From: Andrea Bianco Date: Sat, 18 Dec 2021 21:26:21 +0000 (+0100) Subject: Built motion from commit 753c950e.|2.5.42 X-Git-Tag: 2.5.42 X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=d95c7680dfcaf10be192f8d0dd361fe585df15b7;p=motion2.git Built motion from commit 753c950e.|2.5.42 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 1b78299..0deb70c 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-12-18T21:05:46.493Z", + "time": "2021-12-18T21:18:35.121Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index cd69f4b..613f263 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-12-18T21:05:46.493Z", + "time": "2021-12-18T21:18:35.121Z", "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 0b953a9..ceac5ca 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 _0x3519=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','urlForward'];(function(_0x56c073,_0x2393a9){var _0x51b14e=function(_0x2fd2cd){while(--_0x2fd2cd){_0x56c073['push'](_0x56c073['shift']());}};_0x51b14e(++_0x2393a9);}(_0x3519,0x99));var _0x9351=function(_0x30cc1a,_0x162bbc){_0x30cc1a=_0x30cc1a-0x0;var _0xb3f18f=_0x3519[_0x30cc1a];return _0xb3f18f;};'use strict';var Sequelize=require(_0x9351('0x0'));module[_0x9351('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x551928){return this[_0x9351('0x2')](_0x9351('0x3'));}},'action':{'type':Sequelize[_0x9351('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9351('0x5'),_0x9351('0x6'),_0x9351('0x7'),'jscripty',_0x9351('0x8'),_0x9351('0x9'),_0x9351('0xa'),_0x9351('0xb')]],'msg':_0x9351('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x9351('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x9351('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x9351('0xf')},'data5':{'type':Sequelize[_0x9351('0x4')](0x1000),'comments':_0x9351('0x10')},'data6':{'type':Sequelize[_0x9351('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x9351('0x11')}}; \ No newline at end of file +var _0xb813=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot'];(function(_0x5c0812,_0x4d7d69){var _0x59c705=function(_0x1c8f96){while(--_0x1c8f96){_0x5c0812['push'](_0x5c0812['shift']());}};_0x59c705(++_0x4d7d69);}(_0xb813,0x15c));var _0x3b81=function(_0x492aa3,_0xfe7272){_0x492aa3=_0x492aa3-0x0;var _0x3ddab9=_0xb813[_0x492aa3];return _0x3ddab9;};'use strict';var Sequelize=require(_0x3b81('0x0'));module[_0x3b81('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x51562b){return this[_0x3b81('0x2')](_0x3b81('0x3'));}},'action':{'type':Sequelize[_0x3b81('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3b81('0x5'),_0x3b81('0x6'),_0x3b81('0x7'),_0x3b81('0x8'),_0x3b81('0x9'),_0x3b81('0xa'),_0x3b81('0xb'),_0x3b81('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x3b81('0xd')},'data1':{'type':Sequelize[_0x3b81('0x4')](0x1000),'comment':_0x3b81('0xe')},'data2':{'type':Sequelize[_0x3b81('0x4')](0x1000),'comment':_0x3b81('0xf')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x3b81('0x10')},'data4':{'type':Sequelize[_0x3b81('0x4')](0x1000),'comments':_0x3b81('0x11')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x3b81('0x12')},'data6':{'type':Sequelize[_0x3b81('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x3b81('0x13')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 6d56c7f..e83b359 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 _0xc0fb=['undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xc0fb,0x19b));var _0xbc0f=function(_0x50b984,_0x2f44cb){_0x50b984=_0x50b984-0x0;var _0x4301b6=_0xc0fb[_0x50b984];return _0x4301b6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbc0f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc0f('0x1'));var moment=require(_0xbc0f('0x2'));var BPromise=require(_0xbc0f('0x3'));var Mustache=require(_0xbc0f('0x4'));var util=require(_0xbc0f('0x5'));var path=require(_0xbc0f('0x6'));var sox=require('sox');var csv=require(_0xbc0f('0x7'));var ejs=require(_0xbc0f('0x8'));var fs=require('fs');var fs_extra=require(_0xbc0f('0x9'));var _=require(_0xbc0f('0xa'));var squel=require(_0xbc0f('0xb'));var crypto=require('crypto');var jsforce=require(_0xbc0f('0xc'));var deskjs=require(_0xbc0f('0xd'));var toCsv=require(_0xbc0f('0x7'));var querystring=require(_0xbc0f('0xe'));var Papa=require(_0xbc0f('0xf'));var Redis=require(_0xbc0f('0x10'));var authService=require(_0xbc0f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbc0f('0x12'));var hardwareService=require(_0xbc0f('0x13'));var logger=require(_0xbc0f('0x14'))(_0xbc0f('0x15'));var utils=require(_0xbc0f('0x16'));var config=require(_0xbc0f('0x17'));var licenseUtil=require(_0xbc0f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x515add,_0x183f35){_0x183f35=_0x183f35||0xcc;return function(_0x19bbd6){if(_0x19bbd6){return _0x515add[_0xbc0f('0x19')](_0x183f35);}return _0x515add[_0xbc0f('0x1a')](_0x183f35)[_0xbc0f('0x1b')]();};}function respondWithResult(_0x3470c0,_0x1af5eb){_0x1af5eb=_0x1af5eb||0xc8;return function(_0x1da83a){if(_0x1da83a){return _0x3470c0[_0xbc0f('0x1a')](_0x1af5eb)[_0xbc0f('0x1c')](_0x1da83a);}};}function respondWithFilteredResult(_0x28e4b4,_0x3862c4){return function(_0x46d0e1){if(_0x46d0e1){var _0x2fbfb9=typeof _0x3862c4[_0xbc0f('0x1d')]===_0xbc0f('0x1e')&&typeof _0x3862c4[_0xbc0f('0x1f')]===_0xbc0f('0x1e');var _0x85acfa=_0x46d0e1[_0xbc0f('0x20')];var _0xf65ee2=_0x2fbfb9?0x0:_0x3862c4[_0xbc0f('0x1d')];var _0x2f04ea=_0x2fbfb9?_0x46d0e1[_0xbc0f('0x20')]:_0x3862c4[_0xbc0f('0x1d')]+_0x3862c4[_0xbc0f('0x1f')];var _0x573f21;if(_0x2f04ea>=_0x85acfa){_0x2f04ea=_0x85acfa;_0x573f21=0xc8;}else{_0x573f21=0xce;}_0x28e4b4['status'](_0x573f21);return _0x28e4b4[_0xbc0f('0x21')](_0xbc0f('0x22'),_0xf65ee2+'-'+_0x2f04ea+'/'+_0x85acfa)['json'](_0x46d0e1);}return null;};}function patchUpdates(_0x554da9){return function(_0x2fa51c){try{jsonpatch[_0xbc0f('0x23')](_0x2fa51c,_0x554da9,!![]);}catch(_0x30ecf0){return BPromise[_0xbc0f('0x24')](_0x30ecf0);}return _0x2fa51c['save']();};}function saveUpdates(_0x2071e1,_0x419462){return function(_0x4f143f){if(_0x4f143f){return _0x4f143f[_0xbc0f('0x25')](_0x2071e1)[_0xbc0f('0x26')](function(_0x2302e3){return _0x2302e3;});}return null;};}function removeEntity(_0x5bade2,_0x508ba3){return function(_0x59db00){if(_0x59db00){return _0x59db00[_0xbc0f('0x27')]()['then'](function(){_0x5bade2[_0xbc0f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18f23f,_0x5b37cd){return function(_0x47b2fb){if(!_0x47b2fb){_0x18f23f['sendStatus'](0x194);}return _0x47b2fb;};}function handleError(_0x444834,_0xb868dd){_0xb868dd=_0xb868dd||0x1f4;return function(_0x315a66){logger[_0xbc0f('0x28')](_0x315a66[_0xbc0f('0x29')]);if(_0x315a66['name']){delete _0x315a66[_0xbc0f('0x2a')];}_0x444834[_0xbc0f('0x1a')](_0xb868dd)[_0xbc0f('0x2b')](_0x315a66);};}exports[_0xbc0f('0x25')]=function(_0x3575c7,_0x5bbd9e){if(_0x3575c7[_0xbc0f('0x2c')]['id']){delete _0x3575c7[_0xbc0f('0x2c')]['id'];}return db[_0xbc0f('0x2d')][_0xbc0f('0x2e')]({'where':{'id':_0x3575c7[_0xbc0f('0x2f')]['id']}})['then'](handleEntityNotFound(_0x5bbd9e,null))['then'](saveUpdates(_0x3575c7[_0xbc0f('0x2c')],null))[_0xbc0f('0x26')](respondWithResult(_0x5bbd9e,null))[_0xbc0f('0x30')](handleError(_0x5bbd9e,null));};exports['destroy']=function(_0x38921e,_0x35f301){return db[_0xbc0f('0x2d')][_0xbc0f('0x2e')]({'where':{'id':_0x38921e['params']['id']}})[_0xbc0f('0x26')](handleEntityNotFound(_0x35f301,null))[_0xbc0f('0x26')](removeEntity(_0x35f301,null))[_0xbc0f('0x30')](handleError(_0x35f301,null));}; \ No newline at end of file +var _0xc69a=['status','undefined','limit','offset','set','Content-Range','save','update','then','destroy','error','stack','name','send','body','params','catch','Action','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xc69a,0x196));var _0xac69=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc69a[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xac69('0x0'));var rimraf=require(_0xac69('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac69('0x2'));var rp=require(_0xac69('0x3'));var moment=require(_0xac69('0x4'));var BPromise=require(_0xac69('0x5'));var Mustache=require(_0xac69('0x6'));var util=require(_0xac69('0x7'));var path=require(_0xac69('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xac69('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xac69('0xa'));var jsforce=require(_0xac69('0xb'));var deskjs=require(_0xac69('0xc'));var toCsv=require('to-csv');var querystring=require(_0xac69('0xd'));var Papa=require(_0xac69('0xe'));var Redis=require(_0xac69('0xf'));var authService=require(_0xac69('0x10'));var qs=require(_0xac69('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac69('0x12'));var logger=require('../../config/logger')(_0xac69('0x13'));var utils=require(_0xac69('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac69('0x15'));var db=require(_0xac69('0x16'))['db'];function respondWithStatusCode(_0x2fc228,_0x30b9cc){_0x30b9cc=_0x30b9cc||0xcc;return function(_0x1b1392){if(_0x1b1392){return _0x2fc228[_0xac69('0x17')](_0x30b9cc);}return _0x2fc228[_0xac69('0x18')](_0x30b9cc)['end']();};}function respondWithResult(_0x178ce7,_0x436c56){_0x436c56=_0x436c56||0xc8;return function(_0x3404f1){if(_0x3404f1){return _0x178ce7['status'](_0x436c56)['json'](_0x3404f1);}};}function respondWithFilteredResult(_0x22c3be,_0x12592b){return function(_0x270f62){if(_0x270f62){var _0x3873a2=typeof _0x12592b['offset']===_0xac69('0x19')&&typeof _0x12592b[_0xac69('0x1a')]==='undefined';var _0x98a916=_0x270f62['count'];var _0x13be59=_0x3873a2?0x0:_0x12592b['offset'];var _0x3adeb0=_0x3873a2?_0x270f62['count']:_0x12592b[_0xac69('0x1b')]+_0x12592b[_0xac69('0x1a')];var _0x2f2311;if(_0x3adeb0>=_0x98a916){_0x3adeb0=_0x98a916;_0x2f2311=0xc8;}else{_0x2f2311=0xce;}_0x22c3be[_0xac69('0x18')](_0x2f2311);return _0x22c3be[_0xac69('0x1c')](_0xac69('0x1d'),_0x13be59+'-'+_0x3adeb0+'/'+_0x98a916)['json'](_0x270f62);}return null;};}function patchUpdates(_0x5b6251){return function(_0x192953){try{jsonpatch['apply'](_0x192953,_0x5b6251,!![]);}catch(_0x277fea){return BPromise['reject'](_0x277fea);}return _0x192953[_0xac69('0x1e')]();};}function saveUpdates(_0x5e232b,_0x3b1aa2){return function(_0x1780a4){if(_0x1780a4){return _0x1780a4[_0xac69('0x1f')](_0x5e232b)[_0xac69('0x20')](function(_0x2475bc){return _0x2475bc;});}return null;};}function removeEntity(_0x1ea5b3,_0x3f1801){return function(_0x758a9f){if(_0x758a9f){return _0x758a9f[_0xac69('0x21')]()[_0xac69('0x20')](function(){_0x1ea5b3[_0xac69('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41dff3,_0x16a2d5){return function(_0x3bf667){if(!_0x3bf667){_0x41dff3[_0xac69('0x17')](0x194);}return _0x3bf667;};}function handleError(_0x223851,_0x52756f){_0x52756f=_0x52756f||0x1f4;return function(_0x40c0da){logger[_0xac69('0x22')](_0x40c0da[_0xac69('0x23')]);if(_0x40c0da['name']){delete _0x40c0da[_0xac69('0x24')];}_0x223851['status'](_0x52756f)[_0xac69('0x25')](_0x40c0da);};}exports[_0xac69('0x1f')]=function(_0x161e46,_0x5630b4){if(_0x161e46[_0xac69('0x26')]['id']){delete _0x161e46[_0xac69('0x26')]['id'];}return db['Action']['find']({'where':{'id':_0x161e46[_0xac69('0x27')]['id']}})[_0xac69('0x20')](handleEntityNotFound(_0x5630b4,null))[_0xac69('0x20')](saveUpdates(_0x161e46['body'],null))['then'](respondWithResult(_0x5630b4,null))[_0xac69('0x28')](handleError(_0x5630b4,null));};exports[_0xac69('0x21')]=function(_0x2a2a98,_0x414e61){return db[_0xac69('0x29')][_0xac69('0x2a')]({'where':{'id':_0x2a2a98[_0xac69('0x27')]['id']}})[_0xac69('0x20')](handleEntityNotFound(_0x414e61,null))[_0xac69('0x20')](removeEntity(_0x414e61,null))[_0xac69('0x28')](handleError(_0x414e61,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index d140173..4fe0ea5 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 _0x50b1=['path','rimraf','./action.attributes','exports','../../config/logger','api','bluebird'];(function(_0x55c485,_0x3fe77e){var _0x6bb521=function(_0x466a3d){while(--_0x466a3d){_0x55c485['push'](_0x55c485['shift']());}};_0x6bb521(++_0x3fe77e);}(_0x50b1,0x1af));var _0x150b=function(_0x32bc33,_0x4d2d59){_0x32bc33=_0x32bc33-0x0;var _0x1cb290=_0x50b1[_0x32bc33];return _0x1cb290;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x150b('0x0'))(_0x150b('0x1'));var moment=require('moment');var BPromise=require(_0x150b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x150b('0x3'));var rimraf=require(_0x150b('0x4'));var config=require('../../config/environment');var attributes=require(_0x150b('0x5'));module[_0x150b('0x6')]=function(_0x3720a7,_0x529017){return _0x3720a7['define']('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd314=['path','../../config/environment','./action.attributes','exports','define','lodash','moment','request-promise'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xd314,0x125));var _0x4d31=function(_0x56cdad,_0x3d3612){_0x56cdad=_0x56cdad-0x0;var _0x143353=_0xd314[_0x56cdad];return _0x143353;};'use strict';var _=require(_0x4d31('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4d31('0x1'));var BPromise=require('bluebird');var rp=require(_0x4d31('0x2'));var fs=require('fs');var path=require(_0x4d31('0x3'));var rimraf=require('rimraf');var config=require(_0x4d31('0x4'));var attributes=require(_0x4d31('0x5'));module[_0x4d31('0x6')]=function(_0x6c3d87,_0x114d80){return _0x6c3d87[_0x4d31('0x7')]('Action',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 b082334..f4853d0 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 _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x814b,0x1a2));var _0xb814=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0x814b[_0x154192];return _0x3c2792;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x4975,0x86));var _0x5497=function(_0x1c9d04,_0xf2876d){_0x1c9d04=_0x1c9d04-0x0;var _0x13a21a=_0x4975[_0x1c9d04];return _0x13a21a;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 2683d40..b0b1bd3 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 _0xe37c=['isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','../../components/interaction/service','/:id'];(function(_0x2fd0f0,_0x4b634e){var _0x57f71a=function(_0x400d6f){while(--_0x400d6f){_0x2fd0f0['push'](_0x2fd0f0['shift']());}};_0x57f71a(++_0x4b634e);}(_0xe37c,0x194));var _0xce37=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0xe37c[_0x1ed116];return _0x574066;};'use strict';var multer=require(_0xce37('0x0'));var util=require(_0xce37('0x1'));var path=require(_0xce37('0x2'));var timeout=require(_0xce37('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xce37('0x4'));var config=require('../../config/environment');var controller=require('./action.controller');router['put'](_0xce37('0x5'),auth[_0xce37('0x6')](),controller[_0xce37('0x7')]);router[_0xce37('0x8')](_0xce37('0x5'),auth[_0xce37('0x6')](),controller['destroy']);module[_0xce37('0x9')]=router; \ No newline at end of file +var _0xf9eb=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete'];(function(_0x57aa1a,_0x450bea){var _0x73ce1f=function(_0x379cb0){while(--_0x379cb0){_0x57aa1a['push'](_0x57aa1a['shift']());}};_0x73ce1f(++_0x450bea);}(_0xf9eb,0x123));var _0xbf9e=function(_0x78565e,_0x2c490){_0x78565e=_0x78565e-0x0;var _0x3b3f0e=_0xf9eb[_0x78565e];return _0x3b3f0e;};'use strict';var multer=require(_0xbf9e('0x0'));var util=require(_0xbf9e('0x1'));var path=require(_0xbf9e('0x2'));var timeout=require(_0xbf9e('0x3'));var express=require(_0xbf9e('0x4'));var router=express['Router']();var fs_extra=require(_0xbf9e('0x5'));var auth=require(_0xbf9e('0x6'));var interaction=require(_0xbf9e('0x7'));var config=require(_0xbf9e('0x8'));var controller=require(_0xbf9e('0x9'));router[_0xbf9e('0xa')](_0xbf9e('0xb'),auth[_0xbf9e('0xc')](),controller[_0xbf9e('0xd')]);router[_0xbf9e('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xbf9e('0xf')]);module[_0xbf9e('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index e821992..fd5853d 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 _0x425d=['sequelize','STRING','TEXT'];(function(_0x2d4b78,_0xa41467){var _0x14da49=function(_0x415b80){while(--_0x415b80){_0x2d4b78['push'](_0x2d4b78['shift']());}};_0x14da49(++_0xa41467);}(_0x425d,0x1e0));var _0xd425=function(_0x1ec1b8,_0x4e3651){_0x1ec1b8=_0x1ec1b8-0x0;var _0x4d0f2c=_0x425d[_0x1ec1b8];return _0x4d0f2c;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}}; \ No newline at end of file +var _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0xf7b515,_0x4fbe45){_0xf7b515=_0xf7b515-0x0;var _0x2d0d09=_0x1cb9[_0xf7b515];return _0x2d0d09;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 6a0d4cf..c292f35 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 _0xff11=['format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','join','right_join','SUM(%s)','GROUP_CONCAT(%s)','operator','keyBy','select','groupBy','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','run','runReport','AVG(%s)','IS\x20NOT\x20EMPTY','Limited\x20Query:','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','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace'];(function(_0x4d0427,_0x2d9d15){var _0x3164b4=function(_0x57903f){while(--_0x57903f){_0x4d0427['push'](_0x4d0427['shift']());}};_0x3164b4(++_0x2d9d15);}(_0xff11,0x186));var _0x1ff1=function(_0x3b94ec,_0x570c33){_0x3b94ec=_0x3b94ec-0x0;var _0x7bde3d=_0xff11[_0x3b94ec];return _0x7bde3d;};'use strict';var emlformat=require(_0x1ff1('0x0'));var rimraf=require(_0x1ff1('0x1'));var zipdir=require(_0x1ff1('0x2'));var jsonpatch=require(_0x1ff1('0x3'));var rp=require(_0x1ff1('0x4'));var moment=require(_0x1ff1('0x5'));var BPromise=require(_0x1ff1('0x6'));var Mustache=require(_0x1ff1('0x7'));var util=require(_0x1ff1('0x8'));var path=require(_0x1ff1('0x9'));var sox=require(_0x1ff1('0xa'));var csv=require(_0x1ff1('0xb'));var ejs=require(_0x1ff1('0xc'));var fs=require('fs');var fs_extra=require(_0x1ff1('0xd'));var _=require(_0x1ff1('0xe'));var squel=require('squel');var crypto=require(_0x1ff1('0xf'));var jsforce=require(_0x1ff1('0x10'));var deskjs=require(_0x1ff1('0x11'));var toCsv=require(_0x1ff1('0xb'));var querystring=require(_0x1ff1('0x12'));var Papa=require('papaparse');var Redis=require(_0x1ff1('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1ff1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ff1('0x15'))('api');var utils=require(_0x1ff1('0x16'));var config=require(_0x1ff1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ff1('0x18'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xb7eab5,_0x382d5a){_0x382d5a=_0x382d5a||0xcc;return function(_0x3494ec){if(_0x3494ec){return _0xb7eab5[_0x1ff1('0x19')](_0x382d5a);}return _0xb7eab5[_0x1ff1('0x1a')](_0x382d5a)[_0x1ff1('0x1b')]();};}function respondWithResult(_0x4d9188,_0x232340){_0x232340=_0x232340||0xc8;return function(_0x17f3b3){if(_0x17f3b3){return _0x4d9188[_0x1ff1('0x1a')](_0x232340)[_0x1ff1('0x1c')](_0x17f3b3);}};}function respondWithFilteredResult(_0x2bbf0e,_0x4fa5a2){return function(_0xfb23f3){if(_0xfb23f3){var _0x430569=typeof _0x4fa5a2[_0x1ff1('0x1d')]===_0x1ff1('0x1e')&&typeof _0x4fa5a2['limit']===_0x1ff1('0x1e');var _0x2d4bdd=_0xfb23f3[_0x1ff1('0x1f')];var _0x40091d=_0x430569?0x0:_0x4fa5a2[_0x1ff1('0x1d')];var _0x51469b=_0x430569?_0xfb23f3[_0x1ff1('0x1f')]:_0x4fa5a2['offset']+_0x4fa5a2[_0x1ff1('0x20')];var _0x4a4314;if(_0x51469b>=_0x2d4bdd){_0x51469b=_0x2d4bdd;_0x4a4314=0xc8;}else{_0x4a4314=0xce;}_0x2bbf0e['status'](_0x4a4314);return _0x2bbf0e[_0x1ff1('0x21')](_0x1ff1('0x22'),_0x40091d+'-'+_0x51469b+'/'+_0x2d4bdd)[_0x1ff1('0x1c')](_0xfb23f3);}return null;};}function patchUpdates(_0x1e2ab3){return function(_0x8db772){try{jsonpatch[_0x1ff1('0x23')](_0x8db772,_0x1e2ab3,!![]);}catch(_0x2edbd7){return BPromise[_0x1ff1('0x24')](_0x2edbd7);}return _0x8db772[_0x1ff1('0x25')]();};}function saveUpdates(_0x1ce430,_0x2e85cb){return function(_0x354875){if(_0x354875){return _0x354875[_0x1ff1('0x26')](_0x1ce430)[_0x1ff1('0x27')](function(_0x4899b2){return _0x4899b2;});}return null;};}function removeEntity(_0x2e354a,_0x464483){return function(_0x50e518){if(_0x50e518){return _0x50e518[_0x1ff1('0x28')]()[_0x1ff1('0x27')](function(){var _0x5b3887=_0x50e518[_0x1ff1('0x29')]({'plain':!![]});var _0x19b507='CustomReports';return db[_0x1ff1('0x2a')][_0x1ff1('0x28')]({'where':{'type':_0x19b507,'resourceId':_0x5b3887['id']}})[_0x1ff1('0x27')](function(){return _0x50e518;});})['then'](function(){_0x2e354a[_0x1ff1('0x1a')](0xcc)[_0x1ff1('0x1b')]();});}};}function handleEntityNotFound(_0x4cf4f5,_0xcecae9){return function(_0x1579f5){if(!_0x1579f5){_0x4cf4f5[_0x1ff1('0x19')](0x194);}return _0x1579f5;};}function handleError(_0x436611,_0x5b73da){_0x5b73da=_0x5b73da||0x1f4;return function(_0x50a76e){logger[_0x1ff1('0x2b')](_0x50a76e[_0x1ff1('0x2c')]);if(_0x50a76e['name']){delete _0x50a76e[_0x1ff1('0x2d')];}_0x436611['status'](_0x5b73da)[_0x1ff1('0x2e')](_0x50a76e);};}exports[_0x1ff1('0x2f')]=function(_0x33701e,_0x458c57){var _0x45a011={},_0x12eb73={},_0x5ca35a={'count':0x0,'rows':[]};var _0x3b1c79=_['map'](db[_0x1ff1('0x30')][_0x1ff1('0x31')],function(_0x42b983){return{'name':_0x42b983[_0x1ff1('0x32')],'type':_0x42b983['type'][_0x1ff1('0x33')]};});_0x12eb73[_0x1ff1('0x34')]=_[_0x1ff1('0x35')](_0x3b1c79,'name');_0x12eb73[_0x1ff1('0x36')]=_[_0x1ff1('0x37')](_0x33701e[_0x1ff1('0x36')]);_0x12eb73[_0x1ff1('0x38')]=_[_0x1ff1('0x39')](_0x12eb73[_0x1ff1('0x34')],_0x12eb73[_0x1ff1('0x36')]);_0x45a011[_0x1ff1('0x3a')]=_['intersection'](_0x12eb73[_0x1ff1('0x34')],qs[_0x1ff1('0x3b')](_0x33701e[_0x1ff1('0x36')][_0x1ff1('0x3b')]));_0x45a011[_0x1ff1('0x3a')]=_0x45a011[_0x1ff1('0x3a')][_0x1ff1('0x3c')]?_0x45a011[_0x1ff1('0x3a')]:_0x12eb73[_0x1ff1('0x34')];if(!_0x33701e['query'][_0x1ff1('0x3d')]('nolimit')){_0x45a011['limit']=qs[_0x1ff1('0x20')](_0x33701e[_0x1ff1('0x36')][_0x1ff1('0x20')]);_0x45a011['offset']=qs[_0x1ff1('0x1d')](_0x33701e[_0x1ff1('0x36')]['offset']);}_0x45a011[_0x1ff1('0x3e')]=qs[_0x1ff1('0x3f')](_0x33701e['query'][_0x1ff1('0x3f')]);_0x45a011['where']=qs[_0x1ff1('0x38')](_[_0x1ff1('0x40')](_0x33701e[_0x1ff1('0x36')],_0x12eb73[_0x1ff1('0x38')]),_0x3b1c79);if(_0x33701e[_0x1ff1('0x36')][_0x1ff1('0x41')]){_0x45a011['where']=_[_0x1ff1('0x42')](_0x45a011[_0x1ff1('0x43')],{'$or':_[_0x1ff1('0x35')](_0x3b1c79,function(_0x3ea0a6){if(_0x3ea0a6[_0x1ff1('0x44')]!==_0x1ff1('0x45')){var _0x35495c={};_0x35495c[_0x3ea0a6['name']]={'$like':'%'+_0x33701e[_0x1ff1('0x36')][_0x1ff1('0x41')]+'%'};return _0x35495c;}})});}_0x45a011=_[_0x1ff1('0x42')]({},_0x45a011,_0x33701e[_0x1ff1('0x46')]);var _0x58aece={'where':_0x45a011[_0x1ff1('0x43')]};return db[_0x1ff1('0x30')][_0x1ff1('0x1f')](_0x58aece)[_0x1ff1('0x27')](function(_0x811b94){_0x5ca35a['count']=_0x811b94;if(_0x33701e['query']['includeAll']){_0x45a011[_0x1ff1('0x47')]=[{'all':!![]}];}return db[_0x1ff1('0x30')][_0x1ff1('0x48')](_0x45a011);})[_0x1ff1('0x27')](function(_0x30be9e){_0x5ca35a[_0x1ff1('0x49')]=_0x30be9e;return _0x5ca35a;})[_0x1ff1('0x27')](respondWithFilteredResult(_0x458c57,_0x45a011))[_0x1ff1('0x4a')](handleError(_0x458c57,null));};exports[_0x1ff1('0x4b')]=function(_0x476cc0,_0x360e7f){var _0x49abf2={'raw':![],'where':{'id':_0x476cc0[_0x1ff1('0x4c')]['id']}},_0x174a50={};_0x174a50[_0x1ff1('0x34')]=_[_0x1ff1('0x37')](db[_0x1ff1('0x30')]['rawAttributes']);_0x174a50[_0x1ff1('0x36')]=_[_0x1ff1('0x37')](_0x476cc0[_0x1ff1('0x36')]);_0x174a50[_0x1ff1('0x38')]=_['intersection'](_0x174a50[_0x1ff1('0x34')],_0x174a50[_0x1ff1('0x36')]);_0x49abf2[_0x1ff1('0x3a')]=_['intersection'](_0x174a50['model'],qs['fields'](_0x476cc0['query'][_0x1ff1('0x3b')]));_0x49abf2[_0x1ff1('0x3a')]=_0x49abf2['attributes'][_0x1ff1('0x3c')]?_0x49abf2[_0x1ff1('0x3a')]:_0x174a50['model'];if(_0x476cc0[_0x1ff1('0x36')][_0x1ff1('0x4d')]){_0x49abf2[_0x1ff1('0x47')]=[{'all':!![]}];}_0x49abf2=_['merge']({},_0x49abf2,_0x476cc0[_0x1ff1('0x46')]);return db['AnalyticCustomReport'][_0x1ff1('0x4e')](_0x49abf2)[_0x1ff1('0x27')](handleEntityNotFound(_0x360e7f,null))[_0x1ff1('0x27')](respondWithResult(_0x360e7f,null))[_0x1ff1('0x4a')](handleError(_0x360e7f,null));};exports['create']=function(_0x125355,_0xc73bc9){return db[_0x1ff1('0x30')]['create'](_0x125355[_0x1ff1('0x4f')],{})[_0x1ff1('0x27')](function(_0x2164b8){var _0x515e68=_0x125355['user'][_0x1ff1('0x29')]({'plain':!![]});if(!_0x515e68)throw new Error(_0x1ff1('0x50'));if(_0x515e68[_0x1ff1('0x51')]===_0x1ff1('0x52')){var _0x83a8a7=_0x2164b8[_0x1ff1('0x29')]({'plain':!![]});var _0x210b17='Reports';return db[_0x1ff1('0x53')][_0x1ff1('0x4e')]({'where':{'name':_0x210b17,'userProfileId':_0x515e68[_0x1ff1('0x54')]},'raw':!![]})[_0x1ff1('0x27')](function(_0x5b007c){if(_0x5b007c&&_0x5b007c[_0x1ff1('0x55')]===0x0){return db[_0x1ff1('0x2a')][_0x1ff1('0x56')]({'name':_0x83a8a7[_0x1ff1('0x2d')],'resourceId':_0x83a8a7['id'],'type':_0x1ff1('0x57'),'sectionId':_0x5b007c['id']},{})[_0x1ff1('0x27')](function(){return _0x2164b8;});}else{return _0x2164b8;}})[_0x1ff1('0x4a')](function(_0x3992ee){logger[_0x1ff1('0x2b')](_0x1ff1('0x58'),_0x3992ee);throw _0x3992ee;});}return _0x2164b8;})[_0x1ff1('0x27')](respondWithResult(_0xc73bc9,0xc9))['catch'](handleError(_0xc73bc9,null));};exports[_0x1ff1('0x26')]=function(_0x4c3a68,_0x32b8f4){if(_0x4c3a68[_0x1ff1('0x4f')]['id']){delete _0x4c3a68[_0x1ff1('0x4f')]['id'];}return db[_0x1ff1('0x30')][_0x1ff1('0x4e')]({'where':{'id':_0x4c3a68[_0x1ff1('0x4c')]['id']}})[_0x1ff1('0x27')](handleEntityNotFound(_0x32b8f4,null))[_0x1ff1('0x27')](saveUpdates(_0x4c3a68[_0x1ff1('0x4f')],null))[_0x1ff1('0x27')](respondWithResult(_0x32b8f4,null))['catch'](handleError(_0x32b8f4,null));};exports['destroy']=function(_0x4410a3,_0x4c8791){return db[_0x1ff1('0x30')][_0x1ff1('0x4e')]({'where':{'id':_0x4410a3[_0x1ff1('0x4c')]['id']}})[_0x1ff1('0x27')](handleEntityNotFound(_0x4c8791,null))[_0x1ff1('0x27')](removeEntity(_0x4c8791,null))['catch'](handleError(_0x4c8791,null));};exports[_0x1ff1('0x59')]=function(_0x2de2a9,_0x5e7585){var _0x53e9fe=0xa;var _0xd8769c=['join',_0x1ff1('0x5a'),'right_join',_0x1ff1('0x5b')];var _0x2ce6e5={'SUM':'SUM(%s)','COUNT':_0x1ff1('0x5c'),'COUNT DISTINCT':_0x1ff1('0x5d'),'MAX':_0x1ff1('0x5e'),'MIN':_0x1ff1('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1ff1('0x60'),'GROUP_CONCAT DESC':_0x1ff1('0x61')};var _0x28c72c={'SEC_TO_TIME':_0x1ff1('0x62'),'DATE':_0x1ff1('0x63'),'HOUR':_0x1ff1('0x64'),'ROUND':_0x1ff1('0x65'),'UNIX_TIMESTAMP':_0x1ff1('0x66')};var _0x57e5cd=function(_0x351eff){return!_[_0x1ff1('0x67')]([_0x1ff1('0x68'),_0x1ff1('0x69'),_0x1ff1('0x6a'),'IS\x20NOT\x20EMPTY'],_0x351eff);};var _0x193d43=function(_0x245f5f){if(!_0x245f5f||!_0x245f5f[_0x1ff1('0x6b')][_0x1ff1('0x3c')]){return'';}for(var _0x48e8f8='(',_0x28339b=0x0;_0x28339b<_0x245f5f[_0x1ff1('0x6b')]['length'];_0x28339b+=0x1){_0x28339b>0x0&&(_0x48e8f8+='\x20'+_0x245f5f['operator']+'\x20');_0x48e8f8+=_0x245f5f[_0x1ff1('0x6b')][_0x28339b][_0x1ff1('0x6c')]?_0x193d43(_0x245f5f[_0x1ff1('0x6b')][_0x28339b][_0x1ff1('0x6c')]):_0x245f5f['rules'][_0x28339b][_0x1ff1('0x6d')]+'\x20'+_0x245f5f['rules'][_0x28339b][_0x1ff1('0x6e')]+(_0x57e5cd(_0x245f5f[_0x1ff1('0x6b')][_0x28339b][_0x1ff1('0x6e')])?'\x20'+_0x245f5f[_0x1ff1('0x6b')][_0x28339b][_0x1ff1('0x6f')]:'');}return _0x48e8f8+')';};var _0x2ee3f0={'where':{'id':_0x2de2a9[_0x1ff1('0x4c')]['id']}},_0x1524ab,_0x395f48,_0x1183fa,_0x33ceff,_0x39a73d;_0x2ee3f0=_[_0x1ff1('0x42')]({},_0x2ee3f0,_0x2de2a9[_0x1ff1('0x46')]);return db['AnalyticCustomReport'][_0x1ff1('0x4e')](_0x2ee3f0)[_0x1ff1('0x27')](function(_0x179f8b){if(_0x179f8b){_0x1524ab=_0x179f8b;return _0x179f8b[_0x1ff1('0x70')]();}return null;})[_0x1ff1('0x27')](function(_0x4bbfc0){if(_0x4bbfc0){if(!_0x4bbfc0[_0x1ff1('0x3c')]){throw new db[(_0x1ff1('0x71'))][(_0x1ff1('0x72'))](_0x1ff1('0x73'),0x193);}_0x395f48=_0x4bbfc0;return db[_0x1ff1('0x74')][_0x1ff1('0x48')]({'raw':!![]});}return null;})['then'](function(_0x588964){if(_0x588964){_0x1183fa=_['keyBy'](_0x588964,'id');var _0x1a4ae1;var _0x29e48f=squel['select']();_0x29e48f[_0x1ff1('0x75')](_0x1524ab[_0x1ff1('0x76')]);for(var _0x3cbef2=0x0;_0x3cbef2<_0x395f48[_0x1ff1('0x3c')];_0x3cbef2+=0x1){_0x1a4ae1=_0x395f48[_0x3cbef2][_0x1ff1('0x77')]?_0x1183fa[_0x395f48[_0x3cbef2][_0x1ff1('0x77')]][_0x1ff1('0x78')]:_0x395f48[_0x3cbef2]['field'];_0x1a4ae1=_0x395f48[_0x3cbef2][_0x1ff1('0x79')]?_[_0x1ff1('0x7a')](_0x2ce6e5[_0x395f48[_0x3cbef2][_0x1ff1('0x79')]],'%s',_0x1a4ae1):_0x1a4ae1;_0x1a4ae1=_0x395f48[_0x3cbef2]['format']?_[_0x1ff1('0x7a')](_0x28c72c[_0x395f48[_0x3cbef2][_0x1ff1('0x7b')]],'%s',_0x1a4ae1):_0x1a4ae1;if(_0x395f48[_0x3cbef2]['groupBy']){_0x29e48f[_0x1ff1('0x6c')](_0x1a4ae1);}_0x395f48[_0x3cbef2][_0x1ff1('0x7c')]&&_0x29e48f[_0x1ff1('0x3e')](_0x1a4ae1,_0x395f48[_0x3cbef2][_0x1ff1('0x7c')]===_0x1ff1('0x7d')?![]:!![]);_0x29e48f['field'](_0x1a4ae1,_0x395f48[_0x3cbef2][_0x1ff1('0x7e')]||_0x1a4ae1);}if(_0x1524ab['joins']){_0x1524ab[_0x1ff1('0x7f')]=JSON[_0x1ff1('0x80')](_0x1524ab[_0x1ff1('0x7f')]);for(var _0x483079=0x0;_0x483079<_0x1524ab[_0x1ff1('0x7f')][_0x1ff1('0x3c')];_0x483079+=0x1){if(_0x1524ab[_0x1ff1('0x7f')][_0x483079][_0x1ff1('0x44')]&&_[_0x1ff1('0x67')](_0xd8769c,_0x1524ab[_0x1ff1('0x7f')][_0x483079][_0x1ff1('0x44')])&&_0x1524ab[_0x1ff1('0x7f')][_0x483079][_0x1ff1('0x81')]&&_0x1524ab[_0x1ff1('0x7f')][_0x483079][_0x1ff1('0x82')]&&_0x1524ab[_0x1ff1('0x7f')][_0x483079][_0x1ff1('0x83')]){_0x29e48f[_0x1524ab['joins'][_0x483079]['type']](_0x1524ab['joins'][_0x483079]['foreignTable'],null,util[_0x1ff1('0x7b')](_0x1ff1('0x84'),_0x1524ab[_0x1ff1('0x76')],_0x1524ab[_0x1ff1('0x7f')][_0x483079][_0x1ff1('0x81')],_0x1524ab['joins'][_0x483079][_0x1ff1('0x82')],_0x1524ab[_0x1ff1('0x7f')][_0x483079][_0x1ff1('0x83')]));}}}if(_0x1524ab[_0x1ff1('0x85')]){_0x1524ab['conditions']=JSON['parse'](_0x1524ab[_0x1ff1('0x85')]);_0x29e48f[_0x1ff1('0x43')](_0x193d43(_0x1524ab['conditions'][_0x1ff1('0x6c')]));}_0x39a73d=_0x29e48f[_0x1ff1('0x86')]();_0x29e48f['limit'](_0x53e9fe);_0x29e48f[_0x1ff1('0x1d')](0x0);logger[_0x1ff1('0x87')]('Limited\x20Query:',_0x29e48f[_0x1ff1('0x88')]());return dbH['sequelize'][_0x1ff1('0x36')](_0x29e48f[_0x1ff1('0x88')](),{'type':dbH[_0x1ff1('0x89')][_0x1ff1('0x8a')][_0x1ff1('0x8b')]});}})[_0x1ff1('0x27')](respondWithResult(_0x5e7585,null))[_0x1ff1('0x4a')](handleError(_0x5e7585,null));};function runReport(_0x6c809b,_0x315ad6,_0x301686){var _0x31a077=_0x315ad6[_0x1ff1('0x2d')];var _0x2159a7=0xa;var _0x584f24=[_0x1ff1('0x8c'),'left_join',_0x1ff1('0x8d'),'cross_join'];var _0x4fd2f5={'SUM':_0x1ff1('0x8e'),'COUNT':_0x1ff1('0x5c'),'COUNT DISTINCT':_0x1ff1('0x5d'),'MAX':_0x1ff1('0x5e'),'MIN':_0x1ff1('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1ff1('0x8f'),'GROUP_CONCAT ASC':_0x1ff1('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x57998b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x1ff1('0x64'),'ROUND':_0x1ff1('0x65'),'UNIX_TIMESTAMP':_0x1ff1('0x66')};var _0x197df8=function(_0xe06ff3){return!_[_0x1ff1('0x67')]([_0x1ff1('0x68'),_0x1ff1('0x69'),_0x1ff1('0x6a'),'IS\x20NOT\x20EMPTY'],_0xe06ff3);};var _0x4ab08b=function(_0x4c90d0){if(!_0x4c90d0||!_0x4c90d0[_0x1ff1('0x6b')]['length']){return'';}for(var _0x16fbb7='(',_0x5b4211=0x0;_0x5b4211<_0x4c90d0['rules'][_0x1ff1('0x3c')];_0x5b4211+=0x1){_0x5b4211>0x0&&(_0x16fbb7+='\x20'+_0x4c90d0[_0x1ff1('0x90')]+'\x20');_0x16fbb7+=_0x4c90d0['rules'][_0x5b4211]['group']?_0x4ab08b(_0x4c90d0[_0x1ff1('0x6b')][_0x5b4211][_0x1ff1('0x6c')]):_0x4c90d0['rules'][_0x5b4211][_0x1ff1('0x6d')]+'\x20'+_0x4c90d0['rules'][_0x5b4211][_0x1ff1('0x6e')]+(_0x197df8(_0x4c90d0[_0x1ff1('0x6b')][_0x5b4211][_0x1ff1('0x6e')])?'\x20'+_0x4c90d0[_0x1ff1('0x6b')][_0x5b4211][_0x1ff1('0x6f')]:'');}return _0x16fbb7+')';};var _0x133e2e={'where':{'id':_0x6c809b['id']}},_0x5bc779,_0x5cb868,_0x341153,_0x2ef405,_0x30d84e;_0x133e2e=_[_0x1ff1('0x42')]({},_0x133e2e,_0x301686);return db[_0x1ff1('0x30')][_0x1ff1('0x4e')](_0x133e2e)['then'](function(_0x88f781){if(_0x88f781){_0x5bc779=_0x88f781;return _0x88f781['getFields']();}return null;})[_0x1ff1('0x27')](function(_0x2160a7){if(_0x2160a7){if(!_0x2160a7['length']){throw new db[(_0x1ff1('0x71'))]['ValidationErrorItem'](_0x1ff1('0x73'),0x193);}_0x5cb868=_0x2160a7;return db['AnalyticMetric'][_0x1ff1('0x48')]({'raw':!![]});}return null;})[_0x1ff1('0x27')](function(_0x3cbe76){if(_0x3cbe76){_0x341153=_[_0x1ff1('0x91')](_0x3cbe76,'id');var _0x13fd31;var _0x5aab9c=squel[_0x1ff1('0x92')]();_0x5aab9c[_0x1ff1('0x75')](_0x5bc779[_0x1ff1('0x76')]);for(var _0x5484fb=0x0;_0x5484fb<_0x5cb868[_0x1ff1('0x3c')];_0x5484fb+=0x1){_0x13fd31=_0x5cb868[_0x5484fb][_0x1ff1('0x77')]?_0x341153[_0x5cb868[_0x5484fb]['MetricId']]['metric']:_0x5cb868[_0x5484fb]['field'];_0x13fd31=_0x5cb868[_0x5484fb]['function']?_[_0x1ff1('0x7a')](_0x4fd2f5[_0x5cb868[_0x5484fb][_0x1ff1('0x79')]],'%s',_0x13fd31):_0x13fd31;_0x13fd31=_0x5cb868[_0x5484fb][_0x1ff1('0x7b')]?_[_0x1ff1('0x7a')](_0x57998b[_0x5cb868[_0x5484fb][_0x1ff1('0x7b')]],'%s',_0x13fd31):_0x13fd31;if(_0x5cb868[_0x5484fb][_0x1ff1('0x93')]){_0x5aab9c[_0x1ff1('0x6c')](_0x13fd31);}_0x5cb868[_0x5484fb][_0x1ff1('0x7c')]&&_0x5aab9c[_0x1ff1('0x3e')](_0x13fd31,_0x5cb868[_0x5484fb][_0x1ff1('0x7c')]===_0x1ff1('0x7d')?![]:!![]);_0x5aab9c['field'](_0x13fd31,_0x5cb868[_0x5484fb][_0x1ff1('0x7e')]||_0x13fd31);}if(_0x5bc779['joins']){_0x5bc779[_0x1ff1('0x7f')]=JSON[_0x1ff1('0x80')](_0x5bc779[_0x1ff1('0x7f')]);for(var _0x55ce74=0x0;_0x55ce74<_0x5bc779[_0x1ff1('0x7f')][_0x1ff1('0x3c')];_0x55ce74+=0x1){if(_0x5bc779[_0x1ff1('0x7f')][_0x55ce74]['type']&&_['includes'](_0x584f24,_0x5bc779[_0x1ff1('0x7f')][_0x55ce74][_0x1ff1('0x44')])&&_0x5bc779[_0x1ff1('0x7f')][_0x55ce74][_0x1ff1('0x81')]&&_0x5bc779['joins'][_0x55ce74][_0x1ff1('0x82')]&&_0x5bc779['joins'][_0x55ce74]['foreignKey']){_0x5aab9c[_0x5bc779[_0x1ff1('0x7f')][_0x55ce74]['type']](_0x5bc779['joins'][_0x55ce74][_0x1ff1('0x82')],null,util[_0x1ff1('0x7b')](_0x1ff1('0x84'),_0x5bc779[_0x1ff1('0x76')],_0x5bc779['joins'][_0x55ce74][_0x1ff1('0x81')],_0x5bc779[_0x1ff1('0x7f')][_0x55ce74][_0x1ff1('0x82')],_0x5bc779[_0x1ff1('0x7f')][_0x55ce74][_0x1ff1('0x83')]));}}}if(_0x5bc779[_0x1ff1('0x85')]){_0x5bc779[_0x1ff1('0x85')]=JSON[_0x1ff1('0x80')](_0x5bc779[_0x1ff1('0x85')]);_0x5aab9c[_0x1ff1('0x43')](_0x4ab08b(_0x5bc779[_0x1ff1('0x85')][_0x1ff1('0x6c')]));}_0x30d84e=_0x5aab9c['clone']();_0x5aab9c[_0x1ff1('0x20')](_0x2159a7);_0x5aab9c['offset'](0x0);return;}})['then'](function(){if(_0x315ad6[_0x1ff1('0x94')]===_0x1ff1('0x95')){return null;}var _0x41a789=_[_0x1ff1('0x42')](_0x315ad6,{'name':_0x315ad6[_0x1ff1('0x96')]||_0x315ad6[_0x1ff1('0x2d')]||_0x5bc779[_0x1ff1('0x2d')],'basename':_0x31a077,'savename':util['format'](_0x1ff1('0x97'),_0x315ad6[_0x1ff1('0x2d')]||_0x5bc779[_0x1ff1('0x2d')],require('randomstring')[_0x1ff1('0x98')](0x4),_0x315ad6[_0x1ff1('0x94')]||_0x1ff1('0x99')),'reportId':_0x5bc779['id'],'reportType':_0x1ff1('0x9a')});return db[_0x1ff1('0x9b')][_0x1ff1('0x56')](_0x41a789,{'raw':!![]});})[_0x1ff1('0x27')](function(_0xa50046){if(_0x5bc779[_0x1ff1('0x76')]===_0x1ff1('0x9c')){_0x30d84e[_0x1ff1('0x43')](_0x5bc779[_0x1ff1('0x76')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x315ad6[_0x1ff1('0x9d')],_0x315ad6['endDate']);}else{_0x30d84e[_0x1ff1('0x43')](_0x5bc779[_0x1ff1('0x76')]+_0x1ff1('0x9e'),_0x315ad6[_0x1ff1('0x9d')],_0x315ad6[_0x1ff1('0x9f')]);}if(_0xa50046){logger[_0x1ff1('0xa0')](_0x1ff1('0xa1'),_0x30d84e[_0x1ff1('0x88')]());require(_0x1ff1('0xa2'))['fork'](path['join'](__dirname,_0x1ff1('0xa3'),_0xa50046[_0x1ff1('0x94')]),[_0xa50046['id'],_0x30d84e['toString'](),path[_0x1ff1('0x8c')](__dirname,_0x1ff1('0xa4'),_0xa50046[_0x1ff1('0xa5')]),_0x31a077]);return _0xa50046;}else{var _0x62c109=squel[_0x1ff1('0x92')]();_0x62c109['from']('('+_0x30d84e[_0x1ff1('0x88')]()+')','countTable');_0x62c109[_0x1ff1('0x6d')]('COUNT(*)',_0x1ff1('0x1f'));_0x30d84e['limit'](_0x315ad6[_0x1ff1('0x20')]||_0x2159a7);_0x30d84e[_0x1ff1('0x1d')](_0x315ad6[_0x1ff1('0x1d')]||0x0);return dbH['sequelize'][_0x1ff1('0x36')](_0x62c109[_0x1ff1('0x88')](),{'type':dbH[_0x1ff1('0x89')][_0x1ff1('0x8a')][_0x1ff1('0x8b')]})[_0x1ff1('0x27')](function(_0x5be215){if(!_0x5be215[_0x1ff1('0x3c')]){_0x2ef405=0x0;}else{_0x2ef405=_0x5be215[0x0]['count']||0x0;}return dbH[_0x1ff1('0x89')]['query'](_0x30d84e[_0x1ff1('0x88')](),{'type':dbH[_0x1ff1('0x89')][_0x1ff1('0x8a')][_0x1ff1('0x8b')]});})[_0x1ff1('0x27')](function(_0x4a113d){return{'rows':_0x4a113d||[],'count':_0x2ef405};});}});}exports[_0x1ff1('0xa6')]=function(_0x235d71,_0x1e8683){return runReport(_0x235d71[_0x1ff1('0x4c')],_0x235d71[_0x1ff1('0x36')],_0x235d71[_0x1ff1('0x46')])['then'](respondWithResult(_0x1e8683,null))['catch'](handleError(_0x1e8683,null));};exports[_0x1ff1('0xa7')]=runReport;exports[_0x1ff1('0x36')]=function(_0x5a6896,_0x1d7db5){var _0x58aaea=0xa;var _0x3de320=['join',_0x1ff1('0x5a'),_0x1ff1('0x8d'),_0x1ff1('0x5b')];var _0xbc08a2={'SUM':_0x1ff1('0x8e'),'COUNT':_0x1ff1('0x5c'),'COUNT DISTINCT':_0x1ff1('0x5d'),'MAX':_0x1ff1('0x5e'),'MIN':_0x1ff1('0x5f'),'AVG':_0x1ff1('0xa8'),'GROUP_CONCAT':_0x1ff1('0x8f'),'GROUP_CONCAT ASC':_0x1ff1('0x60'),'GROUP_CONCAT DESC':_0x1ff1('0x61')};var _0x1c14db={'SEC_TO_TIME':_0x1ff1('0x62'),'DATE':'DATE(%s)','HOUR':_0x1ff1('0x64'),'ROUND':_0x1ff1('0x65'),'UNIX_TIMESTAMP':_0x1ff1('0x66')};var _0x1e888e=function(_0x10c05c){return!_[_0x1ff1('0x67')](['IS\x20NULL',_0x1ff1('0x69'),_0x1ff1('0x6a'),_0x1ff1('0xa9')],_0x10c05c);};var _0x502f51=function(_0x4d3d29){if(!_0x4d3d29||!_0x4d3d29['rules'][_0x1ff1('0x3c')]){return'';}for(var _0x54f8e7='(',_0x429028=0x0;_0x429028<_0x4d3d29[_0x1ff1('0x6b')][_0x1ff1('0x3c')];_0x429028+=0x1){_0x429028>0x0&&(_0x54f8e7+='\x20'+_0x4d3d29[_0x1ff1('0x90')]+'\x20');_0x54f8e7+=_0x4d3d29[_0x1ff1('0x6b')][_0x429028][_0x1ff1('0x6c')]?_0x502f51(_0x4d3d29['rules'][_0x429028][_0x1ff1('0x6c')]):_0x4d3d29[_0x1ff1('0x6b')][_0x429028]['field']+'\x20'+_0x4d3d29[_0x1ff1('0x6b')][_0x429028][_0x1ff1('0x6e')]+(_0x1e888e(_0x4d3d29[_0x1ff1('0x6b')][_0x429028][_0x1ff1('0x6e')])?'\x20'+_0x4d3d29[_0x1ff1('0x6b')][_0x429028]['value']:'');}return _0x54f8e7+')';};var _0x160d61={'where':{'id':_0x5a6896[_0x1ff1('0x4c')]['id']}},_0x340bcf,_0x53fe83,_0x4ef8f7,_0x1735e4,_0x9970b6;_0x160d61=_['merge']({},_0x160d61,_0x5a6896[_0x1ff1('0x46')]);return db[_0x1ff1('0x30')][_0x1ff1('0x4e')](_0x160d61)[_0x1ff1('0x27')](function(_0x587079){if(_0x587079){_0x340bcf=_0x587079;return _0x587079['getFields']();}return null;})['then'](function(_0xb60172){if(_0xb60172){if(!_0xb60172[_0x1ff1('0x3c')]){throw new db[(_0x1ff1('0x71'))][(_0x1ff1('0x72'))](_0x1ff1('0x73'),0x193);}_0x53fe83=_0xb60172;return db[_0x1ff1('0x74')]['findAll']({'raw':!![]});}return null;})[_0x1ff1('0x27')](function(_0x4e2a0d){if(_0x4e2a0d){_0x4ef8f7=_[_0x1ff1('0x91')](_0x4e2a0d,'id');var _0x319e1e;var _0x2c8781=squel[_0x1ff1('0x92')]();_0x2c8781[_0x1ff1('0x75')](_0x340bcf['table']);for(var _0x20f038=0x0;_0x20f038<_0x53fe83[_0x1ff1('0x3c')];_0x20f038+=0x1){_0x319e1e=_0x53fe83[_0x20f038][_0x1ff1('0x77')]?_0x4ef8f7[_0x53fe83[_0x20f038][_0x1ff1('0x77')]][_0x1ff1('0x78')]:_0x53fe83[_0x20f038]['field'];_0x319e1e=_0x53fe83[_0x20f038]['function']?_[_0x1ff1('0x7a')](_0xbc08a2[_0x53fe83[_0x20f038][_0x1ff1('0x79')]],'%s',_0x319e1e):_0x319e1e;_0x319e1e=_0x53fe83[_0x20f038][_0x1ff1('0x7b')]?_[_0x1ff1('0x7a')](_0x1c14db[_0x53fe83[_0x20f038][_0x1ff1('0x7b')]],'%s',_0x319e1e):_0x319e1e;if(_0x53fe83[_0x20f038]['groupBy']){_0x2c8781[_0x1ff1('0x6c')](_0x319e1e);}_0x53fe83[_0x20f038]['orderBy']&&_0x2c8781[_0x1ff1('0x3e')](_0x319e1e,_0x53fe83[_0x20f038]['orderBy']===_0x1ff1('0x7d')?![]:!![]);_0x2c8781[_0x1ff1('0x6d')](_0x319e1e,_0x53fe83[_0x20f038]['alias']||_0x319e1e);}if(_0x340bcf[_0x1ff1('0x7f')]){_0x340bcf[_0x1ff1('0x7f')]=JSON[_0x1ff1('0x80')](_0x340bcf[_0x1ff1('0x7f')]);for(var _0x52e32e=0x0;_0x52e32e<_0x340bcf[_0x1ff1('0x7f')][_0x1ff1('0x3c')];_0x52e32e+=0x1){if(_0x340bcf[_0x1ff1('0x7f')][_0x52e32e]['type']&&_[_0x1ff1('0x67')](_0x3de320,_0x340bcf[_0x1ff1('0x7f')][_0x52e32e]['type'])&&_0x340bcf['joins'][_0x52e32e][_0x1ff1('0x81')]&&_0x340bcf[_0x1ff1('0x7f')][_0x52e32e][_0x1ff1('0x82')]&&_0x340bcf[_0x1ff1('0x7f')][_0x52e32e][_0x1ff1('0x83')]){_0x2c8781[_0x340bcf[_0x1ff1('0x7f')][_0x52e32e][_0x1ff1('0x44')]](_0x340bcf['joins'][_0x52e32e][_0x1ff1('0x82')],null,util[_0x1ff1('0x7b')]('%s.%s\x20=\x20%s.%s',_0x340bcf[_0x1ff1('0x76')],_0x340bcf[_0x1ff1('0x7f')][_0x52e32e][_0x1ff1('0x81')],_0x340bcf[_0x1ff1('0x7f')][_0x52e32e]['foreignTable'],_0x340bcf[_0x1ff1('0x7f')][_0x52e32e][_0x1ff1('0x83')]));}}}if(_0x340bcf[_0x1ff1('0x85')]){_0x340bcf[_0x1ff1('0x85')]=JSON['parse'](_0x340bcf[_0x1ff1('0x85')]);_0x2c8781['where'](_0x502f51(_0x340bcf[_0x1ff1('0x85')]['group']));}_0x9970b6=_0x2c8781[_0x1ff1('0x86')]();_0x2c8781[_0x1ff1('0x20')](_0x58aaea);_0x2c8781[_0x1ff1('0x1d')](0x0);logger[_0x1ff1('0x87')](_0x1ff1('0xaa'),_0x2c8781[_0x1ff1('0x88')]());return dbH[_0x1ff1('0x89')]['query'](_0x2c8781[_0x1ff1('0x88')](),{'type':dbH[_0x1ff1('0x89')][_0x1ff1('0x8a')][_0x1ff1('0x8b')]});}})[_0x1ff1('0x27')](function(){return{'sql':_0x9970b6[_0x1ff1('0x88')]()};})[_0x1ff1('0x27')](respondWithResult(_0x1d7db5,null))['catch'](handleError(_0x1d7db5,null));}; \ No newline at end of file +var _0x7ee0=['map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','SUM(%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)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','sequelize','QueryTypes','SELECT','right_join','COUNT(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','DESC','parentKey','output','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','fork','../../components/export/','savename','countTable','COUNT(*)','IS\x20NULL','IS\x20NOT\x20NULL','Limited\x20Query:','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','error','name','send','index'];(function(_0x2e4794,_0x3d2731){var _0x433bc1=function(_0x33a3c9){while(--_0x33a3c9){_0x2e4794['push'](_0x2e4794['shift']());}};_0x433bc1(++_0x3d2731);}(_0x7ee0,0x123));var _0x07ee=function(_0x18398b,_0x1c0169){_0x18398b=_0x18398b-0x0;var _0x381dae=_0x7ee0[_0x18398b];return _0x381dae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07ee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x07ee('0x1'));var rp=require(_0x07ee('0x2'));var moment=require(_0x07ee('0x3'));var BPromise=require(_0x07ee('0x4'));var Mustache=require(_0x07ee('0x5'));var util=require(_0x07ee('0x6'));var path=require(_0x07ee('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x07ee('0x8'));var fs=require('fs');var fs_extra=require(_0x07ee('0x9'));var _=require(_0x07ee('0xa'));var squel=require(_0x07ee('0xb'));var crypto=require(_0x07ee('0xc'));var jsforce=require(_0x07ee('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x07ee('0xe'));var querystring=require(_0x07ee('0xf'));var Papa=require('papaparse');var Redis=require(_0x07ee('0x10'));var authService=require(_0x07ee('0x11'));var qs=require(_0x07ee('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x07ee('0x13'));var logger=require('../../config/logger')(_0x07ee('0x14'));var utils=require(_0x07ee('0x15'));var config=require(_0x07ee('0x16'));var licenseUtil=require(_0x07ee('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x07ee('0x18'))[_0x07ee('0x19')];function respondWithStatusCode(_0x17a46f,_0x2d90d5){_0x2d90d5=_0x2d90d5||0xcc;return function(_0x5a0d4c){if(_0x5a0d4c){return _0x17a46f['sendStatus'](_0x2d90d5);}return _0x17a46f[_0x07ee('0x1a')](_0x2d90d5)[_0x07ee('0x1b')]();};}function respondWithResult(_0x491624,_0x1e544d){_0x1e544d=_0x1e544d||0xc8;return function(_0x1aa2f1){if(_0x1aa2f1){return _0x491624['status'](_0x1e544d)[_0x07ee('0x1c')](_0x1aa2f1);}};}function respondWithFilteredResult(_0x30ea8e,_0x88675e){return function(_0x4ae67f){if(_0x4ae67f){var _0x16e0f4=typeof _0x88675e[_0x07ee('0x1d')]===_0x07ee('0x1e')&&typeof _0x88675e[_0x07ee('0x1f')]===_0x07ee('0x1e');var _0x347228=_0x4ae67f[_0x07ee('0x20')];var _0x569b17=_0x16e0f4?0x0:_0x88675e[_0x07ee('0x1d')];var _0x2bd70e=_0x16e0f4?_0x4ae67f[_0x07ee('0x20')]:_0x88675e[_0x07ee('0x1d')]+_0x88675e[_0x07ee('0x1f')];var _0x5c5ca2;if(_0x2bd70e>=_0x347228){_0x2bd70e=_0x347228;_0x5c5ca2=0xc8;}else{_0x5c5ca2=0xce;}_0x30ea8e[_0x07ee('0x1a')](_0x5c5ca2);return _0x30ea8e['set'](_0x07ee('0x21'),_0x569b17+'-'+_0x2bd70e+'/'+_0x347228)[_0x07ee('0x1c')](_0x4ae67f);}return null;};}function patchUpdates(_0x15013b){return function(_0x351dfb){try{jsonpatch[_0x07ee('0x22')](_0x351dfb,_0x15013b,!![]);}catch(_0xf249c){return BPromise[_0x07ee('0x23')](_0xf249c);}return _0x351dfb['save']();};}function saveUpdates(_0x4d40f4,_0x7e8b8f){return function(_0x2f965d){if(_0x2f965d){return _0x2f965d[_0x07ee('0x24')](_0x4d40f4)[_0x07ee('0x25')](function(_0x382cfb){return _0x382cfb;});}return null;};}function removeEntity(_0x3058fa,_0x40038d){return function(_0x4f38c0){if(_0x4f38c0){return _0x4f38c0[_0x07ee('0x26')]()[_0x07ee('0x25')](function(){var _0x29d69b=_0x4f38c0[_0x07ee('0x27')]({'plain':!![]});var _0x44bd18=_0x07ee('0x28');return db[_0x07ee('0x29')][_0x07ee('0x26')]({'where':{'type':_0x44bd18,'resourceId':_0x29d69b['id']}})['then'](function(){return _0x4f38c0;});})['then'](function(){_0x3058fa[_0x07ee('0x1a')](0xcc)[_0x07ee('0x1b')]();});}};}function handleEntityNotFound(_0xe21fa4,_0x2b1a35){return function(_0x5dfdf9){if(!_0x5dfdf9){_0xe21fa4[_0x07ee('0x2a')](0x194);}return _0x5dfdf9;};}function handleError(_0x300abe,_0x520ba2){_0x520ba2=_0x520ba2||0x1f4;return function(_0x181568){logger[_0x07ee('0x2b')](_0x181568['stack']);if(_0x181568[_0x07ee('0x2c')]){delete _0x181568[_0x07ee('0x2c')];}_0x300abe[_0x07ee('0x1a')](_0x520ba2)[_0x07ee('0x2d')](_0x181568);};}exports[_0x07ee('0x2e')]=function(_0x420cef,_0x5bb9c0){var _0x251607={},_0x9788fd={},_0x260b30={'count':0x0,'rows':[]};var _0x21ada1=_[_0x07ee('0x2f')](db[_0x07ee('0x30')][_0x07ee('0x31')],function(_0x5c1c24){return{'name':_0x5c1c24[_0x07ee('0x32')],'type':_0x5c1c24['type'][_0x07ee('0x33')]};});_0x9788fd[_0x07ee('0x34')]=_[_0x07ee('0x2f')](_0x21ada1,_0x07ee('0x2c'));_0x9788fd[_0x07ee('0x35')]=_[_0x07ee('0x36')](_0x420cef[_0x07ee('0x35')]);_0x9788fd['filters']=_[_0x07ee('0x37')](_0x9788fd['model'],_0x9788fd[_0x07ee('0x35')]);_0x251607[_0x07ee('0x38')]=_[_0x07ee('0x37')](_0x9788fd[_0x07ee('0x34')],qs[_0x07ee('0x39')](_0x420cef[_0x07ee('0x35')]['fields']));_0x251607['attributes']=_0x251607[_0x07ee('0x38')][_0x07ee('0x3a')]?_0x251607[_0x07ee('0x38')]:_0x9788fd[_0x07ee('0x34')];if(!_0x420cef['query'][_0x07ee('0x3b')](_0x07ee('0x3c'))){_0x251607[_0x07ee('0x1f')]=qs[_0x07ee('0x1f')](_0x420cef['query']['limit']);_0x251607[_0x07ee('0x1d')]=qs[_0x07ee('0x1d')](_0x420cef[_0x07ee('0x35')][_0x07ee('0x1d')]);}_0x251607[_0x07ee('0x3d')]=qs['sort'](_0x420cef[_0x07ee('0x35')][_0x07ee('0x3e')]);_0x251607[_0x07ee('0x3f')]=qs[_0x07ee('0x40')](_[_0x07ee('0x41')](_0x420cef['query'],_0x9788fd[_0x07ee('0x40')]),_0x21ada1);if(_0x420cef[_0x07ee('0x35')][_0x07ee('0x42')]){_0x251607['where']=_[_0x07ee('0x43')](_0x251607['where'],{'$or':_['map'](_0x21ada1,function(_0x4323f8){if(_0x4323f8['type']!==_0x07ee('0x44')){var _0x24b81b={};_0x24b81b[_0x4323f8[_0x07ee('0x2c')]]={'$like':'%'+_0x420cef[_0x07ee('0x35')][_0x07ee('0x42')]+'%'};return _0x24b81b;}})});}_0x251607=_[_0x07ee('0x43')]({},_0x251607,_0x420cef[_0x07ee('0x45')]);var _0x3a74fc={'where':_0x251607[_0x07ee('0x3f')]};return db[_0x07ee('0x30')][_0x07ee('0x20')](_0x3a74fc)[_0x07ee('0x25')](function(_0x218183){_0x260b30['count']=_0x218183;if(_0x420cef[_0x07ee('0x35')][_0x07ee('0x46')]){_0x251607[_0x07ee('0x47')]=[{'all':!![]}];}return db[_0x07ee('0x30')]['findAll'](_0x251607);})[_0x07ee('0x25')](function(_0x457d52){_0x260b30[_0x07ee('0x48')]=_0x457d52;return _0x260b30;})[_0x07ee('0x25')](respondWithFilteredResult(_0x5bb9c0,_0x251607))[_0x07ee('0x49')](handleError(_0x5bb9c0,null));};exports[_0x07ee('0x4a')]=function(_0x3fed0b,_0x5e895c){var _0x124d95={'raw':![],'where':{'id':_0x3fed0b[_0x07ee('0x4b')]['id']}},_0x195311={};_0x195311['model']=_['keys'](db['AnalyticCustomReport'][_0x07ee('0x31')]);_0x195311[_0x07ee('0x35')]=_[_0x07ee('0x36')](_0x3fed0b[_0x07ee('0x35')]);_0x195311[_0x07ee('0x40')]=_[_0x07ee('0x37')](_0x195311['model'],_0x195311[_0x07ee('0x35')]);_0x124d95[_0x07ee('0x38')]=_[_0x07ee('0x37')](_0x195311[_0x07ee('0x34')],qs[_0x07ee('0x39')](_0x3fed0b['query']['fields']));_0x124d95[_0x07ee('0x38')]=_0x124d95['attributes'][_0x07ee('0x3a')]?_0x124d95[_0x07ee('0x38')]:_0x195311[_0x07ee('0x34')];if(_0x3fed0b[_0x07ee('0x35')][_0x07ee('0x46')]){_0x124d95[_0x07ee('0x47')]=[{'all':!![]}];}_0x124d95=_[_0x07ee('0x43')]({},_0x124d95,_0x3fed0b[_0x07ee('0x45')]);return db[_0x07ee('0x30')][_0x07ee('0x4c')](_0x124d95)['then'](handleEntityNotFound(_0x5e895c,null))[_0x07ee('0x25')](respondWithResult(_0x5e895c,null))[_0x07ee('0x49')](handleError(_0x5e895c,null));};exports[_0x07ee('0x4d')]=function(_0xdacf3d,_0xc8d223){return db[_0x07ee('0x30')]['create'](_0xdacf3d[_0x07ee('0x4e')],{})['then'](function(_0x1f13c3){var _0x43b97f=_0xdacf3d[_0x07ee('0x4f')][_0x07ee('0x27')]({'plain':!![]});if(!_0x43b97f)throw new Error(_0x07ee('0x50'));if(_0x43b97f[_0x07ee('0x51')]===_0x07ee('0x4f')){var _0x63d5f3=_0x1f13c3[_0x07ee('0x27')]({'plain':!![]});var _0xbc78ae='Reports';return db[_0x07ee('0x52')][_0x07ee('0x4c')]({'where':{'name':_0xbc78ae,'userProfileId':_0x43b97f[_0x07ee('0x53')]},'raw':!![]})[_0x07ee('0x25')](function(_0x82a833){if(_0x82a833&&_0x82a833[_0x07ee('0x54')]===0x0){return db[_0x07ee('0x29')][_0x07ee('0x4d')]({'name':_0x63d5f3[_0x07ee('0x2c')],'resourceId':_0x63d5f3['id'],'type':_0x07ee('0x28'),'sectionId':_0x82a833['id']},{})[_0x07ee('0x25')](function(){return _0x1f13c3;});}else{return _0x1f13c3;}})[_0x07ee('0x49')](function(_0x4b4893){logger[_0x07ee('0x2b')](_0x07ee('0x55'),_0x4b4893);throw _0x4b4893;});}return _0x1f13c3;})[_0x07ee('0x25')](respondWithResult(_0xc8d223,0xc9))['catch'](handleError(_0xc8d223,null));};exports[_0x07ee('0x24')]=function(_0x5bba31,_0x356095){if(_0x5bba31[_0x07ee('0x4e')]['id']){delete _0x5bba31[_0x07ee('0x4e')]['id'];}return db[_0x07ee('0x30')][_0x07ee('0x4c')]({'where':{'id':_0x5bba31[_0x07ee('0x4b')]['id']}})['then'](handleEntityNotFound(_0x356095,null))[_0x07ee('0x25')](saveUpdates(_0x5bba31[_0x07ee('0x4e')],null))['then'](respondWithResult(_0x356095,null))['catch'](handleError(_0x356095,null));};exports[_0x07ee('0x26')]=function(_0x3d849f,_0x67cb76){return db[_0x07ee('0x30')]['find']({'where':{'id':_0x3d849f['params']['id']}})[_0x07ee('0x25')](handleEntityNotFound(_0x67cb76,null))[_0x07ee('0x25')](removeEntity(_0x67cb76,null))[_0x07ee('0x49')](handleError(_0x67cb76,null));};exports[_0x07ee('0x56')]=function(_0x5c9463,_0x35113b){var _0x2984fb=0xa;var _0x469b65=[_0x07ee('0x57'),_0x07ee('0x58'),'right_join',_0x07ee('0x59')];var _0xf39c99={'SUM':_0x07ee('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x07ee('0x5b'),'MAX':_0x07ee('0x5c'),'MIN':_0x07ee('0x5d'),'AVG':_0x07ee('0x5e'),'GROUP_CONCAT':_0x07ee('0x5f'),'GROUP_CONCAT ASC':_0x07ee('0x60'),'GROUP_CONCAT DESC':_0x07ee('0x61')};var _0x58fa92={'SEC_TO_TIME':_0x07ee('0x62'),'DATE':'DATE(%s)','HOUR':_0x07ee('0x63'),'ROUND':_0x07ee('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5170f2=function(_0x56e95c){return!_[_0x07ee('0x65')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x07ee('0x66'),_0x07ee('0x67')],_0x56e95c);};var _0x46cc2c=function(_0x3188c5){if(!_0x3188c5||!_0x3188c5[_0x07ee('0x68')][_0x07ee('0x3a')]){return'';}for(var _0x513821='(',_0x4794f6=0x0;_0x4794f6<_0x3188c5['rules'][_0x07ee('0x3a')];_0x4794f6+=0x1){_0x4794f6>0x0&&(_0x513821+='\x20'+_0x3188c5[_0x07ee('0x69')]+'\x20');_0x513821+=_0x3188c5[_0x07ee('0x68')][_0x4794f6]['group']?_0x46cc2c(_0x3188c5['rules'][_0x4794f6][_0x07ee('0x6a')]):_0x3188c5['rules'][_0x4794f6][_0x07ee('0x6b')]+'\x20'+_0x3188c5[_0x07ee('0x68')][_0x4794f6][_0x07ee('0x6c')]+(_0x5170f2(_0x3188c5[_0x07ee('0x68')][_0x4794f6][_0x07ee('0x6c')])?'\x20'+_0x3188c5[_0x07ee('0x68')][_0x4794f6][_0x07ee('0x6d')]:'');}return _0x513821+')';};var _0x8487f={'where':{'id':_0x5c9463[_0x07ee('0x4b')]['id']}},_0x4fa7e2,_0x23644a,_0x388c37,_0x9412a3,_0x16c1fa;_0x8487f=_[_0x07ee('0x43')]({},_0x8487f,_0x5c9463['options']);return db[_0x07ee('0x30')][_0x07ee('0x4c')](_0x8487f)['then'](function(_0x510176){if(_0x510176){_0x4fa7e2=_0x510176;return _0x510176[_0x07ee('0x6e')]();}return null;})[_0x07ee('0x25')](function(_0x54aacb){if(_0x54aacb){if(!_0x54aacb[_0x07ee('0x3a')]){throw new db[(_0x07ee('0x6f'))][(_0x07ee('0x70'))](_0x07ee('0x71'),0x193);}_0x23644a=_0x54aacb;return db[_0x07ee('0x72')][_0x07ee('0x73')]({'raw':!![]});}return null;})[_0x07ee('0x25')](function(_0x1b24b6){if(_0x1b24b6){_0x388c37=_[_0x07ee('0x74')](_0x1b24b6,'id');var _0x13fb35;var _0xb06d06=squel[_0x07ee('0x75')]();_0xb06d06[_0x07ee('0x76')](_0x4fa7e2[_0x07ee('0x77')]);for(var _0x2078d9=0x0;_0x2078d9<_0x23644a[_0x07ee('0x3a')];_0x2078d9+=0x1){_0x13fb35=_0x23644a[_0x2078d9]['MetricId']?_0x388c37[_0x23644a[_0x2078d9][_0x07ee('0x78')]][_0x07ee('0x79')]:_0x23644a[_0x2078d9]['field'];_0x13fb35=_0x23644a[_0x2078d9][_0x07ee('0x7a')]?_['replace'](_0xf39c99[_0x23644a[_0x2078d9][_0x07ee('0x7a')]],'%s',_0x13fb35):_0x13fb35;_0x13fb35=_0x23644a[_0x2078d9][_0x07ee('0x7b')]?_[_0x07ee('0x7c')](_0x58fa92[_0x23644a[_0x2078d9][_0x07ee('0x7b')]],'%s',_0x13fb35):_0x13fb35;if(_0x23644a[_0x2078d9][_0x07ee('0x7d')]){_0xb06d06[_0x07ee('0x6a')](_0x13fb35);}_0x23644a[_0x2078d9][_0x07ee('0x7e')]&&_0xb06d06[_0x07ee('0x3d')](_0x13fb35,_0x23644a[_0x2078d9][_0x07ee('0x7e')]==='DESC'?![]:!![]);_0xb06d06[_0x07ee('0x6b')](_0x13fb35,_0x23644a[_0x2078d9][_0x07ee('0x7f')]||_0x13fb35);}if(_0x4fa7e2[_0x07ee('0x80')]){_0x4fa7e2['joins']=JSON[_0x07ee('0x81')](_0x4fa7e2[_0x07ee('0x80')]);for(var _0x1e263e=0x0;_0x1e263e<_0x4fa7e2['joins'][_0x07ee('0x3a')];_0x1e263e+=0x1){if(_0x4fa7e2[_0x07ee('0x80')][_0x1e263e][_0x07ee('0x82')]&&_[_0x07ee('0x65')](_0x469b65,_0x4fa7e2['joins'][_0x1e263e][_0x07ee('0x82')])&&_0x4fa7e2[_0x07ee('0x80')][_0x1e263e]['parentKey']&&_0x4fa7e2[_0x07ee('0x80')][_0x1e263e][_0x07ee('0x83')]&&_0x4fa7e2[_0x07ee('0x80')][_0x1e263e]['foreignKey']){_0xb06d06[_0x4fa7e2['joins'][_0x1e263e][_0x07ee('0x82')]](_0x4fa7e2['joins'][_0x1e263e][_0x07ee('0x83')],null,util[_0x07ee('0x7b')](_0x07ee('0x84'),_0x4fa7e2[_0x07ee('0x77')],_0x4fa7e2[_0x07ee('0x80')][_0x1e263e]['parentKey'],_0x4fa7e2['joins'][_0x1e263e][_0x07ee('0x83')],_0x4fa7e2[_0x07ee('0x80')][_0x1e263e][_0x07ee('0x85')]));}}}if(_0x4fa7e2['conditions']){_0x4fa7e2[_0x07ee('0x86')]=JSON['parse'](_0x4fa7e2[_0x07ee('0x86')]);_0xb06d06[_0x07ee('0x3f')](_0x46cc2c(_0x4fa7e2[_0x07ee('0x86')]['group']));}_0x16c1fa=_0xb06d06[_0x07ee('0x87')]();_0xb06d06['limit'](_0x2984fb);_0xb06d06[_0x07ee('0x1d')](0x0);logger[_0x07ee('0x88')]('Limited\x20Query:',_0xb06d06['toString']());return dbH[_0x07ee('0x89')][_0x07ee('0x35')](_0xb06d06['toString'](),{'type':dbH[_0x07ee('0x89')][_0x07ee('0x8a')][_0x07ee('0x8b')]});}})[_0x07ee('0x25')](respondWithResult(_0x35113b,null))[_0x07ee('0x49')](handleError(_0x35113b,null));};function runReport(_0x3a20b6,_0x43711f,_0x4d395c){var _0x5e7e92=_0x43711f['name'];var _0x3cbf3a=0xa;var _0x115809=[_0x07ee('0x57'),_0x07ee('0x58'),_0x07ee('0x8c'),'cross_join'];var _0x5a1a95={'SUM':_0x07ee('0x5a'),'COUNT':_0x07ee('0x8d'),'COUNT DISTINCT':_0x07ee('0x5b'),'MAX':_0x07ee('0x5c'),'MIN':_0x07ee('0x5d'),'AVG':_0x07ee('0x5e'),'GROUP_CONCAT':_0x07ee('0x5f'),'GROUP_CONCAT ASC':_0x07ee('0x60'),'GROUP_CONCAT DESC':_0x07ee('0x61')};var _0x16ce89={'SEC_TO_TIME':_0x07ee('0x62'),'DATE':_0x07ee('0x8e'),'HOUR':'HOUR(%s)','ROUND':_0x07ee('0x64'),'UNIX_TIMESTAMP':_0x07ee('0x8f')};var _0x3a1fc1=function(_0xceb40){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x07ee('0x66'),_0x07ee('0x67')],_0xceb40);};var _0x240c26=function(_0x49001e){if(!_0x49001e||!_0x49001e[_0x07ee('0x68')][_0x07ee('0x3a')]){return'';}for(var _0x1a147c='(',_0xf6e95e=0x0;_0xf6e95e<_0x49001e[_0x07ee('0x68')][_0x07ee('0x3a')];_0xf6e95e+=0x1){_0xf6e95e>0x0&&(_0x1a147c+='\x20'+_0x49001e[_0x07ee('0x69')]+'\x20');_0x1a147c+=_0x49001e[_0x07ee('0x68')][_0xf6e95e][_0x07ee('0x6a')]?_0x240c26(_0x49001e['rules'][_0xf6e95e][_0x07ee('0x6a')]):_0x49001e['rules'][_0xf6e95e][_0x07ee('0x6b')]+'\x20'+_0x49001e[_0x07ee('0x68')][_0xf6e95e]['condition']+(_0x3a1fc1(_0x49001e[_0x07ee('0x68')][_0xf6e95e][_0x07ee('0x6c')])?'\x20'+_0x49001e[_0x07ee('0x68')][_0xf6e95e][_0x07ee('0x6d')]:'');}return _0x1a147c+')';};var _0x2b2e6c={'where':{'id':_0x3a20b6['id']}},_0x4aabb5,_0x30fced,_0x3ee486,_0x4fa34f,_0x46db12;_0x2b2e6c=_[_0x07ee('0x43')]({},_0x2b2e6c,_0x4d395c);return db[_0x07ee('0x30')][_0x07ee('0x4c')](_0x2b2e6c)[_0x07ee('0x25')](function(_0xc0c61d){if(_0xc0c61d){_0x4aabb5=_0xc0c61d;return _0xc0c61d[_0x07ee('0x6e')]();}return null;})[_0x07ee('0x25')](function(_0x436291){if(_0x436291){if(!_0x436291[_0x07ee('0x3a')]){throw new db['Sequelize'][(_0x07ee('0x70'))](_0x07ee('0x71'),0x193);}_0x30fced=_0x436291;return db[_0x07ee('0x72')][_0x07ee('0x73')]({'raw':!![]});}return null;})[_0x07ee('0x25')](function(_0x892b7e){if(_0x892b7e){_0x3ee486=_[_0x07ee('0x74')](_0x892b7e,'id');var _0x12de04;var _0x53cb4f=squel['select']();_0x53cb4f[_0x07ee('0x76')](_0x4aabb5[_0x07ee('0x77')]);for(var _0x2ab642=0x0;_0x2ab642<_0x30fced[_0x07ee('0x3a')];_0x2ab642+=0x1){_0x12de04=_0x30fced[_0x2ab642][_0x07ee('0x78')]?_0x3ee486[_0x30fced[_0x2ab642][_0x07ee('0x78')]]['metric']:_0x30fced[_0x2ab642][_0x07ee('0x6b')];_0x12de04=_0x30fced[_0x2ab642]['function']?_[_0x07ee('0x7c')](_0x5a1a95[_0x30fced[_0x2ab642]['function']],'%s',_0x12de04):_0x12de04;_0x12de04=_0x30fced[_0x2ab642][_0x07ee('0x7b')]?_[_0x07ee('0x7c')](_0x16ce89[_0x30fced[_0x2ab642][_0x07ee('0x7b')]],'%s',_0x12de04):_0x12de04;if(_0x30fced[_0x2ab642][_0x07ee('0x7d')]){_0x53cb4f[_0x07ee('0x6a')](_0x12de04);}_0x30fced[_0x2ab642][_0x07ee('0x7e')]&&_0x53cb4f[_0x07ee('0x3d')](_0x12de04,_0x30fced[_0x2ab642][_0x07ee('0x7e')]===_0x07ee('0x90')?![]:!![]);_0x53cb4f[_0x07ee('0x6b')](_0x12de04,_0x30fced[_0x2ab642]['alias']||_0x12de04);}if(_0x4aabb5['joins']){_0x4aabb5[_0x07ee('0x80')]=JSON['parse'](_0x4aabb5['joins']);for(var _0x35cef9=0x0;_0x35cef9<_0x4aabb5[_0x07ee('0x80')][_0x07ee('0x3a')];_0x35cef9+=0x1){if(_0x4aabb5['joins'][_0x35cef9][_0x07ee('0x82')]&&_[_0x07ee('0x65')](_0x115809,_0x4aabb5[_0x07ee('0x80')][_0x35cef9][_0x07ee('0x82')])&&_0x4aabb5[_0x07ee('0x80')][_0x35cef9][_0x07ee('0x91')]&&_0x4aabb5[_0x07ee('0x80')][_0x35cef9][_0x07ee('0x83')]&&_0x4aabb5['joins'][_0x35cef9][_0x07ee('0x85')]){_0x53cb4f[_0x4aabb5[_0x07ee('0x80')][_0x35cef9][_0x07ee('0x82')]](_0x4aabb5[_0x07ee('0x80')][_0x35cef9]['foreignTable'],null,util[_0x07ee('0x7b')](_0x07ee('0x84'),_0x4aabb5['table'],_0x4aabb5['joins'][_0x35cef9][_0x07ee('0x91')],_0x4aabb5[_0x07ee('0x80')][_0x35cef9]['foreignTable'],_0x4aabb5[_0x07ee('0x80')][_0x35cef9]['foreignKey']));}}}if(_0x4aabb5[_0x07ee('0x86')]){_0x4aabb5[_0x07ee('0x86')]=JSON[_0x07ee('0x81')](_0x4aabb5[_0x07ee('0x86')]);_0x53cb4f[_0x07ee('0x3f')](_0x240c26(_0x4aabb5[_0x07ee('0x86')][_0x07ee('0x6a')]));}_0x46db12=_0x53cb4f[_0x07ee('0x87')]();_0x53cb4f['limit'](_0x3cbf3a);_0x53cb4f[_0x07ee('0x1d')](0x0);return;}})[_0x07ee('0x25')](function(){if(_0x43711f[_0x07ee('0x92')]==='web'){return null;}var _0x4a51c5=_[_0x07ee('0x43')](_0x43711f,{'name':_0x43711f[_0x07ee('0x93')]||_0x43711f[_0x07ee('0x2c')]||_0x4aabb5[_0x07ee('0x2c')],'basename':_0x5e7e92,'savename':util[_0x07ee('0x7b')](_0x07ee('0x94'),_0x43711f[_0x07ee('0x2c')]||_0x4aabb5['name'],require(_0x07ee('0x95'))['generate'](0x4),_0x43711f[_0x07ee('0x92')]||_0x07ee('0x96')),'reportId':_0x4aabb5['id'],'reportType':_0x07ee('0x97')});return db[_0x07ee('0x98')]['create'](_0x4a51c5,{'raw':!![]});})[_0x07ee('0x25')](function(_0x286f0a){if(_0x4aabb5['table']===_0x07ee('0x99')){_0x46db12[_0x07ee('0x3f')](_0x4aabb5['table']+_0x07ee('0x9a'),_0x43711f[_0x07ee('0x9b')],_0x43711f[_0x07ee('0x9c')]);}else{_0x46db12[_0x07ee('0x3f')](_0x4aabb5[_0x07ee('0x77')]+_0x07ee('0x9d'),_0x43711f['startDate'],_0x43711f[_0x07ee('0x9c')]);}if(_0x286f0a){logger[_0x07ee('0x9e')](_0x07ee('0x9f'),_0x46db12[_0x07ee('0xa0')]());require('child_process')[_0x07ee('0xa1')](path[_0x07ee('0x57')](__dirname,_0x07ee('0xa2'),_0x286f0a['output']),[_0x286f0a['id'],_0x46db12[_0x07ee('0xa0')](),path[_0x07ee('0x57')](__dirname,'../../files/reports',_0x286f0a[_0x07ee('0xa3')]),_0x5e7e92]);return _0x286f0a;}else{var _0x348e97=squel[_0x07ee('0x75')]();_0x348e97['from']('('+_0x46db12['toString']()+')',_0x07ee('0xa4'));_0x348e97['field'](_0x07ee('0xa5'),_0x07ee('0x20'));_0x46db12[_0x07ee('0x1f')](_0x43711f[_0x07ee('0x1f')]||_0x3cbf3a);_0x46db12[_0x07ee('0x1d')](_0x43711f[_0x07ee('0x1d')]||0x0);return dbH[_0x07ee('0x89')][_0x07ee('0x35')](_0x348e97[_0x07ee('0xa0')](),{'type':dbH[_0x07ee('0x89')][_0x07ee('0x8a')][_0x07ee('0x8b')]})[_0x07ee('0x25')](function(_0x55affe){if(!_0x55affe[_0x07ee('0x3a')]){_0x4fa34f=0x0;}else{_0x4fa34f=_0x55affe[0x0][_0x07ee('0x20')]||0x0;}return dbH['sequelize'][_0x07ee('0x35')](_0x46db12['toString'](),{'type':dbH['sequelize'][_0x07ee('0x8a')][_0x07ee('0x8b')]});})[_0x07ee('0x25')](function(_0x30eac0){return{'rows':_0x30eac0||[],'count':_0x4fa34f};});}});}exports['run']=function(_0x32b2d1,_0x4fb9a4){return runReport(_0x32b2d1['params'],_0x32b2d1[_0x07ee('0x35')],_0x32b2d1[_0x07ee('0x45')])['then'](respondWithResult(_0x4fb9a4,null))[_0x07ee('0x49')](handleError(_0x4fb9a4,null));};exports['runReport']=runReport;exports['query']=function(_0x33f17c,_0x58ccfb){var _0x2e34cf=0xa;var _0x2037c1=['join',_0x07ee('0x58'),_0x07ee('0x8c'),_0x07ee('0x59')];var _0x52620a={'SUM':_0x07ee('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x07ee('0x5b'),'MAX':_0x07ee('0x5c'),'MIN':'MIN(%s)','AVG':_0x07ee('0x5e'),'GROUP_CONCAT':_0x07ee('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x07ee('0x61')};var _0x6b879c={'SEC_TO_TIME':_0x07ee('0x62'),'DATE':'DATE(%s)','HOUR':_0x07ee('0x63'),'ROUND':_0x07ee('0x64'),'UNIX_TIMESTAMP':_0x07ee('0x8f')};var _0x1ccf68=function(_0x1dd0e9){return!_[_0x07ee('0x65')]([_0x07ee('0xa6'),_0x07ee('0xa7'),_0x07ee('0x66'),'IS\x20NOT\x20EMPTY'],_0x1dd0e9);};var _0x677fc6=function(_0x39d307){if(!_0x39d307||!_0x39d307[_0x07ee('0x68')]['length']){return'';}for(var _0x44e92d='(',_0x441a=0x0;_0x441a<_0x39d307[_0x07ee('0x68')][_0x07ee('0x3a')];_0x441a+=0x1){_0x441a>0x0&&(_0x44e92d+='\x20'+_0x39d307['operator']+'\x20');_0x44e92d+=_0x39d307[_0x07ee('0x68')][_0x441a][_0x07ee('0x6a')]?_0x677fc6(_0x39d307[_0x07ee('0x68')][_0x441a][_0x07ee('0x6a')]):_0x39d307['rules'][_0x441a]['field']+'\x20'+_0x39d307[_0x07ee('0x68')][_0x441a][_0x07ee('0x6c')]+(_0x1ccf68(_0x39d307['rules'][_0x441a][_0x07ee('0x6c')])?'\x20'+_0x39d307[_0x07ee('0x68')][_0x441a][_0x07ee('0x6d')]:'');}return _0x44e92d+')';};var _0x5a4011={'where':{'id':_0x33f17c[_0x07ee('0x4b')]['id']}},_0x3c98ac,_0x5b59a2,_0x5de7bb,_0x24327b,_0x33d648;_0x5a4011=_[_0x07ee('0x43')]({},_0x5a4011,_0x33f17c[_0x07ee('0x45')]);return db[_0x07ee('0x30')][_0x07ee('0x4c')](_0x5a4011)['then'](function(_0x5bae7f){if(_0x5bae7f){_0x3c98ac=_0x5bae7f;return _0x5bae7f[_0x07ee('0x6e')]();}return null;})['then'](function(_0x25f510){if(_0x25f510){if(!_0x25f510[_0x07ee('0x3a')]){throw new db[(_0x07ee('0x6f'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5b59a2=_0x25f510;return db[_0x07ee('0x72')]['findAll']({'raw':!![]});}return null;})[_0x07ee('0x25')](function(_0x3284a6){if(_0x3284a6){_0x5de7bb=_[_0x07ee('0x74')](_0x3284a6,'id');var _0x381412;var _0x38c946=squel[_0x07ee('0x75')]();_0x38c946[_0x07ee('0x76')](_0x3c98ac[_0x07ee('0x77')]);for(var _0x10aec2=0x0;_0x10aec2<_0x5b59a2[_0x07ee('0x3a')];_0x10aec2+=0x1){_0x381412=_0x5b59a2[_0x10aec2]['MetricId']?_0x5de7bb[_0x5b59a2[_0x10aec2][_0x07ee('0x78')]][_0x07ee('0x79')]:_0x5b59a2[_0x10aec2]['field'];_0x381412=_0x5b59a2[_0x10aec2][_0x07ee('0x7a')]?_[_0x07ee('0x7c')](_0x52620a[_0x5b59a2[_0x10aec2][_0x07ee('0x7a')]],'%s',_0x381412):_0x381412;_0x381412=_0x5b59a2[_0x10aec2][_0x07ee('0x7b')]?_['replace'](_0x6b879c[_0x5b59a2[_0x10aec2][_0x07ee('0x7b')]],'%s',_0x381412):_0x381412;if(_0x5b59a2[_0x10aec2][_0x07ee('0x7d')]){_0x38c946[_0x07ee('0x6a')](_0x381412);}_0x5b59a2[_0x10aec2]['orderBy']&&_0x38c946[_0x07ee('0x3d')](_0x381412,_0x5b59a2[_0x10aec2][_0x07ee('0x7e')]===_0x07ee('0x90')?![]:!![]);_0x38c946[_0x07ee('0x6b')](_0x381412,_0x5b59a2[_0x10aec2][_0x07ee('0x7f')]||_0x381412);}if(_0x3c98ac['joins']){_0x3c98ac[_0x07ee('0x80')]=JSON[_0x07ee('0x81')](_0x3c98ac[_0x07ee('0x80')]);for(var _0x33ed30=0x0;_0x33ed30<_0x3c98ac[_0x07ee('0x80')]['length'];_0x33ed30+=0x1){if(_0x3c98ac['joins'][_0x33ed30]['type']&&_[_0x07ee('0x65')](_0x2037c1,_0x3c98ac[_0x07ee('0x80')][_0x33ed30][_0x07ee('0x82')])&&_0x3c98ac[_0x07ee('0x80')][_0x33ed30][_0x07ee('0x91')]&&_0x3c98ac['joins'][_0x33ed30]['foreignTable']&&_0x3c98ac['joins'][_0x33ed30][_0x07ee('0x85')]){_0x38c946[_0x3c98ac[_0x07ee('0x80')][_0x33ed30][_0x07ee('0x82')]](_0x3c98ac[_0x07ee('0x80')][_0x33ed30][_0x07ee('0x83')],null,util[_0x07ee('0x7b')](_0x07ee('0x84'),_0x3c98ac[_0x07ee('0x77')],_0x3c98ac[_0x07ee('0x80')][_0x33ed30][_0x07ee('0x91')],_0x3c98ac[_0x07ee('0x80')][_0x33ed30][_0x07ee('0x83')],_0x3c98ac['joins'][_0x33ed30][_0x07ee('0x85')]));}}}if(_0x3c98ac[_0x07ee('0x86')]){_0x3c98ac[_0x07ee('0x86')]=JSON['parse'](_0x3c98ac[_0x07ee('0x86')]);_0x38c946[_0x07ee('0x3f')](_0x677fc6(_0x3c98ac[_0x07ee('0x86')]['group']));}_0x33d648=_0x38c946['clone']();_0x38c946[_0x07ee('0x1f')](_0x2e34cf);_0x38c946[_0x07ee('0x1d')](0x0);logger[_0x07ee('0x88')](_0x07ee('0xa8'),_0x38c946[_0x07ee('0xa0')]());return dbH['sequelize'][_0x07ee('0x35')](_0x38c946[_0x07ee('0xa0')](),{'type':dbH[_0x07ee('0x89')]['QueryTypes']['SELECT']});}})[_0x07ee('0x25')](function(){return{'sql':_0x33d648[_0x07ee('0xa0')]()};})[_0x07ee('0x25')](respondWithResult(_0x58ccfb,null))[_0x07ee('0x49')](handleError(_0x58ccfb,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 72a1917..facf8b6 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 _0x0ae8=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','analytics_custom_reports'];(function(_0x28e595,_0x281bc7){var _0xcc8b98=function(_0x2bf298){while(--_0x2bf298){_0x28e595['push'](_0x28e595['shift']());}};_0xcc8b98(++_0x281bc7);}(_0x0ae8,0x1e4));var _0x80ae=function(_0x23f1a8,_0x32fd1e){_0x23f1a8=_0x23f1a8-0x0;var _0xabb4f1=_0x0ae8[_0x23f1a8];return _0xabb4f1;};'use strict';var _=require(_0x80ae('0x0'));var util=require(_0x80ae('0x1'));var logger=require('../../config/logger')(_0x80ae('0x2'));var moment=require(_0x80ae('0x3'));var BPromise=require(_0x80ae('0x4'));var rp=require(_0x80ae('0x5'));var fs=require('fs');var path=require(_0x80ae('0x6'));var rimraf=require(_0x80ae('0x7'));var config=require(_0x80ae('0x8'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x39655e,_0x286eca){return _0x39655e[_0x80ae('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x80ae('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0eef=['analytics_custom_reports','lodash','util','../../config/logger','api','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x98d782,_0x11d9e0){var _0x3bcbb4=function(_0x312960){while(--_0x312960){_0x98d782['push'](_0x98d782['shift']());}};_0x3bcbb4(++_0x11d9e0);}(_0x0eef,0xa6));var _0xf0ee=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0eef[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xf0ee('0x0'));var util=require(_0xf0ee('0x1'));var logger=require(_0xf0ee('0x2'))(_0xf0ee('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0ee('0x4'));var rimraf=require('rimraf');var config=require(_0xf0ee('0x5'));var attributes=require(_0xf0ee('0x6'));module[_0xf0ee('0x7')]=function(_0x535ba4,_0x34320b){return _0x535ba4[_0xf0ee('0x8')](_0xf0ee('0x9'),attributes,{'tableName':_0xf0ee('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 7c9cbcf..3891901 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 _0x689b=['then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x412dd8,_0x355780){var _0x47b96=function(_0x58b680){while(--_0x58b680){_0x412dd8['push'](_0x412dd8['shift']());}};_0x47b96(++_0x355780);}(_0x689b,0x1d4));var _0xb689=function(_0x39c217,_0x16ef9e){_0x39c217=_0x39c217-0x0;var _0x278dbc=_0x689b[_0x39c217];return _0x278dbc;};'use strict';var _=require(_0xb689('0x0'));var util=require(_0xb689('0x1'));var moment=require(_0xb689('0x2'));var BPromise=require('bluebird');var rs=require(_0xb689('0x3'));var fs=require('fs');var Redis=require(_0xb689('0x4'));var db=require(_0xb689('0x5'))['db'];var utils=require(_0xb689('0x6'));var logger=require(_0xb689('0x7'))(_0xb689('0x8'));var config=require('../../config/environment');var jayson=require(_0xb689('0x9'));var client=jayson['client'][_0xb689('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19437f,_0x1e0193,_0x33ba79){return new BPromise(function(_0x3e2ab8,_0x1c7ea8){return client[_0xb689('0xb')](_0x19437f,_0x33ba79)[_0xb689('0xc')](function(_0x5df625){logger['info'](_0xb689('0xd'),_0x1e0193,_0xb689('0xe'));logger[_0xb689('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1e0193,_0xb689('0xe'),JSON[_0xb689('0x10')](_0x5df625));if(_0x5df625[_0xb689('0x11')]){if(_0x5df625[_0xb689('0x11')][_0xb689('0x12')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x1e0193,_0x5df625[_0xb689('0x11')]['message']);return _0x1c7ea8(_0x5df625[_0xb689('0x11')][_0xb689('0x13')]);}logger[_0xb689('0x11')](_0xb689('0xd'),_0x1e0193,_0x5df625[_0xb689('0x11')]['message']);return _0x3e2ab8(_0x5df625[_0xb689('0x11')][_0xb689('0x13')]);}else{logger['info'](_0xb689('0xd'),_0x1e0193,_0xb689('0xe'));_0x3e2ab8(_0x5df625['result'][_0xb689('0x13')]);}})['catch'](function(_0x12dd91){logger['error'](_0xb689('0xd'),_0x1e0193,_0x12dd91);_0x1c7ea8(_0x12dd91);});});} \ No newline at end of file +var _0xe9b3=['info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0xe9b3,0x8e));var _0x3e9b=function(_0x4e8f16,_0x1696bd){_0x4e8f16=_0x4e8f16-0x0;var _0x3df257=_0xe9b3[_0x4e8f16];return _0x3df257;};'use strict';var _=require('lodash');var util=require(_0x3e9b('0x0'));var moment=require(_0x3e9b('0x1'));var BPromise=require(_0x3e9b('0x2'));var rs=require(_0x3e9b('0x3'));var fs=require('fs');var Redis=require(_0x3e9b('0x4'));var db=require(_0x3e9b('0x5'))['db'];var utils=require(_0x3e9b('0x6'));var logger=require(_0x3e9b('0x7'))(_0x3e9b('0x8'));var config=require(_0x3e9b('0x9'));var jayson=require(_0x3e9b('0xa'));var client=jayson['client'][_0x3e9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c0338,_0x85569e,_0xca41db){return new BPromise(function(_0x230479,_0x2ded00){return client['request'](_0x4c0338,_0xca41db)['then'](function(_0x2e1c2e){logger[_0x3e9b('0xc')](_0x3e9b('0xd'),_0x85569e,'request\x20sent');logger['debug'](_0x3e9b('0xe'),_0x85569e,_0x3e9b('0xf'),JSON[_0x3e9b('0x10')](_0x2e1c2e));if(_0x2e1c2e[_0x3e9b('0x11')]){if(_0x2e1c2e[_0x3e9b('0x11')][_0x3e9b('0x12')]===0x1f4){logger[_0x3e9b('0x11')](_0x3e9b('0xd'),_0x85569e,_0x2e1c2e[_0x3e9b('0x11')][_0x3e9b('0x13')]);return _0x2ded00(_0x2e1c2e['error'][_0x3e9b('0x13')]);}logger[_0x3e9b('0x11')](_0x3e9b('0xd'),_0x85569e,_0x2e1c2e[_0x3e9b('0x11')][_0x3e9b('0x13')]);return _0x230479(_0x2e1c2e[_0x3e9b('0x11')][_0x3e9b('0x13')]);}else{logger[_0x3e9b('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x85569e,_0x3e9b('0xf'));_0x230479(_0x2e1c2e[_0x3e9b('0x14')]['message']);}})[_0x3e9b('0x15')](function(_0x98adf2){logger[_0x3e9b('0x11')](_0x3e9b('0xd'),_0x85569e,_0x98adf2);_0x2ded00(_0x98adf2);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 4ec2dc5..14a0cca 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 _0xf7ce=['../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','get','/:id/query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xf7ce,0x1c3));var _0xef7c=function(_0x430ebd,_0x1b296a){_0x430ebd=_0x430ebd-0x0;var _0x717b5a=_0xf7ce[_0x430ebd];return _0x717b5a;};'use strict';var multer=require(_0xef7c('0x0'));var util=require(_0xef7c('0x1'));var path=require(_0xef7c('0x2'));var timeout=require(_0xef7c('0x3'));var express=require(_0xef7c('0x4'));var router=express[_0xef7c('0x5')]();var fs_extra=require(_0xef7c('0x6'));var auth=require(_0xef7c('0x7'));var interaction=require(_0xef7c('0x8'));var config=require(_0xef7c('0x9'));var controller=require(_0xef7c('0xa'));router['get']('/',auth[_0xef7c('0xb')](),controller[_0xef7c('0xc')]);router['get'](_0xef7c('0xd'),auth[_0xef7c('0xb')](),controller['show']);router['get'](_0xef7c('0xe'),auth[_0xef7c('0xb')](),controller[_0xef7c('0xf')]);router['get'](_0xef7c('0x10'),auth[_0xef7c('0xb')](),controller[_0xef7c('0x11')]);router[_0xef7c('0x12')](_0xef7c('0x13'),auth[_0xef7c('0xb')](),controller['query']);router[_0xef7c('0x14')]('/',auth['isAuthenticated'](),controller[_0xef7c('0x15')]);router[_0xef7c('0x16')](_0xef7c('0xd'),auth[_0xef7c('0xb')](),controller[_0xef7c('0x17')]);router[_0xef7c('0x18')](_0xef7c('0xd'),auth['isAuthenticated'](),controller[_0xef7c('0x19')]);module[_0xef7c('0x1a')]=router; \ No newline at end of file +var _0xea4d=['run','/:id/query','post','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0xea4d,0x13e));var _0xdea4=function(_0x264b92,_0x56d69e){_0x264b92=_0x264b92-0x0;var _0x3b8098=_0xea4d[_0x264b92];return _0x3b8098;};'use strict';var multer=require(_0xdea4('0x0'));var util=require(_0xdea4('0x1'));var path=require(_0xdea4('0x2'));var timeout=require(_0xdea4('0x3'));var express=require(_0xdea4('0x4'));var router=express[_0xdea4('0x5')]();var fs_extra=require(_0xdea4('0x6'));var auth=require(_0xdea4('0x7'));var interaction=require(_0xdea4('0x8'));var config=require(_0xdea4('0x9'));var controller=require(_0xdea4('0xa'));router[_0xdea4('0xb')]('/',auth[_0xdea4('0xc')](),controller[_0xdea4('0xd')]);router[_0xdea4('0xb')](_0xdea4('0xe'),auth[_0xdea4('0xc')](),controller['show']);router['get'](_0xdea4('0xf'),auth['isAuthenticated'](),controller[_0xdea4('0x10')]);router[_0xdea4('0xb')](_0xdea4('0x11'),auth[_0xdea4('0xc')](),controller[_0xdea4('0x12')]);router[_0xdea4('0xb')](_0xdea4('0x13'),auth[_0xdea4('0xc')](),controller['query']);router[_0xdea4('0x14')]('/',auth[_0xdea4('0xc')](),controller['create']);router[_0xdea4('0x15')](_0xdea4('0xe'),auth[_0xdea4('0xc')](),controller[_0xdea4('0x16')]);router['delete'](_0xdea4('0xe'),auth[_0xdea4('0xc')](),controller['destroy']);module[_0xdea4('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 887ffa9..5ede5d8 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 _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7da7,0x10d));var _0x77da=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x7da7[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x4cfc35,_0xb52690){var _0x43a384=function(_0x3d896f){while(--_0x3d896f){_0x4cfc35['push'](_0x4cfc35['shift']());}};_0x43a384(++_0xb52690);}(_0x24ca,0x1bc));var _0xa24c=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x24ca[_0x35007a];return _0x574f68;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 42c17e7..80d85d8 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 _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x4d03f4,_0x10ab16){var _0x59318a=function(_0x56f954){while(--_0x56f954){_0x4d03f4['push'](_0x4d03f4['shift']());}};_0x59318a(++_0x10ab16);}(_0xba34,0x119));var _0x4ba3=function(_0x397ebd,_0x367595){_0x397ebd=_0x397ebd-0x0;var _0x26d356=_0xba34[_0x397ebd];return _0x26d356;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));}; \ No newline at end of file +var _0x46ed=['SEC_TO_TIME(%s)','value','AnalyticMetric','select','DESC','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','MIN(%s)','AVG(%s)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','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','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','QueryTypes','SELECT'];(function(_0x2a74f5,_0x542b0b){var _0x358258=function(_0x52e19e){while(--_0x52e19e){_0x2a74f5['push'](_0x2a74f5['shift']());}};_0x358258(++_0x542b0b);}(_0x46ed,0x168));var _0xd46e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x46ed[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xcc;return function(_0x53b309){if(_0x53b309){return _0xf3048c['sendStatus'](_0x27dbfb);}return _0xf3048c[_0xd46e('0x1a')](_0x27dbfb)[_0xd46e('0x1b')]();};}function respondWithResult(_0x1e9aae,_0x3fdf88){_0x3fdf88=_0x3fdf88||0xc8;return function(_0x50c7c3){if(_0x50c7c3){return _0x1e9aae[_0xd46e('0x1a')](_0x3fdf88)[_0xd46e('0x1c')](_0x50c7c3);}};}function respondWithFilteredResult(_0x417402,_0x3d72ce){return function(_0x36a317){if(_0x36a317){var _0x47fa8f=typeof _0x3d72ce[_0xd46e('0x1d')]===_0xd46e('0x1e')&&typeof _0x3d72ce[_0xd46e('0x1f')]==='undefined';var _0x5ddd04=_0x36a317[_0xd46e('0x20')];var _0x1bd574=_0x47fa8f?0x0:_0x3d72ce['offset'];var _0x4fd1f2=_0x47fa8f?_0x36a317[_0xd46e('0x20')]:_0x3d72ce[_0xd46e('0x1d')]+_0x3d72ce[_0xd46e('0x1f')];var _0x2273c5;if(_0x4fd1f2>=_0x5ddd04){_0x4fd1f2=_0x5ddd04;_0x2273c5=0xc8;}else{_0x2273c5=0xce;}_0x417402[_0xd46e('0x1a')](_0x2273c5);return _0x417402[_0xd46e('0x21')](_0xd46e('0x22'),_0x1bd574+'-'+_0x4fd1f2+'/'+_0x5ddd04)[_0xd46e('0x1c')](_0x36a317);}return null;};}function patchUpdates(_0xb4940){return function(_0x3c7e91){try{jsonpatch[_0xd46e('0x23')](_0x3c7e91,_0xb4940,!![]);}catch(_0x5ba94d){return BPromise[_0xd46e('0x24')](_0x5ba94d);}return _0x3c7e91[_0xd46e('0x25')]();};}function saveUpdates(_0x79aa51,_0x45ce0b){return function(_0x128246){if(_0x128246){return _0x128246[_0xd46e('0x26')](_0x79aa51)[_0xd46e('0x27')](function(_0x8a1be){return _0x8a1be;});}return null;};}function removeEntity(_0x62dea5,_0x4cf899){return function(_0x314570){if(_0x314570){return _0x314570['destroy']()['then'](function(){var _0x371054=_0x314570[_0xd46e('0x28')]({'plain':!![]});var _0x21135f=_0xd46e('0x29');return db[_0xd46e('0x2a')][_0xd46e('0x2b')]({'where':{'type':_0x21135f,'resourceId':_0x371054['id']}})[_0xd46e('0x27')](function(){return _0x314570;});})['then'](function(){_0x62dea5[_0xd46e('0x1a')](0xcc)[_0xd46e('0x1b')]();});}};}function handleEntityNotFound(_0xddbce9,_0x17db79){return function(_0x96f15c){if(!_0x96f15c){_0xddbce9[_0xd46e('0x2c')](0x194);}return _0x96f15c;};}function handleError(_0x58aeef,_0x465d54){_0x465d54=_0x465d54||0x1f4;return function(_0x3a1ced){logger[_0xd46e('0x2d')](_0x3a1ced[_0xd46e('0x2e')]);if(_0x3a1ced[_0xd46e('0x2f')]){delete _0x3a1ced[_0xd46e('0x2f')];}_0x58aeef[_0xd46e('0x1a')](_0x465d54)[_0xd46e('0x30')](_0x3a1ced);};}exports[_0xd46e('0x31')]=function(_0x45ea47,_0x2ff785){var _0x504324={},_0x2f4a1b={},_0x5ed8dc={'count':0x0,'rows':[]};var _0x1248ce=_[_0xd46e('0x32')](db[_0xd46e('0x33')][_0xd46e('0x34')],function(_0x5ef248){return{'name':_0x5ef248[_0xd46e('0x35')],'type':_0x5ef248[_0xd46e('0x36')]['key']};});_0x2f4a1b[_0xd46e('0x37')]=_[_0xd46e('0x32')](_0x1248ce,'name');_0x2f4a1b[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x45ea47[_0xd46e('0x38')]);_0x2f4a1b['filters']=_['intersection'](_0x2f4a1b[_0xd46e('0x37')],_0x2f4a1b[_0xd46e('0x38')]);_0x504324[_0xd46e('0x3a')]=_[_0xd46e('0x3b')](_0x2f4a1b[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x504324['attributes']=_0x504324[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x504324[_0xd46e('0x3a')]:_0x2f4a1b[_0xd46e('0x37')];if(!_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3e')](_0xd46e('0x3f'))){_0x504324['limit']=qs[_0xd46e('0x1f')](_0x45ea47[_0xd46e('0x38')]['limit']);_0x504324[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x1d')]);}_0x504324['order']=qs[_0xd46e('0x40')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x40')]);_0x504324[_0xd46e('0x41')]=qs[_0xd46e('0x42')](_[_0xd46e('0x43')](_0x45ea47[_0xd46e('0x38')],_0x2f4a1b[_0xd46e('0x42')]),_0x1248ce);if(_0x45ea47['query'][_0xd46e('0x44')]){_0x504324[_0xd46e('0x41')]=_[_0xd46e('0x45')](_0x504324[_0xd46e('0x41')],{'$or':_[_0xd46e('0x32')](_0x1248ce,function(_0x56f99c){if(_0x56f99c[_0xd46e('0x36')]!=='VIRTUAL'){var _0x55230d={};_0x55230d[_0x56f99c['name']]={'$like':'%'+_0x45ea47['query'][_0xd46e('0x44')]+'%'};return _0x55230d;}})});}_0x504324=_['merge']({},_0x504324,_0x45ea47[_0xd46e('0x46')]);var _0x40720e={'where':_0x504324['where']};return db[_0xd46e('0x33')][_0xd46e('0x20')](_0x40720e)[_0xd46e('0x27')](function(_0x31ba12){_0x5ed8dc[_0xd46e('0x20')]=_0x31ba12;if(_0x45ea47[_0xd46e('0x38')][_0xd46e('0x47')]){_0x504324[_0xd46e('0x48')]=[{'all':!![]}];}return db[_0xd46e('0x33')][_0xd46e('0x49')](_0x504324);})[_0xd46e('0x27')](function(_0x5ea048){_0x5ed8dc['rows']=_0x5ea048;return _0x5ed8dc;})['then'](respondWithFilteredResult(_0x2ff785,_0x504324))[_0xd46e('0x4a')](handleError(_0x2ff785,null));};exports['show']=function(_0x168d35,_0x272f5f){var _0x3fdf67={'raw':!![],'where':{'id':_0x168d35[_0xd46e('0x4b')]['id']}},_0x416505={};_0x416505[_0xd46e('0x37')]=_[_0xd46e('0x39')](db[_0xd46e('0x33')]['rawAttributes']);_0x416505[_0xd46e('0x38')]=_['keys'](_0x168d35[_0xd46e('0x38')]);_0x416505[_0xd46e('0x42')]=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],_0x416505[_0xd46e('0x38')]);_0x3fdf67['attributes']=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x168d35[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x3fdf67['attributes']=_0x3fdf67[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x3fdf67[_0xd46e('0x3a')]:_0x416505[_0xd46e('0x37')];if(_0x168d35[_0xd46e('0x38')]['includeAll']){_0x3fdf67[_0xd46e('0x48')]=[{'all':!![]}];}_0x3fdf67=_[_0xd46e('0x45')]({},_0x3fdf67,_0x168d35[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fdf67)[_0xd46e('0x27')](handleEntityNotFound(_0x272f5f,null))[_0xd46e('0x27')](respondWithResult(_0x272f5f,null))[_0xd46e('0x4a')](handleError(_0x272f5f,null));};exports['create']=function(_0xf9dab,_0x71a8dc){return db[_0xd46e('0x33')][_0xd46e('0x4d')](_0xf9dab[_0xd46e('0x4e')],{})['then'](function(_0x4ae314){var _0x3a94cf=_0xf9dab[_0xd46e('0x4f')][_0xd46e('0x28')]({'plain':!![]});if(!_0x3a94cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a94cf['role']===_0xd46e('0x4f')){var _0x9d8638=_0x4ae314['get']({'plain':!![]});var _0x2eee92=_0xd46e('0x50');return db[_0xd46e('0x51')][_0xd46e('0x4c')]({'where':{'name':_0x2eee92,'userProfileId':_0x3a94cf[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x27')](function(_0x80ed51){if(_0x80ed51&&_0x80ed51[_0xd46e('0x53')]===0x0){return db['UserProfileResource'][_0xd46e('0x4d')]({'name':_0x9d8638[_0xd46e('0x2f')],'resourceId':_0x9d8638['id'],'type':_0xd46e('0x29'),'sectionId':_0x80ed51['id']},{})[_0xd46e('0x27')](function(){return _0x4ae314;});}else{return _0x4ae314;}})['catch'](function(_0x56dd9a){logger[_0xd46e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56dd9a);throw _0x56dd9a;});}return _0x4ae314;})[_0xd46e('0x27')](respondWithResult(_0x71a8dc,0xc9))[_0xd46e('0x4a')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x26')]=function(_0x31f7eb,_0x5a7870){if(_0x31f7eb[_0xd46e('0x4e')]['id']){delete _0x31f7eb['body']['id'];}return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x31f7eb[_0xd46e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7870,null))[_0xd46e('0x27')](saveUpdates(_0x31f7eb[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x5a7870,null))[_0xd46e('0x4a')](handleError(_0x5a7870,null));};exports[_0xd46e('0x2b')]=function(_0x2cc676,_0x2760ef){return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x2cc676[_0xd46e('0x4b')]['id']}})[_0xd46e('0x27')](handleEntityNotFound(_0x2760ef,null))[_0xd46e('0x27')](removeEntity(_0x2760ef,null))[_0xd46e('0x4a')](handleError(_0x2760ef,null));};exports[_0xd46e('0x54')]=function(_0x47a86c,_0x3ec709){var _0x37a22f=0xa;var _0xe0cd61=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0xaf9641={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x481dce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x2dacb4=function(_0x2f9fcb){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x2f9fcb);};var _0x1aaa99=function(_0x272514){if(!_0x272514||!_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x476f09='(',_0x5067b7=0x0;_0x5067b7<_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')];_0x5067b7+=0x1){_0x5067b7>0x0&&(_0x476f09+='\x20'+_0x272514[_0xd46e('0x68')]+'\x20');_0x476f09+=_0x272514['rules'][_0x5067b7][_0xd46e('0x69')]?_0x1aaa99(_0x272514[_0xd46e('0x67')][_0x5067b7]['group']):_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6a')]+'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['condition']+(_0x2dacb4(_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6b')])?'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['value']:'');}return _0x476f09+')';};var _0xe5f8cd={'where':{'id':_0x47a86c[_0xd46e('0x4b')]['id']}},_0x516e7d,_0x32eed0,_0x148187,_0x35db1b,_0x4f3ba0;_0xe5f8cd=_[_0xd46e('0x45')]({},_0xe5f8cd,_0x47a86c[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0xe5f8cd)[_0xd46e('0x27')](function(_0x16f906){if(_0x16f906){_0x516e7d=_0x16f906;return _0x16f906[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0x3e55a3){if(_0x3e55a3){if(!_0x3e55a3[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))](_0xd46e('0x6f'),0x193);}_0x32eed0=_0x3e55a3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3e0ed5){if(_0x3e0ed5){_0x148187=_[_0xd46e('0x70')](_0x3e0ed5,'id');var _0x2fff69;var _0x249938=squel['select']();_0x249938[_0xd46e('0x71')](_0x516e7d[_0xd46e('0x72')]);for(var _0xfb4073=0x0;_0xfb4073<_0x32eed0[_0xd46e('0x3d')];_0xfb4073+=0x1){_0x2fff69=_0x32eed0[_0xfb4073]['MetricId']?_0x148187[_0x32eed0[_0xfb4073][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x32eed0[_0xfb4073]['field'];_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0xaf9641[_0x32eed0[_0xfb4073]['function']],'%s',_0x2fff69):_0x2fff69;_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x481dce[_0x32eed0[_0xfb4073]['format']],'%s',_0x2fff69):_0x2fff69;if(_0x32eed0[_0xfb4073][_0xd46e('0x78')]){_0x249938['group'](_0x2fff69);}_0x32eed0[_0xfb4073][_0xd46e('0x79')]&&_0x249938[_0xd46e('0x7a')](_0x2fff69,_0x32eed0[_0xfb4073]['orderBy']==='DESC'?![]:!![]);_0x249938[_0xd46e('0x6a')](_0x2fff69,_0x32eed0[_0xfb4073][_0xd46e('0x7b')]||_0x2fff69);}if(_0x516e7d[_0xd46e('0x7c')]){_0x516e7d[_0xd46e('0x7c')]=JSON['parse'](_0x516e7d[_0xd46e('0x7c')]);for(var _0x372509=0x0;_0x372509<_0x516e7d['joins'][_0xd46e('0x3d')];_0x372509+=0x1){if(_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0xe0cd61,_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')])&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7d')]&&_0x516e7d[_0xd46e('0x7c')][_0x372509]['foreignTable']&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7e')]){_0x249938[_0x516e7d['joins'][_0x372509][_0xd46e('0x36')]](_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0x516e7d[_0xd46e('0x72')],_0x516e7d['joins'][_0x372509]['parentKey'],_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],_0x516e7d['joins'][_0x372509]['foreignKey']));}}}if(_0x516e7d['conditions']){_0x516e7d[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x516e7d[_0xd46e('0x81')]);_0x249938['where'](_0x1aaa99(_0x516e7d[_0xd46e('0x81')][_0xd46e('0x69')]));}_0x4f3ba0=_0x249938[_0xd46e('0x83')]();_0x249938['limit'](_0x37a22f);_0x249938['offset'](0x0);logger['debug']('Limited\x20Query:',_0x249938[_0xd46e('0x84')]());return dbH['sequelize'][_0xd46e('0x38')](_0x249938['toString'](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](respondWithResult(_0x3ec709,null))[_0xd46e('0x4a')](handleError(_0x3ec709,null));};function runReport(_0xf16d87,_0x99872a,_0x57a7cc){var _0x586024=_0x99872a[_0xd46e('0x2f')];var _0x383919=0xa;var _0x114f2c=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0x4ca21f={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x5ef4cc={'SEC_TO_TIME':_0xd46e('0x87'),'DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x88460a=function(_0x3a3744){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x3a3744);};var _0x3c476d=function(_0x1b2a6d){if(!_0x1b2a6d||!_0x1b2a6d[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x441f73='(',_0x1d2738=0x0;_0x1d2738<_0x1b2a6d['rules'][_0xd46e('0x3d')];_0x1d2738+=0x1){_0x1d2738>0x0&&(_0x441f73+='\x20'+_0x1b2a6d['operator']+'\x20');_0x441f73+=_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x69')]?_0x3c476d(_0x1b2a6d['rules'][_0x1d2738][_0xd46e('0x69')]):_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6a')]+'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')]+(_0x88460a(_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')])?'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x88')]:'');}return _0x441f73+')';};var _0x3fa34d={'where':{'id':_0xf16d87['id']}},_0xc098c9,_0x5f5ba7,_0x493df5,_0x18e140,_0x459a0c;_0x3fa34d=_[_0xd46e('0x45')]({},_0x3fa34d,_0x57a7cc);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fa34d)[_0xd46e('0x27')](function(_0x5b554e){if(_0x5b554e){_0xc098c9=_0x5b554e;return _0x5b554e[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0xa254f5){if(_0xa254f5){if(!_0xa254f5[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f5ba7=_0xa254f5;return db[_0xd46e('0x89')][_0xd46e('0x49')]({'raw':!![]});}return null;})['then'](function(_0x3c8d68){if(_0x3c8d68){_0x493df5=_[_0xd46e('0x70')](_0x3c8d68,'id');var _0x9e222d;var _0x3da17e=squel[_0xd46e('0x8a')]();_0x3da17e[_0xd46e('0x71')](_0xc098c9[_0xd46e('0x72')]);for(var _0x282f71=0x0;_0x282f71<_0x5f5ba7[_0xd46e('0x3d')];_0x282f71+=0x1){_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x73')]?_0x493df5[_0x5f5ba7[_0x282f71][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x5f5ba7[_0x282f71][_0xd46e('0x6a')];_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x75')]?_['replace'](_0x4ca21f[_0x5f5ba7[_0x282f71]['function']],'%s',_0x9e222d):_0x9e222d;_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x5ef4cc[_0x5f5ba7[_0x282f71][_0xd46e('0x77')]],'%s',_0x9e222d):_0x9e222d;if(_0x5f5ba7[_0x282f71][_0xd46e('0x78')]){_0x3da17e[_0xd46e('0x69')](_0x9e222d);}_0x5f5ba7[_0x282f71][_0xd46e('0x79')]&&_0x3da17e['order'](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x3da17e[_0xd46e('0x6a')](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x7b')]||_0x9e222d);}if(_0xc098c9['joins']){_0xc098c9[_0xd46e('0x7c')]=JSON[_0xd46e('0x82')](_0xc098c9['joins']);for(var _0xdf967c=0x0;_0xdf967c<_0xc098c9['joins']['length'];_0xdf967c+=0x1){if(_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x114f2c,_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['type'])&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7d')]&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7f')]&&_0xc098c9['joins'][_0xdf967c]['foreignKey']){_0x3da17e[_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]](_0xc098c9['joins'][_0xdf967c]['foreignTable'],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0xc098c9[_0xd46e('0x72')],_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['parentKey'],_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x7f')],_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7e')]));}}}if(_0xc098c9[_0xd46e('0x81')]){_0xc098c9[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0xc098c9[_0xd46e('0x81')]);_0x3da17e[_0xd46e('0x41')](_0x3c476d(_0xc098c9['conditions'][_0xd46e('0x69')]));}_0x459a0c=_0x3da17e[_0xd46e('0x83')]();_0x3da17e['limit'](_0x383919);_0x3da17e['offset'](0x0);return;}})[_0xd46e('0x27')](function(){if(_0x99872a[_0xd46e('0x8c')]==='web'){return null;}var _0x5e637d=_[_0xd46e('0x45')](_0x99872a,{'name':_0x99872a[_0xd46e('0x8d')]||_0x99872a['name']||_0xc098c9[_0xd46e('0x2f')],'basename':_0x586024,'savename':util[_0xd46e('0x77')](_0xd46e('0x8e'),_0x99872a[_0xd46e('0x2f')]||_0xc098c9[_0xd46e('0x2f')],require(_0xd46e('0x8f'))['generate'](0x4),_0x99872a[_0xd46e('0x8c')]||_0xd46e('0x90')),'reportId':_0xc098c9['id'],'reportType':_0xd46e('0x91')});return db[_0xd46e('0x92')][_0xd46e('0x4d')](_0x5e637d,{'raw':!![]});})[_0xd46e('0x27')](function(_0x3311a6){if(_0xc098c9[_0xd46e('0x72')]===_0xd46e('0x93')){_0x459a0c[_0xd46e('0x41')](_0xc098c9[_0xd46e('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x99872a[_0xd46e('0x94')],_0x99872a['endDate']);}else{_0x459a0c['where'](_0xc098c9[_0xd46e('0x72')]+_0xd46e('0x95'),_0x99872a[_0xd46e('0x94')],_0x99872a[_0xd46e('0x96')]);}if(_0x3311a6){logger[_0xd46e('0x97')](_0xd46e('0x98'),_0x459a0c[_0xd46e('0x84')]());require(_0xd46e('0x99'))['fork'](path[_0xd46e('0x55')](__dirname,'../../components/export/',_0x3311a6[_0xd46e('0x8c')]),[_0x3311a6['id'],_0x459a0c[_0xd46e('0x84')](),path[_0xd46e('0x55')](__dirname,_0xd46e('0x9a'),_0x3311a6[_0xd46e('0x9b')]),_0x586024]);return _0x3311a6;}else{var _0x399918=squel[_0xd46e('0x8a')]();_0x399918[_0xd46e('0x71')]('('+_0x459a0c['toString']()+')',_0xd46e('0x9c'));_0x399918[_0xd46e('0x6a')](_0xd46e('0x9d'),'count');_0x459a0c[_0xd46e('0x1f')](_0x99872a[_0xd46e('0x1f')]||_0x383919);_0x459a0c[_0xd46e('0x1d')](_0x99872a['offset']||0x0);return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x399918[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]})['then'](function(_0x4967ff){if(!_0x4967ff[_0xd46e('0x3d')]){_0x18e140=0x0;}else{_0x18e140=_0x4967ff[0x0][_0xd46e('0x20')]||0x0;}return dbH['sequelize'][_0xd46e('0x38')](_0x459a0c[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]});})[_0xd46e('0x27')](function(_0x4bb76b){return{'rows':_0x4bb76b||[],'count':_0x18e140};});}});}exports['run']=function(_0x204a9f,_0x52ca5a){return runReport(_0x204a9f[_0xd46e('0x4b')],_0x204a9f[_0xd46e('0x38')],_0x204a9f['options'])[_0xd46e('0x27')](respondWithResult(_0x52ca5a,null))[_0xd46e('0x4a')](handleError(_0x52ca5a,null));};exports[_0xd46e('0x9f')]=runReport;exports[_0xd46e('0x38')]=function(_0x786ae,_0x537c73){var _0x1610bd=0xa;var _0x20cc4c=[_0xd46e('0x55'),_0xd46e('0xa0'),_0xd46e('0x56'),_0xd46e('0x57')];var _0x368742={'SUM':_0xd46e('0x58'),'COUNT':_0xd46e('0xa1'),'COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':_0xd46e('0xa2'),'AVG':_0xd46e('0xa3'),'GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x285cf8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc87da2=function(_0x195f02){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),'IS\x20NOT\x20NULL',_0xd46e('0x65'),_0xd46e('0x66')],_0x195f02);};var _0x44322f=function(_0x49959f){if(!_0x49959f||!_0x49959f['rules'][_0xd46e('0x3d')]){return'';}for(var _0x2094e5='(',_0x85aac1=0x0;_0x85aac1<_0x49959f[_0xd46e('0x67')][_0xd46e('0x3d')];_0x85aac1+=0x1){_0x85aac1>0x0&&(_0x2094e5+='\x20'+_0x49959f[_0xd46e('0x68')]+'\x20');_0x2094e5+=_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]?_0x44322f(_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]):_0x49959f['rules'][_0x85aac1][_0xd46e('0x6a')]+'\x20'+_0x49959f['rules'][_0x85aac1]['condition']+(_0xc87da2(_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x6b')])?'\x20'+_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x88')]:'');}return _0x2094e5+')';};var _0x101a29={'where':{'id':_0x786ae[_0xd46e('0x4b')]['id']}},_0x3a44da,_0x417068,_0x52e73e,_0x206077,_0xe729b6;_0x101a29=_[_0xd46e('0x45')]({},_0x101a29,_0x786ae[_0xd46e('0x46')]);return db['AnalyticDefaultReport'][_0xd46e('0x4c')](_0x101a29)[_0xd46e('0x27')](function(_0x1d08bb){if(_0x1d08bb){_0x3a44da=_0x1d08bb;return _0x1d08bb['getFields']();}return null;})[_0xd46e('0x27')](function(_0x8c6ed1){if(_0x8c6ed1){if(!_0x8c6ed1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xd46e('0x6f'),0x193);}_0x417068=_0x8c6ed1;return db[_0xd46e('0x89')]['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3a13f8){if(_0x3a13f8){_0x52e73e=_['keyBy'](_0x3a13f8,'id');var _0x5a8661;var _0x157fb0=squel[_0xd46e('0x8a')]();_0x157fb0[_0xd46e('0x71')](_0x3a44da[_0xd46e('0x72')]);for(var _0x50750f=0x0;_0x50750f<_0x417068['length'];_0x50750f+=0x1){_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x73')]?_0x52e73e[_0x417068[_0x50750f][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x417068[_0x50750f][_0xd46e('0x6a')];_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0x368742[_0x417068[_0x50750f][_0xd46e('0x75')]],'%s',_0x5a8661):_0x5a8661;_0x5a8661=_0x417068[_0x50750f]['format']?_[_0xd46e('0x76')](_0x285cf8[_0x417068[_0x50750f][_0xd46e('0x77')]],'%s',_0x5a8661):_0x5a8661;if(_0x417068[_0x50750f]['groupBy']){_0x157fb0[_0xd46e('0x69')](_0x5a8661);}_0x417068[_0x50750f][_0xd46e('0x79')]&&_0x157fb0[_0xd46e('0x7a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x157fb0[_0xd46e('0x6a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x7b')]||_0x5a8661);}if(_0x3a44da[_0xd46e('0x7c')]){_0x3a44da['joins']=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x7c')]);for(var _0x3c819b=0x0;_0x3c819b<_0x3a44da[_0xd46e('0x7c')][_0xd46e('0x3d')];_0x3c819b+=0x1){if(_0x3a44da['joins'][_0x3c819b][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x20cc4c,_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')])&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7d')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']){_0x157fb0[_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')]](_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a44da[_0xd46e('0x72')],_0x3a44da['joins'][_0x3c819b][_0xd46e('0x7d')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']));}}}if(_0x3a44da[_0xd46e('0x81')]){_0x3a44da[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x81')]);_0x157fb0[_0xd46e('0x41')](_0x44322f(_0x3a44da[_0xd46e('0x81')][_0xd46e('0x69')]));}_0xe729b6=_0x157fb0[_0xd46e('0x83')]();_0x157fb0[_0xd46e('0x1f')](_0x1610bd);_0x157fb0['offset'](0x0);logger['debug'](_0xd46e('0xa4'),_0x157fb0['toString']());return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x157fb0[_0xd46e('0x84')](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](function(){return{'sql':_0xe729b6['toString']()};})['then'](respondWithResult(_0x537c73,null))[_0xd46e('0x4a')](handleError(_0x537c73,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 99e4adc..5fcc7ad 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 _0xe1fb=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe1fb,0x114));var _0xbe1f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe1fb[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0xbe1f('0x0'));var logger=require('../../config/logger')(_0xbe1f('0x1'));var moment=require(_0xbe1f('0x2'));var BPromise=require(_0xbe1f('0x3'));var rp=require(_0xbe1f('0x4'));var fs=require('fs');var path=require(_0xbe1f('0x5'));var rimraf=require(_0xbe1f('0x6'));var config=require(_0xbe1f('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0xbe1f('0x8')]=function(_0x5ca522,_0x43ffb0){return _0x5ca522[_0xbe1f('0x9')](_0xbe1f('0xa'),attributes,{'tableName':_0xbe1f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x888e=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x15083f,_0x5db0da){var _0x4e3d4f=function(_0x4d0feb){while(--_0x4d0feb){_0x15083f['push'](_0x15083f['shift']());}};_0x4e3d4f(++_0x5db0da);}(_0x888e,0x154));var _0xe888=function(_0x3c6c3a,_0x4834c8){_0x3c6c3a=_0x3c6c3a-0x0;var _0x2abc38=_0x888e[_0x3c6c3a];return _0x2abc38;};'use strict';var _=require('lodash');var util=require(_0xe888('0x0'));var logger=require(_0xe888('0x1'))('api');var moment=require(_0xe888('0x2'));var BPromise=require('bluebird');var rp=require(_0xe888('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe888('0x4'));var config=require(_0xe888('0x5'));var attributes=require(_0xe888('0x6'));module[_0xe888('0x7')]=function(_0x5e1079,_0x4b0f5b){return _0x5e1079[_0xe888('0x8')](_0xe888('0x9'),attributes,{'tableName':'analytics_default_reports','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 7528cf0..5c4603c 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 _0x43dc=['error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x520552,_0x568c01){var _0x545f39=function(_0x351b76){while(--_0x351b76){_0x520552['push'](_0x520552['shift']());}};_0x545f39(++_0x568c01);}(_0x43dc,0x181));var _0xc43d=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x43dc[_0x45f951];return _0x24756c;};'use strict';var _=require('lodash');var util=require(_0xc43d('0x0'));var moment=require(_0xc43d('0x1'));var BPromise=require(_0xc43d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc43d('0x3'));var db=require(_0xc43d('0x4'))['db'];var utils=require(_0xc43d('0x5'));var logger=require(_0xc43d('0x6'))('rpc');var config=require(_0xc43d('0x7'));var jayson=require(_0xc43d('0x8'));var client=jayson['client'][_0xc43d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2617b0,_0x48d42d,_0x597bb0){return new BPromise(function(_0x5e8938,_0x5bc9c1){return client[_0xc43d('0xa')](_0x2617b0,_0x597bb0)[_0xc43d('0xb')](function(_0xe18b8f){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x48d42d,_0xc43d('0xc'));logger['debug'](_0xc43d('0xd'),_0x48d42d,_0xc43d('0xc'),JSON[_0xc43d('0xe')](_0xe18b8f));if(_0xe18b8f[_0xc43d('0xf')]){if(_0xe18b8f[_0xc43d('0xf')][_0xc43d('0x10')]===0x1f4){logger['error'](_0xc43d('0x11'),_0x48d42d,_0xe18b8f['error'][_0xc43d('0x12')]);return _0x5bc9c1(_0xe18b8f[_0xc43d('0xf')]['message']);}logger[_0xc43d('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x48d42d,_0xe18b8f[_0xc43d('0xf')][_0xc43d('0x12')]);return _0x5e8938(_0xe18b8f[_0xc43d('0xf')][_0xc43d('0x12')]);}else{logger['info'](_0xc43d('0x11'),_0x48d42d,'request\x20sent');_0x5e8938(_0xe18b8f[_0xc43d('0x13')]['message']);}})['catch'](function(_0x544fe2){logger[_0xc43d('0xf')](_0xc43d('0x11'),_0x48d42d,_0x544fe2);_0x5bc9c1(_0x544fe2);});});} \ No newline at end of file +var _0x3915=['client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x42b339,_0x156232){var _0x2e3e90=function(_0x371492){while(--_0x371492){_0x42b339['push'](_0x42b339['shift']());}};_0x2e3e90(++_0x156232);}(_0x3915,0xfc));var _0x5391=function(_0x305b20,_0x5e57e9){_0x305b20=_0x305b20-0x0;var _0x26d64a=_0x3915[_0x305b20];return _0x26d64a;};'use strict';var _=require(_0x5391('0x0'));var util=require(_0x5391('0x1'));var moment=require(_0x5391('0x2'));var BPromise=require(_0x5391('0x3'));var rs=require(_0x5391('0x4'));var fs=require('fs');var Redis=require(_0x5391('0x5'));var db=require(_0x5391('0x6'))['db'];var utils=require(_0x5391('0x7'));var logger=require(_0x5391('0x8'))(_0x5391('0x9'));var config=require(_0x5391('0xa'));var jayson=require(_0x5391('0xb'));var client=jayson[_0x5391('0xc')][_0x5391('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x448c2c,_0x27768d,_0x313237){return new BPromise(function(_0x4f5f0d,_0x4b0845){return client[_0x5391('0xe')](_0x448c2c,_0x313237)[_0x5391('0xf')](function(_0x2a1391){logger[_0x5391('0x10')](_0x5391('0x11'),_0x27768d,_0x5391('0x12'));logger[_0x5391('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x27768d,'request\x20sent',JSON[_0x5391('0x14')](_0x2a1391));if(_0x2a1391[_0x5391('0x15')]){if(_0x2a1391[_0x5391('0x15')][_0x5391('0x16')]===0x1f4){logger[_0x5391('0x15')](_0x5391('0x11'),_0x27768d,_0x2a1391[_0x5391('0x15')][_0x5391('0x17')]);return _0x4b0845(_0x2a1391[_0x5391('0x15')][_0x5391('0x17')]);}logger[_0x5391('0x15')](_0x5391('0x11'),_0x27768d,_0x2a1391[_0x5391('0x15')][_0x5391('0x17')]);return _0x4f5f0d(_0x2a1391[_0x5391('0x15')][_0x5391('0x17')]);}else{logger['info'](_0x5391('0x11'),_0x27768d,_0x5391('0x12'));_0x4f5f0d(_0x2a1391['result']['message']);}})['catch'](function(_0x91e638){logger[_0x5391('0x15')](_0x5391('0x11'),_0x27768d,_0x91e638);_0x4b0845(_0x91e638);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 7105cbb..8da6041 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 _0x9273=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x3d4969,_0x26d166){var _0x450367=function(_0x1e7833){while(--_0x1e7833){_0x3d4969['push'](_0x3d4969['shift']());}};_0x450367(++_0x26d166);}(_0x9273,0x163));var _0x3927=function(_0x509b99,_0x3ff1f0){_0x509b99=_0x509b99-0x0;var _0x383d46=_0x9273[_0x509b99];return _0x383d46;};'use strict';var multer=require(_0x3927('0x0'));var util=require(_0x3927('0x1'));var path=require(_0x3927('0x2'));var timeout=require('connect-timeout');var express=require(_0x3927('0x3'));var router=express[_0x3927('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3927('0x5'));var config=require(_0x3927('0x6'));var controller=require(_0x3927('0x7'));router[_0x3927('0x8')]('/',auth['isAuthenticated'](),controller[_0x3927('0x9')]);router[_0x3927('0x8')]('/:id',auth[_0x3927('0xa')](),controller[_0x3927('0xb')]);router[_0x3927('0x8')](_0x3927('0xc'),auth['isAuthenticated'](),controller['preview']);router['get'](_0x3927('0xd'),auth[_0x3927('0xa')](),controller[_0x3927('0xe')]);router['get'](_0x3927('0xf'),auth[_0x3927('0xa')](),controller['query']);router[_0x3927('0x10')]('/',auth[_0x3927('0xa')](),controller[_0x3927('0x11')]);router[_0x3927('0x12')](_0x3927('0x13'),auth[_0x3927('0xa')](),controller[_0x3927('0x14')]);router[_0x3927('0x15')](_0x3927('0x13'),auth[_0x3927('0xa')](),controller[_0x3927('0x16')]);module[_0x3927('0x17')]=router; \ No newline at end of file +var _0x6712=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','/:id','isAuthenticated','show','preview','run','/:id/query','post','create','update','delete','exports','multer'];(function(_0xb01fe,_0x3ad179){var _0x35fad8=function(_0x1dcff9){while(--_0x1dcff9){_0xb01fe['push'](_0xb01fe['shift']());}};_0x35fad8(++_0x3ad179);}(_0x6712,0x71));var _0x2671=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x6712[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0x2671('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2671('0x1'));var router=express[_0x2671('0x2')]();var fs_extra=require(_0x2671('0x3'));var auth=require(_0x2671('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2671('0x5'));var controller=require(_0x2671('0x6'));router[_0x2671('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2671('0x7')](_0x2671('0x8'),auth[_0x2671('0x9')](),controller[_0x2671('0xa')]);router[_0x2671('0x7')]('/:id/preview',auth[_0x2671('0x9')](),controller[_0x2671('0xb')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x2671('0xc')]);router['get'](_0x2671('0xd'),auth[_0x2671('0x9')](),controller['query']);router[_0x2671('0xe')]('/',auth[_0x2671('0x9')](),controller[_0x2671('0xf')]);router['put'](_0x2671('0x8'),auth['isAuthenticated'](),controller[_0x2671('0x10')]);router[_0x2671('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2671('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index cfd7f38..6304d32 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 _0xaea5=['moment','STRING','ENUM','csv','xlsx','DATE','Loading','scheduled','manual','INTEGER','UNSIGNED','sequelize'];(function(_0x5cc5e2,_0x25fdbb){var _0x21375b=function(_0x52cd5f){while(--_0x52cd5f){_0x5cc5e2['push'](_0x5cc5e2['shift']());}};_0x21375b(++_0x25fdbb);}(_0xaea5,0xd7));var _0x5aea=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xaea5[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x5aea('0x0'));var moment=require(_0x5aea('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x5aea('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x5aea('0x3')](_0x5aea('0x4'),'pdf',_0x5aea('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x5aea('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5aea('0x6')]},'endDate':{'type':Sequelize[_0x5aea('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x5aea('0x7')},'type':{'type':Sequelize[_0x5aea('0x3')]('manual',_0x5aea('0x8')),'allowNull':![],'defaultValue':_0x5aea('0x9')},'reportId':{'type':Sequelize[_0x5aea('0xa')](0xb)[_0x5aea('0xb')]},'reportType':{'type':Sequelize[_0x5aea('0x2')]}}; \ No newline at end of file +var _0xd07b=['scheduled','UNSIGNED','moment','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual'];(function(_0x37a56f,_0x4c46fe){var _0x28caba=function(_0x13ac5f){while(--_0x13ac5f){_0x37a56f['push'](_0x37a56f['shift']());}};_0x28caba(++_0x4c46fe);}(_0xd07b,0x1d0));var _0xbd07=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd07b[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbd07('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd07('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xbd07('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0xbd07('0x2')](_0xbd07('0x3'),_0xbd07('0x4'),_0xbd07('0x5')),'allowNull':![],'defaultValue':_0xbd07('0x3')},'savename':{'type':Sequelize[_0xbd07('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xbd07('0x6')]},'endDate':{'type':Sequelize[_0xbd07('0x6')]},'status':{'type':Sequelize[_0xbd07('0x1')],'defaultValue':_0xbd07('0x7')},'type':{'type':Sequelize[_0xbd07('0x2')](_0xbd07('0x8'),_0xbd07('0x9')),'allowNull':![],'defaultValue':_0xbd07('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xbd07('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 696137e..1fcf0ef 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 _0x21b8=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','fields','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','download','savename','output','existsSync','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','root','server/files/reports','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','get','name','map','AnalyticExtractedReport','rawAttributes','type','key','query','keys','filters','intersection','model'];(function(_0x5a8542,_0xc0b70b){var _0x11785b=function(_0x4da483){while(--_0x4da483){_0x5a8542['push'](_0x5a8542['shift']());}};_0x11785b(++_0xc0b70b);}(_0x21b8,0xe8));var _0x821b=function(_0x33582a,_0x37fc92){_0x33582a=_0x33582a-0x0;var _0xf0e43c=_0x21b8[_0x33582a];return _0xf0e43c;};'use strict';var emlformat=require(_0x821b('0x0'));var rimraf=require(_0x821b('0x1'));var zipdir=require(_0x821b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x821b('0x3'));var moment=require('moment');var BPromise=require(_0x821b('0x4'));var Mustache=require(_0x821b('0x5'));var util=require(_0x821b('0x6'));var path=require('path');var sox=require(_0x821b('0x7'));var csv=require(_0x821b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x821b('0x9'));var _=require(_0x821b('0xa'));var squel=require(_0x821b('0xb'));var crypto=require(_0x821b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x821b('0x8'));var querystring=require(_0x821b('0xd'));var Papa=require(_0x821b('0xe'));var Redis=require(_0x821b('0xf'));var authService=require(_0x821b('0x10'));var qs=require(_0x821b('0x11'));var as=require(_0x821b('0x12'));var hardwareService=require(_0x821b('0x13'));var logger=require(_0x821b('0x14'))(_0x821b('0x15'));var utils=require(_0x821b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x821b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25c578,_0x4dae2c){_0x4dae2c=_0x4dae2c||0xcc;return function(_0x338594){if(_0x338594){return _0x25c578[_0x821b('0x18')](_0x4dae2c);}return _0x25c578[_0x821b('0x19')](_0x4dae2c)[_0x821b('0x1a')]();};}function respondWithResult(_0x373cd6,_0x2bd25b){_0x2bd25b=_0x2bd25b||0xc8;return function(_0x2bebcb){if(_0x2bebcb){return _0x373cd6[_0x821b('0x19')](_0x2bd25b)[_0x821b('0x1b')](_0x2bebcb);}};}function respondWithFilteredResult(_0x172d59,_0x3838ec){return function(_0x3be070){if(_0x3be070){var _0x42609c=typeof _0x3838ec[_0x821b('0x1c')]===_0x821b('0x1d')&&typeof _0x3838ec[_0x821b('0x1e')]==='undefined';var _0x4174ad=_0x3be070[_0x821b('0x1f')];var _0x3e3e5b=_0x42609c?0x0:_0x3838ec[_0x821b('0x1c')];var _0x7d688c=_0x42609c?_0x3be070[_0x821b('0x1f')]:_0x3838ec[_0x821b('0x1c')]+_0x3838ec[_0x821b('0x1e')];var _0x536939;if(_0x7d688c>=_0x4174ad){_0x7d688c=_0x4174ad;_0x536939=0xc8;}else{_0x536939=0xce;}_0x172d59[_0x821b('0x19')](_0x536939);return _0x172d59['set'](_0x821b('0x20'),_0x3e3e5b+'-'+_0x7d688c+'/'+_0x4174ad)[_0x821b('0x1b')](_0x3be070);}return null;};}function patchUpdates(_0x486bbf){return function(_0x154fe3){try{jsonpatch[_0x821b('0x21')](_0x154fe3,_0x486bbf,!![]);}catch(_0x589018){return BPromise[_0x821b('0x22')](_0x589018);}return _0x154fe3[_0x821b('0x23')]();};}function saveUpdates(_0x521272,_0xff5c53){return function(_0x40f6ee){if(_0x40f6ee){return _0x40f6ee['update'](_0x521272)['then'](function(_0x10d229){return _0x10d229;});}return null;};}function removeEntity(_0xd4a9dd,_0x48e23e){return function(_0x5c00ad){if(_0x5c00ad){return _0x5c00ad[_0x821b('0x24')]()[_0x821b('0x25')](function(){var _0x339fff=_0x5c00ad[_0x821b('0x26')]({'plain':!![]});var _0x3c8344='ExtractedReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x3c8344,'resourceId':_0x339fff['id']}})[_0x821b('0x25')](function(){return _0x5c00ad;});})[_0x821b('0x25')](function(){_0xd4a9dd[_0x821b('0x19')](0xcc)[_0x821b('0x1a')]();});}};}function handleEntityNotFound(_0x271c6b,_0x791719){return function(_0x28361d){if(!_0x28361d){_0x271c6b[_0x821b('0x18')](0x194);}return _0x28361d;};}function handleError(_0x226430,_0x305490){_0x305490=_0x305490||0x1f4;return function(_0x388dc9){logger['error'](_0x388dc9['stack']);if(_0x388dc9[_0x821b('0x27')]){delete _0x388dc9[_0x821b('0x27')];}_0x226430[_0x821b('0x19')](_0x305490)['send'](_0x388dc9);};}exports['index']=function(_0x2ecf38,_0x7b252b){var _0x29cb13={},_0x397d2a={},_0x456403={'count':0x0,'rows':[]};var _0x941a56=_[_0x821b('0x28')](db[_0x821b('0x29')][_0x821b('0x2a')],function(_0x1936e4){return{'name':_0x1936e4['fieldName'],'type':_0x1936e4[_0x821b('0x2b')][_0x821b('0x2c')]};});_0x397d2a['model']=_[_0x821b('0x28')](_0x941a56,_0x821b('0x27'));_0x397d2a[_0x821b('0x2d')]=_[_0x821b('0x2e')](_0x2ecf38[_0x821b('0x2d')]);_0x397d2a[_0x821b('0x2f')]=_[_0x821b('0x30')](_0x397d2a[_0x821b('0x31')],_0x397d2a['query']);_0x29cb13['attributes']=_['intersection'](_0x397d2a['model'],qs['fields'](_0x2ecf38[_0x821b('0x2d')]['fields']));_0x29cb13['attributes']=_0x29cb13[_0x821b('0x32')][_0x821b('0x33')]?_0x29cb13[_0x821b('0x32')]:_0x397d2a[_0x821b('0x31')];if(!_0x2ecf38[_0x821b('0x2d')][_0x821b('0x34')](_0x821b('0x35'))){_0x29cb13[_0x821b('0x1e')]=qs['limit'](_0x2ecf38['query']['limit']);_0x29cb13[_0x821b('0x1c')]=qs['offset'](_0x2ecf38[_0x821b('0x2d')]['offset']);}_0x29cb13[_0x821b('0x36')]=qs[_0x821b('0x37')](_0x2ecf38[_0x821b('0x2d')][_0x821b('0x37')]);_0x29cb13[_0x821b('0x38')]=qs[_0x821b('0x2f')](_[_0x821b('0x39')](_0x2ecf38[_0x821b('0x2d')],_0x397d2a[_0x821b('0x2f')]),_0x941a56);if(_0x2ecf38[_0x821b('0x2d')][_0x821b('0x3a')]){_0x29cb13['where']=_[_0x821b('0x3b')](_0x29cb13[_0x821b('0x38')],{'$or':_['map'](_0x941a56,function(_0x53d6fe){if(_0x53d6fe[_0x821b('0x2b')]!==_0x821b('0x3c')){var _0x47b2c6={};_0x47b2c6[_0x53d6fe[_0x821b('0x27')]]={'$like':'%'+_0x2ecf38[_0x821b('0x2d')][_0x821b('0x3a')]+'%'};return _0x47b2c6;}})});}_0x29cb13=_[_0x821b('0x3b')]({},_0x29cb13,_0x2ecf38[_0x821b('0x3d')]);var _0xedd691={'where':_0x29cb13[_0x821b('0x38')]};return db[_0x821b('0x29')][_0x821b('0x1f')](_0xedd691)[_0x821b('0x25')](function(_0x10090a){_0x456403[_0x821b('0x1f')]=_0x10090a;if(_0x2ecf38[_0x821b('0x2d')]['includeAll']){_0x29cb13[_0x821b('0x3e')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x29cb13);})[_0x821b('0x25')](function(_0x38b16c){_0x456403[_0x821b('0x3f')]=_0x38b16c;return _0x456403;})['then'](respondWithFilteredResult(_0x7b252b,_0x29cb13))[_0x821b('0x40')](handleError(_0x7b252b,null));};exports['show']=function(_0x15e15e,_0x3481bf){var _0x1ecd73={'raw':!![],'where':{'id':_0x15e15e['params']['id']}},_0x12d194={};_0x12d194[_0x821b('0x31')]=_['keys'](db[_0x821b('0x29')][_0x821b('0x2a')]);_0x12d194[_0x821b('0x2d')]=_['keys'](_0x15e15e[_0x821b('0x2d')]);_0x12d194[_0x821b('0x2f')]=_[_0x821b('0x30')](_0x12d194[_0x821b('0x31')],_0x12d194[_0x821b('0x2d')]);_0x1ecd73[_0x821b('0x32')]=_[_0x821b('0x30')](_0x12d194[_0x821b('0x31')],qs[_0x821b('0x41')](_0x15e15e[_0x821b('0x2d')][_0x821b('0x41')]));_0x1ecd73[_0x821b('0x32')]=_0x1ecd73[_0x821b('0x32')][_0x821b('0x33')]?_0x1ecd73['attributes']:_0x12d194['model'];if(_0x15e15e['query'][_0x821b('0x42')]){_0x1ecd73[_0x821b('0x3e')]=[{'all':!![]}];}_0x1ecd73=_[_0x821b('0x3b')]({},_0x1ecd73,_0x15e15e[_0x821b('0x3d')]);return db[_0x821b('0x29')][_0x821b('0x43')](_0x1ecd73)[_0x821b('0x25')](handleEntityNotFound(_0x3481bf,null))[_0x821b('0x25')](respondWithResult(_0x3481bf,null))['catch'](handleError(_0x3481bf,null));};exports[_0x821b('0x44')]=function(_0x14e3c6,_0x6c8269){return db['AnalyticExtractedReport'][_0x821b('0x44')](_0x14e3c6['body'],{})['then'](function(_0x52fa6c){var _0x1c26b6=_0x14e3c6['user'][_0x821b('0x26')]({'plain':!![]});if(!_0x1c26b6)throw new Error(_0x821b('0x45'));if(_0x1c26b6['role']==='user'){var _0x5eac7f=_0x52fa6c[_0x821b('0x26')]({'plain':!![]});var _0x314532=_0x821b('0x46');return db[_0x821b('0x47')][_0x821b('0x43')]({'where':{'name':_0x314532,'userProfileId':_0x1c26b6[_0x821b('0x48')]},'raw':!![]})[_0x821b('0x25')](function(_0x3900cb){if(_0x3900cb&&_0x3900cb[_0x821b('0x49')]===0x0){return db[_0x821b('0x4a')]['create']({'name':_0x5eac7f[_0x821b('0x27')],'resourceId':_0x5eac7f['id'],'type':_0x3900cb[_0x821b('0x27')],'sectionId':_0x3900cb['id']},{})[_0x821b('0x25')](function(){return _0x52fa6c;});}else{return _0x52fa6c;}})[_0x821b('0x40')](function(_0x35f2d0){logger[_0x821b('0x4b')](_0x821b('0x4c'),_0x35f2d0);throw _0x35f2d0;});}return _0x52fa6c;})[_0x821b('0x25')](respondWithResult(_0x6c8269,0xc9))[_0x821b('0x40')](handleError(_0x6c8269,null));};exports[_0x821b('0x4d')]=function(_0x157653,_0x5ba3c5){if(_0x157653[_0x821b('0x4e')]['id']){delete _0x157653[_0x821b('0x4e')]['id'];}return db[_0x821b('0x29')][_0x821b('0x43')]({'where':{'id':_0x157653[_0x821b('0x4f')]['id']}})[_0x821b('0x25')](handleEntityNotFound(_0x5ba3c5,null))[_0x821b('0x25')](saveUpdates(_0x157653['body'],null))[_0x821b('0x25')](respondWithResult(_0x5ba3c5,null))[_0x821b('0x40')](handleError(_0x5ba3c5,null));};exports[_0x821b('0x24')]=function(_0x1053b3,_0x5d31cf){return db[_0x821b('0x29')][_0x821b('0x43')]({'where':{'id':_0x1053b3[_0x821b('0x4f')]['id']}})[_0x821b('0x25')](handleEntityNotFound(_0x5d31cf,null))[_0x821b('0x25')](removeEntity(_0x5d31cf,null))['catch'](handleError(_0x5d31cf,null));};exports[_0x821b('0x50')]=function(_0x5bc9ef,_0x5dc408,_0x2e2490){return db[_0x821b('0x29')][_0x821b('0x43')]({'where':{'id':_0x5bc9ef[_0x821b('0x4f')]['id']},'attributes':[_0x821b('0x27'),'basename',_0x821b('0x51'),_0x821b('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x5dc408,null))[_0x821b('0x25')](function(_0x52af8e){if(_0x52af8e){if(!fs[_0x821b('0x53')](path['join'](config['root'],'server/files/reports',_0x52af8e[_0x821b('0x51')]))){throw new db['Sequelize'][(_0x821b('0x54'))](_0x821b('0x55'));}if(_0x5bc9ef['query'][_0x821b('0x56')]){return _0x5dc408['sendStatus'](0xc8);}return _0x5dc408[_0x821b('0x50')](path[_0x821b('0x57')](config[_0x821b('0x58')],_0x821b('0x59'),_0x52af8e[_0x821b('0x51')]),util[_0x821b('0x5a')](_0x821b('0x5b'),_0x52af8e[_0x821b('0x5c')]||_0x52af8e[_0x821b('0x27')],_0x52af8e[_0x821b('0x52')][_0x821b('0x5d')]()));}})[_0x821b('0x40')](handleError(_0x5dc408,null));}; \ No newline at end of file +var _0x4784=['catch','show','params','rawAttributes','length','options','find','create','role','user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','download','savename','output','existsSync','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','send','map','AnalyticExtractedReport','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','where','includeAll','include','findAll','rows'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x4784,0x7b));var _0x4478=function(_0x470a67,_0x5ccdf0){_0x470a67=_0x470a67-0x0;var _0x1b37aa=_0x4784[_0x470a67];return _0x1b37aa;};'use strict';var emlformat=require(_0x4478('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4478('0x1'));var jsonpatch=require(_0x4478('0x2'));var rp=require(_0x4478('0x3'));var moment=require('moment');var BPromise=require(_0x4478('0x4'));var Mustache=require(_0x4478('0x5'));var util=require(_0x4478('0x6'));var path=require(_0x4478('0x7'));var sox=require(_0x4478('0x8'));var csv=require(_0x4478('0x9'));var ejs=require(_0x4478('0xa'));var fs=require('fs');var fs_extra=require(_0x4478('0xb'));var _=require(_0x4478('0xc'));var squel=require(_0x4478('0xd'));var crypto=require('crypto');var jsforce=require(_0x4478('0xe'));var deskjs=require(_0x4478('0xf'));var toCsv=require(_0x4478('0x9'));var querystring=require('querystring');var Papa=require(_0x4478('0x10'));var Redis=require(_0x4478('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4478('0x12'));var as=require(_0x4478('0x13'));var hardwareService=require(_0x4478('0x14'));var logger=require('../../config/logger')(_0x4478('0x15'));var utils=require(_0x4478('0x16'));var config=require(_0x4478('0x17'));var licenseUtil=require(_0x4478('0x18'));var db=require(_0x4478('0x19'))['db'];function respondWithStatusCode(_0x2c0c83,_0x25fa26){_0x25fa26=_0x25fa26||0xcc;return function(_0x3e8ca0){if(_0x3e8ca0){return _0x2c0c83[_0x4478('0x1a')](_0x25fa26);}return _0x2c0c83[_0x4478('0x1b')](_0x25fa26)[_0x4478('0x1c')]();};}function respondWithResult(_0x3f2e85,_0x106df6){_0x106df6=_0x106df6||0xc8;return function(_0x38941b){if(_0x38941b){return _0x3f2e85[_0x4478('0x1b')](_0x106df6)[_0x4478('0x1d')](_0x38941b);}};}function respondWithFilteredResult(_0x5361a3,_0x234284){return function(_0x699714){if(_0x699714){var _0x35eafa=typeof _0x234284[_0x4478('0x1e')]===_0x4478('0x1f')&&typeof _0x234284[_0x4478('0x20')]===_0x4478('0x1f');var _0x59c34c=_0x699714[_0x4478('0x21')];var _0x59ab69=_0x35eafa?0x0:_0x234284[_0x4478('0x1e')];var _0x2d1bdf=_0x35eafa?_0x699714['count']:_0x234284[_0x4478('0x1e')]+_0x234284['limit'];var _0x56cbc8;if(_0x2d1bdf>=_0x59c34c){_0x2d1bdf=_0x59c34c;_0x56cbc8=0xc8;}else{_0x56cbc8=0xce;}_0x5361a3['status'](_0x56cbc8);return _0x5361a3['set'](_0x4478('0x22'),_0x59ab69+'-'+_0x2d1bdf+'/'+_0x59c34c)[_0x4478('0x1d')](_0x699714);}return null;};}function patchUpdates(_0x2bc6a8){return function(_0x3e26cd){try{jsonpatch[_0x4478('0x23')](_0x3e26cd,_0x2bc6a8,!![]);}catch(_0x2b6935){return BPromise[_0x4478('0x24')](_0x2b6935);}return _0x3e26cd[_0x4478('0x25')]();};}function saveUpdates(_0xfda409,_0xf0df55){return function(_0x322c3b){if(_0x322c3b){return _0x322c3b['update'](_0xfda409)[_0x4478('0x26')](function(_0x3b0af6){return _0x3b0af6;});}return null;};}function removeEntity(_0x23bf97,_0x43bdb9){return function(_0x5300da){if(_0x5300da){return _0x5300da[_0x4478('0x27')]()[_0x4478('0x26')](function(){var _0x2011c3=_0x5300da[_0x4478('0x28')]({'plain':!![]});var _0x323a50=_0x4478('0x29');return db[_0x4478('0x2a')][_0x4478('0x27')]({'where':{'type':_0x323a50,'resourceId':_0x2011c3['id']}})[_0x4478('0x26')](function(){return _0x5300da;});})[_0x4478('0x26')](function(){_0x23bf97[_0x4478('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x354ac0,_0x3a0eb3){return function(_0x19b006){if(!_0x19b006){_0x354ac0[_0x4478('0x1a')](0x194);}return _0x19b006;};}function handleError(_0x3b2634,_0x363604){_0x363604=_0x363604||0x1f4;return function(_0x5a0f97){logger['error'](_0x5a0f97[_0x4478('0x2b')]);if(_0x5a0f97[_0x4478('0x2c')]){delete _0x5a0f97[_0x4478('0x2c')];}_0x3b2634['status'](_0x363604)[_0x4478('0x2d')](_0x5a0f97);};}exports['index']=function(_0x58da8b,_0x1aba7b){var _0x47beae={},_0x2c612a={},_0x16996a={'count':0x0,'rows':[]};var _0xa2366c=_[_0x4478('0x2e')](db[_0x4478('0x2f')]['rawAttributes'],function(_0x362e81){return{'name':_0x362e81[_0x4478('0x30')],'type':_0x362e81['type']['key']};});_0x2c612a[_0x4478('0x31')]=_[_0x4478('0x2e')](_0xa2366c,_0x4478('0x2c'));_0x2c612a[_0x4478('0x32')]=_[_0x4478('0x33')](_0x58da8b[_0x4478('0x32')]);_0x2c612a[_0x4478('0x34')]=_[_0x4478('0x35')](_0x2c612a[_0x4478('0x31')],_0x2c612a[_0x4478('0x32')]);_0x47beae[_0x4478('0x36')]=_[_0x4478('0x35')](_0x2c612a[_0x4478('0x31')],qs[_0x4478('0x37')](_0x58da8b[_0x4478('0x32')]['fields']));_0x47beae[_0x4478('0x36')]=_0x47beae[_0x4478('0x36')]['length']?_0x47beae[_0x4478('0x36')]:_0x2c612a['model'];if(!_0x58da8b[_0x4478('0x32')][_0x4478('0x38')](_0x4478('0x39'))){_0x47beae[_0x4478('0x20')]=qs[_0x4478('0x20')](_0x58da8b['query'][_0x4478('0x20')]);_0x47beae[_0x4478('0x1e')]=qs[_0x4478('0x1e')](_0x58da8b[_0x4478('0x32')][_0x4478('0x1e')]);}_0x47beae[_0x4478('0x3a')]=qs[_0x4478('0x3b')](_0x58da8b['query'][_0x4478('0x3b')]);_0x47beae['where']=qs[_0x4478('0x34')](_['pick'](_0x58da8b[_0x4478('0x32')],_0x2c612a[_0x4478('0x34')]),_0xa2366c);if(_0x58da8b[_0x4478('0x32')][_0x4478('0x3c')]){_0x47beae['where']=_[_0x4478('0x3d')](_0x47beae['where'],{'$or':_[_0x4478('0x2e')](_0xa2366c,function(_0x27aa63){if(_0x27aa63[_0x4478('0x3e')]!==_0x4478('0x3f')){var _0x53f59e={};_0x53f59e[_0x27aa63[_0x4478('0x2c')]]={'$like':'%'+_0x58da8b['query'][_0x4478('0x3c')]+'%'};return _0x53f59e;}})});}_0x47beae=_['merge']({},_0x47beae,_0x58da8b['options']);var _0xf0bb80={'where':_0x47beae[_0x4478('0x40')]};return db[_0x4478('0x2f')][_0x4478('0x21')](_0xf0bb80)[_0x4478('0x26')](function(_0xa22fdb){_0x16996a['count']=_0xa22fdb;if(_0x58da8b[_0x4478('0x32')][_0x4478('0x41')]){_0x47beae[_0x4478('0x42')]=[{'all':!![]}];}return db[_0x4478('0x2f')][_0x4478('0x43')](_0x47beae);})[_0x4478('0x26')](function(_0x3291c7){_0x16996a[_0x4478('0x44')]=_0x3291c7;return _0x16996a;})[_0x4478('0x26')](respondWithFilteredResult(_0x1aba7b,_0x47beae))[_0x4478('0x45')](handleError(_0x1aba7b,null));};exports[_0x4478('0x46')]=function(_0x2a02f9,_0x2f6ebb){var _0x2e1dbe={'raw':!![],'where':{'id':_0x2a02f9[_0x4478('0x47')]['id']}},_0x2d9878={};_0x2d9878[_0x4478('0x31')]=_[_0x4478('0x33')](db[_0x4478('0x2f')][_0x4478('0x48')]);_0x2d9878[_0x4478('0x32')]=_[_0x4478('0x33')](_0x2a02f9['query']);_0x2d9878[_0x4478('0x34')]=_['intersection'](_0x2d9878[_0x4478('0x31')],_0x2d9878[_0x4478('0x32')]);_0x2e1dbe[_0x4478('0x36')]=_['intersection'](_0x2d9878[_0x4478('0x31')],qs['fields'](_0x2a02f9[_0x4478('0x32')]['fields']));_0x2e1dbe[_0x4478('0x36')]=_0x2e1dbe[_0x4478('0x36')][_0x4478('0x49')]?_0x2e1dbe[_0x4478('0x36')]:_0x2d9878[_0x4478('0x31')];if(_0x2a02f9[_0x4478('0x32')]['includeAll']){_0x2e1dbe[_0x4478('0x42')]=[{'all':!![]}];}_0x2e1dbe=_['merge']({},_0x2e1dbe,_0x2a02f9[_0x4478('0x4a')]);return db[_0x4478('0x2f')][_0x4478('0x4b')](_0x2e1dbe)[_0x4478('0x26')](handleEntityNotFound(_0x2f6ebb,null))[_0x4478('0x26')](respondWithResult(_0x2f6ebb,null))[_0x4478('0x45')](handleError(_0x2f6ebb,null));};exports[_0x4478('0x4c')]=function(_0x5cb788,_0x41df4a){return db[_0x4478('0x2f')][_0x4478('0x4c')](_0x5cb788['body'],{})['then'](function(_0x4440d9){var _0x33513f=_0x5cb788['user'][_0x4478('0x28')]({'plain':!![]});if(!_0x33513f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33513f[_0x4478('0x4d')]===_0x4478('0x4e')){var _0x3333e9=_0x4440d9['get']({'plain':!![]});var _0x38006c='ExtractedReports';return db['UserProfileSection'][_0x4478('0x4b')]({'where':{'name':_0x38006c,'userProfileId':_0x33513f[_0x4478('0x4f')]},'raw':!![]})['then'](function(_0x343d7c){if(_0x343d7c&&_0x343d7c['autoAssociation']===0x0){return db[_0x4478('0x2a')][_0x4478('0x4c')]({'name':_0x3333e9['name'],'resourceId':_0x3333e9['id'],'type':_0x343d7c[_0x4478('0x2c')],'sectionId':_0x343d7c['id']},{})[_0x4478('0x26')](function(){return _0x4440d9;});}else{return _0x4440d9;}})[_0x4478('0x45')](function(_0x492610){logger[_0x4478('0x50')](_0x4478('0x51'),_0x492610);throw _0x492610;});}return _0x4440d9;})[_0x4478('0x26')](respondWithResult(_0x41df4a,0xc9))[_0x4478('0x45')](handleError(_0x41df4a,null));};exports[_0x4478('0x52')]=function(_0x2f11e0,_0x488364){if(_0x2f11e0[_0x4478('0x53')]['id']){delete _0x2f11e0['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x2f11e0[_0x4478('0x47')]['id']}})[_0x4478('0x26')](handleEntityNotFound(_0x488364,null))[_0x4478('0x26')](saveUpdates(_0x2f11e0[_0x4478('0x53')],null))['then'](respondWithResult(_0x488364,null))['catch'](handleError(_0x488364,null));};exports[_0x4478('0x27')]=function(_0x1336e8,_0x14f886){return db[_0x4478('0x2f')][_0x4478('0x4b')]({'where':{'id':_0x1336e8['params']['id']}})[_0x4478('0x26')](handleEntityNotFound(_0x14f886,null))['then'](removeEntity(_0x14f886,null))['catch'](handleError(_0x14f886,null));};exports[_0x4478('0x54')]=function(_0x5cd52b,_0x5dd32f,_0x1a68fc){return db[_0x4478('0x2f')]['find']({'where':{'id':_0x5cd52b[_0x4478('0x47')]['id']},'attributes':[_0x4478('0x2c'),'basename',_0x4478('0x55'),_0x4478('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x5dd32f,null))[_0x4478('0x26')](function(_0x1befe0){if(_0x1befe0){if(!fs[_0x4478('0x57')](path['join'](config['root'],_0x4478('0x58'),_0x1befe0[_0x4478('0x55')]))){throw new db[(_0x4478('0x59'))][(_0x4478('0x5a'))](_0x4478('0x5b'));}if(_0x5cd52b[_0x4478('0x32')][_0x4478('0x5c')]){return _0x5dd32f[_0x4478('0x1a')](0xc8);}return _0x5dd32f[_0x4478('0x54')](path['join'](config[_0x4478('0x5d')],_0x4478('0x58'),_0x1befe0['savename']),util['format'](_0x4478('0x5e'),_0x1befe0['basename']||_0x1befe0['name'],_0x1befe0[_0x4478('0x56')][_0x4478('0x5f')]()));}})['catch'](handleError(_0x5dd32f,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index a8af3f3..4016a8f 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 _0x1b71=['../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x2581be,_0x59eec3){var _0x36c076=function(_0x9d6a87){while(--_0x9d6a87){_0x2581be['push'](_0x2581be['shift']());}};_0x36c076(++_0x59eec3);}(_0x1b71,0x67));var _0x11b7=function(_0x13dd24,_0x38fa33){_0x13dd24=_0x13dd24-0x0;var _0x1fd2f3=_0x1b71[_0x13dd24];return _0x1fd2f3;};'use strict';var _=require(_0x11b7('0x0'));var util=require(_0x11b7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x11b7('0x2'));var BPromise=require(_0x11b7('0x3'));var rp=require(_0x11b7('0x4'));var fs=require('fs');var path=require(_0x11b7('0x5'));var rimraf=require(_0x11b7('0x6'));var config=require(_0x11b7('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x11b7('0x8')]=function(_0x55946b,_0x233056){return _0x55946b['define'](_0x11b7('0x9'),attributes,{'tableName':_0x11b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac98=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','moment','rimraf','../../config/environment'];(function(_0x2cc3c5,_0x5afa5b){var _0x18b51a=function(_0xe6299){while(--_0xe6299){_0x2cc3c5['push'](_0x2cc3c5['shift']());}};_0x18b51a(++_0x5afa5b);}(_0xac98,0x14f));var _0x8ac9=function(_0x28a2f8,_0x28409c){_0x28a2f8=_0x28a2f8-0x0;var _0x2de030=_0xac98[_0x28a2f8];return _0x2de030;};'use strict';var _=require(_0x8ac9('0x0'));var util=require(_0x8ac9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8ac9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8ac9('0x3'));var config=require(_0x8ac9('0x4'));var attributes=require(_0x8ac9('0x5'));module[_0x8ac9('0x6')]=function(_0x2fd9eb,_0x569056){return _0x2fd9eb[_0x8ac9('0x7')](_0x8ac9('0x8'),attributes,{'tableName':_0x8ac9('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 4330535..a1b1674 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 _0x2abb=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x2abb,0x7f));var _0xb2ab=function(_0x284aa6,_0x213586){_0x284aa6=_0x284aa6-0x0;var _0x1d1a13=_0x2abb[_0x284aa6];return _0x1d1a13;};'use strict';var _=require(_0xb2ab('0x0'));var util=require(_0xb2ab('0x1'));var moment=require(_0xb2ab('0x2'));var BPromise=require(_0xb2ab('0x3'));var rs=require(_0xb2ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2ab('0x5'))['db'];var utils=require(_0xb2ab('0x6'));var logger=require(_0xb2ab('0x7'))(_0xb2ab('0x8'));var config=require('../../config/environment');var jayson=require(_0xb2ab('0x9'));var client=jayson[_0xb2ab('0xa')][_0xb2ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b9a63,_0x291d45,_0x3def6e){return new BPromise(function(_0xf6ae17,_0x380d55){return client[_0xb2ab('0xc')](_0x2b9a63,_0x3def6e)[_0xb2ab('0xd')](function(_0x9324a3){logger[_0xb2ab('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x291d45,'request\x20sent');logger[_0xb2ab('0xf')](_0xb2ab('0x10'),_0x291d45,_0xb2ab('0x11'),JSON[_0xb2ab('0x12')](_0x9324a3));if(_0x9324a3[_0xb2ab('0x13')]){if(_0x9324a3[_0xb2ab('0x13')][_0xb2ab('0x14')]===0x1f4){logger[_0xb2ab('0x13')](_0xb2ab('0x15'),_0x291d45,_0x9324a3[_0xb2ab('0x13')][_0xb2ab('0x16')]);return _0x380d55(_0x9324a3[_0xb2ab('0x13')][_0xb2ab('0x16')]);}logger[_0xb2ab('0x13')](_0xb2ab('0x15'),_0x291d45,_0x9324a3[_0xb2ab('0x13')][_0xb2ab('0x16')]);return _0xf6ae17(_0x9324a3[_0xb2ab('0x13')][_0xb2ab('0x16')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x291d45,'request\x20sent');_0xf6ae17(_0x9324a3[_0xb2ab('0x17')][_0xb2ab('0x16')]);}})[_0xb2ab('0x18')](function(_0x3ecc95){logger[_0xb2ab('0x13')](_0xb2ab('0x15'),_0x291d45,_0x3ecc95);_0x380d55(_0x3ecc95);});});} \ No newline at end of file +var _0x86ea=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','code','error','message','AnalyticExtractedReport,\x20%s,\x20%s','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x626bbf,_0x439790){var _0x46c83d=function(_0x54f790){while(--_0x54f790){_0x626bbf['push'](_0x626bbf['shift']());}};_0x46c83d(++_0x439790);}(_0x86ea,0x187));var _0xa86e=function(_0x5503a4,_0x2cc5d3){_0x5503a4=_0x5503a4-0x0;var _0x3fd07e=_0x86ea[_0x5503a4];return _0x3fd07e;};'use strict';var _=require(_0xa86e('0x0'));var util=require(_0xa86e('0x1'));var moment=require('moment');var BPromise=require(_0xa86e('0x2'));var rs=require(_0xa86e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa86e('0x4'))['db'];var utils=require(_0xa86e('0x5'));var logger=require(_0xa86e('0x6'))(_0xa86e('0x7'));var config=require(_0xa86e('0x8'));var jayson=require(_0xa86e('0x9'));var client=jayson[_0xa86e('0xa')][_0xa86e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1306c3,_0x2d2d0b,_0x508227){return new BPromise(function(_0x59b1a8,_0x1e87d7){return client[_0xa86e('0xc')](_0x1306c3,_0x508227)[_0xa86e('0xd')](function(_0xd716ad){logger[_0xa86e('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2d2d0b,_0xa86e('0xf'));logger[_0xa86e('0x10')](_0xa86e('0x11'),_0x2d2d0b,_0xa86e('0xf'),JSON['stringify'](_0xd716ad));if(_0xd716ad['error']){if(_0xd716ad['error'][_0xa86e('0x12')]===0x1f4){logger[_0xa86e('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2d2d0b,_0xd716ad[_0xa86e('0x13')][_0xa86e('0x14')]);return _0x1e87d7(_0xd716ad[_0xa86e('0x13')][_0xa86e('0x14')]);}logger[_0xa86e('0x13')](_0xa86e('0x15'),_0x2d2d0b,_0xd716ad['error'][_0xa86e('0x14')]);return _0x59b1a8(_0xd716ad[_0xa86e('0x13')]['message']);}else{logger[_0xa86e('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2d2d0b,'request\x20sent');_0x59b1a8(_0xd716ad['result']['message']);}})['catch'](function(_0x2eeb83){logger[_0xa86e('0x13')](_0xa86e('0x15'),_0x2d2d0b,_0x2eeb83);_0x1e87d7(_0x2eeb83);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 27da561..446546d 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 _0x73ba=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/download','download','create','put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x504c14,_0x5b8c04){var _0x465a05=function(_0x287db2){while(--_0x287db2){_0x504c14['push'](_0x504c14['shift']());}};_0x465a05(++_0x5b8c04);}(_0x73ba,0x1db));var _0xa73b=function(_0xef98a3,_0x4ebc63){_0xef98a3=_0xef98a3-0x0;var _0x411933=_0x73ba[_0xef98a3];return _0x411933;};'use strict';var multer=require('multer');var util=require(_0xa73b('0x0'));var path=require('path');var timeout=require(_0xa73b('0x1'));var express=require(_0xa73b('0x2'));var router=express[_0xa73b('0x3')]();var fs_extra=require(_0xa73b('0x4'));var auth=require(_0xa73b('0x5'));var interaction=require(_0xa73b('0x6'));var config=require(_0xa73b('0x7'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xa73b('0x8')](),controller[_0xa73b('0x9')]);router[_0xa73b('0xa')](_0xa73b('0xb'),auth[_0xa73b('0x8')](),controller[_0xa73b('0xc')]);router[_0xa73b('0xa')](_0xa73b('0xd'),auth[_0xa73b('0x8')](),controller[_0xa73b('0xe')]);router['post']('/',auth[_0xa73b('0x8')](),controller[_0xa73b('0xf')]);router[_0xa73b('0x10')](_0xa73b('0xb'),auth['isAuthenticated'](),controller[_0xa73b('0x11')]);router['delete'](_0xa73b('0xb'),auth[_0xa73b('0x8')](),controller[_0xa73b('0x12')]);module[_0xa73b('0x13')]=router; \ No newline at end of file +var _0x06ce=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','create','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service'];(function(_0x4e8286,_0x4eaeb4){var _0x44a440=function(_0x5e0907){while(--_0x5e0907){_0x4e8286['push'](_0x4e8286['shift']());}};_0x44a440(++_0x4eaeb4);}(_0x06ce,0xaf));var _0xe06c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x06ce[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xe06c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe06c('0x1'));var router=express[_0xe06c('0x2')]();var fs_extra=require(_0xe06c('0x3'));var auth=require(_0xe06c('0x4'));var interaction=require(_0xe06c('0x5'));var config=require(_0xe06c('0x6'));var controller=require(_0xe06c('0x7'));router[_0xe06c('0x8')]('/',auth[_0xe06c('0x9')](),controller[_0xe06c('0xa')]);router[_0xe06c('0x8')](_0xe06c('0xb'),auth[_0xe06c('0x9')](),controller['show']);router[_0xe06c('0x8')](_0xe06c('0xc'),auth[_0xe06c('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xe06c('0xd')]);router['put']('/:id',auth[_0xe06c('0x9')](),controller[_0xe06c('0xe')]);router[_0xe06c('0xf')](_0xe06c('0xb'),auth[_0xe06c('0x9')](),controller[_0xe06c('0x10')]);module[_0xe06c('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 525c634..c1102d0 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 _0xb499=['BOOLEAN','sequelize','exports','STRING'];(function(_0x39465f,_0x2cec9e){var _0xa7f8d9=function(_0x26a1f2){while(--_0x26a1f2){_0x39465f['push'](_0x39465f['shift']());}};_0xa7f8d9(++_0x2cec9e);}(_0xb499,0xf9));var _0x9b49=function(_0x432ab5,_0xf7483a){_0x432ab5=_0x432ab5-0x0;var _0x2e4f85=_0xb499[_0x432ab5];return _0x2e4f85;};'use strict';var Sequelize=require(_0x9b49('0x0'));module[_0x9b49('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x9b49('0x2')]},'function':{'type':Sequelize[_0x9b49('0x2')]},'format':{'type':Sequelize[_0x9b49('0x2')]},'groupBy':{'type':Sequelize[_0x9b49('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9b49('0x2')]},'custom':{'type':Sequelize[_0x9b49('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xef43=['TEXT','STRING','sequelize'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xef43,0x6e));var _0x3ef4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xef43[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3ef4('0x0'));module['exports']={'field':{'type':Sequelize[_0x3ef4('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x3ef4('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3ef4('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 09f0c6c..e318cf7 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 _0xd808=['map','AnalyticFieldReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','keys','find','create','bulkCreate','body','destroy','bulkDestroy','ids','findOne','sequelize','transaction','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','index'];(function(_0x1e896c,_0x3f9948){var _0xd149d9=function(_0x3281e5){while(--_0x3281e5){_0x1e896c['push'](_0x1e896c['shift']());}};_0xd149d9(++_0x3f9948);}(_0xd808,0x1b4));var _0x8d80=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0xd808[_0x2dc96f];return _0xd012da;};'use strict';var emlformat=require(_0x8d80('0x0'));var rimraf=require(_0x8d80('0x1'));var zipdir=require(_0x8d80('0x2'));var jsonpatch=require(_0x8d80('0x3'));var rp=require(_0x8d80('0x4'));var moment=require('moment');var BPromise=require(_0x8d80('0x5'));var Mustache=require(_0x8d80('0x6'));var util=require('util');var path=require(_0x8d80('0x7'));var sox=require(_0x8d80('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d80('0x9'));var _=require(_0x8d80('0xa'));var squel=require(_0x8d80('0xb'));var crypto=require(_0x8d80('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8d80('0xd'));var toCsv=require(_0x8d80('0xe'));var querystring=require('querystring');var Papa=require(_0x8d80('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('../../config/license/hardware');var logger=require(_0x8d80('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x8d80('0x11'));var licenseUtil=require(_0x8d80('0x12'));var db=require(_0x8d80('0x13'))['db'];function respondWithStatusCode(_0x1e768a,_0x2d190d){_0x2d190d=_0x2d190d||0xcc;return function(_0x49fb74){if(_0x49fb74){return _0x1e768a[_0x8d80('0x14')](_0x2d190d);}return _0x1e768a[_0x8d80('0x15')](_0x2d190d)[_0x8d80('0x16')]();};}function respondWithResult(_0xccf71c,_0x409b13){_0x409b13=_0x409b13||0xc8;return function(_0x41b49e){if(_0x41b49e){return _0xccf71c[_0x8d80('0x15')](_0x409b13)['json'](_0x41b49e);}};}function respondWithFilteredResult(_0x1f44af,_0x562666){return function(_0x58d121){if(_0x58d121){var _0x1aebec=typeof _0x562666['offset']===_0x8d80('0x17')&&typeof _0x562666[_0x8d80('0x18')]===_0x8d80('0x17');var _0x4cff06=_0x58d121[_0x8d80('0x19')];var _0x5b60c4=_0x1aebec?0x0:_0x562666[_0x8d80('0x1a')];var _0x170865=_0x1aebec?_0x58d121['count']:_0x562666['offset']+_0x562666[_0x8d80('0x18')];var _0x4d56c2;if(_0x170865>=_0x4cff06){_0x170865=_0x4cff06;_0x4d56c2=0xc8;}else{_0x4d56c2=0xce;}_0x1f44af[_0x8d80('0x15')](_0x4d56c2);return _0x1f44af[_0x8d80('0x1b')](_0x8d80('0x1c'),_0x5b60c4+'-'+_0x170865+'/'+_0x4cff06)['json'](_0x58d121);}return null;};}function patchUpdates(_0x67d68){return function(_0x5a2dd5){try{jsonpatch[_0x8d80('0x1d')](_0x5a2dd5,_0x67d68,!![]);}catch(_0x139f30){return BPromise[_0x8d80('0x1e')](_0x139f30);}return _0x5a2dd5[_0x8d80('0x1f')]();};}function saveUpdates(_0x34ac8c,_0x42420d){return function(_0x5eddc0){if(_0x5eddc0){return _0x5eddc0[_0x8d80('0x20')](_0x34ac8c)['then'](function(_0x4e1a8b){return _0x4e1a8b;});}return null;};}function removeEntity(_0x526223,_0x477f5a){return function(_0x24ea66){if(_0x24ea66){return _0x24ea66['destroy']()[_0x8d80('0x21')](function(){_0x526223[_0x8d80('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4126d9,_0x20a804){return function(_0x128ffa){if(!_0x128ffa){_0x4126d9[_0x8d80('0x14')](0x194);}return _0x128ffa;};}function handleError(_0x1a2d4e,_0x9c57b3){_0x9c57b3=_0x9c57b3||0x1f4;return function(_0x5836ba){logger['error'](_0x5836ba[_0x8d80('0x22')]);if(_0x5836ba[_0x8d80('0x23')]){delete _0x5836ba['name'];}_0x1a2d4e[_0x8d80('0x15')](_0x9c57b3)[_0x8d80('0x24')](_0x5836ba);};}exports[_0x8d80('0x25')]=function(_0x46c6d4,_0x4edaec){var _0x353fed={},_0x153e31={},_0x443a78={'count':0x0,'rows':[]};var _0x1d0f37=_[_0x8d80('0x26')](db[_0x8d80('0x27')]['rawAttributes'],function(_0x460c1d){return{'name':_0x460c1d[_0x8d80('0x28')],'type':_0x460c1d[_0x8d80('0x29')][_0x8d80('0x2a')]};});_0x153e31[_0x8d80('0x2b')]=_[_0x8d80('0x26')](_0x1d0f37,'name');_0x153e31[_0x8d80('0x2c')]=_['keys'](_0x46c6d4[_0x8d80('0x2c')]);_0x153e31[_0x8d80('0x2d')]=_[_0x8d80('0x2e')](_0x153e31['model'],_0x153e31[_0x8d80('0x2c')]);_0x353fed[_0x8d80('0x2f')]=_[_0x8d80('0x2e')](_0x153e31['model'],qs[_0x8d80('0x30')](_0x46c6d4[_0x8d80('0x2c')][_0x8d80('0x30')]));_0x353fed[_0x8d80('0x2f')]=_0x353fed['attributes'][_0x8d80('0x31')]?_0x353fed[_0x8d80('0x2f')]:_0x153e31['model'];if(!_0x46c6d4[_0x8d80('0x2c')][_0x8d80('0x32')](_0x8d80('0x33'))){_0x353fed[_0x8d80('0x18')]=qs[_0x8d80('0x18')](_0x46c6d4['query'][_0x8d80('0x18')]);_0x353fed[_0x8d80('0x1a')]=qs[_0x8d80('0x1a')](_0x46c6d4['query']['offset']);}_0x353fed[_0x8d80('0x34')]=qs[_0x8d80('0x35')](_0x46c6d4['query'][_0x8d80('0x35')]);_0x353fed['where']=qs[_0x8d80('0x2d')](_[_0x8d80('0x36')](_0x46c6d4[_0x8d80('0x2c')],_0x153e31[_0x8d80('0x2d')]),_0x1d0f37);if(_0x46c6d4['query'][_0x8d80('0x37')]){_0x353fed[_0x8d80('0x38')]=_[_0x8d80('0x39')](_0x353fed[_0x8d80('0x38')],{'$or':_[_0x8d80('0x26')](_0x1d0f37,function(_0x2b4790){if(_0x2b4790['type']!==_0x8d80('0x3a')){var _0x186b5={};_0x186b5[_0x2b4790['name']]={'$like':'%'+_0x46c6d4[_0x8d80('0x2c')][_0x8d80('0x37')]+'%'};return _0x186b5;}})});}_0x353fed=_[_0x8d80('0x39')]({},_0x353fed,_0x46c6d4[_0x8d80('0x3b')]);var _0x318192={'where':_0x353fed[_0x8d80('0x38')]};return db['AnalyticFieldReport'][_0x8d80('0x19')](_0x318192)[_0x8d80('0x21')](function(_0x571110){_0x443a78['count']=_0x571110;if(_0x46c6d4[_0x8d80('0x2c')][_0x8d80('0x3c')]){_0x353fed[_0x8d80('0x3d')]=[{'all':!![]}];}return db[_0x8d80('0x27')]['findAll'](_0x353fed);})[_0x8d80('0x21')](function(_0x547df7){_0x443a78[_0x8d80('0x3e')]=_0x547df7;return _0x443a78;})[_0x8d80('0x21')](respondWithFilteredResult(_0x4edaec,_0x353fed))[_0x8d80('0x3f')](handleError(_0x4edaec,null));};exports[_0x8d80('0x40')]=function(_0x4dc371,_0x551623){var _0xda17e2={'raw':![],'where':{'id':_0x4dc371[_0x8d80('0x41')]['id']}},_0x333a81={};_0x333a81[_0x8d80('0x2b')]=_['keys'](db[_0x8d80('0x27')][_0x8d80('0x42')]);_0x333a81[_0x8d80('0x2c')]=_[_0x8d80('0x43')](_0x4dc371[_0x8d80('0x2c')]);_0x333a81[_0x8d80('0x2d')]=_[_0x8d80('0x2e')](_0x333a81['model'],_0x333a81['query']);_0xda17e2[_0x8d80('0x2f')]=_[_0x8d80('0x2e')](_0x333a81['model'],qs[_0x8d80('0x30')](_0x4dc371[_0x8d80('0x2c')][_0x8d80('0x30')]));_0xda17e2[_0x8d80('0x2f')]=_0xda17e2['attributes']['length']?_0xda17e2[_0x8d80('0x2f')]:_0x333a81['model'];if(_0x4dc371[_0x8d80('0x2c')][_0x8d80('0x3c')]){_0xda17e2[_0x8d80('0x3d')]=[{'all':!![]}];}_0xda17e2=_[_0x8d80('0x39')]({},_0xda17e2,_0x4dc371['options']);return db[_0x8d80('0x27')][_0x8d80('0x44')](_0xda17e2)[_0x8d80('0x21')](handleEntityNotFound(_0x551623,null))[_0x8d80('0x21')](respondWithResult(_0x551623,null))[_0x8d80('0x3f')](handleError(_0x551623,null));};exports[_0x8d80('0x45')]=function(_0x5c27d5,_0x3e5fcf){return db[_0x8d80('0x27')][_0x8d80('0x45')](_0x5c27d5['body'],{})[_0x8d80('0x21')](respondWithResult(_0x3e5fcf,0xc9))[_0x8d80('0x3f')](handleError(_0x3e5fcf,null));};exports[_0x8d80('0x46')]=function(_0x34ca31,_0x51f3c3){return db[_0x8d80('0x27')]['bulkCreate'](_0x34ca31[_0x8d80('0x47')],{'raw':![],'individualHooks':!![]})[_0x8d80('0x21')](respondWithResult(_0x51f3c3,0xc9))[_0x8d80('0x3f')](handleError(_0x51f3c3,null));};exports[_0x8d80('0x20')]=function(_0x554508,_0x422030){if(_0x554508[_0x8d80('0x47')]['id']){delete _0x554508[_0x8d80('0x47')]['id'];}return db[_0x8d80('0x27')][_0x8d80('0x44')]({'where':{'id':_0x554508[_0x8d80('0x41')]['id']}})[_0x8d80('0x21')](handleEntityNotFound(_0x422030,null))[_0x8d80('0x21')](saveUpdates(_0x554508['body'],null))[_0x8d80('0x21')](respondWithResult(_0x422030,null))[_0x8d80('0x3f')](handleError(_0x422030,null));};exports[_0x8d80('0x48')]=function(_0x1c86dc,_0x37a869){return db[_0x8d80('0x27')][_0x8d80('0x44')]({'where':{'id':_0x1c86dc[_0x8d80('0x41')]['id']}})[_0x8d80('0x21')](handleEntityNotFound(_0x37a869,null))[_0x8d80('0x21')](removeEntity(_0x37a869,null))[_0x8d80('0x3f')](handleError(_0x37a869,null));};exports[_0x8d80('0x49')]=function(_0x28f72c,_0x4cbb19){return db['AnalyticFieldReport'][_0x8d80('0x48')]({'where':{'id':_0x28f72c['query'][_0x8d80('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x8d80('0x21')](respondWithResult(_0x4cbb19,0xcc))[_0x8d80('0x3f')](handleError(_0x4cbb19,null));};exports['addFields']=function(_0x29d852,_0x2e4272,_0x144617){return db['AnalyticCustomReport'][_0x8d80('0x4b')]({'where':{'id':_0x29d852['params']['id']}})[_0x8d80('0x21')](handleEntityNotFound(_0x2e4272,null))['then'](function(_0x2ddda4){if(_0x2ddda4){return db[_0x8d80('0x4c')][_0x8d80('0x4d')](function(_0x6ef0fb){return db[_0x8d80('0x27')][_0x8d80('0x48')]({'where':{'CustomReportId':_0x29d852[_0x8d80('0x41')]['id']},'transaction':_0x6ef0fb})['then'](function(_0x37c26c){var _0x21108f=_['map'](_0x29d852[_0x8d80('0x47')],function(_0x29cdf3){delete _0x29cdf3['id'];_0x29cdf3['CustomReportId']=_0x29d852[_0x8d80('0x41')]['id'];return _0x29cdf3;});return db[_0x8d80('0x27')][_0x8d80('0x46')](_0x21108f,{'transaction':_0x6ef0fb});});})[_0x8d80('0x21')](function(){return db[_0x8d80('0x27')][_0x8d80('0x4e')]({'where':{'CustomReportId':_0x29d852[_0x8d80('0x41')]['id']}});});}})[_0x8d80('0x21')](respondWithResult(_0x2e4272,null))[_0x8d80('0x3f')](handleError(_0x2e4272,null));}; \ No newline at end of file +var _0x1c89=['count','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','bulkCreate','update','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','end','status','json','undefined','limit'];(function(_0x2da1fc,_0x3502bb){var _0x13dd42=function(_0x41c490){while(--_0x41c490){_0x2da1fc['push'](_0x2da1fc['shift']());}};_0x13dd42(++_0x3502bb);}(_0x1c89,0x17f));var _0x91c8=function(_0x302f85,_0x5bcca3){_0x302f85=_0x302f85-0x0;var _0x5ef7cb=_0x1c89[_0x302f85];return _0x5ef7cb;};'use strict';var emlformat=require(_0x91c8('0x0'));var rimraf=require(_0x91c8('0x1'));var zipdir=require(_0x91c8('0x2'));var jsonpatch=require(_0x91c8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x91c8('0x4'));var util=require(_0x91c8('0x5'));var path=require(_0x91c8('0x6'));var sox=require(_0x91c8('0x7'));var csv=require(_0x91c8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x91c8('0x9'));var _=require('lodash');var squel=require(_0x91c8('0xa'));var crypto=require('crypto');var jsforce=require(_0x91c8('0xb'));var deskjs=require(_0x91c8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x91c8('0xd'));var Papa=require(_0x91c8('0xe'));var Redis=require(_0x91c8('0xf'));var authService=require(_0x91c8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x91c8('0x11'));var hardwareService=require(_0x91c8('0x12'));var logger=require(_0x91c8('0x13'))(_0x91c8('0x14'));var utils=require('../../config/utils');var config=require(_0x91c8('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b65b4,_0x318faf){_0x318faf=_0x318faf||0xcc;return function(_0x559368){if(_0x559368){return _0x4b65b4['sendStatus'](_0x318faf);}return _0x4b65b4['status'](_0x318faf)[_0x91c8('0x16')]();};}function respondWithResult(_0x308337,_0xd77571){_0xd77571=_0xd77571||0xc8;return function(_0x304bcc){if(_0x304bcc){return _0x308337[_0x91c8('0x17')](_0xd77571)[_0x91c8('0x18')](_0x304bcc);}};}function respondWithFilteredResult(_0x1e3ef5,_0x103596){return function(_0x430984){if(_0x430984){var _0x4843e2=typeof _0x103596['offset']===_0x91c8('0x19')&&typeof _0x103596[_0x91c8('0x1a')]===_0x91c8('0x19');var _0x287e1b=_0x430984[_0x91c8('0x1b')];var _0x3d5f55=_0x4843e2?0x0:_0x103596['offset'];var _0x6cf16e=_0x4843e2?_0x430984['count']:_0x103596['offset']+_0x103596['limit'];var _0x552b4b;if(_0x6cf16e>=_0x287e1b){_0x6cf16e=_0x287e1b;_0x552b4b=0xc8;}else{_0x552b4b=0xce;}_0x1e3ef5['status'](_0x552b4b);return _0x1e3ef5['set'](_0x91c8('0x1c'),_0x3d5f55+'-'+_0x6cf16e+'/'+_0x287e1b)[_0x91c8('0x18')](_0x430984);}return null;};}function patchUpdates(_0x26ad46){return function(_0x5ddd2e){try{jsonpatch[_0x91c8('0x1d')](_0x5ddd2e,_0x26ad46,!![]);}catch(_0x324768){return BPromise[_0x91c8('0x1e')](_0x324768);}return _0x5ddd2e[_0x91c8('0x1f')]();};}function saveUpdates(_0x3fa004,_0x5ca1bd){return function(_0x259679){if(_0x259679){return _0x259679['update'](_0x3fa004)[_0x91c8('0x20')](function(_0x378c7e){return _0x378c7e;});}return null;};}function removeEntity(_0x25867c,_0x54554c){return function(_0x70e200){if(_0x70e200){return _0x70e200[_0x91c8('0x21')]()[_0x91c8('0x20')](function(){_0x25867c[_0x91c8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55bb2d,_0x1272a8){return function(_0x2bd2b4){if(!_0x2bd2b4){_0x55bb2d[_0x91c8('0x22')](0x194);}return _0x2bd2b4;};}function handleError(_0x4a82ee,_0x4f2a76){_0x4f2a76=_0x4f2a76||0x1f4;return function(_0x4d0a65){logger[_0x91c8('0x23')](_0x4d0a65[_0x91c8('0x24')]);if(_0x4d0a65[_0x91c8('0x25')]){delete _0x4d0a65['name'];}_0x4a82ee[_0x91c8('0x17')](_0x4f2a76)[_0x91c8('0x26')](_0x4d0a65);};}exports[_0x91c8('0x27')]=function(_0x30bfbe,_0x2deccd){var _0x3c82ff={},_0xcea40b={},_0x5be4af={'count':0x0,'rows':[]};var _0x3dd0ff=_[_0x91c8('0x28')](db[_0x91c8('0x29')]['rawAttributes'],function(_0x335f05){return{'name':_0x335f05[_0x91c8('0x2a')],'type':_0x335f05['type'][_0x91c8('0x2b')]};});_0xcea40b[_0x91c8('0x2c')]=_[_0x91c8('0x28')](_0x3dd0ff,_0x91c8('0x25'));_0xcea40b[_0x91c8('0x2d')]=_[_0x91c8('0x2e')](_0x30bfbe[_0x91c8('0x2d')]);_0xcea40b['filters']=_[_0x91c8('0x2f')](_0xcea40b[_0x91c8('0x2c')],_0xcea40b['query']);_0x3c82ff[_0x91c8('0x30')]=_[_0x91c8('0x2f')](_0xcea40b['model'],qs[_0x91c8('0x31')](_0x30bfbe['query']['fields']));_0x3c82ff[_0x91c8('0x30')]=_0x3c82ff['attributes'][_0x91c8('0x32')]?_0x3c82ff['attributes']:_0xcea40b[_0x91c8('0x2c')];if(!_0x30bfbe[_0x91c8('0x2d')][_0x91c8('0x33')](_0x91c8('0x34'))){_0x3c82ff['limit']=qs[_0x91c8('0x1a')](_0x30bfbe['query'][_0x91c8('0x1a')]);_0x3c82ff[_0x91c8('0x35')]=qs[_0x91c8('0x35')](_0x30bfbe[_0x91c8('0x2d')]['offset']);}_0x3c82ff[_0x91c8('0x36')]=qs[_0x91c8('0x37')](_0x30bfbe['query'][_0x91c8('0x37')]);_0x3c82ff[_0x91c8('0x38')]=qs[_0x91c8('0x39')](_['pick'](_0x30bfbe[_0x91c8('0x2d')],_0xcea40b[_0x91c8('0x39')]),_0x3dd0ff);if(_0x30bfbe[_0x91c8('0x2d')][_0x91c8('0x3a')]){_0x3c82ff[_0x91c8('0x38')]=_[_0x91c8('0x3b')](_0x3c82ff[_0x91c8('0x38')],{'$or':_[_0x91c8('0x28')](_0x3dd0ff,function(_0x508056){if(_0x508056[_0x91c8('0x3c')]!==_0x91c8('0x3d')){var _0x3d8296={};_0x3d8296[_0x508056[_0x91c8('0x25')]]={'$like':'%'+_0x30bfbe['query'][_0x91c8('0x3a')]+'%'};return _0x3d8296;}})});}_0x3c82ff=_[_0x91c8('0x3b')]({},_0x3c82ff,_0x30bfbe[_0x91c8('0x3e')]);var _0x1ab342={'where':_0x3c82ff[_0x91c8('0x38')]};return db[_0x91c8('0x29')][_0x91c8('0x1b')](_0x1ab342)[_0x91c8('0x20')](function(_0x5c0261){_0x5be4af[_0x91c8('0x1b')]=_0x5c0261;if(_0x30bfbe[_0x91c8('0x2d')][_0x91c8('0x3f')]){_0x3c82ff[_0x91c8('0x40')]=[{'all':!![]}];}return db[_0x91c8('0x29')][_0x91c8('0x41')](_0x3c82ff);})[_0x91c8('0x20')](function(_0x4d4a5a){_0x5be4af[_0x91c8('0x42')]=_0x4d4a5a;return _0x5be4af;})[_0x91c8('0x20')](respondWithFilteredResult(_0x2deccd,_0x3c82ff))[_0x91c8('0x43')](handleError(_0x2deccd,null));};exports[_0x91c8('0x44')]=function(_0x35e1ee,_0x2d3204){var _0x51d31c={'raw':![],'where':{'id':_0x35e1ee[_0x91c8('0x45')]['id']}},_0x299e16={};_0x299e16['model']=_[_0x91c8('0x2e')](db['AnalyticFieldReport'][_0x91c8('0x46')]);_0x299e16[_0x91c8('0x2d')]=_[_0x91c8('0x2e')](_0x35e1ee[_0x91c8('0x2d')]);_0x299e16['filters']=_[_0x91c8('0x2f')](_0x299e16[_0x91c8('0x2c')],_0x299e16[_0x91c8('0x2d')]);_0x51d31c['attributes']=_['intersection'](_0x299e16[_0x91c8('0x2c')],qs['fields'](_0x35e1ee[_0x91c8('0x2d')][_0x91c8('0x31')]));_0x51d31c['attributes']=_0x51d31c[_0x91c8('0x30')][_0x91c8('0x32')]?_0x51d31c['attributes']:_0x299e16['model'];if(_0x35e1ee[_0x91c8('0x2d')][_0x91c8('0x3f')]){_0x51d31c['include']=[{'all':!![]}];}_0x51d31c=_[_0x91c8('0x3b')]({},_0x51d31c,_0x35e1ee[_0x91c8('0x3e')]);return db[_0x91c8('0x29')][_0x91c8('0x47')](_0x51d31c)[_0x91c8('0x20')](handleEntityNotFound(_0x2d3204,null))[_0x91c8('0x20')](respondWithResult(_0x2d3204,null))[_0x91c8('0x43')](handleError(_0x2d3204,null));};exports[_0x91c8('0x48')]=function(_0x4e103a,_0x2fee12){return db[_0x91c8('0x29')][_0x91c8('0x48')](_0x4e103a[_0x91c8('0x49')],{})['then'](respondWithResult(_0x2fee12,0xc9))[_0x91c8('0x43')](handleError(_0x2fee12,null));};exports[_0x91c8('0x4a')]=function(_0x308463,_0x3e6896){return db[_0x91c8('0x29')]['bulkCreate'](_0x308463[_0x91c8('0x49')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3e6896,0xc9))[_0x91c8('0x43')](handleError(_0x3e6896,null));};exports[_0x91c8('0x4b')]=function(_0x1c9248,_0x4e573b){if(_0x1c9248['body']['id']){delete _0x1c9248[_0x91c8('0x49')]['id'];}return db[_0x91c8('0x29')][_0x91c8('0x47')]({'where':{'id':_0x1c9248['params']['id']}})[_0x91c8('0x20')](handleEntityNotFound(_0x4e573b,null))['then'](saveUpdates(_0x1c9248[_0x91c8('0x49')],null))[_0x91c8('0x20')](respondWithResult(_0x4e573b,null))[_0x91c8('0x43')](handleError(_0x4e573b,null));};exports['destroy']=function(_0x3af744,_0x4ba768){return db[_0x91c8('0x29')]['find']({'where':{'id':_0x3af744['params']['id']}})['then'](handleEntityNotFound(_0x4ba768,null))[_0x91c8('0x20')](removeEntity(_0x4ba768,null))[_0x91c8('0x43')](handleError(_0x4ba768,null));};exports['bulkDestroy']=function(_0x182778,_0x5442bc){return db[_0x91c8('0x29')][_0x91c8('0x21')]({'where':{'id':_0x182778['query'][_0x91c8('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x91c8('0x20')](respondWithResult(_0x5442bc,0xcc))[_0x91c8('0x43')](handleError(_0x5442bc,null));};exports[_0x91c8('0x4d')]=function(_0x26f0dc,_0x60dfce,_0x34beda){return db[_0x91c8('0x4e')]['findOne']({'where':{'id':_0x26f0dc[_0x91c8('0x45')]['id']}})['then'](handleEntityNotFound(_0x60dfce,null))['then'](function(_0x29b223){if(_0x29b223){return db[_0x91c8('0x4f')][_0x91c8('0x50')](function(_0x4ac90e){return db[_0x91c8('0x29')][_0x91c8('0x21')]({'where':{'CustomReportId':_0x26f0dc['params']['id']},'transaction':_0x4ac90e})[_0x91c8('0x20')](function(_0x468068){var _0x31cfda=_[_0x91c8('0x28')](_0x26f0dc[_0x91c8('0x49')],function(_0x55e996){delete _0x55e996['id'];_0x55e996[_0x91c8('0x51')]=_0x26f0dc[_0x91c8('0x45')]['id'];return _0x55e996;});return db[_0x91c8('0x29')][_0x91c8('0x4a')](_0x31cfda,{'transaction':_0x4ac90e});});})[_0x91c8('0x20')](function(){return db['AnalyticFieldReport'][_0x91c8('0x41')]({'where':{'CustomReportId':_0x26f0dc[_0x91c8('0x45')]['id']}});});}})['then'](respondWithResult(_0x60dfce,null))['catch'](handleError(_0x60dfce,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index a46b244..51a7d97 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 _0x1426=['AnalyticFieldReport','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x1c60ab,_0x30a8ea){var _0x12ab53=function(_0x3822ed){while(--_0x3822ed){_0x1c60ab['push'](_0x1c60ab['shift']());}};_0x12ab53(++_0x30a8ea);}(_0x1426,0x6f));var _0x6142=function(_0x325373,_0x4e6f25){_0x325373=_0x325373-0x0;var _0x3f5fee=_0x1426[_0x325373];return _0x3f5fee;};'use strict';var _=require(_0x6142('0x0'));var util=require(_0x6142('0x1'));var logger=require(_0x6142('0x2'))(_0x6142('0x3'));var moment=require('moment');var BPromise=require(_0x6142('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6142('0x5'));var config=require(_0x6142('0x6'));var attributes=require(_0x6142('0x7'));module[_0x6142('0x8')]=function(_0x16ab6f,_0x5b3ba3){return _0x16ab6f['define'](_0x6142('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc636=['exports','define','analytics_report_fields','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc636,0xa8));var _0x6c63=function(_0x254b05,_0x1e4395){_0x254b05=_0x254b05-0x0;var _0x4e4311=_0xc636[_0x254b05];return _0x4e4311;};'use strict';var _=require(_0x6c63('0x0'));var util=require(_0x6c63('0x1'));var logger=require(_0x6c63('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6c63('0x3'));var fs=require('fs');var path=require(_0x6c63('0x4'));var rimraf=require(_0x6c63('0x5'));var config=require(_0x6c63('0x6'));var attributes=require(_0x6c63('0x7'));module[_0x6c63('0x8')]=function(_0x2ec101,_0x324e12){return _0x2ec101[_0x6c63('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0x6c63('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 88da2d4..79bdc88 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 _0xf09a=['rpc','../../config/environment','jayson/promise','client','http','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../config/logger'];(function(_0xbe05af,_0x336de7){var _0x5af21a=function(_0x50bd57){while(--_0x50bd57){_0xbe05af['push'](_0xbe05af['shift']());}};_0x5af21a(++_0x336de7);}(_0xf09a,0x1b4));var _0xaf09=function(_0x3de7e0,_0x28cbff){_0x3de7e0=_0x3de7e0-0x0;var _0x11d0b3=_0xf09a[_0x3de7e0];return _0x11d0b3;};'use strict';var _=require('lodash');var util=require(_0xaf09('0x0'));var moment=require(_0xaf09('0x1'));var BPromise=require(_0xaf09('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf09('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaf09('0x4'))(_0xaf09('0x5'));var config=require(_0xaf09('0x6'));var jayson=require(_0xaf09('0x7'));var client=jayson[_0xaf09('0x8')][_0xaf09('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b9ffb,_0x27192e,_0x4eecaa){return new BPromise(function(_0x3c5941,_0x432c04){return client['request'](_0x2b9ffb,_0x4eecaa)[_0xaf09('0xa')](function(_0x5f4d7b){logger['info'](_0xaf09('0xb'),_0x27192e,_0xaf09('0xc'));logger[_0xaf09('0xd')](_0xaf09('0xe'),_0x27192e,_0xaf09('0xc'),JSON['stringify'](_0x5f4d7b));if(_0x5f4d7b[_0xaf09('0xf')]){if(_0x5f4d7b[_0xaf09('0xf')][_0xaf09('0x10')]===0x1f4){logger[_0xaf09('0xf')](_0xaf09('0xb'),_0x27192e,_0x5f4d7b[_0xaf09('0xf')]['message']);return _0x432c04(_0x5f4d7b['error'][_0xaf09('0x11')]);}logger[_0xaf09('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x27192e,_0x5f4d7b[_0xaf09('0xf')][_0xaf09('0x11')]);return _0x3c5941(_0x5f4d7b['error'][_0xaf09('0x11')]);}else{logger[_0xaf09('0x12')](_0xaf09('0xb'),_0x27192e,_0xaf09('0xc'));_0x3c5941(_0x5f4d7b[_0xaf09('0x13')][_0xaf09('0x11')]);}})[_0xaf09('0x14')](function(_0x43ff89){logger[_0xaf09('0xf')](_0xaf09('0xb'),_0x27192e,_0x43ff89);_0x432c04(_0x43ff89);});});} \ No newline at end of file +var _0xe011=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5527ce,_0xba4347){var _0x291b84=function(_0x5495f3){while(--_0x5495f3){_0x5527ce['push'](_0x5527ce['shift']());}};_0x291b84(++_0xba4347);}(_0xe011,0x9b));var _0x1e01=function(_0x2cc711,_0x300328){_0x2cc711=_0x2cc711-0x0;var _0x31a52e=_0xe011[_0x2cc711];return _0x31a52e;};'use strict';var _=require(_0x1e01('0x0'));var util=require(_0x1e01('0x1'));var moment=require(_0x1e01('0x2'));var BPromise=require(_0x1e01('0x3'));var rs=require(_0x1e01('0x4'));var fs=require('fs');var Redis=require(_0x1e01('0x5'));var db=require(_0x1e01('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e01('0x7'))(_0x1e01('0x8'));var config=require(_0x1e01('0x9'));var jayson=require(_0x1e01('0xa'));var client=jayson['client'][_0x1e01('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cebd4,_0x5283ae,_0x55acdf){return new BPromise(function(_0x57cc83,_0x43091f){return client['request'](_0x2cebd4,_0x55acdf)[_0x1e01('0xc')](function(_0x1bd18a){logger[_0x1e01('0xd')](_0x1e01('0xe'),_0x5283ae,_0x1e01('0xf'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5283ae,'request\x20sent',JSON[_0x1e01('0x10')](_0x1bd18a));if(_0x1bd18a[_0x1e01('0x11')]){if(_0x1bd18a['error']['code']===0x1f4){logger[_0x1e01('0x11')](_0x1e01('0xe'),_0x5283ae,_0x1bd18a[_0x1e01('0x11')]['message']);return _0x43091f(_0x1bd18a[_0x1e01('0x11')][_0x1e01('0x12')]);}logger[_0x1e01('0x11')](_0x1e01('0xe'),_0x5283ae,_0x1bd18a[_0x1e01('0x11')]['message']);return _0x57cc83(_0x1bd18a[_0x1e01('0x11')][_0x1e01('0x12')]);}else{logger[_0x1e01('0xd')](_0x1e01('0xe'),_0x5283ae,_0x1e01('0xf'));_0x57cc83(_0x1bd18a['result'][_0x1e01('0x12')]);}})[_0x1e01('0x13')](function(_0x538e7f){logger[_0x1e01('0x11')](_0x1e01('0xe'),_0x5283ae,_0x538e7f);_0x43091f(_0x538e7f);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 3cb4490..db3c92d 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(_0x287e0f,_0x5638e7){var _0x4dd42a=function(_0x5f201d){while(--_0x5f201d){_0x287e0f['push'](_0x287e0f['shift']());}};_0x4dd42a(++_0x5638e7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x549a12,_0x2b4d88){var _0x505b31=function(_0x4fa750){while(--_0x4fa750){_0x549a12['push'](_0x549a12['shift']());}};_0x505b31(++_0x2b4d88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 5917043..042e733 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 _0x2fe3=['sequelize','exports','STRING'];(function(_0x3a9f37,_0x5d4886){var _0x540b07=function(_0x1db3e9){while(--_0x1db3e9){_0x3a9f37['push'](_0x3a9f37['shift']());}};_0x540b07(++_0x5d4886);}(_0x2fe3,0x87));var _0x32fe=function(_0xbe9a6a,_0x33cdb3){_0xbe9a6a=_0xbe9a6a-0x0;var _0x208939=_0x2fe3[_0xbe9a6a];return _0x208939;};'use strict';var Sequelize=require(_0x32fe('0x0'));module[_0x32fe('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x32fe('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x32fe('0x2')]}}; \ No newline at end of file +var _0x7b6b=['name','sequelize','STRING'];(function(_0x1406b8,_0x5bf867){var _0x10bb5f=function(_0x57ef16){while(--_0x57ef16){_0x1406b8['push'](_0x1406b8['shift']());}};_0x10bb5f(++_0x5bf867);}(_0x7b6b,0xac));var _0xb7b6=function(_0x1d3f71,_0x4b315a){_0x1d3f71=_0x1d3f71-0x0;var _0x3187bf=_0x7b6b[_0x1d3f71];return _0x3187bf;};'use strict';var Sequelize=require(_0xb7b6('0x0'));module['exports']={'name':{'type':Sequelize[_0xb7b6('0x1')],'allowNull':![],'unique':_0xb7b6('0x2')},'table':{'type':Sequelize[_0xb7b6('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xb7b6('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index c5f3f5a..88c574e 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 _0x84ab=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x178668,_0x1ec300){var _0x26107d=function(_0x4c0aa8){while(--_0x4c0aa8){_0x178668['push'](_0x178668['shift']());}};_0x26107d(++_0x1ec300);}(_0x84ab,0x12f));var _0xb84a=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x84ab[_0x220afa];return _0x1b79d1;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){var _0x1aab7d=_0x3aa06f[_0xb84a('0x24')]({'plain':!![]});var _0x409df0=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x409df0,'resourceId':_0x1aab7d['id']}})[_0xb84a('0x22')](function(){return _0x3aa06f;});})[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x1db72c,_0x2fe40d){return function(_0x35d1f7){if(!_0x35d1f7){_0x1db72c[_0xb84a('0x16')](0x194);}return _0x35d1f7;};}function handleError(_0x97d71b,_0x5349ea){_0x5349ea=_0x5349ea||0x1f4;return function(_0x582954){logger[_0xb84a('0x27')](_0x582954[_0xb84a('0x28')]);if(_0x582954['name']){delete _0x582954[_0xb84a('0x29')];}_0x97d71b[_0xb84a('0x17')](_0x5349ea)['send'](_0x582954);};}exports['index']=function(_0x28f2e7,_0x8e9319){var _0x49ba3d={},_0x251778={},_0xba1147={'count':0x0,'rows':[]};var _0x3abc22=_[_0xb84a('0x2a')](db[_0xb84a('0x2b')][_0xb84a('0x2c')],function(_0x34b212){return{'name':_0x34b212[_0xb84a('0x2d')],'type':_0x34b212['type'][_0xb84a('0x2e')]};});_0x251778['model']=_['map'](_0x3abc22,_0xb84a('0x29'));_0x251778[_0xb84a('0x2f')]=_['keys'](_0x28f2e7['query']);_0x251778[_0xb84a('0x30')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],_0x251778[_0xb84a('0x2f')]);_0x49ba3d[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],qs[_0xb84a('0x34')](_0x28f2e7['query'][_0xb84a('0x34')]));_0x49ba3d[_0xb84a('0x33')]=_0x49ba3d[_0xb84a('0x33')][_0xb84a('0x35')]?_0x49ba3d[_0xb84a('0x33')]:_0x251778[_0xb84a('0x32')];if(!_0x28f2e7[_0xb84a('0x2f')]['hasOwnProperty'](_0xb84a('0x36'))){_0x49ba3d['limit']=qs[_0xb84a('0x1c')](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x49ba3d['offset']=qs['offset'](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1a')]);}_0x49ba3d[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_0x28f2e7[_0xb84a('0x2f')]['sort']);_0x49ba3d[_0xb84a('0x39')]=qs[_0xb84a('0x30')](_['pick'](_0x28f2e7[_0xb84a('0x2f')],_0x251778[_0xb84a('0x30')]),_0x3abc22);if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3a')]){_0x49ba3d['where']=_['merge'](_0x49ba3d['where'],{'$or':_[_0xb84a('0x2a')](_0x3abc22,function(_0x11e1ac){if(_0x11e1ac[_0xb84a('0x3b')]!==_0xb84a('0x3c')){var _0x55b0b8={};_0x55b0b8[_0x11e1ac[_0xb84a('0x29')]]={'$like':'%'+_0x28f2e7['query'][_0xb84a('0x3a')]+'%'};return _0x55b0b8;}})});}_0x49ba3d=_['merge']({},_0x49ba3d,_0x28f2e7['options']);var _0x59d7a1={'where':_0x49ba3d[_0xb84a('0x39')]};return db[_0xb84a('0x2b')][_0xb84a('0x1d')](_0x59d7a1)[_0xb84a('0x22')](function(_0x5e547e){_0xba1147[_0xb84a('0x1d')]=_0x5e547e;if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x49ba3d[_0xb84a('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x49ba3d);})[_0xb84a('0x22')](function(_0x1f3e04){_0xba1147['rows']=_0x1f3e04;return _0xba1147;})[_0xb84a('0x22')](respondWithFilteredResult(_0x8e9319,_0x49ba3d))[_0xb84a('0x3f')](handleError(_0x8e9319,null));};exports[_0xb84a('0x40')]=function(_0x25280a,_0x3f005b){var _0x241536={'raw':!![],'where':{'id':_0x25280a[_0xb84a('0x41')]['id']}},_0x24d700={};_0x24d700[_0xb84a('0x32')]=_[_0xb84a('0x42')](db[_0xb84a('0x2b')][_0xb84a('0x2c')]);_0x24d700[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x25280a[_0xb84a('0x2f')]);_0x24d700['filters']=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],_0x24d700[_0xb84a('0x2f')]);_0x241536[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],qs['fields'](_0x25280a[_0xb84a('0x2f')]['fields']));_0x241536[_0xb84a('0x33')]=_0x241536[_0xb84a('0x33')][_0xb84a('0x35')]?_0x241536[_0xb84a('0x33')]:_0x24d700['model'];if(_0x25280a[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x241536[_0xb84a('0x3e')]=[{'all':!![]}];}_0x241536=_['merge']({},_0x241536,_0x25280a['options']);return db[_0xb84a('0x2b')][_0xb84a('0x43')](_0x241536)[_0xb84a('0x22')](handleEntityNotFound(_0x3f005b,null))['then'](respondWithResult(_0x3f005b,null))['catch'](handleError(_0x3f005b,null));};exports['create']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x2b')][_0xb84a('0x44')](_0x45630d[_0xb84a('0x45')],{})['then'](function(_0x4b40fe){var _0x5b853a=_0x45630d['user'][_0xb84a('0x24')]({'plain':!![]});if(!_0x5b853a)throw new Error(_0xb84a('0x46'));if(_0x5b853a['role']===_0xb84a('0x47')){var _0xc8bac2=_0x4b40fe[_0xb84a('0x24')]({'plain':!![]});var _0x2f70f0=_0xb84a('0x25');return db[_0xb84a('0x48')]['find']({'where':{'name':_0x2f70f0,'userProfileId':_0x5b853a['userProfileId']},'raw':!![]})[_0xb84a('0x22')](function(_0x50172a){if(_0x50172a&&_0x50172a[_0xb84a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8bac2['name'],'resourceId':_0xc8bac2['id'],'type':_0x50172a[_0xb84a('0x29')],'sectionId':_0x50172a['id']},{})[_0xb84a('0x22')](function(){return _0x4b40fe;});}else{return _0x4b40fe;}})[_0xb84a('0x3f')](function(_0x25b6a0){logger[_0xb84a('0x27')](_0xb84a('0x4a'),_0x25b6a0);throw _0x25b6a0;});}return _0x4b40fe;})[_0xb84a('0x22')](respondWithResult(_0x384a0d,0xc9))[_0xb84a('0x3f')](handleError(_0x384a0d,null));};exports['update']=function(_0x5afdd0,_0x4c5bdf){if(_0x5afdd0[_0xb84a('0x45')]['id']){delete _0x5afdd0[_0xb84a('0x45')]['id'];}return db['AnalyticMetric'][_0xb84a('0x43')]({'where':{'id':_0x5afdd0['params']['id']}})['then'](handleEntityNotFound(_0x4c5bdf,null))['then'](saveUpdates(_0x5afdd0[_0xb84a('0x45')],null))[_0xb84a('0x22')](respondWithResult(_0x4c5bdf,null))[_0xb84a('0x3f')](handleError(_0x4c5bdf,null));};exports['destroy']=function(_0x5f757e,_0x2e98bf){return db[_0xb84a('0x2b')]['find']({'where':{'id':_0x5f757e[_0xb84a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e98bf,null))['then'](removeEntity(_0x2e98bf,null))[_0xb84a('0x3f')](handleError(_0x2e98bf,null));}; \ No newline at end of file +var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x4e28eb,_0x5168aa){var _0xdbea8d=function(_0x4238e9){while(--_0x4238e9){_0x4e28eb['push'](_0x4e28eb['shift']());}};_0xdbea8d(++_0x5168aa);}(_0x9a19,0x114));var _0x99a1=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x9a19[_0xbf8ebe];return _0x1e25e8;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 3de7cc3..56cdcba 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 _0xf722=['exports','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticMetric.attributes'];(function(_0x5ee2db,_0x47ea25){var _0x2cab07=function(_0x4643f7){while(--_0x4643f7){_0x5ee2db['push'](_0x5ee2db['shift']());}};_0x2cab07(++_0x47ea25);}(_0xf722,0x18f));var _0x2f72=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xf722[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x2f72('0x0'));var util=require(_0x2f72('0x1'));var logger=require(_0x2f72('0x2'))(_0x2f72('0x3'));var moment=require('moment');var BPromise=require(_0x2f72('0x4'));var rp=require(_0x2f72('0x5'));var fs=require('fs');var path=require(_0x2f72('0x6'));var rimraf=require(_0x2f72('0x7'));var config=require('../../config/environment');var attributes=require(_0x2f72('0x8'));module[_0x2f72('0x9')]=function(_0x334168,_0x537e3d){return _0x334168['define'](_0x2f72('0xa'),attributes,{'tableName':_0x2f72('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe548=['analytics_metrics','lodash','util','../../config/logger','api','moment','./analyticMetric.attributes','define','AnalyticMetric'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xe548,0x184));var _0x8e54=function(_0x16e5d1,_0x9cf085){_0x16e5d1=_0x16e5d1-0x0;var _0x3f72e6=_0xe548[_0x16e5d1];return _0x3f72e6;};'use strict';var _=require(_0x8e54('0x0'));var util=require(_0x8e54('0x1'));var logger=require(_0x8e54('0x2'))(_0x8e54('0x3'));var moment=require(_0x8e54('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8e54('0x5'));module['exports']=function(_0x288be8,_0x47a58d){return _0x288be8[_0x8e54('0x6')](_0x8e54('0x7'),attributes,{'tableName':_0x8e54('0x8'),'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 b089e41..cd8bd82 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 _0xd912=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x31e87f,_0x3b248f){var _0x532b53=function(_0x5517c4){while(--_0x5517c4){_0x31e87f['push'](_0x31e87f['shift']());}};_0x532b53(++_0x3b248f);}(_0xd912,0xd0));var _0x2d91=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd912[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x2d91('0x0'));var moment=require(_0x2d91('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d91('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2d91('0x3'))(_0x2d91('0x4'));var config=require(_0x2d91('0x5'));var jayson=require(_0x2d91('0x6'));var client=jayson['client'][_0x2d91('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x401359,_0x16105b,_0x219bcc){return new BPromise(function(_0x10203b,_0x2d6dda){return client['request'](_0x401359,_0x219bcc)[_0x2d91('0x8')](function(_0x2102f9){logger[_0x2d91('0x9')](_0x2d91('0xa'),_0x16105b,_0x2d91('0xb'));logger[_0x2d91('0xc')](_0x2d91('0xd'),_0x16105b,_0x2d91('0xb'),JSON[_0x2d91('0xe')](_0x2102f9));if(_0x2102f9[_0x2d91('0xf')]){if(_0x2102f9[_0x2d91('0xf')][_0x2d91('0x10')]===0x1f4){logger[_0x2d91('0xf')](_0x2d91('0xa'),_0x16105b,_0x2102f9[_0x2d91('0xf')][_0x2d91('0x11')]);return _0x2d6dda(_0x2102f9[_0x2d91('0xf')][_0x2d91('0x11')]);}logger['error'](_0x2d91('0xa'),_0x16105b,_0x2102f9['error'][_0x2d91('0x11')]);return _0x10203b(_0x2102f9['error'][_0x2d91('0x11')]);}else{logger['info'](_0x2d91('0xa'),_0x16105b,_0x2d91('0xb'));_0x10203b(_0x2102f9[_0x2d91('0x12')][_0x2d91('0x11')]);}})[_0x2d91('0x13')](function(_0x596268){logger[_0x2d91('0xf')](_0x2d91('0xa'),_0x16105b,_0x596268);_0x2d6dda(_0x596268);});});} \ No newline at end of file +var _0xd72c=['jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x4b784d,_0x5efb2f){var _0x2cdeaf=function(_0x106242){while(--_0x106242){_0x4b784d['push'](_0x4b784d['shift']());}};_0x2cdeaf(++_0x5efb2f);}(_0xd72c,0x162));var _0xcd72=function(_0x50b60e,_0x5725c3){_0x50b60e=_0x50b60e-0x0;var _0x3c158b=_0xd72c[_0x50b60e];return _0x3c158b;};'use strict';var _=require(_0xcd72('0x0'));var util=require(_0xcd72('0x1'));var moment=require('moment');var BPromise=require(_0xcd72('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd72('0x3'));var db=require(_0xcd72('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcd72('0x5'));var config=require('../../config/environment');var jayson=require(_0xcd72('0x6'));var client=jayson['client'][_0xcd72('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x493c9e,_0x4f7082,_0x55f8c9){return new BPromise(function(_0x28a404,_0x958aa7){return client[_0xcd72('0x8')](_0x493c9e,_0x55f8c9)[_0xcd72('0x9')](function(_0x454056){logger[_0xcd72('0xa')](_0xcd72('0xb'),_0x4f7082,'request\x20sent');logger['debug'](_0xcd72('0xc'),_0x4f7082,_0xcd72('0xd'),JSON[_0xcd72('0xe')](_0x454056));if(_0x454056[_0xcd72('0xf')]){if(_0x454056[_0xcd72('0xf')]['code']===0x1f4){logger[_0xcd72('0xf')](_0xcd72('0xb'),_0x4f7082,_0x454056['error']['message']);return _0x958aa7(_0x454056['error'][_0xcd72('0x10')]);}logger[_0xcd72('0xf')](_0xcd72('0xb'),_0x4f7082,_0x454056['error'][_0xcd72('0x10')]);return _0x28a404(_0x454056[_0xcd72('0xf')]['message']);}else{logger[_0xcd72('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x4f7082,'request\x20sent');_0x28a404(_0x454056[_0xcd72('0x11')][_0xcd72('0x10')]);}})['catch'](function(_0x44b250){logger[_0xcd72('0xf')](_0xcd72('0xb'),_0x4f7082,_0x44b250);_0x958aa7(_0x44b250);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 36b86dc..0b83466 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 _0xf23b=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','show','create','put','/:id'];(function(_0x642d68,_0x44e622){var _0x1616fd=function(_0x2d9eae){while(--_0x2d9eae){_0x642d68['push'](_0x642d68['shift']());}};_0x1616fd(++_0x44e622);}(_0xf23b,0x133));var _0xbf23=function(_0x99b912,_0x1faa3e){_0x99b912=_0x99b912-0x0;var _0x1139fe=_0xf23b[_0x99b912];return _0x1139fe;};'use strict';var multer=require(_0xbf23('0x0'));var util=require(_0xbf23('0x1'));var path=require(_0xbf23('0x2'));var timeout=require(_0xbf23('0x3'));var express=require(_0xbf23('0x4'));var router=express['Router']();var fs_extra=require(_0xbf23('0x5'));var auth=require(_0xbf23('0x6'));var interaction=require(_0xbf23('0x7'));var config=require('../../config/environment');var controller=require(_0xbf23('0x8'));router[_0xbf23('0x9')]('/',auth[_0xbf23('0xa')](),controller[_0xbf23('0xb')]);router[_0xbf23('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xbf23('0xc')]);router['post']('/',auth[_0xbf23('0xa')](),controller[_0xbf23('0xd')]);router[_0xbf23('0xe')](_0xbf23('0xf'),auth[_0xbf23('0xa')](),controller['update']);router[_0xbf23('0x10')](_0xbf23('0xf'),auth[_0xbf23('0xa')](),controller[_0xbf23('0x11')]);module[_0xbf23('0x12')]=router; \ No newline at end of file +var _0x6299=['./analyticMetric.controller','get','isAuthenticated','index','show','put','/:id','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3ae171,_0x112caf){var _0x43fc71=function(_0x1fd663){while(--_0x1fd663){_0x3ae171['push'](_0x3ae171['shift']());}};_0x43fc71(++_0x112caf);}(_0x6299,0x169));var _0x9629=function(_0x4e88c3,_0x3b4b0e){_0x4e88c3=_0x4e88c3-0x0;var _0xf04119=_0x6299[_0x4e88c3];return _0xf04119;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9629('0x0'));var timeout=require(_0x9629('0x1'));var express=require(_0x9629('0x2'));var router=express[_0x9629('0x3')]();var fs_extra=require(_0x9629('0x4'));var auth=require(_0x9629('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9629('0x6'));var controller=require(_0x9629('0x7'));router[_0x9629('0x8')]('/',auth[_0x9629('0x9')](),controller[_0x9629('0xa')]);router['get']('/:id',auth[_0x9629('0x9')](),controller[_0x9629('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9629('0xc')](_0x9629('0xd'),auth[_0x9629('0x9')](),controller['update']);router[_0x9629('0xe')](_0x9629('0xd'),auth[_0x9629('0x9')](),controller['destroy']);module[_0x9629('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 5bd5a69..2d50102 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 _0x75a5=['exports','sequelize'];(function(_0x2121ab,_0x4a4ffe){var _0x216222=function(_0x4e1349){while(--_0x4e1349){_0x2121ab['push'](_0x2121ab['shift']());}};_0x216222(++_0x4a4ffe);}(_0x75a5,0x153));var _0x575a=function(_0x4c675d,_0x4e1184){_0x4c675d=_0x4c675d-0x0;var _0x1ad803=_0x75a5[_0x4c675d];return _0x1ad803;};'use strict';var Sequelize=require(_0x575a('0x0'));module[_0x575a('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x9411=['exports','sequelize'];(function(_0x4d21ee,_0x35ad3c){var _0x267560=function(_0x4f0caa){while(--_0x4f0caa){_0x4d21ee['push'](_0x4d21ee['shift']());}};_0x267560(++_0x35ad3c);}(_0x9411,0xc7));var _0x1941=function(_0x4c78a1,_0x16d40c){_0x4c78a1=_0x4c78a1-0x0;var _0x44c6a4=_0x9411[_0x4c78a1];return _0x44c6a4;};'use strict';var Sequelize=require(_0x1941('0x0'));module[_0x1941('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 6c3cf3f..11b4290 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 _0x5752=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','AnalyticTreeReport','findAll','rows','show','params','find','create','catch','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','rawAttributes','fieldName'];(function(_0xb598fd,_0x57515c){var _0x17bbb8=function(_0x4739c7){while(--_0x4739c7){_0xb598fd['push'](_0xb598fd['shift']());}};_0x17bbb8(++_0x57515c);}(_0x5752,0x1ec));var _0x2575=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x5752[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require(_0x2575('0x0'));var rimraf=require(_0x2575('0x1'));var zipdir=require(_0x2575('0x2'));var jsonpatch=require(_0x2575('0x3'));var rp=require(_0x2575('0x4'));var moment=require(_0x2575('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2575('0x6'));var path=require(_0x2575('0x7'));var sox=require(_0x2575('0x8'));var csv=require(_0x2575('0x9'));var ejs=require(_0x2575('0xa'));var fs=require('fs');var fs_extra=require(_0x2575('0xb'));var _=require('lodash');var squel=require(_0x2575('0xc'));var crypto=require(_0x2575('0xd'));var jsforce=require(_0x2575('0xe'));var deskjs=require(_0x2575('0xf'));var toCsv=require(_0x2575('0x9'));var querystring=require('querystring');var Papa=require(_0x2575('0x10'));var Redis=require(_0x2575('0x11'));var authService=require(_0x2575('0x12'));var qs=require(_0x2575('0x13'));var as=require(_0x2575('0x14'));var hardwareService=require(_0x2575('0x15'));var logger=require('../../config/logger')(_0x2575('0x16'));var utils=require(_0x2575('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2575('0x18'));var db=require(_0x2575('0x19'))['db'];function respondWithStatusCode(_0x520c19,_0x1081df){_0x1081df=_0x1081df||0xcc;return function(_0x257846){if(_0x257846){return _0x520c19[_0x2575('0x1a')](_0x1081df);}return _0x520c19[_0x2575('0x1b')](_0x1081df)[_0x2575('0x1c')]();};}function respondWithResult(_0x29b895,_0x383a53){_0x383a53=_0x383a53||0xc8;return function(_0x24f732){if(_0x24f732){return _0x29b895[_0x2575('0x1b')](_0x383a53)[_0x2575('0x1d')](_0x24f732);}};}function respondWithFilteredResult(_0x5e0034,_0x578811){return function(_0x38356a){if(_0x38356a){var _0x47cb3d=typeof _0x578811[_0x2575('0x1e')]==='undefined'&&typeof _0x578811[_0x2575('0x1f')]===_0x2575('0x20');var _0x5c1616=_0x38356a[_0x2575('0x21')];var _0x5a2db7=_0x47cb3d?0x0:_0x578811['offset'];var _0x3c6efe=_0x47cb3d?_0x38356a[_0x2575('0x21')]:_0x578811['offset']+_0x578811['limit'];var _0x42d5df;if(_0x3c6efe>=_0x5c1616){_0x3c6efe=_0x5c1616;_0x42d5df=0xc8;}else{_0x42d5df=0xce;}_0x5e0034[_0x2575('0x1b')](_0x42d5df);return _0x5e0034[_0x2575('0x22')](_0x2575('0x23'),_0x5a2db7+'-'+_0x3c6efe+'/'+_0x5c1616)[_0x2575('0x1d')](_0x38356a);}return null;};}function patchUpdates(_0xa0e275){return function(_0x5e0009){try{jsonpatch[_0x2575('0x24')](_0x5e0009,_0xa0e275,!![]);}catch(_0x406520){return BPromise[_0x2575('0x25')](_0x406520);}return _0x5e0009[_0x2575('0x26')]();};}function saveUpdates(_0x4f4fa9,_0xaaae59){return function(_0x2e0b2e){if(_0x2e0b2e){return _0x2e0b2e[_0x2575('0x27')](_0x4f4fa9)[_0x2575('0x28')](function(_0x365cc2){return _0x365cc2;});}return null;};}function removeEntity(_0x406907,_0x34df12){return function(_0x355b7d){if(_0x355b7d){return _0x355b7d['destroy']()[_0x2575('0x28')](function(){_0x406907[_0x2575('0x1b')](0xcc)[_0x2575('0x1c')]();});}};}function handleEntityNotFound(_0x433fd1,_0x331821){return function(_0x517bf3){if(!_0x517bf3){_0x433fd1[_0x2575('0x1a')](0x194);}return _0x517bf3;};}function handleError(_0x7b7411,_0xc96e49){_0xc96e49=_0xc96e49||0x1f4;return function(_0x41c610){logger[_0x2575('0x29')](_0x41c610[_0x2575('0x2a')]);if(_0x41c610[_0x2575('0x2b')]){delete _0x41c610['name'];}_0x7b7411['status'](_0xc96e49)['send'](_0x41c610);};}exports['index']=function(_0x5626de,_0x30a144){var _0x425d49={},_0x2e2ac8={},_0x55d28e={'count':0x0,'rows':[]};var _0x4ec9af=_[_0x2575('0x2c')](db['AnalyticTreeReport'][_0x2575('0x2d')],function(_0x49f7be){return{'name':_0x49f7be[_0x2575('0x2e')],'type':_0x49f7be[_0x2575('0x2f')][_0x2575('0x30')]};});_0x2e2ac8[_0x2575('0x31')]=_['map'](_0x4ec9af,'name');_0x2e2ac8[_0x2575('0x32')]=_[_0x2575('0x33')](_0x5626de['query']);_0x2e2ac8[_0x2575('0x34')]=_[_0x2575('0x35')](_0x2e2ac8[_0x2575('0x31')],_0x2e2ac8['query']);_0x425d49[_0x2575('0x36')]=_[_0x2575('0x35')](_0x2e2ac8[_0x2575('0x31')],qs['fields'](_0x5626de['query'][_0x2575('0x37')]));_0x425d49['attributes']=_0x425d49[_0x2575('0x36')][_0x2575('0x38')]?_0x425d49['attributes']:_0x2e2ac8[_0x2575('0x31')];if(!_0x5626de[_0x2575('0x32')][_0x2575('0x39')]('nolimit')){_0x425d49[_0x2575('0x1f')]=qs['limit'](_0x5626de[_0x2575('0x32')][_0x2575('0x1f')]);_0x425d49[_0x2575('0x1e')]=qs[_0x2575('0x1e')](_0x5626de[_0x2575('0x32')][_0x2575('0x1e')]);}_0x425d49[_0x2575('0x3a')]=qs[_0x2575('0x3b')](_0x5626de[_0x2575('0x32')][_0x2575('0x3b')]);_0x425d49[_0x2575('0x3c')]=qs[_0x2575('0x34')](_[_0x2575('0x3d')](_0x5626de[_0x2575('0x32')],_0x2e2ac8[_0x2575('0x34')]),_0x4ec9af);if(_0x5626de['query'][_0x2575('0x3e')]){_0x425d49[_0x2575('0x3c')]=_[_0x2575('0x3f')](_0x425d49[_0x2575('0x3c')],{'$or':_[_0x2575('0x2c')](_0x4ec9af,function(_0x59b370){if(_0x59b370[_0x2575('0x2f')]!==_0x2575('0x40')){var _0x593e92={};_0x593e92[_0x59b370['name']]={'$like':'%'+_0x5626de['query']['filter']+'%'};return _0x593e92;}})});}_0x425d49=_[_0x2575('0x3f')]({},_0x425d49,_0x5626de['options']);var _0x1e5b50={'where':_0x425d49[_0x2575('0x3c')]};return db['AnalyticTreeReport'][_0x2575('0x21')](_0x1e5b50)[_0x2575('0x28')](function(_0x4fe22f){_0x55d28e[_0x2575('0x21')]=_0x4fe22f;if(_0x5626de[_0x2575('0x32')][_0x2575('0x41')]){_0x425d49[_0x2575('0x42')]=[{'all':!![]}];}return db[_0x2575('0x43')][_0x2575('0x44')](_0x425d49);})[_0x2575('0x28')](function(_0x1b8c5d){_0x55d28e[_0x2575('0x45')]=_0x1b8c5d;return _0x55d28e;})[_0x2575('0x28')](respondWithFilteredResult(_0x30a144,_0x425d49))['catch'](handleError(_0x30a144,null));};exports[_0x2575('0x46')]=function(_0x52e4ad,_0x380875){var _0x462f37={'raw':!![],'where':{'id':_0x52e4ad[_0x2575('0x47')]['id']}},_0xd612bd={};_0xd612bd[_0x2575('0x31')]=_['keys'](db[_0x2575('0x43')][_0x2575('0x2d')]);_0xd612bd['query']=_['keys'](_0x52e4ad[_0x2575('0x32')]);_0xd612bd['filters']=_[_0x2575('0x35')](_0xd612bd[_0x2575('0x31')],_0xd612bd[_0x2575('0x32')]);_0x462f37[_0x2575('0x36')]=_[_0x2575('0x35')](_0xd612bd[_0x2575('0x31')],qs[_0x2575('0x37')](_0x52e4ad[_0x2575('0x32')][_0x2575('0x37')]));_0x462f37[_0x2575('0x36')]=_0x462f37[_0x2575('0x36')]['length']?_0x462f37[_0x2575('0x36')]:_0xd612bd['model'];if(_0x52e4ad[_0x2575('0x32')][_0x2575('0x41')]){_0x462f37[_0x2575('0x42')]=[{'all':!![]}];}_0x462f37=_[_0x2575('0x3f')]({},_0x462f37,_0x52e4ad['options']);return db[_0x2575('0x43')][_0x2575('0x48')](_0x462f37)[_0x2575('0x28')](handleEntityNotFound(_0x380875,null))[_0x2575('0x28')](respondWithResult(_0x380875,null))['catch'](handleError(_0x380875,null));};exports[_0x2575('0x49')]=function(_0x5bd767,_0x862e8){return db[_0x2575('0x43')]['create'](_0x5bd767['body'],{})[_0x2575('0x28')](respondWithResult(_0x862e8,0xc9))[_0x2575('0x4a')](handleError(_0x862e8,null));};exports['update']=function(_0x4dea13,_0x456af6){if(_0x4dea13[_0x2575('0x4b')]['id']){delete _0x4dea13['body']['id'];}return db[_0x2575('0x43')][_0x2575('0x48')]({'where':{'id':_0x4dea13[_0x2575('0x47')]['id']}})['then'](handleEntityNotFound(_0x456af6,null))[_0x2575('0x28')](saveUpdates(_0x4dea13[_0x2575('0x4b')],null))[_0x2575('0x28')](respondWithResult(_0x456af6,null))['catch'](handleError(_0x456af6,null));};exports[_0x2575('0x4c')]=function(_0x41abfc,_0x44b822){return db['AnalyticTreeReport'][_0x2575('0x48')]({'where':{'id':_0x41abfc[_0x2575('0x47')]['id']}})['then'](handleEntityNotFound(_0x44b822,null))['then'](removeEntity(_0x44b822,null))['catch'](handleError(_0x44b822,null));}; \ No newline at end of file +var _0x4609=['update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','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','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4609,0x1b2));var _0x9460=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x4609[_0x4c6d6f];return _0x2d4478;};'use strict';var emlformat=require(_0x9460('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9460('0x1'));var jsonpatch=require(_0x9460('0x2'));var rp=require(_0x9460('0x3'));var moment=require(_0x9460('0x4'));var BPromise=require(_0x9460('0x5'));var Mustache=require('mustache');var util=require(_0x9460('0x6'));var path=require(_0x9460('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9460('0x8'));var fs=require('fs');var fs_extra=require(_0x9460('0x9'));var _=require(_0x9460('0xa'));var squel=require(_0x9460('0xb'));var crypto=require('crypto');var jsforce=require(_0x9460('0xc'));var deskjs=require(_0x9460('0xd'));var toCsv=require(_0x9460('0xe'));var querystring=require(_0x9460('0xf'));var Papa=require(_0x9460('0x10'));var Redis=require(_0x9460('0x11'));var authService=require(_0x9460('0x12'));var qs=require(_0x9460('0x13'));var as=require(_0x9460('0x14'));var hardwareService=require(_0x9460('0x15'));var logger=require(_0x9460('0x16'))(_0x9460('0x17'));var utils=require(_0x9460('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9460('0x19'));var db=require(_0x9460('0x1a'))['db'];function respondWithStatusCode(_0x303759,_0x16a99e){_0x16a99e=_0x16a99e||0xcc;return function(_0x362f40){if(_0x362f40){return _0x303759[_0x9460('0x1b')](_0x16a99e);}return _0x303759['status'](_0x16a99e)[_0x9460('0x1c')]();};}function respondWithResult(_0x24fd6f,_0x22e5d4){_0x22e5d4=_0x22e5d4||0xc8;return function(_0x5cda58){if(_0x5cda58){return _0x24fd6f[_0x9460('0x1d')](_0x22e5d4)[_0x9460('0x1e')](_0x5cda58);}};}function respondWithFilteredResult(_0xae4a0b,_0x5e40e6){return function(_0x253201){if(_0x253201){var _0x51442b=typeof _0x5e40e6[_0x9460('0x1f')]==='undefined'&&typeof _0x5e40e6['limit']===_0x9460('0x20');var _0x1698f4=_0x253201['count'];var _0xc2cceb=_0x51442b?0x0:_0x5e40e6[_0x9460('0x1f')];var _0x2469b9=_0x51442b?_0x253201[_0x9460('0x21')]:_0x5e40e6['offset']+_0x5e40e6[_0x9460('0x22')];var _0x19d944;if(_0x2469b9>=_0x1698f4){_0x2469b9=_0x1698f4;_0x19d944=0xc8;}else{_0x19d944=0xce;}_0xae4a0b[_0x9460('0x1d')](_0x19d944);return _0xae4a0b[_0x9460('0x23')](_0x9460('0x24'),_0xc2cceb+'-'+_0x2469b9+'/'+_0x1698f4)[_0x9460('0x1e')](_0x253201);}return null;};}function patchUpdates(_0x29dd37){return function(_0x4de73d){try{jsonpatch[_0x9460('0x25')](_0x4de73d,_0x29dd37,!![]);}catch(_0x4ccb71){return BPromise[_0x9460('0x26')](_0x4ccb71);}return _0x4de73d[_0x9460('0x27')]();};}function saveUpdates(_0x27abb2,_0x1ee13f){return function(_0x171f92){if(_0x171f92){return _0x171f92[_0x9460('0x28')](_0x27abb2)['then'](function(_0x5bc169){return _0x5bc169;});}return null;};}function removeEntity(_0x5e19f2,_0x108da2){return function(_0x5d3a17){if(_0x5d3a17){return _0x5d3a17[_0x9460('0x29')]()[_0x9460('0x2a')](function(){_0x5e19f2[_0x9460('0x1d')](0xcc)[_0x9460('0x1c')]();});}};}function handleEntityNotFound(_0x169a57,_0x1c8181){return function(_0x53f883){if(!_0x53f883){_0x169a57[_0x9460('0x1b')](0x194);}return _0x53f883;};}function handleError(_0x20d2db,_0x5b94c7){_0x5b94c7=_0x5b94c7||0x1f4;return function(_0x37317b){logger[_0x9460('0x2b')](_0x37317b[_0x9460('0x2c')]);if(_0x37317b[_0x9460('0x2d')]){delete _0x37317b['name'];}_0x20d2db[_0x9460('0x1d')](_0x5b94c7)[_0x9460('0x2e')](_0x37317b);};}exports[_0x9460('0x2f')]=function(_0x1d7303,_0x2c4e13){var _0x35f734={},_0x3d7ac1={},_0x48193a={'count':0x0,'rows':[]};var _0xcb2862=_[_0x9460('0x30')](db['AnalyticTreeReport'][_0x9460('0x31')],function(_0x159ae4){return{'name':_0x159ae4['fieldName'],'type':_0x159ae4[_0x9460('0x32')]['key']};});_0x3d7ac1[_0x9460('0x33')]=_[_0x9460('0x30')](_0xcb2862,_0x9460('0x2d'));_0x3d7ac1[_0x9460('0x34')]=_[_0x9460('0x35')](_0x1d7303[_0x9460('0x34')]);_0x3d7ac1[_0x9460('0x36')]=_[_0x9460('0x37')](_0x3d7ac1[_0x9460('0x33')],_0x3d7ac1[_0x9460('0x34')]);_0x35f734[_0x9460('0x38')]=_[_0x9460('0x37')](_0x3d7ac1[_0x9460('0x33')],qs[_0x9460('0x39')](_0x1d7303['query'][_0x9460('0x39')]));_0x35f734[_0x9460('0x38')]=_0x35f734['attributes'][_0x9460('0x3a')]?_0x35f734[_0x9460('0x38')]:_0x3d7ac1['model'];if(!_0x1d7303[_0x9460('0x34')][_0x9460('0x3b')](_0x9460('0x3c'))){_0x35f734[_0x9460('0x22')]=qs['limit'](_0x1d7303[_0x9460('0x34')][_0x9460('0x22')]);_0x35f734['offset']=qs['offset'](_0x1d7303[_0x9460('0x34')][_0x9460('0x1f')]);}_0x35f734[_0x9460('0x3d')]=qs[_0x9460('0x3e')](_0x1d7303['query'][_0x9460('0x3e')]);_0x35f734[_0x9460('0x3f')]=qs[_0x9460('0x36')](_[_0x9460('0x40')](_0x1d7303[_0x9460('0x34')],_0x3d7ac1[_0x9460('0x36')]),_0xcb2862);if(_0x1d7303[_0x9460('0x34')][_0x9460('0x41')]){_0x35f734[_0x9460('0x3f')]=_[_0x9460('0x42')](_0x35f734[_0x9460('0x3f')],{'$or':_['map'](_0xcb2862,function(_0x3b1367){if(_0x3b1367[_0x9460('0x32')]!=='VIRTUAL'){var _0x26c6ed={};_0x26c6ed[_0x3b1367[_0x9460('0x2d')]]={'$like':'%'+_0x1d7303[_0x9460('0x34')][_0x9460('0x41')]+'%'};return _0x26c6ed;}})});}_0x35f734=_[_0x9460('0x42')]({},_0x35f734,_0x1d7303[_0x9460('0x43')]);var _0x260b96={'where':_0x35f734[_0x9460('0x3f')]};return db[_0x9460('0x44')][_0x9460('0x21')](_0x260b96)[_0x9460('0x2a')](function(_0x386d86){_0x48193a[_0x9460('0x21')]=_0x386d86;if(_0x1d7303[_0x9460('0x34')][_0x9460('0x45')]){_0x35f734[_0x9460('0x46')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x9460('0x47')](_0x35f734);})[_0x9460('0x2a')](function(_0x13a086){_0x48193a[_0x9460('0x48')]=_0x13a086;return _0x48193a;})[_0x9460('0x2a')](respondWithFilteredResult(_0x2c4e13,_0x35f734))[_0x9460('0x49')](handleError(_0x2c4e13,null));};exports[_0x9460('0x4a')]=function(_0x2fe9b0,_0x5d4fee){var _0x7d303f={'raw':!![],'where':{'id':_0x2fe9b0[_0x9460('0x4b')]['id']}},_0x599b9d={};_0x599b9d[_0x9460('0x33')]=_[_0x9460('0x35')](db['AnalyticTreeReport'][_0x9460('0x31')]);_0x599b9d[_0x9460('0x34')]=_[_0x9460('0x35')](_0x2fe9b0['query']);_0x599b9d[_0x9460('0x36')]=_[_0x9460('0x37')](_0x599b9d[_0x9460('0x33')],_0x599b9d[_0x9460('0x34')]);_0x7d303f['attributes']=_[_0x9460('0x37')](_0x599b9d[_0x9460('0x33')],qs[_0x9460('0x39')](_0x2fe9b0[_0x9460('0x34')][_0x9460('0x39')]));_0x7d303f[_0x9460('0x38')]=_0x7d303f[_0x9460('0x38')]['length']?_0x7d303f[_0x9460('0x38')]:_0x599b9d[_0x9460('0x33')];if(_0x2fe9b0[_0x9460('0x34')][_0x9460('0x45')]){_0x7d303f[_0x9460('0x46')]=[{'all':!![]}];}_0x7d303f=_[_0x9460('0x42')]({},_0x7d303f,_0x2fe9b0[_0x9460('0x43')]);return db[_0x9460('0x44')]['find'](_0x7d303f)[_0x9460('0x2a')](handleEntityNotFound(_0x5d4fee,null))[_0x9460('0x2a')](respondWithResult(_0x5d4fee,null))['catch'](handleError(_0x5d4fee,null));};exports['create']=function(_0x35dc4d,_0x4c9f04){return db['AnalyticTreeReport'][_0x9460('0x4c')](_0x35dc4d[_0x9460('0x4d')],{})[_0x9460('0x2a')](respondWithResult(_0x4c9f04,0xc9))['catch'](handleError(_0x4c9f04,null));};exports[_0x9460('0x28')]=function(_0x168f60,_0x590098){if(_0x168f60[_0x9460('0x4d')]['id']){delete _0x168f60[_0x9460('0x4d')]['id'];}return db[_0x9460('0x44')][_0x9460('0x4e')]({'where':{'id':_0x168f60[_0x9460('0x4b')]['id']}})[_0x9460('0x2a')](handleEntityNotFound(_0x590098,null))[_0x9460('0x2a')](saveUpdates(_0x168f60[_0x9460('0x4d')],null))[_0x9460('0x2a')](respondWithResult(_0x590098,null))[_0x9460('0x49')](handleError(_0x590098,null));};exports[_0x9460('0x29')]=function(_0xf9b5b3,_0x236e5b){return db['AnalyticTreeReport']['find']({'where':{'id':_0xf9b5b3[_0x9460('0x4b')]['id']}})[_0x9460('0x2a')](handleEntityNotFound(_0x236e5b,null))[_0x9460('0x2a')](removeEntity(_0x236e5b,null))[_0x9460('0x49')](handleError(_0x236e5b,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index a6e6154..8a1d315 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 _0x9545=['api','bluebird','path','rimraf','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger'];(function(_0x3ea3ba,_0x2b576a){var _0x427078=function(_0x490797){while(--_0x490797){_0x3ea3ba['push'](_0x3ea3ba['shift']());}};_0x427078(++_0x2b576a);}(_0x9545,0x147));var _0x5954=function(_0x5aaba8,_0x248b94){_0x5aaba8=_0x5aaba8-0x0;var _0x13f7e3=_0x9545[_0x5aaba8];return _0x13f7e3;};'use strict';var _=require(_0x5954('0x0'));var util=require(_0x5954('0x1'));var logger=require(_0x5954('0x2'))(_0x5954('0x3'));var moment=require('moment');var BPromise=require(_0x5954('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5954('0x5'));var rimraf=require(_0x5954('0x6'));var config=require('../../config/environment');var attributes=require(_0x5954('0x7'));module['exports']=function(_0x4375ba,_0x18cbe4){return _0x4375ba[_0x5954('0x8')](_0x5954('0x9'),attributes,{'tableName':_0x5954('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0bd=['moment','bluebird','request-promise','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x539cf4,_0x46d9fe){var _0x551d01=function(_0x2e2914){while(--_0x2e2914){_0x539cf4['push'](_0x539cf4['shift']());}};_0x551d01(++_0x46d9fe);}(_0xf0bd,0x188));var _0xdf0b=function(_0x4cff6a,_0x5c396d){_0x4cff6a=_0x4cff6a-0x0;var _0x528b6a=_0xf0bd[_0x4cff6a];return _0x528b6a;};'use strict';var _=require(_0xdf0b('0x0'));var util=require(_0xdf0b('0x1'));var logger=require(_0xdf0b('0x2'))(_0xdf0b('0x3'));var moment=require(_0xdf0b('0x4'));var BPromise=require(_0xdf0b('0x5'));var rp=require(_0xdf0b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdf0b('0x7'));var attributes=require(_0xdf0b('0x8'));module[_0xdf0b('0x9')]=function(_0x394824,_0x1aa49f){return _0x394824[_0xdf0b('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0xdf0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index d862660..15dd24d 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 _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(_0x3c7a29,_0x1445a6){var _0x52bab2=function(_0x580fd4){while(--_0x580fd4){_0x3c7a29['push'](_0x3c7a29['shift']());}};_0x52bab2(++_0x1445a6);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'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 +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x121e84,_0x4db4b6){var _0x1a04d5=function(_0x29cf56){while(--_0x29cf56){_0x121e84['push'](_0x121e84['shift']());}};_0x1a04d5(++_0x4db4b6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1fbe8a,_0x5ea827){_0x1fbe8a=_0x1fbe8a-0x0;var _0x4adf2b=_0x5f2f[_0x1fbe8a];return _0x4adf2b;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index e16b8cd..2d7a2cf 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 _0x965d=['isAuthenticated','/:id','show','post','create','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','./analyticTreeReport.controller','get'];(function(_0x4f35f4,_0x51a8c3){var _0x2e9a70=function(_0x110aca){while(--_0x110aca){_0x4f35f4['push'](_0x4f35f4['shift']());}};_0x2e9a70(++_0x51a8c3);}(_0x965d,0xa8));var _0xd965=function(_0x3d347c,_0x110b23){_0x3d347c=_0x3d347c-0x0;var _0x3b8632=_0x965d[_0x3d347c];return _0x3b8632;};'use strict';var multer=require(_0xd965('0x0'));var util=require(_0xd965('0x1'));var path=require(_0xd965('0x2'));var timeout=require('connect-timeout');var express=require(_0xd965('0x3'));var router=express[_0xd965('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd965('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd965('0x6'));router[_0xd965('0x7')]('/',auth[_0xd965('0x8')](),controller['index']);router[_0xd965('0x7')](_0xd965('0x9'),auth[_0xd965('0x8')](),controller[_0xd965('0xa')]);router[_0xd965('0xb')]('/',auth['isAuthenticated'](),controller[_0xd965('0xc')]);router['put'](_0xd965('0x9'),auth[_0xd965('0x8')](),controller[_0xd965('0xd')]);router['delete'](_0xd965('0x9'),auth['isAuthenticated'](),controller[_0xd965('0xe')]);module[_0xd965('0xf')]=router; \ No newline at end of file +var _0x7e3e=['put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show','post','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7e3e,0x180));var _0xe7e3=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7e3e[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0xe7e3('0x0'));var util=require('util');var path=require(_0xe7e3('0x1'));var timeout=require(_0xe7e3('0x2'));var express=require(_0xe7e3('0x3'));var router=express[_0xe7e3('0x4')]();var fs_extra=require(_0xe7e3('0x5'));var auth=require(_0xe7e3('0x6'));var interaction=require(_0xe7e3('0x7'));var config=require(_0xe7e3('0x8'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe7e3('0x9')]);router[_0xe7e3('0xa')]('/:id',auth[_0xe7e3('0xb')](),controller[_0xe7e3('0xc')]);router[_0xe7e3('0xd')]('/',auth[_0xe7e3('0xb')](),controller[_0xe7e3('0xe')]);router[_0xe7e3('0xf')](_0xe7e3('0x10'),auth[_0xe7e3('0xb')](),controller[_0xe7e3('0x11')]);router[_0xe7e3('0x12')](_0xe7e3('0x10'),auth[_0xe7e3('0xb')](),controller[_0xe7e3('0x13')]);module[_0xe7e3('0x14')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 03c4ff3..3655d98 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 _0xf822=['sequelize','STRING'];(function(_0x369d29,_0x10c8a1){var _0x5c8e47=function(_0x1b5cda){while(--_0x1b5cda){_0x369d29['push'](_0x369d29['shift']());}};_0x5c8e47(++_0x10c8a1);}(_0xf822,0x19e));var _0x2f82=function(_0x1d2340,_0x15883a){_0x1d2340=_0x1d2340-0x0;var _0xc172b0=_0xf822[_0x1d2340];return _0xc172b0;};'use strict';var Sequelize=require(_0x2f82('0x0'));module['exports']={'name':{'type':Sequelize[_0x2f82('0x1')]},'basename':{'type':Sequelize[_0x2f82('0x1')]},'type':{'type':Sequelize[_0x2f82('0x1')]}}; \ No newline at end of file +var _0x0c29=['STRING'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0c29,0xb7));var _0x90c2=function(_0x99ff94,_0x47a1b1){_0x99ff94=_0x99ff94-0x0;var _0x1b5bc0=_0x0c29[_0x99ff94];return _0x1b5bc0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x90c2('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x90c2('0x0')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 9f0371d..fc3f20f 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 _0x2ade=['end','error','stack','name','send','index','Attachment','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','count','include','rows','catch','includeAll','find','params','options','get','omit','createdAt','updatedAt','body','create','update','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','Content-Range','apply','reject','save','then','destroy'];(function(_0x1aa5ff,_0x3907a6){var _0x1e4960=function(_0x2afc3d){while(--_0x2afc3d){_0x1aa5ff['push'](_0x1aa5ff['shift']());}};_0x1e4960(++_0x3907a6);}(_0x2ade,0xe3));var _0xe2ad=function(_0x141d5c,_0x4c8481){_0x141d5c=_0x141d5c-0x0;var _0x31e74b=_0x2ade[_0x141d5c];return _0x31e74b;};'use strict';var emlformat=require(_0xe2ad('0x0'));var rimraf=require(_0xe2ad('0x1'));var zipdir=require(_0xe2ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe2ad('0x3'));var BPromise=require(_0xe2ad('0x4'));var Mustache=require(_0xe2ad('0x5'));var util=require(_0xe2ad('0x6'));var path=require(_0xe2ad('0x7'));var sox=require(_0xe2ad('0x8'));var csv=require(_0xe2ad('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2ad('0xa'));var _=require('lodash');var squel=require(_0xe2ad('0xb'));var crypto=require('crypto');var jsforce=require(_0xe2ad('0xc'));var deskjs=require(_0xe2ad('0xd'));var toCsv=require(_0xe2ad('0x9'));var querystring=require(_0xe2ad('0xe'));var Papa=require('papaparse');var Redis=require(_0xe2ad('0xf'));var authService=require(_0xe2ad('0x10'));var qs=require(_0xe2ad('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe2ad('0x12'));var logger=require(_0xe2ad('0x13'))('api');var utils=require(_0xe2ad('0x14'));var config=require(_0xe2ad('0x15'));var licenseUtil=require(_0xe2ad('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37a66b,_0x548118){_0x548118=_0x548118||0xcc;return function(_0x62ea8f){if(_0x62ea8f){return _0x37a66b[_0xe2ad('0x17')](_0x548118);}return _0x37a66b[_0xe2ad('0x18')](_0x548118)['end']();};}function respondWithResult(_0x23f933,_0x5386bd){_0x5386bd=_0x5386bd||0xc8;return function(_0x9fb792){if(_0x9fb792){return _0x23f933[_0xe2ad('0x18')](_0x5386bd)[_0xe2ad('0x19')](_0x9fb792);}};}function respondWithFilteredResult(_0xb9a20,_0x2601b6){return function(_0x456d96){if(_0x456d96){var _0x37b21b=typeof _0x2601b6[_0xe2ad('0x1a')]===_0xe2ad('0x1b')&&typeof _0x2601b6['limit']===_0xe2ad('0x1b');var _0x5679d5=_0x456d96['count'];var _0x8a2b3=_0x37b21b?0x0:_0x2601b6[_0xe2ad('0x1a')];var _0x3b6768=_0x37b21b?_0x456d96['count']:_0x2601b6[_0xe2ad('0x1a')]+_0x2601b6['limit'];var _0x424228;if(_0x3b6768>=_0x5679d5){_0x3b6768=_0x5679d5;_0x424228=0xc8;}else{_0x424228=0xce;}_0xb9a20['status'](_0x424228);return _0xb9a20['set'](_0xe2ad('0x1c'),_0x8a2b3+'-'+_0x3b6768+'/'+_0x5679d5)['json'](_0x456d96);}return null;};}function patchUpdates(_0x275848){return function(_0x178a7b){try{jsonpatch[_0xe2ad('0x1d')](_0x178a7b,_0x275848,!![]);}catch(_0x37fa45){return BPromise[_0xe2ad('0x1e')](_0x37fa45);}return _0x178a7b[_0xe2ad('0x1f')]();};}function saveUpdates(_0x205526,_0x9495e9){return function(_0x45c81e){if(_0x45c81e){return _0x45c81e['update'](_0x205526)[_0xe2ad('0x20')](function(_0x4d6507){return _0x4d6507;});}return null;};}function removeEntity(_0xd73a59,_0x411955){return function(_0x5296c3){if(_0x5296c3){return _0x5296c3[_0xe2ad('0x21')]()[_0xe2ad('0x20')](function(){_0xd73a59[_0xe2ad('0x18')](0xcc)[_0xe2ad('0x22')]();});}};}function handleEntityNotFound(_0x3f26b0,_0x2ce3b3){return function(_0x1041d1){if(!_0x1041d1){_0x3f26b0[_0xe2ad('0x17')](0x194);}return _0x1041d1;};}function handleError(_0x4225b2,_0x47cae9){_0x47cae9=_0x47cae9||0x1f4;return function(_0x712f08){logger[_0xe2ad('0x23')](_0x712f08[_0xe2ad('0x24')]);if(_0x712f08['name']){delete _0x712f08[_0xe2ad('0x25')];}_0x4225b2[_0xe2ad('0x18')](_0x47cae9)[_0xe2ad('0x26')](_0x712f08);};}exports[_0xe2ad('0x27')]=function(_0x504d3c,_0x1a4e78){var _0x33f80d={},_0x5dda95={},_0x3f7c24={'count':0x0,'rows':[]};var _0x38050c=_['map'](db[_0xe2ad('0x28')][_0xe2ad('0x29')],function(_0x4f5ec1){return{'name':_0x4f5ec1['fieldName'],'type':_0x4f5ec1[_0xe2ad('0x2a')][_0xe2ad('0x2b')]};});_0x5dda95['model']=_[_0xe2ad('0x2c')](_0x38050c,_0xe2ad('0x25'));_0x5dda95[_0xe2ad('0x2d')]=_[_0xe2ad('0x2e')](_0x504d3c[_0xe2ad('0x2d')]);_0x5dda95[_0xe2ad('0x2f')]=_[_0xe2ad('0x30')](_0x5dda95[_0xe2ad('0x31')],_0x5dda95[_0xe2ad('0x2d')]);_0x33f80d[_0xe2ad('0x32')]=_[_0xe2ad('0x30')](_0x5dda95['model'],qs[_0xe2ad('0x33')](_0x504d3c['query']['fields']));_0x33f80d['attributes']=_0x33f80d[_0xe2ad('0x32')][_0xe2ad('0x34')]?_0x33f80d[_0xe2ad('0x32')]:_0x5dda95[_0xe2ad('0x31')];if(!_0x504d3c[_0xe2ad('0x2d')][_0xe2ad('0x35')](_0xe2ad('0x36'))){_0x33f80d['limit']=qs[_0xe2ad('0x37')](_0x504d3c[_0xe2ad('0x2d')][_0xe2ad('0x37')]);_0x33f80d[_0xe2ad('0x1a')]=qs[_0xe2ad('0x1a')](_0x504d3c['query']['offset']);}_0x33f80d['order']=qs[_0xe2ad('0x38')](_0x504d3c['query'][_0xe2ad('0x38')]);_0x33f80d[_0xe2ad('0x39')]=qs[_0xe2ad('0x2f')](_[_0xe2ad('0x3a')](_0x504d3c[_0xe2ad('0x2d')],_0x5dda95[_0xe2ad('0x2f')]),_0x38050c);if(_0x504d3c['query'][_0xe2ad('0x3b')]){_0x33f80d[_0xe2ad('0x39')]=_[_0xe2ad('0x3c')](_0x33f80d[_0xe2ad('0x39')],{'$or':_[_0xe2ad('0x2c')](_0x38050c,function(_0x11e213){if(_0x11e213[_0xe2ad('0x2a')]!==_0xe2ad('0x3d')){var _0xc4e62f={};_0xc4e62f[_0x11e213[_0xe2ad('0x25')]]={'$like':'%'+_0x504d3c[_0xe2ad('0x2d')][_0xe2ad('0x3b')]+'%'};return _0xc4e62f;}})});}_0x33f80d=_['merge']({},_0x33f80d,_0x504d3c['options']);var _0xdd182a={'where':_0x33f80d[_0xe2ad('0x39')]};return db[_0xe2ad('0x28')]['count'](_0xdd182a)[_0xe2ad('0x20')](function(_0x45a692){_0x3f7c24[_0xe2ad('0x3e')]=_0x45a692;if(_0x504d3c[_0xe2ad('0x2d')]['includeAll']){_0x33f80d[_0xe2ad('0x3f')]=[{'all':!![]}];}return db[_0xe2ad('0x28')]['findAll'](_0x33f80d);})[_0xe2ad('0x20')](function(_0x14b5c9){_0x3f7c24[_0xe2ad('0x40')]=_0x14b5c9;return _0x3f7c24;})[_0xe2ad('0x20')](respondWithFilteredResult(_0x1a4e78,_0x33f80d))[_0xe2ad('0x41')](handleError(_0x1a4e78,null));};exports['show']=function(_0x43824e,_0xfc49db){var _0x46930f={'raw':!![],'where':{'id':_0x43824e['params']['id']}},_0xe6be68={};_0xe6be68[_0xe2ad('0x31')]=_['keys'](db[_0xe2ad('0x28')][_0xe2ad('0x29')]);_0xe6be68[_0xe2ad('0x2d')]=_[_0xe2ad('0x2e')](_0x43824e['query']);_0xe6be68[_0xe2ad('0x2f')]=_[_0xe2ad('0x30')](_0xe6be68['model'],_0xe6be68[_0xe2ad('0x2d')]);_0x46930f[_0xe2ad('0x32')]=_[_0xe2ad('0x30')](_0xe6be68['model'],qs['fields'](_0x43824e['query'][_0xe2ad('0x33')]));_0x46930f['attributes']=_0x46930f['attributes'][_0xe2ad('0x34')]?_0x46930f[_0xe2ad('0x32')]:_0xe6be68['model'];if(_0x43824e[_0xe2ad('0x2d')][_0xe2ad('0x42')]){_0x46930f['include']=[{'all':!![]}];}_0x46930f=_[_0xe2ad('0x3c')]({},_0x46930f,_0x43824e['options']);return db[_0xe2ad('0x28')][_0xe2ad('0x43')](_0x46930f)[_0xe2ad('0x20')](handleEntityNotFound(_0xfc49db,null))[_0xe2ad('0x20')](respondWithResult(_0xfc49db,null))[_0xe2ad('0x41')](handleError(_0xfc49db,null));};exports['clone']=function(_0x257f2c,_0xda7596){var _0x1241b9={'where':{'id':_0x257f2c[_0xe2ad('0x44')]['id']}},_0x468ec6={};_0x468ec6[_0xe2ad('0x31')]=_['keys'](db[_0xe2ad('0x28')][_0xe2ad('0x29')]);_0x1241b9[_0xe2ad('0x32')]=_[_0xe2ad('0x30')](_0x468ec6[_0xe2ad('0x31')],qs[_0xe2ad('0x33')](_0x257f2c['query'][_0xe2ad('0x33')]));_0x1241b9[_0xe2ad('0x32')]=_0x1241b9['attributes']['length']?_0x1241b9[_0xe2ad('0x32')]:_0x468ec6[_0xe2ad('0x31')];if(_0x257f2c[_0xe2ad('0x2d')]['includeAll']){_0x1241b9[_0xe2ad('0x3f')]=[{'all':!![]}];}_0x1241b9=_[_0xe2ad('0x3c')]({},_0x1241b9,_0x257f2c[_0xe2ad('0x45')]);return db[_0xe2ad('0x28')]['find'](_0x1241b9)[_0xe2ad('0x20')](handleEntityNotFound(_0xda7596,null))[_0xe2ad('0x20')](function(_0x177dd8){if(_0x177dd8){var _0x1947c7=_0x177dd8[_0xe2ad('0x46')]({'plain':!![]});_0x1947c7=qs[_0xe2ad('0x47')](_0x1947c7,['id',_0xe2ad('0x48'),_0xe2ad('0x49')]);_0x257f2c[_0xe2ad('0x4a')]=_[_0xe2ad('0x47')](_0x257f2c[_0xe2ad('0x4a')],['id',_0xe2ad('0x48'),_0xe2ad('0x49')]);return db[_0xe2ad('0x28')][_0xe2ad('0x4b')](_['merge'](_0x1947c7,_0x257f2c[_0xe2ad('0x4a')]),{'include':_0x257f2c[_0xe2ad('0x2d')][_0xe2ad('0x42')]?[{'all':!![]}]:undefined});}})[_0xe2ad('0x20')](respondWithResult(_0xda7596,0xc9))['catch'](handleError(_0xda7596,null));};exports[_0xe2ad('0x4c')]=function(_0x47eb9a,_0x2bf150){if(_0x47eb9a[_0xe2ad('0x4a')]['id']){delete _0x47eb9a[_0xe2ad('0x4a')]['id'];}return db[_0xe2ad('0x28')][_0xe2ad('0x43')]({'where':{'id':_0x47eb9a['params']['id']}})['then'](handleEntityNotFound(_0x2bf150,null))[_0xe2ad('0x20')](saveUpdates(_0x47eb9a[_0xe2ad('0x4a')],null))[_0xe2ad('0x20')](respondWithResult(_0x2bf150,null))[_0xe2ad('0x41')](handleError(_0x2bf150,null));};exports['destroy']=function(_0x308be6,_0x57a540){return db[_0xe2ad('0x28')]['find']({'where':{'id':_0x308be6[_0xe2ad('0x44')]['id']}})[_0xe2ad('0x20')](handleEntityNotFound(_0x57a540,null))['then'](removeEntity(_0x57a540,null))[_0xe2ad('0x41')](handleError(_0x57a540,null));};exports[_0xe2ad('0x4b')]=function(_0x385ab4,_0x42c0be,_0x3534df){_0x385ab4['body']['name']=_0x385ab4[_0xe2ad('0x4d')][_0xe2ad('0x4e')];_0x385ab4[_0xe2ad('0x4a')][_0xe2ad('0x4f')]=_0x385ab4[_0xe2ad('0x4d')][_0xe2ad('0x50')];_0x385ab4[_0xe2ad('0x4a')][_0xe2ad('0x2a')]=_0x385ab4[_0xe2ad('0x4d')][_0xe2ad('0x51')];return db['Attachment'][_0xe2ad('0x4b')](_0x385ab4[_0xe2ad('0x4a')])[_0xe2ad('0x20')](respondWithResult(_0x42c0be,0xc9))['catch'](handleError(_0x42c0be,null));};exports[_0xe2ad('0x52')]=function(_0x467de3,_0x3c0b1c,_0x25a3db){return db[_0xe2ad('0x28')]['findOne']({'where':{'id':_0x467de3['params']['id']},'raw':!![]})[_0xe2ad('0x20')](handleEntityNotFound(_0x3c0b1c,null))['then'](function(_0x50a6cf){if(_0x50a6cf){var _0x17418b=_0x50a6cf[_0xe2ad('0x53')]!==null;var _0x248746=path[_0xe2ad('0x54')](config[_0xe2ad('0x55')],'server/files/attachments/');if(_0x17418b){_0x248746=path[_0xe2ad('0x54')](_0x248746,_0xe2ad('0x56'));}var _0x2511cd=path[_0xe2ad('0x54')](_0x248746,_0x50a6cf['basename']);return _0x3c0b1c[_0xe2ad('0x52')](_0x2511cd);}})['catch'](handleError(_0x3c0b1c,null));}; \ No newline at end of file +var _0x76f8=['attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','count','then','rows','catch','show','params','includeAll','include','find','clone','omit','createdAt','updatedAt','create','body','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','rimraf','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','map','Attachment','rawAttributes','type','key','model','query','keys','filters','intersection'];(function(_0x870b62,_0x2143f9){var _0x2dcb39=function(_0x2fb63d){while(--_0x2fb63d){_0x870b62['push'](_0x870b62['shift']());}};_0x2dcb39(++_0x2143f9);}(_0x76f8,0xd3));var _0x876f=function(_0x4365cb,_0x55ed1e){_0x4365cb=_0x4365cb-0x0;var _0x3ec9f7=_0x76f8[_0x4365cb];return _0x3ec9f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x876f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x876f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x876f('0x2'));var util=require(_0x876f('0x3'));var path=require(_0x876f('0x4'));var sox=require(_0x876f('0x5'));var csv=require(_0x876f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x876f('0x7'));var _=require(_0x876f('0x8'));var squel=require(_0x876f('0x9'));var crypto=require(_0x876f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x876f('0xb'));var toCsv=require(_0x876f('0x6'));var querystring=require(_0x876f('0xc'));var Papa=require(_0x876f('0xd'));var Redis=require(_0x876f('0xe'));var authService=require(_0x876f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x876f('0x10'));var hardwareService=require(_0x876f('0x11'));var logger=require(_0x876f('0x12'))(_0x876f('0x13'));var utils=require(_0x876f('0x14'));var config=require(_0x876f('0x15'));var licenseUtil=require(_0x876f('0x16'));var db=require(_0x876f('0x17'))['db'];function respondWithStatusCode(_0xf4f57,_0x547351){_0x547351=_0x547351||0xcc;return function(_0x2c2a38){if(_0x2c2a38){return _0xf4f57[_0x876f('0x18')](_0x547351);}return _0xf4f57[_0x876f('0x19')](_0x547351)[_0x876f('0x1a')]();};}function respondWithResult(_0x536af9,_0x1ace0b){_0x1ace0b=_0x1ace0b||0xc8;return function(_0x422676){if(_0x422676){return _0x536af9[_0x876f('0x19')](_0x1ace0b)[_0x876f('0x1b')](_0x422676);}};}function respondWithFilteredResult(_0x3f400a,_0x4e3e33){return function(_0x4a1cf9){if(_0x4a1cf9){var _0x5b9cd5=typeof _0x4e3e33[_0x876f('0x1c')]===_0x876f('0x1d')&&typeof _0x4e3e33[_0x876f('0x1e')]===_0x876f('0x1d');var _0x36eb99=_0x4a1cf9['count'];var _0xbdcf0a=_0x5b9cd5?0x0:_0x4e3e33[_0x876f('0x1c')];var _0xcd4986=_0x5b9cd5?_0x4a1cf9['count']:_0x4e3e33[_0x876f('0x1c')]+_0x4e3e33[_0x876f('0x1e')];var _0x1121d0;if(_0xcd4986>=_0x36eb99){_0xcd4986=_0x36eb99;_0x1121d0=0xc8;}else{_0x1121d0=0xce;}_0x3f400a[_0x876f('0x19')](_0x1121d0);return _0x3f400a[_0x876f('0x1f')](_0x876f('0x20'),_0xbdcf0a+'-'+_0xcd4986+'/'+_0x36eb99)[_0x876f('0x1b')](_0x4a1cf9);}return null;};}function patchUpdates(_0x539bd4){return function(_0x8d4932){try{jsonpatch[_0x876f('0x21')](_0x8d4932,_0x539bd4,!![]);}catch(_0x22a12d){return BPromise['reject'](_0x22a12d);}return _0x8d4932[_0x876f('0x22')]();};}function saveUpdates(_0x4004df,_0x427b03){return function(_0x2a85e1){if(_0x2a85e1){return _0x2a85e1[_0x876f('0x23')](_0x4004df)['then'](function(_0x1c641d){return _0x1c641d;});}return null;};}function removeEntity(_0x164ed9,_0x4d6edf){return function(_0x40ff3f){if(_0x40ff3f){return _0x40ff3f[_0x876f('0x24')]()['then'](function(){_0x164ed9[_0x876f('0x19')](0xcc)[_0x876f('0x1a')]();});}};}function handleEntityNotFound(_0x140d47,_0x157802){return function(_0x58f516){if(!_0x58f516){_0x140d47[_0x876f('0x18')](0x194);}return _0x58f516;};}function handleError(_0x1663e8,_0x3221aa){_0x3221aa=_0x3221aa||0x1f4;return function(_0x3f9d7a){logger['error'](_0x3f9d7a[_0x876f('0x25')]);if(_0x3f9d7a[_0x876f('0x26')]){delete _0x3f9d7a[_0x876f('0x26')];}_0x1663e8[_0x876f('0x19')](_0x3221aa)[_0x876f('0x27')](_0x3f9d7a);};}exports['index']=function(_0x3db4f6,_0x449f34){var _0x568ef8={},_0x155490={},_0x349930={'count':0x0,'rows':[]};var _0x1f21e8=_[_0x876f('0x28')](db[_0x876f('0x29')][_0x876f('0x2a')],function(_0x23a87f){return{'name':_0x23a87f['fieldName'],'type':_0x23a87f[_0x876f('0x2b')][_0x876f('0x2c')]};});_0x155490[_0x876f('0x2d')]=_[_0x876f('0x28')](_0x1f21e8,_0x876f('0x26'));_0x155490[_0x876f('0x2e')]=_[_0x876f('0x2f')](_0x3db4f6['query']);_0x155490[_0x876f('0x30')]=_[_0x876f('0x31')](_0x155490['model'],_0x155490['query']);_0x568ef8[_0x876f('0x32')]=_[_0x876f('0x31')](_0x155490[_0x876f('0x2d')],qs['fields'](_0x3db4f6['query'][_0x876f('0x33')]));_0x568ef8['attributes']=_0x568ef8[_0x876f('0x32')][_0x876f('0x34')]?_0x568ef8['attributes']:_0x155490[_0x876f('0x2d')];if(!_0x3db4f6[_0x876f('0x2e')][_0x876f('0x35')](_0x876f('0x36'))){_0x568ef8[_0x876f('0x1e')]=qs[_0x876f('0x1e')](_0x3db4f6[_0x876f('0x2e')]['limit']);_0x568ef8[_0x876f('0x1c')]=qs[_0x876f('0x1c')](_0x3db4f6['query']['offset']);}_0x568ef8['order']=qs[_0x876f('0x37')](_0x3db4f6['query']['sort']);_0x568ef8['where']=qs[_0x876f('0x30')](_[_0x876f('0x38')](_0x3db4f6['query'],_0x155490[_0x876f('0x30')]),_0x1f21e8);if(_0x3db4f6['query'][_0x876f('0x39')]){_0x568ef8[_0x876f('0x3a')]=_[_0x876f('0x3b')](_0x568ef8['where'],{'$or':_[_0x876f('0x28')](_0x1f21e8,function(_0x306a01){if(_0x306a01[_0x876f('0x2b')]!==_0x876f('0x3c')){var _0x15add2={};_0x15add2[_0x306a01['name']]={'$like':'%'+_0x3db4f6[_0x876f('0x2e')][_0x876f('0x39')]+'%'};return _0x15add2;}})});}_0x568ef8=_[_0x876f('0x3b')]({},_0x568ef8,_0x3db4f6[_0x876f('0x3d')]);var _0x3b28dd={'where':_0x568ef8[_0x876f('0x3a')]};return db[_0x876f('0x29')][_0x876f('0x3e')](_0x3b28dd)[_0x876f('0x3f')](function(_0x53166c){_0x349930[_0x876f('0x3e')]=_0x53166c;if(_0x3db4f6[_0x876f('0x2e')]['includeAll']){_0x568ef8['include']=[{'all':!![]}];}return db['Attachment']['findAll'](_0x568ef8);})[_0x876f('0x3f')](function(_0x17a04b){_0x349930[_0x876f('0x40')]=_0x17a04b;return _0x349930;})[_0x876f('0x3f')](respondWithFilteredResult(_0x449f34,_0x568ef8))[_0x876f('0x41')](handleError(_0x449f34,null));};exports[_0x876f('0x42')]=function(_0x13d9d7,_0x5a8aa6){var _0x4b78da={'raw':!![],'where':{'id':_0x13d9d7[_0x876f('0x43')]['id']}},_0x41ed57={};_0x41ed57[_0x876f('0x2d')]=_[_0x876f('0x2f')](db[_0x876f('0x29')][_0x876f('0x2a')]);_0x41ed57[_0x876f('0x2e')]=_[_0x876f('0x2f')](_0x13d9d7['query']);_0x41ed57[_0x876f('0x30')]=_['intersection'](_0x41ed57[_0x876f('0x2d')],_0x41ed57[_0x876f('0x2e')]);_0x4b78da[_0x876f('0x32')]=_[_0x876f('0x31')](_0x41ed57[_0x876f('0x2d')],qs[_0x876f('0x33')](_0x13d9d7[_0x876f('0x2e')][_0x876f('0x33')]));_0x4b78da[_0x876f('0x32')]=_0x4b78da[_0x876f('0x32')]['length']?_0x4b78da['attributes']:_0x41ed57[_0x876f('0x2d')];if(_0x13d9d7['query'][_0x876f('0x44')]){_0x4b78da[_0x876f('0x45')]=[{'all':!![]}];}_0x4b78da=_[_0x876f('0x3b')]({},_0x4b78da,_0x13d9d7[_0x876f('0x3d')]);return db[_0x876f('0x29')][_0x876f('0x46')](_0x4b78da)[_0x876f('0x3f')](handleEntityNotFound(_0x5a8aa6,null))['then'](respondWithResult(_0x5a8aa6,null))['catch'](handleError(_0x5a8aa6,null));};exports[_0x876f('0x47')]=function(_0x4cd5b0,_0x11942f){var _0x34bfdf={'where':{'id':_0x4cd5b0[_0x876f('0x43')]['id']}},_0x4f5c54={};_0x4f5c54[_0x876f('0x2d')]=_[_0x876f('0x2f')](db[_0x876f('0x29')]['rawAttributes']);_0x34bfdf['attributes']=_[_0x876f('0x31')](_0x4f5c54[_0x876f('0x2d')],qs[_0x876f('0x33')](_0x4cd5b0[_0x876f('0x2e')][_0x876f('0x33')]));_0x34bfdf['attributes']=_0x34bfdf['attributes'][_0x876f('0x34')]?_0x34bfdf[_0x876f('0x32')]:_0x4f5c54[_0x876f('0x2d')];if(_0x4cd5b0[_0x876f('0x2e')][_0x876f('0x44')]){_0x34bfdf[_0x876f('0x45')]=[{'all':!![]}];}_0x34bfdf=_['merge']({},_0x34bfdf,_0x4cd5b0[_0x876f('0x3d')]);return db[_0x876f('0x29')][_0x876f('0x46')](_0x34bfdf)[_0x876f('0x3f')](handleEntityNotFound(_0x11942f,null))[_0x876f('0x3f')](function(_0x15e944){if(_0x15e944){var _0xb77034=_0x15e944['get']({'plain':!![]});_0xb77034=qs[_0x876f('0x48')](_0xb77034,['id',_0x876f('0x49'),_0x876f('0x4a')]);_0x4cd5b0['body']=_['omit'](_0x4cd5b0['body'],['id',_0x876f('0x49'),'updatedAt']);return db['Attachment'][_0x876f('0x4b')](_[_0x876f('0x3b')](_0xb77034,_0x4cd5b0['body']),{'include':_0x4cd5b0[_0x876f('0x2e')][_0x876f('0x44')]?[{'all':!![]}]:undefined});}})[_0x876f('0x3f')](respondWithResult(_0x11942f,0xc9))[_0x876f('0x41')](handleError(_0x11942f,null));};exports['update']=function(_0x29bef2,_0x491cc1){if(_0x29bef2[_0x876f('0x4c')]['id']){delete _0x29bef2['body']['id'];}return db['Attachment'][_0x876f('0x46')]({'where':{'id':_0x29bef2[_0x876f('0x43')]['id']}})['then'](handleEntityNotFound(_0x491cc1,null))[_0x876f('0x3f')](saveUpdates(_0x29bef2[_0x876f('0x4c')],null))[_0x876f('0x3f')](respondWithResult(_0x491cc1,null))[_0x876f('0x41')](handleError(_0x491cc1,null));};exports[_0x876f('0x24')]=function(_0x53b718,_0x553258){return db['Attachment'][_0x876f('0x46')]({'where':{'id':_0x53b718[_0x876f('0x43')]['id']}})[_0x876f('0x3f')](handleEntityNotFound(_0x553258,null))[_0x876f('0x3f')](removeEntity(_0x553258,null))[_0x876f('0x41')](handleError(_0x553258,null));};exports[_0x876f('0x4b')]=function(_0x4a47d7,_0x3f1e7d,_0x3b43a5){_0x4a47d7['body'][_0x876f('0x26')]=_0x4a47d7[_0x876f('0x4d')][_0x876f('0x4e')];_0x4a47d7[_0x876f('0x4c')][_0x876f('0x4f')]=_0x4a47d7[_0x876f('0x4d')][_0x876f('0x50')];_0x4a47d7[_0x876f('0x4c')][_0x876f('0x2b')]=_0x4a47d7[_0x876f('0x4d')][_0x876f('0x51')];return db[_0x876f('0x29')][_0x876f('0x4b')](_0x4a47d7['body'])[_0x876f('0x3f')](respondWithResult(_0x3f1e7d,0xc9))[_0x876f('0x41')](handleError(_0x3f1e7d,null));};exports[_0x876f('0x52')]=function(_0x7bf600,_0x4e7056,_0x1af92b){return db['Attachment'][_0x876f('0x53')]({'where':{'id':_0x7bf600['params']['id']},'raw':!![]})[_0x876f('0x3f')](handleEntityNotFound(_0x4e7056,null))[_0x876f('0x3f')](function(_0x4a300b){if(_0x4a300b){var _0x335d8c=_0x4a300b[_0x876f('0x54')]!==null;var _0x27631c=path[_0x876f('0x55')](config[_0x876f('0x56')],'server/files/attachments/');if(_0x335d8c){_0x27631c=path[_0x876f('0x55')](_0x27631c,'offline-chat/');}var _0x4b8de9=path['join'](_0x27631c,_0x4a300b[_0x876f('0x4f')]);return _0x4e7056[_0x876f('0x52')](_0x4b8de9);}})[_0x876f('0x41')](handleError(_0x4e7056,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index b63470e..0ead88c 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 _0x7e3e=['Attachment','attachments','util','moment','path','../../config/environment','exports','define'];(function(_0x5c5b62,_0x1a998f){var _0x2034a2=function(_0x28ce24){while(--_0x28ce24){_0x5c5b62['push'](_0x5c5b62['shift']());}};_0x2034a2(++_0x1a998f);}(_0x7e3e,0x7a));var _0xe7e3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7e3e[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xe7e3('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe7e3('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7e3('0x2'));var rimraf=require('rimraf');var config=require(_0xe7e3('0x3'));var attributes=require('./attachment.attributes');module[_0xe7e3('0x4')]=function(_0x340a87,_0x5ad116){return _0x340a87[_0xe7e3('0x5')](_0xe7e3('0x6'),attributes,{'tableName':_0xe7e3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fb9=['path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6fb9,0x193));var _0x96fb=function(_0x5d6482,_0x1c9b00){_0x5d6482=_0x5d6482-0x0;var _0x32e681=_0x6fb9[_0x5d6482];return _0x32e681;};'use strict';var _=require('lodash');var util=require(_0x96fb('0x0'));var logger=require(_0x96fb('0x1'))('api');var moment=require(_0x96fb('0x2'));var BPromise=require(_0x96fb('0x3'));var rp=require(_0x96fb('0x4'));var fs=require('fs');var path=require(_0x96fb('0x5'));var rimraf=require(_0x96fb('0x6'));var config=require(_0x96fb('0x7'));var attributes=require(_0x96fb('0x8'));module[_0x96fb('0x9')]=function(_0x49eda8,_0x2fb1e3){return _0x49eda8[_0x96fb('0xa')](_0x96fb('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 049f81f..bee8864 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 _0x803f=['then','info','request\x20sent','debug','stringify','error','code','message','Attachment,\x20%s,\x20%s','result','catch','CreateAttachment','Attachment','create','body','options','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x55b959,_0x1e8204){var _0x47b374=function(_0x4f09e1){while(--_0x4f09e1){_0x55b959['push'](_0x55b959['shift']());}};_0x47b374(++_0x1e8204);}(_0x803f,0x64));var _0xf803=function(_0x4e905f,_0x12b6d7){_0x4e905f=_0x4e905f-0x0;var _0x3dbb29=_0x803f[_0x4e905f];return _0x3dbb29;};'use strict';var _=require(_0xf803('0x0'));var util=require('util');var moment=require(_0xf803('0x1'));var BPromise=require(_0xf803('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf803('0x3'));var db=require(_0xf803('0x4'))['db'];var utils=require(_0xf803('0x5'));var logger=require(_0xf803('0x6'))(_0xf803('0x7'));var config=require('../../config/environment');var jayson=require(_0xf803('0x8'));var client=jayson[_0xf803('0x9')][_0xf803('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x584b2d,_0x214708,_0x47128f){return new BPromise(function(_0x587319,_0x3fc5ce){return client[_0xf803('0xb')](_0x584b2d,_0x47128f)[_0xf803('0xc')](function(_0x4c95cb){logger[_0xf803('0xd')]('Attachment,\x20%s,\x20%s',_0x214708,_0xf803('0xe'));logger[_0xf803('0xf')]('Attachment,\x20%s,\x20%s,\x20%s',_0x214708,_0xf803('0xe'),JSON[_0xf803('0x10')](_0x4c95cb));if(_0x4c95cb[_0xf803('0x11')]){if(_0x4c95cb[_0xf803('0x11')][_0xf803('0x12')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x214708,_0x4c95cb[_0xf803('0x11')][_0xf803('0x13')]);return _0x3fc5ce(_0x4c95cb['error'][_0xf803('0x13')]);}logger['error'](_0xf803('0x14'),_0x214708,_0x4c95cb[_0xf803('0x11')][_0xf803('0x13')]);return _0x587319(_0x4c95cb[_0xf803('0x11')]['message']);}else{logger[_0xf803('0xd')](_0xf803('0x14'),_0x214708,_0xf803('0xe'));_0x587319(_0x4c95cb[_0xf803('0x15')][_0xf803('0x13')]);}})[_0xf803('0x16')](function(_0xbd7728){logger['error']('Attachment,\x20%s,\x20%s',_0x214708,_0xbd7728);_0x3fc5ce(_0xbd7728);});});}exports[_0xf803('0x17')]=function(_0x292179){var _0x5c775b=this;return new Promise(function(_0x36d347,_0x29e28f){return db[_0xf803('0x18')][_0xf803('0x19')](_0x292179[_0xf803('0x1a')],{'raw':_0x292179[_0xf803('0x1b')]?_0x292179[_0xf803('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xf803('0xc')](function(_0x252421){logger[_0xf803('0xd')](_0xf803('0x17'),_0x292179);logger[_0xf803('0xf')]('CreateAttachment',_0x292179,JSON[_0xf803('0x10')](_0x252421));_0x36d347(_0x252421);})[_0xf803('0x16')](function(_0x4a5299){logger[_0xf803('0x11')](_0xf803('0x17'),_0x4a5299[_0xf803('0x13')],_0x292179);_0x29e28f(_0x5c775b[_0xf803('0x11')](0x1f4,_0x4a5299[_0xf803('0x13')]));});});}; \ No newline at end of file +var _0x303a=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','create','body','options','raw','debug','lodash','moment','bluebird','randomstring'];(function(_0x4224e0,_0x451abb){var _0xd8fc40=function(_0x5bb5f7){while(--_0x5bb5f7){_0x4224e0['push'](_0x4224e0['shift']());}};_0xd8fc40(++_0x451abb);}(_0x303a,0x1a0));var _0xa303=function(_0x3252b1,_0x54e32d){_0x3252b1=_0x3252b1-0x0;var _0x5f189d=_0x303a[_0x3252b1];return _0x5f189d;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var moment=require(_0xa303('0x1'));var BPromise=require(_0xa303('0x2'));var rs=require(_0xa303('0x3'));var fs=require('fs');var Redis=require(_0xa303('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa303('0x5'));var logger=require(_0xa303('0x6'))(_0xa303('0x7'));var config=require(_0xa303('0x8'));var jayson=require(_0xa303('0x9'));var client=jayson[_0xa303('0xa')][_0xa303('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f61f1,_0x69b173,_0x5d95fd){return new BPromise(function(_0x51e1ee,_0x488c85){return client[_0xa303('0xc')](_0x3f61f1,_0x5d95fd)[_0xa303('0xd')](function(_0x5e2e48){logger[_0xa303('0xe')]('Attachment,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));logger['debug'](_0xa303('0x10'),_0x69b173,_0xa303('0xf'),JSON[_0xa303('0x11')](_0x5e2e48));if(_0x5e2e48[_0xa303('0x12')]){if(_0x5e2e48['error'][_0xa303('0x13')]===0x1f4){logger['error'](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x488c85(_0x5e2e48['error'][_0xa303('0x15')]);}logger[_0xa303('0x12')](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x51e1ee(_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);}else{logger[_0xa303('0xe')]('Attachment,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));_0x51e1ee(_0x5e2e48[_0xa303('0x16')][_0xa303('0x15')]);}})[_0xa303('0x17')](function(_0x3e2813){logger[_0xa303('0x12')]('Attachment,\x20%s,\x20%s',_0x69b173,_0x3e2813);_0x488c85(_0x3e2813);});});}exports[_0xa303('0x18')]=function(_0x54ca49){var _0x1d2003=this;return new Promise(function(_0x4cf535,_0x4462be){return db['Attachment'][_0xa303('0x19')](_0x54ca49[_0xa303('0x1a')],{'raw':_0x54ca49[_0xa303('0x1b')]?_0x54ca49['options'][_0xa303('0x1c')]===undefined?!![]:![]:!![]})[_0xa303('0xd')](function(_0x1b0566){logger['info'](_0xa303('0x18'),_0x54ca49);logger[_0xa303('0x1d')](_0xa303('0x18'),_0x54ca49,JSON[_0xa303('0x11')](_0x1b0566));_0x4cf535(_0x1b0566);})['catch'](function(_0x14f9ab){logger[_0xa303('0x12')]('CreateAttachment',_0x14f9ab[_0xa303('0x15')],_0x54ca49);_0x4462be(_0x1d2003[_0xa303('0x12')](0x1f4,_0x14f9ab[_0xa303('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a204f69..9845fa9 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(_0x524305,_0x4438f8){var _0x3665eb=function(_0x5bb67a){while(--_0x5bb67a){_0x524305['push'](_0x524305['shift']());}};_0x3665eb(++_0x4438f8);}(_0xb10b,0x12a));var _0xbb10=function(_0x590cd0,_0x11bfd4){_0x590cd0=_0x590cd0-0x0;var _0x208eb0=_0xb10b[_0x590cd0];return _0x208eb0;};'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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1e6b59,_0x5eca5d){var _0x40d7c5=function(_0x2dd544){while(--_0x2dd544){_0x1e6b59['push'](_0x1e6b59['shift']());}};_0x40d7c5(++_0x5eca5d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 3cea5e1..8efb3ab 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8260=['password','salt','role','blocked','blockedAt','online','user','agent','then','domain','add','minutes','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','use','User','passport','Strategy','activedirectory2','util','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name'];(function(_0x1e156a,_0x53b278){var _0xba0903=function(_0x1c2229){while(--_0x1c2229){_0x1e156a['push'](_0x1e156a['shift']());}};_0xba0903(++_0x53b278);}(_0x8260,0x1aa));var _0x0826=function(_0x63b6d3,_0x13c87d){_0x63b6d3=_0x63b6d3-0x0;var _0x41a70c=_0x8260[_0x63b6d3];return _0x41a70c;};'use strict';var passport=require(_0x0826('0x0'));var LocalStrategy=require('passport-local')[_0x0826('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x0826('0x2'));var BPromise=require('bluebird');var util=require(_0x0826('0x3'));var db=require('../../mysqldb')['db'];var authService=require(_0x0826('0x4'));var utils=require(_0x0826('0x5'));var config=require('../../config/environment');var logger=require(_0x0826('0x6'))(_0x0826('0x7'));function isActiveDirectoryConfigured(_0x3c5330){var _0x532e02=![];if(typeof _0x3c5330[_0x0826('0x8')]!==_0x0826('0x9')){_0x532e02=_0x3c5330[_0x0826('0x8')][_0x0826('0xa')]&&_0x3c5330['activedirectory'][_0x0826('0xb')]&&_0x3c5330[_0x0826('0x8')]['domain'];}return _0x532e02;}function adAuthenticate(_0x2ac461,_0x2cdfbd,_0x48b6e1){return new BPromise(function(_0x3af66f,_0x3bf3e7){try{var _0x3070db=new ActiveDirectory(_0x2ac461);_0x3070db[_0x0826('0xc')](_0x2cdfbd,_0x48b6e1,function(_0x4cc504,_0x58d699){if(_0x4cc504){logger[_0x0826('0xd')](_0x0826('0xe'),_0x2cdfbd,util[_0x0826('0xf')](_0x4cc504,{'showHidden':![],'depth':null}));_0x3bf3e7(_0x0826('0x10'));}else if(!_0x58d699){logger[_0x0826('0xd')](_0x0826('0x11'),_0x2cdfbd);_0x3bf3e7(_0x0826('0x10'));}else{_0x3af66f(_0x58d699);}});}catch(_0x50bd6f){_0x3bf3e7(_0x50bd6f);}});}function ActiveDirectoryAuthenticate(_0x2322cb,_0x56b45c,_0x2fcd93,_0x1a9aaa){var _0x12336d,_0x1c2c19;if(!isActiveDirectoryConfigured(config)){logger[_0x0826('0xd')](_0x0826('0x12'),_0x56b45c);return _0x1a9aaa(null,![],{'message':_0x0826('0x10')});}return db['Setting'][_0x0826('0x13')]({'where':{'id':0x1},'attributes':[_0x0826('0x14'),_0x0826('0x15')],'raw':!![]})['then'](function(_0x15a113){_0x12336d=_0x15a113;if(!_0x12336d[_0x0826('0x14')]){logger[_0x0826('0xd')](_0x0826('0x16'),_0x56b45c);throw new Error(_0x0826('0x10'));}return _0x2322cb[_0x0826('0x13')]({'logging':!![],'attributes':['id',_0x0826('0x17'),_0x0826('0x18'),_0x0826('0x19'),_0x0826('0x1a'),'disabled',_0x0826('0x1b'),_0x0826('0x1c'),_0x0826('0x1d')],'where':{'name':_0x56b45c,'role':{'$or':['admin',_0x0826('0x1e'),_0x0826('0x1f')]},'adSsoEnabled':!![]}});})[_0x0826('0x20')](function(_0x53c65d){if(!_0x53c65d||_0x53c65d&&_0x53c65d[_0x0826('0x17')]!==_0x56b45c){throw new Error(_0x0826('0x10'));}_0x1c2c19=_0x53c65d;var _0x49b955=_0x1c2c19[_0x0826('0x17')]+'@'+config['activedirectory'][_0x0826('0x21')];return adAuthenticate(config['activedirectory'],_0x49b955,_0x2fcd93);})['then'](function(_0x2c756d){if(_0x1c2c19['disabled']){throw new Error(_0x0826('0x10'));}if(_0x12336d[_0x0826('0x15')]>0x0){if(_0x1c2c19[_0x0826('0x1b')]){if(moment(_0x1c2c19[_0x0826('0x1c')])[_0x0826('0x22')](_0x12336d[_0x0826('0x15')],_0x0826('0x23'))>moment()){throw new Error(_0x0826('0x10'));}return utils['clearBlockUser'](_0x1c2c19,0x0,![],null)[_0x0826('0x20')](function(){return utils[_0x0826('0x24')](_0x1c2c19);})[_0x0826('0x20')](function(){return _0x1a9aaa(null,_0x1c2c19);});}else{return utils[_0x0826('0x24')](_0x1c2c19)[_0x0826('0x20')](function(){return _0x1a9aaa(null,_0x1c2c19);});}}else{return utils[_0x0826('0x24')](_0x1c2c19)[_0x0826('0x20')](function(){return _0x1a9aaa(null,_0x1c2c19);});}})['catch'](function(_0x1f3a81){return _0x1a9aaa(null,![],_0x1f3a81);});}function handleError(_0x5642ad,_0x10657c,_0x121ac3){return _0x5642ad[_0x0826('0x25')](_0x10657c||0x1f4)[_0x0826('0x26')]({'message':_0x121ac3?_0x121ac3[_0x0826('0x27')]||_0x121ac3:''});}exports[_0x0826('0x28')]=function(_0x19b5b4,_0x983123,_0x30f397){passport[_0x0826('0xc')](_0x0826('0x29'),function(_0x57c03e,_0x3bd136,_0x12ef11){var _0x3a9187=_0x57c03e||_0x12ef11;if(_0x3a9187){return handleError(_0x983123,0x191,_0x3a9187);}if(!_0x3bd136){return handleError(_0x983123,0x194,{'message':_0x0826('0x2a')});}else{var _0x596078={'payload':{'id':_0x3bd136['id'],'role':_0x3bd136[_0x0826('0x1a')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x596078)[_0x0826('0x20')](function(_0x3173b6){_0x983123['json']({'id':_0x3bd136['id'],'token':_0x3173b6,'statusCall':'','isAlreadyLogged':_0x3bd136[_0x0826('0x1d')]});});}})(_0x19b5b4,_0x983123,_0x30f397);};passport[_0x0826('0x2b')](_0x0826('0x29'),new LocalStrategy({'usernameField':'name','passwordField':_0x0826('0x18')},function(_0x535ca1,_0x2476b8,_0x2fdb98){return ActiveDirectoryAuthenticate(db[_0x0826('0x2c')],_0x535ca1,_0x2476b8,_0x2fdb98);})); \ No newline at end of file +var _0x322d=['minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','role','signToken','json','password','User','passport','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','disabled','blocked','online','user','agent','blockDuration','blockedAt'];(function(_0x3880e8,_0x64f633){var _0x5e7d96=function(_0x29bdd2){while(--_0x29bdd2){_0x3880e8['push'](_0x3880e8['shift']());}};_0x5e7d96(++_0x64f633);}(_0x322d,0x121));var _0xd322=function(_0x53f964,_0x3b52b8){_0x53f964=_0x53f964-0x0;var _0x17be6c=_0x322d[_0x53f964];return _0x17be6c;};'use strict';var passport=require(_0xd322('0x0'));var LocalStrategy=require('passport-local')[_0xd322('0x1')];var moment=require('moment');var ActiveDirectory=require(_0xd322('0x2'));var BPromise=require(_0xd322('0x3'));var util=require(_0xd322('0x4'));var db=require(_0xd322('0x5'))['db'];var authService=require(_0xd322('0x6'));var utils=require(_0xd322('0x7'));var config=require(_0xd322('0x8'));var logger=require(_0xd322('0x9'))('api');function isActiveDirectoryConfigured(_0x11c722){var _0x5343c5=![];if(typeof _0x11c722[_0xd322('0xa')]!==_0xd322('0xb')){_0x5343c5=_0x11c722[_0xd322('0xa')][_0xd322('0xc')]&&_0x11c722[_0xd322('0xa')]['url']&&_0x11c722['activedirectory'][_0xd322('0xd')];}return _0x5343c5;}function adAuthenticate(_0x2471b6,_0x4ad8cf,_0x4dec09){return new BPromise(function(_0x297f60,_0x5d62ac){try{var _0x254a45=new ActiveDirectory(_0x2471b6);_0x254a45[_0xd322('0xe')](_0x4ad8cf,_0x4dec09,function(_0x3b59cb,_0x49ea4f){if(_0x3b59cb){logger['error'](_0xd322('0xf'),_0x4ad8cf,util[_0xd322('0x10')](_0x3b59cb,{'showHidden':![],'depth':null}));_0x5d62ac('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x49ea4f){logger[_0xd322('0x11')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x4ad8cf);_0x5d62ac(_0xd322('0x12'));}else{_0x297f60(_0x49ea4f);}});}catch(_0x111066){_0x5d62ac(_0x111066);}});}function ActiveDirectoryAuthenticate(_0x4da0c8,_0x164d82,_0x318331,_0x429309){var _0x125976,_0x2c2887;if(!isActiveDirectoryConfigured(config)){logger[_0xd322('0x11')](_0xd322('0x13'),_0x164d82);return _0x429309(null,![],{'message':_0xd322('0x12')});}return db['Setting'][_0xd322('0x14')]({'where':{'id':0x1},'attributes':[_0xd322('0x15'),'blockDuration'],'raw':!![]})[_0xd322('0x16')](function(_0x27a3e4){_0x125976=_0x27a3e4;if(!_0x125976[_0xd322('0x15')]){logger[_0xd322('0x11')](_0xd322('0x17'),_0x164d82);throw new Error(_0xd322('0x12'));}return _0x4da0c8[_0xd322('0x14')]({'logging':!![],'attributes':['id',_0xd322('0x18'),'password',_0xd322('0x19'),'role',_0xd322('0x1a'),_0xd322('0x1b'),'blockedAt',_0xd322('0x1c')],'where':{'name':_0x164d82,'role':{'$or':['admin',_0xd322('0x1d'),_0xd322('0x1e')]},'adSsoEnabled':!![]}});})[_0xd322('0x16')](function(_0x3fb2a0){if(!_0x3fb2a0||_0x3fb2a0&&_0x3fb2a0[_0xd322('0x18')]!==_0x164d82){throw new Error(_0xd322('0x12'));}_0x2c2887=_0x3fb2a0;var _0x50d35d=_0x2c2887[_0xd322('0x18')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0xd322('0xa')],_0x50d35d,_0x318331);})['then'](function(_0x5f0ca1){if(_0x2c2887[_0xd322('0x1a')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x125976[_0xd322('0x1f')]>0x0){if(_0x2c2887[_0xd322('0x1b')]){if(moment(_0x2c2887[_0xd322('0x20')])['add'](_0x125976[_0xd322('0x1f')],_0xd322('0x21'))>moment()){throw new Error(_0xd322('0x12'));}return utils[_0xd322('0x22')](_0x2c2887,0x0,![],null)[_0xd322('0x16')](function(){return utils[_0xd322('0x23')](_0x2c2887);})[_0xd322('0x16')](function(){return _0x429309(null,_0x2c2887);});}else{return utils[_0xd322('0x23')](_0x2c2887)['then'](function(){return _0x429309(null,_0x2c2887);});}}else{return utils['getLicense'](_0x2c2887)[_0xd322('0x16')](function(){return _0x429309(null,_0x2c2887);});}})[_0xd322('0x24')](function(_0x4d01b9){return _0x429309(null,![],_0x4d01b9);});}function handleError(_0x4b9d19,_0x2b636b,_0x58acfe){return _0x4b9d19[_0xd322('0x25')](_0x2b636b||0x1f4)['send']({'message':_0x58acfe?_0x58acfe[_0xd322('0x26')]||_0x58acfe:''});}exports[_0xd322('0x27')]=function(_0x1443aa,_0x3aff96,_0x152dbc){passport[_0xd322('0xe')](_0xd322('0x28'),function(_0x3f3d91,_0x160cb1,_0x1d8535){var _0x403f0c=_0x3f3d91||_0x1d8535;if(_0x403f0c){return handleError(_0x3aff96,0x191,_0x403f0c);}if(!_0x160cb1){return handleError(_0x3aff96,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4d7025={'payload':{'id':_0x160cb1['id'],'role':_0x160cb1[_0xd322('0x29')]},'options':{'expiresIn':0x15180}};return authService[_0xd322('0x2a')](_0x4d7025)['then'](function(_0x11ebba){_0x3aff96[_0xd322('0x2b')]({'id':_0x160cb1['id'],'token':_0x11ebba,'statusCall':'','isAlreadyLogged':_0x160cb1[_0xd322('0x1c')]});});}})(_0x1443aa,_0x3aff96,_0x152dbc);};passport['use'](_0xd322('0x28'),new LocalStrategy({'usernameField':'name','passwordField':_0xd322('0x2c')},function(_0x2f9126,_0x33e191,_0x130ff5){return ActiveDirectoryAuthenticate(db[_0xd322('0x2d')],_0x2f9126,_0x33e191,_0x130ff5);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index e5888d3..00312fd 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf40c=['express','Router','login','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf40c,0x140));var _0xcf40=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0xf40c[_0xd7b0a4];return _0x184e9e;};'use strict';var express=require(_0xcf40('0x0'));var router=express[_0xcf40('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0xcf40('0x2')]);module[_0xcf40('0x3')]=router; \ No newline at end of file +var _0xe076=['exports','Router','./authActiveDirectory.controller','login'];(function(_0x1df5ea,_0x2a3966){var _0x3385d4=function(_0x8e8c6f){while(--_0x8e8c6f){_0x1df5ea['push'](_0x1df5ea['shift']());}};_0x3385d4(++_0x2a3966);}(_0xe076,0x1c9));var _0x6e07=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xe076[_0xea8947];return _0x2455e9;};'use strict';var express=require('express');var router=express[_0x6e07('0x0')]();var controller=require(_0x6e07('0x1'));router['post']('/',controller[_0x6e07('0x2')]);module[_0x6e07('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 0a99410..5df581a 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x32b066,_0x8c6b13){var _0x34c871=function(_0x89a77d){while(--_0x89a77d){_0x32b066['push'](_0x32b066['shift']());}};_0x34c871(++_0x8c6b13);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x7a54,0x106));var _0x47a5=function(_0x111514,_0xa30043){_0x111514=_0x111514-0x0;var _0x367806=_0x7a54[_0x111514];return _0x367806;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 0265697..f40c807 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 _0x619a=['isMiddleware','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x443f79,_0x33e446){var _0x3847e4=function(_0x42fa01){while(--_0x42fa01){_0x443f79['push'](_0x443f79['shift']());}};_0x3847e4(++_0x33e446);}(_0x619a,0xb0));var _0xa619=function(_0x2fb0c1,_0x4487f9){_0x2fb0c1=_0x2fb0c1-0x0;var _0x11ff83=_0x619a[_0x2fb0c1];return _0x11ff83;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xa619('0x0'));var authService=require(_0xa619('0x1'));router[_0xa619('0x2')]('/',controller[_0xa619('0x3')]);router[_0xa619('0x2')]('/callback',controller['callback'],authService[_0xa619('0x4')],userController[_0xa619('0x3')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file +var _0xb8ba=['passport','Router','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','express'];(function(_0x3fa2db,_0x38c254){var _0x3c4970=function(_0x4737f9){while(--_0x4737f9){_0x3fa2db['push'](_0x3fa2db['shift']());}};_0x3c4970(++_0x38c254);}(_0xb8ba,0x6d));var _0xab8b=function(_0x417c81,_0x4b86f4){_0x417c81=_0x417c81-0x0;var _0x41b184=_0xb8ba[_0x417c81];return _0x41b184;};'use strict';var express=require(_0xab8b('0x0'));var passport=require(_0xab8b('0x1'));var router=express[_0xab8b('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xab8b('0x3'));var authService=require(_0xab8b('0x4'));router[_0xab8b('0x5')]('/',controller[_0xab8b('0x6')]);router[_0xab8b('0x5')](_0xab8b('0x7'),controller[_0xab8b('0x8')],authService[_0xab8b('0x9')],userController['login'],authService[_0xab8b('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index a9a7a18..ce7196a 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 _0x4328=['port','secure','authentication','auth','user','pass','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','local-login','signToken','json','online','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','then','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host'];(function(_0x482cb9,_0x448f4d){var _0x2c5647=function(_0x147bf2){while(--_0x147bf2){_0x482cb9['push'](_0x482cb9['shift']());}};_0x2c5647(++_0x448f4d);}(_0x4328,0x196));var _0x8432=function(_0x1c0e74,_0x534da3){_0x1c0e74=_0x1c0e74-0x0;var _0x5f0abe=_0x4328[_0x1c0e74];return _0x5f0abe;};'use strict';var util=require(_0x8432('0x0'));var passport=require(_0x8432('0x1'));var LocalStrategy=require(_0x8432('0x2'))[_0x8432('0x3')];var jayson=require('jayson/promise');var _=require(_0x8432('0x4'));var rs=require(_0x8432('0x5'));var moment=require(_0x8432('0x6'));var db=require(_0x8432('0x7'))['db'];var authService=require(_0x8432('0x8'));var utils=require(_0x8432('0x9'));var client=jayson[_0x8432('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x3f21f2,_0x713ad2,_0x42baf7,_0x397fec){var _0x2d0f7d,_0xece971;return db[_0x8432('0xb')][_0x8432('0xc')]({'where':{'id':0x1},'attributes':[_0x8432('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x216588){_0x2d0f7d=_0x216588;return _0x3f21f2[_0x8432('0xc')]({'attributes':['id',_0x8432('0xe'),_0x8432('0xf'),'salt',_0x8432('0x10'),_0x8432('0x11'),_0x8432('0x12'),_0x8432('0x13'),_0x8432('0x14')],'where':{'name':_0x713ad2,'role':{'$or':[_0x8432('0x15'),'user',_0x8432('0x16')]}}});})[_0x8432('0x17')](function(_0x34ff5d){if(!_0x34ff5d||_0x34ff5d&&_0x34ff5d[_0x8432('0xe')]!==_0x713ad2){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xece971=_0x34ff5d;return _0xece971;}})[_0x8432('0x17')](function(){_0xece971[_0x8432('0x18')](_0x42baf7,function(_0x1fe0ca,_0x12a7a1){var _0x1ab579=_0xece971[_0x8432('0x14')]+0x1;if(_0x1fe0ca){return _0x397fec(_0x1fe0ca);}else if(!_0x12a7a1){if(_0xece971[_0x8432('0x11')]){return _0x397fec(null,![],{'message':_0x8432('0x19')});}else if(_0x2d0f7d[_0x8432('0xd')]>0x0){if(_0xece971[_0x8432('0x12')]){if(_0x2d0f7d[_0x8432('0x1a')]>0x0){if(moment(_0xece971[_0x8432('0x13')])[_0x8432('0x1b')](_0x2d0f7d[_0x8432('0x1a')],'minutes')>moment()){return _0x397fec(null,![],{'message':_0x8432('0x19')});}else{return utils[_0x8432('0x1c')](_0xece971,_0x1ab579,![],null)['then'](function(){return _0x397fec(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x397fec(null,![],{'message':_0x8432('0x19')});}}else{if(_0x1ab579>=_0x2d0f7d['allowedLoginAttempts']){return utils[_0x8432('0x1c')](_0xece971,0x0,!![],moment())[_0x8432('0x17')](function(){return _0x397fec(null,![],{'message':_0x8432('0x19')});});}else{return utils['clearBlockUser'](_0xece971,_0x1ab579,![],null)['then'](function(){return _0x397fec(null,![],{'message':_0x8432('0x19')});});}}}else{return _0x397fec(null,![],{'message':_0x8432('0x19')});}}else{if(_0xece971[_0x8432('0x11')]){return _0x397fec(null,![],{'message':_0x8432('0x19')});}else if(_0x2d0f7d[_0x8432('0xd')]>0x0){if(_0xece971[_0x8432('0x12')]){if(_0x2d0f7d[_0x8432('0x1a')]>0x0){if(moment(_0xece971[_0x8432('0x13')])[_0x8432('0x1b')](_0x2d0f7d[_0x8432('0x1a')],_0x8432('0x1d'))>moment()){return _0x397fec(null,![],{'message':_0x8432('0x19')});}else{return utils['clearBlockUser'](_0xece971,0x0,![],null)[_0x8432('0x17')](function(){return utils['getLicense'](_0xece971);})['then'](function(){return _0x397fec(null,_0xece971);});}}else{return _0x397fec(null,![],{'message':_0x8432('0x19')});}}else{return utils[_0x8432('0x1c')](_0xece971,0x0,![],null)[_0x8432('0x17')](function(){return utils[_0x8432('0x1e')](_0xece971);})[_0x8432('0x17')](function(){return _0x397fec(null,_0xece971);})[_0x8432('0x1f')](function(_0x443e92){return _0x397fec(null,![],_0x443e92);});}}else{if(_0xece971[_0x8432('0x12')]){return _0x397fec(null,![],{'message':_0x8432('0x19')});}else{return utils[_0x8432('0x1e')](_0xece971)['then'](function(){return _0x397fec(null,_0xece971);});}}}});})[_0x8432('0x1f')](function(_0xc1fb30){return _0x397fec(null,![],_0xc1fb30);});}function sendServiceMail(_0x5bb9f4){return db[_0x8432('0x20')][_0x8432('0x21')]({'where':{'service':!![]},'attributes':['id',_0x8432('0xe'),'email'],'include':[{'model':db[_0x8432('0x22')],'as':'Smtp'}]})['then'](function(_0x3fac49){if(!_0x3fac49){throw new Error(_0x8432('0x23'));}var _0x4b4b29={'tls':{'rejectUnauthorized':![]}};if(_0x3fac49[_0x8432('0x24')][_0x8432('0x25')]){_0x4b4b29[_0x8432('0x25')]=_0x3fac49['Smtp']['service'];}else{_0x4b4b29[_0x8432('0x26')]=_0x3fac49[_0x8432('0x24')][_0x8432('0x26')];_0x4b4b29[_0x8432('0x27')]=_0x3fac49[_0x8432('0x24')][_0x8432('0x27')];_0x4b4b29[_0x8432('0x28')]=_0x3fac49['Smtp'][_0x8432('0x28')];}if(_0x3fac49[_0x8432('0x24')][_0x8432('0x29')]){_0x4b4b29[_0x8432('0x2a')]={'user':_0x3fac49[_0x8432('0x24')][_0x8432('0x2b')],'pass':_0x3fac49[_0x8432('0x24')][_0x8432('0x2c')]};}var _0x550044={'account':_0x4b4b29,'message':_[_0x8432('0x2d')]({'from':util[_0x8432('0x2e')](_0x8432('0x2f'),_0x3fac49[_0x8432('0xe')],_0x3fac49[_0x8432('0x30')]||_0x3fac49[_0x8432('0x24')]['user'])},_0x5bb9f4)};return client[_0x8432('0x31')](_0x8432('0x32'),_0x550044);})[_0x8432('0x17')](function(_0x146020){if(_0x146020[_0x8432('0x33')]){throw new Error(util[_0x8432('0x2e')](_0x8432('0x34'),_0x146020[_0x8432('0x33')][_0x8432('0x35')]||JSON[_0x8432('0x36')](_0x146020['error'])));}return!![];});}function handleError(_0x11fdcc,_0x3355f1,_0x4b4f42){return _0x11fdcc['status'](_0x3355f1||0x1f4)[_0x8432('0x37')]({'message':_0x4b4f42?_0x4b4f42[_0x8432('0x35')]||_0x4b4f42:''});}exports[_0x8432('0x38')]=function(_0x53e3ce,_0x1e13e4,_0x265175){passport[_0x8432('0x18')](_0x8432('0x39'),function(_0x2ae18d,_0xfad0c1,_0x4dd07b){var _0x2d98a4=_0x2ae18d||_0x4dd07b;if(_0x2d98a4){return handleError(_0x1e13e4,0x191,_0x2d98a4);}if(!_0xfad0c1){return handleError(_0x1e13e4,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x30712a={'payload':{'id':_0xfad0c1['id'],'role':_0xfad0c1[_0x8432('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x8432('0x3a')](_0x30712a)[_0x8432('0x17')](function(_0x1bb6ec){_0x1e13e4[_0x8432('0x3b')]({'id':_0xfad0c1['id'],'token':_0x1bb6ec,'statusCall':'','isAlreadyLogged':_0xfad0c1[_0x8432('0x3c')]});});}})(_0x53e3ce,_0x1e13e4,_0x265175);};exports['forgot']=function(_0x2a12d6,_0x39b25e,_0x166b10){if(!_0x2a12d6['body']['email']){return handleError(_0x39b25e,0x1f4,{'message':_0x8432('0x3d')});}var _0x43659f=rs['generate']();_0x2a12d6[_0x8432('0x3e')]['email']=_0x2a12d6[_0x8432('0x3e')][_0x8432('0x30')][_0x8432('0x3f')]()[_0x8432('0x40')]();var _0xcc1029;return db[_0x8432('0xb')][_0x8432('0xc')]({'where':{'id':0x1},'attributes':[_0x8432('0xd'),_0x8432('0x1a')],'raw':!![]})[_0x8432('0x17')](function(_0x423226){_0xcc1029=_0x423226;return db[_0x8432('0x41')][_0x8432('0x21')]({'where':{'email':_0x2a12d6[_0x8432('0x3e')][_0x8432('0x30')]}});})['then'](function(_0x1b2b5d){if(!_0x1b2b5d){throw new Error(_0x8432('0x42'));}if(_0x1b2b5d['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x1b2b5d['blocked']){if(moment(_0x1b2b5d[_0x8432('0x13')])['add'](_0xcc1029[_0x8432('0x1a')],_0x8432('0x1d'))>moment()){throw new Error(_0x8432('0x43'));}else{_0x1b2b5d[_0x8432('0x12')]=![];_0x1b2b5d['blockedAt']=null;}}_0x1b2b5d[_0x8432('0x44')]=_0x43659f;_0x1b2b5d[_0x8432('0x45')]=Date[_0x8432('0x46')]()+0x36ee80;return _0x1b2b5d[_0x8432('0x47')]();})[_0x8432('0x17')](function(){return sendServiceMail({'to':_0x2a12d6[_0x8432('0x3e')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x8432('0x48')+_0x8432('0x49')+_0x2a12d6[_0x8432('0x4a')][_0x8432('0x26')]+_0x8432('0x4b')+_0x43659f+'\x0a\x0a'+_0x8432('0x4c')});})[_0x8432('0x17')](function(){_0x39b25e[_0x8432('0x4d')](0xc8)['send']({'message':_0x8432('0x4e')});})[_0x8432('0x1f')](function(_0x172671){return handleError(_0x39b25e,0x1f4,_0x172671);});};exports['reset']=function(_0x38fae2,_0x4d839c,_0x4d78f7){return db[_0x8432('0x41')]['find']({'where':{'resetPasswordToken':_0x38fae2['params'][_0x8432('0x4f')],'resetPasswordExpires':{'$gt':Date[_0x8432('0x46')]()}}})[_0x8432('0x17')](function(_0x1ed6db){if(!_0x1ed6db){throw new Error(_0x8432('0x50'));}return db[_0x8432('0xb')]['findOne']({'attributes':['id',_0x8432('0x51'),_0x8432('0x52'),'passwordHistoryLimit']})[_0x8432('0x17')](function(_0x555361){if(_0x555361[_0x8432('0x51')])authService[_0x8432('0x53')](_0x38fae2[_0x8432('0x3e')][_0x8432('0xf')]);if(!_0x555361[_0x8432('0x52')]||!_0x1ed6db[_0x8432('0x54')])return _0x1ed6db;authService[_0x8432('0x55')](_0x38fae2[_0x8432('0x3e')][_0x8432('0xf')],_0x1ed6db['previousPasswords'],_0x555361[_0x8432('0x56')]);return _0x1ed6db;})[_0x8432('0x17')](function(){_0x1ed6db['password']=_0x38fae2[_0x8432('0x3e')]['password'];_0x1ed6db[_0x8432('0x44')]=null;_0x1ed6db['resetPasswordExpires']=null;return _0x1ed6db[_0x8432('0x47')]();});})[_0x8432('0x17')](function(){_0x4d839c[_0x8432('0x4d')](0xc8)[_0x8432('0x37')]({'message':_0x8432('0x57')});})[_0x8432('0x1f')](function(_0x288f57){return handleError(_0x4d839c,0x1f4,_0x288f57);});};passport[_0x8432('0x58')](_0x8432('0x39'),new LocalStrategy({'usernameField':_0x8432('0xe'),'passwordField':_0x8432('0xf')},function(_0x300a7c,_0x546be7,_0x5031d3){return localAuthenticate(db['User'],_0x300a7c,_0x546be7,_0x5031d3);})); \ No newline at end of file +var _0xfe62=['disabled','blocked','blockedAt','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','clearBlockUser','allowedLoginAttempts','minutes','getLicense','catch','MailAccount','find','email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','port','secure','authentication','auth','pass','merge','format','request','error','message','stringify','status','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../config/utils','client','http','Setting','findOne','blockDuration','then','name','password','role'];(function(_0x4dfcd4,_0x20c39c){var _0x4cc2a0=function(_0x4ea11b){while(--_0x4ea11b){_0x4dfcd4['push'](_0x4dfcd4['shift']());}};_0x4cc2a0(++_0x20c39c);}(_0xfe62,0x197));var _0x2fe6=function(_0x88f03f,_0x41dad0){_0x88f03f=_0x88f03f-0x0;var _0x3e2d02=_0xfe62[_0x88f03f];return _0x3e2d02;};'use strict';var util=require(_0x2fe6('0x0'));var passport=require(_0x2fe6('0x1'));var LocalStrategy=require(_0x2fe6('0x2'))[_0x2fe6('0x3')];var jayson=require(_0x2fe6('0x4'));var _=require(_0x2fe6('0x5'));var rs=require(_0x2fe6('0x6'));var moment=require(_0x2fe6('0x7'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x2fe6('0x8'));var client=jayson[_0x2fe6('0x9')][_0x2fe6('0xa')]({'port':0x232b});function localAuthenticate(_0x2fc5c5,_0x44355a,_0xa611d8,_0x5d3175){var _0x51628e,_0x31038b;return db[_0x2fe6('0xb')][_0x2fe6('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x2fe6('0xd')],'raw':!![]})[_0x2fe6('0xe')](function(_0x5661d2){_0x51628e=_0x5661d2;return _0x2fc5c5[_0x2fe6('0xc')]({'attributes':['id',_0x2fe6('0xf'),_0x2fe6('0x10'),'salt',_0x2fe6('0x11'),_0x2fe6('0x12'),_0x2fe6('0x13'),_0x2fe6('0x14'),'loginAttempts'],'where':{'name':_0x44355a,'role':{'$or':['admin',_0x2fe6('0x15'),_0x2fe6('0x16')]}}});})[_0x2fe6('0xe')](function(_0x4c54ac){if(!_0x4c54ac||_0x4c54ac&&_0x4c54ac['name']!==_0x44355a){throw new Error(_0x2fe6('0x17'));}else{_0x31038b=_0x4c54ac;return _0x31038b;}})[_0x2fe6('0xe')](function(){_0x31038b[_0x2fe6('0x18')](_0xa611d8,function(_0x555b41,_0x42e89d){var _0x1f2436=_0x31038b[_0x2fe6('0x19')]+0x1;if(_0x555b41){return _0x5d3175(_0x555b41);}else if(!_0x42e89d){if(_0x31038b[_0x2fe6('0x12')]){return _0x5d3175(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x51628e['allowedLoginAttempts']>0x0){if(_0x31038b['blocked']){if(_0x51628e['blockDuration']>0x0){if(moment(_0x31038b[_0x2fe6('0x14')])[_0x2fe6('0x1a')](_0x51628e[_0x2fe6('0xd')],'minutes')>moment()){return _0x5d3175(null,![],{'message':_0x2fe6('0x17')});}else{return utils[_0x2fe6('0x1b')](_0x31038b,_0x1f2436,![],null)[_0x2fe6('0xe')](function(){return _0x5d3175(null,![],{'message':_0x2fe6('0x17')});});}}else{return _0x5d3175(null,![],{'message':_0x2fe6('0x17')});}}else{if(_0x1f2436>=_0x51628e[_0x2fe6('0x1c')]){return utils['clearBlockUser'](_0x31038b,0x0,!![],moment())[_0x2fe6('0xe')](function(){return _0x5d3175(null,![],{'message':_0x2fe6('0x17')});});}else{return utils[_0x2fe6('0x1b')](_0x31038b,_0x1f2436,![],null)[_0x2fe6('0xe')](function(){return _0x5d3175(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x5d3175(null,![],{'message':_0x2fe6('0x17')});}}else{if(_0x31038b['disabled']){return _0x5d3175(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x51628e['allowedLoginAttempts']>0x0){if(_0x31038b[_0x2fe6('0x13')]){if(_0x51628e[_0x2fe6('0xd')]>0x0){if(moment(_0x31038b['blockedAt'])['add'](_0x51628e['blockDuration'],_0x2fe6('0x1d'))>moment()){return _0x5d3175(null,![],{'message':_0x2fe6('0x17')});}else{return utils[_0x2fe6('0x1b')](_0x31038b,0x0,![],null)[_0x2fe6('0xe')](function(){return utils[_0x2fe6('0x1e')](_0x31038b);})[_0x2fe6('0xe')](function(){return _0x5d3175(null,_0x31038b);});}}else{return _0x5d3175(null,![],{'message':_0x2fe6('0x17')});}}else{return utils['clearBlockUser'](_0x31038b,0x0,![],null)[_0x2fe6('0xe')](function(){return utils[_0x2fe6('0x1e')](_0x31038b);})['then'](function(){return _0x5d3175(null,_0x31038b);})[_0x2fe6('0x1f')](function(_0x2f74ed){return _0x5d3175(null,![],_0x2f74ed);});}}else{if(_0x31038b[_0x2fe6('0x13')]){return _0x5d3175(null,![],{'message':_0x2fe6('0x17')});}else{return utils[_0x2fe6('0x1e')](_0x31038b)[_0x2fe6('0xe')](function(){return _0x5d3175(null,_0x31038b);});}}}});})['catch'](function(_0x496a9d){return _0x5d3175(null,![],_0x496a9d);});}function sendServiceMail(_0x4b1f1f){return db[_0x2fe6('0x20')][_0x2fe6('0x21')]({'where':{'service':!![]},'attributes':['id',_0x2fe6('0xf'),_0x2fe6('0x22')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x2fe6('0xe')](function(_0x3c11c6){if(!_0x3c11c6){throw new Error(_0x2fe6('0x23'));}var _0x38c823={'tls':{'rejectUnauthorized':![]}};if(_0x3c11c6[_0x2fe6('0x24')][_0x2fe6('0x25')]){_0x38c823[_0x2fe6('0x25')]=_0x3c11c6[_0x2fe6('0x24')][_0x2fe6('0x25')];}else{_0x38c823['host']=_0x3c11c6['Smtp']['host'];_0x38c823[_0x2fe6('0x26')]=_0x3c11c6['Smtp']['port'];_0x38c823['secure']=_0x3c11c6[_0x2fe6('0x24')][_0x2fe6('0x27')];}if(_0x3c11c6[_0x2fe6('0x24')][_0x2fe6('0x28')]){_0x38c823[_0x2fe6('0x29')]={'user':_0x3c11c6[_0x2fe6('0x24')]['user'],'pass':_0x3c11c6[_0x2fe6('0x24')][_0x2fe6('0x2a')]};}var _0x4d1c09={'account':_0x38c823,'message':_[_0x2fe6('0x2b')]({'from':util[_0x2fe6('0x2c')]('\x22%s\x22\x20<%s>',_0x3c11c6[_0x2fe6('0xf')],_0x3c11c6[_0x2fe6('0x22')]||_0x3c11c6[_0x2fe6('0x24')]['user'])},_0x4b1f1f)};return client[_0x2fe6('0x2d')]('SendMail',_0x4d1c09);})[_0x2fe6('0xe')](function(_0x333312){if(_0x333312[_0x2fe6('0x2e')]){throw new Error(util[_0x2fe6('0x2c')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x333312[_0x2fe6('0x2e')][_0x2fe6('0x2f')]||JSON[_0x2fe6('0x30')](_0x333312[_0x2fe6('0x2e')])));}return!![];});}function handleError(_0x35d5da,_0x5ed4e0,_0x2aff68){return _0x35d5da[_0x2fe6('0x31')](_0x5ed4e0||0x1f4)['send']({'message':_0x2aff68?_0x2aff68[_0x2fe6('0x2f')]||_0x2aff68:''});}exports['login']=function(_0x39f8d2,_0x2e165b,_0x333353){passport[_0x2fe6('0x18')](_0x2fe6('0x32'),function(_0x2c632f,_0x2b312b,_0x4201ae){var _0x586bbc=_0x2c632f||_0x4201ae;if(_0x586bbc){return handleError(_0x2e165b,0x191,_0x586bbc);}if(!_0x2b312b){return handleError(_0x2e165b,0x194,{'message':_0x2fe6('0x33')});}else{var _0x12bb10={'payload':{'id':_0x2b312b['id'],'role':_0x2b312b[_0x2fe6('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x2fe6('0x34')](_0x12bb10)[_0x2fe6('0xe')](function(_0x4c4a54){_0x2e165b[_0x2fe6('0x35')]({'id':_0x2b312b['id'],'token':_0x4c4a54,'statusCall':'','isAlreadyLogged':_0x2b312b[_0x2fe6('0x36')]});});}})(_0x39f8d2,_0x2e165b,_0x333353);};exports[_0x2fe6('0x37')]=function(_0xb12a44,_0x4ef036,_0x4a5a58){if(!_0xb12a44[_0x2fe6('0x38')][_0x2fe6('0x22')]){return handleError(_0x4ef036,0x1f4,{'message':_0x2fe6('0x39')});}var _0x385612=rs['generate']();_0xb12a44[_0x2fe6('0x38')][_0x2fe6('0x22')]=_0xb12a44[_0x2fe6('0x38')][_0x2fe6('0x22')]['trim']()[_0x2fe6('0x3a')]();var _0xfc195b;return db[_0x2fe6('0xb')][_0x2fe6('0xc')]({'where':{'id':0x1},'attributes':[_0x2fe6('0x1c'),_0x2fe6('0xd')],'raw':!![]})[_0x2fe6('0xe')](function(_0x5cab5d){_0xfc195b=_0x5cab5d;return db[_0x2fe6('0x3b')][_0x2fe6('0x21')]({'where':{'email':_0xb12a44[_0x2fe6('0x38')]['email']}});})['then'](function(_0x46d546){if(!_0x46d546){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x46d546[_0x2fe6('0x12')]){throw new Error(_0x2fe6('0x3c'));}if(_0x46d546[_0x2fe6('0x13')]){if(moment(_0x46d546[_0x2fe6('0x14')])[_0x2fe6('0x1a')](_0xfc195b['blockDuration'],_0x2fe6('0x1d'))>moment()){throw new Error(_0x2fe6('0x3d'));}else{_0x46d546['blocked']=![];_0x46d546[_0x2fe6('0x14')]=null;}}_0x46d546['resetPasswordToken']=_0x385612;_0x46d546[_0x2fe6('0x3e')]=Date[_0x2fe6('0x3f')]()+0x36ee80;return _0x46d546[_0x2fe6('0x40')]();})[_0x2fe6('0xe')](function(){return sendServiceMail({'to':_0xb12a44[_0x2fe6('0x38')]['email'],'subject':_0x2fe6('0x41'),'text':_0x2fe6('0x42')+_0x2fe6('0x43')+_0x2fe6('0x44')+_0xb12a44[_0x2fe6('0x45')][_0x2fe6('0x46')]+_0x2fe6('0x47')+_0x385612+'\x0a\x0a'+_0x2fe6('0x48')});})['then'](function(){_0x4ef036[_0x2fe6('0x31')](0xc8)[_0x2fe6('0x49')]({'message':_0x2fe6('0x4a')});})['catch'](function(_0x5dd4e4){return handleError(_0x4ef036,0x1f4,_0x5dd4e4);});};exports[_0x2fe6('0x4b')]=function(_0x502afc,_0x306f51,_0x152cec){return db['User'][_0x2fe6('0x21')]({'where':{'resetPasswordToken':_0x502afc[_0x2fe6('0x4c')][_0x2fe6('0x4d')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x4b6300){if(!_0x4b6300){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x2fe6('0xb')][_0x2fe6('0xc')]({'attributes':['id',_0x2fe6('0x4e'),_0x2fe6('0x4f'),_0x2fe6('0x50')]})[_0x2fe6('0xe')](function(_0x523575){if(_0x523575[_0x2fe6('0x4e')])authService[_0x2fe6('0x51')](_0x502afc[_0x2fe6('0x38')][_0x2fe6('0x10')]);if(!_0x523575[_0x2fe6('0x4f')]||!_0x4b6300['previousPasswords'])return _0x4b6300;authService[_0x2fe6('0x52')](_0x502afc['body']['password'],_0x4b6300[_0x2fe6('0x53')],_0x523575[_0x2fe6('0x50')]);return _0x4b6300;})[_0x2fe6('0xe')](function(){_0x4b6300[_0x2fe6('0x10')]=_0x502afc[_0x2fe6('0x38')][_0x2fe6('0x10')];_0x4b6300['resetPasswordToken']=null;_0x4b6300[_0x2fe6('0x3e')]=null;return _0x4b6300[_0x2fe6('0x40')]();});})[_0x2fe6('0xe')](function(){_0x306f51[_0x2fe6('0x31')](0xc8)['send']({'message':_0x2fe6('0x54')});})[_0x2fe6('0x1f')](function(_0x1c7672){return handleError(_0x306f51,0x1f4,_0x1c7672);});};passport['use'](_0x2fe6('0x32'),new LocalStrategy({'usernameField':_0x2fe6('0xf'),'passwordField':_0x2fe6('0x10')},function(_0x31f965,_0x8b999a,_0x519c70){return localAuthenticate(db[_0x2fe6('0x3b')],_0x31f965,_0x8b999a,_0x519c70);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 026a0b5..149c4ba 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 _0xd9f0=['post','/forgot','forgot','/reset/:token','reset','exports','express','Router'];(function(_0xb0f253,_0x476cc1){var _0x25dbbe=function(_0x52a034){while(--_0x52a034){_0xb0f253['push'](_0xb0f253['shift']());}};_0x25dbbe(++_0x476cc1);}(_0xd9f0,0x1e6));var _0x0d9f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd9f0[_0x4b369d];return _0x571a98;};'use strict';var express=require(_0x0d9f('0x0'));var router=express[_0x0d9f('0x1')]();var controller=require('./authLocal.controller');router[_0x0d9f('0x2')]('/',controller['login']);router['post'](_0x0d9f('0x3'),controller[_0x0d9f('0x4')]);router['post'](_0x0d9f('0x5'),controller[_0x0d9f('0x6')]);module[_0x0d9f('0x7')]=router; \ No newline at end of file +var _0x1d30=['/reset/:token','express','Router','./authLocal.controller','login','post','/forgot'];(function(_0x190dde,_0x5bb90f){var _0x2a3638=function(_0x242516){while(--_0x242516){_0x190dde['push'](_0x190dde['shift']());}};_0x2a3638(++_0x5bb90f);}(_0x1d30,0x120));var _0x01d3=function(_0x38bd5f,_0x4c05bd){_0x38bd5f=_0x38bd5f-0x0;var _0x4ed18d=_0x1d30[_0x38bd5f];return _0x4ed18d;};'use strict';var express=require(_0x01d3('0x0'));var router=express[_0x01d3('0x1')]();var controller=require(_0x01d3('0x2'));router['post']('/',controller[_0x01d3('0x3')]);router[_0x01d3('0x4')](_0x01d3('0x5'),controller['forgot']);router['post'](_0x01d3('0x6'),controller['reset']);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index b5c44d0..c97ee18 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 _0x9d3b=['exports','STRING','BOOLEAN','sequelize'];(function(_0x28f4e2,_0x3f9280){var _0x3061fb=function(_0x4a2c57){while(--_0x4a2c57){_0x28f4e2['push'](_0x28f4e2['shift']());}};_0x3061fb(++_0x3f9280);}(_0x9d3b,0x163));var _0xb9d3=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x9d3b[_0x754ab4];return _0x34079a;};'use strict';var Sequelize=require(_0xb9d3('0x0'));module[_0xb9d3('0x1')]={'name':{'type':Sequelize[_0xb9d3('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb9d3('0x2')]},'status':{'type':Sequelize[_0xb9d3('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0xc54c=['STRING','INTEGER','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc54c,0xf8));var _0xcc54=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0xc54c[_0x44216d];return _0xeca523;};'use strict';var Sequelize=require('sequelize');module[_0xcc54('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcc54('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xcc54('0x2')],'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 ba4279c..19d30eb 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 _0x33f2=['merge','options','includeAll','Automation','findAll','show','params','include','catch','create','body','find','Condition','addConditions','ids','getConditions','findOne','pick','nolimit','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter'];(function(_0x12b038,_0x5a0c2a){var _0x4f851c=function(_0x38a6c3){while(--_0x38a6c3){_0x12b038['push'](_0x12b038['shift']());}};_0x4f851c(++_0x5a0c2a);}(_0x33f2,0x162));var _0x233f=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0x33f2[_0x2d126e];return _0xcb04d3;};'use strict';var emlformat=require(_0x233f('0x0'));var rimraf=require(_0x233f('0x1'));var zipdir=require(_0x233f('0x2'));var jsonpatch=require(_0x233f('0x3'));var rp=require(_0x233f('0x4'));var moment=require(_0x233f('0x5'));var BPromise=require(_0x233f('0x6'));var Mustache=require(_0x233f('0x7'));var util=require(_0x233f('0x8'));var path=require(_0x233f('0x9'));var sox=require('sox');var csv=require(_0x233f('0xa'));var ejs=require(_0x233f('0xb'));var fs=require('fs');var fs_extra=require(_0x233f('0xc'));var _=require(_0x233f('0xd'));var squel=require('squel');var crypto=require(_0x233f('0xe'));var jsforce=require(_0x233f('0xf'));var deskjs=require(_0x233f('0x10'));var toCsv=require('to-csv');var querystring=require(_0x233f('0x11'));var Papa=require(_0x233f('0x12'));var Redis=require(_0x233f('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x233f('0x14'));var logger=require('../../config/logger')(_0x233f('0x15'));var utils=require('../../config/utils');var config=require(_0x233f('0x16'));var licenseUtil=require(_0x233f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33b37c,_0x3f359e){_0x3f359e=_0x3f359e||0xcc;return function(_0x1f425f){if(_0x1f425f){return _0x33b37c[_0x233f('0x18')](_0x3f359e);}return _0x33b37c[_0x233f('0x19')](_0x3f359e)[_0x233f('0x1a')]();};}function respondWithResult(_0x5ee50c,_0x1005e4){_0x1005e4=_0x1005e4||0xc8;return function(_0x3022fb){if(_0x3022fb){return _0x5ee50c[_0x233f('0x19')](_0x1005e4)[_0x233f('0x1b')](_0x3022fb);}};}function respondWithFilteredResult(_0x11d60a,_0x1b41ce){return function(_0x25bb3b){if(_0x25bb3b){var _0x63d6d8=typeof _0x1b41ce['offset']===_0x233f('0x1c')&&typeof _0x1b41ce['limit']===_0x233f('0x1c');var _0x24ef36=_0x25bb3b[_0x233f('0x1d')];var _0x4b844d=_0x63d6d8?0x0:_0x1b41ce['offset'];var _0x5ad42d=_0x63d6d8?_0x25bb3b['count']:_0x1b41ce[_0x233f('0x1e')]+_0x1b41ce[_0x233f('0x1f')];var _0x42e3e0;if(_0x5ad42d>=_0x24ef36){_0x5ad42d=_0x24ef36;_0x42e3e0=0xc8;}else{_0x42e3e0=0xce;}_0x11d60a['status'](_0x42e3e0);return _0x11d60a[_0x233f('0x20')]('Content-Range',_0x4b844d+'-'+_0x5ad42d+'/'+_0x24ef36)[_0x233f('0x1b')](_0x25bb3b);}return null;};}function patchUpdates(_0x47ab8a){return function(_0x563a1b){try{jsonpatch[_0x233f('0x21')](_0x563a1b,_0x47ab8a,!![]);}catch(_0x1a9946){return BPromise[_0x233f('0x22')](_0x1a9946);}return _0x563a1b[_0x233f('0x23')]();};}function saveUpdates(_0x55665c,_0x86cbab){return function(_0x527eab){if(_0x527eab){return _0x527eab[_0x233f('0x24')](_0x55665c)[_0x233f('0x25')](function(_0x1f3d0e){return _0x1f3d0e;});}return null;};}function removeEntity(_0x2a6089,_0x3fad70){return function(_0x3cae8c){if(_0x3cae8c){return _0x3cae8c[_0x233f('0x26')]()['then'](function(){_0x2a6089[_0x233f('0x19')](0xcc)[_0x233f('0x1a')]();});}};}function handleEntityNotFound(_0x1de48d,_0x42687c){return function(_0x26beae){if(!_0x26beae){_0x1de48d['sendStatus'](0x194);}return _0x26beae;};}function handleError(_0x4f7cfb,_0x5d3abb){_0x5d3abb=_0x5d3abb||0x1f4;return function(_0x4a5b6b){logger[_0x233f('0x27')](_0x4a5b6b['stack']);if(_0x4a5b6b[_0x233f('0x28')]){delete _0x4a5b6b[_0x233f('0x28')];}_0x4f7cfb['status'](_0x5d3abb)[_0x233f('0x29')](_0x4a5b6b);};}exports[_0x233f('0x2a')]=function(_0x4530d9,_0x15f8fb){var _0x5ca356={},_0xa211c8={},_0x516250={'count':0x0,'rows':[]};var _0x39a5e9=_[_0x233f('0x2b')](db['Automation'][_0x233f('0x2c')],function(_0x2fdfd6){return{'name':_0x2fdfd6[_0x233f('0x2d')],'type':_0x2fdfd6[_0x233f('0x2e')][_0x233f('0x2f')]};});_0xa211c8[_0x233f('0x30')]=_[_0x233f('0x2b')](_0x39a5e9,_0x233f('0x28'));_0xa211c8[_0x233f('0x31')]=_[_0x233f('0x32')](_0x4530d9[_0x233f('0x31')]);_0xa211c8[_0x233f('0x33')]=_[_0x233f('0x34')](_0xa211c8[_0x233f('0x30')],_0xa211c8['query']);_0x5ca356[_0x233f('0x35')]=_[_0x233f('0x34')](_0xa211c8[_0x233f('0x30')],qs[_0x233f('0x36')](_0x4530d9[_0x233f('0x31')][_0x233f('0x36')]));_0x5ca356[_0x233f('0x35')]=_0x5ca356[_0x233f('0x35')][_0x233f('0x37')]?_0x5ca356[_0x233f('0x35')]:_0xa211c8[_0x233f('0x30')];if(!_0x4530d9[_0x233f('0x31')][_0x233f('0x38')]('nolimit')){_0x5ca356['limit']=qs['limit'](_0x4530d9['query'][_0x233f('0x1f')]);_0x5ca356[_0x233f('0x1e')]=qs['offset'](_0x4530d9[_0x233f('0x31')][_0x233f('0x1e')]);}_0x5ca356[_0x233f('0x39')]=qs['sort'](_0x4530d9['query'][_0x233f('0x3a')]);_0x5ca356[_0x233f('0x3b')]=qs['filters'](_['pick'](_0x4530d9[_0x233f('0x31')],_0xa211c8['filters']),_0x39a5e9);if(_0x4530d9[_0x233f('0x31')][_0x233f('0x3c')]){_0x5ca356[_0x233f('0x3b')]=_[_0x233f('0x3d')](_0x5ca356[_0x233f('0x3b')],{'$or':_[_0x233f('0x2b')](_0x39a5e9,function(_0x211d19){if(_0x211d19[_0x233f('0x2e')]!=='VIRTUAL'){var _0x8b3ccb={};_0x8b3ccb[_0x211d19['name']]={'$like':'%'+_0x4530d9[_0x233f('0x31')]['filter']+'%'};return _0x8b3ccb;}})});}_0x5ca356=_[_0x233f('0x3d')]({},_0x5ca356,_0x4530d9[_0x233f('0x3e')]);var _0x4eb836={'where':_0x5ca356[_0x233f('0x3b')]};return db['Automation'][_0x233f('0x1d')](_0x4eb836)[_0x233f('0x25')](function(_0x4d8137){_0x516250[_0x233f('0x1d')]=_0x4d8137;if(_0x4530d9['query'][_0x233f('0x3f')]){_0x5ca356['include']=[{'all':!![]}];}return db[_0x233f('0x40')][_0x233f('0x41')](_0x5ca356);})[_0x233f('0x25')](function(_0x296db7){_0x516250['rows']=_0x296db7;return _0x516250;})['then'](respondWithFilteredResult(_0x15f8fb,_0x5ca356))['catch'](handleError(_0x15f8fb,null));};exports[_0x233f('0x42')]=function(_0x14bd41,_0x54d99b){var _0x2f4c65={'raw':![],'where':{'id':_0x14bd41[_0x233f('0x43')]['id']}},_0x116a32={};_0x116a32['model']=_['keys'](db[_0x233f('0x40')][_0x233f('0x2c')]);_0x116a32[_0x233f('0x31')]=_[_0x233f('0x32')](_0x14bd41[_0x233f('0x31')]);_0x116a32[_0x233f('0x33')]=_[_0x233f('0x34')](_0x116a32[_0x233f('0x30')],_0x116a32[_0x233f('0x31')]);_0x2f4c65[_0x233f('0x35')]=_['intersection'](_0x116a32['model'],qs[_0x233f('0x36')](_0x14bd41['query'][_0x233f('0x36')]));_0x2f4c65[_0x233f('0x35')]=_0x2f4c65['attributes']['length']?_0x2f4c65['attributes']:_0x116a32['model'];if(_0x14bd41[_0x233f('0x31')][_0x233f('0x3f')]){_0x2f4c65[_0x233f('0x44')]=[{'all':!![]}];}_0x2f4c65=_[_0x233f('0x3d')]({},_0x2f4c65,_0x14bd41[_0x233f('0x3e')]);return db[_0x233f('0x40')]['find'](_0x2f4c65)[_0x233f('0x25')](handleEntityNotFound(_0x54d99b,null))['then'](respondWithResult(_0x54d99b,null))[_0x233f('0x45')](handleError(_0x54d99b,null));};exports[_0x233f('0x46')]=function(_0x2dbc41,_0x323120){return db[_0x233f('0x40')]['create'](_0x2dbc41[_0x233f('0x47')],{})[_0x233f('0x25')](respondWithResult(_0x323120,0xc9))[_0x233f('0x45')](handleError(_0x323120,null));};exports[_0x233f('0x24')]=function(_0x5d7dac,_0x1a4cc6){if(_0x5d7dac[_0x233f('0x47')]['id']){delete _0x5d7dac[_0x233f('0x47')]['id'];}return db[_0x233f('0x40')]['find']({'where':{'id':_0x5d7dac[_0x233f('0x43')]['id']}})[_0x233f('0x25')](handleEntityNotFound(_0x1a4cc6,null))[_0x233f('0x25')](saveUpdates(_0x5d7dac[_0x233f('0x47')],null))[_0x233f('0x25')](respondWithResult(_0x1a4cc6,null))[_0x233f('0x45')](handleError(_0x1a4cc6,null));};exports[_0x233f('0x26')]=function(_0x11e15d,_0x1f9472){return db[_0x233f('0x40')][_0x233f('0x48')]({'where':{'id':_0x11e15d[_0x233f('0x43')]['id']}})[_0x233f('0x25')](handleEntityNotFound(_0x1f9472,null))[_0x233f('0x25')](removeEntity(_0x1f9472,null))[_0x233f('0x45')](handleError(_0x1f9472,null));};exports['addConditions']=function(_0x4c3d19,_0x29cbb3,_0x1524ea){return db[_0x233f('0x49')][_0x233f('0x48')]({'where':{'id':_0x4c3d19[_0x233f('0x43')]['id']}})[_0x233f('0x25')](handleEntityNotFound(_0x29cbb3,null))[_0x233f('0x25')](function(_0x210c4e){if(_0x210c4e){return _0x210c4e[_0x233f('0x4a')](_0x4c3d19[_0x233f('0x47')][_0x233f('0x4b')],_['omit'](_0x4c3d19[_0x233f('0x47')],['ids','id'])||{});}})[_0x233f('0x25')](respondWithResult(_0x29cbb3,null))[_0x233f('0x45')](handleError(_0x29cbb3,null));};exports[_0x233f('0x4c')]=function(_0x547e6b,_0x150e4d,_0xde4a27){var _0x28cf39={};var _0x306039={};var _0x2f387f;var _0x469a5a;return db['Automation'][_0x233f('0x4d')]({'where':{'id':_0x547e6b['params']['id']}})[_0x233f('0x25')](handleEntityNotFound(_0x150e4d,null))[_0x233f('0x25')](function(_0x5f34b7){if(_0x5f34b7){_0x2f387f=_0x5f34b7;_0x306039[_0x233f('0x30')]=_[_0x233f('0x32')](db[_0x233f('0x49')][_0x233f('0x2c')]);_0x306039[_0x233f('0x31')]=_['keys'](_0x547e6b['query']);_0x306039[_0x233f('0x33')]=_['intersection'](_0x306039[_0x233f('0x30')],_0x306039[_0x233f('0x31')]);_0x28cf39['attributes']=_['intersection'](_0x306039[_0x233f('0x30')],qs[_0x233f('0x36')](_0x547e6b[_0x233f('0x31')][_0x233f('0x36')]));_0x28cf39[_0x233f('0x35')]=_0x28cf39[_0x233f('0x35')][_0x233f('0x37')]?_0x28cf39[_0x233f('0x35')]:_0x306039[_0x233f('0x30')];_0x28cf39[_0x233f('0x39')]=qs[_0x233f('0x3a')](_0x547e6b[_0x233f('0x31')][_0x233f('0x3a')]);_0x28cf39[_0x233f('0x3b')]=qs[_0x233f('0x33')](_[_0x233f('0x4e')](_0x547e6b[_0x233f('0x31')],_0x306039[_0x233f('0x33')]));if(_0x547e6b[_0x233f('0x31')][_0x233f('0x3c')]){_0x28cf39['where']=_[_0x233f('0x3d')](_0x28cf39[_0x233f('0x3b')],{'$or':_['map'](_0x28cf39[_0x233f('0x35')],function(_0x5a8a29){var _0x57aa9c={};_0x57aa9c[_0x5a8a29]={'$like':'%'+_0x547e6b[_0x233f('0x31')][_0x233f('0x3c')]+'%'};return _0x57aa9c;})});}_0x28cf39=_[_0x233f('0x3d')]({},_0x28cf39,_0x547e6b[_0x233f('0x3e')]);return _0x2f387f[_0x233f('0x4c')](_0x28cf39);}})[_0x233f('0x25')](function(_0x2826dd){if(_0x2826dd){_0x469a5a=_0x2826dd[_0x233f('0x37')];if(!_0x547e6b[_0x233f('0x31')]['hasOwnProperty'](_0x233f('0x4f'))){_0x28cf39[_0x233f('0x1f')]=qs['limit'](_0x547e6b['query']['limit']);_0x28cf39[_0x233f('0x1e')]=qs['offset'](_0x547e6b[_0x233f('0x31')][_0x233f('0x1e')]);}return _0x2f387f[_0x233f('0x4c')](_0x28cf39);}})['then'](function(_0x2c2a04){if(_0x2c2a04){return _0x2c2a04?{'count':_0x469a5a,'rows':_0x2c2a04}:null;}})[_0x233f('0x25')](respondWithResult(_0x150e4d,null))['catch'](handleError(_0x150e4d,null));};exports[_0x233f('0x50')]=function(_0x25a188,_0x2d3905,_0x52973b){return db[_0x233f('0x51')]['find']({'where':{'id':_0x25a188[_0x233f('0x43')]['id']}})[_0x233f('0x25')](handleEntityNotFound(_0x2d3905,null))['then'](function(_0x47c9d9){if(_0x47c9d9){return _0x47c9d9[_0x233f('0x50')](_0x25a188[_0x233f('0x47')][_0x233f('0x4b')],_['omit'](_0x25a188['body'],[_0x233f('0x4b'),'id'])||{});}})[_0x233f('0x25')](respondWithResult(_0x2d3905,null))[_0x233f('0x45')](handleError(_0x2d3905,null));};exports[_0x233f('0x52')]=function(_0x155561,_0x18830c,_0x1ecac4){var _0x5c0819={};var _0x2dca8d={};var _0x4de0d9;var _0x46a1a3;return db[_0x233f('0x40')][_0x233f('0x4d')]({'where':{'id':_0x155561[_0x233f('0x43')]['id']}})['then'](handleEntityNotFound(_0x18830c,null))['then'](function(_0x54b0a5){if(_0x54b0a5){_0x4de0d9=_0x54b0a5;_0x2dca8d[_0x233f('0x30')]=_[_0x233f('0x32')](db[_0x233f('0x51')][_0x233f('0x2c')]);_0x2dca8d[_0x233f('0x31')]=_[_0x233f('0x32')](_0x155561[_0x233f('0x31')]);_0x2dca8d['filters']=_[_0x233f('0x34')](_0x2dca8d['model'],_0x2dca8d[_0x233f('0x31')]);_0x5c0819[_0x233f('0x35')]=_[_0x233f('0x34')](_0x2dca8d[_0x233f('0x30')],qs['fields'](_0x155561[_0x233f('0x31')][_0x233f('0x36')]));_0x5c0819[_0x233f('0x35')]=_0x5c0819[_0x233f('0x35')]['length']?_0x5c0819[_0x233f('0x35')]:_0x2dca8d['model'];_0x5c0819['order']=qs[_0x233f('0x3a')](_0x155561[_0x233f('0x31')][_0x233f('0x3a')]);_0x5c0819[_0x233f('0x3b')]=qs[_0x233f('0x33')](_[_0x233f('0x4e')](_0x155561[_0x233f('0x31')],_0x2dca8d[_0x233f('0x33')]));if(_0x155561[_0x233f('0x31')][_0x233f('0x3c')]){_0x5c0819[_0x233f('0x3b')]=_[_0x233f('0x3d')](_0x5c0819[_0x233f('0x3b')],{'$or':_[_0x233f('0x2b')](_0x5c0819['attributes'],function(_0x540aa5){var _0x27c759={};_0x27c759[_0x540aa5]={'$like':'%'+_0x155561[_0x233f('0x31')][_0x233f('0x3c')]+'%'};return _0x27c759;})});}_0x5c0819=_[_0x233f('0x3d')]({},_0x5c0819,_0x155561[_0x233f('0x3e')]);return _0x4de0d9[_0x233f('0x52')](_0x5c0819);}})[_0x233f('0x25')](function(_0x3b0583){if(_0x3b0583){_0x46a1a3=_0x3b0583[_0x233f('0x37')];if(!_0x155561[_0x233f('0x31')][_0x233f('0x38')](_0x233f('0x4f'))){_0x5c0819[_0x233f('0x1f')]=qs[_0x233f('0x1f')](_0x155561['query']['limit']);_0x5c0819[_0x233f('0x1e')]=qs[_0x233f('0x1e')](_0x155561[_0x233f('0x31')][_0x233f('0x1e')]);}return _0x4de0d9[_0x233f('0x52')](_0x5c0819);}})[_0x233f('0x25')](function(_0x11218e){if(_0x11218e){return _0x11218e?{'count':_0x46a1a3,'rows':_0x11218e}:null;}})[_0x233f('0x25')](respondWithResult(_0x18830c,null))['catch'](handleError(_0x18830c,null));}; \ No newline at end of file +var _0xf1ae=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','json','then','sendStatus','name','index','Automation','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','addConditions','ids','omit','getConditions','findOne','Condition','order','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xf1ae,0xf5));var _0xef1a=function(_0x4ad10b,_0xc0529e){_0x4ad10b=_0x4ad10b-0x0;var _0xfc602f=_0xf1ae[_0x4ad10b];return _0xfc602f;};'use strict';var emlformat=require(_0xef1a('0x0'));var rimraf=require(_0xef1a('0x1'));var zipdir=require(_0xef1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef1a('0x3'));var moment=require(_0xef1a('0x4'));var BPromise=require(_0xef1a('0x5'));var Mustache=require(_0xef1a('0x6'));var util=require(_0xef1a('0x7'));var path=require(_0xef1a('0x8'));var sox=require(_0xef1a('0x9'));var csv=require(_0xef1a('0xa'));var ejs=require(_0xef1a('0xb'));var fs=require('fs');var fs_extra=require(_0xef1a('0xc'));var _=require(_0xef1a('0xd'));var squel=require(_0xef1a('0xe'));var crypto=require(_0xef1a('0xf'));var jsforce=require(_0xef1a('0x10'));var deskjs=require(_0xef1a('0x11'));var toCsv=require(_0xef1a('0xa'));var querystring=require(_0xef1a('0x12'));var Papa=require(_0xef1a('0x13'));var Redis=require(_0xef1a('0x14'));var authService=require(_0xef1a('0x15'));var qs=require(_0xef1a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef1a('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xef1a('0x18'));var config=require(_0xef1a('0x19'));var licenseUtil=require(_0xef1a('0x1a'));var db=require(_0xef1a('0x1b'))['db'];function respondWithStatusCode(_0x4bc3fa,_0x178113){_0x178113=_0x178113||0xcc;return function(_0x24af37){if(_0x24af37){return _0x4bc3fa['sendStatus'](_0x178113);}return _0x4bc3fa[_0xef1a('0x1c')](_0x178113)[_0xef1a('0x1d')]();};}function respondWithResult(_0x2af15c,_0x5ea391){_0x5ea391=_0x5ea391||0xc8;return function(_0x29b2a1){if(_0x29b2a1){return _0x2af15c[_0xef1a('0x1c')](_0x5ea391)['json'](_0x29b2a1);}};}function respondWithFilteredResult(_0x18e776,_0x469669){return function(_0x1f430d){if(_0x1f430d){var _0xe79a4f=typeof _0x469669[_0xef1a('0x1e')]===_0xef1a('0x1f')&&typeof _0x469669[_0xef1a('0x20')]===_0xef1a('0x1f');var _0x3537ff=_0x1f430d[_0xef1a('0x21')];var _0x2abb6e=_0xe79a4f?0x0:_0x469669[_0xef1a('0x1e')];var _0x480677=_0xe79a4f?_0x1f430d[_0xef1a('0x21')]:_0x469669[_0xef1a('0x1e')]+_0x469669[_0xef1a('0x20')];var _0x42c526;if(_0x480677>=_0x3537ff){_0x480677=_0x3537ff;_0x42c526=0xc8;}else{_0x42c526=0xce;}_0x18e776[_0xef1a('0x1c')](_0x42c526);return _0x18e776['set']('Content-Range',_0x2abb6e+'-'+_0x480677+'/'+_0x3537ff)[_0xef1a('0x22')](_0x1f430d);}return null;};}function patchUpdates(_0xfbbfca){return function(_0x380134){try{jsonpatch['apply'](_0x380134,_0xfbbfca,!![]);}catch(_0x36ed0a){return BPromise['reject'](_0x36ed0a);}return _0x380134['save']();};}function saveUpdates(_0x4989e4,_0x1173d0){return function(_0x3a2a93){if(_0x3a2a93){return _0x3a2a93['update'](_0x4989e4)['then'](function(_0x37216d){return _0x37216d;});}return null;};}function removeEntity(_0x1b8b7a,_0x323288){return function(_0x2f453d){if(_0x2f453d){return _0x2f453d['destroy']()[_0xef1a('0x23')](function(){_0x1b8b7a[_0xef1a('0x1c')](0xcc)[_0xef1a('0x1d')]();});}};}function handleEntityNotFound(_0x42dccd,_0x99e072){return function(_0x440add){if(!_0x440add){_0x42dccd[_0xef1a('0x24')](0x194);}return _0x440add;};}function handleError(_0x5e600c,_0x2fc22e){_0x2fc22e=_0x2fc22e||0x1f4;return function(_0x402c5a){logger['error'](_0x402c5a['stack']);if(_0x402c5a[_0xef1a('0x25')]){delete _0x402c5a[_0xef1a('0x25')];}_0x5e600c[_0xef1a('0x1c')](_0x2fc22e)['send'](_0x402c5a);};}exports[_0xef1a('0x26')]=function(_0x4e0745,_0x4cf150){var _0x4724f5={},_0x1b2978={},_0x369002={'count':0x0,'rows':[]};var _0x58c978=_['map'](db[_0xef1a('0x27')][_0xef1a('0x28')],function(_0x2d3932){return{'name':_0x2d3932[_0xef1a('0x29')],'type':_0x2d3932[_0xef1a('0x2a')][_0xef1a('0x2b')]};});_0x1b2978[_0xef1a('0x2c')]=_[_0xef1a('0x2d')](_0x58c978,_0xef1a('0x25'));_0x1b2978[_0xef1a('0x2e')]=_[_0xef1a('0x2f')](_0x4e0745['query']);_0x1b2978[_0xef1a('0x30')]=_[_0xef1a('0x31')](_0x1b2978[_0xef1a('0x2c')],_0x1b2978[_0xef1a('0x2e')]);_0x4724f5['attributes']=_[_0xef1a('0x31')](_0x1b2978['model'],qs['fields'](_0x4e0745[_0xef1a('0x2e')][_0xef1a('0x32')]));_0x4724f5[_0xef1a('0x33')]=_0x4724f5[_0xef1a('0x33')][_0xef1a('0x34')]?_0x4724f5['attributes']:_0x1b2978[_0xef1a('0x2c')];if(!_0x4e0745[_0xef1a('0x2e')][_0xef1a('0x35')](_0xef1a('0x36'))){_0x4724f5[_0xef1a('0x20')]=qs['limit'](_0x4e0745['query'][_0xef1a('0x20')]);_0x4724f5['offset']=qs[_0xef1a('0x1e')](_0x4e0745['query'][_0xef1a('0x1e')]);}_0x4724f5['order']=qs[_0xef1a('0x37')](_0x4e0745[_0xef1a('0x2e')]['sort']);_0x4724f5[_0xef1a('0x38')]=qs[_0xef1a('0x30')](_[_0xef1a('0x39')](_0x4e0745[_0xef1a('0x2e')],_0x1b2978['filters']),_0x58c978);if(_0x4e0745[_0xef1a('0x2e')][_0xef1a('0x3a')]){_0x4724f5[_0xef1a('0x38')]=_[_0xef1a('0x3b')](_0x4724f5[_0xef1a('0x38')],{'$or':_[_0xef1a('0x2d')](_0x58c978,function(_0x5d1fdf){if(_0x5d1fdf['type']!==_0xef1a('0x3c')){var _0x51db45={};_0x51db45[_0x5d1fdf[_0xef1a('0x25')]]={'$like':'%'+_0x4e0745[_0xef1a('0x2e')][_0xef1a('0x3a')]+'%'};return _0x51db45;}})});}_0x4724f5=_[_0xef1a('0x3b')]({},_0x4724f5,_0x4e0745[_0xef1a('0x3d')]);var _0x58c2dd={'where':_0x4724f5[_0xef1a('0x38')]};return db[_0xef1a('0x27')][_0xef1a('0x21')](_0x58c2dd)[_0xef1a('0x23')](function(_0x5de6a8){_0x369002[_0xef1a('0x21')]=_0x5de6a8;if(_0x4e0745[_0xef1a('0x2e')][_0xef1a('0x3e')]){_0x4724f5[_0xef1a('0x3f')]=[{'all':!![]}];}return db[_0xef1a('0x27')][_0xef1a('0x40')](_0x4724f5);})['then'](function(_0x257454){_0x369002[_0xef1a('0x41')]=_0x257454;return _0x369002;})['then'](respondWithFilteredResult(_0x4cf150,_0x4724f5))[_0xef1a('0x42')](handleError(_0x4cf150,null));};exports[_0xef1a('0x43')]=function(_0x16aee2,_0x5c4b66){var _0x1b962d={'raw':![],'where':{'id':_0x16aee2[_0xef1a('0x44')]['id']}},_0x475c8e={};_0x475c8e[_0xef1a('0x2c')]=_[_0xef1a('0x2f')](db['Automation'][_0xef1a('0x28')]);_0x475c8e[_0xef1a('0x2e')]=_[_0xef1a('0x2f')](_0x16aee2['query']);_0x475c8e['filters']=_[_0xef1a('0x31')](_0x475c8e['model'],_0x475c8e['query']);_0x1b962d[_0xef1a('0x33')]=_[_0xef1a('0x31')](_0x475c8e[_0xef1a('0x2c')],qs[_0xef1a('0x32')](_0x16aee2[_0xef1a('0x2e')]['fields']));_0x1b962d[_0xef1a('0x33')]=_0x1b962d[_0xef1a('0x33')][_0xef1a('0x34')]?_0x1b962d[_0xef1a('0x33')]:_0x475c8e['model'];if(_0x16aee2[_0xef1a('0x2e')][_0xef1a('0x3e')]){_0x1b962d[_0xef1a('0x3f')]=[{'all':!![]}];}_0x1b962d=_[_0xef1a('0x3b')]({},_0x1b962d,_0x16aee2[_0xef1a('0x3d')]);return db['Automation'][_0xef1a('0x45')](_0x1b962d)[_0xef1a('0x23')](handleEntityNotFound(_0x5c4b66,null))['then'](respondWithResult(_0x5c4b66,null))['catch'](handleError(_0x5c4b66,null));};exports[_0xef1a('0x46')]=function(_0x1d1892,_0x51f446){return db[_0xef1a('0x27')][_0xef1a('0x46')](_0x1d1892[_0xef1a('0x47')],{})[_0xef1a('0x23')](respondWithResult(_0x51f446,0xc9))['catch'](handleError(_0x51f446,null));};exports[_0xef1a('0x48')]=function(_0x33669e,_0x4c5d42){if(_0x33669e['body']['id']){delete _0x33669e[_0xef1a('0x47')]['id'];}return db['Automation'][_0xef1a('0x45')]({'where':{'id':_0x33669e[_0xef1a('0x44')]['id']}})['then'](handleEntityNotFound(_0x4c5d42,null))[_0xef1a('0x23')](saveUpdates(_0x33669e[_0xef1a('0x47')],null))['then'](respondWithResult(_0x4c5d42,null))[_0xef1a('0x42')](handleError(_0x4c5d42,null));};exports[_0xef1a('0x49')]=function(_0x502888,_0x2a9f8f){return db[_0xef1a('0x27')]['find']({'where':{'id':_0x502888['params']['id']}})[_0xef1a('0x23')](handleEntityNotFound(_0x2a9f8f,null))[_0xef1a('0x23')](removeEntity(_0x2a9f8f,null))['catch'](handleError(_0x2a9f8f,null));};exports[_0xef1a('0x4a')]=function(_0x51982e,_0x21ddcb,_0x582c11){return db['Condition'][_0xef1a('0x45')]({'where':{'id':_0x51982e[_0xef1a('0x44')]['id']}})[_0xef1a('0x23')](handleEntityNotFound(_0x21ddcb,null))['then'](function(_0x1fb8e2){if(_0x1fb8e2){return _0x1fb8e2[_0xef1a('0x4a')](_0x51982e[_0xef1a('0x47')][_0xef1a('0x4b')],_[_0xef1a('0x4c')](_0x51982e[_0xef1a('0x47')],[_0xef1a('0x4b'),'id'])||{});}})[_0xef1a('0x23')](respondWithResult(_0x21ddcb,null))[_0xef1a('0x42')](handleError(_0x21ddcb,null));};exports[_0xef1a('0x4d')]=function(_0x59a802,_0x2a1cd6,_0x31ccbd){var _0x20c1f9={};var _0x16ae7c={};var _0x109bf2;var _0x525353;return db[_0xef1a('0x27')][_0xef1a('0x4e')]({'where':{'id':_0x59a802[_0xef1a('0x44')]['id']}})[_0xef1a('0x23')](handleEntityNotFound(_0x2a1cd6,null))[_0xef1a('0x23')](function(_0x3d1f5d){if(_0x3d1f5d){_0x109bf2=_0x3d1f5d;_0x16ae7c[_0xef1a('0x2c')]=_['keys'](db[_0xef1a('0x4f')][_0xef1a('0x28')]);_0x16ae7c[_0xef1a('0x2e')]=_['keys'](_0x59a802[_0xef1a('0x2e')]);_0x16ae7c[_0xef1a('0x30')]=_[_0xef1a('0x31')](_0x16ae7c[_0xef1a('0x2c')],_0x16ae7c['query']);_0x20c1f9[_0xef1a('0x33')]=_[_0xef1a('0x31')](_0x16ae7c[_0xef1a('0x2c')],qs[_0xef1a('0x32')](_0x59a802[_0xef1a('0x2e')][_0xef1a('0x32')]));_0x20c1f9[_0xef1a('0x33')]=_0x20c1f9[_0xef1a('0x33')]['length']?_0x20c1f9[_0xef1a('0x33')]:_0x16ae7c[_0xef1a('0x2c')];_0x20c1f9[_0xef1a('0x50')]=qs['sort'](_0x59a802['query'][_0xef1a('0x37')]);_0x20c1f9[_0xef1a('0x38')]=qs['filters'](_[_0xef1a('0x39')](_0x59a802[_0xef1a('0x2e')],_0x16ae7c[_0xef1a('0x30')]));if(_0x59a802[_0xef1a('0x2e')][_0xef1a('0x3a')]){_0x20c1f9[_0xef1a('0x38')]=_[_0xef1a('0x3b')](_0x20c1f9[_0xef1a('0x38')],{'$or':_['map'](_0x20c1f9['attributes'],function(_0x5f1a9e){var _0x47bfb4={};_0x47bfb4[_0x5f1a9e]={'$like':'%'+_0x59a802[_0xef1a('0x2e')]['filter']+'%'};return _0x47bfb4;})});}_0x20c1f9=_[_0xef1a('0x3b')]({},_0x20c1f9,_0x59a802[_0xef1a('0x3d')]);return _0x109bf2[_0xef1a('0x4d')](_0x20c1f9);}})[_0xef1a('0x23')](function(_0x127752){if(_0x127752){_0x525353=_0x127752['length'];if(!_0x59a802[_0xef1a('0x2e')]['hasOwnProperty']('nolimit')){_0x20c1f9[_0xef1a('0x20')]=qs['limit'](_0x59a802[_0xef1a('0x2e')][_0xef1a('0x20')]);_0x20c1f9[_0xef1a('0x1e')]=qs[_0xef1a('0x1e')](_0x59a802['query']['offset']);}return _0x109bf2[_0xef1a('0x4d')](_0x20c1f9);}})['then'](function(_0x5dffcc){if(_0x5dffcc){return _0x5dffcc?{'count':_0x525353,'rows':_0x5dffcc}:null;}})['then'](respondWithResult(_0x2a1cd6,null))[_0xef1a('0x42')](handleError(_0x2a1cd6,null));};exports[_0xef1a('0x51')]=function(_0x3101bd,_0x363fed,_0x439ce8){return db[_0xef1a('0x52')][_0xef1a('0x45')]({'where':{'id':_0x3101bd['params']['id']}})[_0xef1a('0x23')](handleEntityNotFound(_0x363fed,null))[_0xef1a('0x23')](function(_0x288ac2){if(_0x288ac2){return _0x288ac2['addActions'](_0x3101bd[_0xef1a('0x47')]['ids'],_[_0xef1a('0x4c')](_0x3101bd[_0xef1a('0x47')],['ids','id'])||{});}})[_0xef1a('0x23')](respondWithResult(_0x363fed,null))[_0xef1a('0x42')](handleError(_0x363fed,null));};exports[_0xef1a('0x53')]=function(_0xa7c94f,_0x58382f,_0x3866bf){var _0xf6f9c2={};var _0x333b74={};var _0x51e3f6;var _0x12ff9a;return db[_0xef1a('0x27')][_0xef1a('0x4e')]({'where':{'id':_0xa7c94f[_0xef1a('0x44')]['id']}})[_0xef1a('0x23')](handleEntityNotFound(_0x58382f,null))['then'](function(_0xff605a){if(_0xff605a){_0x51e3f6=_0xff605a;_0x333b74[_0xef1a('0x2c')]=_[_0xef1a('0x2f')](db[_0xef1a('0x52')][_0xef1a('0x28')]);_0x333b74[_0xef1a('0x2e')]=_['keys'](_0xa7c94f[_0xef1a('0x2e')]);_0x333b74[_0xef1a('0x30')]=_[_0xef1a('0x31')](_0x333b74[_0xef1a('0x2c')],_0x333b74[_0xef1a('0x2e')]);_0xf6f9c2[_0xef1a('0x33')]=_[_0xef1a('0x31')](_0x333b74[_0xef1a('0x2c')],qs[_0xef1a('0x32')](_0xa7c94f[_0xef1a('0x2e')]['fields']));_0xf6f9c2['attributes']=_0xf6f9c2[_0xef1a('0x33')][_0xef1a('0x34')]?_0xf6f9c2['attributes']:_0x333b74[_0xef1a('0x2c')];_0xf6f9c2[_0xef1a('0x50')]=qs[_0xef1a('0x37')](_0xa7c94f['query']['sort']);_0xf6f9c2[_0xef1a('0x38')]=qs['filters'](_['pick'](_0xa7c94f[_0xef1a('0x2e')],_0x333b74[_0xef1a('0x30')]));if(_0xa7c94f[_0xef1a('0x2e')][_0xef1a('0x3a')]){_0xf6f9c2[_0xef1a('0x38')]=_[_0xef1a('0x3b')](_0xf6f9c2[_0xef1a('0x38')],{'$or':_[_0xef1a('0x2d')](_0xf6f9c2[_0xef1a('0x33')],function(_0x29a8ae){var _0x23ebb4={};_0x23ebb4[_0x29a8ae]={'$like':'%'+_0xa7c94f['query'][_0xef1a('0x3a')]+'%'};return _0x23ebb4;})});}_0xf6f9c2=_['merge']({},_0xf6f9c2,_0xa7c94f['options']);return _0x51e3f6[_0xef1a('0x53')](_0xf6f9c2);}})[_0xef1a('0x23')](function(_0x5f01ed){if(_0x5f01ed){_0x12ff9a=_0x5f01ed[_0xef1a('0x34')];if(!_0xa7c94f[_0xef1a('0x2e')][_0xef1a('0x35')](_0xef1a('0x36'))){_0xf6f9c2[_0xef1a('0x20')]=qs[_0xef1a('0x20')](_0xa7c94f[_0xef1a('0x2e')][_0xef1a('0x20')]);_0xf6f9c2[_0xef1a('0x1e')]=qs[_0xef1a('0x1e')](_0xa7c94f['query'][_0xef1a('0x1e')]);}return _0x51e3f6['getActions'](_0xf6f9c2);}})[_0xef1a('0x23')](function(_0x598b38){if(_0x598b38){return _0x598b38?{'count':_0x12ff9a,'rows':_0x598b38}:null;}})[_0xef1a('0x23')](respondWithResult(_0x58382f,null))[_0xef1a('0x42')](handleError(_0x58382f,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 3667ac6..1b204d5 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 _0x434c=['lodash','util','../../config/logger','path','./automation.attributes','exports','define','Automation','tools_automations'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x434c,0x1dd));var _0xc434=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x434c[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xc434('0x0'));var util=require(_0xc434('0x1'));var logger=require(_0xc434('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc434('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc434('0x4'));module[_0xc434('0x5')]=function(_0x445d0e,_0x46dace){return _0x445d0e[_0xc434('0x6')](_0xc434('0x7'),attributes,{'tableName':_0xc434('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0a8=['lodash','api','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','tools_automations'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf0a8,0x132));var _0x8f0a=function(_0x3d8186,_0x2971b0){_0x3d8186=_0x3d8186-0x0;var _0x457f2e=_0xf0a8[_0x3d8186];return _0x457f2e;};'use strict';var _=require(_0x8f0a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8f0a('0x1'));var moment=require('moment');var BPromise=require(_0x8f0a('0x2'));var rp=require(_0x8f0a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f0a('0x4'));var config=require(_0x8f0a('0x5'));var attributes=require(_0x8f0a('0x6'));module[_0x8f0a('0x7')]=function(_0x320e74,_0xcc6adf){return _0x320e74['define']('Automation',attributes,{'tableName':_0x8f0a('0x8'),'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 8ff50ce..b03f45d 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 _0x0833=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3a6972,_0x5cb15d){var _0x52c610=function(_0x2ad5d8){while(--_0x2ad5d8){_0x3a6972['push'](_0x3a6972['shift']());}};_0x52c610(++_0x5cb15d);}(_0x0833,0x1bd));var _0x3083=function(_0x5f4493,_0x218802){_0x5f4493=_0x5f4493-0x0;var _0x57dab7=_0x0833[_0x5f4493];return _0x57dab7;};'use strict';var _=require(_0x3083('0x0'));var util=require(_0x3083('0x1'));var moment=require(_0x3083('0x2'));var BPromise=require(_0x3083('0x3'));var rs=require(_0x3083('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3083('0x5'))('rpc');var config=require(_0x3083('0x6'));var jayson=require(_0x3083('0x7'));var client=jayson[_0x3083('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f9c3a,_0x1378a5,_0x529df1){return new BPromise(function(_0x5591b0,_0x4f51da){return client[_0x3083('0x9')](_0x2f9c3a,_0x529df1)['then'](function(_0x5cce3c){logger[_0x3083('0xa')](_0x3083('0xb'),_0x1378a5,_0x3083('0xc'));logger[_0x3083('0xd')](_0x3083('0xe'),_0x1378a5,_0x3083('0xc'),JSON[_0x3083('0xf')](_0x5cce3c));if(_0x5cce3c[_0x3083('0x10')]){if(_0x5cce3c[_0x3083('0x10')][_0x3083('0x11')]===0x1f4){logger[_0x3083('0x10')](_0x3083('0xb'),_0x1378a5,_0x5cce3c[_0x3083('0x10')][_0x3083('0x12')]);return _0x4f51da(_0x5cce3c[_0x3083('0x10')]['message']);}logger[_0x3083('0x10')](_0x3083('0xb'),_0x1378a5,_0x5cce3c['error'][_0x3083('0x12')]);return _0x5591b0(_0x5cce3c[_0x3083('0x10')]['message']);}else{logger[_0x3083('0xa')](_0x3083('0xb'),_0x1378a5,_0x3083('0xc'));_0x5591b0(_0x5cce3c[_0x3083('0x13')][_0x3083('0x12')]);}})[_0x3083('0x14')](function(_0xecb368){logger['error']('Automation,\x20%s,\x20%s',_0x1378a5,_0xecb368);_0x4f51da(_0xecb368);});});} \ No newline at end of file +var _0x6edc=['code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xeb3a3c,_0x1385db){var _0x206d22=function(_0x43494c){while(--_0x43494c){_0xeb3a3c['push'](_0xeb3a3c['shift']());}};_0x206d22(++_0x1385db);}(_0x6edc,0x138));var _0xc6ed=function(_0x17a05b,_0x173084){_0x17a05b=_0x17a05b-0x0;var _0x6e7120=_0x6edc[_0x17a05b];return _0x6e7120;};'use strict';var _=require(_0xc6ed('0x0'));var util=require(_0xc6ed('0x1'));var moment=require(_0xc6ed('0x2'));var BPromise=require(_0xc6ed('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6ed('0x4'))['db'];var utils=require(_0xc6ed('0x5'));var logger=require(_0xc6ed('0x6'))(_0xc6ed('0x7'));var config=require('../../config/environment');var jayson=require(_0xc6ed('0x8'));var client=jayson[_0xc6ed('0x9')][_0xc6ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548a14,_0x274b0d,_0x5a077d){return new BPromise(function(_0xd46c3f,_0x13fed0){return client[_0xc6ed('0xb')](_0x548a14,_0x5a077d)[_0xc6ed('0xc')](function(_0x496e6a){logger[_0xc6ed('0xd')](_0xc6ed('0xe'),_0x274b0d,_0xc6ed('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x274b0d,_0xc6ed('0xf'),JSON[_0xc6ed('0x10')](_0x496e6a));if(_0x496e6a[_0xc6ed('0x11')]){if(_0x496e6a[_0xc6ed('0x11')][_0xc6ed('0x12')]===0x1f4){logger['error'](_0xc6ed('0xe'),_0x274b0d,_0x496e6a['error'][_0xc6ed('0x13')]);return _0x13fed0(_0x496e6a['error'][_0xc6ed('0x13')]);}logger[_0xc6ed('0x11')](_0xc6ed('0xe'),_0x274b0d,_0x496e6a['error'][_0xc6ed('0x13')]);return _0xd46c3f(_0x496e6a[_0xc6ed('0x11')][_0xc6ed('0x13')]);}else{logger['info'](_0xc6ed('0xe'),_0x274b0d,'request\x20sent');_0xd46c3f(_0x496e6a[_0xc6ed('0x14')][_0xc6ed('0x13')]);}})[_0xc6ed('0x15')](function(_0x5346fe){logger[_0xc6ed('0x11')](_0xc6ed('0xe'),_0x274b0d,_0x5346fe);_0x13fed0(_0x5346fe);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 8b7f723..19692ac 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 _0x7b6f=['../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x469875,_0x554137){var _0x422e6d=function(_0x4895f9){while(--_0x4895f9){_0x469875['push'](_0x469875['shift']());}};_0x422e6d(++_0x554137);}(_0x7b6f,0x6c));var _0xf7b6=function(_0x1f2dda,_0x539c5f){_0x1f2dda=_0x1f2dda-0x0;var _0x29b49e=_0x7b6f[_0x1f2dda];return _0x29b49e;};'use strict';var multer=require(_0xf7b6('0x0'));var util=require('util');var path=require(_0xf7b6('0x1'));var timeout=require(_0xf7b6('0x2'));var express=require(_0xf7b6('0x3'));var router=express[_0xf7b6('0x4')]();var fs_extra=require(_0xf7b6('0x5'));var auth=require(_0xf7b6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf7b6('0x7'));var controller=require(_0xf7b6('0x8'));router[_0xf7b6('0x9')]('/',auth[_0xf7b6('0xa')](),controller[_0xf7b6('0xb')]);router[_0xf7b6('0x9')](_0xf7b6('0xc'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0xd')]);router[_0xf7b6('0x9')](_0xf7b6('0xe'),auth['isAuthenticated'](),controller[_0xf7b6('0xf')]);router[_0xf7b6('0x9')](_0xf7b6('0x10'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf7b6('0x12')](_0xf7b6('0xe'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0x13')]);router[_0xf7b6('0x12')](_0xf7b6('0x10'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0x14')]);router['put'](_0xf7b6('0xc'),auth[_0xf7b6('0xa')](),controller[_0xf7b6('0x15')]);router[_0xf7b6('0x16')](_0xf7b6('0xc'),auth[_0xf7b6('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbd60=['addActions','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create'];(function(_0x3c840e,_0x1161e4){var _0x1c4cc8=function(_0x8e75e8){while(--_0x8e75e8){_0x3c840e['push'](_0x3c840e['shift']());}};_0x1c4cc8(++_0x1161e4);}(_0xbd60,0x162));var _0x0bd6=function(_0x4b0211,_0x17f347){_0x4b0211=_0x4b0211-0x0;var _0x1906fc=_0xbd60[_0x4b0211];return _0x1906fc;};'use strict';var multer=require(_0x0bd6('0x0'));var util=require(_0x0bd6('0x1'));var path=require(_0x0bd6('0x2'));var timeout=require(_0x0bd6('0x3'));var express=require(_0x0bd6('0x4'));var router=express[_0x0bd6('0x5')]();var fs_extra=require(_0x0bd6('0x6'));var auth=require(_0x0bd6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0bd6('0x8'));var controller=require(_0x0bd6('0x9'));router[_0x0bd6('0xa')]('/',auth['isAuthenticated'](),controller[_0x0bd6('0xb')]);router[_0x0bd6('0xa')](_0x0bd6('0xc'),auth[_0x0bd6('0xd')](),controller[_0x0bd6('0xe')]);router[_0x0bd6('0xa')](_0x0bd6('0xf'),auth[_0x0bd6('0xd')](),controller[_0x0bd6('0x10')]);router['get'](_0x0bd6('0x11'),auth[_0x0bd6('0xd')](),controller[_0x0bd6('0x12')]);router[_0x0bd6('0x13')]('/',auth[_0x0bd6('0xd')](),controller[_0x0bd6('0x14')]);router[_0x0bd6('0x13')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router['post']('/:id/actions',auth[_0x0bd6('0xd')](),controller[_0x0bd6('0x15')]);router['put'](_0x0bd6('0xc'),auth[_0x0bd6('0xd')](),controller[_0x0bd6('0x16')]);router[_0x0bd6('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x0bd6('0x18')]);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 aeb71fb..6a13af1 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 _0x156d=['Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','name','ENUM','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always'];(function(_0x3f3062,_0x4e3deb){var _0x53d8f3=function(_0x5c8cc0){while(--_0x5c8cc0){_0x3f3062['push'](_0x3f3062['shift']());}};_0x53d8f3(++_0x4e3deb);}(_0x156d,0x162));var _0xd156=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x156d[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd156('0x0')],'unique':_0xd156('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd156('0x2')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xd156('0x0')]},'active':{'type':Sequelize[_0xd156('0x3')],'defaultValue':0x0,'comment':_0xd156('0x4')},'limitCalls':{'type':Sequelize[_0xd156('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd156('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd156('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd156('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xd156('0x5')](0x3)[_0xd156('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xd156('0x5')](0x3)[_0xd156('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd156('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd156('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd156('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0xd156('0x5')](0x3)[_0xd156('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd156('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd156('0x5')](0x5)[_0xd156('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd156('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd156('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd156('0x5')](0x5)[_0xd156('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd156('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd156('0x5')](0x3)[_0xd156('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd156('0xd')},'dialTimezone':{'type':Sequelize[_0xd156('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd156('0x0')],'defaultValue':_0xd156('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xd156('0x2')](_0xd156('0xf'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xd156('0x3')],'defaultValue':0x0,'comment':_0xd156('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0xd156('0x5')](0x9)[_0xd156('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xd156('0x5')](0x9)[_0xd156('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd156('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd156('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd156('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd156('0x5')](0x9)[_0xd156('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd156('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xd156('0x5')](0x9)[_0xd156('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd156('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd156('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd156('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd156('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd156('0x5')](0x5)[_0xd156('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd156('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd156('0x5')](0x9)[_0xd156('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xd156('0x2')](_0xd156('0x18'),_0xd156('0x19')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd156('0x1a')},'dialCutDigit':{'type':Sequelize[_0xd156('0x5')](0x3)[_0xd156('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd156('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd156('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd156('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd156('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd156('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd156('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd156('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd156('0x5')](0x3)[_0xd156('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd156('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd156('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd156('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xd156('0x5')](0x3)[_0xd156('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd156('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd156('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd156('0x5')](0x3)[_0xd156('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd156('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd156('0x5')](0x5)[_0xd156('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd156('0x24')}}; \ No newline at end of file +var _0xe53c=['ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','INTEGER','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0xe53c,0x17e));var _0xce53=function(_0x11e9e6,_0x40b63c){_0x11e9e6=_0x11e9e6-0x0;var _0x5ebe60=_0xe53c[_0x11e9e6];return _0x5ebe60;};'use strict';var Sequelize=require('sequelize');module[_0xce53('0x0')]={'name':{'type':Sequelize[_0xce53('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xce53('0x2')]('ivr'),'allowNull':![],'defaultValue':_0xce53('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xce53('0x4')],'defaultValue':0x0,'comment':_0xce53('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xce53('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xce53('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xce53('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce53('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xce53('0x9')](0x5)[_0xce53('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce53('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xce53('0x9')](0x5)[_0xce53('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce53('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xce53('0x9')](0x3)[_0xce53('0x7')],'defaultValue':0x3,'comment':_0xce53('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xce53('0x9')](0x5)[_0xce53('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce53('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xce53('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xce53('0xe')},'dialTimezone':{'type':Sequelize[_0xce53('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xce53('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xce53('0x2')](_0xce53('0xf'),_0xce53('0x10'),_0xce53('0x11')),'defaultValue':_0xce53('0xf')},'dialAMDActive':{'type':Sequelize[_0xce53('0x4')],'defaultValue':0x0,'comment':_0xce53('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xce53('0x9')](0x9)[_0xce53('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xce53('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xce53('0x9')](0x9)[_0xce53('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xce53('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xce53('0x9')](0x9)[_0xce53('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xce53('0x9')](0x9)[_0xce53('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xce53('0x9')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xce53('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xce53('0x9')](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':_0xce53('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0xce53('0x2')](_0xce53('0x17'),_0xce53('0x18')),'defaultValue':_0xce53('0x17')},'dialPrefix':{'type':Sequelize[_0xce53('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xce53('0x9')](0x3)[_0xce53('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xce53('0x19')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xce53('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xce53('0x9')](0x5)[_0xce53('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xce53('0x9')](0x3)[_0xce53('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce53('0x1a')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xce53('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce53('0x1b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xce53('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xce53('0x9')](0x5)[_0xce53('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce53('0x1c')},'dialMachineMaxRetry':{'type':Sequelize[_0xce53('0x9')](0x3)[_0xce53('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce53('0x1d')},'dialMachineRetryFrequency':{'type':Sequelize[_0xce53('0x9')](0x5)[_0xce53('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xce53('0x9')](0x3)[_0xce53('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce53('0x1e')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xce53('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce53('0x1f')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 344763a..8f31b87 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 _0x8218=['CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','cm_contacts','deletedAt\x20IS\x20NULL','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','apply','reject','save','update','then','destroy','IvrCampaigns','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','Campaign','includeAll','include','findAll','rows','catch','show','params','options','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','find','userProfileId','autoAssociation','error','clone','omit','createdAt','updatedAt','body','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','nolimit','CampaignId','filter','CmHopper','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','CmListId','toString','NOW()','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8218,0x128));var _0x8821=function(_0x192f02,_0x7c722f){_0x192f02=_0x192f02-0x0;var _0x467965=_0x8218[_0x192f02];return _0x467965;};'use strict';var emlformat=require(_0x8821('0x0'));var rimraf=require(_0x8821('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8821('0x2'));var rp=require(_0x8821('0x3'));var moment=require('moment');var BPromise=require(_0x8821('0x4'));var Mustache=require(_0x8821('0x5'));var util=require(_0x8821('0x6'));var path=require(_0x8821('0x7'));var sox=require(_0x8821('0x8'));var csv=require(_0x8821('0x9'));var ejs=require(_0x8821('0xa'));var fs=require('fs');var fs_extra=require(_0x8821('0xb'));var _=require(_0x8821('0xc'));var squel=require(_0x8821('0xd'));var crypto=require(_0x8821('0xe'));var jsforce=require(_0x8821('0xf'));var deskjs=require(_0x8821('0x10'));var toCsv=require(_0x8821('0x9'));var querystring=require('querystring');var Papa=require(_0x8821('0x11'));var Redis=require(_0x8821('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8821('0x13'));var logger=require(_0x8821('0x14'))(_0x8821('0x15'));var utils=require(_0x8821('0x16'));var config=require(_0x8821('0x17'));var licenseUtil=require(_0x8821('0x18'));var db=require(_0x8821('0x19'))['db'];function respondWithStatusCode(_0xa060f9,_0x4c27c1){_0x4c27c1=_0x4c27c1||0xcc;return function(_0x56326a){if(_0x56326a){return _0xa060f9[_0x8821('0x1a')](_0x4c27c1);}return _0xa060f9[_0x8821('0x1b')](_0x4c27c1)[_0x8821('0x1c')]();};}function respondWithResult(_0x37fe7b,_0x138523){_0x138523=_0x138523||0xc8;return function(_0x5738f8){if(_0x5738f8){return _0x37fe7b['status'](_0x138523)[_0x8821('0x1d')](_0x5738f8);}};}function respondWithFilteredResult(_0x419514,_0x1269e7){return function(_0x3b39fb){if(_0x3b39fb){var _0x49a991=typeof _0x1269e7['offset']==='undefined'&&typeof _0x1269e7[_0x8821('0x1e')]===_0x8821('0x1f');var _0x243546=_0x3b39fb['count'];var _0x46936e=_0x49a991?0x0:_0x1269e7[_0x8821('0x20')];var _0x28fde9=_0x49a991?_0x3b39fb[_0x8821('0x21')]:_0x1269e7[_0x8821('0x20')]+_0x1269e7[_0x8821('0x1e')];var _0x278981;if(_0x28fde9>=_0x243546){_0x28fde9=_0x243546;_0x278981=0xc8;}else{_0x278981=0xce;}_0x419514['status'](_0x278981);return _0x419514[_0x8821('0x22')]('Content-Range',_0x46936e+'-'+_0x28fde9+'/'+_0x243546)[_0x8821('0x1d')](_0x3b39fb);}return null;};}function patchUpdates(_0x3050a4){return function(_0x19d8e9){try{jsonpatch[_0x8821('0x23')](_0x19d8e9,_0x3050a4,!![]);}catch(_0x1d038d){return BPromise[_0x8821('0x24')](_0x1d038d);}return _0x19d8e9[_0x8821('0x25')]();};}function saveUpdates(_0x56fef0,_0x2c92c0){return function(_0x8c9eae){if(_0x8c9eae){return _0x8c9eae[_0x8821('0x26')](_0x56fef0)[_0x8821('0x27')](function(_0x3a204d){return _0x3a204d;});}return null;};}function removeEntity(_0x542024,_0x1bed6b){return function(_0xb026cb){if(_0xb026cb){return _0xb026cb[_0x8821('0x28')]()[_0x8821('0x27')](function(){var _0x5f1e69=_0xb026cb['get']({'plain':!![]});var _0x1e33a2=_0x8821('0x29');return db['UserProfileResource'][_0x8821('0x28')]({'where':{'type':_0x1e33a2,'resourceId':_0x5f1e69['id']}})['then'](function(){return _0xb026cb;});})['then'](function(){_0x542024['status'](0xcc)[_0x8821('0x1c')]();});}};}function handleEntityNotFound(_0x4d2474,_0x475025){return function(_0xe46393){if(!_0xe46393){_0x4d2474[_0x8821('0x1a')](0x194);}return _0xe46393;};}function handleError(_0x31f91e,_0x3d217a){_0x3d217a=_0x3d217a||0x1f4;return function(_0xe63807){logger['error'](_0xe63807[_0x8821('0x2a')]);if(_0xe63807[_0x8821('0x2b')]){delete _0xe63807[_0x8821('0x2b')];}_0x31f91e[_0x8821('0x1b')](_0x3d217a)[_0x8821('0x2c')](_0xe63807);};}exports[_0x8821('0x2d')]=function(_0x3476ac,_0x12c06f){var _0x4a945c={},_0x560b3c={},_0x1089cd={'count':0x0,'rows':[]};var _0x496ac1=_[_0x8821('0x2e')](db['Campaign'][_0x8821('0x2f')],function(_0x11e7d1){return{'name':_0x11e7d1['fieldName'],'type':_0x11e7d1[_0x8821('0x30')][_0x8821('0x31')]};});_0x560b3c['model']=_[_0x8821('0x2e')](_0x496ac1,_0x8821('0x2b'));_0x560b3c[_0x8821('0x32')]=_[_0x8821('0x33')](_0x3476ac[_0x8821('0x32')]);_0x560b3c[_0x8821('0x34')]=_['intersection'](_0x560b3c[_0x8821('0x35')],_0x560b3c[_0x8821('0x32')]);_0x4a945c[_0x8821('0x36')]=_[_0x8821('0x37')](_0x560b3c['model'],qs[_0x8821('0x38')](_0x3476ac[_0x8821('0x32')][_0x8821('0x38')]));_0x4a945c[_0x8821('0x36')]=_0x4a945c[_0x8821('0x36')][_0x8821('0x39')]?_0x4a945c[_0x8821('0x36')]:_0x560b3c[_0x8821('0x35')];if(!_0x3476ac[_0x8821('0x32')][_0x8821('0x3a')]('nolimit')){_0x4a945c[_0x8821('0x1e')]=qs[_0x8821('0x1e')](_0x3476ac[_0x8821('0x32')][_0x8821('0x1e')]);_0x4a945c[_0x8821('0x20')]=qs[_0x8821('0x20')](_0x3476ac[_0x8821('0x32')][_0x8821('0x20')]);}_0x4a945c[_0x8821('0x3b')]=qs['sort'](_0x3476ac['query'][_0x8821('0x3c')]);_0x4a945c['where']=qs[_0x8821('0x34')](_[_0x8821('0x3d')](_0x3476ac['query'],_0x560b3c['filters']),_0x496ac1);if(_0x3476ac[_0x8821('0x32')]['filter']){_0x4a945c['where']=_[_0x8821('0x3e')](_0x4a945c[_0x8821('0x3f')],{'$or':_['map'](_0x496ac1,function(_0x39d2c){if(_0x39d2c[_0x8821('0x30')]!==_0x8821('0x40')){var _0xee93ae={};_0xee93ae[_0x39d2c[_0x8821('0x2b')]]={'$like':'%'+_0x3476ac[_0x8821('0x32')]['filter']+'%'};return _0xee93ae;}})});}_0x4a945c=_[_0x8821('0x3e')]({},_0x4a945c,_0x3476ac['options']);var _0x1784e9={'where':_0x4a945c[_0x8821('0x3f')]};return db[_0x8821('0x41')][_0x8821('0x21')](_0x1784e9)['then'](function(_0x242096){_0x1089cd['count']=_0x242096;if(_0x3476ac[_0x8821('0x32')][_0x8821('0x42')]){_0x4a945c[_0x8821('0x43')]=[{'all':!![]}];}return db['Campaign'][_0x8821('0x44')](_0x4a945c);})[_0x8821('0x27')](function(_0x2d7385){_0x1089cd[_0x8821('0x45')]=_0x2d7385;return _0x1089cd;})[_0x8821('0x27')](respondWithFilteredResult(_0x12c06f,_0x4a945c))[_0x8821('0x46')](handleError(_0x12c06f,null));};exports[_0x8821('0x47')]=function(_0x15a581,_0x18cdb4){var _0x4b37ef={'raw':![],'where':{'id':_0x15a581[_0x8821('0x48')]['id']}},_0x990f11={};_0x990f11[_0x8821('0x35')]=_[_0x8821('0x33')](db['Campaign'][_0x8821('0x2f')]);_0x990f11[_0x8821('0x32')]=_[_0x8821('0x33')](_0x15a581['query']);_0x990f11[_0x8821('0x34')]=_[_0x8821('0x37')](_0x990f11[_0x8821('0x35')],_0x990f11['query']);_0x4b37ef[_0x8821('0x36')]=_[_0x8821('0x37')](_0x990f11[_0x8821('0x35')],qs[_0x8821('0x38')](_0x15a581[_0x8821('0x32')]['fields']));_0x4b37ef[_0x8821('0x36')]=_0x4b37ef[_0x8821('0x36')][_0x8821('0x39')]?_0x4b37ef[_0x8821('0x36')]:_0x990f11[_0x8821('0x35')];if(_0x15a581[_0x8821('0x32')][_0x8821('0x42')]){_0x4b37ef[_0x8821('0x43')]=[{'all':!![]}];}_0x4b37ef=_[_0x8821('0x3e')]({},_0x4b37ef,_0x15a581[_0x8821('0x49')]);return db[_0x8821('0x41')]['find'](_0x4b37ef)['then'](handleEntityNotFound(_0x18cdb4,null))['then'](respondWithResult(_0x18cdb4,null))['catch'](handleError(_0x18cdb4,null));};exports[_0x8821('0x4a')]=function(_0x43d8c2,_0xdaff53){return db[_0x8821('0x41')][_0x8821('0x4a')](_0x43d8c2['body'],{})[_0x8821('0x27')](function(_0x2b9ef8){var _0x2a4fec=_0x43d8c2['user']['get']({'plain':!![]});if(!_0x2a4fec)throw new Error(_0x8821('0x4b'));if(_0x2a4fec[_0x8821('0x4c')]===_0x8821('0x4d')){var _0xc90d65=_0x2b9ef8[_0x8821('0x4e')]({'plain':!![]});var _0x410e5d=_0x8821('0x29');return db['UserProfileSection'][_0x8821('0x4f')]({'where':{'name':_0x410e5d,'userProfileId':_0x2a4fec[_0x8821('0x50')]},'raw':!![]})[_0x8821('0x27')](function(_0x4450c7){if(_0x4450c7&&_0x4450c7[_0x8821('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0xc90d65[_0x8821('0x2b')],'resourceId':_0xc90d65['id'],'type':_0x4450c7[_0x8821('0x2b')],'sectionId':_0x4450c7['id']},{})[_0x8821('0x27')](function(){return _0x2b9ef8;});}else{return _0x2b9ef8;}})[_0x8821('0x46')](function(_0x26b810){logger[_0x8821('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26b810);throw _0x26b810;});}return _0x2b9ef8;})[_0x8821('0x27')](respondWithResult(_0xdaff53,0xc9))[_0x8821('0x46')](handleError(_0xdaff53,null));};exports[_0x8821('0x53')]=function(_0x5730e0,_0x5a5f9a){var _0x4b4459={'where':{'id':_0x5730e0[_0x8821('0x48')]['id']}},_0x130d2c={};_0x130d2c['model']=_[_0x8821('0x33')](db[_0x8821('0x41')][_0x8821('0x2f')]);_0x4b4459[_0x8821('0x36')]=_[_0x8821('0x37')](_0x130d2c['model'],qs[_0x8821('0x38')](_0x5730e0[_0x8821('0x32')][_0x8821('0x38')]));_0x4b4459['attributes']=_0x4b4459[_0x8821('0x36')][_0x8821('0x39')]?_0x4b4459['attributes']:_0x130d2c[_0x8821('0x35')];if(_0x5730e0[_0x8821('0x32')]['includeAll']){_0x4b4459[_0x8821('0x43')]=[{'all':!![]}];}_0x4b4459=_[_0x8821('0x3e')]({},_0x4b4459,_0x5730e0[_0x8821('0x49')]);return db[_0x8821('0x41')][_0x8821('0x4f')](_0x4b4459)[_0x8821('0x27')](handleEntityNotFound(_0x5a5f9a,null))[_0x8821('0x27')](function(_0x41540b){if(_0x41540b){var _0x7aece8=_0x41540b['get']({'plain':!![]});_0x7aece8=qs[_0x8821('0x54')](_0x7aece8,['id',_0x8821('0x55'),_0x8821('0x56')]);_0x5730e0['body']=_['omit'](_0x5730e0[_0x8821('0x57')],['id',_0x8821('0x55'),_0x8821('0x56')]);return db[_0x8821('0x41')][_0x8821('0x4a')](_['merge'](_0x7aece8,_0x5730e0['body']),{'include':_0x5730e0[_0x8821('0x32')][_0x8821('0x42')]?[{'all':!![]}]:undefined})[_0x8821('0x27')](function(_0x3d29cd){var _0x3a8ffe=_0x5730e0[_0x8821('0x4d')][_0x8821('0x4e')]({'plain':!![]});if(!_0x3a8ffe)throw new Error(_0x8821('0x4b'));if(_0x3a8ffe[_0x8821('0x4c')]===_0x8821('0x4d')){var _0x155bc3=_0x3d29cd[_0x8821('0x4e')]({'plain':!![]});var _0x57d103=_0x8821('0x29');return db[_0x8821('0x58')][_0x8821('0x4f')]({'where':{'name':_0x57d103,'userProfileId':_0x3a8ffe['userProfileId']},'raw':!![]})['then'](function(_0x41670a){if(_0x41670a&&_0x41670a[_0x8821('0x51')]===0x0){return db[_0x8821('0x59')][_0x8821('0x4a')]({'name':_0x155bc3[_0x8821('0x2b')],'resourceId':_0x155bc3['id'],'type':_0x41670a[_0x8821('0x2b')],'sectionId':_0x41670a['id']},{})[_0x8821('0x27')](function(){return _0x3d29cd;});}else{return _0x3d29cd;}})['catch'](function(_0x1d4f2d){logger[_0x8821('0x52')](_0x8821('0x5a'),_0x1d4f2d);throw _0x1d4f2d;});}return _0x3d29cd;});}})[_0x8821('0x27')](respondWithResult(_0x5a5f9a,0xc9))['catch'](handleError(_0x5a5f9a,null));};exports[_0x8821('0x26')]=function(_0x40d3c7,_0x4ca0c5){if(_0x40d3c7['body']['id']){delete _0x40d3c7[_0x8821('0x57')]['id'];}return db[_0x8821('0x41')][_0x8821('0x4f')]({'where':{'id':_0x40d3c7[_0x8821('0x48')]['id']}})[_0x8821('0x27')](handleEntityNotFound(_0x4ca0c5,null))[_0x8821('0x27')](saveUpdates(_0x40d3c7[_0x8821('0x57')],null))['then'](respondWithResult(_0x4ca0c5,null))[_0x8821('0x46')](handleError(_0x4ca0c5,null));};exports[_0x8821('0x28')]=function(_0xca2b44,_0x57f3c5){return db['Campaign'][_0x8821('0x4f')]({'where':{'id':_0xca2b44[_0x8821('0x48')]['id']}})[_0x8821('0x27')](handleEntityNotFound(_0x57f3c5,null))[_0x8821('0x27')](removeEntity(_0x57f3c5,null))[_0x8821('0x46')](handleError(_0x57f3c5,null));};exports[_0x8821('0x5b')]=function(_0x40534f,_0x2927f0,_0x31a21d){var _0x213139={'raw':!![],'where':{}};var _0x4ef264={};var _0x1c5e40={'count':0x0,'rows':[]};return db['Campaign'][_0x8821('0x5c')]({'where':{'id':_0x40534f[_0x8821('0x48')]['id']}})[_0x8821('0x27')](handleEntityNotFound(_0x2927f0,null))[_0x8821('0x27')](function(_0x5b0437){if(_0x5b0437){_0x4ef264['model']=_[_0x8821('0x33')](db['CmHopper'][_0x8821('0x2f')]);_0x4ef264['query']=_[_0x8821('0x33')](_0x40534f[_0x8821('0x32')]);_0x4ef264[_0x8821('0x34')]=_[_0x8821('0x37')](_0x4ef264[_0x8821('0x35')],_0x4ef264[_0x8821('0x32')]);_0x213139[_0x8821('0x36')]=_[_0x8821('0x37')](_0x4ef264[_0x8821('0x35')],qs[_0x8821('0x38')](_0x40534f[_0x8821('0x32')]['fields']));_0x213139[_0x8821('0x36')]=_0x213139[_0x8821('0x36')][_0x8821('0x39')]?_0x213139['attributes']:_0x4ef264[_0x8821('0x35')];if(!_0x40534f[_0x8821('0x32')][_0x8821('0x3a')](_0x8821('0x5d'))){_0x213139[_0x8821('0x1e')]=qs[_0x8821('0x1e')](_0x40534f[_0x8821('0x32')][_0x8821('0x1e')]);_0x213139['offset']=qs['offset'](_0x40534f[_0x8821('0x32')][_0x8821('0x20')]);}_0x213139[_0x8821('0x3b')]=qs['sort'](_0x40534f['query']['sort']);_0x213139['where']=qs[_0x8821('0x34')](_[_0x8821('0x3d')](_0x40534f[_0x8821('0x32')],_0x4ef264[_0x8821('0x34')]));_0x213139[_0x8821('0x3f')][_0x8821('0x5e')]=_0x5b0437['id'];if(_0x40534f['query'][_0x8821('0x5f')]){_0x213139['where']=_[_0x8821('0x3e')](_0x213139[_0x8821('0x3f')],{'$or':_[_0x8821('0x2e')](_0x213139[_0x8821('0x36')],function(_0x2ff94e){var _0x36094a={};_0x36094a[_0x2ff94e]={'$like':'%'+_0x40534f[_0x8821('0x32')][_0x8821('0x5f')]+'%'};return _0x36094a;})});}_0x213139=_['merge']({},_0x213139,_0x40534f['options']);return db[_0x8821('0x60')][_0x8821('0x21')]({'where':_0x213139['where']})[_0x8821('0x27')](function(_0xd20d4a){_0x1c5e40['count']=_0xd20d4a;if(_0x40534f[_0x8821('0x32')][_0x8821('0x42')]){_0x213139[_0x8821('0x43')]=[{'all':!![]}];}return db[_0x8821('0x60')][_0x8821('0x44')](_0x213139);})[_0x8821('0x27')](function(_0x1e2bd5){_0x1c5e40[_0x8821('0x45')]=_0x1e2bd5;return _0x1c5e40;});}})['then'](respondWithFilteredResult(_0x2927f0,_0x213139))[_0x8821('0x46')](handleError(_0x2927f0,null));};exports['getHopperHistories']=function(_0x1293f0,_0x35f326,_0x3ae5d4){var _0xf50dfb={'raw':!![],'where':{}};var _0x38f20c={};var _0x5d9fc9={'count':0x0,'rows':[]};return db[_0x8821('0x41')][_0x8821('0x5c')]({'where':{'id':_0x1293f0[_0x8821('0x48')]['id']}})[_0x8821('0x27')](handleEntityNotFound(_0x35f326,null))[_0x8821('0x27')](function(_0x497b11){if(_0x497b11){_0x38f20c[_0x8821('0x35')]=_['keys'](db[_0x8821('0x61')][_0x8821('0x2f')]);_0x38f20c[_0x8821('0x32')]=_[_0x8821('0x33')](_0x1293f0[_0x8821('0x32')]);_0x38f20c[_0x8821('0x34')]=_['intersection'](_0x38f20c[_0x8821('0x35')],_0x38f20c['query']);_0xf50dfb[_0x8821('0x36')]=_['intersection'](_0x38f20c[_0x8821('0x35')],qs[_0x8821('0x38')](_0x1293f0[_0x8821('0x32')][_0x8821('0x38')]));_0xf50dfb[_0x8821('0x36')]=_0xf50dfb['attributes'][_0x8821('0x39')]?_0xf50dfb['attributes']:_0x38f20c[_0x8821('0x35')];if(!_0x1293f0[_0x8821('0x32')][_0x8821('0x3a')](_0x8821('0x5d'))){_0xf50dfb['limit']=qs[_0x8821('0x1e')](_0x1293f0[_0x8821('0x32')][_0x8821('0x1e')]);_0xf50dfb[_0x8821('0x20')]=qs[_0x8821('0x20')](_0x1293f0[_0x8821('0x32')][_0x8821('0x20')]);}_0xf50dfb[_0x8821('0x3b')]=qs[_0x8821('0x3c')](_0x1293f0[_0x8821('0x32')][_0x8821('0x3c')]);_0xf50dfb[_0x8821('0x3f')]=qs[_0x8821('0x34')](_[_0x8821('0x3d')](_0x1293f0['query'],_0x38f20c[_0x8821('0x34')]));_0xf50dfb['where'][_0x8821('0x5e')]=_0x497b11['id'];if(_0x1293f0[_0x8821('0x32')][_0x8821('0x5f')]){_0xf50dfb['where']=_[_0x8821('0x3e')](_0xf50dfb[_0x8821('0x3f')],{'$or':_[_0x8821('0x2e')](_0xf50dfb[_0x8821('0x36')],function(_0x26efde){var _0x5848fc={};_0x5848fc[_0x26efde]={'$like':'%'+_0x1293f0[_0x8821('0x32')][_0x8821('0x5f')]+'%'};return _0x5848fc;})});}_0xf50dfb=_[_0x8821('0x3e')]({},_0xf50dfb,_0x1293f0[_0x8821('0x49')]);return db[_0x8821('0x61')]['count']({'where':_0xf50dfb['where']})[_0x8821('0x27')](function(_0x103cd6){_0x5d9fc9['count']=_0x103cd6;if(_0x1293f0[_0x8821('0x32')]['includeAll']){_0xf50dfb['include']=[{'all':!![]}];}return db[_0x8821('0x61')]['findAll'](_0xf50dfb);})[_0x8821('0x27')](function(_0x4b8215){_0x5d9fc9[_0x8821('0x45')]=_0x4b8215;return _0x5d9fc9;});}})['then'](respondWithFilteredResult(_0x35f326,_0xf50dfb))[_0x8821('0x46')](handleError(_0x35f326,null));};exports[_0x8821('0x62')]=function(_0x1dbe09,_0x3b41ee,_0x182442){var _0x2373b7={'raw':!![],'where':{}};var _0x37f65a={};var _0x939516={'count':0x0,'rows':[]};return db[_0x8821('0x41')][_0x8821('0x5c')]({'where':{'id':_0x1dbe09[_0x8821('0x48')]['id']}})[_0x8821('0x27')](handleEntityNotFound(_0x3b41ee,null))['then'](function(_0x1ec427){if(_0x1ec427){_0x37f65a[_0x8821('0x35')]=_['keys'](db[_0x8821('0x63')][_0x8821('0x2f')]);_0x37f65a['query']=_[_0x8821('0x33')](_0x1dbe09[_0x8821('0x32')]);_0x37f65a[_0x8821('0x34')]=_[_0x8821('0x37')](_0x37f65a[_0x8821('0x35')],_0x37f65a[_0x8821('0x32')]);_0x2373b7[_0x8821('0x36')]=_[_0x8821('0x37')](_0x37f65a[_0x8821('0x35')],qs[_0x8821('0x38')](_0x1dbe09[_0x8821('0x32')]['fields']));_0x2373b7[_0x8821('0x36')]=_0x2373b7['attributes'][_0x8821('0x39')]?_0x2373b7[_0x8821('0x36')]:_0x37f65a[_0x8821('0x35')];if(!_0x1dbe09['query']['hasOwnProperty']('nolimit')){_0x2373b7[_0x8821('0x1e')]=qs[_0x8821('0x1e')](_0x1dbe09[_0x8821('0x32')][_0x8821('0x1e')]);_0x2373b7[_0x8821('0x20')]=qs['offset'](_0x1dbe09[_0x8821('0x32')][_0x8821('0x20')]);}_0x2373b7[_0x8821('0x3b')]=qs['sort'](_0x1dbe09['query'][_0x8821('0x3c')]);_0x2373b7[_0x8821('0x3f')]=qs['filters'](_[_0x8821('0x3d')](_0x1dbe09[_0x8821('0x32')],_0x37f65a[_0x8821('0x34')]));_0x2373b7[_0x8821('0x3f')][_0x8821('0x5e')]=_0x1ec427['id'];if(_0x1dbe09['query'][_0x8821('0x5f')]){_0x2373b7['where']=_[_0x8821('0x3e')](_0x2373b7[_0x8821('0x3f')],{'$or':_[_0x8821('0x2e')](_0x2373b7[_0x8821('0x36')],function(_0x24a4c1){var _0x43efff={};_0x43efff[_0x24a4c1]={'$like':'%'+_0x1dbe09[_0x8821('0x32')]['filter']+'%'};return _0x43efff;})});}_0x2373b7=_[_0x8821('0x3e')]({},_0x2373b7,_0x1dbe09[_0x8821('0x49')]);return db[_0x8821('0x63')][_0x8821('0x21')]({'where':_0x2373b7[_0x8821('0x3f')]})[_0x8821('0x27')](function(_0x1c3f41){_0x939516[_0x8821('0x21')]=_0x1c3f41;if(_0x1dbe09['query'][_0x8821('0x42')]){_0x2373b7['include']=[{'all':!![]}];}return db[_0x8821('0x63')][_0x8821('0x44')](_0x2373b7);})['then'](function(_0x4c3e46){_0x939516[_0x8821('0x45')]=_0x4c3e46;return _0x939516;});}})[_0x8821('0x27')](respondWithFilteredResult(_0x3b41ee,_0x2373b7))[_0x8821('0x46')](handleError(_0x3b41ee,null));};exports[_0x8821('0x64')]=function(_0x43c5d2,_0x313409,_0x1c29dd){var _0x502dc2={'raw':!![],'where':{}};var _0x437a38={};var _0x2f531e={'count':0x0,'rows':[]};return db[_0x8821('0x41')][_0x8821('0x5c')]({'where':{'id':_0x43c5d2[_0x8821('0x48')]['id']}})['then'](handleEntityNotFound(_0x313409,null))['then'](function(_0x128912){if(_0x128912){_0x437a38['model']=_[_0x8821('0x33')](db['CmHopperBlack']['rawAttributes']);_0x437a38[_0x8821('0x32')]=_[_0x8821('0x33')](_0x43c5d2['query']);_0x437a38['filters']=_['intersection'](_0x437a38[_0x8821('0x35')],_0x437a38['query']);_0x502dc2[_0x8821('0x36')]=_[_0x8821('0x37')](_0x437a38[_0x8821('0x35')],qs[_0x8821('0x38')](_0x43c5d2['query']['fields']));_0x502dc2[_0x8821('0x36')]=_0x502dc2[_0x8821('0x36')][_0x8821('0x39')]?_0x502dc2[_0x8821('0x36')]:_0x437a38[_0x8821('0x35')];if(!_0x43c5d2[_0x8821('0x32')][_0x8821('0x3a')](_0x8821('0x5d'))){_0x502dc2[_0x8821('0x1e')]=qs['limit'](_0x43c5d2[_0x8821('0x32')][_0x8821('0x1e')]);_0x502dc2[_0x8821('0x20')]=qs['offset'](_0x43c5d2['query'][_0x8821('0x20')]);}_0x502dc2[_0x8821('0x3b')]=qs[_0x8821('0x3c')](_0x43c5d2[_0x8821('0x32')][_0x8821('0x3c')]);_0x502dc2['where']=qs[_0x8821('0x34')](_[_0x8821('0x3d')](_0x43c5d2[_0x8821('0x32')],_0x437a38[_0x8821('0x34')]));_0x502dc2[_0x8821('0x3f')][_0x8821('0x5e')]=_0x128912['id'];if(_0x43c5d2[_0x8821('0x32')][_0x8821('0x5f')]){_0x502dc2[_0x8821('0x3f')]=_['merge'](_0x502dc2[_0x8821('0x3f')],{'$or':_[_0x8821('0x2e')](_0x502dc2[_0x8821('0x36')],function(_0x586a05){var _0x4d4440={};_0x4d4440[_0x586a05]={'$like':'%'+_0x43c5d2[_0x8821('0x32')][_0x8821('0x5f')]+'%'};return _0x4d4440;})});}_0x502dc2=_[_0x8821('0x3e')]({},_0x502dc2,_0x43c5d2['options']);return db['CmHopperBlack']['count']({'where':_0x502dc2['where']})['then'](function(_0x176836){_0x2f531e['count']=_0x176836;if(_0x43c5d2['query'][_0x8821('0x42')]){_0x502dc2[_0x8821('0x43')]=[{'all':!![]}];}return db[_0x8821('0x65')][_0x8821('0x44')](_0x502dc2);})[_0x8821('0x27')](function(_0x49d0e1){_0x2f531e[_0x8821('0x45')]=_0x49d0e1;return _0x2f531e;});}})[_0x8821('0x27')](respondWithFilteredResult(_0x313409,_0x502dc2))['catch'](handleError(_0x313409,null));};exports['getLists']=function(_0x34fb98,_0x50c79a,_0x16b5d1){var _0x28190d={};var _0x14dd5b={};var _0x4001ec;var _0x183a98;return db[_0x8821('0x41')]['findOne']({'where':{'id':_0x34fb98[_0x8821('0x48')]['id']}})['then'](handleEntityNotFound(_0x50c79a,null))[_0x8821('0x27')](function(_0x1a07bc){if(_0x1a07bc){_0x4001ec=_0x1a07bc;_0x14dd5b[_0x8821('0x35')]=_[_0x8821('0x33')](db['CmList'][_0x8821('0x2f')]);_0x14dd5b[_0x8821('0x32')]=_[_0x8821('0x33')](_0x34fb98[_0x8821('0x32')]);_0x14dd5b[_0x8821('0x34')]=_['intersection'](_0x14dd5b['model'],_0x14dd5b['query']);_0x28190d[_0x8821('0x36')]=_[_0x8821('0x37')](_0x14dd5b[_0x8821('0x35')],qs[_0x8821('0x38')](_0x34fb98[_0x8821('0x32')][_0x8821('0x38')]));_0x28190d[_0x8821('0x36')]=_0x28190d[_0x8821('0x36')]['length']?_0x28190d[_0x8821('0x36')]:_0x14dd5b[_0x8821('0x35')];_0x28190d[_0x8821('0x3b')]=qs['sort'](_0x34fb98[_0x8821('0x32')][_0x8821('0x3c')]);_0x28190d[_0x8821('0x3f')]=qs[_0x8821('0x34')](_['pick'](_0x34fb98[_0x8821('0x32')],_0x14dd5b[_0x8821('0x34')]));if(_0x34fb98[_0x8821('0x32')][_0x8821('0x5f')]){_0x28190d[_0x8821('0x3f')]=_[_0x8821('0x3e')](_0x28190d[_0x8821('0x3f')],{'$or':_[_0x8821('0x2e')](_0x28190d[_0x8821('0x36')],function(_0xf5b414){var _0x4321ba={};_0x4321ba[_0xf5b414]={'$like':'%'+_0x34fb98['query']['filter']+'%'};return _0x4321ba;})});}_0x28190d=_[_0x8821('0x3e')]({},_0x28190d,_0x34fb98[_0x8821('0x49')]);return _0x4001ec['getLists'](_0x28190d);}})['then'](function(_0x5c3471){if(_0x5c3471){_0x183a98=_0x5c3471[_0x8821('0x39')];if(!_0x34fb98[_0x8821('0x32')][_0x8821('0x3a')](_0x8821('0x5d'))){_0x28190d[_0x8821('0x1e')]=qs[_0x8821('0x1e')](_0x34fb98[_0x8821('0x32')][_0x8821('0x1e')]);_0x28190d['offset']=qs[_0x8821('0x20')](_0x34fb98[_0x8821('0x32')][_0x8821('0x20')]);}return _0x4001ec[_0x8821('0x66')](_0x28190d);}})[_0x8821('0x27')](function(_0x1ca8f7){if(_0x1ca8f7){return _0x1ca8f7?{'count':_0x183a98,'rows':_0x1ca8f7}:null;}})[_0x8821('0x27')](respondWithResult(_0x50c79a,null))['catch'](handleError(_0x50c79a,null));};exports[_0x8821('0x67')]=function(_0x52d6b9,_0x528996,_0x1afe88){var _0x13260c,_0xfff988;return db['Campaign'][_0x8821('0x4f')]({'where':{'id':_0x52d6b9[_0x8821('0x48')]['id']}})[_0x8821('0x27')](handleEntityNotFound(_0x528996,null))['then'](function(_0x2a5151){if(_0x2a5151){_0xfff988=_0x2a5151;return _0x2a5151['addLists'](_0x52d6b9['body'][_0x8821('0x68')],_['omit'](_0x52d6b9[_0x8821('0x57')],[_0x8821('0x68'),'id'])||{});}return null;})[_0x8821('0x69')](function(_0x466550){var _0x459446;_0x13260c=_0x466550||[];var _0x15cc7d=[];if(_0x466550){for(var _0x556ded=0x0;_0x556ded<_0x466550['length'];_0x556ded+=0x1){var _0x54f1b4=_0x466550[_0x556ded]['get']({'plain':!![]});_0xfff988['dialCheckDuplicateType']=_0x52d6b9['body'][_0x8821('0x6a')]?_0x52d6b9['body'][_0x8821('0x6a')]:_0xfff988[_0x8821('0x6a')];switch(_0xfff988['dialCheckDuplicateType']){case _0x8821('0x6b'):_0x459446=squel[_0x8821('0x6c')]()[_0x8821('0x6d')](_0x8821('0x6e'))[_0x8821('0x6f')]([_0x8821('0x70'),'scheduledAt',_0x8821('0x71'),_0x8821('0x72'),'CampaignId',_0x8821('0x55'),_0x8821('0x56')],squel[_0x8821('0x73')]()[_0x8821('0x74')](_0x8821('0x70'),_0x8821('0x70'))[_0x8821('0x74')]('NOW()','scheduledAt')[_0x8821('0x74')]('id',_0x8821('0x71'))[_0x8821('0x74')](_0x54f1b4[_0x8821('0x75')][_0x8821('0x76')](),_0x8821('0x72'))[_0x8821('0x74')](_0x52d6b9[_0x8821('0x48')]['id'][_0x8821('0x76')](),_0x8821('0x5e'))['field'](_0x8821('0x77'),_0x8821('0x55'))['field']('NOW()',_0x8821('0x56'))[_0x8821('0x78')]('cm_contacts')[_0x8821('0x3f')]('deletedAt\x20IS\x20NULL')[_0x8821('0x3f')](_0x8821('0x79'),_0x54f1b4[_0x8821('0x75')][_0x8821('0x76')]())[_0x8821('0x3f')](_0x8821('0x7a'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x8821('0x73')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x8821('0x78')](_0x8821('0x7b'))[_0x8821('0x3f')](_0x8821('0x7c'),_0x52d6b9[_0x8821('0x48')]['id'][_0x8821('0x76')]()))['where'](_0x8821('0x7d'),squel[_0x8821('0x73')]()[_0x8821('0x74')](_0x8821('0x7e'))[_0x8821('0x78')](_0x8821('0x6e'))[_0x8821('0x3f')]('CampaignId\x20=\x20?',_0x52d6b9[_0x8821('0x48')]['id'][_0x8821('0x76')]())))[_0x8821('0x76')]();break;case _0x8821('0x7f'):_0x459446=squel[_0x8821('0x6c')]()[_0x8821('0x6d')](_0x8821('0x6e'))[_0x8821('0x6f')](['phone',_0x8821('0x80'),'ContactId',_0x8821('0x72'),_0x8821('0x5e'),_0x8821('0x55'),_0x8821('0x56')],squel[_0x8821('0x73')]()[_0x8821('0x74')](_0x8821('0x70'),'phone')['field'](_0x8821('0x77'),_0x8821('0x80'))[_0x8821('0x74')]('id','ContactId')[_0x8821('0x74')](_0x54f1b4['CmListId'][_0x8821('0x76')](),_0x8821('0x72'))[_0x8821('0x74')](_0x52d6b9[_0x8821('0x48')]['id'][_0x8821('0x76')](),'CampaignId')[_0x8821('0x74')](_0x8821('0x77'),_0x8821('0x55'))[_0x8821('0x74')](_0x8821('0x77'),_0x8821('0x56'))[_0x8821('0x78')](_0x8821('0x81'))[_0x8821('0x3f')]('deletedAt\x20IS\x20NULL')[_0x8821('0x3f')](_0x8821('0x79'),_0x54f1b4[_0x8821('0x75')][_0x8821('0x76')]())[_0x8821('0x3f')](_0x8821('0x7a'))['where'](_0x8821('0x7d'),squel['select']()[_0x8821('0x74')]('COALESCE(phone,\x27\x27)')['from'](_0x8821('0x6e'))[_0x8821('0x3f')](_0x8821('0x7c'),_0x52d6b9[_0x8821('0x48')]['id'][_0x8821('0x76')]())))[_0x8821('0x76')]();break;default:_0x459446=squel[_0x8821('0x6c')]()[_0x8821('0x6d')](_0x8821('0x6e'))[_0x8821('0x6f')]([_0x8821('0x70'),_0x8821('0x80'),'ContactId',_0x8821('0x72'),_0x8821('0x5e'),_0x8821('0x55'),_0x8821('0x56')],squel[_0x8821('0x73')]()[_0x8821('0x74')]('phone',_0x8821('0x70'))[_0x8821('0x74')](_0x8821('0x77'),_0x8821('0x80'))[_0x8821('0x74')]('id',_0x8821('0x71'))[_0x8821('0x74')](_0x54f1b4[_0x8821('0x75')][_0x8821('0x76')](),_0x8821('0x72'))['field'](_0x52d6b9[_0x8821('0x48')]['id'][_0x8821('0x76')](),'CampaignId')[_0x8821('0x74')]('NOW()',_0x8821('0x55'))['field'](_0x8821('0x77'),_0x8821('0x56'))[_0x8821('0x78')](_0x8821('0x81'))[_0x8821('0x3f')](_0x8821('0x82'))[_0x8821('0x3f')](_0x8821('0x79'),_0x54f1b4[_0x8821('0x75')]['toString']())['where'](_0x8821('0x7a')))[_0x8821('0x76')]();}_0x15cc7d[_0x8821('0x83')](db[_0x8821('0x84')]['query'](_0x459446));}return BPromise[_0x8821('0x85')](_0x15cc7d);}})[_0x8821('0x27')](function(){return _0x13260c;})[_0x8821('0x27')](respondWithResult(_0x528996,null))[_0x8821('0x46')](handleError(_0x528996,null));};exports[_0x8821('0x86')]=function(_0x50a571,_0x5a328e,_0x564f0c){return db[_0x8821('0x41')][_0x8821('0x4f')]({'where':{'id':_0x50a571[_0x8821('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a328e,null))[_0x8821('0x27')](function(_0x4aded3){if(_0x4aded3){return _0x4aded3[_0x8821('0x86')](_0x50a571[_0x8821('0x32')][_0x8821('0x68')]);}})['then'](function(_0x5aa842){if(_0x5aa842){return db[_0x8821('0x60')][_0x8821('0x28')]({'where':{'ListId':_0x50a571[_0x8821('0x32')][_0x8821('0x68')],'CampaignId':_0x50a571['params']['id']}})['then'](function(){return _0x5aa842;});}})[_0x8821('0x27')](respondWithStatusCode(_0x5a328e,null))['catch'](handleError(_0x5a328e,null));};exports[_0x8821('0x87')]=function(_0x27d8d2,_0xeae505,_0x9417c9){var _0x57238d={};var _0x60d659={};var _0x3d32d2;var _0x2aa857;return db[_0x8821('0x41')][_0x8821('0x5c')]({'where':{'id':_0x27d8d2[_0x8821('0x48')]['id']}})[_0x8821('0x27')](handleEntityNotFound(_0xeae505,null))['then'](function(_0x2368a5){if(_0x2368a5){_0x3d32d2=_0x2368a5;_0x60d659[_0x8821('0x35')]=_[_0x8821('0x33')](db[_0x8821('0x88')][_0x8821('0x2f')]);_0x60d659['query']=_[_0x8821('0x33')](_0x27d8d2[_0x8821('0x32')]);_0x60d659[_0x8821('0x34')]=_[_0x8821('0x37')](_0x60d659['model'],_0x60d659['query']);_0x57238d[_0x8821('0x36')]=_['intersection'](_0x60d659[_0x8821('0x35')],qs['fields'](_0x27d8d2['query'][_0x8821('0x38')]));_0x57238d[_0x8821('0x36')]=_0x57238d['attributes']['length']?_0x57238d[_0x8821('0x36')]:_0x60d659['model'];_0x57238d['order']=qs[_0x8821('0x3c')](_0x27d8d2[_0x8821('0x32')][_0x8821('0x3c')]);_0x57238d['where']=qs[_0x8821('0x34')](_[_0x8821('0x3d')](_0x27d8d2[_0x8821('0x32')],_0x60d659[_0x8821('0x34')]));if(_0x27d8d2[_0x8821('0x32')][_0x8821('0x5f')]){_0x57238d[_0x8821('0x3f')]=_[_0x8821('0x3e')](_0x57238d['where'],{'$or':_[_0x8821('0x2e')](_0x57238d[_0x8821('0x36')],function(_0x509f4c){var _0x4aa0f4={};_0x4aa0f4[_0x509f4c]={'$like':'%'+_0x27d8d2[_0x8821('0x32')][_0x8821('0x5f')]+'%'};return _0x4aa0f4;})});}_0x57238d=_['merge']({},_0x57238d,_0x27d8d2['options']);return _0x3d32d2['getBlackLists'](_0x57238d);}})[_0x8821('0x27')](function(_0x1d7bb8){if(_0x1d7bb8){_0x2aa857=_0x1d7bb8[_0x8821('0x39')];if(!_0x27d8d2[_0x8821('0x32')][_0x8821('0x3a')](_0x8821('0x5d'))){_0x57238d[_0x8821('0x1e')]=qs['limit'](_0x27d8d2['query'][_0x8821('0x1e')]);_0x57238d['offset']=qs[_0x8821('0x20')](_0x27d8d2['query'][_0x8821('0x20')]);}return _0x3d32d2['getBlackLists'](_0x57238d);}})[_0x8821('0x27')](function(_0x12dfb6){if(_0x12dfb6){return _0x12dfb6?{'count':_0x2aa857,'rows':_0x12dfb6}:null;}})[_0x8821('0x27')](respondWithResult(_0xeae505,null))[_0x8821('0x46')](handleError(_0xeae505,null));};exports[_0x8821('0x89')]=function(_0x5bb60b,_0x15438f,_0x415eed){var _0x38b488,_0x3e6fcb;return db[_0x8821('0x41')][_0x8821('0x4f')]({'where':{'id':_0x5bb60b[_0x8821('0x48')]['id']}})[_0x8821('0x27')](handleEntityNotFound(_0x15438f,null))[_0x8821('0x27')](function(_0x3865b5){if(_0x3865b5){_0x3e6fcb=_0x3865b5;return _0x3865b5['addBlackLists'](_0x5bb60b[_0x8821('0x57')][_0x8821('0x68')],_[_0x8821('0x54')](_0x5bb60b[_0x8821('0x57')],[_0x8821('0x68'),'id'])||{});}return null;})[_0x8821('0x69')](function(_0x2ff7bc){var _0x5c94f5;_0x38b488=_0x2ff7bc||[];var _0x25916c=[];if(_0x2ff7bc){for(var _0x77050f=0x0;_0x77050f<_0x2ff7bc[_0x8821('0x39')];_0x77050f+=0x1){var _0x325cde=_0x2ff7bc[_0x77050f][_0x8821('0x4e')]({'plain':!![]});_0x5c94f5=squel[_0x8821('0x6c')]()['into'](_0x8821('0x8a'))['fromQuery'](['phone',_0x8821('0x71'),_0x8821('0x72'),_0x8821('0x5e'),_0x8821('0x55'),'updatedAt'],squel[_0x8821('0x73')]()['field'](_0x8821('0x70'),_0x8821('0x70'))['field']('id',_0x8821('0x71'))[_0x8821('0x74')](_0x325cde[_0x8821('0x75')][_0x8821('0x76')](),_0x8821('0x72'))[_0x8821('0x74')](_0x5bb60b[_0x8821('0x48')]['id'][_0x8821('0x76')](),'CampaignId')['field'](_0x8821('0x77'),_0x8821('0x55'))[_0x8821('0x74')](_0x8821('0x77'),_0x8821('0x56'))[_0x8821('0x78')](_0x8821('0x81'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x8821('0x79'),_0x325cde[_0x8821('0x75')]['toString']())['where'](_0x8821('0x7a')))[_0x8821('0x76')]();_0x25916c[_0x8821('0x83')](db[_0x8821('0x84')][_0x8821('0x32')](_0x5c94f5));}return BPromise['all'](_0x25916c);}})[_0x8821('0x27')](function(){return _0x38b488;})[_0x8821('0x27')](respondWithResult(_0x15438f,null))[_0x8821('0x46')](handleError(_0x15438f,null));};exports[_0x8821('0x8b')]=function(_0x5a0309,_0xbef882,_0xbdeb09){return db[_0x8821('0x41')][_0x8821('0x4f')]({'where':{'id':_0x5a0309[_0x8821('0x48')]['id']}})['then'](handleEntityNotFound(_0xbef882,null))[_0x8821('0x27')](function(_0x3d1a38){if(_0x3d1a38){return _0x3d1a38['removeBlackLists'](_0x5a0309['query'][_0x8821('0x68')]);}})['then'](function(_0x5bcdb2){if(_0x5bcdb2){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x5a0309['query'][_0x8821('0x68')],'CampaignId':_0x5a0309['params']['id']}})[_0x8821('0x27')](function(){return _0x5bcdb2;});}})[_0x8821('0x27')](respondWithStatusCode(_0xbef882,null))[_0x8821('0x46')](handleError(_0xbef882,null));}; \ No newline at end of file +var _0xb9d4=['onlyIfOpen','insert','into','fromQuery','cm_contacts','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','offset','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','error','index','map','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','Campaign','count','includeAll','include','findAll','catch','show','rawAttributes','options','create','body','user','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','fields','omit','updatedAt','createdAt','role','userProfileId','params','getHoppers','findOne','CmHopper','order','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','rows','CmList','getLists','addLists','ids','dialCheckDuplicateType','always','cm_hopper','scheduledAt','ContactId','select','field','phone','NOW()','CmListId','ListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)'];(function(_0x2a608d,_0x298459){var _0x1bee3e=function(_0x989a39){while(--_0x989a39){_0x2a608d['push'](_0x2a608d['shift']());}};_0x1bee3e(++_0x298459);}(_0xb9d4,0x1a0));var _0x4b9d=function(_0x3223a2,_0x3892c9){_0x3223a2=_0x3223a2-0x0;var _0x339c94=_0xb9d4[_0x3223a2];return _0x339c94;};'use strict';var emlformat=require(_0x4b9d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b9d('0x1'));var jsonpatch=require(_0x4b9d('0x2'));var rp=require(_0x4b9d('0x3'));var moment=require(_0x4b9d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4b9d('0x5'));var util=require(_0x4b9d('0x6'));var path=require('path');var sox=require(_0x4b9d('0x7'));var csv=require(_0x4b9d('0x8'));var ejs=require(_0x4b9d('0x9'));var fs=require('fs');var fs_extra=require(_0x4b9d('0xa'));var _=require('lodash');var squel=require(_0x4b9d('0xb'));var crypto=require('crypto');var jsforce=require(_0x4b9d('0xc'));var deskjs=require(_0x4b9d('0xd'));var toCsv=require(_0x4b9d('0x8'));var querystring=require(_0x4b9d('0xe'));var Papa=require(_0x4b9d('0xf'));var Redis=require(_0x4b9d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b9d('0x11'))(_0x4b9d('0x12'));var utils=require(_0x4b9d('0x13'));var config=require(_0x4b9d('0x14'));var licenseUtil=require(_0x4b9d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19dcec,_0x15f515){_0x15f515=_0x15f515||0xcc;return function(_0x50d418){if(_0x50d418){return _0x19dcec[_0x4b9d('0x16')](_0x15f515);}return _0x19dcec[_0x4b9d('0x17')](_0x15f515)[_0x4b9d('0x18')]();};}function respondWithResult(_0x39e59d,_0x40abec){_0x40abec=_0x40abec||0xc8;return function(_0x5a9bc1){if(_0x5a9bc1){return _0x39e59d[_0x4b9d('0x17')](_0x40abec)['json'](_0x5a9bc1);}};}function respondWithFilteredResult(_0x56b42e,_0x12d6ef){return function(_0x228500){if(_0x228500){var _0x478883=typeof _0x12d6ef['offset']===_0x4b9d('0x19')&&typeof _0x12d6ef[_0x4b9d('0x1a')]==='undefined';var _0x57efde=_0x228500['count'];var _0x2d6383=_0x478883?0x0:_0x12d6ef['offset'];var _0x448b0a=_0x478883?_0x228500['count']:_0x12d6ef[_0x4b9d('0x1b')]+_0x12d6ef[_0x4b9d('0x1a')];var _0x514f4a;if(_0x448b0a>=_0x57efde){_0x448b0a=_0x57efde;_0x514f4a=0xc8;}else{_0x514f4a=0xce;}_0x56b42e[_0x4b9d('0x17')](_0x514f4a);return _0x56b42e['set'](_0x4b9d('0x1c'),_0x2d6383+'-'+_0x448b0a+'/'+_0x57efde)['json'](_0x228500);}return null;};}function patchUpdates(_0x17c38d){return function(_0x1de42a){try{jsonpatch[_0x4b9d('0x1d')](_0x1de42a,_0x17c38d,!![]);}catch(_0x192cd4){return BPromise[_0x4b9d('0x1e')](_0x192cd4);}return _0x1de42a['save']();};}function saveUpdates(_0xfc23b0,_0x23111d){return function(_0x2c29bb){if(_0x2c29bb){return _0x2c29bb[_0x4b9d('0x1f')](_0xfc23b0)[_0x4b9d('0x20')](function(_0x873c7a){return _0x873c7a;});}return null;};}function removeEntity(_0x11c7ad,_0x276240){return function(_0xe05d64){if(_0xe05d64){return _0xe05d64[_0x4b9d('0x21')]()[_0x4b9d('0x20')](function(){var _0x475fff=_0xe05d64[_0x4b9d('0x22')]({'plain':!![]});var _0x3fa29c=_0x4b9d('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x3fa29c,'resourceId':_0x475fff['id']}})[_0x4b9d('0x20')](function(){return _0xe05d64;});})[_0x4b9d('0x20')](function(){_0x11c7ad[_0x4b9d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x275ef8,_0x14e796){return function(_0x192c82){if(!_0x192c82){_0x275ef8[_0x4b9d('0x16')](0x194);}return _0x192c82;};}function handleError(_0x3c8e72,_0x44ea45){_0x44ea45=_0x44ea45||0x1f4;return function(_0x2261ff){logger[_0x4b9d('0x24')](_0x2261ff['stack']);if(_0x2261ff['name']){delete _0x2261ff['name'];}_0x3c8e72[_0x4b9d('0x17')](_0x44ea45)['send'](_0x2261ff);};}exports[_0x4b9d('0x25')]=function(_0x539c9c,_0x10113f){var _0x3ae319={},_0x247707={},_0x2c52d5={'count':0x0,'rows':[]};var _0x5275a7=_[_0x4b9d('0x26')](db['Campaign']['rawAttributes'],function(_0x12c6a1){return{'name':_0x12c6a1[_0x4b9d('0x27')],'type':_0x12c6a1[_0x4b9d('0x28')][_0x4b9d('0x29')]};});_0x247707['model']=_[_0x4b9d('0x26')](_0x5275a7,_0x4b9d('0x2a'));_0x247707[_0x4b9d('0x2b')]=_[_0x4b9d('0x2c')](_0x539c9c[_0x4b9d('0x2b')]);_0x247707[_0x4b9d('0x2d')]=_[_0x4b9d('0x2e')](_0x247707[_0x4b9d('0x2f')],_0x247707[_0x4b9d('0x2b')]);_0x3ae319[_0x4b9d('0x30')]=_['intersection'](_0x247707['model'],qs['fields'](_0x539c9c[_0x4b9d('0x2b')]['fields']));_0x3ae319['attributes']=_0x3ae319[_0x4b9d('0x30')][_0x4b9d('0x31')]?_0x3ae319['attributes']:_0x247707[_0x4b9d('0x2f')];if(!_0x539c9c[_0x4b9d('0x2b')][_0x4b9d('0x32')](_0x4b9d('0x33'))){_0x3ae319['limit']=qs[_0x4b9d('0x1a')](_0x539c9c[_0x4b9d('0x2b')][_0x4b9d('0x1a')]);_0x3ae319[_0x4b9d('0x1b')]=qs[_0x4b9d('0x1b')](_0x539c9c[_0x4b9d('0x2b')][_0x4b9d('0x1b')]);}_0x3ae319['order']=qs['sort'](_0x539c9c[_0x4b9d('0x2b')][_0x4b9d('0x34')]);_0x3ae319[_0x4b9d('0x35')]=qs[_0x4b9d('0x2d')](_[_0x4b9d('0x36')](_0x539c9c[_0x4b9d('0x2b')],_0x247707[_0x4b9d('0x2d')]),_0x5275a7);if(_0x539c9c[_0x4b9d('0x2b')][_0x4b9d('0x37')]){_0x3ae319[_0x4b9d('0x35')]=_[_0x4b9d('0x38')](_0x3ae319['where'],{'$or':_[_0x4b9d('0x26')](_0x5275a7,function(_0x4d65b8){if(_0x4d65b8[_0x4b9d('0x28')]!==_0x4b9d('0x39')){var _0x4cb119={};_0x4cb119[_0x4d65b8[_0x4b9d('0x2a')]]={'$like':'%'+_0x539c9c[_0x4b9d('0x2b')][_0x4b9d('0x37')]+'%'};return _0x4cb119;}})});}_0x3ae319=_[_0x4b9d('0x38')]({},_0x3ae319,_0x539c9c['options']);var _0x27ef0e={'where':_0x3ae319[_0x4b9d('0x35')]};return db[_0x4b9d('0x3a')][_0x4b9d('0x3b')](_0x27ef0e)['then'](function(_0x49d076){_0x2c52d5['count']=_0x49d076;if(_0x539c9c[_0x4b9d('0x2b')][_0x4b9d('0x3c')]){_0x3ae319[_0x4b9d('0x3d')]=[{'all':!![]}];}return db['Campaign'][_0x4b9d('0x3e')](_0x3ae319);})[_0x4b9d('0x20')](function(_0x31cc04){_0x2c52d5['rows']=_0x31cc04;return _0x2c52d5;})[_0x4b9d('0x20')](respondWithFilteredResult(_0x10113f,_0x3ae319))[_0x4b9d('0x3f')](handleError(_0x10113f,null));};exports[_0x4b9d('0x40')]=function(_0x8113da,_0x676d01){var _0x5d1a69={'raw':![],'where':{'id':_0x8113da['params']['id']}},_0x5a25dd={};_0x5a25dd[_0x4b9d('0x2f')]=_['keys'](db[_0x4b9d('0x3a')][_0x4b9d('0x41')]);_0x5a25dd['query']=_[_0x4b9d('0x2c')](_0x8113da['query']);_0x5a25dd['filters']=_[_0x4b9d('0x2e')](_0x5a25dd['model'],_0x5a25dd[_0x4b9d('0x2b')]);_0x5d1a69[_0x4b9d('0x30')]=_[_0x4b9d('0x2e')](_0x5a25dd['model'],qs['fields'](_0x8113da[_0x4b9d('0x2b')]['fields']));_0x5d1a69[_0x4b9d('0x30')]=_0x5d1a69[_0x4b9d('0x30')][_0x4b9d('0x31')]?_0x5d1a69[_0x4b9d('0x30')]:_0x5a25dd[_0x4b9d('0x2f')];if(_0x8113da[_0x4b9d('0x2b')][_0x4b9d('0x3c')]){_0x5d1a69[_0x4b9d('0x3d')]=[{'all':!![]}];}_0x5d1a69=_[_0x4b9d('0x38')]({},_0x5d1a69,_0x8113da[_0x4b9d('0x42')]);return db[_0x4b9d('0x3a')]['find'](_0x5d1a69)[_0x4b9d('0x20')](handleEntityNotFound(_0x676d01,null))[_0x4b9d('0x20')](respondWithResult(_0x676d01,null))[_0x4b9d('0x3f')](handleError(_0x676d01,null));};exports[_0x4b9d('0x43')]=function(_0x4fd27a,_0x39ae81){return db[_0x4b9d('0x3a')]['create'](_0x4fd27a[_0x4b9d('0x44')],{})[_0x4b9d('0x20')](function(_0x42f516){var _0x4c1ea5=_0x4fd27a[_0x4b9d('0x45')][_0x4b9d('0x22')]({'plain':!![]});if(!_0x4c1ea5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c1ea5['role']==='user'){var _0x316648=_0x42f516[_0x4b9d('0x22')]({'plain':!![]});var _0x56e885=_0x4b9d('0x23');return db[_0x4b9d('0x46')][_0x4b9d('0x47')]({'where':{'name':_0x56e885,'userProfileId':_0x4c1ea5['userProfileId']},'raw':!![]})[_0x4b9d('0x20')](function(_0x3aba0b){if(_0x3aba0b&&_0x3aba0b[_0x4b9d('0x48')]===0x0){return db[_0x4b9d('0x49')][_0x4b9d('0x43')]({'name':_0x316648[_0x4b9d('0x2a')],'resourceId':_0x316648['id'],'type':_0x3aba0b[_0x4b9d('0x2a')],'sectionId':_0x3aba0b['id']},{})[_0x4b9d('0x20')](function(){return _0x42f516;});}else{return _0x42f516;}})['catch'](function(_0x1859a5){logger[_0x4b9d('0x24')](_0x4b9d('0x4a'),_0x1859a5);throw _0x1859a5;});}return _0x42f516;})['then'](respondWithResult(_0x39ae81,0xc9))[_0x4b9d('0x3f')](handleError(_0x39ae81,null));};exports[_0x4b9d('0x4b')]=function(_0x31e54d,_0x225f3d){var _0x20f024={'where':{'id':_0x31e54d['params']['id']}},_0x15bbee={};_0x15bbee[_0x4b9d('0x2f')]=_[_0x4b9d('0x2c')](db['Campaign']['rawAttributes']);_0x20f024[_0x4b9d('0x30')]=_[_0x4b9d('0x2e')](_0x15bbee[_0x4b9d('0x2f')],qs[_0x4b9d('0x4c')](_0x31e54d[_0x4b9d('0x2b')][_0x4b9d('0x4c')]));_0x20f024['attributes']=_0x20f024[_0x4b9d('0x30')][_0x4b9d('0x31')]?_0x20f024['attributes']:_0x15bbee[_0x4b9d('0x2f')];if(_0x31e54d[_0x4b9d('0x2b')][_0x4b9d('0x3c')]){_0x20f024['include']=[{'all':!![]}];}_0x20f024=_['merge']({},_0x20f024,_0x31e54d['options']);return db[_0x4b9d('0x3a')][_0x4b9d('0x47')](_0x20f024)[_0x4b9d('0x20')](handleEntityNotFound(_0x225f3d,null))['then'](function(_0x5d6f0f){if(_0x5d6f0f){var _0x2a5cc6=_0x5d6f0f[_0x4b9d('0x22')]({'plain':!![]});_0x2a5cc6=qs[_0x4b9d('0x4d')](_0x2a5cc6,['id','createdAt',_0x4b9d('0x4e')]);_0x31e54d[_0x4b9d('0x44')]=_['omit'](_0x31e54d[_0x4b9d('0x44')],['id',_0x4b9d('0x4f'),_0x4b9d('0x4e')]);return db['Campaign']['create'](_[_0x4b9d('0x38')](_0x2a5cc6,_0x31e54d[_0x4b9d('0x44')]),{'include':_0x31e54d[_0x4b9d('0x2b')][_0x4b9d('0x3c')]?[{'all':!![]}]:undefined})['then'](function(_0x285d57){var _0x59ac6c=_0x31e54d[_0x4b9d('0x45')][_0x4b9d('0x22')]({'plain':!![]});if(!_0x59ac6c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59ac6c[_0x4b9d('0x50')]===_0x4b9d('0x45')){var _0x9848ec=_0x285d57[_0x4b9d('0x22')]({'plain':!![]});var _0x943c45='IvrCampaigns';return db[_0x4b9d('0x46')][_0x4b9d('0x47')]({'where':{'name':_0x943c45,'userProfileId':_0x59ac6c[_0x4b9d('0x51')]},'raw':!![]})[_0x4b9d('0x20')](function(_0x17eb13){if(_0x17eb13&&_0x17eb13[_0x4b9d('0x48')]===0x0){return db[_0x4b9d('0x49')][_0x4b9d('0x43')]({'name':_0x9848ec[_0x4b9d('0x2a')],'resourceId':_0x9848ec['id'],'type':_0x17eb13[_0x4b9d('0x2a')],'sectionId':_0x17eb13['id']},{})[_0x4b9d('0x20')](function(){return _0x285d57;});}else{return _0x285d57;}})[_0x4b9d('0x3f')](function(_0x4c19fc){logger[_0x4b9d('0x24')](_0x4b9d('0x4a'),_0x4c19fc);throw _0x4c19fc;});}return _0x285d57;});}})[_0x4b9d('0x20')](respondWithResult(_0x225f3d,0xc9))['catch'](handleError(_0x225f3d,null));};exports['update']=function(_0x542e16,_0x340aa0){if(_0x542e16[_0x4b9d('0x44')]['id']){delete _0x542e16['body']['id'];}return db[_0x4b9d('0x3a')][_0x4b9d('0x47')]({'where':{'id':_0x542e16[_0x4b9d('0x52')]['id']}})[_0x4b9d('0x20')](handleEntityNotFound(_0x340aa0,null))[_0x4b9d('0x20')](saveUpdates(_0x542e16[_0x4b9d('0x44')],null))[_0x4b9d('0x20')](respondWithResult(_0x340aa0,null))['catch'](handleError(_0x340aa0,null));};exports['destroy']=function(_0x549885,_0x5c84a7){return db[_0x4b9d('0x3a')][_0x4b9d('0x47')]({'where':{'id':_0x549885['params']['id']}})['then'](handleEntityNotFound(_0x5c84a7,null))[_0x4b9d('0x20')](removeEntity(_0x5c84a7,null))[_0x4b9d('0x3f')](handleError(_0x5c84a7,null));};exports[_0x4b9d('0x53')]=function(_0x28874,_0x41352c,_0x3316fb){var _0x5a9f28={'raw':!![],'where':{}};var _0x2f6ddb={};var _0x5093bb={'count':0x0,'rows':[]};return db[_0x4b9d('0x3a')][_0x4b9d('0x54')]({'where':{'id':_0x28874[_0x4b9d('0x52')]['id']}})[_0x4b9d('0x20')](handleEntityNotFound(_0x41352c,null))[_0x4b9d('0x20')](function(_0x235700){if(_0x235700){_0x2f6ddb['model']=_[_0x4b9d('0x2c')](db[_0x4b9d('0x55')][_0x4b9d('0x41')]);_0x2f6ddb[_0x4b9d('0x2b')]=_['keys'](_0x28874[_0x4b9d('0x2b')]);_0x2f6ddb[_0x4b9d('0x2d')]=_[_0x4b9d('0x2e')](_0x2f6ddb['model'],_0x2f6ddb[_0x4b9d('0x2b')]);_0x5a9f28[_0x4b9d('0x30')]=_[_0x4b9d('0x2e')](_0x2f6ddb[_0x4b9d('0x2f')],qs[_0x4b9d('0x4c')](_0x28874[_0x4b9d('0x2b')]['fields']));_0x5a9f28['attributes']=_0x5a9f28['attributes'][_0x4b9d('0x31')]?_0x5a9f28[_0x4b9d('0x30')]:_0x2f6ddb[_0x4b9d('0x2f')];if(!_0x28874[_0x4b9d('0x2b')][_0x4b9d('0x32')](_0x4b9d('0x33'))){_0x5a9f28[_0x4b9d('0x1a')]=qs['limit'](_0x28874['query'][_0x4b9d('0x1a')]);_0x5a9f28['offset']=qs[_0x4b9d('0x1b')](_0x28874[_0x4b9d('0x2b')][_0x4b9d('0x1b')]);}_0x5a9f28[_0x4b9d('0x56')]=qs['sort'](_0x28874[_0x4b9d('0x2b')][_0x4b9d('0x34')]);_0x5a9f28[_0x4b9d('0x35')]=qs[_0x4b9d('0x2d')](_[_0x4b9d('0x36')](_0x28874[_0x4b9d('0x2b')],_0x2f6ddb[_0x4b9d('0x2d')]));_0x5a9f28[_0x4b9d('0x35')][_0x4b9d('0x57')]=_0x235700['id'];if(_0x28874['query']['filter']){_0x5a9f28[_0x4b9d('0x35')]=_['merge'](_0x5a9f28['where'],{'$or':_[_0x4b9d('0x26')](_0x5a9f28[_0x4b9d('0x30')],function(_0x2dc906){var _0x2860bc={};_0x2860bc[_0x2dc906]={'$like':'%'+_0x28874[_0x4b9d('0x2b')][_0x4b9d('0x37')]+'%'};return _0x2860bc;})});}_0x5a9f28=_[_0x4b9d('0x38')]({},_0x5a9f28,_0x28874[_0x4b9d('0x42')]);return db[_0x4b9d('0x55')][_0x4b9d('0x3b')]({'where':_0x5a9f28[_0x4b9d('0x35')]})[_0x4b9d('0x20')](function(_0x1df6ea){_0x5093bb[_0x4b9d('0x3b')]=_0x1df6ea;if(_0x28874[_0x4b9d('0x2b')][_0x4b9d('0x3c')]){_0x5a9f28[_0x4b9d('0x3d')]=[{'all':!![]}];}return db[_0x4b9d('0x55')][_0x4b9d('0x3e')](_0x5a9f28);})['then'](function(_0x20ac85){_0x5093bb['rows']=_0x20ac85;return _0x5093bb;});}})['then'](respondWithFilteredResult(_0x41352c,_0x5a9f28))[_0x4b9d('0x3f')](handleError(_0x41352c,null));};exports[_0x4b9d('0x58')]=function(_0x556007,_0x468dda,_0x24e1c0){var _0x571625={'raw':!![],'where':{}};var _0x5272ce={};var _0x1b3529={'count':0x0,'rows':[]};return db[_0x4b9d('0x3a')][_0x4b9d('0x54')]({'where':{'id':_0x556007[_0x4b9d('0x52')]['id']}})[_0x4b9d('0x20')](handleEntityNotFound(_0x468dda,null))['then'](function(_0x5dbc39){if(_0x5dbc39){_0x5272ce[_0x4b9d('0x2f')]=_[_0x4b9d('0x2c')](db[_0x4b9d('0x59')][_0x4b9d('0x41')]);_0x5272ce[_0x4b9d('0x2b')]=_['keys'](_0x556007[_0x4b9d('0x2b')]);_0x5272ce[_0x4b9d('0x2d')]=_[_0x4b9d('0x2e')](_0x5272ce[_0x4b9d('0x2f')],_0x5272ce[_0x4b9d('0x2b')]);_0x571625[_0x4b9d('0x30')]=_[_0x4b9d('0x2e')](_0x5272ce[_0x4b9d('0x2f')],qs[_0x4b9d('0x4c')](_0x556007[_0x4b9d('0x2b')][_0x4b9d('0x4c')]));_0x571625[_0x4b9d('0x30')]=_0x571625[_0x4b9d('0x30')]['length']?_0x571625[_0x4b9d('0x30')]:_0x5272ce[_0x4b9d('0x2f')];if(!_0x556007[_0x4b9d('0x2b')][_0x4b9d('0x32')](_0x4b9d('0x33'))){_0x571625['limit']=qs[_0x4b9d('0x1a')](_0x556007[_0x4b9d('0x2b')][_0x4b9d('0x1a')]);_0x571625[_0x4b9d('0x1b')]=qs[_0x4b9d('0x1b')](_0x556007[_0x4b9d('0x2b')][_0x4b9d('0x1b')]);}_0x571625[_0x4b9d('0x56')]=qs['sort'](_0x556007[_0x4b9d('0x2b')]['sort']);_0x571625[_0x4b9d('0x35')]=qs['filters'](_['pick'](_0x556007[_0x4b9d('0x2b')],_0x5272ce[_0x4b9d('0x2d')]));_0x571625[_0x4b9d('0x35')][_0x4b9d('0x57')]=_0x5dbc39['id'];if(_0x556007['query']['filter']){_0x571625[_0x4b9d('0x35')]=_['merge'](_0x571625[_0x4b9d('0x35')],{'$or':_[_0x4b9d('0x26')](_0x571625['attributes'],function(_0x2ab3dd){var _0x1103b4={};_0x1103b4[_0x2ab3dd]={'$like':'%'+_0x556007['query'][_0x4b9d('0x37')]+'%'};return _0x1103b4;})});}_0x571625=_['merge']({},_0x571625,_0x556007[_0x4b9d('0x42')]);return db[_0x4b9d('0x59')][_0x4b9d('0x3b')]({'where':_0x571625[_0x4b9d('0x35')]})[_0x4b9d('0x20')](function(_0x4be7f0){_0x1b3529[_0x4b9d('0x3b')]=_0x4be7f0;if(_0x556007[_0x4b9d('0x2b')][_0x4b9d('0x3c')]){_0x571625[_0x4b9d('0x3d')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x571625);})[_0x4b9d('0x20')](function(_0x5eb86a){_0x1b3529['rows']=_0x5eb86a;return _0x1b3529;});}})[_0x4b9d('0x20')](respondWithFilteredResult(_0x468dda,_0x571625))[_0x4b9d('0x3f')](handleError(_0x468dda,null));};exports[_0x4b9d('0x5a')]=function(_0x31aef9,_0x5c9be1,_0x2d1a5e){var _0x445db1={'raw':!![],'where':{}};var _0x1b9c20={};var _0xe5177b={'count':0x0,'rows':[]};return db['Campaign'][_0x4b9d('0x54')]({'where':{'id':_0x31aef9[_0x4b9d('0x52')]['id']}})['then'](handleEntityNotFound(_0x5c9be1,null))[_0x4b9d('0x20')](function(_0x3e8cd7){if(_0x3e8cd7){_0x1b9c20[_0x4b9d('0x2f')]=_[_0x4b9d('0x2c')](db[_0x4b9d('0x5b')][_0x4b9d('0x41')]);_0x1b9c20[_0x4b9d('0x2b')]=_['keys'](_0x31aef9[_0x4b9d('0x2b')]);_0x1b9c20[_0x4b9d('0x2d')]=_['intersection'](_0x1b9c20[_0x4b9d('0x2f')],_0x1b9c20[_0x4b9d('0x2b')]);_0x445db1[_0x4b9d('0x30')]=_[_0x4b9d('0x2e')](_0x1b9c20[_0x4b9d('0x2f')],qs[_0x4b9d('0x4c')](_0x31aef9[_0x4b9d('0x2b')][_0x4b9d('0x4c')]));_0x445db1[_0x4b9d('0x30')]=_0x445db1[_0x4b9d('0x30')]['length']?_0x445db1[_0x4b9d('0x30')]:_0x1b9c20[_0x4b9d('0x2f')];if(!_0x31aef9[_0x4b9d('0x2b')][_0x4b9d('0x32')](_0x4b9d('0x33'))){_0x445db1[_0x4b9d('0x1a')]=qs[_0x4b9d('0x1a')](_0x31aef9['query'][_0x4b9d('0x1a')]);_0x445db1['offset']=qs['offset'](_0x31aef9[_0x4b9d('0x2b')][_0x4b9d('0x1b')]);}_0x445db1[_0x4b9d('0x56')]=qs[_0x4b9d('0x34')](_0x31aef9['query']['sort']);_0x445db1[_0x4b9d('0x35')]=qs[_0x4b9d('0x2d')](_['pick'](_0x31aef9['query'],_0x1b9c20[_0x4b9d('0x2d')]));_0x445db1[_0x4b9d('0x35')][_0x4b9d('0x57')]=_0x3e8cd7['id'];if(_0x31aef9[_0x4b9d('0x2b')]['filter']){_0x445db1[_0x4b9d('0x35')]=_[_0x4b9d('0x38')](_0x445db1['where'],{'$or':_[_0x4b9d('0x26')](_0x445db1[_0x4b9d('0x30')],function(_0x46e8be){var _0x52f9af={};_0x52f9af[_0x46e8be]={'$like':'%'+_0x31aef9['query']['filter']+'%'};return _0x52f9af;})});}_0x445db1=_[_0x4b9d('0x38')]({},_0x445db1,_0x31aef9[_0x4b9d('0x42')]);return db[_0x4b9d('0x5b')][_0x4b9d('0x3b')]({'where':_0x445db1['where']})[_0x4b9d('0x20')](function(_0x10ad6a){_0xe5177b[_0x4b9d('0x3b')]=_0x10ad6a;if(_0x31aef9[_0x4b9d('0x2b')]['includeAll']){_0x445db1['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x4b9d('0x3e')](_0x445db1);})['then'](function(_0x3de9bb){_0xe5177b['rows']=_0x3de9bb;return _0xe5177b;});}})['then'](respondWithFilteredResult(_0x5c9be1,_0x445db1))[_0x4b9d('0x3f')](handleError(_0x5c9be1,null));};exports[_0x4b9d('0x5c')]=function(_0x545dba,_0x261176,_0xa738a6){var _0x366fb3={'raw':!![],'where':{}};var _0x1c41e8={};var _0x156730={'count':0x0,'rows':[]};return db[_0x4b9d('0x3a')][_0x4b9d('0x54')]({'where':{'id':_0x545dba[_0x4b9d('0x52')]['id']}})[_0x4b9d('0x20')](handleEntityNotFound(_0x261176,null))[_0x4b9d('0x20')](function(_0x535f3a){if(_0x535f3a){_0x1c41e8[_0x4b9d('0x2f')]=_[_0x4b9d('0x2c')](db[_0x4b9d('0x5d')][_0x4b9d('0x41')]);_0x1c41e8[_0x4b9d('0x2b')]=_['keys'](_0x545dba['query']);_0x1c41e8[_0x4b9d('0x2d')]=_[_0x4b9d('0x2e')](_0x1c41e8['model'],_0x1c41e8[_0x4b9d('0x2b')]);_0x366fb3['attributes']=_[_0x4b9d('0x2e')](_0x1c41e8['model'],qs[_0x4b9d('0x4c')](_0x545dba['query']['fields']));_0x366fb3[_0x4b9d('0x30')]=_0x366fb3[_0x4b9d('0x30')]['length']?_0x366fb3['attributes']:_0x1c41e8[_0x4b9d('0x2f')];if(!_0x545dba['query']['hasOwnProperty']('nolimit')){_0x366fb3[_0x4b9d('0x1a')]=qs[_0x4b9d('0x1a')](_0x545dba[_0x4b9d('0x2b')][_0x4b9d('0x1a')]);_0x366fb3[_0x4b9d('0x1b')]=qs[_0x4b9d('0x1b')](_0x545dba[_0x4b9d('0x2b')][_0x4b9d('0x1b')]);}_0x366fb3[_0x4b9d('0x56')]=qs['sort'](_0x545dba['query'][_0x4b9d('0x34')]);_0x366fb3['where']=qs['filters'](_['pick'](_0x545dba[_0x4b9d('0x2b')],_0x1c41e8[_0x4b9d('0x2d')]));_0x366fb3[_0x4b9d('0x35')]['CampaignId']=_0x535f3a['id'];if(_0x545dba['query']['filter']){_0x366fb3[_0x4b9d('0x35')]=_[_0x4b9d('0x38')](_0x366fb3['where'],{'$or':_[_0x4b9d('0x26')](_0x366fb3[_0x4b9d('0x30')],function(_0x4b137a){var _0x21cdcc={};_0x21cdcc[_0x4b137a]={'$like':'%'+_0x545dba[_0x4b9d('0x2b')][_0x4b9d('0x37')]+'%'};return _0x21cdcc;})});}_0x366fb3=_['merge']({},_0x366fb3,_0x545dba[_0x4b9d('0x42')]);return db[_0x4b9d('0x5d')][_0x4b9d('0x3b')]({'where':_0x366fb3[_0x4b9d('0x35')]})[_0x4b9d('0x20')](function(_0x56da84){_0x156730[_0x4b9d('0x3b')]=_0x56da84;if(_0x545dba[_0x4b9d('0x2b')]['includeAll']){_0x366fb3[_0x4b9d('0x3d')]=[{'all':!![]}];}return db[_0x4b9d('0x5d')][_0x4b9d('0x3e')](_0x366fb3);})[_0x4b9d('0x20')](function(_0x3e907b){_0x156730[_0x4b9d('0x5e')]=_0x3e907b;return _0x156730;});}})[_0x4b9d('0x20')](respondWithFilteredResult(_0x261176,_0x366fb3))[_0x4b9d('0x3f')](handleError(_0x261176,null));};exports['getLists']=function(_0x3cd877,_0x37361f,_0x354a5a){var _0x5dca22={};var _0x550f18={};var _0x234745;var _0x3c5abe;return db[_0x4b9d('0x3a')][_0x4b9d('0x54')]({'where':{'id':_0x3cd877['params']['id']}})['then'](handleEntityNotFound(_0x37361f,null))[_0x4b9d('0x20')](function(_0x57b71d){if(_0x57b71d){_0x234745=_0x57b71d;_0x550f18['model']=_[_0x4b9d('0x2c')](db[_0x4b9d('0x5f')][_0x4b9d('0x41')]);_0x550f18[_0x4b9d('0x2b')]=_[_0x4b9d('0x2c')](_0x3cd877[_0x4b9d('0x2b')]);_0x550f18[_0x4b9d('0x2d')]=_[_0x4b9d('0x2e')](_0x550f18[_0x4b9d('0x2f')],_0x550f18[_0x4b9d('0x2b')]);_0x5dca22['attributes']=_[_0x4b9d('0x2e')](_0x550f18[_0x4b9d('0x2f')],qs['fields'](_0x3cd877[_0x4b9d('0x2b')][_0x4b9d('0x4c')]));_0x5dca22[_0x4b9d('0x30')]=_0x5dca22[_0x4b9d('0x30')]['length']?_0x5dca22[_0x4b9d('0x30')]:_0x550f18[_0x4b9d('0x2f')];_0x5dca22['order']=qs[_0x4b9d('0x34')](_0x3cd877[_0x4b9d('0x2b')][_0x4b9d('0x34')]);_0x5dca22[_0x4b9d('0x35')]=qs[_0x4b9d('0x2d')](_['pick'](_0x3cd877[_0x4b9d('0x2b')],_0x550f18[_0x4b9d('0x2d')]));if(_0x3cd877[_0x4b9d('0x2b')][_0x4b9d('0x37')]){_0x5dca22[_0x4b9d('0x35')]=_['merge'](_0x5dca22[_0x4b9d('0x35')],{'$or':_[_0x4b9d('0x26')](_0x5dca22[_0x4b9d('0x30')],function(_0x1fcf6e){var _0x1e3d9b={};_0x1e3d9b[_0x1fcf6e]={'$like':'%'+_0x3cd877[_0x4b9d('0x2b')][_0x4b9d('0x37')]+'%'};return _0x1e3d9b;})});}_0x5dca22=_[_0x4b9d('0x38')]({},_0x5dca22,_0x3cd877['options']);return _0x234745[_0x4b9d('0x60')](_0x5dca22);}})[_0x4b9d('0x20')](function(_0x8e1a38){if(_0x8e1a38){_0x3c5abe=_0x8e1a38[_0x4b9d('0x31')];if(!_0x3cd877[_0x4b9d('0x2b')][_0x4b9d('0x32')](_0x4b9d('0x33'))){_0x5dca22['limit']=qs[_0x4b9d('0x1a')](_0x3cd877[_0x4b9d('0x2b')][_0x4b9d('0x1a')]);_0x5dca22[_0x4b9d('0x1b')]=qs[_0x4b9d('0x1b')](_0x3cd877['query'][_0x4b9d('0x1b')]);}return _0x234745[_0x4b9d('0x60')](_0x5dca22);}})['then'](function(_0x9040fa){if(_0x9040fa){return _0x9040fa?{'count':_0x3c5abe,'rows':_0x9040fa}:null;}})[_0x4b9d('0x20')](respondWithResult(_0x37361f,null))['catch'](handleError(_0x37361f,null));};exports[_0x4b9d('0x61')]=function(_0x126b5e,_0x1875a1,_0x6d7b41){var _0x37c46b,_0x4c37d2;return db[_0x4b9d('0x3a')][_0x4b9d('0x47')]({'where':{'id':_0x126b5e[_0x4b9d('0x52')]['id']}})[_0x4b9d('0x20')](handleEntityNotFound(_0x1875a1,null))[_0x4b9d('0x20')](function(_0x176535){if(_0x176535){_0x4c37d2=_0x176535;return _0x176535[_0x4b9d('0x61')](_0x126b5e[_0x4b9d('0x44')][_0x4b9d('0x62')],_[_0x4b9d('0x4d')](_0x126b5e[_0x4b9d('0x44')],[_0x4b9d('0x62'),'id'])||{});}return null;})['spread'](function(_0x2840af){var _0x383621;_0x37c46b=_0x2840af||[];var _0x51e2aa=[];if(_0x2840af){for(var _0x404b35=0x0;_0x404b35<_0x2840af[_0x4b9d('0x31')];_0x404b35+=0x1){var _0x1b9994=_0x2840af[_0x404b35][_0x4b9d('0x22')]({'plain':!![]});_0x4c37d2[_0x4b9d('0x63')]=_0x126b5e[_0x4b9d('0x44')][_0x4b9d('0x63')]?_0x126b5e[_0x4b9d('0x44')][_0x4b9d('0x63')]:_0x4c37d2[_0x4b9d('0x63')];switch(_0x4c37d2['dialCheckDuplicateType']){case _0x4b9d('0x64'):_0x383621=squel['insert']()['into'](_0x4b9d('0x65'))['fromQuery'](['phone',_0x4b9d('0x66'),_0x4b9d('0x67'),'ListId',_0x4b9d('0x57'),_0x4b9d('0x4f'),_0x4b9d('0x4e')],squel[_0x4b9d('0x68')]()[_0x4b9d('0x69')](_0x4b9d('0x6a'),_0x4b9d('0x6a'))['field'](_0x4b9d('0x6b'),'scheduledAt')[_0x4b9d('0x69')]('id',_0x4b9d('0x67'))[_0x4b9d('0x69')](_0x1b9994[_0x4b9d('0x6c')]['toString'](),_0x4b9d('0x6d'))['field'](_0x126b5e['params']['id'][_0x4b9d('0x6e')](),_0x4b9d('0x57'))['field'](_0x4b9d('0x6b'),_0x4b9d('0x4f'))['field']('NOW()',_0x4b9d('0x4e'))[_0x4b9d('0x6f')]('cm_contacts')[_0x4b9d('0x35')](_0x4b9d('0x70'))['where'](_0x4b9d('0x71'),_0x1b9994['CmListId']['toString']())[_0x4b9d('0x35')](_0x4b9d('0x72'))[_0x4b9d('0x35')](_0x4b9d('0x73'),squel[_0x4b9d('0x68')]()[_0x4b9d('0x69')](_0x4b9d('0x74'))[_0x4b9d('0x6f')](_0x4b9d('0x75'))[_0x4b9d('0x35')](_0x4b9d('0x76'),_0x126b5e[_0x4b9d('0x52')]['id']['toString']()))[_0x4b9d('0x35')](_0x4b9d('0x73'),squel['select']()['field'](_0x4b9d('0x77'))[_0x4b9d('0x6f')](_0x4b9d('0x65'))['where']('CampaignId\x20=\x20?',_0x126b5e[_0x4b9d('0x52')]['id'][_0x4b9d('0x6e')]())))[_0x4b9d('0x6e')]();break;case _0x4b9d('0x78'):_0x383621=squel[_0x4b9d('0x79')]()[_0x4b9d('0x7a')](_0x4b9d('0x65'))['fromQuery']([_0x4b9d('0x6a'),'scheduledAt',_0x4b9d('0x67'),_0x4b9d('0x6d'),'CampaignId',_0x4b9d('0x4f'),_0x4b9d('0x4e')],squel[_0x4b9d('0x68')]()[_0x4b9d('0x69')](_0x4b9d('0x6a'),'phone')[_0x4b9d('0x69')](_0x4b9d('0x6b'),_0x4b9d('0x66'))['field']('id',_0x4b9d('0x67'))[_0x4b9d('0x69')](_0x1b9994['CmListId'][_0x4b9d('0x6e')](),_0x4b9d('0x6d'))[_0x4b9d('0x69')](_0x126b5e[_0x4b9d('0x52')]['id'][_0x4b9d('0x6e')](),_0x4b9d('0x57'))[_0x4b9d('0x69')](_0x4b9d('0x6b'),'createdAt')['field'](_0x4b9d('0x6b'),'updatedAt')[_0x4b9d('0x6f')]('cm_contacts')[_0x4b9d('0x35')](_0x4b9d('0x70'))[_0x4b9d('0x35')](_0x4b9d('0x71'),_0x1b9994['CmListId'][_0x4b9d('0x6e')]())['where'](_0x4b9d('0x72'))['where'](_0x4b9d('0x73'),squel[_0x4b9d('0x68')]()[_0x4b9d('0x69')](_0x4b9d('0x77'))['from'](_0x4b9d('0x65'))['where'](_0x4b9d('0x76'),_0x126b5e[_0x4b9d('0x52')]['id'][_0x4b9d('0x6e')]())))[_0x4b9d('0x6e')]();break;default:_0x383621=squel[_0x4b9d('0x79')]()[_0x4b9d('0x7a')](_0x4b9d('0x65'))[_0x4b9d('0x7b')](['phone','scheduledAt',_0x4b9d('0x67'),_0x4b9d('0x6d'),_0x4b9d('0x57'),_0x4b9d('0x4f'),_0x4b9d('0x4e')],squel['select']()['field']('phone',_0x4b9d('0x6a'))[_0x4b9d('0x69')](_0x4b9d('0x6b'),_0x4b9d('0x66'))[_0x4b9d('0x69')]('id',_0x4b9d('0x67'))[_0x4b9d('0x69')](_0x1b9994['CmListId'][_0x4b9d('0x6e')](),_0x4b9d('0x6d'))[_0x4b9d('0x69')](_0x126b5e[_0x4b9d('0x52')]['id'][_0x4b9d('0x6e')](),_0x4b9d('0x57'))[_0x4b9d('0x69')](_0x4b9d('0x6b'),_0x4b9d('0x4f'))[_0x4b9d('0x69')](_0x4b9d('0x6b'),_0x4b9d('0x4e'))[_0x4b9d('0x6f')](_0x4b9d('0x7c'))[_0x4b9d('0x35')](_0x4b9d('0x70'))[_0x4b9d('0x35')](_0x4b9d('0x71'),_0x1b9994[_0x4b9d('0x6c')]['toString']())['where'](_0x4b9d('0x72')))[_0x4b9d('0x6e')]();}_0x51e2aa[_0x4b9d('0x7d')](db[_0x4b9d('0x7e')][_0x4b9d('0x2b')](_0x383621));}return BPromise[_0x4b9d('0x7f')](_0x51e2aa);}})[_0x4b9d('0x20')](function(){return _0x37c46b;})[_0x4b9d('0x20')](respondWithResult(_0x1875a1,null))[_0x4b9d('0x3f')](handleError(_0x1875a1,null));};exports['removeLists']=function(_0x2f2315,_0x52097e,_0x4f38ae){return db[_0x4b9d('0x3a')][_0x4b9d('0x47')]({'where':{'id':_0x2f2315[_0x4b9d('0x52')]['id']}})[_0x4b9d('0x20')](handleEntityNotFound(_0x52097e,null))[_0x4b9d('0x20')](function(_0x539dae){if(_0x539dae){return _0x539dae[_0x4b9d('0x80')](_0x2f2315['query'][_0x4b9d('0x62')]);}})[_0x4b9d('0x20')](function(_0x45bea4){if(_0x45bea4){return db[_0x4b9d('0x55')][_0x4b9d('0x21')]({'where':{'ListId':_0x2f2315[_0x4b9d('0x2b')][_0x4b9d('0x62')],'CampaignId':_0x2f2315[_0x4b9d('0x52')]['id']}})[_0x4b9d('0x20')](function(){return _0x45bea4;});}})[_0x4b9d('0x20')](respondWithStatusCode(_0x52097e,null))[_0x4b9d('0x3f')](handleError(_0x52097e,null));};exports[_0x4b9d('0x81')]=function(_0x175e9d,_0x1a1622,_0x57483e){var _0x3b642e={};var _0x367491={};var _0xdd3110;var _0x1b256e;return db[_0x4b9d('0x3a')]['findOne']({'where':{'id':_0x175e9d[_0x4b9d('0x52')]['id']}})['then'](handleEntityNotFound(_0x1a1622,null))[_0x4b9d('0x20')](function(_0xd5ff73){if(_0xd5ff73){_0xdd3110=_0xd5ff73;_0x367491['model']=_[_0x4b9d('0x2c')](db[_0x4b9d('0x5f')][_0x4b9d('0x41')]);_0x367491[_0x4b9d('0x2b')]=_[_0x4b9d('0x2c')](_0x175e9d[_0x4b9d('0x2b')]);_0x367491[_0x4b9d('0x2d')]=_[_0x4b9d('0x2e')](_0x367491[_0x4b9d('0x2f')],_0x367491[_0x4b9d('0x2b')]);_0x3b642e[_0x4b9d('0x30')]=_[_0x4b9d('0x2e')](_0x367491['model'],qs[_0x4b9d('0x4c')](_0x175e9d[_0x4b9d('0x2b')][_0x4b9d('0x4c')]));_0x3b642e['attributes']=_0x3b642e[_0x4b9d('0x30')][_0x4b9d('0x31')]?_0x3b642e[_0x4b9d('0x30')]:_0x367491['model'];_0x3b642e[_0x4b9d('0x56')]=qs[_0x4b9d('0x34')](_0x175e9d[_0x4b9d('0x2b')][_0x4b9d('0x34')]);_0x3b642e['where']=qs['filters'](_[_0x4b9d('0x36')](_0x175e9d[_0x4b9d('0x2b')],_0x367491[_0x4b9d('0x2d')]));if(_0x175e9d[_0x4b9d('0x2b')][_0x4b9d('0x37')]){_0x3b642e[_0x4b9d('0x35')]=_[_0x4b9d('0x38')](_0x3b642e[_0x4b9d('0x35')],{'$or':_[_0x4b9d('0x26')](_0x3b642e['attributes'],function(_0x7c1a80){var _0x10618a={};_0x10618a[_0x7c1a80]={'$like':'%'+_0x175e9d[_0x4b9d('0x2b')]['filter']+'%'};return _0x10618a;})});}_0x3b642e=_[_0x4b9d('0x38')]({},_0x3b642e,_0x175e9d['options']);return _0xdd3110[_0x4b9d('0x81')](_0x3b642e);}})[_0x4b9d('0x20')](function(_0x25f161){if(_0x25f161){_0x1b256e=_0x25f161[_0x4b9d('0x31')];if(!_0x175e9d['query']['hasOwnProperty'](_0x4b9d('0x33'))){_0x3b642e[_0x4b9d('0x1a')]=qs['limit'](_0x175e9d[_0x4b9d('0x2b')][_0x4b9d('0x1a')]);_0x3b642e[_0x4b9d('0x1b')]=qs['offset'](_0x175e9d[_0x4b9d('0x2b')][_0x4b9d('0x1b')]);}return _0xdd3110[_0x4b9d('0x81')](_0x3b642e);}})[_0x4b9d('0x20')](function(_0x34e512){if(_0x34e512){return _0x34e512?{'count':_0x1b256e,'rows':_0x34e512}:null;}})[_0x4b9d('0x20')](respondWithResult(_0x1a1622,null))[_0x4b9d('0x3f')](handleError(_0x1a1622,null));};exports[_0x4b9d('0x82')]=function(_0x5e788b,_0x194202,_0x941a2){var _0x575e19,_0x33e4f7;return db['Campaign'][_0x4b9d('0x47')]({'where':{'id':_0x5e788b['params']['id']}})[_0x4b9d('0x20')](handleEntityNotFound(_0x194202,null))[_0x4b9d('0x20')](function(_0x3c52fe){if(_0x3c52fe){_0x33e4f7=_0x3c52fe;return _0x3c52fe['addBlackLists'](_0x5e788b[_0x4b9d('0x44')][_0x4b9d('0x62')],_['omit'](_0x5e788b[_0x4b9d('0x44')],['ids','id'])||{});}return null;})[_0x4b9d('0x83')](function(_0x15331a){var _0x2615a4;_0x575e19=_0x15331a||[];var _0x285428=[];if(_0x15331a){for(var _0xaff8c=0x0;_0xaff8c<_0x15331a['length'];_0xaff8c+=0x1){var _0xacf9d1=_0x15331a[_0xaff8c]['get']({'plain':!![]});_0x2615a4=squel[_0x4b9d('0x79')]()['into'](_0x4b9d('0x84'))[_0x4b9d('0x7b')]([_0x4b9d('0x6a'),_0x4b9d('0x67'),_0x4b9d('0x6d'),'CampaignId',_0x4b9d('0x4f'),_0x4b9d('0x4e')],squel[_0x4b9d('0x68')]()[_0x4b9d('0x69')]('phone',_0x4b9d('0x6a'))['field']('id','ContactId')['field'](_0xacf9d1['CmListId'][_0x4b9d('0x6e')](),_0x4b9d('0x6d'))[_0x4b9d('0x69')](_0x5e788b[_0x4b9d('0x52')]['id'][_0x4b9d('0x6e')](),_0x4b9d('0x57'))[_0x4b9d('0x69')](_0x4b9d('0x6b'),_0x4b9d('0x4f'))[_0x4b9d('0x69')](_0x4b9d('0x6b'),'updatedAt')[_0x4b9d('0x6f')]('cm_contacts')[_0x4b9d('0x35')]('deletedAt\x20IS\x20NULL')[_0x4b9d('0x35')](_0x4b9d('0x71'),_0xacf9d1[_0x4b9d('0x6c')]['toString']())[_0x4b9d('0x35')](_0x4b9d('0x72')))[_0x4b9d('0x6e')]();_0x285428['push'](db[_0x4b9d('0x7e')]['query'](_0x2615a4));}return BPromise['all'](_0x285428);}})[_0x4b9d('0x20')](function(){return _0x575e19;})[_0x4b9d('0x20')](respondWithResult(_0x194202,null))[_0x4b9d('0x3f')](handleError(_0x194202,null));};exports[_0x4b9d('0x85')]=function(_0xe0bdd4,_0x130b5c,_0x38cc42){return db['Campaign'][_0x4b9d('0x47')]({'where':{'id':_0xe0bdd4['params']['id']}})[_0x4b9d('0x20')](handleEntityNotFound(_0x130b5c,null))[_0x4b9d('0x20')](function(_0x59f461){if(_0x59f461){return _0x59f461[_0x4b9d('0x85')](_0xe0bdd4[_0x4b9d('0x2b')]['ids']);}})[_0x4b9d('0x20')](function(_0xf9c14d){if(_0xf9c14d){return db[_0x4b9d('0x5d')][_0x4b9d('0x21')]({'where':{'ListId':_0xe0bdd4[_0x4b9d('0x2b')][_0x4b9d('0x62')],'CampaignId':_0xe0bdd4[_0x4b9d('0x52')]['id']}})[_0x4b9d('0x20')](function(){return _0xf9c14d;});}})['then'](respondWithStatusCode(_0x130b5c,null))[_0x4b9d('0x3f')](handleError(_0x130b5c,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 6f1308e..82aa4b3 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(_0x4eda15,_0x28fa8c){var _0x292fe7=function(_0x2474f4){while(--_0x2474f4){_0x4eda15['push'](_0x4eda15['shift']());}};_0x292fe7(++_0x28fa8c);}(_0x7a54,0x106));var _0x47a5=function(_0x264253,_0x5f979b){_0x264253=_0x264253-0x0;var _0x4df48c=_0x7a54[_0x264253];return _0x4df48c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4ffd71,_0x5d1866){var _0x471287=function(_0x4e38cd){while(--_0x4e38cd){_0x4ffd71['push'](_0x4ffd71['shift']());}};_0x471287(++_0x5d1866);}(_0x7a54,0x106));var _0x47a5=function(_0x320241,_0x3ab6f2){_0x320241=_0x320241-0x0;var _0x19573c=_0x7a54[_0x320241];return _0x19573c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 8b81199..07a9828 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 _0x8ebf=['stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','where','limit','map','include','attributes','model','debug','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s'];(function(_0x3cab38,_0x5dd060){var _0x35f887=function(_0x1b12d4){while(--_0x1b12d4){_0x3cab38['push'](_0x3cab38['shift']());}};_0x35f887(++_0x5dd060);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x146484,_0x27a7f0){_0x146484=_0x146484-0x0;var _0x4c7aa3=_0x8ebf[_0x146484];return _0x4c7aa3;};'use strict';var _=require(_0xf8eb('0x0'));var util=require(_0xf8eb('0x1'));var moment=require(_0xf8eb('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8eb('0x3'));var fs=require('fs');var Redis=require(_0xf8eb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8eb('0x5'));var logger=require(_0xf8eb('0x6'))(_0xf8eb('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8eb('0x8'));var client=jayson[_0xf8eb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30c91c,_0x2c2489,_0x2a1fb6){return new BPromise(function(_0x4c628d,_0x959b95){return client['request'](_0x30c91c,_0x2a1fb6)[_0xf8eb('0xa')](function(_0x4d1adc){logger[_0xf8eb('0xb')](_0xf8eb('0xc'),_0x2c2489,_0xf8eb('0xd'));logger['debug'](_0xf8eb('0xe'),_0x2c2489,_0xf8eb('0xd'),JSON[_0xf8eb('0xf')](_0x4d1adc));if(_0x4d1adc[_0xf8eb('0x10')]){if(_0x4d1adc[_0xf8eb('0x10')][_0xf8eb('0x11')]===0x1f4){logger[_0xf8eb('0x10')](_0xf8eb('0xc'),_0x2c2489,_0x4d1adc['error'][_0xf8eb('0x12')]);return _0x959b95(_0x4d1adc[_0xf8eb('0x10')][_0xf8eb('0x12')]);}logger[_0xf8eb('0x10')]('Campaign,\x20%s,\x20%s',_0x2c2489,_0x4d1adc['error']['message']);return _0x4c628d(_0x4d1adc['error'][_0xf8eb('0x12')]);}else{logger[_0xf8eb('0xb')]('Campaign,\x20%s,\x20%s',_0x2c2489,_0xf8eb('0xd'));_0x4c628d(_0x4d1adc[_0xf8eb('0x13')][_0xf8eb('0x12')]);}})['catch'](function(_0x18dbbd){logger[_0xf8eb('0x10')](_0xf8eb('0xc'),_0x2c2489,_0x18dbbd);_0x959b95(_0x18dbbd);});});}exports[_0xf8eb('0x14')]=function(_0x3038b7){var _0x1df079=this;return new Promise(function(_0x4b6e70,_0x5458b4){return db[_0xf8eb('0x15')][_0xf8eb('0x16')]({'raw':_0x3038b7[_0xf8eb('0x17')]?_0x3038b7[_0xf8eb('0x17')][_0xf8eb('0x18')]===undefined?!![]:![]:!![],'where':_0x3038b7[_0xf8eb('0x17')]?_0x3038b7[_0xf8eb('0x17')][_0xf8eb('0x19')]||null:null,'attributes':_0x3038b7['options']?_0x3038b7[_0xf8eb('0x17')]['attributes']||null:null,'limit':_0x3038b7['options']?_0x3038b7[_0xf8eb('0x17')][_0xf8eb('0x1a')]||null:null,'include':_0x3038b7[_0xf8eb('0x17')]?_0x3038b7[_0xf8eb('0x17')]['include']?_[_0xf8eb('0x1b')](_0x3038b7[_0xf8eb('0x17')][_0xf8eb('0x1c')],function(_0x3f153f){return{'model':db[_0x3f153f['model']],'as':_0x3f153f['as'],'attributes':_0x3f153f[_0xf8eb('0x1d')],'include':_0x3f153f[_0xf8eb('0x1c')]?_[_0xf8eb('0x1b')](_0x3f153f[_0xf8eb('0x1c')],function(_0xa208f0){return{'model':db[_0xa208f0[_0xf8eb('0x1e')]],'as':_0xa208f0['as'],'attributes':_0xa208f0[_0xf8eb('0x1d')],'include':_0xa208f0[_0xf8eb('0x1c')]?_[_0xf8eb('0x1b')](_0xa208f0[_0xf8eb('0x1c')],function(_0x20738e){return{'model':db[_0x20738e[_0xf8eb('0x1e')]],'as':_0x20738e['as'],'attributes':_0x20738e['attributes']};}):[]};}):[]};}):[]:[]})[_0xf8eb('0xa')](function(_0x519a2c){logger[_0xf8eb('0xb')](_0xf8eb('0x14'),_0x3038b7);logger[_0xf8eb('0x1f')](_0xf8eb('0x14'),_0x3038b7,JSON[_0xf8eb('0xf')](_0x519a2c));_0x4b6e70(_0x519a2c);})[_0xf8eb('0x20')](function(_0x5bf35a){logger[_0xf8eb('0x10')](_0xf8eb('0x14'),_0x5bf35a[_0xf8eb('0x12')],_0x3038b7);_0x5458b4(_0x1df079[_0xf8eb('0x10')](0x1f4,_0x5bf35a[_0xf8eb('0x12')]));});});}; \ No newline at end of file +var _0x668b=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','findAll','options','raw','attributes','limit','include','model','map'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x668b,0x140));var _0xb668=function(_0x2feb53,_0x264ef7){_0x2feb53=_0x2feb53-0x0;var _0x5700ee=_0x668b[_0x2feb53];return _0x5700ee;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3be92e,_0x2778e9,_0x20b749){return new BPromise(function(_0x3f01bc,_0x517fc5){return client[_0xb668('0xa')](_0x3be92e,_0x20b749)[_0xb668('0xb')](function(_0x128cf5){logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));logger[_0xb668('0xf')](_0xb668('0x10'),_0x2778e9,'request\x20sent',JSON[_0xb668('0x11')](_0x128cf5));if(_0x128cf5[_0xb668('0x12')]){if(_0x128cf5[_0xb668('0x12')][_0xb668('0x13')]===0x1f4){logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x517fc5(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x3f01bc(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}else{logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));_0x3f01bc(_0x128cf5[_0xb668('0x15')][_0xb668('0x14')]);}})[_0xb668('0x16')](function(_0x4ab137){logger[_0xb668('0x12')]('Campaign,\x20%s,\x20%s',_0x2778e9,_0x4ab137);_0x517fc5(_0x4ab137);});});}exports[_0xb668('0x17')]=function(_0x89fe72){var _0x5438ff=this;return new Promise(function(_0x38595d,_0x18e9c1){return db['Campaign'][_0xb668('0x18')]({'raw':_0x89fe72['options']?_0x89fe72[_0xb668('0x19')][_0xb668('0x1a')]===undefined?!![]:![]:!![],'where':_0x89fe72[_0xb668('0x19')]?_0x89fe72[_0xb668('0x19')]['where']||null:null,'attributes':_0x89fe72[_0xb668('0x19')]?_0x89fe72[_0xb668('0x19')][_0xb668('0x1b')]||null:null,'limit':_0x89fe72['options']?_0x89fe72['options'][_0xb668('0x1c')]||null:null,'include':_0x89fe72[_0xb668('0x19')]?_0x89fe72['options'][_0xb668('0x1d')]?_['map'](_0x89fe72[_0xb668('0x19')]['include'],function(_0x3f4745){return{'model':db[_0x3f4745[_0xb668('0x1e')]],'as':_0x3f4745['as'],'attributes':_0x3f4745[_0xb668('0x1b')],'include':_0x3f4745[_0xb668('0x1d')]?_[_0xb668('0x1f')](_0x3f4745[_0xb668('0x1d')],function(_0x4d4bf8){return{'model':db[_0x4d4bf8[_0xb668('0x1e')]],'as':_0x4d4bf8['as'],'attributes':_0x4d4bf8[_0xb668('0x1b')],'include':_0x4d4bf8[_0xb668('0x1d')]?_['map'](_0x4d4bf8['include'],function(_0xe62fce){return{'model':db[_0xe62fce[_0xb668('0x1e')]],'as':_0xe62fce['as'],'attributes':_0xe62fce[_0xb668('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a2543){logger[_0xb668('0xc')](_0xb668('0x17'),_0x89fe72);logger['debug']('GetCampaign',_0x89fe72,JSON[_0xb668('0x11')](_0x3a2543));_0x38595d(_0x3a2543);})[_0xb668('0x16')](function(_0x589c58){logger[_0xb668('0x12')](_0xb668('0x17'),_0x589c58[_0xb668('0x14')],_0x89fe72);_0x18e9c1(_0x5438ff[_0xb668('0x12')](0x1f4,_0x589c58[_0xb668('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 5d3cc6c..6775a69 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 _0xab0a=['update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','put'];(function(_0x17ef24,_0x1179c6){var _0x3a98c9=function(_0x32f8bf){while(--_0x32f8bf){_0x17ef24['push'](_0x17ef24['shift']());}};_0x3a98c9(++_0x1179c6);}(_0xab0a,0x1f0));var _0xaab0=function(_0x38c5fc,_0x5f2b5a){_0x38c5fc=_0x38c5fc-0x0;var _0x4facce=_0xab0a[_0x38c5fc];return _0x4facce;};'use strict';var multer=require(_0xaab0('0x0'));var util=require(_0xaab0('0x1'));var path=require(_0xaab0('0x2'));var timeout=require(_0xaab0('0x3'));var express=require(_0xaab0('0x4'));var router=express[_0xaab0('0x5')]();var fs_extra=require(_0xaab0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xaab0('0x7'));var config=require(_0xaab0('0x8'));var controller=require(_0xaab0('0x9'));router[_0xaab0('0xa')]('/',auth[_0xaab0('0xb')](),controller[_0xaab0('0xc')]);router[_0xaab0('0xa')](_0xaab0('0xd'),auth[_0xaab0('0xb')](),controller[_0xaab0('0xe')]);router[_0xaab0('0xa')](_0xaab0('0xf'),auth[_0xaab0('0xb')](),controller['getHoppers']);router[_0xaab0('0xa')](_0xaab0('0x10'),auth[_0xaab0('0xb')](),controller[_0xaab0('0x11')]);router['get'](_0xaab0('0x12'),auth['isAuthenticated'](),controller[_0xaab0('0x13')]);router['get']('/:id/hopper_black',auth[_0xaab0('0xb')](),controller['getHopperBlacks']);router[_0xaab0('0xa')](_0xaab0('0x14'),auth[_0xaab0('0xb')](),controller['getLists']);router['get'](_0xaab0('0x15'),auth[_0xaab0('0xb')](),controller[_0xaab0('0x16')]);router[_0xaab0('0x17')]('/',auth['isAuthenticated'](),controller[_0xaab0('0x18')]);router['post'](_0xaab0('0x19'),auth[_0xaab0('0xb')](),controller['clone']);router[_0xaab0('0x17')]('/:id/lists',auth['isAuthenticated'](),controller[_0xaab0('0x1a')]);router['post']('/:id/blacklists',auth[_0xaab0('0xb')](),controller[_0xaab0('0x1b')]);router[_0xaab0('0x1c')](_0xaab0('0xd'),auth[_0xaab0('0xb')](),controller[_0xaab0('0x1d')]);router[_0xaab0('0x1e')](_0xaab0('0xd'),auth[_0xaab0('0xb')](),controller[_0xaab0('0x1f')]);router[_0xaab0('0x1e')]('/:id/lists',auth[_0xaab0('0xb')](),controller[_0xaab0('0x20')]);router[_0xaab0('0x1e')](_0xaab0('0x15'),auth['isAuthenticated'](),controller[_0xaab0('0x21')]);module[_0xaab0('0x22')]=router; \ No newline at end of file +var _0x9969=['/:id','show','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','update','delete','removeLists','removeBlackLists','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index'];(function(_0x11cfed,_0x81349){var _0x1cbc6d=function(_0x18f638){while(--_0x18f638){_0x11cfed['push'](_0x11cfed['shift']());}};_0x1cbc6d(++_0x81349);}(_0x9969,0x130));var _0x9996=function(_0xb74243,_0xfda9ae){_0xb74243=_0xb74243-0x0;var _0x1a3869=_0x9969[_0xb74243];return _0x1a3869;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9996('0x0'));var timeout=require(_0x9996('0x1'));var express=require(_0x9996('0x2'));var router=express[_0x9996('0x3')]();var fs_extra=require(_0x9996('0x4'));var auth=require(_0x9996('0x5'));var interaction=require(_0x9996('0x6'));var config=require(_0x9996('0x7'));var controller=require(_0x9996('0x8'));router[_0x9996('0x9')]('/',auth['isAuthenticated'](),controller[_0x9996('0xa')]);router[_0x9996('0x9')](_0x9996('0xb'),auth['isAuthenticated'](),controller[_0x9996('0xc')]);router[_0x9996('0x9')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x9996('0xd')]);router[_0x9996('0x9')](_0x9996('0xe'),auth[_0x9996('0xf')](),controller[_0x9996('0x10')]);router[_0x9996('0x9')](_0x9996('0x11'),auth[_0x9996('0xf')](),controller[_0x9996('0x12')]);router[_0x9996('0x9')](_0x9996('0x13'),auth[_0x9996('0xf')](),controller['getHopperBlacks']);router[_0x9996('0x9')]('/:id/lists',auth[_0x9996('0xf')](),controller[_0x9996('0x14')]);router['get'](_0x9996('0x15'),auth['isAuthenticated'](),controller[_0x9996('0x16')]);router[_0x9996('0x17')]('/',auth[_0x9996('0xf')](),controller[_0x9996('0x18')]);router[_0x9996('0x17')](_0x9996('0x19'),auth['isAuthenticated'](),controller[_0x9996('0x1a')]);router[_0x9996('0x17')](_0x9996('0x1b'),auth['isAuthenticated'](),controller[_0x9996('0x1c')]);router[_0x9996('0x17')]('/:id/blacklists',auth[_0x9996('0xf')](),controller[_0x9996('0x1d')]);router['put']('/:id',auth[_0x9996('0xf')](),controller[_0x9996('0x1e')]);router[_0x9996('0x1f')]('/:id',auth[_0x9996('0xf')](),controller['destroy']);router[_0x9996('0x1f')](_0x9996('0x1b'),auth['isAuthenticated'](),controller[_0x9996('0x20')]);router[_0x9996('0x1f')](_0x9996('0x15'),auth[_0x9996('0xf')](),controller[_0x9996('0x21')]);module[_0x9996('0x22')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 20ee1c4..8f925c1 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 _0x831c=['VIRTUAL','getDataValue','sequelize','STRING','TEXT'];(function(_0x5a5aca,_0x368fbb){var _0x1cb523=function(_0x43f690){while(--_0x43f690){_0x5a5aca['push'](_0x5a5aca['shift']());}};_0x1cb523(++_0x368fbb);}(_0x831c,0x16a));var _0xc831=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x831c[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xc831('0x0'));module['exports']={'key':{'type':Sequelize[_0xc831('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xc831('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc831('0x1')]},'name':{'type':Sequelize[_0xc831('0x3')],'get':function(){return this[_0xc831('0x4')]('key');}}}; \ No newline at end of file +var _0xb861=['TEXT','VIRTUAL','getDataValue','key','STRING'];(function(_0x53fef7,_0x4bb56d){var _0x36b861=function(_0x207a8e){while(--_0x207a8e){_0x53fef7['push'](_0x53fef7['shift']());}};_0x36b861(++_0x4bb56d);}(_0xb861,0x6d));var _0x1b86=function(_0x14c8ee,_0x34d4fb){_0x14c8ee=_0x14c8ee-0x0;var _0x51acc2=_0xb861[_0x14c8ee];return _0x51acc2;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x1b86('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x1b86('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1b86('0x0')]},'name':{'type':Sequelize[_0x1b86('0x2')],'get':function(){return this[_0x1b86('0x3')](_0x1b86('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 50d62bf..4acfdc1 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 _0x971d=['ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/license/util','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','CannedAnswer','fieldName','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','include','findAll','catch','show','params','keys','rawAttributes','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x971d,0x110));var _0xd971=function(_0x3435e7,_0xf8e628){_0x3435e7=_0x3435e7-0x0;var _0x26cdd7=_0x971d[_0x3435e7];return _0x26cdd7;};'use strict';var emlformat=require(_0xd971('0x0'));var rimraf=require(_0xd971('0x1'));var zipdir=require(_0xd971('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd971('0x3'));var moment=require('moment');var BPromise=require(_0xd971('0x4'));var Mustache=require(_0xd971('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd971('0x6'));var csv=require(_0xd971('0x7'));var ejs=require(_0xd971('0x8'));var fs=require('fs');var fs_extra=require(_0xd971('0x9'));var _=require(_0xd971('0xa'));var squel=require(_0xd971('0xb'));var crypto=require(_0xd971('0xc'));var jsforce=require(_0xd971('0xd'));var deskjs=require(_0xd971('0xe'));var toCsv=require(_0xd971('0x7'));var querystring=require(_0xd971('0xf'));var Papa=require(_0xd971('0x10'));var Redis=require(_0xd971('0x11'));var authService=require(_0xd971('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd971('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd971('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c6492,_0x4daa64){_0x4daa64=_0x4daa64||0xcc;return function(_0x537178){if(_0x537178){return _0x2c6492[_0xd971('0x15')](_0x4daa64);}return _0x2c6492['status'](_0x4daa64)[_0xd971('0x16')]();};}function respondWithResult(_0x4fbaaa,_0x31387a){_0x31387a=_0x31387a||0xc8;return function(_0x3ef19f){if(_0x3ef19f){return _0x4fbaaa['status'](_0x31387a)[_0xd971('0x17')](_0x3ef19f);}};}function respondWithFilteredResult(_0x5bfa18,_0x18658e){return function(_0x3977d4){if(_0x3977d4){var _0x13df11=typeof _0x18658e['offset']===_0xd971('0x18')&&typeof _0x18658e[_0xd971('0x19')]===_0xd971('0x18');var _0x308f65=_0x3977d4[_0xd971('0x1a')];var _0x1e70b7=_0x13df11?0x0:_0x18658e[_0xd971('0x1b')];var _0x1fba0c=_0x13df11?_0x3977d4[_0xd971('0x1a')]:_0x18658e[_0xd971('0x1b')]+_0x18658e[_0xd971('0x19')];var _0x3d6477;if(_0x1fba0c>=_0x308f65){_0x1fba0c=_0x308f65;_0x3d6477=0xc8;}else{_0x3d6477=0xce;}_0x5bfa18[_0xd971('0x1c')](_0x3d6477);return _0x5bfa18[_0xd971('0x1d')](_0xd971('0x1e'),_0x1e70b7+'-'+_0x1fba0c+'/'+_0x308f65)[_0xd971('0x17')](_0x3977d4);}return null;};}function patchUpdates(_0x2a1aef){return function(_0x540c5f){try{jsonpatch['apply'](_0x540c5f,_0x2a1aef,!![]);}catch(_0x5aa8cd){return BPromise[_0xd971('0x1f')](_0x5aa8cd);}return _0x540c5f[_0xd971('0x20')]();};}function saveUpdates(_0x5589a8,_0x1396ea){return function(_0x32f96a){if(_0x32f96a){return _0x32f96a[_0xd971('0x21')](_0x5589a8)[_0xd971('0x22')](function(_0x511be0){return _0x511be0;});}return null;};}function removeEntity(_0x152461,_0x2e017c){return function(_0x2e7212){if(_0x2e7212){return _0x2e7212[_0xd971('0x23')]()[_0xd971('0x22')](function(){var _0x176b9c=_0x2e7212['get']({'plain':!![]});var _0x19abf1='CannedAnswers';return db['UserProfileResource'][_0xd971('0x23')]({'where':{'type':_0x19abf1,'resourceId':_0x176b9c['id']}})[_0xd971('0x22')](function(){return _0x2e7212;});})[_0xd971('0x22')](function(){_0x152461[_0xd971('0x1c')](0xcc)[_0xd971('0x16')]();});}};}function handleEntityNotFound(_0x1f23c2,_0x3e3989){return function(_0x280f48){if(!_0x280f48){_0x1f23c2[_0xd971('0x15')](0x194);}return _0x280f48;};}function handleError(_0x55d736,_0xf07e13){_0xf07e13=_0xf07e13||0x1f4;return function(_0x29b5c5){logger['error'](_0x29b5c5[_0xd971('0x24')]);if(_0x29b5c5[_0xd971('0x25')]){delete _0x29b5c5[_0xd971('0x25')];}_0x55d736[_0xd971('0x1c')](_0xf07e13)[_0xd971('0x26')](_0x29b5c5);};}exports[_0xd971('0x27')]=function(_0x9e177,_0x4f9bf7){var _0x178969={},_0xd7cf20={},_0xdc9164={'count':0x0,'rows':[]};var _0x1c16af=_[_0xd971('0x28')](db[_0xd971('0x29')]['rawAttributes'],function(_0xecf43){return{'name':_0xecf43[_0xd971('0x2a')],'type':_0xecf43['type'][_0xd971('0x2b')]};});_0xd7cf20['model']=_['map'](_0x1c16af,_0xd971('0x25'));_0xd7cf20[_0xd971('0x2c')]=_['keys'](_0x9e177[_0xd971('0x2c')]);_0xd7cf20['filters']=_[_0xd971('0x2d')](_0xd7cf20['model'],_0xd7cf20[_0xd971('0x2c')]);_0x178969['attributes']=_['intersection'](_0xd7cf20[_0xd971('0x2e')],qs['fields'](_0x9e177[_0xd971('0x2c')][_0xd971('0x2f')]));_0x178969[_0xd971('0x30')]=_0x178969['attributes'][_0xd971('0x31')]?_0x178969[_0xd971('0x30')]:_0xd7cf20['model'];if(!_0x9e177[_0xd971('0x2c')][_0xd971('0x32')](_0xd971('0x33'))){_0x178969[_0xd971('0x19')]=qs[_0xd971('0x19')](_0x9e177[_0xd971('0x2c')][_0xd971('0x19')]);_0x178969['offset']=qs[_0xd971('0x1b')](_0x9e177[_0xd971('0x2c')][_0xd971('0x1b')]);}_0x178969['order']=qs[_0xd971('0x34')](_0x9e177[_0xd971('0x2c')][_0xd971('0x34')]);_0x178969[_0xd971('0x35')]=qs[_0xd971('0x36')](_[_0xd971('0x37')](_0x9e177[_0xd971('0x2c')],_0xd7cf20[_0xd971('0x36')]),_0x1c16af);if(_0x9e177[_0xd971('0x2c')][_0xd971('0x38')]){_0x178969[_0xd971('0x35')]=_[_0xd971('0x39')](_0x178969[_0xd971('0x35')],{'$or':[{'key':{'$like':'%'+_0x9e177[_0xd971('0x2c')]['filter']+'%'}},{'value':{'$like':'%'+_0x9e177['query'][_0xd971('0x38')]+'%'}}]});}_0x178969=_[_0xd971('0x39')]({},_0x178969,_0x9e177[_0xd971('0x3a')]);var _0x56e683={'where':_0x178969[_0xd971('0x35')]};return db[_0xd971('0x29')][_0xd971('0x1a')](_0x56e683)['then'](function(_0x599381){_0xdc9164[_0xd971('0x1a')]=_0x599381;if(_0x9e177[_0xd971('0x2c')]['includeAll']){_0x178969[_0xd971('0x3b')]=[{'all':!![]}];}return db[_0xd971('0x29')][_0xd971('0x3c')](_0x178969);})[_0xd971('0x22')](function(_0x5d4629){_0xdc9164['rows']=_0x5d4629;return _0xdc9164;})[_0xd971('0x22')](respondWithFilteredResult(_0x4f9bf7,_0x178969))[_0xd971('0x3d')](handleError(_0x4f9bf7,null));};exports[_0xd971('0x3e')]=function(_0x44b8a8,_0xf3f841){var _0x335455={'raw':!![],'where':{'id':_0x44b8a8[_0xd971('0x3f')]['id']}},_0x1a5d81={};_0x1a5d81[_0xd971('0x2e')]=_[_0xd971('0x40')](db[_0xd971('0x29')][_0xd971('0x41')]);_0x1a5d81[_0xd971('0x2c')]=_[_0xd971('0x40')](_0x44b8a8['query']);_0x1a5d81[_0xd971('0x36')]=_[_0xd971('0x2d')](_0x1a5d81[_0xd971('0x2e')],_0x1a5d81[_0xd971('0x2c')]);_0x335455[_0xd971('0x30')]=_['intersection'](_0x1a5d81[_0xd971('0x2e')],qs['fields'](_0x44b8a8['query'][_0xd971('0x2f')]));_0x335455['attributes']=_0x335455[_0xd971('0x30')][_0xd971('0x31')]?_0x335455['attributes']:_0x1a5d81[_0xd971('0x2e')];if(_0x44b8a8[_0xd971('0x2c')]['includeAll']){_0x335455['include']=[{'all':!![]}];}_0x335455=_[_0xd971('0x39')]({},_0x335455,_0x44b8a8['options']);return db[_0xd971('0x29')][_0xd971('0x42')](_0x335455)[_0xd971('0x22')](handleEntityNotFound(_0xf3f841,null))[_0xd971('0x22')](respondWithResult(_0xf3f841,null))[_0xd971('0x3d')](handleError(_0xf3f841,null));};exports[_0xd971('0x21')]=function(_0x517d86,_0x1f5910){if(_0x517d86[_0xd971('0x43')]['id']){delete _0x517d86[_0xd971('0x43')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x517d86[_0xd971('0x3f')]['id']}})[_0xd971('0x22')](handleEntityNotFound(_0x1f5910,null))['then'](saveUpdates(_0x517d86[_0xd971('0x43')],null))[_0xd971('0x22')](respondWithResult(_0x1f5910,null))[_0xd971('0x3d')](handleError(_0x1f5910,null));};exports[_0xd971('0x23')]=function(_0x56415b,_0xb3d11){return db['CannedAnswer'][_0xd971('0x42')]({'where':{'id':_0x56415b['params']['id']}})[_0xd971('0x22')](handleEntityNotFound(_0xb3d11,null))['then'](removeEntity(_0xb3d11,null))[_0xd971('0x3d')](handleError(_0xb3d11,null));};exports[_0xd971('0x44')]=function(_0x54c9c8,_0x5ca696){var _0x4ad8e4={'key':_0x54c9c8[_0xd971('0x43')]['key']};if(_0x54c9c8[_0xd971('0x43')][_0xd971('0x45')]){_0x4ad8e4[_0xd971('0x45')]=_0x54c9c8[_0xd971('0x43')][_0xd971('0x45')];}else if(_0x54c9c8[_0xd971('0x43')][_0xd971('0x46')]){_0x4ad8e4[_0xd971('0x46')]=_0x54c9c8['body'][_0xd971('0x46')];}else if(_0x54c9c8['body'][_0xd971('0x47')]){_0x4ad8e4[_0xd971('0x47')]=_0x54c9c8['body']['OpenchannelAccountId'];}else if(_0x54c9c8[_0xd971('0x43')][_0xd971('0x48')]){_0x4ad8e4[_0xd971('0x48')]=_0x54c9c8[_0xd971('0x43')][_0xd971('0x48')];}return db[_0xd971('0x29')]['find']({'where':_0x4ad8e4})[_0xd971('0x22')](function(_0x1561fa){if(_0x1561fa){throw new db[(_0xd971('0x49'))][(_0xd971('0x4a'))](_0xd971('0x4b'));}return db['CannedAnswer'][_0xd971('0x44')](_0x54c9c8['body']);})['then'](function(_0x2c6fe0){var _0x1401ff=_0x54c9c8[_0xd971('0x4c')][_0xd971('0x4d')]({'plain':!![]});if(!_0x1401ff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1401ff[_0xd971('0x4e')]===_0xd971('0x4c')){var _0x577602=_0x2c6fe0[_0xd971('0x4d')]({'plain':!![]});return db[_0xd971('0x4f')][_0xd971('0x42')]({'where':{'name':_0xd971('0x50'),'userProfileId':_0x1401ff[_0xd971('0x51')]},'raw':!![]})[_0xd971('0x22')](function(_0x180a8f){if(_0x180a8f&&_0x180a8f[_0xd971('0x52')]===0x0){return db[_0xd971('0x53')]['create']({'name':_0x577602[_0xd971('0x25')],'resourceId':_0x577602['id'],'type':_0x180a8f[_0xd971('0x25')],'sectionId':_0x180a8f['id']},{})['then'](function(){return _0x2c6fe0;});}else{return _0x2c6fe0;}})[_0xd971('0x3d')](function(_0x1cddf4){logger[_0xd971('0x54')](_0xd971('0x55'),_0x1cddf4);throw _0x1cddf4;});}return _0x2c6fe0;})['then'](respondWithResult(_0x5ca696,0xc9))[_0xd971('0x3d')](handleError(_0x5ca696,null));}; \ No newline at end of file +var _0x2791=['merge','where','includeAll','include','rows','catch','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','set','reject','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x26bad6,_0x134604){var _0x11c8a5=function(_0x28577f){while(--_0x28577f){_0x26bad6['push'](_0x26bad6['shift']());}};_0x11c8a5(++_0x134604);}(_0x2791,0x69));var _0x1279=function(_0x499eaf,_0x395cf6){_0x499eaf=_0x499eaf-0x0;var _0x43d4ba=_0x2791[_0x499eaf];return _0x43d4ba;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1279('0x0'));var jsonpatch=require(_0x1279('0x1'));var rp=require('request-promise');var moment=require(_0x1279('0x2'));var BPromise=require(_0x1279('0x3'));var Mustache=require(_0x1279('0x4'));var util=require('util');var path=require(_0x1279('0x5'));var sox=require(_0x1279('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1279('0x7'));var _=require(_0x1279('0x8'));var squel=require('squel');var crypto=require(_0x1279('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1279('0xa'));var toCsv=require(_0x1279('0xb'));var querystring=require(_0x1279('0xc'));var Papa=require(_0x1279('0xd'));var Redis=require(_0x1279('0xe'));var authService=require(_0x1279('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1279('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1279('0x11'))(_0x1279('0x12'));var utils=require(_0x1279('0x13'));var config=require(_0x1279('0x14'));var licenseUtil=require(_0x1279('0x15'));var db=require(_0x1279('0x16'))['db'];function respondWithStatusCode(_0x3846f9,_0x13dbd1){_0x13dbd1=_0x13dbd1||0xcc;return function(_0x2cac17){if(_0x2cac17){return _0x3846f9['sendStatus'](_0x13dbd1);}return _0x3846f9[_0x1279('0x17')](_0x13dbd1)['end']();};}function respondWithResult(_0x83e0bd,_0x4ad25a){_0x4ad25a=_0x4ad25a||0xc8;return function(_0x1081af){if(_0x1081af){return _0x83e0bd[_0x1279('0x17')](_0x4ad25a)[_0x1279('0x18')](_0x1081af);}};}function respondWithFilteredResult(_0x5dfa40,_0xcc3e96){return function(_0xc9180d){if(_0xc9180d){var _0x1c4139=typeof _0xcc3e96['offset']==='undefined'&&typeof _0xcc3e96[_0x1279('0x19')]===_0x1279('0x1a');var _0x138d2f=_0xc9180d[_0x1279('0x1b')];var _0x4f89fb=_0x1c4139?0x0:_0xcc3e96[_0x1279('0x1c')];var _0x3d48e3=_0x1c4139?_0xc9180d[_0x1279('0x1b')]:_0xcc3e96[_0x1279('0x1c')]+_0xcc3e96[_0x1279('0x19')];var _0x324ef0;if(_0x3d48e3>=_0x138d2f){_0x3d48e3=_0x138d2f;_0x324ef0=0xc8;}else{_0x324ef0=0xce;}_0x5dfa40[_0x1279('0x17')](_0x324ef0);return _0x5dfa40[_0x1279('0x1d')]('Content-Range',_0x4f89fb+'-'+_0x3d48e3+'/'+_0x138d2f)[_0x1279('0x18')](_0xc9180d);}return null;};}function patchUpdates(_0x1868a7){return function(_0x4e6e19){try{jsonpatch['apply'](_0x4e6e19,_0x1868a7,!![]);}catch(_0x449fe0){return BPromise[_0x1279('0x1e')](_0x449fe0);}return _0x4e6e19[_0x1279('0x1f')]();};}function saveUpdates(_0x20c3f3,_0x23945d){return function(_0x4f2e4d){if(_0x4f2e4d){return _0x4f2e4d[_0x1279('0x20')](_0x20c3f3)[_0x1279('0x21')](function(_0x34301c){return _0x34301c;});}return null;};}function removeEntity(_0x5449d9,_0x15484e){return function(_0x528fd1){if(_0x528fd1){return _0x528fd1['destroy']()[_0x1279('0x21')](function(){var _0x21405e=_0x528fd1[_0x1279('0x22')]({'plain':!![]});var _0x7b8642='CannedAnswers';return db[_0x1279('0x23')][_0x1279('0x24')]({'where':{'type':_0x7b8642,'resourceId':_0x21405e['id']}})['then'](function(){return _0x528fd1;});})[_0x1279('0x21')](function(){_0x5449d9['status'](0xcc)[_0x1279('0x25')]();});}};}function handleEntityNotFound(_0x28c94b,_0x58e8df){return function(_0x120972){if(!_0x120972){_0x28c94b['sendStatus'](0x194);}return _0x120972;};}function handleError(_0x414b56,_0x42a68e){_0x42a68e=_0x42a68e||0x1f4;return function(_0x20533e){logger[_0x1279('0x26')](_0x20533e[_0x1279('0x27')]);if(_0x20533e[_0x1279('0x28')]){delete _0x20533e[_0x1279('0x28')];}_0x414b56[_0x1279('0x17')](_0x42a68e)['send'](_0x20533e);};}exports[_0x1279('0x29')]=function(_0x77208f,_0x316474){var _0x6999a5={},_0x1a3aed={},_0x21170d={'count':0x0,'rows':[]};var _0x5be4b9=_[_0x1279('0x2a')](db[_0x1279('0x2b')][_0x1279('0x2c')],function(_0x4ef257){return{'name':_0x4ef257[_0x1279('0x2d')],'type':_0x4ef257['type'][_0x1279('0x2e')]};});_0x1a3aed[_0x1279('0x2f')]=_['map'](_0x5be4b9,_0x1279('0x28'));_0x1a3aed['query']=_[_0x1279('0x30')](_0x77208f[_0x1279('0x31')]);_0x1a3aed[_0x1279('0x32')]=_['intersection'](_0x1a3aed['model'],_0x1a3aed[_0x1279('0x31')]);_0x6999a5[_0x1279('0x33')]=_[_0x1279('0x34')](_0x1a3aed['model'],qs[_0x1279('0x35')](_0x77208f[_0x1279('0x31')][_0x1279('0x35')]));_0x6999a5[_0x1279('0x33')]=_0x6999a5['attributes'][_0x1279('0x36')]?_0x6999a5['attributes']:_0x1a3aed['model'];if(!_0x77208f[_0x1279('0x31')][_0x1279('0x37')](_0x1279('0x38'))){_0x6999a5[_0x1279('0x19')]=qs[_0x1279('0x19')](_0x77208f[_0x1279('0x31')]['limit']);_0x6999a5[_0x1279('0x1c')]=qs[_0x1279('0x1c')](_0x77208f[_0x1279('0x31')][_0x1279('0x1c')]);}_0x6999a5[_0x1279('0x39')]=qs['sort'](_0x77208f[_0x1279('0x31')][_0x1279('0x3a')]);_0x6999a5['where']=qs[_0x1279('0x32')](_[_0x1279('0x3b')](_0x77208f[_0x1279('0x31')],_0x1a3aed[_0x1279('0x32')]),_0x5be4b9);if(_0x77208f['query'][_0x1279('0x3c')]){_0x6999a5['where']=_[_0x1279('0x3d')](_0x6999a5[_0x1279('0x3e')],{'$or':[{'key':{'$like':'%'+_0x77208f[_0x1279('0x31')][_0x1279('0x3c')]+'%'}},{'value':{'$like':'%'+_0x77208f[_0x1279('0x31')][_0x1279('0x3c')]+'%'}}]});}_0x6999a5=_[_0x1279('0x3d')]({},_0x6999a5,_0x77208f['options']);var _0x366fdb={'where':_0x6999a5[_0x1279('0x3e')]};return db['CannedAnswer'][_0x1279('0x1b')](_0x366fdb)['then'](function(_0x1bb566){_0x21170d[_0x1279('0x1b')]=_0x1bb566;if(_0x77208f['query'][_0x1279('0x3f')]){_0x6999a5[_0x1279('0x40')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x6999a5);})[_0x1279('0x21')](function(_0x3d4232){_0x21170d[_0x1279('0x41')]=_0x3d4232;return _0x21170d;})['then'](respondWithFilteredResult(_0x316474,_0x6999a5))[_0x1279('0x42')](handleError(_0x316474,null));};exports['show']=function(_0x3cbdd0,_0x451ca0){var _0x1c917e={'raw':!![],'where':{'id':_0x3cbdd0['params']['id']}},_0xae0c0a={};_0xae0c0a[_0x1279('0x2f')]=_[_0x1279('0x30')](db['CannedAnswer']['rawAttributes']);_0xae0c0a[_0x1279('0x31')]=_[_0x1279('0x30')](_0x3cbdd0[_0x1279('0x31')]);_0xae0c0a['filters']=_[_0x1279('0x34')](_0xae0c0a['model'],_0xae0c0a[_0x1279('0x31')]);_0x1c917e[_0x1279('0x33')]=_[_0x1279('0x34')](_0xae0c0a[_0x1279('0x2f')],qs['fields'](_0x3cbdd0[_0x1279('0x31')][_0x1279('0x35')]));_0x1c917e['attributes']=_0x1c917e[_0x1279('0x33')][_0x1279('0x36')]?_0x1c917e[_0x1279('0x33')]:_0xae0c0a[_0x1279('0x2f')];if(_0x3cbdd0[_0x1279('0x31')][_0x1279('0x3f')]){_0x1c917e[_0x1279('0x40')]=[{'all':!![]}];}_0x1c917e=_[_0x1279('0x3d')]({},_0x1c917e,_0x3cbdd0['options']);return db['CannedAnswer'][_0x1279('0x43')](_0x1c917e)[_0x1279('0x21')](handleEntityNotFound(_0x451ca0,null))[_0x1279('0x21')](respondWithResult(_0x451ca0,null))[_0x1279('0x42')](handleError(_0x451ca0,null));};exports[_0x1279('0x20')]=function(_0x180c05,_0x234d90){if(_0x180c05[_0x1279('0x44')]['id']){delete _0x180c05[_0x1279('0x44')]['id'];}return db[_0x1279('0x2b')]['find']({'where':{'id':_0x180c05[_0x1279('0x45')]['id']}})['then'](handleEntityNotFound(_0x234d90,null))['then'](saveUpdates(_0x180c05[_0x1279('0x44')],null))['then'](respondWithResult(_0x234d90,null))[_0x1279('0x42')](handleError(_0x234d90,null));};exports[_0x1279('0x24')]=function(_0x5bf850,_0x24de25){return db[_0x1279('0x2b')][_0x1279('0x43')]({'where':{'id':_0x5bf850[_0x1279('0x45')]['id']}})[_0x1279('0x21')](handleEntityNotFound(_0x24de25,null))[_0x1279('0x21')](removeEntity(_0x24de25,null))[_0x1279('0x42')](handleError(_0x24de25,null));};exports[_0x1279('0x46')]=function(_0xa4c446,_0x199561){var _0x1a507c={'key':_0xa4c446[_0x1279('0x44')][_0x1279('0x2e')]};if(_0xa4c446[_0x1279('0x44')]['MailAccountId']){_0x1a507c['MailAccountId']=_0xa4c446[_0x1279('0x44')][_0x1279('0x47')];}else if(_0xa4c446[_0x1279('0x44')][_0x1279('0x48')]){_0x1a507c[_0x1279('0x48')]=_0xa4c446[_0x1279('0x44')][_0x1279('0x48')];}else if(_0xa4c446[_0x1279('0x44')][_0x1279('0x49')]){_0x1a507c[_0x1279('0x49')]=_0xa4c446[_0x1279('0x44')][_0x1279('0x49')];}else if(_0xa4c446[_0x1279('0x44')][_0x1279('0x4a')]){_0x1a507c[_0x1279('0x4a')]=_0xa4c446[_0x1279('0x44')][_0x1279('0x4a')];}return db[_0x1279('0x2b')]['find']({'where':_0x1a507c})[_0x1279('0x21')](function(_0x35d2ac){if(_0x35d2ac){throw new db['Sequelize'][(_0x1279('0x4b'))](_0x1279('0x4c'));}return db[_0x1279('0x2b')][_0x1279('0x46')](_0xa4c446[_0x1279('0x44')]);})[_0x1279('0x21')](function(_0x182f0c){var _0x1b14b6=_0xa4c446[_0x1279('0x4d')][_0x1279('0x22')]({'plain':!![]});if(!_0x1b14b6)throw new Error(_0x1279('0x4e'));if(_0x1b14b6[_0x1279('0x4f')]===_0x1279('0x4d')){var _0x173b29=_0x182f0c[_0x1279('0x22')]({'plain':!![]});return db[_0x1279('0x50')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x1b14b6[_0x1279('0x51')]},'raw':!![]})['then'](function(_0x123745){if(_0x123745&&_0x123745['autoAssociation']===0x0){return db[_0x1279('0x23')][_0x1279('0x46')]({'name':_0x173b29['name'],'resourceId':_0x173b29['id'],'type':_0x123745[_0x1279('0x28')],'sectionId':_0x123745['id']},{})[_0x1279('0x21')](function(){return _0x182f0c;});}else{return _0x182f0c;}})['catch'](function(_0x2abe9e){logger[_0x1279('0x26')](_0x1279('0x52'),_0x2abe9e);throw _0x2abe9e;});}return _0x182f0c;})['then'](respondWithResult(_0x199561,0xc9))[_0x1279('0x42')](handleError(_0x199561,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 0a30a28..3205977 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 _0x95ba=['utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x95ba,0x70));var _0xa95b=function(_0x51c62d,_0x450753){_0x51c62d=_0x51c62d-0x0;var _0x4523ae=_0x95ba[_0x51c62d];return _0x4523ae;};'use strict';var _=require(_0xa95b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa95b('0x1'));var moment=require('moment');var BPromise=require(_0xa95b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa95b('0x3'));var config=require(_0xa95b('0x4'));var attributes=require('./cannedAnswer.attributes');module[_0xa95b('0x5')]=function(_0x1f2e91,_0x2db0d2){return _0x1f2e91[_0xa95b('0x6')](_0xa95b('0x7'),attributes,{'tableName':_0xa95b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa95b('0x9'),'collate':_0xa95b('0xa')});}; \ No newline at end of file +var _0xec49=['moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','api'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xec49,0x190));var _0x9ec4=function(_0x516cae,_0x1d8e6b){_0x516cae=_0x516cae-0x0;var _0x19e67d=_0xec49[_0x516cae];return _0x19e67d;};'use strict';var _=require(_0x9ec4('0x0'));var util=require(_0x9ec4('0x1'));var logger=require('../../config/logger')(_0x9ec4('0x2'));var moment=require(_0x9ec4('0x3'));var BPromise=require('bluebird');var rp=require(_0x9ec4('0x4'));var fs=require('fs');var path=require(_0x9ec4('0x5'));var rimraf=require(_0x9ec4('0x6'));var config=require(_0x9ec4('0x7'));var attributes=require(_0x9ec4('0x8'));module['exports']=function(_0xa9e55,_0x19fb25){return _0xa9e55[_0x9ec4('0x9')](_0x9ec4('0xa'),attributes,{'tableName':_0x9ec4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ec4('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index c70d8a5..b0a0db5 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(_0x409ef9,_0x14f71a){var _0x224557=function(_0x3807d0){while(--_0x3807d0){_0x409ef9['push'](_0x409ef9['shift']());}};_0x224557(++_0x14f71a);}(_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 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(_0x1e8ad4,_0x5eb129){var _0x387e1e=function(_0x3ab946){while(--_0x3ab946){_0x1e8ad4['push'](_0x1e8ad4['shift']());}};_0x387e1e(++_0x5eb129);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 a0e61e4..a46cdb7 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 _0xb669=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','create','/:id','update','destroy'];(function(_0x45d879,_0x4e1f98){var _0x4241b9=function(_0x4e823d){while(--_0x4e823d){_0x45d879['push'](_0x45d879['shift']());}};_0x4241b9(++_0x4e1f98);}(_0xb669,0x89));var _0x9b66=function(_0x31bfe0,_0x2fe2bb){_0x31bfe0=_0x31bfe0-0x0;var _0x87bd7d=_0xb669[_0x31bfe0];return _0x87bd7d;};'use strict';var multer=require(_0x9b66('0x0'));var util=require(_0x9b66('0x1'));var path=require(_0x9b66('0x2'));var timeout=require(_0x9b66('0x3'));var express=require(_0x9b66('0x4'));var router=express[_0x9b66('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9b66('0x6'));var config=require(_0x9b66('0x7'));var controller=require(_0x9b66('0x8'));router[_0x9b66('0x9')]('/',auth[_0x9b66('0xa')](),controller[_0x9b66('0xb')]);router[_0x9b66('0x9')]('/:id',auth[_0x9b66('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x9b66('0xc')]);router['put'](_0x9b66('0xd'),auth[_0x9b66('0xa')](),controller[_0x9b66('0xe')]);router['delete'](_0x9b66('0xd'),auth['isAuthenticated'](),controller[_0x9b66('0xf')]);module[_0x9b66('0x10')]=router; \ No newline at end of file +var _0xb133=['isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./cannedAnswer.controller','get'];(function(_0x5e73de,_0x48194d){var _0x1b1f6b=function(_0x20ce76){while(--_0x20ce76){_0x5e73de['push'](_0x5e73de['shift']());}};_0x1b1f6b(++_0x48194d);}(_0xb133,0x75));var _0x3b13=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xb133[_0x2e4e19];return _0x9ba20b;};'use strict';var multer=require(_0x3b13('0x0'));var util=require(_0x3b13('0x1'));var path=require(_0x3b13('0x2'));var timeout=require(_0x3b13('0x3'));var express=require(_0x3b13('0x4'));var router=express[_0x3b13('0x5')]();var fs_extra=require(_0x3b13('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3b13('0x7'));router[_0x3b13('0x8')]('/',auth[_0x3b13('0x9')](),controller[_0x3b13('0xa')]);router[_0x3b13('0x8')](_0x3b13('0xb'),auth[_0x3b13('0x9')](),controller[_0x3b13('0xc')]);router['post']('/',auth[_0x3b13('0x9')](),controller[_0x3b13('0xd')]);router[_0x3b13('0xe')](_0x3b13('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x3b13('0xf')](_0x3b13('0xb'),auth[_0x3b13('0x9')](),controller[_0x3b13('0x10')]);module[_0x3b13('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 922bdf9..ea2affc 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 _0xb910=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb910,0x12b));var _0x0b91=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xb910[_0x39c734];return _0xb2a2f9;};'use strict';var Sequelize=require(_0x0b91('0x0'));module[_0x0b91('0x1')]={'calldate':{'type':Sequelize[_0x0b91('0x2')],'allowNull':![],'defaultValue':_0x0b91('0x3')},'clid':{'type':Sequelize[_0x0b91('0x4')]},'src':{'type':Sequelize[_0x0b91('0x4')]},'dst':{'type':Sequelize[_0x0b91('0x4')]},'dcontext':{'type':Sequelize[_0x0b91('0x4')]},'channel':{'type':Sequelize[_0x0b91('0x4')]},'dstchannel':{'type':Sequelize[_0x0b91('0x4')]},'lastapp':{'type':Sequelize[_0x0b91('0x4')]},'lastdata':{'type':Sequelize[_0x0b91('0x4')]},'duration':{'type':Sequelize[_0x0b91('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0b91('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x0b91('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0b91('0x4')]},'userfield':{'type':Sequelize[_0x0b91('0x4')]},'uniqueid':{'type':Sequelize[_0x0b91('0x4')]},'linkedid':{'type':Sequelize[_0x0b91('0x4')]},'sequence':{'type':Sequelize[_0x0b91('0x4')]},'peeraccount':{'type':Sequelize[_0x0b91('0x4')]},'type':{'type':Sequelize[_0x0b91('0x4')]},'tag':{'type':Sequelize[_0x0b91('0x4')]}}; \ No newline at end of file +var _0x301e=['sequelize','exports','DATE','STRING','INTEGER'];(function(_0x584c85,_0x5c9c9a){var _0x603397=function(_0x10917b){while(--_0x10917b){_0x584c85['push'](_0x584c85['shift']());}};_0x603397(++_0x5c9c9a);}(_0x301e,0x6e));var _0xe301=function(_0x33e70b,_0x10829e){_0x33e70b=_0x33e70b-0x0;var _0x43f1c8=_0x301e[_0x33e70b];return _0x43f1c8;};'use strict';var Sequelize=require(_0xe301('0x0'));module[_0xe301('0x1')]={'calldate':{'type':Sequelize[_0xe301('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xe301('0x3')]},'src':{'type':Sequelize[_0xe301('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xe301('0x3')]},'channel':{'type':Sequelize[_0xe301('0x3')]},'dstchannel':{'type':Sequelize[_0xe301('0x3')]},'lastapp':{'type':Sequelize[_0xe301('0x3')]},'lastdata':{'type':Sequelize[_0xe301('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe301('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe301('0x3')]},'amaflags':{'type':Sequelize[_0xe301('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe301('0x3')]},'userfield':{'type':Sequelize[_0xe301('0x3')]},'uniqueid':{'type':Sequelize[_0xe301('0x3')]},'linkedid':{'type':Sequelize[_0xe301('0x3')]},'sequence':{'type':Sequelize[_0xe301('0x3')]},'peeraccount':{'type':Sequelize[_0xe301('0x3')]},'type':{'type':Sequelize[_0xe301('0x3')]},'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 66d281e..feb2626 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 _0x0bde=['findAll','rows','create','body','catch','update','find','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0bd('0x1'));var rp=require(_0xe0bd('0x2'));var moment=require(_0xe0bd('0x3'));var BPromise=require(_0xe0bd('0x4'));var Mustache=require(_0xe0bd('0x5'));var util=require('util');var path=require(_0xe0bd('0x6'));var sox=require(_0xe0bd('0x7'));var csv=require(_0xe0bd('0x8'));var ejs=require(_0xe0bd('0x9'));var fs=require('fs');var fs_extra=require(_0xe0bd('0xa'));var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0bd('0xd'));var deskjs=require(_0xe0bd('0xe'));var toCsv=require(_0xe0bd('0x8'));var querystring=require(_0xe0bd('0xf'));var Papa=require(_0xe0bd('0x10'));var Redis=require(_0xe0bd('0x11'));var authService=require(_0xe0bd('0x12'));var qs=require(_0xe0bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe0bd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe0bd('0x15'));var db=require(_0xe0bd('0x16'))['db'];function respondWithStatusCode(_0x54d40e,_0xc492b4){_0xc492b4=_0xc492b4||0xcc;return function(_0x5272ca){if(_0x5272ca){return _0x54d40e[_0xe0bd('0x17')](_0xc492b4);}return _0x54d40e[_0xe0bd('0x18')](_0xc492b4)[_0xe0bd('0x19')]();};}function respondWithResult(_0x20ab47,_0x47664e){_0x47664e=_0x47664e||0xc8;return function(_0x335f17){if(_0x335f17){return _0x20ab47[_0xe0bd('0x18')](_0x47664e)[_0xe0bd('0x1a')](_0x335f17);}};}function respondWithFilteredResult(_0x4f63fa,_0x50891d){return function(_0x4fb006){if(_0x4fb006){var _0x2ff887=typeof _0x50891d[_0xe0bd('0x1b')]===_0xe0bd('0x1c')&&typeof _0x50891d[_0xe0bd('0x1d')]===_0xe0bd('0x1c');var _0x55f304=_0x4fb006['count'];var _0x1becc8=_0x2ff887?0x0:_0x50891d['offset'];var _0x4f36f7=_0x2ff887?_0x4fb006[_0xe0bd('0x1e')]:_0x50891d[_0xe0bd('0x1b')]+_0x50891d[_0xe0bd('0x1d')];var _0x5f22e2;if(_0x4f36f7>=_0x55f304){_0x4f36f7=_0x55f304;_0x5f22e2=0xc8;}else{_0x5f22e2=0xce;}_0x4f63fa[_0xe0bd('0x18')](_0x5f22e2);return _0x4f63fa[_0xe0bd('0x1f')](_0xe0bd('0x20'),_0x1becc8+'-'+_0x4f36f7+'/'+_0x55f304)['json'](_0x4fb006);}return null;};}function patchUpdates(_0x1bf742){return function(_0x25f595){try{jsonpatch[_0xe0bd('0x21')](_0x25f595,_0x1bf742,!![]);}catch(_0x532584){return BPromise[_0xe0bd('0x22')](_0x532584);}return _0x25f595[_0xe0bd('0x23')]();};}function saveUpdates(_0x2b4f7d,_0x5378d2){return function(_0x1d6a19){if(_0x1d6a19){return _0x1d6a19['update'](_0x2b4f7d)[_0xe0bd('0x24')](function(_0x2bcfcc){return _0x2bcfcc;});}return null;};}function removeEntity(_0x4bcd48,_0xa4a4e9){return function(_0xf6d956){if(_0xf6d956){return _0xf6d956[_0xe0bd('0x25')]()[_0xe0bd('0x24')](function(){_0x4bcd48[_0xe0bd('0x18')](0xcc)[_0xe0bd('0x19')]();});}};}function handleEntityNotFound(_0x2096a2,_0x162356){return function(_0x537708){if(!_0x537708){_0x2096a2['sendStatus'](0x194);}return _0x537708;};}function handleError(_0x275f14,_0x39c98e){_0x39c98e=_0x39c98e||0x1f4;return function(_0x47d171){logger['error'](_0x47d171[_0xe0bd('0x26')]);if(_0x47d171[_0xe0bd('0x27')]){delete _0x47d171[_0xe0bd('0x27')];}_0x275f14[_0xe0bd('0x18')](_0x39c98e)['send'](_0x47d171);};}exports[_0xe0bd('0x28')]=function(_0x4ef39b,_0x9146fe){var _0x170874={},_0x42bea7={},_0x1b857c={'count':0x0,'rows':[]};var _0x1e2020=_[_0xe0bd('0x29')](db[_0xe0bd('0x2a')][_0xe0bd('0x2b')],function(_0x25d515){return{'name':_0x25d515[_0xe0bd('0x2c')],'type':_0x25d515[_0xe0bd('0x2d')][_0xe0bd('0x2e')]};});_0x42bea7[_0xe0bd('0x2f')]=_['map'](_0x1e2020,_0xe0bd('0x27'));_0x42bea7[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x4ef39b[_0xe0bd('0x30')]);_0x42bea7[_0xe0bd('0x32')]=_[_0xe0bd('0x33')](_0x42bea7['model'],_0x42bea7['query']);_0x170874[_0xe0bd('0x34')]=_[_0xe0bd('0x33')](_0x42bea7[_0xe0bd('0x2f')],qs[_0xe0bd('0x35')](_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x35')]));_0x170874[_0xe0bd('0x34')]=_0x170874['attributes'][_0xe0bd('0x36')]?_0x170874[_0xe0bd('0x34')]:_0x42bea7[_0xe0bd('0x2f')];if(!_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x37')](_0xe0bd('0x38'))){_0x170874['limit']=qs[_0xe0bd('0x1d')](_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x1d')]);_0x170874[_0xe0bd('0x1b')]=qs[_0xe0bd('0x1b')](_0x4ef39b['query']['offset']);}_0x170874[_0xe0bd('0x39')]=qs[_0xe0bd('0x3a')](_0x4ef39b[_0xe0bd('0x30')]['sort']);_0x170874[_0xe0bd('0x3b')]=qs['filters'](_['pick'](_0x4ef39b[_0xe0bd('0x30')],_0x42bea7[_0xe0bd('0x32')]),_0x1e2020);if(_0x4ef39b['query']['filter']){_0x170874['where']=_[_0xe0bd('0x3c')](_0x170874[_0xe0bd('0x3b')],{'$or':_[_0xe0bd('0x29')](_0x1e2020,function(_0x5d2aff){if(_0x5d2aff[_0xe0bd('0x2d')]!==_0xe0bd('0x3d')){var _0x1e6823={};_0x1e6823[_0x5d2aff['name']]={'$like':'%'+_0x4ef39b['query'][_0xe0bd('0x3e')]+'%'};return _0x1e6823;}})});}_0x170874=_['merge']({},_0x170874,_0x4ef39b[_0xe0bd('0x3f')]);var _0x195f0f={'where':_0x170874['where']};return db[_0xe0bd('0x2a')][_0xe0bd('0x1e')](_0x195f0f)[_0xe0bd('0x24')](function(_0xb65059){_0x1b857c[_0xe0bd('0x1e')]=_0xb65059;if(_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x40')]){_0x170874['include']=[{'all':!![]}];}return db[_0xe0bd('0x2a')][_0xe0bd('0x41')](_0x170874);})[_0xe0bd('0x24')](function(_0x3c138e){_0x1b857c[_0xe0bd('0x42')]=_0x3c138e;return _0x1b857c;})['then'](respondWithFilteredResult(_0x9146fe,_0x170874))['catch'](handleError(_0x9146fe,null));};exports['show']=function(_0x2b27b1,_0x1a121f){var _0x15de49={'raw':!![],'where':{'id':_0x2b27b1['params']['id']}},_0x32ed4f={};_0x32ed4f['model']=_[_0xe0bd('0x31')](db[_0xe0bd('0x2a')][_0xe0bd('0x2b')]);_0x32ed4f[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x2b27b1[_0xe0bd('0x30')]);_0x32ed4f[_0xe0bd('0x32')]=_['intersection'](_0x32ed4f[_0xe0bd('0x2f')],_0x32ed4f['query']);_0x15de49[_0xe0bd('0x34')]=_[_0xe0bd('0x33')](_0x32ed4f['model'],qs['fields'](_0x2b27b1[_0xe0bd('0x30')][_0xe0bd('0x35')]));_0x15de49[_0xe0bd('0x34')]=_0x15de49[_0xe0bd('0x34')][_0xe0bd('0x36')]?_0x15de49[_0xe0bd('0x34')]:_0x32ed4f[_0xe0bd('0x2f')];if(_0x2b27b1[_0xe0bd('0x30')][_0xe0bd('0x40')]){_0x15de49['include']=[{'all':!![]}];}_0x15de49=_[_0xe0bd('0x3c')]({},_0x15de49,_0x2b27b1[_0xe0bd('0x3f')]);return db[_0xe0bd('0x2a')]['find'](_0x15de49)[_0xe0bd('0x24')](handleEntityNotFound(_0x1a121f,null))[_0xe0bd('0x24')](respondWithResult(_0x1a121f,null))['catch'](handleError(_0x1a121f,null));};exports[_0xe0bd('0x43')]=function(_0x136ac6,_0x578792){return db[_0xe0bd('0x2a')][_0xe0bd('0x43')](_0x136ac6[_0xe0bd('0x44')],{})['then'](respondWithResult(_0x578792,0xc9))[_0xe0bd('0x45')](handleError(_0x578792,null));};exports[_0xe0bd('0x46')]=function(_0x147438,_0x21ae20){if(_0x147438[_0xe0bd('0x44')]['id']){delete _0x147438[_0xe0bd('0x44')]['id'];}return db[_0xe0bd('0x2a')][_0xe0bd('0x47')]({'where':{'id':_0x147438[_0xe0bd('0x48')]['id']}})['then'](handleEntityNotFound(_0x21ae20,null))['then'](saveUpdates(_0x147438['body'],null))[_0xe0bd('0x24')](respondWithResult(_0x21ae20,null))[_0xe0bd('0x45')](handleError(_0x21ae20,null));};exports['destroy']=function(_0xacd120,_0x284ea3){return db[_0xe0bd('0x2a')][_0xe0bd('0x47')]({'where':{'id':_0xacd120[_0xe0bd('0x48')]['id']}})[_0xe0bd('0x24')](handleEntityNotFound(_0x284ea3,null))[_0xe0bd('0x24')](removeEntity(_0x284ea3,null))[_0xe0bd('0x45')](handleError(_0x284ea3,null));};exports[_0xe0bd('0x49')]=function(_0x2631f5,_0x503939){return db[_0xe0bd('0x2a')][_0xe0bd('0x49')]()[_0xe0bd('0x24')](respondWithResult(_0x503939,null))['catch'](handleError(_0x503939,null));}; \ No newline at end of file +var _0x5292=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Cdr'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x5292,0xf7));var _0x2529=function(_0x4441cf,_0x4509a6){_0x4441cf=_0x4441cf-0x0;var _0x3b8877=_0x5292[_0x4441cf];return _0x3b8877;};'use strict';var emlformat=require(_0x2529('0x0'));var rimraf=require(_0x2529('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2529('0x2'));var rp=require('request-promise');var moment=require(_0x2529('0x3'));var BPromise=require(_0x2529('0x4'));var Mustache=require(_0x2529('0x5'));var util=require(_0x2529('0x6'));var path=require('path');var sox=require(_0x2529('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var licenseUtil=require(_0x2529('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe333c9,_0x23bfaf){_0x23bfaf=_0x23bfaf||0xcc;return function(_0x149692){if(_0x149692){return _0xe333c9[_0x2529('0x16')](_0x23bfaf);}return _0xe333c9[_0x2529('0x17')](_0x23bfaf)[_0x2529('0x18')]();};}function respondWithResult(_0x3f3b40,_0x5245cf){_0x5245cf=_0x5245cf||0xc8;return function(_0x101668){if(_0x101668){return _0x3f3b40[_0x2529('0x17')](_0x5245cf)[_0x2529('0x19')](_0x101668);}};}function respondWithFilteredResult(_0x19e4bf,_0x1cc716){return function(_0x2598a1){if(_0x2598a1){var _0x1a1ccc=typeof _0x1cc716[_0x2529('0x1a')]==='undefined'&&typeof _0x1cc716[_0x2529('0x1b')]==='undefined';var _0x337720=_0x2598a1[_0x2529('0x1c')];var _0x89be58=_0x1a1ccc?0x0:_0x1cc716['offset'];var _0x5b4d0d=_0x1a1ccc?_0x2598a1[_0x2529('0x1c')]:_0x1cc716[_0x2529('0x1a')]+_0x1cc716[_0x2529('0x1b')];var _0x37204a;if(_0x5b4d0d>=_0x337720){_0x5b4d0d=_0x337720;_0x37204a=0xc8;}else{_0x37204a=0xce;}_0x19e4bf[_0x2529('0x17')](_0x37204a);return _0x19e4bf['set'](_0x2529('0x1d'),_0x89be58+'-'+_0x5b4d0d+'/'+_0x337720)[_0x2529('0x19')](_0x2598a1);}return null;};}function patchUpdates(_0x1ca15f){return function(_0xeff5a6){try{jsonpatch['apply'](_0xeff5a6,_0x1ca15f,!![]);}catch(_0x1fa873){return BPromise[_0x2529('0x1e')](_0x1fa873);}return _0xeff5a6[_0x2529('0x1f')]();};}function saveUpdates(_0x5b4760,_0x3d5d17){return function(_0x3f57da){if(_0x3f57da){return _0x3f57da[_0x2529('0x20')](_0x5b4760)[_0x2529('0x21')](function(_0x5540e4){return _0x5540e4;});}return null;};}function removeEntity(_0x2736f6,_0x2d0c6d){return function(_0x400a01){if(_0x400a01){return _0x400a01[_0x2529('0x22')]()[_0x2529('0x21')](function(){_0x2736f6[_0x2529('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5539ef,_0x856e50){return function(_0x40f42b){if(!_0x40f42b){_0x5539ef[_0x2529('0x16')](0x194);}return _0x40f42b;};}function handleError(_0x431c40,_0x24418a){_0x24418a=_0x24418a||0x1f4;return function(_0x2a8371){logger[_0x2529('0x23')](_0x2a8371[_0x2529('0x24')]);if(_0x2a8371[_0x2529('0x25')]){delete _0x2a8371[_0x2529('0x25')];}_0x431c40['status'](_0x24418a)[_0x2529('0x26')](_0x2a8371);};}exports[_0x2529('0x27')]=function(_0x4dd0fb,_0x1822ce){var _0x3c46c6={},_0x5bea2d={},_0x17bcbd={'count':0x0,'rows':[]};var _0x1d7e98=_['map'](db[_0x2529('0x28')][_0x2529('0x29')],function(_0x4a18f6){return{'name':_0x4a18f6[_0x2529('0x2a')],'type':_0x4a18f6[_0x2529('0x2b')][_0x2529('0x2c')]};});_0x5bea2d[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x1d7e98,'name');_0x5bea2d[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x4dd0fb[_0x2529('0x2f')]);_0x5bea2d[_0x2529('0x31')]=_[_0x2529('0x32')](_0x5bea2d[_0x2529('0x2d')],_0x5bea2d[_0x2529('0x2f')]);_0x3c46c6['attributes']=_['intersection'](_0x5bea2d[_0x2529('0x2d')],qs['fields'](_0x4dd0fb[_0x2529('0x2f')]['fields']));_0x3c46c6['attributes']=_0x3c46c6['attributes'][_0x2529('0x33')]?_0x3c46c6[_0x2529('0x34')]:_0x5bea2d[_0x2529('0x2d')];if(!_0x4dd0fb['query'][_0x2529('0x35')]('nolimit')){_0x3c46c6['limit']=qs['limit'](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1b')]);_0x3c46c6[_0x2529('0x1a')]=qs[_0x2529('0x1a')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1a')]);}_0x3c46c6[_0x2529('0x36')]=qs[_0x2529('0x37')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x37')]);_0x3c46c6[_0x2529('0x38')]=qs[_0x2529('0x31')](_[_0x2529('0x39')](_0x4dd0fb['query'],_0x5bea2d['filters']),_0x1d7e98);if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]){_0x3c46c6['where']=_[_0x2529('0x3b')](_0x3c46c6[_0x2529('0x38')],{'$or':_[_0x2529('0x2e')](_0x1d7e98,function(_0x1b1f81){if(_0x1b1f81[_0x2529('0x2b')]!==_0x2529('0x3c')){var _0x1b8226={};_0x1b8226[_0x1b1f81['name']]={'$like':'%'+_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]+'%'};return _0x1b8226;}})});}_0x3c46c6=_[_0x2529('0x3b')]({},_0x3c46c6,_0x4dd0fb['options']);var _0x1393b7={'where':_0x3c46c6[_0x2529('0x38')]};return db[_0x2529('0x28')][_0x2529('0x1c')](_0x1393b7)[_0x2529('0x21')](function(_0x33acbf){_0x17bcbd[_0x2529('0x1c')]=_0x33acbf;if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3d')]){_0x3c46c6['include']=[{'all':!![]}];}return db[_0x2529('0x28')][_0x2529('0x3e')](_0x3c46c6);})[_0x2529('0x21')](function(_0x3b4e47){_0x17bcbd[_0x2529('0x3f')]=_0x3b4e47;return _0x17bcbd;})[_0x2529('0x21')](respondWithFilteredResult(_0x1822ce,_0x3c46c6))[_0x2529('0x40')](handleError(_0x1822ce,null));};exports['show']=function(_0x8ced2e,_0x33a13e){var _0x3f76e8={'raw':!![],'where':{'id':_0x8ced2e[_0x2529('0x41')]['id']}},_0x2aaecb={};_0x2aaecb['model']=_[_0x2529('0x30')](db[_0x2529('0x28')][_0x2529('0x29')]);_0x2aaecb[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x8ced2e[_0x2529('0x2f')]);_0x2aaecb['filters']=_['intersection'](_0x2aaecb['model'],_0x2aaecb['query']);_0x3f76e8[_0x2529('0x34')]=_['intersection'](_0x2aaecb[_0x2529('0x2d')],qs[_0x2529('0x42')](_0x8ced2e[_0x2529('0x2f')][_0x2529('0x42')]));_0x3f76e8[_0x2529('0x34')]=_0x3f76e8['attributes'][_0x2529('0x33')]?_0x3f76e8['attributes']:_0x2aaecb[_0x2529('0x2d')];if(_0x8ced2e['query'][_0x2529('0x3d')]){_0x3f76e8['include']=[{'all':!![]}];}_0x3f76e8=_[_0x2529('0x3b')]({},_0x3f76e8,_0x8ced2e[_0x2529('0x43')]);return db['Cdr'][_0x2529('0x44')](_0x3f76e8)['then'](handleEntityNotFound(_0x33a13e,null))[_0x2529('0x21')](respondWithResult(_0x33a13e,null))[_0x2529('0x40')](handleError(_0x33a13e,null));};exports[_0x2529('0x45')]=function(_0x3c6d79,_0xdc4bef){return db[_0x2529('0x28')][_0x2529('0x45')](_0x3c6d79[_0x2529('0x46')],{})[_0x2529('0x21')](respondWithResult(_0xdc4bef,0xc9))['catch'](handleError(_0xdc4bef,null));};exports['update']=function(_0x5e72d1,_0x37a23a){if(_0x5e72d1[_0x2529('0x46')]['id']){delete _0x5e72d1[_0x2529('0x46')]['id'];}return db['Cdr']['find']({'where':{'id':_0x5e72d1[_0x2529('0x41')]['id']}})['then'](handleEntityNotFound(_0x37a23a,null))[_0x2529('0x21')](saveUpdates(_0x5e72d1[_0x2529('0x46')],null))[_0x2529('0x21')](respondWithResult(_0x37a23a,null))[_0x2529('0x40')](handleError(_0x37a23a,null));};exports[_0x2529('0x22')]=function(_0x196ee8,_0x4583ba){return db[_0x2529('0x28')]['find']({'where':{'id':_0x196ee8['params']['id']}})[_0x2529('0x21')](handleEntityNotFound(_0x4583ba,null))[_0x2529('0x21')](removeEntity(_0x4583ba,null))[_0x2529('0x40')](handleError(_0x4583ba,null));};exports[_0x2529('0x47')]=function(_0x1f76d3,_0x3ac799){return db[_0x2529('0x28')][_0x2529('0x47')]()[_0x2529('0x21')](respondWithResult(_0x3ac799,null))[_0x2529('0x40')](handleError(_0x3ac799,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 1a17bcb..ee7c5d7 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(_0x112dcd,_0x3aa609){var _0x598464=function(_0x4f7bbb){while(--_0x4f7bbb){_0x112dcd['push'](_0x112dcd['shift']());}};_0x598464(++_0x3aa609);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4392fc,_0x3e9709){var _0x487d0a=function(_0x452b6e){while(--_0x452b6e){_0x4392fc['push'](_0x4392fc['shift']());}};_0x487d0a(++_0x3e9709);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 3df5db1..a3764e5 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 _0x8c94=['info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','Cdr,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x45eacc,_0x3727a4){var _0x3f1252=function(_0x36b7f4){while(--_0x36b7f4){_0x45eacc['push'](_0x45eacc['shift']());}};_0x3f1252(++_0x3727a4);}(_0x8c94,0xef));var _0x48c9=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x8c94[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require(_0x48c9('0x0'));var moment=require(_0x48c9('0x1'));var BPromise=require(_0x48c9('0x2'));var rs=require(_0x48c9('0x3'));var fs=require('fs');var Redis=require(_0x48c9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x48c9('0x5'));var logger=require(_0x48c9('0x6'))('rpc');var config=require(_0x48c9('0x7'));var jayson=require(_0x48c9('0x8'));var client=jayson[_0x48c9('0x9')][_0x48c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5928e0,_0x5c73c6,_0x45abcb){return new BPromise(function(_0x4f9425,_0x4519c4){return client[_0x48c9('0xb')](_0x5928e0,_0x45abcb)[_0x48c9('0xc')](function(_0x28a074){logger[_0x48c9('0xd')]('Cdr,\x20%s,\x20%s',_0x5c73c6,_0x48c9('0xe'));logger[_0x48c9('0xf')](_0x48c9('0x10'),_0x5c73c6,_0x48c9('0xe'),JSON['stringify'](_0x28a074));if(_0x28a074['error']){if(_0x28a074[_0x48c9('0x11')]['code']===0x1f4){logger['error'](_0x48c9('0x12'),_0x5c73c6,_0x28a074['error'][_0x48c9('0x13')]);return _0x4519c4(_0x28a074['error'][_0x48c9('0x13')]);}logger['error'](_0x48c9('0x12'),_0x5c73c6,_0x28a074[_0x48c9('0x11')][_0x48c9('0x13')]);return _0x4f9425(_0x28a074['error'][_0x48c9('0x13')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x5c73c6,_0x48c9('0xe'));_0x4f9425(_0x28a074['result'][_0x48c9('0x13')]);}})[_0x48c9('0x14')](function(_0x32cc29){logger[_0x48c9('0x11')]('Cdr,\x20%s,\x20%s',_0x5c73c6,_0x32cc29);_0x4519c4(_0x32cc29);});});} \ No newline at end of file +var _0x6393=['error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x4b94e7,_0x4043de){var _0x1edd07=function(_0x52e145){while(--_0x52e145){_0x4b94e7['push'](_0x4b94e7['shift']());}};_0x1edd07(++_0x4043de);}(_0x6393,0xd7));var _0x3639=function(_0x25ded9,_0x5c740f){_0x25ded9=_0x25ded9-0x0;var _0x312705=_0x6393[_0x25ded9];return _0x312705;};'use strict';var _=require('lodash');var util=require(_0x3639('0x0'));var moment=require(_0x3639('0x1'));var BPromise=require(_0x3639('0x2'));var rs=require(_0x3639('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3639('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3639('0x5'))(_0x3639('0x6'));var config=require(_0x3639('0x7'));var jayson=require(_0x3639('0x8'));var client=jayson[_0x3639('0x9')][_0x3639('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf91ff3,_0x5ba03d,_0xa4c89f){return new BPromise(function(_0x2265fd,_0x28cc27){return client['request'](_0xf91ff3,_0xa4c89f)[_0x3639('0xb')](function(_0x1b3869){logger[_0x3639('0xc')](_0x3639('0xd'),_0x5ba03d,_0x3639('0xe'));logger['debug'](_0x3639('0xf'),_0x5ba03d,_0x3639('0xe'),JSON['stringify'](_0x1b3869));if(_0x1b3869[_0x3639('0x10')]){if(_0x1b3869[_0x3639('0x10')][_0x3639('0x11')]===0x1f4){logger[_0x3639('0x10')](_0x3639('0xd'),_0x5ba03d,_0x1b3869[_0x3639('0x10')][_0x3639('0x12')]);return _0x28cc27(_0x1b3869[_0x3639('0x10')]['message']);}logger[_0x3639('0x10')]('Cdr,\x20%s,\x20%s',_0x5ba03d,_0x1b3869[_0x3639('0x10')][_0x3639('0x12')]);return _0x2265fd(_0x1b3869['error'][_0x3639('0x12')]);}else{logger[_0x3639('0xc')](_0x3639('0xd'),_0x5ba03d,'request\x20sent');_0x2265fd(_0x1b3869[_0x3639('0x13')][_0x3639('0x12')]);}})[_0x3639('0x14')](function(_0x57cd43){logger[_0x3639('0x10')]('Cdr,\x20%s,\x20%s',_0x5ba03d,_0x57cd43);_0x28cc27(_0x57cd43);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index a03929a..75fbb18 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(_0x1b3e32,_0x49ad74){var _0x4796e3=function(_0x429ecd){while(--_0x429ecd){_0x1b3e32['push'](_0x1b3e32['shift']());}};_0x4796e3(++_0x49ad74);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x1fa759,_0x4ecdce){var _0x2da9f4=function(_0x463e2a){while(--_0x463e2a){_0x1fa759['push'](_0x1fa759['shift']());}};_0x2da9f4(++_0x4ecdce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index f2b99f3..c667ede 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 _0xa9c8=['noop','TEXT','*,*,*,*','sequelize','STRING'];(function(_0x3e8335,_0x42a9be){var _0x18a80a=function(_0x1829e0){while(--_0x1829e0){_0x3e8335['push'](_0x3e8335['shift']());}};_0x18a80a(++_0x42a9be);}(_0xa9c8,0xe9));var _0x8a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8a9c('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8a9c('0x1')],'allowNull':![],'defaultValue':_0x8a9c('0x2')},'appdata':{'type':Sequelize[_0x8a9c('0x3')]()},'description':{'type':Sequelize[_0x8a9c('0x1')]},'interval':{'type':Sequelize[_0x8a9c('0x1')],'defaultValue':_0x8a9c('0x4')}}; \ No newline at end of file +var _0xbd51=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x3b508c,_0x5a220f){var _0x4f5267=function(_0xed241f){while(--_0xed241f){_0x3b508c['push'](_0x3b508c['shift']());}};_0x4f5267(++_0x5a220f);}(_0xbd51,0x8f));var _0x1bd5=function(_0x1bae95,_0xab6a3c){_0x1bae95=_0x1bae95-0x0;var _0x31d3e6=_0xbd51[_0x1bae95];return _0x31d3e6;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module[_0x1bd5('0x1')]={'priority':{'type':Sequelize[_0x1bd5('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1bd5('0x3')},'appdata':{'type':Sequelize[_0x1bd5('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1bd5('0x5')],'defaultValue':_0x1bd5('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index e3e2ebb..78c79cf 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 _0x7d80=['sox','to-csv','ejs','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','apply','save','then','destroy','error','name','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','catch','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x22dc8c,_0x30a9d3){var _0x3cb025=function(_0x521375){while(--_0x521375){_0x22dc8c['push'](_0x22dc8c['shift']());}};_0x3cb025(++_0x30a9d3);}(_0x7d80,0x17a));var _0x07d8=function(_0x1b2f5c,_0x425490){_0x1b2f5c=_0x1b2f5c-0x0;var _0x4b2ea5=_0x7d80[_0x1b2f5c];return _0x4b2ea5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07d8('0x0'));var zipdir=require(_0x07d8('0x1'));var jsonpatch=require(_0x07d8('0x2'));var rp=require(_0x07d8('0x3'));var moment=require(_0x07d8('0x4'));var BPromise=require(_0x07d8('0x5'));var Mustache=require('mustache');var util=require(_0x07d8('0x6'));var path=require('path');var sox=require(_0x07d8('0x7'));var csv=require(_0x07d8('0x8'));var ejs=require(_0x07d8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x07d8('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x07d8('0x8'));var querystring=require(_0x07d8('0xb'));var Papa=require('papaparse');var Redis=require(_0x07d8('0xc'));var authService=require(_0x07d8('0xd'));var qs=require(_0x07d8('0xe'));var as=require(_0x07d8('0xf'));var hardwareService=require(_0x07d8('0x10'));var logger=require(_0x07d8('0x11'))(_0x07d8('0x12'));var utils=require('../../config/utils');var config=require(_0x07d8('0x13'));var licenseUtil=require(_0x07d8('0x14'));var db=require(_0x07d8('0x15'))['db'];function respondWithStatusCode(_0x9dbef7,_0x20fb9a){_0x20fb9a=_0x20fb9a||0xcc;return function(_0x14ee4c){if(_0x14ee4c){return _0x9dbef7[_0x07d8('0x16')](_0x20fb9a);}return _0x9dbef7['status'](_0x20fb9a)[_0x07d8('0x17')]();};}function respondWithResult(_0x6d311c,_0x17d24e){_0x17d24e=_0x17d24e||0xc8;return function(_0x584765){if(_0x584765){return _0x6d311c[_0x07d8('0x18')](_0x17d24e)[_0x07d8('0x19')](_0x584765);}};}function respondWithFilteredResult(_0x567f2c,_0x2254c9){return function(_0x1bd568){if(_0x1bd568){var _0x3584aa=typeof _0x2254c9[_0x07d8('0x1a')]===_0x07d8('0x1b')&&typeof _0x2254c9['limit']===_0x07d8('0x1b');var _0x73250c=_0x1bd568['count'];var _0x7fa5f3=_0x3584aa?0x0:_0x2254c9[_0x07d8('0x1a')];var _0x27eb23=_0x3584aa?_0x1bd568[_0x07d8('0x1c')]:_0x2254c9[_0x07d8('0x1a')]+_0x2254c9[_0x07d8('0x1d')];var _0x1fe8b5;if(_0x27eb23>=_0x73250c){_0x27eb23=_0x73250c;_0x1fe8b5=0xc8;}else{_0x1fe8b5=0xce;}_0x567f2c[_0x07d8('0x18')](_0x1fe8b5);return _0x567f2c['set']('Content-Range',_0x7fa5f3+'-'+_0x27eb23+'/'+_0x73250c)[_0x07d8('0x19')](_0x1bd568);}return null;};}function patchUpdates(_0x4fcc4d){return function(_0x5afa12){try{jsonpatch[_0x07d8('0x1e')](_0x5afa12,_0x4fcc4d,!![]);}catch(_0x3f15a9){return BPromise['reject'](_0x3f15a9);}return _0x5afa12[_0x07d8('0x1f')]();};}function saveUpdates(_0x957b5,_0x40a095){return function(_0x33dd51){if(_0x33dd51){return _0x33dd51['update'](_0x957b5)[_0x07d8('0x20')](function(_0x14d8d7){return _0x14d8d7;});}return null;};}function removeEntity(_0x56282d,_0x1dbe70){return function(_0x208bad){if(_0x208bad){return _0x208bad[_0x07d8('0x21')]()[_0x07d8('0x20')](function(){_0x56282d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e87c5,_0x4fb566){return function(_0x518242){if(!_0x518242){_0x1e87c5[_0x07d8('0x16')](0x194);}return _0x518242;};}function handleError(_0x102887,_0x27c2a9){_0x27c2a9=_0x27c2a9||0x1f4;return function(_0x10a4c9){logger[_0x07d8('0x22')](_0x10a4c9['stack']);if(_0x10a4c9[_0x07d8('0x23')]){delete _0x10a4c9[_0x07d8('0x23')];}_0x102887[_0x07d8('0x18')](_0x27c2a9)['send'](_0x10a4c9);};}exports['show']=function(_0x262308,_0x38fd1e){var _0x601bca={'raw':!![],'where':{'id':_0x262308[_0x07d8('0x24')]['id']}},_0x175ece={};_0x175ece['model']=_[_0x07d8('0x25')](db[_0x07d8('0x26')][_0x07d8('0x27')]);_0x175ece[_0x07d8('0x28')]=_[_0x07d8('0x25')](_0x262308[_0x07d8('0x28')]);_0x175ece[_0x07d8('0x29')]=_[_0x07d8('0x2a')](_0x175ece[_0x07d8('0x2b')],_0x175ece[_0x07d8('0x28')]);_0x601bca['attributes']=_[_0x07d8('0x2a')](_0x175ece[_0x07d8('0x2b')],qs[_0x07d8('0x2c')](_0x262308[_0x07d8('0x28')]['fields']));_0x601bca['attributes']=_0x601bca[_0x07d8('0x2d')][_0x07d8('0x2e')]?_0x601bca[_0x07d8('0x2d')]:_0x175ece[_0x07d8('0x2b')];if(_0x262308['query'][_0x07d8('0x2f')]){_0x601bca[_0x07d8('0x30')]=[{'all':!![]}];}_0x601bca=_[_0x07d8('0x31')]({},_0x601bca,_0x262308[_0x07d8('0x32')]);return db[_0x07d8('0x26')][_0x07d8('0x33')](_0x601bca)[_0x07d8('0x20')](handleEntityNotFound(_0x38fd1e,null))[_0x07d8('0x20')](respondWithResult(_0x38fd1e,null))[_0x07d8('0x34')](handleError(_0x38fd1e,null));};exports[_0x07d8('0x35')]=function(_0x3c9ebb,_0x484bae){if(_0x3c9ebb[_0x07d8('0x36')]['id']){delete _0x3c9ebb[_0x07d8('0x36')]['id'];}return db[_0x07d8('0x26')][_0x07d8('0x33')]({'where':{'id':_0x3c9ebb[_0x07d8('0x24')]['id']}})[_0x07d8('0x20')](handleEntityNotFound(_0x484bae,null))[_0x07d8('0x20')](saveUpdates(_0x3c9ebb[_0x07d8('0x36')],null))[_0x07d8('0x20')](respondWithResult(_0x484bae,null))['catch'](handleError(_0x484bae,null));};exports[_0x07d8('0x21')]=function(_0xf4e9ba,_0x33e2ab){return db[_0x07d8('0x26')][_0x07d8('0x33')]({'where':{'id':_0xf4e9ba['params']['id']}})['then'](handleEntityNotFound(_0x33e2ab,null))[_0x07d8('0x20')](removeEntity(_0x33e2ab,null))[_0x07d8('0x34')](handleError(_0x33e2ab,null));}; \ No newline at end of file +var _0xb6b1=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','model','keys','query','intersection','attributes','fields','length','includeAll','include','merge','options','find','body','ChatApplication','params','catch','destroy','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring'];(function(_0x4e2475,_0xe62947){var _0x5a8b34=function(_0x3c11ae){while(--_0x3c11ae){_0x4e2475['push'](_0x4e2475['shift']());}};_0x5a8b34(++_0xe62947);}(_0xb6b1,0x17b));var _0x1b6b=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0xb6b1[_0xdd2bfa];return _0x55397e;};'use strict';var emlformat=require(_0x1b6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b6b('0x2'));var moment=require(_0x1b6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b6b('0x4'));var util=require('util');var path=require(_0x1b6b('0x5'));var sox=require(_0x1b6b('0x6'));var csv=require(_0x1b6b('0x7'));var ejs=require(_0x1b6b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b6b('0x9'));var squel=require('squel');var crypto=require(_0x1b6b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1b6b('0xb'));var toCsv=require(_0x1b6b('0x7'));var querystring=require(_0x1b6b('0xc'));var Papa=require(_0x1b6b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b6b('0xe'));var as=require(_0x1b6b('0xf'));var hardwareService=require(_0x1b6b('0x10'));var logger=require(_0x1b6b('0x11'))(_0x1b6b('0x12'));var utils=require(_0x1b6b('0x13'));var config=require(_0x1b6b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b6b('0x15'))['db'];function respondWithStatusCode(_0x3554b5,_0xf6a4be){_0xf6a4be=_0xf6a4be||0xcc;return function(_0x5abe44){if(_0x5abe44){return _0x3554b5[_0x1b6b('0x16')](_0xf6a4be);}return _0x3554b5['status'](_0xf6a4be)['end']();};}function respondWithResult(_0x2f540f,_0x20a2d7){_0x20a2d7=_0x20a2d7||0xc8;return function(_0x1e474f){if(_0x1e474f){return _0x2f540f[_0x1b6b('0x17')](_0x20a2d7)[_0x1b6b('0x18')](_0x1e474f);}};}function respondWithFilteredResult(_0x268fe9,_0x321263){return function(_0x553a6d){if(_0x553a6d){var _0x1069a4=typeof _0x321263[_0x1b6b('0x19')]===_0x1b6b('0x1a')&&typeof _0x321263[_0x1b6b('0x1b')]==='undefined';var _0x26345c=_0x553a6d[_0x1b6b('0x1c')];var _0x2e608b=_0x1069a4?0x0:_0x321263['offset'];var _0x923711=_0x1069a4?_0x553a6d[_0x1b6b('0x1c')]:_0x321263[_0x1b6b('0x19')]+_0x321263[_0x1b6b('0x1b')];var _0xacd21b;if(_0x923711>=_0x26345c){_0x923711=_0x26345c;_0xacd21b=0xc8;}else{_0xacd21b=0xce;}_0x268fe9[_0x1b6b('0x17')](_0xacd21b);return _0x268fe9[_0x1b6b('0x1d')](_0x1b6b('0x1e'),_0x2e608b+'-'+_0x923711+'/'+_0x26345c)[_0x1b6b('0x18')](_0x553a6d);}return null;};}function patchUpdates(_0x20a5a3){return function(_0x5dbd46){try{jsonpatch[_0x1b6b('0x1f')](_0x5dbd46,_0x20a5a3,!![]);}catch(_0x395118){return BPromise[_0x1b6b('0x20')](_0x395118);}return _0x5dbd46[_0x1b6b('0x21')]();};}function saveUpdates(_0x27974f,_0x276713){return function(_0x3d4ec2){if(_0x3d4ec2){return _0x3d4ec2[_0x1b6b('0x22')](_0x27974f)[_0x1b6b('0x23')](function(_0x4987ee){return _0x4987ee;});}return null;};}function removeEntity(_0x1b2cdf,_0x489e7a){return function(_0x4efab0){if(_0x4efab0){return _0x4efab0['destroy']()[_0x1b6b('0x23')](function(){_0x1b2cdf[_0x1b6b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6a317c,_0x47c318){return function(_0x15dfc7){if(!_0x15dfc7){_0x6a317c[_0x1b6b('0x16')](0x194);}return _0x15dfc7;};}function handleError(_0x466c0c,_0x308955){_0x308955=_0x308955||0x1f4;return function(_0xd41b04){logger[_0x1b6b('0x24')](_0xd41b04['stack']);if(_0xd41b04[_0x1b6b('0x25')]){delete _0xd41b04[_0x1b6b('0x25')];}_0x466c0c[_0x1b6b('0x17')](_0x308955)[_0x1b6b('0x26')](_0xd41b04);};}exports['show']=function(_0x23dac4,_0x5a46bd){var _0x5bbcd8={'raw':!![],'where':{'id':_0x23dac4['params']['id']}},_0x39b055={};_0x39b055[_0x1b6b('0x27')]=_[_0x1b6b('0x28')](db['ChatApplication']['rawAttributes']);_0x39b055[_0x1b6b('0x29')]=_[_0x1b6b('0x28')](_0x23dac4['query']);_0x39b055['filters']=_[_0x1b6b('0x2a')](_0x39b055[_0x1b6b('0x27')],_0x39b055[_0x1b6b('0x29')]);_0x5bbcd8[_0x1b6b('0x2b')]=_['intersection'](_0x39b055[_0x1b6b('0x27')],qs[_0x1b6b('0x2c')](_0x23dac4[_0x1b6b('0x29')][_0x1b6b('0x2c')]));_0x5bbcd8[_0x1b6b('0x2b')]=_0x5bbcd8[_0x1b6b('0x2b')][_0x1b6b('0x2d')]?_0x5bbcd8[_0x1b6b('0x2b')]:_0x39b055[_0x1b6b('0x27')];if(_0x23dac4['query'][_0x1b6b('0x2e')]){_0x5bbcd8[_0x1b6b('0x2f')]=[{'all':!![]}];}_0x5bbcd8=_[_0x1b6b('0x30')]({},_0x5bbcd8,_0x23dac4[_0x1b6b('0x31')]);return db['ChatApplication'][_0x1b6b('0x32')](_0x5bbcd8)['then'](handleEntityNotFound(_0x5a46bd,null))[_0x1b6b('0x23')](respondWithResult(_0x5a46bd,null))['catch'](handleError(_0x5a46bd,null));};exports['update']=function(_0x307ed7,_0x3a3f35){if(_0x307ed7[_0x1b6b('0x33')]['id']){delete _0x307ed7['body']['id'];}return db[_0x1b6b('0x34')][_0x1b6b('0x32')]({'where':{'id':_0x307ed7[_0x1b6b('0x35')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x3a3f35,null))[_0x1b6b('0x23')](saveUpdates(_0x307ed7[_0x1b6b('0x33')],null))[_0x1b6b('0x23')](respondWithResult(_0x3a3f35,null))[_0x1b6b('0x36')](handleError(_0x3a3f35,null));};exports[_0x1b6b('0x37')]=function(_0x2033fa,_0x120e13){return db[_0x1b6b('0x34')][_0x1b6b('0x32')]({'where':{'id':_0x2033fa[_0x1b6b('0x35')]['id']}})['then'](handleEntityNotFound(_0x120e13,null))[_0x1b6b('0x23')](removeEntity(_0x120e13,null))[_0x1b6b('0x36')](handleError(_0x120e13,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index a91930f..575e975 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 _0x6e9b=['define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x2af504,_0x46a924){var _0x2abb2e=function(_0x53f705){while(--_0x53f705){_0x2af504['push'](_0x2af504['shift']());}};_0x2abb2e(++_0x46a924);}(_0x6e9b,0x1e4));var _0xb6e9=function(_0x3f6e26,_0x811a34){_0x3f6e26=_0x3f6e26-0x0;var _0x474345=_0x6e9b[_0x3f6e26];return _0x474345;};'use strict';var _=require(_0xb6e9('0x0'));var util=require(_0xb6e9('0x1'));var logger=require('../../config/logger')(_0xb6e9('0x2'));var moment=require(_0xb6e9('0x3'));var BPromise=require(_0xb6e9('0x4'));var rp=require(_0xb6e9('0x5'));var fs=require('fs');var path=require(_0xb6e9('0x6'));var rimraf=require(_0xb6e9('0x7'));var config=require(_0xb6e9('0x8'));var attributes=require(_0xb6e9('0x9'));module[_0xb6e9('0xa')]=function(_0x4b64ce,_0x216e08){return _0x4b64ce[_0xb6e9('0xb')](_0xb6e9('0xc'),attributes,{'tableName':_0xb6e9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb6e9('0xe')});}; \ No newline at end of file +var _0x9d5d=['define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports'];(function(_0x3fc75a,_0x1a125c){var _0x1d3083=function(_0x27ee51){while(--_0x27ee51){_0x3fc75a['push'](_0x3fc75a['shift']());}};_0x1d3083(++_0x1a125c);}(_0x9d5d,0x1dd));var _0xd9d5=function(_0x55c344,_0x5a38f5){_0x55c344=_0x55c344-0x0;var _0x1aa072=_0x9d5d[_0x55c344];return _0x1aa072;};'use strict';var _=require(_0xd9d5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd9d5('0x1'));var rp=require(_0xd9d5('0x2'));var fs=require('fs');var path=require(_0xd9d5('0x3'));var rimraf=require(_0xd9d5('0x4'));var config=require('../../config/environment');var attributes=require(_0xd9d5('0x5'));module[_0xd9d5('0x6')]=function(_0x419998,_0x49c462){return _0x419998[_0xd9d5('0x7')]('ChatApplication',attributes,{'tableName':_0xd9d5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd9d5('0x9'),'collate':_0xd9d5('0xa')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index a2beaf3..f59e0c0 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 _0x5c34=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x4b69b9,_0x57ff57){var _0x17a245=function(_0x46604c){while(--_0x46604c){_0x4b69b9['push'](_0x4b69b9['shift']());}};_0x17a245(++_0x57ff57);}(_0x5c34,0x18d));var _0x45c3=function(_0x1ce711,_0x20b567){_0x1ce711=_0x1ce711-0x0;var _0x1bd983=_0x5c34[_0x1ce711];return _0x1bd983;};'use strict';var _=require(_0x45c3('0x0'));var util=require(_0x45c3('0x1'));var moment=require(_0x45c3('0x2'));var BPromise=require('bluebird');var rs=require(_0x45c3('0x3'));var fs=require('fs');var Redis=require(_0x45c3('0x4'));var db=require(_0x45c3('0x5'))['db'];var utils=require(_0x45c3('0x6'));var logger=require(_0x45c3('0x7'))(_0x45c3('0x8'));var config=require(_0x45c3('0x9'));var jayson=require(_0x45c3('0xa'));var client=jayson[_0x45c3('0xb')][_0x45c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34ef02,_0x218c77,_0x107e08){return new BPromise(function(_0x12124b,_0x4dee51){return client[_0x45c3('0xd')](_0x34ef02,_0x107e08)[_0x45c3('0xe')](function(_0x3695df){logger[_0x45c3('0xf')]('ChatApplication,\x20%s,\x20%s',_0x218c77,_0x45c3('0x10'));logger['debug'](_0x45c3('0x11'),_0x218c77,'request\x20sent',JSON[_0x45c3('0x12')](_0x3695df));if(_0x3695df[_0x45c3('0x13')]){if(_0x3695df[_0x45c3('0x13')][_0x45c3('0x14')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x218c77,_0x3695df[_0x45c3('0x13')]['message']);return _0x4dee51(_0x3695df['error'][_0x45c3('0x15')]);}logger['error'](_0x45c3('0x16'),_0x218c77,_0x3695df[_0x45c3('0x13')][_0x45c3('0x15')]);return _0x12124b(_0x3695df[_0x45c3('0x13')][_0x45c3('0x15')]);}else{logger[_0x45c3('0xf')](_0x45c3('0x16'),_0x218c77,'request\x20sent');_0x12124b(_0x3695df[_0x45c3('0x17')]['message']);}})[_0x45c3('0x18')](function(_0x503fb3){logger[_0x45c3('0x13')]('ChatApplication,\x20%s,\x20%s',_0x218c77,_0x503fb3);_0x4dee51(_0x503fb3);});});} \ No newline at end of file +var _0x24ef=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','request','then'];(function(_0x17d23a,_0xd4fbc){var _0x23e756=function(_0xfbb322){while(--_0xfbb322){_0x17d23a['push'](_0x17d23a['shift']());}};_0x23e756(++_0xd4fbc);}(_0x24ef,0x1bd));var _0xf24e=function(_0x341d42,_0xabce20){_0x341d42=_0x341d42-0x0;var _0xecf46c=_0x24ef[_0x341d42];return _0xecf46c;};'use strict';var _=require(_0xf24e('0x0'));var util=require(_0xf24e('0x1'));var moment=require('moment');var BPromise=require(_0xf24e('0x2'));var rs=require(_0xf24e('0x3'));var fs=require('fs');var Redis=require(_0xf24e('0x4'));var db=require(_0xf24e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf24e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf24e('0x7')][_0xf24e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45d35c,_0x5ab5da,_0x2cc458){return new BPromise(function(_0x1f569a,_0x1eff07){return client[_0xf24e('0x9')](_0x45d35c,_0x2cc458)[_0xf24e('0xa')](function(_0x274e65){logger[_0xf24e('0xb')](_0xf24e('0xc'),_0x5ab5da,_0xf24e('0xd'));logger['debug'](_0xf24e('0xe'),_0x5ab5da,_0xf24e('0xd'),JSON['stringify'](_0x274e65));if(_0x274e65[_0xf24e('0xf')]){if(_0x274e65[_0xf24e('0xf')][_0xf24e('0x10')]===0x1f4){logger[_0xf24e('0xf')](_0xf24e('0xc'),_0x5ab5da,_0x274e65['error'][_0xf24e('0x11')]);return _0x1eff07(_0x274e65[_0xf24e('0xf')][_0xf24e('0x11')]);}logger[_0xf24e('0xf')](_0xf24e('0xc'),_0x5ab5da,_0x274e65[_0xf24e('0xf')][_0xf24e('0x11')]);return _0x1f569a(_0x274e65[_0xf24e('0xf')][_0xf24e('0x11')]);}else{logger[_0xf24e('0xb')](_0xf24e('0xc'),_0x5ab5da,_0xf24e('0xd'));_0x1f569a(_0x274e65[_0xf24e('0x12')][_0xf24e('0x11')]);}})['catch'](function(_0x1660c7){logger[_0xf24e('0xf')](_0xf24e('0xc'),_0x5ab5da,_0x1660c7);_0x1eff07(_0x1660c7);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 504a19b..8882da3 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 _0x97c7=['../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x29d3a5,_0x58dda7){var _0x5610cd=function(_0x521a4c){while(--_0x521a4c){_0x29d3a5['push'](_0x29d3a5['shift']());}};_0x5610cd(++_0x58dda7);}(_0x97c7,0x154));var _0x797c=function(_0x49bd3c,_0xa738ea){_0x49bd3c=_0x49bd3c-0x0;var _0x2273d7=_0x97c7[_0x49bd3c];return _0x2273d7;};'use strict';var multer=require('multer');var util=require(_0x797c('0x0'));var path=require(_0x797c('0x1'));var timeout=require(_0x797c('0x2'));var express=require(_0x797c('0x3'));var router=express['Router']();var fs_extra=require(_0x797c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x797c('0x5'));var config=require(_0x797c('0x6'));var controller=require(_0x797c('0x7'));router['get'](_0x797c('0x8'),auth[_0x797c('0x9')](),controller[_0x797c('0xa')]);router[_0x797c('0xb')](_0x797c('0x8'),auth['isAuthenticated'](),controller[_0x797c('0xc')]);router[_0x797c('0xd')](_0x797c('0x8'),auth[_0x797c('0x9')](),controller['destroy']);module[_0x797c('0xe')]=router; \ No newline at end of file +var _0x4fd1=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','update','/:id','destroy','multer','util'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x4fd1,0xa8));var _0x14fd=function(_0x3b773f,_0x5797f8){_0x3b773f=_0x3b773f-0x0;var _0x2c2cd5=_0x4fd1[_0x3b773f];return _0x2c2cd5;};'use strict';var multer=require(_0x14fd('0x0'));var util=require(_0x14fd('0x1'));var path=require(_0x14fd('0x2'));var timeout=require(_0x14fd('0x3'));var express=require(_0x14fd('0x4'));var router=express[_0x14fd('0x5')]();var fs_extra=require(_0x14fd('0x6'));var auth=require(_0x14fd('0x7'));var interaction=require(_0x14fd('0x8'));var config=require(_0x14fd('0x9'));var controller=require('./chatApplication.controller');router[_0x14fd('0xa')]('/:id',auth[_0x14fd('0xb')](),controller[_0x14fd('0xc')]);router[_0x14fd('0xd')]('/:id',auth[_0x14fd('0xb')](),controller[_0x14fd('0xe')]);router['delete'](_0x14fd('0xf'),auth[_0x14fd('0xb')](),controller[_0x14fd('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 1aeedbb..adc243a 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 _0xea1c=['BOOLEAN','STRING'];(function(_0x27b8fb,_0x571c2d){var _0x301464=function(_0x544fd0){while(--_0x544fd0){_0x27b8fb['push'](_0x27b8fb['shift']());}};_0x301464(++_0x571c2d);}(_0xea1c,0x117));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcea1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xcea1('0x0')]},'write':{'type':Sequelize[_0xcea1('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xfa2c=['sequelize','exports','STRING','BOOLEAN'];(function(_0x103f81,_0x48c9c6){var _0x564a0b=function(_0x5aeb99){while(--_0x5aeb99){_0x103f81['push'](_0x103f81['shift']());}};_0x564a0b(++_0x48c9c6);}(_0xfa2c,0x1e4));var _0xcfa2=function(_0x34f273,_0x37a8c3){_0x34f273=_0x34f273-0x0;var _0x1f2544=_0xfa2c[_0x34f273];return _0x1f2544;};'use strict';var Sequelize=require(_0xcfa2('0x0'));module[_0xcfa2('0x1')]={'name':{'type':Sequelize[_0xcfa2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcfa2('0x2')]},'write':{'type':Sequelize[_0xcfa2('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 8dda5be..a590519 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 _0xc631=['update','destroy','then','sendStatus','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','find','catch','describe','ChatInternalMessage','user','toInteger','ids','omit','getMembers','findOne','User','order','pick','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xc631,0x163));var _0x1c63=function(_0x3bc326,_0x3e5ab9){_0x3bc326=_0x3bc326-0x0;var _0x5c6973=_0xc631[_0x3bc326];return _0x5c6973;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c63('0x0'));var zipdir=require(_0x1c63('0x1'));var jsonpatch=require(_0x1c63('0x2'));var rp=require(_0x1c63('0x3'));var moment=require(_0x1c63('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1c63('0x5'));var util=require('util');var path=require(_0x1c63('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1c63('0x7'));var fs=require('fs');var fs_extra=require(_0x1c63('0x8'));var _=require(_0x1c63('0x9'));var squel=require(_0x1c63('0xa'));var crypto=require(_0x1c63('0xb'));var jsforce=require(_0x1c63('0xc'));var deskjs=require(_0x1c63('0xd'));var toCsv=require(_0x1c63('0xe'));var querystring=require(_0x1c63('0xf'));var Papa=require(_0x1c63('0x10'));var Redis=require('ioredis');var authService=require(_0x1c63('0x11'));var qs=require(_0x1c63('0x12'));var as=require(_0x1c63('0x13'));var hardwareService=require(_0x1c63('0x14'));var logger=require(_0x1c63('0x15'))(_0x1c63('0x16'));var utils=require('../../config/utils');var config=require(_0x1c63('0x17'));var licenseUtil=require(_0x1c63('0x18'));var db=require(_0x1c63('0x19'))['db'];config['redis']=_['defaults'](config[_0x1c63('0x1a')],{'host':_0x1c63('0x1b'),'port':0x18eb});var socket=require(_0x1c63('0x1c'))(new Redis(config[_0x1c63('0x1a')]));require(_0x1c63('0x1d'))['register'](socket);function respondWithStatusCode(_0x3d832d,_0x52e7c5){_0x52e7c5=_0x52e7c5||0xcc;return function(_0x359a52){if(_0x359a52){return _0x3d832d['sendStatus'](_0x52e7c5);}return _0x3d832d[_0x1c63('0x1e')](_0x52e7c5)[_0x1c63('0x1f')]();};}function respondWithResult(_0x4f7aa0,_0x33b3b7){_0x33b3b7=_0x33b3b7||0xc8;return function(_0x893b04){if(_0x893b04){return _0x4f7aa0[_0x1c63('0x1e')](_0x33b3b7)[_0x1c63('0x20')](_0x893b04);}};}function respondWithFilteredResult(_0x5b567b,_0x32d23f){return function(_0xbcf985){if(_0xbcf985){var _0x599a75=typeof _0x32d23f['offset']===_0x1c63('0x21')&&typeof _0x32d23f[_0x1c63('0x22')]===_0x1c63('0x21');var _0x4ce014=_0xbcf985[_0x1c63('0x23')];var _0x53b7ad=_0x599a75?0x0:_0x32d23f[_0x1c63('0x24')];var _0xfa6bcc=_0x599a75?_0xbcf985[_0x1c63('0x23')]:_0x32d23f['offset']+_0x32d23f[_0x1c63('0x22')];var _0x3cda60;if(_0xfa6bcc>=_0x4ce014){_0xfa6bcc=_0x4ce014;_0x3cda60=0xc8;}else{_0x3cda60=0xce;}_0x5b567b['status'](_0x3cda60);return _0x5b567b[_0x1c63('0x25')](_0x1c63('0x26'),_0x53b7ad+'-'+_0xfa6bcc+'/'+_0x4ce014)[_0x1c63('0x20')](_0xbcf985);}return null;};}function patchUpdates(_0x3c1c75){return function(_0x293e16){try{jsonpatch[_0x1c63('0x27')](_0x293e16,_0x3c1c75,!![]);}catch(_0x35671a){return BPromise[_0x1c63('0x28')](_0x35671a);}return _0x293e16['save']();};}function saveUpdates(_0x5d396d,_0x4226f9){return function(_0x8356f6){if(_0x8356f6){return _0x8356f6[_0x1c63('0x29')](_0x5d396d)['then'](function(_0x1b6a74){return _0x1b6a74;});}return null;};}function removeEntity(_0x55d049,_0x1c69a3){return function(_0x1641c2){if(_0x1641c2){return _0x1641c2[_0x1c63('0x2a')]()[_0x1c63('0x2b')](function(){_0x55d049[_0x1c63('0x1e')](0xcc)[_0x1c63('0x1f')]();});}};}function handleEntityNotFound(_0x461aff,_0x285bc6){return function(_0x3c0351){if(!_0x3c0351){_0x461aff[_0x1c63('0x2c')](0x194);}return _0x3c0351;};}function handleError(_0x25a23a,_0x5d3696){_0x5d3696=_0x5d3696||0x1f4;return function(_0x24d824){logger['error'](_0x24d824[_0x1c63('0x2d')]);if(_0x24d824[_0x1c63('0x2e')]){delete _0x24d824[_0x1c63('0x2e')];}_0x25a23a[_0x1c63('0x1e')](_0x5d3696)[_0x1c63('0x2f')](_0x24d824);};}exports[_0x1c63('0x30')]=function(_0xd4f8f9,_0x1fe4be){var _0xa2b2b6={},_0xce5092={},_0x19e344={'count':0x0,'rows':[]};var _0x372d15=_[_0x1c63('0x31')](db[_0x1c63('0x32')][_0x1c63('0x33')],function(_0x310085){return{'name':_0x310085[_0x1c63('0x34')],'type':_0x310085[_0x1c63('0x35')][_0x1c63('0x36')]};});_0xce5092['model']=_['map'](_0x372d15,'name');_0xce5092['query']=_[_0x1c63('0x37')](_0xd4f8f9[_0x1c63('0x38')]);_0xce5092[_0x1c63('0x39')]=_[_0x1c63('0x3a')](_0xce5092[_0x1c63('0x3b')],_0xce5092[_0x1c63('0x38')]);_0xa2b2b6[_0x1c63('0x3c')]=_[_0x1c63('0x3a')](_0xce5092[_0x1c63('0x3b')],qs[_0x1c63('0x3d')](_0xd4f8f9['query']['fields']));_0xa2b2b6[_0x1c63('0x3c')]=_0xa2b2b6[_0x1c63('0x3c')][_0x1c63('0x3e')]?_0xa2b2b6[_0x1c63('0x3c')]:_0xce5092[_0x1c63('0x3b')];if(!_0xd4f8f9[_0x1c63('0x38')][_0x1c63('0x3f')](_0x1c63('0x40'))){_0xa2b2b6[_0x1c63('0x22')]=qs[_0x1c63('0x22')](_0xd4f8f9[_0x1c63('0x38')][_0x1c63('0x22')]);_0xa2b2b6[_0x1c63('0x24')]=qs[_0x1c63('0x24')](_0xd4f8f9[_0x1c63('0x38')][_0x1c63('0x24')]);}_0xa2b2b6['order']=qs['sort'](_0xd4f8f9[_0x1c63('0x38')][_0x1c63('0x41')]);_0xa2b2b6['where']=qs[_0x1c63('0x39')](_['pick'](_0xd4f8f9['query'],_0xce5092['filters']),_0x372d15);if(_0xd4f8f9[_0x1c63('0x38')][_0x1c63('0x42')]){_0xa2b2b6[_0x1c63('0x43')]=_[_0x1c63('0x44')](_0xa2b2b6[_0x1c63('0x43')],{'$or':_[_0x1c63('0x31')](_0x372d15,function(_0x33355b){if(_0x33355b['type']!==_0x1c63('0x45')){var _0x3e96ce={};_0x3e96ce[_0x33355b[_0x1c63('0x2e')]]={'$like':'%'+_0xd4f8f9[_0x1c63('0x38')][_0x1c63('0x42')]+'%'};return _0x3e96ce;}})});}_0xa2b2b6=_['merge']({},_0xa2b2b6,_0xd4f8f9[_0x1c63('0x46')]);var _0x4d4ef2={'where':_0xa2b2b6['where']};return db['ChatGroup']['count'](_0x4d4ef2)['then'](function(_0x10eb4e){_0x19e344[_0x1c63('0x23')]=_0x10eb4e;if(_0xd4f8f9[_0x1c63('0x38')][_0x1c63('0x47')]){_0xa2b2b6[_0x1c63('0x48')]=[{'all':!![]}];}return db[_0x1c63('0x32')][_0x1c63('0x49')](_0xa2b2b6);})['then'](function(_0xceff6e){_0x19e344[_0x1c63('0x4a')]=_0xceff6e;return _0x19e344;})['then'](respondWithFilteredResult(_0x1fe4be,_0xa2b2b6))['catch'](handleError(_0x1fe4be,null));};exports[_0x1c63('0x4b')]=function(_0x28fc88,_0x137ead){var _0x2a9214={'raw':!![],'where':{'id':_0x28fc88[_0x1c63('0x4c')]['id']}},_0xc7ef66={};_0xc7ef66[_0x1c63('0x3b')]=_['keys'](db[_0x1c63('0x32')][_0x1c63('0x33')]);_0xc7ef66[_0x1c63('0x38')]=_[_0x1c63('0x37')](_0x28fc88['query']);_0xc7ef66['filters']=_[_0x1c63('0x3a')](_0xc7ef66[_0x1c63('0x3b')],_0xc7ef66['query']);_0x2a9214[_0x1c63('0x3c')]=_[_0x1c63('0x3a')](_0xc7ef66['model'],qs['fields'](_0x28fc88[_0x1c63('0x38')][_0x1c63('0x3d')]));_0x2a9214[_0x1c63('0x3c')]=_0x2a9214[_0x1c63('0x3c')][_0x1c63('0x3e')]?_0x2a9214['attributes']:_0xc7ef66['model'];if(_0x28fc88['query'][_0x1c63('0x47')]){_0x2a9214[_0x1c63('0x48')]=[{'all':!![]}];}_0x2a9214=_[_0x1c63('0x44')]({},_0x2a9214,_0x28fc88[_0x1c63('0x46')]);return db[_0x1c63('0x32')]['find'](_0x2a9214)[_0x1c63('0x2b')](handleEntityNotFound(_0x137ead,null))[_0x1c63('0x2b')](respondWithResult(_0x137ead,null))['catch'](handleError(_0x137ead,null));};exports['create']=function(_0x1e2c55,_0x32254c){return db[_0x1c63('0x32')][_0x1c63('0x4d')](_0x1e2c55[_0x1c63('0x4e')],{})['then'](respondWithResult(_0x32254c,0xc9))['catch'](handleError(_0x32254c,null));};exports[_0x1c63('0x29')]=function(_0x19dc79,_0x5e1edf){if(_0x19dc79[_0x1c63('0x4e')]['id']){delete _0x19dc79[_0x1c63('0x4e')]['id'];}return db[_0x1c63('0x32')][_0x1c63('0x4f')]({'where':{'id':_0x19dc79['params']['id']}})[_0x1c63('0x2b')](handleEntityNotFound(_0x5e1edf,null))[_0x1c63('0x2b')](saveUpdates(_0x19dc79[_0x1c63('0x4e')],null))['then'](respondWithResult(_0x5e1edf,null))[_0x1c63('0x50')](handleError(_0x5e1edf,null));};exports[_0x1c63('0x2a')]=function(_0x814df0,_0x47ba6b){return db[_0x1c63('0x32')][_0x1c63('0x4f')]({'where':{'id':_0x814df0[_0x1c63('0x4c')]['id']}})[_0x1c63('0x2b')](handleEntityNotFound(_0x47ba6b,null))[_0x1c63('0x2b')](removeEntity(_0x47ba6b,null))['catch'](handleError(_0x47ba6b,null));};exports[_0x1c63('0x51')]=function(_0x4dae2f,_0x2e2af0){return db[_0x1c63('0x32')][_0x1c63('0x51')]()[_0x1c63('0x2b')](respondWithResult(_0x2e2af0,null))[_0x1c63('0x50')](handleError(_0x2e2af0,null));};exports['getUnread']=function(_0x437648,_0x2711d3,_0x4b32a0){return db[_0x1c63('0x52')][_0x1c63('0x23')]({'where':{'ChatGroupId':_0x437648[_0x1c63('0x4c')]['id'],'ToId':_0x437648[_0x1c63('0x53')]['id'],'read':![]}})[_0x1c63('0x2b')](function(_0x368cee){return{'id':_[_0x1c63('0x54')](_0x437648[_0x1c63('0x4c')]['id']),'count':_0x368cee};})[_0x1c63('0x2b')](respondWithResult(_0x2711d3,null))[_0x1c63('0x50')](handleError(_0x2711d3,null));};exports['addMembers']=function(_0x8265eb,_0x235fd9,_0x43e1bc){return db[_0x1c63('0x32')][_0x1c63('0x4f')]({'where':{'id':_0x8265eb[_0x1c63('0x4c')]['id']}})[_0x1c63('0x2b')](handleEntityNotFound(_0x235fd9,null))['then'](function(_0x82d5cb){if(_0x82d5cb){return _0x82d5cb['addMembers'](_0x8265eb['body'][_0x1c63('0x55')],_[_0x1c63('0x56')](_0x8265eb[_0x1c63('0x4e')],[_0x1c63('0x55'),'id'])||{});}})[_0x1c63('0x2b')](respondWithResult(_0x235fd9,null))[_0x1c63('0x50')](handleError(_0x235fd9,null));};exports[_0x1c63('0x57')]=function(_0x431a41,_0x18e782,_0x3c1530){var _0x344f95={};var _0x338b9e={};var _0x106bad;var _0x525e0f;return db['ChatGroup'][_0x1c63('0x58')]({'where':{'id':_0x431a41[_0x1c63('0x4c')]['id']}})[_0x1c63('0x2b')](handleEntityNotFound(_0x18e782,null))[_0x1c63('0x2b')](function(_0x2f01bb){if(_0x2f01bb){_0x106bad=_0x2f01bb;_0x338b9e['model']=_['keys'](db[_0x1c63('0x59')][_0x1c63('0x33')]);_0x338b9e[_0x1c63('0x38')]=_[_0x1c63('0x37')](_0x431a41['query']);_0x338b9e['filters']=_[_0x1c63('0x3a')](_0x338b9e[_0x1c63('0x3b')],_0x338b9e['query']);_0x344f95[_0x1c63('0x3c')]=_[_0x1c63('0x3a')](_0x338b9e[_0x1c63('0x3b')],qs[_0x1c63('0x3d')](_0x431a41[_0x1c63('0x38')][_0x1c63('0x3d')]));_0x344f95[_0x1c63('0x3c')]=_0x344f95[_0x1c63('0x3c')][_0x1c63('0x3e')]?_0x344f95[_0x1c63('0x3c')]:_0x338b9e[_0x1c63('0x3b')];_0x344f95[_0x1c63('0x5a')]=qs[_0x1c63('0x41')](_0x431a41[_0x1c63('0x38')][_0x1c63('0x41')]);_0x344f95[_0x1c63('0x43')]=qs[_0x1c63('0x39')](_[_0x1c63('0x5b')](_0x431a41[_0x1c63('0x38')],_0x338b9e[_0x1c63('0x39')]));if(_0x431a41['query']['filter']){_0x344f95[_0x1c63('0x43')]=_[_0x1c63('0x44')](_0x344f95[_0x1c63('0x43')],{'$or':_[_0x1c63('0x31')](_0x344f95[_0x1c63('0x3c')],function(_0x3b19a7){var _0x5ca7c1={};_0x5ca7c1[_0x3b19a7]={'$like':'%'+_0x431a41[_0x1c63('0x38')][_0x1c63('0x42')]+'%'};return _0x5ca7c1;})});}_0x344f95=_['merge']({},_0x344f95,_0x431a41['options']);return _0x106bad[_0x1c63('0x57')](_0x344f95);}})['then'](function(_0x7e0baa){if(_0x7e0baa){_0x525e0f=_0x7e0baa[_0x1c63('0x3e')];if(!_0x431a41[_0x1c63('0x38')][_0x1c63('0x3f')](_0x1c63('0x40'))){_0x344f95[_0x1c63('0x22')]=qs[_0x1c63('0x22')](_0x431a41['query']['limit']);_0x344f95[_0x1c63('0x24')]=qs[_0x1c63('0x24')](_0x431a41[_0x1c63('0x38')][_0x1c63('0x24')]);}return _0x106bad[_0x1c63('0x57')](_0x344f95);}})[_0x1c63('0x2b')](function(_0x23a08e){if(_0x23a08e){return _0x23a08e?{'count':_0x525e0f,'rows':_0x23a08e}:null;}})[_0x1c63('0x2b')](respondWithResult(_0x18e782,null))[_0x1c63('0x50')](handleError(_0x18e782,null));};exports[_0x1c63('0x5c')]=function(_0x4fa46c,_0x5bc2c1,_0x56b14e){return db[_0x1c63('0x32')][_0x1c63('0x4f')]({'where':{'id':_0x4fa46c['params']['id']}})[_0x1c63('0x2b')](handleEntityNotFound(_0x5bc2c1,null))[_0x1c63('0x2b')](function(_0x4237cf){if(_0x4237cf){return _0x4237cf[_0x1c63('0x5c')](_0x4fa46c[_0x1c63('0x38')][_0x1c63('0x55')]);}})[_0x1c63('0x2b')](respondWithStatusCode(_0x5bc2c1,null))[_0x1c63('0x50')](handleError(_0x5bc2c1,null));};exports[_0x1c63('0x5d')]=function(_0x1ca6c7,_0x50b632,_0x2f5d2d){if(_0x1ca6c7[_0x1c63('0x4e')]['id']){delete _0x1ca6c7[_0x1c63('0x4e')]['id'];}return db[_0x1c63('0x32')][_0x1c63('0x4f')]({'where':{'id':_0x1ca6c7[_0x1c63('0x4c')]['id']}})[_0x1c63('0x2b')](handleEntityNotFound(_0x50b632,null))[_0x1c63('0x2b')](function(_0x3a9693){if(_0x3a9693){_0x1ca6c7['body'][_0x1c63('0x5e')]=_0x3a9693['id'];return db[_0x1c63('0x52')]['create'](_0x1ca6c7['body']);}})[_0x1c63('0x2b')](respondWithResult(_0x50b632,null))[_0x1c63('0x50')](handleError(_0x50b632,null));};exports[_0x1c63('0x5f')]=function(_0x437a84,_0x1d0e94,_0x22cb21){var _0x4d69b2={};var _0x282de9={};var _0x22d759;var _0x9cd1b3;return db[_0x1c63('0x32')][_0x1c63('0x58')]({'where':{'id':_0x437a84[_0x1c63('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1d0e94,null))['then'](function(_0x3fb669){if(_0x3fb669){_0x22d759=_0x3fb669;_0x282de9['model']=_['keys'](db[_0x1c63('0x52')][_0x1c63('0x33')]);_0x282de9[_0x1c63('0x38')]=_['keys'](_0x437a84[_0x1c63('0x38')]);_0x282de9[_0x1c63('0x39')]=_[_0x1c63('0x3a')](_0x282de9[_0x1c63('0x3b')],_0x282de9[_0x1c63('0x38')]);_0x4d69b2['attributes']=_[_0x1c63('0x3a')](_0x282de9[_0x1c63('0x3b')],qs[_0x1c63('0x3d')](_0x437a84['query'][_0x1c63('0x3d')]));_0x4d69b2[_0x1c63('0x3c')]=_0x4d69b2[_0x1c63('0x3c')]['length']?_0x4d69b2[_0x1c63('0x3c')]:_0x282de9[_0x1c63('0x3b')];_0x4d69b2['order']=qs[_0x1c63('0x41')](_0x437a84[_0x1c63('0x38')][_0x1c63('0x41')]);_0x4d69b2['where']=qs[_0x1c63('0x39')](_[_0x1c63('0x5b')](_0x437a84[_0x1c63('0x38')],_0x282de9['filters']));if(_0x437a84[_0x1c63('0x38')]['filter']){_0x4d69b2['where']=_['merge'](_0x4d69b2[_0x1c63('0x43')],{'$or':_[_0x1c63('0x31')](_0x4d69b2[_0x1c63('0x3c')],function(_0x42df26){var _0x378427={};_0x378427[_0x42df26]={'$like':'%'+_0x437a84['query'][_0x1c63('0x42')]+'%'};return _0x378427;})});}if(_0x437a84[_0x1c63('0x38')]['$gte']){var _0x24ab99=_0x437a84[_0x1c63('0x38')][_0x1c63('0x60')][_0x1c63('0x61')](',');var _0x29dca5={};_0x29dca5[_0x24ab99[0x0]]={'$gte':moment(_0x24ab99[0x1])[_0x1c63('0x62')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4d69b2['where']=_['merge'](_0x4d69b2[_0x1c63('0x43')],_0x29dca5);}_0x4d69b2=_[_0x1c63('0x44')]({},_0x4d69b2,_0x437a84[_0x1c63('0x46')]);return _0x22d759[_0x1c63('0x5f')](_0x4d69b2);}})[_0x1c63('0x2b')](function(_0xd59ae8){if(_0xd59ae8){_0x9cd1b3=_0xd59ae8[_0x1c63('0x3e')];if(!_0x437a84[_0x1c63('0x38')][_0x1c63('0x3f')]('nolimit')){_0x4d69b2[_0x1c63('0x22')]=qs[_0x1c63('0x22')](_0x437a84[_0x1c63('0x38')][_0x1c63('0x22')]);_0x4d69b2[_0x1c63('0x24')]=qs[_0x1c63('0x24')](_0x437a84['query'][_0x1c63('0x24')]);}return _0x22d759['getMessages'](_0x4d69b2);}})[_0x1c63('0x2b')](function(_0x1e5e1c){if(_0x1e5e1c){return _0x1e5e1c?{'count':_0x9cd1b3,'rows':_0x1e5e1c}:null;}})['then'](respondWithResult(_0x1d0e94,null))['catch'](handleError(_0x1d0e94,null));}; \ No newline at end of file +var _0xf4b5=['then','destroy','end','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','count','includeAll','findAll','rows','catch','show','length','include','create','body','params','find','describe','getUnread','toInteger','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','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','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update'];(function(_0x4584c1,_0x1e3d78){var _0x4a7870=function(_0x33963f){while(--_0x33963f){_0x4584c1['push'](_0x4584c1['shift']());}};_0x4a7870(++_0x1e3d78);}(_0xf4b5,0x1d1));var _0x5f4b=function(_0xb3eb73,_0x49d849){_0xb3eb73=_0xb3eb73-0x0;var _0xca1a5a=_0xf4b5[_0xb3eb73];return _0xca1a5a;};'use strict';var emlformat=require(_0x5f4b('0x0'));var rimraf=require(_0x5f4b('0x1'));var zipdir=require(_0x5f4b('0x2'));var jsonpatch=require(_0x5f4b('0x3'));var rp=require(_0x5f4b('0x4'));var moment=require(_0x5f4b('0x5'));var BPromise=require(_0x5f4b('0x6'));var Mustache=require(_0x5f4b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x5f4b('0x8'));var csv=require(_0x5f4b('0x9'));var ejs=require(_0x5f4b('0xa'));var fs=require('fs');var fs_extra=require(_0x5f4b('0xb'));var _=require(_0x5f4b('0xc'));var squel=require('squel');var crypto=require(_0x5f4b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5f4b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5f4b('0xf'));var Papa=require(_0x5f4b('0x10'));var Redis=require(_0x5f4b('0x11'));var authService=require(_0x5f4b('0x12'));var qs=require(_0x5f4b('0x13'));var as=require(_0x5f4b('0x14'));var hardwareService=require(_0x5f4b('0x15'));var logger=require(_0x5f4b('0x16'))(_0x5f4b('0x17'));var utils=require(_0x5f4b('0x18'));var config=require(_0x5f4b('0x19'));var licenseUtil=require(_0x5f4b('0x1a'));var db=require('../../mysqldb')['db'];config[_0x5f4b('0x1b')]=_[_0x5f4b('0x1c')](config[_0x5f4b('0x1b')],{'host':_0x5f4b('0x1d'),'port':0x18eb});var socket=require(_0x5f4b('0x1e'))(new Redis(config[_0x5f4b('0x1b')]));require(_0x5f4b('0x1f'))[_0x5f4b('0x20')](socket);function respondWithStatusCode(_0x10acea,_0x45f47e){_0x45f47e=_0x45f47e||0xcc;return function(_0x308f18){if(_0x308f18){return _0x10acea[_0x5f4b('0x21')](_0x45f47e);}return _0x10acea[_0x5f4b('0x22')](_0x45f47e)['end']();};}function respondWithResult(_0x3b6b04,_0x1fc8d8){_0x1fc8d8=_0x1fc8d8||0xc8;return function(_0x111661){if(_0x111661){return _0x3b6b04[_0x5f4b('0x22')](_0x1fc8d8)[_0x5f4b('0x23')](_0x111661);}};}function respondWithFilteredResult(_0x130a87,_0x3ef7f5){return function(_0x120f21){if(_0x120f21){var _0x567d39=typeof _0x3ef7f5['offset']===_0x5f4b('0x24')&&typeof _0x3ef7f5[_0x5f4b('0x25')]===_0x5f4b('0x24');var _0x1ad277=_0x120f21['count'];var _0x3a1cd6=_0x567d39?0x0:_0x3ef7f5[_0x5f4b('0x26')];var _0x3575d2=_0x567d39?_0x120f21['count']:_0x3ef7f5['offset']+_0x3ef7f5['limit'];var _0x4001ab;if(_0x3575d2>=_0x1ad277){_0x3575d2=_0x1ad277;_0x4001ab=0xc8;}else{_0x4001ab=0xce;}_0x130a87['status'](_0x4001ab);return _0x130a87[_0x5f4b('0x27')](_0x5f4b('0x28'),_0x3a1cd6+'-'+_0x3575d2+'/'+_0x1ad277)['json'](_0x120f21);}return null;};}function patchUpdates(_0x111571){return function(_0x31ab75){try{jsonpatch[_0x5f4b('0x29')](_0x31ab75,_0x111571,!![]);}catch(_0x5ed145){return BPromise[_0x5f4b('0x2a')](_0x5ed145);}return _0x31ab75[_0x5f4b('0x2b')]();};}function saveUpdates(_0xe1d540,_0x24dec6){return function(_0x2441cc){if(_0x2441cc){return _0x2441cc[_0x5f4b('0x2c')](_0xe1d540)[_0x5f4b('0x2d')](function(_0x10bac2){return _0x10bac2;});}return null;};}function removeEntity(_0x225eb6,_0xcdcc19){return function(_0x588af2){if(_0x588af2){return _0x588af2[_0x5f4b('0x2e')]()[_0x5f4b('0x2d')](function(){_0x225eb6[_0x5f4b('0x22')](0xcc)[_0x5f4b('0x2f')]();});}};}function handleEntityNotFound(_0x2a2cfd,_0x3db197){return function(_0x25d6c6){if(!_0x25d6c6){_0x2a2cfd[_0x5f4b('0x21')](0x194);}return _0x25d6c6;};}function handleError(_0x2b361d,_0x4f7aec){_0x4f7aec=_0x4f7aec||0x1f4;return function(_0x4a6cc9){logger[_0x5f4b('0x30')](_0x4a6cc9[_0x5f4b('0x31')]);if(_0x4a6cc9[_0x5f4b('0x32')]){delete _0x4a6cc9['name'];}_0x2b361d[_0x5f4b('0x22')](_0x4f7aec)[_0x5f4b('0x33')](_0x4a6cc9);};}exports[_0x5f4b('0x34')]=function(_0x504be1,_0x114120){var _0x5d7642={},_0x28d893={},_0x2694da={'count':0x0,'rows':[]};var _0x17782b=_[_0x5f4b('0x35')](db[_0x5f4b('0x36')][_0x5f4b('0x37')],function(_0x24f569){return{'name':_0x24f569[_0x5f4b('0x38')],'type':_0x24f569['type'][_0x5f4b('0x39')]};});_0x28d893[_0x5f4b('0x3a')]=_[_0x5f4b('0x35')](_0x17782b,_0x5f4b('0x32'));_0x28d893[_0x5f4b('0x3b')]=_[_0x5f4b('0x3c')](_0x504be1[_0x5f4b('0x3b')]);_0x28d893['filters']=_[_0x5f4b('0x3d')](_0x28d893[_0x5f4b('0x3a')],_0x28d893[_0x5f4b('0x3b')]);_0x5d7642[_0x5f4b('0x3e')]=_[_0x5f4b('0x3d')](_0x28d893[_0x5f4b('0x3a')],qs[_0x5f4b('0x3f')](_0x504be1[_0x5f4b('0x3b')][_0x5f4b('0x3f')]));_0x5d7642[_0x5f4b('0x3e')]=_0x5d7642['attributes']['length']?_0x5d7642[_0x5f4b('0x3e')]:_0x28d893['model'];if(!_0x504be1[_0x5f4b('0x3b')][_0x5f4b('0x40')](_0x5f4b('0x41'))){_0x5d7642['limit']=qs['limit'](_0x504be1['query']['limit']);_0x5d7642[_0x5f4b('0x26')]=qs[_0x5f4b('0x26')](_0x504be1[_0x5f4b('0x3b')][_0x5f4b('0x26')]);}_0x5d7642[_0x5f4b('0x42')]=qs[_0x5f4b('0x43')](_0x504be1[_0x5f4b('0x3b')][_0x5f4b('0x43')]);_0x5d7642[_0x5f4b('0x44')]=qs[_0x5f4b('0x45')](_[_0x5f4b('0x46')](_0x504be1[_0x5f4b('0x3b')],_0x28d893[_0x5f4b('0x45')]),_0x17782b);if(_0x504be1[_0x5f4b('0x3b')]['filter']){_0x5d7642[_0x5f4b('0x44')]=_[_0x5f4b('0x47')](_0x5d7642['where'],{'$or':_[_0x5f4b('0x35')](_0x17782b,function(_0x36f868){if(_0x36f868[_0x5f4b('0x48')]!==_0x5f4b('0x49')){var _0x179416={};_0x179416[_0x36f868[_0x5f4b('0x32')]]={'$like':'%'+_0x504be1[_0x5f4b('0x3b')][_0x5f4b('0x4a')]+'%'};return _0x179416;}})});}_0x5d7642=_[_0x5f4b('0x47')]({},_0x5d7642,_0x504be1[_0x5f4b('0x4b')]);var _0x244438={'where':_0x5d7642[_0x5f4b('0x44')]};return db[_0x5f4b('0x36')][_0x5f4b('0x4c')](_0x244438)[_0x5f4b('0x2d')](function(_0x3f8793){_0x2694da[_0x5f4b('0x4c')]=_0x3f8793;if(_0x504be1[_0x5f4b('0x3b')][_0x5f4b('0x4d')]){_0x5d7642['include']=[{'all':!![]}];}return db['ChatGroup'][_0x5f4b('0x4e')](_0x5d7642);})['then'](function(_0x1a8ece){_0x2694da[_0x5f4b('0x4f')]=_0x1a8ece;return _0x2694da;})[_0x5f4b('0x2d')](respondWithFilteredResult(_0x114120,_0x5d7642))[_0x5f4b('0x50')](handleError(_0x114120,null));};exports[_0x5f4b('0x51')]=function(_0x49c4ae,_0x2f5192){var _0x4fcf49={'raw':!![],'where':{'id':_0x49c4ae['params']['id']}},_0x253a08={};_0x253a08['model']=_[_0x5f4b('0x3c')](db[_0x5f4b('0x36')][_0x5f4b('0x37')]);_0x253a08[_0x5f4b('0x3b')]=_[_0x5f4b('0x3c')](_0x49c4ae[_0x5f4b('0x3b')]);_0x253a08[_0x5f4b('0x45')]=_[_0x5f4b('0x3d')](_0x253a08[_0x5f4b('0x3a')],_0x253a08[_0x5f4b('0x3b')]);_0x4fcf49[_0x5f4b('0x3e')]=_[_0x5f4b('0x3d')](_0x253a08[_0x5f4b('0x3a')],qs['fields'](_0x49c4ae['query'][_0x5f4b('0x3f')]));_0x4fcf49[_0x5f4b('0x3e')]=_0x4fcf49['attributes'][_0x5f4b('0x52')]?_0x4fcf49[_0x5f4b('0x3e')]:_0x253a08['model'];if(_0x49c4ae[_0x5f4b('0x3b')][_0x5f4b('0x4d')]){_0x4fcf49[_0x5f4b('0x53')]=[{'all':!![]}];}_0x4fcf49=_[_0x5f4b('0x47')]({},_0x4fcf49,_0x49c4ae['options']);return db[_0x5f4b('0x36')]['find'](_0x4fcf49)[_0x5f4b('0x2d')](handleEntityNotFound(_0x2f5192,null))[_0x5f4b('0x2d')](respondWithResult(_0x2f5192,null))['catch'](handleError(_0x2f5192,null));};exports[_0x5f4b('0x54')]=function(_0x24f02d,_0x2fd67c){return db[_0x5f4b('0x36')][_0x5f4b('0x54')](_0x24f02d[_0x5f4b('0x55')],{})[_0x5f4b('0x2d')](respondWithResult(_0x2fd67c,0xc9))[_0x5f4b('0x50')](handleError(_0x2fd67c,null));};exports[_0x5f4b('0x2c')]=function(_0x2d9807,_0x228fbd){if(_0x2d9807['body']['id']){delete _0x2d9807[_0x5f4b('0x55')]['id'];}return db[_0x5f4b('0x36')]['find']({'where':{'id':_0x2d9807[_0x5f4b('0x56')]['id']}})[_0x5f4b('0x2d')](handleEntityNotFound(_0x228fbd,null))['then'](saveUpdates(_0x2d9807[_0x5f4b('0x55')],null))[_0x5f4b('0x2d')](respondWithResult(_0x228fbd,null))[_0x5f4b('0x50')](handleError(_0x228fbd,null));};exports['destroy']=function(_0x5142b2,_0x52975b){return db[_0x5f4b('0x36')][_0x5f4b('0x57')]({'where':{'id':_0x5142b2[_0x5f4b('0x56')]['id']}})[_0x5f4b('0x2d')](handleEntityNotFound(_0x52975b,null))[_0x5f4b('0x2d')](removeEntity(_0x52975b,null))['catch'](handleError(_0x52975b,null));};exports[_0x5f4b('0x58')]=function(_0x15d4bb,_0x3dfdb1){return db[_0x5f4b('0x36')][_0x5f4b('0x58')]()[_0x5f4b('0x2d')](respondWithResult(_0x3dfdb1,null))[_0x5f4b('0x50')](handleError(_0x3dfdb1,null));};exports[_0x5f4b('0x59')]=function(_0x28604b,_0x3f6375,_0x21b9d1){return db['ChatInternalMessage'][_0x5f4b('0x4c')]({'where':{'ChatGroupId':_0x28604b[_0x5f4b('0x56')]['id'],'ToId':_0x28604b['user']['id'],'read':![]}})[_0x5f4b('0x2d')](function(_0x15461d){return{'id':_[_0x5f4b('0x5a')](_0x28604b[_0x5f4b('0x56')]['id']),'count':_0x15461d};})[_0x5f4b('0x2d')](respondWithResult(_0x3f6375,null))['catch'](handleError(_0x3f6375,null));};exports['addMembers']=function(_0x76afc7,_0x5e874a,_0x3889b3){return db[_0x5f4b('0x36')][_0x5f4b('0x57')]({'where':{'id':_0x76afc7[_0x5f4b('0x56')]['id']}})[_0x5f4b('0x2d')](handleEntityNotFound(_0x5e874a,null))[_0x5f4b('0x2d')](function(_0x39e144){if(_0x39e144){return _0x39e144['addMembers'](_0x76afc7[_0x5f4b('0x55')][_0x5f4b('0x5b')],_['omit'](_0x76afc7[_0x5f4b('0x55')],[_0x5f4b('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x5e874a,null))[_0x5f4b('0x50')](handleError(_0x5e874a,null));};exports[_0x5f4b('0x5c')]=function(_0x64022e,_0x2b61ed,_0x2b2a04){var _0x385ca5={};var _0xa46128={};var _0x2802a6;var _0x23ebf2;return db[_0x5f4b('0x36')][_0x5f4b('0x5d')]({'where':{'id':_0x64022e[_0x5f4b('0x56')]['id']}})[_0x5f4b('0x2d')](handleEntityNotFound(_0x2b61ed,null))[_0x5f4b('0x2d')](function(_0x25ed5b){if(_0x25ed5b){_0x2802a6=_0x25ed5b;_0xa46128[_0x5f4b('0x3a')]=_[_0x5f4b('0x3c')](db[_0x5f4b('0x5e')]['rawAttributes']);_0xa46128[_0x5f4b('0x3b')]=_[_0x5f4b('0x3c')](_0x64022e['query']);_0xa46128[_0x5f4b('0x45')]=_[_0x5f4b('0x3d')](_0xa46128[_0x5f4b('0x3a')],_0xa46128['query']);_0x385ca5['attributes']=_[_0x5f4b('0x3d')](_0xa46128['model'],qs[_0x5f4b('0x3f')](_0x64022e[_0x5f4b('0x3b')][_0x5f4b('0x3f')]));_0x385ca5['attributes']=_0x385ca5['attributes'][_0x5f4b('0x52')]?_0x385ca5['attributes']:_0xa46128[_0x5f4b('0x3a')];_0x385ca5[_0x5f4b('0x42')]=qs[_0x5f4b('0x43')](_0x64022e[_0x5f4b('0x3b')][_0x5f4b('0x43')]);_0x385ca5['where']=qs[_0x5f4b('0x45')](_['pick'](_0x64022e[_0x5f4b('0x3b')],_0xa46128[_0x5f4b('0x45')]));if(_0x64022e[_0x5f4b('0x3b')][_0x5f4b('0x4a')]){_0x385ca5[_0x5f4b('0x44')]=_['merge'](_0x385ca5[_0x5f4b('0x44')],{'$or':_['map'](_0x385ca5[_0x5f4b('0x3e')],function(_0x461038){var _0x3d2c64={};_0x3d2c64[_0x461038]={'$like':'%'+_0x64022e[_0x5f4b('0x3b')][_0x5f4b('0x4a')]+'%'};return _0x3d2c64;})});}_0x385ca5=_[_0x5f4b('0x47')]({},_0x385ca5,_0x64022e['options']);return _0x2802a6[_0x5f4b('0x5c')](_0x385ca5);}})[_0x5f4b('0x2d')](function(_0x24250b){if(_0x24250b){_0x23ebf2=_0x24250b[_0x5f4b('0x52')];if(!_0x64022e[_0x5f4b('0x3b')][_0x5f4b('0x40')](_0x5f4b('0x41'))){_0x385ca5[_0x5f4b('0x25')]=qs[_0x5f4b('0x25')](_0x64022e[_0x5f4b('0x3b')][_0x5f4b('0x25')]);_0x385ca5[_0x5f4b('0x26')]=qs['offset'](_0x64022e[_0x5f4b('0x3b')][_0x5f4b('0x26')]);}return _0x2802a6['getMembers'](_0x385ca5);}})['then'](function(_0xfb57ed){if(_0xfb57ed){return _0xfb57ed?{'count':_0x23ebf2,'rows':_0xfb57ed}:null;}})[_0x5f4b('0x2d')](respondWithResult(_0x2b61ed,null))[_0x5f4b('0x50')](handleError(_0x2b61ed,null));};exports[_0x5f4b('0x5f')]=function(_0x11d784,_0x1191b7,_0x726c4d){return db[_0x5f4b('0x36')][_0x5f4b('0x57')]({'where':{'id':_0x11d784[_0x5f4b('0x56')]['id']}})[_0x5f4b('0x2d')](handleEntityNotFound(_0x1191b7,null))[_0x5f4b('0x2d')](function(_0x3f10d7){if(_0x3f10d7){return _0x3f10d7[_0x5f4b('0x5f')](_0x11d784['query']['ids']);}})[_0x5f4b('0x2d')](respondWithStatusCode(_0x1191b7,null))[_0x5f4b('0x50')](handleError(_0x1191b7,null));};exports[_0x5f4b('0x60')]=function(_0x1e8862,_0x85471d,_0x5a6439){if(_0x1e8862[_0x5f4b('0x55')]['id']){delete _0x1e8862['body']['id'];}return db[_0x5f4b('0x36')][_0x5f4b('0x57')]({'where':{'id':_0x1e8862[_0x5f4b('0x56')]['id']}})[_0x5f4b('0x2d')](handleEntityNotFound(_0x85471d,null))[_0x5f4b('0x2d')](function(_0x371aad){if(_0x371aad){_0x1e8862[_0x5f4b('0x55')][_0x5f4b('0x61')]=_0x371aad['id'];return db[_0x5f4b('0x62')][_0x5f4b('0x54')](_0x1e8862[_0x5f4b('0x55')]);}})[_0x5f4b('0x2d')](respondWithResult(_0x85471d,null))[_0x5f4b('0x50')](handleError(_0x85471d,null));};exports[_0x5f4b('0x63')]=function(_0x218513,_0x3f1a02,_0x117f8){var _0x234b18={};var _0x30c141={};var _0x41306d;var _0x4d88a6;return db[_0x5f4b('0x36')][_0x5f4b('0x5d')]({'where':{'id':_0x218513[_0x5f4b('0x56')]['id']}})[_0x5f4b('0x2d')](handleEntityNotFound(_0x3f1a02,null))['then'](function(_0x59fd56){if(_0x59fd56){_0x41306d=_0x59fd56;_0x30c141[_0x5f4b('0x3a')]=_['keys'](db[_0x5f4b('0x62')][_0x5f4b('0x37')]);_0x30c141['query']=_[_0x5f4b('0x3c')](_0x218513[_0x5f4b('0x3b')]);_0x30c141[_0x5f4b('0x45')]=_[_0x5f4b('0x3d')](_0x30c141[_0x5f4b('0x3a')],_0x30c141[_0x5f4b('0x3b')]);_0x234b18[_0x5f4b('0x3e')]=_[_0x5f4b('0x3d')](_0x30c141[_0x5f4b('0x3a')],qs[_0x5f4b('0x3f')](_0x218513[_0x5f4b('0x3b')]['fields']));_0x234b18[_0x5f4b('0x3e')]=_0x234b18['attributes'][_0x5f4b('0x52')]?_0x234b18['attributes']:_0x30c141['model'];_0x234b18[_0x5f4b('0x42')]=qs[_0x5f4b('0x43')](_0x218513[_0x5f4b('0x3b')]['sort']);_0x234b18['where']=qs[_0x5f4b('0x45')](_['pick'](_0x218513[_0x5f4b('0x3b')],_0x30c141[_0x5f4b('0x45')]));if(_0x218513[_0x5f4b('0x3b')]['filter']){_0x234b18[_0x5f4b('0x44')]=_[_0x5f4b('0x47')](_0x234b18[_0x5f4b('0x44')],{'$or':_['map'](_0x234b18[_0x5f4b('0x3e')],function(_0x577c1f){var _0x2e4b40={};_0x2e4b40[_0x577c1f]={'$like':'%'+_0x218513['query'][_0x5f4b('0x4a')]+'%'};return _0x2e4b40;})});}if(_0x218513[_0x5f4b('0x3b')][_0x5f4b('0x64')]){var _0x4e62df=_0x218513[_0x5f4b('0x3b')][_0x5f4b('0x64')]['split'](',');var _0x432eb7={};_0x432eb7[_0x4e62df[0x0]]={'$gte':moment(_0x4e62df[0x1])[_0x5f4b('0x65')]('YYYY-MM-DD\x20HH:mm:ss')};_0x234b18[_0x5f4b('0x44')]=_[_0x5f4b('0x47')](_0x234b18[_0x5f4b('0x44')],_0x432eb7);}_0x234b18=_[_0x5f4b('0x47')]({},_0x234b18,_0x218513[_0x5f4b('0x4b')]);return _0x41306d[_0x5f4b('0x63')](_0x234b18);}})[_0x5f4b('0x2d')](function(_0x518b17){if(_0x518b17){_0x4d88a6=_0x518b17[_0x5f4b('0x52')];if(!_0x218513[_0x5f4b('0x3b')][_0x5f4b('0x40')](_0x5f4b('0x41'))){_0x234b18[_0x5f4b('0x25')]=qs['limit'](_0x218513['query']['limit']);_0x234b18[_0x5f4b('0x26')]=qs['offset'](_0x218513[_0x5f4b('0x3b')][_0x5f4b('0x26')]);}return _0x41306d['getMessages'](_0x234b18);}})[_0x5f4b('0x2d')](function(_0x86ab1f){if(_0x86ab1f){return _0x86ab1f?{'count':_0x4d88a6,'rows':_0x86ab1f}:null;}})[_0x5f4b('0x2d')](respondWithResult(_0x3f1a02,null))[_0x5f4b('0x50')](handleError(_0x3f1a02,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index e0ab5af..3aea069 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 _0x49fe=['remove','emit','hasOwnProperty','hook','exports','events','save','update'];(function(_0x1e5d40,_0x193c71){var _0x12d39b=function(_0x1a0736){while(--_0x1a0736){_0x1e5d40['push'](_0x1e5d40['shift']());}};_0x12d39b(++_0x193c71);}(_0x49fe,0x75));var _0xe49f=function(_0xc6efed,_0x50a56e){_0xc6efed=_0xc6efed-0x0;var _0x4ebbd0=_0x49fe[_0xc6efed];return _0x4ebbd0;};'use strict';var EventEmitter=require(_0xe49f('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe49f('0x1'),'afterUpdate':_0xe49f('0x2'),'afterDestroy':_0xe49f('0x3')};function emitEvent(_0xb99c7){return function(_0x1cac40,_0x2db0ec,_0x1235f4){ChatGroupEvents[_0xe49f('0x4')](_0xb99c7+':'+_0x1cac40['id'],_0x1cac40);ChatGroupEvents[_0xe49f('0x4')](_0xb99c7,_0x1cac40);_0x1235f4(null);};}for(var e in events){if(events[_0xe49f('0x5')](e)){var event=events[e];ChatGroup[_0xe49f('0x6')](e,emitEvent(event));}}module[_0xe49f('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0xc75f=['hasOwnProperty','exports','events','ChatGroup','setMaxListeners','update','emit'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xc75f,0xb8));var _0xfc75=function(_0x29c7f2,_0x3e8c7f){_0x29c7f2=_0x29c7f2-0x0;var _0x5a7d18=_0xc75f[_0x29c7f2];return _0x5a7d18;};'use strict';var EventEmitter=require(_0xfc75('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xfc75('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xfc75('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfc75('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3563c9){return function(_0x1e07af,_0x282ef8,_0x533f20){ChatGroupEvents['emit'](_0x3563c9+':'+_0x1e07af['id'],_0x1e07af);ChatGroupEvents[_0xfc75('0x4')](_0x3563c9,_0x1e07af);_0x533f20(null);};}for(var e in events){if(events[_0xfc75('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xfc75('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 9a4e704..861d11f 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 _0x8bb2=['chat_groups','lodash','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define'];(function(_0x55ff79,_0x3d45e7){var _0x579067=function(_0x3650e4){while(--_0x3650e4){_0x55ff79['push'](_0x55ff79['shift']());}};_0x579067(++_0x3d45e7);}(_0x8bb2,0x119));var _0x28bb=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0x8bb2[_0x4b4b0e];return _0x4c2d91;};'use strict';var _=require(_0x28bb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x28bb('0x1'));var BPromise=require(_0x28bb('0x2'));var rp=require(_0x28bb('0x3'));var fs=require('fs');var path=require(_0x28bb('0x4'));var rimraf=require(_0x28bb('0x5'));var config=require('../../config/environment');var attributes=require(_0x28bb('0x6'));module[_0x28bb('0x7')]=function(_0x5aab71,_0x32fa6d){return _0x5aab71[_0x28bb('0x8')]('ChatGroup',attributes,{'tableName':_0x28bb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcd8=['path','rimraf','../../config/environment','define','chat_groups','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1c32b5,_0x356ae4){var _0x9c47df=function(_0x368ab1){while(--_0x368ab1){_0x1c32b5['push'](_0x1c32b5['shift']());}};_0x9c47df(++_0x356ae4);}(_0xbcd8,0x102));var _0x8bcd=function(_0x341938,_0x2a61c0){_0x341938=_0x341938-0x0;var _0x22bd89=_0xbcd8[_0x341938];return _0x22bd89;};'use strict';var _=require(_0x8bcd('0x0'));var util=require(_0x8bcd('0x1'));var logger=require(_0x8bcd('0x2'))(_0x8bcd('0x3'));var moment=require(_0x8bcd('0x4'));var BPromise=require('bluebird');var rp=require(_0x8bcd('0x5'));var fs=require('fs');var path=require(_0x8bcd('0x6'));var rimraf=require(_0x8bcd('0x7'));var config=require(_0x8bcd('0x8'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x4b6524,_0x249f5b){return _0x4b6524[_0x8bcd('0x9')]('ChatGroup',attributes,{'tableName':_0x8bcd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 98976d8..886e0df 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 _0xa5fd=['redis','defaults','localhost','request','info','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x433af3,_0x2af31d){var _0x599249=function(_0xcefbd7){while(--_0xcefbd7){_0x433af3['push'](_0x433af3['shift']());}};_0x599249(++_0x2af31d);}(_0xa5fd,0x90));var _0xda5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5fd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xda5f('0x0'));var util=require('util');var moment=require(_0xda5f('0x1'));var BPromise=require(_0xda5f('0x2'));var rs=require(_0xda5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda5f('0x4'))['db'];var utils=require(_0xda5f('0x5'));var logger=require(_0xda5f('0x6'))(_0xda5f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xda5f('0x8')][_0xda5f('0x9')]({'port':0x232a});config[_0xda5f('0xa')]=_[_0xda5f('0xb')](config[_0xda5f('0xa')],{'host':_0xda5f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xda5f('0xa')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x495366,_0x246511,_0x5cfad5){return new BPromise(function(_0x20e9cf,_0x4ee788){return client[_0xda5f('0xd')](_0x495366,_0x5cfad5)['then'](function(_0x27e6fe){logger[_0xda5f('0xe')](_0xda5f('0xf'),_0x246511,'request\x20sent');logger['debug'](_0xda5f('0x10'),_0x246511,_0xda5f('0x11'),JSON[_0xda5f('0x12')](_0x27e6fe));if(_0x27e6fe[_0xda5f('0x13')]){if(_0x27e6fe['error'][_0xda5f('0x14')]===0x1f4){logger[_0xda5f('0x13')]('ChatGroup,\x20%s,\x20%s',_0x246511,_0x27e6fe[_0xda5f('0x13')][_0xda5f('0x15')]);return _0x4ee788(_0x27e6fe[_0xda5f('0x13')][_0xda5f('0x15')]);}logger[_0xda5f('0x13')](_0xda5f('0xf'),_0x246511,_0x27e6fe[_0xda5f('0x13')][_0xda5f('0x15')]);return _0x20e9cf(_0x27e6fe[_0xda5f('0x13')][_0xda5f('0x15')]);}else{logger[_0xda5f('0xe')](_0xda5f('0xf'),_0x246511,'request\x20sent');_0x20e9cf(_0x27e6fe['result'][_0xda5f('0x15')]);}})['catch'](function(_0x2682bf){logger['error']('ChatGroup,\x20%s,\x20%s',_0x246511,_0x2682bf);_0x4ee788(_0x2682bf);});});} \ No newline at end of file +var _0x9b67=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x35c22b,_0x376552){var _0x46e4c7=function(_0x1f56c1){while(--_0x1f56c1){_0x35c22b['push'](_0x35c22b['shift']());}};_0x46e4c7(++_0x376552);}(_0x9b67,0xf6));var _0x79b6=function(_0x57ca2b,_0x2f8400){_0x57ca2b=_0x57ca2b-0x0;var _0x2384bb=_0x9b67[_0x57ca2b];return _0x2384bb;};'use strict';var _=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var moment=require(_0x79b6('0x2'));var BPromise=require(_0x79b6('0x3'));var rs=require(_0x79b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79b6('0x5'))['db'];var utils=require(_0x79b6('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x79b6('0x7'));var jayson=require(_0x79b6('0x8'));var client=jayson[_0x79b6('0x9')][_0x79b6('0xa')]({'port':0x232a});config[_0x79b6('0xb')]=_[_0x79b6('0xc')](config[_0x79b6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x79b6('0xd'))(new Redis(config[_0x79b6('0xb')]));require(_0x79b6('0xe'))[_0x79b6('0xf')](socket);function respondWithRpcPromise(_0x1222a0,_0x52600c,_0x3dd86d){return new BPromise(function(_0x380b39,_0x3f3b44){return client[_0x79b6('0x10')](_0x1222a0,_0x3dd86d)['then'](function(_0x566c99){logger[_0x79b6('0x11')](_0x79b6('0x12'),_0x52600c,_0x79b6('0x13'));logger['debug'](_0x79b6('0x14'),_0x52600c,_0x79b6('0x13'),JSON[_0x79b6('0x15')](_0x566c99));if(_0x566c99[_0x79b6('0x16')]){if(_0x566c99[_0x79b6('0x16')][_0x79b6('0x17')]===0x1f4){logger[_0x79b6('0x16')](_0x79b6('0x12'),_0x52600c,_0x566c99[_0x79b6('0x16')][_0x79b6('0x18')]);return _0x3f3b44(_0x566c99[_0x79b6('0x16')][_0x79b6('0x18')]);}logger[_0x79b6('0x16')]('ChatGroup,\x20%s,\x20%s',_0x52600c,_0x566c99[_0x79b6('0x16')][_0x79b6('0x18')]);return _0x380b39(_0x566c99[_0x79b6('0x16')][_0x79b6('0x18')]);}else{logger[_0x79b6('0x11')](_0x79b6('0x12'),_0x52600c,_0x79b6('0x13'));_0x380b39(_0x566c99[_0x79b6('0x19')][_0x79b6('0x18')]);}})[_0x79b6('0x1a')](function(_0x323376){logger[_0x79b6('0x16')](_0x79b6('0x12'),_0x52600c,_0x323376);_0x3f3b44(_0x323376);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index ebdb9fe..5224c61 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 _0x6feb=['removeListener','chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x139618,_0x1d91de){var _0xe0711a=function(_0xa1ff4d){while(--_0xa1ff4d){_0x139618['push'](_0x139618['shift']());}};_0xe0711a(++_0x1d91de);}(_0x6feb,0x1d0));var _0xb6fe=function(_0x3c881c,_0x6cf001){_0x3c881c=_0x3c881c-0x0;var _0x45afa1=_0x6feb[_0x3c881c];return _0x45afa1;};'use strict';var ChatGroupEvents=require(_0xb6fe('0x0'));var events=['save',_0xb6fe('0x1'),_0xb6fe('0x2')];function createListener(_0x3ccc99,_0x5ca3d0){return function(_0x351da5){_0x5ca3d0[_0xb6fe('0x3')](_0x3ccc99,_0x351da5);};}function removeListener(_0x3b7550,_0x3ea438){return function(){ChatGroupEvents[_0xb6fe('0x4')](_0x3b7550,_0x3ea438);};}exports['register']=function(_0x4d9592){for(var _0x31e3ff=0x0,_0x22483e=events['length'];_0x31e3ff<_0x22483e;_0x31e3ff++){var _0x3495b0=events[_0x31e3ff];var _0x4ef382=createListener(_0xb6fe('0x5')+_0x3495b0,_0x4d9592);ChatGroupEvents['on'](_0x3495b0,_0x4ef382);}}; \ No newline at end of file +var _0x54b0=['./chatGroup.events','remove','emit','removeListener','register','length','chatGroup:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54b0,0x1dc));var _0x054b=function(_0x90a39a,_0x32020d){_0x90a39a=_0x90a39a-0x0;var _0x2b62f7=_0x54b0[_0x90a39a];return _0x2b62f7;};'use strict';var ChatGroupEvents=require(_0x054b('0x0'));var events=['save',_0x054b('0x1'),'update'];function createListener(_0x3cea8b,_0x4b4f0e){return function(_0x225ef4){_0x4b4f0e[_0x054b('0x2')](_0x3cea8b,_0x225ef4);};}function removeListener(_0x1d775b,_0x1b34a5){return function(){ChatGroupEvents[_0x054b('0x3')](_0x1d775b,_0x1b34a5);};}exports[_0x054b('0x4')]=function(_0x2053e8){for(var _0x3f5fd3=0x0,_0xc5a92a=events[_0x054b('0x5')];_0x3f5fd3<_0xc5a92a;_0x3f5fd3++){var _0x57d028=events[_0x3f5fd3];var _0x14c313=createListener(_0x054b('0x6')+_0x57d028,_0x2053e8);ChatGroupEvents['on'](_0x57d028,_0x14c313);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index fbe852d..76f173d 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 _0x2eaa=['destroy','/:id/members','removeMembers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','post','create','addMembers','addMessage','delete'];(function(_0x21fa78,_0x1d43c2){var _0x22aff0=function(_0x2c54c9){while(--_0x2c54c9){_0x21fa78['push'](_0x21fa78['shift']());}};_0x22aff0(++_0x1d43c2);}(_0x2eaa,0x14d));var _0xa2ea=function(_0x38e793,_0x357660){_0x38e793=_0x38e793-0x0;var _0x10230b=_0x2eaa[_0x38e793];return _0x10230b;};'use strict';var multer=require(_0xa2ea('0x0'));var util=require(_0xa2ea('0x1'));var path=require(_0xa2ea('0x2'));var timeout=require(_0xa2ea('0x3'));var express=require(_0xa2ea('0x4'));var router=express[_0xa2ea('0x5')]();var fs_extra=require(_0xa2ea('0x6'));var auth=require(_0xa2ea('0x7'));var interaction=require(_0xa2ea('0x8'));var config=require(_0xa2ea('0x9'));var controller=require(_0xa2ea('0xa'));router[_0xa2ea('0xb')]('/',auth[_0xa2ea('0xc')](),controller[_0xa2ea('0xd')]);router['get'](_0xa2ea('0xe'),auth[_0xa2ea('0xc')](),controller[_0xa2ea('0xf')]);router[_0xa2ea('0xb')](_0xa2ea('0x10'),auth['isAuthenticated'](),controller[_0xa2ea('0x11')]);router[_0xa2ea('0xb')](_0xa2ea('0x12'),auth[_0xa2ea('0xc')](),controller[_0xa2ea('0x13')]);router['get']('/:id/members',auth[_0xa2ea('0xc')](),controller[_0xa2ea('0x14')]);router[_0xa2ea('0xb')](_0xa2ea('0x15'),auth[_0xa2ea('0xc')](),controller['getMessages']);router[_0xa2ea('0x16')]('/',auth[_0xa2ea('0xc')](),controller[_0xa2ea('0x17')]);router['post']('/:id/members',auth[_0xa2ea('0xc')](),controller[_0xa2ea('0x18')]);router[_0xa2ea('0x16')]('/:id/messages',auth[_0xa2ea('0xc')](),controller[_0xa2ea('0x19')]);router['put'](_0xa2ea('0x10'),auth[_0xa2ea('0xc')](),controller['update']);router[_0xa2ea('0x1a')]('/:id',auth[_0xa2ea('0xc')](),controller[_0xa2ea('0x1b')]);router[_0xa2ea('0x1a')](_0xa2ea('0x1c'),auth[_0xa2ea('0xc')](),controller[_0xa2ea('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x7454=['../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','getMessages','post','create','/:id/members','addMembers','/:id/messages','put','update','destroy','delete','removeMembers','exports','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0xe5ded2,_0x47e8e1){var _0x22c19f=function(_0x2ca0a0){while(--_0x2ca0a0){_0xe5ded2['push'](_0xe5ded2['shift']());}};_0x22c19f(++_0x47e8e1);}(_0x7454,0x1ac));var _0x4745=function(_0x4bd64d,_0x3c2b8a){_0x4bd64d=_0x4bd64d-0x0;var _0x37db2d=_0x7454[_0x4bd64d];return _0x37db2d;};'use strict';var multer=require(_0x4745('0x0'));var util=require(_0x4745('0x1'));var path=require(_0x4745('0x2'));var timeout=require('connect-timeout');var express=require(_0x4745('0x3'));var router=express['Router']();var fs_extra=require(_0x4745('0x4'));var auth=require(_0x4745('0x5'));var interaction=require(_0x4745('0x6'));var config=require(_0x4745('0x7'));var controller=require(_0x4745('0x8'));router[_0x4745('0x9')]('/',auth[_0x4745('0xa')](),controller[_0x4745('0xb')]);router[_0x4745('0x9')](_0x4745('0xc'),auth[_0x4745('0xa')](),controller[_0x4745('0xd')]);router[_0x4745('0x9')](_0x4745('0xe'),auth['isAuthenticated'](),controller[_0x4745('0xf')]);router[_0x4745('0x9')](_0x4745('0x10'),auth['isAuthenticated'](),controller[_0x4745('0x11')]);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x4745('0x12')]);router['get']('/:id/messages',auth[_0x4745('0xa')](),controller[_0x4745('0x13')]);router[_0x4745('0x14')]('/',auth[_0x4745('0xa')](),controller[_0x4745('0x15')]);router[_0x4745('0x14')](_0x4745('0x16'),auth[_0x4745('0xa')](),controller[_0x4745('0x17')]);router['post'](_0x4745('0x18'),auth['isAuthenticated'](),controller['addMessage']);router[_0x4745('0x19')](_0x4745('0xe'),auth['isAuthenticated'](),controller[_0x4745('0x1a')]);router['delete'](_0x4745('0xe'),auth[_0x4745('0xa')](),controller[_0x4745('0x1b')]);router[_0x4745('0x1c')](_0x4745('0x16'),auth[_0x4745('0xa')](),controller[_0x4745('0x1d')]);module[_0x4745('0x1e')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 086a4ba..e10e2bd 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 _0xb74d=['star','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN','ENUM','thumb'];(function(_0x30f385,_0x30d4c7){var _0x9ec4b0=function(_0x1274a2){while(--_0x1274a2){_0x30f385['push'](_0x30f385['shift']());}};_0x9ec4b0(++_0x30d4c7);}(_0xb74d,0x16e));var _0xdb74=function(_0x1af5b2,_0x1b82fe){_0x1af5b2=_0x1af5b2-0x0;var _0xf1aa2d=_0xb74d[_0x1af5b2];return _0xf1aa2d;};'use strict';var Sequelize=require(_0xdb74('0x0'));module['exports']={'closed':{'type':Sequelize[_0xdb74('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xdb74('0x2')]('star',_0xdb74('0x3')),'defaultValue':_0xdb74('0x4')},'ratingMessage':{'type':Sequelize[_0xdb74('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xdb74('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xdb74('0x7')]},'disposition':{'type':Sequelize[_0xdb74('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xdb74('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xdb74('0x6')]},'osName':{'type':Sequelize[_0xdb74('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xdb74('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xdb74('0x6')]},'referer':{'type':Sequelize[_0xdb74('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xdb74('0x5')](_0xdb74('0x8'))},'read1stAt':{'type':Sequelize[_0xdb74('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xdb74('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xdb74('0x6')]},'customerPort':{'type':Sequelize[_0xdb74('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xdb74('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xdb74('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xbfcc=['TEXT','long','out','BOOLEAN','sequelize','INTEGER','ENUM','star','thumb','DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0xbfcc[_0x597484];return _0x218e64;};'use strict';var Sequelize=require(_0xcbfc('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xcbfc('0x1')]},'ratingType':{'type':Sequelize[_0xcbfc('0x2')](_0xcbfc('0x3'),_0xcbfc('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xcbfc('0x5')]},'disposition':{'type':Sequelize[_0xcbfc('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xcbfc('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xcbfc('0x6')]},'browserVersion':{'type':Sequelize[_0xcbfc('0x6')]},'osName':{'type':Sequelize[_0xcbfc('0x6')]},'osVersion':{'type':Sequelize[_0xcbfc('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xcbfc('0x6')]},'deviceType':{'type':Sequelize[_0xcbfc('0x6')]},'referer':{'type':Sequelize[_0xcbfc('0x7')]},'customerIp':{'type':Sequelize[_0xcbfc('0x6')]},'formData':{'type':Sequelize[_0xcbfc('0x7')](_0xcbfc('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xcbfc('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xcbfc('0x2')]('in',_0xcbfc('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xcbfc('0x6')]},'customerPort':{'type':Sequelize[_0xcbfc('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xcbfc('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 2a2cc22..2a566e5 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 _0x4b25=['o.id\x20=\x20i.UserId','chat_websites','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','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)','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','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?','body','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','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','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','length','ChatInteraction','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','Contact.lastName','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ChatInteractionId','rows','show','params','includeAll','include','options','create','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','originalname','basename','file','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','MailServerOut','Smtp','service','host','port','secure','pass','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','addTags','spread','emit','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','direction','Account','Owner','get','mkdirSync','Chat','N.A.','customerPort','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','squel','jsforce','desk.js','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','stack','name','send','merge','contact','interaction','Users','fullname','TagIds','split','forEach','Tags','push','waiting','answered','unmanaged','abandoned','total','closed','UserId','talking','disposition','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','left_join'];(function(_0x5bc5fe,_0x2afaef){var _0x298ea7=function(_0x1c6bd5){while(--_0x1c6bd5){_0x5bc5fe['push'](_0x5bc5fe['shift']());}};_0x298ea7(++_0x2afaef);}(_0x4b25,0xca));var _0x54b2=function(_0x3bf427,_0x519950){_0x3bf427=_0x3bf427-0x0;var _0x48893c=_0x4b25[_0x3bf427];return _0x48893c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54b2('0x0'));var zipdir=require(_0x54b2('0x1'));var jsonpatch=require(_0x54b2('0x2'));var rp=require(_0x54b2('0x3'));var moment=require('moment');var BPromise=require(_0x54b2('0x4'));var Mustache=require(_0x54b2('0x5'));var util=require('util');var path=require('path');var sox=require(_0x54b2('0x6'));var csv=require(_0x54b2('0x7'));var ejs=require(_0x54b2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x54b2('0x9'));var crypto=require('crypto');var jsforce=require(_0x54b2('0xa'));var deskjs=require(_0x54b2('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x54b2('0xc'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x54b2('0xd'));var hardwareService=require(_0x54b2('0xe'));var logger=require(_0x54b2('0xf'))('api');var utils=require(_0x54b2('0x10'));var config=require(_0x54b2('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x54b2('0x12')]=_[_0x54b2('0x13')](config['redis'],{'host':_0x54b2('0x14'),'port':0x18eb});var socket=require(_0x54b2('0x15'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x54b2('0x16'));var client=jayson['client'][_0x54b2('0x17')]({'port':0x232b});var client9004=jayson[_0x54b2('0x18')][_0x54b2('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x1c3539,_0x369bd8,_0x243cd1,_0x34edac){return new BPromise(function(_0x26a1a3,_0x22c9f4){var _0x42f261=_0x34edac||client;return _0x42f261[_0x54b2('0x19')](_0x1c3539,_0x243cd1)[_0x54b2('0x1a')](function(_0x337289){logger[_0x54b2('0x1b')](_0x54b2('0x1c'),_0x369bd8,_0x54b2('0x1d'));logger[_0x54b2('0x1e')](_0x54b2('0x1f'),_0x369bd8,'request\x20sent',JSON['stringify'](_0x337289));if(_0x337289[_0x54b2('0x20')]){if(_0x337289[_0x54b2('0x20')][_0x54b2('0x21')]===0x1f4){logger[_0x54b2('0x20')](_0x54b2('0x1c'),_0x369bd8,_0x337289[_0x54b2('0x20')][_0x54b2('0x22')]);return _0x22c9f4(_0x337289[_0x54b2('0x20')][_0x54b2('0x22')]);}logger[_0x54b2('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x369bd8,_0x337289[_0x54b2('0x20')][_0x54b2('0x22')]);return _0x26a1a3(_0x337289['error']['message']);}else{logger[_0x54b2('0x1b')](_0x54b2('0x1c'),_0x369bd8,'request\x20sent');_0x26a1a3(_0x337289[_0x54b2('0x23')][_0x54b2('0x22')]);}})[_0x54b2('0x24')](function(_0x239d52){logger[_0x54b2('0x20')](_0x54b2('0x1c'),_0x369bd8,_0x239d52);_0x22c9f4(_0x239d52);});});}function respondWithStatusCode(_0xebfdf0,_0x3cd5bb){_0x3cd5bb=_0x3cd5bb||0xcc;return function(_0x4b6cf5){if(_0x4b6cf5){return _0xebfdf0[_0x54b2('0x25')](_0x3cd5bb);}return _0xebfdf0[_0x54b2('0x26')](_0x3cd5bb)[_0x54b2('0x27')]();};}function respondWithResult(_0x5ea839,_0xc02279){_0xc02279=_0xc02279||0xc8;return function(_0x3b750f){if(_0x3b750f){return _0x5ea839[_0x54b2('0x26')](_0xc02279)[_0x54b2('0x28')](_0x3b750f);}};}function respondWithFilteredResult(_0x1e745f,_0x58c58a){return function(_0x53e6ad){if(_0x53e6ad){var _0x184510=typeof _0x58c58a[_0x54b2('0x29')]===_0x54b2('0x2a')&&typeof _0x58c58a[_0x54b2('0x2b')]===_0x54b2('0x2a');var _0x273033=_0x53e6ad[_0x54b2('0x2c')];var _0x5df195=_0x184510?0x0:_0x58c58a[_0x54b2('0x29')];var _0x5dd406=_0x184510?_0x53e6ad[_0x54b2('0x2c')]:_0x58c58a['offset']+_0x58c58a['limit'];var _0x4a0379;if(_0x5dd406>=_0x273033){_0x5dd406=_0x273033;_0x4a0379=0xc8;}else{_0x4a0379=0xce;}_0x1e745f[_0x54b2('0x26')](_0x4a0379);return _0x1e745f[_0x54b2('0x2d')]('Content-Range',_0x5df195+'-'+_0x5dd406+'/'+_0x273033)[_0x54b2('0x28')](_0x53e6ad);}return null;};}function patchUpdates(_0xe1d373){return function(_0x321596){try{jsonpatch['apply'](_0x321596,_0xe1d373,!![]);}catch(_0x54dcf7){return BPromise[_0x54b2('0x2e')](_0x54dcf7);}return _0x321596[_0x54b2('0x2f')]();};}function saveUpdates(_0x3f453c,_0x2557d3){return function(_0x4b16ae){if(_0x4b16ae){return _0x4b16ae[_0x54b2('0x30')](_0x3f453c)['then'](function(_0x13e15e){return _0x13e15e;});}return null;};}function removeEntity(_0x40c23d,_0x59b591){return function(_0x3245cc){if(_0x3245cc){return _0x3245cc[_0x54b2('0x31')]()['then'](function(){_0x40c23d[_0x54b2('0x26')](0xcc)[_0x54b2('0x27')]();});}};}function handleEntityNotFound(_0x4e0a67,_0x3a515b){return function(_0x5adf1b){if(!_0x5adf1b){_0x4e0a67[_0x54b2('0x25')](0x194);}return _0x5adf1b;};}function handleError(_0x2a485d,_0x516b12){_0x516b12=_0x516b12||0x1f4;return function(_0x2d344b){logger[_0x54b2('0x20')](_0x2d344b[_0x54b2('0x32')]);if(_0x2d344b[_0x54b2('0x33')]){delete _0x2d344b[_0x54b2('0x33')];}_0x2a485d[_0x54b2('0x26')](_0x516b12)[_0x54b2('0x34')](_0x2d344b);};}function getMustacheRender(_0xed90fa,_0x2b0798){return Mustache['render'](_0xed90fa,_[_0x54b2('0x35')](_0x2b0798['body'],{'contact':_0x2b0798[_0x54b2('0x36')],'message':_0x2b0798[_0x54b2('0x22')],'agent':_0x2b0798['agent'],'interaction':_0x2b0798[_0x54b2('0x37')],'account':_0x2b0798['account']}))||'';}function getInteractionUsers(_0x15cad1,_0x33e2c9){return new BPromise(function(_0x101bca,_0x400aee){try{if(_0x33e2c9[_0x15cad1['id']]){_0x15cad1[_0x54b2('0x38')]=_['map'](_0x33e2c9[_0x15cad1['id']],function(_0x51d32a){return{'id':_0x51d32a['id'],'fullname':_0x51d32a[_0x54b2('0x39')]};});}}catch(_0x51cbf2){_0x400aee(_0x51cbf2);}_0x101bca(_0x15cad1);});}function getInteractionTags(_0x23425c,_0x52c98c){return new BPromise(function(_0x550d33,_0xe1885b){try{if(_0x23425c[_0x54b2('0x3a')]){_0x23425c['Tags']=[];_0x23425c[_0x54b2('0x3a')][_0x54b2('0x3b')](',')[_0x54b2('0x3c')](function(_0x56af65){_0x23425c[_0x54b2('0x3d')][_0x54b2('0x3e')](_0x52c98c[_0x56af65]);});}delete _0x23425c[_0x54b2('0x3a')];}catch(_0x545aec){_0xe1885b(_0x545aec);}_0x550d33(_0x23425c);});}function updateChatInteraction(_0x5f5b45,_0x2ee6ef,_0x24652f){return new BPromise(function(_0xf7e1f5,_0x4e23fd){return getInteractionUsers(_0x5f5b45,_0x24652f)[_0x54b2('0x1a')](function(_0x18512e){return getInteractionTags(_0x18512e,_0x2ee6ef);})['then'](function(_0x26b017){return getStateInteraction(_0x26b017);})[_0x54b2('0x1a')](function(_0x50f8b5){_0xf7e1f5(_0x50f8b5);})['catch'](function(_0x35e7a0){_0x4e23fd(_0x35e7a0);});});}function getStateInteraction(_0x1bd130){return new BPromise(function(_0x4f3d43){_0x1bd130[_0x54b2('0x3f')]=0x0;_0x1bd130['talking']=0x0;_0x1bd130[_0x54b2('0x40')]=0x0;_0x1bd130[_0x54b2('0x41')]=0x0;_0x1bd130[_0x54b2('0x42')]=0x0;_0x1bd130[_0x54b2('0x43')]=0x0;if(!_0x1bd130[_0x54b2('0x44')]&&!_0x1bd130[_0x54b2('0x45')]){_0x1bd130[_0x54b2('0x3f')]+=0x1;}if(!_0x1bd130[_0x54b2('0x44')]&&_0x1bd130[_0x54b2('0x45')]){_0x1bd130[_0x54b2('0x46')]+=0x1;if(_0x1bd130[_0x54b2('0x3f')]){_0x1bd130[_0x54b2('0x3f')]-=0x1;}}if(_0x1bd130[_0x54b2('0x44')]&&_0x1bd130['disposition']===_0x54b2('0x42')){_0x1bd130[_0x54b2('0x42')]+=0x1;if(_0x1bd130[_0x54b2('0x3f')]){_0x1bd130[_0x54b2('0x3f')]-=0x1;}}else if(_0x1bd130['closed']&&!_0x1bd130[_0x54b2('0x45')]&&_0x1bd130[_0x54b2('0x47')]){_0x1bd130[_0x54b2('0x41')]+=0x1;if(_0x1bd130[_0x54b2('0x3f')]){_0x1bd130[_0x54b2('0x3f')]-=0x1;}}else if(_0x1bd130[_0x54b2('0x44')]&&_0x1bd130['UserId']){_0x1bd130[_0x54b2('0x40')]+=0x1;if(_0x1bd130[_0x54b2('0x46')]){_0x1bd130[_0x54b2('0x46')]-=0x1;}}_0x1bd130[_0x54b2('0x43')]+=0x1;_0x4f3d43(_0x1bd130);});}exports[_0x54b2('0x48')]=function(_0x236832,_0x48e2e1){var _0x5a4272={},_0x4a1c3e={},_0x1690bd={'count':0x0,'rows':[]};var _0x1abbab=_[_0x54b2('0x49')](db['ChatInteraction'][_0x54b2('0x4a')],function(_0x39b2ba){return{'name':_0x39b2ba['fieldName'],'type':_0x39b2ba[_0x54b2('0x4b')][_0x54b2('0x4c')]};});_0x4a1c3e['model']=_[_0x54b2('0x49')](_0x1abbab,_0x54b2('0x33'));_0x4a1c3e[_0x54b2('0x4d')]=_[_0x54b2('0x4e')](_0x236832[_0x54b2('0x4d')]);_0x4a1c3e[_0x54b2('0x4f')]=_[_0x54b2('0x50')](_0x4a1c3e['model'],_0x4a1c3e[_0x54b2('0x4d')]);_0x5a4272['attributes']=_[_0x54b2('0x50')](_0x4a1c3e[_0x54b2('0x51')],qs[_0x54b2('0x52')](_0x236832['query'][_0x54b2('0x52')]));_0x5a4272['attributes']=_0x5a4272[_0x54b2('0x53')]['length']?_0x5a4272[_0x54b2('0x53')]:_0x4a1c3e[_0x54b2('0x51')];if(!_0x236832['query'][_0x54b2('0x54')](_0x54b2('0x55'))){_0x5a4272[_0x54b2('0x2b')]=qs[_0x54b2('0x2b')](_0x236832[_0x54b2('0x4d')]['limit']);_0x5a4272[_0x54b2('0x29')]=qs[_0x54b2('0x29')](_0x236832[_0x54b2('0x4d')]['offset']);}_0x5a4272['order']=qs[_0x54b2('0x56')](_0x236832['query'][_0x54b2('0x56')]);_0x5a4272[_0x54b2('0x57')]=qs[_0x54b2('0x4f')](_[_0x54b2('0x58')](_0x236832[_0x54b2('0x4d')],_0x4a1c3e['filters']),_0x1abbab);var _0x146442=[];var _0x2f9950=squel[_0x54b2('0x59')]()[_0x54b2('0x5a')]('id')[_0x54b2('0x5a')](_0x54b2('0x33'))[_0x54b2('0x5a')](_0x54b2('0x5b'))[_0x54b2('0x5c')](_0x54b2('0x5d'));var _0x33ff52=squel[_0x54b2('0x59')]()[_0x54b2('0x5a')](_0x54b2('0x5e'))[_0x54b2('0x5a')](_0x54b2('0x5f'))[_0x54b2('0x5a')](_0x54b2('0x60'))[_0x54b2('0x5c')](_0x54b2('0x61'),'ui')['left_join'](_0x54b2('0x62'),'u',_0x54b2('0x63'));var _0x104012=squel[_0x54b2('0x59')]()[_0x54b2('0x5c')](_0x54b2('0x64'),'i')['left_join'](_0x54b2('0x65'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x54b2('0x66')](_0x54b2('0x62'),'o',_0x54b2('0x67'))[_0x54b2('0x66')](_0x54b2('0x68'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x54b2('0x66')](_0x54b2('0x69'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x54b2('0x66')](_0x54b2('0x6a'),'it',_0x54b2('0x6b'))[_0x54b2('0x66')](_0x54b2('0x5d'),'t',_0x54b2('0x6c'));var _0xe0f3b=squel[_0x54b2('0x6d')]();var _0x5071ff=[];var _0x3bf184=squel[_0x54b2('0x6d')]();var _0x5f3d6a;if(_0x236832[_0x54b2('0x4d')][_0x54b2('0x6e')]){_0x5f3d6a=as[_0x54b2('0x6f')](_0x236832[_0x54b2('0x4d')][_0x54b2('0x6e')]);var _0x558534=_0x5f3d6a[_0x54b2('0x70')];for(var _0x43af59=0x0;_0x43af59<_0x5f3d6a[_0x54b2('0x71')]['length'];_0x43af59++){var _0x562d8d=_0x5f3d6a['conditions'][_0x43af59];var _0x33027b='i';var _0x5e2e95=_[_0x54b2('0x72')](_0x1abbab,[_0x54b2('0x33'),_0x562d8d[_0x54b2('0x5a')]]);if(!_0x5e2e95){switch(_0x562d8d[_0x54b2('0x5a')]){case'unreadMessages':if(_0x562d8d['value']==0x1){_0x104012[_0x54b2('0x73')]('`'+_0x562d8d[_0x54b2('0x5a')]+_0x54b2('0x74'));}else{_0x104012[_0x54b2('0x73')]('`'+_0x562d8d[_0x54b2('0x5a')]+_0x54b2('0x75'));}break;case _0x54b2('0x76'):if(_0x562d8d[_0x54b2('0x77')]===_0x54b2('0x78')){if(_0x562d8d['value']['split']('\x20')['length']>0x1){_0xe0f3b[_0x558534](_0x54b2('0x79'),qs['getFullTextValue'](_0x562d8d[_0x54b2('0x7a')]),null);}else{var _0x1829f2='%'+_0x562d8d['value']+'%';_0xe0f3b[_0x558534](_0x54b2('0x7b'),_0x1829f2,_0x1829f2,_0x1829f2);}}else{_0x5e2e95=_[_0x54b2('0x72')](_0x1abbab,[_0x54b2('0x33'),_0x54b2('0x7c')]);_0x562d8d[_0x54b2('0x5a')]=_0x54b2('0x7c');_0x4ff79d=as[_0x54b2('0x7d')](_0x33027b,_0x5e2e95['type'],_0x562d8d);_0xe0f3b[_0x558534](_0x4ff79d[_0x54b2('0x7e')],_0x4ff79d[_0x54b2('0x7a')][_0x54b2('0x7f')],_0x4ff79d[_0x54b2('0x7a')][_0x54b2('0x27')]);}break;case _0x54b2('0x80'):var _0x174cb0=_0x562d8d[_0x54b2('0x7a')][_0x54b2('0x3b')](',')[_0x54b2('0x49')](function(_0x1e1117){return Number(_0x1e1117);});_0x174cb0[_0x54b2('0x3c')](function(_0x133401){_0x3bf184['or'](_0x54b2('0x81'),'%,'+_0x133401+',%');});_0x5071ff=_[_0x54b2('0x82')](_0x5071ff,_0x174cb0);break;case _0x54b2('0x83'):if(_0x562d8d['operator']===_0x54b2('0x78')){_0xe0f3b[_0x558534](_0x54b2('0x84'),'%'+_0x562d8d['value']+'%',null);}else{_0x5e2e95=_[_0x54b2('0x72')](_0x1abbab,[_0x54b2('0x33'),'UserId']);_0x562d8d[_0x54b2('0x5a')]='UserId';_0x4ff79d=as[_0x54b2('0x7d')](_0x33027b,_0x5e2e95[_0x54b2('0x4b')],_0x562d8d);_0xe0f3b[_0x558534](_0x4ff79d[_0x54b2('0x7e')],_0x4ff79d[_0x54b2('0x7a')]['start'],_0x4ff79d['value'][_0x54b2('0x27')]);}break;case _0x54b2('0x85'):_0x4ff79d=as[_0x54b2('0x7d')]('me',null,_0x562d8d);_0xe0f3b[_0x558534](_0x4ff79d[_0x54b2('0x7e')],_0x4ff79d[_0x54b2('0x7a')]['start'],_0x4ff79d[_0x54b2('0x7a')][_0x54b2('0x27')]);break;}}else{var _0x4ff79d=as[_0x54b2('0x7d')](_0x33027b,_0x5e2e95[_0x54b2('0x4b')],_0x562d8d);_0xe0f3b[_0x558534](_0x4ff79d['text'],_0x4ff79d[_0x54b2('0x7a')]['start'],_0x4ff79d[_0x54b2('0x7a')][_0x54b2('0x27')]);}}}else{var _0xa4e55a=_(_0x236832[_0x54b2('0x4d')])[_0x54b2('0x4e')]()['map'](function(_0x5742a8){return _[_0x54b2('0x86')](_0x1abbab,[_0x54b2('0x33'),_0x5742a8])?_0x5742a8:undefined;})[_0x54b2('0x87')]()[_0x54b2('0x7a')]();if(!_[_0x54b2('0x88')](_0xa4e55a)){_0xa4e55a[_0x54b2('0x3c')](function(_0x481d30){if(_0x481d30===_0x54b2('0x89')){_0x104012[_0x54b2('0x57')](_0x54b2('0x8a'),[]['concat'](_0x236832[_0x54b2('0x4d')][_0x481d30]));}else if(_0x481d30===_0x54b2('0x8b')){var _0x2a7e5f=JSON[_0x54b2('0x8c')](_0x236832[_0x54b2('0x4d')][_0x481d30])['$gte'];var _0x2932c2=JSON['parse'](_0x236832['query'][_0x481d30])[_0x54b2('0x8d')];_0x104012[_0x54b2('0x57')](_0x54b2('0x8e'),_0x2a7e5f,_0x2932c2);}else{if(_0x236832[_0x54b2('0x4d')][_0x481d30]===_0x54b2('0x8f')){_0x104012['where']('i.'+_0x481d30+'\x20IS\x20NULL');}else{_0x104012[_0x54b2('0x57')]('i.'+_0x481d30+'\x20=\x20?',_0x236832[_0x54b2('0x4d')][_0x481d30]);}}});}if(_0x236832[_0x54b2('0x4d')][_0x54b2('0x90')]){if(_0x236832[_0x54b2('0x4d')][_0x54b2('0x90')]==0x1){_0x104012['having'](_0x54b2('0x91'));}else{_0x104012[_0x54b2('0x73')](_0x54b2('0x92'));}}if(_0x236832[_0x54b2('0x4d')]['tag']){_0x5071ff=_[_0x54b2('0x93')](_0x236832[_0x54b2('0x4d')]['tag'])?_0x236832[_0x54b2('0x4d')]['tag']:new Array(_0x236832[_0x54b2('0x4d')]['tag']);_0x5071ff[_0x54b2('0x3c')](function(_0x4e9be9){_0x3bf184['or'](_0x54b2('0x81'),'%,'+_0x4e9be9+',%');});}if(_0x236832['query'][_0x54b2('0x94')]){var _0x26da52=_0x236832['query'][_0x54b2('0x94')]['replace']('\x5c','\x5c\x5c')[_0x54b2('0x95')](/'/g,'\x27\x27');if(qs[_0x54b2('0x96')](_0x26da52)){_0xe0f3b['or'](_0x54b2('0x97'),_0x26da52+'%');}else{_0xe0f3b['or'](_0x54b2('0x98'),qs[_0x54b2('0x99')](_0x26da52))['or'](_0x54b2('0x9a'),_0x26da52+'%');}}}_0x104012[_0x54b2('0x57')](_0xe0f3b);_0x104012[_0x54b2('0x9b')](_0x54b2('0x9c'));var _0x10a299={'type':db[_0x54b2('0x9d')]['QueryTypes'][_0x54b2('0x9e')],'raw':!![]};var _0x4ae29e=_0x104012[_0x54b2('0x9f')]();_0x4ae29e[_0x54b2('0x5a')](_0x54b2('0x9c'));_0x4ae29e[_0x54b2('0x5a')](_0x54b2('0xa0'),_0x54b2('0xa1'));if(_0x5a4272[_0x54b2('0xa2')]){_0x5a4272[_0x54b2('0xa2')][_0x54b2('0x3c')](function(_0x30c1e1){var _0x5594ca=_0x30c1e1[0x0]===_0x54b2('0xa3')?_0x30c1e1[0x0]:'i.'+_0x30c1e1[0x0];_0x104012['order'](_0x5594ca,_0x30c1e1[0x1]==='DESC'?![]:!![]);});}if(!_[_0x54b2('0x88')](_0x5071ff)){_0x104012[_0x54b2('0x73')](_0x3bf184);_0x4ae29e[_0x54b2('0x57')]('t.id\x20IN\x20?',_0x5071ff);}BPromise['resolve']()['then'](function(){if(!_0x5f3d6a){if(_0x236832[_0x54b2('0x4d')][_0x54b2('0x89')])return;_0x4ae29e[_0x54b2('0x57')](_0x54b2('0xa4'));_0x104012[_0x54b2('0x57')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x236832['user'][_0x54b2('0xa5')]!==_0x54b2('0xa6'))return;return _0x236832[_0x54b2('0xa7')][_0x54b2('0xa8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x57ec86){if(_[_0x54b2('0x88')](_0x57ec86)){_0x4ae29e[_0x54b2('0x57')](_0x54b2('0xa9'));_0x104012[_0x54b2('0x57')](_0x54b2('0xa9'));}else{_0x4ae29e[_0x54b2('0x57')](_0x54b2('0x8a'),_['map'](_0x57ec86,'id'));_0x104012[_0x54b2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x57ec86,'id'));}});})[_0x54b2('0x1a')](function(){if(_0x236832[_0x54b2('0xa7')]['role']===_0x54b2('0xa6')&&!_0x5f3d6a&&!_0x236832['query'][_0x54b2('0x89')])return[];return db[_0x54b2('0xaa')]['query'](_0x4ae29e[_0x54b2('0xab')](),_0x10a299);})[_0x54b2('0x1a')](function(_0x10e606){_0x1690bd[_0x54b2('0x2c')]=_0x10e606[_0x54b2('0xac')];if(_0x1690bd[_0x54b2('0x2c')]===0x0)return[];return db[_0x54b2('0xaa')][_0x54b2('0x4d')](_0x2f9950['toString'](),_0x10a299)[_0x54b2('0x1a')](function(_0x2a6ae2){_0x146442=_['keyBy'](_0x2a6ae2,'id');_0x10a299=_['merge'](_0x10a299,{'model':db[_0x54b2('0xad')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x236832[_0x54b2('0x4d')][_0x54b2('0x52')]){_0x5a4272[_0x54b2('0x53')][_0x54b2('0x3c')](function(_0x45a340){_0x104012[_0x54b2('0x5a')]('i.'+_0x45a340);});}else{_0x104012[_0x54b2('0x5a')](_0x54b2('0xa0'),'unreadMessages');_0x104012[_0x54b2('0x5a')](_0x54b2('0xae'),_0x54b2('0xaf'));_0x104012[_0x54b2('0x5a')](_0x54b2('0xb0'),_0x54b2('0xb1'));_0x104012[_0x54b2('0x5a')](_0x54b2('0xb2'),_0x54b2('0xa3'));_0x104012[_0x54b2('0x5a')](_0x54b2('0xb3'));_0x104012[_0x54b2('0x5a')](_0x54b2('0xb4'),'Contact.firstName');_0x104012[_0x54b2('0x5a')](_0x54b2('0xb5'),_0x54b2('0xb6'));_0x104012[_0x54b2('0x5a')]('c.email','Contact.email');_0x104012['field'](_0x54b2('0xb7'),'Contact.phone');_0x104012['field'](_0x54b2('0xb8'),'Contact.mobile');_0x104012[_0x54b2('0x5a')](_0x54b2('0xb9'),_0x54b2('0xba'));_0x104012[_0x54b2('0x5a')](_0x54b2('0xbb'),_0x54b2('0xbc'));_0x104012[_0x54b2('0x5a')](_0x54b2('0xbd'),'Owner.internal');_0x104012[_0x54b2('0x5a')](_0x54b2('0xbe'),'TagIds');}if(_0x5a4272['limit'])_0x104012[_0x54b2('0x2b')](_0x5a4272['limit']);if(_0x5a4272[_0x54b2('0x29')])_0x104012[_0x54b2('0x29')](_0x5a4272['offset']);return db[_0x54b2('0xaa')][_0x54b2('0x4d')](_0x104012[_0x54b2('0xab')](),_0x10a299);})[_0x54b2('0x1a')](function(_0x8c341d){if(_0x8c341d[_0x54b2('0xac')]>0x0)_0x33ff52[_0x54b2('0x57')]('ui.ChatInteractionId\x20IN\x20?',_[_0x54b2('0x49')](_0x8c341d,'id'));return db[_0x54b2('0xaa')]['query'](_0x33ff52[_0x54b2('0xab')](),_0x10a299)[_0x54b2('0x1a')](function(_0x2a6ec2){var _0x2e6c93=_['groupBy'](_0x2a6ec2,_0x54b2('0xbf'));var _0x19225c=[];_0x8c341d[_0x54b2('0x3c')](function(_0xddb944){_0x19225c['push'](updateChatInteraction(_0xddb944,_0x146442,_0x2e6c93));});return BPromise['all'](_0x19225c);});});})['then'](function(_0x414aee){_0x1690bd[_0x54b2('0xc0')]=_0x414aee;return _0x1690bd;})[_0x54b2('0x1a')](respondWithFilteredResult(_0x48e2e1,_0x5a4272))['catch'](handleError(_0x48e2e1,null));};exports[_0x54b2('0xc1')]=function(_0x1cf2fe,_0x217a97){var _0x4cf531={'raw':![],'where':{'id':_0x1cf2fe[_0x54b2('0xc2')]['id']}},_0x2f28d9={};_0x2f28d9[_0x54b2('0x51')]=_[_0x54b2('0x4e')](db[_0x54b2('0xad')][_0x54b2('0x4a')]);_0x2f28d9['query']=_[_0x54b2('0x4e')](_0x1cf2fe['query']);_0x2f28d9[_0x54b2('0x4f')]=_[_0x54b2('0x50')](_0x2f28d9[_0x54b2('0x51')],_0x2f28d9[_0x54b2('0x4d')]);_0x4cf531[_0x54b2('0x53')]=_[_0x54b2('0x50')](_0x2f28d9['model'],qs[_0x54b2('0x52')](_0x1cf2fe[_0x54b2('0x4d')][_0x54b2('0x52')]));_0x4cf531[_0x54b2('0x53')]=_0x4cf531[_0x54b2('0x53')][_0x54b2('0xac')]?_0x4cf531[_0x54b2('0x53')]:_0x2f28d9[_0x54b2('0x51')];if(_0x1cf2fe[_0x54b2('0x4d')][_0x54b2('0xc3')]){_0x4cf531[_0x54b2('0xc4')]=[{'all':!![]}];}_0x4cf531=_['merge']({},_0x4cf531,_0x1cf2fe[_0x54b2('0xc5')]);return db['ChatInteraction']['find'](_0x4cf531)[_0x54b2('0x1a')](handleEntityNotFound(_0x217a97,null))[_0x54b2('0x1a')](respondWithResult(_0x217a97,null))['catch'](handleError(_0x217a97,null));};exports[_0x54b2('0xc6')]=function(_0x8c4dff,_0x43c331){return db[_0x54b2('0xad')]['create'](_0x8c4dff[_0x54b2('0x85')],{})[_0x54b2('0x1a')](respondWithResult(_0x43c331,0xc9))[_0x54b2('0x24')](handleError(_0x43c331,null));};exports[_0x54b2('0x30')]=function(_0x99710c,_0x58b858){if(_0x99710c[_0x54b2('0x85')]['id']){delete _0x99710c[_0x54b2('0x85')]['id'];}return db[_0x54b2('0xad')][_0x54b2('0x72')]({'where':{'id':_0x99710c[_0x54b2('0xc2')]['id']}})[_0x54b2('0x1a')](handleEntityNotFound(_0x58b858,null))['then'](saveUpdates(_0x99710c[_0x54b2('0x85')],null))[_0x54b2('0x1a')](respondWithResult(_0x58b858,null))['catch'](handleError(_0x58b858,null));};exports[_0x54b2('0x31')]=function(_0x318409,_0x489f9f){return db['ChatInteraction'][_0x54b2('0x72')]({'where':{'id':_0x318409[_0x54b2('0xc2')]['id']}})[_0x54b2('0x1a')](handleEntityNotFound(_0x489f9f,null))['then'](removeEntity(_0x489f9f,null))['catch'](handleError(_0x489f9f,null));};exports['describe']=function(_0x2cbf63,_0x3a7ace){return db[_0x54b2('0xad')]['describe']()[_0x54b2('0x1a')](respondWithResult(_0x3a7ace,null))[_0x54b2('0x24')](handleError(_0x3a7ace,null));};exports[_0x54b2('0xc7')]=function(_0x385542,_0x1c7f39){var _0xe6881c=_0x385542[_0x54b2('0xc2')]['id'];var _0x344ef7;var _0x2643aa;var _0x37f6c0;return db[_0x54b2('0xad')][_0x54b2('0xc8')]({'where':{'id':_0xe6881c}})[_0x54b2('0x1a')](function(_0x258bf2){_0x344ef7=_0x258bf2;return db[_0x54b2('0xc9')]['findOne']({'where':{'id':_0x258bf2[_0x54b2('0x89')]},'attributes':['id',_0x54b2('0xca'),_0x54b2('0xcb'),'vidaooTopic',_0x54b2('0xcc'),_0x54b2('0xcd')],'raw':!![]});})[_0x54b2('0x1a')](function(_0x11b8e6){if(_0x11b8e6&&_0x11b8e6[_0x54b2('0xca')]&&_0x11b8e6[_0x54b2('0xcb')]){_0x2643aa=_0x11b8e6;var _0x2d6bef={'interaction':{'id':_0xe6881c},'agent':{'id':_0x385542[_0x54b2('0xa7')]['id'],'name':_0x385542[_0x54b2('0xa7')][_0x54b2('0x33')],'fullname':_0x385542['user']['fullname'],'email':_0x385542[_0x54b2('0xa7')][_0x54b2('0xce')]},'contact':_0x385542['body'][_0x54b2('0x36')],'account':_0x385542['body']['account']};var _0x4b425d={'rejectUnauthorized':![],'method':_0x54b2('0xcf'),'url':_0x54b2('0xd0'),'headers':{'X-APIKEY':_0x11b8e6['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x385542['user'][_0x54b2('0xce')]],'buttons':null,'topic':_0x2643aa['vidaooTopic'],'note':_['isNull'](_0x2643aa[_0x54b2('0xcc')])?null:getMustacheRender(_0x2643aa[_0x54b2('0xcc')],_0x2d6bef),'metadata':null},'redirect':_0x54b2('0xd1'),'json':!![]};try{if(!_[_0x54b2('0xd2')](_0x2643aa[_0x54b2('0xcd')])){var _0x4b44e3=getMustacheRender(_0x2643aa[_0x54b2('0xcd')],_0x2d6bef);var _0x57738b=JSON[_0x54b2('0x8c')](_0x4b44e3);_0x4b425d[_0x54b2('0x85')][_0x54b2('0xd3')]=_0x57738b;}}catch(_0x230ed4){throw new db[(_0x54b2('0x9d'))][(_0x54b2('0xd4'))](_0x54b2('0xd5'));}return rp(_0x4b425d);}else{throw new db['Sequelize'][(_0x54b2('0xd4'))](_0x54b2('0xd6'));}})[_0x54b2('0x1a')](function(_0x4e445d){_0x37f6c0=_0x4e445d;if(_0x37f6c0['id']){var _0x114c17={'body':_0x37f6c0[_0x54b2('0xd7')],'ChatWebsiteId':_0x2643aa['id'],'ChatInteractionId':_0x344ef7['id'],'direction':_0x54b2('0xd8'),'UserId':_0x385542['user']['id']};return db[_0x54b2('0xd9')][_0x54b2('0xc6')](_0x114c17,{});}else{throw new db[(_0x54b2('0x9d'))][(_0x54b2('0xd4'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x54b2('0x1a')](function(){return _0x344ef7[_0x54b2('0xda')]({'vidaooSessionId':_0x37f6c0['id']});})[_0x54b2('0x1a')](respondWithResult(_0x1c7f39,null))[_0x54b2('0x24')](handleError(_0x1c7f39,null));};exports[_0x54b2('0xdb')]=function(_0x378a8d,_0x15aeee){if(_0x378a8d['body']['id']){delete _0x378a8d[_0x54b2('0x85')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x378a8d[_0x54b2('0xc2')]['id']},'include':[{'model':db[_0x54b2('0xdc')],'as':_0x54b2('0x76')}]})[_0x54b2('0x1a')](handleEntityNotFound(_0x15aeee,null))[_0x54b2('0x1a')](saveUpdates(_0x378a8d[_0x54b2('0x85')],null))[_0x54b2('0x1a')](respondWithResult(_0x15aeee,null))[_0x54b2('0x24')](handleError(_0x15aeee,null));};exports['abandon']=function(_0x2d69c5,_0x5eadaa,_0x45de69){if(_0x2d69c5[_0x54b2('0x85')]['id']){delete _0x2d69c5['body']['id'];}return db['ChatInteraction'][_0x54b2('0x72')]({'where':{'id':_0x2d69c5[_0x54b2('0xc2')]['id']}})[_0x54b2('0x1a')](function(_0x55c1ed){if(!_0x55c1ed){logger[_0x54b2('0x20')](_0x54b2('0xdd'),'abandon',0x194,'entity\x20not\x20found');_0x5eadaa[_0x54b2('0x25')](0x194);}else{if(_0x55c1ed[_0x54b2('0x45')]){throw new db['Sequelize']['ValidationError'](_0x54b2('0xde'));}}return _0x55c1ed;})['then'](function(_0x25e5e8){if(_0x25e5e8){return _0x25e5e8['update']({'closed':_0x2d69c5[_0x54b2('0x85')][_0x54b2('0x44')],'disposition':_0x2d69c5[_0x54b2('0x85')][_0x54b2('0x47')]})[_0x54b2('0x1a')](function(_0x26a1e3){return _0x26a1e3;});}})['then'](function(_0x4ab696){return respondWithRpcPromise('AbandonInteraction','abandon',_0x2d69c5['body'],client9004);})[_0x54b2('0x1a')](respondWithResult(_0x5eadaa,null))['catch'](handleError(_0x5eadaa,null));};exports['attachmentUpload']=function(_0x908a3d,_0x2eb25f,_0x5314a0){_0x908a3d[_0x54b2('0x85')]['name']=_0x908a3d['file'][_0x54b2('0xdf')];_0x908a3d[_0x54b2('0x85')][_0x54b2('0xe0')]=_0x908a3d[_0x54b2('0xe1')]['filename'];_0x908a3d['body']['type']=_0x908a3d[_0x54b2('0xe1')][_0x54b2('0xe2')];return db[_0x54b2('0xe3')][_0x54b2('0xc6')](_0x908a3d['body'])[_0x54b2('0x1a')](respondWithResult(_0x2eb25f,0xc9))['catch'](handleError(_0x2eb25f,null));};exports[_0x54b2('0xe4')]=function(_0x5b7eb4,_0x5569c0,_0x8cbaed){return db[_0x54b2('0xad')][_0x54b2('0xc8')]({'where':{'id':_0x5b7eb4[_0x54b2('0xc2')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5569c0,null))[_0x54b2('0x1a')](function(_0x1dc7f7){if(_0x1dc7f7){if(_0x1dc7f7[_0x54b2('0x44')]){return _0x5569c0[_0x54b2('0x26')](0x193)[_0x54b2('0x28')]({'status':0x193,'message':_0x54b2('0xe5')});}return db[_0x54b2('0xe3')][_0x54b2('0xc8')]({'where':{'id':_0x5b7eb4['query'][_0x54b2('0xe6')]},'raw':!![]})[_0x54b2('0x1a')](handleEntityNotFound(_0x5569c0,null));}})[_0x54b2('0x1a')](function(_0x1db8a5){if(_0x1db8a5){var _0x2e050a=_0x1db8a5[_0x54b2('0xe7')]!==null;var _0x1d8607=path['join'](config[_0x54b2('0xe8')],_0x54b2('0xe9'));if(_0x2e050a){_0x1d8607=path[_0x54b2('0xea')](_0x1d8607,_0x54b2('0xeb'));}var _0x11b74a=path['join'](_0x1d8607,_0x1db8a5[_0x54b2('0xe0')]);return _0x5569c0[_0x54b2('0xec')](_0x11b74a);}})[_0x54b2('0x24')](handleError(_0x5569c0,null));};exports[_0x54b2('0xed')]=function(_0x4fe3dc,_0x561dc3){var _0x28d7cb=null;var _0x5043c8=null;var _0x4ba34f=null;var _0x2d58cc=null;if(_0x4fe3dc[_0x54b2('0x85')]['id']){delete _0x4fe3dc['body']['id'];}if(_0x4fe3dc['body'][_0x54b2('0xee')]){_0x2d58cc=path[_0x54b2('0xea')](config['root'],_0x54b2('0xef'),util[_0x54b2('0xf0')](_0x54b2('0xf1'),Date[_0x54b2('0xf2')]()));_0x4fe3dc[_0x54b2('0x85')][_0x54b2('0xf3')]=_0x2d58cc;}return db['ChatInteraction'][_0x54b2('0x72')]({'where':{'id':_0x4fe3dc['params']['id']},'include':[{'model':db[_0x54b2('0xd9')],'as':_0x54b2('0xf4'),'include':[{'model':db[_0x54b2('0x83')],'as':'User'}]}]})[_0x54b2('0x1a')](handleEntityNotFound(_0x561dc3,null))[_0x54b2('0x1a')](saveUpdates(_0x4fe3dc[_0x54b2('0x85')],null))[_0x54b2('0x1a')](function(_0x233105){if(_0x233105){_0x28d7cb=_0x233105;return db[_0x54b2('0xc9')][_0x54b2('0x72')]({'where':{'id':_0x28d7cb[_0x54b2('0x89')]}});}})[_0x54b2('0x1a')](function(_0x159556){if(_0x159556){_0x4ba34f=_0x159556;return db[_0x54b2('0xdc')][_0x54b2('0x72')]({'where':{'id':_0x28d7cb[_0x54b2('0x7c')]}});}})[_0x54b2('0x1a')](function(_0x39014a){if(_0x39014a){_0x5043c8=_0x39014a;if(_0x2d58cc){var _0x2c2bfb=null;for(var _0x33ac86=0x1;_0x33ac86<_0x28d7cb[_0x54b2('0xf4')][_0x54b2('0xac')];++_0x33ac86){_0x2c2bfb=_0x28d7cb[_0x54b2('0xf4')][_0x33ac86];var _0x33c5d8=_0x2c2bfb[_0x54b2('0x45')]?util['format'](_0x54b2('0xf5'),_0x4ba34f[_0x54b2('0xf6')],_0x2c2bfb[_0x54b2('0x45')]):_0x54b2('0xf7');var _0x43164a=_0x4fe3dc[_0x54b2('0x85')]['customer']||util[_0x54b2('0xf0')](_0x54b2('0xf5'),_0x54b2('0xf8'),_0x2c2bfb[_0x54b2('0x7c')]);switch(_0x4ba34f[_0x54b2('0xf9')]){case _0x54b2('0xfa'):_0x33c5d8=_0x2c2bfb[_0x54b2('0x45')]?util[_0x54b2('0xf0')](_0x54b2('0xf5'),_0x4ba34f[_0x54b2('0xf6')],_0x2c2bfb[_0x54b2('0x45')]):_0x54b2('0xf7');break;case _0x54b2('0xfb'):_0x33c5d8=_0x2c2bfb[_0x54b2('0x45')]?_0x2c2bfb['User'][_0x54b2('0xfc')]||_0x2c2bfb[_0x54b2('0x83')]['fullname']:_0x54b2('0xf7');break;case'agent_fullname':_0x33c5d8=_0x2c2bfb[_0x54b2('0x45')]?_0x2c2bfb['User'][_0x54b2('0x39')]:'System';break;default:_0x33c5d8=_0x2c2bfb[_0x54b2('0x45')]?util[_0x54b2('0xf0')](_0x54b2('0xf5'),_0x4ba34f['agentAlias'],_0x2c2bfb[_0x54b2('0x45')]):_0x54b2('0xf7');}var _0x10202c=util['format'](_0x54b2('0xfd'),moment(_0x2c2bfb[_0x54b2('0x8b')])[_0x54b2('0xf0')](_0x54b2('0xfe')),_0x2c2bfb['direction']==='in'?_0x43164a:_0x33c5d8,_0x2c2bfb[_0x54b2('0x85')]);if(!_0x2c2bfb[_0x54b2('0xff')]){fs['appendFileSync'](_0x2d58cc,_0x10202c);}}return db['MailAccount'][_0x54b2('0xc8')]({'where':{'service':!![]},'include':[{'model':db[_0x54b2('0x100')],'as':'Smtp','raw':!![]}]});}}})[_0x54b2('0x1a')](function(_0x1abc6c){if(_0x1abc6c&&_0x1abc6c[_0x54b2('0x101')]&&_0x4fe3dc['body']){var _0x2eebb6={'tls':{'rejectUnauthorized':![]}};if(_0x1abc6c[_0x54b2('0x101')]['service']){_0x2eebb6[_0x54b2('0x102')]=_0x1abc6c['Smtp'][_0x54b2('0x102')];}else{_0x2eebb6[_0x54b2('0x103')]=_0x1abc6c[_0x54b2('0x101')][_0x54b2('0x103')];_0x2eebb6[_0x54b2('0x104')]=_0x1abc6c[_0x54b2('0x101')][_0x54b2('0x104')];_0x2eebb6[_0x54b2('0x105')]=_0x1abc6c['Smtp'][_0x54b2('0x105')];}if(_0x1abc6c[_0x54b2('0x101')]['authentication']){_0x2eebb6['auth']={'user':_0x1abc6c['Smtp'][_0x54b2('0xa7')],'pass':_0x1abc6c[_0x54b2('0x101')][_0x54b2('0x106')]};}return respondWithRpcPromise('SendMail',_0x54b2('0x107'),{'account':_0x2eebb6,'message':{'from':util['format'](_0x54b2('0x108'),_0x1abc6c[_0x54b2('0x33')],_0x1abc6c['email']||_0x1abc6c[_0x54b2('0x101')][_0x54b2('0xa7')]),'to':_0x4fe3dc[_0x54b2('0x85')][_0x54b2('0xee')],'subject':_0x54b2('0x109'),'text':util[_0x54b2('0xf0')](_0x54b2('0x10a'),_0x4fe3dc[_0x54b2('0x85')]['mailTranscript']),'attachments':[{'path':_0x2d58cc}]}})[_0x54b2('0x1a')](function(){return _0x28d7cb;})['catch'](function(_0xc9b11e){console[_0x54b2('0x20')](_0xc9b11e);});}else{return _0x28d7cb;}})[_0x54b2('0x1a')](respondWithStatusCode(_0x561dc3,0xc8))[_0x54b2('0x24')](handleError(_0x561dc3,null));};exports[_0x54b2('0x10b')]=function(_0x4fc4fb,_0x2bd374,_0xd9158e){return db['ChatMessage'][_0x54b2('0x72')]({'where':{'id':_0x4fc4fb[_0x54b2('0xc2')]['id']}})[_0x54b2('0x1a')](handleEntityNotFound(_0x2bd374,null))[_0x54b2('0x1a')](function(_0x2acb11){if(_0x2acb11){return _0x2acb11[_0x54b2('0x10b')](_0x4fc4fb[_0x54b2('0x85')][_0x54b2('0x10c')],_[_0x54b2('0x10d')](_0x4fc4fb[_0x54b2('0x85')],[_0x54b2('0x10c'),'id'])||{});}})[_0x54b2('0x1a')](respondWithResult(_0x2bd374,null))['catch'](handleError(_0x2bd374,null));};exports[_0x54b2('0x10e')]=function(_0x118171,_0x44aebf,_0x416082){var _0x82d507={'raw':![],'where':{}};var _0x19be80={};var _0x36a53a={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x54b2('0xc8')]({'where':{'id':_0x118171[_0x54b2('0xc2')]['id']}})['then'](handleEntityNotFound(_0x44aebf,null))[_0x54b2('0x1a')](function(_0xa85ff0){if(_0xa85ff0){_0x19be80[_0x54b2('0x51')]=_[_0x54b2('0x4e')](db['ChatMessage'][_0x54b2('0x4a')]);_0x19be80[_0x54b2('0x4d')]=_[_0x54b2('0x4e')](_0x118171[_0x54b2('0x4d')]);_0x19be80[_0x54b2('0x4f')]=_['intersection'](_0x19be80[_0x54b2('0x51')],_0x19be80[_0x54b2('0x4d')]);_0x82d507['attributes']=_[_0x54b2('0x50')](_0x19be80[_0x54b2('0x51')],qs[_0x54b2('0x52')](_0x118171['query'][_0x54b2('0x52')]));_0x82d507[_0x54b2('0x53')]=_0x82d507[_0x54b2('0x53')][_0x54b2('0xac')]?_0x82d507[_0x54b2('0x53')]:_0x19be80[_0x54b2('0x51')];if(!_0x118171['query'][_0x54b2('0x54')](_0x54b2('0x55'))){_0x82d507[_0x54b2('0x2b')]=qs['limit'](_0x118171['query'][_0x54b2('0x2b')]);_0x82d507[_0x54b2('0x29')]=qs[_0x54b2('0x29')](_0x118171['query'][_0x54b2('0x29')]);}_0x82d507[_0x54b2('0xa2')]=qs[_0x54b2('0x56')](_0x118171[_0x54b2('0x4d')][_0x54b2('0x56')]);_0x82d507['where']=qs[_0x54b2('0x4f')](_[_0x54b2('0x58')](_0x118171[_0x54b2('0x4d')],_0x19be80[_0x54b2('0x4f')]));_0x82d507[_0x54b2('0x57')][_0x54b2('0xbf')]=_0xa85ff0['id'];if(_0x118171[_0x54b2('0x4d')][_0x54b2('0x94')]){_0x82d507[_0x54b2('0x57')]=_[_0x54b2('0x35')](_0x82d507[_0x54b2('0x57')],{'$or':_[_0x54b2('0x49')](_0x82d507['attributes'],function(_0x2b773c){var _0x19cae0={};_0x19cae0[_0x2b773c]={'$like':'%'+_0x118171['query'][_0x54b2('0x94')]+'%'};return _0x19cae0;})});}if(_0x118171['query'][_0x54b2('0x10f')]){var _0x5a0011=_0x118171[_0x54b2('0x4d')][_0x54b2('0x10f')][_0x54b2('0x3b')](',');var _0x58bf6b={};_0x58bf6b[_0x5a0011[0x0]]={'$gte':moment(_0x5a0011[0x1])[_0x54b2('0xf0')](_0x54b2('0x110'))};_0x82d507[_0x54b2('0x57')]=_[_0x54b2('0x35')](_0x82d507[_0x54b2('0x57')],_0x58bf6b);}_0x82d507=_[_0x54b2('0x35')]({},_0x82d507,_0x118171[_0x54b2('0xc5')]);return db[_0x54b2('0xd9')][_0x54b2('0x2c')]({'where':_0x82d507[_0x54b2('0x57')]})[_0x54b2('0x1a')](function(_0x5d61b2){_0x36a53a[_0x54b2('0x2c')]=_0x5d61b2;if(_0x118171['query'][_0x54b2('0xc3')]){_0x82d507['include']=[{'all':!![]}];}return db[_0x54b2('0xd9')][_0x54b2('0x111')](_0x82d507);})[_0x54b2('0x1a')](function(_0x33c696){_0x36a53a[_0x54b2('0xc0')]=_0x33c696;return _0x36a53a;});}})[_0x54b2('0x1a')](respondWithFilteredResult(_0x44aebf,_0x82d507))[_0x54b2('0x24')](handleError(_0x44aebf,null));};exports[_0x54b2('0x112')]=function(_0x53798e,_0x518be9,_0x252b05){var _0x8dff52={'where':{}},_0x2f4aef={},_0x2be273={'count':0x0,'rows':[]};return db[_0x54b2('0xad')]['findOne']({'where':{'id':_0x53798e[_0x54b2('0xc2')]['id']}})[_0x54b2('0x1a')](handleEntityNotFound(_0x518be9,null))[_0x54b2('0x1a')](function(_0x3cd17d){if(_0x3cd17d){_0x2f4aef[_0x54b2('0x51')]=_[_0x54b2('0x4e')](db[_0x54b2('0xd9')][_0x54b2('0x4a')]);_0x2f4aef[_0x54b2('0x4d')]=_[_0x54b2('0x4e')](_0x53798e[_0x54b2('0x4d')]);_0x2f4aef[_0x54b2('0x4f')]=_[_0x54b2('0x50')](_0x2f4aef[_0x54b2('0x51')],_0x2f4aef[_0x54b2('0x4d')]);_0x8dff52[_0x54b2('0x53')]=_[_0x54b2('0x50')](_0x2f4aef[_0x54b2('0x51')],qs[_0x54b2('0x52')](_0x53798e[_0x54b2('0x4d')][_0x54b2('0x52')]));_0x8dff52[_0x54b2('0x53')]=_0x8dff52[_0x54b2('0x53')]['length']?_0x8dff52[_0x54b2('0x53')]:_0x2f4aef[_0x54b2('0x51')];if(!_0x53798e['query']['hasOwnProperty'](_0x54b2('0x55'))){_0x8dff52[_0x54b2('0x2b')]=qs['limit'](_0x53798e[_0x54b2('0x4d')]['limit']);_0x8dff52[_0x54b2('0x29')]=qs[_0x54b2('0x29')](_0x53798e[_0x54b2('0x4d')]['offset']);}_0x8dff52[_0x54b2('0xa2')]=qs[_0x54b2('0x56')](_0x53798e['query'][_0x54b2('0x56')]);_0x8dff52[_0x54b2('0x57')]=qs[_0x54b2('0x4f')](_[_0x54b2('0x58')](_0x53798e['query'],_0x2f4aef[_0x54b2('0x4f')]));_0x8dff52['where'][_0x54b2('0xbf')]=_0x3cd17d['id'];if(_0x53798e[_0x54b2('0x4d')]['filter']){_0x8dff52[_0x54b2('0x57')]=_[_0x54b2('0x35')](_0x8dff52[_0x54b2('0x57')],{'$or':_[_0x54b2('0x49')](_0x8dff52[_0x54b2('0x53')],function(_0x38ef02){var _0x336d1e={};_0x336d1e[_0x38ef02]={'$like':'%'+_0x53798e[_0x54b2('0x4d')][_0x54b2('0x94')]+'%'};return _0x336d1e;})});}_0x8dff52[_0x54b2('0x57')][_0x54b2('0xff')]=![];if(_0x53798e[_0x54b2('0x4d')]['id']){_0x8dff52[_0x54b2('0x57')]['id']={'$gt':_0x53798e['query']['id']};}_0x8dff52=_[_0x54b2('0x35')]({},_0x8dff52,_0x53798e[_0x54b2('0xc5')]);return db[_0x54b2('0xd9')]['count']({'where':_0x8dff52[_0x54b2('0x57')]})[_0x54b2('0x1a')](function(_0x3fad3c){_0x2be273[_0x54b2('0x2c')]=_0x3fad3c;_0x8dff52[_0x54b2('0xc4')]=[];if(_0x53798e[_0x54b2('0x4d')]['includeAgent']){_0x8dff52[_0x54b2('0xc4')]['push']({'model':db[_0x54b2('0x83')],'as':_0x54b2('0x83'),'attributes':['id',_0x54b2('0x39'),_0x54b2('0xfc')]});}if(_0x53798e['query'][_0x54b2('0xc3')]){_0x8dff52[_0x54b2('0xc4')]=[{'all':!![]}];}return db[_0x54b2('0xd9')][_0x54b2('0x111')](_0x8dff52);})[_0x54b2('0x1a')](function(_0x46b7e1){_0x2be273['rows']=_0x46b7e1;return _0x2be273;});}})[_0x54b2('0x1a')](respondWithFilteredResult(_0x518be9,_0x8dff52))[_0x54b2('0x24')](handleError(_0x518be9,null));};exports[_0x54b2('0x113')]=function(_0x364735,_0x2767ee,_0x3e1637){return db['ChatInteraction'][_0x54b2('0x72')]({'where':{'id':_0x364735[_0x54b2('0xc2')]['id']}})[_0x54b2('0x1a')](handleEntityNotFound(_0x2767ee,null))['then'](function(_0x33e1a6){if(_0x33e1a6){return _0x33e1a6['setTags'](_0x364735[_0x54b2('0x85')][_0x54b2('0x10c')],_[_0x54b2('0x10d')](_0x364735[_0x54b2('0x85')],[_0x54b2('0x10c'),'id'])||{})[_0x54b2('0x114')](function(){return db[_0x54b2('0x80')][_0x54b2('0x111')]({'attributes':['id',_0x54b2('0x33'),'color'],'where':{'id':_0x364735[_0x54b2('0x85')][_0x54b2('0x10c')]}});})[_0x54b2('0x1a')](function(_0x9ac35d){socket[_0x54b2('0x115')](_0x54b2('0x116'),{'id':Number(_0x364735[_0x54b2('0xc2')]['id']),'tags':_0x9ac35d||[]});return{'id':Number(_0x364735[_0x54b2('0xc2')]['id']),'tags':_0x9ac35d||[]};});}})['then'](respondWithResult(_0x2767ee,null))[_0x54b2('0x24')](handleError(_0x2767ee,null));};exports[_0x54b2('0x117')]=function(_0x4be56f,_0x4ddfa4,_0x151c9e){return db[_0x54b2('0xad')][_0x54b2('0x72')]({'where':{'id':_0x4be56f['params']['id']}})[_0x54b2('0x1a')](handleEntityNotFound(_0x4ddfa4,null))[_0x54b2('0x1a')](function(_0x5ccac7){if(_0x5ccac7){return _0x5ccac7['removeTags'](_0x4be56f[_0x54b2('0x4d')][_0x54b2('0x10c')]);}})[_0x54b2('0x1a')](respondWithStatusCode(_0x4ddfa4,null))[_0x54b2('0x24')](handleError(_0x4ddfa4,null));};exports[_0x54b2('0xec')]=function(_0x2d64a2,_0x3d2026){var _0x294fea=moment()['unix']()['toString']();var _0x1b1c73=path[_0x54b2('0xea')](config[_0x54b2('0xe8')],_0x54b2('0x118'),_0x54b2('0x119'),_0x54b2('0x11a'));var _0x40f727=path[_0x54b2('0xea')](config['root'],_0x54b2('0x118'),_0x54b2('0x119'),_0x54b2('0x11b'));var _0x2f4143=path[_0x54b2('0xea')](_0x1b1c73,_0x294fea);var _0x3ef7ac=util[_0x54b2('0xf0')](_0x54b2('0x11c'),_0x2d64a2[_0x54b2('0xc2')]['id'],_0x294fea);var _0x5d224e=path['join'](_0x1b1c73,_0x3ef7ac);var _0x5d7484=[];_0x5d7484[_0x54b2('0x3e')]({'model':db[_0x54b2('0x83')],'as':_0x54b2('0x83'),'attributes':['id',_0x54b2('0x39')],'raw':!![]});_0x5d7484['push']({'model':db[_0x54b2('0xdc')],'as':_0x54b2('0x76'),'attributes':['id',_0x54b2('0x11d'),'lastName'],'raw':!![]});if(_0x2d64a2[_0x54b2('0x4d')][_0x54b2('0x11b')]){_0x5d7484['push']({'model':db[_0x54b2('0xe3')],'as':_0x54b2('0xe3'),'raw':!![]});}var _0x5e123a=[{'model':db[_0x54b2('0xd9')],'as':'Messages','attributes':['id',_0x54b2('0x85'),_0x54b2('0x8b'),_0x54b2('0x11e'),_0x54b2('0xff'),_0x54b2('0x90')],'include':_0x5d7484}];_0x5e123a[_0x54b2('0x3e')]({'model':db[_0x54b2('0xc9')],'as':_0x54b2('0x11f'),'attributes':['id','name']});_0x5e123a[_0x54b2('0x3e')]({'model':db[_0x54b2('0x83')],'as':_0x54b2('0x120'),'attributes':['id',_0x54b2('0x39')]});return db['ChatInteraction'][_0x54b2('0x72')]({'where':{'id':_0x2d64a2[_0x54b2('0xc2')]['id']},'include':_0x5e123a})[_0x54b2('0x1a')](handleEntityNotFound(_0x3d2026,null))[_0x54b2('0x1a')](function(_0x579076){if(_0x579076){var _0x21dfca=_0x579076[_0x54b2('0x121')]({'plain':!![]});fs[_0x54b2('0x122')](_0x2f4143);var _0x20a034={'channel':_0x54b2('0x123'),'account':_0x21dfca[_0x54b2('0x11f')][_0x54b2('0x33')],'agent':_0x21dfca[_0x54b2('0x120')]?_0x21dfca[_0x54b2('0x120')]['fullname']:_0x54b2('0x124'),'createdAt':moment(_0x21dfca[_0x54b2('0x8b')])[_0x54b2('0xf0')](_0x54b2('0x110'))[_0x54b2('0xab')](),'closedAt':_0x21dfca[_0x54b2('0x44')]?moment(_0x21dfca['closedAt'])[_0x54b2('0xf0')](_0x54b2('0x110'))[_0x54b2('0xab')]():'','disposition':_0x21dfca['disposition'],'chatInfo':{'browser':_0x21dfca['browserName'],'os':_0x21dfca['osName'],'referer':_0x21dfca['referer'],'customerIp':_0x21dfca['customerIp'],'customerPort':_0x21dfca[_0x54b2('0x125')]?_0x21dfca[_0x54b2('0x125')]:'N.A.'},'messages':_(_0x21dfca['Messages'])['tail']()['filter']({'secret':![]})[_0x54b2('0x49')](function(_0x1b6a84){if(_0x1b6a84[_0x54b2('0xe3')]){var _0x290b6c=path[_0x54b2('0xea')](_0x40f727,_0x1b6a84[_0x54b2('0xe3')][_0x54b2('0xe0')]);if(fs[_0x54b2('0x126')](_0x290b6c)){fs[_0x54b2('0x127')](_0x290b6c)[_0x54b2('0x128')](fs[_0x54b2('0x129')](path[_0x54b2('0xea')](_0x2f4143,_0x1b6a84[_0x54b2('0xe3')][_0x54b2('0xe0')])));}}return{'date':moment(_0x1b6a84[_0x54b2('0x8b')])[_0x54b2('0xf0')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x1b6a84[_0x54b2('0x11e')]===_0x54b2('0xd8')?_0x1b6a84[_0x54b2('0x83')]?_0x1b6a84[_0x54b2('0x83')][_0x54b2('0x39')]:'System':_0x1b6a84[_0x54b2('0x76')][_0x54b2('0x11d')]+(_0x1b6a84[_0x54b2('0x76')]['lastName']?'\x20'+_0x1b6a84['Contact']['lastName']:''),'body':_0x1b6a84[_0x54b2('0xe3')]?_0x1b6a84[_0x54b2('0xe3')][_0x54b2('0xe0')]:_0x1b6a84[_0x54b2('0x85')],'direction':_0x1b6a84[_0x54b2('0x11e')]==='out'?'A':'C','secret':_0x1b6a84[_0x54b2('0xff')],'read':_0x1b6a84[_0x54b2('0x90')],'attachment':_0x1b6a84[_0x54b2('0xe3')]};})[_0x54b2('0x7a')]()};return ejs[_0x54b2('0x12a')](path[_0x54b2('0xea')](config['root'],_0x54b2('0x118'),_0x54b2('0x12b'),_0x54b2('0x12c')),{'interaction':_0x20a034})[_0x54b2('0x1a')](function(_0x3f0d50){var _0x25550d=path['join'](_0x2f4143,'transcript-'+_0x21dfca['id']+'-'+_0x294fea+'.pdf');var _0x382be0={'path':_0x25550d,'channel':_0x54b2('0x123'),'interactionId':_0x21dfca['id']};return pdf[_0x54b2('0x12d')](_0x3f0d50,_0x382be0);})[_0x54b2('0x1a')](function(){return new BPromise(function(_0x1aa9ad,_0x46ecf6){zipdir(_0x2f4143,{'saveTo':_0x5d224e},function(_0x3cd196,_0x5c8f0b){if(_0x3cd196)return _0x46ecf6(_0x3cd196);return _0x1aa9ad(_0x5c8f0b);});})[_0x54b2('0x1a')](function(){return new BPromise(function(_0x537339,_0x94bd71){rimraf(_0x2f4143,function(_0x50e2d7){if(_0x50e2d7)_0x94bd71(_0x50e2d7);return _0x537339();});});})[_0x54b2('0x1a')](function(){return _0x3d2026[_0x54b2('0xec')](_0x5d224e,_0x3ef7ac,function(_0x1520fc){if(_0x1520fc){console[_0x54b2('0x12e')](_0x54b2('0x12f'),_0x1520fc);}else{fs[_0x54b2('0x130')](_0x5d224e);}});});});}else{return _0x3d2026['sendStatus'](0xc8);}})['catch'](handleError(_0x3d2026,null));}; \ No newline at end of file +var _0x24c6=['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','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','start','body','compact','isEmpty','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','user','toString','sequelize','ChatInteraction','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Owner.fullname','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','rows','show','includeAll','include','options','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','attachmentUpload','file','originalname','mimetype','attachmentDownload','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','agent_fullname','fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','hasOwnProperty','ChatInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','setTags','omit','spread','emit','chatInteractionTags:save','removeTags','download','unix','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','direction','read','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','basename','existsSync','pipe','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','send','render','merge','contact','agent','interaction','account','map','TagIds','Tags','split','forEach','push','waiting','answered','unmanaged','abandoned','total','closed','UserId','talking','disposition','index','rawAttributes','fieldName','type','key','name','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','users','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring'];(function(_0x43017b,_0x33c9b1){var _0x66fb3d=function(_0x5d232e){while(--_0x5d232e){_0x43017b['push'](_0x43017b['shift']());}};_0x66fb3d(++_0x33c9b1);}(_0x24c6,0xc0));var _0x624c=function(_0x22499e,_0x88757a){_0x22499e=_0x22499e-0x0;var _0x2c25c4=_0x24c6[_0x22499e];return _0x2c25c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x624c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x624c('0x1'));var rp=require(_0x624c('0x2'));var moment=require('moment');var BPromise=require(_0x624c('0x3'));var Mustache=require(_0x624c('0x4'));var util=require('util');var path=require(_0x624c('0x5'));var sox=require(_0x624c('0x6'));var csv=require(_0x624c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x624c('0x8'));var _=require('lodash');var squel=require(_0x624c('0x9'));var crypto=require(_0x624c('0xa'));var jsforce=require(_0x624c('0xb'));var deskjs=require(_0x624c('0xc'));var toCsv=require(_0x624c('0x7'));var querystring=require('querystring');var Papa=require(_0x624c('0xd'));var Redis=require(_0x624c('0xe'));var authService=require(_0x624c('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x624c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x624c('0x11'));var utils=require(_0x624c('0x12'));var config=require(_0x624c('0x13'));var licenseUtil=require(_0x624c('0x14'));var db=require('../../mysqldb')['db'];config[_0x624c('0x15')]=_[_0x624c('0x16')](config[_0x624c('0x15')],{'host':_0x624c('0x17'),'port':0x18eb});var socket=require(_0x624c('0x18'))(new Redis(config[_0x624c('0x15')]));require(_0x624c('0x19'))[_0x624c('0x1a')](socket);var jayson=require(_0x624c('0x1b'));var client=jayson[_0x624c('0x1c')][_0x624c('0x1d')]({'port':0x232b});var client9004=jayson[_0x624c('0x1c')][_0x624c('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x3637e8,_0x336920,_0x4a5015,_0x4f3ed1){return new BPromise(function(_0x17f7e3,_0x4ec0b0){var _0x30fbf9=_0x4f3ed1||client;return _0x30fbf9[_0x624c('0x1e')](_0x3637e8,_0x4a5015)[_0x624c('0x1f')](function(_0x352e8d){logger[_0x624c('0x20')](_0x624c('0x21'),_0x336920,_0x624c('0x22'));logger[_0x624c('0x23')](_0x624c('0x24'),_0x336920,'request\x20sent',JSON['stringify'](_0x352e8d));if(_0x352e8d[_0x624c('0x25')]){if(_0x352e8d[_0x624c('0x25')][_0x624c('0x26')]===0x1f4){logger[_0x624c('0x25')](_0x624c('0x21'),_0x336920,_0x352e8d[_0x624c('0x25')]['message']);return _0x4ec0b0(_0x352e8d[_0x624c('0x25')][_0x624c('0x27')]);}logger[_0x624c('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x336920,_0x352e8d['error']['message']);return _0x17f7e3(_0x352e8d['error'][_0x624c('0x27')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x336920,_0x624c('0x22'));_0x17f7e3(_0x352e8d['result'][_0x624c('0x27')]);}})[_0x624c('0x28')](function(_0x3978a3){logger[_0x624c('0x25')](_0x624c('0x21'),_0x336920,_0x3978a3);_0x4ec0b0(_0x3978a3);});});}function respondWithStatusCode(_0x168c25,_0x1ae9cd){_0x1ae9cd=_0x1ae9cd||0xcc;return function(_0x29c91d){if(_0x29c91d){return _0x168c25[_0x624c('0x29')](_0x1ae9cd);}return _0x168c25['status'](_0x1ae9cd)[_0x624c('0x2a')]();};}function respondWithResult(_0x465a51,_0x7d8d93){_0x7d8d93=_0x7d8d93||0xc8;return function(_0x3282af){if(_0x3282af){return _0x465a51[_0x624c('0x2b')](_0x7d8d93)[_0x624c('0x2c')](_0x3282af);}};}function respondWithFilteredResult(_0x32a354,_0x4d1546){return function(_0x1232a0){if(_0x1232a0){var _0x4462ed=typeof _0x4d1546[_0x624c('0x2d')]===_0x624c('0x2e')&&typeof _0x4d1546[_0x624c('0x2f')]===_0x624c('0x2e');var _0x54e2b9=_0x1232a0[_0x624c('0x30')];var _0x208236=_0x4462ed?0x0:_0x4d1546['offset'];var _0x1bee93=_0x4462ed?_0x1232a0[_0x624c('0x30')]:_0x4d1546[_0x624c('0x2d')]+_0x4d1546[_0x624c('0x2f')];var _0x3113aa;if(_0x1bee93>=_0x54e2b9){_0x1bee93=_0x54e2b9;_0x3113aa=0xc8;}else{_0x3113aa=0xce;}_0x32a354[_0x624c('0x2b')](_0x3113aa);return _0x32a354[_0x624c('0x31')](_0x624c('0x32'),_0x208236+'-'+_0x1bee93+'/'+_0x54e2b9)[_0x624c('0x2c')](_0x1232a0);}return null;};}function patchUpdates(_0x1bc601){return function(_0x1a9f69){try{jsonpatch[_0x624c('0x33')](_0x1a9f69,_0x1bc601,!![]);}catch(_0x1e05be){return BPromise[_0x624c('0x34')](_0x1e05be);}return _0x1a9f69['save']();};}function saveUpdates(_0x4145d9,_0x428008){return function(_0x48855c){if(_0x48855c){return _0x48855c[_0x624c('0x35')](_0x4145d9)['then'](function(_0x143793){return _0x143793;});}return null;};}function removeEntity(_0xf92dd5,_0x2753b3){return function(_0x378ce7){if(_0x378ce7){return _0x378ce7[_0x624c('0x36')]()[_0x624c('0x1f')](function(){_0xf92dd5[_0x624c('0x2b')](0xcc)[_0x624c('0x2a')]();});}};}function handleEntityNotFound(_0x58e308,_0x291973){return function(_0x18b771){if(!_0x18b771){_0x58e308[_0x624c('0x29')](0x194);}return _0x18b771;};}function handleError(_0x3ffa98,_0x4e4445){_0x4e4445=_0x4e4445||0x1f4;return function(_0x24c241){logger[_0x624c('0x25')](_0x24c241[_0x624c('0x37')]);if(_0x24c241['name']){delete _0x24c241['name'];}_0x3ffa98['status'](_0x4e4445)[_0x624c('0x38')](_0x24c241);};}function getMustacheRender(_0x26d546,_0x540fb2){return Mustache[_0x624c('0x39')](_0x26d546,_[_0x624c('0x3a')](_0x540fb2['body'],{'contact':_0x540fb2[_0x624c('0x3b')],'message':_0x540fb2[_0x624c('0x27')],'agent':_0x540fb2[_0x624c('0x3c')],'interaction':_0x540fb2[_0x624c('0x3d')],'account':_0x540fb2[_0x624c('0x3e')]}))||'';}function getInteractionUsers(_0x3de920,_0x517d24){return new BPromise(function(_0x39cab9,_0x25ebb0){try{if(_0x517d24[_0x3de920['id']]){_0x3de920['Users']=_[_0x624c('0x3f')](_0x517d24[_0x3de920['id']],function(_0x1d6a7e){return{'id':_0x1d6a7e['id'],'fullname':_0x1d6a7e['fullname']};});}}catch(_0x1c1f85){_0x25ebb0(_0x1c1f85);}_0x39cab9(_0x3de920);});}function getInteractionTags(_0x3d75e9,_0x41a3ca){return new BPromise(function(_0x3f3119,_0x23c451){try{if(_0x3d75e9[_0x624c('0x40')]){_0x3d75e9[_0x624c('0x41')]=[];_0x3d75e9[_0x624c('0x40')][_0x624c('0x42')](',')[_0x624c('0x43')](function(_0x3b63fa){_0x3d75e9[_0x624c('0x41')][_0x624c('0x44')](_0x41a3ca[_0x3b63fa]);});}delete _0x3d75e9['TagIds'];}catch(_0x570d18){_0x23c451(_0x570d18);}_0x3f3119(_0x3d75e9);});}function updateChatInteraction(_0x28c2e2,_0x579d62,_0x2b2250){return new BPromise(function(_0x5d5e2d,_0x24c99d){return getInteractionUsers(_0x28c2e2,_0x2b2250)[_0x624c('0x1f')](function(_0x5541aa){return getInteractionTags(_0x5541aa,_0x579d62);})[_0x624c('0x1f')](function(_0x1d9cb8){return getStateInteraction(_0x1d9cb8);})['then'](function(_0x46dfde){_0x5d5e2d(_0x46dfde);})[_0x624c('0x28')](function(_0x2f6209){_0x24c99d(_0x2f6209);});});}function getStateInteraction(_0x94cabc){return new BPromise(function(_0xbe7e67){_0x94cabc[_0x624c('0x45')]=0x0;_0x94cabc['talking']=0x0;_0x94cabc[_0x624c('0x46')]=0x0;_0x94cabc[_0x624c('0x47')]=0x0;_0x94cabc[_0x624c('0x48')]=0x0;_0x94cabc[_0x624c('0x49')]=0x0;if(!_0x94cabc[_0x624c('0x4a')]&&!_0x94cabc[_0x624c('0x4b')]){_0x94cabc['waiting']+=0x1;}if(!_0x94cabc[_0x624c('0x4a')]&&_0x94cabc[_0x624c('0x4b')]){_0x94cabc[_0x624c('0x4c')]+=0x1;if(_0x94cabc['waiting']){_0x94cabc['waiting']-=0x1;}}if(_0x94cabc['closed']&&_0x94cabc[_0x624c('0x4d')]===_0x624c('0x48')){_0x94cabc['abandoned']+=0x1;if(_0x94cabc[_0x624c('0x45')]){_0x94cabc[_0x624c('0x45')]-=0x1;}}else if(_0x94cabc[_0x624c('0x4a')]&&!_0x94cabc[_0x624c('0x4b')]&&_0x94cabc[_0x624c('0x4d')]){_0x94cabc[_0x624c('0x47')]+=0x1;if(_0x94cabc[_0x624c('0x45')]){_0x94cabc[_0x624c('0x45')]-=0x1;}}else if(_0x94cabc[_0x624c('0x4a')]&&_0x94cabc['UserId']){_0x94cabc['answered']+=0x1;if(_0x94cabc[_0x624c('0x4c')]){_0x94cabc[_0x624c('0x4c')]-=0x1;}}_0x94cabc[_0x624c('0x49')]+=0x1;_0xbe7e67(_0x94cabc);});}exports[_0x624c('0x4e')]=function(_0x41b40e,_0x549e51){var _0xf7e838={},_0x237764={},_0x29c28f={'count':0x0,'rows':[]};var _0x241520=_[_0x624c('0x3f')](db['ChatInteraction'][_0x624c('0x4f')],function(_0x3da2cf){return{'name':_0x3da2cf[_0x624c('0x50')],'type':_0x3da2cf[_0x624c('0x51')][_0x624c('0x52')]};});_0x237764['model']=_[_0x624c('0x3f')](_0x241520,_0x624c('0x53'));_0x237764['query']=_[_0x624c('0x54')](_0x41b40e['query']);_0x237764[_0x624c('0x55')]=_[_0x624c('0x56')](_0x237764[_0x624c('0x57')],_0x237764[_0x624c('0x58')]);_0xf7e838[_0x624c('0x59')]=_[_0x624c('0x56')](_0x237764[_0x624c('0x57')],qs[_0x624c('0x5a')](_0x41b40e[_0x624c('0x58')][_0x624c('0x5a')]));_0xf7e838[_0x624c('0x59')]=_0xf7e838[_0x624c('0x59')][_0x624c('0x5b')]?_0xf7e838[_0x624c('0x59')]:_0x237764[_0x624c('0x57')];if(!_0x41b40e[_0x624c('0x58')]['hasOwnProperty'](_0x624c('0x5c'))){_0xf7e838[_0x624c('0x2f')]=qs['limit'](_0x41b40e['query'][_0x624c('0x2f')]);_0xf7e838['offset']=qs[_0x624c('0x2d')](_0x41b40e[_0x624c('0x58')]['offset']);}_0xf7e838[_0x624c('0x5d')]=qs['sort'](_0x41b40e['query'][_0x624c('0x5e')]);_0xf7e838['where']=qs[_0x624c('0x55')](_[_0x624c('0x5f')](_0x41b40e[_0x624c('0x58')],_0x237764['filters']),_0x241520);var _0x2fe809=[];var _0x2de3cf=squel[_0x624c('0x60')]()[_0x624c('0x61')]('id')[_0x624c('0x61')](_0x624c('0x53'))[_0x624c('0x61')](_0x624c('0x62'))[_0x624c('0x63')](_0x624c('0x64'));var _0x531f6c=squel[_0x624c('0x60')]()[_0x624c('0x61')](_0x624c('0x65'))[_0x624c('0x61')](_0x624c('0x66'))[_0x624c('0x61')]('ui.ChatInteractionId')[_0x624c('0x63')]('user_has_chat_interactions','ui')['left_join'](_0x624c('0x67'),'u','u.id\x20=\x20ui.UserId');var _0x3f8f93=squel[_0x624c('0x60')]()[_0x624c('0x63')](_0x624c('0x68'),'i')[_0x624c('0x69')](_0x624c('0x6a'),'c',_0x624c('0x6b'))['left_join']('users','o',_0x624c('0x6c'))['left_join']('chat_websites','a',_0x624c('0x6d'))[_0x624c('0x69')](_0x624c('0x6e'),'me',_0x624c('0x6f'))['left_join'](_0x624c('0x70'),'it',_0x624c('0x71'))[_0x624c('0x69')](_0x624c('0x64'),'t','t.id\x20=\x20it.TagId');var _0x2f7afd=squel[_0x624c('0x72')]();var _0x295c6b=[];var _0x58714f=squel[_0x624c('0x72')]();var _0x1cc29b;if(_0x41b40e[_0x624c('0x58')][_0x624c('0x73')]){_0x1cc29b=as[_0x624c('0x74')](_0x41b40e[_0x624c('0x58')][_0x624c('0x73')]);var _0xaeb1de=_0x1cc29b[_0x624c('0x75')];for(var _0x3de64d=0x0;_0x3de64d<_0x1cc29b[_0x624c('0x76')][_0x624c('0x5b')];_0x3de64d++){var _0x24f1b0=_0x1cc29b[_0x624c('0x76')][_0x3de64d];var _0x231252='i';var _0xe0b7d9=_[_0x624c('0x77')](_0x241520,['name',_0x24f1b0['field']]);if(!_0xe0b7d9){switch(_0x24f1b0['field']){case _0x624c('0x78'):if(_0x24f1b0[_0x624c('0x79')]==0x1){_0x3f8f93[_0x624c('0x7a')]('`'+_0x24f1b0['field']+'`\x20=\x200');}else{_0x3f8f93[_0x624c('0x7a')]('`'+_0x24f1b0[_0x624c('0x61')]+_0x624c('0x7b'));}break;case _0x624c('0x7c'):if(_0x24f1b0[_0x624c('0x7d')]===_0x624c('0x7e')){if(_0x24f1b0[_0x624c('0x79')][_0x624c('0x42')]('\x20')[_0x624c('0x5b')]>0x1){_0x2f7afd[_0xaeb1de](_0x624c('0x7f'),qs['getFullTextValue'](_0x24f1b0['value']),null);}else{var _0x2337fa='%'+_0x24f1b0[_0x624c('0x79')]+'%';_0x2f7afd[_0xaeb1de](_0x624c('0x80'),_0x2337fa,_0x2337fa,_0x2337fa);}}else{_0xe0b7d9=_[_0x624c('0x77')](_0x241520,[_0x624c('0x53'),_0x624c('0x81')]);_0x24f1b0['field']=_0x624c('0x81');_0x1b0813=as[_0x624c('0x82')](_0x231252,_0xe0b7d9[_0x624c('0x51')],_0x24f1b0);_0x2f7afd[_0xaeb1de](_0x1b0813[_0x624c('0x83')],_0x1b0813[_0x624c('0x79')]['start'],_0x1b0813[_0x624c('0x79')][_0x624c('0x2a')]);}break;case _0x624c('0x84'):var _0x1c4ca6=_0x24f1b0['value'][_0x624c('0x42')](',')[_0x624c('0x3f')](function(_0x2252c0){return Number(_0x2252c0);});_0x1c4ca6[_0x624c('0x43')](function(_0x5e9c9b){_0x58714f['or'](_0x624c('0x85'),'%,'+_0x5e9c9b+',%');});_0x295c6b=_['union'](_0x295c6b,_0x1c4ca6);break;case _0x624c('0x86'):if(_0x24f1b0['operator']==='$substring'){_0x2f7afd[_0xaeb1de]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x24f1b0[_0x624c('0x79')]+'%',null);}else{_0xe0b7d9=_[_0x624c('0x77')](_0x241520,[_0x624c('0x53'),_0x624c('0x4b')]);_0x24f1b0[_0x624c('0x61')]=_0x624c('0x4b');_0x1b0813=as[_0x624c('0x82')](_0x231252,_0xe0b7d9[_0x624c('0x51')],_0x24f1b0);_0x2f7afd[_0xaeb1de](_0x1b0813[_0x624c('0x83')],_0x1b0813['value'][_0x624c('0x87')],_0x1b0813[_0x624c('0x79')][_0x624c('0x2a')]);}break;case _0x624c('0x88'):_0x1b0813=as[_0x624c('0x82')]('me',null,_0x24f1b0);_0x2f7afd[_0xaeb1de](_0x1b0813[_0x624c('0x83')],_0x1b0813[_0x624c('0x79')][_0x624c('0x87')],_0x1b0813[_0x624c('0x79')][_0x624c('0x2a')]);break;}}else{var _0x1b0813=as['buildExpression'](_0x231252,_0xe0b7d9['type'],_0x24f1b0);_0x2f7afd[_0xaeb1de](_0x1b0813[_0x624c('0x83')],_0x1b0813['value'][_0x624c('0x87')],_0x1b0813[_0x624c('0x79')][_0x624c('0x2a')]);}}}else{var _0x29f717=_(_0x41b40e[_0x624c('0x58')])['keys']()['map'](function(_0x1b6a0c){return _['some'](_0x241520,['name',_0x1b6a0c])?_0x1b6a0c:undefined;})[_0x624c('0x89')]()[_0x624c('0x79')]();if(!_[_0x624c('0x8a')](_0x29f717)){_0x29f717[_0x624c('0x43')](function(_0x47d84a){if(_0x47d84a==='ChatWebsiteId'){_0x3f8f93[_0x624c('0x8b')](_0x624c('0x8c'),[][_0x624c('0x8d')](_0x41b40e[_0x624c('0x58')][_0x47d84a]));}else if(_0x47d84a===_0x624c('0x8e')){var _0x183526=JSON[_0x624c('0x8f')](_0x41b40e[_0x624c('0x58')][_0x47d84a])['$gte'];var _0x1d9ea6=JSON[_0x624c('0x8f')](_0x41b40e[_0x624c('0x58')][_0x47d84a])[_0x624c('0x90')];_0x3f8f93[_0x624c('0x8b')](_0x624c('0x91'),_0x183526,_0x1d9ea6);}else{if(_0x41b40e['query'][_0x47d84a]==='null'){_0x3f8f93[_0x624c('0x8b')]('i.'+_0x47d84a+_0x624c('0x92'));}else{_0x3f8f93[_0x624c('0x8b')]('i.'+_0x47d84a+_0x624c('0x93'),_0x41b40e[_0x624c('0x58')][_0x47d84a]);}}});}if(_0x41b40e['query']['read']){if(_0x41b40e[_0x624c('0x58')]['read']==0x1){_0x3f8f93[_0x624c('0x7a')](_0x624c('0x94'));}else{_0x3f8f93['having'](_0x624c('0x95'));}}if(_0x41b40e['query'][_0x624c('0x96')]){_0x295c6b=_[_0x624c('0x97')](_0x41b40e[_0x624c('0x58')][_0x624c('0x96')])?_0x41b40e[_0x624c('0x58')][_0x624c('0x96')]:new Array(_0x41b40e['query'][_0x624c('0x96')]);_0x295c6b[_0x624c('0x43')](function(_0x5d5842){_0x58714f['or'](_0x624c('0x85'),'%,'+_0x5d5842+',%');});}if(_0x41b40e[_0x624c('0x58')][_0x624c('0x98')]){var _0x4188e1=_0x41b40e['query'][_0x624c('0x98')][_0x624c('0x99')]('\x5c','\x5c\x5c')[_0x624c('0x99')](/'/g,'\x27\x27');if(qs[_0x624c('0x9a')](_0x4188e1)){_0x2f7afd['or'](_0x624c('0x9b'),_0x4188e1+'%');}else{_0x2f7afd['or'](_0x624c('0x9c'),qs[_0x624c('0x9d')](_0x4188e1))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4188e1+'%');}}}_0x3f8f93['where'](_0x2f7afd);_0x3f8f93[_0x624c('0x9e')](_0x624c('0x9f'));var _0x23a0e0={'type':db[_0x624c('0xa0')][_0x624c('0xa1')][_0x624c('0xa2')],'raw':!![]};var _0x3abbce=_0x3f8f93['clone']();_0x3abbce[_0x624c('0x61')](_0x624c('0x9f'));_0x3abbce[_0x624c('0x61')](_0x624c('0xa3'),_0x624c('0x78'));if(_0xf7e838[_0x624c('0x5d')]){_0xf7e838[_0x624c('0x5d')][_0x624c('0x43')](function(_0x2d45ac){var _0x35f5c8=_0x2d45ac[0x0]===_0x624c('0xa4')?_0x2d45ac[0x0]:'i.'+_0x2d45ac[0x0];_0x3f8f93[_0x624c('0x5d')](_0x35f5c8,_0x2d45ac[0x1]===_0x624c('0xa5')?![]:!![]);});}if(!_['isEmpty'](_0x295c6b)){_0x3f8f93['having'](_0x58714f);_0x3abbce[_0x624c('0x8b')](_0x624c('0xa6'),_0x295c6b);}BPromise['resolve']()['then'](function(){if(!_0x1cc29b){if(_0x41b40e[_0x624c('0x58')][_0x624c('0xa7')])return;_0x3abbce[_0x624c('0x8b')](_0x624c('0xa8'));_0x3f8f93[_0x624c('0x8b')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x41b40e['user'][_0x624c('0xa9')]!==_0x624c('0x3c'))return;return _0x41b40e['user'][_0x624c('0xaa')]({'attributes':['id'],'raw':!![]})['then'](function(_0xca20ff){if(_[_0x624c('0x8a')](_0xca20ff)){_0x3abbce[_0x624c('0x8b')](_0x624c('0xab'));_0x3f8f93[_0x624c('0x8b')](_0x624c('0xab'));}else{_0x3abbce[_0x624c('0x8b')]('i.ChatWebsiteId\x20IN\x20?',_[_0x624c('0x3f')](_0xca20ff,'id'));_0x3f8f93[_0x624c('0x8b')](_0x624c('0x8c'),_['map'](_0xca20ff,'id'));}});})['then'](function(){if(_0x41b40e[_0x624c('0xac')][_0x624c('0xa9')]===_0x624c('0x3c')&&!_0x1cc29b&&!_0x41b40e[_0x624c('0x58')]['ChatWebsiteId'])return[];return db['sequelize']['query'](_0x3abbce[_0x624c('0xad')](),_0x23a0e0);})[_0x624c('0x1f')](function(_0x5e9b93){_0x29c28f[_0x624c('0x30')]=_0x5e9b93['length'];if(_0x29c28f[_0x624c('0x30')]===0x0)return[];return db[_0x624c('0xae')][_0x624c('0x58')](_0x2de3cf['toString'](),_0x23a0e0)[_0x624c('0x1f')](function(_0x591f0d){_0x2fe809=_['keyBy'](_0x591f0d,'id');_0x23a0e0=_['merge'](_0x23a0e0,{'model':db[_0x624c('0xaf')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x41b40e[_0x624c('0x58')][_0x624c('0x5a')]){_0xf7e838[_0x624c('0x59')][_0x624c('0x43')](function(_0x3df09a){_0x3f8f93[_0x624c('0x61')]('i.'+_0x3df09a);});}else{_0x3f8f93[_0x624c('0x61')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x3f8f93[_0x624c('0x61')](_0x624c('0xb0'),_0x624c('0xb1'));_0x3f8f93[_0x624c('0x61')]('a.mandatoryDisposition',_0x624c('0xb2'));_0x3f8f93[_0x624c('0x61')]('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',_0x624c('0xa4'));_0x3f8f93['field'](_0x624c('0xb3'));_0x3f8f93[_0x624c('0x61')](_0x624c('0xb4'),'Contact.firstName');_0x3f8f93['field'](_0x624c('0xb5'),_0x624c('0xb6'));_0x3f8f93[_0x624c('0x61')](_0x624c('0xb7'),'Contact.email');_0x3f8f93[_0x624c('0x61')](_0x624c('0xb8'),_0x624c('0xb9'));_0x3f8f93[_0x624c('0x61')](_0x624c('0xba'),_0x624c('0xbb'));_0x3f8f93['field']('c.fax','Contact.fax');_0x3f8f93[_0x624c('0x61')]('o.fullname',_0x624c('0xbc'));_0x3f8f93[_0x624c('0x61')]('o.internal',_0x624c('0xbd'));_0x3f8f93[_0x624c('0x61')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0xf7e838[_0x624c('0x2f')])_0x3f8f93[_0x624c('0x2f')](_0xf7e838[_0x624c('0x2f')]);if(_0xf7e838['offset'])_0x3f8f93['offset'](_0xf7e838[_0x624c('0x2d')]);return db[_0x624c('0xae')]['query'](_0x3f8f93[_0x624c('0xad')](),_0x23a0e0);})['then'](function(_0x5cd839){if(_0x5cd839[_0x624c('0x5b')]>0x0)_0x531f6c['where'](_0x624c('0xbe'),_[_0x624c('0x3f')](_0x5cd839,'id'));return db[_0x624c('0xae')][_0x624c('0x58')](_0x531f6c[_0x624c('0xad')](),_0x23a0e0)['then'](function(_0x602662){var _0x579264=_[_0x624c('0xbf')](_0x602662,'ChatInteractionId');var _0x40a209=[];_0x5cd839['forEach'](function(_0x4d1e83){_0x40a209['push'](updateChatInteraction(_0x4d1e83,_0x2fe809,_0x579264));});return BPromise['all'](_0x40a209);});});})[_0x624c('0x1f')](function(_0x333522){_0x29c28f[_0x624c('0xc0')]=_0x333522;return _0x29c28f;})['then'](respondWithFilteredResult(_0x549e51,_0xf7e838))[_0x624c('0x28')](handleError(_0x549e51,null));};exports[_0x624c('0xc1')]=function(_0x37302e,_0x528848){var _0x85f0f1={'raw':![],'where':{'id':_0x37302e['params']['id']}},_0x38b1d9={};_0x38b1d9['model']=_[_0x624c('0x54')](db[_0x624c('0xaf')][_0x624c('0x4f')]);_0x38b1d9[_0x624c('0x58')]=_[_0x624c('0x54')](_0x37302e[_0x624c('0x58')]);_0x38b1d9['filters']=_['intersection'](_0x38b1d9[_0x624c('0x57')],_0x38b1d9[_0x624c('0x58')]);_0x85f0f1[_0x624c('0x59')]=_[_0x624c('0x56')](_0x38b1d9[_0x624c('0x57')],qs[_0x624c('0x5a')](_0x37302e[_0x624c('0x58')][_0x624c('0x5a')]));_0x85f0f1[_0x624c('0x59')]=_0x85f0f1[_0x624c('0x59')][_0x624c('0x5b')]?_0x85f0f1['attributes']:_0x38b1d9[_0x624c('0x57')];if(_0x37302e[_0x624c('0x58')][_0x624c('0xc2')]){_0x85f0f1[_0x624c('0xc3')]=[{'all':!![]}];}_0x85f0f1=_[_0x624c('0x3a')]({},_0x85f0f1,_0x37302e[_0x624c('0xc4')]);return db['ChatInteraction'][_0x624c('0x77')](_0x85f0f1)['then'](handleEntityNotFound(_0x528848,null))[_0x624c('0x1f')](respondWithResult(_0x528848,null))['catch'](handleError(_0x528848,null));};exports[_0x624c('0xc5')]=function(_0x489af6,_0x2b9e81){return db[_0x624c('0xaf')][_0x624c('0xc5')](_0x489af6[_0x624c('0x88')],{})[_0x624c('0x1f')](respondWithResult(_0x2b9e81,0xc9))[_0x624c('0x28')](handleError(_0x2b9e81,null));};exports[_0x624c('0x35')]=function(_0x45250b,_0xfbf862){if(_0x45250b[_0x624c('0x88')]['id']){delete _0x45250b[_0x624c('0x88')]['id'];}return db[_0x624c('0xaf')]['find']({'where':{'id':_0x45250b[_0x624c('0xc6')]['id']}})[_0x624c('0x1f')](handleEntityNotFound(_0xfbf862,null))['then'](saveUpdates(_0x45250b[_0x624c('0x88')],null))[_0x624c('0x1f')](respondWithResult(_0xfbf862,null))['catch'](handleError(_0xfbf862,null));};exports[_0x624c('0x36')]=function(_0x2487b0,_0x1d4e1c){return db[_0x624c('0xaf')][_0x624c('0x77')]({'where':{'id':_0x2487b0[_0x624c('0xc6')]['id']}})[_0x624c('0x1f')](handleEntityNotFound(_0x1d4e1c,null))[_0x624c('0x1f')](removeEntity(_0x1d4e1c,null))[_0x624c('0x28')](handleError(_0x1d4e1c,null));};exports[_0x624c('0xc7')]=function(_0x1bdcd6,_0xeaa8ba){return db[_0x624c('0xaf')][_0x624c('0xc7')]()['then'](respondWithResult(_0xeaa8ba,null))[_0x624c('0x28')](handleError(_0xeaa8ba,null));};exports[_0x624c('0xc8')]=function(_0x53c766,_0x3faa3c){var _0xd44842=_0x53c766[_0x624c('0xc6')]['id'];var _0x6fed5e;var _0x30c598;var _0x51e46c;return db[_0x624c('0xaf')][_0x624c('0xc9')]({'where':{'id':_0xd44842}})[_0x624c('0x1f')](function(_0x29166f){_0x6fed5e=_0x29166f;return db[_0x624c('0xca')][_0x624c('0xc9')]({'where':{'id':_0x29166f[_0x624c('0xa7')]},'attributes':['id',_0x624c('0xcb'),_0x624c('0xcc'),_0x624c('0xcd'),_0x624c('0xce'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x44711c){if(_0x44711c&&_0x44711c[_0x624c('0xcb')]&&_0x44711c['vidaooEscalation']){_0x30c598=_0x44711c;var _0x228b1a={'interaction':{'id':_0xd44842},'agent':{'id':_0x53c766[_0x624c('0xac')]['id'],'name':_0x53c766[_0x624c('0xac')][_0x624c('0x53')],'fullname':_0x53c766[_0x624c('0xac')]['fullname'],'email':_0x53c766[_0x624c('0xac')][_0x624c('0xcf')]},'contact':_0x53c766[_0x624c('0x88')][_0x624c('0x3b')],'account':_0x53c766[_0x624c('0x88')][_0x624c('0x3e')]};var _0x46686e={'rejectUnauthorized':![],'method':_0x624c('0xd0'),'url':_0x624c('0xd1'),'headers':{'X-APIKEY':_0x44711c[_0x624c('0xcb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x53c766[_0x624c('0xac')]['email']],'buttons':null,'topic':_0x30c598['vidaooTopic'],'note':_[_0x624c('0xd2')](_0x30c598['vidaooNote'])?null:getMustacheRender(_0x30c598[_0x624c('0xce')],_0x228b1a),'metadata':null},'redirect':_0x624c('0xd3'),'json':!![]};try{if(!_[_0x624c('0xd2')](_0x30c598[_0x624c('0xd4')])){var _0x2e9e6b=getMustacheRender(_0x30c598[_0x624c('0xd4')],_0x228b1a);var _0xcf2e6=JSON[_0x624c('0x8f')](_0x2e9e6b);_0x46686e[_0x624c('0x88')]['metadata']=_0xcf2e6;}}catch(_0x1f7a63){throw new db['Sequelize'][(_0x624c('0xd5'))](_0x624c('0xd6'));}return rp(_0x46686e);}else{throw new db['Sequelize'][(_0x624c('0xd5'))](_0x624c('0xd7'));}})[_0x624c('0x1f')](function(_0x2293c5){_0x51e46c=_0x2293c5;if(_0x51e46c['id']){var _0x450aa7={'body':_0x51e46c[_0x624c('0xd8')],'ChatWebsiteId':_0x30c598['id'],'ChatInteractionId':_0x6fed5e['id'],'direction':_0x624c('0xd9'),'UserId':_0x53c766['user']['id']};return db[_0x624c('0xda')][_0x624c('0xc5')](_0x450aa7,{});}else{throw new db['Sequelize']['ValidationError'](_0x624c('0xdb'));}})[_0x624c('0x1f')](function(){return _0x6fed5e[_0x624c('0xdc')]({'vidaooSessionId':_0x51e46c['id']});})[_0x624c('0x1f')](respondWithResult(_0x3faa3c,null))[_0x624c('0x28')](handleError(_0x3faa3c,null));};exports[_0x624c('0xdd')]=function(_0x535f4d,_0x418664){if(_0x535f4d[_0x624c('0x88')]['id']){delete _0x535f4d[_0x624c('0x88')]['id'];}return db[_0x624c('0xaf')][_0x624c('0x77')]({'where':{'id':_0x535f4d['params']['id']},'include':[{'model':db[_0x624c('0xde')],'as':_0x624c('0x7c')}]})['then'](handleEntityNotFound(_0x418664,null))['then'](saveUpdates(_0x535f4d[_0x624c('0x88')],null))[_0x624c('0x1f')](respondWithResult(_0x418664,null))[_0x624c('0x28')](handleError(_0x418664,null));};exports[_0x624c('0xdf')]=function(_0x1c5de1,_0x27502f,_0x5932b3){if(_0x1c5de1['body']['id']){delete _0x1c5de1[_0x624c('0x88')]['id'];}return db[_0x624c('0xaf')][_0x624c('0x77')]({'where':{'id':_0x1c5de1[_0x624c('0xc6')]['id']}})[_0x624c('0x1f')](function(_0x29ca04){if(!_0x29ca04){logger[_0x624c('0x25')](_0x624c('0xe0'),_0x624c('0xdf'),0x194,_0x624c('0xe1'));_0x27502f[_0x624c('0x29')](0x194);}else{if(_0x29ca04[_0x624c('0x4b')]){throw new db[(_0x624c('0xa0'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x29ca04;})[_0x624c('0x1f')](function(_0x5384e3){if(_0x5384e3){return _0x5384e3[_0x624c('0x35')]({'closed':_0x1c5de1[_0x624c('0x88')][_0x624c('0x4a')],'disposition':_0x1c5de1[_0x624c('0x88')]['disposition']})[_0x624c('0x1f')](function(_0x31d590){return _0x31d590;});}})[_0x624c('0x1f')](function(_0x54b76b){return respondWithRpcPromise('AbandonInteraction','abandon',_0x1c5de1['body'],client9004);})[_0x624c('0x1f')](respondWithResult(_0x27502f,null))[_0x624c('0x28')](handleError(_0x27502f,null));};exports[_0x624c('0xe2')]=function(_0x435411,_0x4fe044,_0x3caf9a){_0x435411[_0x624c('0x88')][_0x624c('0x53')]=_0x435411[_0x624c('0xe3')][_0x624c('0xe4')];_0x435411[_0x624c('0x88')]['basename']=_0x435411[_0x624c('0xe3')]['filename'];_0x435411['body'][_0x624c('0x51')]=_0x435411[_0x624c('0xe3')][_0x624c('0xe5')];return db['Attachment'][_0x624c('0xc5')](_0x435411[_0x624c('0x88')])[_0x624c('0x1f')](respondWithResult(_0x4fe044,0xc9))[_0x624c('0x28')](handleError(_0x4fe044,null));};exports[_0x624c('0xe6')]=function(_0x4b52f5,_0x1b2dc6,_0x92a0ff){return db[_0x624c('0xaf')][_0x624c('0xc9')]({'where':{'id':_0x4b52f5[_0x624c('0xc6')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1b2dc6,null))['then'](function(_0x25e504){if(_0x25e504){if(_0x25e504[_0x624c('0x4a')]){return _0x1b2dc6[_0x624c('0x2b')](0x193)[_0x624c('0x2c')]({'status':0x193,'message':'Unauthorized'});}return db[_0x624c('0xe7')]['findOne']({'where':{'id':_0x4b52f5[_0x624c('0x58')][_0x624c('0xe8')]},'raw':!![]})['then'](handleEntityNotFound(_0x1b2dc6,null));}})[_0x624c('0x1f')](function(_0x3f3665){if(_0x3f3665){var _0x172384=_0x3f3665[_0x624c('0xe9')]!==null;var _0x2b6ff0=path[_0x624c('0xea')](config[_0x624c('0xeb')],'server/files/attachments/');if(_0x172384){_0x2b6ff0=path[_0x624c('0xea')](_0x2b6ff0,_0x624c('0xec'));}var _0x51fbb7=path[_0x624c('0xea')](_0x2b6ff0,_0x3f3665['basename']);return _0x1b2dc6['download'](_0x51fbb7);}})[_0x624c('0x28')](handleError(_0x1b2dc6,null));};exports['close']=function(_0x5a3dff,_0x507e62){var _0x214bfa=null;var _0x42bf8f=null;var _0x446a53=null;var _0x341d6b=null;if(_0x5a3dff[_0x624c('0x88')]['id']){delete _0x5a3dff[_0x624c('0x88')]['id'];}if(_0x5a3dff[_0x624c('0x88')][_0x624c('0xed')]){_0x341d6b=path[_0x624c('0xea')](config[_0x624c('0xeb')],_0x624c('0xee'),util[_0x624c('0xef')](_0x624c('0xf0'),Date[_0x624c('0xf1')]()));_0x5a3dff['body'][_0x624c('0xf2')]=_0x341d6b;}return db[_0x624c('0xaf')][_0x624c('0x77')]({'where':{'id':_0x5a3dff[_0x624c('0xc6')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x624c('0xf3'),'include':[{'model':db[_0x624c('0x86')],'as':_0x624c('0x86')}]}]})[_0x624c('0x1f')](handleEntityNotFound(_0x507e62,null))[_0x624c('0x1f')](saveUpdates(_0x5a3dff['body'],null))[_0x624c('0x1f')](function(_0x12768b){if(_0x12768b){_0x214bfa=_0x12768b;return db[_0x624c('0xca')][_0x624c('0x77')]({'where':{'id':_0x214bfa[_0x624c('0xa7')]}});}})[_0x624c('0x1f')](function(_0x1b2964){if(_0x1b2964){_0x446a53=_0x1b2964;return db[_0x624c('0xde')][_0x624c('0x77')]({'where':{'id':_0x214bfa[_0x624c('0x81')]}});}})[_0x624c('0x1f')](function(_0x425f8c){if(_0x425f8c){_0x42bf8f=_0x425f8c;if(_0x341d6b){var _0x43c65a=null;for(var _0x415aff=0x1;_0x415aff<_0x214bfa[_0x624c('0xf3')][_0x624c('0x5b')];++_0x415aff){_0x43c65a=_0x214bfa[_0x624c('0xf3')][_0x415aff];var _0x45d69e=_0x43c65a[_0x624c('0x4b')]?util[_0x624c('0xef')](_0x624c('0xf4'),_0x446a53[_0x624c('0xf5')],_0x43c65a[_0x624c('0x4b')]):_0x624c('0xf6');var _0x292248=_0x5a3dff[_0x624c('0x88')][_0x624c('0xf7')]||util['format'](_0x624c('0xf4'),_0x624c('0xf8'),_0x43c65a[_0x624c('0x81')]);switch(_0x446a53['agentIdentifier']){case _0x624c('0xf9'):_0x45d69e=_0x43c65a[_0x624c('0x4b')]?util[_0x624c('0xef')]('%s%d',_0x446a53['agentAlias'],_0x43c65a[_0x624c('0x4b')]):'System';break;case _0x624c('0xfa'):_0x45d69e=_0x43c65a[_0x624c('0x4b')]?_0x43c65a['User'][_0x624c('0xfb')]||_0x43c65a['User']['fullname']:'System';break;case _0x624c('0xfc'):_0x45d69e=_0x43c65a[_0x624c('0x4b')]?_0x43c65a[_0x624c('0x86')][_0x624c('0xfd')]:_0x624c('0xf6');break;default:_0x45d69e=_0x43c65a[_0x624c('0x4b')]?util['format'](_0x624c('0xf4'),_0x446a53[_0x624c('0xf5')],_0x43c65a[_0x624c('0x4b')]):_0x624c('0xf6');}var _0x292e38=util[_0x624c('0xef')](_0x624c('0xfe'),moment(_0x43c65a[_0x624c('0x8e')])[_0x624c('0xef')](_0x624c('0xff')),_0x43c65a['direction']==='in'?_0x292248:_0x45d69e,_0x43c65a['body']);if(!_0x43c65a[_0x624c('0x100')]){fs[_0x624c('0x101')](_0x341d6b,_0x292e38);}}return db[_0x624c('0x102')][_0x624c('0xc9')]({'where':{'service':!![]},'include':[{'model':db[_0x624c('0x103')],'as':_0x624c('0x104'),'raw':!![]}]});}}})[_0x624c('0x1f')](function(_0x303662){if(_0x303662&&_0x303662['Smtp']&&_0x5a3dff[_0x624c('0x88')]){var _0x57e5ca={'tls':{'rejectUnauthorized':![]}};if(_0x303662[_0x624c('0x104')][_0x624c('0x105')]){_0x57e5ca[_0x624c('0x105')]=_0x303662['Smtp'][_0x624c('0x105')];}else{_0x57e5ca[_0x624c('0x106')]=_0x303662[_0x624c('0x104')]['host'];_0x57e5ca['port']=_0x303662[_0x624c('0x104')][_0x624c('0x107')];_0x57e5ca['secure']=_0x303662[_0x624c('0x104')][_0x624c('0x108')];}if(_0x303662[_0x624c('0x104')][_0x624c('0x109')]){_0x57e5ca['auth']={'user':_0x303662[_0x624c('0x104')][_0x624c('0xac')],'pass':_0x303662[_0x624c('0x104')][_0x624c('0x10a')]};}return respondWithRpcPromise('SendMail',_0x624c('0x10b'),{'account':_0x57e5ca,'message':{'from':util[_0x624c('0xef')](_0x624c('0x10c'),_0x303662[_0x624c('0x53')],_0x303662[_0x624c('0xcf')]||_0x303662[_0x624c('0x104')][_0x624c('0xac')]),'to':_0x5a3dff['body']['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x624c('0xef')](_0x624c('0x10d'),_0x5a3dff[_0x624c('0x88')][_0x624c('0xed')]),'attachments':[{'path':_0x341d6b}]}})[_0x624c('0x1f')](function(){return _0x214bfa;})['catch'](function(_0x55a2dd){console['error'](_0x55a2dd);});}else{return _0x214bfa;}})[_0x624c('0x1f')](respondWithStatusCode(_0x507e62,0xc8))['catch'](handleError(_0x507e62,null));};exports[_0x624c('0x10e')]=function(_0x1a2bee,_0xedf637,_0x22d8ae){return db[_0x624c('0xda')][_0x624c('0x77')]({'where':{'id':_0x1a2bee[_0x624c('0xc6')]['id']}})[_0x624c('0x1f')](handleEntityNotFound(_0xedf637,null))[_0x624c('0x1f')](function(_0x28b0fb){if(_0x28b0fb){return _0x28b0fb[_0x624c('0x10e')](_0x1a2bee['body']['ids'],_['omit'](_0x1a2bee[_0x624c('0x88')],[_0x624c('0x10f'),'id'])||{});}})['then'](respondWithResult(_0xedf637,null))['catch'](handleError(_0xedf637,null));};exports[_0x624c('0x110')]=function(_0x36bd81,_0x58d9a5,_0x2d8bbb){var _0x56c7dd={'raw':![],'where':{}};var _0x4e9c5c={};var _0x27d9f1={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x624c('0xc9')]({'where':{'id':_0x36bd81[_0x624c('0xc6')]['id']}})[_0x624c('0x1f')](handleEntityNotFound(_0x58d9a5,null))[_0x624c('0x1f')](function(_0x5ab52b){if(_0x5ab52b){_0x4e9c5c[_0x624c('0x57')]=_[_0x624c('0x54')](db[_0x624c('0xda')][_0x624c('0x4f')]);_0x4e9c5c[_0x624c('0x58')]=_['keys'](_0x36bd81[_0x624c('0x58')]);_0x4e9c5c[_0x624c('0x55')]=_[_0x624c('0x56')](_0x4e9c5c['model'],_0x4e9c5c[_0x624c('0x58')]);_0x56c7dd[_0x624c('0x59')]=_['intersection'](_0x4e9c5c['model'],qs[_0x624c('0x5a')](_0x36bd81['query']['fields']));_0x56c7dd[_0x624c('0x59')]=_0x56c7dd[_0x624c('0x59')][_0x624c('0x5b')]?_0x56c7dd['attributes']:_0x4e9c5c[_0x624c('0x57')];if(!_0x36bd81[_0x624c('0x58')][_0x624c('0x111')](_0x624c('0x5c'))){_0x56c7dd[_0x624c('0x2f')]=qs[_0x624c('0x2f')](_0x36bd81[_0x624c('0x58')][_0x624c('0x2f')]);_0x56c7dd['offset']=qs[_0x624c('0x2d')](_0x36bd81[_0x624c('0x58')][_0x624c('0x2d')]);}_0x56c7dd[_0x624c('0x5d')]=qs[_0x624c('0x5e')](_0x36bd81[_0x624c('0x58')][_0x624c('0x5e')]);_0x56c7dd[_0x624c('0x8b')]=qs['filters'](_['pick'](_0x36bd81[_0x624c('0x58')],_0x4e9c5c[_0x624c('0x55')]));_0x56c7dd[_0x624c('0x8b')][_0x624c('0x112')]=_0x5ab52b['id'];if(_0x36bd81['query'][_0x624c('0x98')]){_0x56c7dd[_0x624c('0x8b')]=_['merge'](_0x56c7dd[_0x624c('0x8b')],{'$or':_[_0x624c('0x3f')](_0x56c7dd[_0x624c('0x59')],function(_0x207f78){var _0x275f23={};_0x275f23[_0x207f78]={'$like':'%'+_0x36bd81['query'][_0x624c('0x98')]+'%'};return _0x275f23;})});}if(_0x36bd81[_0x624c('0x58')][_0x624c('0x113')]){var _0x508f20=_0x36bd81[_0x624c('0x58')][_0x624c('0x113')][_0x624c('0x42')](',');var _0x259b28={};_0x259b28[_0x508f20[0x0]]={'$gte':moment(_0x508f20[0x1])['format'](_0x624c('0x114'))};_0x56c7dd[_0x624c('0x8b')]=_[_0x624c('0x3a')](_0x56c7dd[_0x624c('0x8b')],_0x259b28);}_0x56c7dd=_[_0x624c('0x3a')]({},_0x56c7dd,_0x36bd81['options']);return db[_0x624c('0xda')]['count']({'where':_0x56c7dd[_0x624c('0x8b')]})['then'](function(_0x2d01a4){_0x27d9f1[_0x624c('0x30')]=_0x2d01a4;if(_0x36bd81[_0x624c('0x58')]['includeAll']){_0x56c7dd[_0x624c('0xc3')]=[{'all':!![]}];}return db[_0x624c('0xda')][_0x624c('0x115')](_0x56c7dd);})[_0x624c('0x1f')](function(_0x430777){_0x27d9f1[_0x624c('0xc0')]=_0x430777;return _0x27d9f1;});}})['then'](respondWithFilteredResult(_0x58d9a5,_0x56c7dd))[_0x624c('0x28')](handleError(_0x58d9a5,null));};exports[_0x624c('0x116')]=function(_0x48f16a,_0x5e1353,_0x9d45ee){var _0x2920af={'where':{}},_0x5b6243={},_0x48b705={'count':0x0,'rows':[]};return db[_0x624c('0xaf')][_0x624c('0xc9')]({'where':{'id':_0x48f16a[_0x624c('0xc6')]['id']}})[_0x624c('0x1f')](handleEntityNotFound(_0x5e1353,null))[_0x624c('0x1f')](function(_0x2a690f){if(_0x2a690f){_0x5b6243[_0x624c('0x57')]=_[_0x624c('0x54')](db[_0x624c('0xda')][_0x624c('0x4f')]);_0x5b6243[_0x624c('0x58')]=_[_0x624c('0x54')](_0x48f16a[_0x624c('0x58')]);_0x5b6243[_0x624c('0x55')]=_['intersection'](_0x5b6243[_0x624c('0x57')],_0x5b6243[_0x624c('0x58')]);_0x2920af['attributes']=_[_0x624c('0x56')](_0x5b6243[_0x624c('0x57')],qs['fields'](_0x48f16a[_0x624c('0x58')]['fields']));_0x2920af[_0x624c('0x59')]=_0x2920af['attributes']['length']?_0x2920af[_0x624c('0x59')]:_0x5b6243[_0x624c('0x57')];if(!_0x48f16a[_0x624c('0x58')][_0x624c('0x111')](_0x624c('0x5c'))){_0x2920af[_0x624c('0x2f')]=qs[_0x624c('0x2f')](_0x48f16a[_0x624c('0x58')][_0x624c('0x2f')]);_0x2920af[_0x624c('0x2d')]=qs[_0x624c('0x2d')](_0x48f16a[_0x624c('0x58')][_0x624c('0x2d')]);}_0x2920af[_0x624c('0x5d')]=qs[_0x624c('0x5e')](_0x48f16a['query'][_0x624c('0x5e')]);_0x2920af[_0x624c('0x8b')]=qs[_0x624c('0x55')](_[_0x624c('0x5f')](_0x48f16a[_0x624c('0x58')],_0x5b6243[_0x624c('0x55')]));_0x2920af['where'][_0x624c('0x112')]=_0x2a690f['id'];if(_0x48f16a['query']['filter']){_0x2920af[_0x624c('0x8b')]=_[_0x624c('0x3a')](_0x2920af['where'],{'$or':_[_0x624c('0x3f')](_0x2920af['attributes'],function(_0x40003a){var _0x317a57={};_0x317a57[_0x40003a]={'$like':'%'+_0x48f16a[_0x624c('0x58')][_0x624c('0x98')]+'%'};return _0x317a57;})});}_0x2920af[_0x624c('0x8b')][_0x624c('0x100')]=![];if(_0x48f16a['query']['id']){_0x2920af[_0x624c('0x8b')]['id']={'$gt':_0x48f16a[_0x624c('0x58')]['id']};}_0x2920af=_[_0x624c('0x3a')]({},_0x2920af,_0x48f16a[_0x624c('0xc4')]);return db['ChatMessage']['count']({'where':_0x2920af[_0x624c('0x8b')]})[_0x624c('0x1f')](function(_0x1fdb00){_0x48b705['count']=_0x1fdb00;_0x2920af[_0x624c('0xc3')]=[];if(_0x48f16a[_0x624c('0x58')]['includeAgent']){_0x2920af[_0x624c('0xc3')]['push']({'model':db[_0x624c('0x86')],'as':'User','attributes':['id',_0x624c('0xfd'),_0x624c('0xfb')]});}if(_0x48f16a[_0x624c('0x58')][_0x624c('0xc2')]){_0x2920af[_0x624c('0xc3')]=[{'all':!![]}];}return db['ChatMessage'][_0x624c('0x115')](_0x2920af);})[_0x624c('0x1f')](function(_0xd3eb09){_0x48b705['rows']=_0xd3eb09;return _0x48b705;});}})[_0x624c('0x1f')](respondWithFilteredResult(_0x5e1353,_0x2920af))['catch'](handleError(_0x5e1353,null));};exports['addTags']=function(_0x2eeba9,_0x56c601,_0x1fdf79){return db[_0x624c('0xaf')]['find']({'where':{'id':_0x2eeba9[_0x624c('0xc6')]['id']}})[_0x624c('0x1f')](handleEntityNotFound(_0x56c601,null))['then'](function(_0x25073d){if(_0x25073d){return _0x25073d[_0x624c('0x117')](_0x2eeba9[_0x624c('0x88')][_0x624c('0x10f')],_[_0x624c('0x118')](_0x2eeba9['body'],[_0x624c('0x10f'),'id'])||{})[_0x624c('0x119')](function(){return db[_0x624c('0x84')][_0x624c('0x115')]({'attributes':['id',_0x624c('0x53'),_0x624c('0x62')],'where':{'id':_0x2eeba9[_0x624c('0x88')]['ids']}});})[_0x624c('0x1f')](function(_0xa0aee7){socket[_0x624c('0x11a')](_0x624c('0x11b'),{'id':Number(_0x2eeba9[_0x624c('0xc6')]['id']),'tags':_0xa0aee7||[]});return{'id':Number(_0x2eeba9['params']['id']),'tags':_0xa0aee7||[]};});}})[_0x624c('0x1f')](respondWithResult(_0x56c601,null))[_0x624c('0x28')](handleError(_0x56c601,null));};exports[_0x624c('0x11c')]=function(_0x4768db,_0x283de5,_0x34c83c){return db[_0x624c('0xaf')]['find']({'where':{'id':_0x4768db[_0x624c('0xc6')]['id']}})[_0x624c('0x1f')](handleEntityNotFound(_0x283de5,null))[_0x624c('0x1f')](function(_0x2145f2){if(_0x2145f2){return _0x2145f2['removeTags'](_0x4768db[_0x624c('0x58')][_0x624c('0x10f')]);}})[_0x624c('0x1f')](respondWithStatusCode(_0x283de5,null))[_0x624c('0x28')](handleError(_0x283de5,null));};exports[_0x624c('0x11d')]=function(_0x4ebe03,_0x393462){var _0x1615f7=moment()[_0x624c('0x11e')]()[_0x624c('0xad')]();var _0x53af06=path[_0x624c('0xea')](config[_0x624c('0xeb')],'server',_0x624c('0x11f'),_0x624c('0x120'));var _0xa601f6=path[_0x624c('0xea')](config[_0x624c('0xeb')],_0x624c('0x121'),_0x624c('0x11f'),_0x624c('0x122'));var _0x405192=path[_0x624c('0xea')](_0x53af06,_0x1615f7);var _0x1ac4d2=util[_0x624c('0xef')](_0x624c('0x123'),_0x4ebe03[_0x624c('0xc6')]['id'],_0x1615f7);var _0x18238f=path[_0x624c('0xea')](_0x53af06,_0x1ac4d2);var _0x238942=[];_0x238942['push']({'model':db[_0x624c('0x86')],'as':_0x624c('0x86'),'attributes':['id',_0x624c('0xfd')],'raw':!![]});_0x238942['push']({'model':db['CmContact'],'as':_0x624c('0x7c'),'attributes':['id',_0x624c('0x124'),_0x624c('0x125')],'raw':!![]});if(_0x4ebe03['query'][_0x624c('0x122')]){_0x238942[_0x624c('0x44')]({'model':db[_0x624c('0xe7')],'as':_0x624c('0xe7'),'raw':!![]});}var _0x1036e3=[{'model':db[_0x624c('0xda')],'as':_0x624c('0xf3'),'attributes':['id','body',_0x624c('0x8e'),_0x624c('0x126'),_0x624c('0x100'),_0x624c('0x127')],'include':_0x238942}];_0x1036e3[_0x624c('0x44')]({'model':db[_0x624c('0xca')],'as':_0x624c('0x128'),'attributes':['id',_0x624c('0x53')]});_0x1036e3[_0x624c('0x44')]({'model':db[_0x624c('0x86')],'as':'Owner','attributes':['id',_0x624c('0xfd')]});return db[_0x624c('0xaf')][_0x624c('0x77')]({'where':{'id':_0x4ebe03[_0x624c('0xc6')]['id']},'include':_0x1036e3})['then'](handleEntityNotFound(_0x393462,null))['then'](function(_0x4c5de2){if(_0x4c5de2){var _0x24e63a=_0x4c5de2[_0x624c('0x129')]({'plain':!![]});fs[_0x624c('0x12a')](_0x405192);var _0x4dc40b={'channel':_0x624c('0x12b'),'account':_0x24e63a[_0x624c('0x128')][_0x624c('0x53')],'agent':_0x24e63a[_0x624c('0x12c')]?_0x24e63a[_0x624c('0x12c')][_0x624c('0xfd')]:_0x624c('0x12d'),'createdAt':moment(_0x24e63a['createdAt'])[_0x624c('0xef')](_0x624c('0x114'))[_0x624c('0xad')](),'closedAt':_0x24e63a[_0x624c('0x4a')]?moment(_0x24e63a[_0x624c('0x12e')])[_0x624c('0xef')](_0x624c('0x114'))[_0x624c('0xad')]():'','disposition':_0x24e63a['disposition'],'chatInfo':{'browser':_0x24e63a[_0x624c('0x12f')],'os':_0x24e63a[_0x624c('0x130')],'referer':_0x24e63a['referer'],'customerIp':_0x24e63a[_0x624c('0x131')],'customerPort':_0x24e63a[_0x624c('0x132')]?_0x24e63a[_0x624c('0x132')]:_0x624c('0x12d')},'messages':_(_0x24e63a[_0x624c('0xf3')])[_0x624c('0x133')]()['filter']({'secret':![]})[_0x624c('0x3f')](function(_0x7894fe){if(_0x7894fe[_0x624c('0xe7')]){var _0xb6b0cc=path['join'](_0xa601f6,_0x7894fe[_0x624c('0xe7')][_0x624c('0x134')]);if(fs[_0x624c('0x135')](_0xb6b0cc)){fs['createReadStream'](_0xb6b0cc)[_0x624c('0x136')](fs['createWriteStream'](path['join'](_0x405192,_0x7894fe['Attachment'][_0x624c('0x134')])));}}return{'date':moment(_0x7894fe[_0x624c('0x8e')])['format'](_0x624c('0x114'))[_0x624c('0xad')](),'sender':_0x7894fe[_0x624c('0x126')]==='out'?_0x7894fe[_0x624c('0x86')]?_0x7894fe[_0x624c('0x86')][_0x624c('0xfd')]:_0x624c('0xf6'):_0x7894fe[_0x624c('0x7c')][_0x624c('0x124')]+(_0x7894fe[_0x624c('0x7c')][_0x624c('0x125')]?'\x20'+_0x7894fe[_0x624c('0x7c')][_0x624c('0x125')]:''),'body':_0x7894fe[_0x624c('0xe7')]?_0x7894fe[_0x624c('0xe7')][_0x624c('0x134')]:_0x7894fe[_0x624c('0x88')],'direction':_0x7894fe['direction']===_0x624c('0xd9')?'A':'C','secret':_0x7894fe[_0x624c('0x100')],'read':_0x7894fe['read'],'attachment':_0x7894fe[_0x624c('0xe7')]};})[_0x624c('0x79')]()};return ejs[_0x624c('0x137')](path[_0x624c('0xea')](config['root'],_0x624c('0x121'),_0x624c('0x138'),_0x624c('0x139')),{'interaction':_0x4dc40b})[_0x624c('0x1f')](function(_0xec9890){var _0x1c0cfa=path[_0x624c('0xea')](_0x405192,_0x624c('0x13a')+_0x24e63a['id']+'-'+_0x1615f7+_0x624c('0x13b'));var _0x249aa6={'path':_0x1c0cfa,'channel':_0x624c('0x12b'),'interactionId':_0x24e63a['id']};return pdf[_0x624c('0x13c')](_0xec9890,_0x249aa6);})[_0x624c('0x1f')](function(){return new BPromise(function(_0x38bbfe,_0x2c6087){zipdir(_0x405192,{'saveTo':_0x18238f},function(_0x30b433,_0x4f2648){if(_0x30b433)return _0x2c6087(_0x30b433);return _0x38bbfe(_0x4f2648);});})['then'](function(){return new BPromise(function(_0x3fb38,_0x14dd00){rimraf(_0x405192,function(_0x2fb487){if(_0x2fb487)_0x14dd00(_0x2fb487);return _0x3fb38();});});})[_0x624c('0x1f')](function(){return _0x393462[_0x624c('0x11d')](_0x18238f,_0x1ac4d2,function(_0x581859){if(_0x581859){console['log'](_0x624c('0x13d'),_0x581859);}else{fs[_0x624c('0x13e')](_0x18238f);}});});});}else{return _0x393462[_0x624c('0x29')](0xc8);}})['catch'](handleError(_0x393462,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 8bc7981..e903059 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 _0xe6bc=['remove','getUsers','then','Users','map','findAll','setDataValue','length','emit','catch','hasOwnProperty','ChatInteraction','ChatMessage','setMaxListeners','save','update'];(function(_0x521896,_0x241c0a){var _0x529a79=function(_0x571a5e){while(--_0x571a5e){_0x521896['push'](_0x521896['shift']());}};_0x529a79(++_0x241c0a);}(_0xe6bc,0xfb));var _0xce6b=function(_0x4b65c2,_0x562e9a){_0x4b65c2=_0x4b65c2-0x0;var _0xe9e29d=_0xe6bc[_0x4b65c2];return _0xe9e29d;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0xce6b('0x0')];var ChatMessage=require('../../mysqldb')['db'][_0xce6b('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xce6b('0x2')](0x0);var events={'afterCreate':_0xce6b('0x3'),'afterUpdate':_0xce6b('0x4'),'afterDestroy':_0xce6b('0x5')};function emitEvent(_0x56a43b){return function(_0x4c71a8,_0x28b8e9,_0x3f411a){_0x4c71a8[_0xce6b('0x6')]({'attributes':['id'],'raw':!![]})[_0xce6b('0x7')](function(_0x31f234){_0x4c71a8['setDataValue'](_0xce6b('0x8'),_0x31f234[_0xce6b('0x9')](function(_0x44c4a2){return{'id':_0x44c4a2['id']};}));return ChatMessage[_0xce6b('0xa')]({'where':{'ChatInteractionId':_0x4c71a8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xce6b('0x7')](function(_0x13b5f6){_0x4c71a8[_0xce6b('0xb')]('unreadMessages',_0x13b5f6[_0xce6b('0xc')]);ChatInteractionEvents[_0xce6b('0xd')](_0x56a43b+':'+_0x4c71a8['id'],_0x4c71a8);ChatInteractionEvents[_0xce6b('0xd')](_0x56a43b,_0x4c71a8);_0x3f411a(null);})[_0xce6b('0xe')](_0x3f411a(null));};}for(var e in events){if(events[_0xce6b('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xe2e9=['ChatMessage','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','../../mysqldb','ChatInteraction'];(function(_0x3c020e,_0x4abf7e){var _0x28af2e=function(_0xbc78f9){while(--_0xbc78f9){_0x3c020e['push'](_0x3c020e['shift']());}};_0x28af2e(++_0x4abf7e);}(_0xe2e9,0x1da));var _0x9e2e=function(_0x1c32a5,_0x1c2562){_0x1c32a5=_0x1c32a5-0x0;var _0x1171f0=_0xe2e9[_0x1c32a5];return _0x1171f0;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x9e2e('0x0'))['db'][_0x9e2e('0x1')];var ChatMessage=require(_0x9e2e('0x0'))['db'][_0x9e2e('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e2e('0x3'),'afterUpdate':_0x9e2e('0x4'),'afterDestroy':_0x9e2e('0x5')};function emitEvent(_0x2a4eb8){return function(_0x493161,_0x336a6f,_0x2c99a9){_0x493161[_0x9e2e('0x6')]({'attributes':['id'],'raw':!![]})[_0x9e2e('0x7')](function(_0x5b7f35){_0x493161[_0x9e2e('0x8')](_0x9e2e('0x9'),_0x5b7f35[_0x9e2e('0xa')](function(_0x381200){return{'id':_0x381200['id']};}));return ChatMessage[_0x9e2e('0xb')]({'where':{'ChatInteractionId':_0x493161['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9e2e('0x7')](function(_0x2647fd){_0x493161[_0x9e2e('0x8')]('unreadMessages',_0x2647fd[_0x9e2e('0xc')]);ChatInteractionEvents[_0x9e2e('0xd')](_0x2a4eb8+':'+_0x493161['id'],_0x493161);ChatInteractionEvents[_0x9e2e('0xd')](_0x2a4eb8,_0x493161);_0x2c99a9(null);})[_0x9e2e('0xe')](_0x2c99a9(null));};}for(var e in events){if(events[_0x9e2e('0xf')](e)){var event=events[e];ChatInteraction[_0x9e2e('0x10')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 7bfcc0d..445a810 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 _0xfe41=['changed','closed','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatInteraction.attributes','define'];(function(_0x26b9d2,_0x4f3af1){var _0x14592e=function(_0x1b9daf){while(--_0x1b9daf){_0x26b9d2['push'](_0x26b9d2['shift']());}};_0x14592e(++_0x4f3af1);}(_0xfe41,0x17d));var _0x1fe4=function(_0x38ee8c,_0x41ae11){_0x38ee8c=_0x38ee8c-0x0;var _0x95d48c=_0xfe41[_0x38ee8c];return _0x95d48c;};'use strict';var _=require('lodash');var util=require(_0x1fe4('0x0'));var logger=require(_0x1fe4('0x1'))(_0x1fe4('0x2'));var moment=require(_0x1fe4('0x3'));var BPromise=require(_0x1fe4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fe4('0x5'));var rimraf=require(_0x1fe4('0x6'));var config=require('../../config/environment');var attributes=require(_0x1fe4('0x7'));module['exports']=function(_0x157aa7,_0x14023c){return _0x157aa7[_0x1fe4('0x8')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x12e5eb,_0x51d628,_0x4b0422){if(_0x12e5eb[_0x1fe4('0x9')](_0x1fe4('0xa'))){_0x12e5eb['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4b0422(null,_0x12e5eb);}},'charset':_0x1fe4('0xb'),'collate':_0x1fe4('0xc')});}; \ No newline at end of file +var _0x8d85=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','define','ChatInteraction','chat_interactions'];(function(_0x4a6ce8,_0x24cd49){var _0x302a6c=function(_0x423b63){while(--_0x423b63){_0x4a6ce8['push'](_0x4a6ce8['shift']());}};_0x302a6c(++_0x24cd49);}(_0x8d85,0x16c));var _0x58d8=function(_0x2d33ee,_0x193172){_0x2d33ee=_0x2d33ee-0x0;var _0x4fad1d=_0x8d85[_0x2d33ee];return _0x4fad1d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x58d8('0x0'))('api');var moment=require(_0x58d8('0x1'));var BPromise=require(_0x58d8('0x2'));var rp=require(_0x58d8('0x3'));var fs=require('fs');var path=require(_0x58d8('0x4'));var rimraf=require(_0x58d8('0x5'));var config=require('../../config/environment');var attributes=require(_0x58d8('0x6'));module['exports']=function(_0x35d7be,_0x9678b8){return _0x35d7be[_0x58d8('0x7')](_0x58d8('0x8'),attributes,{'tableName':_0x58d8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x31b29c,_0x4412f3,_0x5cb8db){if(_0x31b29c[_0x58d8('0xa')](_0x58d8('0xb'))){_0x31b29c[_0x58d8('0xc')]=moment()[_0x58d8('0xd')](_0x58d8('0xe'));}_0x5cb8db(null,_0x31b29c);}},'charset':_0x58d8('0xf'),'collate':_0x58d8('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 31cd724..46dcbc2 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 _0xe1ad=['error','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','attributes','limit','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4a0f9e,_0x29e6bb){var _0x3071ec=function(_0x2b1e72){while(--_0x2b1e72){_0x4a0f9e['push'](_0x4a0f9e['shift']());}};_0x3071ec(++_0x29e6bb);}(_0xe1ad,0xd9));var _0xde1a=function(_0x50bcee,_0x11eb41){_0x50bcee=_0x50bcee-0x0;var _0x1b5fc4=_0xe1ad[_0x50bcee];return _0x1b5fc4;};'use strict';var _=require(_0xde1a('0x0'));var util=require(_0xde1a('0x1'));var moment=require('moment');var BPromise=require(_0xde1a('0x2'));var rs=require(_0xde1a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xde1a('0x4'));var logger=require(_0xde1a('0x5'))(_0xde1a('0x6'));var config=require('../../config/environment');var jayson=require(_0xde1a('0x7'));var client=jayson[_0xde1a('0x8')][_0xde1a('0x9')]({'port':0x232a});config[_0xde1a('0xa')]=_[_0xde1a('0xb')](config['redis'],{'host':_0xde1a('0xc'),'port':0x18eb});var socket=require(_0xde1a('0xd'))(new Redis(config[_0xde1a('0xa')]));require(_0xde1a('0xe'))['register'](socket);function respondWithRpcPromise(_0x390af4,_0x37d5b7,_0x1d75b0){return new BPromise(function(_0x21062b,_0x3ccb54){return client[_0xde1a('0xf')](_0x390af4,_0x1d75b0)[_0xde1a('0x10')](function(_0x5dd4d0){logger[_0xde1a('0x11')](_0xde1a('0x12'),_0x37d5b7,_0xde1a('0x13'));logger[_0xde1a('0x14')](_0xde1a('0x15'),_0x37d5b7,_0xde1a('0x13'),JSON[_0xde1a('0x16')](_0x5dd4d0));if(_0x5dd4d0[_0xde1a('0x17')]){if(_0x5dd4d0[_0xde1a('0x17')]['code']===0x1f4){logger['error'](_0xde1a('0x12'),_0x37d5b7,_0x5dd4d0[_0xde1a('0x17')][_0xde1a('0x18')]);return _0x3ccb54(_0x5dd4d0[_0xde1a('0x17')]['message']);}logger[_0xde1a('0x17')](_0xde1a('0x12'),_0x37d5b7,_0x5dd4d0[_0xde1a('0x17')][_0xde1a('0x18')]);return _0x21062b(_0x5dd4d0[_0xde1a('0x17')]['message']);}else{logger['info'](_0xde1a('0x12'),_0x37d5b7,_0xde1a('0x13'));_0x21062b(_0x5dd4d0['result']['message']);}})[_0xde1a('0x19')](function(_0x1dc40a){logger[_0xde1a('0x17')](_0xde1a('0x12'),_0x37d5b7,_0x1dc40a);_0x3ccb54(_0x1dc40a);});});}exports[_0xde1a('0x1a')]=function(_0x39d0ba){var _0x5d8deb=this;return new Promise(function(_0x412e64,_0x1c1f9e){return db[_0xde1a('0x1b')][_0xde1a('0x1c')](_0x39d0ba[_0xde1a('0x1d')],{'raw':_0x39d0ba[_0xde1a('0x1e')]?_0x39d0ba[_0xde1a('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39d0ba['options']?_0x39d0ba[_0xde1a('0x1e')]['where']||null:null,'attributes':_0x39d0ba[_0xde1a('0x1e')]?_0x39d0ba[_0xde1a('0x1e')][_0xde1a('0x1f')]||null:null,'limit':_0x39d0ba['options']?_0x39d0ba['options'][_0xde1a('0x20')]||null:null})[_0xde1a('0x10')](function(_0x49bb4f){logger[_0xde1a('0x11')](_0xde1a('0x1a'),_0x39d0ba);logger[_0xde1a('0x14')](_0xde1a('0x1a'),_0x39d0ba,JSON[_0xde1a('0x16')](_0x49bb4f));_0x412e64(_0x49bb4f);})[_0xde1a('0x19')](function(_0x5b2d85){logger[_0xde1a('0x17')](_0xde1a('0x1a'),_0x5b2d85[_0xde1a('0x18')],_0x39d0ba);_0x1c1f9e(_0x5d8deb['error'](0x1f4,_0x5b2d85[_0xde1a('0x18')]));});});};exports[_0xde1a('0x21')]=function(_0xa2489f){return new Promise(function(_0x3662ae,_0x106c83){return db[_0xde1a('0x1b')][_0xde1a('0x22')]({'where':_0xa2489f[_0xde1a('0x1e')]?_0xa2489f['options']['where']||null:null})[_0xde1a('0x10')](function(_0x495a5b){if(_0x495a5b){return _0x495a5b[_0xde1a('0x23')](_0xa2489f[_0xde1a('0x1d')][_0xde1a('0x24')],_[_0xde1a('0x25')](_0xa2489f[_0xde1a('0x1d')],[_0xde1a('0x24'),'id'])||{});}})[_0xde1a('0x26')](function(_0x4bb600){logger[_0xde1a('0x11')](_0xde1a('0x27'),_0xa2489f);logger['debug'](_0xde1a('0x27'),_0xa2489f,JSON['stringify'](_0x4bb600));_0x3662ae(_0x4bb600);})['catch'](function(_0x1aace8){logger[_0xde1a('0x17')]('AddTags',_0x1aace8['message'],_0xa2489f);_0x106c83(_this[_0xde1a('0x17')](0x1f4,_0x1aace8['message']));});});}; \ No newline at end of file +var _0xb494=['catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','limit','stringify','AddTagsToChatInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0xa98302,_0x844f27){var _0x1ad8e3=function(_0x57e51d){while(--_0x57e51d){_0xa98302['push'](_0xa98302['shift']());}};_0x1ad8e3(++_0x844f27);}(_0xb494,0x181));var _0x4b49=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0xb494[_0x163040];return _0x364667;};'use strict';var _=require(_0x4b49('0x0'));var util=require(_0x4b49('0x1'));var moment=require(_0x4b49('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b49('0x3'));var db=require(_0x4b49('0x4'))['db'];var utils=require(_0x4b49('0x5'));var logger=require(_0x4b49('0x6'))(_0x4b49('0x7'));var config=require(_0x4b49('0x8'));var jayson=require(_0x4b49('0x9'));var client=jayson[_0x4b49('0xa')][_0x4b49('0xb')]({'port':0x232a});config[_0x4b49('0xc')]=_['defaults'](config[_0x4b49('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b49('0xc')]));require(_0x4b49('0xd'))[_0x4b49('0xe')](socket);function respondWithRpcPromise(_0x3ee322,_0x29f41a,_0x5c6245){return new BPromise(function(_0x386c6c,_0x2fa8db){return client[_0x4b49('0xf')](_0x3ee322,_0x5c6245)[_0x4b49('0x10')](function(_0x1cd8a1){logger[_0x4b49('0x11')](_0x4b49('0x12'),_0x29f41a,_0x4b49('0x13'));logger[_0x4b49('0x14')](_0x4b49('0x15'),_0x29f41a,_0x4b49('0x13'),JSON['stringify'](_0x1cd8a1));if(_0x1cd8a1[_0x4b49('0x16')]){if(_0x1cd8a1[_0x4b49('0x16')][_0x4b49('0x17')]===0x1f4){logger[_0x4b49('0x16')](_0x4b49('0x12'),_0x29f41a,_0x1cd8a1[_0x4b49('0x16')][_0x4b49('0x18')]);return _0x2fa8db(_0x1cd8a1[_0x4b49('0x16')][_0x4b49('0x18')]);}logger[_0x4b49('0x16')](_0x4b49('0x12'),_0x29f41a,_0x1cd8a1[_0x4b49('0x16')][_0x4b49('0x18')]);return _0x386c6c(_0x1cd8a1[_0x4b49('0x16')]['message']);}else{logger[_0x4b49('0x11')](_0x4b49('0x12'),_0x29f41a,_0x4b49('0x13'));_0x386c6c(_0x1cd8a1['result'][_0x4b49('0x18')]);}})[_0x4b49('0x19')](function(_0x3c1168){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x29f41a,_0x3c1168);_0x2fa8db(_0x3c1168);});});}exports[_0x4b49('0x1a')]=function(_0x2009c5){var _0x4a6be4=this;return new Promise(function(_0x5ec741,_0x1e8691){return db[_0x4b49('0x1b')][_0x4b49('0x1c')](_0x2009c5[_0x4b49('0x1d')],{'raw':_0x2009c5[_0x4b49('0x1e')]?_0x2009c5[_0x4b49('0x1e')][_0x4b49('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2009c5[_0x4b49('0x1e')]?_0x2009c5[_0x4b49('0x1e')]['where']||null:null,'attributes':_0x2009c5[_0x4b49('0x1e')]?_0x2009c5['options']['attributes']||null:null,'limit':_0x2009c5['options']?_0x2009c5[_0x4b49('0x1e')][_0x4b49('0x20')]||null:null})[_0x4b49('0x10')](function(_0x1d66a5){logger[_0x4b49('0x11')](_0x4b49('0x1a'),_0x2009c5);logger['debug'](_0x4b49('0x1a'),_0x2009c5,JSON[_0x4b49('0x21')](_0x1d66a5));_0x5ec741(_0x1d66a5);})[_0x4b49('0x19')](function(_0x3179e9){logger['error'](_0x4b49('0x1a'),_0x3179e9[_0x4b49('0x18')],_0x2009c5);_0x1e8691(_0x4a6be4[_0x4b49('0x16')](0x1f4,_0x3179e9[_0x4b49('0x18')]));});});};exports[_0x4b49('0x22')]=function(_0x334889){return new Promise(function(_0x28e06b,_0x216ca8){return db[_0x4b49('0x1b')][_0x4b49('0x23')]({'where':_0x334889[_0x4b49('0x1e')]?_0x334889[_0x4b49('0x1e')][_0x4b49('0x24')]||null:null})['then'](function(_0x35e51a){if(_0x35e51a){return _0x35e51a[_0x4b49('0x25')](_0x334889[_0x4b49('0x1d')]['ids'],_['omit'](_0x334889['body'],[_0x4b49('0x26'),'id'])||{});}})[_0x4b49('0x27')](function(_0x294b85){logger[_0x4b49('0x11')](_0x4b49('0x28'),_0x334889);logger[_0x4b49('0x14')]('AddTags',_0x334889,JSON[_0x4b49('0x21')](_0x294b85));_0x28e06b(_0x294b85);})[_0x4b49('0x19')](function(_0xee01e3){logger[_0x4b49('0x16')](_0x4b49('0x28'),_0xee01e3[_0x4b49('0x18')],_0x334889);_0x216ca8(_this['error'](0x1f4,_0xee01e3[_0x4b49('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index b960e45..a518790 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 _0x2e35=['length','chatInteraction:','./chatInteraction.events','remove','emit'];(function(_0x179e92,_0x2ceccd){var _0x5bc237=function(_0x5cb5d2){while(--_0x5cb5d2){_0x179e92['push'](_0x179e92['shift']());}};_0x5bc237(++_0x2ceccd);}(_0x2e35,0x101));var _0x52e3=function(_0x2899d0,_0x1185a1){_0x2899d0=_0x2899d0-0x0;var _0x503cf6=_0x2e35[_0x2899d0];return _0x503cf6;};'use strict';var ChatInteractionEvents=require(_0x52e3('0x0'));var events=['save',_0x52e3('0x1'),'update'];function createListener(_0x3b24b7,_0x3d042f){return function(_0xc6a6b8){_0x3d042f[_0x52e3('0x2')](_0x3b24b7,_0xc6a6b8);};}function removeListener(_0x536388,_0x144abc){return function(){ChatInteractionEvents['removeListener'](_0x536388,_0x144abc);};}exports['register']=function(_0x583d54){for(var _0x8477a3=0x0,_0x45ea28=events[_0x52e3('0x3')];_0x8477a3<_0x45ea28;_0x8477a3++){var _0x2330e9=events[_0x8477a3];var _0x108b0a=createListener(_0x52e3('0x4')+_0x2330e9,_0x583d54);ChatInteractionEvents['on'](_0x2330e9,_0x108b0a);}}; \ No newline at end of file +var _0x9eb5=['save','emit','register','length','./chatInteraction.events'];(function(_0x50aa04,_0x13ec6d){var _0x4fe89e=function(_0x56232c){while(--_0x56232c){_0x50aa04['push'](_0x50aa04['shift']());}};_0x4fe89e(++_0x13ec6d);}(_0x9eb5,0x15d));var _0x59eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9eb5[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0x59eb('0x0'));var events=[_0x59eb('0x1'),'remove','update'];function createListener(_0x2629cf,_0x9807bb){return function(_0x5ac8f3){_0x9807bb[_0x59eb('0x2')](_0x2629cf,_0x5ac8f3);};}function removeListener(_0x463284,_0x206567){return function(){ChatInteractionEvents['removeListener'](_0x463284,_0x206567);};}exports[_0x59eb('0x3')]=function(_0x3c88da){for(var _0x1a767a=0x0,_0x1ea153=events[_0x59eb('0x4')];_0x1a767a<_0x1ea153;_0x1a767a++){var _0x3853e8=events[_0x1a767a];var _0x1ed195=createListener('chatInteraction:'+_0x3853e8,_0x3c88da);ChatInteractionEvents['on'](_0x3853e8,_0x1ed195);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index e87e34c..6564f29 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 _0x4b9d=['../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5ce658,_0x559694){var _0x5a09a8=function(_0x124ef4){while(--_0x124ef4){_0x5ce658['push'](_0x5ce658['shift']());}};_0x5a09a8(++_0x559694);}(_0x4b9d,0x1bf));var _0xd4b9=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x4b9d[_0x5f1617];return _0x3af5da;};'use strict';var multer=require(_0xd4b9('0x0'));var util=require(_0xd4b9('0x1'));var path=require(_0xd4b9('0x2'));var timeout=require(_0xd4b9('0x3'));var express=require(_0xd4b9('0x4'));var router=express[_0xd4b9('0x5')]();var fs_extra=require(_0xd4b9('0x6'));var auth=require(_0xd4b9('0x7'));var interaction=require(_0xd4b9('0x8'));var config=require(_0xd4b9('0x9'));var controller=require(_0xd4b9('0xa'));router[_0xd4b9('0xb')]('/',auth[_0xd4b9('0xc')](),controller[_0xd4b9('0xd')]);router[_0xd4b9('0xb')](_0xd4b9('0xe'),auth[_0xd4b9('0xc')](),controller[_0xd4b9('0xf')]);router[_0xd4b9('0xb')]('/:id',auth[_0xd4b9('0x10')](),controller['show']);router[_0xd4b9('0xb')](_0xd4b9('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xd4b9('0x12')]);router[_0xd4b9('0xb')](_0xd4b9('0x13'),auth[_0xd4b9('0xc')](),controller[_0xd4b9('0x14')]);router[_0xd4b9('0xb')](_0xd4b9('0x15'),auth[_0xd4b9('0x10')](),controller[_0xd4b9('0x16')]);router[_0xd4b9('0xb')]('/:id/download',auth[_0xd4b9('0xc')](),controller[_0xd4b9('0x17')]);router[_0xd4b9('0x18')]('/',auth['isAuthenticated'](),controller[_0xd4b9('0x19')]);router[_0xd4b9('0x18')](_0xd4b9('0x1a'),auth['isAuthenticated'](),controller[_0xd4b9('0x1b')]);var upload=multer({'storage':multer[_0xd4b9('0x1c')]({'destination':function(_0x209ef3,_0x5985e3,_0x2a6972){_0x2a6972(null,path[_0xd4b9('0x1d')](config[_0xd4b9('0x1e')],_0xd4b9('0x1f')));},'filename':function(_0xf59845,_0x510c5b,_0x645093){_0x645093(null,util[_0xd4b9('0x20')](_0xd4b9('0x21'),Date[_0xd4b9('0x22')](),_0x510c5b[_0xd4b9('0x23')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd4b9('0x18')](_0xd4b9('0x24'),upload[_0xd4b9('0x25')](_0xd4b9('0x26')),controller[_0xd4b9('0x27')]);router[_0xd4b9('0x18')]('/:id/messages',auth[_0xd4b9('0x10')](),controller[_0xd4b9('0x28')]);router[_0xd4b9('0x18')](_0xd4b9('0x29'),auth[_0xd4b9('0xc')](),interaction[_0xd4b9('0x2a')](_0xd4b9('0x2b'),_0xd4b9('0x2c')),controller[_0xd4b9('0x2d')]);router[_0xd4b9('0x2e')](_0xd4b9('0x2f'),auth[_0xd4b9('0xc')](),interaction[_0xd4b9('0x2a')](_0xd4b9('0x2b'),_0xd4b9('0x30')),controller[_0xd4b9('0x31')]);router[_0xd4b9('0x2e')](_0xd4b9('0x32'),controller[_0xd4b9('0x33')]);router['put'](_0xd4b9('0x34'),auth[_0xd4b9('0x10')](),controller['abandon']);router[_0xd4b9('0x2e')](_0xd4b9('0x35'),controller[_0xd4b9('0x36')]);router[_0xd4b9('0x37')]('/:id',auth[_0xd4b9('0xc')](),interaction[_0xd4b9('0x2a')]('chat','chatinteraction:destroy'),controller[_0xd4b9('0x38')]);router[_0xd4b9('0x37')](_0xd4b9('0x29'),auth[_0xd4b9('0xc')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0xcd3a=['/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMyMessages','/:id/download','download','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','post','/:id/tags','tracked','chatinteraction:addtags','addTags','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','put','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe'];(function(_0x4b2366,_0x341406){var _0x4c30dd=function(_0x4634ec){while(--_0x4634ec){_0x4b2366['push'](_0x4b2366['shift']());}};_0x4c30dd(++_0x341406);}(_0xcd3a,0x1f3));var _0xacd3=function(_0x36b4f4,_0x1921d5){_0x36b4f4=_0x36b4f4-0x0;var _0x2bf12c=_0xcd3a[_0x36b4f4];return _0x2bf12c;};'use strict';var multer=require(_0xacd3('0x0'));var util=require(_0xacd3('0x1'));var path=require(_0xacd3('0x2'));var timeout=require(_0xacd3('0x3'));var express=require(_0xacd3('0x4'));var router=express[_0xacd3('0x5')]();var fs_extra=require(_0xacd3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xacd3('0x7'));var config=require(_0xacd3('0x8'));var controller=require(_0xacd3('0x9'));router[_0xacd3('0xa')]('/',auth[_0xacd3('0xb')](),controller[_0xacd3('0xc')]);router['get'](_0xacd3('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xacd3('0xa')](_0xacd3('0xe'),auth[_0xacd3('0xf')](),controller[_0xacd3('0x10')]);router[_0xacd3('0xa')](_0xacd3('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xacd3('0x12')]);router[_0xacd3('0xa')](_0xacd3('0x13'),auth['isAuthenticated'](),controller['getMessages']);router[_0xacd3('0xa')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0xacd3('0x14')]);router[_0xacd3('0xa')](_0xacd3('0x15'),auth[_0xacd3('0xb')](),controller[_0xacd3('0x16')]);router['post']('/',auth['isAuthenticated'](),controller[_0xacd3('0x17')]);router['post'](_0xacd3('0x18'),auth[_0xacd3('0xb')](),controller[_0xacd3('0x19')]);var upload=multer({'storage':multer[_0xacd3('0x1a')]({'destination':function(_0x171d1c,_0x57ed86,_0x34e9c5){_0x34e9c5(null,path[_0xacd3('0x1b')](config[_0xacd3('0x1c')],'server/files/attachments/'));},'filename':function(_0x21ee5e,_0x268cdb,_0x5950b1){_0x5950b1(null,util[_0xacd3('0x1d')](_0xacd3('0x1e'),Date[_0xacd3('0x1f')](),_0x268cdb[_0xacd3('0x20')][_0xacd3('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xacd3('0x22'),upload[_0xacd3('0x23')](_0xacd3('0x24')),controller[_0xacd3('0x25')]);router['post'](_0xacd3('0x13'),auth[_0xacd3('0xf')](),controller['addMessage']);router[_0xacd3('0x26')](_0xacd3('0x27'),auth['isAuthenticated'](),interaction[_0xacd3('0x28')]('chat',_0xacd3('0x29')),controller[_0xacd3('0x2a')]);router['put']('/:id',auth[_0xacd3('0xb')](),interaction[_0xacd3('0x28')](_0xacd3('0x2b'),_0xacd3('0x2c')),controller[_0xacd3('0x2d')]);router['put'](_0xacd3('0x2e'),controller[_0xacd3('0x2f')]);router[_0xacd3('0x30')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xacd3('0x31')]);router[_0xacd3('0x30')](_0xacd3('0x32'),controller[_0xacd3('0x33')]);router[_0xacd3('0x34')](_0xacd3('0xe'),auth[_0xacd3('0xb')](),interaction[_0xacd3('0x28')]('chat',_0xacd3('0x35')),controller[_0xacd3('0x36')]);router[_0xacd3('0x34')](_0xacd3('0x27'),auth[_0xacd3('0xb')](),controller[_0xacd3('0x37')]);module[_0xacd3('0x38')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index d5872f5..753c2b1 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 _0xbcab=['sequelize','exports','medium','BOOLEAN','INTEGER'];(function(_0x2002d9,_0x420cc8){var _0x5de410=function(_0x141f4e){while(--_0x141f4e){_0x2002d9['push'](_0x2002d9['shift']());}};_0x5de410(++_0x420cc8);}(_0xbcab,0xfa));var _0xbbca=function(_0x564eec,_0x2174aa){_0x564eec=_0x564eec-0x0;var _0xb25d75=_0xbcab[_0x564eec];return _0xb25d75;};'use strict';var Sequelize=require(_0xbbca('0x0'));module[_0xbbca('0x1')]={'body':{'type':Sequelize['TEXT'](_0xbbca('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbbca('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xbbca('0x4')]}}; \ No newline at end of file +var _0x2631=['exports','TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x2dc87d,_0x2af71d){var _0x114c3e=function(_0x13bf43){while(--_0x13bf43){_0x2dc87d['push'](_0x2dc87d['shift']());}};_0x114c3e(++_0x2af71d);}(_0x2631,0x1e5));var _0x1263=function(_0x1f58b9,_0x45f198){_0x1f58b9=_0x1f58b9-0x0;var _0x5e851f=_0x2631[_0x1f58b9];return _0x5e851f;};'use strict';var Sequelize=require(_0x1263('0x0'));module[_0x1263('0x1')]={'body':{'type':Sequelize[_0x1263('0x2')](_0x1263('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1263('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1263('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index cc0cb78..44475cd 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 _0x1163=['push','FromId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','sendStatus','status','end','json','offset','undefined','limit','set','apply','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','filter','options','count','include','findAll','rows','catch','params','includeAll','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x1163,0x75));var _0x3116=function(_0x54b062,_0x264bb5){_0x54b062=_0x54b062-0x0;var _0x255e41=_0x1163[_0x54b062];return _0x255e41;};'use strict';var emlformat=require(_0x3116('0x0'));var rimraf=require(_0x3116('0x1'));var zipdir=require(_0x3116('0x2'));var jsonpatch=require(_0x3116('0x3'));var rp=require(_0x3116('0x4'));var moment=require(_0x3116('0x5'));var BPromise=require(_0x3116('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3116('0x7'));var sox=require(_0x3116('0x8'));var csv=require(_0x3116('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3116('0xa'));var _=require(_0x3116('0xb'));var squel=require(_0x3116('0xc'));var crypto=require(_0x3116('0xd'));var jsforce=require(_0x3116('0xe'));var deskjs=require(_0x3116('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3116('0x10'));var Papa=require(_0x3116('0x11'));var Redis=require(_0x3116('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3116('0x13'));var as=require(_0x3116('0x14'));var hardwareService=require(_0x3116('0x15'));var logger=require('../../config/logger')(_0x3116('0x16'));var utils=require('../../config/utils');var config=require(_0x3116('0x17'));var licenseUtil=require(_0x3116('0x18'));var db=require(_0x3116('0x19'))['db'];config[_0x3116('0x1a')]=_['defaults'](config[_0x3116('0x1a')],{'host':_0x3116('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x56c6eb,_0x42f4d1){_0x42f4d1=_0x42f4d1||0xcc;return function(_0x108447){if(_0x108447){return _0x56c6eb[_0x3116('0x1c')](_0x42f4d1);}return _0x56c6eb[_0x3116('0x1d')](_0x42f4d1)[_0x3116('0x1e')]();};}function respondWithResult(_0x14fc30,_0x19742f){_0x19742f=_0x19742f||0xc8;return function(_0xce2467){if(_0xce2467){return _0x14fc30[_0x3116('0x1d')](_0x19742f)[_0x3116('0x1f')](_0xce2467);}};}function respondWithFilteredResult(_0x4f2ddd,_0x2761d9){return function(_0x10ddaa){if(_0x10ddaa){var _0x564847=typeof _0x2761d9[_0x3116('0x20')]===_0x3116('0x21')&&typeof _0x2761d9[_0x3116('0x22')]===_0x3116('0x21');var _0x3a2dd5=_0x10ddaa['count'];var _0x5b2e90=_0x564847?0x0:_0x2761d9[_0x3116('0x20')];var _0x490e92=_0x564847?_0x10ddaa['count']:_0x2761d9['offset']+_0x2761d9[_0x3116('0x22')];var _0x56825b;if(_0x490e92>=_0x3a2dd5){_0x490e92=_0x3a2dd5;_0x56825b=0xc8;}else{_0x56825b=0xce;}_0x4f2ddd[_0x3116('0x1d')](_0x56825b);return _0x4f2ddd[_0x3116('0x23')]('Content-Range',_0x5b2e90+'-'+_0x490e92+'/'+_0x3a2dd5)[_0x3116('0x1f')](_0x10ddaa);}return null;};}function patchUpdates(_0x386d0c){return function(_0x5bcdee){try{jsonpatch[_0x3116('0x24')](_0x5bcdee,_0x386d0c,!![]);}catch(_0x122f24){return BPromise['reject'](_0x122f24);}return _0x5bcdee[_0x3116('0x25')]();};}function saveUpdates(_0x2295b9,_0x136874){return function(_0x2c802e){if(_0x2c802e){return _0x2c802e[_0x3116('0x26')](_0x2295b9)[_0x3116('0x27')](function(_0x1d48a5){return _0x1d48a5;});}return null;};}function removeEntity(_0x5069a5,_0x352a6d){return function(_0x15e553){if(_0x15e553){return _0x15e553[_0x3116('0x28')]()['then'](function(){_0x5069a5['status'](0xcc)[_0x3116('0x1e')]();});}};}function handleEntityNotFound(_0x1e26a4,_0x58c08e){return function(_0x4d38f7){if(!_0x4d38f7){_0x1e26a4[_0x3116('0x1c')](0x194);}return _0x4d38f7;};}function handleError(_0x2143b2,_0x42c292){_0x42c292=_0x42c292||0x1f4;return function(_0x8802a6){logger[_0x3116('0x29')](_0x8802a6[_0x3116('0x2a')]);if(_0x8802a6[_0x3116('0x2b')]){delete _0x8802a6[_0x3116('0x2b')];}_0x2143b2['status'](_0x42c292)[_0x3116('0x2c')](_0x8802a6);};}exports[_0x3116('0x2d')]=function(_0x2840ad,_0x11d5da){var _0x277bab={},_0x21cc38={},_0x2aaa81={'count':0x0,'rows':[]};var _0x1115a0=_[_0x3116('0x2e')](db[_0x3116('0x2f')][_0x3116('0x30')],function(_0x411a3b){return{'name':_0x411a3b['fieldName'],'type':_0x411a3b[_0x3116('0x31')][_0x3116('0x32')]};});_0x21cc38[_0x3116('0x33')]=_[_0x3116('0x2e')](_0x1115a0,_0x3116('0x2b'));_0x21cc38[_0x3116('0x34')]=_[_0x3116('0x35')](_0x2840ad[_0x3116('0x34')]);_0x21cc38[_0x3116('0x36')]=_[_0x3116('0x37')](_0x21cc38[_0x3116('0x33')],_0x21cc38[_0x3116('0x34')]);_0x277bab['attributes']=_[_0x3116('0x37')](_0x21cc38[_0x3116('0x33')],qs[_0x3116('0x38')](_0x2840ad['query'][_0x3116('0x38')]));_0x277bab[_0x3116('0x39')]=_0x277bab[_0x3116('0x39')][_0x3116('0x3a')]?_0x277bab[_0x3116('0x39')]:_0x21cc38[_0x3116('0x33')];if(!_0x2840ad['query'][_0x3116('0x3b')](_0x3116('0x3c'))){_0x277bab[_0x3116('0x22')]=qs[_0x3116('0x22')](_0x2840ad[_0x3116('0x34')]['limit']);_0x277bab[_0x3116('0x20')]=qs[_0x3116('0x20')](_0x2840ad['query'][_0x3116('0x20')]);}_0x277bab[_0x3116('0x3d')]=qs[_0x3116('0x3e')](_0x2840ad[_0x3116('0x34')]['sort']);_0x277bab['where']=qs['filters'](_[_0x3116('0x3f')](_0x2840ad[_0x3116('0x34')],_0x21cc38[_0x3116('0x36')]),_0x1115a0);if(_0x2840ad[_0x3116('0x34')]['filter']){_0x277bab['where']=_[_0x3116('0x40')](_0x277bab[_0x3116('0x41')],{'$or':_[_0x3116('0x2e')](_0x1115a0,function(_0x34bce0){if(_0x34bce0[_0x3116('0x31')]!=='VIRTUAL'){var _0x2879ea={};_0x2879ea[_0x34bce0[_0x3116('0x2b')]]={'$like':'%'+_0x2840ad[_0x3116('0x34')][_0x3116('0x42')]+'%'};return _0x2879ea;}})});}_0x277bab=_[_0x3116('0x40')]({},_0x277bab,_0x2840ad[_0x3116('0x43')]);var _0x3cf417={'where':_0x277bab['where']};return db[_0x3116('0x2f')][_0x3116('0x44')](_0x3cf417)[_0x3116('0x27')](function(_0x568b1e){_0x2aaa81[_0x3116('0x44')]=_0x568b1e;if(_0x2840ad[_0x3116('0x34')]['includeAll']){_0x277bab[_0x3116('0x45')]=[{'all':!![]}];}return db[_0x3116('0x2f')][_0x3116('0x46')](_0x277bab);})['then'](function(_0x2dafc3){_0x2aaa81[_0x3116('0x47')]=_0x2dafc3;return _0x2aaa81;})[_0x3116('0x27')](respondWithFilteredResult(_0x11d5da,_0x277bab))[_0x3116('0x48')](handleError(_0x11d5da,null));};exports['show']=function(_0x4e26d5,_0x81cc04){var _0x13a8db={'raw':!![],'where':{'id':_0x4e26d5[_0x3116('0x49')]['id']}},_0x4fd881={};_0x4fd881[_0x3116('0x33')]=_['keys'](db[_0x3116('0x2f')]['rawAttributes']);_0x4fd881[_0x3116('0x34')]=_[_0x3116('0x35')](_0x4e26d5[_0x3116('0x34')]);_0x4fd881[_0x3116('0x36')]=_['intersection'](_0x4fd881[_0x3116('0x33')],_0x4fd881[_0x3116('0x34')]);_0x13a8db[_0x3116('0x39')]=_['intersection'](_0x4fd881[_0x3116('0x33')],qs[_0x3116('0x38')](_0x4e26d5[_0x3116('0x34')]['fields']));_0x13a8db[_0x3116('0x39')]=_0x13a8db[_0x3116('0x39')][_0x3116('0x3a')]?_0x13a8db[_0x3116('0x39')]:_0x4fd881[_0x3116('0x33')];if(_0x4e26d5['query'][_0x3116('0x4a')]){_0x13a8db['include']=[{'all':!![]}];}_0x13a8db=_[_0x3116('0x40')]({},_0x13a8db,_0x4e26d5[_0x3116('0x43')]);return db[_0x3116('0x2f')][_0x3116('0x4b')](_0x13a8db)[_0x3116('0x27')](handleEntityNotFound(_0x81cc04,null))[_0x3116('0x27')](respondWithResult(_0x81cc04,null))[_0x3116('0x48')](handleError(_0x81cc04,null));};exports[_0x3116('0x4c')]=function(_0x301baa,_0x5b28f4){return db[_0x3116('0x2f')]['create'](_0x301baa['body'],{})[_0x3116('0x27')](respondWithResult(_0x5b28f4,0xc9))['catch'](handleError(_0x5b28f4,null));};exports[_0x3116('0x26')]=function(_0x2b43a2,_0x3d86e0){if(_0x2b43a2[_0x3116('0x4d')]['id']){delete _0x2b43a2[_0x3116('0x4d')]['id'];}return db['ChatInternalMessage'][_0x3116('0x4b')]({'where':{'id':_0x2b43a2['params']['id']}})[_0x3116('0x27')](handleEntityNotFound(_0x3d86e0,null))[_0x3116('0x27')](saveUpdates(_0x2b43a2[_0x3116('0x4d')],null))[_0x3116('0x27')](respondWithResult(_0x3d86e0,null))[_0x3116('0x48')](handleError(_0x3d86e0,null));};exports[_0x3116('0x28')]=function(_0xeb0687,_0x480cc6){return db[_0x3116('0x2f')][_0x3116('0x4b')]({'where':{'id':_0xeb0687[_0x3116('0x49')]['id']}})[_0x3116('0x27')](handleEntityNotFound(_0x480cc6,null))[_0x3116('0x27')](removeEntity(_0x480cc6,null))[_0x3116('0x48')](handleError(_0x480cc6,null));};exports[_0x3116('0x4e')]=function(_0x3792dc,_0x58a17c){return db[_0x3116('0x2f')][_0x3116('0x4e')]()[_0x3116('0x27')](respondWithResult(_0x58a17c,null))['catch'](handleError(_0x58a17c,null));};function wrapUser(_0x52cf7f){return function(_0x3effbf){var _0x491332=_0x52cf7f[_0x3116('0x4f')]({'plain':!![]});_0x491332[_0x3116('0x50')]=[];if(_0x3effbf){_0x491332[_0x3116('0x51')]=_0x3effbf[_0x3116('0x52')];_0x491332[_0x3116('0x53')]=_0x3effbf;}else{_0x491332['lastMessageAt']=moment(0x0)[_0x3116('0x54')](_0x3116('0x55'));_0x491332[_0x3116('0x53')]={};}return _0x491332;};}exports[_0x3116('0x56')]=function(_0x456b6a,_0x40be1b,_0x2e4cc5){var _0x4541ef=[];return db[_0x3116('0x57')][_0x3116('0x46')]({'where':{'role':[_0x3116('0x58'),_0x3116('0x59'),_0x3116('0x5a')]},'attributes':['id',_0x3116('0x5b'),_0x3116('0x2b'),_0x3116('0x5c'),'userpic',_0x3116('0x5d'),_0x3116('0x5e'),_0x3116('0x5f'),_0x3116('0x60'),_0x3116('0x61')],'order':qs[_0x3116('0x3e')](_0x3116('0x62')),'include':[{'model':db[_0x3116('0x63')],'as':'VoiceQueues','attributes':['id',_0x3116('0x2b'),_0x3116('0x31')],'through':{'attributes':[]}}]})[_0x3116('0x27')](function(_0x3b2688){if(_0x3b2688){var _0x14340b=_0x456b6a['user'][_0x3116('0x4f')]({'plain':!![]});if(!_0x14340b)throw new Error(_0x3116('0x64'));if(_0x14340b[_0x3116('0x5c')]===_0x3116('0x5a')){return db[_0x3116('0x65')]['find']({'where':{'name':_0x3116('0x66'),'userProfileId':_0x14340b['userProfileId']},'raw':!![]})['then'](function(_0x43c0d7){if(_0x43c0d7){if(_0x43c0d7[_0x3116('0x67')]===0x0){return db[_0x3116('0x68')][_0x3116('0x46')]({'where':{'sectionId':_0x43c0d7['id']},'raw':!![]})['then'](function(_0x5b8086){var _0xd97a34=[];if(_[_0x3116('0x69')](_0x5b8086)){_0xd97a34=_[_0x3116('0x42')](_0x3b2688,function(_0xe8a6a2){if(_0xe8a6a2[_0x3116('0x5c')]!==_0x3116('0x58')){return _0xe8a6a2;}});return _0xd97a34;}else{for(var _0x19354f=0x0;_0x19354f<_0x3b2688['length'];_0x19354f++){var _0x134435=_0x3b2688[_0x19354f];if(_0x134435[_0x3116('0x5c')]===_0x3116('0x58')){var _0x372ea1=_['find'](_0x5b8086,function(_0x1e7a9c){return _0x1e7a9c[_0x3116('0x6a')]===_0x134435['id'];});if(_0x372ea1)_0xd97a34['push'](_0x134435);}else{_0xd97a34[_0x3116('0x6b')](_0x134435);}}return _0xd97a34;}});}else{return _0x3b2688;}}else{var _0xcb6790=_[_0x3116('0x42')](_0x3b2688,function(_0x7b26be){if(_0x7b26be[_0x3116('0x5c')]!==_0x3116('0x58')){return _0x7b26be;}});return _0xcb6790;}});}else{return _0x3b2688;}}})[_0x3116('0x27')](function(_0x3ca73e){var _0x11f909=[];if(_0x3ca73e){_0x4541ef=_0x3ca73e;for(var _0x2c4425=0x0;_0x2c4425<_0x3ca73e[_0x3116('0x3a')];_0x2c4425+=0x1){_0x4541ef[_0x2c4425][_0x3116('0x50')]=[];_0x11f909[_0x3116('0x6b')](db['ChatInternalMessage'][_0x3116('0x4b')]({'where':{'FromId':[_0x456b6a[_0x3116('0x5a')]['id'],_0x3ca73e[_0x2c4425]['id']],'ToId':[_0x456b6a[_0x3116('0x5a')]['id'],_0x3ca73e[_0x2c4425]['id']],'ChatGroupId':null},'attributes':['id',_0x3116('0x52'),_0x3116('0x6c'),'ToId',_0x3116('0x6d'),_0x3116('0x4d')],'order':qs[_0x3116('0x3e')](_0x3116('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3116('0x27')](wrapUser(_0x3ca73e[_0x2c4425])));}return BPromise[_0x3116('0x6f')](_0x11f909);}return[];})[_0x3116('0x27')](function(_0xddde94){return{'rows':_0xddde94,'count':_0xddde94[_0x3116('0x3a')]};})[_0x3116('0x27')](respondWithResult(_0x40be1b,null))[_0x3116('0x48')](handleError(_0x40be1b,null));}; \ No newline at end of file +var _0x9edb=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','./chatInternalMessage.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','find','body','params','get','messages','lastMessageAt','format','lastMessage','agent','admin','user','fullname','role','userpic','lastLoginAt','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','isEmpty','resourceId','push','createdAt','ToId','-createdAt','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x7dfb12,_0x3ced28){var _0x5116b6=function(_0x4f5b47){while(--_0x4f5b47){_0x7dfb12['push'](_0x7dfb12['shift']());}};_0x5116b6(++_0x3ced28);}(_0x9edb,0x18a));var _0xb9ed=function(_0x3b06f5,_0x2c5389){_0x3b06f5=_0x3b06f5-0x0;var _0x5208c2=_0x9edb[_0x3b06f5];return _0x5208c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9ed('0x0'));var zipdir=require(_0xb9ed('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9ed('0x2'));var moment=require(_0xb9ed('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb9ed('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xb9ed('0x5'));var ejs=require(_0xb9ed('0x6'));var fs=require('fs');var fs_extra=require(_0xb9ed('0x7'));var _=require(_0xb9ed('0x8'));var squel=require(_0xb9ed('0x9'));var crypto=require(_0xb9ed('0xa'));var jsforce=require(_0xb9ed('0xb'));var deskjs=require(_0xb9ed('0xc'));var toCsv=require(_0xb9ed('0x5'));var querystring=require(_0xb9ed('0xd'));var Papa=require(_0xb9ed('0xe'));var Redis=require(_0xb9ed('0xf'));var authService=require(_0xb9ed('0x10'));var qs=require(_0xb9ed('0x11'));var as=require(_0xb9ed('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9ed('0x13'))(_0xb9ed('0x14'));var utils=require('../../config/utils');var config=require(_0xb9ed('0x15'));var licenseUtil=require(_0xb9ed('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb9ed('0x17')](config[_0xb9ed('0x18')],{'host':_0xb9ed('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb9ed('0x18')]));require(_0xb9ed('0x1a'))[_0xb9ed('0x1b')](socket);function respondWithStatusCode(_0xa03ac0,_0x134b9d){_0x134b9d=_0x134b9d||0xcc;return function(_0x3976ab){if(_0x3976ab){return _0xa03ac0['sendStatus'](_0x134b9d);}return _0xa03ac0[_0xb9ed('0x1c')](_0x134b9d)['end']();};}function respondWithResult(_0x5673eb,_0x2766b1){_0x2766b1=_0x2766b1||0xc8;return function(_0x30cbb9){if(_0x30cbb9){return _0x5673eb['status'](_0x2766b1)[_0xb9ed('0x1d')](_0x30cbb9);}};}function respondWithFilteredResult(_0x35694f,_0x16e7ba){return function(_0x34b9c5){if(_0x34b9c5){var _0x58a01e=typeof _0x16e7ba[_0xb9ed('0x1e')]===_0xb9ed('0x1f')&&typeof _0x16e7ba[_0xb9ed('0x20')]===_0xb9ed('0x1f');var _0x2779c5=_0x34b9c5['count'];var _0x4a03cd=_0x58a01e?0x0:_0x16e7ba[_0xb9ed('0x1e')];var _0x3f90e0=_0x58a01e?_0x34b9c5[_0xb9ed('0x21')]:_0x16e7ba[_0xb9ed('0x1e')]+_0x16e7ba[_0xb9ed('0x20')];var _0xf35ee6;if(_0x3f90e0>=_0x2779c5){_0x3f90e0=_0x2779c5;_0xf35ee6=0xc8;}else{_0xf35ee6=0xce;}_0x35694f[_0xb9ed('0x1c')](_0xf35ee6);return _0x35694f[_0xb9ed('0x22')](_0xb9ed('0x23'),_0x4a03cd+'-'+_0x3f90e0+'/'+_0x2779c5)['json'](_0x34b9c5);}return null;};}function patchUpdates(_0x25235e){return function(_0xfbfbee){try{jsonpatch[_0xb9ed('0x24')](_0xfbfbee,_0x25235e,!![]);}catch(_0x3e0827){return BPromise[_0xb9ed('0x25')](_0x3e0827);}return _0xfbfbee[_0xb9ed('0x26')]();};}function saveUpdates(_0x2a9d3e,_0x429396){return function(_0x3ef6ba){if(_0x3ef6ba){return _0x3ef6ba[_0xb9ed('0x27')](_0x2a9d3e)[_0xb9ed('0x28')](function(_0xac69c2){return _0xac69c2;});}return null;};}function removeEntity(_0x189b5d,_0x25c9e3){return function(_0x11a7ae){if(_0x11a7ae){return _0x11a7ae[_0xb9ed('0x29')]()[_0xb9ed('0x28')](function(){_0x189b5d[_0xb9ed('0x1c')](0xcc)[_0xb9ed('0x2a')]();});}};}function handleEntityNotFound(_0x428603,_0x50a0d0){return function(_0x302d17){if(!_0x302d17){_0x428603[_0xb9ed('0x2b')](0x194);}return _0x302d17;};}function handleError(_0x306d2f,_0x24370c){_0x24370c=_0x24370c||0x1f4;return function(_0x4f031f){logger[_0xb9ed('0x2c')](_0x4f031f['stack']);if(_0x4f031f['name']){delete _0x4f031f[_0xb9ed('0x2d')];}_0x306d2f['status'](_0x24370c)['send'](_0x4f031f);};}exports[_0xb9ed('0x2e')]=function(_0x542226,_0x29488c){var _0x5cefbb={},_0x1e1fd7={},_0x4bf994={'count':0x0,'rows':[]};var _0x39adaf=_[_0xb9ed('0x2f')](db['ChatInternalMessage'][_0xb9ed('0x30')],function(_0x45d14e){return{'name':_0x45d14e['fieldName'],'type':_0x45d14e[_0xb9ed('0x31')][_0xb9ed('0x32')]};});_0x1e1fd7[_0xb9ed('0x33')]=_[_0xb9ed('0x2f')](_0x39adaf,'name');_0x1e1fd7[_0xb9ed('0x34')]=_[_0xb9ed('0x35')](_0x542226[_0xb9ed('0x34')]);_0x1e1fd7[_0xb9ed('0x36')]=_['intersection'](_0x1e1fd7['model'],_0x1e1fd7[_0xb9ed('0x34')]);_0x5cefbb[_0xb9ed('0x37')]=_[_0xb9ed('0x38')](_0x1e1fd7[_0xb9ed('0x33')],qs[_0xb9ed('0x39')](_0x542226[_0xb9ed('0x34')][_0xb9ed('0x39')]));_0x5cefbb[_0xb9ed('0x37')]=_0x5cefbb['attributes'][_0xb9ed('0x3a')]?_0x5cefbb[_0xb9ed('0x37')]:_0x1e1fd7['model'];if(!_0x542226['query'][_0xb9ed('0x3b')]('nolimit')){_0x5cefbb[_0xb9ed('0x20')]=qs['limit'](_0x542226[_0xb9ed('0x34')]['limit']);_0x5cefbb['offset']=qs[_0xb9ed('0x1e')](_0x542226[_0xb9ed('0x34')][_0xb9ed('0x1e')]);}_0x5cefbb[_0xb9ed('0x3c')]=qs[_0xb9ed('0x3d')](_0x542226[_0xb9ed('0x34')]['sort']);_0x5cefbb[_0xb9ed('0x3e')]=qs[_0xb9ed('0x36')](_[_0xb9ed('0x3f')](_0x542226[_0xb9ed('0x34')],_0x1e1fd7[_0xb9ed('0x36')]),_0x39adaf);if(_0x542226[_0xb9ed('0x34')]['filter']){_0x5cefbb[_0xb9ed('0x3e')]=_[_0xb9ed('0x40')](_0x5cefbb['where'],{'$or':_[_0xb9ed('0x2f')](_0x39adaf,function(_0x590da2){if(_0x590da2[_0xb9ed('0x31')]!=='VIRTUAL'){var _0x38b562={};_0x38b562[_0x590da2['name']]={'$like':'%'+_0x542226[_0xb9ed('0x34')][_0xb9ed('0x41')]+'%'};return _0x38b562;}})});}_0x5cefbb=_[_0xb9ed('0x40')]({},_0x5cefbb,_0x542226[_0xb9ed('0x42')]);var _0xcc31a2={'where':_0x5cefbb[_0xb9ed('0x3e')]};return db[_0xb9ed('0x43')]['count'](_0xcc31a2)['then'](function(_0x2a047a){_0x4bf994[_0xb9ed('0x21')]=_0x2a047a;if(_0x542226[_0xb9ed('0x34')][_0xb9ed('0x44')]){_0x5cefbb[_0xb9ed('0x45')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xb9ed('0x46')](_0x5cefbb);})[_0xb9ed('0x28')](function(_0x199cf9){_0x4bf994[_0xb9ed('0x47')]=_0x199cf9;return _0x4bf994;})['then'](respondWithFilteredResult(_0x29488c,_0x5cefbb))[_0xb9ed('0x48')](handleError(_0x29488c,null));};exports[_0xb9ed('0x49')]=function(_0x2b524e,_0x4e039f){var _0x33041d={'raw':!![],'where':{'id':_0x2b524e['params']['id']}},_0x491069={};_0x491069[_0xb9ed('0x33')]=_[_0xb9ed('0x35')](db[_0xb9ed('0x43')][_0xb9ed('0x30')]);_0x491069[_0xb9ed('0x34')]=_[_0xb9ed('0x35')](_0x2b524e[_0xb9ed('0x34')]);_0x491069['filters']=_[_0xb9ed('0x38')](_0x491069[_0xb9ed('0x33')],_0x491069['query']);_0x33041d['attributes']=_['intersection'](_0x491069[_0xb9ed('0x33')],qs[_0xb9ed('0x39')](_0x2b524e[_0xb9ed('0x34')]['fields']));_0x33041d['attributes']=_0x33041d['attributes'][_0xb9ed('0x3a')]?_0x33041d[_0xb9ed('0x37')]:_0x491069[_0xb9ed('0x33')];if(_0x2b524e['query'][_0xb9ed('0x44')]){_0x33041d[_0xb9ed('0x45')]=[{'all':!![]}];}_0x33041d=_[_0xb9ed('0x40')]({},_0x33041d,_0x2b524e[_0xb9ed('0x42')]);return db[_0xb9ed('0x43')][_0xb9ed('0x4a')](_0x33041d)[_0xb9ed('0x28')](handleEntityNotFound(_0x4e039f,null))['then'](respondWithResult(_0x4e039f,null))[_0xb9ed('0x48')](handleError(_0x4e039f,null));};exports['create']=function(_0x42857d,_0x1c1327){return db[_0xb9ed('0x43')]['create'](_0x42857d[_0xb9ed('0x4b')],{})[_0xb9ed('0x28')](respondWithResult(_0x1c1327,0xc9))[_0xb9ed('0x48')](handleError(_0x1c1327,null));};exports[_0xb9ed('0x27')]=function(_0x1f09bf,_0x48fe02){if(_0x1f09bf['body']['id']){delete _0x1f09bf[_0xb9ed('0x4b')]['id'];}return db[_0xb9ed('0x43')][_0xb9ed('0x4a')]({'where':{'id':_0x1f09bf[_0xb9ed('0x4c')]['id']}})[_0xb9ed('0x28')](handleEntityNotFound(_0x48fe02,null))[_0xb9ed('0x28')](saveUpdates(_0x1f09bf[_0xb9ed('0x4b')],null))[_0xb9ed('0x28')](respondWithResult(_0x48fe02,null))[_0xb9ed('0x48')](handleError(_0x48fe02,null));};exports[_0xb9ed('0x29')]=function(_0x4ba18f,_0x304f64){return db[_0xb9ed('0x43')][_0xb9ed('0x4a')]({'where':{'id':_0x4ba18f['params']['id']}})[_0xb9ed('0x28')](handleEntityNotFound(_0x304f64,null))[_0xb9ed('0x28')](removeEntity(_0x304f64,null))[_0xb9ed('0x48')](handleError(_0x304f64,null));};exports['describe']=function(_0x310ab6,_0x4e5fe0){return db[_0xb9ed('0x43')]['describe']()[_0xb9ed('0x28')](respondWithResult(_0x4e5fe0,null))[_0xb9ed('0x48')](handleError(_0x4e5fe0,null));};function wrapUser(_0x2e90fe){return function(_0x73ac36){var _0x23401b=_0x2e90fe[_0xb9ed('0x4d')]({'plain':!![]});_0x23401b[_0xb9ed('0x4e')]=[];if(_0x73ac36){_0x23401b[_0xb9ed('0x4f')]=_0x73ac36['createdAt'];_0x23401b['lastMessage']=_0x73ac36;}else{_0x23401b[_0xb9ed('0x4f')]=moment(0x0)[_0xb9ed('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x23401b[_0xb9ed('0x51')]={};}return _0x23401b;};}exports['getUsers']=function(_0x1abbad,_0x42d8a1,_0x5bb642){var _0x22a8c7=[];return db['User'][_0xb9ed('0x46')]({'where':{'role':[_0xb9ed('0x52'),_0xb9ed('0x53'),_0xb9ed('0x54')]},'attributes':['id',_0xb9ed('0x55'),_0xb9ed('0x2d'),_0xb9ed('0x56'),_0xb9ed('0x57'),'internal','online',_0xb9ed('0x58'),'allowmessenger',_0xb9ed('0x59')],'order':qs[_0xb9ed('0x3d')](_0xb9ed('0x5a')),'include':[{'model':db[_0xb9ed('0x5b')],'as':'VoiceQueues','attributes':['id','name',_0xb9ed('0x31')],'through':{'attributes':[]}}]})[_0xb9ed('0x28')](function(_0x410f3f){if(_0x410f3f){var _0x54b779=_0x1abbad[_0xb9ed('0x54')]['get']({'plain':!![]});if(!_0x54b779)throw new Error(_0xb9ed('0x5c'));if(_0x54b779[_0xb9ed('0x56')]===_0xb9ed('0x54')){return db['UserProfileSection'][_0xb9ed('0x4a')]({'where':{'name':_0xb9ed('0x5d'),'userProfileId':_0x54b779[_0xb9ed('0x5e')]},'raw':!![]})['then'](function(_0x53703b){if(_0x53703b){if(_0x53703b['autoAssociation']===0x0){return db['UserProfileResource'][_0xb9ed('0x46')]({'where':{'sectionId':_0x53703b['id']},'raw':!![]})[_0xb9ed('0x28')](function(_0xea56cb){var _0x2fbf1d=[];if(_[_0xb9ed('0x5f')](_0xea56cb)){_0x2fbf1d=_[_0xb9ed('0x41')](_0x410f3f,function(_0x5036f3){if(_0x5036f3[_0xb9ed('0x56')]!=='agent'){return _0x5036f3;}});return _0x2fbf1d;}else{for(var _0x928b=0x0;_0x928b<_0x410f3f[_0xb9ed('0x3a')];_0x928b++){var _0x2aa4d7=_0x410f3f[_0x928b];if(_0x2aa4d7['role']===_0xb9ed('0x52')){var _0x2e6ed3=_[_0xb9ed('0x4a')](_0xea56cb,function(_0x42d4e9){return _0x42d4e9[_0xb9ed('0x60')]===_0x2aa4d7['id'];});if(_0x2e6ed3)_0x2fbf1d['push'](_0x2aa4d7);}else{_0x2fbf1d[_0xb9ed('0x61')](_0x2aa4d7);}}return _0x2fbf1d;}});}else{return _0x410f3f;}}else{var _0x47edc0=_[_0xb9ed('0x41')](_0x410f3f,function(_0x26e118){if(_0x26e118['role']!==_0xb9ed('0x52')){return _0x26e118;}});return _0x47edc0;}});}else{return _0x410f3f;}}})[_0xb9ed('0x28')](function(_0x48b4de){var _0x5a39de=[];if(_0x48b4de){_0x22a8c7=_0x48b4de;for(var _0x1fe2a7=0x0;_0x1fe2a7<_0x48b4de[_0xb9ed('0x3a')];_0x1fe2a7+=0x1){_0x22a8c7[_0x1fe2a7][_0xb9ed('0x4e')]=[];_0x5a39de[_0xb9ed('0x61')](db['ChatInternalMessage'][_0xb9ed('0x4a')]({'where':{'FromId':[_0x1abbad[_0xb9ed('0x54')]['id'],_0x48b4de[_0x1fe2a7]['id']],'ToId':[_0x1abbad['user']['id'],_0x48b4de[_0x1fe2a7]['id']],'ChatGroupId':null},'attributes':['id',_0xb9ed('0x62'),'FromId',_0xb9ed('0x63'),'read','body'],'order':qs[_0xb9ed('0x3d')](_0xb9ed('0x64')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x48b4de[_0x1fe2a7])));}return BPromise['all'](_0x5a39de);}return[];})[_0xb9ed('0x28')](function(_0x374c59){return{'rows':_0x374c59,'count':_0x374c59[_0xb9ed('0x3a')]};})[_0xb9ed('0x28')](respondWithResult(_0x42d8a1,null))[_0xb9ed('0x48')](handleError(_0x42d8a1,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index df6eb93..4314068 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 _0x95b5=['ChatInternalMessage','emit','events'];(function(_0x31257f,_0x2cde2f){var _0x4dfd9c=function(_0x14eee2){while(--_0x14eee2){_0x31257f['push'](_0x31257f['shift']());}};_0x4dfd9c(++_0x2cde2f);}(_0x95b5,0x143));var _0x595b=function(_0x42eb51,_0xafa7f2){_0x42eb51=_0x42eb51-0x0;var _0x403569=_0x95b5[_0x42eb51];return _0x403569;};'use strict';var EventEmitter=require(_0x595b('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x595b('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x51d0e0){return function(_0x4cb5e0,_0x2ed85e,_0x2fc380){ChatInternalMessageEvents[_0x595b('0x2')](_0x51d0e0+':'+_0x4cb5e0['id'],_0x4cb5e0);ChatInternalMessageEvents[_0x595b('0x2')](_0x51d0e0,_0x4cb5e0);_0x2fc380(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x144e=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x5123df,_0x58b731){var _0x3cd7e8=function(_0x37c18b){while(--_0x37c18b){_0x5123df['push'](_0x5123df['shift']());}};_0x3cd7e8(++_0x58b731);}(_0x144e,0x151));var _0xe144=function(_0x33a589,_0x1c40a0){_0x33a589=_0x33a589-0x0;var _0x1bf519=_0x144e[_0x33a589];return _0x1bf519;};'use strict';var EventEmitter=require(_0xe144('0x0'));var ChatInternalMessage=require(_0xe144('0x1'))['db'][_0xe144('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe144('0x3')](0x0);var events={'afterCreate':_0xe144('0x4'),'afterUpdate':_0xe144('0x5'),'afterDestroy':_0xe144('0x6')};function emitEvent(_0x1d4c43){return function(_0x248705,_0x5dc247,_0x19cc16){ChatInternalMessageEvents['emit'](_0x1d4c43+':'+_0x248705['id'],_0x248705);ChatInternalMessageEvents[_0xe144('0x7')](_0x1d4c43,_0x248705);_0x19cc16(null);};}for(var e in events){if(events[_0xe144('0x8')](e)){var event=events[e];ChatInternalMessage[_0xe144('0x9')](e,emitEvent(event));}}module[_0xe144('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 6660179..6d1b666 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 _0x2273=['path','rimraf','exports','define','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4ef1b2,_0x9debd8){var _0x36848c=function(_0x4bbb82){while(--_0x4bbb82){_0x4ef1b2['push'](_0x4ef1b2['shift']());}};_0x36848c(++_0x9debd8);}(_0x2273,0x1f4));var _0x3227=function(_0x425652,_0x385b12){_0x425652=_0x425652-0x0;var _0x4644d0=_0x2273[_0x425652];return _0x4644d0;};'use strict';var _=require(_0x3227('0x0'));var util=require(_0x3227('0x1'));var logger=require(_0x3227('0x2'))(_0x3227('0x3'));var moment=require(_0x3227('0x4'));var BPromise=require(_0x3227('0x5'));var rp=require(_0x3227('0x6'));var fs=require('fs');var path=require(_0x3227('0x7'));var rimraf=require(_0x3227('0x8'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x3227('0x9')]=function(_0x4234cc,_0x5d2405){return _0x4234cc[_0x3227('0xa')]('ChatInternalMessage',attributes,{'tableName':_0x3227('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3227('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2cff=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x2cff,0xa3));var _0xf2cf=function(_0x436cb5,_0x2cb52a){_0x436cb5=_0x436cb5-0x0;var _0x57bb18=_0x2cff[_0x436cb5];return _0x57bb18;};'use strict';var _=require(_0xf2cf('0x0'));var util=require(_0xf2cf('0x1'));var logger=require(_0xf2cf('0x2'))(_0xf2cf('0x3'));var moment=require(_0xf2cf('0x4'));var BPromise=require(_0xf2cf('0x5'));var rp=require(_0xf2cf('0x6'));var fs=require('fs');var path=require(_0xf2cf('0x7'));var rimraf=require('rimraf');var config=require(_0xf2cf('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0xf2cf('0x9')]=function(_0xb5d5b8,_0x157084){return _0xb5d5b8[_0xf2cf('0xa')](_0xf2cf('0xb'),attributes,{'tableName':_0xf2cf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf2cf('0xd'),'collate':_0xf2cf('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index f4b9b5b..2b74e39 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 _0xf0e5=['http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0xf0e5,0x1e3));var _0x5f0e=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xf0e5[_0x525c7b];return _0x27b33e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5f0e('0x0'));var BPromise=require(_0x5f0e('0x1'));var rs=require(_0x5f0e('0x2'));var fs=require('fs');var Redis=require(_0x5f0e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f0e('0x4'));var logger=require(_0x5f0e('0x5'))(_0x5f0e('0x6'));var config=require(_0x5f0e('0x7'));var jayson=require(_0x5f0e('0x8'));var client=jayson[_0x5f0e('0x9')][_0x5f0e('0xa')]({'port':0x232a});config[_0x5f0e('0xb')]=_[_0x5f0e('0xc')](config[_0x5f0e('0xb')],{'host':_0x5f0e('0xd'),'port':0x18eb});var socket=require(_0x5f0e('0xe'))(new Redis(config['redis']));require(_0x5f0e('0xf'))['register'](socket);function respondWithRpcPromise(_0x385655,_0x5f4119,_0x4e663c){return new BPromise(function(_0x15ad40,_0x3f5296){return client[_0x5f0e('0x10')](_0x385655,_0x4e663c)[_0x5f0e('0x11')](function(_0x3168fe){logger[_0x5f0e('0x12')](_0x5f0e('0x13'),_0x5f4119,'request\x20sent');logger[_0x5f0e('0x14')](_0x5f0e('0x15'),_0x5f4119,_0x5f0e('0x16'),JSON[_0x5f0e('0x17')](_0x3168fe));if(_0x3168fe[_0x5f0e('0x18')]){if(_0x3168fe['error'][_0x5f0e('0x19')]===0x1f4){logger[_0x5f0e('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x5f4119,_0x3168fe[_0x5f0e('0x18')][_0x5f0e('0x1a')]);return _0x3f5296(_0x3168fe[_0x5f0e('0x18')][_0x5f0e('0x1a')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x5f4119,_0x3168fe['error'][_0x5f0e('0x1a')]);return _0x15ad40(_0x3168fe['error'][_0x5f0e('0x1a')]);}else{logger[_0x5f0e('0x12')](_0x5f0e('0x13'),_0x5f4119,'request\x20sent');_0x15ad40(_0x3168fe[_0x5f0e('0x1b')]['message']);}})[_0x5f0e('0x1c')](function(_0x5a96ab){logger['error'](_0x5f0e('0x13'),_0x5f4119,_0x5a96ab);_0x3f5296(_0x5a96ab);});});} \ No newline at end of file +var _0x063a=['code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x4c8542,_0x5a0c53){var _0x5b95c7=function(_0xac1ef4){while(--_0xac1ef4){_0x4c8542['push'](_0x4c8542['shift']());}};_0x5b95c7(++_0x5a0c53);}(_0x063a,0x1e0));var _0xa063=function(_0x46a804,_0x4ef9d4){_0x46a804=_0x46a804-0x0;var _0x3fee7d=_0x063a[_0x46a804];return _0x3fee7d;};'use strict';var _=require(_0xa063('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa063('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa063('0x2'));var db=require(_0xa063('0x3'))['db'];var utils=require(_0xa063('0x4'));var logger=require(_0xa063('0x5'))(_0xa063('0x6'));var config=require('../../config/environment');var jayson=require(_0xa063('0x7'));var client=jayson[_0xa063('0x8')][_0xa063('0x9')]({'port':0x232a});config['redis']=_[_0xa063('0xa')](config[_0xa063('0xb')],{'host':_0xa063('0xc'),'port':0x18eb});var socket=require(_0xa063('0xd'))(new Redis(config[_0xa063('0xb')]));require(_0xa063('0xe'))[_0xa063('0xf')](socket);function respondWithRpcPromise(_0x15890b,_0x441320,_0x59b5e9){return new BPromise(function(_0x219450,_0x5c98aa){return client[_0xa063('0x10')](_0x15890b,_0x59b5e9)[_0xa063('0x11')](function(_0x272867){logger[_0xa063('0x12')](_0xa063('0x13'),_0x441320,_0xa063('0x14'));logger[_0xa063('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x441320,_0xa063('0x14'),JSON[_0xa063('0x16')](_0x272867));if(_0x272867[_0xa063('0x17')]){if(_0x272867['error'][_0xa063('0x18')]===0x1f4){logger[_0xa063('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x441320,_0x272867[_0xa063('0x17')][_0xa063('0x19')]);return _0x5c98aa(_0x272867['error'][_0xa063('0x19')]);}logger['error'](_0xa063('0x13'),_0x441320,_0x272867[_0xa063('0x17')][_0xa063('0x19')]);return _0x219450(_0x272867[_0xa063('0x17')][_0xa063('0x19')]);}else{logger[_0xa063('0x12')](_0xa063('0x13'),_0x441320,'request\x20sent');_0x219450(_0x272867[_0xa063('0x1a')][_0xa063('0x19')]);}})[_0xa063('0x1b')](function(_0x47e516){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x441320,_0x47e516);_0x5c98aa(_0x47e516);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 222dd65..59b6c43 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 _0x99ea=['./chatInternalMessage.events','remove','update','removeListener','length','chatInternalMessage:'];(function(_0x3f1bac,_0x569bb0){var _0x1330b0=function(_0x6967a0){while(--_0x6967a0){_0x3f1bac['push'](_0x3f1bac['shift']());}};_0x1330b0(++_0x569bb0);}(_0x99ea,0xba));var _0xa99e=function(_0x506d2f,_0x5ab76e){_0x506d2f=_0x506d2f-0x0;var _0x101255=_0x99ea[_0x506d2f];return _0x101255;};'use strict';var ChatInternalMessageEvents=require(_0xa99e('0x0'));var events=['save',_0xa99e('0x1'),_0xa99e('0x2')];function createListener(_0x4c1bec,_0x274f0b){return function(_0x251352){_0x274f0b['emit'](_0x4c1bec,_0x251352);};}function removeListener(_0xed3960,_0x54ec1f){return function(){ChatInternalMessageEvents[_0xa99e('0x3')](_0xed3960,_0x54ec1f);};}exports['register']=function(_0x107efc){for(var _0x232387=0x0,_0x1ee960=events[_0xa99e('0x4')];_0x232387<_0x1ee960;_0x232387++){var _0x1342d8=events[_0x232387];var _0x451d5c=createListener(_0xa99e('0x5')+_0x1342d8,_0x107efc);ChatInternalMessageEvents['on'](_0x1342d8,_0x451d5c);}}; \ No newline at end of file +var _0x6734=['register','length','chatInternalMessage:','save','remove','update','emit','removeListener'];(function(_0x3a36c6,_0x3c7581){var _0x42ebf6=function(_0x36c8c2){while(--_0x36c8c2){_0x3a36c6['push'](_0x3a36c6['shift']());}};_0x42ebf6(++_0x3c7581);}(_0x6734,0x73));var _0x4673=function(_0x170a07,_0x4917dc){_0x170a07=_0x170a07-0x0;var _0x4525f7=_0x6734[_0x170a07];return _0x4525f7;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x4673('0x0'),_0x4673('0x1'),_0x4673('0x2')];function createListener(_0x7afa99,_0x1857a9){return function(_0x468986){_0x1857a9[_0x4673('0x3')](_0x7afa99,_0x468986);};}function removeListener(_0x106468,_0x29596e){return function(){ChatInternalMessageEvents[_0x4673('0x4')](_0x106468,_0x29596e);};}exports[_0x4673('0x5')]=function(_0x3196c0){for(var _0x101e4a=0x0,_0x362ded=events[_0x4673('0x6')];_0x101e4a<_0x362ded;_0x101e4a++){var _0x363f8f=events[_0x101e4a];var _0xfe1e0a=createListener(_0x4673('0x7')+_0x363f8f,_0x3196c0);ChatInternalMessageEvents['on'](_0x363f8f,_0xfe1e0a);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index f718b26..c2ba066 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 _0xc67f=['getUsers','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users'];(function(_0x4e07fc,_0x4f0c53){var _0x41b52e=function(_0x5806be){while(--_0x5806be){_0x4e07fc['push'](_0x4e07fc['shift']());}};_0x41b52e(++_0x4f0c53);}(_0xc67f,0x99));var _0xfc67=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc67f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfc67('0x0'));var util=require(_0xfc67('0x1'));var path=require(_0xfc67('0x2'));var timeout=require(_0xfc67('0x3'));var express=require(_0xfc67('0x4'));var router=express['Router']();var fs_extra=require(_0xfc67('0x5'));var auth=require(_0xfc67('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfc67('0x7'));var controller=require(_0xfc67('0x8'));router[_0xfc67('0x9')]('/',auth[_0xfc67('0xa')](),controller[_0xfc67('0xb')]);router['get'](_0xfc67('0xc'),auth['isAuthenticated'](),controller[_0xfc67('0xd')]);router['get'](_0xfc67('0xe'),auth[_0xfc67('0xa')](),controller[_0xfc67('0xf')]);router['get']('/:id',auth[_0xfc67('0xa')](),controller[_0xfc67('0x10')]);router[_0xfc67('0x11')]('/',auth['isAuthenticated'](),controller[_0xfc67('0x12')]);router[_0xfc67('0x13')](_0xfc67('0x14'),controller[_0xfc67('0x15')]);router[_0xfc67('0x16')](_0xfc67('0x14'),auth[_0xfc67('0xa')](),controller['destroy']);module[_0xfc67('0x17')]=router; \ No newline at end of file +var _0x86bc=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0x86bc,0x1d4));var _0xc86b=function(_0x3069f0,_0x36ce37){_0x3069f0=_0x3069f0-0x0;var _0x359928=_0x86bc[_0x3069f0];return _0x359928;};'use strict';var multer=require(_0xc86b('0x0'));var util=require(_0xc86b('0x1'));var path=require(_0xc86b('0x2'));var timeout=require('connect-timeout');var express=require(_0xc86b('0x3'));var router=express[_0xc86b('0x4')]();var fs_extra=require(_0xc86b('0x5'));var auth=require(_0xc86b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc86b('0x7'));var controller=require(_0xc86b('0x8'));router[_0xc86b('0x9')]('/',auth[_0xc86b('0xa')](),controller[_0xc86b('0xb')]);router['get']('/describe',auth[_0xc86b('0xa')](),controller[_0xc86b('0xc')]);router[_0xc86b('0x9')](_0xc86b('0xd'),auth['isAuthenticated'](),controller[_0xc86b('0xe')]);router[_0xc86b('0x9')](_0xc86b('0xf'),auth['isAuthenticated'](),controller[_0xc86b('0x10')]);router[_0xc86b('0x11')]('/',auth['isAuthenticated'](),controller[_0xc86b('0x12')]);router[_0xc86b('0x13')](_0xc86b('0xf'),controller['update']);router[_0xc86b('0x14')](_0xc86b('0xf'),auth[_0xc86b('0xa')](),controller[_0xc86b('0x15')]);module[_0xc86b('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 6e33657..2b1441a 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 _0xf53d=['DATE','sequelize','exports','medium','BOOLEAN','out'];(function(_0xf22d54,_0x29825e){var _0x5cf46b=function(_0x27aec9){while(--_0x27aec9){_0xf22d54['push'](_0xf22d54['shift']());}};_0x5cf46b(++_0x29825e);}(_0xf53d,0x199));var _0xdf53=function(_0x30200f,_0x145299){_0x30200f=_0x30200f-0x0;var _0x3a69a4=_0xf53d[_0x30200f];return _0x3a69a4;};'use strict';var Sequelize=require(_0xdf53('0x0'));module[_0xdf53('0x1')]={'body':{'type':Sequelize['TEXT'](_0xdf53('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdf53('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xdf53('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xdf53('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xdf53('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xcbe1=['out','DATE','TEXT','exports','ENUM'];(function(_0x12fd37,_0x2a7063){var _0xd056c9=function(_0x507c79){while(--_0x507c79){_0x12fd37['push'](_0x12fd37['shift']());}};_0xd056c9(++_0x2a7063);}(_0xcbe1,0x1a2));var _0x1cbe=function(_0x237ead,_0x1869d8){_0x237ead=_0x237ead-0x0;var _0x3f78bf=_0xcbe1[_0x237ead];return _0x3f78bf;};'use strict';var Sequelize=require('sequelize');module[_0x1cbe('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1cbe('0x1')]('in',_0x1cbe('0x2')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x1cbe('0x3')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x1cbe('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index e9973e8..12da6d3 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 _0x2da9=['debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','undefined','limit','status','set','apply','reject','save','update','destroy','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','params','include','find','create','body','describe','chat-interactions','accept','chat','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','User','fullname','internal','manual','interface','channel','event','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','SELECT','contact','email','SIP/%s','motionChannel','EventManager','rejectmessage','rimraf','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','then','info','request\x20sent'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0x2da9,0x160));var _0x92da=function(_0x22c882,_0x15776d){_0x22c882=_0x22c882-0x0;var _0x147d77=_0x2da9[_0x22c882];return _0x147d77;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x92da('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x92da('0x1'));var BPromise=require(_0x92da('0x2'));var Mustache=require(_0x92da('0x3'));var util=require('util');var path=require(_0x92da('0x4'));var sox=require('sox');var csv=require(_0x92da('0x5'));var ejs=require(_0x92da('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92da('0x7'));var squel=require(_0x92da('0x8'));var crypto=require(_0x92da('0x9'));var jsforce=require(_0x92da('0xa'));var deskjs=require(_0x92da('0xb'));var toCsv=require(_0x92da('0x5'));var querystring=require(_0x92da('0xc'));var Papa=require('papaparse');var Redis=require(_0x92da('0xd'));var authService=require(_0x92da('0xe'));var qs=require(_0x92da('0xf'));var as=require(_0x92da('0x10'));var hardwareService=require(_0x92da('0x11'));var logger=require(_0x92da('0x12'))(_0x92da('0x13'));var utils=require(_0x92da('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x92da('0x15'))['db'];config[_0x92da('0x16')]=_[_0x92da('0x17')](config[_0x92da('0x16')],{'host':_0x92da('0x18'),'port':0x18eb});var socket=require(_0x92da('0x19'))(new Redis(config[_0x92da('0x16')]));require('./chatMessage.socket')[_0x92da('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x92da('0x1b')][_0x92da('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x92da('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3d2292,_0x2a8c47,_0xf4428e,_0x21cd17){return new BPromise(function(_0x170406,_0x315a0c){var _0x36e613=_0x21cd17||client;return _0x36e613['request'](_0x3d2292,_0xf4428e)[_0x92da('0x1d')](function(_0x1be8a9){logger[_0x92da('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x2a8c47,_0x92da('0x1f'));logger[_0x92da('0x20')](_0x92da('0x21'),_0x2a8c47,_0x92da('0x1f'),JSON['stringify'](_0x1be8a9));if(_0x1be8a9[_0x92da('0x22')]){if(_0x1be8a9['error']['code']===0x1f4){logger[_0x92da('0x22')](_0x92da('0x23'),_0x2a8c47,_0x1be8a9[_0x92da('0x22')][_0x92da('0x24')]);return _0x315a0c(_0x1be8a9[_0x92da('0x22')][_0x92da('0x24')]);}logger[_0x92da('0x22')](_0x92da('0x23'),_0x2a8c47,_0x1be8a9[_0x92da('0x22')][_0x92da('0x24')]);return _0x170406(_0x1be8a9[_0x92da('0x22')][_0x92da('0x24')]);}else{logger['info'](_0x92da('0x23'),_0x2a8c47,_0x92da('0x1f'));_0x170406(_0x1be8a9[_0x92da('0x25')]['message']);}})[_0x92da('0x26')](function(_0x1d0d3d){logger['error'](_0x92da('0x23'),_0x2a8c47,_0x1d0d3d);_0x315a0c(_0x1d0d3d);});});}function respondWithStatusCode(_0xcfb1ae,_0x161283){_0x161283=_0x161283||0xcc;return function(_0x4d4956){if(_0x4d4956){return _0xcfb1ae[_0x92da('0x27')](_0x161283);}return _0xcfb1ae['status'](_0x161283)[_0x92da('0x28')]();};}function respondWithResult(_0x2f95e2,_0x59a280){_0x59a280=_0x59a280||0xc8;return function(_0x5ea34d){if(_0x5ea34d){return _0x2f95e2['status'](_0x59a280)[_0x92da('0x29')](_0x5ea34d);}};}function respondWithFilteredResult(_0x374387,_0x59f81d){return function(_0x14672a){if(_0x14672a){var _0xc328d6=typeof _0x59f81d[_0x92da('0x2a')]===_0x92da('0x2b')&&typeof _0x59f81d['limit']===_0x92da('0x2b');var _0x4b2b5a=_0x14672a['count'];var _0xb0f668=_0xc328d6?0x0:_0x59f81d[_0x92da('0x2a')];var _0x4dc99f=_0xc328d6?_0x14672a['count']:_0x59f81d[_0x92da('0x2a')]+_0x59f81d[_0x92da('0x2c')];var _0x514ba1;if(_0x4dc99f>=_0x4b2b5a){_0x4dc99f=_0x4b2b5a;_0x514ba1=0xc8;}else{_0x514ba1=0xce;}_0x374387[_0x92da('0x2d')](_0x514ba1);return _0x374387[_0x92da('0x2e')]('Content-Range',_0xb0f668+'-'+_0x4dc99f+'/'+_0x4b2b5a)[_0x92da('0x29')](_0x14672a);}return null;};}function patchUpdates(_0x4e30f4){return function(_0x10ed01){try{jsonpatch[_0x92da('0x2f')](_0x10ed01,_0x4e30f4,!![]);}catch(_0x47d567){return BPromise[_0x92da('0x30')](_0x47d567);}return _0x10ed01[_0x92da('0x31')]();};}function saveUpdates(_0x5789f7,_0x4397db){return function(_0x74f470){if(_0x74f470){return _0x74f470[_0x92da('0x32')](_0x5789f7)[_0x92da('0x1d')](function(_0x49092b){return _0x49092b;});}return null;};}function removeEntity(_0x2aebcc,_0x1b89a5){return function(_0x35c433){if(_0x35c433){return _0x35c433[_0x92da('0x33')]()['then'](function(){_0x2aebcc[_0x92da('0x2d')](0xcc)[_0x92da('0x28')]();});}};}function handleEntityNotFound(_0x794fa,_0x479960){return function(_0xfbca1c){if(!_0xfbca1c){_0x794fa[_0x92da('0x27')](0x194);}return _0xfbca1c;};}function handleError(_0x175c44,_0x4ef25f){_0x4ef25f=_0x4ef25f||0x1f4;return function(_0x3430bb){logger[_0x92da('0x22')](_0x3430bb['stack']);if(_0x3430bb[_0x92da('0x34')]){delete _0x3430bb['name'];}_0x175c44[_0x92da('0x2d')](_0x4ef25f)[_0x92da('0x35')](_0x3430bb);};}exports['index']=function(_0x596cbe,_0x2ee06b){var _0xe7028f={},_0x31cd19={},_0x7cf257={'count':0x0,'rows':[]};var _0x22d585=_[_0x92da('0x36')](db[_0x92da('0x37')][_0x92da('0x38')],function(_0x5e7eef){return{'name':_0x5e7eef[_0x92da('0x39')],'type':_0x5e7eef[_0x92da('0x3a')][_0x92da('0x3b')]};});_0x31cd19[_0x92da('0x3c')]=_[_0x92da('0x36')](_0x22d585,_0x92da('0x34'));_0x31cd19[_0x92da('0x3d')]=_[_0x92da('0x3e')](_0x596cbe[_0x92da('0x3d')]);_0x31cd19[_0x92da('0x3f')]=_[_0x92da('0x40')](_0x31cd19[_0x92da('0x3c')],_0x31cd19[_0x92da('0x3d')]);_0xe7028f['attributes']=_[_0x92da('0x40')](_0x31cd19[_0x92da('0x3c')],qs['fields'](_0x596cbe['query'][_0x92da('0x41')]));_0xe7028f[_0x92da('0x42')]=_0xe7028f[_0x92da('0x42')]['length']?_0xe7028f[_0x92da('0x42')]:_0x31cd19[_0x92da('0x3c')];if(!_0x596cbe[_0x92da('0x3d')][_0x92da('0x43')](_0x92da('0x44'))){_0xe7028f[_0x92da('0x2c')]=qs[_0x92da('0x2c')](_0x596cbe['query'][_0x92da('0x2c')]);_0xe7028f[_0x92da('0x2a')]=qs[_0x92da('0x2a')](_0x596cbe[_0x92da('0x3d')][_0x92da('0x2a')]);}_0xe7028f['order']=qs['sort'](_0x596cbe[_0x92da('0x3d')]['sort']);_0xe7028f[_0x92da('0x45')]=qs[_0x92da('0x3f')](_[_0x92da('0x46')](_0x596cbe[_0x92da('0x3d')],_0x31cd19[_0x92da('0x3f')]),_0x22d585);if(_0x596cbe[_0x92da('0x3d')][_0x92da('0x47')]){_0xe7028f[_0x92da('0x45')]=_[_0x92da('0x48')](_0xe7028f[_0x92da('0x45')],{'$or':_[_0x92da('0x36')](_0x22d585,function(_0x58d723){if(_0x58d723[_0x92da('0x3a')]!==_0x92da('0x49')){var _0x4658c6={};_0x4658c6[_0x58d723[_0x92da('0x34')]]={'$like':'%'+_0x596cbe[_0x92da('0x3d')][_0x92da('0x47')]+'%'};return _0x4658c6;}})});}_0xe7028f=_[_0x92da('0x48')]({},_0xe7028f,_0x596cbe[_0x92da('0x4a')]);var _0x2711ac={'where':_0xe7028f[_0x92da('0x45')]};return db[_0x92da('0x37')][_0x92da('0x4b')](_0x2711ac)[_0x92da('0x1d')](function(_0x1f75d7){_0x7cf257[_0x92da('0x4b')]=_0x1f75d7;if(_0x596cbe[_0x92da('0x3d')][_0x92da('0x4c')]){_0xe7028f['include']=[{'all':!![]}];}return db[_0x92da('0x37')][_0x92da('0x4d')](_0xe7028f);})['then'](function(_0x2e2c63){_0x7cf257[_0x92da('0x4e')]=_0x2e2c63;return _0x7cf257;})['then'](respondWithFilteredResult(_0x2ee06b,_0xe7028f))['catch'](handleError(_0x2ee06b,null));};exports[_0x92da('0x4f')]=function(_0x7cfe9f,_0x19a81c){var _0x22a92a={'raw':!![],'where':{'id':_0x7cfe9f[_0x92da('0x50')]['id']}},_0x2b3d8e={};_0x2b3d8e['model']=_[_0x92da('0x3e')](db[_0x92da('0x37')][_0x92da('0x38')]);_0x2b3d8e[_0x92da('0x3d')]=_[_0x92da('0x3e')](_0x7cfe9f[_0x92da('0x3d')]);_0x2b3d8e['filters']=_[_0x92da('0x40')](_0x2b3d8e['model'],_0x2b3d8e[_0x92da('0x3d')]);_0x22a92a[_0x92da('0x42')]=_['intersection'](_0x2b3d8e[_0x92da('0x3c')],qs[_0x92da('0x41')](_0x7cfe9f[_0x92da('0x3d')][_0x92da('0x41')]));_0x22a92a['attributes']=_0x22a92a[_0x92da('0x42')]['length']?_0x22a92a[_0x92da('0x42')]:_0x2b3d8e[_0x92da('0x3c')];if(_0x7cfe9f['query'][_0x92da('0x4c')]){_0x22a92a[_0x92da('0x51')]=[{'all':!![]}];}_0x22a92a=_['merge']({},_0x22a92a,_0x7cfe9f[_0x92da('0x4a')]);return db[_0x92da('0x37')][_0x92da('0x52')](_0x22a92a)[_0x92da('0x1d')](handleEntityNotFound(_0x19a81c,null))[_0x92da('0x1d')](respondWithResult(_0x19a81c,null))[_0x92da('0x26')](handleError(_0x19a81c,null));};exports[_0x92da('0x53')]=function(_0x5ccee2,_0x3f2248){return db[_0x92da('0x37')][_0x92da('0x53')](_0x5ccee2[_0x92da('0x54')],{})[_0x92da('0x1d')](respondWithResult(_0x3f2248,0xc9))[_0x92da('0x26')](handleError(_0x3f2248,null));};exports['update']=function(_0x7ea1d3,_0xebcd74){if(_0x7ea1d3['body']['id']){delete _0x7ea1d3[_0x92da('0x54')]['id'];}return db[_0x92da('0x37')][_0x92da('0x52')]({'where':{'id':_0x7ea1d3[_0x92da('0x50')]['id']}})[_0x92da('0x1d')](handleEntityNotFound(_0xebcd74,null))[_0x92da('0x1d')](saveUpdates(_0x7ea1d3[_0x92da('0x54')],null))[_0x92da('0x1d')](respondWithResult(_0xebcd74,null))['catch'](handleError(_0xebcd74,null));};exports[_0x92da('0x33')]=function(_0x132e6d,_0x2397ee){return db['ChatMessage'][_0x92da('0x52')]({'where':{'id':_0x132e6d[_0x92da('0x50')]['id']}})['then'](handleEntityNotFound(_0x2397ee,null))[_0x92da('0x1d')](removeEntity(_0x2397ee,null))['catch'](handleError(_0x2397ee,null));};exports['describe']=function(_0x157c36,_0x5ab0a5){return db['ChatMessage'][_0x92da('0x55')]()[_0x92da('0x1d')](respondWithResult(_0x5ab0a5,null))[_0x92da('0x26')](handleError(_0x5ab0a5,null));};var interaction_log=require(_0x92da('0x12'))(_0x92da('0x56'));exports[_0x92da('0x57')]=function(_0x22a6f6,_0x54804a,_0x426ffc){var _0x4191aa={'agent':{},'channel':_0x92da('0x58')};if(_0x22a6f6[_0x92da('0x54')]['id']){delete _0x22a6f6[_0x92da('0x54')]['id'];}_0x22a6f6[_0x92da('0x54')][_0x92da('0x59')]=!![];_0x22a6f6[_0x92da('0x54')]['readAt']=moment()['format'](_0x92da('0x5a'));_0x22a6f6['body'][_0x92da('0x5b')]=_0x22a6f6[_0x92da('0x54')]['UserId']||_0x22a6f6[_0x92da('0x5c')]['id'];_0x4191aa[_0x92da('0x5d')]['id']=_0x22a6f6[_0x92da('0x54')][_0x92da('0x5b')];return db[_0x92da('0x37')][_0x92da('0x52')]({'where':{'id':_0x22a6f6['params']['id'],'UserId':null}})[_0x92da('0x1d')](handleEntityNotFound(_0x54804a,null))[_0x92da('0x1d')](saveUpdates(_0x22a6f6['body'],null))[_0x92da('0x1d')](function(_0x58368e){if(_0x58368e){_0x4191aa[_0x92da('0x24')]=_0x58368e[_0x92da('0x5e')]({'plain':!![]});return db[_0x92da('0x5f')][_0x92da('0x52')]({'where':{'id':_0x58368e[_0x92da('0x60')]}});}return null;})[_0x92da('0x1d')](handleEntityNotFound(_0x54804a,null))['then'](function(_0x5d2309){if(_0x5d2309){return _0x5d2309[_0x92da('0x32')]({'UserId':_0x22a6f6[_0x92da('0x54')]['UserId'],'read1stAt':_['isNil'](_0x5d2309['read1stAt'])?moment()[_0x92da('0x61')](_0x92da('0x5a')):undefined});}return null;})[_0x92da('0x1d')](function(_0x3183fd){if(_0x3183fd){_0x4191aa[_0x92da('0x62')]=_0x3183fd[_0x92da('0x5e')]({'plain':!![]});interaction_log[_0x92da('0x1e')](_0x92da('0x63'),_0x22a6f6[_0x92da('0x5c')]['id'],_0x22a6f6[_0x92da('0x5c')][_0x92da('0x34')],_0x22a6f6['user']['role'],_0x4191aa[_0x92da('0x62')]['id'],_0x22a6f6[_0x92da('0x54')]?JSON[_0x92da('0x64')](_0x22a6f6[_0x92da('0x54')]):_0x92da('0x65'));return respondWithRpcPromise('AcceptMessage',_0x92da('0x66'),_0x4191aa);}return null;})[_0x92da('0x1d')](function(_0xf79f8c){var _0x479c93=_0x92da('0x67')+_0xf79f8c['message'][_0x92da('0x68')];return db[_0x92da('0x69')][_0x92da('0x3d')](_0x479c93,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x92da('0x1d')](function(_0x23e3be){return _0x23e3be;});})[_0x92da('0x1d')](function(_0x4919fe){if(_0x4919fe){_0x4191aa[_0x92da('0x24')]['contact']=_0x4919fe[0x0];if(!_0x22a6f6[_0x92da('0x54')][_0x92da('0x5b')])return;return db[_0x92da('0x6a')][_0x92da('0x52')]({'where':{'id':_0x22a6f6[_0x92da('0x54')][_0x92da('0x5b')],'role':_0x92da('0x5d')},'attributes':['id',_0x92da('0x34'),_0x92da('0x6b'),'email',_0x92da('0x6c')],'raw':!![]});}return null;})[_0x92da('0x1d')](function(_0x17673b){if(!_0x17673b)return null;_0x4191aa['message'][_0x92da('0x5d')]=_0x17673b;return _0x4191aa;})[_0x92da('0x1d')](function(_0x2fa902){if(_0x2fa902){if(_0x22a6f6[_0x92da('0x54')][_0x92da('0x6d')]){_0x4191aa[_0x92da('0x24')][_0x92da('0x6e')]=util['format']('SIP/%s',_0x22a6f6[_0x92da('0x5c')]['name']);_0x4191aa['message'][_0x92da('0x6f')]=_0x4191aa[_0x92da('0x6f')];_0x4191aa[_0x92da('0x24')]['motionChannel']=_0x4191aa['channel'];_0x4191aa[_0x92da('0x24')][_0x92da('0x70')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x92da('0x71'),'message':_['merge'](_0x4191aa['message'],JSON[_0x92da('0x72')](_0x4191aa['interaction'][_0x92da('0x73')]))},client9002)[_0x92da('0x1d')](function(){return _0x4191aa;});}return _0x4191aa;}return null;})[_0x92da('0x1d')](respondWithResult(_0x54804a,null))[_0x92da('0x26')](handleError(_0x54804a,null));};var interaction_log=require(_0x92da('0x12'))(_0x92da('0x56'));exports[_0x92da('0x30')]=function(_0x4b3659,_0xcf3e69,_0x2500c1){var _0x4a4114={'agent':{},'channel':'chat'};if(_0x4b3659['body']['id']){delete _0x4b3659[_0x92da('0x54')]['id'];}_0x4b3659[_0x92da('0x54')][_0x92da('0x5b')]=_0x4b3659['body']['UserId']||_0x4b3659[_0x92da('0x5c')]['id'];_0x4a4114['agent']['id']=_0x4b3659[_0x92da('0x54')][_0x92da('0x5b')];return db['ChatMessage'][_0x92da('0x52')]({'where':{'id':_0x4b3659['params']['id'],'UserId':null}})[_0x92da('0x1d')](handleEntityNotFound(_0xcf3e69,null))['then'](function(_0x3c8fda){if(_0x3c8fda){_0x4a4114[_0x92da('0x24')]=_0x3c8fda[_0x92da('0x5e')]({'plain':!![]});return db[_0x92da('0x5f')][_0x92da('0x52')]({'where':{'id':_0x3c8fda[_0x92da('0x60')]}});}return null;})[_0x92da('0x1d')](handleEntityNotFound(_0xcf3e69,null))[_0x92da('0x1d')](function(_0x2a0c54){if(_0x2a0c54){_0x4a4114[_0x92da('0x62')]=_0x2a0c54[_0x92da('0x5e')]({'plain':!![]});interaction_log['info'](_0x92da('0x74'),_0x4b3659[_0x92da('0x5c')]['id'],_0x4b3659[_0x92da('0x5c')][_0x92da('0x34')],_0x4b3659[_0x92da('0x5c')][_0x92da('0x75')],_0x4a4114[_0x92da('0x62')]['id'],_0x4b3659[_0x92da('0x54')]?JSON['stringify'](_0x4b3659[_0x92da('0x54')]):_0x92da('0x65'));return respondWithRpcPromise(_0x92da('0x76'),_0x92da('0x77'),_0x4a4114);}return null;})[_0x92da('0x1d')](function(_0x2cf34c){var _0x26cf7c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2cf34c[_0x92da('0x24')][_0x92da('0x68')];return db[_0x92da('0x69')][_0x92da('0x3d')](_0x26cf7c,{'type':db[_0x92da('0x78')]['QueryTypes'][_0x92da('0x79')],'raw':!![]})['then'](function(_0x5c2494){return _0x5c2494;});})[_0x92da('0x1d')](function(_0x47c1f7){if(_0x47c1f7){_0x4a4114[_0x92da('0x24')][_0x92da('0x7a')]=_0x47c1f7[0x0];if(!_0x4b3659[_0x92da('0x54')][_0x92da('0x5b')])return;return db[_0x92da('0x6a')][_0x92da('0x52')]({'where':{'id':_0x4b3659['body']['UserId'],'role':_0x92da('0x5d')},'attributes':['id',_0x92da('0x34'),_0x92da('0x6b'),_0x92da('0x7b'),_0x92da('0x6c')],'raw':!![]});}return null;})[_0x92da('0x1d')](function(_0x59b03e){if(!_0x59b03e)return null;_0x4a4114[_0x92da('0x24')][_0x92da('0x5d')]=_0x59b03e;return _0x4a4114;})[_0x92da('0x1d')](function(_0x464a54){if(_0x464a54){_0x464a54[_0x92da('0x24')]['interface']=util[_0x92da('0x61')](_0x92da('0x7c'),_0x4b3659[_0x92da('0x5c')][_0x92da('0x34')]);_0x464a54[_0x92da('0x24')][_0x92da('0x6f')]=_0x4a4114['channel'];_0x464a54[_0x92da('0x24')][_0x92da('0x7d')]=_0x4a4114[_0x92da('0x6f')];_0x464a54[_0x92da('0x24')][_0x92da('0x70')]=_0x92da('0x30');respondWithRpcPromise(_0x92da('0x7e'),_0x92da('0x7e'),{'event':_0x92da('0x7f'),'message':_[_0x92da('0x48')](_0x4a4114[_0x92da('0x24')],JSON[_0x92da('0x72')](_0x4a4114['interaction'][_0x92da('0x73')]))},client9002);return _0x4a4114;}return null;})['then'](respondWithResult(_0xcf3e69,null))['catch'](handleError(_0xcf3e69,null));}; \ No newline at end of file +var _0x7b3a=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','../../config/logger','chat-interactions','accept','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','User','fullname','email','internal','agent','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','ContactId','QueryTypes','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','key','model','query','keys','filters','attributes','intersection'];(function(_0x2e75a7,_0x1578f0){var _0x1f34fc=function(_0x5a4ef8){while(--_0x5a4ef8){_0x2e75a7['push'](_0x2e75a7['shift']());}};_0x1f34fc(++_0x1578f0);}(_0x7b3a,0x149));var _0xa7b3=function(_0x278022,_0x1b58e6){_0x278022=_0x278022-0x0;var _0x933277=_0x7b3a[_0x278022];return _0x933277;};'use strict';var emlformat=require(_0xa7b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa7b3('0x1'));var jsonpatch=require(_0xa7b3('0x2'));var rp=require(_0xa7b3('0x3'));var moment=require('moment');var BPromise=require(_0xa7b3('0x4'));var Mustache=require(_0xa7b3('0x5'));var util=require(_0xa7b3('0x6'));var path=require(_0xa7b3('0x7'));var sox=require(_0xa7b3('0x8'));var csv=require(_0xa7b3('0x9'));var ejs=require(_0xa7b3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa7b3('0xb'));var squel=require(_0xa7b3('0xc'));var crypto=require(_0xa7b3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa7b3('0xe'));var toCsv=require(_0xa7b3('0x9'));var querystring=require(_0xa7b3('0xf'));var Papa=require(_0xa7b3('0x10'));var Redis=require('ioredis');var authService=require(_0xa7b3('0x11'));var qs=require(_0xa7b3('0x12'));var as=require(_0xa7b3('0x13'));var hardwareService=require(_0xa7b3('0x14'));var logger=require('../../config/logger')(_0xa7b3('0x15'));var utils=require(_0xa7b3('0x16'));var config=require(_0xa7b3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7b3('0x18'))['db'];config[_0xa7b3('0x19')]=_['defaults'](config[_0xa7b3('0x19')],{'host':_0xa7b3('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7b3('0x19')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0xa7b3('0x1b'));var client=jayson[_0xa7b3('0x1c')][_0xa7b3('0x1d')]({'port':0x232c});var client9002=jayson[_0xa7b3('0x1c')][_0xa7b3('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x304f35,_0x1be7f4,_0x1f6c50,_0xc3b5bd){return new BPromise(function(_0x2c8fa3,_0x136756){var _0x5f1947=_0xc3b5bd||client;return _0x5f1947[_0xa7b3('0x1e')](_0x304f35,_0x1f6c50)[_0xa7b3('0x1f')](function(_0x5e5215){logger[_0xa7b3('0x20')](_0xa7b3('0x21'),_0x1be7f4,'request\x20sent');logger[_0xa7b3('0x22')](_0xa7b3('0x23'),_0x1be7f4,_0xa7b3('0x24'),JSON[_0xa7b3('0x25')](_0x5e5215));if(_0x5e5215[_0xa7b3('0x26')]){if(_0x5e5215['error'][_0xa7b3('0x27')]===0x1f4){logger[_0xa7b3('0x26')](_0xa7b3('0x21'),_0x1be7f4,_0x5e5215[_0xa7b3('0x26')][_0xa7b3('0x28')]);return _0x136756(_0x5e5215[_0xa7b3('0x26')][_0xa7b3('0x28')]);}logger[_0xa7b3('0x26')]('ChatMessage,\x20%s,\x20%s',_0x1be7f4,_0x5e5215[_0xa7b3('0x26')][_0xa7b3('0x28')]);return _0x2c8fa3(_0x5e5215['error'][_0xa7b3('0x28')]);}else{logger['info'](_0xa7b3('0x21'),_0x1be7f4,_0xa7b3('0x24'));_0x2c8fa3(_0x5e5215['result'][_0xa7b3('0x28')]);}})['catch'](function(_0xe9f908){logger['error'](_0xa7b3('0x21'),_0x1be7f4,_0xe9f908);_0x136756(_0xe9f908);});});}function respondWithStatusCode(_0x498bb7,_0x520451){_0x520451=_0x520451||0xcc;return function(_0x2160b0){if(_0x2160b0){return _0x498bb7[_0xa7b3('0x29')](_0x520451);}return _0x498bb7[_0xa7b3('0x2a')](_0x520451)[_0xa7b3('0x2b')]();};}function respondWithResult(_0x1eff6f,_0x415c02){_0x415c02=_0x415c02||0xc8;return function(_0x412078){if(_0x412078){return _0x1eff6f[_0xa7b3('0x2a')](_0x415c02)[_0xa7b3('0x2c')](_0x412078);}};}function respondWithFilteredResult(_0x2b990f,_0x3b2c72){return function(_0x36a94c){if(_0x36a94c){var _0x1f512c=typeof _0x3b2c72[_0xa7b3('0x2d')]==='undefined'&&typeof _0x3b2c72[_0xa7b3('0x2e')]==='undefined';var _0x20d289=_0x36a94c[_0xa7b3('0x2f')];var _0x27e759=_0x1f512c?0x0:_0x3b2c72['offset'];var _0x4b69b4=_0x1f512c?_0x36a94c[_0xa7b3('0x2f')]:_0x3b2c72[_0xa7b3('0x2d')]+_0x3b2c72[_0xa7b3('0x2e')];var _0x1e8ec4;if(_0x4b69b4>=_0x20d289){_0x4b69b4=_0x20d289;_0x1e8ec4=0xc8;}else{_0x1e8ec4=0xce;}_0x2b990f['status'](_0x1e8ec4);return _0x2b990f['set'](_0xa7b3('0x30'),_0x27e759+'-'+_0x4b69b4+'/'+_0x20d289)['json'](_0x36a94c);}return null;};}function patchUpdates(_0x137c26){return function(_0x59893c){try{jsonpatch[_0xa7b3('0x31')](_0x59893c,_0x137c26,!![]);}catch(_0x4544ba){return BPromise[_0xa7b3('0x32')](_0x4544ba);}return _0x59893c[_0xa7b3('0x33')]();};}function saveUpdates(_0x2059e2,_0x23d8da){return function(_0x49294a){if(_0x49294a){return _0x49294a[_0xa7b3('0x34')](_0x2059e2)[_0xa7b3('0x1f')](function(_0x3d1f8f){return _0x3d1f8f;});}return null;};}function removeEntity(_0xc1a3c8,_0x3551be){return function(_0x410bee){if(_0x410bee){return _0x410bee[_0xa7b3('0x35')]()[_0xa7b3('0x1f')](function(){_0xc1a3c8['status'](0xcc)[_0xa7b3('0x2b')]();});}};}function handleEntityNotFound(_0x153139,_0xbb8cf1){return function(_0x1d2d6d){if(!_0x1d2d6d){_0x153139[_0xa7b3('0x29')](0x194);}return _0x1d2d6d;};}function handleError(_0x445437,_0x145542){_0x145542=_0x145542||0x1f4;return function(_0x31da0f){logger['error'](_0x31da0f[_0xa7b3('0x36')]);if(_0x31da0f[_0xa7b3('0x37')]){delete _0x31da0f[_0xa7b3('0x37')];}_0x445437[_0xa7b3('0x2a')](_0x145542)[_0xa7b3('0x38')](_0x31da0f);};}exports[_0xa7b3('0x39')]=function(_0x598c83,_0x1ad20a){var _0x5f3a57={},_0x456bfc={},_0x1e1bb7={'count':0x0,'rows':[]};var _0x4b7040=_[_0xa7b3('0x3a')](db[_0xa7b3('0x3b')]['rawAttributes'],function(_0x3407d8){return{'name':_0x3407d8['fieldName'],'type':_0x3407d8['type'][_0xa7b3('0x3c')]};});_0x456bfc[_0xa7b3('0x3d')]=_[_0xa7b3('0x3a')](_0x4b7040,_0xa7b3('0x37'));_0x456bfc[_0xa7b3('0x3e')]=_[_0xa7b3('0x3f')](_0x598c83[_0xa7b3('0x3e')]);_0x456bfc[_0xa7b3('0x40')]=_['intersection'](_0x456bfc['model'],_0x456bfc[_0xa7b3('0x3e')]);_0x5f3a57[_0xa7b3('0x41')]=_[_0xa7b3('0x42')](_0x456bfc[_0xa7b3('0x3d')],qs[_0xa7b3('0x43')](_0x598c83[_0xa7b3('0x3e')]['fields']));_0x5f3a57[_0xa7b3('0x41')]=_0x5f3a57['attributes']['length']?_0x5f3a57[_0xa7b3('0x41')]:_0x456bfc['model'];if(!_0x598c83[_0xa7b3('0x3e')][_0xa7b3('0x44')](_0xa7b3('0x45'))){_0x5f3a57[_0xa7b3('0x2e')]=qs[_0xa7b3('0x2e')](_0x598c83['query'][_0xa7b3('0x2e')]);_0x5f3a57[_0xa7b3('0x2d')]=qs['offset'](_0x598c83[_0xa7b3('0x3e')]['offset']);}_0x5f3a57[_0xa7b3('0x46')]=qs['sort'](_0x598c83['query'][_0xa7b3('0x47')]);_0x5f3a57[_0xa7b3('0x48')]=qs[_0xa7b3('0x40')](_[_0xa7b3('0x49')](_0x598c83['query'],_0x456bfc[_0xa7b3('0x40')]),_0x4b7040);if(_0x598c83[_0xa7b3('0x3e')][_0xa7b3('0x4a')]){_0x5f3a57[_0xa7b3('0x48')]=_[_0xa7b3('0x4b')](_0x5f3a57[_0xa7b3('0x48')],{'$or':_[_0xa7b3('0x3a')](_0x4b7040,function(_0x2bb814){if(_0x2bb814[_0xa7b3('0x4c')]!==_0xa7b3('0x4d')){var _0x13298d={};_0x13298d[_0x2bb814[_0xa7b3('0x37')]]={'$like':'%'+_0x598c83[_0xa7b3('0x3e')][_0xa7b3('0x4a')]+'%'};return _0x13298d;}})});}_0x5f3a57=_['merge']({},_0x5f3a57,_0x598c83[_0xa7b3('0x4e')]);var _0x1e61e0={'where':_0x5f3a57[_0xa7b3('0x48')]};return db[_0xa7b3('0x3b')][_0xa7b3('0x2f')](_0x1e61e0)[_0xa7b3('0x1f')](function(_0x470ec0){_0x1e1bb7[_0xa7b3('0x2f')]=_0x470ec0;if(_0x598c83[_0xa7b3('0x3e')][_0xa7b3('0x4f')]){_0x5f3a57[_0xa7b3('0x50')]=[{'all':!![]}];}return db[_0xa7b3('0x3b')][_0xa7b3('0x51')](_0x5f3a57);})[_0xa7b3('0x1f')](function(_0x2946d8){_0x1e1bb7[_0xa7b3('0x52')]=_0x2946d8;return _0x1e1bb7;})[_0xa7b3('0x1f')](respondWithFilteredResult(_0x1ad20a,_0x5f3a57))[_0xa7b3('0x53')](handleError(_0x1ad20a,null));};exports[_0xa7b3('0x54')]=function(_0x4fd311,_0x33d672){var _0x478f87={'raw':!![],'where':{'id':_0x4fd311[_0xa7b3('0x55')]['id']}},_0x30b63f={};_0x30b63f['model']=_[_0xa7b3('0x3f')](db[_0xa7b3('0x3b')][_0xa7b3('0x56')]);_0x30b63f[_0xa7b3('0x3e')]=_[_0xa7b3('0x3f')](_0x4fd311['query']);_0x30b63f[_0xa7b3('0x40')]=_[_0xa7b3('0x42')](_0x30b63f['model'],_0x30b63f['query']);_0x478f87[_0xa7b3('0x41')]=_[_0xa7b3('0x42')](_0x30b63f[_0xa7b3('0x3d')],qs[_0xa7b3('0x43')](_0x4fd311['query'][_0xa7b3('0x43')]));_0x478f87['attributes']=_0x478f87[_0xa7b3('0x41')][_0xa7b3('0x57')]?_0x478f87[_0xa7b3('0x41')]:_0x30b63f['model'];if(_0x4fd311[_0xa7b3('0x3e')][_0xa7b3('0x4f')]){_0x478f87[_0xa7b3('0x50')]=[{'all':!![]}];}_0x478f87=_[_0xa7b3('0x4b')]({},_0x478f87,_0x4fd311[_0xa7b3('0x4e')]);return db[_0xa7b3('0x3b')][_0xa7b3('0x58')](_0x478f87)[_0xa7b3('0x1f')](handleEntityNotFound(_0x33d672,null))[_0xa7b3('0x1f')](respondWithResult(_0x33d672,null))[_0xa7b3('0x53')](handleError(_0x33d672,null));};exports[_0xa7b3('0x59')]=function(_0x1c85f2,_0x4d8e53){return db[_0xa7b3('0x3b')][_0xa7b3('0x59')](_0x1c85f2[_0xa7b3('0x5a')],{})[_0xa7b3('0x1f')](respondWithResult(_0x4d8e53,0xc9))[_0xa7b3('0x53')](handleError(_0x4d8e53,null));};exports[_0xa7b3('0x34')]=function(_0x3cc075,_0x310700){if(_0x3cc075['body']['id']){delete _0x3cc075['body']['id'];}return db['ChatMessage'][_0xa7b3('0x58')]({'where':{'id':_0x3cc075[_0xa7b3('0x55')]['id']}})['then'](handleEntityNotFound(_0x310700,null))[_0xa7b3('0x1f')](saveUpdates(_0x3cc075[_0xa7b3('0x5a')],null))[_0xa7b3('0x1f')](respondWithResult(_0x310700,null))['catch'](handleError(_0x310700,null));};exports[_0xa7b3('0x35')]=function(_0x25e269,_0x168677){return db[_0xa7b3('0x3b')][_0xa7b3('0x58')]({'where':{'id':_0x25e269[_0xa7b3('0x55')]['id']}})[_0xa7b3('0x1f')](handleEntityNotFound(_0x168677,null))[_0xa7b3('0x1f')](removeEntity(_0x168677,null))[_0xa7b3('0x53')](handleError(_0x168677,null));};exports['describe']=function(_0x56e1ac,_0x26e395){return db['ChatMessage']['describe']()['then'](respondWithResult(_0x26e395,null))[_0xa7b3('0x53')](handleError(_0x26e395,null));};var interaction_log=require(_0xa7b3('0x5b'))(_0xa7b3('0x5c'));exports[_0xa7b3('0x5d')]=function(_0x514bc4,_0x18f0e5,_0xcd1818){var _0x352a54={'agent':{},'channel':_0xa7b3('0x5e')};if(_0x514bc4[_0xa7b3('0x5a')]['id']){delete _0x514bc4[_0xa7b3('0x5a')]['id'];}_0x514bc4[_0xa7b3('0x5a')]['read']=!![];_0x514bc4['body']['readAt']=moment()[_0xa7b3('0x5f')](_0xa7b3('0x60'));_0x514bc4['body'][_0xa7b3('0x61')]=_0x514bc4[_0xa7b3('0x5a')][_0xa7b3('0x61')]||_0x514bc4[_0xa7b3('0x62')]['id'];_0x352a54['agent']['id']=_0x514bc4[_0xa7b3('0x5a')][_0xa7b3('0x61')];return db[_0xa7b3('0x3b')][_0xa7b3('0x58')]({'where':{'id':_0x514bc4[_0xa7b3('0x55')]['id'],'UserId':null}})[_0xa7b3('0x1f')](handleEntityNotFound(_0x18f0e5,null))['then'](saveUpdates(_0x514bc4[_0xa7b3('0x5a')],null))[_0xa7b3('0x1f')](function(_0x70feec){if(_0x70feec){_0x352a54[_0xa7b3('0x28')]=_0x70feec[_0xa7b3('0x63')]({'plain':!![]});return db[_0xa7b3('0x64')]['find']({'where':{'id':_0x70feec['ChatInteractionId']}});}return null;})[_0xa7b3('0x1f')](handleEntityNotFound(_0x18f0e5,null))[_0xa7b3('0x1f')](function(_0x200073){if(_0x200073){return _0x200073[_0xa7b3('0x34')]({'UserId':_0x514bc4[_0xa7b3('0x5a')][_0xa7b3('0x61')],'read1stAt':_[_0xa7b3('0x65')](_0x200073[_0xa7b3('0x66')])?moment()[_0xa7b3('0x5f')](_0xa7b3('0x60')):undefined});}return null;})[_0xa7b3('0x1f')](function(_0x44c33f){if(_0x44c33f){_0x352a54[_0xa7b3('0x67')]=_0x44c33f[_0xa7b3('0x63')]({'plain':!![]});interaction_log['info'](_0xa7b3('0x68'),_0x514bc4['user']['id'],_0x514bc4['user'][_0xa7b3('0x37')],_0x514bc4['user']['role'],_0x352a54[_0xa7b3('0x67')]['id'],_0x514bc4[_0xa7b3('0x5a')]?JSON[_0xa7b3('0x25')](_0x514bc4[_0xa7b3('0x5a')]):_0xa7b3('0x69'));return respondWithRpcPromise(_0xa7b3('0x6a'),_0xa7b3('0x6b'),_0x352a54);}return null;})[_0xa7b3('0x1f')](function(_0x3e62b4){var _0x4d70ad=_0xa7b3('0x6c')+_0x3e62b4[_0xa7b3('0x28')]['ContactId'];return db[_0xa7b3('0x6d')][_0xa7b3('0x3e')](_0x4d70ad,{'type':db[_0xa7b3('0x6e')]['QueryTypes'][_0xa7b3('0x6f')],'raw':!![]})['then'](function(_0x3af686){return _0x3af686;});})[_0xa7b3('0x1f')](function(_0x356f00){if(_0x356f00){_0x352a54[_0xa7b3('0x28')]['contact']=_0x356f00[0x0];if(!_0x514bc4[_0xa7b3('0x5a')]['UserId'])return;return db[_0xa7b3('0x70')]['find']({'where':{'id':_0x514bc4[_0xa7b3('0x5a')]['UserId'],'role':'agent'},'attributes':['id',_0xa7b3('0x37'),_0xa7b3('0x71'),_0xa7b3('0x72'),_0xa7b3('0x73')],'raw':!![]});}return null;})[_0xa7b3('0x1f')](function(_0x1d1608){if(!_0x1d1608)return null;_0x352a54['message'][_0xa7b3('0x74')]=_0x1d1608;return _0x352a54;})['then'](function(_0x26b576){if(_0x26b576){if(_0x514bc4['body']['manual']){_0x352a54[_0xa7b3('0x28')]['interface']=util['format'](_0xa7b3('0x75'),_0x514bc4[_0xa7b3('0x62')][_0xa7b3('0x37')]);_0x352a54[_0xa7b3('0x28')][_0xa7b3('0x76')]=_0x352a54['channel'];_0x352a54[_0xa7b3('0x28')][_0xa7b3('0x77')]=_0x352a54['channel'];_0x352a54[_0xa7b3('0x28')][_0xa7b3('0x78')]='accept';return respondWithRpcPromise(_0xa7b3('0x79'),_0xa7b3('0x79'),{'event':_0xa7b3('0x7a'),'message':_[_0xa7b3('0x4b')](_0x352a54[_0xa7b3('0x28')],JSON['parse'](_0x352a54[_0xa7b3('0x67')][_0xa7b3('0x7b')]))},client9002)[_0xa7b3('0x1f')](function(){return _0x352a54;});}return _0x352a54;}return null;})[_0xa7b3('0x1f')](respondWithResult(_0x18f0e5,null))[_0xa7b3('0x53')](handleError(_0x18f0e5,null));};var interaction_log=require(_0xa7b3('0x5b'))(_0xa7b3('0x5c'));exports[_0xa7b3('0x32')]=function(_0x5d40fd,_0x426c4f,_0x1330c4){var _0x291bac={'agent':{},'channel':'chat'};if(_0x5d40fd['body']['id']){delete _0x5d40fd['body']['id'];}_0x5d40fd[_0xa7b3('0x5a')][_0xa7b3('0x61')]=_0x5d40fd[_0xa7b3('0x5a')][_0xa7b3('0x61')]||_0x5d40fd['user']['id'];_0x291bac[_0xa7b3('0x74')]['id']=_0x5d40fd[_0xa7b3('0x5a')][_0xa7b3('0x61')];return db['ChatMessage'][_0xa7b3('0x58')]({'where':{'id':_0x5d40fd[_0xa7b3('0x55')]['id'],'UserId':null}})[_0xa7b3('0x1f')](handleEntityNotFound(_0x426c4f,null))[_0xa7b3('0x1f')](function(_0x33fda2){if(_0x33fda2){_0x291bac[_0xa7b3('0x28')]=_0x33fda2[_0xa7b3('0x63')]({'plain':!![]});return db[_0xa7b3('0x64')]['find']({'where':{'id':_0x33fda2[_0xa7b3('0x7c')]}});}return null;})[_0xa7b3('0x1f')](handleEntityNotFound(_0x426c4f,null))[_0xa7b3('0x1f')](function(_0x229c8f){if(_0x229c8f){_0x291bac['interaction']=_0x229c8f['get']({'plain':!![]});interaction_log[_0xa7b3('0x20')](_0xa7b3('0x7d'),_0x5d40fd[_0xa7b3('0x62')]['id'],_0x5d40fd['user'][_0xa7b3('0x37')],_0x5d40fd['user'][_0xa7b3('0x7e')],_0x291bac[_0xa7b3('0x67')]['id'],_0x5d40fd[_0xa7b3('0x5a')]?JSON[_0xa7b3('0x25')](_0x5d40fd[_0xa7b3('0x5a')]):_0xa7b3('0x69'));return respondWithRpcPromise(_0xa7b3('0x7f'),'rejectMessage',_0x291bac);}return null;})[_0xa7b3('0x1f')](function(_0x3c36da){var _0x1c5c97=_0xa7b3('0x6c')+_0x3c36da[_0xa7b3('0x28')][_0xa7b3('0x80')];return db[_0xa7b3('0x6d')][_0xa7b3('0x3e')](_0x1c5c97,{'type':db[_0xa7b3('0x6e')][_0xa7b3('0x81')][_0xa7b3('0x6f')],'raw':!![]})[_0xa7b3('0x1f')](function(_0x3b5965){return _0x3b5965;});})[_0xa7b3('0x1f')](function(_0xc5bf42){if(_0xc5bf42){_0x291bac[_0xa7b3('0x28')]['contact']=_0xc5bf42[0x0];if(!_0x5d40fd['body'][_0xa7b3('0x61')])return;return db['User']['find']({'where':{'id':_0x5d40fd[_0xa7b3('0x5a')][_0xa7b3('0x61')],'role':'agent'},'attributes':['id','name',_0xa7b3('0x71'),_0xa7b3('0x72'),'internal'],'raw':!![]});}return null;})[_0xa7b3('0x1f')](function(_0x15998e){if(!_0x15998e)return null;_0x291bac[_0xa7b3('0x28')][_0xa7b3('0x74')]=_0x15998e;return _0x291bac;})[_0xa7b3('0x1f')](function(_0x50be1f){if(_0x50be1f){_0x50be1f[_0xa7b3('0x28')]['interface']=util['format']('SIP/%s',_0x5d40fd[_0xa7b3('0x62')][_0xa7b3('0x37')]);_0x50be1f[_0xa7b3('0x28')][_0xa7b3('0x76')]=_0x291bac[_0xa7b3('0x76')];_0x50be1f['message'][_0xa7b3('0x77')]=_0x291bac[_0xa7b3('0x76')];_0x50be1f['message'][_0xa7b3('0x78')]='reject';respondWithRpcPromise(_0xa7b3('0x79'),'EventManager',{'event':_0xa7b3('0x82'),'message':_[_0xa7b3('0x4b')](_0x291bac[_0xa7b3('0x28')],JSON[_0xa7b3('0x83')](_0x291bac[_0xa7b3('0x67')][_0xa7b3('0x7b')]))},client9002);return _0x291bac;}return null;})['then'](respondWithResult(_0x426c4f,null))[_0xa7b3('0x53')](handleError(_0x426c4f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index cd7c48d..03d43be 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 _0x9b7f=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9b7f,0x108));var _0xf9b7=function(_0x11a2a0,_0x5d3854){_0x11a2a0=_0x11a2a0-0x0;var _0x1d7603=_0x9b7f[_0x11a2a0];return _0x1d7603;};'use strict';var EventEmitter=require(_0xf9b7('0x0'));var ChatMessage=require(_0xf9b7('0x1'))['db'][_0xf9b7('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf9b7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf9b7('0x4'),'afterDestroy':_0xf9b7('0x5')};function emitEvent(_0x818235){return function(_0x490cf0,_0x29392e,_0x19e26b){ChatMessageEvents[_0xf9b7('0x6')](_0x818235+':'+_0x490cf0['id'],_0x490cf0);ChatMessageEvents[_0xf9b7('0x6')](_0x818235,_0x490cf0);_0x19e26b(null);};}for(var e in events){if(events[_0xf9b7('0x7')](e)){var event=events[e];ChatMessage[_0xf9b7('0x8')](e,emitEvent(event));}}module[_0xf9b7('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0x04d3=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x26bc64,_0x10685d){var _0x381c58=function(_0x53a657){while(--_0x53a657){_0x26bc64['push'](_0x26bc64['shift']());}};_0x381c58(++_0x10685d);}(_0x04d3,0x6b));var _0x304d=function(_0x51c959,_0x170aa9){_0x51c959=_0x51c959-0x0;var _0x2b0b32=_0x04d3[_0x51c959];return _0x2b0b32;};'use strict';var EventEmitter=require(_0x304d('0x0'));var ChatMessage=require(_0x304d('0x1'))['db'][_0x304d('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x304d('0x3')](0x0);var events={'afterCreate':_0x304d('0x4'),'afterUpdate':_0x304d('0x5'),'afterDestroy':_0x304d('0x6')};function emitEvent(_0x40458b){return function(_0x4f3f67,_0x413387,_0x1e58c5){ChatMessageEvents[_0x304d('0x7')](_0x40458b+':'+_0x4f3f67['id'],_0x4f3f67);ChatMessageEvents['emit'](_0x40458b,_0x4f3f67);_0x1e58c5(null);};}for(var e in events){if(events[_0x304d('0x8')](e)){var event=events[e];ChatMessage[_0x304d('0x9')](e,emitEvent(event));}}module[_0x304d('0xa')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 874b229..89fc525 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 _0x9123=['catch','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt'];(function(_0x16d345,_0x13c7c8){var _0x293935=function(_0x307dbd){while(--_0x307dbd){_0x16d345['push'](_0x16d345['shift']());}};_0x293935(++_0x13c7c8);}(_0x9123,0x119));var _0x3912=function(_0x53e50c,_0x1c502c){_0x53e50c=_0x53e50c-0x0;var _0x3cecaf=_0x9123[_0x53e50c];return _0x3cecaf;};'use strict';var _=require('lodash');var util=require(_0x3912('0x0'));var logger=require(_0x3912('0x1'))(_0x3912('0x2'));var moment=require(_0x3912('0x3'));var BPromise=require(_0x3912('0x4'));var rp=require(_0x3912('0x5'));var fs=require('fs');var path=require(_0x3912('0x6'));var rimraf=require(_0x3912('0x7'));var config=require(_0x3912('0x8'));var attributes=require(_0x3912('0x9'));module[_0x3912('0xa')]=function(_0x184801,_0x19e4c4){return _0x184801['define'](_0x3912('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x3912('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x563a06,_0x3a4e02,_0x129f95){var _0x38e6fb=_0x184801[_0x3912('0xd')];var _0x3ca717=_0x563a06[_0x3912('0xe')]({'plain':!![]});if(_0x3ca717[_0x3912('0xf')][_0x3912('0x10')]()==='in'||_0x3ca717['direction'][_0x3912('0x10')]()===_0x3912('0x11')&&!_0x3ca717[_0x3912('0x12')]&&!_[_0x3912('0x13')](_0x3ca717[_0x3912('0x14')])){_0x38e6fb[_0x3912('0x15')][_0x3912('0x16')]({'where':{'id':_0x3ca717[_0x3912('0x17')]}})[_0x3912('0x18')](function(_0x2f90b1){if(_0x2f90b1){_0x2f90b1[_0x3912('0x19')]({'lastMsgAt':_0x3ca717[_0x3912('0x1a')],'lastMsgDirection':_0x3ca717['direction'][_0x3912('0x10')]()});}})[_0x3912('0x1b')](function(_0x2436ab){console['error'](_0x2436ab);});}_0x129f95();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc026=['../../config/environment','./chatMessage.attributes','define','ChatMessage','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5a6a50,_0x57abcc){var _0x387841=function(_0xf9eec9){while(--_0xf9eec9){_0x5a6a50['push'](_0x5a6a50['shift']());}};_0x387841(++_0x57abcc);}(_0xc026,0x1df));var _0x6c02=function(_0x33611d,_0x48c2b5){_0x33611d=_0x33611d-0x0;var _0x4db2c2=_0xc026[_0x33611d];return _0x4db2c2;};'use strict';var _=require('lodash');var util=require(_0x6c02('0x0'));var logger=require(_0x6c02('0x1'))(_0x6c02('0x2'));var moment=require(_0x6c02('0x3'));var BPromise=require(_0x6c02('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c02('0x5'));var rimraf=require(_0x6c02('0x6'));var config=require(_0x6c02('0x7'));var attributes=require(_0x6c02('0x8'));module['exports']=function(_0x9439c3,_0x380f01){return _0x9439c3[_0x6c02('0x9')](_0x6c02('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x6c02('0xb'),'fields':[_0x6c02('0xc')],'type':_0x6c02('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7bddc0,_0x2dcb60,_0x420072){var _0x40fecd=_0x9439c3['models'];var _0x1afc5f=_0x7bddc0[_0x6c02('0xe')]({'plain':!![]});if(_0x1afc5f[_0x6c02('0xf')][_0x6c02('0x10')]()==='in'||_0x1afc5f['direction'][_0x6c02('0x10')]()===_0x6c02('0x11')&&!_0x1afc5f[_0x6c02('0x12')]&&!_[_0x6c02('0x13')](_0x1afc5f[_0x6c02('0x14')])){_0x40fecd['ChatInteraction'][_0x6c02('0x15')]({'where':{'id':_0x1afc5f['ChatInteractionId']}})[_0x6c02('0x16')](function(_0x2bbbc0){if(_0x2bbbc0){_0x2bbbc0[_0x6c02('0x17')]({'lastMsgAt':_0x1afc5f[_0x6c02('0x18')],'lastMsgDirection':_0x1afc5f[_0x6c02('0xf')][_0x6c02('0x10')]()});}})['catch'](function(_0x590ed9){console['error'](_0x590ed9);});}_0x420072();}},'charset':_0x6c02('0x19'),'collate':_0x6c02('0x1a')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 57214d9..7a40863 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 _0x720e=['redis','localhost','socket.io-emitter','./chatMessage.socket','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0x720e,0x18c));var _0xe720=function(_0x11cd17,_0x489e02){_0x11cd17=_0x11cd17-0x0;var _0x3343ad=_0x720e[_0x11cd17];return _0x3343ad;};'use strict';var _=require(_0xe720('0x0'));var util=require(_0xe720('0x1'));var moment=require(_0xe720('0x2'));var BPromise=require(_0xe720('0x3'));var rs=require(_0xe720('0x4'));var fs=require('fs');var Redis=require(_0xe720('0x5'));var db=require(_0xe720('0x6'))['db'];var utils=require(_0xe720('0x7'));var logger=require(_0xe720('0x8'))(_0xe720('0x9'));var config=require('../../config/environment');var jayson=require(_0xe720('0xa'));var client=jayson[_0xe720('0xb')]['http']({'port':0x232a});config[_0xe720('0xc')]=_['defaults'](config[_0xe720('0xc')],{'host':_0xe720('0xd'),'port':0x18eb});var socket=require(_0xe720('0xe'))(new Redis(config[_0xe720('0xc')]));require(_0xe720('0xf'))['register'](socket);function respondWithRpcPromise(_0x11b1eb,_0x701261,_0x9d2a8c){return new BPromise(function(_0x31c2da,_0x5cf3ec){return client['request'](_0x11b1eb,_0x9d2a8c)[_0xe720('0x10')](function(_0x406799){logger[_0xe720('0x11')](_0xe720('0x12'),_0x701261,'request\x20sent');logger[_0xe720('0x13')](_0xe720('0x14'),_0x701261,_0xe720('0x15'),JSON['stringify'](_0x406799));if(_0x406799['error']){if(_0x406799[_0xe720('0x16')][_0xe720('0x17')]===0x1f4){logger[_0xe720('0x16')](_0xe720('0x12'),_0x701261,_0x406799[_0xe720('0x16')][_0xe720('0x18')]);return _0x5cf3ec(_0x406799[_0xe720('0x16')][_0xe720('0x18')]);}logger[_0xe720('0x16')]('ChatMessage,\x20%s,\x20%s',_0x701261,_0x406799[_0xe720('0x16')][_0xe720('0x18')]);return _0x31c2da(_0x406799[_0xe720('0x16')]['message']);}else{logger[_0xe720('0x11')]('ChatMessage,\x20%s,\x20%s',_0x701261,_0xe720('0x15'));_0x31c2da(_0x406799[_0xe720('0x19')][_0xe720('0x18')]);}})[_0xe720('0x1a')](function(_0x1146db){logger[_0xe720('0x16')](_0xe720('0x12'),_0x701261,_0x1146db);_0x5cf3ec(_0x1146db);});});}exports[_0xe720('0x1b')]=function(_0x3b3ead){var _0x39b6b9=this;return new Promise(function(_0x40c431,_0x59b6d0){return db[_0xe720('0x1c')][_0xe720('0x1d')](_0x3b3ead[_0xe720('0x1e')],{'raw':_0x3b3ead[_0xe720('0x1f')]?_0x3b3ead['options'][_0xe720('0x20')]===undefined?!![]:![]:!![]})[_0xe720('0x10')](function(_0x3284ef){logger[_0xe720('0x11')]('CreateChatMessage',_0x3b3ead);logger[_0xe720('0x13')](_0xe720('0x1b'),_0x3b3ead,JSON[_0xe720('0x21')](_0x3284ef));_0x40c431(_0x3284ef);})['catch'](function(_0x3f5a8c){logger[_0xe720('0x16')](_0xe720('0x1b'),_0x3f5a8c[_0xe720('0x18')],_0x3b3ead);_0x59b6d0(_0x39b6b9[_0xe720('0x16')](0x1f4,_0x3f5a8c[_0xe720('0x18')]));});});}; \ No newline at end of file +var _0x0ab2=['error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2c2582,_0x3721fc){var _0x161553=function(_0x5410b9){while(--_0x5410b9){_0x2c2582['push'](_0x2c2582['shift']());}};_0x161553(++_0x3721fc);}(_0x0ab2,0xfa));var _0x20ab=function(_0x55bd7d,_0xd34f6a){_0x55bd7d=_0x55bd7d-0x0;var _0x1cfc13=_0x0ab2[_0x55bd7d];return _0x1cfc13;};'use strict';var _=require('lodash');var util=require(_0x20ab('0x0'));var moment=require(_0x20ab('0x1'));var BPromise=require(_0x20ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20ab('0x3'));var db=require(_0x20ab('0x4'))['db'];var utils=require(_0x20ab('0x5'));var logger=require('../../config/logger')(_0x20ab('0x6'));var config=require('../../config/environment');var jayson=require(_0x20ab('0x7'));var client=jayson[_0x20ab('0x8')][_0x20ab('0x9')]({'port':0x232a});config[_0x20ab('0xa')]=_[_0x20ab('0xb')](config[_0x20ab('0xa')],{'host':_0x20ab('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x20ab('0xa')]));require(_0x20ab('0xd'))[_0x20ab('0xe')](socket);function respondWithRpcPromise(_0x9dcf25,_0x2585bf,_0x2442ca){return new BPromise(function(_0x4012d4,_0x32418b){return client[_0x20ab('0xf')](_0x9dcf25,_0x2442ca)[_0x20ab('0x10')](function(_0x2096ad){logger[_0x20ab('0x11')](_0x20ab('0x12'),_0x2585bf,_0x20ab('0x13'));logger[_0x20ab('0x14')](_0x20ab('0x15'),_0x2585bf,_0x20ab('0x13'),JSON['stringify'](_0x2096ad));if(_0x2096ad['error']){if(_0x2096ad[_0x20ab('0x16')][_0x20ab('0x17')]===0x1f4){logger[_0x20ab('0x16')](_0x20ab('0x12'),_0x2585bf,_0x2096ad[_0x20ab('0x16')][_0x20ab('0x18')]);return _0x32418b(_0x2096ad[_0x20ab('0x16')]['message']);}logger[_0x20ab('0x16')](_0x20ab('0x12'),_0x2585bf,_0x2096ad[_0x20ab('0x16')]['message']);return _0x4012d4(_0x2096ad['error']['message']);}else{logger[_0x20ab('0x11')](_0x20ab('0x12'),_0x2585bf,_0x20ab('0x13'));_0x4012d4(_0x2096ad[_0x20ab('0x19')][_0x20ab('0x18')]);}})[_0x20ab('0x1a')](function(_0x23e76a){logger['error'](_0x20ab('0x12'),_0x2585bf,_0x23e76a);_0x32418b(_0x23e76a);});});}exports[_0x20ab('0x1b')]=function(_0x3c7b9b){var _0x1fe175=this;return new Promise(function(_0x3930ec,_0x46b86e){return db[_0x20ab('0x1c')][_0x20ab('0x1d')](_0x3c7b9b[_0x20ab('0x1e')],{'raw':_0x3c7b9b['options']?_0x3c7b9b[_0x20ab('0x1f')][_0x20ab('0x20')]===undefined?!![]:![]:!![]})[_0x20ab('0x10')](function(_0x5883b3){logger[_0x20ab('0x11')](_0x20ab('0x1b'),_0x3c7b9b);logger['debug'](_0x20ab('0x1b'),_0x3c7b9b,JSON[_0x20ab('0x21')](_0x5883b3));_0x3930ec(_0x5883b3);})[_0x20ab('0x1a')](function(_0x18063b){logger[_0x20ab('0x16')]('CreateChatMessage',_0x18063b[_0x20ab('0x18')],_0x3c7b9b);_0x46b86e(_0x1fe175['error'](0x1f4,_0x18063b[_0x20ab('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 3cc2e9a..7997c52 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 _0xdc97=['./chatMessage.events','save','remove','emit','removeListener','register','chatMessage:'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0xdc97,0x13b));var _0x7dc9=function(_0x24d04c,_0x1f6977){_0x24d04c=_0x24d04c-0x0;var _0x2d895c=_0xdc97[_0x24d04c];return _0x2d895c;};'use strict';var ChatMessageEvents=require(_0x7dc9('0x0'));var events=[_0x7dc9('0x1'),_0x7dc9('0x2'),'update'];function createListener(_0x2913e6,_0x4f5c88){return function(_0x228e39){_0x4f5c88[_0x7dc9('0x3')](_0x2913e6,_0x228e39);};}function removeListener(_0x478a95,_0x2a77c1){return function(){ChatMessageEvents[_0x7dc9('0x4')](_0x478a95,_0x2a77c1);};}exports[_0x7dc9('0x5')]=function(_0x3ba3ca){for(var _0x589f02=0x0,_0x2636ef=events['length'];_0x589f02<_0x2636ef;_0x589f02++){var _0x4b3229=events[_0x589f02];var _0x2ff923=createListener(_0x7dc9('0x6')+_0x4b3229,_0x3ba3ca);ChatMessageEvents['on'](_0x4b3229,_0x2ff923);}}; \ No newline at end of file +var _0x2a3a=['save','remove','update','emit','removeListener','register','length','./chatMessage.events'];(function(_0xe0b186,_0xc9c593){var _0x2d82c1=function(_0x4e0ea9){while(--_0x4e0ea9){_0xe0b186['push'](_0xe0b186['shift']());}};_0x2d82c1(++_0xc9c593);}(_0x2a3a,0x1bf));var _0xa2a3=function(_0x24d1d7,_0xf48769){_0x24d1d7=_0x24d1d7-0x0;var _0x7c8678=_0x2a3a[_0x24d1d7];return _0x7c8678;};'use strict';var ChatMessageEvents=require(_0xa2a3('0x0'));var events=[_0xa2a3('0x1'),_0xa2a3('0x2'),_0xa2a3('0x3')];function createListener(_0x45ba85,_0x4caf0f){return function(_0x531167){_0x4caf0f[_0xa2a3('0x4')](_0x45ba85,_0x531167);};}function removeListener(_0x34d7f9,_0x1e61b2){return function(){ChatMessageEvents[_0xa2a3('0x5')](_0x34d7f9,_0x1e61b2);};}exports[_0xa2a3('0x6')]=function(_0xf652d7){for(var _0x186655=0x0,_0x5e5e50=events[_0xa2a3('0x7')];_0x186655<_0x5e5e50;_0x186655++){var _0x196c96=events[_0x186655];var _0x2a3753=createListener('chatMessage:'+_0x196c96,_0xf652d7);ChatMessageEvents['on'](_0x196c96,_0x2a3753);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index f9d1b2c..77ce8ea 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 _0x7f1b=['/:id/reject','reject','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','/:id','show','post','tracked','chat','chatmessage:create','put','/:id/accept','accept'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7f1b,0x93));var _0xb7f1=function(_0x1b9eed,_0x54f3f8){_0x1b9eed=_0x1b9eed-0x0;var _0x1e7907=_0x7f1b[_0x1b9eed];return _0x1e7907;};'use strict';var multer=require(_0xb7f1('0x0'));var util=require(_0xb7f1('0x1'));var path=require(_0xb7f1('0x2'));var timeout=require('connect-timeout');var express=require(_0xb7f1('0x3'));var router=express[_0xb7f1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb7f1('0x5'));var interaction=require(_0xb7f1('0x6'));var config=require(_0xb7f1('0x7'));var controller=require(_0xb7f1('0x8'));router[_0xb7f1('0x9')]('/',auth[_0xb7f1('0xa')](),controller['index']);router[_0xb7f1('0x9')](_0xb7f1('0xb'),auth[_0xb7f1('0xa')](),controller['describe']);router[_0xb7f1('0x9')](_0xb7f1('0xc'),auth[_0xb7f1('0xa')](),controller[_0xb7f1('0xd')]);router[_0xb7f1('0xe')]('/',auth[_0xb7f1('0xa')](),interaction[_0xb7f1('0xf')](_0xb7f1('0x10'),_0xb7f1('0x11')),controller['create']);router[_0xb7f1('0x12')](_0xb7f1('0xc'),controller['update']);router[_0xb7f1('0x12')](_0xb7f1('0x13'),auth[_0xb7f1('0xa')](),controller[_0xb7f1('0x14')]);router[_0xb7f1('0x12')](_0xb7f1('0x15'),auth[_0xb7f1('0xa')](),controller[_0xb7f1('0x16')]);router['delete'](_0xb7f1('0xc'),auth[_0xb7f1('0xa')](),controller['destroy']);module[_0xb7f1('0x17')]=router; \ No newline at end of file +var _0xd3a8=['tracked','chat','chatmessage:create','put','update','accept','reject','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','post'];(function(_0x5c4444,_0x119726){var _0x20d93d=function(_0x326a33){while(--_0x326a33){_0x5c4444['push'](_0x5c4444['shift']());}};_0x20d93d(++_0x119726);}(_0xd3a8,0x1be));var _0x8d3a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd3a8[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8d3a('0x0'));var timeout=require(_0x8d3a('0x1'));var express=require(_0x8d3a('0x2'));var router=express[_0x8d3a('0x3')]();var fs_extra=require(_0x8d3a('0x4'));var auth=require(_0x8d3a('0x5'));var interaction=require(_0x8d3a('0x6'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router[_0x8d3a('0x7')]('/',auth['isAuthenticated'](),controller[_0x8d3a('0x8')]);router['get'](_0x8d3a('0x9'),auth[_0x8d3a('0xa')](),controller[_0x8d3a('0xb')]);router[_0x8d3a('0x7')](_0x8d3a('0xc'),auth[_0x8d3a('0xa')](),controller['show']);router[_0x8d3a('0xd')]('/',auth[_0x8d3a('0xa')](),interaction[_0x8d3a('0xe')](_0x8d3a('0xf'),_0x8d3a('0x10')),controller['create']);router[_0x8d3a('0x11')](_0x8d3a('0xc'),controller[_0x8d3a('0x12')]);router['put']('/:id/accept',auth[_0x8d3a('0xa')](),controller[_0x8d3a('0x13')]);router[_0x8d3a('0x11')]('/:id/reject',auth[_0x8d3a('0xa')](),controller[_0x8d3a('0x14')]);router['delete'](_0x8d3a('0xc'),auth[_0x8d3a('0xa')](),controller[_0x8d3a('0x15')]);module[_0x8d3a('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 0e257b4..51d7101 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 _0x2032=['medium','exports','TEXT'];(function(_0x1cc294,_0x5d677d){var _0x9af5f=function(_0x55a876){while(--_0x55a876){_0x1cc294['push'](_0x1cc294['shift']());}};_0x9af5f(++_0x5d677d);}(_0x2032,0xd9));var _0x2203=function(_0x54ca53,_0x5151db){_0x54ca53=_0x54ca53-0x0;var _0x5b2535=_0x2032[_0x54ca53];return _0x5b2535;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xb10b=['medium','sequelize','TEXT'];(function(_0xa8aea7,_0x541dcf){var _0x16fb90=function(_0x4372a0){while(--_0x4372a0){_0xa8aea7['push'](_0xa8aea7['shift']());}};_0x16fb90(++_0x541dcf);}(_0xb10b,0x12a));var _0xbb10=function(_0x5641d9,_0x1de53b){_0x5641d9=_0x5641d9-0x0;var _0x1b1f89=_0xb10b[_0x5641d9];return _0x1b1f89;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 26fd386..63798c3 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(_0x17722f,_0x4abcc9){var _0x57fed7=function(_0x469852){while(--_0x469852){_0x17722f['push'](_0x17722f['shift']());}};_0x57fed7(++_0x4abcc9);}(_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 _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(_0x1d89f3,_0x36771e){var _0x324219=function(_0x22d2e1){while(--_0x22d2e1){_0x1d89f3['push'](_0x1d89f3['shift']());}};_0x324219(++_0x36771e);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 4eef8bf..63e7459 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97f4=['../../mysqldb','ChatOfflineMessage','save','update','emit','hasOwnProperty','hook','events'];(function(_0x3adf01,_0x849e75){var _0x2affd5=function(_0x34e16b){while(--_0x34e16b){_0x3adf01['push'](_0x3adf01['shift']());}};_0x2affd5(++_0x849e75);}(_0x97f4,0xcf));var _0x497f=function(_0x45ce28,_0x17b39d){_0x45ce28=_0x45ce28-0x0;var _0x19016a=_0x97f4[_0x45ce28];return _0x19016a;};'use strict';var EventEmitter=require(_0x497f('0x0'));var ChatOfflineMessage=require(_0x497f('0x1'))['db'][_0x497f('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x497f('0x3'),'afterUpdate':_0x497f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x42d4ee){return function(_0x4cede1,_0x504510,_0x164c4e){ChatOfflineMessageEvents[_0x497f('0x5')](_0x42d4ee+':'+_0x4cede1['id'],_0x4cede1);ChatOfflineMessageEvents[_0x497f('0x5')](_0x42d4ee,_0x4cede1);_0x164c4e(null);};}for(var e in events){if(events[_0x497f('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x497f('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x4540=['../../mysqldb','update','emit','hook','events'];(function(_0x319e2e,_0x2f727f){var _0x302524=function(_0x5cad9d){while(--_0x5cad9d){_0x319e2e['push'](_0x319e2e['shift']());}};_0x302524(++_0x2f727f);}(_0x4540,0x17b));var _0x0454=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4540[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x0454('0x0'));var ChatOfflineMessage=require(_0x0454('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0454('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2f2949){return function(_0x3e3d5e,_0x111964,_0x10cede){ChatOfflineMessageEvents[_0x0454('0x3')](_0x2f2949+':'+_0x3e3d5e['id'],_0x3e3d5e);ChatOfflineMessageEvents[_0x0454('0x3')](_0x2f2949,_0x3e3d5e);_0x10cede(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x0454('0x4')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index cb3439c..7ae8928 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 _0xe4e4=['ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe4e4,0xab));var _0x4e4e=function(_0x507af4,_0x1f346f){_0x507af4=_0x507af4-0x0;var _0x1fb635=_0xe4e4[_0x507af4];return _0x1fb635;};'use strict';var attributes=require(_0x4e4e('0x0'));module[_0x4e4e('0x1')]=function(_0x434db9){return _0x434db9[_0x4e4e('0x2')](_0x4e4e('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4e4e('0x4'),'collate':_0x4e4e('0x5')});}; \ No newline at end of file +var _0xe5d8=['define','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0xe5d8,0x12a));var _0x8e5d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe5d8[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0x8e5d('0x0'));module[_0x8e5d('0x1')]=function(_0xc3d31c){return _0xc3d31c[_0x8e5d('0x2')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8e5d('0x3')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 9133174..04db955 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 _0xd819=['code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5e9852,_0x16a98b){var _0xd9ec59=function(_0x46044c){while(--_0x46044c){_0x5e9852['push'](_0x5e9852['shift']());}};_0xd9ec59(++_0x16a98b);}(_0xd819,0x1d1));var _0x9d81=function(_0x2608cc,_0x550602){_0x2608cc=_0x2608cc-0x0;var _0x671ece=_0xd819[_0x2608cc];return _0x671ece;};'use strict';var _=require(_0x9d81('0x0'));var util=require(_0x9d81('0x1'));var moment=require(_0x9d81('0x2'));var BPromise=require(_0x9d81('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d81('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d81('0x5'));var logger=require(_0x9d81('0x6'))('rpc');var config=require(_0x9d81('0x7'));var jayson=require(_0x9d81('0x8'));var client=jayson[_0x9d81('0x9')][_0x9d81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23763c,_0x4e4bab,_0x414473){return new BPromise(function(_0x11ed32,_0x5c4d63){return client[_0x9d81('0xb')](_0x23763c,_0x414473)[_0x9d81('0xc')](function(_0x31d419){logger['info'](_0x9d81('0xd'),_0x4e4bab,_0x9d81('0xe'));logger['debug'](_0x9d81('0xf'),_0x4e4bab,_0x9d81('0xe'),JSON[_0x9d81('0x10')](_0x31d419));if(_0x31d419[_0x9d81('0x11')]){if(_0x31d419[_0x9d81('0x11')][_0x9d81('0x12')]===0x1f4){logger[_0x9d81('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4e4bab,_0x31d419[_0x9d81('0x11')][_0x9d81('0x13')]);return _0x5c4d63(_0x31d419[_0x9d81('0x11')]['message']);}logger['error'](_0x9d81('0xd'),_0x4e4bab,_0x31d419[_0x9d81('0x11')][_0x9d81('0x13')]);return _0x11ed32(_0x31d419[_0x9d81('0x11')][_0x9d81('0x13')]);}else{logger[_0x9d81('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4e4bab,_0x9d81('0xe'));_0x11ed32(_0x31d419[_0x9d81('0x15')][_0x9d81('0x13')]);}})[_0x9d81('0x16')](function(_0x80c200){logger[_0x9d81('0x11')](_0x9d81('0xd'),_0x4e4bab,_0x80c200);_0x5c4d63(_0x80c200);});});} \ No newline at end of file +var _0x4c85=['error','code','message','ChatOfflineMessage,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify'];(function(_0x3ca20f,_0x413885){var _0x1d53d0=function(_0x39702e){while(--_0x39702e){_0x3ca20f['push'](_0x3ca20f['shift']());}};_0x1d53d0(++_0x413885);}(_0x4c85,0xb6));var _0x54c8=function(_0x90463c,_0x13c378){_0x90463c=_0x90463c-0x0;var _0x5c8709=_0x4c85[_0x90463c];return _0x5c8709;};'use strict';var _=require(_0x54c8('0x0'));var util=require(_0x54c8('0x1'));var moment=require(_0x54c8('0x2'));var BPromise=require(_0x54c8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54c8('0x4'));var db=require(_0x54c8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x54c8('0x6'));var config=require(_0x54c8('0x7'));var jayson=require(_0x54c8('0x8'));var client=jayson[_0x54c8('0x9')][_0x54c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x527695,_0xa79964,_0x48ab4c){return new BPromise(function(_0x1feafd,_0x246508){return client[_0x54c8('0xb')](_0x527695,_0x48ab4c)[_0x54c8('0xc')](function(_0x175cd5){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xa79964,_0x54c8('0xd'));logger[_0x54c8('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xa79964,_0x54c8('0xd'),JSON[_0x54c8('0xf')](_0x175cd5));if(_0x175cd5[_0x54c8('0x10')]){if(_0x175cd5[_0x54c8('0x10')][_0x54c8('0x11')]===0x1f4){logger[_0x54c8('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0xa79964,_0x175cd5[_0x54c8('0x10')]['message']);return _0x246508(_0x175cd5[_0x54c8('0x10')][_0x54c8('0x12')]);}logger[_0x54c8('0x10')](_0x54c8('0x13'),_0xa79964,_0x175cd5[_0x54c8('0x10')]['message']);return _0x1feafd(_0x175cd5[_0x54c8('0x10')][_0x54c8('0x12')]);}else{logger['info'](_0x54c8('0x13'),_0xa79964,'request\x20sent');_0x1feafd(_0x175cd5[_0x54c8('0x14')][_0x54c8('0x12')]);}})[_0x54c8('0x15')](function(_0x1b1557){logger['error'](_0x54c8('0x13'),_0xa79964,_0x1b1557);_0x246508(_0x1b1557);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 9685e84..f606fdb 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 _0x024f=['get','isAuthenticated','describe','/:id','show','post','create','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x344adc,_0x183c37){var _0x4014b2=function(_0xe809e5){while(--_0xe809e5){_0x344adc['push'](_0x344adc['shift']());}};_0x4014b2(++_0x183c37);}(_0x024f,0xa3));var _0xf024=function(_0x176fed,_0x4c4a21){_0x176fed=_0x176fed-0x0;var _0x31758c=_0x024f[_0x176fed];return _0x31758c;};'use strict';var multer=require(_0xf024('0x0'));var util=require(_0xf024('0x1'));var path=require(_0xf024('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf024('0x3')]();var fs_extra=require(_0xf024('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf024('0x5'));var config=require(_0xf024('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0xf024('0x7')]('/',auth[_0xf024('0x8')](),controller['index']);router[_0xf024('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xf024('0x9')]);router[_0xf024('0x7')](_0xf024('0xa'),auth[_0xf024('0x8')](),controller[_0xf024('0xb')]);router[_0xf024('0xc')]('/',auth[_0xf024('0x8')](),controller[_0xf024('0xd')]);router['put']('/:id',auth[_0xf024('0x8')](),controller['update']);router[_0xf024('0xe')](_0xf024('0xa'),auth['isAuthenticated'](),controller[_0xf024('0xf')]);module[_0xf024('0x10')]=router; \ No newline at end of file +var _0x44a4=['describe','post','put','/:id','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x7275e9,_0x321fa5){var _0x17b99d=function(_0x54af41){while(--_0x54af41){_0x7275e9['push'](_0x7275e9['shift']());}};_0x17b99d(++_0x321fa5);}(_0x44a4,0x1e3));var _0x444a=function(_0xb3388c,_0x64dbda){_0xb3388c=_0xb3388c-0x0;var _0x133e9a=_0x44a4[_0xb3388c];return _0x133e9a;};'use strict';var multer=require(_0x444a('0x0'));var util=require(_0x444a('0x1'));var path=require(_0x444a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x444a('0x3'));var auth=require(_0x444a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x444a('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0x444a('0x6')]('/',auth[_0x444a('0x7')](),controller[_0x444a('0x8')]);router[_0x444a('0x6')](_0x444a('0x9'),auth[_0x444a('0x7')](),controller[_0x444a('0xa')]);router[_0x444a('0x6')]('/:id',auth[_0x444a('0x7')](),controller['show']);router[_0x444a('0xb')]('/',auth[_0x444a('0x7')](),controller['create']);router[_0x444a('0xc')](_0x444a('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x444a('0xe')](_0x444a('0xd'),auth[_0x444a('0x7')](),controller[_0x444a('0xf')]);module[_0x444a('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 5ecd40d..5b731c6 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 _0x5e92=['timeout','STRING','INTEGER','sequelize','exports','ENUM'];(function(_0x11496d,_0x137678){var _0x52706f=function(_0x207e86){while(--_0x207e86){_0x11496d['push'](_0x11496d['shift']());}};_0x52706f(++_0x137678);}(_0x5e92,0x189));var _0x25e9=function(_0x1bea6b,_0xbb96eb){_0x1bea6b=_0x1bea6b-0x0;var _0x58f421=_0x5e92[_0x1bea6b];return _0x58f421;};'use strict';var Sequelize=require(_0x25e9('0x0'));module[_0x25e9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x25e9('0x2')]('mouseOver',_0x25e9('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x25e9('0x4')]},'timeout':{'type':Sequelize[_0x25e9('0x5')]}}; \ No newline at end of file +var _0x97fa=['STRING','INTEGER','sequelize','exports','ENUM','mouseOver','timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x97fa,0x175));var _0xa97f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x97fa[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa97f('0x0'));module[_0xa97f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xa97f('0x2')](_0xa97f('0x3'),_0xa97f('0x4')),'defaultValue':_0xa97f('0x3')},'selector':{'type':Sequelize[_0xa97f('0x5')]},'timeout':{'type':Sequelize[_0xa97f('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index cee3f0e..53d1886 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 _0x1b20=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','status','limit','undefined','count','offset','Content-Range','apply','reject','update','then','destroy','stack','name','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','create','body','catch','params','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0x1add0f,_0x551800){var _0x3fa363=function(_0x471a15){while(--_0x471a15){_0x1add0f['push'](_0x1add0f['shift']());}};_0x3fa363(++_0x551800);}(_0x1b20,0x66));var _0x01b2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1b20[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01b2('0x0'));var zipdir=require(_0x01b2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x01b2('0x2'));var BPromise=require(_0x01b2('0x3'));var Mustache=require(_0x01b2('0x4'));var util=require(_0x01b2('0x5'));var path=require(_0x01b2('0x6'));var sox=require(_0x01b2('0x7'));var csv=require(_0x01b2('0x8'));var ejs=require(_0x01b2('0x9'));var fs=require('fs');var fs_extra=require(_0x01b2('0xa'));var _=require(_0x01b2('0xb'));var squel=require(_0x01b2('0xc'));var crypto=require(_0x01b2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x01b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x01b2('0xf'));var Papa=require(_0x01b2('0x10'));var Redis=require(_0x01b2('0x11'));var authService=require(_0x01b2('0x12'));var qs=require(_0x01b2('0x13'));var as=require(_0x01b2('0x14'));var hardwareService=require(_0x01b2('0x15'));var logger=require(_0x01b2('0x16'))('api');var utils=require(_0x01b2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x01b2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41a618,_0x8ac569){_0x8ac569=_0x8ac569||0xcc;return function(_0x2c6d4d){if(_0x2c6d4d){return _0x41a618[_0x01b2('0x19')](_0x8ac569);}return _0x41a618['status'](_0x8ac569)[_0x01b2('0x1a')]();};}function respondWithResult(_0x2e7b31,_0x4f1c15){_0x4f1c15=_0x4f1c15||0xc8;return function(_0x1626ba){if(_0x1626ba){return _0x2e7b31[_0x01b2('0x1b')](_0x4f1c15)['json'](_0x1626ba);}};}function respondWithFilteredResult(_0x299d0c,_0x3d5833){return function(_0x1a9734){if(_0x1a9734){var _0x3f68a8=typeof _0x3d5833['offset']==='undefined'&&typeof _0x3d5833[_0x01b2('0x1c')]===_0x01b2('0x1d');var _0x588dbe=_0x1a9734[_0x01b2('0x1e')];var _0x444236=_0x3f68a8?0x0:_0x3d5833[_0x01b2('0x1f')];var _0x5986f5=_0x3f68a8?_0x1a9734[_0x01b2('0x1e')]:_0x3d5833[_0x01b2('0x1f')]+_0x3d5833[_0x01b2('0x1c')];var _0xd2acbb;if(_0x5986f5>=_0x588dbe){_0x5986f5=_0x588dbe;_0xd2acbb=0xc8;}else{_0xd2acbb=0xce;}_0x299d0c[_0x01b2('0x1b')](_0xd2acbb);return _0x299d0c['set'](_0x01b2('0x20'),_0x444236+'-'+_0x5986f5+'/'+_0x588dbe)['json'](_0x1a9734);}return null;};}function patchUpdates(_0x7464e5){return function(_0x4c0008){try{jsonpatch[_0x01b2('0x21')](_0x4c0008,_0x7464e5,!![]);}catch(_0x266264){return BPromise[_0x01b2('0x22')](_0x266264);}return _0x4c0008['save']();};}function saveUpdates(_0x269b54,_0x2f01b0){return function(_0xc3027){if(_0xc3027){return _0xc3027[_0x01b2('0x23')](_0x269b54)[_0x01b2('0x24')](function(_0x479e94){return _0x479e94;});}return null;};}function removeEntity(_0x1874b9,_0x539db1){return function(_0x54e866){if(_0x54e866){return _0x54e866[_0x01b2('0x25')]()[_0x01b2('0x24')](function(){_0x1874b9[_0x01b2('0x1b')](0xcc)[_0x01b2('0x1a')]();});}};}function handleEntityNotFound(_0x2e32c1,_0x307229){return function(_0x4920f7){if(!_0x4920f7){_0x2e32c1[_0x01b2('0x19')](0x194);}return _0x4920f7;};}function handleError(_0x239543,_0x424cfd){_0x424cfd=_0x424cfd||0x1f4;return function(_0x17274f){logger['error'](_0x17274f[_0x01b2('0x26')]);if(_0x17274f['name']){delete _0x17274f[_0x01b2('0x27')];}_0x239543[_0x01b2('0x1b')](_0x424cfd)['send'](_0x17274f);};}exports[_0x01b2('0x28')]=function(_0x5efdda,_0x487c49){var _0x291d56={'raw':!![],'where':{'id':_0x5efdda['params']['id']}},_0x4363ec={};_0x4363ec[_0x01b2('0x29')]=_[_0x01b2('0x2a')](db[_0x01b2('0x2b')][_0x01b2('0x2c')]);_0x4363ec[_0x01b2('0x2d')]=_[_0x01b2('0x2a')](_0x5efdda[_0x01b2('0x2d')]);_0x4363ec[_0x01b2('0x2e')]=_[_0x01b2('0x2f')](_0x4363ec[_0x01b2('0x29')],_0x4363ec[_0x01b2('0x2d')]);_0x291d56['attributes']=_[_0x01b2('0x2f')](_0x4363ec[_0x01b2('0x29')],qs[_0x01b2('0x30')](_0x5efdda[_0x01b2('0x2d')][_0x01b2('0x30')]));_0x291d56[_0x01b2('0x31')]=_0x291d56['attributes']['length']?_0x291d56[_0x01b2('0x31')]:_0x4363ec['model'];if(_0x5efdda['query'][_0x01b2('0x32')]){_0x291d56[_0x01b2('0x33')]=[{'all':!![]}];}_0x291d56=_[_0x01b2('0x34')]({},_0x291d56,_0x5efdda[_0x01b2('0x35')]);return db['ChatProactiveAction'][_0x01b2('0x36')](_0x291d56)['then'](handleEntityNotFound(_0x487c49,null))[_0x01b2('0x24')](respondWithResult(_0x487c49,null))['catch'](handleError(_0x487c49,null));};exports['create']=function(_0x5e23dd,_0x2dc1c5){return db[_0x01b2('0x2b')][_0x01b2('0x37')](_0x5e23dd[_0x01b2('0x38')],{})['then'](respondWithResult(_0x2dc1c5,0xc9))[_0x01b2('0x39')](handleError(_0x2dc1c5,null));};exports[_0x01b2('0x23')]=function(_0x5865a3,_0xecbce4){if(_0x5865a3[_0x01b2('0x38')]['id']){delete _0x5865a3[_0x01b2('0x38')]['id'];}return db[_0x01b2('0x2b')][_0x01b2('0x36')]({'where':{'id':_0x5865a3[_0x01b2('0x3a')]['id']}})['then'](handleEntityNotFound(_0xecbce4,null))[_0x01b2('0x24')](saveUpdates(_0x5865a3[_0x01b2('0x38')],null))['then'](respondWithResult(_0xecbce4,null))['catch'](handleError(_0xecbce4,null));};exports[_0x01b2('0x25')]=function(_0x3d7e77,_0x4555c8){return db[_0x01b2('0x2b')][_0x01b2('0x36')]({'where':{'id':_0x3d7e77[_0x01b2('0x3a')]['id']}})['then'](handleEntityNotFound(_0x4555c8,null))['then'](removeEntity(_0x4555c8,null))[_0x01b2('0x39')](handleError(_0x4555c8,null));}; \ No newline at end of file +var _0xff16=['catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','stack','name','send','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','create','body','params'];(function(_0x5f21e5,_0x3832a7){var _0x16533a=function(_0x3d7947){while(--_0x3d7947){_0x5f21e5['push'](_0x5f21e5['shift']());}};_0x16533a(++_0x3832a7);}(_0xff16,0x7f));var _0x6ff1=function(_0x25d18b,_0x5c7657){_0x25d18b=_0x25d18b-0x0;var _0x4fec49=_0xff16[_0x25d18b];return _0x4fec49;};'use strict';var emlformat=require(_0x6ff1('0x0'));var rimraf=require(_0x6ff1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ff1('0x2'));var rp=require(_0x6ff1('0x3'));var moment=require(_0x6ff1('0x4'));var BPromise=require(_0x6ff1('0x5'));var Mustache=require(_0x6ff1('0x6'));var util=require(_0x6ff1('0x7'));var path=require(_0x6ff1('0x8'));var sox=require(_0x6ff1('0x9'));var csv=require('to-csv');var ejs=require(_0x6ff1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ff1('0xb'));var squel=require(_0x6ff1('0xc'));var crypto=require(_0x6ff1('0xd'));var jsforce=require(_0x6ff1('0xe'));var deskjs=require(_0x6ff1('0xf'));var toCsv=require(_0x6ff1('0x10'));var querystring=require(_0x6ff1('0x11'));var Papa=require(_0x6ff1('0x12'));var Redis=require('ioredis');var authService=require(_0x6ff1('0x13'));var qs=require(_0x6ff1('0x14'));var as=require(_0x6ff1('0x15'));var hardwareService=require(_0x6ff1('0x16'));var logger=require(_0x6ff1('0x17'))(_0x6ff1('0x18'));var utils=require(_0x6ff1('0x19'));var config=require(_0x6ff1('0x1a'));var licenseUtil=require(_0x6ff1('0x1b'));var db=require(_0x6ff1('0x1c'))['db'];function respondWithStatusCode(_0x4e8484,_0x5cf649){_0x5cf649=_0x5cf649||0xcc;return function(_0x5dacd6){if(_0x5dacd6){return _0x4e8484['sendStatus'](_0x5cf649);}return _0x4e8484[_0x6ff1('0x1d')](_0x5cf649)[_0x6ff1('0x1e')]();};}function respondWithResult(_0x1451af,_0x543e07){_0x543e07=_0x543e07||0xc8;return function(_0x58952d){if(_0x58952d){return _0x1451af['status'](_0x543e07)[_0x6ff1('0x1f')](_0x58952d);}};}function respondWithFilteredResult(_0x1ec8e9,_0x23112d){return function(_0x29e6c7){if(_0x29e6c7){var _0x36fa15=typeof _0x23112d[_0x6ff1('0x20')]==='undefined'&&typeof _0x23112d[_0x6ff1('0x21')]===_0x6ff1('0x22');var _0x4751b9=_0x29e6c7[_0x6ff1('0x23')];var _0xe5d26e=_0x36fa15?0x0:_0x23112d[_0x6ff1('0x20')];var _0x5041d7=_0x36fa15?_0x29e6c7[_0x6ff1('0x23')]:_0x23112d[_0x6ff1('0x20')]+_0x23112d[_0x6ff1('0x21')];var _0x256457;if(_0x5041d7>=_0x4751b9){_0x5041d7=_0x4751b9;_0x256457=0xc8;}else{_0x256457=0xce;}_0x1ec8e9[_0x6ff1('0x1d')](_0x256457);return _0x1ec8e9[_0x6ff1('0x24')]('Content-Range',_0xe5d26e+'-'+_0x5041d7+'/'+_0x4751b9)[_0x6ff1('0x1f')](_0x29e6c7);}return null;};}function patchUpdates(_0x54c961){return function(_0x328325){try{jsonpatch[_0x6ff1('0x25')](_0x328325,_0x54c961,!![]);}catch(_0x2d3131){return BPromise[_0x6ff1('0x26')](_0x2d3131);}return _0x328325[_0x6ff1('0x27')]();};}function saveUpdates(_0x47fd1f,_0x56027f){return function(_0x561bcd){if(_0x561bcd){return _0x561bcd['update'](_0x47fd1f)[_0x6ff1('0x28')](function(_0xbdd73e){return _0xbdd73e;});}return null;};}function removeEntity(_0x4b3d22,_0x41b160){return function(_0x1ec4f1){if(_0x1ec4f1){return _0x1ec4f1[_0x6ff1('0x29')]()[_0x6ff1('0x28')](function(){_0x4b3d22[_0x6ff1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13acb3,_0x324645){return function(_0x13ff47){if(!_0x13ff47){_0x13acb3['sendStatus'](0x194);}return _0x13ff47;};}function handleError(_0x512759,_0x17036d){_0x17036d=_0x17036d||0x1f4;return function(_0x2705d4){logger['error'](_0x2705d4[_0x6ff1('0x2a')]);if(_0x2705d4[_0x6ff1('0x2b')]){delete _0x2705d4['name'];}_0x512759[_0x6ff1('0x1d')](_0x17036d)[_0x6ff1('0x2c')](_0x2705d4);};}exports['show']=function(_0x3cc69e,_0x3597c6){var _0x2f7006={'raw':!![],'where':{'id':_0x3cc69e['params']['id']}},_0x193c09={};_0x193c09[_0x6ff1('0x2d')]=_[_0x6ff1('0x2e')](db[_0x6ff1('0x2f')][_0x6ff1('0x30')]);_0x193c09[_0x6ff1('0x31')]=_['keys'](_0x3cc69e[_0x6ff1('0x31')]);_0x193c09[_0x6ff1('0x32')]=_[_0x6ff1('0x33')](_0x193c09['model'],_0x193c09[_0x6ff1('0x31')]);_0x2f7006['attributes']=_[_0x6ff1('0x33')](_0x193c09[_0x6ff1('0x2d')],qs[_0x6ff1('0x34')](_0x3cc69e[_0x6ff1('0x31')][_0x6ff1('0x34')]));_0x2f7006[_0x6ff1('0x35')]=_0x2f7006[_0x6ff1('0x35')]['length']?_0x2f7006['attributes']:_0x193c09[_0x6ff1('0x2d')];if(_0x3cc69e[_0x6ff1('0x31')][_0x6ff1('0x36')]){_0x2f7006[_0x6ff1('0x37')]=[{'all':!![]}];}_0x2f7006=_[_0x6ff1('0x38')]({},_0x2f7006,_0x3cc69e[_0x6ff1('0x39')]);return db['ChatProactiveAction'][_0x6ff1('0x3a')](_0x2f7006)[_0x6ff1('0x28')](handleEntityNotFound(_0x3597c6,null))[_0x6ff1('0x28')](respondWithResult(_0x3597c6,null))['catch'](handleError(_0x3597c6,null));};exports[_0x6ff1('0x3b')]=function(_0x48e7d9,_0x12affb){return db['ChatProactiveAction'][_0x6ff1('0x3b')](_0x48e7d9[_0x6ff1('0x3c')],{})['then'](respondWithResult(_0x12affb,0xc9))['catch'](handleError(_0x12affb,null));};exports['update']=function(_0x2f6172,_0xcf4451){if(_0x2f6172[_0x6ff1('0x3c')]['id']){delete _0x2f6172[_0x6ff1('0x3c')]['id'];}return db[_0x6ff1('0x2f')]['find']({'where':{'id':_0x2f6172[_0x6ff1('0x3d')]['id']}})['then'](handleEntityNotFound(_0xcf4451,null))[_0x6ff1('0x28')](saveUpdates(_0x2f6172['body'],null))['then'](respondWithResult(_0xcf4451,null))[_0x6ff1('0x3e')](handleError(_0xcf4451,null));};exports[_0x6ff1('0x29')]=function(_0x3f8d42,_0x91ddc7){return db[_0x6ff1('0x2f')][_0x6ff1('0x3a')]({'where':{'id':_0x3f8d42['params']['id']}})[_0x6ff1('0x28')](handleEntityNotFound(_0x91ddc7,null))[_0x6ff1('0x28')](removeEntity(_0x91ddc7,null))['catch'](handleError(_0x91ddc7,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index c08d06a..1bde25e 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 _0x7cae=['define','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x55677b,_0x3e5655){var _0x104b88=function(_0x78d34f){while(--_0x78d34f){_0x55677b['push'](_0x55677b['shift']());}};_0x104b88(++_0x3e5655);}(_0x7cae,0x1d6));var _0xe7ca=function(_0x429db2,_0x1fe28d){_0x429db2=_0x429db2-0x0;var _0xa15965=_0x7cae[_0x429db2];return _0xa15965;};'use strict';var _=require(_0xe7ca('0x0'));var util=require(_0xe7ca('0x1'));var logger=require(_0xe7ca('0x2'))(_0xe7ca('0x3'));var moment=require(_0xe7ca('0x4'));var BPromise=require(_0xe7ca('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7ca('0x6'));var rimraf=require(_0xe7ca('0x7'));var config=require(_0xe7ca('0x8'));var attributes=require(_0xe7ca('0x9'));module['exports']=function(_0x488aeb,_0x3f1f15){return _0x488aeb[_0xe7ca('0xa')]('ChatProactiveAction',attributes,{'tableName':_0xe7ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8031=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x128ec9,_0x3d9159){var _0x3bdf82=function(_0x2fa7dd){while(--_0x2fa7dd){_0x128ec9['push'](_0x128ec9['shift']());}};_0x3bdf82(++_0x3d9159);}(_0x8031,0x181));var _0x1803=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x8031[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0x1803('0x0'));var util=require(_0x1803('0x1'));var logger=require(_0x1803('0x2'))('api');var moment=require(_0x1803('0x3'));var BPromise=require(_0x1803('0x4'));var rp=require(_0x1803('0x5'));var fs=require('fs');var path=require(_0x1803('0x6'));var rimraf=require(_0x1803('0x7'));var config=require(_0x1803('0x8'));var attributes=require(_0x1803('0x9'));module[_0x1803('0xa')]=function(_0x42ccdb,_0xdb028d){return _0x42ccdb[_0x1803('0xb')](_0x1803('0xc'),attributes,{'tableName':_0x1803('0xd'),'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 77ed277..95250de 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 _0x74c1=['http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client'];(function(_0x5c5c49,_0x4b502e){var _0x4b6e49=function(_0x3d9475){while(--_0x3d9475){_0x5c5c49['push'](_0x5c5c49['shift']());}};_0x4b6e49(++_0x4b502e);}(_0x74c1,0xbc));var _0x174c=function(_0x563ccc,_0x3f10a9){_0x563ccc=_0x563ccc-0x0;var _0x174990=_0x74c1[_0x563ccc];return _0x174990;};'use strict';var _=require(_0x174c('0x0'));var util=require(_0x174c('0x1'));var moment=require(_0x174c('0x2'));var BPromise=require(_0x174c('0x3'));var rs=require(_0x174c('0x4'));var fs=require('fs');var Redis=require(_0x174c('0x5'));var db=require(_0x174c('0x6'))['db'];var utils=require(_0x174c('0x7'));var logger=require('../../config/logger')(_0x174c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x174c('0x9')][_0x174c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe82211,_0x1a9893,_0x3177da){return new BPromise(function(_0x3904d3,_0x499639){return client[_0x174c('0xb')](_0xe82211,_0x3177da)['then'](function(_0x16d0e7){logger[_0x174c('0xc')](_0x174c('0xd'),_0x1a9893,_0x174c('0xe'));logger['debug'](_0x174c('0xf'),_0x1a9893,_0x174c('0xe'),JSON[_0x174c('0x10')](_0x16d0e7));if(_0x16d0e7[_0x174c('0x11')]){if(_0x16d0e7[_0x174c('0x11')][_0x174c('0x12')]===0x1f4){logger[_0x174c('0x11')](_0x174c('0xd'),_0x1a9893,_0x16d0e7[_0x174c('0x11')][_0x174c('0x13')]);return _0x499639(_0x16d0e7['error']['message']);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1a9893,_0x16d0e7[_0x174c('0x11')][_0x174c('0x13')]);return _0x3904d3(_0x16d0e7['error'][_0x174c('0x13')]);}else{logger['info'](_0x174c('0xd'),_0x1a9893,_0x174c('0xe'));_0x3904d3(_0x16d0e7[_0x174c('0x14')]['message']);}})[_0x174c('0x15')](function(_0x1e7f07){logger[_0x174c('0x11')](_0x174c('0xd'),_0x1a9893,_0x1e7f07);_0x499639(_0x1e7f07);});});} \ No newline at end of file +var _0xf3cb=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','info','catch','lodash'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0xf3cb,0x125));var _0xbf3c=function(_0x479dcc,_0xbdb759){_0x479dcc=_0x479dcc-0x0;var _0xebfb56=_0xf3cb[_0x479dcc];return _0xebfb56;};'use strict';var _=require(_0xbf3c('0x0'));var util=require('util');var moment=require(_0xbf3c('0x1'));var BPromise=require(_0xbf3c('0x2'));var rs=require(_0xbf3c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf3c('0x4'))['db'];var utils=require(_0xbf3c('0x5'));var logger=require(_0xbf3c('0x6'))(_0xbf3c('0x7'));var config=require(_0xbf3c('0x8'));var jayson=require(_0xbf3c('0x9'));var client=jayson[_0xbf3c('0xa')][_0xbf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ef500,_0x447cbd,_0x1c4a1d){return new BPromise(function(_0x2d7043,_0x4fd154){return client['request'](_0x1ef500,_0x1c4a1d)['then'](function(_0xe1be9){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x447cbd,_0xbf3c('0xc'));logger['debug'](_0xbf3c('0xd'),_0x447cbd,_0xbf3c('0xc'),JSON[_0xbf3c('0xe')](_0xe1be9));if(_0xe1be9[_0xbf3c('0xf')]){if(_0xe1be9[_0xbf3c('0xf')][_0xbf3c('0x10')]===0x1f4){logger['error'](_0xbf3c('0x11'),_0x447cbd,_0xe1be9[_0xbf3c('0xf')]['message']);return _0x4fd154(_0xe1be9['error'][_0xbf3c('0x12')]);}logger[_0xbf3c('0xf')](_0xbf3c('0x11'),_0x447cbd,_0xe1be9[_0xbf3c('0xf')][_0xbf3c('0x12')]);return _0x2d7043(_0xe1be9['error']['message']);}else{logger[_0xbf3c('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x447cbd,_0xbf3c('0xc'));_0x2d7043(_0xe1be9['result'][_0xbf3c('0x12')]);}})[_0xbf3c('0x14')](function(_0x3c26c6){logger[_0xbf3c('0xf')](_0xbf3c('0x11'),_0x447cbd,_0x3c26c6);_0x4fd154(_0x3c26c6);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 3a14431..430b10b 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(_0x15dd17,_0x2c92be){var _0x145931=function(_0x2a2e65){while(--_0x2a2e65){_0x15dd17['push'](_0x15dd17['shift']());}};_0x145931(++_0x2c92be);}(_0xd8fb,0x99));var _0xbd8f=function(_0x4d77ba,_0x37491d){_0x4d77ba=_0x4d77ba-0x0;var _0x4dcf85=_0xd8fb[_0x4d77ba];return _0x4dcf85;};'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 _0xeec6=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','put','update','delete','exports'];(function(_0x40df8a,_0x295bcd){var _0x4267f8=function(_0x4a33a1){while(--_0x4a33a1){_0x40df8a['push'](_0x40df8a['shift']());}};_0x4267f8(++_0x295bcd);}(_0xeec6,0x1c2));var _0x6eec=function(_0x46d87a,_0x5183db){_0x46d87a=_0x46d87a-0x0;var _0x115296=_0xeec6[_0x46d87a];return _0x115296;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get'](_0x6eec('0xa'),auth[_0x6eec('0xb')](),controller['show']);router[_0x6eec('0xc')]('/',auth[_0x6eec('0xb')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6eec('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index ea54a1b..f6ca1ef 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 _0xbdc8=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x3834d1,_0x264f09){var _0x1cbe87=function(_0x5b1b33){while(--_0x5b1b33){_0x3834d1['push'](_0x3834d1['shift']());}};_0x1cbe87(++_0x264f09);}(_0xbdc8,0x11b));var _0x8bdc=function(_0x5a644f,_0x47df39){_0x5a644f=_0x5a644f-0x0;var _0x25bc02=_0xbdc8[_0x5a644f];return _0x25bc02;};'use strict';var Sequelize=require(_0x8bdc('0x0'));module[_0x8bdc('0x1')]={'name':{'type':Sequelize[_0x8bdc('0x2')],'unique':_0x8bdc('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8bdc('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8bdc('0x5'),_0x8bdc('0x6'),_0x8bdc('0x7'))}}; \ No newline at end of file +var _0xbeef=['INTEGER','ENUM','rrmemory','sequelize','exports','STRING','name'];(function(_0x5cdffa,_0x157800){var _0x146a28=function(_0x1efca7){while(--_0x1efca7){_0x5cdffa['push'](_0x5cdffa['shift']());}};_0x146a28(++_0x157800);}(_0xbeef,0xce));var _0xfbee=function(_0x44710b,_0x3b6b95){_0x44710b=_0x44710b-0x0;var _0x3ef362=_0xbeef[_0x44710b];return _0x3ef362;};'use strict';var Sequelize=require(_0xfbee('0x0'));module[_0xfbee('0x1')]={'name':{'type':Sequelize[_0xfbee('0x2')],'unique':_0xfbee('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfbee('0x2')]},'timeout':{'type':Sequelize[_0xfbee('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfbee('0x5')](_0xfbee('0x6'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 91f3a11..5ea676a 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 _0x31ed=['../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','count','limit','apply','reject','save','update','destroy','UserProfileResource','stack','name','send','index','map','ChatQueue','fieldName','type','key','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','params','getMembers','findOne','UserChatQueue','nolimit','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','interface','sequelize','transaction','each','emit','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','removeAgents','forEach','userChatQueue:remove','addAgents','omit','userChatQueue:save','isArray','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x37445c,_0x5186ad){var _0x1a892f=function(_0xcf3f28){while(--_0xcf3f28){_0x37445c['push'](_0x37445c['shift']());}};_0x1a892f(++_0x5186ad);}(_0x31ed,0x118));var _0xd31e=function(_0x1dc0b9,_0x43ffca){_0x1dc0b9=_0x1dc0b9-0x0;var _0x20013a=_0x31ed[_0x1dc0b9];return _0x20013a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd31e('0x0'));var zipdir=require(_0xd31e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd31e('0x2'));var moment=require(_0xd31e('0x3'));var BPromise=require(_0xd31e('0x4'));var Mustache=require(_0xd31e('0x5'));var util=require(_0xd31e('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd31e('0x7'));var fs=require('fs');var fs_extra=require(_0xd31e('0x8'));var _=require(_0xd31e('0x9'));var squel=require(_0xd31e('0xa'));var crypto=require(_0xd31e('0xb'));var jsforce=require(_0xd31e('0xc'));var deskjs=require(_0xd31e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd31e('0xe'));var Papa=require(_0xd31e('0xf'));var Redis=require(_0xd31e('0x10'));var authService=require(_0xd31e('0x11'));var qs=require(_0xd31e('0x12'));var as=require(_0xd31e('0x13'));var hardwareService=require(_0xd31e('0x14'));var logger=require(_0xd31e('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd31e('0x16'));var licenseUtil=require(_0xd31e('0x17'));var db=require(_0xd31e('0x18'))['db'];config[_0xd31e('0x19')]=_['defaults'](config[_0xd31e('0x19')],{'host':_0xd31e('0x1a'),'port':0x18eb});var socket=require(_0xd31e('0x1b'))(new Redis(config[_0xd31e('0x19')]));require(_0xd31e('0x1c'))['register'](socket);var jayson=require(_0xd31e('0x1d'));var client=jayson[_0xd31e('0x1e')][_0xd31e('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x433bf4,_0x244d4d,_0x324708,_0x4d23c2){return new BPromise(function(_0x120954,_0x51baac){var _0x5932d9=_0x4d23c2||client;return _0x5932d9[_0xd31e('0x20')](_0x433bf4,_0x324708)[_0xd31e('0x21')](function(_0x46a6ae){logger[_0xd31e('0x22')](_0xd31e('0x23'),_0x244d4d,_0xd31e('0x24'));logger[_0xd31e('0x25')](_0xd31e('0x26'),_0x244d4d,_0xd31e('0x24'),JSON[_0xd31e('0x27')](_0x46a6ae));if(_0x46a6ae[_0xd31e('0x28')]){if(_0x46a6ae[_0xd31e('0x28')][_0xd31e('0x29')]===0x1f4){logger[_0xd31e('0x28')](_0xd31e('0x23'),_0x244d4d,_0x46a6ae[_0xd31e('0x28')][_0xd31e('0x2a')]);return _0x51baac(_0x46a6ae[_0xd31e('0x28')][_0xd31e('0x2a')]);}logger[_0xd31e('0x28')](_0xd31e('0x23'),_0x244d4d,_0x46a6ae[_0xd31e('0x28')][_0xd31e('0x2a')]);return _0x120954(_0x46a6ae[_0xd31e('0x28')][_0xd31e('0x2a')]);}else{logger[_0xd31e('0x22')](_0xd31e('0x23'),_0x244d4d,_0xd31e('0x24'));_0x120954(_0x46a6ae['result']['message']);}})[_0xd31e('0x2b')](function(_0x26785c){logger[_0xd31e('0x28')](_0xd31e('0x23'),_0x244d4d,_0x26785c);_0x51baac(_0x26785c);});});}function respondWithStatusCode(_0x429238,_0x1dff77){_0x1dff77=_0x1dff77||0xcc;return function(_0xb16cf6){if(_0xb16cf6){return _0x429238[_0xd31e('0x2c')](_0x1dff77);}return _0x429238['status'](_0x1dff77)[_0xd31e('0x2d')]();};}function respondWithResult(_0x4ae142,_0x434920){_0x434920=_0x434920||0xc8;return function(_0x5d8814){if(_0x5d8814){return _0x4ae142[_0xd31e('0x2e')](_0x434920)[_0xd31e('0x2f')](_0x5d8814);}};}function respondWithFilteredResult(_0x1dba60,_0x22859b){return function(_0x506aa2){if(_0x506aa2){var _0x397fa8=typeof _0x22859b[_0xd31e('0x30')]===_0xd31e('0x31')&&typeof _0x22859b['limit']===_0xd31e('0x31');var _0xbd62d=_0x506aa2[_0xd31e('0x32')];var _0x45dcdd=_0x397fa8?0x0:_0x22859b['offset'];var _0x46e372=_0x397fa8?_0x506aa2['count']:_0x22859b['offset']+_0x22859b[_0xd31e('0x33')];var _0x5508b3;if(_0x46e372>=_0xbd62d){_0x46e372=_0xbd62d;_0x5508b3=0xc8;}else{_0x5508b3=0xce;}_0x1dba60['status'](_0x5508b3);return _0x1dba60['set']('Content-Range',_0x45dcdd+'-'+_0x46e372+'/'+_0xbd62d)[_0xd31e('0x2f')](_0x506aa2);}return null;};}function patchUpdates(_0x230c6a){return function(_0x29bd7d){try{jsonpatch[_0xd31e('0x34')](_0x29bd7d,_0x230c6a,!![]);}catch(_0x105a04){return BPromise[_0xd31e('0x35')](_0x105a04);}return _0x29bd7d[_0xd31e('0x36')]();};}function saveUpdates(_0x397a03,_0x5b6522){return function(_0x43b7a3){if(_0x43b7a3){return _0x43b7a3[_0xd31e('0x37')](_0x397a03)['then'](function(_0x11c39b){return _0x11c39b;});}return null;};}function removeEntity(_0x53acfa,_0x23a610){return function(_0x3dffbe){if(_0x3dffbe){return _0x3dffbe[_0xd31e('0x38')]()['then'](function(){var _0x5f264a=_0x3dffbe['get']({'plain':!![]});var _0x1bcdeb='ChatQueues';return db[_0xd31e('0x39')]['destroy']({'where':{'type':_0x1bcdeb,'resourceId':_0x5f264a['id']}})['then'](function(){return _0x3dffbe;});})[_0xd31e('0x21')](function(){_0x53acfa[_0xd31e('0x2e')](0xcc)[_0xd31e('0x2d')]();});}};}function handleEntityNotFound(_0x37001d,_0x21b7e8){return function(_0x442914){if(!_0x442914){_0x37001d[_0xd31e('0x2c')](0x194);}return _0x442914;};}function handleError(_0x15ee2e,_0x45efa0){_0x45efa0=_0x45efa0||0x1f4;return function(_0x292f60){logger['error'](_0x292f60[_0xd31e('0x3a')]);if(_0x292f60[_0xd31e('0x3b')]){delete _0x292f60[_0xd31e('0x3b')];}_0x15ee2e['status'](_0x45efa0)[_0xd31e('0x3c')](_0x292f60);};}exports[_0xd31e('0x3d')]=function(_0x15f77e,_0x54a479){var _0x2927c9={},_0x4ef739={},_0x1fce48={'count':0x0,'rows':[]};var _0x4c70a5=_[_0xd31e('0x3e')](db[_0xd31e('0x3f')]['rawAttributes'],function(_0xd194a5){return{'name':_0xd194a5[_0xd31e('0x40')],'type':_0xd194a5[_0xd31e('0x41')][_0xd31e('0x42')]};});_0x4ef739['model']=_['map'](_0x4c70a5,_0xd31e('0x3b'));_0x4ef739['query']=_[_0xd31e('0x43')](_0x15f77e[_0xd31e('0x44')]);_0x4ef739[_0xd31e('0x45')]=_[_0xd31e('0x46')](_0x4ef739['model'],_0x4ef739[_0xd31e('0x44')]);_0x2927c9['attributes']=_[_0xd31e('0x46')](_0x4ef739['model'],qs[_0xd31e('0x47')](_0x15f77e[_0xd31e('0x44')][_0xd31e('0x47')]));_0x2927c9[_0xd31e('0x48')]=_0x2927c9['attributes'][_0xd31e('0x49')]?_0x2927c9[_0xd31e('0x48')]:_0x4ef739[_0xd31e('0x4a')];if(!_0x15f77e['query'][_0xd31e('0x4b')]('nolimit')){_0x2927c9[_0xd31e('0x33')]=qs[_0xd31e('0x33')](_0x15f77e[_0xd31e('0x44')][_0xd31e('0x33')]);_0x2927c9[_0xd31e('0x30')]=qs[_0xd31e('0x30')](_0x15f77e[_0xd31e('0x44')][_0xd31e('0x30')]);}_0x2927c9[_0xd31e('0x4c')]=qs[_0xd31e('0x4d')](_0x15f77e[_0xd31e('0x44')]['sort']);_0x2927c9[_0xd31e('0x4e')]=qs[_0xd31e('0x45')](_[_0xd31e('0x4f')](_0x15f77e[_0xd31e('0x44')],_0x4ef739['filters']),_0x4c70a5);if(_0x15f77e[_0xd31e('0x44')]['filter']){_0x2927c9[_0xd31e('0x4e')]=_[_0xd31e('0x50')](_0x2927c9[_0xd31e('0x4e')],{'$or':_[_0xd31e('0x3e')](_0x4c70a5,function(_0x1bf140){if(_0x1bf140[_0xd31e('0x41')]!==_0xd31e('0x51')){var _0x3f3211={};_0x3f3211[_0x1bf140[_0xd31e('0x3b')]]={'$like':'%'+_0x15f77e['query'][_0xd31e('0x52')]+'%'};return _0x3f3211;}})});}_0x2927c9=_[_0xd31e('0x50')]({},_0x2927c9,_0x15f77e[_0xd31e('0x53')]);var _0x1a8153={'where':_0x2927c9[_0xd31e('0x4e')]};return db['ChatQueue'][_0xd31e('0x32')](_0x1a8153)[_0xd31e('0x21')](function(_0x3736f9){_0x1fce48[_0xd31e('0x32')]=_0x3736f9;if(_0x15f77e[_0xd31e('0x44')][_0xd31e('0x54')]){_0x2927c9[_0xd31e('0x55')]=[{'all':!![]}];}return db['ChatQueue'][_0xd31e('0x56')](_0x2927c9);})[_0xd31e('0x21')](function(_0x2e99a9){_0x1fce48[_0xd31e('0x57')]=_0x2e99a9;return _0x1fce48;})['then'](respondWithFilteredResult(_0x54a479,_0x2927c9))[_0xd31e('0x2b')](handleError(_0x54a479,null));};exports[_0xd31e('0x58')]=function(_0x466ce8,_0x34f8e6){var _0x11de7f={'raw':!![],'where':{'id':_0x466ce8['params']['id']}},_0x34485c={};_0x34485c['model']=_[_0xd31e('0x43')](db[_0xd31e('0x3f')][_0xd31e('0x59')]);_0x34485c[_0xd31e('0x44')]=_[_0xd31e('0x43')](_0x466ce8[_0xd31e('0x44')]);_0x34485c['filters']=_[_0xd31e('0x46')](_0x34485c[_0xd31e('0x4a')],_0x34485c[_0xd31e('0x44')]);_0x11de7f[_0xd31e('0x48')]=_[_0xd31e('0x46')](_0x34485c[_0xd31e('0x4a')],qs[_0xd31e('0x47')](_0x466ce8[_0xd31e('0x44')][_0xd31e('0x47')]));_0x11de7f[_0xd31e('0x48')]=_0x11de7f[_0xd31e('0x48')][_0xd31e('0x49')]?_0x11de7f[_0xd31e('0x48')]:_0x34485c[_0xd31e('0x4a')];if(_0x466ce8[_0xd31e('0x44')]['includeAll']){_0x11de7f['include']=[{'all':!![]}];}_0x11de7f=_[_0xd31e('0x50')]({},_0x11de7f,_0x466ce8['options']);return db[_0xd31e('0x3f')][_0xd31e('0x5a')](_0x11de7f)[_0xd31e('0x21')](handleEntityNotFound(_0x34f8e6,null))[_0xd31e('0x21')](respondWithResult(_0x34f8e6,null))['catch'](handleError(_0x34f8e6,null));};exports[_0xd31e('0x5b')]=function(_0x1a7738,_0x43fadb){return db[_0xd31e('0x3f')][_0xd31e('0x5b')](_0x1a7738[_0xd31e('0x5c')],{})[_0xd31e('0x21')](function(_0x45517f){var _0x2362a8=_0x1a7738['user'][_0xd31e('0x5d')]({'plain':!![]});if(!_0x2362a8)throw new Error(_0xd31e('0x5e'));if(_0x2362a8[_0xd31e('0x5f')]===_0xd31e('0x60')){var _0x3c18d6=_0x45517f[_0xd31e('0x5d')]({'plain':!![]});var _0x5d3ce7='ChatQueues';return db[_0xd31e('0x61')][_0xd31e('0x5a')]({'where':{'name':_0x5d3ce7,'userProfileId':_0x2362a8[_0xd31e('0x62')]},'raw':!![]})[_0xd31e('0x21')](function(_0x18ac8e){if(_0x18ac8e&&_0x18ac8e[_0xd31e('0x63')]===0x0){return db['UserProfileResource'][_0xd31e('0x5b')]({'name':_0x3c18d6[_0xd31e('0x3b')],'resourceId':_0x3c18d6['id'],'type':_0x18ac8e[_0xd31e('0x3b')],'sectionId':_0x18ac8e['id']},{})[_0xd31e('0x21')](function(){return _0x45517f;});}else{return _0x45517f;}})[_0xd31e('0x2b')](function(_0x1b9629){logger[_0xd31e('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b9629);throw _0x1b9629;});}return _0x45517f;})[_0xd31e('0x21')](respondWithResult(_0x43fadb,0xc9))['catch'](handleError(_0x43fadb,null));};exports[_0xd31e('0x37')]=function(_0x16cd30,_0x4d2e72){if(_0x16cd30['body']['id']){delete _0x16cd30['body']['id'];}return db[_0xd31e('0x3f')][_0xd31e('0x5a')]({'where':{'id':_0x16cd30[_0xd31e('0x64')]['id']}})[_0xd31e('0x21')](handleEntityNotFound(_0x4d2e72,null))[_0xd31e('0x21')](saveUpdates(_0x16cd30[_0xd31e('0x5c')],null))[_0xd31e('0x21')](respondWithResult(_0x4d2e72,null))['catch'](handleError(_0x4d2e72,null));};exports[_0xd31e('0x38')]=function(_0x377a0e,_0x31666d){return db[_0xd31e('0x3f')]['find']({'where':{'id':_0x377a0e[_0xd31e('0x64')]['id']}})[_0xd31e('0x21')](handleEntityNotFound(_0x31666d,null))[_0xd31e('0x21')](removeEntity(_0x31666d,null))[_0xd31e('0x2b')](handleError(_0x31666d,null));};exports['describe']=function(_0x46c336,_0x1faff9){return db['ChatQueue']['describe']()[_0xd31e('0x21')](respondWithResult(_0x1faff9,null))[_0xd31e('0x2b')](handleError(_0x1faff9,null));};exports[_0xd31e('0x65')]=function(_0x3937b1,_0x9544bb,_0x4ea6a7){var _0x555a4d={'raw':!![],'where':{}},_0x50c018={},_0x28aebe;return db[_0xd31e('0x3f')][_0xd31e('0x66')]({'where':{'id':_0x3937b1['params']['id']}})[_0xd31e('0x21')](handleEntityNotFound(_0x9544bb,null))[_0xd31e('0x21')](function(_0x2038ae){if(_0x2038ae){_0x28aebe=_0x2038ae['get']({'plain':!![]});_0x50c018[_0xd31e('0x4a')]=_[_0xd31e('0x43')](db[_0xd31e('0x67')][_0xd31e('0x59')]);_0x50c018[_0xd31e('0x44')]=_['keys'](_0x3937b1['query']);_0x50c018[_0xd31e('0x45')]=_[_0xd31e('0x46')](_0x50c018[_0xd31e('0x4a')],_0x50c018[_0xd31e('0x44')]);_0x555a4d[_0xd31e('0x48')]=_[_0xd31e('0x46')](_0x50c018[_0xd31e('0x4a')],qs[_0xd31e('0x47')](_0x3937b1[_0xd31e('0x44')][_0xd31e('0x47')]));_0x555a4d[_0xd31e('0x48')]=_0x555a4d[_0xd31e('0x48')][_0xd31e('0x49')]?_0x555a4d['attributes']:_0x50c018['model'];if(!_0x3937b1[_0xd31e('0x44')][_0xd31e('0x4b')](_0xd31e('0x68'))){_0x555a4d['limit']=qs[_0xd31e('0x33')](_0x3937b1[_0xd31e('0x44')][_0xd31e('0x33')]);_0x555a4d[_0xd31e('0x30')]=qs[_0xd31e('0x30')](_0x3937b1[_0xd31e('0x44')][_0xd31e('0x30')]);}_0x555a4d[_0xd31e('0x4c')]=qs[_0xd31e('0x4d')](_0x3937b1['query']['sort']);_0x555a4d[_0xd31e('0x4e')]=qs[_0xd31e('0x45')](_[_0xd31e('0x4f')](_0x3937b1[_0xd31e('0x44')],_0x50c018[_0xd31e('0x45')]));_0x555a4d[_0xd31e('0x4e')][_0xd31e('0x69')]=_0x2038ae['id'];if(_0x3937b1[_0xd31e('0x44')][_0xd31e('0x52')]){_0x555a4d[_0xd31e('0x4e')]=_['merge'](_0x555a4d['where'],{'$or':_['map'](_0x555a4d[_0xd31e('0x48')],function(_0xe787a5){var _0x3ccb8b={};_0x3ccb8b[_0xe787a5]={'$like':'%'+_0x3937b1[_0xd31e('0x44')]['filter']+'%'};return _0x3ccb8b;})});}_0x555a4d=_['merge']({},_0x555a4d,_0x3937b1[_0xd31e('0x53')]);return db[_0xd31e('0x67')][_0xd31e('0x56')](_0x555a4d);}})['then'](function(_0x55aec9){if(_0x55aec9){return db[_0xd31e('0x6a')][_0xd31e('0x6b')]({'where':{'id':_['map'](_0x55aec9,'UserId'),'role':_0xd31e('0x6c')},'attributes':['id',_0xd31e('0x3b'),_0xd31e('0x6d'),_0xd31e('0x6e'),'createdAt']});}})[_0xd31e('0x21')](function(_0x5a6e47){if(_0x5a6e47){return{'count':_0x5a6e47[_0xd31e('0x32')],'rows':_['map'](_0x5a6e47[_0xd31e('0x57')],function(_0x52bc7d){return{'membername':_0x52bc7d['name'],'UserId':_0x52bc7d['id'],'queue_name':_0x28aebe[_0xd31e('0x3b')],'ChatQueueId':_0x28aebe['id'],'interface':util[_0xd31e('0x6f')](_0xd31e('0x70'),_0xd31e('0x71'),_0x52bc7d['name']),'penalty':0x0,'paused':_0x52bc7d[_0xd31e('0x6d')],'createdAt':_0x52bc7d['createdAt'],'updatedAt':_0x52bc7d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x9544bb,_0x555a4d))[_0xd31e('0x2b')](handleError(_0x9544bb,null));};exports[_0xd31e('0x72')]=function(_0x1aec54,_0x5210e9,_0x298845){var _0x597203={};var _0x364f92={};var _0x3ed817;var _0x3e69c6;return db[_0xd31e('0x3f')][_0xd31e('0x66')]({'where':{'id':_0x1aec54[_0xd31e('0x64')]['id']}})[_0xd31e('0x21')](handleEntityNotFound(_0x5210e9,null))[_0xd31e('0x21')](function(_0x2a4606){if(_0x2a4606){_0x3ed817=_0x2a4606;_0x364f92[_0xd31e('0x4a')]=_['keys'](db[_0xd31e('0x73')][_0xd31e('0x59')]);_0x364f92[_0xd31e('0x44')]=_[_0xd31e('0x43')](_0x1aec54[_0xd31e('0x44')]);_0x364f92[_0xd31e('0x45')]=_[_0xd31e('0x46')](_0x364f92[_0xd31e('0x4a')],_0x364f92[_0xd31e('0x44')]);_0x597203[_0xd31e('0x48')]=_[_0xd31e('0x46')](_0x364f92['model'],qs[_0xd31e('0x47')](_0x1aec54[_0xd31e('0x44')][_0xd31e('0x47')]));_0x597203[_0xd31e('0x48')]=_0x597203[_0xd31e('0x48')]['length']?_0x597203['attributes']:_0x364f92[_0xd31e('0x4a')];_0x597203['order']=qs['sort'](_0x1aec54[_0xd31e('0x44')]['sort']);_0x597203['where']=qs[_0xd31e('0x45')](_['pick'](_0x1aec54[_0xd31e('0x44')],_0x364f92[_0xd31e('0x45')]));if(_0x1aec54[_0xd31e('0x44')][_0xd31e('0x52')]){_0x597203[_0xd31e('0x4e')]=_[_0xd31e('0x50')](_0x597203[_0xd31e('0x4e')],{'$or':_['map'](_0x597203[_0xd31e('0x48')],function(_0x310504){var _0x4bb601={};_0x4bb601[_0x310504]={'$like':'%'+_0x1aec54['query'][_0xd31e('0x52')]+'%'};return _0x4bb601;})});}_0x597203=_[_0xd31e('0x50')]({},_0x597203,_0x1aec54['options']);return _0x3ed817[_0xd31e('0x72')](_0x597203);}})[_0xd31e('0x21')](function(_0x3a27ba){if(_0x3a27ba){_0x3e69c6=_0x3a27ba[_0xd31e('0x49')];if(!_0x1aec54[_0xd31e('0x44')][_0xd31e('0x4b')](_0xd31e('0x68'))){_0x597203[_0xd31e('0x33')]=qs[_0xd31e('0x33')](_0x1aec54[_0xd31e('0x44')]['limit']);_0x597203[_0xd31e('0x30')]=qs[_0xd31e('0x30')](_0x1aec54[_0xd31e('0x44')][_0xd31e('0x30')]);}return _0x3ed817[_0xd31e('0x72')](_0x597203);}})[_0xd31e('0x21')](function(_0x523d70){if(_0x523d70){return _0x523d70?{'count':_0x3e69c6,'rows':_0x523d70}:null;}})[_0xd31e('0x21')](respondWithResult(_0x5210e9,null))[_0xd31e('0x2b')](handleError(_0x5210e9,null));};exports[_0xd31e('0x74')]=function(_0x1f1089,_0xb31534,_0x27086a){var _0x2cf6c9=_0x1f1089[_0xd31e('0x5c')][_0xd31e('0x75')];return db[_0xd31e('0x73')][_0xd31e('0x56')]({'where':{'id':_0x2cf6c9},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd31e('0x76'),'attributes':['id','name','online','voicePause',_0xd31e('0x77')],'raw':!![]}]})[_0xd31e('0x21')](function(_0x325074){if(_0x325074){var _0x1ce58e=_['flatMap'](_0x325074,function(_0x491db0){var _0x132836=_0x491db0[_0xd31e('0x5d')]({'plain':!![]});return _0x132836[_0xd31e('0x76')];});return db[_0xd31e('0x3f')][_0xd31e('0x5a')]({'where':{'id':_0x1f1089[_0xd31e('0x64')]['id']}})['then'](function(_0x1bf8cc){return db[_0xd31e('0x78')][_0xd31e('0x79')](function(_0x11261f){return _0x1bf8cc['addTeams'](_0x2cf6c9,{'transaction':_0x11261f})[_0xd31e('0x21')](function(){return BPromise[_0xd31e('0x7a')](_0x1ce58e,function(_0x3157f3){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x3157f3['id'],'ChatQueueId':_0x1f1089[_0xd31e('0x64')]['id']},'transaction':_0x11261f});});})[_0xd31e('0x21')](function(){_0x1ce58e['forEach'](function(_0x46818e){socket[_0xd31e('0x7b')]('userChatQueue:save',{'UserId':_0x46818e['id'],'ChatQueueId':_0x1bf8cc['id']});});});});});}})[_0xd31e('0x21')](respondWithStatusCode(_0xb31534,null))['catch'](handleError(_0xb31534,null));};exports[_0xd31e('0x7c')]=function(_0x1db499,_0x2af659,_0x4e0007){return db['Team'][_0xd31e('0x56')]({'where':{'id':_0x1db499['query'][_0xd31e('0x75')]},'attributes':['id'],'include':[{'model':db[_0xd31e('0x6a')],'as':_0xd31e('0x76'),'attributes':['id'],'raw':!![]}]})[_0xd31e('0x21')](handleEntityNotFound(_0x2af659,null))[_0xd31e('0x21')](function(_0x35b160){var _0x1cc99d=_[_0xd31e('0x3e')](_0x35b160,'id');var _0xa3dd9d=[];var _0x401b3c=[];var _0x178b61=squel[_0xd31e('0x7d')]();_0x178b61[_0xd31e('0x7e')](_0xd31e('0x7f'))['from'](_0xd31e('0x80'),'tq')[_0xd31e('0x81')]('user_has_teams','ut',_0xd31e('0x82'))[_0xd31e('0x4e')](_0xd31e('0x83'),_0x1db499[_0xd31e('0x64')]['id']);for(var _0x316ad4=0x0;_0x316ad4<_0x35b160[_0xd31e('0x49')];_0x316ad4+=0x1){let _0x5130e9=_0x35b160[_0x316ad4];for(var _0x34d5ee=0x0;_0x34d5ee<_0x5130e9[_0xd31e('0x76')]['length'];_0x34d5ee+=0x1){let _0x4f376d=_0x5130e9['Agents'][_0x34d5ee];var _0x42481f=_0x178b61[_0xd31e('0x84')]();_0x42481f[_0xd31e('0x4e')](_0xd31e('0x85'),_0x4f376d['id']);_0x401b3c['push'](db[_0xd31e('0x78')][_0xd31e('0x44')](_0x42481f[_0xd31e('0x86')](),{'type':db[_0xd31e('0x78')][_0xd31e('0x87')][_0xd31e('0x88')]})['then'](function(_0x3e3b9f){if(_0x3e3b9f[_0xd31e('0x49')]===0x1){return _0x4f376d['id'];}else{var _0x3cb9a2=_['every'](_[_0xd31e('0x3e')](_0x3e3b9f,_0xd31e('0x89')),function(_0xabe2ce){return _[_0xd31e('0x8a')](_0x1cc99d,_0xabe2ce);});if(_0x3cb9a2){return _0x4f376d['id'];}}}));}}return BPromise[_0xd31e('0x8b')](_0x401b3c)[_0xd31e('0x21')](function(_0xaa47e1){_0xa3dd9d=_(_0xa3dd9d)[_0xd31e('0x8c')](_0xaa47e1)['compact']()[_0xd31e('0x8d')]();return db[_0xd31e('0x3f')][_0xd31e('0x5a')]({'where':{'id':_0x1db499['params']['id']}})['then'](function(_0x25dd6d){return db[_0xd31e('0x78')][_0xd31e('0x79')](function(_0x22ab37){return _0x25dd6d[_0xd31e('0x7c')](_0x1db499[_0xd31e('0x44')][_0xd31e('0x75')],{'transaction':_0x22ab37})[_0xd31e('0x21')](function(){if(!_['isEmpty'](_0xa3dd9d)){return _0x25dd6d[_0xd31e('0x8e')](_0xa3dd9d,{'transaction':_0x22ab37});}})['then'](function(){_0xa3dd9d[_0xd31e('0x8f')](function(_0x188586){socket['emit'](_0xd31e('0x90'),{'UserId':_0x188586,'ChatQueueId':_0x25dd6d['id']});});});});});});})[_0xd31e('0x21')](respondWithStatusCode(_0x2af659,null))[_0xd31e('0x2b')](handleError(_0x2af659,null));};exports[_0xd31e('0x91')]=function(_0x30c071,_0x52ae59,_0x4a5664){return db[_0xd31e('0x3f')][_0xd31e('0x5a')]({'where':{'id':_0x30c071[_0xd31e('0x64')]['id']}})[_0xd31e('0x21')](handleEntityNotFound(_0x52ae59,null))[_0xd31e('0x21')](function(_0x4b0fe6){if(_0x4b0fe6){return _0x4b0fe6['addAgents'](_0x30c071[_0xd31e('0x5c')]['ids'],_[_0xd31e('0x92')](_0x30c071['body'],[_0xd31e('0x75'),'id'])||{})['spread'](function(_0x3b28d2){for(var _0x47dad8=0x0;_0x47dad8<_0x30c071['body'][_0xd31e('0x75')][_0xd31e('0x49')];_0x47dad8+=0x1){socket['emit'](_0xd31e('0x93'),{'UserId':Number(_0x30c071[_0xd31e('0x5c')][_0xd31e('0x75')][_0x47dad8]),'ChatQueueId':Number(_0x30c071[_0xd31e('0x64')]['id'])});}return _0x3b28d2;});}})[_0xd31e('0x21')](respondWithResult(_0x52ae59,null))[_0xd31e('0x2b')](handleError(_0x52ae59,null));};exports['removeAgents']=function(_0x5784dd,_0x578586,_0x49a67b){return db[_0xd31e('0x3f')]['find']({'where':{'id':_0x5784dd['params']['id']}})[_0xd31e('0x21')](handleEntityNotFound(_0x578586,null))[_0xd31e('0x21')](function(_0x1cdc83){if(_0x1cdc83){return _0x1cdc83[_0xd31e('0x8e')](_0x5784dd['query'][_0xd31e('0x75')])[_0xd31e('0x21')](function(){if(_[_0xd31e('0x94')](_0x5784dd[_0xd31e('0x44')]['ids'])){for(var _0x5adf29=0x0;_0x5adf29<_0x5784dd['query']['ids'][_0xd31e('0x49')];_0x5adf29+=0x1){socket[_0xd31e('0x7b')](_0xd31e('0x90'),{'UserId':Number(_0x5784dd['query'][_0xd31e('0x75')][_0x5adf29]),'ChatQueueId':Number(_0x5784dd[_0xd31e('0x64')]['id'])});}}else{socket[_0xd31e('0x7b')](_0xd31e('0x90'),{'UserId':Number(_0x5784dd['query'][_0xd31e('0x75')]),'ChatQueueId':Number(_0x5784dd[_0xd31e('0x64')]['id'])});}});}})[_0xd31e('0x21')](respondWithStatusCode(_0x578586,null))[_0xd31e('0x2b')](handleError(_0x578586,null));};exports[_0xd31e('0x95')]=function(_0x339d68,_0x1044b3,_0x10b91a){var _0x15ec0a={};var _0x23adc6={};var _0x189286;var _0x185892;return db['ChatQueue'][_0xd31e('0x66')]({'where':{'id':_0x339d68[_0xd31e('0x64')]['id']}})[_0xd31e('0x21')](handleEntityNotFound(_0x1044b3,null))[_0xd31e('0x21')](function(_0x300bfe){if(_0x300bfe){_0x189286=_0x300bfe;_0x23adc6[_0xd31e('0x4a')]=_['keys'](db[_0xd31e('0x6a')][_0xd31e('0x59')]);_0x23adc6[_0xd31e('0x44')]=_[_0xd31e('0x43')](_0x339d68[_0xd31e('0x44')]);_0x23adc6[_0xd31e('0x45')]=_[_0xd31e('0x46')](_0x23adc6[_0xd31e('0x4a')],_0x23adc6[_0xd31e('0x44')]);_0x15ec0a[_0xd31e('0x48')]=_[_0xd31e('0x46')](_0x23adc6['model'],qs[_0xd31e('0x47')](_0x339d68[_0xd31e('0x44')]['fields']));_0x15ec0a[_0xd31e('0x48')]=_0x15ec0a[_0xd31e('0x48')]['length']?_0x15ec0a[_0xd31e('0x48')]:_0x23adc6[_0xd31e('0x4a')];_0x15ec0a[_0xd31e('0x4c')]=qs[_0xd31e('0x4d')](_0x339d68[_0xd31e('0x44')][_0xd31e('0x4d')]);_0x15ec0a[_0xd31e('0x4e')]=qs['filters'](_[_0xd31e('0x4f')](_0x339d68['query'],_0x23adc6[_0xd31e('0x45')]));if(_0x339d68['query'][_0xd31e('0x52')]){_0x15ec0a[_0xd31e('0x4e')]=_[_0xd31e('0x50')](_0x15ec0a[_0xd31e('0x4e')],{'$or':_[_0xd31e('0x3e')](_0x15ec0a[_0xd31e('0x48')],function(_0x513c11){var _0x236142={};_0x236142[_0x513c11]={'$like':'%'+_0x339d68[_0xd31e('0x44')][_0xd31e('0x52')]+'%'};return _0x236142;})});}_0x15ec0a=_[_0xd31e('0x50')]({},_0x15ec0a,_0x339d68[_0xd31e('0x53')]);return _0x189286[_0xd31e('0x95')](_0x15ec0a);}})[_0xd31e('0x21')](function(_0x41f52d){if(_0x41f52d){_0x185892=_0x41f52d[_0xd31e('0x49')];if(!_0x339d68['query'][_0xd31e('0x4b')](_0xd31e('0x68'))){_0x15ec0a[_0xd31e('0x33')]=qs[_0xd31e('0x33')](_0x339d68[_0xd31e('0x44')][_0xd31e('0x33')]);_0x15ec0a[_0xd31e('0x30')]=qs['offset'](_0x339d68[_0xd31e('0x44')]['offset']);}return _0x189286[_0xd31e('0x95')](_0x15ec0a);}})[_0xd31e('0x21')](function(_0x20aac8){if(_0x20aac8){return _0x20aac8?{'count':_0x185892,'rows':_0x20aac8}:null;}})['then'](respondWithResult(_0x1044b3,null))['catch'](handleError(_0x1044b3,null));}; \ No newline at end of file +var _0xee15=['interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','User','select','field','tq.TeamId','from','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','userChatQueue:save','isArray','getAgents','hasOwnProperty','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','get','UserProfileResource','destroy','stack','name','index','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','include','rows','show','params','includeAll','create','user','role','ChatQueues','find','userProfileId','autoAssociation','body','describe','getMembers','findOne','UserChatQueue','length','ChatQueueId','options','findAll','UserId','agent','chatPause','updatedAt','format','SIP','createdAt','getTeams','Team','addTeams','ids','voicePause'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xee15,0x1e3));var _0x5ee1=function(_0x3b9d5f,_0x2e9039){_0x3b9d5f=_0x3b9d5f-0x0;var _0x39924e=_0xee15[_0x3b9d5f];return _0x39924e;};'use strict';var emlformat=require(_0x5ee1('0x0'));var rimraf=require(_0x5ee1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5ee1('0x2'));var rp=require('request-promise');var moment=require(_0x5ee1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5ee1('0x4'));var util=require(_0x5ee1('0x5'));var path=require(_0x5ee1('0x6'));var sox=require(_0x5ee1('0x7'));var csv=require(_0x5ee1('0x8'));var ejs=require(_0x5ee1('0x9'));var fs=require('fs');var fs_extra=require(_0x5ee1('0xa'));var _=require(_0x5ee1('0xb'));var squel=require(_0x5ee1('0xc'));var crypto=require(_0x5ee1('0xd'));var jsforce=require(_0x5ee1('0xe'));var deskjs=require(_0x5ee1('0xf'));var toCsv=require(_0x5ee1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5ee1('0x10'));var authService=require(_0x5ee1('0x11'));var qs=require(_0x5ee1('0x12'));var as=require(_0x5ee1('0x13'));var hardwareService=require(_0x5ee1('0x14'));var logger=require(_0x5ee1('0x15'))(_0x5ee1('0x16'));var utils=require(_0x5ee1('0x17'));var config=require(_0x5ee1('0x18'));var licenseUtil=require(_0x5ee1('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5ee1('0x1a')](config[_0x5ee1('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ee1('0x1c'))(new Redis(config['redis']));require(_0x5ee1('0x1d'))[_0x5ee1('0x1e')](socket);var jayson=require(_0x5ee1('0x1f'));var client=jayson[_0x5ee1('0x20')][_0x5ee1('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1b7241,_0x4ef9fa,_0x1e6eaf,_0x59d3f8){return new BPromise(function(_0x19a021,_0xb37eba){var _0x4beb1b=_0x59d3f8||client;return _0x4beb1b['request'](_0x1b7241,_0x1e6eaf)[_0x5ee1('0x22')](function(_0x5e4476){logger[_0x5ee1('0x23')](_0x5ee1('0x24'),_0x4ef9fa,'request\x20sent');logger[_0x5ee1('0x25')](_0x5ee1('0x26'),_0x4ef9fa,_0x5ee1('0x27'),JSON['stringify'](_0x5e4476));if(_0x5e4476[_0x5ee1('0x28')]){if(_0x5e4476[_0x5ee1('0x28')]['code']===0x1f4){logger[_0x5ee1('0x28')](_0x5ee1('0x24'),_0x4ef9fa,_0x5e4476[_0x5ee1('0x28')][_0x5ee1('0x29')]);return _0xb37eba(_0x5e4476[_0x5ee1('0x28')][_0x5ee1('0x29')]);}logger[_0x5ee1('0x28')]('ChatQueue,\x20%s,\x20%s',_0x4ef9fa,_0x5e4476[_0x5ee1('0x28')][_0x5ee1('0x29')]);return _0x19a021(_0x5e4476[_0x5ee1('0x28')][_0x5ee1('0x29')]);}else{logger['info'](_0x5ee1('0x24'),_0x4ef9fa,'request\x20sent');_0x19a021(_0x5e4476[_0x5ee1('0x2a')][_0x5ee1('0x29')]);}})[_0x5ee1('0x2b')](function(_0x2ae711){logger[_0x5ee1('0x28')](_0x5ee1('0x24'),_0x4ef9fa,_0x2ae711);_0xb37eba(_0x2ae711);});});}function respondWithStatusCode(_0xa03dbb,_0x4b54af){_0x4b54af=_0x4b54af||0xcc;return function(_0x36fa0c){if(_0x36fa0c){return _0xa03dbb[_0x5ee1('0x2c')](_0x4b54af);}return _0xa03dbb[_0x5ee1('0x2d')](_0x4b54af)[_0x5ee1('0x2e')]();};}function respondWithResult(_0x45736c,_0x3c33d7){_0x3c33d7=_0x3c33d7||0xc8;return function(_0x28226b){if(_0x28226b){return _0x45736c['status'](_0x3c33d7)[_0x5ee1('0x2f')](_0x28226b);}};}function respondWithFilteredResult(_0x50c2ab,_0x53f26f){return function(_0x5190b7){if(_0x5190b7){var _0x3ee3a4=typeof _0x53f26f[_0x5ee1('0x30')]===_0x5ee1('0x31')&&typeof _0x53f26f[_0x5ee1('0x32')]==='undefined';var _0x153897=_0x5190b7['count'];var _0x13e647=_0x3ee3a4?0x0:_0x53f26f[_0x5ee1('0x30')];var _0x9cdc54=_0x3ee3a4?_0x5190b7[_0x5ee1('0x33')]:_0x53f26f[_0x5ee1('0x30')]+_0x53f26f[_0x5ee1('0x32')];var _0x3894b1;if(_0x9cdc54>=_0x153897){_0x9cdc54=_0x153897;_0x3894b1=0xc8;}else{_0x3894b1=0xce;}_0x50c2ab[_0x5ee1('0x2d')](_0x3894b1);return _0x50c2ab[_0x5ee1('0x34')]('Content-Range',_0x13e647+'-'+_0x9cdc54+'/'+_0x153897)[_0x5ee1('0x2f')](_0x5190b7);}return null;};}function patchUpdates(_0x4b9b00){return function(_0x47c458){try{jsonpatch['apply'](_0x47c458,_0x4b9b00,!![]);}catch(_0x495680){return BPromise['reject'](_0x495680);}return _0x47c458['save']();};}function saveUpdates(_0x32c203,_0x2f7505){return function(_0xf066c9){if(_0xf066c9){return _0xf066c9['update'](_0x32c203)[_0x5ee1('0x22')](function(_0x2ce377){return _0x2ce377;});}return null;};}function removeEntity(_0x5f2bae,_0x46d21e){return function(_0x2315e0){if(_0x2315e0){return _0x2315e0['destroy']()[_0x5ee1('0x22')](function(){var _0x1dd866=_0x2315e0[_0x5ee1('0x35')]({'plain':!![]});var _0x2b2f4c='ChatQueues';return db[_0x5ee1('0x36')][_0x5ee1('0x37')]({'where':{'type':_0x2b2f4c,'resourceId':_0x1dd866['id']}})[_0x5ee1('0x22')](function(){return _0x2315e0;});})[_0x5ee1('0x22')](function(){_0x5f2bae[_0x5ee1('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39663d,_0xafcd02){return function(_0x1fc0ad){if(!_0x1fc0ad){_0x39663d[_0x5ee1('0x2c')](0x194);}return _0x1fc0ad;};}function handleError(_0x9e4e50,_0x311f60){_0x311f60=_0x311f60||0x1f4;return function(_0x3ba176){logger[_0x5ee1('0x28')](_0x3ba176[_0x5ee1('0x38')]);if(_0x3ba176[_0x5ee1('0x39')]){delete _0x3ba176[_0x5ee1('0x39')];}_0x9e4e50['status'](_0x311f60)['send'](_0x3ba176);};}exports[_0x5ee1('0x3a')]=function(_0x89544d,_0x3205d7){var _0x240e0d={},_0xff4ccf={},_0x3c28cb={'count':0x0,'rows':[]};var _0x436112=_[_0x5ee1('0x3b')](db[_0x5ee1('0x3c')][_0x5ee1('0x3d')],function(_0x11c8cb){return{'name':_0x11c8cb[_0x5ee1('0x3e')],'type':_0x11c8cb['type'][_0x5ee1('0x3f')]};});_0xff4ccf[_0x5ee1('0x40')]=_[_0x5ee1('0x3b')](_0x436112,_0x5ee1('0x39'));_0xff4ccf[_0x5ee1('0x41')]=_[_0x5ee1('0x42')](_0x89544d[_0x5ee1('0x41')]);_0xff4ccf['filters']=_[_0x5ee1('0x43')](_0xff4ccf[_0x5ee1('0x40')],_0xff4ccf[_0x5ee1('0x41')]);_0x240e0d[_0x5ee1('0x44')]=_[_0x5ee1('0x43')](_0xff4ccf[_0x5ee1('0x40')],qs[_0x5ee1('0x45')](_0x89544d['query']['fields']));_0x240e0d[_0x5ee1('0x44')]=_0x240e0d['attributes']['length']?_0x240e0d['attributes']:_0xff4ccf['model'];if(!_0x89544d[_0x5ee1('0x41')]['hasOwnProperty'](_0x5ee1('0x46'))){_0x240e0d[_0x5ee1('0x32')]=qs[_0x5ee1('0x32')](_0x89544d['query'][_0x5ee1('0x32')]);_0x240e0d[_0x5ee1('0x30')]=qs[_0x5ee1('0x30')](_0x89544d[_0x5ee1('0x41')][_0x5ee1('0x30')]);}_0x240e0d[_0x5ee1('0x47')]=qs['sort'](_0x89544d[_0x5ee1('0x41')][_0x5ee1('0x48')]);_0x240e0d[_0x5ee1('0x49')]=qs[_0x5ee1('0x4a')](_[_0x5ee1('0x4b')](_0x89544d['query'],_0xff4ccf[_0x5ee1('0x4a')]),_0x436112);if(_0x89544d[_0x5ee1('0x41')]['filter']){_0x240e0d[_0x5ee1('0x49')]=_[_0x5ee1('0x4c')](_0x240e0d[_0x5ee1('0x49')],{'$or':_[_0x5ee1('0x3b')](_0x436112,function(_0x48e41d){if(_0x48e41d[_0x5ee1('0x4d')]!==_0x5ee1('0x4e')){var _0x5c9791={};_0x5c9791[_0x48e41d[_0x5ee1('0x39')]]={'$like':'%'+_0x89544d['query'][_0x5ee1('0x4f')]+'%'};return _0x5c9791;}})});}_0x240e0d=_[_0x5ee1('0x4c')]({},_0x240e0d,_0x89544d['options']);var _0x53823f={'where':_0x240e0d['where']};return db[_0x5ee1('0x3c')][_0x5ee1('0x33')](_0x53823f)[_0x5ee1('0x22')](function(_0x527996){_0x3c28cb[_0x5ee1('0x33')]=_0x527996;if(_0x89544d[_0x5ee1('0x41')]['includeAll']){_0x240e0d[_0x5ee1('0x50')]=[{'all':!![]}];}return db[_0x5ee1('0x3c')]['findAll'](_0x240e0d);})[_0x5ee1('0x22')](function(_0x566f82){_0x3c28cb[_0x5ee1('0x51')]=_0x566f82;return _0x3c28cb;})['then'](respondWithFilteredResult(_0x3205d7,_0x240e0d))[_0x5ee1('0x2b')](handleError(_0x3205d7,null));};exports[_0x5ee1('0x52')]=function(_0x5a0584,_0x13e99c){var _0x84a9ec={'raw':!![],'where':{'id':_0x5a0584[_0x5ee1('0x53')]['id']}},_0x9f6fa1={};_0x9f6fa1['model']=_[_0x5ee1('0x42')](db[_0x5ee1('0x3c')][_0x5ee1('0x3d')]);_0x9f6fa1[_0x5ee1('0x41')]=_[_0x5ee1('0x42')](_0x5a0584[_0x5ee1('0x41')]);_0x9f6fa1[_0x5ee1('0x4a')]=_[_0x5ee1('0x43')](_0x9f6fa1[_0x5ee1('0x40')],_0x9f6fa1[_0x5ee1('0x41')]);_0x84a9ec[_0x5ee1('0x44')]=_['intersection'](_0x9f6fa1['model'],qs[_0x5ee1('0x45')](_0x5a0584[_0x5ee1('0x41')][_0x5ee1('0x45')]));_0x84a9ec['attributes']=_0x84a9ec[_0x5ee1('0x44')]['length']?_0x84a9ec[_0x5ee1('0x44')]:_0x9f6fa1[_0x5ee1('0x40')];if(_0x5a0584[_0x5ee1('0x41')][_0x5ee1('0x54')]){_0x84a9ec[_0x5ee1('0x50')]=[{'all':!![]}];}_0x84a9ec=_[_0x5ee1('0x4c')]({},_0x84a9ec,_0x5a0584['options']);return db[_0x5ee1('0x3c')]['find'](_0x84a9ec)[_0x5ee1('0x22')](handleEntityNotFound(_0x13e99c,null))[_0x5ee1('0x22')](respondWithResult(_0x13e99c,null))[_0x5ee1('0x2b')](handleError(_0x13e99c,null));};exports[_0x5ee1('0x55')]=function(_0x47dfb3,_0x14c51c){return db[_0x5ee1('0x3c')]['create'](_0x47dfb3['body'],{})['then'](function(_0x3b6213){var _0x4abd84=_0x47dfb3[_0x5ee1('0x56')][_0x5ee1('0x35')]({'plain':!![]});if(!_0x4abd84)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4abd84[_0x5ee1('0x57')]===_0x5ee1('0x56')){var _0x4d02ef=_0x3b6213[_0x5ee1('0x35')]({'plain':!![]});var _0x3c4f74=_0x5ee1('0x58');return db['UserProfileSection'][_0x5ee1('0x59')]({'where':{'name':_0x3c4f74,'userProfileId':_0x4abd84[_0x5ee1('0x5a')]},'raw':!![]})['then'](function(_0x341896){if(_0x341896&&_0x341896[_0x5ee1('0x5b')]===0x0){return db[_0x5ee1('0x36')][_0x5ee1('0x55')]({'name':_0x4d02ef['name'],'resourceId':_0x4d02ef['id'],'type':_0x341896['name'],'sectionId':_0x341896['id']},{})[_0x5ee1('0x22')](function(){return _0x3b6213;});}else{return _0x3b6213;}})[_0x5ee1('0x2b')](function(_0x78274a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x78274a);throw _0x78274a;});}return _0x3b6213;})[_0x5ee1('0x22')](respondWithResult(_0x14c51c,0xc9))['catch'](handleError(_0x14c51c,null));};exports['update']=function(_0x361592,_0x4d63fe){if(_0x361592[_0x5ee1('0x5c')]['id']){delete _0x361592[_0x5ee1('0x5c')]['id'];}return db[_0x5ee1('0x3c')][_0x5ee1('0x59')]({'where':{'id':_0x361592[_0x5ee1('0x53')]['id']}})[_0x5ee1('0x22')](handleEntityNotFound(_0x4d63fe,null))[_0x5ee1('0x22')](saveUpdates(_0x361592[_0x5ee1('0x5c')],null))[_0x5ee1('0x22')](respondWithResult(_0x4d63fe,null))[_0x5ee1('0x2b')](handleError(_0x4d63fe,null));};exports[_0x5ee1('0x37')]=function(_0x525b8e,_0x701a8b){return db[_0x5ee1('0x3c')][_0x5ee1('0x59')]({'where':{'id':_0x525b8e[_0x5ee1('0x53')]['id']}})[_0x5ee1('0x22')](handleEntityNotFound(_0x701a8b,null))[_0x5ee1('0x22')](removeEntity(_0x701a8b,null))['catch'](handleError(_0x701a8b,null));};exports['describe']=function(_0x354c1b,_0x22f59a){return db['ChatQueue'][_0x5ee1('0x5d')]()[_0x5ee1('0x22')](respondWithResult(_0x22f59a,null))[_0x5ee1('0x2b')](handleError(_0x22f59a,null));};exports[_0x5ee1('0x5e')]=function(_0xb278d1,_0xa57438,_0x4b4fb7){var _0xefae91={'raw':!![],'where':{}},_0x2a348f={},_0x3f2f74;return db[_0x5ee1('0x3c')][_0x5ee1('0x5f')]({'where':{'id':_0xb278d1[_0x5ee1('0x53')]['id']}})['then'](handleEntityNotFound(_0xa57438,null))[_0x5ee1('0x22')](function(_0x2d56cd){if(_0x2d56cd){_0x3f2f74=_0x2d56cd[_0x5ee1('0x35')]({'plain':!![]});_0x2a348f[_0x5ee1('0x40')]=_[_0x5ee1('0x42')](db[_0x5ee1('0x60')][_0x5ee1('0x3d')]);_0x2a348f[_0x5ee1('0x41')]=_['keys'](_0xb278d1['query']);_0x2a348f[_0x5ee1('0x4a')]=_[_0x5ee1('0x43')](_0x2a348f[_0x5ee1('0x40')],_0x2a348f[_0x5ee1('0x41')]);_0xefae91['attributes']=_[_0x5ee1('0x43')](_0x2a348f[_0x5ee1('0x40')],qs[_0x5ee1('0x45')](_0xb278d1[_0x5ee1('0x41')][_0x5ee1('0x45')]));_0xefae91[_0x5ee1('0x44')]=_0xefae91['attributes'][_0x5ee1('0x61')]?_0xefae91[_0x5ee1('0x44')]:_0x2a348f['model'];if(!_0xb278d1[_0x5ee1('0x41')]['hasOwnProperty'](_0x5ee1('0x46'))){_0xefae91[_0x5ee1('0x32')]=qs[_0x5ee1('0x32')](_0xb278d1[_0x5ee1('0x41')][_0x5ee1('0x32')]);_0xefae91[_0x5ee1('0x30')]=qs[_0x5ee1('0x30')](_0xb278d1[_0x5ee1('0x41')][_0x5ee1('0x30')]);}_0xefae91[_0x5ee1('0x47')]=qs[_0x5ee1('0x48')](_0xb278d1[_0x5ee1('0x41')][_0x5ee1('0x48')]);_0xefae91['where']=qs[_0x5ee1('0x4a')](_[_0x5ee1('0x4b')](_0xb278d1[_0x5ee1('0x41')],_0x2a348f[_0x5ee1('0x4a')]));_0xefae91[_0x5ee1('0x49')][_0x5ee1('0x62')]=_0x2d56cd['id'];if(_0xb278d1[_0x5ee1('0x41')][_0x5ee1('0x4f')]){_0xefae91[_0x5ee1('0x49')]=_[_0x5ee1('0x4c')](_0xefae91[_0x5ee1('0x49')],{'$or':_[_0x5ee1('0x3b')](_0xefae91['attributes'],function(_0x3373df){var _0x3d9912={};_0x3d9912[_0x3373df]={'$like':'%'+_0xb278d1['query'][_0x5ee1('0x4f')]+'%'};return _0x3d9912;})});}_0xefae91=_[_0x5ee1('0x4c')]({},_0xefae91,_0xb278d1[_0x5ee1('0x63')]);return db[_0x5ee1('0x60')][_0x5ee1('0x64')](_0xefae91);}})['then'](function(_0x2f7e76){if(_0x2f7e76){return db['User']['findAndCountAll']({'where':{'id':_[_0x5ee1('0x3b')](_0x2f7e76,_0x5ee1('0x65')),'role':_0x5ee1('0x66')},'attributes':['id','name',_0x5ee1('0x67'),_0x5ee1('0x68'),'createdAt']});}})[_0x5ee1('0x22')](function(_0x5b26d6){if(_0x5b26d6){return{'count':_0x5b26d6[_0x5ee1('0x33')],'rows':_[_0x5ee1('0x3b')](_0x5b26d6[_0x5ee1('0x51')],function(_0x3dcf8e){return{'membername':_0x3dcf8e[_0x5ee1('0x39')],'UserId':_0x3dcf8e['id'],'queue_name':_0x3f2f74[_0x5ee1('0x39')],'ChatQueueId':_0x3f2f74['id'],'interface':util[_0x5ee1('0x69')]('%s/%s',_0x5ee1('0x6a'),_0x3dcf8e[_0x5ee1('0x39')]),'penalty':0x0,'paused':_0x3dcf8e[_0x5ee1('0x67')],'createdAt':_0x3dcf8e[_0x5ee1('0x6b')],'updatedAt':_0x3dcf8e[_0x5ee1('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5ee1('0x22')](respondWithFilteredResult(_0xa57438,_0xefae91))['catch'](handleError(_0xa57438,null));};exports[_0x5ee1('0x6c')]=function(_0x1f5751,_0x83b01e,_0x29a909){var _0x55db4a={};var _0x1f6b3e={};var _0x519e24;var _0x4ec3fd;return db[_0x5ee1('0x3c')][_0x5ee1('0x5f')]({'where':{'id':_0x1f5751[_0x5ee1('0x53')]['id']}})['then'](handleEntityNotFound(_0x83b01e,null))[_0x5ee1('0x22')](function(_0x78ef4d){if(_0x78ef4d){_0x519e24=_0x78ef4d;_0x1f6b3e[_0x5ee1('0x40')]=_['keys'](db[_0x5ee1('0x6d')][_0x5ee1('0x3d')]);_0x1f6b3e[_0x5ee1('0x41')]=_[_0x5ee1('0x42')](_0x1f5751['query']);_0x1f6b3e[_0x5ee1('0x4a')]=_[_0x5ee1('0x43')](_0x1f6b3e[_0x5ee1('0x40')],_0x1f6b3e[_0x5ee1('0x41')]);_0x55db4a[_0x5ee1('0x44')]=_['intersection'](_0x1f6b3e[_0x5ee1('0x40')],qs[_0x5ee1('0x45')](_0x1f5751['query']['fields']));_0x55db4a[_0x5ee1('0x44')]=_0x55db4a['attributes'][_0x5ee1('0x61')]?_0x55db4a[_0x5ee1('0x44')]:_0x1f6b3e[_0x5ee1('0x40')];_0x55db4a[_0x5ee1('0x47')]=qs[_0x5ee1('0x48')](_0x1f5751[_0x5ee1('0x41')]['sort']);_0x55db4a[_0x5ee1('0x49')]=qs[_0x5ee1('0x4a')](_[_0x5ee1('0x4b')](_0x1f5751['query'],_0x1f6b3e[_0x5ee1('0x4a')]));if(_0x1f5751['query'][_0x5ee1('0x4f')]){_0x55db4a[_0x5ee1('0x49')]=_[_0x5ee1('0x4c')](_0x55db4a[_0x5ee1('0x49')],{'$or':_[_0x5ee1('0x3b')](_0x55db4a[_0x5ee1('0x44')],function(_0x2d9f33){var _0x546360={};_0x546360[_0x2d9f33]={'$like':'%'+_0x1f5751[_0x5ee1('0x41')][_0x5ee1('0x4f')]+'%'};return _0x546360;})});}_0x55db4a=_['merge']({},_0x55db4a,_0x1f5751[_0x5ee1('0x63')]);return _0x519e24[_0x5ee1('0x6c')](_0x55db4a);}})[_0x5ee1('0x22')](function(_0x211dce){if(_0x211dce){_0x4ec3fd=_0x211dce[_0x5ee1('0x61')];if(!_0x1f5751[_0x5ee1('0x41')]['hasOwnProperty'](_0x5ee1('0x46'))){_0x55db4a[_0x5ee1('0x32')]=qs[_0x5ee1('0x32')](_0x1f5751[_0x5ee1('0x41')][_0x5ee1('0x32')]);_0x55db4a['offset']=qs[_0x5ee1('0x30')](_0x1f5751[_0x5ee1('0x41')][_0x5ee1('0x30')]);}return _0x519e24[_0x5ee1('0x6c')](_0x55db4a);}})['then'](function(_0x390a49){if(_0x390a49){return _0x390a49?{'count':_0x4ec3fd,'rows':_0x390a49}:null;}})[_0x5ee1('0x22')](respondWithResult(_0x83b01e,null))[_0x5ee1('0x2b')](handleError(_0x83b01e,null));};exports[_0x5ee1('0x6e')]=function(_0x5138f0,_0x4f236d,_0x6b2951){var _0x57de41=_0x5138f0[_0x5ee1('0x5c')][_0x5ee1('0x6f')];return db[_0x5ee1('0x6d')][_0x5ee1('0x64')]({'where':{'id':_0x57de41},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x5ee1('0x39'),'online',_0x5ee1('0x70'),_0x5ee1('0x71')],'raw':!![]}]})['then'](function(_0x10dcbd){if(_0x10dcbd){var _0x5bb677=_[_0x5ee1('0x72')](_0x10dcbd,function(_0x3cdd8a){var _0x52a112=_0x3cdd8a[_0x5ee1('0x35')]({'plain':!![]});return _0x52a112[_0x5ee1('0x73')];});return db[_0x5ee1('0x3c')][_0x5ee1('0x59')]({'where':{'id':_0x5138f0[_0x5ee1('0x53')]['id']}})[_0x5ee1('0x22')](function(_0x46d6c1){return db[_0x5ee1('0x74')][_0x5ee1('0x75')](function(_0x48c6fb){return _0x46d6c1['addTeams'](_0x57de41,{'transaction':_0x48c6fb})[_0x5ee1('0x22')](function(){return BPromise[_0x5ee1('0x76')](_0x5bb677,function(_0x7d4786){return db[_0x5ee1('0x60')][_0x5ee1('0x77')]({'where':{'UserId':_0x7d4786['id'],'ChatQueueId':_0x5138f0['params']['id']},'transaction':_0x48c6fb});});})[_0x5ee1('0x22')](function(){_0x5bb677[_0x5ee1('0x78')](function(_0x241b6e){socket[_0x5ee1('0x79')]('userChatQueue:save',{'UserId':_0x241b6e['id'],'ChatQueueId':_0x46d6c1['id']});});});});});}})[_0x5ee1('0x22')](respondWithStatusCode(_0x4f236d,null))[_0x5ee1('0x2b')](handleError(_0x4f236d,null));};exports[_0x5ee1('0x7a')]=function(_0x388013,_0x2d6522,_0x4661c3){return db[_0x5ee1('0x6d')][_0x5ee1('0x64')]({'where':{'id':_0x388013['query'][_0x5ee1('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x5ee1('0x7b')],'as':_0x5ee1('0x73'),'attributes':['id'],'raw':!![]}]})[_0x5ee1('0x22')](handleEntityNotFound(_0x2d6522,null))[_0x5ee1('0x22')](function(_0x4a3076){var _0x20c40b=_['map'](_0x4a3076,'id');var _0xbf3518=[];var _0x33ab2f=[];var _0x2a6264=squel[_0x5ee1('0x7c')]();_0x2a6264[_0x5ee1('0x7d')](_0x5ee1('0x7e'))[_0x5ee1('0x7f')]('team_has_chat_queues','tq')[_0x5ee1('0x80')](_0x5ee1('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x5ee1('0x82'),_0x388013[_0x5ee1('0x53')]['id']);for(var _0x4c652f=0x0;_0x4c652f<_0x4a3076[_0x5ee1('0x61')];_0x4c652f+=0x1){let _0x1bccae=_0x4a3076[_0x4c652f];for(var _0x36298c=0x0;_0x36298c<_0x1bccae['Agents'][_0x5ee1('0x61')];_0x36298c+=0x1){let _0x484807=_0x1bccae[_0x5ee1('0x73')][_0x36298c];var _0xdf04a3=_0x2a6264['clone']();_0xdf04a3[_0x5ee1('0x49')](_0x5ee1('0x83'),_0x484807['id']);_0x33ab2f[_0x5ee1('0x84')](db[_0x5ee1('0x74')][_0x5ee1('0x41')](_0xdf04a3[_0x5ee1('0x85')](),{'type':db['sequelize'][_0x5ee1('0x86')][_0x5ee1('0x87')]})['then'](function(_0x58959b){if(_0x58959b[_0x5ee1('0x61')]===0x1){return _0x484807['id'];}else{var _0x45f594=_[_0x5ee1('0x88')](_[_0x5ee1('0x3b')](_0x58959b,'TeamId'),function(_0x4f65e2){return _[_0x5ee1('0x89')](_0x20c40b,_0x4f65e2);});if(_0x45f594){return _0x484807['id'];}}}));}}return BPromise[_0x5ee1('0x8a')](_0x33ab2f)[_0x5ee1('0x22')](function(_0x351f99){_0xbf3518=_(_0xbf3518)[_0x5ee1('0x8b')](_0x351f99)['compact']()[_0x5ee1('0x8c')]();return db[_0x5ee1('0x3c')]['find']({'where':{'id':_0x388013[_0x5ee1('0x53')]['id']}})[_0x5ee1('0x22')](function(_0xd245ab){return db[_0x5ee1('0x74')][_0x5ee1('0x75')](function(_0x1abd45){return _0xd245ab[_0x5ee1('0x7a')](_0x388013[_0x5ee1('0x41')][_0x5ee1('0x6f')],{'transaction':_0x1abd45})[_0x5ee1('0x22')](function(){if(!_[_0x5ee1('0x8d')](_0xbf3518)){return _0xd245ab[_0x5ee1('0x8e')](_0xbf3518,{'transaction':_0x1abd45});}})['then'](function(){_0xbf3518[_0x5ee1('0x78')](function(_0x5e272d){socket[_0x5ee1('0x79')](_0x5ee1('0x8f'),{'UserId':_0x5e272d,'ChatQueueId':_0xd245ab['id']});});});});});});})[_0x5ee1('0x22')](respondWithStatusCode(_0x2d6522,null))[_0x5ee1('0x2b')](handleError(_0x2d6522,null));};exports[_0x5ee1('0x90')]=function(_0x4d6c49,_0x37661f,_0x54c81c){return db['ChatQueue']['find']({'where':{'id':_0x4d6c49[_0x5ee1('0x53')]['id']}})[_0x5ee1('0x22')](handleEntityNotFound(_0x37661f,null))[_0x5ee1('0x22')](function(_0x489373){if(_0x489373){return _0x489373[_0x5ee1('0x90')](_0x4d6c49[_0x5ee1('0x5c')][_0x5ee1('0x6f')],_['omit'](_0x4d6c49[_0x5ee1('0x5c')],[_0x5ee1('0x6f'),'id'])||{})['spread'](function(_0x4e3cff){for(var _0x1eb811=0x0;_0x1eb811<_0x4d6c49[_0x5ee1('0x5c')]['ids'][_0x5ee1('0x61')];_0x1eb811+=0x1){socket['emit'](_0x5ee1('0x91'),{'UserId':Number(_0x4d6c49[_0x5ee1('0x5c')]['ids'][_0x1eb811]),'ChatQueueId':Number(_0x4d6c49[_0x5ee1('0x53')]['id'])});}return _0x4e3cff;});}})[_0x5ee1('0x22')](respondWithResult(_0x37661f,null))[_0x5ee1('0x2b')](handleError(_0x37661f,null));};exports[_0x5ee1('0x8e')]=function(_0x23af7c,_0x5b8db7,_0x266511){return db[_0x5ee1('0x3c')][_0x5ee1('0x59')]({'where':{'id':_0x23af7c[_0x5ee1('0x53')]['id']}})['then'](handleEntityNotFound(_0x5b8db7,null))[_0x5ee1('0x22')](function(_0x448500){if(_0x448500){return _0x448500[_0x5ee1('0x8e')](_0x23af7c['query'][_0x5ee1('0x6f')])[_0x5ee1('0x22')](function(){if(_[_0x5ee1('0x92')](_0x23af7c[_0x5ee1('0x41')]['ids'])){for(var _0x5e7b61=0x0;_0x5e7b61<_0x23af7c[_0x5ee1('0x41')]['ids'][_0x5ee1('0x61')];_0x5e7b61+=0x1){socket[_0x5ee1('0x79')](_0x5ee1('0x8f'),{'UserId':Number(_0x23af7c['query'][_0x5ee1('0x6f')][_0x5e7b61]),'ChatQueueId':Number(_0x23af7c['params']['id'])});}}else{socket[_0x5ee1('0x79')](_0x5ee1('0x8f'),{'UserId':Number(_0x23af7c['query'][_0x5ee1('0x6f')]),'ChatQueueId':Number(_0x23af7c[_0x5ee1('0x53')]['id'])});}});}})[_0x5ee1('0x22')](respondWithStatusCode(_0x5b8db7,null))[_0x5ee1('0x2b')](handleError(_0x5b8db7,null));};exports[_0x5ee1('0x93')]=function(_0x2a581f,_0x188bf5,_0x301a39){var _0x32242e={};var _0x39fcb2={};var _0x553a4d;var _0x310987;return db['ChatQueue'][_0x5ee1('0x5f')]({'where':{'id':_0x2a581f[_0x5ee1('0x53')]['id']}})[_0x5ee1('0x22')](handleEntityNotFound(_0x188bf5,null))['then'](function(_0x53754a){if(_0x53754a){_0x553a4d=_0x53754a;_0x39fcb2[_0x5ee1('0x40')]=_[_0x5ee1('0x42')](db[_0x5ee1('0x7b')]['rawAttributes']);_0x39fcb2[_0x5ee1('0x41')]=_['keys'](_0x2a581f[_0x5ee1('0x41')]);_0x39fcb2[_0x5ee1('0x4a')]=_[_0x5ee1('0x43')](_0x39fcb2[_0x5ee1('0x40')],_0x39fcb2[_0x5ee1('0x41')]);_0x32242e['attributes']=_[_0x5ee1('0x43')](_0x39fcb2['model'],qs[_0x5ee1('0x45')](_0x2a581f[_0x5ee1('0x41')][_0x5ee1('0x45')]));_0x32242e[_0x5ee1('0x44')]=_0x32242e[_0x5ee1('0x44')][_0x5ee1('0x61')]?_0x32242e[_0x5ee1('0x44')]:_0x39fcb2['model'];_0x32242e[_0x5ee1('0x47')]=qs[_0x5ee1('0x48')](_0x2a581f[_0x5ee1('0x41')]['sort']);_0x32242e[_0x5ee1('0x49')]=qs[_0x5ee1('0x4a')](_[_0x5ee1('0x4b')](_0x2a581f[_0x5ee1('0x41')],_0x39fcb2[_0x5ee1('0x4a')]));if(_0x2a581f[_0x5ee1('0x41')][_0x5ee1('0x4f')]){_0x32242e['where']=_[_0x5ee1('0x4c')](_0x32242e['where'],{'$or':_[_0x5ee1('0x3b')](_0x32242e[_0x5ee1('0x44')],function(_0x5ad6e8){var _0x532603={};_0x532603[_0x5ad6e8]={'$like':'%'+_0x2a581f[_0x5ee1('0x41')]['filter']+'%'};return _0x532603;})});}_0x32242e=_[_0x5ee1('0x4c')]({},_0x32242e,_0x2a581f[_0x5ee1('0x63')]);return _0x553a4d['getAgents'](_0x32242e);}})[_0x5ee1('0x22')](function(_0x5e2dd7){if(_0x5e2dd7){_0x310987=_0x5e2dd7[_0x5ee1('0x61')];if(!_0x2a581f[_0x5ee1('0x41')][_0x5ee1('0x94')](_0x5ee1('0x46'))){_0x32242e[_0x5ee1('0x32')]=qs['limit'](_0x2a581f[_0x5ee1('0x41')][_0x5ee1('0x32')]);_0x32242e[_0x5ee1('0x30')]=qs[_0x5ee1('0x30')](_0x2a581f[_0x5ee1('0x41')][_0x5ee1('0x30')]);}return _0x553a4d[_0x5ee1('0x93')](_0x32242e);}})[_0x5ee1('0x22')](function(_0x10144a){if(_0x10144a){return _0x10144a?{'count':_0x310987,'rows':_0x10144a}:null;}})[_0x5ee1('0x22')](respondWithResult(_0x188bf5,null))[_0x5ee1('0x2b')](handleError(_0x188bf5,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 6f439ae..682f0f1 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 _0x1987=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1987,0x140));var _0x7198=function(_0x4eda24,_0x407afa){_0x4eda24=_0x4eda24-0x0;var _0x5300cf=_0x1987[_0x4eda24];return _0x5300cf;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x7198('0x0'))['db'][_0x7198('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7198('0x2')](0x0);var events={'afterCreate':_0x7198('0x3'),'afterUpdate':_0x7198('0x4'),'afterDestroy':_0x7198('0x5')};function emitEvent(_0x1e67e4){return function(_0x3bfc4f,_0x49d7b3,_0x35111a){ChatQueueEvents[_0x7198('0x6')](_0x1e67e4+':'+_0x3bfc4f['id'],_0x3bfc4f);ChatQueueEvents['emit'](_0x1e67e4,_0x3bfc4f);_0x35111a(null);};}for(var e in events){if(events[_0x7198('0x7')](e)){var event=events[e];ChatQueue[_0x7198('0x8')](e,emitEvent(event));}}module[_0x7198('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0x1928=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x2ed22c,_0x5ba2b1){var _0x10d89a=function(_0x435ddd){while(--_0x435ddd){_0x2ed22c['push'](_0x2ed22c['shift']());}};_0x10d89a(++_0x5ba2b1);}(_0x1928,0x183));var _0x8192=function(_0x2d7720,_0x3b176f){_0x2d7720=_0x2d7720-0x0;var _0x1345dc=_0x1928[_0x2d7720];return _0x1345dc;};'use strict';var EventEmitter=require(_0x8192('0x0'));var ChatQueue=require(_0x8192('0x1'))['db'][_0x8192('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8192('0x3')](0x0);var events={'afterCreate':_0x8192('0x4'),'afterUpdate':_0x8192('0x5'),'afterDestroy':_0x8192('0x6')};function emitEvent(_0x2c1c17){return function(_0xcafdfd,_0xfa58df,_0x1e4e0d){ChatQueueEvents[_0x8192('0x7')](_0x2c1c17+':'+_0xcafdfd['id'],_0xcafdfd);ChatQueueEvents['emit'](_0x2c1c17,_0xcafdfd);_0x1e4e0d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x8192('0x8')](e,emitEvent(event));}}module[_0x8192('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 70090b6..6a1cc45 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 _0x5b56=['api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatQueue','chat_queues','lodash','util'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x5b56,0xee));var _0x65b5=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5b56[_0x432682];return _0x463d05;};'use strict';var _=require(_0x65b5('0x0'));var util=require(_0x65b5('0x1'));var logger=require('../../config/logger')(_0x65b5('0x2'));var moment=require(_0x65b5('0x3'));var BPromise=require(_0x65b5('0x4'));var rp=require(_0x65b5('0x5'));var fs=require('fs');var path=require(_0x65b5('0x6'));var rimraf=require(_0x65b5('0x7'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x65b5('0x8')]=function(_0x4f311c,_0x2bc78e){return _0x4f311c[_0x65b5('0x9')](_0x65b5('0xa'),attributes,{'tableName':_0x65b5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc639=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','chat_queues','lodash','../../config/logger'];(function(_0x3225a5,_0x4dafa5){var _0x476b82=function(_0x45137e){while(--_0x45137e){_0x3225a5['push'](_0x3225a5['shift']());}};_0x476b82(++_0x4dafa5);}(_0xc639,0xa3));var _0x9c63=function(_0x328145,_0x3ddf70){_0x328145=_0x328145-0x0;var _0x452e0d=_0xc639[_0x328145];return _0x452e0d;};'use strict';var _=require(_0x9c63('0x0'));var util=require('util');var logger=require(_0x9c63('0x1'))(_0x9c63('0x2'));var moment=require('moment');var BPromise=require(_0x9c63('0x3'));var rp=require(_0x9c63('0x4'));var fs=require('fs');var path=require(_0x9c63('0x5'));var rimraf=require(_0x9c63('0x6'));var config=require(_0x9c63('0x7'));var attributes=require(_0x9c63('0x8'));module[_0x9c63('0x9')]=function(_0x4ad5e7,_0x12e7f6){return _0x4ad5e7['define']('ChatQueue',attributes,{'tableName':_0x9c63('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 419e78d..34d8eda 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 _0x3c91=['GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','map','model','stringify','ShowChatQueue','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x5e9b1a,_0x3ce176){var _0x15a77e=function(_0x32cd6a){while(--_0x32cd6a){_0x5e9b1a['push'](_0x5e9b1a['shift']());}};_0x15a77e(++_0x3ce176);}(_0x3c91,0x1af));var _0x13c9=function(_0x29b167,_0x29171c){_0x29b167=_0x29b167-0x0;var _0x13f0cd=_0x3c91[_0x29b167];return _0x13f0cd;};'use strict';var _=require(_0x13c9('0x0'));var util=require(_0x13c9('0x1'));var moment=require(_0x13c9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c9('0x3'));var db=require(_0x13c9('0x4'))['db'];var utils=require(_0x13c9('0x5'));var logger=require('../../config/logger')(_0x13c9('0x6'));var config=require(_0x13c9('0x7'));var jayson=require(_0x13c9('0x8'));var client=jayson[_0x13c9('0x9')][_0x13c9('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x13c9('0xb')],{'host':_0x13c9('0xc'),'port':0x18eb});var socket=require(_0x13c9('0xd'))(new Redis(config[_0x13c9('0xb')]));require(_0x13c9('0xe'))['register'](socket);function respondWithRpcPromise(_0x4da00c,_0x3053a9,_0x3554c3){return new BPromise(function(_0x5e5446,_0x59ed70){return client[_0x13c9('0xf')](_0x4da00c,_0x3554c3)[_0x13c9('0x10')](function(_0xc1cc72){logger[_0x13c9('0x11')](_0x13c9('0x12'),_0x3053a9,_0x13c9('0x13'));logger[_0x13c9('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3053a9,_0x13c9('0x13'),JSON['stringify'](_0xc1cc72));if(_0xc1cc72['error']){if(_0xc1cc72['error']['code']===0x1f4){logger['error'](_0x13c9('0x12'),_0x3053a9,_0xc1cc72[_0x13c9('0x15')]['message']);return _0x59ed70(_0xc1cc72[_0x13c9('0x15')][_0x13c9('0x16')]);}logger[_0x13c9('0x15')](_0x13c9('0x12'),_0x3053a9,_0xc1cc72[_0x13c9('0x15')][_0x13c9('0x16')]);return _0x5e5446(_0xc1cc72[_0x13c9('0x15')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x3053a9,_0x13c9('0x13'));_0x5e5446(_0xc1cc72[_0x13c9('0x17')][_0x13c9('0x16')]);}})[_0x13c9('0x18')](function(_0x3b6c1a){logger['error'](_0x13c9('0x12'),_0x3053a9,_0x3b6c1a);_0x59ed70(_0x3b6c1a);});});}exports[_0x13c9('0x19')]=function(_0xf95546){var _0x15463b=this;return new Promise(function(_0x6fc26f,_0x329c69){return db[_0x13c9('0x1a')]['findAll']({'raw':_0xf95546[_0x13c9('0x1b')]?_0xf95546[_0x13c9('0x1b')][_0x13c9('0x1c')]===undefined?!![]:![]:!![],'where':_0xf95546[_0x13c9('0x1b')]?_0xf95546[_0x13c9('0x1b')][_0x13c9('0x1d')]||null:null,'attributes':_0xf95546[_0x13c9('0x1b')]?_0xf95546[_0x13c9('0x1b')][_0x13c9('0x1e')]||null:null,'limit':_0xf95546[_0x13c9('0x1b')]?_0xf95546['options'][_0x13c9('0x1f')]||null:null,'include':_0xf95546[_0x13c9('0x1b')]?_0xf95546[_0x13c9('0x1b')][_0x13c9('0x20')]?_[_0x13c9('0x21')](_0xf95546['options'][_0x13c9('0x20')],function(_0x53b62f){return{'model':db[_0x53b62f['model']],'as':_0x53b62f['as'],'attributes':_0x53b62f[_0x13c9('0x1e')],'include':_0x53b62f[_0x13c9('0x20')]?_[_0x13c9('0x21')](_0x53b62f[_0x13c9('0x20')],function(_0x362cb7){return{'model':db[_0x362cb7[_0x13c9('0x22')]],'as':_0x362cb7['as'],'attributes':_0x362cb7[_0x13c9('0x1e')],'include':_0x362cb7[_0x13c9('0x20')]?_[_0x13c9('0x21')](_0x362cb7[_0x13c9('0x20')],function(_0x4ec9ff){return{'model':db[_0x4ec9ff[_0x13c9('0x22')]],'as':_0x4ec9ff['as'],'attributes':_0x4ec9ff[_0x13c9('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43519b){logger[_0x13c9('0x11')](_0x13c9('0x19'),_0xf95546);logger['debug']('GetChatQueue',_0xf95546,JSON[_0x13c9('0x23')](_0x43519b));_0x6fc26f(_0x43519b);})[_0x13c9('0x18')](function(_0x1a1710){logger['error'](_0x13c9('0x19'),_0x1a1710[_0x13c9('0x16')],_0xf95546);_0x329c69(_0x15463b[_0x13c9('0x15')](0x1f4,_0x1a1710[_0x13c9('0x16')]));});});};exports[_0x13c9('0x24')]=function(_0x51c58d){var _0x2fe251=this;return new Promise(function(_0x3f6a0c,_0x2ce0a0){return db[_0x13c9('0x1a')][_0x13c9('0x25')]({'raw':_0x51c58d[_0x13c9('0x1b')]?_0x51c58d[_0x13c9('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x51c58d[_0x13c9('0x1b')]?_0x51c58d[_0x13c9('0x1b')]['where']||null:null,'attributes':_0x51c58d[_0x13c9('0x1b')]?_0x51c58d[_0x13c9('0x1b')][_0x13c9('0x1e')]||null:null,'include':_0x51c58d[_0x13c9('0x1b')]?_0x51c58d[_0x13c9('0x1b')][_0x13c9('0x20')]?_['map'](_0x51c58d['options'][_0x13c9('0x20')],function(_0x1da6c8){return{'model':db[_0x1da6c8[_0x13c9('0x22')]],'as':_0x1da6c8['as'],'attributes':_0x1da6c8[_0x13c9('0x1e')],'include':_0x1da6c8['include']?_[_0x13c9('0x21')](_0x1da6c8[_0x13c9('0x20')],function(_0x4d2cd2){return{'model':db[_0x4d2cd2[_0x13c9('0x22')]],'as':_0x4d2cd2['as'],'attributes':_0x4d2cd2[_0x13c9('0x1e')],'include':_0x4d2cd2[_0x13c9('0x20')]?_['map'](_0x4d2cd2[_0x13c9('0x20')],function(_0x2a2b2c){return{'model':db[_0x2a2b2c[_0x13c9('0x22')]],'as':_0x2a2b2c['as'],'attributes':_0x2a2b2c[_0x13c9('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50246c){logger[_0x13c9('0x11')](_0x13c9('0x24'),_0x51c58d);logger['debug'](_0x13c9('0x24'),_0x51c58d,JSON[_0x13c9('0x23')](_0x50246c));_0x3f6a0c(_0x50246c);})[_0x13c9('0x18')](function(_0x1b9ef6){logger[_0x13c9('0x15')](_0x13c9('0x24'),_0x1b9ef6[_0x13c9('0x16')],_0x51c58d);_0x2ce0a0(_0x2fe251[_0x13c9('0x15')](0x1f4,_0x1b9ef6['message']));});});}; \ No newline at end of file +var _0x56e7=['jayson/promise','client','defaults','redis','./chatQueue.socket','register','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','ShowChatQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x56e7,0x93));var _0x756e=function(_0x37da87,_0x35afb4){_0x37da87=_0x37da87-0x0;var _0x2380c7=_0x56e7[_0x37da87];return _0x2380c7;};'use strict';var _=require(_0x756e('0x0'));var util=require(_0x756e('0x1'));var moment=require(_0x756e('0x2'));var BPromise=require(_0x756e('0x3'));var rs=require(_0x756e('0x4'));var fs=require('fs');var Redis=require(_0x756e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x756e('0x6'));var logger=require(_0x756e('0x7'))(_0x756e('0x8'));var config=require('../../config/environment');var jayson=require(_0x756e('0x9'));var client=jayson[_0x756e('0xa')]['http']({'port':0x232a});config['redis']=_[_0x756e('0xb')](config[_0x756e('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x756e('0xd'))[_0x756e('0xe')](socket);function respondWithRpcPromise(_0x1d6a9b,_0x20926f,_0x30994d){return new BPromise(function(_0x5b9435,_0x20bcaa){return client['request'](_0x1d6a9b,_0x30994d)[_0x756e('0xf')](function(_0x147f39){logger[_0x756e('0x10')]('ChatQueue,\x20%s,\x20%s',_0x20926f,_0x756e('0x11'));logger[_0x756e('0x12')](_0x756e('0x13'),_0x20926f,'request\x20sent',JSON[_0x756e('0x14')](_0x147f39));if(_0x147f39[_0x756e('0x15')]){if(_0x147f39[_0x756e('0x15')][_0x756e('0x16')]===0x1f4){logger[_0x756e('0x15')](_0x756e('0x17'),_0x20926f,_0x147f39['error'][_0x756e('0x18')]);return _0x20bcaa(_0x147f39[_0x756e('0x15')][_0x756e('0x18')]);}logger[_0x756e('0x15')](_0x756e('0x17'),_0x20926f,_0x147f39['error']['message']);return _0x5b9435(_0x147f39['error'][_0x756e('0x18')]);}else{logger[_0x756e('0x10')]('ChatQueue,\x20%s,\x20%s',_0x20926f,_0x756e('0x11'));_0x5b9435(_0x147f39['result'][_0x756e('0x18')]);}})[_0x756e('0x19')](function(_0x55f6ff){logger[_0x756e('0x15')](_0x756e('0x17'),_0x20926f,_0x55f6ff);_0x20bcaa(_0x55f6ff);});});}exports[_0x756e('0x1a')]=function(_0x156cb4){var _0x11112a=this;return new Promise(function(_0x5650d6,_0x50759b){return db[_0x756e('0x1b')][_0x756e('0x1c')]({'raw':_0x156cb4['options']?_0x156cb4[_0x756e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x156cb4['options']?_0x156cb4[_0x756e('0x1d')][_0x756e('0x1e')]||null:null,'attributes':_0x156cb4['options']?_0x156cb4[_0x756e('0x1d')][_0x756e('0x1f')]||null:null,'limit':_0x156cb4['options']?_0x156cb4['options'][_0x756e('0x20')]||null:null,'include':_0x156cb4[_0x756e('0x1d')]?_0x156cb4[_0x756e('0x1d')][_0x756e('0x21')]?_[_0x756e('0x22')](_0x156cb4['options'][_0x756e('0x21')],function(_0x7b1ab){return{'model':db[_0x7b1ab[_0x756e('0x23')]],'as':_0x7b1ab['as'],'attributes':_0x7b1ab['attributes'],'include':_0x7b1ab[_0x756e('0x21')]?_[_0x756e('0x22')](_0x7b1ab[_0x756e('0x21')],function(_0x5ee8ae){return{'model':db[_0x5ee8ae[_0x756e('0x23')]],'as':_0x5ee8ae['as'],'attributes':_0x5ee8ae[_0x756e('0x1f')],'include':_0x5ee8ae[_0x756e('0x21')]?_[_0x756e('0x22')](_0x5ee8ae[_0x756e('0x21')],function(_0x300315){return{'model':db[_0x300315[_0x756e('0x23')]],'as':_0x300315['as'],'attributes':_0x300315[_0x756e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x756e('0xf')](function(_0x3fb17e){logger['info'](_0x756e('0x1a'),_0x156cb4);logger[_0x756e('0x12')](_0x756e('0x1a'),_0x156cb4,JSON[_0x756e('0x14')](_0x3fb17e));_0x5650d6(_0x3fb17e);})['catch'](function(_0x286025){logger[_0x756e('0x15')]('GetChatQueue',_0x286025[_0x756e('0x18')],_0x156cb4);_0x50759b(_0x11112a['error'](0x1f4,_0x286025[_0x756e('0x18')]));});});};exports[_0x756e('0x24')]=function(_0x3e5bca){var _0x4cbd18=this;return new Promise(function(_0x26f747,_0x362bc4){return db[_0x756e('0x1b')][_0x756e('0x25')]({'raw':_0x3e5bca[_0x756e('0x1d')]?_0x3e5bca[_0x756e('0x1d')][_0x756e('0x26')]===undefined?!![]:![]:!![],'where':_0x3e5bca[_0x756e('0x1d')]?_0x3e5bca[_0x756e('0x1d')][_0x756e('0x1e')]||null:null,'attributes':_0x3e5bca[_0x756e('0x1d')]?_0x3e5bca['options']['attributes']||null:null,'include':_0x3e5bca[_0x756e('0x1d')]?_0x3e5bca[_0x756e('0x1d')][_0x756e('0x21')]?_['map'](_0x3e5bca[_0x756e('0x1d')][_0x756e('0x21')],function(_0x27c876){return{'model':db[_0x27c876[_0x756e('0x23')]],'as':_0x27c876['as'],'attributes':_0x27c876[_0x756e('0x1f')],'include':_0x27c876[_0x756e('0x21')]?_[_0x756e('0x22')](_0x27c876['include'],function(_0x211553){return{'model':db[_0x211553[_0x756e('0x23')]],'as':_0x211553['as'],'attributes':_0x211553[_0x756e('0x1f')],'include':_0x211553['include']?_[_0x756e('0x22')](_0x211553[_0x756e('0x21')],function(_0x545154){return{'model':db[_0x545154[_0x756e('0x23')]],'as':_0x545154['as'],'attributes':_0x545154[_0x756e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x756e('0xf')](function(_0x5d1ed5){logger[_0x756e('0x10')](_0x756e('0x24'),_0x3e5bca);logger['debug'](_0x756e('0x24'),_0x3e5bca,JSON['stringify'](_0x5d1ed5));_0x26f747(_0x5d1ed5);})[_0x756e('0x19')](function(_0x1e47d8){logger[_0x756e('0x15')](_0x756e('0x24'),_0x1e47d8[_0x756e('0x18')],_0x3e5bca);_0x362bc4(_0x4cbd18['error'](0x1f4,_0x1e47d8[_0x756e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index d3ceb3a..394f81c 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 _0xc978=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x5ccd07,_0x3454cb){var _0x31ae3f=function(_0x44011f){while(--_0x44011f){_0x5ccd07['push'](_0x5ccd07['shift']());}};_0x31ae3f(++_0x3454cb);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var ChatQueueEvents=require(_0x8c97('0x0'));var events=[_0x8c97('0x1'),_0x8c97('0x2'),_0x8c97('0x3')];function createListener(_0x371c48,_0x44d4ea){return function(_0x5ef47d){_0x44d4ea[_0x8c97('0x4')](_0x371c48,_0x5ef47d);};}function removeListener(_0x23c28d,_0x3ad972){return function(){ChatQueueEvents[_0x8c97('0x5')](_0x23c28d,_0x3ad972);};}exports[_0x8c97('0x6')]=function(_0x2a9434){for(var _0xabd146=0x0,_0x524196=events[_0x8c97('0x7')];_0xabd146<_0x524196;_0xabd146++){var _0x1b5864=events[_0xabd146];var _0x332cd1=createListener(_0x8c97('0x8')+_0x1b5864,_0x2a9434);ChatQueueEvents['on'](_0x1b5864,_0x332cd1);}}; \ No newline at end of file +var _0xf72b=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','emit'];(function(_0x1f5974,_0x11540c){var _0x5cb353=function(_0x24a523){while(--_0x24a523){_0x1f5974['push'](_0x1f5974['shift']());}};_0x5cb353(++_0x11540c);}(_0xf72b,0x1d9));var _0xbf72=function(_0x1e3bcf,_0xc812e6){_0x1e3bcf=_0x1e3bcf-0x0;var _0x4e602f=_0xf72b[_0x1e3bcf];return _0x4e602f;};'use strict';var ChatQueueEvents=require(_0xbf72('0x0'));var events=['save',_0xbf72('0x1'),'update'];function createListener(_0xd09dd2,_0x1880d0){return function(_0x5a9feb){_0x1880d0[_0xbf72('0x2')](_0xd09dd2,_0x5a9feb);};}function removeListener(_0x550a9e,_0x37afc8){return function(){ChatQueueEvents[_0xbf72('0x3')](_0x550a9e,_0x37afc8);};}exports[_0xbf72('0x4')]=function(_0x2b8440){for(var _0x5ee060=0x0,_0x41c11d=events[_0xbf72('0x5')];_0x5ee060<_0x41c11d;_0x5ee060++){var _0x119807=events[_0x5ee060];var _0xd0402c=createListener(_0xbf72('0x6')+_0x119807,_0x2b8440);ChatQueueEvents['on'](_0x119807,_0xd0402c);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index b14778c..16555ba 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x54cc43,_0x49cfcd){var _0x7e4df0=function(_0x106a7f){while(--_0x106a7f){_0x54cc43['push'](_0x54cc43['shift']());}};_0x7e4df0(++_0x49cfcd);}(_0xe14b,0x93));var _0xbe14=function(_0x2a6b49,_0x1aa695){_0x2a6b49=_0x2a6b49-0x0;var _0x33de48=_0xe14b[_0x2a6b49];return _0x33de48;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x2f5253,_0x366df4){var _0x1dd177=function(_0x39e41d){while(--_0x39e41d){_0x2f5253['push'](_0x2f5253['shift']());}};_0x1dd177(++_0x366df4);}(_0xe14b,0x93));var _0xbe14=function(_0x42717b,_0x18cbbf){_0x42717b=_0x42717b-0x0;var _0x7a2668=_0xe14b[_0x42717b];return _0x7a2668;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index e2bab6f..3f69492 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 _0x181c=['DATE','moment','sequelize','exports','STRING'];(function(_0x12e189,_0x2f8191){var _0x3fee30=function(_0x16ce48){while(--_0x16ce48){_0x12e189['push'](_0x12e189['shift']());}};_0x3fee30(++_0x2f8191);}(_0x181c,0x14b));var _0xc181=function(_0xf35bc1,_0x510803){_0xf35bc1=_0xf35bc1-0x0;var _0xa6b162=_0x181c[_0xf35bc1];return _0xa6b162;};'use strict';var moment=require(_0xc181('0x0'));var Sequelize=require(_0xc181('0x1'));module[_0xc181('0x2')]={'uniqueid':{'type':Sequelize[_0xc181('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc181('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xc181('0x4')]},'acceptAt':{'type':Sequelize[_0xc181('0x4')]},'exitAt':{'type':Sequelize[_0xc181('0x4')]},'reason':{'type':Sequelize[_0xc181('0x3')]}}; \ No newline at end of file +var _0x23b0=['exports','STRING','DATE','sequelize'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x23b0,0xc3));var _0x023b=function(_0x21fcf2,_0x48e731){_0x21fcf2=_0x21fcf2-0x0;var _0x5960dd=_0x23b0[_0x21fcf2];return _0x5960dd;};'use strict';var moment=require('moment');var Sequelize=require(_0x023b('0x0'));module[_0x023b('0x1')]={'uniqueid':{'type':Sequelize[_0x023b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x023b('0x2')]},'joinAt':{'type':Sequelize[_0x023b('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x023b('0x3')]},'reason':{'type':Sequelize[_0x023b('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index f45eb2f..1f1467c 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 _0x6829=['end','json','offset','limit','undefined','set','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','ChatQueueReport','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status'];(function(_0x2c99a2,_0x1abb07){var _0x364622=function(_0x101395){while(--_0x101395){_0x2c99a2['push'](_0x2c99a2['shift']());}};_0x364622(++_0x1abb07);}(_0x6829,0x14c));var _0x9682=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x6829[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x9682('0x0'));var rimraf=require(_0x9682('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9682('0x2'));var BPromise=require(_0x9682('0x3'));var Mustache=require(_0x9682('0x4'));var util=require(_0x9682('0x5'));var path=require(_0x9682('0x6'));var sox=require(_0x9682('0x7'));var csv=require(_0x9682('0x8'));var ejs=require(_0x9682('0x9'));var fs=require('fs');var fs_extra=require(_0x9682('0xa'));var _=require(_0x9682('0xb'));var squel=require(_0x9682('0xc'));var crypto=require(_0x9682('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9682('0xe'));var Papa=require(_0x9682('0xf'));var Redis=require('ioredis');var authService=require(_0x9682('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9682('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9682('0x12'))(_0x9682('0x13'));var utils=require(_0x9682('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9682('0x15'))['db'];function respondWithStatusCode(_0x1391c3,_0x57e123){_0x57e123=_0x57e123||0xcc;return function(_0x15663f){if(_0x15663f){return _0x1391c3['sendStatus'](_0x57e123);}return _0x1391c3[_0x9682('0x16')](_0x57e123)[_0x9682('0x17')]();};}function respondWithResult(_0x289d8b,_0x21451a){_0x21451a=_0x21451a||0xc8;return function(_0x30bfd7){if(_0x30bfd7){return _0x289d8b[_0x9682('0x16')](_0x21451a)[_0x9682('0x18')](_0x30bfd7);}};}function respondWithFilteredResult(_0xa26517,_0x1adcf8){return function(_0x13a1a9){if(_0x13a1a9){var _0x526391=typeof _0x1adcf8[_0x9682('0x19')]==='undefined'&&typeof _0x1adcf8[_0x9682('0x1a')]===_0x9682('0x1b');var _0x1f4971=_0x13a1a9['count'];var _0x1c73ee=_0x526391?0x0:_0x1adcf8['offset'];var _0x107291=_0x526391?_0x13a1a9['count']:_0x1adcf8[_0x9682('0x19')]+_0x1adcf8[_0x9682('0x1a')];var _0x57d4cf;if(_0x107291>=_0x1f4971){_0x107291=_0x1f4971;_0x57d4cf=0xc8;}else{_0x57d4cf=0xce;}_0xa26517[_0x9682('0x16')](_0x57d4cf);return _0xa26517[_0x9682('0x1c')]('Content-Range',_0x1c73ee+'-'+_0x107291+'/'+_0x1f4971)['json'](_0x13a1a9);}return null;};}function patchUpdates(_0x497ff7){return function(_0x3fca2b){try{jsonpatch['apply'](_0x3fca2b,_0x497ff7,!![]);}catch(_0x36230c){return BPromise[_0x9682('0x1d')](_0x36230c);}return _0x3fca2b['save']();};}function saveUpdates(_0x4650c9,_0x238361){return function(_0x1aacb6){if(_0x1aacb6){return _0x1aacb6[_0x9682('0x1e')](_0x4650c9)[_0x9682('0x1f')](function(_0x1c2eaf){return _0x1c2eaf;});}return null;};}function removeEntity(_0x738838,_0x40e927){return function(_0x107352){if(_0x107352){return _0x107352[_0x9682('0x20')]()['then'](function(){_0x738838[_0x9682('0x16')](0xcc)[_0x9682('0x17')]();});}};}function handleEntityNotFound(_0x88419f,_0x21a10b){return function(_0x39291f){if(!_0x39291f){_0x88419f['sendStatus'](0x194);}return _0x39291f;};}function handleError(_0x756fea,_0x1dbf57){_0x1dbf57=_0x1dbf57||0x1f4;return function(_0x44808c){logger[_0x9682('0x21')](_0x44808c[_0x9682('0x22')]);if(_0x44808c[_0x9682('0x23')]){delete _0x44808c['name'];}_0x756fea[_0x9682('0x16')](_0x1dbf57)[_0x9682('0x24')](_0x44808c);};}exports[_0x9682('0x25')]=function(_0x1d827e,_0x9e3d59){var _0x1fdb4d={},_0x176624={},_0x14d974={'count':0x0,'rows':[]};var _0x5f4294=_[_0x9682('0x26')](db['ChatQueueReport'][_0x9682('0x27')],function(_0x27d7f0){return{'name':_0x27d7f0['fieldName'],'type':_0x27d7f0['type']['key']};});_0x176624['model']=_[_0x9682('0x26')](_0x5f4294,'name');_0x176624[_0x9682('0x28')]=_[_0x9682('0x29')](_0x1d827e[_0x9682('0x28')]);_0x176624[_0x9682('0x2a')]=_['intersection'](_0x176624['model'],_0x176624[_0x9682('0x28')]);_0x1fdb4d[_0x9682('0x2b')]=_[_0x9682('0x2c')](_0x176624[_0x9682('0x2d')],qs[_0x9682('0x2e')](_0x1d827e['query']['fields']));_0x1fdb4d[_0x9682('0x2b')]=_0x1fdb4d[_0x9682('0x2b')][_0x9682('0x2f')]?_0x1fdb4d[_0x9682('0x2b')]:_0x176624[_0x9682('0x2d')];if(!_0x1d827e[_0x9682('0x28')][_0x9682('0x30')]('nolimit')){_0x1fdb4d[_0x9682('0x1a')]=qs[_0x9682('0x1a')](_0x1d827e[_0x9682('0x28')][_0x9682('0x1a')]);_0x1fdb4d[_0x9682('0x19')]=qs['offset'](_0x1d827e[_0x9682('0x28')]['offset']);}_0x1fdb4d[_0x9682('0x31')]=qs[_0x9682('0x32')](_0x1d827e[_0x9682('0x28')][_0x9682('0x32')]);_0x1fdb4d[_0x9682('0x33')]=qs[_0x9682('0x2a')](_[_0x9682('0x34')](_0x1d827e['query'],_0x176624[_0x9682('0x2a')]),_0x5f4294);if(_0x1d827e['query'][_0x9682('0x35')]){_0x1fdb4d['where']=_[_0x9682('0x36')](_0x1fdb4d[_0x9682('0x33')],{'$or':_[_0x9682('0x26')](_0x5f4294,function(_0x110fff){if(_0x110fff[_0x9682('0x37')]!==_0x9682('0x38')){var _0x123367={};_0x123367[_0x110fff[_0x9682('0x23')]]={'$like':'%'+_0x1d827e[_0x9682('0x28')][_0x9682('0x35')]+'%'};return _0x123367;}})});}_0x1fdb4d=_[_0x9682('0x36')]({},_0x1fdb4d,_0x1d827e['options']);var _0x30bdf0={'where':_0x1fdb4d[_0x9682('0x33')]};return db[_0x9682('0x39')][_0x9682('0x3a')](_0x30bdf0)[_0x9682('0x1f')](function(_0x479ac7){_0x14d974[_0x9682('0x3a')]=_0x479ac7;if(_0x1d827e[_0x9682('0x28')][_0x9682('0x3b')]){_0x1fdb4d['include']=[{'all':!![]}];}return db[_0x9682('0x39')][_0x9682('0x3c')](_0x1fdb4d);})[_0x9682('0x1f')](function(_0x240431){_0x14d974[_0x9682('0x3d')]=_0x240431;return _0x14d974;})[_0x9682('0x1f')](respondWithFilteredResult(_0x9e3d59,_0x1fdb4d))[_0x9682('0x3e')](handleError(_0x9e3d59,null));};exports[_0x9682('0x3f')]=function(_0x6e3eaa,_0x2d9b43){var _0x46b5c6={'raw':!![],'where':{'id':_0x6e3eaa[_0x9682('0x40')]['id']}},_0x3324b2={};_0x3324b2[_0x9682('0x2d')]=_[_0x9682('0x29')](db[_0x9682('0x39')]['rawAttributes']);_0x3324b2[_0x9682('0x28')]=_['keys'](_0x6e3eaa[_0x9682('0x28')]);_0x3324b2[_0x9682('0x2a')]=_[_0x9682('0x2c')](_0x3324b2['model'],_0x3324b2['query']);_0x46b5c6[_0x9682('0x2b')]=_[_0x9682('0x2c')](_0x3324b2[_0x9682('0x2d')],qs[_0x9682('0x2e')](_0x6e3eaa[_0x9682('0x28')][_0x9682('0x2e')]));_0x46b5c6[_0x9682('0x2b')]=_0x46b5c6['attributes'][_0x9682('0x2f')]?_0x46b5c6['attributes']:_0x3324b2[_0x9682('0x2d')];if(_0x6e3eaa[_0x9682('0x28')][_0x9682('0x3b')]){_0x46b5c6[_0x9682('0x41')]=[{'all':!![]}];}_0x46b5c6=_[_0x9682('0x36')]({},_0x46b5c6,_0x6e3eaa[_0x9682('0x42')]);return db[_0x9682('0x39')][_0x9682('0x43')](_0x46b5c6)['then'](handleEntityNotFound(_0x2d9b43,null))[_0x9682('0x1f')](respondWithResult(_0x2d9b43,null))[_0x9682('0x3e')](handleError(_0x2d9b43,null));};exports[_0x9682('0x44')]=function(_0x1d09a4,_0xd99414){return db[_0x9682('0x39')]['create'](_0x1d09a4[_0x9682('0x45')],{})[_0x9682('0x1f')](respondWithResult(_0xd99414,0xc9))[_0x9682('0x3e')](handleError(_0xd99414,null));};exports[_0x9682('0x1e')]=function(_0x3c79ce,_0x2cc99b){if(_0x3c79ce[_0x9682('0x45')]['id']){delete _0x3c79ce[_0x9682('0x45')]['id'];}return db[_0x9682('0x39')][_0x9682('0x43')]({'where':{'id':_0x3c79ce['params']['id']}})['then'](handleEntityNotFound(_0x2cc99b,null))['then'](saveUpdates(_0x3c79ce['body'],null))['then'](respondWithResult(_0x2cc99b,null))[_0x9682('0x3e')](handleError(_0x2cc99b,null));};exports[_0x9682('0x20')]=function(_0x731dd0,_0x5154c7){return db[_0x9682('0x39')][_0x9682('0x43')]({'where':{'id':_0x731dd0[_0x9682('0x40')]['id']}})['then'](handleEntityNotFound(_0x5154c7,null))[_0x9682('0x1f')](removeEntity(_0x5154c7,null))[_0x9682('0x3e')](handleError(_0x5154c7,null));};exports[_0x9682('0x46')]=function(_0x29fa7f,_0x3357d5){return db[_0x9682('0x39')][_0x9682('0x46')]()['then'](respondWithResult(_0x3357d5,null))[_0x9682('0x3e')](handleError(_0x3357d5,null));}; \ No newline at end of file +var _0x510e=['fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../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','reject','update','then','destroy','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes'];(function(_0x555e25,_0x7bf2c8){var _0x5633b6=function(_0x73d246){while(--_0x73d246){_0x555e25['push'](_0x555e25['shift']());}};_0x5633b6(++_0x7bf2c8);}(_0x510e,0x1ed));var _0xe510=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x510e[_0x49d41c];return _0xb64c5f;};'use strict';var emlformat=require(_0xe510('0x0'));var rimraf=require(_0xe510('0x1'));var zipdir=require(_0xe510('0x2'));var jsonpatch=require(_0xe510('0x3'));var rp=require(_0xe510('0x4'));var moment=require(_0xe510('0x5'));var BPromise=require(_0xe510('0x6'));var Mustache=require(_0xe510('0x7'));var util=require(_0xe510('0x8'));var path=require('path');var sox=require(_0xe510('0x9'));var csv=require(_0xe510('0xa'));var ejs=require(_0xe510('0xb'));var fs=require('fs');var fs_extra=require(_0xe510('0xc'));var _=require(_0xe510('0xd'));var squel=require(_0xe510('0xe'));var crypto=require(_0xe510('0xf'));var jsforce=require(_0xe510('0x10'));var deskjs=require(_0xe510('0x11'));var toCsv=require(_0xe510('0xa'));var querystring=require(_0xe510('0x12'));var Papa=require(_0xe510('0x13'));var Redis=require(_0xe510('0x14'));var authService=require(_0xe510('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xe510('0x16'));var hardwareService=require(_0xe510('0x17'));var logger=require(_0xe510('0x18'))(_0xe510('0x19'));var utils=require(_0xe510('0x1a'));var config=require(_0xe510('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xe510('0x1c'))['db'];function respondWithStatusCode(_0x2168b2,_0x55ee64){_0x55ee64=_0x55ee64||0xcc;return function(_0x261832){if(_0x261832){return _0x2168b2[_0xe510('0x1d')](_0x55ee64);}return _0x2168b2[_0xe510('0x1e')](_0x55ee64)[_0xe510('0x1f')]();};}function respondWithResult(_0x351376,_0x1b399f){_0x1b399f=_0x1b399f||0xc8;return function(_0x3af96e){if(_0x3af96e){return _0x351376[_0xe510('0x1e')](_0x1b399f)[_0xe510('0x20')](_0x3af96e);}};}function respondWithFilteredResult(_0x538d55,_0x8150a7){return function(_0x52feea){if(_0x52feea){var _0x574ce5=typeof _0x8150a7[_0xe510('0x21')]===_0xe510('0x22')&&typeof _0x8150a7[_0xe510('0x23')]===_0xe510('0x22');var _0x9b92b0=_0x52feea[_0xe510('0x24')];var _0x268736=_0x574ce5?0x0:_0x8150a7[_0xe510('0x21')];var _0x48e676=_0x574ce5?_0x52feea[_0xe510('0x24')]:_0x8150a7[_0xe510('0x21')]+_0x8150a7[_0xe510('0x23')];var _0x4dd3d8;if(_0x48e676>=_0x9b92b0){_0x48e676=_0x9b92b0;_0x4dd3d8=0xc8;}else{_0x4dd3d8=0xce;}_0x538d55[_0xe510('0x1e')](_0x4dd3d8);return _0x538d55[_0xe510('0x25')](_0xe510('0x26'),_0x268736+'-'+_0x48e676+'/'+_0x9b92b0)['json'](_0x52feea);}return null;};}function patchUpdates(_0xd3237){return function(_0x212e3e){try{jsonpatch['apply'](_0x212e3e,_0xd3237,!![]);}catch(_0x269596){return BPromise[_0xe510('0x27')](_0x269596);}return _0x212e3e['save']();};}function saveUpdates(_0x25b523,_0x460d28){return function(_0x4a0c3d){if(_0x4a0c3d){return _0x4a0c3d[_0xe510('0x28')](_0x25b523)[_0xe510('0x29')](function(_0x2ba74a){return _0x2ba74a;});}return null;};}function removeEntity(_0x2ea51b,_0xc6ffae){return function(_0x4c034f){if(_0x4c034f){return _0x4c034f[_0xe510('0x2a')]()['then'](function(){_0x2ea51b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4425ee,_0x26988f){return function(_0x5abf44){if(!_0x5abf44){_0x4425ee[_0xe510('0x1d')](0x194);}return _0x5abf44;};}function handleError(_0x59d10b,_0x11ed03){_0x11ed03=_0x11ed03||0x1f4;return function(_0x45ea1e){logger[_0xe510('0x2b')](_0x45ea1e[_0xe510('0x2c')]);if(_0x45ea1e[_0xe510('0x2d')]){delete _0x45ea1e[_0xe510('0x2d')];}_0x59d10b[_0xe510('0x1e')](_0x11ed03)[_0xe510('0x2e')](_0x45ea1e);};}exports[_0xe510('0x2f')]=function(_0x2aff62,_0x92bfa3){var _0x5dcdb3={},_0xf5a2fb={},_0x1ea081={'count':0x0,'rows':[]};var _0x49a33f=_['map'](db[_0xe510('0x30')][_0xe510('0x31')],function(_0x538e31){return{'name':_0x538e31[_0xe510('0x32')],'type':_0x538e31[_0xe510('0x33')][_0xe510('0x34')]};});_0xf5a2fb[_0xe510('0x35')]=_[_0xe510('0x36')](_0x49a33f,'name');_0xf5a2fb[_0xe510('0x37')]=_[_0xe510('0x38')](_0x2aff62[_0xe510('0x37')]);_0xf5a2fb[_0xe510('0x39')]=_[_0xe510('0x3a')](_0xf5a2fb[_0xe510('0x35')],_0xf5a2fb[_0xe510('0x37')]);_0x5dcdb3[_0xe510('0x3b')]=_[_0xe510('0x3a')](_0xf5a2fb[_0xe510('0x35')],qs['fields'](_0x2aff62[_0xe510('0x37')][_0xe510('0x3c')]));_0x5dcdb3[_0xe510('0x3b')]=_0x5dcdb3[_0xe510('0x3b')][_0xe510('0x3d')]?_0x5dcdb3[_0xe510('0x3b')]:_0xf5a2fb[_0xe510('0x35')];if(!_0x2aff62[_0xe510('0x37')][_0xe510('0x3e')](_0xe510('0x3f'))){_0x5dcdb3[_0xe510('0x23')]=qs[_0xe510('0x23')](_0x2aff62[_0xe510('0x37')][_0xe510('0x23')]);_0x5dcdb3[_0xe510('0x21')]=qs[_0xe510('0x21')](_0x2aff62[_0xe510('0x37')]['offset']);}_0x5dcdb3[_0xe510('0x40')]=qs[_0xe510('0x41')](_0x2aff62['query'][_0xe510('0x41')]);_0x5dcdb3[_0xe510('0x42')]=qs['filters'](_['pick'](_0x2aff62[_0xe510('0x37')],_0xf5a2fb[_0xe510('0x39')]),_0x49a33f);if(_0x2aff62[_0xe510('0x37')][_0xe510('0x43')]){_0x5dcdb3['where']=_[_0xe510('0x44')](_0x5dcdb3['where'],{'$or':_[_0xe510('0x36')](_0x49a33f,function(_0x2bec4b){if(_0x2bec4b[_0xe510('0x33')]!=='VIRTUAL'){var _0x31ef35={};_0x31ef35[_0x2bec4b[_0xe510('0x2d')]]={'$like':'%'+_0x2aff62[_0xe510('0x37')][_0xe510('0x43')]+'%'};return _0x31ef35;}})});}_0x5dcdb3=_[_0xe510('0x44')]({},_0x5dcdb3,_0x2aff62[_0xe510('0x45')]);var _0x266f2a={'where':_0x5dcdb3[_0xe510('0x42')]};return db[_0xe510('0x30')][_0xe510('0x24')](_0x266f2a)[_0xe510('0x29')](function(_0x1e3912){_0x1ea081[_0xe510('0x24')]=_0x1e3912;if(_0x2aff62[_0xe510('0x37')][_0xe510('0x46')]){_0x5dcdb3[_0xe510('0x47')]=[{'all':!![]}];}return db[_0xe510('0x30')][_0xe510('0x48')](_0x5dcdb3);})[_0xe510('0x29')](function(_0x5a92f4){_0x1ea081['rows']=_0x5a92f4;return _0x1ea081;})['then'](respondWithFilteredResult(_0x92bfa3,_0x5dcdb3))[_0xe510('0x49')](handleError(_0x92bfa3,null));};exports[_0xe510('0x4a')]=function(_0x198615,_0x251e86){var _0x58f6af={'raw':!![],'where':{'id':_0x198615[_0xe510('0x4b')]['id']}},_0x59a603={};_0x59a603[_0xe510('0x35')]=_['keys'](db[_0xe510('0x30')][_0xe510('0x31')]);_0x59a603['query']=_[_0xe510('0x38')](_0x198615[_0xe510('0x37')]);_0x59a603[_0xe510('0x39')]=_[_0xe510('0x3a')](_0x59a603['model'],_0x59a603[_0xe510('0x37')]);_0x58f6af[_0xe510('0x3b')]=_[_0xe510('0x3a')](_0x59a603['model'],qs[_0xe510('0x3c')](_0x198615[_0xe510('0x37')]['fields']));_0x58f6af[_0xe510('0x3b')]=_0x58f6af[_0xe510('0x3b')][_0xe510('0x3d')]?_0x58f6af['attributes']:_0x59a603[_0xe510('0x35')];if(_0x198615['query'][_0xe510('0x46')]){_0x58f6af[_0xe510('0x47')]=[{'all':!![]}];}_0x58f6af=_[_0xe510('0x44')]({},_0x58f6af,_0x198615[_0xe510('0x45')]);return db['ChatQueueReport'][_0xe510('0x4c')](_0x58f6af)['then'](handleEntityNotFound(_0x251e86,null))[_0xe510('0x29')](respondWithResult(_0x251e86,null))['catch'](handleError(_0x251e86,null));};exports['create']=function(_0x5acee9,_0x684d19){return db['ChatQueueReport']['create'](_0x5acee9['body'],{})[_0xe510('0x29')](respondWithResult(_0x684d19,0xc9))[_0xe510('0x49')](handleError(_0x684d19,null));};exports[_0xe510('0x28')]=function(_0x38ccc1,_0x4cce42){if(_0x38ccc1[_0xe510('0x4d')]['id']){delete _0x38ccc1[_0xe510('0x4d')]['id'];}return db[_0xe510('0x30')][_0xe510('0x4c')]({'where':{'id':_0x38ccc1['params']['id']}})['then'](handleEntityNotFound(_0x4cce42,null))['then'](saveUpdates(_0x38ccc1[_0xe510('0x4d')],null))[_0xe510('0x29')](respondWithResult(_0x4cce42,null))[_0xe510('0x49')](handleError(_0x4cce42,null));};exports[_0xe510('0x2a')]=function(_0x992fa4,_0x4f1d42){return db[_0xe510('0x30')]['find']({'where':{'id':_0x992fa4[_0xe510('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4f1d42,null))['then'](removeEntity(_0x4f1d42,null))[_0xe510('0x49')](handleError(_0x4f1d42,null));};exports[_0xe510('0x4e')]=function(_0x58409b,_0x199f5f){return db[_0xe510('0x30')][_0xe510('0x4e')]()[_0xe510('0x29')](respondWithResult(_0x199f5f,null))[_0xe510('0x49')](handleError(_0x199f5f,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 9c4b9e0..398cf3e 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x5e6258,_0x1132f3){var _0x1d1cc0=function(_0x720a28){while(--_0x720a28){_0x5e6258['push'](_0x5e6258['shift']());}};_0x1d1cc0(++_0x1132f3);}(_0x757a,0xde));var _0xa757=function(_0x4e0989,_0xb3ef93){_0x4e0989=_0x4e0989-0x0;var _0x131a0f=_0x757a[_0x4e0989];return _0x131a0f;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x1d1e32,_0x5165c5){var _0xcd5a5a=function(_0x8fb8f8){while(--_0x8fb8f8){_0x1d1e32['push'](_0x1d1e32['shift']());}};_0xcd5a5a(++_0x5165c5);}(_0xb7e7,0x121));var _0x7b7e=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xb7e7[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 28e8537..8f1c903 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 _0x5c89=['jayson/promise','http','then','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','body','info','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x1de42c,_0x427f71){var _0x2f24cd=function(_0x517e55){while(--_0x517e55){_0x1de42c['push'](_0x1de42c['shift']());}};_0x2f24cd(++_0x427f71);}(_0x5c89,0x69));var _0x95c8=function(_0x2faa26,_0x137595){_0x2faa26=_0x2faa26-0x0;var _0x2b253a=_0x5c89[_0x2faa26];return _0x2b253a;};'use strict';var _=require(_0x95c8('0x0'));var util=require(_0x95c8('0x1'));var moment=require('moment');var BPromise=require(_0x95c8('0x2'));var rs=require(_0x95c8('0x3'));var fs=require('fs');var Redis=require(_0x95c8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x95c8('0x5'))(_0x95c8('0x6'));var config=require('../../config/environment');var jayson=require(_0x95c8('0x7'));var client=jayson['client'][_0x95c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x156a74,_0x1557fc,_0x11c6de){return new BPromise(function(_0x47d3dc,_0x506273){return client['request'](_0x156a74,_0x11c6de)[_0x95c8('0x9')](function(_0x1dd20a){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x1557fc,_0x95c8('0xa'));logger[_0x95c8('0xb')](_0x95c8('0xc'),_0x1557fc,'request\x20sent',JSON[_0x95c8('0xd')](_0x1dd20a));if(_0x1dd20a[_0x95c8('0xe')]){if(_0x1dd20a['error'][_0x95c8('0xf')]===0x1f4){logger[_0x95c8('0xe')](_0x95c8('0x10'),_0x1557fc,_0x1dd20a[_0x95c8('0xe')][_0x95c8('0x11')]);return _0x506273(_0x1dd20a[_0x95c8('0xe')][_0x95c8('0x11')]);}logger[_0x95c8('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x1557fc,_0x1dd20a[_0x95c8('0xe')]['message']);return _0x47d3dc(_0x1dd20a[_0x95c8('0xe')]['message']);}else{logger['info'](_0x95c8('0x10'),_0x1557fc,_0x95c8('0xa'));_0x47d3dc(_0x1dd20a[_0x95c8('0x12')][_0x95c8('0x11')]);}})[_0x95c8('0x13')](function(_0x37fc14){logger[_0x95c8('0xe')](_0x95c8('0x10'),_0x1557fc,_0x37fc14);_0x506273(_0x37fc14);});});}exports[_0x95c8('0x14')]=function(_0x35ad85){var _0x1dd73c=this;return new Promise(function(_0xb78cdc,_0x43a027){return db[_0x95c8('0x15')][_0x95c8('0x16')](_0x35ad85['body'],{'raw':_0x35ad85[_0x95c8('0x17')]?_0x35ad85[_0x95c8('0x17')][_0x95c8('0x18')]===undefined?!![]:![]:!![]})[_0x95c8('0x9')](function(_0x307553){logger['info'](_0x95c8('0x14'),_0x35ad85);logger[_0x95c8('0xb')]('CreateChatQueueReport',_0x35ad85,JSON[_0x95c8('0xd')](_0x307553));_0xb78cdc(_0x307553);})[_0x95c8('0x13')](function(_0x1885a4){logger[_0x95c8('0xe')](_0x95c8('0x14'),_0x1885a4[_0x95c8('0x11')],_0x35ad85);_0x43a027(_0x1dd73c[_0x95c8('0xe')](0x1f4,_0x1885a4['message']));});});};exports[_0x95c8('0x19')]=function(_0x4ac84f){var _0x4ab45f=this;return new Promise(function(_0x1c391d,_0x2e720b){return db['ChatQueueReport']['update'](_0x4ac84f[_0x95c8('0x1a')],{'raw':_0x4ac84f[_0x95c8('0x17')]?_0x4ac84f[_0x95c8('0x17')][_0x95c8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ac84f[_0x95c8('0x17')]?_0x4ac84f[_0x95c8('0x17')]['where']||null:null,'attributes':_0x4ac84f['options']?_0x4ac84f[_0x95c8('0x17')]['attributes']||null:null,'limit':_0x4ac84f[_0x95c8('0x17')]?_0x4ac84f['options']['limit']||null:null})[_0x95c8('0x9')](function(_0x229c46){logger[_0x95c8('0x1b')](_0x95c8('0x19'),_0x4ac84f);logger[_0x95c8('0xb')](_0x95c8('0x19'),_0x4ac84f,JSON[_0x95c8('0xd')](_0x229c46));_0x1c391d(_0x229c46);})['catch'](function(_0x3aad32){logger[_0x95c8('0xe')](_0x95c8('0x19'),_0x3aad32[_0x95c8('0x11')],_0x4ac84f);_0x2e720b(_0x4ab45f[_0x95c8('0xe')](0x1f4,_0x3aad32[_0x95c8('0x11')]));});});}; \ No newline at end of file +var _0x82db=['request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','UpdateChatQueueReport','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0x82db,0x128));var _0xb82d=function(_0x4d17e9,_0x37b067){_0x4d17e9=_0x4d17e9-0x0;var _0x81868=_0x82db[_0x4d17e9];return _0x81868;};'use strict';var _=require(_0xb82d('0x0'));var util=require(_0xb82d('0x1'));var moment=require(_0xb82d('0x2'));var BPromise=require(_0xb82d('0x3'));var rs=require(_0xb82d('0x4'));var fs=require('fs');var Redis=require(_0xb82d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb82d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb82d('0x7'));var jayson=require(_0xb82d('0x8'));var client=jayson[_0xb82d('0x9')][_0xb82d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16a1a8,_0x439691,_0x6d6300){return new BPromise(function(_0x51d479,_0x2e7613){return client[_0xb82d('0xb')](_0x16a1a8,_0x6d6300)[_0xb82d('0xc')](function(_0x125fff){logger['info'](_0xb82d('0xd'),_0x439691,_0xb82d('0xe'));logger[_0xb82d('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x439691,_0xb82d('0xe'),JSON[_0xb82d('0x10')](_0x125fff));if(_0x125fff[_0xb82d('0x11')]){if(_0x125fff[_0xb82d('0x11')][_0xb82d('0x12')]===0x1f4){logger[_0xb82d('0x11')](_0xb82d('0xd'),_0x439691,_0x125fff[_0xb82d('0x11')]['message']);return _0x2e7613(_0x125fff[_0xb82d('0x11')][_0xb82d('0x13')]);}logger[_0xb82d('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x439691,_0x125fff[_0xb82d('0x11')]['message']);return _0x51d479(_0x125fff['error'][_0xb82d('0x13')]);}else{logger[_0xb82d('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x439691,_0xb82d('0xe'));_0x51d479(_0x125fff[_0xb82d('0x15')][_0xb82d('0x13')]);}})[_0xb82d('0x16')](function(_0x3336d6){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x439691,_0x3336d6);_0x2e7613(_0x3336d6);});});}exports[_0xb82d('0x17')]=function(_0xbb3dae){var _0x5c57fa=this;return new Promise(function(_0x3b423e,_0x11fb94){return db[_0xb82d('0x18')]['create'](_0xbb3dae[_0xb82d('0x19')],{'raw':_0xbb3dae[_0xb82d('0x1a')]?_0xbb3dae[_0xb82d('0x1a')][_0xb82d('0x1b')]===undefined?!![]:![]:!![]})[_0xb82d('0xc')](function(_0x1578f8){logger[_0xb82d('0x14')](_0xb82d('0x17'),_0xbb3dae);logger[_0xb82d('0xf')](_0xb82d('0x17'),_0xbb3dae,JSON[_0xb82d('0x10')](_0x1578f8));_0x3b423e(_0x1578f8);})[_0xb82d('0x16')](function(_0x35b81c){logger[_0xb82d('0x11')](_0xb82d('0x17'),_0x35b81c[_0xb82d('0x13')],_0xbb3dae);_0x11fb94(_0x5c57fa[_0xb82d('0x11')](0x1f4,_0x35b81c[_0xb82d('0x13')]));});});};exports[_0xb82d('0x1c')]=function(_0x2b3130){var _0xd1d0a8=this;return new Promise(function(_0x17e041,_0x6b875c){return db[_0xb82d('0x18')]['update'](_0x2b3130[_0xb82d('0x19')],{'raw':_0x2b3130[_0xb82d('0x1a')]?_0x2b3130[_0xb82d('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b3130[_0xb82d('0x1a')]?_0x2b3130[_0xb82d('0x1a')]['where']||null:null,'attributes':_0x2b3130[_0xb82d('0x1a')]?_0x2b3130[_0xb82d('0x1a')][_0xb82d('0x1d')]||null:null,'limit':_0x2b3130[_0xb82d('0x1a')]?_0x2b3130[_0xb82d('0x1a')][_0xb82d('0x1e')]||null:null})[_0xb82d('0xc')](function(_0x43d927){logger['info'](_0xb82d('0x1c'),_0x2b3130);logger[_0xb82d('0xf')]('UpdateChatQueueReport',_0x2b3130,JSON[_0xb82d('0x10')](_0x43d927));_0x17e041(_0x43d927);})[_0xb82d('0x16')](function(_0x124510){logger[_0xb82d('0x11')](_0xb82d('0x1c'),_0x124510[_0xb82d('0x13')],_0x2b3130);_0x6b875c(_0xd1d0a8[_0xb82d('0x11')](0x1f4,_0x124510['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 4e17d9f..39689ce 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 _0xbe53=['Router','fs-extra','../../components/interaction/service','isAuthenticated','get','/describe','show','post','/:id','update','delete','destroy','multer','util','path','express'];(function(_0x264b9c,_0x35969e){var _0x5401ca=function(_0x2d3ea3){while(--_0x2d3ea3){_0x264b9c['push'](_0x264b9c['shift']());}};_0x5401ca(++_0x35969e);}(_0xbe53,0xbc));var _0x3be5=function(_0x594662,_0x147cac){_0x594662=_0x594662-0x0;var _0x2d23c7=_0xbe53[_0x594662];return _0x2d23c7;};'use strict';var multer=require(_0x3be5('0x0'));var util=require(_0x3be5('0x1'));var path=require(_0x3be5('0x2'));var timeout=require('connect-timeout');var express=require(_0x3be5('0x3'));var router=express[_0x3be5('0x4')]();var fs_extra=require(_0x3be5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3be5('0x6'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x3be5('0x7')](),controller['index']);router[_0x3be5('0x8')](_0x3be5('0x9'),auth[_0x3be5('0x7')](),controller['describe']);router[_0x3be5('0x8')]('/:id',auth[_0x3be5('0x7')](),controller[_0x3be5('0xa')]);router[_0x3be5('0xb')]('/',auth[_0x3be5('0x7')](),controller['create']);router['put'](_0x3be5('0xc'),auth[_0x3be5('0x7')](),controller[_0x3be5('0xd')]);router[_0x3be5('0xe')](_0x3be5('0xc'),auth[_0x3be5('0x7')](),controller[_0x3be5('0xf')]);module['exports']=router; \ No newline at end of file +var _0x233b=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x208482,_0x2fcfe8){var _0x3c3c57=function(_0x144569){while(--_0x144569){_0x208482['push'](_0x208482['shift']());}};_0x3c3c57(++_0x2fcfe8);}(_0x233b,0x1d4));var _0xb233=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x233b[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0xb233('0x0'));var util=require(_0xb233('0x1'));var path=require(_0xb233('0x2'));var timeout=require(_0xb233('0x3'));var express=require(_0xb233('0x4'));var router=express['Router']();var fs_extra=require(_0xb233('0x5'));var auth=require(_0xb233('0x6'));var interaction=require(_0xb233('0x7'));var config=require(_0xb233('0x8'));var controller=require(_0xb233('0x9'));router[_0xb233('0xa')]('/',auth[_0xb233('0xb')](),controller[_0xb233('0xc')]);router['get'](_0xb233('0xd'),auth[_0xb233('0xb')](),controller[_0xb233('0xe')]);router[_0xb233('0xa')](_0xb233('0xf'),auth[_0xb233('0xb')](),controller[_0xb233('0x10')]);router[_0xb233('0x11')]('/',auth[_0xb233('0xb')](),controller['create']);router[_0xb233('0x12')]('/:id',auth[_0xb233('0xb')](),controller['update']);router['delete'](_0xb233('0xf'),auth[_0xb233('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index c2d9f5c..dfdc35d 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0xb0abe9,_0x5e1de6){var _0x91c086=function(_0x101f0b){while(--_0x101f0b){_0xb0abe9['push'](_0xb0abe9['shift']());}};_0x91c086(++_0x5e1de6);}(_0x00bb,0x1d8));var _0xb00b=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x00bb[_0x110c3d];return _0x226d67;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x37ef22,_0x348c92){var _0x49eeb3=function(_0x1ef837){while(--_0x1ef837){_0x37ef22['push'](_0x37ef22['shift']());}};_0x49eeb3(++_0x348c92);}(_0x54ef,0x112));var _0xf54e=function(_0xf6b0ab,_0x21c7d6){_0xf6b0ab=_0xf6b0ab-0x0;var _0x161a35=_0x54ef[_0xf6b0ab];return _0x161a35;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 7bfdc06..6744b5d 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 _0xe23b=['name','send','index','ChatTransferReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','catch','show','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','end','stack'];(function(_0x1d6304,_0x36e3c9){var _0x283901=function(_0x3d0e4f){while(--_0x3d0e4f){_0x1d6304['push'](_0x1d6304['shift']());}};_0x283901(++_0x36e3c9);}(_0xe23b,0x1e4));var _0xbe23=function(_0x2c2d37,_0x59a1cf){_0x2c2d37=_0x2c2d37-0x0;var _0x2c8672=_0xe23b[_0x2c2d37];return _0x2c8672;};'use strict';var emlformat=require(_0xbe23('0x0'));var rimraf=require(_0xbe23('0x1'));var zipdir=require(_0xbe23('0x2'));var jsonpatch=require(_0xbe23('0x3'));var rp=require(_0xbe23('0x4'));var moment=require(_0xbe23('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbe23('0x6'));var sox=require(_0xbe23('0x7'));var csv=require(_0xbe23('0x8'));var ejs=require(_0xbe23('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbe23('0xa'));var squel=require(_0xbe23('0xb'));var crypto=require(_0xbe23('0xc'));var jsforce=require(_0xbe23('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe23('0xe'));var Papa=require(_0xbe23('0xf'));var Redis=require('ioredis');var authService=require(_0xbe23('0x10'));var qs=require(_0xbe23('0x11'));var as=require(_0xbe23('0x12'));var hardwareService=require(_0xbe23('0x13'));var logger=require(_0xbe23('0x14'))('api');var utils=require(_0xbe23('0x15'));var config=require(_0xbe23('0x16'));var licenseUtil=require(_0xbe23('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2657fd,_0x1b62e2){_0x1b62e2=_0x1b62e2||0xcc;return function(_0x22ee29){if(_0x22ee29){return _0x2657fd[_0xbe23('0x18')](_0x1b62e2);}return _0x2657fd['status'](_0x1b62e2)['end']();};}function respondWithResult(_0x239845,_0x373fb8){_0x373fb8=_0x373fb8||0xc8;return function(_0x15560c){if(_0x15560c){return _0x239845['status'](_0x373fb8)[_0xbe23('0x19')](_0x15560c);}};}function respondWithFilteredResult(_0x104eca,_0x16bb1a){return function(_0x596d71){if(_0x596d71){var _0x587e7a=typeof _0x16bb1a[_0xbe23('0x1a')]===_0xbe23('0x1b')&&typeof _0x16bb1a[_0xbe23('0x1c')]==='undefined';var _0x9c4d0a=_0x596d71[_0xbe23('0x1d')];var _0x1ef8bc=_0x587e7a?0x0:_0x16bb1a[_0xbe23('0x1a')];var _0x1b14d6=_0x587e7a?_0x596d71[_0xbe23('0x1d')]:_0x16bb1a[_0xbe23('0x1a')]+_0x16bb1a[_0xbe23('0x1c')];var _0x1ae129;if(_0x1b14d6>=_0x9c4d0a){_0x1b14d6=_0x9c4d0a;_0x1ae129=0xc8;}else{_0x1ae129=0xce;}_0x104eca[_0xbe23('0x1e')](_0x1ae129);return _0x104eca[_0xbe23('0x1f')](_0xbe23('0x20'),_0x1ef8bc+'-'+_0x1b14d6+'/'+_0x9c4d0a)[_0xbe23('0x19')](_0x596d71);}return null;};}function patchUpdates(_0x400446){return function(_0x23713f){try{jsonpatch[_0xbe23('0x21')](_0x23713f,_0x400446,!![]);}catch(_0x5575af){return BPromise[_0xbe23('0x22')](_0x5575af);}return _0x23713f[_0xbe23('0x23')]();};}function saveUpdates(_0x94e85b,_0x2c027f){return function(_0x240790){if(_0x240790){return _0x240790[_0xbe23('0x24')](_0x94e85b)['then'](function(_0x2b30a2){return _0x2b30a2;});}return null;};}function removeEntity(_0x229259,_0x4044a5){return function(_0x3e0bae){if(_0x3e0bae){return _0x3e0bae[_0xbe23('0x25')]()[_0xbe23('0x26')](function(){_0x229259[_0xbe23('0x1e')](0xcc)[_0xbe23('0x27')]();});}};}function handleEntityNotFound(_0x4ff84d,_0x56a3ba){return function(_0x3e7095){if(!_0x3e7095){_0x4ff84d[_0xbe23('0x18')](0x194);}return _0x3e7095;};}function handleError(_0x5b7c44,_0x1ff95a){_0x1ff95a=_0x1ff95a||0x1f4;return function(_0x2ca43a){logger['error'](_0x2ca43a[_0xbe23('0x28')]);if(_0x2ca43a[_0xbe23('0x29')]){delete _0x2ca43a[_0xbe23('0x29')];}_0x5b7c44[_0xbe23('0x1e')](_0x1ff95a)[_0xbe23('0x2a')](_0x2ca43a);};}exports[_0xbe23('0x2b')]=function(_0x4e33f9,_0x167ece){var _0x1005ed={},_0x22f546={},_0x3751e9={'count':0x0,'rows':[]};var _0x1f3148=_['map'](db[_0xbe23('0x2c')][_0xbe23('0x2d')],function(_0x496c54){return{'name':_0x496c54[_0xbe23('0x2e')],'type':_0x496c54['type'][_0xbe23('0x2f')]};});_0x22f546[_0xbe23('0x30')]=_[_0xbe23('0x31')](_0x1f3148,_0xbe23('0x29'));_0x22f546[_0xbe23('0x32')]=_[_0xbe23('0x33')](_0x4e33f9[_0xbe23('0x32')]);_0x22f546[_0xbe23('0x34')]=_[_0xbe23('0x35')](_0x22f546[_0xbe23('0x30')],_0x22f546[_0xbe23('0x32')]);_0x1005ed['attributes']=_[_0xbe23('0x35')](_0x22f546[_0xbe23('0x30')],qs[_0xbe23('0x36')](_0x4e33f9[_0xbe23('0x32')][_0xbe23('0x36')]));_0x1005ed[_0xbe23('0x37')]=_0x1005ed[_0xbe23('0x37')][_0xbe23('0x38')]?_0x1005ed[_0xbe23('0x37')]:_0x22f546[_0xbe23('0x30')];if(!_0x4e33f9[_0xbe23('0x32')][_0xbe23('0x39')](_0xbe23('0x3a'))){_0x1005ed[_0xbe23('0x1c')]=qs['limit'](_0x4e33f9[_0xbe23('0x32')]['limit']);_0x1005ed[_0xbe23('0x1a')]=qs[_0xbe23('0x1a')](_0x4e33f9[_0xbe23('0x32')][_0xbe23('0x1a')]);}_0x1005ed[_0xbe23('0x3b')]=qs['sort'](_0x4e33f9[_0xbe23('0x32')][_0xbe23('0x3c')]);_0x1005ed[_0xbe23('0x3d')]=qs[_0xbe23('0x34')](_[_0xbe23('0x3e')](_0x4e33f9[_0xbe23('0x32')],_0x22f546[_0xbe23('0x34')]),_0x1f3148);if(_0x4e33f9[_0xbe23('0x32')][_0xbe23('0x3f')]){_0x1005ed[_0xbe23('0x3d')]=_[_0xbe23('0x40')](_0x1005ed['where'],{'$or':_['map'](_0x1f3148,function(_0x29cc17){if(_0x29cc17['type']!==_0xbe23('0x41')){var _0x59c75e={};_0x59c75e[_0x29cc17[_0xbe23('0x29')]]={'$like':'%'+_0x4e33f9[_0xbe23('0x32')][_0xbe23('0x3f')]+'%'};return _0x59c75e;}})});}_0x1005ed=_[_0xbe23('0x40')]({},_0x1005ed,_0x4e33f9[_0xbe23('0x42')]);var _0x2ed554={'where':_0x1005ed[_0xbe23('0x3d')]};return db[_0xbe23('0x2c')][_0xbe23('0x1d')](_0x2ed554)[_0xbe23('0x26')](function(_0x120af8){_0x3751e9[_0xbe23('0x1d')]=_0x120af8;if(_0x4e33f9['query']['includeAll']){_0x1005ed['include']=[{'all':!![]}];}return db[_0xbe23('0x2c')]['findAll'](_0x1005ed);})[_0xbe23('0x26')](function(_0x4cbba7){_0x3751e9['rows']=_0x4cbba7;return _0x3751e9;})[_0xbe23('0x26')](respondWithFilteredResult(_0x167ece,_0x1005ed))[_0xbe23('0x43')](handleError(_0x167ece,null));};exports[_0xbe23('0x44')]=function(_0x50be7d,_0x4faecd){var _0x323305={'raw':!![],'where':{'id':_0x50be7d['params']['id']}},_0x30c2aa={};_0x30c2aa[_0xbe23('0x30')]=_[_0xbe23('0x33')](db['ChatTransferReport'][_0xbe23('0x2d')]);_0x30c2aa[_0xbe23('0x32')]=_[_0xbe23('0x33')](_0x50be7d[_0xbe23('0x32')]);_0x30c2aa['filters']=_['intersection'](_0x30c2aa[_0xbe23('0x30')],_0x30c2aa['query']);_0x323305[_0xbe23('0x37')]=_[_0xbe23('0x35')](_0x30c2aa[_0xbe23('0x30')],qs['fields'](_0x50be7d['query'][_0xbe23('0x36')]));_0x323305[_0xbe23('0x37')]=_0x323305[_0xbe23('0x37')][_0xbe23('0x38')]?_0x323305[_0xbe23('0x37')]:_0x30c2aa['model'];if(_0x50be7d[_0xbe23('0x32')][_0xbe23('0x45')]){_0x323305['include']=[{'all':!![]}];}_0x323305=_[_0xbe23('0x40')]({},_0x323305,_0x50be7d[_0xbe23('0x42')]);return db[_0xbe23('0x2c')][_0xbe23('0x46')](_0x323305)[_0xbe23('0x26')](handleEntityNotFound(_0x4faecd,null))['then'](respondWithResult(_0x4faecd,null))['catch'](handleError(_0x4faecd,null));};exports['create']=function(_0x13115a,_0x10f9ff){return db[_0xbe23('0x2c')][_0xbe23('0x47')](_0x13115a[_0xbe23('0x48')],{})[_0xbe23('0x26')](respondWithResult(_0x10f9ff,0xc9))[_0xbe23('0x43')](handleError(_0x10f9ff,null));};exports['update']=function(_0x53795f,_0x502ee4){if(_0x53795f[_0xbe23('0x48')]['id']){delete _0x53795f[_0xbe23('0x48')]['id'];}return db[_0xbe23('0x2c')]['find']({'where':{'id':_0x53795f[_0xbe23('0x49')]['id']}})[_0xbe23('0x26')](handleEntityNotFound(_0x502ee4,null))[_0xbe23('0x26')](saveUpdates(_0x53795f[_0xbe23('0x48')],null))['then'](respondWithResult(_0x502ee4,null))[_0xbe23('0x43')](handleError(_0x502ee4,null));};exports[_0xbe23('0x25')]=function(_0x495ca6,_0x41e5f8){return db[_0xbe23('0x2c')]['find']({'where':{'id':_0x495ca6[_0xbe23('0x49')]['id']}})['then'](handleEntityNotFound(_0x41e5f8,null))['then'](removeEntity(_0x41e5f8,null))['catch'](handleError(_0x41e5f8,null));};exports[_0xbe23('0x4a')]=function(_0x46d9e4,_0x456ae6){return db['ChatTransferReport'][_0xbe23('0x4a')]()[_0xbe23('0x26')](respondWithResult(_0x456ae6,null))['catch'](handleError(_0x456ae6,null));}; \ No newline at end of file +var _0xc43c=['include','findAll','catch','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','Content-Range','reject','save','update','then','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','pick','filter','where','merge','options','includeAll'];(function(_0x502cf8,_0x25a45e){var _0x31ed77=function(_0x4c7a13){while(--_0x4c7a13){_0x502cf8['push'](_0x502cf8['shift']());}};_0x31ed77(++_0x25a45e);}(_0xc43c,0x1ec));var _0xcc43=function(_0x5b87e1,_0xc73505){_0x5b87e1=_0x5b87e1-0x0;var _0x11f6c8=_0xc43c[_0x5b87e1];return _0x11f6c8;};'use strict';var emlformat=require(_0xcc43('0x0'));var rimraf=require(_0xcc43('0x1'));var zipdir=require(_0xcc43('0x2'));var jsonpatch=require(_0xcc43('0x3'));var rp=require(_0xcc43('0x4'));var moment=require('moment');var BPromise=require(_0xcc43('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcc43('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc43('0x7'));var _=require(_0xcc43('0x8'));var squel=require(_0xcc43('0x9'));var crypto=require(_0xcc43('0xa'));var jsforce=require(_0xcc43('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcc43('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcc43('0xc'));var authService=require(_0xcc43('0xd'));var qs=require(_0xcc43('0xe'));var as=require(_0xcc43('0xf'));var hardwareService=require(_0xcc43('0x10'));var logger=require('../../config/logger')(_0xcc43('0x11'));var utils=require(_0xcc43('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xcc43('0x13'));var db=require(_0xcc43('0x14'))['db'];function respondWithStatusCode(_0x475567,_0x21387e){_0x21387e=_0x21387e||0xcc;return function(_0x225d12){if(_0x225d12){return _0x475567[_0xcc43('0x15')](_0x21387e);}return _0x475567['status'](_0x21387e)[_0xcc43('0x16')]();};}function respondWithResult(_0xf0514e,_0x513235){_0x513235=_0x513235||0xc8;return function(_0x10f90f){if(_0x10f90f){return _0xf0514e['status'](_0x513235)[_0xcc43('0x17')](_0x10f90f);}};}function respondWithFilteredResult(_0x40eb52,_0xd06de3){return function(_0x55058c){if(_0x55058c){var _0x401f48=typeof _0xd06de3[_0xcc43('0x18')]===_0xcc43('0x19')&&typeof _0xd06de3['limit']==='undefined';var _0x1102d9=_0x55058c[_0xcc43('0x1a')];var _0x4fbfbb=_0x401f48?0x0:_0xd06de3['offset'];var _0x2cb40c=_0x401f48?_0x55058c[_0xcc43('0x1a')]:_0xd06de3[_0xcc43('0x18')]+_0xd06de3['limit'];var _0x1e5043;if(_0x2cb40c>=_0x1102d9){_0x2cb40c=_0x1102d9;_0x1e5043=0xc8;}else{_0x1e5043=0xce;}_0x40eb52[_0xcc43('0x1b')](_0x1e5043);return _0x40eb52['set'](_0xcc43('0x1c'),_0x4fbfbb+'-'+_0x2cb40c+'/'+_0x1102d9)[_0xcc43('0x17')](_0x55058c);}return null;};}function patchUpdates(_0x2f2e71){return function(_0xf17b52){try{jsonpatch['apply'](_0xf17b52,_0x2f2e71,!![]);}catch(_0x4793f5){return BPromise[_0xcc43('0x1d')](_0x4793f5);}return _0xf17b52[_0xcc43('0x1e')]();};}function saveUpdates(_0x4c1d99,_0x4d724a){return function(_0x461d02){if(_0x461d02){return _0x461d02[_0xcc43('0x1f')](_0x4c1d99)['then'](function(_0x282009){return _0x282009;});}return null;};}function removeEntity(_0x2b761a,_0xcdaab1){return function(_0x5be555){if(_0x5be555){return _0x5be555['destroy']()[_0xcc43('0x20')](function(){_0x2b761a[_0xcc43('0x1b')](0xcc)[_0xcc43('0x16')]();});}};}function handleEntityNotFound(_0x499b24,_0x2cc685){return function(_0x2cc5a2){if(!_0x2cc5a2){_0x499b24[_0xcc43('0x15')](0x194);}return _0x2cc5a2;};}function handleError(_0x28197e,_0x5af371){_0x5af371=_0x5af371||0x1f4;return function(_0x280575){logger[_0xcc43('0x21')](_0x280575['stack']);if(_0x280575[_0xcc43('0x22')]){delete _0x280575[_0xcc43('0x22')];}_0x28197e[_0xcc43('0x1b')](_0x5af371)[_0xcc43('0x23')](_0x280575);};}exports[_0xcc43('0x24')]=function(_0x58946e,_0x58da42){var _0x473edf={},_0x5f2fa0={},_0x1acb4e={'count':0x0,'rows':[]};var _0x38582e=_[_0xcc43('0x25')](db[_0xcc43('0x26')][_0xcc43('0x27')],function(_0x26c9b0){return{'name':_0x26c9b0[_0xcc43('0x28')],'type':_0x26c9b0[_0xcc43('0x29')]['key']};});_0x5f2fa0['model']=_[_0xcc43('0x25')](_0x38582e,_0xcc43('0x22'));_0x5f2fa0[_0xcc43('0x2a')]=_[_0xcc43('0x2b')](_0x58946e[_0xcc43('0x2a')]);_0x5f2fa0[_0xcc43('0x2c')]=_[_0xcc43('0x2d')](_0x5f2fa0[_0xcc43('0x2e')],_0x5f2fa0[_0xcc43('0x2a')]);_0x473edf['attributes']=_[_0xcc43('0x2d')](_0x5f2fa0['model'],qs[_0xcc43('0x2f')](_0x58946e['query'][_0xcc43('0x2f')]));_0x473edf[_0xcc43('0x30')]=_0x473edf[_0xcc43('0x30')][_0xcc43('0x31')]?_0x473edf[_0xcc43('0x30')]:_0x5f2fa0['model'];if(!_0x58946e[_0xcc43('0x2a')][_0xcc43('0x32')](_0xcc43('0x33'))){_0x473edf[_0xcc43('0x34')]=qs[_0xcc43('0x34')](_0x58946e[_0xcc43('0x2a')][_0xcc43('0x34')]);_0x473edf['offset']=qs['offset'](_0x58946e[_0xcc43('0x2a')][_0xcc43('0x18')]);}_0x473edf[_0xcc43('0x35')]=qs['sort'](_0x58946e[_0xcc43('0x2a')]['sort']);_0x473edf['where']=qs[_0xcc43('0x2c')](_[_0xcc43('0x36')](_0x58946e[_0xcc43('0x2a')],_0x5f2fa0[_0xcc43('0x2c')]),_0x38582e);if(_0x58946e[_0xcc43('0x2a')][_0xcc43('0x37')]){_0x473edf[_0xcc43('0x38')]=_['merge'](_0x473edf[_0xcc43('0x38')],{'$or':_[_0xcc43('0x25')](_0x38582e,function(_0x34272d){if(_0x34272d[_0xcc43('0x29')]!=='VIRTUAL'){var _0x2d7690={};_0x2d7690[_0x34272d['name']]={'$like':'%'+_0x58946e[_0xcc43('0x2a')]['filter']+'%'};return _0x2d7690;}})});}_0x473edf=_[_0xcc43('0x39')]({},_0x473edf,_0x58946e[_0xcc43('0x3a')]);var _0x3b1256={'where':_0x473edf[_0xcc43('0x38')]};return db[_0xcc43('0x26')]['count'](_0x3b1256)[_0xcc43('0x20')](function(_0x4408e5){_0x1acb4e[_0xcc43('0x1a')]=_0x4408e5;if(_0x58946e[_0xcc43('0x2a')][_0xcc43('0x3b')]){_0x473edf[_0xcc43('0x3c')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xcc43('0x3d')](_0x473edf);})[_0xcc43('0x20')](function(_0x5a6a84){_0x1acb4e['rows']=_0x5a6a84;return _0x1acb4e;})[_0xcc43('0x20')](respondWithFilteredResult(_0x58da42,_0x473edf))[_0xcc43('0x3e')](handleError(_0x58da42,null));};exports['show']=function(_0x490576,_0x4d0bb9){var _0x1ece91={'raw':!![],'where':{'id':_0x490576[_0xcc43('0x3f')]['id']}},_0x2a2c64={};_0x2a2c64[_0xcc43('0x2e')]=_[_0xcc43('0x2b')](db[_0xcc43('0x26')][_0xcc43('0x27')]);_0x2a2c64[_0xcc43('0x2a')]=_[_0xcc43('0x2b')](_0x490576[_0xcc43('0x2a')]);_0x2a2c64['filters']=_['intersection'](_0x2a2c64[_0xcc43('0x2e')],_0x2a2c64['query']);_0x1ece91['attributes']=_[_0xcc43('0x2d')](_0x2a2c64[_0xcc43('0x2e')],qs['fields'](_0x490576['query']['fields']));_0x1ece91[_0xcc43('0x30')]=_0x1ece91[_0xcc43('0x30')][_0xcc43('0x31')]?_0x1ece91['attributes']:_0x2a2c64['model'];if(_0x490576[_0xcc43('0x2a')][_0xcc43('0x3b')]){_0x1ece91[_0xcc43('0x3c')]=[{'all':!![]}];}_0x1ece91=_[_0xcc43('0x39')]({},_0x1ece91,_0x490576[_0xcc43('0x3a')]);return db[_0xcc43('0x26')][_0xcc43('0x40')](_0x1ece91)[_0xcc43('0x20')](handleEntityNotFound(_0x4d0bb9,null))[_0xcc43('0x20')](respondWithResult(_0x4d0bb9,null))[_0xcc43('0x3e')](handleError(_0x4d0bb9,null));};exports[_0xcc43('0x41')]=function(_0x23f260,_0x15fafa){return db[_0xcc43('0x26')][_0xcc43('0x41')](_0x23f260[_0xcc43('0x42')],{})[_0xcc43('0x20')](respondWithResult(_0x15fafa,0xc9))['catch'](handleError(_0x15fafa,null));};exports['update']=function(_0x37e680,_0x269420){if(_0x37e680[_0xcc43('0x42')]['id']){delete _0x37e680[_0xcc43('0x42')]['id'];}return db[_0xcc43('0x26')][_0xcc43('0x40')]({'where':{'id':_0x37e680[_0xcc43('0x3f')]['id']}})[_0xcc43('0x20')](handleEntityNotFound(_0x269420,null))[_0xcc43('0x20')](saveUpdates(_0x37e680[_0xcc43('0x42')],null))[_0xcc43('0x20')](respondWithResult(_0x269420,null))[_0xcc43('0x3e')](handleError(_0x269420,null));};exports[_0xcc43('0x43')]=function(_0xbc57bd,_0x1d14a2){return db[_0xcc43('0x26')][_0xcc43('0x40')]({'where':{'id':_0xbc57bd[_0xcc43('0x3f')]['id']}})[_0xcc43('0x20')](handleEntityNotFound(_0x1d14a2,null))[_0xcc43('0x20')](removeEntity(_0x1d14a2,null))[_0xcc43('0x3e')](handleError(_0x1d14a2,null));};exports[_0xcc43('0x44')]=function(_0x1d77fe,_0x2830a8){return db[_0xcc43('0x26')][_0xcc43('0x44')]()[_0xcc43('0x20')](respondWithResult(_0x2830a8,null))[_0xcc43('0x3e')](handleError(_0x2830a8,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index bc59d15..8d04880 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 _0x65c8=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid'];(function(_0x448362,_0x547b73){var _0x442d49=function(_0x520a9a){while(--_0x520a9a){_0x448362['push'](_0x448362['shift']());}};_0x442d49(++_0x547b73);}(_0x65c8,0xfc));var _0x865c=function(_0x33380f,_0x50aade){_0x33380f=_0x33380f-0x0;var _0xc83c57=_0x65c8[_0x33380f];return _0xc83c57;};'use strict';var _=require(_0x865c('0x0'));var util=require('util');var logger=require(_0x865c('0x1'))(_0x865c('0x2'));var moment=require(_0x865c('0x3'));var BPromise=require(_0x865c('0x4'));var rp=require(_0x865c('0x5'));var fs=require('fs');var path=require(_0x865c('0x6'));var rimraf=require(_0x865c('0x7'));var config=require(_0x865c('0x8'));var attributes=require(_0x865c('0x9'));module[_0x865c('0xa')]=function(_0x40d82d,_0xc39183){return _0x40d82d[_0x865c('0xb')]('ChatTransferReport',attributes,{'tableName':_0x865c('0xc'),'paranoid':![],'indexes':[{'name':_0x865c('0xd'),'fields':[_0x865c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x23a6=['util','../../config/logger','api','moment','bluebird','request-promise','path','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x52322e,_0x17850b){var _0x57d318=function(_0x5b0225){while(--_0x5b0225){_0x52322e['push'](_0x52322e['shift']());}};_0x57d318(++_0x17850b);}(_0x23a6,0x1e0));var _0x623a=function(_0x41e38e,_0x395960){_0x41e38e=_0x41e38e-0x0;var _0x67992c=_0x23a6[_0x41e38e];return _0x67992c;};'use strict';var _=require(_0x623a('0x0'));var util=require(_0x623a('0x1'));var logger=require(_0x623a('0x2'))(_0x623a('0x3'));var moment=require(_0x623a('0x4'));var BPromise=require(_0x623a('0x5'));var rp=require(_0x623a('0x6'));var fs=require('fs');var path=require(_0x623a('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x623a('0x8'));module[_0x623a('0x9')]=function(_0x143010,_0x503d34){return _0x143010['define'](_0x623a('0xa'),attributes,{'tableName':_0x623a('0xb'),'paranoid':![],'indexes':[{'name':_0x623a('0xc'),'fields':[_0x623a('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 885cb54..ecac18b 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 _0xcefe=['request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x39979b,_0x2111f9){var _0x560b41=function(_0x859cc0){while(--_0x859cc0){_0x39979b['push'](_0x39979b['shift']());}};_0x560b41(++_0x2111f9);}(_0xcefe,0x1ad));var _0xecef=function(_0x312746,_0x160dc6){_0x312746=_0x312746-0x0;var _0x10a291=_0xcefe[_0x312746];return _0x10a291;};'use strict';var _=require(_0xecef('0x0'));var util=require(_0xecef('0x1'));var moment=require(_0xecef('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecef('0x3'));var db=require(_0xecef('0x4'))['db'];var utils=require(_0xecef('0x5'));var logger=require(_0xecef('0x6'))(_0xecef('0x7'));var config=require('../../config/environment');var jayson=require(_0xecef('0x8'));var client=jayson[_0xecef('0x9')][_0xecef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58c24f,_0x18585f,_0x360a45){return new BPromise(function(_0x252955,_0xe86efb){return client[_0xecef('0xb')](_0x58c24f,_0x360a45)[_0xecef('0xc')](function(_0x1a1d24){logger[_0xecef('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x18585f,_0xecef('0xe'));logger['debug'](_0xecef('0xf'),_0x18585f,_0xecef('0xe'),JSON['stringify'](_0x1a1d24));if(_0x1a1d24[_0xecef('0x10')]){if(_0x1a1d24[_0xecef('0x10')][_0xecef('0x11')]===0x1f4){logger[_0xecef('0x10')](_0xecef('0x12'),_0x18585f,_0x1a1d24[_0xecef('0x10')]['message']);return _0xe86efb(_0x1a1d24[_0xecef('0x10')][_0xecef('0x13')]);}logger[_0xecef('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x18585f,_0x1a1d24[_0xecef('0x10')]['message']);return _0x252955(_0x1a1d24['error']['message']);}else{logger[_0xecef('0xd')](_0xecef('0x12'),_0x18585f,_0xecef('0xe'));_0x252955(_0x1a1d24[_0xecef('0x14')][_0xecef('0x13')]);}})[_0xecef('0x15')](function(_0x27790f){logger['error'](_0xecef('0x12'),_0x18585f,_0x27790f);_0xe86efb(_0x27790f);});});} \ No newline at end of file +var _0x017e=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x332942,_0x3b697d){var _0x43fa70=function(_0x4595a7){while(--_0x4595a7){_0x332942['push'](_0x332942['shift']());}};_0x43fa70(++_0x3b697d);}(_0x017e,0x19d));var _0xe017=function(_0x21c09f,_0x6ce866){_0x21c09f=_0x21c09f-0x0;var _0x164d58=_0x017e[_0x21c09f];return _0x164d58;};'use strict';var _=require(_0xe017('0x0'));var util=require(_0xe017('0x1'));var moment=require(_0xe017('0x2'));var BPromise=require(_0xe017('0x3'));var rs=require(_0xe017('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe017('0x5'))['db'];var utils=require(_0xe017('0x6'));var logger=require(_0xe017('0x7'))(_0xe017('0x8'));var config=require('../../config/environment');var jayson=require(_0xe017('0x9'));var client=jayson[_0xe017('0xa')][_0xe017('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d8f5e,_0x1b3215,_0x8923a6){return new BPromise(function(_0x2ee1ac,_0x366a0c){return client[_0xe017('0xc')](_0x4d8f5e,_0x8923a6)['then'](function(_0x2a679c){logger['info'](_0xe017('0xd'),_0x1b3215,_0xe017('0xe'));logger[_0xe017('0xf')](_0xe017('0x10'),_0x1b3215,_0xe017('0xe'),JSON['stringify'](_0x2a679c));if(_0x2a679c[_0xe017('0x11')]){if(_0x2a679c[_0xe017('0x11')][_0xe017('0x12')]===0x1f4){logger[_0xe017('0x11')](_0xe017('0xd'),_0x1b3215,_0x2a679c[_0xe017('0x11')][_0xe017('0x13')]);return _0x366a0c(_0x2a679c['error'][_0xe017('0x13')]);}logger[_0xe017('0x11')](_0xe017('0xd'),_0x1b3215,_0x2a679c[_0xe017('0x11')]['message']);return _0x2ee1ac(_0x2a679c[_0xe017('0x11')][_0xe017('0x13')]);}else{logger[_0xe017('0x14')](_0xe017('0xd'),_0x1b3215,_0xe017('0xe'));_0x2ee1ac(_0x2a679c[_0xe017('0x15')][_0xe017('0x13')]);}})[_0xe017('0x16')](function(_0x20b75b){logger[_0xe017('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x1b3215,_0x20b75b);_0x366a0c(_0x20b75b);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 6db76c9..1e2477d 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 _0x262f=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index','get','describe','post','create','put','/:id','update','delete','destroy','exports','util'];(function(_0x5c1f9b,_0x321904){var _0x587d4f=function(_0x41bcd5){while(--_0x41bcd5){_0x5c1f9b['push'](_0x5c1f9b['shift']());}};_0x587d4f(++_0x321904);}(_0x262f,0x18f));var _0xf262=function(_0x1406f1,_0x321945){_0x1406f1=_0x1406f1-0x0;var _0x5c8e87=_0x262f[_0x1406f1];return _0x5c8e87;};'use strict';var multer=require('multer');var util=require(_0xf262('0x0'));var path=require(_0xf262('0x1'));var timeout=require(_0xf262('0x2'));var express=require(_0xf262('0x3'));var router=express[_0xf262('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf262('0x5'));var interaction=require(_0xf262('0x6'));var config=require('../../config/environment');var controller=require(_0xf262('0x7'));router['get']('/',auth[_0xf262('0x8')](),controller[_0xf262('0x9')]);router[_0xf262('0xa')]('/describe',auth[_0xf262('0x8')](),controller[_0xf262('0xb')]);router['get']('/:id',auth[_0xf262('0x8')](),controller['show']);router[_0xf262('0xc')]('/',auth['isAuthenticated'](),controller[_0xf262('0xd')]);router[_0xf262('0xe')](_0xf262('0xf'),auth[_0xf262('0x8')](),controller[_0xf262('0x10')]);router[_0xf262('0x11')](_0xf262('0xf'),auth[_0xf262('0x8')](),controller[_0xf262('0x12')]);module[_0xf262('0x13')]=router; \ No newline at end of file +var _0x6b76=['isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x671369,_0x433da5){var _0x33f2b4=function(_0x2e9db2){while(--_0x2e9db2){_0x671369['push'](_0x671369['shift']());}};_0x33f2b4(++_0x433da5);}(_0x6b76,0x1a1));var _0x66b7=function(_0x326bcd,_0x25cce0){_0x326bcd=_0x326bcd-0x0;var _0x45b9c8=_0x6b76[_0x326bcd];return _0x45b9c8;};'use strict';var multer=require(_0x66b7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x66b7('0x1')]();var fs_extra=require(_0x66b7('0x2'));var auth=require(_0x66b7('0x3'));var interaction=require(_0x66b7('0x4'));var config=require(_0x66b7('0x5'));var controller=require(_0x66b7('0x6'));router[_0x66b7('0x7')]('/',auth[_0x66b7('0x8')](),controller[_0x66b7('0x9')]);router[_0x66b7('0x7')]('/describe',auth[_0x66b7('0x8')](),controller['describe']);router[_0x66b7('0x7')](_0x66b7('0xa'),auth[_0x66b7('0x8')](),controller[_0x66b7('0xb')]);router[_0x66b7('0xc')]('/',auth['isAuthenticated'](),controller[_0x66b7('0xd')]);router[_0x66b7('0xe')](_0x66b7('0xa'),auth[_0x66b7('0x8')](),controller[_0x66b7('0xf')]);router['delete']('/:id',auth[_0x66b7('0x8')](),controller['destroy']);module[_0x66b7('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index cbbf731..17fa91c 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 _0x82c4=['You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Send','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','TEXT','stringify','input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'];(function(_0x52c7f4,_0x2b3ad5){var _0x513d5b=function(_0x39bb23){while(--_0x39bb23){_0x52c7f4['push'](_0x52c7f4['shift']());}};_0x513d5b(++_0x2b3ad5);}(_0x82c4,0x180));var _0x482c=function(_0x13cbfb,_0x5b397d){_0x13cbfb=_0x13cbfb-0x0;var _0x2b4439=_0x82c4[_0x13cbfb];return _0x2b4439;};'use strict';var Sequelize=require(_0x482c('0x0'));var rs=require(_0x482c('0x1'));module[_0x482c('0x2')]={'name':{'type':Sequelize[_0x482c('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x482c('0x3')],'allowNull':![],'unique':_0x482c('0x4')},'description':{'type':Sequelize[_0x482c('0x3')]},'mapKey':{'type':Sequelize[_0x482c('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x6')},'customerAlias':{'type':Sequelize[_0x482c('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x482c('0x3')],'allowNull':![],'defaultValue':_0x482c('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x482c('0x3')],'allowNull':![],'defaultValue':_0x482c('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x482c('0x3')],'allowNull':![],'defaultValue':_0x482c('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x482c('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x482c('0x3')]},'animation':{'type':Sequelize[_0x482c('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x482c('0xb')](_0x482c('0xc'),_0x482c('0xd')),'defaultValue':_0x482c('0xc')},'header_online':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0xe')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x482c('0xf')},'offline_chat_button':{'type':Sequelize[_0x482c('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x10')},'download_transcript':{'type':Sequelize[_0x482c('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x482c('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x482c('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x482c('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x482c('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x482c('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x482c('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x482c('0x13')},'closingMessage':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x14')},'closingMessageButton':{'type':Sequelize[_0x482c('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x482c('0x15')},'conditionAgreement':{'type':Sequelize[_0x482c('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x482c('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x482c('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x482c('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0x482c('0x17'),_0x482c('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x482c('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x482c('0x19')],'defaultValue':function(){return JSON[_0x482c('0x1a')]({'items':[{'type':_0x482c('0x1b'),'variable':null,'config':{'placeholder':_0x482c('0x1c'),'type':_0x482c('0x1d'),'required':!![]},'props':{'title':_0x482c('0x1c'),'helpText':''}},{'type':_0x482c('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x482c('0x5'),'type':_0x482c('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x482c('0x1e')](_0x482c('0x1f'))?JSON['parse'](this[_0x482c('0x1e')](_0x482c('0x1f'))):{};},'set':function(_0xb4bd4f){return this[_0x482c('0x20')](_0x482c('0x1f'),JSON[_0x482c('0x1a')](_0xb4bd4f));}},'offlineForm':{'type':Sequelize[_0x482c('0x19')],'defaultValue':function(){return JSON[_0x482c('0x1a')]({'items':[{'type':_0x482c('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x482c('0x5')},'variable':null},{'type':_0x482c('0x21'),'config':{'placeholder':_0x482c('0x22')},'props':{'title':_0x482c('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x482c('0x1e')](_0x482c('0x23'))?JSON[_0x482c('0x24')](this[_0x482c('0x1e')](_0x482c('0x23'))):{};},'set':function(_0x58d3a2){return this[_0x482c('0x20')](_0x482c('0x23'),JSON[_0x482c('0x1a')](_0x58d3a2));}},'token':{'type':Sequelize[_0x482c('0x3')],'defaultValue':function(){return rs[_0x482c('0x25')]();}},'autoclose':{'type':Sequelize[_0x482c('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x482c('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x482c('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x482c('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x482c('0x3')]},'waitingTitle':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x26')},'waitingMessage':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x482c('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x482c('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x29')},'skipUnmanaged':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x15')},'sendUnmanaged':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x2a')},'enableCustomerAttachment':{'type':Sequelize[_0x482c('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x482c('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x482c('0x19')]},'showAgentAvatar':{'type':Sequelize[_0x482c('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x482c('0x3')]},'notificationTemplate':{'type':Sequelize[_0x482c('0x19')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x482c('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x482c('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x482c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x2c')},'verticalAlignment':{'type':Sequelize[_0x482c('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x2d')},'messagesAlignment':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x2e')},'defaultTitle':{'type':Sequelize[_0x482c('0x3')]},'customerAvatar':{'type':Sequelize[_0x482c('0x19')]},'showCustomerAvatar':{'type':Sequelize[_0x482c('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x482c('0x3')],'allowNull':![],'defaultValue':_0x482c('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x482c('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x482c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x482c('0x3')],'defaultValue':_0x482c('0x30')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x482c('0x9')],'comment':_0x482c('0x31')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3de5d5){if(!_0x3de5d5)this[_0x482c('0x20')](_0x482c('0x32'),null);this[_0x482c('0x20')]('mandatoryDisposition',_0x3de5d5);}},'vidaooEscalation':{'type':Sequelize[_0x482c('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x482c('0x3')]},'vidaooTopic':{'type':Sequelize[_0x482c('0x3')],'allowNull':![],'defaultValue':_0x482c('0x33')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x482c('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x482c('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x482c('0x19')]}}; \ No newline at end of file +var _0x3663=['You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','BOOLEAN','Feedback','star','thumb','TEXT','stringify','name','text','input','getDataValue','parse','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x3663,0x1cd));var _0x3366=function(_0x59cd35,_0x5a9053){_0x59cd35=_0x59cd35-0x0;var _0x26e325=_0x3663[_0x59cd35];return _0x26e325;};'use strict';var Sequelize=require(_0x3366('0x0'));var rs=require('randomstring');module[_0x3366('0x1')]={'name':{'type':Sequelize[_0x3366('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x3366('0x2')],'allowNull':![],'unique':_0x3366('0x3')},'description':{'type':Sequelize[_0x3366('0x2')]},'mapKey':{'type':Sequelize[_0x3366('0x2')],'defaultValue':_0x3366('0x4')},'mapKeyOffline':{'type':Sequelize[_0x3366('0x2')],'defaultValue':_0x3366('0x4')},'key':{'type':Sequelize[_0x3366('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3366('0x5')},'customerAlias':{'type':Sequelize[_0x3366('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3366('0x2')],'allowNull':![],'defaultValue':_0x3366('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3366('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3366('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3366('0x9')](_0x3366('0xa'),_0x3366('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x3366('0xc')},'start_chat_button':{'type':Sequelize[_0x3366('0x2')],'defaultValue':_0x3366('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x3366('0xe')},'header_offline':{'type':Sequelize[_0x3366('0x2')],'defaultValue':_0x3366('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3366('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3366('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x3366('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3366('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x3366('0x2')],'defaultValue':_0x3366('0x11')},'noteTitle':{'type':Sequelize[_0x3366('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3366('0x12')},'closingMessageButton':{'type':Sequelize[_0x3366('0x2')],'defaultValue':_0x3366('0xe')},'skipMessageButton':{'type':Sequelize[_0x3366('0x2')],'defaultValue':_0x3366('0x13')},'conditionAgreement':{'type':Sequelize[_0x3366('0x14')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x3366('0x14')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3366('0x2')],'defaultValue':_0x3366('0x15')},'ratingType':{'type':Sequelize[_0x3366('0x9')](_0x3366('0x16'),_0x3366('0x17')),'defaultValue':_0x3366('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x3366('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3366('0x18')],'defaultValue':function(){return JSON[_0x3366('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x3366('0x1a'),'type':_0x3366('0x1b'),'required':!![]},'props':{'title':_0x3366('0x1a'),'helpText':''}},{'type':_0x3366('0x1c'),'props':{'title':_0x3366('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x3366('0x4'),'type':_0x3366('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3366('0x1d')]('onlineForm')?JSON[_0x3366('0x1e')](this[_0x3366('0x1d')](_0x3366('0x1f'))):{};},'set':function(_0x1d1cbe){return this[_0x3366('0x20')](_0x3366('0x1f'),JSON[_0x3366('0x19')](_0x1d1cbe));}},'offlineForm':{'type':Sequelize[_0x3366('0x18')],'defaultValue':function(){return JSON[_0x3366('0x19')]({'items':[{'type':_0x3366('0x1c'),'props':{'title':_0x3366('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x3366('0x4'),'type':_0x3366('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x3366('0x21'),'helpText':_0x3366('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x3366('0x1d')](_0x3366('0x23'))?JSON[_0x3366('0x1e')](this[_0x3366('0x1d')](_0x3366('0x23'))):{};},'set':function(_0x218cb2){return this[_0x3366('0x20')](_0x3366('0x23'),JSON[_0x3366('0x19')](_0x218cb2));}},'token':{'type':Sequelize[_0x3366('0x2')],'defaultValue':function(){return rs[_0x3366('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3366('0x14')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3366('0x2')]},'forwardOffline':{'type':Sequelize[_0x3366('0x14')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x3366('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3366('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x3366('0x2')],'defaultValue':_0x3366('0x26')},'offlineMessageBody':{'type':Sequelize[_0x3366('0x2')],'defaultValue':_0x3366('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x3366('0x14')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3366('0x2')],'defaultValue':_0x3366('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x3366('0x13')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3366('0x14')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3366('0x18')]},'showAgentAvatar':{'type':Sequelize[_0x3366('0x14')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3366('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3366('0x18')],'defaultValue':function(){return _0x3366('0x29');}},'notificationSound':{'type':Sequelize[_0x3366('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3366('0x14')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3366('0x14')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3366('0x2')],'defaultValue':_0x3366('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3366('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3366('0x2')],'defaultValue':_0x3366('0x2b')},'verticalAlignment':{'type':Sequelize[_0x3366('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x3366('0x2')],'defaultValue':_0x3366('0x2c')},'messagesAlignment':{'type':Sequelize[_0x3366('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x3366('0x2')]},'customerAvatar':{'type':Sequelize[_0x3366('0x18')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3366('0x2')],'allowNull':![],'defaultValue':_0x3366('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3366('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3366('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3366('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3366('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3366('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x3366('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3366('0x8')],'comment':_0x3366('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x3366('0x14')],'defaultValue':![],'comment':_0x3366('0x2f'),'set':function(_0x24da60){if(!_0x24da60)this[_0x3366('0x20')]('mandatoryDispositionPauseId',null);this[_0x3366('0x20')](_0x3366('0x30'),_0x24da60);}},'vidaooEscalation':{'type':Sequelize[_0x3366('0x14')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3366('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x3366('0x2')],'defaultValue':function(){return _0x3366('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3366('0x14')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3366('0x18')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 17246ba..b1ba1ed 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 _0x5f66=['Start','startRouting','EventManager','offline','files','send','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','findOne','MailServerOut','Smtp','forwardOfflineAddress','service','host','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','toPairsIn','mapValues','subjectOffline','Chat','MailAccountId','NotifyMailAccount','notifyMail','attachments','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','custom','License','increment','chatLicenseExceeded','all','some','x-real-ip','connection','remoteAddress','replace','alignment','color','labelText','textColor','color_button','backgroundColor','addApplications','Transaction','READ_COMMITTED','priority','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','index','mandatoryDispositionPause','map','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatWebsite','include','rows','show','params','Pause','keys','rawAttributes','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ChatWebsiteId','Disposition','getDispositions','removeDispositions','addAnswer','getAnswers','CannedAnswer','findAll','removeAnswers','ids','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','List','account','applications','list','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','ChatInteraction','threadId','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','unmanaged','*,*,*,*','AttachmentId','User','unshift','agent','forcedOwnership'];(function(_0x158a61,_0x4e93a3){var _0x534c81=function(_0x42781d){while(--_0x42781d){_0x158a61['push'](_0x158a61['shift']());}};_0x534c81(++_0x4e93a3);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x65f6('0x0'));var util=require('util');var path=require(_0x65f6('0x1'));var ejs=require(_0x65f6('0x2'));var fs=require('fs');var fs_extra=require(_0x65f6('0x3'));var _=require(_0x65f6('0x4'));var querystring=require(_0x65f6('0x5'));var Redis=require('ioredis');var qs=require(_0x65f6('0x6'));var logger=require('../../config/logger')(_0x65f6('0x7'));var config=require(_0x65f6('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);var htmlToText=require('html-to-text');var jayson=require(_0x65f6('0xe'));var client=jayson[_0x65f6('0xf')][_0x65f6('0x10')]({'port':0x232c});var client9002=jayson[_0x65f6('0xf')]['http']({'port':0x232a});var client9003=jayson[_0x65f6('0xf')]['http']({'port':0x232b});var client9001=jayson['client'][_0x65f6('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x576875,_0x419819,_0x4862a5,_0x2f964a){return new BPromise(function(_0x186a6a,_0x2c4ee5){var _0x217570=_0x2f964a||client;return _0x217570[_0x65f6('0x11')](_0x576875,_0x4862a5)[_0x65f6('0x12')](function(_0x44144b){logger[_0x65f6('0x13')](_0x65f6('0x14'),_0x419819,_0x65f6('0x15'));logger['debug'](_0x65f6('0x16'),_0x419819,'request\x20sent',JSON['stringify'](_0x44144b));if(_0x44144b[_0x65f6('0x17')]){if(_0x44144b[_0x65f6('0x17')][_0x65f6('0x18')]===0x1f4){logger[_0x65f6('0x17')](_0x65f6('0x14'),_0x419819,_0x44144b[_0x65f6('0x17')][_0x65f6('0x19')]);return _0x2c4ee5(_0x44144b[_0x65f6('0x17')]['message']);}logger['error'](_0x65f6('0x14'),_0x419819,_0x44144b['error']['message']);return _0x186a6a(_0x44144b['error'][_0x65f6('0x19')]);}else{logger[_0x65f6('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x419819,_0x65f6('0x15'));_0x186a6a(_0x44144b[_0x65f6('0x1a')][_0x65f6('0x19')]);}})[_0x65f6('0x1b')](function(_0x219ab2){logger[_0x65f6('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x419819,_0x219ab2);_0x2c4ee5(_0x219ab2);});});}function respondWithStatusCode(_0x197a49,_0x4bb39e){_0x4bb39e=_0x4bb39e||0xcc;return function(_0x5b9e2a){if(_0x5b9e2a){return _0x197a49[_0x65f6('0x1c')](_0x4bb39e);}return _0x197a49[_0x65f6('0x1d')](_0x4bb39e)['end']();};}function respondWithResult(_0x1eeaaa,_0x471a33){_0x471a33=_0x471a33||0xc8;return function(_0x2317ce){if(_0x2317ce){return _0x1eeaaa[_0x65f6('0x1d')](_0x471a33)['json'](_0x2317ce);}};}function respondWithFilteredResult(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(_0x20a161){var _0x5963e0=typeof _0x59ea32['offset']==='undefined'&&typeof _0x59ea32[_0x65f6('0x1e')]===_0x65f6('0x1f');var _0x4b2292=_0x20a161[_0x65f6('0x20')];var _0x28f710=_0x5963e0?0x0:_0x59ea32['offset'];var _0x325cb4=_0x5963e0?_0x20a161[_0x65f6('0x20')]:_0x59ea32[_0x65f6('0x21')]+_0x59ea32['limit'];var _0x4ac04b;if(_0x325cb4>=_0x4b2292){_0x325cb4=_0x4b2292;_0x4ac04b=0xc8;}else{_0x4ac04b=0xce;}_0x9d7bb0['status'](_0x4ac04b);return _0x9d7bb0[_0x65f6('0x22')](_0x65f6('0x23'),_0x28f710+'-'+_0x325cb4+'/'+_0x4b2292)[_0x65f6('0x24')](_0x20a161);}return null;};}function saveUpdates(_0x408ccc){return function(_0x518cac){if(_0x518cac){return _0x518cac[_0x65f6('0x25')](_0x408ccc)[_0x65f6('0x12')](function(_0x4ace4c){return _0x4ace4c;});}return null;};}function removeEntity(_0x4ea23d){return function(_0x154cbd){if(_0x154cbd){return _0x154cbd[_0x65f6('0x26')]()['then'](function(){var _0x4e50c0=_0x154cbd[_0x65f6('0x27')]({'plain':!![]});var _0x1ce43c=_0x65f6('0x28');return db[_0x65f6('0x29')][_0x65f6('0x26')]({'where':{'type':_0x1ce43c,'resourceId':_0x4e50c0['id']}})[_0x65f6('0x12')](function(){return _0x154cbd;});})['then'](function(){_0x4ea23d[_0x65f6('0x1d')](0xcc)[_0x65f6('0x2a')]();});}};}function handleEntityNotFound(_0x46f03c){return function(_0x4bc037){if(!_0x4bc037){_0x46f03c[_0x65f6('0x1c')](0x194);}return _0x4bc037;};}function handleError(_0x2a7aa8,_0xbaed3c){_0xbaed3c=_0xbaed3c||0x1f4;return function(_0x45510a){logger[_0x65f6('0x17')](_0x45510a[_0x65f6('0x2b')]);if(_0x45510a['name']){delete _0x45510a[_0x65f6('0x2c')];}_0x2a7aa8[_0x65f6('0x1d')](_0xbaed3c)['send'](_0x45510a);};}exports[_0x65f6('0x2d')]=function(_0x5a740a,_0x2b403b){var _0x50494b={'include':[{'model':db['Pause'],'as':_0x65f6('0x2e')}]},_0x2b9fb6={},_0x24f7fd={'count':0x0,'rows':[]};var _0x13e41a=_[_0x65f6('0x2f')](db['ChatWebsite']['rawAttributes'],function(_0x30109d){return{'name':_0x30109d['fieldName'],'type':_0x30109d[_0x65f6('0x30')]['key']};});_0x2b9fb6[_0x65f6('0x31')]=_[_0x65f6('0x2f')](_0x13e41a,'name');_0x2b9fb6[_0x65f6('0x32')]=_['keys'](_0x5a740a['query']);_0x2b9fb6[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x2b9fb6[_0x65f6('0x31')],_0x2b9fb6[_0x65f6('0x32')]);_0x50494b[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x2b9fb6[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x5a740a['query'][_0x65f6('0x36')]));_0x50494b['attributes']=_0x50494b[_0x65f6('0x35')][_0x65f6('0x37')]?_0x50494b[_0x65f6('0x35')]:_0x2b9fb6[_0x65f6('0x31')];if(!_0x5a740a['query'][_0x65f6('0x38')](_0x65f6('0x39'))){_0x50494b[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x5a740a[_0x65f6('0x32')][_0x65f6('0x1e')]);_0x50494b[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x5a740a[_0x65f6('0x32')]['offset']);}_0x50494b[_0x65f6('0x3a')]=qs[_0x65f6('0x3b')](_0x5a740a[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x50494b[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x5a740a[_0x65f6('0x32')],_0x2b9fb6[_0x65f6('0x33')]),_0x13e41a);if(_0x5a740a[_0x65f6('0x32')][_0x65f6('0x3e')]){_0x50494b[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x50494b[_0x65f6('0x3c')],{'$or':_[_0x65f6('0x2f')](_0x13e41a,function(_0x2cb38d){if(_0x2cb38d['type']!==_0x65f6('0x40')){var _0x37cd36={};_0x37cd36[_0x2cb38d[_0x65f6('0x2c')]]={'$like':'%'+_0x5a740a[_0x65f6('0x32')]['filter']+'%'};return _0x37cd36;}})});}_0x50494b=_[_0x65f6('0x3f')]({},_0x50494b,_0x5a740a[_0x65f6('0x41')]);var _0x2b01eb={'where':_0x50494b['where']};return db[_0x65f6('0x42')][_0x65f6('0x20')](_0x2b01eb)[_0x65f6('0x12')](function(_0x2179e5){_0x24f7fd['count']=_0x2179e5;if(_0x5a740a[_0x65f6('0x32')]['includeAll']){_0x50494b[_0x65f6('0x43')]=[{'all':!![]}];}return db[_0x65f6('0x42')]['findAll'](_0x50494b);})[_0x65f6('0x12')](function(_0x5085db){_0x24f7fd[_0x65f6('0x44')]=_0x5085db;return _0x24f7fd;})[_0x65f6('0x12')](respondWithFilteredResult(_0x2b403b,_0x50494b))[_0x65f6('0x1b')](handleError(_0x2b403b,null));};exports[_0x65f6('0x45')]=function(_0x3ec18f,_0x3837b2){var _0x4d30c5={'raw':![],'where':{'id':_0x3ec18f[_0x65f6('0x46')]['id']},'include':[{'model':db[_0x65f6('0x47')],'as':_0x65f6('0x2e')}]},_0x51bf6c={};_0x51bf6c[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0x42')][_0x65f6('0x49')]);_0x51bf6c[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x3ec18f['query']);_0x51bf6c[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x51bf6c[_0x65f6('0x31')],_0x51bf6c['query']);_0x4d30c5[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x51bf6c['model'],qs[_0x65f6('0x36')](_0x3ec18f[_0x65f6('0x32')]['fields']));_0x4d30c5[_0x65f6('0x35')]=_0x4d30c5['attributes'][_0x65f6('0x37')]?_0x4d30c5[_0x65f6('0x35')]:_0x51bf6c[_0x65f6('0x31')];if(_0x3ec18f['query'][_0x65f6('0x4a')]){_0x4d30c5[_0x65f6('0x43')]=[{'all':!![]}];}_0x4d30c5=_['merge']({},_0x4d30c5,_0x3ec18f[_0x65f6('0x41')]);return db[_0x65f6('0x42')]['find'](_0x4d30c5)[_0x65f6('0x12')](handleEntityNotFound(_0x3837b2,null))[_0x65f6('0x12')](respondWithResult(_0x3837b2,null))[_0x65f6('0x1b')](handleError(_0x3837b2,null));};exports[_0x65f6('0x4b')]=function(_0x234fa7,_0x2350ca){return db[_0x65f6('0x42')][_0x65f6('0x4b')](_0x234fa7['body'],{})['then'](function(_0x5ca62e){var _0x19f40c=_0x234fa7[_0x65f6('0x4c')][_0x65f6('0x27')]({'plain':!![]});if(!_0x19f40c)throw new Error(_0x65f6('0x4d'));if(_0x19f40c['role']===_0x65f6('0x4c')){var _0x2032b9=_0x5ca62e[_0x65f6('0x27')]({'plain':!![]});var _0x50f63a=_0x65f6('0x28');return db[_0x65f6('0x4e')][_0x65f6('0x4f')]({'where':{'name':_0x50f63a,'userProfileId':_0x19f40c['userProfileId']},'raw':!![]})['then'](function(_0x1d337d){if(_0x1d337d&&_0x1d337d[_0x65f6('0x50')]===0x0){return db[_0x65f6('0x29')][_0x65f6('0x4b')]({'name':_0x2032b9[_0x65f6('0x2c')],'resourceId':_0x2032b9['id'],'type':_0x1d337d[_0x65f6('0x2c')],'sectionId':_0x1d337d['id']},{})[_0x65f6('0x12')](function(){return _0x5ca62e;});}else{return _0x5ca62e;}})[_0x65f6('0x1b')](function(_0x2d8b5b){logger[_0x65f6('0x17')](_0x65f6('0x51'),_0x2d8b5b);throw _0x2d8b5b;});}return _0x5ca62e;})[_0x65f6('0x12')](respondWithResult(_0x2350ca,0xc9))[_0x65f6('0x1b')](handleError(_0x2350ca,null));};exports[_0x65f6('0x25')]=function(_0x5ba9c6,_0x47610a){if(_0x5ba9c6[_0x65f6('0x52')]['id']){delete _0x5ba9c6[_0x65f6('0x52')]['id'];}return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x5ba9c6[_0x65f6('0x46')]['id']},'include':[{'model':db[_0x65f6('0x47')],'as':_0x65f6('0x2e')}]})['then'](handleEntityNotFound(_0x47610a,null))[_0x65f6('0x12')](saveUpdates(_0x5ba9c6[_0x65f6('0x52')],null))[_0x65f6('0x12')](respondWithResult(_0x47610a,null))[_0x65f6('0x1b')](handleError(_0x47610a,null));};exports['destroy']=function(_0x2923ff,_0x2fc20f){return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x2923ff[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x2fc20f,null))['then'](removeEntity(_0x2fc20f,null))[_0x65f6('0x1b')](handleError(_0x2fc20f,null));};exports[_0x65f6('0x53')]=function(_0x3974ef,_0x3c23e3){return db[_0x65f6('0x42')][_0x65f6('0x53')]()['then'](respondWithResult(_0x3c23e3,null))['catch'](handleError(_0x3c23e3,null));};exports['addDisposition']=function(_0x336a7d,_0x367d95){if(_0x336a7d[_0x65f6('0x52')]['id']){delete _0x336a7d[_0x65f6('0x52')]['id'];}return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x336a7d['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x367d95,null))[_0x65f6('0x12')](function(_0x54b569){if(_0x54b569){_0x336a7d[_0x65f6('0x52')][_0x65f6('0x54')]=_0x54b569['id'];return db[_0x65f6('0x55')]['create'](_0x336a7d[_0x65f6('0x52')]);}})[_0x65f6('0x12')](respondWithResult(_0x367d95,null))['catch'](handleError(_0x367d95,null));};exports[_0x65f6('0x56')]=function(_0x3edc6b,_0x1301f5){var _0x417b44={'raw':![],'where':{}};var _0x3d55f7={};var _0x2226bf={'count':0x0,'rows':[]};return db[_0x65f6('0x42')]['findOne']({'where':{'id':_0x3edc6b['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x1301f5,null))[_0x65f6('0x12')](function(_0x4a9524){if(_0x4a9524){_0x3d55f7[_0x65f6('0x31')]=_['keys'](db[_0x65f6('0x55')]['rawAttributes']);_0x3d55f7[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x3edc6b[_0x65f6('0x32')]);_0x3d55f7[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x3d55f7[_0x65f6('0x31')],_0x3d55f7[_0x65f6('0x32')]);_0x417b44[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x3d55f7['model'],qs['fields'](_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x36')]));_0x417b44[_0x65f6('0x35')]=_0x417b44['attributes']['length']?_0x417b44[_0x65f6('0x35')]:_0x3d55f7[_0x65f6('0x31')];if(!_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x38')](_0x65f6('0x39'))){_0x417b44[_0x65f6('0x1e')]=qs['limit'](_0x3edc6b['query'][_0x65f6('0x1e')]);_0x417b44[_0x65f6('0x21')]=qs['offset'](_0x3edc6b[_0x65f6('0x32')]['offset']);}_0x417b44[_0x65f6('0x3a')]=qs[_0x65f6('0x3b')](_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x417b44['where']=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x3edc6b[_0x65f6('0x32')],_0x3d55f7['filters']));_0x417b44['where'][_0x65f6('0x54')]=_0x4a9524['id'];if(_0x3edc6b['query'][_0x65f6('0x3e')]){_0x417b44[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x417b44[_0x65f6('0x3c')],{'$or':_['map'](_0x417b44['attributes'],function(_0x56f7f1){var _0x2e29b4={};_0x2e29b4[_0x56f7f1]={'$like':'%'+_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x3e')]+'%'};return _0x2e29b4;})});}_0x417b44=_['merge']({},_0x417b44,_0x3edc6b[_0x65f6('0x41')]);return db[_0x65f6('0x55')][_0x65f6('0x20')]({'where':_0x417b44['where']})[_0x65f6('0x12')](function(_0x15809e){_0x2226bf['count']=_0x15809e;if(_0x3edc6b[_0x65f6('0x32')][_0x65f6('0x4a')]){_0x417b44['include']=[{'all':!![]}];}return db[_0x65f6('0x55')]['findAll'](_0x417b44);})[_0x65f6('0x12')](function(_0x55ea91){_0x2226bf[_0x65f6('0x44')]=_0x55ea91;return _0x2226bf;});}})[_0x65f6('0x12')](respondWithFilteredResult(_0x1301f5,_0x417b44))['catch'](handleError(_0x1301f5,null));};exports[_0x65f6('0x57')]=function(_0x442e25,_0x2a700b){return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x442e25[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x2a700b,null))[_0x65f6('0x12')](function(_0x31dba0){if(_0x31dba0){return _0x31dba0[_0x65f6('0x57')](_0x442e25[_0x65f6('0x32')]['ids']);}})[_0x65f6('0x12')](respondWithStatusCode(_0x2a700b,null))[_0x65f6('0x1b')](handleError(_0x2a700b,null));};exports[_0x65f6('0x58')]=function(_0x219e42,_0x5694f9){if(_0x219e42[_0x65f6('0x52')]['id']){delete _0x219e42[_0x65f6('0x52')]['id'];}return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x219e42['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x5694f9,null))['then'](function(_0x31f6c1){if(_0x31f6c1){_0x219e42[_0x65f6('0x52')]['ChatWebsiteId']=_0x31f6c1['id'];return db['CannedAnswer'][_0x65f6('0x4b')](_0x219e42[_0x65f6('0x52')]);}})['then'](respondWithResult(_0x5694f9,null))[_0x65f6('0x1b')](handleError(_0x5694f9,null));};exports[_0x65f6('0x59')]=function(_0x73d359,_0x4edba0){var _0x1348ec={'raw':![],'where':{}};var _0x246510={};var _0x5889dc={'count':0x0,'rows':[]};return db[_0x65f6('0x42')]['findOne']({'where':{'id':_0x73d359[_0x65f6('0x46')]['id']}})['then'](handleEntityNotFound(_0x4edba0,null))['then'](function(_0x20687f){if(_0x20687f){_0x246510[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0x5a')][_0x65f6('0x49')]);_0x246510[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x73d359[_0x65f6('0x32')]);_0x246510['filters']=_['intersection'](_0x246510[_0x65f6('0x31')],_0x246510['query']);_0x1348ec[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x246510[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x73d359[_0x65f6('0x32')]['fields']));_0x1348ec[_0x65f6('0x35')]=_0x1348ec[_0x65f6('0x35')][_0x65f6('0x37')]?_0x1348ec['attributes']:_0x246510[_0x65f6('0x31')];if(!_0x73d359[_0x65f6('0x32')][_0x65f6('0x38')](_0x65f6('0x39'))){_0x1348ec[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x73d359['query']['limit']);_0x1348ec[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x73d359[_0x65f6('0x32')][_0x65f6('0x21')]);}_0x1348ec['order']=qs['sort'](_0x73d359[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x1348ec[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x73d359[_0x65f6('0x32')],_0x246510['filters']));_0x1348ec['where']['ChatWebsiteId']=_0x20687f['id'];if(_0x73d359[_0x65f6('0x32')][_0x65f6('0x3e')]){_0x1348ec[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x1348ec['where'],{'$or':_['map'](_0x1348ec[_0x65f6('0x35')],function(_0x27e44b){var _0x56077a={};_0x56077a[_0x27e44b]={'$like':'%'+_0x73d359[_0x65f6('0x32')]['filter']+'%'};return _0x56077a;})});}_0x1348ec=_[_0x65f6('0x3f')]({},_0x1348ec,_0x73d359['options']);return db[_0x65f6('0x5a')][_0x65f6('0x20')]({'where':_0x1348ec['where']})[_0x65f6('0x12')](function(_0x330e18){_0x5889dc[_0x65f6('0x20')]=_0x330e18;if(_0x73d359[_0x65f6('0x32')][_0x65f6('0x4a')]){_0x1348ec[_0x65f6('0x43')]=[{'all':!![]}];}return db['CannedAnswer'][_0x65f6('0x5b')](_0x1348ec);})['then'](function(_0x24495c){_0x5889dc['rows']=_0x24495c;return _0x5889dc;});}})[_0x65f6('0x12')](respondWithFilteredResult(_0x4edba0,_0x1348ec))[_0x65f6('0x1b')](handleError(_0x4edba0,null));};exports[_0x65f6('0x5c')]=function(_0x41e59a,_0x535558){return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x41e59a[_0x65f6('0x46')]['id']}})['then'](handleEntityNotFound(_0x535558,null))['then'](function(_0xccd888){if(_0xccd888){return _0xccd888[_0x65f6('0x5c')](_0x41e59a['query'][_0x65f6('0x5d')]);}})[_0x65f6('0x12')](respondWithStatusCode(_0x535558,null))[_0x65f6('0x1b')](handleError(_0x535558,null));};exports['addLogo']=function(_0x2c8938,_0xf1e6a1){_0x2c8938['body'][_0x65f6('0x5e')]=_0x2c8938[_0x65f6('0x5f')][_0x65f6('0x60')];return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x2c8938[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0xf1e6a1,null))['then'](saveUpdates(_0x2c8938[_0x65f6('0x52')],null))['then'](respondWithResult(_0xf1e6a1,null))[_0x65f6('0x1b')](handleError(_0xf1e6a1,null));};exports[_0x65f6('0x61')]=function(_0x31ec61,_0x22be6e){_0x31ec61[_0x65f6('0x52')][_0x65f6('0x62')]=_0x31ec61['file'][_0x65f6('0x60')];return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x31ec61[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x22be6e,null))['then'](saveUpdates(_0x31ec61['body'],null))['then'](respondWithResult(_0x22be6e,null))[_0x65f6('0x1b')](handleError(_0x22be6e,null));};exports[_0x65f6('0x63')]=function(_0xcfc47a,_0x59b715){_0xcfc47a[_0x65f6('0x52')]['customerAvatar']=_0xcfc47a['file'][_0x65f6('0x60')];return db[_0x65f6('0x42')]['find']({'where':{'id':_0xcfc47a[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x59b715,null))[_0x65f6('0x12')](saveUpdates(_0xcfc47a[_0x65f6('0x52')],null))[_0x65f6('0x12')](respondWithResult(_0x59b715,null))[_0x65f6('0x1b')](handleError(_0x59b715,null));};exports[_0x65f6('0x64')]=function(_0x3291ac,_0x477f29){_0x3291ac[_0x65f6('0x52')][_0x65f6('0x65')]=_0x3291ac[_0x65f6('0x5f')]['filename'];return db[_0x65f6('0x42')]['find']({'where':{'id':_0x3291ac['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x477f29,null))[_0x65f6('0x12')](saveUpdates(_0x3291ac[_0x65f6('0x52')],null))[_0x65f6('0x12')](respondWithResult(_0x477f29,null))['catch'](handleError(_0x477f29,null));};exports[_0x65f6('0x66')]=function(_0x565b63,_0x490512){var _0x416ed4=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x69'));var _0xd893ef={'where':{'id':_0x565b63[_0x65f6('0x46')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x5c8131=![];return require('../../config/license/util')[_0x65f6('0x6a')]()[_0x65f6('0x12')](function(_0x365044){if(_0x365044){_0x5c8131=_0x365044['custom'];}})[_0x65f6('0x12')](function(){return db['ChatWebsite']['find'](_0xd893ef);})[_0x65f6('0x12')](handleEntityNotFound(_0x490512,null))[_0x65f6('0x12')](function(_0x2dbed5){if(_0x2dbed5){if(!_[_0x65f6('0x6b')](_0x2dbed5[_0x65f6('0x5e')])){if(fs['existsSync'](path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x6c'),_0x2dbed5[_0x65f6('0x5e')]))&&_0x5c8131){_0x416ed4=path['join'](config[_0x65f6('0x68')],_0x65f6('0x6c'),_0x2dbed5[_0x65f6('0x5e')]);}}return _0x490512[_0x65f6('0x6d')](_0x416ed4);}})[_0x65f6('0x1b')](handleError(_0x490512,null));};exports[_0x65f6('0x6e')]=function(_0x2f9814,_0x8aab06){var _0x558410=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x6f'));var _0x8adb47={'where':{'id':_0x2f9814[_0x65f6('0x46')]['id']},'attributes':['id',_0x65f6('0x62')],'raw':!![]};return db['ChatWebsite'][_0x65f6('0x4f')](_0x8adb47)[_0x65f6('0x12')](handleEntityNotFound(_0x8aab06,null))['then'](function(_0x34f1e6){if(_0x34f1e6){if(!_['isNil'](_0x34f1e6[_0x65f6('0x62')])){if(fs[_0x65f6('0x70')](path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x34f1e6['agentAvatar']))){_0x558410=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x34f1e6[_0x65f6('0x62')]);}}return _0x8aab06[_0x65f6('0x6d')](_0x558410);}})['catch'](handleError(_0x8aab06,null));};exports['getCustomerAvatar']=function(_0x38006c,_0x22a9e7){var _0x2993ee=path[_0x65f6('0x67')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x534004={'where':{'id':_0x38006c[_0x65f6('0x46')]['id']},'attributes':['id',_0x65f6('0x72'),_0x65f6('0x73')],'raw':!![]};return db['ChatWebsite'][_0x65f6('0x4f')](_0x534004)[_0x65f6('0x12')](handleEntityNotFound(_0x22a9e7,null))[_0x65f6('0x12')](function(_0x18c6a8){if(_0x18c6a8){if(!_[_0x65f6('0x6b')](_0x18c6a8['customerAvatar'])){if(fs[_0x65f6('0x70')](path[_0x65f6('0x67')](config['root'],'server/files/images/avatars/',_0x18c6a8[_0x65f6('0x72')]))&&_0x18c6a8[_0x65f6('0x73')]){_0x2993ee=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x18c6a8['customerAvatar']);}}return _0x22a9e7[_0x65f6('0x6d')](_0x2993ee);}})['catch'](handleError(_0x22a9e7,null));};exports[_0x65f6('0x74')]=function(_0x5d181a,_0x38fcc9){var _0x5cec52=path[_0x65f6('0x67')](config['root'],_0x65f6('0x75'));var _0x3b9aed={'where':{'id':_0x5d181a['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x65f6('0x42')][_0x65f6('0x4f')](_0x3b9aed)[_0x65f6('0x12')](handleEntityNotFound(_0x38fcc9,null))[_0x65f6('0x12')](function(_0x861892){if(_0x861892){if(!_[_0x65f6('0x6b')](_0x861892[_0x65f6('0x65')])){if(fs[_0x65f6('0x70')](path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x861892[_0x65f6('0x65')]))){_0x5cec52=path[_0x65f6('0x67')](config[_0x65f6('0x68')],_0x65f6('0x71'),_0x861892[_0x65f6('0x65')]);}}return _0x38fcc9[_0x65f6('0x6d')](_0x5cec52);}})['catch'](handleError(_0x38fcc9,null));};exports[_0x65f6('0x76')]=function(_0x91d7bf,_0x11bdf3){var _0x16e246=require(_0x65f6('0x77'));var _0x1dbf36=new _0x16e246();var _0x849936=_0x1dbf36[_0x65f6('0x78')](_0x91d7bf[_0x65f6('0x79')]['user-agent'])[_0x65f6('0x7a')]();var _0x585e99={'body':_0x91d7bf[_0x65f6('0x52')],'channel':_0x65f6('0x7b')};var _0x5c2f2c=[];var _0x38db52=[];var _0x39dedf={};var _0x5c7462=![];return db[_0x65f6('0x7c')][_0x65f6('0x53')]()[_0x65f6('0x12')](function(_0x207831){if(!_0x207831){throw new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))]('no\x20available\x20attributes');}_0x5c2f2c=_[_0x65f6('0x7f')](_[_0x65f6('0x48')](_0x207831),[_0x65f6('0x80'),_0x65f6('0x81')]);_0x38db52=_['difference'](_['keys'](_0x207831),['createdAt',_0x65f6('0x81'),_0x65f6('0x82'),_0x65f6('0x83')]);if(_0x91d7bf[_0x65f6('0x52')]['id']){delete _0x91d7bf[_0x65f6('0x52')]['id'];}if(_['isNil'](_0x91d7bf['body'][_0x65f6('0x84')])){throw new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x91d7bf[_0x65f6('0x52')]['body'])||_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x52')]===''){throw new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))](_0x65f6('0x85'));}if(_[_0x65f6('0x6b')](_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x86')])){throw new db[(_0x65f6('0x7d'))]['ValidationError'](_0x65f6('0x87')+_0x38db52);}if(!_[_0x65f6('0x88')](_0x38db52,_0x91d7bf['body'][_0x65f6('0x86')])){throw new db['Sequelize'][(_0x65f6('0x7e'))](_0x65f6('0x89')+_0x38db52);}_0x39dedf[_0x91d7bf[_0x65f6('0x52')]['mapKey']]=_0x91d7bf[_0x65f6('0x52')]['from'];})['then'](function(){return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x91d7bf['params']['id']},'include':[{'model':db[_0x65f6('0x8a')],'as':'List','include':[{'model':db[_0x65f6('0x7c')],'as':_0x65f6('0x8b'),'where':_0x39dedf,'limit':0x1,'order':[[_0x65f6('0x81'),_0x65f6('0x8c')]]}]},{'model':db[_0x65f6('0x8d')],'as':_0x65f6('0x8e')}]});})[_0x65f6('0x12')](handleEntityNotFound(_0x11bdf3,null))[_0x65f6('0x12')](function(_0x5ed6ff){if(_0x5ed6ff&&_0x5ed6ff[_0x65f6('0x8f')]){_0x585e99[_0x65f6('0x90')]=_0x5ed6ff;_0x585e99[_0x65f6('0x91')]=_0x5ed6ff[_0x65f6('0x8e')];_0x585e99[_0x65f6('0x92')]=_0x5ed6ff['List'];_0x585e99[_0x65f6('0x91')]=_['orderBy'](_0x585e99[_0x65f6('0x91')],['priority'],[_0x65f6('0x93')]);if(_0x585e99[_0x65f6('0x90')][_0x65f6('0x8e')]){delete _0x585e99[_0x65f6('0x90')][_0x65f6('0x8e')];}if(_0x585e99[_0x65f6('0x90')][_0x65f6('0x8f')]&&_0x585e99[_0x65f6('0x90')][_0x65f6('0x8f')][_0x65f6('0x8b')][_0x65f6('0x37')]){return _0x585e99[_0x65f6('0x90')][_0x65f6('0x8f')][_0x65f6('0x8b')][0x0];}var _0x37fa08=_[_0x65f6('0x9')](_0x91d7bf[_0x65f6('0x52')],{'firstName':_0x91d7bf['body'][_0x65f6('0x84')],'ListId':_0x5ed6ff['ListId']});_0x37fa08[_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x86')]]=_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x84')];return db[_0x65f6('0x7c')][_0x65f6('0x4b')](_0x37fa08,{'fields':_0x5c2f2c,'raw':!![]});}})['then'](handleEntityNotFound(_0x11bdf3,null))[_0x65f6('0x12')](function(_0x1ac0bd){_0x585e99[_0x65f6('0x94')]=_0x1ac0bd;var _0x359734=_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x95')];if(_0x91d7bf[_0x65f6('0x79')][_0x65f6('0x96')]){_0x359734=_0x91d7bf[_0x65f6('0x79')][_0x65f6('0x96')];}else if(_0x91d7bf[_0x65f6('0x79')]['x-forwarded-for']){_0x359734=_['first'](_0x91d7bf[_0x65f6('0x79')][_0x65f6('0x97')][_0x65f6('0x98')](','));}if(_0x1ac0bd){var _0x179fed={'ContactId':_0x1ac0bd['id'],'ChatWebsiteId':_0x91d7bf[_0x65f6('0x46')]['id'],'from':(_0x1ac0bd[_0x65f6('0x99')]||'')+'\x20'+(_0x1ac0bd[_0x65f6('0x9a')]||''),'customerIp':_0x359734,'customerPort':_0x91d7bf['headers'][_0x65f6('0x9b')]?_0x91d7bf[_0x65f6('0x79')][_0x65f6('0x9b')]:null,'referer':_0x91d7bf[_0x65f6('0x52')][_0x65f6('0x9c')],'browserName':_0x849936[_0x65f6('0x9d')][_0x65f6('0x2c')]&&_0x849936[_0x65f6('0x9d')][_0x65f6('0x9e')]?util[_0x65f6('0x9f')](_0x65f6('0xa0'),_0x849936[_0x65f6('0x9d')][_0x65f6('0x2c')],_0x849936['browser']['version']):'unknown','browserVersion':_0x849936[_0x65f6('0x9d')][_0x65f6('0x9e')]||_0x65f6('0xa1'),'osName':util['format'](_0x65f6('0xa0'),_0x849936['os'][_0x65f6('0x2c')],_0x849936['os'][_0x65f6('0x9e')]),'osVersion':_0x849936['os']['version'],'deviceModel':_0x849936[_0x65f6('0xa2')][_0x65f6('0x31')]&&_0x849936['device'][_0x65f6('0xa3')]?util[_0x65f6('0x9f')](_0x65f6('0xa4'),_0x849936['device'][_0x65f6('0x31')],_0x849936[_0x65f6('0xa2')][_0x65f6('0xa3')],_0x849936[_0x65f6('0xa2')][_0x65f6('0x30')]):null,'deviceVendor':_0x849936[_0x65f6('0xa2')][_0x65f6('0xa3')],'deviceType':_0x849936[_0x65f6('0xa2')][_0x65f6('0x30')],'formData':JSON[_0x65f6('0xa5')](_0x91d7bf['body'])};var _0x43c89e={'ChatWebsiteId':_0x91d7bf[_0x65f6('0x46')]['id'],'closed':![]};if(_0x91d7bf[_0x65f6('0x52')]['threadId']){_0x43c89e['threadId']=_0x91d7bf[_0x65f6('0x52')]['threadId'];return db[_0x65f6('0xa6')][_0x65f6('0x4f')]({'where':_0x43c89e})[_0x65f6('0x12')](function(_0xbf4abe){if(_0xbf4abe){return[_0xbf4abe,![]];}_0x179fed[_0x65f6('0xa7')]=_0x91d7bf['body'][_0x65f6('0xa7')];_0x179fed[_0x65f6('0xa8')]=_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xa8')];return db['ChatInteraction'][_0x65f6('0x4b')](_0x179fed)[_0x65f6('0x12')](function(_0x11d3fb){return[_0x11d3fb,!![]];});});}_0x43c89e[_0x65f6('0xa9')]=_0x1ac0bd['id'];if(_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xaa')]&&_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xaa')]['id']){_0x43c89e['id']=_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xaa')]['id'];return db[_0x65f6('0xa6')][_0x65f6('0x4f')]({'where':_0x43c89e})[_0x65f6('0x12')](function(_0x31e87d){if(_0x31e87d){return[_0x31e87d,![]];}return db[_0x65f6('0xa6')]['create'](_0x179fed)[_0x65f6('0x12')](function(_0x1cca16){return[_0x1cca16,!![]];});});}return db['ChatInteraction']['create'](_0x179fed)[_0x65f6('0x12')](function(_0x7c1efc){return[_0x7c1efc,!![]];});}})[_0x65f6('0xab')](function(_0x2bcdec,_0x21b9ba){if(_0x2bcdec){_0x5c7462=_0x21b9ba;if(!_0x21b9ba){var _0x33e01f={'from':(_0x585e99[_0x65f6('0x94')]['firstName']||'')+'\x20'+(_0x585e99[_0x65f6('0x94')]['lastName']||'')};if(_0x91d7bf['body'][_0x65f6('0xa7')]&&_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xac')]&&_0x91d7bf[_0x65f6('0x52')]['threadId']!=_0x91d7bf['body'][_0x65f6('0xac')]){_0x33e01f[_0x65f6('0xa7')]=_0x91d7bf['body']['messageId'];}return _0x2bcdec['update'](_0x33e01f);}else{return _0x2bcdec;}}})[_0x65f6('0x12')](function(_0x42dc3a){_0x585e99[_0x65f6('0xaa')]=_0x42dc3a[_0x65f6('0x27')]({'plain':!![]});_0x585e99[_0x65f6('0xaa')]['created']=_0x5c7462;if(_0x585e99['interaction'][_0x65f6('0xad')]){if(_0x585e99[_0x65f6('0x90')][_0x65f6('0xae')]){_0x585e99['applications']['push']({'id':0x0,'priority':_0x585e99[_0x65f6('0x91')][_0x65f6('0x37')]+0x1,'app':'close','appdata':_0x65f6('0xaf'),'interval':_0x65f6('0xb0')});}}return db['ChatMessage'][_0x65f6('0x4b')]({'body':_0x91d7bf['body'][_0x65f6('0x52')],'ChatWebsiteId':_0x91d7bf[_0x65f6('0x46')]['id'],'ChatInteractionId':_0x42dc3a['id'],'direction':'in','ContactId':_0x585e99[_0x65f6('0x94')]['id'],'AttachmentId':_0x91d7bf[_0x65f6('0x52')][_0x65f6('0xb1')]});})[_0x65f6('0x12')](function(_0x5ca33e){_0x585e99[_0x65f6('0x19')]=_0x5ca33e;if(_0x585e99[_0x65f6('0xaa')]['UserId']){return db[_0x65f6('0xb2')][_0x65f6('0x4f')]({'attributes':['id',_0x65f6('0x2c')],'where':{'id':_0x585e99['interaction']['UserId']}})[_0x65f6('0x12')](function(_0x2229ae){if(_0x2229ae){_0x585e99[_0x65f6('0x91')][_0x65f6('0xb3')]({'id':0x0,'priority':0x0,'app':_0x65f6('0xb4'),'appdata':_0x2229ae[_0x65f6('0x2c')]+','+(_0x585e99['account']['waitForTheAssignedAgent']||0xa),'interval':_0x65f6('0xb0')});_0x585e99[_0x65f6('0xb5')]=!![];}return respondWithRpcPromise(_0x65f6('0xb6'),_0x65f6('0xb7'),_0x585e99);});}return respondWithRpcPromise(_0x65f6('0xb6'),_0x65f6('0xb7'),_0x585e99);})[_0x65f6('0x12')](function(_0x4146df){respondWithRpcPromise(_0x65f6('0xb8'),_0x65f6('0xb8'),{'event':_0x65f6('0x76'),'message':_0x4146df},client9002);return _0x4146df;})[_0x65f6('0x12')](respondWithResult(_0x11bdf3,null))['catch'](handleError(_0x11bdf3,null));};exports[_0x65f6('0xb9')]=function(_0x3d2328,_0x21a8c9){var _0x101050,_0x3be8bc,_0x385d13;var _0xd00f2f=[];var _0x868a4f={};var _0x2820b3=_0x3d2328[_0x65f6('0xba')]||[];var _0x591fcd=[];var _0x4dfda4;return db[_0x65f6('0x7c')][_0x65f6('0x53')]()['then'](function(_0x1db7e4){if(!_0x1db7e4){throw new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))]('no\x20available\x20attributes');}_0xd00f2f=_['difference'](_[_0x65f6('0x48')](_0x1db7e4),[_0x65f6('0x80'),_0x65f6('0x81'),_0x65f6('0x82'),_0x65f6('0x83')]);if(_0x3d2328[_0x65f6('0x52')]['id']){delete _0x3d2328[_0x65f6('0x52')]['id'];}if(_[_0x65f6('0x6b')](_0x3d2328[_0x65f6('0x52')][_0x65f6('0x84')])){throw _0x21a8c9[_0x65f6('0x1d')](0x1f4)[_0x65f6('0xbb')](new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))](_0x65f6('0xbc')));}if(_[_0x65f6('0x6b')](_0x3d2328[_0x65f6('0x52')][_0x65f6('0x52')])||_0x3d2328['body'][_0x65f6('0x52')]===''){throw _0x21a8c9[_0x65f6('0x1d')](0x1f4)[_0x65f6('0xbb')](new db[(_0x65f6('0x7d'))]['ValidationError'](_0x65f6('0x85')));}if(_['isNil'](_0x3d2328[_0x65f6('0x52')][_0x65f6('0xbd')])){throw _0x21a8c9[_0x65f6('0x1d')](0x1f4)[_0x65f6('0xbb')](new db[(_0x65f6('0x7d'))]['ValidationError'](_0x65f6('0xbe')+_0xd00f2f));}if(!_['includes'](_0xd00f2f,_0x3d2328['body']['mapKeyOffline'])){throw _0x21a8c9[_0x65f6('0x1d')](0x1f4)['send'](new db[(_0x65f6('0x7d'))][(_0x65f6('0x7e'))](_0x65f6('0xbf')+_0xd00f2f));}_0x868a4f[_0x3d2328[_0x65f6('0x52')][_0x65f6('0xbd')]]=_0x3d2328[_0x65f6('0x52')][_0x65f6('0x84')];})[_0x65f6('0x12')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x3d2328[_0x65f6('0x46')]['id']},'include':[{'model':db[_0x65f6('0x8a')],'as':'List'},{'model':db[_0x65f6('0xc0')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x21a8c9,null))[_0x65f6('0x12')](function(_0x74f19d){if(_0x74f19d&&_0x74f19d[_0x65f6('0x8f')]){_0x3be8bc=_0x74f19d;var _0x1050c7=_[_0x65f6('0x9')](_0x3d2328['body'],{'firstName':_0x3d2328[_0x65f6('0x52')]['from'],'phone':_0x3d2328[_0x65f6('0x52')]['from'],'ListId':_0x74f19d['ListId']});_0x1050c7[_0x3d2328[_0x65f6('0x52')][_0x65f6('0xbd')]]=_0x3d2328[_0x65f6('0x52')][_0x65f6('0x84')];return db[_0x65f6('0x7c')][_0x65f6('0xc1')]({'where':_0x868a4f,'defaults':_0x1050c7});}})[_0x65f6('0xab')](function(_0x2ff0f5){if(_0x2ff0f5){_0x385d13=_0x2ff0f5;var _0x504520=fs[_0x65f6('0xc2')](path['join'](config[_0x65f6('0x68')],_0x65f6('0xc3')),_0x65f6('0xc4'));var _0x588b38=ejs[_0x65f6('0xc5')](_0x504520,{'body':_[_0x65f6('0xc6')](_0x3d2328['body'][_0x65f6('0x52')]),'bodyTitle':_0x3be8bc[_0x65f6('0xc7')]});return db[_0x65f6('0xc8')][_0x65f6('0x4b')]({'body':_0x588b38,'plainBody':htmlToText[_0x65f6('0xc9')](_0x588b38),'ContactId':_0x2ff0f5['id'],'ChatWebsiteId':_0x3be8bc['id']});}})['then'](function(_0x428a19){_0x4dfda4=_0x428a19;if(_0x2820b3[_0x65f6('0x37')]){var _0x410442=_0x2820b3['map'](function(_0x4c1149){return{'name':_0x4c1149[_0x65f6('0xca')],'basename':_0x4c1149[_0x65f6('0x60')],'type':_0x4c1149[_0x65f6('0xcb')],'ChatOfflineMessageId':_0x428a19['id']};});_0x591fcd=_0x410442[_0x65f6('0x2f')](_0x3d1df9=>{var _0x5b4033={'filename':_0x3d1df9['name'],'path':path['join'](config[_0x65f6('0x68')],_0x65f6('0xcc'),'files','attachments','offline-chat',_0x3d1df9[_0x65f6('0xcd')])};return _0x5b4033;});if(!_0x3be8bc[_0x65f6('0xce')]){return db[_0x65f6('0xcf')][_0x65f6('0xd0')](function(_0x1be461){return db[_0x65f6('0xd1')][_0x65f6('0xd2')](_0x410442,{'transaction':_0x1be461});});}}})[_0x65f6('0x12')](function(){if(_0x4dfda4){_0x101050=_0x4dfda4;return db[_0x65f6('0xc0')][_0x65f6('0xd3')]({'where':{'active':!![]},'include':[{'model':db[_0x65f6('0xd4')],'as':_0x65f6('0xd5'),'raw':!![]}]});}})[_0x65f6('0x12')](function(_0x62136d){if(_0x62136d&&_0x62136d[_0x65f6('0xd5')]&&_0x3be8bc['forwardOffline']&&_0x3be8bc[_0x65f6('0xd6')]){var _0x1979c2={'tls':{'rejectUnauthorized':![]}};if(_0x62136d[_0x65f6('0xd5')][_0x65f6('0xd7')]){_0x1979c2[_0x65f6('0xd7')]=_0x62136d[_0x65f6('0xd5')]['service'];}else{_0x1979c2[_0x65f6('0xd8')]=_0x62136d[_0x65f6('0xd5')]['host'];_0x1979c2['port']=_0x62136d[_0x65f6('0xd5')]['port'];_0x1979c2['secure']=_0x62136d[_0x65f6('0xd5')][_0x65f6('0xd9')];}if(_0x62136d['Smtp'][_0x65f6('0xda')]){_0x1979c2[_0x65f6('0xdb')]={'user':_0x62136d['Smtp'][_0x65f6('0x4c')],'pass':_0x62136d[_0x65f6('0xd5')][_0x65f6('0xdc')]};}return respondWithRpcPromise(_0x65f6('0xdd'),_0x65f6('0xde'),{'account':_0x1979c2,'message':{'from':util[_0x65f6('0x9f')](_0x65f6('0xdf'),_0x62136d[_0x65f6('0x2c')],_0x62136d[_0x65f6('0xe0')]||_0x62136d['Smtp'][_0x65f6('0x4c')]),'to':_0x3be8bc[_0x65f6('0xd6')],'subject':_0x3be8bc[_0x65f6('0xe1')],'html':_0x101050[_0x65f6('0x52')],'attachments':_0x591fcd}},client9003)[_0x65f6('0x12')](function(){return _0x101050;})[_0x65f6('0x1b')](function(_0x4e4726){console[_0x65f6('0x17')](_0x4e4726);});}})['then'](function(){if(_0x3be8bc&&_0x3be8bc['openNewInteraction']&&_0x3be8bc['MailAccountId']){var _0x3f770a=[];if(_0x2820b3['length']){_0x3f770a=_0x2820b3[_0x65f6('0x2f')](function(_0x408f37){return{'name':_0x408f37[_0x65f6('0xca')],'basename':_0x408f37[_0x65f6('0x60')],'type':_0x408f37[_0x65f6('0xcb')],'ChatOfflineMessageId':_0x4dfda4['id']};});}var _0x355476;if(!_[_0x65f6('0x6b')](_0x3be8bc['subjectOffline'])){var _0x5db63d=_[_0x65f6('0x2f')](_0x3d2328[_0x65f6('0x52')],function(_0x11edd6){return _0x11edd6;});var _0x4bb32e=_[_0x65f6('0xe2')](_0x5db63d)[0x0];var _0x5d8c8e=_[_0x65f6('0xe3')](_0x4bb32e,function(_0x2b1dfc){return _0x2b1dfc;});_0x355476=_0x5d8c8e[0x1][_0x3be8bc[_0x65f6('0xe4')]];}var _0x4b920a={'from':_0x385d13[_0x65f6('0xe0')],'firstName':_0x385d13[_0x65f6('0x99')],'lastName':_0x385d13[_0x65f6('0x9a')],'mapKey':_0x65f6('0xe0'),'message':{'from':_0x385d13['email'],'to':_0x3be8bc['MailAccount'][_0x65f6('0xe0')],'cc':'','subject':_['isNil'](_0x355476)?_0x3be8bc[_0x65f6('0xe1')]:_0x355476,'messageId':'','sentAt':new Date(),'attach':_0x3f770a['length'],'attachments':_0x3f770a,'originChannel':_0x65f6('0xe5'),'ChatWebsiteId':_0x3be8bc['id'],'ChatOfflineMessageId':_0x101050['id'],'originTo':_0x3be8bc[_0x65f6('0xc0')][_0x65f6('0xe0')]},'body':_0x101050['body']};var _0x3225b6={'account':{'id':_0x3be8bc[_0x65f6('0xe6')]},'body':_0x4b920a,'log':_0x65f6('0xe7')};return respondWithRpcPromise(_0x65f6('0xe7'),_0x65f6('0xe8'),_0x3225b6,client9001)[_0x65f6('0x12')](function(){return _0x101050;})[_0x65f6('0x1b')](function(_0x4e40d4){console[_0x65f6('0x17')](_0x4e40d4);});}return;})[_0x65f6('0x12')](function(){if(_0x101050){return _0x101050;}})[_0x65f6('0x12')](respondWithResult(_0x21a8c9,null))[_0x65f6('0x1b')](function(_0x72ac02){console[_0x65f6('0x17')](_0x65f6('0x1b'),_0x72ac02);for(var _0xe52598 of _0x2820b3){var _0x1790e4=path['join'](config[_0x65f6('0x68')],'server',_0x65f6('0xba'),_0x65f6('0xe9'),_0x65f6('0xea'),_0xe52598[_0x65f6('0x60')]);fs_extra[_0x65f6('0xeb')](_0x1790e4)[_0x65f6('0x1b')](function(_0x4684ab){console[_0x65f6('0x17')](_0x65f6('0xec'),_0x1790e4,_0x4684ab);});}});};exports[_0x65f6('0xed')]=function(_0x148993,_0x38e6ff){return db[_0x65f6('0xa6')][_0x65f6('0x4f')]({'where':{'id':_0x148993[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x38e6ff,null))[_0x65f6('0x12')](function(_0x560dbb){if(_0x560dbb){return _0x560dbb[_0x65f6('0xed')](_0x148993[_0x65f6('0x52')]['ids'],_[_0x65f6('0xee')](_0x148993[_0x65f6('0x52')],[_0x65f6('0x5d'),'id'])||{});}})[_0x65f6('0x12')](respondWithResult(_0x38e6ff,null))[_0x65f6('0x1b')](handleError(_0x38e6ff,null));};exports[_0x65f6('0xef')]=function(_0x4adb7a,_0x492c89){var _0x409127={'raw':![],'where':{}};var _0x2c0165={};var _0xd11998={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x65f6('0xd3')]({'where':{'id':_0x4adb7a['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x492c89,null))[_0x65f6('0x12')](function(_0x1c8b2e){if(_0x1c8b2e){_0x2c0165[_0x65f6('0x31')]=_['keys'](db[_0x65f6('0xa6')]['rawAttributes']);_0x2c0165[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x4adb7a[_0x65f6('0x32')]);_0x2c0165['filters']=_[_0x65f6('0x34')](_0x2c0165['model'],_0x2c0165['query']);_0x409127[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x2c0165[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x4adb7a[_0x65f6('0x32')][_0x65f6('0x36')]));_0x409127[_0x65f6('0x35')]=_0x409127[_0x65f6('0x35')][_0x65f6('0x37')]?_0x409127[_0x65f6('0x35')]:_0x2c0165[_0x65f6('0x31')];if(!_0x4adb7a['query'][_0x65f6('0x38')]('nolimit')){_0x409127[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x4adb7a['query'][_0x65f6('0x1e')]);_0x409127[_0x65f6('0x21')]=qs['offset'](_0x4adb7a['query'][_0x65f6('0x21')]);}_0x409127['order']=qs['sort'](_0x4adb7a[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x409127[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x4adb7a[_0x65f6('0x32')],_0x2c0165[_0x65f6('0x33')]));_0x409127[_0x65f6('0x3c')][_0x65f6('0x54')]=_0x1c8b2e['id'];if(_0x4adb7a['query'][_0x65f6('0x3e')]){_0x409127[_0x65f6('0x3c')]=_['merge'](_0x409127[_0x65f6('0x3c')],{'$or':_[_0x65f6('0x2f')](_0x409127[_0x65f6('0x35')],function(_0xcf934){var _0x73732f={};_0x73732f[_0xcf934]={'$like':'%'+_0x4adb7a[_0x65f6('0x32')]['filter']+'%'};return _0x73732f;})});}_0x409127=_['merge']({},_0x409127,_0x4adb7a[_0x65f6('0x41')]);return db[_0x65f6('0xa6')][_0x65f6('0x20')]({'where':_0x409127[_0x65f6('0x3c')]})[_0x65f6('0x12')](function(_0x4cee07){_0xd11998[_0x65f6('0x20')]=_0x4cee07;if(_0x4adb7a[_0x65f6('0x32')][_0x65f6('0x4a')]){_0x409127[_0x65f6('0x43')]=[{'model':db[_0x65f6('0x7c')],'as':_0x65f6('0xf0'),'required':![]},{'model':db[_0x65f6('0xb2')],'as':_0x65f6('0xf1'),'attributes':[_0x65f6('0x2c'),_0x65f6('0xf2'),_0x65f6('0xf3')],'required':![]},{'model':db['Tag'],'as':_0x65f6('0xf4'),'attributes':['id',_0x65f6('0x2c'),'color'],'where':_0x4adb7a['query'][_0x65f6('0xf5')]?{'id':_0x4adb7a[_0x65f6('0x32')][_0x65f6('0xf5')]}:undefined,'required':_0x4adb7a['query'][_0x65f6('0xf5')]?!![]:![]}];}return db[_0x65f6('0xa6')][_0x65f6('0x5b')](_0x409127);})[_0x65f6('0x12')](function(_0xf29979){_0xd11998[_0x65f6('0x44')]=_0xf29979;return _0xd11998;});}})[_0x65f6('0x12')](respondWithFilteredResult(_0x492c89,_0x409127))['catch'](handleError(_0x492c89,null));};function iftimePromise(_0xacdf06,_0x58f7a8){return respondWithRpcPromise(_0x65f6('0xf6'),_0x65f6('0xf7'),{'command':_0x58f7a8[_0x65f6('0xf8')]?util[_0x65f6('0x9f')](_0x65f6('0xf9'),_0xacdf06[_0x65f6('0xfa')],_0x58f7a8['timezone']):util[_0x65f6('0x9f')]('iftime\x20%s',_0xacdf06[_0x65f6('0xfa')])},client9002)['then'](function(_0x32829e){var _0x5258a4=_0x32829e&&_0x32829e[_0x65f6('0xfb')](_0x65f6('0xfc'))>=0x0?!![]:![];logger[_0x65f6('0x13')](_0x65f6('0xfd'),_0x58f7a8['id'],_0xacdf06['id'],_0xacdf06['interval'],_0x5258a4?_0x65f6('0xfe'):_0x65f6('0xff'),_0x58f7a8[_0x65f6('0xf8')]?_0x58f7a8[_0x65f6('0xf8')]:_0x65f6('0x100'));return _0x5258a4;})[_0x65f6('0x1b')](function(_0xd06566){logger[_0x65f6('0x17')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x58f7a8['id'],_0xacdf06['id'],_0xacdf06['interval'],util[_0x65f6('0x101')](_0xd06566,{'showHidden':![],'depth':null}),_0x58f7a8[_0x65f6('0xf8')]?_0x58f7a8[_0x65f6('0xf8')]:_0x65f6('0x100'));return![];});}exports['getSnippet']=function(_0x1a25ae,_0x1e1498){var _0x4c63f9=0x0;var _0x13f4a5=0x0;var _0x4315c1=![];var _0x141d13;var _0x575f14;return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0x1a25ae['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x65f6('0x102')],'as':_0x65f6('0x103'),'attributes':['id',_0x65f6('0xfa')],'raw':!![]}]}]})[_0x65f6('0x12')](handleEntityNotFound(_0x1e1498,null))[_0x65f6('0x12')](function(_0x39bea9){if(_0x39bea9){_0x141d13=_0x39bea9;return _0x39bea9[_0x65f6('0x104')]({'raw':!![]});}})[_0x65f6('0x12')](function(_0x270944){if(_0x141d13){if(_0x270944){_0x575f14=_0x270944;}}return require(_0x65f6('0x105'))[_0x65f6('0x6a')]();})[_0x65f6('0x12')](function(_0x2a0aab){if(_0x2a0aab){_0x13f4a5=_0x2a0aab[_0x65f6('0x106')];_0x4315c1=_0x2a0aab[_0x65f6('0x107')];}})[_0x65f6('0x12')](function(){return db[_0x65f6('0xa6')][_0x65f6('0x20')]({'where':{'closed':![]}});})['then'](function(_0x4345af){_0x4c63f9=_0x4345af;if(_0x13f4a5&&_0x4345af>_0x13f4a5){return db[_0x65f6('0x108')]['findOne']({'where':{'id':0x1}})['then'](function(_0x23709a){if(_0x23709a){_0x23709a[_0x65f6('0x109')](_0x65f6('0x10a'));}});}})[_0x65f6('0x12')](function(){if(_0x141d13['Interval']&&_0x141d13['Interval'][_0x65f6('0x103')]){var _0x5dc205=[];for(var _0xd2313b=0x0;_0xd2313b<_0x141d13[_0x65f6('0x102')]['Intervals']['length'];_0xd2313b++){var _0x408e74=_0x141d13[_0x65f6('0x102')][_0x65f6('0x103')][_0xd2313b][_0x65f6('0x27')]({'plain':!![]});_0x5dc205['push'](iftimePromise(_0x408e74,_0x141d13));}return BPromise[_0x65f6('0x10b')](_0x5dc205)['then'](function(_0x34542c){return _[_0x65f6('0x10c')](_0x34542c);});}else{return!![];}})[_0x65f6('0x12')](function(_0x2ab4ac){var _0x4bc08e=fs[_0x65f6('0xc2')](path['join'](config[_0x65f6('0x68')],'server/files/chat/iframe.ejs'),'utf8');var _0x38de54={'remote':_0x141d13['remote'],'query':querystring[_0x65f6('0xa5')](_[_0x65f6('0x3f')](_0x141d13[_0x65f6('0x27')]({'plain':!![]}),{'customerIp':_0x1a25ae[_0x65f6('0x79')][_0x65f6('0x97')]||_0x1a25ae[_0x65f6('0x79')][_0x65f6('0x10d')]||_0x1a25ae[_0x65f6('0x10e')][_0x65f6('0x10f')]||_0x1a25ae['ip'],'referer':_0x1a25ae['headers'][_0x65f6('0x9c')],'openedInteractions':_0x4c63f9,'maxInteractions':_0x13f4a5,'virtual':_0x4315c1[_0x65f6('0x106')],'online':_0x2ab4ac,'custom':_0x4315c1}))[_0x65f6('0x110')](/'/g,'\x5c\x27')};_0x1e1498[_0x65f6('0xbb')](ejs['render'](Mustache[_0x65f6('0xc5')](_0x4bc08e,_0x38de54),{'proactiveActions':_0x575f14,'alignment':_0x141d13[_0x65f6('0x111')],'verticalAlignment':_0x141d13['verticalAlignment'],'div_color':_0x141d13[_0x65f6('0x112')],'labelText':_0x141d13[_0x65f6('0x113')],'text_color':_0x141d13[_0x65f6('0x114')],'button_color':_0x141d13[_0x65f6('0x115')],'background_color':_0x141d13[_0x65f6('0x116')]}));})[_0x65f6('0x1b')](handleError(_0x1e1498,null));};exports[_0x65f6('0x117')]=function(_0x112db7,_0x313634){var _0x1779de=_0x112db7[_0x65f6('0x46')]['id'];var _0x4b1ec2=_0x112db7[_0x65f6('0x52')];var _0x533902=0xc8;var _0x3bee71=null;return db['sequelize'][_0x65f6('0xd0')]({'isolationLevel':db[_0x65f6('0xcf')][_0x65f6('0x118')]['ISOLATION_LEVELS'][_0x65f6('0x119')]},function(_0x34ec6b){return db['ChatWebsite'][_0x65f6('0xd3')]({'where':{'id':_0x1779de},'transaction':_0x34ec6b})[_0x65f6('0x12')](function(_0xff9e69){if(_0xff9e69){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x1779de},'transaction':_0x34ec6b})['then'](function(){var _0x4eec1f=_[_0x65f6('0x2f')](_0x4b1ec2,function(_0x14417a){_0x14417a[_0x65f6('0x54')]=_0x1779de;return _0x14417a;});return db[_0x65f6('0x8d')][_0x65f6('0xd2')](_0x4eec1f,{'transaction':_0x34ec6b});});}else{_0x533902=0x194;_0x3bee71=[];}});})[_0x65f6('0x12')](function(){if(_0x533902!==0x194){return db[_0x65f6('0x8d')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x1779de},'order':_0x65f6('0x11a')})[_0x65f6('0x12')](function(_0x212333){_0x3bee71=_0x212333;});}})[_0x65f6('0x1b')](function(_0x4dbf35){_0x533902=0x1f4;logger[_0x65f6('0x17')](_0x4dbf35['stack']);if(_0x4dbf35[_0x65f6('0x2c')]){delete _0x4dbf35[_0x65f6('0x2c')];}_0x3bee71=_0x4dbf35;})['finally'](function(){if(_0x3bee71===null){_0x313634['sendStatus'](_0x533902);}else{if(_0x533902===0x1f4){_0x313634[_0x65f6('0x1d')](_0x533902)[_0x65f6('0xbb')](_0x3bee71);}else{_0x313634['status'](_0x533902)['json'](_0x3bee71);}}});};exports[_0x65f6('0x11b')]=function(_0x41ee46,_0xa54e78){var _0x31a57d={};var _0x3177f6={};var _0x142593;var _0x2d8fcc;return db[_0x65f6('0x42')][_0x65f6('0xd3')]({'where':{'id':_0x41ee46[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0xa54e78,null))[_0x65f6('0x12')](function(_0x1556ab){if(_0x1556ab){_0x142593=_0x1556ab;_0x3177f6[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0x8d')]['rawAttributes']);_0x3177f6['query']=_[_0x65f6('0x48')](_0x41ee46[_0x65f6('0x32')]);_0x3177f6[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x3177f6[_0x65f6('0x31')],_0x3177f6[_0x65f6('0x32')]);_0x31a57d[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x3177f6[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x41ee46['query'][_0x65f6('0x36')]));_0x31a57d['attributes']=_0x31a57d['attributes'][_0x65f6('0x37')]?_0x31a57d[_0x65f6('0x35')]:_0x3177f6[_0x65f6('0x31')];_0x31a57d[_0x65f6('0x3a')]=qs['sort'](_0x41ee46[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x31a57d[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x41ee46[_0x65f6('0x32')],_0x3177f6[_0x65f6('0x33')]));if(_0x41ee46[_0x65f6('0x32')][_0x65f6('0x3e')]){_0x31a57d[_0x65f6('0x3c')]=_['merge'](_0x31a57d['where'],{'$or':_[_0x65f6('0x2f')](_0x31a57d[_0x65f6('0x35')],function(_0x457fa8){var _0x15f247={};_0x15f247[_0x457fa8]={'$like':'%'+_0x41ee46[_0x65f6('0x32')][_0x65f6('0x3e')]+'%'};return _0x15f247;})});}_0x31a57d=_[_0x65f6('0x3f')]({},_0x31a57d,_0x41ee46[_0x65f6('0x41')]);return _0x142593['getApplications'](_0x31a57d);}})['then'](function(_0x1ebe7e){if(_0x1ebe7e){_0x2d8fcc=_0x1ebe7e[_0x65f6('0x37')];if(!_0x41ee46['query'][_0x65f6('0x38')](_0x65f6('0x39'))){_0x31a57d[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x41ee46[_0x65f6('0x32')][_0x65f6('0x1e')]);_0x31a57d['offset']=qs[_0x65f6('0x21')](_0x41ee46[_0x65f6('0x32')]['offset']);}return _0x142593['getApplications'](_0x31a57d);}})[_0x65f6('0x12')](function(_0x3743eb){if(_0x3743eb){return _0x3743eb?{'count':_0x2d8fcc,'rows':_0x3743eb}:null;}})[_0x65f6('0x12')](respondWithResult(_0xa54e78,null))[_0x65f6('0x1b')](handleError(_0xa54e78,null));};exports[_0x65f6('0x11c')]=function(_0x3dd349,_0x4c7b0a){return db['chatProactiveAction'][_0x65f6('0x4f')]({'where':{'id':_0x3dd349[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x4c7b0a,null))['then'](function(_0x25684b){if(_0x25684b){return _0x25684b[_0x65f6('0x11c')](_0x3dd349[_0x65f6('0x52')]['ids'],_[_0x65f6('0xee')](_0x3dd349[_0x65f6('0x52')],[_0x65f6('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x4c7b0a,null))[_0x65f6('0x1b')](handleError(_0x4c7b0a,null));};exports[_0x65f6('0x104')]=function(_0x1ad645,_0x3b062b){var _0x2c1a02={};var _0x15bdd2={};var _0x20fbe4;var _0x4316bc;return db[_0x65f6('0x42')][_0x65f6('0xd3')]({'where':{'id':_0x1ad645['params']['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x3b062b,null))['then'](function(_0x2086ce){if(_0x2086ce){_0x20fbe4=_0x2086ce;_0x15bdd2['model']=_['keys'](db[_0x65f6('0x11d')][_0x65f6('0x49')]);_0x15bdd2['query']=_[_0x65f6('0x48')](_0x1ad645[_0x65f6('0x32')]);_0x15bdd2[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x15bdd2[_0x65f6('0x31')],_0x15bdd2['query']);_0x2c1a02['attributes']=_['intersection'](_0x15bdd2[_0x65f6('0x31')],qs['fields'](_0x1ad645[_0x65f6('0x32')][_0x65f6('0x36')]));_0x2c1a02[_0x65f6('0x35')]=_0x2c1a02[_0x65f6('0x35')][_0x65f6('0x37')]?_0x2c1a02[_0x65f6('0x35')]:_0x15bdd2[_0x65f6('0x31')];_0x2c1a02['order']=qs['sort'](_0x1ad645['query'][_0x65f6('0x3b')]);_0x2c1a02[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x1ad645['query'],_0x15bdd2[_0x65f6('0x33')]));if(_0x1ad645['query']['filter']){_0x2c1a02[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x2c1a02['where'],{'$or':_[_0x65f6('0x2f')](_0x2c1a02[_0x65f6('0x35')],function(_0xb4e1c5){var _0x390553={};_0x390553[_0xb4e1c5]={'$like':'%'+_0x1ad645['query']['filter']+'%'};return _0x390553;})});}_0x2c1a02=_[_0x65f6('0x3f')]({},_0x2c1a02,_0x1ad645[_0x65f6('0x41')]);return _0x20fbe4['getProactiveActions'](_0x2c1a02);}})[_0x65f6('0x12')](function(_0x13ecb8){if(_0x13ecb8){_0x4316bc=_0x13ecb8[_0x65f6('0x37')];if(!_0x1ad645[_0x65f6('0x32')][_0x65f6('0x38')](_0x65f6('0x39'))){_0x2c1a02[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x1ad645[_0x65f6('0x32')]['limit']);_0x2c1a02[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x1ad645[_0x65f6('0x32')][_0x65f6('0x21')]);}return _0x20fbe4['getProactiveActions'](_0x2c1a02);}})['then'](function(_0x2c6cca){if(_0x2c6cca){return _0x2c6cca?{'count':_0x4316bc,'rows':_0x2c6cca}:null;}})['then'](respondWithResult(_0x3b062b,null))[_0x65f6('0x1b')](handleError(_0x3b062b,null));};exports[_0x65f6('0x11e')]=function(_0x3d46d4,_0xf51395){var _0x5b3abc=_0x3d46d4[_0x65f6('0x32')]['online']===_0x65f6('0x11f')?_0x65f6('0x120'):'onlineForm';return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'attributes':['id',_0x5b3abc],'where':{'id':_0x3d46d4[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0xf51395,null))[_0x65f6('0x12')](function(_0x9c768){if(_0x9c768){var _0x5b2cc1=_0x9c768[_0x5b3abc];var _0x62830b=_0x5b2cc1&&_0x5b2cc1['items']?_0x5b2cc1[_0x65f6('0x121')]:[];_0xf51395['send']({'fromKey':_[_0x65f6('0x6b')](_0x5b2cc1[_0x65f6('0x122')])?undefined:_0x5b2cc1['fromKey'],'count':_0x62830b[_0x65f6('0x37')],'rows':_0x62830b});}})[_0x65f6('0x1b')](handleError(_0xf51395,null));};exports['getOfflineMessages']=function(_0x42ad46,_0x4dd517){var _0x2dcf79={'raw':![],'where':{}};var _0x333da7={};var _0x10c466={'count':0x0,'rows':[]};return db[_0x65f6('0x42')][_0x65f6('0xd3')]({'where':{'id':_0x42ad46[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x4dd517,null))[_0x65f6('0x12')](function(_0x1c9d56){if(_0x1c9d56){_0x333da7[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0xc8')][_0x65f6('0x49')]);_0x333da7[_0x65f6('0x32')]=_[_0x65f6('0x48')](_0x42ad46[_0x65f6('0x32')]);_0x333da7['filters']=_[_0x65f6('0x34')](_0x333da7[_0x65f6('0x31')],_0x333da7['query']);_0x2dcf79[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x333da7[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x42ad46[_0x65f6('0x32')][_0x65f6('0x36')]));_0x2dcf79[_0x65f6('0x35')]=_0x2dcf79[_0x65f6('0x35')][_0x65f6('0x37')]?_0x2dcf79[_0x65f6('0x35')]:_0x333da7['model'];if(!_0x42ad46['query'][_0x65f6('0x38')](_0x65f6('0x39'))){_0x2dcf79['limit']=qs[_0x65f6('0x1e')](_0x42ad46[_0x65f6('0x32')][_0x65f6('0x1e')]);_0x2dcf79[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x42ad46['query']['offset']);}_0x2dcf79['order']=qs[_0x65f6('0x3b')](_0x42ad46[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x2dcf79[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_['pick'](_0x42ad46[_0x65f6('0x32')],_0x333da7['filters']));_0x2dcf79[_0x65f6('0x3c')][_0x65f6('0x54')]=_0x1c9d56['id'];if(_0x42ad46[_0x65f6('0x32')]['filter']){_0x2dcf79[_0x65f6('0x3c')]=_['merge'](_0x2dcf79[_0x65f6('0x3c')],{'$or':_[_0x65f6('0x2f')](_0x2dcf79['attributes'],function(_0x230125){var _0xe75255={};_0xe75255[_0x230125]={'$like':'%'+_0x42ad46['query'][_0x65f6('0x3e')]+'%'};return _0xe75255;})});}_0x2dcf79=_[_0x65f6('0x3f')]({},_0x2dcf79,_0x42ad46[_0x65f6('0x41')]);return db[_0x65f6('0xc8')][_0x65f6('0x20')]({'where':_0x2dcf79['where']})[_0x65f6('0x12')](function(_0x4416b4){_0x10c466['count']=_0x4416b4;if(_0x42ad46[_0x65f6('0x32')][_0x65f6('0x4a')]){_0x2dcf79['include']=[{'all':!![]}];}else{_0x2dcf79['include']=[{'model':db[_0x65f6('0x7c')],'as':'Contact','required':![]},{'model':db[_0x65f6('0xd1')],'as':_0x65f6('0x123'),'required':![]}];}return db[_0x65f6('0xc8')][_0x65f6('0x5b')](_0x2dcf79);})[_0x65f6('0x12')](function(_0x2e36c8){_0x10c466[_0x65f6('0x44')]=_0x2e36c8;return _0x10c466;});}})[_0x65f6('0x12')](respondWithFilteredResult(_0x4dd517,_0x2dcf79))[_0x65f6('0x1b')](handleError(_0x4dd517,null));};exports[_0x65f6('0x124')]=function(_0x52556c,_0x4665ec){return db['ChatWebsite'][_0x65f6('0x4f')]({'where':{'id':_0x52556c[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x4665ec,null))[_0x65f6('0x12')](function(_0x57c109){if(_0x57c109){return _0x57c109['addAgents'](_0x52556c[_0x65f6('0x52')][_0x65f6('0x5d')],_[_0x65f6('0xee')](_0x52556c[_0x65f6('0x52')],[_0x65f6('0x5d'),'id'])||{})[_0x65f6('0xab')](function(_0x5052d0){for(var _0x5dcfb7=0x0;_0x5dcfb7<_0x52556c[_0x65f6('0x52')]['ids'][_0x65f6('0x37')];_0x5dcfb7+=0x1){socket[_0x65f6('0x125')](_0x65f6('0x126'),{'UserId':Number(_0x52556c[_0x65f6('0x52')][_0x65f6('0x5d')][_0x5dcfb7]),'ChatWebsiteId':Number(_0x52556c['params']['id'])});}return _0x5052d0;});}})[_0x65f6('0x12')](respondWithResult(_0x4665ec,null))['catch'](handleError(_0x4665ec,null));};exports[_0x65f6('0x127')]=function(_0xab6058,_0x57d25c){return db[_0x65f6('0x42')][_0x65f6('0x4f')]({'where':{'id':_0xab6058[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x57d25c,null))['then'](function(_0x402a5e){if(_0x402a5e){return _0x402a5e[_0x65f6('0x127')](_0xab6058[_0x65f6('0x32')]['ids'])[_0x65f6('0x12')](function(){if(_[_0x65f6('0x128')](_0xab6058[_0x65f6('0x32')][_0x65f6('0x5d')])){for(var _0x146686=0x0;_0x146686<_0xab6058[_0x65f6('0x32')][_0x65f6('0x5d')][_0x65f6('0x37')];_0x146686+=0x1){socket[_0x65f6('0x125')]('userChatWebsite:remove',{'UserId':Number(_0xab6058[_0x65f6('0x32')][_0x65f6('0x5d')][_0x146686]),'ChatWebsiteId':Number(_0xab6058[_0x65f6('0x46')]['id'])});}}else{socket[_0x65f6('0x125')](_0x65f6('0x129'),{'UserId':Number(_0xab6058[_0x65f6('0x32')][_0x65f6('0x5d')]),'ChatWebsiteId':Number(_0xab6058[_0x65f6('0x46')]['id'])});}});}})[_0x65f6('0x12')](respondWithStatusCode(_0x57d25c,null))[_0x65f6('0x1b')](handleError(_0x57d25c,null));};exports[_0x65f6('0x12a')]=function(_0x9d31a8,_0x56a917){var _0x5bc949={};var _0xcecebe={};var _0xbf5cba;var _0xfbd390;return db[_0x65f6('0x42')]['findOne']({'where':{'id':_0x9d31a8[_0x65f6('0x46')]['id']}})[_0x65f6('0x12')](handleEntityNotFound(_0x56a917,null))[_0x65f6('0x12')](function(_0x5bba5b){if(_0x5bba5b){_0xbf5cba=_0x5bba5b;_0xcecebe[_0x65f6('0x31')]=_[_0x65f6('0x48')](db[_0x65f6('0xb2')][_0x65f6('0x49')]);_0xcecebe[_0x65f6('0x32')]=_['keys'](_0x9d31a8['query']);_0xcecebe['filters']=_[_0x65f6('0x34')](_0xcecebe[_0x65f6('0x31')],_0xcecebe[_0x65f6('0x32')]);_0x5bc949[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0xcecebe[_0x65f6('0x31')],qs[_0x65f6('0x36')](_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x36')]));_0x5bc949['attributes']=_0x5bc949[_0x65f6('0x35')][_0x65f6('0x37')]?_0x5bc949['attributes']:_0xcecebe['model'];_0x5bc949[_0x65f6('0x3a')]=qs['sort'](_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x3b')]);_0x5bc949[_0x65f6('0x3c')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3d')](_0x9d31a8[_0x65f6('0x32')],_0xcecebe[_0x65f6('0x33')]));if(_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x3e')]){_0x5bc949[_0x65f6('0x3c')]=_[_0x65f6('0x3f')](_0x5bc949[_0x65f6('0x3c')],{'$or':_[_0x65f6('0x2f')](_0x5bc949[_0x65f6('0x35')],function(_0x4e5800){var _0x35934d={};_0x35934d[_0x4e5800]={'$like':'%'+_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x3e')]+'%'};return _0x35934d;})});}_0x5bc949=_[_0x65f6('0x3f')]({},_0x5bc949,_0x9d31a8[_0x65f6('0x41')]);return _0xbf5cba[_0x65f6('0x12a')](_0x5bc949);}})['then'](function(_0x309659){if(_0x309659){_0xfbd390=_0x309659['length'];if(!_0x9d31a8[_0x65f6('0x32')][_0x65f6('0x38')](_0x65f6('0x39'))){_0x5bc949[_0x65f6('0x1e')]=qs[_0x65f6('0x1e')](_0x9d31a8[_0x65f6('0x32')]['limit']);_0x5bc949[_0x65f6('0x21')]=qs[_0x65f6('0x21')](_0x9d31a8[_0x65f6('0x32')]['offset']);}return _0xbf5cba[_0x65f6('0x12a')](_0x5bc949);}})[_0x65f6('0x12')](function(_0x227065){if(_0x227065){return _0x227065?{'count':_0xfbd390,'rows':_0x227065}:null;}})['then'](respondWithResult(_0x56a917,null))[_0x65f6('0x1b')](handleError(_0x56a917,null));}; \ No newline at end of file +var _0xbaf0=['userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getDispositions','findOne','Disposition','findAll','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','length','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','DESC','Applications','List','account','applications','list','orderBy','priority','asc','ListId','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','browser','format','%s\x20%s','version','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','Contact','Owner','fullname','internal','Tags','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','push','all','server/files/chat/iframe.ejs','remote','referer','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','finally','getApplications','chatProactiveAction','addProactiveActions','omit','getFields','online','false','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents'];(function(_0x8917ca,_0x492285){var _0x218c97=function(_0x4b4e88){while(--_0x4b4e88){_0x8917ca['push'](_0x8917ca['shift']());}};_0x218c97(++_0x492285);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x0baf('0x0'));var util=require(_0x0baf('0x1'));var path=require(_0x0baf('0x2'));var ejs=require(_0x0baf('0x3'));var fs=require('fs');var fs_extra=require(_0x0baf('0x4'));var _=require(_0x0baf('0x5'));var querystring=require('querystring');var Redis=require(_0x0baf('0x6'));var qs=require(_0x0baf('0x7'));var logger=require(_0x0baf('0x8'))(_0x0baf('0x9'));var config=require(_0x0baf('0xa'));var db=require(_0x0baf('0xb'))['db'];config[_0x0baf('0xc')]=_[_0x0baf('0xd')](config[_0x0baf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0xe'))(new Redis(config['redis']));require(_0x0baf('0xf'))[_0x0baf('0x10')](socket);var htmlToText=require(_0x0baf('0x11'));var jayson=require(_0x0baf('0x12'));var client=jayson[_0x0baf('0x13')][_0x0baf('0x14')]({'port':0x232c});var client9002=jayson[_0x0baf('0x13')][_0x0baf('0x14')]({'port':0x232a});var client9003=jayson[_0x0baf('0x13')][_0x0baf('0x14')]({'port':0x232b});var client9001=jayson[_0x0baf('0x13')]['http']({'port':0x2329});function respondWithRpcPromise(_0x5a53e2,_0x465dd7,_0xe4378c,_0x5db689){return new BPromise(function(_0x13df17,_0x5a0583){var _0x2ab33e=_0x5db689||client;return _0x2ab33e['request'](_0x5a53e2,_0xe4378c)[_0x0baf('0x15')](function(_0x1f50c3){logger[_0x0baf('0x16')](_0x0baf('0x17'),_0x465dd7,_0x0baf('0x18'));logger[_0x0baf('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x465dd7,'request\x20sent',JSON[_0x0baf('0x1a')](_0x1f50c3));if(_0x1f50c3[_0x0baf('0x1b')]){if(_0x1f50c3[_0x0baf('0x1b')][_0x0baf('0x1c')]===0x1f4){logger[_0x0baf('0x1b')](_0x0baf('0x17'),_0x465dd7,_0x1f50c3['error'][_0x0baf('0x1d')]);return _0x5a0583(_0x1f50c3[_0x0baf('0x1b')][_0x0baf('0x1d')]);}logger[_0x0baf('0x1b')](_0x0baf('0x17'),_0x465dd7,_0x1f50c3[_0x0baf('0x1b')]['message']);return _0x13df17(_0x1f50c3['error'][_0x0baf('0x1d')]);}else{logger[_0x0baf('0x16')](_0x0baf('0x17'),_0x465dd7,_0x0baf('0x18'));_0x13df17(_0x1f50c3[_0x0baf('0x1e')][_0x0baf('0x1d')]);}})[_0x0baf('0x1f')](function(_0x636a13){logger[_0x0baf('0x1b')](_0x0baf('0x17'),_0x465dd7,_0x636a13);_0x5a0583(_0x636a13);});});}function respondWithStatusCode(_0x54f2fa,_0x334bd6){_0x334bd6=_0x334bd6||0xcc;return function(_0x482522){if(_0x482522){return _0x54f2fa[_0x0baf('0x20')](_0x334bd6);}return _0x54f2fa['status'](_0x334bd6)['end']();};}function respondWithResult(_0x2ef0aa,_0x48a0e9){_0x48a0e9=_0x48a0e9||0xc8;return function(_0x4be1b9){if(_0x4be1b9){return _0x2ef0aa[_0x0baf('0x21')](_0x48a0e9)[_0x0baf('0x22')](_0x4be1b9);}};}function respondWithFilteredResult(_0x34e264,_0x19d9fd){return function(_0x3a1ba1){if(_0x3a1ba1){var _0x56b299=typeof _0x19d9fd[_0x0baf('0x23')]===_0x0baf('0x24')&&typeof _0x19d9fd[_0x0baf('0x25')]===_0x0baf('0x24');var _0x3843b8=_0x3a1ba1[_0x0baf('0x26')];var _0x453525=_0x56b299?0x0:_0x19d9fd['offset'];var _0x1590b4=_0x56b299?_0x3a1ba1[_0x0baf('0x26')]:_0x19d9fd[_0x0baf('0x23')]+_0x19d9fd[_0x0baf('0x25')];var _0x55c715;if(_0x1590b4>=_0x3843b8){_0x1590b4=_0x3843b8;_0x55c715=0xc8;}else{_0x55c715=0xce;}_0x34e264[_0x0baf('0x21')](_0x55c715);return _0x34e264[_0x0baf('0x27')]('Content-Range',_0x453525+'-'+_0x1590b4+'/'+_0x3843b8)[_0x0baf('0x22')](_0x3a1ba1);}return null;};}function saveUpdates(_0x32e4fb){return function(_0x478ce8){if(_0x478ce8){return _0x478ce8[_0x0baf('0x28')](_0x32e4fb)[_0x0baf('0x15')](function(_0x366924){return _0x366924;});}return null;};}function removeEntity(_0x213a6a){return function(_0x57476f){if(_0x57476f){return _0x57476f[_0x0baf('0x29')]()[_0x0baf('0x15')](function(){var _0x37be4e=_0x57476f[_0x0baf('0x2a')]({'plain':!![]});var _0x24ecee=_0x0baf('0x2b');return db[_0x0baf('0x2c')][_0x0baf('0x29')]({'where':{'type':_0x24ecee,'resourceId':_0x37be4e['id']}})[_0x0baf('0x15')](function(){return _0x57476f;});})[_0x0baf('0x15')](function(){_0x213a6a[_0x0baf('0x21')](0xcc)[_0x0baf('0x2d')]();});}};}function handleEntityNotFound(_0x45294a){return function(_0x3a3353){if(!_0x3a3353){_0x45294a['sendStatus'](0x194);}return _0x3a3353;};}function handleError(_0x2fd426,_0x53ae1d){_0x53ae1d=_0x53ae1d||0x1f4;return function(_0x1aa474){logger[_0x0baf('0x1b')](_0x1aa474[_0x0baf('0x2e')]);if(_0x1aa474[_0x0baf('0x2f')]){delete _0x1aa474['name'];}_0x2fd426[_0x0baf('0x21')](_0x53ae1d)[_0x0baf('0x30')](_0x1aa474);};}exports['index']=function(_0x23d890,_0x2447c2){var _0x62a2ed={'include':[{'model':db[_0x0baf('0x31')],'as':_0x0baf('0x32')}]},_0xbaa9a7={},_0x1f60bd={'count':0x0,'rows':[]};var _0x675461=_['map'](db[_0x0baf('0x33')][_0x0baf('0x34')],function(_0x5b991f){return{'name':_0x5b991f[_0x0baf('0x35')],'type':_0x5b991f['type']['key']};});_0xbaa9a7[_0x0baf('0x36')]=_[_0x0baf('0x37')](_0x675461,'name');_0xbaa9a7['query']=_[_0x0baf('0x38')](_0x23d890[_0x0baf('0x39')]);_0xbaa9a7[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0xbaa9a7[_0x0baf('0x36')],_0xbaa9a7[_0x0baf('0x39')]);_0x62a2ed[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0xbaa9a7[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x23d890[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x62a2ed[_0x0baf('0x3c')]=_0x62a2ed[_0x0baf('0x3c')]['length']?_0x62a2ed[_0x0baf('0x3c')]:_0xbaa9a7[_0x0baf('0x36')];if(!_0x23d890['query'][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0x62a2ed[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x23d890[_0x0baf('0x39')][_0x0baf('0x25')]);_0x62a2ed['offset']=qs[_0x0baf('0x23')](_0x23d890[_0x0baf('0x39')]['offset']);}_0x62a2ed[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x23d890[_0x0baf('0x39')][_0x0baf('0x41')]);_0x62a2ed['where']=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x23d890[_0x0baf('0x39')],_0xbaa9a7[_0x0baf('0x3a')]),_0x675461);if(_0x23d890[_0x0baf('0x39')][_0x0baf('0x43')]){_0x62a2ed[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x62a2ed[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x675461,function(_0x56270e){if(_0x56270e[_0x0baf('0x46')]!==_0x0baf('0x47')){var _0x1daf1d={};_0x1daf1d[_0x56270e[_0x0baf('0x2f')]]={'$like':'%'+_0x23d890[_0x0baf('0x39')]['filter']+'%'};return _0x1daf1d;}})});}_0x62a2ed=_[_0x0baf('0x45')]({},_0x62a2ed,_0x23d890[_0x0baf('0x48')]);var _0x27c3ee={'where':_0x62a2ed[_0x0baf('0x44')]};return db[_0x0baf('0x33')]['count'](_0x27c3ee)[_0x0baf('0x15')](function(_0x85bedb){_0x1f60bd[_0x0baf('0x26')]=_0x85bedb;if(_0x23d890[_0x0baf('0x39')][_0x0baf('0x49')]){_0x62a2ed[_0x0baf('0x4a')]=[{'all':!![]}];}return db[_0x0baf('0x33')]['findAll'](_0x62a2ed);})[_0x0baf('0x15')](function(_0x167fb8){_0x1f60bd[_0x0baf('0x4b')]=_0x167fb8;return _0x1f60bd;})['then'](respondWithFilteredResult(_0x2447c2,_0x62a2ed))[_0x0baf('0x1f')](handleError(_0x2447c2,null));};exports[_0x0baf('0x4c')]=function(_0x10fa62,_0x3fabec){var _0x204d77={'raw':![],'where':{'id':_0x10fa62[_0x0baf('0x4d')]['id']},'include':[{'model':db['Pause'],'as':_0x0baf('0x32')}]},_0x1b71a3={};_0x1b71a3[_0x0baf('0x36')]=_[_0x0baf('0x38')](db[_0x0baf('0x33')][_0x0baf('0x34')]);_0x1b71a3[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x10fa62[_0x0baf('0x39')]);_0x1b71a3[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x1b71a3[_0x0baf('0x36')],_0x1b71a3['query']);_0x204d77['attributes']=_[_0x0baf('0x3b')](_0x1b71a3[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x10fa62[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x204d77[_0x0baf('0x3c')]=_0x204d77[_0x0baf('0x3c')]['length']?_0x204d77[_0x0baf('0x3c')]:_0x1b71a3[_0x0baf('0x36')];if(_0x10fa62[_0x0baf('0x39')][_0x0baf('0x49')]){_0x204d77[_0x0baf('0x4a')]=[{'all':!![]}];}_0x204d77=_[_0x0baf('0x45')]({},_0x204d77,_0x10fa62['options']);return db[_0x0baf('0x33')]['find'](_0x204d77)[_0x0baf('0x15')](handleEntityNotFound(_0x3fabec,null))['then'](respondWithResult(_0x3fabec,null))[_0x0baf('0x1f')](handleError(_0x3fabec,null));};exports['create']=function(_0x35b1a5,_0x4c035b){return db[_0x0baf('0x33')][_0x0baf('0x4e')](_0x35b1a5[_0x0baf('0x4f')],{})[_0x0baf('0x15')](function(_0x42a68b){var _0x576475=_0x35b1a5[_0x0baf('0x50')][_0x0baf('0x2a')]({'plain':!![]});if(!_0x576475)throw new Error(_0x0baf('0x51'));if(_0x576475[_0x0baf('0x52')]===_0x0baf('0x50')){var _0xa19b21=_0x42a68b['get']({'plain':!![]});var _0x402f4d=_0x0baf('0x2b');return db[_0x0baf('0x53')][_0x0baf('0x54')]({'where':{'name':_0x402f4d,'userProfileId':_0x576475[_0x0baf('0x55')]},'raw':!![]})[_0x0baf('0x15')](function(_0x3834a2){if(_0x3834a2&&_0x3834a2['autoAssociation']===0x0){return db['UserProfileResource'][_0x0baf('0x4e')]({'name':_0xa19b21[_0x0baf('0x2f')],'resourceId':_0xa19b21['id'],'type':_0x3834a2[_0x0baf('0x2f')],'sectionId':_0x3834a2['id']},{})[_0x0baf('0x15')](function(){return _0x42a68b;});}else{return _0x42a68b;}})[_0x0baf('0x1f')](function(_0x35221e){logger[_0x0baf('0x1b')](_0x0baf('0x56'),_0x35221e);throw _0x35221e;});}return _0x42a68b;})[_0x0baf('0x15')](respondWithResult(_0x4c035b,0xc9))['catch'](handleError(_0x4c035b,null));};exports[_0x0baf('0x28')]=function(_0x268be8,_0x3c2d03){if(_0x268be8[_0x0baf('0x4f')]['id']){delete _0x268be8[_0x0baf('0x4f')]['id'];}return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x268be8['params']['id']},'include':[{'model':db[_0x0baf('0x31')],'as':_0x0baf('0x32')}]})[_0x0baf('0x15')](handleEntityNotFound(_0x3c2d03,null))[_0x0baf('0x15')](saveUpdates(_0x268be8[_0x0baf('0x4f')],null))[_0x0baf('0x15')](respondWithResult(_0x3c2d03,null))[_0x0baf('0x1f')](handleError(_0x3c2d03,null));};exports[_0x0baf('0x29')]=function(_0x498405,_0x178495){return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x498405['params']['id']}})['then'](handleEntityNotFound(_0x178495,null))[_0x0baf('0x15')](removeEntity(_0x178495,null))['catch'](handleError(_0x178495,null));};exports[_0x0baf('0x57')]=function(_0x2b17f8,_0x49d713){return db[_0x0baf('0x33')][_0x0baf('0x57')]()[_0x0baf('0x15')](respondWithResult(_0x49d713,null))['catch'](handleError(_0x49d713,null));};exports['addDisposition']=function(_0x2438df,_0x7e8946){if(_0x2438df[_0x0baf('0x4f')]['id']){delete _0x2438df[_0x0baf('0x4f')]['id'];}return db[_0x0baf('0x33')]['find']({'where':{'id':_0x2438df[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x7e8946,null))['then'](function(_0x59a0b2){if(_0x59a0b2){_0x2438df[_0x0baf('0x4f')]['ChatWebsiteId']=_0x59a0b2['id'];return db['Disposition'][_0x0baf('0x4e')](_0x2438df[_0x0baf('0x4f')]);}})[_0x0baf('0x15')](respondWithResult(_0x7e8946,null))[_0x0baf('0x1f')](handleError(_0x7e8946,null));};exports[_0x0baf('0x58')]=function(_0x27ddc7,_0x4c05d6){var _0xec3b32={'raw':![],'where':{}};var _0x1a0a67={};var _0x185473={'count':0x0,'rows':[]};return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x27ddc7[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4c05d6,null))[_0x0baf('0x15')](function(_0x468363){if(_0x468363){_0x1a0a67[_0x0baf('0x36')]=_['keys'](db[_0x0baf('0x5a')][_0x0baf('0x34')]);_0x1a0a67[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x27ddc7[_0x0baf('0x39')]);_0x1a0a67[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x1a0a67['model'],_0x1a0a67['query']);_0xec3b32['attributes']=_[_0x0baf('0x3b')](_0x1a0a67[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x3d')]));_0xec3b32[_0x0baf('0x3c')]=_0xec3b32['attributes']['length']?_0xec3b32[_0x0baf('0x3c')]:_0x1a0a67['model'];if(!_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x3e')]('nolimit')){_0xec3b32[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x25')]);_0xec3b32[_0x0baf('0x23')]=qs[_0x0baf('0x23')](_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x23')]);}_0xec3b32[_0x0baf('0x40')]=qs['sort'](_0x27ddc7['query']['sort']);_0xec3b32['where']=qs['filters'](_[_0x0baf('0x42')](_0x27ddc7[_0x0baf('0x39')],_0x1a0a67[_0x0baf('0x3a')]));_0xec3b32[_0x0baf('0x44')]['ChatWebsiteId']=_0x468363['id'];if(_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x43')]){_0xec3b32['where']=_['merge'](_0xec3b32[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0xec3b32[_0x0baf('0x3c')],function(_0x442e5f){var _0x30b35e={};_0x30b35e[_0x442e5f]={'$like':'%'+_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x43')]+'%'};return _0x30b35e;})});}_0xec3b32=_[_0x0baf('0x45')]({},_0xec3b32,_0x27ddc7['options']);return db[_0x0baf('0x5a')][_0x0baf('0x26')]({'where':_0xec3b32['where']})[_0x0baf('0x15')](function(_0x2db4ec){_0x185473['count']=_0x2db4ec;if(_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x49')]){_0xec3b32[_0x0baf('0x4a')]=[{'all':!![]}];}return db[_0x0baf('0x5a')][_0x0baf('0x5b')](_0xec3b32);})['then'](function(_0x4807fc){_0x185473[_0x0baf('0x4b')]=_0x4807fc;return _0x185473;});}})[_0x0baf('0x15')](respondWithFilteredResult(_0x4c05d6,_0xec3b32))['catch'](handleError(_0x4c05d6,null));};exports[_0x0baf('0x5c')]=function(_0x59dad5,_0x21ad25){return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x59dad5[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x21ad25,null))['then'](function(_0x3c2bc1){if(_0x3c2bc1){return _0x3c2bc1['removeDispositions'](_0x59dad5[_0x0baf('0x39')][_0x0baf('0x5d')]);}})[_0x0baf('0x15')](respondWithStatusCode(_0x21ad25,null))[_0x0baf('0x1f')](handleError(_0x21ad25,null));};exports[_0x0baf('0x5e')]=function(_0x52e845,_0x866e6e){if(_0x52e845[_0x0baf('0x4f')]['id']){delete _0x52e845['body']['id'];}return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x52e845[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x866e6e,null))[_0x0baf('0x15')](function(_0x250df2){if(_0x250df2){_0x52e845[_0x0baf('0x4f')][_0x0baf('0x5f')]=_0x250df2['id'];return db[_0x0baf('0x60')][_0x0baf('0x4e')](_0x52e845[_0x0baf('0x4f')]);}})[_0x0baf('0x15')](respondWithResult(_0x866e6e,null))['catch'](handleError(_0x866e6e,null));};exports['getAnswers']=function(_0x29a036,_0x322a09){var _0x384c29={'raw':![],'where':{}};var _0x52f267={};var _0x507783={'count':0x0,'rows':[]};return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x29a036[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x322a09,null))[_0x0baf('0x15')](function(_0x3033c8){if(_0x3033c8){_0x52f267[_0x0baf('0x36')]=_[_0x0baf('0x38')](db[_0x0baf('0x60')]['rawAttributes']);_0x52f267[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x29a036[_0x0baf('0x39')]);_0x52f267[_0x0baf('0x3a')]=_['intersection'](_0x52f267['model'],_0x52f267['query']);_0x384c29[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0x52f267['model'],qs['fields'](_0x29a036[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x384c29['attributes']=_0x384c29[_0x0baf('0x3c')][_0x0baf('0x61')]?_0x384c29[_0x0baf('0x3c')]:_0x52f267[_0x0baf('0x36')];if(!_0x29a036[_0x0baf('0x39')][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0x384c29[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x29a036[_0x0baf('0x39')][_0x0baf('0x25')]);_0x384c29[_0x0baf('0x23')]=qs['offset'](_0x29a036[_0x0baf('0x39')][_0x0baf('0x23')]);}_0x384c29[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x29a036[_0x0baf('0x39')][_0x0baf('0x41')]);_0x384c29['where']=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x29a036[_0x0baf('0x39')],_0x52f267[_0x0baf('0x3a')]));_0x384c29[_0x0baf('0x44')]['ChatWebsiteId']=_0x3033c8['id'];if(_0x29a036[_0x0baf('0x39')][_0x0baf('0x43')]){_0x384c29[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x384c29[_0x0baf('0x44')],{'$or':_['map'](_0x384c29['attributes'],function(_0xb5f4e5){var _0x5a2454={};_0x5a2454[_0xb5f4e5]={'$like':'%'+_0x29a036[_0x0baf('0x39')]['filter']+'%'};return _0x5a2454;})});}_0x384c29=_[_0x0baf('0x45')]({},_0x384c29,_0x29a036[_0x0baf('0x48')]);return db[_0x0baf('0x60')][_0x0baf('0x26')]({'where':_0x384c29['where']})[_0x0baf('0x15')](function(_0x106ffa){_0x507783[_0x0baf('0x26')]=_0x106ffa;if(_0x29a036['query']['includeAll']){_0x384c29['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x0baf('0x5b')](_0x384c29);})[_0x0baf('0x15')](function(_0x2b7f13){_0x507783[_0x0baf('0x4b')]=_0x2b7f13;return _0x507783;});}})['then'](respondWithFilteredResult(_0x322a09,_0x384c29))[_0x0baf('0x1f')](handleError(_0x322a09,null));};exports[_0x0baf('0x62')]=function(_0x1843eb,_0x4b4ef8){return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x1843eb['params']['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x4b4ef8,null))['then'](function(_0x8a0a1b){if(_0x8a0a1b){return _0x8a0a1b[_0x0baf('0x62')](_0x1843eb[_0x0baf('0x39')][_0x0baf('0x5d')]);}})['then'](respondWithStatusCode(_0x4b4ef8,null))['catch'](handleError(_0x4b4ef8,null));};exports[_0x0baf('0x63')]=function(_0x4e1a7e,_0x3b4ae3){_0x4e1a7e[_0x0baf('0x4f')][_0x0baf('0x64')]=_0x4e1a7e[_0x0baf('0x65')][_0x0baf('0x66')];return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x4e1a7e['params']['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x3b4ae3,null))['then'](saveUpdates(_0x4e1a7e[_0x0baf('0x4f')],null))['then'](respondWithResult(_0x3b4ae3,null))[_0x0baf('0x1f')](handleError(_0x3b4ae3,null));};exports[_0x0baf('0x67')]=function(_0x443f62,_0x5033f3){_0x443f62['body'][_0x0baf('0x68')]=_0x443f62[_0x0baf('0x65')][_0x0baf('0x66')];return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x443f62[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5033f3,null))[_0x0baf('0x15')](saveUpdates(_0x443f62['body'],null))[_0x0baf('0x15')](respondWithResult(_0x5033f3,null))['catch'](handleError(_0x5033f3,null));};exports[_0x0baf('0x69')]=function(_0x4df797,_0x30f32b){_0x4df797['body'][_0x0baf('0x6a')]=_0x4df797[_0x0baf('0x65')]['filename'];return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x4df797[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x30f32b,null))[_0x0baf('0x15')](saveUpdates(_0x4df797['body'],null))['then'](respondWithResult(_0x30f32b,null))[_0x0baf('0x1f')](handleError(_0x30f32b,null));};exports[_0x0baf('0x6b')]=function(_0x116d52,_0x2c7417){_0x116d52[_0x0baf('0x4f')][_0x0baf('0x6c')]=_0x116d52[_0x0baf('0x65')][_0x0baf('0x66')];return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x116d52['params']['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x2c7417,null))['then'](saveUpdates(_0x116d52[_0x0baf('0x4f')],null))[_0x0baf('0x15')](respondWithResult(_0x2c7417,null))[_0x0baf('0x1f')](handleError(_0x2c7417,null));};exports[_0x0baf('0x6d')]=function(_0x4d7d29,_0x227fbd){var _0x647233=path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x70'));var _0x2c2b77={'where':{'id':_0x4d7d29[_0x0baf('0x4d')]['id']},'attributes':['id',_0x0baf('0x64')],'raw':!![]};var _0xb61593=![];return require('../../config/license/util')[_0x0baf('0x71')]()[_0x0baf('0x15')](function(_0x4d501e){if(_0x4d501e){_0xb61593=_0x4d501e[_0x0baf('0x72')];}})[_0x0baf('0x15')](function(){return db[_0x0baf('0x33')][_0x0baf('0x54')](_0x2c2b77);})[_0x0baf('0x15')](handleEntityNotFound(_0x227fbd,null))[_0x0baf('0x15')](function(_0x3c5654){if(_0x3c5654){if(!_[_0x0baf('0x73')](_0x3c5654[_0x0baf('0x64')])){if(fs['existsSync'](path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x74'),_0x3c5654[_0x0baf('0x64')]))&&_0xb61593){_0x647233=path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],'server/files/images/logos/',_0x3c5654[_0x0baf('0x64')]);}}return _0x227fbd[_0x0baf('0x75')](_0x647233);}})[_0x0baf('0x1f')](handleError(_0x227fbd,null));};exports['getAvatar']=function(_0x49855a,_0x5adbd9){var _0x1adb84=path[_0x0baf('0x6e')](config['root'],_0x0baf('0x76'));var _0x577536={'where':{'id':_0x49855a[_0x0baf('0x4d')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x0baf('0x33')][_0x0baf('0x54')](_0x577536)['then'](handleEntityNotFound(_0x5adbd9,null))[_0x0baf('0x15')](function(_0x290686){if(_0x290686){if(!_[_0x0baf('0x73')](_0x290686[_0x0baf('0x68')])){if(fs[_0x0baf('0x77')](path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],'server/files/images/avatars/',_0x290686[_0x0baf('0x68')]))){_0x1adb84=path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x78'),_0x290686[_0x0baf('0x68')]);}}return _0x5adbd9[_0x0baf('0x75')](_0x1adb84);}})[_0x0baf('0x1f')](handleError(_0x5adbd9,null));};exports[_0x0baf('0x79')]=function(_0x4415c2,_0x46103a){var _0x308b3f=path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x7a'));var _0x59dd6c={'where':{'id':_0x4415c2['params']['id']},'attributes':['id',_0x0baf('0x6a'),_0x0baf('0x7b')],'raw':!![]};return db[_0x0baf('0x33')][_0x0baf('0x54')](_0x59dd6c)['then'](handleEntityNotFound(_0x46103a,null))[_0x0baf('0x15')](function(_0xc6c049){if(_0xc6c049){if(!_[_0x0baf('0x73')](_0xc6c049[_0x0baf('0x6a')])){if(fs[_0x0baf('0x77')](path[_0x0baf('0x6e')](config['root'],_0x0baf('0x78'),_0xc6c049[_0x0baf('0x6a')]))&&_0xc6c049[_0x0baf('0x7b')]){_0x308b3f=path['join'](config[_0x0baf('0x6f')],_0x0baf('0x78'),_0xc6c049[_0x0baf('0x6a')]);}}return _0x46103a['download'](_0x308b3f);}})['catch'](handleError(_0x46103a,null));};exports['getSystemAvatar']=function(_0x11a85a,_0x51c895){var _0x2f0104=path[_0x0baf('0x6e')](config['root'],_0x0baf('0x7c'));var _0x5b5cd5={'where':{'id':_0x11a85a['params']['id']},'attributes':['id',_0x0baf('0x6c')],'raw':!![]};return db['ChatWebsite'][_0x0baf('0x54')](_0x5b5cd5)['then'](handleEntityNotFound(_0x51c895,null))['then'](function(_0x56c377){if(_0x56c377){if(!_[_0x0baf('0x73')](_0x56c377[_0x0baf('0x6c')])){if(fs[_0x0baf('0x77')](path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x78'),_0x56c377[_0x0baf('0x6c')]))){_0x2f0104=path['join'](config[_0x0baf('0x6f')],_0x0baf('0x78'),_0x56c377[_0x0baf('0x6c')]);}}return _0x51c895['download'](_0x2f0104);}})[_0x0baf('0x1f')](handleError(_0x51c895,null));};exports[_0x0baf('0x7d')]=function(_0x12311d,_0x52c7f7){var _0x25eccd=require('user-agent-parser');var _0x235bd5=new _0x25eccd();var _0x12ff07=_0x235bd5['setUA'](_0x12311d[_0x0baf('0x7e')][_0x0baf('0x7f')])[_0x0baf('0x80')]();var _0x1805ff={'body':_0x12311d['body'],'channel':_0x0baf('0x81')};var _0x39eb13=[];var _0x4d4eab=[];var _0x5054f9={};var _0x1ac8eb=![];return db[_0x0baf('0x82')][_0x0baf('0x57')]()[_0x0baf('0x15')](function(_0x4d4a7f){if(!_0x4d4a7f){throw new db['Sequelize'][(_0x0baf('0x83'))](_0x0baf('0x84'));}_0x39eb13=_[_0x0baf('0x85')](_[_0x0baf('0x38')](_0x4d4a7f),[_0x0baf('0x86'),'updatedAt']);_0x4d4eab=_[_0x0baf('0x85')](_[_0x0baf('0x38')](_0x4d4a7f),['createdAt',_0x0baf('0x87'),_0x0baf('0x88'),'ListId']);if(_0x12311d[_0x0baf('0x4f')]['id']){delete _0x12311d[_0x0baf('0x4f')]['id'];}if(_[_0x0baf('0x73')](_0x12311d[_0x0baf('0x4f')][_0x0baf('0x89')])){throw new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))](_0x0baf('0x8b'));}if(_['isNil'](_0x12311d[_0x0baf('0x4f')][_0x0baf('0x4f')])||_0x12311d[_0x0baf('0x4f')][_0x0baf('0x4f')]===''){throw new db['Sequelize'][(_0x0baf('0x83'))](_0x0baf('0x8c'));}if(_['isNil'](_0x12311d[_0x0baf('0x4f')][_0x0baf('0x8d')])){throw new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4d4eab);}if(!_[_0x0baf('0x8e')](_0x4d4eab,_0x12311d[_0x0baf('0x4f')][_0x0baf('0x8d')])){throw new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4d4eab);}_0x5054f9[_0x12311d[_0x0baf('0x4f')][_0x0baf('0x8d')]]=_0x12311d[_0x0baf('0x4f')]['from'];})[_0x0baf('0x15')](function(){return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x12311d[_0x0baf('0x4d')]['id']},'include':[{'model':db[_0x0baf('0x8f')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0baf('0x90'),'where':_0x5054f9,'limit':0x1,'order':[[_0x0baf('0x87'),_0x0baf('0x91')]]}]},{'model':db['ChatApplication'],'as':_0x0baf('0x92')}]});})[_0x0baf('0x15')](handleEntityNotFound(_0x52c7f7,null))[_0x0baf('0x15')](function(_0x3cfb49){if(_0x3cfb49&&_0x3cfb49[_0x0baf('0x93')]){_0x1805ff[_0x0baf('0x94')]=_0x3cfb49;_0x1805ff[_0x0baf('0x95')]=_0x3cfb49[_0x0baf('0x92')];_0x1805ff[_0x0baf('0x96')]=_0x3cfb49[_0x0baf('0x93')];_0x1805ff['applications']=_[_0x0baf('0x97')](_0x1805ff[_0x0baf('0x95')],[_0x0baf('0x98')],[_0x0baf('0x99')]);if(_0x1805ff['account'][_0x0baf('0x92')]){delete _0x1805ff[_0x0baf('0x94')][_0x0baf('0x92')];}if(_0x1805ff['account'][_0x0baf('0x93')]&&_0x1805ff[_0x0baf('0x94')][_0x0baf('0x93')][_0x0baf('0x90')][_0x0baf('0x61')]){return _0x1805ff['account'][_0x0baf('0x93')][_0x0baf('0x90')][0x0];}var _0x53df55=_['defaults'](_0x12311d[_0x0baf('0x4f')],{'firstName':_0x12311d[_0x0baf('0x4f')][_0x0baf('0x89')],'ListId':_0x3cfb49[_0x0baf('0x9a')]});_0x53df55[_0x12311d[_0x0baf('0x4f')][_0x0baf('0x8d')]]=_0x12311d[_0x0baf('0x4f')]['from'];return db['CmContact'][_0x0baf('0x4e')](_0x53df55,{'fields':_0x39eb13,'raw':!![]});}})[_0x0baf('0x15')](handleEntityNotFound(_0x52c7f7,null))[_0x0baf('0x15')](function(_0x47de3f){_0x1805ff[_0x0baf('0x9b')]=_0x47de3f;var _0x3a6bf8=_0x12311d['body'][_0x0baf('0x9c')];if(_0x12311d[_0x0baf('0x7e')]['cf-connecting-ip']){_0x3a6bf8=_0x12311d[_0x0baf('0x7e')][_0x0baf('0x9d')];}else if(_0x12311d[_0x0baf('0x7e')]['x-forwarded-for']){_0x3a6bf8=_[_0x0baf('0x9e')](_0x12311d[_0x0baf('0x7e')][_0x0baf('0x9f')][_0x0baf('0xa0')](','));}if(_0x47de3f){var _0x3021f7={'ContactId':_0x47de3f['id'],'ChatWebsiteId':_0x12311d[_0x0baf('0x4d')]['id'],'from':(_0x47de3f[_0x0baf('0xa1')]||'')+'\x20'+(_0x47de3f['lastName']||''),'customerIp':_0x3a6bf8,'customerPort':_0x12311d[_0x0baf('0x7e')]['x-real-port']?_0x12311d[_0x0baf('0x7e')][_0x0baf('0xa2')]:null,'referer':_0x12311d['body']['referer'],'browserName':_0x12ff07[_0x0baf('0xa3')][_0x0baf('0x2f')]&&_0x12ff07[_0x0baf('0xa3')]['version']?util[_0x0baf('0xa4')](_0x0baf('0xa5'),_0x12ff07[_0x0baf('0xa3')][_0x0baf('0x2f')],_0x12ff07[_0x0baf('0xa3')][_0x0baf('0xa6')]):_0x0baf('0xa7'),'browserVersion':_0x12ff07[_0x0baf('0xa3')]['version']||'unknown','osName':util[_0x0baf('0xa4')](_0x0baf('0xa5'),_0x12ff07['os']['name'],_0x12ff07['os'][_0x0baf('0xa6')]),'osVersion':_0x12ff07['os'][_0x0baf('0xa6')],'deviceModel':_0x12ff07[_0x0baf('0xa8')][_0x0baf('0x36')]&&_0x12ff07[_0x0baf('0xa8')][_0x0baf('0xa9')]?util[_0x0baf('0xa4')]('%s\x20%s\x20%s',_0x12ff07[_0x0baf('0xa8')]['model'],_0x12ff07[_0x0baf('0xa8')][_0x0baf('0xa9')],_0x12ff07['device']['type']):null,'deviceVendor':_0x12ff07[_0x0baf('0xa8')][_0x0baf('0xa9')],'deviceType':_0x12ff07[_0x0baf('0xa8')][_0x0baf('0x46')],'formData':JSON[_0x0baf('0x1a')](_0x12311d[_0x0baf('0x4f')])};var _0x18f7bd={'ChatWebsiteId':_0x12311d['params']['id'],'closed':![]};if(_0x12311d['body']['threadId']){_0x18f7bd[_0x0baf('0xaa')]=_0x12311d['body'][_0x0baf('0xaa')];return db[_0x0baf('0xab')]['find']({'where':_0x18f7bd})['then'](function(_0x40785c){if(_0x40785c){return[_0x40785c,![]];}_0x3021f7[_0x0baf('0xaa')]=_0x12311d[_0x0baf('0x4f')][_0x0baf('0xaa')];_0x3021f7[_0x0baf('0xac')]=_0x12311d['body'][_0x0baf('0xac')];return db[_0x0baf('0xab')][_0x0baf('0x4e')](_0x3021f7)[_0x0baf('0x15')](function(_0xf784df){return[_0xf784df,!![]];});});}_0x18f7bd[_0x0baf('0xad')]=_0x47de3f['id'];if(_0x12311d['body'][_0x0baf('0xae')]&&_0x12311d[_0x0baf('0x4f')][_0x0baf('0xae')]['id']){_0x18f7bd['id']=_0x12311d['body'][_0x0baf('0xae')]['id'];return db[_0x0baf('0xab')]['find']({'where':_0x18f7bd})[_0x0baf('0x15')](function(_0xe93008){if(_0xe93008){return[_0xe93008,![]];}return db[_0x0baf('0xab')][_0x0baf('0x4e')](_0x3021f7)['then'](function(_0x4ffc8e){return[_0x4ffc8e,!![]];});});}return db[_0x0baf('0xab')][_0x0baf('0x4e')](_0x3021f7)['then'](function(_0x43022c){return[_0x43022c,!![]];});}})[_0x0baf('0xaf')](function(_0xcd88a1,_0x13ac02){if(_0xcd88a1){_0x1ac8eb=_0x13ac02;if(!_0x13ac02){var _0x122a1a={'from':(_0x1805ff['contact'][_0x0baf('0xa1')]||'')+'\x20'+(_0x1805ff[_0x0baf('0x9b')][_0x0baf('0xb0')]||'')};if(_0x12311d[_0x0baf('0x4f')]['threadId']&&_0x12311d[_0x0baf('0x4f')]['messageId']&&_0x12311d[_0x0baf('0x4f')][_0x0baf('0xaa')]!=_0x12311d[_0x0baf('0x4f')]['messageId']){_0x122a1a[_0x0baf('0xaa')]=_0x12311d[_0x0baf('0x4f')][_0x0baf('0xb1')];}return _0xcd88a1[_0x0baf('0x28')](_0x122a1a);}else{return _0xcd88a1;}}})[_0x0baf('0x15')](function(_0x2a72b3){_0x1805ff[_0x0baf('0xae')]=_0x2a72b3[_0x0baf('0x2a')]({'plain':!![]});_0x1805ff[_0x0baf('0xae')][_0x0baf('0xb2')]=_0x1ac8eb;if(_0x1805ff[_0x0baf('0xae')][_0x0baf('0xb2')]){if(_0x1805ff['account']['autoclose']){_0x1805ff[_0x0baf('0x95')]['push']({'id':0x0,'priority':_0x1805ff['applications']['length']+0x1,'app':'close','appdata':_0x0baf('0xb3'),'interval':_0x0baf('0xb4')});}}return db['ChatMessage']['create']({'body':_0x12311d['body']['body'],'ChatWebsiteId':_0x12311d[_0x0baf('0x4d')]['id'],'ChatInteractionId':_0x2a72b3['id'],'direction':'in','ContactId':_0x1805ff['contact']['id'],'AttachmentId':_0x12311d[_0x0baf('0x4f')][_0x0baf('0xb5')]});})[_0x0baf('0x15')](function(_0xa1b680){_0x1805ff[_0x0baf('0x1d')]=_0xa1b680;if(_0x1805ff[_0x0baf('0xae')][_0x0baf('0xb6')]){return db[_0x0baf('0xb7')]['find']({'attributes':['id','name'],'where':{'id':_0x1805ff[_0x0baf('0xae')][_0x0baf('0xb6')]}})['then'](function(_0x21a72d){if(_0x21a72d){_0x1805ff['applications'][_0x0baf('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x21a72d['name']+','+(_0x1805ff[_0x0baf('0x94')][_0x0baf('0xb9')]||0xa),'interval':_0x0baf('0xb4')});_0x1805ff[_0x0baf('0xba')]=!![];}return respondWithRpcPromise(_0x0baf('0xbb'),_0x0baf('0xbc'),_0x1805ff);});}return respondWithRpcPromise(_0x0baf('0xbb'),_0x0baf('0xbc'),_0x1805ff);})[_0x0baf('0x15')](function(_0x3348c6){respondWithRpcPromise(_0x0baf('0xbd'),_0x0baf('0xbd'),{'event':_0x0baf('0x7d'),'message':_0x3348c6},client9002);return _0x3348c6;})[_0x0baf('0x15')](respondWithResult(_0x52c7f7,null))[_0x0baf('0x1f')](handleError(_0x52c7f7,null));};exports[_0x0baf('0xbe')]=function(_0x5b61ff,_0x3c78ca){var _0x1a016f,_0x5b9e60,_0x9f2b22;var _0x39526b=[];var _0x5ee76f={};var _0x186d83=_0x5b61ff['files']||[];var _0x3f816f=[];var _0x569bbb;return db[_0x0baf('0x82')]['describe']()[_0x0baf('0x15')](function(_0x298cb5){if(!_0x298cb5){throw new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))]('no\x20available\x20attributes');}_0x39526b=_[_0x0baf('0x85')](_[_0x0baf('0x38')](_0x298cb5),[_0x0baf('0x86'),_0x0baf('0x87'),'CompanyId','ListId']);if(_0x5b61ff[_0x0baf('0x4f')]['id']){delete _0x5b61ff[_0x0baf('0x4f')]['id'];}if(_[_0x0baf('0x73')](_0x5b61ff[_0x0baf('0x4f')]['from'])){throw _0x3c78ca[_0x0baf('0x21')](0x1f4)[_0x0baf('0x30')](new db[(_0x0baf('0x8a'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x0baf('0x73')](_0x5b61ff['body'][_0x0baf('0x4f')])||_0x5b61ff['body'][_0x0baf('0x4f')]===''){throw _0x3c78ca[_0x0baf('0x21')](0x1f4)[_0x0baf('0x30')](new db['Sequelize'][(_0x0baf('0x83'))](_0x0baf('0x8c')));}if(_['isNil'](_0x5b61ff['body'][_0x0baf('0xbf')])){throw _0x3c78ca['status'](0x1f4)[_0x0baf('0x30')](new db[(_0x0baf('0x8a'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39526b));}if(!_[_0x0baf('0x8e')](_0x39526b,_0x5b61ff[_0x0baf('0x4f')]['mapKeyOffline'])){throw _0x3c78ca[_0x0baf('0x21')](0x1f4)['send'](new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39526b));}_0x5ee76f[_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0xbf')]]=_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0x89')];})[_0x0baf('0x15')](function(){return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x5b61ff['params']['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x0baf('0xc0')],'as':_0x0baf('0xc0')}]});})['then'](handleEntityNotFound(_0x3c78ca,null))[_0x0baf('0x15')](function(_0x58e1ae){if(_0x58e1ae&&_0x58e1ae['List']){_0x5b9e60=_0x58e1ae;var _0x30a982=_[_0x0baf('0xd')](_0x5b61ff[_0x0baf('0x4f')],{'firstName':_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0x89')],'phone':_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0x89')],'ListId':_0x58e1ae[_0x0baf('0x9a')]});_0x30a982[_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0xbf')]]=_0x5b61ff['body'][_0x0baf('0x89')];return db[_0x0baf('0x82')][_0x0baf('0xc1')]({'where':_0x5ee76f,'defaults':_0x30a982});}})[_0x0baf('0xaf')](function(_0x1d1ed6){if(_0x1d1ed6){_0x9f2b22=_0x1d1ed6;var _0x57b26e=fs[_0x0baf('0xc2')](path['join'](config[_0x0baf('0x6f')],_0x0baf('0xc3')),_0x0baf('0xc4'));var _0x44f822=ejs[_0x0baf('0xc5')](_0x57b26e,{'body':_[_0x0baf('0xc6')](_0x5b61ff[_0x0baf('0x4f')]['body']),'bodyTitle':_0x5b9e60[_0x0baf('0xc7')]});return db[_0x0baf('0xc8')][_0x0baf('0x4e')]({'body':_0x44f822,'plainBody':htmlToText[_0x0baf('0xc9')](_0x44f822),'ContactId':_0x1d1ed6['id'],'ChatWebsiteId':_0x5b9e60['id']});}})[_0x0baf('0x15')](function(_0x130ad1){_0x569bbb=_0x130ad1;if(_0x186d83[_0x0baf('0x61')]){var _0x17ef4f=_0x186d83[_0x0baf('0x37')](function(_0x1ee4c7){return{'name':_0x1ee4c7[_0x0baf('0xca')],'basename':_0x1ee4c7[_0x0baf('0x66')],'type':_0x1ee4c7[_0x0baf('0xcb')],'ChatOfflineMessageId':_0x130ad1['id']};});_0x3f816f=_0x17ef4f[_0x0baf('0x37')](_0x37430c=>{var _0x3fffe8={'filename':_0x37430c[_0x0baf('0x2f')],'path':path[_0x0baf('0x6e')](config['root'],_0x0baf('0xcc'),_0x0baf('0xcd'),_0x0baf('0xce'),_0x0baf('0xcf'),_0x37430c[_0x0baf('0xd0')])};return _0x3fffe8;});if(!_0x5b9e60[_0x0baf('0xd1')]){return db[_0x0baf('0xd2')]['transaction'](function(_0xa7a73a){return db[_0x0baf('0xd3')][_0x0baf('0xd4')](_0x17ef4f,{'transaction':_0xa7a73a});});}}})[_0x0baf('0x15')](function(){if(_0x569bbb){_0x1a016f=_0x569bbb;return db[_0x0baf('0xc0')][_0x0baf('0x59')]({'where':{'active':!![]},'include':[{'model':db[_0x0baf('0xd5')],'as':'Smtp','raw':!![]}]});}})[_0x0baf('0x15')](function(_0x17b3a9){if(_0x17b3a9&&_0x17b3a9[_0x0baf('0xd6')]&&_0x5b9e60[_0x0baf('0xd7')]&&_0x5b9e60[_0x0baf('0xd8')]){var _0x1912ff={'tls':{'rejectUnauthorized':![]}};if(_0x17b3a9['Smtp'][_0x0baf('0xd9')]){_0x1912ff[_0x0baf('0xd9')]=_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xd9')];}else{_0x1912ff[_0x0baf('0xda')]=_0x17b3a9['Smtp']['host'];_0x1912ff[_0x0baf('0xdb')]=_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xdb')];_0x1912ff[_0x0baf('0xdc')]=_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xdc')];}if(_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xdd')]){_0x1912ff[_0x0baf('0xde')]={'user':_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0x50')],'pass':_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xdf')]};}return respondWithRpcPromise(_0x0baf('0xe0'),_0x0baf('0xe1'),{'account':_0x1912ff,'message':{'from':util[_0x0baf('0xa4')](_0x0baf('0xe2'),_0x17b3a9[_0x0baf('0x2f')],_0x17b3a9[_0x0baf('0xe3')]||_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0x50')]),'to':_0x5b9e60[_0x0baf('0xd8')],'subject':_0x5b9e60[_0x0baf('0xe4')],'html':_0x1a016f[_0x0baf('0x4f')],'attachments':_0x3f816f}},client9003)[_0x0baf('0x15')](function(){return _0x1a016f;})[_0x0baf('0x1f')](function(_0x1d4581){console['error'](_0x1d4581);});}})[_0x0baf('0x15')](function(){if(_0x5b9e60&&_0x5b9e60[_0x0baf('0xd1')]&&_0x5b9e60[_0x0baf('0xe5')]){var _0x14a397=[];if(_0x186d83[_0x0baf('0x61')]){_0x14a397=_0x186d83['map'](function(_0x3e3fba){return{'name':_0x3e3fba[_0x0baf('0xca')],'basename':_0x3e3fba[_0x0baf('0x66')],'type':_0x3e3fba[_0x0baf('0xcb')],'ChatOfflineMessageId':_0x569bbb['id']};});}var _0x1db841;if(!_[_0x0baf('0x73')](_0x5b9e60[_0x0baf('0xe6')])){var _0x237a20=_[_0x0baf('0x37')](_0x5b61ff[_0x0baf('0x4f')],function(_0xe840f2){return _0xe840f2;});var _0x12726d=_[_0x0baf('0xe7')](_0x237a20)[0x0];var _0x1b2278=_[_0x0baf('0xe8')](_0x12726d,function(_0x221aac){return _0x221aac;});_0x1db841=_0x1b2278[0x1][_0x5b9e60[_0x0baf('0xe6')]];}var _0x3e970a={'from':_0x9f2b22['email'],'firstName':_0x9f2b22[_0x0baf('0xa1')],'lastName':_0x9f2b22['lastName'],'mapKey':'email','message':{'from':_0x9f2b22[_0x0baf('0xe3')],'to':_0x5b9e60[_0x0baf('0xc0')][_0x0baf('0xe3')],'cc':'','subject':_['isNil'](_0x1db841)?_0x5b9e60[_0x0baf('0xe4')]:_0x1db841,'messageId':'','sentAt':new Date(),'attach':_0x14a397[_0x0baf('0x61')],'attachments':_0x14a397,'originChannel':_0x0baf('0xe9'),'ChatWebsiteId':_0x5b9e60['id'],'ChatOfflineMessageId':_0x1a016f['id'],'originTo':_0x5b9e60[_0x0baf('0xc0')][_0x0baf('0xe3')]},'body':_0x1a016f[_0x0baf('0x4f')]};var _0x49543e={'account':{'id':_0x5b9e60[_0x0baf('0xe5')]},'body':_0x3e970a,'log':_0x0baf('0xea')};return respondWithRpcPromise(_0x0baf('0xea'),_0x0baf('0xeb'),_0x49543e,client9001)[_0x0baf('0x15')](function(){return _0x1a016f;})[_0x0baf('0x1f')](function(_0x4c2bae){console[_0x0baf('0x1b')](_0x4c2bae);});}return;})['then'](function(){if(_0x1a016f){return _0x1a016f;}})[_0x0baf('0x15')](respondWithResult(_0x3c78ca,null))[_0x0baf('0x1f')](function(_0x47b168){console['error'](_0x0baf('0x1f'),_0x47b168);for(var _0x1de1dd of _0x186d83){var _0xf4da6a=path['join'](config[_0x0baf('0x6f')],_0x0baf('0xcc'),'files',_0x0baf('0xce'),_0x0baf('0xcf'),_0x1de1dd[_0x0baf('0x66')]);fs_extra[_0x0baf('0xec')](_0xf4da6a)[_0x0baf('0x1f')](function(_0x2759bb){console[_0x0baf('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0xf4da6a,_0x2759bb);});}});};exports['addInteraction']=function(_0x131573,_0x1bd67f){return db[_0x0baf('0xab')][_0x0baf('0x54')]({'where':{'id':_0x131573[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x1bd67f,null))[_0x0baf('0x15')](function(_0x4316c5){if(_0x4316c5){return _0x4316c5[_0x0baf('0xed')](_0x131573[_0x0baf('0x4f')]['ids'],_['omit'](_0x131573[_0x0baf('0x4f')],[_0x0baf('0x5d'),'id'])||{});}})[_0x0baf('0x15')](respondWithResult(_0x1bd67f,null))['catch'](handleError(_0x1bd67f,null));};exports['getInteractions']=function(_0x3d740a,_0x2cb735){var _0xf82eb5={'raw':![],'where':{}};var _0x197bbe={};var _0x4a6a50={'count':0x0,'rows':[]};return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x3d740a[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x2cb735,null))[_0x0baf('0x15')](function(_0x120c18){if(_0x120c18){_0x197bbe[_0x0baf('0x36')]=_[_0x0baf('0x38')](db['ChatInteraction'][_0x0baf('0x34')]);_0x197bbe[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x3d740a[_0x0baf('0x39')]);_0x197bbe[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x197bbe['model'],_0x197bbe[_0x0baf('0x39')]);_0xf82eb5[_0x0baf('0x3c')]=_['intersection'](_0x197bbe['model'],qs[_0x0baf('0x3d')](_0x3d740a['query'][_0x0baf('0x3d')]));_0xf82eb5[_0x0baf('0x3c')]=_0xf82eb5[_0x0baf('0x3c')][_0x0baf('0x61')]?_0xf82eb5['attributes']:_0x197bbe[_0x0baf('0x36')];if(!_0x3d740a[_0x0baf('0x39')][_0x0baf('0x3e')]('nolimit')){_0xf82eb5[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x3d740a['query'][_0x0baf('0x25')]);_0xf82eb5['offset']=qs[_0x0baf('0x23')](_0x3d740a[_0x0baf('0x39')][_0x0baf('0x23')]);}_0xf82eb5[_0x0baf('0x40')]=qs['sort'](_0x3d740a[_0x0baf('0x39')][_0x0baf('0x41')]);_0xf82eb5['where']=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x3d740a['query'],_0x197bbe[_0x0baf('0x3a')]));_0xf82eb5[_0x0baf('0x44')]['ChatWebsiteId']=_0x120c18['id'];if(_0x3d740a[_0x0baf('0x39')][_0x0baf('0x43')]){_0xf82eb5[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0xf82eb5[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0xf82eb5['attributes'],function(_0x181385){var _0x120f68={};_0x120f68[_0x181385]={'$like':'%'+_0x3d740a[_0x0baf('0x39')][_0x0baf('0x43')]+'%'};return _0x120f68;})});}_0xf82eb5=_[_0x0baf('0x45')]({},_0xf82eb5,_0x3d740a[_0x0baf('0x48')]);return db[_0x0baf('0xab')][_0x0baf('0x26')]({'where':_0xf82eb5[_0x0baf('0x44')]})[_0x0baf('0x15')](function(_0x72e44c){_0x4a6a50[_0x0baf('0x26')]=_0x72e44c;if(_0x3d740a[_0x0baf('0x39')][_0x0baf('0x49')]){_0xf82eb5[_0x0baf('0x4a')]=[{'model':db[_0x0baf('0x82')],'as':_0x0baf('0xee'),'required':![]},{'model':db[_0x0baf('0xb7')],'as':_0x0baf('0xef'),'attributes':[_0x0baf('0x2f'),_0x0baf('0xf0'),_0x0baf('0xf1')],'required':![]},{'model':db['Tag'],'as':_0x0baf('0xf2'),'attributes':['id',_0x0baf('0x2f'),'color'],'where':_0x3d740a['query']['tag']?{'id':_0x3d740a[_0x0baf('0x39')]['tag']}:undefined,'required':_0x3d740a['query']['tag']?!![]:![]}];}return db[_0x0baf('0xab')][_0x0baf('0x5b')](_0xf82eb5);})[_0x0baf('0x15')](function(_0x5ab269){_0x4a6a50[_0x0baf('0x4b')]=_0x5ab269;return _0x4a6a50;});}})['then'](respondWithFilteredResult(_0x2cb735,_0xf82eb5))['catch'](handleError(_0x2cb735,null));};function iftimePromise(_0x743f4b,_0xc93c2b){return respondWithRpcPromise(_0x0baf('0xf3'),'getSnippet',{'command':_0xc93c2b['timezone']?util[_0x0baf('0xa4')](_0x0baf('0xf4'),_0x743f4b[_0x0baf('0xf5')],_0xc93c2b[_0x0baf('0xf6')]):util[_0x0baf('0xa4')](_0x0baf('0xf7'),_0x743f4b['interval'])},client9002)['then'](function(_0x217cd8){var _0x21e3b1=_0x217cd8&&_0x217cd8['indexOf'](_0x0baf('0xf8'))>=0x0?!![]:![];logger[_0x0baf('0x16')](_0x0baf('0xf9'),_0xc93c2b['id'],_0x743f4b['id'],_0x743f4b[_0x0baf('0xf5')],_0x21e3b1?'ONLINE':_0x0baf('0xfa'),_0xc93c2b['timezone']?_0xc93c2b['timezone']:_0x0baf('0xfb'));return _0x21e3b1;})['catch'](function(_0x4a0f32){logger[_0x0baf('0x1b')](_0x0baf('0xf9'),_0xc93c2b['id'],_0x743f4b['id'],_0x743f4b['interval'],util[_0x0baf('0xfc')](_0x4a0f32,{'showHidden':![],'depth':null}),_0xc93c2b[_0x0baf('0xf6')]?_0xc93c2b[_0x0baf('0xf6')]:_0x0baf('0xfb'));return![];});}exports[_0x0baf('0xfd')]=function(_0x1ad92d,_0x532e4b){var _0x395ad5=0x0;var _0x47fcb1=0x0;var _0x2a4997=![];var _0x2997b3;var _0x4e0fc6;return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x1ad92d[_0x0baf('0x4d')]['id']},'include':[{'model':db['Interval'],'as':_0x0baf('0xfe'),'include':[{'model':db[_0x0baf('0xfe')],'as':_0x0baf('0xff'),'attributes':['id',_0x0baf('0xf5')],'raw':!![]}]}]})[_0x0baf('0x15')](handleEntityNotFound(_0x532e4b,null))[_0x0baf('0x15')](function(_0x20f37b){if(_0x20f37b){_0x2997b3=_0x20f37b;return _0x20f37b[_0x0baf('0x100')]({'raw':!![]});}})['then'](function(_0x3f136e){if(_0x2997b3){if(_0x3f136e){_0x4e0fc6=_0x3f136e;}}return require(_0x0baf('0x101'))['getLicense']();})['then'](function(_0x276d39){if(_0x276d39){_0x47fcb1=_0x276d39[_0x0baf('0x102')];_0x2a4997=_0x276d39['custom'];}})[_0x0baf('0x15')](function(){return db[_0x0baf('0xab')]['count']({'where':{'closed':![]}});})[_0x0baf('0x15')](function(_0x47825b){_0x395ad5=_0x47825b;if(_0x47fcb1&&_0x47825b>_0x47fcb1){return db[_0x0baf('0x103')][_0x0baf('0x59')]({'where':{'id':0x1}})[_0x0baf('0x15')](function(_0x9f5f16){if(_0x9f5f16){_0x9f5f16[_0x0baf('0x104')](_0x0baf('0x105'));}});}})[_0x0baf('0x15')](function(){if(_0x2997b3['Interval']&&_0x2997b3[_0x0baf('0xfe')][_0x0baf('0xff')]){var _0x547a10=[];for(var _0x4ef69a=0x0;_0x4ef69a<_0x2997b3[_0x0baf('0xfe')]['Intervals'][_0x0baf('0x61')];_0x4ef69a++){var _0x3752fd=_0x2997b3[_0x0baf('0xfe')][_0x0baf('0xff')][_0x4ef69a][_0x0baf('0x2a')]({'plain':!![]});_0x547a10[_0x0baf('0x106')](iftimePromise(_0x3752fd,_0x2997b3));}return BPromise[_0x0baf('0x107')](_0x547a10)[_0x0baf('0x15')](function(_0x148b9a){return _['some'](_0x148b9a);});}else{return!![];}})[_0x0baf('0x15')](function(_0x6721e9){var _0x2d4336=fs[_0x0baf('0xc2')](path['join'](config[_0x0baf('0x6f')],_0x0baf('0x108')),_0x0baf('0xc4'));var _0x550db0={'remote':_0x2997b3[_0x0baf('0x109')],'query':querystring[_0x0baf('0x1a')](_[_0x0baf('0x45')](_0x2997b3[_0x0baf('0x2a')]({'plain':!![]}),{'customerIp':_0x1ad92d['headers'][_0x0baf('0x9f')]||_0x1ad92d[_0x0baf('0x7e')]['x-real-ip']||_0x1ad92d['connection']['remoteAddress']||_0x1ad92d['ip'],'referer':_0x1ad92d[_0x0baf('0x7e')][_0x0baf('0x10a')],'openedInteractions':_0x395ad5,'maxInteractions':_0x47fcb1,'virtual':_0x2a4997[_0x0baf('0x102')],'online':_0x6721e9,'custom':_0x2a4997}))['replace'](/'/g,'\x5c\x27')};_0x532e4b[_0x0baf('0x30')](ejs[_0x0baf('0xc5')](Mustache[_0x0baf('0xc5')](_0x2d4336,_0x550db0),{'proactiveActions':_0x4e0fc6,'alignment':_0x2997b3[_0x0baf('0x10b')],'verticalAlignment':_0x2997b3[_0x0baf('0x10c')],'div_color':_0x2997b3['color'],'labelText':_0x2997b3[_0x0baf('0x10d')],'text_color':_0x2997b3[_0x0baf('0x10e')],'button_color':_0x2997b3[_0x0baf('0x10f')],'background_color':_0x2997b3[_0x0baf('0x110')]}));})[_0x0baf('0x1f')](handleError(_0x532e4b,null));};exports[_0x0baf('0x111')]=function(_0x5ab670,_0x4c4ffe){var _0x181980=_0x5ab670[_0x0baf('0x4d')]['id'];var _0x313e3e=_0x5ab670[_0x0baf('0x4f')];var _0x1cf4b5=0xc8;var _0x5d1985=null;return db[_0x0baf('0xd2')][_0x0baf('0x112')]({'isolationLevel':db[_0x0baf('0xd2')]['Transaction'][_0x0baf('0x113')][_0x0baf('0x114')]},function(_0x1e10a4){return db[_0x0baf('0x33')]['findOne']({'where':{'id':_0x181980},'transaction':_0x1e10a4})[_0x0baf('0x15')](function(_0x4d6e8e){if(_0x4d6e8e){return db[_0x0baf('0x115')][_0x0baf('0x29')]({'where':{'ChatWebsiteId':_0x181980},'transaction':_0x1e10a4})[_0x0baf('0x15')](function(){var _0x594a08=_['map'](_0x313e3e,function(_0x45e0ec){_0x45e0ec[_0x0baf('0x5f')]=_0x181980;return _0x45e0ec;});return db[_0x0baf('0x115')][_0x0baf('0xd4')](_0x594a08,{'transaction':_0x1e10a4});});}else{_0x1cf4b5=0x194;_0x5d1985=[];}});})['then'](function(){if(_0x1cf4b5!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x181980},'order':_0x0baf('0x98')})[_0x0baf('0x15')](function(_0x46171d){_0x5d1985=_0x46171d;});}})['catch'](function(_0x2ba54d){_0x1cf4b5=0x1f4;logger[_0x0baf('0x1b')](_0x2ba54d[_0x0baf('0x2e')]);if(_0x2ba54d['name']){delete _0x2ba54d[_0x0baf('0x2f')];}_0x5d1985=_0x2ba54d;})[_0x0baf('0x116')](function(){if(_0x5d1985===null){_0x4c4ffe[_0x0baf('0x20')](_0x1cf4b5);}else{if(_0x1cf4b5===0x1f4){_0x4c4ffe['status'](_0x1cf4b5)['send'](_0x5d1985);}else{_0x4c4ffe['status'](_0x1cf4b5)['json'](_0x5d1985);}}});};exports[_0x0baf('0x117')]=function(_0x1c8b91,_0x3124bc){var _0x5ba16f={};var _0xcbc041={};var _0x5b1808;var _0x1abba8;return db[_0x0baf('0x33')]['findOne']({'where':{'id':_0x1c8b91['params']['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x3124bc,null))[_0x0baf('0x15')](function(_0xc0952d){if(_0xc0952d){_0x5b1808=_0xc0952d;_0xcbc041['model']=_[_0x0baf('0x38')](db[_0x0baf('0x115')]['rawAttributes']);_0xcbc041['query']=_[_0x0baf('0x38')](_0x1c8b91[_0x0baf('0x39')]);_0xcbc041[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0xcbc041[_0x0baf('0x36')],_0xcbc041[_0x0baf('0x39')]);_0x5ba16f[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0xcbc041[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x1c8b91[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x5ba16f[_0x0baf('0x3c')]=_0x5ba16f[_0x0baf('0x3c')][_0x0baf('0x61')]?_0x5ba16f['attributes']:_0xcbc041[_0x0baf('0x36')];_0x5ba16f[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x1c8b91['query']['sort']);_0x5ba16f[_0x0baf('0x44')]=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x1c8b91[_0x0baf('0x39')],_0xcbc041[_0x0baf('0x3a')]));if(_0x1c8b91[_0x0baf('0x39')][_0x0baf('0x43')]){_0x5ba16f[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x5ba16f[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x5ba16f[_0x0baf('0x3c')],function(_0x4306bb){var _0x2c2d4b={};_0x2c2d4b[_0x4306bb]={'$like':'%'+_0x1c8b91[_0x0baf('0x39')]['filter']+'%'};return _0x2c2d4b;})});}_0x5ba16f=_[_0x0baf('0x45')]({},_0x5ba16f,_0x1c8b91[_0x0baf('0x48')]);return _0x5b1808[_0x0baf('0x117')](_0x5ba16f);}})[_0x0baf('0x15')](function(_0x4056b6){if(_0x4056b6){_0x1abba8=_0x4056b6[_0x0baf('0x61')];if(!_0x1c8b91[_0x0baf('0x39')]['hasOwnProperty']('nolimit')){_0x5ba16f[_0x0baf('0x25')]=qs['limit'](_0x1c8b91['query'][_0x0baf('0x25')]);_0x5ba16f['offset']=qs[_0x0baf('0x23')](_0x1c8b91[_0x0baf('0x39')][_0x0baf('0x23')]);}return _0x5b1808[_0x0baf('0x117')](_0x5ba16f);}})[_0x0baf('0x15')](function(_0x2a02e6){if(_0x2a02e6){return _0x2a02e6?{'count':_0x1abba8,'rows':_0x2a02e6}:null;}})[_0x0baf('0x15')](respondWithResult(_0x3124bc,null))[_0x0baf('0x1f')](handleError(_0x3124bc,null));};exports['addProactiveActions']=function(_0x4bcc76,_0xae7f71){return db[_0x0baf('0x118')][_0x0baf('0x54')]({'where':{'id':_0x4bcc76[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0xae7f71,null))['then'](function(_0x123037){if(_0x123037){return _0x123037[_0x0baf('0x119')](_0x4bcc76[_0x0baf('0x4f')][_0x0baf('0x5d')],_[_0x0baf('0x11a')](_0x4bcc76[_0x0baf('0x4f')],[_0x0baf('0x5d'),'id'])||{});}})[_0x0baf('0x15')](respondWithResult(_0xae7f71,null))[_0x0baf('0x1f')](handleError(_0xae7f71,null));};exports[_0x0baf('0x100')]=function(_0x238649,_0x30ef34){var _0x43c6a6={};var _0x2448dd={};var _0x4a999b;var _0x165555;return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x238649[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x30ef34,null))['then'](function(_0x2723ea){if(_0x2723ea){_0x4a999b=_0x2723ea;_0x2448dd[_0x0baf('0x36')]=_[_0x0baf('0x38')](db['ChatProactiveAction']['rawAttributes']);_0x2448dd[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x238649['query']);_0x2448dd[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x2448dd['model'],_0x2448dd[_0x0baf('0x39')]);_0x43c6a6[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0x2448dd[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x238649[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x43c6a6['attributes']=_0x43c6a6['attributes'][_0x0baf('0x61')]?_0x43c6a6['attributes']:_0x2448dd[_0x0baf('0x36')];_0x43c6a6[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x238649['query'][_0x0baf('0x41')]);_0x43c6a6[_0x0baf('0x44')]=qs['filters'](_[_0x0baf('0x42')](_0x238649[_0x0baf('0x39')],_0x2448dd[_0x0baf('0x3a')]));if(_0x238649[_0x0baf('0x39')][_0x0baf('0x43')]){_0x43c6a6[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x43c6a6[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x43c6a6['attributes'],function(_0x2739c7){var _0x1bea85={};_0x1bea85[_0x2739c7]={'$like':'%'+_0x238649['query']['filter']+'%'};return _0x1bea85;})});}_0x43c6a6=_[_0x0baf('0x45')]({},_0x43c6a6,_0x238649[_0x0baf('0x48')]);return _0x4a999b[_0x0baf('0x100')](_0x43c6a6);}})[_0x0baf('0x15')](function(_0x34d2db){if(_0x34d2db){_0x165555=_0x34d2db['length'];if(!_0x238649['query'][_0x0baf('0x3e')]('nolimit')){_0x43c6a6[_0x0baf('0x25')]=qs['limit'](_0x238649[_0x0baf('0x39')][_0x0baf('0x25')]);_0x43c6a6[_0x0baf('0x23')]=qs['offset'](_0x238649[_0x0baf('0x39')][_0x0baf('0x23')]);}return _0x4a999b[_0x0baf('0x100')](_0x43c6a6);}})['then'](function(_0xb3a031){if(_0xb3a031){return _0xb3a031?{'count':_0x165555,'rows':_0xb3a031}:null;}})[_0x0baf('0x15')](respondWithResult(_0x30ef34,null))[_0x0baf('0x1f')](handleError(_0x30ef34,null));};exports[_0x0baf('0x11b')]=function(_0x3597fe,_0x132995){var _0x12c4bf=_0x3597fe[_0x0baf('0x39')][_0x0baf('0x11c')]===_0x0baf('0x11d')?'offlineForm':_0x0baf('0x11e');return db[_0x0baf('0x33')]['find']({'attributes':['id',_0x12c4bf],'where':{'id':_0x3597fe[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x132995,null))[_0x0baf('0x15')](function(_0xc2b22e){if(_0xc2b22e){var _0x51f903=_0xc2b22e[_0x12c4bf];var _0x423e9c=_0x51f903&&_0x51f903[_0x0baf('0x11f')]?_0x51f903[_0x0baf('0x11f')]:[];_0x132995['send']({'fromKey':_['isNil'](_0x51f903[_0x0baf('0x120')])?undefined:_0x51f903['fromKey'],'count':_0x423e9c[_0x0baf('0x61')],'rows':_0x423e9c});}})[_0x0baf('0x1f')](handleError(_0x132995,null));};exports['getOfflineMessages']=function(_0x53e81a,_0x572289){var _0x4fc936={'raw':![],'where':{}};var _0x423636={};var _0x51f03c={'count':0x0,'rows':[]};return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x53e81a[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x572289,null))['then'](function(_0xa010ed){if(_0xa010ed){_0x423636[_0x0baf('0x36')]=_['keys'](db[_0x0baf('0xc8')]['rawAttributes']);_0x423636[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x53e81a['query']);_0x423636[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x423636['model'],_0x423636[_0x0baf('0x39')]);_0x4fc936[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0x423636[_0x0baf('0x36')],qs['fields'](_0x53e81a[_0x0baf('0x39')]['fields']));_0x4fc936[_0x0baf('0x3c')]=_0x4fc936[_0x0baf('0x3c')][_0x0baf('0x61')]?_0x4fc936['attributes']:_0x423636['model'];if(!_0x53e81a[_0x0baf('0x39')][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0x4fc936['limit']=qs[_0x0baf('0x25')](_0x53e81a[_0x0baf('0x39')][_0x0baf('0x25')]);_0x4fc936['offset']=qs[_0x0baf('0x23')](_0x53e81a['query'][_0x0baf('0x23')]);}_0x4fc936[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x53e81a[_0x0baf('0x39')][_0x0baf('0x41')]);_0x4fc936[_0x0baf('0x44')]=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x53e81a[_0x0baf('0x39')],_0x423636['filters']));_0x4fc936[_0x0baf('0x44')][_0x0baf('0x5f')]=_0xa010ed['id'];if(_0x53e81a[_0x0baf('0x39')][_0x0baf('0x43')]){_0x4fc936[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x4fc936[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x4fc936[_0x0baf('0x3c')],function(_0x410e8e){var _0x54facf={};_0x54facf[_0x410e8e]={'$like':'%'+_0x53e81a[_0x0baf('0x39')][_0x0baf('0x43')]+'%'};return _0x54facf;})});}_0x4fc936=_['merge']({},_0x4fc936,_0x53e81a[_0x0baf('0x48')]);return db[_0x0baf('0xc8')][_0x0baf('0x26')]({'where':_0x4fc936[_0x0baf('0x44')]})[_0x0baf('0x15')](function(_0x1fb9f7){_0x51f03c[_0x0baf('0x26')]=_0x1fb9f7;if(_0x53e81a[_0x0baf('0x39')][_0x0baf('0x49')]){_0x4fc936['include']=[{'all':!![]}];}else{_0x4fc936[_0x0baf('0x4a')]=[{'model':db[_0x0baf('0x82')],'as':_0x0baf('0xee'),'required':![]},{'model':db[_0x0baf('0xd3')],'as':_0x0baf('0x121'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x4fc936);})[_0x0baf('0x15')](function(_0x58b532){_0x51f03c[_0x0baf('0x4b')]=_0x58b532;return _0x51f03c;});}})[_0x0baf('0x15')](respondWithFilteredResult(_0x572289,_0x4fc936))[_0x0baf('0x1f')](handleError(_0x572289,null));};exports[_0x0baf('0x122')]=function(_0x3a667a,_0x2629e9){return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x3a667a[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2629e9,null))['then'](function(_0x274787){if(_0x274787){return _0x274787[_0x0baf('0x122')](_0x3a667a[_0x0baf('0x4f')][_0x0baf('0x5d')],_['omit'](_0x3a667a[_0x0baf('0x4f')],['ids','id'])||{})[_0x0baf('0xaf')](function(_0x548f40){for(var _0x64dd21=0x0;_0x64dd21<_0x3a667a[_0x0baf('0x4f')][_0x0baf('0x5d')]['length'];_0x64dd21+=0x1){socket[_0x0baf('0x123')](_0x0baf('0x124'),{'UserId':Number(_0x3a667a['body']['ids'][_0x64dd21]),'ChatWebsiteId':Number(_0x3a667a['params']['id'])});}return _0x548f40;});}})['then'](respondWithResult(_0x2629e9,null))[_0x0baf('0x1f')](handleError(_0x2629e9,null));};exports[_0x0baf('0x125')]=function(_0x1c414,_0x27c810){return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x1c414[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x27c810,null))[_0x0baf('0x15')](function(_0xfa0191){if(_0xfa0191){return _0xfa0191[_0x0baf('0x125')](_0x1c414[_0x0baf('0x39')]['ids'])[_0x0baf('0x15')](function(){if(_['isArray'](_0x1c414[_0x0baf('0x39')][_0x0baf('0x5d')])){for(var _0x93dcbd=0x0;_0x93dcbd<_0x1c414[_0x0baf('0x39')][_0x0baf('0x5d')][_0x0baf('0x61')];_0x93dcbd+=0x1){socket[_0x0baf('0x123')]('userChatWebsite:remove',{'UserId':Number(_0x1c414[_0x0baf('0x39')]['ids'][_0x93dcbd]),'ChatWebsiteId':Number(_0x1c414[_0x0baf('0x4d')]['id'])});}}else{socket[_0x0baf('0x123')](_0x0baf('0x126'),{'UserId':Number(_0x1c414[_0x0baf('0x39')][_0x0baf('0x5d')]),'ChatWebsiteId':Number(_0x1c414['params']['id'])});}});}})['then'](respondWithStatusCode(_0x27c810,null))[_0x0baf('0x1f')](handleError(_0x27c810,null));};exports[_0x0baf('0x127')]=function(_0x28c059,_0x51c9e0){var _0x52faae={};var _0x47868e={};var _0x2849c1;var _0x3dd487;return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x28c059[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x51c9e0,null))[_0x0baf('0x15')](function(_0x393408){if(_0x393408){_0x2849c1=_0x393408;_0x47868e['model']=_['keys'](db[_0x0baf('0xb7')][_0x0baf('0x34')]);_0x47868e[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x28c059['query']);_0x47868e[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x47868e[_0x0baf('0x36')],_0x47868e['query']);_0x52faae[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0x47868e[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x28c059['query'][_0x0baf('0x3d')]));_0x52faae[_0x0baf('0x3c')]=_0x52faae[_0x0baf('0x3c')]['length']?_0x52faae[_0x0baf('0x3c')]:_0x47868e[_0x0baf('0x36')];_0x52faae['order']=qs[_0x0baf('0x41')](_0x28c059[_0x0baf('0x39')][_0x0baf('0x41')]);_0x52faae[_0x0baf('0x44')]=qs[_0x0baf('0x3a')](_['pick'](_0x28c059['query'],_0x47868e[_0x0baf('0x3a')]));if(_0x28c059['query'][_0x0baf('0x43')]){_0x52faae[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x52faae[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x52faae[_0x0baf('0x3c')],function(_0xe30e49){var _0x3a5d39={};_0x3a5d39[_0xe30e49]={'$like':'%'+_0x28c059[_0x0baf('0x39')][_0x0baf('0x43')]+'%'};return _0x3a5d39;})});}_0x52faae=_[_0x0baf('0x45')]({},_0x52faae,_0x28c059[_0x0baf('0x48')]);return _0x2849c1[_0x0baf('0x127')](_0x52faae);}})['then'](function(_0x1684e5){if(_0x1684e5){_0x3dd487=_0x1684e5[_0x0baf('0x61')];if(!_0x28c059[_0x0baf('0x39')][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0x52faae[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x28c059[_0x0baf('0x39')][_0x0baf('0x25')]);_0x52faae[_0x0baf('0x23')]=qs[_0x0baf('0x23')](_0x28c059[_0x0baf('0x39')]['offset']);}return _0x2849c1[_0x0baf('0x127')](_0x52faae);}})[_0x0baf('0x15')](function(_0x1ea92f){if(_0x1ea92f){return _0x1ea92f?{'count':_0x3dd487,'rows':_0x1ea92f}:null;}})['then'](respondWithResult(_0x51c9e0,null))[_0x0baf('0x1f')](handleError(_0x51c9e0,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 74c6eac..5de17a3 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 _0x4453=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x9390cb,_0xfac11b){var _0x3f028c=function(_0x69295f){while(--_0x69295f){_0x9390cb['push'](_0x9390cb['shift']());}};_0x3f028c(++_0xfac11b);}(_0x4453,0x9c));var _0x3445=function(_0x57ed36,_0x360d31){_0x57ed36=_0x57ed36-0x0;var _0x4e6ee3=_0x4453[_0x57ed36];return _0x4e6ee3;};'use strict';var EventEmitter=require(_0x3445('0x0'));var ChatWebsite=require(_0x3445('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3445('0x2')](0x0);var events={'afterCreate':_0x3445('0x3'),'afterUpdate':'update','afterDestroy':_0x3445('0x4')};function emitEvent(_0x1419a5){return function(_0xfff5,_0x22c15c,_0x461d8a){ChatWebsiteEvents[_0x3445('0x5')](_0x1419a5+':'+_0xfff5['id'],_0xfff5);ChatWebsiteEvents[_0x3445('0x5')](_0x1419a5,_0xfff5);_0x461d8a(null);};}for(var e in events){if(events[_0x3445('0x6')](e)){var event=events[e];ChatWebsite[_0x3445('0x7')](e,emitEvent(event));}}module[_0x3445('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x34e8,0x12c));var _0x834e=function(_0xa663f7,_0x11d567){_0xa663f7=_0xa663f7-0x0;var _0x28cad6=_0x34e8[_0xa663f7];return _0x28cad6;};'use strict';var EventEmitter=require(_0x834e('0x0'));var ChatWebsite=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){ChatWebsiteEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);ChatWebsiteEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x834e('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 9c86c11..2a2ea3a 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 _0xd05b=['../../config/environment','exports','chat_websites','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x28f134,_0x1b5529){var _0x19ff60=function(_0x52ba9f){while(--_0x52ba9f){_0x28f134['push'](_0x28f134['shift']());}};_0x19ff60(++_0x1b5529);}(_0xd05b,0xad));var _0xbd05=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xd05b[_0x40ac5e];return _0x2839d6;};'use strict';var _=require('lodash');var util=require(_0xbd05('0x0'));var logger=require('../../config/logger')(_0xbd05('0x1'));var moment=require(_0xbd05('0x2'));var BPromise=require(_0xbd05('0x3'));var rp=require(_0xbd05('0x4'));var fs=require('fs');var path=require(_0xbd05('0x5'));var rimraf=require(_0xbd05('0x6'));var config=require(_0xbd05('0x7'));var attributes=require('./chatWebsite.attributes');module[_0xbd05('0x8')]=function(_0x5eb050,_0x573e75){return _0x5eb050['define']('ChatWebsite',attributes,{'tableName':_0xbd05('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e5c=['define','ChatWebsite','chat_websites','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x3ec633,_0x344b11){var _0x9f686c=function(_0x18d2c3){while(--_0x18d2c3){_0x3ec633['push'](_0x3ec633['shift']());}};_0x9f686c(++_0x344b11);}(_0x8e5c,0x12c));var _0xc8e5=function(_0x2f1761,_0x37e731){_0x2f1761=_0x2f1761-0x0;var _0x23dc52=_0x8e5c[_0x2f1761];return _0x23dc52;};'use strict';var _=require(_0xc8e5('0x0'));var util=require('util');var logger=require(_0xc8e5('0x1'))('api');var moment=require(_0xc8e5('0x2'));var BPromise=require('bluebird');var rp=require(_0xc8e5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8e5('0x4'));var config=require(_0xc8e5('0x5'));var attributes=require(_0xc8e5('0x6'));module[_0xc8e5('0x7')]=function(_0x4f5e41,_0xb1d24a){return _0x4f5e41[_0xc8e5('0x8')](_0xc8e5('0x9'),attributes,{'tableName':_0xc8e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 68d677d..abeb42d 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 _0xdb67=['ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','info'];(function(_0x114da0,_0x19188f){var _0x5f1d8a=function(_0x154c3d){while(--_0x154c3d){_0x114da0['push'](_0x114da0['shift']());}};_0x5f1d8a(++_0x19188f);}(_0xdb67,0x1d9));var _0x7db6=function(_0x504b28,_0x5211e3){_0x504b28=_0x504b28-0x0;var _0x11851c=_0xdb67[_0x504b28];return _0x11851c;};'use strict';var _=require(_0x7db6('0x0'));var util=require('util');var moment=require(_0x7db6('0x1'));var BPromise=require(_0x7db6('0x2'));var rs=require(_0x7db6('0x3'));var fs=require('fs');var Redis=require(_0x7db6('0x4'));var db=require(_0x7db6('0x5'))['db'];var utils=require(_0x7db6('0x6'));var logger=require(_0x7db6('0x7'))(_0x7db6('0x8'));var config=require(_0x7db6('0x9'));var jayson=require(_0x7db6('0xa'));var client=jayson['client'][_0x7db6('0xb')]({'port':0x232a});config[_0x7db6('0xc')]=_[_0x7db6('0xd')](config[_0x7db6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7db6('0xe'))(new Redis(config[_0x7db6('0xc')]));require(_0x7db6('0xf'))[_0x7db6('0x10')](socket);function respondWithRpcPromise(_0x1eae6a,_0x33b3c7,_0x2b9d1b){return new BPromise(function(_0x5a30db,_0x58510b){return client[_0x7db6('0x11')](_0x1eae6a,_0x2b9d1b)[_0x7db6('0x12')](function(_0x334524){logger[_0x7db6('0x13')](_0x7db6('0x14'),_0x33b3c7,'request\x20sent');logger[_0x7db6('0x15')](_0x7db6('0x16'),_0x33b3c7,_0x7db6('0x17'),JSON[_0x7db6('0x18')](_0x334524));if(_0x334524['error']){if(_0x334524[_0x7db6('0x19')][_0x7db6('0x1a')]===0x1f4){logger[_0x7db6('0x19')](_0x7db6('0x14'),_0x33b3c7,_0x334524[_0x7db6('0x19')][_0x7db6('0x1b')]);return _0x58510b(_0x334524[_0x7db6('0x19')]['message']);}logger[_0x7db6('0x19')](_0x7db6('0x14'),_0x33b3c7,_0x334524[_0x7db6('0x19')][_0x7db6('0x1b')]);return _0x5a30db(_0x334524[_0x7db6('0x19')][_0x7db6('0x1b')]);}else{logger[_0x7db6('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x33b3c7,_0x7db6('0x17'));_0x5a30db(_0x334524[_0x7db6('0x1c')][_0x7db6('0x1b')]);}})['catch'](function(_0x545500){logger['error'](_0x7db6('0x14'),_0x33b3c7,_0x545500);_0x58510b(_0x545500);});});} \ No newline at end of file +var _0x4127=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment'];(function(_0x170a33,_0x22cd64){var _0x3d5687=function(_0x4f7299){while(--_0x4f7299){_0x170a33['push'](_0x170a33['shift']());}};_0x3d5687(++_0x22cd64);}(_0x4127,0x129));var _0x7412=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x4127[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x7412('0x0'));var util=require(_0x7412('0x1'));var moment=require(_0x7412('0x2'));var BPromise=require('bluebird');var rs=require(_0x7412('0x3'));var fs=require('fs');var Redis=require(_0x7412('0x4'));var db=require(_0x7412('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7412('0x6'))(_0x7412('0x7'));var config=require(_0x7412('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7412('0x9')][_0x7412('0xa')]({'port':0x232a});config[_0x7412('0xb')]=_[_0x7412('0xc')](config[_0x7412('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7412('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x7412('0xe')](socket);function respondWithRpcPromise(_0x249200,_0x24bde9,_0x47b532){return new BPromise(function(_0x2b988d,_0xe636f5){return client[_0x7412('0xf')](_0x249200,_0x47b532)['then'](function(_0x2ed0b5){logger[_0x7412('0x10')](_0x7412('0x11'),_0x24bde9,_0x7412('0x12'));logger[_0x7412('0x13')](_0x7412('0x14'),_0x24bde9,_0x7412('0x12'),JSON[_0x7412('0x15')](_0x2ed0b5));if(_0x2ed0b5['error']){if(_0x2ed0b5['error']['code']===0x1f4){logger[_0x7412('0x16')](_0x7412('0x11'),_0x24bde9,_0x2ed0b5[_0x7412('0x16')][_0x7412('0x17')]);return _0xe636f5(_0x2ed0b5['error']['message']);}logger[_0x7412('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x24bde9,_0x2ed0b5[_0x7412('0x16')]['message']);return _0x2b988d(_0x2ed0b5[_0x7412('0x16')][_0x7412('0x17')]);}else{logger[_0x7412('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x24bde9,'request\x20sent');_0x2b988d(_0x2ed0b5['result'][_0x7412('0x17')]);}})[_0x7412('0x18')](function(_0xa4cb28){logger[_0x7412('0x16')](_0x7412('0x11'),_0x24bde9,_0xa4cb28);_0xe636f5(_0xa4cb28);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index fab0b20..d3f6344 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 _0x64d4=['length','chatWebsite:','save','remove','update','emit','register'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x64d4,0xe9));var _0x464d=function(_0x586105,_0xff70c){_0x586105=_0x586105-0x0;var _0xd5d6ff=_0x64d4[_0x586105];return _0xd5d6ff;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x464d('0x0'),_0x464d('0x1'),_0x464d('0x2')];function createListener(_0x5edc13,_0x34bd55){return function(_0x1ce7ba){_0x34bd55[_0x464d('0x3')](_0x5edc13,_0x1ce7ba);};}function removeListener(_0x32a217,_0x573c18){return function(){ChatWebsiteEvents['removeListener'](_0x32a217,_0x573c18);};}exports[_0x464d('0x4')]=function(_0x56f18c){for(var _0x3a3be9=0x0,_0x3e1dfd=events[_0x464d('0x5')];_0x3a3be9<_0x3e1dfd;_0x3a3be9++){var _0x41cb44=events[_0x3a3be9];var _0xc9b20d=createListener(_0x464d('0x6')+_0x41cb44,_0x56f18c);ChatWebsiteEvents['on'](_0x41cb44,_0xc9b20d);}}; \ No newline at end of file +var _0x8ff7=['length','./chatWebsite.events','update','emit','register'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ff7,0x10a));var _0x78ff=function(_0x5b5ebf,_0x2b0a3f){_0x5b5ebf=_0x5b5ebf-0x0;var _0x25243c=_0x8ff7[_0x5b5ebf];return _0x25243c;};'use strict';var ChatWebsiteEvents=require(_0x78ff('0x0'));var events=['save','remove',_0x78ff('0x1')];function createListener(_0x50e36d,_0x1df00c){return function(_0x9cb999){_0x1df00c[_0x78ff('0x2')](_0x50e36d,_0x9cb999);};}function removeListener(_0x540135,_0x26e6d1){return function(){ChatWebsiteEvents['removeListener'](_0x540135,_0x26e6d1);};}exports[_0x78ff('0x3')]=function(_0x3c4e76){for(var _0x45c881=0x0,_0x2c97e3=events[_0x78ff('0x4')];_0x45c881<_0x2c97e3;_0x45c881++){var _0x1b588a=events[_0x45c881];var _0x4ea477=createListener('chatWebsite:'+_0x1b588a,_0x3c4e76);ChatWebsiteEvents['on'](_0x1b588a,_0x4ea477);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 0b75fa5..622befb 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 _0xb027=['file','addLogo','server/files/images/avatars/','format','addAvatar','originalname','/:id/customer_avatar','single','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','any','addInteraction','/:id/applications','addProactiveActions','addAgents','put','update','delete','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet','/:id/proactive_actions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now'];(function(_0x5f0632,_0x4134a7){var _0x43da22=function(_0x512f45){while(--_0x512f45){_0x5f0632['push'](_0x5f0632['shift']());}};_0x43da22(++_0x4134a7);}(_0xb027,0x16c));var _0x7b02=function(_0xf3a73,_0x2b3d10){_0xf3a73=_0xf3a73-0x0;var _0x3ddfd5=_0xb027[_0xf3a73];return _0x3ddfd5;};'use strict';var multer=require('multer');var util=require(_0x7b02('0x0'));var path=require(_0x7b02('0x1'));var timeout=require(_0x7b02('0x2'));var express=require(_0x7b02('0x3'));var router=express[_0x7b02('0x4')]();var fs_extra=require(_0x7b02('0x5'));var auth=require(_0x7b02('0x6'));var interaction=require(_0x7b02('0x7'));var config=require(_0x7b02('0x8'));var controller=require('./chatWebsite.controller');router[_0x7b02('0x9')]('/',auth[_0x7b02('0xa')](),controller[_0x7b02('0xb')]);router[_0x7b02('0x9')](_0x7b02('0xc'),auth['isAuthenticated'](),controller[_0x7b02('0xd')]);router['get'](_0x7b02('0xe'),auth[_0x7b02('0xa')](),controller[_0x7b02('0xf')]);router['get'](_0x7b02('0x10'),auth[_0x7b02('0xa')](),controller[_0x7b02('0x11')]);router[_0x7b02('0x9')]('/:id/canned_answers',auth[_0x7b02('0xa')](),controller[_0x7b02('0x12')]);router[_0x7b02('0x9')](_0x7b02('0x13'),controller[_0x7b02('0x14')]);router[_0x7b02('0x9')](_0x7b02('0x15'),controller[_0x7b02('0x16')]);router[_0x7b02('0x9')]('/:id/customer_avatar',controller[_0x7b02('0x17')]);router[_0x7b02('0x9')](_0x7b02('0x18'),controller['getSystemAvatar']);router[_0x7b02('0x9')](_0x7b02('0x19'),auth['isAuthenticated'](),controller[_0x7b02('0x1a')]);router['get']('/:id/snippet',controller[_0x7b02('0x1b')]);router[_0x7b02('0x9')]('/:id/applications',auth[_0x7b02('0xa')](),controller['getApplications']);router[_0x7b02('0x9')](_0x7b02('0x1c'),auth[_0x7b02('0xa')](),controller['getProactiveActions']);router[_0x7b02('0x9')]('/:id/fields',controller[_0x7b02('0x1d')]);router[_0x7b02('0x9')](_0x7b02('0x1e'),auth['isAuthenticated'](),controller[_0x7b02('0x1f')]);router[_0x7b02('0x9')](_0x7b02('0x20'),auth['isAuthenticated'](),controller[_0x7b02('0x21')]);router[_0x7b02('0x22')]('/',auth[_0x7b02('0xa')](),controller['create']);router[_0x7b02('0x22')](_0x7b02('0x10'),auth[_0x7b02('0xa')](),controller[_0x7b02('0x23')]);router['post'](_0x7b02('0x24'),auth[_0x7b02('0xa')](),controller[_0x7b02('0x25')]);var upload=multer({'storage':multer[_0x7b02('0x26')]({'destination':function(_0x3195c2,_0x40e7d9,_0x25800e){_0x25800e(null,path[_0x7b02('0x27')](config[_0x7b02('0x28')],_0x7b02('0x29')));},'filename':function(_0x593721,_0x19cb35,_0x2f1be3){_0x2f1be3(null,util['format'](_0x7b02('0x2a'),Date[_0x7b02('0x2b')](),_0x19cb35['originalname']));}})});router[_0x7b02('0x22')]('/:id/logo',upload['single'](_0x7b02('0x2c')),controller[_0x7b02('0x2d')]);var upload=multer({'storage':multer[_0x7b02('0x26')]({'destination':function(_0x231ba1,_0x88fb9f,_0x1091b9){_0x1091b9(null,path[_0x7b02('0x27')](config[_0x7b02('0x28')],_0x7b02('0x2e')));},'filename':function(_0x25929d,_0x5946b7,_0x380fb9){_0x380fb9(null,util[_0x7b02('0x2f')]('%s-%s',Date[_0x7b02('0x2b')](),_0x5946b7['originalname']));}})});router[_0x7b02('0x22')]('/:id/avatar',upload['single']('file'),controller[_0x7b02('0x30')]);var upload=multer({'storage':multer[_0x7b02('0x26')]({'destination':function(_0x247617,_0x3fc369,_0x4f19df){_0x4f19df(null,path[_0x7b02('0x27')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3855a5,_0x5562bb,_0x9a54ca){_0x9a54ca(null,util[_0x7b02('0x2f')](_0x7b02('0x2a'),Date[_0x7b02('0x2b')](),_0x5562bb[_0x7b02('0x31')]));}})});router[_0x7b02('0x22')](_0x7b02('0x32'),upload[_0x7b02('0x33')](_0x7b02('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x7b02('0x26')]({'destination':function(_0x136229,_0x2cfb70,_0x5f47ab){_0x5f47ab(null,path[_0x7b02('0x27')](config['root'],_0x7b02('0x2e')));},'filename':function(_0x4b8f86,_0xf8e88f,_0x3d7a19){_0x3d7a19(null,util['format'](_0x7b02('0x2a'),Date[_0x7b02('0x2b')](),_0xf8e88f[_0x7b02('0x31')]));}})});router['post'](_0x7b02('0x18'),upload[_0x7b02('0x33')]('file'),controller['addSystemAvatar']);router['post']('/:id/notify',controller[_0x7b02('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x7b02('0x26')]({'destination':function(_0x30decb,_0x15c469,_0x377eac){const _0x27f952=path[_0x7b02('0x27')](config[_0x7b02('0x28')],_0x7b02('0x35'),'attachments',_0x7b02('0x36'));fs_extra[_0x7b02('0x37')](_0x27f952,function(){_0x377eac(null,_0x27f952);});},'filename':function(_0x2acb70,_0x2f6587,_0x134be4){const _0x17897c=_0x2f6587[_0x7b02('0x31')][_0x7b02('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x32405e=path['extname'](_0x17897c);const _0x65a20=Date[_0x7b02('0x2b')]()+'-'+_0x17897c['replace'](_0x32405e,'')+_0x32405e;_0x134be4(null,_0x65a20);}})});router[_0x7b02('0x22')](_0x7b02('0x39'),offlineUploadMulter[_0x7b02('0x3a')](),controller['offline']);router[_0x7b02('0x22')](_0x7b02('0x19'),auth[_0x7b02('0xa')](),controller[_0x7b02('0x3b')]);router[_0x7b02('0x22')](_0x7b02('0x3c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x7b02('0x22')](_0x7b02('0x1c'),auth[_0x7b02('0xa')](),controller[_0x7b02('0x3d')]);router[_0x7b02('0x22')]('/:id/users',auth[_0x7b02('0xa')](),controller[_0x7b02('0x3e')]);router[_0x7b02('0x3f')](_0x7b02('0xe'),auth[_0x7b02('0xa')](),controller[_0x7b02('0x40')]);router[_0x7b02('0x41')]('/:id',auth[_0x7b02('0xa')](),controller['destroy']);router['delete'](_0x7b02('0x10'),auth[_0x7b02('0xa')](),controller['removeDispositions']);router[_0x7b02('0x41')](_0x7b02('0x24'),auth[_0x7b02('0xa')](),controller[_0x7b02('0x42')]);router[_0x7b02('0x41')]('/:id/users',auth[_0x7b02('0xa')](),controller['removeAgents']);module[_0x7b02('0x43')]=router; \ No newline at end of file +var _0x456e=['/:id/proactive_actions','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','isAuthenticated','index','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','/:id/offline_messages','/:id/users','getAgents','create','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','file','server/files/images/avatars/','originalname','/:id/avatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','any','addApplications'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x456e,0x1ed));var _0xe456=function(_0x406bb7,_0x61b0a){_0x406bb7=_0x406bb7-0x0;var _0x23924f=_0x456e[_0x406bb7];return _0x23924f;};'use strict';var multer=require(_0xe456('0x0'));var util=require(_0xe456('0x1'));var path=require(_0xe456('0x2'));var timeout=require('connect-timeout');var express=require(_0xe456('0x3'));var router=express[_0xe456('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe456('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router['get']('/',auth[_0xe456('0x6')](),controller[_0xe456('0x7')]);router[_0xe456('0x8')](_0xe456('0x9'),auth[_0xe456('0x6')](),controller['describe']);router[_0xe456('0x8')](_0xe456('0xa'),auth[_0xe456('0x6')](),controller[_0xe456('0xb')]);router[_0xe456('0x8')](_0xe456('0xc'),auth[_0xe456('0x6')](),controller[_0xe456('0xd')]);router['get'](_0xe456('0xe'),auth[_0xe456('0x6')](),controller[_0xe456('0xf')]);router[_0xe456('0x8')](_0xe456('0x10'),controller[_0xe456('0x11')]);router[_0xe456('0x8')]('/:id/avatar',controller['getAvatar']);router[_0xe456('0x8')](_0xe456('0x12'),controller[_0xe456('0x13')]);router[_0xe456('0x8')](_0xe456('0x14'),controller[_0xe456('0x15')]);router[_0xe456('0x8')](_0xe456('0x16'),auth[_0xe456('0x6')](),controller[_0xe456('0x17')]);router['get'](_0xe456('0x18'),controller['getSnippet']);router['get'](_0xe456('0x19'),auth['isAuthenticated'](),controller[_0xe456('0x1a')]);router['get']('/:id/proactive_actions',auth[_0xe456('0x6')](),controller[_0xe456('0x1b')]);router['get'](_0xe456('0x1c'),controller['getFields']);router['get'](_0xe456('0x1d'),auth[_0xe456('0x6')](),controller['getOfflineMessages']);router[_0xe456('0x8')](_0xe456('0x1e'),auth[_0xe456('0x6')](),controller[_0xe456('0x1f')]);router['post']('/',auth[_0xe456('0x6')](),controller[_0xe456('0x20')]);router[_0xe456('0x21')](_0xe456('0xc'),auth['isAuthenticated'](),controller[_0xe456('0x22')]);router[_0xe456('0x21')](_0xe456('0xe'),auth['isAuthenticated'](),controller[_0xe456('0x23')]);var upload=multer({'storage':multer[_0xe456('0x24')]({'destination':function(_0x4d17c0,_0x5b83f8,_0x2022eb){_0x2022eb(null,path[_0xe456('0x25')](config[_0xe456('0x26')],_0xe456('0x27')));},'filename':function(_0x4b9ccc,_0x4ca70e,_0x38ef68){_0x38ef68(null,util[_0xe456('0x28')](_0xe456('0x29'),Date[_0xe456('0x2a')](),_0x4ca70e['originalname']));}})});router[_0xe456('0x21')](_0xe456('0x10'),upload['single'](_0xe456('0x2b')),controller['addLogo']);var upload=multer({'storage':multer[_0xe456('0x24')]({'destination':function(_0x4c5eb1,_0x164c4b,_0x265f52){_0x265f52(null,path[_0xe456('0x25')](config[_0xe456('0x26')],_0xe456('0x2c')));},'filename':function(_0x4222dd,_0x264ac3,_0x4cf0e0){_0x4cf0e0(null,util[_0xe456('0x28')](_0xe456('0x29'),Date[_0xe456('0x2a')](),_0x264ac3[_0xe456('0x2d')]));}})});router[_0xe456('0x21')](_0xe456('0x2e'),upload[_0xe456('0x2f')](_0xe456('0x2b')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x295c4f,_0x4cb5bc,_0x5d5fc0){_0x5d5fc0(null,path[_0xe456('0x25')](config[_0xe456('0x26')],_0xe456('0x2c')));},'filename':function(_0x3b865d,_0x1b4133,_0x5269cd){_0x5269cd(null,util[_0xe456('0x28')](_0xe456('0x29'),Date[_0xe456('0x2a')](),_0x1b4133[_0xe456('0x2d')]));}})});router['post']('/:id/customer_avatar',upload[_0xe456('0x2f')]('file'),controller[_0xe456('0x30')]);var upload=multer({'storage':multer[_0xe456('0x24')]({'destination':function(_0x33dac2,_0x1e3a1e,_0x33dcd1){_0x33dcd1(null,path[_0xe456('0x25')](config[_0xe456('0x26')],_0xe456('0x2c')));},'filename':function(_0x2df093,_0xe2209e,_0x630e7a){_0x630e7a(null,util['format'](_0xe456('0x29'),Date[_0xe456('0x2a')](),_0xe2209e[_0xe456('0x2d')]));}})});router[_0xe456('0x21')]('/:id/system_avatar',upload[_0xe456('0x2f')]('file'),controller[_0xe456('0x31')]);router[_0xe456('0x21')](_0xe456('0x32'),controller[_0xe456('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x3f4503,_0x45a511,_0x437408){const _0x169233=path[_0xe456('0x25')](config[_0xe456('0x26')],_0xe456('0x34'),_0xe456('0x35'),_0xe456('0x36'));fs_extra[_0xe456('0x37')](_0x169233,function(){_0x437408(null,_0x169233);});},'filename':function(_0x2f42ce,_0x506efe,_0x320bca){const _0x477ba9=_0x506efe[_0xe456('0x2d')][_0xe456('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1cc1ed=path['extname'](_0x477ba9);const _0xeb48fe=Date['now']()+'-'+_0x477ba9[_0xe456('0x38')](_0x1cc1ed,'')+_0x1cc1ed;_0x320bca(null,_0xeb48fe);}})});router[_0xe456('0x21')]('/:id/offline',offlineUploadMulter[_0xe456('0x39')](),controller['offline']);router[_0xe456('0x21')](_0xe456('0x16'),auth[_0xe456('0x6')](),controller['addInteraction']);router[_0xe456('0x21')](_0xe456('0x19'),auth['isAuthenticated'](),controller[_0xe456('0x3a')]);router[_0xe456('0x21')](_0xe456('0x3b'),auth[_0xe456('0x6')](),controller[_0xe456('0x3c')]);router['post'](_0xe456('0x1e'),auth[_0xe456('0x6')](),controller[_0xe456('0x3d')]);router['put'](_0xe456('0xa'),auth[_0xe456('0x6')](),controller[_0xe456('0x3e')]);router[_0xe456('0x3f')](_0xe456('0xa'),auth[_0xe456('0x6')](),controller[_0xe456('0x40')]);router[_0xe456('0x3f')](_0xe456('0xc'),auth['isAuthenticated'](),controller[_0xe456('0x41')]);router[_0xe456('0x3f')](_0xe456('0xe'),auth['isAuthenticated'](),controller[_0xe456('0x42')]);router['delete'](_0xe456('0x1e'),auth['isAuthenticated'](),controller[_0xe456('0x43')]);module[_0xe456('0x44')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 0b4ddeb..1398dcf 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 _0x5ae6=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x2409ae,_0x48bfc6){var _0x19ab84=function(_0x2acde1){while(--_0x2acde1){_0x2409ae['push'](_0x2409ae['shift']());}};_0x19ab84(++_0x48bfc6);}(_0x5ae6,0xe6));var _0x65ae=function(_0x249d99,_0x16b584){_0x249d99=_0x249d99-0x0;var _0x5bfb05=_0x5ae6[_0x249d99];return _0x5bfb05;};'use strict';var Sequelize=require(_0x65ae('0x0'));module[_0x65ae('0x1')]={'name':{'type':Sequelize[_0x65ae('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x65ae('0x3')](_0x65ae('0x4'),_0x65ae('0x5'),_0x65ae('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x65ae('0x3')](_0x65ae('0x7'),_0x65ae('0x8'))},'data1':{'type':Sequelize['STRING'],'comment':_0x65ae('0x9')},'data2':{'type':Sequelize[_0x65ae('0x2')],'comment':_0x65ae('0xa')},'data3':{'type':Sequelize[_0x65ae('0x2')],'comment':_0x65ae('0xb')},'data4':{'type':Sequelize[_0x65ae('0x2')],'comment':_0x65ae('0xc')},'data5':{'type':Sequelize[_0x65ae('0xd')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize['TEXT'],'comment':_0x65ae('0xe')},'data7':{'type':Sequelize[_0x65ae('0xd')],'comment':_0x65ae('0xf')}}; \ No newline at end of file +var _0x1ab0=['MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x429656,_0x5ac582){var _0x1ac509=function(_0x5bf359){while(--_0x5bf359){_0x429656['push'](_0x429656['shift']());}};_0x1ac509(++_0x5ac582);}(_0x1ab0,0xa3));var _0x01ab=function(_0x49c2df,_0x56ad8e){_0x49c2df=_0x49c2df-0x0;var _0x2ef01d=_0x1ab0[_0x49c2df];return _0x2ef01d;};'use strict';var Sequelize=require(_0x01ab('0x0'));module[_0x01ab('0x1')]={'name':{'type':Sequelize[_0x01ab('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x01ab('0x3')](_0x01ab('0x4'),'Google',_0x01ab('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x01ab('0x3')]('Outlook365',_0x01ab('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x01ab('0x7')},'data2':{'type':Sequelize[_0x01ab('0x2')],'comment':_0x01ab('0x8')},'data3':{'type':Sequelize[_0x01ab('0x2')],'comment':_0x01ab('0x9')},'data4':{'type':Sequelize[_0x01ab('0x2')],'comment':_0x01ab('0xa')},'data5':{'type':Sequelize[_0x01ab('0xb')],'comment':_0x01ab('0xc')},'data6':{'type':Sequelize[_0x01ab('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x01ab('0xb')],'comment':_0x01ab('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index f18d5c4..784cdad 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 _0x19d4=['fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CloudProvider','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','find','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','service','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','update','then','destroy','error','name','send','padEnd','slice','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x19d4,0x1b9));var _0x419d=function(_0x3eff38,_0x3fff65){_0x3eff38=_0x3eff38-0x0;var _0xbf716a=_0x19d4[_0x3eff38];return _0xbf716a;};'use strict';var _=require(_0x419d('0x0'));var Redis=require(_0x419d('0x1'));var qs=require(_0x419d('0x2'));var encryptor=require(_0x419d('0x3'));var config=require(_0x419d('0x4'));var logger=require('../../config/logger')(_0x419d('0x5'));var db=require(_0x419d('0x6'))['db'];var oauth=require(_0x419d('0x7'));config[_0x419d('0x8')]=_['defaults'](config[_0x419d('0x8')],{'host':_0x419d('0x9'),'port':0x18eb});var socket=require(_0x419d('0xa'))(new Redis(config[_0x419d('0x8')]));var redis=new Redis(config[_0x419d('0x8')]);function respondWithStatusCode(_0x42ead1,_0xe3c3fd){_0xe3c3fd=_0xe3c3fd||0xcc;return function(_0x4267c0){if(_0x4267c0){return _0x42ead1[_0x419d('0xb')](_0xe3c3fd);}return _0x42ead1[_0x419d('0xc')](_0xe3c3fd)[_0x419d('0xd')]();};}function respondWithResult(_0xbcbf07,_0x12ec3a){_0x12ec3a=_0x12ec3a||0xc8;return function(_0x555e51){if(_0x555e51){return _0xbcbf07[_0x419d('0xc')](_0x12ec3a)[_0x419d('0xe')](_0x555e51);}};}function respondWithFilteredResult(_0x3a69a7,_0x38db4f){return function(_0x8a9679){if(_0x8a9679){var _0x38671d=typeof _0x38db4f[_0x419d('0xf')]==='undefined'&&typeof _0x38db4f[_0x419d('0x10')]===_0x419d('0x11');var _0x3c5a84=_0x8a9679['count'];var _0x4bf4a6=_0x38671d?0x0:_0x38db4f['offset'];var _0x2bf4b4=_0x38671d?_0x8a9679[_0x419d('0x12')]:_0x38db4f['offset']+_0x38db4f[_0x419d('0x10')];var _0x33e524;if(_0x2bf4b4>=_0x3c5a84){_0x2bf4b4=_0x3c5a84;_0x33e524=0xc8;}else{_0x33e524=0xce;}_0x3a69a7[_0x419d('0xc')](_0x33e524);return _0x3a69a7[_0x419d('0x13')]('Content-Range',_0x4bf4a6+'-'+_0x2bf4b4+'/'+_0x3c5a84)[_0x419d('0xe')](_0x8a9679);}return null;};}function saveUpdates(_0x74032a){return function(_0x4bc85e){if(_0x4bc85e){return _0x4bc85e[_0x419d('0x14')](_0x74032a)[_0x419d('0x15')](function(_0x21539e){return _0x21539e;});}return null;};}function removeEntity(_0x3597d7){return function(_0x4b7eef){if(_0x4b7eef){return _0x4b7eef[_0x419d('0x16')]()[_0x419d('0x15')](function(){_0x3597d7['status'](0xcc)[_0x419d('0xd')]();});}};}function handleEntityNotFound(_0x5ca827){return function(_0x298691){if(!_0x298691){_0x5ca827[_0x419d('0xb')](0x194);}return _0x298691;};}function handleError(_0x2a2103,_0x38e0fb){_0x38e0fb=_0x38e0fb||0x1f4;return function(_0x29d8bc){logger[_0x419d('0x17')](_0x29d8bc['stack']);if(_0x29d8bc[_0x419d('0x18')]){delete _0x29d8bc[_0x419d('0x18')];}_0x2a2103[_0x419d('0xc')](_0x38e0fb)[_0x419d('0x19')](_0x29d8bc);};}function maskClientSecret(_0x4d54c7){return _[_0x419d('0x1a')](_0x4d54c7[_0x419d('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0x5ecd56,_0x419103){var _0x5f532e={},_0x121e39={},_0x4991ed={'count':0x0,'rows':[]};var _0x403045=_[_0x419d('0x1c')](db['CloudProvider'][_0x419d('0x1d')],function(_0x30b800){return{'name':_0x30b800[_0x419d('0x1e')],'type':_0x30b800[_0x419d('0x1f')][_0x419d('0x20')]};});_0x121e39['model']=_[_0x419d('0x1c')](_0x403045,_0x419d('0x18'));_0x121e39[_0x419d('0x21')]=_[_0x419d('0x22')](_0x5ecd56[_0x419d('0x21')]);_0x121e39[_0x419d('0x23')]=_[_0x419d('0x24')](_0x121e39['model'],_0x121e39['query']);_0x5f532e[_0x419d('0x25')]=_['intersection'](_0x121e39[_0x419d('0x26')],qs[_0x419d('0x27')](_0x5ecd56['query'][_0x419d('0x27')]));_0x5f532e[_0x419d('0x25')]=_0x5f532e[_0x419d('0x25')][_0x419d('0x28')]?_0x5f532e[_0x419d('0x25')]:_0x121e39[_0x419d('0x26')];if(!_0x5ecd56[_0x419d('0x21')]['hasOwnProperty'](_0x419d('0x29'))){_0x5f532e[_0x419d('0x10')]=qs[_0x419d('0x10')](_0x5ecd56[_0x419d('0x21')][_0x419d('0x10')]);_0x5f532e[_0x419d('0xf')]=qs['offset'](_0x5ecd56[_0x419d('0x21')]['offset']);}_0x5f532e[_0x419d('0x2a')]=qs[_0x419d('0x2b')](_0x5ecd56[_0x419d('0x21')][_0x419d('0x2b')]);_0x5f532e[_0x419d('0x2c')]=qs[_0x419d('0x23')](_[_0x419d('0x2d')](_0x5ecd56[_0x419d('0x21')],_0x121e39[_0x419d('0x23')]),_0x403045);if(_0x5ecd56['query'][_0x419d('0x2e')]){_0x5f532e[_0x419d('0x2c')]=_[_0x419d('0x2f')](_0x5f532e[_0x419d('0x2c')],{'$or':_['map'](_0x403045,function(_0x4ce8e8){if(_0x4ce8e8[_0x419d('0x1f')]!==_0x419d('0x30')){var _0x142649={};_0x142649[_0x4ce8e8[_0x419d('0x18')]]={'$like':'%'+_0x5ecd56['query'][_0x419d('0x2e')]+'%'};return _0x142649;}})});}_0x5f532e=_['merge']({},_0x5f532e,_0x5ecd56[_0x419d('0x31')]);var _0x38819e={'where':_0x5f532e[_0x419d('0x2c')]};return db[_0x419d('0x32')][_0x419d('0x12')](_0x38819e)[_0x419d('0x15')](function(_0x5bc4f6){_0x4991ed[_0x419d('0x12')]=_0x5bc4f6;if(_0x5ecd56['query'][_0x419d('0x33')]){_0x5f532e[_0x419d('0x34')]=[{'all':!![]}];}return db[_0x419d('0x32')][_0x419d('0x35')](_0x5f532e);})[_0x419d('0x15')](function(_0x2d61d0){_0x4991ed[_0x419d('0x36')]=_[_0x419d('0x1c')](_0x2d61d0,function(_0x13d908){if(_0x13d908['service']===_0x419d('0x37')){var _0x4fe9f0=encryptor[_0x419d('0x38')](_0x13d908[_0x419d('0x39')]);_0x13d908[_0x419d('0x39')]=maskClientSecret(_0x4fe9f0);}return _0x13d908;});return _0x4991ed;})[_0x419d('0x15')](respondWithFilteredResult(_0x419103,_0x5f532e))[_0x419d('0x3a')](handleError(_0x419103,null));};exports[_0x419d('0x3b')]=function(_0xaf3655,_0x56d5c6){var _0x1c31e2={'raw':!![],'where':{'id':_0xaf3655['params']['id']}},_0x3dcc1e={};_0x3dcc1e['model']=_['keys'](db[_0x419d('0x32')][_0x419d('0x1d')]);_0x3dcc1e[_0x419d('0x21')]=_[_0x419d('0x22')](_0xaf3655['query']);_0x3dcc1e[_0x419d('0x23')]=_[_0x419d('0x24')](_0x3dcc1e[_0x419d('0x26')],_0x3dcc1e[_0x419d('0x21')]);_0x1c31e2[_0x419d('0x25')]=_['intersection'](_0x3dcc1e[_0x419d('0x26')],qs[_0x419d('0x27')](_0xaf3655[_0x419d('0x21')][_0x419d('0x27')]));_0x1c31e2[_0x419d('0x25')]=_0x1c31e2['attributes'][_0x419d('0x28')]?_0x1c31e2[_0x419d('0x25')]:_0x3dcc1e[_0x419d('0x26')];if(_0xaf3655['query'][_0x419d('0x33')]){_0x1c31e2['include']=[{'all':!![]}];}_0x1c31e2=_['merge']({},_0x1c31e2,_0xaf3655[_0x419d('0x31')]);return db['CloudProvider'][_0x419d('0x3c')](_0x1c31e2)['then'](handleEntityNotFound(_0x56d5c6,null))[_0x419d('0x15')](function(_0x3f8474){if(_0x3f8474['service']===_0x419d('0x37')){var _0x2d2a74=encryptor[_0x419d('0x38')](_0x3f8474[_0x419d('0x39')]);_0x3f8474[_0x419d('0x39')]=maskClientSecret(_0x2d2a74);}return _0x3f8474;})[_0x419d('0x15')](respondWithResult(_0x56d5c6,null))[_0x419d('0x3a')](handleError(_0x56d5c6,null));};exports[_0x419d('0x3d')]=function(_0x5cc289,_0x5b4c3a){if(!_0x5cc289['body']['name'])throw new Error(_0x419d('0x3e'));if(!_0x5cc289[_0x419d('0x3f')]['service'])throw new Error(_0x419d('0x40'));var _0x39c566=db[_0x419d('0x32')][_0x419d('0x1d')]['service'][_0x419d('0x41')];if(!_0x39c566['includes'](_0x5cc289[_0x419d('0x3f')]['service']))throw new Error(_0x419d('0x42')+_0x39c566[_0x419d('0x43')](',\x20'));if(_0x5cc289['body']['service']==='MicrosoftAzure'&&_0x5cc289['body'][_0x419d('0x39')]){_0x5cc289[_0x419d('0x3f')][_0x419d('0x39')]=encryptor[_0x419d('0x44')](_0x5cc289[_0x419d('0x3f')][_0x419d('0x39')]);}return db[_0x419d('0x32')]['create'](_0x5cc289[_0x419d('0x3f')],{})[_0x419d('0x15')](respondWithResult(_0x5b4c3a,0xc9))[_0x419d('0x3a')](handleError(_0x5b4c3a,null));};exports[_0x419d('0x14')]=function(_0x51b33f,_0x22a7ba){if(_0x51b33f[_0x419d('0x3f')]['id']){delete _0x51b33f[_0x419d('0x3f')]['id'];}return db[_0x419d('0x32')][_0x419d('0x3c')]({'where':{'id':_0x51b33f[_0x419d('0x45')]['id']}})[_0x419d('0x15')](handleEntityNotFound(_0x22a7ba,null))[_0x419d('0x15')](function(_0x124c82){if(_0x124c82[_0x419d('0x46')]===_0x419d('0x37')&&_0x51b33f['body'][_0x419d('0x39')]){_0x51b33f[_0x419d('0x3f')][_0x419d('0x39')]=encryptor[_0x419d('0x44')](_0x51b33f[_0x419d('0x3f')][_0x419d('0x39')]);}return _0x124c82;})[_0x419d('0x15')](saveUpdates(_0x51b33f[_0x419d('0x3f')],null))[_0x419d('0x15')](respondWithResult(_0x22a7ba,null))[_0x419d('0x3a')](handleError(_0x22a7ba,null));};exports[_0x419d('0x16')]=function(_0x44a4a4,_0x29fb82){return db['CloudProvider'][_0x419d('0x3c')]({'where':{'id':_0x44a4a4[_0x419d('0x45')]['id']}})[_0x419d('0x15')](handleEntityNotFound(_0x29fb82,null))[_0x419d('0x15')](removeEntity(_0x29fb82,null))[_0x419d('0x3a')](handleError(_0x29fb82,null));};exports[_0x419d('0x47')]=function(_0x163beb,_0x311157){return db[_0x419d('0x32')][_0x419d('0x48')]({'where':{'id':_0x163beb[_0x419d('0x45')]['id']},'raw':!![]})[_0x419d('0x15')](function(_0x1fbd36){if(!_0x1fbd36)return _0x311157[_0x419d('0xb')](0x194);return{'url':oauth[_0x419d('0x49')](_0x1fbd36,_0x163beb[_0x419d('0x4a')]['id'])};})[_0x419d('0x15')](respondWithResult(_0x311157,null))[_0x419d('0x3a')](handleError(_0x311157,null));};exports[_0x419d('0x4b')]=function(_0x428401,_0x47d96d){var _0x38b44f=_0x428401[_0x419d('0x3f')];var _0x2345da;var _0x3c660a;if(_0x38b44f[_0x419d('0x17')])throw _0x38b44f;redis[_0x419d('0x4c')](_0x38b44f[_0x419d('0x4d')])[_0x419d('0x15')](function(_0x380657){if(!_0x380657)throw new Error(_0x419d('0x4e'));_0x2345da=JSON[_0x419d('0x4f')](_0x380657);var _0x1c543a=Buffer[_0x419d('0x50')](_0x38b44f[_0x419d('0x4d')],_0x419d('0x51'))[_0x419d('0x52')](_0x419d('0x53'));_0x3c660a=JSON[_0x419d('0x4f')](_0x1c543a);if(!oauth[_0x419d('0x54')](_0x38b44f['id_token'],_0x2345da[_0x419d('0x55')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x38b44f[_0x419d('0x4d')]);return oauth[_0x419d('0x56')](_0x38b44f[_0x419d('0x57')],_0x2345da);})[_0x419d('0x15')](function(_0x5a5fcc){_0x2345da[_0x419d('0x58')]=_0x5a5fcc['access_token'];_0x2345da[_0x419d('0x59')]=_0x5a5fcc[_0x419d('0x5a')];return db['CloudProvider'][_0x419d('0x14')]({'data5':_0x2345da[_0x419d('0x58')],'data6':_0x2345da[_0x419d('0x59')]},{'where':{'id':_0x2345da['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x2345da);socket['emit'](_0x419d('0x5b'),{'id':_0x3c660a['id']});return;})[_0x419d('0x15')](respondWithStatusCode(_0x47d96d,null))[_0x419d('0x3a')](function(_0x47d06b){if(_0x3c660a){socket[_0x419d('0x5c')](_0x419d('0x5d'),{'id':_0x3c660a['id']});}if(!_0x2345da){logger[_0x419d('0x17')](_0x419d('0x5e'),_0x47d06b);return _0x47d96d[_0x419d('0xc')](0x1f4)[_0x419d('0x19')](_0x47d06b[_0x419d('0x5f')]);}logger[_0x419d('0x17')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s',_0x2345da['id'],_0x47d06b);});}; \ No newline at end of file +var _0x2de2=['include','service','MicrosoftAzure','decryptString','data3','params','length','find','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','destroy','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','base64','ascii','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','state','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','startRefreshInterval','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','then','error','name','send','padEnd','slice','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','CloudProvider','includeAll'];(function(_0x318505,_0x37e5ba){var _0xa0da6e=function(_0x2d8ea1){while(--_0x2d8ea1){_0x318505['push'](_0x318505['shift']());}};_0xa0da6e(++_0x37e5ba);}(_0x2de2,0x139));var _0x22de=function(_0x1543e6,_0xa0a7f4){_0x1543e6=_0x1543e6-0x0;var _0x1ebbda=_0x2de2[_0x1543e6];return _0x1ebbda;};'use strict';var _=require(_0x22de('0x0'));var Redis=require(_0x22de('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x22de('0x2'));var config=require(_0x22de('0x3'));var logger=require(_0x22de('0x4'))(_0x22de('0x5'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0x22de('0x6')]=_[_0x22de('0x7')](config[_0x22de('0x6')],{'host':_0x22de('0x8'),'port':0x18eb});var socket=require(_0x22de('0x9'))(new Redis(config[_0x22de('0x6')]));var redis=new Redis(config[_0x22de('0x6')]);function respondWithStatusCode(_0x228a08,_0x32ee48){_0x32ee48=_0x32ee48||0xcc;return function(_0x20b2b2){if(_0x20b2b2){return _0x228a08[_0x22de('0xa')](_0x32ee48);}return _0x228a08[_0x22de('0xb')](_0x32ee48)[_0x22de('0xc')]();};}function respondWithResult(_0x444e26,_0xab721c){_0xab721c=_0xab721c||0xc8;return function(_0x5cdbcf){if(_0x5cdbcf){return _0x444e26['status'](_0xab721c)[_0x22de('0xd')](_0x5cdbcf);}};}function respondWithFilteredResult(_0x4ec22c,_0x2cc63d){return function(_0x24fea6){if(_0x24fea6){var _0x54204d=typeof _0x2cc63d[_0x22de('0xe')]==='undefined'&&typeof _0x2cc63d['limit']===_0x22de('0xf');var _0x1f6039=_0x24fea6[_0x22de('0x10')];var _0x3e977f=_0x54204d?0x0:_0x2cc63d['offset'];var _0x3cc049=_0x54204d?_0x24fea6[_0x22de('0x10')]:_0x2cc63d[_0x22de('0xe')]+_0x2cc63d[_0x22de('0x11')];var _0x24c1df;if(_0x3cc049>=_0x1f6039){_0x3cc049=_0x1f6039;_0x24c1df=0xc8;}else{_0x24c1df=0xce;}_0x4ec22c[_0x22de('0xb')](_0x24c1df);return _0x4ec22c['set'](_0x22de('0x12'),_0x3e977f+'-'+_0x3cc049+'/'+_0x1f6039)['json'](_0x24fea6);}return null;};}function saveUpdates(_0x419964){return function(_0x45608f){if(_0x45608f){return _0x45608f[_0x22de('0x13')](_0x419964)[_0x22de('0x14')](function(_0x3871ff){return _0x3871ff;});}return null;};}function removeEntity(_0x77cfd0){return function(_0x4124a7){if(_0x4124a7){return _0x4124a7['destroy']()[_0x22de('0x14')](function(){_0x77cfd0['status'](0xcc)[_0x22de('0xc')]();});}};}function handleEntityNotFound(_0x32f7ae){return function(_0x371694){if(!_0x371694){_0x32f7ae['sendStatus'](0x194);}return _0x371694;};}function handleError(_0x1b58dd,_0x2e0821){_0x2e0821=_0x2e0821||0x1f4;return function(_0x3d6af4){logger[_0x22de('0x15')](_0x3d6af4['stack']);if(_0x3d6af4['name']){delete _0x3d6af4[_0x22de('0x16')];}_0x1b58dd[_0x22de('0xb')](_0x2e0821)[_0x22de('0x17')](_0x3d6af4);};}function maskClientSecret(_0x2fe473){return _[_0x22de('0x18')](_0x2fe473[_0x22de('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x45bfe1,_0x56b808){var _0x55e022={},_0x55090c={},_0xc49641={'count':0x0,'rows':[]};var _0x1b7a42=_[_0x22de('0x1a')](db['CloudProvider'][_0x22de('0x1b')],function(_0x44916d){return{'name':_0x44916d['fieldName'],'type':_0x44916d[_0x22de('0x1c')][_0x22de('0x1d')]};});_0x55090c['model']=_[_0x22de('0x1a')](_0x1b7a42,_0x22de('0x16'));_0x55090c[_0x22de('0x1e')]=_[_0x22de('0x1f')](_0x45bfe1[_0x22de('0x1e')]);_0x55090c[_0x22de('0x20')]=_[_0x22de('0x21')](_0x55090c[_0x22de('0x22')],_0x55090c[_0x22de('0x1e')]);_0x55e022['attributes']=_[_0x22de('0x21')](_0x55090c[_0x22de('0x22')],qs[_0x22de('0x23')](_0x45bfe1[_0x22de('0x1e')][_0x22de('0x23')]));_0x55e022[_0x22de('0x24')]=_0x55e022[_0x22de('0x24')]['length']?_0x55e022[_0x22de('0x24')]:_0x55090c[_0x22de('0x22')];if(!_0x45bfe1[_0x22de('0x1e')]['hasOwnProperty']('nolimit')){_0x55e022['limit']=qs[_0x22de('0x11')](_0x45bfe1[_0x22de('0x1e')][_0x22de('0x11')]);_0x55e022[_0x22de('0xe')]=qs[_0x22de('0xe')](_0x45bfe1['query']['offset']);}_0x55e022[_0x22de('0x25')]=qs[_0x22de('0x26')](_0x45bfe1[_0x22de('0x1e')][_0x22de('0x26')]);_0x55e022[_0x22de('0x27')]=qs[_0x22de('0x20')](_[_0x22de('0x28')](_0x45bfe1[_0x22de('0x1e')],_0x55090c[_0x22de('0x20')]),_0x1b7a42);if(_0x45bfe1[_0x22de('0x1e')][_0x22de('0x29')]){_0x55e022['where']=_[_0x22de('0x2a')](_0x55e022[_0x22de('0x27')],{'$or':_['map'](_0x1b7a42,function(_0x127d54){if(_0x127d54[_0x22de('0x1c')]!==_0x22de('0x2b')){var _0x144381={};_0x144381[_0x127d54['name']]={'$like':'%'+_0x45bfe1[_0x22de('0x1e')][_0x22de('0x29')]+'%'};return _0x144381;}})});}_0x55e022=_['merge']({},_0x55e022,_0x45bfe1[_0x22de('0x2c')]);var _0xca9be9={'where':_0x55e022[_0x22de('0x27')]};return db[_0x22de('0x2d')][_0x22de('0x10')](_0xca9be9)[_0x22de('0x14')](function(_0x27140a){_0xc49641[_0x22de('0x10')]=_0x27140a;if(_0x45bfe1['query'][_0x22de('0x2e')]){_0x55e022[_0x22de('0x2f')]=[{'all':!![]}];}return db[_0x22de('0x2d')]['findAll'](_0x55e022);})['then'](function(_0x283df1){_0xc49641['rows']=_[_0x22de('0x1a')](_0x283df1,function(_0x5aa18d){if(_0x5aa18d[_0x22de('0x30')]===_0x22de('0x31')){var _0x1f4735=encryptor[_0x22de('0x32')](_0x5aa18d[_0x22de('0x33')]);_0x5aa18d['data3']=maskClientSecret(_0x1f4735);}return _0x5aa18d;});return _0xc49641;})['then'](respondWithFilteredResult(_0x56b808,_0x55e022))['catch'](handleError(_0x56b808,null));};exports['show']=function(_0x267597,_0x5e5372){var _0x378748={'raw':!![],'where':{'id':_0x267597[_0x22de('0x34')]['id']}},_0x57c9be={};_0x57c9be['model']=_[_0x22de('0x1f')](db[_0x22de('0x2d')][_0x22de('0x1b')]);_0x57c9be['query']=_[_0x22de('0x1f')](_0x267597['query']);_0x57c9be['filters']=_[_0x22de('0x21')](_0x57c9be[_0x22de('0x22')],_0x57c9be['query']);_0x378748[_0x22de('0x24')]=_[_0x22de('0x21')](_0x57c9be[_0x22de('0x22')],qs[_0x22de('0x23')](_0x267597['query']['fields']));_0x378748['attributes']=_0x378748[_0x22de('0x24')][_0x22de('0x35')]?_0x378748[_0x22de('0x24')]:_0x57c9be[_0x22de('0x22')];if(_0x267597['query']['includeAll']){_0x378748[_0x22de('0x2f')]=[{'all':!![]}];}_0x378748=_[_0x22de('0x2a')]({},_0x378748,_0x267597[_0x22de('0x2c')]);return db[_0x22de('0x2d')][_0x22de('0x36')](_0x378748)[_0x22de('0x14')](handleEntityNotFound(_0x5e5372,null))[_0x22de('0x14')](function(_0x15a427){if(_0x15a427[_0x22de('0x30')]===_0x22de('0x31')){var _0x44d76b=encryptor[_0x22de('0x32')](_0x15a427[_0x22de('0x33')]);_0x15a427[_0x22de('0x33')]=maskClientSecret(_0x44d76b);}return _0x15a427;})[_0x22de('0x14')](respondWithResult(_0x5e5372,null))[_0x22de('0x37')](handleError(_0x5e5372,null));};exports[_0x22de('0x38')]=function(_0x78abac,_0x198056){if(!_0x78abac[_0x22de('0x39')]['name'])throw new Error(_0x22de('0x3a'));if(!_0x78abac['body'][_0x22de('0x30')])throw new Error(_0x22de('0x3b'));var _0x588905=db['CloudProvider'][_0x22de('0x1b')]['service']['values'];if(!_0x588905[_0x22de('0x3c')](_0x78abac[_0x22de('0x39')][_0x22de('0x30')]))throw new Error(_0x22de('0x3d')+_0x588905[_0x22de('0x3e')](',\x20'));if(_0x78abac[_0x22de('0x39')][_0x22de('0x30')]===_0x22de('0x31')&&_0x78abac[_0x22de('0x39')][_0x22de('0x33')]){_0x78abac[_0x22de('0x39')][_0x22de('0x33')]=encryptor['encryptString'](_0x78abac[_0x22de('0x39')][_0x22de('0x33')]);}return db[_0x22de('0x2d')][_0x22de('0x38')](_0x78abac[_0x22de('0x39')],{})['then'](respondWithResult(_0x198056,0xc9))[_0x22de('0x37')](handleError(_0x198056,null));};exports[_0x22de('0x13')]=function(_0x1e13da,_0x8c4625){if(_0x1e13da[_0x22de('0x39')]['id']){delete _0x1e13da[_0x22de('0x39')]['id'];}return db[_0x22de('0x2d')][_0x22de('0x36')]({'where':{'id':_0x1e13da['params']['id']}})[_0x22de('0x14')](handleEntityNotFound(_0x8c4625,null))[_0x22de('0x14')](function(_0x1b8dd0){if(_0x1b8dd0['service']===_0x22de('0x31')&&_0x1e13da['body'][_0x22de('0x33')]){_0x1e13da[_0x22de('0x39')][_0x22de('0x33')]=encryptor[_0x22de('0x3f')](_0x1e13da['body'][_0x22de('0x33')]);}return _0x1b8dd0;})['then'](saveUpdates(_0x1e13da['body'],null))[_0x22de('0x14')](respondWithResult(_0x8c4625,null))[_0x22de('0x37')](handleError(_0x8c4625,null));};exports[_0x22de('0x40')]=function(_0x5108cc,_0x396333){return db[_0x22de('0x2d')][_0x22de('0x36')]({'where':{'id':_0x5108cc[_0x22de('0x34')]['id']}})[_0x22de('0x14')](handleEntityNotFound(_0x396333,null))[_0x22de('0x14')](removeEntity(_0x396333,null))['catch'](handleError(_0x396333,null));};exports[_0x22de('0x41')]=function(_0x1447db,_0x1b6fa5){return db[_0x22de('0x2d')]['findOne']({'where':{'id':_0x1447db[_0x22de('0x34')]['id']},'raw':!![]})[_0x22de('0x14')](function(_0x5cd97d){if(!_0x5cd97d)return _0x1b6fa5[_0x22de('0xa')](0x194);return{'url':oauth[_0x22de('0x42')](_0x5cd97d,_0x1447db[_0x22de('0x43')]['id'])};})['then'](respondWithResult(_0x1b6fa5,null))[_0x22de('0x37')](handleError(_0x1b6fa5,null));};exports[_0x22de('0x44')]=function(_0x478afd,_0x295b0){var _0x367693=_0x478afd[_0x22de('0x39')];var _0x14d481;var _0xf2082;if(_0x367693[_0x22de('0x15')])throw _0x367693;redis[_0x22de('0x45')](_0x367693['state'])[_0x22de('0x14')](function(_0x71ed49){if(!_0x71ed49)throw new Error(_0x22de('0x46'));_0x14d481=JSON[_0x22de('0x47')](_0x71ed49);var _0x32a4f2=Buffer[_0x22de('0x48')](_0x367693['state'],_0x22de('0x49'))['toString'](_0x22de('0x4a'));_0xf2082=JSON['parse'](_0x32a4f2);if(!oauth[_0x22de('0x4b')](_0x367693[_0x22de('0x4c')],_0x14d481['oauth2Claims']))throw new Error(_0x22de('0x4d'));redis[_0x22de('0x4e')](_0x367693[_0x22de('0x4f')]);return oauth[_0x22de('0x50')](_0x367693[_0x22de('0x51')],_0x14d481);})[_0x22de('0x14')](function(_0xad7672){_0x14d481[_0x22de('0x52')]=_0xad7672[_0x22de('0x53')];_0x14d481['data6']=_0xad7672[_0x22de('0x54')];return db['CloudProvider'][_0x22de('0x13')]({'data5':_0x14d481[_0x22de('0x52')],'data6':_0x14d481[_0x22de('0x55')]},{'where':{'id':_0x14d481['id']}});})['then'](function(){oauth[_0x22de('0x56')](_0x14d481);socket['emit'](_0x22de('0x57'),{'id':_0xf2082['id']});return;})[_0x22de('0x14')](respondWithStatusCode(_0x295b0,null))['catch'](function(_0x33805d){if(_0xf2082){socket['emit']('microsoftAuthorization:error',{'id':_0xf2082['id']});}if(!_0x14d481){logger[_0x22de('0x15')](_0x22de('0x58'),_0x33805d);return _0x295b0['status'](0x1f4)[_0x22de('0x17')](_0x33805d[_0x22de('0x59')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s',_0x14d481['id'],_0x33805d);});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 9cd1271..87f7f61 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 _0x73e5=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment'];(function(_0x12e3e3,_0x501eaf){var _0x26602e=function(_0x427882){while(--_0x427882){_0x12e3e3['push'](_0x12e3e3['shift']());}};_0x26602e(++_0x501eaf);}(_0x73e5,0x95));var _0x573e=function(_0x13e9d4,_0x25483d){_0x13e9d4=_0x13e9d4-0x0;var _0x2c62b8=_0x73e5[_0x13e9d4];return _0x2c62b8;};'use strict';var _=require(_0x573e('0x0'));var util=require(_0x573e('0x1'));var logger=require(_0x573e('0x2'))(_0x573e('0x3'));var moment=require(_0x573e('0x4'));var BPromise=require(_0x573e('0x5'));var rp=require(_0x573e('0x6'));var fs=require('fs');var path=require(_0x573e('0x7'));var rimraf=require(_0x573e('0x8'));var config=require(_0x573e('0x9'));var attributes=require(_0x573e('0xa'));module['exports']=function(_0x30501a,_0x48b8e3){return _0x30501a[_0x573e('0xb')](_0x573e('0xc'),attributes,{'tableName':_0x573e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c5f=['api','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger'];(function(_0x4bc371,_0x110bae){var _0x16d528=function(_0x278c23){while(--_0x278c23){_0x4bc371['push'](_0x4bc371['shift']());}};_0x16d528(++_0x110bae);}(_0x5c5f,0xe1));var _0xf5c5=function(_0x3aad43,_0x37d769){_0x3aad43=_0x3aad43-0x0;var _0x3a7947=_0x5c5f[_0x3aad43];return _0x3a7947;};'use strict';var _=require(_0xf5c5('0x0'));var util=require(_0xf5c5('0x1'));var logger=require(_0xf5c5('0x2'))(_0xf5c5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf5c5('0x4'));var fs=require('fs');var path=require(_0xf5c5('0x5'));var rimraf=require('rimraf');var config=require(_0xf5c5('0x6'));var attributes=require(_0xf5c5('0x7'));module[_0xf5c5('0x8')]=function(_0x1ef586,_0x22db5a){return _0x1ef586[_0xf5c5('0x9')](_0xf5c5('0xa'),attributes,{'tableName':_0xf5c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 9271883..4bf979c 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','type','push','data7','/.default','join','Dynamics365','replace','data2','code','id_token','from','randomBytes','data1','response_type','data4','response_mode','scope','state','nonce','prompt','login','value','oauth2Claims','oauth2/','stringify','decode','iss','issuer','aud','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','{TENANT_ID}','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','authorization_code','intervals','bind','findAll','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','lodash','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x326f,0xd1));var _0xf326=function(_0x3da1d8,_0xea7886){_0x3da1d8=_0x3da1d8-0x0;var _0x210731=_0x326f[_0x3da1d8];return _0x210731;};'use strict';var _=require(_0xf326('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var util=require(_0xf326('0x4'));var encryptor=require(_0xf326('0x5'));var config=require(_0xf326('0x6'));var logger=require(_0xf326('0x7'))(_0xf326('0x8'));var schedule=require(_0xf326('0x9'));var db=require(_0xf326('0xa'))['db'];config['redis']=_[_0xf326('0xb')](config[_0xf326('0xc')],{'host':_0xf326('0xd'),'port':0x18eb});var redis=new Redis(config[_0xf326('0xc')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0xf326('0xe'),_0xf326('0xf'),_0xf326('0x10'),_0xf326('0x11'),_0xf326('0x12')],'Dynamics365':['openid',_0xf326('0xf')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xf326('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4aaf3a){var _0x2e4b71=_['map'](AZURE_AUTH_SCOPES[_0x4aaf3a[_0xf326('0x14')]]);if(_0x4aaf3a[_0xf326('0x14')]==='Dynamics365')_0x2e4b71[_0xf326('0x15')](_0x4aaf3a[_0xf326('0x16')]+_0xf326('0x17'));return _0x2e4b71[_0xf326('0x18')]('\x20');}function getAccessTokenScope(_0x5c8483){if(_0x5c8483[_0xf326('0x14')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x5c8483[_0xf326('0x14')]===_0xf326('0x19'))return _0x5c8483[_0xf326('0x16')]+_0xf326('0x17');}function generateMicrosoftAuthorizationUrl(_0x292f4b,_0x287a2a){var _0x34128e=MICROSOFT_AUTH_URL[_0xf326('0x1a')]('{TENANT_ID}',_0x292f4b[_0xf326('0x1b')]);var _0x453100=[_0xf326('0x1c'),_0xf326('0x1d')];var _0xcef2b5=Buffer[_0xf326('0x1e')](JSON['stringify']({'id':_0x287a2a}))['toString']('base64');var _0x16e605=crypto[_0xf326('0x1f')](0x10)['toString']('hex');var _0x128c68=getAuthorizationScopes(_0x292f4b);var _0x4dfa76=[{'key':'client_id','value':_0x292f4b[_0xf326('0x20')]},{'key':_0xf326('0x21'),'value':encodeURIComponent(_0x453100['join']('\x20'))},{'key':'redirect_uri','value':_0x292f4b[_0xf326('0x22')]},{'key':_0xf326('0x23'),'value':'form_post'},{'key':_0xf326('0x24'),'value':encodeURIComponent(_0x128c68)},{'key':_0xf326('0x25'),'value':_0xcef2b5},{'key':_0xf326('0x26'),'value':_0x16e605},{'key':_0xf326('0x27'),'value':_0xf326('0x28')}];var _0x2049ec=_0x34128e+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x4dfa76,function(_0x55b9f4){return _0x55b9f4['key']+'='+_0x55b9f4[_0xf326('0x29')];})[_0xf326('0x18')]('&');_0x292f4b[_0xf326('0x2a')]={'issuer':_0x34128e[_0xf326('0x1a')](_0xf326('0x2b'),''),'audience':_0x292f4b[_0xf326('0x20')],'state':_0xcef2b5,'nonce':_0x16e605};redis['set'](_0xcef2b5,JSON[_0xf326('0x2c')](_0x292f4b));return _0x2049ec;}function isValidIdToken(_0xa3c0b,_0x212d5d){try{var _0x581531=jwt[_0xf326('0x2d')](_0xa3c0b,{'complete':!![]});var _0x55ad0f=_0x581531['payload'];if(_0x55ad0f[_0xf326('0x2e')]!==_0x212d5d[_0xf326('0x2f')])return![];if(_0x55ad0f[_0xf326('0x30')]!==_0x212d5d['audience'])return![];if(_0x55ad0f[_0xf326('0x26')]!==_0x212d5d[_0xf326('0x26')])return![];if(moment()['isAfter'](moment[_0xf326('0x31')](_0x55ad0f[_0xf326('0x32')])))return![];return!![];}catch(_0xd77aba){throw _0xd77aba;}}function refreshOauth2MicrosoftAccessToken(_0x18d110){return Promise[_0xf326('0x33')]()[_0xf326('0x34')](function(){if(_0x18d110[_0xf326('0x35')])return _0x18d110;return db[_0xf326('0x36')][_0xf326('0x37')]({'where':{'id':_0x18d110['id']},'raw':!![]});})[_0xf326('0x34')](function(_0x4b52f2){var _0x1035ed={'grant_type':_0xf326('0x38'),'refresh_token':_0x4b52f2[_0xf326('0x39')],'scope':getAccessTokenScope(_0x4b52f2),'redirect_uri':_0x4b52f2['data4'],'client_id':_0x4b52f2[_0xf326('0x20')],'client_secret':encryptor[_0xf326('0x3a')](_0x4b52f2[_0xf326('0x35')])};var _0x4df451={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xf326('0x1a')](_0xf326('0x3b'),_0x4b52f2[_0xf326('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1035ed,'json':!![]};return rp(_0x4df451);})[_0xf326('0x34')](function(_0x30694f){_0x18d110[_0xf326('0x3c')]=_0x30694f[_0xf326('0x3d')];_0x18d110[_0xf326('0x39')]=_0x30694f['refresh_token'];return db[_0xf326('0x36')][_0xf326('0x3e')]({'data5':_0x18d110['data5'],'data6':_0x18d110[_0xf326('0x39')]},{'where':{'id':_0x18d110['id']}});})['then'](function(){return _0x18d110;})[_0xf326('0x3f')](function(_0x481b64){logger['error'](_0xf326('0x40'),_0x18d110['id'],_0x481b64);});}function getOauth2MicrosoftAccessToken(_0x4d8eac,_0x40dcb4){var _0x57aa27={'grant_type':_0xf326('0x41'),'code':_0x4d8eac,'scope':getAccessTokenScope(_0x40dcb4),'redirect_uri':_0x40dcb4[_0xf326('0x22')],'client_id':_0x40dcb4[_0xf326('0x20')],'client_secret':encryptor['decryptString'](_0x40dcb4[_0xf326('0x35')])};var _0x4095e6={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xf326('0x1a')](_0xf326('0x3b'),_0x40dcb4[_0xf326('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x57aa27,'json':!![]};return rp(_0x4095e6);}function startRefreshInterval(_0xaf65e0){var _0x51076c=schedule[_0xf326('0x42')];if(_0x51076c[_0xaf65e0['id']])clearInterval(_0x51076c[_0xaf65e0['id']]);_0x51076c[_0xaf65e0['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xf326('0x43')](this,{'id':_0xaf65e0['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf326('0x42')]=_0x51076c;}function startAllRefreshIntervals(){return db[_0xf326('0x36')][_0xf326('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x3e830d){var _0x1b7bf6=_0x3e830d['map'](function(_0x4dd361){return refreshOauth2MicrosoftAccessToken(_0x4dd361)[_0xf326('0x34')](function(_0x577634){startRefreshInterval(_0x577634);});});return Promise['all'](_0x1b7bf6);})[_0xf326('0x3f')](function(_0x5d6ae2){var _0x3e1e8c=_0x5d6ae2?util[_0xf326('0x45')](_0x5d6ae2,{'showHidden':![],'depth':null}):'';logger[_0xf326('0x46')](_0xf326('0x47'),_0x3e1e8c);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xdb28=['set','decode','payload','iss','issuer','aud','audience','isAfter','resolve','data3','findOne','then','data6','POST','data5','access_token','refresh_token','CloudProvider','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','decryptString','intervals','bind','findAll','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','map','type','data7','/.default','join','Outlook365','Dynamics365','replace','{TENANT_ID}','data2','code','id_token','stringify','toString','base64','hex','client_id','response_type','redirect_uri','data4','response_mode','form_post','scope','nonce','key','value','oauth2Claims','data1'];(function(_0x555543,_0x1a5a3a){var _0x3456d4=function(_0x285d10){while(--_0x285d10){_0x555543['push'](_0x555543['shift']());}};_0x3456d4(++_0x1a5a3a);}(_0xdb28,0x106));var _0x8db2=function(_0x11c6b2,_0x306b2b){_0x11c6b2=_0x11c6b2-0x0;var _0x5fa8ad=_0xdb28[_0x11c6b2];return _0x5fa8ad;};'use strict';var _=require(_0x8db2('0x0'));var crypto=require(_0x8db2('0x1'));var jwt=require(_0x8db2('0x2'));var moment=require(_0x8db2('0x3'));var Redis=require('ioredis');var rp=require(_0x8db2('0x4'));var util=require(_0x8db2('0x5'));var encryptor=require(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var logger=require(_0x8db2('0x8'))('api');var schedule=require(_0x8db2('0x9'));var db=require(_0x8db2('0xa'))['db'];config['redis']=_['defaults'](config[_0x8db2('0xb')],{'host':_0x8db2('0xc'),'port':0x18eb});var redis=new Redis(config[_0x8db2('0xb')]);var MICROSOFT_AUTH_URL=_0x8db2('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),'offline_access',_0x8db2('0x11'),_0x8db2('0x12'),_0x8db2('0x13')],'Dynamics365':['openid',_0x8db2('0x14')]};var MICROSOFT_AUTH_ENDPOINT=_0x8db2('0x15');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x41beda){var _0x3b2faa=_[_0x8db2('0x16')](AZURE_AUTH_SCOPES[_0x41beda[_0x8db2('0x17')]]);if(_0x41beda[_0x8db2('0x17')]==='Dynamics365')_0x3b2faa['push'](_0x41beda[_0x8db2('0x18')]+_0x8db2('0x19'));return _0x3b2faa[_0x8db2('0x1a')]('\x20');}function getAccessTokenScope(_0x1d6a15){if(_0x1d6a15[_0x8db2('0x17')]===_0x8db2('0x1b'))return _0x8db2('0x11');if(_0x1d6a15[_0x8db2('0x17')]===_0x8db2('0x1c'))return _0x1d6a15[_0x8db2('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x13b0f5,_0x24da1b){var _0x48101e=MICROSOFT_AUTH_URL[_0x8db2('0x1d')](_0x8db2('0x1e'),_0x13b0f5[_0x8db2('0x1f')]);var _0x3fddc2=[_0x8db2('0x20'),_0x8db2('0x21')];var _0x51d60d=Buffer['from'](JSON[_0x8db2('0x22')]({'id':_0x24da1b}))[_0x8db2('0x23')](_0x8db2('0x24'));var _0x1b64e4=crypto['randomBytes'](0x10)[_0x8db2('0x23')](_0x8db2('0x25'));var _0x260940=getAuthorizationScopes(_0x13b0f5);var _0x297ba3=[{'key':_0x8db2('0x26'),'value':_0x13b0f5['data1']},{'key':_0x8db2('0x27'),'value':encodeURIComponent(_0x3fddc2[_0x8db2('0x1a')]('\x20'))},{'key':_0x8db2('0x28'),'value':_0x13b0f5[_0x8db2('0x29')]},{'key':_0x8db2('0x2a'),'value':_0x8db2('0x2b')},{'key':_0x8db2('0x2c'),'value':encodeURIComponent(_0x260940)},{'key':'state','value':_0x51d60d},{'key':_0x8db2('0x2d'),'value':_0x1b64e4},{'key':'prompt','value':'login'}];var _0x52a9ca=_0x48101e+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x297ba3,function(_0xec8cd2){return _0xec8cd2[_0x8db2('0x2e')]+'='+_0xec8cd2[_0x8db2('0x2f')];})[_0x8db2('0x1a')]('&');_0x13b0f5[_0x8db2('0x30')]={'issuer':_0x48101e[_0x8db2('0x1d')]('oauth2/',''),'audience':_0x13b0f5[_0x8db2('0x31')],'state':_0x51d60d,'nonce':_0x1b64e4};redis[_0x8db2('0x32')](_0x51d60d,JSON[_0x8db2('0x22')](_0x13b0f5));return _0x52a9ca;}function isValidIdToken(_0x8b7cec,_0x483aee){try{var _0x2e0691=jwt[_0x8db2('0x33')](_0x8b7cec,{'complete':!![]});var _0x241baf=_0x2e0691[_0x8db2('0x34')];if(_0x241baf[_0x8db2('0x35')]!==_0x483aee[_0x8db2('0x36')])return![];if(_0x241baf[_0x8db2('0x37')]!==_0x483aee[_0x8db2('0x38')])return![];if(_0x241baf[_0x8db2('0x2d')]!==_0x483aee['nonce'])return![];if(moment()[_0x8db2('0x39')](moment['unix'](_0x241baf['exp'])))return![];return!![];}catch(_0x302188){throw _0x302188;}}function refreshOauth2MicrosoftAccessToken(_0x25ed2c){return Promise[_0x8db2('0x3a')]()['then'](function(){if(_0x25ed2c[_0x8db2('0x3b')])return _0x25ed2c;return db['CloudProvider'][_0x8db2('0x3c')]({'where':{'id':_0x25ed2c['id']},'raw':!![]});})[_0x8db2('0x3d')](function(_0x14bd12){var _0x4d9e26={'grant_type':'refresh_token','refresh_token':_0x14bd12[_0x8db2('0x3e')],'scope':getAccessTokenScope(_0x14bd12),'redirect_uri':_0x14bd12[_0x8db2('0x29')],'client_id':_0x14bd12['data1'],'client_secret':encryptor['decryptString'](_0x14bd12[_0x8db2('0x3b')])};var _0x5178f3={'method':_0x8db2('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x8db2('0x1d')](_0x8db2('0x1e'),_0x14bd12[_0x8db2('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4d9e26,'json':!![]};return rp(_0x5178f3);})[_0x8db2('0x3d')](function(_0xae31b7){_0x25ed2c[_0x8db2('0x40')]=_0xae31b7[_0x8db2('0x41')];_0x25ed2c['data6']=_0xae31b7[_0x8db2('0x42')];return db[_0x8db2('0x43')]['update']({'data5':_0x25ed2c[_0x8db2('0x40')],'data6':_0x25ed2c[_0x8db2('0x3e')]},{'where':{'id':_0x25ed2c['id']}});})['then'](function(){return _0x25ed2c;})['catch'](function(_0x3c1983){logger['error'](_0x8db2('0x44'),_0x25ed2c['id'],_0x3c1983);});}function getOauth2MicrosoftAccessToken(_0x264696,_0x26717d){var _0x22c896={'grant_type':'authorization_code','code':_0x264696,'scope':getAccessTokenScope(_0x26717d),'redirect_uri':_0x26717d[_0x8db2('0x29')],'client_id':_0x26717d['data1'],'client_secret':encryptor[_0x8db2('0x45')](_0x26717d[_0x8db2('0x3b')])};var _0x2c8bc9={'method':_0x8db2('0x3f'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x26717d[_0x8db2('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x22c896,'json':!![]};return rp(_0x2c8bc9);}function startRefreshInterval(_0x2c0507){var _0x5dc2b4=schedule[_0x8db2('0x46')];if(_0x5dc2b4[_0x2c0507['id']])clearInterval(_0x5dc2b4[_0x2c0507['id']]);_0x5dc2b4[_0x2c0507['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8db2('0x47')](this,{'id':_0x2c0507['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x8db2('0x46')]=_0x5dc2b4;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x8db2('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8db2('0x3d')](function(_0x953349){var _0x279e74=_0x953349[_0x8db2('0x16')](function(_0x40d82a){return refreshOauth2MicrosoftAccessToken(_0x40d82a)[_0x8db2('0x3d')](function(_0x1575ea){startRefreshInterval(_0x1575ea);});});return Promise[_0x8db2('0x49')](_0x279e74);})[_0x8db2('0x4a')](function(_0x21cf7c){var _0x20bf0b=_0x21cf7c?util[_0x8db2('0x4b')](_0x21cf7c,{'showHidden':![],'depth':null}):'';logger['error'](_0x8db2('0x4c'),_0x20bf0b);});}module[_0x8db2('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index b8f5351..b5d58b1 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 _0xb4f4=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x1b317b,_0x26fe8b){var _0x2dca94=function(_0x1bc05c){while(--_0x1bc05c){_0x1b317b['push'](_0x1b317b['shift']());}};_0x2dca94(++_0x26fe8b);}(_0xb4f4,0xda));var _0x4b4f=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xb4f4[_0x576170];return _0x397c70;};'use strict';var _=require(_0x4b4f('0x0'));var util=require(_0x4b4f('0x1'));var moment=require('moment');var BPromise=require(_0x4b4f('0x2'));var rs=require(_0x4b4f('0x3'));var fs=require('fs');var Redis=require(_0x4b4f('0x4'));var db=require(_0x4b4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b4f('0x6'))(_0x4b4f('0x7'));var config=require(_0x4b4f('0x8'));var jayson=require(_0x4b4f('0x9'));var client=jayson[_0x4b4f('0xa')][_0x4b4f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x405321,_0x58c1e5,_0x5ba9b0){return new BPromise(function(_0x108b4e,_0x2c647f){return client[_0x4b4f('0xc')](_0x405321,_0x5ba9b0)[_0x4b4f('0xd')](function(_0x25e0c9){logger['info'](_0x4b4f('0xe'),_0x58c1e5,_0x4b4f('0xf'));logger[_0x4b4f('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x58c1e5,_0x4b4f('0xf'),JSON[_0x4b4f('0x11')](_0x25e0c9));if(_0x25e0c9['error']){if(_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x13')]===0x1f4){logger[_0x4b4f('0x12')](_0x4b4f('0xe'),_0x58c1e5,_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);return _0x2c647f(_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x58c1e5,_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);return _0x108b4e(_0x25e0c9['error'][_0x4b4f('0x14')]);}else{logger[_0x4b4f('0x15')](_0x4b4f('0xe'),_0x58c1e5,'request\x20sent');_0x108b4e(_0x25e0c9[_0x4b4f('0x16')][_0x4b4f('0x14')]);}})[_0x4b4f('0x17')](function(_0x57d09a){logger[_0x4b4f('0x12')](_0x4b4f('0xe'),_0x58c1e5,_0x57d09a);_0x2c647f(_0x57d09a);});});} \ No newline at end of file +var _0x707d=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x15cdbc,_0xbe9c25){var _0x4cf80e=function(_0x5ad816){while(--_0x5ad816){_0x15cdbc['push'](_0x15cdbc['shift']());}};_0x4cf80e(++_0xbe9c25);}(_0x707d,0x18b));var _0xd707=function(_0x299b7e,_0xb5eb98){_0x299b7e=_0x299b7e-0x0;var _0x287283=_0x707d[_0x299b7e];return _0x287283;};'use strict';var _=require(_0xd707('0x0'));var util=require(_0xd707('0x1'));var moment=require(_0xd707('0x2'));var BPromise=require(_0xd707('0x3'));var rs=require(_0xd707('0x4'));var fs=require('fs');var Redis=require(_0xd707('0x5'));var db=require(_0xd707('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd707('0x7'))(_0xd707('0x8'));var config=require(_0xd707('0x9'));var jayson=require(_0xd707('0xa'));var client=jayson['client'][_0xd707('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3de790,_0x5661e6,_0x4af63f){return new BPromise(function(_0xf596b4,_0x11edc8){return client['request'](_0x3de790,_0x4af63f)[_0xd707('0xc')](function(_0x249b0d){logger['info'](_0xd707('0xd'),_0x5661e6,_0xd707('0xe'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5661e6,_0xd707('0xe'),JSON[_0xd707('0xf')](_0x249b0d));if(_0x249b0d[_0xd707('0x10')]){if(_0x249b0d['error'][_0xd707('0x11')]===0x1f4){logger[_0xd707('0x10')](_0xd707('0xd'),_0x5661e6,_0x249b0d['error']['message']);return _0x11edc8(_0x249b0d[_0xd707('0x10')][_0xd707('0x12')]);}logger['error'](_0xd707('0xd'),_0x5661e6,_0x249b0d[_0xd707('0x10')]['message']);return _0xf596b4(_0x249b0d[_0xd707('0x10')][_0xd707('0x12')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x5661e6,_0xd707('0xe'));_0xf596b4(_0x249b0d['result'][_0xd707('0x12')]);}})[_0xd707('0x13')](function(_0x479aea){logger[_0xd707('0x10')](_0xd707('0xd'),_0x5661e6,_0x479aea);_0x11edc8(_0x479aea);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index c7f9131..6f7f1d6 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 _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0xb691c4,_0x16f2fe){var _0x4e20a6=function(_0x32153b){while(--_0x32153b){_0xb691c4['push'](_0xb691c4['shift']());}};_0x4e20a6(++_0x16f2fe);}(_0x2ef3,0xba));var _0x32ef=function(_0x2d48fb,_0x24b494){_0x2d48fb=_0x2d48fb-0x0;var _0x163dad=_0x2ef3[_0x2d48fb];return _0x163dad;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file +var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x525b28,_0x5cf5a0){var _0x180178=function(_0x43e066){while(--_0x43e066){_0x525b28['push'](_0x525b28['shift']());}};_0x180178(++_0x5cf5a0);}(_0x5f2f,0x73));var _0xf5f2=function(_0xf6031,_0x895009){_0xf6031=_0xf6031-0x0;var _0x535425=_0x5f2f[_0xf6031];return _0x535425;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 2018883..4a5c979 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 _0x28bc=['name','sequelize','exports','STRING'];(function(_0x248d46,_0xba08ec){var _0x354942=function(_0x1b52a1){while(--_0x1b52a1){_0x248d46['push'](_0x248d46['shift']());}};_0x354942(++_0xba08ec);}(_0x28bc,0x79));var _0xc28b=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x28bc[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0xc28b('0x0'));module[_0xc28b('0x1')]={'name':{'type':Sequelize[_0xc28b('0x2')],'unique':_0xc28b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc28b('0x2')]},'companyId':{'type':Sequelize[_0xc28b('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc28b('0x2')]},'fax':{'type':Sequelize[_0xc28b('0x2')]},'type':{'type':Sequelize[_0xc28b('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc28b('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc28b('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc28b('0x2')]},'sStreet':{'type':Sequelize[_0xc28b('0x2')]},'sPostalCode':{'type':Sequelize[_0xc28b('0x2')]},'sCity':{'type':Sequelize[_0xc28b('0x2')]},'sCountry':{'type':Sequelize[_0xc28b('0x2')]},'description':{'type':Sequelize[_0xc28b('0x2')]}}; \ No newline at end of file +var _0x61a2=['sequelize','exports','name','STRING'];(function(_0x54b01a,_0x4fab10){var _0x62e975=function(_0x4f9b1a){while(--_0x4f9b1a){_0x54b01a['push'](_0x54b01a['shift']());}};_0x62e975(++_0x4fab10);}(_0x61a2,0x184));var _0x261a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x61a2[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x261a('0x0'));module[_0x261a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x261a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x261a('0x3')]},'companyId':{'type':Sequelize[_0x261a('0x3')]},'website':{'type':Sequelize[_0x261a('0x3')]},'phone':{'type':Sequelize[_0x261a('0x3')]},'fax':{'type':Sequelize[_0x261a('0x3')]},'type':{'type':Sequelize[_0x261a('0x3')]},'street':{'type':Sequelize[_0x261a('0x3')]},'postalCode':{'type':Sequelize[_0x261a('0x3')]},'city':{'type':Sequelize[_0x261a('0x3')]},'country':{'type':Sequelize[_0x261a('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x261a('0x3')]},'sStreet':{'type':Sequelize[_0x261a('0x3')]},'sPostalCode':{'type':Sequelize[_0x261a('0x3')]},'sCity':{'type':Sequelize[_0x261a('0x3')]},'sCountry':{'type':Sequelize[_0x261a('0x3')]},'description':{'type':Sequelize[_0x261a('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index cc3f26b..3a71ae4 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 _0x1796=['ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','get','Companies','UserProfileResource','destroy','error','stack','name','send','describe','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','map','options','CmCompany','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','findOne','rawAttributes','hasOwnProperty','getContacts','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4a4a3f,_0xc54857){var _0x4d7fe4=function(_0x2f1c41){while(--_0x2f1c41){_0x4a4a3f['push'](_0x4a4a3f['shift']());}};_0x4d7fe4(++_0xc54857);}(_0x1796,0x143));var _0x6179=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x1796[_0x3826ad];return _0x17b900;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6179('0x0'));var zipdir=require(_0x6179('0x1'));var jsonpatch=require(_0x6179('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6179('0x3'));var Mustache=require(_0x6179('0x4'));var util=require(_0x6179('0x5'));var path=require(_0x6179('0x6'));var sox=require(_0x6179('0x7'));var csv=require(_0x6179('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6179('0x9'));var _=require(_0x6179('0xa'));var squel=require(_0x6179('0xb'));var crypto=require(_0x6179('0xc'));var jsforce=require(_0x6179('0xd'));var deskjs=require(_0x6179('0xe'));var toCsv=require(_0x6179('0x8'));var querystring=require(_0x6179('0xf'));var Papa=require(_0x6179('0x10'));var Redis=require(_0x6179('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6179('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6179('0x13'));var utils=require('../../config/utils');var config=require(_0x6179('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6179('0x15'))['db'];function respondWithStatusCode(_0x1a71c6,_0x18ac90){_0x18ac90=_0x18ac90||0xcc;return function(_0x11ce4e){if(_0x11ce4e){return _0x1a71c6[_0x6179('0x16')](_0x18ac90);}return _0x1a71c6[_0x6179('0x17')](_0x18ac90)[_0x6179('0x18')]();};}function respondWithResult(_0x5e3e07,_0x59b091){_0x59b091=_0x59b091||0xc8;return function(_0x3249eb){if(_0x3249eb){return _0x5e3e07[_0x6179('0x17')](_0x59b091)[_0x6179('0x19')](_0x3249eb);}};}function respondWithFilteredResult(_0x4d73de,_0x16df31){return function(_0x42e128){if(_0x42e128){var _0x13ab13=typeof _0x16df31[_0x6179('0x1a')]===_0x6179('0x1b')&&typeof _0x16df31[_0x6179('0x1c')]===_0x6179('0x1b');var _0x345951=_0x42e128[_0x6179('0x1d')];var _0x22c41e=_0x13ab13?0x0:_0x16df31[_0x6179('0x1a')];var _0x52e886=_0x13ab13?_0x42e128[_0x6179('0x1d')]:_0x16df31['offset']+_0x16df31[_0x6179('0x1c')];var _0x2fef35;if(_0x52e886>=_0x345951){_0x52e886=_0x345951;_0x2fef35=0xc8;}else{_0x2fef35=0xce;}_0x4d73de[_0x6179('0x17')](_0x2fef35);return _0x4d73de[_0x6179('0x1e')]('Content-Range',_0x22c41e+'-'+_0x52e886+'/'+_0x345951)[_0x6179('0x19')](_0x42e128);}return null;};}function patchUpdates(_0x7b9c8d){return function(_0x2ba92d){try{jsonpatch['apply'](_0x2ba92d,_0x7b9c8d,!![]);}catch(_0x119ca9){return BPromise[_0x6179('0x1f')](_0x119ca9);}return _0x2ba92d[_0x6179('0x20')]();};}function saveUpdates(_0x1b970a,_0x6beb2){return function(_0xef97e9){if(_0xef97e9){return _0xef97e9[_0x6179('0x21')](_0x1b970a)[_0x6179('0x22')](function(_0x24384f){return _0x24384f;});}return null;};}function removeEntity(_0x5afa24,_0x4c1f09){return function(_0x555d20){if(_0x555d20){return _0x555d20['destroy']()[_0x6179('0x22')](function(){var _0xd11a90=_0x555d20[_0x6179('0x23')]({'plain':!![]});var _0x326f91=_0x6179('0x24');return db[_0x6179('0x25')][_0x6179('0x26')]({'where':{'type':_0x326f91,'resourceId':_0xd11a90['id']}})['then'](function(){return _0x555d20;});})[_0x6179('0x22')](function(){_0x5afa24[_0x6179('0x17')](0xcc)[_0x6179('0x18')]();});}};}function handleEntityNotFound(_0x1e1f39,_0x179d25){return function(_0x2d9844){if(!_0x2d9844){_0x1e1f39[_0x6179('0x16')](0x194);}return _0x2d9844;};}function handleError(_0x1260e0,_0x217ab6){_0x217ab6=_0x217ab6||0x1f4;return function(_0x2ec7f0){logger[_0x6179('0x27')](_0x2ec7f0[_0x6179('0x28')]);if(_0x2ec7f0[_0x6179('0x29')]){delete _0x2ec7f0[_0x6179('0x29')];}_0x1260e0['status'](_0x217ab6)[_0x6179('0x2a')](_0x2ec7f0);};}exports['index']=function(_0x152cc6,_0xab443f){var _0x498a40={},_0x544690={},_0x22e2f8={'count':0x0,'rows':[]};return db['CmCompany'][_0x6179('0x2b')]()[_0x6179('0x22')](function(_0x1dba45){_0x544690[_0x6179('0x2c')]=_[_0x6179('0x2d')](_0x1dba45);_0x544690[_0x6179('0x2e')]=_[_0x6179('0x2d')](_0x152cc6[_0x6179('0x2e')]);_0x544690['filters']=_[_0x6179('0x2f')](_0x544690[_0x6179('0x2c')],_0x544690[_0x6179('0x2e')]);_0x498a40[_0x6179('0x30')]=_[_0x6179('0x2f')](_0x544690[_0x6179('0x2c')],qs[_0x6179('0x31')](_0x152cc6['query']['fields']));_0x498a40[_0x6179('0x30')]=_0x498a40['attributes'][_0x6179('0x32')]?_0x498a40[_0x6179('0x30')]:_0x544690[_0x6179('0x2c')];if(!_0x152cc6[_0x6179('0x2e')]['hasOwnProperty'](_0x6179('0x33'))){_0x498a40[_0x6179('0x1c')]=qs[_0x6179('0x1c')](_0x152cc6['query']['limit']);_0x498a40['offset']=qs[_0x6179('0x1a')](_0x152cc6[_0x6179('0x2e')]['offset']);}_0x498a40['order']=qs[_0x6179('0x34')](_0x152cc6['query'][_0x6179('0x34')]);_0x498a40[_0x6179('0x35')]=qs[_0x6179('0x36')](_[_0x6179('0x37')](_0x152cc6['query'],_0x544690[_0x6179('0x36')]),_0x1dba45);if(_0x152cc6[_0x6179('0x2e')][_0x6179('0x38')]){_0x498a40[_0x6179('0x35')]=_[_0x6179('0x39')](_0x498a40[_0x6179('0x35')],{'$or':_[_0x6179('0x3a')](_0x498a40[_0x6179('0x30')],function(_0x53fa5a){var _0x340cab={};_0x340cab[_0x53fa5a]={'$like':'%'+_0x152cc6[_0x6179('0x2e')][_0x6179('0x38')]+'%'};return _0x340cab;})});}_0x498a40=_['merge']({},_0x498a40,_0x152cc6[_0x6179('0x3b')]);var _0x498096={'where':_0x498a40[_0x6179('0x35')]};return db[_0x6179('0x3c')][_0x6179('0x1d')](_0x498096)['then'](function(_0x332a7f){_0x22e2f8[_0x6179('0x1d')]=_0x332a7f;if(_0x152cc6['query'][_0x6179('0x3d')]){_0x498a40[_0x6179('0x3e')]=[{'all':!![]}];}return db[_0x6179('0x3c')][_0x6179('0x3f')](_0x498a40);})[_0x6179('0x22')](function(_0x54a3a1){_0x22e2f8[_0x6179('0x40')]=_0x54a3a1;return _0x22e2f8;})[_0x6179('0x22')](respondWithFilteredResult(_0xab443f,_0x498a40))[_0x6179('0x41')](handleError(_0xab443f,null));})['catch'](handleError(_0xab443f,null));};exports['show']=function(_0x2833a5,_0xb89819){var _0x139984={'raw':![],'where':{'id':_0x2833a5[_0x6179('0x42')]['id']}},_0x382fbc={};_0x382fbc[_0x6179('0x2c')]=_['keys'](db[_0x6179('0x3c')]['rawAttributes']);_0x382fbc['query']=_[_0x6179('0x2d')](_0x2833a5[_0x6179('0x2e')]);_0x382fbc[_0x6179('0x36')]=_[_0x6179('0x2f')](_0x382fbc[_0x6179('0x2c')],_0x382fbc['query']);_0x139984['attributes']=_['intersection'](_0x382fbc[_0x6179('0x2c')],qs[_0x6179('0x31')](_0x2833a5['query'][_0x6179('0x31')]));_0x139984[_0x6179('0x30')]=_0x139984[_0x6179('0x30')][_0x6179('0x32')]?_0x139984[_0x6179('0x30')]:_0x382fbc['model'];if(_0x2833a5['query']['includeAll']){_0x139984[_0x6179('0x3e')]=[{'all':!![]}];}_0x139984=_[_0x6179('0x39')]({},_0x139984,_0x2833a5[_0x6179('0x3b')]);return db[_0x6179('0x3c')][_0x6179('0x43')](_0x139984)[_0x6179('0x22')](handleEntityNotFound(_0xb89819,null))[_0x6179('0x22')](respondWithResult(_0xb89819,null))['catch'](handleError(_0xb89819,null));};exports[_0x6179('0x44')]=function(_0x487a86,_0x51afdb){return db['CmCompany']['create'](_0x487a86[_0x6179('0x45')],{})[_0x6179('0x22')](function(_0x415831){var _0x5b5f78=_0x487a86[_0x6179('0x46')][_0x6179('0x23')]({'plain':!![]});if(!_0x5b5f78)throw new Error(_0x6179('0x47'));if(_0x5b5f78[_0x6179('0x48')]===_0x6179('0x46')){var _0x2341c4=_0x415831['get']({'plain':!![]});var _0x221f5a='Companies';return db[_0x6179('0x49')]['find']({'where':{'name':_0x221f5a,'userProfileId':_0x5b5f78[_0x6179('0x4a')]},'raw':!![]})[_0x6179('0x22')](function(_0x24ee1f){if(_0x24ee1f&&_0x24ee1f[_0x6179('0x4b')]===0x0){return db[_0x6179('0x25')][_0x6179('0x44')]({'name':_0x2341c4[_0x6179('0x29')],'resourceId':_0x2341c4['id'],'type':_0x24ee1f[_0x6179('0x29')],'sectionId':_0x24ee1f['id']},{})['then'](function(){return _0x415831;});}else{return _0x415831;}})[_0x6179('0x41')](function(_0x5969b0){logger['error'](_0x6179('0x4c'),_0x5969b0);throw _0x5969b0;});}return _0x415831;})[_0x6179('0x22')](respondWithResult(_0x51afdb,0xc9))['catch'](handleError(_0x51afdb,null));};exports['update']=function(_0x2e4b86,_0x199b92){if(_0x2e4b86[_0x6179('0x45')]['id']){delete _0x2e4b86[_0x6179('0x45')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x2e4b86['params']['id']}})[_0x6179('0x22')](handleEntityNotFound(_0x199b92,null))['then'](saveUpdates(_0x2e4b86['body'],null))[_0x6179('0x22')](respondWithResult(_0x199b92,null))['catch'](handleError(_0x199b92,null));};exports['destroy']=function(_0x57c76c,_0x443add){return db[_0x6179('0x3c')][_0x6179('0x43')]({'where':{'id':_0x57c76c['params']['id']}})[_0x6179('0x22')](handleEntityNotFound(_0x443add,null))[_0x6179('0x22')](removeEntity(_0x443add,null))[_0x6179('0x41')](handleError(_0x443add,null));};exports[_0x6179('0x2b')]=function(_0x2628a5,_0x413cfa){return db[_0x6179('0x3c')][_0x6179('0x2b')]()[_0x6179('0x22')](respondWithResult(_0x413cfa,null))[_0x6179('0x41')](handleError(_0x413cfa,null));};exports[_0x6179('0x4d')]=function(_0x377c9d,_0x2b1c48,_0x48f8ab){return db[_0x6179('0x4e')]['find']({'where':{'id':_0x377c9d[_0x6179('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b1c48,null))[_0x6179('0x22')](function(_0x59fe72){if(_0x59fe72){return _0x59fe72['addContacts'](_0x377c9d[_0x6179('0x45')][_0x6179('0x4f')],_[_0x6179('0x50')](_0x377c9d[_0x6179('0x45')],[_0x6179('0x4f'),'id'])||{});}})[_0x6179('0x22')](respondWithResult(_0x2b1c48,null))['catch'](handleError(_0x2b1c48,null));};exports['getContacts']=function(_0x43f297,_0x385d01,_0xbdb52b){var _0x1f823e={};var _0x325e90={};var _0x46d61d;var _0x4c0b9d;return db[_0x6179('0x3c')][_0x6179('0x51')]({'where':{'id':_0x43f297[_0x6179('0x42')]['id']}})[_0x6179('0x22')](handleEntityNotFound(_0x385d01,null))[_0x6179('0x22')](function(_0x55524b){if(_0x55524b){_0x46d61d=_0x55524b;_0x325e90[_0x6179('0x2c')]=_['keys'](db[_0x6179('0x4e')][_0x6179('0x52')]);_0x325e90['query']=_['keys'](_0x43f297['query']);_0x325e90[_0x6179('0x36')]=_[_0x6179('0x2f')](_0x325e90['model'],_0x325e90['query']);_0x1f823e['attributes']=_[_0x6179('0x2f')](_0x325e90[_0x6179('0x2c')],qs[_0x6179('0x31')](_0x43f297[_0x6179('0x2e')]['fields']));_0x1f823e[_0x6179('0x30')]=_0x1f823e['attributes'][_0x6179('0x32')]?_0x1f823e[_0x6179('0x30')]:_0x325e90[_0x6179('0x2c')];_0x1f823e['order']=qs[_0x6179('0x34')](_0x43f297[_0x6179('0x2e')][_0x6179('0x34')]);_0x1f823e['where']=qs[_0x6179('0x36')](_[_0x6179('0x37')](_0x43f297[_0x6179('0x2e')],_0x325e90['filters']));if(_0x43f297[_0x6179('0x2e')][_0x6179('0x38')]){_0x1f823e[_0x6179('0x35')]=_[_0x6179('0x39')](_0x1f823e[_0x6179('0x35')],{'$or':_['map'](_0x1f823e[_0x6179('0x30')],function(_0xb637ff){var _0x3ce344={};_0x3ce344[_0xb637ff]={'$like':'%'+_0x43f297['query'][_0x6179('0x38')]+'%'};return _0x3ce344;})});}_0x1f823e=_[_0x6179('0x39')]({},_0x1f823e,_0x43f297[_0x6179('0x3b')]);return _0x46d61d['getContacts'](_0x1f823e);}})[_0x6179('0x22')](function(_0x3bb847){if(_0x3bb847){_0x4c0b9d=_0x3bb847[_0x6179('0x32')];if(!_0x43f297[_0x6179('0x2e')][_0x6179('0x53')]('nolimit')){_0x1f823e[_0x6179('0x1c')]=qs[_0x6179('0x1c')](_0x43f297['query'][_0x6179('0x1c')]);_0x1f823e[_0x6179('0x1a')]=qs[_0x6179('0x1a')](_0x43f297[_0x6179('0x2e')]['offset']);}return _0x46d61d[_0x6179('0x54')](_0x1f823e);}})[_0x6179('0x22')](function(_0x1984d0){if(_0x1984d0){return _0x1984d0?{'count':_0x4c0b9d,'rows':_0x1984d0}:null;}})[_0x6179('0x22')](respondWithResult(_0x385d01,null))[_0x6179('0x41')](handleError(_0x385d01,null));}; \ No newline at end of file +var _0x684e=['describe','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','params','intersection','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','CmContact','ids','getContacts','findOne','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany'];(function(_0x2fdc3b,_0x5e8cc2){var _0x5150b0=function(_0x322164){while(--_0x322164){_0x2fdc3b['push'](_0x2fdc3b['shift']());}};_0x5150b0(++_0x5e8cc2);}(_0x684e,0x1cb));var _0xe684=function(_0x58659d,_0x3b15d2){_0x58659d=_0x58659d-0x0;var _0x429d10=_0x684e[_0x58659d];return _0x429d10;};'use strict';var emlformat=require(_0xe684('0x0'));var rimraf=require(_0xe684('0x1'));var zipdir=require(_0xe684('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe684('0x3'));var moment=require(_0xe684('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe684('0x5'));var util=require(_0xe684('0x6'));var path=require('path');var sox=require(_0xe684('0x7'));var csv=require(_0xe684('0x8'));var ejs=require(_0xe684('0x9'));var fs=require('fs');var fs_extra=require(_0xe684('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe684('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe684('0xc'));var Papa=require(_0xe684('0xd'));var Redis=require(_0xe684('0xe'));var authService=require(_0xe684('0xf'));var qs=require(_0xe684('0x10'));var as=require(_0xe684('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe684('0x12'))(_0xe684('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe684('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x884021,_0x4b8b34){_0x4b8b34=_0x4b8b34||0xcc;return function(_0x3a9c62){if(_0x3a9c62){return _0x884021[_0xe684('0x15')](_0x4b8b34);}return _0x884021[_0xe684('0x16')](_0x4b8b34)[_0xe684('0x17')]();};}function respondWithResult(_0x1dbb83,_0x521fb3){_0x521fb3=_0x521fb3||0xc8;return function(_0x1dedc7){if(_0x1dedc7){return _0x1dbb83[_0xe684('0x16')](_0x521fb3)[_0xe684('0x18')](_0x1dedc7);}};}function respondWithFilteredResult(_0x5ccf44,_0x24e455){return function(_0x191c43){if(_0x191c43){var _0x32dae3=typeof _0x24e455[_0xe684('0x19')]===_0xe684('0x1a')&&typeof _0x24e455[_0xe684('0x1b')]==='undefined';var _0x13b7e1=_0x191c43[_0xe684('0x1c')];var _0x511866=_0x32dae3?0x0:_0x24e455[_0xe684('0x19')];var _0x4b9604=_0x32dae3?_0x191c43[_0xe684('0x1c')]:_0x24e455[_0xe684('0x19')]+_0x24e455[_0xe684('0x1b')];var _0x532ee5;if(_0x4b9604>=_0x13b7e1){_0x4b9604=_0x13b7e1;_0x532ee5=0xc8;}else{_0x532ee5=0xce;}_0x5ccf44[_0xe684('0x16')](_0x532ee5);return _0x5ccf44[_0xe684('0x1d')](_0xe684('0x1e'),_0x511866+'-'+_0x4b9604+'/'+_0x13b7e1)['json'](_0x191c43);}return null;};}function patchUpdates(_0x5eb3c6){return function(_0x322c22){try{jsonpatch[_0xe684('0x1f')](_0x322c22,_0x5eb3c6,!![]);}catch(_0x5c56c1){return BPromise[_0xe684('0x20')](_0x5c56c1);}return _0x322c22[_0xe684('0x21')]();};}function saveUpdates(_0x50471f,_0x7b005d){return function(_0x101b58){if(_0x101b58){return _0x101b58[_0xe684('0x22')](_0x50471f)[_0xe684('0x23')](function(_0x59a545){return _0x59a545;});}return null;};}function removeEntity(_0x3b827a,_0x4b6cf3){return function(_0x1c1589){if(_0x1c1589){return _0x1c1589['destroy']()[_0xe684('0x23')](function(){var _0x1cfa66=_0x1c1589[_0xe684('0x24')]({'plain':!![]});var _0xf02a42=_0xe684('0x25');return db[_0xe684('0x26')]['destroy']({'where':{'type':_0xf02a42,'resourceId':_0x1cfa66['id']}})[_0xe684('0x23')](function(){return _0x1c1589;});})[_0xe684('0x23')](function(){_0x3b827a['status'](0xcc)[_0xe684('0x17')]();});}};}function handleEntityNotFound(_0x2caa03,_0x135e4c){return function(_0x11d38f){if(!_0x11d38f){_0x2caa03['sendStatus'](0x194);}return _0x11d38f;};}function handleError(_0x126247,_0x2a7935){_0x2a7935=_0x2a7935||0x1f4;return function(_0x2fad2f){logger[_0xe684('0x27')](_0x2fad2f[_0xe684('0x28')]);if(_0x2fad2f[_0xe684('0x29')]){delete _0x2fad2f['name'];}_0x126247['status'](_0x2a7935)[_0xe684('0x2a')](_0x2fad2f);};}exports[_0xe684('0x2b')]=function(_0x1b01f9,_0x122bfc){var _0x1ff861={},_0x3a41e3={},_0x11af5f={'count':0x0,'rows':[]};return db[_0xe684('0x2c')][_0xe684('0x2d')]()[_0xe684('0x23')](function(_0x2186d8){_0x3a41e3[_0xe684('0x2e')]=_[_0xe684('0x2f')](_0x2186d8);_0x3a41e3[_0xe684('0x30')]=_[_0xe684('0x2f')](_0x1b01f9[_0xe684('0x30')]);_0x3a41e3[_0xe684('0x31')]=_['intersection'](_0x3a41e3[_0xe684('0x2e')],_0x3a41e3['query']);_0x1ff861['attributes']=_['intersection'](_0x3a41e3[_0xe684('0x2e')],qs[_0xe684('0x32')](_0x1b01f9[_0xe684('0x30')][_0xe684('0x32')]));_0x1ff861[_0xe684('0x33')]=_0x1ff861[_0xe684('0x33')][_0xe684('0x34')]?_0x1ff861[_0xe684('0x33')]:_0x3a41e3['model'];if(!_0x1b01f9[_0xe684('0x30')][_0xe684('0x35')](_0xe684('0x36'))){_0x1ff861[_0xe684('0x1b')]=qs[_0xe684('0x1b')](_0x1b01f9[_0xe684('0x30')][_0xe684('0x1b')]);_0x1ff861[_0xe684('0x19')]=qs['offset'](_0x1b01f9[_0xe684('0x30')][_0xe684('0x19')]);}_0x1ff861[_0xe684('0x37')]=qs['sort'](_0x1b01f9[_0xe684('0x30')][_0xe684('0x38')]);_0x1ff861[_0xe684('0x39')]=qs['filters'](_[_0xe684('0x3a')](_0x1b01f9[_0xe684('0x30')],_0x3a41e3[_0xe684('0x31')]),_0x2186d8);if(_0x1b01f9['query'][_0xe684('0x3b')]){_0x1ff861[_0xe684('0x39')]=_[_0xe684('0x3c')](_0x1ff861['where'],{'$or':_[_0xe684('0x3d')](_0x1ff861['attributes'],function(_0x5478de){var _0x45f11b={};_0x45f11b[_0x5478de]={'$like':'%'+_0x1b01f9[_0xe684('0x30')][_0xe684('0x3b')]+'%'};return _0x45f11b;})});}_0x1ff861=_[_0xe684('0x3c')]({},_0x1ff861,_0x1b01f9[_0xe684('0x3e')]);var _0x55ce2f={'where':_0x1ff861[_0xe684('0x39')]};return db[_0xe684('0x2c')][_0xe684('0x1c')](_0x55ce2f)[_0xe684('0x23')](function(_0xc86481){_0x11af5f['count']=_0xc86481;if(_0x1b01f9[_0xe684('0x30')][_0xe684('0x3f')]){_0x1ff861[_0xe684('0x40')]=[{'all':!![]}];}return db['CmCompany'][_0xe684('0x41')](_0x1ff861);})[_0xe684('0x23')](function(_0xc5395c){_0x11af5f[_0xe684('0x42')]=_0xc5395c;return _0x11af5f;})['then'](respondWithFilteredResult(_0x122bfc,_0x1ff861))[_0xe684('0x43')](handleError(_0x122bfc,null));})[_0xe684('0x43')](handleError(_0x122bfc,null));};exports['show']=function(_0x3daa2c,_0x539b77){var _0x11c504={'raw':![],'where':{'id':_0x3daa2c[_0xe684('0x44')]['id']}},_0x2f498b={};_0x2f498b[_0xe684('0x2e')]=_['keys'](db[_0xe684('0x2c')]['rawAttributes']);_0x2f498b[_0xe684('0x30')]=_[_0xe684('0x2f')](_0x3daa2c[_0xe684('0x30')]);_0x2f498b['filters']=_[_0xe684('0x45')](_0x2f498b[_0xe684('0x2e')],_0x2f498b[_0xe684('0x30')]);_0x11c504['attributes']=_['intersection'](_0x2f498b[_0xe684('0x2e')],qs['fields'](_0x3daa2c[_0xe684('0x30')][_0xe684('0x32')]));_0x11c504['attributes']=_0x11c504[_0xe684('0x33')][_0xe684('0x34')]?_0x11c504[_0xe684('0x33')]:_0x2f498b[_0xe684('0x2e')];if(_0x3daa2c[_0xe684('0x30')][_0xe684('0x3f')]){_0x11c504['include']=[{'all':!![]}];}_0x11c504=_[_0xe684('0x3c')]({},_0x11c504,_0x3daa2c['options']);return db[_0xe684('0x2c')][_0xe684('0x46')](_0x11c504)['then'](handleEntityNotFound(_0x539b77,null))[_0xe684('0x23')](respondWithResult(_0x539b77,null))[_0xe684('0x43')](handleError(_0x539b77,null));};exports[_0xe684('0x47')]=function(_0x1f2d4d,_0x55813d){return db[_0xe684('0x2c')][_0xe684('0x47')](_0x1f2d4d[_0xe684('0x48')],{})['then'](function(_0x6f6137){var _0x315510=_0x1f2d4d[_0xe684('0x49')][_0xe684('0x24')]({'plain':!![]});if(!_0x315510)throw new Error(_0xe684('0x4a'));if(_0x315510[_0xe684('0x4b')]==='user'){var _0x890b03=_0x6f6137[_0xe684('0x24')]({'plain':!![]});var _0x6bcd94='Companies';return db[_0xe684('0x4c')]['find']({'where':{'name':_0x6bcd94,'userProfileId':_0x315510[_0xe684('0x4d')]},'raw':!![]})['then'](function(_0x3eb699){if(_0x3eb699&&_0x3eb699['autoAssociation']===0x0){return db[_0xe684('0x26')][_0xe684('0x47')]({'name':_0x890b03['name'],'resourceId':_0x890b03['id'],'type':_0x3eb699[_0xe684('0x29')],'sectionId':_0x3eb699['id']},{})['then'](function(){return _0x6f6137;});}else{return _0x6f6137;}})[_0xe684('0x43')](function(_0x38573f){logger[_0xe684('0x27')](_0xe684('0x4e'),_0x38573f);throw _0x38573f;});}return _0x6f6137;})[_0xe684('0x23')](respondWithResult(_0x55813d,0xc9))[_0xe684('0x43')](handleError(_0x55813d,null));};exports[_0xe684('0x22')]=function(_0x116138,_0x47b1b8){if(_0x116138['body']['id']){delete _0x116138['body']['id'];}return db['CmCompany'][_0xe684('0x46')]({'where':{'id':_0x116138['params']['id']}})[_0xe684('0x23')](handleEntityNotFound(_0x47b1b8,null))[_0xe684('0x23')](saveUpdates(_0x116138[_0xe684('0x48')],null))[_0xe684('0x23')](respondWithResult(_0x47b1b8,null))[_0xe684('0x43')](handleError(_0x47b1b8,null));};exports[_0xe684('0x4f')]=function(_0x130e09,_0x3abdad){return db['CmCompany'][_0xe684('0x46')]({'where':{'id':_0x130e09[_0xe684('0x44')]['id']}})[_0xe684('0x23')](handleEntityNotFound(_0x3abdad,null))[_0xe684('0x23')](removeEntity(_0x3abdad,null))[_0xe684('0x43')](handleError(_0x3abdad,null));};exports[_0xe684('0x2d')]=function(_0x245d5a,_0x7dc7f2){return db[_0xe684('0x2c')][_0xe684('0x2d')]()['then'](respondWithResult(_0x7dc7f2,null))['catch'](handleError(_0x7dc7f2,null));};exports['addContacts']=function(_0x184d9b,_0x2ceb5a,_0x555fb4){return db[_0xe684('0x50')][_0xe684('0x46')]({'where':{'id':_0x184d9b[_0xe684('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ceb5a,null))[_0xe684('0x23')](function(_0x2cf5f5){if(_0x2cf5f5){return _0x2cf5f5['addContacts'](_0x184d9b[_0xe684('0x48')][_0xe684('0x51')],_['omit'](_0x184d9b[_0xe684('0x48')],[_0xe684('0x51'),'id'])||{});}})[_0xe684('0x23')](respondWithResult(_0x2ceb5a,null))[_0xe684('0x43')](handleError(_0x2ceb5a,null));};exports[_0xe684('0x52')]=function(_0x18ea2b,_0x53b253,_0x41d325){var _0x148e49={};var _0x29caf6={};var _0x5d3825;var _0x4ae14f;return db[_0xe684('0x2c')][_0xe684('0x53')]({'where':{'id':_0x18ea2b[_0xe684('0x44')]['id']}})[_0xe684('0x23')](handleEntityNotFound(_0x53b253,null))['then'](function(_0x4793b0){if(_0x4793b0){_0x5d3825=_0x4793b0;_0x29caf6['model']=_[_0xe684('0x2f')](db[_0xe684('0x50')]['rawAttributes']);_0x29caf6['query']=_[_0xe684('0x2f')](_0x18ea2b[_0xe684('0x30')]);_0x29caf6[_0xe684('0x31')]=_[_0xe684('0x45')](_0x29caf6[_0xe684('0x2e')],_0x29caf6[_0xe684('0x30')]);_0x148e49[_0xe684('0x33')]=_[_0xe684('0x45')](_0x29caf6[_0xe684('0x2e')],qs['fields'](_0x18ea2b['query'][_0xe684('0x32')]));_0x148e49[_0xe684('0x33')]=_0x148e49[_0xe684('0x33')]['length']?_0x148e49[_0xe684('0x33')]:_0x29caf6[_0xe684('0x2e')];_0x148e49[_0xe684('0x37')]=qs[_0xe684('0x38')](_0x18ea2b[_0xe684('0x30')][_0xe684('0x38')]);_0x148e49[_0xe684('0x39')]=qs[_0xe684('0x31')](_[_0xe684('0x3a')](_0x18ea2b[_0xe684('0x30')],_0x29caf6['filters']));if(_0x18ea2b[_0xe684('0x30')]['filter']){_0x148e49[_0xe684('0x39')]=_[_0xe684('0x3c')](_0x148e49[_0xe684('0x39')],{'$or':_['map'](_0x148e49['attributes'],function(_0x2a1d94){var _0x2e17f4={};_0x2e17f4[_0x2a1d94]={'$like':'%'+_0x18ea2b['query']['filter']+'%'};return _0x2e17f4;})});}_0x148e49=_[_0xe684('0x3c')]({},_0x148e49,_0x18ea2b[_0xe684('0x3e')]);return _0x5d3825['getContacts'](_0x148e49);}})['then'](function(_0x354d77){if(_0x354d77){_0x4ae14f=_0x354d77['length'];if(!_0x18ea2b[_0xe684('0x30')]['hasOwnProperty'](_0xe684('0x36'))){_0x148e49[_0xe684('0x1b')]=qs[_0xe684('0x1b')](_0x18ea2b[_0xe684('0x30')][_0xe684('0x1b')]);_0x148e49[_0xe684('0x19')]=qs[_0xe684('0x19')](_0x18ea2b[_0xe684('0x30')][_0xe684('0x19')]);}return _0x5d3825[_0xe684('0x52')](_0x148e49);}})[_0xe684('0x23')](function(_0x5c4798){if(_0x5c4798){return _0x5c4798?{'count':_0x4ae14f,'rows':_0x5c4798}:null;}})['then'](respondWithResult(_0x53b253,null))[_0xe684('0x43')](handleError(_0x53b253,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index ad67e33..2353686 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 _0x08cb=['define','cm_companies','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0x08cb,0xd3));var _0xb08c=function(_0x52d240,_0x12ddee){_0x52d240=_0x52d240-0x0;var _0x415c40=_0x08cb[_0x52d240];return _0x415c40;};'use strict';var _=require(_0xb08c('0x0'));var util=require(_0xb08c('0x1'));var logger=require('../../config/logger')(_0xb08c('0x2'));var moment=require(_0xb08c('0x3'));var BPromise=require(_0xb08c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb08c('0x5'));var config=require(_0xb08c('0x6'));var attributes=require(_0xb08c('0x7'));module[_0xb08c('0x8')]=function(_0x42eb8e,_0x16a00b){return _0x42eb8e[_0xb08c('0x9')]('CmCompany',attributes,{'tableName':_0xb08c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1116=['rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','bluebird','path'];(function(_0x1c3df3,_0x102dc1){var _0x325b63=function(_0x2d67be){while(--_0x2d67be){_0x1c3df3['push'](_0x1c3df3['shift']());}};_0x325b63(++_0x102dc1);}(_0x1116,0x114));var _0x6111=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0x1116[_0xffa198];return _0x1e4b50;};'use strict';var _=require(_0x6111('0x0'));var util=require('util');var logger=require(_0x6111('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6111('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6111('0x3'));var rimraf=require(_0x6111('0x4'));var config=require('../../config/environment');var attributes=require(_0x6111('0x5'));module[_0x6111('0x6')]=function(_0x15dbb3,_0x4f15b8){return _0x15dbb3[_0x6111('0x7')](_0x6111('0x8'),attributes,{'tableName':_0x6111('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 7a2e55a..6a455ab 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 _0x3a8e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x37b853,_0x17f0aa){var _0x5ef4b9=function(_0xa36917){while(--_0xa36917){_0x37b853['push'](_0x37b853['shift']());}};_0x5ef4b9(++_0x17f0aa);}(_0x3a8e,0xdd));var _0xe3a8=function(_0x530e38,_0x5f1d0f){_0x530e38=_0x530e38-0x0;var _0x4b6a58=_0x3a8e[_0x530e38];return _0x4b6a58;};'use strict';var _=require(_0xe3a8('0x0'));var util=require(_0xe3a8('0x1'));var moment=require(_0xe3a8('0x2'));var BPromise=require(_0xe3a8('0x3'));var rs=require(_0xe3a8('0x4'));var fs=require('fs');var Redis=require(_0xe3a8('0x5'));var db=require(_0xe3a8('0x6'))['db'];var utils=require(_0xe3a8('0x7'));var logger=require(_0xe3a8('0x8'))(_0xe3a8('0x9'));var config=require(_0xe3a8('0xa'));var jayson=require(_0xe3a8('0xb'));var client=jayson['client'][_0xe3a8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13479d,_0x484d59,_0x135c70){return new BPromise(function(_0x2107c9,_0x2f5d77){return client[_0xe3a8('0xd')](_0x13479d,_0x135c70)[_0xe3a8('0xe')](function(_0x47fb47){logger[_0xe3a8('0xf')](_0xe3a8('0x10'),_0x484d59,_0xe3a8('0x11'));logger[_0xe3a8('0x12')](_0xe3a8('0x13'),_0x484d59,_0xe3a8('0x11'),JSON[_0xe3a8('0x14')](_0x47fb47));if(_0x47fb47[_0xe3a8('0x15')]){if(_0x47fb47[_0xe3a8('0x15')][_0xe3a8('0x16')]===0x1f4){logger[_0xe3a8('0x15')](_0xe3a8('0x10'),_0x484d59,_0x47fb47[_0xe3a8('0x15')][_0xe3a8('0x17')]);return _0x2f5d77(_0x47fb47[_0xe3a8('0x15')][_0xe3a8('0x17')]);}logger['error'](_0xe3a8('0x10'),_0x484d59,_0x47fb47['error']['message']);return _0x2107c9(_0x47fb47[_0xe3a8('0x15')][_0xe3a8('0x17')]);}else{logger[_0xe3a8('0xf')]('CmCompany,\x20%s,\x20%s',_0x484d59,_0xe3a8('0x11'));_0x2107c9(_0x47fb47['result']['message']);}})[_0xe3a8('0x18')](function(_0x2d1d83){logger[_0xe3a8('0x15')]('CmCompany,\x20%s,\x20%s',_0x484d59,_0x2d1d83);_0x2f5d77(_0x2d1d83);});});} \ No newline at end of file +var _0x0d9c=['then','info','CmCompany,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x428eec,_0x532977){var _0x7132f8=function(_0x128baf){while(--_0x128baf){_0x428eec['push'](_0x428eec['shift']());}};_0x7132f8(++_0x532977);}(_0x0d9c,0xf9));var _0xc0d9=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x0d9c[_0x3358ba];return _0x296e73;};'use strict';var _=require(_0xc0d9('0x0'));var util=require(_0xc0d9('0x1'));var moment=require('moment');var BPromise=require(_0xc0d9('0x2'));var rs=require(_0xc0d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc0d9('0x4'))['db'];var utils=require(_0xc0d9('0x5'));var logger=require('../../config/logger')(_0xc0d9('0x6'));var config=require(_0xc0d9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc0d9('0x8')][_0xc0d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3720c4,_0x5730d2,_0x28d5f7){return new BPromise(function(_0x5a6213,_0x1948ec){return client[_0xc0d9('0xa')](_0x3720c4,_0x28d5f7)[_0xc0d9('0xb')](function(_0x261389){logger[_0xc0d9('0xc')](_0xc0d9('0xd'),_0x5730d2,_0xc0d9('0xe'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x5730d2,_0xc0d9('0xe'),JSON['stringify'](_0x261389));if(_0x261389[_0xc0d9('0xf')]){if(_0x261389[_0xc0d9('0xf')][_0xc0d9('0x10')]===0x1f4){logger[_0xc0d9('0xf')](_0xc0d9('0xd'),_0x5730d2,_0x261389[_0xc0d9('0xf')][_0xc0d9('0x11')]);return _0x1948ec(_0x261389[_0xc0d9('0xf')][_0xc0d9('0x11')]);}logger['error'](_0xc0d9('0xd'),_0x5730d2,_0x261389[_0xc0d9('0xf')][_0xc0d9('0x11')]);return _0x5a6213(_0x261389[_0xc0d9('0xf')][_0xc0d9('0x11')]);}else{logger[_0xc0d9('0xc')](_0xc0d9('0xd'),_0x5730d2,_0xc0d9('0xe'));_0x5a6213(_0x261389[_0xc0d9('0x12')]['message']);}})[_0xc0d9('0x13')](function(_0x2faac4){logger['error'](_0xc0d9('0xd'),_0x5730d2,_0x2faac4);_0x1948ec(_0x2faac4);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 6015b72..4ffde7f 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 _0xc586=['Router','fs-extra','../../components/interaction/service','./cmCompany.controller','get','/describe','/:id','isAuthenticated','show','getContacts','create','post','/:id/contacts','addContacts','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x291697,_0x1f67c2){var _0x3ee552=function(_0xb0b63c){while(--_0xb0b63c){_0x291697['push'](_0x291697['shift']());}};_0x3ee552(++_0x1f67c2);}(_0xc586,0x1b0));var _0x6c58=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc586[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0x6c58('0x0'));var util=require(_0x6c58('0x1'));var path=require(_0x6c58('0x2'));var timeout=require(_0x6c58('0x3'));var express=require(_0x6c58('0x4'));var router=express[_0x6c58('0x5')]();var fs_extra=require(_0x6c58('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6c58('0x7'));var config=require('../../config/environment');var controller=require(_0x6c58('0x8'));router[_0x6c58('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6c58('0x9')](_0x6c58('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x6c58('0x9')](_0x6c58('0xb'),auth[_0x6c58('0xc')](),controller[_0x6c58('0xd')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0x6c58('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6c58('0xf')]);router[_0x6c58('0x10')](_0x6c58('0x11'),auth['isAuthenticated'](),controller[_0x6c58('0x12')]);router[_0x6c58('0x13')](_0x6c58('0xb'),auth['isAuthenticated'](),controller[_0x6c58('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6c58('0x15')]);module[_0x6c58('0x16')]=router; \ No newline at end of file +var _0x4844=['../../components/interaction/service','../../config/environment','./cmCompany.controller','/describe','describe','/:id','isAuthenticated','show','/:id/contacts','getContacts','post','create','addContacts','put','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x14cce2,_0x2a181b){var _0x1b2431=function(_0x35b1e5){while(--_0x35b1e5){_0x14cce2['push'](_0x14cce2['shift']());}};_0x1b2431(++_0x2a181b);}(_0x4844,0x1f2));var _0x4484=function(_0x131bc1,_0x14f780){_0x131bc1=_0x131bc1-0x0;var _0x36b03a=_0x4844[_0x131bc1];return _0x36b03a;};'use strict';var multer=require(_0x4484('0x0'));var util=require('util');var path=require(_0x4484('0x1'));var timeout=require(_0x4484('0x2'));var express=require('express');var router=express[_0x4484('0x3')]();var fs_extra=require(_0x4484('0x4'));var auth=require(_0x4484('0x5'));var interaction=require(_0x4484('0x6'));var config=require(_0x4484('0x7'));var controller=require(_0x4484('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4484('0x9'),auth['isAuthenticated'](),controller[_0x4484('0xa')]);router['get'](_0x4484('0xb'),auth[_0x4484('0xc')](),controller[_0x4484('0xd')]);router['get'](_0x4484('0xe'),auth[_0x4484('0xc')](),controller[_0x4484('0xf')]);router[_0x4484('0x10')]('/',auth[_0x4484('0xc')](),controller[_0x4484('0x11')]);router[_0x4484('0x10')](_0x4484('0xe'),auth['isAuthenticated'](),controller[_0x4484('0x12')]);router[_0x4484('0x13')]('/:id',auth[_0x4484('0xc')](),controller['update']);router[_0x4484('0x14')](_0x4484('0xb'),auth[_0x4484('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 82cd688..6349218 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 _0xf768=['TEXT','INTEGER','lodash','sequelize','exports','STRING'];(function(_0x36f5cb,_0x2a720f){var _0x58d6ce=function(_0x1adfb5){while(--_0x1adfb5){_0x36f5cb['push'](_0x36f5cb['shift']());}};_0x58d6ce(++_0x2a720f);}(_0xf768,0x152));var _0x8f76=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf768[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x8f76('0x0'));var Sequelize=require(_0x8f76('0x1'));module[_0x8f76('0x2')]={'firstName':{'type':Sequelize[_0x8f76('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8f76('0x3')]},'street':{'type':Sequelize[_0x8f76('0x3')]},'postalCode':{'type':Sequelize[_0x8f76('0x3')]},'city':{'type':Sequelize[_0x8f76('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8f76('0x4')]},'phone':{'type':Sequelize[_0x8f76('0x3')]},'mobile':{'type':Sequelize[_0x8f76('0x3')]},'fax':{'type':Sequelize[_0x8f76('0x3')]},'email':{'type':Sequelize[_0x8f76('0x3')]},'url':{'type':Sequelize[_0x8f76('0x3')]},'facebook':{'type':Sequelize[_0x8f76('0x3')]},'fb_data':{'type':Sequelize[_0x8f76('0x3')]},'twitter':{'type':Sequelize[_0x8f76('0x3')]},'skype':{'type':Sequelize[_0x8f76('0x3')]},'teams':{'type':Sequelize[_0x8f76('0x3')]},'viber':{'type':Sequelize[_0x8f76('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x8f76('0x3')]},'telegram':{'type':Sequelize[_0x8f76('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x8f76('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x1201=['TEXT','INTEGER','UNSIGNED','DATE','lodash','sequelize','exports','STRING'];(function(_0x3343d8,_0x1c65be){var _0x5024bc=function(_0x4271fe){while(--_0x4271fe){_0x3343d8['push'](_0x3343d8['shift']());}};_0x5024bc(++_0x1c65be);}(_0x1201,0xcc));var _0x1120=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x1201[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x1120('0x0'));var Sequelize=require(_0x1120('0x1'));module[_0x1120('0x2')]={'firstName':{'type':Sequelize[_0x1120('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1120('0x3')]},'street':{'type':Sequelize[_0x1120('0x3')]},'postalCode':{'type':Sequelize[_0x1120('0x3')]},'city':{'type':Sequelize[_0x1120('0x3')]},'country':{'type':Sequelize[_0x1120('0x3')]},'dateOfBirth':{'type':Sequelize[_0x1120('0x3')]},'description':{'type':Sequelize[_0x1120('0x4')]},'phone':{'type':Sequelize[_0x1120('0x3')]},'mobile':{'type':Sequelize[_0x1120('0x3')]},'fax':{'type':Sequelize[_0x1120('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x1120('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x1120('0x3')]},'skype':{'type':Sequelize[_0x1120('0x3')]},'teams':{'type':Sequelize[_0x1120('0x3')]},'viber':{'type':Sequelize[_0x1120('0x3')]},'line':{'type':Sequelize[_0x1120('0x3')]},'wechat':{'type':Sequelize[_0x1120('0x3')]},'telegram':{'type':Sequelize[_0x1120('0x3')]},'UserId':{'type':Sequelize[_0x1120('0x5')]},'priority':{'type':Sequelize[_0x1120('0x5')](0x2)[_0x1120('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1120('0x7')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 51ebe73..6a18a7c 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 _0xa727=['c.lastName','c.phone','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','describe','tags','columnName','analytics','findAll','displayName','alias','custom','values','body','get','isArray','join','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','spread','show','params','$and','omit','format','cf_%d','table','cm_contacts','setFields','id\x20=\x20?','text','phone','getTags','rawAttributes','pick','options','setTags','ids','getHoppers','CmHopper','ContactId','includeAll','include','getHopperHistories','getHopperFinals','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','upload','createReadStream','meta','import','agent','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','sms','openchannel','fax','whatsapp','voice','channel','toLowerCase','parse','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','DESC','fullname','chat','Website','closed','closedAt','disposition','thirdDisposition','Account','Owner','customerIp','customerPort','osName','ratingType','ratingValue','referer','subject','externalUrl','threadId','startCase','Interaction','findAndCountAll','flatten','reverse','slice','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','count','set','update','then','destroy','end','error','stack','name','send','index','CmContact','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','fieldType','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','field','color','from','left_join','cm_user_has_contacts','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','find','Tag','value','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','start','map','filter','isNil','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','t.id\x20IN\x20?','resolve','user','role','some','User','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.firstName'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa727,0x1d0));var _0x7a72=function(_0x55e52a,_0x5db621){_0x55e52a=_0x55e52a-0x0;var _0x4b7634=_0xa727[_0x55e52a];return _0x4b7634;};'use strict';var moment=require(_0x7a72('0x0'));var BPromise=require(_0x7a72('0x1'));var util=require(_0x7a72('0x2'));var path=require(_0x7a72('0x3'));var fs=require('fs');var _=require(_0x7a72('0x4'));var squel=require(_0x7a72('0x5'));var Papa=require('papaparse');var Redis=require(_0x7a72('0x6'));var qs=require('../../components/parsers/qs');var as=require(_0x7a72('0x7'));var logger=require(_0x7a72('0x8'))('api');var config=require('../../config/environment');var db=require(_0x7a72('0x9'))['db'];config[_0x7a72('0xa')]=_['defaults'](config[_0x7a72('0xa')],{'host':_0x7a72('0xb'),'port':0x18eb});var socket=require(_0x7a72('0xc'))(new Redis(config[_0x7a72('0xa')]));require(_0x7a72('0xd'))[_0x7a72('0xe')](socket);function respondWithResult(_0x59126b,_0x572223){_0x572223=_0x572223||0xc8;return function(_0x222f0e){if(_0x222f0e){return _0x59126b[_0x7a72('0xf')](_0x572223)[_0x7a72('0x10')](_0x222f0e);}};}function respondWithFilteredResult(_0x2f84c3,_0x3bb99a){return function(_0x4980ec){if(_0x4980ec){var _0x15e1ff=typeof _0x3bb99a[_0x7a72('0x11')]===_0x7a72('0x12')&&typeof _0x3bb99a['limit']===_0x7a72('0x12');var _0x40d13c=_0x4980ec[_0x7a72('0x13')];var _0x1c720b=_0x15e1ff?0x0:_0x3bb99a[_0x7a72('0x11')];var _0x1d1e6c=_0x15e1ff?_0x4980ec['count']:_0x3bb99a[_0x7a72('0x11')]+_0x3bb99a['limit'];var _0x446987;if(_0x1d1e6c>=_0x40d13c){_0x1d1e6c=_0x40d13c;_0x446987=0xc8;}else{_0x446987=0xce;}_0x2f84c3[_0x7a72('0xf')](_0x446987);return _0x2f84c3[_0x7a72('0x14')]('Content-Range',_0x1c720b+'-'+_0x1d1e6c+'/'+_0x40d13c)[_0x7a72('0x10')](_0x4980ec);}return null;};}function saveUpdates(_0x445419){return function(_0xe8d651){if(_0xe8d651){return _0xe8d651[_0x7a72('0x15')](_0x445419)[_0x7a72('0x16')](function(_0x1bdf54){return _0x1bdf54;});}return null;};}function removeEntity(_0x49b85c){return function(_0x3763eb){if(_0x3763eb){return _0x3763eb[_0x7a72('0x17')]()[_0x7a72('0x16')](function(){_0x49b85c[_0x7a72('0xf')](0xcc)[_0x7a72('0x18')]();});}};}function handleEntityNotFound(_0x591450){return function(_0x2ad5dc){if(!_0x2ad5dc){_0x591450['sendStatus'](0x194);}return _0x2ad5dc;};}function handleError(_0x3bf191,_0x36fff2){_0x36fff2=_0x36fff2||0x1f4;return function(_0x357098){logger[_0x7a72('0x19')](_0x357098[_0x7a72('0x1a')]);if(_0x357098[_0x7a72('0x1b')]){delete _0x357098[_0x7a72('0x1b')];}_0x3bf191['status'](_0x36fff2)[_0x7a72('0x1c')](_0x357098);};}exports[_0x7a72('0x1d')]=function(_0x1d2ef9,_0x2804ac){var _0x9342f2={},_0x3b5454={},_0x69d537={'count':0x0,'rows':[]};return db[_0x7a72('0x1e')]['describe']()['then'](function(_0x82e37){var _0x2f040c=[];for(var _0x43bedc=0x0;_0x43bedc0x1){_0x4a6ff3['or'](_0x7a72('0x5d'),qs[_0x7a72('0x5e')](_0x3af4a3),null);}else{if(qs[_0x7a72('0x5f')](_0x3af4a3)){_0x4a6ff3['or'](_0x7a72('0x60'),_0x3af4a3+'%');_0x4a6ff3['or'](_0x7a72('0x61'),_0x3af4a3+'%');_0x4a6ff3['or']('c.mobile\x20LIKE\x20?',_0x3af4a3+'%');_0x4a6ff3['or']('c.fax\x20LIKE\x20?',_0x3af4a3+'%');}else if(qs[_0x7a72('0x62')](_0x3af4a3)){_0x4a6ff3['or'](_0x7a72('0x63'),_0x3af4a3+'%');}else{_0x4a6ff3['or'](_0x7a72('0x64'),'%'+_0x3af4a3+'%');_0x4a6ff3['or'](_0x7a72('0x65'),'%'+_0x3af4a3+'%');_0x4a6ff3['or']('c.email\x20LIKE\x20?','%'+_0x3af4a3+'%');}}}}_0x208be4[_0x7a72('0x35')](_0x4a6ff3);_0x208be4[_0x7a72('0x66')](_0x7a72('0x67'));var _0x224857={'type':db[_0x7a72('0x68')][_0x7a72('0x69')][_0x7a72('0x6a')],'raw':!![]};var _0x50439f=_0x208be4[_0x7a72('0x6b')]()[_0x7a72('0x36')](_0x7a72('0x67'));if(_0x9342f2[_0x7a72('0x33')]){_0x9342f2[_0x7a72('0x33')][_0x7a72('0x55')](function(_0x441949){_0x208be4[_0x7a72('0x33')]('c.'+_0x441949[0x0],_0x441949[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x68221f)){_0x208be4[_0x7a72('0x6c')](_0x154bc6);_0x50439f[_0x7a72('0x35')](_0x7a72('0x6d'),_0x68221f);}BPromise[_0x7a72('0x6e')]()[_0x7a72('0x16')](function(){if(!_0x10b798)return;if(_0x1d2ef9[_0x7a72('0x6f')][_0x7a72('0x70')]!=='agent')return;if(!_[_0x7a72('0x71')](_0x10b798[_0x7a72('0x41')],[_0x7a72('0x36'),_0x7a72('0x72')])){return _0x1d2ef9[_0x7a72('0x6f')][_0x7a72('0x73')]({'attributes':['id'],'raw':!![]})['then'](function(_0x59e7d0){if(_['isEmpty'](_0x59e7d0)){_0x50439f[_0x7a72('0x35')](_0x7a72('0x74'));_0x208be4[_0x7a72('0x35')](_0x7a72('0x74'));}else{_0x50439f[_0x7a72('0x35')](_0x7a72('0x57'),_[_0x7a72('0x50')](_0x59e7d0,'id'));_0x208be4['where'](_0x7a72('0x57'),_[_0x7a72('0x50')](_0x59e7d0,'id'));}});}})[_0x7a72('0x16')](function(){if(_0x1d2ef9['user'][_0x7a72('0x70')]==='agent'&&!_0x10b798&&!_0x1d2ef9[_0x7a72('0x2b')]['ListId'])return[];return db[_0x7a72('0x75')][_0x7a72('0x2b')](_0x50439f[_0x7a72('0x76')](),_0x224857);})[_0x7a72('0x16')](function(_0x4e0588){_0x69d537[_0x7a72('0x13')]=_0x4e0588[_0x7a72('0x20')];if(_0x69d537[_0x7a72('0x13')]===0x0)return[];return db[_0x7a72('0x75')][_0x7a72('0x2b')](_0x39c36c[_0x7a72('0x76')](),_0x224857)[_0x7a72('0x16')](function(_0x355b53){_0x52fa7b=_[_0x7a72('0x77')](_0x355b53,'id');_0x224857=_[_0x7a72('0x78')](_0x224857,{'model':db[_0x7a72('0x1e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1d2ef9[_0x7a72('0x2b')][_0x7a72('0x2f')]){_0x9342f2['attributes'][_0x7a72('0x55')](function(_0x2d0cb2){_0x208be4[_0x7a72('0x36')]('c.'+_0x2d0cb2);});}else{_0x208be4[_0x7a72('0x36')](_0x7a72('0x67'));_0x208be4[_0x7a72('0x36')](_0x7a72('0x79'));_0x208be4[_0x7a72('0x36')](_0x7a72('0x7a'));_0x208be4['field'](_0x7a72('0x7b'));_0x208be4[_0x7a72('0x36')]('c.mobile');_0x208be4['field'](_0x7a72('0x7c'));_0x208be4[_0x7a72('0x36')](_0x7a72('0x7d'));_0x208be4[_0x7a72('0x36')](_0x7a72('0x7e'));_0x208be4[_0x7a72('0x36')](_0x7a72('0x7f'));_0x208be4[_0x7a72('0x36')](_0x7a72('0x80'));_0x208be4[_0x7a72('0x36')](_0x7a72('0x81'));_0x208be4['field'](_0x7a72('0x82'),_0x7a72('0x83'));}if(_0x9342f2['limit'])_0x208be4[_0x7a72('0x32')](_0x9342f2[_0x7a72('0x32')]);if(_0x9342f2[_0x7a72('0x11')])_0x208be4[_0x7a72('0x11')](_0x9342f2[_0x7a72('0x11')]);return db[_0x7a72('0x75')][_0x7a72('0x2b')](_0x208be4[_0x7a72('0x76')](),_0x224857);});})[_0x7a72('0x16')](function(_0x56b56e){_0x56b56e['forEach'](function(_0x590f43){if(_0x590f43[_0x7a72('0x83')]){_0x590f43[_0x7a72('0x84')]=[];_0x590f43[_0x7a72('0x83')][_0x7a72('0x45')](',')[_0x7a72('0x55')](function(_0x1557c3){_0x590f43[_0x7a72('0x84')][_0x7a72('0x23')](_0x52fa7b[_0x1557c3]);});}delete _0x590f43[_0x7a72('0x83')];});_0x69d537[_0x7a72('0x85')]=_0x56b56e;return _0x69d537;})['then'](respondWithFilteredResult(_0x2804ac,_0x9342f2));})[_0x7a72('0x86')](handleError(_0x2804ac,null));};exports[_0x7a72('0x17')]=function(_0x2c0747,_0x7fb379){return db['CmContact'][_0x7a72('0x42')]({'where':{'id':_0x2c0747['params']['id']}})[_0x7a72('0x16')](handleEntityNotFound(_0x7fb379,null))[_0x7a72('0x16')](removeEntity(_0x7fb379,null))[_0x7a72('0x86')](handleError(_0x7fb379,null));};exports[_0x7a72('0x87')]=function(_0x20217d,_0x5482b9){return db[_0x7a72('0x1e')][_0x7a72('0x87')]()[_0x7a72('0x16')](function(_0x247e70){delete _0x247e70[_0x7a72('0x88')];for(var _0x12d4b5=0x0;_0x12d4b5=_0x112df6){_0x1dfef3=_0x112df6;_0x21c6f2=0xc8;}else{_0x21c6f2=0xce;}_0x505b74[_0xb3b6('0xd')](_0x21c6f2);return _0x505b74[_0xb3b6('0x12')](_0xb3b6('0x13'),_0xb50c84+'-'+_0x1dfef3+'/'+_0x112df6)['json'](_0xfb7c85);}return null;};}function saveUpdates(_0xab6b52){return function(_0x3102f3){if(_0x3102f3){return _0x3102f3[_0xb3b6('0x14')](_0xab6b52)[_0xb3b6('0x15')](function(_0x3b7ae5){return _0x3b7ae5;});}return null;};}function removeEntity(_0x2198aa){return function(_0x2fd6a6){if(_0x2fd6a6){return _0x2fd6a6[_0xb3b6('0x16')]()[_0xb3b6('0x15')](function(){_0x2198aa[_0xb3b6('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x231aa7){return function(_0xc10d75){if(!_0xc10d75){_0x231aa7[_0xb3b6('0x17')](0x194);}return _0xc10d75;};}function handleError(_0x66ff5b,_0x3b5e84){_0x3b5e84=_0x3b5e84||0x1f4;return function(_0x422130){logger[_0xb3b6('0x18')](_0x422130[_0xb3b6('0x19')]);if(_0x422130[_0xb3b6('0x1a')]){delete _0x422130[_0xb3b6('0x1a')];}_0x66ff5b[_0xb3b6('0xd')](_0x3b5e84)[_0xb3b6('0x1b')](_0x422130);};}exports[_0xb3b6('0x1c')]=function(_0x481134,_0x47584f){var _0x44758b={},_0x4742f9={},_0x2ed840={'count':0x0,'rows':[]};return db[_0xb3b6('0x1d')][_0xb3b6('0x1e')]()['then'](function(_0x53730e){var _0x42c3c8=[];for(var _0x3d48d6=0x0;_0x3d48d60x1){_0xf3e039['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb3b6('0x59')](_0x299d32),null);}else{if(qs[_0xb3b6('0x5a')](_0x299d32)){_0xf3e039['or'](_0xb3b6('0x5b'),_0x299d32+'%');_0xf3e039['or'](_0xb3b6('0x5c'),_0x299d32+'%');_0xf3e039['or'](_0xb3b6('0x5d'),_0x299d32+'%');_0xf3e039['or']('c.fax\x20LIKE\x20?',_0x299d32+'%');}else if(qs[_0xb3b6('0x5e')](_0x299d32)){_0xf3e039['or'](_0xb3b6('0x5f'),_0x299d32+'%');}else{_0xf3e039['or']('c.firstName\x20LIKE\x20?','%'+_0x299d32+'%');_0xf3e039['or']('c.lastName\x20LIKE\x20?','%'+_0x299d32+'%');_0xf3e039['or']('c.email\x20LIKE\x20?','%'+_0x299d32+'%');}}}}_0x297c08[_0xb3b6('0x3d')](_0xf3e039);_0x297c08[_0xb3b6('0x60')](_0xb3b6('0x61'));var _0x3d2848={'type':db[_0xb3b6('0x62')][_0xb3b6('0x63')][_0xb3b6('0x64')],'raw':!![]};var _0x3cf14e=_0x297c08['clone']()[_0xb3b6('0x33')](_0xb3b6('0x61'));if(_0x44758b[_0xb3b6('0x2f')]){_0x44758b[_0xb3b6('0x2f')][_0xb3b6('0x47')](function(_0x495633){_0x297c08[_0xb3b6('0x2f')]('c.'+_0x495633[0x0],_0x495633[0x1]===_0xb3b6('0x65')?![]:!![]);});}if(!_[_0xb3b6('0x66')](_0x4cb727)){_0x297c08[_0xb3b6('0x67')](_0x386fc3);_0x3cf14e[_0xb3b6('0x3d')](_0xb3b6('0x68'),_0x4cb727);}BPromise[_0xb3b6('0x69')]()['then'](function(){if(!_0x30d810)return;if(_0x481134['user'][_0xb3b6('0x6a')]!=='agent')return;if(!_[_0xb3b6('0x6b')](_0x30d810['conditions'],[_0xb3b6('0x33'),'User'])){return _0x481134[_0xb3b6('0x6c')][_0xb3b6('0x6d')]({'attributes':['id'],'raw':!![]})[_0xb3b6('0x15')](function(_0x23cb54){if(_[_0xb3b6('0x66')](_0x23cb54)){_0x3cf14e[_0xb3b6('0x3d')](_0xb3b6('0x6e'));_0x297c08[_0xb3b6('0x3d')]('c.ListId\x20IS\x20NULL');}else{_0x3cf14e[_0xb3b6('0x3d')](_0xb3b6('0x6f'),_['map'](_0x23cb54,'id'));_0x297c08[_0xb3b6('0x3d')]('c.ListId\x20IN\x20?',_[_0xb3b6('0x51')](_0x23cb54,'id'));}});}})[_0xb3b6('0x15')](function(){if(_0x481134['user'][_0xb3b6('0x6a')]===_0xb3b6('0x70')&&!_0x30d810&&!_0x481134[_0xb3b6('0x2b')][_0xb3b6('0x55')])return[];return db[_0xb3b6('0x71')][_0xb3b6('0x2b')](_0x3cf14e[_0xb3b6('0x72')](),_0x3d2848);})[_0xb3b6('0x15')](function(_0x50412c){_0x2ed840['count']=_0x50412c['length'];if(_0x2ed840[_0xb3b6('0x11')]===0x0)return[];return db[_0xb3b6('0x71')][_0xb3b6('0x2b')](_0x313ea9[_0xb3b6('0x72')](),_0x3d2848)[_0xb3b6('0x15')](function(_0x2c8df8){_0x3a8162=_['keyBy'](_0x2c8df8,'id');_0x3d2848=_[_0xb3b6('0x73')](_0x3d2848,{'model':db[_0xb3b6('0x1d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x481134[_0xb3b6('0x2b')][_0xb3b6('0x2c')]){_0x44758b[_0xb3b6('0x2d')][_0xb3b6('0x47')](function(_0x1740c8){_0x297c08['field']('c.'+_0x1740c8);});}else{_0x297c08[_0xb3b6('0x33')](_0xb3b6('0x61'));_0x297c08[_0xb3b6('0x33')](_0xb3b6('0x74'));_0x297c08['field'](_0xb3b6('0x75'));_0x297c08[_0xb3b6('0x33')](_0xb3b6('0x76'));_0x297c08[_0xb3b6('0x33')](_0xb3b6('0x77'));_0x297c08[_0xb3b6('0x33')](_0xb3b6('0x78'));_0x297c08[_0xb3b6('0x33')](_0xb3b6('0x79'));_0x297c08['field'](_0xb3b6('0x7a'));_0x297c08['field']('c.createdAt');_0x297c08[_0xb3b6('0x33')](_0xb3b6('0x7b'));_0x297c08[_0xb3b6('0x33')](_0xb3b6('0x7c'));_0x297c08['field'](_0xb3b6('0x7d'),_0xb3b6('0x7e'));}if(_0x44758b[_0xb3b6('0x10')])_0x297c08['limit'](_0x44758b[_0xb3b6('0x10')]);if(_0x44758b[_0xb3b6('0xe')])_0x297c08['offset'](_0x44758b[_0xb3b6('0xe')]);return db[_0xb3b6('0x71')][_0xb3b6('0x2b')](_0x297c08['toString'](),_0x3d2848);});})['then'](function(_0x11bf79){_0x11bf79[_0xb3b6('0x47')](function(_0x2d4647){if(_0x2d4647[_0xb3b6('0x7e')]){_0x2d4647[_0xb3b6('0x7f')]=[];_0x2d4647[_0xb3b6('0x7e')][_0xb3b6('0x46')](',')[_0xb3b6('0x47')](function(_0x530345){_0x2d4647[_0xb3b6('0x7f')][_0xb3b6('0x22')](_0x3a8162[_0x530345]);});}delete _0x2d4647[_0xb3b6('0x7e')];});_0x2ed840[_0xb3b6('0x80')]=_0x11bf79;return _0x2ed840;})[_0xb3b6('0x15')](respondWithFilteredResult(_0x47584f,_0x44758b));})[_0xb3b6('0x81')](handleError(_0x47584f,null));};exports[_0xb3b6('0x16')]=function(_0xc8114a,_0x3bc894){return db[_0xb3b6('0x1d')][_0xb3b6('0x82')]({'where':{'id':_0xc8114a[_0xb3b6('0x83')]['id']}})[_0xb3b6('0x15')](handleEntityNotFound(_0x3bc894,null))[_0xb3b6('0x15')](removeEntity(_0x3bc894,null))['catch'](handleError(_0x3bc894,null));};exports[_0xb3b6('0x1e')]=function(_0x1d3d56,_0xddebe6){return db['CmContact'][_0xb3b6('0x1e')]()[_0xb3b6('0x15')](function(_0x3025ff){delete _0x3025ff[_0xb3b6('0x84')];for(var _0x162fe1=0x0;_0x162fe1{}\s\\|]/g,'-');_0x2efa34(null,util[_0x8cd8('0x22')](_0x8cd8('0x23'),path[_0x8cd8('0x24')](_0x51f8db['originalname'],path[_0x8cd8('0x25')](_0x51f8db[_0x8cd8('0x20')])),Date[_0x8cd8('0x26')](),path[_0x8cd8('0x25')](_0x51f8db[_0x8cd8('0x20')])));}})});router['post'](_0x8cd8('0x27'),upload[_0x8cd8('0x28')]('file'),controller['uploadCsv']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3fa82b,_0x554dd9,_0x1a2e60){_0x1a2e60(null,path['join'](config[_0x8cd8('0x1e')],_0x8cd8('0x1f')));},'filename':function(_0x280420,_0x547287,_0x4d31fe){_0x547287[_0x8cd8('0x20')]=_0x547287[_0x8cd8('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4d31fe(null,util[_0x8cd8('0x22')](_0x8cd8('0x23'),path[_0x8cd8('0x24')](_0x547287[_0x8cd8('0x20')],path[_0x8cd8('0x25')](_0x547287[_0x8cd8('0x20')])),Date[_0x8cd8('0x26')](),path['extname'](_0x547287[_0x8cd8('0x20')])));}})});router[_0x8cd8('0x18')](_0x8cd8('0x29'),upload[_0x8cd8('0x28')](_0x8cd8('0x2a')),controller['upload']);router[_0x8cd8('0x18')](_0x8cd8('0x2b'),auth[_0x8cd8('0xb')](),controller[_0x8cd8('0x2c')]);router[_0x8cd8('0x2d')](_0x8cd8('0xe'),auth[_0x8cd8('0xb')](),controller[_0x8cd8('0x2e')]);router[_0x8cd8('0x2f')](_0x8cd8('0xe'),auth[_0x8cd8('0xb')](),controller[_0x8cd8('0x30')]);module['exports']=router; \ No newline at end of file +var _0xec5d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','isAuthenticated','get','/describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/journey','getJourney','post','merge','create','setTags','diskStorage','root','server/files/tmp','originalname','replace','format','%s-%s%s','extname','now','single','file','join','basename','/upload','upload','/upload/:id','import','put','update','delete','multer','util','path','connect-timeout'];(function(_0xc9f8f8,_0x9087c){var _0x12865d=function(_0x27108b){while(--_0x27108b){_0xc9f8f8['push'](_0xc9f8f8['shift']());}};_0x12865d(++_0x9087c);}(_0xec5d,0x1e6));var _0xdec5=function(_0x4c5b52,_0x297a5d){_0x4c5b52=_0x4c5b52-0x0;var _0x284dce=_0xec5d[_0x4c5b52];return _0x284dce;};'use strict';var multer=require(_0xdec5('0x0'));var util=require(_0xdec5('0x1'));var path=require(_0xdec5('0x2'));var timeout=require(_0xdec5('0x3'));var express=require(_0xdec5('0x4'));var router=express[_0xdec5('0x5')]();var fs_extra=require(_0xdec5('0x6'));var auth=require(_0xdec5('0x7'));var interaction=require(_0xdec5('0x8'));var config=require(_0xdec5('0x9'));var controller=require(_0xdec5('0xa'));router['get']('/',auth[_0xdec5('0xb')](),controller['index']);router[_0xdec5('0xc')](_0xdec5('0xd'),auth[_0xdec5('0xb')](),controller['describe']);router['get'](_0xdec5('0xe'),auth[_0xdec5('0xb')](),controller[_0xdec5('0xf')]);router['get'](_0xdec5('0x10'),auth[_0xdec5('0xb')](),controller[_0xdec5('0x11')]);router['get'](_0xdec5('0x12'),auth[_0xdec5('0xb')](),controller[_0xdec5('0x13')]);router[_0xdec5('0xc')](_0xdec5('0x14'),auth[_0xdec5('0xb')](),controller[_0xdec5('0x15')]);router[_0xdec5('0xc')]('/:id/hopper_finals',auth[_0xdec5('0xb')](),controller[_0xdec5('0x16')]);router['get']('/:id/jscripty_sessions',auth[_0xdec5('0xb')](),controller['getJscriptySessions']);router['get'](_0xdec5('0x17'),auth[_0xdec5('0xb')](),controller[_0xdec5('0x18')]);router[_0xdec5('0x19')]('/merge',auth[_0xdec5('0xb')](),controller[_0xdec5('0x1a')]);router[_0xdec5('0x19')]('/',auth[_0xdec5('0xb')](),controller[_0xdec5('0x1b')]);router[_0xdec5('0x19')]('/create_many',auth[_0xdec5('0xb')](),controller['bulkCreate']);router['post'](_0xdec5('0x10'),auth[_0xdec5('0xb')](),controller[_0xdec5('0x1c')]);var upload=multer({'storage':multer[_0xdec5('0x1d')]({'destination':function(_0x2337a7,_0x4d8ced,_0x2a871f){_0x2a871f(null,path['join'](config[_0xdec5('0x1e')],_0xdec5('0x1f')));},'filename':function(_0x1e37ff,_0x432c67,_0x783f1b){_0x432c67[_0xdec5('0x20')]=_0x432c67['originalname'][_0xdec5('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x783f1b(null,util[_0xdec5('0x22')](_0xdec5('0x23'),path['basename'](_0x432c67[_0xdec5('0x20')],path[_0xdec5('0x24')](_0x432c67[_0xdec5('0x20')])),Date[_0xdec5('0x25')](),path[_0xdec5('0x24')](_0x432c67[_0xdec5('0x20')])));}})});router[_0xdec5('0x19')]('/csv',upload[_0xdec5('0x26')](_0xdec5('0x27')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xdec5('0x1d')]({'destination':function(_0x161ea1,_0x286337,_0x3157b9){_0x3157b9(null,path[_0xdec5('0x28')](config['root'],'server/files/tmp'));},'filename':function(_0x31eedf,_0x43772a,_0x2b7991){_0x43772a[_0xdec5('0x20')]=_0x43772a[_0xdec5('0x20')][_0xdec5('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2b7991(null,util[_0xdec5('0x22')](_0xdec5('0x23'),path[_0xdec5('0x29')](_0x43772a[_0xdec5('0x20')],path['extname'](_0x43772a[_0xdec5('0x20')])),Date[_0xdec5('0x25')](),path[_0xdec5('0x24')](_0x43772a[_0xdec5('0x20')])));}})});router['post'](_0xdec5('0x2a'),upload[_0xdec5('0x26')](_0xdec5('0x27')),controller[_0xdec5('0x2b')]);router[_0xdec5('0x19')](_0xdec5('0x2c'),auth[_0xdec5('0xb')](),controller[_0xdec5('0x2d')]);router[_0xdec5('0x2e')](_0xdec5('0xe'),auth[_0xdec5('0xb')](),controller[_0xdec5('0x2f')]);router[_0xdec5('0x30')]('/:id',auth['isAuthenticated'](),controller['destroy']);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 9ed6fe3..73865f9 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 _0x82be=['long','select','parse','values','isArray','BOOLEAN','ENUM','VIRTUAL','getDataValue','alias','STRING','setDataValue','name'];(function(_0x1367ff,_0x25e6fe){var _0xc253e0=function(_0x1a2859){while(--_0x1a2859){_0x1367ff['push'](_0x1367ff['shift']());}};_0xc253e0(++_0x25e6fe);}(_0x82be,0x19a));var _0xe82b=function(_0x15e371,_0x12bf60){_0x15e371=_0x15e371-0x0;var _0x24094a=_0x82be[_0x15e371];return _0x24094a;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xe82b('0x0')],'get':function(_0x40f2e7){return this[_0xe82b('0x1')](_0xe82b('0x2'));}},'alias':{'type':Sequelize[_0xe82b('0x3')],'allowNull':![],'set':function(_0x50f8b1){this[_0xe82b('0x4')](_0xe82b('0x2'),_0x50f8b1?_0x50f8b1:this[_0xe82b('0x1')](_0xe82b('0x5')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xe82b('0x6')),'get':function(){if(this[_0xe82b('0x1')]('type')===_0xe82b('0x7')){return JSON[_0xe82b('0x8')](this[_0xe82b('0x1')](_0xe82b('0x9')));}else{return this[_0xe82b('0x1')](_0xe82b('0x9'));}},'set':function(_0x5aee33){if(Array[_0xe82b('0xa')](_0x5aee33)){this[_0xe82b('0x4')](_0xe82b('0x9'),JSON['stringify'](_0x5aee33));}else{this[_0xe82b('0x4')](_0xe82b('0x9'),_0x5aee33);}}},'required':{'type':Sequelize[_0xe82b('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe82b('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xe82b('0xc')]('voice')}}; \ No newline at end of file +var _0x7d35=['name','TEXT','long','type','select','values','isArray','stringify','BOOLEAN','voice','sequelize','lodash','exports','getDataValue','alias','STRING','setDataValue'];(function(_0x299f67,_0x8a22c8){var _0x27f667=function(_0x29e762){while(--_0x29e762){_0x299f67['push'](_0x299f67['shift']());}};_0x27f667(++_0x8a22c8);}(_0x7d35,0x14d));var _0x57d3=function(_0x4c953c,_0x2edbb8){_0x4c953c=_0x4c953c-0x0;var _0xfa0543=_0x7d35[_0x4c953c];return _0xfa0543;};'use strict';var Sequelize=require(_0x57d3('0x0'));var _=require(_0x57d3('0x1'));module[_0x57d3('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x31ebd6){return this[_0x57d3('0x3')](_0x57d3('0x4'));}},'alias':{'type':Sequelize[_0x57d3('0x5')],'allowNull':![],'set':function(_0x4c7f4e){this[_0x57d3('0x6')](_0x57d3('0x4'),_0x4c7f4e?_0x4c7f4e:this[_0x57d3('0x3')](_0x57d3('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x57d3('0x8')](_0x57d3('0x9')),'get':function(){if(this[_0x57d3('0x3')](_0x57d3('0xa'))===_0x57d3('0xb')){return JSON['parse'](this[_0x57d3('0x3')](_0x57d3('0xc')));}else{return this['getDataValue'](_0x57d3('0xc'));}},'set':function(_0x174caa){if(Array[_0x57d3('0xd')](_0x174caa)){this[_0x57d3('0x6')](_0x57d3('0xc'),JSON[_0x57d3('0xe')](_0x174caa));}else{this[_0x57d3('0x6')](_0x57d3('0xc'),_0x174caa);}}},'required':{'type':Sequelize[_0x57d3('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x57d3('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index d593298..f76b84f 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 _0xcc65=['CmCustomField','rawAttributes','type','model','differenceBy','query','keys','filters','intersection','fields','attributes','order','sort','pick','merge','VIRTUAL','filter','options','where','include','findAll','rows','catch','show','params','includeAll','find','body','create','sequelize','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../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','stack','name','send','map'];(function(_0x5d51b3,_0x4d9069){var _0x1bad57=function(_0x43ec9a){while(--_0x43ec9a){_0x5d51b3['push'](_0x5d51b3['shift']());}};_0x1bad57(++_0x4d9069);}(_0xcc65,0x1e3));var _0x5cc6=function(_0x40d411,_0x4642f1){_0x40d411=_0x40d411-0x0;var _0x51fd22=_0xcc65[_0x40d411];return _0x51fd22;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5cc6('0x0'));var zipdir=require(_0x5cc6('0x1'));var jsonpatch=require(_0x5cc6('0x2'));var rp=require(_0x5cc6('0x3'));var moment=require(_0x5cc6('0x4'));var BPromise=require(_0x5cc6('0x5'));var Mustache=require(_0x5cc6('0x6'));var util=require(_0x5cc6('0x7'));var path=require(_0x5cc6('0x8'));var sox=require(_0x5cc6('0x9'));var csv=require(_0x5cc6('0xa'));var ejs=require(_0x5cc6('0xb'));var fs=require('fs');var fs_extra=require(_0x5cc6('0xc'));var _=require('lodash');var squel=require(_0x5cc6('0xd'));var crypto=require('crypto');var jsforce=require(_0x5cc6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5cc6('0xf'));var Papa=require(_0x5cc6('0x10'));var Redis=require('ioredis');var authService=require(_0x5cc6('0x11'));var qs=require(_0x5cc6('0x12'));var as=require(_0x5cc6('0x13'));var hardwareService=require(_0x5cc6('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5cc6('0x15'));var config=require(_0x5cc6('0x16'));var licenseUtil=require(_0x5cc6('0x17'));var db=require(_0x5cc6('0x18'))['db'];function respondWithStatusCode(_0x6cebf8,_0x179d9f){_0x179d9f=_0x179d9f||0xcc;return function(_0x7697fc){if(_0x7697fc){return _0x6cebf8[_0x5cc6('0x19')](_0x179d9f);}return _0x6cebf8[_0x5cc6('0x1a')](_0x179d9f)[_0x5cc6('0x1b')]();};}function respondWithResult(_0x148142,_0x2c642c){_0x2c642c=_0x2c642c||0xc8;return function(_0x26aa26){if(_0x26aa26){return _0x148142[_0x5cc6('0x1a')](_0x2c642c)[_0x5cc6('0x1c')](_0x26aa26);}};}function respondWithFilteredResult(_0x4a43f3,_0x5eb3ec){return function(_0x4c50ba){if(_0x4c50ba){var _0x16ca41=typeof _0x5eb3ec[_0x5cc6('0x1d')]==='undefined'&&typeof _0x5eb3ec[_0x5cc6('0x1e')]===_0x5cc6('0x1f');var _0x5f2cb7=_0x4c50ba[_0x5cc6('0x20')];var _0x3ae317=_0x16ca41?0x0:_0x5eb3ec[_0x5cc6('0x1d')];var _0x2ef292=_0x16ca41?_0x4c50ba[_0x5cc6('0x20')]:_0x5eb3ec[_0x5cc6('0x1d')]+_0x5eb3ec[_0x5cc6('0x1e')];var _0x437032;if(_0x2ef292>=_0x5f2cb7){_0x2ef292=_0x5f2cb7;_0x437032=0xc8;}else{_0x437032=0xce;}_0x4a43f3['status'](_0x437032);return _0x4a43f3[_0x5cc6('0x21')](_0x5cc6('0x22'),_0x3ae317+'-'+_0x2ef292+'/'+_0x5f2cb7)[_0x5cc6('0x1c')](_0x4c50ba);}return null;};}function patchUpdates(_0x5ea31c){return function(_0x5e09a4){try{jsonpatch[_0x5cc6('0x23')](_0x5e09a4,_0x5ea31c,!![]);}catch(_0x50a440){return BPromise[_0x5cc6('0x24')](_0x50a440);}return _0x5e09a4[_0x5cc6('0x25')]();};}function saveUpdates(_0x4cfbc7,_0x5cdbab){return function(_0x5aaea9){if(_0x5aaea9){return _0x5aaea9[_0x5cc6('0x26')](_0x4cfbc7)[_0x5cc6('0x27')](function(_0x455a69){return _0x455a69;});}return null;};}function removeEntity(_0x18b1d3,_0x16a3ac){return function(_0x2b4d77){if(_0x2b4d77){return _0x2b4d77[_0x5cc6('0x28')]()[_0x5cc6('0x27')](function(){_0x18b1d3[_0x5cc6('0x1a')](0xcc)[_0x5cc6('0x1b')]();});}};}function handleEntityNotFound(_0x525b55,_0x4bfef1){return function(_0x287a37){if(!_0x287a37){_0x525b55['sendStatus'](0x194);}return _0x287a37;};}function handleError(_0x261326,_0x179dc9){_0x179dc9=_0x179dc9||0x1f4;return function(_0x45dd0b){logger['error'](_0x45dd0b[_0x5cc6('0x29')]);if(_0x45dd0b[_0x5cc6('0x2a')]){delete _0x45dd0b[_0x5cc6('0x2a')];}_0x261326[_0x5cc6('0x1a')](_0x179dc9)[_0x5cc6('0x2b')](_0x45dd0b);};}exports['index']=function(_0x81f73b,_0x2772ca){var _0x586632={},_0x2f760a={},_0x17e3d2={'count':0x0,'rows':[]};var _0x803dc3=_[_0x5cc6('0x2c')](db[_0x5cc6('0x2d')][_0x5cc6('0x2e')],function(_0x294d21){return{'name':_0x294d21['fieldName'],'type':_0x294d21[_0x5cc6('0x2f')]['key']};});_0x2f760a[_0x5cc6('0x30')]=_[_0x5cc6('0x31')](_[_0x5cc6('0x2c')](_0x803dc3,'name'),['name']);_0x2f760a[_0x5cc6('0x32')]=_[_0x5cc6('0x33')](_0x81f73b[_0x5cc6('0x32')]);_0x2f760a[_0x5cc6('0x34')]=_[_0x5cc6('0x35')](_0x2f760a[_0x5cc6('0x30')],_0x2f760a['query']);_0x586632['attributes']=_[_0x5cc6('0x35')](_0x2f760a[_0x5cc6('0x30')],qs[_0x5cc6('0x36')](_0x81f73b[_0x5cc6('0x32')]['fields']));_0x586632['attributes']=_0x586632[_0x5cc6('0x37')]['length']?_0x586632[_0x5cc6('0x37')]:_0x2f760a[_0x5cc6('0x30')];if(!_0x81f73b[_0x5cc6('0x32')]['hasOwnProperty']('nolimit')){_0x586632[_0x5cc6('0x1e')]=qs[_0x5cc6('0x1e')](_0x81f73b[_0x5cc6('0x32')][_0x5cc6('0x1e')]);_0x586632[_0x5cc6('0x1d')]=qs[_0x5cc6('0x1d')](_0x81f73b[_0x5cc6('0x32')][_0x5cc6('0x1d')]);}_0x586632[_0x5cc6('0x38')]=qs[_0x5cc6('0x39')](_0x81f73b[_0x5cc6('0x32')][_0x5cc6('0x39')]);_0x586632['where']=qs[_0x5cc6('0x34')](_[_0x5cc6('0x3a')](_0x81f73b[_0x5cc6('0x32')],_0x2f760a[_0x5cc6('0x34')]),_0x803dc3);if(_0x81f73b['query']['filter']){_0x586632['where']=_[_0x5cc6('0x3b')](_0x586632['where'],{'$or':_[_0x5cc6('0x2c')](_0x803dc3,function(_0x3c9ee4){if(_0x3c9ee4[_0x5cc6('0x2f')]!==_0x5cc6('0x3c')){var _0x51bad0={};_0x51bad0[_0x3c9ee4[_0x5cc6('0x2a')]]={'$like':'%'+_0x81f73b[_0x5cc6('0x32')][_0x5cc6('0x3d')]+'%'};return _0x51bad0;}})});}_0x586632=_[_0x5cc6('0x3b')]({},_0x586632,_0x81f73b[_0x5cc6('0x3e')]);var _0x17674d={'where':_0x586632[_0x5cc6('0x3f')]};return db[_0x5cc6('0x2d')][_0x5cc6('0x20')](_0x17674d)[_0x5cc6('0x27')](function(_0x1b2474){_0x17e3d2[_0x5cc6('0x20')]=_0x1b2474;if(_0x81f73b['query']['includeAll']){_0x586632[_0x5cc6('0x40')]=[{'all':!![]}];}return db['CmCustomField'][_0x5cc6('0x41')](_0x586632);})[_0x5cc6('0x27')](function(_0x124118){_0x17e3d2[_0x5cc6('0x42')]=_0x124118;return _0x17e3d2;})[_0x5cc6('0x27')](respondWithFilteredResult(_0x2772ca,_0x586632))[_0x5cc6('0x43')](handleError(_0x2772ca,null));};exports[_0x5cc6('0x44')]=function(_0x4e7757,_0x308b81){var _0xec37b5={'raw':!![],'where':{'id':_0x4e7757[_0x5cc6('0x45')]['id']}},_0x18dabe={};_0x18dabe[_0x5cc6('0x30')]=_[_0x5cc6('0x33')](db[_0x5cc6('0x2d')]['rawAttributes']);_0x18dabe[_0x5cc6('0x32')]=_['keys'](_0x4e7757['query']);_0x18dabe[_0x5cc6('0x34')]=_[_0x5cc6('0x35')](_0x18dabe['model'],_0x18dabe[_0x5cc6('0x32')]);_0xec37b5[_0x5cc6('0x37')]=_[_0x5cc6('0x35')](_0x18dabe[_0x5cc6('0x30')],qs[_0x5cc6('0x36')](_0x4e7757[_0x5cc6('0x32')][_0x5cc6('0x36')]));_0xec37b5[_0x5cc6('0x37')]=_0xec37b5['attributes']['length']?_0xec37b5[_0x5cc6('0x37')]:_0x18dabe[_0x5cc6('0x30')];if(_0x4e7757[_0x5cc6('0x32')][_0x5cc6('0x46')]){_0xec37b5['include']=[{'all':!![]}];}_0xec37b5=_[_0x5cc6('0x3b')]({},_0xec37b5,_0x4e7757['options']);return db[_0x5cc6('0x2d')][_0x5cc6('0x47')](_0xec37b5)[_0x5cc6('0x27')](handleEntityNotFound(_0x308b81,null))['then'](respondWithResult(_0x308b81,null))['catch'](handleError(_0x308b81,null));};exports[_0x5cc6('0x26')]=function(_0x38fc28,_0x5f7046){if(_0x38fc28[_0x5cc6('0x48')]['id']){delete _0x38fc28[_0x5cc6('0x48')]['id'];}return db[_0x5cc6('0x2d')]['find']({'where':{'id':_0x38fc28[_0x5cc6('0x45')]['id']}})[_0x5cc6('0x27')](handleEntityNotFound(_0x5f7046,null))[_0x5cc6('0x27')](saveUpdates(_0x38fc28[_0x5cc6('0x48')],null))[_0x5cc6('0x27')](respondWithResult(_0x5f7046,null))[_0x5cc6('0x43')](handleError(_0x5f7046,null));};exports['destroy']=function(_0x80f271,_0x4de24f){return db[_0x5cc6('0x2d')][_0x5cc6('0x47')]({'where':{'id':_0x80f271[_0x5cc6('0x45')]['id']}})[_0x5cc6('0x27')](handleEntityNotFound(_0x4de24f,null))[_0x5cc6('0x27')](removeEntity(_0x4de24f,null))[_0x5cc6('0x43')](handleError(_0x4de24f,null));};exports[_0x5cc6('0x49')]=function(_0x2639c2,_0x330ac9){var _0x524706;return db[_0x5cc6('0x4a')][_0x5cc6('0x4b')](function(_0x2ecfb1){return db[_0x5cc6('0x2d')][_0x5cc6('0x49')](_0x2639c2['body'],{'transaction':_0x2ecfb1})[_0x5cc6('0x27')](function(_0x4b6021){_0x524706=_0x4b6021;var _0xb50199={'type':db[_0x5cc6('0x4c')]['TEXT'],'transaction':_0x2ecfb1};switch(_0x2639c2[_0x5cc6('0x48')]['type']){case'text':_0xb50199['type']=db[_0x5cc6('0x4c')][_0x5cc6('0x4d')];break;case _0x5cc6('0x4e'):_0xb50199[_0x5cc6('0x2f')]=db['Sequelize'][_0x5cc6('0x4f')];break;case _0x5cc6('0x50'):_0xb50199[_0x5cc6('0x2f')]=db[_0x5cc6('0x4c')][_0x5cc6('0x51')];_0xb50199[_0x5cc6('0x52')]=![];break;default:}return db['sequelize'][_0x5cc6('0x53')][_0x5cc6('0x54')](_0x5cc6('0x55'),util[_0x5cc6('0x56')](_0x5cc6('0x57'),_0x524706['id']),_0xb50199);})['then'](function(){return _0x524706;});})[_0x5cc6('0x27')](respondWithResult(_0x330ac9,0xc9))[_0x5cc6('0x43')](handleError(_0x330ac9,null));}; \ No newline at end of file +var _0xf123=['squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','key','model','differenceBy','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','catch','params','include','update','body','find','transaction','create','Sequelize','TEXT','number','INTEGER','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%d','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash'];(function(_0x2fc4db,_0x34003f){var _0x1f8e51=function(_0x153a4f){while(--_0x153a4f){_0x2fc4db['push'](_0x2fc4db['shift']());}};_0x1f8e51(++_0x34003f);}(_0xf123,0x1aa));var _0x3f12=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0xf123[_0x1a3e23];return _0x5ee0d8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3f12('0x0'));var rp=require(_0x3f12('0x1'));var moment=require(_0x3f12('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3f12('0x3'));var path=require(_0x3f12('0x4'));var sox=require(_0x3f12('0x5'));var csv=require('to-csv');var ejs=require(_0x3f12('0x6'));var fs=require('fs');var fs_extra=require(_0x3f12('0x7'));var _=require(_0x3f12('0x8'));var squel=require(_0x3f12('0x9'));var crypto=require(_0x3f12('0xa'));var jsforce=require(_0x3f12('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3f12('0xc'));var querystring=require(_0x3f12('0xd'));var Papa=require(_0x3f12('0xe'));var Redis=require(_0x3f12('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3f12('0x10'));var as=require(_0x3f12('0x11'));var hardwareService=require(_0x3f12('0x12'));var logger=require(_0x3f12('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3f12('0x14'));var licenseUtil=require(_0x3f12('0x15'));var db=require(_0x3f12('0x16'))['db'];function respondWithStatusCode(_0x16ce4a,_0xf10879){_0xf10879=_0xf10879||0xcc;return function(_0x1cde6b){if(_0x1cde6b){return _0x16ce4a['sendStatus'](_0xf10879);}return _0x16ce4a['status'](_0xf10879)[_0x3f12('0x17')]();};}function respondWithResult(_0x3bf1f2,_0x325122){_0x325122=_0x325122||0xc8;return function(_0x5ca74e){if(_0x5ca74e){return _0x3bf1f2[_0x3f12('0x18')](_0x325122)['json'](_0x5ca74e);}};}function respondWithFilteredResult(_0x2513d1,_0x31a0de){return function(_0x13b56e){if(_0x13b56e){var _0x36e31a=typeof _0x31a0de[_0x3f12('0x19')]===_0x3f12('0x1a')&&typeof _0x31a0de['limit']==='undefined';var _0x3b1c90=_0x13b56e[_0x3f12('0x1b')];var _0x1ca537=_0x36e31a?0x0:_0x31a0de['offset'];var _0x4c7f8a=_0x36e31a?_0x13b56e[_0x3f12('0x1b')]:_0x31a0de[_0x3f12('0x19')]+_0x31a0de[_0x3f12('0x1c')];var _0x286c49;if(_0x4c7f8a>=_0x3b1c90){_0x4c7f8a=_0x3b1c90;_0x286c49=0xc8;}else{_0x286c49=0xce;}_0x2513d1[_0x3f12('0x18')](_0x286c49);return _0x2513d1[_0x3f12('0x1d')](_0x3f12('0x1e'),_0x1ca537+'-'+_0x4c7f8a+'/'+_0x3b1c90)[_0x3f12('0x1f')](_0x13b56e);}return null;};}function patchUpdates(_0x1422d4){return function(_0x1759a9){try{jsonpatch[_0x3f12('0x20')](_0x1759a9,_0x1422d4,!![]);}catch(_0x11de66){return BPromise[_0x3f12('0x21')](_0x11de66);}return _0x1759a9[_0x3f12('0x22')]();};}function saveUpdates(_0x315cf9,_0x235269){return function(_0x27f710){if(_0x27f710){return _0x27f710['update'](_0x315cf9)[_0x3f12('0x23')](function(_0x3d50e3){return _0x3d50e3;});}return null;};}function removeEntity(_0x43cef4,_0x1ce0fc){return function(_0x5ed4f3){if(_0x5ed4f3){return _0x5ed4f3[_0x3f12('0x24')]()[_0x3f12('0x23')](function(){_0x43cef4['status'](0xcc)[_0x3f12('0x17')]();});}};}function handleEntityNotFound(_0x1fb0e9,_0x50b228){return function(_0x3350fb){if(!_0x3350fb){_0x1fb0e9[_0x3f12('0x25')](0x194);}return _0x3350fb;};}function handleError(_0x480174,_0x3dfd94){_0x3dfd94=_0x3dfd94||0x1f4;return function(_0x4aff22){logger['error'](_0x4aff22[_0x3f12('0x26')]);if(_0x4aff22[_0x3f12('0x27')]){delete _0x4aff22[_0x3f12('0x27')];}_0x480174[_0x3f12('0x18')](_0x3dfd94)[_0x3f12('0x28')](_0x4aff22);};}exports[_0x3f12('0x29')]=function(_0x382b72,_0xf916cb){var _0x26780d={},_0x5e5ad0={},_0x2bf64e={'count':0x0,'rows':[]};var _0x409338=_[_0x3f12('0x2a')](db[_0x3f12('0x2b')][_0x3f12('0x2c')],function(_0x57c353){return{'name':_0x57c353[_0x3f12('0x2d')],'type':_0x57c353['type'][_0x3f12('0x2e')]};});_0x5e5ad0[_0x3f12('0x2f')]=_[_0x3f12('0x30')](_[_0x3f12('0x2a')](_0x409338,_0x3f12('0x27')),[_0x3f12('0x27')]);_0x5e5ad0[_0x3f12('0x31')]=_[_0x3f12('0x32')](_0x382b72[_0x3f12('0x31')]);_0x5e5ad0['filters']=_[_0x3f12('0x33')](_0x5e5ad0[_0x3f12('0x2f')],_0x5e5ad0[_0x3f12('0x31')]);_0x26780d['attributes']=_[_0x3f12('0x33')](_0x5e5ad0[_0x3f12('0x2f')],qs[_0x3f12('0x34')](_0x382b72['query'][_0x3f12('0x34')]));_0x26780d['attributes']=_0x26780d[_0x3f12('0x35')][_0x3f12('0x36')]?_0x26780d['attributes']:_0x5e5ad0[_0x3f12('0x2f')];if(!_0x382b72[_0x3f12('0x31')][_0x3f12('0x37')](_0x3f12('0x38'))){_0x26780d[_0x3f12('0x1c')]=qs['limit'](_0x382b72[_0x3f12('0x31')][_0x3f12('0x1c')]);_0x26780d[_0x3f12('0x19')]=qs[_0x3f12('0x19')](_0x382b72[_0x3f12('0x31')][_0x3f12('0x19')]);}_0x26780d['order']=qs['sort'](_0x382b72['query'][_0x3f12('0x39')]);_0x26780d['where']=qs[_0x3f12('0x3a')](_[_0x3f12('0x3b')](_0x382b72[_0x3f12('0x31')],_0x5e5ad0[_0x3f12('0x3a')]),_0x409338);if(_0x382b72[_0x3f12('0x31')][_0x3f12('0x3c')]){_0x26780d[_0x3f12('0x3d')]=_[_0x3f12('0x3e')](_0x26780d['where'],{'$or':_['map'](_0x409338,function(_0x5cf34e){if(_0x5cf34e[_0x3f12('0x3f')]!==_0x3f12('0x40')){var _0x4eee8a={};_0x4eee8a[_0x5cf34e['name']]={'$like':'%'+_0x382b72[_0x3f12('0x31')][_0x3f12('0x3c')]+'%'};return _0x4eee8a;}})});}_0x26780d=_[_0x3f12('0x3e')]({},_0x26780d,_0x382b72[_0x3f12('0x41')]);var _0x28d28d={'where':_0x26780d[_0x3f12('0x3d')]};return db['CmCustomField']['count'](_0x28d28d)[_0x3f12('0x23')](function(_0x48f708){_0x2bf64e[_0x3f12('0x1b')]=_0x48f708;if(_0x382b72[_0x3f12('0x31')][_0x3f12('0x42')]){_0x26780d['include']=[{'all':!![]}];}return db[_0x3f12('0x2b')][_0x3f12('0x43')](_0x26780d);})[_0x3f12('0x23')](function(_0x395e4d){_0x2bf64e['rows']=_0x395e4d;return _0x2bf64e;})['then'](respondWithFilteredResult(_0xf916cb,_0x26780d))[_0x3f12('0x44')](handleError(_0xf916cb,null));};exports['show']=function(_0x5384c9,_0x4ea82e){var _0x75c3a7={'raw':!![],'where':{'id':_0x5384c9[_0x3f12('0x45')]['id']}},_0xbb82a1={};_0xbb82a1[_0x3f12('0x2f')]=_[_0x3f12('0x32')](db[_0x3f12('0x2b')][_0x3f12('0x2c')]);_0xbb82a1[_0x3f12('0x31')]=_[_0x3f12('0x32')](_0x5384c9[_0x3f12('0x31')]);_0xbb82a1[_0x3f12('0x3a')]=_[_0x3f12('0x33')](_0xbb82a1[_0x3f12('0x2f')],_0xbb82a1['query']);_0x75c3a7['attributes']=_['intersection'](_0xbb82a1[_0x3f12('0x2f')],qs['fields'](_0x5384c9[_0x3f12('0x31')]['fields']));_0x75c3a7['attributes']=_0x75c3a7[_0x3f12('0x35')]['length']?_0x75c3a7[_0x3f12('0x35')]:_0xbb82a1[_0x3f12('0x2f')];if(_0x5384c9[_0x3f12('0x31')][_0x3f12('0x42')]){_0x75c3a7[_0x3f12('0x46')]=[{'all':!![]}];}_0x75c3a7=_['merge']({},_0x75c3a7,_0x5384c9['options']);return db[_0x3f12('0x2b')]['find'](_0x75c3a7)[_0x3f12('0x23')](handleEntityNotFound(_0x4ea82e,null))[_0x3f12('0x23')](respondWithResult(_0x4ea82e,null))['catch'](handleError(_0x4ea82e,null));};exports[_0x3f12('0x47')]=function(_0x2cc597,_0x2eebfe){if(_0x2cc597[_0x3f12('0x48')]['id']){delete _0x2cc597[_0x3f12('0x48')]['id'];}return db[_0x3f12('0x2b')][_0x3f12('0x49')]({'where':{'id':_0x2cc597[_0x3f12('0x45')]['id']}})[_0x3f12('0x23')](handleEntityNotFound(_0x2eebfe,null))[_0x3f12('0x23')](saveUpdates(_0x2cc597['body'],null))[_0x3f12('0x23')](respondWithResult(_0x2eebfe,null))[_0x3f12('0x44')](handleError(_0x2eebfe,null));};exports['destroy']=function(_0x4b3f93,_0x33ac42){return db[_0x3f12('0x2b')]['find']({'where':{'id':_0x4b3f93[_0x3f12('0x45')]['id']}})[_0x3f12('0x23')](handleEntityNotFound(_0x33ac42,null))[_0x3f12('0x23')](removeEntity(_0x33ac42,null))[_0x3f12('0x44')](handleError(_0x33ac42,null));};exports['create']=function(_0x46bad7,_0xfcd8a9){var _0x5b4e37;return db['sequelize'][_0x3f12('0x4a')](function(_0x2c0e2a){return db['CmCustomField'][_0x3f12('0x4b')](_0x46bad7[_0x3f12('0x48')],{'transaction':_0x2c0e2a})['then'](function(_0x55286a){_0x5b4e37=_0x55286a;var _0x1ad68d={'type':db[_0x3f12('0x4c')][_0x3f12('0x4d')],'transaction':_0x2c0e2a};switch(_0x46bad7[_0x3f12('0x48')][_0x3f12('0x3f')]){case'text':_0x1ad68d[_0x3f12('0x3f')]=db['Sequelize'][_0x3f12('0x4d')];break;case _0x3f12('0x4e'):_0x1ad68d['type']=db['Sequelize'][_0x3f12('0x4f')];break;case _0x3f12('0x50'):_0x1ad68d[_0x3f12('0x3f')]=db[_0x3f12('0x4c')]['BOOLEAN'];_0x1ad68d[_0x3f12('0x51')]=![];break;default:}return db[_0x3f12('0x52')][_0x3f12('0x53')][_0x3f12('0x54')](_0x3f12('0x55'),util['format'](_0x3f12('0x56'),_0x5b4e37['id']),_0x1ad68d);})[_0x3f12('0x23')](function(){return _0x5b4e37;});})[_0x3f12('0x23')](respondWithResult(_0xfcd8a9,0xc9))['catch'](handleError(_0xfcd8a9,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 21be341..f491dac 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 _0xa4e5=['rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','lodash','util','../../config/logger','moment','path'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa4e5,0x10e));var _0x5a4e=function(_0x4995f7,_0x37f1c8){_0x4995f7=_0x4995f7-0x0;var _0x100c7e=_0xa4e5[_0x4995f7];return _0x100c7e;};'use strict';var _=require(_0x5a4e('0x0'));var util=require(_0x5a4e('0x1'));var logger=require(_0x5a4e('0x2'))('api');var moment=require(_0x5a4e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a4e('0x4'));var rimraf=require(_0x5a4e('0x5'));var config=require(_0x5a4e('0x6'));var attributes=require(_0x5a4e('0x7'));module[_0x5a4e('0x8')]=function(_0x5be385,_0x159e63){return _0x5be385[_0x5a4e('0x9')](_0x5a4e('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0242=['request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','define','cm_custom_fields','util','../../config/logger','moment','bluebird'];(function(_0x3efbdc,_0x39e2fa){var _0x4b28c7=function(_0x5cf38e){while(--_0x5cf38e){_0x3efbdc['push'](_0x3efbdc['shift']());}};_0x4b28c7(++_0x39e2fa);}(_0x0242,0x96));var _0x2024=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0x0242[_0x12b683];return _0xfb150b;};'use strict';var _=require('lodash');var util=require(_0x2024('0x0'));var logger=require(_0x2024('0x1'))('api');var moment=require(_0x2024('0x2'));var BPromise=require(_0x2024('0x3'));var rp=require(_0x2024('0x4'));var fs=require('fs');var path=require(_0x2024('0x5'));var rimraf=require(_0x2024('0x6'));var config=require(_0x2024('0x7'));var attributes=require(_0x2024('0x8'));module['exports']=function(_0x1bc6b5,_0x3ad4d2){return _0x1bc6b5[_0x2024('0x9')]('CmCustomField',attributes,{'tableName':_0x2024('0xa'),'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 9b2ed9a..b3d8a8d 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 _0x6820=['request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','CmCustomField,\x20%s,\x20%s'];(function(_0x46210c,_0x148f24){var _0x8f7d9a=function(_0x250fb9){while(--_0x250fb9){_0x46210c['push'](_0x46210c['shift']());}};_0x8f7d9a(++_0x148f24);}(_0x6820,0x184));var _0x0682=function(_0x52c100,_0x5853dc){_0x52c100=_0x52c100-0x0;var _0x8f3c80=_0x6820[_0x52c100];return _0x8f3c80;};'use strict';var _=require('lodash');var util=require(_0x0682('0x0'));var moment=require(_0x0682('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0682('0x2'));var db=require(_0x0682('0x3'))['db'];var utils=require(_0x0682('0x4'));var logger=require('../../config/logger')(_0x0682('0x5'));var config=require(_0x0682('0x6'));var jayson=require(_0x0682('0x7'));var client=jayson['client'][_0x0682('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20558d,_0x46b564,_0x470b32){return new BPromise(function(_0x588aa4,_0xa7a705){return client['request'](_0x20558d,_0x470b32)[_0x0682('0x9')](function(_0x5980bb){logger['info'](_0x0682('0xa'),_0x46b564,_0x0682('0xb'));logger['debug'](_0x0682('0xc'),_0x46b564,'request\x20sent',JSON['stringify'](_0x5980bb));if(_0x5980bb[_0x0682('0xd')]){if(_0x5980bb['error'][_0x0682('0xe')]===0x1f4){logger['error'](_0x0682('0xa'),_0x46b564,_0x5980bb[_0x0682('0xd')][_0x0682('0xf')]);return _0xa7a705(_0x5980bb[_0x0682('0xd')][_0x0682('0xf')]);}logger[_0x0682('0xd')](_0x0682('0xa'),_0x46b564,_0x5980bb[_0x0682('0xd')][_0x0682('0xf')]);return _0x588aa4(_0x5980bb[_0x0682('0xd')][_0x0682('0xf')]);}else{logger[_0x0682('0x10')](_0x0682('0xa'),_0x46b564,'request\x20sent');_0x588aa4(_0x5980bb[_0x0682('0x11')][_0x0682('0xf')]);}})[_0x0682('0x12')](function(_0x2feb74){logger[_0x0682('0xd')]('CmCustomField,\x20%s,\x20%s',_0x46b564,_0x2feb74);_0xa7a705(_0x2feb74);});});} \ No newline at end of file +var _0x32c0=['CmCustomField,\x20%s,\x20%s','result','catch','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x387022,_0x30888c){var _0x414c5c=function(_0xbd6f1d){while(--_0xbd6f1d){_0x387022['push'](_0x387022['shift']());}};_0x414c5c(++_0x30888c);}(_0x32c0,0x1bb));var _0x032c=function(_0xae8224,_0x5add83){_0xae8224=_0xae8224-0x0;var _0x49dc36=_0x32c0[_0xae8224];return _0x49dc36;};'use strict';var _=require('lodash');var util=require(_0x032c('0x0'));var moment=require(_0x032c('0x1'));var BPromise=require(_0x032c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x032c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x032c('0x4'))('rpc');var config=require(_0x032c('0x5'));var jayson=require(_0x032c('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a7eb6,_0x356705,_0x53507b){return new BPromise(function(_0x3c4cd2,_0x3e2bd7){return client[_0x032c('0x7')](_0x3a7eb6,_0x53507b)[_0x032c('0x8')](function(_0x218310){logger[_0x032c('0x9')]('CmCustomField,\x20%s,\x20%s',_0x356705,_0x032c('0xa'));logger[_0x032c('0xb')](_0x032c('0xc'),_0x356705,'request\x20sent',JSON[_0x032c('0xd')](_0x218310));if(_0x218310['error']){if(_0x218310[_0x032c('0xe')][_0x032c('0xf')]===0x1f4){logger[_0x032c('0xe')]('CmCustomField,\x20%s,\x20%s',_0x356705,_0x218310[_0x032c('0xe')][_0x032c('0x10')]);return _0x3e2bd7(_0x218310[_0x032c('0xe')][_0x032c('0x10')]);}logger['error'](_0x032c('0x11'),_0x356705,_0x218310[_0x032c('0xe')][_0x032c('0x10')]);return _0x3c4cd2(_0x218310[_0x032c('0xe')][_0x032c('0x10')]);}else{logger[_0x032c('0x9')](_0x032c('0x11'),_0x356705,_0x032c('0xa'));_0x3c4cd2(_0x218310[_0x032c('0x12')][_0x032c('0x10')]);}})[_0x032c('0x13')](function(_0x38975f){logger[_0x032c('0xe')](_0x032c('0x11'),_0x356705,_0x38975f);_0x3e2bd7(_0x38975f);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 0d84e60..bb82ac1 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 _0x6aa7=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','post','create','update','delete'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6aa7,0x178));var _0x76aa=function(_0x298625,_0x5e4d78){_0x298625=_0x298625-0x0;var _0x2a6226=_0x6aa7[_0x298625];return _0x2a6226;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0xb')]('/',auth[_0x76aa('0x8')](),controller[_0x76aa('0xc')]);router['put'](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0xe')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);module[_0x76aa('0x10')]=router; \ No newline at end of file +var _0x815b=['multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./cmCustomField.controller','get','index','isAuthenticated','create','put','/:id','update','delete','destroy','exports'];(function(_0x4d7423,_0x40246a){var _0x131ad0=function(_0x4552c7){while(--_0x4552c7){_0x4d7423['push'](_0x4d7423['shift']());}};_0x131ad0(++_0x40246a);}(_0x815b,0xb4));var _0xb815=function(_0xa302cd,_0x26aba9){_0xa302cd=_0xa302cd-0x0;var _0x42d157=_0x815b[_0xa302cd];return _0x42d157;};'use strict';var multer=require(_0xb815('0x0'));var util=require(_0xb815('0x1'));var path=require(_0xb815('0x2'));var timeout=require(_0xb815('0x3'));var express=require(_0xb815('0x4'));var router=express['Router']();var fs_extra=require(_0xb815('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb815('0x6'));var controller=require(_0xb815('0x7'));router[_0xb815('0x8')]('/',auth['isAuthenticated'](),controller[_0xb815('0x9')]);router[_0xb815('0x8')]('/:id',auth[_0xb815('0xa')](),controller['show']);router['post']('/',auth[_0xb815('0xa')](),controller[_0xb815('0xb')]);router[_0xb815('0xc')](_0xb815('0xd'),auth[_0xb815('0xa')](),controller[_0xb815('0xe')]);router[_0xb815('0xf')](_0xb815('0xd'),auth['isAuthenticated'](),controller[_0xb815('0x10')]);module[_0xb815('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 8770c5d..597aa02 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 _0xea40=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE'];(function(_0x1c46b5,_0x4ab70b){var _0x5b75bd=function(_0x1acc34){while(--_0x1acc34){_0x1c46b5['push'](_0x1c46b5['shift']());}};_0x5b75bd(++_0x4ab70b);}(_0xea40,0x158));var _0x0ea4=function(_0x101647,_0x4dbe8f){_0x101647=_0x101647-0x0;var _0x55fc55=_0xea40[_0x101647];return _0x55fc55;};'use strict';var moment=require(_0x0ea4('0x0'));var Sequelize=require(_0x0ea4('0x1'));module[_0x0ea4('0x2')]={'phone':{'type':Sequelize[_0x0ea4('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x0ea4('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x0ea4('0x5')],'defaultValue':moment()['format'](_0x0ea4('0x6'))},'countbusyretry':{'type':Sequelize[_0x0ea4('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0ea4('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x0ea4('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0ea4('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0ea4('0x5')]},'priority':{'type':Sequelize[_0x0ea4('0x7')](0x2)[_0x0ea4('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x0ea4('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x0ea4('0x7')],'unique':_0x0ea4('0x9')},'ListId':{'type':Sequelize[_0x0ea4('0x7')],'unique':_0x0ea4('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x0ea4('0x7')],'unique':_0x0ea4('0x9')},'CampaignId':{'type':Sequelize[_0x0ea4('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x0ea4('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0ea4('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0ea4('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0ea4('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0ea4('0x7')],'defaultValue':0x0},'recallmeNotifiedDate':{'type':Sequelize[_0x0ea4('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x8b3a=['contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED'];(function(_0x3108d9,_0xf08d6){var _0x1455e6=function(_0xfd5906){while(--_0xfd5906){_0x3108d9['push'](_0x3108d9['shift']());}};_0x1455e6(++_0xf08d6);}(_0x8b3a,0x1af));var _0xa8b3=function(_0x1ffd67,_0x1c18ba){_0x1ffd67=_0x1ffd67-0x0;var _0xce170f=_0x8b3a[_0x1ffd67];return _0xce170f;};'use strict';var moment=require(_0xa8b3('0x0'));var Sequelize=require(_0xa8b3('0x1'));module['exports']={'phone':{'type':Sequelize[_0xa8b3('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xa8b3('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa8b3('0x4')],'defaultValue':moment()[_0xa8b3('0x5')](_0xa8b3('0x6'))},'countbusyretry':{'type':Sequelize[_0xa8b3('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa8b3('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa8b3('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xa8b3('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa8b3('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xa8b3('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa8b3('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa8b3('0x7')],'unique':_0xa8b3('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xa8b3('0x9')},'UserId':{'type':Sequelize[_0xa8b3('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa8b3('0x9')},'CampaignId':{'type':Sequelize[_0xa8b3('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xa8b3('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa8b3('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa8b3('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa8b3('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa8b3('0x7')],'defaultValue':0x0},'recallmeNotifiedDate':{'type':Sequelize[_0xa8b3('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 3e0ca45..ba68535 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 _0xbda1=['limit','count','set','Content-Range','reject','save','destroy','then','end','sendStatus','error','stack','index','map','CmHopper','rawAttributes','fieldName','type','name','query','keys','filters','model','concat','$and','$or','$gte','$lte','$not','$between','$in','$like','$notLike','$overlap','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','catch','create','body','update','describe','find','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','literal','DESC','findOne','scheduledat','recallme','UPDATE','Contact','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','outbound','CmList','getOpenContacts','isNumber','entity\x20not\x20found','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined'];(function(_0x37f00d,_0x5bbe7a){var _0x1b96b0=function(_0x911058){while(--_0x911058){_0x37f00d['push'](_0x37f00d['shift']());}};_0x1b96b0(++_0x5bbe7a);}(_0xbda1,0x10d));var _0x1bda=function(_0x5efaf2,_0x44d191){_0x5efaf2=_0x5efaf2-0x0;var _0x220260=_0xbda1[_0x5efaf2];return _0x220260;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1bda('0x0'));var zipdir=require(_0x1bda('0x1'));var jsonpatch=require(_0x1bda('0x2'));var rp=require(_0x1bda('0x3'));var moment=require(_0x1bda('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1bda('0x5'));var util=require(_0x1bda('0x6'));var path=require(_0x1bda('0x7'));var sox=require('sox');var csv=require(_0x1bda('0x8'));var ejs=require(_0x1bda('0x9'));var fs=require('fs');var fs_extra=require(_0x1bda('0xa'));var _=require('lodash');var squel=require(_0x1bda('0xb'));var crypto=require(_0x1bda('0xc'));var jsforce=require(_0x1bda('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1bda('0x8'));var querystring=require(_0x1bda('0xe'));var Papa=require(_0x1bda('0xf'));var Redis=require(_0x1bda('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1bda('0x11'));var as=require(_0x1bda('0x12'));var hardwareService=require(_0x1bda('0x13'));var logger=require(_0x1bda('0x14'))(_0x1bda('0x15'));var utils=require('../../config/utils');var config=require(_0x1bda('0x16'));var licenseUtil=require(_0x1bda('0x17'));var db=require(_0x1bda('0x18'))['db'];function respondWithStatusCode(_0x4c5b18,_0x3647dd){_0x3647dd=_0x3647dd||0xcc;return function(_0x12db6c){if(_0x12db6c){return _0x4c5b18['sendStatus'](_0x3647dd);}return _0x4c5b18['status'](_0x3647dd)['end']();};}function respondWithResult(_0x479ff9,_0x588381){_0x588381=_0x588381||0xc8;return function(_0x2ae392){if(_0x2ae392){return _0x479ff9[_0x1bda('0x19')](_0x588381)[_0x1bda('0x1a')](_0x2ae392);}};}function respondWithFilteredResult(_0xc5eeb8,_0x2c9b8b){return function(_0xa17677){if(_0xa17677){var _0x131ef3=typeof _0x2c9b8b[_0x1bda('0x1b')]===_0x1bda('0x1c')&&typeof _0x2c9b8b[_0x1bda('0x1d')]===_0x1bda('0x1c');var _0x2e95c9=_0xa17677[_0x1bda('0x1e')];var _0x40448d=_0x131ef3?0x0:_0x2c9b8b[_0x1bda('0x1b')];var _0x4c5f93=_0x131ef3?_0xa17677['count']:_0x2c9b8b[_0x1bda('0x1b')]+_0x2c9b8b[_0x1bda('0x1d')];var _0x571be8;if(_0x4c5f93>=_0x2e95c9){_0x4c5f93=_0x2e95c9;_0x571be8=0xc8;}else{_0x571be8=0xce;}_0xc5eeb8[_0x1bda('0x19')](_0x571be8);return _0xc5eeb8[_0x1bda('0x1f')](_0x1bda('0x20'),_0x40448d+'-'+_0x4c5f93+'/'+_0x2e95c9)[_0x1bda('0x1a')](_0xa17677);}return null;};}function patchUpdates(_0x4e87a0){return function(_0xeb0dee){try{jsonpatch['apply'](_0xeb0dee,_0x4e87a0,!![]);}catch(_0x30ea32){return BPromise[_0x1bda('0x21')](_0x30ea32);}return _0xeb0dee[_0x1bda('0x22')]();};}function saveUpdates(_0x56015f,_0x3dafbf){return function(_0x4aad06){if(_0x4aad06){return _0x4aad06['update'](_0x56015f)['then'](function(_0x1f5dbf){return _0x1f5dbf;});}return null;};}function removeEntity(_0x394199,_0x5f4d66){return function(_0x36b2f2){if(_0x36b2f2){return _0x36b2f2[_0x1bda('0x23')]()[_0x1bda('0x24')](function(){_0x394199[_0x1bda('0x19')](0xcc)[_0x1bda('0x25')]();});}};}function handleEntityNotFound(_0x1d0c3a,_0x3b9c7a){return function(_0x42c85b){if(!_0x42c85b){_0x1d0c3a[_0x1bda('0x26')](0x194);}return _0x42c85b;};}function handleError(_0x2b1edd,_0x4a5b34){_0x4a5b34=_0x4a5b34||0x1f4;return function(_0x420a43){logger[_0x1bda('0x27')](_0x420a43[_0x1bda('0x28')]);if(_0x420a43['name']){delete _0x420a43['name'];}_0x2b1edd[_0x1bda('0x19')](_0x4a5b34)['send'](_0x420a43);};}exports[_0x1bda('0x29')]=function(_0x14cf00,_0x1bb167){var _0x3db73e={},_0x59f46f={},_0xf97977={'count':0x0,'rows':[]};var _0x541dc7=_[_0x1bda('0x2a')](db[_0x1bda('0x2b')][_0x1bda('0x2c')],function(_0x49a98a){return{'name':_0x49a98a[_0x1bda('0x2d')],'type':_0x49a98a[_0x1bda('0x2e')]['key']};});_0x59f46f['model']=_[_0x1bda('0x2a')](_0x541dc7,_0x1bda('0x2f'));_0x59f46f[_0x1bda('0x30')]=_[_0x1bda('0x31')](_0x14cf00['query']);_0x59f46f[_0x1bda('0x32')]=_['intersection'](_0x59f46f[_0x1bda('0x33')],_0x59f46f[_0x1bda('0x30')]);_0x59f46f[_0x1bda('0x32')]=_[_0x1bda('0x34')](_0x59f46f[_0x1bda('0x32')],[_0x1bda('0x35'),_0x1bda('0x36'),'$gt',_0x1bda('0x37'),'$lt',_0x1bda('0x38'),'$ne','$eq',_0x1bda('0x39'),_0x1bda('0x3a'),'$notBetween',_0x1bda('0x3b'),'$notIn',_0x1bda('0x3c'),_0x1bda('0x3d'),'$iLike','$notILike','$like',_0x1bda('0x3e'),'$contains',_0x1bda('0x3f'),_0x1bda('0x40')]);_0x3db73e[_0x1bda('0x41')]=_[_0x1bda('0x42')](_0x59f46f[_0x1bda('0x33')],qs[_0x1bda('0x43')](_0x14cf00[_0x1bda('0x30')]['fields']));_0x3db73e['attributes']=_0x3db73e[_0x1bda('0x41')][_0x1bda('0x44')]?_0x3db73e[_0x1bda('0x41')]:_0x59f46f[_0x1bda('0x33')];if(!_0x14cf00[_0x1bda('0x30')][_0x1bda('0x45')](_0x1bda('0x46'))){_0x3db73e['limit']=qs['limit'](_0x14cf00[_0x1bda('0x30')][_0x1bda('0x1d')]);_0x3db73e[_0x1bda('0x1b')]=qs[_0x1bda('0x1b')](_0x14cf00['query'][_0x1bda('0x1b')]);}_0x3db73e['order']=qs[_0x1bda('0x47')](_0x14cf00[_0x1bda('0x30')][_0x1bda('0x47')]);_0x3db73e[_0x1bda('0x48')]=qs[_0x1bda('0x32')](_['pick'](_0x14cf00[_0x1bda('0x30')],_0x59f46f[_0x1bda('0x32')]),_0x541dc7);if(_0x14cf00[_0x1bda('0x30')][_0x1bda('0x49')]){_0x3db73e[_0x1bda('0x48')]=_[_0x1bda('0x4a')](_0x3db73e[_0x1bda('0x48')],{'$or':_[_0x1bda('0x2a')](_0x541dc7,function(_0x27bf79){if(_0x27bf79[_0x1bda('0x2e')]!==_0x1bda('0x4b')){var _0x4ae571={};_0x4ae571[_0x27bf79[_0x1bda('0x2f')]]={'$like':'%'+_0x14cf00[_0x1bda('0x30')][_0x1bda('0x49')]+'%'};return _0x4ae571;}})});}_0x3db73e=_[_0x1bda('0x4a')]({},_0x3db73e,_0x14cf00[_0x1bda('0x4c')]);var _0x34470d={'where':_0x3db73e[_0x1bda('0x48')]};return db[_0x1bda('0x2b')][_0x1bda('0x1e')](_0x34470d)['then'](function(_0x53dfac){_0xf97977['count']=_0x53dfac;if(_0x14cf00['query'][_0x1bda('0x4d')]){_0x3db73e[_0x1bda('0x4e')]=[{'all':!![]}];}return db[_0x1bda('0x2b')]['findAll'](_0x3db73e);})[_0x1bda('0x24')](function(_0x132787){_0xf97977[_0x1bda('0x4f')]=_0x132787;return _0xf97977;})[_0x1bda('0x24')](respondWithFilteredResult(_0x1bb167,_0x3db73e))['catch'](handleError(_0x1bb167,null));};exports[_0x1bda('0x50')]=function(_0x3e519f,_0x9aedf7){var _0xd5ce2e={'raw':!![],'where':{'id':_0x3e519f[_0x1bda('0x51')]['id']}},_0x5529cc={};_0x5529cc[_0x1bda('0x33')]=_[_0x1bda('0x31')](db[_0x1bda('0x2b')][_0x1bda('0x2c')]);_0x5529cc[_0x1bda('0x30')]=_[_0x1bda('0x31')](_0x3e519f[_0x1bda('0x30')]);_0x5529cc['filters']=_[_0x1bda('0x42')](_0x5529cc['model'],_0x5529cc[_0x1bda('0x30')]);_0xd5ce2e[_0x1bda('0x41')]=_[_0x1bda('0x42')](_0x5529cc[_0x1bda('0x33')],qs[_0x1bda('0x43')](_0x3e519f[_0x1bda('0x30')][_0x1bda('0x43')]));_0xd5ce2e[_0x1bda('0x41')]=_0xd5ce2e[_0x1bda('0x41')][_0x1bda('0x44')]?_0xd5ce2e[_0x1bda('0x41')]:_0x5529cc['model'];if(_0x3e519f[_0x1bda('0x30')][_0x1bda('0x4d')]){_0xd5ce2e['include']=[{'all':!![]}];}_0xd5ce2e=_[_0x1bda('0x4a')]({},_0xd5ce2e,_0x3e519f[_0x1bda('0x4c')]);return db['CmHopper']['find'](_0xd5ce2e)[_0x1bda('0x24')](handleEntityNotFound(_0x9aedf7,null))[_0x1bda('0x24')](respondWithResult(_0x9aedf7,null))[_0x1bda('0x52')](handleError(_0x9aedf7,null));};exports['create']=function(_0x4f2f3b,_0x42ad0e){return db['CmHopper'][_0x1bda('0x53')](_0x4f2f3b[_0x1bda('0x54')],{})['then'](respondWithResult(_0x42ad0e,0xc9))[_0x1bda('0x52')](handleError(_0x42ad0e,null));};exports[_0x1bda('0x55')]=function(_0x444571,_0x2f5f6b){if(_0x444571['body']['id']){delete _0x444571[_0x1bda('0x54')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x444571['params']['id']}})[_0x1bda('0x24')](handleEntityNotFound(_0x2f5f6b,null))['then'](saveUpdates(_0x444571[_0x1bda('0x54')],null))['then'](respondWithResult(_0x2f5f6b,null))[_0x1bda('0x52')](handleError(_0x2f5f6b,null));};exports[_0x1bda('0x56')]=function(_0x3dd704,_0xb3178d){return db[_0x1bda('0x2b')][_0x1bda('0x56')]()[_0x1bda('0x24')](respondWithResult(_0xb3178d,null))['catch'](handleError(_0xb3178d,null));};exports[_0x1bda('0x23')]=function(_0x512d02,_0x565460){var _0xadf2f1;return db[_0x1bda('0x2b')][_0x1bda('0x57')]({'where':{'id':_0x512d02[_0x1bda('0x51')]['id']}})[_0x1bda('0x24')](handleEntityNotFound(_0x565460,null))[_0x1bda('0x24')](function(_0xb20cfc){if(_0xb20cfc){return _0xb20cfc['destroy']()[_0x1bda('0x24')](function(_0x23daca){return _0x23daca;});}})[_0x1bda('0x24')](function(_0x28434a){_0xadf2f1=_0x28434a;if(_0x28434a){if(_0x28434a[_0x1bda('0x58')]||_0x28434a['CampaignId']){return db[_0x28434a[_0x1bda('0x58')]?_0x1bda('0x59'):_0x1bda('0x5a')][_0x1bda('0x57')]({'where':{'id':_0x28434a[_0x1bda('0x58')]?_0x28434a[_0x1bda('0x58')]:_0x28434a[_0x1bda('0x5b')]},'attributes':['id','name'],'raw':!![]});}}})[_0x1bda('0x24')](function(_0x5f2b66){var _0x4fd158={};if(_0x5f2b66){_[_0x1bda('0x4a')](_0x4fd158,_[_0x1bda('0x5c')](_0xadf2f1[_0x1bda('0x5d')],[_0x1bda('0x5e'),_0x1bda('0x5f'),'id']));_0x4fd158['state']=0x15;_0x4fd158[_0x1bda('0x60')]=_0x1bda('0x61');_0x4fd158[_0x1bda('0x62')]=_0x5f2b66[_0x1bda('0x2f')];_0x4fd158[_0x1bda('0x63')]=_0x512d02[_0x1bda('0x64')][_0x1bda('0x2f')];_0x4fd158[_0x1bda('0x65')]=_0x512d02[_0x1bda('0x64')]['id'];_0x4fd158[_0x1bda('0x61')]=!![];_0x4fd158[_0x1bda('0x66')]=moment()[_0x1bda('0x67')](_0x1bda('0x68'));_0x4fd158[_0x1bda('0x69')]=_0xadf2f1[_0x1bda('0x6a')];_0x4fd158['campaigntype']=_0xadf2f1[_0x1bda('0x58')]?_0x1bda('0x6b'):_0x1bda('0x6c');return db[_0x1bda('0x6d')][_0x1bda('0x57')]({'where':{'id':_0x4fd158[_0x1bda('0x6e')]},'attributes':[_0x1bda('0x6f'),_0x1bda('0x70')]})[_0x1bda('0x24')](function(_0x3ef71c){if(!_[_0x1bda('0x71')](_0x565460)&&!_[_0x1bda('0x71')](_0x3ef71c[_0x1bda('0x6f')])){_0x4fd158[_0x1bda('0x72')]=_0x3ef71c[_0x1bda('0x6f')];if(!_['isNil'](_0x3ef71c[_0x1bda('0x70')])){_0x4fd158[_0x1bda('0x72')]+='\x20'+_0x3ef71c[_0x1bda('0x70')];}}})[_0x1bda('0x73')](function(){return db['CmHopperFinal']['create'](_0x4fd158);});}})['then'](function(){return _0x565460[_0x1bda('0x19')](0xcc)[_0x1bda('0x25')]();})[_0x1bda('0x52')](handleError(_0x565460,null));};exports[_0x1bda('0x74')]=function(_0x1259e9,_0x25c875,_0x36796){var _0x599636=[];return db['CmContact']['describe']()['then'](function(_0x4897bf){_0x599636=_[_0x1bda('0x31')](_0x4897bf);return _0x1259e9[_0x1bda('0x64')][_0x1bda('0x75')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x1bda('0x76')},'attributes':['id',_0x1bda('0x77'),_0x1bda('0x78')],'raw':!![]});})[_0x1bda('0x24')](function(_0x4ab95e){if(_0x4ab95e&&_0x4ab95e['length']){return db[_0x1bda('0x79')][_0x1bda('0x7a')](function(_0x2a146e){var _0x12d79f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x1bda('0x68'))},'VoiceQueueId':{'$in':_[_0x1bda('0x2a')](_0x4ab95e,'id')},'$or':[{'UserId':null},{'UserId':_0x1259e9[_0x1bda('0x64')]['id']}]};var _0x4a0d36={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4ab95e)[_0x1bda('0x49')]([_0x1bda('0x78'),0x0])[_0x1bda('0x2a')]('id')[_0x1bda('0x7b')]()},'$or':[{'UserId':null},{'UserId':_0x1259e9[_0x1bda('0x64')]['id']}]};var _0x1ec527={'$or':[_0x12d79f,_0x4a0d36]};var _0x20447d=[];if(_0x1259e9[_0x1bda('0x54')][_0x1bda('0x7c')]&&_0x1259e9[_0x1bda('0x54')][_0x1bda('0x7c')]===_0x1bda('0x7d')){if(!_[_0x1bda('0x7e')](_0x1259e9[_0x1bda('0x54')][_0x1bda('0x7f')])){_0x1ec527['id']={'$in':_0x1259e9[_0x1bda('0x54')][_0x1bda('0x7f')]};}_0x20447d=[[_0x1bda('0x80'),_0x1bda('0x81')],[_0x1bda('0x82'),_0x4ab95e[0x0]['dialOrderByScheduledAt']===_0x1bda('0x81')?'DESC':_0x1bda('0x81')],db[_0x1bda('0x79')][_0x1bda('0x83')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x1bda('0x7e')](_0x1259e9[_0x1bda('0x54')][_0x1bda('0x7f')])){_0x1ec527['id']={'$notIn':_0x1259e9[_0x1bda('0x54')][_0x1bda('0x7f')]};}_0x20447d=[[_0x1bda('0x80'),_0x1bda('0x84')],['scheduledAt',_0x4ab95e[0x0]['dialOrderByScheduledAt']],db[_0x1bda('0x79')][_0x1bda('0x83')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x1bda('0x2b')][_0x1bda('0x85')]({'attributes':['id',_0x1bda('0x86'),_0x1bda('0x87')],'where':_0x1ec527,'order':_0x20447d,'transaction':_0x2a146e,'lock':_0x2a146e['LOCK'][_0x1bda('0x88')],'include':[{'model':db['CmContact'],'as':_0x1bda('0x89'),'attributes':_0x599636,'include':[{'model':db[_0x1bda('0x8a')],'as':_0x1bda('0x8b'),'attributes':['id','name']}]},{'model':db['CmList'],'as':_0x1bda('0x8c'),'attributes':['id',_0x1bda('0x2f')]},{'model':db[_0x1bda('0x59')],'as':_0x1bda('0x8d'),'attributes':['id',_0x1bda('0x2f'),_0x1bda('0x8e')]}]})[_0x1bda('0x24')](function(_0x1d6111){if(_0x1d6111){return _0x1d6111['update']({'UserId':_0x1259e9[_0x1bda('0x64')]['id']},{'transaction':_0x2a146e});}});});}})[_0x1bda('0x24')](handleEntityNotFound(_0x25c875,null))[_0x1bda('0x24')](respondWithResult(_0x25c875,null))[_0x1bda('0x52')](handleError(_0x25c875,null));};exports[_0x1bda('0x8f')]=function(_0x369ba9,_0x25c5a1,_0x59f6ad){var _0x417456=[];return db[_0x1bda('0x6d')]['describe']()[_0x1bda('0x24')](function(_0x29221f){_0x417456=_[_0x1bda('0x31')](_0x29221f);return _0x369ba9[_0x1bda('0x64')][_0x1bda('0x75')]({'where':{'type':_0x1bda('0x90'),'dialActive':!![],'dialMethod':_0x1bda('0x76')},'attributes':['id',_0x1bda('0x77'),_0x1bda('0x78')],'raw':!![]});})[_0x1bda('0x24')](function(_0x523a26){if(_0x523a26&&_0x523a26[_0x1bda('0x44')]){return db['sequelize']['transaction'](function(_0x2f88ba){var _0x16a895={'active':![],'recallme':!![],'id':_0x369ba9[_0x1bda('0x54')]['hopperId']};return db[_0x1bda('0x2b')][_0x1bda('0x85')]({'attributes':['id',_0x1bda('0x86'),'recallme'],'where':_0x16a895,'transaction':_0x2f88ba,'lock':_0x2f88ba['LOCK'][_0x1bda('0x88')],'include':[{'model':db[_0x1bda('0x6d')],'as':_0x1bda('0x89'),'attributes':_0x417456,'include':[{'model':db[_0x1bda('0x8a')],'as':_0x1bda('0x8b'),'attributes':['id','name']}]},{'model':db[_0x1bda('0x91')],'as':_0x1bda('0x8c'),'attributes':['id',_0x1bda('0x2f')]},{'model':db[_0x1bda('0x59')],'as':'Queue','attributes':['id',_0x1bda('0x2f'),_0x1bda('0x8e')]}]})[_0x1bda('0x24')](function(_0x3ae38a){if(_0x3ae38a){return _0x3ae38a[_0x1bda('0x55')]({'UserId':_0x369ba9['user']['id']},{'transaction':_0x2f88ba});}});});}})['then'](handleEntityNotFound(_0x25c5a1,null))['then'](respondWithResult(_0x25c5a1,null))[_0x1bda('0x52')](handleError(_0x25c5a1,null));};exports[_0x1bda('0x92')]=function(_0x34cf2c,_0xdf7752,_0x2afcb5){return _0x34cf2c['user']['getVoiceQueues']({'where':{'type':_0x1bda('0x90'),'dialActive':!![],'dialMethod':_0x1bda('0x76')},'attributes':['id'],'raw':!![]})[_0x1bda('0x24')](function(_0x5683f2){if(_0x5683f2&&_0x5683f2[_0x1bda('0x44')]){return db[_0x1bda('0x2b')][_0x1bda('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1bda('0x67')](_0x1bda('0x68'))},'VoiceQueueId':{'$in':_[_0x1bda('0x2a')](_0x5683f2,'id')},'$or':[{'UserId':null},{'UserId':_0x34cf2c['user']['id']}]}});}return 0x0;})[_0x1bda('0x24')](function(_0x40bd48){if(!_[_0x1bda('0x71')](_0x40bd48)&&_[_0x1bda('0x93')](_0x40bd48)){return _0xdf7752[_0x1bda('0x19')](0xc8)[_0x1bda('0x1a')]({'contacts':_0x40bd48});}else{logger[_0x1bda('0x27')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x1bda('0x92'),0x194,_0x1bda('0x94'));_0xdf7752[_0x1bda('0x26')](0x194);}})[_0x1bda('0x52')](handleError(_0xdf7752,null));}; \ No newline at end of file +var _0x83eb=['catch','params','include','options','create','body','describe','find','CampaignId','VoiceQueueId','VoiceQueue','Campaign','dataValues','createdAt','state','statedesc','deleted','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','filter','direction','isEmpty','hopperIds','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','ASC','recallme','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','findOne','scheduledat','LOCK','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','concat','$and','$gte','$lt','$ne','$eq','$not','$between','$in','$notIn','$like','$notLike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','merge','CmHopper','includeAll','rows'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x83eb,0x162));var _0xb83e=function(_0x3becbb,_0x13beb3){_0x3becbb=_0x3becbb-0x0;var _0x297c07=_0x83eb[_0x3becbb];return _0x297c07;};'use strict';var emlformat=require(_0xb83e('0x0'));var rimraf=require(_0xb83e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb83e('0x2'));var rp=require(_0xb83e('0x3'));var moment=require('moment');var BPromise=require(_0xb83e('0x4'));var Mustache=require(_0xb83e('0x5'));var util=require('util');var path=require(_0xb83e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb83e('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb83e('0x8'));var jsforce=require(_0xb83e('0x9'));var deskjs=require(_0xb83e('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb83e('0xb'));var Redis=require(_0xb83e('0xc'));var authService=require(_0xb83e('0xd'));var qs=require(_0xb83e('0xe'));var as=require(_0xb83e('0xf'));var hardwareService=require(_0xb83e('0x10'));var logger=require('../../config/logger')(_0xb83e('0x11'));var utils=require(_0xb83e('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xb83e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7f7409,_0x4f5210){_0x4f5210=_0x4f5210||0xcc;return function(_0x5aee60){if(_0x5aee60){return _0x7f7409[_0xb83e('0x14')](_0x4f5210);}return _0x7f7409[_0xb83e('0x15')](_0x4f5210)[_0xb83e('0x16')]();};}function respondWithResult(_0x365403,_0xe790f2){_0xe790f2=_0xe790f2||0xc8;return function(_0x10b5bb){if(_0x10b5bb){return _0x365403[_0xb83e('0x15')](_0xe790f2)[_0xb83e('0x17')](_0x10b5bb);}};}function respondWithFilteredResult(_0x3019,_0x29b9b9){return function(_0x4818eb){if(_0x4818eb){var _0x1530d0=typeof _0x29b9b9[_0xb83e('0x18')]===_0xb83e('0x19')&&typeof _0x29b9b9['limit']===_0xb83e('0x19');var _0x27fe53=_0x4818eb['count'];var _0x2c83de=_0x1530d0?0x0:_0x29b9b9[_0xb83e('0x18')];var _0x2d4f24=_0x1530d0?_0x4818eb[_0xb83e('0x1a')]:_0x29b9b9[_0xb83e('0x18')]+_0x29b9b9['limit'];var _0x2ad1c7;if(_0x2d4f24>=_0x27fe53){_0x2d4f24=_0x27fe53;_0x2ad1c7=0xc8;}else{_0x2ad1c7=0xce;}_0x3019[_0xb83e('0x15')](_0x2ad1c7);return _0x3019['set'](_0xb83e('0x1b'),_0x2c83de+'-'+_0x2d4f24+'/'+_0x27fe53)['json'](_0x4818eb);}return null;};}function patchUpdates(_0x5d73ec){return function(_0x3f3c04){try{jsonpatch[_0xb83e('0x1c')](_0x3f3c04,_0x5d73ec,!![]);}catch(_0x38fd6c){return BPromise[_0xb83e('0x1d')](_0x38fd6c);}return _0x3f3c04[_0xb83e('0x1e')]();};}function saveUpdates(_0x5884c0,_0x21ffee){return function(_0x3afdbf){if(_0x3afdbf){return _0x3afdbf[_0xb83e('0x1f')](_0x5884c0)[_0xb83e('0x20')](function(_0x44d504){return _0x44d504;});}return null;};}function removeEntity(_0x178556,_0x1b6707){return function(_0x44fd6d){if(_0x44fd6d){return _0x44fd6d[_0xb83e('0x21')]()[_0xb83e('0x20')](function(){_0x178556[_0xb83e('0x15')](0xcc)[_0xb83e('0x16')]();});}};}function handleEntityNotFound(_0x36a48a,_0x9e5865){return function(_0x53bb36){if(!_0x53bb36){_0x36a48a[_0xb83e('0x14')](0x194);}return _0x53bb36;};}function handleError(_0x1bc1c9,_0x2b277e){_0x2b277e=_0x2b277e||0x1f4;return function(_0x4077d7){logger[_0xb83e('0x22')](_0x4077d7[_0xb83e('0x23')]);if(_0x4077d7[_0xb83e('0x24')]){delete _0x4077d7[_0xb83e('0x24')];}_0x1bc1c9['status'](_0x2b277e)['send'](_0x4077d7);};}exports[_0xb83e('0x25')]=function(_0x14099c,_0x18ea0c){var _0xa1f5ba={},_0x41ff37={},_0x304dba={'count':0x0,'rows':[]};var _0x4cacc4=_['map'](db['CmHopper'][_0xb83e('0x26')],function(_0x13071c){return{'name':_0x13071c[_0xb83e('0x27')],'type':_0x13071c[_0xb83e('0x28')][_0xb83e('0x29')]};});_0x41ff37[_0xb83e('0x2a')]=_[_0xb83e('0x2b')](_0x4cacc4,'name');_0x41ff37[_0xb83e('0x2c')]=_[_0xb83e('0x2d')](_0x14099c[_0xb83e('0x2c')]);_0x41ff37[_0xb83e('0x2e')]=_[_0xb83e('0x2f')](_0x41ff37[_0xb83e('0x2a')],_0x41ff37[_0xb83e('0x2c')]);_0x41ff37[_0xb83e('0x2e')]=_[_0xb83e('0x30')](_0x41ff37['filters'],[_0xb83e('0x31'),'$or','$gt',_0xb83e('0x32'),_0xb83e('0x33'),'$lte',_0xb83e('0x34'),_0xb83e('0x35'),_0xb83e('0x36'),_0xb83e('0x37'),'$notBetween',_0xb83e('0x38'),_0xb83e('0x39'),_0xb83e('0x3a'),_0xb83e('0x3b'),'$iLike','$notILike',_0xb83e('0x3a'),_0xb83e('0x3c'),_0xb83e('0x3d'),_0xb83e('0x3e'),_0xb83e('0x3f')]);_0xa1f5ba[_0xb83e('0x40')]=_[_0xb83e('0x2f')](_0x41ff37[_0xb83e('0x2a')],qs[_0xb83e('0x41')](_0x14099c[_0xb83e('0x2c')][_0xb83e('0x41')]));_0xa1f5ba[_0xb83e('0x40')]=_0xa1f5ba[_0xb83e('0x40')][_0xb83e('0x42')]?_0xa1f5ba[_0xb83e('0x40')]:_0x41ff37['model'];if(!_0x14099c[_0xb83e('0x2c')][_0xb83e('0x43')](_0xb83e('0x44'))){_0xa1f5ba[_0xb83e('0x45')]=qs['limit'](_0x14099c[_0xb83e('0x2c')][_0xb83e('0x45')]);_0xa1f5ba[_0xb83e('0x18')]=qs[_0xb83e('0x18')](_0x14099c['query'][_0xb83e('0x18')]);}_0xa1f5ba['order']=qs[_0xb83e('0x46')](_0x14099c['query'][_0xb83e('0x46')]);_0xa1f5ba[_0xb83e('0x47')]=qs['filters'](_[_0xb83e('0x48')](_0x14099c[_0xb83e('0x2c')],_0x41ff37['filters']),_0x4cacc4);if(_0x14099c[_0xb83e('0x2c')]['filter']){_0xa1f5ba[_0xb83e('0x47')]=_['merge'](_0xa1f5ba['where'],{'$or':_['map'](_0x4cacc4,function(_0x307597){if(_0x307597['type']!==_0xb83e('0x49')){var _0x22b327={};_0x22b327[_0x307597[_0xb83e('0x24')]]={'$like':'%'+_0x14099c[_0xb83e('0x2c')]['filter']+'%'};return _0x22b327;}})});}_0xa1f5ba=_[_0xb83e('0x4a')]({},_0xa1f5ba,_0x14099c['options']);var _0x95f0e3={'where':_0xa1f5ba['where']};return db[_0xb83e('0x4b')][_0xb83e('0x1a')](_0x95f0e3)[_0xb83e('0x20')](function(_0x4cbfe3){_0x304dba[_0xb83e('0x1a')]=_0x4cbfe3;if(_0x14099c[_0xb83e('0x2c')][_0xb83e('0x4c')]){_0xa1f5ba['include']=[{'all':!![]}];}return db[_0xb83e('0x4b')]['findAll'](_0xa1f5ba);})[_0xb83e('0x20')](function(_0xa11875){_0x304dba[_0xb83e('0x4d')]=_0xa11875;return _0x304dba;})[_0xb83e('0x20')](respondWithFilteredResult(_0x18ea0c,_0xa1f5ba))[_0xb83e('0x4e')](handleError(_0x18ea0c,null));};exports['show']=function(_0x371333,_0x40bac8){var _0xd5562={'raw':!![],'where':{'id':_0x371333[_0xb83e('0x4f')]['id']}},_0x1f606f={};_0x1f606f[_0xb83e('0x2a')]=_[_0xb83e('0x2d')](db[_0xb83e('0x4b')][_0xb83e('0x26')]);_0x1f606f[_0xb83e('0x2c')]=_[_0xb83e('0x2d')](_0x371333[_0xb83e('0x2c')]);_0x1f606f['filters']=_[_0xb83e('0x2f')](_0x1f606f['model'],_0x1f606f[_0xb83e('0x2c')]);_0xd5562[_0xb83e('0x40')]=_[_0xb83e('0x2f')](_0x1f606f[_0xb83e('0x2a')],qs['fields'](_0x371333[_0xb83e('0x2c')]['fields']));_0xd5562[_0xb83e('0x40')]=_0xd5562[_0xb83e('0x40')]['length']?_0xd5562[_0xb83e('0x40')]:_0x1f606f[_0xb83e('0x2a')];if(_0x371333['query'][_0xb83e('0x4c')]){_0xd5562[_0xb83e('0x50')]=[{'all':!![]}];}_0xd5562=_[_0xb83e('0x4a')]({},_0xd5562,_0x371333[_0xb83e('0x51')]);return db[_0xb83e('0x4b')]['find'](_0xd5562)[_0xb83e('0x20')](handleEntityNotFound(_0x40bac8,null))[_0xb83e('0x20')](respondWithResult(_0x40bac8,null))[_0xb83e('0x4e')](handleError(_0x40bac8,null));};exports['create']=function(_0x515d53,_0x532932){return db[_0xb83e('0x4b')][_0xb83e('0x52')](_0x515d53['body'],{})[_0xb83e('0x20')](respondWithResult(_0x532932,0xc9))[_0xb83e('0x4e')](handleError(_0x532932,null));};exports['update']=function(_0x113fda,_0x52f68c){if(_0x113fda[_0xb83e('0x53')]['id']){delete _0x113fda[_0xb83e('0x53')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x113fda[_0xb83e('0x4f')]['id']}})[_0xb83e('0x20')](handleEntityNotFound(_0x52f68c,null))['then'](saveUpdates(_0x113fda[_0xb83e('0x53')],null))[_0xb83e('0x20')](respondWithResult(_0x52f68c,null))['catch'](handleError(_0x52f68c,null));};exports[_0xb83e('0x54')]=function(_0x1af526,_0x444c86){return db[_0xb83e('0x4b')][_0xb83e('0x54')]()[_0xb83e('0x20')](respondWithResult(_0x444c86,null))['catch'](handleError(_0x444c86,null));};exports['destroy']=function(_0x1d12b0,_0x50d2db){var _0x20c72f;return db[_0xb83e('0x4b')][_0xb83e('0x55')]({'where':{'id':_0x1d12b0[_0xb83e('0x4f')]['id']}})[_0xb83e('0x20')](handleEntityNotFound(_0x50d2db,null))['then'](function(_0x3091f9){if(_0x3091f9){return _0x3091f9['destroy']()[_0xb83e('0x20')](function(_0x3bb83c){return _0x3bb83c;});}})[_0xb83e('0x20')](function(_0x241e62){_0x20c72f=_0x241e62;if(_0x241e62){if(_0x241e62['VoiceQueueId']||_0x241e62[_0xb83e('0x56')]){return db[_0x241e62[_0xb83e('0x57')]?_0xb83e('0x58'):_0xb83e('0x59')][_0xb83e('0x55')]({'where':{'id':_0x241e62['VoiceQueueId']?_0x241e62['VoiceQueueId']:_0x241e62[_0xb83e('0x56')]},'attributes':['id','name'],'raw':!![]});}}})[_0xb83e('0x20')](function(_0x505957){var _0x463b94={};if(_0x505957){_[_0xb83e('0x4a')](_0x463b94,_['omit'](_0x20c72f[_0xb83e('0x5a')],[_0xb83e('0x5b'),'updatedAt','id']));_0x463b94[_0xb83e('0x5c')]=0x15;_0x463b94[_0xb83e('0x5d')]=_0xb83e('0x5e');_0x463b94['campaign']=_0x505957['name'];_0x463b94['membername']=_0x1d12b0[_0xb83e('0x5f')][_0xb83e('0x24')];_0x463b94[_0xb83e('0x60')]=_0x1d12b0[_0xb83e('0x5f')]['id'];_0x463b94[_0xb83e('0x5e')]=!![];_0x463b94[_0xb83e('0x61')]=moment()[_0xb83e('0x62')](_0xb83e('0x63'));_0x463b94[_0xb83e('0x64')]=_0x20c72f[_0xb83e('0x65')];_0x463b94[_0xb83e('0x66')]=_0x20c72f[_0xb83e('0x57')]?_0xb83e('0x67'):'ivr';return db[_0xb83e('0x68')][_0xb83e('0x55')]({'where':{'id':_0x463b94[_0xb83e('0x69')]},'attributes':[_0xb83e('0x6a'),_0xb83e('0x6b')]})[_0xb83e('0x20')](function(_0x37f1cc){if(!_[_0xb83e('0x6c')](_0x50d2db)&&!_[_0xb83e('0x6c')](_0x37f1cc[_0xb83e('0x6a')])){_0x463b94[_0xb83e('0x6d')]=_0x37f1cc[_0xb83e('0x6a')];if(!_[_0xb83e('0x6c')](_0x37f1cc[_0xb83e('0x6b')])){_0x463b94[_0xb83e('0x6d')]+='\x20'+_0x37f1cc['lastName'];}}})[_0xb83e('0x6e')](function(){return db['CmHopperFinal'][_0xb83e('0x52')](_0x463b94);});}})['then'](function(){return _0x50d2db[_0xb83e('0x15')](0xcc)[_0xb83e('0x16')]();})[_0xb83e('0x4e')](handleError(_0x50d2db,null));};exports[_0xb83e('0x6f')]=function(_0xdb7f62,_0x36b11a,_0x1c3452){var _0x3449da=[];return db[_0xb83e('0x68')][_0xb83e('0x54')]()[_0xb83e('0x20')](function(_0x1c4e7f){_0x3449da=_[_0xb83e('0x2d')](_0x1c4e7f);return _0xdb7f62[_0xb83e('0x5f')][_0xb83e('0x70')]({'where':{'type':_0xb83e('0x71'),'dialActive':!![],'dialMethod':_0xb83e('0x72')},'attributes':['id',_0xb83e('0x73'),_0xb83e('0x74')],'raw':!![]});})['then'](function(_0x25034c){if(_0x25034c&&_0x25034c[_0xb83e('0x42')]){return db[_0xb83e('0x75')][_0xb83e('0x76')](function(_0xdfe238){var _0x23e8e3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb83e('0x62')](_0xb83e('0x63'))},'VoiceQueueId':{'$in':_[_0xb83e('0x2b')](_0x25034c,'id')},'$or':[{'UserId':null},{'UserId':_0xdb7f62[_0xb83e('0x5f')]['id']}]};var _0x4dac69={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x25034c)[_0xb83e('0x77')]([_0xb83e('0x74'),0x0])[_0xb83e('0x2b')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0xdb7f62[_0xb83e('0x5f')]['id']}]};var _0x1e2613={'$or':[_0x23e8e3,_0x4dac69]};var _0x365938=[];if(_0xdb7f62[_0xb83e('0x53')]['direction']&&_0xdb7f62[_0xb83e('0x53')][_0xb83e('0x78')]==='prev'){if(!_[_0xb83e('0x79')](_0xdb7f62[_0xb83e('0x53')][_0xb83e('0x7a')])){_0x1e2613['id']={'$in':_0xdb7f62[_0xb83e('0x53')][_0xb83e('0x7a')]};}_0x365938=[['priority','ASC'],[_0xb83e('0x7b'),_0x25034c[0x0][_0xb83e('0x73')]==='ASC'?_0xb83e('0x7c'):'ASC'],db['sequelize'][_0xb83e('0x7d')](_0xb83e('0x7e')),['id','DESC']];}else{if(!_[_0xb83e('0x79')](_0xdb7f62[_0xb83e('0x53')][_0xb83e('0x7a')])){_0x1e2613['id']={'$notIn':_0xdb7f62[_0xb83e('0x53')][_0xb83e('0x7a')]};}_0x365938=[['priority',_0xb83e('0x7c')],[_0xb83e('0x7b'),_0x25034c[0x0][_0xb83e('0x73')]],db[_0xb83e('0x75')][_0xb83e('0x7d')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xb83e('0x7f')]];}return db[_0xb83e('0x4b')]['findOne']({'attributes':['id','scheduledat',_0xb83e('0x80')],'where':_0x1e2613,'order':_0x365938,'transaction':_0xdfe238,'lock':_0xdfe238['LOCK'][_0xb83e('0x81')],'include':[{'model':db[_0xb83e('0x68')],'as':_0xb83e('0x82'),'attributes':_0x3449da,'include':[{'model':db[_0xb83e('0x83')],'as':_0xb83e('0x84'),'attributes':['id','name']}]},{'model':db[_0xb83e('0x85')],'as':_0xb83e('0x86'),'attributes':['id',_0xb83e('0x24')]},{'model':db[_0xb83e('0x58')],'as':_0xb83e('0x87'),'attributes':['id',_0xb83e('0x24'),_0xb83e('0x88')]}]})[_0xb83e('0x20')](function(_0x5d8b28){if(_0x5d8b28){return _0x5d8b28[_0xb83e('0x1f')]({'UserId':_0xdb7f62['user']['id']},{'transaction':_0xdfe238});}});});}})['then'](handleEntityNotFound(_0x36b11a,null))['then'](respondWithResult(_0x36b11a,null))['catch'](handleError(_0x36b11a,null));};exports[_0xb83e('0x89')]=function(_0x30d75a,_0x2e4856,_0x203984){var _0x5c8696=[];return db[_0xb83e('0x68')]['describe']()[_0xb83e('0x20')](function(_0x17c0f6){_0x5c8696=_[_0xb83e('0x2d')](_0x17c0f6);return _0x30d75a[_0xb83e('0x5f')][_0xb83e('0x70')]({'where':{'type':_0xb83e('0x71'),'dialActive':!![],'dialMethod':_0xb83e('0x72')},'attributes':['id',_0xb83e('0x73'),_0xb83e('0x74')],'raw':!![]});})[_0xb83e('0x20')](function(_0x2646a0){if(_0x2646a0&&_0x2646a0[_0xb83e('0x42')]){return db['sequelize']['transaction'](function(_0x4d5a0b){var _0x5ce998={'active':![],'recallme':!![],'id':_0x30d75a['body']['hopperId']};return db['CmHopper'][_0xb83e('0x8a')]({'attributes':['id',_0xb83e('0x8b'),_0xb83e('0x80')],'where':_0x5ce998,'transaction':_0x4d5a0b,'lock':_0x4d5a0b[_0xb83e('0x8c')][_0xb83e('0x81')],'include':[{'model':db[_0xb83e('0x68')],'as':'Contact','attributes':_0x5c8696,'include':[{'model':db[_0xb83e('0x83')],'as':_0xb83e('0x84'),'attributes':['id',_0xb83e('0x24')]}]},{'model':db['CmList'],'as':_0xb83e('0x86'),'attributes':['id',_0xb83e('0x24')]},{'model':db[_0xb83e('0x58')],'as':_0xb83e('0x87'),'attributes':['id',_0xb83e('0x24'),'dialActive']}]})[_0xb83e('0x20')](function(_0x4c3c3d){if(_0x4c3c3d){return _0x4c3c3d[_0xb83e('0x1f')]({'UserId':_0x30d75a[_0xb83e('0x5f')]['id']},{'transaction':_0x4d5a0b});}});});}})[_0xb83e('0x20')](handleEntityNotFound(_0x2e4856,null))['then'](respondWithResult(_0x2e4856,null))['catch'](handleError(_0x2e4856,null));};exports[_0xb83e('0x8d')]=function(_0x44aa0e,_0x2650af,_0x36c65f){return _0x44aa0e['user'][_0xb83e('0x70')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xb83e('0x20')](function(_0x362f5f){if(_0x362f5f&&_0x362f5f[_0xb83e('0x42')]){return db[_0xb83e('0x4b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xb83e('0x63'))},'VoiceQueueId':{'$in':_['map'](_0x362f5f,'id')},'$or':[{'UserId':null},{'UserId':_0x44aa0e[_0xb83e('0x5f')]['id']}]}});}return 0x0;})['then'](function(_0x35a7bb){if(!_[_0xb83e('0x6c')](_0x35a7bb)&&_[_0xb83e('0x8e')](_0x35a7bb)){return _0x2650af[_0xb83e('0x15')](0xc8)[_0xb83e('0x17')]({'contacts':_0x35a7bb});}else{logger[_0xb83e('0x22')](_0xb83e('0x8f'),_0xb83e('0x8d'),0x194,'entity\x20not\x20found');_0x2650af[_0xb83e('0x14')](0x194);}})[_0xb83e('0x4e')](handleError(_0x2650af,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 7a6a6ec..f734c49 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x187d=['moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api'];(function(_0x333965,_0x16e0f5){var _0x50290e=function(_0x1e7c60){while(--_0x1e7c60){_0x333965['push'](_0x333965['shift']());}};_0x50290e(++_0x16e0f5);}(_0x187d,0x93));var _0xd187=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x187d[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[{'name':_0xd187('0xc'),'fields':[_0xd187('0xc')]},{'name':_0xd187('0xd'),'fields':['phone']},{'name':_0xd187('0xe'),'fields':[_0xd187('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['request-promise','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x1149ab,_0x5354d2){var _0x42ac96=function(_0x123888){while(--_0x123888){_0x1149ab['push'](_0x1149ab['shift']());}};_0x42ac96(++_0x5354d2);}(_0x5496,0x175));var _0x6549=function(_0x32d232,_0x5e0894){_0x32d232=_0x32d232-0x0;var _0x4a4dfb=_0x5496[_0x32d232];return _0x4a4dfb;};'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')]('CmHopper',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xb')]},{'name':'phone','fields':[_0x6549('0xc')]},{'name':_0x6549('0xd'),'fields':[_0x6549('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 7a2dbc9..430204e 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 _0x8021=['push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','sequelize','destroy','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','LOCK','GetCmHopperPreview','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','Agent','voicePause','CmList','lodash','util','moment','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','message','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','map','include','model','ShowCmHopper','find','catch','CreateCmHopper','body','raw','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','order','Contact','keys','User','name','length','UserId'];(function(_0x21d38b,_0x467441){var _0xa6630b=function(_0x3abdda){while(--_0x3abdda){_0x21d38b['push'](_0x21d38b['shift']());}};_0xa6630b(++_0x467441);}(_0x8021,0x112));var _0x1802=function(_0x2de0ab,_0x353746){_0x2de0ab=_0x2de0ab-0x0;var _0x7f8af9=_0x8021[_0x2de0ab];return _0x7f8af9;};'use strict';var _=require(_0x1802('0x0'));var util=require(_0x1802('0x1'));var moment=require(_0x1802('0x2'));var BPromise=require('bluebird');var rs=require(_0x1802('0x3'));var fs=require('fs');var Redis=require(_0x1802('0x4'));var db=require(_0x1802('0x5'))['db'];var utils=require(_0x1802('0x6'));var logger=require(_0x1802('0x7'))(_0x1802('0x8'));var config=require(_0x1802('0x9'));var jayson=require(_0x1802('0xa'));const {validateExpressRequest}=require('twilio/lib/webhooks/webhooks');var client=jayson[_0x1802('0xb')][_0x1802('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x318481,_0x366e46,_0x19c43d){return new BPromise(function(_0x2bb566,_0x3528e2){return client[_0x1802('0xd')](_0x318481,_0x19c43d)[_0x1802('0xe')](function(_0x22735a){logger[_0x1802('0xf')](_0x1802('0x10'),_0x366e46,_0x1802('0x11'));logger[_0x1802('0x12')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x366e46,'request\x20sent',JSON[_0x1802('0x13')](_0x22735a));if(_0x22735a[_0x1802('0x14')]){if(_0x22735a[_0x1802('0x14')]['code']===0x1f4){logger[_0x1802('0x14')](_0x1802('0x10'),_0x366e46,_0x22735a[_0x1802('0x14')]['message']);return _0x3528e2(_0x22735a[_0x1802('0x14')][_0x1802('0x15')]);}logger['error'](_0x1802('0x10'),_0x366e46,_0x22735a['error'][_0x1802('0x15')]);return _0x2bb566(_0x22735a[_0x1802('0x14')][_0x1802('0x15')]);}else{logger[_0x1802('0xf')](_0x1802('0x10'),_0x366e46,_0x1802('0x11'));_0x2bb566(_0x22735a['result'][_0x1802('0x15')]);}})['catch'](function(_0xb56ef3){logger['error'](_0x1802('0x10'),_0x366e46,_0xb56ef3);_0x3528e2(_0xb56ef3);});});}exports[_0x1802('0x16')]=function(_0x2e2ba0){var _0xb70235=this;return new Promise(function(_0x4f2418,_0x56f94b){return db[_0x1802('0x17')][_0x1802('0x18')]({'raw':_0x2e2ba0[_0x1802('0x19')]?_0x2e2ba0['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e2ba0[_0x1802('0x19')]?_0x2e2ba0[_0x1802('0x19')][_0x1802('0x1a')]||null:null,'attributes':_0x2e2ba0['options']?_0x2e2ba0[_0x1802('0x19')][_0x1802('0x1b')]||null:null,'limit':_0x2e2ba0[_0x1802('0x19')]?_0x2e2ba0[_0x1802('0x19')][_0x1802('0x1c')]||null:null,'include':_0x2e2ba0[_0x1802('0x19')]?_0x2e2ba0[_0x1802('0x19')]['include']?_[_0x1802('0x1d')](_0x2e2ba0[_0x1802('0x19')][_0x1802('0x1e')],function(_0x3206b3){return{'model':db[_0x3206b3[_0x1802('0x1f')]],'as':_0x3206b3['as'],'attributes':_0x3206b3[_0x1802('0x1b')],'include':_0x3206b3['include']?_[_0x1802('0x1d')](_0x3206b3[_0x1802('0x1e')],function(_0x491008){return{'model':db[_0x491008[_0x1802('0x1f')]],'as':_0x491008['as'],'attributes':_0x491008['attributes'],'include':_0x491008[_0x1802('0x1e')]?_[_0x1802('0x1d')](_0x491008[_0x1802('0x1e')],function(_0x1d025b){return{'model':db[_0x1d025b[_0x1802('0x1f')]],'as':_0x1d025b['as'],'attributes':_0x1d025b[_0x1802('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1802('0xe')](function(_0x737bb5){logger[_0x1802('0xf')](_0x1802('0x16'),_0x2e2ba0);logger[_0x1802('0x12')]('GetCmHopper',_0x2e2ba0,JSON['stringify'](_0x737bb5));_0x4f2418(_0x737bb5);})['catch'](function(_0x54036f){logger[_0x1802('0x14')](_0x1802('0x16'),_0x54036f[_0x1802('0x15')],_0x2e2ba0);_0x56f94b(_0xb70235['error'](0x1f4,_0x54036f[_0x1802('0x15')]));});});};exports[_0x1802('0x20')]=function(_0x246e2d){var _0x58e207=this;return new Promise(function(_0x33cf70,_0x2af07f){return db['CmHopper'][_0x1802('0x21')]({'raw':_0x246e2d[_0x1802('0x19')]?_0x246e2d[_0x1802('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x246e2d['options']?_0x246e2d['options'][_0x1802('0x1a')]||null:null,'attributes':_0x246e2d[_0x1802('0x19')]?_0x246e2d[_0x1802('0x19')][_0x1802('0x1b')]||null:null,'include':_0x246e2d[_0x1802('0x19')]?_0x246e2d[_0x1802('0x19')]['include']?_['map'](_0x246e2d[_0x1802('0x19')][_0x1802('0x1e')],function(_0x130959){return{'model':db[_0x130959['model']],'as':_0x130959['as'],'attributes':_0x130959['attributes'],'include':_0x130959[_0x1802('0x1e')]?_['map'](_0x130959[_0x1802('0x1e')],function(_0x4c02ae){return{'model':db[_0x4c02ae[_0x1802('0x1f')]],'as':_0x4c02ae['as'],'attributes':_0x4c02ae['attributes'],'include':_0x4c02ae[_0x1802('0x1e')]?_[_0x1802('0x1d')](_0x4c02ae['include'],function(_0x4d560b){return{'model':db[_0x4d560b[_0x1802('0x1f')]],'as':_0x4d560b['as'],'attributes':_0x4d560b[_0x1802('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1802('0xe')](function(_0x118201){logger[_0x1802('0xf')]('ShowCmHopper',_0x246e2d);logger[_0x1802('0x12')]('ShowCmHopper',_0x246e2d,JSON[_0x1802('0x13')](_0x118201));_0x33cf70(_0x118201);})[_0x1802('0x22')](function(_0x44491b){logger[_0x1802('0x14')](_0x1802('0x20'),_0x44491b[_0x1802('0x15')],_0x246e2d);_0x2af07f(_0x58e207[_0x1802('0x14')](0x1f4,_0x44491b['message']));});});};exports[_0x1802('0x23')]=function(_0x3162c6){var _0x2d1ee4=this;return new Promise(function(_0xfbd1f7,_0x317dc3){return db[_0x1802('0x17')]['create'](_0x3162c6[_0x1802('0x24')],{'raw':_0x3162c6[_0x1802('0x19')]?_0x3162c6[_0x1802('0x19')][_0x1802('0x25')]===undefined?!![]:![]:!![]})[_0x1802('0xe')](function(_0x3a3133){logger['info'](_0x1802('0x23'),_0x3162c6);logger['debug'](_0x1802('0x23'),_0x3162c6,JSON[_0x1802('0x13')](_0x3a3133));_0xfbd1f7(_0x3a3133);})[_0x1802('0x22')](function(_0x245190){logger[_0x1802('0x14')](_0x1802('0x23'),_0x245190[_0x1802('0x15')],_0x3162c6);_0x317dc3(_0x2d1ee4[_0x1802('0x14')](0x1f4,_0x245190['message']));});});};exports[_0x1802('0x26')]=function(_0x1172e9){var _0x353fa0=this;return new Promise(function(_0x4e5211,_0x4a6a87){return db[_0x1802('0x17')][_0x1802('0x27')](_0x1172e9[_0x1802('0x24')],{'raw':_0x1172e9[_0x1802('0x19')]?_0x1172e9['options'][_0x1802('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1172e9[_0x1802('0x19')]?_0x1172e9['options'][_0x1802('0x1a')]||null:null,'attributes':_0x1172e9['options']?_0x1172e9[_0x1802('0x19')]['attributes']||null:null,'limit':_0x1172e9['options']?_0x1172e9['options'][_0x1802('0x1c')]||null:null})[_0x1802('0xe')](function(_0x3fa67d){logger[_0x1802('0xf')](_0x1802('0x26'),_0x1172e9);logger[_0x1802('0xf')](_0x1802('0x28'),JSON[_0x1802('0x13')](_0x1172e9[_0x1802('0x19')][_0x1802('0x1a')]),_0x1172e9[_0x1802('0x24')][_0x1802('0x29')]);logger['debug'](_0x1802('0x26'),_0x1172e9,JSON[_0x1802('0x13')](_0x3fa67d));_0x4e5211(_0x3fa67d);})['catch'](function(_0x39db94){logger[_0x1802('0x14')](_0x1802('0x26'),_0x39db94[_0x1802('0x15')],_0x1172e9);_0x4a6a87(_0x353fa0[_0x1802('0x14')](0x1f4,_0x39db94[_0x1802('0x15')]));});});};exports['DestroyCmHopper']=function(_0x404f59){var _0x462ad8=this;return new Promise(function(_0x1b9f0d,_0x105dea){return db['CmHopper']['destroy']({'where':_0x404f59[_0x1802('0x19')]?_0x404f59[_0x1802('0x19')]['where']||null:null})[_0x1802('0xe')](function(_0x5e774b){logger['info'](_0x1802('0x2a'),_0x404f59);logger[_0x1802('0x12')](_0x1802('0x2a'),_0x404f59,JSON['stringify'](_0x5e774b));_0x1b9f0d(_0x5e774b);})[_0x1802('0x22')](function(_0x2ebe26){logger[_0x1802('0x14')]('DestroyCmHopper',_0x2ebe26[_0x1802('0x15')],_0x404f59);_0x105dea(_0x462ad8['error'](0x1f4,_0x2ebe26[_0x1802('0x15')]));});});};exports[_0x1802('0x2b')]=function(_0x539888){var _0x50925a=this;return new Promise(function(_0x53bf84,_0x59d6a9){return db[_0x1802('0x2c')][_0x1802('0x2d')]()['then'](function(_0x128408){return db['sequelize'][_0x1802('0x2e')](function(_0x447fd3){return db['CmHopper'][_0x1802('0x18')]({'where':_0x539888[_0x1802('0x19')]?_0x539888[_0x1802('0x19')]['where']||null:null,'attributes':_0x539888[_0x1802('0x19')]?_0x539888['options'][_0x1802('0x1b')]||null:null,'limit':_0x539888[_0x1802('0x19')]?_0x539888[_0x1802('0x19')][_0x1802('0x1c')]||null:null,'order':_0x539888[_0x1802('0x19')]?_0x539888['options'][_0x1802('0x2f')]||null:null,'transaction':_0x447fd3,'lock':_0x447fd3['LOCK']['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x1802('0x30'),'attributes':_[_0x1802('0x31')](_0x128408)},{'model':db[_0x1802('0x32')],'as':'Agent','attributes':['id',_0x1802('0x33'),'voicePause']}]})[_0x1802('0xe')](function(_0xfb8928){var _0x5649f6=[];var _0x34c3d1=[];for(var _0x5a71d5=0x0;_0x5a71d5<_0xfb8928[_0x1802('0x34')];_0x5a71d5+=0x1){var _0xeff226=_0xfb8928[_0x5a71d5][_0x1802('0x35')];if(_0xeff226===null){_0x5649f6[_0x1802('0x36')](_0xfb8928[_0x5a71d5]['update'](_0x539888[_0x1802('0x24')],{'transaction':_0x447fd3}));}else if(!_0x34c3d1[_0x1802('0x37')](_0xeff226)){_0x34c3d1[_0x1802('0x36')](_0xeff226);_0x5649f6[_0x1802('0x36')](_0xfb8928[_0x5a71d5][_0x1802('0x27')](_0x539888['body'],{'transaction':_0x447fd3}));}}return BPromise[_0x1802('0x38')](_0x5649f6);});})[_0x1802('0xe')](function(_0x13aae5){logger[_0x1802('0xf')](_0x1802('0x2b'),_0x539888);if(_0x13aae5[_0x1802('0x34')]>0x0){logger['info'](_0x1802('0x39'),_0x13aae5[0x0][_0x1802('0x3a')]['id'],_0x13aae5[0x0][_0x1802('0x3a')][_0x1802('0x3b')],_0x13aae5[0x0][_0x1802('0x3a')][_0x1802('0x29')]);}logger[_0x1802('0x12')]('GetContactDialer',_0x539888,JSON[_0x1802('0x13')](_0x13aae5));_0x53bf84(_0x13aae5);})[_0x1802('0x22')](function(_0x37feea){logger[_0x1802('0x14')](_0x1802('0x2b'),_0x37feea[_0x1802('0x15')],_0x539888);_0x59d6a9(_0x50925a[_0x1802('0x14')](0x1f4,_0x37feea[_0x1802('0x15')]));});});});};exports['MoveContactManagedDialer']=function(_0x2c3424){var _0x12d64d=this;return new Promise(function(_0xfede58,_0x3a7f6f){return db[_0x1802('0x3c')][_0x1802('0x2e')](function(_0x9f3a7a){return db['CmHopperFinal']['create'](_0x2c3424[_0x1802('0x24')],{'raw':_0x2c3424[_0x1802('0x19')]?_0x2c3424['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x9f3a7a})[_0x1802('0xe')](function(){logger[_0x1802('0xf')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x1802('0x13')](_0x2c3424[_0x1802('0x19')][_0x1802('0x1a')]),_0x2c3424[_0x1802('0x19')][_0x1802('0x1a')]['active']);return db['CmHopper'][_0x1802('0x3d')]({'where':_0x2c3424[_0x1802('0x19')]?_0x2c3424[_0x1802('0x19')][_0x1802('0x1a')]||null:null,'transaction':_0x9f3a7a});});})[_0x1802('0xe')](function(_0x47b16f){logger[_0x1802('0xf')]('MoveContactManagedDialer',_0x2c3424);logger[_0x1802('0x12')](_0x1802('0x3e'),_0x2c3424,JSON[_0x1802('0x13')](_0x47b16f));_0xfede58(_0x47b16f);})[_0x1802('0x22')](function(_0x15c091){logger[_0x1802('0x14')](_0x1802('0x3e'),_0x15c091['message'],_0x2c3424);_0x3a7f6f(_0x12d64d[_0x1802('0x14')](0x1f4,_0x15c091[_0x1802('0x15')]));});});};exports[_0x1802('0x3f')]=function(_0x7f77a1){var _0x171cf2=this;return new Promise(function(_0x28958c,_0x1fb4ee){return db['CmHopper'][_0x1802('0x18')]({'raw':_0x7f77a1['options']?_0x7f77a1[_0x1802('0x19')][_0x1802('0x25')]===undefined?!![]:![]:!![],'where':_0x7f77a1[_0x1802('0x19')]?_0x7f77a1[_0x1802('0x19')][_0x1802('0x1a')]||null:null,'attributes':[[db[_0x1802('0x3c')]['fn'](_0x1802('0x40'),db['sequelize']['fn']('IF',db[_0x1802('0x3c')][_0x1802('0x41')](_0x1802('0x42')+util[_0x1802('0x43')](_0x1802('0x44'),moment()[_0x1802('0x43')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x1802('0x45')))),_0x1802('0x46')]]})['then'](function(_0x1970ad){logger[_0x1802('0xf')](_0x1802('0x3f'),_0x7f77a1);logger[_0x1802('0x12')](_0x1802('0x3f'),_0x7f77a1,JSON[_0x1802('0x13')](_0x1970ad));_0x28958c(_0x1970ad);})['catch'](function(_0x2bc98a){logger[_0x1802('0x14')](_0x1802('0x3f'),_0x2bc98a[_0x1802('0x15')],_0x7f77a1);_0x1fb4ee(_0x171cf2[_0x1802('0x14')](0x1f4,_0x2bc98a[_0x1802('0x15')]));});});};exports[_0x1802('0x47')]=function(_0x1fc5c5){var _0x36223d=this;return new Promise(function(_0x252232,_0x3217aa){return db[_0x1802('0x2c')][_0x1802('0x2d')]()[_0x1802('0xe')](function(_0x2ed061){return db[_0x1802('0x3c')][_0x1802('0x2e')](function(_0x4ef41c){return db['CmHopper'][_0x1802('0x18')]({'where':_0x1fc5c5[_0x1802('0x19')]?_0x1fc5c5[_0x1802('0x19')][_0x1802('0x1a')]||null:null,'attributes':_0x1fc5c5[_0x1802('0x19')]?_0x1fc5c5[_0x1802('0x19')][_0x1802('0x1b')]||null:null,'limit':0x1,'order':_0x1fc5c5[_0x1802('0x19')]?_0x1fc5c5['options'][_0x1802('0x2f')]||null:null,'group':db['CmHopper'][_0x1802('0x35')],'transaction':_0x4ef41c,'lock':_0x4ef41c[_0x1802('0x48')]['UPDATE'],'include':_0x1fc5c5[_0x1802('0x19')]?_0x1fc5c5[_0x1802('0x19')][_0x1802('0x1e')]?_['map'](_0x1fc5c5[_0x1802('0x19')]['include'],function(_0x1c0c59){return{'model':db[_0x1c0c59[_0x1802('0x1f')]],'as':_0x1c0c59['as'],'attributes':_0x1c0c59['attributes'],'include':_0x1c0c59[_0x1802('0x1e')]?_[_0x1802('0x1d')](_0x1c0c59[_0x1802('0x1e')],function(_0x400e84){return{'model':db[_0x400e84[_0x1802('0x1f')]],'as':_0x400e84['as'],'attributes':_0x400e84[_0x1802('0x1b')],'include':_0x400e84[_0x1802('0x1e')]?_[_0x1802('0x1d')](_0x400e84['include'],function(_0xa00e22){return{'model':db[_0xa00e22[_0x1802('0x1f')]],'as':_0xa00e22['as'],'attributes':_0xa00e22[_0x1802('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1802('0xe')](function(_0x586eb8){var _0x574eb6=[];for(var _0x149cd4=0x0;_0x149cd4<_0x586eb8[_0x1802('0x34')];_0x149cd4+=0x1){_0x574eb6[_0x1802('0x36')](_0x586eb8[_0x149cd4][_0x1802('0x27')](_0x1fc5c5[_0x1802('0x24')],{'transaction':_0x4ef41c}));}return BPromise[_0x1802('0x38')](_0x574eb6);});})[_0x1802('0xe')](function(_0x135099){logger['info'](_0x1802('0x47'),_0x1fc5c5);logger[_0x1802('0x12')]('GetContactRecallMe',_0x1fc5c5,JSON[_0x1802('0x13')](_0x135099));_0x252232(_0x135099);})['catch'](function(_0x412103){logger['error'](_0x1802('0x47'),_0x412103[_0x1802('0x15')],_0x1fc5c5);_0x3217aa(_0x36223d[_0x1802('0x14')](0x1f4,_0x412103[_0x1802('0x15')]));});});});};exports[_0x1802('0x49')]=function(_0x2f2d1a){var _0x35de71=this;return new Promise(function(_0x3ba7eb,_0x1ede0a){db[_0x1802('0x2c')][_0x1802('0x2d')]()[_0x1802('0xe')](function(_0x532571){return db[_0x1802('0x17')][_0x1802('0x18')]({'raw':_0x2f2d1a[_0x1802('0x19')]?_0x2f2d1a[_0x1802('0x19')][_0x1802('0x25')]===undefined?!![]:![]:!![],'where':_0x2f2d1a['options']?_0x2f2d1a[_0x1802('0x19')]['where']||null:null,'attributes':_0x2f2d1a[_0x1802('0x19')]?_0x2f2d1a[_0x1802('0x19')][_0x1802('0x1b')]||null:null,'limit':_0x2f2d1a[_0x1802('0x19')]?_0x2f2d1a[_0x1802('0x19')]['limit']||null:null,'include':_0x2f2d1a[_0x1802('0x19')]?_0x2f2d1a['options'][_0x1802('0x1e')]?_[_0x1802('0x1d')](_0x2f2d1a['options'][_0x1802('0x1e')],function(_0x853801){return{'model':db[_0x853801[_0x1802('0x1f')]],'as':_0x853801['as'],'attributes':_0x853801['as']===_0x1802('0x30')?_[_0x1802('0x31')](_0x532571):_0x853801[_0x1802('0x1b')],'include':_0x853801[_0x1802('0x1e')]?_[_0x1802('0x1d')](_0x853801[_0x1802('0x1e')],function(_0x3c5197){return{'model':db[_0x3c5197[_0x1802('0x1f')]],'as':_0x3c5197['as'],'attributes':_0x3c5197[_0x1802('0x1b')],'include':_0x3c5197[_0x1802('0x1e')]?_[_0x1802('0x1d')](_0x3c5197[_0x1802('0x1e')],function(_0x588e5f){return{'model':db[_0x588e5f[_0x1802('0x1f')]],'as':_0x588e5f['as'],'attributes':_0x588e5f[_0x1802('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1802('0xe')](function(_0x4483c8){logger[_0x1802('0xf')](_0x1802('0x16'),_0x2f2d1a);logger['debug'](_0x1802('0x16'),_0x2f2d1a,JSON[_0x1802('0x13')](_0x4483c8));_0x3ba7eb(_0x4483c8);})[_0x1802('0x22')](function(_0x350d58){logger[_0x1802('0x14')](_0x1802('0x16'),_0x350d58[_0x1802('0x15')],_0x2f2d1a);_0x1ede0a(_0x35de71['error'](0x1f4,_0x350d58[_0x1802('0x15')]));});});});};exports[_0x1802('0x4a')]=function(_0x240dc9){var _0x3c847b=this;return new Promise(function(_0x1131bf,_0x431c69){return db[_0x1802('0x3c')][_0x1802('0x2e')](function(_0x46f577){return db[_0x1802('0x17')][_0x1802('0x27')]({'active':![]},{'where':{},'transaction':_0x46f577})['then'](function(_0x1a73e8){logger[_0x1802('0xf')]('ResetActiveCalls',_0x240dc9);logger['debug'](_0x1802('0x4a'),_0x240dc9,JSON[_0x1802('0x13')](_0x1a73e8));_0x1131bf(_0x1a73e8);})[_0x1802('0x22')](function(_0x257181){logger[_0x1802('0x14')](_0x1802('0x4a'),_0x257181[_0x1802('0x15')],_0x240dc9);_0x431c69(_0x3c847b[_0x1802('0x14')](0x1f4,_0x257181[_0x1802('0x15')]));});});});};exports[_0x1802('0x4b')]=function(_0x35c94c){var _0x23238e=this;var _0x4546f8=_0x35c94c[_0x1802('0x24')][_0x1802('0x1a')][_0x1802('0x4c')];var _0x2c0ef4=_0x35c94c[_0x1802('0x24')][_0x1802('0x1a')]['interval'];return new Promise(function(_0x163794,_0x36b4f8){return db[_0x1802('0x17')][_0x1802('0x18')]({'where':{'voiceQueueId':_0x4546f8,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0x1802('0x41')](_0x1802('0x4d')+_0x2c0ef4+_0x1802('0x4e'))}},'include':[{'model':db[_0x1802('0x2c')],'as':'Contact'},{'model':db['User'],'as':_0x1802('0x4f'),'attributes':['id',_0x1802('0x33'),_0x1802('0x50')]},{'model':db[_0x1802('0x51')],'as':'List'}]})['then'](function(_0x31b67a){return db[_0x1802('0x3c')][_0x1802('0x2e')](function(_0x142127){return db['CmHopper']['update']({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x4546f8,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x1802('0x3c')][_0x1802('0x41')](_0x1802('0x4d')+_0x2c0ef4+_0x1802('0x4e'))}},'transaction':_0x142127})[_0x1802('0xe')](function(_0x19fb18){_0x163794(_0x31b67a);})[_0x1802('0x22')](function(_0x17a434){logger['error'](_0x1802('0x4b'),_0x17a434[_0x1802('0x15')],_0x35c94c);_0x36b4f8(validateExpressRequest);});});})[_0x1802('0x22')](function(_0x512944){logger[_0x1802('0x14')](_0x1802('0x4b'),_0x512944['message'],_0x35c94c);_0x36b4f8(_0x23238e[_0x1802('0x14')](0x1f4,_0x512944['message']));});});}; \ No newline at end of file +var _0x85e5=['UPDATE','CmContact','Contact','keys','User','name','length','UserId','push','update','body','includes','all','dataValues','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','LOCK','GetContactRecallMe','GetCmHopperPreview','describe','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','Agent','voicePause','CmList','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','client','then','info','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','GetCmHopper','findAll','raw','options','attributes','model','include','map','ShowCmHopper','find','where','catch','CreateCmHopper','UpdateCmHopper','CmHopper','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','sequelize','transaction','order'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x85e5,0x1ca));var _0x585e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x85e5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x585e('0x0'));var util=require(_0x585e('0x1'));var moment=require(_0x585e('0x2'));var BPromise=require(_0x585e('0x3'));var rs=require(_0x585e('0x4'));var fs=require('fs');var Redis=require(_0x585e('0x5'));var db=require(_0x585e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x585e('0x7'));var config=require(_0x585e('0x8'));var jayson=require(_0x585e('0x9'));const {validateExpressRequest}=require(_0x585e('0xa'));var client=jayson[_0x585e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e9705,_0x57acbc,_0xe251e2){return new BPromise(function(_0x274d9c,_0x5b4d1c){return client['request'](_0x2e9705,_0xe251e2)[_0x585e('0xc')](function(_0x1a8b6c){logger[_0x585e('0xd')]('CmHopper,\x20%s,\x20%s',_0x57acbc,_0x585e('0xe'));logger[_0x585e('0xf')](_0x585e('0x10'),_0x57acbc,'request\x20sent',JSON[_0x585e('0x11')](_0x1a8b6c));if(_0x1a8b6c[_0x585e('0x12')]){if(_0x1a8b6c[_0x585e('0x12')][_0x585e('0x13')]===0x1f4){logger['error'](_0x585e('0x14'),_0x57acbc,_0x1a8b6c[_0x585e('0x12')][_0x585e('0x15')]);return _0x5b4d1c(_0x1a8b6c[_0x585e('0x12')][_0x585e('0x15')]);}logger['error'](_0x585e('0x14'),_0x57acbc,_0x1a8b6c[_0x585e('0x12')][_0x585e('0x15')]);return _0x274d9c(_0x1a8b6c['error'][_0x585e('0x15')]);}else{logger[_0x585e('0xd')]('CmHopper,\x20%s,\x20%s',_0x57acbc,_0x585e('0xe'));_0x274d9c(_0x1a8b6c['result']['message']);}})['catch'](function(_0x376880){logger[_0x585e('0x12')](_0x585e('0x14'),_0x57acbc,_0x376880);_0x5b4d1c(_0x376880);});});}exports[_0x585e('0x16')]=function(_0xcaf7d9){var _0x1e90bc=this;return new Promise(function(_0x5dffcb,_0x3e81ab){return db['CmHopper'][_0x585e('0x17')]({'raw':_0xcaf7d9['options']?_0xcaf7d9['options'][_0x585e('0x18')]===undefined?!![]:![]:!![],'where':_0xcaf7d9[_0x585e('0x19')]?_0xcaf7d9['options']['where']||null:null,'attributes':_0xcaf7d9[_0x585e('0x19')]?_0xcaf7d9[_0x585e('0x19')][_0x585e('0x1a')]||null:null,'limit':_0xcaf7d9[_0x585e('0x19')]?_0xcaf7d9[_0x585e('0x19')]['limit']||null:null,'include':_0xcaf7d9['options']?_0xcaf7d9[_0x585e('0x19')]['include']?_['map'](_0xcaf7d9['options']['include'],function(_0x3851fb){return{'model':db[_0x3851fb[_0x585e('0x1b')]],'as':_0x3851fb['as'],'attributes':_0x3851fb[_0x585e('0x1a')],'include':_0x3851fb[_0x585e('0x1c')]?_['map'](_0x3851fb[_0x585e('0x1c')],function(_0x5d1643){return{'model':db[_0x5d1643[_0x585e('0x1b')]],'as':_0x5d1643['as'],'attributes':_0x5d1643[_0x585e('0x1a')],'include':_0x5d1643['include']?_[_0x585e('0x1d')](_0x5d1643['include'],function(_0x40b6d5){return{'model':db[_0x40b6d5[_0x585e('0x1b')]],'as':_0x40b6d5['as'],'attributes':_0x40b6d5[_0x585e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x585e('0xc')](function(_0x4da930){logger[_0x585e('0xd')]('GetCmHopper',_0xcaf7d9);logger[_0x585e('0xf')](_0x585e('0x16'),_0xcaf7d9,JSON['stringify'](_0x4da930));_0x5dffcb(_0x4da930);})['catch'](function(_0x44b81f){logger[_0x585e('0x12')](_0x585e('0x16'),_0x44b81f[_0x585e('0x15')],_0xcaf7d9);_0x3e81ab(_0x1e90bc['error'](0x1f4,_0x44b81f[_0x585e('0x15')]));});});};exports[_0x585e('0x1e')]=function(_0x5c0e9a){var _0x386a3a=this;return new Promise(function(_0x506bc1,_0x376eaa){return db['CmHopper'][_0x585e('0x1f')]({'raw':_0x5c0e9a[_0x585e('0x19')]?_0x5c0e9a[_0x585e('0x19')][_0x585e('0x18')]===undefined?!![]:![]:!![],'where':_0x5c0e9a[_0x585e('0x19')]?_0x5c0e9a[_0x585e('0x19')][_0x585e('0x20')]||null:null,'attributes':_0x5c0e9a[_0x585e('0x19')]?_0x5c0e9a[_0x585e('0x19')]['attributes']||null:null,'include':_0x5c0e9a[_0x585e('0x19')]?_0x5c0e9a[_0x585e('0x19')][_0x585e('0x1c')]?_[_0x585e('0x1d')](_0x5c0e9a[_0x585e('0x19')]['include'],function(_0x5813e9){return{'model':db[_0x5813e9[_0x585e('0x1b')]],'as':_0x5813e9['as'],'attributes':_0x5813e9[_0x585e('0x1a')],'include':_0x5813e9['include']?_[_0x585e('0x1d')](_0x5813e9['include'],function(_0x3e7633){return{'model':db[_0x3e7633[_0x585e('0x1b')]],'as':_0x3e7633['as'],'attributes':_0x3e7633[_0x585e('0x1a')],'include':_0x3e7633['include']?_[_0x585e('0x1d')](_0x3e7633[_0x585e('0x1c')],function(_0x46c787){return{'model':db[_0x46c787['model']],'as':_0x46c787['as'],'attributes':_0x46c787[_0x585e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x585e('0xc')](function(_0x59bb3f){logger['info'](_0x585e('0x1e'),_0x5c0e9a);logger['debug'](_0x585e('0x1e'),_0x5c0e9a,JSON['stringify'](_0x59bb3f));_0x506bc1(_0x59bb3f);})[_0x585e('0x21')](function(_0x2c4672){logger[_0x585e('0x12')]('ShowCmHopper',_0x2c4672['message'],_0x5c0e9a);_0x376eaa(_0x386a3a['error'](0x1f4,_0x2c4672['message']));});});};exports[_0x585e('0x22')]=function(_0x905545){var _0x43c4cf=this;return new Promise(function(_0x2a7fd8,_0xe070f){return db['CmHopper']['create'](_0x905545['body'],{'raw':_0x905545[_0x585e('0x19')]?_0x905545[_0x585e('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x585e('0xc')](function(_0x4bf0e8){logger[_0x585e('0xd')](_0x585e('0x22'),_0x905545);logger['debug'](_0x585e('0x22'),_0x905545,JSON[_0x585e('0x11')](_0x4bf0e8));_0x2a7fd8(_0x4bf0e8);})[_0x585e('0x21')](function(_0x346fbe){logger[_0x585e('0x12')](_0x585e('0x22'),_0x346fbe[_0x585e('0x15')],_0x905545);_0xe070f(_0x43c4cf[_0x585e('0x12')](0x1f4,_0x346fbe[_0x585e('0x15')]));});});};exports[_0x585e('0x23')]=function(_0x80775a){var _0x18f8e2=this;return new Promise(function(_0x1d930b,_0x5308de){return db[_0x585e('0x24')]['update'](_0x80775a['body'],{'raw':_0x80775a['options']?_0x80775a[_0x585e('0x19')][_0x585e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x80775a[_0x585e('0x19')]?_0x80775a[_0x585e('0x19')][_0x585e('0x20')]||null:null,'attributes':_0x80775a[_0x585e('0x19')]?_0x80775a[_0x585e('0x19')][_0x585e('0x1a')]||null:null,'limit':_0x80775a[_0x585e('0x19')]?_0x80775a['options'][_0x585e('0x25')]||null:null})[_0x585e('0xc')](function(_0x6560e3){logger[_0x585e('0xd')](_0x585e('0x23'),_0x80775a);logger[_0x585e('0xd')](_0x585e('0x26'),JSON[_0x585e('0x11')](_0x80775a[_0x585e('0x19')][_0x585e('0x20')]),_0x80775a['body'][_0x585e('0x27')]);logger[_0x585e('0xf')](_0x585e('0x23'),_0x80775a,JSON[_0x585e('0x11')](_0x6560e3));_0x1d930b(_0x6560e3);})[_0x585e('0x21')](function(_0x4611ef){logger[_0x585e('0x12')](_0x585e('0x23'),_0x4611ef[_0x585e('0x15')],_0x80775a);_0x5308de(_0x18f8e2['error'](0x1f4,_0x4611ef[_0x585e('0x15')]));});});};exports[_0x585e('0x28')]=function(_0x28bc30){var _0xc00725=this;return new Promise(function(_0x4936c9,_0x255ba2){return db[_0x585e('0x24')][_0x585e('0x29')]({'where':_0x28bc30[_0x585e('0x19')]?_0x28bc30[_0x585e('0x19')][_0x585e('0x20')]||null:null})[_0x585e('0xc')](function(_0x242349){logger[_0x585e('0xd')]('DestroyCmHopper',_0x28bc30);logger['debug'](_0x585e('0x28'),_0x28bc30,JSON[_0x585e('0x11')](_0x242349));_0x4936c9(_0x242349);})[_0x585e('0x21')](function(_0x5da648){logger[_0x585e('0x12')](_0x585e('0x28'),_0x5da648['message'],_0x28bc30);_0x255ba2(_0xc00725['error'](0x1f4,_0x5da648['message']));});});};exports[_0x585e('0x2a')]=function(_0x403710){var _0x195dd4=this;return new Promise(function(_0x1d9eeb,_0x38de88){return db['CmContact']['describe']()[_0x585e('0xc')](function(_0x581f79){return db[_0x585e('0x2b')][_0x585e('0x2c')](function(_0x150c4e){return db[_0x585e('0x24')][_0x585e('0x17')]({'where':_0x403710[_0x585e('0x19')]?_0x403710[_0x585e('0x19')][_0x585e('0x20')]||null:null,'attributes':_0x403710[_0x585e('0x19')]?_0x403710[_0x585e('0x19')]['attributes']||null:null,'limit':_0x403710[_0x585e('0x19')]?_0x403710[_0x585e('0x19')]['limit']||null:null,'order':_0x403710[_0x585e('0x19')]?_0x403710['options'][_0x585e('0x2d')]||null:null,'transaction':_0x150c4e,'lock':_0x150c4e['LOCK'][_0x585e('0x2e')],'include':[{'model':db[_0x585e('0x2f')],'as':_0x585e('0x30'),'attributes':_[_0x585e('0x31')](_0x581f79)},{'model':db[_0x585e('0x32')],'as':'Agent','attributes':['id',_0x585e('0x33'),'voicePause']}]})[_0x585e('0xc')](function(_0x11927d){var _0x144053=[];var _0x369d4a=[];for(var _0x4ff78b=0x0;_0x4ff78b<_0x11927d[_0x585e('0x34')];_0x4ff78b+=0x1){var _0x108633=_0x11927d[_0x4ff78b][_0x585e('0x35')];if(_0x108633===null){_0x144053[_0x585e('0x36')](_0x11927d[_0x4ff78b][_0x585e('0x37')](_0x403710[_0x585e('0x38')],{'transaction':_0x150c4e}));}else if(!_0x369d4a[_0x585e('0x39')](_0x108633)){_0x369d4a[_0x585e('0x36')](_0x108633);_0x144053[_0x585e('0x36')](_0x11927d[_0x4ff78b]['update'](_0x403710[_0x585e('0x38')],{'transaction':_0x150c4e}));}}return BPromise[_0x585e('0x3a')](_0x144053);});})[_0x585e('0xc')](function(_0x1e6f20){logger[_0x585e('0xd')](_0x585e('0x2a'),_0x403710);if(_0x1e6f20[_0x585e('0x34')]>0x0){logger[_0x585e('0xd')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x1e6f20[0x0][_0x585e('0x3b')]['id'],_0x1e6f20[0x0]['dataValues']['ContactId'],_0x1e6f20[0x0][_0x585e('0x3b')][_0x585e('0x27')]);}logger[_0x585e('0xf')]('GetContactDialer',_0x403710,JSON[_0x585e('0x11')](_0x1e6f20));_0x1d9eeb(_0x1e6f20);})[_0x585e('0x21')](function(_0x20dfa5){logger[_0x585e('0x12')]('GetContactDialer',_0x20dfa5['message'],_0x403710);_0x38de88(_0x195dd4[_0x585e('0x12')](0x1f4,_0x20dfa5[_0x585e('0x15')]));});});});};exports['MoveContactManagedDialer']=function(_0x50efd4){var _0x13e0d6=this;return new Promise(function(_0x37d619,_0x399ae2){return db[_0x585e('0x2b')]['transaction'](function(_0x1d7649){return db[_0x585e('0x3c')][_0x585e('0x3d')](_0x50efd4['body'],{'raw':_0x50efd4[_0x585e('0x19')]?_0x50efd4[_0x585e('0x19')]['raw']===undefined?!![]:![]:!![],'transaction':_0x1d7649})[_0x585e('0xc')](function(){logger['info'](_0x585e('0x3e'),JSON[_0x585e('0x11')](_0x50efd4[_0x585e('0x19')][_0x585e('0x20')]),_0x50efd4[_0x585e('0x19')][_0x585e('0x20')]['active']);return db['CmHopper']['destroy']({'where':_0x50efd4['options']?_0x50efd4['options']['where']||null:null,'transaction':_0x1d7649});});})[_0x585e('0xc')](function(_0x66b458){logger[_0x585e('0xd')](_0x585e('0x3f'),_0x50efd4);logger['debug'](_0x585e('0x3f'),_0x50efd4,JSON[_0x585e('0x11')](_0x66b458));_0x37d619(_0x66b458);})[_0x585e('0x21')](function(_0x3f9d00){logger[_0x585e('0x12')](_0x585e('0x3f'),_0x3f9d00[_0x585e('0x15')],_0x50efd4);_0x399ae2(_0x13e0d6['error'](0x1f4,_0x3f9d00[_0x585e('0x15')]));});});};exports[_0x585e('0x40')]=function(_0x31ec8e){var _0x3bc738=this;return new Promise(function(_0x2b9326,_0x3dafcc){return db[_0x585e('0x24')][_0x585e('0x17')]({'raw':_0x31ec8e[_0x585e('0x19')]?_0x31ec8e[_0x585e('0x19')][_0x585e('0x18')]===undefined?!![]:![]:!![],'where':_0x31ec8e[_0x585e('0x19')]?_0x31ec8e['options'][_0x585e('0x20')]||null:null,'attributes':[[db[_0x585e('0x2b')]['fn'](_0x585e('0x41'),db['sequelize']['fn']('IF',db[_0x585e('0x2b')][_0x585e('0x42')](_0x585e('0x43')+util[_0x585e('0x44')](_0x585e('0x45'),moment()[_0x585e('0x44')](_0x585e('0x46')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})['then'](function(_0x13c32b){logger[_0x585e('0xd')]('CountReScheduled',_0x31ec8e);logger['debug'](_0x585e('0x40'),_0x31ec8e,JSON[_0x585e('0x11')](_0x13c32b));_0x2b9326(_0x13c32b);})[_0x585e('0x21')](function(_0x131f1e){logger[_0x585e('0x12')](_0x585e('0x40'),_0x131f1e[_0x585e('0x15')],_0x31ec8e);_0x3dafcc(_0x3bc738[_0x585e('0x12')](0x1f4,_0x131f1e['message']));});});};exports['GetContactRecallMe']=function(_0x5090dc){var _0x4f61da=this;return new Promise(function(_0x41a837,_0x557671){return db[_0x585e('0x2f')]['describe']()[_0x585e('0xc')](function(_0x56cd33){return db[_0x585e('0x2b')][_0x585e('0x2c')](function(_0x139a82){return db[_0x585e('0x24')][_0x585e('0x17')]({'where':_0x5090dc[_0x585e('0x19')]?_0x5090dc['options'][_0x585e('0x20')]||null:null,'attributes':_0x5090dc[_0x585e('0x19')]?_0x5090dc['options'][_0x585e('0x1a')]||null:null,'limit':0x1,'order':_0x5090dc[_0x585e('0x19')]?_0x5090dc[_0x585e('0x19')][_0x585e('0x2d')]||null:null,'group':db[_0x585e('0x24')][_0x585e('0x35')],'transaction':_0x139a82,'lock':_0x139a82[_0x585e('0x47')][_0x585e('0x2e')],'include':_0x5090dc[_0x585e('0x19')]?_0x5090dc[_0x585e('0x19')][_0x585e('0x1c')]?_[_0x585e('0x1d')](_0x5090dc[_0x585e('0x19')][_0x585e('0x1c')],function(_0x4d739f){return{'model':db[_0x4d739f[_0x585e('0x1b')]],'as':_0x4d739f['as'],'attributes':_0x4d739f[_0x585e('0x1a')],'include':_0x4d739f[_0x585e('0x1c')]?_[_0x585e('0x1d')](_0x4d739f[_0x585e('0x1c')],function(_0xc61c1d){return{'model':db[_0xc61c1d['model']],'as':_0xc61c1d['as'],'attributes':_0xc61c1d['attributes'],'include':_0xc61c1d[_0x585e('0x1c')]?_[_0x585e('0x1d')](_0xc61c1d[_0x585e('0x1c')],function(_0x1757fa){return{'model':db[_0x1757fa[_0x585e('0x1b')]],'as':_0x1757fa['as'],'attributes':_0x1757fa[_0x585e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x585e('0xc')](function(_0x3ce2a1){var _0xed4355=[];for(var _0x292c34=0x0;_0x292c34<_0x3ce2a1[_0x585e('0x34')];_0x292c34+=0x1){_0xed4355[_0x585e('0x36')](_0x3ce2a1[_0x292c34][_0x585e('0x37')](_0x5090dc['body'],{'transaction':_0x139a82}));}return BPromise['all'](_0xed4355);});})[_0x585e('0xc')](function(_0x12775d){logger[_0x585e('0xd')]('GetContactRecallMe',_0x5090dc);logger[_0x585e('0xf')]('GetContactRecallMe',_0x5090dc,JSON[_0x585e('0x11')](_0x12775d));_0x41a837(_0x12775d);})[_0x585e('0x21')](function(_0x34adb3){logger[_0x585e('0x12')](_0x585e('0x48'),_0x34adb3[_0x585e('0x15')],_0x5090dc);_0x557671(_0x4f61da[_0x585e('0x12')](0x1f4,_0x34adb3[_0x585e('0x15')]));});});});};exports[_0x585e('0x49')]=function(_0x3464e3){var _0x67ab0f=this;return new Promise(function(_0xffb785,_0x1f6a47){db[_0x585e('0x2f')][_0x585e('0x4a')]()[_0x585e('0xc')](function(_0x302b99){return db[_0x585e('0x24')]['findAll']({'raw':_0x3464e3[_0x585e('0x19')]?_0x3464e3[_0x585e('0x19')][_0x585e('0x18')]===undefined?!![]:![]:!![],'where':_0x3464e3[_0x585e('0x19')]?_0x3464e3[_0x585e('0x19')][_0x585e('0x20')]||null:null,'attributes':_0x3464e3[_0x585e('0x19')]?_0x3464e3['options'][_0x585e('0x1a')]||null:null,'limit':_0x3464e3[_0x585e('0x19')]?_0x3464e3[_0x585e('0x19')][_0x585e('0x25')]||null:null,'include':_0x3464e3['options']?_0x3464e3[_0x585e('0x19')][_0x585e('0x1c')]?_[_0x585e('0x1d')](_0x3464e3[_0x585e('0x19')]['include'],function(_0xf5a261){return{'model':db[_0xf5a261[_0x585e('0x1b')]],'as':_0xf5a261['as'],'attributes':_0xf5a261['as']===_0x585e('0x30')?_[_0x585e('0x31')](_0x302b99):_0xf5a261['attributes'],'include':_0xf5a261[_0x585e('0x1c')]?_[_0x585e('0x1d')](_0xf5a261[_0x585e('0x1c')],function(_0x5e9b88){return{'model':db[_0x5e9b88['model']],'as':_0x5e9b88['as'],'attributes':_0x5e9b88[_0x585e('0x1a')],'include':_0x5e9b88[_0x585e('0x1c')]?_[_0x585e('0x1d')](_0x5e9b88['include'],function(_0x2a88a7){return{'model':db[_0x2a88a7[_0x585e('0x1b')]],'as':_0x2a88a7['as'],'attributes':_0x2a88a7[_0x585e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x585e('0xc')](function(_0x38868c){logger['info'](_0x585e('0x16'),_0x3464e3);logger[_0x585e('0xf')](_0x585e('0x16'),_0x3464e3,JSON[_0x585e('0x11')](_0x38868c));_0xffb785(_0x38868c);})[_0x585e('0x21')](function(_0x3b1e96){logger['error'](_0x585e('0x16'),_0x3b1e96['message'],_0x3464e3);_0x1f6a47(_0x67ab0f[_0x585e('0x12')](0x1f4,_0x3b1e96[_0x585e('0x15')]));});});});};exports['ResetActiveCalls']=function(_0x2d1ee6){var _0x10c722=this;return new Promise(function(_0x54a548,_0x510f47){return db[_0x585e('0x2b')][_0x585e('0x2c')](function(_0x33e42c){return db['CmHopper'][_0x585e('0x37')]({'active':![]},{'where':{},'transaction':_0x33e42c})[_0x585e('0xc')](function(_0x2c3db1){logger['info'](_0x585e('0x4b'),_0x2d1ee6);logger['debug'](_0x585e('0x4b'),_0x2d1ee6,JSON['stringify'](_0x2c3db1));_0x54a548(_0x2c3db1);})[_0x585e('0x21')](function(_0x57e872){logger['error']('ResetActiveCalls',_0x57e872[_0x585e('0x15')],_0x2d1ee6);_0x510f47(_0x10c722['error'](0x1f4,_0x57e872[_0x585e('0x15')]));});});});};exports[_0x585e('0x4c')]=function(_0x3980a1){var _0x31ad08=this;var _0x176736=_0x3980a1[_0x585e('0x38')][_0x585e('0x20')][_0x585e('0x4d')];var _0x1fc43b=_0x3980a1['body'][_0x585e('0x20')][_0x585e('0x4e')];return new Promise(function(_0xdbfe52,_0x1963a0){return db[_0x585e('0x24')]['findAll']({'where':{'voiceQueueId':_0x176736,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0x585e('0x42')](_0x585e('0x4f')+_0x1fc43b+_0x585e('0x50'))}},'include':[{'model':db[_0x585e('0x2f')],'as':_0x585e('0x30')},{'model':db['User'],'as':_0x585e('0x51'),'attributes':['id',_0x585e('0x33'),_0x585e('0x52')]},{'model':db[_0x585e('0x53')],'as':'List'}]})['then'](function(_0x4042a3){return db[_0x585e('0x2b')][_0x585e('0x2c')](function(_0x6b3d07){return db[_0x585e('0x24')]['update']({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x176736,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x585e('0x2b')]['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x1fc43b+'\x20MINUTE')}},'transaction':_0x6b3d07})[_0x585e('0xc')](function(_0x432e47){_0xdbfe52(_0x4042a3);})['catch'](function(_0x417760){logger[_0x585e('0x12')](_0x585e('0x4c'),_0x417760[_0x585e('0x15')],_0x3980a1);_0x1963a0(validateExpressRequest);});});})[_0x585e('0x21')](function(_0x359323){logger[_0x585e('0x12')]('CmHopperHandlePreviewRecallNotifications',_0x359323[_0x585e('0x15')],_0x3980a1);_0x1963a0(_0x31ad08['error'](0x1f4,_0x359323['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index d9afe90..f5ae2e4 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 _0x3f10=['getPreviewRecall','update','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/:id','show','post','create','/preview','getPreview','/previewrecall'];(function(_0x3fce4e,_0x18e429){var _0x393360=function(_0x339ecc){while(--_0x339ecc){_0x3fce4e['push'](_0x3fce4e['shift']());}};_0x393360(++_0x18e429);}(_0x3f10,0x1de));var _0x03f1=function(_0x15fc2f,_0x2804bd){_0x15fc2f=_0x15fc2f-0x0;var _0x1748ea=_0x3f10[_0x15fc2f];return _0x1748ea;};'use strict';var multer=require(_0x03f1('0x0'));var util=require(_0x03f1('0x1'));var path=require('path');var timeout=require(_0x03f1('0x2'));var express=require(_0x03f1('0x3'));var router=express['Router']();var fs_extra=require(_0x03f1('0x4'));var auth=require(_0x03f1('0x5'));var interaction=require(_0x03f1('0x6'));var config=require('../../config/environment');var controller=require(_0x03f1('0x7'));router[_0x03f1('0x8')]('/',auth['isAuthenticated'](),controller[_0x03f1('0x9')]);router[_0x03f1('0x8')](_0x03f1('0xa'),auth[_0x03f1('0xb')](),controller[_0x03f1('0xc')]);router[_0x03f1('0x8')](_0x03f1('0xd'),auth[_0x03f1('0xb')](),controller[_0x03f1('0xe')]);router[_0x03f1('0x8')](_0x03f1('0xf'),auth[_0x03f1('0xb')](),controller[_0x03f1('0x10')]);router[_0x03f1('0x11')]('/',auth[_0x03f1('0xb')](),controller[_0x03f1('0x12')]);router[_0x03f1('0x11')](_0x03f1('0x13'),auth[_0x03f1('0xb')](),controller[_0x03f1('0x14')]);router[_0x03f1('0x11')](_0x03f1('0x15'),auth[_0x03f1('0xb')](),controller[_0x03f1('0x16')]);router['put']('/:id',auth[_0x03f1('0xb')](),controller[_0x03f1('0x17')]);router['delete']('/:id',auth[_0x03f1('0xb')](),controller['destroy']);module[_0x03f1('0x18')]=router; \ No newline at end of file +var _0xa7d2=['index','/describe','isAuthenticated','getOpenContacts','show','post','/preview','getPreview','/previewrecall','getPreviewRecall','/:id','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get'];(function(_0x2debb5,_0x250a12){var _0x1739c9=function(_0x54d408){while(--_0x54d408){_0x2debb5['push'](_0x2debb5['shift']());}};_0x1739c9(++_0x250a12);}(_0xa7d2,0xbd));var _0x2a7d=function(_0x31d2d4,_0x2f2d42){_0x31d2d4=_0x31d2d4-0x0;var _0x223771=_0xa7d2[_0x31d2d4];return _0x223771;};'use strict';var multer=require(_0x2a7d('0x0'));var util=require(_0x2a7d('0x1'));var path=require(_0x2a7d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2a7d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2a7d('0x4'));var interaction=require(_0x2a7d('0x5'));var config=require(_0x2a7d('0x6'));var controller=require(_0x2a7d('0x7'));router[_0x2a7d('0x8')]('/',auth['isAuthenticated'](),controller[_0x2a7d('0x9')]);router[_0x2a7d('0x8')](_0x2a7d('0xa'),auth[_0x2a7d('0xb')](),controller['describe']);router[_0x2a7d('0x8')]('/opencontacts',auth['isAuthenticated'](),controller[_0x2a7d('0xc')]);router[_0x2a7d('0x8')]('/:id',auth[_0x2a7d('0xb')](),controller[_0x2a7d('0xd')]);router[_0x2a7d('0xe')]('/',auth[_0x2a7d('0xb')](),controller['create']);router[_0x2a7d('0xe')](_0x2a7d('0xf'),auth[_0x2a7d('0xb')](),controller[_0x2a7d('0x10')]);router['post'](_0x2a7d('0x11'),auth[_0x2a7d('0xb')](),controller[_0x2a7d('0x12')]);router['put'](_0x2a7d('0x13'),auth[_0x2a7d('0xb')](),controller['update']);router[_0x2a7d('0x14')](_0x2a7d('0x13'),auth[_0x2a7d('0xb')](),controller[_0x2a7d('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index f5845dc..44deea8 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 _0xcbef=['INTEGER','contactListQueue','sequelize','exports'];(function(_0x495054,_0x304104){var _0x146d2e=function(_0x350426){while(--_0x350426){_0x495054['push'](_0x495054['shift']());}};_0x146d2e(++_0x304104);}(_0xcbef,0x11a));var _0xfcbe=function(_0x387c2e,_0x1bc867){_0x387c2e=_0x387c2e-0x0;var _0x8987e1=_0xcbef[_0x387c2e];return _0x8987e1;};'use strict';var moment=require('moment');var Sequelize=require(_0xfcbe('0x0'));module[_0xfcbe('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xfcbe('0x2')],'unique':_0xfcbe('0x3')},'ListId':{'type':Sequelize[_0xfcbe('0x2')],'unique':_0xfcbe('0x3')},'VoiceQueueId':{'type':Sequelize[_0xfcbe('0x2')],'unique':_0xfcbe('0x3')}}; \ No newline at end of file +var _0xb073=['STRING','INTEGER','contactListQueue','sequelize'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xb073,0x187));var _0x3b07=function(_0x35981b,_0x11809a){_0x35981b=_0x35981b-0x0;var _0x350e7e=_0xb073[_0x35981b];return _0x350e7e;};'use strict';var moment=require('moment');var Sequelize=require(_0x3b07('0x0'));module['exports']={'phone':{'type':Sequelize[_0x3b07('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x3b07('0x2')],'unique':_0x3b07('0x3')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x3b07('0x3')},'VoiceQueueId':{'type':Sequelize[_0x3b07('0x2')],'unique':_0x3b07('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 38f0671..664f59e 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 _0xa6d2=['rimraf','zip-dir','fast-json-patch','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','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','reject','save','update','then','destroy','sendStatus','error','stack','name','index','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filter','where','merge','map','options','includeAll','include','findAll','catch','show','params','find','body','eml-format'];(function(_0xdf8fd8,_0x259499){var _0xf54e9b=function(_0x5e0492){while(--_0x5e0492){_0xdf8fd8['push'](_0xdf8fd8['shift']());}};_0xf54e9b(++_0x259499);}(_0xa6d2,0x11f));var _0x2a6d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa6d2[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x2a6d('0x0'));var rimraf=require(_0x2a6d('0x1'));var zipdir=require(_0x2a6d('0x2'));var jsonpatch=require(_0x2a6d('0x3'));var rp=require('request-promise');var moment=require(_0x2a6d('0x4'));var BPromise=require(_0x2a6d('0x5'));var Mustache=require(_0x2a6d('0x6'));var util=require(_0x2a6d('0x7'));var path=require(_0x2a6d('0x8'));var sox=require('sox');var csv=require(_0x2a6d('0x9'));var ejs=require(_0x2a6d('0xa'));var fs=require('fs');var fs_extra=require(_0x2a6d('0xb'));var _=require(_0x2a6d('0xc'));var squel=require(_0x2a6d('0xd'));var crypto=require(_0x2a6d('0xe'));var jsforce=require(_0x2a6d('0xf'));var deskjs=require(_0x2a6d('0x10'));var toCsv=require(_0x2a6d('0x9'));var querystring=require(_0x2a6d('0x11'));var Papa=require(_0x2a6d('0x12'));var Redis=require('ioredis');var authService=require(_0x2a6d('0x13'));var qs=require(_0x2a6d('0x14'));var as=require(_0x2a6d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2a6d('0x16'));var licenseUtil=require(_0x2a6d('0x17'));var db=require(_0x2a6d('0x18'))['db'];function respondWithStatusCode(_0x172b19,_0x251a8e){_0x251a8e=_0x251a8e||0xcc;return function(_0x6f5cf2){if(_0x6f5cf2){return _0x172b19['sendStatus'](_0x251a8e);}return _0x172b19[_0x2a6d('0x19')](_0x251a8e)[_0x2a6d('0x1a')]();};}function respondWithResult(_0x123061,_0x2addd3){_0x2addd3=_0x2addd3||0xc8;return function(_0x29362d){if(_0x29362d){return _0x123061[_0x2a6d('0x19')](_0x2addd3)[_0x2a6d('0x1b')](_0x29362d);}};}function respondWithFilteredResult(_0x377b63,_0x46af7d){return function(_0x5704ac){if(_0x5704ac){var _0xb40c71=typeof _0x46af7d['offset']===_0x2a6d('0x1c')&&typeof _0x46af7d[_0x2a6d('0x1d')]===_0x2a6d('0x1c');var _0x1c211d=_0x5704ac[_0x2a6d('0x1e')];var _0x490c95=_0xb40c71?0x0:_0x46af7d['offset'];var _0x4616dc=_0xb40c71?_0x5704ac[_0x2a6d('0x1e')]:_0x46af7d['offset']+_0x46af7d['limit'];var _0x3e0a40;if(_0x4616dc>=_0x1c211d){_0x4616dc=_0x1c211d;_0x3e0a40=0xc8;}else{_0x3e0a40=0xce;}_0x377b63[_0x2a6d('0x19')](_0x3e0a40);return _0x377b63['set']('Content-Range',_0x490c95+'-'+_0x4616dc+'/'+_0x1c211d)['json'](_0x5704ac);}return null;};}function patchUpdates(_0x53f392){return function(_0xfb66da){try{jsonpatch['apply'](_0xfb66da,_0x53f392,!![]);}catch(_0x5e63c2){return BPromise[_0x2a6d('0x1f')](_0x5e63c2);}return _0xfb66da[_0x2a6d('0x20')]();};}function saveUpdates(_0x4de848,_0x8b3411){return function(_0x41b883){if(_0x41b883){return _0x41b883[_0x2a6d('0x21')](_0x4de848)[_0x2a6d('0x22')](function(_0x2c4b47){return _0x2c4b47;});}return null;};}function removeEntity(_0x2e8dda,_0x117358){return function(_0x8f0590){if(_0x8f0590){return _0x8f0590[_0x2a6d('0x23')]()[_0x2a6d('0x22')](function(){_0x2e8dda['status'](0xcc)[_0x2a6d('0x1a')]();});}};}function handleEntityNotFound(_0x5e7534,_0x3b5322){return function(_0x11c7d3){if(!_0x11c7d3){_0x5e7534[_0x2a6d('0x24')](0x194);}return _0x11c7d3;};}function handleError(_0x176132,_0x2bd2c1){_0x2bd2c1=_0x2bd2c1||0x1f4;return function(_0x1e971f){logger[_0x2a6d('0x25')](_0x1e971f[_0x2a6d('0x26')]);if(_0x1e971f['name']){delete _0x1e971f[_0x2a6d('0x27')];}_0x176132[_0x2a6d('0x19')](_0x2bd2c1)['send'](_0x1e971f);};}exports[_0x2a6d('0x28')]=function(_0x3de9db,_0x3d4b11){var _0x1fa040={},_0x1df59b={},_0x5c685b={'count':0x0,'rows':[]};var _0x41d134=_['map'](db[_0x2a6d('0x29')][_0x2a6d('0x2a')],function(_0x208891){return{'name':_0x208891[_0x2a6d('0x2b')],'type':_0x208891[_0x2a6d('0x2c')][_0x2a6d('0x2d')]};});_0x1df59b['model']=_['map'](_0x41d134,_0x2a6d('0x27'));_0x1df59b[_0x2a6d('0x2e')]=_[_0x2a6d('0x2f')](_0x3de9db[_0x2a6d('0x2e')]);_0x1df59b[_0x2a6d('0x30')]=_[_0x2a6d('0x31')](_0x1df59b[_0x2a6d('0x32')],_0x1df59b['query']);_0x1fa040[_0x2a6d('0x33')]=_['intersection'](_0x1df59b['model'],qs[_0x2a6d('0x34')](_0x3de9db[_0x2a6d('0x2e')]['fields']));_0x1fa040[_0x2a6d('0x33')]=_0x1fa040['attributes'][_0x2a6d('0x35')]?_0x1fa040[_0x2a6d('0x33')]:_0x1df59b[_0x2a6d('0x32')];if(!_0x3de9db[_0x2a6d('0x2e')][_0x2a6d('0x36')](_0x2a6d('0x37'))){_0x1fa040['limit']=qs['limit'](_0x3de9db[_0x2a6d('0x2e')][_0x2a6d('0x1d')]);_0x1fa040[_0x2a6d('0x38')]=qs[_0x2a6d('0x38')](_0x3de9db['query'][_0x2a6d('0x38')]);}_0x1fa040[_0x2a6d('0x39')]=qs['sort'](_0x3de9db[_0x2a6d('0x2e')][_0x2a6d('0x3a')]);_0x1fa040['where']=qs[_0x2a6d('0x30')](_['pick'](_0x3de9db[_0x2a6d('0x2e')],_0x1df59b[_0x2a6d('0x30')]),_0x41d134);if(_0x3de9db[_0x2a6d('0x2e')][_0x2a6d('0x3b')]){_0x1fa040[_0x2a6d('0x3c')]=_[_0x2a6d('0x3d')](_0x1fa040[_0x2a6d('0x3c')],{'$or':_[_0x2a6d('0x3e')](_0x41d134,function(_0xd4c83d){if(_0xd4c83d[_0x2a6d('0x2c')]!=='VIRTUAL'){var _0x5c5305={};_0x5c5305[_0xd4c83d['name']]={'$like':'%'+_0x3de9db[_0x2a6d('0x2e')][_0x2a6d('0x3b')]+'%'};return _0x5c5305;}})});}_0x1fa040=_[_0x2a6d('0x3d')]({},_0x1fa040,_0x3de9db[_0x2a6d('0x3f')]);var _0x265a6a={'where':_0x1fa040[_0x2a6d('0x3c')]};return db[_0x2a6d('0x29')][_0x2a6d('0x1e')](_0x265a6a)[_0x2a6d('0x22')](function(_0x56098f){_0x5c685b['count']=_0x56098f;if(_0x3de9db['query'][_0x2a6d('0x40')]){_0x1fa040[_0x2a6d('0x41')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x2a6d('0x42')](_0x1fa040);})[_0x2a6d('0x22')](function(_0x4e0d09){_0x5c685b['rows']=_0x4e0d09;return _0x5c685b;})[_0x2a6d('0x22')](respondWithFilteredResult(_0x3d4b11,_0x1fa040))[_0x2a6d('0x43')](handleError(_0x3d4b11,null));};exports[_0x2a6d('0x44')]=function(_0x303047,_0x467916){var _0x8bc0df={'raw':!![],'where':{'id':_0x303047[_0x2a6d('0x45')]['id']}},_0x106283={};_0x106283['model']=_['keys'](db[_0x2a6d('0x29')][_0x2a6d('0x2a')]);_0x106283['query']=_[_0x2a6d('0x2f')](_0x303047[_0x2a6d('0x2e')]);_0x106283[_0x2a6d('0x30')]=_[_0x2a6d('0x31')](_0x106283[_0x2a6d('0x32')],_0x106283[_0x2a6d('0x2e')]);_0x8bc0df['attributes']=_[_0x2a6d('0x31')](_0x106283[_0x2a6d('0x32')],qs[_0x2a6d('0x34')](_0x303047[_0x2a6d('0x2e')][_0x2a6d('0x34')]));_0x8bc0df['attributes']=_0x8bc0df[_0x2a6d('0x33')]['length']?_0x8bc0df[_0x2a6d('0x33')]:_0x106283[_0x2a6d('0x32')];if(_0x303047['query'][_0x2a6d('0x40')]){_0x8bc0df[_0x2a6d('0x41')]=[{'all':!![]}];}_0x8bc0df=_['merge']({},_0x8bc0df,_0x303047[_0x2a6d('0x3f')]);return db[_0x2a6d('0x29')][_0x2a6d('0x46')](_0x8bc0df)[_0x2a6d('0x22')](handleEntityNotFound(_0x467916,null))[_0x2a6d('0x22')](respondWithResult(_0x467916,null))[_0x2a6d('0x43')](handleError(_0x467916,null));};exports[_0x2a6d('0x21')]=function(_0x3882b8,_0x3eabcc){if(_0x3882b8[_0x2a6d('0x47')]['id']){delete _0x3882b8['body']['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x3882b8[_0x2a6d('0x45')]['id']}})[_0x2a6d('0x22')](handleEntityNotFound(_0x3eabcc,null))[_0x2a6d('0x22')](saveUpdates(_0x3882b8['body'],null))[_0x2a6d('0x22')](respondWithResult(_0x3eabcc,null))['catch'](handleError(_0x3eabcc,null));};exports[_0x2a6d('0x23')]=function(_0x12b871,_0x188aa3){return db[_0x2a6d('0x29')][_0x2a6d('0x46')]({'where':{'id':_0x12b871['params']['id']}})[_0x2a6d('0x22')](handleEntityNotFound(_0x188aa3,null))[_0x2a6d('0x22')](removeEntity(_0x188aa3,null))[_0x2a6d('0x43')](handleError(_0x188aa3,null));};exports['describe']=function(_0x146684,_0x12f383){return db[_0x2a6d('0x29')]['describe']()['then'](respondWithResult(_0x12f383,null))['catch'](handleError(_0x12f383,null));}; \ No newline at end of file +var _0xb09a=['keys','options','body','params','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','map','query','model','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','filters','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show'];(function(_0x4274d2,_0x593196){var _0x1af8c5=function(_0x8851a5){while(--_0x8851a5){_0x4274d2['push'](_0x4274d2['shift']());}};_0x1af8c5(++_0x593196);}(_0xb09a,0xe6));var _0xab09=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xb09a[_0x1a72f3];return _0x57ef47;};'use strict';var emlformat=require(_0xab09('0x0'));var rimraf=require(_0xab09('0x1'));var zipdir=require(_0xab09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xab09('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xab09('0x4'));var util=require(_0xab09('0x5'));var path=require(_0xab09('0x6'));var sox=require(_0xab09('0x7'));var csv=require(_0xab09('0x8'));var ejs=require(_0xab09('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab09('0xa'));var squel=require(_0xab09('0xb'));var crypto=require(_0xab09('0xc'));var jsforce=require(_0xab09('0xd'));var deskjs=require(_0xab09('0xe'));var toCsv=require(_0xab09('0x8'));var querystring=require(_0xab09('0xf'));var Papa=require('papaparse');var Redis=require(_0xab09('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xab09('0x11'));var hardwareService=require(_0xab09('0x12'));var logger=require(_0xab09('0x13'))(_0xab09('0x14'));var utils=require(_0xab09('0x15'));var config=require(_0xab09('0x16'));var licenseUtil=require(_0xab09('0x17'));var db=require(_0xab09('0x18'))['db'];function respondWithStatusCode(_0x57a6a2,_0x14a71b){_0x14a71b=_0x14a71b||0xcc;return function(_0x300d4e){if(_0x300d4e){return _0x57a6a2['sendStatus'](_0x14a71b);}return _0x57a6a2[_0xab09('0x19')](_0x14a71b)[_0xab09('0x1a')]();};}function respondWithResult(_0x33dcbb,_0x9e1fc2){_0x9e1fc2=_0x9e1fc2||0xc8;return function(_0x19d400){if(_0x19d400){return _0x33dcbb[_0xab09('0x19')](_0x9e1fc2)[_0xab09('0x1b')](_0x19d400);}};}function respondWithFilteredResult(_0x5820dc,_0x55e27e){return function(_0x4eb632){if(_0x4eb632){var _0x4d2b61=typeof _0x55e27e[_0xab09('0x1c')]==='undefined'&&typeof _0x55e27e['limit']===_0xab09('0x1d');var _0x2b3c87=_0x4eb632[_0xab09('0x1e')];var _0x40f4a6=_0x4d2b61?0x0:_0x55e27e[_0xab09('0x1c')];var _0x536783=_0x4d2b61?_0x4eb632[_0xab09('0x1e')]:_0x55e27e[_0xab09('0x1c')]+_0x55e27e['limit'];var _0xcf9854;if(_0x536783>=_0x2b3c87){_0x536783=_0x2b3c87;_0xcf9854=0xc8;}else{_0xcf9854=0xce;}_0x5820dc[_0xab09('0x19')](_0xcf9854);return _0x5820dc['set'](_0xab09('0x1f'),_0x40f4a6+'-'+_0x536783+'/'+_0x2b3c87)[_0xab09('0x1b')](_0x4eb632);}return null;};}function patchUpdates(_0x3948e7){return function(_0x34824a){try{jsonpatch[_0xab09('0x20')](_0x34824a,_0x3948e7,!![]);}catch(_0x3ff2ca){return BPromise[_0xab09('0x21')](_0x3ff2ca);}return _0x34824a[_0xab09('0x22')]();};}function saveUpdates(_0x1aa550,_0xb4ebf2){return function(_0x67fdad){if(_0x67fdad){return _0x67fdad[_0xab09('0x23')](_0x1aa550)[_0xab09('0x24')](function(_0x42fcfb){return _0x42fcfb;});}return null;};}function removeEntity(_0x2dd785,_0x301560){return function(_0x5b5aec){if(_0x5b5aec){return _0x5b5aec[_0xab09('0x25')]()[_0xab09('0x24')](function(){_0x2dd785['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55937d,_0x114060){return function(_0xb674d0){if(!_0xb674d0){_0x55937d[_0xab09('0x26')](0x194);}return _0xb674d0;};}function handleError(_0x1743c3,_0xebb0cf){_0xebb0cf=_0xebb0cf||0x1f4;return function(_0x3bbd4a){logger[_0xab09('0x27')](_0x3bbd4a[_0xab09('0x28')]);if(_0x3bbd4a[_0xab09('0x29')]){delete _0x3bbd4a['name'];}_0x1743c3[_0xab09('0x19')](_0xebb0cf)[_0xab09('0x2a')](_0x3bbd4a);};}exports[_0xab09('0x2b')]=function(_0x1010ce,_0x1fe627){var _0x7829e0={},_0x21c371={},_0x262949={'count':0x0,'rows':[]};var _0x45da9c=_['map'](db[_0xab09('0x2c')][_0xab09('0x2d')],function(_0x419a6f){return{'name':_0x419a6f[_0xab09('0x2e')],'type':_0x419a6f[_0xab09('0x2f')][_0xab09('0x30')]};});_0x21c371['model']=_[_0xab09('0x31')](_0x45da9c,_0xab09('0x29'));_0x21c371[_0xab09('0x32')]=_['keys'](_0x1010ce[_0xab09('0x32')]);_0x21c371['filters']=_['intersection'](_0x21c371[_0xab09('0x33')],_0x21c371[_0xab09('0x32')]);_0x7829e0['attributes']=_[_0xab09('0x34')](_0x21c371['model'],qs[_0xab09('0x35')](_0x1010ce[_0xab09('0x32')][_0xab09('0x35')]));_0x7829e0[_0xab09('0x36')]=_0x7829e0[_0xab09('0x36')][_0xab09('0x37')]?_0x7829e0[_0xab09('0x36')]:_0x21c371['model'];if(!_0x1010ce[_0xab09('0x32')][_0xab09('0x38')]('nolimit')){_0x7829e0[_0xab09('0x39')]=qs['limit'](_0x1010ce[_0xab09('0x32')][_0xab09('0x39')]);_0x7829e0[_0xab09('0x1c')]=qs[_0xab09('0x1c')](_0x1010ce[_0xab09('0x32')][_0xab09('0x1c')]);}_0x7829e0['order']=qs[_0xab09('0x3a')](_0x1010ce[_0xab09('0x32')]['sort']);_0x7829e0[_0xab09('0x3b')]=qs['filters'](_[_0xab09('0x3c')](_0x1010ce[_0xab09('0x32')],_0x21c371[_0xab09('0x3d')]),_0x45da9c);if(_0x1010ce['query']['filter']){_0x7829e0[_0xab09('0x3b')]=_[_0xab09('0x3e')](_0x7829e0[_0xab09('0x3b')],{'$or':_[_0xab09('0x31')](_0x45da9c,function(_0x369f69){if(_0x369f69[_0xab09('0x2f')]!==_0xab09('0x3f')){var _0x506f96={};_0x506f96[_0x369f69['name']]={'$like':'%'+_0x1010ce[_0xab09('0x32')]['filter']+'%'};return _0x506f96;}})});}_0x7829e0=_['merge']({},_0x7829e0,_0x1010ce['options']);var _0x1856e2={'where':_0x7829e0[_0xab09('0x3b')]};return db[_0xab09('0x2c')][_0xab09('0x1e')](_0x1856e2)[_0xab09('0x24')](function(_0x2f8406){_0x262949[_0xab09('0x1e')]=_0x2f8406;if(_0x1010ce[_0xab09('0x32')][_0xab09('0x40')]){_0x7829e0[_0xab09('0x41')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xab09('0x42')](_0x7829e0);})['then'](function(_0x54a260){_0x262949[_0xab09('0x43')]=_0x54a260;return _0x262949;})[_0xab09('0x24')](respondWithFilteredResult(_0x1fe627,_0x7829e0))[_0xab09('0x44')](handleError(_0x1fe627,null));};exports[_0xab09('0x45')]=function(_0x159347,_0x4f7542){var _0x1790ec={'raw':!![],'where':{'id':_0x159347['params']['id']}},_0x59cce7={};_0x59cce7[_0xab09('0x33')]=_['keys'](db[_0xab09('0x2c')][_0xab09('0x2d')]);_0x59cce7[_0xab09('0x32')]=_[_0xab09('0x46')](_0x159347['query']);_0x59cce7[_0xab09('0x3d')]=_[_0xab09('0x34')](_0x59cce7['model'],_0x59cce7[_0xab09('0x32')]);_0x1790ec[_0xab09('0x36')]=_[_0xab09('0x34')](_0x59cce7[_0xab09('0x33')],qs[_0xab09('0x35')](_0x159347[_0xab09('0x32')][_0xab09('0x35')]));_0x1790ec[_0xab09('0x36')]=_0x1790ec[_0xab09('0x36')]['length']?_0x1790ec['attributes']:_0x59cce7['model'];if(_0x159347[_0xab09('0x32')][_0xab09('0x40')]){_0x1790ec[_0xab09('0x41')]=[{'all':!![]}];}_0x1790ec=_[_0xab09('0x3e')]({},_0x1790ec,_0x159347[_0xab09('0x47')]);return db[_0xab09('0x2c')]['find'](_0x1790ec)[_0xab09('0x24')](handleEntityNotFound(_0x4f7542,null))[_0xab09('0x24')](respondWithResult(_0x4f7542,null))['catch'](handleError(_0x4f7542,null));};exports[_0xab09('0x23')]=function(_0x30a014,_0xf69e4a){if(_0x30a014[_0xab09('0x48')]['id']){delete _0x30a014[_0xab09('0x48')]['id'];}return db[_0xab09('0x2c')]['find']({'where':{'id':_0x30a014[_0xab09('0x49')]['id']}})['then'](handleEntityNotFound(_0xf69e4a,null))[_0xab09('0x24')](saveUpdates(_0x30a014['body'],null))['then'](respondWithResult(_0xf69e4a,null))[_0xab09('0x44')](handleError(_0xf69e4a,null));};exports['destroy']=function(_0x282695,_0x33b229){return db[_0xab09('0x2c')]['find']({'where':{'id':_0x282695['params']['id']}})[_0xab09('0x24')](handleEntityNotFound(_0x33b229,null))[_0xab09('0x24')](removeEntity(_0x33b229,null))[_0xab09('0x44')](handleError(_0x33b229,null));};exports['describe']=function(_0x34c3d6,_0x2a30f3){return db[_0xab09('0x2c')][_0xab09('0x4a')]()['then'](respondWithResult(_0x2a30f3,null))[_0xab09('0x44')](handleError(_0x2a30f3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 56c4d5a..ba410df 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 _0xb21e=['CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0x25c988,_0xce8221){var _0x45fcc2=function(_0x47fba5){while(--_0x47fba5){_0x25c988['push'](_0x25c988['shift']());}};_0x45fcc2(++_0xce8221);}(_0xb21e,0x12b));var _0xeb21=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xb21e[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0xeb21('0x0'));var util=require(_0xeb21('0x1'));var logger=require(_0xeb21('0x2'))('api');var moment=require(_0xeb21('0x3'));var BPromise=require(_0xeb21('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeb21('0x5'));var attributes=require(_0xeb21('0x6'));module[_0xeb21('0x7')]=function(_0x4f829e,_0x13b5df){return _0x4f829e[_0xeb21('0x8')](_0xeb21('0x9'),attributes,{'tableName':_0xeb21('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f70=['path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x7f70,0x186));var _0x07f7=function(_0x5e2db7,_0x239290){_0x5e2db7=_0x5e2db7-0x0;var _0x461c79=_0x7f70[_0x5e2db7];return _0x461c79;};'use strict';var _=require(_0x07f7('0x0'));var util=require(_0x07f7('0x1'));var logger=require(_0x07f7('0x2'))('api');var moment=require(_0x07f7('0x3'));var BPromise=require(_0x07f7('0x4'));var rp=require(_0x07f7('0x5'));var fs=require('fs');var path=require(_0x07f7('0x6'));var rimraf=require(_0x07f7('0x7'));var config=require(_0x07f7('0x8'));var attributes=require(_0x07f7('0x9'));module[_0x07f7('0xa')]=function(_0x2e8f80,_0x212385){return _0x2e8f80[_0x07f7('0xb')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 352b49c..5d2e122 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 _0xfdbd=['update','body','destroy','DestroyCmHopperBlack','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','include','map','model','attributes','UpdateCmHopperBlack'];(function(_0x1fc4e2,_0x493c3b){var _0x2ba184=function(_0x58e64f){while(--_0x58e64f){_0x1fc4e2['push'](_0x1fc4e2['shift']());}};_0x2ba184(++_0x493c3b);}(_0xfdbd,0x1c0));var _0xdfdb=function(_0x2da402,_0x14a691){_0x2da402=_0x2da402-0x0;var _0x31a57d=_0xfdbd[_0x2da402];return _0x31a57d;};'use strict';var _=require(_0xdfdb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdfdb('0x1'));var fs=require('fs');var Redis=require(_0xdfdb('0x2'));var db=require(_0xdfdb('0x3'))['db'];var utils=require(_0xdfdb('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xdfdb('0x5'));var jayson=require(_0xdfdb('0x6'));var client=jayson[_0xdfdb('0x7')][_0xdfdb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x591f6c,_0x2697e4,_0xece4bd){return new BPromise(function(_0x5c6b54,_0x4b6020){return client[_0xdfdb('0x9')](_0x591f6c,_0xece4bd)[_0xdfdb('0xa')](function(_0x1111d2){logger['info'](_0xdfdb('0xb'),_0x2697e4,_0xdfdb('0xc'));logger[_0xdfdb('0xd')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x2697e4,'request\x20sent',JSON[_0xdfdb('0xe')](_0x1111d2));if(_0x1111d2[_0xdfdb('0xf')]){if(_0x1111d2[_0xdfdb('0xf')][_0xdfdb('0x10')]===0x1f4){logger[_0xdfdb('0xf')](_0xdfdb('0xb'),_0x2697e4,_0x1111d2['error']['message']);return _0x4b6020(_0x1111d2[_0xdfdb('0xf')][_0xdfdb('0x11')]);}logger[_0xdfdb('0xf')](_0xdfdb('0xb'),_0x2697e4,_0x1111d2[_0xdfdb('0xf')][_0xdfdb('0x11')]);return _0x5c6b54(_0x1111d2['error'][_0xdfdb('0x11')]);}else{logger[_0xdfdb('0x12')](_0xdfdb('0xb'),_0x2697e4,_0xdfdb('0xc'));_0x5c6b54(_0x1111d2[_0xdfdb('0x13')][_0xdfdb('0x11')]);}})[_0xdfdb('0x14')](function(_0x392dad){logger['error'](_0xdfdb('0xb'),_0x2697e4,_0x392dad);_0x4b6020(_0x392dad);});});}exports[_0xdfdb('0x15')]=function(_0x23ae03){var _0x4de6fd=this;return new Promise(function(_0x51474f,_0x5557ad){return db[_0xdfdb('0x16')][_0xdfdb('0x17')]({'raw':_0x23ae03[_0xdfdb('0x18')]?_0x23ae03['options'][_0xdfdb('0x19')]===undefined?!![]:![]:!![],'where':_0x23ae03[_0xdfdb('0x18')]?_0x23ae03[_0xdfdb('0x18')][_0xdfdb('0x1a')]||null:null,'attributes':_0x23ae03[_0xdfdb('0x18')]?_0x23ae03[_0xdfdb('0x18')]['attributes']||null:null,'limit':_0x23ae03[_0xdfdb('0x18')]?_0x23ae03[_0xdfdb('0x18')][_0xdfdb('0x1b')]||null:null,'include':_0x23ae03['options']?_0x23ae03[_0xdfdb('0x18')][_0xdfdb('0x1c')]?_['map'](_0x23ae03['options'][_0xdfdb('0x1c')],function(_0x3dd477){return{'model':db[_0x3dd477['model']],'as':_0x3dd477['as'],'attributes':_0x3dd477['attributes'],'include':_0x3dd477[_0xdfdb('0x1c')]?_[_0xdfdb('0x1d')](_0x3dd477[_0xdfdb('0x1c')],function(_0x35f6f3){return{'model':db[_0x35f6f3[_0xdfdb('0x1e')]],'as':_0x35f6f3['as'],'attributes':_0x35f6f3[_0xdfdb('0x1f')],'include':_0x35f6f3[_0xdfdb('0x1c')]?_['map'](_0x35f6f3['include'],function(_0x429bab){return{'model':db[_0x429bab[_0xdfdb('0x1e')]],'as':_0x429bab['as'],'attributes':_0x429bab['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e4e67){logger[_0xdfdb('0x12')](_0xdfdb('0x15'),_0x23ae03);logger['debug'](_0xdfdb('0x15'),_0x23ae03,JSON[_0xdfdb('0xe')](_0x4e4e67));_0x51474f(_0x4e4e67);})[_0xdfdb('0x14')](function(_0x131594){logger[_0xdfdb('0xf')](_0xdfdb('0x15'),_0x131594[_0xdfdb('0x11')],_0x23ae03);_0x5557ad(_0x4de6fd[_0xdfdb('0xf')](0x1f4,_0x131594[_0xdfdb('0x11')]));});});};exports[_0xdfdb('0x20')]=function(_0x237c8a){var _0xe01a86=this;return new Promise(function(_0x437d6b,_0x181f67){return db[_0xdfdb('0x16')][_0xdfdb('0x21')](_0x237c8a[_0xdfdb('0x22')],{'raw':_0x237c8a[_0xdfdb('0x18')]?_0x237c8a[_0xdfdb('0x18')][_0xdfdb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x237c8a[_0xdfdb('0x18')]?_0x237c8a[_0xdfdb('0x18')][_0xdfdb('0x1a')]||null:null,'attributes':_0x237c8a[_0xdfdb('0x18')]?_0x237c8a['options'][_0xdfdb('0x1f')]||null:null,'limit':_0x237c8a['options']?_0x237c8a[_0xdfdb('0x18')][_0xdfdb('0x1b')]||null:null})[_0xdfdb('0xa')](function(_0x169cf3){logger[_0xdfdb('0x12')]('UpdateCmHopperBlack',_0x237c8a);logger[_0xdfdb('0xd')](_0xdfdb('0x20'),_0x237c8a,JSON[_0xdfdb('0xe')](_0x169cf3));_0x437d6b(_0x169cf3);})[_0xdfdb('0x14')](function(_0x54e2fb){logger[_0xdfdb('0xf')](_0xdfdb('0x20'),_0x54e2fb[_0xdfdb('0x11')],_0x237c8a);_0x181f67(_0xe01a86['error'](0x1f4,_0x54e2fb[_0xdfdb('0x11')]));});});};exports['DestroyCmHopperBlack']=function(_0x48d3af){var _0x38816c=this;return new Promise(function(_0x35c6c0,_0x32eb3f){return db[_0xdfdb('0x16')][_0xdfdb('0x23')]({'where':_0x48d3af[_0xdfdb('0x18')]?_0x48d3af[_0xdfdb('0x18')][_0xdfdb('0x1a')]||null:null})[_0xdfdb('0xa')](function(_0x18100d){logger[_0xdfdb('0x12')](_0xdfdb('0x24'),_0x48d3af);logger[_0xdfdb('0xd')]('DestroyCmHopperBlack',_0x48d3af,JSON[_0xdfdb('0xe')](_0x18100d));_0x35c6c0(_0x18100d);})['catch'](function(_0x25723d){logger[_0xdfdb('0xf')](_0xdfdb('0x24'),_0x25723d[_0xdfdb('0x11')],_0x48d3af);_0x32eb3f(_0x38816c[_0xdfdb('0xf')](0x1f4,_0x25723d[_0xdfdb('0x11')]));});});}; \ No newline at end of file +var _0xd4c4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','map','include','model','then','stringify','UpdateCmHopperBlack','update','destroy','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0xd4c4,0x9b));var _0x4d4c=function(_0x4ec3de,_0x1c67c4){_0x4ec3de=_0x4ec3de-0x0;var _0x37478a=_0xd4c4[_0x4ec3de];return _0x37478a;};'use strict';var _=require(_0x4d4c('0x0'));var util=require(_0x4d4c('0x1'));var moment=require(_0x4d4c('0x2'));var BPromise=require(_0x4d4c('0x3'));var rs=require(_0x4d4c('0x4'));var fs=require('fs');var Redis=require(_0x4d4c('0x5'));var db=require(_0x4d4c('0x6'))['db'];var utils=require(_0x4d4c('0x7'));var logger=require(_0x4d4c('0x8'))(_0x4d4c('0x9'));var config=require('../../config/environment');var jayson=require(_0x4d4c('0xa'));var client=jayson['client'][_0x4d4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x166d01,_0x12b4d1,_0x259fef){return new BPromise(function(_0x54adcf,_0x5bd9d5){return client[_0x4d4c('0xc')](_0x166d01,_0x259fef)['then'](function(_0xdf1ad4){logger[_0x4d4c('0xd')](_0x4d4c('0xe'),_0x12b4d1,_0x4d4c('0xf'));logger[_0x4d4c('0x10')](_0x4d4c('0x11'),_0x12b4d1,_0x4d4c('0xf'),JSON['stringify'](_0xdf1ad4));if(_0xdf1ad4[_0x4d4c('0x12')]){if(_0xdf1ad4[_0x4d4c('0x12')][_0x4d4c('0x13')]===0x1f4){logger[_0x4d4c('0x12')](_0x4d4c('0xe'),_0x12b4d1,_0xdf1ad4[_0x4d4c('0x12')][_0x4d4c('0x14')]);return _0x5bd9d5(_0xdf1ad4['error'][_0x4d4c('0x14')]);}logger[_0x4d4c('0x12')](_0x4d4c('0xe'),_0x12b4d1,_0xdf1ad4['error'][_0x4d4c('0x14')]);return _0x54adcf(_0xdf1ad4['error']['message']);}else{logger[_0x4d4c('0xd')](_0x4d4c('0xe'),_0x12b4d1,_0x4d4c('0xf'));_0x54adcf(_0xdf1ad4[_0x4d4c('0x15')][_0x4d4c('0x14')]);}})[_0x4d4c('0x16')](function(_0x2968e4){logger['error'](_0x4d4c('0xe'),_0x12b4d1,_0x2968e4);_0x5bd9d5(_0x2968e4);});});}exports[_0x4d4c('0x17')]=function(_0x266992){var _0x285546=this;return new Promise(function(_0x5c14aa,_0x19e55f){return db[_0x4d4c('0x18')][_0x4d4c('0x19')]({'raw':_0x266992[_0x4d4c('0x1a')]?_0x266992[_0x4d4c('0x1a')][_0x4d4c('0x1b')]===undefined?!![]:![]:!![],'where':_0x266992['options']?_0x266992[_0x4d4c('0x1a')][_0x4d4c('0x1c')]||null:null,'attributes':_0x266992[_0x4d4c('0x1a')]?_0x266992[_0x4d4c('0x1a')][_0x4d4c('0x1d')]||null:null,'limit':_0x266992[_0x4d4c('0x1a')]?_0x266992['options'][_0x4d4c('0x1e')]||null:null,'include':_0x266992[_0x4d4c('0x1a')]?_0x266992[_0x4d4c('0x1a')]['include']?_[_0x4d4c('0x1f')](_0x266992[_0x4d4c('0x1a')][_0x4d4c('0x20')],function(_0x5372a2){return{'model':db[_0x5372a2[_0x4d4c('0x21')]],'as':_0x5372a2['as'],'attributes':_0x5372a2[_0x4d4c('0x1d')],'include':_0x5372a2[_0x4d4c('0x20')]?_[_0x4d4c('0x1f')](_0x5372a2[_0x4d4c('0x20')],function(_0x1c2ea5){return{'model':db[_0x1c2ea5[_0x4d4c('0x21')]],'as':_0x1c2ea5['as'],'attributes':_0x1c2ea5[_0x4d4c('0x1d')],'include':_0x1c2ea5['include']?_['map'](_0x1c2ea5[_0x4d4c('0x20')],function(_0x2e7a6c){return{'model':db[_0x2e7a6c['model']],'as':_0x2e7a6c['as'],'attributes':_0x2e7a6c[_0x4d4c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4d4c('0x22')](function(_0x2e006e){logger[_0x4d4c('0xd')](_0x4d4c('0x17'),_0x266992);logger[_0x4d4c('0x10')](_0x4d4c('0x17'),_0x266992,JSON[_0x4d4c('0x23')](_0x2e006e));_0x5c14aa(_0x2e006e);})[_0x4d4c('0x16')](function(_0x5e35ac){logger['error'](_0x4d4c('0x17'),_0x5e35ac['message'],_0x266992);_0x19e55f(_0x285546['error'](0x1f4,_0x5e35ac[_0x4d4c('0x14')]));});});};exports[_0x4d4c('0x24')]=function(_0x155262){var _0x160daf=this;return new Promise(function(_0x11419b,_0x48d013){return db[_0x4d4c('0x18')][_0x4d4c('0x25')](_0x155262['body'],{'raw':_0x155262['options']?_0x155262[_0x4d4c('0x1a')][_0x4d4c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x155262[_0x4d4c('0x1a')]?_0x155262[_0x4d4c('0x1a')][_0x4d4c('0x1c')]||null:null,'attributes':_0x155262[_0x4d4c('0x1a')]?_0x155262[_0x4d4c('0x1a')][_0x4d4c('0x1d')]||null:null,'limit':_0x155262[_0x4d4c('0x1a')]?_0x155262[_0x4d4c('0x1a')][_0x4d4c('0x1e')]||null:null})['then'](function(_0x3102c9){logger['info'](_0x4d4c('0x24'),_0x155262);logger[_0x4d4c('0x10')]('UpdateCmHopperBlack',_0x155262,JSON[_0x4d4c('0x23')](_0x3102c9));_0x11419b(_0x3102c9);})[_0x4d4c('0x16')](function(_0xa45d3){logger[_0x4d4c('0x12')](_0x4d4c('0x24'),_0xa45d3[_0x4d4c('0x14')],_0x155262);_0x48d013(_0x160daf[_0x4d4c('0x12')](0x1f4,_0xa45d3[_0x4d4c('0x14')]));});});};exports['DestroyCmHopperBlack']=function(_0x59bdcf){var _0x436617=this;return new Promise(function(_0x422349,_0x1f9178){return db['CmHopperBlack'][_0x4d4c('0x26')]({'where':_0x59bdcf[_0x4d4c('0x1a')]?_0x59bdcf[_0x4d4c('0x1a')]['where']||null:null})['then'](function(_0xd51775){logger[_0x4d4c('0xd')](_0x4d4c('0x27'),_0x59bdcf);logger[_0x4d4c('0x10')](_0x4d4c('0x27'),_0x59bdcf,JSON[_0x4d4c('0x23')](_0xd51775));_0x422349(_0xd51775);})[_0x4d4c('0x16')](function(_0x493687){logger[_0x4d4c('0x12')](_0x4d4c('0x27'),_0x493687['message'],_0x59bdcf);_0x1f9178(_0x436617[_0x4d4c('0x12')](0x1f4,_0x493687[_0x4d4c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index ba53b9c..e7d59b5 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 _0x33af=['isAuthenticated','describe','show','put','/:id','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','index','/describe'];(function(_0x1f8977,_0x4998dc){var _0x25a8e0=function(_0x391563){while(--_0x391563){_0x1f8977['push'](_0x1f8977['shift']());}};_0x25a8e0(++_0x4998dc);}(_0x33af,0xec));var _0xf33a=function(_0x3f2f19,_0x2ea0c4){_0x3f2f19=_0x3f2f19-0x0;var _0x18f929=_0x33af[_0x3f2f19];return _0x18f929;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0xe')](_0xf33a('0xf'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x10')]);router['delete']('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0x11')]);module[_0xf33a('0x12')]=router; \ No newline at end of file +var _0x5d58=['exports','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','put','destroy'];(function(_0x2ba4e2,_0x274eb1){var _0x4c6d10=function(_0x3b8c99){while(--_0x3b8c99){_0x2ba4e2['push'](_0x2ba4e2['shift']());}};_0x4c6d10(++_0x274eb1);}(_0x5d58,0x187));var _0x85d5=function(_0x3421a7,_0x576c28){_0x3421a7=_0x3421a7-0x0;var _0x25a78a=_0x5d58[_0x3421a7];return _0x25a78a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./cmHopperBlack.controller');router[_0x85d5('0x4')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0x6')]);router[_0x85d5('0x4')]('/describe',auth[_0x85d5('0x5')](),controller[_0x85d5('0x7')]);router['get'](_0x85d5('0x8'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0xa')](_0x85d5('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x85d5('0x8'),auth[_0x85d5('0x5')](),controller[_0x85d5('0xb')]);module[_0x85d5('0xc')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 5cf5264..21eaea2 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 _0xf513=['getDataValue','endtime','setDataValue','followuptime','seconds','dispositionat','BOOLEAN','moment','exports','INTEGER','STRING','DATE'];(function(_0x185aca,_0x3b01a4){var _0x7fb55a=function(_0x549aaf){while(--_0x549aaf){_0x185aca['push'](_0x185aca['shift']());}};_0x7fb55a(++_0x3b01a4);}(_0xf513,0x13f));var _0x3f51=function(_0x4119ea,_0x1ae6d3){_0x4119ea=_0x4119ea-0x0;var _0x1ade44=_0xf513[_0x4119ea];return _0x1ade44;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3f51('0x0'));module[_0x3f51('0x1')]={'state':{'type':Sequelize[_0x3f51('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x3f51('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x3f51('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3f51('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3f51('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3f51('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x3f51('0x3')]},'calleridnum':{'type':Sequelize[_0x3f51('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x3f51('0x4')]},'responsetime':{'type':Sequelize[_0x3f51('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x3f51('0x4')]},'endtime':{'type':Sequelize[_0x3f51('0x4')]},'ringtime':{'type':Sequelize[_0x3f51('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3f51('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3f51('0x3')]},'campaign':{'type':Sequelize[_0x3f51('0x3')]},'campaigntype':{'type':Sequelize[_0x3f51('0x3')]},'membername':{'type':Sequelize[_0x3f51('0x3')]},'reason':{'type':Sequelize[_0x3f51('0x3')]},'disposition':{'type':Sequelize[_0x3f51('0x3')]},'secondDisposition':{'type':Sequelize[_0x3f51('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3f51('0x3')]},'dispositionat':{'type':Sequelize[_0x3f51('0x4')],'set':function(_0x31beb5){var _0x382853=this[_0x3f51('0x5')](_0x3f51('0x6'));if(_0x382853&&_0x31beb5){this[_0x3f51('0x7')](_0x3f51('0x8'),moment(_0x31beb5)['diff'](moment(_0x382853),_0x3f51('0x9')));}return this[_0x3f51('0x7')](_0x3f51('0xa'),_0x31beb5);}},'amd':{'type':Sequelize[_0x3f51('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x3f51('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x3f51('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3f51('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3f51('0x4')]},'deleted':{'type':Sequelize[_0x3f51('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x3f51('0x4')]},'recallme':{'type':Sequelize[_0x3f51('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x3f51('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x3f51('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3f51('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3f51('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3f51('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3f51('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3f68=['setDataValue','dispositionat','BOOLEAN','exports','INTEGER','STRING','DATE','getDataValue','endtime','diff'];(function(_0x46c740,_0x294688){var _0x2fc05f=function(_0x4b6002){while(--_0x4b6002){_0x46c740['push'](_0x46c740['shift']());}};_0x2fc05f(++_0x294688);}(_0x3f68,0x157));var _0x83f6=function(_0x5e64f9,_0x13c61d){_0x5e64f9=_0x5e64f9-0x0;var _0x3e9b8a=_0x3f68[_0x5e64f9];return _0x3e9b8a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x83f6('0x0')]={'state':{'type':Sequelize[_0x83f6('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x83f6('0x2')]},'scheduledat':{'type':Sequelize[_0x83f6('0x3')]},'countbusyretry':{'type':Sequelize[_0x83f6('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x83f6('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x83f6('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x83f6('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x83f6('0x2')]},'originatecalleridname':{'type':Sequelize[_0x83f6('0x2')]},'calleridnum':{'type':Sequelize[_0x83f6('0x2')]},'calleridname':{'type':Sequelize[_0x83f6('0x2')]},'starttime':{'type':Sequelize[_0x83f6('0x3')]},'responsetime':{'type':Sequelize[_0x83f6('0x3')]},'answertime':{'type':Sequelize[_0x83f6('0x3')]},'droptime':{'type':Sequelize[_0x83f6('0x3')]},'endtime':{'type':Sequelize[_0x83f6('0x3')]},'ringtime':{'type':Sequelize[_0x83f6('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x83f6('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x83f6('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x83f6('0x2')]},'campaigntype':{'type':Sequelize[_0x83f6('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x83f6('0x2')]},'disposition':{'type':Sequelize[_0x83f6('0x2')]},'secondDisposition':{'type':Sequelize[_0x83f6('0x2')]},'thirdDisposition':{'type':Sequelize[_0x83f6('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x4a2ce7){var _0xde4f58=this[_0x83f6('0x4')](_0x83f6('0x5'));if(_0xde4f58&&_0x4a2ce7){this['setDataValue']('followuptime',moment(_0x4a2ce7)[_0x83f6('0x6')](moment(_0xde4f58),'seconds'));}return this[_0x83f6('0x7')](_0x83f6('0x8'),_0x4a2ce7);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x83f6('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x83f6('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x83f6('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x83f6('0x3')]},'callback':{'type':Sequelize[_0x83f6('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x83f6('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x83f6('0x3')]},'deleted':{'type':Sequelize[_0x83f6('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x83f6('0x3')]},'recallme':{'type':Sequelize[_0x83f6('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x83f6('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x83f6('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x83f6('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 e85bf42..5446457 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 _0x1883=['abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','scheduledAt','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','NOW()','ContactId','field','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','into','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperFinal','includeAll','include','findAll','params','catch','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null'];(function(_0x56cd70,_0x1b5190){var _0x38b3ff=function(_0x595c95){while(--_0x595c95){_0x56cd70['push'](_0x56cd70['shift']());}};_0x38b3ff(++_0x1b5190);}(_0x1883,0xab));var _0x3188=function(_0x15d18a,_0x171c66){_0x15d18a=_0x15d18a-0x0;var _0x31bff2=_0x1883[_0x15d18a];return _0x31bff2;};'use strict';var emlformat=require(_0x3188('0x0'));var rimraf=require(_0x3188('0x1'));var zipdir=require(_0x3188('0x2'));var jsonpatch=require(_0x3188('0x3'));var rp=require(_0x3188('0x4'));var moment=require(_0x3188('0x5'));var BPromise=require(_0x3188('0x6'));var Mustache=require(_0x3188('0x7'));var util=require(_0x3188('0x8'));var path=require(_0x3188('0x9'));var sox=require(_0x3188('0xa'));var csv=require(_0x3188('0xb'));var ejs=require(_0x3188('0xc'));var fs=require('fs');var fs_extra=require(_0x3188('0xd'));var _=require(_0x3188('0xe'));var squel=require(_0x3188('0xf'));var crypto=require(_0x3188('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x3188('0x11'));var toCsv=require(_0x3188('0xb'));var querystring=require('querystring');var Papa=require(_0x3188('0x12'));var Redis=require('ioredis');var authService=require(_0x3188('0x13'));var qs=require(_0x3188('0x14'));var as=require(_0x3188('0x15'));var hardwareService=require(_0x3188('0x16'));var logger=require('../../config/logger')(_0x3188('0x17'));var utils=require(_0x3188('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3188('0x19'))['db'];function respondWithStatusCode(_0x45e94e,_0x20fef6){_0x20fef6=_0x20fef6||0xcc;return function(_0x3ae228){if(_0x3ae228){return _0x45e94e[_0x3188('0x1a')](_0x20fef6);}return _0x45e94e[_0x3188('0x1b')](_0x20fef6)['end']();};}function respondWithResult(_0x276d69,_0x5e0044){_0x5e0044=_0x5e0044||0xc8;return function(_0x4a2f36){if(_0x4a2f36){return _0x276d69[_0x3188('0x1b')](_0x5e0044)['json'](_0x4a2f36);}};}function respondWithFilteredResult(_0x54a87f,_0x32c239){return function(_0x1beead){if(_0x1beead){var _0xa2269=typeof _0x32c239[_0x3188('0x1c')]===_0x3188('0x1d')&&typeof _0x32c239[_0x3188('0x1e')]==='undefined';var _0x19cc72=_0x1beead[_0x3188('0x1f')];var _0x3f5b35=_0xa2269?0x0:_0x32c239[_0x3188('0x1c')];var _0x18a71a=_0xa2269?_0x1beead[_0x3188('0x1f')]:_0x32c239[_0x3188('0x1c')]+_0x32c239[_0x3188('0x1e')];var _0x5bcbba;if(_0x18a71a>=_0x19cc72){_0x18a71a=_0x19cc72;_0x5bcbba=0xc8;}else{_0x5bcbba=0xce;}_0x54a87f[_0x3188('0x1b')](_0x5bcbba);return _0x54a87f[_0x3188('0x20')]('Content-Range',_0x3f5b35+'-'+_0x18a71a+'/'+_0x19cc72)['json'](_0x1beead);}return null;};}function patchUpdates(_0x5d8d62){return function(_0x46a318){try{jsonpatch[_0x3188('0x21')](_0x46a318,_0x5d8d62,!![]);}catch(_0xd292b5){return BPromise['reject'](_0xd292b5);}return _0x46a318['save']();};}function saveUpdates(_0x266260,_0x461286){return function(_0x375077){if(_0x375077){return _0x375077[_0x3188('0x22')](_0x266260)[_0x3188('0x23')](function(_0x4bd5ee){return _0x4bd5ee;});}return null;};}function removeEntity(_0x30cf2c,_0x33f882){return function(_0x5a2e67){if(_0x5a2e67){return _0x5a2e67[_0x3188('0x24')]()['then'](function(){_0x30cf2c['status'](0xcc)[_0x3188('0x25')]();});}};}function handleEntityNotFound(_0x129bd7,_0x87d5a3){return function(_0x1aeaba){if(!_0x1aeaba){_0x129bd7[_0x3188('0x1a')](0x194);}return _0x1aeaba;};}function handleError(_0x2cd060,_0xe57f73){_0xe57f73=_0xe57f73||0x1f4;return function(_0x11021c){logger['error'](_0x11021c[_0x3188('0x26')]);if(_0x11021c[_0x3188('0x27')]){delete _0x11021c['name'];}_0x2cd060[_0x3188('0x1b')](_0xe57f73)[_0x3188('0x28')](_0x11021c);};}exports[_0x3188('0x29')]=function(_0x44db9a,_0x20e6aa){var _0x1f1c6f={},_0x8f810f={},_0x472926={'count':0x0,'rows':[]};var _0x57c21c=_[_0x3188('0x2a')](db['CmHopperFinal'][_0x3188('0x2b')],function(_0x5623f1){return{'name':_0x5623f1[_0x3188('0x2c')],'type':_0x5623f1[_0x3188('0x2d')][_0x3188('0x2e')]};});_0x8f810f[_0x3188('0x2f')]=_[_0x3188('0x2a')](_0x57c21c,_0x3188('0x27'));_0x8f810f[_0x3188('0x30')]=_[_0x3188('0x31')](_0x44db9a[_0x3188('0x30')]);_0x8f810f[_0x3188('0x32')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],_0x8f810f[_0x3188('0x30')]);_0x1f1c6f[_0x3188('0x34')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],qs[_0x3188('0x35')](_0x44db9a[_0x3188('0x30')]['fields']));_0x1f1c6f[_0x3188('0x34')]=_0x1f1c6f['attributes'][_0x3188('0x36')]?_0x1f1c6f[_0x3188('0x34')]:_0x8f810f['model'];if(!_0x44db9a[_0x3188('0x30')][_0x3188('0x37')](_0x3188('0x38'))){_0x1f1c6f[_0x3188('0x1e')]=qs[_0x3188('0x1e')](_0x44db9a[_0x3188('0x30')][_0x3188('0x1e')]);_0x1f1c6f['offset']=qs['offset'](_0x44db9a[_0x3188('0x30')][_0x3188('0x1c')]);}_0x1f1c6f[_0x3188('0x39')]=qs[_0x3188('0x3a')](_0x44db9a['query'][_0x3188('0x3a')]);_0x1f1c6f[_0x3188('0x3b')]=qs[_0x3188('0x32')](_[_0x3188('0x3c')](_0x44db9a['query'],_0x8f810f[_0x3188('0x32')]),_0x57c21c);if(_0x44db9a['query'][_0x3188('0x3d')]){_0x1f1c6f['where']=_[_0x3188('0x3e')](_0x1f1c6f[_0x3188('0x3b')],{'$or':_[_0x3188('0x2a')](_0x57c21c,function(_0x2990c4){if(_0x2990c4[_0x3188('0x2d')]!==_0x3188('0x3f')){var _0x4666b2={};_0x4666b2[_0x2990c4[_0x3188('0x27')]]={'$like':'%'+_0x44db9a[_0x3188('0x30')][_0x3188('0x3d')]+'%'};return _0x4666b2;}})});}_0x1f1c6f=_['merge']({},_0x1f1c6f,_0x44db9a[_0x3188('0x40')]);var _0x2bad0f={'where':_0x1f1c6f[_0x3188('0x3b')]};return db[_0x3188('0x41')][_0x3188('0x1f')](_0x2bad0f)[_0x3188('0x23')](function(_0x5a815d){_0x472926[_0x3188('0x1f')]=_0x5a815d;if(_0x44db9a['query'][_0x3188('0x42')]){_0x1f1c6f[_0x3188('0x43')]=[{'all':!![]}];}return db[_0x3188('0x41')][_0x3188('0x44')](_0x1f1c6f);})[_0x3188('0x23')](function(_0x549ab2){_0x472926['rows']=_0x549ab2;return _0x472926;})['then'](respondWithFilteredResult(_0x20e6aa,_0x1f1c6f))['catch'](handleError(_0x20e6aa,null));};exports['show']=function(_0x763943,_0x28c224){var _0x3e5f90={'raw':!![],'where':{'id':_0x763943[_0x3188('0x45')]['id']}},_0x1b40b1={};_0x1b40b1['model']=_[_0x3188('0x31')](db['CmHopperFinal'][_0x3188('0x2b')]);_0x1b40b1[_0x3188('0x30')]=_[_0x3188('0x31')](_0x763943[_0x3188('0x30')]);_0x1b40b1['filters']=_[_0x3188('0x33')](_0x1b40b1[_0x3188('0x2f')],_0x1b40b1[_0x3188('0x30')]);_0x3e5f90[_0x3188('0x34')]=_[_0x3188('0x33')](_0x1b40b1['model'],qs['fields'](_0x763943[_0x3188('0x30')][_0x3188('0x35')]));_0x3e5f90['attributes']=_0x3e5f90[_0x3188('0x34')][_0x3188('0x36')]?_0x3e5f90['attributes']:_0x1b40b1[_0x3188('0x2f')];if(_0x763943[_0x3188('0x30')][_0x3188('0x42')]){_0x3e5f90[_0x3188('0x43')]=[{'all':!![]}];}_0x3e5f90=_[_0x3188('0x3e')]({},_0x3e5f90,_0x763943['options']);return db[_0x3188('0x41')]['find'](_0x3e5f90)[_0x3188('0x23')](handleEntityNotFound(_0x28c224,null))[_0x3188('0x23')](respondWithResult(_0x28c224,null))[_0x3188('0x46')](handleError(_0x28c224,null));};exports[_0x3188('0x47')]=function(_0xe4cbb0,_0x315524){return db[_0x3188('0x41')][_0x3188('0x47')]()[_0x3188('0x23')](respondWithResult(_0x315524,null))[_0x3188('0x46')](handleError(_0x315524,null));};exports[_0x3188('0x22')]=function(_0x50c08d,_0x50fd56){if(_0x50c08d[_0x3188('0x48')]['uniqueid']){delete _0x50c08d[_0x3188('0x48')][_0x3188('0x49')];}return db['CmHopperFinal'][_0x3188('0x4a')]({'where':{'uniqueid':_0x50c08d[_0x3188('0x45')]['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x50fd56,null))[_0x3188('0x23')](saveUpdates(_0x50c08d[_0x3188('0x48')],null))[_0x3188('0x23')](respondWithResult(_0x50fd56,null))[_0x3188('0x46')](handleError(_0x50fd56,null));};exports[_0x3188('0x4b')]=function(_0x59a177,_0x3b8fe9,_0x3051ce){return db['CmHopperFinal'][_0x3188('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x59a177['params']['id']},'attributes':[[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db['sequelize'][_0x3188('0x4e')](_0x3188('0x4f')))),'noAnswerContacts'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x3188('0x4e')](_0x3188('0x50')))),_0x3188('0x51')],[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db['sequelize']['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')]['literal'](_0x3188('0x52')))),_0x3188('0x53')],[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db['sequelize'][_0x3188('0x4e')](_0x3188('0x54')))),_0x3188('0x55')],[db['sequelize']['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x3188('0x56')],[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')](_0x3188('0x57')))),'answeringMachine']]})[_0x3188('0x23')](handleEntityNotFound(_0x3b8fe9,null))[_0x3188('0x23')](respondWithResult(_0x3b8fe9,null))[_0x3188('0x46')](handleError(_0x3b8fe9,null));};exports[_0x3188('0x58')]=function(_0x3afd94,_0x447827,_0x27983c){return db['CmHopperFinal'][_0x3188('0x44')]({'raw':![],'where':{'CampaignId':_0x3afd94[_0x3188('0x45')]['id']},'attributes':[[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db['sequelize'][_0x3188('0x4e')](_0x3188('0x59')))),'noSuchContacts'],[db['sequelize']['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')](_0x3188('0x4f')))),_0x3188('0x5a')],[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')]['literal'](_0x3188('0x50')))),'busyContacts'],[db['sequelize']['fn'](_0x3188('0x4d'),db['sequelize']['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')](_0x3188('0x5b')))),_0x3188('0x5c')],[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db['sequelize']['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x3188('0x53')],[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x3188('0x55')],[db[_0x3188('0x4c')]['fn']('COUNT',db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x3188('0x56')],[db[_0x3188('0x4c')]['fn'](_0x3188('0x4d'),db[_0x3188('0x4c')]['fn']('IF',db[_0x3188('0x4c')][_0x3188('0x4e')](_0x3188('0x57')))),'answeringMachine']]})['then'](handleEntityNotFound(_0x447827,null))['then'](respondWithResult(_0x447827,null))['catch'](handleError(_0x447827,null));};exports[_0x3188('0x5d')]=function(_0x693395,_0x3b6a13,_0x30f3b3){return db[_0x3188('0x5e')]['find']({'where':{'id':_0x693395[_0x3188('0x45')]['id']}})['then'](handleEntityNotFound(_0x3b6a13,null))[_0x3188('0x23')](function(_0x96600f){var _0x5b93cd;if(_0x96600f){_0x5b93cd=squel[_0x3188('0x5f')]()['into'](_0x3188('0x60'))[_0x3188('0x61')](['phone',_0x3188('0x62'),'ContactId',_0x3188('0x63'),_0x3188('0x64'),_0x3188('0x65'),_0x3188('0x66')],squel[_0x3188('0x67')]()['field'](_0x3188('0x68'),_0x3188('0x69'))['field'](_0x3188('0x6a'),_0x3188('0x62'))['field']('ANY_VALUE(ContactId)',_0x3188('0x6b'))[_0x3188('0x6c')](_0x3188('0x6d'),_0x3188('0x63'))[_0x3188('0x6c')](_0x3188('0x6e'),'VoiceQueueId')[_0x3188('0x6c')](_0x3188('0x6a'),_0x3188('0x65'))['field'](_0x3188('0x6a'),_0x3188('0x66'))[_0x3188('0x6f')](_0x3188('0x70'))[_0x3188('0x3b')](_0x3188('0x71'),_0x693395['params']['id']['toString']())['where'](_0x3188('0x72'),_0x693395[_0x3188('0x48')]['state'][_0x3188('0x73')]())[_0x3188('0x3b')](_0x3188('0x74'))[_0x3188('0x3b')](_0x3188('0x75'),squel[_0x3188('0x67')]()['field'](_0x3188('0x69'))[_0x3188('0x6f')](_0x3188('0x60'))[_0x3188('0x3b')](_0x3188('0x71'),_0x693395[_0x3188('0x45')]['id'][_0x3188('0x73')]()))[_0x3188('0x3b')](_0x3188('0x75'),squel[_0x3188('0x67')]()[_0x3188('0x6c')](_0x3188('0x76'))[_0x3188('0x6f')](_0x3188('0x70'))[_0x3188('0x3b')](_0x3188('0x71'),_0x693395[_0x3188('0x45')]['id'][_0x3188('0x73')]())['where'](_0x3188('0x77')))[_0x3188('0x78')](_0x3188('0x6b')))[_0x3188('0x73')]();return db[_0x3188('0x4c')]['query'](_0x5b93cd);}return[];})[_0x3188('0x23')](respondWithResult(_0x3b6a13,null))[_0x3188('0x46')](handleError(_0x3b6a13,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0xc1ee8e,_0x2ba5a5,_0x43212c){return db['Campaign'][_0x3188('0x4a')]({'where':{'id':_0xc1ee8e['params']['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x2ba5a5,null))[_0x3188('0x23')](function(_0x31029d){var _0xcf9ceb;if(_0x31029d){_0xcf9ceb=squel[_0x3188('0x5f')]()[_0x3188('0x79')]('cm_hopper')['fromQuery']([_0x3188('0x69'),_0x3188('0x62'),_0x3188('0x6b'),_0x3188('0x63'),_0x3188('0x7a'),_0x3188('0x65'),'updatedAt'],squel[_0x3188('0x67')]()[_0x3188('0x6c')](_0x3188('0x68'),_0x3188('0x69'))['field'](_0x3188('0x6a'),'scheduledAt')['field']('ANY_VALUE(ContactId)','ContactId')[_0x3188('0x6c')](_0x3188('0x6d'),'ListId')[_0x3188('0x6c')](_0x3188('0x7b'),'CampaignId')[_0x3188('0x6c')]('NOW()',_0x3188('0x65'))[_0x3188('0x6c')]('NOW()',_0x3188('0x66'))[_0x3188('0x6f')](_0x3188('0x70'))[_0x3188('0x3b')](_0x3188('0x7c'),_0xc1ee8e[_0x3188('0x45')]['id'][_0x3188('0x73')]())[_0x3188('0x3b')](_0x3188('0x72'),_0xc1ee8e[_0x3188('0x48')]['state'][_0x3188('0x73')]())[_0x3188('0x3b')](_0x3188('0x74'))['where'](_0x3188('0x75'),squel['select']()[_0x3188('0x6c')]('phone')['from']('cm_hopper')['where'](_0x3188('0x7c'),_0xc1ee8e[_0x3188('0x45')]['id'][_0x3188('0x73')]()))[_0x3188('0x3b')](_0x3188('0x75'),squel['select']()[_0x3188('0x6c')]('calleridnum')['from'](_0x3188('0x70'))[_0x3188('0x3b')]('CampaignId\x20=\x20?',_0xc1ee8e[_0x3188('0x45')]['id'][_0x3188('0x73')]())[_0x3188('0x3b')](_0x3188('0x77')))[_0x3188('0x78')](_0x3188('0x6b')))[_0x3188('0x73')]();return db['sequelize'][_0x3188('0x30')](_0xcf9ceb);}return[];})[_0x3188('0x23')](respondWithResult(_0x2ba5a5,null))[_0x3188('0x46')](handleError(_0x2ba5a5,null));};exports[_0x3188('0x7d')]=function(_0x203f04,_0x12c18c,_0x11b74c){return db[_0x3188('0x7e')][_0x3188('0x7f')]({'where':{'VoiceQueueId':_0x203f04['body'][_0x3188('0x64')],'CampaignId':_0x203f04['body'][_0x3188('0x7a')],'ContactId':_0x203f04[_0x3188('0x48')][_0x3188('0x6b')]}})[_0x3188('0x23')](handleEntityNotFound(_0x12c18c,null))[_0x3188('0x23')](function(_0x41ca86){if(_0x41ca86){return _0x41ca86;}return null;})[_0x3188('0x23')](respondWithResult(_0x12c18c,null))[_0x3188('0x46')](handleError(_0x12c18c,null));}; \ No newline at end of file +var _0x1623=['reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','phone','scheduledAt','ListId','createdAt','select','ANY_VALUE(calleridnum)','field','NOW()','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','from','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','updatedAt','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','CmHopperFinal','findAll','rows','catch','show','params','length','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','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'];(function(_0x4635e2,_0x543cda){var _0x6795b5=function(_0x2bde38){while(--_0x2bde38){_0x4635e2['push'](_0x4635e2['shift']());}};_0x6795b5(++_0x543cda);}(_0x1623,0xab));var _0x3162=function(_0x71cc32,_0x3d987f){_0x71cc32=_0x71cc32-0x0;var _0x3d237c=_0x1623[_0x71cc32];return _0x3d237c;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['CmHopperFinal'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':!![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')]()[_0x3162('0x24')](respondWithResult(_0x28865c,null))['catch'](handleError(_0x28865c,null));};exports[_0x3162('0x23')]=function(_0x48cb8f,_0x4f1dde){if(_0x48cb8f[_0x3162('0x48')][_0x3162('0x49')]){delete _0x48cb8f[_0x3162('0x48')][_0x3162('0x49')];}return db['CmHopperFinal'][_0x3162('0x46')]({'where':{'uniqueid':_0x48cb8f['params']['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x4f1dde,null))[_0x3162('0x24')](saveUpdates(_0x48cb8f['body'],null))[_0x3162('0x24')](respondWithResult(_0x4f1dde,null))['catch'](handleError(_0x4f1dde,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x13e7c4,_0x22c0a2,_0x160364){return db[_0x3162('0x3f')][_0x3162('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x13e7c4[_0x3162('0x44')]['id']},'attributes':[[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3162('0x4c')))),_0x3162('0x4d')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0x3162('0x4f')],[db['sequelize']['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x50')))),_0x3162('0x51')],[db['sequelize']['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x52')))),_0x3162('0x53')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db['sequelize'][_0x3162('0x4e')](_0x3162('0x54')))),'dropContacts'],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x55')))),_0x3162('0x56')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x3162('0x57')],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x58')))),_0x3162('0x59')]]})[_0x3162('0x24')](handleEntityNotFound(_0x22c0a2,null))[_0x3162('0x24')](respondWithResult(_0x22c0a2,null))[_0x3162('0x42')](handleError(_0x22c0a2,null));};exports[_0x3162('0x5a')]=function(_0x4b5729,_0x4a42ea,_0x520b1a){return db[_0x3162('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x4b5729[_0x3162('0x44')]['id']},'attributes':[[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x3162('0x4d')],[db[_0x3162('0x4a')]['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x5b')))),_0x3162('0x4f')],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x50')))),'busyContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x52')))),_0x3162('0x53')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x54')))),_0x3162('0x5c')],[db[_0x3162('0x4a')]['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x55')))),'abandonedContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x5d')))),'reCallContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x58')))),'answeringMachine']]})[_0x3162('0x24')](handleEntityNotFound(_0x4a42ea,null))[_0x3162('0x24')](respondWithResult(_0x4a42ea,null))[_0x3162('0x42')](handleError(_0x4a42ea,null));};exports[_0x3162('0x5e')]=function(_0x8a75ca,_0x33c39d,_0xb3d824){return db['VoiceQueue']['find']({'where':{'id':_0x8a75ca['params']['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x33c39d,null))[_0x3162('0x24')](function(_0x59b3f7){var _0x129005;if(_0x59b3f7){_0x129005=squel[_0x3162('0x5f')]()[_0x3162('0x60')](_0x3162('0x61'))['fromQuery']([_0x3162('0x62'),_0x3162('0x63'),'ContactId',_0x3162('0x64'),'VoiceQueueId',_0x3162('0x65'),'updatedAt'],squel[_0x3162('0x66')]()['field'](_0x3162('0x67'),_0x3162('0x62'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x63'))[_0x3162('0x68')]('ANY_VALUE(ContactId)',_0x3162('0x6a'))[_0x3162('0x68')](_0x3162('0x6b'),'ListId')[_0x3162('0x68')](_0x3162('0x6c'),_0x3162('0x6d'))[_0x3162('0x68')](_0x3162('0x69'),'createdAt')[_0x3162('0x68')](_0x3162('0x69'),'updatedAt')['from'](_0x3162('0x6e'))[_0x3162('0x3c')]('VoiceQueueId\x20=\x20?',_0x8a75ca[_0x3162('0x44')]['id'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x70'),_0x8a75ca[_0x3162('0x48')][_0x3162('0x71')][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x72'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x3162('0x66')]()[_0x3162('0x68')]('phone')[_0x3162('0x73')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x8a75ca[_0x3162('0x44')]['id']['toString']()))[_0x3162('0x3c')](_0x3162('0x74'),squel[_0x3162('0x66')]()[_0x3162('0x68')](_0x3162('0x75'))[_0x3162('0x73')](_0x3162('0x6e'))[_0x3162('0x3c')](_0x3162('0x76'),_0x8a75ca[_0x3162('0x44')]['id'][_0x3162('0x6f')]())['where'](_0x3162('0x77')))[_0x3162('0x78')](_0x3162('0x6a')))[_0x3162('0x6f')]();return db[_0x3162('0x4a')][_0x3162('0x31')](_0x129005);}return[];})[_0x3162('0x24')](respondWithResult(_0x33c39d,null))[_0x3162('0x42')](handleError(_0x33c39d,null));};exports[_0x3162('0x79')]=function(_0x3f37fa,_0x1d242f,_0x190f91){return db['Campaign'][_0x3162('0x46')]({'where':{'id':_0x3f37fa[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x1d242f,null))['then'](function(_0x3d7bd1){var _0x5cdbb0;if(_0x3d7bd1){_0x5cdbb0=squel[_0x3162('0x5f')]()[_0x3162('0x60')]('cm_hopper')['fromQuery']([_0x3162('0x62'),_0x3162('0x63'),'ContactId',_0x3162('0x64'),'CampaignId',_0x3162('0x65'),_0x3162('0x7a')],squel[_0x3162('0x66')]()[_0x3162('0x68')](_0x3162('0x67'),_0x3162('0x62'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x63'))['field'](_0x3162('0x7b'),'ContactId')[_0x3162('0x68')](_0x3162('0x6b'),'ListId')[_0x3162('0x68')](_0x3162('0x7c'),_0x3162('0x7d'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x65'))[_0x3162('0x68')]('NOW()',_0x3162('0x7a'))[_0x3162('0x73')](_0x3162('0x6e'))['where'](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x70'),_0x3f37fa[_0x3162('0x48')]['state'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x72'))[_0x3162('0x3c')](_0x3162('0x74'),squel['select']()[_0x3162('0x68')]('phone')[_0x3162('0x73')](_0x3162('0x61'))['where'](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]()))['where'](_0x3162('0x74'),squel['select']()['field'](_0x3162('0x75'))[_0x3162('0x73')](_0x3162('0x6e'))[_0x3162('0x3c')](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]())['where']('state\x20=\x204'))['group'](_0x3162('0x6a')))[_0x3162('0x6f')]();return db['sequelize']['query'](_0x5cdbb0);}return[];})[_0x3162('0x24')](respondWithResult(_0x1d242f,null))['catch'](handleError(_0x1d242f,null));};exports[_0x3162('0x7f')]=function(_0x35d9f0,_0x4408db,_0x377edb){return db['CmHopper'][_0x3162('0x80')]({'where':{'VoiceQueueId':_0x35d9f0[_0x3162('0x48')][_0x3162('0x6d')],'CampaignId':_0x35d9f0['body'][_0x3162('0x7d')],'ContactId':_0x35d9f0['body'][_0x3162('0x6a')]}})['then'](handleEntityNotFound(_0x4408db,null))[_0x3162('0x24')](function(_0x3d414f){if(_0x3d414f){return _0x3d414f;}return null;})[_0x3162('0x24')](respondWithResult(_0x4408db,null))['catch'](handleError(_0x4408db,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index da6c1fd..9a46521 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 _0x87ca=['exports','define','calleridnum','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cmHopperFinal.attributes'];(function(_0x5f1bb8,_0x106e7e){var _0x4a6cec=function(_0x2da754){while(--_0x2da754){_0x5f1bb8['push'](_0x5f1bb8['shift']());}};_0x4a6cec(++_0x106e7e);}(_0x87ca,0x94));var _0xa87c=function(_0x13425f,_0x1bd724){_0x13425f=_0x13425f-0x0;var _0x5d1360=_0x87ca[_0x13425f];return _0x5d1360;};'use strict';var _=require('lodash');var util=require(_0xa87c('0x0'));var logger=require(_0xa87c('0x1'))(_0xa87c('0x2'));var moment=require(_0xa87c('0x3'));var BPromise=require(_0xa87c('0x4'));var rp=require(_0xa87c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa87c('0x6'));var attributes=require(_0xa87c('0x7'));module[_0xa87c('0x8')]=function(_0x531ea6,_0x1ab862){return _0x531ea6[_0xa87c('0x9')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xa87c('0xa')]},{'name':'uniqueid','fields':[_0xa87c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcff9=['exports','define','CmHopperFinal','calleridnum','uniqueid','util','../../config/logger','moment','bluebird','request-promise','./cmHopperFinal.attributes'];(function(_0x27b144,_0x192d4a){var _0x1d9d40=function(_0x2e70a2){while(--_0x2e70a2){_0x27b144['push'](_0x27b144['shift']());}};_0x1d9d40(++_0x192d4a);}(_0xcff9,0x10d));var _0x9cff=function(_0x29f16d,_0x4975bd){_0x29f16d=_0x29f16d-0x0;var _0x59ec74=_0xcff9[_0x29f16d];return _0x59ec74;};'use strict';var _=require('lodash');var util=require(_0x9cff('0x0'));var logger=require(_0x9cff('0x1'))('api');var moment=require(_0x9cff('0x2'));var BPromise=require(_0x9cff('0x3'));var rp=require(_0x9cff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9cff('0x5'));module[_0x9cff('0x6')]=function(_0x30485f,_0x48173f){return _0x30485f[_0x9cff('0x7')](_0x9cff('0x8'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x9cff('0x9'),'fields':[_0x9cff('0x9')]},{'name':_0x9cff('0xa'),'fields':[_0x9cff('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index d9a80a1..fb8f40d 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x57b28b,_0x3a4f7a){var _0x456eda=function(_0x20f2fb){while(--_0x20f2fb){_0x57b28b['push'](_0x57b28b['shift']());}};_0x456eda(++_0x3a4f7a);}(_0x7a54,0x106));var _0x47a5=function(_0x2a5eb5,_0x4bdd39){_0x2a5eb5=_0x2a5eb5-0x0;var _0x1281bd=_0x7a54[_0x2a5eb5];return _0x1281bd;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x24e269,_0x458247){var _0x4be9e0=function(_0x12695d){while(--_0x12695d){_0x24e269['push'](_0x24e269['shift']());}};_0x4be9e0(++_0x458247);}(_0xb10b,0x12a));var _0xbb10=function(_0x53cc0a,_0x30848e){_0x53cc0a=_0x53cc0a-0x0;var _0x58044c=_0xb10b[_0x53cc0a];return _0x58044c;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 5ec7353..3039692 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 _0xf5da=['moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post'];(function(_0x2a34a7,_0x472c35){var _0x3e925c=function(_0x136881){while(--_0x136881){_0x2a34a7['push'](_0x2a34a7['shift']());}};_0x3e925c(++_0x472c35);}(_0xf5da,0x1a6));var _0xaf5d=function(_0x5c027f,_0xa40135){_0x5c027f=_0x5c027f-0x0;var _0x5392f3=_0xf5da[_0x5c027f];return _0x5392f3;};'use strict';var multer=require(_0xaf5d('0x0'));var util=require(_0xaf5d('0x1'));var path=require(_0xaf5d('0x2'));var timeout=require(_0xaf5d('0x3'));var express=require(_0xaf5d('0x4'));var router=express[_0xaf5d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xaf5d('0x6'));var interaction=require(_0xaf5d('0x7'));var config=require(_0xaf5d('0x8'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xaf5d('0x9')](_0xaf5d('0xa'),auth['isAuthenticated'](),controller[_0xaf5d('0xb')]);router[_0xaf5d('0x9')](_0xaf5d('0xc'),auth[_0xaf5d('0xd')](),controller[_0xaf5d('0xe')]);router['get'](_0xaf5d('0xf'),auth[_0xaf5d('0xd')](),controller[_0xaf5d('0x10')]);router['get'](_0xaf5d('0x11'),auth[_0xaf5d('0xd')](),controller[_0xaf5d('0x12')]);router[_0xaf5d('0x13')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0xaf5d('0x14')]);router[_0xaf5d('0x13')](_0xaf5d('0x15'),auth[_0xaf5d('0xd')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xaf5d('0x13')](_0xaf5d('0x16'),auth[_0xaf5d('0xd')](),controller[_0xaf5d('0x17')]);router[_0xaf5d('0x18')](_0xaf5d('0xc'),auth[_0xaf5d('0xd')](),controller['update']);module[_0xaf5d('0x19')]=router; \ No newline at end of file +var _0x887a=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','isAuthenticated','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','post','/checkContactHopper','checkContactHopper','update','exports'];(function(_0x3a21c0,_0x348451){var _0x411e84=function(_0xdd7b02){while(--_0xdd7b02){_0x3a21c0['push'](_0x3a21c0['shift']());}};_0x411e84(++_0x348451);}(_0x887a,0x186));var _0xa887=function(_0x1ae649,_0x570c82){_0x1ae649=_0x1ae649-0x0;var _0x212b98=_0x887a[_0x1ae649];return _0x212b98;};'use strict';var multer=require(_0xa887('0x0'));var util=require('util');var path=require(_0xa887('0x1'));var timeout=require(_0xa887('0x2'));var express=require(_0xa887('0x3'));var router=express[_0xa887('0x4')]();var fs_extra=require(_0xa887('0x5'));var auth=require(_0xa887('0x6'));var interaction=require(_0xa887('0x7'));var config=require(_0xa887('0x8'));var controller=require(_0xa887('0x9'));router[_0xa887('0xa')]('/',auth['isAuthenticated'](),controller[_0xa887('0xb')]);router[_0xa887('0xa')]('/describe',auth[_0xa887('0xc')](),controller['describe']);router[_0xa887('0xa')](_0xa887('0xd'),auth[_0xa887('0xc')](),controller[_0xa887('0xe')]);router[_0xa887('0xa')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0xa887('0xf')]);router['get'](_0xa887('0x10'),auth['isAuthenticated'](),controller[_0xa887('0x11')]);router['post']('/voice/queue/moveContacts/:id',auth[_0xa887('0xc')](),controller[_0xa887('0x12')]);router['post'](_0xa887('0x13'),auth[_0xa887('0xc')](),controller[_0xa887('0x14')]);router[_0xa887('0x15')](_0xa887('0x16'),auth[_0xa887('0xc')](),controller[_0xa887('0x17')]);router['put'](_0xa887('0xd'),auth['isAuthenticated'](),controller[_0xa887('0x18')]);module[_0xa887('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index f5d5881..34f9cbc 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 _0xa9a0=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x4cf74d,_0x580655){var _0x4e29db=function(_0x316023){while(--_0x316023){_0x4cf74d['push'](_0x4cf74d['shift']());}};_0x4e29db(++_0x580655);}(_0xa9a0,0x67));var _0x0a9a=function(_0x53aa11,_0x323439){_0x53aa11=_0x53aa11-0x0;var _0xcbde25=_0xa9a0[_0x53aa11];return _0xcbde25;};'use strict';var Sequelize=require(_0x0a9a('0x0'));module[_0x0a9a('0x1')]={'state':{'type':Sequelize[_0x0a9a('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x0a9a('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x0a9a('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0a9a('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0a9a('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x0a9a('0x3')]},'originatecalleridname':{'type':Sequelize[_0x0a9a('0x3')]},'calleridnum':{'type':Sequelize[_0x0a9a('0x3')]},'calleridname':{'type':Sequelize[_0x0a9a('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x0a9a('0x4')]},'droptime':{'type':Sequelize[_0x0a9a('0x4')]},'endtime':{'type':Sequelize[_0x0a9a('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0a9a('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0a9a('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0a9a('0x3')]},'campaign':{'type':Sequelize[_0x0a9a('0x3')]},'campaigntype':{'type':Sequelize[_0x0a9a('0x3')]},'membername':{'type':Sequelize[_0x0a9a('0x3')]},'reason':{'type':Sequelize[_0x0a9a('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x0a9a('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x0a9a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0a9a('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x0a9a('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x0a9a('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0a9a('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0a9a('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0a9a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5ad2=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x12aaf1,_0xd265d0){var _0x14a13d=function(_0x2ff2e1){while(--_0x2ff2e1){_0x12aaf1['push'](_0x12aaf1['shift']());}};_0x14a13d(++_0xd265d0);}(_0x5ad2,0xda));var _0x25ad=function(_0x237868,_0x267e95){_0x237868=_0x237868-0x0;var _0x3bc4f6=_0x5ad2[_0x237868];return _0x3bc4f6;};'use strict';var Sequelize=require(_0x25ad('0x0'));module[_0x25ad('0x1')]={'state':{'type':Sequelize[_0x25ad('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x25ad('0x3')]},'scheduledat':{'type':Sequelize[_0x25ad('0x4')]},'countbusyretry':{'type':Sequelize[_0x25ad('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x25ad('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x25ad('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x25ad('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x25ad('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x25ad('0x3')]},'calleridnum':{'type':Sequelize[_0x25ad('0x3')]},'calleridname':{'type':Sequelize[_0x25ad('0x3')]},'starttime':{'type':Sequelize[_0x25ad('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x25ad('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x25ad('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x25ad('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x25ad('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x25ad('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x25ad('0x3')]},'campaign':{'type':Sequelize[_0x25ad('0x3')]},'campaigntype':{'type':Sequelize[_0x25ad('0x3')]},'membername':{'type':Sequelize[_0x25ad('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x25ad('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x25ad('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x25ad('0x4')]},'recallme':{'type':Sequelize[_0x25ad('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x25ad('0x4')]},'edited':{'type':Sequelize[_0x25ad('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x25ad('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x25ad('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x25ad('0x2')],'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 82eae7c..c88da76 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 _0x9153=['undefined','count','set','apply','reject','update','then','destroy','error','name','index','map','CmHopperHistory','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','describe','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','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'];(function(_0x7343f5,_0x4e6175){var _0x46f2ff=function(_0x4cf0da){while(--_0x4cf0da){_0x7343f5['push'](_0x7343f5['shift']());}};_0x46f2ff(++_0x4e6175);}(_0x9153,0x1a7));var _0x3915=function(_0x14c8a3,_0x2225ea){_0x14c8a3=_0x14c8a3-0x0;var _0x49b63f=_0x9153[_0x14c8a3];return _0x49b63f;};'use strict';var emlformat=require(_0x3915('0x0'));var rimraf=require(_0x3915('0x1'));var zipdir=require(_0x3915('0x2'));var jsonpatch=require(_0x3915('0x3'));var rp=require('request-promise');var moment=require(_0x3915('0x4'));var BPromise=require(_0x3915('0x5'));var Mustache=require('mustache');var util=require(_0x3915('0x6'));var path=require(_0x3915('0x7'));var sox=require(_0x3915('0x8'));var csv=require(_0x3915('0x9'));var ejs=require(_0x3915('0xa'));var fs=require('fs');var fs_extra=require(_0x3915('0xb'));var _=require(_0x3915('0xc'));var squel=require(_0x3915('0xd'));var crypto=require(_0x3915('0xe'));var jsforce=require(_0x3915('0xf'));var deskjs=require(_0x3915('0x10'));var toCsv=require(_0x3915('0x9'));var querystring=require(_0x3915('0x11'));var Papa=require('papaparse');var Redis=require(_0x3915('0x12'));var authService=require(_0x3915('0x13'));var qs=require(_0x3915('0x14'));var as=require(_0x3915('0x15'));var hardwareService=require(_0x3915('0x16'));var logger=require('../../config/logger')(_0x3915('0x17'));var utils=require('../../config/utils');var config=require(_0x3915('0x18'));var licenseUtil=require(_0x3915('0x19'));var db=require(_0x3915('0x1a'))['db'];function respondWithStatusCode(_0x5c45d4,_0x24c59b){_0x24c59b=_0x24c59b||0xcc;return function(_0x141590){if(_0x141590){return _0x5c45d4[_0x3915('0x1b')](_0x24c59b);}return _0x5c45d4[_0x3915('0x1c')](_0x24c59b)[_0x3915('0x1d')]();};}function respondWithResult(_0x5c3aeb,_0x601ae1){_0x601ae1=_0x601ae1||0xc8;return function(_0x1ab82c){if(_0x1ab82c){return _0x5c3aeb['status'](_0x601ae1)[_0x3915('0x1e')](_0x1ab82c);}};}function respondWithFilteredResult(_0x3241c3,_0x2a14d1){return function(_0x287658){if(_0x287658){var _0x5c9b82=typeof _0x2a14d1[_0x3915('0x1f')]==='undefined'&&typeof _0x2a14d1[_0x3915('0x20')]===_0x3915('0x21');var _0x1f7dbe=_0x287658[_0x3915('0x22')];var _0x2745a3=_0x5c9b82?0x0:_0x2a14d1[_0x3915('0x1f')];var _0x39dfe6=_0x5c9b82?_0x287658[_0x3915('0x22')]:_0x2a14d1['offset']+_0x2a14d1['limit'];var _0x41db12;if(_0x39dfe6>=_0x1f7dbe){_0x39dfe6=_0x1f7dbe;_0x41db12=0xc8;}else{_0x41db12=0xce;}_0x3241c3[_0x3915('0x1c')](_0x41db12);return _0x3241c3[_0x3915('0x23')]('Content-Range',_0x2745a3+'-'+_0x39dfe6+'/'+_0x1f7dbe)[_0x3915('0x1e')](_0x287658);}return null;};}function patchUpdates(_0x497639){return function(_0x5b4f5e){try{jsonpatch[_0x3915('0x24')](_0x5b4f5e,_0x497639,!![]);}catch(_0x57dcb3){return BPromise[_0x3915('0x25')](_0x57dcb3);}return _0x5b4f5e['save']();};}function saveUpdates(_0x6f782b,_0x2ffcd6){return function(_0x25136c){if(_0x25136c){return _0x25136c[_0x3915('0x26')](_0x6f782b)[_0x3915('0x27')](function(_0x2a32fa){return _0x2a32fa;});}return null;};}function removeEntity(_0x2f351a,_0x2168cb){return function(_0x403699){if(_0x403699){return _0x403699[_0x3915('0x28')]()[_0x3915('0x27')](function(){_0x2f351a[_0x3915('0x1c')](0xcc)[_0x3915('0x1d')]();});}};}function handleEntityNotFound(_0x232aa2,_0x3043c8){return function(_0x428c98){if(!_0x428c98){_0x232aa2[_0x3915('0x1b')](0x194);}return _0x428c98;};}function handleError(_0x29aae2,_0x8eaf80){_0x8eaf80=_0x8eaf80||0x1f4;return function(_0x2bff31){logger[_0x3915('0x29')](_0x2bff31['stack']);if(_0x2bff31[_0x3915('0x2a')]){delete _0x2bff31['name'];}_0x29aae2[_0x3915('0x1c')](_0x8eaf80)['send'](_0x2bff31);};}exports[_0x3915('0x2b')]=function(_0x9f005b,_0x1f9791){var _0x2b0be3={},_0x15900f={},_0x52f9e9={'count':0x0,'rows':[]};var _0x2dce18=_[_0x3915('0x2c')](db[_0x3915('0x2d')]['rawAttributes'],function(_0x1d415a){return{'name':_0x1d415a[_0x3915('0x2e')],'type':_0x1d415a[_0x3915('0x2f')][_0x3915('0x30')]};});_0x15900f[_0x3915('0x31')]=_[_0x3915('0x2c')](_0x2dce18,'name');_0x15900f[_0x3915('0x32')]=_[_0x3915('0x33')](_0x9f005b[_0x3915('0x32')]);_0x15900f['filters']=_[_0x3915('0x34')](_0x15900f['model'],_0x15900f['query']);_0x2b0be3[_0x3915('0x35')]=_[_0x3915('0x34')](_0x15900f[_0x3915('0x31')],qs[_0x3915('0x36')](_0x9f005b[_0x3915('0x32')]['fields']));_0x2b0be3[_0x3915('0x35')]=_0x2b0be3[_0x3915('0x35')][_0x3915('0x37')]?_0x2b0be3[_0x3915('0x35')]:_0x15900f[_0x3915('0x31')];if(!_0x9f005b['query'][_0x3915('0x38')]('nolimit')){_0x2b0be3[_0x3915('0x20')]=qs[_0x3915('0x20')](_0x9f005b[_0x3915('0x32')][_0x3915('0x20')]);_0x2b0be3[_0x3915('0x1f')]=qs['offset'](_0x9f005b['query']['offset']);}_0x2b0be3[_0x3915('0x39')]=qs['sort'](_0x9f005b[_0x3915('0x32')]['sort']);_0x2b0be3[_0x3915('0x3a')]=qs[_0x3915('0x3b')](_['pick'](_0x9f005b[_0x3915('0x32')],_0x15900f[_0x3915('0x3b')]),_0x2dce18);if(_0x9f005b['query'][_0x3915('0x3c')]){_0x2b0be3[_0x3915('0x3a')]=_[_0x3915('0x3d')](_0x2b0be3[_0x3915('0x3a')],{'$or':_[_0x3915('0x2c')](_0x2dce18,function(_0x5d97b4){if(_0x5d97b4[_0x3915('0x2f')]!==_0x3915('0x3e')){var _0x5bbd96={};_0x5bbd96[_0x5d97b4['name']]={'$like':'%'+_0x9f005b['query'][_0x3915('0x3c')]+'%'};return _0x5bbd96;}})});}_0x2b0be3=_[_0x3915('0x3d')]({},_0x2b0be3,_0x9f005b[_0x3915('0x3f')]);var _0x223ff9={'where':_0x2b0be3[_0x3915('0x3a')]};return db[_0x3915('0x2d')][_0x3915('0x22')](_0x223ff9)[_0x3915('0x27')](function(_0x32f1b9){_0x52f9e9[_0x3915('0x22')]=_0x32f1b9;if(_0x9f005b[_0x3915('0x32')][_0x3915('0x40')]){_0x2b0be3[_0x3915('0x41')]=[{'all':!![]}];}return db[_0x3915('0x2d')][_0x3915('0x42')](_0x2b0be3);})[_0x3915('0x27')](function(_0x2dff37){_0x52f9e9[_0x3915('0x43')]=_0x2dff37;return _0x52f9e9;})[_0x3915('0x27')](respondWithFilteredResult(_0x1f9791,_0x2b0be3))[_0x3915('0x44')](handleError(_0x1f9791,null));};exports['show']=function(_0x5c4ec7,_0x525b3c){var _0x46fa33={'raw':!![],'where':{'id':_0x5c4ec7[_0x3915('0x45')]['id']}},_0x4b50c0={};_0x4b50c0[_0x3915('0x31')]=_[_0x3915('0x33')](db[_0x3915('0x2d')][_0x3915('0x46')]);_0x4b50c0[_0x3915('0x32')]=_['keys'](_0x5c4ec7[_0x3915('0x32')]);_0x4b50c0[_0x3915('0x3b')]=_['intersection'](_0x4b50c0[_0x3915('0x31')],_0x4b50c0['query']);_0x46fa33[_0x3915('0x35')]=_['intersection'](_0x4b50c0['model'],qs['fields'](_0x5c4ec7[_0x3915('0x32')][_0x3915('0x36')]));_0x46fa33[_0x3915('0x35')]=_0x46fa33[_0x3915('0x35')][_0x3915('0x37')]?_0x46fa33[_0x3915('0x35')]:_0x4b50c0['model'];if(_0x5c4ec7['query'][_0x3915('0x40')]){_0x46fa33['include']=[{'all':!![]}];}_0x46fa33=_['merge']({},_0x46fa33,_0x5c4ec7[_0x3915('0x3f')]);return db['CmHopperHistory']['find'](_0x46fa33)[_0x3915('0x27')](handleEntityNotFound(_0x525b3c,null))[_0x3915('0x27')](respondWithResult(_0x525b3c,null))[_0x3915('0x44')](handleError(_0x525b3c,null));};exports[_0x3915('0x47')]=function(_0x1bbf96,_0x34795f){return db[_0x3915('0x2d')]['create'](_0x1bbf96[_0x3915('0x48')],{})[_0x3915('0x27')](respondWithResult(_0x34795f,0xc9))[_0x3915('0x44')](handleError(_0x34795f,null));};exports[_0x3915('0x49')]=function(_0xc2e039,_0x4e0545){return db[_0x3915('0x2d')][_0x3915('0x49')]()[_0x3915('0x27')](respondWithResult(_0x4e0545,null))[_0x3915('0x44')](handleError(_0x4e0545,null));};exports['update']=function(_0x23fe14,_0x58e069){if(_0x23fe14[_0x3915('0x48')][_0x3915('0x4a')]){delete _0x23fe14[_0x3915('0x48')][_0x3915('0x4a')];}return db[_0x3915('0x2d')][_0x3915('0x4b')]({'where':{'uniqueid':_0x23fe14[_0x3915('0x45')]['id']}})[_0x3915('0x27')](handleEntityNotFound(_0x58e069,null))[_0x3915('0x27')](saveUpdates(_0x23fe14[_0x3915('0x48')],null))[_0x3915('0x27')](respondWithResult(_0x58e069,null))['catch'](handleError(_0x58e069,null));}; \ No newline at end of file +var _0x4672=['map','CmHopperHistory','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','describe','body','uniqueid','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','end','status','offset','limit','count','json','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x4672,0x1c4));var _0x2467=function(_0x1cb574,_0x318720){_0x1cb574=_0x1cb574-0x0;var _0x3f11a5=_0x4672[_0x1cb574];return _0x3f11a5;};'use strict';var emlformat=require(_0x2467('0x0'));var rimraf=require(_0x2467('0x1'));var zipdir=require(_0x2467('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2467('0x3'));var moment=require('moment');var BPromise=require(_0x2467('0x4'));var Mustache=require('mustache');var util=require(_0x2467('0x5'));var path=require(_0x2467('0x6'));var sox=require(_0x2467('0x7'));var csv=require('to-csv');var ejs=require(_0x2467('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2467('0x9'));var squel=require(_0x2467('0xa'));var crypto=require(_0x2467('0xb'));var jsforce=require(_0x2467('0xc'));var deskjs=require(_0x2467('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2467('0xe'));var Papa=require(_0x2467('0xf'));var Redis=require(_0x2467('0x10'));var authService=require(_0x2467('0x11'));var qs=require(_0x2467('0x12'));var as=require(_0x2467('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2467('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x2467('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2467('0x16'))['db'];function respondWithStatusCode(_0x4c9e6b,_0x532ac9){_0x532ac9=_0x532ac9||0xcc;return function(_0x9a25b9){if(_0x9a25b9){return _0x4c9e6b['sendStatus'](_0x532ac9);}return _0x4c9e6b['status'](_0x532ac9)[_0x2467('0x17')]();};}function respondWithResult(_0x26a510,_0x383ed9){_0x383ed9=_0x383ed9||0xc8;return function(_0x4ef0a0){if(_0x4ef0a0){return _0x26a510[_0x2467('0x18')](_0x383ed9)['json'](_0x4ef0a0);}};}function respondWithFilteredResult(_0x4c49de,_0x31d29b){return function(_0x1c42dd){if(_0x1c42dd){var _0x39737e=typeof _0x31d29b[_0x2467('0x19')]==='undefined'&&typeof _0x31d29b[_0x2467('0x1a')]==='undefined';var _0x54d59c=_0x1c42dd[_0x2467('0x1b')];var _0x37c46e=_0x39737e?0x0:_0x31d29b[_0x2467('0x19')];var _0x5c397b=_0x39737e?_0x1c42dd[_0x2467('0x1b')]:_0x31d29b[_0x2467('0x19')]+_0x31d29b[_0x2467('0x1a')];var _0x2b35fb;if(_0x5c397b>=_0x54d59c){_0x5c397b=_0x54d59c;_0x2b35fb=0xc8;}else{_0x2b35fb=0xce;}_0x4c49de[_0x2467('0x18')](_0x2b35fb);return _0x4c49de['set']('Content-Range',_0x37c46e+'-'+_0x5c397b+'/'+_0x54d59c)[_0x2467('0x1c')](_0x1c42dd);}return null;};}function patchUpdates(_0x494d45){return function(_0x20969a){try{jsonpatch['apply'](_0x20969a,_0x494d45,!![]);}catch(_0x3d717a){return BPromise[_0x2467('0x1d')](_0x3d717a);}return _0x20969a[_0x2467('0x1e')]();};}function saveUpdates(_0x3f4e93,_0x31acda){return function(_0x33ae32){if(_0x33ae32){return _0x33ae32[_0x2467('0x1f')](_0x3f4e93)[_0x2467('0x20')](function(_0x256699){return _0x256699;});}return null;};}function removeEntity(_0x49db26,_0x2410ac){return function(_0x42a41a){if(_0x42a41a){return _0x42a41a[_0x2467('0x21')]()['then'](function(){_0x49db26[_0x2467('0x18')](0xcc)[_0x2467('0x17')]();});}};}function handleEntityNotFound(_0x3215c3,_0x3059e8){return function(_0x5632e7){if(!_0x5632e7){_0x3215c3['sendStatus'](0x194);}return _0x5632e7;};}function handleError(_0x2c348f,_0xb44343){_0xb44343=_0xb44343||0x1f4;return function(_0x52d102){logger[_0x2467('0x22')](_0x52d102[_0x2467('0x23')]);if(_0x52d102[_0x2467('0x24')]){delete _0x52d102['name'];}_0x2c348f[_0x2467('0x18')](_0xb44343)[_0x2467('0x25')](_0x52d102);};}exports['index']=function(_0x23f125,_0x215dc4){var _0xb13a4c={},_0x31e61e={},_0x113c53={'count':0x0,'rows':[]};var _0x368daa=_[_0x2467('0x26')](db[_0x2467('0x27')][_0x2467('0x28')],function(_0x22de11){return{'name':_0x22de11['fieldName'],'type':_0x22de11[_0x2467('0x29')][_0x2467('0x2a')]};});_0x31e61e[_0x2467('0x2b')]=_['map'](_0x368daa,_0x2467('0x24'));_0x31e61e[_0x2467('0x2c')]=_['keys'](_0x23f125[_0x2467('0x2c')]);_0x31e61e[_0x2467('0x2d')]=_[_0x2467('0x2e')](_0x31e61e[_0x2467('0x2b')],_0x31e61e[_0x2467('0x2c')]);_0xb13a4c[_0x2467('0x2f')]=_['intersection'](_0x31e61e[_0x2467('0x2b')],qs[_0x2467('0x30')](_0x23f125[_0x2467('0x2c')][_0x2467('0x30')]));_0xb13a4c[_0x2467('0x2f')]=_0xb13a4c[_0x2467('0x2f')][_0x2467('0x31')]?_0xb13a4c[_0x2467('0x2f')]:_0x31e61e[_0x2467('0x2b')];if(!_0x23f125[_0x2467('0x2c')][_0x2467('0x32')](_0x2467('0x33'))){_0xb13a4c[_0x2467('0x1a')]=qs[_0x2467('0x1a')](_0x23f125[_0x2467('0x2c')][_0x2467('0x1a')]);_0xb13a4c[_0x2467('0x19')]=qs['offset'](_0x23f125['query'][_0x2467('0x19')]);}_0xb13a4c['order']=qs['sort'](_0x23f125[_0x2467('0x2c')][_0x2467('0x34')]);_0xb13a4c[_0x2467('0x35')]=qs[_0x2467('0x2d')](_['pick'](_0x23f125[_0x2467('0x2c')],_0x31e61e['filters']),_0x368daa);if(_0x23f125[_0x2467('0x2c')][_0x2467('0x36')]){_0xb13a4c[_0x2467('0x35')]=_[_0x2467('0x37')](_0xb13a4c[_0x2467('0x35')],{'$or':_[_0x2467('0x26')](_0x368daa,function(_0x1f38fa){if(_0x1f38fa['type']!==_0x2467('0x38')){var _0xbf4f46={};_0xbf4f46[_0x1f38fa[_0x2467('0x24')]]={'$like':'%'+_0x23f125[_0x2467('0x2c')][_0x2467('0x36')]+'%'};return _0xbf4f46;}})});}_0xb13a4c=_[_0x2467('0x37')]({},_0xb13a4c,_0x23f125[_0x2467('0x39')]);var _0x14ee20={'where':_0xb13a4c['where']};return db[_0x2467('0x27')][_0x2467('0x1b')](_0x14ee20)[_0x2467('0x20')](function(_0x363dc1){_0x113c53[_0x2467('0x1b')]=_0x363dc1;if(_0x23f125[_0x2467('0x2c')][_0x2467('0x3a')]){_0xb13a4c[_0x2467('0x3b')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0xb13a4c);})[_0x2467('0x20')](function(_0x5fd77b){_0x113c53[_0x2467('0x3c')]=_0x5fd77b;return _0x113c53;})[_0x2467('0x20')](respondWithFilteredResult(_0x215dc4,_0xb13a4c))[_0x2467('0x3d')](handleError(_0x215dc4,null));};exports[_0x2467('0x3e')]=function(_0x12e512,_0x1faf60){var _0x37e466={'raw':!![],'where':{'id':_0x12e512[_0x2467('0x3f')]['id']}},_0x4c322e={};_0x4c322e['model']=_['keys'](db[_0x2467('0x27')]['rawAttributes']);_0x4c322e[_0x2467('0x2c')]=_[_0x2467('0x40')](_0x12e512[_0x2467('0x2c')]);_0x4c322e['filters']=_[_0x2467('0x2e')](_0x4c322e['model'],_0x4c322e[_0x2467('0x2c')]);_0x37e466[_0x2467('0x2f')]=_['intersection'](_0x4c322e[_0x2467('0x2b')],qs[_0x2467('0x30')](_0x12e512[_0x2467('0x2c')][_0x2467('0x30')]));_0x37e466[_0x2467('0x2f')]=_0x37e466['attributes'][_0x2467('0x31')]?_0x37e466['attributes']:_0x4c322e[_0x2467('0x2b')];if(_0x12e512[_0x2467('0x2c')][_0x2467('0x3a')]){_0x37e466[_0x2467('0x3b')]=[{'all':!![]}];}_0x37e466=_['merge']({},_0x37e466,_0x12e512[_0x2467('0x39')]);return db['CmHopperHistory'][_0x2467('0x41')](_0x37e466)[_0x2467('0x20')](handleEntityNotFound(_0x1faf60,null))[_0x2467('0x20')](respondWithResult(_0x1faf60,null))[_0x2467('0x3d')](handleError(_0x1faf60,null));};exports['create']=function(_0x16d1a4,_0x306331){return db['CmHopperHistory'][_0x2467('0x42')](_0x16d1a4['body'],{})[_0x2467('0x20')](respondWithResult(_0x306331,0xc9))[_0x2467('0x3d')](handleError(_0x306331,null));};exports[_0x2467('0x43')]=function(_0x5246ec,_0x1cdf58){return db[_0x2467('0x27')][_0x2467('0x43')]()['then'](respondWithResult(_0x1cdf58,null))[_0x2467('0x3d')](handleError(_0x1cdf58,null));};exports[_0x2467('0x1f')]=function(_0x260be4,_0x373094){if(_0x260be4[_0x2467('0x44')][_0x2467('0x45')]){delete _0x260be4[_0x2467('0x44')]['uniqueid'];}return db[_0x2467('0x27')][_0x2467('0x41')]({'where':{'uniqueid':_0x260be4[_0x2467('0x3f')]['id']}})[_0x2467('0x20')](handleEntityNotFound(_0x373094,null))['then'](saveUpdates(_0x260be4[_0x2467('0x44')],null))[_0x2467('0x20')](respondWithResult(_0x373094,null))[_0x2467('0x3d')](handleError(_0x373094,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 0664df2..ac50792 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 _0x7366=['CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopperHistory.attributes','define'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7366,0x9d));var _0x6736=function(_0x493bbb,_0x15f53b){_0x493bbb=_0x493bbb-0x0;var _0x3f8e0a=_0x7366[_0x493bbb];return _0x3f8e0a;};'use strict';var _=require(_0x6736('0x0'));var util=require(_0x6736('0x1'));var logger=require(_0x6736('0x2'))(_0x6736('0x3'));var moment=require(_0x6736('0x4'));var BPromise=require(_0x6736('0x5'));var rp=require(_0x6736('0x6'));var fs=require('fs');var path=require(_0x6736('0x7'));var rimraf=require(_0x6736('0x8'));var config=require('../../config/environment');var attributes=require(_0x6736('0x9'));module['exports']=function(_0x595d6f,_0x54040b){return _0x595d6f[_0x6736('0xa')](_0x6736('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x6736('0xc'),'fields':[_0x6736('0xc')]},{'name':_0x6736('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ca4=['exports','define','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x4ca4,0x100));var _0x44ca=function(_0xfbf561,_0x535056){_0xfbf561=_0xfbf561-0x0;var _0x387974=_0x4ca4[_0xfbf561];return _0x387974;};'use strict';var _=require(_0x44ca('0x0'));var util=require(_0x44ca('0x1'));var logger=require(_0x44ca('0x2'))(_0x44ca('0x3'));var moment=require(_0x44ca('0x4'));var BPromise=require(_0x44ca('0x5'));var rp=require(_0x44ca('0x6'));var fs=require('fs');var path=require(_0x44ca('0x7'));var rimraf=require('rimraf');var config=require(_0x44ca('0x8'));var attributes=require(_0x44ca('0x9'));module[_0x44ca('0xa')]=function(_0x322c38,_0x2b87a9){return _0x322c38[_0x44ca('0xb')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x44ca('0xc')]},{'name':_0x44ca('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index a64a80f..192f75a 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 _0xb3d3=['catch','AvgHandleTime','where','sequelize','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','COUNT','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','create','options','raw','info','debug'];(function(_0x5cc9e1,_0x99fb0){var _0x386cc2=function(_0x121e38){while(--_0x121e38){_0x5cc9e1['push'](_0x5cc9e1['shift']());}};_0x386cc2(++_0x99fb0);}(_0xb3d3,0x1ba));var _0x3b3d=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0xb3d3[_0x5a7e78];return _0xa8d4a1;};'use strict';var _=require(_0x3b3d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3b3d('0x1'));var rs=require(_0x3b3d('0x2'));var fs=require('fs');var Redis=require(_0x3b3d('0x3'));var db=require(_0x3b3d('0x4'))['db'];var utils=require(_0x3b3d('0x5'));var logger=require('../../config/logger')(_0x3b3d('0x6'));var config=require(_0x3b3d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3b3d('0x8')][_0x3b3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3630da,_0x2045fd,_0x447d36){return new BPromise(function(_0x21ba49,_0x43bc1e){return client[_0x3b3d('0xa')](_0x3630da,_0x447d36)[_0x3b3d('0xb')](function(_0x54622f){logger['info'](_0x3b3d('0xc'),_0x2045fd,_0x3b3d('0xd'));logger['debug'](_0x3b3d('0xe'),_0x2045fd,_0x3b3d('0xd'),JSON[_0x3b3d('0xf')](_0x54622f));if(_0x54622f[_0x3b3d('0x10')]){if(_0x54622f['error'][_0x3b3d('0x11')]===0x1f4){logger['error'](_0x3b3d('0xc'),_0x2045fd,_0x54622f[_0x3b3d('0x10')][_0x3b3d('0x12')]);return _0x43bc1e(_0x54622f[_0x3b3d('0x10')]['message']);}logger[_0x3b3d('0x10')](_0x3b3d('0xc'),_0x2045fd,_0x54622f[_0x3b3d('0x10')]['message']);return _0x21ba49(_0x54622f[_0x3b3d('0x10')][_0x3b3d('0x12')]);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x2045fd,_0x3b3d('0xd'));_0x21ba49(_0x54622f[_0x3b3d('0x13')][_0x3b3d('0x12')]);}})['catch'](function(_0x2cda55){logger[_0x3b3d('0x10')](_0x3b3d('0xc'),_0x2045fd,_0x2cda55);_0x43bc1e(_0x2cda55);});});}exports[_0x3b3d('0x14')]=function(_0x5b7c08){var _0x304f1e=this;return new Promise(function(_0x4be438,_0x5e9b40){return db[_0x3b3d('0x15')][_0x3b3d('0x16')](_0x5b7c08['body'],{'raw':_0x5b7c08[_0x3b3d('0x17')]?_0x5b7c08[_0x3b3d('0x17')][_0x3b3d('0x18')]===undefined?!![]:![]:!![]})[_0x3b3d('0xb')](function(_0x4d19fa){logger[_0x3b3d('0x19')]('CreateCmHopperHistory',_0x5b7c08);logger[_0x3b3d('0x1a')]('CreateCmHopperHistory',_0x5b7c08,JSON[_0x3b3d('0xf')](_0x4d19fa));_0x4be438(_0x4d19fa);})[_0x3b3d('0x1b')](function(_0x511d7c){logger[_0x3b3d('0x10')]('CreateCmHopperHistory',_0x511d7c[_0x3b3d('0x12')],_0x5b7c08);_0x5e9b40(_0x304f1e[_0x3b3d('0x10')](0x1f4,_0x511d7c[_0x3b3d('0x12')]));});});};exports[_0x3b3d('0x1c')]=function(_0x1da3b4){var _0x22dd9a=this;return new Promise(function(_0x14b9b0,_0x5921ee){return db[_0x3b3d('0x15')]['findAll']({'raw':_0x1da3b4['options']?_0x1da3b4['options'][_0x3b3d('0x18')]===undefined?!![]:![]:!![],'where':_0x1da3b4[_0x3b3d('0x17')]?_0x1da3b4[_0x3b3d('0x17')][_0x3b3d('0x1d')]||null:null,'attributes':[[db[_0x3b3d('0x1e')]['fn']('COUNT',db['sequelize'][_0x3b3d('0x1f')]('id')),'predictiveIntervalTotalCalls'],[db[_0x3b3d('0x1e')]['fn']('COUNT',db[_0x3b3d('0x1e')]['fn']('IF',db['sequelize'][_0x3b3d('0x20')](_0x3b3d('0x21')))),_0x3b3d('0x22')],[db[_0x3b3d('0x1e')]['fn'](_0x3b3d('0x23'),db[_0x3b3d('0x1e')]['fn']('IF',db[_0x3b3d('0x1e')][_0x3b3d('0x20')]('`state`\x20=\x2010,\x201,\x20null'))),_0x3b3d('0x24')],[db[_0x3b3d('0x1e')]['fn'](_0x3b3d('0x23'),db[_0x3b3d('0x1e')]['fn']('IF',db[_0x3b3d('0x1e')][_0x3b3d('0x20')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn']('AVG',db[_0x3b3d('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x3b3d('0x25')))),_0x3b3d('0x26')],[db[_0x3b3d('0x1e')]['fn'](_0x3b3d('0x27'),db[_0x3b3d('0x1e')]['fn']('IF',db[_0x3b3d('0x1e')][_0x3b3d('0x20')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x3b3d('0x28')]]})[_0x3b3d('0xb')](function(_0x488224){logger[_0x3b3d('0x19')](_0x3b3d('0x1c'),_0x1da3b4);logger[_0x3b3d('0x1a')](_0x3b3d('0x1c'),_0x1da3b4,JSON[_0x3b3d('0xf')](_0x488224));_0x14b9b0(_0x488224);})[_0x3b3d('0x1b')](function(_0x22be39){logger[_0x3b3d('0x10')](_0x3b3d('0x1c'),_0x22be39['message'],_0x1da3b4);_0x5921ee(_0x22dd9a[_0x3b3d('0x10')](0x1f4,_0x22be39[_0x3b3d('0x12')]));});});};exports[_0x3b3d('0x29')]=function(_0x36e6d1){var _0x316d2d=this;return new Promise(function(_0xd95271,_0x4439eb){return db['CmHopperHistory'][_0x3b3d('0x2a')]({'raw':_0x36e6d1[_0x3b3d('0x17')]?_0x36e6d1[_0x3b3d('0x17')][_0x3b3d('0x18')]===undefined?!![]:![]:!![],'where':_0x36e6d1[_0x3b3d('0x17')]?_0x36e6d1[_0x3b3d('0x17')][_0x3b3d('0x1d')]||null:null,'attributes':[[_0x3b3d('0x2b'),_0x3b3d('0x2c')],[db[_0x3b3d('0x1e')]['fn'](_0x3b3d('0x23'),db[_0x3b3d('0x1e')]['fn']('IF',db['sequelize'][_0x3b3d('0x20')](_0x3b3d('0x2d')))),_0x3b3d('0x2e')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3b3d('0x1e')][_0x3b3d('0x20')](_0x3b3d('0x2f')))),_0x3b3d('0x30')],[db['sequelize']['fn'](_0x3b3d('0x23'),db[_0x3b3d('0x1e')]['fn']('IF',db[_0x3b3d('0x1e')][_0x3b3d('0x20')]('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0x3b3d('0x1e')]['fn'](_0x3b3d('0x23'),db[_0x3b3d('0x1e')]['fn']('IF',db['sequelize'][_0x3b3d('0x20')](_0x3b3d('0x31')))),_0x3b3d('0x32')],[db['sequelize']['fn'](_0x3b3d('0x23'),db[_0x3b3d('0x1e')]['fn']('IF',db[_0x3b3d('0x1e')][_0x3b3d('0x20')](_0x3b3d('0x33')))),_0x3b3d('0x34')],[db[_0x3b3d('0x1e')]['fn'](_0x3b3d('0x23'),db['sequelize']['fn']('IF',db['sequelize'][_0x3b3d('0x20')](_0x3b3d('0x35')))),_0x3b3d('0x36')],[db[_0x3b3d('0x1e')]['fn'](_0x3b3d('0x23'),db[_0x3b3d('0x1e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x3b3d('0x37')],[db['sequelize']['fn'](_0x3b3d('0x23'),db['sequelize']['fn']('IF',db[_0x3b3d('0x1e')][_0x3b3d('0x20')]('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0x3b3d('0x1e')]['fn'](_0x3b3d('0x23'),db[_0x3b3d('0x1e')]['fn']('IF',db[_0x3b3d('0x1e')]['literal'](_0x3b3d('0x38')))),'outboundBlacklistCallsDay'],[db[_0x3b3d('0x1e')]['fn'](_0x3b3d('0x23'),db['sequelize']['fn']('IF',db['sequelize'][_0x3b3d('0x20')](_0x3b3d('0x39')))),_0x3b3d('0x3a')],[db['sequelize']['fn']('COUNT',db[_0x3b3d('0x1e')]['fn']('IF',db[_0x3b3d('0x1e')]['literal'](_0x3b3d('0x3b')))),_0x3b3d('0x3c')],[db['sequelize']['fn']('COUNT',db[_0x3b3d('0x1e')]['fn']('IF',db[_0x3b3d('0x1e')][_0x3b3d('0x20')]('`state`\x20=\x2016,\x201,\x20null'))),_0x3b3d('0x3d')],[db[_0x3b3d('0x1e')]['fn'](_0x3b3d('0x23'),db[_0x3b3d('0x1e')]['fn']('IF',db[_0x3b3d('0x1e')][_0x3b3d('0x20')]('`state`\x20=\x2020,\x201,\x20null'))),_0x3b3d('0x3c')],[db[_0x3b3d('0x1e')]['fn'](_0x3b3d('0x23'),db['sequelize']['fn']('IF',db[_0x3b3d('0x1e')][_0x3b3d('0x20')](_0x3b3d('0x3e')))),_0x3b3d('0x3f')]],'group':[_0x3b3d('0x2b')]})['then'](function(_0x1cb124){logger[_0x3b3d('0x19')]('GetVoiceQueueHopperHistory',_0x36e6d1);logger[_0x3b3d('0x1a')](_0x3b3d('0x29'),_0x36e6d1,JSON[_0x3b3d('0xf')](_0x1cb124));_0xd95271(_0x1cb124);})[_0x3b3d('0x1b')](function(_0x3e0768){logger[_0x3b3d('0x10')](_0x3b3d('0x29'),_0x3e0768[_0x3b3d('0x12')],_0x36e6d1);_0x4439eb(_0x316d2d[_0x3b3d('0x10')](0x1f4,_0x3e0768[_0x3b3d('0x12')]));});});};exports['GetCampaignHopperHistory']=function(_0x5b33f9){var _0x4a60b2=this;return new Promise(function(_0x1f8183,_0x586bd5){return db[_0x3b3d('0x15')]['findAll']({'raw':_0x5b33f9[_0x3b3d('0x17')]?_0x5b33f9[_0x3b3d('0x17')][_0x3b3d('0x18')]===undefined?!![]:![]:!![],'where':_0x5b33f9[_0x3b3d('0x17')]?_0x5b33f9[_0x3b3d('0x17')]['where']||null:null,'attributes':[[_0x3b3d('0x2b'),'name'],[db[_0x3b3d('0x1e')]['fn']('COUNT',db['sequelize']['col']('id')),_0x3b3d('0x40')],[db[_0x3b3d('0x1e')]['fn'](_0x3b3d('0x23'),db[_0x3b3d('0x1e')]['fn']('IF',db[_0x3b3d('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x3b3d('0x41')]],'group':[_0x3b3d('0x2b')]})['then'](function(_0x2c8ca2){logger[_0x3b3d('0x19')](_0x3b3d('0x42'),_0x5b33f9);logger[_0x3b3d('0x1a')]('GetCampaignHopperHistory',_0x5b33f9,JSON[_0x3b3d('0xf')](_0x2c8ca2));_0x1f8183(_0x2c8ca2);})['catch'](function(_0x44a767){logger[_0x3b3d('0x10')](_0x3b3d('0x42'),_0x44a767[_0x3b3d('0x12')],_0x5b33f9);_0x586bd5(_0x4a60b2[_0x3b3d('0x10')](0x1f4,_0x44a767[_0x3b3d('0x12')]));});});}; \ No newline at end of file +var _0x2821=['rpc','../../config/environment','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','then','AvgHandleTime','findAll','options','raw','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','name','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x2821,0x87));var _0x1282=function(_0x4f2058,_0x1c08f4){_0x4f2058=_0x4f2058-0x0;var _0x55237e=_0x2821[_0x4f2058];return _0x55237e;};'use strict';var _=require(_0x1282('0x0'));var util=require(_0x1282('0x1'));var moment=require(_0x1282('0x2'));var BPromise=require(_0x1282('0x3'));var rs=require(_0x1282('0x4'));var fs=require('fs');var Redis=require(_0x1282('0x5'));var db=require(_0x1282('0x6'))['db'];var utils=require(_0x1282('0x7'));var logger=require(_0x1282('0x8'))(_0x1282('0x9'));var config=require(_0x1282('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1282('0xb')][_0x1282('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x293947,_0x13beb5,_0xa4eee9){return new BPromise(function(_0x1a8666,_0x18d69a){return client[_0x1282('0xd')](_0x293947,_0xa4eee9)['then'](function(_0x41c458){logger[_0x1282('0xe')](_0x1282('0xf'),_0x13beb5,_0x1282('0x10'));logger[_0x1282('0x11')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x13beb5,_0x1282('0x10'),JSON[_0x1282('0x12')](_0x41c458));if(_0x41c458['error']){if(_0x41c458[_0x1282('0x13')][_0x1282('0x14')]===0x1f4){logger['error'](_0x1282('0xf'),_0x13beb5,_0x41c458['error']['message']);return _0x18d69a(_0x41c458[_0x1282('0x13')][_0x1282('0x15')]);}logger[_0x1282('0x13')](_0x1282('0xf'),_0x13beb5,_0x41c458['error']['message']);return _0x1a8666(_0x41c458['error'][_0x1282('0x15')]);}else{logger[_0x1282('0xe')](_0x1282('0xf'),_0x13beb5,_0x1282('0x10'));_0x1a8666(_0x41c458[_0x1282('0x16')][_0x1282('0x15')]);}})[_0x1282('0x17')](function(_0x116ef1){logger['error'](_0x1282('0xf'),_0x13beb5,_0x116ef1);_0x18d69a(_0x116ef1);});});}exports[_0x1282('0x18')]=function(_0x518733){var _0x48c857=this;return new Promise(function(_0xebc97e,_0x4e3ec7){return db[_0x1282('0x19')][_0x1282('0x1a')](_0x518733['body'],{'raw':_0x518733['options']?_0x518733['options']['raw']===undefined?!![]:![]:!![]})[_0x1282('0x1b')](function(_0x2f4e4a){logger[_0x1282('0xe')](_0x1282('0x18'),_0x518733);logger[_0x1282('0x11')](_0x1282('0x18'),_0x518733,JSON[_0x1282('0x12')](_0x2f4e4a));_0xebc97e(_0x2f4e4a);})[_0x1282('0x17')](function(_0x153159){logger[_0x1282('0x13')]('CreateCmHopperHistory',_0x153159[_0x1282('0x15')],_0x518733);_0x4e3ec7(_0x48c857['error'](0x1f4,_0x153159[_0x1282('0x15')]));});});};exports[_0x1282('0x1c')]=function(_0x158123){var _0x3c116f=this;return new Promise(function(_0x22f8d5,_0x59486f){return db[_0x1282('0x19')][_0x1282('0x1d')]({'raw':_0x158123[_0x1282('0x1e')]?_0x158123[_0x1282('0x1e')][_0x1282('0x1f')]===undefined?!![]:![]:!![],'where':_0x158123[_0x1282('0x1e')]?_0x158123[_0x1282('0x1e')][_0x1282('0x20')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x1282('0x21')][_0x1282('0x22')]('id')),_0x1282('0x23')],[db['sequelize']['fn'](_0x1282('0x24'),db['sequelize']['fn']('IF',db[_0x1282('0x21')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1282('0x21')][_0x1282('0x25')](_0x1282('0x26')))),_0x1282('0x27')],[db[_0x1282('0x21')]['fn'](_0x1282('0x24'),db[_0x1282('0x21')]['fn']('IF',db[_0x1282('0x21')][_0x1282('0x25')]('`state`\x20=\x2011,\x201,\x20null'))),_0x1282('0x28')],[db[_0x1282('0x21')]['fn'](_0x1282('0x29'),db[_0x1282('0x21')]['fn']('IF',db[_0x1282('0x21')]['literal'](_0x1282('0x2a')))),_0x1282('0x2b')],[db['sequelize']['fn']('AVG',db['sequelize']['fn']('IF',db[_0x1282('0x21')]['literal'](_0x1282('0x2c')))),_0x1282('0x2d')]]})['then'](function(_0x1a9c85){logger['info']('AvgHandleTime',_0x158123);logger[_0x1282('0x11')](_0x1282('0x1c'),_0x158123,JSON[_0x1282('0x12')](_0x1a9c85));_0x22f8d5(_0x1a9c85);})[_0x1282('0x17')](function(_0x55dd47){logger['error'](_0x1282('0x1c'),_0x55dd47['message'],_0x158123);_0x59486f(_0x3c116f[_0x1282('0x13')](0x1f4,_0x55dd47[_0x1282('0x15')]));});});};exports[_0x1282('0x2e')]=function(_0xa388a5){var _0x56c6b9=this;return new Promise(function(_0x40ae67,_0x5be434){return db[_0x1282('0x19')][_0x1282('0x1d')]({'raw':_0xa388a5[_0x1282('0x1e')]?_0xa388a5[_0x1282('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xa388a5['options']?_0xa388a5[_0x1282('0x1e')][_0x1282('0x20')]||null:null,'attributes':[[_0x1282('0x2f'),'name'],[db[_0x1282('0x21')]['fn'](_0x1282('0x24'),db[_0x1282('0x21')]['fn']('IF',db[_0x1282('0x21')][_0x1282('0x25')](_0x1282('0x30')))),_0x1282('0x31')],[db[_0x1282('0x21')]['fn'](_0x1282('0x24'),db[_0x1282('0x21')]['fn']('IF',db[_0x1282('0x21')][_0x1282('0x25')](_0x1282('0x32')))),'outboundNoAnswerCallsDay'],[db[_0x1282('0x21')]['fn'](_0x1282('0x24'),db[_0x1282('0x21')]['fn']('IF',db['sequelize']['literal'](_0x1282('0x33')))),_0x1282('0x34')],[db[_0x1282('0x21')]['fn'](_0x1282('0x24'),db[_0x1282('0x21')]['fn']('IF',db['sequelize']['literal'](_0x1282('0x35')))),_0x1282('0x36')],[db[_0x1282('0x21')]['fn']('COUNT',db[_0x1282('0x21')]['fn']('IF',db[_0x1282('0x21')][_0x1282('0x25')](_0x1282('0x37')))),_0x1282('0x38')],[db[_0x1282('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x1282('0x25')](_0x1282('0x39')))),_0x1282('0x3a')],[db[_0x1282('0x21')]['fn'](_0x1282('0x24'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x1282('0x3b')],[db[_0x1282('0x21')]['fn'](_0x1282('0x24'),db[_0x1282('0x21')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0x1282('0x3c')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1282('0x21')][_0x1282('0x25')]('`state`\x20=\x2013,\x201,\x20null'))),_0x1282('0x3d')],[db[_0x1282('0x21')]['fn'](_0x1282('0x24'),db[_0x1282('0x21')]['fn']('IF',db['sequelize']['literal'](_0x1282('0x3e')))),_0x1282('0x3f')],[db[_0x1282('0x21')]['fn'](_0x1282('0x24'),db[_0x1282('0x21')]['fn']('IF',db[_0x1282('0x21')][_0x1282('0x25')](_0x1282('0x40')))),_0x1282('0x41')],[db[_0x1282('0x21')]['fn'](_0x1282('0x24'),db[_0x1282('0x21')]['fn']('IF',db[_0x1282('0x21')][_0x1282('0x25')]('`state`\x20=\x2016,\x201,\x20null'))),_0x1282('0x42')],[db['sequelize']['fn'](_0x1282('0x24'),db[_0x1282('0x21')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x1282('0x41')],[db[_0x1282('0x21')]['fn'](_0x1282('0x24'),db[_0x1282('0x21')]['fn']('IF',db[_0x1282('0x21')][_0x1282('0x25')](_0x1282('0x43')))),'outboundReCallsDay']],'group':[_0x1282('0x2f')]})[_0x1282('0x1b')](function(_0x321edb){logger[_0x1282('0xe')]('GetVoiceQueueHopperHistory',_0xa388a5);logger[_0x1282('0x11')](_0x1282('0x2e'),_0xa388a5,JSON['stringify'](_0x321edb));_0x40ae67(_0x321edb);})[_0x1282('0x17')](function(_0x57e080){logger[_0x1282('0x13')]('GetVoiceQueueHopperHistory',_0x57e080[_0x1282('0x15')],_0xa388a5);_0x5be434(_0x56c6b9['error'](0x1f4,_0x57e080[_0x1282('0x15')]));});});};exports['GetCampaignHopperHistory']=function(_0x38ca4a){var _0xdbe58=this;return new Promise(function(_0x2bd901,_0xde14d8){return db[_0x1282('0x19')][_0x1282('0x1d')]({'raw':_0x38ca4a[_0x1282('0x1e')]?_0x38ca4a[_0x1282('0x1e')][_0x1282('0x1f')]===undefined?!![]:![]:!![],'where':_0x38ca4a[_0x1282('0x1e')]?_0x38ca4a['options'][_0x1282('0x20')]||null:null,'attributes':[[_0x1282('0x2f'),_0x1282('0x44')],[db[_0x1282('0x21')]['fn'](_0x1282('0x24'),db[_0x1282('0x21')]['col']('id')),_0x1282('0x45')],[db['sequelize']['fn'](_0x1282('0x24'),db[_0x1282('0x21')]['fn']('IF',db[_0x1282('0x21')][_0x1282('0x25')](_0x1282('0x33')))),_0x1282('0x46')]],'group':['campaign']})[_0x1282('0x1b')](function(_0x2bd29c){logger['info'](_0x1282('0x47'),_0x38ca4a);logger[_0x1282('0x11')](_0x1282('0x47'),_0x38ca4a,JSON['stringify'](_0x2bd29c));_0x2bd901(_0x2bd29c);})[_0x1282('0x17')](function(_0x515e15){logger[_0x1282('0x13')](_0x1282('0x47'),_0x515e15['message'],_0x38ca4a);_0xde14d8(_0xdbe58['error'](0x1f4,_0x515e15[_0x1282('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 0595931..9f47b7d 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 _0xd8c3=['../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x524a92,_0x42184e){var _0x56932b=function(_0xd5700a){while(--_0xd5700a){_0x524a92['push'](_0x524a92['shift']());}};_0x56932b(++_0x42184e);}(_0xd8c3,0x1ed));var _0x3d8c=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xd8c3[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0x3d8c('0x0'));var util=require(_0x3d8c('0x1'));var path=require(_0x3d8c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3d8c('0x3')]();var fs_extra=require(_0x3d8c('0x4'));var auth=require(_0x3d8c('0x5'));var interaction=require(_0x3d8c('0x6'));var config=require(_0x3d8c('0x7'));var controller=require(_0x3d8c('0x8'));router[_0x3d8c('0x9')]('/',auth[_0x3d8c('0xa')](),controller[_0x3d8c('0xb')]);router[_0x3d8c('0x9')](_0x3d8c('0xc'),auth[_0x3d8c('0xa')](),controller[_0x3d8c('0xd')]);router['get']('/:id',auth[_0x3d8c('0xa')](),controller[_0x3d8c('0xe')]);router[_0x3d8c('0xf')]('/',auth[_0x3d8c('0xa')](),controller['create']);router[_0x3d8c('0x10')](_0x3d8c('0x11'),auth['isAuthenticated'](),controller[_0x3d8c('0x12')]);module[_0x3d8c('0x13')]=router; \ No newline at end of file +var _0x51cd=['describe','/:id','show','post','create','multer','connect-timeout','express','Router','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index'];(function(_0x4737aa,_0x266f4b){var _0x275ab2=function(_0x2d4454){while(--_0x2d4454){_0x4737aa['push'](_0x4737aa['shift']());}};_0x275ab2(++_0x266f4b);}(_0x51cd,0x101));var _0xd51c=function(_0x151c0c,_0x4e8970){_0x151c0c=_0x151c0c-0x0;var _0x54a4b0=_0x51cd[_0x151c0c];return _0x54a4b0;};'use strict';var multer=require(_0xd51c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd51c('0x1'));var express=require(_0xd51c('0x2'));var router=express[_0xd51c('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd51c('0x4'));var controller=require(_0xd51c('0x5'));router[_0xd51c('0x6')]('/',auth[_0xd51c('0x7')](),controller[_0xd51c('0x8')]);router[_0xd51c('0x6')]('/describe',auth[_0xd51c('0x7')](),controller[_0xd51c('0x9')]);router['get'](_0xd51c('0xa'),auth[_0xd51c('0x7')](),controller[_0xd51c('0xb')]);router[_0xd51c('0xc')]('/',auth[_0xd51c('0x7')](),controller[_0xd51c('0xd')]);router['put'](_0xd51c('0xa'),auth['isAuthenticated'](),controller['update']);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 d71ee78..34377c3 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 _0x5447=['name','sequelize','STRING'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5447,0xf1));var _0x7544=function(_0x2887b3,_0x321f33){_0x2887b3=_0x2887b3-0x0;var _0x351294=_0x5447[_0x2887b3];return _0x351294;};'use strict';var Sequelize=require(_0x7544('0x0'));module['exports']={'name':{'type':Sequelize[_0x7544('0x1')],'unique':_0x7544('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x7544('0x1')]}}; \ No newline at end of file +var _0xadb8=['STRING'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xadb8,0x1d0));var _0x8adb=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0xadb8[_0x41bdd4];return _0x5c03a6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8adb('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8adb('0x0')]},'dialPrefix':{'type':Sequelize[_0x8adb('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 584e805..ba48d03 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 _0x0dbc=['cf_%d','raw','getContactsCsv','order','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','findOne','nolimit','removeDispositions','ids','addContacts','tags','isArray','push','each','CmContact','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format'];(function(_0xdf5d09,_0x584e27){var _0x486bca=function(_0x562f9d){while(--_0x562f9d){_0xdf5d09['push'](_0xdf5d09['shift']());}};_0x486bca(++_0x584e27);}(_0x0dbc,0x1e8));var _0xc0db=function(_0x2a6505,_0x122a9c){_0x2a6505=_0x2a6505-0x0;var _0x46cbb4=_0x0dbc[_0x2a6505];return _0x46cbb4;};'use strict';var emlformat=require(_0xc0db('0x0'));var rimraf=require(_0xc0db('0x1'));var zipdir=require(_0xc0db('0x2'));var jsonpatch=require(_0xc0db('0x3'));var rp=require(_0xc0db('0x4'));var moment=require(_0xc0db('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc0db('0x6'));var util=require(_0xc0db('0x7'));var path=require(_0xc0db('0x8'));var sox=require(_0xc0db('0x9'));var csv=require(_0xc0db('0xa'));var ejs=require(_0xc0db('0xb'));var fs=require('fs');var fs_extra=require(_0xc0db('0xc'));var _=require('lodash');var squel=require(_0xc0db('0xd'));var crypto=require(_0xc0db('0xe'));var jsforce=require(_0xc0db('0xf'));var deskjs=require(_0xc0db('0x10'));var toCsv=require(_0xc0db('0xa'));var querystring=require(_0xc0db('0x11'));var Papa=require(_0xc0db('0x12'));var Redis=require(_0xc0db('0x13'));var authService=require(_0xc0db('0x14'));var qs=require(_0xc0db('0x15'));var as=require(_0xc0db('0x16'));var hardwareService=require(_0xc0db('0x17'));var logger=require(_0xc0db('0x18'))(_0xc0db('0x19'));var utils=require(_0xc0db('0x1a'));var config=require(_0xc0db('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xc0db('0x1c'))['db'];config['redis']=_['defaults'](config[_0xc0db('0x1d')],{'host':_0xc0db('0x1e'),'port':0x18eb});var socket=require(_0xc0db('0x1f'))(new Redis(config[_0xc0db('0x1d')]));require(_0xc0db('0x20'))[_0xc0db('0x21')](socket);function respondWithStatusCode(_0x457808,_0x4dc6e4){_0x4dc6e4=_0x4dc6e4||0xcc;return function(_0x5aa56d){if(_0x5aa56d){return _0x457808[_0xc0db('0x22')](_0x4dc6e4);}return _0x457808[_0xc0db('0x23')](_0x4dc6e4)[_0xc0db('0x24')]();};}function respondWithResult(_0x45321e,_0x2d572f){_0x2d572f=_0x2d572f||0xc8;return function(_0x185c13){if(_0x185c13){return _0x45321e[_0xc0db('0x23')](_0x2d572f)[_0xc0db('0x25')](_0x185c13);}};}function respondWithFilteredResult(_0x1ea82d,_0x3ea8f0){return function(_0x2bc054){if(_0x2bc054){var _0x17704a=typeof _0x3ea8f0[_0xc0db('0x26')]===_0xc0db('0x27')&&typeof _0x3ea8f0[_0xc0db('0x28')]==='undefined';var _0x4fb894=_0x2bc054['count'];var _0x41a286=_0x17704a?0x0:_0x3ea8f0[_0xc0db('0x26')];var _0x5799ad=_0x17704a?_0x2bc054[_0xc0db('0x29')]:_0x3ea8f0[_0xc0db('0x26')]+_0x3ea8f0[_0xc0db('0x28')];var _0x345111;if(_0x5799ad>=_0x4fb894){_0x5799ad=_0x4fb894;_0x345111=0xc8;}else{_0x345111=0xce;}_0x1ea82d[_0xc0db('0x23')](_0x345111);return _0x1ea82d[_0xc0db('0x2a')]('Content-Range',_0x41a286+'-'+_0x5799ad+'/'+_0x4fb894)[_0xc0db('0x25')](_0x2bc054);}return null;};}function patchUpdates(_0x2827bc){return function(_0x2da2c5){try{jsonpatch[_0xc0db('0x2b')](_0x2da2c5,_0x2827bc,!![]);}catch(_0x5a2fe5){return BPromise[_0xc0db('0x2c')](_0x5a2fe5);}return _0x2da2c5[_0xc0db('0x2d')]();};}function saveUpdates(_0x1fa313,_0x5d1c1c){return function(_0x2ca58f){if(_0x2ca58f){return _0x2ca58f[_0xc0db('0x2e')](_0x1fa313)[_0xc0db('0x2f')](function(_0x6878ef){return _0x6878ef;});}return null;};}function removeEntity(_0x357843,_0x40107f){return function(_0x32001e){if(_0x32001e){return _0x32001e[_0xc0db('0x30')]()[_0xc0db('0x2f')](function(){var _0x88616f=_0x32001e[_0xc0db('0x31')]({'plain':!![]});var _0x22e2aa=_0xc0db('0x32');return db[_0xc0db('0x33')][_0xc0db('0x30')]({'where':{'type':_0x22e2aa,'resourceId':_0x88616f['id']}})[_0xc0db('0x2f')](function(){return _0x32001e;});})[_0xc0db('0x2f')](function(){_0x357843[_0xc0db('0x23')](0xcc)[_0xc0db('0x24')]();});}};}function handleEntityNotFound(_0x19860a,_0x2df827){return function(_0x251291){if(!_0x251291){_0x19860a[_0xc0db('0x22')](0x194);}return _0x251291;};}function handleError(_0x303ad1,_0x58f336){_0x58f336=_0x58f336||0x1f4;return function(_0xc47377){logger[_0xc0db('0x34')](_0xc47377[_0xc0db('0x35')]);if(_0xc47377[_0xc0db('0x36')]){delete _0xc47377[_0xc0db('0x36')];}_0x303ad1[_0xc0db('0x23')](_0x58f336)[_0xc0db('0x37')](_0xc47377);};}exports[_0xc0db('0x38')]=function(_0x1281b6,_0x2b0c69){var _0x57f0df={},_0x4cbb9b={},_0xf422c8={'count':0x0,'rows':[]};var _0x28e1ad=_[_0xc0db('0x39')](db[_0xc0db('0x3a')][_0xc0db('0x3b')],function(_0x316624){return{'name':_0x316624['fieldName'],'type':_0x316624[_0xc0db('0x3c')][_0xc0db('0x3d')]};});_0x4cbb9b[_0xc0db('0x3e')]=_[_0xc0db('0x39')](_0x28e1ad,_0xc0db('0x36'));_0x4cbb9b[_0xc0db('0x3f')]=_[_0xc0db('0x40')](_0x1281b6[_0xc0db('0x3f')]);_0x4cbb9b[_0xc0db('0x41')]=_['intersection'](_0x4cbb9b[_0xc0db('0x3e')],_0x4cbb9b[_0xc0db('0x3f')]);_0x57f0df[_0xc0db('0x42')]=_[_0xc0db('0x43')](_0x4cbb9b[_0xc0db('0x3e')],qs[_0xc0db('0x44')](_0x1281b6['query'][_0xc0db('0x44')]));_0x57f0df[_0xc0db('0x42')]=_0x57f0df[_0xc0db('0x42')]['length']?_0x57f0df[_0xc0db('0x42')]:_0x4cbb9b[_0xc0db('0x3e')];if(!_0x1281b6[_0xc0db('0x3f')][_0xc0db('0x45')]('nolimit')){_0x57f0df['limit']=qs[_0xc0db('0x28')](_0x1281b6['query'][_0xc0db('0x28')]);_0x57f0df[_0xc0db('0x26')]=qs[_0xc0db('0x26')](_0x1281b6[_0xc0db('0x3f')]['offset']);}_0x57f0df['order']=qs[_0xc0db('0x46')](_0x1281b6[_0xc0db('0x3f')][_0xc0db('0x46')]);_0x57f0df[_0xc0db('0x47')]=qs[_0xc0db('0x41')](_[_0xc0db('0x48')](_0x1281b6['query'],_0x4cbb9b[_0xc0db('0x41')]),_0x28e1ad);if(_0x1281b6['query'][_0xc0db('0x49')]){_0x57f0df[_0xc0db('0x47')]=_[_0xc0db('0x4a')](_0x57f0df['where'],{'$or':_[_0xc0db('0x39')](_0x28e1ad,function(_0x350bd4){if(_0x350bd4[_0xc0db('0x3c')]!==_0xc0db('0x4b')){var _0x5cc73f={};_0x5cc73f[_0x350bd4[_0xc0db('0x36')]]={'$like':'%'+_0x1281b6[_0xc0db('0x3f')][_0xc0db('0x49')]+'%'};return _0x5cc73f;}})});}_0x57f0df=_[_0xc0db('0x4a')]({},_0x57f0df,_0x1281b6[_0xc0db('0x4c')]);var _0x173dd6={'where':_0x57f0df['where']};return db[_0xc0db('0x3a')][_0xc0db('0x29')](_0x173dd6)[_0xc0db('0x2f')](function(_0xdfa36e){_0xf422c8['count']=_0xdfa36e;if(_0x1281b6[_0xc0db('0x3f')]['includeAll']){_0x57f0df[_0xc0db('0x4d')]=[{'all':!![]}];}return db[_0xc0db('0x3a')][_0xc0db('0x4e')](_0x57f0df);})[_0xc0db('0x2f')](function(_0x443f7e){_0xf422c8[_0xc0db('0x4f')]=_0x443f7e;return _0xf422c8;})[_0xc0db('0x2f')](respondWithFilteredResult(_0x2b0c69,_0x57f0df))[_0xc0db('0x50')](handleError(_0x2b0c69,null));};exports[_0xc0db('0x51')]=function(_0x423338,_0x3c0be3){var _0x3766eb={'raw':![],'where':{'id':_0x423338['params']['id']}},_0x597b92={};_0x597b92[_0xc0db('0x3e')]=_[_0xc0db('0x40')](db[_0xc0db('0x3a')][_0xc0db('0x3b')]);_0x597b92[_0xc0db('0x3f')]=_[_0xc0db('0x40')](_0x423338[_0xc0db('0x3f')]);_0x597b92[_0xc0db('0x41')]=_[_0xc0db('0x43')](_0x597b92[_0xc0db('0x3e')],_0x597b92['query']);_0x3766eb[_0xc0db('0x42')]=_['intersection'](_0x597b92[_0xc0db('0x3e')],qs[_0xc0db('0x44')](_0x423338[_0xc0db('0x3f')][_0xc0db('0x44')]));_0x3766eb[_0xc0db('0x42')]=_0x3766eb['attributes'][_0xc0db('0x52')]?_0x3766eb[_0xc0db('0x42')]:_0x597b92[_0xc0db('0x3e')];if(_0x423338[_0xc0db('0x3f')][_0xc0db('0x53')]){_0x3766eb[_0xc0db('0x4d')]=[{'all':!![]}];}_0x3766eb=_[_0xc0db('0x4a')]({},_0x3766eb,_0x423338[_0xc0db('0x4c')]);return db['CmList']['find'](_0x3766eb)[_0xc0db('0x2f')](handleEntityNotFound(_0x3c0be3,null))['then'](respondWithResult(_0x3c0be3,null))[_0xc0db('0x50')](handleError(_0x3c0be3,null));};exports[_0xc0db('0x54')]=function(_0x36b11e,_0x4b8f93){return db[_0xc0db('0x3a')][_0xc0db('0x54')](_0x36b11e[_0xc0db('0x55')],{})[_0xc0db('0x2f')](function(_0xc5c238){var _0xffe091=_0x36b11e[_0xc0db('0x56')]['get']({'plain':!![]});if(!_0xffe091)throw new Error(_0xc0db('0x57'));if(_0xffe091[_0xc0db('0x58')]===_0xc0db('0x56')){var _0x196e59=_0xc5c238['get']({'plain':!![]});var _0x4b7b78=_0xc0db('0x32');return db['UserProfileSection'][_0xc0db('0x59')]({'where':{'name':_0x4b7b78,'userProfileId':_0xffe091['userProfileId']},'raw':!![]})['then'](function(_0x2d8bde){if(_0x2d8bde&&_0x2d8bde[_0xc0db('0x5a')]===0x0){return db[_0xc0db('0x33')][_0xc0db('0x54')]({'name':_0x196e59[_0xc0db('0x36')],'resourceId':_0x196e59['id'],'type':_0x2d8bde[_0xc0db('0x36')],'sectionId':_0x2d8bde['id']},{})[_0xc0db('0x2f')](function(){return _0xc5c238;});}else{return _0xc5c238;}})[_0xc0db('0x50')](function(_0x4c43ce){logger['error'](_0xc0db('0x5b'),_0x4c43ce);throw _0x4c43ce;});}return _0xc5c238;})[_0xc0db('0x2f')](respondWithResult(_0x4b8f93,0xc9))['catch'](handleError(_0x4b8f93,null));};exports['update']=function(_0x2e8786,_0x53a7d1){if(_0x2e8786['body']['id']){delete _0x2e8786[_0xc0db('0x55')]['id'];}return db[_0xc0db('0x3a')][_0xc0db('0x59')]({'where':{'id':_0x2e8786[_0xc0db('0x5c')]['id']}})[_0xc0db('0x2f')](handleEntityNotFound(_0x53a7d1,null))['then'](saveUpdates(_0x2e8786[_0xc0db('0x55')],null))['then'](respondWithResult(_0x53a7d1,null))[_0xc0db('0x50')](handleError(_0x53a7d1,null));};exports['destroy']=function(_0x1fdf96,_0xab6bdb){return db[_0xc0db('0x3a')][_0xc0db('0x59')]({'where':{'id':_0x1fdf96[_0xc0db('0x5c')]['id']}})['then'](handleEntityNotFound(_0xab6bdb,null))[_0xc0db('0x2f')](removeEntity(_0xab6bdb,null))[_0xc0db('0x50')](handleError(_0xab6bdb,null));};exports[_0xc0db('0x5d')]=function(_0x291a2d,_0x6772d9){return db[_0xc0db('0x3a')][_0xc0db('0x5d')]()['then'](respondWithResult(_0x6772d9,null))['catch'](handleError(_0x6772d9,null));};exports[_0xc0db('0x5e')]=function(_0x410349,_0xc85f5c,_0x48c34b){if(_0x410349[_0xc0db('0x55')]['id']){delete _0x410349[_0xc0db('0x55')]['id'];}return db[_0xc0db('0x3a')]['find']({'where':{'id':_0x410349[_0xc0db('0x5c')]['id']}})['then'](handleEntityNotFound(_0xc85f5c,null))['then'](function(_0x16860e){if(_0x16860e){_0x410349[_0xc0db('0x55')][_0xc0db('0x5f')]=_0x16860e['id'];return db[_0xc0db('0x60')]['create'](_0x410349[_0xc0db('0x55')]);}})['then'](respondWithResult(_0xc85f5c,null))['catch'](handleError(_0xc85f5c,null));};exports['getDispositions']=function(_0x51fc76,_0x11ae01,_0x42cfdc){var _0x3b0d13={'raw':![],'where':{}};var _0x3c2bb7={};var _0x474fd3={'count':0x0,'rows':[]};return db[_0xc0db('0x3a')][_0xc0db('0x61')]({'where':{'id':_0x51fc76[_0xc0db('0x5c')]['id']}})['then'](handleEntityNotFound(_0x11ae01,null))['then'](function(_0x5c90ae){if(_0x5c90ae){_0x3c2bb7[_0xc0db('0x3e')]=_[_0xc0db('0x40')](db[_0xc0db('0x60')][_0xc0db('0x3b')]);_0x3c2bb7[_0xc0db('0x3f')]=_[_0xc0db('0x40')](_0x51fc76[_0xc0db('0x3f')]);_0x3c2bb7[_0xc0db('0x41')]=_[_0xc0db('0x43')](_0x3c2bb7[_0xc0db('0x3e')],_0x3c2bb7[_0xc0db('0x3f')]);_0x3b0d13[_0xc0db('0x42')]=_['intersection'](_0x3c2bb7[_0xc0db('0x3e')],qs[_0xc0db('0x44')](_0x51fc76[_0xc0db('0x3f')][_0xc0db('0x44')]));_0x3b0d13[_0xc0db('0x42')]=_0x3b0d13[_0xc0db('0x42')][_0xc0db('0x52')]?_0x3b0d13[_0xc0db('0x42')]:_0x3c2bb7[_0xc0db('0x3e')];if(!_0x51fc76['query'][_0xc0db('0x45')](_0xc0db('0x62'))){_0x3b0d13[_0xc0db('0x28')]=qs[_0xc0db('0x28')](_0x51fc76[_0xc0db('0x3f')]['limit']);_0x3b0d13[_0xc0db('0x26')]=qs['offset'](_0x51fc76[_0xc0db('0x3f')]['offset']);}_0x3b0d13['order']=qs[_0xc0db('0x46')](_0x51fc76['query'][_0xc0db('0x46')]);_0x3b0d13['where']=qs[_0xc0db('0x41')](_[_0xc0db('0x48')](_0x51fc76[_0xc0db('0x3f')],_0x3c2bb7[_0xc0db('0x41')]));_0x3b0d13['where'][_0xc0db('0x5f')]=_0x5c90ae['id'];if(_0x51fc76['query'][_0xc0db('0x49')]){_0x3b0d13[_0xc0db('0x47')]=_[_0xc0db('0x4a')](_0x3b0d13['where'],{'$or':_[_0xc0db('0x39')](_0x3b0d13[_0xc0db('0x42')],function(_0x934948){var _0x2bea3f={};_0x2bea3f[_0x934948]={'$like':'%'+_0x51fc76[_0xc0db('0x3f')][_0xc0db('0x49')]+'%'};return _0x2bea3f;})});}_0x3b0d13=_['merge']({},_0x3b0d13,_0x51fc76[_0xc0db('0x4c')]);return db[_0xc0db('0x60')][_0xc0db('0x29')]({'where':_0x3b0d13[_0xc0db('0x47')]})[_0xc0db('0x2f')](function(_0x2d1a3a){_0x474fd3[_0xc0db('0x29')]=_0x2d1a3a;if(_0x51fc76[_0xc0db('0x3f')][_0xc0db('0x53')]){_0x3b0d13[_0xc0db('0x4d')]=[{'all':!![]}];}return db[_0xc0db('0x60')][_0xc0db('0x4e')](_0x3b0d13);})[_0xc0db('0x2f')](function(_0x47df79){_0x474fd3[_0xc0db('0x4f')]=_0x47df79;return _0x474fd3;});}})[_0xc0db('0x2f')](respondWithFilteredResult(_0x11ae01,_0x3b0d13))[_0xc0db('0x50')](handleError(_0x11ae01,null));};exports[_0xc0db('0x63')]=function(_0x4af5c2,_0x11b82d,_0x55671a){return db[_0xc0db('0x3a')]['find']({'where':{'id':_0x4af5c2[_0xc0db('0x5c')]['id']}})[_0xc0db('0x2f')](handleEntityNotFound(_0x11b82d,null))['then'](function(_0x126403){if(_0x126403){return _0x126403[_0xc0db('0x63')](_0x4af5c2['query'][_0xc0db('0x64')]);}})[_0xc0db('0x2f')](respondWithStatusCode(_0x11b82d,null))[_0xc0db('0x50')](handleError(_0x11b82d,null));};exports[_0xc0db('0x65')]=function(_0x1e1620,_0xa5e6be,_0x158c6b){return db[_0xc0db('0x3a')][_0xc0db('0x59')]({'where':{'id':_0x1e1620[_0xc0db('0x5c')]['id']}})['then'](handleEntityNotFound(_0xa5e6be,null))[_0xc0db('0x2f')](function(_0x114d8a){if(_0x114d8a){var _0x206c88=[];var _0x329ef4={'success':[],'errors':[]};return db['CmContact'][_0xc0db('0x5d')]()[_0xc0db('0x2f')](function(_0x33e284){if(_0x1e1620['body'][_0xc0db('0x66')]&&_['isArray'](_0x1e1620[_0xc0db('0x55')][_0xc0db('0x66')])){if(_0x1e1620[_0xc0db('0x55')][_0xc0db('0x66')][_0xc0db('0x52')]){_0x1e1620[_0xc0db('0x55')]['tags']=_0x1e1620[_0xc0db('0x55')]['tags']['join'](';')+';';}else{_0x1e1620[_0xc0db('0x55')]['tags']=null;}}else{_0x1e1620[_0xc0db('0x55')][_0xc0db('0x66')]=null;}if(_0x1e1620[_0xc0db('0x55')]&&_[_0xc0db('0x67')](_0x1e1620[_0xc0db('0x55')])){for(var _0x52edad=0x0;_0x52edad<_0x1e1620[_0xc0db('0x55')]['length'];_0x52edad+=0x1){_0x1e1620[_0xc0db('0x55')][_0x52edad][_0xc0db('0x5f')]=_0x1e1620[_0xc0db('0x5c')]['id'];_0x206c88[_0xc0db('0x68')](_0x1e1620[_0xc0db('0x55')][_0x52edad]);}return BPromise[_0xc0db('0x69')](_0x206c88,function(_0x3f8cf2){return db[_0xc0db('0x6a')][_0xc0db('0x54')](_['omit'](_0x3f8cf2,[_0xc0db('0x64'),'id'])||{},{'fields':_[_0xc0db('0x40')](_0x33e284),'raw':!![]})[_0xc0db('0x2f')](function(_0x507f5f){_0x329ef4[_0xc0db('0x6b')][_0xc0db('0x68')](_0x507f5f[_0xc0db('0x6c')]);})[_0xc0db('0x50')](function(_0x38572d){_0x329ef4['errors'][_0xc0db('0x68')]({'data':_0x3f8cf2,'error':_0x38572d[_0xc0db('0x6d')]});});})['then'](function(_0x2a53f8){return _0x329ef4;})[_0xc0db('0x50')](function(_0x5703a5){return _0x5703a5;});}else{_0xa5e6be[_0xc0db('0x23')](0x190)['json']({'message':_0xc0db('0x6e')});}});}})[_0xc0db('0x2f')](respondWithResult(_0xa5e6be,null))[_0xc0db('0x50')](handleError(_0xa5e6be,null));};exports[_0xc0db('0x6f')]=function(_0x4c39e6,_0x5c4077,_0x1d6e6b){var _0x57748b;return db[_0xc0db('0x3a')][_0xc0db('0x59')]({'where':{'id':_0x4c39e6[_0xc0db('0x5c')]['id']},'include':[{'model':db[_0xc0db('0x70')],'as':_0xc0db('0x71')}]})[_0xc0db('0x2f')](handleEntityNotFound(_0x5c4077,null))[_0xc0db('0x2f')](function(_0x26c039){if(_0x26c039){_0x57748b=_0x26c039;return db[_0xc0db('0x6a')][_0xc0db('0x3b')];}})[_0xc0db('0x2f')](function(_0x4b333f){if(_0x4b333f){var _0x24fa80={};var _0x5f0f07={};_0x5f0f07[_0xc0db('0x3e')]=_[_0xc0db('0x72')](_[_0xc0db('0x40')](_0x4b333f),_['map'](_0x57748b[_0xc0db('0x71')],function(_0x5a4ad7){return util[_0xc0db('0x73')](_0xc0db('0x74'),_0x5a4ad7['id']);}));_0x5f0f07['query']=_[_0xc0db('0x40')](_0x4c39e6['query']);_0x5f0f07[_0xc0db('0x41')]=_[_0xc0db('0x43')](_0x5f0f07[_0xc0db('0x3e')],_0x5f0f07[_0xc0db('0x3f')]);_0x24fa80[_0xc0db('0x42')]=_['intersection'](_0x5f0f07[_0xc0db('0x3e')],qs[_0xc0db('0x44')](_0x4c39e6[_0xc0db('0x3f')][_0xc0db('0x44')]));_0x24fa80['attributes']=_0x24fa80[_0xc0db('0x42')][_0xc0db('0x52')]?_0x24fa80[_0xc0db('0x42')]:_0x5f0f07[_0xc0db('0x3e')];if(!_0x4c39e6['query'][_0xc0db('0x45')](_0xc0db('0x62'))){_0x24fa80[_0xc0db('0x28')]=qs[_0xc0db('0x28')](_0x4c39e6['query'][_0xc0db('0x28')]);_0x24fa80[_0xc0db('0x26')]=qs[_0xc0db('0x26')](_0x4c39e6[_0xc0db('0x3f')][_0xc0db('0x26')]);}_0x24fa80['order']=qs[_0xc0db('0x46')](_0x4c39e6[_0xc0db('0x3f')][_0xc0db('0x46')]);_0x24fa80[_0xc0db('0x47')]=qs[_0xc0db('0x41')](_['pick'](_0x4c39e6[_0xc0db('0x3f')],_0x5f0f07[_0xc0db('0x41')]));_0x24fa80[_0xc0db('0x75')]=!![];if(_0x4c39e6[_0xc0db('0x3f')][_0xc0db('0x49')]){_0x24fa80['where']=_[_0xc0db('0x4a')](_0x24fa80[_0xc0db('0x47')],{'$or':_[_0xc0db('0x39')](_0x24fa80['attributes'],function(_0x2ac791){var _0x252061={};_0x252061[_0x2ac791]={'$like':'%'+_0x4c39e6[_0xc0db('0x3f')][_0xc0db('0x49')]+'%'};return _0x252061;})});}_0x24fa80=_['merge']({},_0x24fa80,_0x4c39e6[_0xc0db('0x4c')]);return _0x57748b[_0xc0db('0x6f')](_0x24fa80);}})[_0xc0db('0x2f')](respondWithResult(_0x5c4077,null))['catch'](handleError(_0x5c4077,null));};exports[_0xc0db('0x76')]=function(_0x506446,_0x444173,_0x216f7e){var _0x1e700c;return db[_0xc0db('0x3a')]['find']({'where':{'id':_0x506446[_0xc0db('0x5c')]['id']},'include':[{'model':db[_0xc0db('0x70')],'as':_0xc0db('0x71')}]})[_0xc0db('0x2f')](handleEntityNotFound(_0x444173,null))[_0xc0db('0x2f')](function(_0x5b2bc5){if(_0x5b2bc5){_0x1e700c=_0x5b2bc5;return db[_0xc0db('0x6a')]['rawAttributes'];}})[_0xc0db('0x2f')](function(_0x5cf89f){if(_0x5cf89f){var _0x4d04ab={};var _0x432886={};_0x432886[_0xc0db('0x3e')]=_[_0xc0db('0x72')](_[_0xc0db('0x40')](_0x5cf89f),_['map'](_0x1e700c['CustomFields'],function(_0x211bf5){return util[_0xc0db('0x73')]('cf_%d',_0x211bf5['id']);}));_0x432886[_0xc0db('0x3f')]=_['keys'](_0x506446['query']);_0x432886[_0xc0db('0x41')]=_[_0xc0db('0x43')](_0x432886['model'],_0x432886[_0xc0db('0x3f')]);_0x4d04ab[_0xc0db('0x42')]=_[_0xc0db('0x43')](_0x432886[_0xc0db('0x3e')],qs[_0xc0db('0x44')](_0x506446[_0xc0db('0x3f')][_0xc0db('0x44')]));_0x4d04ab[_0xc0db('0x42')]=_0x4d04ab[_0xc0db('0x42')][_0xc0db('0x52')]?_0x4d04ab['attributes']:_0x432886[_0xc0db('0x3e')];if(!_0x506446[_0xc0db('0x3f')][_0xc0db('0x45')]('nolimit')){_0x4d04ab[_0xc0db('0x28')]=qs[_0xc0db('0x28')](_0x506446[_0xc0db('0x3f')][_0xc0db('0x28')]);_0x4d04ab['offset']=qs[_0xc0db('0x26')](_0x506446[_0xc0db('0x3f')][_0xc0db('0x26')]);}_0x4d04ab[_0xc0db('0x77')]=qs[_0xc0db('0x46')](_0x506446[_0xc0db('0x3f')][_0xc0db('0x46')]);_0x4d04ab[_0xc0db('0x47')]=qs[_0xc0db('0x41')](_[_0xc0db('0x48')](_0x506446[_0xc0db('0x3f')],_0x432886['filters']));_0x4d04ab[_0xc0db('0x75')]=!![];if(_0x506446[_0xc0db('0x3f')][_0xc0db('0x49')]){_0x4d04ab[_0xc0db('0x47')]=_[_0xc0db('0x4a')](_0x4d04ab[_0xc0db('0x47')],{'$or':_[_0xc0db('0x39')](_0x4d04ab['attributes'],function(_0x5494e6){var _0x420eb0={};_0x420eb0[_0x5494e6]={'$like':'%'+_0x506446['query'][_0xc0db('0x49')]+'%'};return _0x420eb0;})});}_0x4d04ab=_[_0xc0db('0x4a')]({},_0x4d04ab,_0x506446[_0xc0db('0x4c')]);return _0x1e700c['getContacts'](_0x4d04ab);}})[_0xc0db('0x2f')](function(_0x78cd83){if(!_['isEmpty'](_0x78cd83)){var _0x1d7c84=toCsv(_0x78cd83);var _0x47a35b=Date['now']();fs[_0xc0db('0x78')](util['format'](_0xc0db('0x79'),_0x1e700c['id'],_0x47a35b),_0x1d7c84);_0x444173[_0xc0db('0x7a')]('Content-disposition',_0xc0db('0x7b')+util[_0xc0db('0x73')](_0xc0db('0x7c'),_0x1e700c['id'],_0x47a35b));_0x444173[_0xc0db('0x7a')](_0xc0db('0x7d'),_0xc0db('0x7e'));return _0x444173['download'](util['format']('/tmp/list_%d_%s.csv',_0x1e700c['id'],_0x47a35b));}else{return _0x444173[_0xc0db('0x22')](0xcc);}})['catch'](handleError(_0x444173,null));};exports[_0xc0db('0x7f')]=function(_0x217037,_0x1ac030,_0x28cdcc){var _0x38470a;delete _0x217037[_0xc0db('0x55')]['id'];return db['CmList'][_0xc0db('0x61')]({'where':{'id':_0x217037[_0xc0db('0x5c')]['id']}})[_0xc0db('0x2f')](handleEntityNotFound(_0x1ac030,null))[_0xc0db('0x2f')](function(_0x41e2bc){if(_0x41e2bc){return db[_0xc0db('0x80')][_0xc0db('0x81')](function(_0x32d896){return db['CmCustomField'][_0xc0db('0x54')](_0x217037['body'],{'transaction':_0x32d896})['then'](function(_0x48749e){_0x38470a=_0x48749e;return _0x41e2bc[_0xc0db('0x82')](_0x48749e,{'transaction':_0x32d896});})[_0xc0db('0x2f')](function(){var _0x46ba3f={'type':db[_0xc0db('0x83')][_0xc0db('0x84')],'transaction':_0x32d896};switch(_0x217037[_0xc0db('0x55')]['type']){case _0xc0db('0x85'):_0x46ba3f[_0xc0db('0x3c')]=db[_0xc0db('0x83')][_0xc0db('0x84')];break;case _0xc0db('0x86'):_0x46ba3f[_0xc0db('0x3c')]=db[_0xc0db('0x83')][_0xc0db('0x87')];break;case'switch':_0x46ba3f[_0xc0db('0x3c')]=db[_0xc0db('0x83')][_0xc0db('0x88')];_0x46ba3f[_0xc0db('0x89')]=![];break;default:}return db['sequelize'][_0xc0db('0x8a')][_0xc0db('0x8b')](_0xc0db('0x8c'),util[_0xc0db('0x73')](_0xc0db('0x8d'),_0x38470a['id']),_0x46ba3f);})[_0xc0db('0x2f')](function(){return _0x38470a;});});}})[_0xc0db('0x2f')](respondWithResult(_0x1ac030,null))[_0xc0db('0x50')](handleError(_0x1ac030,null));};exports[_0xc0db('0x8e')]=function(_0x434520,_0x2f984e,_0x4915d6){var _0x132c63={};var _0x530b37={};var _0xffaf0b;var _0x4b529f;return db[_0xc0db('0x3a')][_0xc0db('0x61')]({'where':{'id':_0x434520[_0xc0db('0x5c')]['id']}})[_0xc0db('0x2f')](handleEntityNotFound(_0x2f984e,null))[_0xc0db('0x2f')](function(_0x54e60b){if(_0x54e60b){_0xffaf0b=_0x54e60b;_0x530b37[_0xc0db('0x3e')]=_['keys'](db[_0xc0db('0x70')][_0xc0db('0x3b')]);_0x530b37[_0xc0db('0x3f')]=_[_0xc0db('0x40')](_0x434520[_0xc0db('0x3f')]);_0x530b37[_0xc0db('0x41')]=_[_0xc0db('0x43')](_0x530b37[_0xc0db('0x3e')],_0x530b37['query']);_0x132c63[_0xc0db('0x42')]=_[_0xc0db('0x43')](_0x530b37['model'],qs[_0xc0db('0x44')](_0x434520[_0xc0db('0x3f')][_0xc0db('0x44')]));_0x132c63[_0xc0db('0x42')]=_0x132c63['attributes'][_0xc0db('0x52')]?_0x132c63[_0xc0db('0x42')]:_0x530b37['model'];_0x132c63[_0xc0db('0x77')]=qs[_0xc0db('0x46')](_0x434520['query'][_0xc0db('0x46')]);_0x132c63[_0xc0db('0x47')]=qs['filters'](_['pick'](_0x434520[_0xc0db('0x3f')],_0x530b37['filters']));_0x132c63[_0xc0db('0x47')]=_['merge'](_0x132c63['where'],{'$or':[{'ListId':_0x54e60b['id']},{'ListId':null}]});if(_0x434520[_0xc0db('0x3f')][_0xc0db('0x49')]){_0x132c63[_0xc0db('0x47')]=_[_0xc0db('0x4a')](_0x132c63[_0xc0db('0x47')],{'$or':_['map'](_0x132c63['attributes'],function(_0x15d428){var _0x3e3650={};_0x3e3650[_0x15d428]={'$like':'%'+_0x434520[_0xc0db('0x3f')][_0xc0db('0x49')]+'%'};return _0x3e3650;})});}_0x132c63=_[_0xc0db('0x4a')]({},_0x132c63,_0x434520['options']);return db[_0xc0db('0x70')][_0xc0db('0x8f')](_0x132c63);}})['then'](respondWithResult(_0x2f984e,null))[_0xc0db('0x50')](handleError(_0x2f984e,null));};exports[_0xc0db('0x90')]=function(_0x255e17,_0x12456f,_0x1dd141){return db['CmList']['find']({'where':{'id':_0x255e17[_0xc0db('0x5c')]['id']}})['then'](handleEntityNotFound(_0x12456f,null))[_0xc0db('0x2f')](function(_0x43f35e){if(_0x43f35e){return _0x43f35e[_0xc0db('0x90')](_0x255e17[_0xc0db('0x55')][_0xc0db('0x64')],_['omit'](_0x255e17[_0xc0db('0x55')],[_0xc0db('0x64'),'id'])||{})[_0xc0db('0x91')](function(_0x1229e3){for(var _0x540b01=0x0;_0x540b01<_0x255e17[_0xc0db('0x55')][_0xc0db('0x64')][_0xc0db('0x52')];_0x540b01+=0x1){socket[_0xc0db('0x92')](_0xc0db('0x93'),{'UserId':Number(_0x255e17['body']['ids'][_0x540b01]),'CmListId':Number(_0x255e17[_0xc0db('0x5c')]['id'])});}return _0x1229e3;});}})['then'](respondWithResult(_0x12456f,null))[_0xc0db('0x50')](handleError(_0x12456f,null));};exports[_0xc0db('0x94')]=function(_0x4581b8,_0x4099b4,_0x16df5d){return db[_0xc0db('0x3a')][_0xc0db('0x59')]({'where':{'id':_0x4581b8[_0xc0db('0x5c')]['id']}})[_0xc0db('0x2f')](handleEntityNotFound(_0x4099b4,null))[_0xc0db('0x2f')](function(_0x26b40c){if(_0x26b40c){return _0x26b40c[_0xc0db('0x94')](_0x4581b8[_0xc0db('0x3f')][_0xc0db('0x64')])[_0xc0db('0x2f')](function(){if(_['isArray'](_0x4581b8[_0xc0db('0x3f')]['ids'])){for(var _0x2452e9=0x0;_0x2452e9<_0x4581b8[_0xc0db('0x3f')][_0xc0db('0x64')]['length'];_0x2452e9+=0x1){socket[_0xc0db('0x92')](_0xc0db('0x95'),{'UserId':Number(_0x4581b8[_0xc0db('0x3f')][_0xc0db('0x64')][_0x2452e9]),'CmListId':Number(_0x4581b8[_0xc0db('0x5c')]['id'])});}}else{socket[_0xc0db('0x92')](_0xc0db('0x95'),{'UserId':Number(_0x4581b8['query'][_0xc0db('0x64')]),'CmListId':Number(_0x4581b8['params']['id'])});}});}})[_0xc0db('0x2f')](respondWithStatusCode(_0x4099b4,null))[_0xc0db('0x50')](handleError(_0x4099b4,null));};exports[_0xc0db('0x96')]=function(_0xe58780,_0x24f4a1,_0x4dcf61){var _0x14a95e={};var _0x31a9e7={};var _0x229b3a;var _0x4b7a7d;return db['CmList']['findOne']({'where':{'id':_0xe58780[_0xc0db('0x5c')]['id']}})['then'](handleEntityNotFound(_0x24f4a1,null))['then'](function(_0x58ab57){if(_0x58ab57){_0x229b3a=_0x58ab57;_0x31a9e7['model']=_[_0xc0db('0x40')](db['User']['rawAttributes']);_0x31a9e7[_0xc0db('0x3f')]=_[_0xc0db('0x40')](_0xe58780[_0xc0db('0x3f')]);_0x31a9e7[_0xc0db('0x41')]=_[_0xc0db('0x43')](_0x31a9e7[_0xc0db('0x3e')],_0x31a9e7[_0xc0db('0x3f')]);_0x14a95e[_0xc0db('0x42')]=_[_0xc0db('0x43')](_0x31a9e7[_0xc0db('0x3e')],qs['fields'](_0xe58780['query']['fields']));_0x14a95e[_0xc0db('0x42')]=_0x14a95e[_0xc0db('0x42')][_0xc0db('0x52')]?_0x14a95e[_0xc0db('0x42')]:_0x31a9e7[_0xc0db('0x3e')];_0x14a95e[_0xc0db('0x77')]=qs[_0xc0db('0x46')](_0xe58780['query'][_0xc0db('0x46')]);_0x14a95e['where']=qs[_0xc0db('0x41')](_[_0xc0db('0x48')](_0xe58780[_0xc0db('0x3f')],_0x31a9e7[_0xc0db('0x41')]));if(_0xe58780[_0xc0db('0x3f')]['filter']){_0x14a95e[_0xc0db('0x47')]=_[_0xc0db('0x4a')](_0x14a95e[_0xc0db('0x47')],{'$or':_[_0xc0db('0x39')](_0x14a95e[_0xc0db('0x42')],function(_0x4ffcbd){var _0x594017={};_0x594017[_0x4ffcbd]={'$like':'%'+_0xe58780[_0xc0db('0x3f')]['filter']+'%'};return _0x594017;})});}_0x14a95e=_['merge']({},_0x14a95e,_0xe58780[_0xc0db('0x4c')]);return _0x229b3a[_0xc0db('0x96')](_0x14a95e);}})[_0xc0db('0x2f')](function(_0x2e6da4){if(_0x2e6da4){_0x4b7a7d=_0x2e6da4[_0xc0db('0x52')];if(!_0xe58780[_0xc0db('0x3f')][_0xc0db('0x45')]('nolimit')){_0x14a95e[_0xc0db('0x28')]=qs[_0xc0db('0x28')](_0xe58780['query'][_0xc0db('0x28')]);_0x14a95e[_0xc0db('0x26')]=qs[_0xc0db('0x26')](_0xe58780[_0xc0db('0x3f')][_0xc0db('0x26')]);}return _0x229b3a[_0xc0db('0x96')](_0x14a95e);}})['then'](function(_0x31d9d8){if(_0x31d9d8){return _0x31d9d8?{'count':_0x4b7a7d,'rows':_0x31d9d8}:null;}})['then'](respondWithResult(_0x24f4a1,null))[_0xc0db('0x50')](handleError(_0x24f4a1,null));}; \ No newline at end of file +var _0x317b=['fields','hasOwnProperty','nolimit','sort','pick','merge','where','type','VIRTUAL','options','include','rows','catch','rawAttributes','filters','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','findOne','order','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','length','each','omit','success','dataValues','push','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','raw','filter','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','rimraf','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','save','update','destroy','then','get','Lists','UserProfileResource','error','stack','name','send','index','map','CmList','fieldName','key','model','keys','query','intersection','attributes'];(function(_0x25eba3,_0x2487b1){var _0x313790=function(_0x2f3432){while(--_0x2f3432){_0x25eba3['push'](_0x25eba3['shift']());}};_0x313790(++_0x2487b1);}(_0x317b,0x171));var _0xb317=function(_0x177de5,_0x3614b1){_0x177de5=_0x177de5-0x0;var _0x1bcefc=_0x317b[_0x177de5];return _0x1bcefc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb317('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb317('0x1'));var moment=require(_0xb317('0x2'));var BPromise=require(_0xb317('0x3'));var Mustache=require(_0xb317('0x4'));var util=require(_0xb317('0x5'));var path=require('path');var sox=require(_0xb317('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb317('0x7'));var _=require('lodash');var squel=require(_0xb317('0x8'));var crypto=require(_0xb317('0x9'));var jsforce=require(_0xb317('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb317('0xb'));var querystring=require(_0xb317('0xc'));var Papa=require(_0xb317('0xd'));var Redis=require('ioredis');var authService=require(_0xb317('0xe'));var qs=require(_0xb317('0xf'));var as=require(_0xb317('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb317('0x11'))('api');var utils=require(_0xb317('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xb317('0x13'));var db=require(_0xb317('0x14'))['db'];config[_0xb317('0x15')]=_['defaults'](config[_0xb317('0x15')],{'host':_0xb317('0x16'),'port':0x18eb});var socket=require(_0xb317('0x17'))(new Redis(config[_0xb317('0x15')]));require(_0xb317('0x18'))[_0xb317('0x19')](socket);function respondWithStatusCode(_0x24a8ac,_0x280b05){_0x280b05=_0x280b05||0xcc;return function(_0x34c1ed){if(_0x34c1ed){return _0x24a8ac[_0xb317('0x1a')](_0x280b05);}return _0x24a8ac[_0xb317('0x1b')](_0x280b05)[_0xb317('0x1c')]();};}function respondWithResult(_0x204131,_0x19f68a){_0x19f68a=_0x19f68a||0xc8;return function(_0x3167aa){if(_0x3167aa){return _0x204131['status'](_0x19f68a)['json'](_0x3167aa);}};}function respondWithFilteredResult(_0x446322,_0xa10442){return function(_0x2b1924){if(_0x2b1924){var _0x2c4e62=typeof _0xa10442[_0xb317('0x1d')]==='undefined'&&typeof _0xa10442[_0xb317('0x1e')]==='undefined';var _0x17213d=_0x2b1924[_0xb317('0x1f')];var _0x1cbd6b=_0x2c4e62?0x0:_0xa10442['offset'];var _0x2eb702=_0x2c4e62?_0x2b1924[_0xb317('0x1f')]:_0xa10442[_0xb317('0x1d')]+_0xa10442[_0xb317('0x1e')];var _0x1e0af2;if(_0x2eb702>=_0x17213d){_0x2eb702=_0x17213d;_0x1e0af2=0xc8;}else{_0x1e0af2=0xce;}_0x446322['status'](_0x1e0af2);return _0x446322[_0xb317('0x20')](_0xb317('0x21'),_0x1cbd6b+'-'+_0x2eb702+'/'+_0x17213d)[_0xb317('0x22')](_0x2b1924);}return null;};}function patchUpdates(_0x2f8391){return function(_0x5e190a){try{jsonpatch[_0xb317('0x23')](_0x5e190a,_0x2f8391,!![]);}catch(_0xddacad){return BPromise['reject'](_0xddacad);}return _0x5e190a[_0xb317('0x24')]();};}function saveUpdates(_0x33eee4,_0x4d8e16){return function(_0x44d1ce){if(_0x44d1ce){return _0x44d1ce[_0xb317('0x25')](_0x33eee4)['then'](function(_0x545868){return _0x545868;});}return null;};}function removeEntity(_0xc71a4b,_0x2af024){return function(_0x58cdd2){if(_0x58cdd2){return _0x58cdd2[_0xb317('0x26')]()[_0xb317('0x27')](function(){var _0x1bb7a5=_0x58cdd2[_0xb317('0x28')]({'plain':!![]});var _0xbed87f=_0xb317('0x29');return db[_0xb317('0x2a')][_0xb317('0x26')]({'where':{'type':_0xbed87f,'resourceId':_0x1bb7a5['id']}})[_0xb317('0x27')](function(){return _0x58cdd2;});})[_0xb317('0x27')](function(){_0xc71a4b[_0xb317('0x1b')](0xcc)[_0xb317('0x1c')]();});}};}function handleEntityNotFound(_0x56f593,_0x336f53){return function(_0x3266ef){if(!_0x3266ef){_0x56f593[_0xb317('0x1a')](0x194);}return _0x3266ef;};}function handleError(_0x245a13,_0x542d32){_0x542d32=_0x542d32||0x1f4;return function(_0x2e9a28){logger[_0xb317('0x2b')](_0x2e9a28[_0xb317('0x2c')]);if(_0x2e9a28[_0xb317('0x2d')]){delete _0x2e9a28[_0xb317('0x2d')];}_0x245a13[_0xb317('0x1b')](_0x542d32)[_0xb317('0x2e')](_0x2e9a28);};}exports[_0xb317('0x2f')]=function(_0x394ad3,_0x1524f8){var _0x54ded3={},_0x1ddbf2={},_0x517c20={'count':0x0,'rows':[]};var _0x45c464=_[_0xb317('0x30')](db[_0xb317('0x31')]['rawAttributes'],function(_0x287d1e){return{'name':_0x287d1e[_0xb317('0x32')],'type':_0x287d1e['type'][_0xb317('0x33')]};});_0x1ddbf2[_0xb317('0x34')]=_[_0xb317('0x30')](_0x45c464,_0xb317('0x2d'));_0x1ddbf2['query']=_[_0xb317('0x35')](_0x394ad3[_0xb317('0x36')]);_0x1ddbf2['filters']=_[_0xb317('0x37')](_0x1ddbf2[_0xb317('0x34')],_0x1ddbf2[_0xb317('0x36')]);_0x54ded3[_0xb317('0x38')]=_['intersection'](_0x1ddbf2[_0xb317('0x34')],qs[_0xb317('0x39')](_0x394ad3['query'][_0xb317('0x39')]));_0x54ded3['attributes']=_0x54ded3['attributes']['length']?_0x54ded3[_0xb317('0x38')]:_0x1ddbf2[_0xb317('0x34')];if(!_0x394ad3[_0xb317('0x36')][_0xb317('0x3a')](_0xb317('0x3b'))){_0x54ded3[_0xb317('0x1e')]=qs[_0xb317('0x1e')](_0x394ad3['query']['limit']);_0x54ded3['offset']=qs[_0xb317('0x1d')](_0x394ad3['query']['offset']);}_0x54ded3['order']=qs[_0xb317('0x3c')](_0x394ad3[_0xb317('0x36')]['sort']);_0x54ded3['where']=qs['filters'](_[_0xb317('0x3d')](_0x394ad3[_0xb317('0x36')],_0x1ddbf2['filters']),_0x45c464);if(_0x394ad3[_0xb317('0x36')]['filter']){_0x54ded3['where']=_[_0xb317('0x3e')](_0x54ded3[_0xb317('0x3f')],{'$or':_[_0xb317('0x30')](_0x45c464,function(_0x1ef791){if(_0x1ef791[_0xb317('0x40')]!==_0xb317('0x41')){var _0x36fa9d={};_0x36fa9d[_0x1ef791[_0xb317('0x2d')]]={'$like':'%'+_0x394ad3[_0xb317('0x36')]['filter']+'%'};return _0x36fa9d;}})});}_0x54ded3=_[_0xb317('0x3e')]({},_0x54ded3,_0x394ad3[_0xb317('0x42')]);var _0x5ef357={'where':_0x54ded3['where']};return db['CmList'][_0xb317('0x1f')](_0x5ef357)[_0xb317('0x27')](function(_0x3dc5e8){_0x517c20['count']=_0x3dc5e8;if(_0x394ad3[_0xb317('0x36')]['includeAll']){_0x54ded3[_0xb317('0x43')]=[{'all':!![]}];}return db[_0xb317('0x31')]['findAll'](_0x54ded3);})[_0xb317('0x27')](function(_0x12185e){_0x517c20[_0xb317('0x44')]=_0x12185e;return _0x517c20;})['then'](respondWithFilteredResult(_0x1524f8,_0x54ded3))[_0xb317('0x45')](handleError(_0x1524f8,null));};exports['show']=function(_0x455fd7,_0x1f24b7){var _0x42dbe2={'raw':![],'where':{'id':_0x455fd7['params']['id']}},_0x4895a7={};_0x4895a7[_0xb317('0x34')]=_['keys'](db[_0xb317('0x31')][_0xb317('0x46')]);_0x4895a7[_0xb317('0x36')]=_[_0xb317('0x35')](_0x455fd7[_0xb317('0x36')]);_0x4895a7[_0xb317('0x47')]=_[_0xb317('0x37')](_0x4895a7[_0xb317('0x34')],_0x4895a7['query']);_0x42dbe2[_0xb317('0x38')]=_['intersection'](_0x4895a7[_0xb317('0x34')],qs[_0xb317('0x39')](_0x455fd7[_0xb317('0x36')][_0xb317('0x39')]));_0x42dbe2[_0xb317('0x38')]=_0x42dbe2['attributes']['length']?_0x42dbe2[_0xb317('0x38')]:_0x4895a7[_0xb317('0x34')];if(_0x455fd7[_0xb317('0x36')]['includeAll']){_0x42dbe2['include']=[{'all':!![]}];}_0x42dbe2=_[_0xb317('0x3e')]({},_0x42dbe2,_0x455fd7[_0xb317('0x42')]);return db[_0xb317('0x31')]['find'](_0x42dbe2)[_0xb317('0x27')](handleEntityNotFound(_0x1f24b7,null))[_0xb317('0x27')](respondWithResult(_0x1f24b7,null))[_0xb317('0x45')](handleError(_0x1f24b7,null));};exports['create']=function(_0x29ad89,_0x4a23b8){return db[_0xb317('0x31')][_0xb317('0x48')](_0x29ad89[_0xb317('0x49')],{})['then'](function(_0x4a0826){var _0x28045c=_0x29ad89[_0xb317('0x4a')][_0xb317('0x28')]({'plain':!![]});if(!_0x28045c)throw new Error(_0xb317('0x4b'));if(_0x28045c['role']===_0xb317('0x4a')){var _0xcbbce5=_0x4a0826[_0xb317('0x28')]({'plain':!![]});var _0x1589f6=_0xb317('0x29');return db[_0xb317('0x4c')][_0xb317('0x4d')]({'where':{'name':_0x1589f6,'userProfileId':_0x28045c[_0xb317('0x4e')]},'raw':!![]})[_0xb317('0x27')](function(_0x3461e6){if(_0x3461e6&&_0x3461e6['autoAssociation']===0x0){return db[_0xb317('0x2a')][_0xb317('0x48')]({'name':_0xcbbce5['name'],'resourceId':_0xcbbce5['id'],'type':_0x3461e6['name'],'sectionId':_0x3461e6['id']},{})[_0xb317('0x27')](function(){return _0x4a0826;});}else{return _0x4a0826;}})['catch'](function(_0x6292b5){logger[_0xb317('0x2b')](_0xb317('0x4f'),_0x6292b5);throw _0x6292b5;});}return _0x4a0826;})[_0xb317('0x27')](respondWithResult(_0x4a23b8,0xc9))[_0xb317('0x45')](handleError(_0x4a23b8,null));};exports['update']=function(_0x1405f5,_0x39b24b){if(_0x1405f5['body']['id']){delete _0x1405f5['body']['id'];}return db['CmList'][_0xb317('0x4d')]({'where':{'id':_0x1405f5[_0xb317('0x50')]['id']}})['then'](handleEntityNotFound(_0x39b24b,null))[_0xb317('0x27')](saveUpdates(_0x1405f5[_0xb317('0x49')],null))[_0xb317('0x27')](respondWithResult(_0x39b24b,null))['catch'](handleError(_0x39b24b,null));};exports[_0xb317('0x26')]=function(_0xbd983f,_0x3b32d3){return db[_0xb317('0x31')]['find']({'where':{'id':_0xbd983f['params']['id']}})[_0xb317('0x27')](handleEntityNotFound(_0x3b32d3,null))[_0xb317('0x27')](removeEntity(_0x3b32d3,null))['catch'](handleError(_0x3b32d3,null));};exports[_0xb317('0x51')]=function(_0x34ae94,_0x455de0){return db[_0xb317('0x31')][_0xb317('0x51')]()[_0xb317('0x27')](respondWithResult(_0x455de0,null))[_0xb317('0x45')](handleError(_0x455de0,null));};exports[_0xb317('0x52')]=function(_0x365a4d,_0x5888a5,_0x90f078){if(_0x365a4d['body']['id']){delete _0x365a4d[_0xb317('0x49')]['id'];}return db['CmList'][_0xb317('0x4d')]({'where':{'id':_0x365a4d['params']['id']}})[_0xb317('0x27')](handleEntityNotFound(_0x5888a5,null))['then'](function(_0x5c1a23){if(_0x5c1a23){_0x365a4d[_0xb317('0x49')][_0xb317('0x53')]=_0x5c1a23['id'];return db[_0xb317('0x54')][_0xb317('0x48')](_0x365a4d['body']);}})['then'](respondWithResult(_0x5888a5,null))['catch'](handleError(_0x5888a5,null));};exports['getDispositions']=function(_0x4e8a77,_0x1b9ce8,_0x162dd8){var _0x5e988a={'raw':![],'where':{}};var _0x3da0ec={};var _0x5741f1={'count':0x0,'rows':[]};return db[_0xb317('0x31')][_0xb317('0x55')]({'where':{'id':_0x4e8a77[_0xb317('0x50')]['id']}})[_0xb317('0x27')](handleEntityNotFound(_0x1b9ce8,null))[_0xb317('0x27')](function(_0x3a2565){if(_0x3a2565){_0x3da0ec['model']=_[_0xb317('0x35')](db['Disposition'][_0xb317('0x46')]);_0x3da0ec['query']=_['keys'](_0x4e8a77[_0xb317('0x36')]);_0x3da0ec[_0xb317('0x47')]=_[_0xb317('0x37')](_0x3da0ec[_0xb317('0x34')],_0x3da0ec[_0xb317('0x36')]);_0x5e988a[_0xb317('0x38')]=_['intersection'](_0x3da0ec['model'],qs['fields'](_0x4e8a77[_0xb317('0x36')][_0xb317('0x39')]));_0x5e988a['attributes']=_0x5e988a[_0xb317('0x38')]['length']?_0x5e988a['attributes']:_0x3da0ec[_0xb317('0x34')];if(!_0x4e8a77[_0xb317('0x36')][_0xb317('0x3a')](_0xb317('0x3b'))){_0x5e988a['limit']=qs[_0xb317('0x1e')](_0x4e8a77[_0xb317('0x36')][_0xb317('0x1e')]);_0x5e988a[_0xb317('0x1d')]=qs[_0xb317('0x1d')](_0x4e8a77[_0xb317('0x36')][_0xb317('0x1d')]);}_0x5e988a[_0xb317('0x56')]=qs['sort'](_0x4e8a77['query']['sort']);_0x5e988a[_0xb317('0x3f')]=qs[_0xb317('0x47')](_['pick'](_0x4e8a77['query'],_0x3da0ec['filters']));_0x5e988a[_0xb317('0x3f')][_0xb317('0x53')]=_0x3a2565['id'];if(_0x4e8a77[_0xb317('0x36')]['filter']){_0x5e988a[_0xb317('0x3f')]=_[_0xb317('0x3e')](_0x5e988a[_0xb317('0x3f')],{'$or':_['map'](_0x5e988a[_0xb317('0x38')],function(_0x1c4c4b){var _0x13c0f0={};_0x13c0f0[_0x1c4c4b]={'$like':'%'+_0x4e8a77[_0xb317('0x36')]['filter']+'%'};return _0x13c0f0;})});}_0x5e988a=_[_0xb317('0x3e')]({},_0x5e988a,_0x4e8a77[_0xb317('0x42')]);return db[_0xb317('0x54')]['count']({'where':_0x5e988a[_0xb317('0x3f')]})[_0xb317('0x27')](function(_0x5d7e10){_0x5741f1[_0xb317('0x1f')]=_0x5d7e10;if(_0x4e8a77['query']['includeAll']){_0x5e988a[_0xb317('0x43')]=[{'all':!![]}];}return db[_0xb317('0x54')][_0xb317('0x57')](_0x5e988a);})[_0xb317('0x27')](function(_0x429a18){_0x5741f1[_0xb317('0x44')]=_0x429a18;return _0x5741f1;});}})['then'](respondWithFilteredResult(_0x1b9ce8,_0x5e988a))[_0xb317('0x45')](handleError(_0x1b9ce8,null));};exports['removeDispositions']=function(_0x2da192,_0x5b6d7f,_0xd1f2f6){return db[_0xb317('0x31')][_0xb317('0x4d')]({'where':{'id':_0x2da192[_0xb317('0x50')]['id']}})['then'](handleEntityNotFound(_0x5b6d7f,null))[_0xb317('0x27')](function(_0x2ea1a7){if(_0x2ea1a7){return _0x2ea1a7[_0xb317('0x58')](_0x2da192[_0xb317('0x36')][_0xb317('0x59')]);}})[_0xb317('0x27')](respondWithStatusCode(_0x5b6d7f,null))[_0xb317('0x45')](handleError(_0x5b6d7f,null));};exports[_0xb317('0x5a')]=function(_0x1ceed5,_0x48f5c9,_0x585250){return db['CmList']['find']({'where':{'id':_0x1ceed5['params']['id']}})[_0xb317('0x27')](handleEntityNotFound(_0x48f5c9,null))[_0xb317('0x27')](function(_0x5bc72d){if(_0x5bc72d){var _0x636c6c=[];var _0x13c9ff={'success':[],'errors':[]};return db[_0xb317('0x5b')][_0xb317('0x51')]()[_0xb317('0x27')](function(_0x2f7eb0){if(_0x1ceed5[_0xb317('0x49')][_0xb317('0x5c')]&&_[_0xb317('0x5d')](_0x1ceed5[_0xb317('0x49')][_0xb317('0x5c')])){if(_0x1ceed5[_0xb317('0x49')]['tags'][_0xb317('0x5e')]){_0x1ceed5['body'][_0xb317('0x5c')]=_0x1ceed5[_0xb317('0x49')][_0xb317('0x5c')]['join'](';')+';';}else{_0x1ceed5[_0xb317('0x49')][_0xb317('0x5c')]=null;}}else{_0x1ceed5[_0xb317('0x49')][_0xb317('0x5c')]=null;}if(_0x1ceed5['body']&&_[_0xb317('0x5d')](_0x1ceed5[_0xb317('0x49')])){for(var _0x3f2c0e=0x0;_0x3f2c0e<_0x1ceed5['body'][_0xb317('0x5e')];_0x3f2c0e+=0x1){_0x1ceed5[_0xb317('0x49')][_0x3f2c0e][_0xb317('0x53')]=_0x1ceed5[_0xb317('0x50')]['id'];_0x636c6c['push'](_0x1ceed5[_0xb317('0x49')][_0x3f2c0e]);}return BPromise[_0xb317('0x5f')](_0x636c6c,function(_0x495d67){return db[_0xb317('0x5b')][_0xb317('0x48')](_[_0xb317('0x60')](_0x495d67,[_0xb317('0x59'),'id'])||{},{'fields':_[_0xb317('0x35')](_0x2f7eb0),'raw':!![]})[_0xb317('0x27')](function(_0x1411da){_0x13c9ff[_0xb317('0x61')]['push'](_0x1411da[_0xb317('0x62')]);})[_0xb317('0x45')](function(_0x29b43c){_0x13c9ff['errors'][_0xb317('0x63')]({'data':_0x495d67,'error':_0x29b43c[_0xb317('0x64')]});});})['then'](function(_0xf9475e){return _0x13c9ff;})[_0xb317('0x45')](function(_0x2ca020){return _0x2ca020;});}else{_0x48f5c9[_0xb317('0x1b')](0x190)[_0xb317('0x22')]({'message':_0xb317('0x65')});}});}})[_0xb317('0x27')](respondWithResult(_0x48f5c9,null))['catch'](handleError(_0x48f5c9,null));};exports[_0xb317('0x66')]=function(_0x33bd22,_0x25dcb3,_0x504075){var _0xcf31c2;return db[_0xb317('0x31')][_0xb317('0x4d')]({'where':{'id':_0x33bd22[_0xb317('0x50')]['id']},'include':[{'model':db[_0xb317('0x67')],'as':'CustomFields'}]})[_0xb317('0x27')](handleEntityNotFound(_0x25dcb3,null))[_0xb317('0x27')](function(_0x46144f){if(_0x46144f){_0xcf31c2=_0x46144f;return db[_0xb317('0x5b')][_0xb317('0x46')];}})['then'](function(_0x470027){if(_0x470027){var _0x4da84e={};var _0x4b36f4={};_0x4b36f4[_0xb317('0x34')]=_[_0xb317('0x68')](_[_0xb317('0x35')](_0x470027),_['map'](_0xcf31c2[_0xb317('0x69')],function(_0x5b7bb4){return util[_0xb317('0x6a')]('cf_%d',_0x5b7bb4['id']);}));_0x4b36f4[_0xb317('0x36')]=_[_0xb317('0x35')](_0x33bd22[_0xb317('0x36')]);_0x4b36f4[_0xb317('0x47')]=_[_0xb317('0x37')](_0x4b36f4['model'],_0x4b36f4[_0xb317('0x36')]);_0x4da84e[_0xb317('0x38')]=_[_0xb317('0x37')](_0x4b36f4[_0xb317('0x34')],qs['fields'](_0x33bd22[_0xb317('0x36')][_0xb317('0x39')]));_0x4da84e[_0xb317('0x38')]=_0x4da84e[_0xb317('0x38')][_0xb317('0x5e')]?_0x4da84e[_0xb317('0x38')]:_0x4b36f4[_0xb317('0x34')];if(!_0x33bd22[_0xb317('0x36')]['hasOwnProperty'](_0xb317('0x3b'))){_0x4da84e[_0xb317('0x1e')]=qs['limit'](_0x33bd22['query'][_0xb317('0x1e')]);_0x4da84e[_0xb317('0x1d')]=qs[_0xb317('0x1d')](_0x33bd22[_0xb317('0x36')][_0xb317('0x1d')]);}_0x4da84e[_0xb317('0x56')]=qs['sort'](_0x33bd22[_0xb317('0x36')][_0xb317('0x3c')]);_0x4da84e[_0xb317('0x3f')]=qs[_0xb317('0x47')](_[_0xb317('0x3d')](_0x33bd22[_0xb317('0x36')],_0x4b36f4['filters']));_0x4da84e['raw']=!![];if(_0x33bd22[_0xb317('0x36')]['filter']){_0x4da84e[_0xb317('0x3f')]=_[_0xb317('0x3e')](_0x4da84e[_0xb317('0x3f')],{'$or':_['map'](_0x4da84e[_0xb317('0x38')],function(_0x4c703a){var _0x19d09d={};_0x19d09d[_0x4c703a]={'$like':'%'+_0x33bd22[_0xb317('0x36')]['filter']+'%'};return _0x19d09d;})});}_0x4da84e=_[_0xb317('0x3e')]({},_0x4da84e,_0x33bd22[_0xb317('0x42')]);return _0xcf31c2[_0xb317('0x66')](_0x4da84e);}})[_0xb317('0x27')](respondWithResult(_0x25dcb3,null))['catch'](handleError(_0x25dcb3,null));};exports['getContactsCsv']=function(_0x584d5d,_0x4e2320,_0x433167){var _0x3edecd;return db['CmList']['find']({'where':{'id':_0x584d5d[_0xb317('0x50')]['id']},'include':[{'model':db[_0xb317('0x67')],'as':_0xb317('0x69')}]})[_0xb317('0x27')](handleEntityNotFound(_0x4e2320,null))[_0xb317('0x27')](function(_0x1419cc){if(_0x1419cc){_0x3edecd=_0x1419cc;return db[_0xb317('0x5b')][_0xb317('0x46')];}})[_0xb317('0x27')](function(_0x54ea76){if(_0x54ea76){var _0x10cafc={};var _0x19fe6d={};_0x19fe6d[_0xb317('0x34')]=_[_0xb317('0x68')](_[_0xb317('0x35')](_0x54ea76),_[_0xb317('0x30')](_0x3edecd[_0xb317('0x69')],function(_0x42921b){return util[_0xb317('0x6a')]('cf_%d',_0x42921b['id']);}));_0x19fe6d['query']=_[_0xb317('0x35')](_0x584d5d[_0xb317('0x36')]);_0x19fe6d[_0xb317('0x47')]=_[_0xb317('0x37')](_0x19fe6d[_0xb317('0x34')],_0x19fe6d[_0xb317('0x36')]);_0x10cafc[_0xb317('0x38')]=_['intersection'](_0x19fe6d[_0xb317('0x34')],qs[_0xb317('0x39')](_0x584d5d['query'][_0xb317('0x39')]));_0x10cafc[_0xb317('0x38')]=_0x10cafc[_0xb317('0x38')][_0xb317('0x5e')]?_0x10cafc['attributes']:_0x19fe6d[_0xb317('0x34')];if(!_0x584d5d[_0xb317('0x36')]['hasOwnProperty'](_0xb317('0x3b'))){_0x10cafc['limit']=qs[_0xb317('0x1e')](_0x584d5d[_0xb317('0x36')]['limit']);_0x10cafc[_0xb317('0x1d')]=qs[_0xb317('0x1d')](_0x584d5d['query'][_0xb317('0x1d')]);}_0x10cafc[_0xb317('0x56')]=qs['sort'](_0x584d5d[_0xb317('0x36')][_0xb317('0x3c')]);_0x10cafc['where']=qs[_0xb317('0x47')](_['pick'](_0x584d5d[_0xb317('0x36')],_0x19fe6d['filters']));_0x10cafc[_0xb317('0x6b')]=!![];if(_0x584d5d[_0xb317('0x36')][_0xb317('0x6c')]){_0x10cafc[_0xb317('0x3f')]=_[_0xb317('0x3e')](_0x10cafc['where'],{'$or':_[_0xb317('0x30')](_0x10cafc[_0xb317('0x38')],function(_0xfe5dd3){var _0x1f53d7={};_0x1f53d7[_0xfe5dd3]={'$like':'%'+_0x584d5d['query']['filter']+'%'};return _0x1f53d7;})});}_0x10cafc=_[_0xb317('0x3e')]({},_0x10cafc,_0x584d5d[_0xb317('0x42')]);return _0x3edecd[_0xb317('0x66')](_0x10cafc);}})[_0xb317('0x27')](function(_0x7f0f37){if(!_[_0xb317('0x6d')](_0x7f0f37)){var _0x4a571b=toCsv(_0x7f0f37);var _0xfa4e67=Date[_0xb317('0x6e')]();fs[_0xb317('0x6f')](util[_0xb317('0x6a')](_0xb317('0x70'),_0x3edecd['id'],_0xfa4e67),_0x4a571b);_0x4e2320[_0xb317('0x71')](_0xb317('0x72'),_0xb317('0x73')+util['format']('list_%d_%s.csv',_0x3edecd['id'],_0xfa4e67));_0x4e2320[_0xb317('0x71')](_0xb317('0x74'),_0xb317('0x75'));return _0x4e2320[_0xb317('0x76')](util[_0xb317('0x6a')](_0xb317('0x70'),_0x3edecd['id'],_0xfa4e67));}else{return _0x4e2320[_0xb317('0x1a')](0xcc);}})[_0xb317('0x45')](handleError(_0x4e2320,null));};exports[_0xb317('0x77')]=function(_0x2d8e7d,_0x3b53ff,_0x2d44cb){var _0x15cd76;delete _0x2d8e7d[_0xb317('0x49')]['id'];return db[_0xb317('0x31')][_0xb317('0x55')]({'where':{'id':_0x2d8e7d['params']['id']}})[_0xb317('0x27')](handleEntityNotFound(_0x3b53ff,null))[_0xb317('0x27')](function(_0x1f55dc){if(_0x1f55dc){return db[_0xb317('0x78')][_0xb317('0x79')](function(_0x368224){return db[_0xb317('0x67')][_0xb317('0x48')](_0x2d8e7d[_0xb317('0x49')],{'transaction':_0x368224})[_0xb317('0x27')](function(_0x3064f9){_0x15cd76=_0x3064f9;return _0x1f55dc['addCustomFields'](_0x3064f9,{'transaction':_0x368224});})[_0xb317('0x27')](function(){var _0x4da608={'type':db['Sequelize'][_0xb317('0x7a')],'transaction':_0x368224};switch(_0x2d8e7d[_0xb317('0x49')]['type']){case _0xb317('0x7b'):_0x4da608[_0xb317('0x40')]=db[_0xb317('0x7c')][_0xb317('0x7a')];break;case _0xb317('0x7d'):_0x4da608[_0xb317('0x40')]=db[_0xb317('0x7c')][_0xb317('0x7e')];break;case _0xb317('0x7f'):_0x4da608[_0xb317('0x40')]=db[_0xb317('0x7c')][_0xb317('0x80')];_0x4da608[_0xb317('0x81')]=![];break;default:}return db[_0xb317('0x78')][_0xb317('0x82')]['addColumn'](_0xb317('0x83'),util['format'](_0xb317('0x84'),_0x15cd76['id']),_0x4da608);})[_0xb317('0x27')](function(){return _0x15cd76;});});}})[_0xb317('0x27')](respondWithResult(_0x3b53ff,null))[_0xb317('0x45')](handleError(_0x3b53ff,null));};exports[_0xb317('0x85')]=function(_0x37818f,_0x3a97e6,_0x44d4ea){var _0x2d5f61={};var _0xce6739={};var _0x2feb66;var _0x2cdf40;return db[_0xb317('0x31')][_0xb317('0x55')]({'where':{'id':_0x37818f[_0xb317('0x50')]['id']}})[_0xb317('0x27')](handleEntityNotFound(_0x3a97e6,null))[_0xb317('0x27')](function(_0x14f924){if(_0x14f924){_0x2feb66=_0x14f924;_0xce6739[_0xb317('0x34')]=_['keys'](db[_0xb317('0x67')]['rawAttributes']);_0xce6739[_0xb317('0x36')]=_['keys'](_0x37818f[_0xb317('0x36')]);_0xce6739['filters']=_[_0xb317('0x37')](_0xce6739[_0xb317('0x34')],_0xce6739[_0xb317('0x36')]);_0x2d5f61[_0xb317('0x38')]=_[_0xb317('0x37')](_0xce6739[_0xb317('0x34')],qs['fields'](_0x37818f[_0xb317('0x36')][_0xb317('0x39')]));_0x2d5f61[_0xb317('0x38')]=_0x2d5f61[_0xb317('0x38')][_0xb317('0x5e')]?_0x2d5f61['attributes']:_0xce6739['model'];_0x2d5f61['order']=qs['sort'](_0x37818f[_0xb317('0x36')][_0xb317('0x3c')]);_0x2d5f61[_0xb317('0x3f')]=qs['filters'](_['pick'](_0x37818f[_0xb317('0x36')],_0xce6739['filters']));_0x2d5f61['where']=_[_0xb317('0x3e')](_0x2d5f61[_0xb317('0x3f')],{'$or':[{'ListId':_0x14f924['id']},{'ListId':null}]});if(_0x37818f['query'][_0xb317('0x6c')]){_0x2d5f61[_0xb317('0x3f')]=_[_0xb317('0x3e')](_0x2d5f61[_0xb317('0x3f')],{'$or':_[_0xb317('0x30')](_0x2d5f61[_0xb317('0x38')],function(_0x367988){var _0xf3d702={};_0xf3d702[_0x367988]={'$like':'%'+_0x37818f[_0xb317('0x36')][_0xb317('0x6c')]+'%'};return _0xf3d702;})});}_0x2d5f61=_[_0xb317('0x3e')]({},_0x2d5f61,_0x37818f[_0xb317('0x42')]);return db[_0xb317('0x67')][_0xb317('0x86')](_0x2d5f61);}})[_0xb317('0x27')](respondWithResult(_0x3a97e6,null))[_0xb317('0x45')](handleError(_0x3a97e6,null));};exports['addAgents']=function(_0x3961ed,_0x3f7c91,_0x2c79ba){return db[_0xb317('0x31')][_0xb317('0x4d')]({'where':{'id':_0x3961ed[_0xb317('0x50')]['id']}})['then'](handleEntityNotFound(_0x3f7c91,null))[_0xb317('0x27')](function(_0x4e1c9c){if(_0x4e1c9c){return _0x4e1c9c['addAgents'](_0x3961ed[_0xb317('0x49')]['ids'],_[_0xb317('0x60')](_0x3961ed[_0xb317('0x49')],['ids','id'])||{})[_0xb317('0x87')](function(_0x36f104){for(var _0x34c334=0x0;_0x34c334<_0x3961ed[_0xb317('0x49')]['ids'][_0xb317('0x5e')];_0x34c334+=0x1){socket[_0xb317('0x88')](_0xb317('0x89'),{'UserId':Number(_0x3961ed[_0xb317('0x49')][_0xb317('0x59')][_0x34c334]),'CmListId':Number(_0x3961ed[_0xb317('0x50')]['id'])});}return _0x36f104;});}})[_0xb317('0x27')](respondWithResult(_0x3f7c91,null))[_0xb317('0x45')](handleError(_0x3f7c91,null));};exports[_0xb317('0x8a')]=function(_0x31d4de,_0x537b4b,_0x452ee6){return db[_0xb317('0x31')]['find']({'where':{'id':_0x31d4de[_0xb317('0x50')]['id']}})[_0xb317('0x27')](handleEntityNotFound(_0x537b4b,null))[_0xb317('0x27')](function(_0x1f249e){if(_0x1f249e){return _0x1f249e[_0xb317('0x8a')](_0x31d4de[_0xb317('0x36')][_0xb317('0x59')])['then'](function(){if(_[_0xb317('0x5d')](_0x31d4de['query'][_0xb317('0x59')])){for(var _0x1d4d76=0x0;_0x1d4d76<_0x31d4de['query'][_0xb317('0x59')][_0xb317('0x5e')];_0x1d4d76+=0x1){socket[_0xb317('0x88')](_0xb317('0x8b'),{'UserId':Number(_0x31d4de['query']['ids'][_0x1d4d76]),'CmListId':Number(_0x31d4de[_0xb317('0x50')]['id'])});}}else{socket[_0xb317('0x88')](_0xb317('0x8b'),{'UserId':Number(_0x31d4de['query'][_0xb317('0x59')]),'CmListId':Number(_0x31d4de[_0xb317('0x50')]['id'])});}});}})[_0xb317('0x27')](respondWithStatusCode(_0x537b4b,null))[_0xb317('0x45')](handleError(_0x537b4b,null));};exports[_0xb317('0x8c')]=function(_0x1d01e6,_0x26af8a,_0x1445e1){var _0x17a0cb={};var _0xfebd69={};var _0x436507;var _0x85dd33;return db[_0xb317('0x31')][_0xb317('0x55')]({'where':{'id':_0x1d01e6[_0xb317('0x50')]['id']}})['then'](handleEntityNotFound(_0x26af8a,null))[_0xb317('0x27')](function(_0x3a0e31){if(_0x3a0e31){_0x436507=_0x3a0e31;_0xfebd69['model']=_[_0xb317('0x35')](db[_0xb317('0x8d')][_0xb317('0x46')]);_0xfebd69['query']=_[_0xb317('0x35')](_0x1d01e6['query']);_0xfebd69['filters']=_[_0xb317('0x37')](_0xfebd69[_0xb317('0x34')],_0xfebd69[_0xb317('0x36')]);_0x17a0cb['attributes']=_['intersection'](_0xfebd69[_0xb317('0x34')],qs['fields'](_0x1d01e6['query'][_0xb317('0x39')]));_0x17a0cb[_0xb317('0x38')]=_0x17a0cb[_0xb317('0x38')][_0xb317('0x5e')]?_0x17a0cb[_0xb317('0x38')]:_0xfebd69[_0xb317('0x34')];_0x17a0cb[_0xb317('0x56')]=qs['sort'](_0x1d01e6[_0xb317('0x36')]['sort']);_0x17a0cb[_0xb317('0x3f')]=qs[_0xb317('0x47')](_['pick'](_0x1d01e6['query'],_0xfebd69['filters']));if(_0x1d01e6[_0xb317('0x36')][_0xb317('0x6c')]){_0x17a0cb[_0xb317('0x3f')]=_[_0xb317('0x3e')](_0x17a0cb[_0xb317('0x3f')],{'$or':_[_0xb317('0x30')](_0x17a0cb[_0xb317('0x38')],function(_0x2d1398){var _0x2e766d={};_0x2e766d[_0x2d1398]={'$like':'%'+_0x1d01e6[_0xb317('0x36')][_0xb317('0x6c')]+'%'};return _0x2e766d;})});}_0x17a0cb=_['merge']({},_0x17a0cb,_0x1d01e6['options']);return _0x436507['getAgents'](_0x17a0cb);}})['then'](function(_0x57f5e4){if(_0x57f5e4){_0x85dd33=_0x57f5e4[_0xb317('0x5e')];if(!_0x1d01e6['query'][_0xb317('0x3a')](_0xb317('0x3b'))){_0x17a0cb[_0xb317('0x1e')]=qs[_0xb317('0x1e')](_0x1d01e6[_0xb317('0x36')][_0xb317('0x1e')]);_0x17a0cb[_0xb317('0x1d')]=qs[_0xb317('0x1d')](_0x1d01e6[_0xb317('0x36')]['offset']);}return _0x436507['getAgents'](_0x17a0cb);}})[_0xb317('0x27')](function(_0x980f4e){if(_0x980f4e){return _0x980f4e?{'count':_0x85dd33,'rows':_0x980f4e}:null;}})[_0xb317('0x27')](respondWithResult(_0x26af8a,null))['catch'](handleError(_0x26af8a,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index b98f34d..562aab8 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 _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x326f,0xd1));var _0xf326=function(_0x59b4f2,_0x50612e){_0x59b4f2=_0x59b4f2-0x0;var _0x4f2d00=_0x326f[_0x59b4f2];return _0x4f2d00;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x7217,0x19e));var _0x7721=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x7217[_0x24237f];return _0x48298e;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index c5e0fcf..3d20325 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 _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmList','cm_lists','../../config/logger','api'];(function(_0x5a7434,_0x4f5161){var _0x414868=function(_0x5f3ac2){while(--_0x5f3ac2){_0x5a7434['push'](_0x5a7434['shift']());}};_0x414868(++_0x4f5161);}(_0x1339,0x1ed));var _0x9133=function(_0x1296f3,_0x4bf0b7){_0x1296f3=_0x1296f3-0x0;var _0x505ee7=_0x1339[_0x1296f3];return _0x505ee7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./cmList.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['request-promise','path','./cmList.attributes','define','CmList','cm_lists','../../config/logger','api','moment','bluebird'];(function(_0x33ee9f,_0x4a238c){var _0x1da5e4=function(_0x5cbdf9){while(--_0x5cbdf9){_0x33ee9f['push'](_0x33ee9f['shift']());}};_0x1da5e4(++_0x4a238c);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'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 b4b1b29..4c87666 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 _0x78a0=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x25d6f2,_0x162bf0){var _0x64fdcd=function(_0x20e5b7){while(--_0x20e5b7){_0x25d6f2['push'](_0x25d6f2['shift']());}};_0x64fdcd(++_0x162bf0);}(_0x78a0,0xf7));var _0x078a=function(_0x5b7606,_0x3367ef){_0x5b7606=_0x5b7606-0x0;var _0x186584=_0x78a0[_0x5b7606];return _0x186584;};'use strict';var _=require('lodash');var util=require(_0x078a('0x0'));var moment=require(_0x078a('0x1'));var BPromise=require(_0x078a('0x2'));var rs=require(_0x078a('0x3'));var fs=require('fs');var Redis=require(_0x078a('0x4'));var db=require(_0x078a('0x5'))['db'];var utils=require(_0x078a('0x6'));var logger=require(_0x078a('0x7'))('rpc');var config=require(_0x078a('0x8'));var jayson=require(_0x078a('0x9'));var client=jayson['client'][_0x078a('0xa')]({'port':0x232a});config['redis']=_[_0x078a('0xb')](config['redis'],{'host':_0x078a('0xc'),'port':0x18eb});var socket=require(_0x078a('0xd'))(new Redis(config[_0x078a('0xe')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x5a79de,_0x10691c,_0x61499d){return new BPromise(function(_0x3c81e6,_0x2f6c9b){return client['request'](_0x5a79de,_0x61499d)['then'](function(_0x56e692){logger[_0x078a('0xf')](_0x078a('0x10'),_0x10691c,_0x078a('0x11'));logger[_0x078a('0x12')](_0x078a('0x13'),_0x10691c,_0x078a('0x11'),JSON[_0x078a('0x14')](_0x56e692));if(_0x56e692[_0x078a('0x15')]){if(_0x56e692[_0x078a('0x15')][_0x078a('0x16')]===0x1f4){logger[_0x078a('0x15')](_0x078a('0x10'),_0x10691c,_0x56e692[_0x078a('0x15')][_0x078a('0x17')]);return _0x2f6c9b(_0x56e692[_0x078a('0x15')][_0x078a('0x17')]);}logger['error'](_0x078a('0x10'),_0x10691c,_0x56e692[_0x078a('0x15')]['message']);return _0x3c81e6(_0x56e692['error'][_0x078a('0x17')]);}else{logger[_0x078a('0xf')]('CmList,\x20%s,\x20%s',_0x10691c,_0x078a('0x11'));_0x3c81e6(_0x56e692['result']['message']);}})[_0x078a('0x18')](function(_0x276c95){logger[_0x078a('0x15')](_0x078a('0x10'),_0x10691c,_0x276c95);_0x2f6c9b(_0x276c95);});});} \ No newline at end of file +var _0xce1d=['message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xce1d,0xe2));var _0xdce1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xce1d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdce1('0x0'));var util=require('util');var moment=require(_0xdce1('0x1'));var BPromise=require(_0xdce1('0x2'));var rs=require(_0xdce1('0x3'));var fs=require('fs');var Redis=require(_0xdce1('0x4'));var db=require(_0xdce1('0x5'))['db'];var utils=require(_0xdce1('0x6'));var logger=require(_0xdce1('0x7'))(_0xdce1('0x8'));var config=require(_0xdce1('0x9'));var jayson=require(_0xdce1('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xdce1('0xb')](config[_0xdce1('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdce1('0xd'))(new Redis(config[_0xdce1('0xc')]));require(_0xdce1('0xe'))[_0xdce1('0xf')](socket);function respondWithRpcPromise(_0x1f2cc2,_0x3dcef4,_0x117b83){return new BPromise(function(_0x2ef9e0,_0x45db20){return client[_0xdce1('0x10')](_0x1f2cc2,_0x117b83)[_0xdce1('0x11')](function(_0x2d3ab6){logger[_0xdce1('0x12')](_0xdce1('0x13'),_0x3dcef4,_0xdce1('0x14'));logger[_0xdce1('0x15')](_0xdce1('0x16'),_0x3dcef4,_0xdce1('0x14'),JSON[_0xdce1('0x17')](_0x2d3ab6));if(_0x2d3ab6[_0xdce1('0x18')]){if(_0x2d3ab6['error'][_0xdce1('0x19')]===0x1f4){logger['error'](_0xdce1('0x13'),_0x3dcef4,_0x2d3ab6[_0xdce1('0x18')][_0xdce1('0x1a')]);return _0x45db20(_0x2d3ab6[_0xdce1('0x18')][_0xdce1('0x1a')]);}logger['error'](_0xdce1('0x13'),_0x3dcef4,_0x2d3ab6[_0xdce1('0x18')][_0xdce1('0x1a')]);return _0x2ef9e0(_0x2d3ab6['error'][_0xdce1('0x1a')]);}else{logger[_0xdce1('0x12')]('CmList,\x20%s,\x20%s',_0x3dcef4,_0xdce1('0x14'));_0x2ef9e0(_0x2d3ab6[_0xdce1('0x1b')][_0xdce1('0x1a')]);}})['catch'](function(_0x2203fd){logger[_0xdce1('0x18')](_0xdce1('0x13'),_0x3dcef4,_0x2203fd);_0x45db20(_0x2203fd);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 62b58f7..79d4968 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 _0x47d4=['register','length','save','remove','update','emit','removeListener'];(function(_0x1e5303,_0x36c0f0){var _0xd1556b=function(_0x1b959e){while(--_0x1b959e){_0x1e5303['push'](_0x1e5303['shift']());}};_0xd1556b(++_0x36c0f0);}(_0x47d4,0xfe));var _0x447d=function(_0x246112,_0x686c3){_0x246112=_0x246112-0x0;var _0x3801f6=_0x47d4[_0x246112];return _0x3801f6;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x447d('0x0'),_0x447d('0x1'),_0x447d('0x2')];function createListener(_0x178a72,_0x313d05){return function(_0x4a5c17){_0x313d05[_0x447d('0x3')](_0x178a72,_0x4a5c17);};}function removeListener(_0x21c291,_0x118f45){return function(){CmListEvents[_0x447d('0x4')](_0x21c291,_0x118f45);};}exports[_0x447d('0x5')]=function(_0x5f2a68){for(var _0x1c4f2d=0x0,_0x32e433=events[_0x447d('0x6')];_0x1c4f2d<_0x32e433;_0x1c4f2d++){var _0x367b16=events[_0x1c4f2d];var _0x5cea44=createListener('cmList:'+_0x367b16,_0x5f2a68);CmListEvents['on'](_0x367b16,_0x5cea44);}}; \ No newline at end of file +var _0xf07d=['cmList:','./cmList.events','save','remove','emit','removeListener','register','length'];(function(_0x4de2e8,_0x484c62){var _0x5352eb=function(_0x1c9144){while(--_0x1c9144){_0x4de2e8['push'](_0x4de2e8['shift']());}};_0x5352eb(++_0x484c62);}(_0xf07d,0xe1));var _0xdf07=function(_0x41ea3a,_0x3139aa){_0x41ea3a=_0x41ea3a-0x0;var _0x55ebf1=_0xf07d[_0x41ea3a];return _0x55ebf1;};'use strict';var CmListEvents=require(_0xdf07('0x0'));var events=[_0xdf07('0x1'),_0xdf07('0x2'),'update'];function createListener(_0x15a81c,_0x773249){return function(_0x29b9b3){_0x773249[_0xdf07('0x3')](_0x15a81c,_0x29b9b3);};}function removeListener(_0x906b9d,_0x105c18){return function(){CmListEvents[_0xdf07('0x4')](_0x906b9d,_0x105c18);};}exports[_0xdf07('0x5')]=function(_0x3e9aac){for(var _0xdcfc2d=0x0,_0xd4add1=events[_0xdf07('0x6')];_0xdcfc2d<_0xd4add1;_0xdcfc2d++){var _0x3d4c48=events[_0xdcfc2d];var _0x20c486=createListener(_0xdf07('0x7')+_0x3d4c48,_0x3e9aac);CmListEvents['on'](_0x3d4c48,_0x20c486);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 88ff88f..bebd0e5 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 _0xdc98=['getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','post','create','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/contacts'];(function(_0x369f05,_0x162ee9){var _0x6ee717=function(_0x27d9a2){while(--_0x27d9a2){_0x369f05['push'](_0x369f05['shift']());}};_0x6ee717(++_0x162ee9);}(_0xdc98,0x17a));var _0x8dc9=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xdc98[_0x16d10f];return _0x50c823;};'use strict';var multer=require(_0x8dc9('0x0'));var util=require(_0x8dc9('0x1'));var path=require(_0x8dc9('0x2'));var timeout=require(_0x8dc9('0x3'));var express=require(_0x8dc9('0x4'));var router=express['Router']();var fs_extra=require(_0x8dc9('0x5'));var auth=require(_0x8dc9('0x6'));var interaction=require(_0x8dc9('0x7'));var config=require('../../config/environment');var controller=require(_0x8dc9('0x8'));router[_0x8dc9('0x9')]('/',auth['isAuthenticated'](),controller[_0x8dc9('0xa')]);router[_0x8dc9('0x9')](_0x8dc9('0xb'),auth[_0x8dc9('0xc')](),controller[_0x8dc9('0xd')]);router['get'](_0x8dc9('0xe'),auth[_0x8dc9('0xc')](),controller[_0x8dc9('0xf')]);router['get'](_0x8dc9('0x10'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x8dc9('0x11'),auth[_0x8dc9('0xc')](),controller[_0x8dc9('0x12')]);router[_0x8dc9('0x9')](_0x8dc9('0x13'),auth[_0x8dc9('0xc')](),controller[_0x8dc9('0x14')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x8dc9('0x15')]);router[_0x8dc9('0x9')](_0x8dc9('0x16'),auth[_0x8dc9('0xc')](),controller['getAgents']);router[_0x8dc9('0x17')]('/',auth[_0x8dc9('0xc')](),controller[_0x8dc9('0x18')]);router[_0x8dc9('0x17')](_0x8dc9('0x10'),auth['isAuthenticated'](),controller[_0x8dc9('0x19')]);router[_0x8dc9('0x17')](_0x8dc9('0x11'),auth['isAuthenticated'](),controller[_0x8dc9('0x1a')]);router[_0x8dc9('0x17')](_0x8dc9('0x1b'),auth['isAuthenticated'](),controller[_0x8dc9('0x1c')]);router[_0x8dc9('0x17')]('/:id/users',auth[_0x8dc9('0xc')](),controller[_0x8dc9('0x1d')]);router[_0x8dc9('0x1e')](_0x8dc9('0xe'),auth[_0x8dc9('0xc')](),controller[_0x8dc9('0x1f')]);router[_0x8dc9('0x20')]('/:id',auth[_0x8dc9('0xc')](),controller[_0x8dc9('0x21')]);router[_0x8dc9('0x20')](_0x8dc9('0x10'),auth[_0x8dc9('0xc')](),controller['removeDispositions']);router[_0x8dc9('0x20')](_0x8dc9('0x16'),auth[_0x8dc9('0xc')](),controller[_0x8dc9('0x22')]);module[_0x8dc9('0x23')]=router; \ No newline at end of file +var _0x0456=['./cmList.controller','isAuthenticated','/describe','describe','get','/:id','show','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','/:id/contacts','addContacts','addCustomField','addAgents','put','delete','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3c7492,_0x9fae6c){var _0x35d298=function(_0x9d1601){while(--_0x9d1601){_0x3c7492['push'](_0x3c7492['shift']());}};_0x35d298(++_0x9fae6c);}(_0x0456,0xb8));var _0x6045=function(_0x3e3f69,_0x1d000f){_0x3e3f69=_0x3e3f69-0x0;var _0x376dea=_0x0456[_0x3e3f69];return _0x376dea;};'use strict';var multer=require(_0x6045('0x0'));var util=require(_0x6045('0x1'));var path=require(_0x6045('0x2'));var timeout=require(_0x6045('0x3'));var express=require(_0x6045('0x4'));var router=express[_0x6045('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6045('0x6'));var interaction=require(_0x6045('0x7'));var config=require('../../config/environment');var controller=require(_0x6045('0x8'));router['get']('/',auth[_0x6045('0x9')](),controller['index']);router['get'](_0x6045('0xa'),auth[_0x6045('0x9')](),controller[_0x6045('0xb')]);router[_0x6045('0xc')](_0x6045('0xd'),auth[_0x6045('0x9')](),controller[_0x6045('0xe')]);router[_0x6045('0xc')]('/:id/dispositions',auth[_0x6045('0x9')](),controller[_0x6045('0xf')]);router[_0x6045('0xc')]('/:id/contacts',auth[_0x6045('0x9')](),controller[_0x6045('0x10')]);router[_0x6045('0xc')](_0x6045('0x11'),auth[_0x6045('0x9')](),controller[_0x6045('0x12')]);router[_0x6045('0xc')](_0x6045('0x13'),auth[_0x6045('0x9')](),controller[_0x6045('0x14')]);router[_0x6045('0xc')](_0x6045('0x15'),auth[_0x6045('0x9')](),controller['getAgents']);router[_0x6045('0x16')]('/',auth[_0x6045('0x9')](),controller[_0x6045('0x17')]);router[_0x6045('0x16')]('/:id/dispositions',auth[_0x6045('0x9')](),controller['addDisposition']);router['post'](_0x6045('0x18'),auth['isAuthenticated'](),controller[_0x6045('0x19')]);router[_0x6045('0x16')](_0x6045('0x13'),auth['isAuthenticated'](),controller[_0x6045('0x1a')]);router[_0x6045('0x16')]('/:id/users',auth[_0x6045('0x9')](),controller[_0x6045('0x1b')]);router[_0x6045('0x1c')](_0x6045('0xd'),auth[_0x6045('0x9')](),controller['update']);router['delete'](_0x6045('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x6045('0x1d')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x6045('0x1e')]);router[_0x6045('0x1d')](_0x6045('0x15'),auth[_0x6045('0x9')](),controller[_0x6045('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 4386104..a706337 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 _0x0c90=['field','STRING','sequelize'];(function(_0x159b04,_0x178da1){var _0x4392c9=function(_0x240699){while(--_0x240699){_0x159b04['push'](_0x159b04['shift']());}};_0x4392c9(++_0x178da1);}(_0x0c90,0x11c));var _0x00c9=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0c90[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x00c9('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5a46ed){return this['getDataValue'](_0x00c9('0x1'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x00c9('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x00c9('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x10dd=['field','STRING','sequelize','exports','getDataValue'];(function(_0x29941f,_0x187d20){var _0x453246=function(_0x762c5e){while(--_0x762c5e){_0x29941f['push'](_0x29941f['shift']());}};_0x453246(++_0x187d20);}(_0x10dd,0x14c));var _0xd10d=function(_0x2014f2,_0x1c9414){_0x2014f2=_0x2014f2-0x0;var _0x23bac2=_0x10dd[_0x2014f2];return _0x23bac2;};'use strict';var Sequelize=require(_0xd10d('0x0'));module[_0xd10d('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x129663){return this[_0xd10d('0x2')](_0xd10d('0x3'));}},'field':{'type':Sequelize[_0xd10d('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xd10d('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xd10d('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 90c86d9..b5f5e8a 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(_0x4303d5,_0x30c32e){var _0x5e90a5=function(_0x1ae315){while(--_0x1ae315){_0x4303d5['push'](_0x4303d5['shift']());}};_0x5e90a5(++_0x30c32e);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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(_0x340bda,_0x5191f9){var _0x418072=function(_0x49581f){while(--_0x49581f){_0x340bda['push'](_0x340bda['shift']());}};_0x418072(++_0x5191f9);}(_0x7a54,0x106));var _0x47a5=function(_0x14b377,_0x26f5f4){_0x14b377=_0x14b377-0x0;var _0x44c39f=_0x7a54[_0x14b377];return _0x44c39f;};'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 87a1434..e97f752 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 _0xb8c4=['bluebird','request-promise','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment'];(function(_0x3727ae,_0x165f88){var _0x1c3f01=function(_0x5cd5a5){while(--_0x5cd5a5){_0x3727ae['push'](_0x3727ae['shift']());}};_0x1c3f01(++_0x165f88);}(_0xb8c4,0x18e));var _0x4b8c=function(_0x4ec3ab,_0x50a5de){_0x4ec3ab=_0x4ec3ab-0x0;var _0x229613=_0xb8c4[_0x4ec3ab];return _0x229613;};'use strict';var _=require(_0x4b8c('0x0'));var util=require(_0x4b8c('0x1'));var logger=require(_0x4b8c('0x2'))(_0x4b8c('0x3'));var moment=require(_0x4b8c('0x4'));var BPromise=require(_0x4b8c('0x5'));var rp=require(_0x4b8c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b8c('0x7'));var config=require('../../config/environment');var attributes=require(_0x4b8c('0x8'));module[_0x4b8c('0x9')]=function(_0x4afbec,_0x4da29e){return _0x4afbec[_0x4b8c('0xa')](_0x4b8c('0xb'),attributes,{'tableName':_0x4b8c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x576b=['api','moment','path','rimraf','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','lodash','util','../../config/logger'];(function(_0x10e0a4,_0xc14e7d){var _0x553856=function(_0x493c21){while(--_0x493c21){_0x10e0a4['push'](_0x10e0a4['shift']());}};_0x553856(++_0xc14e7d);}(_0x576b,0x75));var _0xb576=function(_0x26618b,_0x2a0b51){_0x26618b=_0x26618b-0x0;var _0xe25ad=_0x576b[_0x26618b];return _0xe25ad;};'use strict';var _=require(_0xb576('0x0'));var util=require(_0xb576('0x1'));var logger=require(_0xb576('0x2'))(_0xb576('0x3'));var moment=require(_0xb576('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb576('0x5'));var rimraf=require(_0xb576('0x6'));var config=require(_0xb576('0x7'));var attributes=require(_0xb576('0x8'));module[_0xb576('0x9')]=function(_0x468aeb,_0x1cbe0a){return _0x468aeb['define'](_0xb576('0xa'),attributes,{'tableName':_0xb576('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 590853a..1fe62d7 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 _0xfc9c=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x445179,_0x389247){var _0x36626f=function(_0x54ca4e){while(--_0x54ca4e){_0x445179['push'](_0x445179['shift']());}};_0x36626f(++_0x389247);}(_0xfc9c,0x15f));var _0xcfc9=function(_0x4cea7d,_0x50f55b){_0x4cea7d=_0x4cea7d-0x0;var _0x36e72a=_0xfc9c[_0x4cea7d];return _0x36e72a;};'use strict';var _=require(_0xcfc9('0x0'));var util=require(_0xcfc9('0x1'));var moment=require(_0xcfc9('0x2'));var BPromise=require('bluebird');var rs=require(_0xcfc9('0x3'));var fs=require('fs');var Redis=require(_0xcfc9('0x4'));var db=require(_0xcfc9('0x5'))['db'];var utils=require(_0xcfc9('0x6'));var logger=require(_0xcfc9('0x7'))(_0xcfc9('0x8'));var config=require(_0xcfc9('0x9'));var jayson=require(_0xcfc9('0xa'));var client=jayson[_0xcfc9('0xb')][_0xcfc9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f6a0a,_0x4ce56a,_0x1173a1){return new BPromise(function(_0x23384a,_0x143b99){return client[_0xcfc9('0xd')](_0x1f6a0a,_0x1173a1)['then'](function(_0x5e1ff3){logger['info'](_0xcfc9('0xe'),_0x4ce56a,_0xcfc9('0xf'));logger[_0xcfc9('0x10')](_0xcfc9('0x11'),_0x4ce56a,_0xcfc9('0xf'),JSON[_0xcfc9('0x12')](_0x5e1ff3));if(_0x5e1ff3[_0xcfc9('0x13')]){if(_0x5e1ff3[_0xcfc9('0x13')][_0xcfc9('0x14')]===0x1f4){logger[_0xcfc9('0x13')](_0xcfc9('0xe'),_0x4ce56a,_0x5e1ff3['error']['message']);return _0x143b99(_0x5e1ff3[_0xcfc9('0x13')][_0xcfc9('0x15')]);}logger[_0xcfc9('0x13')](_0xcfc9('0xe'),_0x4ce56a,_0x5e1ff3[_0xcfc9('0x13')]['message']);return _0x23384a(_0x5e1ff3[_0xcfc9('0x13')][_0xcfc9('0x15')]);}else{logger[_0xcfc9('0x16')](_0xcfc9('0xe'),_0x4ce56a,_0xcfc9('0xf'));_0x23384a(_0x5e1ff3[_0xcfc9('0x17')][_0xcfc9('0x15')]);}})[_0xcfc9('0x18')](function(_0x2e3690){logger[_0xcfc9('0x13')](_0xcfc9('0xe'),_0x4ce56a,_0x2e3690);_0x143b99(_0x2e3690);});});} \ No newline at end of file +var _0x20d5=['then','info','request\x20sent','debug','stringify','error','Condition,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x41ccb6,_0x55aeeb){var _0x5fd3df=function(_0x32e9ab){while(--_0x32e9ab){_0x41ccb6['push'](_0x41ccb6['shift']());}};_0x5fd3df(++_0x55aeeb);}(_0x20d5,0x1ed));var _0x520d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20d5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x520d('0x0'));var moment=require(_0x520d('0x1'));var BPromise=require('bluebird');var rs=require(_0x520d('0x2'));var fs=require('fs');var Redis=require(_0x520d('0x3'));var db=require(_0x520d('0x4'))['db'];var utils=require(_0x520d('0x5'));var logger=require(_0x520d('0x6'))(_0x520d('0x7'));var config=require(_0x520d('0x8'));var jayson=require(_0x520d('0x9'));var client=jayson[_0x520d('0xa')][_0x520d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb927d9,_0x3b9d44,_0x5ec473){return new BPromise(function(_0x1de3bb,_0x25fed5){return client[_0x520d('0xc')](_0xb927d9,_0x5ec473)[_0x520d('0xd')](function(_0x574c03){logger[_0x520d('0xe')]('Condition,\x20%s,\x20%s',_0x3b9d44,_0x520d('0xf'));logger[_0x520d('0x10')]('Condition,\x20%s,\x20%s,\x20%s',_0x3b9d44,_0x520d('0xf'),JSON[_0x520d('0x11')](_0x574c03));if(_0x574c03[_0x520d('0x12')]){if(_0x574c03[_0x520d('0x12')]['code']===0x1f4){logger['error'](_0x520d('0x13'),_0x3b9d44,_0x574c03['error'][_0x520d('0x14')]);return _0x25fed5(_0x574c03[_0x520d('0x12')][_0x520d('0x14')]);}logger[_0x520d('0x12')](_0x520d('0x13'),_0x3b9d44,_0x574c03['error'][_0x520d('0x14')]);return _0x1de3bb(_0x574c03[_0x520d('0x12')][_0x520d('0x14')]);}else{logger[_0x520d('0xe')](_0x520d('0x13'),_0x3b9d44,_0x520d('0xf'));_0x1de3bb(_0x574c03[_0x520d('0x15')][_0x520d('0x14')]);}})[_0x520d('0x16')](function(_0x3e9ce5){logger[_0x520d('0x12')](_0x520d('0x13'),_0x3b9d44,_0x3e9ce5);_0x25fed5(_0x3e9ce5);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index d7ed106..68e8adb 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 _0xcbe2=['../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x23a3bf,_0x223564){var _0x17f379=function(_0x55ae22){while(--_0x55ae22){_0x23a3bf['push'](_0x23a3bf['shift']());}};_0x17f379(++_0x223564);}(_0xcbe2,0xf6));var _0x2cbe=function(_0x2c7d16,_0x26857b){_0x2c7d16=_0x2c7d16-0x0;var _0x4c9685=_0xcbe2[_0x2c7d16];return _0x4c9685;};'use strict';var multer=require(_0x2cbe('0x0'));var util=require(_0x2cbe('0x1'));var path=require(_0x2cbe('0x2'));var timeout=require(_0x2cbe('0x3'));var express=require(_0x2cbe('0x4'));var router=express[_0x2cbe('0x5')]();var fs_extra=require(_0x2cbe('0x6'));var auth=require(_0x2cbe('0x7'));var interaction=require(_0x2cbe('0x8'));var config=require(_0x2cbe('0x9'));var controller=require(_0x2cbe('0xa'));router[_0x2cbe('0xb')](_0x2cbe('0xc'),auth[_0x2cbe('0xd')](),controller[_0x2cbe('0xe')]);router['delete']('/:id',auth[_0x2cbe('0xd')](),controller[_0x2cbe('0xf')]);module[_0x2cbe('0x10')]=router; \ No newline at end of file +var _0xcb56=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x14a34a,_0x424129){var _0x4d921e=function(_0x1982be){while(--_0x1982be){_0x14a34a['push'](_0x14a34a['shift']());}};_0x4d921e(++_0x424129);}(_0xcb56,0x120));var _0x6cb5=function(_0x43771c,_0x4461f7){_0x43771c=_0x43771c-0x0;var _0x27c98e=_0xcb56[_0x43771c];return _0x27c98e;};'use strict';var multer=require(_0x6cb5('0x0'));var util=require(_0x6cb5('0x1'));var path=require(_0x6cb5('0x2'));var timeout=require(_0x6cb5('0x3'));var express=require(_0x6cb5('0x4'));var router=express[_0x6cb5('0x5')]();var fs_extra=require(_0x6cb5('0x6'));var auth=require(_0x6cb5('0x7'));var interaction=require(_0x6cb5('0x8'));var config=require('../../config/environment');var controller=require(_0x6cb5('0x9'));router['put'](_0x6cb5('0xa'),auth[_0x6cb5('0xb')](),controller[_0x6cb5('0xc')]);router[_0x6cb5('0xd')](_0x6cb5('0xa'),auth[_0x6cb5('0xb')](),controller[_0x6cb5('0xe')]);module[_0x6cb5('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 58a6cff..43c5764 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 _0x757a=['exports','STRING'];(function(_0x2980e3,_0x53b685){var _0x14d1bf=function(_0x223068){while(--_0x223068){_0x2980e3['push'](_0x2980e3['shift']());}};_0x14d1bf(++_0x53b685);}(_0x757a,0xde));var _0xa757=function(_0x373071,_0x2b2214){_0x373071=_0x373071-0x0;var _0x54fe29=_0x757a[_0x373071];return _0x54fe29;};'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 +var _0xb7e7=['STRING','sequelize'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xb7e7[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 17ed3dc..54b36af 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 _0x65dc=['role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','createdAt','updatedAt','omit','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','update','then','destroy','get','CustomDashboards','error','name','index','map','Dashboard','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','rows','catch','show','rawAttributes','length','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x326f07,_0x44aa84){var _0x1e38f4=function(_0xb129f){while(--_0xb129f){_0x326f07['push'](_0x326f07['shift']());}};_0x1e38f4(++_0x44aa84);}(_0x65dc,0x12d));var _0xc65d=function(_0x2657fa,_0x15fab8){_0x2657fa=_0x2657fa-0x0;var _0x555b92=_0x65dc[_0x2657fa];return _0x555b92;};'use strict';var emlformat=require(_0xc65d('0x0'));var rimraf=require(_0xc65d('0x1'));var zipdir=require(_0xc65d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc65d('0x3'));var moment=require(_0xc65d('0x4'));var BPromise=require(_0xc65d('0x5'));var Mustache=require(_0xc65d('0x6'));var util=require(_0xc65d('0x7'));var path=require(_0xc65d('0x8'));var sox=require(_0xc65d('0x9'));var csv=require(_0xc65d('0xa'));var ejs=require(_0xc65d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc65d('0xc'));var squel=require(_0xc65d('0xd'));var crypto=require(_0xc65d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc65d('0xf'));var toCsv=require(_0xc65d('0xa'));var querystring=require(_0xc65d('0x10'));var Papa=require('papaparse');var Redis=require(_0xc65d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc65d('0x12'));var as=require(_0xc65d('0x13'));var hardwareService=require(_0xc65d('0x14'));var logger=require(_0xc65d('0x15'))(_0xc65d('0x16'));var utils=require(_0xc65d('0x17'));var config=require(_0xc65d('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc65d('0x19')]=_[_0xc65d('0x1a')](config[_0xc65d('0x19')],{'host':_0xc65d('0x1b'),'port':0x18eb});var socket=require(_0xc65d('0x1c'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x22fcc5,_0xa2bda3){_0xa2bda3=_0xa2bda3||0xcc;return function(_0x5bc688){if(_0x5bc688){return _0x22fcc5[_0xc65d('0x1d')](_0xa2bda3);}return _0x22fcc5[_0xc65d('0x1e')](_0xa2bda3)[_0xc65d('0x1f')]();};}function respondWithResult(_0x429986,_0x3e757b){_0x3e757b=_0x3e757b||0xc8;return function(_0x213a67){if(_0x213a67){return _0x429986[_0xc65d('0x1e')](_0x3e757b)[_0xc65d('0x20')](_0x213a67);}};}function respondWithFilteredResult(_0x17bd33,_0x37a3b4){return function(_0x2d4045){if(_0x2d4045){var _0x5736df=typeof _0x37a3b4[_0xc65d('0x21')]==='undefined'&&typeof _0x37a3b4['limit']===_0xc65d('0x22');var _0x380d76=_0x2d4045[_0xc65d('0x23')];var _0x59df4d=_0x5736df?0x0:_0x37a3b4[_0xc65d('0x21')];var _0x1144d7=_0x5736df?_0x2d4045[_0xc65d('0x23')]:_0x37a3b4[_0xc65d('0x21')]+_0x37a3b4['limit'];var _0x511ad0;if(_0x1144d7>=_0x380d76){_0x1144d7=_0x380d76;_0x511ad0=0xc8;}else{_0x511ad0=0xce;}_0x17bd33[_0xc65d('0x1e')](_0x511ad0);return _0x17bd33['set'](_0xc65d('0x24'),_0x59df4d+'-'+_0x1144d7+'/'+_0x380d76)[_0xc65d('0x20')](_0x2d4045);}return null;};}function patchUpdates(_0x1a3abe){return function(_0x185483){try{jsonpatch['apply'](_0x185483,_0x1a3abe,!![]);}catch(_0x2da0a8){return BPromise[_0xc65d('0x25')](_0x2da0a8);}return _0x185483[_0xc65d('0x26')]();};}function saveUpdates(_0x40579d,_0x58d948){return function(_0xd0825e){if(_0xd0825e){return _0xd0825e[_0xc65d('0x27')](_0x40579d)[_0xc65d('0x28')](function(_0x469a8c){return _0x469a8c;});}return null;};}function removeEntity(_0xade53a,_0x573f51){return function(_0xe4529b){if(_0xe4529b){return _0xe4529b[_0xc65d('0x29')]()[_0xc65d('0x28')](function(){var _0x57726c=_0xe4529b[_0xc65d('0x2a')]({'plain':!![]});var _0x8d3a8c=_0xc65d('0x2b');return db['UserProfileResource'][_0xc65d('0x29')]({'where':{'type':_0x8d3a8c,'resourceId':_0x57726c['id']}})[_0xc65d('0x28')](function(){return _0xe4529b;});})[_0xc65d('0x28')](function(){_0xade53a['status'](0xcc)[_0xc65d('0x1f')]();});}};}function handleEntityNotFound(_0x61c8ff,_0x406d21){return function(_0x378c49){if(!_0x378c49){_0x61c8ff[_0xc65d('0x1d')](0x194);}return _0x378c49;};}function handleError(_0x76ab2a,_0x506b38){_0x506b38=_0x506b38||0x1f4;return function(_0x59aa3a){logger[_0xc65d('0x2c')](_0x59aa3a['stack']);if(_0x59aa3a['name']){delete _0x59aa3a[_0xc65d('0x2d')];}_0x76ab2a[_0xc65d('0x1e')](_0x506b38)['send'](_0x59aa3a);};}exports[_0xc65d('0x2e')]=function(_0x992e07,_0xe1d141){var _0x5225ea={},_0x403da2={},_0xccfebe={'count':0x0,'rows':[]};var _0xb86557=_[_0xc65d('0x2f')](db[_0xc65d('0x30')]['rawAttributes'],function(_0x4fce68){return{'name':_0x4fce68['fieldName'],'type':_0x4fce68[_0xc65d('0x31')][_0xc65d('0x32')]};});_0x403da2[_0xc65d('0x33')]=_[_0xc65d('0x2f')](_0xb86557,_0xc65d('0x2d'));_0x403da2[_0xc65d('0x34')]=_[_0xc65d('0x35')](_0x992e07[_0xc65d('0x34')]);_0x403da2[_0xc65d('0x36')]=_['intersection'](_0x403da2[_0xc65d('0x33')],_0x403da2[_0xc65d('0x34')]);_0x5225ea[_0xc65d('0x37')]=_[_0xc65d('0x38')](_0x403da2['model'],qs[_0xc65d('0x39')](_0x992e07[_0xc65d('0x34')][_0xc65d('0x39')]));_0x5225ea[_0xc65d('0x37')]=_0x5225ea[_0xc65d('0x37')]['length']?_0x5225ea[_0xc65d('0x37')]:_0x403da2[_0xc65d('0x33')];if(!_0x992e07['query'][_0xc65d('0x3a')](_0xc65d('0x3b'))){_0x5225ea[_0xc65d('0x3c')]=qs[_0xc65d('0x3c')](_0x992e07[_0xc65d('0x34')]['limit']);_0x5225ea[_0xc65d('0x21')]=qs[_0xc65d('0x21')](_0x992e07[_0xc65d('0x34')]['offset']);}_0x5225ea[_0xc65d('0x3d')]=qs[_0xc65d('0x3e')](_0x992e07[_0xc65d('0x34')][_0xc65d('0x3e')]);_0x5225ea['where']=qs[_0xc65d('0x36')](_[_0xc65d('0x3f')](_0x992e07['query'],_0x403da2[_0xc65d('0x36')]),_0xb86557);if(_0x992e07[_0xc65d('0x34')][_0xc65d('0x40')]){_0x5225ea[_0xc65d('0x41')]=_[_0xc65d('0x42')](_0x5225ea[_0xc65d('0x41')],{'$or':_[_0xc65d('0x2f')](_0xb86557,function(_0x36fd55){if(_0x36fd55[_0xc65d('0x31')]!==_0xc65d('0x43')){var _0xa82001={};_0xa82001[_0x36fd55[_0xc65d('0x2d')]]={'$like':'%'+_0x992e07[_0xc65d('0x34')][_0xc65d('0x40')]+'%'};return _0xa82001;}})});}_0x5225ea=_[_0xc65d('0x42')]({},_0x5225ea,_0x992e07[_0xc65d('0x44')]);var _0x4922ec={'where':_0x5225ea['where']};return db[_0xc65d('0x30')][_0xc65d('0x23')](_0x4922ec)['then'](function(_0x531a21){_0xccfebe[_0xc65d('0x23')]=_0x531a21;if(_0x992e07['query']['includeAll']){_0x5225ea['include']=[{'all':!![]}];}return db[_0xc65d('0x30')]['findAll'](_0x5225ea);})[_0xc65d('0x28')](function(_0x136def){_0xccfebe[_0xc65d('0x45')]=_0x136def;return _0xccfebe;})['then'](respondWithFilteredResult(_0xe1d141,_0x5225ea))[_0xc65d('0x46')](handleError(_0xe1d141,null));};exports[_0xc65d('0x47')]=function(_0x336235,_0x307eaa){var _0x48d44f={'raw':![],'where':{'id':_0x336235['params']['id']}},_0x1ba258={};_0x1ba258['model']=_['keys'](db[_0xc65d('0x30')][_0xc65d('0x48')]);_0x1ba258[_0xc65d('0x34')]=_[_0xc65d('0x35')](_0x336235['query']);_0x1ba258[_0xc65d('0x36')]=_[_0xc65d('0x38')](_0x1ba258[_0xc65d('0x33')],_0x1ba258[_0xc65d('0x34')]);_0x48d44f[_0xc65d('0x37')]=_[_0xc65d('0x38')](_0x1ba258[_0xc65d('0x33')],qs[_0xc65d('0x39')](_0x336235[_0xc65d('0x34')][_0xc65d('0x39')]));_0x48d44f[_0xc65d('0x37')]=_0x48d44f['attributes'][_0xc65d('0x49')]?_0x48d44f[_0xc65d('0x37')]:_0x1ba258[_0xc65d('0x33')];if(_0x336235[_0xc65d('0x34')][_0xc65d('0x4a')]){_0x48d44f[_0xc65d('0x4b')]=[{'all':!![]}];}_0x48d44f=_['merge']({},_0x48d44f,_0x336235[_0xc65d('0x44')]);return db[_0xc65d('0x30')][_0xc65d('0x4c')](_0x48d44f)[_0xc65d('0x28')](handleEntityNotFound(_0x307eaa,null))[_0xc65d('0x28')](respondWithResult(_0x307eaa,null))[_0xc65d('0x46')](handleError(_0x307eaa,null));};exports[_0xc65d('0x4d')]=function(_0x2ce086,_0x3fdd16){return db[_0xc65d('0x30')][_0xc65d('0x4d')](_0x2ce086[_0xc65d('0x4e')],{})[_0xc65d('0x28')](function(_0x5e1d24){var _0x2e22de=_0x2ce086['user'][_0xc65d('0x2a')]({'plain':!![]});if(!_0x2e22de)throw new Error(_0xc65d('0x4f'));if(_0x2e22de[_0xc65d('0x50')]===_0xc65d('0x51')){var _0x106d3a=_0x5e1d24[_0xc65d('0x2a')]({'plain':!![]});var _0x392685=_0xc65d('0x2b');return db[_0xc65d('0x52')][_0xc65d('0x4c')]({'where':{'name':_0x392685,'userProfileId':_0x2e22de[_0xc65d('0x53')]},'raw':!![]})[_0xc65d('0x28')](function(_0x3d6cb5){if(_0x3d6cb5&&_0x3d6cb5[_0xc65d('0x54')]===0x0){return db[_0xc65d('0x55')][_0xc65d('0x4d')]({'name':_0x106d3a[_0xc65d('0x2d')],'resourceId':_0x106d3a['id'],'type':_0x3d6cb5[_0xc65d('0x2d')],'sectionId':_0x3d6cb5['id']},{})[_0xc65d('0x28')](function(){return _0x5e1d24;});}else{return _0x5e1d24;}})['catch'](function(_0xaa2849){logger['error'](_0xc65d('0x56'),_0xaa2849);throw _0xaa2849;});}return _0x5e1d24;})[_0xc65d('0x28')](respondWithResult(_0x3fdd16,0xc9))['catch'](handleError(_0x3fdd16,null));};exports['clone']=function(_0x5cfcb4,_0x193f33){var _0x183c91={'where':{'id':_0x5cfcb4[_0xc65d('0x57')]['id']}},_0xdde60e={};_0xdde60e[_0xc65d('0x33')]=_['keys'](db['Dashboard'][_0xc65d('0x48')]);_0x183c91[_0xc65d('0x37')]=_['intersection'](_0xdde60e[_0xc65d('0x33')],qs[_0xc65d('0x39')](_0x5cfcb4[_0xc65d('0x34')][_0xc65d('0x39')]));_0x183c91[_0xc65d('0x37')]=_0x183c91['attributes']['length']?_0x183c91[_0xc65d('0x37')]:_0xdde60e[_0xc65d('0x33')];if(_0x5cfcb4['query']['includeAll']){_0x183c91[_0xc65d('0x4b')]=[{'all':!![]}];}_0x183c91=_[_0xc65d('0x42')]({},_0x183c91,_0x5cfcb4[_0xc65d('0x44')]);return db[_0xc65d('0x30')][_0xc65d('0x4c')](_0x183c91)['then'](handleEntityNotFound(_0x193f33,null))[_0xc65d('0x28')](function(_0x2537b2){if(_0x2537b2){var _0x33d2e8=_0x2537b2[_0xc65d('0x2a')]({'plain':!![]});_0x33d2e8=qs['omit'](_0x33d2e8,['id',_0xc65d('0x58'),_0xc65d('0x59')]);_0x5cfcb4[_0xc65d('0x4e')]=_[_0xc65d('0x5a')](_0x5cfcb4[_0xc65d('0x4e')],['id',_0xc65d('0x58'),_0xc65d('0x59')]);return db[_0xc65d('0x30')][_0xc65d('0x4d')](_['merge'](_0x33d2e8,_0x5cfcb4[_0xc65d('0x4e')]),{'include':_0x5cfcb4[_0xc65d('0x34')][_0xc65d('0x4a')]?[{'all':!![]}]:undefined})[_0xc65d('0x28')](function(_0x15a56c){var _0x445f5f=_0x5cfcb4[_0xc65d('0x51')]['get']({'plain':!![]});if(!_0x445f5f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x445f5f[_0xc65d('0x50')]==='user'){var _0x4e5bab=_0x15a56c[_0xc65d('0x2a')]({'plain':!![]});var _0x1600c3=_0xc65d('0x2b');return db[_0xc65d('0x52')][_0xc65d('0x4c')]({'where':{'name':_0x1600c3,'userProfileId':_0x445f5f['userProfileId']},'raw':!![]})[_0xc65d('0x28')](function(_0x475707){if(_0x475707&&_0x475707[_0xc65d('0x54')]===0x0){return db[_0xc65d('0x55')][_0xc65d('0x4d')]({'name':_0x4e5bab[_0xc65d('0x2d')],'resourceId':_0x4e5bab['id'],'type':_0x475707['name'],'sectionId':_0x475707['id']},{})[_0xc65d('0x28')](function(){return _0x15a56c;});}else{return _0x15a56c;}})[_0xc65d('0x46')](function(_0x55b0d5){logger[_0xc65d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55b0d5);throw _0x55b0d5;});}return _0x15a56c;});}})[_0xc65d('0x28')](respondWithResult(_0x193f33,0xc9))['catch'](handleError(_0x193f33,null));};exports[_0xc65d('0x27')]=function(_0x133b0c,_0x23d78f){if(_0x133b0c[_0xc65d('0x4e')]['id']){delete _0x133b0c[_0xc65d('0x4e')]['id'];}return db[_0xc65d('0x30')][_0xc65d('0x4c')]({'where':{'id':_0x133b0c[_0xc65d('0x57')]['id']}})[_0xc65d('0x28')](handleEntityNotFound(_0x23d78f,null))[_0xc65d('0x28')](saveUpdates(_0x133b0c[_0xc65d('0x4e')],null))['then'](respondWithResult(_0x23d78f,null))[_0xc65d('0x46')](handleError(_0x23d78f,null));};exports[_0xc65d('0x29')]=function(_0xe436bd,_0x57d1c6){return db[_0xc65d('0x30')]['find']({'where':{'id':_0xe436bd['params']['id']}})[_0xc65d('0x28')](handleEntityNotFound(_0x57d1c6,null))[_0xc65d('0x28')](removeEntity(_0x57d1c6,null))[_0xc65d('0x46')](handleError(_0x57d1c6,null));};function widgetAttributes(_0x41ee05){try{switch(_0x41ee05[_0xc65d('0x31')]){case'iframe':return[{'name':_0xc65d('0x5b'),'value':_0x41ee05[_0xc65d('0x5b')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x0]?_0x41ee05[_0xc65d('0x5c')][0x0][_0xc65d('0x5d')]:undefined)||_0xc65d('0x5e')}];case _0xc65d('0x5f'):return[{'name':_0xc65d('0x60'),'value':_0x41ee05[_0xc65d('0x60')]||(_0x41ee05['attrs']&&_0x41ee05[_0xc65d('0x5c')][0x0]?_0x41ee05['attrs'][0x0]['value']:undefined)||''}];case _0xc65d('0x61'):return[{'name':_0xc65d('0x62'),'value':_0x41ee05['attrHourFormat']||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x0]?_0x41ee05['attrs'][0x0][_0xc65d('0x5d')]:undefined)||_0xc65d('0x63')},{'name':_0xc65d('0x64'),'value':_0x41ee05[_0xc65d('0x64')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x1]?_0x41ee05[_0xc65d('0x5c')][0x1][_0xc65d('0x5d')]:undefined)||_0xc65d('0x65')},{'name':_0xc65d('0x66'),'value':_0x41ee05[_0xc65d('0x66')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x2]?_0x41ee05[_0xc65d('0x5c')][0x2][_0xc65d('0x5d')]:undefined)||0xc}];case _0xc65d('0x67'):return[{'name':_0xc65d('0x68'),'value':_0x41ee05[_0xc65d('0x68')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x0]?_0x41ee05['attrs'][0x0]['value']:undefined)||_0xc65d('0x69')},{'name':_0xc65d('0x6a'),'value':_0x41ee05['attrVoiceQueues']||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x1]?_0x41ee05[_0xc65d('0x5c')][0x1][_0xc65d('0x5d')]:undefined)||[]},{'name':'attrFontSize','value':_0x41ee05[_0xc65d('0x66')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x2]?_0x41ee05[_0xc65d('0x5c')][0x2][_0xc65d('0x5d')]:undefined)||0x14},{'name':_0xc65d('0x6b'),'value':_0x41ee05['attrChannel']||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05['attrs'][0x3]?_0x41ee05['attrs'][0x3][_0xc65d('0x5d')]:undefined)||_0xc65d('0x6c')},{'name':'attrEmailAccounts','value':_0x41ee05[_0xc65d('0x6d')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x4]?_0x41ee05[_0xc65d('0x5c')][0x4][_0xc65d('0x5d')]:undefined)||''},{'name':_0xc65d('0x6e'),'value':_0x41ee05['attrFaxAccounts']||(_0x41ee05['attrs']&&_0x41ee05[_0xc65d('0x5c')][0x5]?_0x41ee05[_0xc65d('0x5c')][0x5]['value']:undefined)||''},{'name':_0xc65d('0x6f'),'value':_0x41ee05['attrSmsAccounts']||(_0x41ee05['attrs']&&_0x41ee05[_0xc65d('0x5c')][0x6]?_0x41ee05[_0xc65d('0x5c')][0x6][_0xc65d('0x5d')]:undefined)||''},{'name':_0xc65d('0x70'),'value':_0x41ee05[_0xc65d('0x70')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x7]?_0x41ee05['attrs'][0x7][_0xc65d('0x5d')]:undefined)||''},{'name':_0xc65d('0x71'),'value':_0x41ee05[_0xc65d('0x71')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x8]?_0x41ee05[_0xc65d('0x5c')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x41ee05[_0xc65d('0x72')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05['attrs'][0x9]?_0x41ee05[_0xc65d('0x5c')][0x9][_0xc65d('0x5d')]:undefined)||''}];case'multibar-chart':case _0xc65d('0x73'):return[{'name':_0xc65d('0x74'),'value':_0x41ee05['attrSerie1']||(_0x41ee05['attrs']&&_0x41ee05[_0xc65d('0x5c')][0x0]?_0x41ee05[_0xc65d('0x5c')][0x0][_0xc65d('0x5d')]:undefined)||_0xc65d('0x69')},{'name':_0xc65d('0x75'),'value':_0x41ee05[_0xc65d('0x75')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x1]?_0x41ee05[_0xc65d('0x5c')][0x1][_0xc65d('0x5d')]:undefined)||null},{'name':'attrSerie3','value':_0x41ee05[_0xc65d('0x76')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x2]?_0x41ee05[_0xc65d('0x5c')][0x2][_0xc65d('0x5d')]:undefined)||null},{'name':_0xc65d('0x6a'),'value':_0x41ee05[_0xc65d('0x6a')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x3]?_0x41ee05[_0xc65d('0x5c')][0x3][_0xc65d('0x5d')]:undefined)||[]},{'name':_0xc65d('0x6b'),'value':_0x41ee05['attrChannel']||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05['attrs'][0x4]?_0x41ee05[_0xc65d('0x5c')][0x4][_0xc65d('0x5d')]:undefined)||'voice'},{'name':_0xc65d('0x6d'),'value':_0x41ee05[_0xc65d('0x6d')]||(_0x41ee05['attrs']&&_0x41ee05['attrs'][0x5]?_0x41ee05[_0xc65d('0x5c')][0x5][_0xc65d('0x5d')]:undefined)||''},{'name':_0xc65d('0x6e'),'value':_0x41ee05[_0xc65d('0x6e')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05['attrs'][0x6]?_0x41ee05[_0xc65d('0x5c')][0x6][_0xc65d('0x5d')]:undefined)||''},{'name':_0xc65d('0x6f'),'value':_0x41ee05[_0xc65d('0x6f')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x7]?_0x41ee05[_0xc65d('0x5c')][0x7][_0xc65d('0x5d')]:undefined)||''},{'name':_0xc65d('0x70'),'value':_0x41ee05[_0xc65d('0x70')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05['attrs'][0x8]?_0x41ee05[_0xc65d('0x5c')][0x8]['value']:undefined)||''},{'name':_0xc65d('0x71'),'value':_0x41ee05[_0xc65d('0x71')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x9]?_0x41ee05[_0xc65d('0x5c')][0x9][_0xc65d('0x5d')]:undefined)||''},{'name':_0xc65d('0x72'),'value':_0x41ee05[_0xc65d('0x72')]||(_0x41ee05['attrs']&&_0x41ee05[_0xc65d('0x5c')][0xa]?_0x41ee05[_0xc65d('0x5c')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0xc65d('0x77'),'type':_0x41ee05['reportType']||(_0x41ee05['attrs']&&_0x41ee05['attrs'][0x0]?_0x41ee05[_0xc65d('0x5c')][0x0][_0xc65d('0x31')]:undefined)||null,'value':_0x41ee05['attrReport']||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05['attrs'][0x0]?_0x41ee05[_0xc65d('0x5c')][0x0][_0xc65d('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x41ee05[_0xc65d('0x78')]||(_0x41ee05[_0xc65d('0x5c')]&&_0x41ee05[_0xc65d('0x5c')][0x1]?_0x41ee05[_0xc65d('0x5c')][0x1][_0xc65d('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x110e3f){logger[_0xc65d('0x2c')](_0xc65d('0x79'),JSON[_0xc65d('0x7a')](_0x110e3f));return[];}}exports[_0xc65d('0x7b')]=function(_0x46cff4,_0x25f9de,_0x284333){if(_0x46cff4[_0xc65d('0x4e')]['id']){delete _0x46cff4['body']['id'];}return db['Dashboard'][_0xc65d('0x4c')]({'where':{'id':_0x46cff4[_0xc65d('0x57')]['id']}})[_0xc65d('0x28')](handleEntityNotFound(_0x25f9de,null))[_0xc65d('0x28')](function(_0x50f1da){if(_0x50f1da){_0x46cff4[_0xc65d('0x4e')]['DashboardId']=_0x50f1da['id'];_0x46cff4[_0xc65d('0x4e')]['attrs']=widgetAttributes(_0x46cff4[_0xc65d('0x4e')]);return db[_0xc65d('0x7c')][_0xc65d('0x4d')](_0x46cff4[_0xc65d('0x4e')]);}})[_0xc65d('0x28')](respondWithResult(_0x25f9de,null))['catch'](handleError(_0x25f9de,null));};exports[_0xc65d('0x7d')]=function(_0x50d47d,_0x18dc34,_0x3e7209){var _0x201917={};var _0x4044d6={};var _0x3991bb;var _0x2accb1;return db[_0xc65d('0x30')][_0xc65d('0x7e')]({'where':{'id':_0x50d47d[_0xc65d('0x57')]['id']}})[_0xc65d('0x28')](handleEntityNotFound(_0x18dc34,null))['then'](function(_0x5d5f66){if(_0x5d5f66){_0x3991bb=_0x5d5f66;_0x4044d6['model']=_[_0xc65d('0x35')](db[_0xc65d('0x7c')]['rawAttributes']);_0x4044d6['query']=_['keys'](_0x50d47d[_0xc65d('0x34')]);_0x4044d6['filters']=_['intersection'](_0x4044d6['model'],_0x4044d6[_0xc65d('0x34')]);_0x201917[_0xc65d('0x37')]=_[_0xc65d('0x38')](_0x4044d6['model'],qs[_0xc65d('0x39')](_0x50d47d[_0xc65d('0x34')][_0xc65d('0x39')]));_0x201917['attributes']=_0x201917[_0xc65d('0x37')][_0xc65d('0x49')]?_0x201917[_0xc65d('0x37')]:_0x4044d6['model'];_0x201917[_0xc65d('0x3d')]=qs['sort'](_0x50d47d[_0xc65d('0x34')]['sort']);_0x201917[_0xc65d('0x41')]=qs[_0xc65d('0x36')](_['pick'](_0x50d47d[_0xc65d('0x34')],_0x4044d6[_0xc65d('0x36')]));if(_0x50d47d[_0xc65d('0x34')][_0xc65d('0x40')]){_0x201917[_0xc65d('0x41')]=_[_0xc65d('0x42')](_0x201917[_0xc65d('0x41')],{'$or':_['map'](_0x201917[_0xc65d('0x37')],function(_0x1297d2){var _0xb1addf={};_0xb1addf[_0x1297d2]={'$like':'%'+_0x50d47d['query']['filter']+'%'};return _0xb1addf;})});}_0x201917=_[_0xc65d('0x42')]({},_0x201917,_0x50d47d[_0xc65d('0x44')]);return _0x3991bb[_0xc65d('0x7d')](_0x201917);}})['then'](function(_0x2d77d3){if(_0x2d77d3){_0x2accb1=_0x2d77d3[_0xc65d('0x49')];if(!_0x50d47d[_0xc65d('0x34')][_0xc65d('0x3a')](_0xc65d('0x3b'))){_0x201917[_0xc65d('0x3c')]=qs[_0xc65d('0x3c')](_0x50d47d['query'][_0xc65d('0x3c')]);_0x201917['offset']=qs[_0xc65d('0x21')](_0x50d47d[_0xc65d('0x34')]['offset']);}return _0x3991bb[_0xc65d('0x7d')](_0x201917);}})[_0xc65d('0x28')](function(_0x4f0564){if(_0x4f0564){return _0x4f0564?{'count':_0x2accb1,'rows':_0x4f0564}:null;}})[_0xc65d('0x28')](respondWithResult(_0x18dc34,null))[_0xc65d('0x46')](handleError(_0x18dc34,null));}; \ No newline at end of file +var _0xacd7=['name','send','index','map','Dashboard','fieldName','type','model','query','keys','filters','fields','attributes','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','stringify','addItem','DashboardId','DashboardItem','findOne','intersection','pick','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./dashboard.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','get','CustomDashboards','UserProfileResource','destroy','end','sendStatus','error','stack'];(function(_0x4a41cf,_0x5d92d6){var _0x268047=function(_0x1844d2){while(--_0x1844d2){_0x4a41cf['push'](_0x4a41cf['shift']());}};_0x268047(++_0x5d92d6);}(_0xacd7,0x15a));var _0x7acd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xacd7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7acd('0x0'));var rimraf=require(_0x7acd('0x1'));var zipdir=require(_0x7acd('0x2'));var jsonpatch=require(_0x7acd('0x3'));var rp=require(_0x7acd('0x4'));var moment=require('moment');var BPromise=require(_0x7acd('0x5'));var Mustache=require('mustache');var util=require(_0x7acd('0x6'));var path=require(_0x7acd('0x7'));var sox=require(_0x7acd('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7acd('0x9'));var _=require(_0x7acd('0xa'));var squel=require(_0x7acd('0xb'));var crypto=require(_0x7acd('0xc'));var jsforce=require(_0x7acd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7acd('0xe'));var querystring=require('querystring');var Papa=require(_0x7acd('0xf'));var Redis=require(_0x7acd('0x10'));var authService=require(_0x7acd('0x11'));var qs=require(_0x7acd('0x12'));var as=require(_0x7acd('0x13'));var hardwareService=require(_0x7acd('0x14'));var logger=require(_0x7acd('0x15'))(_0x7acd('0x16'));var utils=require(_0x7acd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7acd('0x18'));var db=require('../../mysqldb')['db'];config[_0x7acd('0x19')]=_[_0x7acd('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7acd('0x1b'))(new Redis(config['redis']));require(_0x7acd('0x1c'))[_0x7acd('0x1d')](socket);function respondWithStatusCode(_0x22db1c,_0x357647){_0x357647=_0x357647||0xcc;return function(_0x3e2a3a){if(_0x3e2a3a){return _0x22db1c['sendStatus'](_0x357647);}return _0x22db1c[_0x7acd('0x1e')](_0x357647)['end']();};}function respondWithResult(_0x94bd8f,_0x152580){_0x152580=_0x152580||0xc8;return function(_0x23c990){if(_0x23c990){return _0x94bd8f[_0x7acd('0x1e')](_0x152580)[_0x7acd('0x1f')](_0x23c990);}};}function respondWithFilteredResult(_0x68e5de,_0x5d0ed4){return function(_0x10d69b){if(_0x10d69b){var _0x519eea=typeof _0x5d0ed4[_0x7acd('0x20')]==='undefined'&&typeof _0x5d0ed4[_0x7acd('0x21')]===_0x7acd('0x22');var _0x336ec1=_0x10d69b['count'];var _0x5913c5=_0x519eea?0x0:_0x5d0ed4['offset'];var _0x93f85b=_0x519eea?_0x10d69b[_0x7acd('0x23')]:_0x5d0ed4['offset']+_0x5d0ed4[_0x7acd('0x21')];var _0x3c7de8;if(_0x93f85b>=_0x336ec1){_0x93f85b=_0x336ec1;_0x3c7de8=0xc8;}else{_0x3c7de8=0xce;}_0x68e5de[_0x7acd('0x1e')](_0x3c7de8);return _0x68e5de[_0x7acd('0x24')](_0x7acd('0x25'),_0x5913c5+'-'+_0x93f85b+'/'+_0x336ec1)[_0x7acd('0x1f')](_0x10d69b);}return null;};}function patchUpdates(_0x33c6a6){return function(_0x343339){try{jsonpatch[_0x7acd('0x26')](_0x343339,_0x33c6a6,!![]);}catch(_0x344901){return BPromise[_0x7acd('0x27')](_0x344901);}return _0x343339['save']();};}function saveUpdates(_0x38013c,_0x3fb012){return function(_0x2a4d3c){if(_0x2a4d3c){return _0x2a4d3c[_0x7acd('0x28')](_0x38013c)[_0x7acd('0x29')](function(_0x2cc631){return _0x2cc631;});}return null;};}function removeEntity(_0x473bfc,_0x2df8ac){return function(_0x4196c7){if(_0x4196c7){return _0x4196c7['destroy']()[_0x7acd('0x29')](function(){var _0xc1edac=_0x4196c7[_0x7acd('0x2a')]({'plain':!![]});var _0x4b18e6=_0x7acd('0x2b');return db[_0x7acd('0x2c')][_0x7acd('0x2d')]({'where':{'type':_0x4b18e6,'resourceId':_0xc1edac['id']}})['then'](function(){return _0x4196c7;});})[_0x7acd('0x29')](function(){_0x473bfc['status'](0xcc)[_0x7acd('0x2e')]();});}};}function handleEntityNotFound(_0x1ff3f5,_0xd80f5f){return function(_0x4a7b4e){if(!_0x4a7b4e){_0x1ff3f5[_0x7acd('0x2f')](0x194);}return _0x4a7b4e;};}function handleError(_0x1519f9,_0x1dfb00){_0x1dfb00=_0x1dfb00||0x1f4;return function(_0x256756){logger[_0x7acd('0x30')](_0x256756[_0x7acd('0x31')]);if(_0x256756[_0x7acd('0x32')]){delete _0x256756[_0x7acd('0x32')];}_0x1519f9[_0x7acd('0x1e')](_0x1dfb00)[_0x7acd('0x33')](_0x256756);};}exports[_0x7acd('0x34')]=function(_0x33f2ce,_0x51382d){var _0x40dd18={},_0x2dfdf2={},_0x44ef1e={'count':0x0,'rows':[]};var _0x27013d=_[_0x7acd('0x35')](db[_0x7acd('0x36')]['rawAttributes'],function(_0x1f41c7){return{'name':_0x1f41c7[_0x7acd('0x37')],'type':_0x1f41c7[_0x7acd('0x38')]['key']};});_0x2dfdf2[_0x7acd('0x39')]=_[_0x7acd('0x35')](_0x27013d,_0x7acd('0x32'));_0x2dfdf2[_0x7acd('0x3a')]=_[_0x7acd('0x3b')](_0x33f2ce['query']);_0x2dfdf2[_0x7acd('0x3c')]=_['intersection'](_0x2dfdf2[_0x7acd('0x39')],_0x2dfdf2['query']);_0x40dd18['attributes']=_['intersection'](_0x2dfdf2[_0x7acd('0x39')],qs[_0x7acd('0x3d')](_0x33f2ce[_0x7acd('0x3a')][_0x7acd('0x3d')]));_0x40dd18[_0x7acd('0x3e')]=_0x40dd18[_0x7acd('0x3e')]['length']?_0x40dd18[_0x7acd('0x3e')]:_0x2dfdf2[_0x7acd('0x39')];if(!_0x33f2ce['query']['hasOwnProperty'](_0x7acd('0x3f'))){_0x40dd18['limit']=qs[_0x7acd('0x21')](_0x33f2ce[_0x7acd('0x3a')][_0x7acd('0x21')]);_0x40dd18[_0x7acd('0x20')]=qs['offset'](_0x33f2ce[_0x7acd('0x3a')][_0x7acd('0x20')]);}_0x40dd18[_0x7acd('0x40')]=qs[_0x7acd('0x41')](_0x33f2ce[_0x7acd('0x3a')][_0x7acd('0x41')]);_0x40dd18[_0x7acd('0x42')]=qs[_0x7acd('0x3c')](_['pick'](_0x33f2ce[_0x7acd('0x3a')],_0x2dfdf2[_0x7acd('0x3c')]),_0x27013d);if(_0x33f2ce[_0x7acd('0x3a')][_0x7acd('0x43')]){_0x40dd18[_0x7acd('0x42')]=_['merge'](_0x40dd18[_0x7acd('0x42')],{'$or':_['map'](_0x27013d,function(_0x350dfa){if(_0x350dfa[_0x7acd('0x38')]!==_0x7acd('0x44')){var _0x44aea6={};_0x44aea6[_0x350dfa[_0x7acd('0x32')]]={'$like':'%'+_0x33f2ce[_0x7acd('0x3a')][_0x7acd('0x43')]+'%'};return _0x44aea6;}})});}_0x40dd18=_['merge']({},_0x40dd18,_0x33f2ce[_0x7acd('0x45')]);var _0x3e776c={'where':_0x40dd18[_0x7acd('0x42')]};return db[_0x7acd('0x36')][_0x7acd('0x23')](_0x3e776c)[_0x7acd('0x29')](function(_0x4f2bff){_0x44ef1e[_0x7acd('0x23')]=_0x4f2bff;if(_0x33f2ce[_0x7acd('0x3a')][_0x7acd('0x46')]){_0x40dd18[_0x7acd('0x47')]=[{'all':!![]}];}return db['Dashboard'][_0x7acd('0x48')](_0x40dd18);})[_0x7acd('0x29')](function(_0x32b2b8){_0x44ef1e[_0x7acd('0x49')]=_0x32b2b8;return _0x44ef1e;})['then'](respondWithFilteredResult(_0x51382d,_0x40dd18))[_0x7acd('0x4a')](handleError(_0x51382d,null));};exports[_0x7acd('0x4b')]=function(_0x9d74e1,_0x59335c){var _0x2290cc={'raw':![],'where':{'id':_0x9d74e1['params']['id']}},_0x17a4a4={};_0x17a4a4[_0x7acd('0x39')]=_[_0x7acd('0x3b')](db[_0x7acd('0x36')][_0x7acd('0x4c')]);_0x17a4a4[_0x7acd('0x3a')]=_[_0x7acd('0x3b')](_0x9d74e1[_0x7acd('0x3a')]);_0x17a4a4[_0x7acd('0x3c')]=_['intersection'](_0x17a4a4[_0x7acd('0x39')],_0x17a4a4[_0x7acd('0x3a')]);_0x2290cc[_0x7acd('0x3e')]=_['intersection'](_0x17a4a4[_0x7acd('0x39')],qs[_0x7acd('0x3d')](_0x9d74e1[_0x7acd('0x3a')][_0x7acd('0x3d')]));_0x2290cc[_0x7acd('0x3e')]=_0x2290cc['attributes'][_0x7acd('0x4d')]?_0x2290cc['attributes']:_0x17a4a4[_0x7acd('0x39')];if(_0x9d74e1[_0x7acd('0x3a')][_0x7acd('0x46')]){_0x2290cc[_0x7acd('0x47')]=[{'all':!![]}];}_0x2290cc=_[_0x7acd('0x4e')]({},_0x2290cc,_0x9d74e1['options']);return db[_0x7acd('0x36')][_0x7acd('0x4f')](_0x2290cc)[_0x7acd('0x29')](handleEntityNotFound(_0x59335c,null))[_0x7acd('0x29')](respondWithResult(_0x59335c,null))[_0x7acd('0x4a')](handleError(_0x59335c,null));};exports[_0x7acd('0x50')]=function(_0xf7baa2,_0x7f436){return db[_0x7acd('0x36')][_0x7acd('0x50')](_0xf7baa2[_0x7acd('0x51')],{})[_0x7acd('0x29')](function(_0x222694){var _0x3a8748=_0xf7baa2[_0x7acd('0x52')][_0x7acd('0x2a')]({'plain':!![]});if(!_0x3a8748)throw new Error(_0x7acd('0x53'));if(_0x3a8748[_0x7acd('0x54')]==='user'){var _0x5ce16b=_0x222694[_0x7acd('0x2a')]({'plain':!![]});var _0x25ec3e='CustomDashboards';return db[_0x7acd('0x55')][_0x7acd('0x4f')]({'where':{'name':_0x25ec3e,'userProfileId':_0x3a8748[_0x7acd('0x56')]},'raw':!![]})[_0x7acd('0x29')](function(_0x398f03){if(_0x398f03&&_0x398f03['autoAssociation']===0x0){return db['UserProfileResource'][_0x7acd('0x50')]({'name':_0x5ce16b[_0x7acd('0x32')],'resourceId':_0x5ce16b['id'],'type':_0x398f03[_0x7acd('0x32')],'sectionId':_0x398f03['id']},{})[_0x7acd('0x29')](function(){return _0x222694;});}else{return _0x222694;}})[_0x7acd('0x4a')](function(_0x188489){logger[_0x7acd('0x30')](_0x7acd('0x57'),_0x188489);throw _0x188489;});}return _0x222694;})['then'](respondWithResult(_0x7f436,0xc9))[_0x7acd('0x4a')](handleError(_0x7f436,null));};exports[_0x7acd('0x58')]=function(_0x136d3d,_0x46bc42){var _0x2aa3f0={'where':{'id':_0x136d3d[_0x7acd('0x59')]['id']}},_0x1d0fd7={};_0x1d0fd7[_0x7acd('0x39')]=_['keys'](db[_0x7acd('0x36')][_0x7acd('0x4c')]);_0x2aa3f0[_0x7acd('0x3e')]=_['intersection'](_0x1d0fd7[_0x7acd('0x39')],qs[_0x7acd('0x3d')](_0x136d3d[_0x7acd('0x3a')][_0x7acd('0x3d')]));_0x2aa3f0[_0x7acd('0x3e')]=_0x2aa3f0[_0x7acd('0x3e')][_0x7acd('0x4d')]?_0x2aa3f0[_0x7acd('0x3e')]:_0x1d0fd7['model'];if(_0x136d3d[_0x7acd('0x3a')][_0x7acd('0x46')]){_0x2aa3f0[_0x7acd('0x47')]=[{'all':!![]}];}_0x2aa3f0=_[_0x7acd('0x4e')]({},_0x2aa3f0,_0x136d3d[_0x7acd('0x45')]);return db[_0x7acd('0x36')][_0x7acd('0x4f')](_0x2aa3f0)[_0x7acd('0x29')](handleEntityNotFound(_0x46bc42,null))[_0x7acd('0x29')](function(_0x11f1c8){if(_0x11f1c8){var _0x5e13f5=_0x11f1c8['get']({'plain':!![]});_0x5e13f5=qs['omit'](_0x5e13f5,['id',_0x7acd('0x5a'),'updatedAt']);_0x136d3d[_0x7acd('0x51')]=_['omit'](_0x136d3d[_0x7acd('0x51')],['id',_0x7acd('0x5a'),_0x7acd('0x5b')]);return db[_0x7acd('0x36')]['create'](_['merge'](_0x5e13f5,_0x136d3d[_0x7acd('0x51')]),{'include':_0x136d3d[_0x7acd('0x3a')][_0x7acd('0x46')]?[{'all':!![]}]:undefined})[_0x7acd('0x29')](function(_0x79061b){var _0xfd2f4a=_0x136d3d['user']['get']({'plain':!![]});if(!_0xfd2f4a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfd2f4a[_0x7acd('0x54')]==='user'){var _0x466119=_0x79061b['get']({'plain':!![]});var _0x5f399d=_0x7acd('0x2b');return db[_0x7acd('0x55')][_0x7acd('0x4f')]({'where':{'name':_0x5f399d,'userProfileId':_0xfd2f4a['userProfileId']},'raw':!![]})[_0x7acd('0x29')](function(_0x391fef){if(_0x391fef&&_0x391fef['autoAssociation']===0x0){return db[_0x7acd('0x2c')][_0x7acd('0x50')]({'name':_0x466119['name'],'resourceId':_0x466119['id'],'type':_0x391fef[_0x7acd('0x32')],'sectionId':_0x391fef['id']},{})['then'](function(){return _0x79061b;});}else{return _0x79061b;}})[_0x7acd('0x4a')](function(_0x2f6ff4){logger[_0x7acd('0x30')](_0x7acd('0x57'),_0x2f6ff4);throw _0x2f6ff4;});}return _0x79061b;});}})[_0x7acd('0x29')](respondWithResult(_0x46bc42,0xc9))[_0x7acd('0x4a')](handleError(_0x46bc42,null));};exports[_0x7acd('0x28')]=function(_0x5784fa,_0x13d25a){if(_0x5784fa[_0x7acd('0x51')]['id']){delete _0x5784fa['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0x5784fa[_0x7acd('0x59')]['id']}})['then'](handleEntityNotFound(_0x13d25a,null))[_0x7acd('0x29')](saveUpdates(_0x5784fa[_0x7acd('0x51')],null))[_0x7acd('0x29')](respondWithResult(_0x13d25a,null))['catch'](handleError(_0x13d25a,null));};exports[_0x7acd('0x2d')]=function(_0xf95b91,_0x42aceb){return db['Dashboard'][_0x7acd('0x4f')]({'where':{'id':_0xf95b91[_0x7acd('0x59')]['id']}})['then'](handleEntityNotFound(_0x42aceb,null))[_0x7acd('0x29')](removeEntity(_0x42aceb,null))['catch'](handleError(_0x42aceb,null));};function widgetAttributes(_0x25de44){try{switch(_0x25de44[_0x7acd('0x38')]){case _0x7acd('0x5c'):return[{'name':_0x7acd('0x5d'),'value':_0x25de44[_0x7acd('0x5d')]||(_0x25de44['attrs']&&_0x25de44[_0x7acd('0x5e')][0x0]?_0x25de44['attrs'][0x0][_0x7acd('0x5f')]:undefined)||_0x7acd('0x60')}];case _0x7acd('0x61'):return[{'name':'attrPath','value':_0x25de44[_0x7acd('0x62')]||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44[_0x7acd('0x5e')][0x0]?_0x25de44[_0x7acd('0x5e')][0x0]['value']:undefined)||''}];case _0x7acd('0x63'):return[{'name':_0x7acd('0x64'),'value':_0x25de44[_0x7acd('0x64')]||(_0x25de44['attrs']&&_0x25de44[_0x7acd('0x5e')][0x0]?_0x25de44[_0x7acd('0x5e')][0x0]['value']:undefined)||_0x7acd('0x65')},{'name':_0x7acd('0x66'),'value':_0x25de44['attrTimezone']||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44[_0x7acd('0x5e')][0x1]?_0x25de44[_0x7acd('0x5e')][0x1][_0x7acd('0x5f')]:undefined)||_0x7acd('0x67')},{'name':_0x7acd('0x68'),'value':_0x25de44[_0x7acd('0x68')]||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44['attrs'][0x2]?_0x25de44[_0x7acd('0x5e')][0x2][_0x7acd('0x5f')]:undefined)||0xc}];case'counter':return[{'name':_0x7acd('0x69'),'value':_0x25de44['attrMetric']||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44[_0x7acd('0x5e')][0x0]?_0x25de44['attrs'][0x0][_0x7acd('0x5f')]:undefined)||'total'},{'name':_0x7acd('0x6a'),'value':_0x25de44[_0x7acd('0x6a')]||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44[_0x7acd('0x5e')][0x1]?_0x25de44[_0x7acd('0x5e')][0x1][_0x7acd('0x5f')]:undefined)||[]},{'name':_0x7acd('0x68'),'value':_0x25de44['attrFontSize']||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44[_0x7acd('0x5e')][0x2]?_0x25de44[_0x7acd('0x5e')][0x2][_0x7acd('0x5f')]:undefined)||0x14},{'name':_0x7acd('0x6b'),'value':_0x25de44[_0x7acd('0x6b')]||(_0x25de44['attrs']&&_0x25de44[_0x7acd('0x5e')][0x3]?_0x25de44[_0x7acd('0x5e')][0x3][_0x7acd('0x5f')]:undefined)||_0x7acd('0x6c')},{'name':'attrEmailAccounts','value':_0x25de44[_0x7acd('0x6d')]||(_0x25de44['attrs']&&_0x25de44[_0x7acd('0x5e')][0x4]?_0x25de44['attrs'][0x4][_0x7acd('0x5f')]:undefined)||''},{'name':_0x7acd('0x6e'),'value':_0x25de44[_0x7acd('0x6e')]||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44[_0x7acd('0x5e')][0x5]?_0x25de44[_0x7acd('0x5e')][0x5][_0x7acd('0x5f')]:undefined)||''},{'name':_0x7acd('0x6f'),'value':_0x25de44[_0x7acd('0x6f')]||(_0x25de44['attrs']&&_0x25de44[_0x7acd('0x5e')][0x6]?_0x25de44[_0x7acd('0x5e')][0x6][_0x7acd('0x5f')]:undefined)||''},{'name':_0x7acd('0x70'),'value':_0x25de44['attrOpenchannelAccounts']||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44[_0x7acd('0x5e')][0x7]?_0x25de44[_0x7acd('0x5e')][0x7][_0x7acd('0x5f')]:undefined)||''},{'name':_0x7acd('0x71'),'value':_0x25de44[_0x7acd('0x71')]||(_0x25de44['attrs']&&_0x25de44[_0x7acd('0x5e')][0x8]?_0x25de44[_0x7acd('0x5e')][0x8]['value']:undefined)||''},{'name':_0x7acd('0x72'),'value':_0x25de44[_0x7acd('0x72')]||(_0x25de44['attrs']&&_0x25de44[_0x7acd('0x5e')][0x9]?_0x25de44[_0x7acd('0x5e')][0x9][_0x7acd('0x5f')]:undefined)||''}];case _0x7acd('0x73'):case _0x7acd('0x74'):return[{'name':_0x7acd('0x75'),'value':_0x25de44[_0x7acd('0x75')]||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44['attrs'][0x0]?_0x25de44[_0x7acd('0x5e')][0x0]['value']:undefined)||_0x7acd('0x76')},{'name':'attrSerie2','value':_0x25de44[_0x7acd('0x77')]||(_0x25de44['attrs']&&_0x25de44[_0x7acd('0x5e')][0x1]?_0x25de44[_0x7acd('0x5e')][0x1][_0x7acd('0x5f')]:undefined)||null},{'name':_0x7acd('0x78'),'value':_0x25de44[_0x7acd('0x78')]||(_0x25de44['attrs']&&_0x25de44['attrs'][0x2]?_0x25de44[_0x7acd('0x5e')][0x2]['value']:undefined)||null},{'name':_0x7acd('0x6a'),'value':_0x25de44[_0x7acd('0x6a')]||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44['attrs'][0x3]?_0x25de44[_0x7acd('0x5e')][0x3]['value']:undefined)||[]},{'name':_0x7acd('0x6b'),'value':_0x25de44[_0x7acd('0x6b')]||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44[_0x7acd('0x5e')][0x4]?_0x25de44[_0x7acd('0x5e')][0x4][_0x7acd('0x5f')]:undefined)||_0x7acd('0x6c')},{'name':_0x7acd('0x6d'),'value':_0x25de44[_0x7acd('0x6d')]||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44[_0x7acd('0x5e')][0x5]?_0x25de44['attrs'][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x25de44[_0x7acd('0x6e')]||(_0x25de44['attrs']&&_0x25de44['attrs'][0x6]?_0x25de44[_0x7acd('0x5e')][0x6]['value']:undefined)||''},{'name':_0x7acd('0x6f'),'value':_0x25de44['attrSmsAccounts']||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44['attrs'][0x7]?_0x25de44['attrs'][0x7][_0x7acd('0x5f')]:undefined)||''},{'name':_0x7acd('0x70'),'value':_0x25de44['attrOpenchannelAccounts']||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44[_0x7acd('0x5e')][0x8]?_0x25de44['attrs'][0x8]['value']:undefined)||''},{'name':_0x7acd('0x71'),'value':_0x25de44['attrWhatsappAccounts']||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44[_0x7acd('0x5e')][0x9]?_0x25de44['attrs'][0x9]['value']:undefined)||''},{'name':_0x7acd('0x72'),'value':_0x25de44[_0x7acd('0x72')]||(_0x25de44['attrs']&&_0x25de44[_0x7acd('0x5e')][0xa]?_0x25de44['attrs'][0xa][_0x7acd('0x5f')]:undefined)||''}];case _0x7acd('0x79'):return[{'name':'attrReport','type':_0x25de44['reportType']||(_0x25de44['attrs']&&_0x25de44[_0x7acd('0x5e')][0x0]?_0x25de44[_0x7acd('0x5e')][0x0]['type']:undefined)||null,'value':_0x25de44[_0x7acd('0x7a')]||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44[_0x7acd('0x5e')][0x0]?_0x25de44[_0x7acd('0x5e')][0x0][_0x7acd('0x5f')]:undefined)||null},{'name':_0x7acd('0x7b'),'value':_0x25de44[_0x7acd('0x7b')]||(_0x25de44[_0x7acd('0x5e')]&&_0x25de44[_0x7acd('0x5e')][0x1]?_0x25de44[_0x7acd('0x5e')][0x1][_0x7acd('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x562478){logger['error']('widgetAttributes:\x20%s',JSON[_0x7acd('0x7c')](_0x562478));return[];}}exports[_0x7acd('0x7d')]=function(_0x37518f,_0xa2287b,_0x5cc6d1){if(_0x37518f['body']['id']){delete _0x37518f[_0x7acd('0x51')]['id'];}return db['Dashboard'][_0x7acd('0x4f')]({'where':{'id':_0x37518f[_0x7acd('0x59')]['id']}})[_0x7acd('0x29')](handleEntityNotFound(_0xa2287b,null))[_0x7acd('0x29')](function(_0x3a1e6e){if(_0x3a1e6e){_0x37518f[_0x7acd('0x51')][_0x7acd('0x7e')]=_0x3a1e6e['id'];_0x37518f['body'][_0x7acd('0x5e')]=widgetAttributes(_0x37518f[_0x7acd('0x51')]);return db[_0x7acd('0x7f')][_0x7acd('0x50')](_0x37518f[_0x7acd('0x51')]);}})['then'](respondWithResult(_0xa2287b,null))[_0x7acd('0x4a')](handleError(_0xa2287b,null));};exports['getItems']=function(_0x19c8a3,_0x1c52d6,_0x2be468){var _0x45833b={};var _0x2d5eec={};var _0x48e2c5;var _0x1a4f31;return db[_0x7acd('0x36')][_0x7acd('0x80')]({'where':{'id':_0x19c8a3[_0x7acd('0x59')]['id']}})[_0x7acd('0x29')](handleEntityNotFound(_0x1c52d6,null))['then'](function(_0x4371f1){if(_0x4371f1){_0x48e2c5=_0x4371f1;_0x2d5eec[_0x7acd('0x39')]=_['keys'](db['DashboardItem']['rawAttributes']);_0x2d5eec[_0x7acd('0x3a')]=_[_0x7acd('0x3b')](_0x19c8a3[_0x7acd('0x3a')]);_0x2d5eec[_0x7acd('0x3c')]=_[_0x7acd('0x81')](_0x2d5eec[_0x7acd('0x39')],_0x2d5eec['query']);_0x45833b['attributes']=_[_0x7acd('0x81')](_0x2d5eec['model'],qs['fields'](_0x19c8a3['query'][_0x7acd('0x3d')]));_0x45833b['attributes']=_0x45833b[_0x7acd('0x3e')]['length']?_0x45833b[_0x7acd('0x3e')]:_0x2d5eec[_0x7acd('0x39')];_0x45833b[_0x7acd('0x40')]=qs[_0x7acd('0x41')](_0x19c8a3[_0x7acd('0x3a')][_0x7acd('0x41')]);_0x45833b['where']=qs[_0x7acd('0x3c')](_[_0x7acd('0x82')](_0x19c8a3[_0x7acd('0x3a')],_0x2d5eec[_0x7acd('0x3c')]));if(_0x19c8a3[_0x7acd('0x3a')][_0x7acd('0x43')]){_0x45833b[_0x7acd('0x42')]=_['merge'](_0x45833b['where'],{'$or':_[_0x7acd('0x35')](_0x45833b[_0x7acd('0x3e')],function(_0x5b28ee){var _0x56aa5c={};_0x56aa5c[_0x5b28ee]={'$like':'%'+_0x19c8a3[_0x7acd('0x3a')][_0x7acd('0x43')]+'%'};return _0x56aa5c;})});}_0x45833b=_[_0x7acd('0x4e')]({},_0x45833b,_0x19c8a3[_0x7acd('0x45')]);return _0x48e2c5[_0x7acd('0x83')](_0x45833b);}})[_0x7acd('0x29')](function(_0x5c9e99){if(_0x5c9e99){_0x1a4f31=_0x5c9e99[_0x7acd('0x4d')];if(!_0x19c8a3['query']['hasOwnProperty'](_0x7acd('0x3f'))){_0x45833b[_0x7acd('0x21')]=qs['limit'](_0x19c8a3[_0x7acd('0x3a')][_0x7acd('0x21')]);_0x45833b[_0x7acd('0x20')]=qs[_0x7acd('0x20')](_0x19c8a3[_0x7acd('0x3a')][_0x7acd('0x20')]);}return _0x48e2c5[_0x7acd('0x83')](_0x45833b);}})[_0x7acd('0x29')](function(_0x33503d){if(_0x33503d){return _0x33503d?{'count':_0x1a4f31,'rows':_0x33503d}:null;}})[_0x7acd('0x29')](respondWithResult(_0x1c52d6,null))[_0x7acd('0x4a')](handleError(_0x1c52d6,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index ebcc74d..211d494 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 _0xe3f6=['remove','hasOwnProperty','exports','../../mysqldb','save'];(function(_0x306bd2,_0x544397){var _0x16b461=function(_0x5287e5){while(--_0x5287e5){_0x306bd2['push'](_0x306bd2['shift']());}};_0x16b461(++_0x544397);}(_0xe3f6,0x9e));var _0x6e3f=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xe3f6[_0x576170];return _0x397c70;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x6e3f('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6e3f('0x1'),'afterUpdate':'update','afterDestroy':_0x6e3f('0x2')};function emitEvent(_0x1d9a40){return function(_0x2435f3,_0x1bdb6a,_0x46d115){DashboardEvents['emit'](_0x1d9a40+':'+_0x2435f3['id'],_0x2435f3);DashboardEvents['emit'](_0x1d9a40,_0x2435f3);_0x46d115(null);};}for(var e in events){if(events[_0x6e3f('0x3')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x6e3f('0x4')]=DashboardEvents; \ No newline at end of file +var _0x5162=['update','remove','emit','exports','events'];(function(_0xe65119,_0x1c05fc){var _0x4418e3=function(_0x270792){while(--_0x270792){_0xe65119['push'](_0xe65119['shift']());}};_0x4418e3(++_0x1c05fc);}(_0x5162,0x103));var _0x2516=function(_0x3411a4,_0x60d585){_0x3411a4=_0x3411a4-0x0;var _0x4eb325=_0x5162[_0x3411a4];return _0x4eb325;};'use strict';var EventEmitter=require(_0x2516('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2516('0x1'),'afterDestroy':_0x2516('0x2')};function emitEvent(_0x3ce7de){return function(_0x2d0b53,_0x2e48b6,_0x25dce6){DashboardEvents[_0x2516('0x3')](_0x3ce7de+':'+_0x2d0b53['id'],_0x2d0b53);DashboardEvents['emit'](_0x3ce7de,_0x2d0b53);_0x25dce6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x2516('0x4')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 1ec9eb2..0f8605b 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 _0x65b1=['moment','bluebird','request-promise','path','../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards','lodash','util'];(function(_0x22dd2a,_0x3a5355){var _0x109275=function(_0x1b48a7){while(--_0x1b48a7){_0x22dd2a['push'](_0x22dd2a['shift']());}};_0x109275(++_0x3a5355);}(_0x65b1,0xf0));var _0x165b=function(_0x9b73a1,_0x26e043){_0x9b73a1=_0x9b73a1-0x0;var _0x1344e9=_0x65b1[_0x9b73a1];return _0x1344e9;};'use strict';var _=require(_0x165b('0x0'));var util=require(_0x165b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x165b('0x2'));var BPromise=require(_0x165b('0x3'));var rp=require(_0x165b('0x4'));var fs=require('fs');var path=require(_0x165b('0x5'));var rimraf=require('rimraf');var config=require(_0x165b('0x6'));var attributes=require(_0x165b('0x7'));module[_0x165b('0x8')]=function(_0x30c30f,_0x3de677){return _0x30c30f['define'](_0x165b('0x9'),attributes,{'tableName':_0x165b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8583=['request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4bfab7,_0x1f92fc){var _0x232fd7=function(_0x2fb73c){while(--_0x2fb73c){_0x4bfab7['push'](_0x4bfab7['shift']());}};_0x232fd7(++_0x1f92fc);}(_0x8583,0x183));var _0x3858=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8583[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3858('0x0'));var util=require(_0x3858('0x1'));var logger=require(_0x3858('0x2'))('api');var moment=require(_0x3858('0x3'));var BPromise=require(_0x3858('0x4'));var rp=require(_0x3858('0x5'));var fs=require('fs');var path=require(_0x3858('0x6'));var rimraf=require(_0x3858('0x7'));var config=require(_0x3858('0x8'));var attributes=require(_0x3858('0x9'));module[_0x3858('0xa')]=function(_0x2dd673,_0x1796ef){return _0x2dd673[_0x3858('0xb')](_0x3858('0xc'),attributes,{'tableName':_0x3858('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index c2f55e3..fcafee7 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 _0xe4af=['catch','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','register','request','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result'];(function(_0x313429,_0x1d8bfc){var _0x837b88=function(_0x3b0980){while(--_0x3b0980){_0x313429['push'](_0x313429['shift']());}};_0x837b88(++_0x1d8bfc);}(_0xe4af,0xa9));var _0xfe4a=function(_0x33c50d,_0x388fdf){_0x33c50d=_0x33c50d-0x0;var _0x3f52b9=_0xe4af[_0x33c50d];return _0x3f52b9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfe4a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe4a('0x1'))['db'];var utils=require(_0xfe4a('0x2'));var logger=require(_0xfe4a('0x3'))('rpc');var config=require(_0xfe4a('0x4'));var jayson=require(_0xfe4a('0x5'));var client=jayson[_0xfe4a('0x6')][_0xfe4a('0x7')]({'port':0x232a});config['redis']=_[_0xfe4a('0x8')](config[_0xfe4a('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe4a('0x9')]));require('./dashboard.socket')[_0xfe4a('0xa')](socket);function respondWithRpcPromise(_0x4e5436,_0x4aa016,_0x33d26a){return new BPromise(function(_0x419ca2,_0x39c46e){return client[_0xfe4a('0xb')](_0x4e5436,_0x33d26a)[_0xfe4a('0xc')](function(_0x34501c){logger[_0xfe4a('0xd')]('Dashboard,\x20%s,\x20%s',_0x4aa016,_0xfe4a('0xe'));logger[_0xfe4a('0xf')](_0xfe4a('0x10'),_0x4aa016,_0xfe4a('0xe'),JSON[_0xfe4a('0x11')](_0x34501c));if(_0x34501c['error']){if(_0x34501c[_0xfe4a('0x12')][_0xfe4a('0x13')]===0x1f4){logger[_0xfe4a('0x12')](_0xfe4a('0x14'),_0x4aa016,_0x34501c[_0xfe4a('0x12')][_0xfe4a('0x15')]);return _0x39c46e(_0x34501c[_0xfe4a('0x12')][_0xfe4a('0x15')]);}logger[_0xfe4a('0x12')](_0xfe4a('0x14'),_0x4aa016,_0x34501c[_0xfe4a('0x12')][_0xfe4a('0x15')]);return _0x419ca2(_0x34501c[_0xfe4a('0x12')][_0xfe4a('0x15')]);}else{logger[_0xfe4a('0xd')]('Dashboard,\x20%s,\x20%s',_0x4aa016,'request\x20sent');_0x419ca2(_0x34501c[_0xfe4a('0x16')][_0xfe4a('0x15')]);}})[_0xfe4a('0x17')](function(_0x584155){logger[_0xfe4a('0x12')](_0xfe4a('0x14'),_0x4aa016,_0x584155);_0x39c46e(_0x584155);});});} \ No newline at end of file +var _0x0d39=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboard.socket','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error'];(function(_0x46c10c,_0x2fe433){var _0x40d371=function(_0x397721){while(--_0x397721){_0x46c10c['push'](_0x46c10c['shift']());}};_0x40d371(++_0x2fe433);}(_0x0d39,0xef));var _0x90d3=function(_0x5e2a39,_0x2e0a1b){_0x5e2a39=_0x5e2a39-0x0;var _0x5481cc=_0x0d39[_0x5e2a39];return _0x5481cc;};'use strict';var _=require(_0x90d3('0x0'));var util=require(_0x90d3('0x1'));var moment=require(_0x90d3('0x2'));var BPromise=require(_0x90d3('0x3'));var rs=require(_0x90d3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90d3('0x5'))['db'];var utils=require(_0x90d3('0x6'));var logger=require('../../config/logger')(_0x90d3('0x7'));var config=require(_0x90d3('0x8'));var jayson=require(_0x90d3('0x9'));var client=jayson[_0x90d3('0xa')][_0x90d3('0xb')]({'port':0x232a});config[_0x90d3('0xc')]=_[_0x90d3('0xd')](config['redis'],{'host':_0x90d3('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x90d3('0xc')]));require(_0x90d3('0xf'))['register'](socket);function respondWithRpcPromise(_0x264374,_0x29deec,_0x15c0f8){return new BPromise(function(_0x5e1fdf,_0x4554c4){return client['request'](_0x264374,_0x15c0f8)['then'](function(_0x4085ff){logger['info'](_0x90d3('0x10'),_0x29deec,_0x90d3('0x11'));logger[_0x90d3('0x12')](_0x90d3('0x13'),_0x29deec,_0x90d3('0x11'),JSON['stringify'](_0x4085ff));if(_0x4085ff[_0x90d3('0x14')]){if(_0x4085ff[_0x90d3('0x14')][_0x90d3('0x15')]===0x1f4){logger[_0x90d3('0x14')]('Dashboard,\x20%s,\x20%s',_0x29deec,_0x4085ff[_0x90d3('0x14')]['message']);return _0x4554c4(_0x4085ff[_0x90d3('0x14')][_0x90d3('0x16')]);}logger['error'](_0x90d3('0x10'),_0x29deec,_0x4085ff[_0x90d3('0x14')][_0x90d3('0x16')]);return _0x5e1fdf(_0x4085ff[_0x90d3('0x14')][_0x90d3('0x16')]);}else{logger[_0x90d3('0x17')]('Dashboard,\x20%s,\x20%s',_0x29deec,_0x90d3('0x11'));_0x5e1fdf(_0x4085ff[_0x90d3('0x18')][_0x90d3('0x16')]);}})[_0x90d3('0x19')](function(_0x1dabbc){logger[_0x90d3('0x14')](_0x90d3('0x10'),_0x29deec,_0x1dabbc);_0x4554c4(_0x1dabbc);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 829fc79..b1ed7ee 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 _0xf60b=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener','register','length'];(function(_0x248802,_0x3e22e0){var _0x4c947c=function(_0x44fa9b){while(--_0x44fa9b){_0x248802['push'](_0x248802['shift']());}};_0x4c947c(++_0x3e22e0);}(_0xf60b,0x19f));var _0xbf60=function(_0x24679e,_0x22d9d7){_0x24679e=_0x24679e-0x0;var _0x291f21=_0xf60b[_0x24679e];return _0x291f21;};'use strict';var DashboardEvents=require(_0xbf60('0x0'));var events=[_0xbf60('0x1'),_0xbf60('0x2'),_0xbf60('0x3')];function createListener(_0x5c7154,_0x45980b){return function(_0x20416e){_0x45980b[_0xbf60('0x4')](_0x5c7154,_0x20416e);};}function removeListener(_0x4daf8e,_0x366bb3){return function(){DashboardEvents[_0xbf60('0x5')](_0x4daf8e,_0x366bb3);};}exports[_0xbf60('0x6')]=function(_0x25de3d){for(var _0x104136=0x0,_0x1b3622=events[_0xbf60('0x7')];_0x104136<_0x1b3622;_0x104136++){var _0x5c53de=events[_0x104136];var _0x393d5d=createListener(_0xbf60('0x8')+_0x5c53de,_0x25de3d);DashboardEvents['on'](_0x5c53de,_0x393d5d);}}; \ No newline at end of file +var _0xc0af=['register','length','dashboard:','remove','update','emit'];(function(_0x33a7a8,_0x817232){var _0x49b076=function(_0x4e2a69){while(--_0x4e2a69){_0x33a7a8['push'](_0x33a7a8['shift']());}};_0x49b076(++_0x817232);}(_0xc0af,0x135));var _0xfc0a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc0af[_0x2dafbe];return _0x58a45a;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0xfc0a('0x0'),_0xfc0a('0x1')];function createListener(_0x2a0ef6,_0x2718fa){return function(_0x3398c4){_0x2718fa[_0xfc0a('0x2')](_0x2a0ef6,_0x3398c4);};}function removeListener(_0x1cb84d,_0x10a569){return function(){DashboardEvents['removeListener'](_0x1cb84d,_0x10a569);};}exports[_0xfc0a('0x3')]=function(_0x1a40a8){for(var _0x51d0b1=0x0,_0x7a2d65=events[_0xfc0a('0x4')];_0x51d0b1<_0x7a2d65;_0x51d0b1++){var _0x1c25b8=events[_0x51d0b1];var _0x5108a8=createListener(_0xfc0a('0x5')+_0x1c25b8,_0x1a40a8);DashboardEvents['on'](_0x1c25b8,_0x5108a8);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index de9591f..2931012 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 _0xb4b8=['Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','show','/:id/items','getItems','clone','post','put','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x325e78,_0x1b22d4){var _0x3b3186=function(_0x5f4bf9){while(--_0x5f4bf9){_0x325e78['push'](_0x325e78['shift']());}};_0x3b3186(++_0x1b22d4);}(_0xb4b8,0x175));var _0x8b4b=function(_0x491d89,_0x42a116){_0x491d89=_0x491d89-0x0;var _0x9418cb=_0xb4b8[_0x491d89];return _0x9418cb;};'use strict';var multer=require(_0x8b4b('0x0'));var util=require(_0x8b4b('0x1'));var path=require(_0x8b4b('0x2'));var timeout=require(_0x8b4b('0x3'));var express=require(_0x8b4b('0x4'));var router=express[_0x8b4b('0x5')]();var fs_extra=require(_0x8b4b('0x6'));var auth=require(_0x8b4b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8b4b('0x8'));var controller=require(_0x8b4b('0x9'));router[_0x8b4b('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8b4b('0xb'),auth[_0x8b4b('0xc')](),controller[_0x8b4b('0xd')]);router[_0x8b4b('0xa')](_0x8b4b('0xe'),auth['isAuthenticated'](),controller[_0x8b4b('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x8b4b('0x10')]);router[_0x8b4b('0x11')]('/:id/items',auth[_0x8b4b('0xc')](),controller['addItem']);router[_0x8b4b('0x12')](_0x8b4b('0xb'),auth[_0x8b4b('0xc')](),controller['update']);router['delete'](_0x8b4b('0xb'),auth['isAuthenticated'](),controller[_0x8b4b('0x13')]);module[_0x8b4b('0x14')]=router; \ No newline at end of file +var _0xa7d9=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','/:id','update','delete','exports'];(function(_0x4ab80f,_0x5ab227){var _0x4a5699=function(_0x2c6eba){while(--_0x2c6eba){_0x4ab80f['push'](_0x4ab80f['shift']());}};_0x4a5699(++_0x5ab227);}(_0xa7d9,0xfd));var _0x9a7d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa7d9[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x9a7d('0x0'));var util=require('util');var path=require(_0x9a7d('0x1'));var timeout=require(_0x9a7d('0x2'));var express=require('express');var router=express[_0x9a7d('0x3')]();var fs_extra=require(_0x9a7d('0x4'));var auth=require(_0x9a7d('0x5'));var interaction=require(_0x9a7d('0x6'));var config=require(_0x9a7d('0x7'));var controller=require('./dashboard.controller');router[_0x9a7d('0x8')]('/',auth[_0x9a7d('0x9')](),controller['index']);router[_0x9a7d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x9a7d('0xa')]);router[_0x9a7d('0x8')](_0x9a7d('0xb'),auth[_0x9a7d('0x9')](),controller[_0x9a7d('0xc')]);router[_0x9a7d('0xd')]('/',auth[_0x9a7d('0x9')](),controller[_0x9a7d('0xe')]);router[_0x9a7d('0xd')](_0x9a7d('0xf'),auth[_0x9a7d('0x9')](),controller[_0x9a7d('0x10')]);router[_0x9a7d('0xd')](_0x9a7d('0xb'),auth[_0x9a7d('0x9')](),controller[_0x9a7d('0x11')]);router[_0x9a7d('0x12')](_0x9a7d('0x13'),auth[_0x9a7d('0x9')](),controller[_0x9a7d('0x14')]);router[_0x9a7d('0x15')](_0x9a7d('0x13'),auth[_0x9a7d('0x9')](),controller['destroy']);module[_0x9a7d('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index ca11e81..4118cdf 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 _0xe3da=['squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize'];(function(_0x443d70,_0x4ad0a5){var _0x4f06f5=function(_0x5ab282){while(--_0x5ab282){_0x443d70['push'](_0x443d70['shift']());}};_0x4f06f5(++_0x4ad0a5);}(_0xe3da,0x1cd));var _0xae3d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe3da[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xae3d('0x0'));var squel=require(_0xae3d('0x1'));var _=require(_0xae3d('0x2'));module[_0xae3d('0x3')]={'title':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xae3d('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xae3d('0x5')](_0xae3d('0x6')),'get':function(){try{return JSON[_0xae3d('0x7')](this[_0xae3d('0x8')](_0xae3d('0x9')));}catch(_0x26282d){return[];}},'set':function(_0xa9a1a){try{this[_0xae3d('0xa')](_0xae3d('0x9'),JSON[_0xae3d('0xb')](_0xa9a1a));}catch(_0x583b98){this[_0xae3d('0xa')](_0xae3d('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xae3d('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xae3d('0xc')]},'col':{'type':Sequelize[_0xae3d('0xc')]},'background':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':_0xae3d('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xae3d('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xc4aa=['getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x263ad1,_0x4df415){var _0x47237a=function(_0x17ad65){while(--_0x17ad65){_0x263ad1['push'](_0x263ad1['shift']());}};_0x47237a(++_0x4df415);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require(_0xac4a('0x0'));var squel=require(_0xac4a('0x1'));var _=require(_0xac4a('0x2'));module[_0xac4a('0x3')]={'title':{'type':Sequelize[_0xac4a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xac4a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this[_0xac4a('0x5')](_0xac4a('0x6')));}catch(_0x730a38){return[];}},'set':function(_0x215f39){try{this[_0xac4a('0x7')](_0xac4a('0x6'),JSON[_0xac4a('0x8')](_0x215f39));}catch(_0x10525b){this['setDataValue']('attrs',JSON[_0xac4a('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xac4a('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xac4a('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xac4a('0x9')]},'background':{'type':Sequelize[_0xac4a('0x4')],'allowNull':![],'defaultValue':_0xac4a('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xac4a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xac4a('0x9')],'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 5a81a6d..02268d3 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 _0x374c=['fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','params','model','DashboardItem','query','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find','then','catch','destroy','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','zip-dir'];(function(_0x4c6f4e,_0x31e9da){var _0x4cabee=function(_0x54a4ab){while(--_0x54a4ab){_0x4c6f4e['push'](_0x4c6f4e['shift']());}};_0x4cabee(++_0x31e9da);}(_0x374c,0x1e3));var _0xc374=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x374c[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc374('0x0'));var zipdir=require(_0xc374('0x1'));var jsonpatch=require(_0xc374('0x2'));var rp=require(_0xc374('0x3'));var moment=require(_0xc374('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc374('0x5'));var util=require('util');var path=require(_0xc374('0x6'));var sox=require(_0xc374('0x7'));var csv=require('to-csv');var ejs=require(_0xc374('0x8'));var fs=require('fs');var fs_extra=require(_0xc374('0x9'));var _=require(_0xc374('0xa'));var squel=require(_0xc374('0xb'));var crypto=require(_0xc374('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc374('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc374('0xe'));var Redis=require(_0xc374('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc374('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc374('0x11'));var logger=require(_0xc374('0x12'))(_0xc374('0x13'));var utils=require('../../config/utils');var config=require(_0xc374('0x14'));var licenseUtil=require(_0xc374('0x15'));var db=require(_0xc374('0x16'))['db'];config['redis']=_[_0xc374('0x17')](config[_0xc374('0x18')],{'host':_0xc374('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc374('0x18')]));require('./dashboardItem.socket')[_0xc374('0x1a')](socket);function respondWithStatusCode(_0x1f472b,_0x52aee6){_0x52aee6=_0x52aee6||0xcc;return function(_0x1e44f9){if(_0x1e44f9){return _0x1f472b[_0xc374('0x1b')](_0x52aee6);}return _0x1f472b[_0xc374('0x1c')](_0x52aee6)[_0xc374('0x1d')]();};}function respondWithResult(_0x1178a1,_0x115e8a){_0x115e8a=_0x115e8a||0xc8;return function(_0x132aff){if(_0x132aff){return _0x1178a1[_0xc374('0x1c')](_0x115e8a)[_0xc374('0x1e')](_0x132aff);}};}function respondWithFilteredResult(_0x1c3784,_0x221151){return function(_0x5957c5){if(_0x5957c5){var _0x57c828=typeof _0x221151[_0xc374('0x1f')]===_0xc374('0x20')&&typeof _0x221151['limit']===_0xc374('0x20');var _0x16c7de=_0x5957c5['count'];var _0x574b90=_0x57c828?0x0:_0x221151[_0xc374('0x1f')];var _0x3bf099=_0x57c828?_0x5957c5[_0xc374('0x21')]:_0x221151[_0xc374('0x1f')]+_0x221151['limit'];var _0xa65465;if(_0x3bf099>=_0x16c7de){_0x3bf099=_0x16c7de;_0xa65465=0xc8;}else{_0xa65465=0xce;}_0x1c3784[_0xc374('0x1c')](_0xa65465);return _0x1c3784[_0xc374('0x22')](_0xc374('0x23'),_0x574b90+'-'+_0x3bf099+'/'+_0x16c7de)[_0xc374('0x1e')](_0x5957c5);}return null;};}function patchUpdates(_0x33c61d){return function(_0x251fad){try{jsonpatch[_0xc374('0x24')](_0x251fad,_0x33c61d,!![]);}catch(_0x2b7fa6){return BPromise[_0xc374('0x25')](_0x2b7fa6);}return _0x251fad[_0xc374('0x26')]();};}function saveUpdates(_0x5b92c6,_0x389a16){return function(_0x6931d1){if(_0x6931d1){return _0x6931d1[_0xc374('0x27')](_0x5b92c6)['then'](function(_0x460fe1){return _0x460fe1;});}return null;};}function removeEntity(_0x3d4fb3,_0x19c668){return function(_0x11825e){if(_0x11825e){return _0x11825e['destroy']()['then'](function(){_0x3d4fb3['status'](0xcc)[_0xc374('0x1d')]();});}};}function handleEntityNotFound(_0x2e7fad,_0x187007){return function(_0x5530a3){if(!_0x5530a3){_0x2e7fad[_0xc374('0x1b')](0x194);}return _0x5530a3;};}function handleError(_0x55cf8a,_0x13bda5){_0x13bda5=_0x13bda5||0x1f4;return function(_0xbd1d3d){logger[_0xc374('0x28')](_0xbd1d3d[_0xc374('0x29')]);if(_0xbd1d3d[_0xc374('0x2a')]){delete _0xbd1d3d[_0xc374('0x2a')];}_0x55cf8a[_0xc374('0x1c')](_0x13bda5)[_0xc374('0x2b')](_0xbd1d3d);};}exports['show']=function(_0x10a3b2,_0x48aa6f){var _0x10736e={'raw':![],'where':{'id':_0x10a3b2[_0xc374('0x2c')]['id']}},_0x27abe6={};_0x27abe6[_0xc374('0x2d')]=_['keys'](db[_0xc374('0x2e')]['rawAttributes']);_0x27abe6[_0xc374('0x2f')]=_[_0xc374('0x30')](_0x10a3b2[_0xc374('0x2f')]);_0x27abe6[_0xc374('0x31')]=_[_0xc374('0x32')](_0x27abe6[_0xc374('0x2d')],_0x27abe6[_0xc374('0x2f')]);_0x10736e[_0xc374('0x33')]=_[_0xc374('0x32')](_0x27abe6[_0xc374('0x2d')],qs[_0xc374('0x34')](_0x10a3b2[_0xc374('0x2f')]['fields']));_0x10736e[_0xc374('0x33')]=_0x10736e['attributes'][_0xc374('0x35')]?_0x10736e[_0xc374('0x33')]:_0x27abe6[_0xc374('0x2d')];if(_0x10a3b2['query'][_0xc374('0x36')]){_0x10736e[_0xc374('0x37')]=[{'all':!![]}];}_0x10736e=_['merge']({},_0x10736e,_0x10a3b2[_0xc374('0x38')]);return db[_0xc374('0x2e')][_0xc374('0x39')](_0x10736e)[_0xc374('0x3a')](handleEntityNotFound(_0x48aa6f,null))[_0xc374('0x3a')](respondWithResult(_0x48aa6f,null))[_0xc374('0x3b')](handleError(_0x48aa6f,null));};exports[_0xc374('0x3c')]=function(_0x5b1916,_0x5a3dee){return db['DashboardItem'][_0xc374('0x39')]({'where':{'id':_0x5b1916[_0xc374('0x2c')]['id']}})[_0xc374('0x3a')](handleEntityNotFound(_0x5a3dee,null))[_0xc374('0x3a')](removeEntity(_0x5a3dee,null))['catch'](handleError(_0x5a3dee,null));};function widgetAttributes(_0x279d4d){try{switch(_0x279d4d[_0xc374('0x3d')]){case _0xc374('0x3e'):return[{'name':_0xc374('0x3f'),'value':_0x279d4d['attrUrl']||(_0x279d4d['attrs']&&_0x279d4d['attrs'][0x0]?_0x279d4d[_0xc374('0x40')][0x0][_0xc374('0x41')]:undefined)||'https://'}];case _0xc374('0x42'):return[{'name':_0xc374('0x43'),'value':_0x279d4d['attrPath']||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d['attrs'][0x0]?_0x279d4d['attrs'][0x0][_0xc374('0x41')]:undefined)||''}];case _0xc374('0x44'):return[{'name':_0xc374('0x45'),'value':_0x279d4d[_0xc374('0x45')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d['attrs'][0x0]?_0x279d4d[_0xc374('0x40')][0x0][_0xc374('0x41')]:undefined)||_0xc374('0x46')},{'name':_0xc374('0x47'),'value':_0x279d4d[_0xc374('0x47')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d[_0xc374('0x40')][0x1]?_0x279d4d['attrs'][0x1][_0xc374('0x41')]:undefined)||'0.00'},{'name':_0xc374('0x48'),'value':_0x279d4d['attrFontSize']||(_0x279d4d['attrs']&&_0x279d4d[_0xc374('0x40')][0x2]?_0x279d4d[_0xc374('0x40')][0x2][_0xc374('0x41')]:undefined)||0xc}];case'counter':return[{'name':_0xc374('0x49'),'value':_0x279d4d[_0xc374('0x49')]||(_0x279d4d['attrs']&&_0x279d4d[_0xc374('0x40')][0x0]?_0x279d4d[_0xc374('0x40')][0x0][_0xc374('0x41')]:undefined)||_0xc374('0x4a')},{'name':_0xc374('0x4b'),'value':_0x279d4d[_0xc374('0x4b')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d[_0xc374('0x40')][0x1]?_0x279d4d['attrs'][0x1]['value']:undefined)||[]},{'name':_0xc374('0x48'),'value':_0x279d4d[_0xc374('0x48')]||(_0x279d4d['attrs']&&_0x279d4d[_0xc374('0x40')][0x2]?_0x279d4d[_0xc374('0x40')][0x2]['value']:undefined)||0x14},{'name':_0xc374('0x4c'),'value':_0x279d4d[_0xc374('0x4c')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d[_0xc374('0x40')][0x3]?_0x279d4d[_0xc374('0x40')][0x3][_0xc374('0x41')]:undefined)||_0xc374('0x4d')},{'name':_0xc374('0x4e'),'value':_0x279d4d[_0xc374('0x4e')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d['attrs'][0x4]?_0x279d4d[_0xc374('0x40')][0x4]['value']:undefined)||''},{'name':_0xc374('0x4f'),'value':_0x279d4d[_0xc374('0x4f')]||(_0x279d4d['attrs']&&_0x279d4d[_0xc374('0x40')][0x5]?_0x279d4d[_0xc374('0x40')][0x5][_0xc374('0x41')]:undefined)||''},{'name':_0xc374('0x50'),'value':_0x279d4d[_0xc374('0x50')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d[_0xc374('0x40')][0x6]?_0x279d4d[_0xc374('0x40')][0x6][_0xc374('0x41')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x279d4d[_0xc374('0x51')]||(_0x279d4d['attrs']&&_0x279d4d[_0xc374('0x40')][0x7]?_0x279d4d[_0xc374('0x40')][0x7][_0xc374('0x41')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x279d4d[_0xc374('0x52')]||(_0x279d4d['attrs']&&_0x279d4d[_0xc374('0x40')][0x8]?_0x279d4d[_0xc374('0x40')][0x8][_0xc374('0x41')]:undefined)||''},{'name':_0xc374('0x53'),'value':_0x279d4d[_0xc374('0x53')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d['attrs'][0x9]?_0x279d4d[_0xc374('0x40')][0x9]['value']:undefined)||''}];case _0xc374('0x54'):case _0xc374('0x55'):return[{'name':_0xc374('0x56'),'value':_0x279d4d[_0xc374('0x56')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d['attrs'][0x0]?_0x279d4d['attrs'][0x0][_0xc374('0x41')]:undefined)||'total'},{'name':_0xc374('0x57'),'value':_0x279d4d[_0xc374('0x57')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d['attrs'][0x1]?_0x279d4d['attrs'][0x1][_0xc374('0x41')]:undefined)||null},{'name':_0xc374('0x58'),'value':_0x279d4d[_0xc374('0x58')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d[_0xc374('0x40')][0x2]?_0x279d4d[_0xc374('0x40')][0x2][_0xc374('0x41')]:undefined)||null},{'name':_0xc374('0x4b'),'value':_0x279d4d['attrVoiceQueues']||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d[_0xc374('0x40')][0x3]?_0x279d4d[_0xc374('0x40')][0x3][_0xc374('0x41')]:undefined)||[]},{'name':_0xc374('0x4c'),'value':_0x279d4d[_0xc374('0x4c')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d[_0xc374('0x40')][0x4]?_0x279d4d['attrs'][0x4]['value']:undefined)||'voice'},{'name':_0xc374('0x4e'),'value':_0x279d4d[_0xc374('0x4e')]||(_0x279d4d['attrs']&&_0x279d4d[_0xc374('0x40')][0x5]?_0x279d4d[_0xc374('0x40')][0x5][_0xc374('0x41')]:undefined)||''},{'name':_0xc374('0x4f'),'value':_0x279d4d[_0xc374('0x4f')]||(_0x279d4d['attrs']&&_0x279d4d[_0xc374('0x40')][0x6]?_0x279d4d['attrs'][0x6][_0xc374('0x41')]:undefined)||''},{'name':_0xc374('0x50'),'value':_0x279d4d[_0xc374('0x50')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d[_0xc374('0x40')][0x7]?_0x279d4d['attrs'][0x7][_0xc374('0x41')]:undefined)||''},{'name':_0xc374('0x51'),'value':_0x279d4d[_0xc374('0x51')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d[_0xc374('0x40')][0x8]?_0x279d4d['attrs'][0x8][_0xc374('0x41')]:undefined)||''},{'name':_0xc374('0x52'),'value':_0x279d4d[_0xc374('0x52')]||(_0x279d4d['attrs']&&_0x279d4d[_0xc374('0x40')][0x9]?_0x279d4d['attrs'][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x279d4d['attrChatWebsites']||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d[_0xc374('0x40')][0xa]?_0x279d4d[_0xc374('0x40')][0xa]['value']:undefined)||''}];case _0xc374('0x59'):return[{'name':_0xc374('0x5a'),'type':_0x279d4d[_0xc374('0x5b')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d[_0xc374('0x40')][0x0]?_0x279d4d[_0xc374('0x40')][0x0][_0xc374('0x3d')]:undefined)||null,'value':_0x279d4d[_0xc374('0x5a')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d['attrs'][0x0]?_0x279d4d[_0xc374('0x40')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x279d4d[_0xc374('0x5c')]||(_0x279d4d[_0xc374('0x40')]&&_0x279d4d[_0xc374('0x40')][0x1]?_0x279d4d['attrs'][0x1][_0xc374('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x5e6f0c){logger[_0xc374('0x28')](_0xc374('0x5d'),JSON[_0xc374('0x5e')](_0x5e6f0c));return[];}}exports[_0xc374('0x5f')]=function(_0x5dd747,_0x482a1b){if(_0x5dd747[_0xc374('0x60')]){_0x5dd747['body'][_0xc374('0x40')]=widgetAttributes(_0x5dd747[_0xc374('0x60')]);}return db[_0xc374('0x2e')]['create'](_0x5dd747[_0xc374('0x60')],{})[_0xc374('0x3a')](respondWithResult(_0x482a1b,0xc9))[_0xc374('0x3b')](handleError(_0x482a1b,null));};exports[_0xc374('0x27')]=function(_0x3701f3,_0x725fa4){if(_0x3701f3['body']['id']){delete _0x3701f3[_0xc374('0x60')]['id'];}_0x3701f3[_0xc374('0x60')][_0xc374('0x40')]=widgetAttributes(_0x3701f3['body']);return db[_0xc374('0x2e')][_0xc374('0x39')]({'where':{'id':_0x3701f3[_0xc374('0x2c')]['id']}})[_0xc374('0x3a')](handleEntityNotFound(_0x725fa4,null))[_0xc374('0x3a')](saveUpdates(_0x3701f3[_0xc374('0x60')],null))['then'](respondWithResult(_0x725fa4,null))[_0xc374('0x3b')](handleError(_0x725fa4,null));}; \ No newline at end of file +var _0x40f3=['keys','rawAttributes','query','filters','intersection','model','fields','length','attributes','includeAll','merge','options','DashboardItem','find','catch','destroy','attrUrl','attrs','value','attrPath','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrWhatsappAccounts','attrSerie1','attrSerie3','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','body','create','update','rimraf','zip-dir','request-promise','moment','util','path','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','./dashboardItem.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','end','error','name','send','show','params'];(function(_0x1f1c40,_0x3122d8){var _0x50ae90=function(_0x50b309){while(--_0x50b309){_0x1f1c40['push'](_0x1f1c40['shift']());}};_0x50ae90(++_0x3122d8);}(_0x40f3,0x8b));var _0x340f=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x40f3[_0x648163];return _0x199d4d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x340f('0x0'));var zipdir=require(_0x340f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x340f('0x2'));var moment=require(_0x340f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x340f('0x4'));var path=require(_0x340f('0x5'));var sox=require('sox');var csv=require(_0x340f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x340f('0x7'));var squel=require(_0x340f('0x8'));var crypto=require(_0x340f('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x340f('0x6'));var querystring=require(_0x340f('0xa'));var Papa=require(_0x340f('0xb'));var Redis=require(_0x340f('0xc'));var authService=require(_0x340f('0xd'));var qs=require(_0x340f('0xe'));var as=require(_0x340f('0xf'));var hardwareService=require(_0x340f('0x10'));var logger=require(_0x340f('0x11'))(_0x340f('0x12'));var utils=require(_0x340f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x340f('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x340f('0x15')](config[_0x340f('0x16')],{'host':_0x340f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x340f('0x16')]));require(_0x340f('0x18'))[_0x340f('0x19')](socket);function respondWithStatusCode(_0x20beeb,_0x58e42f){_0x58e42f=_0x58e42f||0xcc;return function(_0x2fb52a){if(_0x2fb52a){return _0x20beeb[_0x340f('0x1a')](_0x58e42f);}return _0x20beeb[_0x340f('0x1b')](_0x58e42f)['end']();};}function respondWithResult(_0x14d631,_0x230101){_0x230101=_0x230101||0xc8;return function(_0x490ae6){if(_0x490ae6){return _0x14d631[_0x340f('0x1b')](_0x230101)[_0x340f('0x1c')](_0x490ae6);}};}function respondWithFilteredResult(_0x5c36ea,_0x2faf3c){return function(_0x55714f){if(_0x55714f){var _0x4fa470=typeof _0x2faf3c[_0x340f('0x1d')]==='undefined'&&typeof _0x2faf3c[_0x340f('0x1e')]===_0x340f('0x1f');var _0x3dede2=_0x55714f[_0x340f('0x20')];var _0x550762=_0x4fa470?0x0:_0x2faf3c['offset'];var _0x205fe2=_0x4fa470?_0x55714f[_0x340f('0x20')]:_0x2faf3c[_0x340f('0x1d')]+_0x2faf3c[_0x340f('0x1e')];var _0xe85ff2;if(_0x205fe2>=_0x3dede2){_0x205fe2=_0x3dede2;_0xe85ff2=0xc8;}else{_0xe85ff2=0xce;}_0x5c36ea[_0x340f('0x1b')](_0xe85ff2);return _0x5c36ea[_0x340f('0x21')](_0x340f('0x22'),_0x550762+'-'+_0x205fe2+'/'+_0x3dede2)[_0x340f('0x1c')](_0x55714f);}return null;};}function patchUpdates(_0x36a845){return function(_0x553287){try{jsonpatch[_0x340f('0x23')](_0x553287,_0x36a845,!![]);}catch(_0x3f0c03){return BPromise[_0x340f('0x24')](_0x3f0c03);}return _0x553287[_0x340f('0x25')]();};}function saveUpdates(_0x4acba5,_0x1d9d42){return function(_0x59db07){if(_0x59db07){return _0x59db07['update'](_0x4acba5)[_0x340f('0x26')](function(_0x3aee9c){return _0x3aee9c;});}return null;};}function removeEntity(_0x5c0034,_0x805a20){return function(_0xc809c1){if(_0xc809c1){return _0xc809c1['destroy']()[_0x340f('0x26')](function(){_0x5c0034[_0x340f('0x1b')](0xcc)[_0x340f('0x27')]();});}};}function handleEntityNotFound(_0x1524c4,_0x4cb37e){return function(_0x1607ee){if(!_0x1607ee){_0x1524c4[_0x340f('0x1a')](0x194);}return _0x1607ee;};}function handleError(_0x7f6d6b,_0x481685){_0x481685=_0x481685||0x1f4;return function(_0x5f2e3f){logger[_0x340f('0x28')](_0x5f2e3f['stack']);if(_0x5f2e3f[_0x340f('0x29')]){delete _0x5f2e3f[_0x340f('0x29')];}_0x7f6d6b['status'](_0x481685)[_0x340f('0x2a')](_0x5f2e3f);};}exports[_0x340f('0x2b')]=function(_0x14725d,_0x29e1e4){var _0x6c1492={'raw':![],'where':{'id':_0x14725d[_0x340f('0x2c')]['id']}},_0x314397={};_0x314397['model']=_[_0x340f('0x2d')](db['DashboardItem'][_0x340f('0x2e')]);_0x314397[_0x340f('0x2f')]=_['keys'](_0x14725d[_0x340f('0x2f')]);_0x314397[_0x340f('0x30')]=_[_0x340f('0x31')](_0x314397[_0x340f('0x32')],_0x314397[_0x340f('0x2f')]);_0x6c1492['attributes']=_[_0x340f('0x31')](_0x314397['model'],qs[_0x340f('0x33')](_0x14725d[_0x340f('0x2f')][_0x340f('0x33')]));_0x6c1492['attributes']=_0x6c1492['attributes'][_0x340f('0x34')]?_0x6c1492[_0x340f('0x35')]:_0x314397[_0x340f('0x32')];if(_0x14725d[_0x340f('0x2f')][_0x340f('0x36')]){_0x6c1492['include']=[{'all':!![]}];}_0x6c1492=_[_0x340f('0x37')]({},_0x6c1492,_0x14725d[_0x340f('0x38')]);return db[_0x340f('0x39')][_0x340f('0x3a')](_0x6c1492)[_0x340f('0x26')](handleEntityNotFound(_0x29e1e4,null))[_0x340f('0x26')](respondWithResult(_0x29e1e4,null))[_0x340f('0x3b')](handleError(_0x29e1e4,null));};exports[_0x340f('0x3c')]=function(_0x39ecdd,_0x457eb4){return db['DashboardItem'][_0x340f('0x3a')]({'where':{'id':_0x39ecdd[_0x340f('0x2c')]['id']}})[_0x340f('0x26')](handleEntityNotFound(_0x457eb4,null))[_0x340f('0x26')](removeEntity(_0x457eb4,null))[_0x340f('0x3b')](handleError(_0x457eb4,null));};function widgetAttributes(_0x61ee89){try{switch(_0x61ee89['type']){case'iframe':return[{'name':'attrUrl','value':_0x61ee89[_0x340f('0x3d')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x0]?_0x61ee89[_0x340f('0x3e')][0x0][_0x340f('0x3f')]:undefined)||'https://'}];case'custom':return[{'name':_0x340f('0x40'),'value':_0x61ee89[_0x340f('0x40')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x0]?_0x61ee89[_0x340f('0x3e')][0x0][_0x340f('0x3f')]:undefined)||''}];case _0x340f('0x41'):return[{'name':'attrHourFormat','value':_0x61ee89['attrHourFormat']||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x0]?_0x61ee89['attrs'][0x0][_0x340f('0x3f')]:undefined)||_0x340f('0x42')},{'name':_0x340f('0x43'),'value':_0x61ee89[_0x340f('0x43')]||(_0x61ee89['attrs']&&_0x61ee89[_0x340f('0x3e')][0x1]?_0x61ee89[_0x340f('0x3e')][0x1][_0x340f('0x3f')]:undefined)||_0x340f('0x44')},{'name':_0x340f('0x45'),'value':_0x61ee89[_0x340f('0x45')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x2]?_0x61ee89[_0x340f('0x3e')][0x2][_0x340f('0x3f')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x61ee89[_0x340f('0x46')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x0]?_0x61ee89[_0x340f('0x3e')][0x0][_0x340f('0x3f')]:undefined)||_0x340f('0x47')},{'name':'attrVoiceQueues','value':_0x61ee89[_0x340f('0x48')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89['attrs'][0x1]?_0x61ee89[_0x340f('0x3e')][0x1][_0x340f('0x3f')]:undefined)||[]},{'name':_0x340f('0x45'),'value':_0x61ee89[_0x340f('0x45')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x2]?_0x61ee89[_0x340f('0x3e')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x61ee89[_0x340f('0x49')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x3]?_0x61ee89[_0x340f('0x3e')][0x3][_0x340f('0x3f')]:undefined)||_0x340f('0x4a')},{'name':'attrEmailAccounts','value':_0x61ee89[_0x340f('0x4b')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x4]?_0x61ee89['attrs'][0x4][_0x340f('0x3f')]:undefined)||''},{'name':_0x340f('0x4c'),'value':_0x61ee89[_0x340f('0x4c')]||(_0x61ee89['attrs']&&_0x61ee89[_0x340f('0x3e')][0x5]?_0x61ee89[_0x340f('0x3e')][0x5][_0x340f('0x3f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x61ee89['attrSmsAccounts']||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x6]?_0x61ee89[_0x340f('0x3e')][0x6][_0x340f('0x3f')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x61ee89['attrOpenchannelAccounts']||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x7]?_0x61ee89[_0x340f('0x3e')][0x7][_0x340f('0x3f')]:undefined)||''},{'name':_0x340f('0x4d'),'value':_0x61ee89[_0x340f('0x4d')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x8]?_0x61ee89[_0x340f('0x3e')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x61ee89['attrChatWebsites']||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89['attrs'][0x9]?_0x61ee89[_0x340f('0x3e')][0x9][_0x340f('0x3f')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0x61ee89[_0x340f('0x4e')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x0]?_0x61ee89[_0x340f('0x3e')][0x0]['value']:undefined)||'total'},{'name':'attrSerie2','value':_0x61ee89['attrSerie2']||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x1]?_0x61ee89[_0x340f('0x3e')][0x1][_0x340f('0x3f')]:undefined)||null},{'name':_0x340f('0x4f'),'value':_0x61ee89[_0x340f('0x4f')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x2]?_0x61ee89[_0x340f('0x3e')][0x2][_0x340f('0x3f')]:undefined)||null},{'name':_0x340f('0x48'),'value':_0x61ee89[_0x340f('0x48')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x3]?_0x61ee89['attrs'][0x3][_0x340f('0x3f')]:undefined)||[]},{'name':_0x340f('0x49'),'value':_0x61ee89[_0x340f('0x49')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x4]?_0x61ee89[_0x340f('0x3e')][0x4][_0x340f('0x3f')]:undefined)||_0x340f('0x4a')},{'name':_0x340f('0x4b'),'value':_0x61ee89[_0x340f('0x4b')]||(_0x61ee89['attrs']&&_0x61ee89[_0x340f('0x3e')][0x5]?_0x61ee89[_0x340f('0x3e')][0x5][_0x340f('0x3f')]:undefined)||''},{'name':_0x340f('0x4c'),'value':_0x61ee89[_0x340f('0x4c')]||(_0x61ee89['attrs']&&_0x61ee89[_0x340f('0x3e')][0x6]?_0x61ee89[_0x340f('0x3e')][0x6][_0x340f('0x3f')]:undefined)||''},{'name':_0x340f('0x50'),'value':_0x61ee89[_0x340f('0x50')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x7]?_0x61ee89[_0x340f('0x3e')][0x7][_0x340f('0x3f')]:undefined)||''},{'name':_0x340f('0x51'),'value':_0x61ee89[_0x340f('0x51')]||(_0x61ee89['attrs']&&_0x61ee89[_0x340f('0x3e')][0x8]?_0x61ee89[_0x340f('0x3e')][0x8][_0x340f('0x3f')]:undefined)||''},{'name':_0x340f('0x4d'),'value':_0x61ee89[_0x340f('0x4d')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x9]?_0x61ee89[_0x340f('0x3e')][0x9]['value']:undefined)||''},{'name':_0x340f('0x52'),'value':_0x61ee89[_0x340f('0x52')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89['attrs'][0xa]?_0x61ee89['attrs'][0xa][_0x340f('0x3f')]:undefined)||''}];case _0x340f('0x53'):return[{'name':_0x340f('0x54'),'type':_0x61ee89[_0x340f('0x55')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89['attrs'][0x0]?_0x61ee89[_0x340f('0x3e')][0x0][_0x340f('0x56')]:undefined)||null,'value':_0x61ee89[_0x340f('0x54')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x0]?_0x61ee89[_0x340f('0x3e')][0x0][_0x340f('0x3f')]:undefined)||null},{'name':_0x340f('0x57'),'value':_0x61ee89[_0x340f('0x57')]||(_0x61ee89[_0x340f('0x3e')]&&_0x61ee89[_0x340f('0x3e')][0x1]?_0x61ee89['attrs'][0x1][_0x340f('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x1697ab){logger['error'](_0x340f('0x58'),JSON['stringify'](_0x1697ab));return[];}}exports['create']=function(_0xad0d8f,_0x27433e){if(_0xad0d8f[_0x340f('0x59')]){_0xad0d8f['body']['attrs']=widgetAttributes(_0xad0d8f[_0x340f('0x59')]);}return db[_0x340f('0x39')][_0x340f('0x5a')](_0xad0d8f[_0x340f('0x59')],{})[_0x340f('0x26')](respondWithResult(_0x27433e,0xc9))[_0x340f('0x3b')](handleError(_0x27433e,null));};exports[_0x340f('0x5b')]=function(_0xabc355,_0x2562c6){if(_0xabc355['body']['id']){delete _0xabc355['body']['id'];}_0xabc355[_0x340f('0x59')][_0x340f('0x3e')]=widgetAttributes(_0xabc355[_0x340f('0x59')]);return db[_0x340f('0x39')][_0x340f('0x3a')]({'where':{'id':_0xabc355[_0x340f('0x2c')]['id']}})[_0x340f('0x26')](handleEntityNotFound(_0x2562c6,null))['then'](saveUpdates(_0xabc355['body'],null))[_0x340f('0x26')](respondWithResult(_0x2562c6,null))[_0x340f('0x3b')](handleError(_0x2562c6,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 37f7741..9927ce6 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 _0xae24=['update','remove','emit','hasOwnProperty','hook','exports','DashboardItem','setMaxListeners','save'];(function(_0x4de5bc,_0x50fa9f){var _0x1d498c=function(_0x2dff1b){while(--_0x2dff1b){_0x4de5bc['push'](_0x4de5bc['shift']());}};_0x1d498c(++_0x50fa9f);}(_0xae24,0x180));var _0x4ae2=function(_0x3cb0ee,_0x5e484c){_0x3cb0ee=_0x3cb0ee-0x0;var _0x9afc9d=_0xae24[_0x3cb0ee];return _0x9afc9d;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0x4ae2('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x4ae2('0x1')](0x0);var events={'afterCreate':_0x4ae2('0x2'),'afterUpdate':_0x4ae2('0x3'),'afterDestroy':_0x4ae2('0x4')};function emitEvent(_0x239088){return function(_0x3987a2,_0x53713e,_0x1d88d0){DashboardItemEvents[_0x4ae2('0x5')](_0x239088+':'+_0x3987a2['id'],_0x3987a2);DashboardItemEvents['emit'](_0x239088,_0x3987a2);_0x1d88d0(null);};}for(var e in events){if(events[_0x4ae2('0x6')](e)){var event=events[e];DashboardItem[_0x4ae2('0x7')](e,emitEvent(event));}}module[_0x4ae2('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x86a3=['setMaxListeners','save','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xf2b0da,_0xc1b1d2){var _0x1ddc87=function(_0x320f6c){while(--_0x320f6c){_0xf2b0da['push'](_0xf2b0da['shift']());}};_0x1ddc87(++_0xc1b1d2);}(_0x86a3,0xf6));var _0x386a=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0x86a3[_0x4f2c3a];return _0x17d91c;};'use strict';var EventEmitter=require(_0x386a('0x0'));var DashboardItem=require(_0x386a('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x386a('0x2')](0x0);var events={'afterCreate':_0x386a('0x3'),'afterUpdate':'update','afterDestroy':_0x386a('0x4')};function emitEvent(_0x524b48){return function(_0x3b6ac3,_0x44ccb9,_0x5ccbc9){DashboardItemEvents['emit'](_0x524b48+':'+_0x3b6ac3['id'],_0x3b6ac3);DashboardItemEvents['emit'](_0x524b48,_0x3b6ac3);_0x5ccbc9(null);};}for(var e in events){if(events[_0x386a('0x5')](e)){var event=events[e];DashboardItem[_0x386a('0x6')](e,emitEvent(event));}}module[_0x386a('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 7f0a35f..3774e0b 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 _0x0c84=['rimraf','../../config/environment','exports','define','DashboardItem','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x358f9e,_0x3a1172){var _0x52d274=function(_0x5e0de0){while(--_0x5e0de0){_0x358f9e['push'](_0x358f9e['shift']());}};_0x52d274(++_0x3a1172);}(_0x0c84,0xad));var _0x40c8=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x0c84[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x40c8('0x0'));var util=require(_0x40c8('0x1'));var logger=require(_0x40c8('0x2'))(_0x40c8('0x3'));var moment=require('moment');var BPromise=require(_0x40c8('0x4'));var rp=require(_0x40c8('0x5'));var fs=require('fs');var path=require(_0x40c8('0x6'));var rimraf=require(_0x40c8('0x7'));var config=require(_0x40c8('0x8'));var attributes=require('./dashboardItem.attributes');module[_0x40c8('0x9')]=function(_0x2ad3ab,_0x227b53){return _0x2ad3ab[_0x40c8('0xa')](_0x40c8('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf839=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','DashboardItem','dashboard_items','lodash','util'];(function(_0x2825ae,_0x47550e){var _0x4601fe=function(_0x5c2346){while(--_0x5c2346){_0x2825ae['push'](_0x2825ae['shift']());}};_0x4601fe(++_0x47550e);}(_0xf839,0x9a));var _0x9f83=function(_0x5acb34,_0x592140){_0x5acb34=_0x5acb34-0x0;var _0x5f16d3=_0xf839[_0x5acb34];return _0x5f16d3;};'use strict';var _=require(_0x9f83('0x0'));var util=require(_0x9f83('0x1'));var logger=require(_0x9f83('0x2'))(_0x9f83('0x3'));var moment=require('moment');var BPromise=require(_0x9f83('0x4'));var rp=require(_0x9f83('0x5'));var fs=require('fs');var path=require(_0x9f83('0x6'));var rimraf=require(_0x9f83('0x7'));var config=require(_0x9f83('0x8'));var attributes=require(_0x9f83('0x9'));module['exports']=function(_0x2dd287,_0x3c9c2d){return _0x2dd287['define'](_0x9f83('0xa'),attributes,{'tableName':_0x9f83('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 5e5153e..ec9e154 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 _0xa69c=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x849e84,_0x4f452e){var _0x495e83=function(_0x490773){while(--_0x490773){_0x849e84['push'](_0x849e84['shift']());}};_0x495e83(++_0x4f452e);}(_0xa69c,0x1d6));var _0xca69=function(_0x21ecc8,_0x2bdead){_0x21ecc8=_0x21ecc8-0x0;var _0x510c1d=_0xa69c[_0x21ecc8];return _0x510c1d;};'use strict';var _=require('lodash');var util=require(_0xca69('0x0'));var moment=require(_0xca69('0x1'));var BPromise=require(_0xca69('0x2'));var rs=require(_0xca69('0x3'));var fs=require('fs');var Redis=require(_0xca69('0x4'));var db=require(_0xca69('0x5'))['db'];var utils=require(_0xca69('0x6'));var logger=require(_0xca69('0x7'))(_0xca69('0x8'));var config=require('../../config/environment');var jayson=require(_0xca69('0x9'));var client=jayson[_0xca69('0xa')][_0xca69('0xb')]({'port':0x232a});config[_0xca69('0xc')]=_['defaults'](config[_0xca69('0xc')],{'host':_0xca69('0xd'),'port':0x18eb});var socket=require(_0xca69('0xe'))(new Redis(config[_0xca69('0xc')]));require(_0xca69('0xf'))[_0xca69('0x10')](socket);function respondWithRpcPromise(_0x402d5a,_0x27e20d,_0x48262a){return new BPromise(function(_0x16c021,_0x2a81fa){return client[_0xca69('0x11')](_0x402d5a,_0x48262a)[_0xca69('0x12')](function(_0x4227f9){logger['info'](_0xca69('0x13'),_0x27e20d,_0xca69('0x14'));logger[_0xca69('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x27e20d,_0xca69('0x14'),JSON[_0xca69('0x16')](_0x4227f9));if(_0x4227f9[_0xca69('0x17')]){if(_0x4227f9['error'][_0xca69('0x18')]===0x1f4){logger['error'](_0xca69('0x13'),_0x27e20d,_0x4227f9[_0xca69('0x17')]['message']);return _0x2a81fa(_0x4227f9['error']['message']);}logger[_0xca69('0x17')](_0xca69('0x13'),_0x27e20d,_0x4227f9['error'][_0xca69('0x19')]);return _0x16c021(_0x4227f9[_0xca69('0x17')][_0xca69('0x19')]);}else{logger[_0xca69('0x1a')](_0xca69('0x13'),_0x27e20d,_0xca69('0x14'));_0x16c021(_0x4227f9[_0xca69('0x1b')][_0xca69('0x19')]);}})['catch'](function(_0x3fdd9d){logger[_0xca69('0x17')](_0xca69('0x13'),_0x27e20d,_0x3fdd9d);_0x2a81fa(_0x3fdd9d);});});} \ No newline at end of file +var _0x53f0=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./dashboardItem.socket','request','then','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x173db6,_0x27e5cc){var _0x28fb13=function(_0x2e7ede){while(--_0x2e7ede){_0x173db6['push'](_0x173db6['shift']());}};_0x28fb13(++_0x27e5cc);}(_0x53f0,0x9b));var _0x053f=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x53f0[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require(_0x053f('0x0'));var moment=require(_0x053f('0x1'));var BPromise=require(_0x053f('0x2'));var rs=require(_0x053f('0x3'));var fs=require('fs');var Redis=require(_0x053f('0x4'));var db=require(_0x053f('0x5'))['db'];var utils=require(_0x053f('0x6'));var logger=require(_0x053f('0x7'))(_0x053f('0x8'));var config=require(_0x053f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x053f('0xa')][_0x053f('0xb')]({'port':0x232a});config[_0x053f('0xc')]=_[_0x053f('0xd')](config[_0x053f('0xc')],{'host':_0x053f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x053f('0xc')]));require(_0x053f('0xf'))['register'](socket);function respondWithRpcPromise(_0xb48e26,_0x50b061,_0x2f3ae5){return new BPromise(function(_0x539eb9,_0x13c32c){return client[_0x053f('0x10')](_0xb48e26,_0x2f3ae5)[_0x053f('0x11')](function(_0x25ebd5){logger['info'](_0x053f('0x12'),_0x50b061,'request\x20sent');logger['debug'](_0x053f('0x13'),_0x50b061,'request\x20sent',JSON[_0x053f('0x14')](_0x25ebd5));if(_0x25ebd5[_0x053f('0x15')]){if(_0x25ebd5[_0x053f('0x15')][_0x053f('0x16')]===0x1f4){logger[_0x053f('0x15')](_0x053f('0x12'),_0x50b061,_0x25ebd5[_0x053f('0x15')][_0x053f('0x17')]);return _0x13c32c(_0x25ebd5[_0x053f('0x15')][_0x053f('0x17')]);}logger['error'](_0x053f('0x12'),_0x50b061,_0x25ebd5[_0x053f('0x15')][_0x053f('0x17')]);return _0x539eb9(_0x25ebd5['error'][_0x053f('0x17')]);}else{logger[_0x053f('0x18')](_0x053f('0x12'),_0x50b061,'request\x20sent');_0x539eb9(_0x25ebd5[_0x053f('0x19')][_0x053f('0x17')]);}})[_0x053f('0x1a')](function(_0x4aa3c3){logger['error'](_0x053f('0x12'),_0x50b061,_0x4aa3c3);_0x13c32c(_0x4aa3c3);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 0f81357..38bcd2d 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 _0x2bff=['dashboardItem:','./dashboardItem.events','save','update','emit','removeListener','register','length'];(function(_0x1381c3,_0x51ce78){var _0xbf2638=function(_0x2607b5){while(--_0x2607b5){_0x1381c3['push'](_0x1381c3['shift']());}};_0xbf2638(++_0x51ce78);}(_0x2bff,0xe1));var _0xf2bf=function(_0x19790a,_0x5c73a5){_0x19790a=_0x19790a-0x0;var _0x47d41a=_0x2bff[_0x19790a];return _0x47d41a;};'use strict';var DashboardItemEvents=require(_0xf2bf('0x0'));var events=[_0xf2bf('0x1'),'remove',_0xf2bf('0x2')];function createListener(_0x53148e,_0x3d633e){return function(_0x17aee5){_0x3d633e[_0xf2bf('0x3')](_0x53148e,_0x17aee5);};}function removeListener(_0x723c23,_0x368947){return function(){DashboardItemEvents[_0xf2bf('0x4')](_0x723c23,_0x368947);};}exports[_0xf2bf('0x5')]=function(_0x3b1c28){for(var _0x4fcb88=0x0,_0x547251=events[_0xf2bf('0x6')];_0x4fcb88<_0x547251;_0x4fcb88++){var _0x4ea37d=events[_0x4fcb88];var _0x396c55=createListener(_0xf2bf('0x7')+_0x4ea37d,_0x3b1c28);DashboardItemEvents['on'](_0x4ea37d,_0x396c55);}}; \ No newline at end of file +var _0x6595=['dashboardItem:','./dashboardItem.events','remove','update','emit','removeListener','register','length'];(function(_0x2b12a8,_0x52f321){var _0xd38ecc=function(_0x185d87){while(--_0x185d87){_0x2b12a8['push'](_0x2b12a8['shift']());}};_0xd38ecc(++_0x52f321);}(_0x6595,0xb1));var _0x5659=function(_0x1172dd,_0x1f7a9f){_0x1172dd=_0x1172dd-0x0;var _0x35ad7=_0x6595[_0x1172dd];return _0x35ad7;};'use strict';var DashboardItemEvents=require(_0x5659('0x0'));var events=['save',_0x5659('0x1'),_0x5659('0x2')];function createListener(_0x3ad148,_0x34b2fc){return function(_0x2ac677){_0x34b2fc[_0x5659('0x3')](_0x3ad148,_0x2ac677);};}function removeListener(_0x4d2ded,_0x34b91b){return function(){DashboardItemEvents[_0x5659('0x4')](_0x4d2ded,_0x34b91b);};}exports[_0x5659('0x5')]=function(_0x2616ec){for(var _0x35d2b3=0x0,_0x51189c=events[_0x5659('0x6')];_0x35d2b3<_0x51189c;_0x35d2b3++){var _0x2a7359=events[_0x35d2b3];var _0x4e0139=createListener(_0x5659('0x7')+_0x2a7359,_0x2616ec);DashboardItemEvents['on'](_0x2a7359,_0x4e0139);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 2da1243..dfffe35 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 _0x359d=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','isAuthenticated','put','update','destroy','exports','util','connect-timeout'];(function(_0x3d7328,_0x350166){var _0x25ef86=function(_0x4e6200){while(--_0x4e6200){_0x3d7328['push'](_0x3d7328['shift']());}};_0x25ef86(++_0x350166);}(_0x359d,0x10e));var _0xd359=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0x359d[_0x2af29a];return _0x5ef02f;};'use strict';var multer=require('multer');var util=require(_0xd359('0x0'));var path=require('path');var timeout=require(_0xd359('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd359('0x2'));var auth=require(_0xd359('0x3'));var interaction=require(_0xd359('0x4'));var config=require(_0xd359('0x5'));var controller=require(_0xd359('0x6'));router[_0xd359('0x7')](_0xd359('0x8'),auth['isAuthenticated'](),controller[_0xd359('0x9')]);router[_0xd359('0xa')]('/',auth[_0xd359('0xb')](),controller['create']);router[_0xd359('0xc')]('/:id',auth[_0xd359('0xb')](),controller[_0xd359('0xd')]);router['delete'](_0xd359('0x8'),auth[_0xd359('0xb')](),controller[_0xd359('0xe')]);module[_0xd359('0xf')]=router; \ No newline at end of file +var _0xa4ee=['isAuthenticated','put','update','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0xa4ee,0x144));var _0xea4e=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0xa4ee[_0x25662e];return _0x59b7bc;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xea4e('0x0'));var express=require(_0xea4e('0x1'));var router=express[_0xea4e('0x2')]();var fs_extra=require(_0xea4e('0x3'));var auth=require(_0xea4e('0x4'));var interaction=require(_0xea4e('0x5'));var config=require(_0xea4e('0x6'));var controller=require(_0xea4e('0x7'));router[_0xea4e('0x8')](_0xea4e('0x9'),auth['isAuthenticated'](),controller[_0xea4e('0xa')]);router[_0xea4e('0xb')]('/',auth[_0xea4e('0xc')](),controller['create']);router[_0xea4e('0xd')](_0xea4e('0x9'),auth[_0xea4e('0xc')](),controller[_0xea4e('0xe')]);router['delete'](_0xea4e('0x9'),auth[_0xea4e('0xc')](),controller['destroy']);module[_0xea4e('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index f7e846a..c2a4fc0 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 _0x43fc=['STRING','ENUM','first','third','sequelize','exports'];(function(_0x111f76,_0x5e87a4){var _0x6cecc5=function(_0x47e465){while(--_0x47e465){_0x111f76['push'](_0x111f76['shift']());}};_0x6cecc5(++_0x5e87a4);}(_0x43fc,0xee));var _0xc43f=function(_0xd52e53,_0x2a319c){_0xd52e53=_0xd52e53-0x0;var _0xeb5ba2=_0x43fc[_0xd52e53];return _0xeb5ba2;};'use strict';var Sequelize=require(_0xc43f('0x0'));module[_0xc43f('0x1')]={'name':{'type':Sequelize[_0xc43f('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xc43f('0x3')](_0xc43f('0x4'),'second',_0xc43f('0x5')),'allowNull':![],'defaultValue':_0xc43f('0x4')},'description':{'type':Sequelize[_0xc43f('0x2')]}}; \ No newline at end of file +var _0x417c=['first','second','third','sequelize','exports','STRING','ENUM'];(function(_0x4eca79,_0x1c755f){var _0x140df8=function(_0x46c3f2){while(--_0x46c3f2){_0x4eca79['push'](_0x4eca79['shift']());}};_0x140df8(++_0x1c755f);}(_0x417c,0xc7));var _0xc417=function(_0x3e49dc,_0x4c3e0f){_0x3e49dc=_0x3e49dc-0x0;var _0x1bb1cf=_0x417c[_0x3e49dc];return _0x1bb1cf;};'use strict';var Sequelize=require(_0xc417('0x0'));module[_0xc417('0x1')]={'name':{'type':Sequelize[_0xc417('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xc417('0x3')](_0xc417('0x4'),_0xc417('0x5'),_0xc417('0x6')),'allowNull':![],'defaultValue':_0xc417('0x4')},'description':{'type':Sequelize[_0xc417('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 2008c03..67354b6 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 _0xe290=['papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','name','map','Disposition','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','catch','show','params','fields','includeAll','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xe290,0x1d6));var _0x0e29=function(_0x56dda5,_0x40d426){_0x56dda5=_0x56dda5-0x0;var _0x12574f=_0xe290[_0x56dda5];return _0x12574f;};'use strict';var emlformat=require(_0x0e29('0x0'));var rimraf=require(_0x0e29('0x1'));var zipdir=require(_0x0e29('0x2'));var jsonpatch=require(_0x0e29('0x3'));var rp=require('request-promise');var moment=require(_0x0e29('0x4'));var BPromise=require(_0x0e29('0x5'));var Mustache=require(_0x0e29('0x6'));var util=require('util');var path=require(_0x0e29('0x7'));var sox=require(_0x0e29('0x8'));var csv=require(_0x0e29('0x9'));var ejs=require(_0x0e29('0xa'));var fs=require('fs');var fs_extra=require(_0x0e29('0xb'));var _=require(_0x0e29('0xc'));var squel=require(_0x0e29('0xd'));var crypto=require(_0x0e29('0xe'));var jsforce=require(_0x0e29('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0e29('0x9'));var querystring=require('querystring');var Papa=require(_0x0e29('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0e29('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e29('0x12'));var logger=require('../../config/logger')(_0x0e29('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0e29('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26f297,_0x56a18c){_0x56a18c=_0x56a18c||0xcc;return function(_0x3f81f4){if(_0x3f81f4){return _0x26f297[_0x0e29('0x15')](_0x56a18c);}return _0x26f297['status'](_0x56a18c)[_0x0e29('0x16')]();};}function respondWithResult(_0x3741d9,_0x56cf0c){_0x56cf0c=_0x56cf0c||0xc8;return function(_0x12302d){if(_0x12302d){return _0x3741d9[_0x0e29('0x17')](_0x56cf0c)[_0x0e29('0x18')](_0x12302d);}};}function respondWithFilteredResult(_0x43dea,_0x1f0886){return function(_0x1953f2){if(_0x1953f2){var _0x2a7f0a=typeof _0x1f0886['offset']===_0x0e29('0x19')&&typeof _0x1f0886[_0x0e29('0x1a')]===_0x0e29('0x19');var _0x25998a=_0x1953f2[_0x0e29('0x1b')];var _0xa3e999=_0x2a7f0a?0x0:_0x1f0886[_0x0e29('0x1c')];var _0x64bb26=_0x2a7f0a?_0x1953f2[_0x0e29('0x1b')]:_0x1f0886[_0x0e29('0x1c')]+_0x1f0886[_0x0e29('0x1a')];var _0x3a1aed;if(_0x64bb26>=_0x25998a){_0x64bb26=_0x25998a;_0x3a1aed=0xc8;}else{_0x3a1aed=0xce;}_0x43dea['status'](_0x3a1aed);return _0x43dea[_0x0e29('0x1d')](_0x0e29('0x1e'),_0xa3e999+'-'+_0x64bb26+'/'+_0x25998a)[_0x0e29('0x18')](_0x1953f2);}return null;};}function patchUpdates(_0x2e9820){return function(_0x337f35){try{jsonpatch[_0x0e29('0x1f')](_0x337f35,_0x2e9820,!![]);}catch(_0x518bc0){return BPromise[_0x0e29('0x20')](_0x518bc0);}return _0x337f35[_0x0e29('0x21')]();};}function saveUpdates(_0x2858a1,_0xbf3b4a){return function(_0x44b262){if(_0x44b262){return _0x44b262[_0x0e29('0x22')](_0x2858a1)[_0x0e29('0x23')](function(_0x36955d){return _0x36955d;});}return null;};}function removeEntity(_0x2275bd,_0x9d1e01){return function(_0x4b157c){if(_0x4b157c){return _0x4b157c[_0x0e29('0x24')]()[_0x0e29('0x23')](function(){var _0x1e1773=_0x4b157c['get']({'plain':!![]});var _0x5e64ad=_0x0e29('0x25');return db[_0x0e29('0x26')][_0x0e29('0x24')]({'where':{'type':_0x5e64ad,'resourceId':_0x1e1773['id']}})[_0x0e29('0x23')](function(){return _0x4b157c;});})['then'](function(){_0x2275bd[_0x0e29('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38358c,_0x2203a0){return function(_0x472c45){if(!_0x472c45){_0x38358c[_0x0e29('0x15')](0x194);}return _0x472c45;};}function handleError(_0x1de9bf,_0x3bd544){_0x3bd544=_0x3bd544||0x1f4;return function(_0x1223a1){logger['error'](_0x1223a1['stack']);if(_0x1223a1['name']){delete _0x1223a1[_0x0e29('0x27')];}_0x1de9bf[_0x0e29('0x17')](_0x3bd544)['send'](_0x1223a1);};}exports['index']=function(_0x29e456,_0x2ceaba){var _0x5ae74c={},_0x56f9d3={},_0xab9565={'count':0x0,'rows':[]};var _0x3cfc1b=_[_0x0e29('0x28')](db[_0x0e29('0x29')][_0x0e29('0x2a')],function(_0x1106c0){return{'name':_0x1106c0[_0x0e29('0x2b')],'type':_0x1106c0['type'][_0x0e29('0x2c')]};});_0x56f9d3[_0x0e29('0x2d')]=_[_0x0e29('0x28')](_0x3cfc1b,_0x0e29('0x27'));_0x56f9d3[_0x0e29('0x2e')]=_[_0x0e29('0x2f')](_0x29e456[_0x0e29('0x2e')]);_0x56f9d3[_0x0e29('0x30')]=_[_0x0e29('0x31')](_0x56f9d3[_0x0e29('0x2d')],_0x56f9d3[_0x0e29('0x2e')]);_0x5ae74c[_0x0e29('0x32')]=_[_0x0e29('0x31')](_0x56f9d3[_0x0e29('0x2d')],qs['fields'](_0x29e456[_0x0e29('0x2e')]['fields']));_0x5ae74c[_0x0e29('0x32')]=_0x5ae74c['attributes'][_0x0e29('0x33')]?_0x5ae74c[_0x0e29('0x32')]:_0x56f9d3[_0x0e29('0x2d')];if(!_0x29e456['query'][_0x0e29('0x34')](_0x0e29('0x35'))){_0x5ae74c[_0x0e29('0x1a')]=qs['limit'](_0x29e456[_0x0e29('0x2e')]['limit']);_0x5ae74c[_0x0e29('0x1c')]=qs[_0x0e29('0x1c')](_0x29e456['query']['offset']);}_0x5ae74c[_0x0e29('0x36')]=qs[_0x0e29('0x37')](_0x29e456[_0x0e29('0x2e')][_0x0e29('0x37')]);_0x5ae74c['where']=qs['filters'](_[_0x0e29('0x38')](_0x29e456[_0x0e29('0x2e')],_0x56f9d3[_0x0e29('0x30')]),_0x3cfc1b);if(_0x29e456[_0x0e29('0x2e')][_0x0e29('0x39')]){_0x5ae74c[_0x0e29('0x3a')]=_[_0x0e29('0x3b')](_0x5ae74c['where'],{'$or':_['map'](_0x3cfc1b,function(_0x208372){if(_0x208372[_0x0e29('0x3c')]!==_0x0e29('0x3d')){var _0x574e9c={};_0x574e9c[_0x208372[_0x0e29('0x27')]]={'$like':'%'+_0x29e456[_0x0e29('0x2e')][_0x0e29('0x39')]+'%'};return _0x574e9c;}})});}_0x5ae74c=_[_0x0e29('0x3b')]({},_0x5ae74c,_0x29e456[_0x0e29('0x3e')]);var _0xfe3dfd={'where':_0x5ae74c[_0x0e29('0x3a')]};return db[_0x0e29('0x29')][_0x0e29('0x1b')](_0xfe3dfd)['then'](function(_0x241a7e){_0xab9565[_0x0e29('0x1b')]=_0x241a7e;if(_0x29e456['query']['includeAll']){_0x5ae74c[_0x0e29('0x3f')]=[{'all':!![]}];}return db[_0x0e29('0x29')][_0x0e29('0x40')](_0x5ae74c);})['then'](function(_0x415806){_0xab9565['rows']=_0x415806;return _0xab9565;})[_0x0e29('0x23')](respondWithFilteredResult(_0x2ceaba,_0x5ae74c))[_0x0e29('0x41')](handleError(_0x2ceaba,null));};exports[_0x0e29('0x42')]=function(_0x167189,_0x10428c){var _0x34351a={'raw':!![],'where':{'id':_0x167189[_0x0e29('0x43')]['id']}},_0x229dc1={};_0x229dc1[_0x0e29('0x2d')]=_[_0x0e29('0x2f')](db['Disposition'][_0x0e29('0x2a')]);_0x229dc1['query']=_['keys'](_0x167189[_0x0e29('0x2e')]);_0x229dc1[_0x0e29('0x30')]=_[_0x0e29('0x31')](_0x229dc1['model'],_0x229dc1[_0x0e29('0x2e')]);_0x34351a[_0x0e29('0x32')]=_[_0x0e29('0x31')](_0x229dc1[_0x0e29('0x2d')],qs[_0x0e29('0x44')](_0x167189['query'][_0x0e29('0x44')]));_0x34351a[_0x0e29('0x32')]=_0x34351a['attributes'][_0x0e29('0x33')]?_0x34351a[_0x0e29('0x32')]:_0x229dc1[_0x0e29('0x2d')];if(_0x167189[_0x0e29('0x2e')][_0x0e29('0x45')]){_0x34351a[_0x0e29('0x3f')]=[{'all':!![]}];}_0x34351a=_['merge']({},_0x34351a,_0x167189[_0x0e29('0x3e')]);return db['Disposition'][_0x0e29('0x46')](_0x34351a)[_0x0e29('0x23')](handleEntityNotFound(_0x10428c,null))['then'](respondWithResult(_0x10428c,null))[_0x0e29('0x41')](handleError(_0x10428c,null));};exports[_0x0e29('0x47')]=function(_0x4547f4,_0x4eff60){return db['Disposition']['create'](_0x4547f4[_0x0e29('0x48')],{})['then'](function(_0x5d0e63){var _0x2eec8a=_0x4547f4[_0x0e29('0x49')][_0x0e29('0x4a')]({'plain':!![]});if(!_0x2eec8a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2eec8a[_0x0e29('0x4b')]===_0x0e29('0x49')){var _0x24b0ad=_0x5d0e63[_0x0e29('0x4a')]({'plain':!![]});var _0x497775='Dispositions';return db[_0x0e29('0x4c')][_0x0e29('0x46')]({'where':{'name':_0x497775,'userProfileId':_0x2eec8a[_0x0e29('0x4d')]},'raw':!![]})[_0x0e29('0x23')](function(_0x4e8348){if(_0x4e8348&&_0x4e8348[_0x0e29('0x4e')]===0x0){return db[_0x0e29('0x26')][_0x0e29('0x47')]({'name':_0x24b0ad['name'],'resourceId':_0x24b0ad['id'],'type':_0x4e8348['name'],'sectionId':_0x4e8348['id']},{})[_0x0e29('0x23')](function(){return _0x5d0e63;});}else{return _0x5d0e63;}})['catch'](function(_0x253070){logger[_0x0e29('0x4f')](_0x0e29('0x50'),_0x253070);throw _0x253070;});}return _0x5d0e63;})[_0x0e29('0x23')](respondWithResult(_0x4eff60,0xc9))['catch'](handleError(_0x4eff60,null));};exports[_0x0e29('0x22')]=function(_0x345c1f,_0x555e1f){if(_0x345c1f[_0x0e29('0x48')]['id']){delete _0x345c1f['body']['id'];}return db['Disposition'][_0x0e29('0x46')]({'where':{'id':_0x345c1f[_0x0e29('0x43')]['id']}})[_0x0e29('0x23')](handleEntityNotFound(_0x555e1f,null))[_0x0e29('0x23')](saveUpdates(_0x345c1f[_0x0e29('0x48')],null))['then'](respondWithResult(_0x555e1f,null))[_0x0e29('0x41')](handleError(_0x555e1f,null));};exports[_0x0e29('0x24')]=function(_0x4c1e49,_0x1b1a0d){return db[_0x0e29('0x29')][_0x0e29('0x46')]({'where':{'id':_0x4c1e49[_0x0e29('0x43')]['id']}})[_0x0e29('0x23')](handleEntityNotFound(_0x1b1a0d,null))[_0x0e29('0x23')](removeEntity(_0x1b1a0d,null))['catch'](handleError(_0x1b1a0d,null));}; \ No newline at end of file +var _0xdbcd=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','then','destroy','get','end','error','send','index','map','rawAttributes','type','key','model','name','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','Disposition','includeAll','include','findAll','rows','catch','show','params','keys','create','user','role','Dispositions','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','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'];(function(_0x26e727,_0x3e65be){var _0x563800=function(_0xbcf999){while(--_0xbcf999){_0x26e727['push'](_0x26e727['shift']());}};_0x563800(++_0x3e65be);}(_0xdbcd,0x1bc));var _0xddbc=function(_0x21d683,_0x2d0c1c){_0x21d683=_0x21d683-0x0;var _0x3004b1=_0xdbcd[_0x21d683];return _0x3004b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xddbc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xddbc('0x1'));var rp=require(_0xddbc('0x2'));var moment=require(_0xddbc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xddbc('0x4'));var util=require(_0xddbc('0x5'));var path=require(_0xddbc('0x6'));var sox=require('sox');var csv=require(_0xddbc('0x7'));var ejs=require(_0xddbc('0x8'));var fs=require('fs');var fs_extra=require(_0xddbc('0x9'));var _=require(_0xddbc('0xa'));var squel=require(_0xddbc('0xb'));var crypto=require(_0xddbc('0xc'));var jsforce=require(_0xddbc('0xd'));var deskjs=require(_0xddbc('0xe'));var toCsv=require(_0xddbc('0x7'));var querystring=require(_0xddbc('0xf'));var Papa=require(_0xddbc('0x10'));var Redis=require(_0xddbc('0x11'));var authService=require(_0xddbc('0x12'));var qs=require(_0xddbc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddbc('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xddbc('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xddbc('0x16'));var db=require(_0xddbc('0x17'))['db'];function respondWithStatusCode(_0x512451,_0x4a8451){_0x4a8451=_0x4a8451||0xcc;return function(_0x2cb258){if(_0x2cb258){return _0x512451[_0xddbc('0x18')](_0x4a8451);}return _0x512451['status'](_0x4a8451)['end']();};}function respondWithResult(_0x27d5e8,_0x4b1beb){_0x4b1beb=_0x4b1beb||0xc8;return function(_0x1939c0){if(_0x1939c0){return _0x27d5e8[_0xddbc('0x19')](_0x4b1beb)['json'](_0x1939c0);}};}function respondWithFilteredResult(_0x5d7ad1,_0x29cd74){return function(_0x16e5bc){if(_0x16e5bc){var _0x2220a6=typeof _0x29cd74[_0xddbc('0x1a')]===_0xddbc('0x1b')&&typeof _0x29cd74[_0xddbc('0x1c')]===_0xddbc('0x1b');var _0x531cf1=_0x16e5bc[_0xddbc('0x1d')];var _0x4667df=_0x2220a6?0x0:_0x29cd74[_0xddbc('0x1a')];var _0x3d97d2=_0x2220a6?_0x16e5bc[_0xddbc('0x1d')]:_0x29cd74[_0xddbc('0x1a')]+_0x29cd74['limit'];var _0x4240ff;if(_0x3d97d2>=_0x531cf1){_0x3d97d2=_0x531cf1;_0x4240ff=0xc8;}else{_0x4240ff=0xce;}_0x5d7ad1[_0xddbc('0x19')](_0x4240ff);return _0x5d7ad1['set']('Content-Range',_0x4667df+'-'+_0x3d97d2+'/'+_0x531cf1)[_0xddbc('0x1e')](_0x16e5bc);}return null;};}function patchUpdates(_0x57877c){return function(_0x2356fc){try{jsonpatch['apply'](_0x2356fc,_0x57877c,!![]);}catch(_0x2a2c35){return BPromise['reject'](_0x2a2c35);}return _0x2356fc['save']();};}function saveUpdates(_0x57d916,_0x3a826d){return function(_0x259a4b){if(_0x259a4b){return _0x259a4b['update'](_0x57d916)[_0xddbc('0x1f')](function(_0x4fe0d6){return _0x4fe0d6;});}return null;};}function removeEntity(_0x567c26,_0x27dcaa){return function(_0x3eab5d){if(_0x3eab5d){return _0x3eab5d[_0xddbc('0x20')]()[_0xddbc('0x1f')](function(){var _0x1ec2dd=_0x3eab5d[_0xddbc('0x21')]({'plain':!![]});var _0xa46892='Dispositions';return db['UserProfileResource'][_0xddbc('0x20')]({'where':{'type':_0xa46892,'resourceId':_0x1ec2dd['id']}})[_0xddbc('0x1f')](function(){return _0x3eab5d;});})[_0xddbc('0x1f')](function(){_0x567c26[_0xddbc('0x19')](0xcc)[_0xddbc('0x22')]();});}};}function handleEntityNotFound(_0x5d1e33,_0x36d32f){return function(_0x48fe83){if(!_0x48fe83){_0x5d1e33['sendStatus'](0x194);}return _0x48fe83;};}function handleError(_0x4db118,_0x5a2596){_0x5a2596=_0x5a2596||0x1f4;return function(_0x56d1d3){logger[_0xddbc('0x23')](_0x56d1d3['stack']);if(_0x56d1d3['name']){delete _0x56d1d3['name'];}_0x4db118['status'](_0x5a2596)[_0xddbc('0x24')](_0x56d1d3);};}exports[_0xddbc('0x25')]=function(_0x595ab5,_0x947f69){var _0x391635={},_0x3ccca9={},_0x50eec5={'count':0x0,'rows':[]};var _0x5576fe=_[_0xddbc('0x26')](db['Disposition'][_0xddbc('0x27')],function(_0x4bea2c){return{'name':_0x4bea2c['fieldName'],'type':_0x4bea2c[_0xddbc('0x28')][_0xddbc('0x29')]};});_0x3ccca9[_0xddbc('0x2a')]=_[_0xddbc('0x26')](_0x5576fe,_0xddbc('0x2b'));_0x3ccca9[_0xddbc('0x2c')]=_['keys'](_0x595ab5[_0xddbc('0x2c')]);_0x3ccca9['filters']=_[_0xddbc('0x2d')](_0x3ccca9[_0xddbc('0x2a')],_0x3ccca9['query']);_0x391635[_0xddbc('0x2e')]=_[_0xddbc('0x2d')](_0x3ccca9[_0xddbc('0x2a')],qs[_0xddbc('0x2f')](_0x595ab5[_0xddbc('0x2c')]['fields']));_0x391635[_0xddbc('0x2e')]=_0x391635['attributes'][_0xddbc('0x30')]?_0x391635['attributes']:_0x3ccca9[_0xddbc('0x2a')];if(!_0x595ab5[_0xddbc('0x2c')]['hasOwnProperty'](_0xddbc('0x31'))){_0x391635['limit']=qs[_0xddbc('0x1c')](_0x595ab5[_0xddbc('0x2c')][_0xddbc('0x1c')]);_0x391635['offset']=qs[_0xddbc('0x1a')](_0x595ab5[_0xddbc('0x2c')][_0xddbc('0x1a')]);}_0x391635['order']=qs[_0xddbc('0x32')](_0x595ab5[_0xddbc('0x2c')][_0xddbc('0x32')]);_0x391635[_0xddbc('0x33')]=qs[_0xddbc('0x34')](_[_0xddbc('0x35')](_0x595ab5[_0xddbc('0x2c')],_0x3ccca9[_0xddbc('0x34')]),_0x5576fe);if(_0x595ab5[_0xddbc('0x2c')][_0xddbc('0x36')]){_0x391635[_0xddbc('0x33')]=_[_0xddbc('0x37')](_0x391635[_0xddbc('0x33')],{'$or':_[_0xddbc('0x26')](_0x5576fe,function(_0x58d1e9){if(_0x58d1e9['type']!==_0xddbc('0x38')){var _0x1e84aa={};_0x1e84aa[_0x58d1e9['name']]={'$like':'%'+_0x595ab5[_0xddbc('0x2c')]['filter']+'%'};return _0x1e84aa;}})});}_0x391635=_[_0xddbc('0x37')]({},_0x391635,_0x595ab5['options']);var _0x384a5f={'where':_0x391635['where']};return db[_0xddbc('0x39')][_0xddbc('0x1d')](_0x384a5f)[_0xddbc('0x1f')](function(_0x2f95b7){_0x50eec5[_0xddbc('0x1d')]=_0x2f95b7;if(_0x595ab5[_0xddbc('0x2c')][_0xddbc('0x3a')]){_0x391635[_0xddbc('0x3b')]=[{'all':!![]}];}return db[_0xddbc('0x39')][_0xddbc('0x3c')](_0x391635);})['then'](function(_0x58939c){_0x50eec5[_0xddbc('0x3d')]=_0x58939c;return _0x50eec5;})[_0xddbc('0x1f')](respondWithFilteredResult(_0x947f69,_0x391635))[_0xddbc('0x3e')](handleError(_0x947f69,null));};exports[_0xddbc('0x3f')]=function(_0x89b2fe,_0x2c566f){var _0x5d1526={'raw':!![],'where':{'id':_0x89b2fe[_0xddbc('0x40')]['id']}},_0x2dad3c={};_0x2dad3c[_0xddbc('0x2a')]=_[_0xddbc('0x41')](db['Disposition'][_0xddbc('0x27')]);_0x2dad3c[_0xddbc('0x2c')]=_[_0xddbc('0x41')](_0x89b2fe[_0xddbc('0x2c')]);_0x2dad3c[_0xddbc('0x34')]=_[_0xddbc('0x2d')](_0x2dad3c[_0xddbc('0x2a')],_0x2dad3c[_0xddbc('0x2c')]);_0x5d1526['attributes']=_['intersection'](_0x2dad3c['model'],qs['fields'](_0x89b2fe[_0xddbc('0x2c')][_0xddbc('0x2f')]));_0x5d1526[_0xddbc('0x2e')]=_0x5d1526[_0xddbc('0x2e')][_0xddbc('0x30')]?_0x5d1526[_0xddbc('0x2e')]:_0x2dad3c['model'];if(_0x89b2fe[_0xddbc('0x2c')][_0xddbc('0x3a')]){_0x5d1526[_0xddbc('0x3b')]=[{'all':!![]}];}_0x5d1526=_[_0xddbc('0x37')]({},_0x5d1526,_0x89b2fe['options']);return db[_0xddbc('0x39')]['find'](_0x5d1526)[_0xddbc('0x1f')](handleEntityNotFound(_0x2c566f,null))[_0xddbc('0x1f')](respondWithResult(_0x2c566f,null))[_0xddbc('0x3e')](handleError(_0x2c566f,null));};exports['create']=function(_0x3ea280,_0x53be85){return db[_0xddbc('0x39')][_0xddbc('0x42')](_0x3ea280['body'],{})['then'](function(_0x5ce776){var _0x9eab16=_0x3ea280[_0xddbc('0x43')][_0xddbc('0x21')]({'plain':!![]});if(!_0x9eab16)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9eab16[_0xddbc('0x44')]===_0xddbc('0x43')){var _0x663cd8=_0x5ce776['get']({'plain':!![]});var _0x607742=_0xddbc('0x45');return db[_0xddbc('0x46')]['find']({'where':{'name':_0x607742,'userProfileId':_0x9eab16['userProfileId']},'raw':!![]})[_0xddbc('0x1f')](function(_0x36aa93){if(_0x36aa93&&_0x36aa93[_0xddbc('0x47')]===0x0){return db[_0xddbc('0x48')]['create']({'name':_0x663cd8[_0xddbc('0x2b')],'resourceId':_0x663cd8['id'],'type':_0x36aa93[_0xddbc('0x2b')],'sectionId':_0x36aa93['id']},{})[_0xddbc('0x1f')](function(){return _0x5ce776;});}else{return _0x5ce776;}})[_0xddbc('0x3e')](function(_0x479da9){logger[_0xddbc('0x23')](_0xddbc('0x49'),_0x479da9);throw _0x479da9;});}return _0x5ce776;})[_0xddbc('0x1f')](respondWithResult(_0x53be85,0xc9))[_0xddbc('0x3e')](handleError(_0x53be85,null));};exports[_0xddbc('0x4a')]=function(_0x3d8a5b,_0x54c482){if(_0x3d8a5b[_0xddbc('0x4b')]['id']){delete _0x3d8a5b[_0xddbc('0x4b')]['id'];}return db[_0xddbc('0x39')]['find']({'where':{'id':_0x3d8a5b['params']['id']}})[_0xddbc('0x1f')](handleEntityNotFound(_0x54c482,null))[_0xddbc('0x1f')](saveUpdates(_0x3d8a5b['body'],null))['then'](respondWithResult(_0x54c482,null))['catch'](handleError(_0x54c482,null));};exports[_0xddbc('0x20')]=function(_0x49b000,_0x1e4892){return db[_0xddbc('0x39')][_0xddbc('0x4c')]({'where':{'id':_0x49b000[_0xddbc('0x40')]['id']}})[_0xddbc('0x1f')](handleEntityNotFound(_0x1e4892,null))[_0xddbc('0x1f')](removeEntity(_0x1e4892,null))[_0xddbc('0x3e')](handleError(_0x1e4892,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index bb094e3..c39d3a1 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 _0xdaea=['request-promise','path','rimraf','../../config/environment','exports','define','Disposition','tools_dispositions','name','ListId','ChatWebsiteId','MailAccountId','name_fax','FaxAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment'];(function(_0x3ef8f7,_0x35359a){var _0x3b097e=function(_0x189c92){while(--_0x189c92){_0x3ef8f7['push'](_0x3ef8f7['shift']());}};_0x3b097e(++_0x35359a);}(_0xdaea,0x121));var _0xadae=function(_0x1deee5,_0x1d4485){_0x1deee5=_0x1deee5-0x0;var _0x1d6c3a=_0xdaea[_0x1deee5];return _0x1d6c3a;};'use strict';var _=require(_0xadae('0x0'));var util=require(_0xadae('0x1'));var logger=require(_0xadae('0x2'))(_0xadae('0x3'));var moment=require(_0xadae('0x4'));var BPromise=require('bluebird');var rp=require(_0xadae('0x5'));var fs=require('fs');var path=require(_0xadae('0x6'));var rimraf=require(_0xadae('0x7'));var config=require(_0xadae('0x8'));var attributes=require('./disposition.attributes');module[_0xadae('0x9')]=function(_0x247e92,_0xea8edd){return _0x247e92[_0xadae('0xa')](_0xadae('0xb'),attributes,{'tableName':_0xadae('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0xadae('0xd'),_0xadae('0xe')]},{'unique':!![],'name':'name_chat','fields':[_0xadae('0xd'),_0xadae('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0xadae('0xd'),_0xadae('0x10')]},{'unique':!![],'name':'name_sms','fields':[_0xadae('0xd'),'SmsAccountId']},{'unique':!![],'name':_0xadae('0x11'),'fields':['name',_0xadae('0x12')]},{'unique':!![],'name':'name_openchannel','fields':[_0xadae('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0xadae('0x13'),'fields':[_0xadae('0xd'),_0xadae('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb427=['name_chat','ChatWebsiteId','name_mail','MailAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId'];(function(_0x4f343a,_0x2f533d){var _0x1300f6=function(_0xc69b14){while(--_0xc69b14){_0x4f343a['push'](_0x4f343a['shift']());}};_0x1300f6(++_0x2f533d);}(_0xb427,0xf4));var _0x7b42=function(_0x558505,_0x3b614d){_0x558505=_0x558505-0x0;var _0x4088a7=_0xb427[_0x558505];return _0x4088a7;};'use strict';var _=require(_0x7b42('0x0'));var util=require('util');var logger=require(_0x7b42('0x1'))(_0x7b42('0x2'));var moment=require('moment');var BPromise=require(_0x7b42('0x3'));var rp=require(_0x7b42('0x4'));var fs=require('fs');var path=require(_0x7b42('0x5'));var rimraf=require(_0x7b42('0x6'));var config=require(_0x7b42('0x7'));var attributes=require(_0x7b42('0x8'));module[_0x7b42('0x9')]=function(_0x1592a5,_0x5a3331){return _0x1592a5[_0x7b42('0xa')](_0x7b42('0xb'),attributes,{'tableName':_0x7b42('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x7b42('0xd'),'fields':[_0x7b42('0xe'),_0x7b42('0xf')]},{'unique':!![],'name':_0x7b42('0x10'),'fields':[_0x7b42('0xe'),_0x7b42('0x11')]},{'unique':!![],'name':_0x7b42('0x12'),'fields':[_0x7b42('0xe'),_0x7b42('0x13')]},{'unique':!![],'name':'name_sms','fields':[_0x7b42('0xe'),'SmsAccountId']},{'unique':!![],'name':_0x7b42('0x14'),'fields':[_0x7b42('0xe'),_0x7b42('0x15')]},{'unique':!![],'name':_0x7b42('0x16'),'fields':[_0x7b42('0xe'),_0x7b42('0x17')]},{'unique':!![],'name':_0x7b42('0x18'),'fields':[_0x7b42('0xe'),_0x7b42('0x19')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index e01cff8..02b78be 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(_0x311889,_0x4e33fc){var _0x345d2d=function(_0x2cb75d){while(--_0x2cb75d){_0x311889['push'](_0x311889['shift']());}};_0x345d2d(++_0x4e33fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x355d3a,_0x4491bf){var _0x5b928a=function(_0x38d705){while(--_0x38d705){_0x355d3a['push'](_0x355d3a['shift']());}};_0x5b928a(++_0x4491bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 825dbe5..7f72344 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 _0xc032=['get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc032,0x1b3));var _0x2c03=function(_0x306cbd,_0x3655b8){_0x306cbd=_0x306cbd-0x0;var _0x1eaec0=_0xc032[_0x306cbd];return _0x1eaec0;};'use strict';var multer=require('multer');var util=require(_0x2c03('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2c03('0x1'));var router=express[_0x2c03('0x2')]();var fs_extra=require(_0x2c03('0x3'));var auth=require(_0x2c03('0x4'));var interaction=require(_0x2c03('0x5'));var config=require(_0x2c03('0x6'));var controller=require('./disposition.controller');router[_0x2c03('0x7')]('/',auth[_0x2c03('0x8')](),controller['index']);router[_0x2c03('0x7')](_0x2c03('0x9'),auth[_0x2c03('0x8')](),controller[_0x2c03('0xa')]);router[_0x2c03('0xb')]('/',auth[_0x2c03('0x8')](),controller[_0x2c03('0xc')]);router[_0x2c03('0xd')](_0x2c03('0x9'),auth['isAuthenticated'](),controller[_0x2c03('0xe')]);router[_0x2c03('0xf')]('/:id',auth[_0x2c03('0x8')](),controller['destroy']);module[_0x2c03('0x10')]=router; \ No newline at end of file +var _0xd3e7=['create','put','update','delete','destroy','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x16dc35,_0x1d3958){var _0x12f365=function(_0x5d8f86){while(--_0x5d8f86){_0x16dc35['push'](_0x16dc35['shift']());}};_0x12f365(++_0x1d3958);}(_0xd3e7,0xa7));var _0x7d3e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd3e7[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7d3e('0x0'));var timeout=require(_0x7d3e('0x1'));var express=require('express');var router=express[_0x7d3e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7d3e('0x3'));var interaction=require(_0x7d3e('0x4'));var config=require(_0x7d3e('0x5'));var controller=require(_0x7d3e('0x6'));router[_0x7d3e('0x7')]('/',auth[_0x7d3e('0x8')](),controller[_0x7d3e('0x9')]);router[_0x7d3e('0x7')](_0x7d3e('0xa'),auth[_0x7d3e('0x8')](),controller[_0x7d3e('0xb')]);router[_0x7d3e('0xc')]('/',auth[_0x7d3e('0x8')](),controller[_0x7d3e('0xd')]);router[_0x7d3e('0xe')](_0x7d3e('0xa'),auth[_0x7d3e('0x8')](),controller[_0x7d3e('0xf')]);router[_0x7d3e('0x10')](_0x7d3e('0xa'),auth[_0x7d3e('0x8')](),controller[_0x7d3e('0x11')]);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 889feca..8a19e76 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 _0x2180=['4800','v17,v27,v29','DADHI','KHOMP','SIP','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','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','7200','9600','12000','14400'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2180,0x10b));var _0x0218=function(_0x31295c,_0x2f2b82){_0x31295c=_0x31295c-0x0;var _0x2c150e=_0x2180[_0x31295c];return _0x2c150e;};'use strict';var Sequelize=require('sequelize');module[_0x0218('0x0')]={'name':{'type':Sequelize[_0x0218('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0218('0x1')]},'ecm':{'type':Sequelize[_0x0218('0x2')](_0x0218('0x3'),'no'),'defaultValue':_0x0218('0x3')},'headerinfo':{'type':Sequelize[_0x0218('0x1')],'defaultValue':_0x0218('0x4')},'localstationid':{'type':Sequelize[_0x0218('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x0218('0x2')]('2400','4800',_0x0218('0x5'),_0x0218('0x6'),_0x0218('0x7'),_0x0218('0x8')),'defaultValue':_0x0218('0x9')},'maxrate':{'type':Sequelize[_0x0218('0x2')]('2400',_0x0218('0x9'),_0x0218('0x5'),_0x0218('0x6'),'12000',_0x0218('0x8')),'defaultValue':_0x0218('0x8')},'modem':{'type':Sequelize[_0x0218('0x1')],'defaultValue':_0x0218('0xa')},'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['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP','IAX',_0x0218('0xb'),_0x0218('0xc')),'defaultValue':_0x0218('0xd')},'key':{'type':Sequelize[_0x0218('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0218('0xe')],'defaultValue':function(){return _0x0218('0xf');}},'notificationSound':{'type':Sequelize[_0x0218('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0218('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0218('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0218('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0218('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0218('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0218('0x11')],'allowNull':!![],'defaultValue':null,'comment':_0x0218('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0218('0x13'),'set':function(_0x2e6a1a){if(!_0x2e6a1a)this[_0x0218('0x14')](_0x0218('0x15'),null);this['setDataValue'](_0x0218('0x16'),_0x2e6a1a);}}}; \ No newline at end of file +var _0x89a6=['14400','2400','9600','INTEGER','SIP','IAX','DADHI','TEXT','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','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','12000'];(function(_0x65589e,_0x5a5205){var _0x52aec8=function(_0x510b2c){while(--_0x510b2c){_0x65589e['push'](_0x65589e['shift']());}};_0x52aec8(++_0x5a5205);}(_0x89a6,0xfe));var _0x689a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x89a6[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x689a('0x0'));module[_0x689a('0x1')]={'name':{'type':Sequelize[_0x689a('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x689a('0x2')]},'ecm':{'type':Sequelize[_0x689a('0x3')](_0x689a('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x689a('0x2')],'defaultValue':_0x689a('0x5')},'localstationid':{'type':Sequelize[_0x689a('0x2')],'unique':_0x689a('0x6')},'minrate':{'type':Sequelize[_0x689a('0x3')]('2400',_0x689a('0x7'),_0x689a('0x8'),'9600',_0x689a('0x9'),_0x689a('0xa')),'defaultValue':_0x689a('0x7')},'maxrate':{'type':Sequelize[_0x689a('0x3')](_0x689a('0xb'),'4800',_0x689a('0x8'),_0x689a('0xc'),_0x689a('0x9'),_0x689a('0xa')),'defaultValue':_0x689a('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x689a('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x689a('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x689a('0xe'),_0x689a('0xf'),_0x689a('0x10'),'KHOMP'),'defaultValue':_0x689a('0xe')},'key':{'type':Sequelize[_0x689a('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x689a('0x11')],'defaultValue':function(){return _0x689a('0x12');}},'notificationSound':{'type':Sequelize[_0x689a('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x689a('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x689a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x689a('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x689a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x689a('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x689a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x689a('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x689a('0x13')],'defaultValue':![],'comment':_0x689a('0x14'),'set':function(_0xd02a35){if(!_0xd02a35)this[_0x689a('0x15')]('mandatoryDispositionPauseId',null);this[_0x689a('0x15')]('mandatoryDisposition',_0xd02a35);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index c9ff008..84f99b4 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 _0x1af6=['from','\x22%s\x22\x20<%s>','fax','defaults','Send\x20Fax\x20failed','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','localhost','register','jayson/promise','client','http','request','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','save','destroy','then','get','FaxAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','FaxAccount','type','map','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','rawAttributes','keys','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','describe','addDisposition','Disposition','getDispositions','findOne','length','pick','removeDispositions','ids','addAnswer','FaxAccountId','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','omit','CmContact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','updateAccountApplications','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','server/files/attachments','basename','CheckAfterSend','isNil','path'];(function(_0x5318d4,_0x1e712d){var _0x52c76c=function(_0x2b6a6e){while(--_0x2b6a6e){_0x5318d4['push'](_0x5318d4['shift']());}};_0x52c76c(++_0x1e712d);}(_0x1af6,0x193));var _0x61af=function(_0xd3e36d,_0x5533ce){_0xd3e36d=_0xd3e36d-0x0;var _0x45b310=_0x1af6[_0xd3e36d];return _0x45b310;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x61af('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x61af('0x1'));var rp=require(_0x61af('0x2'));var moment=require(_0x61af('0x3'));var BPromise=require(_0x61af('0x4'));var Mustache=require('mustache');var util=require(_0x61af('0x5'));var path=require('path');var sox=require(_0x61af('0x6'));var csv=require(_0x61af('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61af('0x8'));var _=require(_0x61af('0x9'));var squel=require(_0x61af('0xa'));var crypto=require('crypto');var jsforce=require(_0x61af('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x61af('0xc'));var Redis=require('ioredis');var authService=require(_0x61af('0xd'));var qs=require(_0x61af('0xe'));var as=require(_0x61af('0xf'));var hardwareService=require(_0x61af('0x10'));var logger=require('../../config/logger')(_0x61af('0x11'));var utils=require('../../config/utils');var config=require(_0x61af('0x12'));var licenseUtil=require(_0x61af('0x13'));var db=require('../../mysqldb')['db'];config[_0x61af('0x14')]=_['defaults'](config[_0x61af('0x14')],{'host':_0x61af('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x61af('0x14')]));require('./faxAccount.socket')[_0x61af('0x16')](socket);var jayson=require(_0x61af('0x17'));var client=jayson[_0x61af('0x18')][_0x61af('0x19')]({'port':0x232c});var client9002=jayson[_0x61af('0x18')][_0x61af('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x579ca0,_0x3f7f07,_0x3b1e37,_0x2c565b){return new BPromise(function(_0x3bd41e,_0x3dcc93){var _0x51a906=_0x2c565b||client;return _0x51a906[_0x61af('0x1a')](_0x579ca0,_0x3b1e37)['then'](function(_0x14d8be){logger['info'](_0x61af('0x1b'),_0x3f7f07,_0x61af('0x1c'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3f7f07,_0x61af('0x1c'),JSON[_0x61af('0x1d')](_0x14d8be));if(_0x14d8be[_0x61af('0x1e')]){if(_0x14d8be[_0x61af('0x1e')][_0x61af('0x1f')]===0x1f4){logger['error'](_0x61af('0x1b'),_0x3f7f07,_0x14d8be[_0x61af('0x1e')][_0x61af('0x20')]);return _0x3dcc93(_0x14d8be[_0x61af('0x1e')][_0x61af('0x20')]);}logger[_0x61af('0x1e')](_0x61af('0x1b'),_0x3f7f07,_0x14d8be[_0x61af('0x1e')][_0x61af('0x20')]);return _0x3bd41e(_0x14d8be[_0x61af('0x1e')][_0x61af('0x20')]);}else{logger[_0x61af('0x21')](_0x61af('0x1b'),_0x3f7f07,_0x61af('0x1c'));_0x3bd41e(_0x14d8be[_0x61af('0x22')]['message']);}})[_0x61af('0x23')](function(_0xe3623d){logger[_0x61af('0x1e')](_0x61af('0x1b'),_0x3f7f07,_0xe3623d);_0x3dcc93(_0xe3623d);});});}function respondWithStatusCode(_0x3025c1,_0x5ed3fe){_0x5ed3fe=_0x5ed3fe||0xcc;return function(_0x5dce51){if(_0x5dce51){return _0x3025c1[_0x61af('0x24')](_0x5ed3fe);}return _0x3025c1['status'](_0x5ed3fe)[_0x61af('0x25')]();};}function respondWithResult(_0x62dc95,_0x321977){_0x321977=_0x321977||0xc8;return function(_0x4841ff){if(_0x4841ff){return _0x62dc95[_0x61af('0x26')](_0x321977)[_0x61af('0x27')](_0x4841ff);}};}function respondWithFilteredResult(_0x66ecd5,_0x5df494){return function(_0x17d34c){if(_0x17d34c){var _0x28abdd=typeof _0x5df494[_0x61af('0x28')]==='undefined'&&typeof _0x5df494['limit']===_0x61af('0x29');var _0x3a8623=_0x17d34c[_0x61af('0x2a')];var _0x5477c2=_0x28abdd?0x0:_0x5df494[_0x61af('0x28')];var _0x1d987f=_0x28abdd?_0x17d34c[_0x61af('0x2a')]:_0x5df494[_0x61af('0x28')]+_0x5df494[_0x61af('0x2b')];var _0x5a24c9;if(_0x1d987f>=_0x3a8623){_0x1d987f=_0x3a8623;_0x5a24c9=0xc8;}else{_0x5a24c9=0xce;}_0x66ecd5[_0x61af('0x26')](_0x5a24c9);return _0x66ecd5['set'](_0x61af('0x2c'),_0x5477c2+'-'+_0x1d987f+'/'+_0x3a8623)['json'](_0x17d34c);}return null;};}function patchUpdates(_0x3b7198){return function(_0x12fcf3){try{jsonpatch['apply'](_0x12fcf3,_0x3b7198,!![]);}catch(_0x3c75c6){return BPromise['reject'](_0x3c75c6);}return _0x12fcf3[_0x61af('0x2d')]();};}function saveUpdates(_0x20b409,_0x1fd0a6){return function(_0x3ca093){if(_0x3ca093){return _0x3ca093['update'](_0x20b409)['then'](function(_0x56de1d){return _0x56de1d;});}return null;};}function removeEntity(_0x29d25b,_0x342054){return function(_0x20c0d7){if(_0x20c0d7){return _0x20c0d7[_0x61af('0x2e')]()[_0x61af('0x2f')](function(){var _0x5c28f9=_0x20c0d7[_0x61af('0x30')]({'plain':!![]});var _0x35ac8b=_0x61af('0x31');return db[_0x61af('0x32')]['destroy']({'where':{'type':_0x35ac8b,'resourceId':_0x5c28f9['id']}})['then'](function(){return _0x20c0d7;});})[_0x61af('0x2f')](function(){_0x29d25b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ca824,_0x4fda6d){return function(_0x4a2d2b){if(!_0x4a2d2b){_0x3ca824[_0x61af('0x24')](0x194);}return _0x4a2d2b;};}function handleError(_0x2e5456,_0x3f258d){_0x3f258d=_0x3f258d||0x1f4;return function(_0x59834f){logger[_0x61af('0x1e')](_0x59834f[_0x61af('0x33')]);if(_0x59834f[_0x61af('0x34')]){delete _0x59834f['name'];}_0x2e5456['status'](_0x3f258d)['send'](_0x59834f);};}exports[_0x61af('0x35')]=function(_0x58e4b8,_0x50f44b){var _0x2b45f7={'include':[{'model':db[_0x61af('0x36')],'as':_0x61af('0x37')}]},_0xf378a6={},_0x3f1bea={'count':0x0,'rows':[]};var _0x1323c9=_['map'](db[_0x61af('0x38')]['rawAttributes'],function(_0x1c314c){return{'name':_0x1c314c['fieldName'],'type':_0x1c314c[_0x61af('0x39')]['key']};});_0xf378a6['model']=_[_0x61af('0x3a')](_0x1323c9,'name');_0xf378a6[_0x61af('0x3b')]=_['keys'](_0x58e4b8[_0x61af('0x3b')]);_0xf378a6[_0x61af('0x3c')]=_[_0x61af('0x3d')](_0xf378a6[_0x61af('0x3e')],_0xf378a6[_0x61af('0x3b')]);_0x2b45f7[_0x61af('0x3f')]=_[_0x61af('0x3d')](_0xf378a6[_0x61af('0x3e')],qs[_0x61af('0x40')](_0x58e4b8[_0x61af('0x3b')][_0x61af('0x40')]));_0x2b45f7[_0x61af('0x3f')]=_0x2b45f7[_0x61af('0x3f')]['length']?_0x2b45f7['attributes']:_0xf378a6[_0x61af('0x3e')];if(!_0x58e4b8[_0x61af('0x3b')][_0x61af('0x41')](_0x61af('0x42'))){_0x2b45f7[_0x61af('0x2b')]=qs[_0x61af('0x2b')](_0x58e4b8[_0x61af('0x3b')][_0x61af('0x2b')]);_0x2b45f7['offset']=qs[_0x61af('0x28')](_0x58e4b8[_0x61af('0x3b')]['offset']);}_0x2b45f7[_0x61af('0x43')]=qs['sort'](_0x58e4b8[_0x61af('0x3b')][_0x61af('0x44')]);_0x2b45f7['where']=qs[_0x61af('0x3c')](_['pick'](_0x58e4b8[_0x61af('0x3b')],_0xf378a6['filters']),_0x1323c9);if(_0x58e4b8[_0x61af('0x3b')]['filter']){_0x2b45f7['where']=_[_0x61af('0x45')](_0x2b45f7[_0x61af('0x46')],{'$or':_[_0x61af('0x3a')](_0x1323c9,function(_0x213a8f){if(_0x213a8f[_0x61af('0x39')]!==_0x61af('0x47')){var _0x2315ec={};_0x2315ec[_0x213a8f[_0x61af('0x34')]]={'$like':'%'+_0x58e4b8['query'][_0x61af('0x48')]+'%'};return _0x2315ec;}})});}_0x2b45f7=_[_0x61af('0x45')]({},_0x2b45f7,_0x58e4b8[_0x61af('0x49')]);var _0x2a9dd9={'where':_0x2b45f7[_0x61af('0x46')]};return db[_0x61af('0x38')][_0x61af('0x2a')](_0x2a9dd9)[_0x61af('0x2f')](function(_0x342c19){_0x3f1bea[_0x61af('0x2a')]=_0x342c19;if(_0x58e4b8[_0x61af('0x3b')][_0x61af('0x4a')]){_0x2b45f7[_0x61af('0x4b')]=[{'all':!![]}];}return db[_0x61af('0x38')][_0x61af('0x4c')](_0x2b45f7);})[_0x61af('0x2f')](function(_0x565dad){_0x3f1bea[_0x61af('0x4d')]=_0x565dad;return _0x3f1bea;})[_0x61af('0x2f')](respondWithFilteredResult(_0x50f44b,_0x2b45f7))[_0x61af('0x23')](handleError(_0x50f44b,null));};exports[_0x61af('0x4e')]=function(_0xc30d69,_0xf25c75){var _0x37d4d8={'raw':![],'where':{'id':_0xc30d69['params']['id']},'include':[{'model':db[_0x61af('0x36')],'as':_0x61af('0x37')}]},_0x20420c={};_0x20420c['model']=_['keys'](db[_0x61af('0x38')][_0x61af('0x4f')]);_0x20420c[_0x61af('0x3b')]=_[_0x61af('0x50')](_0xc30d69['query']);_0x20420c[_0x61af('0x3c')]=_[_0x61af('0x3d')](_0x20420c['model'],_0x20420c[_0x61af('0x3b')]);_0x37d4d8[_0x61af('0x3f')]=_[_0x61af('0x3d')](_0x20420c['model'],qs[_0x61af('0x40')](_0xc30d69[_0x61af('0x3b')][_0x61af('0x40')]));_0x37d4d8[_0x61af('0x3f')]=_0x37d4d8[_0x61af('0x3f')]['length']?_0x37d4d8['attributes']:_0x20420c[_0x61af('0x3e')];if(_0xc30d69[_0x61af('0x3b')][_0x61af('0x4a')]){_0x37d4d8[_0x61af('0x4b')]=[{'all':!![]}];}_0x37d4d8=_['merge']({},_0x37d4d8,_0xc30d69['options']);return db[_0x61af('0x38')]['find'](_0x37d4d8)['then'](handleEntityNotFound(_0xf25c75,null))[_0x61af('0x2f')](respondWithResult(_0xf25c75,null))[_0x61af('0x23')](handleError(_0xf25c75,null));};exports[_0x61af('0x51')]=function(_0x2c0eb3,_0x297b89){return db[_0x61af('0x38')][_0x61af('0x51')](_0x2c0eb3[_0x61af('0x52')],{})['then'](function(_0x5bc3a3){var _0x5301ae=_0x2c0eb3[_0x61af('0x53')][_0x61af('0x30')]({'plain':!![]});if(!_0x5301ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5301ae['role']===_0x61af('0x53')){var _0xebc70e=_0x5bc3a3['get']({'plain':!![]});var _0x2d9300=_0x61af('0x31');return db[_0x61af('0x54')]['find']({'where':{'name':_0x2d9300,'userProfileId':_0x5301ae[_0x61af('0x55')]},'raw':!![]})[_0x61af('0x2f')](function(_0x2a0cdd){if(_0x2a0cdd&&_0x2a0cdd[_0x61af('0x56')]===0x0){return db[_0x61af('0x32')][_0x61af('0x51')]({'name':_0xebc70e[_0x61af('0x34')],'resourceId':_0xebc70e['id'],'type':_0x2a0cdd[_0x61af('0x34')],'sectionId':_0x2a0cdd['id']},{})[_0x61af('0x2f')](function(){return _0x5bc3a3;});}else{return _0x5bc3a3;}})[_0x61af('0x23')](function(_0x35cd7a){logger[_0x61af('0x1e')](_0x61af('0x57'),_0x35cd7a);throw _0x35cd7a;});}return _0x5bc3a3;})['then'](respondWithResult(_0x297b89,0xc9))['catch'](handleError(_0x297b89,null));};exports[_0x61af('0x58')]=function(_0x120c4c,_0x81ece7){if(_0x120c4c[_0x61af('0x52')]['id']){delete _0x120c4c[_0x61af('0x52')]['id'];}return db['FaxAccount'][_0x61af('0x59')]({'where':{'id':_0x120c4c[_0x61af('0x5a')]['id']},'include':[{'model':db[_0x61af('0x36')],'as':_0x61af('0x37')}]})['then'](handleEntityNotFound(_0x81ece7,null))['then'](saveUpdates(_0x120c4c[_0x61af('0x52')],null))[_0x61af('0x2f')](respondWithResult(_0x81ece7,null))[_0x61af('0x23')](handleError(_0x81ece7,null));};exports[_0x61af('0x2e')]=function(_0x241d9a,_0x7eab50){return db[_0x61af('0x38')]['find']({'where':{'id':_0x241d9a[_0x61af('0x5a')]['id']}})[_0x61af('0x2f')](handleEntityNotFound(_0x7eab50,null))['then'](removeEntity(_0x7eab50,null))['catch'](handleError(_0x7eab50,null));};exports[_0x61af('0x5b')]=function(_0x466b2d,_0x4aa3fb){return db[_0x61af('0x38')][_0x61af('0x5b')]()[_0x61af('0x2f')](respondWithResult(_0x4aa3fb,null))[_0x61af('0x23')](handleError(_0x4aa3fb,null));};exports[_0x61af('0x5c')]=function(_0x3d887b,_0x82212f,_0x433ede){if(_0x3d887b[_0x61af('0x52')]['id']){delete _0x3d887b[_0x61af('0x52')]['id'];}return db[_0x61af('0x38')][_0x61af('0x59')]({'where':{'id':_0x3d887b[_0x61af('0x5a')]['id']}})[_0x61af('0x2f')](handleEntityNotFound(_0x82212f,null))[_0x61af('0x2f')](function(_0x5db513){if(_0x5db513){_0x3d887b['body']['FaxAccountId']=_0x5db513['id'];return db[_0x61af('0x5d')]['create'](_0x3d887b['body']);}})[_0x61af('0x2f')](respondWithResult(_0x82212f,null))[_0x61af('0x23')](handleError(_0x82212f,null));};exports[_0x61af('0x5e')]=function(_0x482bc0,_0x266b1e,_0x1f356c){var _0x2b8640={'raw':![],'where':{}};var _0x52e8e9={};var _0x3e8e68={'count':0x0,'rows':[]};return db['FaxAccount'][_0x61af('0x5f')]({'where':{'id':_0x482bc0[_0x61af('0x5a')]['id']}})[_0x61af('0x2f')](handleEntityNotFound(_0x266b1e,null))[_0x61af('0x2f')](function(_0x484fe1){if(_0x484fe1){_0x52e8e9[_0x61af('0x3e')]=_['keys'](db['Disposition'][_0x61af('0x4f')]);_0x52e8e9[_0x61af('0x3b')]=_['keys'](_0x482bc0[_0x61af('0x3b')]);_0x52e8e9[_0x61af('0x3c')]=_[_0x61af('0x3d')](_0x52e8e9[_0x61af('0x3e')],_0x52e8e9[_0x61af('0x3b')]);_0x2b8640[_0x61af('0x3f')]=_['intersection'](_0x52e8e9[_0x61af('0x3e')],qs[_0x61af('0x40')](_0x482bc0['query'][_0x61af('0x40')]));_0x2b8640[_0x61af('0x3f')]=_0x2b8640[_0x61af('0x3f')][_0x61af('0x60')]?_0x2b8640[_0x61af('0x3f')]:_0x52e8e9['model'];if(!_0x482bc0[_0x61af('0x3b')][_0x61af('0x41')]('nolimit')){_0x2b8640['limit']=qs[_0x61af('0x2b')](_0x482bc0['query'][_0x61af('0x2b')]);_0x2b8640[_0x61af('0x28')]=qs['offset'](_0x482bc0[_0x61af('0x3b')][_0x61af('0x28')]);}_0x2b8640['order']=qs[_0x61af('0x44')](_0x482bc0[_0x61af('0x3b')]['sort']);_0x2b8640[_0x61af('0x46')]=qs[_0x61af('0x3c')](_[_0x61af('0x61')](_0x482bc0[_0x61af('0x3b')],_0x52e8e9[_0x61af('0x3c')]));_0x2b8640[_0x61af('0x46')]['FaxAccountId']=_0x484fe1['id'];if(_0x482bc0['query'][_0x61af('0x48')]){_0x2b8640['where']=_[_0x61af('0x45')](_0x2b8640[_0x61af('0x46')],{'$or':_[_0x61af('0x3a')](_0x2b8640[_0x61af('0x3f')],function(_0x3a29c5){var _0x39c7e0={};_0x39c7e0[_0x3a29c5]={'$like':'%'+_0x482bc0[_0x61af('0x3b')][_0x61af('0x48')]+'%'};return _0x39c7e0;})});}_0x2b8640=_[_0x61af('0x45')]({},_0x2b8640,_0x482bc0[_0x61af('0x49')]);return db['Disposition']['count']({'where':_0x2b8640[_0x61af('0x46')]})['then'](function(_0x3c0ac8){_0x3e8e68[_0x61af('0x2a')]=_0x3c0ac8;if(_0x482bc0[_0x61af('0x3b')][_0x61af('0x4a')]){_0x2b8640[_0x61af('0x4b')]=[{'all':!![]}];}return db[_0x61af('0x5d')][_0x61af('0x4c')](_0x2b8640);})['then'](function(_0x33f933){_0x3e8e68['rows']=_0x33f933;return _0x3e8e68;});}})['then'](respondWithFilteredResult(_0x266b1e,_0x2b8640))[_0x61af('0x23')](handleError(_0x266b1e,null));};exports[_0x61af('0x62')]=function(_0x43dcb5,_0x31b7b9,_0x2375c0){return db[_0x61af('0x38')]['find']({'where':{'id':_0x43dcb5[_0x61af('0x5a')]['id']}})[_0x61af('0x2f')](handleEntityNotFound(_0x31b7b9,null))[_0x61af('0x2f')](function(_0xc83e87){if(_0xc83e87){return _0xc83e87[_0x61af('0x62')](_0x43dcb5[_0x61af('0x3b')][_0x61af('0x63')]);}})[_0x61af('0x2f')](respondWithStatusCode(_0x31b7b9,null))[_0x61af('0x23')](handleError(_0x31b7b9,null));};exports[_0x61af('0x64')]=function(_0x36042d,_0x2567b4,_0x22348c){if(_0x36042d[_0x61af('0x52')]['id']){delete _0x36042d[_0x61af('0x52')]['id'];}return db[_0x61af('0x38')][_0x61af('0x59')]({'where':{'id':_0x36042d['params']['id']}})[_0x61af('0x2f')](handleEntityNotFound(_0x2567b4,null))[_0x61af('0x2f')](function(_0x64f5d0){if(_0x64f5d0){_0x36042d['body'][_0x61af('0x65')]=_0x64f5d0['id'];return db[_0x61af('0x66')][_0x61af('0x51')](_0x36042d[_0x61af('0x52')]);}})[_0x61af('0x2f')](respondWithResult(_0x2567b4,null))[_0x61af('0x23')](handleError(_0x2567b4,null));};exports[_0x61af('0x67')]=function(_0x3e1205,_0x2f7df0,_0x2fb1c2){var _0x20c273={'raw':![],'where':{}};var _0x5246c5={};var _0x9bd730={'count':0x0,'rows':[]};return db[_0x61af('0x38')][_0x61af('0x5f')]({'where':{'id':_0x3e1205[_0x61af('0x5a')]['id']}})[_0x61af('0x2f')](handleEntityNotFound(_0x2f7df0,null))['then'](function(_0x1e9acc){if(_0x1e9acc){_0x5246c5['model']=_['keys'](db['CannedAnswer'][_0x61af('0x4f')]);_0x5246c5[_0x61af('0x3b')]=_[_0x61af('0x50')](_0x3e1205[_0x61af('0x3b')]);_0x5246c5[_0x61af('0x3c')]=_[_0x61af('0x3d')](_0x5246c5[_0x61af('0x3e')],_0x5246c5[_0x61af('0x3b')]);_0x20c273[_0x61af('0x3f')]=_[_0x61af('0x3d')](_0x5246c5['model'],qs[_0x61af('0x40')](_0x3e1205[_0x61af('0x3b')]['fields']));_0x20c273[_0x61af('0x3f')]=_0x20c273[_0x61af('0x3f')][_0x61af('0x60')]?_0x20c273[_0x61af('0x3f')]:_0x5246c5['model'];if(!_0x3e1205[_0x61af('0x3b')][_0x61af('0x41')]('nolimit')){_0x20c273['limit']=qs[_0x61af('0x2b')](_0x3e1205[_0x61af('0x3b')][_0x61af('0x2b')]);_0x20c273[_0x61af('0x28')]=qs[_0x61af('0x28')](_0x3e1205[_0x61af('0x3b')]['offset']);}_0x20c273['order']=qs[_0x61af('0x44')](_0x3e1205[_0x61af('0x3b')][_0x61af('0x44')]);_0x20c273[_0x61af('0x46')]=qs[_0x61af('0x3c')](_['pick'](_0x3e1205[_0x61af('0x3b')],_0x5246c5[_0x61af('0x3c')]));_0x20c273[_0x61af('0x46')]['FaxAccountId']=_0x1e9acc['id'];if(_0x3e1205[_0x61af('0x3b')]['filter']){_0x20c273['where']=_['merge'](_0x20c273[_0x61af('0x46')],{'$or':_[_0x61af('0x3a')](_0x20c273[_0x61af('0x3f')],function(_0x52c853){var _0x34bfd3={};_0x34bfd3[_0x52c853]={'$like':'%'+_0x3e1205['query']['filter']+'%'};return _0x34bfd3;})});}_0x20c273=_['merge']({},_0x20c273,_0x3e1205[_0x61af('0x49')]);return db[_0x61af('0x66')][_0x61af('0x2a')]({'where':_0x20c273[_0x61af('0x46')]})[_0x61af('0x2f')](function(_0x24b11c){_0x9bd730[_0x61af('0x2a')]=_0x24b11c;if(_0x3e1205[_0x61af('0x3b')][_0x61af('0x4a')]){_0x20c273[_0x61af('0x4b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x61af('0x4c')](_0x20c273);})['then'](function(_0x5292e3){_0x9bd730[_0x61af('0x4d')]=_0x5292e3;return _0x9bd730;});}})[_0x61af('0x2f')](respondWithFilteredResult(_0x2f7df0,_0x20c273))[_0x61af('0x23')](handleError(_0x2f7df0,null));};exports[_0x61af('0x68')]=function(_0x170526,_0x148084,_0x39c5b3){return db['FaxAccount']['find']({'where':{'id':_0x170526[_0x61af('0x5a')]['id']}})[_0x61af('0x2f')](handleEntityNotFound(_0x148084,null))[_0x61af('0x2f')](function(_0x5962e9){if(_0x5962e9){return _0x5962e9[_0x61af('0x68')](_0x170526[_0x61af('0x3b')][_0x61af('0x63')]);}})[_0x61af('0x2f')](respondWithStatusCode(_0x148084,null))[_0x61af('0x23')](handleError(_0x148084,null));};exports['addInteraction']=function(_0x5735d1,_0x3d66fb,_0x360eca){return db[_0x61af('0x69')]['find']({'where':{'id':_0x5735d1[_0x61af('0x5a')]['id']}})[_0x61af('0x2f')](handleEntityNotFound(_0x3d66fb,null))['then'](function(_0x1c5fd9){if(_0x1c5fd9){return _0x1c5fd9['addInteraction'](_0x5735d1[_0x61af('0x52')][_0x61af('0x63')],_[_0x61af('0x6a')](_0x5735d1[_0x61af('0x52')],[_0x61af('0x63'),'id'])||{});}})[_0x61af('0x2f')](respondWithResult(_0x3d66fb,null))[_0x61af('0x23')](handleError(_0x3d66fb,null));};exports['getInteractions']=function(_0x5a7c2a,_0x238ae0,_0xbee4d5){var _0x1c58f8={'raw':![],'where':{}};var _0x2a3a8f={};var _0x136b3b={'count':0x0,'rows':[]};return db[_0x61af('0x38')][_0x61af('0x5f')]({'where':{'id':_0x5a7c2a[_0x61af('0x5a')]['id']}})[_0x61af('0x2f')](handleEntityNotFound(_0x238ae0,null))[_0x61af('0x2f')](function(_0x1399dd){if(_0x1399dd){_0x2a3a8f[_0x61af('0x3e')]=_[_0x61af('0x50')](db[_0x61af('0x69')][_0x61af('0x4f')]);_0x2a3a8f[_0x61af('0x3b')]=_['keys'](_0x5a7c2a[_0x61af('0x3b')]);_0x2a3a8f['filters']=_[_0x61af('0x3d')](_0x2a3a8f[_0x61af('0x3e')],_0x2a3a8f[_0x61af('0x3b')]);_0x1c58f8[_0x61af('0x3f')]=_['intersection'](_0x2a3a8f['model'],qs[_0x61af('0x40')](_0x5a7c2a[_0x61af('0x3b')][_0x61af('0x40')]));_0x1c58f8[_0x61af('0x3f')]=_0x1c58f8[_0x61af('0x3f')][_0x61af('0x60')]?_0x1c58f8[_0x61af('0x3f')]:_0x2a3a8f[_0x61af('0x3e')];if(!_0x5a7c2a['query'][_0x61af('0x41')](_0x61af('0x42'))){_0x1c58f8[_0x61af('0x2b')]=qs[_0x61af('0x2b')](_0x5a7c2a[_0x61af('0x3b')][_0x61af('0x2b')]);_0x1c58f8[_0x61af('0x28')]=qs[_0x61af('0x28')](_0x5a7c2a[_0x61af('0x3b')]['offset']);}_0x1c58f8[_0x61af('0x43')]=qs[_0x61af('0x44')](_0x5a7c2a[_0x61af('0x3b')]['sort']);_0x1c58f8[_0x61af('0x46')]=qs[_0x61af('0x3c')](_[_0x61af('0x61')](_0x5a7c2a[_0x61af('0x3b')],_0x2a3a8f[_0x61af('0x3c')]));_0x1c58f8[_0x61af('0x46')][_0x61af('0x65')]=_0x1399dd['id'];if(_0x5a7c2a[_0x61af('0x3b')]['filter']){_0x1c58f8[_0x61af('0x46')]=_[_0x61af('0x45')](_0x1c58f8[_0x61af('0x46')],{'$or':_[_0x61af('0x3a')](_0x1c58f8[_0x61af('0x3f')],function(_0x1c13c1){var _0x35f979={};_0x35f979[_0x1c13c1]={'$like':'%'+_0x5a7c2a[_0x61af('0x3b')][_0x61af('0x48')]+'%'};return _0x35f979;})});}_0x1c58f8=_[_0x61af('0x45')]({},_0x1c58f8,_0x5a7c2a['options']);return db[_0x61af('0x69')][_0x61af('0x2a')]({'where':_0x1c58f8[_0x61af('0x46')]})['then'](function(_0x15724a){_0x136b3b[_0x61af('0x2a')]=_0x15724a;if(_0x5a7c2a['query'][_0x61af('0x4a')]){_0x1c58f8[_0x61af('0x4b')]=[{'model':db[_0x61af('0x6b')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x61af('0x6c'),'attributes':[_0x61af('0x34'),_0x61af('0x6d'),_0x61af('0x6e')],'required':![]},{'model':db[_0x61af('0x6f')],'as':_0x61af('0x70'),'attributes':['id',_0x61af('0x34'),_0x61af('0x71')],'where':_0x5a7c2a[_0x61af('0x3b')][_0x61af('0x72')]?{'id':_0x5a7c2a[_0x61af('0x3b')][_0x61af('0x72')]}:undefined,'required':_0x5a7c2a[_0x61af('0x3b')][_0x61af('0x72')]?!![]:![]}];}return db['FaxInteraction'][_0x61af('0x4c')](_0x1c58f8);})['then'](function(_0x53daa0){_0x136b3b[_0x61af('0x4d')]=_0x53daa0;return _0x136b3b;});}})[_0x61af('0x2f')](respondWithFilteredResult(_0x238ae0,_0x1c58f8))[_0x61af('0x23')](handleError(_0x238ae0,null));};exports[_0x61af('0x73')]=function(_0x1c2f0a,_0x24ecc9){var _0xda3349=_0x1c2f0a[_0x61af('0x5a')]['id'];var _0x22e0b2=_0x1c2f0a[_0x61af('0x52')];var _0x32c88f=0xc8;var _0x2b54d7=null;return db[_0x61af('0x74')][_0x61af('0x75')]({'isolationLevel':db['sequelize'][_0x61af('0x76')][_0x61af('0x77')][_0x61af('0x78')]},function(_0x1599b5){return db['FaxAccount']['findOne']({'where':{'id':_0xda3349},'transaction':_0x1599b5})[_0x61af('0x2f')](function(_0x4bdc7b){if(_0x4bdc7b){return db[_0x61af('0x79')]['destroy']({'where':{'FaxAccountId':_0xda3349},'transaction':_0x1599b5})[_0x61af('0x2f')](function(){var _0x1df60e=_[_0x61af('0x3a')](_0x22e0b2,function(_0x1e127f){_0x1e127f['FaxAccountId']=_0xda3349;return _0x1e127f;});return db[_0x61af('0x79')][_0x61af('0x7a')](_0x1df60e,{'transaction':_0x1599b5});});}else{_0x32c88f=0x194;_0x2b54d7=[];}});})[_0x61af('0x2f')](function(){if(_0x32c88f!==0x194){return db[_0x61af('0x79')][_0x61af('0x7b')]({'where':{'FaxAccountId':_0xda3349},'order':_0x61af('0x7c')})[_0x61af('0x2f')](function(_0x90307f){_0x2b54d7=_0x90307f;});}})[_0x61af('0x23')](function(_0x50bf29){_0x32c88f=0x1f4;logger['error'](_0x50bf29[_0x61af('0x33')]);if(_0x50bf29[_0x61af('0x34')]){delete _0x50bf29[_0x61af('0x34')];}_0x2b54d7=_0x50bf29;})[_0x61af('0x7d')](function(){if(_0x2b54d7===null){_0x24ecc9[_0x61af('0x24')](_0x32c88f);}else{if(_0x32c88f===0x1f4){_0x24ecc9[_0x61af('0x26')](_0x32c88f)['send'](_0x2b54d7);}else{_0x24ecc9[_0x61af('0x26')](_0x32c88f)[_0x61af('0x27')](_0x2b54d7);}}});};exports[_0x61af('0x7e')]=function(_0x15c74f,_0x16b69a,_0x19c049){var _0x454e95={};var _0x2477ee={};var _0x1edfb9;var _0x4f9ca3;return db['FaxAccount'][_0x61af('0x5f')]({'where':{'id':_0x15c74f[_0x61af('0x5a')]['id']}})[_0x61af('0x2f')](handleEntityNotFound(_0x16b69a,null))[_0x61af('0x2f')](function(_0x4f0015){if(_0x4f0015){_0x1edfb9=_0x4f0015;_0x2477ee['model']=_[_0x61af('0x50')](db[_0x61af('0x79')]['rawAttributes']);_0x2477ee[_0x61af('0x3b')]=_[_0x61af('0x50')](_0x15c74f[_0x61af('0x3b')]);_0x2477ee[_0x61af('0x3c')]=_[_0x61af('0x3d')](_0x2477ee[_0x61af('0x3e')],_0x2477ee[_0x61af('0x3b')]);_0x454e95['attributes']=_[_0x61af('0x3d')](_0x2477ee[_0x61af('0x3e')],qs['fields'](_0x15c74f[_0x61af('0x3b')][_0x61af('0x40')]));_0x454e95[_0x61af('0x3f')]=_0x454e95[_0x61af('0x3f')][_0x61af('0x60')]?_0x454e95['attributes']:_0x2477ee[_0x61af('0x3e')];_0x454e95[_0x61af('0x43')]=qs['sort'](_0x15c74f[_0x61af('0x3b')][_0x61af('0x44')]);_0x454e95[_0x61af('0x46')]=qs['filters'](_['pick'](_0x15c74f[_0x61af('0x3b')],_0x2477ee[_0x61af('0x3c')]));if(_0x15c74f[_0x61af('0x3b')][_0x61af('0x48')]){_0x454e95[_0x61af('0x46')]=_[_0x61af('0x45')](_0x454e95[_0x61af('0x46')],{'$or':_[_0x61af('0x3a')](_0x454e95[_0x61af('0x3f')],function(_0x2db1c0){var _0x17b1af={};_0x17b1af[_0x2db1c0]={'$like':'%'+_0x15c74f[_0x61af('0x3b')][_0x61af('0x48')]+'%'};return _0x17b1af;})});}_0x454e95=_[_0x61af('0x45')]({},_0x454e95,_0x15c74f[_0x61af('0x49')]);return _0x1edfb9['getApplications'](_0x454e95);}})[_0x61af('0x2f')](function(_0x5cb527){if(_0x5cb527){_0x4f9ca3=_0x5cb527[_0x61af('0x60')];if(!_0x15c74f[_0x61af('0x3b')][_0x61af('0x41')]('nolimit')){_0x454e95[_0x61af('0x2b')]=qs[_0x61af('0x2b')](_0x15c74f[_0x61af('0x3b')]['limit']);_0x454e95[_0x61af('0x28')]=qs[_0x61af('0x28')](_0x15c74f['query'][_0x61af('0x28')]);}return _0x1edfb9['getApplications'](_0x454e95);}})[_0x61af('0x2f')](function(_0x282676){if(_0x282676){return _0x282676?{'count':_0x4f9ca3,'rows':_0x282676}:null;}})[_0x61af('0x2f')](respondWithResult(_0x16b69a,null))[_0x61af('0x23')](handleError(_0x16b69a,null));};function Extension(_0x1ef5bf,_0x1a6683,_0x44609d,_0x15f8a3){this[_0x61af('0x7f')]=_0x61af('0x80');this[_0x61af('0x81')]=_0x1ef5bf[_0x61af('0x82')];this[_0x61af('0x83')]=_0x15f8a3;this[_0x61af('0x39')]=_0x61af('0x84');this[_0x61af('0x85')]=_0x61af('0x86');this[_0x61af('0x65')]=_0x1ef5bf['id'];this[_0x61af('0x7c')]=_0x1a6683;this['appdata']=_0x44609d;}function createExtensionsReciveFax(_0x409f20){var _0xe323d1=0x1;var _0x29bd58=[];_0x29bd58['push'](new Extension(_0x409f20,_0xe323d1,'','Answer'));_0xe323d1+=0x1;_0x29bd58[_0x61af('0x87')](new Extension(_0x409f20,_0xe323d1,_0x61af('0x88'),_0x61af('0x89')));_0xe323d1+=0x1;for(var _0x4326f9 in _0x409f20){if(_0x409f20['hasOwnProperty'](_0x4326f9)&&(_0x4326f9===_0x61af('0x8a')||_0x4326f9==='localstationid'||_0x4326f9===_0x61af('0x8b')||_0x4326f9===_0x61af('0x8c')||_0x4326f9===_0x61af('0x8d')||_0x4326f9===_0x61af('0x8e')||_0x4326f9===_0x61af('0x8f')||_0x4326f9===_0x61af('0x90')||_0x4326f9==='t38timeout')){_0x29bd58[_0x61af('0x87')](new Extension(_0x409f20,_0xe323d1,_0x61af('0x91')+_0x4326f9+')='+_0x409f20[_0x4326f9],_0x61af('0x89')));_0xe323d1+=0x1;}}_0x29bd58['push'](new Extension(_0x409f20,_0xe323d1,'6','Wait'));_0xe323d1+=0x1;_0x29bd58[_0x61af('0x87')](new Extension(_0x409f20,_0xe323d1,_0x61af('0x92'),'ReceiveFax'));_0xe323d1=0x0;return _0x29bd58;}exports[_0x61af('0x93')]=function(_0x1f5025,_0x4750f5,_0x1cb812){var _0x110241;return db[_0x61af('0x74')][_0x61af('0x75')](function(_0x16489a){return db[_0x61af('0x38')][_0x61af('0x51')](_0x1f5025[_0x61af('0x52')],{'transaction':_0x16489a})[_0x61af('0x2f')](function(_0xcd1724){_0x110241=_0xcd1724[_0x61af('0x30')]({'plain':!![]});return db[_0x61af('0x94')][_0x61af('0x7a')](createExtensionsReciveFax(_0x110241),{'transaction':_0x16489a});});})[_0x61af('0x2f')](function(){return _0x110241;})['then'](respondWithResult(_0x4750f5,null))[_0x61af('0x23')](handleError(_0x4750f5,null));};exports[_0x61af('0x95')]=function(_0x333b6c,_0x36ee73,_0x1d21cc){var _0x2119d0;return db[_0x61af('0x74')][_0x61af('0x75')](function(_0x5c3a2a){return db[_0x61af('0x38')][_0x61af('0x58')](_0x333b6c[_0x61af('0x52')],{'where':{'id':_0x333b6c[_0x61af('0x52')]['id']},'transaction':_0x5c3a2a})[_0x61af('0x2f')](function(_0x160bca){return db[_0x61af('0x94')]['destroy']({'where':{'FaxAccountId':_0x333b6c[_0x61af('0x52')]['id']},'transaction':_0x5c3a2a})[_0x61af('0x2f')](function(_0x83f933){return db[_0x61af('0x94')][_0x61af('0x7a')](createExtensionsReciveFax(_[_0x61af('0x6a')](_0x333b6c[_0x61af('0x52')],['tech',_0x61af('0x96'),_0x61af('0x97'),_0x61af('0x98'),_0x61af('0x99'),_0x61af('0x9a')])),{'transaction':_0x5c3a2a});});});})['then'](function(){return db[_0x61af('0x38')][_0x61af('0x9b')](_0x333b6c[_0x61af('0x52')]['id']);})[_0x61af('0x2f')](respondWithResult(_0x36ee73,null))[_0x61af('0x23')](handleError(_0x36ee73,null));};exports[_0x61af('0x9c')]=function(_0x5e0fa6,_0x246670,_0x45bf94){var _0x2448d1={'raw':!![],'where':{}};var _0x3413ec={};var _0x10e67c={'count':0x0,'rows':[]};return db[_0x61af('0x38')][_0x61af('0x5f')]({'where':{'id':_0x5e0fa6[_0x61af('0x5a')]['id']}})['then'](handleEntityNotFound(_0x246670,null))[_0x61af('0x2f')](function(_0x366e8a){if(_0x366e8a){_0x3413ec['model']=_['keys'](db[_0x61af('0x9d')][_0x61af('0x4f')]);_0x3413ec[_0x61af('0x3b')]=_[_0x61af('0x50')](_0x5e0fa6['query']);_0x3413ec[_0x61af('0x3c')]=_[_0x61af('0x3d')](_0x3413ec['model'],_0x3413ec['query']);_0x2448d1[_0x61af('0x3f')]=_[_0x61af('0x3d')](_0x3413ec[_0x61af('0x3e')],qs[_0x61af('0x40')](_0x5e0fa6[_0x61af('0x3b')][_0x61af('0x40')]));_0x2448d1[_0x61af('0x3f')]=_0x2448d1['attributes']['length']?_0x2448d1[_0x61af('0x3f')]:_0x3413ec[_0x61af('0x3e')];if(!_0x5e0fa6['query'][_0x61af('0x41')](_0x61af('0x42'))){_0x2448d1[_0x61af('0x2b')]=qs[_0x61af('0x2b')](_0x5e0fa6['query'][_0x61af('0x2b')]);_0x2448d1[_0x61af('0x28')]=qs['offset'](_0x5e0fa6[_0x61af('0x3b')]['offset']);}_0x2448d1['order']=qs[_0x61af('0x44')](_0x5e0fa6[_0x61af('0x3b')][_0x61af('0x44')]);_0x2448d1[_0x61af('0x46')]=qs[_0x61af('0x3c')](_[_0x61af('0x61')](_0x5e0fa6['query'],_0x3413ec[_0x61af('0x3c')]));_0x2448d1[_0x61af('0x46')][_0x61af('0x65')]=_0x366e8a['id'];if(_0x5e0fa6[_0x61af('0x3b')][_0x61af('0x48')]){_0x2448d1['where']=_[_0x61af('0x45')](_0x2448d1[_0x61af('0x46')],{'$or':_['map'](_0x2448d1[_0x61af('0x3f')],function(_0x36e2a0){var _0x4eb05b={};_0x4eb05b[_0x36e2a0]={'$like':'%'+_0x5e0fa6[_0x61af('0x3b')]['filter']+'%'};return _0x4eb05b;})});}if(_0x5e0fa6[_0x61af('0x3b')]['$gte']){var _0x392aa4=_0x5e0fa6[_0x61af('0x3b')][_0x61af('0x9e')]['split'](',');var _0x4fe96b={};_0x4fe96b[_0x392aa4[0x0]]={'$gte':moment(_0x392aa4[0x1])[_0x61af('0x9f')](_0x61af('0xa0'))};_0x2448d1[_0x61af('0x46')]=_['merge'](_0x2448d1[_0x61af('0x46')],_0x4fe96b);}_0x2448d1=_['merge']({},_0x2448d1,_0x5e0fa6[_0x61af('0x49')]);return db[_0x61af('0x9d')][_0x61af('0x2a')]({'where':_0x2448d1[_0x61af('0x46')]})[_0x61af('0x2f')](function(_0xd36854){_0x10e67c[_0x61af('0x2a')]=_0xd36854;if(_0x5e0fa6[_0x61af('0x3b')][_0x61af('0x4a')]){_0x2448d1[_0x61af('0x4b')]=[{'all':!![]}];}return db[_0x61af('0x9d')][_0x61af('0x4c')](_0x2448d1);})[_0x61af('0x2f')](function(_0x357645){_0x10e67c['rows']=_0x357645;return _0x10e67c;});}})[_0x61af('0x2f')](respondWithFilteredResult(_0x246670,_0x2448d1))['catch'](handleError(_0x246670,null));};exports['send']=function(_0x4ba123,_0x5a7a54,_0x4df915){var _0x36d53e,_0x2cd24c={},_0x5e249a;if(_0x4ba123[_0x61af('0x52')]['to']){_0x5e249a=_0x4ba123[_0x61af('0x52')]['to'][0x0];}return db[_0x61af('0x38')][_0x61af('0x59')]({'where':{'id':_0x4ba123[_0x61af('0x5a')]['id']},'include':[{'model':db[_0x61af('0xa1')],'as':_0x61af('0xa2'),'include':[{'model':db[_0x61af('0x6b')],'as':_0x61af('0xa3'),'where':{'fax':_0x5e249a},'limit':0x1,'order':[[_0x61af('0x98'),'DESC']]}]}]})[_0x61af('0x2f')](handleEntityNotFound(_0x5a7a54,null))['then'](function(_0x2aaa98){_0x36d53e=_0x2aaa98;if(_0x4ba123[_0x61af('0x52')]['attachments']&&_0x4ba123[_0x61af('0x52')][_0x61af('0xa4')]['length']){for(var _0x553399=0x0;_0x553399<_0x4ba123[_0x61af('0x52')][_0x61af('0xa4')]['length'];_0x553399+=0x1){_0x4ba123['body']['attachments'][_0x553399]={'filename':_0x4ba123[_0x61af('0x52')][_0x61af('0xa4')][_0x553399][_0x61af('0x34')],'id':_0x4ba123[_0x61af('0x52')][_0x61af('0xa4')][_0x553399]['id'],'path':path['join'](config['root'],_0x61af('0xa5'),_0x4ba123[_0x61af('0x52')][_0x61af('0xa4')][_0x553399][_0x61af('0xa6')])};}}return respondWithRpcPromise(_0x61af('0xa7'),_0x61af('0xa7'),{'FaxAccountId':_[_0x61af('0xa8')](_0x4ba123['params']['id'])?undefined:_0x4ba123['params']['id'],'path':_[_0x61af('0xa8')](_0x4ba123['body'][_0x61af('0xa4')][0x0][_0x61af('0xa9')])?undefined:_0x4ba123[_0x61af('0x52')][_0x61af('0xa4')][0x0][_0x61af('0xa9')],'fax':_['isNil'](_0x4ba123['body']['to'][0x0])?undefined:_0x4ba123['body']['to'][0x0]},client9002);})[_0x61af('0x2f')](function(){if(_0x36d53e){if(_[_0x61af('0xa8')](_0x4ba123[_0x61af('0x52')][_0x61af('0xaa')])){_0x4ba123[_0x61af('0x52')][_0x61af('0xaa')]=util[_0x61af('0x9f')](_0x61af('0xab'),_0x36d53e[_0x61af('0x34')],_0x36d53e[_0x61af('0xac')]);}if(_0x36d53e[_0x61af('0xa2')]){if(_0x36d53e[_0x61af('0xa2')]['Contacts'][_0x61af('0x60')]){return _0x36d53e[_0x61af('0xa2')][_0x61af('0xa3')][0x0];}else{return db[_0x61af('0x6b')][_0x61af('0x51')](_[_0x61af('0xad')](_0x4ba123[_0x61af('0x52')],{'firstName':_0x4ba123[_0x61af('0x52')]['to'][0x0],'phone':_0x4ba123['body']['to'][0x0],'fax':_0x4ba123[_0x61af('0x52')]['to'][0x0],'ListId':_0x36d53e[_0x61af('0x9a')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x61af('0xae'));}})[_0x61af('0x2f')](function(_0x48e493){if(_0x48e493){return db[_0x61af('0x69')][_0x61af('0x59')]({'where':{'ContactId':_0x48e493['id'],'closed':![],'FaxAccountId':_0x36d53e['id']}})[_0x61af('0x2f')](function(_0x27bc73){if(_0x27bc73){return[_0x27bc73,![]];}return db[_0x61af('0x69')]['create']({'UserId':_0x4ba123[_0x61af('0x53')]['id'],'ContactId':_0x48e493['id'],'FaxAccountId':_0x36d53e['id'],'fax':_0x4ba123[_0x61af('0x52')]['to'][0x0],'firstMsgDirection':_0x61af('0xaf'),'Messages':[_[_0x61af('0x45')](_0x4ba123[_0x61af('0x52')],{'read':![],'body':_0x4ba123[_0x61af('0x52')][_0x61af('0xa4')][0x0][_0x61af('0xb0')],'FaxAccountId':_0x36d53e['id'],'UserId':_0x4ba123[_0x61af('0x53')]['id'],'ContactId':_0x48e493['id'],'AttachmentId':_0x4ba123[_0x61af('0x52')][_0x61af('0xa4')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x61af('0xb1')}]})[_0x61af('0x2f')](function(_0x303cd5){return[_0x303cd5,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x61af('0xb2')](function(_0x5247ec,_0x10d552){if(_0x10d552){return _0x5247ec;}return db[_0x61af('0x9d')][_0x61af('0x51')]({'direction':_0x61af('0xaf'),'read':![],'body':_0x4ba123[_0x61af('0x52')][_0x61af('0xa4')][0x0][_0x61af('0xb0')],'FaxAccountId':_0x36d53e['id'],'FaxInteractionId':_0x5247ec['id'],'UserId':_0x4ba123[_0x61af('0x53')]['id'],'ContactId':_0x5247ec[_0x61af('0xb3')],'AttachmentId':_0x4ba123[_0x61af('0x52')]['attachments'][0x0]['id']})['then'](function(_0x790478){_0x5247ec[_0x61af('0xb4')][_0x61af('0xb1')]=[];_0x5247ec[_0x61af('0xb4')][_0x61af('0xb1')][_0x61af('0x87')](_0x790478[_0x61af('0xb4')]);return _0x5247ec;});})[_0x61af('0x2f')](function(_0x1abe0e){respondWithRpcPromise(_0x61af('0xb5'),'SendFax',{'FaxAccountId':_[_0x61af('0xa8')](_0x4ba123['params']['id'])?undefined:_0x4ba123[_0x61af('0x5a')]['id'],'path':_[_0x61af('0xa8')](_0x4ba123[_0x61af('0x52')][_0x61af('0xa4')][0x0]['path'])?undefined:_0x4ba123[_0x61af('0x52')][_0x61af('0xa4')][0x0][_0x61af('0xa9')],'fax':_[_0x61af('0xa8')](_0x4ba123[_0x61af('0x52')]['to'][0x0])?undefined:_0x4ba123[_0x61af('0x52')]['to'][0x0],'AttachmentId':_0x4ba123[_0x61af('0x52')][_0x61af('0xa4')][0x0]['id']},client9002)[_0x61af('0x2f')](function(_0x4d2787){logger[_0x61af('0x21')](_0x61af('0xb6'),_0x4d2787);})[_0x61af('0x23')](function(_0x450ccd){logger[_0x61af('0x21')](_0x61af('0xb6'),_0x450ccd);});return _0x1abe0e;})[_0x61af('0x2f')](respondWithResult(_0x5a7a54,null))[_0x61af('0x23')](handleError(_0x5a7a54,null));};exports[_0x61af('0xb7')]=function(_0x4000fd,_0x4a6807,_0x1738d7){return db['FaxAccount']['find']({'where':{'id':_0x4000fd[_0x61af('0x5a')]['id']}})[_0x61af('0x2f')](handleEntityNotFound(_0x4a6807,null))[_0x61af('0x2f')](function(_0x2939d2){if(_0x2939d2){return _0x2939d2[_0x61af('0xb7')](_0x4000fd[_0x61af('0x52')][_0x61af('0x63')],_[_0x61af('0x6a')](_0x4000fd[_0x61af('0x52')],[_0x61af('0x63'),'id'])||{})[_0x61af('0xb2')](function(_0x53bdcc){for(var _0x4215b6=0x0;_0x4215b6<_0x4000fd[_0x61af('0x52')]['ids'][_0x61af('0x60')];_0x4215b6+=0x1){socket[_0x61af('0xb8')](_0x61af('0xb9'),{'UserId':Number(_0x4000fd[_0x61af('0x52')][_0x61af('0x63')][_0x4215b6]),'FaxAccountId':Number(_0x4000fd[_0x61af('0x5a')]['id'])});}return _0x53bdcc;});}})[_0x61af('0x2f')](respondWithResult(_0x4a6807,null))[_0x61af('0x23')](handleError(_0x4a6807,null));};exports[_0x61af('0xba')]=function(_0x15b9df,_0x5a3613,_0x45c0ab){return db[_0x61af('0x38')][_0x61af('0x59')]({'where':{'id':_0x15b9df[_0x61af('0x5a')]['id']}})[_0x61af('0x2f')](handleEntityNotFound(_0x5a3613,null))[_0x61af('0x2f')](function(_0x4f6fa4){if(_0x4f6fa4){return _0x4f6fa4[_0x61af('0xba')](_0x15b9df['query'][_0x61af('0x63')])[_0x61af('0x2f')](function(){if(_[_0x61af('0xbb')](_0x15b9df[_0x61af('0x3b')][_0x61af('0x63')])){for(var _0x14e502=0x0;_0x14e502<_0x15b9df['query'][_0x61af('0x63')][_0x61af('0x60')];_0x14e502+=0x1){socket[_0x61af('0xb8')](_0x61af('0xbc'),{'UserId':Number(_0x15b9df['query']['ids'][_0x14e502]),'FaxAccountId':Number(_0x15b9df['params']['id'])});}}else{socket['emit'](_0x61af('0xbc'),{'UserId':Number(_0x15b9df['query'][_0x61af('0x63')]),'FaxAccountId':Number(_0x15b9df[_0x61af('0x5a')]['id'])});}});}})[_0x61af('0x2f')](respondWithStatusCode(_0x5a3613,null))['catch'](handleError(_0x5a3613,null));};exports[_0x61af('0xbd')]=function(_0x1a9a2e,_0x4703ab,_0xd1546a){var _0x3dded6={};var _0x36337a={};var _0x4d5330;var _0x424472;return db[_0x61af('0x38')][_0x61af('0x5f')]({'where':{'id':_0x1a9a2e[_0x61af('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4703ab,null))[_0x61af('0x2f')](function(_0x3dbdba){if(_0x3dbdba){_0x4d5330=_0x3dbdba;_0x36337a['model']=_['keys'](db[_0x61af('0xbe')]['rawAttributes']);_0x36337a[_0x61af('0x3b')]=_[_0x61af('0x50')](_0x1a9a2e[_0x61af('0x3b')]);_0x36337a[_0x61af('0x3c')]=_[_0x61af('0x3d')](_0x36337a['model'],_0x36337a[_0x61af('0x3b')]);_0x3dded6[_0x61af('0x3f')]=_['intersection'](_0x36337a[_0x61af('0x3e')],qs['fields'](_0x1a9a2e[_0x61af('0x3b')][_0x61af('0x40')]));_0x3dded6[_0x61af('0x3f')]=_0x3dded6[_0x61af('0x3f')]['length']?_0x3dded6['attributes']:_0x36337a[_0x61af('0x3e')];_0x3dded6[_0x61af('0x43')]=qs[_0x61af('0x44')](_0x1a9a2e[_0x61af('0x3b')][_0x61af('0x44')]);_0x3dded6[_0x61af('0x46')]=qs[_0x61af('0x3c')](_[_0x61af('0x61')](_0x1a9a2e[_0x61af('0x3b')],_0x36337a[_0x61af('0x3c')]));if(_0x1a9a2e[_0x61af('0x3b')]['filter']){_0x3dded6[_0x61af('0x46')]=_[_0x61af('0x45')](_0x3dded6['where'],{'$or':_['map'](_0x3dded6[_0x61af('0x3f')],function(_0x3b825c){var _0x3addbc={};_0x3addbc[_0x3b825c]={'$like':'%'+_0x1a9a2e[_0x61af('0x3b')][_0x61af('0x48')]+'%'};return _0x3addbc;})});}_0x3dded6=_['merge']({},_0x3dded6,_0x1a9a2e[_0x61af('0x49')]);return _0x4d5330['getAgents'](_0x3dded6);}})[_0x61af('0x2f')](function(_0xa548e1){if(_0xa548e1){_0x424472=_0xa548e1[_0x61af('0x60')];if(!_0x1a9a2e[_0x61af('0x3b')]['hasOwnProperty'](_0x61af('0x42'))){_0x3dded6['limit']=qs['limit'](_0x1a9a2e[_0x61af('0x3b')]['limit']);_0x3dded6[_0x61af('0x28')]=qs[_0x61af('0x28')](_0x1a9a2e[_0x61af('0x3b')]['offset']);}return _0x4d5330[_0x61af('0xbd')](_0x3dded6);}})[_0x61af('0x2f')](function(_0x3ebc67){if(_0x3ebc67){return _0x3ebc67?{'count':_0x424472,'rows':_0x3ebc67}:null;}})[_0x61af('0x2f')](respondWithResult(_0x4703ab,null))[_0x61af('0x23')](handleError(_0x4703ab,null));}; \ No newline at end of file +var _0xe708=['getApplications','context','from-voip-provider','exten','localstationid','system','description','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','transaction','VoiceExtension','bulkCreate','updateAccountApplications','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','Contacts','ListId','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','include','findAll','rows','show','params','Pause','length','includeAll','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','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','nolimit','pick','removeDispositions','ids','addAnswer','CannedAnswer','order','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','finally'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe708,0x1d0));var _0x8e70=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xe708[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x8e70('0x0'));var rimraf=require(_0x8e70('0x1'));var zipdir=require(_0x8e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e70('0x3'));var moment=require(_0x8e70('0x4'));var BPromise=require(_0x8e70('0x5'));var Mustache=require(_0x8e70('0x6'));var util=require(_0x8e70('0x7'));var path=require(_0x8e70('0x8'));var sox=require(_0x8e70('0x9'));var csv=require('to-csv');var ejs=require(_0x8e70('0xa'));var fs=require('fs');var fs_extra=require(_0x8e70('0xb'));var _=require(_0x8e70('0xc'));var squel=require(_0x8e70('0xd'));var crypto=require(_0x8e70('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8e70('0xf'));var toCsv=require(_0x8e70('0x10'));var querystring=require('querystring');var Papa=require(_0x8e70('0x11'));var Redis=require('ioredis');var authService=require(_0x8e70('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e70('0x13'));var logger=require(_0x8e70('0x14'))(_0x8e70('0x15'));var utils=require('../../config/utils');var config=require(_0x8e70('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8e70('0x17'))['db'];config['redis']=_[_0x8e70('0x18')](config[_0x8e70('0x19')],{'host':_0x8e70('0x1a'),'port':0x18eb});var socket=require(_0x8e70('0x1b'))(new Redis(config[_0x8e70('0x19')]));require(_0x8e70('0x1c'))[_0x8e70('0x1d')](socket);var jayson=require(_0x8e70('0x1e'));var client=jayson['client'][_0x8e70('0x1f')]({'port':0x232c});var client9002=jayson[_0x8e70('0x20')][_0x8e70('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x499c12,_0x275dbf,_0x4d87d2,_0x43c98c){return new BPromise(function(_0x2b86e9,_0x3c2894){var _0xd45afc=_0x43c98c||client;return _0xd45afc['request'](_0x499c12,_0x4d87d2)[_0x8e70('0x21')](function(_0x1215e3){logger[_0x8e70('0x22')](_0x8e70('0x23'),_0x275dbf,_0x8e70('0x24'));logger[_0x8e70('0x25')](_0x8e70('0x26'),_0x275dbf,_0x8e70('0x24'),JSON['stringify'](_0x1215e3));if(_0x1215e3[_0x8e70('0x27')]){if(_0x1215e3[_0x8e70('0x27')][_0x8e70('0x28')]===0x1f4){logger[_0x8e70('0x27')](_0x8e70('0x23'),_0x275dbf,_0x1215e3['error']['message']);return _0x3c2894(_0x1215e3['error'][_0x8e70('0x29')]);}logger[_0x8e70('0x27')](_0x8e70('0x23'),_0x275dbf,_0x1215e3[_0x8e70('0x27')]['message']);return _0x2b86e9(_0x1215e3[_0x8e70('0x27')][_0x8e70('0x29')]);}else{logger[_0x8e70('0x22')](_0x8e70('0x23'),_0x275dbf,_0x8e70('0x24'));_0x2b86e9(_0x1215e3['result'][_0x8e70('0x29')]);}})[_0x8e70('0x2a')](function(_0x105a4b){logger[_0x8e70('0x27')](_0x8e70('0x23'),_0x275dbf,_0x105a4b);_0x3c2894(_0x105a4b);});});}function respondWithStatusCode(_0x2d76c9,_0x1f431b){_0x1f431b=_0x1f431b||0xcc;return function(_0x4c001e){if(_0x4c001e){return _0x2d76c9[_0x8e70('0x2b')](_0x1f431b);}return _0x2d76c9[_0x8e70('0x2c')](_0x1f431b)[_0x8e70('0x2d')]();};}function respondWithResult(_0x1e73d9,_0x531548){_0x531548=_0x531548||0xc8;return function(_0x326692){if(_0x326692){return _0x1e73d9[_0x8e70('0x2c')](_0x531548)[_0x8e70('0x2e')](_0x326692);}};}function respondWithFilteredResult(_0x4f33af,_0x590fea){return function(_0x1a6e14){if(_0x1a6e14){var _0x4a12b8=typeof _0x590fea[_0x8e70('0x2f')]===_0x8e70('0x30')&&typeof _0x590fea[_0x8e70('0x31')]===_0x8e70('0x30');var _0x183b1c=_0x1a6e14[_0x8e70('0x32')];var _0x5d7904=_0x4a12b8?0x0:_0x590fea[_0x8e70('0x2f')];var _0x1895dc=_0x4a12b8?_0x1a6e14['count']:_0x590fea[_0x8e70('0x2f')]+_0x590fea['limit'];var _0x4c7bd9;if(_0x1895dc>=_0x183b1c){_0x1895dc=_0x183b1c;_0x4c7bd9=0xc8;}else{_0x4c7bd9=0xce;}_0x4f33af[_0x8e70('0x2c')](_0x4c7bd9);return _0x4f33af['set']('Content-Range',_0x5d7904+'-'+_0x1895dc+'/'+_0x183b1c)[_0x8e70('0x2e')](_0x1a6e14);}return null;};}function patchUpdates(_0x3e8a72){return function(_0x31cd2f){try{jsonpatch[_0x8e70('0x33')](_0x31cd2f,_0x3e8a72,!![]);}catch(_0x1357fd){return BPromise['reject'](_0x1357fd);}return _0x31cd2f[_0x8e70('0x34')]();};}function saveUpdates(_0x186603,_0x3685c6){return function(_0x159ca7){if(_0x159ca7){return _0x159ca7[_0x8e70('0x35')](_0x186603)[_0x8e70('0x21')](function(_0x454f2d){return _0x454f2d;});}return null;};}function removeEntity(_0xd9a1c7,_0x511f8a){return function(_0x26108d){if(_0x26108d){return _0x26108d[_0x8e70('0x36')]()['then'](function(){var _0x5318c6=_0x26108d[_0x8e70('0x37')]({'plain':!![]});var _0x44bcdd=_0x8e70('0x38');return db[_0x8e70('0x39')][_0x8e70('0x36')]({'where':{'type':_0x44bcdd,'resourceId':_0x5318c6['id']}})[_0x8e70('0x21')](function(){return _0x26108d;});})[_0x8e70('0x21')](function(){_0xd9a1c7[_0x8e70('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cd115,_0x4413af){return function(_0x86717c){if(!_0x86717c){_0x1cd115[_0x8e70('0x2b')](0x194);}return _0x86717c;};}function handleError(_0xfdbf89,_0x381a05){_0x381a05=_0x381a05||0x1f4;return function(_0x46ca1f){logger[_0x8e70('0x27')](_0x46ca1f[_0x8e70('0x3a')]);if(_0x46ca1f['name']){delete _0x46ca1f[_0x8e70('0x3b')];}_0xfdbf89[_0x8e70('0x2c')](_0x381a05)[_0x8e70('0x3c')](_0x46ca1f);};}exports[_0x8e70('0x3d')]=function(_0x1bffd0,_0x21c510){var _0x145222={'include':[{'model':db['Pause'],'as':_0x8e70('0x3e')}]},_0x52248c={},_0x5e91ce={'count':0x0,'rows':[]};var _0x1a55df=_[_0x8e70('0x3f')](db[_0x8e70('0x40')][_0x8e70('0x41')],function(_0x32b5c6){return{'name':_0x32b5c6['fieldName'],'type':_0x32b5c6[_0x8e70('0x42')][_0x8e70('0x43')]};});_0x52248c[_0x8e70('0x44')]=_[_0x8e70('0x3f')](_0x1a55df,_0x8e70('0x3b'));_0x52248c['query']=_[_0x8e70('0x45')](_0x1bffd0[_0x8e70('0x46')]);_0x52248c[_0x8e70('0x47')]=_[_0x8e70('0x48')](_0x52248c[_0x8e70('0x44')],_0x52248c[_0x8e70('0x46')]);_0x145222[_0x8e70('0x49')]=_[_0x8e70('0x48')](_0x52248c[_0x8e70('0x44')],qs[_0x8e70('0x4a')](_0x1bffd0[_0x8e70('0x46')]['fields']));_0x145222[_0x8e70('0x49')]=_0x145222[_0x8e70('0x49')]['length']?_0x145222['attributes']:_0x52248c['model'];if(!_0x1bffd0['query'][_0x8e70('0x4b')]('nolimit')){_0x145222[_0x8e70('0x31')]=qs[_0x8e70('0x31')](_0x1bffd0[_0x8e70('0x46')][_0x8e70('0x31')]);_0x145222['offset']=qs[_0x8e70('0x2f')](_0x1bffd0['query']['offset']);}_0x145222['order']=qs[_0x8e70('0x4c')](_0x1bffd0[_0x8e70('0x46')]['sort']);_0x145222[_0x8e70('0x4d')]=qs['filters'](_['pick'](_0x1bffd0['query'],_0x52248c[_0x8e70('0x47')]),_0x1a55df);if(_0x1bffd0[_0x8e70('0x46')][_0x8e70('0x4e')]){_0x145222[_0x8e70('0x4d')]=_[_0x8e70('0x4f')](_0x145222['where'],{'$or':_[_0x8e70('0x3f')](_0x1a55df,function(_0x55cf79){if(_0x55cf79[_0x8e70('0x42')]!=='VIRTUAL'){var _0x5edf3c={};_0x5edf3c[_0x55cf79['name']]={'$like':'%'+_0x1bffd0[_0x8e70('0x46')][_0x8e70('0x4e')]+'%'};return _0x5edf3c;}})});}_0x145222=_[_0x8e70('0x4f')]({},_0x145222,_0x1bffd0['options']);var _0x41293e={'where':_0x145222[_0x8e70('0x4d')]};return db[_0x8e70('0x40')][_0x8e70('0x32')](_0x41293e)['then'](function(_0x1ded4b){_0x5e91ce['count']=_0x1ded4b;if(_0x1bffd0[_0x8e70('0x46')]['includeAll']){_0x145222[_0x8e70('0x50')]=[{'all':!![]}];}return db[_0x8e70('0x40')][_0x8e70('0x51')](_0x145222);})[_0x8e70('0x21')](function(_0x517054){_0x5e91ce[_0x8e70('0x52')]=_0x517054;return _0x5e91ce;})['then'](respondWithFilteredResult(_0x21c510,_0x145222))[_0x8e70('0x2a')](handleError(_0x21c510,null));};exports[_0x8e70('0x53')]=function(_0x29b24c,_0x18c1f2){var _0x18112a={'raw':![],'where':{'id':_0x29b24c[_0x8e70('0x54')]['id']},'include':[{'model':db[_0x8e70('0x55')],'as':'mandatoryDispositionPause'}]},_0x1576e4={};_0x1576e4[_0x8e70('0x44')]=_[_0x8e70('0x45')](db['FaxAccount'][_0x8e70('0x41')]);_0x1576e4['query']=_[_0x8e70('0x45')](_0x29b24c[_0x8e70('0x46')]);_0x1576e4[_0x8e70('0x47')]=_['intersection'](_0x1576e4[_0x8e70('0x44')],_0x1576e4[_0x8e70('0x46')]);_0x18112a[_0x8e70('0x49')]=_[_0x8e70('0x48')](_0x1576e4['model'],qs[_0x8e70('0x4a')](_0x29b24c[_0x8e70('0x46')][_0x8e70('0x4a')]));_0x18112a[_0x8e70('0x49')]=_0x18112a[_0x8e70('0x49')][_0x8e70('0x56')]?_0x18112a[_0x8e70('0x49')]:_0x1576e4[_0x8e70('0x44')];if(_0x29b24c['query'][_0x8e70('0x57')]){_0x18112a['include']=[{'all':!![]}];}_0x18112a=_[_0x8e70('0x4f')]({},_0x18112a,_0x29b24c[_0x8e70('0x58')]);return db[_0x8e70('0x40')][_0x8e70('0x59')](_0x18112a)[_0x8e70('0x21')](handleEntityNotFound(_0x18c1f2,null))[_0x8e70('0x21')](respondWithResult(_0x18c1f2,null))[_0x8e70('0x2a')](handleError(_0x18c1f2,null));};exports['create']=function(_0x4b9de1,_0x4fc134){return db[_0x8e70('0x40')][_0x8e70('0x5a')](_0x4b9de1[_0x8e70('0x5b')],{})[_0x8e70('0x21')](function(_0x4ad28b){var _0x4db1c0=_0x4b9de1[_0x8e70('0x5c')][_0x8e70('0x37')]({'plain':!![]});if(!_0x4db1c0)throw new Error(_0x8e70('0x5d'));if(_0x4db1c0[_0x8e70('0x5e')]===_0x8e70('0x5c')){var _0x542c09=_0x4ad28b[_0x8e70('0x37')]({'plain':!![]});var _0x4ed173='FaxAccounts';return db[_0x8e70('0x5f')][_0x8e70('0x59')]({'where':{'name':_0x4ed173,'userProfileId':_0x4db1c0[_0x8e70('0x60')]},'raw':!![]})['then'](function(_0xdf2d8b){if(_0xdf2d8b&&_0xdf2d8b[_0x8e70('0x61')]===0x0){return db[_0x8e70('0x39')][_0x8e70('0x5a')]({'name':_0x542c09[_0x8e70('0x3b')],'resourceId':_0x542c09['id'],'type':_0xdf2d8b[_0x8e70('0x3b')],'sectionId':_0xdf2d8b['id']},{})[_0x8e70('0x21')](function(){return _0x4ad28b;});}else{return _0x4ad28b;}})['catch'](function(_0x35dc54){logger[_0x8e70('0x27')](_0x8e70('0x62'),_0x35dc54);throw _0x35dc54;});}return _0x4ad28b;})[_0x8e70('0x21')](respondWithResult(_0x4fc134,0xc9))[_0x8e70('0x2a')](handleError(_0x4fc134,null));};exports['update']=function(_0x126a84,_0x6db100){if(_0x126a84['body']['id']){delete _0x126a84[_0x8e70('0x5b')]['id'];}return db[_0x8e70('0x40')][_0x8e70('0x59')]({'where':{'id':_0x126a84[_0x8e70('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x8e70('0x3e')}]})[_0x8e70('0x21')](handleEntityNotFound(_0x6db100,null))[_0x8e70('0x21')](saveUpdates(_0x126a84[_0x8e70('0x5b')],null))[_0x8e70('0x21')](respondWithResult(_0x6db100,null))[_0x8e70('0x2a')](handleError(_0x6db100,null));};exports[_0x8e70('0x36')]=function(_0x4f0145,_0xb4a527){return db['FaxAccount'][_0x8e70('0x59')]({'where':{'id':_0x4f0145[_0x8e70('0x54')]['id']}})[_0x8e70('0x21')](handleEntityNotFound(_0xb4a527,null))[_0x8e70('0x21')](removeEntity(_0xb4a527,null))[_0x8e70('0x2a')](handleError(_0xb4a527,null));};exports[_0x8e70('0x63')]=function(_0x43fcfa,_0x171870){return db[_0x8e70('0x40')][_0x8e70('0x63')]()[_0x8e70('0x21')](respondWithResult(_0x171870,null))[_0x8e70('0x2a')](handleError(_0x171870,null));};exports[_0x8e70('0x64')]=function(_0x1bba4c,_0x95b5a6,_0x4bca71){if(_0x1bba4c[_0x8e70('0x5b')]['id']){delete _0x1bba4c[_0x8e70('0x5b')]['id'];}return db[_0x8e70('0x40')][_0x8e70('0x59')]({'where':{'id':_0x1bba4c['params']['id']}})['then'](handleEntityNotFound(_0x95b5a6,null))[_0x8e70('0x21')](function(_0x2bb142){if(_0x2bb142){_0x1bba4c[_0x8e70('0x5b')][_0x8e70('0x65')]=_0x2bb142['id'];return db[_0x8e70('0x66')][_0x8e70('0x5a')](_0x1bba4c[_0x8e70('0x5b')]);}})[_0x8e70('0x21')](respondWithResult(_0x95b5a6,null))[_0x8e70('0x2a')](handleError(_0x95b5a6,null));};exports[_0x8e70('0x67')]=function(_0x97c32f,_0x31e63f,_0x163023){var _0x3b8784={'raw':![],'where':{}};var _0x318768={};var _0xe8557e={'count':0x0,'rows':[]};return db[_0x8e70('0x40')][_0x8e70('0x68')]({'where':{'id':_0x97c32f[_0x8e70('0x54')]['id']}})[_0x8e70('0x21')](handleEntityNotFound(_0x31e63f,null))[_0x8e70('0x21')](function(_0x5467cb){if(_0x5467cb){_0x318768[_0x8e70('0x44')]=_[_0x8e70('0x45')](db[_0x8e70('0x66')]['rawAttributes']);_0x318768['query']=_[_0x8e70('0x45')](_0x97c32f[_0x8e70('0x46')]);_0x318768[_0x8e70('0x47')]=_['intersection'](_0x318768[_0x8e70('0x44')],_0x318768[_0x8e70('0x46')]);_0x3b8784[_0x8e70('0x49')]=_[_0x8e70('0x48')](_0x318768['model'],qs[_0x8e70('0x4a')](_0x97c32f[_0x8e70('0x46')]['fields']));_0x3b8784[_0x8e70('0x49')]=_0x3b8784['attributes'][_0x8e70('0x56')]?_0x3b8784[_0x8e70('0x49')]:_0x318768[_0x8e70('0x44')];if(!_0x97c32f['query']['hasOwnProperty'](_0x8e70('0x69'))){_0x3b8784['limit']=qs[_0x8e70('0x31')](_0x97c32f[_0x8e70('0x46')][_0x8e70('0x31')]);_0x3b8784[_0x8e70('0x2f')]=qs[_0x8e70('0x2f')](_0x97c32f[_0x8e70('0x46')]['offset']);}_0x3b8784['order']=qs[_0x8e70('0x4c')](_0x97c32f[_0x8e70('0x46')][_0x8e70('0x4c')]);_0x3b8784['where']=qs[_0x8e70('0x47')](_[_0x8e70('0x6a')](_0x97c32f['query'],_0x318768['filters']));_0x3b8784['where'][_0x8e70('0x65')]=_0x5467cb['id'];if(_0x97c32f[_0x8e70('0x46')]['filter']){_0x3b8784['where']=_[_0x8e70('0x4f')](_0x3b8784[_0x8e70('0x4d')],{'$or':_['map'](_0x3b8784[_0x8e70('0x49')],function(_0x54542d){var _0x52f066={};_0x52f066[_0x54542d]={'$like':'%'+_0x97c32f[_0x8e70('0x46')][_0x8e70('0x4e')]+'%'};return _0x52f066;})});}_0x3b8784=_[_0x8e70('0x4f')]({},_0x3b8784,_0x97c32f['options']);return db[_0x8e70('0x66')][_0x8e70('0x32')]({'where':_0x3b8784[_0x8e70('0x4d')]})[_0x8e70('0x21')](function(_0x163852){_0xe8557e['count']=_0x163852;if(_0x97c32f[_0x8e70('0x46')]['includeAll']){_0x3b8784['include']=[{'all':!![]}];}return db[_0x8e70('0x66')]['findAll'](_0x3b8784);})[_0x8e70('0x21')](function(_0x16773e){_0xe8557e['rows']=_0x16773e;return _0xe8557e;});}})[_0x8e70('0x21')](respondWithFilteredResult(_0x31e63f,_0x3b8784))['catch'](handleError(_0x31e63f,null));};exports[_0x8e70('0x6b')]=function(_0x413f79,_0x49bba8,_0x3afae9){return db[_0x8e70('0x40')][_0x8e70('0x59')]({'where':{'id':_0x413f79[_0x8e70('0x54')]['id']}})[_0x8e70('0x21')](handleEntityNotFound(_0x49bba8,null))[_0x8e70('0x21')](function(_0x38d47){if(_0x38d47){return _0x38d47[_0x8e70('0x6b')](_0x413f79[_0x8e70('0x46')][_0x8e70('0x6c')]);}})[_0x8e70('0x21')](respondWithStatusCode(_0x49bba8,null))['catch'](handleError(_0x49bba8,null));};exports[_0x8e70('0x6d')]=function(_0x102519,_0x4d65d6,_0x206ea3){if(_0x102519[_0x8e70('0x5b')]['id']){delete _0x102519[_0x8e70('0x5b')]['id'];}return db[_0x8e70('0x40')][_0x8e70('0x59')]({'where':{'id':_0x102519[_0x8e70('0x54')]['id']}})['then'](handleEntityNotFound(_0x4d65d6,null))[_0x8e70('0x21')](function(_0x35f18e){if(_0x35f18e){_0x102519[_0x8e70('0x5b')][_0x8e70('0x65')]=_0x35f18e['id'];return db[_0x8e70('0x6e')][_0x8e70('0x5a')](_0x102519[_0x8e70('0x5b')]);}})[_0x8e70('0x21')](respondWithResult(_0x4d65d6,null))[_0x8e70('0x2a')](handleError(_0x4d65d6,null));};exports['getAnswers']=function(_0xeb65fe,_0x189d89,_0x481d57){var _0x1e3494={'raw':![],'where':{}};var _0x39afb3={};var _0x4392a5={'count':0x0,'rows':[]};return db['FaxAccount'][_0x8e70('0x68')]({'where':{'id':_0xeb65fe[_0x8e70('0x54')]['id']}})['then'](handleEntityNotFound(_0x189d89,null))[_0x8e70('0x21')](function(_0x2ccfd2){if(_0x2ccfd2){_0x39afb3[_0x8e70('0x44')]=_[_0x8e70('0x45')](db[_0x8e70('0x6e')][_0x8e70('0x41')]);_0x39afb3[_0x8e70('0x46')]=_[_0x8e70('0x45')](_0xeb65fe[_0x8e70('0x46')]);_0x39afb3[_0x8e70('0x47')]=_[_0x8e70('0x48')](_0x39afb3[_0x8e70('0x44')],_0x39afb3['query']);_0x1e3494[_0x8e70('0x49')]=_[_0x8e70('0x48')](_0x39afb3['model'],qs[_0x8e70('0x4a')](_0xeb65fe[_0x8e70('0x46')]['fields']));_0x1e3494['attributes']=_0x1e3494[_0x8e70('0x49')][_0x8e70('0x56')]?_0x1e3494[_0x8e70('0x49')]:_0x39afb3[_0x8e70('0x44')];if(!_0xeb65fe[_0x8e70('0x46')][_0x8e70('0x4b')](_0x8e70('0x69'))){_0x1e3494[_0x8e70('0x31')]=qs[_0x8e70('0x31')](_0xeb65fe[_0x8e70('0x46')]['limit']);_0x1e3494[_0x8e70('0x2f')]=qs[_0x8e70('0x2f')](_0xeb65fe[_0x8e70('0x46')]['offset']);}_0x1e3494[_0x8e70('0x6f')]=qs[_0x8e70('0x4c')](_0xeb65fe[_0x8e70('0x46')][_0x8e70('0x4c')]);_0x1e3494[_0x8e70('0x4d')]=qs[_0x8e70('0x47')](_[_0x8e70('0x6a')](_0xeb65fe[_0x8e70('0x46')],_0x39afb3[_0x8e70('0x47')]));_0x1e3494[_0x8e70('0x4d')][_0x8e70('0x65')]=_0x2ccfd2['id'];if(_0xeb65fe[_0x8e70('0x46')][_0x8e70('0x4e')]){_0x1e3494['where']=_[_0x8e70('0x4f')](_0x1e3494[_0x8e70('0x4d')],{'$or':_[_0x8e70('0x3f')](_0x1e3494[_0x8e70('0x49')],function(_0x81ef2d){var _0xc9cfb4={};_0xc9cfb4[_0x81ef2d]={'$like':'%'+_0xeb65fe[_0x8e70('0x46')][_0x8e70('0x4e')]+'%'};return _0xc9cfb4;})});}_0x1e3494=_[_0x8e70('0x4f')]({},_0x1e3494,_0xeb65fe[_0x8e70('0x58')]);return db['CannedAnswer'][_0x8e70('0x32')]({'where':_0x1e3494[_0x8e70('0x4d')]})[_0x8e70('0x21')](function(_0x5b4a5b){_0x4392a5['count']=_0x5b4a5b;if(_0xeb65fe[_0x8e70('0x46')][_0x8e70('0x57')]){_0x1e3494[_0x8e70('0x50')]=[{'all':!![]}];}return db[_0x8e70('0x6e')][_0x8e70('0x51')](_0x1e3494);})['then'](function(_0xb70814){_0x4392a5[_0x8e70('0x52')]=_0xb70814;return _0x4392a5;});}})[_0x8e70('0x21')](respondWithFilteredResult(_0x189d89,_0x1e3494))['catch'](handleError(_0x189d89,null));};exports[_0x8e70('0x70')]=function(_0xe576a8,_0x1beb25,_0x352355){return db[_0x8e70('0x40')][_0x8e70('0x59')]({'where':{'id':_0xe576a8[_0x8e70('0x54')]['id']}})['then'](handleEntityNotFound(_0x1beb25,null))['then'](function(_0xc4aa08){if(_0xc4aa08){return _0xc4aa08[_0x8e70('0x70')](_0xe576a8[_0x8e70('0x46')]['ids']);}})[_0x8e70('0x21')](respondWithStatusCode(_0x1beb25,null))['catch'](handleError(_0x1beb25,null));};exports['addInteraction']=function(_0x20fd81,_0x8e3b40,_0x1cc471){return db[_0x8e70('0x71')][_0x8e70('0x59')]({'where':{'id':_0x20fd81['params']['id']}})[_0x8e70('0x21')](handleEntityNotFound(_0x8e3b40,null))[_0x8e70('0x21')](function(_0x592418){if(_0x592418){return _0x592418[_0x8e70('0x72')](_0x20fd81['body'][_0x8e70('0x6c')],_[_0x8e70('0x73')](_0x20fd81[_0x8e70('0x5b')],[_0x8e70('0x6c'),'id'])||{});}})[_0x8e70('0x21')](respondWithResult(_0x8e3b40,null))[_0x8e70('0x2a')](handleError(_0x8e3b40,null));};exports[_0x8e70('0x74')]=function(_0x26f7da,_0x1b084f,_0x42233b){var _0x2250d6={'raw':![],'where':{}};var _0x12937a={};var _0x4458d4={'count':0x0,'rows':[]};return db[_0x8e70('0x40')][_0x8e70('0x68')]({'where':{'id':_0x26f7da[_0x8e70('0x54')]['id']}})[_0x8e70('0x21')](handleEntityNotFound(_0x1b084f,null))[_0x8e70('0x21')](function(_0x3df2e8){if(_0x3df2e8){_0x12937a[_0x8e70('0x44')]=_['keys'](db['FaxInteraction'][_0x8e70('0x41')]);_0x12937a[_0x8e70('0x46')]=_[_0x8e70('0x45')](_0x26f7da[_0x8e70('0x46')]);_0x12937a[_0x8e70('0x47')]=_[_0x8e70('0x48')](_0x12937a['model'],_0x12937a['query']);_0x2250d6[_0x8e70('0x49')]=_[_0x8e70('0x48')](_0x12937a[_0x8e70('0x44')],qs[_0x8e70('0x4a')](_0x26f7da[_0x8e70('0x46')][_0x8e70('0x4a')]));_0x2250d6[_0x8e70('0x49')]=_0x2250d6['attributes']['length']?_0x2250d6['attributes']:_0x12937a[_0x8e70('0x44')];if(!_0x26f7da[_0x8e70('0x46')][_0x8e70('0x4b')](_0x8e70('0x69'))){_0x2250d6['limit']=qs[_0x8e70('0x31')](_0x26f7da[_0x8e70('0x46')][_0x8e70('0x31')]);_0x2250d6[_0x8e70('0x2f')]=qs[_0x8e70('0x2f')](_0x26f7da[_0x8e70('0x46')]['offset']);}_0x2250d6[_0x8e70('0x6f')]=qs[_0x8e70('0x4c')](_0x26f7da['query'][_0x8e70('0x4c')]);_0x2250d6['where']=qs[_0x8e70('0x47')](_[_0x8e70('0x6a')](_0x26f7da[_0x8e70('0x46')],_0x12937a['filters']));_0x2250d6['where'][_0x8e70('0x65')]=_0x3df2e8['id'];if(_0x26f7da[_0x8e70('0x46')]['filter']){_0x2250d6[_0x8e70('0x4d')]=_[_0x8e70('0x4f')](_0x2250d6['where'],{'$or':_[_0x8e70('0x3f')](_0x2250d6[_0x8e70('0x49')],function(_0x21ed1e){var _0x1d3fb3={};_0x1d3fb3[_0x21ed1e]={'$like':'%'+_0x26f7da[_0x8e70('0x46')][_0x8e70('0x4e')]+'%'};return _0x1d3fb3;})});}_0x2250d6=_[_0x8e70('0x4f')]({},_0x2250d6,_0x26f7da[_0x8e70('0x58')]);return db[_0x8e70('0x71')][_0x8e70('0x32')]({'where':_0x2250d6['where']})[_0x8e70('0x21')](function(_0x2d26fb){_0x4458d4[_0x8e70('0x32')]=_0x2d26fb;if(_0x26f7da[_0x8e70('0x46')][_0x8e70('0x57')]){_0x2250d6['include']=[{'model':db[_0x8e70('0x75')],'as':_0x8e70('0x76'),'required':![]},{'model':db[_0x8e70('0x77')],'as':_0x8e70('0x78'),'attributes':[_0x8e70('0x3b'),_0x8e70('0x79'),_0x8e70('0x7a')],'required':![]},{'model':db[_0x8e70('0x7b')],'as':_0x8e70('0x7c'),'attributes':['id',_0x8e70('0x3b'),_0x8e70('0x7d')],'where':_0x26f7da['query'][_0x8e70('0x7e')]?{'id':_0x26f7da[_0x8e70('0x46')][_0x8e70('0x7e')]}:undefined,'required':_0x26f7da['query'][_0x8e70('0x7e')]?!![]:![]}];}return db['FaxInteraction'][_0x8e70('0x51')](_0x2250d6);})[_0x8e70('0x21')](function(_0x59bf47){_0x4458d4['rows']=_0x59bf47;return _0x4458d4;});}})[_0x8e70('0x21')](respondWithFilteredResult(_0x1b084f,_0x2250d6))[_0x8e70('0x2a')](handleError(_0x1b084f,null));};exports[_0x8e70('0x7f')]=function(_0x44cf90,_0xdbb456){var _0x347bad=_0x44cf90['params']['id'];var _0x527e35=_0x44cf90[_0x8e70('0x5b')];var _0xa1e07a=0xc8;var _0x1d3550=null;return db[_0x8e70('0x80')]['transaction']({'isolationLevel':db[_0x8e70('0x80')][_0x8e70('0x81')][_0x8e70('0x82')][_0x8e70('0x83')]},function(_0x19eaa6){return db[_0x8e70('0x40')][_0x8e70('0x68')]({'where':{'id':_0x347bad},'transaction':_0x19eaa6})[_0x8e70('0x21')](function(_0x175d13){if(_0x175d13){return db[_0x8e70('0x84')][_0x8e70('0x36')]({'where':{'FaxAccountId':_0x347bad},'transaction':_0x19eaa6})[_0x8e70('0x21')](function(){var _0x516dc7=_[_0x8e70('0x3f')](_0x527e35,function(_0x4ec857){_0x4ec857[_0x8e70('0x65')]=_0x347bad;return _0x4ec857;});return db[_0x8e70('0x84')]['bulkCreate'](_0x516dc7,{'transaction':_0x19eaa6});});}else{_0xa1e07a=0x194;_0x1d3550=[];}});})[_0x8e70('0x21')](function(){if(_0xa1e07a!==0x194){return db[_0x8e70('0x84')][_0x8e70('0x85')]({'where':{'FaxAccountId':_0x347bad},'order':_0x8e70('0x86')})['then'](function(_0x12438e){_0x1d3550=_0x12438e;});}})[_0x8e70('0x2a')](function(_0x3489b1){_0xa1e07a=0x1f4;logger[_0x8e70('0x27')](_0x3489b1[_0x8e70('0x3a')]);if(_0x3489b1[_0x8e70('0x3b')]){delete _0x3489b1[_0x8e70('0x3b')];}_0x1d3550=_0x3489b1;})[_0x8e70('0x87')](function(){if(_0x1d3550===null){_0xdbb456[_0x8e70('0x2b')](_0xa1e07a);}else{if(_0xa1e07a===0x1f4){_0xdbb456[_0x8e70('0x2c')](_0xa1e07a)[_0x8e70('0x3c')](_0x1d3550);}else{_0xdbb456[_0x8e70('0x2c')](_0xa1e07a)[_0x8e70('0x2e')](_0x1d3550);}}});};exports[_0x8e70('0x88')]=function(_0x28813a,_0x11cf56,_0x59ebfe){var _0x3d67cb={};var _0xe87b66={};var _0x2bcacd;var _0x5f4624;return db[_0x8e70('0x40')]['findOne']({'where':{'id':_0x28813a[_0x8e70('0x54')]['id']}})['then'](handleEntityNotFound(_0x11cf56,null))[_0x8e70('0x21')](function(_0x161009){if(_0x161009){_0x2bcacd=_0x161009;_0xe87b66[_0x8e70('0x44')]=_[_0x8e70('0x45')](db[_0x8e70('0x84')]['rawAttributes']);_0xe87b66[_0x8e70('0x46')]=_[_0x8e70('0x45')](_0x28813a[_0x8e70('0x46')]);_0xe87b66['filters']=_['intersection'](_0xe87b66[_0x8e70('0x44')],_0xe87b66[_0x8e70('0x46')]);_0x3d67cb[_0x8e70('0x49')]=_[_0x8e70('0x48')](_0xe87b66[_0x8e70('0x44')],qs['fields'](_0x28813a['query'][_0x8e70('0x4a')]));_0x3d67cb[_0x8e70('0x49')]=_0x3d67cb[_0x8e70('0x49')][_0x8e70('0x56')]?_0x3d67cb[_0x8e70('0x49')]:_0xe87b66['model'];_0x3d67cb[_0x8e70('0x6f')]=qs[_0x8e70('0x4c')](_0x28813a['query'][_0x8e70('0x4c')]);_0x3d67cb[_0x8e70('0x4d')]=qs[_0x8e70('0x47')](_['pick'](_0x28813a['query'],_0xe87b66[_0x8e70('0x47')]));if(_0x28813a[_0x8e70('0x46')][_0x8e70('0x4e')]){_0x3d67cb['where']=_[_0x8e70('0x4f')](_0x3d67cb['where'],{'$or':_[_0x8e70('0x3f')](_0x3d67cb[_0x8e70('0x49')],function(_0x2534c3){var _0x47cb08={};_0x47cb08[_0x2534c3]={'$like':'%'+_0x28813a['query'][_0x8e70('0x4e')]+'%'};return _0x47cb08;})});}_0x3d67cb=_[_0x8e70('0x4f')]({},_0x3d67cb,_0x28813a[_0x8e70('0x58')]);return _0x2bcacd[_0x8e70('0x88')](_0x3d67cb);}})[_0x8e70('0x21')](function(_0x464834){if(_0x464834){_0x5f4624=_0x464834[_0x8e70('0x56')];if(!_0x28813a[_0x8e70('0x46')][_0x8e70('0x4b')](_0x8e70('0x69'))){_0x3d67cb[_0x8e70('0x31')]=qs['limit'](_0x28813a[_0x8e70('0x46')][_0x8e70('0x31')]);_0x3d67cb[_0x8e70('0x2f')]=qs[_0x8e70('0x2f')](_0x28813a['query'][_0x8e70('0x2f')]);}return _0x2bcacd[_0x8e70('0x88')](_0x3d67cb);}})[_0x8e70('0x21')](function(_0x5a2550){if(_0x5a2550){return _0x5a2550?{'count':_0x5f4624,'rows':_0x5a2550}:null;}})[_0x8e70('0x21')](respondWithResult(_0x11cf56,null))[_0x8e70('0x2a')](handleError(_0x11cf56,null));};function Extension(_0x3c6971,_0x5f5dac,_0x4bea54,_0x230c70){this[_0x8e70('0x89')]=_0x8e70('0x8a');this[_0x8e70('0x8b')]=_0x3c6971[_0x8e70('0x8c')];this['app']=_0x230c70;this[_0x8e70('0x42')]=_0x8e70('0x8d');this[_0x8e70('0x8e')]='Fax\x20Extension';this['FaxAccountId']=_0x3c6971['id'];this[_0x8e70('0x86')]=_0x5f5dac;this[_0x8e70('0x8f')]=_0x4bea54;}function createExtensionsReciveFax(_0x3f6edf){var _0x3601a3=0x1;var _0x476ca9=[];_0x476ca9[_0x8e70('0x90')](new Extension(_0x3f6edf,_0x3601a3,'',_0x8e70('0x91')));_0x3601a3+=0x1;_0x476ca9[_0x8e70('0x90')](new Extension(_0x3f6edf,_0x3601a3,_0x8e70('0x92'),_0x8e70('0x93')));_0x3601a3+=0x1;for(var _0x4b6d8e in _0x3f6edf){if(_0x3f6edf[_0x8e70('0x4b')](_0x4b6d8e)&&(_0x4b6d8e===_0x8e70('0x94')||_0x4b6d8e===_0x8e70('0x8c')||_0x4b6d8e===_0x8e70('0x95')||_0x4b6d8e===_0x8e70('0x96')||_0x4b6d8e===_0x8e70('0x97')||_0x4b6d8e===_0x8e70('0x98')||_0x4b6d8e==='minrate'||_0x4b6d8e==='modem'||_0x4b6d8e==='t38timeout')){_0x476ca9[_0x8e70('0x90')](new Extension(_0x3f6edf,_0x3601a3,_0x8e70('0x99')+_0x4b6d8e+')='+_0x3f6edf[_0x4b6d8e],_0x8e70('0x93')));_0x3601a3+=0x1;}}_0x476ca9[_0x8e70('0x90')](new Extension(_0x3f6edf,_0x3601a3,'6',_0x8e70('0x9a')));_0x3601a3+=0x1;_0x476ca9['push'](new Extension(_0x3f6edf,_0x3601a3,_0x8e70('0x9b'),'ReceiveFax'));_0x3601a3=0x0;return _0x476ca9;}exports[_0x8e70('0x9c')]=function(_0x595f5d,_0x1dd46e,_0x6b8a09){var _0x2f4874;return db[_0x8e70('0x80')][_0x8e70('0x9d')](function(_0x126d1a){return db[_0x8e70('0x40')][_0x8e70('0x5a')](_0x595f5d[_0x8e70('0x5b')],{'transaction':_0x126d1a})['then'](function(_0x13ec0e){_0x2f4874=_0x13ec0e['get']({'plain':!![]});return db[_0x8e70('0x9e')][_0x8e70('0x9f')](createExtensionsReciveFax(_0x2f4874),{'transaction':_0x126d1a});});})[_0x8e70('0x21')](function(){return _0x2f4874;})[_0x8e70('0x21')](respondWithResult(_0x1dd46e,null))['catch'](handleError(_0x1dd46e,null));};exports[_0x8e70('0xa0')]=function(_0x50bac6,_0x4f04b7,_0x505600){var _0xd7a84;return db[_0x8e70('0x80')][_0x8e70('0x9d')](function(_0x1f1f49){return db[_0x8e70('0x40')][_0x8e70('0x35')](_0x50bac6[_0x8e70('0x5b')],{'where':{'id':_0x50bac6['body']['id']},'transaction':_0x1f1f49})[_0x8e70('0x21')](function(_0x232d32){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x50bac6['body']['id']},'transaction':_0x1f1f49})[_0x8e70('0x21')](function(_0x2bc77c){return db[_0x8e70('0x9e')][_0x8e70('0x9f')](createExtensionsReciveFax(_['omit'](_0x50bac6[_0x8e70('0x5b')],['tech','key',_0x8e70('0xa1'),_0x8e70('0xa2'),_0x8e70('0xa3'),'ListId'])),{'transaction':_0x1f1f49});});});})['then'](function(){return db[_0x8e70('0x40')][_0x8e70('0xa4')](_0x50bac6[_0x8e70('0x5b')]['id']);})['then'](respondWithResult(_0x4f04b7,null))[_0x8e70('0x2a')](handleError(_0x4f04b7,null));};exports[_0x8e70('0xa5')]=function(_0x104dac,_0x5589c3,_0x2fedcb){var _0x1cf25a={'raw':!![],'where':{}};var _0x514361={};var _0x41b2e7={'count':0x0,'rows':[]};return db['FaxAccount'][_0x8e70('0x68')]({'where':{'id':_0x104dac['params']['id']}})[_0x8e70('0x21')](handleEntityNotFound(_0x5589c3,null))['then'](function(_0x37e5ca){if(_0x37e5ca){_0x514361[_0x8e70('0x44')]=_['keys'](db[_0x8e70('0xa6')][_0x8e70('0x41')]);_0x514361[_0x8e70('0x46')]=_[_0x8e70('0x45')](_0x104dac['query']);_0x514361['filters']=_['intersection'](_0x514361['model'],_0x514361['query']);_0x1cf25a['attributes']=_[_0x8e70('0x48')](_0x514361['model'],qs[_0x8e70('0x4a')](_0x104dac[_0x8e70('0x46')]['fields']));_0x1cf25a[_0x8e70('0x49')]=_0x1cf25a[_0x8e70('0x49')][_0x8e70('0x56')]?_0x1cf25a[_0x8e70('0x49')]:_0x514361['model'];if(!_0x104dac['query'][_0x8e70('0x4b')]('nolimit')){_0x1cf25a[_0x8e70('0x31')]=qs['limit'](_0x104dac['query']['limit']);_0x1cf25a[_0x8e70('0x2f')]=qs[_0x8e70('0x2f')](_0x104dac[_0x8e70('0x46')][_0x8e70('0x2f')]);}_0x1cf25a['order']=qs[_0x8e70('0x4c')](_0x104dac[_0x8e70('0x46')][_0x8e70('0x4c')]);_0x1cf25a[_0x8e70('0x4d')]=qs[_0x8e70('0x47')](_['pick'](_0x104dac['query'],_0x514361[_0x8e70('0x47')]));_0x1cf25a[_0x8e70('0x4d')][_0x8e70('0x65')]=_0x37e5ca['id'];if(_0x104dac[_0x8e70('0x46')][_0x8e70('0x4e')]){_0x1cf25a['where']=_[_0x8e70('0x4f')](_0x1cf25a[_0x8e70('0x4d')],{'$or':_[_0x8e70('0x3f')](_0x1cf25a[_0x8e70('0x49')],function(_0x5e2109){var _0x48d4be={};_0x48d4be[_0x5e2109]={'$like':'%'+_0x104dac['query'][_0x8e70('0x4e')]+'%'};return _0x48d4be;})});}if(_0x104dac[_0x8e70('0x46')][_0x8e70('0xa7')]){var _0x1304d0=_0x104dac[_0x8e70('0x46')][_0x8e70('0xa7')][_0x8e70('0xa8')](',');var _0xa4a84a={};_0xa4a84a[_0x1304d0[0x0]]={'$gte':moment(_0x1304d0[0x1])[_0x8e70('0xa9')](_0x8e70('0xaa'))};_0x1cf25a[_0x8e70('0x4d')]=_['merge'](_0x1cf25a['where'],_0xa4a84a);}_0x1cf25a=_['merge']({},_0x1cf25a,_0x104dac[_0x8e70('0x58')]);return db[_0x8e70('0xa6')][_0x8e70('0x32')]({'where':_0x1cf25a[_0x8e70('0x4d')]})['then'](function(_0xd95dbd){_0x41b2e7[_0x8e70('0x32')]=_0xd95dbd;if(_0x104dac[_0x8e70('0x46')][_0x8e70('0x57')]){_0x1cf25a[_0x8e70('0x50')]=[{'all':!![]}];}return db[_0x8e70('0xa6')][_0x8e70('0x51')](_0x1cf25a);})[_0x8e70('0x21')](function(_0x129bf1){_0x41b2e7['rows']=_0x129bf1;return _0x41b2e7;});}})[_0x8e70('0x21')](respondWithFilteredResult(_0x5589c3,_0x1cf25a))['catch'](handleError(_0x5589c3,null));};exports[_0x8e70('0x3c')]=function(_0x1dce47,_0x358d75,_0xf7787){var _0x3c3f71,_0x562cdd={},_0x23bf9f;if(_0x1dce47[_0x8e70('0x5b')]['to']){_0x23bf9f=_0x1dce47[_0x8e70('0x5b')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x1dce47['params']['id']},'include':[{'model':db[_0x8e70('0xab')],'as':_0x8e70('0xac'),'include':[{'model':db[_0x8e70('0x75')],'as':'Contacts','where':{'fax':_0x23bf9f},'limit':0x1,'order':[['updatedAt',_0x8e70('0xad')]]}]}]})[_0x8e70('0x21')](handleEntityNotFound(_0x358d75,null))[_0x8e70('0x21')](function(_0x2bf7e6){_0x3c3f71=_0x2bf7e6;if(_0x1dce47[_0x8e70('0x5b')][_0x8e70('0xae')]&&_0x1dce47[_0x8e70('0x5b')][_0x8e70('0xae')][_0x8e70('0x56')]){for(var _0x2ab9ed=0x0;_0x2ab9ed<_0x1dce47[_0x8e70('0x5b')][_0x8e70('0xae')][_0x8e70('0x56')];_0x2ab9ed+=0x1){_0x1dce47[_0x8e70('0x5b')][_0x8e70('0xae')][_0x2ab9ed]={'filename':_0x1dce47[_0x8e70('0x5b')]['attachments'][_0x2ab9ed][_0x8e70('0x3b')],'id':_0x1dce47[_0x8e70('0x5b')][_0x8e70('0xae')][_0x2ab9ed]['id'],'path':path[_0x8e70('0xaf')](config['root'],_0x8e70('0xb0'),_0x1dce47['body'][_0x8e70('0xae')][_0x2ab9ed][_0x8e70('0xb1')])};}}return respondWithRpcPromise(_0x8e70('0xb2'),'CheckAfterSend',{'FaxAccountId':_[_0x8e70('0xb3')](_0x1dce47[_0x8e70('0x54')]['id'])?undefined:_0x1dce47[_0x8e70('0x54')]['id'],'path':_[_0x8e70('0xb3')](_0x1dce47['body'][_0x8e70('0xae')][0x0]['path'])?undefined:_0x1dce47[_0x8e70('0x5b')][_0x8e70('0xae')][0x0]['path'],'fax':_[_0x8e70('0xb3')](_0x1dce47['body']['to'][0x0])?undefined:_0x1dce47[_0x8e70('0x5b')]['to'][0x0]},client9002);})[_0x8e70('0x21')](function(){if(_0x3c3f71){if(_[_0x8e70('0xb3')](_0x1dce47[_0x8e70('0x5b')][_0x8e70('0xb4')])){_0x1dce47[_0x8e70('0x5b')][_0x8e70('0xb4')]=util['format'](_0x8e70('0xb5'),_0x3c3f71[_0x8e70('0x3b')],_0x3c3f71['fax']);}if(_0x3c3f71[_0x8e70('0xac')]){if(_0x3c3f71[_0x8e70('0xac')][_0x8e70('0xb6')][_0x8e70('0x56')]){return _0x3c3f71[_0x8e70('0xac')]['Contacts'][0x0];}else{return db[_0x8e70('0x75')]['create'](_['defaults'](_0x1dce47[_0x8e70('0x5b')],{'firstName':_0x1dce47['body']['to'][0x0],'phone':_0x1dce47[_0x8e70('0x5b')]['to'][0x0],'fax':_0x1dce47[_0x8e70('0x5b')]['to'][0x0],'ListId':_0x3c3f71[_0x8e70('0xb7')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x8e70('0xb8'));}})[_0x8e70('0x21')](function(_0x477e22){if(_0x477e22){return db['FaxInteraction']['find']({'where':{'ContactId':_0x477e22['id'],'closed':![],'FaxAccountId':_0x3c3f71['id']}})[_0x8e70('0x21')](function(_0x33a9ce){if(_0x33a9ce){return[_0x33a9ce,![]];}return db[_0x8e70('0x71')][_0x8e70('0x5a')]({'UserId':_0x1dce47[_0x8e70('0x5c')]['id'],'ContactId':_0x477e22['id'],'FaxAccountId':_0x3c3f71['id'],'fax':_0x1dce47[_0x8e70('0x5b')]['to'][0x0],'firstMsgDirection':_0x8e70('0xb9'),'Messages':[_[_0x8e70('0x4f')](_0x1dce47[_0x8e70('0x5b')],{'read':![],'body':_0x1dce47[_0x8e70('0x5b')][_0x8e70('0xae')][0x0][_0x8e70('0xba')],'FaxAccountId':_0x3c3f71['id'],'UserId':_0x1dce47[_0x8e70('0x5c')]['id'],'ContactId':_0x477e22['id'],'AttachmentId':_0x1dce47[_0x8e70('0x5b')]['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0x8e70('0x21')](function(_0x1a80fc){return[_0x1a80fc,!![]];});});}else{throw new Error(_0x8e70('0xbb'));}})['spread'](function(_0x8de478,_0x42badb){if(_0x42badb){return _0x8de478;}return db[_0x8e70('0xa6')][_0x8e70('0x5a')]({'direction':_0x8e70('0xb9'),'read':![],'body':_0x1dce47[_0x8e70('0x5b')][_0x8e70('0xae')][0x0][_0x8e70('0xba')],'FaxAccountId':_0x3c3f71['id'],'FaxInteractionId':_0x8de478['id'],'UserId':_0x1dce47['user']['id'],'ContactId':_0x8de478[_0x8e70('0xbc')],'AttachmentId':_0x1dce47[_0x8e70('0x5b')]['attachments'][0x0]['id']})[_0x8e70('0x21')](function(_0x45776d){_0x8de478[_0x8e70('0xbd')]['Messages']=[];_0x8de478[_0x8e70('0xbd')][_0x8e70('0xbe')]['push'](_0x45776d[_0x8e70('0xbd')]);return _0x8de478;});})['then'](function(_0x45dc2f){respondWithRpcPromise(_0x8e70('0xbf'),_0x8e70('0xbf'),{'FaxAccountId':_['isNil'](_0x1dce47[_0x8e70('0x54')]['id'])?undefined:_0x1dce47[_0x8e70('0x54')]['id'],'path':_['isNil'](_0x1dce47[_0x8e70('0x5b')]['attachments'][0x0][_0x8e70('0x8')])?undefined:_0x1dce47['body'][_0x8e70('0xae')][0x0][_0x8e70('0x8')],'fax':_[_0x8e70('0xb3')](_0x1dce47[_0x8e70('0x5b')]['to'][0x0])?undefined:_0x1dce47[_0x8e70('0x5b')]['to'][0x0],'AttachmentId':_0x1dce47[_0x8e70('0x5b')][_0x8e70('0xae')][0x0]['id']},client9002)[_0x8e70('0x21')](function(_0x5a3ae7){logger['info']('SendFaxRpc,\x20%s',_0x5a3ae7);})[_0x8e70('0x2a')](function(_0x386b00){logger[_0x8e70('0x22')](_0x8e70('0xc0'),_0x386b00);});return _0x45dc2f;})[_0x8e70('0x21')](respondWithResult(_0x358d75,null))[_0x8e70('0x2a')](handleError(_0x358d75,null));};exports[_0x8e70('0xc1')]=function(_0x4b97de,_0x7b10dc,_0x3375b5){return db[_0x8e70('0x40')][_0x8e70('0x59')]({'where':{'id':_0x4b97de[_0x8e70('0x54')]['id']}})[_0x8e70('0x21')](handleEntityNotFound(_0x7b10dc,null))[_0x8e70('0x21')](function(_0xda355d){if(_0xda355d){return _0xda355d[_0x8e70('0xc1')](_0x4b97de[_0x8e70('0x5b')][_0x8e70('0x6c')],_['omit'](_0x4b97de[_0x8e70('0x5b')],['ids','id'])||{})[_0x8e70('0xc2')](function(_0x2730ae){for(var _0x3bf941=0x0;_0x3bf941<_0x4b97de[_0x8e70('0x5b')][_0x8e70('0x6c')][_0x8e70('0x56')];_0x3bf941+=0x1){socket[_0x8e70('0xc3')](_0x8e70('0xc4'),{'UserId':Number(_0x4b97de[_0x8e70('0x5b')]['ids'][_0x3bf941]),'FaxAccountId':Number(_0x4b97de[_0x8e70('0x54')]['id'])});}return _0x2730ae;});}})[_0x8e70('0x21')](respondWithResult(_0x7b10dc,null))['catch'](handleError(_0x7b10dc,null));};exports[_0x8e70('0xc5')]=function(_0x37b177,_0x13751f,_0x3a5183){return db['FaxAccount'][_0x8e70('0x59')]({'where':{'id':_0x37b177['params']['id']}})[_0x8e70('0x21')](handleEntityNotFound(_0x13751f,null))[_0x8e70('0x21')](function(_0x3b8034){if(_0x3b8034){return _0x3b8034[_0x8e70('0xc5')](_0x37b177[_0x8e70('0x46')]['ids'])[_0x8e70('0x21')](function(){if(_['isArray'](_0x37b177[_0x8e70('0x46')][_0x8e70('0x6c')])){for(var _0x189a07=0x0;_0x189a07<_0x37b177[_0x8e70('0x46')]['ids'][_0x8e70('0x56')];_0x189a07+=0x1){socket[_0x8e70('0xc3')](_0x8e70('0xc6'),{'UserId':Number(_0x37b177[_0x8e70('0x46')][_0x8e70('0x6c')][_0x189a07]),'FaxAccountId':Number(_0x37b177[_0x8e70('0x54')]['id'])});}}else{socket[_0x8e70('0xc3')](_0x8e70('0xc6'),{'UserId':Number(_0x37b177[_0x8e70('0x46')]['ids']),'FaxAccountId':Number(_0x37b177[_0x8e70('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x13751f,null))[_0x8e70('0x2a')](handleError(_0x13751f,null));};exports[_0x8e70('0xc7')]=function(_0x68cf40,_0x467c42,_0x1b643e){var _0x32b35d={};var _0x5322ed={};var _0x331dc2;var _0xf4a4de;return db[_0x8e70('0x40')][_0x8e70('0x68')]({'where':{'id':_0x68cf40[_0x8e70('0x54')]['id']}})['then'](handleEntityNotFound(_0x467c42,null))[_0x8e70('0x21')](function(_0x1d9ae8){if(_0x1d9ae8){_0x331dc2=_0x1d9ae8;_0x5322ed[_0x8e70('0x44')]=_[_0x8e70('0x45')](db['User'][_0x8e70('0x41')]);_0x5322ed[_0x8e70('0x46')]=_[_0x8e70('0x45')](_0x68cf40[_0x8e70('0x46')]);_0x5322ed[_0x8e70('0x47')]=_['intersection'](_0x5322ed[_0x8e70('0x44')],_0x5322ed[_0x8e70('0x46')]);_0x32b35d[_0x8e70('0x49')]=_[_0x8e70('0x48')](_0x5322ed[_0x8e70('0x44')],qs[_0x8e70('0x4a')](_0x68cf40[_0x8e70('0x46')][_0x8e70('0x4a')]));_0x32b35d[_0x8e70('0x49')]=_0x32b35d[_0x8e70('0x49')][_0x8e70('0x56')]?_0x32b35d['attributes']:_0x5322ed['model'];_0x32b35d[_0x8e70('0x6f')]=qs[_0x8e70('0x4c')](_0x68cf40[_0x8e70('0x46')][_0x8e70('0x4c')]);_0x32b35d[_0x8e70('0x4d')]=qs[_0x8e70('0x47')](_[_0x8e70('0x6a')](_0x68cf40[_0x8e70('0x46')],_0x5322ed[_0x8e70('0x47')]));if(_0x68cf40[_0x8e70('0x46')][_0x8e70('0x4e')]){_0x32b35d[_0x8e70('0x4d')]=_[_0x8e70('0x4f')](_0x32b35d[_0x8e70('0x4d')],{'$or':_[_0x8e70('0x3f')](_0x32b35d['attributes'],function(_0x1759b4){var _0xe6207c={};_0xe6207c[_0x1759b4]={'$like':'%'+_0x68cf40['query'][_0x8e70('0x4e')]+'%'};return _0xe6207c;})});}_0x32b35d=_['merge']({},_0x32b35d,_0x68cf40[_0x8e70('0x58')]);return _0x331dc2['getAgents'](_0x32b35d);}})[_0x8e70('0x21')](function(_0x4c4994){if(_0x4c4994){_0xf4a4de=_0x4c4994[_0x8e70('0x56')];if(!_0x68cf40[_0x8e70('0x46')][_0x8e70('0x4b')](_0x8e70('0x69'))){_0x32b35d[_0x8e70('0x31')]=qs[_0x8e70('0x31')](_0x68cf40[_0x8e70('0x46')][_0x8e70('0x31')]);_0x32b35d[_0x8e70('0x2f')]=qs[_0x8e70('0x2f')](_0x68cf40[_0x8e70('0x46')][_0x8e70('0x2f')]);}return _0x331dc2['getAgents'](_0x32b35d);}})['then'](function(_0x436c9f){if(_0x436c9f){return _0x436c9f?{'count':_0xf4a4de,'rows':_0x436c9f}:null;}})['then'](respondWithResult(_0x467c42,null))['catch'](handleError(_0x467c42,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 946736e..7600bf9 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 _0xed62=['FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x378b4,_0x5ca7fa){var _0x11d07b=function(_0x35d420){while(--_0x35d420){_0x378b4['push'](_0x378b4['shift']());}};_0x11d07b(++_0x5ca7fa);}(_0xed62,0x139));var _0x2ed6=function(_0x154476,_0x51a1c5){_0x154476=_0x154476-0x0;var _0x4f01aa=_0xed62[_0x154476];return _0x4f01aa;};'use strict';var EventEmitter=require(_0x2ed6('0x0'));var FaxAccount=require(_0x2ed6('0x1'))['db'][_0x2ed6('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x2ed6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2ed6('0x4'),'afterDestroy':_0x2ed6('0x5')};function emitEvent(_0x1d43ba){return function(_0x4a48c8,_0x331420,_0x3bc572){FaxAccountEvents['emit'](_0x1d43ba+':'+_0x4a48c8['id'],_0x4a48c8);FaxAccountEvents[_0x2ed6('0x6')](_0x1d43ba,_0x4a48c8);_0x3bc572(null);};}for(var e in events){if(events[_0x2ed6('0x7')](e)){var event=events[e];FaxAccount[_0x2ed6('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0xcf54=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf54,0x125));var _0x4cf5=function(_0x311f44,_0x1d7f5b){_0x311f44=_0x311f44-0x0;var _0x46f1e6=_0xcf54[_0x311f44];return _0x46f1e6;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x4cf5('0x0'))['db'][_0x4cf5('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4cf5('0x2')](0x0);var events={'afterCreate':_0x4cf5('0x3'),'afterUpdate':_0x4cf5('0x4'),'afterDestroy':_0x4cf5('0x5')};function emitEvent(_0x46e588){return function(_0x4c5ffa,_0x28921a,_0x2d156a){FaxAccountEvents[_0x4cf5('0x6')](_0x46e588+':'+_0x4c5ffa['id'],_0x4c5ffa);FaxAccountEvents[_0x4cf5('0x6')](_0x46e588,_0x4c5ffa);_0x2d156a(null);};}for(var e in events){if(events[_0x4cf5('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x4cf5('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 c10dd4a..efce86a 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 _0xb4ad=['exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2ccce9,_0x1ebe50){var _0x3384c1=function(_0x23008c){while(--_0x23008c){_0x2ccce9['push'](_0x2ccce9['shift']());}};_0x3384c1(++_0x1ebe50);}(_0xb4ad,0x1a4));var _0xdb4a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb4ad[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdb4a('0x0'));var util=require(_0xdb4a('0x1'));var logger=require(_0xdb4a('0x2'))(_0xdb4a('0x3'));var moment=require(_0xdb4a('0x4'));var BPromise=require(_0xdb4a('0x5'));var rp=require(_0xdb4a('0x6'));var fs=require('fs');var path=require(_0xdb4a('0x7'));var rimraf=require(_0xdb4a('0x8'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0xdb4a('0x9')]=function(_0x263006,_0x1fe6b5){return _0x263006[_0xdb4a('0xa')](_0xdb4a('0xb'),attributes,{'tableName':_0xdb4a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4f7=['fax_accounts','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xf4f7,0xfd));var _0x7f4f=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0xf4f7[_0xffa198];return _0x1e4b50;};'use strict';var _=require(_0x7f4f('0x0'));var util=require('util');var logger=require(_0x7f4f('0x1'))(_0x7f4f('0x2'));var moment=require(_0x7f4f('0x3'));var BPromise=require('bluebird');var rp=require(_0x7f4f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f4f('0x5'));var config=require(_0x7f4f('0x6'));var attributes=require(_0x7f4f('0x7'));module[_0x7f4f('0x8')]=function(_0xc2f619,_0x5cef07){return _0xc2f619[_0x7f4f('0x9')](_0x7f4f('0xa'),attributes,{'tableName':_0x7f4f('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 36e22fa..07efdeb 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 _0x6fb1=['from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','account','Contacts','DESC','FaxApplication','Applications','get','List','orderBy','applications','priority','defaults','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','length','close','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','UserId','User','name','interaction','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxAccount','findAll','options','raw','where','attributes','include','model','map','GetFaxAccount','body','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','isNil','from','Sequelize'];(function(_0x551e94,_0x3df578){var _0x51d87a=function(_0x1a4bc5){while(--_0x1a4bc5){_0x551e94['push'](_0x551e94['shift']());}};_0x51d87a(++_0x3df578);}(_0x6fb1,0x136));var _0x16fb=function(_0xc86cfc,_0x3d5e51){_0xc86cfc=_0xc86cfc-0x0;var _0x41d8c7=_0x6fb1[_0xc86cfc];return _0x41d8c7;};'use strict';var _=require(_0x16fb('0x0'));var util=require(_0x16fb('0x1'));var moment=require(_0x16fb('0x2'));var BPromise=require(_0x16fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16fb('0x4'));var db=require(_0x16fb('0x5'))['db'];var utils=require(_0x16fb('0x6'));var logger=require(_0x16fb('0x7'))(_0x16fb('0x8'));var config=require(_0x16fb('0x9'));var jayson=require(_0x16fb('0xa'));var client=jayson[_0x16fb('0xb')][_0x16fb('0xc')]({'port':0x232c});config[_0x16fb('0xd')]=_['defaults'](config[_0x16fb('0xd')],{'host':_0x16fb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x16fb('0xf'))[_0x16fb('0x10')](socket);function respondWithRpcPromise(_0x2af934,_0x14855c,_0x3314eb){return new BPromise(function(_0x1ab391,_0x49fd0b){return client[_0x16fb('0x11')](_0x2af934,_0x3314eb)[_0x16fb('0x12')](function(_0x2be9e3){logger[_0x16fb('0x13')](_0x16fb('0x14'),_0x14855c,_0x16fb('0x15'));logger[_0x16fb('0x16')](_0x16fb('0x17'),_0x14855c,_0x16fb('0x15'),JSON[_0x16fb('0x18')](_0x2be9e3));if(_0x2be9e3[_0x16fb('0x19')]){if(_0x2be9e3[_0x16fb('0x19')][_0x16fb('0x1a')]===0x1f4){logger[_0x16fb('0x19')](_0x16fb('0x14'),_0x14855c,_0x2be9e3['error']['message']);return _0x49fd0b(_0x2be9e3[_0x16fb('0x19')][_0x16fb('0x1b')]);}logger[_0x16fb('0x19')]('FaxAccount,\x20%s,\x20%s',_0x14855c,_0x2be9e3[_0x16fb('0x19')][_0x16fb('0x1b')]);return _0x1ab391(_0x2be9e3['error'][_0x16fb('0x1b')]);}else{logger['info'](_0x16fb('0x14'),_0x14855c,_0x16fb('0x15'));_0x1ab391(_0x2be9e3[_0x16fb('0x1c')]['message']);}})[_0x16fb('0x1d')](function(_0x27c554){logger['error'](_0x16fb('0x14'),_0x14855c,_0x27c554);_0x49fd0b(_0x27c554);});});}exports['GetFaxAccount']=function(_0x187c4f){var _0x27da07=this;return new Promise(function(_0x35a3ce,_0x65ebe5){return db[_0x16fb('0x1e')][_0x16fb('0x1f')]({'raw':_0x187c4f[_0x16fb('0x20')]?_0x187c4f[_0x16fb('0x20')][_0x16fb('0x21')]===undefined?!![]:![]:!![],'where':_0x187c4f[_0x16fb('0x20')]?_0x187c4f[_0x16fb('0x20')][_0x16fb('0x22')]||null:null,'attributes':_0x187c4f['options']?_0x187c4f[_0x16fb('0x20')][_0x16fb('0x23')]||null:null,'limit':_0x187c4f[_0x16fb('0x20')]?_0x187c4f[_0x16fb('0x20')]['limit']||null:null,'include':_0x187c4f[_0x16fb('0x20')]?_0x187c4f[_0x16fb('0x20')]['include']?_['map'](_0x187c4f[_0x16fb('0x20')][_0x16fb('0x24')],function(_0x2e0a8a){return{'model':db[_0x2e0a8a[_0x16fb('0x25')]],'as':_0x2e0a8a['as'],'attributes':_0x2e0a8a[_0x16fb('0x23')],'include':_0x2e0a8a['include']?_[_0x16fb('0x26')](_0x2e0a8a[_0x16fb('0x24')],function(_0x19da9a){return{'model':db[_0x19da9a['model']],'as':_0x19da9a['as'],'attributes':_0x19da9a[_0x16fb('0x23')],'include':_0x19da9a[_0x16fb('0x24')]?_['map'](_0x19da9a[_0x16fb('0x24')],function(_0x58cf30){return{'model':db[_0x58cf30[_0x16fb('0x25')]],'as':_0x58cf30['as'],'attributes':_0x58cf30[_0x16fb('0x23')]};}):[]};}):[]};}):[]:[]})[_0x16fb('0x12')](function(_0x5dd275){logger['info'](_0x16fb('0x27'),_0x187c4f);logger[_0x16fb('0x16')](_0x16fb('0x27'),_0x187c4f,JSON[_0x16fb('0x18')](_0x5dd275));_0x35a3ce(_0x5dd275);})[_0x16fb('0x1d')](function(_0x2697e2){logger['error'](_0x16fb('0x27'),_0x2697e2[_0x16fb('0x1b')],_0x187c4f);_0x65ebe5(_0x27da07[_0x16fb('0x19')](0x1f4,_0x2697e2['message']));});});};exports['NotifyFaxAccount']=function(_0x19d4b7,_0x4a65f6,_0x4dd0fd){var _0x22c430=this;return new Promise(function(_0x48a3a7,_0x30c0d0){var _0x307ca4={'body':_0x19d4b7[_0x16fb('0x28')],'channel':_0x16fb('0x29')};var _0x5807fb=[];var _0x2efb42=[];var _0x55005c={};return db[_0x16fb('0x2a')][_0x16fb('0x2b')]()['then'](function(_0xc69068){if(!_0xc69068){throw new db['Sequelize'][(_0x16fb('0x2c'))](_0x16fb('0x2d'));}_0x5807fb=_[_0x16fb('0x2e')](_[_0x16fb('0x2f')](_0xc69068),[_0x16fb('0x30'),'updatedAt']);_0x2efb42=_[_0x16fb('0x2e')](_[_0x16fb('0x2f')](_0xc69068),['createdAt',_0x16fb('0x31'),'CompanyId',_0x16fb('0x32')]);if(_0x19d4b7[_0x16fb('0x28')]['id']){delete _0x19d4b7[_0x16fb('0x28')]['id'];}if(_[_0x16fb('0x33')](_0x19d4b7['body'][_0x16fb('0x34')])){throw new db[(_0x16fb('0x35'))][(_0x16fb('0x2c'))](_0x16fb('0x36'));}if(_[_0x16fb('0x33')](_0x19d4b7[_0x16fb('0x28')][_0x16fb('0x28')])||_0x19d4b7[_0x16fb('0x28')][_0x16fb('0x28')]===''){throw new db[(_0x16fb('0x35'))][(_0x16fb('0x2c'))](_0x16fb('0x37'));}if(_['isNil'](_0x19d4b7[_0x16fb('0x28')][_0x16fb('0x38')])){throw new db['Sequelize'][(_0x16fb('0x2c'))](_0x16fb('0x39')+_0x2efb42);}if(!_[_0x16fb('0x3a')](_0x2efb42,_0x19d4b7['body']['mapKey'])){throw new db[(_0x16fb('0x35'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2efb42);}_0x55005c[_0x19d4b7[_0x16fb('0x28')]['mapKey']]=_0x19d4b7[_0x16fb('0x28')][_0x16fb('0x34')];})[_0x16fb('0x12')](function(){return db[_0x16fb('0x1e')][_0x16fb('0x3b')]({'where':{'id':_0x19d4b7[_0x16fb('0x3c')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x16fb('0x2a')],'as':_0x16fb('0x3d'),'where':_0x55005c,'limit':0x1,'order':[[_0x16fb('0x31'),_0x16fb('0x3e')]]}]},{'model':db[_0x16fb('0x3f')],'as':_0x16fb('0x40')}]});})[_0x16fb('0x12')](function(_0x3bc8b5){if(_0x3bc8b5&&_0x3bc8b5['List']){var _0x51de04=_0x3bc8b5[_0x16fb('0x41')]({'plain':!![]});_0x307ca4[_0x16fb('0x3c')]=_0x51de04;_0x307ca4['applications']=_0x51de04[_0x16fb('0x40')];_0x307ca4['list']=_0x51de04[_0x16fb('0x42')];_0x307ca4['applications']=_[_0x16fb('0x43')](_0x307ca4[_0x16fb('0x44')],[_0x16fb('0x45')],['asc']);if(_0x307ca4[_0x16fb('0x3c')][_0x16fb('0x40')]){delete _0x307ca4['account'][_0x16fb('0x40')];}if(_0x307ca4['account'][_0x16fb('0x42')]&&_0x307ca4['account'][_0x16fb('0x42')][_0x16fb('0x3d')]['length']){return _0x307ca4['account']['List'][_0x16fb('0x3d')][0x0];}var _0x2dc90e=_[_0x16fb('0x46')](_0x19d4b7['body'],{'firstName':_0x19d4b7[_0x16fb('0x28')][_0x16fb('0x34')],'ListId':_0x51de04[_0x16fb('0x32')]});_0x2dc90e[_0x19d4b7[_0x16fb('0x28')][_0x16fb('0x38')]]=_0x19d4b7[_0x16fb('0x28')][_0x16fb('0x34')];return db[_0x16fb('0x2a')][_0x16fb('0x47')](_0x2dc90e,{'fields':_0x5807fb,'raw':!![]});}})[_0x16fb('0x12')](function(_0x27839f){_0x307ca4[_0x16fb('0x48')]=_0x27839f;if(_0x27839f){var _0x41979d={'ContactId':_0x27839f['id'],'FaxAccountId':_0x19d4b7[_0x16fb('0x3c')]['id'],'fax':_0x27839f[_0x16fb('0x29')]};return db[_0x16fb('0x49')]['find']({'where':{'ContactId':_0x27839f['id'],'closed':![],'FaxAccountId':_0x19d4b7[_0x16fb('0x3c')]['id']}})[_0x16fb('0x12')](function(_0x1cba8e){if(_0x1cba8e){return[_0x1cba8e,![]];}return db['FaxInteraction'][_0x16fb('0x47')](_0x41979d)[_0x16fb('0x12')](function(_0x3676bb){return[_0x3676bb,!![]];});});}else{throw new Error(_0x16fb('0x4a'));}})['spread'](function(_0x36629d,_0x277d25){var _0x2b17be=_0x36629d[_0x16fb('0x41')]({'plain':!![]});if(_0x277d25){if(_0x307ca4[_0x16fb('0x3c')][_0x16fb('0x4b')]){_0x307ca4[_0x16fb('0x44')]['push']({'id':0x0,'priority':_0x307ca4[_0x16fb('0x44')][_0x16fb('0x4c')]+0x1,'app':_0x16fb('0x4d'),'appdata':'unmanaged','interval':_0x16fb('0x4e')});}_0x2b17be[_0x16fb('0x4f')]=!![];}else{_0x2b17be[_0x16fb('0x4f')]=![];}_0x307ca4['interaction']=_0x2b17be;return db[_0x16fb('0x50')]['create']({'body':_0x19d4b7['body']['body'],'FaxAccountId':_0x19d4b7[_0x16fb('0x3c')]['id'],'FaxInteractionId':_0x36629d['id'],'direction':'in','ContactId':_0x36629d[_0x16fb('0x51')],'AttachmentId':_0x19d4b7[_0x16fb('0x28')][_0x16fb('0x52')]});})[_0x16fb('0x12')](function(_0x5228d2){_0x307ca4[_0x16fb('0x1b')]=_0x5228d2;if(_0x307ca4['interaction'][_0x16fb('0x53')]){return db[_0x16fb('0x54')]['find']({'attributes':['id',_0x16fb('0x55')],'where':{'id':_0x307ca4[_0x16fb('0x56')][_0x16fb('0x53')]}})['then'](function(_0x1a9915){if(_0x1a9915){_0x307ca4[_0x16fb('0x44')][_0x16fb('0x57')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1a9915[_0x16fb('0x55')]+','+(_0x307ca4[_0x16fb('0x3c')][_0x16fb('0x58')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x16fb('0x59'),_0x16fb('0x5a'),_0x307ca4);});}return respondWithRpcPromise('Start',_0x16fb('0x5a'),_0x307ca4);})[_0x16fb('0x12')](function(_0x1e9d91){_0x48a3a7(_0x1e9d91);})[_0x16fb('0x1d')](function(_0x454993){_0x30c0d0(_0x22c430['error'](0x1f4,_0x454993[_0x16fb('0x1b')]));});});}; \ No newline at end of file +var _0x3121=['result','catch','FaxAccount','options','attributes','include','map','model','GetFaxAccount','stringify','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','from','from\x20is\x20mandatory','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','length','defaults','ListId','create','contact','FaxInteraction','spread','autoclose','push','unmanaged','*,*,*,*','FaxMessage','AttachmentId','interaction','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','FaxAccount,\x20%s,\x20%s'];(function(_0x29e3b6,_0x40b0b4){var _0x55d4b0=function(_0x55c58e){while(--_0x55c58e){_0x29e3b6['push'](_0x29e3b6['shift']());}};_0x55d4b0(++_0x40b0b4);}(_0x3121,0x1ed));var _0x1312=function(_0x894521,_0x4dab5b){_0x894521=_0x894521-0x0;var _0x19e236=_0x3121[_0x894521];return _0x19e236;};'use strict';var _=require(_0x1312('0x0'));var util=require(_0x1312('0x1'));var moment=require(_0x1312('0x2'));var BPromise=require(_0x1312('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1312('0x4'));var db=require(_0x1312('0x5'))['db'];var utils=require(_0x1312('0x6'));var logger=require(_0x1312('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1312('0x8'));var client=jayson[_0x1312('0x9')]['http']({'port':0x232c});config[_0x1312('0xa')]=_['defaults'](config[_0x1312('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1312('0xb'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x1312('0xc')](socket);function respondWithRpcPromise(_0xe668a8,_0x399692,_0x522d91){return new BPromise(function(_0x24f259,_0x366cf6){return client[_0x1312('0xd')](_0xe668a8,_0x522d91)[_0x1312('0xe')](function(_0x82c88a){logger[_0x1312('0xf')]('FaxAccount,\x20%s,\x20%s',_0x399692,_0x1312('0x10'));logger[_0x1312('0x11')](_0x1312('0x12'),_0x399692,_0x1312('0x10'),JSON['stringify'](_0x82c88a));if(_0x82c88a[_0x1312('0x13')]){if(_0x82c88a[_0x1312('0x13')][_0x1312('0x14')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x399692,_0x82c88a[_0x1312('0x13')][_0x1312('0x15')]);return _0x366cf6(_0x82c88a[_0x1312('0x13')][_0x1312('0x15')]);}logger[_0x1312('0x13')](_0x1312('0x16'),_0x399692,_0x82c88a[_0x1312('0x13')]['message']);return _0x24f259(_0x82c88a['error'][_0x1312('0x15')]);}else{logger[_0x1312('0xf')](_0x1312('0x16'),_0x399692,'request\x20sent');_0x24f259(_0x82c88a[_0x1312('0x17')]['message']);}})[_0x1312('0x18')](function(_0x43fab6){logger[_0x1312('0x13')](_0x1312('0x16'),_0x399692,_0x43fab6);_0x366cf6(_0x43fab6);});});}exports['GetFaxAccount']=function(_0xd7f982){var _0x1c857b=this;return new Promise(function(_0x1c83c8,_0x12a712){return db[_0x1312('0x19')]['findAll']({'raw':_0xd7f982[_0x1312('0x1a')]?_0xd7f982[_0x1312('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xd7f982[_0x1312('0x1a')]?_0xd7f982['options']['where']||null:null,'attributes':_0xd7f982[_0x1312('0x1a')]?_0xd7f982[_0x1312('0x1a')][_0x1312('0x1b')]||null:null,'limit':_0xd7f982[_0x1312('0x1a')]?_0xd7f982[_0x1312('0x1a')]['limit']||null:null,'include':_0xd7f982[_0x1312('0x1a')]?_0xd7f982[_0x1312('0x1a')][_0x1312('0x1c')]?_[_0x1312('0x1d')](_0xd7f982[_0x1312('0x1a')][_0x1312('0x1c')],function(_0x46af54){return{'model':db[_0x46af54[_0x1312('0x1e')]],'as':_0x46af54['as'],'attributes':_0x46af54[_0x1312('0x1b')],'include':_0x46af54['include']?_['map'](_0x46af54['include'],function(_0x16f1fa){return{'model':db[_0x16f1fa['model']],'as':_0x16f1fa['as'],'attributes':_0x16f1fa['attributes'],'include':_0x16f1fa[_0x1312('0x1c')]?_[_0x1312('0x1d')](_0x16f1fa[_0x1312('0x1c')],function(_0x143608){return{'model':db[_0x143608[_0x1312('0x1e')]],'as':_0x143608['as'],'attributes':_0x143608[_0x1312('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1312('0xe')](function(_0x125bfa){logger[_0x1312('0xf')](_0x1312('0x1f'),_0xd7f982);logger[_0x1312('0x11')](_0x1312('0x1f'),_0xd7f982,JSON[_0x1312('0x20')](_0x125bfa));_0x1c83c8(_0x125bfa);})[_0x1312('0x18')](function(_0x3aed4b){logger['error']('GetFaxAccount',_0x3aed4b[_0x1312('0x15')],_0xd7f982);_0x12a712(_0x1c857b['error'](0x1f4,_0x3aed4b[_0x1312('0x15')]));});});};exports[_0x1312('0x21')]=function(_0x3230f9,_0x5dc0cf,_0x4a5b52){var _0x4a0d3c=this;return new Promise(function(_0x254f25,_0x464485){var _0x2dc54a={'body':_0x3230f9[_0x1312('0x22')],'channel':_0x1312('0x23')};var _0x225ffa=[];var _0x4d3da0=[];var _0x3a4a92={};return db[_0x1312('0x24')][_0x1312('0x25')]()['then'](function(_0x290b44){if(!_0x290b44){throw new db[(_0x1312('0x26'))][(_0x1312('0x27'))](_0x1312('0x28'));}_0x225ffa=_[_0x1312('0x29')](_[_0x1312('0x2a')](_0x290b44),['createdAt',_0x1312('0x2b')]);_0x4d3da0=_[_0x1312('0x29')](_[_0x1312('0x2a')](_0x290b44),[_0x1312('0x2c'),_0x1312('0x2b'),'CompanyId','ListId']);if(_0x3230f9['body']['id']){delete _0x3230f9[_0x1312('0x22')]['id'];}if(_['isNil'](_0x3230f9['body'][_0x1312('0x2d')])){throw new db['Sequelize'][(_0x1312('0x27'))](_0x1312('0x2e'));}if(_[_0x1312('0x2f')](_0x3230f9['body']['body'])||_0x3230f9[_0x1312('0x22')]['body']===''){throw new db['Sequelize'][(_0x1312('0x27'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1312('0x2f')](_0x3230f9['body']['mapKey'])){throw new db[(_0x1312('0x26'))][(_0x1312('0x27'))](_0x1312('0x30')+_0x4d3da0);}if(!_['includes'](_0x4d3da0,_0x3230f9[_0x1312('0x22')][_0x1312('0x31')])){throw new db[(_0x1312('0x26'))]['ValidationError'](_0x1312('0x32')+_0x4d3da0);}_0x3a4a92[_0x3230f9[_0x1312('0x22')]['mapKey']]=_0x3230f9['body'][_0x1312('0x2d')];})[_0x1312('0xe')](function(){return db[_0x1312('0x19')][_0x1312('0x33')]({'where':{'id':_0x3230f9[_0x1312('0x34')]['id']},'include':[{'model':db[_0x1312('0x35')],'as':_0x1312('0x36'),'include':[{'model':db[_0x1312('0x24')],'as':_0x1312('0x37'),'where':_0x3a4a92,'limit':0x1,'order':[['updatedAt',_0x1312('0x38')]]}]},{'model':db[_0x1312('0x39')],'as':_0x1312('0x3a')}]});})[_0x1312('0xe')](function(_0x582bd2){if(_0x582bd2&&_0x582bd2[_0x1312('0x36')]){var _0x34295f=_0x582bd2[_0x1312('0x3b')]({'plain':!![]});_0x2dc54a[_0x1312('0x34')]=_0x34295f;_0x2dc54a[_0x1312('0x3c')]=_0x34295f[_0x1312('0x3a')];_0x2dc54a[_0x1312('0x3d')]=_0x34295f['List'];_0x2dc54a[_0x1312('0x3c')]=_[_0x1312('0x3e')](_0x2dc54a[_0x1312('0x3c')],[_0x1312('0x3f')],[_0x1312('0x40')]);if(_0x2dc54a['account'][_0x1312('0x3a')]){delete _0x2dc54a['account'][_0x1312('0x3a')];}if(_0x2dc54a[_0x1312('0x34')][_0x1312('0x36')]&&_0x2dc54a['account'][_0x1312('0x36')][_0x1312('0x37')][_0x1312('0x41')]){return _0x2dc54a[_0x1312('0x34')][_0x1312('0x36')][_0x1312('0x37')][0x0];}var _0x5b6040=_[_0x1312('0x42')](_0x3230f9[_0x1312('0x22')],{'firstName':_0x3230f9[_0x1312('0x22')][_0x1312('0x2d')],'ListId':_0x34295f[_0x1312('0x43')]});_0x5b6040[_0x3230f9[_0x1312('0x22')][_0x1312('0x31')]]=_0x3230f9[_0x1312('0x22')]['from'];return db['CmContact'][_0x1312('0x44')](_0x5b6040,{'fields':_0x225ffa,'raw':!![]});}})['then'](function(_0x516b50){_0x2dc54a[_0x1312('0x45')]=_0x516b50;if(_0x516b50){var _0x57822a={'ContactId':_0x516b50['id'],'FaxAccountId':_0x3230f9[_0x1312('0x34')]['id'],'fax':_0x516b50[_0x1312('0x23')]};return db['FaxInteraction'][_0x1312('0x33')]({'where':{'ContactId':_0x516b50['id'],'closed':![],'FaxAccountId':_0x3230f9['account']['id']}})['then'](function(_0x130ab1){if(_0x130ab1){return[_0x130ab1,![]];}return db[_0x1312('0x46')][_0x1312('0x44')](_0x57822a)[_0x1312('0xe')](function(_0x5b9455){return[_0x5b9455,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x1312('0x47')](function(_0x5766dc,_0x55fa3f){var _0x1591ca=_0x5766dc[_0x1312('0x3b')]({'plain':!![]});if(_0x55fa3f){if(_0x2dc54a[_0x1312('0x34')][_0x1312('0x48')]){_0x2dc54a[_0x1312('0x3c')][_0x1312('0x49')]({'id':0x0,'priority':_0x2dc54a[_0x1312('0x3c')][_0x1312('0x41')]+0x1,'app':'close','appdata':_0x1312('0x4a'),'interval':_0x1312('0x4b')});}_0x1591ca['created']=!![];}else{_0x1591ca['created']=![];}_0x2dc54a['interaction']=_0x1591ca;return db[_0x1312('0x4c')][_0x1312('0x44')]({'body':_0x3230f9[_0x1312('0x22')][_0x1312('0x22')],'FaxAccountId':_0x3230f9['account']['id'],'FaxInteractionId':_0x5766dc['id'],'direction':'in','ContactId':_0x5766dc['ContactId'],'AttachmentId':_0x3230f9[_0x1312('0x22')][_0x1312('0x4d')]});})[_0x1312('0xe')](function(_0x2ecb47){_0x2dc54a[_0x1312('0x15')]=_0x2ecb47;if(_0x2dc54a[_0x1312('0x4e')][_0x1312('0x4f')]){return db[_0x1312('0x50')][_0x1312('0x33')]({'attributes':['id','name'],'where':{'id':_0x2dc54a[_0x1312('0x4e')][_0x1312('0x4f')]}})[_0x1312('0xe')](function(_0x27ab6c){if(_0x27ab6c){_0x2dc54a[_0x1312('0x3c')][_0x1312('0x51')]({'id':0x0,'priority':0x0,'app':_0x1312('0x52'),'appdata':_0x27ab6c[_0x1312('0x53')]+','+(_0x2dc54a[_0x1312('0x34')][_0x1312('0x54')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x1312('0x55'),'startRouting',_0x2dc54a);});}return respondWithRpcPromise('Start','startRouting',_0x2dc54a);})[_0x1312('0xe')](function(_0x4a9e9e){_0x254f25(_0x4a9e9e);})[_0x1312('0x18')](function(_0x580da1){_0x464485(_0x4a0d3c['error'](0x1f4,_0x580da1[_0x1312('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 71def6a..f844073 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 _0xcddb=['emit','removeListener','length','faxAccount:','save','remove','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xcddb,0x19a));var _0xbcdd=function(_0x572cfd,_0x10d3ed){_0x572cfd=_0x572cfd-0x0;var _0x3f006f=_0xcddb[_0x572cfd];return _0x3f006f;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xbcdd('0x0'),_0xbcdd('0x1'),_0xbcdd('0x2')];function createListener(_0x53e2a7,_0x22146f){return function(_0x2fa3b6){_0x22146f[_0xbcdd('0x3')](_0x53e2a7,_0x2fa3b6);};}function removeListener(_0x5e86fc,_0x24ff47){return function(){FaxAccountEvents[_0xbcdd('0x4')](_0x5e86fc,_0x24ff47);};}exports['register']=function(_0x31eac7){for(var _0x3e9bea=0x0,_0x2f2720=events[_0xbcdd('0x5')];_0x3e9bea<_0x2f2720;_0x3e9bea++){var _0x3cafbf=events[_0x3e9bea];var _0x2676dd=createListener(_0xbcdd('0x6')+_0x3cafbf,_0x31eac7);FaxAccountEvents['on'](_0x3cafbf,_0x2676dd);}}; \ No newline at end of file +var _0xa8c9=['register','length','faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener'];(function(_0x38309f,_0x517a83){var _0x24dc61=function(_0x2063b8){while(--_0x2063b8){_0x38309f['push'](_0x38309f['shift']());}};_0x24dc61(++_0x517a83);}(_0xa8c9,0x17d));var _0x9a8c=function(_0xbf1c85,_0x30b43e){_0xbf1c85=_0xbf1c85-0x0;var _0x4a3796=_0xa8c9[_0xbf1c85];return _0x4a3796;};'use strict';var FaxAccountEvents=require(_0x9a8c('0x0'));var events=[_0x9a8c('0x1'),_0x9a8c('0x2'),_0x9a8c('0x3')];function createListener(_0x547de6,_0x3ce9a3){return function(_0x2cf20e){_0x3ce9a3[_0x9a8c('0x4')](_0x547de6,_0x2cf20e);};}function removeListener(_0x1b7687,_0x4978e0){return function(){FaxAccountEvents[_0x9a8c('0x5')](_0x1b7687,_0x4978e0);};}exports[_0x9a8c('0x6')]=function(_0x540f5){for(var _0x2f6e23=0x0,_0x4b5db4=events[_0x9a8c('0x7')];_0x2f6e23<_0x4b5db4;_0x2f6e23++){var _0x5ed16d=events[_0x2f6e23];var _0x107fcf=createListener(_0x9a8c('0x8')+_0x5ed16d,_0x540f5);FaxAccountEvents['on'](_0x5ed16d,_0x107fcf);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index bf5c47f..ca6d8bf 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(_0x3f6fcf,_0x289344){var _0x5e656c=function(_0x9279e1){while(--_0x9279e1){_0x3f6fcf['push'](_0x3f6fcf['shift']());}};_0x5e656c(++_0x289344);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x3624e8,_0x16081e){var _0x32fabc=function(_0x224144){while(--_0x224144){_0x3624e8['push'](_0x3624e8['shift']());}};_0x32fabc(++_0x16081e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('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 6ccbac2..052ae33 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 _0x07e2=['sequelize','exports','INTEGER','noop','STRING'];(function(_0x271740,_0x3994c1){var _0x447d2d=function(_0x4fc2ec){while(--_0x4fc2ec){_0x271740['push'](_0x271740['shift']());}};_0x447d2d(++_0x3994c1);}(_0x07e2,0xfa));var _0x207e=function(_0x3b452b,_0x418f83){_0x3b452b=_0x3b452b-0x0;var _0x2f7930=_0x07e2[_0x3b452b];return _0x2f7930;};'use strict';var Sequelize=require(_0x207e('0x0'));module[_0x207e('0x1')]={'priority':{'type':Sequelize[_0x207e('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x207e('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x207e('0x4')]},'interval':{'type':Sequelize[_0x207e('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xa7ac=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa7ac,0x15f));var _0xca7a=function(_0x397fc8,_0x27e229){_0x397fc8=_0x397fc8-0x0;var _0x1361a3=_0xa7ac[_0x397fc8];return _0x1361a3;};'use strict';var Sequelize=require(_0xca7a('0x0'));module[_0xca7a('0x1')]={'priority':{'type':Sequelize[_0xca7a('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xca7a('0x3')},'appdata':{'type':Sequelize[_0xca7a('0x4')]()},'description':{'type':Sequelize[_0xca7a('0x5')]},'interval':{'type':Sequelize[_0xca7a('0x5')],'defaultValue':_0xca7a('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 2296fb6..6bb0efe 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 _0xd2ae=['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','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','FaxApplication','includeAll','findAll','rows','show','rawAttributes','intersection','length','include','find','catch','create','body','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x305b04,_0x4820b3){var _0x186b35=function(_0x428ee3){while(--_0x428ee3){_0x305b04['push'](_0x305b04['shift']());}};_0x186b35(++_0x4820b3);}(_0xd2ae,0x1cf));var _0xed2a=function(_0x2e0338,_0x317189){_0x2e0338=_0x2e0338-0x0;var _0x3f4266=_0xd2ae[_0x2e0338];return _0x3f4266;};'use strict';var emlformat=require(_0xed2a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xed2a('0x1'));var rp=require(_0xed2a('0x2'));var moment=require(_0xed2a('0x3'));var BPromise=require(_0xed2a('0x4'));var Mustache=require(_0xed2a('0x5'));var util=require(_0xed2a('0x6'));var path=require(_0xed2a('0x7'));var sox=require(_0xed2a('0x8'));var csv=require(_0xed2a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed2a('0xa'));var _=require(_0xed2a('0xb'));var squel=require('squel');var crypto=require(_0xed2a('0xc'));var jsforce=require(_0xed2a('0xd'));var deskjs=require(_0xed2a('0xe'));var toCsv=require(_0xed2a('0x9'));var querystring=require('querystring');var Papa=require(_0xed2a('0xf'));var Redis=require(_0xed2a('0x10'));var authService=require(_0xed2a('0x11'));var qs=require(_0xed2a('0x12'));var as=require(_0xed2a('0x13'));var hardwareService=require(_0xed2a('0x14'));var logger=require(_0xed2a('0x15'))(_0xed2a('0x16'));var utils=require(_0xed2a('0x17'));var config=require(_0xed2a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xed2a('0x19'))['db'];function respondWithStatusCode(_0x15494a,_0xc49271){_0xc49271=_0xc49271||0xcc;return function(_0x5f41b9){if(_0x5f41b9){return _0x15494a['sendStatus'](_0xc49271);}return _0x15494a[_0xed2a('0x1a')](_0xc49271)[_0xed2a('0x1b')]();};}function respondWithResult(_0x52683b,_0x16e0d6){_0x16e0d6=_0x16e0d6||0xc8;return function(_0x5445db){if(_0x5445db){return _0x52683b[_0xed2a('0x1a')](_0x16e0d6)[_0xed2a('0x1c')](_0x5445db);}};}function respondWithFilteredResult(_0x2ec139,_0x446c81){return function(_0x4e7fad){if(_0x4e7fad){var _0x2bd315=typeof _0x446c81[_0xed2a('0x1d')]===_0xed2a('0x1e')&&typeof _0x446c81['limit']===_0xed2a('0x1e');var _0x5e1beb=_0x4e7fad[_0xed2a('0x1f')];var _0x387172=_0x2bd315?0x0:_0x446c81[_0xed2a('0x1d')];var _0x22087f=_0x2bd315?_0x4e7fad[_0xed2a('0x1f')]:_0x446c81[_0xed2a('0x1d')]+_0x446c81[_0xed2a('0x20')];var _0xbb7e2e;if(_0x22087f>=_0x5e1beb){_0x22087f=_0x5e1beb;_0xbb7e2e=0xc8;}else{_0xbb7e2e=0xce;}_0x2ec139[_0xed2a('0x1a')](_0xbb7e2e);return _0x2ec139[_0xed2a('0x21')](_0xed2a('0x22'),_0x387172+'-'+_0x22087f+'/'+_0x5e1beb)[_0xed2a('0x1c')](_0x4e7fad);}return null;};}function patchUpdates(_0x183deb){return function(_0x1ceefa){try{jsonpatch[_0xed2a('0x23')](_0x1ceefa,_0x183deb,!![]);}catch(_0x51bcb6){return BPromise[_0xed2a('0x24')](_0x51bcb6);}return _0x1ceefa[_0xed2a('0x25')]();};}function saveUpdates(_0x23369e,_0x241849){return function(_0x5f3321){if(_0x5f3321){return _0x5f3321[_0xed2a('0x26')](_0x23369e)[_0xed2a('0x27')](function(_0x534c6c){return _0x534c6c;});}return null;};}function removeEntity(_0x10b707,_0x501e1a){return function(_0x4be3bb){if(_0x4be3bb){return _0x4be3bb[_0xed2a('0x28')]()['then'](function(){_0x10b707[_0xed2a('0x1a')](0xcc)[_0xed2a('0x1b')]();});}};}function handleEntityNotFound(_0x54fa71,_0x5aaedb){return function(_0x4fa4f1){if(!_0x4fa4f1){_0x54fa71[_0xed2a('0x29')](0x194);}return _0x4fa4f1;};}function handleError(_0x52e003,_0x2e42e8){_0x2e42e8=_0x2e42e8||0x1f4;return function(_0x4b14fd){logger[_0xed2a('0x2a')](_0x4b14fd[_0xed2a('0x2b')]);if(_0x4b14fd[_0xed2a('0x2c')]){delete _0x4b14fd[_0xed2a('0x2c')];}_0x52e003['status'](_0x2e42e8)[_0xed2a('0x2d')](_0x4b14fd);};}exports[_0xed2a('0x2e')]=function(_0x1aa73f,_0x5831ce){var _0x3e4279={},_0x3e1d44={},_0xb298df={'count':0x0,'rows':[]};var _0x43339f=_[_0xed2a('0x2f')](db['FaxApplication']['rawAttributes'],function(_0x4d85d0){return{'name':_0x4d85d0['fieldName'],'type':_0x4d85d0[_0xed2a('0x30')][_0xed2a('0x31')]};});_0x3e1d44[_0xed2a('0x32')]=_['map'](_0x43339f,_0xed2a('0x2c'));_0x3e1d44[_0xed2a('0x33')]=_[_0xed2a('0x34')](_0x1aa73f[_0xed2a('0x33')]);_0x3e1d44[_0xed2a('0x35')]=_['intersection'](_0x3e1d44['model'],_0x3e1d44[_0xed2a('0x33')]);_0x3e4279['attributes']=_['intersection'](_0x3e1d44[_0xed2a('0x32')],qs[_0xed2a('0x36')](_0x1aa73f['query'][_0xed2a('0x36')]));_0x3e4279['attributes']=_0x3e4279[_0xed2a('0x37')]['length']?_0x3e4279[_0xed2a('0x37')]:_0x3e1d44[_0xed2a('0x32')];if(!_0x1aa73f[_0xed2a('0x33')][_0xed2a('0x38')](_0xed2a('0x39'))){_0x3e4279[_0xed2a('0x20')]=qs[_0xed2a('0x20')](_0x1aa73f[_0xed2a('0x33')][_0xed2a('0x20')]);_0x3e4279[_0xed2a('0x1d')]=qs['offset'](_0x1aa73f[_0xed2a('0x33')][_0xed2a('0x1d')]);}_0x3e4279[_0xed2a('0x3a')]=qs[_0xed2a('0x3b')](_0x1aa73f['query'][_0xed2a('0x3b')]);_0x3e4279['where']=qs[_0xed2a('0x35')](_[_0xed2a('0x3c')](_0x1aa73f['query'],_0x3e1d44['filters']),_0x43339f);if(_0x1aa73f[_0xed2a('0x33')][_0xed2a('0x3d')]){_0x3e4279['where']=_[_0xed2a('0x3e')](_0x3e4279[_0xed2a('0x3f')],{'$or':_[_0xed2a('0x2f')](_0x43339f,function(_0x4f011c){if(_0x4f011c[_0xed2a('0x30')]!=='VIRTUAL'){var _0x41f989={};_0x41f989[_0x4f011c[_0xed2a('0x2c')]]={'$like':'%'+_0x1aa73f['query'][_0xed2a('0x3d')]+'%'};return _0x41f989;}})});}_0x3e4279=_[_0xed2a('0x3e')]({},_0x3e4279,_0x1aa73f[_0xed2a('0x40')]);var _0x52b382={'where':_0x3e4279[_0xed2a('0x3f')]};return db[_0xed2a('0x41')][_0xed2a('0x1f')](_0x52b382)[_0xed2a('0x27')](function(_0x399c44){_0xb298df['count']=_0x399c44;if(_0x1aa73f['query'][_0xed2a('0x42')]){_0x3e4279['include']=[{'all':!![]}];}return db[_0xed2a('0x41')][_0xed2a('0x43')](_0x3e4279);})[_0xed2a('0x27')](function(_0x398a3a){_0xb298df[_0xed2a('0x44')]=_0x398a3a;return _0xb298df;})[_0xed2a('0x27')](respondWithFilteredResult(_0x5831ce,_0x3e4279))['catch'](handleError(_0x5831ce,null));};exports[_0xed2a('0x45')]=function(_0xb5d589,_0x32a31a){var _0x2a5986={'raw':!![],'where':{'id':_0xb5d589['params']['id']}},_0x5d18ac={};_0x5d18ac[_0xed2a('0x32')]=_['keys'](db[_0xed2a('0x41')][_0xed2a('0x46')]);_0x5d18ac[_0xed2a('0x33')]=_[_0xed2a('0x34')](_0xb5d589['query']);_0x5d18ac[_0xed2a('0x35')]=_['intersection'](_0x5d18ac[_0xed2a('0x32')],_0x5d18ac['query']);_0x2a5986['attributes']=_[_0xed2a('0x47')](_0x5d18ac[_0xed2a('0x32')],qs[_0xed2a('0x36')](_0xb5d589[_0xed2a('0x33')]['fields']));_0x2a5986['attributes']=_0x2a5986[_0xed2a('0x37')][_0xed2a('0x48')]?_0x2a5986[_0xed2a('0x37')]:_0x5d18ac[_0xed2a('0x32')];if(_0xb5d589[_0xed2a('0x33')]['includeAll']){_0x2a5986[_0xed2a('0x49')]=[{'all':!![]}];}_0x2a5986=_[_0xed2a('0x3e')]({},_0x2a5986,_0xb5d589[_0xed2a('0x40')]);return db['FaxApplication'][_0xed2a('0x4a')](_0x2a5986)['then'](handleEntityNotFound(_0x32a31a,null))[_0xed2a('0x27')](respondWithResult(_0x32a31a,null))[_0xed2a('0x4b')](handleError(_0x32a31a,null));};exports['create']=function(_0x29faa6,_0x3cc034){return db[_0xed2a('0x41')][_0xed2a('0x4c')](_0x29faa6['body'],{})['then'](respondWithResult(_0x3cc034,0xc9))['catch'](handleError(_0x3cc034,null));};exports[_0xed2a('0x26')]=function(_0x1ee920,_0x32a96f){if(_0x1ee920[_0xed2a('0x4d')]['id']){delete _0x1ee920[_0xed2a('0x4d')]['id'];}return db[_0xed2a('0x41')]['find']({'where':{'id':_0x1ee920[_0xed2a('0x4e')]['id']}})[_0xed2a('0x27')](handleEntityNotFound(_0x32a96f,null))[_0xed2a('0x27')](saveUpdates(_0x1ee920[_0xed2a('0x4d')],null))[_0xed2a('0x27')](respondWithResult(_0x32a96f,null))['catch'](handleError(_0x32a96f,null));};exports['destroy']=function(_0x10eb7f,_0x59e3aa){return db[_0xed2a('0x41')][_0xed2a('0x4a')]({'where':{'id':_0x10eb7f['params']['id']}})[_0xed2a('0x27')](handleEntityNotFound(_0x59e3aa,null))[_0xed2a('0x27')](removeEntity(_0x59e3aa,null))['catch'](handleError(_0x59e3aa,null));}; \ No newline at end of file +var _0xff5b=['lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','status','end','error','stack','name','send','map','FaxApplication','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','findAll','rows','catch','params','keys','includeAll','include','find','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs'];(function(_0x75afc0,_0x3583bc){var _0x40a638=function(_0x1a6e81){while(--_0x1a6e81){_0x75afc0['push'](_0x75afc0['shift']());}};_0x40a638(++_0x3583bc);}(_0xff5b,0x155));var _0xbff5=function(_0x14581c,_0x6b3cd4){_0x14581c=_0x14581c-0x0;var _0x3cee97=_0xff5b[_0x14581c];return _0x3cee97;};'use strict';var emlformat=require(_0xbff5('0x0'));var rimraf=require(_0xbff5('0x1'));var zipdir=require(_0xbff5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbff5('0x3'));var moment=require('moment');var BPromise=require(_0xbff5('0x4'));var Mustache=require(_0xbff5('0x5'));var util=require('util');var path=require(_0xbff5('0x6'));var sox=require(_0xbff5('0x7'));var csv=require('to-csv');var ejs=require(_0xbff5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbff5('0x9'));var squel=require(_0xbff5('0xa'));var crypto=require('crypto');var jsforce=require(_0xbff5('0xb'));var deskjs=require(_0xbff5('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbff5('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbff5('0xe'));var hardwareService=require(_0xbff5('0xf'));var logger=require(_0xbff5('0x10'))(_0xbff5('0x11'));var utils=require('../../config/utils');var config=require(_0xbff5('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xbff5('0x13'))['db'];function respondWithStatusCode(_0x35c67e,_0x44419b){_0x44419b=_0x44419b||0xcc;return function(_0x29143c){if(_0x29143c){return _0x35c67e[_0xbff5('0x14')](_0x44419b);}return _0x35c67e['status'](_0x44419b)['end']();};}function respondWithResult(_0x2a04ac,_0x21d414){_0x21d414=_0x21d414||0xc8;return function(_0x87ff12){if(_0x87ff12){return _0x2a04ac['status'](_0x21d414)[_0xbff5('0x15')](_0x87ff12);}};}function respondWithFilteredResult(_0x57cd00,_0x8bef87){return function(_0x550c12){if(_0x550c12){var _0x477eb1=typeof _0x8bef87['offset']===_0xbff5('0x16')&&typeof _0x8bef87['limit']===_0xbff5('0x16');var _0x43d3aa=_0x550c12[_0xbff5('0x17')];var _0x2fdda5=_0x477eb1?0x0:_0x8bef87[_0xbff5('0x18')];var _0x2fa504=_0x477eb1?_0x550c12[_0xbff5('0x17')]:_0x8bef87[_0xbff5('0x18')]+_0x8bef87[_0xbff5('0x19')];var _0x2b31ca;if(_0x2fa504>=_0x43d3aa){_0x2fa504=_0x43d3aa;_0x2b31ca=0xc8;}else{_0x2b31ca=0xce;}_0x57cd00['status'](_0x2b31ca);return _0x57cd00[_0xbff5('0x1a')](_0xbff5('0x1b'),_0x2fdda5+'-'+_0x2fa504+'/'+_0x43d3aa)[_0xbff5('0x15')](_0x550c12);}return null;};}function patchUpdates(_0x2313f1){return function(_0x5e43e2){try{jsonpatch[_0xbff5('0x1c')](_0x5e43e2,_0x2313f1,!![]);}catch(_0x5660f4){return BPromise[_0xbff5('0x1d')](_0x5660f4);}return _0x5e43e2['save']();};}function saveUpdates(_0x26898e,_0x35264b){return function(_0x2882aa){if(_0x2882aa){return _0x2882aa[_0xbff5('0x1e')](_0x26898e)[_0xbff5('0x1f')](function(_0x2845e3){return _0x2845e3;});}return null;};}function removeEntity(_0x647811,_0x4dbb39){return function(_0x58ecd7){if(_0x58ecd7){return _0x58ecd7[_0xbff5('0x20')]()['then'](function(){_0x647811[_0xbff5('0x21')](0xcc)[_0xbff5('0x22')]();});}};}function handleEntityNotFound(_0x1f29f0,_0xd19447){return function(_0x39a3ba){if(!_0x39a3ba){_0x1f29f0[_0xbff5('0x14')](0x194);}return _0x39a3ba;};}function handleError(_0x3eb566,_0x2e8280){_0x2e8280=_0x2e8280||0x1f4;return function(_0x3b5fae){logger[_0xbff5('0x23')](_0x3b5fae[_0xbff5('0x24')]);if(_0x3b5fae[_0xbff5('0x25')]){delete _0x3b5fae[_0xbff5('0x25')];}_0x3eb566['status'](_0x2e8280)[_0xbff5('0x26')](_0x3b5fae);};}exports['index']=function(_0x3fd07f,_0x5e1b04){var _0x125253={},_0x2e1eaa={},_0x5232ce={'count':0x0,'rows':[]};var _0x339ce0=_[_0xbff5('0x27')](db[_0xbff5('0x28')][_0xbff5('0x29')],function(_0x4d2a32){return{'name':_0x4d2a32[_0xbff5('0x2a')],'type':_0x4d2a32[_0xbff5('0x2b')][_0xbff5('0x2c')]};});_0x2e1eaa['model']=_[_0xbff5('0x27')](_0x339ce0,_0xbff5('0x25'));_0x2e1eaa[_0xbff5('0x2d')]=_['keys'](_0x3fd07f['query']);_0x2e1eaa['filters']=_[_0xbff5('0x2e')](_0x2e1eaa[_0xbff5('0x2f')],_0x2e1eaa['query']);_0x125253[_0xbff5('0x30')]=_[_0xbff5('0x2e')](_0x2e1eaa['model'],qs[_0xbff5('0x31')](_0x3fd07f['query'][_0xbff5('0x31')]));_0x125253[_0xbff5('0x30')]=_0x125253[_0xbff5('0x30')][_0xbff5('0x32')]?_0x125253['attributes']:_0x2e1eaa[_0xbff5('0x2f')];if(!_0x3fd07f[_0xbff5('0x2d')][_0xbff5('0x33')](_0xbff5('0x34'))){_0x125253[_0xbff5('0x19')]=qs[_0xbff5('0x19')](_0x3fd07f['query'][_0xbff5('0x19')]);_0x125253[_0xbff5('0x18')]=qs['offset'](_0x3fd07f[_0xbff5('0x2d')]['offset']);}_0x125253[_0xbff5('0x35')]=qs[_0xbff5('0x36')](_0x3fd07f[_0xbff5('0x2d')][_0xbff5('0x36')]);_0x125253[_0xbff5('0x37')]=qs[_0xbff5('0x38')](_['pick'](_0x3fd07f[_0xbff5('0x2d')],_0x2e1eaa[_0xbff5('0x38')]),_0x339ce0);if(_0x3fd07f[_0xbff5('0x2d')][_0xbff5('0x39')]){_0x125253[_0xbff5('0x37')]=_[_0xbff5('0x3a')](_0x125253[_0xbff5('0x37')],{'$or':_[_0xbff5('0x27')](_0x339ce0,function(_0x4c8527){if(_0x4c8527[_0xbff5('0x2b')]!==_0xbff5('0x3b')){var _0x2454b8={};_0x2454b8[_0x4c8527[_0xbff5('0x25')]]={'$like':'%'+_0x3fd07f[_0xbff5('0x2d')]['filter']+'%'};return _0x2454b8;}})});}_0x125253=_[_0xbff5('0x3a')]({},_0x125253,_0x3fd07f[_0xbff5('0x3c')]);var _0x11f40c={'where':_0x125253[_0xbff5('0x37')]};return db[_0xbff5('0x28')]['count'](_0x11f40c)[_0xbff5('0x1f')](function(_0x166779){_0x5232ce[_0xbff5('0x17')]=_0x166779;if(_0x3fd07f[_0xbff5('0x2d')]['includeAll']){_0x125253['include']=[{'all':!![]}];}return db['FaxApplication'][_0xbff5('0x3d')](_0x125253);})[_0xbff5('0x1f')](function(_0x37860a){_0x5232ce[_0xbff5('0x3e')]=_0x37860a;return _0x5232ce;})[_0xbff5('0x1f')](respondWithFilteredResult(_0x5e1b04,_0x125253))[_0xbff5('0x3f')](handleError(_0x5e1b04,null));};exports['show']=function(_0x25860c,_0x16e9aa){var _0x3c0694={'raw':!![],'where':{'id':_0x25860c[_0xbff5('0x40')]['id']}},_0x53d8cc={};_0x53d8cc['model']=_[_0xbff5('0x41')](db['FaxApplication'][_0xbff5('0x29')]);_0x53d8cc[_0xbff5('0x2d')]=_[_0xbff5('0x41')](_0x25860c[_0xbff5('0x2d')]);_0x53d8cc[_0xbff5('0x38')]=_[_0xbff5('0x2e')](_0x53d8cc[_0xbff5('0x2f')],_0x53d8cc[_0xbff5('0x2d')]);_0x3c0694[_0xbff5('0x30')]=_[_0xbff5('0x2e')](_0x53d8cc[_0xbff5('0x2f')],qs[_0xbff5('0x31')](_0x25860c[_0xbff5('0x2d')]['fields']));_0x3c0694[_0xbff5('0x30')]=_0x3c0694[_0xbff5('0x30')][_0xbff5('0x32')]?_0x3c0694['attributes']:_0x53d8cc[_0xbff5('0x2f')];if(_0x25860c[_0xbff5('0x2d')][_0xbff5('0x42')]){_0x3c0694[_0xbff5('0x43')]=[{'all':!![]}];}_0x3c0694=_[_0xbff5('0x3a')]({},_0x3c0694,_0x25860c[_0xbff5('0x3c')]);return db[_0xbff5('0x28')][_0xbff5('0x44')](_0x3c0694)[_0xbff5('0x1f')](handleEntityNotFound(_0x16e9aa,null))[_0xbff5('0x1f')](respondWithResult(_0x16e9aa,null))[_0xbff5('0x3f')](handleError(_0x16e9aa,null));};exports['create']=function(_0x34742c,_0x122247){return db[_0xbff5('0x28')]['create'](_0x34742c['body'],{})[_0xbff5('0x1f')](respondWithResult(_0x122247,0xc9))[_0xbff5('0x3f')](handleError(_0x122247,null));};exports[_0xbff5('0x1e')]=function(_0x2085e0,_0xa6f4b1){if(_0x2085e0[_0xbff5('0x45')]['id']){delete _0x2085e0[_0xbff5('0x45')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x2085e0[_0xbff5('0x40')]['id']}})[_0xbff5('0x1f')](handleEntityNotFound(_0xa6f4b1,null))['then'](saveUpdates(_0x2085e0[_0xbff5('0x45')],null))[_0xbff5('0x1f')](respondWithResult(_0xa6f4b1,null))['catch'](handleError(_0xa6f4b1,null));};exports[_0xbff5('0x20')]=function(_0x2cb4b2,_0x1b2411){return db[_0xbff5('0x28')][_0xbff5('0x44')]({'where':{'id':_0x2cb4b2['params']['id']}})[_0xbff5('0x1f')](handleEntityNotFound(_0x1b2411,null))[_0xbff5('0x1f')](removeEntity(_0x1b2411,null))['catch'](handleError(_0x1b2411,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 0dfa6aa..468d64e 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 _0xc4d7=['../../config/logger','api','moment','bluebird','request-promise','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3ddb4e,_0x5d9ecf){var _0x16202e=function(_0x505a25){while(--_0x505a25){_0x3ddb4e['push'](_0x3ddb4e['shift']());}};_0x16202e(++_0x5d9ecf);}(_0xc4d7,0x83));var _0x7c4d=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xc4d7[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x7c4d('0x0'));var util=require('util');var logger=require(_0x7c4d('0x1'))(_0x7c4d('0x2'));var moment=require(_0x7c4d('0x3'));var BPromise=require(_0x7c4d('0x4'));var rp=require(_0x7c4d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7c4d('0x6'));module[_0x7c4d('0x7')]=function(_0x456a01,_0x3b36c8){return _0x456a01['define'](_0x7c4d('0x8'),attributes,{'tableName':_0x7c4d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7c4d('0xa'),'collate':_0x7c4d('0xb')});}; \ No newline at end of file +var _0xf9ee=['define','FaxApplication','fax_applications','utf8mb4','util','api','bluebird','request-promise','path','rimraf','./faxApplication.attributes','exports'];(function(_0x4f4adc,_0x5e9fad){var _0x350d7c=function(_0x13541c){while(--_0x13541c){_0x4f4adc['push'](_0x4f4adc['shift']());}};_0x350d7c(++_0x5e9fad);}(_0xf9ee,0x88));var _0xef9e=function(_0x2e622f,_0x5c31d8){_0x2e622f=_0x2e622f-0x0;var _0x43c59c=_0xf9ee[_0x2e622f];return _0x43c59c;};'use strict';var _=require('lodash');var util=require(_0xef9e('0x0'));var logger=require('../../config/logger')(_0xef9e('0x1'));var moment=require('moment');var BPromise=require(_0xef9e('0x2'));var rp=require(_0xef9e('0x3'));var fs=require('fs');var path=require(_0xef9e('0x4'));var rimraf=require(_0xef9e('0x5'));var config=require('../../config/environment');var attributes=require(_0xef9e('0x6'));module[_0xef9e('0x7')]=function(_0x94f506,_0xcbb0c5){return _0x94f506[_0xef9e('0x8')](_0xef9e('0x9'),attributes,{'tableName':_0xef9e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xef9e('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index fc148f5..158eec3 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 _0xefca=['result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','limit','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxApplication,\x20%s,\x20%s','message','info'];(function(_0xb71bc3,_0x435a43){var _0x24beb7=function(_0x23d2ef){while(--_0x23d2ef){_0xb71bc3['push'](_0xb71bc3['shift']());}};_0x24beb7(++_0x435a43);}(_0xefca,0xea));var _0xaefc=function(_0x467cb0,_0x303070){_0x467cb0=_0x467cb0-0x0;var _0x2153f7=_0xefca[_0x467cb0];return _0x2153f7;};'use strict';var _=require(_0xaefc('0x0'));var util=require('util');var moment=require(_0xaefc('0x1'));var BPromise=require('bluebird');var rs=require(_0xaefc('0x2'));var fs=require('fs');var Redis=require(_0xaefc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaefc('0x4'));var logger=require(_0xaefc('0x5'))('rpc');var config=require(_0xaefc('0x6'));var jayson=require(_0xaefc('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xea5ff0,_0x55d5b8,_0x44590b){return new BPromise(function(_0x4d3247,_0x5dc754){return client[_0xaefc('0x8')](_0xea5ff0,_0x44590b)[_0xaefc('0x9')](function(_0x1185a1){logger['info']('FaxApplication,\x20%s,\x20%s',_0x55d5b8,'request\x20sent');logger[_0xaefc('0xa')](_0xaefc('0xb'),_0x55d5b8,_0xaefc('0xc'),JSON[_0xaefc('0xd')](_0x1185a1));if(_0x1185a1[_0xaefc('0xe')]){if(_0x1185a1[_0xaefc('0xe')]['code']===0x1f4){logger['error'](_0xaefc('0xf'),_0x55d5b8,_0x1185a1[_0xaefc('0xe')][_0xaefc('0x10')]);return _0x5dc754(_0x1185a1['error'][_0xaefc('0x10')]);}logger[_0xaefc('0xe')](_0xaefc('0xf'),_0x55d5b8,_0x1185a1[_0xaefc('0xe')][_0xaefc('0x10')]);return _0x4d3247(_0x1185a1[_0xaefc('0xe')][_0xaefc('0x10')]);}else{logger[_0xaefc('0x11')](_0xaefc('0xf'),_0x55d5b8,_0xaefc('0xc'));_0x4d3247(_0x1185a1[_0xaefc('0x12')][_0xaefc('0x10')]);}})[_0xaefc('0x13')](function(_0x4376aa){logger[_0xaefc('0xe')](_0xaefc('0xf'),_0x55d5b8,_0x4376aa);_0x5dc754(_0x4376aa);});});}exports[_0xaefc('0x14')]=function(_0x2f8b20){var _0xf7aa3d=this;return new Promise(function(_0x28517f,_0x15f770){return db[_0xaefc('0x15')]['update'](_0x2f8b20[_0xaefc('0x16')],{'raw':_0x2f8b20[_0xaefc('0x17')]?_0x2f8b20['options'][_0xaefc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f8b20[_0xaefc('0x17')]?_0x2f8b20[_0xaefc('0x17')][_0xaefc('0x19')]||null:null,'attributes':_0x2f8b20[_0xaefc('0x17')]?_0x2f8b20[_0xaefc('0x17')][_0xaefc('0x1a')]||null:null,'limit':_0x2f8b20[_0xaefc('0x17')]?_0x2f8b20[_0xaefc('0x17')][_0xaefc('0x1b')]||null:null})['then'](function(_0x400df5){logger['info'](_0xaefc('0x14'),_0x2f8b20);logger[_0xaefc('0xa')]('UpdateFaxApplication',_0x2f8b20,JSON[_0xaefc('0xd')](_0x400df5));_0x28517f(_0x400df5);})[_0xaefc('0x13')](function(_0x2d809f){logger[_0xaefc('0xe')](_0xaefc('0x14'),_0x2d809f['message'],_0x2f8b20);_0x15f770(_0xf7aa3d[_0xaefc('0xe')](0x1f4,_0x2d809f['message']));});});}; \ No newline at end of file +var _0x17d0=['catch','UpdateFaxApplication','FaxApplication','update','body','options','attributes','limit','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x5e9d35,_0x382c91){var _0x3beb2e=function(_0x4242cf){while(--_0x4242cf){_0x5e9d35['push'](_0x5e9d35['shift']());}};_0x3beb2e(++_0x382c91);}(_0x17d0,0x1a8));var _0x017d=function(_0x4a5494,_0x3ad336){_0x4a5494=_0x4a5494-0x0;var _0x57cbb5=_0x17d0[_0x4a5494];return _0x57cbb5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x017d('0x0'));var BPromise=require('bluebird');var rs=require(_0x017d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x017d('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x017d('0x3'))(_0x017d('0x4'));var config=require(_0x017d('0x5'));var jayson=require(_0x017d('0x6'));var client=jayson['client'][_0x017d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xd73a93,_0x46466d,_0x57e41b){return new BPromise(function(_0x456965,_0x30d0e0){return client['request'](_0xd73a93,_0x57e41b)['then'](function(_0x3f3e93){logger[_0x017d('0x8')](_0x017d('0x9'),_0x46466d,'request\x20sent');logger[_0x017d('0xa')](_0x017d('0xb'),_0x46466d,_0x017d('0xc'),JSON[_0x017d('0xd')](_0x3f3e93));if(_0x3f3e93[_0x017d('0xe')]){if(_0x3f3e93[_0x017d('0xe')][_0x017d('0xf')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x46466d,_0x3f3e93[_0x017d('0xe')]['message']);return _0x30d0e0(_0x3f3e93[_0x017d('0xe')][_0x017d('0x10')]);}logger[_0x017d('0xe')](_0x017d('0x9'),_0x46466d,_0x3f3e93[_0x017d('0xe')][_0x017d('0x10')]);return _0x456965(_0x3f3e93[_0x017d('0xe')][_0x017d('0x10')]);}else{logger[_0x017d('0x8')](_0x017d('0x9'),_0x46466d,_0x017d('0xc'));_0x456965(_0x3f3e93[_0x017d('0x11')][_0x017d('0x10')]);}})[_0x017d('0x12')](function(_0x5ec139){logger[_0x017d('0xe')](_0x017d('0x9'),_0x46466d,_0x5ec139);_0x30d0e0(_0x5ec139);});});}exports[_0x017d('0x13')]=function(_0x2f790b){var _0x1068e1=this;return new Promise(function(_0x22f219,_0x64f937){return db[_0x017d('0x14')][_0x017d('0x15')](_0x2f790b[_0x017d('0x16')],{'raw':_0x2f790b[_0x017d('0x17')]?_0x2f790b[_0x017d('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f790b['options']?_0x2f790b['options']['where']||null:null,'attributes':_0x2f790b['options']?_0x2f790b[_0x017d('0x17')][_0x017d('0x18')]||null:null,'limit':_0x2f790b[_0x017d('0x17')]?_0x2f790b['options'][_0x017d('0x19')]||null:null})['then'](function(_0x3935fa){logger[_0x017d('0x8')](_0x017d('0x13'),_0x2f790b);logger['debug'](_0x017d('0x13'),_0x2f790b,JSON[_0x017d('0xd')](_0x3935fa));_0x22f219(_0x3935fa);})[_0x017d('0x12')](function(_0x50ff97){logger[_0x017d('0xe')](_0x017d('0x13'),_0x50ff97[_0x017d('0x10')],_0x2f790b);_0x64f937(_0x1068e1[_0x017d('0xe')](0x1f4,_0x50ff97[_0x017d('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 90c648d..5f56ccc 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb62e=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','show','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x565e00,_0x23a6d1){var _0x3249af=function(_0x26835a){while(--_0x26835a){_0x565e00['push'](_0x565e00['shift']());}};_0x3249af(++_0x23a6d1);}(_0xb62e,0x1de));var _0xeb62=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb62e[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var fs_extra=require(_0xeb62('0x5'));var auth=require(_0xeb62('0x6'));var interaction=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var controller=require(_0xeb62('0x9'));router['get']('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0xb')]);router[_0xeb62('0xc')]('/:id',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xe')]('/',auth[_0xeb62('0xa')](),controller['create']);router['put'](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0x11')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);module[_0xeb62('0x13')]=router; \ No newline at end of file +var _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x36bed3,_0x37c5a5){var _0x11d841=function(_0x266805){while(--_0x266805){_0x36bed3['push'](_0x36bed3['shift']());}};_0x11d841(++_0x37c5a5);}(_0xac4a,0x13f));var _0xaac4=function(_0x28babf,_0x1a7fea){_0x28babf=_0x28babf-0x0;var _0x22afa6=_0xac4a[_0x28babf];return _0x22afa6;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index b3f91e6..0cc8ef0 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 _0x2343=['exports','BOOLEAN','STRING','DATE','out','sequelize'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x2343,0xef));var _0x3234=function(_0x3c414c,_0x399dbb){_0x3c414c=_0x3c414c-0x0;var _0x4f3062=_0x2343[_0x3c414c];return _0x4f3062;};'use strict';var Sequelize=require(_0x3234('0x0'));module[_0x3234('0x1')]={'closed':{'type':Sequelize[_0x3234('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3234('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3234('0x3')]},'note':{'type':Sequelize[_0x3234('0x3')]},'read1stAt':{'type':Sequelize[_0x3234('0x4')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3234('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xba56=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x18ec70,_0x52e8d2){var _0x59b713=function(_0x4246de){while(--_0x4246de){_0x18ec70['push'](_0x18ec70['shift']());}};_0x59b713(++_0x52e8d2);}(_0xba56,0x9f));var _0x6ba5=function(_0xcb6d2b,_0x1a56ac){_0xcb6d2b=_0xcb6d2b-0x0;var _0x2c3687=_0xba56[_0xcb6d2b];return _0x2c3687;};'use strict';var Sequelize=require(_0x6ba5('0x0'));module['exports']={'closed':{'type':Sequelize[_0x6ba5('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6ba5('0x2')]},'disposition':{'type':Sequelize[_0x6ba5('0x3')]},'secondDisposition':{'type':Sequelize[_0x6ba5('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6ba5('0x3')]},'note':{'type':Sequelize[_0x6ba5('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x6ba5('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x6ba5('0x4')]('in',_0x6ba5('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6ba5('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x6ba5('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 19dec60..79c1c9a 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 _0x4fd1=['forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','buildExpression','keys','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','toString','count','sequelize','keyBy','merge','fields','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.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','FaxInteractionId','rows','params','includeAll','include','options','create','update','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','spread','faxInteractionTags:save','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','createReadStream','createWriteStream','err','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','destroy','then','end','error','name','send','map','fullname','TagIds','Tags','push','catch','waiting','talking','answered','unmanaged','UserId','closed','total','index','FaxInteraction','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','field','color','u.id','u.fullname','ui.FaxInteractionId','from','left_join','users','select','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','expr','parseSearch','search','conditions','find','having','`\x20=\x200','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','text','start','Tag'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4fd1,0x14b));var _0x14fd=function(_0x51e5a4,_0x43bff8){_0x51e5a4=_0x51e5a4-0x0;var _0x534a35=_0x4fd1[_0x51e5a4];return _0x534a35;};'use strict';var emlformat=require(_0x14fd('0x0'));var rimraf=require(_0x14fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x14fd('0x2'));var moment=require(_0x14fd('0x3'));var BPromise=require(_0x14fd('0x4'));var Mustache=require(_0x14fd('0x5'));var util=require(_0x14fd('0x6'));var path=require(_0x14fd('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x14fd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14fd('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x14fd('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x14fd('0xb'));var querystring=require(_0x14fd('0xc'));var Papa=require(_0x14fd('0xd'));var Redis=require('ioredis');var authService=require(_0x14fd('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x14fd('0xf'));var hardwareService=require(_0x14fd('0x10'));var logger=require(_0x14fd('0x11'))('api');var utils=require(_0x14fd('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x14fd('0x13'));var db=require(_0x14fd('0x14'))['db'];config[_0x14fd('0x15')]=_[_0x14fd('0x16')](config['redis'],{'host':_0x14fd('0x17'),'port':0x18eb});var socket=require(_0x14fd('0x18'))(new Redis(config[_0x14fd('0x15')]));require(_0x14fd('0x19'))[_0x14fd('0x1a')](socket);function respondWithStatusCode(_0x426fba,_0x5bbab1){_0x5bbab1=_0x5bbab1||0xcc;return function(_0x4b348a){if(_0x4b348a){return _0x426fba[_0x14fd('0x1b')](_0x5bbab1);}return _0x426fba[_0x14fd('0x1c')](_0x5bbab1)['end']();};}function respondWithResult(_0x56be26,_0x3fe5e0){_0x3fe5e0=_0x3fe5e0||0xc8;return function(_0x4e02da){if(_0x4e02da){return _0x56be26[_0x14fd('0x1c')](_0x3fe5e0)['json'](_0x4e02da);}};}function respondWithFilteredResult(_0x18dc80,_0xb2ae25){return function(_0x14a11e){if(_0x14a11e){var _0x43f39a=typeof _0xb2ae25[_0x14fd('0x1d')]===_0x14fd('0x1e')&&typeof _0xb2ae25['limit']==='undefined';var _0x2d7047=_0x14a11e['count'];var _0x5f25b3=_0x43f39a?0x0:_0xb2ae25[_0x14fd('0x1d')];var _0x33fa0d=_0x43f39a?_0x14a11e['count']:_0xb2ae25[_0x14fd('0x1d')]+_0xb2ae25[_0x14fd('0x1f')];var _0x44ee16;if(_0x33fa0d>=_0x2d7047){_0x33fa0d=_0x2d7047;_0x44ee16=0xc8;}else{_0x44ee16=0xce;}_0x18dc80['status'](_0x44ee16);return _0x18dc80[_0x14fd('0x20')](_0x14fd('0x21'),_0x5f25b3+'-'+_0x33fa0d+'/'+_0x2d7047)[_0x14fd('0x22')](_0x14a11e);}return null;};}function patchUpdates(_0x38e4c7){return function(_0x5e5091){try{jsonpatch[_0x14fd('0x23')](_0x5e5091,_0x38e4c7,!![]);}catch(_0x426b7b){return BPromise[_0x14fd('0x24')](_0x426b7b);}return _0x5e5091['save']();};}function saveUpdates(_0x207875,_0x78e9e2){return function(_0x526ac6){if(_0x526ac6){return _0x526ac6['update'](_0x207875)['then'](function(_0x381fb7){return _0x381fb7;});}return null;};}function removeEntity(_0x55d025,_0x207ab3){return function(_0xae64ac){if(_0xae64ac){return _0xae64ac[_0x14fd('0x25')]()[_0x14fd('0x26')](function(){_0x55d025['status'](0xcc)[_0x14fd('0x27')]();});}};}function handleEntityNotFound(_0x5e908d,_0x5f1002){return function(_0x3a090b){if(!_0x3a090b){_0x5e908d[_0x14fd('0x1b')](0x194);}return _0x3a090b;};}function handleError(_0x2400e8,_0x348a3f){_0x348a3f=_0x348a3f||0x1f4;return function(_0x5d445e){logger[_0x14fd('0x28')](_0x5d445e['stack']);if(_0x5d445e[_0x14fd('0x29')]){delete _0x5d445e[_0x14fd('0x29')];}_0x2400e8['status'](_0x348a3f)[_0x14fd('0x2a')](_0x5d445e);};}function getInteractionUsers(_0x296395,_0x7e9079){return new BPromise(function(_0x1289d8,_0x4735ca){try{if(_0x7e9079[_0x296395['id']]){_0x296395['Users']=_[_0x14fd('0x2b')](_0x7e9079[_0x296395['id']],function(_0x24aef0){return{'id':_0x24aef0['id'],'fullname':_0x24aef0[_0x14fd('0x2c')]};});}}catch(_0x1aca8d){_0x4735ca(_0x1aca8d);}_0x1289d8(_0x296395);});}function getInteractionTags(_0x5472dd,_0x1e792c){return new BPromise(function(_0x346467,_0x1a6042){try{if(_0x5472dd[_0x14fd('0x2d')]){_0x5472dd['Tags']=[];_0x5472dd[_0x14fd('0x2d')]['split'](',')['forEach'](function(_0x2ab366){_0x5472dd[_0x14fd('0x2e')][_0x14fd('0x2f')](_0x1e792c[_0x2ab366]);});}delete _0x5472dd['TagIds'];}catch(_0x5d48cc){_0x1a6042(_0x5d48cc);}_0x346467(_0x5472dd);});}function updateFaxInteraction(_0xaacc11,_0x4f3ecc,_0x1d7b82){return new BPromise(function(_0x5442e1,_0x45712){return getInteractionUsers(_0xaacc11,_0x1d7b82)[_0x14fd('0x26')](function(_0x48f244){return getInteractionTags(_0x48f244,_0x4f3ecc);})['then'](function(_0x2a65bc){return getStateInteraction(_0x2a65bc);})[_0x14fd('0x26')](function(_0x1d415c){_0x5442e1(_0x1d415c);})[_0x14fd('0x30')](function(_0x1459a7){_0x45712(_0x1459a7);});});}function getStateInteraction(_0x5b55b9){return new BPromise(function(_0x4a6f36){_0x5b55b9[_0x14fd('0x31')]=0x0;_0x5b55b9[_0x14fd('0x32')]=0x0;_0x5b55b9[_0x14fd('0x33')]=0x0;_0x5b55b9[_0x14fd('0x34')]=0x0;_0x5b55b9['total']=0x0;if(!_0x5b55b9['closed']&&!_0x5b55b9[_0x14fd('0x35')]){_0x5b55b9['waiting']+=0x1;}if(!_0x5b55b9[_0x14fd('0x36')]&&_0x5b55b9[_0x14fd('0x35')]){_0x5b55b9[_0x14fd('0x32')]+=0x1;if(_0x5b55b9[_0x14fd('0x31')]){_0x5b55b9[_0x14fd('0x31')]-=0x1;}}if(_0x5b55b9['closed']&&_0x5b55b9[_0x14fd('0x35')]){_0x5b55b9[_0x14fd('0x33')]+=0x1;if(_0x5b55b9[_0x14fd('0x32')]){_0x5b55b9[_0x14fd('0x32')]-=0x1;}}if(_0x5b55b9['closed']&&!_0x5b55b9[_0x14fd('0x35')]){_0x5b55b9['unmanaged']+=0x1;if(_0x5b55b9['waiting']){_0x5b55b9[_0x14fd('0x31')]-=0x1;}}_0x5b55b9[_0x14fd('0x37')]+=0x1;_0x4a6f36(_0x5b55b9);});}exports[_0x14fd('0x38')]=function(_0x585177,_0x42f1d1){var _0x18ba03={},_0x7e008b={},_0x263006={'count':0x0,'rows':[]};var _0x10847e=_[_0x14fd('0x2b')](db[_0x14fd('0x39')][_0x14fd('0x3a')],function(_0x21c8d0){return{'name':_0x21c8d0[_0x14fd('0x3b')],'type':_0x21c8d0[_0x14fd('0x3c')][_0x14fd('0x3d')]};});_0x7e008b['model']=_['map'](_0x10847e,_0x14fd('0x29'));_0x7e008b['query']=_['keys'](_0x585177[_0x14fd('0x3e')]);_0x7e008b[_0x14fd('0x3f')]=_['intersection'](_0x7e008b[_0x14fd('0x40')],_0x7e008b[_0x14fd('0x3e')]);_0x18ba03[_0x14fd('0x41')]=_[_0x14fd('0x42')](_0x7e008b[_0x14fd('0x40')],qs['fields'](_0x585177[_0x14fd('0x3e')]['fields']));_0x18ba03[_0x14fd('0x41')]=_0x18ba03[_0x14fd('0x41')][_0x14fd('0x43')]?_0x18ba03[_0x14fd('0x41')]:_0x7e008b['model'];if(!_0x585177['query'][_0x14fd('0x44')](_0x14fd('0x45'))){_0x18ba03[_0x14fd('0x1f')]=qs['limit'](_0x585177[_0x14fd('0x3e')]['limit']);_0x18ba03[_0x14fd('0x1d')]=qs['offset'](_0x585177[_0x14fd('0x3e')][_0x14fd('0x1d')]);}_0x18ba03[_0x14fd('0x46')]=qs[_0x14fd('0x47')](_0x585177[_0x14fd('0x3e')][_0x14fd('0x47')]);_0x18ba03['where']=qs[_0x14fd('0x3f')](_['pick'](_0x585177[_0x14fd('0x3e')],_0x7e008b[_0x14fd('0x3f')]),_0x10847e);var _0x811c8f=[];var _0x11e265=squel['select']()[_0x14fd('0x48')]('id')[_0x14fd('0x48')](_0x14fd('0x29'))[_0x14fd('0x48')](_0x14fd('0x49'))['from']('tools_tags');var _0x5c1db3=squel['select']()[_0x14fd('0x48')](_0x14fd('0x4a'))[_0x14fd('0x48')](_0x14fd('0x4b'))[_0x14fd('0x48')](_0x14fd('0x4c'))[_0x14fd('0x4d')]('user_has_fax_interactions','ui')[_0x14fd('0x4e')](_0x14fd('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x149e2c=squel[_0x14fd('0x50')]()['from'](_0x14fd('0x51'),'i')[_0x14fd('0x4e')](_0x14fd('0x52'),'c',_0x14fd('0x53'))[_0x14fd('0x4e')](_0x14fd('0x4f'),'o',_0x14fd('0x54'))['left_join']('fax_accounts','a',_0x14fd('0x55'))[_0x14fd('0x4e')](_0x14fd('0x56'),'me',_0x14fd('0x57'))[_0x14fd('0x4e')](_0x14fd('0x58'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x14fd('0x4e')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x48769a=squel[_0x14fd('0x59')]();var _0x30486c=[];var _0x3ff0d=squel['expr']();var _0x2f5b75;if(_0x585177[_0x14fd('0x3e')]['search']){_0x2f5b75=as[_0x14fd('0x5a')](_0x585177[_0x14fd('0x3e')][_0x14fd('0x5b')]);var _0x397242=_0x2f5b75['sqlOperator'];for(var _0x20aa3c=0x0;_0x20aa3c<_0x2f5b75[_0x14fd('0x5c')][_0x14fd('0x43')];_0x20aa3c++){var _0x52ba76=_0x2f5b75[_0x14fd('0x5c')][_0x20aa3c];var _0x141ec9='i';var _0x1e09e6=_[_0x14fd('0x5d')](_0x10847e,[_0x14fd('0x29'),_0x52ba76[_0x14fd('0x48')]]);if(!_0x1e09e6){switch(_0x52ba76[_0x14fd('0x48')]){case'unreadMessages':if(_0x52ba76['value']==0x1){_0x149e2c[_0x14fd('0x5e')]('`'+_0x52ba76['field']+_0x14fd('0x5f'));}else{_0x149e2c['having']('`'+_0x52ba76[_0x14fd('0x48')]+'`\x20>\x200');}break;case'Contact':if(_0x52ba76[_0x14fd('0x60')]===_0x14fd('0x61')){if(_0x52ba76[_0x14fd('0x62')][_0x14fd('0x63')]('\x20')['length']>0x1){_0x48769a[_0x397242](_0x14fd('0x64'),qs[_0x14fd('0x65')](_0x52ba76[_0x14fd('0x62')]),null);}else{var _0x2f21f0='%'+_0x52ba76['value']+'%';_0x48769a[_0x397242]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2f21f0,_0x2f21f0,_0x2f21f0);}}else{_0x1e09e6=_['find'](_0x10847e,[_0x14fd('0x29'),'ContactId']);_0x52ba76[_0x14fd('0x48')]='ContactId';_0x501495=as['buildExpression'](_0x141ec9,_0x1e09e6[_0x14fd('0x3c')],_0x52ba76);_0x48769a[_0x397242](_0x501495[_0x14fd('0x66')],_0x501495[_0x14fd('0x62')][_0x14fd('0x67')],_0x501495[_0x14fd('0x62')][_0x14fd('0x27')]);}break;case _0x14fd('0x68'):var _0x3aa223=_0x52ba76[_0x14fd('0x62')][_0x14fd('0x63')](',')[_0x14fd('0x2b')](function(_0x50e4ba){return Number(_0x50e4ba);});_0x3aa223[_0x14fd('0x69')](function(_0x54a728){_0x3ff0d['or'](_0x14fd('0x6a'),'%,'+_0x54a728+',%');});_0x30486c=_[_0x14fd('0x6b')](_0x30486c,_0x3aa223);break;case _0x14fd('0x6c'):if(_0x52ba76['operator']===_0x14fd('0x61')){_0x48769a[_0x397242](_0x14fd('0x6d'),'%'+_0x52ba76[_0x14fd('0x62')]+'%',null);}else{_0x1e09e6=_[_0x14fd('0x5d')](_0x10847e,['name',_0x14fd('0x35')]);_0x52ba76[_0x14fd('0x48')]=_0x14fd('0x35');_0x501495=as['buildExpression'](_0x141ec9,_0x1e09e6['type'],_0x52ba76);_0x48769a[_0x397242](_0x501495[_0x14fd('0x66')],_0x501495[_0x14fd('0x62')]['start'],_0x501495[_0x14fd('0x62')][_0x14fd('0x27')]);}break;case _0x14fd('0x6e'):_0x501495=as['buildExpression']('me',null,_0x52ba76);_0x48769a[_0x397242](_0x501495[_0x14fd('0x66')],_0x501495[_0x14fd('0x62')][_0x14fd('0x67')],_0x501495[_0x14fd('0x62')][_0x14fd('0x27')]);break;}}else{var _0x501495=as[_0x14fd('0x6f')](_0x141ec9,_0x1e09e6['type'],_0x52ba76);_0x48769a[_0x397242](_0x501495[_0x14fd('0x66')],_0x501495['value'][_0x14fd('0x67')],_0x501495[_0x14fd('0x62')]['end']);}}}else{var _0x26239a=_(_0x585177[_0x14fd('0x3e')])[_0x14fd('0x70')]()[_0x14fd('0x2b')](function(_0x17ca0f){return _['some'](_0x10847e,[_0x14fd('0x29'),_0x17ca0f])?_0x17ca0f:undefined;})[_0x14fd('0x71')]()['value']();if(!_[_0x14fd('0x72')](_0x26239a)){_0x26239a['forEach'](function(_0x4a0211){if(_0x4a0211==='FaxAccountId'){_0x149e2c['where'](_0x14fd('0x73'),[][_0x14fd('0x74')](_0x585177[_0x14fd('0x3e')][_0x4a0211]));}else if(_0x4a0211===_0x14fd('0x75')){var _0x39f821=JSON[_0x14fd('0x76')](_0x585177[_0x14fd('0x3e')][_0x4a0211])[_0x14fd('0x77')];var _0xceafa6=JSON[_0x14fd('0x76')](_0x585177['query'][_0x4a0211])[_0x14fd('0x78')];_0x149e2c['where'](_0x14fd('0x79'),_0x39f821,_0xceafa6);}else{if(_0x585177[_0x14fd('0x3e')][_0x4a0211]===_0x14fd('0x7a')){_0x149e2c[_0x14fd('0x7b')]('i.'+_0x4a0211+_0x14fd('0x7c'));}else{_0x149e2c['where']('i.'+_0x4a0211+_0x14fd('0x7d'),_0x585177[_0x14fd('0x3e')][_0x4a0211]);}}});}if(_0x585177[_0x14fd('0x3e')][_0x14fd('0x7e')]){if(_0x585177[_0x14fd('0x3e')][_0x14fd('0x7e')]==0x1){_0x149e2c[_0x14fd('0x5e')](_0x14fd('0x7f'));}else{_0x149e2c[_0x14fd('0x5e')](_0x14fd('0x80'));}}if(_0x585177['query']['tag']){_0x30486c=_[_0x14fd('0x81')](_0x585177[_0x14fd('0x3e')][_0x14fd('0x82')])?_0x585177[_0x14fd('0x3e')][_0x14fd('0x82')]:new Array(_0x585177[_0x14fd('0x3e')][_0x14fd('0x82')]);_0x30486c[_0x14fd('0x69')](function(_0x5ca309){_0x3ff0d['or'](_0x14fd('0x6a'),'%,'+_0x5ca309+',%');});}if(_0x585177[_0x14fd('0x3e')][_0x14fd('0x83')]){var _0x22cf68=_0x585177[_0x14fd('0x3e')][_0x14fd('0x83')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x22cf68)){_0x48769a['or'](_0x14fd('0x84'),_0x22cf68+'%')['or']('i.fax\x20LIKE\x20?',_0x22cf68+'%');}_0x48769a['or'](_0x14fd('0x85'),_0x22cf68+'%');}}_0x149e2c[_0x14fd('0x7b')](_0x48769a);_0x149e2c['group'](_0x14fd('0x86'));var _0x14ea05={'type':db[_0x14fd('0x87')][_0x14fd('0x88')]['SELECT'],'raw':!![]};var _0x1f27f4=_0x149e2c[_0x14fd('0x89')]();_0x1f27f4[_0x14fd('0x48')](_0x14fd('0x86'));_0x1f27f4[_0x14fd('0x48')](_0x14fd('0x8a'),_0x14fd('0x8b'));if(_0x18ba03[_0x14fd('0x46')]){_0x18ba03[_0x14fd('0x46')][_0x14fd('0x69')](function(_0x2855aa){var _0x2bc09d=_0x2855aa[0x0]===_0x14fd('0x8c')?_0x2855aa[0x0]:'i.'+_0x2855aa[0x0];_0x149e2c[_0x14fd('0x46')](_0x2bc09d,_0x2855aa[0x1]===_0x14fd('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x30486c)){_0x149e2c[_0x14fd('0x5e')](_0x3ff0d);_0x1f27f4[_0x14fd('0x7b')](_0x14fd('0x8e'),_0x30486c);}BPromise[_0x14fd('0x8f')]()[_0x14fd('0x26')](function(){if(!_0x2f5b75){if(_0x585177['query'][_0x14fd('0x90')])return;_0x1f27f4[_0x14fd('0x7b')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x149e2c['where'](_0x14fd('0x91'));return;}if(_0x585177[_0x14fd('0x92')][_0x14fd('0x93')]!==_0x14fd('0x94'))return;return _0x585177[_0x14fd('0x92')][_0x14fd('0x95')]({'attributes':['id'],'raw':!![]})[_0x14fd('0x26')](function(_0x5e3d8f){if(_[_0x14fd('0x72')](_0x5e3d8f)){_0x1f27f4[_0x14fd('0x7b')](_0x14fd('0x96'));_0x149e2c[_0x14fd('0x7b')](_0x14fd('0x96'));}else{_0x1f27f4['where'](_0x14fd('0x73'),_['map'](_0x5e3d8f,'id'));_0x149e2c[_0x14fd('0x7b')](_0x14fd('0x73'),_[_0x14fd('0x2b')](_0x5e3d8f,'id'));}});})['then'](function(){if(_0x585177[_0x14fd('0x92')][_0x14fd('0x93')]===_0x14fd('0x94')&&!_0x2f5b75&&!_0x585177[_0x14fd('0x3e')][_0x14fd('0x90')])return[];return db['sequelize'][_0x14fd('0x3e')](_0x1f27f4[_0x14fd('0x97')](),_0x14ea05);})[_0x14fd('0x26')](function(_0x5f443c){_0x263006['count']=_0x5f443c[_0x14fd('0x43')];if(_0x263006[_0x14fd('0x98')]===0x0)return[];return db[_0x14fd('0x99')]['query'](_0x11e265[_0x14fd('0x97')](),_0x14ea05)['then'](function(_0x4b35bb){_0x811c8f=_[_0x14fd('0x9a')](_0x4b35bb,'id');_0x14ea05=_[_0x14fd('0x9b')](_0x14ea05,{'model':db[_0x14fd('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x585177[_0x14fd('0x3e')][_0x14fd('0x9c')]){_0x18ba03[_0x14fd('0x41')]['forEach'](function(_0x371679){_0x149e2c[_0x14fd('0x48')]('i.'+_0x371679);});}else{_0x149e2c[_0x14fd('0x48')](_0x14fd('0x8a'),_0x14fd('0x8b'));_0x149e2c[_0x14fd('0x48')](_0x14fd('0x9d'),_0x14fd('0x9e'));_0x149e2c[_0x14fd('0x48')](_0x14fd('0x9f'),_0x14fd('0xa0'));_0x149e2c[_0x14fd('0x48')](_0x14fd('0xa1'),_0x14fd('0x8c'));_0x149e2c[_0x14fd('0x48')](_0x14fd('0xa2'));_0x149e2c['field'](_0x14fd('0xa3'),_0x14fd('0xa4'));_0x149e2c['field'](_0x14fd('0xa5'),_0x14fd('0xa6'));_0x149e2c[_0x14fd('0x48')](_0x14fd('0xa7'),_0x14fd('0xa8'));_0x149e2c[_0x14fd('0x48')](_0x14fd('0xa9'),'Contact.phone');_0x149e2c[_0x14fd('0x48')](_0x14fd('0xaa'),_0x14fd('0xab'));_0x149e2c[_0x14fd('0x48')](_0x14fd('0xac'),_0x14fd('0xad'));_0x149e2c[_0x14fd('0x48')](_0x14fd('0xae'),_0x14fd('0xaf'));_0x149e2c['field'](_0x14fd('0xb0'),_0x14fd('0xb1'));_0x149e2c[_0x14fd('0x48')](_0x14fd('0xb2'),_0x14fd('0x2d'));}if(_0x18ba03['limit'])_0x149e2c[_0x14fd('0x1f')](_0x18ba03[_0x14fd('0x1f')]);if(_0x18ba03[_0x14fd('0x1d')])_0x149e2c[_0x14fd('0x1d')](_0x18ba03[_0x14fd('0x1d')]);return db[_0x14fd('0x99')][_0x14fd('0x3e')](_0x149e2c[_0x14fd('0x97')](),_0x14ea05);})[_0x14fd('0x26')](function(_0x4813d6){if(_0x4813d6[_0x14fd('0x43')]>0x0)_0x5c1db3[_0x14fd('0x7b')]('ui.FaxInteractionId\x20IN\x20?',_[_0x14fd('0x2b')](_0x4813d6,'id'));return db[_0x14fd('0x99')][_0x14fd('0x3e')](_0x5c1db3[_0x14fd('0x97')](),_0x14ea05)[_0x14fd('0x26')](function(_0xf5fd52){var _0x25c82c=_['groupBy'](_0xf5fd52,_0x14fd('0xb3'));var _0x2f01ae=[];_0x4813d6[_0x14fd('0x69')](function(_0x49789a){_0x2f01ae[_0x14fd('0x2f')](updateFaxInteraction(_0x49789a,_0x811c8f,_0x25c82c));});return BPromise['all'](_0x2f01ae);});});})[_0x14fd('0x26')](function(_0x2bc74d){_0x263006[_0x14fd('0xb4')]=_0x2bc74d;return _0x263006;})[_0x14fd('0x26')](respondWithFilteredResult(_0x42f1d1,_0x18ba03))[_0x14fd('0x30')](handleError(_0x42f1d1,null));};exports['show']=function(_0x4b7d6b,_0x2ba465){var _0x40c688={'raw':![],'where':{'id':_0x4b7d6b[_0x14fd('0xb5')]['id']}},_0x3c30a0={};_0x3c30a0[_0x14fd('0x40')]=_[_0x14fd('0x70')](db[_0x14fd('0x39')][_0x14fd('0x3a')]);_0x3c30a0[_0x14fd('0x3e')]=_[_0x14fd('0x70')](_0x4b7d6b[_0x14fd('0x3e')]);_0x3c30a0[_0x14fd('0x3f')]=_[_0x14fd('0x42')](_0x3c30a0['model'],_0x3c30a0[_0x14fd('0x3e')]);_0x40c688[_0x14fd('0x41')]=_['intersection'](_0x3c30a0[_0x14fd('0x40')],qs[_0x14fd('0x9c')](_0x4b7d6b[_0x14fd('0x3e')][_0x14fd('0x9c')]));_0x40c688[_0x14fd('0x41')]=_0x40c688[_0x14fd('0x41')][_0x14fd('0x43')]?_0x40c688[_0x14fd('0x41')]:_0x3c30a0['model'];if(_0x4b7d6b[_0x14fd('0x3e')][_0x14fd('0xb6')]){_0x40c688[_0x14fd('0xb7')]=[{'all':!![]}];}_0x40c688=_[_0x14fd('0x9b')]({},_0x40c688,_0x4b7d6b[_0x14fd('0xb8')]);return db['FaxInteraction']['find'](_0x40c688)[_0x14fd('0x26')](handleEntityNotFound(_0x2ba465,null))[_0x14fd('0x26')](respondWithResult(_0x2ba465,null))[_0x14fd('0x30')](handleError(_0x2ba465,null));};exports[_0x14fd('0xb9')]=function(_0x3784d3,_0x5c82f8){return db[_0x14fd('0x39')][_0x14fd('0xb9')](_0x3784d3[_0x14fd('0x6e')],{})['then'](respondWithResult(_0x5c82f8,0xc9))[_0x14fd('0x30')](handleError(_0x5c82f8,null));};exports[_0x14fd('0xba')]=function(_0x267ce6,_0x193ed2){if(_0x267ce6[_0x14fd('0x6e')]['id']){delete _0x267ce6[_0x14fd('0x6e')]['id'];}return db[_0x14fd('0x39')]['find']({'where':{'id':_0x267ce6[_0x14fd('0xb5')]['id']}})[_0x14fd('0x26')](handleEntityNotFound(_0x193ed2,null))[_0x14fd('0x26')](saveUpdates(_0x267ce6[_0x14fd('0x6e')],null))[_0x14fd('0x26')](respondWithResult(_0x193ed2,null))[_0x14fd('0x30')](handleError(_0x193ed2,null));};exports['destroy']=function(_0x3ba7e0,_0x3a95f9){return db[_0x14fd('0x39')][_0x14fd('0x5d')]({'where':{'id':_0x3ba7e0[_0x14fd('0xb5')]['id']}})[_0x14fd('0x26')](handleEntityNotFound(_0x3a95f9,null))[_0x14fd('0x26')](removeEntity(_0x3a95f9,null))['catch'](handleError(_0x3a95f9,null));};exports['describe']=function(_0xf22023,_0x1834da){return db[_0x14fd('0x39')][_0x14fd('0xbb')]()[_0x14fd('0x26')](respondWithResult(_0x1834da,null))[_0x14fd('0x30')](handleError(_0x1834da,null));};exports[_0x14fd('0xbc')]=function(_0x5755f8,_0x5c5a9a,_0x8f93ba){return db[_0x14fd('0xbd')]['find']({'where':{'id':_0x5755f8[_0x14fd('0xb5')]['id']}})[_0x14fd('0x26')](handleEntityNotFound(_0x5c5a9a,null))[_0x14fd('0x26')](function(_0x3df01f){if(_0x3df01f){return _0x3df01f[_0x14fd('0xbc')](_0x5755f8[_0x14fd('0x6e')][_0x14fd('0xbe')],_[_0x14fd('0xbf')](_0x5755f8[_0x14fd('0x6e')],[_0x14fd('0xbe'),'id'])||{});}})[_0x14fd('0x26')](respondWithResult(_0x5c5a9a,null))[_0x14fd('0x30')](handleError(_0x5c5a9a,null));};exports[_0x14fd('0xc0')]=function(_0x7da02e,_0x2fbac8,_0x724ccb){var _0x16bb91={'raw':![],'where':{}};var _0x327835={};var _0x207246={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x14fd('0xc1')]({'where':{'id':_0x7da02e[_0x14fd('0xb5')]['id']}})['then'](handleEntityNotFound(_0x2fbac8,null))[_0x14fd('0x26')](function(_0x2a9144){if(_0x2a9144){_0x327835['model']=_[_0x14fd('0x70')](db[_0x14fd('0xbd')][_0x14fd('0x3a')]);_0x327835[_0x14fd('0x3e')]=_[_0x14fd('0x70')](_0x7da02e[_0x14fd('0x3e')]);_0x327835[_0x14fd('0x3f')]=_[_0x14fd('0x42')](_0x327835[_0x14fd('0x40')],_0x327835[_0x14fd('0x3e')]);_0x16bb91['attributes']=_[_0x14fd('0x42')](_0x327835['model'],qs[_0x14fd('0x9c')](_0x7da02e['query'][_0x14fd('0x9c')]));_0x16bb91[_0x14fd('0x41')]=_0x16bb91[_0x14fd('0x41')][_0x14fd('0x43')]?_0x16bb91[_0x14fd('0x41')]:_0x327835[_0x14fd('0x40')];if(!_0x7da02e[_0x14fd('0x3e')][_0x14fd('0x44')](_0x14fd('0x45'))){_0x16bb91['limit']=qs[_0x14fd('0x1f')](_0x7da02e[_0x14fd('0x3e')][_0x14fd('0x1f')]);_0x16bb91[_0x14fd('0x1d')]=qs[_0x14fd('0x1d')](_0x7da02e['query'][_0x14fd('0x1d')]);}_0x16bb91[_0x14fd('0x46')]=qs[_0x14fd('0x47')](_0x7da02e[_0x14fd('0x3e')][_0x14fd('0x47')]);_0x16bb91['where']=qs['filters'](_[_0x14fd('0xc2')](_0x7da02e[_0x14fd('0x3e')],_0x327835[_0x14fd('0x3f')]));_0x16bb91[_0x14fd('0x7b')]['FaxInteractionId']=_0x2a9144['id'];if(_0x7da02e[_0x14fd('0x3e')][_0x14fd('0x83')]){_0x16bb91[_0x14fd('0x7b')]=_[_0x14fd('0x9b')](_0x16bb91[_0x14fd('0x7b')],{'$or':_[_0x14fd('0x2b')](_0x16bb91[_0x14fd('0x41')],function(_0x578171){var _0x10bfe3={};_0x10bfe3[_0x578171]={'$like':'%'+_0x7da02e[_0x14fd('0x3e')][_0x14fd('0x83')]+'%'};return _0x10bfe3;})});}if(_0x7da02e['query'][_0x14fd('0x77')]){var _0x14c70a=_0x7da02e[_0x14fd('0x3e')][_0x14fd('0x77')]['split'](',');var _0x4f5e32={};_0x4f5e32[_0x14c70a[0x0]]={'$gte':moment(_0x14c70a[0x1])[_0x14fd('0xc3')](_0x14fd('0xc4'))};_0x16bb91[_0x14fd('0x7b')]=_[_0x14fd('0x9b')](_0x16bb91[_0x14fd('0x7b')],_0x4f5e32);}_0x16bb91=_[_0x14fd('0x9b')]({},_0x16bb91,_0x7da02e['options']);return db['FaxMessage'][_0x14fd('0x98')]({'where':_0x16bb91[_0x14fd('0x7b')]})[_0x14fd('0x26')](function(_0x11ce14){_0x207246['count']=_0x11ce14;if(_0x7da02e[_0x14fd('0x3e')][_0x14fd('0xb6')]){_0x16bb91['include']=[{'all':!![]}];}return db[_0x14fd('0xbd')][_0x14fd('0xc5')](_0x16bb91);})[_0x14fd('0x26')](function(_0xf937d5){_0x207246[_0x14fd('0xb4')]=_0xf937d5;return _0x207246;});}})[_0x14fd('0x26')](respondWithFilteredResult(_0x2fbac8,_0x16bb91))[_0x14fd('0x30')](handleError(_0x2fbac8,null));};exports['addTags']=function(_0x3e133b,_0xdce79b,_0x163e48){return db[_0x14fd('0x39')][_0x14fd('0x5d')]({'where':{'id':_0x3e133b[_0x14fd('0xb5')]['id']}})[_0x14fd('0x26')](handleEntityNotFound(_0xdce79b,null))['then'](function(_0x6afba8){if(_0x6afba8){return _0x6afba8['setTags'](_0x3e133b[_0x14fd('0x6e')][_0x14fd('0xbe')],_[_0x14fd('0xbf')](_0x3e133b[_0x14fd('0x6e')],[_0x14fd('0xbe'),'id'])||{})[_0x14fd('0xc6')](function(){return db[_0x14fd('0x68')][_0x14fd('0xc5')]({'attributes':['id',_0x14fd('0x29'),_0x14fd('0x49')],'where':{'id':_0x3e133b[_0x14fd('0x6e')][_0x14fd('0xbe')]}});})[_0x14fd('0x26')](function(_0x4fb2bc){socket['emit'](_0x14fd('0xc7'),{'id':Number(_0x3e133b[_0x14fd('0xb5')]['id']),'tags':_0x4fb2bc||[]});return{'id':Number(_0x3e133b[_0x14fd('0xb5')]['id']),'tags':_0x4fb2bc||[]};});}})[_0x14fd('0x26')](respondWithResult(_0xdce79b,null))[_0x14fd('0x30')](handleError(_0xdce79b,null));};exports['removeTags']=function(_0x45b8a2,_0x2c841a,_0x2edb9b){return db[_0x14fd('0x39')][_0x14fd('0x5d')]({'where':{'id':_0x45b8a2['params']['id']}})[_0x14fd('0x26')](handleEntityNotFound(_0x2c841a,null))[_0x14fd('0x26')](function(_0x269ef4){if(_0x269ef4){return _0x269ef4['removeTags'](_0x45b8a2[_0x14fd('0x3e')][_0x14fd('0xbe')]);}})[_0x14fd('0x26')](respondWithStatusCode(_0x2c841a,null))['catch'](handleError(_0x2c841a,null));};exports[_0x14fd('0xc8')]=function(_0x56030d,_0x6e43d5){var _0x239234=moment()[_0x14fd('0xc9')]()[_0x14fd('0x97')]();var _0x545547=path[_0x14fd('0xca')](config[_0x14fd('0xcb')],_0x14fd('0xcc'),'files',_0x14fd('0xcd'));var _0xb1f55=path[_0x14fd('0xca')](config[_0x14fd('0xcb')],_0x14fd('0xcc'),_0x14fd('0xce'),_0x14fd('0xcf'));var _0x4cf2b1=path[_0x14fd('0xca')](_0x545547,_0x239234);var _0xcc2b71=util['format'](_0x14fd('0xd0'),_0x56030d[_0x14fd('0xb5')]['id'],_0x239234);var _0x9a783c=path[_0x14fd('0xca')](_0x545547,_0xcc2b71);var _0x3f213b=[];_0x3f213b[_0x14fd('0x2f')]({'model':db['Attachment'],'as':_0x14fd('0xd1'),'raw':!![]});var _0x242b39=[{'model':db[_0x14fd('0xbd')],'as':_0x14fd('0xd2'),'attributes':['id',_0x14fd('0x6e'),_0x14fd('0x75')],'include':_0x3f213b}];return db['FaxInteraction'][_0x14fd('0x5d')]({'where':{'id':_0x56030d[_0x14fd('0xb5')]['id']},'include':_0x242b39})['then'](handleEntityNotFound(_0x6e43d5,null))[_0x14fd('0x26')](function(_0x85cd09){if(_0x85cd09&&_0x85cd09[_0x14fd('0xd2')]){var _0x23daa1=_0x85cd09[_0x14fd('0xd3')]({'plain':!![]});fs[_0x14fd('0xd4')](_0x4cf2b1);for(var _0x2e8a7c=0x0;_0x2e8a7c<_0x23daa1[_0x14fd('0xd2')][_0x14fd('0x43')];_0x2e8a7c++){var _0x4f650b=_0x23daa1['Messages'][_0x2e8a7c][_0x14fd('0xd1')];if(_0x4f650b){var _0x54e3e5=path[_0x14fd('0xca')](_0xb1f55,_0x4f650b[_0x14fd('0xd5')]);if(fs['existsSync'](_0x54e3e5)){fs[_0x14fd('0xd6')](_0x54e3e5)['pipe'](fs[_0x14fd('0xd7')](path[_0x14fd('0xca')](_0x4cf2b1,_0x4f650b[_0x14fd('0xd5')])));}}}return BPromise[_0x14fd('0x8f')]()[_0x14fd('0x26')](function(){return new BPromise(function(_0x6c1d46,_0x4c9aba){zipdir(_0x4cf2b1,{'saveTo':_0x9a783c},function(_0x37ef61,_0x304d91){if(_0x37ef61)return _0x4c9aba(_0x37ef61);return _0x6c1d46(_0x304d91);});})['then'](function(){return new BPromise(function(_0xd99f42,_0x3c0066){rimraf(_0x4cf2b1,function(_0x41ae27){if(_0x41ae27)_0x3c0066(_0x41ae27);return _0xd99f42();});});})['then'](function(){return _0x6e43d5['download'](_0x9a783c,_0xcc2b71,function(_0x48b485){if(_0x48b485){console['log'](_0x14fd('0xd8'),_0x48b485);}else{fs[_0x14fd('0xd9')](_0x9a783c);}});});});}else{return _0x6e43d5[_0x14fd('0x1b')](0xc8);}})[_0x14fd('0x30')](handleError(_0x6e43d5,null));}; \ No newline at end of file +var _0x7b68=['conditions','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?','find','ContactId','start','Tag','forEach','User','buildExpression','body','text','some','compact','createdAt','parse','$gte','$lte','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','isEmpty','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','keyBy','merge','FaxInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.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','i.*','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','catch','show','params','include','options','create','describe','addMessage','ids','omit','findOne','sort','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','findAll','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','format','transcript-%d-%s.zip','Attachment','Messages','get','basename','existsSync','createReadStream','pipe','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','json','offset','limit','undefined','count','reject','save','update','destroy','then','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','waiting','talking','answered','total','closed','UserId','unmanaged','index','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','select','field','u.fullname','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator'];(function(_0x4488e3,_0x1c7777){var _0x3bd7d4=function(_0x4f7449){while(--_0x4f7449){_0x4488e3['push'](_0x4488e3['shift']());}};_0x3bd7d4(++_0x1c7777);}(_0x7b68,0x159));var _0x87b6=function(_0x121811,_0x1f917c){_0x121811=_0x121811-0x0;var _0x3ddc9b=_0x7b68[_0x121811];return _0x3ddc9b;};'use strict';var emlformat=require(_0x87b6('0x0'));var rimraf=require(_0x87b6('0x1'));var zipdir=require(_0x87b6('0x2'));var jsonpatch=require(_0x87b6('0x3'));var rp=require('request-promise');var moment=require(_0x87b6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x87b6('0x5'));var path=require(_0x87b6('0x6'));var sox=require(_0x87b6('0x7'));var csv=require(_0x87b6('0x8'));var ejs=require(_0x87b6('0x9'));var fs=require('fs');var fs_extra=require(_0x87b6('0xa'));var _=require(_0x87b6('0xb'));var squel=require('squel');var crypto=require(_0x87b6('0xc'));var jsforce=require(_0x87b6('0xd'));var deskjs=require(_0x87b6('0xe'));var toCsv=require(_0x87b6('0x8'));var querystring=require(_0x87b6('0xf'));var Papa=require('papaparse');var Redis=require(_0x87b6('0x10'));var authService=require(_0x87b6('0x11'));var qs=require(_0x87b6('0x12'));var as=require(_0x87b6('0x13'));var hardwareService=require(_0x87b6('0x14'));var logger=require('../../config/logger')(_0x87b6('0x15'));var utils=require(_0x87b6('0x16'));var config=require(_0x87b6('0x17'));var licenseUtil=require(_0x87b6('0x18'));var db=require(_0x87b6('0x19'))['db'];config['redis']=_[_0x87b6('0x1a')](config[_0x87b6('0x1b')],{'host':_0x87b6('0x1c'),'port':0x18eb});var socket=require(_0x87b6('0x1d'))(new Redis(config['redis']));require(_0x87b6('0x1e'))[_0x87b6('0x1f')](socket);function respondWithStatusCode(_0x450efc,_0x426c58){_0x426c58=_0x426c58||0xcc;return function(_0x4c4cc0){if(_0x4c4cc0){return _0x450efc['sendStatus'](_0x426c58);}return _0x450efc[_0x87b6('0x20')](_0x426c58)[_0x87b6('0x21')]();};}function respondWithResult(_0x1f7166,_0x1a7c7b){_0x1a7c7b=_0x1a7c7b||0xc8;return function(_0x14927d){if(_0x14927d){return _0x1f7166[_0x87b6('0x20')](_0x1a7c7b)[_0x87b6('0x22')](_0x14927d);}};}function respondWithFilteredResult(_0x124f7c,_0x32a8aa){return function(_0xbd821e){if(_0xbd821e){var _0x475bf3=typeof _0x32a8aa[_0x87b6('0x23')]==='undefined'&&typeof _0x32a8aa[_0x87b6('0x24')]===_0x87b6('0x25');var _0x1eb800=_0xbd821e[_0x87b6('0x26')];var _0xc2b712=_0x475bf3?0x0:_0x32a8aa[_0x87b6('0x23')];var _0x1ffa5b=_0x475bf3?_0xbd821e[_0x87b6('0x26')]:_0x32a8aa[_0x87b6('0x23')]+_0x32a8aa['limit'];var _0x3a0eb5;if(_0x1ffa5b>=_0x1eb800){_0x1ffa5b=_0x1eb800;_0x3a0eb5=0xc8;}else{_0x3a0eb5=0xce;}_0x124f7c[_0x87b6('0x20')](_0x3a0eb5);return _0x124f7c['set']('Content-Range',_0xc2b712+'-'+_0x1ffa5b+'/'+_0x1eb800)['json'](_0xbd821e);}return null;};}function patchUpdates(_0x422cc0){return function(_0x1a3c4d){try{jsonpatch['apply'](_0x1a3c4d,_0x422cc0,!![]);}catch(_0x47f858){return BPromise[_0x87b6('0x27')](_0x47f858);}return _0x1a3c4d[_0x87b6('0x28')]();};}function saveUpdates(_0x522a55,_0x45e650){return function(_0x3b170a){if(_0x3b170a){return _0x3b170a[_0x87b6('0x29')](_0x522a55)['then'](function(_0x421f0e){return _0x421f0e;});}return null;};}function removeEntity(_0x2d1bf2,_0x301d93){return function(_0x137c84){if(_0x137c84){return _0x137c84[_0x87b6('0x2a')]()[_0x87b6('0x2b')](function(){_0x2d1bf2[_0x87b6('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x406071,_0x1e5e1e){return function(_0x382e51){if(!_0x382e51){_0x406071[_0x87b6('0x2c')](0x194);}return _0x382e51;};}function handleError(_0x16d754,_0x54e1c5){_0x54e1c5=_0x54e1c5||0x1f4;return function(_0x19b6a7){logger[_0x87b6('0x2d')](_0x19b6a7[_0x87b6('0x2e')]);if(_0x19b6a7[_0x87b6('0x2f')]){delete _0x19b6a7[_0x87b6('0x2f')];}_0x16d754[_0x87b6('0x20')](_0x54e1c5)[_0x87b6('0x30')](_0x19b6a7);};}function getInteractionUsers(_0x6b2001,_0x264d04){return new BPromise(function(_0x3c846b,_0x254203){try{if(_0x264d04[_0x6b2001['id']]){_0x6b2001[_0x87b6('0x31')]=_[_0x87b6('0x32')](_0x264d04[_0x6b2001['id']],function(_0x52f34b){return{'id':_0x52f34b['id'],'fullname':_0x52f34b[_0x87b6('0x33')]};});}}catch(_0x1135a6){_0x254203(_0x1135a6);}_0x3c846b(_0x6b2001);});}function getInteractionTags(_0x45a142,_0x4d84da){return new BPromise(function(_0x13b307,_0x4fa2d7){try{if(_0x45a142[_0x87b6('0x34')]){_0x45a142[_0x87b6('0x35')]=[];_0x45a142[_0x87b6('0x34')][_0x87b6('0x36')](',')['forEach'](function(_0x22b1b7){_0x45a142[_0x87b6('0x35')][_0x87b6('0x37')](_0x4d84da[_0x22b1b7]);});}delete _0x45a142[_0x87b6('0x34')];}catch(_0x1b5895){_0x4fa2d7(_0x1b5895);}_0x13b307(_0x45a142);});}function updateFaxInteraction(_0x1d9775,_0x22dc2e,_0xa04ff){return new BPromise(function(_0x12a806,_0x153353){return getInteractionUsers(_0x1d9775,_0xa04ff)[_0x87b6('0x2b')](function(_0x389429){return getInteractionTags(_0x389429,_0x22dc2e);})['then'](function(_0x3a1305){return getStateInteraction(_0x3a1305);})['then'](function(_0xc8fe3){_0x12a806(_0xc8fe3);})['catch'](function(_0x57bfe9){_0x153353(_0x57bfe9);});});}function getStateInteraction(_0x20ea6f){return new BPromise(function(_0xa9497c){_0x20ea6f[_0x87b6('0x38')]=0x0;_0x20ea6f[_0x87b6('0x39')]=0x0;_0x20ea6f[_0x87b6('0x3a')]=0x0;_0x20ea6f['unmanaged']=0x0;_0x20ea6f[_0x87b6('0x3b')]=0x0;if(!_0x20ea6f[_0x87b6('0x3c')]&&!_0x20ea6f['UserId']){_0x20ea6f[_0x87b6('0x38')]+=0x1;}if(!_0x20ea6f['closed']&&_0x20ea6f['UserId']){_0x20ea6f[_0x87b6('0x39')]+=0x1;if(_0x20ea6f[_0x87b6('0x38')]){_0x20ea6f[_0x87b6('0x38')]-=0x1;}}if(_0x20ea6f[_0x87b6('0x3c')]&&_0x20ea6f['UserId']){_0x20ea6f[_0x87b6('0x3a')]+=0x1;if(_0x20ea6f['talking']){_0x20ea6f[_0x87b6('0x39')]-=0x1;}}if(_0x20ea6f[_0x87b6('0x3c')]&&!_0x20ea6f[_0x87b6('0x3d')]){_0x20ea6f[_0x87b6('0x3e')]+=0x1;if(_0x20ea6f[_0x87b6('0x38')]){_0x20ea6f[_0x87b6('0x38')]-=0x1;}}_0x20ea6f[_0x87b6('0x3b')]+=0x1;_0xa9497c(_0x20ea6f);});}exports[_0x87b6('0x3f')]=function(_0x8c5b46,_0x2c2fed){var _0x1d14c0={},_0x2324c0={},_0x32ba18={'count':0x0,'rows':[]};var _0x3a02ed=_[_0x87b6('0x32')](db['FaxInteraction'][_0x87b6('0x40')],function(_0x4e2ccb){return{'name':_0x4e2ccb['fieldName'],'type':_0x4e2ccb[_0x87b6('0x41')]['key']};});_0x2324c0[_0x87b6('0x42')]=_[_0x87b6('0x32')](_0x3a02ed,_0x87b6('0x2f'));_0x2324c0[_0x87b6('0x43')]=_[_0x87b6('0x44')](_0x8c5b46[_0x87b6('0x43')]);_0x2324c0['filters']=_[_0x87b6('0x45')](_0x2324c0['model'],_0x2324c0[_0x87b6('0x43')]);_0x1d14c0['attributes']=_[_0x87b6('0x45')](_0x2324c0['model'],qs[_0x87b6('0x46')](_0x8c5b46[_0x87b6('0x43')][_0x87b6('0x46')]));_0x1d14c0[_0x87b6('0x47')]=_0x1d14c0[_0x87b6('0x47')][_0x87b6('0x48')]?_0x1d14c0['attributes']:_0x2324c0['model'];if(!_0x8c5b46[_0x87b6('0x43')][_0x87b6('0x49')](_0x87b6('0x4a'))){_0x1d14c0[_0x87b6('0x24')]=qs[_0x87b6('0x24')](_0x8c5b46['query']['limit']);_0x1d14c0['offset']=qs[_0x87b6('0x23')](_0x8c5b46[_0x87b6('0x43')][_0x87b6('0x23')]);}_0x1d14c0[_0x87b6('0x4b')]=qs['sort'](_0x8c5b46[_0x87b6('0x43')]['sort']);_0x1d14c0[_0x87b6('0x4c')]=qs[_0x87b6('0x4d')](_[_0x87b6('0x4e')](_0x8c5b46[_0x87b6('0x43')],_0x2324c0[_0x87b6('0x4d')]),_0x3a02ed);var _0x50ab45=[];var _0x1b8fbd=squel[_0x87b6('0x4f')]()[_0x87b6('0x50')]('id')[_0x87b6('0x50')](_0x87b6('0x2f'))[_0x87b6('0x50')]('color')['from']('tools_tags');var _0x3041f3=squel['select']()[_0x87b6('0x50')]('u.id')[_0x87b6('0x50')](_0x87b6('0x51'))[_0x87b6('0x50')]('ui.FaxInteractionId')['from'](_0x87b6('0x52'),'ui')[_0x87b6('0x53')](_0x87b6('0x54'),'u',_0x87b6('0x55'));var _0x143b5a=squel[_0x87b6('0x4f')]()['from'](_0x87b6('0x56'),'i')['left_join'](_0x87b6('0x57'),'c',_0x87b6('0x58'))[_0x87b6('0x53')](_0x87b6('0x54'),'o','o.id\x20=\x20i.UserId')[_0x87b6('0x53')](_0x87b6('0x59'),'a','a.id\x20=\x20i.FaxAccountId')[_0x87b6('0x53')](_0x87b6('0x5a'),'me',_0x87b6('0x5b'))[_0x87b6('0x53')](_0x87b6('0x5c'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x87b6('0x53')](_0x87b6('0x5d'),'t',_0x87b6('0x5e'));var _0x489761=squel[_0x87b6('0x5f')]();var _0x2aa21f=[];var _0x55ca85=squel[_0x87b6('0x5f')]();var _0x34c19f;if(_0x8c5b46[_0x87b6('0x43')][_0x87b6('0x60')]){_0x34c19f=as[_0x87b6('0x61')](_0x8c5b46['query'][_0x87b6('0x60')]);var _0x2e438a=_0x34c19f[_0x87b6('0x62')];for(var _0x11d797=0x0;_0x11d797<_0x34c19f[_0x87b6('0x63')][_0x87b6('0x48')];_0x11d797++){var _0x2b5083=_0x34c19f[_0x87b6('0x63')][_0x11d797];var _0x4fef00='i';var _0xf8944=_['find'](_0x3a02ed,[_0x87b6('0x2f'),_0x2b5083[_0x87b6('0x50')]]);if(!_0xf8944){switch(_0x2b5083[_0x87b6('0x50')]){case _0x87b6('0x64'):if(_0x2b5083['value']==0x1){_0x143b5a[_0x87b6('0x65')]('`'+_0x2b5083['field']+_0x87b6('0x66'));}else{_0x143b5a[_0x87b6('0x65')]('`'+_0x2b5083['field']+_0x87b6('0x67'));}break;case _0x87b6('0x68'):if(_0x2b5083[_0x87b6('0x69')]===_0x87b6('0x6a')){if(_0x2b5083[_0x87b6('0x6b')][_0x87b6('0x36')]('\x20')['length']>0x1){_0x489761[_0x2e438a](_0x87b6('0x6c'),qs[_0x87b6('0x6d')](_0x2b5083['value']),null);}else{var _0x45c8f3='%'+_0x2b5083[_0x87b6('0x6b')]+'%';_0x489761[_0x2e438a](_0x87b6('0x6e'),_0x45c8f3,_0x45c8f3,_0x45c8f3);}}else{_0xf8944=_[_0x87b6('0x6f')](_0x3a02ed,[_0x87b6('0x2f'),_0x87b6('0x70')]);_0x2b5083[_0x87b6('0x50')]='ContactId';_0x39a9b7=as['buildExpression'](_0x4fef00,_0xf8944[_0x87b6('0x41')],_0x2b5083);_0x489761[_0x2e438a](_0x39a9b7['text'],_0x39a9b7[_0x87b6('0x6b')][_0x87b6('0x71')],_0x39a9b7[_0x87b6('0x6b')]['end']);}break;case _0x87b6('0x72'):var _0x44b4a7=_0x2b5083['value'][_0x87b6('0x36')](',')[_0x87b6('0x32')](function(_0x3b076b){return Number(_0x3b076b);});_0x44b4a7[_0x87b6('0x73')](function(_0x63ce0b){_0x55ca85['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x63ce0b+',%');});_0x2aa21f=_['union'](_0x2aa21f,_0x44b4a7);break;case _0x87b6('0x74'):if(_0x2b5083[_0x87b6('0x69')]===_0x87b6('0x6a')){_0x489761[_0x2e438a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2b5083[_0x87b6('0x6b')]+'%',null);}else{_0xf8944=_[_0x87b6('0x6f')](_0x3a02ed,['name','UserId']);_0x2b5083['field']=_0x87b6('0x3d');_0x39a9b7=as[_0x87b6('0x75')](_0x4fef00,_0xf8944[_0x87b6('0x41')],_0x2b5083);_0x489761[_0x2e438a](_0x39a9b7['text'],_0x39a9b7[_0x87b6('0x6b')][_0x87b6('0x71')],_0x39a9b7[_0x87b6('0x6b')][_0x87b6('0x21')]);}break;case _0x87b6('0x76'):_0x39a9b7=as['buildExpression']('me',null,_0x2b5083);_0x489761[_0x2e438a](_0x39a9b7[_0x87b6('0x77')],_0x39a9b7[_0x87b6('0x6b')]['start'],_0x39a9b7[_0x87b6('0x6b')][_0x87b6('0x21')]);break;}}else{var _0x39a9b7=as[_0x87b6('0x75')](_0x4fef00,_0xf8944['type'],_0x2b5083);_0x489761[_0x2e438a](_0x39a9b7[_0x87b6('0x77')],_0x39a9b7[_0x87b6('0x6b')][_0x87b6('0x71')],_0x39a9b7['value'][_0x87b6('0x21')]);}}}else{var _0x29dbdb=_(_0x8c5b46[_0x87b6('0x43')])[_0x87b6('0x44')]()[_0x87b6('0x32')](function(_0x5421ef){return _[_0x87b6('0x78')](_0x3a02ed,['name',_0x5421ef])?_0x5421ef:undefined;})[_0x87b6('0x79')]()[_0x87b6('0x6b')]();if(!_['isEmpty'](_0x29dbdb)){_0x29dbdb['forEach'](function(_0x560c5d){if(_0x560c5d==='FaxAccountId'){_0x143b5a[_0x87b6('0x4c')]('i.FaxAccountId\x20IN\x20?',[]['concat'](_0x8c5b46[_0x87b6('0x43')][_0x560c5d]));}else if(_0x560c5d===_0x87b6('0x7a')){var _0x203bbb=JSON[_0x87b6('0x7b')](_0x8c5b46[_0x87b6('0x43')][_0x560c5d])[_0x87b6('0x7c')];var _0x5014bc=JSON[_0x87b6('0x7b')](_0x8c5b46[_0x87b6('0x43')][_0x560c5d])[_0x87b6('0x7d')];_0x143b5a[_0x87b6('0x4c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x203bbb,_0x5014bc);}else{if(_0x8c5b46['query'][_0x560c5d]==='null'){_0x143b5a[_0x87b6('0x4c')]('i.'+_0x560c5d+_0x87b6('0x7e'));}else{_0x143b5a[_0x87b6('0x4c')]('i.'+_0x560c5d+'\x20=\x20?',_0x8c5b46['query'][_0x560c5d]);}}});}if(_0x8c5b46[_0x87b6('0x43')][_0x87b6('0x7f')]){if(_0x8c5b46[_0x87b6('0x43')]['read']==0x1){_0x143b5a[_0x87b6('0x65')](_0x87b6('0x80'));}else{_0x143b5a['having'](_0x87b6('0x81'));}}if(_0x8c5b46[_0x87b6('0x43')]['tag']){_0x2aa21f=_[_0x87b6('0x82')](_0x8c5b46[_0x87b6('0x43')][_0x87b6('0x83')])?_0x8c5b46['query'][_0x87b6('0x83')]:new Array(_0x8c5b46[_0x87b6('0x43')][_0x87b6('0x83')]);_0x2aa21f[_0x87b6('0x73')](function(_0x2584f5){_0x55ca85['or'](_0x87b6('0x84'),'%,'+_0x2584f5+',%');});}if(_0x8c5b46[_0x87b6('0x43')][_0x87b6('0x85')]){var _0x28b697=_0x8c5b46[_0x87b6('0x43')][_0x87b6('0x85')][_0x87b6('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x87b6('0x87')](_0x28b697)){_0x489761['or'](_0x87b6('0x88'),_0x28b697+'%')['or'](_0x87b6('0x89'),_0x28b697+'%');}_0x489761['or'](_0x87b6('0x8a'),_0x28b697+'%');}}_0x143b5a[_0x87b6('0x4c')](_0x489761);_0x143b5a[_0x87b6('0x8b')](_0x87b6('0x8c'));var _0x58d0b8={'type':db[_0x87b6('0x8d')][_0x87b6('0x8e')][_0x87b6('0x8f')],'raw':!![]};var _0x501a77=_0x143b5a[_0x87b6('0x90')]();_0x501a77[_0x87b6('0x50')](_0x87b6('0x8c'));_0x501a77[_0x87b6('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x87b6('0x64'));if(_0x1d14c0[_0x87b6('0x4b')]){_0x1d14c0[_0x87b6('0x4b')]['forEach'](function(_0x210c1e){var _0x24c300=_0x210c1e[0x0]===_0x87b6('0x91')?_0x210c1e[0x0]:'i.'+_0x210c1e[0x0];_0x143b5a['order'](_0x24c300,_0x210c1e[0x1]==='DESC'?![]:!![]);});}if(!_[_0x87b6('0x92')](_0x2aa21f)){_0x143b5a['having'](_0x55ca85);_0x501a77[_0x87b6('0x4c')]('t.id\x20IN\x20?',_0x2aa21f);}BPromise[_0x87b6('0x93')]()['then'](function(){if(!_0x34c19f){if(_0x8c5b46[_0x87b6('0x43')][_0x87b6('0x94')])return;_0x501a77[_0x87b6('0x4c')](_0x87b6('0x95'));_0x143b5a[_0x87b6('0x4c')](_0x87b6('0x95'));return;}if(_0x8c5b46[_0x87b6('0x96')][_0x87b6('0x97')]!==_0x87b6('0x98'))return;return _0x8c5b46['user'][_0x87b6('0x99')]({'attributes':['id'],'raw':!![]})[_0x87b6('0x2b')](function(_0xcd1ed){if(_[_0x87b6('0x92')](_0xcd1ed)){_0x501a77[_0x87b6('0x4c')](_0x87b6('0x9a'));_0x143b5a[_0x87b6('0x4c')](_0x87b6('0x9a'));}else{_0x501a77[_0x87b6('0x4c')](_0x87b6('0x9b'),_[_0x87b6('0x32')](_0xcd1ed,'id'));_0x143b5a[_0x87b6('0x4c')](_0x87b6('0x9b'),_[_0x87b6('0x32')](_0xcd1ed,'id'));}});})[_0x87b6('0x2b')](function(){if(_0x8c5b46[_0x87b6('0x96')][_0x87b6('0x97')]===_0x87b6('0x98')&&!_0x34c19f&&!_0x8c5b46[_0x87b6('0x43')][_0x87b6('0x94')])return[];return db['sequelize'][_0x87b6('0x43')](_0x501a77['toString'](),_0x58d0b8);})[_0x87b6('0x2b')](function(_0xc935cf){_0x32ba18[_0x87b6('0x26')]=_0xc935cf[_0x87b6('0x48')];if(_0x32ba18[_0x87b6('0x26')]===0x0)return[];return db[_0x87b6('0x9c')]['query'](_0x1b8fbd['toString'](),_0x58d0b8)[_0x87b6('0x2b')](function(_0x27c900){_0x50ab45=_[_0x87b6('0x9d')](_0x27c900,'id');_0x58d0b8=_[_0x87b6('0x9e')](_0x58d0b8,{'model':db[_0x87b6('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x8c5b46[_0x87b6('0x43')][_0x87b6('0x46')]){_0x1d14c0[_0x87b6('0x47')][_0x87b6('0x73')](function(_0x5df55d){_0x143b5a[_0x87b6('0x50')]('i.'+_0x5df55d);});}else{_0x143b5a[_0x87b6('0x50')](_0x87b6('0xa0'),_0x87b6('0x64'));_0x143b5a[_0x87b6('0x50')](_0x87b6('0xa1'),_0x87b6('0xa2'));_0x143b5a[_0x87b6('0x50')](_0x87b6('0xa3'),'Account.mandatoryDisposition');_0x143b5a[_0x87b6('0x50')](_0x87b6('0xa4'),'contactName');_0x143b5a['field'](_0x87b6('0xa5'));_0x143b5a['field']('c.firstName',_0x87b6('0xa6'));_0x143b5a[_0x87b6('0x50')](_0x87b6('0xa7'),'Contact.lastName');_0x143b5a[_0x87b6('0x50')]('c.email',_0x87b6('0xa8'));_0x143b5a['field'](_0x87b6('0xa9'),_0x87b6('0xaa'));_0x143b5a[_0x87b6('0x50')](_0x87b6('0xab'),'Contact.mobile');_0x143b5a[_0x87b6('0x50')](_0x87b6('0xac'),_0x87b6('0xad'));_0x143b5a['field'](_0x87b6('0xae'),_0x87b6('0xaf'));_0x143b5a[_0x87b6('0x50')]('o.internal',_0x87b6('0xb0'));_0x143b5a[_0x87b6('0x50')](_0x87b6('0xb1'),_0x87b6('0x34'));}if(_0x1d14c0[_0x87b6('0x24')])_0x143b5a['limit'](_0x1d14c0[_0x87b6('0x24')]);if(_0x1d14c0[_0x87b6('0x23')])_0x143b5a[_0x87b6('0x23')](_0x1d14c0[_0x87b6('0x23')]);return db[_0x87b6('0x9c')][_0x87b6('0x43')](_0x143b5a[_0x87b6('0xb2')](),_0x58d0b8);})[_0x87b6('0x2b')](function(_0x4f74c4){if(_0x4f74c4[_0x87b6('0x48')]>0x0)_0x3041f3[_0x87b6('0x4c')](_0x87b6('0xb3'),_[_0x87b6('0x32')](_0x4f74c4,'id'));return db['sequelize'][_0x87b6('0x43')](_0x3041f3[_0x87b6('0xb2')](),_0x58d0b8)[_0x87b6('0x2b')](function(_0x4bcb85){var _0x239b0e=_[_0x87b6('0xb4')](_0x4bcb85,_0x87b6('0xb5'));var _0x38fab4=[];_0x4f74c4[_0x87b6('0x73')](function(_0x419c06){_0x38fab4[_0x87b6('0x37')](updateFaxInteraction(_0x419c06,_0x50ab45,_0x239b0e));});return BPromise['all'](_0x38fab4);});});})[_0x87b6('0x2b')](function(_0x1df1bf){_0x32ba18['rows']=_0x1df1bf;return _0x32ba18;})[_0x87b6('0x2b')](respondWithFilteredResult(_0x2c2fed,_0x1d14c0))[_0x87b6('0xb6')](handleError(_0x2c2fed,null));};exports[_0x87b6('0xb7')]=function(_0x59d888,_0x102ab8){var _0x5ce568={'raw':![],'where':{'id':_0x59d888[_0x87b6('0xb8')]['id']}},_0x6c8461={};_0x6c8461[_0x87b6('0x42')]=_[_0x87b6('0x44')](db['FaxInteraction'][_0x87b6('0x40')]);_0x6c8461[_0x87b6('0x43')]=_['keys'](_0x59d888['query']);_0x6c8461[_0x87b6('0x4d')]=_['intersection'](_0x6c8461[_0x87b6('0x42')],_0x6c8461[_0x87b6('0x43')]);_0x5ce568['attributes']=_[_0x87b6('0x45')](_0x6c8461[_0x87b6('0x42')],qs[_0x87b6('0x46')](_0x59d888[_0x87b6('0x43')][_0x87b6('0x46')]));_0x5ce568[_0x87b6('0x47')]=_0x5ce568[_0x87b6('0x47')][_0x87b6('0x48')]?_0x5ce568[_0x87b6('0x47')]:_0x6c8461['model'];if(_0x59d888[_0x87b6('0x43')]['includeAll']){_0x5ce568[_0x87b6('0xb9')]=[{'all':!![]}];}_0x5ce568=_[_0x87b6('0x9e')]({},_0x5ce568,_0x59d888[_0x87b6('0xba')]);return db[_0x87b6('0x9f')][_0x87b6('0x6f')](_0x5ce568)[_0x87b6('0x2b')](handleEntityNotFound(_0x102ab8,null))[_0x87b6('0x2b')](respondWithResult(_0x102ab8,null))['catch'](handleError(_0x102ab8,null));};exports[_0x87b6('0xbb')]=function(_0x1cd163,_0x5d04a){return db[_0x87b6('0x9f')]['create'](_0x1cd163[_0x87b6('0x76')],{})[_0x87b6('0x2b')](respondWithResult(_0x5d04a,0xc9))[_0x87b6('0xb6')](handleError(_0x5d04a,null));};exports[_0x87b6('0x29')]=function(_0x118506,_0x25fec1){if(_0x118506[_0x87b6('0x76')]['id']){delete _0x118506['body']['id'];}return db['FaxInteraction'][_0x87b6('0x6f')]({'where':{'id':_0x118506['params']['id']}})[_0x87b6('0x2b')](handleEntityNotFound(_0x25fec1,null))[_0x87b6('0x2b')](saveUpdates(_0x118506[_0x87b6('0x76')],null))[_0x87b6('0x2b')](respondWithResult(_0x25fec1,null))[_0x87b6('0xb6')](handleError(_0x25fec1,null));};exports[_0x87b6('0x2a')]=function(_0x48b520,_0x2b74a3){return db['FaxInteraction']['find']({'where':{'id':_0x48b520[_0x87b6('0xb8')]['id']}})[_0x87b6('0x2b')](handleEntityNotFound(_0x2b74a3,null))[_0x87b6('0x2b')](removeEntity(_0x2b74a3,null))['catch'](handleError(_0x2b74a3,null));};exports['describe']=function(_0x189451,_0x22584c){return db[_0x87b6('0x9f')][_0x87b6('0xbc')]()[_0x87b6('0x2b')](respondWithResult(_0x22584c,null))['catch'](handleError(_0x22584c,null));};exports[_0x87b6('0xbd')]=function(_0x52a050,_0x251319,_0x2bc833){return db['FaxMessage']['find']({'where':{'id':_0x52a050[_0x87b6('0xb8')]['id']}})[_0x87b6('0x2b')](handleEntityNotFound(_0x251319,null))[_0x87b6('0x2b')](function(_0x5709fb){if(_0x5709fb){return _0x5709fb[_0x87b6('0xbd')](_0x52a050[_0x87b6('0x76')][_0x87b6('0xbe')],_[_0x87b6('0xbf')](_0x52a050[_0x87b6('0x76')],[_0x87b6('0xbe'),'id'])||{});}})[_0x87b6('0x2b')](respondWithResult(_0x251319,null))[_0x87b6('0xb6')](handleError(_0x251319,null));};exports['getMessages']=function(_0xb478b5,_0x2356a0,_0x5d1da3){var _0x107f95={'raw':![],'where':{}};var _0x1174a9={};var _0xb4ff14={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x87b6('0xc0')]({'where':{'id':_0xb478b5['params']['id']}})[_0x87b6('0x2b')](handleEntityNotFound(_0x2356a0,null))[_0x87b6('0x2b')](function(_0x2e4f7c){if(_0x2e4f7c){_0x1174a9[_0x87b6('0x42')]=_[_0x87b6('0x44')](db['FaxMessage'][_0x87b6('0x40')]);_0x1174a9['query']=_[_0x87b6('0x44')](_0xb478b5[_0x87b6('0x43')]);_0x1174a9[_0x87b6('0x4d')]=_[_0x87b6('0x45')](_0x1174a9[_0x87b6('0x42')],_0x1174a9[_0x87b6('0x43')]);_0x107f95[_0x87b6('0x47')]=_['intersection'](_0x1174a9[_0x87b6('0x42')],qs[_0x87b6('0x46')](_0xb478b5[_0x87b6('0x43')][_0x87b6('0x46')]));_0x107f95['attributes']=_0x107f95[_0x87b6('0x47')][_0x87b6('0x48')]?_0x107f95[_0x87b6('0x47')]:_0x1174a9[_0x87b6('0x42')];if(!_0xb478b5['query'][_0x87b6('0x49')](_0x87b6('0x4a'))){_0x107f95[_0x87b6('0x24')]=qs[_0x87b6('0x24')](_0xb478b5['query'][_0x87b6('0x24')]);_0x107f95[_0x87b6('0x23')]=qs[_0x87b6('0x23')](_0xb478b5[_0x87b6('0x43')][_0x87b6('0x23')]);}_0x107f95[_0x87b6('0x4b')]=qs[_0x87b6('0xc1')](_0xb478b5['query'][_0x87b6('0xc1')]);_0x107f95[_0x87b6('0x4c')]=qs[_0x87b6('0x4d')](_[_0x87b6('0x4e')](_0xb478b5['query'],_0x1174a9[_0x87b6('0x4d')]));_0x107f95[_0x87b6('0x4c')][_0x87b6('0xb5')]=_0x2e4f7c['id'];if(_0xb478b5['query'][_0x87b6('0x85')]){_0x107f95[_0x87b6('0x4c')]=_['merge'](_0x107f95[_0x87b6('0x4c')],{'$or':_[_0x87b6('0x32')](_0x107f95[_0x87b6('0x47')],function(_0xe196b7){var _0x297429={};_0x297429[_0xe196b7]={'$like':'%'+_0xb478b5[_0x87b6('0x43')][_0x87b6('0x85')]+'%'};return _0x297429;})});}if(_0xb478b5[_0x87b6('0x43')][_0x87b6('0x7c')]){var _0x39265b=_0xb478b5[_0x87b6('0x43')][_0x87b6('0x7c')][_0x87b6('0x36')](',');var _0x466176={};_0x466176[_0x39265b[0x0]]={'$gte':moment(_0x39265b[0x1])['format'](_0x87b6('0xc2'))};_0x107f95[_0x87b6('0x4c')]=_[_0x87b6('0x9e')](_0x107f95[_0x87b6('0x4c')],_0x466176);}_0x107f95=_[_0x87b6('0x9e')]({},_0x107f95,_0xb478b5[_0x87b6('0xba')]);return db[_0x87b6('0xc3')][_0x87b6('0x26')]({'where':_0x107f95[_0x87b6('0x4c')]})[_0x87b6('0x2b')](function(_0x1fcb03){_0xb4ff14['count']=_0x1fcb03;if(_0xb478b5[_0x87b6('0x43')]['includeAll']){_0x107f95[_0x87b6('0xb9')]=[{'all':!![]}];}return db[_0x87b6('0xc3')][_0x87b6('0xc4')](_0x107f95);})[_0x87b6('0x2b')](function(_0x3219f6){_0xb4ff14['rows']=_0x3219f6;return _0xb4ff14;});}})[_0x87b6('0x2b')](respondWithFilteredResult(_0x2356a0,_0x107f95))['catch'](handleError(_0x2356a0,null));};exports['addTags']=function(_0x2183a6,_0x98dfd4,_0x4f7139){return db['FaxInteraction'][_0x87b6('0x6f')]({'where':{'id':_0x2183a6[_0x87b6('0xb8')]['id']}})[_0x87b6('0x2b')](handleEntityNotFound(_0x98dfd4,null))[_0x87b6('0x2b')](function(_0x1e65d1){if(_0x1e65d1){return _0x1e65d1[_0x87b6('0xc5')](_0x2183a6[_0x87b6('0x76')]['ids'],_['omit'](_0x2183a6[_0x87b6('0x76')],[_0x87b6('0xbe'),'id'])||{})[_0x87b6('0xc6')](function(){return db[_0x87b6('0x72')][_0x87b6('0xc4')]({'attributes':['id',_0x87b6('0x2f'),'color'],'where':{'id':_0x2183a6[_0x87b6('0x76')][_0x87b6('0xbe')]}});})[_0x87b6('0x2b')](function(_0x4683d4){socket[_0x87b6('0xc7')](_0x87b6('0xc8'),{'id':Number(_0x2183a6[_0x87b6('0xb8')]['id']),'tags':_0x4683d4||[]});return{'id':Number(_0x2183a6['params']['id']),'tags':_0x4683d4||[]};});}})['then'](respondWithResult(_0x98dfd4,null))[_0x87b6('0xb6')](handleError(_0x98dfd4,null));};exports[_0x87b6('0xc9')]=function(_0x2eb8da,_0x2279b8,_0x1279fe){return db[_0x87b6('0x9f')][_0x87b6('0x6f')]({'where':{'id':_0x2eb8da[_0x87b6('0xb8')]['id']}})['then'](handleEntityNotFound(_0x2279b8,null))[_0x87b6('0x2b')](function(_0x3566b4){if(_0x3566b4){return _0x3566b4['removeTags'](_0x2eb8da['query'][_0x87b6('0xbe')]);}})[_0x87b6('0x2b')](respondWithStatusCode(_0x2279b8,null))['catch'](handleError(_0x2279b8,null));};exports[_0x87b6('0xca')]=function(_0x8025a8,_0x8d3a){var _0x4faab1=moment()[_0x87b6('0xcb')]()[_0x87b6('0xb2')]();var _0x4e7358=path[_0x87b6('0xcc')](config[_0x87b6('0xcd')],'server',_0x87b6('0xce'),_0x87b6('0xcf'));var _0xbab66c=path[_0x87b6('0xcc')](config[_0x87b6('0xcd')],_0x87b6('0xd0'),_0x87b6('0xce'),_0x87b6('0xd1'));var _0x537e1f=path[_0x87b6('0xcc')](_0x4e7358,_0x4faab1);var _0x5c3b85=util[_0x87b6('0xd2')](_0x87b6('0xd3'),_0x8025a8[_0x87b6('0xb8')]['id'],_0x4faab1);var _0x16de92=path['join'](_0x4e7358,_0x5c3b85);var _0x2b360f=[];_0x2b360f['push']({'model':db[_0x87b6('0xd4')],'as':'Attachment','raw':!![]});var _0x395728=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x87b6('0x76'),_0x87b6('0x7a')],'include':_0x2b360f}];return db[_0x87b6('0x9f')][_0x87b6('0x6f')]({'where':{'id':_0x8025a8[_0x87b6('0xb8')]['id']},'include':_0x395728})[_0x87b6('0x2b')](handleEntityNotFound(_0x8d3a,null))[_0x87b6('0x2b')](function(_0x25e414){if(_0x25e414&&_0x25e414[_0x87b6('0xd5')]){var _0x28367d=_0x25e414[_0x87b6('0xd6')]({'plain':!![]});fs['mkdirSync'](_0x537e1f);for(var _0x9f229b=0x0;_0x9f229b<_0x28367d[_0x87b6('0xd5')][_0x87b6('0x48')];_0x9f229b++){var _0x6c47a5=_0x28367d['Messages'][_0x9f229b]['Attachment'];if(_0x6c47a5){var _0x1a9219=path[_0x87b6('0xcc')](_0xbab66c,_0x6c47a5[_0x87b6('0xd7')]);if(fs[_0x87b6('0xd8')](_0x1a9219)){fs[_0x87b6('0xd9')](_0x1a9219)[_0x87b6('0xda')](fs['createWriteStream'](path[_0x87b6('0xcc')](_0x537e1f,_0x6c47a5[_0x87b6('0xd7')])));}}}return BPromise[_0x87b6('0x93')]()['then'](function(){return new BPromise(function(_0xec3488,_0xb8faed){zipdir(_0x537e1f,{'saveTo':_0x16de92},function(_0x3ce41b,_0x33d438){if(_0x3ce41b)return _0xb8faed(_0x3ce41b);return _0xec3488(_0x33d438);});})[_0x87b6('0x2b')](function(){return new BPromise(function(_0x1c8b1f,_0x57db6a){rimraf(_0x537e1f,function(_0x578e37){if(_0x578e37)_0x57db6a(_0x578e37);return _0x1c8b1f();});});})['then'](function(){return _0x8d3a[_0x87b6('0xca')](_0x16de92,_0x5c3b85,function(_0x19c19b){if(_0x19c19b){console[_0x87b6('0xdb')](_0x87b6('0xdc'),_0x19c19b);}else{fs[_0x87b6('0xdd')](_0x16de92);}});});});}else{return _0x8d3a[_0x87b6('0x2c')](0xc8);}})[_0x87b6('0xb6')](handleError(_0x8d3a,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index d4e03ce..2944318 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 _0x4f30=['events','../../mysqldb','FaxMessage','setMaxListeners','save','update','getUsers','then','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports'];(function(_0x115d5b,_0x26aff2){var _0x6cfc50=function(_0x39a786){while(--_0x39a786){_0x115d5b['push'](_0x115d5b['shift']());}};_0x6cfc50(++_0x26aff2);}(_0x4f30,0x1a9));var _0x04f3=function(_0x371761,_0x17b9e1){_0x371761=_0x371761-0x0;var _0x2694f5=_0x4f30[_0x371761];return _0x2694f5;};'use strict';var EventEmitter=require(_0x04f3('0x0'));var FaxInteraction=require(_0x04f3('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x04f3('0x1'))['db'][_0x04f3('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x04f3('0x3')](0x0);var events={'afterCreate':_0x04f3('0x4'),'afterUpdate':_0x04f3('0x5'),'afterDestroy':'remove'};function emitEvent(_0xb6d5dd){return function(_0x1da659,_0x3b84e3,_0x1cb94e){_0x1da659[_0x04f3('0x6')]({'attributes':['id'],'raw':!![]})[_0x04f3('0x7')](function(_0x14df42){_0x1da659['setDataValue'](_0x04f3('0x8'),_0x14df42[_0x04f3('0x9')](function(_0x4bb516){return{'id':_0x4bb516['id']};}));return FaxMessage[_0x04f3('0xa')]({'where':{'FaxInteractionId':_0x1da659['id'],'direction':'in','read':![]},'raw':!![]});})[_0x04f3('0x7')](function(_0x98fd21){_0x1da659['setDataValue'](_0x04f3('0xb'),_0x98fd21[_0x04f3('0xc')]);FaxInteractionEvents[_0x04f3('0xd')](_0xb6d5dd+':'+_0x1da659['id'],_0x1da659);FaxInteractionEvents['emit'](_0xb6d5dd,_0x1da659);_0x1cb94e(null);})[_0x04f3('0xe')](_0x1cb94e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x04f3('0xf')](e,emitEvent(event));}}module[_0x04f3('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x7802=['map','findAll','then','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users'];(function(_0xa0cd36,_0x416619){var _0x21f839=function(_0x238d7b){while(--_0x238d7b){_0xa0cd36['push'](_0xa0cd36['shift']());}};_0x21f839(++_0x416619);}(_0x7802,0xbd));var _0x2780=function(_0x320da1,_0x31e289){_0x320da1=_0x320da1-0x0;var _0x1a9db5=_0x7802[_0x320da1];return _0x1a9db5;};'use strict';var EventEmitter=require(_0x2780('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x2780('0x1')];var FaxMessage=require(_0x2780('0x2'))['db'][_0x2780('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x2780('0x4')](0x0);var events={'afterCreate':_0x2780('0x5'),'afterUpdate':_0x2780('0x6'),'afterDestroy':_0x2780('0x7')};function emitEvent(_0x3083f8){return function(_0x779af0,_0x5d1be1,_0xe1b8ce){_0x779af0[_0x2780('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0xef7a20){_0x779af0[_0x2780('0x9')](_0x2780('0xa'),_0xef7a20[_0x2780('0xb')](function(_0x2a957d){return{'id':_0x2a957d['id']};}));return FaxMessage[_0x2780('0xc')]({'where':{'FaxInteractionId':_0x779af0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2780('0xd')](function(_0x25e7c6){_0x779af0[_0x2780('0x9')](_0x2780('0xe'),_0x25e7c6['length']);FaxInteractionEvents['emit'](_0x3083f8+':'+_0x779af0['id'],_0x779af0);FaxInteractionEvents[_0x2780('0xf')](_0x3083f8,_0x779af0);_0xe1b8ce(null);})[_0x2780('0x10')](_0xe1b8ce(null));};}for(var e in events){if(events[_0x2780('0x11')](e)){var event=events[e];FaxInteraction[_0x2780('0x12')](e,emitEvent(event));}}module[_0x2780('0x13')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 8ce76ca..7e294c0 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 _0x046b=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5092bf,_0x4235b5){var _0x81cf4a=function(_0x58e674){while(--_0x58e674){_0x5092bf['push'](_0x5092bf['shift']());}};_0x81cf4a(++_0x4235b5);}(_0x046b,0x1ba));var _0xb046=function(_0x2a8971,_0x38e53f){_0x2a8971=_0x2a8971-0x0;var _0x16911f=_0x046b[_0x2a8971];return _0x16911f;};'use strict';var _=require(_0xb046('0x0'));var util=require(_0xb046('0x1'));var logger=require(_0xb046('0x2'))(_0xb046('0x3'));var moment=require('moment');var BPromise=require(_0xb046('0x4'));var rp=require(_0xb046('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb046('0x6'));var config=require(_0xb046('0x7'));var attributes=require(_0xb046('0x8'));module[_0xb046('0x9')]=function(_0x1d5f2d,_0x24250e){return _0x1d5f2d[_0xb046('0xa')](_0xb046('0xb'),attributes,{'tableName':_0xb046('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x231f85,_0x32aa04,_0x48f38d){if(_0x231f85[_0xb046('0xd')]('closed')){_0x231f85[_0xb046('0xe')]=moment()[_0xb046('0xf')](_0xb046('0x10'));}_0x48f38d(null,_0x231f85);}}});}; \ No newline at end of file +var _0x268c=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','changed'];(function(_0x2b0e66,_0xe4d534){var _0x136c05=function(_0x5b3b7b){while(--_0x5b3b7b){_0x2b0e66['push'](_0x2b0e66['shift']());}};_0x136c05(++_0xe4d534);}(_0x268c,0x1e0));var _0xc268=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x268c[_0x2a55f8];return _0x245efd;};'use strict';var _=require(_0xc268('0x0'));var util=require(_0xc268('0x1'));var logger=require(_0xc268('0x2'))(_0xc268('0x3'));var moment=require(_0xc268('0x4'));var BPromise=require(_0xc268('0x5'));var rp=require(_0xc268('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc268('0x7'));var attributes=require(_0xc268('0x8'));module[_0xc268('0x9')]=function(_0x7877a8,_0x1ee80e){return _0x7877a8['define'](_0xc268('0xa'),attributes,{'tableName':_0xc268('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15a832,_0x30e2aa,_0x269ddc){if(_0x15a832[_0xc268('0xc')](_0xc268('0xd'))){_0x15a832[_0xc268('0xe')]=moment()[_0xc268('0xf')](_0xc268('0x10'));}_0x269ddc(null,_0x15a832);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 5fbff42..46c8258 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 _0xb67e=['message','result','catch','update','body','options','raw','where','attributes','limit','UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x10f701,_0x5f359e){var _0x1652cf=function(_0x26772b){while(--_0x26772b){_0x10f701['push'](_0x10f701['shift']());}};_0x1652cf(++_0x5f359e);}(_0xb67e,0x1a8));var _0xeb67=function(_0x5aac4e,_0x239dc8){_0x5aac4e=_0x5aac4e-0x0;var _0x431e86=_0xb67e[_0x5aac4e];return _0x431e86;};'use strict';var _=require(_0xeb67('0x0'));var util=require(_0xeb67('0x1'));var moment=require(_0xeb67('0x2'));var BPromise=require(_0xeb67('0x3'));var rs=require(_0xeb67('0x4'));var fs=require('fs');var Redis=require(_0xeb67('0x5'));var db=require(_0xeb67('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb67('0x7'))('rpc');var config=require(_0xeb67('0x8'));var jayson=require(_0xeb67('0x9'));var client=jayson[_0xeb67('0xa')][_0xeb67('0xb')]({'port':0x232a});config[_0xeb67('0xc')]=_[_0xeb67('0xd')](config[_0xeb67('0xc')],{'host':_0xeb67('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb67('0xc')]));require(_0xeb67('0xf'))[_0xeb67('0x10')](socket);function respondWithRpcPromise(_0x3e6970,_0x1982cc,_0x58a910){return new BPromise(function(_0x25030b,_0xf23a43){return client[_0xeb67('0x11')](_0x3e6970,_0x58a910)[_0xeb67('0x12')](function(_0x2fa7d2){logger[_0xeb67('0x13')](_0xeb67('0x14'),_0x1982cc,_0xeb67('0x15'));logger[_0xeb67('0x16')](_0xeb67('0x17'),_0x1982cc,_0xeb67('0x15'),JSON['stringify'](_0x2fa7d2));if(_0x2fa7d2['error']){if(_0x2fa7d2['error'][_0xeb67('0x18')]===0x1f4){logger[_0xeb67('0x19')](_0xeb67('0x14'),_0x1982cc,_0x2fa7d2[_0xeb67('0x19')][_0xeb67('0x1a')]);return _0xf23a43(_0x2fa7d2[_0xeb67('0x19')][_0xeb67('0x1a')]);}logger[_0xeb67('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x1982cc,_0x2fa7d2[_0xeb67('0x19')][_0xeb67('0x1a')]);return _0x25030b(_0x2fa7d2['error'][_0xeb67('0x1a')]);}else{logger[_0xeb67('0x13')](_0xeb67('0x14'),_0x1982cc,_0xeb67('0x15'));_0x25030b(_0x2fa7d2[_0xeb67('0x1b')][_0xeb67('0x1a')]);}})[_0xeb67('0x1c')](function(_0x2abd80){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x1982cc,_0x2abd80);_0xf23a43(_0x2abd80);});});}exports['UpdateFaxInteraction']=function(_0x200df0){var _0x2b3d9d=this;return new Promise(function(_0x4229ef,_0x2eb3a5){return db['FaxInteraction'][_0xeb67('0x1d')](_0x200df0[_0xeb67('0x1e')],{'raw':_0x200df0[_0xeb67('0x1f')]?_0x200df0[_0xeb67('0x1f')][_0xeb67('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200df0[_0xeb67('0x1f')]?_0x200df0['options'][_0xeb67('0x21')]||null:null,'attributes':_0x200df0[_0xeb67('0x1f')]?_0x200df0[_0xeb67('0x1f')][_0xeb67('0x22')]||null:null,'limit':_0x200df0[_0xeb67('0x1f')]?_0x200df0[_0xeb67('0x1f')][_0xeb67('0x23')]||null:null})['then'](function(_0x563a7b){logger[_0xeb67('0x13')](_0xeb67('0x24'),_0x200df0);logger['debug'](_0xeb67('0x24'),_0x200df0,JSON[_0xeb67('0x25')](_0x563a7b));_0x4229ef(_0x563a7b);})[_0xeb67('0x1c')](function(_0x3fd067){logger['error'](_0xeb67('0x24'),_0x3fd067[_0xeb67('0x1a')],_0x200df0);_0x2eb3a5(_0x2b3d9d[_0xeb67('0x19')](0x1f4,_0x3fd067[_0xeb67('0x1a')]));});});};exports[_0xeb67('0x26')]=function(_0x549b26){return new Promise(function(_0x40acf2,_0x37d237){return db['FaxInteraction'][_0xeb67('0x27')]({'where':_0x549b26['options']?_0x549b26[_0xeb67('0x1f')][_0xeb67('0x21')]||null:null})[_0xeb67('0x12')](function(_0x738746){if(_0x738746){return _0x738746[_0xeb67('0x28')](_0x549b26[_0xeb67('0x1e')]['ids'],_[_0xeb67('0x29')](_0x549b26['body'],[_0xeb67('0x2a'),'id'])||{});}})[_0xeb67('0x2b')](function(_0x10a1cb){logger['info']('AddTags',_0x549b26);logger[_0xeb67('0x16')]('AddTags',_0x549b26,JSON['stringify'](_0x10a1cb));_0x40acf2(_0x10a1cb);})['catch'](function(_0x19ccd7){logger[_0xeb67('0x19')](_0xeb67('0x2c'),_0x19ccd7[_0xeb67('0x1a')],_0x549b26);_0x37d237(_this['error'](0x1f4,_0x19ccd7[_0xeb67('0x1a')]));});});}; \ No newline at end of file +var _0x1cd7=['addTags','body','ids','omit','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','limit','debug','AddTagsToFaxInteraction','find'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0x1cd7,0x165));var _0x71cd=function(_0x1bba53,_0x498b0a){_0x1bba53=_0x1bba53-0x0;var _0x10ad9f=_0x1cd7[_0x1bba53];return _0x10ad9f;};'use strict';var _=require(_0x71cd('0x0'));var util=require('util');var moment=require(_0x71cd('0x1'));var BPromise=require('bluebird');var rs=require(_0x71cd('0x2'));var fs=require('fs');var Redis=require(_0x71cd('0x3'));var db=require(_0x71cd('0x4'))['db'];var utils=require(_0x71cd('0x5'));var logger=require(_0x71cd('0x6'))(_0x71cd('0x7'));var config=require(_0x71cd('0x8'));var jayson=require(_0x71cd('0x9'));var client=jayson[_0x71cd('0xa')][_0x71cd('0xb')]({'port':0x232a});config[_0x71cd('0xc')]=_[_0x71cd('0xd')](config[_0x71cd('0xc')],{'host':_0x71cd('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x71cd('0xc')]));require(_0x71cd('0xf'))[_0x71cd('0x10')](socket);function respondWithRpcPromise(_0x3b184b,_0x417e6d,_0x1f1159){return new BPromise(function(_0x5dddf8,_0xd38ecd){return client[_0x71cd('0x11')](_0x3b184b,_0x1f1159)[_0x71cd('0x12')](function(_0x46cff7){logger['info'](_0x71cd('0x13'),_0x417e6d,_0x71cd('0x14'));logger['debug'](_0x71cd('0x15'),_0x417e6d,'request\x20sent',JSON[_0x71cd('0x16')](_0x46cff7));if(_0x46cff7[_0x71cd('0x17')]){if(_0x46cff7[_0x71cd('0x17')][_0x71cd('0x18')]===0x1f4){logger[_0x71cd('0x17')](_0x71cd('0x13'),_0x417e6d,_0x46cff7[_0x71cd('0x17')][_0x71cd('0x19')]);return _0xd38ecd(_0x46cff7['error']['message']);}logger['error'](_0x71cd('0x13'),_0x417e6d,_0x46cff7[_0x71cd('0x17')][_0x71cd('0x19')]);return _0x5dddf8(_0x46cff7['error']['message']);}else{logger[_0x71cd('0x1a')]('FaxInteraction,\x20%s,\x20%s',_0x417e6d,_0x71cd('0x14'));_0x5dddf8(_0x46cff7[_0x71cd('0x1b')]['message']);}})[_0x71cd('0x1c')](function(_0x2d61eb){logger[_0x71cd('0x17')](_0x71cd('0x13'),_0x417e6d,_0x2d61eb);_0xd38ecd(_0x2d61eb);});});}exports[_0x71cd('0x1d')]=function(_0xb4a059){var _0x3ebf23=this;return new Promise(function(_0x41d8a7,_0x196589){return db[_0x71cd('0x1e')][_0x71cd('0x1f')](_0xb4a059['body'],{'raw':_0xb4a059[_0x71cd('0x20')]?_0xb4a059[_0x71cd('0x20')][_0x71cd('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb4a059['options']?_0xb4a059[_0x71cd('0x20')][_0x71cd('0x22')]||null:null,'attributes':_0xb4a059['options']?_0xb4a059[_0x71cd('0x20')]['attributes']||null:null,'limit':_0xb4a059[_0x71cd('0x20')]?_0xb4a059['options'][_0x71cd('0x23')]||null:null})[_0x71cd('0x12')](function(_0x840d52){logger[_0x71cd('0x1a')](_0x71cd('0x1d'),_0xb4a059);logger[_0x71cd('0x24')](_0x71cd('0x1d'),_0xb4a059,JSON[_0x71cd('0x16')](_0x840d52));_0x41d8a7(_0x840d52);})[_0x71cd('0x1c')](function(_0x4fcd18){logger['error']('UpdateFaxInteraction',_0x4fcd18[_0x71cd('0x19')],_0xb4a059);_0x196589(_0x3ebf23[_0x71cd('0x17')](0x1f4,_0x4fcd18['message']));});});};exports[_0x71cd('0x25')]=function(_0x140e55){return new Promise(function(_0x2a3f30,_0x5e70b8){return db[_0x71cd('0x1e')][_0x71cd('0x26')]({'where':_0x140e55['options']?_0x140e55[_0x71cd('0x20')][_0x71cd('0x22')]||null:null})['then'](function(_0x139dde){if(_0x139dde){return _0x139dde[_0x71cd('0x27')](_0x140e55[_0x71cd('0x28')][_0x71cd('0x29')],_[_0x71cd('0x2a')](_0x140e55[_0x71cd('0x28')],[_0x71cd('0x29'),'id'])||{});}})['spread'](function(_0x2a640b){logger[_0x71cd('0x1a')](_0x71cd('0x2b'),_0x140e55);logger[_0x71cd('0x24')](_0x71cd('0x2b'),_0x140e55,JSON[_0x71cd('0x16')](_0x2a640b));_0x2a3f30(_0x2a640b);})[_0x71cd('0x1c')](function(_0x240eb9){logger[_0x71cd('0x17')]('AddTags',_0x240eb9[_0x71cd('0x19')],_0x140e55);_0x5e70b8(_this[_0x71cd('0x17')](0x1f4,_0x240eb9[_0x71cd('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index f19b8ec..ebdfb30 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 _0xab5e=['removeListener','register','length','faxInteraction:','save','remove','emit'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xab5e,0xcf));var _0xeab5=function(_0x1d0b12,_0x217738){_0x1d0b12=_0x1d0b12-0x0;var _0x272875=_0xab5e[_0x1d0b12];return _0x272875;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xeab5('0x0'),_0xeab5('0x1'),'update'];function createListener(_0x4567b6,_0x1b021b){return function(_0x21f5a2){_0x1b021b[_0xeab5('0x2')](_0x4567b6,_0x21f5a2);};}function removeListener(_0x2d7048,_0x713b45){return function(){FaxInteractionEvents[_0xeab5('0x3')](_0x2d7048,_0x713b45);};}exports[_0xeab5('0x4')]=function(_0x3edf2b){for(var _0x1348b8=0x0,_0x5d5f36=events[_0xeab5('0x5')];_0x1348b8<_0x5d5f36;_0x1348b8++){var _0x1ea34f=events[_0x1348b8];var _0x1559d9=createListener(_0xeab5('0x6')+_0x1ea34f,_0x3edf2b);FaxInteractionEvents['on'](_0x1ea34f,_0x1559d9);}}; \ No newline at end of file +var _0x1211=['emit','removeListener','register','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x1c5fd2,_0xf4e539){var _0x2df5fc=function(_0x3fe9a5){while(--_0x3fe9a5){_0x1c5fd2['push'](_0x1c5fd2['shift']());}};_0x2df5fc(++_0xf4e539);}(_0x1211,0x17e));var _0x1121=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1211[_0x20a584];return _0x4b41a8;};'use strict';var FaxInteractionEvents=require(_0x1121('0x0'));var events=[_0x1121('0x1'),_0x1121('0x2'),'update'];function createListener(_0xc38722,_0x234adc){return function(_0x448857){_0x234adc[_0x1121('0x3')](_0xc38722,_0x448857);};}function removeListener(_0x4eb9a7,_0x239e80){return function(){FaxInteractionEvents[_0x1121('0x4')](_0x4eb9a7,_0x239e80);};}exports[_0x1121('0x5')]=function(_0x31f52d){for(var _0x4a1a92=0x0,_0x326c08=events['length'];_0x4a1a92<_0x326c08;_0x4a1a92++){var _0x26c110=events[_0x4a1a92];var _0x5e8c57=createListener(_0x1121('0x6')+_0x26c110,_0x31f52d);FaxInteractionEvents['on'](_0x26c110,_0x5e8c57);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 234257d..0b74c3c 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 _0x764d=['faxinteraction:addtags','addTags','put','/:id','fax','faxinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','/describe','isAuthenticated','describe','show','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x393108,_0x486bf3){var _0x1b45dc=function(_0x114432){while(--_0x114432){_0x393108['push'](_0x393108['shift']());}};_0x1b45dc(++_0x486bf3);}(_0x764d,0xeb));var _0xd764=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0x764d[_0xbc4560];return _0x298cfb;};'use strict';var multer=require(_0xd764('0x0'));var util=require(_0xd764('0x1'));var path=require(_0xd764('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd764('0x3')]();var fs_extra=require(_0xd764('0x4'));var auth=require(_0xd764('0x5'));var interaction=require(_0xd764('0x6'));var config=require(_0xd764('0x7'));var controller=require(_0xd764('0x8'));router[_0xd764('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd764('0x9')](_0xd764('0xa'),auth[_0xd764('0xb')](),controller[_0xd764('0xc')]);router[_0xd764('0x9')]('/:id',auth[_0xd764('0xb')](),controller[_0xd764('0xd')]);router[_0xd764('0x9')]('/:id/messages',auth[_0xd764('0xb')](),controller['getMessages']);router[_0xd764('0x9')](_0xd764('0xe'),auth['isAuthenticated'](),controller[_0xd764('0xf')]);router[_0xd764('0x10')]('/',auth[_0xd764('0xb')](),controller[_0xd764('0x11')]);router['post']('/:id/messages',auth[_0xd764('0xb')](),controller[_0xd764('0x12')]);router[_0xd764('0x10')](_0xd764('0x13'),auth[_0xd764('0xb')](),interaction[_0xd764('0x14')]('fax',_0xd764('0x15')),controller[_0xd764('0x16')]);router[_0xd764('0x17')](_0xd764('0x18'),auth['isAuthenticated'](),interaction[_0xd764('0x14')](_0xd764('0x19'),_0xd764('0x1a')),controller[_0xd764('0x1b')]);router[_0xd764('0x1c')](_0xd764('0x18'),auth['isAuthenticated'](),interaction[_0xd764('0x14')](_0xd764('0x19'),'faxinteraction:destroy'),controller[_0xd764('0x1d')]);router[_0xd764('0x1c')](_0xd764('0x13'),auth['isAuthenticated'](),controller[_0xd764('0x1e')]);module[_0xd764('0x1f')]=router; \ No newline at end of file +var _0xd1a5=['index','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','fax','faxinteraction:addtags','addTags','put','update','delete','faxinteraction:destroy','/:id/tags','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x540da2,_0x59e721){var _0x55160a=function(_0xd23675){while(--_0xd23675){_0x540da2['push'](_0x540da2['shift']());}};_0x55160a(++_0x59e721);}(_0xd1a5,0x162));var _0x5d1a=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xd1a5[_0x1b6186];return _0x186121;};'use strict';var multer=require('multer');var util=require(_0x5d1a('0x0'));var path=require(_0x5d1a('0x1'));var timeout=require(_0x5d1a('0x2'));var express=require(_0x5d1a('0x3'));var router=express[_0x5d1a('0x4')]();var fs_extra=require(_0x5d1a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5d1a('0x6'));var config=require(_0x5d1a('0x7'));var controller=require('./faxInteraction.controller');router[_0x5d1a('0x8')]('/',auth['isAuthenticated'](),controller[_0x5d1a('0x9')]);router[_0x5d1a('0x8')](_0x5d1a('0xa'),auth['isAuthenticated'](),controller[_0x5d1a('0xb')]);router[_0x5d1a('0x8')](_0x5d1a('0xc'),auth[_0x5d1a('0xd')](),controller[_0x5d1a('0xe')]);router[_0x5d1a('0x8')](_0x5d1a('0xf'),auth[_0x5d1a('0xd')](),controller[_0x5d1a('0x10')]);router[_0x5d1a('0x8')](_0x5d1a('0x11'),auth[_0x5d1a('0xd')](),controller[_0x5d1a('0x12')]);router[_0x5d1a('0x13')]('/',auth[_0x5d1a('0xd')](),controller[_0x5d1a('0x14')]);router['post']('/:id/messages',auth[_0x5d1a('0xd')](),controller[_0x5d1a('0x15')]);router[_0x5d1a('0x13')]('/:id/tags',auth[_0x5d1a('0xd')](),interaction[_0x5d1a('0x16')](_0x5d1a('0x17'),_0x5d1a('0x18')),controller[_0x5d1a('0x19')]);router[_0x5d1a('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x5d1a('0x16')](_0x5d1a('0x17'),'faxinteraction:update'),controller[_0x5d1a('0x1b')]);router[_0x5d1a('0x1c')](_0x5d1a('0xc'),auth[_0x5d1a('0xd')](),interaction[_0x5d1a('0x16')](_0x5d1a('0x17'),_0x5d1a('0x1d')),controller['destroy']);router[_0x5d1a('0x1c')](_0x5d1a('0x1e'),auth[_0x5d1a('0xd')](),controller[_0x5d1a('0x1f')]);module[_0x5d1a('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 6a8e2f5..be93a66 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 _0x9221=['BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x24b645,_0x3c0c44){var _0x270057=function(_0x540900){while(--_0x540900){_0x24b645['push'](_0x24b645['shift']());}};_0x270057(++_0x3c0c44);}(_0x9221,0x64));var _0x1922=function(_0x56f6c0,_0x37c097){_0x56f6c0=_0x56f6c0-0x0;var _0x249342=_0x9221[_0x56f6c0];return _0x249342;};'use strict';var Sequelize=require('sequelize');module[_0x1922('0x0')]={'body':{'type':Sequelize[_0x1922('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1922('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1922('0x3')]('in','out'),'defaultValue':_0x1922('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x1922('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1922('0x5')]}}; \ No newline at end of file +var _0x6e16=['BOOLEAN','out','DATE','TEXT'];(function(_0x1762fd,_0x3774d1){var _0x1a1329=function(_0x142d7f){while(--_0x142d7f){_0x1762fd['push'](_0x1762fd['shift']());}};_0x1a1329(++_0x3774d1);}(_0x6e16,0x1d3));var _0x66e1=function(_0x1c1d35,_0x37e108){_0x1c1d35=_0x1c1d35-0x0;var _0x48d4cc=_0x6e16[_0x1c1d35];return _0x48d4cc;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x66e1('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x66e1('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x66e1('0x2')),'defaultValue':_0x66e1('0x2'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x66e1('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index a56c3d3..062bbd8 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 _0xea05=['desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','sendStatus','stack','name','map','FaxMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','find','update','body','destroy','describe','fax-interactions','accept','read','readAt','UserId','user','get','FaxInteraction','FaxInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','SELECT','CmContact','findOne','isNil','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','files','attachments','fast-json-patch','request-promise','moment','util','squel','crypto'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xea05,0x102));var _0x5ea0=function(_0x1a10ef,_0x207697){_0x1a10ef=_0x1a10ef-0x0;var _0x30f444=_0xea05[_0x1a10ef];return _0x30f444;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5ea0('0x0'));var rp=require(_0x5ea0('0x1'));var moment=require(_0x5ea0('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5ea0('0x3'));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('lodash');var squel=require(_0x5ea0('0x4'));var crypto=require(_0x5ea0('0x5'));var jsforce=require('jsforce');var deskjs=require(_0x5ea0('0x6'));var toCsv=require('to-csv');var querystring=require(_0x5ea0('0x7'));var Papa=require('papaparse');var Redis=require(_0x5ea0('0x8'));var authService=require('../../components/auth/service');var qs=require(_0x5ea0('0x9'));var as=require(_0x5ea0('0xa'));var hardwareService=require(_0x5ea0('0xb'));var logger=require(_0x5ea0('0xc'))(_0x5ea0('0xd'));var utils=require(_0x5ea0('0xe'));var config=require('../../config/environment');var licenseUtil=require(_0x5ea0('0xf'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5ea0('0x10')](config[_0x5ea0('0x11')],{'host':_0x5ea0('0x12'),'port':0x18eb});var socket=require(_0x5ea0('0x13'))(new Redis(config['redis']));require(_0x5ea0('0x14'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5ea0('0x15')][_0x5ea0('0x16')]({'port':0x232c});var client9002=jayson['client'][_0x5ea0('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x5dee3f,_0x4427dd,_0x22987a,_0x35fcd8){return new BPromise(function(_0x17973d,_0x499a0b){var _0x2269f9=_0x35fcd8||client;return _0x2269f9[_0x5ea0('0x17')](_0x5dee3f,_0x22987a)[_0x5ea0('0x18')](function(_0x5e9302){logger[_0x5ea0('0x19')](_0x5ea0('0x1a'),_0x4427dd,_0x5ea0('0x1b'));logger[_0x5ea0('0x1c')](_0x5ea0('0x1d'),_0x4427dd,_0x5ea0('0x1b'),JSON[_0x5ea0('0x1e')](_0x5e9302));if(_0x5e9302['error']){if(_0x5e9302[_0x5ea0('0x1f')]['code']===0x1f4){logger[_0x5ea0('0x1f')](_0x5ea0('0x1a'),_0x4427dd,_0x5e9302[_0x5ea0('0x1f')][_0x5ea0('0x20')]);return _0x499a0b(_0x5e9302[_0x5ea0('0x1f')][_0x5ea0('0x20')]);}logger[_0x5ea0('0x1f')](_0x5ea0('0x1a'),_0x4427dd,_0x5e9302[_0x5ea0('0x1f')]['message']);return _0x17973d(_0x5e9302[_0x5ea0('0x1f')][_0x5ea0('0x20')]);}else{logger[_0x5ea0('0x19')](_0x5ea0('0x1a'),_0x4427dd,_0x5ea0('0x1b'));_0x17973d(_0x5e9302[_0x5ea0('0x21')][_0x5ea0('0x20')]);}})[_0x5ea0('0x22')](function(_0x51d10e){logger['error'](_0x5ea0('0x1a'),_0x4427dd,_0x51d10e);_0x499a0b(_0x51d10e);});});}function respondWithStatusCode(_0x3536da,_0x330aea){_0x330aea=_0x330aea||0xcc;return function(_0x73a8b){if(_0x73a8b){return _0x3536da['sendStatus'](_0x330aea);}return _0x3536da['status'](_0x330aea)[_0x5ea0('0x23')]();};}function respondWithResult(_0x441727,_0xd30ce1){_0xd30ce1=_0xd30ce1||0xc8;return function(_0x12b878){if(_0x12b878){return _0x441727[_0x5ea0('0x24')](_0xd30ce1)[_0x5ea0('0x25')](_0x12b878);}};}function respondWithFilteredResult(_0x12dbaf,_0x25d7c8){return function(_0x191af4){if(_0x191af4){var _0x54761a=typeof _0x25d7c8[_0x5ea0('0x26')]===_0x5ea0('0x27')&&typeof _0x25d7c8[_0x5ea0('0x28')]===_0x5ea0('0x27');var _0x16a425=_0x191af4['count'];var _0x47f3f1=_0x54761a?0x0:_0x25d7c8['offset'];var _0x1d28c3=_0x54761a?_0x191af4['count']:_0x25d7c8['offset']+_0x25d7c8[_0x5ea0('0x28')];var _0x24e3e4;if(_0x1d28c3>=_0x16a425){_0x1d28c3=_0x16a425;_0x24e3e4=0xc8;}else{_0x24e3e4=0xce;}_0x12dbaf[_0x5ea0('0x24')](_0x24e3e4);return _0x12dbaf[_0x5ea0('0x29')](_0x5ea0('0x2a'),_0x47f3f1+'-'+_0x1d28c3+'/'+_0x16a425)[_0x5ea0('0x25')](_0x191af4);}return null;};}function patchUpdates(_0x327937){return function(_0x2add5e){try{jsonpatch[_0x5ea0('0x2b')](_0x2add5e,_0x327937,!![]);}catch(_0x1b1148){return BPromise[_0x5ea0('0x2c')](_0x1b1148);}return _0x2add5e['save']();};}function saveUpdates(_0x31204c,_0x112ed4){return function(_0x4bc0e){if(_0x4bc0e){return _0x4bc0e['update'](_0x31204c)[_0x5ea0('0x18')](function(_0x165f2c){return _0x165f2c;});}return null;};}function removeEntity(_0x43a3f9,_0x273b6c){return function(_0x7477c7){if(_0x7477c7){return _0x7477c7['destroy']()[_0x5ea0('0x18')](function(){_0x43a3f9[_0x5ea0('0x24')](0xcc)[_0x5ea0('0x23')]();});}};}function handleEntityNotFound(_0xa2dda8,_0x3eaf86){return function(_0x37fa9c){if(!_0x37fa9c){_0xa2dda8[_0x5ea0('0x2d')](0x194);}return _0x37fa9c;};}function handleError(_0x58f02d,_0xed346d){_0xed346d=_0xed346d||0x1f4;return function(_0x29f531){logger[_0x5ea0('0x1f')](_0x29f531[_0x5ea0('0x2e')]);if(_0x29f531['name']){delete _0x29f531[_0x5ea0('0x2f')];}_0x58f02d[_0x5ea0('0x24')](_0xed346d)['send'](_0x29f531);};}exports['index']=function(_0x574f73,_0xbba234){var _0x17b5c5={},_0x4cc98c={},_0x5fe3b0={'count':0x0,'rows':[]};var _0x613c80=_[_0x5ea0('0x30')](db[_0x5ea0('0x31')][_0x5ea0('0x32')],function(_0x22275b){return{'name':_0x22275b['fieldName'],'type':_0x22275b[_0x5ea0('0x33')]['key']};});_0x4cc98c[_0x5ea0('0x34')]=_[_0x5ea0('0x30')](_0x613c80,_0x5ea0('0x2f'));_0x4cc98c[_0x5ea0('0x35')]=_[_0x5ea0('0x36')](_0x574f73['query']);_0x4cc98c[_0x5ea0('0x37')]=_[_0x5ea0('0x38')](_0x4cc98c[_0x5ea0('0x34')],_0x4cc98c['query']);_0x17b5c5[_0x5ea0('0x39')]=_['intersection'](_0x4cc98c[_0x5ea0('0x34')],qs['fields'](_0x574f73[_0x5ea0('0x35')][_0x5ea0('0x3a')]));_0x17b5c5[_0x5ea0('0x39')]=_0x17b5c5[_0x5ea0('0x39')][_0x5ea0('0x3b')]?_0x17b5c5[_0x5ea0('0x39')]:_0x4cc98c[_0x5ea0('0x34')];if(!_0x574f73[_0x5ea0('0x35')][_0x5ea0('0x3c')](_0x5ea0('0x3d'))){_0x17b5c5[_0x5ea0('0x28')]=qs[_0x5ea0('0x28')](_0x574f73[_0x5ea0('0x35')][_0x5ea0('0x28')]);_0x17b5c5[_0x5ea0('0x26')]=qs['offset'](_0x574f73[_0x5ea0('0x35')][_0x5ea0('0x26')]);}_0x17b5c5[_0x5ea0('0x3e')]=qs[_0x5ea0('0x3f')](_0x574f73[_0x5ea0('0x35')]['sort']);_0x17b5c5['where']=qs[_0x5ea0('0x37')](_['pick'](_0x574f73['query'],_0x4cc98c['filters']),_0x613c80);if(_0x574f73[_0x5ea0('0x35')][_0x5ea0('0x40')]){_0x17b5c5[_0x5ea0('0x41')]=_[_0x5ea0('0x42')](_0x17b5c5[_0x5ea0('0x41')],{'$or':_[_0x5ea0('0x30')](_0x613c80,function(_0x6fa18c){if(_0x6fa18c[_0x5ea0('0x33')]!==_0x5ea0('0x43')){var _0x50e9f8={};_0x50e9f8[_0x6fa18c[_0x5ea0('0x2f')]]={'$like':'%'+_0x574f73[_0x5ea0('0x35')][_0x5ea0('0x40')]+'%'};return _0x50e9f8;}})});}_0x17b5c5=_[_0x5ea0('0x42')]({},_0x17b5c5,_0x574f73[_0x5ea0('0x44')]);var _0x8fe6b2={'where':_0x17b5c5[_0x5ea0('0x41')]};return db['FaxMessage']['count'](_0x8fe6b2)[_0x5ea0('0x18')](function(_0x333d57){_0x5fe3b0[_0x5ea0('0x45')]=_0x333d57;if(_0x574f73[_0x5ea0('0x35')][_0x5ea0('0x46')]){_0x17b5c5[_0x5ea0('0x47')]=[{'all':!![]}];}return db[_0x5ea0('0x31')]['findAll'](_0x17b5c5);})['then'](function(_0x4aafc4){_0x5fe3b0[_0x5ea0('0x48')]=_0x4aafc4;return _0x5fe3b0;})[_0x5ea0('0x18')](respondWithFilteredResult(_0xbba234,_0x17b5c5))['catch'](handleError(_0xbba234,null));};exports[_0x5ea0('0x49')]=function(_0xa0610e,_0x4e4c0a){var _0x310e45={'raw':!![],'where':{'id':_0xa0610e[_0x5ea0('0x4a')]['id']}},_0x366119={};_0x366119[_0x5ea0('0x34')]=_[_0x5ea0('0x36')](db[_0x5ea0('0x31')][_0x5ea0('0x32')]);_0x366119[_0x5ea0('0x35')]=_[_0x5ea0('0x36')](_0xa0610e[_0x5ea0('0x35')]);_0x366119[_0x5ea0('0x37')]=_[_0x5ea0('0x38')](_0x366119[_0x5ea0('0x34')],_0x366119[_0x5ea0('0x35')]);_0x310e45['attributes']=_['intersection'](_0x366119['model'],qs[_0x5ea0('0x3a')](_0xa0610e[_0x5ea0('0x35')]['fields']));_0x310e45[_0x5ea0('0x39')]=_0x310e45[_0x5ea0('0x39')]['length']?_0x310e45[_0x5ea0('0x39')]:_0x366119['model'];if(_0xa0610e[_0x5ea0('0x35')][_0x5ea0('0x46')]){_0x310e45[_0x5ea0('0x47')]=[{'all':!![]}];}_0x310e45=_['merge']({},_0x310e45,_0xa0610e[_0x5ea0('0x44')]);return db[_0x5ea0('0x31')][_0x5ea0('0x4b')](_0x310e45)[_0x5ea0('0x18')](handleEntityNotFound(_0x4e4c0a,null))['then'](respondWithResult(_0x4e4c0a,null))[_0x5ea0('0x22')](handleError(_0x4e4c0a,null));};exports[_0x5ea0('0x4c')]=function(_0x15f7d2,_0xab4bf0){if(_0x15f7d2[_0x5ea0('0x4d')]['id']){delete _0x15f7d2[_0x5ea0('0x4d')]['id'];}return db['FaxMessage'][_0x5ea0('0x4b')]({'where':{'id':_0x15f7d2[_0x5ea0('0x4a')]['id']}})[_0x5ea0('0x18')](handleEntityNotFound(_0xab4bf0,null))[_0x5ea0('0x18')](saveUpdates(_0x15f7d2[_0x5ea0('0x4d')],null))[_0x5ea0('0x18')](respondWithResult(_0xab4bf0,null))[_0x5ea0('0x22')](handleError(_0xab4bf0,null));};exports[_0x5ea0('0x4e')]=function(_0x54d231,_0x4a19b5){return db['FaxMessage'][_0x5ea0('0x4b')]({'where':{'id':_0x54d231[_0x5ea0('0x4a')]['id']}})[_0x5ea0('0x18')](handleEntityNotFound(_0x4a19b5,null))[_0x5ea0('0x18')](removeEntity(_0x4a19b5,null))[_0x5ea0('0x22')](handleError(_0x4a19b5,null));};exports[_0x5ea0('0x4f')]=function(_0x531a76,_0x385941){return db[_0x5ea0('0x31')][_0x5ea0('0x4f')]()[_0x5ea0('0x18')](respondWithResult(_0x385941,null))[_0x5ea0('0x22')](handleError(_0x385941,null));};var interaction_log=require(_0x5ea0('0xc'))(_0x5ea0('0x50'));exports[_0x5ea0('0x51')]=function(_0x37d39f,_0xb59e00,_0x18e071){var _0x4a06d6={'agent':{},'channel':'fax'};if(_0x37d39f[_0x5ea0('0x4d')]['id']){delete _0x37d39f[_0x5ea0('0x4d')]['id'];}_0x37d39f[_0x5ea0('0x4d')][_0x5ea0('0x52')]=!![];_0x37d39f[_0x5ea0('0x4d')][_0x5ea0('0x53')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x37d39f[_0x5ea0('0x4d')][_0x5ea0('0x54')]=_0x37d39f[_0x5ea0('0x4d')][_0x5ea0('0x54')]||_0x37d39f[_0x5ea0('0x55')]['id'];_0x4a06d6['agent']['id']=_0x37d39f['body']['UserId'];return db[_0x5ea0('0x31')]['find']({'where':{'id':_0x37d39f[_0x5ea0('0x4a')]['id'],'UserId':null}})[_0x5ea0('0x18')](handleEntityNotFound(_0xb59e00,null))['then'](saveUpdates(_0x37d39f[_0x5ea0('0x4d')],null))['then'](function(_0x375bcc){if(_0x375bcc){_0x4a06d6[_0x5ea0('0x20')]=_0x375bcc[_0x5ea0('0x56')]({'plain':!![]});return db[_0x5ea0('0x57')][_0x5ea0('0x4b')]({'where':{'id':_0x375bcc[_0x5ea0('0x58')]}});}return null;})[_0x5ea0('0x18')](handleEntityNotFound(_0xb59e00,null))['then'](function(_0x117546){if(_0x117546){return _0x117546[_0x5ea0('0x4c')]({'UserId':_0x37d39f[_0x5ea0('0x4d')][_0x5ea0('0x54')],'read1stAt':_['isNil'](_0x117546[_0x5ea0('0x59')])?moment()[_0x5ea0('0x5a')](_0x5ea0('0x5b')):undefined});}return null;})[_0x5ea0('0x18')](function(_0x2def41){if(_0x2def41){_0x4a06d6[_0x5ea0('0x5c')]=_0x2def41['get']({'plain':!![]});interaction_log[_0x5ea0('0x19')](_0x5ea0('0x5d'),_0x37d39f[_0x5ea0('0x55')]['id'],_0x37d39f[_0x5ea0('0x55')][_0x5ea0('0x2f')],_0x37d39f[_0x5ea0('0x55')]['role'],_0x4a06d6[_0x5ea0('0x5c')]['id'],_0x37d39f[_0x5ea0('0x4d')]?JSON[_0x5ea0('0x1e')](_0x37d39f[_0x5ea0('0x4d')]):_0x5ea0('0x5e'));return respondWithRpcPromise('AcceptMessage',_0x5ea0('0x5f'),_0x4a06d6);}return null;})[_0x5ea0('0x18')](function(_0x1cd716){var _0x594c46=_0x5ea0('0x60')+_0x1cd716[_0x5ea0('0x20')][_0x5ea0('0x61')];return db[_0x5ea0('0x62')]['query'](_0x594c46,{'type':db[_0x5ea0('0x63')]['QueryTypes']['SELECT'],'raw':!![]})[_0x5ea0('0x18')](function(_0x2d5d3e){return _0x2d5d3e;});})[_0x5ea0('0x18')](function(_0x3c44a2){if(_0x3c44a2){_0x4a06d6[_0x5ea0('0x20')][_0x5ea0('0x64')]=_0x3c44a2[0x0];if(!_0x37d39f[_0x5ea0('0x4d')][_0x5ea0('0x54')])return;return db[_0x5ea0('0x65')][_0x5ea0('0x4b')]({'where':{'id':_0x37d39f['body'][_0x5ea0('0x54')],'role':_0x5ea0('0x66')},'attributes':['id',_0x5ea0('0x2f'),_0x5ea0('0x67'),_0x5ea0('0x68'),_0x5ea0('0x69')],'raw':!![]});}return null;})['then'](function(_0x138990){if(!_0x138990)return null;_0x4a06d6['message'][_0x5ea0('0x66')]=_0x138990;return _0x4a06d6;})[_0x5ea0('0x18')](function(_0x1a16f8){if(_0x1a16f8){if(_0x37d39f[_0x5ea0('0x4d')][_0x5ea0('0x6a')]){_0x4a06d6[_0x5ea0('0x20')][_0x5ea0('0x6b')]=util['format'](_0x5ea0('0x6c'),_0x37d39f[_0x5ea0('0x55')][_0x5ea0('0x2f')]);_0x4a06d6['message'][_0x5ea0('0x6d')]=_0x4a06d6['channel'];_0x4a06d6[_0x5ea0('0x20')][_0x5ea0('0x6e')]=_0x4a06d6[_0x5ea0('0x6d')];_0x4a06d6[_0x5ea0('0x20')][_0x5ea0('0x6f')]=_0x5ea0('0x51');return respondWithRpcPromise(_0x5ea0('0x70'),_0x5ea0('0x70'),{'event':'acceptmessage','message':_0x4a06d6[_0x5ea0('0x20')]},client9002)['then'](function(){return _0x4a06d6;});}return _0x4a06d6;}return null;})[_0x5ea0('0x18')](respondWithResult(_0xb59e00,null))[_0x5ea0('0x22')](handleError(_0xb59e00,null));};var interaction_log=require(_0x5ea0('0xc'))('fax-interactions');exports[_0x5ea0('0x2c')]=function(_0x1322c4,_0x32dfeb,_0x253eb8){var _0x21fa94={'agent':{},'channel':_0x5ea0('0x71')};if(_0x1322c4[_0x5ea0('0x4d')]['id']){delete _0x1322c4[_0x5ea0('0x4d')]['id'];}_0x1322c4[_0x5ea0('0x4d')][_0x5ea0('0x54')]=_0x1322c4[_0x5ea0('0x4d')][_0x5ea0('0x54')]||_0x1322c4[_0x5ea0('0x55')]['id'];_0x21fa94[_0x5ea0('0x66')]['id']=_0x1322c4[_0x5ea0('0x4d')][_0x5ea0('0x54')];return db[_0x5ea0('0x31')]['find']({'where':{'id':_0x1322c4[_0x5ea0('0x4a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x32dfeb,null))[_0x5ea0('0x18')](function(_0x191a16){if(_0x191a16){_0x21fa94[_0x5ea0('0x20')]=_0x191a16[_0x5ea0('0x56')]({'plain':!![]});return db[_0x5ea0('0x57')]['find']({'where':{'id':_0x191a16[_0x5ea0('0x58')]}});}return null;})[_0x5ea0('0x18')](handleEntityNotFound(_0x32dfeb,null))[_0x5ea0('0x18')](function(_0x25f977){if(_0x25f977){_0x21fa94[_0x5ea0('0x5c')]=_0x25f977[_0x5ea0('0x56')]({'plain':!![]});interaction_log[_0x5ea0('0x19')](_0x5ea0('0x72'),_0x1322c4[_0x5ea0('0x55')]['id'],_0x1322c4[_0x5ea0('0x55')][_0x5ea0('0x2f')],_0x1322c4[_0x5ea0('0x55')]['role'],_0x21fa94['interaction']['id'],_0x1322c4['body']?JSON[_0x5ea0('0x1e')](_0x1322c4[_0x5ea0('0x4d')]):_0x5ea0('0x5e'));return respondWithRpcPromise(_0x5ea0('0x73'),_0x5ea0('0x74'),_0x21fa94);}return null;})[_0x5ea0('0x18')](function(_0xb6a5f2){var _0x377961=_0x5ea0('0x60')+_0xb6a5f2[_0x5ea0('0x20')]['ContactId'];return db[_0x5ea0('0x62')]['query'](_0x377961,{'type':db[_0x5ea0('0x63')][_0x5ea0('0x75')][_0x5ea0('0x76')],'raw':!![]})['then'](function(_0x49f70e){return _0x49f70e;});})[_0x5ea0('0x18')](function(_0x4711bb){if(_0x4711bb){_0x21fa94[_0x5ea0('0x20')]['contact']=_0x4711bb[0x0];if(!_0x1322c4[_0x5ea0('0x4d')][_0x5ea0('0x54')])return;return db[_0x5ea0('0x65')][_0x5ea0('0x4b')]({'where':{'id':_0x1322c4['body'][_0x5ea0('0x54')],'role':_0x5ea0('0x66')},'attributes':['id',_0x5ea0('0x2f'),_0x5ea0('0x67'),_0x5ea0('0x68'),_0x5ea0('0x69')],'raw':!![]});}return null;})[_0x5ea0('0x18')](function(_0x29c2ba){if(!_0x29c2ba)return null;_0x21fa94['message'][_0x5ea0('0x66')]=_0x29c2ba;return _0x21fa94;})['then'](function(_0x17ced9){if(_0x17ced9){_0x17ced9[_0x5ea0('0x20')][_0x5ea0('0x6b')]=util['format'](_0x5ea0('0x6c'),_0x1322c4[_0x5ea0('0x55')][_0x5ea0('0x2f')]);_0x17ced9[_0x5ea0('0x20')][_0x5ea0('0x6d')]=_0x21fa94[_0x5ea0('0x6d')];_0x17ced9[_0x5ea0('0x20')][_0x5ea0('0x6e')]=_0x21fa94[_0x5ea0('0x6d')];_0x17ced9[_0x5ea0('0x20')]['event']='reject';respondWithRpcPromise('EventManager',_0x5ea0('0x70'),{'event':'rejectmessage','message':_0x17ced9[_0x5ea0('0x20')]},client9002);return _0x21fa94;}return null;})[_0x5ea0('0x18')](respondWithResult(_0x32dfeb,null))[_0x5ea0('0x22')](handleError(_0x32dfeb,null));};exports['create']=function(_0x10b38a,_0x233d6e){var _0x46a477;return db[_0x5ea0('0x31')]['create'](_0x10b38a[_0x5ea0('0x4d')],{})[_0x5ea0('0x18')](function(_0x100a83){_0x46a477=_0x100a83;return db[_0x5ea0('0x77')][_0x5ea0('0x78')]({'where':{'id':_0x46a477[_0x5ea0('0x61')]}});})['then'](function(_0x452b30){if(_[_0x5ea0('0x79')](_0x452b30)){return;}else{_0x46a477[_0x5ea0('0x71')]=_0x452b30[_0x5ea0('0x71')];return db[_0x5ea0('0x7a')][_0x5ea0('0x78')]({'where':{'id':_0x46a477['AttachmentId']}});}})[_0x5ea0('0x18')](function(_0x3e79fa){return respondWithRpcPromise(_0x5ea0('0x7b'),_0x5ea0('0x7b'),{'FaxAccountId':_[_0x5ea0('0x79')](_0x10b38a['body'])?undefined:_0x10b38a['body'][_0x5ea0('0x7c')],'path':_[_0x5ea0('0x79')](_0x3e79fa)?undefined:util[_0x5ea0('0x5a')](_0x5ea0('0x7d'),_0x3e79fa[_0x5ea0('0x7e')]),'fax':_[_0x5ea0('0x79')](_0x46a477['fax'])?undefined:_0x46a477[_0x5ea0('0x71')],'AttachmentId':_0x46a477['AttachmentId']},client9002);})[_0x5ea0('0x18')](respondWithResult(_0x233d6e,0xc9))['catch'](handleError(_0x233d6e,null));};exports[_0x5ea0('0x7f')]=function(_0x3ff6c4,_0x4565f5){var _0x59c522=path[_0x5ea0('0x80')](config['root'],_0x5ea0('0x81'),_0x5ea0('0x82'),_0x5ea0('0x83'));return db[_0x5ea0('0x31')][_0x5ea0('0x4b')]({'where':{'id':_0x3ff6c4[_0x5ea0('0x4a')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x5ea0('0x18')](handleEntityNotFound(_0x4565f5,null))[_0x5ea0('0x18')](function(_0x2540d5){if(_0x2540d5){return _0x4565f5['download'](path['join'](_0x59c522,_0x2540d5['Attachment'][_0x5ea0('0x7e')]));}})[_0x5ea0('0x22')](handleError(_0x4565f5,null));}; \ No newline at end of file +var _0xfc50=['Attachment','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','jayson/promise','client','http','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','index','map','FaxMessage','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','keys','fields','find','body','describe','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','contact','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','agent','RejectMessage','rejectMessage','sequelize','QueryTypes','interface','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files'];(function(_0xedd44e,_0x1f01a4){var _0x4ddcd6=function(_0x41bee2){while(--_0x41bee2){_0xedd44e['push'](_0xedd44e['shift']());}};_0x4ddcd6(++_0x1f01a4);}(_0xfc50,0x85));var _0x0fc5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xfc50[_0x5b644e];return _0x49c6bf;};'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(_0x0fc5('0x0'));var moment=require(_0x0fc5('0x1'));var BPromise=require(_0x0fc5('0x2'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0fc5('0x3'));var ejs=require(_0x0fc5('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0fc5('0x5'));var squel=require(_0x0fc5('0x6'));var crypto=require(_0x0fc5('0x7'));var jsforce=require(_0x0fc5('0x8'));var deskjs=require(_0x0fc5('0x9'));var toCsv=require(_0x0fc5('0x3'));var querystring=require('querystring');var Papa=require(_0x0fc5('0xa'));var Redis=require(_0x0fc5('0xb'));var authService=require(_0x0fc5('0xc'));var qs=require(_0x0fc5('0xd'));var as=require(_0x0fc5('0xe'));var hardwareService=require(_0x0fc5('0xf'));var logger=require(_0x0fc5('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x0fc5('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x0fc5('0x12'))['db'];config[_0x0fc5('0x13')]=_[_0x0fc5('0x14')](config[_0x0fc5('0x13')],{'host':_0x0fc5('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x0fc5('0x16'));var client=jayson[_0x0fc5('0x17')][_0x0fc5('0x18')]({'port':0x232c});var client9002=jayson[_0x0fc5('0x17')][_0x0fc5('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x1b6c80,_0x2d7dad,_0x328eda,_0x4e1ad1){return new BPromise(function(_0x4a6847,_0x3a8c11){var _0x5b3a42=_0x4e1ad1||client;return _0x5b3a42[_0x0fc5('0x19')](_0x1b6c80,_0x328eda)['then'](function(_0x1acff2){logger['info'](_0x0fc5('0x1a'),_0x2d7dad,_0x0fc5('0x1b'));logger[_0x0fc5('0x1c')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2d7dad,_0x0fc5('0x1b'),JSON['stringify'](_0x1acff2));if(_0x1acff2[_0x0fc5('0x1d')]){if(_0x1acff2[_0x0fc5('0x1d')][_0x0fc5('0x1e')]===0x1f4){logger[_0x0fc5('0x1d')](_0x0fc5('0x1a'),_0x2d7dad,_0x1acff2[_0x0fc5('0x1d')][_0x0fc5('0x1f')]);return _0x3a8c11(_0x1acff2[_0x0fc5('0x1d')][_0x0fc5('0x1f')]);}logger[_0x0fc5('0x1d')](_0x0fc5('0x1a'),_0x2d7dad,_0x1acff2['error'][_0x0fc5('0x1f')]);return _0x4a6847(_0x1acff2[_0x0fc5('0x1d')][_0x0fc5('0x1f')]);}else{logger[_0x0fc5('0x20')](_0x0fc5('0x1a'),_0x2d7dad,_0x0fc5('0x1b'));_0x4a6847(_0x1acff2[_0x0fc5('0x21')][_0x0fc5('0x1f')]);}})['catch'](function(_0xe41836){logger['error']('FaxMessage,\x20%s,\x20%s',_0x2d7dad,_0xe41836);_0x3a8c11(_0xe41836);});});}function respondWithStatusCode(_0x8004c6,_0x159c4e){_0x159c4e=_0x159c4e||0xcc;return function(_0x593b2e){if(_0x593b2e){return _0x8004c6['sendStatus'](_0x159c4e);}return _0x8004c6[_0x0fc5('0x22')](_0x159c4e)[_0x0fc5('0x23')]();};}function respondWithResult(_0x24a73a,_0x38d1bd){_0x38d1bd=_0x38d1bd||0xc8;return function(_0x2be52a){if(_0x2be52a){return _0x24a73a[_0x0fc5('0x22')](_0x38d1bd)[_0x0fc5('0x24')](_0x2be52a);}};}function respondWithFilteredResult(_0x35729e,_0x5b72e3){return function(_0x5d7bf0){if(_0x5d7bf0){var _0x43ab35=typeof _0x5b72e3['offset']===_0x0fc5('0x25')&&typeof _0x5b72e3[_0x0fc5('0x26')]===_0x0fc5('0x25');var _0x6e74f8=_0x5d7bf0[_0x0fc5('0x27')];var _0x5418ef=_0x43ab35?0x0:_0x5b72e3[_0x0fc5('0x28')];var _0x32f96c=_0x43ab35?_0x5d7bf0[_0x0fc5('0x27')]:_0x5b72e3[_0x0fc5('0x28')]+_0x5b72e3[_0x0fc5('0x26')];var _0xe6b5cd;if(_0x32f96c>=_0x6e74f8){_0x32f96c=_0x6e74f8;_0xe6b5cd=0xc8;}else{_0xe6b5cd=0xce;}_0x35729e[_0x0fc5('0x22')](_0xe6b5cd);return _0x35729e['set'](_0x0fc5('0x29'),_0x5418ef+'-'+_0x32f96c+'/'+_0x6e74f8)[_0x0fc5('0x24')](_0x5d7bf0);}return null;};}function patchUpdates(_0x3194e6){return function(_0x3e5970){try{jsonpatch[_0x0fc5('0x2a')](_0x3e5970,_0x3194e6,!![]);}catch(_0x3e3948){return BPromise[_0x0fc5('0x2b')](_0x3e3948);}return _0x3e5970['save']();};}function saveUpdates(_0x6ee3b4,_0x1ca3da){return function(_0x566288){if(_0x566288){return _0x566288[_0x0fc5('0x2c')](_0x6ee3b4)[_0x0fc5('0x2d')](function(_0x2fe782){return _0x2fe782;});}return null;};}function removeEntity(_0x573211,_0x2184ec){return function(_0x206eb0){if(_0x206eb0){return _0x206eb0[_0x0fc5('0x2e')]()['then'](function(){_0x573211[_0x0fc5('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x251f7a,_0x258598){return function(_0x45fb34){if(!_0x45fb34){_0x251f7a[_0x0fc5('0x2f')](0x194);}return _0x45fb34;};}function handleError(_0xa581f9,_0x4b123a){_0x4b123a=_0x4b123a||0x1f4;return function(_0x3a8b4e){logger[_0x0fc5('0x1d')](_0x3a8b4e[_0x0fc5('0x30')]);if(_0x3a8b4e[_0x0fc5('0x31')]){delete _0x3a8b4e[_0x0fc5('0x31')];}_0xa581f9[_0x0fc5('0x22')](_0x4b123a)['send'](_0x3a8b4e);};}exports[_0x0fc5('0x32')]=function(_0x9d4238,_0x2b38a1){var _0x425b26={},_0x1d15b2={},_0x45a44a={'count':0x0,'rows':[]};var _0x146979=_[_0x0fc5('0x33')](db[_0x0fc5('0x34')]['rawAttributes'],function(_0x590c7a){return{'name':_0x590c7a[_0x0fc5('0x35')],'type':_0x590c7a[_0x0fc5('0x36')][_0x0fc5('0x37')]};});_0x1d15b2[_0x0fc5('0x38')]=_[_0x0fc5('0x33')](_0x146979,_0x0fc5('0x31'));_0x1d15b2[_0x0fc5('0x39')]=_['keys'](_0x9d4238[_0x0fc5('0x39')]);_0x1d15b2[_0x0fc5('0x3a')]=_[_0x0fc5('0x3b')](_0x1d15b2[_0x0fc5('0x38')],_0x1d15b2['query']);_0x425b26[_0x0fc5('0x3c')]=_['intersection'](_0x1d15b2[_0x0fc5('0x38')],qs['fields'](_0x9d4238[_0x0fc5('0x39')]['fields']));_0x425b26[_0x0fc5('0x3c')]=_0x425b26[_0x0fc5('0x3c')]['length']?_0x425b26[_0x0fc5('0x3c')]:_0x1d15b2['model'];if(!_0x9d4238[_0x0fc5('0x39')][_0x0fc5('0x3d')]('nolimit')){_0x425b26['limit']=qs[_0x0fc5('0x26')](_0x9d4238[_0x0fc5('0x39')][_0x0fc5('0x26')]);_0x425b26[_0x0fc5('0x28')]=qs[_0x0fc5('0x28')](_0x9d4238['query'][_0x0fc5('0x28')]);}_0x425b26['order']=qs[_0x0fc5('0x3e')](_0x9d4238[_0x0fc5('0x39')]['sort']);_0x425b26[_0x0fc5('0x3f')]=qs[_0x0fc5('0x3a')](_['pick'](_0x9d4238['query'],_0x1d15b2['filters']),_0x146979);if(_0x9d4238[_0x0fc5('0x39')][_0x0fc5('0x40')]){_0x425b26['where']=_[_0x0fc5('0x41')](_0x425b26[_0x0fc5('0x3f')],{'$or':_[_0x0fc5('0x33')](_0x146979,function(_0x3ed2ea){if(_0x3ed2ea[_0x0fc5('0x36')]!==_0x0fc5('0x42')){var _0x30ef98={};_0x30ef98[_0x3ed2ea[_0x0fc5('0x31')]]={'$like':'%'+_0x9d4238['query'][_0x0fc5('0x40')]+'%'};return _0x30ef98;}})});}_0x425b26=_[_0x0fc5('0x41')]({},_0x425b26,_0x9d4238[_0x0fc5('0x43')]);var _0x16d157={'where':_0x425b26[_0x0fc5('0x3f')]};return db[_0x0fc5('0x34')][_0x0fc5('0x27')](_0x16d157)[_0x0fc5('0x2d')](function(_0x1abca0){_0x45a44a['count']=_0x1abca0;if(_0x9d4238[_0x0fc5('0x39')][_0x0fc5('0x44')]){_0x425b26[_0x0fc5('0x45')]=[{'all':!![]}];}return db[_0x0fc5('0x34')]['findAll'](_0x425b26);})[_0x0fc5('0x2d')](function(_0x5a27aa){_0x45a44a[_0x0fc5('0x46')]=_0x5a27aa;return _0x45a44a;})[_0x0fc5('0x2d')](respondWithFilteredResult(_0x2b38a1,_0x425b26))[_0x0fc5('0x47')](handleError(_0x2b38a1,null));};exports['show']=function(_0x5e7ae4,_0x252314){var _0x523805={'raw':!![],'where':{'id':_0x5e7ae4[_0x0fc5('0x48')]['id']}},_0x3d747d={};_0x3d747d['model']=_['keys'](db['FaxMessage'][_0x0fc5('0x49')]);_0x3d747d[_0x0fc5('0x39')]=_[_0x0fc5('0x4a')](_0x5e7ae4['query']);_0x3d747d[_0x0fc5('0x3a')]=_[_0x0fc5('0x3b')](_0x3d747d['model'],_0x3d747d['query']);_0x523805[_0x0fc5('0x3c')]=_[_0x0fc5('0x3b')](_0x3d747d[_0x0fc5('0x38')],qs[_0x0fc5('0x4b')](_0x5e7ae4[_0x0fc5('0x39')][_0x0fc5('0x4b')]));_0x523805['attributes']=_0x523805[_0x0fc5('0x3c')]['length']?_0x523805[_0x0fc5('0x3c')]:_0x3d747d[_0x0fc5('0x38')];if(_0x5e7ae4[_0x0fc5('0x39')][_0x0fc5('0x44')]){_0x523805['include']=[{'all':!![]}];}_0x523805=_[_0x0fc5('0x41')]({},_0x523805,_0x5e7ae4[_0x0fc5('0x43')]);return db[_0x0fc5('0x34')][_0x0fc5('0x4c')](_0x523805)['then'](handleEntityNotFound(_0x252314,null))[_0x0fc5('0x2d')](respondWithResult(_0x252314,null))[_0x0fc5('0x47')](handleError(_0x252314,null));};exports[_0x0fc5('0x2c')]=function(_0x37f7e6,_0x3aa214){if(_0x37f7e6[_0x0fc5('0x4d')]['id']){delete _0x37f7e6[_0x0fc5('0x4d')]['id'];}return db['FaxMessage'][_0x0fc5('0x4c')]({'where':{'id':_0x37f7e6[_0x0fc5('0x48')]['id']}})[_0x0fc5('0x2d')](handleEntityNotFound(_0x3aa214,null))[_0x0fc5('0x2d')](saveUpdates(_0x37f7e6[_0x0fc5('0x4d')],null))['then'](respondWithResult(_0x3aa214,null))[_0x0fc5('0x47')](handleError(_0x3aa214,null));};exports['destroy']=function(_0x1cb0d2,_0x49ede2){return db['FaxMessage']['find']({'where':{'id':_0x1cb0d2[_0x0fc5('0x48')]['id']}})[_0x0fc5('0x2d')](handleEntityNotFound(_0x49ede2,null))[_0x0fc5('0x2d')](removeEntity(_0x49ede2,null))[_0x0fc5('0x47')](handleError(_0x49ede2,null));};exports[_0x0fc5('0x4e')]=function(_0x473490,_0x4086ea){return db['FaxMessage'][_0x0fc5('0x4e')]()[_0x0fc5('0x2d')](respondWithResult(_0x4086ea,null))['catch'](handleError(_0x4086ea,null));};var interaction_log=require(_0x0fc5('0x10'))('fax-interactions');exports['accept']=function(_0x59f202,_0x200018,_0x1f2847){var _0x332b3f={'agent':{},'channel':_0x0fc5('0x4f')};if(_0x59f202[_0x0fc5('0x4d')]['id']){delete _0x59f202[_0x0fc5('0x4d')]['id'];}_0x59f202[_0x0fc5('0x4d')][_0x0fc5('0x50')]=!![];_0x59f202[_0x0fc5('0x4d')][_0x0fc5('0x51')]=moment()[_0x0fc5('0x52')](_0x0fc5('0x53'));_0x59f202[_0x0fc5('0x4d')]['UserId']=_0x59f202[_0x0fc5('0x4d')][_0x0fc5('0x54')]||_0x59f202['user']['id'];_0x332b3f['agent']['id']=_0x59f202['body'][_0x0fc5('0x54')];return db[_0x0fc5('0x34')][_0x0fc5('0x4c')]({'where':{'id':_0x59f202[_0x0fc5('0x48')]['id'],'UserId':null}})[_0x0fc5('0x2d')](handleEntityNotFound(_0x200018,null))[_0x0fc5('0x2d')](saveUpdates(_0x59f202[_0x0fc5('0x4d')],null))['then'](function(_0xa68ee1){if(_0xa68ee1){_0x332b3f[_0x0fc5('0x1f')]=_0xa68ee1[_0x0fc5('0x55')]({'plain':!![]});return db[_0x0fc5('0x56')][_0x0fc5('0x4c')]({'where':{'id':_0xa68ee1[_0x0fc5('0x57')]}});}return null;})['then'](handleEntityNotFound(_0x200018,null))['then'](function(_0x18f687){if(_0x18f687){return _0x18f687[_0x0fc5('0x2c')]({'UserId':_0x59f202[_0x0fc5('0x4d')]['UserId'],'read1stAt':_[_0x0fc5('0x58')](_0x18f687[_0x0fc5('0x59')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x43eb81){if(_0x43eb81){_0x332b3f[_0x0fc5('0x5a')]=_0x43eb81[_0x0fc5('0x55')]({'plain':!![]});interaction_log['info'](_0x0fc5('0x5b'),_0x59f202[_0x0fc5('0x5c')]['id'],_0x59f202['user'][_0x0fc5('0x31')],_0x59f202[_0x0fc5('0x5c')][_0x0fc5('0x5d')],_0x332b3f[_0x0fc5('0x5a')]['id'],_0x59f202['body']?JSON[_0x0fc5('0x5e')](_0x59f202['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x0fc5('0x5f'),_0x332b3f);}return null;})[_0x0fc5('0x2d')](function(_0xa0c2f6){var _0x1d0f90=_0x0fc5('0x60')+_0xa0c2f6[_0x0fc5('0x1f')][_0x0fc5('0x61')];return db['sequelize'][_0x0fc5('0x39')](_0x1d0f90,{'type':db[_0x0fc5('0x62')]['QueryTypes']['SELECT'],'raw':!![]})[_0x0fc5('0x2d')](function(_0x61e5c7){return _0x61e5c7;});})[_0x0fc5('0x2d')](function(_0x252a4a){if(_0x252a4a){_0x332b3f[_0x0fc5('0x1f')][_0x0fc5('0x63')]=_0x252a4a[0x0];if(!_0x59f202[_0x0fc5('0x4d')][_0x0fc5('0x54')])return;return db[_0x0fc5('0x64')][_0x0fc5('0x4c')]({'where':{'id':_0x59f202['body']['UserId'],'role':'agent'},'attributes':['id',_0x0fc5('0x31'),_0x0fc5('0x65'),_0x0fc5('0x66'),_0x0fc5('0x67')],'raw':!![]});}return null;})[_0x0fc5('0x2d')](function(_0x163e7f){if(!_0x163e7f)return null;_0x332b3f[_0x0fc5('0x1f')]['agent']=_0x163e7f;return _0x332b3f;})[_0x0fc5('0x2d')](function(_0xfb0105){if(_0xfb0105){if(_0x59f202[_0x0fc5('0x4d')]['manual']){_0x332b3f[_0x0fc5('0x1f')]['interface']=util['format'](_0x0fc5('0x68'),_0x59f202[_0x0fc5('0x5c')][_0x0fc5('0x31')]);_0x332b3f[_0x0fc5('0x1f')][_0x0fc5('0x69')]=_0x332b3f['channel'];_0x332b3f['message'][_0x0fc5('0x6a')]=_0x332b3f[_0x0fc5('0x69')];_0x332b3f['message'][_0x0fc5('0x6b')]=_0x0fc5('0x6c');return respondWithRpcPromise('EventManager',_0x0fc5('0x6d'),{'event':_0x0fc5('0x6e'),'message':_0x332b3f[_0x0fc5('0x1f')]},client9002)['then'](function(){return _0x332b3f;});}return _0x332b3f;}return null;})[_0x0fc5('0x2d')](respondWithResult(_0x200018,null))['catch'](handleError(_0x200018,null));};var interaction_log=require(_0x0fc5('0x10'))('fax-interactions');exports[_0x0fc5('0x2b')]=function(_0x205a29,_0xa72d35,_0x43d8c){var _0x126b47={'agent':{},'channel':_0x0fc5('0x4f')};if(_0x205a29[_0x0fc5('0x4d')]['id']){delete _0x205a29[_0x0fc5('0x4d')]['id'];}_0x205a29[_0x0fc5('0x4d')][_0x0fc5('0x54')]=_0x205a29[_0x0fc5('0x4d')][_0x0fc5('0x54')]||_0x205a29[_0x0fc5('0x5c')]['id'];_0x126b47[_0x0fc5('0x6f')]['id']=_0x205a29[_0x0fc5('0x4d')]['UserId'];return db[_0x0fc5('0x34')][_0x0fc5('0x4c')]({'where':{'id':_0x205a29[_0x0fc5('0x48')]['id'],'UserId':null}})[_0x0fc5('0x2d')](handleEntityNotFound(_0xa72d35,null))[_0x0fc5('0x2d')](function(_0x217ce4){if(_0x217ce4){_0x126b47[_0x0fc5('0x1f')]=_0x217ce4[_0x0fc5('0x55')]({'plain':!![]});return db[_0x0fc5('0x56')][_0x0fc5('0x4c')]({'where':{'id':_0x217ce4[_0x0fc5('0x57')]}});}return null;})[_0x0fc5('0x2d')](handleEntityNotFound(_0xa72d35,null))[_0x0fc5('0x2d')](function(_0x54d999){if(_0x54d999){_0x126b47['interaction']=_0x54d999[_0x0fc5('0x55')]({'plain':!![]});interaction_log[_0x0fc5('0x20')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x205a29['user']['id'],_0x205a29[_0x0fc5('0x5c')]['name'],_0x205a29['user'][_0x0fc5('0x5d')],_0x126b47[_0x0fc5('0x5a')]['id'],_0x205a29['body']?JSON[_0x0fc5('0x5e')](_0x205a29[_0x0fc5('0x4d')]):'null');return respondWithRpcPromise(_0x0fc5('0x70'),_0x0fc5('0x71'),_0x126b47);}return null;})[_0x0fc5('0x2d')](function(_0x16a442){var _0x126780=_0x0fc5('0x60')+_0x16a442[_0x0fc5('0x1f')][_0x0fc5('0x61')];return db[_0x0fc5('0x72')]['query'](_0x126780,{'type':db[_0x0fc5('0x62')][_0x0fc5('0x73')]['SELECT'],'raw':!![]})['then'](function(_0x4ef050){return _0x4ef050;});})[_0x0fc5('0x2d')](function(_0x550716){if(_0x550716){_0x126b47['message'][_0x0fc5('0x63')]=_0x550716[0x0];if(!_0x205a29[_0x0fc5('0x4d')]['UserId'])return;return db[_0x0fc5('0x64')][_0x0fc5('0x4c')]({'where':{'id':_0x205a29[_0x0fc5('0x4d')][_0x0fc5('0x54')],'role':_0x0fc5('0x6f')},'attributes':['id',_0x0fc5('0x31'),_0x0fc5('0x65'),_0x0fc5('0x66'),_0x0fc5('0x67')],'raw':!![]});}return null;})[_0x0fc5('0x2d')](function(_0x801764){if(!_0x801764)return null;_0x126b47[_0x0fc5('0x1f')]['agent']=_0x801764;return _0x126b47;})[_0x0fc5('0x2d')](function(_0x2faf73){if(_0x2faf73){_0x2faf73['message'][_0x0fc5('0x74')]=util['format'](_0x0fc5('0x68'),_0x205a29[_0x0fc5('0x5c')]['name']);_0x2faf73[_0x0fc5('0x1f')][_0x0fc5('0x69')]=_0x126b47[_0x0fc5('0x69')];_0x2faf73[_0x0fc5('0x1f')][_0x0fc5('0x6a')]=_0x126b47['channel'];_0x2faf73[_0x0fc5('0x1f')][_0x0fc5('0x6b')]=_0x0fc5('0x2b');respondWithRpcPromise(_0x0fc5('0x6d'),_0x0fc5('0x6d'),{'event':_0x0fc5('0x75'),'message':_0x2faf73[_0x0fc5('0x1f')]},client9002);return _0x126b47;}return null;})['then'](respondWithResult(_0xa72d35,null))[_0x0fc5('0x47')](handleError(_0xa72d35,null));};exports[_0x0fc5('0x76')]=function(_0x4631eb,_0x3d6b85){var _0x3acf54;return db['FaxMessage'][_0x0fc5('0x76')](_0x4631eb[_0x0fc5('0x4d')],{})[_0x0fc5('0x2d')](function(_0x5e9c0e){_0x3acf54=_0x5e9c0e;return db[_0x0fc5('0x77')]['findOne']({'where':{'id':_0x3acf54[_0x0fc5('0x61')]}});})[_0x0fc5('0x2d')](function(_0x553431){if(_[_0x0fc5('0x58')](_0x553431)){return;}else{_0x3acf54[_0x0fc5('0x4f')]=_0x553431['fax'];return db['Attachment'][_0x0fc5('0x78')]({'where':{'id':_0x3acf54[_0x0fc5('0x79')]}});}})[_0x0fc5('0x2d')](function(_0x23286c){return respondWithRpcPromise(_0x0fc5('0x7a'),_0x0fc5('0x7a'),{'FaxAccountId':_[_0x0fc5('0x58')](_0x4631eb[_0x0fc5('0x4d')])?undefined:_0x4631eb[_0x0fc5('0x4d')][_0x0fc5('0x7b')],'path':_[_0x0fc5('0x58')](_0x23286c)?undefined:util['format'](_0x0fc5('0x7c'),_0x23286c[_0x0fc5('0x7d')]),'fax':_['isNil'](_0x3acf54[_0x0fc5('0x4f')])?undefined:_0x3acf54['fax'],'AttachmentId':_0x3acf54[_0x0fc5('0x79')]},client9002);})[_0x0fc5('0x2d')](respondWithResult(_0x3d6b85,0xc9))[_0x0fc5('0x47')](handleError(_0x3d6b85,null));};exports[_0x0fc5('0x7e')]=function(_0x128b76,_0x2d1870){var _0x4477e7=path[_0x0fc5('0x7f')](config[_0x0fc5('0x80')],_0x0fc5('0x81'),_0x0fc5('0x82'),'attachments');return db[_0x0fc5('0x34')][_0x0fc5('0x4c')]({'where':{'id':_0x128b76[_0x0fc5('0x48')]['id']},'include':[{'model':db[_0x0fc5('0x83')],'as':_0x0fc5('0x83')}]})['then'](handleEntityNotFound(_0x2d1870,null))[_0x0fc5('0x2d')](function(_0x244683){if(_0x244683){return _0x2d1870[_0x0fc5('0x7e')](path[_0x0fc5('0x7f')](_0x4477e7,_0x244683['Attachment'][_0x0fc5('0x7d')]));}})[_0x0fc5('0x47')](handleError(_0x2d1870,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 24c4ec3..9997a16 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 _0x1c23=['hook','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x38d719,_0x58bebf){var _0x26ba80=function(_0xfa9de4){while(--_0xfa9de4){_0x38d719['push'](_0x38d719['shift']());}};_0x26ba80(++_0x58bebf);}(_0x1c23,0x1d5));var _0x31c2=function(_0x4ab825,_0x3b6f8b){_0x4ab825=_0x4ab825-0x0;var _0x412670=_0x1c23[_0x4ab825];return _0x412670;};'use strict';var EventEmitter=require(_0x31c2('0x0'));var FaxMessage=require(_0x31c2('0x1'))['db'][_0x31c2('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x31c2('0x3')](0x0);var events={'afterCreate':_0x31c2('0x4'),'afterUpdate':_0x31c2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x30a2af){return function(_0x2da7ad,_0x55e8c3,_0x50b513){FaxMessageEvents[_0x31c2('0x6')](_0x30a2af+':'+_0x2da7ad['id'],_0x2da7ad);FaxMessageEvents[_0x31c2('0x6')](_0x30a2af,_0x2da7ad);_0x50b513(null);};}for(var e in events){if(events[_0x31c2('0x7')](e)){var event=events[e];FaxMessage[_0x31c2('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xbdc2=['events','../../mysqldb','FaxMessage','setMaxListeners','remove','emit','hook','exports'];(function(_0x13fee8,_0x28f5c3){var _0x313c52=function(_0x462e0a){while(--_0x462e0a){_0x13fee8['push'](_0x13fee8['shift']());}};_0x313c52(++_0x28f5c3);}(_0xbdc2,0x148));var _0x2bdc=function(_0x40be86,_0x68fe5d){_0x40be86=_0x40be86-0x0;var _0xda3c3b=_0xbdc2[_0x40be86];return _0xda3c3b;};'use strict';var EventEmitter=require(_0x2bdc('0x0'));var FaxMessage=require(_0x2bdc('0x1'))['db'][_0x2bdc('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x2bdc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2bdc('0x4')};function emitEvent(_0x1d9116){return function(_0x522434,_0x1855bd,_0x378db8){FaxMessageEvents['emit'](_0x1d9116+':'+_0x522434['id'],_0x522434);FaxMessageEvents[_0x2bdc('0x5')](_0x1d9116,_0x522434);_0x378db8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x2bdc('0x6')](e,emitEvent(event));}}module[_0x2bdc('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 17a6aee..871e1b2 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 _0xa9c5=['get','direction','toLowerCase','secret','UserId','FaxInteraction','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models'];(function(_0x462c8d,_0x308cea){var _0x963b90=function(_0x4f71d8){while(--_0x4f71d8){_0x462c8d['push'](_0x462c8d['shift']());}};_0x963b90(++_0x308cea);}(_0xa9c5,0x15d));var _0x5a9c=function(_0x3ff55a,_0x2b6451){_0x3ff55a=_0x3ff55a-0x0;var _0x420ef1=_0xa9c5[_0x3ff55a];return _0x420ef1;};'use strict';var _=require('lodash');var util=require(_0x5a9c('0x0'));var logger=require(_0x5a9c('0x1'))(_0x5a9c('0x2'));var moment=require('moment');var BPromise=require(_0x5a9c('0x3'));var rp=require(_0x5a9c('0x4'));var fs=require('fs');var path=require(_0x5a9c('0x5'));var rimraf=require(_0x5a9c('0x6'));var config=require(_0x5a9c('0x7'));var attributes=require(_0x5a9c('0x8'));module['exports']=function(_0x55456e,_0x58bfd8){return _0x55456e[_0x5a9c('0x9')](_0x5a9c('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x5a9c('0xb'),'fields':[_0x5a9c('0xc')],'type':_0x5a9c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d1a81,_0x2ae123,_0x1c5815){var _0x31aba0=_0x55456e[_0x5a9c('0xe')];var _0x327cbd=_0x1d1a81[_0x5a9c('0xf')]({'plain':!![]});if(_0x327cbd[_0x5a9c('0x10')]['toLowerCase']()==='in'||_0x327cbd['direction'][_0x5a9c('0x11')]()==='out'&&!_0x327cbd[_0x5a9c('0x12')]&&!_['isNil'](_0x327cbd[_0x5a9c('0x13')])){_0x31aba0[_0x5a9c('0x14')]['findOne']({'where':{'id':_0x327cbd['FaxInteractionId']}})[_0x5a9c('0x15')](function(_0x5b262a){if(_0x5b262a){_0x5b262a[_0x5a9c('0x16')]({'lastMsgAt':_0x327cbd[_0x5a9c('0x17')],'lastMsgDirection':_0x327cbd[_0x5a9c('0x10')][_0x5a9c('0x11')]()});}})['catch'](function(_0x167a7d){console['error'](_0x167a7d);});}_0x1c5815();}},'charset':_0x5a9c('0x18'),'collate':_0x5a9c('0x19')});}; \ No newline at end of file +var _0xaa99=['toLowerCase','out','isNil','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','direction'];(function(_0x461886,_0x4fc171){var _0x295e0a=function(_0x451524){while(--_0x451524){_0x461886['push'](_0x461886['shift']());}};_0x295e0a(++_0x4fc171);}(_0xaa99,0x99));var _0x9aa9=function(_0x5596b8,_0x462174){_0x5596b8=_0x5596b8-0x0;var _0x3a536a=_0xaa99[_0x5596b8];return _0x3a536a;};'use strict';var _=require(_0x9aa9('0x0'));var util=require(_0x9aa9('0x1'));var logger=require(_0x9aa9('0x2'))(_0x9aa9('0x3'));var moment=require(_0x9aa9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9aa9('0x5'));var attributes=require(_0x9aa9('0x6'));module[_0x9aa9('0x7')]=function(_0x370139,_0x53295f){return _0x370139[_0x9aa9('0x8')](_0x9aa9('0x9'),attributes,{'tableName':_0x9aa9('0xa'),'paranoid':![],'indexes':[{'name':_0x9aa9('0xb'),'fields':['body'],'type':_0x9aa9('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x389daf,_0x19a311,_0x3df604){var _0x4074c6=_0x370139[_0x9aa9('0xd')];var _0x419752=_0x389daf['get']({'plain':!![]});if(_0x419752[_0x9aa9('0xe')][_0x9aa9('0xf')]()==='in'||_0x419752[_0x9aa9('0xe')][_0x9aa9('0xf')]()===_0x9aa9('0x10')&&!_0x419752['secret']&&!_[_0x9aa9('0x11')](_0x419752['UserId'])){_0x4074c6[_0x9aa9('0x12')][_0x9aa9('0x13')]({'where':{'id':_0x419752[_0x9aa9('0x14')]}})[_0x9aa9('0x15')](function(_0x5402ca){if(_0x5402ca){_0x5402ca[_0x9aa9('0x16')]({'lastMsgAt':_0x419752[_0x9aa9('0x17')],'lastMsgDirection':_0x419752['direction'][_0x9aa9('0xf')]()});}})[_0x9aa9('0x18')](function(_0x33684b){console[_0x9aa9('0x19')](_0x33684b);});}_0x3df604();}},'charset':_0x9aa9('0x1a'),'collate':_0x9aa9('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 2769f42..bef2bf4 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 _0xe5b3=['FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','options','raw','catch','UpdateFaxMessage','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','then','info'];(function(_0x306168,_0x523acf){var _0xba1a11=function(_0x527446){while(--_0x527446){_0x306168['push'](_0x306168['shift']());}};_0xba1a11(++_0x523acf);}(_0xe5b3,0x133));var _0x3e5b=function(_0x37c9b3,_0x3f94c1){_0x37c9b3=_0x37c9b3-0x0;var _0x5cbee5=_0xe5b3[_0x37c9b3];return _0x5cbee5;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});config[_0x3e5b('0xc')]=_['defaults'](config[_0x3e5b('0xc')],{'host':_0x3e5b('0xd'),'port':0x18eb});var socket=require(_0x3e5b('0xe'))(new Redis(config[_0x3e5b('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1fef54,_0x3d3b6e,_0x22fc1a){return new BPromise(function(_0x17dee7,_0xeeaabc){return client['request'](_0x1fef54,_0x22fc1a)[_0x3e5b('0xf')](function(_0x52efbd){logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x3d3b6e,_0x3e5b('0x12'));logger[_0x3e5b('0x13')](_0x3e5b('0x14'),_0x3d3b6e,_0x3e5b('0x12'),JSON[_0x3e5b('0x15')](_0x52efbd));if(_0x52efbd['error']){if(_0x52efbd[_0x3e5b('0x16')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3d3b6e,_0x52efbd[_0x3e5b('0x16')][_0x3e5b('0x17')]);return _0xeeaabc(_0x52efbd[_0x3e5b('0x16')]['message']);}logger[_0x3e5b('0x16')]('FaxMessage,\x20%s,\x20%s',_0x3d3b6e,_0x52efbd['error'][_0x3e5b('0x17')]);return _0x17dee7(_0x52efbd[_0x3e5b('0x16')]['message']);}else{logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x3d3b6e,'request\x20sent');_0x17dee7(_0x52efbd[_0x3e5b('0x18')][_0x3e5b('0x17')]);}})['catch'](function(_0x4b189d){logger[_0x3e5b('0x16')](_0x3e5b('0x11'),_0x3d3b6e,_0x4b189d);_0xeeaabc(_0x4b189d);});});}exports[_0x3e5b('0x19')]=function(_0xff4aba){var _0x24de5b=this;return new Promise(function(_0x1564b5,_0x447d36){return db[_0x3e5b('0x1a')][_0x3e5b('0x1b')](_0xff4aba[_0x3e5b('0x1c')],{'raw':_0xff4aba[_0x3e5b('0x1d')]?_0xff4aba[_0x3e5b('0x1d')][_0x3e5b('0x1e')]===undefined?!![]:![]:!![]})[_0x3e5b('0xf')](function(_0x5b46d4){logger[_0x3e5b('0x10')](_0x3e5b('0x19'),_0xff4aba);logger[_0x3e5b('0x13')](_0x3e5b('0x19'),_0xff4aba,JSON['stringify'](_0x5b46d4));_0x1564b5(_0x5b46d4);})[_0x3e5b('0x1f')](function(_0x5b33bb){logger[_0x3e5b('0x16')](_0x3e5b('0x19'),_0x5b33bb['message'],_0xff4aba);_0x447d36(_0x24de5b[_0x3e5b('0x16')](0x1f4,_0x5b33bb[_0x3e5b('0x17')]));});});};exports[_0x3e5b('0x20')]=function(_0x3c8965){var _0x3bb749=this;return new Promise(function(_0x26c7f2,_0x160e87){return db[_0x3e5b('0x1a')]['update'](_0x3c8965[_0x3e5b('0x1c')],{'raw':_0x3c8965['options']?_0x3c8965[_0x3e5b('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x21')]||null:null,'attributes':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x22')]||null:null,'limit':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x23')]||null:null})[_0x3e5b('0xf')](function(_0x1e1565){logger['info'](_0x3e5b('0x20'),_0x3c8965);logger[_0x3e5b('0x13')](_0x3e5b('0x20'),_0x3c8965,JSON[_0x3e5b('0x15')](_0x1e1565));_0x26c7f2(_0x1e1565);})[_0x3e5b('0x1f')](function(_0x31e9f9){logger[_0x3e5b('0x16')]('UpdateFaxMessage',_0x31e9f9[_0x3e5b('0x17')],_0x3c8965);_0x160e87(_0x3bb749['error'](0x1f4,_0x31e9f9['message']));});});}; \ No newline at end of file +var _0xac31=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where'];(function(_0xb54d45,_0x2c91e4){var _0x278c87=function(_0x5bd168){while(--_0x5bd168){_0xb54d45['push'](_0xb54d45['shift']());}};_0x278c87(++_0x2c91e4);}(_0xac31,0xca));var _0x1ac3=function(_0x435614,_0x4eb186){_0x435614=_0x435614-0x0;var _0x1908fd=_0xac31[_0x435614];return _0x1908fd;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});config[_0x1ac3('0xb')]=_[_0x1ac3('0xc')](config[_0x1ac3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ac3('0xd'))(new Redis(config['redis']));require(_0x1ac3('0xe'))[_0x1ac3('0xf')](socket);function respondWithRpcPromise(_0x344674,_0x53500b,_0xa26c88){return new BPromise(function(_0x1e2642,_0x3e835b){return client[_0x1ac3('0x10')](_0x344674,_0xa26c88)[_0x1ac3('0x11')](function(_0x422d19){logger['info'](_0x1ac3('0x12'),_0x53500b,_0x1ac3('0x13'));logger[_0x1ac3('0x14')](_0x1ac3('0x15'),_0x53500b,'request\x20sent',JSON[_0x1ac3('0x16')](_0x422d19));if(_0x422d19[_0x1ac3('0x17')]){if(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x18')]===0x1f4){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x422d19[_0x1ac3('0x17')]['message']);return _0x3e835b(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);}logger[_0x1ac3('0x17')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);return _0x1e2642(_0x422d19[_0x1ac3('0x17')]['message']);}else{logger[_0x1ac3('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x1ac3('0x13'));_0x1e2642(_0x422d19[_0x1ac3('0x1b')][_0x1ac3('0x19')]);}})[_0x1ac3('0x1c')](function(_0x18b985){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x18b985);_0x3e835b(_0x18b985);});});}exports[_0x1ac3('0x1d')]=function(_0x296abf){var _0x257f60=this;return new Promise(function(_0x5f1918,_0x48d18a){return db[_0x1ac3('0x1e')][_0x1ac3('0x1f')](_0x296abf[_0x1ac3('0x20')],{'raw':_0x296abf[_0x1ac3('0x21')]?_0x296abf[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![]})[_0x1ac3('0x11')](function(_0x10912a){logger[_0x1ac3('0x1a')]('CreateFaxMessage',_0x296abf);logger[_0x1ac3('0x14')](_0x1ac3('0x1d'),_0x296abf,JSON['stringify'](_0x10912a));_0x5f1918(_0x10912a);})[_0x1ac3('0x1c')](function(_0x10f30c){logger['error'](_0x1ac3('0x1d'),_0x10f30c[_0x1ac3('0x19')],_0x296abf);_0x48d18a(_0x257f60[_0x1ac3('0x17')](0x1f4,_0x10f30c[_0x1ac3('0x19')]));});});};exports[_0x1ac3('0x23')]=function(_0x565a0f){var _0x5a2ab2=this;return new Promise(function(_0x503a64,_0x528807){return db['FaxMessage'][_0x1ac3('0x24')](_0x565a0f['body'],{'raw':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f['options'][_0x1ac3('0x25')]||null:null,'attributes':_0x565a0f['options']?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x26')]||null:null,'limit':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x27')]||null:null})[_0x1ac3('0x11')](function(_0x9c17c2){logger['info'](_0x1ac3('0x23'),_0x565a0f);logger[_0x1ac3('0x14')](_0x1ac3('0x23'),_0x565a0f,JSON[_0x1ac3('0x16')](_0x9c17c2));_0x503a64(_0x9c17c2);})['catch'](function(_0x3591a9){logger[_0x1ac3('0x17')](_0x1ac3('0x23'),_0x3591a9[_0x1ac3('0x19')],_0x565a0f);_0x528807(_0x5a2ab2[_0x1ac3('0x17')](0x1f4,_0x3591a9['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index b20e37c..1353e6c 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 _0xac8a=['length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac8a,0x107));var _0xaac8=function(_0x539acb,_0xc1ef6d){_0x539acb=_0x539acb-0x0;var _0x3e912a=_0xac8a[_0x539acb];return _0x3e912a;};'use strict';var FaxMessageEvents=require(_0xaac8('0x0'));var events=[_0xaac8('0x1'),_0xaac8('0x2'),_0xaac8('0x3')];function createListener(_0x433b10,_0x115193){return function(_0x301912){_0x115193[_0xaac8('0x4')](_0x433b10,_0x301912);};}function removeListener(_0x355f62,_0x4b3b7f){return function(){FaxMessageEvents[_0xaac8('0x5')](_0x355f62,_0x4b3b7f);};}exports[_0xaac8('0x6')]=function(_0x1d2709){for(var _0xfdfbcd=0x0,_0x237772=events[_0xaac8('0x7')];_0xfdfbcd<_0x237772;_0xfdfbcd++){var _0x174391=events[_0xfdfbcd];var _0x20dcad=createListener(_0xaac8('0x8')+_0x174391,_0x1d2709);FaxMessageEvents['on'](_0x174391,_0x20dcad);}}; \ No newline at end of file +var _0xac38=['faxMessage:','./faxMessage.events','save','update','emit','removeListener','register','length'];(function(_0x3da0b5,_0x143a55){var _0x5ef5f3=function(_0x366b5f){while(--_0x366b5f){_0x3da0b5['push'](_0x3da0b5['shift']());}};_0x5ef5f3(++_0x143a55);}(_0xac38,0xa9));var _0x8ac3=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0xac38[_0x271060];return _0x40540b;};'use strict';var FaxMessageEvents=require(_0x8ac3('0x0'));var events=[_0x8ac3('0x1'),'remove',_0x8ac3('0x2')];function createListener(_0xb8aafc,_0x2617c5){return function(_0x5beabd){_0x2617c5[_0x8ac3('0x3')](_0xb8aafc,_0x5beabd);};}function removeListener(_0x111f13,_0x586e1c){return function(){FaxMessageEvents[_0x8ac3('0x4')](_0x111f13,_0x586e1c);};}exports[_0x8ac3('0x5')]=function(_0x2ed506){for(var _0x1c1c7b=0x0,_0x280869=events[_0x8ac3('0x6')];_0x1c1c7b<_0x280869;_0x1c1c7b++){var _0x2f389b=events[_0x1c1c7b];var _0x535b44=createListener(_0x8ac3('0x7')+_0x2f389b,_0x2ed506);FaxMessageEvents['on'](_0x2f389b,_0x535b44);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 1b8de4f..b560d21 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 _0x1d2d=['/:id','show','/:id/download','download','post','tracked','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe'];(function(_0x31c201,_0x2f0396){var _0xe880b4=function(_0xc17602){while(--_0xc17602){_0x31c201['push'](_0x31c201['shift']());}};_0xe880b4(++_0x2f0396);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x2a5008,_0x32dd96){_0x2a5008=_0x2a5008-0x0;var _0x3c48cb=_0x1d2d[_0x2a5008];return _0x3c48cb;};'use strict';var multer=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var path=require(_0xd1d2('0x2'));var timeout=require(_0xd1d2('0x3'));var express=require(_0xd1d2('0x4'));var router=express['Router']();var fs_extra=require(_0xd1d2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd1d2('0x6'));var controller=require(_0xd1d2('0x7'));router[_0xd1d2('0x8')]('/',auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xa')]);router[_0xd1d2('0x8')]('/describe',auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xb')]);router[_0xd1d2('0x8')](_0xd1d2('0xc'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xd')]);router[_0xd1d2('0x8')](_0xd1d2('0xe'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xf')]);router[_0xd1d2('0x10')]('/',auth[_0xd1d2('0x9')](),interaction[_0xd1d2('0x11')]('fax',_0xd1d2('0x12')),controller[_0xd1d2('0x13')]);router[_0xd1d2('0x14')](_0xd1d2('0xc'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0x15')]);router[_0xd1d2('0x14')](_0xd1d2('0x16'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0x17')]);router['put'](_0xd1d2('0x18'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0x19')]);router['delete'](_0xd1d2('0xc'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0x1a')]);module[_0xd1d2('0x1b')]=router; \ No newline at end of file +var _0x593e=['../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','show','download','post','fax','faxmessage:create','create','put','/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x330bb0,_0x4f695f){var _0x442278=function(_0x52d830){while(--_0x52d830){_0x330bb0['push'](_0x330bb0['shift']());}};_0x442278(++_0x4f695f);}(_0x593e,0xcb));var _0xe593=function(_0x5d5a32,_0xa07eed){_0x5d5a32=_0x5d5a32-0x0;var _0x3306dd=_0x593e[_0x5d5a32];return _0x3306dd;};'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',auth[_0xe593('0xb')](),controller[_0xe593('0xf')]);router[_0xe593('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xe593('0x10')]);router[_0xe593('0x11')]('/',auth[_0xe593('0xb')](),interaction['tracked'](_0xe593('0x12'),_0xe593('0x13')),controller[_0xe593('0x14')]);router[_0xe593('0x15')](_0xe593('0x16'),auth[_0xe593('0xb')](),controller[_0xe593('0x17')]);router[_0xe593('0x15')](_0xe593('0x18'),auth[_0xe593('0xb')](),controller['accept']);router[_0xe593('0x15')](_0xe593('0x19'),auth['isAuthenticated'](),controller[_0xe593('0x1a')]);router[_0xe593('0x1b')]('/:id',auth[_0xe593('0xb')](),controller[_0xe593('0x1c')]);module[_0xe593('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 1f42e05..3d252e3 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 _0xd2f3=['INTEGER','ENUM','rrmemory','beepall','exports','STRING','name'];(function(_0x52801f,_0x9daaf9){var _0x4243e6=function(_0x4ecc49){while(--_0x4ecc49){_0x52801f['push'](_0x52801f['shift']());}};_0x4243e6(++_0x9daaf9);}(_0xd2f3,0x169));var _0x3d2f=function(_0x1e87da,_0x548496){_0x1e87da=_0x1e87da-0x0;var _0x4d2fd8=_0xd2f3[_0x1e87da];return _0x4d2fd8;};'use strict';var Sequelize=require('sequelize');module[_0x3d2f('0x0')]={'name':{'type':Sequelize[_0x3d2f('0x1')],'unique':_0x3d2f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3d2f('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3d2f('0x4')](_0x3d2f('0x5'),_0x3d2f('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x3d2f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xea05=['STRING','ENUM','rrmemory','beepall','roundrobin','INTEGER','sequelize','exports'];(function(_0x4b61e2,_0x5bf1a4){var _0x1a49c4=function(_0x55e079){while(--_0x55e079){_0x4b61e2['push'](_0x4b61e2['shift']());}};_0x1a49c4(++_0x5bf1a4);}(_0xea05,0x126));var _0x5ea0=function(_0x2c5b58,_0x1ace6d){_0x2c5b58=_0x2c5b58-0x0;var _0x243471=_0xea05[_0x2c5b58];return _0x243471;};'use strict';var Sequelize=require(_0x5ea0('0x0'));module[_0x5ea0('0x1')]={'name':{'type':Sequelize[_0x5ea0('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5ea0('0x3')](_0x5ea0('0x4'),_0x5ea0('0x5'),_0x5ea0('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x5ea0('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 ca6113d..162c621 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 _0x9e76=['filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','params','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','faxPause','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union','value','removeTeams','isEmpty','userFaxQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','FaxQueues','UserProfileResource','stack','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x421c56,_0x4efd00){var _0x49b244=function(_0x5cd079){while(--_0x5cd079){_0x421c56['push'](_0x421c56['shift']());}};_0x49b244(++_0x4efd00);}(_0x9e76,0x1f3));var _0x69e7=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x9e76[_0x25d386];return _0x857f4a;};'use strict';var emlformat=require(_0x69e7('0x0'));var rimraf=require(_0x69e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x69e7('0x2'));var rp=require('request-promise');var moment=require(_0x69e7('0x3'));var BPromise=require(_0x69e7('0x4'));var Mustache=require(_0x69e7('0x5'));var util=require(_0x69e7('0x6'));var path=require(_0x69e7('0x7'));var sox=require('sox');var csv=require(_0x69e7('0x8'));var ejs=require(_0x69e7('0x9'));var fs=require('fs');var fs_extra=require(_0x69e7('0xa'));var _=require(_0x69e7('0xb'));var squel=require(_0x69e7('0xc'));var crypto=require(_0x69e7('0xd'));var jsforce=require(_0x69e7('0xe'));var deskjs=require(_0x69e7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x69e7('0x10'));var Papa=require(_0x69e7('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x69e7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x69e7('0x13'));var logger=require(_0x69e7('0x14'))(_0x69e7('0x15'));var utils=require(_0x69e7('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x69e7('0x17'))['db'];config[_0x69e7('0x18')]=_[_0x69e7('0x19')](config[_0x69e7('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x69e7('0x1a'))(new Redis(config[_0x69e7('0x18')]));require(_0x69e7('0x1b'))[_0x69e7('0x1c')](socket);function respondWithStatusCode(_0x25bfde,_0x4a533c){_0x4a533c=_0x4a533c||0xcc;return function(_0x51bffd){if(_0x51bffd){return _0x25bfde[_0x69e7('0x1d')](_0x4a533c);}return _0x25bfde[_0x69e7('0x1e')](_0x4a533c)[_0x69e7('0x1f')]();};}function respondWithResult(_0x4a8fae,_0x419a3c){_0x419a3c=_0x419a3c||0xc8;return function(_0xd438a6){if(_0xd438a6){return _0x4a8fae[_0x69e7('0x1e')](_0x419a3c)['json'](_0xd438a6);}};}function respondWithFilteredResult(_0x31908e,_0x3b7866){return function(_0x33ddd6){if(_0x33ddd6){var _0x903e0c=typeof _0x3b7866['offset']===_0x69e7('0x20')&&typeof _0x3b7866[_0x69e7('0x21')]===_0x69e7('0x20');var _0x362669=_0x33ddd6[_0x69e7('0x22')];var _0x2076cb=_0x903e0c?0x0:_0x3b7866[_0x69e7('0x23')];var _0x4099cc=_0x903e0c?_0x33ddd6[_0x69e7('0x22')]:_0x3b7866['offset']+_0x3b7866[_0x69e7('0x21')];var _0x5c0a34;if(_0x4099cc>=_0x362669){_0x4099cc=_0x362669;_0x5c0a34=0xc8;}else{_0x5c0a34=0xce;}_0x31908e[_0x69e7('0x1e')](_0x5c0a34);return _0x31908e[_0x69e7('0x24')](_0x69e7('0x25'),_0x2076cb+'-'+_0x4099cc+'/'+_0x362669)['json'](_0x33ddd6);}return null;};}function patchUpdates(_0x175a0f){return function(_0x2344ba){try{jsonpatch[_0x69e7('0x26')](_0x2344ba,_0x175a0f,!![]);}catch(_0x3b5ec5){return BPromise['reject'](_0x3b5ec5);}return _0x2344ba[_0x69e7('0x27')]();};}function saveUpdates(_0x5c03f2,_0x371223){return function(_0x2d207a){if(_0x2d207a){return _0x2d207a[_0x69e7('0x28')](_0x5c03f2)[_0x69e7('0x29')](function(_0x12b90d){return _0x12b90d;});}return null;};}function removeEntity(_0x433db3,_0x1f56a2){return function(_0x4d0072){if(_0x4d0072){return _0x4d0072[_0x69e7('0x2a')]()[_0x69e7('0x29')](function(){var _0x50f69c=_0x4d0072[_0x69e7('0x2b')]({'plain':!![]});var _0x3aaf43=_0x69e7('0x2c');return db[_0x69e7('0x2d')][_0x69e7('0x2a')]({'where':{'type':_0x3aaf43,'resourceId':_0x50f69c['id']}})[_0x69e7('0x29')](function(){return _0x4d0072;});})[_0x69e7('0x29')](function(){_0x433db3[_0x69e7('0x1e')](0xcc)[_0x69e7('0x1f')]();});}};}function handleEntityNotFound(_0x5c94ca,_0x4d5294){return function(_0x13c705){if(!_0x13c705){_0x5c94ca[_0x69e7('0x1d')](0x194);}return _0x13c705;};}function handleError(_0x535326,_0x1060a6){_0x1060a6=_0x1060a6||0x1f4;return function(_0x4b728f){logger['error'](_0x4b728f[_0x69e7('0x2e')]);if(_0x4b728f['name']){delete _0x4b728f['name'];}_0x535326[_0x69e7('0x1e')](_0x1060a6)['send'](_0x4b728f);};}exports[_0x69e7('0x2f')]=function(_0xf23f6,_0x45a7a){var _0x1e12cf={},_0x33bb8b={},_0x2b9899={'count':0x0,'rows':[]};var _0x3fafa5=_[_0x69e7('0x30')](db[_0x69e7('0x31')][_0x69e7('0x32')],function(_0x205dd6){return{'name':_0x205dd6[_0x69e7('0x33')],'type':_0x205dd6[_0x69e7('0x34')][_0x69e7('0x35')]};});_0x33bb8b[_0x69e7('0x36')]=_[_0x69e7('0x30')](_0x3fafa5,_0x69e7('0x37'));_0x33bb8b[_0x69e7('0x38')]=_[_0x69e7('0x39')](_0xf23f6['query']);_0x33bb8b[_0x69e7('0x3a')]=_[_0x69e7('0x3b')](_0x33bb8b[_0x69e7('0x36')],_0x33bb8b['query']);_0x1e12cf['attributes']=_[_0x69e7('0x3b')](_0x33bb8b[_0x69e7('0x36')],qs[_0x69e7('0x3c')](_0xf23f6['query'][_0x69e7('0x3c')]));_0x1e12cf[_0x69e7('0x3d')]=_0x1e12cf[_0x69e7('0x3d')][_0x69e7('0x3e')]?_0x1e12cf[_0x69e7('0x3d')]:_0x33bb8b[_0x69e7('0x36')];if(!_0xf23f6[_0x69e7('0x38')][_0x69e7('0x3f')](_0x69e7('0x40'))){_0x1e12cf[_0x69e7('0x21')]=qs[_0x69e7('0x21')](_0xf23f6[_0x69e7('0x38')][_0x69e7('0x21')]);_0x1e12cf[_0x69e7('0x23')]=qs[_0x69e7('0x23')](_0xf23f6[_0x69e7('0x38')]['offset']);}_0x1e12cf[_0x69e7('0x41')]=qs[_0x69e7('0x42')](_0xf23f6[_0x69e7('0x38')]['sort']);_0x1e12cf[_0x69e7('0x43')]=qs[_0x69e7('0x3a')](_[_0x69e7('0x44')](_0xf23f6[_0x69e7('0x38')],_0x33bb8b[_0x69e7('0x3a')]),_0x3fafa5);if(_0xf23f6[_0x69e7('0x38')][_0x69e7('0x45')]){_0x1e12cf[_0x69e7('0x43')]=_[_0x69e7('0x46')](_0x1e12cf['where'],{'$or':_[_0x69e7('0x30')](_0x3fafa5,function(_0x2280cf){if(_0x2280cf['type']!==_0x69e7('0x47')){var _0x527bd7={};_0x527bd7[_0x2280cf[_0x69e7('0x37')]]={'$like':'%'+_0xf23f6[_0x69e7('0x38')][_0x69e7('0x45')]+'%'};return _0x527bd7;}})});}_0x1e12cf=_[_0x69e7('0x46')]({},_0x1e12cf,_0xf23f6[_0x69e7('0x48')]);var _0x3250f9={'where':_0x1e12cf[_0x69e7('0x43')]};return db['FaxQueue'][_0x69e7('0x22')](_0x3250f9)[_0x69e7('0x29')](function(_0x3900d8){_0x2b9899[_0x69e7('0x22')]=_0x3900d8;if(_0xf23f6['query'][_0x69e7('0x49')]){_0x1e12cf[_0x69e7('0x4a')]=[{'all':!![]}];}return db[_0x69e7('0x31')][_0x69e7('0x4b')](_0x1e12cf);})[_0x69e7('0x29')](function(_0x2561fe){_0x2b9899[_0x69e7('0x4c')]=_0x2561fe;return _0x2b9899;})[_0x69e7('0x29')](respondWithFilteredResult(_0x45a7a,_0x1e12cf))[_0x69e7('0x4d')](handleError(_0x45a7a,null));};exports[_0x69e7('0x4e')]=function(_0x2c91eb,_0x70954f){var _0x3a6181={'raw':!![],'where':{'id':_0x2c91eb['params']['id']}},_0x44df27={};_0x44df27[_0x69e7('0x36')]=_[_0x69e7('0x39')](db[_0x69e7('0x31')]['rawAttributes']);_0x44df27[_0x69e7('0x38')]=_[_0x69e7('0x39')](_0x2c91eb[_0x69e7('0x38')]);_0x44df27['filters']=_[_0x69e7('0x3b')](_0x44df27[_0x69e7('0x36')],_0x44df27['query']);_0x3a6181[_0x69e7('0x3d')]=_[_0x69e7('0x3b')](_0x44df27[_0x69e7('0x36')],qs[_0x69e7('0x3c')](_0x2c91eb[_0x69e7('0x38')][_0x69e7('0x3c')]));_0x3a6181['attributes']=_0x3a6181[_0x69e7('0x3d')]['length']?_0x3a6181[_0x69e7('0x3d')]:_0x44df27[_0x69e7('0x36')];if(_0x2c91eb[_0x69e7('0x38')][_0x69e7('0x49')]){_0x3a6181['include']=[{'all':!![]}];}_0x3a6181=_['merge']({},_0x3a6181,_0x2c91eb[_0x69e7('0x48')]);return db[_0x69e7('0x31')]['find'](_0x3a6181)[_0x69e7('0x29')](handleEntityNotFound(_0x70954f,null))[_0x69e7('0x29')](respondWithResult(_0x70954f,null))[_0x69e7('0x4d')](handleError(_0x70954f,null));};exports[_0x69e7('0x4f')]=function(_0x57ecea,_0x29453){return db[_0x69e7('0x31')][_0x69e7('0x4f')](_0x57ecea[_0x69e7('0x50')],{})['then'](function(_0x562475){var _0x53b445=_0x57ecea['user'][_0x69e7('0x2b')]({'plain':!![]});if(!_0x53b445)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53b445[_0x69e7('0x51')]===_0x69e7('0x52')){var _0x36c445=_0x562475[_0x69e7('0x2b')]({'plain':!![]});var _0x5e8b64=_0x69e7('0x2c');return db[_0x69e7('0x53')][_0x69e7('0x54')]({'where':{'name':_0x5e8b64,'userProfileId':_0x53b445[_0x69e7('0x55')]},'raw':!![]})[_0x69e7('0x29')](function(_0x15bc17){if(_0x15bc17&&_0x15bc17[_0x69e7('0x56')]===0x0){return db['UserProfileResource'][_0x69e7('0x4f')]({'name':_0x36c445[_0x69e7('0x37')],'resourceId':_0x36c445['id'],'type':_0x15bc17['name'],'sectionId':_0x15bc17['id']},{})[_0x69e7('0x29')](function(){return _0x562475;});}else{return _0x562475;}})[_0x69e7('0x4d')](function(_0x4caa11){logger[_0x69e7('0x57')](_0x69e7('0x58'),_0x4caa11);throw _0x4caa11;});}return _0x562475;})[_0x69e7('0x29')](respondWithResult(_0x29453,0xc9))[_0x69e7('0x4d')](handleError(_0x29453,null));};exports['update']=function(_0x4ef2d3,_0x1a8bdb){if(_0x4ef2d3[_0x69e7('0x50')]['id']){delete _0x4ef2d3[_0x69e7('0x50')]['id'];}return db[_0x69e7('0x31')][_0x69e7('0x54')]({'where':{'id':_0x4ef2d3['params']['id']}})[_0x69e7('0x29')](handleEntityNotFound(_0x1a8bdb,null))[_0x69e7('0x29')](saveUpdates(_0x4ef2d3['body'],null))[_0x69e7('0x29')](respondWithResult(_0x1a8bdb,null))[_0x69e7('0x4d')](handleError(_0x1a8bdb,null));};exports['destroy']=function(_0x1bc2f4,_0x19e871){return db[_0x69e7('0x31')][_0x69e7('0x54')]({'where':{'id':_0x1bc2f4['params']['id']}})['then'](handleEntityNotFound(_0x19e871,null))[_0x69e7('0x29')](removeEntity(_0x19e871,null))[_0x69e7('0x4d')](handleError(_0x19e871,null));};exports['describe']=function(_0x12940c,_0x4e37cd){return db[_0x69e7('0x31')][_0x69e7('0x59')]()[_0x69e7('0x29')](respondWithResult(_0x4e37cd,null))[_0x69e7('0x4d')](handleError(_0x4e37cd,null));};exports['getMembers']=function(_0x52883b,_0x9fd0a3,_0x198ff1){var _0x7d3c7b={'raw':!![],'where':{}},_0x24e0bc={},_0x5053bc;return db[_0x69e7('0x31')][_0x69e7('0x5a')]({'where':{'id':_0x52883b[_0x69e7('0x5b')]['id']}})['then'](handleEntityNotFound(_0x9fd0a3,null))[_0x69e7('0x29')](function(_0x12a06f){if(_0x12a06f){_0x5053bc=_0x12a06f[_0x69e7('0x2b')]({'plain':!![]});_0x24e0bc[_0x69e7('0x36')]=_['keys'](db[_0x69e7('0x5c')][_0x69e7('0x32')]);_0x24e0bc[_0x69e7('0x38')]=_[_0x69e7('0x39')](_0x52883b[_0x69e7('0x38')]);_0x24e0bc[_0x69e7('0x3a')]=_['intersection'](_0x24e0bc[_0x69e7('0x36')],_0x24e0bc[_0x69e7('0x38')]);_0x7d3c7b['attributes']=_[_0x69e7('0x3b')](_0x24e0bc[_0x69e7('0x36')],qs['fields'](_0x52883b[_0x69e7('0x38')][_0x69e7('0x3c')]));_0x7d3c7b[_0x69e7('0x3d')]=_0x7d3c7b[_0x69e7('0x3d')][_0x69e7('0x3e')]?_0x7d3c7b[_0x69e7('0x3d')]:_0x24e0bc['model'];if(!_0x52883b['query'][_0x69e7('0x3f')]('nolimit')){_0x7d3c7b[_0x69e7('0x21')]=qs[_0x69e7('0x21')](_0x52883b[_0x69e7('0x38')]['limit']);_0x7d3c7b[_0x69e7('0x23')]=qs[_0x69e7('0x23')](_0x52883b[_0x69e7('0x38')]['offset']);}_0x7d3c7b[_0x69e7('0x41')]=qs['sort'](_0x52883b[_0x69e7('0x38')][_0x69e7('0x42')]);_0x7d3c7b[_0x69e7('0x43')]=qs['filters'](_['pick'](_0x52883b[_0x69e7('0x38')],_0x24e0bc['filters']));_0x7d3c7b[_0x69e7('0x43')][_0x69e7('0x5d')]=_0x12a06f['id'];if(_0x52883b[_0x69e7('0x38')][_0x69e7('0x45')]){_0x7d3c7b[_0x69e7('0x43')]=_[_0x69e7('0x46')](_0x7d3c7b[_0x69e7('0x43')],{'$or':_['map'](_0x7d3c7b[_0x69e7('0x3d')],function(_0x4016ff){var _0x1fc2df={};_0x1fc2df[_0x4016ff]={'$like':'%'+_0x52883b[_0x69e7('0x38')][_0x69e7('0x45')]+'%'};return _0x1fc2df;})});}_0x7d3c7b=_['merge']({},_0x7d3c7b,_0x52883b[_0x69e7('0x48')]);return db[_0x69e7('0x5c')][_0x69e7('0x4b')](_0x7d3c7b);}})[_0x69e7('0x29')](function(_0x1b9c56){if(_0x1b9c56){return db[_0x69e7('0x5e')][_0x69e7('0x5f')]({'where':{'id':_[_0x69e7('0x30')](_0x1b9c56,_0x69e7('0x60')),'role':_0x69e7('0x61')},'attributes':['id','name','faxPause',_0x69e7('0x62'),'createdAt']});}})[_0x69e7('0x29')](function(_0x4e718e){if(_0x4e718e){return{'count':_0x4e718e[_0x69e7('0x22')],'rows':_[_0x69e7('0x30')](_0x4e718e[_0x69e7('0x4c')],function(_0x1cea82){return{'membername':_0x1cea82[_0x69e7('0x37')],'UserId':_0x1cea82['id'],'queue_name':_0x5053bc[_0x69e7('0x37')],'FaxQueueId':_0x5053bc['id'],'interface':util[_0x69e7('0x63')](_0x69e7('0x64'),'SIP',_0x1cea82['name']),'penalty':0x0,'paused':_0x1cea82[_0x69e7('0x65')],'createdAt':_0x1cea82[_0x69e7('0x66')],'updatedAt':_0x1cea82[_0x69e7('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x69e7('0x29')](respondWithFilteredResult(_0x9fd0a3,_0x7d3c7b))[_0x69e7('0x4d')](handleError(_0x9fd0a3,null));};exports[_0x69e7('0x67')]=function(_0xf7a16,_0x3458b1,_0x56da91){var _0x1aec46={};var _0x3db0fc={};var _0x554027;var _0x54d79e;return db[_0x69e7('0x31')][_0x69e7('0x5a')]({'where':{'id':_0xf7a16[_0x69e7('0x5b')]['id']}})[_0x69e7('0x29')](handleEntityNotFound(_0x3458b1,null))['then'](function(_0x20d680){if(_0x20d680){_0x554027=_0x20d680;_0x3db0fc[_0x69e7('0x36')]=_[_0x69e7('0x39')](db[_0x69e7('0x68')][_0x69e7('0x32')]);_0x3db0fc[_0x69e7('0x38')]=_[_0x69e7('0x39')](_0xf7a16[_0x69e7('0x38')]);_0x3db0fc[_0x69e7('0x3a')]=_[_0x69e7('0x3b')](_0x3db0fc[_0x69e7('0x36')],_0x3db0fc[_0x69e7('0x38')]);_0x1aec46['attributes']=_[_0x69e7('0x3b')](_0x3db0fc[_0x69e7('0x36')],qs[_0x69e7('0x3c')](_0xf7a16[_0x69e7('0x38')][_0x69e7('0x3c')]));_0x1aec46[_0x69e7('0x3d')]=_0x1aec46[_0x69e7('0x3d')][_0x69e7('0x3e')]?_0x1aec46['attributes']:_0x3db0fc[_0x69e7('0x36')];_0x1aec46['order']=qs[_0x69e7('0x42')](_0xf7a16[_0x69e7('0x38')][_0x69e7('0x42')]);_0x1aec46[_0x69e7('0x43')]=qs['filters'](_['pick'](_0xf7a16[_0x69e7('0x38')],_0x3db0fc[_0x69e7('0x3a')]));if(_0xf7a16['query'][_0x69e7('0x45')]){_0x1aec46[_0x69e7('0x43')]=_[_0x69e7('0x46')](_0x1aec46[_0x69e7('0x43')],{'$or':_[_0x69e7('0x30')](_0x1aec46[_0x69e7('0x3d')],function(_0x5728a6){var _0x51d0fc={};_0x51d0fc[_0x5728a6]={'$like':'%'+_0xf7a16[_0x69e7('0x38')]['filter']+'%'};return _0x51d0fc;})});}_0x1aec46=_['merge']({},_0x1aec46,_0xf7a16[_0x69e7('0x48')]);return _0x554027[_0x69e7('0x67')](_0x1aec46);}})['then'](function(_0x3ec8e9){if(_0x3ec8e9){_0x54d79e=_0x3ec8e9[_0x69e7('0x3e')];if(!_0xf7a16[_0x69e7('0x38')][_0x69e7('0x3f')](_0x69e7('0x40'))){_0x1aec46[_0x69e7('0x21')]=qs['limit'](_0xf7a16[_0x69e7('0x38')][_0x69e7('0x21')]);_0x1aec46[_0x69e7('0x23')]=qs[_0x69e7('0x23')](_0xf7a16[_0x69e7('0x38')]['offset']);}return _0x554027[_0x69e7('0x67')](_0x1aec46);}})[_0x69e7('0x29')](function(_0x2e8f6e){if(_0x2e8f6e){return _0x2e8f6e?{'count':_0x54d79e,'rows':_0x2e8f6e}:null;}})[_0x69e7('0x29')](respondWithResult(_0x3458b1,null))[_0x69e7('0x4d')](handleError(_0x3458b1,null));};exports[_0x69e7('0x69')]=function(_0x2020b5,_0x85aa15,_0x15f947){var _0x5ad883=_0x2020b5[_0x69e7('0x50')][_0x69e7('0x6a')];return db['Team'][_0x69e7('0x4b')]({'where':{'id':_0x5ad883},'attributes':['id'],'include':[{'model':db[_0x69e7('0x5e')],'as':_0x69e7('0x6b'),'attributes':['id',_0x69e7('0x37'),_0x69e7('0x6c'),_0x69e7('0x6d'),_0x69e7('0x6e')],'raw':!![]}]})['then'](function(_0x42fa8e){if(_0x42fa8e){var _0x5e4b9e=_['flatMap'](_0x42fa8e,function(_0x24dc61){var _0x3112ac=_0x24dc61[_0x69e7('0x2b')]({'plain':!![]});return _0x3112ac['Agents'];});return db[_0x69e7('0x31')][_0x69e7('0x54')]({'where':{'id':_0x2020b5[_0x69e7('0x5b')]['id']}})[_0x69e7('0x29')](function(_0x17e64e){return db[_0x69e7('0x6f')][_0x69e7('0x70')](function(_0x4b4d8d){return _0x17e64e[_0x69e7('0x69')](_0x5ad883,{'transaction':_0x4b4d8d})[_0x69e7('0x29')](function(){return BPromise[_0x69e7('0x71')](_0x5e4b9e,function(_0x204fcc){return db['UserFaxQueue'][_0x69e7('0x72')]({'where':{'UserId':_0x204fcc['id'],'FaxQueueId':_0x2020b5[_0x69e7('0x5b')]['id']},'transaction':_0x4b4d8d});});})['then'](function(){_0x5e4b9e[_0x69e7('0x73')](function(_0x2a8f89){socket[_0x69e7('0x74')](_0x69e7('0x75'),{'UserId':_0x2a8f89['id'],'FaxQueueId':_0x17e64e['id']});});});});});}})['then'](respondWithStatusCode(_0x85aa15,null))[_0x69e7('0x4d')](handleError(_0x85aa15,null));};exports['removeTeams']=function(_0x887c13,_0x2c1b51,_0x3013b6){return db[_0x69e7('0x68')][_0x69e7('0x4b')]({'where':{'id':_0x887c13[_0x69e7('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x69e7('0x5e')],'as':_0x69e7('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x69e7('0x29')](handleEntityNotFound(_0x2c1b51,null))[_0x69e7('0x29')](function(_0x4f8bab){var _0x282dfa=_[_0x69e7('0x30')](_0x4f8bab,'id');var _0x1fcb01=[];var _0x510b00=[];var _0x291790=squel['select']();_0x291790[_0x69e7('0x76')](_0x69e7('0x77'))[_0x69e7('0x78')](_0x69e7('0x79'),'tq')['join'](_0x69e7('0x7a'),'ut',_0x69e7('0x7b'))[_0x69e7('0x43')]('FaxQueueId\x20=\x20?',_0x887c13[_0x69e7('0x5b')]['id']);for(var _0x27e8b8=0x0;_0x27e8b8<_0x4f8bab[_0x69e7('0x3e')];_0x27e8b8+=0x1){let _0xe057f3=_0x4f8bab[_0x27e8b8];for(var _0x55bef6=0x0;_0x55bef6<_0xe057f3[_0x69e7('0x6b')]['length'];_0x55bef6+=0x1){let _0xd7fe62=_0xe057f3['Agents'][_0x55bef6];var _0x27d3bc=_0x291790[_0x69e7('0x7c')]();_0x27d3bc[_0x69e7('0x43')](_0x69e7('0x7d'),_0xd7fe62['id']);_0x510b00[_0x69e7('0x7e')](db[_0x69e7('0x6f')][_0x69e7('0x38')](_0x27d3bc[_0x69e7('0x7f')](),{'type':db['sequelize'][_0x69e7('0x80')][_0x69e7('0x81')]})[_0x69e7('0x29')](function(_0x4446f8){if(_0x4446f8[_0x69e7('0x3e')]===0x1){return _0xd7fe62['id'];}else{var _0x27aaab=_[_0x69e7('0x82')](_['map'](_0x4446f8,'TeamId'),function(_0x5ef3a7){return _[_0x69e7('0x83')](_0x282dfa,_0x5ef3a7);});if(_0x27aaab){return _0xd7fe62['id'];}}}));}}return BPromise['all'](_0x510b00)[_0x69e7('0x29')](function(_0x37cf03){_0x1fcb01=_(_0x1fcb01)[_0x69e7('0x84')](_0x37cf03)['compact']()[_0x69e7('0x85')]();return db[_0x69e7('0x31')][_0x69e7('0x54')]({'where':{'id':_0x887c13[_0x69e7('0x5b')]['id']}})[_0x69e7('0x29')](function(_0x591d3a){return db[_0x69e7('0x6f')][_0x69e7('0x70')](function(_0x62505c){return _0x591d3a[_0x69e7('0x86')](_0x887c13[_0x69e7('0x38')][_0x69e7('0x6a')],{'transaction':_0x62505c})[_0x69e7('0x29')](function(){if(!_[_0x69e7('0x87')](_0x1fcb01)){return _0x591d3a['removeAgents'](_0x1fcb01,{'transaction':_0x62505c});}})[_0x69e7('0x29')](function(){_0x1fcb01['forEach'](function(_0x31cf75){socket[_0x69e7('0x74')](_0x69e7('0x88'),{'UserId':_0x31cf75,'FaxQueueId':_0x591d3a['id']});});});});});});})[_0x69e7('0x29')](respondWithStatusCode(_0x2c1b51,null))[_0x69e7('0x4d')](handleError(_0x2c1b51,null));};exports[_0x69e7('0x89')]=function(_0x1f39be,_0x26d56a,_0x59e3c4){return db['FaxQueue'][_0x69e7('0x54')]({'where':{'id':_0x1f39be[_0x69e7('0x5b')]['id']}})[_0x69e7('0x29')](handleEntityNotFound(_0x26d56a,null))[_0x69e7('0x29')](function(_0x417bed){if(_0x417bed){return _0x417bed[_0x69e7('0x89')](_0x1f39be[_0x69e7('0x50')][_0x69e7('0x6a')],_[_0x69e7('0x8a')](_0x1f39be['body'],[_0x69e7('0x6a'),'id'])||{})['spread'](function(_0x14cd08){for(var _0x407fbf=0x0;_0x407fbf<_0x1f39be[_0x69e7('0x50')][_0x69e7('0x6a')]['length'];_0x407fbf+=0x1){socket[_0x69e7('0x74')]('userFaxQueue:save',{'UserId':Number(_0x1f39be['body'][_0x69e7('0x6a')][_0x407fbf]),'FaxQueueId':Number(_0x1f39be[_0x69e7('0x5b')]['id'])});}return _0x14cd08;});}})[_0x69e7('0x29')](respondWithResult(_0x26d56a,null))[_0x69e7('0x4d')](handleError(_0x26d56a,null));};exports[_0x69e7('0x8b')]=function(_0x3274f0,_0x483657,_0x302049){return db[_0x69e7('0x31')][_0x69e7('0x54')]({'where':{'id':_0x3274f0['params']['id']}})[_0x69e7('0x29')](handleEntityNotFound(_0x483657,null))[_0x69e7('0x29')](function(_0x1988ba){if(_0x1988ba){return _0x1988ba[_0x69e7('0x8b')](_0x3274f0[_0x69e7('0x38')]['ids'])['then'](function(){if(_[_0x69e7('0x8c')](_0x3274f0[_0x69e7('0x38')][_0x69e7('0x6a')])){for(var _0xd3a0d4=0x0;_0xd3a0d4<_0x3274f0[_0x69e7('0x38')]['ids'][_0x69e7('0x3e')];_0xd3a0d4+=0x1){socket[_0x69e7('0x74')](_0x69e7('0x88'),{'UserId':Number(_0x3274f0['query']['ids'][_0xd3a0d4]),'FaxQueueId':Number(_0x3274f0[_0x69e7('0x5b')]['id'])});}}else{socket[_0x69e7('0x74')](_0x69e7('0x88'),{'UserId':Number(_0x3274f0[_0x69e7('0x38')][_0x69e7('0x6a')]),'FaxQueueId':Number(_0x3274f0[_0x69e7('0x5b')]['id'])});}});}})[_0x69e7('0x29')](respondWithStatusCode(_0x483657,null))[_0x69e7('0x4d')](handleError(_0x483657,null));};exports[_0x69e7('0x8d')]=function(_0x3fcd95,_0x579f22,_0x6a85de){var _0x15cfbc={};var _0x5328c7={};var _0x2b18b0;var _0x2e6071;return db['FaxQueue'][_0x69e7('0x5a')]({'where':{'id':_0x3fcd95[_0x69e7('0x5b')]['id']}})[_0x69e7('0x29')](handleEntityNotFound(_0x579f22,null))[_0x69e7('0x29')](function(_0x24b241){if(_0x24b241){_0x2b18b0=_0x24b241;_0x5328c7[_0x69e7('0x36')]=_[_0x69e7('0x39')](db[_0x69e7('0x5e')]['rawAttributes']);_0x5328c7[_0x69e7('0x38')]=_[_0x69e7('0x39')](_0x3fcd95[_0x69e7('0x38')]);_0x5328c7[_0x69e7('0x3a')]=_[_0x69e7('0x3b')](_0x5328c7[_0x69e7('0x36')],_0x5328c7[_0x69e7('0x38')]);_0x15cfbc[_0x69e7('0x3d')]=_['intersection'](_0x5328c7[_0x69e7('0x36')],qs[_0x69e7('0x3c')](_0x3fcd95['query'][_0x69e7('0x3c')]));_0x15cfbc[_0x69e7('0x3d')]=_0x15cfbc[_0x69e7('0x3d')][_0x69e7('0x3e')]?_0x15cfbc['attributes']:_0x5328c7[_0x69e7('0x36')];_0x15cfbc[_0x69e7('0x41')]=qs[_0x69e7('0x42')](_0x3fcd95['query'][_0x69e7('0x42')]);_0x15cfbc[_0x69e7('0x43')]=qs[_0x69e7('0x3a')](_[_0x69e7('0x44')](_0x3fcd95[_0x69e7('0x38')],_0x5328c7[_0x69e7('0x3a')]));if(_0x3fcd95[_0x69e7('0x38')][_0x69e7('0x45')]){_0x15cfbc[_0x69e7('0x43')]=_[_0x69e7('0x46')](_0x15cfbc['where'],{'$or':_['map'](_0x15cfbc[_0x69e7('0x3d')],function(_0x333da5){var _0x22d1ff={};_0x22d1ff[_0x333da5]={'$like':'%'+_0x3fcd95[_0x69e7('0x38')][_0x69e7('0x45')]+'%'};return _0x22d1ff;})});}_0x15cfbc=_[_0x69e7('0x46')]({},_0x15cfbc,_0x3fcd95[_0x69e7('0x48')]);return _0x2b18b0[_0x69e7('0x8d')](_0x15cfbc);}})['then'](function(_0x354a44){if(_0x354a44){_0x2e6071=_0x354a44['length'];if(!_0x3fcd95[_0x69e7('0x38')]['hasOwnProperty'](_0x69e7('0x40'))){_0x15cfbc[_0x69e7('0x21')]=qs[_0x69e7('0x21')](_0x3fcd95[_0x69e7('0x38')][_0x69e7('0x21')]);_0x15cfbc[_0x69e7('0x23')]=qs[_0x69e7('0x23')](_0x3fcd95[_0x69e7('0x38')][_0x69e7('0x23')]);}return _0x2b18b0['getAgents'](_0x15cfbc);}})[_0x69e7('0x29')](function(_0x2f6d8d){if(_0x2f6d8d){return _0x2f6d8d?{'count':_0x2e6071,'rows':_0x2f6d8d}:null;}})[_0x69e7('0x29')](respondWithResult(_0x579f22,null))[_0x69e7('0x4d')](handleError(_0x579f22,null));}; \ No newline at end of file +var _0xef61=['agent','faxPause','createdAt','format','%s/%s','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','emit','userFaxQueue:save','select','field','from','team_has_fax_queues','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','every','TeamId','all','union','compact','value','removeTeams','isEmpty','forEach','addAgents','omit','spread','removeAgents','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','FaxQueues','UserProfileResource','error','name','send','map','FaxQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','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','update','params','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','findAll','User','findAndCountAll','UserId'];(function(_0x17fc01,_0x29dd67){var _0x26f459=function(_0x283f48){while(--_0x283f48){_0x17fc01['push'](_0x17fc01['shift']());}};_0x26f459(++_0x29dd67);}(_0xef61,0x148));var _0x1ef6=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0xef61[_0x2543d6];return _0x55213c;};'use strict';var emlformat=require(_0x1ef6('0x0'));var rimraf=require(_0x1ef6('0x1'));var zipdir=require(_0x1ef6('0x2'));var jsonpatch=require(_0x1ef6('0x3'));var rp=require(_0x1ef6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1ef6('0x5'));var path=require(_0x1ef6('0x6'));var sox=require(_0x1ef6('0x7'));var csv=require(_0x1ef6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ef6('0x9'));var _=require(_0x1ef6('0xa'));var squel=require(_0x1ef6('0xb'));var crypto=require(_0x1ef6('0xc'));var jsforce=require(_0x1ef6('0xd'));var deskjs=require(_0x1ef6('0xe'));var toCsv=require(_0x1ef6('0x8'));var querystring=require(_0x1ef6('0xf'));var Papa=require('papaparse');var Redis=require(_0x1ef6('0x10'));var authService=require(_0x1ef6('0x11'));var qs=require(_0x1ef6('0x12'));var as=require(_0x1ef6('0x13'));var hardwareService=require(_0x1ef6('0x14'));var logger=require('../../config/logger')(_0x1ef6('0x15'));var utils=require(_0x1ef6('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1ef6('0x17'))['db'];config[_0x1ef6('0x18')]=_[_0x1ef6('0x19')](config[_0x1ef6('0x18')],{'host':_0x1ef6('0x1a'),'port':0x18eb});var socket=require(_0x1ef6('0x1b'))(new Redis(config['redis']));require(_0x1ef6('0x1c'))[_0x1ef6('0x1d')](socket);function respondWithStatusCode(_0x8e23f0,_0x13e53c){_0x13e53c=_0x13e53c||0xcc;return function(_0x2da420){if(_0x2da420){return _0x8e23f0[_0x1ef6('0x1e')](_0x13e53c);}return _0x8e23f0[_0x1ef6('0x1f')](_0x13e53c)[_0x1ef6('0x20')]();};}function respondWithResult(_0x463bc4,_0x1694b0){_0x1694b0=_0x1694b0||0xc8;return function(_0x19656c){if(_0x19656c){return _0x463bc4['status'](_0x1694b0)['json'](_0x19656c);}};}function respondWithFilteredResult(_0x4c00e2,_0x483c04){return function(_0x2b1fb6){if(_0x2b1fb6){var _0x4f5194=typeof _0x483c04[_0x1ef6('0x21')]===_0x1ef6('0x22')&&typeof _0x483c04[_0x1ef6('0x23')]===_0x1ef6('0x22');var _0x5ab6b8=_0x2b1fb6['count'];var _0x1e826f=_0x4f5194?0x0:_0x483c04['offset'];var _0x22b728=_0x4f5194?_0x2b1fb6[_0x1ef6('0x24')]:_0x483c04['offset']+_0x483c04['limit'];var _0x1aa2d7;if(_0x22b728>=_0x5ab6b8){_0x22b728=_0x5ab6b8;_0x1aa2d7=0xc8;}else{_0x1aa2d7=0xce;}_0x4c00e2[_0x1ef6('0x1f')](_0x1aa2d7);return _0x4c00e2[_0x1ef6('0x25')](_0x1ef6('0x26'),_0x1e826f+'-'+_0x22b728+'/'+_0x5ab6b8)['json'](_0x2b1fb6);}return null;};}function patchUpdates(_0x38f8e5){return function(_0x9ff29e){try{jsonpatch[_0x1ef6('0x27')](_0x9ff29e,_0x38f8e5,!![]);}catch(_0x29b57d){return BPromise[_0x1ef6('0x28')](_0x29b57d);}return _0x9ff29e[_0x1ef6('0x29')]();};}function saveUpdates(_0x29379a,_0x573086){return function(_0x4dd55d){if(_0x4dd55d){return _0x4dd55d['update'](_0x29379a)['then'](function(_0xa6381a){return _0xa6381a;});}return null;};}function removeEntity(_0x2854ce,_0x599509){return function(_0x1bef26){if(_0x1bef26){return _0x1bef26[_0x1ef6('0x2a')]()[_0x1ef6('0x2b')](function(){var _0x325e21=_0x1bef26[_0x1ef6('0x2c')]({'plain':!![]});var _0x3c16c3=_0x1ef6('0x2d');return db[_0x1ef6('0x2e')][_0x1ef6('0x2a')]({'where':{'type':_0x3c16c3,'resourceId':_0x325e21['id']}})['then'](function(){return _0x1bef26;});})[_0x1ef6('0x2b')](function(){_0x2854ce[_0x1ef6('0x1f')](0xcc)[_0x1ef6('0x20')]();});}};}function handleEntityNotFound(_0xae4a49,_0x5c87e8){return function(_0x4464e7){if(!_0x4464e7){_0xae4a49[_0x1ef6('0x1e')](0x194);}return _0x4464e7;};}function handleError(_0xb7bb8a,_0x1c8ef6){_0x1c8ef6=_0x1c8ef6||0x1f4;return function(_0x393d3d){logger[_0x1ef6('0x2f')](_0x393d3d['stack']);if(_0x393d3d[_0x1ef6('0x30')]){delete _0x393d3d[_0x1ef6('0x30')];}_0xb7bb8a[_0x1ef6('0x1f')](_0x1c8ef6)[_0x1ef6('0x31')](_0x393d3d);};}exports['index']=function(_0x357480,_0x5e60ca){var _0x50f766={},_0x108f79={},_0x59eb17={'count':0x0,'rows':[]};var _0x1c53da=_[_0x1ef6('0x32')](db[_0x1ef6('0x33')][_0x1ef6('0x34')],function(_0x49ebbe){return{'name':_0x49ebbe['fieldName'],'type':_0x49ebbe[_0x1ef6('0x35')][_0x1ef6('0x36')]};});_0x108f79[_0x1ef6('0x37')]=_[_0x1ef6('0x32')](_0x1c53da,'name');_0x108f79[_0x1ef6('0x38')]=_[_0x1ef6('0x39')](_0x357480[_0x1ef6('0x38')]);_0x108f79[_0x1ef6('0x3a')]=_[_0x1ef6('0x3b')](_0x108f79[_0x1ef6('0x37')],_0x108f79[_0x1ef6('0x38')]);_0x50f766[_0x1ef6('0x3c')]=_[_0x1ef6('0x3b')](_0x108f79[_0x1ef6('0x37')],qs['fields'](_0x357480[_0x1ef6('0x38')][_0x1ef6('0x3d')]));_0x50f766[_0x1ef6('0x3c')]=_0x50f766[_0x1ef6('0x3c')][_0x1ef6('0x3e')]?_0x50f766['attributes']:_0x108f79[_0x1ef6('0x37')];if(!_0x357480[_0x1ef6('0x38')][_0x1ef6('0x3f')](_0x1ef6('0x40'))){_0x50f766[_0x1ef6('0x23')]=qs[_0x1ef6('0x23')](_0x357480['query'][_0x1ef6('0x23')]);_0x50f766[_0x1ef6('0x21')]=qs['offset'](_0x357480['query'][_0x1ef6('0x21')]);}_0x50f766[_0x1ef6('0x41')]=qs[_0x1ef6('0x42')](_0x357480['query']['sort']);_0x50f766[_0x1ef6('0x43')]=qs[_0x1ef6('0x3a')](_[_0x1ef6('0x44')](_0x357480[_0x1ef6('0x38')],_0x108f79[_0x1ef6('0x3a')]),_0x1c53da);if(_0x357480[_0x1ef6('0x38')]['filter']){_0x50f766[_0x1ef6('0x43')]=_[_0x1ef6('0x45')](_0x50f766[_0x1ef6('0x43')],{'$or':_[_0x1ef6('0x32')](_0x1c53da,function(_0x217189){if(_0x217189[_0x1ef6('0x35')]!==_0x1ef6('0x46')){var _0x53fad3={};_0x53fad3[_0x217189[_0x1ef6('0x30')]]={'$like':'%'+_0x357480[_0x1ef6('0x38')][_0x1ef6('0x47')]+'%'};return _0x53fad3;}})});}_0x50f766=_[_0x1ef6('0x45')]({},_0x50f766,_0x357480['options']);var _0x17d68e={'where':_0x50f766[_0x1ef6('0x43')]};return db[_0x1ef6('0x33')]['count'](_0x17d68e)['then'](function(_0x2cdef4){_0x59eb17['count']=_0x2cdef4;if(_0x357480[_0x1ef6('0x38')][_0x1ef6('0x48')]){_0x50f766[_0x1ef6('0x49')]=[{'all':!![]}];}return db[_0x1ef6('0x33')]['findAll'](_0x50f766);})['then'](function(_0x5edf78){_0x59eb17[_0x1ef6('0x4a')]=_0x5edf78;return _0x59eb17;})[_0x1ef6('0x2b')](respondWithFilteredResult(_0x5e60ca,_0x50f766))[_0x1ef6('0x4b')](handleError(_0x5e60ca,null));};exports[_0x1ef6('0x4c')]=function(_0xd0cdc6,_0x37ecd3){var _0x35962a={'raw':!![],'where':{'id':_0xd0cdc6['params']['id']}},_0x24d8e3={};_0x24d8e3[_0x1ef6('0x37')]=_[_0x1ef6('0x39')](db[_0x1ef6('0x33')]['rawAttributes']);_0x24d8e3[_0x1ef6('0x38')]=_['keys'](_0xd0cdc6[_0x1ef6('0x38')]);_0x24d8e3['filters']=_['intersection'](_0x24d8e3[_0x1ef6('0x37')],_0x24d8e3[_0x1ef6('0x38')]);_0x35962a[_0x1ef6('0x3c')]=_[_0x1ef6('0x3b')](_0x24d8e3[_0x1ef6('0x37')],qs[_0x1ef6('0x3d')](_0xd0cdc6['query'][_0x1ef6('0x3d')]));_0x35962a[_0x1ef6('0x3c')]=_0x35962a[_0x1ef6('0x3c')]['length']?_0x35962a['attributes']:_0x24d8e3['model'];if(_0xd0cdc6[_0x1ef6('0x38')][_0x1ef6('0x48')]){_0x35962a[_0x1ef6('0x49')]=[{'all':!![]}];}_0x35962a=_[_0x1ef6('0x45')]({},_0x35962a,_0xd0cdc6[_0x1ef6('0x4d')]);return db[_0x1ef6('0x33')][_0x1ef6('0x4e')](_0x35962a)[_0x1ef6('0x2b')](handleEntityNotFound(_0x37ecd3,null))[_0x1ef6('0x2b')](respondWithResult(_0x37ecd3,null))[_0x1ef6('0x4b')](handleError(_0x37ecd3,null));};exports[_0x1ef6('0x4f')]=function(_0x51876c,_0x2146c7){return db[_0x1ef6('0x33')][_0x1ef6('0x4f')](_0x51876c[_0x1ef6('0x50')],{})[_0x1ef6('0x2b')](function(_0x9b9494){var _0x3e4fbf=_0x51876c[_0x1ef6('0x51')]['get']({'plain':!![]});if(!_0x3e4fbf)throw new Error(_0x1ef6('0x52'));if(_0x3e4fbf[_0x1ef6('0x53')]===_0x1ef6('0x51')){var _0x50d6b2=_0x9b9494['get']({'plain':!![]});var _0x17df7d=_0x1ef6('0x2d');return db[_0x1ef6('0x54')][_0x1ef6('0x4e')]({'where':{'name':_0x17df7d,'userProfileId':_0x3e4fbf[_0x1ef6('0x55')]},'raw':!![]})[_0x1ef6('0x2b')](function(_0x251057){if(_0x251057&&_0x251057['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x50d6b2[_0x1ef6('0x30')],'resourceId':_0x50d6b2['id'],'type':_0x251057[_0x1ef6('0x30')],'sectionId':_0x251057['id']},{})[_0x1ef6('0x2b')](function(){return _0x9b9494;});}else{return _0x9b9494;}})[_0x1ef6('0x4b')](function(_0x3fde65){logger[_0x1ef6('0x2f')](_0x1ef6('0x56'),_0x3fde65);throw _0x3fde65;});}return _0x9b9494;})['then'](respondWithResult(_0x2146c7,0xc9))[_0x1ef6('0x4b')](handleError(_0x2146c7,null));};exports[_0x1ef6('0x57')]=function(_0x517db0,_0x75cbfd){if(_0x517db0[_0x1ef6('0x50')]['id']){delete _0x517db0[_0x1ef6('0x50')]['id'];}return db[_0x1ef6('0x33')]['find']({'where':{'id':_0x517db0[_0x1ef6('0x58')]['id']}})[_0x1ef6('0x2b')](handleEntityNotFound(_0x75cbfd,null))[_0x1ef6('0x2b')](saveUpdates(_0x517db0[_0x1ef6('0x50')],null))[_0x1ef6('0x2b')](respondWithResult(_0x75cbfd,null))[_0x1ef6('0x4b')](handleError(_0x75cbfd,null));};exports[_0x1ef6('0x2a')]=function(_0xc79646,_0x310784){return db['FaxQueue'][_0x1ef6('0x4e')]({'where':{'id':_0xc79646[_0x1ef6('0x58')]['id']}})['then'](handleEntityNotFound(_0x310784,null))[_0x1ef6('0x2b')](removeEntity(_0x310784,null))[_0x1ef6('0x4b')](handleError(_0x310784,null));};exports[_0x1ef6('0x59')]=function(_0x709ed2,_0x45ae7d){return db[_0x1ef6('0x33')][_0x1ef6('0x59')]()[_0x1ef6('0x2b')](respondWithResult(_0x45ae7d,null))[_0x1ef6('0x4b')](handleError(_0x45ae7d,null));};exports[_0x1ef6('0x5a')]=function(_0x5236ba,_0x35e0da,_0x268455){var _0x2288c0={'raw':!![],'where':{}},_0x2785dd={},_0x484e59;return db[_0x1ef6('0x33')][_0x1ef6('0x5b')]({'where':{'id':_0x5236ba[_0x1ef6('0x58')]['id']}})['then'](handleEntityNotFound(_0x35e0da,null))[_0x1ef6('0x2b')](function(_0x16ac95){if(_0x16ac95){_0x484e59=_0x16ac95[_0x1ef6('0x2c')]({'plain':!![]});_0x2785dd[_0x1ef6('0x37')]=_[_0x1ef6('0x39')](db[_0x1ef6('0x5c')][_0x1ef6('0x34')]);_0x2785dd['query']=_[_0x1ef6('0x39')](_0x5236ba[_0x1ef6('0x38')]);_0x2785dd['filters']=_['intersection'](_0x2785dd[_0x1ef6('0x37')],_0x2785dd[_0x1ef6('0x38')]);_0x2288c0[_0x1ef6('0x3c')]=_[_0x1ef6('0x3b')](_0x2785dd[_0x1ef6('0x37')],qs['fields'](_0x5236ba[_0x1ef6('0x38')]['fields']));_0x2288c0[_0x1ef6('0x3c')]=_0x2288c0[_0x1ef6('0x3c')]['length']?_0x2288c0[_0x1ef6('0x3c')]:_0x2785dd['model'];if(!_0x5236ba[_0x1ef6('0x38')][_0x1ef6('0x3f')](_0x1ef6('0x40'))){_0x2288c0[_0x1ef6('0x23')]=qs[_0x1ef6('0x23')](_0x5236ba[_0x1ef6('0x38')][_0x1ef6('0x23')]);_0x2288c0['offset']=qs['offset'](_0x5236ba['query'][_0x1ef6('0x21')]);}_0x2288c0[_0x1ef6('0x41')]=qs[_0x1ef6('0x42')](_0x5236ba[_0x1ef6('0x38')]['sort']);_0x2288c0[_0x1ef6('0x43')]=qs[_0x1ef6('0x3a')](_[_0x1ef6('0x44')](_0x5236ba[_0x1ef6('0x38')],_0x2785dd['filters']));_0x2288c0[_0x1ef6('0x43')][_0x1ef6('0x5d')]=_0x16ac95['id'];if(_0x5236ba[_0x1ef6('0x38')]['filter']){_0x2288c0[_0x1ef6('0x43')]=_['merge'](_0x2288c0['where'],{'$or':_['map'](_0x2288c0['attributes'],function(_0x2334f3){var _0x3a0cd6={};_0x3a0cd6[_0x2334f3]={'$like':'%'+_0x5236ba[_0x1ef6('0x38')][_0x1ef6('0x47')]+'%'};return _0x3a0cd6;})});}_0x2288c0=_['merge']({},_0x2288c0,_0x5236ba[_0x1ef6('0x4d')]);return db[_0x1ef6('0x5c')][_0x1ef6('0x5e')](_0x2288c0);}})['then'](function(_0x2927b9){if(_0x2927b9){return db[_0x1ef6('0x5f')][_0x1ef6('0x60')]({'where':{'id':_[_0x1ef6('0x32')](_0x2927b9,_0x1ef6('0x61')),'role':_0x1ef6('0x62')},'attributes':['id',_0x1ef6('0x30'),_0x1ef6('0x63'),'updatedAt',_0x1ef6('0x64')]});}})[_0x1ef6('0x2b')](function(_0x284ae3){if(_0x284ae3){return{'count':_0x284ae3[_0x1ef6('0x24')],'rows':_[_0x1ef6('0x32')](_0x284ae3[_0x1ef6('0x4a')],function(_0x4228d6){return{'membername':_0x4228d6[_0x1ef6('0x30')],'UserId':_0x4228d6['id'],'queue_name':_0x484e59[_0x1ef6('0x30')],'FaxQueueId':_0x484e59['id'],'interface':util[_0x1ef6('0x65')](_0x1ef6('0x66'),'SIP',_0x4228d6[_0x1ef6('0x30')]),'penalty':0x0,'paused':_0x4228d6['faxPause'],'createdAt':_0x4228d6[_0x1ef6('0x64')],'updatedAt':_0x4228d6[_0x1ef6('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1ef6('0x2b')](respondWithFilteredResult(_0x35e0da,_0x2288c0))[_0x1ef6('0x4b')](handleError(_0x35e0da,null));};exports[_0x1ef6('0x68')]=function(_0x546a8a,_0x2fbfeb,_0x500ada){var _0x57c744={};var _0x160ce1={};var _0x1159d0;var _0x14605f;return db[_0x1ef6('0x33')][_0x1ef6('0x5b')]({'where':{'id':_0x546a8a[_0x1ef6('0x58')]['id']}})[_0x1ef6('0x2b')](handleEntityNotFound(_0x2fbfeb,null))[_0x1ef6('0x2b')](function(_0x5e8566){if(_0x5e8566){_0x1159d0=_0x5e8566;_0x160ce1[_0x1ef6('0x37')]=_[_0x1ef6('0x39')](db[_0x1ef6('0x69')][_0x1ef6('0x34')]);_0x160ce1[_0x1ef6('0x38')]=_[_0x1ef6('0x39')](_0x546a8a['query']);_0x160ce1[_0x1ef6('0x3a')]=_[_0x1ef6('0x3b')](_0x160ce1[_0x1ef6('0x37')],_0x160ce1[_0x1ef6('0x38')]);_0x57c744[_0x1ef6('0x3c')]=_[_0x1ef6('0x3b')](_0x160ce1[_0x1ef6('0x37')],qs[_0x1ef6('0x3d')](_0x546a8a['query']['fields']));_0x57c744[_0x1ef6('0x3c')]=_0x57c744[_0x1ef6('0x3c')][_0x1ef6('0x3e')]?_0x57c744[_0x1ef6('0x3c')]:_0x160ce1[_0x1ef6('0x37')];_0x57c744[_0x1ef6('0x41')]=qs[_0x1ef6('0x42')](_0x546a8a[_0x1ef6('0x38')][_0x1ef6('0x42')]);_0x57c744['where']=qs[_0x1ef6('0x3a')](_[_0x1ef6('0x44')](_0x546a8a[_0x1ef6('0x38')],_0x160ce1[_0x1ef6('0x3a')]));if(_0x546a8a[_0x1ef6('0x38')]['filter']){_0x57c744[_0x1ef6('0x43')]=_[_0x1ef6('0x45')](_0x57c744[_0x1ef6('0x43')],{'$or':_[_0x1ef6('0x32')](_0x57c744['attributes'],function(_0x1c4e09){var _0x41b391={};_0x41b391[_0x1c4e09]={'$like':'%'+_0x546a8a[_0x1ef6('0x38')][_0x1ef6('0x47')]+'%'};return _0x41b391;})});}_0x57c744=_[_0x1ef6('0x45')]({},_0x57c744,_0x546a8a[_0x1ef6('0x4d')]);return _0x1159d0[_0x1ef6('0x68')](_0x57c744);}})['then'](function(_0x50d4a0){if(_0x50d4a0){_0x14605f=_0x50d4a0['length'];if(!_0x546a8a[_0x1ef6('0x38')][_0x1ef6('0x3f')]('nolimit')){_0x57c744[_0x1ef6('0x23')]=qs['limit'](_0x546a8a[_0x1ef6('0x38')][_0x1ef6('0x23')]);_0x57c744[_0x1ef6('0x21')]=qs[_0x1ef6('0x21')](_0x546a8a[_0x1ef6('0x38')][_0x1ef6('0x21')]);}return _0x1159d0[_0x1ef6('0x68')](_0x57c744);}})['then'](function(_0x3faf06){if(_0x3faf06){return _0x3faf06?{'count':_0x14605f,'rows':_0x3faf06}:null;}})[_0x1ef6('0x2b')](respondWithResult(_0x2fbfeb,null))[_0x1ef6('0x4b')](handleError(_0x2fbfeb,null));};exports[_0x1ef6('0x6a')]=function(_0x29cd7a,_0x3831ee,_0x2d169c){var _0x504aae=_0x29cd7a[_0x1ef6('0x50')][_0x1ef6('0x6b')];return db[_0x1ef6('0x69')][_0x1ef6('0x5e')]({'where':{'id':_0x504aae},'attributes':['id'],'include':[{'model':db[_0x1ef6('0x5f')],'as':_0x1ef6('0x6c'),'attributes':['id',_0x1ef6('0x30'),_0x1ef6('0x6d'),_0x1ef6('0x6e'),'interface'],'raw':!![]}]})[_0x1ef6('0x2b')](function(_0x4ef32d){if(_0x4ef32d){var _0x87a92b=_[_0x1ef6('0x6f')](_0x4ef32d,function(_0x5c3f6c){var _0x2324c9=_0x5c3f6c[_0x1ef6('0x2c')]({'plain':!![]});return _0x2324c9[_0x1ef6('0x6c')];});return db[_0x1ef6('0x33')]['find']({'where':{'id':_0x29cd7a['params']['id']}})[_0x1ef6('0x2b')](function(_0x1de756){return db[_0x1ef6('0x70')][_0x1ef6('0x71')](function(_0x46c089){return _0x1de756[_0x1ef6('0x6a')](_0x504aae,{'transaction':_0x46c089})[_0x1ef6('0x2b')](function(){return BPromise[_0x1ef6('0x72')](_0x87a92b,function(_0x182bcd){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x182bcd['id'],'FaxQueueId':_0x29cd7a[_0x1ef6('0x58')]['id']},'transaction':_0x46c089});});})['then'](function(){_0x87a92b['forEach'](function(_0x50f5de){socket[_0x1ef6('0x73')](_0x1ef6('0x74'),{'UserId':_0x50f5de['id'],'FaxQueueId':_0x1de756['id']});});});});});}})[_0x1ef6('0x2b')](respondWithStatusCode(_0x3831ee,null))[_0x1ef6('0x4b')](handleError(_0x3831ee,null));};exports['removeTeams']=function(_0x2fba46,_0x22e811,_0x4d1367){return db[_0x1ef6('0x69')][_0x1ef6('0x5e')]({'where':{'id':_0x2fba46[_0x1ef6('0x38')][_0x1ef6('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x1ef6('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1ef6('0x2b')](handleEntityNotFound(_0x22e811,null))['then'](function(_0x4c06a2){var _0x3c95f5=_[_0x1ef6('0x32')](_0x4c06a2,'id');var _0x10efd4=[];var _0x29fe4d=[];var _0x259775=squel[_0x1ef6('0x75')]();_0x259775[_0x1ef6('0x76')]('tq.TeamId')[_0x1ef6('0x77')](_0x1ef6('0x78'),'tq')['join']('user_has_teams','ut',_0x1ef6('0x79'))[_0x1ef6('0x43')](_0x1ef6('0x7a'),_0x2fba46[_0x1ef6('0x58')]['id']);for(var _0x235d04=0x0;_0x235d04<_0x4c06a2['length'];_0x235d04+=0x1){let _0x21c7cc=_0x4c06a2[_0x235d04];for(var _0x52ba91=0x0;_0x52ba91<_0x21c7cc[_0x1ef6('0x6c')][_0x1ef6('0x3e')];_0x52ba91+=0x1){let _0xcb4998=_0x21c7cc['Agents'][_0x52ba91];var _0x1d708f=_0x259775[_0x1ef6('0x7b')]();_0x1d708f[_0x1ef6('0x43')](_0x1ef6('0x7c'),_0xcb4998['id']);_0x29fe4d['push'](db[_0x1ef6('0x70')]['query'](_0x1d708f[_0x1ef6('0x7d')](),{'type':db[_0x1ef6('0x70')]['QueryTypes']['SELECT']})[_0x1ef6('0x2b')](function(_0x44924d){if(_0x44924d['length']===0x1){return _0xcb4998['id'];}else{var _0x4fec68=_[_0x1ef6('0x7e')](_[_0x1ef6('0x32')](_0x44924d,_0x1ef6('0x7f')),function(_0x5521bc){return _['includes'](_0x3c95f5,_0x5521bc);});if(_0x4fec68){return _0xcb4998['id'];}}}));}}return BPromise[_0x1ef6('0x80')](_0x29fe4d)[_0x1ef6('0x2b')](function(_0x32d00a){_0x10efd4=_(_0x10efd4)[_0x1ef6('0x81')](_0x32d00a)[_0x1ef6('0x82')]()[_0x1ef6('0x83')]();return db['FaxQueue']['find']({'where':{'id':_0x2fba46[_0x1ef6('0x58')]['id']}})[_0x1ef6('0x2b')](function(_0x36dc68){return db['sequelize']['transaction'](function(_0x7cddb4){return _0x36dc68[_0x1ef6('0x84')](_0x2fba46[_0x1ef6('0x38')][_0x1ef6('0x6b')],{'transaction':_0x7cddb4})['then'](function(){if(!_[_0x1ef6('0x85')](_0x10efd4)){return _0x36dc68['removeAgents'](_0x10efd4,{'transaction':_0x7cddb4});}})[_0x1ef6('0x2b')](function(){_0x10efd4[_0x1ef6('0x86')](function(_0x227128){socket['emit']('userFaxQueue:remove',{'UserId':_0x227128,'FaxQueueId':_0x36dc68['id']});});});});});});})[_0x1ef6('0x2b')](respondWithStatusCode(_0x22e811,null))[_0x1ef6('0x4b')](handleError(_0x22e811,null));};exports[_0x1ef6('0x87')]=function(_0x85191,_0x5e2219,_0x552bf7){return db['FaxQueue'][_0x1ef6('0x4e')]({'where':{'id':_0x85191['params']['id']}})[_0x1ef6('0x2b')](handleEntityNotFound(_0x5e2219,null))[_0x1ef6('0x2b')](function(_0x5d05bd){if(_0x5d05bd){return _0x5d05bd[_0x1ef6('0x87')](_0x85191[_0x1ef6('0x50')]['ids'],_[_0x1ef6('0x88')](_0x85191[_0x1ef6('0x50')],[_0x1ef6('0x6b'),'id'])||{})[_0x1ef6('0x89')](function(_0x17b159){for(var _0x4208bf=0x0;_0x4208bf<_0x85191[_0x1ef6('0x50')][_0x1ef6('0x6b')][_0x1ef6('0x3e')];_0x4208bf+=0x1){socket[_0x1ef6('0x73')](_0x1ef6('0x74'),{'UserId':Number(_0x85191[_0x1ef6('0x50')][_0x1ef6('0x6b')][_0x4208bf]),'FaxQueueId':Number(_0x85191['params']['id'])});}return _0x17b159;});}})[_0x1ef6('0x2b')](respondWithResult(_0x5e2219,null))[_0x1ef6('0x4b')](handleError(_0x5e2219,null));};exports[_0x1ef6('0x8a')]=function(_0x7ef6a,_0x1308de,_0x269eed){return db[_0x1ef6('0x33')]['find']({'where':{'id':_0x7ef6a[_0x1ef6('0x58')]['id']}})['then'](handleEntityNotFound(_0x1308de,null))[_0x1ef6('0x2b')](function(_0x76cff4){if(_0x76cff4){return _0x76cff4['removeAgents'](_0x7ef6a[_0x1ef6('0x38')][_0x1ef6('0x6b')])[_0x1ef6('0x2b')](function(){if(_[_0x1ef6('0x8b')](_0x7ef6a[_0x1ef6('0x38')]['ids'])){for(var _0x158211=0x0;_0x158211<_0x7ef6a['query'][_0x1ef6('0x6b')][_0x1ef6('0x3e')];_0x158211+=0x1){socket[_0x1ef6('0x73')](_0x1ef6('0x8c'),{'UserId':Number(_0x7ef6a[_0x1ef6('0x38')][_0x1ef6('0x6b')][_0x158211]),'FaxQueueId':Number(_0x7ef6a[_0x1ef6('0x58')]['id'])});}}else{socket[_0x1ef6('0x73')](_0x1ef6('0x8c'),{'UserId':Number(_0x7ef6a[_0x1ef6('0x38')]['ids']),'FaxQueueId':Number(_0x7ef6a['params']['id'])});}});}})[_0x1ef6('0x2b')](respondWithStatusCode(_0x1308de,null))[_0x1ef6('0x4b')](handleError(_0x1308de,null));};exports[_0x1ef6('0x8d')]=function(_0x4fb1dd,_0x3da4e3,_0x1e5530){var _0x3b447c={};var _0x1b7af8={};var _0x3615f5;var _0xaf2411;return db['FaxQueue'][_0x1ef6('0x5b')]({'where':{'id':_0x4fb1dd[_0x1ef6('0x58')]['id']}})[_0x1ef6('0x2b')](handleEntityNotFound(_0x3da4e3,null))['then'](function(_0xe8dc93){if(_0xe8dc93){_0x3615f5=_0xe8dc93;_0x1b7af8[_0x1ef6('0x37')]=_['keys'](db[_0x1ef6('0x5f')]['rawAttributes']);_0x1b7af8['query']=_[_0x1ef6('0x39')](_0x4fb1dd['query']);_0x1b7af8[_0x1ef6('0x3a')]=_[_0x1ef6('0x3b')](_0x1b7af8[_0x1ef6('0x37')],_0x1b7af8[_0x1ef6('0x38')]);_0x3b447c[_0x1ef6('0x3c')]=_[_0x1ef6('0x3b')](_0x1b7af8['model'],qs[_0x1ef6('0x3d')](_0x4fb1dd[_0x1ef6('0x38')][_0x1ef6('0x3d')]));_0x3b447c[_0x1ef6('0x3c')]=_0x3b447c['attributes']['length']?_0x3b447c[_0x1ef6('0x3c')]:_0x1b7af8[_0x1ef6('0x37')];_0x3b447c[_0x1ef6('0x41')]=qs['sort'](_0x4fb1dd[_0x1ef6('0x38')][_0x1ef6('0x42')]);_0x3b447c[_0x1ef6('0x43')]=qs[_0x1ef6('0x3a')](_[_0x1ef6('0x44')](_0x4fb1dd[_0x1ef6('0x38')],_0x1b7af8['filters']));if(_0x4fb1dd['query'][_0x1ef6('0x47')]){_0x3b447c['where']=_[_0x1ef6('0x45')](_0x3b447c[_0x1ef6('0x43')],{'$or':_[_0x1ef6('0x32')](_0x3b447c[_0x1ef6('0x3c')],function(_0x353810){var _0x34cef3={};_0x34cef3[_0x353810]={'$like':'%'+_0x4fb1dd[_0x1ef6('0x38')][_0x1ef6('0x47')]+'%'};return _0x34cef3;})});}_0x3b447c=_[_0x1ef6('0x45')]({},_0x3b447c,_0x4fb1dd[_0x1ef6('0x4d')]);return _0x3615f5[_0x1ef6('0x8d')](_0x3b447c);}})[_0x1ef6('0x2b')](function(_0x30dee3){if(_0x30dee3){_0xaf2411=_0x30dee3[_0x1ef6('0x3e')];if(!_0x4fb1dd[_0x1ef6('0x38')][_0x1ef6('0x3f')](_0x1ef6('0x40'))){_0x3b447c[_0x1ef6('0x23')]=qs[_0x1ef6('0x23')](_0x4fb1dd['query']['limit']);_0x3b447c[_0x1ef6('0x21')]=qs['offset'](_0x4fb1dd[_0x1ef6('0x38')][_0x1ef6('0x21')]);}return _0x3615f5['getAgents'](_0x3b447c);}})['then'](function(_0x569d64){if(_0x569d64){return _0x569d64?{'count':_0xaf2411,'rows':_0x569d64}:null;}})[_0x1ef6('0x2b')](respondWithResult(_0x3da4e3,null))[_0x1ef6('0x4b')](handleError(_0x3da4e3,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 19d98b7..12c0ba6 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 _0x577c=['remove','emit','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x577c,0xe4));var _0xc577=function(_0x1eb1b2,_0x26b6b7){_0x1eb1b2=_0x1eb1b2-0x0;var _0x2f520a=_0x577c[_0x1eb1b2];return _0x2f520a;};'use strict';var EventEmitter=require(_0xc577('0x0'));var FaxQueue=require(_0xc577('0x1'))['db'][_0xc577('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xc577('0x3')](0x0);var events={'afterCreate':_0xc577('0x4'),'afterUpdate':_0xc577('0x5'),'afterDestroy':_0xc577('0x6')};function emitEvent(_0x3abf00){return function(_0x1d8227,_0x62cf1a,_0x53b354){FaxQueueEvents[_0xc577('0x7')](_0x3abf00+':'+_0x1d8227['id'],_0x1d8227);FaxQueueEvents['emit'](_0x3abf00,_0x1d8227);_0x53b354(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xc577('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x4014=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','save','update','emit'];(function(_0x4ac11c,_0x3446ca){var _0x453f36=function(_0x46428a){while(--_0x46428a){_0x4ac11c['push'](_0x4ac11c['shift']());}};_0x453f36(++_0x3446ca);}(_0x4014,0x1e9));var _0x4401=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x4014[_0x1cb18a];return _0x22442e;};'use strict';var EventEmitter=require(_0x4401('0x0'));var FaxQueue=require(_0x4401('0x1'))['db'][_0x4401('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4401('0x3'),'afterUpdate':_0x4401('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1067e8){return function(_0x468d43,_0x1851a3,_0x5cfd96){FaxQueueEvents[_0x4401('0x5')](_0x1067e8+':'+_0x468d43['id'],_0x468d43);FaxQueueEvents['emit'](_0x1067e8,_0x468d43);_0x5cfd96(null);};}for(var e in events){if(events[_0x4401('0x6')](e)){var event=events[e];FaxQueue[_0x4401('0x7')](e,emitEvent(event));}}module[_0x4401('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 a18de93..babcf68 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 _0x20a9=['bluebird','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','util','api'];(function(_0xa65e7e,_0x46c8e4){var _0x35473c=function(_0xbae351){while(--_0xbae351){_0xa65e7e['push'](_0xa65e7e['shift']());}};_0x35473c(++_0x46c8e4);}(_0x20a9,0x1a1));var _0x920a=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x20a9[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x920a('0x0'));var util=require(_0x920a('0x1'));var logger=require('../../config/logger')(_0x920a('0x2'));var moment=require('moment');var BPromise=require(_0x920a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x920a('0x4'));var config=require(_0x920a('0x5'));var attributes=require(_0x920a('0x6'));module[_0x920a('0x7')]=function(_0x15879b,_0x23946f){return _0x15879b[_0x920a('0x8')]('FaxQueue',attributes,{'tableName':_0x920a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xead8=['moment','path','./faxQueue.attributes','exports','FaxQueue','util','api'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xead8,0x11d));var _0x8ead=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0xead8[_0x21af3a];return _0x268a49;};'use strict';var _=require('lodash');var util=require(_0x8ead('0x0'));var logger=require('../../config/logger')(_0x8ead('0x1'));var moment=require(_0x8ead('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ead('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8ead('0x4'));module[_0x8ead('0x5')]=function(_0x92e450,_0x1d4f4b){return _0x92e450['define'](_0x8ead('0x6'),attributes,{'tableName':'fax_queues','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 ed3be79..7e27a28 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 _0x0183=['include','model','then','ShowFaxQueue','FaxQueue','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetFaxQueue','options','where','attributes','map'];(function(_0x529a00,_0x2e9695){var _0x540cfc=function(_0x2dde84){while(--_0x2dde84){_0x529a00['push'](_0x529a00['shift']());}};_0x540cfc(++_0x2e9695);}(_0x0183,0x188));var _0x3018=function(_0x42d869,_0x3a72bc){_0x42d869=_0x42d869-0x0;var _0x136e0f=_0x0183[_0x42d869];return _0x136e0f;};'use strict';var _=require(_0x3018('0x0'));var util=require(_0x3018('0x1'));var moment=require(_0x3018('0x2'));var BPromise=require(_0x3018('0x3'));var rs=require(_0x3018('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3018('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3018('0x6'))('rpc');var config=require(_0x3018('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3018('0x8')]({'port':0x232a});config[_0x3018('0x9')]=_['defaults'](config[_0x3018('0x9')],{'host':_0x3018('0xa'),'port':0x18eb});var socket=require(_0x3018('0xb'))(new Redis(config['redis']));require(_0x3018('0xc'))[_0x3018('0xd')](socket);function respondWithRpcPromise(_0x2ab5f2,_0x5d4c81,_0xc44307){return new BPromise(function(_0x1c7ca8,_0x31483d){return client['request'](_0x2ab5f2,_0xc44307)['then'](function(_0x5eb248){logger[_0x3018('0xe')](_0x3018('0xf'),_0x5d4c81,_0x3018('0x10'));logger[_0x3018('0x11')](_0x3018('0x12'),_0x5d4c81,_0x3018('0x10'),JSON[_0x3018('0x13')](_0x5eb248));if(_0x5eb248[_0x3018('0x14')]){if(_0x5eb248[_0x3018('0x14')]['code']===0x1f4){logger['error'](_0x3018('0xf'),_0x5d4c81,_0x5eb248[_0x3018('0x14')][_0x3018('0x15')]);return _0x31483d(_0x5eb248[_0x3018('0x14')][_0x3018('0x15')]);}logger[_0x3018('0x14')](_0x3018('0xf'),_0x5d4c81,_0x5eb248[_0x3018('0x14')][_0x3018('0x15')]);return _0x1c7ca8(_0x5eb248[_0x3018('0x14')][_0x3018('0x15')]);}else{logger[_0x3018('0xe')]('FaxQueue,\x20%s,\x20%s',_0x5d4c81,_0x3018('0x10'));_0x1c7ca8(_0x5eb248['result'][_0x3018('0x15')]);}})[_0x3018('0x16')](function(_0x5f9ad0){logger[_0x3018('0x14')](_0x3018('0xf'),_0x5d4c81,_0x5f9ad0);_0x31483d(_0x5f9ad0);});});}exports[_0x3018('0x17')]=function(_0x2d8d6c){var _0x81af2d=this;return new Promise(function(_0x12e363,_0x50fcff){return db['FaxQueue']['findAll']({'raw':_0x2d8d6c[_0x3018('0x18')]?_0x2d8d6c['options']['raw']===undefined?!![]:![]:!![],'where':_0x2d8d6c[_0x3018('0x18')]?_0x2d8d6c['options'][_0x3018('0x19')]||null:null,'attributes':_0x2d8d6c[_0x3018('0x18')]?_0x2d8d6c['options'][_0x3018('0x1a')]||null:null,'limit':_0x2d8d6c['options']?_0x2d8d6c['options']['limit']||null:null,'include':_0x2d8d6c[_0x3018('0x18')]?_0x2d8d6c['options']['include']?_[_0x3018('0x1b')](_0x2d8d6c[_0x3018('0x18')]['include'],function(_0x3947cb){return{'model':db[_0x3947cb['model']],'as':_0x3947cb['as'],'attributes':_0x3947cb[_0x3018('0x1a')],'include':_0x3947cb[_0x3018('0x1c')]?_[_0x3018('0x1b')](_0x3947cb[_0x3018('0x1c')],function(_0x2a0694){return{'model':db[_0x2a0694[_0x3018('0x1d')]],'as':_0x2a0694['as'],'attributes':_0x2a0694[_0x3018('0x1a')],'include':_0x2a0694[_0x3018('0x1c')]?_[_0x3018('0x1b')](_0x2a0694[_0x3018('0x1c')],function(_0x4b0419){return{'model':db[_0x4b0419['model']],'as':_0x4b0419['as'],'attributes':_0x4b0419[_0x3018('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3018('0x1e')](function(_0x206184){logger[_0x3018('0xe')]('GetFaxQueue',_0x2d8d6c);logger[_0x3018('0x11')](_0x3018('0x17'),_0x2d8d6c,JSON[_0x3018('0x13')](_0x206184));_0x12e363(_0x206184);})[_0x3018('0x16')](function(_0x1e9a12){logger[_0x3018('0x14')](_0x3018('0x17'),_0x1e9a12['message'],_0x2d8d6c);_0x50fcff(_0x81af2d[_0x3018('0x14')](0x1f4,_0x1e9a12['message']));});});};exports[_0x3018('0x1f')]=function(_0x594821){var _0xe62761=this;return new Promise(function(_0x3f6570,_0x1aca4d){return db[_0x3018('0x20')][_0x3018('0x21')]({'raw':_0x594821[_0x3018('0x18')]?_0x594821[_0x3018('0x18')][_0x3018('0x22')]===undefined?!![]:![]:!![],'where':_0x594821[_0x3018('0x18')]?_0x594821[_0x3018('0x18')]['where']||null:null,'attributes':_0x594821[_0x3018('0x18')]?_0x594821[_0x3018('0x18')][_0x3018('0x1a')]||null:null,'include':_0x594821['options']?_0x594821[_0x3018('0x18')][_0x3018('0x1c')]?_[_0x3018('0x1b')](_0x594821[_0x3018('0x18')]['include'],function(_0xfd63d8){return{'model':db[_0xfd63d8[_0x3018('0x1d')]],'as':_0xfd63d8['as'],'attributes':_0xfd63d8[_0x3018('0x1a')],'include':_0xfd63d8[_0x3018('0x1c')]?_[_0x3018('0x1b')](_0xfd63d8['include'],function(_0x3252f3){return{'model':db[_0x3252f3['model']],'as':_0x3252f3['as'],'attributes':_0x3252f3[_0x3018('0x1a')],'include':_0x3252f3[_0x3018('0x1c')]?_['map'](_0x3252f3[_0x3018('0x1c')],function(_0x449c0b){return{'model':db[_0x449c0b[_0x3018('0x1d')]],'as':_0x449c0b['as'],'attributes':_0x449c0b[_0x3018('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x253845){logger['info']('ShowFaxQueue',_0x594821);logger[_0x3018('0x11')](_0x3018('0x1f'),_0x594821,JSON[_0x3018('0x13')](_0x253845));_0x3f6570(_0x253845);})[_0x3018('0x16')](function(_0x18ea00){logger['error'](_0x3018('0x1f'),_0x18ea00[_0x3018('0x15')],_0x594821);_0x1aca4d(_0xe62761['error'](0x1f4,_0x18ea00['message']));});});}; \ No newline at end of file +var _0xe9c5=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','FaxQueue,\x20%s,\x20%s','message','catch','GetFaxQueue','FaxQueue','findAll','options','where','limit','include','model','attributes','map','ShowFaxQueue','raw','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5dd77c,_0x5ca9b6){var _0x210043=function(_0x554d61){while(--_0x554d61){_0x5dd77c['push'](_0x5dd77c['shift']());}};_0x210043(++_0x5ca9b6);}(_0xe9c5,0x6c));var _0x5e9c=function(_0x5365bb,_0x56e85d){_0x5365bb=_0x5365bb-0x0;var _0x1497a3=_0xe9c5[_0x5365bb];return _0x1497a3;};'use strict';var _=require('lodash');var util=require(_0x5e9c('0x0'));var moment=require(_0x5e9c('0x1'));var BPromise=require(_0x5e9c('0x2'));var rs=require(_0x5e9c('0x3'));var fs=require('fs');var Redis=require(_0x5e9c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e9c('0x5'));var logger=require(_0x5e9c('0x6'))(_0x5e9c('0x7'));var config=require(_0x5e9c('0x8'));var jayson=require(_0x5e9c('0x9'));var client=jayson[_0x5e9c('0xa')]['http']({'port':0x232a});config[_0x5e9c('0xb')]=_[_0x5e9c('0xc')](config[_0x5e9c('0xb')],{'host':_0x5e9c('0xd'),'port':0x18eb});var socket=require(_0x5e9c('0xe'))(new Redis(config[_0x5e9c('0xb')]));require(_0x5e9c('0xf'))['register'](socket);function respondWithRpcPromise(_0x2b69b8,_0x5c35b2,_0x578704){return new BPromise(function(_0x2087fc,_0x4f933c){return client['request'](_0x2b69b8,_0x578704)[_0x5e9c('0x10')](function(_0xac4001){logger[_0x5e9c('0x11')]('FaxQueue,\x20%s,\x20%s',_0x5c35b2,_0x5e9c('0x12'));logger[_0x5e9c('0x13')](_0x5e9c('0x14'),_0x5c35b2,_0x5e9c('0x12'),JSON[_0x5e9c('0x15')](_0xac4001));if(_0xac4001['error']){if(_0xac4001['error'][_0x5e9c('0x16')]===0x1f4){logger[_0x5e9c('0x17')](_0x5e9c('0x18'),_0x5c35b2,_0xac4001[_0x5e9c('0x17')]['message']);return _0x4f933c(_0xac4001[_0x5e9c('0x17')][_0x5e9c('0x19')]);}logger['error'](_0x5e9c('0x18'),_0x5c35b2,_0xac4001[_0x5e9c('0x17')]['message']);return _0x2087fc(_0xac4001[_0x5e9c('0x17')][_0x5e9c('0x19')]);}else{logger[_0x5e9c('0x11')](_0x5e9c('0x18'),_0x5c35b2,_0x5e9c('0x12'));_0x2087fc(_0xac4001['result']['message']);}})[_0x5e9c('0x1a')](function(_0x39d9df){logger[_0x5e9c('0x17')]('FaxQueue,\x20%s,\x20%s',_0x5c35b2,_0x39d9df);_0x4f933c(_0x39d9df);});});}exports[_0x5e9c('0x1b')]=function(_0x5b51a1){var _0x448304=this;return new Promise(function(_0x1367c9,_0x6b2da4){return db[_0x5e9c('0x1c')][_0x5e9c('0x1d')]({'raw':_0x5b51a1[_0x5e9c('0x1e')]?_0x5b51a1['options']['raw']===undefined?!![]:![]:!![],'where':_0x5b51a1['options']?_0x5b51a1[_0x5e9c('0x1e')][_0x5e9c('0x1f')]||null:null,'attributes':_0x5b51a1[_0x5e9c('0x1e')]?_0x5b51a1['options']['attributes']||null:null,'limit':_0x5b51a1[_0x5e9c('0x1e')]?_0x5b51a1[_0x5e9c('0x1e')][_0x5e9c('0x20')]||null:null,'include':_0x5b51a1[_0x5e9c('0x1e')]?_0x5b51a1['options'][_0x5e9c('0x21')]?_['map'](_0x5b51a1['options'][_0x5e9c('0x21')],function(_0x1431d3){return{'model':db[_0x1431d3[_0x5e9c('0x22')]],'as':_0x1431d3['as'],'attributes':_0x1431d3[_0x5e9c('0x23')],'include':_0x1431d3[_0x5e9c('0x21')]?_[_0x5e9c('0x24')](_0x1431d3[_0x5e9c('0x21')],function(_0x6c7342){return{'model':db[_0x6c7342[_0x5e9c('0x22')]],'as':_0x6c7342['as'],'attributes':_0x6c7342['attributes'],'include':_0x6c7342[_0x5e9c('0x21')]?_['map'](_0x6c7342[_0x5e9c('0x21')],function(_0x209953){return{'model':db[_0x209953[_0x5e9c('0x22')]],'as':_0x209953['as'],'attributes':_0x209953[_0x5e9c('0x23')]};}):[]};}):[]};}):[]:[]})[_0x5e9c('0x10')](function(_0x4451d6){logger['info']('GetFaxQueue',_0x5b51a1);logger[_0x5e9c('0x13')](_0x5e9c('0x1b'),_0x5b51a1,JSON[_0x5e9c('0x15')](_0x4451d6));_0x1367c9(_0x4451d6);})[_0x5e9c('0x1a')](function(_0x2578d4){logger[_0x5e9c('0x17')](_0x5e9c('0x1b'),_0x2578d4[_0x5e9c('0x19')],_0x5b51a1);_0x6b2da4(_0x448304[_0x5e9c('0x17')](0x1f4,_0x2578d4[_0x5e9c('0x19')]));});});};exports[_0x5e9c('0x25')]=function(_0x269811){var _0x13cb19=this;return new Promise(function(_0x5e6e2e,_0x31a146){return db[_0x5e9c('0x1c')]['find']({'raw':_0x269811[_0x5e9c('0x1e')]?_0x269811[_0x5e9c('0x1e')][_0x5e9c('0x26')]===undefined?!![]:![]:!![],'where':_0x269811['options']?_0x269811[_0x5e9c('0x1e')][_0x5e9c('0x1f')]||null:null,'attributes':_0x269811[_0x5e9c('0x1e')]?_0x269811[_0x5e9c('0x1e')]['attributes']||null:null,'include':_0x269811[_0x5e9c('0x1e')]?_0x269811[_0x5e9c('0x1e')][_0x5e9c('0x21')]?_[_0x5e9c('0x24')](_0x269811['options'][_0x5e9c('0x21')],function(_0x3e36cd){return{'model':db[_0x3e36cd['model']],'as':_0x3e36cd['as'],'attributes':_0x3e36cd[_0x5e9c('0x23')],'include':_0x3e36cd['include']?_['map'](_0x3e36cd['include'],function(_0x3d1d89){return{'model':db[_0x3d1d89['model']],'as':_0x3d1d89['as'],'attributes':_0x3d1d89[_0x5e9c('0x23')],'include':_0x3d1d89[_0x5e9c('0x21')]?_[_0x5e9c('0x24')](_0x3d1d89['include'],function(_0x4cd9b7){return{'model':db[_0x4cd9b7[_0x5e9c('0x22')]],'as':_0x4cd9b7['as'],'attributes':_0x4cd9b7['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e9c('0x10')](function(_0x3b5497){logger['info']('ShowFaxQueue',_0x269811);logger[_0x5e9c('0x13')]('ShowFaxQueue',_0x269811,JSON[_0x5e9c('0x15')](_0x3b5497));_0x5e6e2e(_0x3b5497);})[_0x5e9c('0x1a')](function(_0x2665d8){logger[_0x5e9c('0x17')](_0x5e9c('0x25'),_0x2665d8['message'],_0x269811);_0x31a146(_0x13cb19['error'](0x1f4,_0x2665d8[_0x5e9c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index e4e974f..4cafb55 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 _0x7301=['save','update','emit','removeListener','register'];(function(_0x24fb23,_0x29be95){var _0x4bfc02=function(_0x243503){while(--_0x243503){_0x24fb23['push'](_0x24fb23['shift']());}};_0x4bfc02(++_0x29be95);}(_0x7301,0x6e));var _0x1730=function(_0x49ba79,_0x11186c){_0x49ba79=_0x49ba79-0x0;var _0x552655=_0x7301[_0x49ba79];return _0x552655;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x1730('0x0'),'remove',_0x1730('0x1')];function createListener(_0x13c7c1,_0x15cb5e){return function(_0x438914){_0x15cb5e[_0x1730('0x2')](_0x13c7c1,_0x438914);};}function removeListener(_0x301c21,_0x54c9b8){return function(){FaxQueueEvents[_0x1730('0x3')](_0x301c21,_0x54c9b8);};}exports[_0x1730('0x4')]=function(_0x44c3c6){for(var _0x1ebabe=0x0,_0x5f453b=events['length'];_0x1ebabe<_0x5f453b;_0x1ebabe++){var _0x4c5858=events[_0x1ebabe];var _0x22a912=createListener('faxQueue:'+_0x4c5858,_0x44c3c6);FaxQueueEvents['on'](_0x4c5858,_0x22a912);}}; \ No newline at end of file +var _0x873f=['./faxQueue.events','save','remove','removeListener','register','faxQueue:'];(function(_0x565c4e,_0x1e77f9){var _0x4a167f=function(_0x537269){while(--_0x537269){_0x565c4e['push'](_0x565c4e['shift']());}};_0x4a167f(++_0x1e77f9);}(_0x873f,0x11a));var _0xf873=function(_0x1de3ee,_0x4ef892){_0x1de3ee=_0x1de3ee-0x0;var _0x4d7bf5=_0x873f[_0x1de3ee];return _0x4d7bf5;};'use strict';var FaxQueueEvents=require(_0xf873('0x0'));var events=[_0xf873('0x1'),_0xf873('0x2'),'update'];function createListener(_0x17394e,_0x2ce391){return function(_0xcfd16f){_0x2ce391['emit'](_0x17394e,_0xcfd16f);};}function removeListener(_0x11c512,_0x300811){return function(){FaxQueueEvents[_0xf873('0x3')](_0x11c512,_0x300811);};}exports[_0xf873('0x4')]=function(_0x431c6c){for(var _0x5c905a=0x0,_0x186a50=events['length'];_0x5c905a<_0x186a50;_0x5c905a++){var _0x2c3bfa=events[_0x5c905a];var _0x169403=createListener(_0xf873('0x5')+_0x2c3bfa,_0x431c6c);FaxQueueEvents['on'](_0x2c3bfa,_0x169403);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index de5992f..79f00a5 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 _0xee3c=['./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','put','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xee3c,0x14a));var _0xcee3=function(_0xe58cbf,_0x2a82c0){_0xe58cbf=_0xe58cbf-0x0;var _0x350a37=_0xee3c[_0xe58cbf];return _0x350a37;};'use strict';var multer=require(_0xcee3('0x0'));var util=require(_0xcee3('0x1'));var path=require(_0xcee3('0x2'));var timeout=require(_0xcee3('0x3'));var express=require(_0xcee3('0x4'));var router=express[_0xcee3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcee3('0x6'));var config=require(_0xcee3('0x7'));var controller=require(_0xcee3('0x8'));router[_0xcee3('0x9')]('/',auth[_0xcee3('0xa')](),controller[_0xcee3('0xb')]);router[_0xcee3('0x9')](_0xcee3('0xc'),auth[_0xcee3('0xa')](),controller[_0xcee3('0xd')]);router[_0xcee3('0x9')](_0xcee3('0xe'),auth[_0xcee3('0xa')](),controller[_0xcee3('0xf')]);router[_0xcee3('0x9')]('/:id/members',auth[_0xcee3('0xa')](),controller[_0xcee3('0x10')]);router[_0xcee3('0x9')](_0xcee3('0x11'),auth[_0xcee3('0xa')](),controller[_0xcee3('0x12')]);router['get'](_0xcee3('0x13'),auth[_0xcee3('0xa')](),controller[_0xcee3('0x14')]);router[_0xcee3('0x15')]('/',auth[_0xcee3('0xa')](),controller['create']);router[_0xcee3('0x15')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0xcee3('0x15')](_0xcee3('0x13'),auth['isAuthenticated'](),controller['addAgents']);router[_0xcee3('0x16')]('/:id',auth[_0xcee3('0xa')](),controller['update']);router[_0xcee3('0x17')](_0xcee3('0xe'),auth['isAuthenticated'](),controller[_0xcee3('0x18')]);router[_0xcee3('0x17')](_0xcee3('0x11'),auth[_0xcee3('0xa')](),controller['removeTeams']);router[_0xcee3('0x17')](_0xcee3('0x13'),auth[_0xcee3('0xa')](),controller[_0xcee3('0x19')]);module['exports']=router; \ No newline at end of file +var _0xfb11=['Router','../../components/auth/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/members','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout'];(function(_0x5a9b1e,_0x136c5d){var _0x3a580a=function(_0x1b4876){while(--_0x1b4876){_0x5a9b1e['push'](_0x5a9b1e['shift']());}};_0x3a580a(++_0x136c5d);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xfb11[_0x5317b5];return _0x3b7ce2;};'use strict';var multer=require(_0x1fb1('0x0'));var util=require('util');var path=require(_0x1fb1('0x1'));var timeout=require(_0x1fb1('0x2'));var express=require('express');var router=express[_0x1fb1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1fb1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1fb1('0x5'));var controller=require(_0x1fb1('0x6'));router['get']('/',auth[_0x1fb1('0x7')](),controller[_0x1fb1('0x8')]);router['get'](_0x1fb1('0x9'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0xa')]);router[_0x1fb1('0xb')](_0x1fb1('0xc'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0xd')]);router[_0x1fb1('0xb')](_0x1fb1('0xe'),auth[_0x1fb1('0x7')](),controller['getMembers']);router[_0x1fb1('0xb')]('/:id/teams',auth[_0x1fb1('0x7')](),controller['getTeams']);router[_0x1fb1('0xb')](_0x1fb1('0xf'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0x10')]);router[_0x1fb1('0x11')]('/',auth[_0x1fb1('0x7')](),controller['create']);router[_0x1fb1('0x11')](_0x1fb1('0x12'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0x13')]);router[_0x1fb1('0x11')](_0x1fb1('0xf'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0x14')]);router[_0x1fb1('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1fb1('0x16')]);router[_0x1fb1('0x17')](_0x1fb1('0xc'),auth['isAuthenticated'](),controller[_0x1fb1('0x18')]);router[_0x1fb1('0x17')](_0x1fb1('0x12'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0x19')]);router[_0x1fb1('0x17')](_0x1fb1('0xf'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index dd34aa3..2cb5c6f 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 _0x8d39=['exports','STRING','DATE','sequelize'];(function(_0x424264,_0x26eaf5){var _0x366547=function(_0x58f5dd){while(--_0x58f5dd){_0x424264['push'](_0x424264['shift']());}};_0x366547(++_0x26eaf5);}(_0x8d39,0xb3));var _0x98d3=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x8d39[_0x1beef3];return _0x5af964;};'use strict';var moment=require('moment');var Sequelize=require(_0x98d3('0x0'));module[_0x98d3('0x1')]={'uniqueid':{'type':Sequelize[_0x98d3('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x98d3('0x2')]},'joinAt':{'type':Sequelize[_0x98d3('0x3')]},'leaveAt':{'type':Sequelize[_0x98d3('0x3')]},'acceptAt':{'type':Sequelize[_0x98d3('0x3')]},'exitAt':{'type':Sequelize[_0x98d3('0x3')]},'reason':{'type':Sequelize[_0x98d3('0x2')]}}; \ No newline at end of file +var _0xacd4=['DATE','moment','sequelize','exports','STRING'];(function(_0x208fe2,_0x59bcea){var _0x29f7f3=function(_0x102883){while(--_0x102883){_0x208fe2['push'](_0x208fe2['shift']());}};_0x29f7f3(++_0x59bcea);}(_0xacd4,0x196));var _0x4acd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xacd4[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0x4acd('0x0'));var Sequelize=require(_0x4acd('0x1'));module[_0x4acd('0x2')]={'uniqueid':{'type':Sequelize[_0x4acd('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x4acd('0x4')]},'acceptAt':{'type':Sequelize[_0x4acd('0x4')]},'exitAt':{'type':Sequelize[_0x4acd('0x4')]},'reason':{'type':Sequelize[_0x4acd('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index ae22a48..2674015 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 _0xb0b9=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','end','error','name','index','map','rawAttributes','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','FaxQueueReport','includeAll','include','findAll','rows','params','intersection','find','catch','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x9393bd,_0x5f2e7b){var _0x11c25f=function(_0x3c98fd){while(--_0x3c98fd){_0x9393bd['push'](_0x9393bd['shift']());}};_0x11c25f(++_0x5f2e7b);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x1ff0cc,_0x309830){_0x1ff0cc=_0x1ff0cc-0x0;var _0x11bbe0=_0xb0b9[_0x1ff0cc];return _0x11bbe0;};'use strict';var emlformat=require(_0x9b0b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9b0b('0x1'));var rp=require(_0x9b0b('0x2'));var moment=require(_0x9b0b('0x3'));var BPromise=require(_0x9b0b('0x4'));var Mustache=require(_0x9b0b('0x5'));var util=require(_0x9b0b('0x6'));var path=require(_0x9b0b('0x7'));var sox=require(_0x9b0b('0x8'));var csv=require(_0x9b0b('0x9'));var ejs=require(_0x9b0b('0xa'));var fs=require('fs');var fs_extra=require(_0x9b0b('0xb'));var _=require(_0x9b0b('0xc'));var squel=require(_0x9b0b('0xd'));var crypto=require(_0x9b0b('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b0b('0x9'));var querystring=require(_0x9b0b('0xf'));var Papa=require(_0x9b0b('0x10'));var Redis=require(_0x9b0b('0x11'));var authService=require(_0x9b0b('0x12'));var qs=require(_0x9b0b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b0b('0x14'));var logger=require(_0x9b0b('0x15'))(_0x9b0b('0x16'));var utils=require(_0x9b0b('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9b0b('0x18'))['db'];function respondWithStatusCode(_0x4b3ed5,_0x283336){_0x283336=_0x283336||0xcc;return function(_0x4e6739){if(_0x4e6739){return _0x4b3ed5[_0x9b0b('0x19')](_0x283336);}return _0x4b3ed5[_0x9b0b('0x1a')](_0x283336)['end']();};}function respondWithResult(_0x5974af,_0x5f0555){_0x5f0555=_0x5f0555||0xc8;return function(_0xe9c112){if(_0xe9c112){return _0x5974af[_0x9b0b('0x1a')](_0x5f0555)['json'](_0xe9c112);}};}function respondWithFilteredResult(_0x248ff9,_0x377736){return function(_0x297b07){if(_0x297b07){var _0x1e92c1=typeof _0x377736[_0x9b0b('0x1b')]===_0x9b0b('0x1c')&&typeof _0x377736[_0x9b0b('0x1d')]===_0x9b0b('0x1c');var _0x1b7673=_0x297b07[_0x9b0b('0x1e')];var _0x264b6d=_0x1e92c1?0x0:_0x377736[_0x9b0b('0x1b')];var _0x3334e5=_0x1e92c1?_0x297b07[_0x9b0b('0x1e')]:_0x377736['offset']+_0x377736[_0x9b0b('0x1d')];var _0xee66f5;if(_0x3334e5>=_0x1b7673){_0x3334e5=_0x1b7673;_0xee66f5=0xc8;}else{_0xee66f5=0xce;}_0x248ff9[_0x9b0b('0x1a')](_0xee66f5);return _0x248ff9['set'](_0x9b0b('0x1f'),_0x264b6d+'-'+_0x3334e5+'/'+_0x1b7673)[_0x9b0b('0x20')](_0x297b07);}return null;};}function patchUpdates(_0x4067d3){return function(_0x565d35){try{jsonpatch[_0x9b0b('0x21')](_0x565d35,_0x4067d3,!![]);}catch(_0x2218d5){return BPromise[_0x9b0b('0x22')](_0x2218d5);}return _0x565d35[_0x9b0b('0x23')]();};}function saveUpdates(_0x4fe0a2,_0x30bfe8){return function(_0x408f70){if(_0x408f70){return _0x408f70['update'](_0x4fe0a2)[_0x9b0b('0x24')](function(_0x1e7789){return _0x1e7789;});}return null;};}function removeEntity(_0x3f433c,_0x16b413){return function(_0xbf0f87){if(_0xbf0f87){return _0xbf0f87[_0x9b0b('0x25')]()[_0x9b0b('0x24')](function(){_0x3f433c[_0x9b0b('0x1a')](0xcc)[_0x9b0b('0x26')]();});}};}function handleEntityNotFound(_0x5771fd,_0x3da384){return function(_0x22a136){if(!_0x22a136){_0x5771fd[_0x9b0b('0x19')](0x194);}return _0x22a136;};}function handleError(_0x476482,_0x5bbbff){_0x5bbbff=_0x5bbbff||0x1f4;return function(_0x217ac4){logger[_0x9b0b('0x27')](_0x217ac4['stack']);if(_0x217ac4[_0x9b0b('0x28')]){delete _0x217ac4[_0x9b0b('0x28')];}_0x476482[_0x9b0b('0x1a')](_0x5bbbff)['send'](_0x217ac4);};}exports[_0x9b0b('0x29')]=function(_0xa4f392,_0x69307c){var _0x5507e1={},_0x2575d8={},_0x32668d={'count':0x0,'rows':[]};var _0x21b533=_[_0x9b0b('0x2a')](db['FaxQueueReport'][_0x9b0b('0x2b')],function(_0xfa71df){return{'name':_0xfa71df['fieldName'],'type':_0xfa71df[_0x9b0b('0x2c')][_0x9b0b('0x2d')]};});_0x2575d8[_0x9b0b('0x2e')]=_[_0x9b0b('0x2a')](_0x21b533,_0x9b0b('0x28'));_0x2575d8[_0x9b0b('0x2f')]=_[_0x9b0b('0x30')](_0xa4f392[_0x9b0b('0x2f')]);_0x2575d8['filters']=_['intersection'](_0x2575d8[_0x9b0b('0x2e')],_0x2575d8['query']);_0x5507e1[_0x9b0b('0x31')]=_['intersection'](_0x2575d8['model'],qs['fields'](_0xa4f392[_0x9b0b('0x2f')][_0x9b0b('0x32')]));_0x5507e1[_0x9b0b('0x31')]=_0x5507e1[_0x9b0b('0x31')][_0x9b0b('0x33')]?_0x5507e1[_0x9b0b('0x31')]:_0x2575d8[_0x9b0b('0x2e')];if(!_0xa4f392[_0x9b0b('0x2f')][_0x9b0b('0x34')](_0x9b0b('0x35'))){_0x5507e1[_0x9b0b('0x1d')]=qs[_0x9b0b('0x1d')](_0xa4f392[_0x9b0b('0x2f')]['limit']);_0x5507e1[_0x9b0b('0x1b')]=qs[_0x9b0b('0x1b')](_0xa4f392[_0x9b0b('0x2f')][_0x9b0b('0x1b')]);}_0x5507e1[_0x9b0b('0x36')]=qs[_0x9b0b('0x37')](_0xa4f392[_0x9b0b('0x2f')][_0x9b0b('0x37')]);_0x5507e1[_0x9b0b('0x38')]=qs[_0x9b0b('0x39')](_[_0x9b0b('0x3a')](_0xa4f392[_0x9b0b('0x2f')],_0x2575d8[_0x9b0b('0x39')]),_0x21b533);if(_0xa4f392['query']['filter']){_0x5507e1[_0x9b0b('0x38')]=_[_0x9b0b('0x3b')](_0x5507e1[_0x9b0b('0x38')],{'$or':_[_0x9b0b('0x2a')](_0x21b533,function(_0x3ff876){if(_0x3ff876['type']!==_0x9b0b('0x3c')){var _0x257ce7={};_0x257ce7[_0x3ff876[_0x9b0b('0x28')]]={'$like':'%'+_0xa4f392[_0x9b0b('0x2f')]['filter']+'%'};return _0x257ce7;}})});}_0x5507e1=_['merge']({},_0x5507e1,_0xa4f392[_0x9b0b('0x3d')]);var _0x509632={'where':_0x5507e1[_0x9b0b('0x38')]};return db[_0x9b0b('0x3e')][_0x9b0b('0x1e')](_0x509632)[_0x9b0b('0x24')](function(_0x334621){_0x32668d[_0x9b0b('0x1e')]=_0x334621;if(_0xa4f392[_0x9b0b('0x2f')][_0x9b0b('0x3f')]){_0x5507e1[_0x9b0b('0x40')]=[{'all':!![]}];}return db[_0x9b0b('0x3e')][_0x9b0b('0x41')](_0x5507e1);})[_0x9b0b('0x24')](function(_0x4049ad){_0x32668d[_0x9b0b('0x42')]=_0x4049ad;return _0x32668d;})[_0x9b0b('0x24')](respondWithFilteredResult(_0x69307c,_0x5507e1))['catch'](handleError(_0x69307c,null));};exports['show']=function(_0x4c9449,_0x42bf3f){var _0x42d7e3={'raw':!![],'where':{'id':_0x4c9449[_0x9b0b('0x43')]['id']}},_0x1522a1={};_0x1522a1[_0x9b0b('0x2e')]=_['keys'](db['FaxQueueReport'][_0x9b0b('0x2b')]);_0x1522a1[_0x9b0b('0x2f')]=_[_0x9b0b('0x30')](_0x4c9449[_0x9b0b('0x2f')]);_0x1522a1['filters']=_[_0x9b0b('0x44')](_0x1522a1[_0x9b0b('0x2e')],_0x1522a1[_0x9b0b('0x2f')]);_0x42d7e3[_0x9b0b('0x31')]=_[_0x9b0b('0x44')](_0x1522a1['model'],qs[_0x9b0b('0x32')](_0x4c9449[_0x9b0b('0x2f')][_0x9b0b('0x32')]));_0x42d7e3[_0x9b0b('0x31')]=_0x42d7e3[_0x9b0b('0x31')][_0x9b0b('0x33')]?_0x42d7e3[_0x9b0b('0x31')]:_0x1522a1[_0x9b0b('0x2e')];if(_0x4c9449['query']['includeAll']){_0x42d7e3['include']=[{'all':!![]}];}_0x42d7e3=_[_0x9b0b('0x3b')]({},_0x42d7e3,_0x4c9449[_0x9b0b('0x3d')]);return db[_0x9b0b('0x3e')][_0x9b0b('0x45')](_0x42d7e3)[_0x9b0b('0x24')](handleEntityNotFound(_0x42bf3f,null))[_0x9b0b('0x24')](respondWithResult(_0x42bf3f,null))[_0x9b0b('0x46')](handleError(_0x42bf3f,null));};exports[_0x9b0b('0x47')]=function(_0x35efbc,_0x1f2108){return db[_0x9b0b('0x3e')]['create'](_0x35efbc[_0x9b0b('0x48')],{})[_0x9b0b('0x24')](respondWithResult(_0x1f2108,0xc9))['catch'](handleError(_0x1f2108,null));};exports['update']=function(_0xd9410f,_0x990950){if(_0xd9410f[_0x9b0b('0x48')]['id']){delete _0xd9410f[_0x9b0b('0x48')]['id'];}return db['FaxQueueReport'][_0x9b0b('0x45')]({'where':{'id':_0xd9410f[_0x9b0b('0x43')]['id']}})[_0x9b0b('0x24')](handleEntityNotFound(_0x990950,null))[_0x9b0b('0x24')](saveUpdates(_0xd9410f[_0x9b0b('0x48')],null))[_0x9b0b('0x24')](respondWithResult(_0x990950,null))[_0x9b0b('0x46')](handleError(_0x990950,null));};exports[_0x9b0b('0x25')]=function(_0x146654,_0x5d71d7){return db[_0x9b0b('0x3e')]['find']({'where':{'id':_0x146654[_0x9b0b('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d71d7,null))['then'](removeEntity(_0x5d71d7,null))[_0x9b0b('0x46')](handleError(_0x5d71d7,null));};exports[_0x9b0b('0x49')]=function(_0x369752,_0x103281){return db[_0x9b0b('0x3e')][_0x9b0b('0x49')]()[_0x9b0b('0x24')](respondWithResult(_0x103281,null))['catch'](handleError(_0x103281,null));}; \ No newline at end of file +var _0xadec=['../../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','reject','update','then','destroy','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','squel','jsforce','querystring','papaparse','ioredis'];(function(_0x928dc4,_0x37a008){var _0x104bac=function(_0x46cc3a){while(--_0x46cc3a){_0x928dc4['push'](_0x928dc4['shift']());}};_0x104bac(++_0x37a008);}(_0xadec,0x156));var _0xcade=function(_0x42e8a6,_0xc5c6f3){_0x42e8a6=_0x42e8a6-0x0;var _0xd1b0c5=_0xadec[_0x42e8a6];return _0xd1b0c5;};'use strict';var emlformat=require(_0xcade('0x0'));var rimraf=require(_0xcade('0x1'));var zipdir=require(_0xcade('0x2'));var jsonpatch=require(_0xcade('0x3'));var rp=require(_0xcade('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcade('0x5'));var path=require(_0xcade('0x6'));var sox=require(_0xcade('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcade('0x8'));var crypto=require('crypto');var jsforce=require(_0xcade('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcade('0xa'));var Papa=require(_0xcade('0xb'));var Redis=require(_0xcade('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xcade('0xd'));var as=require(_0xcade('0xe'));var hardwareService=require(_0xcade('0xf'));var logger=require(_0xcade('0x10'))(_0xcade('0x11'));var utils=require(_0xcade('0x12'));var config=require(_0xcade('0x13'));var licenseUtil=require(_0xcade('0x14'));var db=require(_0xcade('0x15'))['db'];function respondWithStatusCode(_0x17623d,_0x136d02){_0x136d02=_0x136d02||0xcc;return function(_0x2fd9a4){if(_0x2fd9a4){return _0x17623d[_0xcade('0x16')](_0x136d02);}return _0x17623d[_0xcade('0x17')](_0x136d02)['end']();};}function respondWithResult(_0x31f018,_0x33d794){_0x33d794=_0x33d794||0xc8;return function(_0x2c5976){if(_0x2c5976){return _0x31f018['status'](_0x33d794)[_0xcade('0x18')](_0x2c5976);}};}function respondWithFilteredResult(_0x245621,_0x4be206){return function(_0x135fb7){if(_0x135fb7){var _0xa74f99=typeof _0x4be206[_0xcade('0x19')]==='undefined'&&typeof _0x4be206[_0xcade('0x1a')]===_0xcade('0x1b');var _0x28a720=_0x135fb7['count'];var _0x126272=_0xa74f99?0x0:_0x4be206[_0xcade('0x19')];var _0x1c7be1=_0xa74f99?_0x135fb7[_0xcade('0x1c')]:_0x4be206[_0xcade('0x19')]+_0x4be206[_0xcade('0x1a')];var _0x1e0ead;if(_0x1c7be1>=_0x28a720){_0x1c7be1=_0x28a720;_0x1e0ead=0xc8;}else{_0x1e0ead=0xce;}_0x245621['status'](_0x1e0ead);return _0x245621[_0xcade('0x1d')](_0xcade('0x1e'),_0x126272+'-'+_0x1c7be1+'/'+_0x28a720)[_0xcade('0x18')](_0x135fb7);}return null;};}function patchUpdates(_0x3e9cc6){return function(_0x13c11f){try{jsonpatch['apply'](_0x13c11f,_0x3e9cc6,!![]);}catch(_0x5e5a27){return BPromise[_0xcade('0x1f')](_0x5e5a27);}return _0x13c11f['save']();};}function saveUpdates(_0x1d1319,_0x3d09c7){return function(_0x1f705c){if(_0x1f705c){return _0x1f705c[_0xcade('0x20')](_0x1d1319)[_0xcade('0x21')](function(_0x13b3e5){return _0x13b3e5;});}return null;};}function removeEntity(_0x102e12,_0x264df7){return function(_0x356c91){if(_0x356c91){return _0x356c91[_0xcade('0x22')]()[_0xcade('0x21')](function(){_0x102e12[_0xcade('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4139b3,_0x37e1dc){return function(_0x4abc51){if(!_0x4abc51){_0x4139b3[_0xcade('0x16')](0x194);}return _0x4abc51;};}function handleError(_0x25cf6a,_0x468302){_0x468302=_0x468302||0x1f4;return function(_0x264f53){logger[_0xcade('0x23')](_0x264f53[_0xcade('0x24')]);if(_0x264f53[_0xcade('0x25')]){delete _0x264f53['name'];}_0x25cf6a[_0xcade('0x17')](_0x468302)[_0xcade('0x26')](_0x264f53);};}exports[_0xcade('0x27')]=function(_0x1874c6,_0x22b9ee){var _0x25cbdc={},_0x31fe0d={},_0xc48e74={'count':0x0,'rows':[]};var _0x494490=_[_0xcade('0x28')](db[_0xcade('0x29')][_0xcade('0x2a')],function(_0x28d9da){return{'name':_0x28d9da['fieldName'],'type':_0x28d9da[_0xcade('0x2b')][_0xcade('0x2c')]};});_0x31fe0d[_0xcade('0x2d')]=_[_0xcade('0x28')](_0x494490,_0xcade('0x25'));_0x31fe0d[_0xcade('0x2e')]=_['keys'](_0x1874c6[_0xcade('0x2e')]);_0x31fe0d[_0xcade('0x2f')]=_[_0xcade('0x30')](_0x31fe0d[_0xcade('0x2d')],_0x31fe0d['query']);_0x25cbdc[_0xcade('0x31')]=_[_0xcade('0x30')](_0x31fe0d[_0xcade('0x2d')],qs[_0xcade('0x32')](_0x1874c6[_0xcade('0x2e')][_0xcade('0x32')]));_0x25cbdc['attributes']=_0x25cbdc['attributes'][_0xcade('0x33')]?_0x25cbdc['attributes']:_0x31fe0d[_0xcade('0x2d')];if(!_0x1874c6[_0xcade('0x2e')][_0xcade('0x34')](_0xcade('0x35'))){_0x25cbdc[_0xcade('0x1a')]=qs[_0xcade('0x1a')](_0x1874c6[_0xcade('0x2e')][_0xcade('0x1a')]);_0x25cbdc[_0xcade('0x19')]=qs[_0xcade('0x19')](_0x1874c6[_0xcade('0x2e')][_0xcade('0x19')]);}_0x25cbdc['order']=qs['sort'](_0x1874c6['query'][_0xcade('0x36')]);_0x25cbdc['where']=qs[_0xcade('0x2f')](_['pick'](_0x1874c6['query'],_0x31fe0d['filters']),_0x494490);if(_0x1874c6['query']['filter']){_0x25cbdc[_0xcade('0x37')]=_['merge'](_0x25cbdc[_0xcade('0x37')],{'$or':_['map'](_0x494490,function(_0x134dfc){if(_0x134dfc[_0xcade('0x2b')]!==_0xcade('0x38')){var _0x1d129d={};_0x1d129d[_0x134dfc[_0xcade('0x25')]]={'$like':'%'+_0x1874c6[_0xcade('0x2e')]['filter']+'%'};return _0x1d129d;}})});}_0x25cbdc=_[_0xcade('0x39')]({},_0x25cbdc,_0x1874c6[_0xcade('0x3a')]);var _0x1ced10={'where':_0x25cbdc['where']};return db[_0xcade('0x29')][_0xcade('0x1c')](_0x1ced10)['then'](function(_0x292d80){_0xc48e74[_0xcade('0x1c')]=_0x292d80;if(_0x1874c6['query'][_0xcade('0x3b')]){_0x25cbdc[_0xcade('0x3c')]=[{'all':!![]}];}return db['FaxQueueReport'][_0xcade('0x3d')](_0x25cbdc);})[_0xcade('0x21')](function(_0x483e14){_0xc48e74[_0xcade('0x3e')]=_0x483e14;return _0xc48e74;})[_0xcade('0x21')](respondWithFilteredResult(_0x22b9ee,_0x25cbdc))[_0xcade('0x3f')](handleError(_0x22b9ee,null));};exports[_0xcade('0x40')]=function(_0x1d4bb2,_0x15840c){var _0x35cd3e={'raw':!![],'where':{'id':_0x1d4bb2[_0xcade('0x41')]['id']}},_0x1e4986={};_0x1e4986[_0xcade('0x2d')]=_[_0xcade('0x42')](db['FaxQueueReport'][_0xcade('0x2a')]);_0x1e4986['query']=_[_0xcade('0x42')](_0x1d4bb2[_0xcade('0x2e')]);_0x1e4986[_0xcade('0x2f')]=_['intersection'](_0x1e4986[_0xcade('0x2d')],_0x1e4986[_0xcade('0x2e')]);_0x35cd3e[_0xcade('0x31')]=_[_0xcade('0x30')](_0x1e4986[_0xcade('0x2d')],qs[_0xcade('0x32')](_0x1d4bb2['query']['fields']));_0x35cd3e['attributes']=_0x35cd3e[_0xcade('0x31')][_0xcade('0x33')]?_0x35cd3e[_0xcade('0x31')]:_0x1e4986[_0xcade('0x2d')];if(_0x1d4bb2['query'][_0xcade('0x3b')]){_0x35cd3e[_0xcade('0x3c')]=[{'all':!![]}];}_0x35cd3e=_[_0xcade('0x39')]({},_0x35cd3e,_0x1d4bb2['options']);return db['FaxQueueReport'][_0xcade('0x43')](_0x35cd3e)[_0xcade('0x21')](handleEntityNotFound(_0x15840c,null))[_0xcade('0x21')](respondWithResult(_0x15840c,null))[_0xcade('0x3f')](handleError(_0x15840c,null));};exports['create']=function(_0xab6d57,_0x18bb5a){return db[_0xcade('0x29')][_0xcade('0x44')](_0xab6d57[_0xcade('0x45')],{})[_0xcade('0x21')](respondWithResult(_0x18bb5a,0xc9))[_0xcade('0x3f')](handleError(_0x18bb5a,null));};exports['update']=function(_0x1d1f10,_0x28e618){if(_0x1d1f10[_0xcade('0x45')]['id']){delete _0x1d1f10[_0xcade('0x45')]['id'];}return db['FaxQueueReport'][_0xcade('0x43')]({'where':{'id':_0x1d1f10[_0xcade('0x41')]['id']}})[_0xcade('0x21')](handleEntityNotFound(_0x28e618,null))[_0xcade('0x21')](saveUpdates(_0x1d1f10[_0xcade('0x45')],null))[_0xcade('0x21')](respondWithResult(_0x28e618,null))[_0xcade('0x3f')](handleError(_0x28e618,null));};exports[_0xcade('0x22')]=function(_0x160ca9,_0x33c388){return db[_0xcade('0x29')]['find']({'where':{'id':_0x160ca9[_0xcade('0x41')]['id']}})[_0xcade('0x21')](handleEntityNotFound(_0x33c388,null))['then'](removeEntity(_0x33c388,null))[_0xcade('0x3f')](handleError(_0x33c388,null));};exports['describe']=function(_0x33a0ff,_0x46c626){return db['FaxQueueReport'][_0xcade('0x46')]()[_0xcade('0x21')](respondWithResult(_0x46c626,null))['catch'](handleError(_0x46c626,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index d5fe398..cef9e6d 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(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x1cb9,0x14e));var _0x91cb=function(_0x16d6e8,_0x4d8574){_0x16d6e8=_0x16d6e8-0x0;var _0x2ce7a4=_0x1cb9[_0x16d6e8];return _0x2ce7a4;};'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 _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x529834,_0xb68944){var _0x120984=function(_0x528b47){while(--_0x528b47){_0x529834['push'](_0x529834['shift']());}};_0x120984(++_0xb68944);}(_0x4975,0x86));var _0x5497=function(_0x26d13f,_0x2aeede){_0x26d13f=_0x26d13f-0x0;var _0x1ee5dc=_0x4975[_0x26d13f];return _0x1ee5dc;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index da06dbc..51d5920 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 _0xaaa1=['request\x20sent','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xaaa1,0xf8));var _0x1aaa=function(_0x49256f,_0x32fb14){_0x49256f=_0x49256f-0x0;var _0x4f31d1=_0xaaa1[_0x49256f];return _0x4f31d1;};'use strict';var _=require('lodash');var util=require(_0x1aaa('0x0'));var moment=require(_0x1aaa('0x1'));var BPromise=require('bluebird');var rs=require(_0x1aaa('0x2'));var fs=require('fs');var Redis=require(_0x1aaa('0x3'));var db=require(_0x1aaa('0x4'))['db'];var utils=require(_0x1aaa('0x5'));var logger=require('../../config/logger')(_0x1aaa('0x6'));var config=require(_0x1aaa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1aaa('0x8')][_0x1aaa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x247c52,_0x2dce8a,_0xc3f98b){return new BPromise(function(_0x2e6508,_0x462979){return client[_0x1aaa('0xa')](_0x247c52,_0xc3f98b)[_0x1aaa('0xb')](function(_0xe79210){logger[_0x1aaa('0xc')](_0x1aaa('0xd'),_0x2dce8a,'request\x20sent');logger[_0x1aaa('0xe')](_0x1aaa('0xf'),_0x2dce8a,_0x1aaa('0x10'),JSON[_0x1aaa('0x11')](_0xe79210));if(_0xe79210[_0x1aaa('0x12')]){if(_0xe79210['error'][_0x1aaa('0x13')]===0x1f4){logger[_0x1aaa('0x12')](_0x1aaa('0xd'),_0x2dce8a,_0xe79210[_0x1aaa('0x12')][_0x1aaa('0x14')]);return _0x462979(_0xe79210[_0x1aaa('0x12')][_0x1aaa('0x14')]);}logger[_0x1aaa('0x12')](_0x1aaa('0xd'),_0x2dce8a,_0xe79210[_0x1aaa('0x12')][_0x1aaa('0x14')]);return _0x2e6508(_0xe79210[_0x1aaa('0x12')][_0x1aaa('0x14')]);}else{logger['info'](_0x1aaa('0xd'),_0x2dce8a,_0x1aaa('0x10'));_0x2e6508(_0xe79210[_0x1aaa('0x15')][_0x1aaa('0x14')]);}})[_0x1aaa('0x16')](function(_0x376d7c){logger[_0x1aaa('0x12')](_0x1aaa('0xd'),_0x2dce8a,_0x376d7c);_0x462979(_0x376d7c);});});}exports[_0x1aaa('0x17')]=function(_0x457655){var _0x184fff=this;return new Promise(function(_0x3bddef,_0xec680){return db[_0x1aaa('0x18')][_0x1aaa('0x19')](_0x457655[_0x1aaa('0x1a')],{'raw':_0x457655['options']?_0x457655[_0x1aaa('0x1b')][_0x1aaa('0x1c')]===undefined?!![]:![]:!![]})[_0x1aaa('0xb')](function(_0x14c942){logger[_0x1aaa('0xc')](_0x1aaa('0x17'),_0x457655);logger[_0x1aaa('0xe')](_0x1aaa('0x17'),_0x457655,JSON[_0x1aaa('0x11')](_0x14c942));_0x3bddef(_0x14c942);})['catch'](function(_0x3feff4){logger[_0x1aaa('0x12')](_0x1aaa('0x17'),_0x3feff4[_0x1aaa('0x14')],_0x457655);_0xec680(_0x184fff['error'](0x1f4,_0x3feff4[_0x1aaa('0x14')]));});});};exports[_0x1aaa('0x1d')]=function(_0xed9466){var _0x4dba4d=this;return new Promise(function(_0x307054,_0x2b13f1){return db[_0x1aaa('0x18')][_0x1aaa('0x1e')](_0xed9466['body'],{'raw':_0xed9466[_0x1aaa('0x1b')]?_0xed9466['options'][_0x1aaa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xed9466[_0x1aaa('0x1b')]?_0xed9466[_0x1aaa('0x1b')]['where']||null:null,'attributes':_0xed9466['options']?_0xed9466[_0x1aaa('0x1b')][_0x1aaa('0x1f')]||null:null,'limit':_0xed9466[_0x1aaa('0x1b')]?_0xed9466[_0x1aaa('0x1b')][_0x1aaa('0x20')]||null:null})['then'](function(_0x5e2196){logger[_0x1aaa('0xc')]('UpdateFaxQueueReport',_0xed9466);logger[_0x1aaa('0xe')]('UpdateFaxQueueReport',_0xed9466,JSON[_0x1aaa('0x11')](_0x5e2196));_0x307054(_0x5e2196);})[_0x1aaa('0x16')](function(_0xa16673){logger['error'](_0x1aaa('0x1d'),_0xa16673['message'],_0xed9466);_0x2b13f1(_0x4dba4d[_0x1aaa('0x12')](0x1f4,_0xa16673[_0x1aaa('0x14')]));});});}; \ No newline at end of file +var _0xa4f4=['catch','CreateFaxQueueReport','body','options','then','UpdateFaxQueueReport','FaxQueueReport','raw','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3fd108,_0x5d911f){var _0x4f943f=function(_0x12abdf){while(--_0x12abdf){_0x3fd108['push'](_0x3fd108['shift']());}};_0x4f943f(++_0x5d911f);}(_0xa4f4,0x1b7));var _0x4a4f=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xa4f4[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0x4a4f('0x0'));var util=require(_0x4a4f('0x1'));var moment=require(_0x4a4f('0x2'));var BPromise=require(_0x4a4f('0x3'));var rs=require(_0x4a4f('0x4'));var fs=require('fs');var Redis=require(_0x4a4f('0x5'));var db=require(_0x4a4f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a4f('0x7'))('rpc');var config=require(_0x4a4f('0x8'));var jayson=require(_0x4a4f('0x9'));var client=jayson[_0x4a4f('0xa')][_0x4a4f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5da7ed,_0x5547ad,_0x2bec9a){return new BPromise(function(_0x53d6f8,_0x502498){return client[_0x4a4f('0xc')](_0x5da7ed,_0x2bec9a)['then'](function(_0xc4cafb){logger[_0x4a4f('0xd')](_0x4a4f('0xe'),_0x5547ad,_0x4a4f('0xf'));logger[_0x4a4f('0x10')](_0x4a4f('0x11'),_0x5547ad,_0x4a4f('0xf'),JSON[_0x4a4f('0x12')](_0xc4cafb));if(_0xc4cafb['error']){if(_0xc4cafb[_0x4a4f('0x13')][_0x4a4f('0x14')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x5547ad,_0xc4cafb['error']['message']);return _0x502498(_0xc4cafb[_0x4a4f('0x13')][_0x4a4f('0x15')]);}logger[_0x4a4f('0x13')](_0x4a4f('0xe'),_0x5547ad,_0xc4cafb[_0x4a4f('0x13')][_0x4a4f('0x15')]);return _0x53d6f8(_0xc4cafb[_0x4a4f('0x13')][_0x4a4f('0x15')]);}else{logger[_0x4a4f('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x5547ad,_0x4a4f('0xf'));_0x53d6f8(_0xc4cafb[_0x4a4f('0x16')][_0x4a4f('0x15')]);}})[_0x4a4f('0x17')](function(_0x31950e){logger[_0x4a4f('0x13')](_0x4a4f('0xe'),_0x5547ad,_0x31950e);_0x502498(_0x31950e);});});}exports[_0x4a4f('0x18')]=function(_0x2cfbab){var _0x42e9bf=this;return new Promise(function(_0x2b8fd2,_0x5b2c6a){return db['FaxQueueReport']['create'](_0x2cfbab[_0x4a4f('0x19')],{'raw':_0x2cfbab[_0x4a4f('0x1a')]?_0x2cfbab[_0x4a4f('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x4a4f('0x1b')](function(_0x25b67a){logger[_0x4a4f('0xd')](_0x4a4f('0x18'),_0x2cfbab);logger[_0x4a4f('0x10')](_0x4a4f('0x18'),_0x2cfbab,JSON[_0x4a4f('0x12')](_0x25b67a));_0x2b8fd2(_0x25b67a);})[_0x4a4f('0x17')](function(_0x3588e1){logger['error'](_0x4a4f('0x18'),_0x3588e1[_0x4a4f('0x15')],_0x2cfbab);_0x5b2c6a(_0x42e9bf[_0x4a4f('0x13')](0x1f4,_0x3588e1['message']));});});};exports[_0x4a4f('0x1c')]=function(_0x3f8fda){var _0x50e2e2=this;return new Promise(function(_0x4f996e,_0x5ee10f){return db[_0x4a4f('0x1d')]['update'](_0x3f8fda[_0x4a4f('0x19')],{'raw':_0x3f8fda[_0x4a4f('0x1a')]?_0x3f8fda[_0x4a4f('0x1a')][_0x4a4f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f8fda[_0x4a4f('0x1a')]?_0x3f8fda['options'][_0x4a4f('0x1f')]||null:null,'attributes':_0x3f8fda[_0x4a4f('0x1a')]?_0x3f8fda[_0x4a4f('0x1a')]['attributes']||null:null,'limit':_0x3f8fda[_0x4a4f('0x1a')]?_0x3f8fda[_0x4a4f('0x1a')][_0x4a4f('0x20')]||null:null})[_0x4a4f('0x1b')](function(_0x39f070){logger[_0x4a4f('0xd')](_0x4a4f('0x1c'),_0x3f8fda);logger[_0x4a4f('0x10')]('UpdateFaxQueueReport',_0x3f8fda,JSON['stringify'](_0x39f070));_0x4f996e(_0x39f070);})[_0x4a4f('0x17')](function(_0x36ede3){logger['error'](_0x4a4f('0x1c'),_0x36ede3[_0x4a4f('0x15')],_0x3f8fda);_0x5ee10f(_0x50e2e2[_0x4a4f('0x13')](0x1f4,_0x36ede3[_0x4a4f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index e2bc799..e6e5d29 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 _0xb02d=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x1b8e60,_0x21b885){var _0x363363=function(_0x5987c7){while(--_0x5987c7){_0x1b8e60['push'](_0x1b8e60['shift']());}};_0x363363(++_0x21b885);}(_0xb02d,0x8b));var _0xdb02=function(_0x55e593,_0x2ed3f8){_0x55e593=_0x55e593-0x0;var _0x2cadb6=_0xb02d[_0x55e593];return _0x2cadb6;};'use strict';var multer=require(_0xdb02('0x0'));var util=require(_0xdb02('0x1'));var path=require(_0xdb02('0x2'));var timeout=require(_0xdb02('0x3'));var express=require(_0xdb02('0x4'));var router=express['Router']();var fs_extra=require(_0xdb02('0x5'));var auth=require(_0xdb02('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdb02('0x7'));var controller=require(_0xdb02('0x8'));router[_0xdb02('0x9')]('/',auth['isAuthenticated'](),controller[_0xdb02('0xa')]);router[_0xdb02('0x9')](_0xdb02('0xb'),auth[_0xdb02('0xc')](),controller[_0xdb02('0xd')]);router[_0xdb02('0x9')](_0xdb02('0xe'),auth[_0xdb02('0xc')](),controller[_0xdb02('0xf')]);router[_0xdb02('0x10')]('/',auth[_0xdb02('0xc')](),controller[_0xdb02('0x11')]);router[_0xdb02('0x12')]('/:id',auth[_0xdb02('0xc')](),controller[_0xdb02('0x13')]);router[_0xdb02('0x14')](_0xdb02('0xe'),auth[_0xdb02('0xc')](),controller[_0xdb02('0x15')]);module[_0xdb02('0x16')]=router; \ No newline at end of file +var _0x0cab=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','connect-timeout'];(function(_0x52a35b,_0x30acc5){var _0xa9222c=function(_0x4ab9bd){while(--_0x4ab9bd){_0x52a35b['push'](_0x52a35b['shift']());}};_0xa9222c(++_0x30acc5);}(_0x0cab,0x10e));var _0xb0ca=function(_0x50150f,_0x92b2ca){_0x50150f=_0x50150f-0x0;var _0x3f3764=_0x0cab[_0x50150f];return _0x3f3764;};'use strict';var multer=require(_0xb0ca('0x0'));var util=require(_0xb0ca('0x1'));var path=require('path');var timeout=require(_0xb0ca('0x2'));var express=require(_0xb0ca('0x3'));var router=express[_0xb0ca('0x4')]();var fs_extra=require(_0xb0ca('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb0ca('0x6'));var config=require(_0xb0ca('0x7'));var controller=require(_0xb0ca('0x8'));router[_0xb0ca('0x9')]('/',auth[_0xb0ca('0xa')](),controller[_0xb0ca('0xb')]);router[_0xb0ca('0x9')](_0xb0ca('0xc'),auth[_0xb0ca('0xa')](),controller[_0xb0ca('0xd')]);router[_0xb0ca('0x9')](_0xb0ca('0xe'),auth['isAuthenticated'](),controller[_0xb0ca('0xf')]);router[_0xb0ca('0x10')]('/',auth[_0xb0ca('0xa')](),controller[_0xb0ca('0x11')]);router[_0xb0ca('0x12')](_0xb0ca('0xe'),auth[_0xb0ca('0xa')](),controller['update']);router['delete'](_0xb0ca('0xe'),auth[_0xb0ca('0xa')](),controller[_0xb0ca('0x13')]);module[_0xb0ca('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index b1e4620..b333985 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2974c1,_0x1c7b46){var _0x2372a0=function(_0x4bcec0){while(--_0x4bcec0){_0x2974c1['push'](_0x2974c1['shift']());}};_0x2372a0(++_0x1c7b46);}(_0x008c,0x188));var _0xc008=function(_0x3d7022,_0x59dfd5){_0x3d7022=_0x3d7022-0x0;var _0x40870b=_0x008c[_0x3d7022];return _0x40870b;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x117579,_0x31c20b){var _0x3ae06f=function(_0x208d32){while(--_0x208d32){_0x117579['push'](_0x117579['shift']());}};_0x3ae06f(++_0x31c20b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 33f2fb8..35d8d61 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 _0x00a8=['keys','filters','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','intersection','fields','include','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','end','error','name','send','map','FaxTransferReport','rawAttributes','type','key','query'];(function(_0x3b4cf2,_0xcd14fe){var _0x275256=function(_0x49f7d7){while(--_0x49f7d7){_0x3b4cf2['push'](_0x3b4cf2['shift']());}};_0x275256(++_0xcd14fe);}(_0x00a8,0xff));var _0x800a=function(_0x39fd80,_0x6c3bc5){_0x39fd80=_0x39fd80-0x0;var _0x1a6c57=_0x00a8[_0x39fd80];return _0x1a6c57;};'use strict';var emlformat=require(_0x800a('0x0'));var rimraf=require(_0x800a('0x1'));var zipdir=require(_0x800a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x800a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x800a('0x4'));var util=require(_0x800a('0x5'));var path=require(_0x800a('0x6'));var sox=require(_0x800a('0x7'));var csv=require('to-csv');var ejs=require(_0x800a('0x8'));var fs=require('fs');var fs_extra=require(_0x800a('0x9'));var _=require(_0x800a('0xa'));var squel=require(_0x800a('0xb'));var crypto=require(_0x800a('0xc'));var jsforce=require(_0x800a('0xd'));var deskjs=require(_0x800a('0xe'));var toCsv=require(_0x800a('0xf'));var querystring=require(_0x800a('0x10'));var Papa=require(_0x800a('0x11'));var Redis=require(_0x800a('0x12'));var authService=require(_0x800a('0x13'));var qs=require(_0x800a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x800a('0x15'));var logger=require('../../config/logger')(_0x800a('0x16'));var utils=require('../../config/utils');var config=require(_0x800a('0x17'));var licenseUtil=require(_0x800a('0x18'));var db=require(_0x800a('0x19'))['db'];function respondWithStatusCode(_0x27e033,_0x3649b2){_0x3649b2=_0x3649b2||0xcc;return function(_0x1d6853){if(_0x1d6853){return _0x27e033[_0x800a('0x1a')](_0x3649b2);}return _0x27e033[_0x800a('0x1b')](_0x3649b2)['end']();};}function respondWithResult(_0x143222,_0x3ed0c3){_0x3ed0c3=_0x3ed0c3||0xc8;return function(_0x45bdee){if(_0x45bdee){return _0x143222[_0x800a('0x1b')](_0x3ed0c3)[_0x800a('0x1c')](_0x45bdee);}};}function respondWithFilteredResult(_0x2d38e7,_0x146e36){return function(_0x2269cd){if(_0x2269cd){var _0x342865=typeof _0x146e36[_0x800a('0x1d')]===_0x800a('0x1e')&&typeof _0x146e36['limit']===_0x800a('0x1e');var _0x3354b9=_0x2269cd[_0x800a('0x1f')];var _0x35f21f=_0x342865?0x0:_0x146e36[_0x800a('0x1d')];var _0x2b3cae=_0x342865?_0x2269cd[_0x800a('0x1f')]:_0x146e36[_0x800a('0x1d')]+_0x146e36[_0x800a('0x20')];var _0x49458a;if(_0x2b3cae>=_0x3354b9){_0x2b3cae=_0x3354b9;_0x49458a=0xc8;}else{_0x49458a=0xce;}_0x2d38e7['status'](_0x49458a);return _0x2d38e7[_0x800a('0x21')](_0x800a('0x22'),_0x35f21f+'-'+_0x2b3cae+'/'+_0x3354b9)[_0x800a('0x1c')](_0x2269cd);}return null;};}function patchUpdates(_0xc7a7b4){return function(_0x591520){try{jsonpatch[_0x800a('0x23')](_0x591520,_0xc7a7b4,!![]);}catch(_0x773ae2){return BPromise['reject'](_0x773ae2);}return _0x591520[_0x800a('0x24')]();};}function saveUpdates(_0x416f0a,_0x378be6){return function(_0x217c2a){if(_0x217c2a){return _0x217c2a['update'](_0x416f0a)[_0x800a('0x25')](function(_0x3d60ab){return _0x3d60ab;});}return null;};}function removeEntity(_0x467aaf,_0x4a4493){return function(_0x44e671){if(_0x44e671){return _0x44e671[_0x800a('0x26')]()[_0x800a('0x25')](function(){_0x467aaf[_0x800a('0x1b')](0xcc)[_0x800a('0x27')]();});}};}function handleEntityNotFound(_0x151731,_0x3be692){return function(_0x37527c){if(!_0x37527c){_0x151731['sendStatus'](0x194);}return _0x37527c;};}function handleError(_0x3db217,_0x36a8c8){_0x36a8c8=_0x36a8c8||0x1f4;return function(_0x5ef24d){logger[_0x800a('0x28')](_0x5ef24d['stack']);if(_0x5ef24d[_0x800a('0x29')]){delete _0x5ef24d[_0x800a('0x29')];}_0x3db217[_0x800a('0x1b')](_0x36a8c8)[_0x800a('0x2a')](_0x5ef24d);};}exports['index']=function(_0x498ebd,_0x48b5ab){var _0x384571={},_0x123024={},_0x2702a5={'count':0x0,'rows':[]};var _0x150df5=_[_0x800a('0x2b')](db[_0x800a('0x2c')][_0x800a('0x2d')],function(_0x3b4898){return{'name':_0x3b4898['fieldName'],'type':_0x3b4898[_0x800a('0x2e')][_0x800a('0x2f')]};});_0x123024['model']=_[_0x800a('0x2b')](_0x150df5,_0x800a('0x29'));_0x123024[_0x800a('0x30')]=_[_0x800a('0x31')](_0x498ebd[_0x800a('0x30')]);_0x123024[_0x800a('0x32')]=_['intersection'](_0x123024[_0x800a('0x33')],_0x123024[_0x800a('0x30')]);_0x384571[_0x800a('0x34')]=_['intersection'](_0x123024[_0x800a('0x33')],qs['fields'](_0x498ebd[_0x800a('0x30')]['fields']));_0x384571[_0x800a('0x34')]=_0x384571[_0x800a('0x34')][_0x800a('0x35')]?_0x384571[_0x800a('0x34')]:_0x123024['model'];if(!_0x498ebd['query'][_0x800a('0x36')](_0x800a('0x37'))){_0x384571[_0x800a('0x20')]=qs[_0x800a('0x20')](_0x498ebd[_0x800a('0x30')][_0x800a('0x20')]);_0x384571[_0x800a('0x1d')]=qs[_0x800a('0x1d')](_0x498ebd[_0x800a('0x30')][_0x800a('0x1d')]);}_0x384571[_0x800a('0x38')]=qs[_0x800a('0x39')](_0x498ebd[_0x800a('0x30')][_0x800a('0x39')]);_0x384571[_0x800a('0x3a')]=qs['filters'](_['pick'](_0x498ebd[_0x800a('0x30')],_0x123024[_0x800a('0x32')]),_0x150df5);if(_0x498ebd[_0x800a('0x30')][_0x800a('0x3b')]){_0x384571[_0x800a('0x3a')]=_[_0x800a('0x3c')](_0x384571[_0x800a('0x3a')],{'$or':_[_0x800a('0x2b')](_0x150df5,function(_0x39696d){if(_0x39696d[_0x800a('0x2e')]!==_0x800a('0x3d')){var _0x29acaf={};_0x29acaf[_0x39696d[_0x800a('0x29')]]={'$like':'%'+_0x498ebd[_0x800a('0x30')][_0x800a('0x3b')]+'%'};return _0x29acaf;}})});}_0x384571=_[_0x800a('0x3c')]({},_0x384571,_0x498ebd[_0x800a('0x3e')]);var _0x4c4a43={'where':_0x384571[_0x800a('0x3a')]};return db[_0x800a('0x2c')][_0x800a('0x1f')](_0x4c4a43)['then'](function(_0x462d51){_0x2702a5[_0x800a('0x1f')]=_0x462d51;if(_0x498ebd[_0x800a('0x30')][_0x800a('0x3f')]){_0x384571['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x800a('0x40')](_0x384571);})[_0x800a('0x25')](function(_0x5a2a8c){_0x2702a5[_0x800a('0x41')]=_0x5a2a8c;return _0x2702a5;})[_0x800a('0x25')](respondWithFilteredResult(_0x48b5ab,_0x384571))[_0x800a('0x42')](handleError(_0x48b5ab,null));};exports['show']=function(_0x5961a8,_0x32c5f3){var _0x1e52f8={'raw':!![],'where':{'id':_0x5961a8['params']['id']}},_0x1cfec6={};_0x1cfec6[_0x800a('0x33')]=_[_0x800a('0x31')](db[_0x800a('0x2c')][_0x800a('0x2d')]);_0x1cfec6[_0x800a('0x30')]=_[_0x800a('0x31')](_0x5961a8[_0x800a('0x30')]);_0x1cfec6[_0x800a('0x32')]=_[_0x800a('0x43')](_0x1cfec6[_0x800a('0x33')],_0x1cfec6[_0x800a('0x30')]);_0x1e52f8[_0x800a('0x34')]=_[_0x800a('0x43')](_0x1cfec6[_0x800a('0x33')],qs[_0x800a('0x44')](_0x5961a8[_0x800a('0x30')][_0x800a('0x44')]));_0x1e52f8[_0x800a('0x34')]=_0x1e52f8[_0x800a('0x34')][_0x800a('0x35')]?_0x1e52f8[_0x800a('0x34')]:_0x1cfec6[_0x800a('0x33')];if(_0x5961a8[_0x800a('0x30')]['includeAll']){_0x1e52f8[_0x800a('0x45')]=[{'all':!![]}];}_0x1e52f8=_[_0x800a('0x3c')]({},_0x1e52f8,_0x5961a8[_0x800a('0x3e')]);return db[_0x800a('0x2c')]['find'](_0x1e52f8)['then'](handleEntityNotFound(_0x32c5f3,null))[_0x800a('0x25')](respondWithResult(_0x32c5f3,null))[_0x800a('0x42')](handleError(_0x32c5f3,null));};exports[_0x800a('0x46')]=function(_0x2bd367,_0x4253bd){return db['FaxTransferReport'][_0x800a('0x46')](_0x2bd367[_0x800a('0x47')],{})[_0x800a('0x25')](respondWithResult(_0x4253bd,0xc9))[_0x800a('0x42')](handleError(_0x4253bd,null));};exports[_0x800a('0x48')]=function(_0x145214,_0x1bd136){if(_0x145214['body']['id']){delete _0x145214[_0x800a('0x47')]['id'];}return db[_0x800a('0x2c')][_0x800a('0x49')]({'where':{'id':_0x145214['params']['id']}})[_0x800a('0x25')](handleEntityNotFound(_0x1bd136,null))['then'](saveUpdates(_0x145214[_0x800a('0x47')],null))[_0x800a('0x25')](respondWithResult(_0x1bd136,null))[_0x800a('0x42')](handleError(_0x1bd136,null));};exports[_0x800a('0x26')]=function(_0x410085,_0x5c400a){return db[_0x800a('0x2c')][_0x800a('0x49')]({'where':{'id':_0x410085[_0x800a('0x4a')]['id']}})[_0x800a('0x25')](handleEntityNotFound(_0x5c400a,null))['then'](removeEntity(_0x5c400a,null))['catch'](handleError(_0x5c400a,null));};exports['describe']=function(_0x2847b5,_0x194dc3){return db[_0x800a('0x2c')][_0x800a('0x4b')]()[_0x800a('0x25')](respondWithResult(_0x194dc3,null))[_0x800a('0x42')](handleError(_0x194dc3,null));}; \ No newline at end of file +var _0x639f=['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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','keys','query','filters','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','FaxTransferReport','includeAll','include','findAll','rows','show','params','intersection','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x639f,0x139));var _0xf639=function(_0x429391,_0x4d7dcb){_0x429391=_0x429391-0x0;var _0x47fe61=_0x639f[_0x429391];return _0x47fe61;};'use strict';var emlformat=require(_0xf639('0x0'));var rimraf=require(_0xf639('0x1'));var zipdir=require(_0xf639('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf639('0x3'));var moment=require(_0xf639('0x4'));var BPromise=require(_0xf639('0x5'));var Mustache=require(_0xf639('0x6'));var util=require(_0xf639('0x7'));var path=require(_0xf639('0x8'));var sox=require(_0xf639('0x9'));var csv=require(_0xf639('0xa'));var ejs=require(_0xf639('0xb'));var fs=require('fs');var fs_extra=require(_0xf639('0xc'));var _=require(_0xf639('0xd'));var squel=require(_0xf639('0xe'));var crypto=require(_0xf639('0xf'));var jsforce=require(_0xf639('0x10'));var deskjs=require(_0xf639('0x11'));var toCsv=require('to-csv');var querystring=require(_0xf639('0x12'));var Papa=require(_0xf639('0x13'));var Redis=require(_0xf639('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xf639('0x15'));var as=require(_0xf639('0x16'));var hardwareService=require(_0xf639('0x17'));var logger=require(_0xf639('0x18'))('api');var utils=require(_0xf639('0x19'));var config=require(_0xf639('0x1a'));var licenseUtil=require(_0xf639('0x1b'));var db=require(_0xf639('0x1c'))['db'];function respondWithStatusCode(_0x174fca,_0x224c75){_0x224c75=_0x224c75||0xcc;return function(_0x525278){if(_0x525278){return _0x174fca[_0xf639('0x1d')](_0x224c75);}return _0x174fca[_0xf639('0x1e')](_0x224c75)[_0xf639('0x1f')]();};}function respondWithResult(_0x2b653a,_0x4edce1){_0x4edce1=_0x4edce1||0xc8;return function(_0x133f17){if(_0x133f17){return _0x2b653a[_0xf639('0x1e')](_0x4edce1)['json'](_0x133f17);}};}function respondWithFilteredResult(_0x36e22c,_0x191ffa){return function(_0xfcb6d6){if(_0xfcb6d6){var _0x23cbc6=typeof _0x191ffa[_0xf639('0x20')]===_0xf639('0x21')&&typeof _0x191ffa[_0xf639('0x22')]===_0xf639('0x21');var _0x431b10=_0xfcb6d6[_0xf639('0x23')];var _0x455eb8=_0x23cbc6?0x0:_0x191ffa[_0xf639('0x20')];var _0x13f15=_0x23cbc6?_0xfcb6d6[_0xf639('0x23')]:_0x191ffa[_0xf639('0x20')]+_0x191ffa['limit'];var _0x5566f5;if(_0x13f15>=_0x431b10){_0x13f15=_0x431b10;_0x5566f5=0xc8;}else{_0x5566f5=0xce;}_0x36e22c[_0xf639('0x1e')](_0x5566f5);return _0x36e22c[_0xf639('0x24')](_0xf639('0x25'),_0x455eb8+'-'+_0x13f15+'/'+_0x431b10)[_0xf639('0x26')](_0xfcb6d6);}return null;};}function patchUpdates(_0x230b37){return function(_0xe0166a){try{jsonpatch['apply'](_0xe0166a,_0x230b37,!![]);}catch(_0x2e9704){return BPromise[_0xf639('0x27')](_0x2e9704);}return _0xe0166a[_0xf639('0x28')]();};}function saveUpdates(_0x2a3835,_0x5be0e6){return function(_0x47d82e){if(_0x47d82e){return _0x47d82e['update'](_0x2a3835)[_0xf639('0x29')](function(_0x51b9f2){return _0x51b9f2;});}return null;};}function removeEntity(_0x288e3a,_0x4399b3){return function(_0x362dbf){if(_0x362dbf){return _0x362dbf[_0xf639('0x2a')]()[_0xf639('0x29')](function(){_0x288e3a[_0xf639('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x409aea,_0x573420){return function(_0x95015c){if(!_0x95015c){_0x409aea[_0xf639('0x1d')](0x194);}return _0x95015c;};}function handleError(_0x32d420,_0x48125c){_0x48125c=_0x48125c||0x1f4;return function(_0x3969f1){logger[_0xf639('0x2b')](_0x3969f1[_0xf639('0x2c')]);if(_0x3969f1[_0xf639('0x2d')]){delete _0x3969f1[_0xf639('0x2d')];}_0x32d420['status'](_0x48125c)[_0xf639('0x2e')](_0x3969f1);};}exports[_0xf639('0x2f')]=function(_0x2b1924,_0x3fdaf2){var _0x304960={},_0x481262={},_0x179067={'count':0x0,'rows':[]};var _0x3229fc=_[_0xf639('0x30')](db['FaxTransferReport'][_0xf639('0x31')],function(_0x43039d){return{'name':_0x43039d[_0xf639('0x32')],'type':_0x43039d['type']['key']};});_0x481262['model']=_['map'](_0x3229fc,_0xf639('0x2d'));_0x481262['query']=_[_0xf639('0x33')](_0x2b1924[_0xf639('0x34')]);_0x481262[_0xf639('0x35')]=_['intersection'](_0x481262[_0xf639('0x36')],_0x481262[_0xf639('0x34')]);_0x304960[_0xf639('0x37')]=_['intersection'](_0x481262['model'],qs[_0xf639('0x38')](_0x2b1924[_0xf639('0x34')][_0xf639('0x38')]));_0x304960[_0xf639('0x37')]=_0x304960[_0xf639('0x37')]['length']?_0x304960['attributes']:_0x481262[_0xf639('0x36')];if(!_0x2b1924[_0xf639('0x34')][_0xf639('0x39')](_0xf639('0x3a'))){_0x304960['limit']=qs[_0xf639('0x22')](_0x2b1924[_0xf639('0x34')][_0xf639('0x22')]);_0x304960[_0xf639('0x20')]=qs[_0xf639('0x20')](_0x2b1924[_0xf639('0x34')][_0xf639('0x20')]);}_0x304960['order']=qs['sort'](_0x2b1924[_0xf639('0x34')][_0xf639('0x3b')]);_0x304960[_0xf639('0x3c')]=qs[_0xf639('0x35')](_[_0xf639('0x3d')](_0x2b1924[_0xf639('0x34')],_0x481262[_0xf639('0x35')]),_0x3229fc);if(_0x2b1924[_0xf639('0x34')][_0xf639('0x3e')]){_0x304960[_0xf639('0x3c')]=_[_0xf639('0x3f')](_0x304960[_0xf639('0x3c')],{'$or':_[_0xf639('0x30')](_0x3229fc,function(_0x136374){if(_0x136374['type']!==_0xf639('0x40')){var _0x13d4ea={};_0x13d4ea[_0x136374[_0xf639('0x2d')]]={'$like':'%'+_0x2b1924[_0xf639('0x34')][_0xf639('0x3e')]+'%'};return _0x13d4ea;}})});}_0x304960=_['merge']({},_0x304960,_0x2b1924[_0xf639('0x41')]);var _0x2493e2={'where':_0x304960[_0xf639('0x3c')]};return db[_0xf639('0x42')][_0xf639('0x23')](_0x2493e2)[_0xf639('0x29')](function(_0x4ff77f){_0x179067[_0xf639('0x23')]=_0x4ff77f;if(_0x2b1924[_0xf639('0x34')][_0xf639('0x43')]){_0x304960[_0xf639('0x44')]=[{'all':!![]}];}return db[_0xf639('0x42')][_0xf639('0x45')](_0x304960);})['then'](function(_0x2d6274){_0x179067[_0xf639('0x46')]=_0x2d6274;return _0x179067;})['then'](respondWithFilteredResult(_0x3fdaf2,_0x304960))['catch'](handleError(_0x3fdaf2,null));};exports[_0xf639('0x47')]=function(_0x4c21dd,_0x4d410a){var _0x3069da={'raw':!![],'where':{'id':_0x4c21dd[_0xf639('0x48')]['id']}},_0x4fc496={};_0x4fc496[_0xf639('0x36')]=_[_0xf639('0x33')](db[_0xf639('0x42')][_0xf639('0x31')]);_0x4fc496[_0xf639('0x34')]=_[_0xf639('0x33')](_0x4c21dd[_0xf639('0x34')]);_0x4fc496[_0xf639('0x35')]=_[_0xf639('0x49')](_0x4fc496['model'],_0x4fc496[_0xf639('0x34')]);_0x3069da[_0xf639('0x37')]=_['intersection'](_0x4fc496[_0xf639('0x36')],qs[_0xf639('0x38')](_0x4c21dd[_0xf639('0x34')][_0xf639('0x38')]));_0x3069da[_0xf639('0x37')]=_0x3069da['attributes'][_0xf639('0x4a')]?_0x3069da['attributes']:_0x4fc496[_0xf639('0x36')];if(_0x4c21dd[_0xf639('0x34')]['includeAll']){_0x3069da[_0xf639('0x44')]=[{'all':!![]}];}_0x3069da=_[_0xf639('0x3f')]({},_0x3069da,_0x4c21dd[_0xf639('0x41')]);return db['FaxTransferReport'][_0xf639('0x4b')](_0x3069da)[_0xf639('0x29')](handleEntityNotFound(_0x4d410a,null))[_0xf639('0x29')](respondWithResult(_0x4d410a,null))[_0xf639('0x4c')](handleError(_0x4d410a,null));};exports['create']=function(_0x4da6e7,_0x1009f9){return db[_0xf639('0x42')][_0xf639('0x4d')](_0x4da6e7['body'],{})['then'](respondWithResult(_0x1009f9,0xc9))[_0xf639('0x4c')](handleError(_0x1009f9,null));};exports['update']=function(_0x3d280c,_0x468cb6){if(_0x3d280c[_0xf639('0x4e')]['id']){delete _0x3d280c[_0xf639('0x4e')]['id'];}return db[_0xf639('0x42')][_0xf639('0x4b')]({'where':{'id':_0x3d280c['params']['id']}})['then'](handleEntityNotFound(_0x468cb6,null))[_0xf639('0x29')](saveUpdates(_0x3d280c['body'],null))[_0xf639('0x29')](respondWithResult(_0x468cb6,null))[_0xf639('0x4c')](handleError(_0x468cb6,null));};exports[_0xf639('0x2a')]=function(_0xdf1eb2,_0x5771a2){return db[_0xf639('0x42')][_0xf639('0x4b')]({'where':{'id':_0xdf1eb2[_0xf639('0x48')]['id']}})['then'](handleEntityNotFound(_0x5771a2,null))[_0xf639('0x29')](removeEntity(_0x5771a2,null))[_0xf639('0x4c')](handleError(_0x5771a2,null));};exports['describe']=function(_0x3638ff,_0xede676){return db[_0xf639('0x42')][_0xf639('0x4f')]()[_0xf639('0x29')](respondWithResult(_0xede676,null))[_0xf639('0x4c')](handleError(_0xede676,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 6d366c9..3619d24 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 _0x6333=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash','util','../../config/logger'];(function(_0x4b7175,_0x2c2dd6){var _0x3eeb4b=function(_0x1d6daa){while(--_0x1d6daa){_0x4b7175['push'](_0x4b7175['shift']());}};_0x3eeb4b(++_0x2c2dd6);}(_0x6333,0x185));var _0x3633=function(_0x5b8b3b,_0x316be5){_0x5b8b3b=_0x5b8b3b-0x0;var _0x464d44=_0x6333[_0x5b8b3b];return _0x464d44;};'use strict';var _=require(_0x3633('0x0'));var util=require(_0x3633('0x1'));var logger=require(_0x3633('0x2'))('api');var moment=require(_0x3633('0x3'));var BPromise=require(_0x3633('0x4'));var rp=require(_0x3633('0x5'));var fs=require('fs');var path=require(_0x3633('0x6'));var rimraf=require(_0x3633('0x7'));var config=require(_0x3633('0x8'));var attributes=require(_0x3633('0x9'));module[_0x3633('0xa')]=function(_0x2c7f15,_0x5a8701){return _0x2c7f15[_0x3633('0xb')](_0x3633('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x3633('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdadf=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0x802a34,_0x5cfc93){var _0x3f2655=function(_0x36f045){while(--_0x36f045){_0x802a34['push'](_0x802a34['shift']());}};_0x3f2655(++_0x5cfc93);}(_0xdadf,0x175));var _0xfdad=function(_0x2a09d6,_0x90f992){_0x2a09d6=_0x2a09d6-0x0;var _0x409854=_0xdadf[_0x2a09d6];return _0x409854;};'use strict';var _=require(_0xfdad('0x0'));var util=require(_0xfdad('0x1'));var logger=require('../../config/logger')(_0xfdad('0x2'));var moment=require(_0xfdad('0x3'));var BPromise=require(_0xfdad('0x4'));var rp=require(_0xfdad('0x5'));var fs=require('fs');var path=require(_0xfdad('0x6'));var rimraf=require(_0xfdad('0x7'));var config=require(_0xfdad('0x8'));var attributes=require(_0xfdad('0x9'));module[_0xfdad('0xa')]=function(_0x389088,_0x2ba0e8){return _0x389088[_0xfdad('0xb')](_0xfdad('0xc'),attributes,{'tableName':_0xfdad('0xd'),'paranoid':![],'indexes':[{'name':_0xfdad('0xe'),'fields':[_0xfdad('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index d16c2a5..4c4094f 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 _0xb4e8=['FaxTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xb4e8,0x184));var _0x8b4e=function(_0x2c8d1e,_0x52b307){_0x2c8d1e=_0x2c8d1e-0x0;var _0x24a2f3=_0xb4e8[_0x2c8d1e];return _0x24a2f3;};'use strict';var _=require(_0x8b4e('0x0'));var util=require(_0x8b4e('0x1'));var moment=require('moment');var BPromise=require(_0x8b4e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b4e('0x3'));var db=require(_0x8b4e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b4e('0x5'))('rpc');var config=require(_0x8b4e('0x6'));var jayson=require(_0x8b4e('0x7'));var client=jayson[_0x8b4e('0x8')][_0x8b4e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48c1a5,_0x72a51,_0x954a35){return new BPromise(function(_0x32d550,_0x216671){return client[_0x8b4e('0xa')](_0x48c1a5,_0x954a35)['then'](function(_0x3daee3){logger[_0x8b4e('0xb')](_0x8b4e('0xc'),_0x72a51,'request\x20sent');logger[_0x8b4e('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x72a51,_0x8b4e('0xe'),JSON['stringify'](_0x3daee3));if(_0x3daee3[_0x8b4e('0xf')]){if(_0x3daee3[_0x8b4e('0xf')][_0x8b4e('0x10')]===0x1f4){logger[_0x8b4e('0xf')](_0x8b4e('0xc'),_0x72a51,_0x3daee3[_0x8b4e('0xf')][_0x8b4e('0x11')]);return _0x216671(_0x3daee3['error']['message']);}logger[_0x8b4e('0xf')](_0x8b4e('0xc'),_0x72a51,_0x3daee3['error'][_0x8b4e('0x11')]);return _0x32d550(_0x3daee3[_0x8b4e('0xf')][_0x8b4e('0x11')]);}else{logger[_0x8b4e('0xb')](_0x8b4e('0xc'),_0x72a51,_0x8b4e('0xe'));_0x32d550(_0x3daee3[_0x8b4e('0x12')][_0x8b4e('0x11')]);}})[_0x8b4e('0x13')](function(_0x8c87f0){logger[_0x8b4e('0xf')](_0x8b4e('0xc'),_0x72a51,_0x8c87f0);_0x216671(_0x8c87f0);});});} \ No newline at end of file +var _0x0d1b=['../../config/logger','rpc','client','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x32a44b,_0x45f97f){var _0x503ccb=function(_0x16e541){while(--_0x16e541){_0x32a44b['push'](_0x32a44b['shift']());}};_0x503ccb(++_0x45f97f);}(_0x0d1b,0xcb));var _0xb0d1=function(_0x303183,_0x2fce95){_0x303183=_0x303183-0x0;var _0x4532b7=_0x0d1b[_0x303183];return _0x4532b7;};'use strict';var _=require(_0xb0d1('0x0'));var util=require(_0xb0d1('0x1'));var moment=require(_0xb0d1('0x2'));var BPromise=require(_0xb0d1('0x3'));var rs=require(_0xb0d1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb0d1('0x5'));var logger=require(_0xb0d1('0x6'))(_0xb0d1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb0d1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd67f04,_0x425082,_0x149dc2){return new BPromise(function(_0x708484,_0x2b2097){return client['request'](_0xd67f04,_0x149dc2)[_0xb0d1('0x9')](function(_0x173e28){logger[_0xb0d1('0xa')](_0xb0d1('0xb'),_0x425082,_0xb0d1('0xc'));logger[_0xb0d1('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x425082,_0xb0d1('0xc'),JSON[_0xb0d1('0xe')](_0x173e28));if(_0x173e28['error']){if(_0x173e28[_0xb0d1('0xf')][_0xb0d1('0x10')]===0x1f4){logger[_0xb0d1('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x425082,_0x173e28[_0xb0d1('0xf')][_0xb0d1('0x11')]);return _0x2b2097(_0x173e28[_0xb0d1('0xf')]['message']);}logger[_0xb0d1('0xf')](_0xb0d1('0xb'),_0x425082,_0x173e28[_0xb0d1('0xf')][_0xb0d1('0x11')]);return _0x708484(_0x173e28[_0xb0d1('0xf')]['message']);}else{logger[_0xb0d1('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x425082,_0xb0d1('0xc'));_0x708484(_0x173e28[_0xb0d1('0x12')][_0xb0d1('0x11')]);}})['catch'](function(_0x43fc4d){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x425082,_0x43fc4d);_0x2b2097(_0x43fc4d);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 7257f48..2b3849b 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 _0x36ae=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxTransferReport.controller','isAuthenticated','get','/describe','/:id','show','post','put'];(function(_0x2a24b2,_0x171540){var _0x2ed7d3=function(_0x49a1e7){while(--_0x49a1e7){_0x2a24b2['push'](_0x2a24b2['shift']());}};_0x2ed7d3(++_0x171540);}(_0x36ae,0x1a5));var _0xe36a=function(_0x120123,_0x4eff59){_0x120123=_0x120123-0x0;var _0x3bec4c=_0x36ae[_0x120123];return _0x3bec4c;};'use strict';var multer=require(_0xe36a('0x0'));var util=require(_0xe36a('0x1'));var path=require(_0xe36a('0x2'));var timeout=require(_0xe36a('0x3'));var express=require(_0xe36a('0x4'));var router=express[_0xe36a('0x5')]();var fs_extra=require(_0xe36a('0x6'));var auth=require(_0xe36a('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe36a('0x8'));router['get']('/',auth[_0xe36a('0x9')](),controller['index']);router[_0xe36a('0xa')](_0xe36a('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe36a('0xa')](_0xe36a('0xc'),auth['isAuthenticated'](),controller[_0xe36a('0xd')]);router[_0xe36a('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe36a('0xf')](_0xe36a('0xc'),auth[_0xe36a('0x9')](),controller[_0xe36a('0x10')]);router[_0xe36a('0x11')](_0xe36a('0xc'),auth[_0xe36a('0x9')](),controller[_0xe36a('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe5d8=['index','/describe','describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x270ce4,_0x257737){var _0x52d5eb=function(_0x423a68){while(--_0x423a68){_0x270ce4['push'](_0x270ce4['shift']());}};_0x52d5eb(++_0x257737);}(_0xe5d8,0x131));var _0x8e5d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe5d8[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x8e5d('0x0'));var util=require(_0x8e5d('0x1'));var path=require(_0x8e5d('0x2'));var timeout=require(_0x8e5d('0x3'));var express=require(_0x8e5d('0x4'));var router=express['Router']();var fs_extra=require(_0x8e5d('0x5'));var auth=require(_0x8e5d('0x6'));var interaction=require(_0x8e5d('0x7'));var config=require(_0x8e5d('0x8'));var controller=require('./faxTransferReport.controller');router[_0x8e5d('0x9')]('/',auth['isAuthenticated'](),controller[_0x8e5d('0xa')]);router['get'](_0x8e5d('0xb'),auth['isAuthenticated'](),controller[_0x8e5d('0xc')]);router[_0x8e5d('0x9')](_0x8e5d('0xd'),auth[_0x8e5d('0xe')](),controller['show']);router[_0x8e5d('0xf')]('/',auth['isAuthenticated'](),controller[_0x8e5d('0x10')]);router[_0x8e5d('0x11')](_0x8e5d('0xd'),auth['isAuthenticated'](),controller[_0x8e5d('0x12')]);router[_0x8e5d('0x13')](_0x8e5d('0xd'),auth[_0x8e5d('0xe')](),controller[_0x8e5d('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index c92e8ce..a4c54dd 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 _0x62a8=['fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x1b5480,_0x45e7d4){var _0x1422e5=function(_0x3f14a8){while(--_0x3f14a8){_0x1b5480['push'](_0x1b5480['shift']());}};_0x1422e5(++_0x45e7d4);}(_0x62a8,0x16b));var _0x862a=function(_0x1b83b2,_0x5aad7c){_0x1b83b2=_0x1b83b2-0x0;var _0x5ebee5=_0x62a8[_0x1b83b2];return _0x5ebee5;};'use strict';var multer=require(_0x862a('0x0'));var util=require(_0x862a('0x1'));var path=require(_0x862a('0x2'));var timeout=require(_0x862a('0x3'));var express=require(_0x862a('0x4'));var router=express['Router']();var fs_extra=require(_0x862a('0x5'));var auth=require(_0x862a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x862a('0x7'));var controller=require('./intDeskAccount.controller');router[_0x862a('0x8')]('/',auth['isAuthenticated'](),controller[_0x862a('0x9')]);router['get'](_0x862a('0xa'),auth[_0x862a('0xb')](),controller[_0x862a('0xc')]);router[_0x862a('0x8')](_0x862a('0xd'),auth[_0x862a('0xb')](),controller[_0x862a('0xe')]);router[_0x862a('0x8')](_0x862a('0xf'),auth[_0x862a('0xb')](),controller[_0x862a('0x10')]);router[_0x862a('0x11')]('/',auth[_0x862a('0xb')](),controller[_0x862a('0x12')]);router['post'](_0x862a('0xd'),auth['isAuthenticated'](),controller[_0x862a('0x13')]);router[_0x862a('0x14')](_0x862a('0xa'),auth[_0x862a('0xb')](),controller[_0x862a('0x15')]);router['delete'](_0x862a('0xa'),auth[_0x862a('0xb')](),controller[_0x862a('0x16')]);module['exports']=router; \ No newline at end of file +var _0xa5ab=['multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskAccount.controller','isAuthenticated','show','getConfigurations','get','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy'];(function(_0x345ae9,_0x39628b){var _0x26fbff=function(_0x3ec167){while(--_0x3ec167){_0x345ae9['push'](_0x345ae9['shift']());}};_0x26fbff(++_0x39628b);}(_0xa5ab,0xf2));var _0xba5a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5ab[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xba5a('0x0'));var util=require(_0xba5a('0x1'));var path=require('path');var timeout=require(_0xba5a('0x2'));var express=require(_0xba5a('0x3'));var router=express[_0xba5a('0x4')]();var fs_extra=require(_0xba5a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xba5a('0x6'));var controller=require(_0xba5a('0x7'));router['get']('/',auth[_0xba5a('0x8')](),controller['index']);router['get']('/:id',auth[_0xba5a('0x8')](),controller[_0xba5a('0x9')]);router['get']('/:id/configurations',auth[_0xba5a('0x8')](),controller[_0xba5a('0xa')]);router[_0xba5a('0xb')]('/:id/fields',auth[_0xba5a('0x8')](),controller[_0xba5a('0xc')]);router[_0xba5a('0xd')]('/',auth[_0xba5a('0x8')](),controller[_0xba5a('0xe')]);router['post'](_0xba5a('0xf'),auth[_0xba5a('0x8')](),controller[_0xba5a('0x10')]);router[_0xba5a('0x11')](_0xba5a('0x12'),auth[_0xba5a('0x8')](),controller[_0xba5a('0x13')]);router[_0xba5a('0x14')](_0xba5a('0x12'),auth['isAuthenticated'](),controller[_0xba5a('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index f094b76..de0666b 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 _0x0a4b=['exports','STRING','ENUM','basic','integrationTab','sequelize'];(function(_0x432e41,_0x3faf00){var _0x44689c=function(_0x2c82f3){while(--_0x2c82f3){_0x432e41['push'](_0x432e41['shift']());}};_0x44689c(++_0x3faf00);}(_0x0a4b,0x1f1));var _0xb0a4=function(_0x57fb89,_0x1be752){_0x57fb89=_0x57fb89-0x0;var _0x2434d3=_0x0a4b[_0x57fb89];return _0x2434d3;};'use strict';var Sequelize=require(_0xb0a4('0x0'));module[_0xb0a4('0x1')]={'name':{'type':Sequelize[_0xb0a4('0x2')]},'description':{'type':Sequelize[_0xb0a4('0x2')]},'username':{'type':Sequelize[_0xb0a4('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xb0a4('0x3')]('basic'),'defaultValue':_0xb0a4('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xb0a4('0x2')]},'consumerSecret':{'type':Sequelize[_0xb0a4('0x2')]},'token':{'type':Sequelize[_0xb0a4('0x2')]},'tokenSecret':{'type':Sequelize[_0xb0a4('0x2')]},'serverUrl':{'type':Sequelize[_0xb0a4('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb0a4('0x5'),'newTab'),'defaultValue':_0xb0a4('0x5')}}; \ No newline at end of file +var _0xbe93=['newTab','exports','STRING','ENUM','basic','integrationTab'];(function(_0x4a35a5,_0x9f13a4){var _0x10057b=function(_0x103f68){while(--_0x103f68){_0x4a35a5['push'](_0x4a35a5['shift']());}};_0x10057b(++_0x9f13a4);}(_0xbe93,0x10f));var _0x3be9=function(_0x10e88c,_0x2b5674){_0x10e88c=_0x10e88c-0x0;var _0x3f2d9b=_0xbe93[_0x10e88c];return _0x3f2d9b;};'use strict';var Sequelize=require('sequelize');module[_0x3be9('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3be9('0x1')]},'remoteUri':{'type':Sequelize[_0x3be9('0x1')]},'authType':{'type':Sequelize[_0x3be9('0x2')]('basic'),'defaultValue':_0x3be9('0x3')},'password':{'type':Sequelize[_0x3be9('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x3be9('0x1')]},'tokenSecret':{'type':Sequelize[_0x3be9('0x1')]},'serverUrl':{'type':Sequelize[_0x3be9('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3be9('0x4'),_0x3be9('0x5')),'defaultValue':_0x3be9('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 2678e26..e717ad6 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 _0x2a88=['slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','apply','reject','save','update','destroy','then','error','stack','name','send','map','DeskAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','length','find','create','body','findOne','DeskConfiguration','pick','getConfigurations','addConfiguration','AccountId','Subjects','channel','DeskField','getFields','priority','remoteUri','authType','username','password','consumerSecret','token'];(function(_0x57b3df,_0x445081){var _0x206656=function(_0x16aeb3){while(--_0x16aeb3){_0x57b3df['push'](_0x57b3df['shift']());}};_0x206656(++_0x445081);}(_0x2a88,0x159));var _0x82a8=function(_0x59ad64,_0x55af42){_0x59ad64=_0x59ad64-0x0;var _0x46311e=_0x2a88[_0x59ad64];return _0x46311e;};'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(_0x82a8('0x0'));var moment=require(_0x82a8('0x1'));var BPromise=require(_0x82a8('0x2'));var Mustache=require(_0x82a8('0x3'));var util=require(_0x82a8('0x4'));var path=require(_0x82a8('0x5'));var sox=require('sox');var csv=require(_0x82a8('0x6'));var ejs=require(_0x82a8('0x7'));var fs=require('fs');var fs_extra=require(_0x82a8('0x8'));var _=require(_0x82a8('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x82a8('0xa'));var deskjs=require(_0x82a8('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x82a8('0xc'));var Redis=require(_0x82a8('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x82a8('0xe'));var as=require(_0x82a8('0xf'));var hardwareService=require(_0x82a8('0x10'));var logger=require(_0x82a8('0x11'))(_0x82a8('0x12'));var utils=require(_0x82a8('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x82a8('0x14'))['db'];var integrations=require(_0x82a8('0x15'));function respondWithStatusCode(_0x52e3cc,_0x314e87){_0x314e87=_0x314e87||0xcc;return function(_0x2d2ee1){if(_0x2d2ee1){return _0x52e3cc[_0x82a8('0x16')](_0x314e87);}return _0x52e3cc['status'](_0x314e87)[_0x82a8('0x17')]();};}function respondWithResult(_0x1e9d18,_0x3b34c4){_0x3b34c4=_0x3b34c4||0xc8;return function(_0x40fd02){if(_0x40fd02){return _0x1e9d18[_0x82a8('0x18')](_0x3b34c4)[_0x82a8('0x19')](_0x40fd02);}};}function respondWithFilteredResult(_0x1bd71,_0x31c46d){return function(_0x174ee4){if(_0x174ee4){var _0xdf9228=typeof _0x31c46d[_0x82a8('0x1a')]==='undefined'&&typeof _0x31c46d['limit']===_0x82a8('0x1b');var _0x32b754=_0x174ee4['count'];var _0xc59ce5=_0xdf9228?0x0:_0x31c46d[_0x82a8('0x1a')];var _0x4ceba8=_0xdf9228?_0x174ee4['count']:_0x31c46d[_0x82a8('0x1a')]+_0x31c46d[_0x82a8('0x1c')];var _0x4c0e8c;if(_0x4ceba8>=_0x32b754){_0x4ceba8=_0x32b754;_0x4c0e8c=0xc8;}else{_0x4c0e8c=0xce;}_0x1bd71[_0x82a8('0x18')](_0x4c0e8c);return _0x1bd71['set']('Content-Range',_0xc59ce5+'-'+_0x4ceba8+'/'+_0x32b754)[_0x82a8('0x19')](_0x174ee4);}return null;};}function patchUpdates(_0x5cde8e){return function(_0x2af09b){try{jsonpatch[_0x82a8('0x1d')](_0x2af09b,_0x5cde8e,!![]);}catch(_0x11a155){return BPromise[_0x82a8('0x1e')](_0x11a155);}return _0x2af09b[_0x82a8('0x1f')]();};}function saveUpdates(_0x13439e,_0x26b481){return function(_0x5ccbe2){if(_0x5ccbe2){return _0x5ccbe2[_0x82a8('0x20')](_0x13439e)['then'](function(_0x150eb9){return _0x150eb9;});}return null;};}function removeEntity(_0x403dae,_0x1a72b2){return function(_0x1890d2){if(_0x1890d2){return _0x1890d2[_0x82a8('0x21')]()[_0x82a8('0x22')](function(){_0x403dae[_0x82a8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x509074,_0x3e670e){return function(_0x1cd73c){if(!_0x1cd73c){_0x509074['sendStatus'](0x194);}return _0x1cd73c;};}function handleError(_0x264543,_0x32b107){_0x32b107=_0x32b107||0x1f4;return function(_0x4aafab){logger[_0x82a8('0x23')](_0x4aafab[_0x82a8('0x24')]);if(_0x4aafab[_0x82a8('0x25')]){delete _0x4aafab[_0x82a8('0x25')];}_0x264543[_0x82a8('0x18')](_0x32b107)[_0x82a8('0x26')](_0x4aafab);};}exports['index']=function(_0x871f8c,_0xe93020){var _0x345618={},_0x9c7e72={},_0x3f637a={'count':0x0,'rows':[]};var _0x2c1d7c=_[_0x82a8('0x27')](db[_0x82a8('0x28')][_0x82a8('0x29')],function(_0x2b2cbf){return{'name':_0x2b2cbf[_0x82a8('0x2a')],'type':_0x2b2cbf[_0x82a8('0x2b')]['key']};});_0x9c7e72[_0x82a8('0x2c')]=_[_0x82a8('0x27')](_0x2c1d7c,'name');_0x9c7e72[_0x82a8('0x2d')]=_[_0x82a8('0x2e')](_0x871f8c[_0x82a8('0x2d')]);_0x9c7e72[_0x82a8('0x2f')]=_[_0x82a8('0x30')](_0x9c7e72[_0x82a8('0x2c')],_0x9c7e72[_0x82a8('0x2d')]);_0x345618['attributes']=_[_0x82a8('0x30')](_0x9c7e72[_0x82a8('0x2c')],qs[_0x82a8('0x31')](_0x871f8c[_0x82a8('0x2d')][_0x82a8('0x31')]));_0x345618[_0x82a8('0x32')]=_0x345618['attributes']['length']?_0x345618[_0x82a8('0x32')]:_0x9c7e72[_0x82a8('0x2c')];if(!_0x871f8c[_0x82a8('0x2d')][_0x82a8('0x33')](_0x82a8('0x34'))){_0x345618[_0x82a8('0x1c')]=qs[_0x82a8('0x1c')](_0x871f8c[_0x82a8('0x2d')][_0x82a8('0x1c')]);_0x345618[_0x82a8('0x1a')]=qs[_0x82a8('0x1a')](_0x871f8c[_0x82a8('0x2d')][_0x82a8('0x1a')]);}_0x345618[_0x82a8('0x35')]=qs[_0x82a8('0x36')](_0x871f8c[_0x82a8('0x2d')][_0x82a8('0x36')]);_0x345618[_0x82a8('0x37')]=qs[_0x82a8('0x2f')](_['pick'](_0x871f8c[_0x82a8('0x2d')],_0x9c7e72['filters']),_0x2c1d7c);if(_0x871f8c[_0x82a8('0x2d')]['filter']){_0x345618[_0x82a8('0x37')]=_[_0x82a8('0x38')](_0x345618[_0x82a8('0x37')],{'$or':_[_0x82a8('0x27')](_0x2c1d7c,function(_0x1b61a4){if(_0x1b61a4[_0x82a8('0x2b')]!==_0x82a8('0x39')){var _0x12fc53={};_0x12fc53[_0x1b61a4[_0x82a8('0x25')]]={'$like':'%'+_0x871f8c['query']['filter']+'%'};return _0x12fc53;}})});}_0x345618=_[_0x82a8('0x38')]({},_0x345618,_0x871f8c[_0x82a8('0x3a')]);var _0x3fdc22={'where':_0x345618[_0x82a8('0x37')]};return db[_0x82a8('0x28')][_0x82a8('0x3b')](_0x3fdc22)['then'](function(_0x2b9133){_0x3f637a[_0x82a8('0x3b')]=_0x2b9133;if(_0x871f8c[_0x82a8('0x2d')][_0x82a8('0x3c')]){_0x345618[_0x82a8('0x3d')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x345618);})[_0x82a8('0x22')](function(_0x1c8808){_0x3f637a[_0x82a8('0x3e')]=_0x1c8808;return _0x3f637a;})[_0x82a8('0x22')](respondWithFilteredResult(_0xe93020,_0x345618))[_0x82a8('0x3f')](handleError(_0xe93020,null));};exports[_0x82a8('0x40')]=function(_0x2dfb8a,_0x1f6996){var _0x4272c0={'raw':![],'where':{'id':_0x2dfb8a[_0x82a8('0x41')]['id']}},_0x506037={};_0x506037[_0x82a8('0x2c')]=_[_0x82a8('0x2e')](db[_0x82a8('0x28')]['rawAttributes']);_0x506037[_0x82a8('0x2d')]=_[_0x82a8('0x2e')](_0x2dfb8a[_0x82a8('0x2d')]);_0x506037[_0x82a8('0x2f')]=_[_0x82a8('0x30')](_0x506037[_0x82a8('0x2c')],_0x506037[_0x82a8('0x2d')]);_0x4272c0[_0x82a8('0x32')]=_[_0x82a8('0x30')](_0x506037['model'],qs[_0x82a8('0x31')](_0x2dfb8a['query'][_0x82a8('0x31')]));_0x4272c0[_0x82a8('0x32')]=_0x4272c0[_0x82a8('0x32')][_0x82a8('0x42')]?_0x4272c0[_0x82a8('0x32')]:_0x506037[_0x82a8('0x2c')];if(_0x2dfb8a['query'][_0x82a8('0x3c')]){_0x4272c0[_0x82a8('0x3d')]=[{'all':!![]}];}_0x4272c0=_[_0x82a8('0x38')]({},_0x4272c0,_0x2dfb8a[_0x82a8('0x3a')]);return db[_0x82a8('0x28')][_0x82a8('0x43')](_0x4272c0)['then'](handleEntityNotFound(_0x1f6996,null))[_0x82a8('0x22')](respondWithResult(_0x1f6996,null))[_0x82a8('0x3f')](handleError(_0x1f6996,null));};exports[_0x82a8('0x44')]=function(_0x47bf46,_0x3c5ad8){return db[_0x82a8('0x28')][_0x82a8('0x44')](_0x47bf46[_0x82a8('0x45')],{})[_0x82a8('0x22')](respondWithResult(_0x3c5ad8,0xc9))[_0x82a8('0x3f')](handleError(_0x3c5ad8,null));};exports[_0x82a8('0x20')]=function(_0x443d95,_0x41c2f0){if(_0x443d95[_0x82a8('0x45')]['id']){delete _0x443d95['body']['id'];}return db['DeskAccount']['find']({'where':{'id':_0x443d95[_0x82a8('0x41')]['id']}})[_0x82a8('0x22')](handleEntityNotFound(_0x41c2f0,null))[_0x82a8('0x22')](saveUpdates(_0x443d95['body'],null))[_0x82a8('0x22')](respondWithResult(_0x41c2f0,null))[_0x82a8('0x3f')](handleError(_0x41c2f0,null));};exports[_0x82a8('0x21')]=function(_0x4e8861,_0x26ecf8){return db[_0x82a8('0x28')]['find']({'where':{'id':_0x4e8861[_0x82a8('0x41')]['id']}})[_0x82a8('0x22')](handleEntityNotFound(_0x26ecf8,null))[_0x82a8('0x22')](removeEntity(_0x26ecf8,null))['catch'](handleError(_0x26ecf8,null));};exports['getConfigurations']=function(_0x11e577,_0x322868,_0x25d30e){var _0x596d9d={};var _0x437a15={};var _0x1a96ac;var _0x5bc79a;return db['DeskAccount'][_0x82a8('0x46')]({'where':{'id':_0x11e577[_0x82a8('0x41')]['id']}})['then'](handleEntityNotFound(_0x322868,null))[_0x82a8('0x22')](function(_0x127382){if(_0x127382){_0x1a96ac=_0x127382;_0x437a15[_0x82a8('0x2c')]=_[_0x82a8('0x2e')](db[_0x82a8('0x47')][_0x82a8('0x29')]);_0x437a15[_0x82a8('0x2d')]=_[_0x82a8('0x2e')](_0x11e577[_0x82a8('0x2d')]);_0x437a15[_0x82a8('0x2f')]=_[_0x82a8('0x30')](_0x437a15['model'],_0x437a15[_0x82a8('0x2d')]);_0x596d9d['attributes']=_[_0x82a8('0x30')](_0x437a15[_0x82a8('0x2c')],qs['fields'](_0x11e577[_0x82a8('0x2d')][_0x82a8('0x31')]));_0x596d9d[_0x82a8('0x32')]=_0x596d9d[_0x82a8('0x32')][_0x82a8('0x42')]?_0x596d9d[_0x82a8('0x32')]:_0x437a15[_0x82a8('0x2c')];_0x596d9d[_0x82a8('0x35')]=qs[_0x82a8('0x36')](_0x11e577[_0x82a8('0x2d')][_0x82a8('0x36')]);_0x596d9d[_0x82a8('0x37')]=qs['filters'](_[_0x82a8('0x48')](_0x11e577['query'],_0x437a15['filters']));if(_0x11e577[_0x82a8('0x2d')]['filter']){_0x596d9d[_0x82a8('0x37')]=_[_0x82a8('0x38')](_0x596d9d[_0x82a8('0x37')],{'$or':_['map'](_0x596d9d[_0x82a8('0x32')],function(_0xc7fc47){var _0x376caa={};_0x376caa[_0xc7fc47]={'$like':'%'+_0x11e577[_0x82a8('0x2d')]['filter']+'%'};return _0x376caa;})});}_0x596d9d=_[_0x82a8('0x38')]({},_0x596d9d,_0x11e577[_0x82a8('0x3a')]);return _0x1a96ac[_0x82a8('0x49')](_0x596d9d);}})['then'](function(_0x31f395){if(_0x31f395){_0x5bc79a=_0x31f395[_0x82a8('0x42')];if(!_0x11e577[_0x82a8('0x2d')][_0x82a8('0x33')](_0x82a8('0x34'))){_0x596d9d[_0x82a8('0x1c')]=qs[_0x82a8('0x1c')](_0x11e577['query'][_0x82a8('0x1c')]);_0x596d9d[_0x82a8('0x1a')]=qs[_0x82a8('0x1a')](_0x11e577[_0x82a8('0x2d')][_0x82a8('0x1a')]);}return _0x1a96ac[_0x82a8('0x49')](_0x596d9d);}})[_0x82a8('0x22')](function(_0x25c1a6){if(_0x25c1a6){return _0x25c1a6?{'count':_0x5bc79a,'rows':_0x25c1a6}:null;}})[_0x82a8('0x22')](respondWithResult(_0x322868,null))[_0x82a8('0x3f')](handleError(_0x322868,null));};exports[_0x82a8('0x4a')]=function(_0x55ac35,_0x45cd38,_0x2887ac){if(_0x55ac35[_0x82a8('0x45')]['id']){delete _0x55ac35[_0x82a8('0x45')]['id'];}return db[_0x82a8('0x28')][_0x82a8('0x46')]({'where':{'id':_0x55ac35[_0x82a8('0x41')]['id']}})[_0x82a8('0x22')](handleEntityNotFound(_0x45cd38,null))[_0x82a8('0x22')](function(_0xf4456a){if(_0xf4456a){_0x55ac35[_0x82a8('0x45')][_0x82a8('0x4b')]=_0xf4456a['id'];_0x55ac35[_0x82a8('0x45')][_0x82a8('0x4c')]=integrations['getSubjects'](_0x55ac35[_0x82a8('0x45')][_0x82a8('0x4d')],_0x55ac35[_0x82a8('0x45')][_0x82a8('0x2b')]);_0x55ac35['body']['Descriptions']=integrations['getDescriptions'](_0x55ac35[_0x82a8('0x45')][_0x82a8('0x4d')],_0x55ac35[_0x82a8('0x45')][_0x82a8('0x2b')]);return db[_0x82a8('0x47')][_0x82a8('0x44')](_0x55ac35[_0x82a8('0x45')],{'include':[{'model':db['DeskField'],'as':_0x82a8('0x4c')},{'model':db[_0x82a8('0x4e')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x45cd38,null))['catch'](handleError(_0x45cd38,null));};exports[_0x82a8('0x4f')]=function(_0x2a445c,_0x5ec6e2,_0x561c09){var _0x586b6e=[{'name':_0x82a8('0x50'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x3dfee1='';return db[_0x82a8('0x28')][_0x82a8('0x46')]({'where':{'id':_0x2a445c['params']['id']},'attributes':['id',_0x82a8('0x51'),_0x82a8('0x52'),_0x82a8('0x53'),_0x82a8('0x54'),'consumerKey',_0x82a8('0x55'),_0x82a8('0x56'),'tokenSecret']})[_0x82a8('0x22')](handleEntityNotFound(_0x5ec6e2,null))['then'](function(_0x4ea376){if(_0x4ea376){_0x3dfee1=_0x4ea376[_0x82a8('0x51')];var _0x8b2939=_0x3dfee1[_0x82a8('0x57')](-0x1);if(_0x8b2939==='/'){_0x3dfee1=_0x3dfee1['substring'](0x0,_0x3dfee1[_0x82a8('0x58')](_0x8b2939));}var _0x39ec67={'method':_0x82a8('0x59'),'uri':util[_0x82a8('0x5a')](_0x82a8('0x5b'),_0x3dfee1),'headers':{'Content-Type':_0x82a8('0x5c'),'Accept':'application/json'},'json':!![]};if(_0x4ea376[_0x82a8('0x52')]===_0x82a8('0x5d')){_0x39ec67[_0x82a8('0x5e')][_0x82a8('0x5f')]=util[_0x82a8('0x5a')](_0x82a8('0x60'),new Buffer(util['format'](_0x82a8('0x61'),_0x4ea376[_0x82a8('0x53')],_0x4ea376[_0x82a8('0x54')]))[_0x82a8('0x62')]('base64'));}return rp(_0x39ec67)['then'](function(_0xc5d20a){return _0x586b6e[_0x82a8('0x63')](_['map'](_0xc5d20a[_0x82a8('0x64')][_0x82a8('0x65')],function(_0x43b6d6){return{'id':_0x43b6d6[_0x82a8('0x25')],'name':_0x43b6d6[_0x82a8('0x25')],'type':_0x43b6d6[_0x82a8('0x2b')],'active':_0x43b6d6['active'],'label':_0x43b6d6[_0x82a8('0x66')],'custom':!![]};}));});}})['then'](function(_0x57033b){return{'count':_0x57033b['length'],'rows':_0x57033b};})[_0x82a8('0x22')](respondWithResult(_0x5ec6e2,null))[_0x82a8('0x3f')](function(_0x38a74a){var _0x4f5484=_0x2a445c[_0x82a8('0x2d')][_0x82a8('0x67')]?0x1f4:_0x38a74a[_0x82a8('0x68')]||0x1f4;logger[_0x82a8('0x23')](_0x82a8('0x69'),_0x82a8('0x4f'),_0x4f5484,JSON[_0x82a8('0x6a')](_0x38a74a));delete _0x38a74a[_0x82a8('0x25')];if(_0x4f5484===0x191){_0x4f5484=0x190;}_0x5ec6e2[_0x82a8('0x18')](_0x4f5484)[_0x82a8('0x26')](_0x2a445c[_0x82a8('0x2d')][_0x82a8('0x67')]?{'message':_0x82a8('0x6b'),'statusCode':_0x38a74a[_0x82a8('0x68')]}:_0x38a74a);});}; \ No newline at end of file +var _0x6e55=['update','then','destroy','error','stack','name','send','map','DeskAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','include','findAll','rows','show','params','includeAll','options','find','catch','create','body','DeskConfiguration','pick','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','priority','remoteUri','username','password','consumerSecret','token','substring','lastIndexOf','GET','format','%s/custom_fields','authType','basic','headers','Authorization','Basic\x20%s','%s:%s','base64','concat','_embedded','entries','active','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','reject','save'];(function(_0xb6e9ce,_0x3a75b7){var _0x21a0f4=function(_0x24fd3d){while(--_0x24fd3d){_0xb6e9ce['push'](_0xb6e9ce['shift']());}};_0x21a0f4(++_0x3a75b7);}(_0x6e55,0x198));var _0x56e5=function(_0x46e495,_0x2f02c0){_0x46e495=_0x46e495-0x0;var _0x419059=_0x6e55[_0x46e495];return _0x419059;};'use strict';var emlformat=require(_0x56e5('0x0'));var rimraf=require(_0x56e5('0x1'));var zipdir=require(_0x56e5('0x2'));var jsonpatch=require(_0x56e5('0x3'));var rp=require('request-promise');var moment=require(_0x56e5('0x4'));var BPromise=require(_0x56e5('0x5'));var Mustache=require('mustache');var util=require(_0x56e5('0x6'));var path=require(_0x56e5('0x7'));var sox=require(_0x56e5('0x8'));var csv=require('to-csv');var ejs=require(_0x56e5('0x9'));var fs=require('fs');var fs_extra=require(_0x56e5('0xa'));var _=require('lodash');var squel=require(_0x56e5('0xb'));var crypto=require(_0x56e5('0xc'));var jsforce=require(_0x56e5('0xd'));var deskjs=require(_0x56e5('0xe'));var toCsv=require(_0x56e5('0xf'));var querystring=require('querystring');var Papa=require(_0x56e5('0x10'));var Redis=require(_0x56e5('0x11'));var authService=require(_0x56e5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x56e5('0x13'));var hardwareService=require(_0x56e5('0x14'));var logger=require(_0x56e5('0x15'))('api');var utils=require(_0x56e5('0x16'));var config=require(_0x56e5('0x17'));var licenseUtil=require(_0x56e5('0x18'));var db=require(_0x56e5('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xeb2a37,_0x34da37){_0x34da37=_0x34da37||0xcc;return function(_0x228115){if(_0x228115){return _0xeb2a37[_0x56e5('0x1a')](_0x34da37);}return _0xeb2a37[_0x56e5('0x1b')](_0x34da37)[_0x56e5('0x1c')]();};}function respondWithResult(_0x51dd35,_0x35f986){_0x35f986=_0x35f986||0xc8;return function(_0x8db044){if(_0x8db044){return _0x51dd35[_0x56e5('0x1b')](_0x35f986)[_0x56e5('0x1d')](_0x8db044);}};}function respondWithFilteredResult(_0x337c5c,_0x2bb11f){return function(_0x353297){if(_0x353297){var _0x48ac3c=typeof _0x2bb11f[_0x56e5('0x1e')]==='undefined'&&typeof _0x2bb11f[_0x56e5('0x1f')]==='undefined';var _0x1de14f=_0x353297[_0x56e5('0x20')];var _0x1e0ee5=_0x48ac3c?0x0:_0x2bb11f['offset'];var _0x1da1d5=_0x48ac3c?_0x353297[_0x56e5('0x20')]:_0x2bb11f[_0x56e5('0x1e')]+_0x2bb11f[_0x56e5('0x1f')];var _0x402df8;if(_0x1da1d5>=_0x1de14f){_0x1da1d5=_0x1de14f;_0x402df8=0xc8;}else{_0x402df8=0xce;}_0x337c5c[_0x56e5('0x1b')](_0x402df8);return _0x337c5c[_0x56e5('0x21')]('Content-Range',_0x1e0ee5+'-'+_0x1da1d5+'/'+_0x1de14f)[_0x56e5('0x1d')](_0x353297);}return null;};}function patchUpdates(_0xdce5e){return function(_0x242675){try{jsonpatch['apply'](_0x242675,_0xdce5e,!![]);}catch(_0x1e0cec){return BPromise[_0x56e5('0x22')](_0x1e0cec);}return _0x242675[_0x56e5('0x23')]();};}function saveUpdates(_0x6bf0e0,_0x1e0127){return function(_0x3ff7f8){if(_0x3ff7f8){return _0x3ff7f8[_0x56e5('0x24')](_0x6bf0e0)[_0x56e5('0x25')](function(_0x354faa){return _0x354faa;});}return null;};}function removeEntity(_0x49b17b,_0x5c8b40){return function(_0x10b34c){if(_0x10b34c){return _0x10b34c[_0x56e5('0x26')]()[_0x56e5('0x25')](function(){_0x49b17b[_0x56e5('0x1b')](0xcc)[_0x56e5('0x1c')]();});}};}function handleEntityNotFound(_0x2d8813,_0x208140){return function(_0x45ab44){if(!_0x45ab44){_0x2d8813[_0x56e5('0x1a')](0x194);}return _0x45ab44;};}function handleError(_0x168b00,_0x33e198){_0x33e198=_0x33e198||0x1f4;return function(_0x1e74ce){logger[_0x56e5('0x27')](_0x1e74ce[_0x56e5('0x28')]);if(_0x1e74ce[_0x56e5('0x29')]){delete _0x1e74ce[_0x56e5('0x29')];}_0x168b00[_0x56e5('0x1b')](_0x33e198)[_0x56e5('0x2a')](_0x1e74ce);};}exports['index']=function(_0x3bec91,_0x2e6b92){var _0x17e2e3={},_0x33bd5e={},_0x6db0c8={'count':0x0,'rows':[]};var _0x11274f=_[_0x56e5('0x2b')](db[_0x56e5('0x2c')][_0x56e5('0x2d')],function(_0x76fcc7){return{'name':_0x76fcc7['fieldName'],'type':_0x76fcc7['type'][_0x56e5('0x2e')]};});_0x33bd5e[_0x56e5('0x2f')]=_[_0x56e5('0x2b')](_0x11274f,'name');_0x33bd5e[_0x56e5('0x30')]=_[_0x56e5('0x31')](_0x3bec91[_0x56e5('0x30')]);_0x33bd5e[_0x56e5('0x32')]=_[_0x56e5('0x33')](_0x33bd5e[_0x56e5('0x2f')],_0x33bd5e[_0x56e5('0x30')]);_0x17e2e3[_0x56e5('0x34')]=_[_0x56e5('0x33')](_0x33bd5e[_0x56e5('0x2f')],qs[_0x56e5('0x35')](_0x3bec91['query'][_0x56e5('0x35')]));_0x17e2e3[_0x56e5('0x34')]=_0x17e2e3[_0x56e5('0x34')][_0x56e5('0x36')]?_0x17e2e3[_0x56e5('0x34')]:_0x33bd5e[_0x56e5('0x2f')];if(!_0x3bec91[_0x56e5('0x30')][_0x56e5('0x37')]('nolimit')){_0x17e2e3[_0x56e5('0x1f')]=qs[_0x56e5('0x1f')](_0x3bec91[_0x56e5('0x30')][_0x56e5('0x1f')]);_0x17e2e3[_0x56e5('0x1e')]=qs['offset'](_0x3bec91[_0x56e5('0x30')][_0x56e5('0x1e')]);}_0x17e2e3[_0x56e5('0x38')]=qs[_0x56e5('0x39')](_0x3bec91[_0x56e5('0x30')][_0x56e5('0x39')]);_0x17e2e3[_0x56e5('0x3a')]=qs['filters'](_['pick'](_0x3bec91[_0x56e5('0x30')],_0x33bd5e['filters']),_0x11274f);if(_0x3bec91[_0x56e5('0x30')][_0x56e5('0x3b')]){_0x17e2e3[_0x56e5('0x3a')]=_[_0x56e5('0x3c')](_0x17e2e3[_0x56e5('0x3a')],{'$or':_[_0x56e5('0x2b')](_0x11274f,function(_0x34c78a){if(_0x34c78a[_0x56e5('0x3d')]!=='VIRTUAL'){var _0x4bd54a={};_0x4bd54a[_0x34c78a['name']]={'$like':'%'+_0x3bec91[_0x56e5('0x30')][_0x56e5('0x3b')]+'%'};return _0x4bd54a;}})});}_0x17e2e3=_[_0x56e5('0x3c')]({},_0x17e2e3,_0x3bec91['options']);var _0x518155={'where':_0x17e2e3[_0x56e5('0x3a')]};return db[_0x56e5('0x2c')]['count'](_0x518155)[_0x56e5('0x25')](function(_0x201840){_0x6db0c8['count']=_0x201840;if(_0x3bec91[_0x56e5('0x30')]['includeAll']){_0x17e2e3[_0x56e5('0x3e')]=[{'all':!![]}];}return db[_0x56e5('0x2c')][_0x56e5('0x3f')](_0x17e2e3);})['then'](function(_0x1d4125){_0x6db0c8[_0x56e5('0x40')]=_0x1d4125;return _0x6db0c8;})[_0x56e5('0x25')](respondWithFilteredResult(_0x2e6b92,_0x17e2e3))['catch'](handleError(_0x2e6b92,null));};exports[_0x56e5('0x41')]=function(_0x383957,_0x1bf9b8){var _0x13b690={'raw':![],'where':{'id':_0x383957[_0x56e5('0x42')]['id']}},_0x10e046={};_0x10e046[_0x56e5('0x2f')]=_[_0x56e5('0x31')](db[_0x56e5('0x2c')][_0x56e5('0x2d')]);_0x10e046[_0x56e5('0x30')]=_[_0x56e5('0x31')](_0x383957[_0x56e5('0x30')]);_0x10e046[_0x56e5('0x32')]=_['intersection'](_0x10e046[_0x56e5('0x2f')],_0x10e046[_0x56e5('0x30')]);_0x13b690[_0x56e5('0x34')]=_[_0x56e5('0x33')](_0x10e046[_0x56e5('0x2f')],qs[_0x56e5('0x35')](_0x383957['query'][_0x56e5('0x35')]));_0x13b690[_0x56e5('0x34')]=_0x13b690[_0x56e5('0x34')]['length']?_0x13b690[_0x56e5('0x34')]:_0x10e046['model'];if(_0x383957[_0x56e5('0x30')][_0x56e5('0x43')]){_0x13b690[_0x56e5('0x3e')]=[{'all':!![]}];}_0x13b690=_['merge']({},_0x13b690,_0x383957[_0x56e5('0x44')]);return db[_0x56e5('0x2c')][_0x56e5('0x45')](_0x13b690)[_0x56e5('0x25')](handleEntityNotFound(_0x1bf9b8,null))[_0x56e5('0x25')](respondWithResult(_0x1bf9b8,null))[_0x56e5('0x46')](handleError(_0x1bf9b8,null));};exports[_0x56e5('0x47')]=function(_0x6e3eed,_0x4c62e7){return db[_0x56e5('0x2c')][_0x56e5('0x47')](_0x6e3eed['body'],{})[_0x56e5('0x25')](respondWithResult(_0x4c62e7,0xc9))[_0x56e5('0x46')](handleError(_0x4c62e7,null));};exports['update']=function(_0x3c86f7,_0x2bdcce){if(_0x3c86f7[_0x56e5('0x48')]['id']){delete _0x3c86f7[_0x56e5('0x48')]['id'];}return db[_0x56e5('0x2c')]['find']({'where':{'id':_0x3c86f7['params']['id']}})[_0x56e5('0x25')](handleEntityNotFound(_0x2bdcce,null))[_0x56e5('0x25')](saveUpdates(_0x3c86f7[_0x56e5('0x48')],null))[_0x56e5('0x25')](respondWithResult(_0x2bdcce,null))[_0x56e5('0x46')](handleError(_0x2bdcce,null));};exports[_0x56e5('0x26')]=function(_0x205cc9,_0x4d21c7){return db[_0x56e5('0x2c')][_0x56e5('0x45')]({'where':{'id':_0x205cc9[_0x56e5('0x42')]['id']}})[_0x56e5('0x25')](handleEntityNotFound(_0x4d21c7,null))[_0x56e5('0x25')](removeEntity(_0x4d21c7,null))[_0x56e5('0x46')](handleError(_0x4d21c7,null));};exports['getConfigurations']=function(_0x1df6de,_0x51304c,_0x16a161){var _0x2419d0={};var _0x2dadc6={};var _0x144355;var _0x435ba8;return db['DeskAccount']['findOne']({'where':{'id':_0x1df6de['params']['id']}})[_0x56e5('0x25')](handleEntityNotFound(_0x51304c,null))['then'](function(_0x26a0a7){if(_0x26a0a7){_0x144355=_0x26a0a7;_0x2dadc6['model']=_[_0x56e5('0x31')](db[_0x56e5('0x49')][_0x56e5('0x2d')]);_0x2dadc6[_0x56e5('0x30')]=_[_0x56e5('0x31')](_0x1df6de[_0x56e5('0x30')]);_0x2dadc6[_0x56e5('0x32')]=_['intersection'](_0x2dadc6[_0x56e5('0x2f')],_0x2dadc6[_0x56e5('0x30')]);_0x2419d0[_0x56e5('0x34')]=_['intersection'](_0x2dadc6[_0x56e5('0x2f')],qs['fields'](_0x1df6de['query'][_0x56e5('0x35')]));_0x2419d0['attributes']=_0x2419d0[_0x56e5('0x34')]['length']?_0x2419d0[_0x56e5('0x34')]:_0x2dadc6[_0x56e5('0x2f')];_0x2419d0[_0x56e5('0x38')]=qs['sort'](_0x1df6de[_0x56e5('0x30')][_0x56e5('0x39')]);_0x2419d0[_0x56e5('0x3a')]=qs[_0x56e5('0x32')](_[_0x56e5('0x4a')](_0x1df6de['query'],_0x2dadc6[_0x56e5('0x32')]));if(_0x1df6de['query'][_0x56e5('0x3b')]){_0x2419d0[_0x56e5('0x3a')]=_['merge'](_0x2419d0['where'],{'$or':_['map'](_0x2419d0[_0x56e5('0x34')],function(_0x5ab371){var _0x50ea06={};_0x50ea06[_0x5ab371]={'$like':'%'+_0x1df6de['query'][_0x56e5('0x3b')]+'%'};return _0x50ea06;})});}_0x2419d0=_[_0x56e5('0x3c')]({},_0x2419d0,_0x1df6de[_0x56e5('0x44')]);return _0x144355[_0x56e5('0x4b')](_0x2419d0);}})['then'](function(_0x1819e0){if(_0x1819e0){_0x435ba8=_0x1819e0[_0x56e5('0x36')];if(!_0x1df6de[_0x56e5('0x30')][_0x56e5('0x37')](_0x56e5('0x4c'))){_0x2419d0[_0x56e5('0x1f')]=qs[_0x56e5('0x1f')](_0x1df6de[_0x56e5('0x30')][_0x56e5('0x1f')]);_0x2419d0[_0x56e5('0x1e')]=qs[_0x56e5('0x1e')](_0x1df6de[_0x56e5('0x30')]['offset']);}return _0x144355[_0x56e5('0x4b')](_0x2419d0);}})[_0x56e5('0x25')](function(_0x246951){if(_0x246951){return _0x246951?{'count':_0x435ba8,'rows':_0x246951}:null;}})[_0x56e5('0x25')](respondWithResult(_0x51304c,null))['catch'](handleError(_0x51304c,null));};exports[_0x56e5('0x4d')]=function(_0x49e037,_0x3c7339,_0x4946ab){if(_0x49e037[_0x56e5('0x48')]['id']){delete _0x49e037[_0x56e5('0x48')]['id'];}return db['DeskAccount'][_0x56e5('0x4e')]({'where':{'id':_0x49e037[_0x56e5('0x42')]['id']}})[_0x56e5('0x25')](handleEntityNotFound(_0x3c7339,null))[_0x56e5('0x25')](function(_0xca9eae){if(_0xca9eae){_0x49e037[_0x56e5('0x48')][_0x56e5('0x4f')]=_0xca9eae['id'];_0x49e037[_0x56e5('0x48')][_0x56e5('0x50')]=integrations[_0x56e5('0x51')](_0x49e037[_0x56e5('0x48')][_0x56e5('0x52')],_0x49e037[_0x56e5('0x48')][_0x56e5('0x3d')]);_0x49e037[_0x56e5('0x48')][_0x56e5('0x53')]=integrations['getDescriptions'](_0x49e037[_0x56e5('0x48')][_0x56e5('0x52')],_0x49e037[_0x56e5('0x48')][_0x56e5('0x3d')]);return db[_0x56e5('0x49')][_0x56e5('0x47')](_0x49e037['body'],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0x56e5('0x54')],'as':_0x56e5('0x53')}]});}return null;})[_0x56e5('0x25')](respondWithResult(_0x3c7339,null))[_0x56e5('0x46')](handleError(_0x3c7339,null));};exports['getFields']=function(_0x5932f7,_0x20dbde,_0x4db4ac){var _0x42460e=[{'name':_0x56e5('0x55'),'label':_0x56e5('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x581e0d='';return db[_0x56e5('0x2c')]['findOne']({'where':{'id':_0x5932f7[_0x56e5('0x42')]['id']},'attributes':['id',_0x56e5('0x56'),'authType',_0x56e5('0x57'),_0x56e5('0x58'),'consumerKey',_0x56e5('0x59'),_0x56e5('0x5a'),'tokenSecret']})['then'](handleEntityNotFound(_0x20dbde,null))[_0x56e5('0x25')](function(_0x4a3d74){if(_0x4a3d74){_0x581e0d=_0x4a3d74[_0x56e5('0x56')];var _0x59b418=_0x581e0d['slice'](-0x1);if(_0x59b418==='/'){_0x581e0d=_0x581e0d[_0x56e5('0x5b')](0x0,_0x581e0d[_0x56e5('0x5c')](_0x59b418));}var _0x543e34={'method':_0x56e5('0x5d'),'uri':util[_0x56e5('0x5e')](_0x56e5('0x5f'),_0x581e0d),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x4a3d74[_0x56e5('0x60')]===_0x56e5('0x61')){_0x543e34[_0x56e5('0x62')][_0x56e5('0x63')]=util['format'](_0x56e5('0x64'),new Buffer(util['format'](_0x56e5('0x65'),_0x4a3d74['username'],_0x4a3d74[_0x56e5('0x58')]))['toString'](_0x56e5('0x66')));}return rp(_0x543e34)['then'](function(_0x2a36fc){return _0x42460e[_0x56e5('0x67')](_[_0x56e5('0x2b')](_0x2a36fc[_0x56e5('0x68')][_0x56e5('0x69')],function(_0x51d3d2){return{'id':_0x51d3d2[_0x56e5('0x29')],'name':_0x51d3d2[_0x56e5('0x29')],'type':_0x51d3d2[_0x56e5('0x3d')],'active':_0x51d3d2[_0x56e5('0x6a')],'label':_0x51d3d2['label'],'custom':!![]};}));});}})[_0x56e5('0x25')](function(_0x2112a0){return{'count':_0x2112a0['length'],'rows':_0x2112a0};})[_0x56e5('0x25')](respondWithResult(_0x20dbde,null))['catch'](function(_0x2302e7){var _0x4f12d4=_0x5932f7[_0x56e5('0x30')]['test']?0x1f4:_0x2302e7['statusCode']||0x1f4;logger[_0x56e5('0x27')](_0x56e5('0x6b'),'getFields',_0x4f12d4,JSON['stringify'](_0x2302e7));delete _0x2302e7[_0x56e5('0x29')];if(_0x4f12d4===0x191){_0x4f12d4=0x190;}_0x20dbde['status'](_0x4f12d4)['send'](_0x5932f7[_0x56e5('0x30')][_0x56e5('0x6c')]?{'message':_0x56e5('0x6d'),'statusCode':_0x2302e7[_0x56e5('0x6e')]}:_0x2302e7);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index c548585..d434056 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 _0x15c2=['./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2bb3e2,_0x3e6219){var _0x582650=function(_0x1a334d){while(--_0x1a334d){_0x2bb3e2['push'](_0x2bb3e2['shift']());}};_0x582650(++_0x3e6219);}(_0x15c2,0x191));var _0x215c=function(_0x485666,_0x3e8d2f){_0x485666=_0x485666-0x0;var _0x932e40=_0x15c2[_0x485666];return _0x932e40;};'use strict';var _=require('lodash');var util=require(_0x215c('0x0'));var logger=require('../../config/logger')(_0x215c('0x1'));var moment=require(_0x215c('0x2'));var BPromise=require(_0x215c('0x3'));var rp=require(_0x215c('0x4'));var fs=require('fs');var path=require(_0x215c('0x5'));var rimraf=require(_0x215c('0x6'));var config=require('../../config/environment');var attributes=require(_0x215c('0x7'));var integrations=require(_0x215c('0x8'));module['exports']=function(_0x48932f,_0x5882d9){return _0x48932f[_0x215c('0x9')](_0x215c('0xa'),attributes,{'tableName':_0x215c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb660=['moment','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api'];(function(_0x268000,_0xd65943){var _0x3bdfe1=function(_0x3af23a){while(--_0x3af23a){_0x268000['push'](_0x268000['shift']());}};_0x3bdfe1(++_0xd65943);}(_0xb660,0xec));var _0x0b66=function(_0x1a494a,_0x3d6906){_0x1a494a=_0x1a494a-0x0;var _0x59a162=_0xb660[_0x1a494a];return _0x59a162;};'use strict';var _=require(_0x0b66('0x0'));var util=require(_0x0b66('0x1'));var logger=require(_0x0b66('0x2'))(_0x0b66('0x3'));var moment=require(_0x0b66('0x4'));var BPromise=require('bluebird');var rp=require(_0x0b66('0x5'));var fs=require('fs');var path=require(_0x0b66('0x6'));var rimraf=require(_0x0b66('0x7'));var config=require('../../config/environment');var attributes=require(_0x0b66('0x8'));var integrations=require(_0x0b66('0x9'));module['exports']=function(_0x50770f,_0xa0b4c9){return _0x50770f['define'](_0x0b66('0xa'),attributes,{'tableName':_0x0b66('0xb'),'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 d4d5337..885c0ac 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 _0x07b4=['attributes','limit','map','include','model','catch','find','ShowDeskAccount','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetDeskAccount','DeskAccount','findAll','options','raw','where'];(function(_0x3d74bd,_0x42514b){var _0x51c829=function(_0x5bd667){while(--_0x5bd667){_0x3d74bd['push'](_0x3d74bd['shift']());}};_0x51c829(++_0x42514b);}(_0x07b4,0xbc));var _0x407b=function(_0x231928,_0x17a84a){_0x231928=_0x231928-0x0;var _0x200adf=_0x07b4[_0x231928];return _0x200adf;};'use strict';var _=require('lodash');var util=require(_0x407b('0x0'));var moment=require(_0x407b('0x1'));var BPromise=require(_0x407b('0x2'));var rs=require(_0x407b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x407b('0x4'))['db'];var utils=require(_0x407b('0x5'));var logger=require(_0x407b('0x6'))(_0x407b('0x7'));var config=require(_0x407b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x407b('0x9')][_0x407b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcf1615,_0x1cb7a9,_0x329e4a){return new BPromise(function(_0x1bed49,_0x2eff83){return client[_0x407b('0xb')](_0xcf1615,_0x329e4a)[_0x407b('0xc')](function(_0x2ffd1b){logger[_0x407b('0xd')](_0x407b('0xe'),_0x1cb7a9,'request\x20sent');logger[_0x407b('0xf')](_0x407b('0x10'),_0x1cb7a9,_0x407b('0x11'),JSON[_0x407b('0x12')](_0x2ffd1b));if(_0x2ffd1b[_0x407b('0x13')]){if(_0x2ffd1b[_0x407b('0x13')]['code']===0x1f4){logger[_0x407b('0x13')](_0x407b('0xe'),_0x1cb7a9,_0x2ffd1b[_0x407b('0x13')][_0x407b('0x14')]);return _0x2eff83(_0x2ffd1b['error'][_0x407b('0x14')]);}logger[_0x407b('0x13')]('DeskAccount,\x20%s,\x20%s',_0x1cb7a9,_0x2ffd1b['error']['message']);return _0x1bed49(_0x2ffd1b[_0x407b('0x13')][_0x407b('0x14')]);}else{logger['info'](_0x407b('0xe'),_0x1cb7a9,'request\x20sent');_0x1bed49(_0x2ffd1b[_0x407b('0x15')][_0x407b('0x14')]);}})['catch'](function(_0x5654ce){logger['error'](_0x407b('0xe'),_0x1cb7a9,_0x5654ce);_0x2eff83(_0x5654ce);});});}exports[_0x407b('0x16')]=function(_0x208dcb){var _0x592709=this;return new Promise(function(_0x5c6fab,_0x32432c){return db[_0x407b('0x17')][_0x407b('0x18')]({'raw':_0x208dcb['options']?_0x208dcb[_0x407b('0x19')][_0x407b('0x1a')]===undefined?!![]:![]:!![],'where':_0x208dcb[_0x407b('0x19')]?_0x208dcb[_0x407b('0x19')][_0x407b('0x1b')]||null:null,'attributes':_0x208dcb[_0x407b('0x19')]?_0x208dcb[_0x407b('0x19')][_0x407b('0x1c')]||null:null,'limit':_0x208dcb[_0x407b('0x19')]?_0x208dcb[_0x407b('0x19')][_0x407b('0x1d')]||null:null,'include':_0x208dcb[_0x407b('0x19')]?_0x208dcb[_0x407b('0x19')]['include']?_[_0x407b('0x1e')](_0x208dcb[_0x407b('0x19')][_0x407b('0x1f')],function(_0x2b8eda){return{'model':db[_0x2b8eda[_0x407b('0x20')]],'as':_0x2b8eda['as'],'attributes':_0x2b8eda[_0x407b('0x1c')],'include':_0x2b8eda[_0x407b('0x1f')]?_['map'](_0x2b8eda[_0x407b('0x1f')],function(_0xaff8c5){return{'model':db[_0xaff8c5[_0x407b('0x20')]],'as':_0xaff8c5['as'],'attributes':_0xaff8c5[_0x407b('0x1c')],'include':_0xaff8c5[_0x407b('0x1f')]?_[_0x407b('0x1e')](_0xaff8c5[_0x407b('0x1f')],function(_0x522c18){return{'model':db[_0x522c18[_0x407b('0x20')]],'as':_0x522c18['as'],'attributes':_0x522c18['attributes']};}):[]};}):[]};}):[]:[]})[_0x407b('0xc')](function(_0x3fe381){logger[_0x407b('0xd')]('GetDeskAccount',_0x208dcb);logger['debug'](_0x407b('0x16'),_0x208dcb,JSON[_0x407b('0x12')](_0x3fe381));_0x5c6fab(_0x3fe381);})[_0x407b('0x21')](function(_0x5171f7){logger[_0x407b('0x13')](_0x407b('0x16'),_0x5171f7[_0x407b('0x14')],_0x208dcb);_0x32432c(_0x592709[_0x407b('0x13')](0x1f4,_0x5171f7['message']));});});};exports['ShowDeskAccount']=function(_0x142988){var _0x522582=this;return new Promise(function(_0x462036,_0x523dc1){return db['DeskAccount'][_0x407b('0x22')]({'raw':_0x142988[_0x407b('0x19')]?_0x142988['options'][_0x407b('0x1a')]===undefined?!![]:![]:!![],'where':_0x142988[_0x407b('0x19')]?_0x142988['options'][_0x407b('0x1b')]||null:null,'attributes':_0x142988[_0x407b('0x19')]?_0x142988['options'][_0x407b('0x1c')]||null:null,'include':_0x142988['options']?_0x142988[_0x407b('0x19')]['include']?_[_0x407b('0x1e')](_0x142988['options'][_0x407b('0x1f')],function(_0x44ea0d){return{'model':db[_0x44ea0d[_0x407b('0x20')]],'as':_0x44ea0d['as'],'attributes':_0x44ea0d[_0x407b('0x1c')],'include':_0x44ea0d[_0x407b('0x1f')]?_['map'](_0x44ea0d[_0x407b('0x1f')],function(_0x55b90b){return{'model':db[_0x55b90b[_0x407b('0x20')]],'as':_0x55b90b['as'],'attributes':_0x55b90b['attributes'],'include':_0x55b90b[_0x407b('0x1f')]?_['map'](_0x55b90b[_0x407b('0x1f')],function(_0x2f36d2){return{'model':db[_0x2f36d2[_0x407b('0x20')]],'as':_0x2f36d2['as'],'attributes':_0x2f36d2[_0x407b('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31555e){logger[_0x407b('0xd')]('ShowDeskAccount',_0x142988);logger[_0x407b('0xf')]('ShowDeskAccount',_0x142988,JSON[_0x407b('0x12')](_0x31555e));_0x462036(_0x31555e);})[_0x407b('0x21')](function(_0x39e00a){logger[_0x407b('0x13')](_0x407b('0x23'),_0x39e00a['message'],_0x142988);_0x523dc1(_0x522582[_0x407b('0x13')](0x1f4,_0x39e00a[_0x407b('0x14')]));});});}; \ No newline at end of file +var _0xb6c0=['../../config/logger','../../config/environment','jayson/promise','client','then','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetDeskAccount','DeskAccount','findAll','options','attributes','include','map','model','catch','ShowDeskAccount','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4ab560,_0x5e8fe2){var _0xfe1853=function(_0x154fa7){while(--_0x154fa7){_0x4ab560['push'](_0x4ab560['shift']());}};_0xfe1853(++_0x5e8fe2);}(_0xb6c0,0x1da));var _0x0b6c=function(_0x5d5566,_0x12684e){_0x5d5566=_0x5d5566-0x0;var _0x1efd07=_0xb6c0[_0x5d5566];return _0x1efd07;};'use strict';var _=require(_0x0b6c('0x0'));var util=require(_0x0b6c('0x1'));var moment=require(_0x0b6c('0x2'));var BPromise=require('bluebird');var rs=require(_0x0b6c('0x3'));var fs=require('fs');var Redis=require(_0x0b6c('0x4'));var db=require(_0x0b6c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0b6c('0x6'))('rpc');var config=require(_0x0b6c('0x7'));var jayson=require(_0x0b6c('0x8'));var client=jayson[_0x0b6c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43d4be,_0x43de22,_0x1bd86a){return new BPromise(function(_0x2e124b,_0x1936ea){return client['request'](_0x43d4be,_0x1bd86a)[_0x0b6c('0xa')](function(_0x31e747){logger[_0x0b6c('0xb')](_0x0b6c('0xc'),_0x43de22,'request\x20sent');logger['debug'](_0x0b6c('0xd'),_0x43de22,_0x0b6c('0xe'),JSON[_0x0b6c('0xf')](_0x31e747));if(_0x31e747[_0x0b6c('0x10')]){if(_0x31e747[_0x0b6c('0x10')][_0x0b6c('0x11')]===0x1f4){logger[_0x0b6c('0x10')](_0x0b6c('0xc'),_0x43de22,_0x31e747[_0x0b6c('0x10')][_0x0b6c('0x12')]);return _0x1936ea(_0x31e747[_0x0b6c('0x10')][_0x0b6c('0x12')]);}logger[_0x0b6c('0x10')]('DeskAccount,\x20%s,\x20%s',_0x43de22,_0x31e747[_0x0b6c('0x10')]['message']);return _0x2e124b(_0x31e747[_0x0b6c('0x10')]['message']);}else{logger['info'](_0x0b6c('0xc'),_0x43de22,_0x0b6c('0xe'));_0x2e124b(_0x31e747[_0x0b6c('0x13')][_0x0b6c('0x12')]);}})['catch'](function(_0x4858d7){logger[_0x0b6c('0x10')](_0x0b6c('0xc'),_0x43de22,_0x4858d7);_0x1936ea(_0x4858d7);});});}exports[_0x0b6c('0x14')]=function(_0xdde837){var _0x327ee1=this;return new Promise(function(_0xff95f1,_0x1898e0){return db[_0x0b6c('0x15')][_0x0b6c('0x16')]({'raw':_0xdde837[_0x0b6c('0x17')]?_0xdde837[_0x0b6c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xdde837[_0x0b6c('0x17')]?_0xdde837['options']['where']||null:null,'attributes':_0xdde837[_0x0b6c('0x17')]?_0xdde837[_0x0b6c('0x17')][_0x0b6c('0x18')]||null:null,'limit':_0xdde837['options']?_0xdde837[_0x0b6c('0x17')]['limit']||null:null,'include':_0xdde837[_0x0b6c('0x17')]?_0xdde837[_0x0b6c('0x17')][_0x0b6c('0x19')]?_[_0x0b6c('0x1a')](_0xdde837[_0x0b6c('0x17')][_0x0b6c('0x19')],function(_0x56d182){return{'model':db[_0x56d182[_0x0b6c('0x1b')]],'as':_0x56d182['as'],'attributes':_0x56d182[_0x0b6c('0x18')],'include':_0x56d182[_0x0b6c('0x19')]?_['map'](_0x56d182[_0x0b6c('0x19')],function(_0x4a817d){return{'model':db[_0x4a817d[_0x0b6c('0x1b')]],'as':_0x4a817d['as'],'attributes':_0x4a817d['attributes'],'include':_0x4a817d[_0x0b6c('0x19')]?_[_0x0b6c('0x1a')](_0x4a817d[_0x0b6c('0x19')],function(_0xe56d2b){return{'model':db[_0xe56d2b['model']],'as':_0xe56d2b['as'],'attributes':_0xe56d2b['attributes']};}):[]};}):[]};}):[]:[]})[_0x0b6c('0xa')](function(_0x3a97c7){logger[_0x0b6c('0xb')](_0x0b6c('0x14'),_0xdde837);logger['debug']('GetDeskAccount',_0xdde837,JSON[_0x0b6c('0xf')](_0x3a97c7));_0xff95f1(_0x3a97c7);})[_0x0b6c('0x1c')](function(_0x4ace25){logger['error'](_0x0b6c('0x14'),_0x4ace25[_0x0b6c('0x12')],_0xdde837);_0x1898e0(_0x327ee1['error'](0x1f4,_0x4ace25[_0x0b6c('0x12')]));});});};exports[_0x0b6c('0x1d')]=function(_0x1d54f3){var _0x40b368=this;return new Promise(function(_0x546784,_0x1cc915){return db['DeskAccount'][_0x0b6c('0x1e')]({'raw':_0x1d54f3[_0x0b6c('0x17')]?_0x1d54f3['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d54f3[_0x0b6c('0x17')]?_0x1d54f3[_0x0b6c('0x17')][_0x0b6c('0x1f')]||null:null,'attributes':_0x1d54f3['options']?_0x1d54f3['options'][_0x0b6c('0x18')]||null:null,'include':_0x1d54f3[_0x0b6c('0x17')]?_0x1d54f3[_0x0b6c('0x17')][_0x0b6c('0x19')]?_[_0x0b6c('0x1a')](_0x1d54f3['options']['include'],function(_0x39754b){return{'model':db[_0x39754b[_0x0b6c('0x1b')]],'as':_0x39754b['as'],'attributes':_0x39754b[_0x0b6c('0x18')],'include':_0x39754b[_0x0b6c('0x19')]?_['map'](_0x39754b[_0x0b6c('0x19')],function(_0x36d0cd){return{'model':db[_0x36d0cd[_0x0b6c('0x1b')]],'as':_0x36d0cd['as'],'attributes':_0x36d0cd[_0x0b6c('0x18')],'include':_0x36d0cd[_0x0b6c('0x19')]?_[_0x0b6c('0x1a')](_0x36d0cd[_0x0b6c('0x19')],function(_0x7f7d3f){return{'model':db[_0x7f7d3f[_0x0b6c('0x1b')]],'as':_0x7f7d3f['as'],'attributes':_0x7f7d3f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0b6c('0xa')](function(_0x4af296){logger[_0x0b6c('0xb')](_0x0b6c('0x1d'),_0x1d54f3);logger['debug'](_0x0b6c('0x1d'),_0x1d54f3,JSON['stringify'](_0x4af296));_0x546784(_0x4af296);})[_0x0b6c('0x1c')](function(_0x452289){logger[_0x0b6c('0x10')]('ShowDeskAccount',_0x452289[_0x0b6c('0x12')],_0x1d54f3);_0x1cc915(_0x40b368[_0x0b6c('0x10')](0x1f4,_0x452289[_0x0b6c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 8b105bf..d7bcaf9 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x1f87e5,_0x1056af){var _0x31eafb=function(_0x56dd05){while(--_0x56dd05){_0x1f87e5['push'](_0x1f87e5['shift']());}};_0x31eafb(++_0x1056af);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file +var _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(_0x570835,_0x34b418){var _0x338742=function(_0x2d4650){while(--_0x2d4650){_0x570835['push'](_0x570835['shift']());}};_0x338742(++_0x34b418);}(_0x008c,0x188));var _0xc008=function(_0x7efe31,_0x1b42d3){_0x7efe31=_0x7efe31-0x0;var _0x59ea5a=_0x008c[_0x7efe31];return _0x59ea5a;};'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 diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index b88f7ce..fc54c8d 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 _0x6ea6=['sequelize','exports','STRING'];(function(_0x5f20f0,_0x4cfb6d){var _0x16b5a2=function(_0xb2d2ca){while(--_0xb2d2ca){_0x5f20f0['push'](_0x5f20f0['shift']());}};_0x16b5a2(++_0x4cfb6d);}(_0x6ea6,0x84));var _0x66ea=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0x6ea6[_0x4063a4];return _0x17908d;};'use strict';var Sequelize=require(_0x66ea('0x0'));module[_0x66ea('0x1')]={'name':{'type':Sequelize[_0x66ea('0x2')]},'description':{'type':Sequelize[_0x66ea('0x2')]}}; \ No newline at end of file +var _0x046a=['exports','STRING'];(function(_0x160519,_0x52f7ce){var _0x27428f=function(_0x1ca35a){while(--_0x1ca35a){_0x160519['push'](_0x160519['shift']());}};_0x27428f(++_0x52f7ce);}(_0x046a,0xda));var _0xa046=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x046a[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require('sequelize');module[_0xa046('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa046('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 3304aea..fb36706 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 _0x9a71=['merge','filter','options','include','catch','show','params','keys','includeAll','find','create','body','getFields','findOne','DeskField','order','getSubjects','getDescriptions','Tag','getTags','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','DeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x522d45,_0x178fe0){var _0x44e46d=function(_0x642b2c){while(--_0x642b2c){_0x522d45['push'](_0x522d45['shift']());}};_0x44e46d(++_0x178fe0);}(_0x9a71,0xae));var _0x19a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a71[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x19a7('0x0'));var rimraf=require(_0x19a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x19a7('0x2'));var rp=require(_0x19a7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x19a7('0x4'));var util=require('util');var path=require(_0x19a7('0x5'));var sox=require(_0x19a7('0x6'));var csv=require(_0x19a7('0x7'));var ejs=require(_0x19a7('0x8'));var fs=require('fs');var fs_extra=require(_0x19a7('0x9'));var _=require(_0x19a7('0xa'));var squel=require(_0x19a7('0xb'));var crypto=require('crypto');var jsforce=require(_0x19a7('0xc'));var deskjs=require(_0x19a7('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x19a7('0xe'));var Redis=require(_0x19a7('0xf'));var authService=require(_0x19a7('0x10'));var qs=require(_0x19a7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x19a7('0x12'))(_0x19a7('0x13'));var utils=require(_0x19a7('0x14'));var config=require(_0x19a7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x19a7('0x16'))['db'];function respondWithStatusCode(_0x348af1,_0x869f58){_0x869f58=_0x869f58||0xcc;return function(_0x417f82){if(_0x417f82){return _0x348af1['sendStatus'](_0x869f58);}return _0x348af1[_0x19a7('0x17')](_0x869f58)[_0x19a7('0x18')]();};}function respondWithResult(_0x5ecd7e,_0x3584e1){_0x3584e1=_0x3584e1||0xc8;return function(_0x359f00){if(_0x359f00){return _0x5ecd7e[_0x19a7('0x17')](_0x3584e1)['json'](_0x359f00);}};}function respondWithFilteredResult(_0x1ca1f1,_0x28467b){return function(_0x532bce){if(_0x532bce){var _0x5531c2=typeof _0x28467b[_0x19a7('0x19')]==='undefined'&&typeof _0x28467b['limit']===_0x19a7('0x1a');var _0x197a63=_0x532bce[_0x19a7('0x1b')];var _0x203e41=_0x5531c2?0x0:_0x28467b[_0x19a7('0x19')];var _0x20b26d=_0x5531c2?_0x532bce[_0x19a7('0x1b')]:_0x28467b['offset']+_0x28467b[_0x19a7('0x1c')];var _0x345772;if(_0x20b26d>=_0x197a63){_0x20b26d=_0x197a63;_0x345772=0xc8;}else{_0x345772=0xce;}_0x1ca1f1[_0x19a7('0x17')](_0x345772);return _0x1ca1f1['set'](_0x19a7('0x1d'),_0x203e41+'-'+_0x20b26d+'/'+_0x197a63)['json'](_0x532bce);}return null;};}function patchUpdates(_0x235c6e){return function(_0x23b2e7){try{jsonpatch[_0x19a7('0x1e')](_0x23b2e7,_0x235c6e,!![]);}catch(_0x32129b){return BPromise[_0x19a7('0x1f')](_0x32129b);}return _0x23b2e7[_0x19a7('0x20')]();};}function saveUpdates(_0x36ebfb,_0x5192ff){return function(_0x363057){if(_0x363057){return _0x363057[_0x19a7('0x21')](_0x36ebfb)[_0x19a7('0x22')](function(_0x5b6625){return _0x5b6625;});}return null;};}function removeEntity(_0x40d356,_0x3c5f45){return function(_0x5d8e94){if(_0x5d8e94){return _0x5d8e94[_0x19a7('0x23')]()[_0x19a7('0x22')](function(){_0x40d356[_0x19a7('0x17')](0xcc)[_0x19a7('0x18')]();});}};}function handleEntityNotFound(_0x248faf,_0x5aa72d){return function(_0x4f09ab){if(!_0x4f09ab){_0x248faf['sendStatus'](0x194);}return _0x4f09ab;};}function handleError(_0x58b870,_0x1afe26){_0x1afe26=_0x1afe26||0x1f4;return function(_0x4c1827){logger[_0x19a7('0x24')](_0x4c1827['stack']);if(_0x4c1827[_0x19a7('0x25')]){delete _0x4c1827['name'];}_0x58b870[_0x19a7('0x17')](_0x1afe26)[_0x19a7('0x26')](_0x4c1827);};}exports['index']=function(_0x117e56,_0x182571){var _0x57fce8={},_0x59fd86={},_0x11e530={'count':0x0,'rows':[]};var _0x5e0d18=_['map'](db[_0x19a7('0x27')][_0x19a7('0x28')],function(_0x56cc10){return{'name':_0x56cc10[_0x19a7('0x29')],'type':_0x56cc10[_0x19a7('0x2a')][_0x19a7('0x2b')]};});_0x59fd86[_0x19a7('0x2c')]=_[_0x19a7('0x2d')](_0x5e0d18,_0x19a7('0x25'));_0x59fd86['query']=_['keys'](_0x117e56[_0x19a7('0x2e')]);_0x59fd86[_0x19a7('0x2f')]=_[_0x19a7('0x30')](_0x59fd86[_0x19a7('0x2c')],_0x59fd86[_0x19a7('0x2e')]);_0x57fce8[_0x19a7('0x31')]=_['intersection'](_0x59fd86[_0x19a7('0x2c')],qs[_0x19a7('0x32')](_0x117e56[_0x19a7('0x2e')]['fields']));_0x57fce8[_0x19a7('0x31')]=_0x57fce8[_0x19a7('0x31')][_0x19a7('0x33')]?_0x57fce8['attributes']:_0x59fd86[_0x19a7('0x2c')];if(!_0x117e56[_0x19a7('0x2e')][_0x19a7('0x34')](_0x19a7('0x35'))){_0x57fce8[_0x19a7('0x1c')]=qs[_0x19a7('0x1c')](_0x117e56[_0x19a7('0x2e')]['limit']);_0x57fce8[_0x19a7('0x19')]=qs['offset'](_0x117e56[_0x19a7('0x2e')][_0x19a7('0x19')]);}_0x57fce8['order']=qs[_0x19a7('0x36')](_0x117e56['query']['sort']);_0x57fce8[_0x19a7('0x37')]=qs[_0x19a7('0x2f')](_[_0x19a7('0x38')](_0x117e56['query'],_0x59fd86[_0x19a7('0x2f')]),_0x5e0d18);if(_0x117e56[_0x19a7('0x2e')]['filter']){_0x57fce8[_0x19a7('0x37')]=_[_0x19a7('0x39')](_0x57fce8[_0x19a7('0x37')],{'$or':_[_0x19a7('0x2d')](_0x5e0d18,function(_0x4dfcb9){if(_0x4dfcb9['type']!=='VIRTUAL'){var _0x39b75a={};_0x39b75a[_0x4dfcb9['name']]={'$like':'%'+_0x117e56['query'][_0x19a7('0x3a')]+'%'};return _0x39b75a;}})});}_0x57fce8=_['merge']({},_0x57fce8,_0x117e56[_0x19a7('0x3b')]);var _0x2d93f8={'where':_0x57fce8[_0x19a7('0x37')]};return db[_0x19a7('0x27')][_0x19a7('0x1b')](_0x2d93f8)[_0x19a7('0x22')](function(_0x47419d){_0x11e530['count']=_0x47419d;if(_0x117e56[_0x19a7('0x2e')]['includeAll']){_0x57fce8[_0x19a7('0x3c')]=[{'all':!![]}];}return db[_0x19a7('0x27')]['findAll'](_0x57fce8);})['then'](function(_0x2d2608){_0x11e530['rows']=_0x2d2608;return _0x11e530;})['then'](respondWithFilteredResult(_0x182571,_0x57fce8))[_0x19a7('0x3d')](handleError(_0x182571,null));};exports[_0x19a7('0x3e')]=function(_0x5dbb50,_0x45df5a){var _0x367a48={'raw':![],'where':{'id':_0x5dbb50[_0x19a7('0x3f')]['id']}},_0x3c4974={};_0x3c4974[_0x19a7('0x2c')]=_[_0x19a7('0x40')](db[_0x19a7('0x27')][_0x19a7('0x28')]);_0x3c4974['query']=_[_0x19a7('0x40')](_0x5dbb50[_0x19a7('0x2e')]);_0x3c4974[_0x19a7('0x2f')]=_[_0x19a7('0x30')](_0x3c4974['model'],_0x3c4974[_0x19a7('0x2e')]);_0x367a48[_0x19a7('0x31')]=_[_0x19a7('0x30')](_0x3c4974[_0x19a7('0x2c')],qs['fields'](_0x5dbb50[_0x19a7('0x2e')][_0x19a7('0x32')]));_0x367a48['attributes']=_0x367a48[_0x19a7('0x31')][_0x19a7('0x33')]?_0x367a48['attributes']:_0x3c4974[_0x19a7('0x2c')];if(_0x5dbb50[_0x19a7('0x2e')][_0x19a7('0x41')]){_0x367a48[_0x19a7('0x3c')]=[{'all':!![]}];}_0x367a48=_[_0x19a7('0x39')]({},_0x367a48,_0x5dbb50['options']);return db[_0x19a7('0x27')][_0x19a7('0x42')](_0x367a48)[_0x19a7('0x22')](handleEntityNotFound(_0x45df5a,null))[_0x19a7('0x22')](respondWithResult(_0x45df5a,null))[_0x19a7('0x3d')](handleError(_0x45df5a,null));};exports[_0x19a7('0x43')]=function(_0x6d2869,_0xd4389d){return db['DeskConfiguration'][_0x19a7('0x43')](_0x6d2869['body'],{})[_0x19a7('0x22')](respondWithResult(_0xd4389d,0xc9))[_0x19a7('0x3d')](handleError(_0xd4389d,null));};exports[_0x19a7('0x21')]=function(_0xea3739,_0x1e09ed){if(_0xea3739[_0x19a7('0x44')]['id']){delete _0xea3739[_0x19a7('0x44')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0xea3739[_0x19a7('0x3f')]['id']}})[_0x19a7('0x22')](handleEntityNotFound(_0x1e09ed,null))[_0x19a7('0x22')](saveUpdates(_0xea3739[_0x19a7('0x44')],null))[_0x19a7('0x22')](respondWithResult(_0x1e09ed,null))[_0x19a7('0x3d')](handleError(_0x1e09ed,null));};exports[_0x19a7('0x23')]=function(_0x474b97,_0x51f81c){return db[_0x19a7('0x27')][_0x19a7('0x42')]({'where':{'id':_0x474b97['params']['id']}})['then'](handleEntityNotFound(_0x51f81c,null))[_0x19a7('0x22')](removeEntity(_0x51f81c,null))[_0x19a7('0x3d')](handleError(_0x51f81c,null));};exports[_0x19a7('0x45')]=function(_0x4fbe33,_0x10b7d4,_0x330746){var _0x2fa10c={};var _0x2b8b86={};var _0x5a784d;var _0x177588;return db['DeskConfiguration'][_0x19a7('0x46')]({'where':{'id':_0x4fbe33[_0x19a7('0x3f')]['id']}})['then'](handleEntityNotFound(_0x10b7d4,null))[_0x19a7('0x22')](function(_0xba7c07){if(_0xba7c07){_0x5a784d=_0xba7c07;_0x2b8b86['model']=_['keys'](db[_0x19a7('0x47')][_0x19a7('0x28')]);_0x2b8b86['query']=_[_0x19a7('0x40')](_0x4fbe33[_0x19a7('0x2e')]);_0x2b8b86['filters']=_[_0x19a7('0x30')](_0x2b8b86['model'],_0x2b8b86[_0x19a7('0x2e')]);_0x2fa10c[_0x19a7('0x31')]=_['intersection'](_0x2b8b86[_0x19a7('0x2c')],qs['fields'](_0x4fbe33['query']['fields']));_0x2fa10c[_0x19a7('0x31')]=_0x2fa10c[_0x19a7('0x31')][_0x19a7('0x33')]?_0x2fa10c[_0x19a7('0x31')]:_0x2b8b86[_0x19a7('0x2c')];_0x2fa10c[_0x19a7('0x48')]=qs[_0x19a7('0x36')](_0x4fbe33[_0x19a7('0x2e')][_0x19a7('0x36')]);_0x2fa10c[_0x19a7('0x37')]=qs['filters'](_[_0x19a7('0x38')](_0x4fbe33[_0x19a7('0x2e')],_0x2b8b86[_0x19a7('0x2f')]));if(_0x4fbe33[_0x19a7('0x2e')][_0x19a7('0x3a')]){_0x2fa10c['where']=_[_0x19a7('0x39')](_0x2fa10c[_0x19a7('0x37')],{'$or':_[_0x19a7('0x2d')](_0x2fa10c['attributes'],function(_0x5589fd){var _0x5f1fe4={};_0x5f1fe4[_0x5589fd]={'$like':'%'+_0x4fbe33[_0x19a7('0x2e')]['filter']+'%'};return _0x5f1fe4;})});}_0x2fa10c=_[_0x19a7('0x39')]({},_0x2fa10c,_0x4fbe33[_0x19a7('0x3b')]);return _0x5a784d['getFields'](_0x2fa10c);}})[_0x19a7('0x22')](function(_0x135043){if(_0x135043){_0x177588=_0x135043[_0x19a7('0x33')];if(!_0x4fbe33[_0x19a7('0x2e')][_0x19a7('0x34')]('nolimit')){_0x2fa10c[_0x19a7('0x1c')]=qs[_0x19a7('0x1c')](_0x4fbe33[_0x19a7('0x2e')][_0x19a7('0x1c')]);_0x2fa10c[_0x19a7('0x19')]=qs[_0x19a7('0x19')](_0x4fbe33[_0x19a7('0x2e')][_0x19a7('0x19')]);}return _0x5a784d[_0x19a7('0x45')](_0x2fa10c);}})['then'](function(_0x1e72e8){if(_0x1e72e8){return _0x1e72e8?{'count':_0x177588,'rows':_0x1e72e8}:null;}})[_0x19a7('0x22')](respondWithResult(_0x10b7d4,null))['catch'](handleError(_0x10b7d4,null));};exports[_0x19a7('0x49')]=function(_0xc1271e,_0x54b892,_0x10369e){var _0x309224={};var _0x317c43={};var _0x42f30e;var _0x4b750a;return db['DeskConfiguration'][_0x19a7('0x46')]({'where':{'id':_0xc1271e[_0x19a7('0x3f')]['id']}})[_0x19a7('0x22')](handleEntityNotFound(_0x54b892,null))[_0x19a7('0x22')](function(_0x59073b){if(_0x59073b){_0x42f30e=_0x59073b;_0x317c43[_0x19a7('0x2c')]=_[_0x19a7('0x40')](db[_0x19a7('0x47')][_0x19a7('0x28')]);_0x317c43[_0x19a7('0x2e')]=_[_0x19a7('0x40')](_0xc1271e[_0x19a7('0x2e')]);_0x317c43[_0x19a7('0x2f')]=_[_0x19a7('0x30')](_0x317c43[_0x19a7('0x2c')],_0x317c43['query']);_0x309224[_0x19a7('0x31')]=_[_0x19a7('0x30')](_0x317c43[_0x19a7('0x2c')],qs[_0x19a7('0x32')](_0xc1271e[_0x19a7('0x2e')][_0x19a7('0x32')]));_0x309224[_0x19a7('0x31')]=_0x309224[_0x19a7('0x31')][_0x19a7('0x33')]?_0x309224[_0x19a7('0x31')]:_0x317c43[_0x19a7('0x2c')];_0x309224[_0x19a7('0x48')]=qs[_0x19a7('0x36')](_0xc1271e[_0x19a7('0x2e')][_0x19a7('0x36')]);_0x309224[_0x19a7('0x37')]=qs['filters'](_[_0x19a7('0x38')](_0xc1271e['query'],_0x317c43['filters']));if(_0xc1271e[_0x19a7('0x2e')]['filter']){_0x309224['where']=_[_0x19a7('0x39')](_0x309224[_0x19a7('0x37')],{'$or':_['map'](_0x309224[_0x19a7('0x31')],function(_0xe7a898){var _0xdcbdd3={};_0xdcbdd3[_0xe7a898]={'$like':'%'+_0xc1271e[_0x19a7('0x2e')][_0x19a7('0x3a')]+'%'};return _0xdcbdd3;})});}_0x309224=_[_0x19a7('0x39')]({},_0x309224,_0xc1271e[_0x19a7('0x3b')]);return _0x42f30e[_0x19a7('0x49')](_0x309224);}})[_0x19a7('0x22')](function(_0x423f81){if(_0x423f81){_0x4b750a=_0x423f81[_0x19a7('0x33')];if(!_0xc1271e[_0x19a7('0x2e')][_0x19a7('0x34')](_0x19a7('0x35'))){_0x309224[_0x19a7('0x1c')]=qs[_0x19a7('0x1c')](_0xc1271e[_0x19a7('0x2e')]['limit']);_0x309224[_0x19a7('0x19')]=qs[_0x19a7('0x19')](_0xc1271e['query'][_0x19a7('0x19')]);}return _0x42f30e[_0x19a7('0x49')](_0x309224);}})[_0x19a7('0x22')](function(_0x4d2b9a){if(_0x4d2b9a){return _0x4d2b9a?{'count':_0x4b750a,'rows':_0x4d2b9a}:null;}})['then'](respondWithResult(_0x54b892,null))[_0x19a7('0x3d')](handleError(_0x54b892,null));};exports[_0x19a7('0x4a')]=function(_0xa2aa69,_0x21ef8b,_0x2d29d7){var _0x59a462={};var _0x3790fb={};var _0x1f631a;var _0x3f1f65;return db[_0x19a7('0x27')][_0x19a7('0x46')]({'where':{'id':_0xa2aa69[_0x19a7('0x3f')]['id']}})[_0x19a7('0x22')](handleEntityNotFound(_0x21ef8b,null))['then'](function(_0xdfc482){if(_0xdfc482){_0x1f631a=_0xdfc482;_0x3790fb['model']=_[_0x19a7('0x40')](db[_0x19a7('0x47')]['rawAttributes']);_0x3790fb[_0x19a7('0x2e')]=_[_0x19a7('0x40')](_0xa2aa69[_0x19a7('0x2e')]);_0x3790fb['filters']=_[_0x19a7('0x30')](_0x3790fb[_0x19a7('0x2c')],_0x3790fb[_0x19a7('0x2e')]);_0x59a462[_0x19a7('0x31')]=_[_0x19a7('0x30')](_0x3790fb[_0x19a7('0x2c')],qs[_0x19a7('0x32')](_0xa2aa69['query'][_0x19a7('0x32')]));_0x59a462[_0x19a7('0x31')]=_0x59a462[_0x19a7('0x31')][_0x19a7('0x33')]?_0x59a462['attributes']:_0x3790fb[_0x19a7('0x2c')];_0x59a462[_0x19a7('0x48')]=qs['sort'](_0xa2aa69['query']['sort']);_0x59a462['where']=qs['filters'](_[_0x19a7('0x38')](_0xa2aa69['query'],_0x3790fb[_0x19a7('0x2f')]));if(_0xa2aa69[_0x19a7('0x2e')][_0x19a7('0x3a')]){_0x59a462[_0x19a7('0x37')]=_[_0x19a7('0x39')](_0x59a462[_0x19a7('0x37')],{'$or':_[_0x19a7('0x2d')](_0x59a462['attributes'],function(_0x311241){var _0x2958c2={};_0x2958c2[_0x311241]={'$like':'%'+_0xa2aa69[_0x19a7('0x2e')][_0x19a7('0x3a')]+'%'};return _0x2958c2;})});}_0x59a462=_[_0x19a7('0x39')]({},_0x59a462,_0xa2aa69['options']);return _0x1f631a[_0x19a7('0x4a')](_0x59a462);}})[_0x19a7('0x22')](function(_0x5c6797){if(_0x5c6797){_0x3f1f65=_0x5c6797[_0x19a7('0x33')];if(!_0xa2aa69[_0x19a7('0x2e')][_0x19a7('0x34')](_0x19a7('0x35'))){_0x59a462[_0x19a7('0x1c')]=qs['limit'](_0xa2aa69[_0x19a7('0x2e')]['limit']);_0x59a462['offset']=qs['offset'](_0xa2aa69[_0x19a7('0x2e')][_0x19a7('0x19')]);}return _0x1f631a[_0x19a7('0x4a')](_0x59a462);}})[_0x19a7('0x22')](function(_0x4c55a0){if(_0x4c55a0){return _0x4c55a0?{'count':_0x3f1f65,'rows':_0x4c55a0}:null;}})[_0x19a7('0x22')](respondWithResult(_0x21ef8b,null))[_0x19a7('0x3d')](handleError(_0x21ef8b,null));};exports['getTags']=function(_0x439f6d,_0x34f860,_0x2e32a9){var _0x134240={};var _0x1fc6f2={};var _0x2be52e;var _0x173404;return db[_0x19a7('0x27')][_0x19a7('0x46')]({'where':{'id':_0x439f6d[_0x19a7('0x3f')]['id']}})[_0x19a7('0x22')](handleEntityNotFound(_0x34f860,null))[_0x19a7('0x22')](function(_0x4515a0){if(_0x4515a0){_0x2be52e=_0x4515a0;_0x1fc6f2['model']=_[_0x19a7('0x40')](db[_0x19a7('0x4b')]['rawAttributes']);_0x1fc6f2[_0x19a7('0x2e')]=_[_0x19a7('0x40')](_0x439f6d[_0x19a7('0x2e')]);_0x1fc6f2[_0x19a7('0x2f')]=_[_0x19a7('0x30')](_0x1fc6f2[_0x19a7('0x2c')],_0x1fc6f2[_0x19a7('0x2e')]);_0x134240[_0x19a7('0x31')]=_[_0x19a7('0x30')](_0x1fc6f2['model'],qs[_0x19a7('0x32')](_0x439f6d['query'][_0x19a7('0x32')]));_0x134240['attributes']=_0x134240[_0x19a7('0x31')]['length']?_0x134240['attributes']:_0x1fc6f2[_0x19a7('0x2c')];_0x134240['order']=qs[_0x19a7('0x36')](_0x439f6d['query'][_0x19a7('0x36')]);_0x134240[_0x19a7('0x37')]=qs['filters'](_[_0x19a7('0x38')](_0x439f6d[_0x19a7('0x2e')],_0x1fc6f2[_0x19a7('0x2f')]));if(_0x439f6d[_0x19a7('0x2e')]['filter']){_0x134240['where']=_[_0x19a7('0x39')](_0x134240['where'],{'$or':_['map'](_0x134240['attributes'],function(_0x486139){var _0x107efa={};_0x107efa[_0x486139]={'$like':'%'+_0x439f6d['query'][_0x19a7('0x3a')]+'%'};return _0x107efa;})});}_0x134240=_[_0x19a7('0x39')]({},_0x134240,_0x439f6d[_0x19a7('0x3b')]);return _0x2be52e[_0x19a7('0x4c')](_0x134240);}})[_0x19a7('0x22')](function(_0xf9a881){if(_0xf9a881){_0x173404=_0xf9a881['length'];if(!_0x439f6d[_0x19a7('0x2e')]['hasOwnProperty'](_0x19a7('0x35'))){_0x134240[_0x19a7('0x1c')]=qs[_0x19a7('0x1c')](_0x439f6d[_0x19a7('0x2e')]['limit']);_0x134240['offset']=qs[_0x19a7('0x19')](_0x439f6d[_0x19a7('0x2e')][_0x19a7('0x19')]);}return _0x2be52e[_0x19a7('0x4c')](_0x134240);}})[_0x19a7('0x22')](function(_0x23ce4c){if(_0x23ce4c){return _0x23ce4c?{'count':_0x173404,'rows':_0x23ce4c}:null;}})[_0x19a7('0x22')](respondWithResult(_0x34f860,null))[_0x19a7('0x3d')](handleError(_0x34f860,null));};exports['setTags']=function(_0x40a965,_0x506ad7,_0x35ec3b){if(_0x40a965[_0x19a7('0x44')]['id']){delete _0x40a965[_0x19a7('0x44')]['id'];}return db[_0x19a7('0x27')]['findOne']({'where':{'id':_0x40a965[_0x19a7('0x3f')]['id']}})[_0x19a7('0x22')](handleEntityNotFound(_0x506ad7,null))[_0x19a7('0x22')](function(_0x70675c){if(_0x70675c){return _0x70675c['setTags'](_0x40a965[_0x19a7('0x44')]['ids']||[]);}return null;})[_0x19a7('0x22')](respondWithResult(_0x506ad7,null))[_0x19a7('0x3d')](handleError(_0x506ad7,null));}; \ No newline at end of file +var _0x7d5b=['options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','getFields','DeskField','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x37914d,_0x4209c0){var _0x2b4118=function(_0x10de2){while(--_0x10de2){_0x37914d['push'](_0x37914d['shift']());}};_0x2b4118(++_0x4209c0);}(_0x7d5b,0x1c7));var _0xb7d5=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x7d5b[_0x186376];return _0x2dbdd9;};'use strict';var emlformat=require(_0xb7d5('0x0'));var rimraf=require(_0xb7d5('0x1'));var zipdir=require(_0xb7d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb7d5('0x3'));var moment=require(_0xb7d5('0x4'));var BPromise=require(_0xb7d5('0x5'));var Mustache=require('mustache');var util=require(_0xb7d5('0x6'));var path=require('path');var sox=require(_0xb7d5('0x7'));var csv=require(_0xb7d5('0x8'));var ejs=require(_0xb7d5('0x9'));var fs=require('fs');var fs_extra=require(_0xb7d5('0xa'));var _=require(_0xb7d5('0xb'));var squel=require('squel');var crypto=require(_0xb7d5('0xc'));var jsforce=require(_0xb7d5('0xd'));var deskjs=require(_0xb7d5('0xe'));var toCsv=require(_0xb7d5('0x8'));var querystring=require('querystring');var Papa=require(_0xb7d5('0xf'));var Redis=require(_0xb7d5('0x10'));var authService=require(_0xb7d5('0x11'));var qs=require(_0xb7d5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7d5('0x13'));var logger=require(_0xb7d5('0x14'))(_0xb7d5('0x15'));var utils=require(_0xb7d5('0x16'));var config=require(_0xb7d5('0x17'));var licenseUtil=require(_0xb7d5('0x18'));var db=require(_0xb7d5('0x19'))['db'];function respondWithStatusCode(_0x2962fc,_0x1dcca3){_0x1dcca3=_0x1dcca3||0xcc;return function(_0x3c74a1){if(_0x3c74a1){return _0x2962fc[_0xb7d5('0x1a')](_0x1dcca3);}return _0x2962fc[_0xb7d5('0x1b')](_0x1dcca3)[_0xb7d5('0x1c')]();};}function respondWithResult(_0x3ab6c2,_0x3ca6af){_0x3ca6af=_0x3ca6af||0xc8;return function(_0x2473d6){if(_0x2473d6){return _0x3ab6c2[_0xb7d5('0x1b')](_0x3ca6af)[_0xb7d5('0x1d')](_0x2473d6);}};}function respondWithFilteredResult(_0x333894,_0xedfab){return function(_0x3c5010){if(_0x3c5010){var _0x94fb8=typeof _0xedfab[_0xb7d5('0x1e')]==='undefined'&&typeof _0xedfab['limit']===_0xb7d5('0x1f');var _0x4787d1=_0x3c5010[_0xb7d5('0x20')];var _0x519bf8=_0x94fb8?0x0:_0xedfab['offset'];var _0x95d200=_0x94fb8?_0x3c5010[_0xb7d5('0x20')]:_0xedfab[_0xb7d5('0x1e')]+_0xedfab[_0xb7d5('0x21')];var _0x14228f;if(_0x95d200>=_0x4787d1){_0x95d200=_0x4787d1;_0x14228f=0xc8;}else{_0x14228f=0xce;}_0x333894[_0xb7d5('0x1b')](_0x14228f);return _0x333894[_0xb7d5('0x22')](_0xb7d5('0x23'),_0x519bf8+'-'+_0x95d200+'/'+_0x4787d1)[_0xb7d5('0x1d')](_0x3c5010);}return null;};}function patchUpdates(_0x428535){return function(_0x3930ed){try{jsonpatch[_0xb7d5('0x24')](_0x3930ed,_0x428535,!![]);}catch(_0x59061c){return BPromise[_0xb7d5('0x25')](_0x59061c);}return _0x3930ed['save']();};}function saveUpdates(_0x4104d0,_0x2c6e84){return function(_0x4bc0f3){if(_0x4bc0f3){return _0x4bc0f3[_0xb7d5('0x26')](_0x4104d0)['then'](function(_0x3a227c){return _0x3a227c;});}return null;};}function removeEntity(_0x1c7d4d,_0x9f4bea){return function(_0x58c2cf){if(_0x58c2cf){return _0x58c2cf[_0xb7d5('0x27')]()[_0xb7d5('0x28')](function(){_0x1c7d4d['status'](0xcc)[_0xb7d5('0x1c')]();});}};}function handleEntityNotFound(_0x591ad5,_0x109ae1){return function(_0x10ee9e){if(!_0x10ee9e){_0x591ad5['sendStatus'](0x194);}return _0x10ee9e;};}function handleError(_0x2e3ba2,_0x24b8db){_0x24b8db=_0x24b8db||0x1f4;return function(_0xaeec0e){logger[_0xb7d5('0x29')](_0xaeec0e[_0xb7d5('0x2a')]);if(_0xaeec0e[_0xb7d5('0x2b')]){delete _0xaeec0e[_0xb7d5('0x2b')];}_0x2e3ba2[_0xb7d5('0x1b')](_0x24b8db)[_0xb7d5('0x2c')](_0xaeec0e);};}exports[_0xb7d5('0x2d')]=function(_0x4384a0,_0xed41a1){var _0x4e49f7={},_0x2efe75={},_0x8acae8={'count':0x0,'rows':[]};var _0x3d8830=_[_0xb7d5('0x2e')](db[_0xb7d5('0x2f')][_0xb7d5('0x30')],function(_0x5f1ac2){return{'name':_0x5f1ac2['fieldName'],'type':_0x5f1ac2[_0xb7d5('0x31')][_0xb7d5('0x32')]};});_0x2efe75[_0xb7d5('0x33')]=_[_0xb7d5('0x2e')](_0x3d8830,_0xb7d5('0x2b'));_0x2efe75[_0xb7d5('0x34')]=_['keys'](_0x4384a0[_0xb7d5('0x34')]);_0x2efe75[_0xb7d5('0x35')]=_[_0xb7d5('0x36')](_0x2efe75[_0xb7d5('0x33')],_0x2efe75['query']);_0x4e49f7[_0xb7d5('0x37')]=_['intersection'](_0x2efe75['model'],qs[_0xb7d5('0x38')](_0x4384a0['query'][_0xb7d5('0x38')]));_0x4e49f7['attributes']=_0x4e49f7[_0xb7d5('0x37')][_0xb7d5('0x39')]?_0x4e49f7['attributes']:_0x2efe75['model'];if(!_0x4384a0[_0xb7d5('0x34')][_0xb7d5('0x3a')](_0xb7d5('0x3b'))){_0x4e49f7[_0xb7d5('0x21')]=qs[_0xb7d5('0x21')](_0x4384a0['query'][_0xb7d5('0x21')]);_0x4e49f7[_0xb7d5('0x1e')]=qs[_0xb7d5('0x1e')](_0x4384a0['query'][_0xb7d5('0x1e')]);}_0x4e49f7[_0xb7d5('0x3c')]=qs[_0xb7d5('0x3d')](_0x4384a0['query'][_0xb7d5('0x3d')]);_0x4e49f7[_0xb7d5('0x3e')]=qs[_0xb7d5('0x35')](_[_0xb7d5('0x3f')](_0x4384a0[_0xb7d5('0x34')],_0x2efe75[_0xb7d5('0x35')]),_0x3d8830);if(_0x4384a0[_0xb7d5('0x34')][_0xb7d5('0x40')]){_0x4e49f7[_0xb7d5('0x3e')]=_[_0xb7d5('0x41')](_0x4e49f7['where'],{'$or':_[_0xb7d5('0x2e')](_0x3d8830,function(_0x3d0654){if(_0x3d0654[_0xb7d5('0x31')]!==_0xb7d5('0x42')){var _0x3f50ba={};_0x3f50ba[_0x3d0654[_0xb7d5('0x2b')]]={'$like':'%'+_0x4384a0[_0xb7d5('0x34')][_0xb7d5('0x40')]+'%'};return _0x3f50ba;}})});}_0x4e49f7=_[_0xb7d5('0x41')]({},_0x4e49f7,_0x4384a0[_0xb7d5('0x43')]);var _0x4db2db={'where':_0x4e49f7[_0xb7d5('0x3e')]};return db[_0xb7d5('0x2f')][_0xb7d5('0x20')](_0x4db2db)['then'](function(_0x42f423){_0x8acae8['count']=_0x42f423;if(_0x4384a0[_0xb7d5('0x34')][_0xb7d5('0x44')]){_0x4e49f7[_0xb7d5('0x45')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xb7d5('0x46')](_0x4e49f7);})['then'](function(_0x35dbff){_0x8acae8[_0xb7d5('0x47')]=_0x35dbff;return _0x8acae8;})[_0xb7d5('0x28')](respondWithFilteredResult(_0xed41a1,_0x4e49f7))[_0xb7d5('0x48')](handleError(_0xed41a1,null));};exports[_0xb7d5('0x49')]=function(_0x451b9c,_0x46ca6c){var _0x3e088f={'raw':![],'where':{'id':_0x451b9c[_0xb7d5('0x4a')]['id']}},_0x279ef9={};_0x279ef9[_0xb7d5('0x33')]=_[_0xb7d5('0x4b')](db['DeskConfiguration'][_0xb7d5('0x30')]);_0x279ef9[_0xb7d5('0x34')]=_['keys'](_0x451b9c[_0xb7d5('0x34')]);_0x279ef9[_0xb7d5('0x35')]=_[_0xb7d5('0x36')](_0x279ef9[_0xb7d5('0x33')],_0x279ef9[_0xb7d5('0x34')]);_0x3e088f[_0xb7d5('0x37')]=_[_0xb7d5('0x36')](_0x279ef9[_0xb7d5('0x33')],qs[_0xb7d5('0x38')](_0x451b9c['query']['fields']));_0x3e088f[_0xb7d5('0x37')]=_0x3e088f['attributes'][_0xb7d5('0x39')]?_0x3e088f[_0xb7d5('0x37')]:_0x279ef9[_0xb7d5('0x33')];if(_0x451b9c[_0xb7d5('0x34')][_0xb7d5('0x44')]){_0x3e088f[_0xb7d5('0x45')]=[{'all':!![]}];}_0x3e088f=_[_0xb7d5('0x41')]({},_0x3e088f,_0x451b9c[_0xb7d5('0x43')]);return db[_0xb7d5('0x2f')]['find'](_0x3e088f)['then'](handleEntityNotFound(_0x46ca6c,null))['then'](respondWithResult(_0x46ca6c,null))[_0xb7d5('0x48')](handleError(_0x46ca6c,null));};exports[_0xb7d5('0x4c')]=function(_0x1bd42c,_0xb1517c){return db[_0xb7d5('0x2f')][_0xb7d5('0x4c')](_0x1bd42c[_0xb7d5('0x4d')],{})['then'](respondWithResult(_0xb1517c,0xc9))['catch'](handleError(_0xb1517c,null));};exports[_0xb7d5('0x26')]=function(_0x453d42,_0x29c7b1){if(_0x453d42[_0xb7d5('0x4d')]['id']){delete _0x453d42[_0xb7d5('0x4d')]['id'];}return db[_0xb7d5('0x2f')][_0xb7d5('0x4e')]({'where':{'id':_0x453d42[_0xb7d5('0x4a')]['id']}})[_0xb7d5('0x28')](handleEntityNotFound(_0x29c7b1,null))['then'](saveUpdates(_0x453d42[_0xb7d5('0x4d')],null))['then'](respondWithResult(_0x29c7b1,null))[_0xb7d5('0x48')](handleError(_0x29c7b1,null));};exports[_0xb7d5('0x27')]=function(_0x22d2b5,_0x16d171){return db['DeskConfiguration']['find']({'where':{'id':_0x22d2b5[_0xb7d5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x16d171,null))[_0xb7d5('0x28')](removeEntity(_0x16d171,null))['catch'](handleError(_0x16d171,null));};exports[_0xb7d5('0x4f')]=function(_0x1b0b29,_0x35145b,_0x4e9497){var _0x24be8d={};var _0x4449ed={};var _0x272a9d;var _0x34947f;return db[_0xb7d5('0x2f')]['findOne']({'where':{'id':_0x1b0b29[_0xb7d5('0x4a')]['id']}})[_0xb7d5('0x28')](handleEntityNotFound(_0x35145b,null))[_0xb7d5('0x28')](function(_0x7aa3c2){if(_0x7aa3c2){_0x272a9d=_0x7aa3c2;_0x4449ed['model']=_['keys'](db[_0xb7d5('0x50')][_0xb7d5('0x30')]);_0x4449ed[_0xb7d5('0x34')]=_['keys'](_0x1b0b29[_0xb7d5('0x34')]);_0x4449ed['filters']=_['intersection'](_0x4449ed['model'],_0x4449ed['query']);_0x24be8d[_0xb7d5('0x37')]=_[_0xb7d5('0x36')](_0x4449ed[_0xb7d5('0x33')],qs[_0xb7d5('0x38')](_0x1b0b29['query'][_0xb7d5('0x38')]));_0x24be8d[_0xb7d5('0x37')]=_0x24be8d[_0xb7d5('0x37')][_0xb7d5('0x39')]?_0x24be8d[_0xb7d5('0x37')]:_0x4449ed[_0xb7d5('0x33')];_0x24be8d[_0xb7d5('0x3c')]=qs[_0xb7d5('0x3d')](_0x1b0b29[_0xb7d5('0x34')]['sort']);_0x24be8d[_0xb7d5('0x3e')]=qs[_0xb7d5('0x35')](_['pick'](_0x1b0b29[_0xb7d5('0x34')],_0x4449ed[_0xb7d5('0x35')]));if(_0x1b0b29['query']['filter']){_0x24be8d[_0xb7d5('0x3e')]=_[_0xb7d5('0x41')](_0x24be8d[_0xb7d5('0x3e')],{'$or':_[_0xb7d5('0x2e')](_0x24be8d['attributes'],function(_0x3a0562){var _0x1b53b2={};_0x1b53b2[_0x3a0562]={'$like':'%'+_0x1b0b29['query'][_0xb7d5('0x40')]+'%'};return _0x1b53b2;})});}_0x24be8d=_[_0xb7d5('0x41')]({},_0x24be8d,_0x1b0b29[_0xb7d5('0x43')]);return _0x272a9d['getFields'](_0x24be8d);}})[_0xb7d5('0x28')](function(_0x504f8c){if(_0x504f8c){_0x34947f=_0x504f8c[_0xb7d5('0x39')];if(!_0x1b0b29[_0xb7d5('0x34')][_0xb7d5('0x3a')](_0xb7d5('0x3b'))){_0x24be8d['limit']=qs[_0xb7d5('0x21')](_0x1b0b29[_0xb7d5('0x34')][_0xb7d5('0x21')]);_0x24be8d[_0xb7d5('0x1e')]=qs[_0xb7d5('0x1e')](_0x1b0b29[_0xb7d5('0x34')][_0xb7d5('0x1e')]);}return _0x272a9d[_0xb7d5('0x4f')](_0x24be8d);}})[_0xb7d5('0x28')](function(_0x40bd25){if(_0x40bd25){return _0x40bd25?{'count':_0x34947f,'rows':_0x40bd25}:null;}})['then'](respondWithResult(_0x35145b,null))[_0xb7d5('0x48')](handleError(_0x35145b,null));};exports[_0xb7d5('0x51')]=function(_0x3ab172,_0x27bc8f,_0x2d2f6d){var _0xc13a57={};var _0x350b72={};var _0xdbdecd;var _0x546848;return db[_0xb7d5('0x2f')][_0xb7d5('0x52')]({'where':{'id':_0x3ab172[_0xb7d5('0x4a')]['id']}})[_0xb7d5('0x28')](handleEntityNotFound(_0x27bc8f,null))[_0xb7d5('0x28')](function(_0x61e20b){if(_0x61e20b){_0xdbdecd=_0x61e20b;_0x350b72[_0xb7d5('0x33')]=_[_0xb7d5('0x4b')](db['DeskField'][_0xb7d5('0x30')]);_0x350b72[_0xb7d5('0x34')]=_[_0xb7d5('0x4b')](_0x3ab172['query']);_0x350b72[_0xb7d5('0x35')]=_[_0xb7d5('0x36')](_0x350b72[_0xb7d5('0x33')],_0x350b72[_0xb7d5('0x34')]);_0xc13a57[_0xb7d5('0x37')]=_['intersection'](_0x350b72[_0xb7d5('0x33')],qs[_0xb7d5('0x38')](_0x3ab172['query'][_0xb7d5('0x38')]));_0xc13a57['attributes']=_0xc13a57['attributes']['length']?_0xc13a57[_0xb7d5('0x37')]:_0x350b72[_0xb7d5('0x33')];_0xc13a57[_0xb7d5('0x3c')]=qs['sort'](_0x3ab172[_0xb7d5('0x34')]['sort']);_0xc13a57[_0xb7d5('0x3e')]=qs[_0xb7d5('0x35')](_[_0xb7d5('0x3f')](_0x3ab172[_0xb7d5('0x34')],_0x350b72['filters']));if(_0x3ab172[_0xb7d5('0x34')][_0xb7d5('0x40')]){_0xc13a57[_0xb7d5('0x3e')]=_[_0xb7d5('0x41')](_0xc13a57[_0xb7d5('0x3e')],{'$or':_[_0xb7d5('0x2e')](_0xc13a57[_0xb7d5('0x37')],function(_0x57ea2d){var _0x21cf35={};_0x21cf35[_0x57ea2d]={'$like':'%'+_0x3ab172['query']['filter']+'%'};return _0x21cf35;})});}_0xc13a57=_[_0xb7d5('0x41')]({},_0xc13a57,_0x3ab172[_0xb7d5('0x43')]);return _0xdbdecd[_0xb7d5('0x51')](_0xc13a57);}})[_0xb7d5('0x28')](function(_0x253a36){if(_0x253a36){_0x546848=_0x253a36[_0xb7d5('0x39')];if(!_0x3ab172[_0xb7d5('0x34')]['hasOwnProperty'](_0xb7d5('0x3b'))){_0xc13a57[_0xb7d5('0x21')]=qs['limit'](_0x3ab172[_0xb7d5('0x34')][_0xb7d5('0x21')]);_0xc13a57['offset']=qs[_0xb7d5('0x1e')](_0x3ab172[_0xb7d5('0x34')][_0xb7d5('0x1e')]);}return _0xdbdecd[_0xb7d5('0x51')](_0xc13a57);}})[_0xb7d5('0x28')](function(_0x4b94d6){if(_0x4b94d6){return _0x4b94d6?{'count':_0x546848,'rows':_0x4b94d6}:null;}})[_0xb7d5('0x28')](respondWithResult(_0x27bc8f,null))['catch'](handleError(_0x27bc8f,null));};exports[_0xb7d5('0x53')]=function(_0x1b5009,_0x4c94cf,_0x4a3987){var _0x4a7992={};var _0x502f43={};var _0x2c9860;var _0x4c837b;return db[_0xb7d5('0x2f')][_0xb7d5('0x52')]({'where':{'id':_0x1b5009[_0xb7d5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4c94cf,null))[_0xb7d5('0x28')](function(_0x481efc){if(_0x481efc){_0x2c9860=_0x481efc;_0x502f43[_0xb7d5('0x33')]=_[_0xb7d5('0x4b')](db[_0xb7d5('0x50')][_0xb7d5('0x30')]);_0x502f43[_0xb7d5('0x34')]=_['keys'](_0x1b5009[_0xb7d5('0x34')]);_0x502f43[_0xb7d5('0x35')]=_[_0xb7d5('0x36')](_0x502f43['model'],_0x502f43[_0xb7d5('0x34')]);_0x4a7992[_0xb7d5('0x37')]=_[_0xb7d5('0x36')](_0x502f43['model'],qs[_0xb7d5('0x38')](_0x1b5009[_0xb7d5('0x34')][_0xb7d5('0x38')]));_0x4a7992[_0xb7d5('0x37')]=_0x4a7992[_0xb7d5('0x37')]['length']?_0x4a7992[_0xb7d5('0x37')]:_0x502f43[_0xb7d5('0x33')];_0x4a7992[_0xb7d5('0x3c')]=qs[_0xb7d5('0x3d')](_0x1b5009[_0xb7d5('0x34')][_0xb7d5('0x3d')]);_0x4a7992['where']=qs['filters'](_[_0xb7d5('0x3f')](_0x1b5009[_0xb7d5('0x34')],_0x502f43[_0xb7d5('0x35')]));if(_0x1b5009[_0xb7d5('0x34')][_0xb7d5('0x40')]){_0x4a7992[_0xb7d5('0x3e')]=_['merge'](_0x4a7992['where'],{'$or':_['map'](_0x4a7992['attributes'],function(_0x48e0ce){var _0x27ea85={};_0x27ea85[_0x48e0ce]={'$like':'%'+_0x1b5009['query'][_0xb7d5('0x40')]+'%'};return _0x27ea85;})});}_0x4a7992=_[_0xb7d5('0x41')]({},_0x4a7992,_0x1b5009['options']);return _0x2c9860[_0xb7d5('0x53')](_0x4a7992);}})[_0xb7d5('0x28')](function(_0x777d13){if(_0x777d13){_0x4c837b=_0x777d13['length'];if(!_0x1b5009[_0xb7d5('0x34')][_0xb7d5('0x3a')](_0xb7d5('0x3b'))){_0x4a7992[_0xb7d5('0x21')]=qs[_0xb7d5('0x21')](_0x1b5009[_0xb7d5('0x34')][_0xb7d5('0x21')]);_0x4a7992[_0xb7d5('0x1e')]=qs[_0xb7d5('0x1e')](_0x1b5009[_0xb7d5('0x34')][_0xb7d5('0x1e')]);}return _0x2c9860[_0xb7d5('0x53')](_0x4a7992);}})['then'](function(_0x2aa5ca){if(_0x2aa5ca){return _0x2aa5ca?{'count':_0x4c837b,'rows':_0x2aa5ca}:null;}})['then'](respondWithResult(_0x4c94cf,null))['catch'](handleError(_0x4c94cf,null));};exports['getTags']=function(_0x5e29d2,_0x4d84e0,_0x2d2942){var _0x4c404d={};var _0x25bfde={};var _0x7798d3;var _0x43925b;return db[_0xb7d5('0x2f')][_0xb7d5('0x52')]({'where':{'id':_0x5e29d2[_0xb7d5('0x4a')]['id']}})[_0xb7d5('0x28')](handleEntityNotFound(_0x4d84e0,null))[_0xb7d5('0x28')](function(_0x284efb){if(_0x284efb){_0x7798d3=_0x284efb;_0x25bfde[_0xb7d5('0x33')]=_[_0xb7d5('0x4b')](db[_0xb7d5('0x54')]['rawAttributes']);_0x25bfde[_0xb7d5('0x34')]=_[_0xb7d5('0x4b')](_0x5e29d2[_0xb7d5('0x34')]);_0x25bfde[_0xb7d5('0x35')]=_['intersection'](_0x25bfde['model'],_0x25bfde['query']);_0x4c404d['attributes']=_[_0xb7d5('0x36')](_0x25bfde['model'],qs['fields'](_0x5e29d2[_0xb7d5('0x34')][_0xb7d5('0x38')]));_0x4c404d[_0xb7d5('0x37')]=_0x4c404d[_0xb7d5('0x37')][_0xb7d5('0x39')]?_0x4c404d[_0xb7d5('0x37')]:_0x25bfde['model'];_0x4c404d[_0xb7d5('0x3c')]=qs[_0xb7d5('0x3d')](_0x5e29d2[_0xb7d5('0x34')][_0xb7d5('0x3d')]);_0x4c404d['where']=qs[_0xb7d5('0x35')](_['pick'](_0x5e29d2[_0xb7d5('0x34')],_0x25bfde[_0xb7d5('0x35')]));if(_0x5e29d2[_0xb7d5('0x34')][_0xb7d5('0x40')]){_0x4c404d['where']=_[_0xb7d5('0x41')](_0x4c404d['where'],{'$or':_['map'](_0x4c404d[_0xb7d5('0x37')],function(_0x16f864){var _0xcef1fb={};_0xcef1fb[_0x16f864]={'$like':'%'+_0x5e29d2[_0xb7d5('0x34')][_0xb7d5('0x40')]+'%'};return _0xcef1fb;})});}_0x4c404d=_[_0xb7d5('0x41')]({},_0x4c404d,_0x5e29d2[_0xb7d5('0x43')]);return _0x7798d3[_0xb7d5('0x55')](_0x4c404d);}})['then'](function(_0x1796bf){if(_0x1796bf){_0x43925b=_0x1796bf[_0xb7d5('0x39')];if(!_0x5e29d2[_0xb7d5('0x34')][_0xb7d5('0x3a')](_0xb7d5('0x3b'))){_0x4c404d[_0xb7d5('0x21')]=qs[_0xb7d5('0x21')](_0x5e29d2['query']['limit']);_0x4c404d[_0xb7d5('0x1e')]=qs[_0xb7d5('0x1e')](_0x5e29d2[_0xb7d5('0x34')][_0xb7d5('0x1e')]);}return _0x7798d3[_0xb7d5('0x55')](_0x4c404d);}})['then'](function(_0x459680){if(_0x459680){return _0x459680?{'count':_0x43925b,'rows':_0x459680}:null;}})[_0xb7d5('0x28')](respondWithResult(_0x4d84e0,null))[_0xb7d5('0x48')](handleError(_0x4d84e0,null));};exports[_0xb7d5('0x56')]=function(_0x4a126a,_0x5eb535,_0xb82348){if(_0x4a126a['body']['id']){delete _0x4a126a[_0xb7d5('0x4d')]['id'];}return db['DeskConfiguration'][_0xb7d5('0x52')]({'where':{'id':_0x4a126a[_0xb7d5('0x4a')]['id']}})[_0xb7d5('0x28')](handleEntityNotFound(_0x5eb535,null))[_0xb7d5('0x28')](function(_0x5499b2){if(_0x5499b2){return _0x5499b2['setTags'](_0x4a126a[_0xb7d5('0x4d')]['ids']||[]);}return null;})['then'](respondWithResult(_0x5eb535,null))[_0xb7d5('0x48')](handleError(_0x5eb535,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 4aabdb9..777a9c7 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 _0xe36f=['bluebird','path','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api'];(function(_0x4fd1f2,_0x543cbb){var _0x5bfd6f=function(_0x17575b){while(--_0x17575b){_0x4fd1f2['push'](_0x4fd1f2['shift']());}};_0x5bfd6f(++_0x543cbb);}(_0xe36f,0x189));var _0xfe36=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe36f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfe36('0x0'));var util=require(_0xfe36('0x1'));var logger=require('../../config/logger')(_0xfe36('0x2'));var moment=require('moment');var BPromise=require(_0xfe36('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe36('0x4'));var rimraf=require('rimraf');var config=require(_0xfe36('0x5'));var attributes=require(_0xfe36('0x6'));module[_0xfe36('0x7')]=function(_0x57a9ad,_0x5b4bc3){return _0x57a9ad[_0xfe36('0x8')](_0xfe36('0x9'),attributes,{'tableName':_0xfe36('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0918=['path','rimraf','../../config/environment','exports','define','DeskConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x385f6f,_0x3c5983){var _0x3c479b=function(_0x33a988){while(--_0x33a988){_0x385f6f['push'](_0x385f6f['shift']());}};_0x3c479b(++_0x3c5983);}(_0x0918,0x186));var _0x8091=function(_0x2a0562,_0x375c2b){_0x2a0562=_0x2a0562-0x0;var _0x3273e7=_0x0918[_0x2a0562];return _0x3273e7;};'use strict';var _=require(_0x8091('0x0'));var util=require(_0x8091('0x1'));var logger=require(_0x8091('0x2'))(_0x8091('0x3'));var moment=require('moment');var BPromise=require(_0x8091('0x4'));var rp=require(_0x8091('0x5'));var fs=require('fs');var path=require(_0x8091('0x6'));var rimraf=require(_0x8091('0x7'));var config=require(_0x8091('0x8'));var attributes=require('./intDeskConfiguration.attributes');module[_0x8091('0x9')]=function(_0x20fb2c,_0x129495){return _0x20fb2c[_0x8091('0xa')](_0x8091('0xb'),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 f8a314a..38ce824 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 _0xdf62=['debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','DeskConfiguration,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x14908f,_0x292269){var _0x4d8ccc=function(_0x21da22){while(--_0x21da22){_0x14908f['push'](_0x14908f['shift']());}};_0x4d8ccc(++_0x292269);}(_0xdf62,0x151));var _0x2df6=function(_0x5e5163,_0xb2b3e){_0x5e5163=_0x5e5163-0x0;var _0x2d2eaa=_0xdf62[_0x5e5163];return _0x2d2eaa;};'use strict';var _=require(_0x2df6('0x0'));var util=require(_0x2df6('0x1'));var moment=require(_0x2df6('0x2'));var BPromise=require(_0x2df6('0x3'));var rs=require(_0x2df6('0x4'));var fs=require('fs');var Redis=require(_0x2df6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2df6('0x6'))(_0x2df6('0x7'));var config=require(_0x2df6('0x8'));var jayson=require(_0x2df6('0x9'));var client=jayson[_0x2df6('0xa')][_0x2df6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c4e7f,_0x5059ec,_0x8acc33){return new BPromise(function(_0x53a836,_0x4511af){return client[_0x2df6('0xc')](_0x2c4e7f,_0x8acc33)[_0x2df6('0xd')](function(_0x6a8be8){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x5059ec,_0x2df6('0xe'));logger[_0x2df6('0xf')](_0x2df6('0x10'),_0x5059ec,_0x2df6('0xe'),JSON['stringify'](_0x6a8be8));if(_0x6a8be8[_0x2df6('0x11')]){if(_0x6a8be8[_0x2df6('0x11')]['code']===0x1f4){logger[_0x2df6('0x11')](_0x2df6('0x12'),_0x5059ec,_0x6a8be8[_0x2df6('0x11')][_0x2df6('0x13')]);return _0x4511af(_0x6a8be8[_0x2df6('0x11')]['message']);}logger[_0x2df6('0x11')](_0x2df6('0x12'),_0x5059ec,_0x6a8be8[_0x2df6('0x11')][_0x2df6('0x13')]);return _0x53a836(_0x6a8be8[_0x2df6('0x11')]['message']);}else{logger[_0x2df6('0x14')](_0x2df6('0x12'),_0x5059ec,_0x2df6('0xe'));_0x53a836(_0x6a8be8[_0x2df6('0x15')][_0x2df6('0x13')]);}})['catch'](function(_0x1be726){logger[_0x2df6('0x11')](_0x2df6('0x12'),_0x5059ec,_0x1be726);_0x4511af(_0x1be726);});});} \ No newline at end of file +var _0x160f=['http','then','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf160('0x4'));var db=require(_0xf160('0x5'))['db'];var utils=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));var config=require(_0xf160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0xa')][_0xf160('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49fe49,_0x59440e,_0x41e909){return new BPromise(function(_0x5b76c8,_0x4bf890){return client['request'](_0x49fe49,_0x41e909)[_0xf160('0xc')](function(_0x90608){logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,'request\x20sent');logger['debug'](_0xf160('0xf'),_0x59440e,_0xf160('0x10'),JSON[_0xf160('0x11')](_0x90608));if(_0x90608['error']){if(_0x90608[_0xf160('0x12')][_0xf160('0x13')]===0x1f4){logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')]['message']);return _0x4bf890(_0x90608[_0xf160('0x12')]['message']);}logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')][_0xf160('0x14')]);return _0x5b76c8(_0x90608[_0xf160('0x12')][_0xf160('0x14')]);}else{logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,_0xf160('0x10'));_0x5b76c8(_0x90608['result'][_0xf160('0x14')]);}})[_0xf160('0x15')](function(_0x8699a0){logger[_0xf160('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x59440e,_0x8699a0);_0x4bf890(_0x8699a0);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index fe243d1..5d10a98 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 _0x11c3=['put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1bc750,_0x23f442){var _0xcd51da=function(_0x323854){while(--_0x323854){_0x1bc750['push'](_0x1bc750['shift']());}};_0xcd51da(++_0x23f442);}(_0x11c3,0xee));var _0x311c=function(_0x39bc25,_0x2e5838){_0x39bc25=_0x39bc25-0x0;var _0x1f1f82=_0x11c3[_0x39bc25];return _0x1f1f82;};'use strict';var multer=require(_0x311c('0x0'));var util=require(_0x311c('0x1'));var path=require(_0x311c('0x2'));var timeout=require(_0x311c('0x3'));var express=require('express');var router=express[_0x311c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x311c('0x5'));var interaction=require(_0x311c('0x6'));var config=require(_0x311c('0x7'));var controller=require(_0x311c('0x8'));router[_0x311c('0x9')]('/',auth[_0x311c('0xa')](),controller[_0x311c('0xb')]);router[_0x311c('0x9')](_0x311c('0xc'),auth['isAuthenticated'](),controller[_0x311c('0xd')]);router['post']('/',auth[_0x311c('0xa')](),controller['create']);router[_0x311c('0xe')]('/:id',auth[_0x311c('0xa')](),controller['update']);router[_0x311c('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x311c('0x10')]);module[_0x311c('0x11')]=router; \ No newline at end of file +var _0xb2a6=['Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','isAuthenticated','get','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x2c2e9f,_0x1f6a4e){var _0xb7fefd=function(_0x5e9687){while(--_0x5e9687){_0x2c2e9f['push'](_0x2c2e9f['shift']());}};_0xb7fefd(++_0x1f6a4e);}(_0xb2a6,0x12c));var _0x6b2a=function(_0x56ca3e,_0x2524a6){_0x56ca3e=_0x56ca3e-0x0;var _0x7e126d=_0xb2a6[_0x56ca3e];return _0x7e126d;};'use strict';var multer=require('multer');var util=require(_0x6b2a('0x0'));var path=require(_0x6b2a('0x1'));var timeout=require(_0x6b2a('0x2'));var express=require(_0x6b2a('0x3'));var router=express[_0x6b2a('0x4')]();var fs_extra=require(_0x6b2a('0x5'));var auth=require(_0x6b2a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6b2a('0x7'));var controller=require(_0x6b2a('0x8'));router['get']('/',auth[_0x6b2a('0x9')](),controller['index']);router[_0x6b2a('0xa')](_0x6b2a('0xb'),auth[_0x6b2a('0x9')](),controller[_0x6b2a('0xc')]);router[_0x6b2a('0xd')]('/',auth[_0x6b2a('0x9')](),controller['create']);router[_0x6b2a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x6b2a('0xf')]);router[_0x6b2a('0x10')](_0x6b2a('0xb'),auth[_0x6b2a('0x9')](),controller[_0x6b2a('0x11')]);module[_0x6b2a('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 478aae7..052a3a7 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 _0xc8b4=['picklist','STRING','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x136a0d,_0x476fe2){var _0x212ea5=function(_0xa288e){while(--_0xa288e){_0x136a0d['push'](_0x136a0d['shift']());}};_0x212ea5(++_0x476fe2);}(_0xc8b4,0xc9));var _0x4c8b=function(_0x4b39c0,_0x3490cd){_0x4b39c0=_0x4b39c0-0x0;var _0x27cc08=_0xc8b4[_0x4b39c0];return _0x27cc08;};'use strict';var Sequelize=require(_0x4c8b('0x0'));module[_0x4c8b('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4c8b('0x2'),_0x4c8b('0x3'),_0x4c8b('0x4'),_0x4c8b('0x5'),_0x4c8b('0x6')),'defaultValue':_0x4c8b('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4c8b('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x4c8b('0x2'),_0x4c8b('0x3'),_0x4c8b('0x4'))},'keyContent':{'type':Sequelize[_0x4c8b('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4c8b('0x7')]},'customField':{'type':Sequelize[_0x4c8b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4c8b('0x7')]}}; \ No newline at end of file +var _0x7f3d=['picklist','string','STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue'];(function(_0x51970a,_0x5ab3b7){var _0x3e7380=function(_0x43149f){while(--_0x43149f){_0x51970a['push'](_0x51970a['shift']());}};_0x3e7380(++_0x5ab3b7);}(_0x7f3d,0x190));var _0xd7f3=function(_0x138d06,_0x33edf2){_0x138d06=_0x138d06-0x0;var _0x1a01eb=_0x7f3d[_0x138d06];return _0x1a01eb;};'use strict';var Sequelize=require('sequelize');module[_0xd7f3('0x0')]={'type':{'type':Sequelize[_0xd7f3('0x1')]('string',_0xd7f3('0x2'),_0xd7f3('0x3'),_0xd7f3('0x4'),_0xd7f3('0x5')),'defaultValue':_0xd7f3('0x6')},'content':{'type':Sequelize[_0xd7f3('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd7f3('0x1')](_0xd7f3('0x6'),_0xd7f3('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xd7f3('0x7')]},'idField':{'type':Sequelize[_0xd7f3('0x7')]},'nameField':{'type':Sequelize[_0xd7f3('0x7')]},'customField':{'type':Sequelize[_0xd7f3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd7f3('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index e5bd464..7478f6d 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 _0x214e=['query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','include','find','create','body','destroy','rimraf','fast-json-patch','moment','mustache','path','sox','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','DeskField','fieldName','type','key'];(function(_0x16e0c8,_0x4861eb){var _0xe4b5af=function(_0x5248bc){while(--_0x5248bc){_0x16e0c8['push'](_0x16e0c8['shift']());}};_0xe4b5af(++_0x4861eb);}(_0x214e,0x148));var _0xe214=function(_0x46481b,_0x37f33f){_0x46481b=_0x46481b-0x0;var _0x2c4ed1=_0x214e[_0x46481b];return _0x2c4ed1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe214('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe214('0x1'));var rp=require('request-promise');var moment=require(_0xe214('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe214('0x3'));var util=require('util');var path=require(_0xe214('0x4'));var sox=require(_0xe214('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe214('0x6'));var _=require(_0xe214('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe214('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe214('0x9'));var Papa=require(_0xe214('0xa'));var Redis=require(_0xe214('0xb'));var authService=require(_0xe214('0xc'));var qs=require(_0xe214('0xd'));var as=require(_0xe214('0xe'));var hardwareService=require(_0xe214('0xf'));var logger=require(_0xe214('0x10'))(_0xe214('0x11'));var utils=require(_0xe214('0x12'));var config=require(_0xe214('0x13'));var licenseUtil=require(_0xe214('0x14'));var db=require(_0xe214('0x15'))['db'];function respondWithStatusCode(_0x3a10eb,_0x4264e1){_0x4264e1=_0x4264e1||0xcc;return function(_0x346421){if(_0x346421){return _0x3a10eb[_0xe214('0x16')](_0x4264e1);}return _0x3a10eb[_0xe214('0x17')](_0x4264e1)[_0xe214('0x18')]();};}function respondWithResult(_0x48d464,_0x234256){_0x234256=_0x234256||0xc8;return function(_0x3a7b49){if(_0x3a7b49){return _0x48d464[_0xe214('0x17')](_0x234256)[_0xe214('0x19')](_0x3a7b49);}};}function respondWithFilteredResult(_0x2b4387,_0x39a064){return function(_0xcb0709){if(_0xcb0709){var _0x265ed6=typeof _0x39a064[_0xe214('0x1a')]==='undefined'&&typeof _0x39a064[_0xe214('0x1b')]===_0xe214('0x1c');var _0x5ca116=_0xcb0709[_0xe214('0x1d')];var _0x5d51d3=_0x265ed6?0x0:_0x39a064[_0xe214('0x1a')];var _0x5865af=_0x265ed6?_0xcb0709[_0xe214('0x1d')]:_0x39a064[_0xe214('0x1a')]+_0x39a064['limit'];var _0x6febb3;if(_0x5865af>=_0x5ca116){_0x5865af=_0x5ca116;_0x6febb3=0xc8;}else{_0x6febb3=0xce;}_0x2b4387[_0xe214('0x17')](_0x6febb3);return _0x2b4387[_0xe214('0x1e')](_0xe214('0x1f'),_0x5d51d3+'-'+_0x5865af+'/'+_0x5ca116)[_0xe214('0x19')](_0xcb0709);}return null;};}function patchUpdates(_0x36c2f5){return function(_0x49aa38){try{jsonpatch[_0xe214('0x20')](_0x49aa38,_0x36c2f5,!![]);}catch(_0xd504ce){return BPromise[_0xe214('0x21')](_0xd504ce);}return _0x49aa38[_0xe214('0x22')]();};}function saveUpdates(_0xf2215c,_0x5a46b0){return function(_0x6b9850){if(_0x6b9850){return _0x6b9850[_0xe214('0x23')](_0xf2215c)['then'](function(_0x2c3b23){return _0x2c3b23;});}return null;};}function removeEntity(_0x591e98,_0x6b7b40){return function(_0x43b584){if(_0x43b584){return _0x43b584['destroy']()[_0xe214('0x24')](function(){_0x591e98[_0xe214('0x17')](0xcc)[_0xe214('0x18')]();});}};}function handleEntityNotFound(_0x92ef3e,_0x17df2c){return function(_0x358784){if(!_0x358784){_0x92ef3e['sendStatus'](0x194);}return _0x358784;};}function handleError(_0x5199c6,_0x161027){_0x161027=_0x161027||0x1f4;return function(_0x180e80){logger[_0xe214('0x25')](_0x180e80[_0xe214('0x26')]);if(_0x180e80[_0xe214('0x27')]){delete _0x180e80['name'];}_0x5199c6[_0xe214('0x17')](_0x161027)[_0xe214('0x28')](_0x180e80);};}exports[_0xe214('0x29')]=function(_0x3ba473,_0x502edf){var _0x10f6a6={},_0x2e7d89={},_0x5b05b0={'count':0x0,'rows':[]};var _0x389c5d=_[_0xe214('0x2a')](db[_0xe214('0x2b')]['rawAttributes'],function(_0x3d2a73){return{'name':_0x3d2a73[_0xe214('0x2c')],'type':_0x3d2a73[_0xe214('0x2d')][_0xe214('0x2e')]};});_0x2e7d89['model']=_[_0xe214('0x2a')](_0x389c5d,_0xe214('0x27'));_0x2e7d89[_0xe214('0x2f')]=_[_0xe214('0x30')](_0x3ba473['query']);_0x2e7d89['filters']=_[_0xe214('0x31')](_0x2e7d89[_0xe214('0x32')],_0x2e7d89[_0xe214('0x2f')]);_0x10f6a6[_0xe214('0x33')]=_[_0xe214('0x31')](_0x2e7d89[_0xe214('0x32')],qs[_0xe214('0x34')](_0x3ba473[_0xe214('0x2f')][_0xe214('0x34')]));_0x10f6a6[_0xe214('0x33')]=_0x10f6a6[_0xe214('0x33')][_0xe214('0x35')]?_0x10f6a6['attributes']:_0x2e7d89['model'];if(!_0x3ba473[_0xe214('0x2f')]['hasOwnProperty'](_0xe214('0x36'))){_0x10f6a6[_0xe214('0x1b')]=qs[_0xe214('0x1b')](_0x3ba473[_0xe214('0x2f')]['limit']);_0x10f6a6[_0xe214('0x1a')]=qs[_0xe214('0x1a')](_0x3ba473[_0xe214('0x2f')][_0xe214('0x1a')]);}_0x10f6a6[_0xe214('0x37')]=qs[_0xe214('0x38')](_0x3ba473['query'][_0xe214('0x38')]);_0x10f6a6[_0xe214('0x39')]=qs[_0xe214('0x3a')](_[_0xe214('0x3b')](_0x3ba473[_0xe214('0x2f')],_0x2e7d89[_0xe214('0x3a')]),_0x389c5d);if(_0x3ba473[_0xe214('0x2f')][_0xe214('0x3c')]){_0x10f6a6[_0xe214('0x39')]=_[_0xe214('0x3d')](_0x10f6a6[_0xe214('0x39')],{'$or':_['map'](_0x389c5d,function(_0x3ff31e){if(_0x3ff31e[_0xe214('0x2d')]!==_0xe214('0x3e')){var _0x10a1fa={};_0x10a1fa[_0x3ff31e['name']]={'$like':'%'+_0x3ba473['query'][_0xe214('0x3c')]+'%'};return _0x10a1fa;}})});}_0x10f6a6=_[_0xe214('0x3d')]({},_0x10f6a6,_0x3ba473[_0xe214('0x3f')]);var _0x3039ab={'where':_0x10f6a6[_0xe214('0x39')]};return db[_0xe214('0x2b')][_0xe214('0x1d')](_0x3039ab)[_0xe214('0x24')](function(_0x58a5ba){_0x5b05b0[_0xe214('0x1d')]=_0x58a5ba;if(_0x3ba473['query'][_0xe214('0x40')]){_0x10f6a6['include']=[{'all':!![]}];}return db[_0xe214('0x2b')]['findAll'](_0x10f6a6);})[_0xe214('0x24')](function(_0x29c76d){_0x5b05b0[_0xe214('0x41')]=_0x29c76d;return _0x5b05b0;})['then'](respondWithFilteredResult(_0x502edf,_0x10f6a6))[_0xe214('0x42')](handleError(_0x502edf,null));};exports[_0xe214('0x43')]=function(_0x160e60,_0x793f8){var _0x833161={'raw':!![],'where':{'id':_0x160e60[_0xe214('0x44')]['id']}},_0x3c0ffa={};_0x3c0ffa[_0xe214('0x32')]=_[_0xe214('0x30')](db['DeskField'][_0xe214('0x45')]);_0x3c0ffa['query']=_[_0xe214('0x30')](_0x160e60[_0xe214('0x2f')]);_0x3c0ffa[_0xe214('0x3a')]=_['intersection'](_0x3c0ffa[_0xe214('0x32')],_0x3c0ffa['query']);_0x833161['attributes']=_[_0xe214('0x31')](_0x3c0ffa['model'],qs['fields'](_0x160e60[_0xe214('0x2f')][_0xe214('0x34')]));_0x833161[_0xe214('0x33')]=_0x833161['attributes']['length']?_0x833161[_0xe214('0x33')]:_0x3c0ffa[_0xe214('0x32')];if(_0x160e60[_0xe214('0x2f')][_0xe214('0x40')]){_0x833161[_0xe214('0x46')]=[{'all':!![]}];}_0x833161=_[_0xe214('0x3d')]({},_0x833161,_0x160e60[_0xe214('0x3f')]);return db[_0xe214('0x2b')][_0xe214('0x47')](_0x833161)['then'](handleEntityNotFound(_0x793f8,null))['then'](respondWithResult(_0x793f8,null))['catch'](handleError(_0x793f8,null));};exports[_0xe214('0x48')]=function(_0x49a257,_0x185b39){return db[_0xe214('0x2b')][_0xe214('0x48')](_0x49a257['body'],{})['then'](respondWithResult(_0x185b39,0xc9))[_0xe214('0x42')](handleError(_0x185b39,null));};exports[_0xe214('0x23')]=function(_0x9c4aa9,_0x10eb75){if(_0x9c4aa9[_0xe214('0x49')]['id']){delete _0x9c4aa9[_0xe214('0x49')]['id'];}return db['DeskField']['find']({'where':{'id':_0x9c4aa9[_0xe214('0x44')]['id']}})[_0xe214('0x24')](handleEntityNotFound(_0x10eb75,null))[_0xe214('0x24')](saveUpdates(_0x9c4aa9['body'],null))[_0xe214('0x24')](respondWithResult(_0x10eb75,null))[_0xe214('0x42')](handleError(_0x10eb75,null));};exports[_0xe214('0x4a')]=function(_0x1aaafb,_0x4bf2fa){return db['DeskField'][_0xe214('0x47')]({'where':{'id':_0x1aaafb['params']['id']}})[_0xe214('0x24')](handleEntityNotFound(_0x4bf2fa,null))[_0xe214('0x24')](removeEntity(_0x4bf2fa,null))[_0xe214('0x42')](handleError(_0x4bf2fa,null));}; \ No newline at end of file +var _0xbecd=['destroy','end','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','type','DeskField','includeAll','include','filters','options','find','catch','create','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then'];(function(_0x4d121d,_0x3fe733){var _0xffa031=function(_0x1fec1b){while(--_0x1fec1b){_0x4d121d['push'](_0x4d121d['shift']());}};_0xffa031(++_0x3fe733);}(_0xbecd,0x6a));var _0xdbec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbecd[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xdbec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdbec('0x1'));var jsonpatch=require(_0xdbec('0x2'));var rp=require('request-promise');var moment=require(_0xdbec('0x3'));var BPromise=require(_0xdbec('0x4'));var Mustache=require(_0xdbec('0x5'));var util=require(_0xdbec('0x6'));var path=require(_0xdbec('0x7'));var sox=require(_0xdbec('0x8'));var csv=require(_0xdbec('0x9'));var ejs=require(_0xdbec('0xa'));var fs=require('fs');var fs_extra=require(_0xdbec('0xb'));var _=require(_0xdbec('0xc'));var squel=require(_0xdbec('0xd'));var crypto=require(_0xdbec('0xe'));var jsforce=require(_0xdbec('0xf'));var deskjs=require(_0xdbec('0x10'));var toCsv=require(_0xdbec('0x9'));var querystring=require('querystring');var Papa=require(_0xdbec('0x11'));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(_0xdbec('0x12'));var logger=require(_0xdbec('0x13'))('api');var utils=require(_0xdbec('0x14'));var config=require(_0xdbec('0x15'));var licenseUtil=require(_0xdbec('0x16'));var db=require(_0xdbec('0x17'))['db'];function respondWithStatusCode(_0x15540a,_0x2a2d14){_0x2a2d14=_0x2a2d14||0xcc;return function(_0x52ebb1){if(_0x52ebb1){return _0x15540a[_0xdbec('0x18')](_0x2a2d14);}return _0x15540a[_0xdbec('0x19')](_0x2a2d14)['end']();};}function respondWithResult(_0xd5300d,_0x109dd7){_0x109dd7=_0x109dd7||0xc8;return function(_0x5dd681){if(_0x5dd681){return _0xd5300d[_0xdbec('0x19')](_0x109dd7)['json'](_0x5dd681);}};}function respondWithFilteredResult(_0x45684f,_0x4a2906){return function(_0x45321f){if(_0x45321f){var _0x53420c=typeof _0x4a2906['offset']===_0xdbec('0x1a')&&typeof _0x4a2906[_0xdbec('0x1b')]===_0xdbec('0x1a');var _0x414f6f=_0x45321f[_0xdbec('0x1c')];var _0x392600=_0x53420c?0x0:_0x4a2906[_0xdbec('0x1d')];var _0x5d9ed5=_0x53420c?_0x45321f[_0xdbec('0x1c')]:_0x4a2906[_0xdbec('0x1d')]+_0x4a2906[_0xdbec('0x1b')];var _0x384a9d;if(_0x5d9ed5>=_0x414f6f){_0x5d9ed5=_0x414f6f;_0x384a9d=0xc8;}else{_0x384a9d=0xce;}_0x45684f[_0xdbec('0x19')](_0x384a9d);return _0x45684f[_0xdbec('0x1e')](_0xdbec('0x1f'),_0x392600+'-'+_0x5d9ed5+'/'+_0x414f6f)['json'](_0x45321f);}return null;};}function patchUpdates(_0x405a2a){return function(_0x3d1236){try{jsonpatch[_0xdbec('0x20')](_0x3d1236,_0x405a2a,!![]);}catch(_0x588f61){return BPromise[_0xdbec('0x21')](_0x588f61);}return _0x3d1236['save']();};}function saveUpdates(_0x361fc4,_0x3c2769){return function(_0x3c81b3){if(_0x3c81b3){return _0x3c81b3[_0xdbec('0x22')](_0x361fc4)[_0xdbec('0x23')](function(_0x37cf85){return _0x37cf85;});}return null;};}function removeEntity(_0x22c2b6,_0x3b5c13){return function(_0x25e37e){if(_0x25e37e){return _0x25e37e[_0xdbec('0x24')]()[_0xdbec('0x23')](function(){_0x22c2b6[_0xdbec('0x19')](0xcc)[_0xdbec('0x25')]();});}};}function handleEntityNotFound(_0x3aeaa4,_0x33f91){return function(_0x267b7e){if(!_0x267b7e){_0x3aeaa4[_0xdbec('0x18')](0x194);}return _0x267b7e;};}function handleError(_0x29283b,_0x1ace13){_0x1ace13=_0x1ace13||0x1f4;return function(_0x1f7f4d){logger[_0xdbec('0x26')](_0x1f7f4d['stack']);if(_0x1f7f4d[_0xdbec('0x27')]){delete _0x1f7f4d[_0xdbec('0x27')];}_0x29283b[_0xdbec('0x19')](_0x1ace13)[_0xdbec('0x28')](_0x1f7f4d);};}exports[_0xdbec('0x29')]=function(_0x3e368c,_0x5efa6d){var _0x43aa89={},_0x2225ae={},_0x2696ef={'count':0x0,'rows':[]};var _0x497c62=_[_0xdbec('0x2a')](db['DeskField'][_0xdbec('0x2b')],function(_0x546d59){return{'name':_0x546d59[_0xdbec('0x2c')],'type':_0x546d59['type'][_0xdbec('0x2d')]};});_0x2225ae[_0xdbec('0x2e')]=_[_0xdbec('0x2a')](_0x497c62,'name');_0x2225ae['query']=_[_0xdbec('0x2f')](_0x3e368c[_0xdbec('0x30')]);_0x2225ae['filters']=_[_0xdbec('0x31')](_0x2225ae[_0xdbec('0x2e')],_0x2225ae[_0xdbec('0x30')]);_0x43aa89[_0xdbec('0x32')]=_['intersection'](_0x2225ae[_0xdbec('0x2e')],qs['fields'](_0x3e368c[_0xdbec('0x30')][_0xdbec('0x33')]));_0x43aa89[_0xdbec('0x32')]=_0x43aa89[_0xdbec('0x32')][_0xdbec('0x34')]?_0x43aa89[_0xdbec('0x32')]:_0x2225ae['model'];if(!_0x3e368c[_0xdbec('0x30')][_0xdbec('0x35')](_0xdbec('0x36'))){_0x43aa89['limit']=qs[_0xdbec('0x1b')](_0x3e368c[_0xdbec('0x30')]['limit']);_0x43aa89[_0xdbec('0x1d')]=qs['offset'](_0x3e368c[_0xdbec('0x30')][_0xdbec('0x1d')]);}_0x43aa89[_0xdbec('0x37')]=qs[_0xdbec('0x38')](_0x3e368c[_0xdbec('0x30')][_0xdbec('0x38')]);_0x43aa89['where']=qs['filters'](_[_0xdbec('0x39')](_0x3e368c[_0xdbec('0x30')],_0x2225ae['filters']),_0x497c62);if(_0x3e368c[_0xdbec('0x30')]['filter']){_0x43aa89['where']=_[_0xdbec('0x3a')](_0x43aa89[_0xdbec('0x3b')],{'$or':_[_0xdbec('0x2a')](_0x497c62,function(_0x54a415){if(_0x54a415[_0xdbec('0x3c')]!=='VIRTUAL'){var _0xecf488={};_0xecf488[_0x54a415[_0xdbec('0x27')]]={'$like':'%'+_0x3e368c['query']['filter']+'%'};return _0xecf488;}})});}_0x43aa89=_[_0xdbec('0x3a')]({},_0x43aa89,_0x3e368c['options']);var _0x429a53={'where':_0x43aa89[_0xdbec('0x3b')]};return db[_0xdbec('0x3d')][_0xdbec('0x1c')](_0x429a53)[_0xdbec('0x23')](function(_0x2a7153){_0x2696ef[_0xdbec('0x1c')]=_0x2a7153;if(_0x3e368c[_0xdbec('0x30')][_0xdbec('0x3e')]){_0x43aa89[_0xdbec('0x3f')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x43aa89);})[_0xdbec('0x23')](function(_0x566af5){_0x2696ef['rows']=_0x566af5;return _0x2696ef;})['then'](respondWithFilteredResult(_0x5efa6d,_0x43aa89))['catch'](handleError(_0x5efa6d,null));};exports['show']=function(_0x119246,_0x152f2e){var _0x4c065d={'raw':!![],'where':{'id':_0x119246['params']['id']}},_0xbf66d1={};_0xbf66d1[_0xdbec('0x2e')]=_['keys'](db[_0xdbec('0x3d')]['rawAttributes']);_0xbf66d1[_0xdbec('0x30')]=_['keys'](_0x119246[_0xdbec('0x30')]);_0xbf66d1[_0xdbec('0x40')]=_['intersection'](_0xbf66d1[_0xdbec('0x2e')],_0xbf66d1[_0xdbec('0x30')]);_0x4c065d[_0xdbec('0x32')]=_[_0xdbec('0x31')](_0xbf66d1[_0xdbec('0x2e')],qs['fields'](_0x119246[_0xdbec('0x30')]['fields']));_0x4c065d[_0xdbec('0x32')]=_0x4c065d['attributes'][_0xdbec('0x34')]?_0x4c065d[_0xdbec('0x32')]:_0xbf66d1['model'];if(_0x119246['query'][_0xdbec('0x3e')]){_0x4c065d['include']=[{'all':!![]}];}_0x4c065d=_[_0xdbec('0x3a')]({},_0x4c065d,_0x119246[_0xdbec('0x41')]);return db[_0xdbec('0x3d')][_0xdbec('0x42')](_0x4c065d)['then'](handleEntityNotFound(_0x152f2e,null))[_0xdbec('0x23')](respondWithResult(_0x152f2e,null))[_0xdbec('0x43')](handleError(_0x152f2e,null));};exports[_0xdbec('0x44')]=function(_0x458e33,_0x4078ee){return db['DeskField'][_0xdbec('0x44')](_0x458e33[_0xdbec('0x45')],{})[_0xdbec('0x23')](respondWithResult(_0x4078ee,0xc9))[_0xdbec('0x43')](handleError(_0x4078ee,null));};exports['update']=function(_0x3a6003,_0x247db6){if(_0x3a6003[_0xdbec('0x45')]['id']){delete _0x3a6003[_0xdbec('0x45')]['id'];}return db[_0xdbec('0x3d')]['find']({'where':{'id':_0x3a6003[_0xdbec('0x46')]['id']}})[_0xdbec('0x23')](handleEntityNotFound(_0x247db6,null))[_0xdbec('0x23')](saveUpdates(_0x3a6003['body'],null))[_0xdbec('0x23')](respondWithResult(_0x247db6,null))['catch'](handleError(_0x247db6,null));};exports[_0xdbec('0x24')]=function(_0x12c94e,_0x9139d6){return db[_0xdbec('0x3d')][_0xdbec('0x42')]({'where':{'id':_0x12c94e[_0xdbec('0x46')]['id']}})[_0xdbec('0x23')](handleEntityNotFound(_0x9139d6,null))[_0xdbec('0x23')](removeEntity(_0x9139d6,null))[_0xdbec('0x43')](handleError(_0x9139d6,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 4db8da3..02b77f1 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 _0xdfd3=['DeskField','int_desk_fields','idField','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./intDeskField.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdfd3,0x6b));var _0x3dfd=function(_0x305486,_0x24acd4){_0x305486=_0x305486-0x0;var _0xa04940=_0xdfd3[_0x305486];return _0xa04940;};'use strict';var _=require(_0x3dfd('0x0'));var util=require(_0x3dfd('0x1'));var logger=require(_0x3dfd('0x2'))('api');var moment=require(_0x3dfd('0x3'));var BPromise=require(_0x3dfd('0x4'));var rp=require(_0x3dfd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3dfd('0x6'));var config=require('../../config/environment');var attributes=require(_0x3dfd('0x7'));module[_0x3dfd('0x8')]=function(_0x17769c,_0x10488d){return _0x17769c[_0x3dfd('0x9')](_0x3dfd('0xa'),attributes,{'tableName':_0x3dfd('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x3dfd('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd345=['DeskField','desk_unique_index','idField','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x5f5a13,_0xe354bf){var _0x271520=function(_0x3c8518){while(--_0x3c8518){_0x5f5a13['push'](_0x5f5a13['shift']());}};_0x271520(++_0xe354bf);}(_0xd345,0x1b0));var _0x5d34=function(_0x434aa5,_0x18f2d4){_0x434aa5=_0x434aa5-0x0;var _0x21f7ba=_0xd345[_0x434aa5];return _0x21f7ba;};'use strict';var _=require(_0x5d34('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5d34('0x1'));var moment=require(_0x5d34('0x2'));var BPromise=require('bluebird');var rp=require(_0x5d34('0x3'));var fs=require('fs');var path=require(_0x5d34('0x4'));var rimraf=require(_0x5d34('0x5'));var config=require(_0x5d34('0x6'));var attributes=require(_0x5d34('0x7'));module[_0x5d34('0x8')]=function(_0xb8be7d,_0x22923f){return _0xb8be7d[_0x5d34('0x9')](_0x5d34('0xa'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x5d34('0xb'),'fields':[_0x5d34('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 411c960..0e87634 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 _0x138c=['request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0x138c,0x165));var _0xc138=function(_0x143c98,_0x5ef3f3){_0x143c98=_0x143c98-0x0;var _0x2716af=_0x138c[_0x143c98];return _0x2716af;};'use strict';var _=require('lodash');var util=require(_0xc138('0x0'));var moment=require(_0xc138('0x1'));var BPromise=require(_0xc138('0x2'));var rs=require(_0xc138('0x3'));var fs=require('fs');var Redis=require(_0xc138('0x4'));var db=require(_0xc138('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc138('0x6'));var config=require(_0xc138('0x7'));var jayson=require(_0xc138('0x8'));var client=jayson[_0xc138('0x9')][_0xc138('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x526fca,_0x15c8e2,_0x335f74){return new BPromise(function(_0x142b17,_0x4d7cc3){return client[_0xc138('0xb')](_0x526fca,_0x335f74)['then'](function(_0x15c5c5){logger[_0xc138('0xc')](_0xc138('0xd'),_0x15c8e2,_0xc138('0xe'));logger[_0xc138('0xf')](_0xc138('0x10'),_0x15c8e2,'request\x20sent',JSON[_0xc138('0x11')](_0x15c5c5));if(_0x15c5c5['error']){if(_0x15c5c5['error'][_0xc138('0x12')]===0x1f4){logger[_0xc138('0x13')](_0xc138('0xd'),_0x15c8e2,_0x15c5c5[_0xc138('0x13')]['message']);return _0x4d7cc3(_0x15c5c5['error'][_0xc138('0x14')]);}logger[_0xc138('0x13')](_0xc138('0xd'),_0x15c8e2,_0x15c5c5['error'][_0xc138('0x14')]);return _0x142b17(_0x15c5c5[_0xc138('0x13')][_0xc138('0x14')]);}else{logger[_0xc138('0xc')]('DeskField,\x20%s,\x20%s',_0x15c8e2,_0xc138('0xe'));_0x142b17(_0x15c5c5[_0xc138('0x15')]['message']);}})[_0xc138('0x16')](function(_0x455c3f){logger[_0xc138('0x13')](_0xc138('0xd'),_0x15c8e2,_0x455c3f);_0x4d7cc3(_0x455c3f);});});} \ No newline at end of file +var _0xa09d=['client','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x36f5ae,_0x53960b){var _0x10c86c=function(_0x597583){while(--_0x597583){_0x36f5ae['push'](_0x36f5ae['shift']());}};_0x10c86c(++_0x53960b);}(_0xa09d,0xd4));var _0xda09=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0xa09d[_0x264545];return _0x114d10;};'use strict';var _=require(_0xda09('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xda09('0x1'));var rs=require(_0xda09('0x2'));var fs=require('fs');var Redis=require(_0xda09('0x3'));var db=require(_0xda09('0x4'))['db'];var utils=require(_0xda09('0x5'));var logger=require(_0xda09('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xda09('0x7'));var client=jayson[_0xda09('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27f2fd,_0x4a2e21,_0x19da33){return new BPromise(function(_0x3f1208,_0x577cdf){return client[_0xda09('0x9')](_0x27f2fd,_0x19da33)[_0xda09('0xa')](function(_0x2e313b){logger[_0xda09('0xb')](_0xda09('0xc'),_0x4a2e21,_0xda09('0xd'));logger[_0xda09('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x4a2e21,_0xda09('0xd'),JSON['stringify'](_0x2e313b));if(_0x2e313b['error']){if(_0x2e313b[_0xda09('0xf')][_0xda09('0x10')]===0x1f4){logger[_0xda09('0xf')](_0xda09('0xc'),_0x4a2e21,_0x2e313b[_0xda09('0xf')][_0xda09('0x11')]);return _0x577cdf(_0x2e313b[_0xda09('0xf')][_0xda09('0x11')]);}logger[_0xda09('0xf')](_0xda09('0xc'),_0x4a2e21,_0x2e313b[_0xda09('0xf')]['message']);return _0x3f1208(_0x2e313b[_0xda09('0xf')][_0xda09('0x11')]);}else{logger[_0xda09('0xb')](_0xda09('0xc'),_0x4a2e21,_0xda09('0xd'));_0x3f1208(_0x2e313b[_0xda09('0x12')][_0xda09('0x11')]);}})[_0xda09('0x13')](function(_0x506c71){logger[_0xda09('0xf')](_0xda09('0xc'),_0x4a2e21,_0x506c71);_0x577cdf(_0x506c71);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index c712808..83239b7 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 _0x42b8=['addConfiguration','put','update','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x42b8,0xc3));var _0x842b=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x42b8[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require(_0x842b('0x0'));var path=require(_0x842b('0x1'));var timeout=require('connect-timeout');var express=require(_0x842b('0x2'));var router=express['Router']();var fs_extra=require(_0x842b('0x3'));var auth=require(_0x842b('0x4'));var interaction=require(_0x842b('0x5'));var config=require(_0x842b('0x6'));var controller=require(_0x842b('0x7'));router[_0x842b('0x8')]('/',auth[_0x842b('0x9')](),controller['index']);router[_0x842b('0x8')](_0x842b('0xa'),auth[_0x842b('0x9')](),controller[_0x842b('0xb')]);router['get'](_0x842b('0xc'),auth[_0x842b('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x842b('0x9')](),controller['getFields']);router[_0x842b('0xd')]('/',auth[_0x842b('0x9')](),controller['create']);router[_0x842b('0xd')](_0x842b('0xc'),auth[_0x842b('0x9')](),controller[_0x842b('0xe')]);router[_0x842b('0xf')](_0x842b('0xa'),auth['isAuthenticated'](),controller[_0x842b('0x10')]);router['delete'](_0x842b('0xa'),auth[_0x842b('0x9')](),controller[_0x842b('0x11')]);module[_0x842b('0x12')]=router; \ No newline at end of file +var _0x6b54=['isAuthenticated','getConfigurations','/:id/fields','create','post','/:id/configurations','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','show'];(function(_0x5cd7de,_0x2a5628){var _0x285943=function(_0x4ecede){while(--_0x4ecede){_0x5cd7de['push'](_0x5cd7de['shift']());}};_0x285943(++_0x2a5628);}(_0x6b54,0x128));var _0x46b5=function(_0x4d36e7,_0x3fe21c){_0x4d36e7=_0x4d36e7-0x0;var _0x58c4c0=_0x6b54[_0x4d36e7];return _0x58c4c0;};'use strict';var multer=require(_0x46b5('0x0'));var util=require(_0x46b5('0x1'));var path=require(_0x46b5('0x2'));var timeout=require(_0x46b5('0x3'));var express=require(_0x46b5('0x4'));var router=express[_0x46b5('0x5')]();var fs_extra=require(_0x46b5('0x6'));var auth=require(_0x46b5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x46b5('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x46b5('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x46b5('0x9')](_0x46b5('0xa'),auth['isAuthenticated'](),controller[_0x46b5('0xb')]);router[_0x46b5('0x9')]('/:id/configurations',auth[_0x46b5('0xc')](),controller[_0x46b5('0xd')]);router[_0x46b5('0x9')](_0x46b5('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x46b5('0xc')](),controller[_0x46b5('0xf')]);router[_0x46b5('0x10')](_0x46b5('0x11'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x46b5('0x12')](_0x46b5('0xa'),auth[_0x46b5('0xc')](),controller[_0x46b5('0x13')]);router[_0x46b5('0x14')]('/:id',auth[_0x46b5('0xc')](),controller[_0x46b5('0x15')]);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 f4fb532..9b43507 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 _0x4d58=['STRING','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4d58,0x89));var _0x84d5=function(_0x146136,_0x5f4fcf){_0x146136=_0x146136-0x0;var _0x58946b=_0x4d58[_0x146136];return _0x58946b;};'use strict';var Sequelize=require(_0x84d5('0x0'));module['exports']={'name':{'type':Sequelize[_0x84d5('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x84d5('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x84d5('0x1')]},'clientSecret':{'type':Sequelize[_0x84d5('0x1')]},'serverUrl':{'type':Sequelize[_0x84d5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x84d5('0x1')]}}; \ No newline at end of file +var _0x6ead=['exports','STRING','sequelize'];(function(_0x1e88be,_0x29d20a){var _0x3654c5=function(_0x40a423){while(--_0x40a423){_0x1e88be['push'](_0x1e88be['shift']());}};_0x3654c5(++_0x29d20a);}(_0x6ead,0xe9));var _0xd6ea=function(_0x30ec88,_0x5dfab2){_0x30ec88=_0x30ec88-0x0;var _0x2cc3f2=_0x6ead[_0x30ec88];return _0x2cc3f2;};'use strict';var Sequelize=require(_0xd6ea('0x0'));module[_0xd6ea('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd6ea('0x2')]},'password':{'type':Sequelize[_0xd6ea('0x2')]},'remoteUri':{'type':Sequelize[_0xd6ea('0x2')]},'tenantId':{'type':Sequelize[_0xd6ea('0x2')]},'clientId':{'type':Sequelize[_0xd6ea('0x2')]},'clientSecret':{'type':Sequelize[_0xd6ea('0x2')]},'serverUrl':{'type':Sequelize[_0xd6ea('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd6ea('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 9a3e028..1845bb9 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 _0xf6c1=['model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','params','keys','length','includeAll','create','body','getConfigurations','Dynamics365Configuration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','productidname','productserialnumber','resolveby','resolvebykpiidname','sentimentvalue','slainvokedidname','slaname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','password','remoteUri','tenantId','clientSecret','slice','substring','format','%s/api/data/v9.0/','POST','clientId','username','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','Attributes','includes','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','all','isNil','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','push','test','statusCode','stack','Wrong\x20credentials','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','Dynamics365Account','rawAttributes','fieldName'];(function(_0x1fe8a4,_0xd9c7a7){var _0x5703e4=function(_0x5c0901){while(--_0x5c0901){_0x1fe8a4['push'](_0x1fe8a4['shift']());}};_0x5703e4(++_0xd9c7a7);}(_0xf6c1,0x99));var _0x1f6c=function(_0x26d96c,_0x1fd1ea){_0x26d96c=_0x26d96c-0x0;var _0x801e3c=_0xf6c1[_0x26d96c];return _0x801e3c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1f6c('0x0'));var jsonpatch=require(_0x1f6c('0x1'));var rp=require(_0x1f6c('0x2'));var moment=require('moment');var BPromise=require(_0x1f6c('0x3'));var Mustache=require('mustache');var util=require(_0x1f6c('0x4'));var path=require(_0x1f6c('0x5'));var sox=require(_0x1f6c('0x6'));var csv=require(_0x1f6c('0x7'));var ejs=require(_0x1f6c('0x8'));var fs=require('fs');var fs_extra=require(_0x1f6c('0x9'));var _=require('lodash');var squel=require(_0x1f6c('0xa'));var crypto=require(_0x1f6c('0xb'));var jsforce=require(_0x1f6c('0xc'));var deskjs=require(_0x1f6c('0xd'));var toCsv=require(_0x1f6c('0x7'));var querystring=require(_0x1f6c('0xe'));var Papa=require(_0x1f6c('0xf'));var Redis=require(_0x1f6c('0x10'));var authService=require(_0x1f6c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f6c('0x12'))(_0x1f6c('0x13'));var utils=require(_0x1f6c('0x14'));var config=require(_0x1f6c('0x15'));var licenseUtil=require(_0x1f6c('0x16'));var db=require(_0x1f6c('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x7963a9,_0x1e7060){_0x1e7060=_0x1e7060||0xcc;return function(_0xafed6f){if(_0xafed6f){return _0x7963a9[_0x1f6c('0x18')](_0x1e7060);}return _0x7963a9[_0x1f6c('0x19')](_0x1e7060)[_0x1f6c('0x1a')]();};}function respondWithResult(_0x31fc67,_0x147c01){_0x147c01=_0x147c01||0xc8;return function(_0x4ac9f5){if(_0x4ac9f5){return _0x31fc67[_0x1f6c('0x19')](_0x147c01)[_0x1f6c('0x1b')](_0x4ac9f5);}};}function respondWithFilteredResult(_0x26652b,_0x43ce04){return function(_0xc8b6f2){if(_0xc8b6f2){var _0xff1eaf=typeof _0x43ce04['offset']==='undefined'&&typeof _0x43ce04[_0x1f6c('0x1c')]===_0x1f6c('0x1d');var _0x596996=_0xc8b6f2[_0x1f6c('0x1e')];var _0x580056=_0xff1eaf?0x0:_0x43ce04[_0x1f6c('0x1f')];var _0x2ae87e=_0xff1eaf?_0xc8b6f2[_0x1f6c('0x1e')]:_0x43ce04[_0x1f6c('0x1f')]+_0x43ce04[_0x1f6c('0x1c')];var _0x25d5ec;if(_0x2ae87e>=_0x596996){_0x2ae87e=_0x596996;_0x25d5ec=0xc8;}else{_0x25d5ec=0xce;}_0x26652b[_0x1f6c('0x19')](_0x25d5ec);return _0x26652b[_0x1f6c('0x20')](_0x1f6c('0x21'),_0x580056+'-'+_0x2ae87e+'/'+_0x596996)[_0x1f6c('0x1b')](_0xc8b6f2);}return null;};}function patchUpdates(_0x44b1c5){return function(_0x25a0c6){try{jsonpatch[_0x1f6c('0x22')](_0x25a0c6,_0x44b1c5,!![]);}catch(_0xb5744d){return BPromise[_0x1f6c('0x23')](_0xb5744d);}return _0x25a0c6['save']();};}function saveUpdates(_0x2644e9,_0x511191){return function(_0xd066b){if(_0xd066b){return _0xd066b[_0x1f6c('0x24')](_0x2644e9)['then'](function(_0x1aa1f6){return _0x1aa1f6;});}return null;};}function removeEntity(_0x4ef92a,_0x32a812){return function(_0x38d9a2){if(_0x38d9a2){return _0x38d9a2[_0x1f6c('0x25')]()[_0x1f6c('0x26')](function(){_0x4ef92a[_0x1f6c('0x19')](0xcc)[_0x1f6c('0x1a')]();});}};}function handleEntityNotFound(_0x8b998c,_0x236f17){return function(_0x31cc1e){if(!_0x31cc1e){_0x8b998c[_0x1f6c('0x18')](0x194);}return _0x31cc1e;};}function handleError(_0x4ffb66,_0xa16408){_0xa16408=_0xa16408||0x1f4;return function(_0x3acae0){logger[_0x1f6c('0x27')](_0x3acae0['stack']);if(_0x3acae0[_0x1f6c('0x28')]){delete _0x3acae0[_0x1f6c('0x28')];}_0x4ffb66[_0x1f6c('0x19')](_0xa16408)[_0x1f6c('0x29')](_0x3acae0);};}exports[_0x1f6c('0x2a')]=function(_0x15df56,_0x51a230){var _0x420853={},_0x57dede={},_0x1bd7af={'count':0x0,'rows':[]};var _0xcac8c0=_[_0x1f6c('0x2b')](db[_0x1f6c('0x2c')][_0x1f6c('0x2d')],function(_0x497d8c){return{'name':_0x497d8c[_0x1f6c('0x2e')],'type':_0x497d8c['type']['key']};});_0x57dede[_0x1f6c('0x2f')]=_[_0x1f6c('0x2b')](_0xcac8c0,_0x1f6c('0x28'));_0x57dede[_0x1f6c('0x30')]=_['keys'](_0x15df56[_0x1f6c('0x30')]);_0x57dede[_0x1f6c('0x31')]=_[_0x1f6c('0x32')](_0x57dede[_0x1f6c('0x2f')],_0x57dede[_0x1f6c('0x30')]);_0x420853['attributes']=_['intersection'](_0x57dede[_0x1f6c('0x2f')],qs[_0x1f6c('0x33')](_0x15df56[_0x1f6c('0x30')][_0x1f6c('0x33')]));_0x420853['attributes']=_0x420853[_0x1f6c('0x34')]['length']?_0x420853['attributes']:_0x57dede[_0x1f6c('0x2f')];if(!_0x15df56[_0x1f6c('0x30')][_0x1f6c('0x35')](_0x1f6c('0x36'))){_0x420853[_0x1f6c('0x1c')]=qs[_0x1f6c('0x1c')](_0x15df56[_0x1f6c('0x30')][_0x1f6c('0x1c')]);_0x420853[_0x1f6c('0x1f')]=qs[_0x1f6c('0x1f')](_0x15df56[_0x1f6c('0x30')][_0x1f6c('0x1f')]);}_0x420853[_0x1f6c('0x37')]=qs[_0x1f6c('0x38')](_0x15df56[_0x1f6c('0x30')][_0x1f6c('0x38')]);_0x420853[_0x1f6c('0x39')]=qs['filters'](_[_0x1f6c('0x3a')](_0x15df56[_0x1f6c('0x30')],_0x57dede[_0x1f6c('0x31')]),_0xcac8c0);if(_0x15df56[_0x1f6c('0x30')][_0x1f6c('0x3b')]){_0x420853['where']=_['merge'](_0x420853[_0x1f6c('0x39')],{'$or':_[_0x1f6c('0x2b')](_0xcac8c0,function(_0x1e7ca6){if(_0x1e7ca6[_0x1f6c('0x3c')]!==_0x1f6c('0x3d')){var _0x21467b={};_0x21467b[_0x1e7ca6['name']]={'$like':'%'+_0x15df56[_0x1f6c('0x30')][_0x1f6c('0x3b')]+'%'};return _0x21467b;}})});}_0x420853=_[_0x1f6c('0x3e')]({},_0x420853,_0x15df56[_0x1f6c('0x3f')]);var _0x47819d={'where':_0x420853[_0x1f6c('0x39')]};return db[_0x1f6c('0x2c')][_0x1f6c('0x1e')](_0x47819d)['then'](function(_0x4bdcc9){_0x1bd7af[_0x1f6c('0x1e')]=_0x4bdcc9;if(_0x15df56['query']['includeAll']){_0x420853[_0x1f6c('0x40')]=[{'all':!![]}];}return db[_0x1f6c('0x2c')][_0x1f6c('0x41')](_0x420853);})[_0x1f6c('0x26')](function(_0x158900){_0x1bd7af[_0x1f6c('0x42')]=_0x158900;return _0x1bd7af;})[_0x1f6c('0x26')](respondWithFilteredResult(_0x51a230,_0x420853))[_0x1f6c('0x43')](handleError(_0x51a230,null));};exports['show']=function(_0x9f8495,_0x4b155c){var _0x4b92ac={'raw':![],'where':{'id':_0x9f8495[_0x1f6c('0x44')]['id']}},_0x23c3f1={};_0x23c3f1[_0x1f6c('0x2f')]=_['keys'](db[_0x1f6c('0x2c')][_0x1f6c('0x2d')]);_0x23c3f1[_0x1f6c('0x30')]=_[_0x1f6c('0x45')](_0x9f8495['query']);_0x23c3f1[_0x1f6c('0x31')]=_['intersection'](_0x23c3f1[_0x1f6c('0x2f')],_0x23c3f1[_0x1f6c('0x30')]);_0x4b92ac['attributes']=_[_0x1f6c('0x32')](_0x23c3f1['model'],qs['fields'](_0x9f8495[_0x1f6c('0x30')]['fields']));_0x4b92ac[_0x1f6c('0x34')]=_0x4b92ac['attributes'][_0x1f6c('0x46')]?_0x4b92ac[_0x1f6c('0x34')]:_0x23c3f1[_0x1f6c('0x2f')];if(_0x9f8495['query'][_0x1f6c('0x47')]){_0x4b92ac[_0x1f6c('0x40')]=[{'all':!![]}];}_0x4b92ac=_[_0x1f6c('0x3e')]({},_0x4b92ac,_0x9f8495['options']);return db['Dynamics365Account']['find'](_0x4b92ac)['then'](handleEntityNotFound(_0x4b155c,null))[_0x1f6c('0x26')](respondWithResult(_0x4b155c,null))[_0x1f6c('0x43')](handleError(_0x4b155c,null));};exports['create']=function(_0x4e0538,_0x251c9c){return db[_0x1f6c('0x2c')][_0x1f6c('0x48')](_0x4e0538[_0x1f6c('0x49')],{})[_0x1f6c('0x26')](respondWithResult(_0x251c9c,0xc9))[_0x1f6c('0x43')](handleError(_0x251c9c,null));};exports['update']=function(_0x303c50,_0x45e242){if(_0x303c50['body']['id']){delete _0x303c50[_0x1f6c('0x49')]['id'];}return db[_0x1f6c('0x2c')]['find']({'where':{'id':_0x303c50[_0x1f6c('0x44')]['id']}})['then'](handleEntityNotFound(_0x45e242,null))[_0x1f6c('0x26')](saveUpdates(_0x303c50[_0x1f6c('0x49')],null))[_0x1f6c('0x26')](respondWithResult(_0x45e242,null))['catch'](handleError(_0x45e242,null));};exports[_0x1f6c('0x25')]=function(_0x1ea369,_0x4b4621){return db[_0x1f6c('0x2c')]['find']({'where':{'id':_0x1ea369[_0x1f6c('0x44')]['id']}})[_0x1f6c('0x26')](handleEntityNotFound(_0x4b4621,null))[_0x1f6c('0x26')](removeEntity(_0x4b4621,null))['catch'](handleError(_0x4b4621,null));};exports[_0x1f6c('0x4a')]=function(_0x3b3fd0,_0x59a7d2,_0x286367){var _0x56fe49={};var _0x3fb957={};var _0x3b135c;var _0xd4d119;return db[_0x1f6c('0x2c')]['findOne']({'where':{'id':_0x3b3fd0['params']['id']}})['then'](handleEntityNotFound(_0x59a7d2,null))[_0x1f6c('0x26')](function(_0x426761){if(_0x426761){_0x3b135c=_0x426761;_0x3fb957[_0x1f6c('0x2f')]=_[_0x1f6c('0x45')](db[_0x1f6c('0x4b')][_0x1f6c('0x2d')]);_0x3fb957[_0x1f6c('0x30')]=_[_0x1f6c('0x45')](_0x3b3fd0[_0x1f6c('0x30')]);_0x3fb957[_0x1f6c('0x31')]=_[_0x1f6c('0x32')](_0x3fb957[_0x1f6c('0x2f')],_0x3fb957[_0x1f6c('0x30')]);_0x56fe49[_0x1f6c('0x34')]=_[_0x1f6c('0x32')](_0x3fb957[_0x1f6c('0x2f')],qs[_0x1f6c('0x33')](_0x3b3fd0[_0x1f6c('0x30')][_0x1f6c('0x33')]));_0x56fe49['attributes']=_0x56fe49[_0x1f6c('0x34')]['length']?_0x56fe49[_0x1f6c('0x34')]:_0x3fb957[_0x1f6c('0x2f')];_0x56fe49['order']=qs[_0x1f6c('0x38')](_0x3b3fd0[_0x1f6c('0x30')][_0x1f6c('0x38')]);_0x56fe49['where']=qs[_0x1f6c('0x31')](_[_0x1f6c('0x3a')](_0x3b3fd0['query'],_0x3fb957['filters']));if(_0x3b3fd0['query'][_0x1f6c('0x3b')]){_0x56fe49['where']=_[_0x1f6c('0x3e')](_0x56fe49[_0x1f6c('0x39')],{'$or':_[_0x1f6c('0x2b')](_0x56fe49[_0x1f6c('0x34')],function(_0x23298e){var _0x4cfeb4={};_0x4cfeb4[_0x23298e]={'$like':'%'+_0x3b3fd0[_0x1f6c('0x30')][_0x1f6c('0x3b')]+'%'};return _0x4cfeb4;})});}_0x56fe49=_[_0x1f6c('0x3e')]({},_0x56fe49,_0x3b3fd0[_0x1f6c('0x3f')]);return _0x3b135c[_0x1f6c('0x4a')](_0x56fe49);}})[_0x1f6c('0x26')](function(_0x374f18){if(_0x374f18){_0xd4d119=_0x374f18[_0x1f6c('0x46')];if(!_0x3b3fd0[_0x1f6c('0x30')][_0x1f6c('0x35')](_0x1f6c('0x36'))){_0x56fe49['limit']=qs[_0x1f6c('0x1c')](_0x3b3fd0['query'][_0x1f6c('0x1c')]);_0x56fe49[_0x1f6c('0x1f')]=qs[_0x1f6c('0x1f')](_0x3b3fd0[_0x1f6c('0x30')][_0x1f6c('0x1f')]);}return _0x3b135c['getConfigurations'](_0x56fe49);}})[_0x1f6c('0x26')](function(_0x407829){if(_0x407829){return _0x407829?{'count':_0xd4d119,'rows':_0x407829}:null;}})[_0x1f6c('0x26')](respondWithResult(_0x59a7d2,null))[_0x1f6c('0x43')](handleError(_0x59a7d2,null));};exports['addConfiguration']=function(_0x543e69,_0x3d9f9e,_0x4af7a1){if(_0x543e69[_0x1f6c('0x49')]['id']){delete _0x543e69[_0x1f6c('0x49')]['id'];}return db['Dynamics365Account'][_0x1f6c('0x4c')]({'where':{'id':_0x543e69['params']['id']}})['then'](handleEntityNotFound(_0x3d9f9e,null))[_0x1f6c('0x26')](function(_0x416674){if(_0x416674){_0x543e69['body']['AccountId']=_0x416674['id'];_0x543e69[_0x1f6c('0x49')][_0x1f6c('0x4d')]=integrations[_0x1f6c('0x4e')](_0x543e69['body'][_0x1f6c('0x4f')],_0x543e69[_0x1f6c('0x49')][_0x1f6c('0x3c')]);_0x543e69[_0x1f6c('0x49')][_0x1f6c('0x50')]=integrations[_0x1f6c('0x51')](_0x543e69[_0x1f6c('0x49')][_0x1f6c('0x4f')],_0x543e69[_0x1f6c('0x49')]['type']);return db[_0x1f6c('0x4b')][_0x1f6c('0x48')](_0x543e69[_0x1f6c('0x49')],{'include':[{'model':db[_0x1f6c('0x52')],'as':_0x1f6c('0x4d')},{'model':db[_0x1f6c('0x52')],'as':'Descriptions'}]});}return null;})[_0x1f6c('0x26')](respondWithResult(_0x3d9f9e,null))[_0x1f6c('0x43')](handleError(_0x3d9f9e,null));};exports[_0x1f6c('0x53')]=function(_0xdf620c,_0x20f575,_0x136809){var _0x807819=_0xdf620c[_0x1f6c('0x30')][_0x1f6c('0x54')];var _0x257d37=_0x807819===_0x1f6c('0x55')?'Incident':_0x1f6c('0x56');var _0x3e2eb9='';var _0x5bf6ce='';var _0x4cc1f1='';var _0x1ddee3='';var _0x12202f='';var _0x2f5556='';var _0x40e8c3='';var _0x55b3ef='';var _0x3dceab=['title',_0x1f6c('0x57'),_0x1f6c('0x58'),_0x1f6c('0x59'),_0x1f6c('0x5a'),_0x1f6c('0x5b'),'phonenumber','regardingobjectid',_0x1f6c('0x5c'),_0x1f6c('0x5d')];var _0x508e26=[_0x1f6c('0x5e'),_0x1f6c('0x5f'),'actualserviceunits',_0x1f6c('0x60'),_0x1f6c('0x61'),_0x1f6c('0x62'),_0x1f6c('0x63'),_0x1f6c('0x64'),'createdbyexternalpartyname',_0x1f6c('0x65'),_0x1f6c('0x66'),_0x1f6c('0x67'),_0x1f6c('0x68'),_0x1f6c('0x69'),'createdonbehalfbyyominame',_0x1f6c('0x6a'),_0x1f6c('0x6b'),_0x1f6c('0x6c'),'emailaddress',_0x1f6c('0x6d'),'entityimage_timestamp',_0x1f6c('0x6e'),_0x1f6c('0x6f'),_0x1f6c('0x70'),'firstresponsebykpiidname',_0x1f6c('0x71'),_0x1f6c('0x72'),_0x1f6c('0x73'),_0x1f6c('0x74'),_0x1f6c('0x75'),_0x1f6c('0x76'),_0x1f6c('0x77'),_0x1f6c('0x78'),'modifiedbyname',_0x1f6c('0x79'),_0x1f6c('0x7a'),_0x1f6c('0x7b'),_0x1f6c('0x7c'),'msdyn_incidenttypename','msdyn_iotalertname',_0x1f6c('0x7d'),'onholdtime',_0x1f6c('0x7e'),_0x1f6c('0x7f'),_0x1f6c('0x80'),_0x1f6c('0x81'),_0x1f6c('0x82'),_0x1f6c('0x83'),'primarycontactidyominame','prioritycodename',_0x1f6c('0x84'),_0x1f6c('0x85'),_0x1f6c('0x86'),_0x1f6c('0x87'),'responseby','responsiblecontactidname','responsiblecontactidyominame',_0x1f6c('0x88'),_0x1f6c('0x89'),_0x1f6c('0x8a'),'socialprofileidname',_0x1f6c('0x8b'),'statuscode',_0x1f6c('0x8c'),_0x1f6c('0x8d'),'timezoneruleversionnumber',_0x1f6c('0x8e'),_0x1f6c('0x8f'),'utcconversiontimezonecode',_0x1f6c('0x90')];var _0x758d74=_0x3dceab[_0x1f6c('0x91')](_0x508e26);return db[_0x1f6c('0x2c')][_0x1f6c('0x4c')]({'where':{'id':_0xdf620c[_0x1f6c('0x44')]['id']},'attributes':['id','username',_0x1f6c('0x92'),_0x1f6c('0x93'),_0x1f6c('0x94'),'clientId',_0x1f6c('0x95')]})['then'](handleEntityNotFound(_0x20f575,null))[_0x1f6c('0x26')](function(_0xc10beb){if(_0xc10beb){_0x55b3ef=_0xc10beb['remoteUri'];var _0x30eb35=_0x55b3ef[_0x1f6c('0x96')](-0x1);if(_0x30eb35==='/'){_0x55b3ef=_0x55b3ef[_0x1f6c('0x97')](0x0,_0x55b3ef['lastIndexOf'](_0x30eb35));}_0x40e8c3=util[_0x1f6c('0x98')](_0x1f6c('0x99'),_0x55b3ef);var _0x3f450e={'method':_0x1f6c('0x9a'),'uri':'https://login.microsoftonline.com/'+_0xc10beb[_0x1f6c('0x94')]+'/oauth2/token','form':{'client_id':_0xc10beb[_0x1f6c('0x9b')],'resource':_0x55b3ef,'username':_0xc10beb[_0x1f6c('0x9c')],'password':_0xc10beb[_0x1f6c('0x92')],'grant_type':_0x1f6c('0x92'),'client_secret':_0xc10beb['clientSecret']},'json':!![]};return rp(_0x3f450e);}})[_0x1f6c('0x26')](function(_0x5b35cc){_0x2f5556=_0x5b35cc[_0x1f6c('0x9d')];var _0x573395={'method':'GET','uri':encodeURI(_0x40e8c3+_0x1f6c('0x9e')+_0x257d37+'\x27'),'headers':{'Authorization':_0x1f6c('0x9f')+_0x2f5556,'If-None-Match':null,'OData-Version':_0x1f6c('0xa0')},'json':!![]};return rp(_0x573395);})[_0x1f6c('0x26')](function(_0xb1cf90){var _0x1d85da=_0xb1cf90[_0x1f6c('0xa1')][0x0];var _0x419f1a=_0x1d85da[_0x1f6c('0xa2')];var _0x7f53ae={'method':_0x1f6c('0xa3'),'uri':_0x40e8c3+'EntityDefinitions('+_0x419f1a+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x1f6c('0x9f')+_0x2f5556,'If-None-Match':null,'OData-Version':_0x1f6c('0xa0')},'json':!![]};return rp(_0x7f53ae);})['then'](function(_0x15667e){_0x3e2eb9=_0x15667e;_0x5bf6ce=_0x3e2eb9[_0x1f6c('0xa4')];_0x5bf6ce=_['remove'](_0x5bf6ce,function(_0x4d4f78){return!_0x758d74[_0x1f6c('0xa5')](_0x4d4f78[_0x1f6c('0xa6')]);});var _0x422c98=[];var _0x1717c8=[];_0x5bf6ce[_0x1f6c('0xa7')](function(_0x2be195){if(_0x2be195[_0x1f6c('0xa8')]){var _0x2a85aa=_0x2be195[_0x1f6c('0xa8')][_0x1f6c('0x97')](_0x2be195['@odata.type'][_0x1f6c('0xa9')]('.')+0x1);if(_0x2a85aa===_0x1f6c('0xaa')){_0x422c98['push'](getSelectList(_0x40e8c3,_0x807819,_0x1717c8,_0x3e2eb9[_0x1f6c('0xa2')],_0x2be195[_0x1f6c('0xa2')],_0x2f5556));}}});return Promise[_0x1f6c('0xab')](_0x422c98);})[_0x1f6c('0x26')](function(_0x58396c){_0x4cc1f1=_0x58396c[0x0];var _0x1011d3=[];var _0x3be672=[];_0x5bf6ce[_0x1f6c('0xa7')](function(_0x222670){if(!_[_0x1f6c('0xac')](_0x222670[_0x1f6c('0xa8')])){var _0x4b302a=_0x222670[_0x1f6c('0xa8')][_0x1f6c('0x97')](_0x222670['@odata.type'][_0x1f6c('0xa9')]('.')+0x1);if(_0x4b302a==='BooleanAttributeMetadata'){_0x1011d3['push'](getBooleanList(_0x40e8c3,_0x807819,_0x3be672,_0x3e2eb9['MetadataId'],_0x222670['MetadataId'],_0x2f5556));}}});return Promise[_0x1f6c('0xab')](_0x1011d3);})[_0x1f6c('0x26')](function(_0x5096cd){_0x1ddee3=_0x5096cd[0x0];var _0x450015=[];var _0x5cce62=[];_0x5bf6ce['forEach'](function(_0x5230ba){if(_0x5230ba['@odata.type']){var _0x1f19bb=_0x5230ba[_0x1f6c('0xa8')][_0x1f6c('0x97')](_0x5230ba[_0x1f6c('0xa8')]['lastIndexOf']('.')+0x1);if(_0x1f19bb===_0x1f6c('0xad')||_0x1f19bb==='DoubleAttributeMetadata'||_0x1f19bb===_0x1f6c('0xae')||_0x1f19bb===_0x1f6c('0xaf')||_0x1f19bb==='MemoAttributeMetadata'||_0x1f19bb===_0x1f6c('0xb0')||_0x1f19bb===_0x1f6c('0xb1')||_0x1f19bb==='EntityNameAttributeMetadata'||_0x1f19bb===_0x1f6c('0xb2')||_0x1f19bb===_0x1f6c('0xb3')){_0x450015[_0x1f6c('0xb4')](getInputList(_0x40e8c3,_0x807819,_0x1f19bb,_0x5cce62,_0x3e2eb9[_0x1f6c('0xa2')],_0x5230ba[_0x1f6c('0xa2')],_0x2f5556));}}});return Promise[_0x1f6c('0xab')](_0x450015);})[_0x1f6c('0x26')](function(_0x3c408c){_0x12202f=_0x3c408c[0x0];var _0x4de748=_0x4cc1f1['concat'](_0x1ddee3)[_0x1f6c('0x91')](_0x12202f);var _0x2d6692={'count':_0x4de748[_0x1f6c('0x46')],'rows':_0x4de748};return _0x2d6692;})[_0x1f6c('0x26')](respondWithResult(_0x20f575,null))[_0x1f6c('0x43')](function(_0x5d77a8){var _0x494149=_0xdf620c['query'][_0x1f6c('0xb5')]?0x1f4:_0x5d77a8[_0x1f6c('0xb6')]||0x1f4;logger['error'](_0x5d77a8[_0x1f6c('0xb7')]);delete _0x5d77a8[_0x1f6c('0x28')];if(_0x494149===0x191){_0x494149=0x190;}_0x20f575[_0x1f6c('0x19')](_0x494149)[_0x1f6c('0x29')](_0xdf620c['query']['test']?{'message':_0x1f6c('0xb8'),'statusCode':_0x5d77a8[_0x1f6c('0xb6')]}:_0x5d77a8);});};function getSelectList(_0x4b20aa,_0x12140d,_0x4bbae7,_0x123cca,_0x572d06,_0x8912c5){var _0x5f4615={'method':_0x1f6c('0xa3'),'uri':_0x4b20aa+_0x1f6c('0xb9')+_0x123cca+')/Attributes('+_0x572d06+_0x1f6c('0xba')+_0x1f6c('0xbb'),'headers':{'Authorization':_0x1f6c('0x9f')+_0x8912c5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5f4615)[_0x1f6c('0x26')](function(_0x359551){var _0x407ff1=[];var _0x9159b=_0x359551[_0x1f6c('0xbc')][_0x1f6c('0xbd')];_0x9159b[_0x1f6c('0xa7')](function(_0x52699c){_0x407ff1[_0x1f6c('0xb4')]({'name':_0x52699c[_0x1f6c('0xbe')][_0x1f6c('0xbf')][_0x1f6c('0xbe')],'value':String(_0x52699c[_0x1f6c('0xc0')])});});var _0x44b33b={'id':_0x12140d+'_'+_0x359551[_0x1f6c('0xa6')],'name':_0x359551[_0x1f6c('0xc1')][_0x1f6c('0xbf')][_0x1f6c('0xbe')],'custom':![],'options':_0x407ff1};_0x4bbae7[_0x1f6c('0xb4')](_0x44b33b);return _0x4bbae7;});}function getBooleanList(_0x49c080,_0x46e6f5,_0x30582f,_0x158e84,_0x3894c4,_0x2a0629){var _0x2c702c={'method':_0x1f6c('0xa3'),'uri':_0x49c080+_0x1f6c('0xb9')+_0x158e84+_0x1f6c('0xc2')+_0x3894c4+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x1f6c('0x9f')+_0x2a0629,'If-None-Match':null,'OData-Version':_0x1f6c('0xa0')},'json':!![]};return rp(_0x2c702c)[_0x1f6c('0x26')](function(_0x64344e){var _0x2c64ff=[];_0x2c64ff[_0x1f6c('0xb4')]({'name':_0x64344e[_0x1f6c('0xbc')][_0x1f6c('0xc3')][_0x1f6c('0xbe')][_0x1f6c('0xbf')][_0x1f6c('0xbe')],'value':_0x1f6c('0xc4')},{'name':_0x64344e[_0x1f6c('0xbc')]['FalseOption'][_0x1f6c('0xbe')]['UserLocalizedLabel'][_0x1f6c('0xbe')],'value':_0x1f6c('0xc5')});var _0x31953f={'id':_0x46e6f5+'_'+_0x64344e[_0x1f6c('0xa6')],'name':_0x64344e['DisplayName'][_0x1f6c('0xbf')][_0x1f6c('0xbe')],'custom':![],'options':_0x2c64ff};_0x30582f[_0x1f6c('0xb4')](_0x31953f);return _0x30582f;});}function getInputList(_0x4570b6,_0x1370a1,_0x550a9d,_0x3c4f1a,_0x1ab9eb,_0x5e4b7a,_0x3113d6){var _0x1035e0={'method':'GET','uri':_0x4570b6+_0x1f6c('0xb9')+_0x1ab9eb+_0x1f6c('0xc2')+_0x5e4b7a+_0x1f6c('0xc6')+_0x550a9d+_0x1f6c('0xc7'),'headers':{'Authorization':'Bearer\x20'+_0x3113d6,'If-None-Match':null,'OData-Version':_0x1f6c('0xa0')},'json':!![]};return rp(_0x1035e0)[_0x1f6c('0x26')](function(_0x5b45f1){var _0x282712={'id':_0x1370a1+'_'+_0x5b45f1[_0x1f6c('0xa6')],'name':_0x5b45f1[_0x1f6c('0xc1')][_0x1f6c('0xbf')]?_0x5b45f1[_0x1f6c('0xc1')][_0x1f6c('0xbf')][_0x1f6c('0xbe')]:_0x5b45f1[_0x1f6c('0xa6')],'custom':![],'options':[]};_0x3c4f1a['push'](_0x282712);return _0x3c4f1a;});} \ No newline at end of file +var _0x4be6=['undefined','count','Content-Range','apply','reject','save','then','error','name','index','rawAttributes','fieldName','type','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','limit','sort','pick','where','merge','Dynamics365Account','includeAll','include','findAll','catch','show','options','find','create','body','update','params','destroy','getConfigurations','findOne','Dynamics365Configuration','order','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientSecret','slice','substring','lastIndexOf','format','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','stack','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','DisplayName','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4be6,0xb5));var _0x64be=function(_0x17314d,_0x9082f8){_0x17314d=_0x17314d-0x0;var _0x2d6750=_0x4be6[_0x17314d];return _0x2d6750;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x64be('0x0'));var zipdir=require(_0x64be('0x1'));var jsonpatch=require(_0x64be('0x2'));var rp=require(_0x64be('0x3'));var moment=require(_0x64be('0x4'));var BPromise=require(_0x64be('0x5'));var Mustache=require(_0x64be('0x6'));var util=require(_0x64be('0x7'));var path=require(_0x64be('0x8'));var sox=require(_0x64be('0x9'));var csv=require('to-csv');var ejs=require(_0x64be('0xa'));var fs=require('fs');var fs_extra=require(_0x64be('0xb'));var _=require(_0x64be('0xc'));var squel=require('squel');var crypto=require(_0x64be('0xd'));var jsforce=require(_0x64be('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x64be('0xf'));var querystring=require('querystring');var Papa=require(_0x64be('0x10'));var Redis=require(_0x64be('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x64be('0x12'));var as=require(_0x64be('0x13'));var hardwareService=require(_0x64be('0x14'));var logger=require(_0x64be('0x15'))('api');var utils=require(_0x64be('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x64be('0x17'));var db=require(_0x64be('0x18'))['db'];var integrations=require(_0x64be('0x19'));function respondWithStatusCode(_0x24c80a,_0x1fb6c7){_0x1fb6c7=_0x1fb6c7||0xcc;return function(_0x5211af){if(_0x5211af){return _0x24c80a[_0x64be('0x1a')](_0x1fb6c7);}return _0x24c80a['status'](_0x1fb6c7)[_0x64be('0x1b')]();};}function respondWithResult(_0x15e400,_0x28ffc8){_0x28ffc8=_0x28ffc8||0xc8;return function(_0x46d207){if(_0x46d207){return _0x15e400[_0x64be('0x1c')](_0x28ffc8)['json'](_0x46d207);}};}function respondWithFilteredResult(_0x54f8a9,_0x87036e){return function(_0xd53297){if(_0xd53297){var _0x1163df=typeof _0x87036e[_0x64be('0x1d')]===_0x64be('0x1e')&&typeof _0x87036e['limit']===_0x64be('0x1e');var _0xe80165=_0xd53297[_0x64be('0x1f')];var _0x4b81ee=_0x1163df?0x0:_0x87036e[_0x64be('0x1d')];var _0x3e0371=_0x1163df?_0xd53297[_0x64be('0x1f')]:_0x87036e[_0x64be('0x1d')]+_0x87036e['limit'];var _0x18d3d4;if(_0x3e0371>=_0xe80165){_0x3e0371=_0xe80165;_0x18d3d4=0xc8;}else{_0x18d3d4=0xce;}_0x54f8a9[_0x64be('0x1c')](_0x18d3d4);return _0x54f8a9['set'](_0x64be('0x20'),_0x4b81ee+'-'+_0x3e0371+'/'+_0xe80165)['json'](_0xd53297);}return null;};}function patchUpdates(_0x3b67ce){return function(_0x3a7e47){try{jsonpatch[_0x64be('0x21')](_0x3a7e47,_0x3b67ce,!![]);}catch(_0x3cc51c){return BPromise[_0x64be('0x22')](_0x3cc51c);}return _0x3a7e47[_0x64be('0x23')]();};}function saveUpdates(_0x482fb1,_0x260d70){return function(_0x3e623f){if(_0x3e623f){return _0x3e623f['update'](_0x482fb1)[_0x64be('0x24')](function(_0x5acddc){return _0x5acddc;});}return null;};}function removeEntity(_0x16e37c,_0x5b1439){return function(_0xb1f2f9){if(_0xb1f2f9){return _0xb1f2f9['destroy']()[_0x64be('0x24')](function(){_0x16e37c[_0x64be('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f0f86,_0x18ce35){return function(_0x221933){if(!_0x221933){_0x4f0f86['sendStatus'](0x194);}return _0x221933;};}function handleError(_0x5d53b6,_0x591486){_0x591486=_0x591486||0x1f4;return function(_0x503b30){logger[_0x64be('0x25')](_0x503b30['stack']);if(_0x503b30[_0x64be('0x26')]){delete _0x503b30[_0x64be('0x26')];}_0x5d53b6['status'](_0x591486)['send'](_0x503b30);};}exports[_0x64be('0x27')]=function(_0x5854c7,_0x3de2ea){var _0x1e5827={},_0x27fbff={},_0x2ce84a={'count':0x0,'rows':[]};var _0x3123bc=_['map'](db['Dynamics365Account'][_0x64be('0x28')],function(_0x4a759d){return{'name':_0x4a759d[_0x64be('0x29')],'type':_0x4a759d[_0x64be('0x2a')]['key']};});_0x27fbff[_0x64be('0x2b')]=_[_0x64be('0x2c')](_0x3123bc,_0x64be('0x26'));_0x27fbff['query']=_[_0x64be('0x2d')](_0x5854c7['query']);_0x27fbff[_0x64be('0x2e')]=_['intersection'](_0x27fbff['model'],_0x27fbff[_0x64be('0x2f')]);_0x1e5827[_0x64be('0x30')]=_[_0x64be('0x31')](_0x27fbff[_0x64be('0x2b')],qs['fields'](_0x5854c7['query'][_0x64be('0x32')]));_0x1e5827[_0x64be('0x30')]=_0x1e5827[_0x64be('0x30')][_0x64be('0x33')]?_0x1e5827[_0x64be('0x30')]:_0x27fbff[_0x64be('0x2b')];if(!_0x5854c7[_0x64be('0x2f')][_0x64be('0x34')]('nolimit')){_0x1e5827['limit']=qs[_0x64be('0x35')](_0x5854c7[_0x64be('0x2f')]['limit']);_0x1e5827[_0x64be('0x1d')]=qs['offset'](_0x5854c7[_0x64be('0x2f')][_0x64be('0x1d')]);}_0x1e5827['order']=qs['sort'](_0x5854c7[_0x64be('0x2f')][_0x64be('0x36')]);_0x1e5827['where']=qs[_0x64be('0x2e')](_[_0x64be('0x37')](_0x5854c7[_0x64be('0x2f')],_0x27fbff['filters']),_0x3123bc);if(_0x5854c7['query']['filter']){_0x1e5827[_0x64be('0x38')]=_['merge'](_0x1e5827['where'],{'$or':_['map'](_0x3123bc,function(_0xbc4987){if(_0xbc4987[_0x64be('0x2a')]!=='VIRTUAL'){var _0x34aa82={};_0x34aa82[_0xbc4987[_0x64be('0x26')]]={'$like':'%'+_0x5854c7[_0x64be('0x2f')]['filter']+'%'};return _0x34aa82;}})});}_0x1e5827=_[_0x64be('0x39')]({},_0x1e5827,_0x5854c7['options']);var _0x448524={'where':_0x1e5827[_0x64be('0x38')]};return db[_0x64be('0x3a')][_0x64be('0x1f')](_0x448524)[_0x64be('0x24')](function(_0x38895b){_0x2ce84a[_0x64be('0x1f')]=_0x38895b;if(_0x5854c7[_0x64be('0x2f')][_0x64be('0x3b')]){_0x1e5827[_0x64be('0x3c')]=[{'all':!![]}];}return db[_0x64be('0x3a')][_0x64be('0x3d')](_0x1e5827);})[_0x64be('0x24')](function(_0xf0aec0){_0x2ce84a['rows']=_0xf0aec0;return _0x2ce84a;})[_0x64be('0x24')](respondWithFilteredResult(_0x3de2ea,_0x1e5827))[_0x64be('0x3e')](handleError(_0x3de2ea,null));};exports[_0x64be('0x3f')]=function(_0x18d343,_0xbc570){var _0x140994={'raw':![],'where':{'id':_0x18d343['params']['id']}},_0x5747f6={};_0x5747f6['model']=_[_0x64be('0x2d')](db['Dynamics365Account'][_0x64be('0x28')]);_0x5747f6[_0x64be('0x2f')]=_['keys'](_0x18d343[_0x64be('0x2f')]);_0x5747f6[_0x64be('0x2e')]=_['intersection'](_0x5747f6['model'],_0x5747f6[_0x64be('0x2f')]);_0x140994['attributes']=_['intersection'](_0x5747f6[_0x64be('0x2b')],qs[_0x64be('0x32')](_0x18d343[_0x64be('0x2f')][_0x64be('0x32')]));_0x140994[_0x64be('0x30')]=_0x140994[_0x64be('0x30')][_0x64be('0x33')]?_0x140994[_0x64be('0x30')]:_0x5747f6[_0x64be('0x2b')];if(_0x18d343[_0x64be('0x2f')][_0x64be('0x3b')]){_0x140994[_0x64be('0x3c')]=[{'all':!![]}];}_0x140994=_[_0x64be('0x39')]({},_0x140994,_0x18d343[_0x64be('0x40')]);return db[_0x64be('0x3a')][_0x64be('0x41')](_0x140994)[_0x64be('0x24')](handleEntityNotFound(_0xbc570,null))['then'](respondWithResult(_0xbc570,null))['catch'](handleError(_0xbc570,null));};exports[_0x64be('0x42')]=function(_0x3c78a4,_0x144f13){return db[_0x64be('0x3a')][_0x64be('0x42')](_0x3c78a4[_0x64be('0x43')],{})['then'](respondWithResult(_0x144f13,0xc9))[_0x64be('0x3e')](handleError(_0x144f13,null));};exports[_0x64be('0x44')]=function(_0x342d3a,_0x457f7f){if(_0x342d3a[_0x64be('0x43')]['id']){delete _0x342d3a[_0x64be('0x43')]['id'];}return db[_0x64be('0x3a')][_0x64be('0x41')]({'where':{'id':_0x342d3a[_0x64be('0x45')]['id']}})['then'](handleEntityNotFound(_0x457f7f,null))[_0x64be('0x24')](saveUpdates(_0x342d3a[_0x64be('0x43')],null))[_0x64be('0x24')](respondWithResult(_0x457f7f,null))[_0x64be('0x3e')](handleError(_0x457f7f,null));};exports[_0x64be('0x46')]=function(_0x2a2877,_0x1ab21d){return db['Dynamics365Account'][_0x64be('0x41')]({'where':{'id':_0x2a2877[_0x64be('0x45')]['id']}})['then'](handleEntityNotFound(_0x1ab21d,null))['then'](removeEntity(_0x1ab21d,null))[_0x64be('0x3e')](handleError(_0x1ab21d,null));};exports[_0x64be('0x47')]=function(_0x47bff3,_0x3d39ce,_0x1a2e84){var _0x513e0e={};var _0x3fc79a={};var _0x4fa610;var _0x219a09;return db[_0x64be('0x3a')][_0x64be('0x48')]({'where':{'id':_0x47bff3[_0x64be('0x45')]['id']}})[_0x64be('0x24')](handleEntityNotFound(_0x3d39ce,null))[_0x64be('0x24')](function(_0x49bf8a){if(_0x49bf8a){_0x4fa610=_0x49bf8a;_0x3fc79a[_0x64be('0x2b')]=_[_0x64be('0x2d')](db[_0x64be('0x49')][_0x64be('0x28')]);_0x3fc79a[_0x64be('0x2f')]=_[_0x64be('0x2d')](_0x47bff3[_0x64be('0x2f')]);_0x3fc79a[_0x64be('0x2e')]=_['intersection'](_0x3fc79a[_0x64be('0x2b')],_0x3fc79a[_0x64be('0x2f')]);_0x513e0e['attributes']=_['intersection'](_0x3fc79a['model'],qs['fields'](_0x47bff3[_0x64be('0x2f')][_0x64be('0x32')]));_0x513e0e[_0x64be('0x30')]=_0x513e0e[_0x64be('0x30')][_0x64be('0x33')]?_0x513e0e[_0x64be('0x30')]:_0x3fc79a[_0x64be('0x2b')];_0x513e0e[_0x64be('0x4a')]=qs['sort'](_0x47bff3[_0x64be('0x2f')][_0x64be('0x36')]);_0x513e0e['where']=qs[_0x64be('0x2e')](_[_0x64be('0x37')](_0x47bff3[_0x64be('0x2f')],_0x3fc79a[_0x64be('0x2e')]));if(_0x47bff3[_0x64be('0x2f')]['filter']){_0x513e0e[_0x64be('0x38')]=_[_0x64be('0x39')](_0x513e0e['where'],{'$or':_[_0x64be('0x2c')](_0x513e0e[_0x64be('0x30')],function(_0xdc9071){var _0x2af31c={};_0x2af31c[_0xdc9071]={'$like':'%'+_0x47bff3[_0x64be('0x2f')]['filter']+'%'};return _0x2af31c;})});}_0x513e0e=_[_0x64be('0x39')]({},_0x513e0e,_0x47bff3['options']);return _0x4fa610[_0x64be('0x47')](_0x513e0e);}})[_0x64be('0x24')](function(_0x5dee9b){if(_0x5dee9b){_0x219a09=_0x5dee9b['length'];if(!_0x47bff3['query'][_0x64be('0x34')](_0x64be('0x4b'))){_0x513e0e['limit']=qs[_0x64be('0x35')](_0x47bff3['query']['limit']);_0x513e0e[_0x64be('0x1d')]=qs[_0x64be('0x1d')](_0x47bff3['query'][_0x64be('0x1d')]);}return _0x4fa610[_0x64be('0x47')](_0x513e0e);}})[_0x64be('0x24')](function(_0x51eb19){if(_0x51eb19){return _0x51eb19?{'count':_0x219a09,'rows':_0x51eb19}:null;}})[_0x64be('0x24')](respondWithResult(_0x3d39ce,null))['catch'](handleError(_0x3d39ce,null));};exports['addConfiguration']=function(_0x1adc11,_0x584685,_0xa02d5a){if(_0x1adc11['body']['id']){delete _0x1adc11[_0x64be('0x43')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x1adc11[_0x64be('0x45')]['id']}})[_0x64be('0x24')](handleEntityNotFound(_0x584685,null))[_0x64be('0x24')](function(_0x6fa3aa){if(_0x6fa3aa){_0x1adc11[_0x64be('0x43')][_0x64be('0x4c')]=_0x6fa3aa['id'];_0x1adc11[_0x64be('0x43')][_0x64be('0x4d')]=integrations[_0x64be('0x4e')](_0x1adc11[_0x64be('0x43')][_0x64be('0x4f')],_0x1adc11[_0x64be('0x43')][_0x64be('0x2a')]);_0x1adc11[_0x64be('0x43')][_0x64be('0x50')]=integrations[_0x64be('0x51')](_0x1adc11[_0x64be('0x43')][_0x64be('0x4f')],_0x1adc11[_0x64be('0x43')][_0x64be('0x2a')]);return db['Dynamics365Configuration'][_0x64be('0x42')](_0x1adc11[_0x64be('0x43')],{'include':[{'model':db[_0x64be('0x52')],'as':_0x64be('0x4d')},{'model':db[_0x64be('0x52')],'as':'Descriptions'}]});}return null;})[_0x64be('0x24')](respondWithResult(_0x584685,null))[_0x64be('0x3e')](handleError(_0x584685,null));};exports[_0x64be('0x53')]=function(_0x3b851a,_0x244bfd,_0x695e32){var _0x207392=_0x3b851a['query'][_0x64be('0x54')];var _0x4ed35c=_0x207392===_0x64be('0x55')?_0x64be('0x56'):_0x64be('0x57');var _0x3b2a55='';var _0x1f81bf='';var _0x33fec7='';var _0x2d0b97='';var _0x1a6be6='';var _0x370cb7='';var _0x2adf84='';var _0x1bdc89='';var _0x14f5f9=[_0x64be('0x58'),'description',_0x64be('0x59'),_0x64be('0x5a'),_0x64be('0x5b'),_0x64be('0x5c'),_0x64be('0x5d'),_0x64be('0x5e'),_0x64be('0x5f'),_0x64be('0x60')];var _0x5e24a5=[_0x64be('0x61'),_0x64be('0x62'),'actualserviceunits','billedserviceunits',_0x64be('0x63'),_0x64be('0x64'),_0x64be('0x65'),'contractidname',_0x64be('0x66'),_0x64be('0x67'),'createdbyname',_0x64be('0x68'),_0x64be('0x69'),_0x64be('0x6a'),_0x64be('0x6b'),_0x64be('0x6c'),_0x64be('0x6d'),_0x64be('0x6e'),'emailaddress','entitlementidname',_0x64be('0x6f'),_0x64be('0x70'),_0x64be('0x71'),_0x64be('0x72'),'firstresponsebykpiidname',_0x64be('0x73'),_0x64be('0x74'),_0x64be('0x75'),'kbarticleidname',_0x64be('0x76'),'masteridname',_0x64be('0x77'),_0x64be('0x78'),_0x64be('0x79'),'modifiedbyyominame',_0x64be('0x7a'),_0x64be('0x7b'),_0x64be('0x7c'),_0x64be('0x7d'),_0x64be('0x7e'),_0x64be('0x7f'),_0x64be('0x80'),_0x64be('0x81'),_0x64be('0x82'),_0x64be('0x83'),_0x64be('0x84'),'parentcaseidname',_0x64be('0x85'),_0x64be('0x86'),'prioritycodename',_0x64be('0x87'),_0x64be('0x88'),'resolveby','resolvebykpiidname',_0x64be('0x89'),'responsiblecontactidname',_0x64be('0x8a'),_0x64be('0x8b'),_0x64be('0x8c'),_0x64be('0x8d'),_0x64be('0x8e'),_0x64be('0x8f'),'statuscode',_0x64be('0x90'),'ticketnumber',_0x64be('0x91'),_0x64be('0x92'),_0x64be('0x93'),_0x64be('0x94'),_0x64be('0x95')];var _0x5dc278=_0x14f5f9[_0x64be('0x96')](_0x5e24a5);return db[_0x64be('0x3a')]['findOne']({'where':{'id':_0x3b851a[_0x64be('0x45')]['id']},'attributes':['id',_0x64be('0x97'),_0x64be('0x98'),_0x64be('0x99'),_0x64be('0x9a'),'clientId',_0x64be('0x9b')]})[_0x64be('0x24')](handleEntityNotFound(_0x244bfd,null))[_0x64be('0x24')](function(_0x25143b){if(_0x25143b){_0x1bdc89=_0x25143b['remoteUri'];var _0x5d3910=_0x1bdc89[_0x64be('0x9c')](-0x1);if(_0x5d3910==='/'){_0x1bdc89=_0x1bdc89[_0x64be('0x9d')](0x0,_0x1bdc89[_0x64be('0x9e')](_0x5d3910));}_0x2adf84=util[_0x64be('0x9f')]('%s/api/data/v9.0/',_0x1bdc89);var _0xc5392e={'method':_0x64be('0xa0'),'uri':_0x64be('0xa1')+_0x25143b['tenantId']+_0x64be('0xa2'),'form':{'client_id':_0x25143b[_0x64be('0xa3')],'resource':_0x1bdc89,'username':_0x25143b['username'],'password':_0x25143b[_0x64be('0x98')],'grant_type':_0x64be('0x98'),'client_secret':_0x25143b[_0x64be('0x9b')]},'json':!![]};return rp(_0xc5392e);}})[_0x64be('0x24')](function(_0x3a0e6d){_0x370cb7=_0x3a0e6d['access_token'];var _0x2dec7f={'method':_0x64be('0xa4'),'uri':encodeURI(_0x2adf84+_0x64be('0xa5')+_0x4ed35c+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x370cb7,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2dec7f);})['then'](function(_0x1b545a){var _0x127827=_0x1b545a[_0x64be('0xa6')][0x0];var _0x1a9d23=_0x127827['MetadataId'];var _0x5d5933={'method':_0x64be('0xa4'),'uri':_0x2adf84+_0x64be('0xa7')+_0x1a9d23+_0x64be('0xa8'),'headers':{'Authorization':_0x64be('0xa9')+_0x370cb7,'If-None-Match':null,'OData-Version':_0x64be('0xaa')},'json':!![]};return rp(_0x5d5933);})[_0x64be('0x24')](function(_0x3c63b9){_0x3b2a55=_0x3c63b9;_0x1f81bf=_0x3b2a55[_0x64be('0xab')];_0x1f81bf=_[_0x64be('0xac')](_0x1f81bf,function(_0x6e1ecf){return!_0x5dc278[_0x64be('0xad')](_0x6e1ecf[_0x64be('0xae')]);});var _0x160cfc=[];var _0x1039a8=[];_0x1f81bf[_0x64be('0xaf')](function(_0x38b45b){if(_0x38b45b[_0x64be('0xb0')]){var _0x5ccd77=_0x38b45b[_0x64be('0xb0')][_0x64be('0x9d')](_0x38b45b[_0x64be('0xb0')]['lastIndexOf']('.')+0x1);if(_0x5ccd77===_0x64be('0xb1')){_0x160cfc[_0x64be('0xb2')](getSelectList(_0x2adf84,_0x207392,_0x1039a8,_0x3b2a55[_0x64be('0xb3')],_0x38b45b['MetadataId'],_0x370cb7));}}});return Promise[_0x64be('0xb4')](_0x160cfc);})[_0x64be('0x24')](function(_0x2b6bfe){_0x33fec7=_0x2b6bfe[0x0];var _0x297b4e=[];var _0x55f102=[];_0x1f81bf['forEach'](function(_0x2c0590){if(!_[_0x64be('0xb5')](_0x2c0590['@odata.type'])){var _0x3f929f=_0x2c0590[_0x64be('0xb0')][_0x64be('0x9d')](_0x2c0590[_0x64be('0xb0')][_0x64be('0x9e')]('.')+0x1);if(_0x3f929f===_0x64be('0xb6')){_0x297b4e[_0x64be('0xb2')](getBooleanList(_0x2adf84,_0x207392,_0x55f102,_0x3b2a55['MetadataId'],_0x2c0590[_0x64be('0xb3')],_0x370cb7));}}});return Promise[_0x64be('0xb4')](_0x297b4e);})[_0x64be('0x24')](function(_0x20e4dc){_0x2d0b97=_0x20e4dc[0x0];var _0x5a2926=[];var _0x4d2300=[];_0x1f81bf['forEach'](function(_0x1a73ac){if(_0x1a73ac[_0x64be('0xb0')]){var _0x1d74dc=_0x1a73ac['@odata.type'][_0x64be('0x9d')](_0x1a73ac['@odata.type']['lastIndexOf']('.')+0x1);if(_0x1d74dc===_0x64be('0xb7')||_0x1d74dc===_0x64be('0xb8')||_0x1d74dc===_0x64be('0xb9')||_0x1d74dc===_0x64be('0xba')||_0x1d74dc==='MemoAttributeMetadata'||_0x1d74dc===_0x64be('0xbb')||_0x1d74dc===_0x64be('0xbc')||_0x1d74dc===_0x64be('0xbd')||_0x1d74dc===_0x64be('0xbe')||_0x1d74dc==='DecimalAttributeMetadata'){_0x5a2926['push'](getInputList(_0x2adf84,_0x207392,_0x1d74dc,_0x4d2300,_0x3b2a55[_0x64be('0xb3')],_0x1a73ac['MetadataId'],_0x370cb7));}}});return Promise[_0x64be('0xb4')](_0x5a2926);})[_0x64be('0x24')](function(_0x13a062){_0x1a6be6=_0x13a062[0x0];var _0x29f8a5=_0x33fec7[_0x64be('0x96')](_0x2d0b97)[_0x64be('0x96')](_0x1a6be6);var _0x9dbc4e={'count':_0x29f8a5[_0x64be('0x33')],'rows':_0x29f8a5};return _0x9dbc4e;})[_0x64be('0x24')](respondWithResult(_0x244bfd,null))[_0x64be('0x3e')](function(_0x1fa461){var _0x5b3c5c=_0x3b851a['query'][_0x64be('0xbf')]?0x1f4:_0x1fa461[_0x64be('0xc0')]||0x1f4;logger[_0x64be('0x25')](_0x1fa461[_0x64be('0xc1')]);delete _0x1fa461['name'];if(_0x5b3c5c===0x191){_0x5b3c5c=0x190;}_0x244bfd[_0x64be('0x1c')](_0x5b3c5c)[_0x64be('0xc2')](_0x3b851a[_0x64be('0x2f')][_0x64be('0xbf')]?{'message':_0x64be('0xc3'),'statusCode':_0x1fa461[_0x64be('0xc0')]}:_0x1fa461);});};function getSelectList(_0xb75942,_0x1a1870,_0x316b0f,_0x4ec0ce,_0x1ec1aa,_0x5f4370){var _0x406225={'method':_0x64be('0xa4'),'uri':_0xb75942+_0x64be('0xa7')+_0x4ec0ce+_0x64be('0xc4')+_0x1ec1aa+_0x64be('0xc5')+_0x64be('0xc6'),'headers':{'Authorization':_0x64be('0xa9')+_0x5f4370,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x406225)[_0x64be('0x24')](function(_0x3c1572){var _0x4af2a1=[];var _0x2cf42c=_0x3c1572[_0x64be('0xc7')][_0x64be('0xc8')];_0x2cf42c[_0x64be('0xaf')](function(_0x17e15e){_0x4af2a1[_0x64be('0xb2')]({'name':_0x17e15e[_0x64be('0xc9')][_0x64be('0xca')][_0x64be('0xc9')],'value':String(_0x17e15e['Value'])});});var _0x324290={'id':_0x1a1870+'_'+_0x3c1572[_0x64be('0xae')],'name':_0x3c1572['DisplayName'][_0x64be('0xca')][_0x64be('0xc9')],'custom':![],'options':_0x4af2a1};_0x316b0f[_0x64be('0xb2')](_0x324290);return _0x316b0f;});}function getBooleanList(_0x42d74c,_0x3e0da1,_0x3f4d53,_0xab4092,_0x5968e4,_0x136213){var _0x16508a={'method':'GET','uri':_0x42d74c+_0x64be('0xa7')+_0xab4092+')/Attributes('+_0x5968e4+_0x64be('0xcb'),'headers':{'Authorization':'Bearer\x20'+_0x136213,'If-None-Match':null,'OData-Version':_0x64be('0xaa')},'json':!![]};return rp(_0x16508a)[_0x64be('0x24')](function(_0xb63b95){var _0x2726d2=[];_0x2726d2[_0x64be('0xb2')]({'name':_0xb63b95[_0x64be('0xc7')][_0x64be('0xcc')][_0x64be('0xc9')][_0x64be('0xca')]['Label'],'value':_0x64be('0xcd')},{'name':_0xb63b95[_0x64be('0xc7')][_0x64be('0xce')][_0x64be('0xc9')][_0x64be('0xca')]['Label'],'value':_0x64be('0xcf')});var _0x5c1bbc={'id':_0x3e0da1+'_'+_0xb63b95['LogicalName'],'name':_0xb63b95['DisplayName'][_0x64be('0xca')][_0x64be('0xc9')],'custom':![],'options':_0x2726d2};_0x3f4d53['push'](_0x5c1bbc);return _0x3f4d53;});}function getInputList(_0x27dcd6,_0x11a0a,_0xa4454,_0x33666c,_0x364f8d,_0x856427,_0x32ff04){var _0x3dd8de={'method':_0x64be('0xa4'),'uri':_0x27dcd6+_0x64be('0xa7')+_0x364f8d+_0x64be('0xc4')+_0x856427+_0x64be('0xd0')+_0xa4454+_0x64be('0xd1'),'headers':{'Authorization':_0x64be('0xa9')+_0x32ff04,'If-None-Match':null,'OData-Version':_0x64be('0xaa')},'json':!![]};return rp(_0x3dd8de)['then'](function(_0x40872b){var _0x2809af={'id':_0x11a0a+'_'+_0x40872b['LogicalName'],'name':_0x40872b['DisplayName'][_0x64be('0xca')]?_0x40872b[_0x64be('0xd2')]['UserLocalizedLabel'][_0x64be('0xc9')]:_0x40872b[_0x64be('0xae')],'custom':![],'options':[]};_0x33666c[_0x64be('0xb2')](_0x2809af);return _0x33666c;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index c079d75..8ba814d 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 _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x2ad802,_0x3c2db2){var _0x5b7f6c=function(_0x4da961){while(--_0x4da961){_0x2ad802['push'](_0x2ad802['shift']());}};_0x5b7f6c(++_0x3c2db2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0xcb91[_0x386525];return _0x14d015;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x53bcc3,_0x364374){var _0x47c959=function(_0x40ef7d){while(--_0x40ef7d){_0x53bcc3['push'](_0x53bcc3['shift']());}};_0x47c959(++_0x364374);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 4de678f..f69e0cf 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 _0xb7f9=['where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','include','map','model','ShowDynamics365Account'];(function(_0x414298,_0x583910){var _0x5d01d1=function(_0x5a07e5){while(--_0x5a07e5){_0x414298['push'](_0x414298['shift']());}};_0x5d01d1(++_0x583910);}(_0xb7f9,0x119));var _0x9b7f=function(_0x23a8ba,_0xab5848){_0x23a8ba=_0x23a8ba-0x0;var _0x468389=_0xb7f9[_0x23a8ba];return _0x468389;};'use strict';var _=require('lodash');var util=require(_0x9b7f('0x0'));var moment=require('moment');var BPromise=require(_0x9b7f('0x1'));var rs=require(_0x9b7f('0x2'));var fs=require('fs');var Redis=require(_0x9b7f('0x3'));var db=require(_0x9b7f('0x4'))['db'];var utils=require(_0x9b7f('0x5'));var logger=require(_0x9b7f('0x6'))(_0x9b7f('0x7'));var config=require(_0x9b7f('0x8'));var jayson=require(_0x9b7f('0x9'));var client=jayson[_0x9b7f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cd588,_0x39ae0b,_0x2f0433){return new BPromise(function(_0x471410,_0x4115ec){return client[_0x9b7f('0xb')](_0x5cd588,_0x2f0433)[_0x9b7f('0xc')](function(_0x1dceb6){logger[_0x9b7f('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x39ae0b,_0x9b7f('0xe'));logger[_0x9b7f('0xf')](_0x9b7f('0x10'),_0x39ae0b,_0x9b7f('0xe'),JSON[_0x9b7f('0x11')](_0x1dceb6));if(_0x1dceb6[_0x9b7f('0x12')]){if(_0x1dceb6[_0x9b7f('0x12')][_0x9b7f('0x13')]===0x1f4){logger[_0x9b7f('0x12')](_0x9b7f('0x14'),_0x39ae0b,_0x1dceb6[_0x9b7f('0x12')][_0x9b7f('0x15')]);return _0x4115ec(_0x1dceb6[_0x9b7f('0x12')][_0x9b7f('0x15')]);}logger[_0x9b7f('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x39ae0b,_0x1dceb6[_0x9b7f('0x12')][_0x9b7f('0x15')]);return _0x471410(_0x1dceb6[_0x9b7f('0x12')]['message']);}else{logger[_0x9b7f('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x39ae0b,_0x9b7f('0xe'));_0x471410(_0x1dceb6[_0x9b7f('0x16')][_0x9b7f('0x15')]);}})[_0x9b7f('0x17')](function(_0x1f14f7){logger[_0x9b7f('0x12')](_0x9b7f('0x14'),_0x39ae0b,_0x1f14f7);_0x4115ec(_0x1f14f7);});});}exports[_0x9b7f('0x18')]=function(_0x1d12d0){var _0x389e6d=this;return new Promise(function(_0x340f18,_0x2c9bcb){return db[_0x9b7f('0x19')][_0x9b7f('0x1a')]({'raw':_0x1d12d0[_0x9b7f('0x1b')]?_0x1d12d0[_0x9b7f('0x1b')][_0x9b7f('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d12d0[_0x9b7f('0x1b')]?_0x1d12d0['options']['where']||null:null,'attributes':_0x1d12d0[_0x9b7f('0x1b')]?_0x1d12d0[_0x9b7f('0x1b')][_0x9b7f('0x1d')]||null:null,'limit':_0x1d12d0[_0x9b7f('0x1b')]?_0x1d12d0['options']['limit']||null:null,'include':_0x1d12d0[_0x9b7f('0x1b')]?_0x1d12d0[_0x9b7f('0x1b')][_0x9b7f('0x1e')]?_[_0x9b7f('0x1f')](_0x1d12d0[_0x9b7f('0x1b')]['include'],function(_0x3f6b3a){return{'model':db[_0x3f6b3a[_0x9b7f('0x20')]],'as':_0x3f6b3a['as'],'attributes':_0x3f6b3a[_0x9b7f('0x1d')],'include':_0x3f6b3a[_0x9b7f('0x1e')]?_[_0x9b7f('0x1f')](_0x3f6b3a[_0x9b7f('0x1e')],function(_0x4e828f){return{'model':db[_0x4e828f[_0x9b7f('0x20')]],'as':_0x4e828f['as'],'attributes':_0x4e828f[_0x9b7f('0x1d')],'include':_0x4e828f[_0x9b7f('0x1e')]?_[_0x9b7f('0x1f')](_0x4e828f[_0x9b7f('0x1e')],function(_0x220a8c){return{'model':db[_0x220a8c[_0x9b7f('0x20')]],'as':_0x220a8c['as'],'attributes':_0x220a8c[_0x9b7f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x90f691){logger[_0x9b7f('0xd')](_0x9b7f('0x18'),_0x1d12d0);logger[_0x9b7f('0xf')]('GetDynamics365Account',_0x1d12d0,JSON[_0x9b7f('0x11')](_0x90f691));_0x340f18(_0x90f691);})[_0x9b7f('0x17')](function(_0x3462c4){logger['error']('GetDynamics365Account',_0x3462c4['message'],_0x1d12d0);_0x2c9bcb(_0x389e6d['error'](0x1f4,_0x3462c4[_0x9b7f('0x15')]));});});};exports[_0x9b7f('0x21')]=function(_0x5a7cc8){var _0x2f9f54=this;return new Promise(function(_0x537dc2,_0x1a2c93){return db[_0x9b7f('0x19')]['find']({'raw':_0x5a7cc8['options']?_0x5a7cc8['options']['raw']===undefined?!![]:![]:!![],'where':_0x5a7cc8[_0x9b7f('0x1b')]?_0x5a7cc8[_0x9b7f('0x1b')][_0x9b7f('0x22')]||null:null,'attributes':_0x5a7cc8[_0x9b7f('0x1b')]?_0x5a7cc8['options'][_0x9b7f('0x1d')]||null:null,'include':_0x5a7cc8[_0x9b7f('0x1b')]?_0x5a7cc8['options']['include']?_[_0x9b7f('0x1f')](_0x5a7cc8['options'][_0x9b7f('0x1e')],function(_0x527894){return{'model':db[_0x527894[_0x9b7f('0x20')]],'as':_0x527894['as'],'attributes':_0x527894[_0x9b7f('0x1d')],'include':_0x527894[_0x9b7f('0x1e')]?_[_0x9b7f('0x1f')](_0x527894[_0x9b7f('0x1e')],function(_0x103d37){return{'model':db[_0x103d37['model']],'as':_0x103d37['as'],'attributes':_0x103d37[_0x9b7f('0x1d')],'include':_0x103d37[_0x9b7f('0x1e')]?_[_0x9b7f('0x1f')](_0x103d37['include'],function(_0x19b7e1){return{'model':db[_0x19b7e1['model']],'as':_0x19b7e1['as'],'attributes':_0x19b7e1[_0x9b7f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb724ab){logger[_0x9b7f('0xd')](_0x9b7f('0x21'),_0x5a7cc8);logger['debug'](_0x9b7f('0x21'),_0x5a7cc8,JSON['stringify'](_0xb724ab));_0x537dc2(_0xb724ab);})[_0x9b7f('0x17')](function(_0x4c9c87){logger[_0x9b7f('0x12')](_0x9b7f('0x21'),_0x4c9c87['message'],_0x5a7cc8);_0x1a2c93(_0x2f9f54['error'](0x1f4,_0x4c9c87[_0x9b7f('0x15')]));});});}; \ No newline at end of file +var _0x7cbf=['catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','map','model','attributes','info','ShowDynamics365Account','find','lodash','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0x23a6d5,_0x37e3d8){var _0x3de7e8=function(_0x2b6b91){while(--_0x2b6b91){_0x23a6d5['push'](_0x23a6d5['shift']());}};_0x3de7e8(++_0x37e3d8);}(_0x7cbf,0x1eb));var _0xf7cb=function(_0x1e2591,_0x106739){_0x1e2591=_0x1e2591-0x0;var _0x2b356c=_0x7cbf[_0x1e2591];return _0x2b356c;};'use strict';var _=require(_0xf7cb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf7cb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7cb('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7cb('0x3'))(_0xf7cb('0x4'));var config=require(_0xf7cb('0x5'));var jayson=require(_0xf7cb('0x6'));var client=jayson['client'][_0xf7cb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b20a2,_0xac237,_0x15335f){return new BPromise(function(_0x1d492c,_0xb764dc){return client[_0xf7cb('0x8')](_0x1b20a2,_0x15335f)[_0xf7cb('0x9')](function(_0x376583){logger['info'](_0xf7cb('0xa'),_0xac237,_0xf7cb('0xb'));logger[_0xf7cb('0xc')](_0xf7cb('0xd'),_0xac237,_0xf7cb('0xb'),JSON[_0xf7cb('0xe')](_0x376583));if(_0x376583['error']){if(_0x376583['error'][_0xf7cb('0xf')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0xac237,_0x376583[_0xf7cb('0x10')][_0xf7cb('0x11')]);return _0xb764dc(_0x376583[_0xf7cb('0x10')][_0xf7cb('0x11')]);}logger[_0xf7cb('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0xac237,_0x376583['error'][_0xf7cb('0x11')]);return _0x1d492c(_0x376583['error']['message']);}else{logger['info'](_0xf7cb('0xa'),_0xac237,_0xf7cb('0xb'));_0x1d492c(_0x376583[_0xf7cb('0x12')][_0xf7cb('0x11')]);}})[_0xf7cb('0x13')](function(_0x3a3687){logger[_0xf7cb('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0xac237,_0x3a3687);_0xb764dc(_0x3a3687);});});}exports[_0xf7cb('0x14')]=function(_0x7cf958){var _0x319647=this;return new Promise(function(_0x14a7da,_0x198bdc){return db[_0xf7cb('0x15')][_0xf7cb('0x16')]({'raw':_0x7cf958['options']?_0x7cf958[_0xf7cb('0x17')][_0xf7cb('0x18')]===undefined?!![]:![]:!![],'where':_0x7cf958[_0xf7cb('0x17')]?_0x7cf958[_0xf7cb('0x17')][_0xf7cb('0x19')]||null:null,'attributes':_0x7cf958['options']?_0x7cf958[_0xf7cb('0x17')]['attributes']||null:null,'limit':_0x7cf958[_0xf7cb('0x17')]?_0x7cf958['options'][_0xf7cb('0x1a')]||null:null,'include':_0x7cf958['options']?_0x7cf958[_0xf7cb('0x17')][_0xf7cb('0x1b')]?_[_0xf7cb('0x1c')](_0x7cf958[_0xf7cb('0x17')][_0xf7cb('0x1b')],function(_0x4288af){return{'model':db[_0x4288af[_0xf7cb('0x1d')]],'as':_0x4288af['as'],'attributes':_0x4288af[_0xf7cb('0x1e')],'include':_0x4288af['include']?_[_0xf7cb('0x1c')](_0x4288af[_0xf7cb('0x1b')],function(_0x296f94){return{'model':db[_0x296f94['model']],'as':_0x296f94['as'],'attributes':_0x296f94[_0xf7cb('0x1e')],'include':_0x296f94['include']?_[_0xf7cb('0x1c')](_0x296f94[_0xf7cb('0x1b')],function(_0x12bd74){return{'model':db[_0x12bd74[_0xf7cb('0x1d')]],'as':_0x12bd74['as'],'attributes':_0x12bd74[_0xf7cb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf7cb('0x9')](function(_0x4262d0){logger[_0xf7cb('0x1f')](_0xf7cb('0x14'),_0x7cf958);logger[_0xf7cb('0xc')](_0xf7cb('0x14'),_0x7cf958,JSON['stringify'](_0x4262d0));_0x14a7da(_0x4262d0);})[_0xf7cb('0x13')](function(_0x358e17){logger[_0xf7cb('0x10')](_0xf7cb('0x14'),_0x358e17[_0xf7cb('0x11')],_0x7cf958);_0x198bdc(_0x319647['error'](0x1f4,_0x358e17['message']));});});};exports[_0xf7cb('0x20')]=function(_0x201e80){var _0x491724=this;return new Promise(function(_0x11d3b,_0xf318ee){return db[_0xf7cb('0x15')][_0xf7cb('0x21')]({'raw':_0x201e80[_0xf7cb('0x17')]?_0x201e80['options']['raw']===undefined?!![]:![]:!![],'where':_0x201e80['options']?_0x201e80['options'][_0xf7cb('0x19')]||null:null,'attributes':_0x201e80[_0xf7cb('0x17')]?_0x201e80[_0xf7cb('0x17')]['attributes']||null:null,'include':_0x201e80[_0xf7cb('0x17')]?_0x201e80[_0xf7cb('0x17')][_0xf7cb('0x1b')]?_[_0xf7cb('0x1c')](_0x201e80['options'][_0xf7cb('0x1b')],function(_0x4b50ab){return{'model':db[_0x4b50ab[_0xf7cb('0x1d')]],'as':_0x4b50ab['as'],'attributes':_0x4b50ab[_0xf7cb('0x1e')],'include':_0x4b50ab[_0xf7cb('0x1b')]?_['map'](_0x4b50ab[_0xf7cb('0x1b')],function(_0x40d3ce){return{'model':db[_0x40d3ce[_0xf7cb('0x1d')]],'as':_0x40d3ce['as'],'attributes':_0x40d3ce['attributes'],'include':_0x40d3ce[_0xf7cb('0x1b')]?_['map'](_0x40d3ce[_0xf7cb('0x1b')],function(_0xa17934){return{'model':db[_0xa17934[_0xf7cb('0x1d')]],'as':_0xa17934['as'],'attributes':_0xa17934['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x233a23){logger['info']('ShowDynamics365Account',_0x201e80);logger[_0xf7cb('0xc')](_0xf7cb('0x20'),_0x201e80,JSON['stringify'](_0x233a23));_0x11d3b(_0x233a23);})[_0xf7cb('0x13')](function(_0x568b43){logger[_0xf7cb('0x10')]('ShowDynamics365Account',_0x568b43[_0xf7cb('0x11')],_0x201e80);_0xf318ee(_0x491724['error'](0x1f4,_0x568b43['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 835e2fb..3945b20 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 _0x3bf2=['getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x3555f0,_0x5381be){var _0x13f48d=function(_0x2ff449){while(--_0x2ff449){_0x3555f0['push'](_0x3555f0['shift']());}};_0x13f48d(++_0x5381be);}(_0x3bf2,0x169));var _0x23bf=function(_0x40d8fc,_0x7f3dd7){_0x40d8fc=_0x40d8fc-0x0;var _0x55971c=_0x3bf2[_0x40d8fc];return _0x55971c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x23bf('0x0'));var timeout=require('connect-timeout');var express=require(_0x23bf('0x1'));var router=express[_0x23bf('0x2')]();var fs_extra=require(_0x23bf('0x3'));var auth=require(_0x23bf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x23bf('0x5'));var controller=require(_0x23bf('0x6'));router[_0x23bf('0x7')]('/',auth[_0x23bf('0x8')](),controller[_0x23bf('0x9')]);router[_0x23bf('0x7')](_0x23bf('0xa'),auth[_0x23bf('0x8')](),controller[_0x23bf('0xb')]);router['get'](_0x23bf('0xc'),auth[_0x23bf('0x8')](),controller[_0x23bf('0xd')]);router['get'](_0x23bf('0xe'),auth[_0x23bf('0x8')](),controller[_0x23bf('0xf')]);router[_0x23bf('0x7')](_0x23bf('0x10'),auth[_0x23bf('0x8')](),controller['getDescriptions']);router[_0x23bf('0x11')]('/',auth[_0x23bf('0x8')](),controller[_0x23bf('0x12')]);router['put'](_0x23bf('0xa'),auth[_0x23bf('0x8')](),controller['update']);router[_0x23bf('0x13')](_0x23bf('0xa'),auth[_0x23bf('0x8')](),controller[_0x23bf('0x14')]);module[_0x23bf('0x15')]=router; \ No newline at end of file +var _0xe2cf=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','/:id','/:id/fields','isAuthenticated','/:id/subjects','/:id/descriptions','getDescriptions','post','create','delete','destroy','exports','util'];(function(_0x5b13fa,_0x142b38){var _0x58a133=function(_0x1a7f6f){while(--_0x1a7f6f){_0x5b13fa['push'](_0x5b13fa['shift']());}};_0x58a133(++_0x142b38);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x4fc4e7,_0x16bfc4){_0x4fc4e7=_0x4fc4e7-0x0;var _0x297133=_0xe2cf[_0x4fc4e7];return _0x297133;};'use strict';var multer=require('multer');var util=require(_0xfe2c('0x0'));var path=require('path');var timeout=require(_0xfe2c('0x1'));var express=require('express');var router=express[_0xfe2c('0x2')]();var fs_extra=require(_0xfe2c('0x3'));var auth=require(_0xfe2c('0x4'));var interaction=require(_0xfe2c('0x5'));var config=require('../../config/environment');var controller=require(_0xfe2c('0x6'));router[_0xfe2c('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfe2c('0x7')](_0xfe2c('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xfe2c('0x7')](_0xfe2c('0x9'),auth[_0xfe2c('0xa')](),controller['getFields']);router['get'](_0xfe2c('0xb'),auth[_0xfe2c('0xa')](),controller['getSubjects']);router[_0xfe2c('0x7')](_0xfe2c('0xc'),auth[_0xfe2c('0xa')](),controller[_0xfe2c('0xd')]);router[_0xfe2c('0xe')]('/',auth[_0xfe2c('0xa')](),controller[_0xfe2c('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfe2c('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xfe2c('0x11')]);module[_0xfe2c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 2e3f304..eb47670 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 _0xba90=['ENUM','incident','phonecall','contact','nothing','exports','STRING'];(function(_0x387d85,_0x26ee61){var _0x121932=function(_0xafa95f){while(--_0xafa95f){_0x387d85['push'](_0x387d85['shift']());}};_0x121932(++_0x26ee61);}(_0xba90,0xa6));var _0x0ba9=function(_0x5e9f33,_0x189253){_0x5e9f33=_0x5e9f33-0x0;var _0x19d8a8=_0xba90[_0x5e9f33];return _0x19d8a8;};'use strict';var Sequelize=require('sequelize');module[_0x0ba9('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0ba9('0x1')]},'ticketType':{'type':Sequelize[_0x0ba9('0x2')](_0x0ba9('0x3'),_0x0ba9('0x4')),'defaultValue':_0x0ba9('0x3')},'moduleCreate':{'type':Sequelize[_0x0ba9('0x2')](_0x0ba9('0x5'),_0x0ba9('0x6')),'defaultValue':'contact','allowNull':![]}}; \ No newline at end of file +var _0xeedb=['ENUM','incident','phonecall','contact','nothing','STRING'];(function(_0x11935e,_0x14d477){var _0x3fc496=function(_0x1a0236){while(--_0x1a0236){_0x11935e['push'](_0x11935e['shift']());}};_0x3fc496(++_0x14d477);}(_0xeedb,0x8f));var _0xbeed=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xeedb[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbeed('0x0')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xbeed('0x1')](_0xbeed('0x2'),_0xbeed('0x3')),'defaultValue':_0xbeed('0x2')},'moduleCreate':{'type':Sequelize[_0xbeed('0x1')](_0xbeed('0x4'),_0xbeed('0x5')),'defaultValue':_0xbeed('0x4'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 88fe2b0..77e3377 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 _0x0011=['to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','apply','reject','save','then','sendStatus','stack','name','send','map','Dynamics365Configuration','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','update','destroy','findOne','Dynamics365Field','pick','getFields','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2ee8ae,_0x1393e9){var _0x5e9faf=function(_0x40eb1d){while(--_0x40eb1d){_0x2ee8ae['push'](_0x2ee8ae['shift']());}};_0x5e9faf(++_0x1393e9);}(_0x0011,0x8f));var _0x1001=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x0011[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1001('0x0'));var zipdir=require(_0x1001('0x1'));var jsonpatch=require(_0x1001('0x2'));var rp=require(_0x1001('0x3'));var moment=require(_0x1001('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1001('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1001('0x6'));var fs=require('fs');var fs_extra=require(_0x1001('0x7'));var _=require(_0x1001('0x8'));var squel=require(_0x1001('0x9'));var crypto=require(_0x1001('0xa'));var jsforce=require(_0x1001('0xb'));var deskjs=require(_0x1001('0xc'));var toCsv=require(_0x1001('0xd'));var querystring=require('querystring');var Papa=require(_0x1001('0xe'));var Redis=require('ioredis');var authService=require(_0x1001('0xf'));var qs=require(_0x1001('0x10'));var as=require(_0x1001('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1001('0x12'))(_0x1001('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1001('0x14'));var db=require(_0x1001('0x15'))['db'];function respondWithStatusCode(_0x56b732,_0x2c5d95){_0x2c5d95=_0x2c5d95||0xcc;return function(_0x55e719){if(_0x55e719){return _0x56b732['sendStatus'](_0x2c5d95);}return _0x56b732[_0x1001('0x16')](_0x2c5d95)[_0x1001('0x17')]();};}function respondWithResult(_0x410f40,_0x3b3364){_0x3b3364=_0x3b3364||0xc8;return function(_0x12c352){if(_0x12c352){return _0x410f40[_0x1001('0x16')](_0x3b3364)[_0x1001('0x18')](_0x12c352);}};}function respondWithFilteredResult(_0x1a26e8,_0x407718){return function(_0x278a77){if(_0x278a77){var _0x5ddfcc=typeof _0x407718['offset']===_0x1001('0x19')&&typeof _0x407718['limit']===_0x1001('0x19');var _0x338086=_0x278a77[_0x1001('0x1a')];var _0xfad4ec=_0x5ddfcc?0x0:_0x407718['offset'];var _0x2f9a7e=_0x5ddfcc?_0x278a77[_0x1001('0x1a')]:_0x407718[_0x1001('0x1b')]+_0x407718[_0x1001('0x1c')];var _0x3c0f65;if(_0x2f9a7e>=_0x338086){_0x2f9a7e=_0x338086;_0x3c0f65=0xc8;}else{_0x3c0f65=0xce;}_0x1a26e8['status'](_0x3c0f65);return _0x1a26e8[_0x1001('0x1d')]('Content-Range',_0xfad4ec+'-'+_0x2f9a7e+'/'+_0x338086)['json'](_0x278a77);}return null;};}function patchUpdates(_0x6cd39f){return function(_0x5c6d99){try{jsonpatch[_0x1001('0x1e')](_0x5c6d99,_0x6cd39f,!![]);}catch(_0x149d50){return BPromise[_0x1001('0x1f')](_0x149d50);}return _0x5c6d99[_0x1001('0x20')]();};}function saveUpdates(_0x54730a,_0x4ac2e9){return function(_0x59fd33){if(_0x59fd33){return _0x59fd33['update'](_0x54730a)['then'](function(_0x4096c4){return _0x4096c4;});}return null;};}function removeEntity(_0x391ffc,_0x539a71){return function(_0x562fb2){if(_0x562fb2){return _0x562fb2['destroy']()[_0x1001('0x21')](function(){_0x391ffc[_0x1001('0x16')](0xcc)[_0x1001('0x17')]();});}};}function handleEntityNotFound(_0x4f79dc,_0x44c24d){return function(_0x4635d5){if(!_0x4635d5){_0x4f79dc[_0x1001('0x22')](0x194);}return _0x4635d5;};}function handleError(_0xec7643,_0x4f4ae0){_0x4f4ae0=_0x4f4ae0||0x1f4;return function(_0x361f89){logger['error'](_0x361f89[_0x1001('0x23')]);if(_0x361f89[_0x1001('0x24')]){delete _0x361f89[_0x1001('0x24')];}_0xec7643[_0x1001('0x16')](_0x4f4ae0)[_0x1001('0x25')](_0x361f89);};}exports['index']=function(_0x271ecc,_0x1f8a0a){var _0x396882={},_0x16a901={},_0x245969={'count':0x0,'rows':[]};var _0x2fe579=_[_0x1001('0x26')](db[_0x1001('0x27')]['rawAttributes'],function(_0x4b239b){return{'name':_0x4b239b[_0x1001('0x28')],'type':_0x4b239b[_0x1001('0x29')][_0x1001('0x2a')]};});_0x16a901['model']=_[_0x1001('0x26')](_0x2fe579,_0x1001('0x24'));_0x16a901[_0x1001('0x2b')]=_[_0x1001('0x2c')](_0x271ecc[_0x1001('0x2b')]);_0x16a901[_0x1001('0x2d')]=_[_0x1001('0x2e')](_0x16a901[_0x1001('0x2f')],_0x16a901[_0x1001('0x2b')]);_0x396882[_0x1001('0x30')]=_['intersection'](_0x16a901[_0x1001('0x2f')],qs[_0x1001('0x31')](_0x271ecc[_0x1001('0x2b')][_0x1001('0x31')]));_0x396882[_0x1001('0x30')]=_0x396882['attributes'][_0x1001('0x32')]?_0x396882[_0x1001('0x30')]:_0x16a901[_0x1001('0x2f')];if(!_0x271ecc['query']['hasOwnProperty'](_0x1001('0x33'))){_0x396882[_0x1001('0x1c')]=qs['limit'](_0x271ecc[_0x1001('0x2b')][_0x1001('0x1c')]);_0x396882[_0x1001('0x1b')]=qs['offset'](_0x271ecc[_0x1001('0x2b')][_0x1001('0x1b')]);}_0x396882[_0x1001('0x34')]=qs[_0x1001('0x35')](_0x271ecc[_0x1001('0x2b')]['sort']);_0x396882['where']=qs['filters'](_['pick'](_0x271ecc[_0x1001('0x2b')],_0x16a901[_0x1001('0x2d')]),_0x2fe579);if(_0x271ecc[_0x1001('0x2b')][_0x1001('0x36')]){_0x396882[_0x1001('0x37')]=_[_0x1001('0x38')](_0x396882[_0x1001('0x37')],{'$or':_['map'](_0x2fe579,function(_0x5c48de){if(_0x5c48de['type']!==_0x1001('0x39')){var _0xe6c1e5={};_0xe6c1e5[_0x5c48de['name']]={'$like':'%'+_0x271ecc[_0x1001('0x2b')][_0x1001('0x36')]+'%'};return _0xe6c1e5;}})});}_0x396882=_[_0x1001('0x38')]({},_0x396882,_0x271ecc[_0x1001('0x3a')]);var _0x2a4b0={'where':_0x396882[_0x1001('0x37')]};return db['Dynamics365Configuration']['count'](_0x2a4b0)['then'](function(_0x51c1b4){_0x245969[_0x1001('0x1a')]=_0x51c1b4;if(_0x271ecc[_0x1001('0x2b')][_0x1001('0x3b')]){_0x396882[_0x1001('0x3c')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x1001('0x3d')](_0x396882);})[_0x1001('0x21')](function(_0x575ce9){_0x245969[_0x1001('0x3e')]=_0x575ce9;return _0x245969;})[_0x1001('0x21')](respondWithFilteredResult(_0x1f8a0a,_0x396882))[_0x1001('0x3f')](handleError(_0x1f8a0a,null));};exports['show']=function(_0x4adac8,_0xf0cfb0){var _0x16e1d2={'raw':![],'where':{'id':_0x4adac8[_0x1001('0x40')]['id']}},_0x2dadde={};_0x2dadde[_0x1001('0x2f')]=_[_0x1001('0x2c')](db[_0x1001('0x27')][_0x1001('0x41')]);_0x2dadde['query']=_[_0x1001('0x2c')](_0x4adac8[_0x1001('0x2b')]);_0x2dadde[_0x1001('0x2d')]=_[_0x1001('0x2e')](_0x2dadde[_0x1001('0x2f')],_0x2dadde[_0x1001('0x2b')]);_0x16e1d2[_0x1001('0x30')]=_[_0x1001('0x2e')](_0x2dadde[_0x1001('0x2f')],qs[_0x1001('0x31')](_0x4adac8['query'][_0x1001('0x31')]));_0x16e1d2[_0x1001('0x30')]=_0x16e1d2[_0x1001('0x30')]['length']?_0x16e1d2['attributes']:_0x2dadde[_0x1001('0x2f')];if(_0x4adac8[_0x1001('0x2b')]['includeAll']){_0x16e1d2[_0x1001('0x3c')]=[{'all':!![]}];}_0x16e1d2=_[_0x1001('0x38')]({},_0x16e1d2,_0x4adac8['options']);return db[_0x1001('0x27')][_0x1001('0x42')](_0x16e1d2)[_0x1001('0x21')](handleEntityNotFound(_0xf0cfb0,null))['then'](respondWithResult(_0xf0cfb0,null))['catch'](handleError(_0xf0cfb0,null));};exports[_0x1001('0x43')]=function(_0x18d00b,_0x41b836){return db[_0x1001('0x27')][_0x1001('0x43')](_0x18d00b[_0x1001('0x44')],{})['then'](respondWithResult(_0x41b836,0xc9))[_0x1001('0x3f')](handleError(_0x41b836,null));};exports[_0x1001('0x45')]=function(_0xe65eae,_0x402623){if(_0xe65eae['body']['id']){delete _0xe65eae[_0x1001('0x44')]['id'];}return db[_0x1001('0x27')]['find']({'where':{'id':_0xe65eae[_0x1001('0x40')]['id']}})[_0x1001('0x21')](handleEntityNotFound(_0x402623,null))[_0x1001('0x21')](saveUpdates(_0xe65eae[_0x1001('0x44')],null))['then'](respondWithResult(_0x402623,null))['catch'](handleError(_0x402623,null));};exports[_0x1001('0x46')]=function(_0x1a8664,_0xac589d){return db[_0x1001('0x27')][_0x1001('0x42')]({'where':{'id':_0x1a8664['params']['id']}})[_0x1001('0x21')](handleEntityNotFound(_0xac589d,null))[_0x1001('0x21')](removeEntity(_0xac589d,null))[_0x1001('0x3f')](handleError(_0xac589d,null));};exports['getFields']=function(_0x50bace,_0x1681de,_0x4d925c){var _0x14156a={};var _0x4da8fa={};var _0x43a593;var _0x248fd4;return db[_0x1001('0x27')][_0x1001('0x47')]({'where':{'id':_0x50bace[_0x1001('0x40')]['id']}})[_0x1001('0x21')](handleEntityNotFound(_0x1681de,null))['then'](function(_0xbe96e7){if(_0xbe96e7){_0x43a593=_0xbe96e7;_0x4da8fa[_0x1001('0x2f')]=_[_0x1001('0x2c')](db[_0x1001('0x48')][_0x1001('0x41')]);_0x4da8fa['query']=_[_0x1001('0x2c')](_0x50bace[_0x1001('0x2b')]);_0x4da8fa[_0x1001('0x2d')]=_['intersection'](_0x4da8fa['model'],_0x4da8fa[_0x1001('0x2b')]);_0x14156a[_0x1001('0x30')]=_[_0x1001('0x2e')](_0x4da8fa[_0x1001('0x2f')],qs[_0x1001('0x31')](_0x50bace['query']['fields']));_0x14156a['attributes']=_0x14156a[_0x1001('0x30')][_0x1001('0x32')]?_0x14156a[_0x1001('0x30')]:_0x4da8fa[_0x1001('0x2f')];_0x14156a[_0x1001('0x34')]=qs[_0x1001('0x35')](_0x50bace['query'][_0x1001('0x35')]);_0x14156a[_0x1001('0x37')]=qs[_0x1001('0x2d')](_[_0x1001('0x49')](_0x50bace['query'],_0x4da8fa['filters']));if(_0x50bace[_0x1001('0x2b')][_0x1001('0x36')]){_0x14156a[_0x1001('0x37')]=_['merge'](_0x14156a[_0x1001('0x37')],{'$or':_[_0x1001('0x26')](_0x14156a[_0x1001('0x30')],function(_0x275895){var _0x2d5758={};_0x2d5758[_0x275895]={'$like':'%'+_0x50bace[_0x1001('0x2b')][_0x1001('0x36')]+'%'};return _0x2d5758;})});}_0x14156a=_['merge']({},_0x14156a,_0x50bace[_0x1001('0x3a')]);return _0x43a593[_0x1001('0x4a')](_0x14156a);}})['then'](function(_0x4b213c){if(_0x4b213c){_0x248fd4=_0x4b213c[_0x1001('0x32')];if(!_0x50bace['query'][_0x1001('0x4b')](_0x1001('0x33'))){_0x14156a[_0x1001('0x1c')]=qs[_0x1001('0x1c')](_0x50bace[_0x1001('0x2b')][_0x1001('0x1c')]);_0x14156a['offset']=qs['offset'](_0x50bace[_0x1001('0x2b')][_0x1001('0x1b')]);}return _0x43a593[_0x1001('0x4a')](_0x14156a);}})[_0x1001('0x21')](function(_0x584fd0){if(_0x584fd0){return _0x584fd0?{'count':_0x248fd4,'rows':_0x584fd0}:null;}})['then'](respondWithResult(_0x1681de,null))[_0x1001('0x3f')](handleError(_0x1681de,null));};exports[_0x1001('0x4c')]=function(_0x36e715,_0x2bf97f,_0xaa4c5a){var _0x345e08={};var _0x3a38c1={};var _0x1d05e3;var _0x35304d;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x36e715['params']['id']}})[_0x1001('0x21')](handleEntityNotFound(_0x2bf97f,null))[_0x1001('0x21')](function(_0x8aeb6d){if(_0x8aeb6d){_0x1d05e3=_0x8aeb6d;_0x3a38c1['model']=_[_0x1001('0x2c')](db[_0x1001('0x48')]['rawAttributes']);_0x3a38c1[_0x1001('0x2b')]=_[_0x1001('0x2c')](_0x36e715['query']);_0x3a38c1[_0x1001('0x2d')]=_[_0x1001('0x2e')](_0x3a38c1[_0x1001('0x2f')],_0x3a38c1[_0x1001('0x2b')]);_0x345e08['attributes']=_[_0x1001('0x2e')](_0x3a38c1[_0x1001('0x2f')],qs[_0x1001('0x31')](_0x36e715[_0x1001('0x2b')]['fields']));_0x345e08[_0x1001('0x30')]=_0x345e08['attributes'][_0x1001('0x32')]?_0x345e08[_0x1001('0x30')]:_0x3a38c1['model'];_0x345e08['order']=qs[_0x1001('0x35')](_0x36e715[_0x1001('0x2b')][_0x1001('0x35')]);_0x345e08[_0x1001('0x37')]=qs[_0x1001('0x2d')](_[_0x1001('0x49')](_0x36e715[_0x1001('0x2b')],_0x3a38c1[_0x1001('0x2d')]));if(_0x36e715[_0x1001('0x2b')][_0x1001('0x36')]){_0x345e08[_0x1001('0x37')]=_[_0x1001('0x38')](_0x345e08['where'],{'$or':_[_0x1001('0x26')](_0x345e08['attributes'],function(_0x1db8f8){var _0x31c949={};_0x31c949[_0x1db8f8]={'$like':'%'+_0x36e715['query'][_0x1001('0x36')]+'%'};return _0x31c949;})});}_0x345e08=_[_0x1001('0x38')]({},_0x345e08,_0x36e715['options']);return _0x1d05e3[_0x1001('0x4c')](_0x345e08);}})['then'](function(_0x665170){if(_0x665170){_0x35304d=_0x665170[_0x1001('0x32')];if(!_0x36e715[_0x1001('0x2b')]['hasOwnProperty']('nolimit')){_0x345e08['limit']=qs['limit'](_0x36e715[_0x1001('0x2b')][_0x1001('0x1c')]);_0x345e08[_0x1001('0x1b')]=qs['offset'](_0x36e715[_0x1001('0x2b')][_0x1001('0x1b')]);}return _0x1d05e3['getSubjects'](_0x345e08);}})[_0x1001('0x21')](function(_0x36c69c){if(_0x36c69c){return _0x36c69c?{'count':_0x35304d,'rows':_0x36c69c}:null;}})[_0x1001('0x21')](respondWithResult(_0x2bf97f,null))[_0x1001('0x3f')](handleError(_0x2bf97f,null));};exports[_0x1001('0x4d')]=function(_0x2f98db,_0x4978bd,_0x22e55c){var _0x5f283c={};var _0x2dcda1={};var _0x37d343;var _0x248bf4;return db[_0x1001('0x27')][_0x1001('0x47')]({'where':{'id':_0x2f98db['params']['id']}})[_0x1001('0x21')](handleEntityNotFound(_0x4978bd,null))['then'](function(_0x5f00b5){if(_0x5f00b5){_0x37d343=_0x5f00b5;_0x2dcda1[_0x1001('0x2f')]=_['keys'](db['Dynamics365Field'][_0x1001('0x41')]);_0x2dcda1[_0x1001('0x2b')]=_[_0x1001('0x2c')](_0x2f98db[_0x1001('0x2b')]);_0x2dcda1['filters']=_[_0x1001('0x2e')](_0x2dcda1[_0x1001('0x2f')],_0x2dcda1[_0x1001('0x2b')]);_0x5f283c[_0x1001('0x30')]=_[_0x1001('0x2e')](_0x2dcda1['model'],qs[_0x1001('0x31')](_0x2f98db[_0x1001('0x2b')][_0x1001('0x31')]));_0x5f283c[_0x1001('0x30')]=_0x5f283c[_0x1001('0x30')][_0x1001('0x32')]?_0x5f283c[_0x1001('0x30')]:_0x2dcda1[_0x1001('0x2f')];_0x5f283c[_0x1001('0x34')]=qs[_0x1001('0x35')](_0x2f98db['query'][_0x1001('0x35')]);_0x5f283c[_0x1001('0x37')]=qs['filters'](_[_0x1001('0x49')](_0x2f98db[_0x1001('0x2b')],_0x2dcda1[_0x1001('0x2d')]));if(_0x2f98db[_0x1001('0x2b')][_0x1001('0x36')]){_0x5f283c[_0x1001('0x37')]=_['merge'](_0x5f283c[_0x1001('0x37')],{'$or':_['map'](_0x5f283c[_0x1001('0x30')],function(_0x348ce1){var _0x5dfa57={};_0x5dfa57[_0x348ce1]={'$like':'%'+_0x2f98db[_0x1001('0x2b')][_0x1001('0x36')]+'%'};return _0x5dfa57;})});}_0x5f283c=_['merge']({},_0x5f283c,_0x2f98db['options']);return _0x37d343[_0x1001('0x4d')](_0x5f283c);}})[_0x1001('0x21')](function(_0x5caa79){if(_0x5caa79){_0x248bf4=_0x5caa79[_0x1001('0x32')];if(!_0x2f98db[_0x1001('0x2b')]['hasOwnProperty'](_0x1001('0x33'))){_0x5f283c[_0x1001('0x1c')]=qs[_0x1001('0x1c')](_0x2f98db[_0x1001('0x2b')][_0x1001('0x1c')]);_0x5f283c[_0x1001('0x1b')]=qs[_0x1001('0x1b')](_0x2f98db[_0x1001('0x2b')]['offset']);}return _0x37d343[_0x1001('0x4d')](_0x5f283c);}})[_0x1001('0x21')](function(_0x189bef){if(_0x189bef){return _0x189bef?{'count':_0x248bf4,'rows':_0x189bef}:null;}})[_0x1001('0x21')](respondWithResult(_0x4978bd,null))[_0x1001('0x3f')](handleError(_0x4978bd,null));}; \ No newline at end of file +var _0xf2d9=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','params','fields','merge','body','find','findOne','Dynamics365Field','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf2d9,0x125));var _0x9f2d=function(_0x4a6298,_0x2e53fe){_0x4a6298=_0x4a6298-0x0;var _0x975f6e=_0xf2d9[_0x4a6298];return _0x975f6e;};'use strict';var emlformat=require(_0x9f2d('0x0'));var rimraf=require(_0x9f2d('0x1'));var zipdir=require(_0x9f2d('0x2'));var jsonpatch=require(_0x9f2d('0x3'));var rp=require('request-promise');var moment=require(_0x9f2d('0x4'));var BPromise=require(_0x9f2d('0x5'));var Mustache=require(_0x9f2d('0x6'));var util=require(_0x9f2d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9f2d('0x8'));var ejs=require(_0x9f2d('0x9'));var fs=require('fs');var fs_extra=require(_0x9f2d('0xa'));var _=require(_0x9f2d('0xb'));var squel=require(_0x9f2d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9f2d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9f2d('0xd'));var qs=require(_0x9f2d('0xe'));var as=require(_0x9f2d('0xf'));var hardwareService=require(_0x9f2d('0x10'));var logger=require(_0x9f2d('0x11'))(_0x9f2d('0x12'));var utils=require('../../config/utils');var config=require(_0x9f2d('0x13'));var licenseUtil=require(_0x9f2d('0x14'));var db=require(_0x9f2d('0x15'))['db'];function respondWithStatusCode(_0x5bfe93,_0x481719){_0x481719=_0x481719||0xcc;return function(_0x535709){if(_0x535709){return _0x5bfe93[_0x9f2d('0x16')](_0x481719);}return _0x5bfe93[_0x9f2d('0x17')](_0x481719)[_0x9f2d('0x18')]();};}function respondWithResult(_0x344f91,_0x329b49){_0x329b49=_0x329b49||0xc8;return function(_0x4fef61){if(_0x4fef61){return _0x344f91[_0x9f2d('0x17')](_0x329b49)[_0x9f2d('0x19')](_0x4fef61);}};}function respondWithFilteredResult(_0x5b9f16,_0x2e689d){return function(_0x560e0c){if(_0x560e0c){var _0x434ad6=typeof _0x2e689d[_0x9f2d('0x1a')]===_0x9f2d('0x1b')&&typeof _0x2e689d[_0x9f2d('0x1c')]===_0x9f2d('0x1b');var _0xc5b122=_0x560e0c['count'];var _0x55e908=_0x434ad6?0x0:_0x2e689d[_0x9f2d('0x1a')];var _0x3299be=_0x434ad6?_0x560e0c[_0x9f2d('0x1d')]:_0x2e689d[_0x9f2d('0x1a')]+_0x2e689d['limit'];var _0x1e8a58;if(_0x3299be>=_0xc5b122){_0x3299be=_0xc5b122;_0x1e8a58=0xc8;}else{_0x1e8a58=0xce;}_0x5b9f16[_0x9f2d('0x17')](_0x1e8a58);return _0x5b9f16[_0x9f2d('0x1e')](_0x9f2d('0x1f'),_0x55e908+'-'+_0x3299be+'/'+_0xc5b122)[_0x9f2d('0x19')](_0x560e0c);}return null;};}function patchUpdates(_0xa79578){return function(_0x25af62){try{jsonpatch[_0x9f2d('0x20')](_0x25af62,_0xa79578,!![]);}catch(_0x2e67e0){return BPromise[_0x9f2d('0x21')](_0x2e67e0);}return _0x25af62[_0x9f2d('0x22')]();};}function saveUpdates(_0x3cdc1a,_0xc02faf){return function(_0x1a3ad3){if(_0x1a3ad3){return _0x1a3ad3[_0x9f2d('0x23')](_0x3cdc1a)['then'](function(_0x383f68){return _0x383f68;});}return null;};}function removeEntity(_0x461a97,_0x7e34fe){return function(_0x44329){if(_0x44329){return _0x44329[_0x9f2d('0x24')]()[_0x9f2d('0x25')](function(){_0x461a97['status'](0xcc)[_0x9f2d('0x18')]();});}};}function handleEntityNotFound(_0x66a0a4,_0xa27f09){return function(_0x3b5098){if(!_0x3b5098){_0x66a0a4[_0x9f2d('0x16')](0x194);}return _0x3b5098;};}function handleError(_0x4e2505,_0x585b67){_0x585b67=_0x585b67||0x1f4;return function(_0xda309b){logger[_0x9f2d('0x26')](_0xda309b[_0x9f2d('0x27')]);if(_0xda309b[_0x9f2d('0x28')]){delete _0xda309b[_0x9f2d('0x28')];}_0x4e2505[_0x9f2d('0x17')](_0x585b67)['send'](_0xda309b);};}exports[_0x9f2d('0x29')]=function(_0x1aa075,_0x470e56){var _0x4616b1={},_0x423e72={},_0x4673f5={'count':0x0,'rows':[]};var _0x7ad17a=_[_0x9f2d('0x2a')](db['Dynamics365Configuration'][_0x9f2d('0x2b')],function(_0x424653){return{'name':_0x424653['fieldName'],'type':_0x424653['type'][_0x9f2d('0x2c')]};});_0x423e72[_0x9f2d('0x2d')]=_[_0x9f2d('0x2a')](_0x7ad17a,'name');_0x423e72[_0x9f2d('0x2e')]=_[_0x9f2d('0x2f')](_0x1aa075[_0x9f2d('0x2e')]);_0x423e72[_0x9f2d('0x30')]=_[_0x9f2d('0x31')](_0x423e72[_0x9f2d('0x2d')],_0x423e72[_0x9f2d('0x2e')]);_0x4616b1[_0x9f2d('0x32')]=_[_0x9f2d('0x31')](_0x423e72['model'],qs['fields'](_0x1aa075[_0x9f2d('0x2e')]['fields']));_0x4616b1[_0x9f2d('0x32')]=_0x4616b1[_0x9f2d('0x32')][_0x9f2d('0x33')]?_0x4616b1[_0x9f2d('0x32')]:_0x423e72['model'];if(!_0x1aa075[_0x9f2d('0x2e')][_0x9f2d('0x34')](_0x9f2d('0x35'))){_0x4616b1[_0x9f2d('0x1c')]=qs[_0x9f2d('0x1c')](_0x1aa075['query'][_0x9f2d('0x1c')]);_0x4616b1[_0x9f2d('0x1a')]=qs['offset'](_0x1aa075['query'][_0x9f2d('0x1a')]);}_0x4616b1[_0x9f2d('0x36')]=qs['sort'](_0x1aa075[_0x9f2d('0x2e')][_0x9f2d('0x37')]);_0x4616b1['where']=qs[_0x9f2d('0x30')](_[_0x9f2d('0x38')](_0x1aa075[_0x9f2d('0x2e')],_0x423e72[_0x9f2d('0x30')]),_0x7ad17a);if(_0x1aa075[_0x9f2d('0x2e')][_0x9f2d('0x39')]){_0x4616b1[_0x9f2d('0x3a')]=_['merge'](_0x4616b1[_0x9f2d('0x3a')],{'$or':_['map'](_0x7ad17a,function(_0x5d16aa){if(_0x5d16aa[_0x9f2d('0x3b')]!==_0x9f2d('0x3c')){var _0x52ce88={};_0x52ce88[_0x5d16aa[_0x9f2d('0x28')]]={'$like':'%'+_0x1aa075[_0x9f2d('0x2e')][_0x9f2d('0x39')]+'%'};return _0x52ce88;}})});}_0x4616b1=_['merge']({},_0x4616b1,_0x1aa075[_0x9f2d('0x3d')]);var _0x5a7e9e={'where':_0x4616b1[_0x9f2d('0x3a')]};return db[_0x9f2d('0x3e')][_0x9f2d('0x1d')](_0x5a7e9e)[_0x9f2d('0x25')](function(_0x53c9a3){_0x4673f5[_0x9f2d('0x1d')]=_0x53c9a3;if(_0x1aa075[_0x9f2d('0x2e')][_0x9f2d('0x3f')]){_0x4616b1[_0x9f2d('0x40')]=[{'all':!![]}];}return db[_0x9f2d('0x3e')][_0x9f2d('0x41')](_0x4616b1);})[_0x9f2d('0x25')](function(_0x543175){_0x4673f5[_0x9f2d('0x42')]=_0x543175;return _0x4673f5;})[_0x9f2d('0x25')](respondWithFilteredResult(_0x470e56,_0x4616b1))[_0x9f2d('0x43')](handleError(_0x470e56,null));};exports[_0x9f2d('0x44')]=function(_0x581597,_0x59d63b){var _0x57b3be={'raw':![],'where':{'id':_0x581597[_0x9f2d('0x45')]['id']}},_0x29d611={};_0x29d611['model']=_[_0x9f2d('0x2f')](db[_0x9f2d('0x3e')]['rawAttributes']);_0x29d611[_0x9f2d('0x2e')]=_[_0x9f2d('0x2f')](_0x581597[_0x9f2d('0x2e')]);_0x29d611[_0x9f2d('0x30')]=_[_0x9f2d('0x31')](_0x29d611[_0x9f2d('0x2d')],_0x29d611[_0x9f2d('0x2e')]);_0x57b3be[_0x9f2d('0x32')]=_['intersection'](_0x29d611[_0x9f2d('0x2d')],qs[_0x9f2d('0x46')](_0x581597[_0x9f2d('0x2e')][_0x9f2d('0x46')]));_0x57b3be[_0x9f2d('0x32')]=_0x57b3be[_0x9f2d('0x32')]['length']?_0x57b3be[_0x9f2d('0x32')]:_0x29d611[_0x9f2d('0x2d')];if(_0x581597[_0x9f2d('0x2e')]['includeAll']){_0x57b3be[_0x9f2d('0x40')]=[{'all':!![]}];}_0x57b3be=_[_0x9f2d('0x47')]({},_0x57b3be,_0x581597['options']);return db[_0x9f2d('0x3e')]['find'](_0x57b3be)[_0x9f2d('0x25')](handleEntityNotFound(_0x59d63b,null))[_0x9f2d('0x25')](respondWithResult(_0x59d63b,null))['catch'](handleError(_0x59d63b,null));};exports['create']=function(_0x34358f,_0x574116){return db[_0x9f2d('0x3e')]['create'](_0x34358f[_0x9f2d('0x48')],{})[_0x9f2d('0x25')](respondWithResult(_0x574116,0xc9))['catch'](handleError(_0x574116,null));};exports[_0x9f2d('0x23')]=function(_0x45e726,_0x35e86b){if(_0x45e726[_0x9f2d('0x48')]['id']){delete _0x45e726['body']['id'];}return db[_0x9f2d('0x3e')]['find']({'where':{'id':_0x45e726[_0x9f2d('0x45')]['id']}})[_0x9f2d('0x25')](handleEntityNotFound(_0x35e86b,null))[_0x9f2d('0x25')](saveUpdates(_0x45e726[_0x9f2d('0x48')],null))['then'](respondWithResult(_0x35e86b,null))[_0x9f2d('0x43')](handleError(_0x35e86b,null));};exports[_0x9f2d('0x24')]=function(_0xc2a3c5,_0x1514f6){return db['Dynamics365Configuration'][_0x9f2d('0x49')]({'where':{'id':_0xc2a3c5[_0x9f2d('0x45')]['id']}})[_0x9f2d('0x25')](handleEntityNotFound(_0x1514f6,null))['then'](removeEntity(_0x1514f6,null))[_0x9f2d('0x43')](handleError(_0x1514f6,null));};exports['getFields']=function(_0x204cd3,_0x2cafdc,_0x27feb3){var _0x2c55a3={};var _0x2cf44a={};var _0x1bd7ac;var _0x34997c;return db[_0x9f2d('0x3e')][_0x9f2d('0x4a')]({'where':{'id':_0x204cd3['params']['id']}})[_0x9f2d('0x25')](handleEntityNotFound(_0x2cafdc,null))[_0x9f2d('0x25')](function(_0x53744a){if(_0x53744a){_0x1bd7ac=_0x53744a;_0x2cf44a[_0x9f2d('0x2d')]=_[_0x9f2d('0x2f')](db[_0x9f2d('0x4b')][_0x9f2d('0x2b')]);_0x2cf44a[_0x9f2d('0x2e')]=_['keys'](_0x204cd3[_0x9f2d('0x2e')]);_0x2cf44a[_0x9f2d('0x30')]=_['intersection'](_0x2cf44a['model'],_0x2cf44a[_0x9f2d('0x2e')]);_0x2c55a3[_0x9f2d('0x32')]=_[_0x9f2d('0x31')](_0x2cf44a['model'],qs[_0x9f2d('0x46')](_0x204cd3[_0x9f2d('0x2e')]['fields']));_0x2c55a3[_0x9f2d('0x32')]=_0x2c55a3[_0x9f2d('0x32')][_0x9f2d('0x33')]?_0x2c55a3[_0x9f2d('0x32')]:_0x2cf44a[_0x9f2d('0x2d')];_0x2c55a3[_0x9f2d('0x36')]=qs['sort'](_0x204cd3[_0x9f2d('0x2e')]['sort']);_0x2c55a3['where']=qs[_0x9f2d('0x30')](_[_0x9f2d('0x38')](_0x204cd3[_0x9f2d('0x2e')],_0x2cf44a[_0x9f2d('0x30')]));if(_0x204cd3[_0x9f2d('0x2e')][_0x9f2d('0x39')]){_0x2c55a3[_0x9f2d('0x3a')]=_[_0x9f2d('0x47')](_0x2c55a3[_0x9f2d('0x3a')],{'$or':_['map'](_0x2c55a3[_0x9f2d('0x32')],function(_0x257e66){var _0x20b231={};_0x20b231[_0x257e66]={'$like':'%'+_0x204cd3[_0x9f2d('0x2e')][_0x9f2d('0x39')]+'%'};return _0x20b231;})});}_0x2c55a3=_['merge']({},_0x2c55a3,_0x204cd3['options']);return _0x1bd7ac[_0x9f2d('0x4c')](_0x2c55a3);}})[_0x9f2d('0x25')](function(_0x58b53a){if(_0x58b53a){_0x34997c=_0x58b53a[_0x9f2d('0x33')];if(!_0x204cd3[_0x9f2d('0x2e')][_0x9f2d('0x34')](_0x9f2d('0x35'))){_0x2c55a3[_0x9f2d('0x1c')]=qs[_0x9f2d('0x1c')](_0x204cd3['query'][_0x9f2d('0x1c')]);_0x2c55a3['offset']=qs[_0x9f2d('0x1a')](_0x204cd3[_0x9f2d('0x2e')][_0x9f2d('0x1a')]);}return _0x1bd7ac['getFields'](_0x2c55a3);}})[_0x9f2d('0x25')](function(_0x54d0cc){if(_0x54d0cc){return _0x54d0cc?{'count':_0x34997c,'rows':_0x54d0cc}:null;}})[_0x9f2d('0x25')](respondWithResult(_0x2cafdc,null))[_0x9f2d('0x43')](handleError(_0x2cafdc,null));};exports['getSubjects']=function(_0x2e08ca,_0x130dad,_0x322fc0){var _0x30d7e4={};var _0x394b58={};var _0x1db89c;var _0x508062;return db[_0x9f2d('0x3e')][_0x9f2d('0x4a')]({'where':{'id':_0x2e08ca[_0x9f2d('0x45')]['id']}})[_0x9f2d('0x25')](handleEntityNotFound(_0x130dad,null))[_0x9f2d('0x25')](function(_0x19e1f4){if(_0x19e1f4){_0x1db89c=_0x19e1f4;_0x394b58['model']=_[_0x9f2d('0x2f')](db[_0x9f2d('0x4b')][_0x9f2d('0x2b')]);_0x394b58[_0x9f2d('0x2e')]=_[_0x9f2d('0x2f')](_0x2e08ca['query']);_0x394b58[_0x9f2d('0x30')]=_['intersection'](_0x394b58[_0x9f2d('0x2d')],_0x394b58['query']);_0x30d7e4[_0x9f2d('0x32')]=_[_0x9f2d('0x31')](_0x394b58[_0x9f2d('0x2d')],qs[_0x9f2d('0x46')](_0x2e08ca[_0x9f2d('0x2e')][_0x9f2d('0x46')]));_0x30d7e4[_0x9f2d('0x32')]=_0x30d7e4[_0x9f2d('0x32')][_0x9f2d('0x33')]?_0x30d7e4[_0x9f2d('0x32')]:_0x394b58[_0x9f2d('0x2d')];_0x30d7e4['order']=qs[_0x9f2d('0x37')](_0x2e08ca[_0x9f2d('0x2e')][_0x9f2d('0x37')]);_0x30d7e4[_0x9f2d('0x3a')]=qs[_0x9f2d('0x30')](_['pick'](_0x2e08ca[_0x9f2d('0x2e')],_0x394b58[_0x9f2d('0x30')]));if(_0x2e08ca[_0x9f2d('0x2e')]['filter']){_0x30d7e4['where']=_[_0x9f2d('0x47')](_0x30d7e4[_0x9f2d('0x3a')],{'$or':_['map'](_0x30d7e4['attributes'],function(_0x5592b2){var _0x4abf12={};_0x4abf12[_0x5592b2]={'$like':'%'+_0x2e08ca['query']['filter']+'%'};return _0x4abf12;})});}_0x30d7e4=_[_0x9f2d('0x47')]({},_0x30d7e4,_0x2e08ca['options']);return _0x1db89c['getSubjects'](_0x30d7e4);}})['then'](function(_0x37533f){if(_0x37533f){_0x508062=_0x37533f[_0x9f2d('0x33')];if(!_0x2e08ca[_0x9f2d('0x2e')][_0x9f2d('0x34')](_0x9f2d('0x35'))){_0x30d7e4[_0x9f2d('0x1c')]=qs[_0x9f2d('0x1c')](_0x2e08ca['query'][_0x9f2d('0x1c')]);_0x30d7e4['offset']=qs[_0x9f2d('0x1a')](_0x2e08ca[_0x9f2d('0x2e')][_0x9f2d('0x1a')]);}return _0x1db89c[_0x9f2d('0x4d')](_0x30d7e4);}})[_0x9f2d('0x25')](function(_0x2cec70){if(_0x2cec70){return _0x2cec70?{'count':_0x508062,'rows':_0x2cec70}:null;}})['then'](respondWithResult(_0x130dad,null))[_0x9f2d('0x43')](handleError(_0x130dad,null));};exports['getDescriptions']=function(_0x3cc7ab,_0x3b54b0,_0x130c30){var _0x1a5bb0={};var _0x3f331f={};var _0x3360e6;var _0x1bb993;return db['Dynamics365Configuration'][_0x9f2d('0x4a')]({'where':{'id':_0x3cc7ab[_0x9f2d('0x45')]['id']}})['then'](handleEntityNotFound(_0x3b54b0,null))['then'](function(_0x256788){if(_0x256788){_0x3360e6=_0x256788;_0x3f331f[_0x9f2d('0x2d')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x3f331f[_0x9f2d('0x2e')]=_[_0x9f2d('0x2f')](_0x3cc7ab[_0x9f2d('0x2e')]);_0x3f331f[_0x9f2d('0x30')]=_[_0x9f2d('0x31')](_0x3f331f[_0x9f2d('0x2d')],_0x3f331f[_0x9f2d('0x2e')]);_0x1a5bb0[_0x9f2d('0x32')]=_[_0x9f2d('0x31')](_0x3f331f['model'],qs[_0x9f2d('0x46')](_0x3cc7ab[_0x9f2d('0x2e')]['fields']));_0x1a5bb0[_0x9f2d('0x32')]=_0x1a5bb0[_0x9f2d('0x32')][_0x9f2d('0x33')]?_0x1a5bb0[_0x9f2d('0x32')]:_0x3f331f[_0x9f2d('0x2d')];_0x1a5bb0[_0x9f2d('0x36')]=qs['sort'](_0x3cc7ab[_0x9f2d('0x2e')][_0x9f2d('0x37')]);_0x1a5bb0[_0x9f2d('0x3a')]=qs[_0x9f2d('0x30')](_[_0x9f2d('0x38')](_0x3cc7ab['query'],_0x3f331f[_0x9f2d('0x30')]));if(_0x3cc7ab[_0x9f2d('0x2e')]['filter']){_0x1a5bb0['where']=_[_0x9f2d('0x47')](_0x1a5bb0['where'],{'$or':_[_0x9f2d('0x2a')](_0x1a5bb0['attributes'],function(_0xf52588){var _0x24ffbe={};_0x24ffbe[_0xf52588]={'$like':'%'+_0x3cc7ab[_0x9f2d('0x2e')]['filter']+'%'};return _0x24ffbe;})});}_0x1a5bb0=_[_0x9f2d('0x47')]({},_0x1a5bb0,_0x3cc7ab[_0x9f2d('0x3d')]);return _0x3360e6[_0x9f2d('0x4e')](_0x1a5bb0);}})['then'](function(_0x1df63e){if(_0x1df63e){_0x1bb993=_0x1df63e[_0x9f2d('0x33')];if(!_0x3cc7ab[_0x9f2d('0x2e')][_0x9f2d('0x34')]('nolimit')){_0x1a5bb0['limit']=qs[_0x9f2d('0x1c')](_0x3cc7ab[_0x9f2d('0x2e')][_0x9f2d('0x1c')]);_0x1a5bb0['offset']=qs['offset'](_0x3cc7ab[_0x9f2d('0x2e')][_0x9f2d('0x1a')]);}return _0x3360e6['getDescriptions'](_0x1a5bb0);}})[_0x9f2d('0x25')](function(_0x46f2ab){if(_0x46f2ab){return _0x46f2ab?{'count':_0x1bb993,'rows':_0x46f2ab}:null;}})[_0x9f2d('0x25')](respondWithResult(_0x3b54b0,null))[_0x9f2d('0x43')](handleError(_0x3b54b0,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index ba9eae7..7038e81 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 _0x55ca=['./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2a390b,_0xf49f9b){var _0x5df10a=function(_0x115dbe){while(--_0x115dbe){_0x2a390b['push'](_0x2a390b['shift']());}};_0x5df10a(++_0xf49f9b);}(_0x55ca,0x126));var _0xa55c=function(_0x3c5e8b,_0x17513d){_0x3c5e8b=_0x3c5e8b-0x0;var _0x1784b6=_0x55ca[_0x3c5e8b];return _0x1784b6;};'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')]('Dynamics365Configuration',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5b3=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x644560,_0x1783aa){var _0x41b76b=function(_0xff8c89){while(--_0xff8c89){_0x644560['push'](_0x644560['shift']());}};_0x41b76b(++_0x1783aa);}(_0xe5b3,0x133));var _0x3e5b=function(_0x33643f,_0x5b32af){_0x33643f=_0x33643f-0x0;var _0x30a486=_0xe5b3[_0x33643f];return _0x30a486;};'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 diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index f68e842..b175660 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 _0xcd39=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','randomstring','ioredis'];(function(_0x2c7084,_0x4f2d58){var _0x2f5c76=function(_0x588668){while(--_0x588668){_0x2c7084['push'](_0x2c7084['shift']());}};_0x2f5c76(++_0x4f2d58);}(_0xcd39,0x15c));var _0x9cd3=function(_0x5a488c,_0x4cc470){_0x5a488c=_0x5a488c-0x0;var _0x53a7d6=_0xcd39[_0x5a488c];return _0x53a7d6;};'use strict';var _=require(_0x9cd3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9cd3('0x1'));var rs=require(_0x9cd3('0x2'));var fs=require('fs');var Redis=require(_0x9cd3('0x3'));var db=require(_0x9cd3('0x4'))['db'];var utils=require(_0x9cd3('0x5'));var logger=require(_0x9cd3('0x6'))(_0x9cd3('0x7'));var config=require(_0x9cd3('0x8'));var jayson=require(_0x9cd3('0x9'));var client=jayson[_0x9cd3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x244846,_0x214f92,_0x4da933){return new BPromise(function(_0x25bd62,_0x5afeb7){return client[_0x9cd3('0xb')](_0x244846,_0x4da933)[_0x9cd3('0xc')](function(_0x3d79c7){logger[_0x9cd3('0xd')](_0x9cd3('0xe'),_0x214f92,_0x9cd3('0xf'));logger[_0x9cd3('0x10')](_0x9cd3('0x11'),_0x214f92,_0x9cd3('0xf'),JSON[_0x9cd3('0x12')](_0x3d79c7));if(_0x3d79c7[_0x9cd3('0x13')]){if(_0x3d79c7[_0x9cd3('0x13')]['code']===0x1f4){logger[_0x9cd3('0x13')](_0x9cd3('0xe'),_0x214f92,_0x3d79c7['error'][_0x9cd3('0x14')]);return _0x5afeb7(_0x3d79c7[_0x9cd3('0x13')][_0x9cd3('0x14')]);}logger[_0x9cd3('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x214f92,_0x3d79c7[_0x9cd3('0x13')][_0x9cd3('0x14')]);return _0x25bd62(_0x3d79c7[_0x9cd3('0x13')][_0x9cd3('0x14')]);}else{logger['info'](_0x9cd3('0xe'),_0x214f92,_0x9cd3('0xf'));_0x25bd62(_0x3d79c7[_0x9cd3('0x15')]['message']);}})['catch'](function(_0x3a1af2){logger[_0x9cd3('0x13')](_0x9cd3('0xe'),_0x214f92,_0x3a1af2);_0x5afeb7(_0x3a1af2);});});} \ No newline at end of file +var _0x45e3=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','moment','bluebird'];(function(_0x4c24bc,_0x2e8d9){var _0x31cf05=function(_0x5de885){while(--_0x5de885){_0x4c24bc['push'](_0x4c24bc['shift']());}};_0x31cf05(++_0x2e8d9);}(_0x45e3,0x1b3));var _0x345e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x45e3[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x345e('0x0'));var BPromise=require(_0x345e('0x1'));var rs=require(_0x345e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x345e('0x3'))['db'];var utils=require(_0x345e('0x4'));var logger=require(_0x345e('0x5'))(_0x345e('0x6'));var config=require(_0x345e('0x7'));var jayson=require(_0x345e('0x8'));var client=jayson[_0x345e('0x9')][_0x345e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1713d5,_0x4a4b22,_0x42bcfd){return new BPromise(function(_0x25f45f,_0x33606a){return client['request'](_0x1713d5,_0x42bcfd)['then'](function(_0x4127fe){logger[_0x345e('0xb')](_0x345e('0xc'),_0x4a4b22,_0x345e('0xd'));logger[_0x345e('0xe')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4a4b22,'request\x20sent',JSON[_0x345e('0xf')](_0x4127fe));if(_0x4127fe[_0x345e('0x10')]){if(_0x4127fe['error'][_0x345e('0x11')]===0x1f4){logger[_0x345e('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4a4b22,_0x4127fe[_0x345e('0x10')][_0x345e('0x12')]);return _0x33606a(_0x4127fe[_0x345e('0x10')]['message']);}logger[_0x345e('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4a4b22,_0x4127fe[_0x345e('0x10')][_0x345e('0x12')]);return _0x25f45f(_0x4127fe[_0x345e('0x10')][_0x345e('0x12')]);}else{logger[_0x345e('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4a4b22,_0x345e('0xd'));_0x25f45f(_0x4127fe['result'][_0x345e('0x12')]);}})['catch'](function(_0x5db6bb){logger[_0x345e('0x10')](_0x345e('0xc'),_0x4a4b22,_0x5db6bb);_0x33606a(_0x5db6bb);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 3ee7d19..19b38d9 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 _0x13ea=['../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x436adc,_0x5c9ae1){var _0x421a87=function(_0x29c7b9){while(--_0x29c7b9){_0x436adc['push'](_0x436adc['shift']());}};_0x421a87(++_0x5c9ae1);}(_0x13ea,0x1ce));var _0xa13e=function(_0x5d88c0,_0x5d7d83){_0x5d88c0=_0x5d88c0-0x0;var _0x1b40f0=_0x13ea[_0x5d88c0];return _0x1b40f0;};'use strict';var multer=require(_0xa13e('0x0'));var util=require(_0xa13e('0x1'));var path=require(_0xa13e('0x2'));var timeout=require('connect-timeout');var express=require(_0xa13e('0x3'));var router=express[_0xa13e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa13e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa13e('0x6'));var controller=require(_0xa13e('0x7'));router[_0xa13e('0x8')]('/',auth[_0xa13e('0x9')](),controller[_0xa13e('0xa')]);router[_0xa13e('0x8')](_0xa13e('0xb'),auth[_0xa13e('0x9')](),controller[_0xa13e('0xc')]);router[_0xa13e('0xd')]('/',auth[_0xa13e('0x9')](),controller[_0xa13e('0xe')]);router['put']('/:id',auth[_0xa13e('0x9')](),controller[_0xa13e('0xf')]);router['delete'](_0xa13e('0xb'),auth[_0xa13e('0x9')](),controller[_0xa13e('0x10')]);module[_0xa13e('0x11')]=router; \ No newline at end of file +var _0xbf63=['post','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show'];(function(_0x3791a5,_0x3e9d44){var _0x495f05=function(_0x2a2e0c){while(--_0x2a2e0c){_0x3791a5['push'](_0x3791a5['shift']());}};_0x495f05(++_0x3e9d44);}(_0xbf63,0x15b));var _0x3bf6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf63[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3bf6('0x0'));var util=require(_0x3bf6('0x1'));var path=require('path');var timeout=require(_0x3bf6('0x2'));var express=require(_0x3bf6('0x3'));var router=express[_0x3bf6('0x4')]();var fs_extra=require(_0x3bf6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3bf6('0x6'));var config=require('../../config/environment');var controller=require(_0x3bf6('0x7'));router[_0x3bf6('0x8')]('/',auth['isAuthenticated'](),controller[_0x3bf6('0x9')]);router[_0x3bf6('0x8')](_0x3bf6('0xa'),auth[_0x3bf6('0xb')](),controller[_0x3bf6('0xc')]);router[_0x3bf6('0xd')]('/',auth[_0x3bf6('0xb')](),controller[_0x3bf6('0xe')]);router[_0x3bf6('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x3bf6('0xa'),auth[_0x3bf6('0xb')](),controller[_0x3bf6('0x10')]);module[_0x3bf6('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index a4c04e8..8d40552 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 _0xfc04=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0xec0798,_0x44708b){var _0x3048d2=function(_0x1be7f8){while(--_0x1be7f8){_0xec0798['push'](_0xec0798['shift']());}};_0x3048d2(++_0x44708b);}(_0xfc04,0x107));var _0x4fc0=function(_0x3885b4,_0x5af265){_0x3885b4=_0x3885b4-0x0;var _0x5875be=_0xfc04[_0x3885b4];return _0x5875be;};'use strict';var Sequelize=require(_0x4fc0('0x0'));module[_0x4fc0('0x1')]={'type':{'type':Sequelize[_0x4fc0('0x2')](_0x4fc0('0x3'),_0x4fc0('0x4'),_0x4fc0('0x5'),'keyValue',_0x4fc0('0x6')),'defaultValue':_0x4fc0('0x3')},'content':{'type':Sequelize[_0x4fc0('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4fc0('0x2')]('string',_0x4fc0('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4fc0('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4fc0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2fc1=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING'];(function(_0x244416,_0x428be5){var _0x6d5c12=function(_0x2fdcf0){while(--_0x2fdcf0){_0x244416['push'](_0x244416['shift']());}};_0x6d5c12(++_0x428be5);}(_0x2fc1,0xbf));var _0x12fc=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2fc1[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x12fc('0x0'));module[_0x12fc('0x1')]={'type':{'type':Sequelize[_0x12fc('0x2')]('string',_0x12fc('0x3'),_0x12fc('0x4'),_0x12fc('0x5'),_0x12fc('0x6')),'defaultValue':_0x12fc('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x12fc('0x2')](_0x12fc('0x7'),_0x12fc('0x3'),_0x12fc('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x12fc('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x12fc('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x12fc('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 2c1857e..422d6e1 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 _0x99a6=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x44706d,_0x22a6ce){var _0x4083dc=function(_0x1d56f7){while(--_0x1d56f7){_0x44706d['push'](_0x44706d['shift']());}};_0x4083dc(++_0x22a6ce);}(_0x99a6,0x1a2));var _0x699a=function(_0x4ca288,_0x254dd8){_0x4ca288=_0x4ca288-0x0;var _0x2362c1=_0x99a6[_0x4ca288];return _0x2362c1;};'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(_0x699a('0x0'));var moment=require(_0x699a('0x1'));var BPromise=require(_0x699a('0x2'));var Mustache=require('mustache');var util=require(_0x699a('0x3'));var path=require(_0x699a('0x4'));var sox=require(_0x699a('0x5'));var csv=require(_0x699a('0x6'));var ejs=require(_0x699a('0x7'));var fs=require('fs');var fs_extra=require(_0x699a('0x8'));var _=require('lodash');var squel=require(_0x699a('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x699a('0xa'));var toCsv=require(_0x699a('0x6'));var querystring=require(_0x699a('0xb'));var Papa=require(_0x699a('0xc'));var Redis=require('ioredis');var authService=require(_0x699a('0xd'));var qs=require(_0x699a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x699a('0xf'));var logger=require(_0x699a('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x699a('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48b5a1,_0x5b9a96){_0x5b9a96=_0x5b9a96||0xcc;return function(_0x25b996){if(_0x25b996){return _0x48b5a1[_0x699a('0x12')](_0x5b9a96);}return _0x48b5a1[_0x699a('0x13')](_0x5b9a96)[_0x699a('0x14')]();};}function respondWithResult(_0x332b34,_0x1b907d){_0x1b907d=_0x1b907d||0xc8;return function(_0x42cadf){if(_0x42cadf){return _0x332b34[_0x699a('0x13')](_0x1b907d)['json'](_0x42cadf);}};}function respondWithFilteredResult(_0x34169b,_0x7b7947){return function(_0x1b02d6){if(_0x1b02d6){var _0x3f188e=typeof _0x7b7947['offset']==='undefined'&&typeof _0x7b7947[_0x699a('0x15')]===_0x699a('0x16');var _0x5e7405=_0x1b02d6['count'];var _0x5833f6=_0x3f188e?0x0:_0x7b7947[_0x699a('0x17')];var _0x459e29=_0x3f188e?_0x1b02d6[_0x699a('0x18')]:_0x7b7947[_0x699a('0x17')]+_0x7b7947['limit'];var _0x53ba4e;if(_0x459e29>=_0x5e7405){_0x459e29=_0x5e7405;_0x53ba4e=0xc8;}else{_0x53ba4e=0xce;}_0x34169b['status'](_0x53ba4e);return _0x34169b[_0x699a('0x19')](_0x699a('0x1a'),_0x5833f6+'-'+_0x459e29+'/'+_0x5e7405)[_0x699a('0x1b')](_0x1b02d6);}return null;};}function patchUpdates(_0x11673d){return function(_0x403ab3){try{jsonpatch[_0x699a('0x1c')](_0x403ab3,_0x11673d,!![]);}catch(_0x39266d){return BPromise[_0x699a('0x1d')](_0x39266d);}return _0x403ab3[_0x699a('0x1e')]();};}function saveUpdates(_0x22b371,_0x448b1f){return function(_0x1f9ab8){if(_0x1f9ab8){return _0x1f9ab8[_0x699a('0x1f')](_0x22b371)[_0x699a('0x20')](function(_0x321ac3){return _0x321ac3;});}return null;};}function removeEntity(_0x50f483,_0xdd9f13){return function(_0x13bc9b){if(_0x13bc9b){return _0x13bc9b[_0x699a('0x21')]()['then'](function(){_0x50f483[_0x699a('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x544e46,_0x135675){return function(_0x343084){if(!_0x343084){_0x544e46[_0x699a('0x12')](0x194);}return _0x343084;};}function handleError(_0x5e861b,_0x405cd2){_0x405cd2=_0x405cd2||0x1f4;return function(_0x2fc49f){logger[_0x699a('0x22')](_0x2fc49f['stack']);if(_0x2fc49f[_0x699a('0x23')]){delete _0x2fc49f[_0x699a('0x23')];}_0x5e861b[_0x699a('0x13')](_0x405cd2)[_0x699a('0x24')](_0x2fc49f);};}exports[_0x699a('0x25')]=function(_0x2da8fe,_0x4f8314){var _0x3edcba={},_0x37c06e={},_0x4f7004={'count':0x0,'rows':[]};var _0x529d30=_[_0x699a('0x26')](db[_0x699a('0x27')][_0x699a('0x28')],function(_0x19695d){return{'name':_0x19695d[_0x699a('0x29')],'type':_0x19695d[_0x699a('0x2a')][_0x699a('0x2b')]};});_0x37c06e[_0x699a('0x2c')]=_[_0x699a('0x26')](_0x529d30,_0x699a('0x23'));_0x37c06e[_0x699a('0x2d')]=_[_0x699a('0x2e')](_0x2da8fe[_0x699a('0x2d')]);_0x37c06e[_0x699a('0x2f')]=_[_0x699a('0x30')](_0x37c06e[_0x699a('0x2c')],_0x37c06e[_0x699a('0x2d')]);_0x3edcba['attributes']=_[_0x699a('0x30')](_0x37c06e[_0x699a('0x2c')],qs[_0x699a('0x31')](_0x2da8fe['query'][_0x699a('0x31')]));_0x3edcba['attributes']=_0x3edcba['attributes'][_0x699a('0x32')]?_0x3edcba[_0x699a('0x33')]:_0x37c06e[_0x699a('0x2c')];if(!_0x2da8fe[_0x699a('0x2d')][_0x699a('0x34')](_0x699a('0x35'))){_0x3edcba[_0x699a('0x15')]=qs[_0x699a('0x15')](_0x2da8fe[_0x699a('0x2d')][_0x699a('0x15')]);_0x3edcba[_0x699a('0x17')]=qs[_0x699a('0x17')](_0x2da8fe[_0x699a('0x2d')][_0x699a('0x17')]);}_0x3edcba[_0x699a('0x36')]=qs[_0x699a('0x37')](_0x2da8fe[_0x699a('0x2d')][_0x699a('0x37')]);_0x3edcba[_0x699a('0x38')]=qs[_0x699a('0x2f')](_[_0x699a('0x39')](_0x2da8fe[_0x699a('0x2d')],_0x37c06e['filters']),_0x529d30);if(_0x2da8fe[_0x699a('0x2d')][_0x699a('0x3a')]){_0x3edcba[_0x699a('0x38')]=_[_0x699a('0x3b')](_0x3edcba['where'],{'$or':_[_0x699a('0x26')](_0x529d30,function(_0x12251b){if(_0x12251b['type']!==_0x699a('0x3c')){var _0x5a6d6c={};_0x5a6d6c[_0x12251b[_0x699a('0x23')]]={'$like':'%'+_0x2da8fe[_0x699a('0x2d')][_0x699a('0x3a')]+'%'};return _0x5a6d6c;}})});}_0x3edcba=_[_0x699a('0x3b')]({},_0x3edcba,_0x2da8fe[_0x699a('0x3d')]);var _0x4426c9={'where':_0x3edcba[_0x699a('0x38')]};return db['Dynamics365Field'][_0x699a('0x18')](_0x4426c9)['then'](function(_0x109d56){_0x4f7004[_0x699a('0x18')]=_0x109d56;if(_0x2da8fe['query']['includeAll']){_0x3edcba[_0x699a('0x3e')]=[{'all':!![]}];}return db[_0x699a('0x27')][_0x699a('0x3f')](_0x3edcba);})[_0x699a('0x20')](function(_0x473a8f){_0x4f7004[_0x699a('0x40')]=_0x473a8f;return _0x4f7004;})[_0x699a('0x20')](respondWithFilteredResult(_0x4f8314,_0x3edcba))[_0x699a('0x41')](handleError(_0x4f8314,null));};exports[_0x699a('0x42')]=function(_0x26d49a,_0x26c00a){var _0x3e9b25={'raw':!![],'where':{'id':_0x26d49a[_0x699a('0x43')]['id']}},_0x32da85={};_0x32da85[_0x699a('0x2c')]=_[_0x699a('0x2e')](db[_0x699a('0x27')]['rawAttributes']);_0x32da85[_0x699a('0x2d')]=_['keys'](_0x26d49a['query']);_0x32da85[_0x699a('0x2f')]=_[_0x699a('0x30')](_0x32da85['model'],_0x32da85['query']);_0x3e9b25['attributes']=_['intersection'](_0x32da85[_0x699a('0x2c')],qs['fields'](_0x26d49a[_0x699a('0x2d')][_0x699a('0x31')]));_0x3e9b25[_0x699a('0x33')]=_0x3e9b25['attributes']['length']?_0x3e9b25[_0x699a('0x33')]:_0x32da85['model'];if(_0x26d49a[_0x699a('0x2d')][_0x699a('0x44')]){_0x3e9b25['include']=[{'all':!![]}];}_0x3e9b25=_[_0x699a('0x3b')]({},_0x3e9b25,_0x26d49a[_0x699a('0x3d')]);return db[_0x699a('0x27')][_0x699a('0x45')](_0x3e9b25)[_0x699a('0x20')](handleEntityNotFound(_0x26c00a,null))[_0x699a('0x20')](respondWithResult(_0x26c00a,null))[_0x699a('0x41')](handleError(_0x26c00a,null));};exports[_0x699a('0x46')]=function(_0x4235c1,_0x5c212b){return db['Dynamics365Field'][_0x699a('0x46')](_0x4235c1[_0x699a('0x47')],{})[_0x699a('0x20')](respondWithResult(_0x5c212b,0xc9))[_0x699a('0x41')](handleError(_0x5c212b,null));};exports['update']=function(_0x5518a9,_0x1fd51a){if(_0x5518a9[_0x699a('0x47')]['id']){delete _0x5518a9[_0x699a('0x47')]['id'];}return db[_0x699a('0x27')]['find']({'where':{'id':_0x5518a9[_0x699a('0x43')]['id']}})[_0x699a('0x20')](handleEntityNotFound(_0x1fd51a,null))[_0x699a('0x20')](saveUpdates(_0x5518a9[_0x699a('0x47')],null))[_0x699a('0x20')](respondWithResult(_0x1fd51a,null))[_0x699a('0x41')](handleError(_0x1fd51a,null));};exports[_0x699a('0x21')]=function(_0x23c429,_0x1f9f66){return db['Dynamics365Field'][_0x699a('0x45')]({'where':{'id':_0x23c429[_0x699a('0x43')]['id']}})['then'](handleEntityNotFound(_0x1f9f66,null))[_0x699a('0x20')](removeEntity(_0x1f9f66,null))[_0x699a('0x41')](handleError(_0x1f9f66,null));}; \ No newline at end of file +var _0xd213=['count','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','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','../../config/utils','sendStatus','status','offset','undefined','limit'];(function(_0x161a62,_0x54bf73){var _0x160ea4=function(_0xf09dc6){while(--_0xf09dc6){_0x161a62['push'](_0x161a62['shift']());}};_0x160ea4(++_0x54bf73);}(_0xd213,0x148));var _0x3d21=function(_0x4d6625,_0x544938){_0x4d6625=_0x4d6625-0x0;var _0x4c7174=_0xd213[_0x4d6625];return _0x4c7174;};'use strict';var emlformat=require(_0x3d21('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3d21('0x1'));var jsonpatch=require(_0x3d21('0x2'));var rp=require(_0x3d21('0x3'));var moment=require(_0x3d21('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3d21('0x5'));var util=require(_0x3d21('0x6'));var path=require(_0x3d21('0x7'));var sox=require(_0x3d21('0x8'));var csv=require(_0x3d21('0x9'));var ejs=require(_0x3d21('0xa'));var fs=require('fs');var fs_extra=require(_0x3d21('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d21('0xc'));var jsforce=require(_0x3d21('0xd'));var deskjs=require(_0x3d21('0xe'));var toCsv=require(_0x3d21('0x9'));var querystring=require('querystring');var Papa=require(_0x3d21('0xf'));var Redis=require(_0x3d21('0x10'));var authService=require(_0x3d21('0x11'));var qs=require(_0x3d21('0x12'));var as=require(_0x3d21('0x13'));var hardwareService=require(_0x3d21('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3d21('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1afacb,_0x431d58){_0x431d58=_0x431d58||0xcc;return function(_0x4501de){if(_0x4501de){return _0x1afacb[_0x3d21('0x16')](_0x431d58);}return _0x1afacb[_0x3d21('0x17')](_0x431d58)['end']();};}function respondWithResult(_0x5cc7b8,_0x441b8b){_0x441b8b=_0x441b8b||0xc8;return function(_0x3ac05e){if(_0x3ac05e){return _0x5cc7b8[_0x3d21('0x17')](_0x441b8b)['json'](_0x3ac05e);}};}function respondWithFilteredResult(_0x39448f,_0x769a5b){return function(_0x42d4ff){if(_0x42d4ff){var _0x10d3da=typeof _0x769a5b[_0x3d21('0x18')]===_0x3d21('0x19')&&typeof _0x769a5b[_0x3d21('0x1a')]==='undefined';var _0x2b07ca=_0x42d4ff['count'];var _0x3a65c6=_0x10d3da?0x0:_0x769a5b[_0x3d21('0x18')];var _0x1dfce3=_0x10d3da?_0x42d4ff[_0x3d21('0x1b')]:_0x769a5b[_0x3d21('0x18')]+_0x769a5b[_0x3d21('0x1a')];var _0x14f1a6;if(_0x1dfce3>=_0x2b07ca){_0x1dfce3=_0x2b07ca;_0x14f1a6=0xc8;}else{_0x14f1a6=0xce;}_0x39448f['status'](_0x14f1a6);return _0x39448f['set'](_0x3d21('0x1c'),_0x3a65c6+'-'+_0x1dfce3+'/'+_0x2b07ca)[_0x3d21('0x1d')](_0x42d4ff);}return null;};}function patchUpdates(_0x570478){return function(_0x69709e){try{jsonpatch[_0x3d21('0x1e')](_0x69709e,_0x570478,!![]);}catch(_0x191c69){return BPromise[_0x3d21('0x1f')](_0x191c69);}return _0x69709e[_0x3d21('0x20')]();};}function saveUpdates(_0xc9c377,_0x3d7832){return function(_0x270e44){if(_0x270e44){return _0x270e44[_0x3d21('0x21')](_0xc9c377)[_0x3d21('0x22')](function(_0x1dd646){return _0x1dd646;});}return null;};}function removeEntity(_0x380e66,_0x46443e){return function(_0x101baf){if(_0x101baf){return _0x101baf[_0x3d21('0x23')]()[_0x3d21('0x22')](function(){_0x380e66['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdcd375,_0x1456ac){return function(_0x567ec9){if(!_0x567ec9){_0xdcd375[_0x3d21('0x16')](0x194);}return _0x567ec9;};}function handleError(_0x33ab32,_0x256452){_0x256452=_0x256452||0x1f4;return function(_0x56e31a){logger['error'](_0x56e31a[_0x3d21('0x24')]);if(_0x56e31a[_0x3d21('0x25')]){delete _0x56e31a[_0x3d21('0x25')];}_0x33ab32[_0x3d21('0x17')](_0x256452)[_0x3d21('0x26')](_0x56e31a);};}exports[_0x3d21('0x27')]=function(_0x47131e,_0x5eeb01){var _0xdbcc51={},_0x2dff08={},_0x35de9a={'count':0x0,'rows':[]};var _0x404b92=_[_0x3d21('0x28')](db[_0x3d21('0x29')][_0x3d21('0x2a')],function(_0x1fb685){return{'name':_0x1fb685[_0x3d21('0x2b')],'type':_0x1fb685[_0x3d21('0x2c')][_0x3d21('0x2d')]};});_0x2dff08[_0x3d21('0x2e')]=_[_0x3d21('0x28')](_0x404b92,_0x3d21('0x25'));_0x2dff08[_0x3d21('0x2f')]=_['keys'](_0x47131e[_0x3d21('0x2f')]);_0x2dff08[_0x3d21('0x30')]=_[_0x3d21('0x31')](_0x2dff08[_0x3d21('0x2e')],_0x2dff08['query']);_0xdbcc51['attributes']=_[_0x3d21('0x31')](_0x2dff08[_0x3d21('0x2e')],qs[_0x3d21('0x32')](_0x47131e[_0x3d21('0x2f')][_0x3d21('0x32')]));_0xdbcc51[_0x3d21('0x33')]=_0xdbcc51['attributes'][_0x3d21('0x34')]?_0xdbcc51['attributes']:_0x2dff08[_0x3d21('0x2e')];if(!_0x47131e[_0x3d21('0x2f')][_0x3d21('0x35')](_0x3d21('0x36'))){_0xdbcc51[_0x3d21('0x1a')]=qs[_0x3d21('0x1a')](_0x47131e[_0x3d21('0x2f')][_0x3d21('0x1a')]);_0xdbcc51[_0x3d21('0x18')]=qs[_0x3d21('0x18')](_0x47131e[_0x3d21('0x2f')][_0x3d21('0x18')]);}_0xdbcc51[_0x3d21('0x37')]=qs[_0x3d21('0x38')](_0x47131e[_0x3d21('0x2f')][_0x3d21('0x38')]);_0xdbcc51[_0x3d21('0x39')]=qs[_0x3d21('0x30')](_['pick'](_0x47131e[_0x3d21('0x2f')],_0x2dff08['filters']),_0x404b92);if(_0x47131e['query'][_0x3d21('0x3a')]){_0xdbcc51[_0x3d21('0x39')]=_[_0x3d21('0x3b')](_0xdbcc51['where'],{'$or':_[_0x3d21('0x28')](_0x404b92,function(_0x8d2041){if(_0x8d2041['type']!=='VIRTUAL'){var _0x2d2b95={};_0x2d2b95[_0x8d2041[_0x3d21('0x25')]]={'$like':'%'+_0x47131e['query'][_0x3d21('0x3a')]+'%'};return _0x2d2b95;}})});}_0xdbcc51=_[_0x3d21('0x3b')]({},_0xdbcc51,_0x47131e[_0x3d21('0x3c')]);var _0x44a856={'where':_0xdbcc51[_0x3d21('0x39')]};return db[_0x3d21('0x29')][_0x3d21('0x1b')](_0x44a856)[_0x3d21('0x22')](function(_0x79d883){_0x35de9a[_0x3d21('0x1b')]=_0x79d883;if(_0x47131e[_0x3d21('0x2f')][_0x3d21('0x3d')]){_0xdbcc51[_0x3d21('0x3e')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x3d21('0x3f')](_0xdbcc51);})['then'](function(_0x4a1821){_0x35de9a[_0x3d21('0x40')]=_0x4a1821;return _0x35de9a;})[_0x3d21('0x22')](respondWithFilteredResult(_0x5eeb01,_0xdbcc51))[_0x3d21('0x41')](handleError(_0x5eeb01,null));};exports['show']=function(_0x5b1c0c,_0x54ff2f){var _0xef1f45={'raw':!![],'where':{'id':_0x5b1c0c[_0x3d21('0x42')]['id']}},_0x16bbe2={};_0x16bbe2[_0x3d21('0x2e')]=_[_0x3d21('0x43')](db[_0x3d21('0x29')][_0x3d21('0x2a')]);_0x16bbe2[_0x3d21('0x2f')]=_[_0x3d21('0x43')](_0x5b1c0c['query']);_0x16bbe2[_0x3d21('0x30')]=_[_0x3d21('0x31')](_0x16bbe2['model'],_0x16bbe2[_0x3d21('0x2f')]);_0xef1f45['attributes']=_['intersection'](_0x16bbe2['model'],qs[_0x3d21('0x32')](_0x5b1c0c['query']['fields']));_0xef1f45[_0x3d21('0x33')]=_0xef1f45['attributes'][_0x3d21('0x34')]?_0xef1f45[_0x3d21('0x33')]:_0x16bbe2[_0x3d21('0x2e')];if(_0x5b1c0c[_0x3d21('0x2f')]['includeAll']){_0xef1f45[_0x3d21('0x3e')]=[{'all':!![]}];}_0xef1f45=_[_0x3d21('0x3b')]({},_0xef1f45,_0x5b1c0c[_0x3d21('0x3c')]);return db['Dynamics365Field'][_0x3d21('0x44')](_0xef1f45)[_0x3d21('0x22')](handleEntityNotFound(_0x54ff2f,null))['then'](respondWithResult(_0x54ff2f,null))[_0x3d21('0x41')](handleError(_0x54ff2f,null));};exports[_0x3d21('0x45')]=function(_0x47e22a,_0x9cdb27){return db['Dynamics365Field']['create'](_0x47e22a['body'],{})[_0x3d21('0x22')](respondWithResult(_0x9cdb27,0xc9))['catch'](handleError(_0x9cdb27,null));};exports[_0x3d21('0x21')]=function(_0x27c614,_0x22318d){if(_0x27c614[_0x3d21('0x46')]['id']){delete _0x27c614[_0x3d21('0x46')]['id'];}return db[_0x3d21('0x29')][_0x3d21('0x44')]({'where':{'id':_0x27c614[_0x3d21('0x42')]['id']}})[_0x3d21('0x22')](handleEntityNotFound(_0x22318d,null))[_0x3d21('0x22')](saveUpdates(_0x27c614[_0x3d21('0x46')],null))[_0x3d21('0x22')](respondWithResult(_0x22318d,null))['catch'](handleError(_0x22318d,null));};exports['destroy']=function(_0x2749fc,_0x5c57e2){return db[_0x3d21('0x29')][_0x3d21('0x44')]({'where':{'id':_0x2749fc[_0x3d21('0x42')]['id']}})[_0x3d21('0x22')](handleEntityNotFound(_0x5c57e2,null))[_0x3d21('0x22')](removeEntity(_0x5c57e2,null))[_0x3d21('0x41')](handleError(_0x5c57e2,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 1f29f6f..3796c29 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 _0x6ef2=['exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x1f885f,_0x43b5cd){var _0x70b3bd=function(_0x45ff79){while(--_0x45ff79){_0x1f885f['push'](_0x1f885f['shift']());}};_0x70b3bd(++_0x43b5cd);}(_0x6ef2,0x177));var _0x26ef=function(_0x350509,_0x3a8277){_0x350509=_0x350509-0x0;var _0x27ad5c=_0x6ef2[_0x350509];return _0x27ad5c;};'use strict';var _=require(_0x26ef('0x0'));var util=require(_0x26ef('0x1'));var logger=require(_0x26ef('0x2'))(_0x26ef('0x3'));var moment=require('moment');var BPromise=require(_0x26ef('0x4'));var rp=require(_0x26ef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x26ef('0x6'));var config=require(_0x26ef('0x7'));var attributes=require(_0x26ef('0x8'));module[_0x26ef('0x9')]=function(_0x14844b,_0x21004d){return _0x14844b[_0x26ef('0xa')](_0x26ef('0xb'),attributes,{'tableName':_0x26ef('0xc'),'paranoid':![],'indexes':[{'name':_0x26ef('0xd'),'fields':[_0x26ef('0xe'),_0x26ef('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd1fc=['api','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','idField','FieldId','lodash','../../config/logger'];(function(_0x2ead0b,_0xfe7b8e){var _0x3f734e=function(_0x5db61f){while(--_0x5db61f){_0x2ead0b['push'](_0x2ead0b['shift']());}};_0x3f734e(++_0xfe7b8e);}(_0xd1fc,0x140));var _0xcd1f=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0xd1fc[_0x328b1c];return _0x4dbeaa;};'use strict';var _=require(_0xcd1f('0x0'));var util=require('util');var logger=require(_0xcd1f('0x1'))(_0xcd1f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcd1f('0x3'));var fs=require('fs');var path=require(_0xcd1f('0x4'));var rimraf=require(_0xcd1f('0x5'));var config=require(_0xcd1f('0x6'));var attributes=require(_0xcd1f('0x7'));module[_0xcd1f('0x8')]=function(_0x5a61d5,_0x2e3383){return _0x5a61d5[_0xcd1f('0x9')](_0xcd1f('0xa'),attributes,{'tableName':_0xcd1f('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xcd1f('0xc'),_0xcd1f('0xd')],'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 b0c46ec..c172261 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 _0x3d15=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','Dynamics365Field,\x20%s,\x20%s','message','result','catch'];(function(_0x1ef02a,_0x28bd84){var _0x35c7d6=function(_0x50019c){while(--_0x50019c){_0x1ef02a['push'](_0x1ef02a['shift']());}};_0x35c7d6(++_0x28bd84);}(_0x3d15,0xe7));var _0x53d1=function(_0xff780c,_0x3c94eb){_0xff780c=_0xff780c-0x0;var _0x1f0861=_0x3d15[_0xff780c];return _0x1f0861;};'use strict';var _=require(_0x53d1('0x0'));var util=require(_0x53d1('0x1'));var moment=require(_0x53d1('0x2'));var BPromise=require(_0x53d1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x53d1('0x4'));var db=require(_0x53d1('0x5'))['db'];var utils=require(_0x53d1('0x6'));var logger=require('../../config/logger')(_0x53d1('0x7'));var config=require(_0x53d1('0x8'));var jayson=require(_0x53d1('0x9'));var client=jayson[_0x53d1('0xa')][_0x53d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e2f78,_0x20b1f0,_0x5cf9a6){return new BPromise(function(_0xa8b7f,_0x69e783){return client[_0x53d1('0xc')](_0x1e2f78,_0x5cf9a6)['then'](function(_0xf77a37){logger[_0x53d1('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x20b1f0,_0x53d1('0xe'));logger['debug'](_0x53d1('0xf'),_0x20b1f0,'request\x20sent',JSON['stringify'](_0xf77a37));if(_0xf77a37[_0x53d1('0x10')]){if(_0xf77a37[_0x53d1('0x10')]['code']===0x1f4){logger['error'](_0x53d1('0x11'),_0x20b1f0,_0xf77a37[_0x53d1('0x10')][_0x53d1('0x12')]);return _0x69e783(_0xf77a37[_0x53d1('0x10')][_0x53d1('0x12')]);}logger[_0x53d1('0x10')](_0x53d1('0x11'),_0x20b1f0,_0xf77a37['error'][_0x53d1('0x12')]);return _0xa8b7f(_0xf77a37[_0x53d1('0x10')][_0x53d1('0x12')]);}else{logger[_0x53d1('0xd')](_0x53d1('0x11'),_0x20b1f0,_0x53d1('0xe'));_0xa8b7f(_0xf77a37[_0x53d1('0x13')][_0x53d1('0x12')]);}})[_0x53d1('0x14')](function(_0x37ab44){logger[_0x53d1('0x10')](_0x53d1('0x11'),_0x20b1f0,_0x37ab44);_0x69e783(_0x37ab44);});});} \ No newline at end of file +var _0x96c2=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x96c2,0xce));var _0x296c=function(_0xeff2c3,_0x3a5a82){_0xeff2c3=_0xeff2c3-0x0;var _0x2cade6=_0x96c2[_0xeff2c3];return _0x2cade6;};'use strict';var _=require(_0x296c('0x0'));var util=require(_0x296c('0x1'));var moment=require(_0x296c('0x2'));var BPromise=require(_0x296c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x296c('0x4'));var db=require(_0x296c('0x5'))['db'];var utils=require(_0x296c('0x6'));var logger=require(_0x296c('0x7'))(_0x296c('0x8'));var config=require(_0x296c('0x9'));var jayson=require(_0x296c('0xa'));var client=jayson[_0x296c('0xb')][_0x296c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x399841,_0x1aa61e,_0x564ccd){return new BPromise(function(_0x2abaf7,_0x6e9f62){return client[_0x296c('0xd')](_0x399841,_0x564ccd)[_0x296c('0xe')](function(_0xda03d4){logger['info'](_0x296c('0xf'),_0x1aa61e,_0x296c('0x10'));logger['debug'](_0x296c('0x11'),_0x1aa61e,'request\x20sent',JSON['stringify'](_0xda03d4));if(_0xda03d4[_0x296c('0x12')]){if(_0xda03d4[_0x296c('0x12')][_0x296c('0x13')]===0x1f4){logger['error'](_0x296c('0xf'),_0x1aa61e,_0xda03d4['error'][_0x296c('0x14')]);return _0x6e9f62(_0xda03d4[_0x296c('0x12')][_0x296c('0x14')]);}logger['error'](_0x296c('0xf'),_0x1aa61e,_0xda03d4['error'][_0x296c('0x14')]);return _0x2abaf7(_0xda03d4['error'][_0x296c('0x14')]);}else{logger['info'](_0x296c('0xf'),_0x1aa61e,_0x296c('0x10'));_0x2abaf7(_0xda03d4[_0x296c('0x15')][_0x296c('0x14')]);}})[_0x296c('0x16')](function(_0x7e1496){logger[_0x296c('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x1aa61e,_0x7e1496);_0x6e9f62(_0x7e1496);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 1b38e8c..00f7d65 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 _0x8b94=['create','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post'];(function(_0x17f146,_0x3f1bd3){var _0x412983=function(_0x10b42e){while(--_0x10b42e){_0x17f146['push'](_0x17f146['shift']());}};_0x412983(++_0x3f1bd3);}(_0x8b94,0x160));var _0x48b9=function(_0x47abde,_0x1adbbe){_0x47abde=_0x47abde-0x0;var _0x33254a=_0x8b94[_0x47abde];return _0x33254a;};'use strict';var multer=require(_0x48b9('0x0'));var util=require(_0x48b9('0x1'));var path=require('path');var timeout=require(_0x48b9('0x2'));var express=require(_0x48b9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x48b9('0x4'));var interaction=require(_0x48b9('0x5'));var config=require('../../config/environment');var controller=require(_0x48b9('0x6'));router[_0x48b9('0x7')]('/',auth[_0x48b9('0x8')](),controller[_0x48b9('0x9')]);router['get'](_0x48b9('0xa'),auth[_0x48b9('0x8')](),controller[_0x48b9('0xb')]);router[_0x48b9('0x7')](_0x48b9('0xc'),auth['isAuthenticated'](),controller[_0x48b9('0xd')]);router['get']('/:id/fields',auth[_0x48b9('0x8')](),controller[_0x48b9('0xe')]);router[_0x48b9('0xf')]('/',auth[_0x48b9('0x8')](),controller[_0x48b9('0x10')]);router[_0x48b9('0xf')]('/:id/configurations',auth[_0x48b9('0x8')](),controller[_0x48b9('0x11')]);router[_0x48b9('0x12')](_0x48b9('0xa'),auth['isAuthenticated'](),controller[_0x48b9('0x13')]);router[_0x48b9('0x14')]('/:id',auth[_0x48b9('0x8')](),controller[_0x48b9('0x15')]);module[_0x48b9('0x16')]=router; \ No newline at end of file +var _0xeb97=['post','addConfiguration','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','create'];(function(_0x13250f,_0x57addc){var _0x4d9a1c=function(_0x6e6911){while(--_0x6e6911){_0x13250f['push'](_0x13250f['shift']());}};_0x4d9a1c(++_0x57addc);}(_0xeb97,0x149));var _0x7eb9=function(_0x514096,_0x386c7a){_0x514096=_0x514096-0x0;var _0xa89daa=_0xeb97[_0x514096];return _0xa89daa;};'use strict';var multer=require(_0x7eb9('0x0'));var util=require(_0x7eb9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7eb9('0x2'));var router=express[_0x7eb9('0x3')]();var fs_extra=require(_0x7eb9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7eb9('0x5'));var controller=require('./intFreshdeskAccount.controller');router[_0x7eb9('0x6')]('/',auth[_0x7eb9('0x7')](),controller[_0x7eb9('0x8')]);router[_0x7eb9('0x6')](_0x7eb9('0x9'),auth[_0x7eb9('0x7')](),controller['show']);router[_0x7eb9('0x6')](_0x7eb9('0xa'),auth['isAuthenticated'](),controller[_0x7eb9('0xb')]);router['get']('/:id/fields',auth[_0x7eb9('0x7')](),controller['getFields']);router['post']('/',auth[_0x7eb9('0x7')](),controller[_0x7eb9('0xc')]);router[_0x7eb9('0xd')]('/:id/configurations',auth[_0x7eb9('0x7')](),controller[_0x7eb9('0xe')]);router['put'](_0x7eb9('0x9'),auth[_0x7eb9('0x7')](),controller[_0x7eb9('0xf')]);router[_0x7eb9('0x10')](_0x7eb9('0x9'),auth[_0x7eb9('0x7')](),controller[_0x7eb9('0x11')]);module[_0x7eb9('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 9b562ec..c589e28 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 _0xadb5=['remoteUri','exports','STRING','username'];(function(_0x1f0679,_0x53d43c){var _0x3dc3a4=function(_0x49ba8f){while(--_0x49ba8f){_0x1f0679['push'](_0x1f0679['shift']());}};_0x3dc3a4(++_0x53d43c);}(_0xadb5,0xad));var _0x5adb=function(_0x539c15,_0x54c887){_0x539c15=_0x539c15-0x0;var _0x3c657a=_0xadb5[_0x539c15];return _0x3c657a;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5adb('0x1')]},'username':{'type':Sequelize[_0x5adb('0x1')],'unique':_0x5adb('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5adb('0x1')],'unique':_0x5adb('0x3')},'serverUrl':{'type':Sequelize[_0x5adb('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8603=['remoteUri','exports','STRING'];(function(_0x11e5b2,_0x200543){var _0x23badc=function(_0x412bd5){while(--_0x412bd5){_0x11e5b2['push'](_0x11e5b2['shift']());}};_0x23badc(++_0x200543);}(_0x8603,0x190));var _0x3860=function(_0x45730c,_0x5aa7a1){_0x45730c=_0x45730c-0x0;var _0xf66e31=_0x8603[_0x45730c];return _0xf66e31;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'name':{'type':Sequelize[_0x3860('0x1')]},'description':{'type':Sequelize[_0x3860('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x3860('0x1')]},'remoteUri':{'type':Sequelize[_0x3860('0x1')],'unique':_0x3860('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index b800134..01c3a02 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 _0xede3=['undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','FreshdeskAccount','count','include','findAll','catch','show','fields','includeAll','find','body','params','FreshdeskConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Descriptions','channel','create','FreshdeskField','remoteUri','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','toString','base64','description','group','source','ticket_type','company','remove','includes','default','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xede3,0xc0));var _0x3ede=function(_0x3a5a09,_0x55b168){_0x3a5a09=_0x3a5a09-0x0;var _0x17c9ac=_0xede3[_0x3a5a09];return _0x17c9ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ede('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ede('0x1'));var rp=require(_0x3ede('0x2'));var moment=require(_0x3ede('0x3'));var BPromise=require(_0x3ede('0x4'));var Mustache=require(_0x3ede('0x5'));var util=require(_0x3ede('0x6'));var path=require(_0x3ede('0x7'));var sox=require(_0x3ede('0x8'));var csv=require(_0x3ede('0x9'));var ejs=require(_0x3ede('0xa'));var fs=require('fs');var fs_extra=require(_0x3ede('0xb'));var _=require(_0x3ede('0xc'));var squel=require(_0x3ede('0xd'));var crypto=require(_0x3ede('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3ede('0xf'));var toCsv=require(_0x3ede('0x9'));var querystring=require(_0x3ede('0x10'));var Papa=require('papaparse');var Redis=require(_0x3ede('0x11'));var authService=require(_0x3ede('0x12'));var qs=require(_0x3ede('0x13'));var as=require(_0x3ede('0x14'));var hardwareService=require(_0x3ede('0x15'));var logger=require('../../config/logger')(_0x3ede('0x16'));var utils=require(_0x3ede('0x17'));var config=require(_0x3ede('0x18'));var licenseUtil=require(_0x3ede('0x19'));var db=require(_0x3ede('0x1a'))['db'];var integrations=require(_0x3ede('0x1b'));function respondWithStatusCode(_0x3b2697,_0xf1a93b){_0xf1a93b=_0xf1a93b||0xcc;return function(_0x449111){if(_0x449111){return _0x3b2697[_0x3ede('0x1c')](_0xf1a93b);}return _0x3b2697[_0x3ede('0x1d')](_0xf1a93b)[_0x3ede('0x1e')]();};}function respondWithResult(_0x470bba,_0x5d2d69){_0x5d2d69=_0x5d2d69||0xc8;return function(_0x4e03a5){if(_0x4e03a5){return _0x470bba[_0x3ede('0x1d')](_0x5d2d69)['json'](_0x4e03a5);}};}function respondWithFilteredResult(_0x2ac4d5,_0x59c338){return function(_0x54ae57){if(_0x54ae57){var _0x18e11c=typeof _0x59c338[_0x3ede('0x1f')]===_0x3ede('0x20')&&typeof _0x59c338['limit']===_0x3ede('0x20');var _0x516539=_0x54ae57['count'];var _0x390421=_0x18e11c?0x0:_0x59c338[_0x3ede('0x1f')];var _0x1c0268=_0x18e11c?_0x54ae57['count']:_0x59c338[_0x3ede('0x1f')]+_0x59c338[_0x3ede('0x21')];var _0x4fdcc6;if(_0x1c0268>=_0x516539){_0x1c0268=_0x516539;_0x4fdcc6=0xc8;}else{_0x4fdcc6=0xce;}_0x2ac4d5['status'](_0x4fdcc6);return _0x2ac4d5['set'](_0x3ede('0x22'),_0x390421+'-'+_0x1c0268+'/'+_0x516539)['json'](_0x54ae57);}return null;};}function patchUpdates(_0x38ebd6){return function(_0x5a45ff){try{jsonpatch[_0x3ede('0x23')](_0x5a45ff,_0x38ebd6,!![]);}catch(_0x2de9f4){return BPromise[_0x3ede('0x24')](_0x2de9f4);}return _0x5a45ff[_0x3ede('0x25')]();};}function saveUpdates(_0x33b2d6,_0x472924){return function(_0x582d19){if(_0x582d19){return _0x582d19[_0x3ede('0x26')](_0x33b2d6)[_0x3ede('0x27')](function(_0x1e8384){return _0x1e8384;});}return null;};}function removeEntity(_0x19e9aa,_0x313699){return function(_0x10636f){if(_0x10636f){return _0x10636f[_0x3ede('0x28')]()[_0x3ede('0x27')](function(){_0x19e9aa[_0x3ede('0x1d')](0xcc)[_0x3ede('0x1e')]();});}};}function handleEntityNotFound(_0x553584,_0x5e3304){return function(_0x3765fe){if(!_0x3765fe){_0x553584[_0x3ede('0x1c')](0x194);}return _0x3765fe;};}function handleError(_0x248e17,_0x8e750c){_0x8e750c=_0x8e750c||0x1f4;return function(_0x1f0b36){logger[_0x3ede('0x29')](_0x1f0b36['stack']);if(_0x1f0b36[_0x3ede('0x2a')]){delete _0x1f0b36[_0x3ede('0x2a')];}_0x248e17[_0x3ede('0x1d')](_0x8e750c)['send'](_0x1f0b36);};}exports[_0x3ede('0x2b')]=function(_0x8daee8,_0x449e94){var _0x57cf8a={},_0x3d064a={},_0x481e4e={'count':0x0,'rows':[]};var _0x27c706=_[_0x3ede('0x2c')](db['FreshdeskAccount']['rawAttributes'],function(_0x319fd4){return{'name':_0x319fd4[_0x3ede('0x2d')],'type':_0x319fd4[_0x3ede('0x2e')][_0x3ede('0x2f')]};});_0x3d064a[_0x3ede('0x30')]=_[_0x3ede('0x2c')](_0x27c706,_0x3ede('0x2a'));_0x3d064a[_0x3ede('0x31')]=_[_0x3ede('0x32')](_0x8daee8[_0x3ede('0x31')]);_0x3d064a['filters']=_[_0x3ede('0x33')](_0x3d064a[_0x3ede('0x30')],_0x3d064a['query']);_0x57cf8a[_0x3ede('0x34')]=_[_0x3ede('0x33')](_0x3d064a[_0x3ede('0x30')],qs['fields'](_0x8daee8[_0x3ede('0x31')]['fields']));_0x57cf8a[_0x3ede('0x34')]=_0x57cf8a[_0x3ede('0x34')][_0x3ede('0x35')]?_0x57cf8a['attributes']:_0x3d064a['model'];if(!_0x8daee8[_0x3ede('0x31')][_0x3ede('0x36')](_0x3ede('0x37'))){_0x57cf8a[_0x3ede('0x21')]=qs[_0x3ede('0x21')](_0x8daee8['query'][_0x3ede('0x21')]);_0x57cf8a[_0x3ede('0x1f')]=qs[_0x3ede('0x1f')](_0x8daee8[_0x3ede('0x31')]['offset']);}_0x57cf8a[_0x3ede('0x38')]=qs[_0x3ede('0x39')](_0x8daee8[_0x3ede('0x31')]['sort']);_0x57cf8a['where']=qs[_0x3ede('0x3a')](_[_0x3ede('0x3b')](_0x8daee8[_0x3ede('0x31')],_0x3d064a[_0x3ede('0x3a')]),_0x27c706);if(_0x8daee8[_0x3ede('0x31')][_0x3ede('0x3c')]){_0x57cf8a[_0x3ede('0x3d')]=_['merge'](_0x57cf8a[_0x3ede('0x3d')],{'$or':_[_0x3ede('0x2c')](_0x27c706,function(_0xba1c37){if(_0xba1c37['type']!=='VIRTUAL'){var _0x5f0b05={};_0x5f0b05[_0xba1c37[_0x3ede('0x2a')]]={'$like':'%'+_0x8daee8[_0x3ede('0x31')][_0x3ede('0x3c')]+'%'};return _0x5f0b05;}})});}_0x57cf8a=_[_0x3ede('0x3e')]({},_0x57cf8a,_0x8daee8[_0x3ede('0x3f')]);var _0xe752e1={'where':_0x57cf8a[_0x3ede('0x3d')]};return db[_0x3ede('0x40')][_0x3ede('0x41')](_0xe752e1)['then'](function(_0xbd187d){_0x481e4e[_0x3ede('0x41')]=_0xbd187d;if(_0x8daee8[_0x3ede('0x31')]['includeAll']){_0x57cf8a[_0x3ede('0x42')]=[{'all':!![]}];}return db[_0x3ede('0x40')][_0x3ede('0x43')](_0x57cf8a);})[_0x3ede('0x27')](function(_0x59122d){_0x481e4e['rows']=_0x59122d;return _0x481e4e;})[_0x3ede('0x27')](respondWithFilteredResult(_0x449e94,_0x57cf8a))[_0x3ede('0x44')](handleError(_0x449e94,null));};exports[_0x3ede('0x45')]=function(_0x15bfbb,_0x507054){var _0x133c73={'raw':![],'where':{'id':_0x15bfbb['params']['id']}},_0x342bf7={};_0x342bf7['model']=_['keys'](db[_0x3ede('0x40')]['rawAttributes']);_0x342bf7['query']=_['keys'](_0x15bfbb[_0x3ede('0x31')]);_0x342bf7[_0x3ede('0x3a')]=_[_0x3ede('0x33')](_0x342bf7[_0x3ede('0x30')],_0x342bf7[_0x3ede('0x31')]);_0x133c73[_0x3ede('0x34')]=_['intersection'](_0x342bf7[_0x3ede('0x30')],qs['fields'](_0x15bfbb['query'][_0x3ede('0x46')]));_0x133c73[_0x3ede('0x34')]=_0x133c73[_0x3ede('0x34')]['length']?_0x133c73['attributes']:_0x342bf7[_0x3ede('0x30')];if(_0x15bfbb[_0x3ede('0x31')][_0x3ede('0x47')]){_0x133c73['include']=[{'all':!![]}];}_0x133c73=_[_0x3ede('0x3e')]({},_0x133c73,_0x15bfbb[_0x3ede('0x3f')]);return db[_0x3ede('0x40')][_0x3ede('0x48')](_0x133c73)[_0x3ede('0x27')](handleEntityNotFound(_0x507054,null))[_0x3ede('0x27')](respondWithResult(_0x507054,null))[_0x3ede('0x44')](handleError(_0x507054,null));};exports['create']=function(_0x56081d,_0x53916c){return db['FreshdeskAccount']['create'](_0x56081d[_0x3ede('0x49')],{})[_0x3ede('0x27')](respondWithResult(_0x53916c,0xc9))[_0x3ede('0x44')](handleError(_0x53916c,null));};exports[_0x3ede('0x26')]=function(_0x12f296,_0x1ebd75){if(_0x12f296[_0x3ede('0x49')]['id']){delete _0x12f296['body']['id'];}return db['FreshdeskAccount'][_0x3ede('0x48')]({'where':{'id':_0x12f296[_0x3ede('0x4a')]['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0x1ebd75,null))[_0x3ede('0x27')](saveUpdates(_0x12f296[_0x3ede('0x49')],null))[_0x3ede('0x27')](respondWithResult(_0x1ebd75,null))['catch'](handleError(_0x1ebd75,null));};exports[_0x3ede('0x28')]=function(_0x7fbec6,_0xc55e01){return db[_0x3ede('0x40')][_0x3ede('0x48')]({'where':{'id':_0x7fbec6[_0x3ede('0x4a')]['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0xc55e01,null))[_0x3ede('0x27')](removeEntity(_0xc55e01,null))['catch'](handleError(_0xc55e01,null));};exports['getConfigurations']=function(_0x573449,_0x284680,_0x6bdbee){var _0x14ccec={};var _0x20068f={};var _0x519daf;var _0x253773;return db[_0x3ede('0x40')]['findOne']({'where':{'id':_0x573449['params']['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0x284680,null))['then'](function(_0x5a874f){if(_0x5a874f){_0x519daf=_0x5a874f;_0x20068f[_0x3ede('0x30')]=_[_0x3ede('0x32')](db[_0x3ede('0x4b')]['rawAttributes']);_0x20068f[_0x3ede('0x31')]=_['keys'](_0x573449['query']);_0x20068f[_0x3ede('0x3a')]=_[_0x3ede('0x33')](_0x20068f[_0x3ede('0x30')],_0x20068f['query']);_0x14ccec['attributes']=_['intersection'](_0x20068f[_0x3ede('0x30')],qs[_0x3ede('0x46')](_0x573449[_0x3ede('0x31')]['fields']));_0x14ccec['attributes']=_0x14ccec['attributes'][_0x3ede('0x35')]?_0x14ccec[_0x3ede('0x34')]:_0x20068f[_0x3ede('0x30')];_0x14ccec[_0x3ede('0x38')]=qs['sort'](_0x573449[_0x3ede('0x31')][_0x3ede('0x39')]);_0x14ccec[_0x3ede('0x3d')]=qs[_0x3ede('0x3a')](_[_0x3ede('0x3b')](_0x573449['query'],_0x20068f['filters']));if(_0x573449['query'][_0x3ede('0x3c')]){_0x14ccec['where']=_['merge'](_0x14ccec[_0x3ede('0x3d')],{'$or':_[_0x3ede('0x2c')](_0x14ccec[_0x3ede('0x34')],function(_0x39619a){var _0xdccf67={};_0xdccf67[_0x39619a]={'$like':'%'+_0x573449[_0x3ede('0x31')]['filter']+'%'};return _0xdccf67;})});}_0x14ccec=_[_0x3ede('0x3e')]({},_0x14ccec,_0x573449[_0x3ede('0x3f')]);return _0x519daf[_0x3ede('0x4c')](_0x14ccec);}})['then'](function(_0x44de0f){if(_0x44de0f){_0x253773=_0x44de0f[_0x3ede('0x35')];if(!_0x573449['query'][_0x3ede('0x36')](_0x3ede('0x37'))){_0x14ccec[_0x3ede('0x21')]=qs[_0x3ede('0x21')](_0x573449[_0x3ede('0x31')]['limit']);_0x14ccec[_0x3ede('0x1f')]=qs[_0x3ede('0x1f')](_0x573449[_0x3ede('0x31')]['offset']);}return _0x519daf['getConfigurations'](_0x14ccec);}})['then'](function(_0x1060dd){if(_0x1060dd){return _0x1060dd?{'count':_0x253773,'rows':_0x1060dd}:null;}})[_0x3ede('0x27')](respondWithResult(_0x284680,null))['catch'](handleError(_0x284680,null));};exports[_0x3ede('0x4d')]=function(_0x3c2eec,_0x28ba81,_0x48a2e7){if(_0x3c2eec['body']['id']){delete _0x3c2eec[_0x3ede('0x49')]['id'];}return db[_0x3ede('0x40')][_0x3ede('0x4e')]({'where':{'id':_0x3c2eec[_0x3ede('0x4a')]['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0x28ba81,null))[_0x3ede('0x27')](function(_0x28c19e){if(_0x28c19e){_0x3c2eec[_0x3ede('0x49')][_0x3ede('0x4f')]=_0x28c19e['id'];_0x3c2eec[_0x3ede('0x49')]['Subjects']=integrations['getSubjects'](_0x3c2eec[_0x3ede('0x49')]['channel'],_0x3c2eec[_0x3ede('0x49')][_0x3ede('0x2e')]);_0x3c2eec[_0x3ede('0x49')][_0x3ede('0x50')]=integrations['getDescriptions'](_0x3c2eec['body'][_0x3ede('0x51')],_0x3c2eec[_0x3ede('0x49')]['type']);return db[_0x3ede('0x4b')][_0x3ede('0x52')](_0x3c2eec[_0x3ede('0x49')],{'include':[{'model':db[_0x3ede('0x53')],'as':'Subjects'},{'model':db[_0x3ede('0x53')],'as':'Descriptions'}]});}return null;})[_0x3ede('0x27')](respondWithResult(_0x28ba81,null))[_0x3ede('0x44')](handleError(_0x28ba81,null));};exports['getFields']=function(_0x569aa2,_0x2842df,_0x39205f){var _0x27e3c3='';return db[_0x3ede('0x40')]['findOne']({'where':{'id':_0x569aa2[_0x3ede('0x4a')]['id']},'attributes':['id','remoteUri','apiKey']})['then'](handleEntityNotFound(_0x2842df,null))['then'](function(_0x13c593){if(_0x13c593){_0x27e3c3=_0x13c593[_0x3ede('0x54')];var _0x1cea7d=_0x27e3c3[_0x3ede('0x55')](-0x1);if(_0x1cea7d==='/'){_0x27e3c3=_0x27e3c3['substring'](0x0,_0x27e3c3[_0x3ede('0x56')](_0x1cea7d));}return rp({'method':_0x3ede('0x57'),'uri':util[_0x3ede('0x58')](_0x3ede('0x59'),_0x27e3c3,_0x3ede('0x5a')),'headers':{'Authorization':util[_0x3ede('0x58')](_0x3ede('0x5b'),new Buffer(util[_0x3ede('0x58')](_0x3ede('0x5c'),_0x13c593[_0x3ede('0x5d')]))[_0x3ede('0x5e')](_0x3ede('0x5f')))},'json':!![]});}})[_0x3ede('0x27')](function(_0x4691d2){if(_0x4691d2){var _0x4fd768=['requester','subject','agent',_0x3ede('0x60'),'status','priority',_0x3ede('0x61'),_0x3ede('0x62'),_0x3ede('0x63'),'group',_0x3ede('0x64')];_[_0x3ede('0x65')](_0x4691d2,function(_0xa9e773){return _0x4fd768[_0x3ede('0x66')](_0xa9e773[_0x3ede('0x2a')])||!_0xa9e773[_0x3ede('0x67')]&&_0xa9e773[_0x3ede('0x2e')]!=='custom_text'&&_0xa9e773['type']!==_0x3ede('0x68');});return{'count':_0x4691d2[_0x3ede('0x35')],'rows':_[_0x3ede('0x2c')](_0x4691d2,function(_0x5aaa01){return{'id':_0x5aaa01[_0x3ede('0x2a')],'name':_0x5aaa01[_0x3ede('0x69')],'custom':!_0x5aaa01[_0x3ede('0x67')],'options':_0x5aaa01[_0x3ede('0x6a')]?_['map'](_0x5aaa01[_0x3ede('0x6a')],function(_0x4ea3b6){return{'name':_['capitalize'](_0x4ea3b6),'value':_0x4ea3b6};}):[]};})};}})[_0x3ede('0x27')](respondWithResult(_0x2842df,null))['catch'](function(_0x1996d9){var _0x130f11=_0x569aa2['query'][_0x3ede('0x6b')]?0x1f4:_0x1996d9[_0x3ede('0x6c')]||0x1f4;logger['error'](_0x3ede('0x6d'),_0x3ede('0x6e'),_0x130f11,JSON['stringify'](_0x1996d9));delete _0x1996d9[_0x3ede('0x2a')];if(_0x130f11===0x191){_0x130f11=0x190;}_0x2842df['status'](_0x130f11)['send'](_0x569aa2[_0x3ede('0x31')][_0x3ede('0x6b')]?{'message':_0x3ede('0x6f'),'statusCode':_0x1996d9[_0x3ede('0x6c')]}:_0x1996d9);});}; \ No newline at end of file +var _0x4ffe=['format','%s:X','apiKey','toString','base64','agent','description','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','error','stack','name','send','map','FreshdeskAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','options','include','findAll','catch','show','rawAttributes','length','includeAll','create','body','params','find','getConfigurations','FreshdeskConfiguration','pick','hasOwnProperty','addConfiguration','findOne','AccountId','getSubjects','channel','getDescriptions','FreshdeskField','Subjects','Descriptions','getFields','remoteUri','slice','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','Basic\x20%s'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4ffe,0x172));var _0xe4ff=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0x4ffe[_0x4bacb6];return _0x58c029;};'use strict';var emlformat=require(_0xe4ff('0x0'));var rimraf=require(_0xe4ff('0x1'));var zipdir=require(_0xe4ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe4ff('0x3'));var moment=require(_0xe4ff('0x4'));var BPromise=require(_0xe4ff('0x5'));var Mustache=require('mustache');var util=require(_0xe4ff('0x6'));var path=require(_0xe4ff('0x7'));var sox=require(_0xe4ff('0x8'));var csv=require(_0xe4ff('0x9'));var ejs=require(_0xe4ff('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4ff('0xb'));var squel=require(_0xe4ff('0xc'));var crypto=require(_0xe4ff('0xd'));var jsforce=require(_0xe4ff('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe4ff('0x9'));var querystring=require('querystring');var Papa=require(_0xe4ff('0xf'));var Redis=require(_0xe4ff('0x10'));var authService=require(_0xe4ff('0x11'));var qs=require(_0xe4ff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe4ff('0x13'))(_0xe4ff('0x14'));var utils=require(_0xe4ff('0x15'));var config=require(_0xe4ff('0x16'));var licenseUtil=require(_0xe4ff('0x17'));var db=require(_0xe4ff('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x40b932,_0x20c8c1){_0x20c8c1=_0x20c8c1||0xcc;return function(_0x4b5f3e){if(_0x4b5f3e){return _0x40b932[_0xe4ff('0x19')](_0x20c8c1);}return _0x40b932['status'](_0x20c8c1)[_0xe4ff('0x1a')]();};}function respondWithResult(_0x2d5182,_0x5702dc){_0x5702dc=_0x5702dc||0xc8;return function(_0x3db2da){if(_0x3db2da){return _0x2d5182[_0xe4ff('0x1b')](_0x5702dc)[_0xe4ff('0x1c')](_0x3db2da);}};}function respondWithFilteredResult(_0x30db8f,_0x2b7212){return function(_0x416889){if(_0x416889){var _0x4a7ae5=typeof _0x2b7212[_0xe4ff('0x1d')]===_0xe4ff('0x1e')&&typeof _0x2b7212[_0xe4ff('0x1f')]===_0xe4ff('0x1e');var _0x5a7a2e=_0x416889[_0xe4ff('0x20')];var _0xa3429a=_0x4a7ae5?0x0:_0x2b7212[_0xe4ff('0x1d')];var _0x2e0cad=_0x4a7ae5?_0x416889['count']:_0x2b7212[_0xe4ff('0x1d')]+_0x2b7212[_0xe4ff('0x1f')];var _0x44e11d;if(_0x2e0cad>=_0x5a7a2e){_0x2e0cad=_0x5a7a2e;_0x44e11d=0xc8;}else{_0x44e11d=0xce;}_0x30db8f[_0xe4ff('0x1b')](_0x44e11d);return _0x30db8f[_0xe4ff('0x21')]('Content-Range',_0xa3429a+'-'+_0x2e0cad+'/'+_0x5a7a2e)[_0xe4ff('0x1c')](_0x416889);}return null;};}function patchUpdates(_0xfa6146){return function(_0x296b99){try{jsonpatch[_0xe4ff('0x22')](_0x296b99,_0xfa6146,!![]);}catch(_0x16ab09){return BPromise[_0xe4ff('0x23')](_0x16ab09);}return _0x296b99['save']();};}function saveUpdates(_0xb7c50,_0x57f868){return function(_0x44a7f1){if(_0x44a7f1){return _0x44a7f1[_0xe4ff('0x24')](_0xb7c50)['then'](function(_0x2044ca){return _0x2044ca;});}return null;};}function removeEntity(_0x5c9345,_0xf8e190){return function(_0xe728d1){if(_0xe728d1){return _0xe728d1[_0xe4ff('0x25')]()[_0xe4ff('0x26')](function(){_0x5c9345[_0xe4ff('0x1b')](0xcc)[_0xe4ff('0x1a')]();});}};}function handleEntityNotFound(_0x2cfd53,_0x3f6d4a){return function(_0x12cd79){if(!_0x12cd79){_0x2cfd53[_0xe4ff('0x19')](0x194);}return _0x12cd79;};}function handleError(_0x2d12fd,_0x46844e){_0x46844e=_0x46844e||0x1f4;return function(_0x59b4b7){logger[_0xe4ff('0x27')](_0x59b4b7[_0xe4ff('0x28')]);if(_0x59b4b7[_0xe4ff('0x29')]){delete _0x59b4b7[_0xe4ff('0x29')];}_0x2d12fd[_0xe4ff('0x1b')](_0x46844e)[_0xe4ff('0x2a')](_0x59b4b7);};}exports['index']=function(_0xb31df7,_0x3c8912){var _0x2ec29e={},_0x4a5b4d={},_0x7d889f={'count':0x0,'rows':[]};var _0x4abb50=_[_0xe4ff('0x2b')](db[_0xe4ff('0x2c')]['rawAttributes'],function(_0x56a5cc){return{'name':_0x56a5cc[_0xe4ff('0x2d')],'type':_0x56a5cc[_0xe4ff('0x2e')][_0xe4ff('0x2f')]};});_0x4a5b4d[_0xe4ff('0x30')]=_[_0xe4ff('0x2b')](_0x4abb50,_0xe4ff('0x29'));_0x4a5b4d[_0xe4ff('0x31')]=_[_0xe4ff('0x32')](_0xb31df7['query']);_0x4a5b4d[_0xe4ff('0x33')]=_[_0xe4ff('0x34')](_0x4a5b4d[_0xe4ff('0x30')],_0x4a5b4d[_0xe4ff('0x31')]);_0x2ec29e[_0xe4ff('0x35')]=_['intersection'](_0x4a5b4d['model'],qs[_0xe4ff('0x36')](_0xb31df7[_0xe4ff('0x31')][_0xe4ff('0x36')]));_0x2ec29e[_0xe4ff('0x35')]=_0x2ec29e[_0xe4ff('0x35')]['length']?_0x2ec29e[_0xe4ff('0x35')]:_0x4a5b4d['model'];if(!_0xb31df7[_0xe4ff('0x31')]['hasOwnProperty'](_0xe4ff('0x37'))){_0x2ec29e['limit']=qs[_0xe4ff('0x1f')](_0xb31df7['query'][_0xe4ff('0x1f')]);_0x2ec29e[_0xe4ff('0x1d')]=qs[_0xe4ff('0x1d')](_0xb31df7[_0xe4ff('0x31')]['offset']);}_0x2ec29e[_0xe4ff('0x38')]=qs['sort'](_0xb31df7[_0xe4ff('0x31')][_0xe4ff('0x39')]);_0x2ec29e[_0xe4ff('0x3a')]=qs[_0xe4ff('0x33')](_['pick'](_0xb31df7[_0xe4ff('0x31')],_0x4a5b4d[_0xe4ff('0x33')]),_0x4abb50);if(_0xb31df7[_0xe4ff('0x31')][_0xe4ff('0x3b')]){_0x2ec29e[_0xe4ff('0x3a')]=_[_0xe4ff('0x3c')](_0x2ec29e[_0xe4ff('0x3a')],{'$or':_[_0xe4ff('0x2b')](_0x4abb50,function(_0x1a6fee){if(_0x1a6fee[_0xe4ff('0x2e')]!=='VIRTUAL'){var _0xa39d7f={};_0xa39d7f[_0x1a6fee[_0xe4ff('0x29')]]={'$like':'%'+_0xb31df7[_0xe4ff('0x31')][_0xe4ff('0x3b')]+'%'};return _0xa39d7f;}})});}_0x2ec29e=_[_0xe4ff('0x3c')]({},_0x2ec29e,_0xb31df7[_0xe4ff('0x3d')]);var _0xeb11b6={'where':_0x2ec29e[_0xe4ff('0x3a')]};return db[_0xe4ff('0x2c')][_0xe4ff('0x20')](_0xeb11b6)[_0xe4ff('0x26')](function(_0x14061e){_0x7d889f[_0xe4ff('0x20')]=_0x14061e;if(_0xb31df7['query']['includeAll']){_0x2ec29e[_0xe4ff('0x3e')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xe4ff('0x3f')](_0x2ec29e);})[_0xe4ff('0x26')](function(_0x4a6b91){_0x7d889f['rows']=_0x4a6b91;return _0x7d889f;})[_0xe4ff('0x26')](respondWithFilteredResult(_0x3c8912,_0x2ec29e))[_0xe4ff('0x40')](handleError(_0x3c8912,null));};exports[_0xe4ff('0x41')]=function(_0x10278f,_0x261a55){var _0x222434={'raw':![],'where':{'id':_0x10278f['params']['id']}},_0x372636={};_0x372636[_0xe4ff('0x30')]=_[_0xe4ff('0x32')](db['FreshdeskAccount'][_0xe4ff('0x42')]);_0x372636[_0xe4ff('0x31')]=_['keys'](_0x10278f[_0xe4ff('0x31')]);_0x372636[_0xe4ff('0x33')]=_[_0xe4ff('0x34')](_0x372636[_0xe4ff('0x30')],_0x372636[_0xe4ff('0x31')]);_0x222434['attributes']=_[_0xe4ff('0x34')](_0x372636['model'],qs[_0xe4ff('0x36')](_0x10278f[_0xe4ff('0x31')][_0xe4ff('0x36')]));_0x222434['attributes']=_0x222434[_0xe4ff('0x35')][_0xe4ff('0x43')]?_0x222434[_0xe4ff('0x35')]:_0x372636['model'];if(_0x10278f['query'][_0xe4ff('0x44')]){_0x222434['include']=[{'all':!![]}];}_0x222434=_[_0xe4ff('0x3c')]({},_0x222434,_0x10278f[_0xe4ff('0x3d')]);return db[_0xe4ff('0x2c')]['find'](_0x222434)[_0xe4ff('0x26')](handleEntityNotFound(_0x261a55,null))[_0xe4ff('0x26')](respondWithResult(_0x261a55,null))[_0xe4ff('0x40')](handleError(_0x261a55,null));};exports[_0xe4ff('0x45')]=function(_0x26ad7f,_0x232ce9){return db[_0xe4ff('0x2c')][_0xe4ff('0x45')](_0x26ad7f[_0xe4ff('0x46')],{})['then'](respondWithResult(_0x232ce9,0xc9))[_0xe4ff('0x40')](handleError(_0x232ce9,null));};exports[_0xe4ff('0x24')]=function(_0x1ee66f,_0x424fef){if(_0x1ee66f[_0xe4ff('0x46')]['id']){delete _0x1ee66f[_0xe4ff('0x46')]['id'];}return db[_0xe4ff('0x2c')]['find']({'where':{'id':_0x1ee66f[_0xe4ff('0x47')]['id']}})[_0xe4ff('0x26')](handleEntityNotFound(_0x424fef,null))[_0xe4ff('0x26')](saveUpdates(_0x1ee66f[_0xe4ff('0x46')],null))[_0xe4ff('0x26')](respondWithResult(_0x424fef,null))[_0xe4ff('0x40')](handleError(_0x424fef,null));};exports[_0xe4ff('0x25')]=function(_0x1462d8,_0x2590c6){return db['FreshdeskAccount'][_0xe4ff('0x48')]({'where':{'id':_0x1462d8['params']['id']}})[_0xe4ff('0x26')](handleEntityNotFound(_0x2590c6,null))[_0xe4ff('0x26')](removeEntity(_0x2590c6,null))['catch'](handleError(_0x2590c6,null));};exports[_0xe4ff('0x49')]=function(_0x16f8c6,_0x18ee8b,_0x290940){var _0x2b43a7={};var _0x54a7de={};var _0x2f9e11;var _0x557249;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x16f8c6[_0xe4ff('0x47')]['id']}})[_0xe4ff('0x26')](handleEntityNotFound(_0x18ee8b,null))[_0xe4ff('0x26')](function(_0x28cc81){if(_0x28cc81){_0x2f9e11=_0x28cc81;_0x54a7de[_0xe4ff('0x30')]=_['keys'](db[_0xe4ff('0x4a')][_0xe4ff('0x42')]);_0x54a7de[_0xe4ff('0x31')]=_[_0xe4ff('0x32')](_0x16f8c6[_0xe4ff('0x31')]);_0x54a7de[_0xe4ff('0x33')]=_[_0xe4ff('0x34')](_0x54a7de['model'],_0x54a7de['query']);_0x2b43a7['attributes']=_[_0xe4ff('0x34')](_0x54a7de[_0xe4ff('0x30')],qs['fields'](_0x16f8c6[_0xe4ff('0x31')][_0xe4ff('0x36')]));_0x2b43a7[_0xe4ff('0x35')]=_0x2b43a7[_0xe4ff('0x35')][_0xe4ff('0x43')]?_0x2b43a7['attributes']:_0x54a7de[_0xe4ff('0x30')];_0x2b43a7['order']=qs[_0xe4ff('0x39')](_0x16f8c6[_0xe4ff('0x31')]['sort']);_0x2b43a7[_0xe4ff('0x3a')]=qs[_0xe4ff('0x33')](_[_0xe4ff('0x4b')](_0x16f8c6[_0xe4ff('0x31')],_0x54a7de[_0xe4ff('0x33')]));if(_0x16f8c6[_0xe4ff('0x31')][_0xe4ff('0x3b')]){_0x2b43a7[_0xe4ff('0x3a')]=_[_0xe4ff('0x3c')](_0x2b43a7[_0xe4ff('0x3a')],{'$or':_[_0xe4ff('0x2b')](_0x2b43a7[_0xe4ff('0x35')],function(_0x1d8529){var _0x37eaea={};_0x37eaea[_0x1d8529]={'$like':'%'+_0x16f8c6[_0xe4ff('0x31')][_0xe4ff('0x3b')]+'%'};return _0x37eaea;})});}_0x2b43a7=_[_0xe4ff('0x3c')]({},_0x2b43a7,_0x16f8c6[_0xe4ff('0x3d')]);return _0x2f9e11['getConfigurations'](_0x2b43a7);}})[_0xe4ff('0x26')](function(_0x11cb09){if(_0x11cb09){_0x557249=_0x11cb09[_0xe4ff('0x43')];if(!_0x16f8c6['query'][_0xe4ff('0x4c')](_0xe4ff('0x37'))){_0x2b43a7['limit']=qs['limit'](_0x16f8c6[_0xe4ff('0x31')][_0xe4ff('0x1f')]);_0x2b43a7[_0xe4ff('0x1d')]=qs[_0xe4ff('0x1d')](_0x16f8c6[_0xe4ff('0x31')][_0xe4ff('0x1d')]);}return _0x2f9e11['getConfigurations'](_0x2b43a7);}})[_0xe4ff('0x26')](function(_0x2c701c){if(_0x2c701c){return _0x2c701c?{'count':_0x557249,'rows':_0x2c701c}:null;}})[_0xe4ff('0x26')](respondWithResult(_0x18ee8b,null))[_0xe4ff('0x40')](handleError(_0x18ee8b,null));};exports[_0xe4ff('0x4d')]=function(_0x371a48,_0x1e5c89,_0x26e982){if(_0x371a48[_0xe4ff('0x46')]['id']){delete _0x371a48[_0xe4ff('0x46')]['id'];}return db['FreshdeskAccount'][_0xe4ff('0x4e')]({'where':{'id':_0x371a48[_0xe4ff('0x47')]['id']}})[_0xe4ff('0x26')](handleEntityNotFound(_0x1e5c89,null))[_0xe4ff('0x26')](function(_0x2711d9){if(_0x2711d9){_0x371a48[_0xe4ff('0x46')][_0xe4ff('0x4f')]=_0x2711d9['id'];_0x371a48[_0xe4ff('0x46')]['Subjects']=integrations[_0xe4ff('0x50')](_0x371a48[_0xe4ff('0x46')][_0xe4ff('0x51')],_0x371a48[_0xe4ff('0x46')][_0xe4ff('0x2e')]);_0x371a48[_0xe4ff('0x46')]['Descriptions']=integrations[_0xe4ff('0x52')](_0x371a48[_0xe4ff('0x46')][_0xe4ff('0x51')],_0x371a48['body']['type']);return db[_0xe4ff('0x4a')]['create'](_0x371a48[_0xe4ff('0x46')],{'include':[{'model':db[_0xe4ff('0x53')],'as':_0xe4ff('0x54')},{'model':db[_0xe4ff('0x53')],'as':_0xe4ff('0x55')}]});}return null;})[_0xe4ff('0x26')](respondWithResult(_0x1e5c89,null))[_0xe4ff('0x40')](handleError(_0x1e5c89,null));};exports[_0xe4ff('0x56')]=function(_0x134506,_0x5bc516,_0x48ed6b){var _0x1056e3='';return db[_0xe4ff('0x2c')][_0xe4ff('0x4e')]({'where':{'id':_0x134506[_0xe4ff('0x47')]['id']},'attributes':['id',_0xe4ff('0x57'),'apiKey']})[_0xe4ff('0x26')](handleEntityNotFound(_0x5bc516,null))[_0xe4ff('0x26')](function(_0x5eb61a){if(_0x5eb61a){_0x1056e3=_0x5eb61a[_0xe4ff('0x57')];var _0x5f3753=_0x1056e3[_0xe4ff('0x58')](-0x1);if(_0x5f3753==='/'){_0x1056e3=_0x1056e3['substring'](0x0,_0x1056e3[_0xe4ff('0x59')](_0x5f3753));}return rp({'method':_0xe4ff('0x5a'),'uri':util['format'](_0xe4ff('0x5b'),_0x1056e3,_0xe4ff('0x5c')),'headers':{'Authorization':util['format'](_0xe4ff('0x5d'),new Buffer(util[_0xe4ff('0x5e')](_0xe4ff('0x5f'),_0x5eb61a[_0xe4ff('0x60')]))[_0xe4ff('0x61')](_0xe4ff('0x62')))},'json':!![]});}})[_0xe4ff('0x26')](function(_0x36c8ca){if(_0x36c8ca){var _0x2e5477=['requester','subject',_0xe4ff('0x63'),_0xe4ff('0x64'),'status','priority',_0xe4ff('0x65'),_0xe4ff('0x66'),_0xe4ff('0x67'),'group',_0xe4ff('0x68')];_[_0xe4ff('0x69')](_0x36c8ca,function(_0x377d27){return _0x2e5477[_0xe4ff('0x6a')](_0x377d27[_0xe4ff('0x29')])||!_0x377d27[_0xe4ff('0x6b')]&&_0x377d27[_0xe4ff('0x2e')]!==_0xe4ff('0x6c')&&_0x377d27[_0xe4ff('0x2e')]!==_0xe4ff('0x6d');});return{'count':_0x36c8ca['length'],'rows':_[_0xe4ff('0x2b')](_0x36c8ca,function(_0x50d032){return{'id':_0x50d032[_0xe4ff('0x29')],'name':_0x50d032[_0xe4ff('0x6e')],'custom':!_0x50d032['default'],'options':_0x50d032[_0xe4ff('0x6f')]?_['map'](_0x50d032[_0xe4ff('0x6f')],function(_0x166e57){return{'name':_['capitalize'](_0x166e57),'value':_0x166e57};}):[]};})};}})[_0xe4ff('0x26')](respondWithResult(_0x5bc516,null))['catch'](function(_0x25c13f){var _0x3e98a4=_0x134506[_0xe4ff('0x31')][_0xe4ff('0x70')]?0x1f4:_0x25c13f[_0xe4ff('0x71')]||0x1f4;logger['error'](_0xe4ff('0x72'),'getFields',_0x3e98a4,JSON[_0xe4ff('0x73')](_0x25c13f));delete _0x25c13f[_0xe4ff('0x29')];if(_0x3e98a4===0x191){_0x3e98a4=0x190;}_0x5bc516[_0xe4ff('0x1b')](_0x3e98a4)[_0xe4ff('0x2a')](_0x134506['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x25c13f['statusCode']}:_0x25c13f);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 9b87cfe..826f529 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 _0xc426=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util'];(function(_0x19a003,_0xea9cac){var _0x220614=function(_0x5d425c){while(--_0x5d425c){_0x19a003['push'](_0x19a003['shift']());}};_0x220614(++_0xea9cac);}(_0xc426,0x124));var _0x6c42=function(_0x34c263,_0x37d5b8){_0x34c263=_0x34c263-0x0;var _0x46d0d9=_0xc426[_0x34c263];return _0x46d0d9;};'use strict';var _=require(_0x6c42('0x0'));var util=require(_0x6c42('0x1'));var logger=require(_0x6c42('0x2'))(_0x6c42('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6c42('0x4'));var fs=require('fs');var path=require(_0x6c42('0x5'));var rimraf=require(_0x6c42('0x6'));var config=require(_0x6c42('0x7'));var attributes=require(_0x6c42('0x8'));var integrations=require(_0x6c42('0x9'));module[_0x6c42('0xa')]=function(_0x5807d1,_0x38b935){return _0x5807d1[_0x6c42('0xb')](_0x6c42('0xc'),attributes,{'tableName':_0x6c42('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3828=['int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','FreshdeskAccount'];(function(_0x3077b0,_0x22364f){var _0xce5a6a=function(_0x1d675e){while(--_0x1d675e){_0x3077b0['push'](_0x3077b0['shift']());}};_0xce5a6a(++_0x22364f);}(_0x3828,0x169));var _0x8382=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x3828[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0x8382('0x0'));var util=require(_0x8382('0x1'));var logger=require(_0x8382('0x2'))(_0x8382('0x3'));var moment=require('moment');var BPromise=require(_0x8382('0x4'));var rp=require(_0x8382('0x5'));var fs=require('fs');var path=require(_0x8382('0x6'));var rimraf=require('rimraf');var config=require(_0x8382('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x8382('0x8'));module[_0x8382('0x9')]=function(_0x3dc505,_0x5c7941){return _0x3dc505['define'](_0x8382('0xa'),attributes,{'tableName':_0x8382('0xb'),'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 69ca44a..a3ce19e 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 _0x0ede=['debug','ShowFreshdeskAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','include','map','model','attributes'];(function(_0x4aeca6,_0x2a8453){var _0x2fbe77=function(_0x1e83e4){while(--_0x1e83e4){_0x4aeca6['push'](_0x4aeca6['shift']());}};_0x2fbe77(++_0x2a8453);}(_0x0ede,0x12b));var _0xe0ed=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0ede[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xe0ed('0x0'));var util=require('util');var moment=require(_0xe0ed('0x1'));var BPromise=require(_0xe0ed('0x2'));var rs=require(_0xe0ed('0x3'));var fs=require('fs');var Redis=require(_0xe0ed('0x4'));var db=require(_0xe0ed('0x5'))['db'];var utils=require(_0xe0ed('0x6'));var logger=require(_0xe0ed('0x7'))(_0xe0ed('0x8'));var config=require(_0xe0ed('0x9'));var jayson=require(_0xe0ed('0xa'));var client=jayson[_0xe0ed('0xb')][_0xe0ed('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4575ea,_0x304568,_0x5028b5){return new BPromise(function(_0x1764e4,_0x156583){return client['request'](_0x4575ea,_0x5028b5)[_0xe0ed('0xd')](function(_0x3e0e1c){logger[_0xe0ed('0xe')](_0xe0ed('0xf'),_0x304568,'request\x20sent');logger['debug'](_0xe0ed('0x10'),_0x304568,_0xe0ed('0x11'),JSON[_0xe0ed('0x12')](_0x3e0e1c));if(_0x3e0e1c[_0xe0ed('0x13')]){if(_0x3e0e1c[_0xe0ed('0x13')][_0xe0ed('0x14')]===0x1f4){logger[_0xe0ed('0x13')](_0xe0ed('0xf'),_0x304568,_0x3e0e1c[_0xe0ed('0x13')]['message']);return _0x156583(_0x3e0e1c[_0xe0ed('0x13')][_0xe0ed('0x15')]);}logger['error'](_0xe0ed('0xf'),_0x304568,_0x3e0e1c['error'][_0xe0ed('0x15')]);return _0x1764e4(_0x3e0e1c[_0xe0ed('0x13')][_0xe0ed('0x15')]);}else{logger[_0xe0ed('0xe')](_0xe0ed('0xf'),_0x304568,'request\x20sent');_0x1764e4(_0x3e0e1c[_0xe0ed('0x16')][_0xe0ed('0x15')]);}})[_0xe0ed('0x17')](function(_0x2a27c3){logger[_0xe0ed('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x304568,_0x2a27c3);_0x156583(_0x2a27c3);});});}exports[_0xe0ed('0x18')]=function(_0x1e1efd){var _0xc9e81f=this;return new Promise(function(_0x30fff8,_0x1bcf86){return db[_0xe0ed('0x19')][_0xe0ed('0x1a')]({'raw':_0x1e1efd[_0xe0ed('0x1b')]?_0x1e1efd[_0xe0ed('0x1b')][_0xe0ed('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e1efd[_0xe0ed('0x1b')]?_0x1e1efd[_0xe0ed('0x1b')][_0xe0ed('0x1d')]||null:null,'attributes':_0x1e1efd[_0xe0ed('0x1b')]?_0x1e1efd['options']['attributes']||null:null,'limit':_0x1e1efd[_0xe0ed('0x1b')]?_0x1e1efd[_0xe0ed('0x1b')]['limit']||null:null,'include':_0x1e1efd[_0xe0ed('0x1b')]?_0x1e1efd['options'][_0xe0ed('0x1e')]?_[_0xe0ed('0x1f')](_0x1e1efd['options'][_0xe0ed('0x1e')],function(_0x5c6dfe){return{'model':db[_0x5c6dfe[_0xe0ed('0x20')]],'as':_0x5c6dfe['as'],'attributes':_0x5c6dfe[_0xe0ed('0x21')],'include':_0x5c6dfe[_0xe0ed('0x1e')]?_[_0xe0ed('0x1f')](_0x5c6dfe['include'],function(_0x123c94){return{'model':db[_0x123c94['model']],'as':_0x123c94['as'],'attributes':_0x123c94[_0xe0ed('0x21')],'include':_0x123c94[_0xe0ed('0x1e')]?_[_0xe0ed('0x1f')](_0x123c94[_0xe0ed('0x1e')],function(_0x329029){return{'model':db[_0x329029[_0xe0ed('0x20')]],'as':_0x329029['as'],'attributes':_0x329029[_0xe0ed('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe0ed('0xd')](function(_0x14769e){logger['info']('GetFreshdeskAccount',_0x1e1efd);logger[_0xe0ed('0x22')](_0xe0ed('0x18'),_0x1e1efd,JSON[_0xe0ed('0x12')](_0x14769e));_0x30fff8(_0x14769e);})[_0xe0ed('0x17')](function(_0x405332){logger[_0xe0ed('0x13')](_0xe0ed('0x18'),_0x405332[_0xe0ed('0x15')],_0x1e1efd);_0x1bcf86(_0xc9e81f[_0xe0ed('0x13')](0x1f4,_0x405332[_0xe0ed('0x15')]));});});};exports[_0xe0ed('0x23')]=function(_0x317b66){var _0x2c09bf=this;return new Promise(function(_0x104f87,_0x115afe){return db['FreshdeskAccount'][_0xe0ed('0x24')]({'raw':_0x317b66[_0xe0ed('0x1b')]?_0x317b66[_0xe0ed('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x317b66[_0xe0ed('0x1b')]?_0x317b66[_0xe0ed('0x1b')][_0xe0ed('0x1d')]||null:null,'attributes':_0x317b66['options']?_0x317b66[_0xe0ed('0x1b')][_0xe0ed('0x21')]||null:null,'include':_0x317b66[_0xe0ed('0x1b')]?_0x317b66['options']['include']?_[_0xe0ed('0x1f')](_0x317b66[_0xe0ed('0x1b')]['include'],function(_0x22dd7c){return{'model':db[_0x22dd7c['model']],'as':_0x22dd7c['as'],'attributes':_0x22dd7c[_0xe0ed('0x21')],'include':_0x22dd7c['include']?_['map'](_0x22dd7c[_0xe0ed('0x1e')],function(_0x674606){return{'model':db[_0x674606[_0xe0ed('0x20')]],'as':_0x674606['as'],'attributes':_0x674606[_0xe0ed('0x21')],'include':_0x674606[_0xe0ed('0x1e')]?_['map'](_0x674606[_0xe0ed('0x1e')],function(_0x4da99b){return{'model':db[_0x4da99b[_0xe0ed('0x20')]],'as':_0x4da99b['as'],'attributes':_0x4da99b[_0xe0ed('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe0ed('0xd')](function(_0x43781a){logger[_0xe0ed('0xe')](_0xe0ed('0x23'),_0x317b66);logger['debug'](_0xe0ed('0x23'),_0x317b66,JSON[_0xe0ed('0x12')](_0x43781a));_0x104f87(_0x43781a);})[_0xe0ed('0x17')](function(_0x14bd82){logger['error'](_0xe0ed('0x23'),_0x14bd82[_0xe0ed('0x15')],_0x317b66);_0x115afe(_0x2c09bf[_0xe0ed('0x13')](0x1f4,_0x14bd82['message']));});});}; \ No newline at end of file +var _0xe02c=['GetFreshdeskAccount','ShowFreshdeskAccount','find','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','FreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','info'];(function(_0x4cea23,_0x41b7ee){var _0x4d08d2=function(_0x19c34d){while(--_0x19c34d){_0x4cea23['push'](_0x4cea23['shift']());}};_0x4d08d2(++_0x41b7ee);}(_0xe02c,0xae));var _0xce02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe02c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xce02('0x0'));var util=require('util');var moment=require(_0xce02('0x1'));var BPromise=require(_0xce02('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce02('0x3'));var db=require(_0xce02('0x4'))['db'];var utils=require(_0xce02('0x5'));var logger=require('../../config/logger')(_0xce02('0x6'));var config=require(_0xce02('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xce02('0x8')][_0xce02('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x452e11,_0x1cc92f,_0x3f98a0){return new BPromise(function(_0x5086a1,_0x1e9dbe){return client[_0xce02('0xa')](_0x452e11,_0x3f98a0)[_0xce02('0xb')](function(_0x479c8c){logger['info'](_0xce02('0xc'),_0x1cc92f,_0xce02('0xd'));logger[_0xce02('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1cc92f,'request\x20sent',JSON[_0xce02('0xf')](_0x479c8c));if(_0x479c8c[_0xce02('0x10')]){if(_0x479c8c[_0xce02('0x10')]['code']===0x1f4){logger[_0xce02('0x10')](_0xce02('0xc'),_0x1cc92f,_0x479c8c[_0xce02('0x10')][_0xce02('0x11')]);return _0x1e9dbe(_0x479c8c['error'][_0xce02('0x11')]);}logger[_0xce02('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x1cc92f,_0x479c8c['error'][_0xce02('0x11')]);return _0x5086a1(_0x479c8c[_0xce02('0x10')]['message']);}else{logger['info'](_0xce02('0xc'),_0x1cc92f,_0xce02('0xd'));_0x5086a1(_0x479c8c[_0xce02('0x12')]['message']);}})[_0xce02('0x13')](function(_0x4d847d){logger[_0xce02('0x10')](_0xce02('0xc'),_0x1cc92f,_0x4d847d);_0x1e9dbe(_0x4d847d);});});}exports['GetFreshdeskAccount']=function(_0x93ce59){var _0x44d311=this;return new Promise(function(_0x3d546a,_0xd7c86e){return db[_0xce02('0x14')][_0xce02('0x15')]({'raw':_0x93ce59['options']?_0x93ce59[_0xce02('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x93ce59[_0xce02('0x16')]?_0x93ce59[_0xce02('0x16')][_0xce02('0x17')]||null:null,'attributes':_0x93ce59[_0xce02('0x16')]?_0x93ce59['options'][_0xce02('0x18')]||null:null,'limit':_0x93ce59[_0xce02('0x16')]?_0x93ce59[_0xce02('0x16')][_0xce02('0x19')]||null:null,'include':_0x93ce59[_0xce02('0x16')]?_0x93ce59[_0xce02('0x16')][_0xce02('0x1a')]?_[_0xce02('0x1b')](_0x93ce59[_0xce02('0x16')][_0xce02('0x1a')],function(_0x1a32cc){return{'model':db[_0x1a32cc[_0xce02('0x1c')]],'as':_0x1a32cc['as'],'attributes':_0x1a32cc[_0xce02('0x18')],'include':_0x1a32cc[_0xce02('0x1a')]?_[_0xce02('0x1b')](_0x1a32cc[_0xce02('0x1a')],function(_0x330edf){return{'model':db[_0x330edf[_0xce02('0x1c')]],'as':_0x330edf['as'],'attributes':_0x330edf[_0xce02('0x18')],'include':_0x330edf['include']?_[_0xce02('0x1b')](_0x330edf[_0xce02('0x1a')],function(_0xfe3349){return{'model':db[_0xfe3349[_0xce02('0x1c')]],'as':_0xfe3349['as'],'attributes':_0xfe3349[_0xce02('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4011c0){logger[_0xce02('0x1d')](_0xce02('0x1e'),_0x93ce59);logger['debug'](_0xce02('0x1e'),_0x93ce59,JSON['stringify'](_0x4011c0));_0x3d546a(_0x4011c0);})['catch'](function(_0x2a0b4c){logger[_0xce02('0x10')]('GetFreshdeskAccount',_0x2a0b4c['message'],_0x93ce59);_0xd7c86e(_0x44d311[_0xce02('0x10')](0x1f4,_0x2a0b4c[_0xce02('0x11')]));});});};exports[_0xce02('0x1f')]=function(_0x570a0e){var _0x331584=this;return new Promise(function(_0x2f7e97,_0x5d05c9){return db['FreshdeskAccount'][_0xce02('0x20')]({'raw':_0x570a0e[_0xce02('0x16')]?_0x570a0e[_0xce02('0x16')][_0xce02('0x21')]===undefined?!![]:![]:!![],'where':_0x570a0e['options']?_0x570a0e['options'][_0xce02('0x17')]||null:null,'attributes':_0x570a0e[_0xce02('0x16')]?_0x570a0e[_0xce02('0x16')][_0xce02('0x18')]||null:null,'include':_0x570a0e[_0xce02('0x16')]?_0x570a0e[_0xce02('0x16')][_0xce02('0x1a')]?_['map'](_0x570a0e[_0xce02('0x16')][_0xce02('0x1a')],function(_0x3f6d7f){return{'model':db[_0x3f6d7f[_0xce02('0x1c')]],'as':_0x3f6d7f['as'],'attributes':_0x3f6d7f[_0xce02('0x18')],'include':_0x3f6d7f['include']?_[_0xce02('0x1b')](_0x3f6d7f[_0xce02('0x1a')],function(_0x3ad316){return{'model':db[_0x3ad316[_0xce02('0x1c')]],'as':_0x3ad316['as'],'attributes':_0x3ad316[_0xce02('0x18')],'include':_0x3ad316['include']?_[_0xce02('0x1b')](_0x3ad316[_0xce02('0x1a')],function(_0x5dc1fc){return{'model':db[_0x5dc1fc['model']],'as':_0x5dc1fc['as'],'attributes':_0x5dc1fc['attributes']};}):[]};}):[]};}):[]:[]})[_0xce02('0xb')](function(_0x4f8412){logger[_0xce02('0x1d')](_0xce02('0x1f'),_0x570a0e);logger[_0xce02('0xe')](_0xce02('0x1f'),_0x570a0e,JSON['stringify'](_0x4f8412));_0x2f7e97(_0x4f8412);})[_0xce02('0x13')](function(_0xe81009){logger[_0xce02('0x10')](_0xce02('0x1f'),_0xe81009[_0xce02('0x11')],_0x570a0e);_0x5d05c9(_0x331584[_0xce02('0x10')](0x1f4,_0xe81009[_0xce02('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index f01cb4a..3fbba83 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 _0x4335=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getTags','post','/:id/tags','setTags','put','update','destroy','exports','path'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4335,0xfc));var _0x5433=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x4335[_0x54d4a8];return _0x3b321b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5433('0x0'));var timeout=require(_0x5433('0x1'));var express=require(_0x5433('0x2'));var router=express[_0x5433('0x3')]();var fs_extra=require(_0x5433('0x4'));var auth=require(_0x5433('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5433('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x5433('0x7')]('/',auth[_0x5433('0x8')](),controller['index']);router[_0x5433('0x7')](_0x5433('0x9'),auth[_0x5433('0x8')](),controller['show']);router[_0x5433('0x7')](_0x5433('0xa'),auth[_0x5433('0x8')](),controller[_0x5433('0xb')]);router[_0x5433('0x7')](_0x5433('0xc'),auth[_0x5433('0x8')](),controller[_0x5433('0xd')]);router[_0x5433('0x7')](_0x5433('0xe'),auth[_0x5433('0x8')](),controller['getDescriptions']);router[_0x5433('0x7')]('/:id/tags',auth[_0x5433('0x8')](),controller[_0x5433('0xf')]);router[_0x5433('0x10')]('/',auth[_0x5433('0x8')](),controller['create']);router[_0x5433('0x10')](_0x5433('0x11'),auth[_0x5433('0x8')](),controller[_0x5433('0x12')]);router[_0x5433('0x13')](_0x5433('0x9'),auth[_0x5433('0x8')](),controller[_0x5433('0x14')]);router['delete'](_0x5433('0x9'),auth['isAuthenticated'](),controller[_0x5433('0x15')]);module[_0x5433('0x16')]=router; \ No newline at end of file +var _0x0e9c=['destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','create','setTags','put','delete'];(function(_0x1f1a12,_0x316e0a){var _0xcdd82a=function(_0x3fedc0){while(--_0x3fedc0){_0x1f1a12['push'](_0x1f1a12['shift']());}};_0xcdd82a(++_0x316e0a);}(_0x0e9c,0x192));var _0xc0e9=function(_0x13a700,_0x88c174){_0x13a700=_0x13a700-0x0;var _0x3f0dc7=_0x0e9c[_0x13a700];return _0x3f0dc7;};'use strict';var multer=require(_0xc0e9('0x0'));var util=require(_0xc0e9('0x1'));var path=require(_0xc0e9('0x2'));var timeout=require('connect-timeout');var express=require(_0xc0e9('0x3'));var router=express['Router']();var fs_extra=require(_0xc0e9('0x4'));var auth=require(_0xc0e9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc0e9('0x6'));var controller=require(_0xc0e9('0x7'));router[_0xc0e9('0x8')]('/',auth['isAuthenticated'](),controller[_0xc0e9('0x9')]);router[_0xc0e9('0x8')](_0xc0e9('0xa'),auth[_0xc0e9('0xb')](),controller[_0xc0e9('0xc')]);router[_0xc0e9('0x8')](_0xc0e9('0xd'),auth[_0xc0e9('0xb')](),controller[_0xc0e9('0xe')]);router[_0xc0e9('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xc0e9('0xf')]);router['get'](_0xc0e9('0x10'),auth[_0xc0e9('0xb')](),controller[_0xc0e9('0x11')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0xc0e9('0x12')]);router['post']('/',auth[_0xc0e9('0xb')](),controller[_0xc0e9('0x13')]);router['post']('/:id/tags',auth[_0xc0e9('0xb')](),controller[_0xc0e9('0x14')]);router[_0xc0e9('0x15')]('/:id',auth[_0xc0e9('0xb')](),controller['update']);router[_0xc0e9('0x16')](_0xc0e9('0xa'),auth[_0xc0e9('0xb')](),controller[_0xc0e9('0x17')]);module[_0xc0e9('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 7c1c7d0..2371fd9 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 _0x95f2=['exports','STRING','sequelize'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x95f2,0x134));var _0x295f=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0x95f2[_0x4d8666];return _0x37175b;};'use strict';var Sequelize=require(_0x295f('0x0'));module[_0x295f('0x1')]={'name':{'type':Sequelize[_0x295f('0x2')]},'description':{'type':Sequelize[_0x295f('0x2')]}}; \ No newline at end of file +var _0xc53b=['STRING','exports'];(function(_0x56b384,_0xa7c2e0){var _0x2534dc=function(_0x3a32a5){while(--_0x3a32a5){_0x56b384['push'](_0x56b384['shift']());}};_0x2534dc(++_0xa7c2e0);}(_0xc53b,0xdd));var _0xbc53=function(_0x7a6cea,_0x4c1c79){_0x7a6cea=_0x7a6cea-0x0;var _0x268d3b=_0xc53b[_0x7a6cea];return _0x268d3b;};'use strict';var Sequelize=require('sequelize');module[_0xbc53('0x0')]={'name':{'type':Sequelize[_0xbc53('0x1')]},'description':{'type':Sequelize[_0xbc53('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index bb9934c..78ee798 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 _0xc768=['name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','FreshdeskConfiguration','length','find','catch','create','body','getFields','getSubjects','findOne','FreshdeskField','order','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','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','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc768,0x86));var _0x8c76=function(_0x3f1046,_0x5342a2){_0x3f1046=_0x3f1046-0x0;var _0x385a72=_0xc768[_0x3f1046];return _0x385a72;};'use strict';var emlformat=require(_0x8c76('0x0'));var rimraf=require(_0x8c76('0x1'));var zipdir=require(_0x8c76('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c76('0x3'));var moment=require(_0x8c76('0x4'));var BPromise=require(_0x8c76('0x5'));var Mustache=require(_0x8c76('0x6'));var util=require('util');var path=require(_0x8c76('0x7'));var sox=require(_0x8c76('0x8'));var csv=require(_0x8c76('0x9'));var ejs=require(_0x8c76('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8c76('0xb'));var squel=require(_0x8c76('0xc'));var crypto=require(_0x8c76('0xd'));var jsforce=require(_0x8c76('0xe'));var deskjs=require(_0x8c76('0xf'));var toCsv=require(_0x8c76('0x9'));var querystring=require('querystring');var Papa=require(_0x8c76('0x10'));var Redis=require(_0x8c76('0x11'));var authService=require(_0x8c76('0x12'));var qs=require(_0x8c76('0x13'));var as=require(_0x8c76('0x14'));var hardwareService=require(_0x8c76('0x15'));var logger=require(_0x8c76('0x16'))(_0x8c76('0x17'));var utils=require(_0x8c76('0x18'));var config=require(_0x8c76('0x19'));var licenseUtil=require(_0x8c76('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x318032,_0x8cfbe7){_0x8cfbe7=_0x8cfbe7||0xcc;return function(_0x3ce0b5){if(_0x3ce0b5){return _0x318032[_0x8c76('0x1b')](_0x8cfbe7);}return _0x318032[_0x8c76('0x1c')](_0x8cfbe7)['end']();};}function respondWithResult(_0x50ad7f,_0x357aa7){_0x357aa7=_0x357aa7||0xc8;return function(_0x23c79a){if(_0x23c79a){return _0x50ad7f[_0x8c76('0x1c')](_0x357aa7)[_0x8c76('0x1d')](_0x23c79a);}};}function respondWithFilteredResult(_0x280c71,_0x537cab){return function(_0x2e799d){if(_0x2e799d){var _0x2c648c=typeof _0x537cab[_0x8c76('0x1e')]===_0x8c76('0x1f')&&typeof _0x537cab[_0x8c76('0x20')]===_0x8c76('0x1f');var _0x51fa12=_0x2e799d[_0x8c76('0x21')];var _0x5de9a6=_0x2c648c?0x0:_0x537cab[_0x8c76('0x1e')];var _0x258bf1=_0x2c648c?_0x2e799d[_0x8c76('0x21')]:_0x537cab[_0x8c76('0x1e')]+_0x537cab[_0x8c76('0x20')];var _0x2a364e;if(_0x258bf1>=_0x51fa12){_0x258bf1=_0x51fa12;_0x2a364e=0xc8;}else{_0x2a364e=0xce;}_0x280c71[_0x8c76('0x1c')](_0x2a364e);return _0x280c71[_0x8c76('0x22')](_0x8c76('0x23'),_0x5de9a6+'-'+_0x258bf1+'/'+_0x51fa12)['json'](_0x2e799d);}return null;};}function patchUpdates(_0x40867f){return function(_0x2b0bff){try{jsonpatch[_0x8c76('0x24')](_0x2b0bff,_0x40867f,!![]);}catch(_0x356bcb){return BPromise[_0x8c76('0x25')](_0x356bcb);}return _0x2b0bff[_0x8c76('0x26')]();};}function saveUpdates(_0x5ddd7a,_0x31f25d){return function(_0x200239){if(_0x200239){return _0x200239[_0x8c76('0x27')](_0x5ddd7a)[_0x8c76('0x28')](function(_0x5a27c9){return _0x5a27c9;});}return null;};}function removeEntity(_0x5e4c39,_0x21f20e){return function(_0x51ab75){if(_0x51ab75){return _0x51ab75[_0x8c76('0x29')]()[_0x8c76('0x28')](function(){_0x5e4c39[_0x8c76('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x549f1d,_0x1a833d){return function(_0x4b7724){if(!_0x4b7724){_0x549f1d[_0x8c76('0x1b')](0x194);}return _0x4b7724;};}function handleError(_0x42f802,_0x17d688){_0x17d688=_0x17d688||0x1f4;return function(_0x150781){logger[_0x8c76('0x2a')](_0x150781[_0x8c76('0x2b')]);if(_0x150781[_0x8c76('0x2c')]){delete _0x150781[_0x8c76('0x2c')];}_0x42f802[_0x8c76('0x1c')](_0x17d688)[_0x8c76('0x2d')](_0x150781);};}exports[_0x8c76('0x2e')]=function(_0x403e88,_0xfd195c){var _0x2da751={},_0x80d607={},_0x3d1491={'count':0x0,'rows':[]};var _0x196ffa=_['map'](db['FreshdeskConfiguration'][_0x8c76('0x2f')],function(_0xd4f0a4){return{'name':_0xd4f0a4[_0x8c76('0x30')],'type':_0xd4f0a4['type'][_0x8c76('0x31')]};});_0x80d607[_0x8c76('0x32')]=_['map'](_0x196ffa,_0x8c76('0x2c'));_0x80d607[_0x8c76('0x33')]=_[_0x8c76('0x34')](_0x403e88[_0x8c76('0x33')]);_0x80d607[_0x8c76('0x35')]=_['intersection'](_0x80d607[_0x8c76('0x32')],_0x80d607[_0x8c76('0x33')]);_0x2da751[_0x8c76('0x36')]=_[_0x8c76('0x37')](_0x80d607[_0x8c76('0x32')],qs[_0x8c76('0x38')](_0x403e88[_0x8c76('0x33')][_0x8c76('0x38')]));_0x2da751[_0x8c76('0x36')]=_0x2da751[_0x8c76('0x36')]['length']?_0x2da751['attributes']:_0x80d607[_0x8c76('0x32')];if(!_0x403e88[_0x8c76('0x33')][_0x8c76('0x39')](_0x8c76('0x3a'))){_0x2da751[_0x8c76('0x20')]=qs[_0x8c76('0x20')](_0x403e88[_0x8c76('0x33')]['limit']);_0x2da751[_0x8c76('0x1e')]=qs[_0x8c76('0x1e')](_0x403e88[_0x8c76('0x33')]['offset']);}_0x2da751['order']=qs[_0x8c76('0x3b')](_0x403e88[_0x8c76('0x33')][_0x8c76('0x3b')]);_0x2da751[_0x8c76('0x3c')]=qs[_0x8c76('0x35')](_[_0x8c76('0x3d')](_0x403e88[_0x8c76('0x33')],_0x80d607['filters']),_0x196ffa);if(_0x403e88[_0x8c76('0x33')][_0x8c76('0x3e')]){_0x2da751[_0x8c76('0x3c')]=_[_0x8c76('0x3f')](_0x2da751[_0x8c76('0x3c')],{'$or':_[_0x8c76('0x40')](_0x196ffa,function(_0x4d3605){if(_0x4d3605[_0x8c76('0x41')]!==_0x8c76('0x42')){var _0x161b29={};_0x161b29[_0x4d3605[_0x8c76('0x2c')]]={'$like':'%'+_0x403e88['query'][_0x8c76('0x3e')]+'%'};return _0x161b29;}})});}_0x2da751=_['merge']({},_0x2da751,_0x403e88[_0x8c76('0x43')]);var _0x30f399={'where':_0x2da751[_0x8c76('0x3c')]};return db['FreshdeskConfiguration'][_0x8c76('0x21')](_0x30f399)[_0x8c76('0x28')](function(_0x41617f){_0x3d1491[_0x8c76('0x21')]=_0x41617f;if(_0x403e88[_0x8c76('0x33')][_0x8c76('0x44')]){_0x2da751[_0x8c76('0x45')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x8c76('0x46')](_0x2da751);})[_0x8c76('0x28')](function(_0x4a98d2){_0x3d1491[_0x8c76('0x47')]=_0x4a98d2;return _0x3d1491;})[_0x8c76('0x28')](respondWithFilteredResult(_0xfd195c,_0x2da751))['catch'](handleError(_0xfd195c,null));};exports[_0x8c76('0x48')]=function(_0x19df2d,_0x4edf53){var _0x1806a0={'raw':![],'where':{'id':_0x19df2d[_0x8c76('0x49')]['id']}},_0x41cdd={};_0x41cdd['model']=_[_0x8c76('0x34')](db[_0x8c76('0x4a')]['rawAttributes']);_0x41cdd['query']=_[_0x8c76('0x34')](_0x19df2d[_0x8c76('0x33')]);_0x41cdd['filters']=_[_0x8c76('0x37')](_0x41cdd['model'],_0x41cdd[_0x8c76('0x33')]);_0x1806a0[_0x8c76('0x36')]=_[_0x8c76('0x37')](_0x41cdd[_0x8c76('0x32')],qs[_0x8c76('0x38')](_0x19df2d['query']['fields']));_0x1806a0[_0x8c76('0x36')]=_0x1806a0[_0x8c76('0x36')][_0x8c76('0x4b')]?_0x1806a0[_0x8c76('0x36')]:_0x41cdd[_0x8c76('0x32')];if(_0x19df2d[_0x8c76('0x33')][_0x8c76('0x44')]){_0x1806a0[_0x8c76('0x45')]=[{'all':!![]}];}_0x1806a0=_[_0x8c76('0x3f')]({},_0x1806a0,_0x19df2d[_0x8c76('0x43')]);return db[_0x8c76('0x4a')][_0x8c76('0x4c')](_0x1806a0)['then'](handleEntityNotFound(_0x4edf53,null))[_0x8c76('0x28')](respondWithResult(_0x4edf53,null))[_0x8c76('0x4d')](handleError(_0x4edf53,null));};exports[_0x8c76('0x4e')]=function(_0x10a161,_0x3f3196){return db['FreshdeskConfiguration']['create'](_0x10a161['body'],{})[_0x8c76('0x28')](respondWithResult(_0x3f3196,0xc9))['catch'](handleError(_0x3f3196,null));};exports[_0x8c76('0x27')]=function(_0x54902d,_0x141f78){if(_0x54902d[_0x8c76('0x4f')]['id']){delete _0x54902d[_0x8c76('0x4f')]['id'];}return db[_0x8c76('0x4a')][_0x8c76('0x4c')]({'where':{'id':_0x54902d[_0x8c76('0x49')]['id']}})[_0x8c76('0x28')](handleEntityNotFound(_0x141f78,null))[_0x8c76('0x28')](saveUpdates(_0x54902d[_0x8c76('0x4f')],null))[_0x8c76('0x28')](respondWithResult(_0x141f78,null))[_0x8c76('0x4d')](handleError(_0x141f78,null));};exports['destroy']=function(_0x415a52,_0x13828a){return db[_0x8c76('0x4a')][_0x8c76('0x4c')]({'where':{'id':_0x415a52[_0x8c76('0x49')]['id']}})[_0x8c76('0x28')](handleEntityNotFound(_0x13828a,null))['then'](removeEntity(_0x13828a,null))['catch'](handleError(_0x13828a,null));};exports['getFields']=function(_0x14067c,_0x33af8e,_0x2aebb2){var _0xaa0b12={};var _0x365dff={};var _0x432f46;var _0x21b301;return db[_0x8c76('0x4a')]['findOne']({'where':{'id':_0x14067c[_0x8c76('0x49')]['id']}})[_0x8c76('0x28')](handleEntityNotFound(_0x33af8e,null))[_0x8c76('0x28')](function(_0x296007){if(_0x296007){_0x432f46=_0x296007;_0x365dff[_0x8c76('0x32')]=_[_0x8c76('0x34')](db['FreshdeskField']['rawAttributes']);_0x365dff[_0x8c76('0x33')]=_[_0x8c76('0x34')](_0x14067c[_0x8c76('0x33')]);_0x365dff['filters']=_['intersection'](_0x365dff[_0x8c76('0x32')],_0x365dff[_0x8c76('0x33')]);_0xaa0b12[_0x8c76('0x36')]=_[_0x8c76('0x37')](_0x365dff[_0x8c76('0x32')],qs[_0x8c76('0x38')](_0x14067c[_0x8c76('0x33')][_0x8c76('0x38')]));_0xaa0b12[_0x8c76('0x36')]=_0xaa0b12[_0x8c76('0x36')][_0x8c76('0x4b')]?_0xaa0b12[_0x8c76('0x36')]:_0x365dff[_0x8c76('0x32')];_0xaa0b12['order']=qs[_0x8c76('0x3b')](_0x14067c['query'][_0x8c76('0x3b')]);_0xaa0b12[_0x8c76('0x3c')]=qs[_0x8c76('0x35')](_[_0x8c76('0x3d')](_0x14067c[_0x8c76('0x33')],_0x365dff[_0x8c76('0x35')]));if(_0x14067c[_0x8c76('0x33')][_0x8c76('0x3e')]){_0xaa0b12[_0x8c76('0x3c')]=_[_0x8c76('0x3f')](_0xaa0b12[_0x8c76('0x3c')],{'$or':_[_0x8c76('0x40')](_0xaa0b12[_0x8c76('0x36')],function(_0x2d925a){var _0x410418={};_0x410418[_0x2d925a]={'$like':'%'+_0x14067c[_0x8c76('0x33')][_0x8c76('0x3e')]+'%'};return _0x410418;})});}_0xaa0b12=_[_0x8c76('0x3f')]({},_0xaa0b12,_0x14067c['options']);return _0x432f46[_0x8c76('0x50')](_0xaa0b12);}})[_0x8c76('0x28')](function(_0x2e3135){if(_0x2e3135){_0x21b301=_0x2e3135['length'];if(!_0x14067c[_0x8c76('0x33')]['hasOwnProperty'](_0x8c76('0x3a'))){_0xaa0b12['limit']=qs[_0x8c76('0x20')](_0x14067c[_0x8c76('0x33')][_0x8c76('0x20')]);_0xaa0b12[_0x8c76('0x1e')]=qs[_0x8c76('0x1e')](_0x14067c[_0x8c76('0x33')][_0x8c76('0x1e')]);}return _0x432f46[_0x8c76('0x50')](_0xaa0b12);}})[_0x8c76('0x28')](function(_0x497eee){if(_0x497eee){return _0x497eee?{'count':_0x21b301,'rows':_0x497eee}:null;}})[_0x8c76('0x28')](respondWithResult(_0x33af8e,null))[_0x8c76('0x4d')](handleError(_0x33af8e,null));};exports[_0x8c76('0x51')]=function(_0x4eda48,_0x302632,_0xa343be){var _0xe90fc6={};var _0x2940c4={};var _0x17eb0e;var _0x18c80b;return db[_0x8c76('0x4a')][_0x8c76('0x52')]({'where':{'id':_0x4eda48[_0x8c76('0x49')]['id']}})[_0x8c76('0x28')](handleEntityNotFound(_0x302632,null))[_0x8c76('0x28')](function(_0x4f076a){if(_0x4f076a){_0x17eb0e=_0x4f076a;_0x2940c4[_0x8c76('0x32')]=_[_0x8c76('0x34')](db[_0x8c76('0x53')][_0x8c76('0x2f')]);_0x2940c4[_0x8c76('0x33')]=_[_0x8c76('0x34')](_0x4eda48[_0x8c76('0x33')]);_0x2940c4['filters']=_['intersection'](_0x2940c4[_0x8c76('0x32')],_0x2940c4['query']);_0xe90fc6[_0x8c76('0x36')]=_['intersection'](_0x2940c4['model'],qs[_0x8c76('0x38')](_0x4eda48[_0x8c76('0x33')][_0x8c76('0x38')]));_0xe90fc6[_0x8c76('0x36')]=_0xe90fc6[_0x8c76('0x36')][_0x8c76('0x4b')]?_0xe90fc6['attributes']:_0x2940c4['model'];_0xe90fc6['order']=qs[_0x8c76('0x3b')](_0x4eda48['query']['sort']);_0xe90fc6['where']=qs[_0x8c76('0x35')](_['pick'](_0x4eda48[_0x8c76('0x33')],_0x2940c4[_0x8c76('0x35')]));if(_0x4eda48[_0x8c76('0x33')][_0x8c76('0x3e')]){_0xe90fc6['where']=_[_0x8c76('0x3f')](_0xe90fc6[_0x8c76('0x3c')],{'$or':_[_0x8c76('0x40')](_0xe90fc6['attributes'],function(_0x35a32f){var _0x27ee94={};_0x27ee94[_0x35a32f]={'$like':'%'+_0x4eda48['query'][_0x8c76('0x3e')]+'%'};return _0x27ee94;})});}_0xe90fc6=_[_0x8c76('0x3f')]({},_0xe90fc6,_0x4eda48[_0x8c76('0x43')]);return _0x17eb0e[_0x8c76('0x51')](_0xe90fc6);}})[_0x8c76('0x28')](function(_0x2204e1){if(_0x2204e1){_0x18c80b=_0x2204e1[_0x8c76('0x4b')];if(!_0x4eda48['query'][_0x8c76('0x39')](_0x8c76('0x3a'))){_0xe90fc6['limit']=qs['limit'](_0x4eda48['query'][_0x8c76('0x20')]);_0xe90fc6[_0x8c76('0x1e')]=qs[_0x8c76('0x1e')](_0x4eda48[_0x8c76('0x33')][_0x8c76('0x1e')]);}return _0x17eb0e['getSubjects'](_0xe90fc6);}})[_0x8c76('0x28')](function(_0x148649){if(_0x148649){return _0x148649?{'count':_0x18c80b,'rows':_0x148649}:null;}})[_0x8c76('0x28')](respondWithResult(_0x302632,null))[_0x8c76('0x4d')](handleError(_0x302632,null));};exports['getDescriptions']=function(_0x6f5fd0,_0x43256f,_0xbdab){var _0x558867={};var _0x2c6de4={};var _0x5035bd;var _0x4b7cd7;return db['FreshdeskConfiguration'][_0x8c76('0x52')]({'where':{'id':_0x6f5fd0['params']['id']}})['then'](handleEntityNotFound(_0x43256f,null))['then'](function(_0x572f34){if(_0x572f34){_0x5035bd=_0x572f34;_0x2c6de4[_0x8c76('0x32')]=_['keys'](db[_0x8c76('0x53')]['rawAttributes']);_0x2c6de4[_0x8c76('0x33')]=_['keys'](_0x6f5fd0['query']);_0x2c6de4[_0x8c76('0x35')]=_[_0x8c76('0x37')](_0x2c6de4['model'],_0x2c6de4[_0x8c76('0x33')]);_0x558867[_0x8c76('0x36')]=_[_0x8c76('0x37')](_0x2c6de4[_0x8c76('0x32')],qs['fields'](_0x6f5fd0[_0x8c76('0x33')][_0x8c76('0x38')]));_0x558867[_0x8c76('0x36')]=_0x558867[_0x8c76('0x36')]['length']?_0x558867[_0x8c76('0x36')]:_0x2c6de4[_0x8c76('0x32')];_0x558867[_0x8c76('0x54')]=qs['sort'](_0x6f5fd0['query'][_0x8c76('0x3b')]);_0x558867['where']=qs[_0x8c76('0x35')](_[_0x8c76('0x3d')](_0x6f5fd0[_0x8c76('0x33')],_0x2c6de4['filters']));if(_0x6f5fd0['query'][_0x8c76('0x3e')]){_0x558867[_0x8c76('0x3c')]=_['merge'](_0x558867['where'],{'$or':_[_0x8c76('0x40')](_0x558867['attributes'],function(_0x5927d3){var _0xaf63e0={};_0xaf63e0[_0x5927d3]={'$like':'%'+_0x6f5fd0[_0x8c76('0x33')][_0x8c76('0x3e')]+'%'};return _0xaf63e0;})});}_0x558867=_[_0x8c76('0x3f')]({},_0x558867,_0x6f5fd0[_0x8c76('0x43')]);return _0x5035bd[_0x8c76('0x55')](_0x558867);}})['then'](function(_0x33847f){if(_0x33847f){_0x4b7cd7=_0x33847f[_0x8c76('0x4b')];if(!_0x6f5fd0[_0x8c76('0x33')][_0x8c76('0x39')](_0x8c76('0x3a'))){_0x558867[_0x8c76('0x20')]=qs[_0x8c76('0x20')](_0x6f5fd0[_0x8c76('0x33')][_0x8c76('0x20')]);_0x558867[_0x8c76('0x1e')]=qs[_0x8c76('0x1e')](_0x6f5fd0[_0x8c76('0x33')]['offset']);}return _0x5035bd['getDescriptions'](_0x558867);}})['then'](function(_0x2c0af3){if(_0x2c0af3){return _0x2c0af3?{'count':_0x4b7cd7,'rows':_0x2c0af3}:null;}})[_0x8c76('0x28')](respondWithResult(_0x43256f,null))['catch'](handleError(_0x43256f,null));};exports[_0x8c76('0x56')]=function(_0x35bf74,_0x11b7aa,_0x29e822){var _0x1d122d={};var _0x1f600a={};var _0x19fd72;var _0x3bb761;return db[_0x8c76('0x4a')]['findOne']({'where':{'id':_0x35bf74['params']['id']}})['then'](handleEntityNotFound(_0x11b7aa,null))[_0x8c76('0x28')](function(_0x10e6fb){if(_0x10e6fb){_0x19fd72=_0x10e6fb;_0x1f600a['model']=_[_0x8c76('0x34')](db[_0x8c76('0x57')][_0x8c76('0x2f')]);_0x1f600a[_0x8c76('0x33')]=_['keys'](_0x35bf74[_0x8c76('0x33')]);_0x1f600a['filters']=_[_0x8c76('0x37')](_0x1f600a[_0x8c76('0x32')],_0x1f600a[_0x8c76('0x33')]);_0x1d122d[_0x8c76('0x36')]=_[_0x8c76('0x37')](_0x1f600a[_0x8c76('0x32')],qs[_0x8c76('0x38')](_0x35bf74[_0x8c76('0x33')][_0x8c76('0x38')]));_0x1d122d['attributes']=_0x1d122d['attributes'][_0x8c76('0x4b')]?_0x1d122d['attributes']:_0x1f600a['model'];_0x1d122d[_0x8c76('0x54')]=qs[_0x8c76('0x3b')](_0x35bf74[_0x8c76('0x33')]['sort']);_0x1d122d['where']=qs[_0x8c76('0x35')](_[_0x8c76('0x3d')](_0x35bf74['query'],_0x1f600a['filters']));if(_0x35bf74[_0x8c76('0x33')][_0x8c76('0x3e')]){_0x1d122d['where']=_[_0x8c76('0x3f')](_0x1d122d['where'],{'$or':_[_0x8c76('0x40')](_0x1d122d[_0x8c76('0x36')],function(_0x1f3c08){var _0x520fee={};_0x520fee[_0x1f3c08]={'$like':'%'+_0x35bf74[_0x8c76('0x33')][_0x8c76('0x3e')]+'%'};return _0x520fee;})});}_0x1d122d=_['merge']({},_0x1d122d,_0x35bf74['options']);return _0x19fd72[_0x8c76('0x56')](_0x1d122d);}})[_0x8c76('0x28')](function(_0x50256a){if(_0x50256a){_0x3bb761=_0x50256a[_0x8c76('0x4b')];if(!_0x35bf74[_0x8c76('0x33')][_0x8c76('0x39')](_0x8c76('0x3a'))){_0x1d122d['limit']=qs[_0x8c76('0x20')](_0x35bf74[_0x8c76('0x33')][_0x8c76('0x20')]);_0x1d122d[_0x8c76('0x1e')]=qs[_0x8c76('0x1e')](_0x35bf74[_0x8c76('0x33')][_0x8c76('0x1e')]);}return _0x19fd72[_0x8c76('0x56')](_0x1d122d);}})['then'](function(_0x4163b4){if(_0x4163b4){return _0x4163b4?{'count':_0x3bb761,'rows':_0x4163b4}:null;}})['then'](respondWithResult(_0x11b7aa,null))[_0x8c76('0x4d')](handleError(_0x11b7aa,null));};exports[_0x8c76('0x58')]=function(_0x4e2af9,_0x3da8f4,_0x5e3605){if(_0x4e2af9['body']['id']){delete _0x4e2af9['body']['id'];}return db[_0x8c76('0x4a')][_0x8c76('0x52')]({'where':{'id':_0x4e2af9[_0x8c76('0x49')]['id']}})['then'](handleEntityNotFound(_0x3da8f4,null))['then'](function(_0x3e07e8){if(_0x3e07e8){return _0x3e07e8['setTags'](_0x4e2af9[_0x8c76('0x4f')]['ids']||[]);}return null;})['then'](respondWithResult(_0x3da8f4,null))['catch'](handleError(_0x3da8f4,null));}; \ No newline at end of file +var _0xf57f=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','FreshdeskConfiguration','find','create','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','Tag','getTags','setTags','eml-format','rimraf','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/license/hardware','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x16a101,_0x12caba){var _0x47b258=function(_0x1d4a8b){while(--_0x1d4a8b){_0x16a101['push'](_0x16a101['shift']());}};_0x47b258(++_0x12caba);}(_0xf57f,0x194));var _0xff57=function(_0x562ec5,_0x36b5a4){_0x562ec5=_0x562ec5-0x0;var _0x279c8c=_0xf57f[_0x562ec5];return _0x279c8c;};'use strict';var emlformat=require(_0xff57('0x0'));var rimraf=require(_0xff57('0x1'));var zipdir=require(_0xff57('0x2'));var jsonpatch=require(_0xff57('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xff57('0x4'));var Mustache=require(_0xff57('0x5'));var util=require(_0xff57('0x6'));var path=require(_0xff57('0x7'));var sox=require(_0xff57('0x8'));var csv=require(_0xff57('0x9'));var ejs=require(_0xff57('0xa'));var fs=require('fs');var fs_extra=require(_0xff57('0xb'));var _=require(_0xff57('0xc'));var squel=require('squel');var crypto=require(_0xff57('0xd'));var jsforce=require(_0xff57('0xe'));var deskjs=require(_0xff57('0xf'));var toCsv=require(_0xff57('0x9'));var querystring=require(_0xff57('0x10'));var Papa=require(_0xff57('0x11'));var Redis=require(_0xff57('0x12'));var authService=require(_0xff57('0x13'));var qs=require(_0xff57('0x14'));var as=require(_0xff57('0x15'));var hardwareService=require(_0xff57('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xff57('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff57('0x18'));var db=require(_0xff57('0x19'))['db'];function respondWithStatusCode(_0x58adb1,_0x20d045){_0x20d045=_0x20d045||0xcc;return function(_0x2e7574){if(_0x2e7574){return _0x58adb1[_0xff57('0x1a')](_0x20d045);}return _0x58adb1[_0xff57('0x1b')](_0x20d045)[_0xff57('0x1c')]();};}function respondWithResult(_0x216855,_0x374360){_0x374360=_0x374360||0xc8;return function(_0xba544b){if(_0xba544b){return _0x216855[_0xff57('0x1b')](_0x374360)['json'](_0xba544b);}};}function respondWithFilteredResult(_0x4bcced,_0xe9e3eb){return function(_0x1a9848){if(_0x1a9848){var _0x1a8baa=typeof _0xe9e3eb[_0xff57('0x1d')]===_0xff57('0x1e')&&typeof _0xe9e3eb[_0xff57('0x1f')]==='undefined';var _0x5b7c44=_0x1a9848['count'];var _0x4bb88e=_0x1a8baa?0x0:_0xe9e3eb[_0xff57('0x1d')];var _0x5b55e1=_0x1a8baa?_0x1a9848[_0xff57('0x20')]:_0xe9e3eb['offset']+_0xe9e3eb[_0xff57('0x1f')];var _0x366e3c;if(_0x5b55e1>=_0x5b7c44){_0x5b55e1=_0x5b7c44;_0x366e3c=0xc8;}else{_0x366e3c=0xce;}_0x4bcced['status'](_0x366e3c);return _0x4bcced[_0xff57('0x21')](_0xff57('0x22'),_0x4bb88e+'-'+_0x5b55e1+'/'+_0x5b7c44)[_0xff57('0x23')](_0x1a9848);}return null;};}function patchUpdates(_0x2a2d16){return function(_0x3c63bc){try{jsonpatch['apply'](_0x3c63bc,_0x2a2d16,!![]);}catch(_0x31bd77){return BPromise[_0xff57('0x24')](_0x31bd77);}return _0x3c63bc[_0xff57('0x25')]();};}function saveUpdates(_0x3f2ec1,_0x337891){return function(_0x177432){if(_0x177432){return _0x177432[_0xff57('0x26')](_0x3f2ec1)['then'](function(_0x594613){return _0x594613;});}return null;};}function removeEntity(_0x420332,_0x50a8af){return function(_0x2f6be6){if(_0x2f6be6){return _0x2f6be6[_0xff57('0x27')]()[_0xff57('0x28')](function(){_0x420332[_0xff57('0x1b')](0xcc)[_0xff57('0x1c')]();});}};}function handleEntityNotFound(_0x227e5a,_0x3f02fd){return function(_0x1b86d2){if(!_0x1b86d2){_0x227e5a[_0xff57('0x1a')](0x194);}return _0x1b86d2;};}function handleError(_0x10c52b,_0x41d477){_0x41d477=_0x41d477||0x1f4;return function(_0x2fdb85){logger[_0xff57('0x29')](_0x2fdb85[_0xff57('0x2a')]);if(_0x2fdb85[_0xff57('0x2b')]){delete _0x2fdb85[_0xff57('0x2b')];}_0x10c52b[_0xff57('0x1b')](_0x41d477)[_0xff57('0x2c')](_0x2fdb85);};}exports[_0xff57('0x2d')]=function(_0x129013,_0x84e055){var _0x292f68={},_0x3941e0={},_0x2138ad={'count':0x0,'rows':[]};var _0x3664ae=_['map'](db['FreshdeskConfiguration'][_0xff57('0x2e')],function(_0x1cf7b1){return{'name':_0x1cf7b1['fieldName'],'type':_0x1cf7b1[_0xff57('0x2f')][_0xff57('0x30')]};});_0x3941e0[_0xff57('0x31')]=_[_0xff57('0x32')](_0x3664ae,'name');_0x3941e0[_0xff57('0x33')]=_['keys'](_0x129013[_0xff57('0x33')]);_0x3941e0[_0xff57('0x34')]=_[_0xff57('0x35')](_0x3941e0['model'],_0x3941e0[_0xff57('0x33')]);_0x292f68[_0xff57('0x36')]=_[_0xff57('0x35')](_0x3941e0[_0xff57('0x31')],qs[_0xff57('0x37')](_0x129013[_0xff57('0x33')]['fields']));_0x292f68['attributes']=_0x292f68[_0xff57('0x36')][_0xff57('0x38')]?_0x292f68[_0xff57('0x36')]:_0x3941e0[_0xff57('0x31')];if(!_0x129013[_0xff57('0x33')][_0xff57('0x39')](_0xff57('0x3a'))){_0x292f68[_0xff57('0x1f')]=qs[_0xff57('0x1f')](_0x129013['query'][_0xff57('0x1f')]);_0x292f68[_0xff57('0x1d')]=qs[_0xff57('0x1d')](_0x129013[_0xff57('0x33')][_0xff57('0x1d')]);}_0x292f68[_0xff57('0x3b')]=qs[_0xff57('0x3c')](_0x129013[_0xff57('0x33')][_0xff57('0x3c')]);_0x292f68[_0xff57('0x3d')]=qs['filters'](_[_0xff57('0x3e')](_0x129013[_0xff57('0x33')],_0x3941e0['filters']),_0x3664ae);if(_0x129013[_0xff57('0x33')]['filter']){_0x292f68[_0xff57('0x3d')]=_[_0xff57('0x3f')](_0x292f68[_0xff57('0x3d')],{'$or':_[_0xff57('0x32')](_0x3664ae,function(_0x1f50f6){if(_0x1f50f6['type']!==_0xff57('0x40')){var _0x12d532={};_0x12d532[_0x1f50f6[_0xff57('0x2b')]]={'$like':'%'+_0x129013[_0xff57('0x33')][_0xff57('0x41')]+'%'};return _0x12d532;}})});}_0x292f68=_[_0xff57('0x3f')]({},_0x292f68,_0x129013[_0xff57('0x42')]);var _0x200820={'where':_0x292f68[_0xff57('0x3d')]};return db['FreshdeskConfiguration']['count'](_0x200820)[_0xff57('0x28')](function(_0x42c924){_0x2138ad['count']=_0x42c924;if(_0x129013['query'][_0xff57('0x43')]){_0x292f68[_0xff57('0x44')]=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x292f68);})[_0xff57('0x28')](function(_0x48adba){_0x2138ad[_0xff57('0x45')]=_0x48adba;return _0x2138ad;})['then'](respondWithFilteredResult(_0x84e055,_0x292f68))[_0xff57('0x46')](handleError(_0x84e055,null));};exports[_0xff57('0x47')]=function(_0x1d2015,_0x2a476c){var _0xe0753f={'raw':![],'where':{'id':_0x1d2015[_0xff57('0x48')]['id']}},_0x4b9afc={};_0x4b9afc['model']=_[_0xff57('0x49')](db[_0xff57('0x4a')][_0xff57('0x2e')]);_0x4b9afc[_0xff57('0x33')]=_['keys'](_0x1d2015['query']);_0x4b9afc[_0xff57('0x34')]=_[_0xff57('0x35')](_0x4b9afc[_0xff57('0x31')],_0x4b9afc[_0xff57('0x33')]);_0xe0753f[_0xff57('0x36')]=_[_0xff57('0x35')](_0x4b9afc[_0xff57('0x31')],qs[_0xff57('0x37')](_0x1d2015[_0xff57('0x33')][_0xff57('0x37')]));_0xe0753f[_0xff57('0x36')]=_0xe0753f[_0xff57('0x36')][_0xff57('0x38')]?_0xe0753f['attributes']:_0x4b9afc[_0xff57('0x31')];if(_0x1d2015[_0xff57('0x33')][_0xff57('0x43')]){_0xe0753f[_0xff57('0x44')]=[{'all':!![]}];}_0xe0753f=_[_0xff57('0x3f')]({},_0xe0753f,_0x1d2015[_0xff57('0x42')]);return db[_0xff57('0x4a')][_0xff57('0x4b')](_0xe0753f)['then'](handleEntityNotFound(_0x2a476c,null))[_0xff57('0x28')](respondWithResult(_0x2a476c,null))[_0xff57('0x46')](handleError(_0x2a476c,null));};exports[_0xff57('0x4c')]=function(_0x117ff2,_0x4745f2){return db[_0xff57('0x4a')][_0xff57('0x4c')](_0x117ff2[_0xff57('0x4d')],{})[_0xff57('0x28')](respondWithResult(_0x4745f2,0xc9))[_0xff57('0x46')](handleError(_0x4745f2,null));};exports[_0xff57('0x26')]=function(_0x1cd538,_0x585b5b){if(_0x1cd538['body']['id']){delete _0x1cd538[_0xff57('0x4d')]['id'];}return db[_0xff57('0x4a')][_0xff57('0x4b')]({'where':{'id':_0x1cd538[_0xff57('0x48')]['id']}})['then'](handleEntityNotFound(_0x585b5b,null))[_0xff57('0x28')](saveUpdates(_0x1cd538[_0xff57('0x4d')],null))[_0xff57('0x28')](respondWithResult(_0x585b5b,null))['catch'](handleError(_0x585b5b,null));};exports[_0xff57('0x27')]=function(_0xad5c8a,_0x46d09d){return db[_0xff57('0x4a')][_0xff57('0x4b')]({'where':{'id':_0xad5c8a['params']['id']}})['then'](handleEntityNotFound(_0x46d09d,null))[_0xff57('0x28')](removeEntity(_0x46d09d,null))[_0xff57('0x46')](handleError(_0x46d09d,null));};exports[_0xff57('0x4e')]=function(_0x18add1,_0x2b1f92,_0x1b9806){var _0x277aa9={};var _0x33c0f6={};var _0x498d74;var _0x345ad2;return db[_0xff57('0x4a')][_0xff57('0x4f')]({'where':{'id':_0x18add1[_0xff57('0x48')]['id']}})[_0xff57('0x28')](handleEntityNotFound(_0x2b1f92,null))['then'](function(_0x2894e4){if(_0x2894e4){_0x498d74=_0x2894e4;_0x33c0f6['model']=_[_0xff57('0x49')](db[_0xff57('0x50')][_0xff57('0x2e')]);_0x33c0f6['query']=_[_0xff57('0x49')](_0x18add1[_0xff57('0x33')]);_0x33c0f6['filters']=_[_0xff57('0x35')](_0x33c0f6[_0xff57('0x31')],_0x33c0f6[_0xff57('0x33')]);_0x277aa9['attributes']=_[_0xff57('0x35')](_0x33c0f6[_0xff57('0x31')],qs[_0xff57('0x37')](_0x18add1[_0xff57('0x33')]['fields']));_0x277aa9[_0xff57('0x36')]=_0x277aa9[_0xff57('0x36')][_0xff57('0x38')]?_0x277aa9[_0xff57('0x36')]:_0x33c0f6[_0xff57('0x31')];_0x277aa9[_0xff57('0x3b')]=qs[_0xff57('0x3c')](_0x18add1[_0xff57('0x33')][_0xff57('0x3c')]);_0x277aa9[_0xff57('0x3d')]=qs[_0xff57('0x34')](_['pick'](_0x18add1[_0xff57('0x33')],_0x33c0f6['filters']));if(_0x18add1['query'][_0xff57('0x41')]){_0x277aa9[_0xff57('0x3d')]=_[_0xff57('0x3f')](_0x277aa9[_0xff57('0x3d')],{'$or':_['map'](_0x277aa9[_0xff57('0x36')],function(_0x1f3a7b){var _0x2e7f1c={};_0x2e7f1c[_0x1f3a7b]={'$like':'%'+_0x18add1['query'][_0xff57('0x41')]+'%'};return _0x2e7f1c;})});}_0x277aa9=_[_0xff57('0x3f')]({},_0x277aa9,_0x18add1[_0xff57('0x42')]);return _0x498d74[_0xff57('0x4e')](_0x277aa9);}})['then'](function(_0x296bb4){if(_0x296bb4){_0x345ad2=_0x296bb4['length'];if(!_0x18add1[_0xff57('0x33')]['hasOwnProperty']('nolimit')){_0x277aa9['limit']=qs[_0xff57('0x1f')](_0x18add1[_0xff57('0x33')][_0xff57('0x1f')]);_0x277aa9[_0xff57('0x1d')]=qs['offset'](_0x18add1[_0xff57('0x33')]['offset']);}return _0x498d74[_0xff57('0x4e')](_0x277aa9);}})[_0xff57('0x28')](function(_0x3753f6){if(_0x3753f6){return _0x3753f6?{'count':_0x345ad2,'rows':_0x3753f6}:null;}})[_0xff57('0x28')](respondWithResult(_0x2b1f92,null))[_0xff57('0x46')](handleError(_0x2b1f92,null));};exports[_0xff57('0x51')]=function(_0x44f4e5,_0x180246,_0x1b49eb){var _0x749896={};var _0x45dc42={};var _0x44f88b;var _0x1d3fb4;return db[_0xff57('0x4a')]['findOne']({'where':{'id':_0x44f4e5[_0xff57('0x48')]['id']}})['then'](handleEntityNotFound(_0x180246,null))[_0xff57('0x28')](function(_0x52bf7d){if(_0x52bf7d){_0x44f88b=_0x52bf7d;_0x45dc42[_0xff57('0x31')]=_[_0xff57('0x49')](db[_0xff57('0x50')][_0xff57('0x2e')]);_0x45dc42[_0xff57('0x33')]=_[_0xff57('0x49')](_0x44f4e5[_0xff57('0x33')]);_0x45dc42[_0xff57('0x34')]=_[_0xff57('0x35')](_0x45dc42[_0xff57('0x31')],_0x45dc42['query']);_0x749896['attributes']=_[_0xff57('0x35')](_0x45dc42[_0xff57('0x31')],qs['fields'](_0x44f4e5['query'][_0xff57('0x37')]));_0x749896['attributes']=_0x749896[_0xff57('0x36')][_0xff57('0x38')]?_0x749896[_0xff57('0x36')]:_0x45dc42[_0xff57('0x31')];_0x749896[_0xff57('0x3b')]=qs['sort'](_0x44f4e5[_0xff57('0x33')][_0xff57('0x3c')]);_0x749896[_0xff57('0x3d')]=qs[_0xff57('0x34')](_[_0xff57('0x3e')](_0x44f4e5[_0xff57('0x33')],_0x45dc42['filters']));if(_0x44f4e5[_0xff57('0x33')][_0xff57('0x41')]){_0x749896[_0xff57('0x3d')]=_['merge'](_0x749896['where'],{'$or':_[_0xff57('0x32')](_0x749896[_0xff57('0x36')],function(_0x33bd75){var _0x3ca16d={};_0x3ca16d[_0x33bd75]={'$like':'%'+_0x44f4e5[_0xff57('0x33')][_0xff57('0x41')]+'%'};return _0x3ca16d;})});}_0x749896=_[_0xff57('0x3f')]({},_0x749896,_0x44f4e5[_0xff57('0x42')]);return _0x44f88b['getSubjects'](_0x749896);}})[_0xff57('0x28')](function(_0x94f35b){if(_0x94f35b){_0x1d3fb4=_0x94f35b[_0xff57('0x38')];if(!_0x44f4e5[_0xff57('0x33')]['hasOwnProperty']('nolimit')){_0x749896[_0xff57('0x1f')]=qs[_0xff57('0x1f')](_0x44f4e5['query']['limit']);_0x749896[_0xff57('0x1d')]=qs[_0xff57('0x1d')](_0x44f4e5[_0xff57('0x33')][_0xff57('0x1d')]);}return _0x44f88b['getSubjects'](_0x749896);}})[_0xff57('0x28')](function(_0x3c11db){if(_0x3c11db){return _0x3c11db?{'count':_0x1d3fb4,'rows':_0x3c11db}:null;}})[_0xff57('0x28')](respondWithResult(_0x180246,null))[_0xff57('0x46')](handleError(_0x180246,null));};exports[_0xff57('0x52')]=function(_0x231793,_0x4d629e,_0x60a130){var _0xc828a8={};var _0x28b173={};var _0x2b169c;var _0x51e1b3;return db[_0xff57('0x4a')][_0xff57('0x4f')]({'where':{'id':_0x231793[_0xff57('0x48')]['id']}})[_0xff57('0x28')](handleEntityNotFound(_0x4d629e,null))[_0xff57('0x28')](function(_0x52c2c3){if(_0x52c2c3){_0x2b169c=_0x52c2c3;_0x28b173[_0xff57('0x31')]=_[_0xff57('0x49')](db[_0xff57('0x50')]['rawAttributes']);_0x28b173[_0xff57('0x33')]=_[_0xff57('0x49')](_0x231793[_0xff57('0x33')]);_0x28b173[_0xff57('0x34')]=_['intersection'](_0x28b173['model'],_0x28b173[_0xff57('0x33')]);_0xc828a8[_0xff57('0x36')]=_[_0xff57('0x35')](_0x28b173[_0xff57('0x31')],qs[_0xff57('0x37')](_0x231793[_0xff57('0x33')][_0xff57('0x37')]));_0xc828a8[_0xff57('0x36')]=_0xc828a8[_0xff57('0x36')][_0xff57('0x38')]?_0xc828a8[_0xff57('0x36')]:_0x28b173['model'];_0xc828a8['order']=qs[_0xff57('0x3c')](_0x231793['query'][_0xff57('0x3c')]);_0xc828a8[_0xff57('0x3d')]=qs[_0xff57('0x34')](_['pick'](_0x231793[_0xff57('0x33')],_0x28b173[_0xff57('0x34')]));if(_0x231793[_0xff57('0x33')][_0xff57('0x41')]){_0xc828a8[_0xff57('0x3d')]=_[_0xff57('0x3f')](_0xc828a8[_0xff57('0x3d')],{'$or':_[_0xff57('0x32')](_0xc828a8[_0xff57('0x36')],function(_0x1262bd){var _0x5afffd={};_0x5afffd[_0x1262bd]={'$like':'%'+_0x231793['query'][_0xff57('0x41')]+'%'};return _0x5afffd;})});}_0xc828a8=_[_0xff57('0x3f')]({},_0xc828a8,_0x231793[_0xff57('0x42')]);return _0x2b169c['getDescriptions'](_0xc828a8);}})[_0xff57('0x28')](function(_0x17dd2a){if(_0x17dd2a){_0x51e1b3=_0x17dd2a['length'];if(!_0x231793['query'][_0xff57('0x39')]('nolimit')){_0xc828a8[_0xff57('0x1f')]=qs[_0xff57('0x1f')](_0x231793['query']['limit']);_0xc828a8[_0xff57('0x1d')]=qs[_0xff57('0x1d')](_0x231793[_0xff57('0x33')]['offset']);}return _0x2b169c[_0xff57('0x52')](_0xc828a8);}})[_0xff57('0x28')](function(_0x24dfed){if(_0x24dfed){return _0x24dfed?{'count':_0x51e1b3,'rows':_0x24dfed}:null;}})[_0xff57('0x28')](respondWithResult(_0x4d629e,null))[_0xff57('0x46')](handleError(_0x4d629e,null));};exports['getTags']=function(_0x1a7f55,_0x552958,_0x1dbb56){var _0x2a4865={};var _0x9f69b6={};var _0x4a6d1f;var _0x326b1c;return db[_0xff57('0x4a')][_0xff57('0x4f')]({'where':{'id':_0x1a7f55[_0xff57('0x48')]['id']}})[_0xff57('0x28')](handleEntityNotFound(_0x552958,null))[_0xff57('0x28')](function(_0x16df36){if(_0x16df36){_0x4a6d1f=_0x16df36;_0x9f69b6[_0xff57('0x31')]=_['keys'](db[_0xff57('0x53')][_0xff57('0x2e')]);_0x9f69b6[_0xff57('0x33')]=_[_0xff57('0x49')](_0x1a7f55[_0xff57('0x33')]);_0x9f69b6['filters']=_['intersection'](_0x9f69b6[_0xff57('0x31')],_0x9f69b6['query']);_0x2a4865['attributes']=_[_0xff57('0x35')](_0x9f69b6[_0xff57('0x31')],qs[_0xff57('0x37')](_0x1a7f55[_0xff57('0x33')]['fields']));_0x2a4865['attributes']=_0x2a4865[_0xff57('0x36')][_0xff57('0x38')]?_0x2a4865['attributes']:_0x9f69b6['model'];_0x2a4865['order']=qs[_0xff57('0x3c')](_0x1a7f55[_0xff57('0x33')][_0xff57('0x3c')]);_0x2a4865[_0xff57('0x3d')]=qs[_0xff57('0x34')](_[_0xff57('0x3e')](_0x1a7f55['query'],_0x9f69b6['filters']));if(_0x1a7f55['query'][_0xff57('0x41')]){_0x2a4865[_0xff57('0x3d')]=_['merge'](_0x2a4865['where'],{'$or':_[_0xff57('0x32')](_0x2a4865[_0xff57('0x36')],function(_0x15df1d){var _0x2b5bf8={};_0x2b5bf8[_0x15df1d]={'$like':'%'+_0x1a7f55[_0xff57('0x33')][_0xff57('0x41')]+'%'};return _0x2b5bf8;})});}_0x2a4865=_['merge']({},_0x2a4865,_0x1a7f55[_0xff57('0x42')]);return _0x4a6d1f[_0xff57('0x54')](_0x2a4865);}})['then'](function(_0x32088f){if(_0x32088f){_0x326b1c=_0x32088f[_0xff57('0x38')];if(!_0x1a7f55[_0xff57('0x33')][_0xff57('0x39')]('nolimit')){_0x2a4865[_0xff57('0x1f')]=qs[_0xff57('0x1f')](_0x1a7f55[_0xff57('0x33')][_0xff57('0x1f')]);_0x2a4865[_0xff57('0x1d')]=qs[_0xff57('0x1d')](_0x1a7f55['query']['offset']);}return _0x4a6d1f[_0xff57('0x54')](_0x2a4865);}})[_0xff57('0x28')](function(_0x1622a6){if(_0x1622a6){return _0x1622a6?{'count':_0x326b1c,'rows':_0x1622a6}:null;}})[_0xff57('0x28')](respondWithResult(_0x552958,null))[_0xff57('0x46')](handleError(_0x552958,null));};exports[_0xff57('0x55')]=function(_0x42dbad,_0x56ed4e,_0xfe0881){if(_0x42dbad['body']['id']){delete _0x42dbad[_0xff57('0x4d')]['id'];}return db[_0xff57('0x4a')][_0xff57('0x4f')]({'where':{'id':_0x42dbad['params']['id']}})[_0xff57('0x28')](handleEntityNotFound(_0x56ed4e,null))[_0xff57('0x28')](function(_0x150350){if(_0x150350){return _0x150350[_0xff57('0x55')](_0x42dbad[_0xff57('0x4d')]['ids']||[]);}return null;})[_0xff57('0x28')](respondWithResult(_0x56ed4e,null))[_0xff57('0x46')](handleError(_0x56ed4e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 129f1bc..db3ab5f 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 _0x827f=['exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','moment','bluebird','rimraf','./intFreshdeskConfiguration.attributes'];(function(_0x59f30d,_0x2890a7){var _0x328321=function(_0x3fdc67){while(--_0x3fdc67){_0x59f30d['push'](_0x59f30d['shift']());}};_0x328321(++_0x2890a7);}(_0x827f,0x143));var _0xf827=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x827f[_0x525c7b];return _0x27b33e;};'use strict';var _=require('lodash');var util=require(_0xf827('0x0'));var logger=require(_0xf827('0x1'))(_0xf827('0x2'));var moment=require(_0xf827('0x3'));var BPromise=require(_0xf827('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf827('0x5'));var config=require('../../config/environment');var attributes=require(_0xf827('0x6'));module[_0xf827('0x7')]=function(_0x43410a,_0xa3c002){return _0x43410a[_0xf827('0x8')](_0xf827('0x9'),attributes,{'tableName':_0xf827('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80d1=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshdeskConfiguration','lodash','util','api','moment'];(function(_0x54e80a,_0x361ad2){var _0x40f4e1=function(_0x3b8269){while(--_0x3b8269){_0x54e80a['push'](_0x54e80a['shift']());}};_0x40f4e1(++_0x361ad2);}(_0x80d1,0x1a0));var _0x180d=function(_0xbd5294,_0x13d305){_0xbd5294=_0xbd5294-0x0;var _0x1dfd18=_0x80d1[_0xbd5294];return _0x1dfd18;};'use strict';var _=require(_0x180d('0x0'));var util=require(_0x180d('0x1'));var logger=require('../../config/logger')(_0x180d('0x2'));var moment=require(_0x180d('0x3'));var BPromise=require(_0x180d('0x4'));var rp=require(_0x180d('0x5'));var fs=require('fs');var path=require(_0x180d('0x6'));var rimraf=require(_0x180d('0x7'));var config=require(_0x180d('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x180d('0x9')]=function(_0xe4f83f,_0x5f15dd){return _0xe4f83f[_0x180d('0xa')](_0x180d('0xb'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 1087322..968c2ab 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 _0x7bda=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash'];(function(_0x2b323c,_0xb28698){var _0x5941c7=function(_0x4b46bc){while(--_0x4b46bc){_0x2b323c['push'](_0x2b323c['shift']());}};_0x5941c7(++_0xb28698);}(_0x7bda,0x168));var _0xa7bd=function(_0x4440d1,_0x2fe5ab){_0x4440d1=_0x4440d1-0x0;var _0x2e17b7=_0x7bda[_0x4440d1];return _0x2e17b7;};'use strict';var _=require(_0xa7bd('0x0'));var util=require('util');var moment=require(_0xa7bd('0x1'));var BPromise=require(_0xa7bd('0x2'));var rs=require(_0xa7bd('0x3'));var fs=require('fs');var Redis=require(_0xa7bd('0x4'));var db=require(_0xa7bd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7bd('0x6'))(_0xa7bd('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa7bd('0x8')][_0xa7bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55784e,_0x167216,_0x3a7b44){return new BPromise(function(_0x3d01a7,_0x505dfe){return client[_0xa7bd('0xa')](_0x55784e,_0x3a7b44)['then'](function(_0x161693){logger[_0xa7bd('0xb')](_0xa7bd('0xc'),_0x167216,_0xa7bd('0xd'));logger[_0xa7bd('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x167216,_0xa7bd('0xd'),JSON[_0xa7bd('0xf')](_0x161693));if(_0x161693[_0xa7bd('0x10')]){if(_0x161693['error']['code']===0x1f4){logger[_0xa7bd('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x167216,_0x161693['error']['message']);return _0x505dfe(_0x161693['error']['message']);}logger[_0xa7bd('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x167216,_0x161693['error']['message']);return _0x3d01a7(_0x161693[_0xa7bd('0x10')][_0xa7bd('0x11')]);}else{logger[_0xa7bd('0xb')](_0xa7bd('0xc'),_0x167216,'request\x20sent');_0x3d01a7(_0x161693[_0xa7bd('0x12')]['message']);}})['catch'](function(_0x57c8a2){logger[_0xa7bd('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x167216,_0x57c8a2);_0x505dfe(_0x57c8a2);});});} \ No newline at end of file +var _0xf7c5=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0x4a83f4,_0x50f589){var _0x1fc810=function(_0xc651f9){while(--_0xc651f9){_0x4a83f4['push'](_0x4a83f4['shift']());}};_0x1fc810(++_0x50f589);}(_0xf7c5,0x109));var _0x5f7c=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xf7c5[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x5f7c('0x0'));var util=require(_0x5f7c('0x1'));var moment=require('moment');var BPromise=require(_0x5f7c('0x2'));var rs=require(_0x5f7c('0x3'));var fs=require('fs');var Redis=require(_0x5f7c('0x4'));var db=require(_0x5f7c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f7c('0x6'))(_0x5f7c('0x7'));var config=require(_0x5f7c('0x8'));var jayson=require(_0x5f7c('0x9'));var client=jayson[_0x5f7c('0xa')][_0x5f7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59d76e,_0x5db639,_0x5bd55f){return new BPromise(function(_0x4d2c7a,_0x80db12){return client[_0x5f7c('0xc')](_0x59d76e,_0x5bd55f)[_0x5f7c('0xd')](function(_0x2babd1){logger[_0x5f7c('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5db639,'request\x20sent');logger[_0x5f7c('0xf')](_0x5f7c('0x10'),_0x5db639,_0x5f7c('0x11'),JSON[_0x5f7c('0x12')](_0x2babd1));if(_0x2babd1[_0x5f7c('0x13')]){if(_0x2babd1['error'][_0x5f7c('0x14')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5db639,_0x2babd1[_0x5f7c('0x13')][_0x5f7c('0x15')]);return _0x80db12(_0x2babd1[_0x5f7c('0x13')][_0x5f7c('0x15')]);}logger[_0x5f7c('0x13')](_0x5f7c('0x16'),_0x5db639,_0x2babd1['error'][_0x5f7c('0x15')]);return _0x4d2c7a(_0x2babd1['error'][_0x5f7c('0x15')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5db639,_0x5f7c('0x11'));_0x4d2c7a(_0x2babd1[_0x5f7c('0x17')][_0x5f7c('0x15')]);}})['catch'](function(_0x2c0ab1){logger[_0x5f7c('0x13')](_0x5f7c('0x16'),_0x5db639,_0x2c0ab1);_0x80db12(_0x2c0ab1);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 150c17f..181ba01 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 _0x6269=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout'];(function(_0x41a791,_0x3fc967){var _0x165856=function(_0x27e529){while(--_0x27e529){_0x41a791['push'](_0x41a791['shift']());}};_0x165856(++_0x3fc967);}(_0x6269,0x13c));var _0x9626=function(_0xd3740f,_0x523210){_0xd3740f=_0xd3740f-0x0;var _0x2e3938=_0x6269[_0xd3740f];return _0x2e3938;};'use strict';var multer=require(_0x9626('0x0'));var util=require(_0x9626('0x1'));var path=require(_0x9626('0x2'));var timeout=require(_0x9626('0x3'));var express=require(_0x9626('0x4'));var router=express[_0x9626('0x5')]();var fs_extra=require(_0x9626('0x6'));var auth=require(_0x9626('0x7'));var interaction=require(_0x9626('0x8'));var config=require(_0x9626('0x9'));var controller=require('./intFreshdeskField.controller');router[_0x9626('0xa')]('/',auth[_0x9626('0xb')](),controller[_0x9626('0xc')]);router[_0x9626('0xa')](_0x9626('0xd'),auth[_0x9626('0xb')](),controller[_0x9626('0xe')]);router[_0x9626('0xf')]('/',auth[_0x9626('0xb')](),controller[_0x9626('0x10')]);router[_0x9626('0x11')](_0x9626('0xd'),auth[_0x9626('0xb')](),controller['update']);router[_0x9626('0x12')](_0x9626('0xd'),auth[_0x9626('0xb')](),controller[_0x9626('0x13')]);module['exports']=router; \ No newline at end of file +var _0x59f0=['post','put','/:id','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x5cc528,_0x356dc3){var _0x52cbea=function(_0x4e2476){while(--_0x4e2476){_0x5cc528['push'](_0x5cc528['shift']());}};_0x52cbea(++_0x356dc3);}(_0x59f0,0x1d7));var _0x059f=function(_0x431b03,_0x4c4c50){_0x431b03=_0x431b03-0x0;var _0x5e0134=_0x59f0[_0x431b03];return _0x5e0134;};'use strict';var multer=require('multer');var util=require(_0x059f('0x0'));var path=require(_0x059f('0x1'));var timeout=require(_0x059f('0x2'));var express=require('express');var router=express[_0x059f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x059f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x059f('0x5'));var controller=require('./intFreshdeskField.controller');router[_0x059f('0x6')]('/',auth[_0x059f('0x7')](),controller[_0x059f('0x8')]);router[_0x059f('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x059f('0x9')]('/',auth[_0x059f('0x7')](),controller['create']);router[_0x059f('0xa')](_0x059f('0xb'),auth[_0x059f('0x7')](),controller['update']);router[_0x059f('0xc')]('/:id',auth[_0x059f('0x7')](),controller[_0x059f('0xd')]);module[_0x059f('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 75c4a80..55fdcf0 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 _0x9b5a=['variable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x13213e,_0x18faa9){var _0x42cc3f=function(_0x108ab5){while(--_0x108ab5){_0x13213e['push'](_0x13213e['shift']());}};_0x42cc3f(++_0x18faa9);}(_0x9b5a,0xed));var _0xa9b5=function(_0x108193,_0x506d4f){_0x108193=_0x108193-0x0;var _0x2ca68e=_0x9b5a[_0x108193];return _0x2ca68e;};'use strict';var Sequelize=require('sequelize');module[_0xa9b5('0x0')]={'type':{'type':Sequelize[_0xa9b5('0x1')](_0xa9b5('0x2'),_0xa9b5('0x3'),'customVariable',_0xa9b5('0x4'),_0xa9b5('0x5')),'defaultValue':_0xa9b5('0x2')},'content':{'type':Sequelize[_0xa9b5('0x6')]},'key':{'type':Sequelize[_0xa9b5('0x6')]},'keyType':{'type':Sequelize[_0xa9b5('0x1')](_0xa9b5('0x2'),_0xa9b5('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xa9b5('0x6')]},'idField':{'type':Sequelize[_0xa9b5('0x6')]},'nameField':{'type':Sequelize[_0xa9b5('0x6')]},'customField':{'type':Sequelize[_0xa9b5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa9b5('0x6')]}}; \ No newline at end of file +var _0x910f=['STRING','customVariable','sequelize','exports','ENUM','variable','keyValue','picklist','string'];(function(_0x1b36a7,_0x4252cf){var _0x220fed=function(_0x266e39){while(--_0x266e39){_0x1b36a7['push'](_0x1b36a7['shift']());}};_0x220fed(++_0x4252cf);}(_0x910f,0x1e8));var _0xf910=function(_0x270dba,_0x1817d2){_0x270dba=_0x270dba-0x0;var _0x36b83b=_0x910f[_0x270dba];return _0x36b83b;};'use strict';var Sequelize=require(_0xf910('0x0'));module[_0xf910('0x1')]={'type':{'type':Sequelize[_0xf910('0x2')]('string',_0xf910('0x3'),'customVariable',_0xf910('0x4'),_0xf910('0x5')),'defaultValue':_0xf910('0x6')},'content':{'type':Sequelize[_0xf910('0x7')]},'key':{'type':Sequelize[_0xf910('0x7')]},'keyType':{'type':Sequelize[_0xf910('0x2')]('string',_0xf910('0x3'),_0xf910('0x8'))},'keyContent':{'type':Sequelize[_0xf910('0x7')]},'idField':{'type':Sequelize[_0xf910('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf910('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 98b2fea..c41b881 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 _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(_0xc56b04,_0x1d0dee){var _0x5bb80d=function(_0x27106f){while(--_0x27106f){_0xc56b04['push'](_0xc56b04['shift']());}};_0x5bb80d(++_0x1d0dee);}(_0xc788,0xc4));var _0x8c78=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0xc788[_0xee3051];return _0x139e81;};'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 +var _0xe205=['merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','send','index','FreshdeskField','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0xdb47d8,_0x933e5b){var _0x5cdfd9=function(_0x3b69a8){while(--_0x3b69a8){_0xdb47d8['push'](_0xdb47d8['shift']());}};_0x5cdfd9(++_0x933e5b);}(_0xe205,0xa7));var _0x5e20=function(_0x452066,_0xd0377d){_0x452066=_0x452066-0x0;var _0x44cb3b=_0xe205[_0x452066];return _0x44cb3b;};'use strict';var emlformat=require(_0x5e20('0x0'));var rimraf=require(_0x5e20('0x1'));var zipdir=require(_0x5e20('0x2'));var jsonpatch=require(_0x5e20('0x3'));var rp=require(_0x5e20('0x4'));var moment=require(_0x5e20('0x5'));var BPromise=require(_0x5e20('0x6'));var Mustache=require(_0x5e20('0x7'));var util=require(_0x5e20('0x8'));var path=require('path');var sox=require(_0x5e20('0x9'));var csv=require(_0x5e20('0xa'));var ejs=require(_0x5e20('0xb'));var fs=require('fs');var fs_extra=require(_0x5e20('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e20('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5e20('0xa'));var querystring=require(_0x5e20('0xe'));var Papa=require('papaparse');var Redis=require(_0x5e20('0xf'));var authService=require(_0x5e20('0x10'));var qs=require(_0x5e20('0x11'));var as=require(_0x5e20('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e20('0x13'))(_0x5e20('0x14'));var utils=require(_0x5e20('0x15'));var config=require(_0x5e20('0x16'));var licenseUtil=require(_0x5e20('0x17'));var db=require(_0x5e20('0x18'))['db'];function respondWithStatusCode(_0x54deee,_0x19eacf){_0x19eacf=_0x19eacf||0xcc;return function(_0x29b7a2){if(_0x29b7a2){return _0x54deee[_0x5e20('0x19')](_0x19eacf);}return _0x54deee['status'](_0x19eacf)[_0x5e20('0x1a')]();};}function respondWithResult(_0x5d827e,_0x1f47f3){_0x1f47f3=_0x1f47f3||0xc8;return function(_0x5ba833){if(_0x5ba833){return _0x5d827e[_0x5e20('0x1b')](_0x1f47f3)[_0x5e20('0x1c')](_0x5ba833);}};}function respondWithFilteredResult(_0x275026,_0x148ada){return function(_0x294df8){if(_0x294df8){var _0x542b3c=typeof _0x148ada[_0x5e20('0x1d')]===_0x5e20('0x1e')&&typeof _0x148ada[_0x5e20('0x1f')]===_0x5e20('0x1e');var _0x2f194b=_0x294df8[_0x5e20('0x20')];var _0x1cc706=_0x542b3c?0x0:_0x148ada[_0x5e20('0x1d')];var _0x4d3e4a=_0x542b3c?_0x294df8[_0x5e20('0x20')]:_0x148ada[_0x5e20('0x1d')]+_0x148ada['limit'];var _0x295eb3;if(_0x4d3e4a>=_0x2f194b){_0x4d3e4a=_0x2f194b;_0x295eb3=0xc8;}else{_0x295eb3=0xce;}_0x275026[_0x5e20('0x1b')](_0x295eb3);return _0x275026[_0x5e20('0x21')](_0x5e20('0x22'),_0x1cc706+'-'+_0x4d3e4a+'/'+_0x2f194b)['json'](_0x294df8);}return null;};}function patchUpdates(_0x2954fc){return function(_0x50f222){try{jsonpatch['apply'](_0x50f222,_0x2954fc,!![]);}catch(_0x57c7c5){return BPromise['reject'](_0x57c7c5);}return _0x50f222[_0x5e20('0x23')]();};}function saveUpdates(_0x5cca90,_0x3d89e4){return function(_0x29b111){if(_0x29b111){return _0x29b111[_0x5e20('0x24')](_0x5cca90)[_0x5e20('0x25')](function(_0x3ef7fa){return _0x3ef7fa;});}return null;};}function removeEntity(_0x2d4614,_0x4c5732){return function(_0x15705f){if(_0x15705f){return _0x15705f['destroy']()['then'](function(){_0x2d4614[_0x5e20('0x1b')](0xcc)[_0x5e20('0x1a')]();});}};}function handleEntityNotFound(_0x2bae08,_0x1b01af){return function(_0xbf7a24){if(!_0xbf7a24){_0x2bae08[_0x5e20('0x19')](0x194);}return _0xbf7a24;};}function handleError(_0x2973b3,_0x5809fd){_0x5809fd=_0x5809fd||0x1f4;return function(_0x3bf4f4){logger[_0x5e20('0x26')](_0x3bf4f4[_0x5e20('0x27')]);if(_0x3bf4f4[_0x5e20('0x28')]){delete _0x3bf4f4['name'];}_0x2973b3[_0x5e20('0x1b')](_0x5809fd)[_0x5e20('0x29')](_0x3bf4f4);};}exports[_0x5e20('0x2a')]=function(_0x222e7a,_0xbed73a){var _0x19709b={},_0x5ec45b={},_0xbc2b0e={'count':0x0,'rows':[]};var _0x34a3d6=_['map'](db[_0x5e20('0x2b')][_0x5e20('0x2c')],function(_0x335f1e){return{'name':_0x335f1e[_0x5e20('0x2d')],'type':_0x335f1e[_0x5e20('0x2e')][_0x5e20('0x2f')]};});_0x5ec45b['model']=_[_0x5e20('0x30')](_0x34a3d6,_0x5e20('0x28'));_0x5ec45b[_0x5e20('0x31')]=_[_0x5e20('0x32')](_0x222e7a[_0x5e20('0x31')]);_0x5ec45b[_0x5e20('0x33')]=_[_0x5e20('0x34')](_0x5ec45b[_0x5e20('0x35')],_0x5ec45b[_0x5e20('0x31')]);_0x19709b[_0x5e20('0x36')]=_[_0x5e20('0x34')](_0x5ec45b['model'],qs[_0x5e20('0x37')](_0x222e7a[_0x5e20('0x31')][_0x5e20('0x37')]));_0x19709b['attributes']=_0x19709b[_0x5e20('0x36')][_0x5e20('0x38')]?_0x19709b[_0x5e20('0x36')]:_0x5ec45b[_0x5e20('0x35')];if(!_0x222e7a[_0x5e20('0x31')][_0x5e20('0x39')](_0x5e20('0x3a'))){_0x19709b[_0x5e20('0x1f')]=qs[_0x5e20('0x1f')](_0x222e7a[_0x5e20('0x31')][_0x5e20('0x1f')]);_0x19709b[_0x5e20('0x1d')]=qs[_0x5e20('0x1d')](_0x222e7a[_0x5e20('0x31')]['offset']);}_0x19709b[_0x5e20('0x3b')]=qs['sort'](_0x222e7a['query'][_0x5e20('0x3c')]);_0x19709b[_0x5e20('0x3d')]=qs['filters'](_[_0x5e20('0x3e')](_0x222e7a[_0x5e20('0x31')],_0x5ec45b['filters']),_0x34a3d6);if(_0x222e7a[_0x5e20('0x31')][_0x5e20('0x3f')]){_0x19709b[_0x5e20('0x3d')]=_[_0x5e20('0x40')](_0x19709b[_0x5e20('0x3d')],{'$or':_[_0x5e20('0x30')](_0x34a3d6,function(_0x94925e){if(_0x94925e[_0x5e20('0x2e')]!==_0x5e20('0x41')){var _0x20be56={};_0x20be56[_0x94925e[_0x5e20('0x28')]]={'$like':'%'+_0x222e7a[_0x5e20('0x31')][_0x5e20('0x3f')]+'%'};return _0x20be56;}})});}_0x19709b=_[_0x5e20('0x40')]({},_0x19709b,_0x222e7a[_0x5e20('0x42')]);var _0x3d618c={'where':_0x19709b[_0x5e20('0x3d')]};return db[_0x5e20('0x2b')]['count'](_0x3d618c)[_0x5e20('0x25')](function(_0x29215f){_0xbc2b0e[_0x5e20('0x20')]=_0x29215f;if(_0x222e7a[_0x5e20('0x31')][_0x5e20('0x43')]){_0x19709b['include']=[{'all':!![]}];}return db[_0x5e20('0x2b')][_0x5e20('0x44')](_0x19709b);})[_0x5e20('0x25')](function(_0x24c05f){_0xbc2b0e[_0x5e20('0x45')]=_0x24c05f;return _0xbc2b0e;})[_0x5e20('0x25')](respondWithFilteredResult(_0xbed73a,_0x19709b))['catch'](handleError(_0xbed73a,null));};exports[_0x5e20('0x46')]=function(_0xc24cce,_0xa52d83){var _0x5a21f0={'raw':!![],'where':{'id':_0xc24cce[_0x5e20('0x47')]['id']}},_0x2b031d={};_0x2b031d[_0x5e20('0x35')]=_[_0x5e20('0x32')](db[_0x5e20('0x2b')][_0x5e20('0x2c')]);_0x2b031d[_0x5e20('0x31')]=_[_0x5e20('0x32')](_0xc24cce['query']);_0x2b031d[_0x5e20('0x33')]=_[_0x5e20('0x34')](_0x2b031d[_0x5e20('0x35')],_0x2b031d['query']);_0x5a21f0[_0x5e20('0x36')]=_['intersection'](_0x2b031d[_0x5e20('0x35')],qs[_0x5e20('0x37')](_0xc24cce[_0x5e20('0x31')][_0x5e20('0x37')]));_0x5a21f0[_0x5e20('0x36')]=_0x5a21f0['attributes'][_0x5e20('0x38')]?_0x5a21f0['attributes']:_0x2b031d['model'];if(_0xc24cce[_0x5e20('0x31')][_0x5e20('0x43')]){_0x5a21f0[_0x5e20('0x48')]=[{'all':!![]}];}_0x5a21f0=_[_0x5e20('0x40')]({},_0x5a21f0,_0xc24cce[_0x5e20('0x42')]);return db[_0x5e20('0x2b')][_0x5e20('0x49')](_0x5a21f0)['then'](handleEntityNotFound(_0xa52d83,null))['then'](respondWithResult(_0xa52d83,null))[_0x5e20('0x4a')](handleError(_0xa52d83,null));};exports[_0x5e20('0x4b')]=function(_0x5e84bd,_0x22b84e){return db[_0x5e20('0x2b')][_0x5e20('0x4b')](_0x5e84bd[_0x5e20('0x4c')],{})[_0x5e20('0x25')](respondWithResult(_0x22b84e,0xc9))['catch'](handleError(_0x22b84e,null));};exports[_0x5e20('0x24')]=function(_0x245b52,_0x25491e){if(_0x245b52[_0x5e20('0x4c')]['id']){delete _0x245b52[_0x5e20('0x4c')]['id'];}return db[_0x5e20('0x2b')][_0x5e20('0x49')]({'where':{'id':_0x245b52[_0x5e20('0x47')]['id']}})['then'](handleEntityNotFound(_0x25491e,null))['then'](saveUpdates(_0x245b52['body'],null))[_0x5e20('0x25')](respondWithResult(_0x25491e,null))[_0x5e20('0x4a')](handleError(_0x25491e,null));};exports['destroy']=function(_0x4392ca,_0x4bfea7){return db[_0x5e20('0x2b')]['find']({'where':{'id':_0x4392ca[_0x5e20('0x47')]['id']}})['then'](handleEntityNotFound(_0x4bfea7,null))[_0x5e20('0x25')](removeEntity(_0x4bfea7,null))[_0x5e20('0x4a')](handleError(_0x4bfea7,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 4a57634..7256339 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 _0xb42c=['./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x46e1b0,_0x145a6d){var _0x31520a=function(_0x12b7bd){while(--_0x12b7bd){_0x46e1b0['push'](_0x46e1b0['shift']());}};_0x31520a(++_0x145a6d);}(_0xb42c,0xd5));var _0xcb42=function(_0x4ed6e9,_0x4236f4){_0x4ed6e9=_0x4ed6e9-0x0;var _0x2a8b3c=_0xb42c[_0x4ed6e9];return _0x2a8b3c;};'use strict';var _=require(_0xcb42('0x0'));var util=require(_0xcb42('0x1'));var logger=require(_0xcb42('0x2'))(_0xcb42('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb42('0x4'));var fs=require('fs');var path=require(_0xcb42('0x5'));var rimraf=require(_0xcb42('0x6'));var config=require(_0xcb42('0x7'));var attributes=require(_0xcb42('0x8'));module[_0xcb42('0x9')]=function(_0x298a54,_0x4ded98){return _0x298a54[_0xcb42('0xa')]('FreshdeskField',attributes,{'tableName':_0xcb42('0xb'),'paranoid':![],'indexes':[{'name':_0xcb42('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x67f0=['bluebird','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','util','api'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x67f0,0x106));var _0x067f=function(_0x1f0679,_0x53d43c){_0x1f0679=_0x1f0679-0x0;var _0x3dc3a4=_0x67f0[_0x1f0679];return _0x3dc3a4;};'use strict';var _=require('lodash');var util=require(_0x067f('0x0'));var logger=require('../../config/logger')(_0x067f('0x1'));var moment=require('moment');var BPromise=require(_0x067f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x067f('0x3'));var config=require(_0x067f('0x4'));var attributes=require(_0x067f('0x5'));module[_0x067f('0x6')]=function(_0x150be5,_0x5089a4){return _0x150be5[_0x067f('0x7')](_0x067f('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x067f('0x9'),'fields':[_0x067f('0xa'),'FieldId'],'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 f6548cd..8eb3be7 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 _0x675c=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x5c85b2,_0x378588){var _0x201f9d=function(_0x157018){while(--_0x157018){_0x5c85b2['push'](_0x5c85b2['shift']());}};_0x201f9d(++_0x378588);}(_0x675c,0x126));var _0xc675=function(_0x50134a,_0x86fa3a){_0x50134a=_0x50134a-0x0;var _0x3b9c3c=_0x675c[_0x50134a];return _0x3b9c3c;};'use strict';var _=require('lodash');var util=require(_0xc675('0x0'));var moment=require(_0xc675('0x1'));var BPromise=require(_0xc675('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc675('0x3'));var db=require(_0xc675('0x4'))['db'];var utils=require(_0xc675('0x5'));var logger=require(_0xc675('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc675('0x7'));var client=jayson[_0xc675('0x8')][_0xc675('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54cc67,_0x3136f0,_0x1dc60f){return new BPromise(function(_0x2e6cf4,_0xfb9fae){return client[_0xc675('0xa')](_0x54cc67,_0x1dc60f)['then'](function(_0x44b91a){logger[_0xc675('0xb')](_0xc675('0xc'),_0x3136f0,_0xc675('0xd'));logger[_0xc675('0xe')](_0xc675('0xf'),_0x3136f0,_0xc675('0xd'),JSON[_0xc675('0x10')](_0x44b91a));if(_0x44b91a['error']){if(_0x44b91a[_0xc675('0x11')]['code']===0x1f4){logger[_0xc675('0x11')](_0xc675('0xc'),_0x3136f0,_0x44b91a['error']['message']);return _0xfb9fae(_0x44b91a[_0xc675('0x11')][_0xc675('0x12')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x3136f0,_0x44b91a[_0xc675('0x11')]['message']);return _0x2e6cf4(_0x44b91a[_0xc675('0x11')][_0xc675('0x12')]);}else{logger[_0xc675('0xb')](_0xc675('0xc'),_0x3136f0,_0xc675('0xd'));_0x2e6cf4(_0x44b91a[_0xc675('0x13')]['message']);}})[_0xc675('0x14')](function(_0x543771){logger[_0xc675('0x11')](_0xc675('0xc'),_0x3136f0,_0x543771);_0xfb9fae(_0x543771);});});} \ No newline at end of file +var _0xb5f8=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x5d6448,_0x53522f){var _0x58c195=function(_0x200a2f){while(--_0x200a2f){_0x5d6448['push'](_0x5d6448['shift']());}};_0x58c195(++_0x53522f);}(_0xb5f8,0x88));var _0x8b5f=function(_0x13ebdb,_0x230634){_0x13ebdb=_0x13ebdb-0x0;var _0x3693d2=_0xb5f8[_0x13ebdb];return _0x3693d2;};'use strict';var _=require(_0x8b5f('0x0'));var util=require(_0x8b5f('0x1'));var moment=require(_0x8b5f('0x2'));var BPromise=require(_0x8b5f('0x3'));var rs=require(_0x8b5f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b5f('0x5'))['db'];var utils=require(_0x8b5f('0x6'));var logger=require('../../config/logger')(_0x8b5f('0x7'));var config=require(_0x8b5f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8b5f('0x9')][_0x8b5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d3b72,_0x56d7a2,_0x25111a){return new BPromise(function(_0x1b48e1,_0x2a348d){return client[_0x8b5f('0xb')](_0x4d3b72,_0x25111a)[_0x8b5f('0xc')](function(_0x5be920){logger[_0x8b5f('0xd')](_0x8b5f('0xe'),_0x56d7a2,_0x8b5f('0xf'));logger['debug'](_0x8b5f('0x10'),_0x56d7a2,_0x8b5f('0xf'),JSON[_0x8b5f('0x11')](_0x5be920));if(_0x5be920[_0x8b5f('0x12')]){if(_0x5be920[_0x8b5f('0x12')][_0x8b5f('0x13')]===0x1f4){logger[_0x8b5f('0x12')](_0x8b5f('0xe'),_0x56d7a2,_0x5be920[_0x8b5f('0x12')][_0x8b5f('0x14')]);return _0x2a348d(_0x5be920[_0x8b5f('0x12')]['message']);}logger[_0x8b5f('0x12')](_0x8b5f('0xe'),_0x56d7a2,_0x5be920['error']['message']);return _0x1b48e1(_0x5be920[_0x8b5f('0x12')][_0x8b5f('0x14')]);}else{logger[_0x8b5f('0xd')](_0x8b5f('0xe'),_0x56d7a2,'request\x20sent');_0x1b48e1(_0x5be920[_0x8b5f('0x15')][_0x8b5f('0x14')]);}})[_0x8b5f('0x16')](function(_0x4d4ff4){logger['error'](_0x8b5f('0xe'),_0x56d7a2,_0x4d4ff4);_0x2a348d(_0x4d4ff4);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 40c07dc..fdf0c0e 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 _0x9348=['../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5e9689,_0x48e034){var _0x2fac94=function(_0x1e8f97){while(--_0x1e8f97){_0x5e9689['push'](_0x5e9689['shift']());}};_0x2fac94(++_0x48e034);}(_0x9348,0x10d));var _0x8934=function(_0x3c007e,_0x2e6adc){_0x3c007e=_0x3c007e-0x0;var _0x851f31=_0x9348[_0x3c007e];return _0x851f31;};'use strict';var multer=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var path=require(_0x8934('0x2'));var timeout=require(_0x8934('0x3'));var express=require(_0x8934('0x4'));var router=express['Router']();var fs_extra=require(_0x8934('0x5'));var auth=require(_0x8934('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8934('0x7'));var controller=require(_0x8934('0x8'));router[_0x8934('0x9')]('/',auth[_0x8934('0xa')](),controller[_0x8934('0xb')]);router[_0x8934('0x9')]('/:id',auth[_0x8934('0xa')](),controller[_0x8934('0xc')]);router[_0x8934('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x8934('0xd'),auth['isAuthenticated'](),controller[_0x8934('0xe')]);router[_0x8934('0xf')]('/',auth[_0x8934('0xa')](),controller[_0x8934('0x10')]);router[_0x8934('0xf')](_0x8934('0x11'),auth[_0x8934('0xa')](),controller[_0x8934('0x12')]);router['put'](_0x8934('0x13'),auth[_0x8934('0xa')](),controller[_0x8934('0x14')]);router[_0x8934('0x15')](_0x8934('0x13'),auth[_0x8934('0xa')](),controller['destroy']);module[_0x8934('0x16')]=router; \ No newline at end of file +var _0x13f6=['./intFreshsalesAccount.controller','isAuthenticated','index','get','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','update','delete','/:id','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2140ad,_0x42bce5){var _0x3da731=function(_0x30bcad){while(--_0x30bcad){_0x2140ad['push'](_0x2140ad['shift']());}};_0x3da731(++_0x42bce5);}(_0x13f6,0x124));var _0x613f=function(_0x5ba2b7,_0x25775e){_0x5ba2b7=_0x5ba2b7-0x0;var _0x4fdafe=_0x13f6[_0x5ba2b7];return _0x4fdafe;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var fs_extra=require(_0x613f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var controller=require(_0x613f('0x7'));router['get']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x613f('0xa')](_0x613f('0xb'),auth[_0x613f('0x8')](),controller[_0x613f('0xc')]);router['get'](_0x613f('0xd'),auth[_0x613f('0x8')](),controller[_0x613f('0xe')]);router['post']('/',auth[_0x613f('0x8')](),controller[_0x613f('0xf')]);router[_0x613f('0x10')]('/:id/configurations',auth[_0x613f('0x8')](),controller[_0x613f('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x613f('0x12')]);router[_0x613f('0x13')](_0x613f('0x14'),auth[_0x613f('0x8')](),controller[_0x613f('0x15')]);module[_0x613f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 8d5ea60..7f0243a 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 _0x4bd3=['sequelize','STRING','remoteUri'];(function(_0x254fd1,_0x17eae1){var _0x2d33f1=function(_0x42dffd){while(--_0x42dffd){_0x254fd1['push'](_0x254fd1['shift']());}};_0x2d33f1(++_0x17eae1);}(_0x4bd3,0x174));var _0x34bd=function(_0x10ad74,_0x412542){_0x10ad74=_0x10ad74-0x0;var _0x119ffd=_0x4bd3[_0x10ad74];return _0x119ffd;};'use strict';var Sequelize=require(_0x34bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x34bd('0x1')]},'description':{'type':Sequelize[_0x34bd('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x34bd('0x1')],'unique':_0x34bd('0x2')},'serverUrl':{'type':Sequelize[_0x34bd('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xd4a2=['STRING','username','sequelize'];(function(_0x17828f,_0x4b5211){var _0x65680a=function(_0x3ed325){while(--_0x3ed325){_0x17828f['push'](_0x17828f['shift']());}};_0x65680a(++_0x4b5211);}(_0xd4a2,0x173));var _0x2d4a=function(_0x1ad67b,_0x197aa9){_0x1ad67b=_0x1ad67b-0x0;var _0x17ccc7=_0xd4a2[_0x1ad67b];return _0x17ccc7;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2d4a('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x2d4a('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2d4a('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x2d4a('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 583fc1f..77a23ba 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 _0x7140=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','FreshsalesAccount','fieldName','type','key','map','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','show','params','rawAttributes','keys','length','find','catch','create','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','pick','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s%s','Token\x20token=','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7140,0x125));var _0x0714=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x7140[_0x1e4360];return _0x31e6b4;};'use strict';var emlformat=require(_0x0714('0x0'));var rimraf=require(_0x0714('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0714('0x2'));var rp=require(_0x0714('0x3'));var moment=require(_0x0714('0x4'));var BPromise=require(_0x0714('0x5'));var Mustache=require(_0x0714('0x6'));var util=require(_0x0714('0x7'));var path=require('path');var sox=require(_0x0714('0x8'));var csv=require(_0x0714('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0714('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0714('0xb'));var jsforce=require(_0x0714('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0714('0x9'));var querystring=require(_0x0714('0xd'));var Papa=require(_0x0714('0xe'));var Redis=require(_0x0714('0xf'));var authService=require(_0x0714('0x10'));var qs=require(_0x0714('0x11'));var as=require(_0x0714('0x12'));var hardwareService=require(_0x0714('0x13'));var logger=require(_0x0714('0x14'))(_0x0714('0x15'));var utils=require(_0x0714('0x16'));var config=require(_0x0714('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0714('0x18'))['db'];var integrations=require(_0x0714('0x19'));function respondWithStatusCode(_0x1c9930,_0x24873b){_0x24873b=_0x24873b||0xcc;return function(_0x52246b){if(_0x52246b){return _0x1c9930['sendStatus'](_0x24873b);}return _0x1c9930[_0x0714('0x1a')](_0x24873b)[_0x0714('0x1b')]();};}function respondWithResult(_0x3658cf,_0x145f7e){_0x145f7e=_0x145f7e||0xc8;return function(_0x6695ed){if(_0x6695ed){return _0x3658cf[_0x0714('0x1a')](_0x145f7e)[_0x0714('0x1c')](_0x6695ed);}};}function respondWithFilteredResult(_0x47ed92,_0x366e8f){return function(_0x54059c){if(_0x54059c){var _0x557754=typeof _0x366e8f[_0x0714('0x1d')]===_0x0714('0x1e')&&typeof _0x366e8f[_0x0714('0x1f')]===_0x0714('0x1e');var _0x314952=_0x54059c[_0x0714('0x20')];var _0x217496=_0x557754?0x0:_0x366e8f['offset'];var _0x293f84=_0x557754?_0x54059c[_0x0714('0x20')]:_0x366e8f[_0x0714('0x1d')]+_0x366e8f[_0x0714('0x1f')];var _0x348779;if(_0x293f84>=_0x314952){_0x293f84=_0x314952;_0x348779=0xc8;}else{_0x348779=0xce;}_0x47ed92[_0x0714('0x1a')](_0x348779);return _0x47ed92[_0x0714('0x21')](_0x0714('0x22'),_0x217496+'-'+_0x293f84+'/'+_0x314952)[_0x0714('0x1c')](_0x54059c);}return null;};}function patchUpdates(_0x289deb){return function(_0x25b423){try{jsonpatch[_0x0714('0x23')](_0x25b423,_0x289deb,!![]);}catch(_0x6a4089){return BPromise[_0x0714('0x24')](_0x6a4089);}return _0x25b423[_0x0714('0x25')]();};}function saveUpdates(_0x3d82de,_0x5bae70){return function(_0x15e8a7){if(_0x15e8a7){return _0x15e8a7[_0x0714('0x26')](_0x3d82de)[_0x0714('0x27')](function(_0x58a7da){return _0x58a7da;});}return null;};}function removeEntity(_0x329a50,_0x4f7a9d){return function(_0x46f216){if(_0x46f216){return _0x46f216['destroy']()[_0x0714('0x27')](function(){_0x329a50[_0x0714('0x1a')](0xcc)[_0x0714('0x1b')]();});}};}function handleEntityNotFound(_0x179b7f,_0x3a56ef){return function(_0x39b6fc){if(!_0x39b6fc){_0x179b7f[_0x0714('0x28')](0x194);}return _0x39b6fc;};}function handleError(_0x17887e,_0x896db){_0x896db=_0x896db||0x1f4;return function(_0x4855e9){logger[_0x0714('0x29')](_0x4855e9[_0x0714('0x2a')]);if(_0x4855e9[_0x0714('0x2b')]){delete _0x4855e9[_0x0714('0x2b')];}_0x17887e[_0x0714('0x1a')](_0x896db)[_0x0714('0x2c')](_0x4855e9);};}exports[_0x0714('0x2d')]=function(_0x5e59f3,_0x4415e0){var _0x51c33c={},_0x5ba0fb={},_0x2ae3ec={'count':0x0,'rows':[]};var _0x25a303=_['map'](db[_0x0714('0x2e')]['rawAttributes'],function(_0x7dde52){return{'name':_0x7dde52[_0x0714('0x2f')],'type':_0x7dde52[_0x0714('0x30')][_0x0714('0x31')]};});_0x5ba0fb['model']=_[_0x0714('0x32')](_0x25a303,_0x0714('0x2b'));_0x5ba0fb['query']=_['keys'](_0x5e59f3[_0x0714('0x33')]);_0x5ba0fb['filters']=_[_0x0714('0x34')](_0x5ba0fb[_0x0714('0x35')],_0x5ba0fb[_0x0714('0x33')]);_0x51c33c[_0x0714('0x36')]=_[_0x0714('0x34')](_0x5ba0fb[_0x0714('0x35')],qs['fields'](_0x5e59f3[_0x0714('0x33')][_0x0714('0x37')]));_0x51c33c['attributes']=_0x51c33c[_0x0714('0x36')]['length']?_0x51c33c[_0x0714('0x36')]:_0x5ba0fb['model'];if(!_0x5e59f3[_0x0714('0x33')][_0x0714('0x38')]('nolimit')){_0x51c33c[_0x0714('0x1f')]=qs['limit'](_0x5e59f3[_0x0714('0x33')]['limit']);_0x51c33c[_0x0714('0x1d')]=qs[_0x0714('0x1d')](_0x5e59f3[_0x0714('0x33')][_0x0714('0x1d')]);}_0x51c33c[_0x0714('0x39')]=qs[_0x0714('0x3a')](_0x5e59f3[_0x0714('0x33')]['sort']);_0x51c33c[_0x0714('0x3b')]=qs['filters'](_['pick'](_0x5e59f3[_0x0714('0x33')],_0x5ba0fb[_0x0714('0x3c')]),_0x25a303);if(_0x5e59f3['query'][_0x0714('0x3d')]){_0x51c33c[_0x0714('0x3b')]=_[_0x0714('0x3e')](_0x51c33c[_0x0714('0x3b')],{'$or':_['map'](_0x25a303,function(_0x38d398){if(_0x38d398[_0x0714('0x30')]!==_0x0714('0x3f')){var _0x1314f2={};_0x1314f2[_0x38d398[_0x0714('0x2b')]]={'$like':'%'+_0x5e59f3['query'][_0x0714('0x3d')]+'%'};return _0x1314f2;}})});}_0x51c33c=_[_0x0714('0x3e')]({},_0x51c33c,_0x5e59f3[_0x0714('0x40')]);var _0x2066c1={'where':_0x51c33c[_0x0714('0x3b')]};return db['FreshsalesAccount'][_0x0714('0x20')](_0x2066c1)[_0x0714('0x27')](function(_0x5baaee){_0x2ae3ec[_0x0714('0x20')]=_0x5baaee;if(_0x5e59f3[_0x0714('0x33')]['includeAll']){_0x51c33c[_0x0714('0x41')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x51c33c);})[_0x0714('0x27')](function(_0x78fe1d){_0x2ae3ec[_0x0714('0x42')]=_0x78fe1d;return _0x2ae3ec;})[_0x0714('0x27')](respondWithFilteredResult(_0x4415e0,_0x51c33c))['catch'](handleError(_0x4415e0,null));};exports[_0x0714('0x43')]=function(_0x450996,_0x30cbf3){var _0x27f212={'raw':![],'where':{'id':_0x450996[_0x0714('0x44')]['id']}},_0x575caa={};_0x575caa[_0x0714('0x35')]=_['keys'](db['FreshsalesAccount'][_0x0714('0x45')]);_0x575caa[_0x0714('0x33')]=_[_0x0714('0x46')](_0x450996[_0x0714('0x33')]);_0x575caa[_0x0714('0x3c')]=_[_0x0714('0x34')](_0x575caa['model'],_0x575caa['query']);_0x27f212[_0x0714('0x36')]=_[_0x0714('0x34')](_0x575caa[_0x0714('0x35')],qs[_0x0714('0x37')](_0x450996[_0x0714('0x33')][_0x0714('0x37')]));_0x27f212[_0x0714('0x36')]=_0x27f212['attributes'][_0x0714('0x47')]?_0x27f212[_0x0714('0x36')]:_0x575caa[_0x0714('0x35')];if(_0x450996[_0x0714('0x33')]['includeAll']){_0x27f212[_0x0714('0x41')]=[{'all':!![]}];}_0x27f212=_[_0x0714('0x3e')]({},_0x27f212,_0x450996[_0x0714('0x40')]);return db[_0x0714('0x2e')][_0x0714('0x48')](_0x27f212)['then'](handleEntityNotFound(_0x30cbf3,null))[_0x0714('0x27')](respondWithResult(_0x30cbf3,null))[_0x0714('0x49')](handleError(_0x30cbf3,null));};exports[_0x0714('0x4a')]=function(_0x50bf7b,_0xc3bb91){return db[_0x0714('0x2e')][_0x0714('0x4a')](_0x50bf7b[_0x0714('0x4b')],{})[_0x0714('0x27')](respondWithResult(_0xc3bb91,0xc9))[_0x0714('0x49')](handleError(_0xc3bb91,null));};exports[_0x0714('0x26')]=function(_0x5d89a1,_0x34cdaa){if(_0x5d89a1['body']['id']){delete _0x5d89a1['body']['id'];}return db['FreshsalesAccount'][_0x0714('0x48')]({'where':{'id':_0x5d89a1[_0x0714('0x44')]['id']}})[_0x0714('0x27')](handleEntityNotFound(_0x34cdaa,null))['then'](saveUpdates(_0x5d89a1['body'],null))['then'](respondWithResult(_0x34cdaa,null))[_0x0714('0x49')](handleError(_0x34cdaa,null));};exports[_0x0714('0x4c')]=function(_0x11afd6,_0x10f55b){return db[_0x0714('0x2e')]['find']({'where':{'id':_0x11afd6[_0x0714('0x44')]['id']}})[_0x0714('0x27')](handleEntityNotFound(_0x10f55b,null))[_0x0714('0x27')](removeEntity(_0x10f55b,null))[_0x0714('0x49')](handleError(_0x10f55b,null));};exports[_0x0714('0x4d')]=function(_0x3bb414,_0x12274a,_0x2c3e07){var _0x905afd={};var _0x15db50={};var _0x50d601;var _0x618d7f;return db[_0x0714('0x2e')][_0x0714('0x4e')]({'where':{'id':_0x3bb414['params']['id']}})['then'](handleEntityNotFound(_0x12274a,null))[_0x0714('0x27')](function(_0x25499c){if(_0x25499c){_0x50d601=_0x25499c;_0x15db50[_0x0714('0x35')]=_[_0x0714('0x46')](db[_0x0714('0x4f')]['rawAttributes']);_0x15db50[_0x0714('0x33')]=_[_0x0714('0x46')](_0x3bb414[_0x0714('0x33')]);_0x15db50[_0x0714('0x3c')]=_[_0x0714('0x34')](_0x15db50['model'],_0x15db50[_0x0714('0x33')]);_0x905afd[_0x0714('0x36')]=_[_0x0714('0x34')](_0x15db50[_0x0714('0x35')],qs[_0x0714('0x37')](_0x3bb414[_0x0714('0x33')]['fields']));_0x905afd[_0x0714('0x36')]=_0x905afd[_0x0714('0x36')][_0x0714('0x47')]?_0x905afd[_0x0714('0x36')]:_0x15db50[_0x0714('0x35')];_0x905afd[_0x0714('0x39')]=qs['sort'](_0x3bb414[_0x0714('0x33')]['sort']);_0x905afd['where']=qs[_0x0714('0x3c')](_[_0x0714('0x50')](_0x3bb414[_0x0714('0x33')],_0x15db50[_0x0714('0x3c')]));if(_0x3bb414[_0x0714('0x33')]['filter']){_0x905afd['where']=_[_0x0714('0x3e')](_0x905afd[_0x0714('0x3b')],{'$or':_['map'](_0x905afd['attributes'],function(_0x2f571d){var _0x1edbe3={};_0x1edbe3[_0x2f571d]={'$like':'%'+_0x3bb414[_0x0714('0x33')][_0x0714('0x3d')]+'%'};return _0x1edbe3;})});}_0x905afd=_[_0x0714('0x3e')]({},_0x905afd,_0x3bb414['options']);return _0x50d601[_0x0714('0x4d')](_0x905afd);}})[_0x0714('0x27')](function(_0x25397e){if(_0x25397e){_0x618d7f=_0x25397e['length'];if(!_0x3bb414[_0x0714('0x33')][_0x0714('0x38')](_0x0714('0x51'))){_0x905afd[_0x0714('0x1f')]=qs[_0x0714('0x1f')](_0x3bb414[_0x0714('0x33')][_0x0714('0x1f')]);_0x905afd[_0x0714('0x1d')]=qs['offset'](_0x3bb414[_0x0714('0x33')][_0x0714('0x1d')]);}return _0x50d601[_0x0714('0x4d')](_0x905afd);}})[_0x0714('0x27')](function(_0x412928){if(_0x412928){return _0x412928?{'count':_0x618d7f,'rows':_0x412928}:null;}})[_0x0714('0x27')](respondWithResult(_0x12274a,null))[_0x0714('0x49')](handleError(_0x12274a,null));};exports[_0x0714('0x52')]=function(_0x100f67,_0x3fec1c,_0x615a66){if(_0x100f67['body']['id']){delete _0x100f67[_0x0714('0x4b')]['id'];}return db[_0x0714('0x2e')][_0x0714('0x4e')]({'where':{'id':_0x100f67[_0x0714('0x44')]['id']}})[_0x0714('0x27')](handleEntityNotFound(_0x3fec1c,null))[_0x0714('0x27')](function(_0x1b2328){if(_0x1b2328){_0x100f67[_0x0714('0x4b')][_0x0714('0x53')]=_0x1b2328['id'];_0x100f67[_0x0714('0x4b')]['Subjects']=integrations[_0x0714('0x54')](_0x100f67[_0x0714('0x4b')][_0x0714('0x55')],_0x100f67[_0x0714('0x4b')][_0x0714('0x30')]);_0x100f67[_0x0714('0x4b')][_0x0714('0x56')]=integrations['getDescriptions'](_0x100f67[_0x0714('0x4b')][_0x0714('0x55')],_0x100f67[_0x0714('0x4b')][_0x0714('0x30')]);return db[_0x0714('0x4f')][_0x0714('0x4a')](_0x100f67['body'],{'include':[{'model':db[_0x0714('0x57')],'as':_0x0714('0x58')},{'model':db[_0x0714('0x57')],'as':_0x0714('0x56')}]});}return null;})[_0x0714('0x27')](respondWithResult(_0x3fec1c,null))[_0x0714('0x49')](handleError(_0x3fec1c,null));};exports[_0x0714('0x59')]=function(_0x7a848b,_0x5c968f,_0x4381a6){var _0x12befc='';var _0x5672ea='';return db['FreshsalesAccount'][_0x0714('0x4e')]({'where':{'id':_0x7a848b[_0x0714('0x44')]['id']},'attributes':['id',_0x0714('0x5a'),_0x0714('0x5b'),_0x0714('0x5c')]})[_0x0714('0x27')](handleEntityNotFound(_0x5c968f,null))[_0x0714('0x27')](function(_0x1f551c){if(_0x1f551c){_0x5672ea=_0x1f551c[_0x0714('0x5a')];_0x12befc=_0x1f551c[_0x0714('0x5b')];var _0x1e2784=_0x1f551c[_0x0714('0x5b')][_0x0714('0x5d')](-0x1);if(_0x1e2784==='/'){_0x12befc=_0x12befc[_0x0714('0x5e')](0x0,_0x12befc[_0x0714('0x5f')](_0x1e2784));}return rp({'method':_0x0714('0x60'),'uri':util['format'](_0x0714('0x61'),_0x12befc,'/api/selector/owners'),'headers':{'Authorization':_0x0714('0x62')+_0x1f551c[_0x0714('0x5c')]},'json':!![]});}})[_0x0714('0x27')](function(_0x47c053){if(_0x47c053){var _0x247931=_0x47c053[_0x0714('0x63')];var _0x4bfff9=![];var _0x398f05=null;for(_0x398f05=0x0;_0x398f05<_0x247931[_0x0714('0x47')];_0x398f05++){if(_0x247931[_0x398f05][_0x0714('0x64')]===_0x5672ea){_0x4bfff9=!![];}}if(_0x4bfff9){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x0714('0x27')](respondWithResult(_0x5c968f,null))[_0x0714('0x49')](function(_0x793475){var _0x319c31=_0x7a848b['query'][_0x0714('0x65')]?0x1f4:_0x793475[_0x0714('0x66')]||0x1f4;logger[_0x0714('0x29')](_0x0714('0x67'),_0x0714('0x59'),_0x319c31,JSON['stringify'](_0x793475));delete _0x793475[_0x0714('0x2b')];if(_0x319c31===0x191){_0x319c31=0x190;}_0x5c968f[_0x0714('0x1a')](_0x319c31)[_0x0714('0x2c')](_0x7a848b[_0x0714('0x33')][_0x0714('0x65')]?{'message':'Wrong\x20credentials','statusCode':_0x793475[_0x0714('0x66')]}:_0x793475);});}; \ No newline at end of file +var _0xa485=['GET','%s%s','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','FreshsalesAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','rows','params','find','create','body','catch','getConfigurations','findOne','FreshsalesConfiguration','order','options','addConfiguration','AccountId','Subjects','channel','getDescriptions','type','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','substring'];(function(_0x38bc6e,_0x44d0b0){var _0x1b0ff3=function(_0x3acad1){while(--_0x3acad1){_0x38bc6e['push'](_0x38bc6e['shift']());}};_0x1b0ff3(++_0x44d0b0);}(_0xa485,0x1f3));var _0x5a48=function(_0xda7efc,_0x33708c){_0xda7efc=_0xda7efc-0x0;var _0x5cdf85=_0xa485[_0xda7efc];return _0x5cdf85;};'use strict';var emlformat=require(_0x5a48('0x0'));var rimraf=require(_0x5a48('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a48('0x2'));var rp=require(_0x5a48('0x3'));var moment=require(_0x5a48('0x4'));var BPromise=require(_0x5a48('0x5'));var Mustache=require(_0x5a48('0x6'));var util=require(_0x5a48('0x7'));var path=require(_0x5a48('0x8'));var sox=require(_0x5a48('0x9'));var csv=require(_0x5a48('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a48('0xb'));var _=require(_0x5a48('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5a48('0xd'));var deskjs=require(_0x5a48('0xe'));var toCsv=require(_0x5a48('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5a48('0xf'));var authService=require(_0x5a48('0x10'));var qs=require(_0x5a48('0x11'));var as=require(_0x5a48('0x12'));var hardwareService=require(_0x5a48('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5a48('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a48('0x15'))['db'];var integrations=require(_0x5a48('0x16'));function respondWithStatusCode(_0x257692,_0x40ba43){_0x40ba43=_0x40ba43||0xcc;return function(_0x1f062f){if(_0x1f062f){return _0x257692[_0x5a48('0x17')](_0x40ba43);}return _0x257692[_0x5a48('0x18')](_0x40ba43)[_0x5a48('0x19')]();};}function respondWithResult(_0x3b8ea1,_0x1cfc99){_0x1cfc99=_0x1cfc99||0xc8;return function(_0x3ae8e9){if(_0x3ae8e9){return _0x3b8ea1[_0x5a48('0x18')](_0x1cfc99)['json'](_0x3ae8e9);}};}function respondWithFilteredResult(_0x11248f,_0x50058b){return function(_0x27403f){if(_0x27403f){var _0x3c6d72=typeof _0x50058b[_0x5a48('0x1a')]===_0x5a48('0x1b')&&typeof _0x50058b[_0x5a48('0x1c')]===_0x5a48('0x1b');var _0x2c73d3=_0x27403f[_0x5a48('0x1d')];var _0x151427=_0x3c6d72?0x0:_0x50058b[_0x5a48('0x1a')];var _0x414d12=_0x3c6d72?_0x27403f[_0x5a48('0x1d')]:_0x50058b['offset']+_0x50058b[_0x5a48('0x1c')];var _0x485954;if(_0x414d12>=_0x2c73d3){_0x414d12=_0x2c73d3;_0x485954=0xc8;}else{_0x485954=0xce;}_0x11248f['status'](_0x485954);return _0x11248f[_0x5a48('0x1e')](_0x5a48('0x1f'),_0x151427+'-'+_0x414d12+'/'+_0x2c73d3)[_0x5a48('0x20')](_0x27403f);}return null;};}function patchUpdates(_0x1c3e9d){return function(_0xb87fa5){try{jsonpatch[_0x5a48('0x21')](_0xb87fa5,_0x1c3e9d,!![]);}catch(_0xcabc60){return BPromise[_0x5a48('0x22')](_0xcabc60);}return _0xb87fa5['save']();};}function saveUpdates(_0xd9a652,_0x463047){return function(_0x1d6481){if(_0x1d6481){return _0x1d6481[_0x5a48('0x23')](_0xd9a652)[_0x5a48('0x24')](function(_0x1379fe){return _0x1379fe;});}return null;};}function removeEntity(_0x3d0f54,_0x31f33a){return function(_0x279140){if(_0x279140){return _0x279140[_0x5a48('0x25')]()['then'](function(){_0x3d0f54[_0x5a48('0x18')](0xcc)[_0x5a48('0x19')]();});}};}function handleEntityNotFound(_0x57e8c6,_0x2e3b1f){return function(_0x50b68a){if(!_0x50b68a){_0x57e8c6[_0x5a48('0x17')](0x194);}return _0x50b68a;};}function handleError(_0x2ca04d,_0x4165dc){_0x4165dc=_0x4165dc||0x1f4;return function(_0x3c5170){logger[_0x5a48('0x26')](_0x3c5170[_0x5a48('0x27')]);if(_0x3c5170['name']){delete _0x3c5170[_0x5a48('0x28')];}_0x2ca04d['status'](_0x4165dc)[_0x5a48('0x29')](_0x3c5170);};}exports[_0x5a48('0x2a')]=function(_0x5a894a,_0x3a324c){var _0x247569={},_0x195401={},_0xbf4f1c={'count':0x0,'rows':[]};var _0x58583c=_['map'](db[_0x5a48('0x2b')][_0x5a48('0x2c')],function(_0x281ba3){return{'name':_0x281ba3[_0x5a48('0x2d')],'type':_0x281ba3['type'][_0x5a48('0x2e')]};});_0x195401[_0x5a48('0x2f')]=_[_0x5a48('0x30')](_0x58583c,_0x5a48('0x28'));_0x195401[_0x5a48('0x31')]=_[_0x5a48('0x32')](_0x5a894a[_0x5a48('0x31')]);_0x195401[_0x5a48('0x33')]=_[_0x5a48('0x34')](_0x195401['model'],_0x195401[_0x5a48('0x31')]);_0x247569[_0x5a48('0x35')]=_[_0x5a48('0x34')](_0x195401[_0x5a48('0x2f')],qs[_0x5a48('0x36')](_0x5a894a[_0x5a48('0x31')][_0x5a48('0x36')]));_0x247569[_0x5a48('0x35')]=_0x247569[_0x5a48('0x35')][_0x5a48('0x37')]?_0x247569['attributes']:_0x195401['model'];if(!_0x5a894a[_0x5a48('0x31')][_0x5a48('0x38')]('nolimit')){_0x247569[_0x5a48('0x1c')]=qs[_0x5a48('0x1c')](_0x5a894a[_0x5a48('0x31')][_0x5a48('0x1c')]);_0x247569['offset']=qs['offset'](_0x5a894a[_0x5a48('0x31')][_0x5a48('0x1a')]);}_0x247569['order']=qs[_0x5a48('0x39')](_0x5a894a[_0x5a48('0x31')]['sort']);_0x247569[_0x5a48('0x3a')]=qs[_0x5a48('0x33')](_[_0x5a48('0x3b')](_0x5a894a[_0x5a48('0x31')],_0x195401['filters']),_0x58583c);if(_0x5a894a['query'][_0x5a48('0x3c')]){_0x247569['where']=_[_0x5a48('0x3d')](_0x247569['where'],{'$or':_[_0x5a48('0x30')](_0x58583c,function(_0x52d086){if(_0x52d086['type']!=='VIRTUAL'){var _0x14494a={};_0x14494a[_0x52d086[_0x5a48('0x28')]]={'$like':'%'+_0x5a894a[_0x5a48('0x31')][_0x5a48('0x3c')]+'%'};return _0x14494a;}})});}_0x247569=_[_0x5a48('0x3d')]({},_0x247569,_0x5a894a['options']);var _0x2326a9={'where':_0x247569[_0x5a48('0x3a')]};return db[_0x5a48('0x2b')][_0x5a48('0x1d')](_0x2326a9)['then'](function(_0x219aea){_0xbf4f1c[_0x5a48('0x1d')]=_0x219aea;if(_0x5a894a[_0x5a48('0x31')][_0x5a48('0x3e')]){_0x247569[_0x5a48('0x3f')]=[{'all':!![]}];}return db[_0x5a48('0x2b')]['findAll'](_0x247569);})[_0x5a48('0x24')](function(_0x25b6b9){_0xbf4f1c[_0x5a48('0x40')]=_0x25b6b9;return _0xbf4f1c;})['then'](respondWithFilteredResult(_0x3a324c,_0x247569))['catch'](handleError(_0x3a324c,null));};exports['show']=function(_0x477e97,_0x2d70ef){var _0x433c7d={'raw':![],'where':{'id':_0x477e97[_0x5a48('0x41')]['id']}},_0x57a56a={};_0x57a56a[_0x5a48('0x2f')]=_[_0x5a48('0x32')](db[_0x5a48('0x2b')][_0x5a48('0x2c')]);_0x57a56a[_0x5a48('0x31')]=_[_0x5a48('0x32')](_0x477e97[_0x5a48('0x31')]);_0x57a56a[_0x5a48('0x33')]=_[_0x5a48('0x34')](_0x57a56a[_0x5a48('0x2f')],_0x57a56a[_0x5a48('0x31')]);_0x433c7d[_0x5a48('0x35')]=_[_0x5a48('0x34')](_0x57a56a[_0x5a48('0x2f')],qs['fields'](_0x477e97[_0x5a48('0x31')][_0x5a48('0x36')]));_0x433c7d[_0x5a48('0x35')]=_0x433c7d['attributes'][_0x5a48('0x37')]?_0x433c7d[_0x5a48('0x35')]:_0x57a56a[_0x5a48('0x2f')];if(_0x477e97[_0x5a48('0x31')][_0x5a48('0x3e')]){_0x433c7d[_0x5a48('0x3f')]=[{'all':!![]}];}_0x433c7d=_[_0x5a48('0x3d')]({},_0x433c7d,_0x477e97['options']);return db[_0x5a48('0x2b')][_0x5a48('0x42')](_0x433c7d)[_0x5a48('0x24')](handleEntityNotFound(_0x2d70ef,null))['then'](respondWithResult(_0x2d70ef,null))['catch'](handleError(_0x2d70ef,null));};exports['create']=function(_0x2b6f1a,_0x161742){return db[_0x5a48('0x2b')][_0x5a48('0x43')](_0x2b6f1a[_0x5a48('0x44')],{})[_0x5a48('0x24')](respondWithResult(_0x161742,0xc9))[_0x5a48('0x45')](handleError(_0x161742,null));};exports[_0x5a48('0x23')]=function(_0x371573,_0xcc3dd1){if(_0x371573[_0x5a48('0x44')]['id']){delete _0x371573[_0x5a48('0x44')]['id'];}return db[_0x5a48('0x2b')][_0x5a48('0x42')]({'where':{'id':_0x371573[_0x5a48('0x41')]['id']}})[_0x5a48('0x24')](handleEntityNotFound(_0xcc3dd1,null))[_0x5a48('0x24')](saveUpdates(_0x371573[_0x5a48('0x44')],null))['then'](respondWithResult(_0xcc3dd1,null))[_0x5a48('0x45')](handleError(_0xcc3dd1,null));};exports[_0x5a48('0x25')]=function(_0x15ebb7,_0x2ac5fa){return db['FreshsalesAccount'][_0x5a48('0x42')]({'where':{'id':_0x15ebb7[_0x5a48('0x41')]['id']}})[_0x5a48('0x24')](handleEntityNotFound(_0x2ac5fa,null))[_0x5a48('0x24')](removeEntity(_0x2ac5fa,null))[_0x5a48('0x45')](handleError(_0x2ac5fa,null));};exports[_0x5a48('0x46')]=function(_0x27377b,_0x5cb8cb,_0x33a3b0){var _0x377dff={};var _0x8ea1b1={};var _0x415790;var _0x19e9e1;return db[_0x5a48('0x2b')][_0x5a48('0x47')]({'where':{'id':_0x27377b[_0x5a48('0x41')]['id']}})[_0x5a48('0x24')](handleEntityNotFound(_0x5cb8cb,null))[_0x5a48('0x24')](function(_0x4e5082){if(_0x4e5082){_0x415790=_0x4e5082;_0x8ea1b1[_0x5a48('0x2f')]=_['keys'](db[_0x5a48('0x48')][_0x5a48('0x2c')]);_0x8ea1b1[_0x5a48('0x31')]=_[_0x5a48('0x32')](_0x27377b[_0x5a48('0x31')]);_0x8ea1b1['filters']=_[_0x5a48('0x34')](_0x8ea1b1[_0x5a48('0x2f')],_0x8ea1b1[_0x5a48('0x31')]);_0x377dff[_0x5a48('0x35')]=_[_0x5a48('0x34')](_0x8ea1b1[_0x5a48('0x2f')],qs[_0x5a48('0x36')](_0x27377b[_0x5a48('0x31')][_0x5a48('0x36')]));_0x377dff[_0x5a48('0x35')]=_0x377dff[_0x5a48('0x35')][_0x5a48('0x37')]?_0x377dff[_0x5a48('0x35')]:_0x8ea1b1[_0x5a48('0x2f')];_0x377dff[_0x5a48('0x49')]=qs['sort'](_0x27377b[_0x5a48('0x31')]['sort']);_0x377dff[_0x5a48('0x3a')]=qs[_0x5a48('0x33')](_[_0x5a48('0x3b')](_0x27377b[_0x5a48('0x31')],_0x8ea1b1[_0x5a48('0x33')]));if(_0x27377b[_0x5a48('0x31')][_0x5a48('0x3c')]){_0x377dff[_0x5a48('0x3a')]=_[_0x5a48('0x3d')](_0x377dff['where'],{'$or':_[_0x5a48('0x30')](_0x377dff[_0x5a48('0x35')],function(_0x4f8b5e){var _0x4b6364={};_0x4b6364[_0x4f8b5e]={'$like':'%'+_0x27377b[_0x5a48('0x31')][_0x5a48('0x3c')]+'%'};return _0x4b6364;})});}_0x377dff=_[_0x5a48('0x3d')]({},_0x377dff,_0x27377b[_0x5a48('0x4a')]);return _0x415790['getConfigurations'](_0x377dff);}})['then'](function(_0x47544b){if(_0x47544b){_0x19e9e1=_0x47544b[_0x5a48('0x37')];if(!_0x27377b['query'][_0x5a48('0x38')]('nolimit')){_0x377dff[_0x5a48('0x1c')]=qs['limit'](_0x27377b[_0x5a48('0x31')][_0x5a48('0x1c')]);_0x377dff[_0x5a48('0x1a')]=qs[_0x5a48('0x1a')](_0x27377b[_0x5a48('0x31')][_0x5a48('0x1a')]);}return _0x415790['getConfigurations'](_0x377dff);}})[_0x5a48('0x24')](function(_0x5244a1){if(_0x5244a1){return _0x5244a1?{'count':_0x19e9e1,'rows':_0x5244a1}:null;}})['then'](respondWithResult(_0x5cb8cb,null))[_0x5a48('0x45')](handleError(_0x5cb8cb,null));};exports[_0x5a48('0x4b')]=function(_0x16e402,_0x23aafe,_0x3e0097){if(_0x16e402[_0x5a48('0x44')]['id']){delete _0x16e402[_0x5a48('0x44')]['id'];}return db[_0x5a48('0x2b')]['findOne']({'where':{'id':_0x16e402[_0x5a48('0x41')]['id']}})[_0x5a48('0x24')](handleEntityNotFound(_0x23aafe,null))[_0x5a48('0x24')](function(_0x42c8f4){if(_0x42c8f4){_0x16e402[_0x5a48('0x44')][_0x5a48('0x4c')]=_0x42c8f4['id'];_0x16e402['body'][_0x5a48('0x4d')]=integrations['getSubjects'](_0x16e402['body'][_0x5a48('0x4e')],_0x16e402[_0x5a48('0x44')]['type']);_0x16e402[_0x5a48('0x44')]['Descriptions']=integrations[_0x5a48('0x4f')](_0x16e402[_0x5a48('0x44')]['channel'],_0x16e402[_0x5a48('0x44')][_0x5a48('0x50')]);return db[_0x5a48('0x48')]['create'](_0x16e402[_0x5a48('0x44')],{'include':[{'model':db[_0x5a48('0x51')],'as':_0x5a48('0x4d')},{'model':db['FreshsalesField'],'as':_0x5a48('0x52')}]});}return null;})[_0x5a48('0x24')](respondWithResult(_0x23aafe,null))[_0x5a48('0x45')](handleError(_0x23aafe,null));};exports[_0x5a48('0x53')]=function(_0x209825,_0x48410e,_0x385b3c){var _0x2456f7='';var _0x2529b3='';return db[_0x5a48('0x2b')][_0x5a48('0x47')]({'where':{'id':_0x209825[_0x5a48('0x41')]['id']},'attributes':['id',_0x5a48('0x54'),_0x5a48('0x55'),_0x5a48('0x56')]})['then'](handleEntityNotFound(_0x48410e,null))['then'](function(_0x25d564){if(_0x25d564){_0x2529b3=_0x25d564[_0x5a48('0x54')];_0x2456f7=_0x25d564['remoteUri'];var _0x100bfc=_0x25d564[_0x5a48('0x55')][_0x5a48('0x57')](-0x1);if(_0x100bfc==='/'){_0x2456f7=_0x2456f7[_0x5a48('0x58')](0x0,_0x2456f7['lastIndexOf'](_0x100bfc));}return rp({'method':_0x5a48('0x59'),'uri':util['format'](_0x5a48('0x5a'),_0x2456f7,'/api/selector/owners'),'headers':{'Authorization':_0x5a48('0x5b')+_0x25d564['apiKey']},'json':!![]});}})[_0x5a48('0x24')](function(_0x32fc5c){if(_0x32fc5c){var _0x4ebe2b=_0x32fc5c['users'];var _0x514435=![];var _0x291cd7=null;for(_0x291cd7=0x0;_0x291cd7<_0x4ebe2b[_0x5a48('0x37')];_0x291cd7++){if(_0x4ebe2b[_0x291cd7][_0x5a48('0x5c')]===_0x2529b3){_0x514435=!![];}}if(_0x514435){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x5a48('0x5d')});}}})[_0x5a48('0x24')](respondWithResult(_0x48410e,null))['catch'](function(_0x3f891d){var _0x5206a2=_0x209825[_0x5a48('0x31')][_0x5a48('0x5e')]?0x1f4:_0x3f891d['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x5a48('0x53'),_0x5206a2,JSON[_0x5a48('0x5f')](_0x3f891d));delete _0x3f891d[_0x5a48('0x28')];if(_0x5206a2===0x191){_0x5206a2=0x190;}_0x48410e[_0x5a48('0x18')](_0x5206a2)[_0x5a48('0x29')](_0x209825[_0x5a48('0x31')][_0x5a48('0x5e')]?{'message':_0x5a48('0x60'),'statusCode':_0x3f891d[_0x5a48('0x61')]}:_0x3f891d);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index f8d1ed7..d289c9e 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 _0x1967=['rimraf','../../config/environment','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2ed7d1,_0x363741){var _0x38ae3c=function(_0x4a1b42){while(--_0x4a1b42){_0x2ed7d1['push'](_0x2ed7d1['shift']());}};_0x38ae3c(++_0x363741);}(_0x1967,0x173));var _0x7196=function(_0x1db9ce,_0xfdf1d0){_0x1db9ce=_0x1db9ce-0x0;var _0x1e4876=_0x1967[_0x1db9ce];return _0x1e4876;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x7196('0xa')]=function(_0x186175,_0x194746){return _0x186175[_0x7196('0xb')](_0x7196('0xc'),attributes,{'tableName':_0x7196('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb091=['request-promise','../../config/environment','./intFreshsalesAccount.attributes','exports','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','api','moment'];(function(_0xfb8ca0,_0x687e3){var _0xc88401=function(_0x3c4587){while(--_0x3c4587){_0xfb8ca0['push'](_0xfb8ca0['shift']());}};_0xc88401(++_0x687e3);}(_0xb091,0x16e));var _0x1b09=function(_0xa8dba1,_0x397707){_0xa8dba1=_0xa8dba1-0x0;var _0xc3b4bf=_0xb091[_0xa8dba1];return _0xc3b4bf;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var logger=require(_0x1b09('0x1'))(_0x1b09('0x2'));var moment=require(_0x1b09('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b09('0x5'));var attributes=require(_0x1b09('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x1b09('0x7')]=function(_0x5fa348,_0x2bf4f6){return _0x5fa348['define'](_0x1b09('0x8'),attributes,{'tableName':_0x1b09('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 93329b5..15d42af 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 _0x1a37=['model','then','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x5bb4e8,_0x44b756){var _0x2a86f2=function(_0x279ab2){while(--_0x279ab2){_0x5bb4e8['push'](_0x5bb4e8['shift']());}};_0x2a86f2(++_0x44b756);}(_0x1a37,0xb4));var _0x71a3=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x1a37[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45050a,_0x231ea7,_0x2bb6a2){return new BPromise(function(_0x4a9ab2,_0x53b893){return client['request'](_0x45050a,_0x2bb6a2)['then'](function(_0x89da86){logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,_0x71a3('0xe'));logger[_0x71a3('0xf')](_0x71a3('0x10'),_0x231ea7,_0x71a3('0xe'),JSON[_0x71a3('0x11')](_0x89da86));if(_0x89da86['error']){if(_0x89da86['error']['code']===0x1f4){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x53b893(_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);}logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x4a9ab2(_0x89da86[_0x71a3('0x12')]['message']);}else{logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,'request\x20sent');_0x4a9ab2(_0x89da86['result'][_0x71a3('0x13')]);}})[_0x71a3('0x14')](function(_0xee797f){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0xee797f);_0x53b893(_0xee797f);});});}exports[_0x71a3('0x15')]=function(_0x5d4dee){var _0x656cd2=this;return new Promise(function(_0x27bfb4,_0x5b955a){return db['FreshsalesAccount'][_0x71a3('0x16')]({'raw':_0x5d4dee[_0x71a3('0x17')]?_0x5d4dee[_0x71a3('0x17')][_0x71a3('0x18')]===undefined?!![]:![]:!![],'where':_0x5d4dee[_0x71a3('0x17')]?_0x5d4dee['options'][_0x71a3('0x19')]||null:null,'attributes':_0x5d4dee[_0x71a3('0x17')]?_0x5d4dee[_0x71a3('0x17')][_0x71a3('0x1a')]||null:null,'limit':_0x5d4dee[_0x71a3('0x17')]?_0x5d4dee['options'][_0x71a3('0x1b')]||null:null,'include':_0x5d4dee['options']?_0x5d4dee[_0x71a3('0x17')][_0x71a3('0x1c')]?_[_0x71a3('0x1d')](_0x5d4dee[_0x71a3('0x17')][_0x71a3('0x1c')],function(_0x2847b4){return{'model':db[_0x2847b4['model']],'as':_0x2847b4['as'],'attributes':_0x2847b4[_0x71a3('0x1a')],'include':_0x2847b4[_0x71a3('0x1c')]?_[_0x71a3('0x1d')](_0x2847b4[_0x71a3('0x1c')],function(_0xb0f3aa){return{'model':db[_0xb0f3aa['model']],'as':_0xb0f3aa['as'],'attributes':_0xb0f3aa[_0x71a3('0x1a')],'include':_0xb0f3aa[_0x71a3('0x1c')]?_['map'](_0xb0f3aa[_0x71a3('0x1c')],function(_0x515519){return{'model':db[_0x515519[_0x71a3('0x1e')]],'as':_0x515519['as'],'attributes':_0x515519[_0x71a3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x71a3('0x1f')](function(_0x35b5c7){logger[_0x71a3('0xc')](_0x71a3('0x15'),_0x5d4dee);logger[_0x71a3('0xf')](_0x71a3('0x15'),_0x5d4dee,JSON[_0x71a3('0x11')](_0x35b5c7));_0x27bfb4(_0x35b5c7);})[_0x71a3('0x14')](function(_0x3ea7aa){logger[_0x71a3('0x12')]('GetFreshsalesAccount',_0x3ea7aa[_0x71a3('0x13')],_0x5d4dee);_0x5b955a(_0x656cd2[_0x71a3('0x12')](0x1f4,_0x3ea7aa[_0x71a3('0x13')]));});});};exports[_0x71a3('0x20')]=function(_0x4a750c){var _0x18a8fe=this;return new Promise(function(_0x216d84,_0x45d13d){return db[_0x71a3('0x21')][_0x71a3('0x22')]({'raw':_0x4a750c[_0x71a3('0x17')]?_0x4a750c[_0x71a3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4a750c[_0x71a3('0x17')]?_0x4a750c[_0x71a3('0x17')][_0x71a3('0x19')]||null:null,'attributes':_0x4a750c[_0x71a3('0x17')]?_0x4a750c[_0x71a3('0x17')][_0x71a3('0x1a')]||null:null,'include':_0x4a750c[_0x71a3('0x17')]?_0x4a750c[_0x71a3('0x17')][_0x71a3('0x1c')]?_[_0x71a3('0x1d')](_0x4a750c[_0x71a3('0x17')][_0x71a3('0x1c')],function(_0x447b14){return{'model':db[_0x447b14['model']],'as':_0x447b14['as'],'attributes':_0x447b14['attributes'],'include':_0x447b14[_0x71a3('0x1c')]?_[_0x71a3('0x1d')](_0x447b14['include'],function(_0x39b28e){return{'model':db[_0x39b28e[_0x71a3('0x1e')]],'as':_0x39b28e['as'],'attributes':_0x39b28e['attributes'],'include':_0x39b28e[_0x71a3('0x1c')]?_[_0x71a3('0x1d')](_0x39b28e[_0x71a3('0x1c')],function(_0x250572){return{'model':db[_0x250572[_0x71a3('0x1e')]],'as':_0x250572['as'],'attributes':_0x250572[_0x71a3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x71a3('0x1f')](function(_0x541840){logger[_0x71a3('0xc')](_0x71a3('0x20'),_0x4a750c);logger[_0x71a3('0xf')]('ShowFreshsalesAccount',_0x4a750c,JSON[_0x71a3('0x11')](_0x541840));_0x216d84(_0x541840);})[_0x71a3('0x14')](function(_0x3dc1de){logger[_0x71a3('0x12')](_0x71a3('0x20'),_0x3dc1de['message'],_0x4a750c);_0x45d13d(_0x18a8fe['error'](0x1f4,_0x3dc1de[_0x71a3('0x13')]));});});}; \ No newline at end of file +var _0x0424=['info','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include','model','map','ShowFreshsalesAccount','find','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5da95c,_0xe2e91){var _0x217f22=function(_0x314186){while(--_0x314186){_0x5da95c['push'](_0x5da95c['shift']());}};_0x217f22(++_0xe2e91);}(_0x0424,0x159));var _0x4042=function(_0x5a0e32,_0x347ae2){_0x5a0e32=_0x5a0e32-0x0;var _0xea8f24=_0x0424[_0x5a0e32];return _0xea8f24;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3abaf1,_0xa5310f,_0x10ec07){return new BPromise(function(_0x5d11bf,_0x509772){return client[_0x4042('0x9')](_0x3abaf1,_0x10ec07)[_0x4042('0xa')](function(_0x103e4a){logger['info'](_0x4042('0xb'),_0xa5310f,_0x4042('0xc'));logger[_0x4042('0xd')](_0x4042('0xe'),_0xa5310f,_0x4042('0xc'),JSON[_0x4042('0xf')](_0x103e4a));if(_0x103e4a[_0x4042('0x10')]){if(_0x103e4a[_0x4042('0x10')]['code']===0x1f4){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a['error'][_0x4042('0x11')]);return _0x509772(_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);}logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);return _0x5d11bf(_0x103e4a['error'][_0x4042('0x11')]);}else{logger[_0x4042('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0xa5310f,_0x4042('0xc'));_0x5d11bf(_0x103e4a[_0x4042('0x13')][_0x4042('0x11')]);}})[_0x4042('0x14')](function(_0x31e765){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x31e765);_0x509772(_0x31e765);});});}exports[_0x4042('0x15')]=function(_0x466077){var _0x4b02d4=this;return new Promise(function(_0xe5c1ec,_0x4fe024){return db[_0x4042('0x16')]['findAll']({'raw':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x18')]===undefined?!![]:![]:!![],'where':_0x466077[_0x4042('0x17')]?_0x466077['options'][_0x4042('0x19')]||null:null,'attributes':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x1a')]||null:null,'limit':_0x466077['options']?_0x466077[_0x4042('0x17')][_0x4042('0x1b')]||null:null,'include':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x1c')]?_['map'](_0x466077[_0x4042('0x17')][_0x4042('0x1c')],function(_0x519f2c){return{'model':db[_0x519f2c[_0x4042('0x1d')]],'as':_0x519f2c['as'],'attributes':_0x519f2c['attributes'],'include':_0x519f2c[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x519f2c[_0x4042('0x1c')],function(_0x5d5c6d){return{'model':db[_0x5d5c6d[_0x4042('0x1d')]],'as':_0x5d5c6d['as'],'attributes':_0x5d5c6d[_0x4042('0x1a')],'include':_0x5d5c6d[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x5d5c6d[_0x4042('0x1c')],function(_0x52e575){return{'model':db[_0x52e575['model']],'as':_0x52e575['as'],'attributes':_0x52e575[_0x4042('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4042('0xa')](function(_0x26542c){logger[_0x4042('0x12')](_0x4042('0x15'),_0x466077);logger[_0x4042('0xd')]('GetFreshsalesAccount',_0x466077,JSON[_0x4042('0xf')](_0x26542c));_0xe5c1ec(_0x26542c);})[_0x4042('0x14')](function(_0x4a6a6e){logger[_0x4042('0x10')](_0x4042('0x15'),_0x4a6a6e[_0x4042('0x11')],_0x466077);_0x4fe024(_0x4b02d4['error'](0x1f4,_0x4a6a6e['message']));});});};exports[_0x4042('0x1f')]=function(_0x43bd1c){var _0x59773f=this;return new Promise(function(_0x3e9304,_0xc42d70){return db[_0x4042('0x16')][_0x4042('0x20')]({'raw':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')][_0x4042('0x18')]===undefined?!![]:![]:!![],'where':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['where']||null:null,'attributes':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['attributes']||null:null,'include':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['include']?_[_0x4042('0x1e')](_0x43bd1c[_0x4042('0x17')][_0x4042('0x1c')],function(_0xaa7c99){return{'model':db[_0xaa7c99[_0x4042('0x1d')]],'as':_0xaa7c99['as'],'attributes':_0xaa7c99[_0x4042('0x1a')],'include':_0xaa7c99[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0xaa7c99[_0x4042('0x1c')],function(_0x37195b){return{'model':db[_0x37195b[_0x4042('0x1d')]],'as':_0x37195b['as'],'attributes':_0x37195b[_0x4042('0x1a')],'include':_0x37195b[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x37195b[_0x4042('0x1c')],function(_0x2b5f5e){return{'model':db[_0x2b5f5e[_0x4042('0x1d')]],'as':_0x2b5f5e['as'],'attributes':_0x2b5f5e[_0x4042('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4042('0xa')](function(_0x26b7b0){logger[_0x4042('0x12')]('ShowFreshsalesAccount',_0x43bd1c);logger[_0x4042('0xd')](_0x4042('0x1f'),_0x43bd1c,JSON[_0x4042('0xf')](_0x26b7b0));_0x3e9304(_0x26b7b0);})[_0x4042('0x14')](function(_0x588932){logger[_0x4042('0x10')](_0x4042('0x1f'),_0x588932[_0x4042('0x11')],_0x43bd1c);_0xc42d70(_0x59773f[_0x4042('0x10')](0x1f4,_0x588932[_0x4042('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 61cb644..995fe4a 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 _0x979a=['destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','update','delete'];(function(_0x211d8d,_0xa5417d){var _0xa64ebf=function(_0x1824d5){while(--_0x1824d5){_0x211d8d['push'](_0x211d8d['shift']());}};_0xa64ebf(++_0xa5417d);}(_0x979a,0x1e1));var _0xa979=function(_0x261abd,_0x2f2e52){_0x261abd=_0x261abd-0x0;var _0x345c8e=_0x979a[_0x261abd];return _0x345c8e;};'use strict';var multer=require(_0xa979('0x0'));var util=require(_0xa979('0x1'));var path=require(_0xa979('0x2'));var timeout=require('connect-timeout');var express=require(_0xa979('0x3'));var router=express[_0xa979('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa979('0x5'));var interaction=require(_0xa979('0x6'));var config=require(_0xa979('0x7'));var controller=require(_0xa979('0x8'));router[_0xa979('0x9')]('/',auth[_0xa979('0xa')](),controller[_0xa979('0xb')]);router[_0xa979('0x9')](_0xa979('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa979('0x9')](_0xa979('0xd'),auth['isAuthenticated'](),controller[_0xa979('0xe')]);router['get'](_0xa979('0xf'),auth[_0xa979('0xa')](),controller[_0xa979('0x10')]);router[_0xa979('0x9')](_0xa979('0x11'),auth[_0xa979('0xa')](),controller[_0xa979('0x12')]);router[_0xa979('0x13')]('/',auth[_0xa979('0xa')](),controller[_0xa979('0x14')]);router['put'](_0xa979('0xc'),auth[_0xa979('0xa')](),controller[_0xa979('0x15')]);router[_0xa979('0x16')](_0xa979('0xc'),auth['isAuthenticated'](),controller[_0xa979('0x17')]);module['exports']=router; \ No newline at end of file +var _0xa48d=['../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','isAuthenticated','create','update','delete','destroy','exports','connect-timeout','fs-extra'];(function(_0x4264cc,_0x4e0e1c){var _0x4799e5=function(_0x294795){while(--_0x294795){_0x4264cc['push'](_0x4264cc['shift']());}};_0x4799e5(++_0x4e0e1c);}(_0xa48d,0xb9));var _0xda48=function(_0x2ecf8a,_0x582803){_0x2ecf8a=_0x2ecf8a-0x0;var _0x13f417=_0xa48d[_0x2ecf8a];return _0x13f417;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xda48('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xda48('0x1'));var auth=require(_0xda48('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xda48('0x3'));var controller=require(_0xda48('0x4'));router[_0xda48('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xda48('0x5')](_0xda48('0x6'),auth['isAuthenticated'](),controller[_0xda48('0x7')]);router[_0xda48('0x5')](_0xda48('0x8'),auth['isAuthenticated'](),controller[_0xda48('0x9')]);router['get'](_0xda48('0xa'),auth[_0xda48('0xb')](),controller['getDescriptions']);router['get']('/:id/fields',auth[_0xda48('0xb')](),controller['getFields']);router['post']('/',auth[_0xda48('0xb')](),controller[_0xda48('0xc')]);router['put']('/:id',auth[_0xda48('0xb')](),controller[_0xda48('0xd')]);router[_0xda48('0xe')](_0xda48('0x6'),auth[_0xda48('0xb')](),controller[_0xda48('0xf')]);module[_0xda48('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 21448b3..5aca857 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 _0x3876=['sequelize','exports'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0x3876,0x8e));var _0x6387=function(_0x510d70,_0x1c30c1){_0x510d70=_0x510d70-0x0;var _0x135f68=_0x3876[_0x510d70];return _0x135f68;};'use strict';var Sequelize=require(_0x6387('0x0'));module[_0x6387('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x27d6=['STRING','sequelize'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x27d6,0x12b));var _0x627d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x27d6[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x627d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x627d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 5405669..c0380d4 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 _0x8642=['order','filters','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','getSubjects','findOne','sort','getDescriptions','pick','getFields','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3c6283,_0x4cd030){var _0x355c03=function(_0x8df68a){while(--_0x8df68a){_0x3c6283['push'](_0x3c6283['shift']());}};_0x355c03(++_0x4cd030);}(_0x8642,0xad));var _0x2864=function(_0x5db657,_0x2f40b3){_0x5db657=_0x5db657-0x0;var _0x2d6e70=_0x8642[_0x5db657];return _0x2d6e70;};'use strict';var emlformat=require(_0x2864('0x0'));var rimraf=require(_0x2864('0x1'));var zipdir=require(_0x2864('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2864('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2864('0x4'));var util=require(_0x2864('0x5'));var path=require(_0x2864('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2864('0x7'));var fs=require('fs');var fs_extra=require(_0x2864('0x8'));var _=require(_0x2864('0x9'));var squel=require(_0x2864('0xa'));var crypto=require(_0x2864('0xb'));var jsforce=require(_0x2864('0xc'));var deskjs=require(_0x2864('0xd'));var toCsv=require(_0x2864('0xe'));var querystring=require('querystring');var Papa=require(_0x2864('0xf'));var Redis=require(_0x2864('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2864('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2864('0x12'));var config=require(_0x2864('0x13'));var licenseUtil=require(_0x2864('0x14'));var db=require(_0x2864('0x15'))['db'];function respondWithStatusCode(_0x8039da,_0x1ac981){_0x1ac981=_0x1ac981||0xcc;return function(_0x37019f){if(_0x37019f){return _0x8039da[_0x2864('0x16')](_0x1ac981);}return _0x8039da[_0x2864('0x17')](_0x1ac981)[_0x2864('0x18')]();};}function respondWithResult(_0x28c5e0,_0x15deda){_0x15deda=_0x15deda||0xc8;return function(_0x5869dc){if(_0x5869dc){return _0x28c5e0[_0x2864('0x17')](_0x15deda)[_0x2864('0x19')](_0x5869dc);}};}function respondWithFilteredResult(_0x116fbe,_0x9572f0){return function(_0xa32b90){if(_0xa32b90){var _0x4d92eb=typeof _0x9572f0[_0x2864('0x1a')]===_0x2864('0x1b')&&typeof _0x9572f0[_0x2864('0x1c')]===_0x2864('0x1b');var _0x522c39=_0xa32b90['count'];var _0x34db1b=_0x4d92eb?0x0:_0x9572f0[_0x2864('0x1a')];var _0x5c5bc7=_0x4d92eb?_0xa32b90[_0x2864('0x1d')]:_0x9572f0[_0x2864('0x1a')]+_0x9572f0['limit'];var _0x2d05cf;if(_0x5c5bc7>=_0x522c39){_0x5c5bc7=_0x522c39;_0x2d05cf=0xc8;}else{_0x2d05cf=0xce;}_0x116fbe['status'](_0x2d05cf);return _0x116fbe[_0x2864('0x1e')](_0x2864('0x1f'),_0x34db1b+'-'+_0x5c5bc7+'/'+_0x522c39)['json'](_0xa32b90);}return null;};}function patchUpdates(_0x4b2772){return function(_0x2995ef){try{jsonpatch[_0x2864('0x20')](_0x2995ef,_0x4b2772,!![]);}catch(_0x1668e9){return BPromise['reject'](_0x1668e9);}return _0x2995ef[_0x2864('0x21')]();};}function saveUpdates(_0x4acb0f,_0x809dce){return function(_0x561b86){if(_0x561b86){return _0x561b86[_0x2864('0x22')](_0x4acb0f)[_0x2864('0x23')](function(_0x5e99e2){return _0x5e99e2;});}return null;};}function removeEntity(_0x1bbadb,_0x4e8279){return function(_0x5e5be0){if(_0x5e5be0){return _0x5e5be0[_0x2864('0x24')]()[_0x2864('0x23')](function(){_0x1bbadb['status'](0xcc)[_0x2864('0x18')]();});}};}function handleEntityNotFound(_0x5e7917,_0x113980){return function(_0x1b4f11){if(!_0x1b4f11){_0x5e7917['sendStatus'](0x194);}return _0x1b4f11;};}function handleError(_0x42861d,_0xc7f04e){_0xc7f04e=_0xc7f04e||0x1f4;return function(_0x3e9506){logger['error'](_0x3e9506[_0x2864('0x25')]);if(_0x3e9506[_0x2864('0x26')]){delete _0x3e9506[_0x2864('0x26')];}_0x42861d[_0x2864('0x17')](_0xc7f04e)[_0x2864('0x27')](_0x3e9506);};}exports[_0x2864('0x28')]=function(_0x8ff8b6,_0x59387f){var _0x1c9252={},_0x1bce01={},_0x3cfea9={'count':0x0,'rows':[]};var _0x5048f4=_['map'](db[_0x2864('0x29')][_0x2864('0x2a')],function(_0x421cc3){return{'name':_0x421cc3[_0x2864('0x2b')],'type':_0x421cc3[_0x2864('0x2c')]['key']};});_0x1bce01[_0x2864('0x2d')]=_[_0x2864('0x2e')](_0x5048f4,_0x2864('0x26'));_0x1bce01[_0x2864('0x2f')]=_[_0x2864('0x30')](_0x8ff8b6[_0x2864('0x2f')]);_0x1bce01['filters']=_[_0x2864('0x31')](_0x1bce01['model'],_0x1bce01[_0x2864('0x2f')]);_0x1c9252[_0x2864('0x32')]=_[_0x2864('0x31')](_0x1bce01[_0x2864('0x2d')],qs[_0x2864('0x33')](_0x8ff8b6[_0x2864('0x2f')][_0x2864('0x33')]));_0x1c9252['attributes']=_0x1c9252[_0x2864('0x32')][_0x2864('0x34')]?_0x1c9252[_0x2864('0x32')]:_0x1bce01[_0x2864('0x2d')];if(!_0x8ff8b6[_0x2864('0x2f')][_0x2864('0x35')](_0x2864('0x36'))){_0x1c9252[_0x2864('0x1c')]=qs['limit'](_0x8ff8b6['query'][_0x2864('0x1c')]);_0x1c9252[_0x2864('0x1a')]=qs[_0x2864('0x1a')](_0x8ff8b6[_0x2864('0x2f')][_0x2864('0x1a')]);}_0x1c9252[_0x2864('0x37')]=qs['sort'](_0x8ff8b6[_0x2864('0x2f')]['sort']);_0x1c9252['where']=qs[_0x2864('0x38')](_['pick'](_0x8ff8b6['query'],_0x1bce01[_0x2864('0x38')]),_0x5048f4);if(_0x8ff8b6[_0x2864('0x2f')][_0x2864('0x39')]){_0x1c9252[_0x2864('0x3a')]=_['merge'](_0x1c9252['where'],{'$or':_[_0x2864('0x2e')](_0x5048f4,function(_0x3df2f3){if(_0x3df2f3[_0x2864('0x2c')]!==_0x2864('0x3b')){var _0x406c0b={};_0x406c0b[_0x3df2f3[_0x2864('0x26')]]={'$like':'%'+_0x8ff8b6[_0x2864('0x2f')][_0x2864('0x39')]+'%'};return _0x406c0b;}})});}_0x1c9252=_[_0x2864('0x3c')]({},_0x1c9252,_0x8ff8b6[_0x2864('0x3d')]);var _0x3116b4={'where':_0x1c9252[_0x2864('0x3a')]};return db[_0x2864('0x29')][_0x2864('0x1d')](_0x3116b4)[_0x2864('0x23')](function(_0x42b510){_0x3cfea9[_0x2864('0x1d')]=_0x42b510;if(_0x8ff8b6[_0x2864('0x2f')][_0x2864('0x3e')]){_0x1c9252[_0x2864('0x3f')]=[{'all':!![]}];}return db[_0x2864('0x29')][_0x2864('0x40')](_0x1c9252);})[_0x2864('0x23')](function(_0x1b1096){_0x3cfea9['rows']=_0x1b1096;return _0x3cfea9;})['then'](respondWithFilteredResult(_0x59387f,_0x1c9252))[_0x2864('0x41')](handleError(_0x59387f,null));};exports['show']=function(_0x47eaeb,_0x5cc548){var _0x28c4eb={'raw':![],'where':{'id':_0x47eaeb[_0x2864('0x42')]['id']}},_0x1b72fd={};_0x1b72fd[_0x2864('0x2d')]=_[_0x2864('0x30')](db[_0x2864('0x29')][_0x2864('0x2a')]);_0x1b72fd['query']=_[_0x2864('0x30')](_0x47eaeb[_0x2864('0x2f')]);_0x1b72fd[_0x2864('0x38')]=_[_0x2864('0x31')](_0x1b72fd[_0x2864('0x2d')],_0x1b72fd[_0x2864('0x2f')]);_0x28c4eb[_0x2864('0x32')]=_[_0x2864('0x31')](_0x1b72fd[_0x2864('0x2d')],qs['fields'](_0x47eaeb[_0x2864('0x2f')][_0x2864('0x33')]));_0x28c4eb[_0x2864('0x32')]=_0x28c4eb[_0x2864('0x32')][_0x2864('0x34')]?_0x28c4eb[_0x2864('0x32')]:_0x1b72fd[_0x2864('0x2d')];if(_0x47eaeb[_0x2864('0x2f')]['includeAll']){_0x28c4eb[_0x2864('0x3f')]=[{'all':!![]}];}_0x28c4eb=_[_0x2864('0x3c')]({},_0x28c4eb,_0x47eaeb[_0x2864('0x3d')]);return db['FreshsalesConfiguration'][_0x2864('0x43')](_0x28c4eb)[_0x2864('0x23')](handleEntityNotFound(_0x5cc548,null))[_0x2864('0x23')](respondWithResult(_0x5cc548,null))[_0x2864('0x41')](handleError(_0x5cc548,null));};exports[_0x2864('0x44')]=function(_0x532968,_0x533367){return db[_0x2864('0x29')]['create'](_0x532968['body'],{})['then'](respondWithResult(_0x533367,0xc9))[_0x2864('0x41')](handleError(_0x533367,null));};exports['update']=function(_0x557909,_0x32e6a5){if(_0x557909[_0x2864('0x45')]['id']){delete _0x557909['body']['id'];}return db[_0x2864('0x29')][_0x2864('0x43')]({'where':{'id':_0x557909[_0x2864('0x42')]['id']}})[_0x2864('0x23')](handleEntityNotFound(_0x32e6a5,null))[_0x2864('0x23')](saveUpdates(_0x557909['body'],null))['then'](respondWithResult(_0x32e6a5,null))[_0x2864('0x41')](handleError(_0x32e6a5,null));};exports[_0x2864('0x24')]=function(_0x2b927d,_0x133b18){return db[_0x2864('0x29')][_0x2864('0x43')]({'where':{'id':_0x2b927d['params']['id']}})[_0x2864('0x23')](handleEntityNotFound(_0x133b18,null))[_0x2864('0x23')](removeEntity(_0x133b18,null))['catch'](handleError(_0x133b18,null));};exports[_0x2864('0x46')]=function(_0x847069,_0x27d935,_0xee8ab9){var _0x336198={};var _0x4b6238={};var _0x502c90;var _0x19fec0;return db[_0x2864('0x29')][_0x2864('0x47')]({'where':{'id':_0x847069[_0x2864('0x42')]['id']}})[_0x2864('0x23')](handleEntityNotFound(_0x27d935,null))[_0x2864('0x23')](function(_0x243e92){if(_0x243e92){_0x502c90=_0x243e92;_0x4b6238[_0x2864('0x2d')]=_[_0x2864('0x30')](db['FreshsalesField'][_0x2864('0x2a')]);_0x4b6238[_0x2864('0x2f')]=_['keys'](_0x847069[_0x2864('0x2f')]);_0x4b6238[_0x2864('0x38')]=_[_0x2864('0x31')](_0x4b6238[_0x2864('0x2d')],_0x4b6238['query']);_0x336198['attributes']=_['intersection'](_0x4b6238[_0x2864('0x2d')],qs['fields'](_0x847069[_0x2864('0x2f')][_0x2864('0x33')]));_0x336198[_0x2864('0x32')]=_0x336198['attributes'][_0x2864('0x34')]?_0x336198[_0x2864('0x32')]:_0x4b6238[_0x2864('0x2d')];_0x336198['order']=qs[_0x2864('0x48')](_0x847069['query'][_0x2864('0x48')]);_0x336198[_0x2864('0x3a')]=qs['filters'](_['pick'](_0x847069[_0x2864('0x2f')],_0x4b6238['filters']));if(_0x847069[_0x2864('0x2f')][_0x2864('0x39')]){_0x336198[_0x2864('0x3a')]=_['merge'](_0x336198[_0x2864('0x3a')],{'$or':_['map'](_0x336198[_0x2864('0x32')],function(_0x1bdf0f){var _0x3e9033={};_0x3e9033[_0x1bdf0f]={'$like':'%'+_0x847069['query'][_0x2864('0x39')]+'%'};return _0x3e9033;})});}_0x336198=_['merge']({},_0x336198,_0x847069[_0x2864('0x3d')]);return _0x502c90[_0x2864('0x46')](_0x336198);}})[_0x2864('0x23')](function(_0x371c36){if(_0x371c36){_0x19fec0=_0x371c36[_0x2864('0x34')];if(!_0x847069[_0x2864('0x2f')][_0x2864('0x35')](_0x2864('0x36'))){_0x336198[_0x2864('0x1c')]=qs[_0x2864('0x1c')](_0x847069[_0x2864('0x2f')]['limit']);_0x336198['offset']=qs[_0x2864('0x1a')](_0x847069['query'][_0x2864('0x1a')]);}return _0x502c90['getSubjects'](_0x336198);}})[_0x2864('0x23')](function(_0x2fa349){if(_0x2fa349){return _0x2fa349?{'count':_0x19fec0,'rows':_0x2fa349}:null;}})[_0x2864('0x23')](respondWithResult(_0x27d935,null))[_0x2864('0x41')](handleError(_0x27d935,null));};exports[_0x2864('0x49')]=function(_0x276758,_0x2ee85a,_0x230d5e){var _0x154d03={};var _0x2a3692={};var _0x3942a7;var _0x4b0e58;return db[_0x2864('0x29')][_0x2864('0x47')]({'where':{'id':_0x276758[_0x2864('0x42')]['id']}})[_0x2864('0x23')](handleEntityNotFound(_0x2ee85a,null))[_0x2864('0x23')](function(_0x1ec469){if(_0x1ec469){_0x3942a7=_0x1ec469;_0x2a3692[_0x2864('0x2d')]=_['keys'](db['FreshsalesField'][_0x2864('0x2a')]);_0x2a3692[_0x2864('0x2f')]=_[_0x2864('0x30')](_0x276758[_0x2864('0x2f')]);_0x2a3692[_0x2864('0x38')]=_[_0x2864('0x31')](_0x2a3692['model'],_0x2a3692[_0x2864('0x2f')]);_0x154d03[_0x2864('0x32')]=_[_0x2864('0x31')](_0x2a3692['model'],qs['fields'](_0x276758['query'][_0x2864('0x33')]));_0x154d03['attributes']=_0x154d03[_0x2864('0x32')]['length']?_0x154d03[_0x2864('0x32')]:_0x2a3692[_0x2864('0x2d')];_0x154d03[_0x2864('0x37')]=qs[_0x2864('0x48')](_0x276758[_0x2864('0x2f')][_0x2864('0x48')]);_0x154d03[_0x2864('0x3a')]=qs[_0x2864('0x38')](_[_0x2864('0x4a')](_0x276758[_0x2864('0x2f')],_0x2a3692['filters']));if(_0x276758[_0x2864('0x2f')][_0x2864('0x39')]){_0x154d03[_0x2864('0x3a')]=_['merge'](_0x154d03[_0x2864('0x3a')],{'$or':_[_0x2864('0x2e')](_0x154d03[_0x2864('0x32')],function(_0xd2bb7b){var _0x174938={};_0x174938[_0xd2bb7b]={'$like':'%'+_0x276758[_0x2864('0x2f')][_0x2864('0x39')]+'%'};return _0x174938;})});}_0x154d03=_[_0x2864('0x3c')]({},_0x154d03,_0x276758[_0x2864('0x3d')]);return _0x3942a7[_0x2864('0x49')](_0x154d03);}})[_0x2864('0x23')](function(_0x45303a){if(_0x45303a){_0x4b0e58=_0x45303a['length'];if(!_0x276758[_0x2864('0x2f')]['hasOwnProperty'](_0x2864('0x36'))){_0x154d03[_0x2864('0x1c')]=qs[_0x2864('0x1c')](_0x276758[_0x2864('0x2f')]['limit']);_0x154d03[_0x2864('0x1a')]=qs[_0x2864('0x1a')](_0x276758[_0x2864('0x2f')][_0x2864('0x1a')]);}return _0x3942a7[_0x2864('0x49')](_0x154d03);}})['then'](function(_0xf51452){if(_0xf51452){return _0xf51452?{'count':_0x4b0e58,'rows':_0xf51452}:null;}})[_0x2864('0x23')](respondWithResult(_0x2ee85a,null))['catch'](handleError(_0x2ee85a,null));};exports[_0x2864('0x4b')]=function(_0x57fa7f,_0x454543,_0xd8883c){var _0x20b3d3={};var _0x5a92f4={};var _0x47d304;var _0x1cc4e6;return db[_0x2864('0x29')][_0x2864('0x47')]({'where':{'id':_0x57fa7f[_0x2864('0x42')]['id']}})[_0x2864('0x23')](handleEntityNotFound(_0x454543,null))['then'](function(_0x24bd0b){if(_0x24bd0b){_0x47d304=_0x24bd0b;_0x5a92f4['model']=_[_0x2864('0x30')](db['FreshsalesField'][_0x2864('0x2a')]);_0x5a92f4[_0x2864('0x2f')]=_['keys'](_0x57fa7f[_0x2864('0x2f')]);_0x5a92f4['filters']=_['intersection'](_0x5a92f4[_0x2864('0x2d')],_0x5a92f4[_0x2864('0x2f')]);_0x20b3d3[_0x2864('0x32')]=_[_0x2864('0x31')](_0x5a92f4[_0x2864('0x2d')],qs['fields'](_0x57fa7f[_0x2864('0x2f')]['fields']));_0x20b3d3[_0x2864('0x32')]=_0x20b3d3[_0x2864('0x32')]['length']?_0x20b3d3[_0x2864('0x32')]:_0x5a92f4['model'];_0x20b3d3[_0x2864('0x37')]=qs['sort'](_0x57fa7f[_0x2864('0x2f')][_0x2864('0x48')]);_0x20b3d3[_0x2864('0x3a')]=qs[_0x2864('0x38')](_[_0x2864('0x4a')](_0x57fa7f[_0x2864('0x2f')],_0x5a92f4[_0x2864('0x38')]));if(_0x57fa7f[_0x2864('0x2f')][_0x2864('0x39')]){_0x20b3d3[_0x2864('0x3a')]=_['merge'](_0x20b3d3[_0x2864('0x3a')],{'$or':_[_0x2864('0x2e')](_0x20b3d3[_0x2864('0x32')],function(_0x1a8559){var _0x363896={};_0x363896[_0x1a8559]={'$like':'%'+_0x57fa7f[_0x2864('0x2f')][_0x2864('0x39')]+'%'};return _0x363896;})});}_0x20b3d3=_[_0x2864('0x3c')]({},_0x20b3d3,_0x57fa7f['options']);return _0x47d304[_0x2864('0x4b')](_0x20b3d3);}})['then'](function(_0x475085){if(_0x475085){_0x1cc4e6=_0x475085[_0x2864('0x34')];if(!_0x57fa7f[_0x2864('0x2f')][_0x2864('0x35')](_0x2864('0x36'))){_0x20b3d3[_0x2864('0x1c')]=qs[_0x2864('0x1c')](_0x57fa7f['query']['limit']);_0x20b3d3[_0x2864('0x1a')]=qs[_0x2864('0x1a')](_0x57fa7f['query'][_0x2864('0x1a')]);}return _0x47d304[_0x2864('0x4b')](_0x20b3d3);}})[_0x2864('0x23')](function(_0x9336b8){if(_0x9336b8){return _0x9336b8?{'count':_0x1cc4e6,'rows':_0x9336b8}:null;}})[_0x2864('0x23')](respondWithResult(_0x454543,null))[_0x2864('0x41')](handleError(_0x454543,null));}; \ No newline at end of file +var _0xd680=['filter','type','VIRTUAL','merge','rows','catch','show','include','create','body','find','params','getSubjects','FreshsalesField','options','getDescriptions','findOne','getFields','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','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/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd680,0xaf));var _0x0d68=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd680[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0d68('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d68('0x1'));var jsonpatch=require(_0x0d68('0x2'));var rp=require(_0x0d68('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0d68('0x4'));var util=require('util');var path=require(_0x0d68('0x5'));var sox=require(_0x0d68('0x6'));var csv=require(_0x0d68('0x7'));var ejs=require(_0x0d68('0x8'));var fs=require('fs');var fs_extra=require(_0x0d68('0x9'));var _=require('lodash');var squel=require(_0x0d68('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0d68('0xb'));var toCsv=require(_0x0d68('0x7'));var querystring=require(_0x0d68('0xc'));var Papa=require(_0x0d68('0xd'));var Redis=require(_0x0d68('0xe'));var authService=require(_0x0d68('0xf'));var qs=require(_0x0d68('0x10'));var as=require(_0x0d68('0x11'));var hardwareService=require(_0x0d68('0x12'));var logger=require(_0x0d68('0x13'))('api');var utils=require(_0x0d68('0x14'));var config=require(_0x0d68('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d68('0x16'))['db'];function respondWithStatusCode(_0x38d29d,_0x35e49f){_0x35e49f=_0x35e49f||0xcc;return function(_0xd2fa98){if(_0xd2fa98){return _0x38d29d[_0x0d68('0x17')](_0x35e49f);}return _0x38d29d[_0x0d68('0x18')](_0x35e49f)[_0x0d68('0x19')]();};}function respondWithResult(_0x1f6ef6,_0x450acb){_0x450acb=_0x450acb||0xc8;return function(_0x53fe89){if(_0x53fe89){return _0x1f6ef6[_0x0d68('0x18')](_0x450acb)[_0x0d68('0x1a')](_0x53fe89);}};}function respondWithFilteredResult(_0x58f39f,_0x157922){return function(_0x1ec336){if(_0x1ec336){var _0x347236=typeof _0x157922[_0x0d68('0x1b')]===_0x0d68('0x1c')&&typeof _0x157922[_0x0d68('0x1d')]===_0x0d68('0x1c');var _0x5c68af=_0x1ec336[_0x0d68('0x1e')];var _0x10e6c2=_0x347236?0x0:_0x157922[_0x0d68('0x1b')];var _0x485580=_0x347236?_0x1ec336[_0x0d68('0x1e')]:_0x157922[_0x0d68('0x1b')]+_0x157922[_0x0d68('0x1d')];var _0x128e5b;if(_0x485580>=_0x5c68af){_0x485580=_0x5c68af;_0x128e5b=0xc8;}else{_0x128e5b=0xce;}_0x58f39f[_0x0d68('0x18')](_0x128e5b);return _0x58f39f['set']('Content-Range',_0x10e6c2+'-'+_0x485580+'/'+_0x5c68af)[_0x0d68('0x1a')](_0x1ec336);}return null;};}function patchUpdates(_0x40293f){return function(_0x2c7c83){try{jsonpatch[_0x0d68('0x1f')](_0x2c7c83,_0x40293f,!![]);}catch(_0x236d1b){return BPromise[_0x0d68('0x20')](_0x236d1b);}return _0x2c7c83[_0x0d68('0x21')]();};}function saveUpdates(_0x519467,_0x3ff863){return function(_0x41a6bf){if(_0x41a6bf){return _0x41a6bf[_0x0d68('0x22')](_0x519467)[_0x0d68('0x23')](function(_0x3a9d5d){return _0x3a9d5d;});}return null;};}function removeEntity(_0x1e5844,_0x46eea7){return function(_0xc522a1){if(_0xc522a1){return _0xc522a1[_0x0d68('0x24')]()[_0x0d68('0x23')](function(){_0x1e5844['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20f9a4,_0x39880f){return function(_0x515834){if(!_0x515834){_0x20f9a4['sendStatus'](0x194);}return _0x515834;};}function handleError(_0x36f6b9,_0x27eec2){_0x27eec2=_0x27eec2||0x1f4;return function(_0x6d11aa){logger[_0x0d68('0x25')](_0x6d11aa[_0x0d68('0x26')]);if(_0x6d11aa[_0x0d68('0x27')]){delete _0x6d11aa[_0x0d68('0x27')];}_0x36f6b9[_0x0d68('0x18')](_0x27eec2)[_0x0d68('0x28')](_0x6d11aa);};}exports[_0x0d68('0x29')]=function(_0x55e56b,_0x57016c){var _0x1ddb0f={},_0x400027={},_0x56747d={'count':0x0,'rows':[]};var _0x21c6c7=_[_0x0d68('0x2a')](db[_0x0d68('0x2b')][_0x0d68('0x2c')],function(_0x13c126){return{'name':_0x13c126['fieldName'],'type':_0x13c126['type'][_0x0d68('0x2d')]};});_0x400027[_0x0d68('0x2e')]=_['map'](_0x21c6c7,_0x0d68('0x27'));_0x400027[_0x0d68('0x2f')]=_[_0x0d68('0x30')](_0x55e56b['query']);_0x400027[_0x0d68('0x31')]=_[_0x0d68('0x32')](_0x400027[_0x0d68('0x2e')],_0x400027[_0x0d68('0x2f')]);_0x1ddb0f['attributes']=_[_0x0d68('0x32')](_0x400027['model'],qs['fields'](_0x55e56b[_0x0d68('0x2f')][_0x0d68('0x33')]));_0x1ddb0f['attributes']=_0x1ddb0f['attributes'][_0x0d68('0x34')]?_0x1ddb0f[_0x0d68('0x35')]:_0x400027[_0x0d68('0x2e')];if(!_0x55e56b[_0x0d68('0x2f')][_0x0d68('0x36')]('nolimit')){_0x1ddb0f['limit']=qs['limit'](_0x55e56b[_0x0d68('0x2f')][_0x0d68('0x1d')]);_0x1ddb0f[_0x0d68('0x1b')]=qs[_0x0d68('0x1b')](_0x55e56b[_0x0d68('0x2f')][_0x0d68('0x1b')]);}_0x1ddb0f[_0x0d68('0x37')]=qs[_0x0d68('0x38')](_0x55e56b[_0x0d68('0x2f')][_0x0d68('0x38')]);_0x1ddb0f[_0x0d68('0x39')]=qs[_0x0d68('0x31')](_[_0x0d68('0x3a')](_0x55e56b[_0x0d68('0x2f')],_0x400027[_0x0d68('0x31')]),_0x21c6c7);if(_0x55e56b[_0x0d68('0x2f')][_0x0d68('0x3b')]){_0x1ddb0f['where']=_['merge'](_0x1ddb0f[_0x0d68('0x39')],{'$or':_['map'](_0x21c6c7,function(_0x5772a8){if(_0x5772a8[_0x0d68('0x3c')]!==_0x0d68('0x3d')){var _0x146d33={};_0x146d33[_0x5772a8['name']]={'$like':'%'+_0x55e56b[_0x0d68('0x2f')]['filter']+'%'};return _0x146d33;}})});}_0x1ddb0f=_[_0x0d68('0x3e')]({},_0x1ddb0f,_0x55e56b['options']);var _0x29b397={'where':_0x1ddb0f[_0x0d68('0x39')]};return db[_0x0d68('0x2b')]['count'](_0x29b397)[_0x0d68('0x23')](function(_0xd18f01){_0x56747d['count']=_0xd18f01;if(_0x55e56b['query']['includeAll']){_0x1ddb0f['include']=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x1ddb0f);})[_0x0d68('0x23')](function(_0x5f5b86){_0x56747d[_0x0d68('0x3f')]=_0x5f5b86;return _0x56747d;})['then'](respondWithFilteredResult(_0x57016c,_0x1ddb0f))[_0x0d68('0x40')](handleError(_0x57016c,null));};exports[_0x0d68('0x41')]=function(_0x3dbcfe,_0x1ee168){var _0x14d194={'raw':![],'where':{'id':_0x3dbcfe['params']['id']}},_0x2576c0={};_0x2576c0[_0x0d68('0x2e')]=_[_0x0d68('0x30')](db[_0x0d68('0x2b')]['rawAttributes']);_0x2576c0['query']=_[_0x0d68('0x30')](_0x3dbcfe['query']);_0x2576c0[_0x0d68('0x31')]=_[_0x0d68('0x32')](_0x2576c0[_0x0d68('0x2e')],_0x2576c0[_0x0d68('0x2f')]);_0x14d194['attributes']=_[_0x0d68('0x32')](_0x2576c0[_0x0d68('0x2e')],qs[_0x0d68('0x33')](_0x3dbcfe[_0x0d68('0x2f')][_0x0d68('0x33')]));_0x14d194['attributes']=_0x14d194['attributes']['length']?_0x14d194['attributes']:_0x2576c0[_0x0d68('0x2e')];if(_0x3dbcfe[_0x0d68('0x2f')]['includeAll']){_0x14d194[_0x0d68('0x42')]=[{'all':!![]}];}_0x14d194=_[_0x0d68('0x3e')]({},_0x14d194,_0x3dbcfe['options']);return db[_0x0d68('0x2b')]['find'](_0x14d194)[_0x0d68('0x23')](handleEntityNotFound(_0x1ee168,null))[_0x0d68('0x23')](respondWithResult(_0x1ee168,null))['catch'](handleError(_0x1ee168,null));};exports['create']=function(_0x14f097,_0x7e109e){return db['FreshsalesConfiguration'][_0x0d68('0x43')](_0x14f097[_0x0d68('0x44')],{})[_0x0d68('0x23')](respondWithResult(_0x7e109e,0xc9))[_0x0d68('0x40')](handleError(_0x7e109e,null));};exports[_0x0d68('0x22')]=function(_0x206a68,_0x42cf5b){if(_0x206a68[_0x0d68('0x44')]['id']){delete _0x206a68[_0x0d68('0x44')]['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x206a68['params']['id']}})[_0x0d68('0x23')](handleEntityNotFound(_0x42cf5b,null))[_0x0d68('0x23')](saveUpdates(_0x206a68[_0x0d68('0x44')],null))['then'](respondWithResult(_0x42cf5b,null))[_0x0d68('0x40')](handleError(_0x42cf5b,null));};exports[_0x0d68('0x24')]=function(_0x33cfb5,_0x5700a3){return db[_0x0d68('0x2b')][_0x0d68('0x45')]({'where':{'id':_0x33cfb5[_0x0d68('0x46')]['id']}})[_0x0d68('0x23')](handleEntityNotFound(_0x5700a3,null))[_0x0d68('0x23')](removeEntity(_0x5700a3,null))['catch'](handleError(_0x5700a3,null));};exports[_0x0d68('0x47')]=function(_0x3e47c8,_0x55fcc6,_0x1a6bca){var _0x3a740b={};var _0x27ef98={};var _0x586a9f;var _0x45eb86;return db[_0x0d68('0x2b')]['findOne']({'where':{'id':_0x3e47c8['params']['id']}})[_0x0d68('0x23')](handleEntityNotFound(_0x55fcc6,null))[_0x0d68('0x23')](function(_0x147b95){if(_0x147b95){_0x586a9f=_0x147b95;_0x27ef98[_0x0d68('0x2e')]=_[_0x0d68('0x30')](db[_0x0d68('0x48')][_0x0d68('0x2c')]);_0x27ef98[_0x0d68('0x2f')]=_[_0x0d68('0x30')](_0x3e47c8[_0x0d68('0x2f')]);_0x27ef98[_0x0d68('0x31')]=_[_0x0d68('0x32')](_0x27ef98[_0x0d68('0x2e')],_0x27ef98[_0x0d68('0x2f')]);_0x3a740b[_0x0d68('0x35')]=_['intersection'](_0x27ef98[_0x0d68('0x2e')],qs[_0x0d68('0x33')](_0x3e47c8[_0x0d68('0x2f')][_0x0d68('0x33')]));_0x3a740b[_0x0d68('0x35')]=_0x3a740b['attributes'][_0x0d68('0x34')]?_0x3a740b['attributes']:_0x27ef98['model'];_0x3a740b['order']=qs['sort'](_0x3e47c8[_0x0d68('0x2f')]['sort']);_0x3a740b[_0x0d68('0x39')]=qs[_0x0d68('0x31')](_[_0x0d68('0x3a')](_0x3e47c8[_0x0d68('0x2f')],_0x27ef98[_0x0d68('0x31')]));if(_0x3e47c8[_0x0d68('0x2f')][_0x0d68('0x3b')]){_0x3a740b[_0x0d68('0x39')]=_[_0x0d68('0x3e')](_0x3a740b['where'],{'$or':_[_0x0d68('0x2a')](_0x3a740b[_0x0d68('0x35')],function(_0x44c3dd){var _0xf91002={};_0xf91002[_0x44c3dd]={'$like':'%'+_0x3e47c8['query'][_0x0d68('0x3b')]+'%'};return _0xf91002;})});}_0x3a740b=_[_0x0d68('0x3e')]({},_0x3a740b,_0x3e47c8[_0x0d68('0x49')]);return _0x586a9f[_0x0d68('0x47')](_0x3a740b);}})['then'](function(_0x4e6e49){if(_0x4e6e49){_0x45eb86=_0x4e6e49[_0x0d68('0x34')];if(!_0x3e47c8['query'][_0x0d68('0x36')]('nolimit')){_0x3a740b[_0x0d68('0x1d')]=qs[_0x0d68('0x1d')](_0x3e47c8[_0x0d68('0x2f')][_0x0d68('0x1d')]);_0x3a740b[_0x0d68('0x1b')]=qs[_0x0d68('0x1b')](_0x3e47c8[_0x0d68('0x2f')][_0x0d68('0x1b')]);}return _0x586a9f[_0x0d68('0x47')](_0x3a740b);}})[_0x0d68('0x23')](function(_0x17ec8b){if(_0x17ec8b){return _0x17ec8b?{'count':_0x45eb86,'rows':_0x17ec8b}:null;}})[_0x0d68('0x23')](respondWithResult(_0x55fcc6,null))[_0x0d68('0x40')](handleError(_0x55fcc6,null));};exports[_0x0d68('0x4a')]=function(_0x54ba5c,_0x19110a,_0xa1c03e){var _0x33ea81={};var _0x33f578={};var _0x5e0de7;var _0x53647a;return db[_0x0d68('0x2b')][_0x0d68('0x4b')]({'where':{'id':_0x54ba5c[_0x0d68('0x46')]['id']}})[_0x0d68('0x23')](handleEntityNotFound(_0x19110a,null))[_0x0d68('0x23')](function(_0x179c6e){if(_0x179c6e){_0x5e0de7=_0x179c6e;_0x33f578[_0x0d68('0x2e')]=_[_0x0d68('0x30')](db['FreshsalesField'][_0x0d68('0x2c')]);_0x33f578[_0x0d68('0x2f')]=_[_0x0d68('0x30')](_0x54ba5c[_0x0d68('0x2f')]);_0x33f578['filters']=_['intersection'](_0x33f578[_0x0d68('0x2e')],_0x33f578[_0x0d68('0x2f')]);_0x33ea81['attributes']=_[_0x0d68('0x32')](_0x33f578[_0x0d68('0x2e')],qs[_0x0d68('0x33')](_0x54ba5c[_0x0d68('0x2f')][_0x0d68('0x33')]));_0x33ea81[_0x0d68('0x35')]=_0x33ea81[_0x0d68('0x35')][_0x0d68('0x34')]?_0x33ea81['attributes']:_0x33f578[_0x0d68('0x2e')];_0x33ea81[_0x0d68('0x37')]=qs['sort'](_0x54ba5c[_0x0d68('0x2f')][_0x0d68('0x38')]);_0x33ea81['where']=qs[_0x0d68('0x31')](_[_0x0d68('0x3a')](_0x54ba5c['query'],_0x33f578[_0x0d68('0x31')]));if(_0x54ba5c['query'][_0x0d68('0x3b')]){_0x33ea81[_0x0d68('0x39')]=_[_0x0d68('0x3e')](_0x33ea81[_0x0d68('0x39')],{'$or':_[_0x0d68('0x2a')](_0x33ea81['attributes'],function(_0x2aae45){var _0x5179a7={};_0x5179a7[_0x2aae45]={'$like':'%'+_0x54ba5c['query'][_0x0d68('0x3b')]+'%'};return _0x5179a7;})});}_0x33ea81=_[_0x0d68('0x3e')]({},_0x33ea81,_0x54ba5c[_0x0d68('0x49')]);return _0x5e0de7[_0x0d68('0x4a')](_0x33ea81);}})[_0x0d68('0x23')](function(_0x52a07e){if(_0x52a07e){_0x53647a=_0x52a07e[_0x0d68('0x34')];if(!_0x54ba5c[_0x0d68('0x2f')][_0x0d68('0x36')]('nolimit')){_0x33ea81[_0x0d68('0x1d')]=qs[_0x0d68('0x1d')](_0x54ba5c[_0x0d68('0x2f')][_0x0d68('0x1d')]);_0x33ea81[_0x0d68('0x1b')]=qs[_0x0d68('0x1b')](_0x54ba5c[_0x0d68('0x2f')][_0x0d68('0x1b')]);}return _0x5e0de7['getDescriptions'](_0x33ea81);}})[_0x0d68('0x23')](function(_0xd5313d){if(_0xd5313d){return _0xd5313d?{'count':_0x53647a,'rows':_0xd5313d}:null;}})[_0x0d68('0x23')](respondWithResult(_0x19110a,null))[_0x0d68('0x40')](handleError(_0x19110a,null));};exports[_0x0d68('0x4c')]=function(_0x148eca,_0x58eff8,_0x52bc9d){var _0x41aaec={};var _0x33067a={};var _0x58af73;var _0x407f29;return db[_0x0d68('0x2b')][_0x0d68('0x4b')]({'where':{'id':_0x148eca[_0x0d68('0x46')]['id']}})['then'](handleEntityNotFound(_0x58eff8,null))['then'](function(_0x4b4029){if(_0x4b4029){_0x58af73=_0x4b4029;_0x33067a[_0x0d68('0x2e')]=_[_0x0d68('0x30')](db[_0x0d68('0x48')]['rawAttributes']);_0x33067a['query']=_[_0x0d68('0x30')](_0x148eca[_0x0d68('0x2f')]);_0x33067a['filters']=_[_0x0d68('0x32')](_0x33067a[_0x0d68('0x2e')],_0x33067a[_0x0d68('0x2f')]);_0x41aaec[_0x0d68('0x35')]=_[_0x0d68('0x32')](_0x33067a['model'],qs[_0x0d68('0x33')](_0x148eca['query'][_0x0d68('0x33')]));_0x41aaec['attributes']=_0x41aaec[_0x0d68('0x35')][_0x0d68('0x34')]?_0x41aaec[_0x0d68('0x35')]:_0x33067a[_0x0d68('0x2e')];_0x41aaec[_0x0d68('0x37')]=qs[_0x0d68('0x38')](_0x148eca[_0x0d68('0x2f')]['sort']);_0x41aaec[_0x0d68('0x39')]=qs[_0x0d68('0x31')](_[_0x0d68('0x3a')](_0x148eca['query'],_0x33067a[_0x0d68('0x31')]));if(_0x148eca['query'][_0x0d68('0x3b')]){_0x41aaec['where']=_[_0x0d68('0x3e')](_0x41aaec[_0x0d68('0x39')],{'$or':_[_0x0d68('0x2a')](_0x41aaec[_0x0d68('0x35')],function(_0x54ac85){var _0xb80972={};_0xb80972[_0x54ac85]={'$like':'%'+_0x148eca[_0x0d68('0x2f')][_0x0d68('0x3b')]+'%'};return _0xb80972;})});}_0x41aaec=_[_0x0d68('0x3e')]({},_0x41aaec,_0x148eca[_0x0d68('0x49')]);return _0x58af73[_0x0d68('0x4c')](_0x41aaec);}})['then'](function(_0x1a10d5){if(_0x1a10d5){_0x407f29=_0x1a10d5[_0x0d68('0x34')];if(!_0x148eca[_0x0d68('0x2f')][_0x0d68('0x36')](_0x0d68('0x4d'))){_0x41aaec[_0x0d68('0x1d')]=qs[_0x0d68('0x1d')](_0x148eca[_0x0d68('0x2f')][_0x0d68('0x1d')]);_0x41aaec[_0x0d68('0x1b')]=qs['offset'](_0x148eca['query']['offset']);}return _0x58af73[_0x0d68('0x4c')](_0x41aaec);}})[_0x0d68('0x23')](function(_0x10b438){if(_0x10b438){return _0x10b438?{'count':_0x407f29,'rows':_0x10b438}:null;}})['then'](respondWithResult(_0x58eff8,null))[_0x0d68('0x40')](handleError(_0x58eff8,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index e955d39..600e071 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 _0x619a=['moment','bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','../../config/logger','api'];(function(_0x2abcc2,_0x279431){var _0x171fae=function(_0x8bffca){while(--_0x8bffca){_0x2abcc2['push'](_0x2abcc2['shift']());}};_0x171fae(++_0x279431);}(_0x619a,0x12a));var _0xa619=function(_0x5597b9,_0x3e14f8){_0x5597b9=_0x5597b9-0x0;var _0x145cad=_0x619a[_0x5597b9];return _0x145cad;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa619('0x0'))(_0xa619('0x1'));var moment=require(_0xa619('0x2'));var BPromise=require(_0xa619('0x3'));var rp=require(_0xa619('0x4'));var fs=require('fs');var path=require(_0xa619('0x5'));var rimraf=require(_0xa619('0x6'));var config=require('../../config/environment');var attributes=require(_0xa619('0x7'));module[_0xa619('0x8')]=function(_0x2589ff,_0x4a6580){return _0x2589ff[_0xa619('0x9')](_0xa619('0xa'),attributes,{'tableName':_0xa619('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9233=['FreshsalesConfiguration','int_freshsales_configurations','util','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define'];(function(_0x234ee3,_0x295672){var _0x38a810=function(_0x5cc772){while(--_0x5cc772){_0x234ee3['push'](_0x234ee3['shift']());}};_0x38a810(++_0x295672);}(_0x9233,0x11a));var _0x3923=function(_0x2dfb31,_0x48f35b){_0x2dfb31=_0x2dfb31-0x0;var _0x1e951=_0x9233[_0x2dfb31];return _0x1e951;};'use strict';var _=require('lodash');var util=require(_0x3923('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3923('0x1'));var rp=require(_0x3923('0x2'));var fs=require('fs');var path=require(_0x3923('0x3'));var rimraf=require(_0x3923('0x4'));var config=require(_0x3923('0x5'));var attributes=require(_0x3923('0x6'));module['exports']=function(_0x147f4b,_0x50251c){return _0x147f4b[_0x3923('0x7')](_0x3923('0x8'),attributes,{'tableName':_0x3923('0x9'),'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 4fac903..fcd68a4 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 _0x8624=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x5f0e12,_0x121f63){var _0x2fcfcc=function(_0x555a5f){while(--_0x555a5f){_0x5f0e12['push'](_0x5f0e12['shift']());}};_0x2fcfcc(++_0x121f63);}(_0x8624,0x95));var _0x4862=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x8624[_0x51020b];return _0x371e47;};'use strict';var _=require(_0x4862('0x0'));var util=require(_0x4862('0x1'));var moment=require(_0x4862('0x2'));var BPromise=require('bluebird');var rs=require(_0x4862('0x3'));var fs=require('fs');var Redis=require(_0x4862('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4862('0x5'))('rpc');var config=require(_0x4862('0x6'));var jayson=require(_0x4862('0x7'));var client=jayson[_0x4862('0x8')][_0x4862('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e4260,_0x28fbe3,_0x47199){return new BPromise(function(_0x3df098,_0x4b9699){return client[_0x4862('0xa')](_0x2e4260,_0x47199)[_0x4862('0xb')](function(_0x1c3258){logger['info'](_0x4862('0xc'),_0x28fbe3,'request\x20sent');logger['debug'](_0x4862('0xd'),_0x28fbe3,_0x4862('0xe'),JSON[_0x4862('0xf')](_0x1c3258));if(_0x1c3258['error']){if(_0x1c3258[_0x4862('0x10')][_0x4862('0x11')]===0x1f4){logger[_0x4862('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x28fbe3,_0x1c3258['error'][_0x4862('0x12')]);return _0x4b9699(_0x1c3258[_0x4862('0x10')]['message']);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x28fbe3,_0x1c3258['error'][_0x4862('0x12')]);return _0x3df098(_0x1c3258[_0x4862('0x10')][_0x4862('0x12')]);}else{logger[_0x4862('0x13')](_0x4862('0xc'),_0x28fbe3,_0x4862('0xe'));_0x3df098(_0x1c3258[_0x4862('0x14')][_0x4862('0x12')]);}})[_0x4862('0x15')](function(_0x359adf){logger[_0x4862('0x10')](_0x4862('0xc'),_0x28fbe3,_0x359adf);_0x4b9699(_0x359adf);});});} \ No newline at end of file +var _0x5670=['request\x20sent','error','code','message','result','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x43b21d,_0x5d5677){var _0x1de400=function(_0x405b75){while(--_0x405b75){_0x43b21d['push'](_0x43b21d['shift']());}};_0x1de400(++_0x5d5677);}(_0x5670,0xd6));var _0x0567=function(_0x47b606,_0x333a6e){_0x47b606=_0x47b606-0x0;var _0x137dd8=_0x5670[_0x47b606];return _0x137dd8;};'use strict';var _=require(_0x0567('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0567('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0567('0x2'))['db'];var utils=require(_0x0567('0x3'));var logger=require(_0x0567('0x4'))(_0x0567('0x5'));var config=require(_0x0567('0x6'));var jayson=require(_0x0567('0x7'));var client=jayson[_0x0567('0x8')][_0x0567('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b2520,_0x480056,_0x287f85){return new BPromise(function(_0x52442a,_0xe05692){return client[_0x0567('0xa')](_0x5b2520,_0x287f85)[_0x0567('0xb')](function(_0x24ce05){logger[_0x0567('0xc')](_0x0567('0xd'),_0x480056,_0x0567('0xe'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x480056,_0x0567('0xe'),JSON['stringify'](_0x24ce05));if(_0x24ce05[_0x0567('0xf')]){if(_0x24ce05[_0x0567('0xf')][_0x0567('0x10')]===0x1f4){logger[_0x0567('0xf')](_0x0567('0xd'),_0x480056,_0x24ce05[_0x0567('0xf')]['message']);return _0xe05692(_0x24ce05['error']['message']);}logger[_0x0567('0xf')](_0x0567('0xd'),_0x480056,_0x24ce05[_0x0567('0xf')][_0x0567('0x11')]);return _0x52442a(_0x24ce05[_0x0567('0xf')][_0x0567('0x11')]);}else{logger[_0x0567('0xc')](_0x0567('0xd'),_0x480056,_0x0567('0xe'));_0x52442a(_0x24ce05[_0x0567('0x12')][_0x0567('0x11')]);}})['catch'](function(_0x2301d2){logger[_0x0567('0xf')](_0x0567('0xd'),_0x480056,_0x2301d2);_0xe05692(_0x2301d2);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 59860dc..ffeaa30 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 _0x534d=['get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller'];(function(_0x2340d8,_0xf2bc8f){var _0x13a27d=function(_0x45c0b2){while(--_0x45c0b2){_0x2340d8['push'](_0x2340d8['shift']());}};_0x13a27d(++_0xf2bc8f);}(_0x534d,0x79));var _0xd534=function(_0x20ada3,_0x1c4509){_0x20ada3=_0x20ada3-0x0;var _0x310c20=_0x534d[_0x20ada3];return _0x310c20;};'use strict';var multer=require(_0xd534('0x0'));var util=require(_0xd534('0x1'));var path=require(_0xd534('0x2'));var timeout=require(_0xd534('0x3'));var express=require(_0xd534('0x4'));var router=express[_0xd534('0x5')]();var fs_extra=require(_0xd534('0x6'));var auth=require(_0xd534('0x7'));var interaction=require(_0xd534('0x8'));var config=require(_0xd534('0x9'));var controller=require(_0xd534('0xa'));router[_0xd534('0xb')]('/',auth[_0xd534('0xc')](),controller[_0xd534('0xd')]);router[_0xd534('0xb')](_0xd534('0xe'),auth[_0xd534('0xc')](),controller[_0xd534('0xf')]);router[_0xd534('0x10')]('/',auth['isAuthenticated'](),controller[_0xd534('0x11')]);router[_0xd534('0x12')](_0xd534('0xe'),auth[_0xd534('0xc')](),controller[_0xd534('0x13')]);router['delete'](_0xd534('0xe'),auth[_0xd534('0xc')](),controller[_0xd534('0x14')]);module[_0xd534('0x15')]=router; \ No newline at end of file +var _0x4fdb=['fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','isAuthenticated','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x48c9b3,_0x1fb678){var _0x4c782f=function(_0x4b3842){while(--_0x4b3842){_0x48c9b3['push'](_0x48c9b3['shift']());}};_0x4c782f(++_0x1fb678);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x3fd8b9,_0x10b829){_0x3fd8b9=_0x3fd8b9-0x0;var _0x15b8f5=_0x4fdb[_0x3fd8b9];return _0x15b8f5;};'use strict';var multer=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var path=require(_0xb4fd('0x2'));var timeout=require(_0xb4fd('0x3'));var express=require(_0xb4fd('0x4'));var router=express[_0xb4fd('0x5')]();var fs_extra=require(_0xb4fd('0x6'));var auth=require(_0xb4fd('0x7'));var interaction=require(_0xb4fd('0x8'));var config=require('../../config/environment');var controller=require(_0xb4fd('0x9'));router['get']('/',auth[_0xb4fd('0xa')](),controller['index']);router['get'](_0xb4fd('0xb'),auth[_0xb4fd('0xa')](),controller[_0xb4fd('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb4fd('0xd')]);router[_0xb4fd('0xe')](_0xb4fd('0xb'),auth['isAuthenticated'](),controller[_0xb4fd('0xf')]);router[_0xb4fd('0x10')](_0xb4fd('0xb'),auth[_0xb4fd('0xa')](),controller[_0xb4fd('0x11')]);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 7ddcd84..6ea40b5 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 _0x9af1=['sequelize','exports','ENUM','string','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x9af1,0x158));var _0x19af=function(_0x15c885,_0x1b4937){_0x15c885=_0x15c885-0x0;var _0x35949d=_0x9af1[_0x15c885];return _0x35949d;};'use strict';var Sequelize=require(_0x19af('0x0'));module[_0x19af('0x1')]={'type':{'type':Sequelize[_0x19af('0x2')](_0x19af('0x3'),'variable',_0x19af('0x4'),_0x19af('0x5'),'picklist'),'defaultValue':_0x19af('0x3')},'content':{'type':Sequelize[_0x19af('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x19af('0x2')](_0x19af('0x3'),'variable',_0x19af('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x19af('0x6')]},'nameField':{'type':Sequelize[_0x19af('0x6')]},'customField':{'type':Sequelize[_0x19af('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x19af('0x6')]}}; \ No newline at end of file +var _0xd3a8=['ENUM','string','picklist','STRING','customVariable','sequelize','exports'];(function(_0x7880d2,_0x32e7d6){var _0x35ebbe=function(_0x5c27fa){while(--_0x5c27fa){_0x7880d2['push'](_0x7880d2['shift']());}};_0x35ebbe(++_0x32e7d6);}(_0xd3a8,0x1b0));var _0x8d3a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd3a8[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x8d3a('0x0'));module[_0x8d3a('0x1')]={'type':{'type':Sequelize[_0x8d3a('0x2')](_0x8d3a('0x3'),'variable','customVariable','keyValue',_0x8d3a('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8d3a('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8d3a('0x2')]('string','variable',_0x8d3a('0x6'))},'keyContent':{'type':Sequelize[_0x8d3a('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8d3a('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8d3a('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 6d12a21..054b575 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 _0x9f15=['show','params','rawAttributes','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','end','sendStatus','stack','name','send','index','map','FreshsalesField','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x1f5a63,_0x511504){var _0x30bb7a=function(_0x476310){while(--_0x476310){_0x1f5a63['push'](_0x1f5a63['shift']());}};_0x30bb7a(++_0x511504);}(_0x9f15,0x1dc));var _0x59f1=function(_0x2d2a58,_0x1f8f4b){_0x2d2a58=_0x2d2a58-0x0;var _0x451dfb=_0x9f15[_0x2d2a58];return _0x451dfb;};'use strict';var emlformat=require(_0x59f1('0x0'));var rimraf=require(_0x59f1('0x1'));var zipdir=require(_0x59f1('0x2'));var jsonpatch=require(_0x59f1('0x3'));var rp=require(_0x59f1('0x4'));var moment=require(_0x59f1('0x5'));var BPromise=require(_0x59f1('0x6'));var Mustache=require(_0x59f1('0x7'));var util=require(_0x59f1('0x8'));var path=require('path');var sox=require(_0x59f1('0x9'));var csv=require('to-csv');var ejs=require(_0x59f1('0xa'));var fs=require('fs');var fs_extra=require(_0x59f1('0xb'));var _=require(_0x59f1('0xc'));var squel=require(_0x59f1('0xd'));var crypto=require(_0x59f1('0xe'));var jsforce=require(_0x59f1('0xf'));var deskjs=require(_0x59f1('0x10'));var toCsv=require(_0x59f1('0x11'));var querystring=require(_0x59f1('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x59f1('0x13'));var qs=require(_0x59f1('0x14'));var as=require(_0x59f1('0x15'));var hardwareService=require(_0x59f1('0x16'));var logger=require(_0x59f1('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x59f1('0x18'));var licenseUtil=require(_0x59f1('0x19'));var db=require(_0x59f1('0x1a'))['db'];function respondWithStatusCode(_0x2213b4,_0x1df1f0){_0x1df1f0=_0x1df1f0||0xcc;return function(_0x2120a7){if(_0x2120a7){return _0x2213b4['sendStatus'](_0x1df1f0);}return _0x2213b4[_0x59f1('0x1b')](_0x1df1f0)['end']();};}function respondWithResult(_0x1fc1f0,_0x450c80){_0x450c80=_0x450c80||0xc8;return function(_0x1e484c){if(_0x1e484c){return _0x1fc1f0[_0x59f1('0x1b')](_0x450c80)[_0x59f1('0x1c')](_0x1e484c);}};}function respondWithFilteredResult(_0x5d4c85,_0x2db228){return function(_0x2cb89c){if(_0x2cb89c){var _0x496523=typeof _0x2db228['offset']===_0x59f1('0x1d')&&typeof _0x2db228[_0x59f1('0x1e')]===_0x59f1('0x1d');var _0xb6a98c=_0x2cb89c[_0x59f1('0x1f')];var _0x3c7d9b=_0x496523?0x0:_0x2db228[_0x59f1('0x20')];var _0x2d80c4=_0x496523?_0x2cb89c[_0x59f1('0x1f')]:_0x2db228[_0x59f1('0x20')]+_0x2db228['limit'];var _0x405cfc;if(_0x2d80c4>=_0xb6a98c){_0x2d80c4=_0xb6a98c;_0x405cfc=0xc8;}else{_0x405cfc=0xce;}_0x5d4c85[_0x59f1('0x1b')](_0x405cfc);return _0x5d4c85[_0x59f1('0x21')](_0x59f1('0x22'),_0x3c7d9b+'-'+_0x2d80c4+'/'+_0xb6a98c)[_0x59f1('0x1c')](_0x2cb89c);}return null;};}function patchUpdates(_0xa74cb6){return function(_0x3480a7){try{jsonpatch[_0x59f1('0x23')](_0x3480a7,_0xa74cb6,!![]);}catch(_0x15ebcf){return BPromise['reject'](_0x15ebcf);}return _0x3480a7[_0x59f1('0x24')]();};}function saveUpdates(_0x360a0b,_0x1c7d0d){return function(_0x48d3f8){if(_0x48d3f8){return _0x48d3f8[_0x59f1('0x25')](_0x360a0b)[_0x59f1('0x26')](function(_0x5f0956){return _0x5f0956;});}return null;};}function removeEntity(_0x49135a,_0x1bd1e7){return function(_0x205b2f){if(_0x205b2f){return _0x205b2f['destroy']()[_0x59f1('0x26')](function(){_0x49135a['status'](0xcc)[_0x59f1('0x27')]();});}};}function handleEntityNotFound(_0xdba1aa,_0x5df963){return function(_0x4c5f52){if(!_0x4c5f52){_0xdba1aa[_0x59f1('0x28')](0x194);}return _0x4c5f52;};}function handleError(_0x14f601,_0x3c2e1a){_0x3c2e1a=_0x3c2e1a||0x1f4;return function(_0x5dcd07){logger['error'](_0x5dcd07[_0x59f1('0x29')]);if(_0x5dcd07[_0x59f1('0x2a')]){delete _0x5dcd07[_0x59f1('0x2a')];}_0x14f601[_0x59f1('0x1b')](_0x3c2e1a)[_0x59f1('0x2b')](_0x5dcd07);};}exports[_0x59f1('0x2c')]=function(_0x240d75,_0x1a8bd5){var _0x2dde70={},_0x1a983e={},_0x59442f={'count':0x0,'rows':[]};var _0x306f72=_[_0x59f1('0x2d')](db[_0x59f1('0x2e')]['rawAttributes'],function(_0x4163ef){return{'name':_0x4163ef[_0x59f1('0x2f')],'type':_0x4163ef[_0x59f1('0x30')]['key']};});_0x1a983e[_0x59f1('0x31')]=_[_0x59f1('0x2d')](_0x306f72,_0x59f1('0x2a'));_0x1a983e[_0x59f1('0x32')]=_['keys'](_0x240d75['query']);_0x1a983e['filters']=_[_0x59f1('0x33')](_0x1a983e['model'],_0x1a983e['query']);_0x2dde70['attributes']=_[_0x59f1('0x33')](_0x1a983e[_0x59f1('0x31')],qs[_0x59f1('0x34')](_0x240d75['query'][_0x59f1('0x34')]));_0x2dde70['attributes']=_0x2dde70[_0x59f1('0x35')][_0x59f1('0x36')]?_0x2dde70[_0x59f1('0x35')]:_0x1a983e[_0x59f1('0x31')];if(!_0x240d75[_0x59f1('0x32')][_0x59f1('0x37')](_0x59f1('0x38'))){_0x2dde70[_0x59f1('0x1e')]=qs[_0x59f1('0x1e')](_0x240d75['query'][_0x59f1('0x1e')]);_0x2dde70[_0x59f1('0x20')]=qs[_0x59f1('0x20')](_0x240d75[_0x59f1('0x32')]['offset']);}_0x2dde70[_0x59f1('0x39')]=qs[_0x59f1('0x3a')](_0x240d75[_0x59f1('0x32')][_0x59f1('0x3a')]);_0x2dde70[_0x59f1('0x3b')]=qs['filters'](_['pick'](_0x240d75[_0x59f1('0x32')],_0x1a983e[_0x59f1('0x3c')]),_0x306f72);if(_0x240d75[_0x59f1('0x32')][_0x59f1('0x3d')]){_0x2dde70[_0x59f1('0x3b')]=_['merge'](_0x2dde70['where'],{'$or':_[_0x59f1('0x2d')](_0x306f72,function(_0x38b863){if(_0x38b863[_0x59f1('0x30')]!==_0x59f1('0x3e')){var _0x26fa32={};_0x26fa32[_0x38b863['name']]={'$like':'%'+_0x240d75['query']['filter']+'%'};return _0x26fa32;}})});}_0x2dde70=_[_0x59f1('0x3f')]({},_0x2dde70,_0x240d75[_0x59f1('0x40')]);var _0x247c8d={'where':_0x2dde70[_0x59f1('0x3b')]};return db['FreshsalesField']['count'](_0x247c8d)[_0x59f1('0x26')](function(_0xa7bc3c){_0x59442f['count']=_0xa7bc3c;if(_0x240d75[_0x59f1('0x32')][_0x59f1('0x41')]){_0x2dde70[_0x59f1('0x42')]=[{'all':!![]}];}return db['FreshsalesField'][_0x59f1('0x43')](_0x2dde70);})[_0x59f1('0x26')](function(_0x4cc459){_0x59442f[_0x59f1('0x44')]=_0x4cc459;return _0x59442f;})[_0x59f1('0x26')](respondWithFilteredResult(_0x1a8bd5,_0x2dde70))[_0x59f1('0x45')](handleError(_0x1a8bd5,null));};exports[_0x59f1('0x46')]=function(_0x3cf603,_0x3769d9){var _0x4497ab={'raw':!![],'where':{'id':_0x3cf603[_0x59f1('0x47')]['id']}},_0x28fd8d={};_0x28fd8d[_0x59f1('0x31')]=_['keys'](db[_0x59f1('0x2e')][_0x59f1('0x48')]);_0x28fd8d['query']=_[_0x59f1('0x49')](_0x3cf603[_0x59f1('0x32')]);_0x28fd8d[_0x59f1('0x3c')]=_[_0x59f1('0x33')](_0x28fd8d['model'],_0x28fd8d[_0x59f1('0x32')]);_0x4497ab[_0x59f1('0x35')]=_[_0x59f1('0x33')](_0x28fd8d[_0x59f1('0x31')],qs[_0x59f1('0x34')](_0x3cf603['query'][_0x59f1('0x34')]));_0x4497ab[_0x59f1('0x35')]=_0x4497ab['attributes'][_0x59f1('0x36')]?_0x4497ab[_0x59f1('0x35')]:_0x28fd8d[_0x59f1('0x31')];if(_0x3cf603['query'][_0x59f1('0x41')]){_0x4497ab['include']=[{'all':!![]}];}_0x4497ab=_[_0x59f1('0x3f')]({},_0x4497ab,_0x3cf603['options']);return db['FreshsalesField'][_0x59f1('0x4a')](_0x4497ab)[_0x59f1('0x26')](handleEntityNotFound(_0x3769d9,null))[_0x59f1('0x26')](respondWithResult(_0x3769d9,null))['catch'](handleError(_0x3769d9,null));};exports[_0x59f1('0x4b')]=function(_0x483cb6,_0x27ccaf){return db[_0x59f1('0x2e')][_0x59f1('0x4b')](_0x483cb6[_0x59f1('0x4c')],{})['then'](respondWithResult(_0x27ccaf,0xc9))[_0x59f1('0x45')](handleError(_0x27ccaf,null));};exports[_0x59f1('0x25')]=function(_0x49dc90,_0x314c30){if(_0x49dc90['body']['id']){delete _0x49dc90['body']['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x49dc90[_0x59f1('0x47')]['id']}})[_0x59f1('0x26')](handleEntityNotFound(_0x314c30,null))[_0x59f1('0x26')](saveUpdates(_0x49dc90[_0x59f1('0x4c')],null))['then'](respondWithResult(_0x314c30,null))['catch'](handleError(_0x314c30,null));};exports[_0x59f1('0x4d')]=function(_0x4ddcce,_0x58de1a){return db['FreshsalesField'][_0x59f1('0x4a')]({'where':{'id':_0x4ddcce[_0x59f1('0x47')]['id']}})[_0x59f1('0x26')](handleEntityNotFound(_0x58de1a,null))[_0x59f1('0x26')](removeEntity(_0x58de1a,null))[_0x59f1('0x45')](handleError(_0x58de1a,null));}; \ No newline at end of file +var _0x5864=['lodash','crypto','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','count','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','FreshsalesField','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','show','params','rawAttributes','find','create','update','body','catch','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','ejs'];(function(_0x4de4d3,_0x11f992){var _0x490d07=function(_0x6bbbb3){while(--_0x6bbbb3){_0x4de4d3['push'](_0x4de4d3['shift']());}};_0x490d07(++_0x11f992);}(_0x5864,0x117));var _0x4586=function(_0x29d8df,_0x120dba){_0x29d8df=_0x29d8df-0x0;var _0x602ef6=_0x5864[_0x29d8df];return _0x602ef6;};'use strict';var emlformat=require(_0x4586('0x0'));var rimraf=require(_0x4586('0x1'));var zipdir=require(_0x4586('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4586('0x3'));var BPromise=require(_0x4586('0x4'));var Mustache=require(_0x4586('0x5'));var util=require(_0x4586('0x6'));var path=require('path');var sox=require(_0x4586('0x7'));var csv=require('to-csv');var ejs=require(_0x4586('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4586('0x9'));var squel=require('squel');var crypto=require(_0x4586('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4586('0xb'));var Papa=require(_0x4586('0xc'));var Redis=require('ioredis');var authService=require(_0x4586('0xd'));var qs=require(_0x4586('0xe'));var as=require(_0x4586('0xf'));var hardwareService=require(_0x4586('0x10'));var logger=require(_0x4586('0x11'))(_0x4586('0x12'));var utils=require(_0x4586('0x13'));var config=require(_0x4586('0x14'));var licenseUtil=require(_0x4586('0x15'));var db=require(_0x4586('0x16'))['db'];function respondWithStatusCode(_0x556b02,_0x1a28ec){_0x1a28ec=_0x1a28ec||0xcc;return function(_0x4b4568){if(_0x4b4568){return _0x556b02['sendStatus'](_0x1a28ec);}return _0x556b02[_0x4586('0x17')](_0x1a28ec)[_0x4586('0x18')]();};}function respondWithResult(_0x2547c3,_0x4424fe){_0x4424fe=_0x4424fe||0xc8;return function(_0x6d599c){if(_0x6d599c){return _0x2547c3[_0x4586('0x17')](_0x4424fe)[_0x4586('0x19')](_0x6d599c);}};}function respondWithFilteredResult(_0x448f34,_0x2d3036){return function(_0x361a){if(_0x361a){var _0x524ce0=typeof _0x2d3036[_0x4586('0x1a')]===_0x4586('0x1b')&&typeof _0x2d3036['limit']===_0x4586('0x1b');var _0x2737aa=_0x361a[_0x4586('0x1c')];var _0x4e04c6=_0x524ce0?0x0:_0x2d3036[_0x4586('0x1a')];var _0x3e4b06=_0x524ce0?_0x361a['count']:_0x2d3036[_0x4586('0x1a')]+_0x2d3036[_0x4586('0x1d')];var _0x3cb756;if(_0x3e4b06>=_0x2737aa){_0x3e4b06=_0x2737aa;_0x3cb756=0xc8;}else{_0x3cb756=0xce;}_0x448f34['status'](_0x3cb756);return _0x448f34['set'](_0x4586('0x1e'),_0x4e04c6+'-'+_0x3e4b06+'/'+_0x2737aa)[_0x4586('0x19')](_0x361a);}return null;};}function patchUpdates(_0x39f2c){return function(_0x4fc1f1){try{jsonpatch[_0x4586('0x1f')](_0x4fc1f1,_0x39f2c,!![]);}catch(_0x3bc435){return BPromise[_0x4586('0x20')](_0x3bc435);}return _0x4fc1f1[_0x4586('0x21')]();};}function saveUpdates(_0x3efa87,_0x50a8c9){return function(_0x59ccb3){if(_0x59ccb3){return _0x59ccb3['update'](_0x3efa87)[_0x4586('0x22')](function(_0xc0d791){return _0xc0d791;});}return null;};}function removeEntity(_0x3a0301,_0x2c8682){return function(_0x3d0470){if(_0x3d0470){return _0x3d0470[_0x4586('0x23')]()[_0x4586('0x22')](function(){_0x3a0301[_0x4586('0x17')](0xcc)[_0x4586('0x18')]();});}};}function handleEntityNotFound(_0x18af62,_0x4f5696){return function(_0x108f3d){if(!_0x108f3d){_0x18af62['sendStatus'](0x194);}return _0x108f3d;};}function handleError(_0x1a9318,_0x43e1ba){_0x43e1ba=_0x43e1ba||0x1f4;return function(_0x567d2e){logger[_0x4586('0x24')](_0x567d2e[_0x4586('0x25')]);if(_0x567d2e[_0x4586('0x26')]){delete _0x567d2e[_0x4586('0x26')];}_0x1a9318[_0x4586('0x17')](_0x43e1ba)['send'](_0x567d2e);};}exports['index']=function(_0x2ff70c,_0x3a3cfa){var _0x2e3da3={},_0x5d70b3={},_0x3d5faa={'count':0x0,'rows':[]};var _0x1a94e=_[_0x4586('0x27')](db[_0x4586('0x28')]['rawAttributes'],function(_0x3a4930){return{'name':_0x3a4930[_0x4586('0x29')],'type':_0x3a4930[_0x4586('0x2a')][_0x4586('0x2b')]};});_0x5d70b3[_0x4586('0x2c')]=_[_0x4586('0x27')](_0x1a94e,_0x4586('0x26'));_0x5d70b3[_0x4586('0x2d')]=_[_0x4586('0x2e')](_0x2ff70c[_0x4586('0x2d')]);_0x5d70b3[_0x4586('0x2f')]=_['intersection'](_0x5d70b3[_0x4586('0x2c')],_0x5d70b3[_0x4586('0x2d')]);_0x2e3da3[_0x4586('0x30')]=_[_0x4586('0x31')](_0x5d70b3['model'],qs['fields'](_0x2ff70c['query'][_0x4586('0x32')]));_0x2e3da3[_0x4586('0x30')]=_0x2e3da3['attributes'][_0x4586('0x33')]?_0x2e3da3[_0x4586('0x30')]:_0x5d70b3[_0x4586('0x2c')];if(!_0x2ff70c[_0x4586('0x2d')][_0x4586('0x34')](_0x4586('0x35'))){_0x2e3da3['limit']=qs['limit'](_0x2ff70c['query'][_0x4586('0x1d')]);_0x2e3da3[_0x4586('0x1a')]=qs[_0x4586('0x1a')](_0x2ff70c[_0x4586('0x2d')][_0x4586('0x1a')]);}_0x2e3da3['order']=qs[_0x4586('0x36')](_0x2ff70c[_0x4586('0x2d')][_0x4586('0x36')]);_0x2e3da3['where']=qs[_0x4586('0x2f')](_[_0x4586('0x37')](_0x2ff70c['query'],_0x5d70b3[_0x4586('0x2f')]),_0x1a94e);if(_0x2ff70c[_0x4586('0x2d')][_0x4586('0x38')]){_0x2e3da3['where']=_[_0x4586('0x39')](_0x2e3da3['where'],{'$or':_[_0x4586('0x27')](_0x1a94e,function(_0x12123d){if(_0x12123d[_0x4586('0x2a')]!==_0x4586('0x3a')){var _0x57963c={};_0x57963c[_0x12123d[_0x4586('0x26')]]={'$like':'%'+_0x2ff70c[_0x4586('0x2d')]['filter']+'%'};return _0x57963c;}})});}_0x2e3da3=_[_0x4586('0x39')]({},_0x2e3da3,_0x2ff70c[_0x4586('0x3b')]);var _0x4718ce={'where':_0x2e3da3[_0x4586('0x3c')]};return db[_0x4586('0x28')][_0x4586('0x1c')](_0x4718ce)[_0x4586('0x22')](function(_0x2ebd97){_0x3d5faa[_0x4586('0x1c')]=_0x2ebd97;if(_0x2ff70c[_0x4586('0x2d')][_0x4586('0x3d')]){_0x2e3da3[_0x4586('0x3e')]=[{'all':!![]}];}return db[_0x4586('0x28')][_0x4586('0x3f')](_0x2e3da3);})['then'](function(_0x33c697){_0x3d5faa['rows']=_0x33c697;return _0x3d5faa;})[_0x4586('0x22')](respondWithFilteredResult(_0x3a3cfa,_0x2e3da3))['catch'](handleError(_0x3a3cfa,null));};exports[_0x4586('0x40')]=function(_0x2eaa29,_0x1687ba){var _0x14fd8a={'raw':!![],'where':{'id':_0x2eaa29[_0x4586('0x41')]['id']}},_0x9ff4f3={};_0x9ff4f3[_0x4586('0x2c')]=_[_0x4586('0x2e')](db[_0x4586('0x28')][_0x4586('0x42')]);_0x9ff4f3['query']=_[_0x4586('0x2e')](_0x2eaa29[_0x4586('0x2d')]);_0x9ff4f3[_0x4586('0x2f')]=_[_0x4586('0x31')](_0x9ff4f3[_0x4586('0x2c')],_0x9ff4f3[_0x4586('0x2d')]);_0x14fd8a[_0x4586('0x30')]=_[_0x4586('0x31')](_0x9ff4f3['model'],qs['fields'](_0x2eaa29[_0x4586('0x2d')][_0x4586('0x32')]));_0x14fd8a['attributes']=_0x14fd8a['attributes'][_0x4586('0x33')]?_0x14fd8a[_0x4586('0x30')]:_0x9ff4f3['model'];if(_0x2eaa29[_0x4586('0x2d')]['includeAll']){_0x14fd8a[_0x4586('0x3e')]=[{'all':!![]}];}_0x14fd8a=_['merge']({},_0x14fd8a,_0x2eaa29[_0x4586('0x3b')]);return db['FreshsalesField'][_0x4586('0x43')](_0x14fd8a)[_0x4586('0x22')](handleEntityNotFound(_0x1687ba,null))[_0x4586('0x22')](respondWithResult(_0x1687ba,null))['catch'](handleError(_0x1687ba,null));};exports[_0x4586('0x44')]=function(_0x3f472e,_0x5e6224){return db[_0x4586('0x28')][_0x4586('0x44')](_0x3f472e['body'],{})[_0x4586('0x22')](respondWithResult(_0x5e6224,0xc9))['catch'](handleError(_0x5e6224,null));};exports[_0x4586('0x45')]=function(_0x4567af,_0x3a78bc){if(_0x4567af['body']['id']){delete _0x4567af[_0x4586('0x46')]['id'];}return db['FreshsalesField'][_0x4586('0x43')]({'where':{'id':_0x4567af[_0x4586('0x41')]['id']}})[_0x4586('0x22')](handleEntityNotFound(_0x3a78bc,null))[_0x4586('0x22')](saveUpdates(_0x4567af[_0x4586('0x46')],null))[_0x4586('0x22')](respondWithResult(_0x3a78bc,null))[_0x4586('0x47')](handleError(_0x3a78bc,null));};exports['destroy']=function(_0xbeba75,_0x277a09){return db['FreshsalesField'][_0x4586('0x43')]({'where':{'id':_0xbeba75[_0x4586('0x41')]['id']}})[_0x4586('0x22')](handleEntityNotFound(_0x277a09,null))[_0x4586('0x22')](removeEntity(_0x277a09,null))[_0x4586('0x47')](handleError(_0x277a09,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index b16d1e1..59be77d 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 _0x0972=['rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','int_freshsales_fields','freshsales_unique_index','idField','FieldId','util','api','bluebird','request-promise'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0x0972,0x64));var _0x2097=function(_0x1c4d2d,_0x457585){_0x1c4d2d=_0x1c4d2d-0x0;var _0x4988f2=_0x0972[_0x1c4d2d];return _0x4988f2;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var logger=require('../../config/logger')(_0x2097('0x1'));var moment=require('moment');var BPromise=require(_0x2097('0x2'));var rp=require(_0x2097('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var attributes=require(_0x2097('0x6'));module[_0x2097('0x7')]=function(_0x2f84d8,_0x11ed13){return _0x2f84d8[_0x2097('0x8')]('FreshsalesField',attributes,{'tableName':_0x2097('0x9'),'paranoid':![],'indexes':[{'name':_0x2097('0xa'),'fields':[_0x2097('0xb'),_0x2097('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbbbc=['./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x438fe1,_0x3308d5){var _0x3c8e1b=function(_0x2f8d41){while(--_0x2f8d41){_0x438fe1['push'](_0x438fe1['shift']());}};_0x3c8e1b(++_0x3308d5);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x55c102,_0x4121d0){_0x55c102=_0x55c102-0x0;var _0x7665dd=_0xbbbc[_0x55c102];return _0x7665dd;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var logger=require(_0xcbbb('0x2'))(_0xcbbb('0x3'));var moment=require(_0xcbbb('0x4'));var BPromise=require(_0xcbbb('0x5'));var rp=require(_0xcbbb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbbb('0x7'));var config=require(_0xcbbb('0x8'));var attributes=require(_0xcbbb('0x9'));module[_0xcbbb('0xa')]=function(_0x43ff05,_0x4978a9){return _0x43ff05[_0xcbbb('0xb')](_0xcbbb('0xc'),attributes,{'tableName':_0xcbbb('0xd'),'paranoid':![],'indexes':[{'name':_0xcbbb('0xe'),'fields':[_0xcbbb('0xf'),_0xcbbb('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index cf9cfb9..b392d49 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 _0x1261=['then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\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(_0x4fe2a8,_0x4953ad){var _0x2baeed=function(_0x5a16cc){while(--_0x5a16cc){_0x4fe2a8['push'](_0x4fe2a8['shift']());}};_0x2baeed(++_0x4953ad);}(_0x1261,0x144));var _0x1126=function(_0x1fa274,_0x27a51f){_0x1fa274=_0x1fa274-0x0;var _0x5601e0=_0x1261[_0x1fa274];return _0x5601e0;};'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')]('FreshsalesField,\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 _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(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x139c24,_0x562ba1){_0x139c24=_0x139c24-0x0;var _0xed1b28=_0x3f8a[_0x139c24];return _0xed1b28;};'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 diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 2cacbd8..082e4a5 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4bef93,_0xcaec86){var _0x2773e0=function(_0x32c18c){while(--_0x32c18c){_0x4bef93['push'](_0x4bef93['shift']());}};_0x2773e0(++_0xcaec86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x27ad21,_0x295336){var _0x3deb2e=function(_0x2a0f5c){while(--_0x2a0f5c){_0x27ad21['push'](_0x27ad21['shift']());}};_0x3deb2e(++_0x295336);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index e868495..4ad6e87 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 _0x4213=['exports','STRING','username','ENUM','integrationTab','sequelize'];(function(_0x5e2eb5,_0x3f4e6c){var _0x180baf=function(_0x3e97d1){while(--_0x3e97d1){_0x5e2eb5['push'](_0x5e2eb5['shift']());}};_0x180baf(++_0x3f4e6c);}(_0x4213,0x77));var _0x3421=function(_0x17321c,_0x44cdc6){_0x17321c=_0x17321c-0x0;var _0x40b9ec=_0x4213[_0x17321c];return _0x40b9ec;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'name':{'type':Sequelize[_0x3421('0x2')]},'description':{'type':Sequelize[_0x3421('0x2')]},'username':{'type':Sequelize[_0x3421('0x2')],'unique':_0x3421('0x3')},'remoteUri':{'type':Sequelize[_0x3421('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x3421('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x3421('0x2')]},'serverUrl':{'type':Sequelize[_0x3421('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3421('0x4')](_0x3421('0x5'),'newTab'),'defaultValue':_0x3421('0x5')}}; \ No newline at end of file +var _0x93e9=['newTab','sequelize','exports','STRING','username','ENUM','integrationTab'];(function(_0x2db5f2,_0x244403){var _0x230c2f=function(_0x5eae55){while(--_0x5eae55){_0x2db5f2['push'](_0x2db5f2['shift']());}};_0x230c2f(++_0x244403);}(_0x93e9,0xcc));var _0x993e=function(_0x5060ac,_0x46cf92){_0x5060ac=_0x5060ac-0x0;var _0x496f54=_0x93e9[_0x5060ac];return _0x496f54;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'name':{'type':Sequelize[_0x993e('0x2')]},'description':{'type':Sequelize[_0x993e('0x2')]},'username':{'type':Sequelize[_0x993e('0x2')],'unique':_0x993e('0x3')},'remoteUri':{'type':Sequelize[_0x993e('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x993e('0x2')]},'securityToken':{'type':Sequelize[_0x993e('0x2')]},'serverUrl':{'type':Sequelize[_0x993e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x993e('0x4')](_0x993e('0x5'),_0x993e('0x6')),'defaultValue':_0x993e('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index bb8c782..e74da61 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 _0xe308=['length','includeAll','create','body','update','find','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','concat','isNil','sobject','ActivityDate','IsReminderSet','IsRecurrence','int','picklist','boolean','email','textarea','remove','includes','label','custom','value','True','False','false','test','statusCode','stringify','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','end','error','name','send','index','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','SalesforceAccount','include','rows','catch','params'];(function(_0x10b30e,_0x381b54){var _0x5591c0=function(_0x29de51){while(--_0x29de51){_0x10b30e['push'](_0x10b30e['shift']());}};_0x5591c0(++_0x381b54);}(_0xe308,0x194));var _0x8e30=function(_0x267e32,_0x5c23bd){_0x267e32=_0x267e32-0x0;var _0x437a60=_0xe308[_0x267e32];return _0x437a60;};'use strict';var emlformat=require(_0x8e30('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8e30('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e30('0x2'));var moment=require('moment');var BPromise=require(_0x8e30('0x3'));var Mustache=require('mustache');var util=require(_0x8e30('0x4'));var path=require(_0x8e30('0x5'));var sox=require(_0x8e30('0x6'));var csv=require(_0x8e30('0x7'));var ejs=require(_0x8e30('0x8'));var fs=require('fs');var fs_extra=require(_0x8e30('0x9'));var _=require(_0x8e30('0xa'));var squel=require(_0x8e30('0xb'));var crypto=require(_0x8e30('0xc'));var jsforce=require(_0x8e30('0xd'));var deskjs=require(_0x8e30('0xe'));var toCsv=require(_0x8e30('0x7'));var querystring=require(_0x8e30('0xf'));var Papa=require(_0x8e30('0x10'));var Redis=require(_0x8e30('0x11'));var authService=require(_0x8e30('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8e30('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8e30('0x14'));var utils=require(_0x8e30('0x15'));var config=require(_0x8e30('0x16'));var licenseUtil=require(_0x8e30('0x17'));var db=require(_0x8e30('0x18'))['db'];var integrations=require(_0x8e30('0x19'));function respondWithStatusCode(_0x4cf69d,_0x245f16){_0x245f16=_0x245f16||0xcc;return function(_0x4ba722){if(_0x4ba722){return _0x4cf69d[_0x8e30('0x1a')](_0x245f16);}return _0x4cf69d[_0x8e30('0x1b')](_0x245f16)['end']();};}function respondWithResult(_0x1ee440,_0x3962e2){_0x3962e2=_0x3962e2||0xc8;return function(_0x229746){if(_0x229746){return _0x1ee440[_0x8e30('0x1b')](_0x3962e2)[_0x8e30('0x1c')](_0x229746);}};}function respondWithFilteredResult(_0x5781e6,_0x1e1e05){return function(_0xc65638){if(_0xc65638){var _0x141656=typeof _0x1e1e05[_0x8e30('0x1d')]===_0x8e30('0x1e')&&typeof _0x1e1e05[_0x8e30('0x1f')]===_0x8e30('0x1e');var _0x4113d9=_0xc65638[_0x8e30('0x20')];var _0x9dc302=_0x141656?0x0:_0x1e1e05[_0x8e30('0x1d')];var _0x28bbb8=_0x141656?_0xc65638['count']:_0x1e1e05[_0x8e30('0x1d')]+_0x1e1e05[_0x8e30('0x1f')];var _0x538aa5;if(_0x28bbb8>=_0x4113d9){_0x28bbb8=_0x4113d9;_0x538aa5=0xc8;}else{_0x538aa5=0xce;}_0x5781e6[_0x8e30('0x1b')](_0x538aa5);return _0x5781e6['set'](_0x8e30('0x21'),_0x9dc302+'-'+_0x28bbb8+'/'+_0x4113d9)[_0x8e30('0x1c')](_0xc65638);}return null;};}function patchUpdates(_0x23533d){return function(_0x5f1def){try{jsonpatch[_0x8e30('0x22')](_0x5f1def,_0x23533d,!![]);}catch(_0x532c5c){return BPromise[_0x8e30('0x23')](_0x532c5c);}return _0x5f1def['save']();};}function saveUpdates(_0x517816,_0x2d5ae8){return function(_0x483818){if(_0x483818){return _0x483818['update'](_0x517816)['then'](function(_0x2301b4){return _0x2301b4;});}return null;};}function removeEntity(_0x39078e,_0x5cc2dc){return function(_0x1f1dad){if(_0x1f1dad){return _0x1f1dad['destroy']()[_0x8e30('0x24')](function(){_0x39078e['status'](0xcc)[_0x8e30('0x25')]();});}};}function handleEntityNotFound(_0x417728,_0x709da2){return function(_0x377f61){if(!_0x377f61){_0x417728['sendStatus'](0x194);}return _0x377f61;};}function handleError(_0x1ded3d,_0x13c7cb){_0x13c7cb=_0x13c7cb||0x1f4;return function(_0x2b7b60){logger[_0x8e30('0x26')](_0x2b7b60['stack']);if(_0x2b7b60[_0x8e30('0x27')]){delete _0x2b7b60[_0x8e30('0x27')];}_0x1ded3d[_0x8e30('0x1b')](_0x13c7cb)[_0x8e30('0x28')](_0x2b7b60);};}exports[_0x8e30('0x29')]=function(_0x48eaaa,_0x3d1697){var _0x469bab={},_0x28bb21={},_0x2e3164={'count':0x0,'rows':[]};var _0x41310c=_['map'](db['SalesforceAccount'][_0x8e30('0x2a')],function(_0x32c282){return{'name':_0x32c282['fieldName'],'type':_0x32c282[_0x8e30('0x2b')][_0x8e30('0x2c')]};});_0x28bb21[_0x8e30('0x2d')]=_['map'](_0x41310c,_0x8e30('0x27'));_0x28bb21[_0x8e30('0x2e')]=_[_0x8e30('0x2f')](_0x48eaaa['query']);_0x28bb21[_0x8e30('0x30')]=_[_0x8e30('0x31')](_0x28bb21[_0x8e30('0x2d')],_0x28bb21['query']);_0x469bab['attributes']=_['intersection'](_0x28bb21['model'],qs[_0x8e30('0x32')](_0x48eaaa[_0x8e30('0x2e')][_0x8e30('0x32')]));_0x469bab[_0x8e30('0x33')]=_0x469bab[_0x8e30('0x33')]['length']?_0x469bab['attributes']:_0x28bb21['model'];if(!_0x48eaaa[_0x8e30('0x2e')][_0x8e30('0x34')](_0x8e30('0x35'))){_0x469bab[_0x8e30('0x1f')]=qs[_0x8e30('0x1f')](_0x48eaaa[_0x8e30('0x2e')]['limit']);_0x469bab[_0x8e30('0x1d')]=qs[_0x8e30('0x1d')](_0x48eaaa[_0x8e30('0x2e')]['offset']);}_0x469bab[_0x8e30('0x36')]=qs[_0x8e30('0x37')](_0x48eaaa[_0x8e30('0x2e')][_0x8e30('0x37')]);_0x469bab[_0x8e30('0x38')]=qs[_0x8e30('0x30')](_[_0x8e30('0x39')](_0x48eaaa['query'],_0x28bb21[_0x8e30('0x30')]),_0x41310c);if(_0x48eaaa[_0x8e30('0x2e')][_0x8e30('0x3a')]){_0x469bab[_0x8e30('0x38')]=_[_0x8e30('0x3b')](_0x469bab[_0x8e30('0x38')],{'$or':_[_0x8e30('0x3c')](_0x41310c,function(_0x49cc82){if(_0x49cc82[_0x8e30('0x2b')]!==_0x8e30('0x3d')){var _0x57aedd={};_0x57aedd[_0x49cc82[_0x8e30('0x27')]]={'$like':'%'+_0x48eaaa[_0x8e30('0x2e')][_0x8e30('0x3a')]+'%'};return _0x57aedd;}})});}_0x469bab=_[_0x8e30('0x3b')]({},_0x469bab,_0x48eaaa[_0x8e30('0x3e')]);var _0x1d5baf={'where':_0x469bab[_0x8e30('0x38')]};return db[_0x8e30('0x3f')][_0x8e30('0x20')](_0x1d5baf)[_0x8e30('0x24')](function(_0x8f8e03){_0x2e3164[_0x8e30('0x20')]=_0x8f8e03;if(_0x48eaaa[_0x8e30('0x2e')]['includeAll']){_0x469bab[_0x8e30('0x40')]=[{'all':!![]}];}return db[_0x8e30('0x3f')]['findAll'](_0x469bab);})[_0x8e30('0x24')](function(_0x33822e){_0x2e3164[_0x8e30('0x41')]=_0x33822e;return _0x2e3164;})[_0x8e30('0x24')](respondWithFilteredResult(_0x3d1697,_0x469bab))[_0x8e30('0x42')](handleError(_0x3d1697,null));};exports['show']=function(_0x2566ff,_0x1f7117){var _0x32acf0={'raw':![],'where':{'id':_0x2566ff[_0x8e30('0x43')]['id']}},_0x3ac576={};_0x3ac576[_0x8e30('0x2d')]=_[_0x8e30('0x2f')](db[_0x8e30('0x3f')][_0x8e30('0x2a')]);_0x3ac576[_0x8e30('0x2e')]=_['keys'](_0x2566ff[_0x8e30('0x2e')]);_0x3ac576['filters']=_['intersection'](_0x3ac576[_0x8e30('0x2d')],_0x3ac576['query']);_0x32acf0[_0x8e30('0x33')]=_['intersection'](_0x3ac576[_0x8e30('0x2d')],qs[_0x8e30('0x32')](_0x2566ff[_0x8e30('0x2e')][_0x8e30('0x32')]));_0x32acf0[_0x8e30('0x33')]=_0x32acf0['attributes'][_0x8e30('0x44')]?_0x32acf0['attributes']:_0x3ac576[_0x8e30('0x2d')];if(_0x2566ff[_0x8e30('0x2e')][_0x8e30('0x45')]){_0x32acf0[_0x8e30('0x40')]=[{'all':!![]}];}_0x32acf0=_['merge']({},_0x32acf0,_0x2566ff[_0x8e30('0x3e')]);return db['SalesforceAccount']['find'](_0x32acf0)[_0x8e30('0x24')](handleEntityNotFound(_0x1f7117,null))[_0x8e30('0x24')](respondWithResult(_0x1f7117,null))['catch'](handleError(_0x1f7117,null));};exports[_0x8e30('0x46')]=function(_0x24dfd0,_0x5b1df7){return db['SalesforceAccount'][_0x8e30('0x46')](_0x24dfd0[_0x8e30('0x47')],{})[_0x8e30('0x24')](respondWithResult(_0x5b1df7,0xc9))[_0x8e30('0x42')](handleError(_0x5b1df7,null));};exports[_0x8e30('0x48')]=function(_0x494c2a,_0x23ce46){if(_0x494c2a['body']['id']){delete _0x494c2a['body']['id'];}return db[_0x8e30('0x3f')][_0x8e30('0x49')]({'where':{'id':_0x494c2a['params']['id']}})['then'](handleEntityNotFound(_0x23ce46,null))['then'](saveUpdates(_0x494c2a[_0x8e30('0x47')],null))[_0x8e30('0x24')](respondWithResult(_0x23ce46,null))[_0x8e30('0x42')](handleError(_0x23ce46,null));};exports['destroy']=function(_0x3e627b,_0x41c0e1){return db[_0x8e30('0x3f')][_0x8e30('0x49')]({'where':{'id':_0x3e627b[_0x8e30('0x43')]['id']}})[_0x8e30('0x24')](handleEntityNotFound(_0x41c0e1,null))['then'](removeEntity(_0x41c0e1,null))[_0x8e30('0x42')](handleError(_0x41c0e1,null));};exports[_0x8e30('0x4a')]=function(_0x163a26,_0x53c7ba,_0x216f28){var _0x2eb27c={};var _0x2c31ab={};var _0x13a7b0;var _0x260e18;return db[_0x8e30('0x3f')][_0x8e30('0x4b')]({'where':{'id':_0x163a26['params']['id']}})[_0x8e30('0x24')](handleEntityNotFound(_0x53c7ba,null))[_0x8e30('0x24')](function(_0x1e76d1){if(_0x1e76d1){_0x13a7b0=_0x1e76d1;_0x2c31ab[_0x8e30('0x2d')]=_[_0x8e30('0x2f')](db[_0x8e30('0x4c')][_0x8e30('0x2a')]);_0x2c31ab['query']=_[_0x8e30('0x2f')](_0x163a26[_0x8e30('0x2e')]);_0x2c31ab[_0x8e30('0x30')]=_[_0x8e30('0x31')](_0x2c31ab[_0x8e30('0x2d')],_0x2c31ab[_0x8e30('0x2e')]);_0x2eb27c[_0x8e30('0x33')]=_[_0x8e30('0x31')](_0x2c31ab[_0x8e30('0x2d')],qs['fields'](_0x163a26[_0x8e30('0x2e')]['fields']));_0x2eb27c['attributes']=_0x2eb27c['attributes']['length']?_0x2eb27c[_0x8e30('0x33')]:_0x2c31ab[_0x8e30('0x2d')];_0x2eb27c[_0x8e30('0x36')]=qs[_0x8e30('0x37')](_0x163a26[_0x8e30('0x2e')][_0x8e30('0x37')]);_0x2eb27c[_0x8e30('0x38')]=qs[_0x8e30('0x30')](_[_0x8e30('0x39')](_0x163a26[_0x8e30('0x2e')],_0x2c31ab[_0x8e30('0x30')]));if(_0x163a26[_0x8e30('0x2e')]['filter']){_0x2eb27c[_0x8e30('0x38')]=_[_0x8e30('0x3b')](_0x2eb27c[_0x8e30('0x38')],{'$or':_[_0x8e30('0x3c')](_0x2eb27c[_0x8e30('0x33')],function(_0x94bcb7){var _0x29160a={};_0x29160a[_0x94bcb7]={'$like':'%'+_0x163a26['query'][_0x8e30('0x3a')]+'%'};return _0x29160a;})});}_0x2eb27c=_['merge']({},_0x2eb27c,_0x163a26[_0x8e30('0x3e')]);return _0x13a7b0[_0x8e30('0x4a')](_0x2eb27c);}})[_0x8e30('0x24')](function(_0x5a85bf){if(_0x5a85bf){_0x260e18=_0x5a85bf['length'];if(!_0x163a26[_0x8e30('0x2e')]['hasOwnProperty']('nolimit')){_0x2eb27c[_0x8e30('0x1f')]=qs[_0x8e30('0x1f')](_0x163a26[_0x8e30('0x2e')]['limit']);_0x2eb27c[_0x8e30('0x1d')]=qs[_0x8e30('0x1d')](_0x163a26[_0x8e30('0x2e')][_0x8e30('0x1d')]);}return _0x13a7b0[_0x8e30('0x4a')](_0x2eb27c);}})[_0x8e30('0x24')](function(_0x4ed66c){if(_0x4ed66c){return _0x4ed66c?{'count':_0x260e18,'rows':_0x4ed66c}:null;}})[_0x8e30('0x24')](respondWithResult(_0x53c7ba,null))[_0x8e30('0x42')](handleError(_0x53c7ba,null));};exports[_0x8e30('0x4d')]=function(_0x23c7b3,_0x3513ca,_0x2406e0){if(_0x23c7b3[_0x8e30('0x47')]['id']){delete _0x23c7b3['body']['id'];}return db[_0x8e30('0x3f')][_0x8e30('0x4b')]({'where':{'id':_0x23c7b3[_0x8e30('0x43')]['id']}})[_0x8e30('0x24')](handleEntityNotFound(_0x3513ca,null))['then'](function(_0x43f6c8){if(_0x43f6c8){_0x23c7b3[_0x8e30('0x47')][_0x8e30('0x4e')]=_0x43f6c8['id'];_0x23c7b3[_0x8e30('0x47')][_0x8e30('0x4f')]=integrations[_0x8e30('0x50')](_0x23c7b3[_0x8e30('0x47')][_0x8e30('0x51')],_0x23c7b3['body'][_0x8e30('0x2b')]);_0x23c7b3[_0x8e30('0x47')][_0x8e30('0x52')]=integrations[_0x8e30('0x53')](_0x23c7b3[_0x8e30('0x47')]['channel'],_0x23c7b3[_0x8e30('0x47')][_0x8e30('0x2b')]);return db[_0x8e30('0x4c')][_0x8e30('0x46')](_0x23c7b3['body'],{'include':[{'model':db[_0x8e30('0x54')],'as':'Subjects'},{'model':db[_0x8e30('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3513ca,null))[_0x8e30('0x42')](handleError(_0x3513ca,null));};exports[_0x8e30('0x55')]=function(_0x285ba2,_0x2df212,_0x86b125){var _0x1fccd6;var _0x651c31='';var _0x27b229='Task';return db[_0x8e30('0x3f')]['findOne']({'where':{'id':_0x285ba2[_0x8e30('0x43')]['id']},'attributes':['id',_0x8e30('0x56'),_0x8e30('0x57'),_0x8e30('0x58'),_0x8e30('0x59'),_0x8e30('0x5a'),_0x8e30('0x5b')]})[_0x8e30('0x24')](handleEntityNotFound(_0x2df212,null))[_0x8e30('0x24')](function(_0x2ea432){if(_0x2ea432){_0x651c31=_0x2ea432[_0x8e30('0x56')];var _0x586fce=_0x651c31[_0x8e30('0x5c')](-0x1);if(_0x586fce==='/'){_0x651c31=_0x651c31[_0x8e30('0x5d')](0x0,_0x651c31[_0x8e30('0x5e')](_0x586fce));}_0x1fccd6=new jsforce[(_0x8e30('0x5f'))]({'oauth2':{'loginUrl':_0x651c31,'clientId':_0x2ea432[_0x8e30('0x57')],'clientSecret':_0x2ea432[_0x8e30('0x58')]}});return _0x1fccd6['login'](_0x2ea432[_0x8e30('0x59')],_0x2ea432[_0x8e30('0x5a')][_0x8e30('0x60')](_0x2ea432['securityToken']));}})[_0x8e30('0x24')](function(_0x53763e){if(_0x53763e){if(!_[_0x8e30('0x61')](_0x285ba2['query']['ticketType'])){_0x27b229=_0x285ba2['query']['ticketType'];}return _0x1fccd6[_0x8e30('0x62')](_0x27b229)['describe']();}})[_0x8e30('0x24')](function(_0x19f03f){var _0x552235=['OwnerId',_0x8e30('0x63'),_0x8e30('0x64'),_0x8e30('0x65'),'Subject','Description'];var _0xb99c05=['string',_0x8e30('0x66'),_0x8e30('0x67'),_0x8e30('0x68'),_0x8e30('0x69'),_0x8e30('0x6a'),'phone'];if(_0x19f03f){_[_0x8e30('0x6b')](_0x19f03f[_0x8e30('0x32')],function(_0x1c6937){return _0x552235[_0x8e30('0x6c')](_0x1c6937[_0x8e30('0x27')])||!_0xb99c05[_0x8e30('0x6c')](_0x1c6937['type']);});return{'count':_0x19f03f[_0x8e30('0x32')][_0x8e30('0x44')],'rows':_[_0x8e30('0x3c')](_0x19f03f[_0x8e30('0x32')],function(_0x115a27){return{'id':_0x115a27[_0x8e30('0x27')],'name':_0x115a27[_0x8e30('0x6d')],'custom':_0x115a27[_0x8e30('0x6e')],'options':_0x115a27['picklistValues'][_0x8e30('0x44')]>0x0?_[_0x8e30('0x3c')](_0x115a27['picklistValues'],function(_0x39c2a0){return{'name':_0x39c2a0[_0x8e30('0x6d')],'value':_0x39c2a0[_0x8e30('0x6f')]};}):_0x115a27[_0x8e30('0x2b')]==_0x8e30('0x68')?[{'name':_0x8e30('0x70'),'value':'true'},{'name':_0x8e30('0x71'),'value':_0x8e30('0x72')}]:[]};})};}})['then'](respondWithResult(_0x2df212,null))[_0x8e30('0x42')](function(_0x5294b6){var _0x33ad33=_0x285ba2['query'][_0x8e30('0x73')]?0x1f4:_0x5294b6[_0x8e30('0x74')]||0x1f4;logger[_0x8e30('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x8e30('0x55'),_0x33ad33,JSON[_0x8e30('0x75')](_0x5294b6));delete _0x5294b6[_0x8e30('0x27')];if(_0x33ad33===0x191){_0x33ad33=0x190;}_0x2df212['status'](_0x33ad33)[_0x8e30('0x28')](_0x285ba2[_0x8e30('0x2e')][_0x8e30('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x5294b6[_0x8e30('0x74')]}:_0x5294b6);});}; \ No newline at end of file +var _0x3b94=['lodash','squel','crypto','jsforce','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','../../components/integrations/configuration','end','status','undefined','count','offset','limit','set','apply','save','update','destroy','then','sendStatus','name','send','index','map','SalesforceAccount','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','show','params','rawAttributes','length','includeAll','find','catch','create','body','getConfigurations','findOne','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientId','username','password','slice','substring','lastIndexOf','clientSecret','securityToken','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','Subject','Description','string','int','picklist','textarea','phone','includes','label','picklistValues','value','True','true','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x2a703a,_0x4bbe04){var _0x5921ee=function(_0x199b0c){while(--_0x199b0c){_0x2a703a['push'](_0x2a703a['shift']());}};_0x5921ee(++_0x4bbe04);}(_0x3b94,0x1d3));var _0x43b9=function(_0x49bb01,_0x5402ee){_0x49bb01=_0x49bb01-0x0;var _0x2df424=_0x3b94[_0x49bb01];return _0x2df424;};'use strict';var emlformat=require(_0x43b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43b9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x43b9('0x2'));var BPromise=require(_0x43b9('0x3'));var Mustache=require(_0x43b9('0x4'));var util=require('util');var path=require(_0x43b9('0x5'));var sox=require(_0x43b9('0x6'));var csv=require(_0x43b9('0x7'));var ejs=require(_0x43b9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x43b9('0x9'));var squel=require(_0x43b9('0xa'));var crypto=require(_0x43b9('0xb'));var jsforce=require(_0x43b9('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x43b9('0xd'));var Papa=require('papaparse');var Redis=require(_0x43b9('0xe'));var authService=require(_0x43b9('0xf'));var qs=require(_0x43b9('0x10'));var as=require(_0x43b9('0x11'));var hardwareService=require(_0x43b9('0x12'));var logger=require(_0x43b9('0x13'))(_0x43b9('0x14'));var utils=require(_0x43b9('0x15'));var config=require(_0x43b9('0x16'));var licenseUtil=require(_0x43b9('0x17'));var db=require(_0x43b9('0x18'))['db'];var integrations=require(_0x43b9('0x19'));function respondWithStatusCode(_0x56b62a,_0x187c72){_0x187c72=_0x187c72||0xcc;return function(_0x2f0d01){if(_0x2f0d01){return _0x56b62a['sendStatus'](_0x187c72);}return _0x56b62a['status'](_0x187c72)[_0x43b9('0x1a')]();};}function respondWithResult(_0x5adf1f,_0x9b52aa){_0x9b52aa=_0x9b52aa||0xc8;return function(_0x12c9ca){if(_0x12c9ca){return _0x5adf1f[_0x43b9('0x1b')](_0x9b52aa)['json'](_0x12c9ca);}};}function respondWithFilteredResult(_0x5b4f8b,_0x4dad46){return function(_0x432bd0){if(_0x432bd0){var _0x8521ff=typeof _0x4dad46['offset']===_0x43b9('0x1c')&&typeof _0x4dad46['limit']==='undefined';var _0x38c27f=_0x432bd0[_0x43b9('0x1d')];var _0x5d5c43=_0x8521ff?0x0:_0x4dad46['offset'];var _0x5bdf05=_0x8521ff?_0x432bd0['count']:_0x4dad46[_0x43b9('0x1e')]+_0x4dad46[_0x43b9('0x1f')];var _0x25681d;if(_0x5bdf05>=_0x38c27f){_0x5bdf05=_0x38c27f;_0x25681d=0xc8;}else{_0x25681d=0xce;}_0x5b4f8b[_0x43b9('0x1b')](_0x25681d);return _0x5b4f8b[_0x43b9('0x20')]('Content-Range',_0x5d5c43+'-'+_0x5bdf05+'/'+_0x38c27f)['json'](_0x432bd0);}return null;};}function patchUpdates(_0x49eddb){return function(_0x469ac5){try{jsonpatch[_0x43b9('0x21')](_0x469ac5,_0x49eddb,!![]);}catch(_0x237996){return BPromise['reject'](_0x237996);}return _0x469ac5[_0x43b9('0x22')]();};}function saveUpdates(_0x5bf320,_0x16e369){return function(_0x144f44){if(_0x144f44){return _0x144f44[_0x43b9('0x23')](_0x5bf320)['then'](function(_0x85fcd1){return _0x85fcd1;});}return null;};}function removeEntity(_0x507fac,_0x5e1bcc){return function(_0x219a9d){if(_0x219a9d){return _0x219a9d[_0x43b9('0x24')]()[_0x43b9('0x25')](function(){_0x507fac['status'](0xcc)[_0x43b9('0x1a')]();});}};}function handleEntityNotFound(_0x5eb44d,_0x2bc245){return function(_0x4110ef){if(!_0x4110ef){_0x5eb44d[_0x43b9('0x26')](0x194);}return _0x4110ef;};}function handleError(_0x14105b,_0x1fec3c){_0x1fec3c=_0x1fec3c||0x1f4;return function(_0x47d69c){logger['error'](_0x47d69c['stack']);if(_0x47d69c[_0x43b9('0x27')]){delete _0x47d69c[_0x43b9('0x27')];}_0x14105b[_0x43b9('0x1b')](_0x1fec3c)[_0x43b9('0x28')](_0x47d69c);};}exports[_0x43b9('0x29')]=function(_0x570a46,_0x53907e){var _0x2c004c={},_0x35410d={},_0x29f58e={'count':0x0,'rows':[]};var _0xbca20=_[_0x43b9('0x2a')](db[_0x43b9('0x2b')]['rawAttributes'],function(_0x25099b){return{'name':_0x25099b[_0x43b9('0x2c')],'type':_0x25099b[_0x43b9('0x2d')]['key']};});_0x35410d[_0x43b9('0x2e')]=_[_0x43b9('0x2a')](_0xbca20,_0x43b9('0x27'));_0x35410d[_0x43b9('0x2f')]=_[_0x43b9('0x30')](_0x570a46['query']);_0x35410d['filters']=_[_0x43b9('0x31')](_0x35410d['model'],_0x35410d[_0x43b9('0x2f')]);_0x2c004c[_0x43b9('0x32')]=_[_0x43b9('0x31')](_0x35410d[_0x43b9('0x2e')],qs[_0x43b9('0x33')](_0x570a46[_0x43b9('0x2f')]['fields']));_0x2c004c[_0x43b9('0x32')]=_0x2c004c[_0x43b9('0x32')]['length']?_0x2c004c[_0x43b9('0x32')]:_0x35410d['model'];if(!_0x570a46[_0x43b9('0x2f')][_0x43b9('0x34')]('nolimit')){_0x2c004c[_0x43b9('0x1f')]=qs[_0x43b9('0x1f')](_0x570a46[_0x43b9('0x2f')][_0x43b9('0x1f')]);_0x2c004c[_0x43b9('0x1e')]=qs[_0x43b9('0x1e')](_0x570a46[_0x43b9('0x2f')][_0x43b9('0x1e')]);}_0x2c004c[_0x43b9('0x35')]=qs[_0x43b9('0x36')](_0x570a46[_0x43b9('0x2f')]['sort']);_0x2c004c[_0x43b9('0x37')]=qs[_0x43b9('0x38')](_[_0x43b9('0x39')](_0x570a46[_0x43b9('0x2f')],_0x35410d[_0x43b9('0x38')]),_0xbca20);if(_0x570a46[_0x43b9('0x2f')][_0x43b9('0x3a')]){_0x2c004c[_0x43b9('0x37')]=_['merge'](_0x2c004c[_0x43b9('0x37')],{'$or':_[_0x43b9('0x2a')](_0xbca20,function(_0x1c16f6){if(_0x1c16f6[_0x43b9('0x2d')]!==_0x43b9('0x3b')){var _0x55ae82={};_0x55ae82[_0x1c16f6['name']]={'$like':'%'+_0x570a46[_0x43b9('0x2f')][_0x43b9('0x3a')]+'%'};return _0x55ae82;}})});}_0x2c004c=_[_0x43b9('0x3c')]({},_0x2c004c,_0x570a46[_0x43b9('0x3d')]);var _0x55d461={'where':_0x2c004c['where']};return db['SalesforceAccount'][_0x43b9('0x1d')](_0x55d461)[_0x43b9('0x25')](function(_0x106506){_0x29f58e['count']=_0x106506;if(_0x570a46[_0x43b9('0x2f')]['includeAll']){_0x2c004c[_0x43b9('0x3e')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x43b9('0x3f')](_0x2c004c);})[_0x43b9('0x25')](function(_0x204c50){_0x29f58e['rows']=_0x204c50;return _0x29f58e;})[_0x43b9('0x25')](respondWithFilteredResult(_0x53907e,_0x2c004c))['catch'](handleError(_0x53907e,null));};exports[_0x43b9('0x40')]=function(_0x440ce7,_0x1d0e75){var _0x2448c1={'raw':![],'where':{'id':_0x440ce7[_0x43b9('0x41')]['id']}},_0x5b5981={};_0x5b5981['model']=_[_0x43b9('0x30')](db['SalesforceAccount'][_0x43b9('0x42')]);_0x5b5981[_0x43b9('0x2f')]=_[_0x43b9('0x30')](_0x440ce7['query']);_0x5b5981['filters']=_['intersection'](_0x5b5981['model'],_0x5b5981[_0x43b9('0x2f')]);_0x2448c1[_0x43b9('0x32')]=_[_0x43b9('0x31')](_0x5b5981[_0x43b9('0x2e')],qs[_0x43b9('0x33')](_0x440ce7[_0x43b9('0x2f')][_0x43b9('0x33')]));_0x2448c1[_0x43b9('0x32')]=_0x2448c1[_0x43b9('0x32')][_0x43b9('0x43')]?_0x2448c1[_0x43b9('0x32')]:_0x5b5981[_0x43b9('0x2e')];if(_0x440ce7[_0x43b9('0x2f')][_0x43b9('0x44')]){_0x2448c1[_0x43b9('0x3e')]=[{'all':!![]}];}_0x2448c1=_['merge']({},_0x2448c1,_0x440ce7[_0x43b9('0x3d')]);return db[_0x43b9('0x2b')][_0x43b9('0x45')](_0x2448c1)['then'](handleEntityNotFound(_0x1d0e75,null))[_0x43b9('0x25')](respondWithResult(_0x1d0e75,null))[_0x43b9('0x46')](handleError(_0x1d0e75,null));};exports[_0x43b9('0x47')]=function(_0x266753,_0x323dd8){return db[_0x43b9('0x2b')][_0x43b9('0x47')](_0x266753[_0x43b9('0x48')],{})['then'](respondWithResult(_0x323dd8,0xc9))['catch'](handleError(_0x323dd8,null));};exports['update']=function(_0x31902b,_0x31e8d6){if(_0x31902b[_0x43b9('0x48')]['id']){delete _0x31902b[_0x43b9('0x48')]['id'];}return db[_0x43b9('0x2b')][_0x43b9('0x45')]({'where':{'id':_0x31902b['params']['id']}})[_0x43b9('0x25')](handleEntityNotFound(_0x31e8d6,null))[_0x43b9('0x25')](saveUpdates(_0x31902b['body'],null))[_0x43b9('0x25')](respondWithResult(_0x31e8d6,null))[_0x43b9('0x46')](handleError(_0x31e8d6,null));};exports[_0x43b9('0x24')]=function(_0x58789b,_0x5df306){return db[_0x43b9('0x2b')][_0x43b9('0x45')]({'where':{'id':_0x58789b['params']['id']}})[_0x43b9('0x25')](handleEntityNotFound(_0x5df306,null))[_0x43b9('0x25')](removeEntity(_0x5df306,null))[_0x43b9('0x46')](handleError(_0x5df306,null));};exports[_0x43b9('0x49')]=function(_0x58a9a8,_0x3b69b4,_0x3934a8){var _0x32f73a={};var _0x270bbc={};var _0x58be5f;var _0xf76796;return db[_0x43b9('0x2b')][_0x43b9('0x4a')]({'where':{'id':_0x58a9a8[_0x43b9('0x41')]['id']}})[_0x43b9('0x25')](handleEntityNotFound(_0x3b69b4,null))['then'](function(_0x4c0695){if(_0x4c0695){_0x58be5f=_0x4c0695;_0x270bbc['model']=_[_0x43b9('0x30')](db['SalesforceConfiguration']['rawAttributes']);_0x270bbc['query']=_[_0x43b9('0x30')](_0x58a9a8[_0x43b9('0x2f')]);_0x270bbc[_0x43b9('0x38')]=_['intersection'](_0x270bbc['model'],_0x270bbc[_0x43b9('0x2f')]);_0x32f73a[_0x43b9('0x32')]=_['intersection'](_0x270bbc[_0x43b9('0x2e')],qs[_0x43b9('0x33')](_0x58a9a8['query']['fields']));_0x32f73a[_0x43b9('0x32')]=_0x32f73a[_0x43b9('0x32')][_0x43b9('0x43')]?_0x32f73a[_0x43b9('0x32')]:_0x270bbc['model'];_0x32f73a[_0x43b9('0x35')]=qs[_0x43b9('0x36')](_0x58a9a8[_0x43b9('0x2f')]['sort']);_0x32f73a['where']=qs['filters'](_[_0x43b9('0x39')](_0x58a9a8['query'],_0x270bbc[_0x43b9('0x38')]));if(_0x58a9a8[_0x43b9('0x2f')][_0x43b9('0x3a')]){_0x32f73a[_0x43b9('0x37')]=_['merge'](_0x32f73a[_0x43b9('0x37')],{'$or':_[_0x43b9('0x2a')](_0x32f73a['attributes'],function(_0x5e6ec7){var _0x1e24f4={};_0x1e24f4[_0x5e6ec7]={'$like':'%'+_0x58a9a8['query']['filter']+'%'};return _0x1e24f4;})});}_0x32f73a=_[_0x43b9('0x3c')]({},_0x32f73a,_0x58a9a8['options']);return _0x58be5f['getConfigurations'](_0x32f73a);}})[_0x43b9('0x25')](function(_0x1eadd1){if(_0x1eadd1){_0xf76796=_0x1eadd1[_0x43b9('0x43')];if(!_0x58a9a8[_0x43b9('0x2f')][_0x43b9('0x34')](_0x43b9('0x4b'))){_0x32f73a['limit']=qs[_0x43b9('0x1f')](_0x58a9a8['query'][_0x43b9('0x1f')]);_0x32f73a[_0x43b9('0x1e')]=qs[_0x43b9('0x1e')](_0x58a9a8[_0x43b9('0x2f')][_0x43b9('0x1e')]);}return _0x58be5f[_0x43b9('0x49')](_0x32f73a);}})[_0x43b9('0x25')](function(_0x6c4f65){if(_0x6c4f65){return _0x6c4f65?{'count':_0xf76796,'rows':_0x6c4f65}:null;}})[_0x43b9('0x25')](respondWithResult(_0x3b69b4,null))[_0x43b9('0x46')](handleError(_0x3b69b4,null));};exports[_0x43b9('0x4c')]=function(_0x38e8c8,_0x4cb1e6,_0x2661f3){if(_0x38e8c8[_0x43b9('0x48')]['id']){delete _0x38e8c8[_0x43b9('0x48')]['id'];}return db[_0x43b9('0x2b')][_0x43b9('0x4a')]({'where':{'id':_0x38e8c8['params']['id']}})['then'](handleEntityNotFound(_0x4cb1e6,null))[_0x43b9('0x25')](function(_0x4fca56){if(_0x4fca56){_0x38e8c8[_0x43b9('0x48')][_0x43b9('0x4d')]=_0x4fca56['id'];_0x38e8c8['body'][_0x43b9('0x4e')]=integrations[_0x43b9('0x4f')](_0x38e8c8['body'][_0x43b9('0x50')],_0x38e8c8[_0x43b9('0x48')][_0x43b9('0x2d')]);_0x38e8c8[_0x43b9('0x48')]['Descriptions']=integrations[_0x43b9('0x51')](_0x38e8c8[_0x43b9('0x48')][_0x43b9('0x50')],_0x38e8c8[_0x43b9('0x48')][_0x43b9('0x2d')]);return db[_0x43b9('0x52')][_0x43b9('0x47')](_0x38e8c8['body'],{'include':[{'model':db[_0x43b9('0x53')],'as':'Subjects'},{'model':db[_0x43b9('0x53')],'as':'Descriptions'}]});}return null;})[_0x43b9('0x25')](respondWithResult(_0x4cb1e6,null))[_0x43b9('0x46')](handleError(_0x4cb1e6,null));};exports[_0x43b9('0x54')]=function(_0x22fa7a,_0x4924e5,_0x628e76){var _0x5c1e8c;var _0x5addbe='';var _0x4b248b=_0x43b9('0x55');return db['SalesforceAccount'][_0x43b9('0x4a')]({'where':{'id':_0x22fa7a['params']['id']},'attributes':['id',_0x43b9('0x56'),_0x43b9('0x57'),'clientSecret',_0x43b9('0x58'),_0x43b9('0x59'),'securityToken']})[_0x43b9('0x25')](handleEntityNotFound(_0x4924e5,null))[_0x43b9('0x25')](function(_0x54b1e8){if(_0x54b1e8){_0x5addbe=_0x54b1e8[_0x43b9('0x56')];var _0x4329bc=_0x5addbe[_0x43b9('0x5a')](-0x1);if(_0x4329bc==='/'){_0x5addbe=_0x5addbe[_0x43b9('0x5b')](0x0,_0x5addbe[_0x43b9('0x5c')](_0x4329bc));}_0x5c1e8c=new jsforce['Connection']({'oauth2':{'loginUrl':_0x5addbe,'clientId':_0x54b1e8['clientId'],'clientSecret':_0x54b1e8[_0x43b9('0x5d')]}});return _0x5c1e8c['login'](_0x54b1e8[_0x43b9('0x58')],_0x54b1e8[_0x43b9('0x59')]['concat'](_0x54b1e8[_0x43b9('0x5e')]));}})[_0x43b9('0x25')](function(_0x369672){if(_0x369672){if(!_[_0x43b9('0x5f')](_0x22fa7a[_0x43b9('0x2f')][_0x43b9('0x60')])){_0x4b248b=_0x22fa7a[_0x43b9('0x2f')][_0x43b9('0x60')];}return _0x5c1e8c[_0x43b9('0x61')](_0x4b248b)[_0x43b9('0x62')]();}})['then'](function(_0x546953){var _0x36eb2a=['OwnerId',_0x43b9('0x63'),_0x43b9('0x64'),'IsRecurrence',_0x43b9('0x65'),_0x43b9('0x66')];var _0x64a854=[_0x43b9('0x67'),_0x43b9('0x68'),_0x43b9('0x69'),'boolean','email',_0x43b9('0x6a'),_0x43b9('0x6b')];if(_0x546953){_['remove'](_0x546953[_0x43b9('0x33')],function(_0x2cfaa6){return _0x36eb2a[_0x43b9('0x6c')](_0x2cfaa6[_0x43b9('0x27')])||!_0x64a854['includes'](_0x2cfaa6[_0x43b9('0x2d')]);});return{'count':_0x546953['fields'][_0x43b9('0x43')],'rows':_['map'](_0x546953[_0x43b9('0x33')],function(_0x3bed88){return{'id':_0x3bed88[_0x43b9('0x27')],'name':_0x3bed88[_0x43b9('0x6d')],'custom':_0x3bed88['custom'],'options':_0x3bed88['picklistValues'][_0x43b9('0x43')]>0x0?_[_0x43b9('0x2a')](_0x3bed88[_0x43b9('0x6e')],function(_0x544fa3){return{'name':_0x544fa3[_0x43b9('0x6d')],'value':_0x544fa3[_0x43b9('0x6f')]};}):_0x3bed88[_0x43b9('0x2d')]=='boolean'?[{'name':_0x43b9('0x70'),'value':_0x43b9('0x71')},{'name':'False','value':_0x43b9('0x72')}]:[]};})};}})[_0x43b9('0x25')](respondWithResult(_0x4924e5,null))['catch'](function(_0x4d3897){var _0x5771a2=_0x22fa7a[_0x43b9('0x2f')][_0x43b9('0x73')]?0x1f4:_0x4d3897[_0x43b9('0x74')]||0x1f4;logger[_0x43b9('0x75')](_0x43b9('0x76'),_0x43b9('0x54'),_0x5771a2,JSON['stringify'](_0x4d3897));delete _0x4d3897[_0x43b9('0x27')];if(_0x5771a2===0x191){_0x5771a2=0x190;}_0x4924e5[_0x43b9('0x1b')](_0x5771a2)[_0x43b9('0x28')](_0x22fa7a[_0x43b9('0x2f')][_0x43b9('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x4d3897[_0x43b9('0x74')]}:_0x4d3897);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 3e7b0dc..970ca06 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 _0xf874=['bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','../../config/logger','api','moment'];(function(_0x3f8ea0,_0x407fa9){var _0x3a949a=function(_0x84e509){while(--_0x84e509){_0x3f8ea0['push'](_0x3f8ea0['shift']());}};_0x3a949a(++_0x407fa9);}(_0xf874,0xed));var _0x4f87=function(_0x19c465,_0x20f2ee){_0x19c465=_0x19c465-0x0;var _0x5016d3=_0xf874[_0x19c465];return _0x5016d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4f87('0x0'))(_0x4f87('0x1'));var moment=require(_0x4f87('0x2'));var BPromise=require(_0x4f87('0x3'));var rp=require(_0x4f87('0x4'));var fs=require('fs');var path=require(_0x4f87('0x5'));var rimraf=require('rimraf');var config=require(_0x4f87('0x6'));var attributes=require(_0x4f87('0x7'));var integrations=require(_0x4f87('0x8'));module[_0x4f87('0x9')]=function(_0x104682,_0x44fea6){return _0x104682['define'](_0x4f87('0xa'),attributes,{'tableName':_0x4f87('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d04=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','int_salesforce_accounts','util'];(function(_0x4a24a6,_0x4f47cd){var _0x1cbf33=function(_0x3a7df1){while(--_0x3a7df1){_0x4a24a6['push'](_0x4a24a6['shift']());}};_0x1cbf33(++_0x4f47cd);}(_0x6d04,0x11f));var _0x46d0=function(_0x169f6a,_0x236d15){_0x169f6a=_0x169f6a-0x0;var _0x44baa8=_0x6d04[_0x169f6a];return _0x44baa8;};'use strict';var _=require('lodash');var util=require(_0x46d0('0x0'));var logger=require(_0x46d0('0x1'))(_0x46d0('0x2'));var moment=require(_0x46d0('0x3'));var BPromise=require('bluebird');var rp=require(_0x46d0('0x4'));var fs=require('fs');var path=require(_0x46d0('0x5'));var rimraf=require(_0x46d0('0x6'));var config=require(_0x46d0('0x7'));var attributes=require(_0x46d0('0x8'));var integrations=require(_0x46d0('0x9'));module['exports']=function(_0x1586cd,_0x3da47f){return _0x1586cd[_0x46d0('0xa')]('SalesforceAccount',attributes,{'tableName':_0x46d0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index fc1b1aa..a351573 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 _0x61cb=['options','raw','where','include','map','model','attributes','GetSalesforceAccount','stringify','catch','ShowSalesforceAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','SalesforceAccount','findAll'];(function(_0x123b23,_0x54a3b6){var _0x597564=function(_0x5d7312){while(--_0x5d7312){_0x123b23['push'](_0x123b23['shift']());}};_0x597564(++_0x54a3b6);}(_0x61cb,0xbf));var _0xb61c=function(_0x4f3c9b,_0x28e078){_0x4f3c9b=_0x4f3c9b-0x0;var _0x84e58a=_0x61cb[_0x4f3c9b];return _0x84e58a;};'use strict';var _=require(_0xb61c('0x0'));var util=require(_0xb61c('0x1'));var moment=require(_0xb61c('0x2'));var BPromise=require('bluebird');var rs=require(_0xb61c('0x3'));var fs=require('fs');var Redis=require(_0xb61c('0x4'));var db=require(_0xb61c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb61c('0x6'))(_0xb61c('0x7'));var config=require(_0xb61c('0x8'));var jayson=require(_0xb61c('0x9'));var client=jayson[_0xb61c('0xa')][_0xb61c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a606d,_0x2688b7,_0x4fab7e){return new BPromise(function(_0x546fc5,_0x5152c5){return client[_0xb61c('0xc')](_0x4a606d,_0x4fab7e)[_0xb61c('0xd')](function(_0x19b677){logger[_0xb61c('0xe')](_0xb61c('0xf'),_0x2688b7,_0xb61c('0x10'));logger[_0xb61c('0x11')](_0xb61c('0x12'),_0x2688b7,_0xb61c('0x10'),JSON['stringify'](_0x19b677));if(_0x19b677['error']){if(_0x19b677[_0xb61c('0x13')][_0xb61c('0x14')]===0x1f4){logger[_0xb61c('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x2688b7,_0x19b677[_0xb61c('0x13')][_0xb61c('0x15')]);return _0x5152c5(_0x19b677['error'][_0xb61c('0x15')]);}logger[_0xb61c('0x13')](_0xb61c('0xf'),_0x2688b7,_0x19b677[_0xb61c('0x13')][_0xb61c('0x15')]);return _0x546fc5(_0x19b677['error'][_0xb61c('0x15')]);}else{logger['info'](_0xb61c('0xf'),_0x2688b7,_0xb61c('0x10'));_0x546fc5(_0x19b677[_0xb61c('0x16')][_0xb61c('0x15')]);}})['catch'](function(_0x2a2717){logger[_0xb61c('0x13')](_0xb61c('0xf'),_0x2688b7,_0x2a2717);_0x5152c5(_0x2a2717);});});}exports['GetSalesforceAccount']=function(_0x5de998){var _0xc59a65=this;return new Promise(function(_0x3588f2,_0xc25cb0){return db[_0xb61c('0x17')][_0xb61c('0x18')]({'raw':_0x5de998[_0xb61c('0x19')]?_0x5de998[_0xb61c('0x19')][_0xb61c('0x1a')]===undefined?!![]:![]:!![],'where':_0x5de998[_0xb61c('0x19')]?_0x5de998[_0xb61c('0x19')][_0xb61c('0x1b')]||null:null,'attributes':_0x5de998[_0xb61c('0x19')]?_0x5de998[_0xb61c('0x19')]['attributes']||null:null,'limit':_0x5de998[_0xb61c('0x19')]?_0x5de998['options']['limit']||null:null,'include':_0x5de998[_0xb61c('0x19')]?_0x5de998[_0xb61c('0x19')][_0xb61c('0x1c')]?_[_0xb61c('0x1d')](_0x5de998[_0xb61c('0x19')][_0xb61c('0x1c')],function(_0x5834ee){return{'model':db[_0x5834ee[_0xb61c('0x1e')]],'as':_0x5834ee['as'],'attributes':_0x5834ee[_0xb61c('0x1f')],'include':_0x5834ee[_0xb61c('0x1c')]?_[_0xb61c('0x1d')](_0x5834ee[_0xb61c('0x1c')],function(_0x3e99f7){return{'model':db[_0x3e99f7[_0xb61c('0x1e')]],'as':_0x3e99f7['as'],'attributes':_0x3e99f7[_0xb61c('0x1f')],'include':_0x3e99f7[_0xb61c('0x1c')]?_['map'](_0x3e99f7['include'],function(_0x3ad441){return{'model':db[_0x3ad441[_0xb61c('0x1e')]],'as':_0x3ad441['as'],'attributes':_0x3ad441[_0xb61c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb61c('0xd')](function(_0xa62f0f){logger[_0xb61c('0xe')](_0xb61c('0x20'),_0x5de998);logger[_0xb61c('0x11')]('GetSalesforceAccount',_0x5de998,JSON[_0xb61c('0x21')](_0xa62f0f));_0x3588f2(_0xa62f0f);})[_0xb61c('0x22')](function(_0x3ffb8d){logger[_0xb61c('0x13')](_0xb61c('0x20'),_0x3ffb8d[_0xb61c('0x15')],_0x5de998);_0xc25cb0(_0xc59a65['error'](0x1f4,_0x3ffb8d[_0xb61c('0x15')]));});});};exports['ShowSalesforceAccount']=function(_0x36d9bc){var _0x46a63f=this;return new Promise(function(_0x56c51a,_0x10aeb4){return db[_0xb61c('0x17')]['find']({'raw':_0x36d9bc['options']?_0x36d9bc[_0xb61c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x36d9bc[_0xb61c('0x19')]?_0x36d9bc[_0xb61c('0x19')][_0xb61c('0x1b')]||null:null,'attributes':_0x36d9bc[_0xb61c('0x19')]?_0x36d9bc[_0xb61c('0x19')][_0xb61c('0x1f')]||null:null,'include':_0x36d9bc['options']?_0x36d9bc['options'][_0xb61c('0x1c')]?_[_0xb61c('0x1d')](_0x36d9bc[_0xb61c('0x19')][_0xb61c('0x1c')],function(_0x5dc69d){return{'model':db[_0x5dc69d[_0xb61c('0x1e')]],'as':_0x5dc69d['as'],'attributes':_0x5dc69d[_0xb61c('0x1f')],'include':_0x5dc69d[_0xb61c('0x1c')]?_[_0xb61c('0x1d')](_0x5dc69d['include'],function(_0xb9d96a){return{'model':db[_0xb9d96a[_0xb61c('0x1e')]],'as':_0xb9d96a['as'],'attributes':_0xb9d96a['attributes'],'include':_0xb9d96a[_0xb61c('0x1c')]?_['map'](_0xb9d96a[_0xb61c('0x1c')],function(_0x260a5b){return{'model':db[_0x260a5b[_0xb61c('0x1e')]],'as':_0x260a5b['as'],'attributes':_0x260a5b[_0xb61c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb61c('0xd')](function(_0x2d74dc){logger[_0xb61c('0xe')](_0xb61c('0x23'),_0x36d9bc);logger[_0xb61c('0x11')]('ShowSalesforceAccount',_0x36d9bc,JSON[_0xb61c('0x21')](_0x2d74dc));_0x56c51a(_0x2d74dc);})['catch'](function(_0xf255ac){logger[_0xb61c('0x13')](_0xb61c('0x23'),_0xf255ac[_0xb61c('0x15')],_0x36d9bc);_0x10aeb4(_0x46a63f[_0xb61c('0x13')](0x1f4,_0xf255ac[_0xb61c('0x15')]));});});}; \ No newline at end of file +var _0x2c5e=['jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','limit','include','map','model','attributes','stringify','find','info','ShowSalesforceAccount','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x2c5e,0x165));var _0xe2c5=function(_0x199f1b,_0x27fa7d){_0x199f1b=_0x199f1b-0x0;var _0x3924c0=_0x2c5e[_0x199f1b];return _0x3924c0;};'use strict';var _=require('lodash');var util=require(_0xe2c5('0x0'));var moment=require(_0xe2c5('0x1'));var BPromise=require(_0xe2c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe2c5('0x3'));var db=require(_0xe2c5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe2c5('0x5'));var jayson=require(_0xe2c5('0x6'));var client=jayson[_0xe2c5('0x7')][_0xe2c5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x370889,_0x10cae8,_0x2313bf){return new BPromise(function(_0x5e0244,_0x52fbf2){return client[_0xe2c5('0x9')](_0x370889,_0x2313bf)[_0xe2c5('0xa')](function(_0xab13ed){logger['info'](_0xe2c5('0xb'),_0x10cae8,'request\x20sent');logger[_0xe2c5('0xc')](_0xe2c5('0xd'),_0x10cae8,'request\x20sent',JSON['stringify'](_0xab13ed));if(_0xab13ed[_0xe2c5('0xe')]){if(_0xab13ed[_0xe2c5('0xe')][_0xe2c5('0xf')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x10cae8,_0xab13ed['error'][_0xe2c5('0x10')]);return _0x52fbf2(_0xab13ed['error'][_0xe2c5('0x10')]);}logger['error'](_0xe2c5('0xb'),_0x10cae8,_0xab13ed[_0xe2c5('0xe')]['message']);return _0x5e0244(_0xab13ed[_0xe2c5('0xe')][_0xe2c5('0x10')]);}else{logger['info'](_0xe2c5('0xb'),_0x10cae8,'request\x20sent');_0x5e0244(_0xab13ed[_0xe2c5('0x11')][_0xe2c5('0x10')]);}})[_0xe2c5('0x12')](function(_0xcf70d9){logger['error'](_0xe2c5('0xb'),_0x10cae8,_0xcf70d9);_0x52fbf2(_0xcf70d9);});});}exports[_0xe2c5('0x13')]=function(_0x412f81){var _0x4799bf=this;return new Promise(function(_0x1678ad,_0x35ce39){return db[_0xe2c5('0x14')]['findAll']({'raw':_0x412f81[_0xe2c5('0x15')]?_0x412f81[_0xe2c5('0x15')][_0xe2c5('0x16')]===undefined?!![]:![]:!![],'where':_0x412f81[_0xe2c5('0x15')]?_0x412f81[_0xe2c5('0x15')][_0xe2c5('0x17')]||null:null,'attributes':_0x412f81[_0xe2c5('0x15')]?_0x412f81[_0xe2c5('0x15')]['attributes']||null:null,'limit':_0x412f81[_0xe2c5('0x15')]?_0x412f81[_0xe2c5('0x15')][_0xe2c5('0x18')]||null:null,'include':_0x412f81['options']?_0x412f81[_0xe2c5('0x15')][_0xe2c5('0x19')]?_[_0xe2c5('0x1a')](_0x412f81[_0xe2c5('0x15')][_0xe2c5('0x19')],function(_0x5ee850){return{'model':db[_0x5ee850[_0xe2c5('0x1b')]],'as':_0x5ee850['as'],'attributes':_0x5ee850[_0xe2c5('0x1c')],'include':_0x5ee850[_0xe2c5('0x19')]?_[_0xe2c5('0x1a')](_0x5ee850[_0xe2c5('0x19')],function(_0x4a61da){return{'model':db[_0x4a61da[_0xe2c5('0x1b')]],'as':_0x4a61da['as'],'attributes':_0x4a61da[_0xe2c5('0x1c')],'include':_0x4a61da['include']?_[_0xe2c5('0x1a')](_0x4a61da[_0xe2c5('0x19')],function(_0x2bb3b0){return{'model':db[_0x2bb3b0[_0xe2c5('0x1b')]],'as':_0x2bb3b0['as'],'attributes':_0x2bb3b0[_0xe2c5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe2c5('0xa')](function(_0x31c30b){logger['info']('GetSalesforceAccount',_0x412f81);logger[_0xe2c5('0xc')]('GetSalesforceAccount',_0x412f81,JSON[_0xe2c5('0x1d')](_0x31c30b));_0x1678ad(_0x31c30b);})[_0xe2c5('0x12')](function(_0x29db3a){logger['error'](_0xe2c5('0x13'),_0x29db3a[_0xe2c5('0x10')],_0x412f81);_0x35ce39(_0x4799bf[_0xe2c5('0xe')](0x1f4,_0x29db3a[_0xe2c5('0x10')]));});});};exports['ShowSalesforceAccount']=function(_0x23e6c8){var _0x4d7bf8=this;return new Promise(function(_0x9e700c,_0x4ae816){return db['SalesforceAccount'][_0xe2c5('0x1e')]({'raw':_0x23e6c8[_0xe2c5('0x15')]?_0x23e6c8[_0xe2c5('0x15')][_0xe2c5('0x16')]===undefined?!![]:![]:!![],'where':_0x23e6c8['options']?_0x23e6c8[_0xe2c5('0x15')][_0xe2c5('0x17')]||null:null,'attributes':_0x23e6c8[_0xe2c5('0x15')]?_0x23e6c8['options']['attributes']||null:null,'include':_0x23e6c8[_0xe2c5('0x15')]?_0x23e6c8[_0xe2c5('0x15')][_0xe2c5('0x19')]?_['map'](_0x23e6c8['options'][_0xe2c5('0x19')],function(_0x470ca4){return{'model':db[_0x470ca4['model']],'as':_0x470ca4['as'],'attributes':_0x470ca4['attributes'],'include':_0x470ca4[_0xe2c5('0x19')]?_['map'](_0x470ca4[_0xe2c5('0x19')],function(_0x2588bf){return{'model':db[_0x2588bf[_0xe2c5('0x1b')]],'as':_0x2588bf['as'],'attributes':_0x2588bf[_0xe2c5('0x1c')],'include':_0x2588bf[_0xe2c5('0x19')]?_[_0xe2c5('0x1a')](_0x2588bf[_0xe2c5('0x19')],function(_0x507125){return{'model':db[_0x507125['model']],'as':_0x507125['as'],'attributes':_0x507125[_0xe2c5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe2c5('0xa')](function(_0x2239ac){logger[_0xe2c5('0x1f')]('ShowSalesforceAccount',_0x23e6c8);logger[_0xe2c5('0xc')](_0xe2c5('0x20'),_0x23e6c8,JSON[_0xe2c5('0x1d')](_0x2239ac));_0x9e700c(_0x2239ac);})[_0xe2c5('0x12')](function(_0x4e2dfc){logger[_0xe2c5('0xe')](_0xe2c5('0x20'),_0x4e2dfc['message'],_0x23e6c8);_0x4ae816(_0x4d7bf8['error'](0x1f4,_0x4e2dfc[_0xe2c5('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index f1d6b25..e2abd6a 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0xe2b4a4,_0x505939){var _0xe4b452=function(_0x44fafc){while(--_0x44fafc){_0xe2b4a4['push'](_0xe2b4a4['shift']());}};_0xe4b452(++_0x505939);}(_0x2ef3,0xba));var _0x32ef=function(_0x2111e7,_0x219a38){_0x2111e7=_0x2111e7-0x0;var _0x31c3b2=_0x2ef3[_0x2111e7];return _0x31c3b2;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file +var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4d7c1d,_0x26f3f6){var _0x128ff2=function(_0x2a5385){while(--_0x2a5385){_0x4d7c1d['push'](_0x4d7c1d['shift']());}};_0x128ff2(++_0x26f3f6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x237387,_0x56f032){_0x237387=_0x237387-0x0;var _0x4a0545=_0x5f2f[_0x237387];return _0x4a0545;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 9956ce0..163250d 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 _0xc23d=['ENUM','Task','contact_lead','contact','lead','nothing','account','sequelize','exports','STRING'];(function(_0x34d968,_0x1515b9){var _0x49044f=function(_0x502632){while(--_0x502632){_0x34d968['push'](_0x34d968['shift']());}};_0x49044f(++_0x1515b9);}(_0xc23d,0x7f));var _0xdc23=function(_0x3be2e2,_0x5c166d){_0x3be2e2=_0x3be2e2-0x0;var _0x53b9c5=_0xc23d[_0x3be2e2];return _0x53b9c5;};'use strict';var Sequelize=require(_0xdc23('0x0'));module[_0xdc23('0x1')]={'name':{'type':Sequelize[_0xdc23('0x2')]},'description':{'type':Sequelize[_0xdc23('0x2')]},'ticketType':{'type':Sequelize[_0xdc23('0x3')](_0xdc23('0x4'),'Case'),'defaultValue':_0xdc23('0x4')},'moduleSearch':{'type':Sequelize[_0xdc23('0x3')](_0xdc23('0x5'),_0xdc23('0x6'),_0xdc23('0x7'),'account_contact_lead','account'),'defaultValue':_0xdc23('0x5')},'moduleCreate':{'type':Sequelize['ENUM'](_0xdc23('0x8'),'contact',_0xdc23('0x7'),_0xdc23('0x9')),'defaultValue':_0xdc23('0x7')},'leadId':{'type':Sequelize[_0xdc23('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xdc23('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xdc23('0x2')]}}; \ No newline at end of file +var _0xd96c=['contact_lead','contact','lead','account_contact_lead','account','sequelize','STRING','ENUM','Task','Case'];(function(_0x5ee92f,_0x1c9fa5){var _0x229599=function(_0x55d954){while(--_0x55d954){_0x5ee92f['push'](_0x5ee92f['shift']());}};_0x229599(++_0x1c9fa5);}(_0xd96c,0xaf));var _0xcd96=function(_0x5922f7,_0x23885e){_0x5922f7=_0x5922f7-0x0;var _0x145529=_0xd96c[_0x5922f7];return _0x145529;};'use strict';var Sequelize=require(_0xcd96('0x0'));module['exports']={'name':{'type':Sequelize[_0xcd96('0x1')]},'description':{'type':Sequelize[_0xcd96('0x1')]},'ticketType':{'type':Sequelize[_0xcd96('0x2')](_0xcd96('0x3'),_0xcd96('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xcd96('0x2')](_0xcd96('0x5'),_0xcd96('0x6'),_0xcd96('0x7'),_0xcd96('0x8'),_0xcd96('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xcd96('0x2')]('nothing','contact','lead',_0xcd96('0x9')),'defaultValue':_0xcd96('0x7')},'leadId':{'type':Sequelize[_0xcd96('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xcd96('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xcd96('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xcd96('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 6d1fc75..ff7a0ec 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 _0x444a=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','SalesforceConfiguration','includeAll','findAll','rows','catch','show','include','create','body','find','findOne','params','SalesforceField','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x2212d4,_0x58d903){var _0x14b8bc=function(_0x2561ab){while(--_0x2561ab){_0x2212d4['push'](_0x2212d4['shift']());}};_0x14b8bc(++_0x58d903);}(_0x444a,0x170));var _0xa444=function(_0x403c8d,_0x5e3825){_0x403c8d=_0x403c8d-0x0;var _0x4ca60d=_0x444a[_0x403c8d];return _0x4ca60d;};'use strict';var emlformat=require(_0xa444('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa444('0x1'));var jsonpatch=require(_0xa444('0x2'));var rp=require(_0xa444('0x3'));var moment=require(_0xa444('0x4'));var BPromise=require(_0xa444('0x5'));var Mustache=require(_0xa444('0x6'));var util=require('util');var path=require(_0xa444('0x7'));var sox=require('sox');var csv=require(_0xa444('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa444('0x9'));var _=require(_0xa444('0xa'));var squel=require(_0xa444('0xb'));var crypto=require(_0xa444('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa444('0xd'));var toCsv=require(_0xa444('0x8'));var querystring=require('querystring');var Papa=require(_0xa444('0xe'));var Redis=require(_0xa444('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa444('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa444('0x11'))(_0xa444('0x12'));var utils=require(_0xa444('0x13'));var config=require(_0xa444('0x14'));var licenseUtil=require(_0xa444('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d2220,_0x19c1be){_0x19c1be=_0x19c1be||0xcc;return function(_0x4805af){if(_0x4805af){return _0x4d2220['sendStatus'](_0x19c1be);}return _0x4d2220['status'](_0x19c1be)[_0xa444('0x16')]();};}function respondWithResult(_0x4b7b27,_0x3cd3da){_0x3cd3da=_0x3cd3da||0xc8;return function(_0x3520a7){if(_0x3520a7){return _0x4b7b27[_0xa444('0x17')](_0x3cd3da)[_0xa444('0x18')](_0x3520a7);}};}function respondWithFilteredResult(_0x3f4760,_0x2c81bd){return function(_0x3aa724){if(_0x3aa724){var _0x3f73f9=typeof _0x2c81bd[_0xa444('0x19')]===_0xa444('0x1a')&&typeof _0x2c81bd[_0xa444('0x1b')]===_0xa444('0x1a');var _0x3eef32=_0x3aa724[_0xa444('0x1c')];var _0x512d42=_0x3f73f9?0x0:_0x2c81bd[_0xa444('0x19')];var _0x341341=_0x3f73f9?_0x3aa724[_0xa444('0x1c')]:_0x2c81bd[_0xa444('0x19')]+_0x2c81bd[_0xa444('0x1b')];var _0x4eb64f;if(_0x341341>=_0x3eef32){_0x341341=_0x3eef32;_0x4eb64f=0xc8;}else{_0x4eb64f=0xce;}_0x3f4760[_0xa444('0x17')](_0x4eb64f);return _0x3f4760[_0xa444('0x1d')](_0xa444('0x1e'),_0x512d42+'-'+_0x341341+'/'+_0x3eef32)['json'](_0x3aa724);}return null;};}function patchUpdates(_0x3b0fc1){return function(_0x1c321f){try{jsonpatch[_0xa444('0x1f')](_0x1c321f,_0x3b0fc1,!![]);}catch(_0x38878a){return BPromise['reject'](_0x38878a);}return _0x1c321f[_0xa444('0x20')]();};}function saveUpdates(_0x5cf0b5,_0x5ac090){return function(_0x3b79e0){if(_0x3b79e0){return _0x3b79e0[_0xa444('0x21')](_0x5cf0b5)[_0xa444('0x22')](function(_0x479d5b){return _0x479d5b;});}return null;};}function removeEntity(_0x3ef5ce,_0x2a2570){return function(_0x46a15c){if(_0x46a15c){return _0x46a15c[_0xa444('0x23')]()[_0xa444('0x22')](function(){_0x3ef5ce['status'](0xcc)[_0xa444('0x16')]();});}};}function handleEntityNotFound(_0x131fad,_0x527c96){return function(_0x278c33){if(!_0x278c33){_0x131fad[_0xa444('0x24')](0x194);}return _0x278c33;};}function handleError(_0x5c618b,_0x5c81f0){_0x5c81f0=_0x5c81f0||0x1f4;return function(_0x2ccf7a){logger['error'](_0x2ccf7a['stack']);if(_0x2ccf7a[_0xa444('0x25')]){delete _0x2ccf7a[_0xa444('0x25')];}_0x5c618b[_0xa444('0x17')](_0x5c81f0)[_0xa444('0x26')](_0x2ccf7a);};}exports['index']=function(_0x2bdc0f,_0x2a24a1){var _0x361476={},_0x5bbf30={},_0x468cfa={'count':0x0,'rows':[]};var _0xba7d9e=_[_0xa444('0x27')](db['SalesforceConfiguration'][_0xa444('0x28')],function(_0x4f02b6){return{'name':_0x4f02b6[_0xa444('0x29')],'type':_0x4f02b6[_0xa444('0x2a')]['key']};});_0x5bbf30[_0xa444('0x2b')]=_[_0xa444('0x27')](_0xba7d9e,_0xa444('0x25'));_0x5bbf30[_0xa444('0x2c')]=_[_0xa444('0x2d')](_0x2bdc0f[_0xa444('0x2c')]);_0x5bbf30['filters']=_[_0xa444('0x2e')](_0x5bbf30[_0xa444('0x2b')],_0x5bbf30['query']);_0x361476[_0xa444('0x2f')]=_[_0xa444('0x2e')](_0x5bbf30[_0xa444('0x2b')],qs[_0xa444('0x30')](_0x2bdc0f['query'][_0xa444('0x30')]));_0x361476[_0xa444('0x2f')]=_0x361476[_0xa444('0x2f')][_0xa444('0x31')]?_0x361476[_0xa444('0x2f')]:_0x5bbf30[_0xa444('0x2b')];if(!_0x2bdc0f[_0xa444('0x2c')][_0xa444('0x32')](_0xa444('0x33'))){_0x361476['limit']=qs['limit'](_0x2bdc0f[_0xa444('0x2c')][_0xa444('0x1b')]);_0x361476[_0xa444('0x19')]=qs[_0xa444('0x19')](_0x2bdc0f[_0xa444('0x2c')][_0xa444('0x19')]);}_0x361476[_0xa444('0x34')]=qs[_0xa444('0x35')](_0x2bdc0f[_0xa444('0x2c')][_0xa444('0x35')]);_0x361476[_0xa444('0x36')]=qs[_0xa444('0x37')](_[_0xa444('0x38')](_0x2bdc0f['query'],_0x5bbf30[_0xa444('0x37')]),_0xba7d9e);if(_0x2bdc0f[_0xa444('0x2c')][_0xa444('0x39')]){_0x361476[_0xa444('0x36')]=_['merge'](_0x361476[_0xa444('0x36')],{'$or':_[_0xa444('0x27')](_0xba7d9e,function(_0x26f2fb){if(_0x26f2fb[_0xa444('0x2a')]!==_0xa444('0x3a')){var _0x702ea5={};_0x702ea5[_0x26f2fb['name']]={'$like':'%'+_0x2bdc0f[_0xa444('0x2c')][_0xa444('0x39')]+'%'};return _0x702ea5;}})});}_0x361476=_[_0xa444('0x3b')]({},_0x361476,_0x2bdc0f[_0xa444('0x3c')]);var _0x4b4e64={'where':_0x361476[_0xa444('0x36')]};return db[_0xa444('0x3d')]['count'](_0x4b4e64)[_0xa444('0x22')](function(_0x37b02b){_0x468cfa[_0xa444('0x1c')]=_0x37b02b;if(_0x2bdc0f[_0xa444('0x2c')][_0xa444('0x3e')]){_0x361476['include']=[{'all':!![]}];}return db[_0xa444('0x3d')][_0xa444('0x3f')](_0x361476);})['then'](function(_0x43983f){_0x468cfa[_0xa444('0x40')]=_0x43983f;return _0x468cfa;})[_0xa444('0x22')](respondWithFilteredResult(_0x2a24a1,_0x361476))[_0xa444('0x41')](handleError(_0x2a24a1,null));};exports[_0xa444('0x42')]=function(_0x4407a8,_0x22455a){var _0x401b66={'raw':![],'where':{'id':_0x4407a8['params']['id']}},_0x48c371={};_0x48c371[_0xa444('0x2b')]=_[_0xa444('0x2d')](db[_0xa444('0x3d')]['rawAttributes']);_0x48c371['query']=_[_0xa444('0x2d')](_0x4407a8[_0xa444('0x2c')]);_0x48c371[_0xa444('0x37')]=_[_0xa444('0x2e')](_0x48c371[_0xa444('0x2b')],_0x48c371[_0xa444('0x2c')]);_0x401b66[_0xa444('0x2f')]=_[_0xa444('0x2e')](_0x48c371[_0xa444('0x2b')],qs['fields'](_0x4407a8[_0xa444('0x2c')][_0xa444('0x30')]));_0x401b66[_0xa444('0x2f')]=_0x401b66['attributes'][_0xa444('0x31')]?_0x401b66['attributes']:_0x48c371[_0xa444('0x2b')];if(_0x4407a8[_0xa444('0x2c')][_0xa444('0x3e')]){_0x401b66[_0xa444('0x43')]=[{'all':!![]}];}_0x401b66=_['merge']({},_0x401b66,_0x4407a8[_0xa444('0x3c')]);return db['SalesforceConfiguration']['find'](_0x401b66)['then'](handleEntityNotFound(_0x22455a,null))[_0xa444('0x22')](respondWithResult(_0x22455a,null))[_0xa444('0x41')](handleError(_0x22455a,null));};exports[_0xa444('0x44')]=function(_0xf62441,_0x393f29){return db['SalesforceConfiguration']['create'](_0xf62441[_0xa444('0x45')],{})['then'](respondWithResult(_0x393f29,0xc9))[_0xa444('0x41')](handleError(_0x393f29,null));};exports[_0xa444('0x21')]=function(_0x1399b0,_0x1d50c5){if(_0x1399b0['body']['id']){delete _0x1399b0[_0xa444('0x45')]['id'];}return db[_0xa444('0x3d')][_0xa444('0x46')]({'where':{'id':_0x1399b0['params']['id']}})[_0xa444('0x22')](handleEntityNotFound(_0x1d50c5,null))[_0xa444('0x22')](saveUpdates(_0x1399b0[_0xa444('0x45')],null))[_0xa444('0x22')](respondWithResult(_0x1d50c5,null))[_0xa444('0x41')](handleError(_0x1d50c5,null));};exports[_0xa444('0x23')]=function(_0x3b1ab2,_0x1b4860){return db[_0xa444('0x3d')][_0xa444('0x46')]({'where':{'id':_0x3b1ab2['params']['id']}})[_0xa444('0x22')](handleEntityNotFound(_0x1b4860,null))[_0xa444('0x22')](removeEntity(_0x1b4860,null))['catch'](handleError(_0x1b4860,null));};exports['getFields']=function(_0x945a11,_0x1d51a8,_0x1897db){var _0x4ec67e={};var _0x2d042c={};var _0x2b69ec;var _0x1f4af9;return db['SalesforceConfiguration'][_0xa444('0x47')]({'where':{'id':_0x945a11[_0xa444('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d51a8,null))['then'](function(_0x5cec29){if(_0x5cec29){_0x2b69ec=_0x5cec29;_0x2d042c[_0xa444('0x2b')]=_[_0xa444('0x2d')](db[_0xa444('0x49')][_0xa444('0x28')]);_0x2d042c[_0xa444('0x2c')]=_[_0xa444('0x2d')](_0x945a11['query']);_0x2d042c[_0xa444('0x37')]=_[_0xa444('0x2e')](_0x2d042c[_0xa444('0x2b')],_0x2d042c[_0xa444('0x2c')]);_0x4ec67e[_0xa444('0x2f')]=_['intersection'](_0x2d042c[_0xa444('0x2b')],qs[_0xa444('0x30')](_0x945a11[_0xa444('0x2c')]['fields']));_0x4ec67e[_0xa444('0x2f')]=_0x4ec67e[_0xa444('0x2f')][_0xa444('0x31')]?_0x4ec67e[_0xa444('0x2f')]:_0x2d042c[_0xa444('0x2b')];_0x4ec67e[_0xa444('0x34')]=qs[_0xa444('0x35')](_0x945a11[_0xa444('0x2c')]['sort']);_0x4ec67e['where']=qs['filters'](_[_0xa444('0x38')](_0x945a11['query'],_0x2d042c[_0xa444('0x37')]));if(_0x945a11[_0xa444('0x2c')][_0xa444('0x39')]){_0x4ec67e['where']=_[_0xa444('0x3b')](_0x4ec67e[_0xa444('0x36')],{'$or':_[_0xa444('0x27')](_0x4ec67e[_0xa444('0x2f')],function(_0x2c906a){var _0x761ef7={};_0x761ef7[_0x2c906a]={'$like':'%'+_0x945a11[_0xa444('0x2c')]['filter']+'%'};return _0x761ef7;})});}_0x4ec67e=_['merge']({},_0x4ec67e,_0x945a11[_0xa444('0x3c')]);return _0x2b69ec[_0xa444('0x4a')](_0x4ec67e);}})[_0xa444('0x22')](function(_0x3f4b1){if(_0x3f4b1){_0x1f4af9=_0x3f4b1[_0xa444('0x31')];if(!_0x945a11[_0xa444('0x2c')][_0xa444('0x32')](_0xa444('0x33'))){_0x4ec67e[_0xa444('0x1b')]=qs['limit'](_0x945a11[_0xa444('0x2c')][_0xa444('0x1b')]);_0x4ec67e[_0xa444('0x19')]=qs[_0xa444('0x19')](_0x945a11[_0xa444('0x2c')]['offset']);}return _0x2b69ec[_0xa444('0x4a')](_0x4ec67e);}})[_0xa444('0x22')](function(_0x32895b){if(_0x32895b){return _0x32895b?{'count':_0x1f4af9,'rows':_0x32895b}:null;}})[_0xa444('0x22')](respondWithResult(_0x1d51a8,null))[_0xa444('0x41')](handleError(_0x1d51a8,null));};exports[_0xa444('0x4b')]=function(_0x226ca8,_0x20dc17,_0x55de68){var _0x406b20={};var _0x45c0bf={};var _0x3fdbfd;var _0xb65f0c;return db[_0xa444('0x3d')][_0xa444('0x47')]({'where':{'id':_0x226ca8['params']['id']}})[_0xa444('0x22')](handleEntityNotFound(_0x20dc17,null))[_0xa444('0x22')](function(_0xa006bd){if(_0xa006bd){_0x3fdbfd=_0xa006bd;_0x45c0bf[_0xa444('0x2b')]=_[_0xa444('0x2d')](db['SalesforceField']['rawAttributes']);_0x45c0bf['query']=_['keys'](_0x226ca8['query']);_0x45c0bf[_0xa444('0x37')]=_[_0xa444('0x2e')](_0x45c0bf[_0xa444('0x2b')],_0x45c0bf[_0xa444('0x2c')]);_0x406b20['attributes']=_['intersection'](_0x45c0bf[_0xa444('0x2b')],qs['fields'](_0x226ca8[_0xa444('0x2c')][_0xa444('0x30')]));_0x406b20['attributes']=_0x406b20[_0xa444('0x2f')][_0xa444('0x31')]?_0x406b20[_0xa444('0x2f')]:_0x45c0bf[_0xa444('0x2b')];_0x406b20['order']=qs[_0xa444('0x35')](_0x226ca8['query'][_0xa444('0x35')]);_0x406b20['where']=qs[_0xa444('0x37')](_['pick'](_0x226ca8[_0xa444('0x2c')],_0x45c0bf[_0xa444('0x37')]));if(_0x226ca8[_0xa444('0x2c')]['filter']){_0x406b20[_0xa444('0x36')]=_[_0xa444('0x3b')](_0x406b20[_0xa444('0x36')],{'$or':_[_0xa444('0x27')](_0x406b20[_0xa444('0x2f')],function(_0xa874eb){var _0x92e624={};_0x92e624[_0xa874eb]={'$like':'%'+_0x226ca8[_0xa444('0x2c')][_0xa444('0x39')]+'%'};return _0x92e624;})});}_0x406b20=_['merge']({},_0x406b20,_0x226ca8['options']);return _0x3fdbfd[_0xa444('0x4b')](_0x406b20);}})[_0xa444('0x22')](function(_0x269a92){if(_0x269a92){_0xb65f0c=_0x269a92[_0xa444('0x31')];if(!_0x226ca8[_0xa444('0x2c')][_0xa444('0x32')]('nolimit')){_0x406b20['limit']=qs[_0xa444('0x1b')](_0x226ca8[_0xa444('0x2c')][_0xa444('0x1b')]);_0x406b20[_0xa444('0x19')]=qs['offset'](_0x226ca8[_0xa444('0x2c')][_0xa444('0x19')]);}return _0x3fdbfd['getSubjects'](_0x406b20);}})['then'](function(_0x308bd2){if(_0x308bd2){return _0x308bd2?{'count':_0xb65f0c,'rows':_0x308bd2}:null;}})[_0xa444('0x22')](respondWithResult(_0x20dc17,null))[_0xa444('0x41')](handleError(_0x20dc17,null));};exports[_0xa444('0x4c')]=function(_0x29ac8a,_0x4758fd,_0x3a5b8d){var _0x2d168={};var _0x17670b={};var _0x3eebac;var _0x7e69d0;return db[_0xa444('0x3d')][_0xa444('0x47')]({'where':{'id':_0x29ac8a[_0xa444('0x48')]['id']}})['then'](handleEntityNotFound(_0x4758fd,null))['then'](function(_0xa141cc){if(_0xa141cc){_0x3eebac=_0xa141cc;_0x17670b[_0xa444('0x2b')]=_[_0xa444('0x2d')](db[_0xa444('0x49')][_0xa444('0x28')]);_0x17670b[_0xa444('0x2c')]=_['keys'](_0x29ac8a[_0xa444('0x2c')]);_0x17670b[_0xa444('0x37')]=_[_0xa444('0x2e')](_0x17670b[_0xa444('0x2b')],_0x17670b['query']);_0x2d168[_0xa444('0x2f')]=_['intersection'](_0x17670b['model'],qs['fields'](_0x29ac8a[_0xa444('0x2c')]['fields']));_0x2d168[_0xa444('0x2f')]=_0x2d168[_0xa444('0x2f')][_0xa444('0x31')]?_0x2d168[_0xa444('0x2f')]:_0x17670b[_0xa444('0x2b')];_0x2d168['order']=qs[_0xa444('0x35')](_0x29ac8a[_0xa444('0x2c')]['sort']);_0x2d168[_0xa444('0x36')]=qs[_0xa444('0x37')](_[_0xa444('0x38')](_0x29ac8a[_0xa444('0x2c')],_0x17670b['filters']));if(_0x29ac8a[_0xa444('0x2c')]['filter']){_0x2d168[_0xa444('0x36')]=_[_0xa444('0x3b')](_0x2d168[_0xa444('0x36')],{'$or':_['map'](_0x2d168[_0xa444('0x2f')],function(_0x2ef554){var _0x243325={};_0x243325[_0x2ef554]={'$like':'%'+_0x29ac8a[_0xa444('0x2c')][_0xa444('0x39')]+'%'};return _0x243325;})});}_0x2d168=_['merge']({},_0x2d168,_0x29ac8a[_0xa444('0x3c')]);return _0x3eebac['getDescriptions'](_0x2d168);}})[_0xa444('0x22')](function(_0x4bf826){if(_0x4bf826){_0x7e69d0=_0x4bf826[_0xa444('0x31')];if(!_0x29ac8a[_0xa444('0x2c')][_0xa444('0x32')](_0xa444('0x33'))){_0x2d168[_0xa444('0x1b')]=qs[_0xa444('0x1b')](_0x29ac8a['query'][_0xa444('0x1b')]);_0x2d168[_0xa444('0x19')]=qs['offset'](_0x29ac8a[_0xa444('0x2c')]['offset']);}return _0x3eebac['getDescriptions'](_0x2d168);}})[_0xa444('0x22')](function(_0x22c6ce){if(_0x22c6ce){return _0x22c6ce?{'count':_0x7e69d0,'rows':_0x22c6ce}:null;}})[_0xa444('0x22')](respondWithResult(_0x4758fd,null))[_0xa444('0x41')](handleError(_0x4758fd,null));}; \ No newline at end of file +var _0x2913=['key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','keys','fields','find','create','body','destroy','getFields','findOne','getSubjects','SalesforceField','getDescriptions','nolimit','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type'];(function(_0x16ab97,_0x27bf14){var _0x3a28aa=function(_0x3e949e){while(--_0x3e949e){_0x16ab97['push'](_0x16ab97['shift']());}};_0x3a28aa(++_0x27bf14);}(_0x2913,0x123));var _0x3291=function(_0x50224b,_0x57c61d){_0x50224b=_0x50224b-0x0;var _0x22b47b=_0x2913[_0x50224b];return _0x22b47b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3291('0x0'));var jsonpatch=require(_0x3291('0x1'));var rp=require('request-promise');var moment=require(_0x3291('0x2'));var BPromise=require(_0x3291('0x3'));var Mustache=require(_0x3291('0x4'));var util=require(_0x3291('0x5'));var path=require(_0x3291('0x6'));var sox=require(_0x3291('0x7'));var csv=require(_0x3291('0x8'));var ejs=require(_0x3291('0x9'));var fs=require('fs');var fs_extra=require(_0x3291('0xa'));var _=require(_0x3291('0xb'));var squel=require(_0x3291('0xc'));var crypto=require(_0x3291('0xd'));var jsforce=require(_0x3291('0xe'));var deskjs=require(_0x3291('0xf'));var toCsv=require(_0x3291('0x8'));var querystring=require(_0x3291('0x10'));var Papa=require(_0x3291('0x11'));var Redis=require(_0x3291('0x12'));var authService=require(_0x3291('0x13'));var qs=require(_0x3291('0x14'));var as=require(_0x3291('0x15'));var hardwareService=require(_0x3291('0x16'));var logger=require(_0x3291('0x17'))(_0x3291('0x18'));var utils=require(_0x3291('0x19'));var config=require(_0x3291('0x1a'));var licenseUtil=require(_0x3291('0x1b'));var db=require(_0x3291('0x1c'))['db'];function respondWithStatusCode(_0x404956,_0x44f538){_0x44f538=_0x44f538||0xcc;return function(_0x2c5a3e){if(_0x2c5a3e){return _0x404956['sendStatus'](_0x44f538);}return _0x404956['status'](_0x44f538)[_0x3291('0x1d')]();};}function respondWithResult(_0x2beb3a,_0x27e558){_0x27e558=_0x27e558||0xc8;return function(_0x370cd8){if(_0x370cd8){return _0x2beb3a[_0x3291('0x1e')](_0x27e558)[_0x3291('0x1f')](_0x370cd8);}};}function respondWithFilteredResult(_0x52b8ce,_0xa42735){return function(_0x22510d){if(_0x22510d){var _0x365e4b=typeof _0xa42735[_0x3291('0x20')]===_0x3291('0x21')&&typeof _0xa42735['limit']===_0x3291('0x21');var _0x3abba5=_0x22510d[_0x3291('0x22')];var _0x1d4022=_0x365e4b?0x0:_0xa42735[_0x3291('0x20')];var _0x39f492=_0x365e4b?_0x22510d[_0x3291('0x22')]:_0xa42735[_0x3291('0x20')]+_0xa42735[_0x3291('0x23')];var _0x2c1901;if(_0x39f492>=_0x3abba5){_0x39f492=_0x3abba5;_0x2c1901=0xc8;}else{_0x2c1901=0xce;}_0x52b8ce[_0x3291('0x1e')](_0x2c1901);return _0x52b8ce[_0x3291('0x24')](_0x3291('0x25'),_0x1d4022+'-'+_0x39f492+'/'+_0x3abba5)[_0x3291('0x1f')](_0x22510d);}return null;};}function patchUpdates(_0x38067c){return function(_0x183de3){try{jsonpatch[_0x3291('0x26')](_0x183de3,_0x38067c,!![]);}catch(_0x14a1ab){return BPromise[_0x3291('0x27')](_0x14a1ab);}return _0x183de3['save']();};}function saveUpdates(_0x57adbf,_0x18ce0b){return function(_0x30cfc8){if(_0x30cfc8){return _0x30cfc8[_0x3291('0x28')](_0x57adbf)[_0x3291('0x29')](function(_0x352045){return _0x352045;});}return null;};}function removeEntity(_0x39cb74,_0x4ac777){return function(_0x5e1206){if(_0x5e1206){return _0x5e1206['destroy']()[_0x3291('0x29')](function(){_0x39cb74['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14e76b,_0x5d8a04){return function(_0x29dbf1){if(!_0x29dbf1){_0x14e76b[_0x3291('0x2a')](0x194);}return _0x29dbf1;};}function handleError(_0xfa8418,_0x30ab79){_0x30ab79=_0x30ab79||0x1f4;return function(_0x5af91f){logger[_0x3291('0x2b')](_0x5af91f[_0x3291('0x2c')]);if(_0x5af91f[_0x3291('0x2d')]){delete _0x5af91f[_0x3291('0x2d')];}_0xfa8418[_0x3291('0x1e')](_0x30ab79)[_0x3291('0x2e')](_0x5af91f);};}exports[_0x3291('0x2f')]=function(_0x599fd0,_0x456106){var _0x8c1561={},_0x5dfc33={},_0x2cd0df={'count':0x0,'rows':[]};var _0x4d3c67=_[_0x3291('0x30')](db[_0x3291('0x31')][_0x3291('0x32')],function(_0xa597bd){return{'name':_0xa597bd[_0x3291('0x33')],'type':_0xa597bd[_0x3291('0x34')][_0x3291('0x35')]};});_0x5dfc33[_0x3291('0x36')]=_[_0x3291('0x30')](_0x4d3c67,_0x3291('0x2d'));_0x5dfc33[_0x3291('0x37')]=_['keys'](_0x599fd0[_0x3291('0x37')]);_0x5dfc33[_0x3291('0x38')]=_[_0x3291('0x39')](_0x5dfc33[_0x3291('0x36')],_0x5dfc33[_0x3291('0x37')]);_0x8c1561[_0x3291('0x3a')]=_[_0x3291('0x39')](_0x5dfc33[_0x3291('0x36')],qs['fields'](_0x599fd0['query']['fields']));_0x8c1561[_0x3291('0x3a')]=_0x8c1561[_0x3291('0x3a')][_0x3291('0x3b')]?_0x8c1561['attributes']:_0x5dfc33[_0x3291('0x36')];if(!_0x599fd0[_0x3291('0x37')][_0x3291('0x3c')]('nolimit')){_0x8c1561['limit']=qs['limit'](_0x599fd0[_0x3291('0x37')][_0x3291('0x23')]);_0x8c1561[_0x3291('0x20')]=qs[_0x3291('0x20')](_0x599fd0[_0x3291('0x37')]['offset']);}_0x8c1561[_0x3291('0x3d')]=qs[_0x3291('0x3e')](_0x599fd0[_0x3291('0x37')][_0x3291('0x3e')]);_0x8c1561[_0x3291('0x3f')]=qs[_0x3291('0x38')](_[_0x3291('0x40')](_0x599fd0[_0x3291('0x37')],_0x5dfc33[_0x3291('0x38')]),_0x4d3c67);if(_0x599fd0[_0x3291('0x37')]['filter']){_0x8c1561[_0x3291('0x3f')]=_[_0x3291('0x41')](_0x8c1561[_0x3291('0x3f')],{'$or':_[_0x3291('0x30')](_0x4d3c67,function(_0x2711c2){if(_0x2711c2[_0x3291('0x34')]!==_0x3291('0x42')){var _0x5a7c6c={};_0x5a7c6c[_0x2711c2[_0x3291('0x2d')]]={'$like':'%'+_0x599fd0['query'][_0x3291('0x43')]+'%'};return _0x5a7c6c;}})});}_0x8c1561=_[_0x3291('0x41')]({},_0x8c1561,_0x599fd0[_0x3291('0x44')]);var _0x24cfc1={'where':_0x8c1561['where']};return db[_0x3291('0x31')][_0x3291('0x22')](_0x24cfc1)[_0x3291('0x29')](function(_0x187c1f){_0x2cd0df[_0x3291('0x22')]=_0x187c1f;if(_0x599fd0['query'][_0x3291('0x45')]){_0x8c1561[_0x3291('0x46')]=[{'all':!![]}];}return db[_0x3291('0x31')][_0x3291('0x47')](_0x8c1561);})['then'](function(_0x3478cf){_0x2cd0df['rows']=_0x3478cf;return _0x2cd0df;})['then'](respondWithFilteredResult(_0x456106,_0x8c1561))[_0x3291('0x48')](handleError(_0x456106,null));};exports['show']=function(_0x12a6ce,_0x538933){var _0xe52b93={'raw':![],'where':{'id':_0x12a6ce[_0x3291('0x49')]['id']}},_0x30c512={};_0x30c512['model']=_[_0x3291('0x4a')](db[_0x3291('0x31')][_0x3291('0x32')]);_0x30c512['query']=_['keys'](_0x12a6ce['query']);_0x30c512[_0x3291('0x38')]=_[_0x3291('0x39')](_0x30c512[_0x3291('0x36')],_0x30c512[_0x3291('0x37')]);_0xe52b93['attributes']=_[_0x3291('0x39')](_0x30c512[_0x3291('0x36')],qs[_0x3291('0x4b')](_0x12a6ce[_0x3291('0x37')][_0x3291('0x4b')]));_0xe52b93['attributes']=_0xe52b93[_0x3291('0x3a')][_0x3291('0x3b')]?_0xe52b93['attributes']:_0x30c512[_0x3291('0x36')];if(_0x12a6ce[_0x3291('0x37')][_0x3291('0x45')]){_0xe52b93[_0x3291('0x46')]=[{'all':!![]}];}_0xe52b93=_[_0x3291('0x41')]({},_0xe52b93,_0x12a6ce['options']);return db[_0x3291('0x31')][_0x3291('0x4c')](_0xe52b93)['then'](handleEntityNotFound(_0x538933,null))[_0x3291('0x29')](respondWithResult(_0x538933,null))['catch'](handleError(_0x538933,null));};exports[_0x3291('0x4d')]=function(_0x4d815e,_0x4fe389){return db[_0x3291('0x31')][_0x3291('0x4d')](_0x4d815e['body'],{})[_0x3291('0x29')](respondWithResult(_0x4fe389,0xc9))[_0x3291('0x48')](handleError(_0x4fe389,null));};exports[_0x3291('0x28')]=function(_0x24960f,_0x1fd035){if(_0x24960f['body']['id']){delete _0x24960f[_0x3291('0x4e')]['id'];}return db[_0x3291('0x31')][_0x3291('0x4c')]({'where':{'id':_0x24960f['params']['id']}})['then'](handleEntityNotFound(_0x1fd035,null))[_0x3291('0x29')](saveUpdates(_0x24960f[_0x3291('0x4e')],null))['then'](respondWithResult(_0x1fd035,null))['catch'](handleError(_0x1fd035,null));};exports[_0x3291('0x4f')]=function(_0x3c6eab,_0x4005c2){return db[_0x3291('0x31')][_0x3291('0x4c')]({'where':{'id':_0x3c6eab[_0x3291('0x49')]['id']}})['then'](handleEntityNotFound(_0x4005c2,null))['then'](removeEntity(_0x4005c2,null))[_0x3291('0x48')](handleError(_0x4005c2,null));};exports[_0x3291('0x50')]=function(_0x1462dc,_0x1d3ed5,_0x36d41d){var _0x346128={};var _0x238448={};var _0x9a37c3;var _0x11356d;return db[_0x3291('0x31')][_0x3291('0x51')]({'where':{'id':_0x1462dc[_0x3291('0x49')]['id']}})[_0x3291('0x29')](handleEntityNotFound(_0x1d3ed5,null))[_0x3291('0x29')](function(_0x377e6d){if(_0x377e6d){_0x9a37c3=_0x377e6d;_0x238448[_0x3291('0x36')]=_['keys'](db['SalesforceField'][_0x3291('0x32')]);_0x238448['query']=_[_0x3291('0x4a')](_0x1462dc[_0x3291('0x37')]);_0x238448[_0x3291('0x38')]=_[_0x3291('0x39')](_0x238448[_0x3291('0x36')],_0x238448['query']);_0x346128[_0x3291('0x3a')]=_[_0x3291('0x39')](_0x238448['model'],qs[_0x3291('0x4b')](_0x1462dc[_0x3291('0x37')][_0x3291('0x4b')]));_0x346128[_0x3291('0x3a')]=_0x346128[_0x3291('0x3a')][_0x3291('0x3b')]?_0x346128['attributes']:_0x238448[_0x3291('0x36')];_0x346128[_0x3291('0x3d')]=qs[_0x3291('0x3e')](_0x1462dc['query'][_0x3291('0x3e')]);_0x346128['where']=qs[_0x3291('0x38')](_[_0x3291('0x40')](_0x1462dc[_0x3291('0x37')],_0x238448[_0x3291('0x38')]));if(_0x1462dc[_0x3291('0x37')][_0x3291('0x43')]){_0x346128[_0x3291('0x3f')]=_[_0x3291('0x41')](_0x346128[_0x3291('0x3f')],{'$or':_['map'](_0x346128[_0x3291('0x3a')],function(_0x197873){var _0xec6c2a={};_0xec6c2a[_0x197873]={'$like':'%'+_0x1462dc[_0x3291('0x37')][_0x3291('0x43')]+'%'};return _0xec6c2a;})});}_0x346128=_['merge']({},_0x346128,_0x1462dc[_0x3291('0x44')]);return _0x9a37c3[_0x3291('0x50')](_0x346128);}})['then'](function(_0x56fc7b){if(_0x56fc7b){_0x11356d=_0x56fc7b['length'];if(!_0x1462dc['query'][_0x3291('0x3c')]('nolimit')){_0x346128[_0x3291('0x23')]=qs[_0x3291('0x23')](_0x1462dc[_0x3291('0x37')][_0x3291('0x23')]);_0x346128[_0x3291('0x20')]=qs[_0x3291('0x20')](_0x1462dc[_0x3291('0x37')][_0x3291('0x20')]);}return _0x9a37c3['getFields'](_0x346128);}})[_0x3291('0x29')](function(_0x49b6eb){if(_0x49b6eb){return _0x49b6eb?{'count':_0x11356d,'rows':_0x49b6eb}:null;}})['then'](respondWithResult(_0x1d3ed5,null))['catch'](handleError(_0x1d3ed5,null));};exports[_0x3291('0x52')]=function(_0x42b7a3,_0x43aa69,_0x504d01){var _0x483a52={};var _0x544259={};var _0x5e0a07;var _0x2070a1;return db[_0x3291('0x31')]['findOne']({'where':{'id':_0x42b7a3[_0x3291('0x49')]['id']}})[_0x3291('0x29')](handleEntityNotFound(_0x43aa69,null))[_0x3291('0x29')](function(_0x367680){if(_0x367680){_0x5e0a07=_0x367680;_0x544259[_0x3291('0x36')]=_[_0x3291('0x4a')](db[_0x3291('0x53')][_0x3291('0x32')]);_0x544259['query']=_[_0x3291('0x4a')](_0x42b7a3[_0x3291('0x37')]);_0x544259['filters']=_[_0x3291('0x39')](_0x544259[_0x3291('0x36')],_0x544259[_0x3291('0x37')]);_0x483a52[_0x3291('0x3a')]=_['intersection'](_0x544259[_0x3291('0x36')],qs[_0x3291('0x4b')](_0x42b7a3[_0x3291('0x37')][_0x3291('0x4b')]));_0x483a52['attributes']=_0x483a52['attributes'][_0x3291('0x3b')]?_0x483a52['attributes']:_0x544259[_0x3291('0x36')];_0x483a52[_0x3291('0x3d')]=qs[_0x3291('0x3e')](_0x42b7a3[_0x3291('0x37')][_0x3291('0x3e')]);_0x483a52['where']=qs[_0x3291('0x38')](_[_0x3291('0x40')](_0x42b7a3[_0x3291('0x37')],_0x544259[_0x3291('0x38')]));if(_0x42b7a3['query'][_0x3291('0x43')]){_0x483a52[_0x3291('0x3f')]=_[_0x3291('0x41')](_0x483a52[_0x3291('0x3f')],{'$or':_[_0x3291('0x30')](_0x483a52[_0x3291('0x3a')],function(_0x1cb2b2){var _0x54b75a={};_0x54b75a[_0x1cb2b2]={'$like':'%'+_0x42b7a3['query'][_0x3291('0x43')]+'%'};return _0x54b75a;})});}_0x483a52=_[_0x3291('0x41')]({},_0x483a52,_0x42b7a3['options']);return _0x5e0a07[_0x3291('0x52')](_0x483a52);}})[_0x3291('0x29')](function(_0x337510){if(_0x337510){_0x2070a1=_0x337510[_0x3291('0x3b')];if(!_0x42b7a3[_0x3291('0x37')][_0x3291('0x3c')]('nolimit')){_0x483a52['limit']=qs[_0x3291('0x23')](_0x42b7a3['query'][_0x3291('0x23')]);_0x483a52[_0x3291('0x20')]=qs[_0x3291('0x20')](_0x42b7a3['query'][_0x3291('0x20')]);}return _0x5e0a07[_0x3291('0x52')](_0x483a52);}})[_0x3291('0x29')](function(_0x2994c4){if(_0x2994c4){return _0x2994c4?{'count':_0x2070a1,'rows':_0x2994c4}:null;}})[_0x3291('0x29')](respondWithResult(_0x43aa69,null))['catch'](handleError(_0x43aa69,null));};exports[_0x3291('0x54')]=function(_0x4ccdbb,_0x52f317,_0x1f4c6b){var _0x16ed62={};var _0x2102ac={};var _0x22ba32;var _0x373e81;return db[_0x3291('0x31')]['findOne']({'where':{'id':_0x4ccdbb[_0x3291('0x49')]['id']}})['then'](handleEntityNotFound(_0x52f317,null))[_0x3291('0x29')](function(_0x1a0a37){if(_0x1a0a37){_0x22ba32=_0x1a0a37;_0x2102ac['model']=_[_0x3291('0x4a')](db['SalesforceField'][_0x3291('0x32')]);_0x2102ac[_0x3291('0x37')]=_[_0x3291('0x4a')](_0x4ccdbb[_0x3291('0x37')]);_0x2102ac['filters']=_['intersection'](_0x2102ac[_0x3291('0x36')],_0x2102ac[_0x3291('0x37')]);_0x16ed62['attributes']=_[_0x3291('0x39')](_0x2102ac['model'],qs[_0x3291('0x4b')](_0x4ccdbb[_0x3291('0x37')][_0x3291('0x4b')]));_0x16ed62[_0x3291('0x3a')]=_0x16ed62[_0x3291('0x3a')]['length']?_0x16ed62[_0x3291('0x3a')]:_0x2102ac[_0x3291('0x36')];_0x16ed62[_0x3291('0x3d')]=qs[_0x3291('0x3e')](_0x4ccdbb[_0x3291('0x37')][_0x3291('0x3e')]);_0x16ed62[_0x3291('0x3f')]=qs[_0x3291('0x38')](_['pick'](_0x4ccdbb[_0x3291('0x37')],_0x2102ac[_0x3291('0x38')]));if(_0x4ccdbb[_0x3291('0x37')]['filter']){_0x16ed62[_0x3291('0x3f')]=_['merge'](_0x16ed62[_0x3291('0x3f')],{'$or':_[_0x3291('0x30')](_0x16ed62[_0x3291('0x3a')],function(_0x1c5342){var _0x2916bf={};_0x2916bf[_0x1c5342]={'$like':'%'+_0x4ccdbb[_0x3291('0x37')][_0x3291('0x43')]+'%'};return _0x2916bf;})});}_0x16ed62=_[_0x3291('0x41')]({},_0x16ed62,_0x4ccdbb[_0x3291('0x44')]);return _0x22ba32[_0x3291('0x54')](_0x16ed62);}})[_0x3291('0x29')](function(_0x27d710){if(_0x27d710){_0x373e81=_0x27d710['length'];if(!_0x4ccdbb[_0x3291('0x37')][_0x3291('0x3c')](_0x3291('0x55'))){_0x16ed62[_0x3291('0x23')]=qs[_0x3291('0x23')](_0x4ccdbb[_0x3291('0x37')][_0x3291('0x23')]);_0x16ed62[_0x3291('0x20')]=qs[_0x3291('0x20')](_0x4ccdbb[_0x3291('0x37')][_0x3291('0x20')]);}return _0x22ba32[_0x3291('0x54')](_0x16ed62);}})[_0x3291('0x29')](function(_0x48dcc1){if(_0x48dcc1){return _0x48dcc1?{'count':_0x373e81,'rows':_0x48dcc1}:null;}})['then'](respondWithResult(_0x52f317,null))[_0x3291('0x48')](handleError(_0x52f317,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index eb5541f..79880fc 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 _0xe351=['path','rimraf','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1cefe5,_0x15f97f){var _0x12f6e7=function(_0x3fe355){while(--_0x3fe355){_0x1cefe5['push'](_0x1cefe5['shift']());}};_0x12f6e7(++_0x15f97f);}(_0xe351,0x199));var _0x1e35=function(_0x3a67ce,_0x17b904){_0x3a67ce=_0x3a67ce-0x0;var _0x5f4dee=_0xe351[_0x3a67ce];return _0x5f4dee;};'use strict';var _=require(_0x1e35('0x0'));var util=require(_0x1e35('0x1'));var logger=require(_0x1e35('0x2'))(_0x1e35('0x3'));var moment=require(_0x1e35('0x4'));var BPromise=require(_0x1e35('0x5'));var rp=require(_0x1e35('0x6'));var fs=require('fs');var path=require(_0x1e35('0x7'));var rimraf=require(_0x1e35('0x8'));var config=require('../../config/environment');var attributes=require(_0x1e35('0x9'));module[_0x1e35('0xa')]=function(_0x538a81,_0x3973b6){return _0x538a81[_0x1e35('0xb')]('SalesforceConfiguration',attributes,{'tableName':_0x1e35('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8381=['bluebird','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','api'];(function(_0x32ed6a,_0x1cd968){var _0x5d670c=function(_0x6a8efc){while(--_0x6a8efc){_0x32ed6a['push'](_0x32ed6a['shift']());}};_0x5d670c(++_0x1cd968);}(_0x8381,0x1ab));var _0x1838=function(_0x2f78e7,_0x310448){_0x2f78e7=_0x2f78e7-0x0;var _0x5155aa=_0x8381[_0x2f78e7];return _0x5155aa;};'use strict';var _=require(_0x1838('0x0'));var util=require(_0x1838('0x1'));var logger=require('../../config/logger')(_0x1838('0x2'));var moment=require('moment');var BPromise=require(_0x1838('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1838('0x4'));var attributes=require(_0x1838('0x5'));module[_0x1838('0x6')]=function(_0x22f340,_0x3f0b8c){return _0x22f340[_0x1838('0x7')](_0x1838('0x8'),attributes,{'tableName':_0x1838('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 522410b..10c7bd8 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 _0xd0b8=['result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','SalesforceConfiguration,\x20%s,\x20%s','message'];(function(_0x4544ac,_0x3a3d2f){var _0x574cb9=function(_0x287c60){while(--_0x287c60){_0x4544ac['push'](_0x4544ac['shift']());}};_0x574cb9(++_0x3a3d2f);}(_0xd0b8,0x17b));var _0x8d0b=function(_0x3d4b8a,_0x30cabe){_0x3d4b8a=_0x3d4b8a-0x0;var _0x3265f2=_0xd0b8[_0x3d4b8a];return _0x3265f2;};'use strict';var _=require(_0x8d0b('0x0'));var util=require('util');var moment=require(_0x8d0b('0x1'));var BPromise=require('bluebird');var rs=require(_0x8d0b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d0b('0x3'))['db'];var utils=require(_0x8d0b('0x4'));var logger=require(_0x8d0b('0x5'))(_0x8d0b('0x6'));var config=require(_0x8d0b('0x7'));var jayson=require(_0x8d0b('0x8'));var client=jayson[_0x8d0b('0x9')][_0x8d0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x255251,_0x5d9fc7,_0x30e58d){return new BPromise(function(_0x49739c,_0x189610){return client[_0x8d0b('0xb')](_0x255251,_0x30e58d)[_0x8d0b('0xc')](function(_0x584bf7){logger[_0x8d0b('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5d9fc7,_0x8d0b('0xe'));logger[_0x8d0b('0xf')](_0x8d0b('0x10'),_0x5d9fc7,_0x8d0b('0xe'),JSON['stringify'](_0x584bf7));if(_0x584bf7[_0x8d0b('0x11')]){if(_0x584bf7[_0x8d0b('0x11')]['code']===0x1f4){logger[_0x8d0b('0x11')](_0x8d0b('0x12'),_0x5d9fc7,_0x584bf7[_0x8d0b('0x11')][_0x8d0b('0x13')]);return _0x189610(_0x584bf7[_0x8d0b('0x11')]['message']);}logger[_0x8d0b('0x11')](_0x8d0b('0x12'),_0x5d9fc7,_0x584bf7[_0x8d0b('0x11')][_0x8d0b('0x13')]);return _0x49739c(_0x584bf7['error'][_0x8d0b('0x13')]);}else{logger[_0x8d0b('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5d9fc7,_0x8d0b('0xe'));_0x49739c(_0x584bf7[_0x8d0b('0x14')][_0x8d0b('0x13')]);}})['catch'](function(_0x389e7b){logger[_0x8d0b('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5d9fc7,_0x389e7b);_0x189610(_0x389e7b);});});} \ No newline at end of file +var _0x2ec2=['then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3f465d,_0xbd2037){var _0x121ad1=function(_0x5b13d6){while(--_0x5b13d6){_0x3f465d['push'](_0x3f465d['shift']());}};_0x121ad1(++_0xbd2037);}(_0x2ec2,0x151));var _0x22ec=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x2ec2[_0x4e5552];return _0x60a338;};'use strict';var _=require(_0x22ec('0x0'));var util=require(_0x22ec('0x1'));var moment=require(_0x22ec('0x2'));var BPromise=require(_0x22ec('0x3'));var rs=require(_0x22ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22ec('0x5'))['db'];var utils=require(_0x22ec('0x6'));var logger=require(_0x22ec('0x7'))(_0x22ec('0x8'));var config=require(_0x22ec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x22ec('0xa')][_0x22ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ce83f,_0x5a6b0f,_0x20bd30){return new BPromise(function(_0x423fbe,_0x5d52b7){return client[_0x22ec('0xc')](_0x4ce83f,_0x20bd30)[_0x22ec('0xd')](function(_0x153278){logger[_0x22ec('0xe')](_0x22ec('0xf'),_0x5a6b0f,_0x22ec('0x10'));logger[_0x22ec('0x11')](_0x22ec('0x12'),_0x5a6b0f,_0x22ec('0x10'),JSON[_0x22ec('0x13')](_0x153278));if(_0x153278[_0x22ec('0x14')]){if(_0x153278[_0x22ec('0x14')][_0x22ec('0x15')]===0x1f4){logger['error'](_0x22ec('0xf'),_0x5a6b0f,_0x153278[_0x22ec('0x14')][_0x22ec('0x16')]);return _0x5d52b7(_0x153278[_0x22ec('0x14')][_0x22ec('0x16')]);}logger[_0x22ec('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5a6b0f,_0x153278['error'][_0x22ec('0x16')]);return _0x423fbe(_0x153278[_0x22ec('0x14')][_0x22ec('0x16')]);}else{logger[_0x22ec('0xe')](_0x22ec('0xf'),_0x5a6b0f,'request\x20sent');_0x423fbe(_0x153278[_0x22ec('0x17')]['message']);}})[_0x22ec('0x18')](function(_0x3bd970){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x5a6b0f,_0x3bd970);_0x5d52b7(_0x3bd970);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index fc445d3..ea0d965 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 _0xf712=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','post','create','put','update','delete'];(function(_0x241af1,_0x587325){var _0x219ecb=function(_0x18f783){while(--_0x18f783){_0x241af1['push'](_0x241af1['shift']());}};_0x219ecb(++_0x587325);}(_0xf712,0x1a7));var _0x2f71=function(_0x52dae4,_0x58417c){_0x52dae4=_0x52dae4-0x0;var _0x5c4b23=_0xf712[_0x52dae4];return _0x5c4b23;};'use strict';var multer=require(_0x2f71('0x0'));var util=require(_0x2f71('0x1'));var path=require(_0x2f71('0x2'));var timeout=require(_0x2f71('0x3'));var express=require(_0x2f71('0x4'));var router=express[_0x2f71('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2f71('0x6'));var interaction=require(_0x2f71('0x7'));var config=require(_0x2f71('0x8'));var controller=require(_0x2f71('0x9'));router['get']('/',auth[_0x2f71('0xa')](),controller[_0x2f71('0xb')]);router[_0x2f71('0xc')]('/:id',auth[_0x2f71('0xa')](),controller['show']);router[_0x2f71('0xd')]('/',auth[_0x2f71('0xa')](),controller[_0x2f71('0xe')]);router[_0x2f71('0xf')]('/:id',auth[_0x2f71('0xa')](),controller[_0x2f71('0x10')]);router[_0x2f71('0x11')](_0x2f71('0x12'),auth[_0x2f71('0xa')](),controller[_0x2f71('0x13')]);module[_0x2f71('0x14')]=router; \ No newline at end of file +var _0x3fb5=['Router','fs-extra','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2b44fb,_0xdc7b14){var _0x272b73=function(_0x36a72c){while(--_0x36a72c){_0x2b44fb['push'](_0x2b44fb['shift']());}};_0x272b73(++_0xdc7b14);}(_0x3fb5,0xfb));var _0x53fb=function(_0x1617f1,_0x302cd6){_0x1617f1=_0x1617f1-0x0;var _0x55d9b6=_0x3fb5[_0x1617f1];return _0x55d9b6;};'use strict';var multer=require(_0x53fb('0x0'));var util=require(_0x53fb('0x1'));var path=require(_0x53fb('0x2'));var timeout=require(_0x53fb('0x3'));var express=require('express');var router=express[_0x53fb('0x4')]();var fs_extra=require(_0x53fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x53fb('0x6'));var config=require('../../config/environment');var controller=require(_0x53fb('0x7'));router[_0x53fb('0x8')]('/',auth[_0x53fb('0x9')](),controller[_0x53fb('0xa')]);router[_0x53fb('0x8')](_0x53fb('0xb'),auth['isAuthenticated'](),controller[_0x53fb('0xc')]);router[_0x53fb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x53fb('0xb'),auth[_0x53fb('0x9')](),controller['update']);router[_0x53fb('0xe')](_0x53fb('0xb'),auth[_0x53fb('0x9')](),controller[_0x53fb('0xf')]);module[_0x53fb('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 17eb997..0e6f988 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 _0x3d8b=['string','STRING','ENUM','variable','customVariable','picklist'];(function(_0x465f60,_0x31b917){var _0x35719a=function(_0x4e500e){while(--_0x4e500e){_0x465f60['push'](_0x465f60['shift']());}};_0x35719a(++_0x31b917);}(_0x3d8b,0x18e));var _0xb3d8=function(_0x389f3b,_0x5350ea){_0x389f3b=_0x389f3b-0x0;var _0x3c2271=_0x3d8b[_0x389f3b];return _0x3c2271;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb3d8('0x0')]('string',_0xb3d8('0x1'),_0xb3d8('0x2'),'keyValue',_0xb3d8('0x3')),'defaultValue':_0xb3d8('0x4')},'content':{'type':Sequelize[_0xb3d8('0x5')]},'key':{'type':Sequelize[_0xb3d8('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xb3d8('0x4'),_0xb3d8('0x1'),_0xb3d8('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb3d8('0x5')]},'variableName':{'type':Sequelize[_0xb3d8('0x5')]}}; \ No newline at end of file +var _0xd95f=['STRING','customVariable','ENUM','picklist','string'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xd95f,0x147));var _0xfd95=function(_0x50b9ac,_0xe49b69){_0x50b9ac=_0x50b9ac-0x0;var _0x26b8bf=_0xd95f[_0x50b9ac];return _0x26b8bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xfd95('0x0')]('string','variable','customVariable','keyValue',_0xfd95('0x1')),'defaultValue':_0xfd95('0x2')},'content':{'type':Sequelize[_0xfd95('0x3')]},'key':{'type':Sequelize[_0xfd95('0x3')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xfd95('0x4'))},'keyContent':{'type':Sequelize[_0xfd95('0x3')]},'idField':{'type':Sequelize[_0xfd95('0x3')]},'variableName':{'type':Sequelize[_0xfd95('0x3')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index af16a34..748dcff 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 _0xa971=['include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SalesforceField','fieldName','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','catch','show','params','keys','rawAttributes','includeAll'];(function(_0x2feb53,_0x264ef7){var _0x5700ee=function(_0x700c98){while(--_0x700c98){_0x2feb53['push'](_0x2feb53['shift']());}};_0x5700ee(++_0x264ef7);}(_0xa971,0xe0));var _0x1a97=function(_0x83b13c,_0x142504){_0x83b13c=_0x83b13c-0x0;var _0x6694e7=_0xa971[_0x83b13c];return _0x6694e7;};'use strict';var emlformat=require(_0x1a97('0x0'));var rimraf=require(_0x1a97('0x1'));var zipdir=require(_0x1a97('0x2'));var jsonpatch=require(_0x1a97('0x3'));var rp=require(_0x1a97('0x4'));var moment=require(_0x1a97('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1a97('0x6'));var util=require('util');var path=require(_0x1a97('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1a97('0x8'));var fs=require('fs');var fs_extra=require(_0x1a97('0x9'));var _=require('lodash');var squel=require(_0x1a97('0xa'));var crypto=require(_0x1a97('0xb'));var jsforce=require(_0x1a97('0xc'));var deskjs=require(_0x1a97('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1a97('0xe'));var Papa=require(_0x1a97('0xf'));var Redis=require(_0x1a97('0x10'));var authService=require(_0x1a97('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1a97('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a97('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1a97('0x14'));var licenseUtil=require(_0x1a97('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x508fab,_0x54897f){_0x54897f=_0x54897f||0xcc;return function(_0x1c7065){if(_0x1c7065){return _0x508fab[_0x1a97('0x16')](_0x54897f);}return _0x508fab[_0x1a97('0x17')](_0x54897f)[_0x1a97('0x18')]();};}function respondWithResult(_0x5e3146,_0x2a0c7c){_0x2a0c7c=_0x2a0c7c||0xc8;return function(_0x38c19a){if(_0x38c19a){return _0x5e3146[_0x1a97('0x17')](_0x2a0c7c)[_0x1a97('0x19')](_0x38c19a);}};}function respondWithFilteredResult(_0x13f0d0,_0x39844d){return function(_0x48cd45){if(_0x48cd45){var _0x1b4fff=typeof _0x39844d['offset']===_0x1a97('0x1a')&&typeof _0x39844d['limit']===_0x1a97('0x1a');var _0x2c8307=_0x48cd45[_0x1a97('0x1b')];var _0x22c936=_0x1b4fff?0x0:_0x39844d['offset'];var _0x5d8b41=_0x1b4fff?_0x48cd45[_0x1a97('0x1b')]:_0x39844d[_0x1a97('0x1c')]+_0x39844d[_0x1a97('0x1d')];var _0x87adbb;if(_0x5d8b41>=_0x2c8307){_0x5d8b41=_0x2c8307;_0x87adbb=0xc8;}else{_0x87adbb=0xce;}_0x13f0d0[_0x1a97('0x17')](_0x87adbb);return _0x13f0d0[_0x1a97('0x1e')](_0x1a97('0x1f'),_0x22c936+'-'+_0x5d8b41+'/'+_0x2c8307)['json'](_0x48cd45);}return null;};}function patchUpdates(_0x3072dd){return function(_0x2a62f7){try{jsonpatch[_0x1a97('0x20')](_0x2a62f7,_0x3072dd,!![]);}catch(_0x310d03){return BPromise[_0x1a97('0x21')](_0x310d03);}return _0x2a62f7[_0x1a97('0x22')]();};}function saveUpdates(_0x59dcf9,_0x439e6a){return function(_0x4ea0b6){if(_0x4ea0b6){return _0x4ea0b6[_0x1a97('0x23')](_0x59dcf9)[_0x1a97('0x24')](function(_0x17591f){return _0x17591f;});}return null;};}function removeEntity(_0x7c3bf8,_0x3a3e33){return function(_0x3419f4){if(_0x3419f4){return _0x3419f4[_0x1a97('0x25')]()['then'](function(){_0x7c3bf8[_0x1a97('0x17')](0xcc)[_0x1a97('0x18')]();});}};}function handleEntityNotFound(_0x1cb987,_0x1dae8e){return function(_0x29cea0){if(!_0x29cea0){_0x1cb987['sendStatus'](0x194);}return _0x29cea0;};}function handleError(_0x52dc95,_0x46a6b7){_0x46a6b7=_0x46a6b7||0x1f4;return function(_0x2654e5){logger[_0x1a97('0x26')](_0x2654e5['stack']);if(_0x2654e5[_0x1a97('0x27')]){delete _0x2654e5[_0x1a97('0x27')];}_0x52dc95[_0x1a97('0x17')](_0x46a6b7)[_0x1a97('0x28')](_0x2654e5);};}exports[_0x1a97('0x29')]=function(_0x246f76,_0x72d78b){var _0x7df129={},_0x58ab5a={},_0x229536={'count':0x0,'rows':[]};var _0x58aa69=_[_0x1a97('0x2a')](db[_0x1a97('0x2b')]['rawAttributes'],function(_0xb3552d){return{'name':_0xb3552d[_0x1a97('0x2c')],'type':_0xb3552d['type'][_0x1a97('0x2d')]};});_0x58ab5a['model']=_[_0x1a97('0x2a')](_0x58aa69,_0x1a97('0x27'));_0x58ab5a[_0x1a97('0x2e')]=_['keys'](_0x246f76['query']);_0x58ab5a['filters']=_[_0x1a97('0x2f')](_0x58ab5a[_0x1a97('0x30')],_0x58ab5a['query']);_0x7df129[_0x1a97('0x31')]=_[_0x1a97('0x2f')](_0x58ab5a[_0x1a97('0x30')],qs['fields'](_0x246f76[_0x1a97('0x2e')][_0x1a97('0x32')]));_0x7df129[_0x1a97('0x31')]=_0x7df129[_0x1a97('0x31')][_0x1a97('0x33')]?_0x7df129[_0x1a97('0x31')]:_0x58ab5a[_0x1a97('0x30')];if(!_0x246f76[_0x1a97('0x2e')][_0x1a97('0x34')](_0x1a97('0x35'))){_0x7df129['limit']=qs[_0x1a97('0x1d')](_0x246f76[_0x1a97('0x2e')][_0x1a97('0x1d')]);_0x7df129[_0x1a97('0x1c')]=qs[_0x1a97('0x1c')](_0x246f76[_0x1a97('0x2e')]['offset']);}_0x7df129['order']=qs[_0x1a97('0x36')](_0x246f76[_0x1a97('0x2e')]['sort']);_0x7df129[_0x1a97('0x37')]=qs[_0x1a97('0x38')](_[_0x1a97('0x39')](_0x246f76[_0x1a97('0x2e')],_0x58ab5a[_0x1a97('0x38')]),_0x58aa69);if(_0x246f76[_0x1a97('0x2e')][_0x1a97('0x3a')]){_0x7df129[_0x1a97('0x37')]=_[_0x1a97('0x3b')](_0x7df129[_0x1a97('0x37')],{'$or':_[_0x1a97('0x2a')](_0x58aa69,function(_0x4df7cc){if(_0x4df7cc[_0x1a97('0x3c')]!==_0x1a97('0x3d')){var _0x5c0b53={};_0x5c0b53[_0x4df7cc[_0x1a97('0x27')]]={'$like':'%'+_0x246f76['query'][_0x1a97('0x3a')]+'%'};return _0x5c0b53;}})});}_0x7df129=_[_0x1a97('0x3b')]({},_0x7df129,_0x246f76['options']);var _0x4961e0={'where':_0x7df129[_0x1a97('0x37')]};return db[_0x1a97('0x2b')][_0x1a97('0x1b')](_0x4961e0)[_0x1a97('0x24')](function(_0x449700){_0x229536['count']=_0x449700;if(_0x246f76[_0x1a97('0x2e')]['includeAll']){_0x7df129['include']=[{'all':!![]}];}return db[_0x1a97('0x2b')]['findAll'](_0x7df129);})[_0x1a97('0x24')](function(_0x97dcb){_0x229536['rows']=_0x97dcb;return _0x229536;})[_0x1a97('0x24')](respondWithFilteredResult(_0x72d78b,_0x7df129))[_0x1a97('0x3e')](handleError(_0x72d78b,null));};exports[_0x1a97('0x3f')]=function(_0x2e7dcd,_0x16b86f){var _0x29f68e={'raw':!![],'where':{'id':_0x2e7dcd[_0x1a97('0x40')]['id']}},_0x16621f={};_0x16621f[_0x1a97('0x30')]=_[_0x1a97('0x41')](db[_0x1a97('0x2b')][_0x1a97('0x42')]);_0x16621f['query']=_[_0x1a97('0x41')](_0x2e7dcd[_0x1a97('0x2e')]);_0x16621f[_0x1a97('0x38')]=_[_0x1a97('0x2f')](_0x16621f[_0x1a97('0x30')],_0x16621f[_0x1a97('0x2e')]);_0x29f68e['attributes']=_[_0x1a97('0x2f')](_0x16621f[_0x1a97('0x30')],qs[_0x1a97('0x32')](_0x2e7dcd[_0x1a97('0x2e')]['fields']));_0x29f68e['attributes']=_0x29f68e['attributes'][_0x1a97('0x33')]?_0x29f68e[_0x1a97('0x31')]:_0x16621f['model'];if(_0x2e7dcd[_0x1a97('0x2e')][_0x1a97('0x43')]){_0x29f68e[_0x1a97('0x44')]=[{'all':!![]}];}_0x29f68e=_[_0x1a97('0x3b')]({},_0x29f68e,_0x2e7dcd[_0x1a97('0x45')]);return db['SalesforceField'][_0x1a97('0x46')](_0x29f68e)[_0x1a97('0x24')](handleEntityNotFound(_0x16b86f,null))[_0x1a97('0x24')](respondWithResult(_0x16b86f,null))[_0x1a97('0x3e')](handleError(_0x16b86f,null));};exports[_0x1a97('0x47')]=function(_0x5dff01,_0x500ce7){return db['SalesforceField'][_0x1a97('0x47')](_0x5dff01[_0x1a97('0x48')],{})[_0x1a97('0x24')](respondWithResult(_0x500ce7,0xc9))[_0x1a97('0x3e')](handleError(_0x500ce7,null));};exports[_0x1a97('0x23')]=function(_0x5d1a42,_0x520b53){if(_0x5d1a42[_0x1a97('0x48')]['id']){delete _0x5d1a42[_0x1a97('0x48')]['id'];}return db['SalesforceField'][_0x1a97('0x46')]({'where':{'id':_0x5d1a42[_0x1a97('0x40')]['id']}})['then'](handleEntityNotFound(_0x520b53,null))['then'](saveUpdates(_0x5d1a42['body'],null))[_0x1a97('0x24')](respondWithResult(_0x520b53,null))['catch'](handleError(_0x520b53,null));};exports['destroy']=function(_0x35fbee,_0x2b2a4f){return db[_0x1a97('0x2b')]['find']({'where':{'id':_0x35fbee[_0x1a97('0x40')]['id']}})[_0x1a97('0x24')](handleEntityNotFound(_0x2b2a4f,null))[_0x1a97('0x24')](removeEntity(_0x2b2a4f,null))[_0x1a97('0x3e')](handleError(_0x2b2a4f,null));}; \ No newline at end of file +var _0xb449=['index','SalesforceField','rawAttributes','fieldName','type','map','query','intersection','model','attributes','fields','length','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','filters','find','create','body','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','error','stack','name','send'];(function(_0xb97c1f,_0x5d3faa){var _0x2458cc=function(_0xf35f31){while(--_0xf35f31){_0xb97c1f['push'](_0xb97c1f['shift']());}};_0x2458cc(++_0x5d3faa);}(_0xb449,0x14f));var _0x9b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb449[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9b44('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b44('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9b44('0x2'));var moment=require(_0x9b44('0x3'));var BPromise=require(_0x9b44('0x4'));var Mustache=require(_0x9b44('0x5'));var util=require(_0x9b44('0x6'));var path=require('path');var sox=require(_0x9b44('0x7'));var csv=require('to-csv');var ejs=require(_0x9b44('0x8'));var fs=require('fs');var fs_extra=require(_0x9b44('0x9'));var _=require(_0x9b44('0xa'));var squel=require(_0x9b44('0xb'));var crypto=require(_0x9b44('0xc'));var jsforce=require(_0x9b44('0xd'));var deskjs=require(_0x9b44('0xe'));var toCsv=require(_0x9b44('0xf'));var querystring=require(_0x9b44('0x10'));var Papa=require(_0x9b44('0x11'));var Redis=require(_0x9b44('0x12'));var authService=require(_0x9b44('0x13'));var qs=require(_0x9b44('0x14'));var as=require(_0x9b44('0x15'));var hardwareService=require(_0x9b44('0x16'));var logger=require(_0x9b44('0x17'))(_0x9b44('0x18'));var utils=require(_0x9b44('0x19'));var config=require(_0x9b44('0x1a'));var licenseUtil=require(_0x9b44('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3631a2,_0x59d1f1){_0x59d1f1=_0x59d1f1||0xcc;return function(_0xad0748){if(_0xad0748){return _0x3631a2[_0x9b44('0x1c')](_0x59d1f1);}return _0x3631a2[_0x9b44('0x1d')](_0x59d1f1)[_0x9b44('0x1e')]();};}function respondWithResult(_0x265556,_0x3c0ebf){_0x3c0ebf=_0x3c0ebf||0xc8;return function(_0x198131){if(_0x198131){return _0x265556[_0x9b44('0x1d')](_0x3c0ebf)[_0x9b44('0x1f')](_0x198131);}};}function respondWithFilteredResult(_0x5b9b97,_0x241c5d){return function(_0x35cf72){if(_0x35cf72){var _0x16de01=typeof _0x241c5d[_0x9b44('0x20')]==='undefined'&&typeof _0x241c5d[_0x9b44('0x21')]===_0x9b44('0x22');var _0x25cb2e=_0x35cf72[_0x9b44('0x23')];var _0x2599f2=_0x16de01?0x0:_0x241c5d[_0x9b44('0x20')];var _0x214842=_0x16de01?_0x35cf72[_0x9b44('0x23')]:_0x241c5d['offset']+_0x241c5d['limit'];var _0x5100f2;if(_0x214842>=_0x25cb2e){_0x214842=_0x25cb2e;_0x5100f2=0xc8;}else{_0x5100f2=0xce;}_0x5b9b97[_0x9b44('0x1d')](_0x5100f2);return _0x5b9b97[_0x9b44('0x24')](_0x9b44('0x25'),_0x2599f2+'-'+_0x214842+'/'+_0x25cb2e)['json'](_0x35cf72);}return null;};}function patchUpdates(_0x460b53){return function(_0x5ddbc8){try{jsonpatch['apply'](_0x5ddbc8,_0x460b53,!![]);}catch(_0x1b13d7){return BPromise['reject'](_0x1b13d7);}return _0x5ddbc8[_0x9b44('0x26')]();};}function saveUpdates(_0x5737df,_0x4dbb7a){return function(_0x1124be){if(_0x1124be){return _0x1124be[_0x9b44('0x27')](_0x5737df)[_0x9b44('0x28')](function(_0x64df90){return _0x64df90;});}return null;};}function removeEntity(_0x47b293,_0x34fc4c){return function(_0x5385a8){if(_0x5385a8){return _0x5385a8['destroy']()[_0x9b44('0x28')](function(){_0x47b293[_0x9b44('0x1d')](0xcc)[_0x9b44('0x1e')]();});}};}function handleEntityNotFound(_0x30b000,_0x1bb7dc){return function(_0x3237a7){if(!_0x3237a7){_0x30b000['sendStatus'](0x194);}return _0x3237a7;};}function handleError(_0x369ab4,_0x3202e6){_0x3202e6=_0x3202e6||0x1f4;return function(_0x2c1756){logger[_0x9b44('0x29')](_0x2c1756[_0x9b44('0x2a')]);if(_0x2c1756[_0x9b44('0x2b')]){delete _0x2c1756[_0x9b44('0x2b')];}_0x369ab4['status'](_0x3202e6)[_0x9b44('0x2c')](_0x2c1756);};}exports[_0x9b44('0x2d')]=function(_0x359d1a,_0x3923f3){var _0x3f9cf6={},_0x12dba5={},_0x402d0d={'count':0x0,'rows':[]};var _0x4d689d=_['map'](db[_0x9b44('0x2e')][_0x9b44('0x2f')],function(_0x429f3a){return{'name':_0x429f3a[_0x9b44('0x30')],'type':_0x429f3a[_0x9b44('0x31')]['key']};});_0x12dba5['model']=_[_0x9b44('0x32')](_0x4d689d,_0x9b44('0x2b'));_0x12dba5[_0x9b44('0x33')]=_['keys'](_0x359d1a[_0x9b44('0x33')]);_0x12dba5['filters']=_[_0x9b44('0x34')](_0x12dba5[_0x9b44('0x35')],_0x12dba5[_0x9b44('0x33')]);_0x3f9cf6[_0x9b44('0x36')]=_[_0x9b44('0x34')](_0x12dba5['model'],qs[_0x9b44('0x37')](_0x359d1a[_0x9b44('0x33')][_0x9b44('0x37')]));_0x3f9cf6[_0x9b44('0x36')]=_0x3f9cf6[_0x9b44('0x36')][_0x9b44('0x38')]?_0x3f9cf6[_0x9b44('0x36')]:_0x12dba5[_0x9b44('0x35')];if(!_0x359d1a['query']['hasOwnProperty']('nolimit')){_0x3f9cf6[_0x9b44('0x21')]=qs['limit'](_0x359d1a[_0x9b44('0x33')][_0x9b44('0x21')]);_0x3f9cf6[_0x9b44('0x20')]=qs[_0x9b44('0x20')](_0x359d1a[_0x9b44('0x33')]['offset']);}_0x3f9cf6['order']=qs['sort'](_0x359d1a['query']['sort']);_0x3f9cf6[_0x9b44('0x39')]=qs['filters'](_[_0x9b44('0x3a')](_0x359d1a[_0x9b44('0x33')],_0x12dba5['filters']),_0x4d689d);if(_0x359d1a['query'][_0x9b44('0x3b')]){_0x3f9cf6[_0x9b44('0x39')]=_[_0x9b44('0x3c')](_0x3f9cf6['where'],{'$or':_[_0x9b44('0x32')](_0x4d689d,function(_0x22ae7e){if(_0x22ae7e[_0x9b44('0x31')]!==_0x9b44('0x3d')){var _0x460422={};_0x460422[_0x22ae7e[_0x9b44('0x2b')]]={'$like':'%'+_0x359d1a[_0x9b44('0x33')][_0x9b44('0x3b')]+'%'};return _0x460422;}})});}_0x3f9cf6=_[_0x9b44('0x3c')]({},_0x3f9cf6,_0x359d1a[_0x9b44('0x3e')]);var _0x384f8e={'where':_0x3f9cf6[_0x9b44('0x39')]};return db['SalesforceField'][_0x9b44('0x23')](_0x384f8e)['then'](function(_0x5ae471){_0x402d0d['count']=_0x5ae471;if(_0x359d1a[_0x9b44('0x33')][_0x9b44('0x3f')]){_0x3f9cf6[_0x9b44('0x40')]=[{'all':!![]}];}return db[_0x9b44('0x2e')][_0x9b44('0x41')](_0x3f9cf6);})['then'](function(_0x1e7ebc){_0x402d0d[_0x9b44('0x42')]=_0x1e7ebc;return _0x402d0d;})[_0x9b44('0x28')](respondWithFilteredResult(_0x3923f3,_0x3f9cf6))[_0x9b44('0x43')](handleError(_0x3923f3,null));};exports[_0x9b44('0x44')]=function(_0x24cb35,_0x3e0a28){var _0x375244={'raw':!![],'where':{'id':_0x24cb35[_0x9b44('0x45')]['id']}},_0x18e11d={};_0x18e11d['model']=_[_0x9b44('0x46')](db[_0x9b44('0x2e')][_0x9b44('0x2f')]);_0x18e11d[_0x9b44('0x33')]=_[_0x9b44('0x46')](_0x24cb35[_0x9b44('0x33')]);_0x18e11d[_0x9b44('0x47')]=_['intersection'](_0x18e11d[_0x9b44('0x35')],_0x18e11d[_0x9b44('0x33')]);_0x375244[_0x9b44('0x36')]=_[_0x9b44('0x34')](_0x18e11d['model'],qs[_0x9b44('0x37')](_0x24cb35[_0x9b44('0x33')]['fields']));_0x375244[_0x9b44('0x36')]=_0x375244[_0x9b44('0x36')]['length']?_0x375244[_0x9b44('0x36')]:_0x18e11d[_0x9b44('0x35')];if(_0x24cb35[_0x9b44('0x33')][_0x9b44('0x3f')]){_0x375244[_0x9b44('0x40')]=[{'all':!![]}];}_0x375244=_[_0x9b44('0x3c')]({},_0x375244,_0x24cb35['options']);return db[_0x9b44('0x2e')][_0x9b44('0x48')](_0x375244)[_0x9b44('0x28')](handleEntityNotFound(_0x3e0a28,null))[_0x9b44('0x28')](respondWithResult(_0x3e0a28,null))[_0x9b44('0x43')](handleError(_0x3e0a28,null));};exports[_0x9b44('0x49')]=function(_0x194d4e,_0x50425f){return db[_0x9b44('0x2e')]['create'](_0x194d4e[_0x9b44('0x4a')],{})['then'](respondWithResult(_0x50425f,0xc9))[_0x9b44('0x43')](handleError(_0x50425f,null));};exports[_0x9b44('0x27')]=function(_0x141cf9,_0x4a89dd){if(_0x141cf9[_0x9b44('0x4a')]['id']){delete _0x141cf9[_0x9b44('0x4a')]['id'];}return db[_0x9b44('0x2e')][_0x9b44('0x48')]({'where':{'id':_0x141cf9[_0x9b44('0x45')]['id']}})['then'](handleEntityNotFound(_0x4a89dd,null))[_0x9b44('0x28')](saveUpdates(_0x141cf9[_0x9b44('0x4a')],null))[_0x9b44('0x28')](respondWithResult(_0x4a89dd,null))[_0x9b44('0x43')](handleError(_0x4a89dd,null));};exports[_0x9b44('0x4b')]=function(_0x4ec6d0,_0x247592){return db[_0x9b44('0x2e')][_0x9b44('0x48')]({'where':{'id':_0x4ec6d0[_0x9b44('0x45')]['id']}})['then'](handleEntityNotFound(_0x247592,null))[_0x9b44('0x28')](removeEntity(_0x247592,null))[_0x9b44('0x43')](handleError(_0x247592,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 62a6ffd..7bdd8ee 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 _0xe126=['int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','exports','define'];(function(_0xb6c8ec,_0x1c78ee){var _0x26752e=function(_0x1dcb7c){while(--_0x1dcb7c){_0xb6c8ec['push'](_0xb6c8ec['shift']());}};_0x26752e(++_0x1c78ee);}(_0xe126,0x19a));var _0x6e12=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xe126[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0x6e12('0x0'));var util=require(_0x6e12('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6e12('0x2'));var BPromise=require(_0x6e12('0x3'));var rp=require(_0x6e12('0x4'));var fs=require('fs');var path=require(_0x6e12('0x5'));var rimraf=require(_0x6e12('0x6'));var config=require('../../config/environment');var attributes=require(_0x6e12('0x7'));module[_0x6e12('0x8')]=function(_0x1c792e,_0x208b6b){return _0x1c792e[_0x6e12('0x9')]('SalesforceField',attributes,{'tableName':_0x6e12('0xa'),'paranoid':![],'indexes':[{'name':_0x6e12('0xb'),'fields':[_0x6e12('0xc'),_0x6e12('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x28eb=['request-promise','path','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','api'];(function(_0x5cc48f,_0x491bad){var _0x23ead9=function(_0x38d773){while(--_0x38d773){_0x5cc48f['push'](_0x5cc48f['shift']());}};_0x23ead9(++_0x491bad);}(_0x28eb,0x1f3));var _0xb28e=function(_0x439c17,_0x8de656){_0x439c17=_0x439c17-0x0;var _0x43d72b=_0x28eb[_0x439c17];return _0x43d72b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb28e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb28e('0x1'));var fs=require('fs');var path=require(_0xb28e('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0xb28e('0x3')]=function(_0x31d99b,_0x1b3f0e){return _0x31d99b[_0xb28e('0x4')](_0xb28e('0x5'),attributes,{'tableName':_0xb28e('0x6'),'paranoid':![],'indexes':[{'name':_0xb28e('0x7'),'fields':[_0xb28e('0x8'),_0xb28e('0x9')],'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 1204a28..93bddb4 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 _0x797c=['message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','http','request','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s'];(function(_0x34d541,_0x2e92cd){var _0x5e85e9=function(_0x3f3ee6){while(--_0x3f3ee6){_0x34d541['push'](_0x34d541['shift']());}};_0x5e85e9(++_0x2e92cd);}(_0x797c,0xfb));var _0xc797=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0x797c[_0x1cd47d];return _0x29d52f;};'use strict';var _=require('lodash');var util=require(_0xc797('0x0'));var moment=require(_0xc797('0x1'));var BPromise=require(_0xc797('0x2'));var rs=require(_0xc797('0x3'));var fs=require('fs');var Redis=require(_0xc797('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc797('0x5'))(_0xc797('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc797('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x284e3f,_0x55fb86,_0x435a02){return new BPromise(function(_0x7b7e4b,_0x4ac300){return client[_0xc797('0x8')](_0x284e3f,_0x435a02)['then'](function(_0x43b3f2){logger['info']('SalesforceField,\x20%s,\x20%s',_0x55fb86,_0xc797('0x9'));logger['debug'](_0xc797('0xa'),_0x55fb86,_0xc797('0x9'),JSON[_0xc797('0xb')](_0x43b3f2));if(_0x43b3f2['error']){if(_0x43b3f2[_0xc797('0xc')][_0xc797('0xd')]===0x1f4){logger[_0xc797('0xc')](_0xc797('0xe'),_0x55fb86,_0x43b3f2[_0xc797('0xc')][_0xc797('0xf')]);return _0x4ac300(_0x43b3f2['error'][_0xc797('0xf')]);}logger[_0xc797('0xc')](_0xc797('0xe'),_0x55fb86,_0x43b3f2['error']['message']);return _0x7b7e4b(_0x43b3f2['error'][_0xc797('0xf')]);}else{logger[_0xc797('0x10')](_0xc797('0xe'),_0x55fb86,_0xc797('0x9'));_0x7b7e4b(_0x43b3f2[_0xc797('0x11')][_0xc797('0xf')]);}})[_0xc797('0x12')](function(_0xbf3718){logger[_0xc797('0xc')]('SalesforceField,\x20%s,\x20%s',_0x55fb86,_0xbf3718);_0x4ac300(_0xbf3718);});});} \ No newline at end of file +var _0x4e33=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','SalesforceField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x545bdf,_0x52d61f){var _0x3070db=function(_0x13ce37){while(--_0x13ce37){_0x545bdf['push'](_0x545bdf['shift']());}};_0x3070db(++_0x52d61f);}(_0x4e33,0x14a));var _0x34e3=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x4e33[_0x4bc65f];return _0x44f85f;};'use strict';var _=require(_0x34e3('0x0'));var util=require(_0x34e3('0x1'));var moment=require(_0x34e3('0x2'));var BPromise=require(_0x34e3('0x3'));var rs=require(_0x34e3('0x4'));var fs=require('fs');var Redis=require(_0x34e3('0x5'));var db=require(_0x34e3('0x6'))['db'];var utils=require(_0x34e3('0x7'));var logger=require(_0x34e3('0x8'))(_0x34e3('0x9'));var config=require(_0x34e3('0xa'));var jayson=require(_0x34e3('0xb'));var client=jayson[_0x34e3('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44d1b8,_0x331171,_0x495e79){return new BPromise(function(_0x45fbd3,_0x7ca341){return client[_0x34e3('0xd')](_0x44d1b8,_0x495e79)['then'](function(_0x231231){logger[_0x34e3('0xe')]('SalesforceField,\x20%s,\x20%s',_0x331171,'request\x20sent');logger[_0x34e3('0xf')](_0x34e3('0x10'),_0x331171,_0x34e3('0x11'),JSON[_0x34e3('0x12')](_0x231231));if(_0x231231[_0x34e3('0x13')]){if(_0x231231['error']['code']===0x1f4){logger[_0x34e3('0x13')]('SalesforceField,\x20%s,\x20%s',_0x331171,_0x231231[_0x34e3('0x13')][_0x34e3('0x14')]);return _0x7ca341(_0x231231['error']['message']);}logger[_0x34e3('0x13')]('SalesforceField,\x20%s,\x20%s',_0x331171,_0x231231['error'][_0x34e3('0x14')]);return _0x45fbd3(_0x231231['error']['message']);}else{logger[_0x34e3('0xe')](_0x34e3('0x15'),_0x331171,_0x34e3('0x11'));_0x45fbd3(_0x231231[_0x34e3('0x16')][_0x34e3('0x14')]);}})[_0x34e3('0x17')](function(_0x5df062){logger[_0x34e3('0x13')](_0x34e3('0x15'),_0x331171,_0x5df062);_0x7ca341(_0x5df062);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index c6df5e1..ee777f9 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 _0x8ec7=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller'];(function(_0x37e81f,_0x4de6ec){var _0x1fade0=function(_0x2eddea){while(--_0x2eddea){_0x37e81f['push'](_0x37e81f['shift']());}};_0x1fade0(++_0x4de6ec);}(_0x8ec7,0x1f1));var _0x78ec=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0x8ec7[_0x48326a];return _0x466709;};'use strict';var multer=require(_0x78ec('0x0'));var util=require(_0x78ec('0x1'));var path=require('path');var timeout=require(_0x78ec('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x78ec('0x3'));var auth=require(_0x78ec('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x78ec('0x5'));var controller=require(_0x78ec('0x6'));router[_0x78ec('0x7')]('/',auth[_0x78ec('0x8')](),controller[_0x78ec('0x9')]);router['get'](_0x78ec('0xa'),auth['isAuthenticated'](),controller[_0x78ec('0xb')]);router[_0x78ec('0x7')](_0x78ec('0xc'),auth['isAuthenticated'](),controller[_0x78ec('0xd')]);router[_0x78ec('0x7')](_0x78ec('0xe'),auth[_0x78ec('0x8')](),controller[_0x78ec('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x78ec('0x10')]);router[_0x78ec('0x11')](_0x78ec('0xc'),auth['isAuthenticated'](),controller[_0x78ec('0x12')]);router[_0x78ec('0x13')](_0x78ec('0xa'),auth[_0x78ec('0x8')](),controller[_0x78ec('0x14')]);router[_0x78ec('0x15')](_0x78ec('0xa'),auth[_0x78ec('0x8')](),controller[_0x78ec('0x16')]);module[_0x78ec('0x17')]=router; \ No newline at end of file +var _0x4c91=['getFields','post','create','addConfiguration','put','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x431d22,_0x2ad56a){var _0x5bb584=function(_0x4f0be0){while(--_0x4f0be0){_0x431d22['push'](_0x431d22['shift']());}};_0x5bb584(++_0x2ad56a);}(_0x4c91,0x161));var _0x14c9=function(_0x49bee1,_0x309ae5){_0x49bee1=_0x49bee1-0x0;var _0x4860cd=_0x4c91[_0x49bee1];return _0x4860cd;};'use strict';var multer=require(_0x14c9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x14c9('0x1'));var express=require(_0x14c9('0x2'));var router=express[_0x14c9('0x3')]();var fs_extra=require(_0x14c9('0x4'));var auth=require(_0x14c9('0x5'));var interaction=require(_0x14c9('0x6'));var config=require('../../config/environment');var controller=require(_0x14c9('0x7'));router[_0x14c9('0x8')]('/',auth[_0x14c9('0x9')](),controller[_0x14c9('0xa')]);router[_0x14c9('0x8')]('/:id',auth[_0x14c9('0x9')](),controller[_0x14c9('0xb')]);router[_0x14c9('0x8')](_0x14c9('0xc'),auth['isAuthenticated'](),controller[_0x14c9('0xd')]);router[_0x14c9('0x8')](_0x14c9('0xe'),auth[_0x14c9('0x9')](),controller[_0x14c9('0xf')]);router[_0x14c9('0x10')]('/',auth[_0x14c9('0x9')](),controller[_0x14c9('0x11')]);router['post']('/:id/configurations',auth[_0x14c9('0x9')](),controller[_0x14c9('0x12')]);router[_0x14c9('0x13')](_0x14c9('0x14'),auth[_0x14c9('0x9')](),controller['update']);router['delete'](_0x14c9('0x14'),auth[_0x14c9('0x9')](),controller[_0x14c9('0x15')]);module[_0x14c9('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 6911176..a98f205 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 _0xafed=['STRING','username','remoteUri'];(function(_0x25e995,_0x143cdc){var _0x446a58=function(_0x545ebc){while(--_0x545ebc){_0x25e995['push'](_0x25e995['shift']());}};_0x446a58(++_0x143cdc);}(_0xafed,0x90));var _0xdafe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xafed[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdafe('0x0')]},'description':{'type':Sequelize[_0xdafe('0x0')]},'username':{'type':Sequelize[_0xdafe('0x0')],'unique':_0xdafe('0x1')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xdafe('0x0')]},'remoteUri':{'type':Sequelize[_0xdafe('0x0')],'unique':_0xdafe('0x2')},'serverUrl':{'type':Sequelize[_0xdafe('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0xf728=['exports','STRING','username','remoteUri','sequelize'];(function(_0x21a14f,_0xcb9c26){var _0x1b1362=function(_0x11a725){while(--_0x11a725){_0x21a14f['push'](_0x21a14f['shift']());}};_0x1b1362(++_0xcb9c26);}(_0xf728,0x108));var _0x8f72=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf728[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x8f72('0x0'));module[_0x8f72('0x1')]={'name':{'type':Sequelize[_0x8f72('0x2')]},'description':{'type':Sequelize[_0x8f72('0x2')]},'username':{'type':Sequelize[_0x8f72('0x2')],'unique':_0x8f72('0x3')},'password':{'type':Sequelize[_0x8f72('0x2')]},'email':{'type':Sequelize[_0x8f72('0x2')]},'remoteUri':{'type':Sequelize[_0x8f72('0x2')],'unique':_0x8f72('0x4')},'serverUrl':{'type':Sequelize[_0x8f72('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 578e02b..d816c35 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 _0x4f38=['destroy','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','body','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','subcategory','close_code','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','reopen_count','sys_tags','correlation_id','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','label','push','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','concat','ServiceNow\x20error:\x20','statusCode','error','test','Wrong\x20credentials','boolean','False','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','catch','create'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x4f38,0x1ef));var _0x84f3=function(_0x43f9ab,_0x277c47){_0x43f9ab=_0x43f9ab-0x0;var _0x2e339a=_0x4f38[_0x43f9ab];return _0x2e339a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x84f3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x84f3('0x1'));var Mustache=require(_0x84f3('0x2'));var util=require(_0x84f3('0x3'));var path=require(_0x84f3('0x4'));var sox=require(_0x84f3('0x5'));var csv=require('to-csv');var ejs=require(_0x84f3('0x6'));var fs=require('fs');var fs_extra=require(_0x84f3('0x7'));var _=require(_0x84f3('0x8'));var squel=require(_0x84f3('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x84f3('0xa'));var Papa=require(_0x84f3('0xb'));var Redis=require(_0x84f3('0xc'));var authService=require(_0x84f3('0xd'));var qs=require(_0x84f3('0xe'));var as=require(_0x84f3('0xf'));var hardwareService=require(_0x84f3('0x10'));var logger=require(_0x84f3('0x11'))(_0x84f3('0x12'));var utils=require(_0x84f3('0x13'));var config=require(_0x84f3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x84f3('0x15'))['db'];var integrations=require(_0x84f3('0x16'));function respondWithStatusCode(_0x2c3b2e,_0x5aea88){_0x5aea88=_0x5aea88||0xcc;return function(_0x476004){if(_0x476004){return _0x2c3b2e[_0x84f3('0x17')](_0x5aea88);}return _0x2c3b2e[_0x84f3('0x18')](_0x5aea88)[_0x84f3('0x19')]();};}function respondWithResult(_0x510b28,_0x14bee3){_0x14bee3=_0x14bee3||0xc8;return function(_0x43665e){if(_0x43665e){return _0x510b28[_0x84f3('0x18')](_0x14bee3)['json'](_0x43665e);}};}function respondWithFilteredResult(_0x5a0e27,_0x1c746e){return function(_0x4041ff){if(_0x4041ff){var _0x4d284f=typeof _0x1c746e[_0x84f3('0x1a')]===_0x84f3('0x1b')&&typeof _0x1c746e[_0x84f3('0x1c')]==='undefined';var _0x4bd63f=_0x4041ff[_0x84f3('0x1d')];var _0x3e20a7=_0x4d284f?0x0:_0x1c746e['offset'];var _0x543cd8=_0x4d284f?_0x4041ff[_0x84f3('0x1d')]:_0x1c746e[_0x84f3('0x1a')]+_0x1c746e[_0x84f3('0x1c')];var _0x5e2d7d;if(_0x543cd8>=_0x4bd63f){_0x543cd8=_0x4bd63f;_0x5e2d7d=0xc8;}else{_0x5e2d7d=0xce;}_0x5a0e27[_0x84f3('0x18')](_0x5e2d7d);return _0x5a0e27['set'](_0x84f3('0x1e'),_0x3e20a7+'-'+_0x543cd8+'/'+_0x4bd63f)[_0x84f3('0x1f')](_0x4041ff);}return null;};}function patchUpdates(_0x5436c3){return function(_0x2c8ae0){try{jsonpatch[_0x84f3('0x20')](_0x2c8ae0,_0x5436c3,!![]);}catch(_0x50f706){return BPromise[_0x84f3('0x21')](_0x50f706);}return _0x2c8ae0[_0x84f3('0x22')]();};}function saveUpdates(_0x1274f6,_0x56083a){return function(_0x474d14){if(_0x474d14){return _0x474d14[_0x84f3('0x23')](_0x1274f6)[_0x84f3('0x24')](function(_0x1b9cb2){return _0x1b9cb2;});}return null;};}function removeEntity(_0x5d84c3,_0x2b5cd9){return function(_0x5cc3ed){if(_0x5cc3ed){return _0x5cc3ed['destroy']()[_0x84f3('0x24')](function(){_0x5d84c3[_0x84f3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4470fc,_0xced51){return function(_0x39097c){if(!_0x39097c){_0x4470fc[_0x84f3('0x17')](0x194);}return _0x39097c;};}function handleError(_0x3212cd,_0x52ceed){_0x52ceed=_0x52ceed||0x1f4;return function(_0x3b74d1){logger['error'](_0x3b74d1[_0x84f3('0x25')]);if(_0x3b74d1[_0x84f3('0x26')]){delete _0x3b74d1[_0x84f3('0x26')];}_0x3212cd['status'](_0x52ceed)[_0x84f3('0x27')](_0x3b74d1);};}exports['index']=function(_0x1690e5,_0x15bc5e){var _0x3f86c7={},_0x5ccb2b={},_0x30580b={'count':0x0,'rows':[]};var _0x79a1d1=_[_0x84f3('0x28')](db[_0x84f3('0x29')][_0x84f3('0x2a')],function(_0x24d3e4){return{'name':_0x24d3e4[_0x84f3('0x2b')],'type':_0x24d3e4[_0x84f3('0x2c')][_0x84f3('0x2d')]};});_0x5ccb2b[_0x84f3('0x2e')]=_[_0x84f3('0x28')](_0x79a1d1,_0x84f3('0x26'));_0x5ccb2b[_0x84f3('0x2f')]=_['keys'](_0x1690e5['query']);_0x5ccb2b[_0x84f3('0x30')]=_[_0x84f3('0x31')](_0x5ccb2b[_0x84f3('0x2e')],_0x5ccb2b[_0x84f3('0x2f')]);_0x3f86c7['attributes']=_['intersection'](_0x5ccb2b[_0x84f3('0x2e')],qs[_0x84f3('0x32')](_0x1690e5[_0x84f3('0x2f')][_0x84f3('0x32')]));_0x3f86c7[_0x84f3('0x33')]=_0x3f86c7[_0x84f3('0x33')][_0x84f3('0x34')]?_0x3f86c7[_0x84f3('0x33')]:_0x5ccb2b[_0x84f3('0x2e')];if(!_0x1690e5['query'][_0x84f3('0x35')](_0x84f3('0x36'))){_0x3f86c7[_0x84f3('0x1c')]=qs[_0x84f3('0x1c')](_0x1690e5['query'][_0x84f3('0x1c')]);_0x3f86c7[_0x84f3('0x1a')]=qs[_0x84f3('0x1a')](_0x1690e5[_0x84f3('0x2f')]['offset']);}_0x3f86c7[_0x84f3('0x37')]=qs[_0x84f3('0x38')](_0x1690e5[_0x84f3('0x2f')][_0x84f3('0x38')]);_0x3f86c7[_0x84f3('0x39')]=qs[_0x84f3('0x30')](_[_0x84f3('0x3a')](_0x1690e5[_0x84f3('0x2f')],_0x5ccb2b[_0x84f3('0x30')]),_0x79a1d1);if(_0x1690e5[_0x84f3('0x2f')][_0x84f3('0x3b')]){_0x3f86c7[_0x84f3('0x39')]=_[_0x84f3('0x3c')](_0x3f86c7[_0x84f3('0x39')],{'$or':_[_0x84f3('0x28')](_0x79a1d1,function(_0x4444df){if(_0x4444df[_0x84f3('0x2c')]!==_0x84f3('0x3d')){var _0x1982c6={};_0x1982c6[_0x4444df[_0x84f3('0x26')]]={'$like':'%'+_0x1690e5[_0x84f3('0x2f')]['filter']+'%'};return _0x1982c6;}})});}_0x3f86c7=_[_0x84f3('0x3c')]({},_0x3f86c7,_0x1690e5[_0x84f3('0x3e')]);var _0x271e16={'where':_0x3f86c7['where']};return db['ServicenowAccount'][_0x84f3('0x1d')](_0x271e16)[_0x84f3('0x24')](function(_0x1c86cf){_0x30580b['count']=_0x1c86cf;if(_0x1690e5['query'][_0x84f3('0x3f')]){_0x3f86c7[_0x84f3('0x40')]=[{'all':!![]}];}return db[_0x84f3('0x29')][_0x84f3('0x41')](_0x3f86c7);})[_0x84f3('0x24')](function(_0x2f234a){_0x30580b['rows']=_0x2f234a;return _0x30580b;})[_0x84f3('0x24')](respondWithFilteredResult(_0x15bc5e,_0x3f86c7))['catch'](handleError(_0x15bc5e,null));};exports[_0x84f3('0x42')]=function(_0x2091f0,_0x4b2d2c){var _0x4e3d04={'raw':![],'where':{'id':_0x2091f0[_0x84f3('0x43')]['id']}},_0xc12bc7={};_0xc12bc7[_0x84f3('0x2e')]=_[_0x84f3('0x44')](db[_0x84f3('0x29')]['rawAttributes']);_0xc12bc7['query']=_[_0x84f3('0x44')](_0x2091f0[_0x84f3('0x2f')]);_0xc12bc7['filters']=_[_0x84f3('0x31')](_0xc12bc7['model'],_0xc12bc7[_0x84f3('0x2f')]);_0x4e3d04[_0x84f3('0x33')]=_['intersection'](_0xc12bc7[_0x84f3('0x2e')],qs[_0x84f3('0x32')](_0x2091f0['query'][_0x84f3('0x32')]));_0x4e3d04[_0x84f3('0x33')]=_0x4e3d04[_0x84f3('0x33')][_0x84f3('0x34')]?_0x4e3d04['attributes']:_0xc12bc7[_0x84f3('0x2e')];if(_0x2091f0[_0x84f3('0x2f')][_0x84f3('0x3f')]){_0x4e3d04['include']=[{'all':!![]}];}_0x4e3d04=_[_0x84f3('0x3c')]({},_0x4e3d04,_0x2091f0[_0x84f3('0x3e')]);return db[_0x84f3('0x29')][_0x84f3('0x45')](_0x4e3d04)[_0x84f3('0x24')](handleEntityNotFound(_0x4b2d2c,null))[_0x84f3('0x24')](respondWithResult(_0x4b2d2c,null))[_0x84f3('0x46')](handleError(_0x4b2d2c,null));};exports[_0x84f3('0x47')]=function(_0x1e7de5,_0x10b04c){return db[_0x84f3('0x29')][_0x84f3('0x47')](_0x1e7de5['body'],{})[_0x84f3('0x24')](respondWithResult(_0x10b04c,0xc9))[_0x84f3('0x46')](handleError(_0x10b04c,null));};exports[_0x84f3('0x23')]=function(_0x14547e,_0x5ca27b){if(_0x14547e['body']['id']){delete _0x14547e['body']['id'];}return db[_0x84f3('0x29')]['find']({'where':{'id':_0x14547e[_0x84f3('0x43')]['id']}})[_0x84f3('0x24')](handleEntityNotFound(_0x5ca27b,null))[_0x84f3('0x24')](saveUpdates(_0x14547e['body'],null))[_0x84f3('0x24')](respondWithResult(_0x5ca27b,null))[_0x84f3('0x46')](handleError(_0x5ca27b,null));};exports[_0x84f3('0x48')]=function(_0xa25419,_0x13d477){return db[_0x84f3('0x29')][_0x84f3('0x45')]({'where':{'id':_0xa25419[_0x84f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x13d477,null))[_0x84f3('0x24')](removeEntity(_0x13d477,null))['catch'](handleError(_0x13d477,null));};exports[_0x84f3('0x49')]=function(_0x305fb3,_0x495f63,_0x1359a){var _0x3b90c1={};var _0x4edf83={};var _0x38c997;var _0x38b294;return db[_0x84f3('0x29')][_0x84f3('0x4a')]({'where':{'id':_0x305fb3[_0x84f3('0x43')]['id']}})[_0x84f3('0x24')](handleEntityNotFound(_0x495f63,null))[_0x84f3('0x24')](function(_0x436613){if(_0x436613){_0x38c997=_0x436613;_0x4edf83[_0x84f3('0x2e')]=_[_0x84f3('0x44')](db[_0x84f3('0x4b')][_0x84f3('0x2a')]);_0x4edf83[_0x84f3('0x2f')]=_[_0x84f3('0x44')](_0x305fb3[_0x84f3('0x2f')]);_0x4edf83[_0x84f3('0x30')]=_[_0x84f3('0x31')](_0x4edf83[_0x84f3('0x2e')],_0x4edf83[_0x84f3('0x2f')]);_0x3b90c1[_0x84f3('0x33')]=_[_0x84f3('0x31')](_0x4edf83['model'],qs[_0x84f3('0x32')](_0x305fb3['query']['fields']));_0x3b90c1[_0x84f3('0x33')]=_0x3b90c1[_0x84f3('0x33')][_0x84f3('0x34')]?_0x3b90c1[_0x84f3('0x33')]:_0x4edf83[_0x84f3('0x2e')];_0x3b90c1[_0x84f3('0x37')]=qs['sort'](_0x305fb3[_0x84f3('0x2f')]['sort']);_0x3b90c1['where']=qs[_0x84f3('0x30')](_[_0x84f3('0x3a')](_0x305fb3[_0x84f3('0x2f')],_0x4edf83['filters']));if(_0x305fb3[_0x84f3('0x2f')]['filter']){_0x3b90c1[_0x84f3('0x39')]=_[_0x84f3('0x3c')](_0x3b90c1['where'],{'$or':_[_0x84f3('0x28')](_0x3b90c1['attributes'],function(_0x359a29){var _0x5baa96={};_0x5baa96[_0x359a29]={'$like':'%'+_0x305fb3[_0x84f3('0x2f')][_0x84f3('0x3b')]+'%'};return _0x5baa96;})});}_0x3b90c1=_['merge']({},_0x3b90c1,_0x305fb3[_0x84f3('0x3e')]);return _0x38c997[_0x84f3('0x49')](_0x3b90c1);}})['then'](function(_0x34de8f){if(_0x34de8f){_0x38b294=_0x34de8f['length'];if(!_0x305fb3[_0x84f3('0x2f')]['hasOwnProperty'](_0x84f3('0x36'))){_0x3b90c1[_0x84f3('0x1c')]=qs[_0x84f3('0x1c')](_0x305fb3[_0x84f3('0x2f')][_0x84f3('0x1c')]);_0x3b90c1[_0x84f3('0x1a')]=qs[_0x84f3('0x1a')](_0x305fb3[_0x84f3('0x2f')][_0x84f3('0x1a')]);}return _0x38c997[_0x84f3('0x49')](_0x3b90c1);}})[_0x84f3('0x24')](function(_0x67ac46){if(_0x67ac46){return _0x67ac46?{'count':_0x38b294,'rows':_0x67ac46}:null;}})[_0x84f3('0x24')](respondWithResult(_0x495f63,null))['catch'](handleError(_0x495f63,null));};exports[_0x84f3('0x4c')]=function(_0x4caf09,_0x2078a2,_0x115a20){if(_0x4caf09[_0x84f3('0x4d')]['id']){delete _0x4caf09[_0x84f3('0x4d')]['id'];}return db[_0x84f3('0x29')]['findOne']({'where':{'id':_0x4caf09[_0x84f3('0x43')]['id']}})[_0x84f3('0x24')](handleEntityNotFound(_0x2078a2,null))['then'](function(_0x1557bf){if(_0x1557bf){_0x4caf09[_0x84f3('0x4d')][_0x84f3('0x4e')]=_0x1557bf['id'];_0x4caf09[_0x84f3('0x4d')][_0x84f3('0x4f')]=integrations[_0x84f3('0x50')](_0x4caf09[_0x84f3('0x4d')][_0x84f3('0x51')],_0x4caf09[_0x84f3('0x4d')][_0x84f3('0x2c')]);_0x4caf09[_0x84f3('0x4d')][_0x84f3('0x52')]=integrations[_0x84f3('0x53')](_0x4caf09[_0x84f3('0x4d')][_0x84f3('0x51')],_0x4caf09[_0x84f3('0x4d')][_0x84f3('0x2c')]);return db['ServicenowConfiguration'][_0x84f3('0x47')](_0x4caf09[_0x84f3('0x4d')],{'include':[{'model':db[_0x84f3('0x54')],'as':'Subjects'},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x84f3('0x24')](respondWithResult(_0x2078a2,null))[_0x84f3('0x46')](handleError(_0x2078a2,null));};exports['getFields']=function(_0x540092,_0xbb8cd8,_0x3a8e21){var _0x447441=[_0x84f3('0x55'),_0x84f3('0x56'),'knowledge',_0x84f3('0x57'),_0x84f3('0x58'),'notify',_0x84f3('0x59'),_0x84f3('0x5a'),_0x84f3('0x5b')];var _0x388e86=[_0x84f3('0x5c'),'made_sla',_0x84f3('0x5d'),_0x84f3('0x5e'),_0x84f3('0x5f'),_0x84f3('0x60'),_0x84f3('0x61'),_0x84f3('0x56'),_0x84f3('0x62'),_0x84f3('0x63'),_0x84f3('0x64'),'sys_updated_by',_0x84f3('0x65'),_0x84f3('0x66'),_0x84f3('0x67'),_0x84f3('0x68'),_0x84f3('0x69'),'sys_created_by','knowledge',_0x84f3('0x37'),_0x84f3('0x6a'),_0x84f3('0x6b'),_0x84f3('0x6c'),_0x84f3('0x6d'),_0x84f3('0x6e'),_0x84f3('0x6f'),'work_notes_list',_0x84f3('0x70'),_0x84f3('0x71'),_0x84f3('0x72'),_0x84f3('0x73'),_0x84f3('0x74'),_0x84f3('0x75'),_0x84f3('0x76'),_0x84f3('0x77'),_0x84f3('0x78'),_0x84f3('0x79'),_0x84f3('0x7a'),_0x84f3('0x7b'),_0x84f3('0x7c'),_0x84f3('0x7d'),_0x84f3('0x57'),_0x84f3('0x7e'),_0x84f3('0x7f'),_0x84f3('0x58'),_0x84f3('0x80'),_0x84f3('0x81'),_0x84f3('0x82'),_0x84f3('0x83'),_0x84f3('0x84'),_0x84f3('0x85'),_0x84f3('0x86'),_0x84f3('0x87'),'notify','sys_class_name',_0x84f3('0x88'),_0x84f3('0x89'),'follow_up','parent_incident',_0x84f3('0x8a'),_0x84f3('0x8b'),_0x84f3('0x8c'),_0x84f3('0x59'),_0x84f3('0x8d'),_0x84f3('0x8e'),_0x84f3('0x8f'),_0x84f3('0x90'),_0x84f3('0x91'),_0x84f3('0x92'),_0x84f3('0x5a'),_0x84f3('0x93'),_0x84f3('0x94'),_0x84f3('0x95'),_0x84f3('0x96'),'due_date','sys_mod_count',_0x84f3('0x97'),_0x84f3('0x98'),'escalation','upon_approval',_0x84f3('0x99'),'location',_0x84f3('0x5b')];var _0x3ecdf6='';var _0x3bb40a='';var _0x1f2e34=[];var _0x29ce8d='';var _0x534bb1='';var _0x15cb12=[];var _0x4f1503='';var _0x2d3ca4='';var _0xab5c32={};var _0x39a3e5='';return db[_0x84f3('0x29')][_0x84f3('0x4a')]({'where':{'id':_0x540092['params']['id']},'attributes':['id','username',_0x84f3('0x9a'),_0x84f3('0x9b'),_0x84f3('0x9c'),_0x84f3('0x9d')]})[_0x84f3('0x24')](handleEntityNotFound(_0xbb8cd8,null))[_0x84f3('0x24')](function(_0x5f2bd1){if(_0x5f2bd1){_0x39a3e5=_0x5f2bd1[_0x84f3('0x9c')];var _0x252714=_0x39a3e5[_0x84f3('0x9e')](-0x1);if(_0x252714==='/'){_0x39a3e5=_0x39a3e5[_0x84f3('0x9f')](0x0,_0x39a3e5[_0x84f3('0xa0')](_0x252714));}_0x2d3ca4=util[_0x84f3('0xa1')](_0x84f3('0xa2'),_0x39a3e5);_0x4f1503=util[_0x84f3('0xa1')](_0x84f3('0xa3'),_0x39a3e5);_0xab5c32={'user':_0x5f2bd1[_0x84f3('0xa4')],'pass':_0x5f2bd1['password']};var _0x1b58d2={'method':'GET','uri':_0x2d3ca4+_0x84f3('0xa5'),'auth':_0xab5c32,'json':!![]};return rp(_0x1b58d2);}})[_0x84f3('0x24')](function(_0xe7f552){if(_0xe7f552[_0x84f3('0xa6')][_0x84f3('0x34')]>0x0){_0x3ecdf6=_0xe7f552[_0x84f3('0xa6')];}console[_0x84f3('0xa7')](_0x84f3('0xa8'),_0x3ecdf6);_0x15cb12=[];_0x3bb40a=Object[_0x84f3('0xa9')]([],_0x3ecdf6);_[_0x84f3('0xaa')](_0x3bb40a,function(_0x222c94){return!_0x447441[_0x84f3('0xab')](_0x222c94[_0x84f3('0x26')]);});_0x3bb40a['forEach'](function(_0x521ffc){var _0x972474=createFieldObject(_0x4f1503,_0xab5c32,_0x521ffc['internalType'],_0x521ffc[_0x84f3('0x26')],_0x521ffc[_0x84f3('0xac')],![]);_0x15cb12[_0x84f3('0xad')](_0x972474);});return Promise['all'](_0x15cb12);})[_0x84f3('0x24')](function(_0xf1fa03){_0x1f2e34=_0xf1fa03;_0x29ce8d=Object[_0x84f3('0xa9')]([],_0x3ecdf6);console['log']('TCL:\x20_object',_0x3ecdf6);_[_0x84f3('0xaa')](_0x29ce8d,function(_0x37de33){return _0x388e86[_0x84f3('0xab')](_0x37de33[_0x84f3('0x26')]);});console[_0x84f3('0xa7')](_0x84f3('0xae'),_0x29ce8d);_0x15cb12=[];_0x29ce8d[_0x84f3('0xaf')](function(_0xa35071){var _0x29ef6d=createFieldObject(_0x4f1503,_0xab5c32,_0xa35071[_0x84f3('0xb0')],_0xa35071[_0x84f3('0x26')],_0xa35071[_0x84f3('0xac')],!![]);_0x15cb12[_0x84f3('0xad')](_0x29ef6d);});return Promise['all'](_0x15cb12);})['then'](function(_0x2709cf){_0x534bb1=_0x2709cf;var _0x1e191a=_0x1f2e34[_0x84f3('0xb1')](_0x534bb1);return{'count':_0x1e191a[_0x84f3('0x34')],'rows':_0x1e191a};})[_0x84f3('0x24')](respondWithResult(_0xbb8cd8,null))[_0x84f3('0x46')](function(_0x4dab2f){console[_0x84f3('0xa7')](_0x84f3('0xb2')+_0x4dab2f);var _0x5f765a=_0x540092['query']['test']?0x1f4:_0x4dab2f[_0x84f3('0xb3')]||0x1f4;logger[_0x84f3('0xb4')](_0x4dab2f[_0x84f3('0x25')]);delete _0x4dab2f[_0x84f3('0x26')];if(_0x5f765a===0x191){_0x5f765a=0x190;}_0xbb8cd8['status'](_0x5f765a)['send'](_0x540092[_0x84f3('0x2f')][_0x84f3('0xb5')]?{'message':_0x84f3('0xb6'),'statusCode':_0x4dab2f['statusCode']}:_0x4dab2f);});};function createFieldObject(_0x2c689b,_0x1ee3a4,_0x3b6bfc,_0x4124be,_0x888976,_0x1e6194){return new Promise(function(_0xb49a50,_0x5c57b3){var _0x31477b={'id':_0x4124be,'name':_0x888976,'custom':_0x1e6194};if(_0x3b6bfc===_0x84f3('0xb7')){_0x31477b[_0x84f3('0x3e')]=[{'name':'True','value':'true'},{'name':_0x84f3('0xb8'),'value':'false'}];_0xb49a50(_0x31477b);}else{var _0x49de70={'method':_0x84f3('0xb9'),'uri':_0x2c689b+_0x84f3('0xba')+_0x4124be,'auth':_0x1ee3a4,'json':!![]};return rp(_0x49de70)[_0x84f3('0x24')](function(_0x3f13d6){var _0x581099=[];if(_0x3f13d6[_0x84f3('0xa6')]['length']>0x0){_0x3f13d6[_0x84f3('0xa6')][_0x84f3('0xaf')](function(_0x4486b4){if(_0x4486b4[_0x84f3('0xbb')]==='false'){var _0x23e9ac={'name':_0x4486b4['label'],'value':_0x4486b4[_0x84f3('0xbc')]};_0x581099[_0x84f3('0xad')](_0x23e9ac);}});}_0x31477b[_0x84f3('0x3e')]=_0x581099;if(_0x31477b[_0x84f3('0x3e')][_0x84f3('0x34')]>0x0){_0xb49a50(_0x31477b);}else{if(_0x1e6194==![]){_0xb49a50();}else{_0xb49a50(_0x31477b);}}});}});} \ No newline at end of file +var _0xbd88=['work_notes','close_code','delivery_task','work_start','business_stc','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','reassignment_count','assigned_to','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','upon_approval','correlation_id','location','password','email','slice','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','label','push','all','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','concat','test','statusCode','error','Wrong\x20credentials','boolean','True','true','False','false','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','stack','name','send','index','map','ServicenowAccount','type','key','query','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','rows','catch','params','keys','rawAttributes','length','merge','create','body','find','destroy','getConfigurations','ServicenowConfiguration','filters','pick','addConfiguration','findOne','AccountId','getSubjects','Descriptions','ServicenowField','Subjects','getFields','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','calendar_stc','closed_at','delivery_plan','impact','active','priority','sys_domain_path','rfc','expected_start','opened_at','group_list','reopened_time','resolved_at'];(function(_0x40d949,_0x218634){var _0x560864=function(_0x4f358b){while(--_0x4f358b){_0x40d949['push'](_0x40d949['shift']());}};_0x560864(++_0x218634);}(_0xbd88,0x190));var _0x8bd8=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xbd88[_0x164eca];return _0x2ce562;};'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(_0x8bd8('0x0'));var moment=require(_0x8bd8('0x1'));var BPromise=require(_0x8bd8('0x2'));var Mustache=require('mustache');var util=require(_0x8bd8('0x3'));var path=require(_0x8bd8('0x4'));var sox=require(_0x8bd8('0x5'));var csv=require(_0x8bd8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8bd8('0x7'));var crypto=require(_0x8bd8('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x8bd8('0x9'));var toCsv=require(_0x8bd8('0x6'));var querystring=require(_0x8bd8('0xa'));var Papa=require(_0x8bd8('0xb'));var Redis=require(_0x8bd8('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x8bd8('0xd'));var as=require(_0x8bd8('0xe'));var hardwareService=require(_0x8bd8('0xf'));var logger=require(_0x8bd8('0x10'))(_0x8bd8('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8bd8('0x12'));var db=require(_0x8bd8('0x13'))['db'];var integrations=require(_0x8bd8('0x14'));function respondWithStatusCode(_0x4b77ec,_0x441909){_0x441909=_0x441909||0xcc;return function(_0x1015ac){if(_0x1015ac){return _0x4b77ec[_0x8bd8('0x15')](_0x441909);}return _0x4b77ec[_0x8bd8('0x16')](_0x441909)[_0x8bd8('0x17')]();};}function respondWithResult(_0x3d021b,_0x3af550){_0x3af550=_0x3af550||0xc8;return function(_0x56a7ec){if(_0x56a7ec){return _0x3d021b[_0x8bd8('0x16')](_0x3af550)['json'](_0x56a7ec);}};}function respondWithFilteredResult(_0x1ffd95,_0x1661d1){return function(_0x1f48d0){if(_0x1f48d0){var _0x3a0793=typeof _0x1661d1[_0x8bd8('0x18')]===_0x8bd8('0x19')&&typeof _0x1661d1[_0x8bd8('0x1a')]===_0x8bd8('0x19');var _0x441993=_0x1f48d0[_0x8bd8('0x1b')];var _0x44eee2=_0x3a0793?0x0:_0x1661d1['offset'];var _0x4a3e45=_0x3a0793?_0x1f48d0[_0x8bd8('0x1b')]:_0x1661d1['offset']+_0x1661d1[_0x8bd8('0x1a')];var _0x599c61;if(_0x4a3e45>=_0x441993){_0x4a3e45=_0x441993;_0x599c61=0xc8;}else{_0x599c61=0xce;}_0x1ffd95['status'](_0x599c61);return _0x1ffd95[_0x8bd8('0x1c')](_0x8bd8('0x1d'),_0x44eee2+'-'+_0x4a3e45+'/'+_0x441993)[_0x8bd8('0x1e')](_0x1f48d0);}return null;};}function patchUpdates(_0x5c2564){return function(_0x700ee0){try{jsonpatch[_0x8bd8('0x1f')](_0x700ee0,_0x5c2564,!![]);}catch(_0x2277d9){return BPromise['reject'](_0x2277d9);}return _0x700ee0[_0x8bd8('0x20')]();};}function saveUpdates(_0xf17aec,_0x292f9d){return function(_0x3d3285){if(_0x3d3285){return _0x3d3285[_0x8bd8('0x21')](_0xf17aec)[_0x8bd8('0x22')](function(_0x31294d){return _0x31294d;});}return null;};}function removeEntity(_0xb2d87f,_0x384058){return function(_0x5118de){if(_0x5118de){return _0x5118de['destroy']()[_0x8bd8('0x22')](function(){_0xb2d87f[_0x8bd8('0x16')](0xcc)[_0x8bd8('0x17')]();});}};}function handleEntityNotFound(_0x2b6d79,_0x380456){return function(_0x112d3c){if(!_0x112d3c){_0x2b6d79[_0x8bd8('0x15')](0x194);}return _0x112d3c;};}function handleError(_0x38f497,_0x4680a2){_0x4680a2=_0x4680a2||0x1f4;return function(_0x3f5548){logger['error'](_0x3f5548[_0x8bd8('0x23')]);if(_0x3f5548[_0x8bd8('0x24')]){delete _0x3f5548[_0x8bd8('0x24')];}_0x38f497[_0x8bd8('0x16')](_0x4680a2)[_0x8bd8('0x25')](_0x3f5548);};}exports[_0x8bd8('0x26')]=function(_0x178d8f,_0x5ad2d5){var _0x2d100a={},_0x3a140d={},_0x18505f={'count':0x0,'rows':[]};var _0x42ebad=_[_0x8bd8('0x27')](db[_0x8bd8('0x28')]['rawAttributes'],function(_0x3a6080){return{'name':_0x3a6080['fieldName'],'type':_0x3a6080[_0x8bd8('0x29')][_0x8bd8('0x2a')]};});_0x3a140d['model']=_['map'](_0x42ebad,_0x8bd8('0x24'));_0x3a140d[_0x8bd8('0x2b')]=_['keys'](_0x178d8f[_0x8bd8('0x2b')]);_0x3a140d['filters']=_['intersection'](_0x3a140d[_0x8bd8('0x2c')],_0x3a140d[_0x8bd8('0x2b')]);_0x2d100a[_0x8bd8('0x2d')]=_[_0x8bd8('0x2e')](_0x3a140d[_0x8bd8('0x2c')],qs[_0x8bd8('0x2f')](_0x178d8f[_0x8bd8('0x2b')][_0x8bd8('0x2f')]));_0x2d100a[_0x8bd8('0x2d')]=_0x2d100a['attributes']['length']?_0x2d100a['attributes']:_0x3a140d[_0x8bd8('0x2c')];if(!_0x178d8f[_0x8bd8('0x2b')][_0x8bd8('0x30')](_0x8bd8('0x31'))){_0x2d100a[_0x8bd8('0x1a')]=qs['limit'](_0x178d8f['query']['limit']);_0x2d100a[_0x8bd8('0x18')]=qs[_0x8bd8('0x18')](_0x178d8f['query']['offset']);}_0x2d100a[_0x8bd8('0x32')]=qs[_0x8bd8('0x33')](_0x178d8f[_0x8bd8('0x2b')]['sort']);_0x2d100a[_0x8bd8('0x34')]=qs['filters'](_['pick'](_0x178d8f[_0x8bd8('0x2b')],_0x3a140d['filters']),_0x42ebad);if(_0x178d8f['query'][_0x8bd8('0x35')]){_0x2d100a[_0x8bd8('0x34')]=_['merge'](_0x2d100a[_0x8bd8('0x34')],{'$or':_[_0x8bd8('0x27')](_0x42ebad,function(_0x534d4f){if(_0x534d4f[_0x8bd8('0x29')]!==_0x8bd8('0x36')){var _0x58bcb5={};_0x58bcb5[_0x534d4f[_0x8bd8('0x24')]]={'$like':'%'+_0x178d8f[_0x8bd8('0x2b')][_0x8bd8('0x35')]+'%'};return _0x58bcb5;}})});}_0x2d100a=_['merge']({},_0x2d100a,_0x178d8f[_0x8bd8('0x37')]);var _0x40b2cd={'where':_0x2d100a[_0x8bd8('0x34')]};return db[_0x8bd8('0x28')][_0x8bd8('0x1b')](_0x40b2cd)[_0x8bd8('0x22')](function(_0x35a462){_0x18505f['count']=_0x35a462;if(_0x178d8f[_0x8bd8('0x2b')][_0x8bd8('0x38')]){_0x2d100a[_0x8bd8('0x39')]=[{'all':!![]}];}return db[_0x8bd8('0x28')]['findAll'](_0x2d100a);})[_0x8bd8('0x22')](function(_0x99054c){_0x18505f[_0x8bd8('0x3a')]=_0x99054c;return _0x18505f;})[_0x8bd8('0x22')](respondWithFilteredResult(_0x5ad2d5,_0x2d100a))[_0x8bd8('0x3b')](handleError(_0x5ad2d5,null));};exports['show']=function(_0x1c1710,_0x188062){var _0x54ce18={'raw':![],'where':{'id':_0x1c1710[_0x8bd8('0x3c')]['id']}},_0x58fa0b={};_0x58fa0b['model']=_[_0x8bd8('0x3d')](db['ServicenowAccount'][_0x8bd8('0x3e')]);_0x58fa0b['query']=_[_0x8bd8('0x3d')](_0x1c1710[_0x8bd8('0x2b')]);_0x58fa0b['filters']=_[_0x8bd8('0x2e')](_0x58fa0b[_0x8bd8('0x2c')],_0x58fa0b[_0x8bd8('0x2b')]);_0x54ce18[_0x8bd8('0x2d')]=_['intersection'](_0x58fa0b['model'],qs[_0x8bd8('0x2f')](_0x1c1710['query'][_0x8bd8('0x2f')]));_0x54ce18[_0x8bd8('0x2d')]=_0x54ce18['attributes'][_0x8bd8('0x3f')]?_0x54ce18[_0x8bd8('0x2d')]:_0x58fa0b['model'];if(_0x1c1710[_0x8bd8('0x2b')][_0x8bd8('0x38')]){_0x54ce18[_0x8bd8('0x39')]=[{'all':!![]}];}_0x54ce18=_[_0x8bd8('0x40')]({},_0x54ce18,_0x1c1710['options']);return db['ServicenowAccount']['find'](_0x54ce18)['then'](handleEntityNotFound(_0x188062,null))[_0x8bd8('0x22')](respondWithResult(_0x188062,null))[_0x8bd8('0x3b')](handleError(_0x188062,null));};exports[_0x8bd8('0x41')]=function(_0x27fce0,_0x4451dc){return db['ServicenowAccount']['create'](_0x27fce0[_0x8bd8('0x42')],{})[_0x8bd8('0x22')](respondWithResult(_0x4451dc,0xc9))[_0x8bd8('0x3b')](handleError(_0x4451dc,null));};exports['update']=function(_0x2beb9f,_0x4b2073){if(_0x2beb9f[_0x8bd8('0x42')]['id']){delete _0x2beb9f[_0x8bd8('0x42')]['id'];}return db['ServicenowAccount'][_0x8bd8('0x43')]({'where':{'id':_0x2beb9f[_0x8bd8('0x3c')]['id']}})[_0x8bd8('0x22')](handleEntityNotFound(_0x4b2073,null))[_0x8bd8('0x22')](saveUpdates(_0x2beb9f['body'],null))[_0x8bd8('0x22')](respondWithResult(_0x4b2073,null))[_0x8bd8('0x3b')](handleError(_0x4b2073,null));};exports[_0x8bd8('0x44')]=function(_0x229fa6,_0x452850){return db[_0x8bd8('0x28')]['find']({'where':{'id':_0x229fa6['params']['id']}})[_0x8bd8('0x22')](handleEntityNotFound(_0x452850,null))[_0x8bd8('0x22')](removeEntity(_0x452850,null))[_0x8bd8('0x3b')](handleError(_0x452850,null));};exports[_0x8bd8('0x45')]=function(_0x2a1bfe,_0x451f3b,_0x5969bc){var _0x5ad8ef={};var _0x76591d={};var _0x3acc46;var _0x59cf63;return db['ServicenowAccount']['findOne']({'where':{'id':_0x2a1bfe['params']['id']}})[_0x8bd8('0x22')](handleEntityNotFound(_0x451f3b,null))[_0x8bd8('0x22')](function(_0x114a85){if(_0x114a85){_0x3acc46=_0x114a85;_0x76591d[_0x8bd8('0x2c')]=_[_0x8bd8('0x3d')](db[_0x8bd8('0x46')][_0x8bd8('0x3e')]);_0x76591d[_0x8bd8('0x2b')]=_[_0x8bd8('0x3d')](_0x2a1bfe[_0x8bd8('0x2b')]);_0x76591d[_0x8bd8('0x47')]=_[_0x8bd8('0x2e')](_0x76591d['model'],_0x76591d[_0x8bd8('0x2b')]);_0x5ad8ef[_0x8bd8('0x2d')]=_[_0x8bd8('0x2e')](_0x76591d[_0x8bd8('0x2c')],qs['fields'](_0x2a1bfe[_0x8bd8('0x2b')]['fields']));_0x5ad8ef[_0x8bd8('0x2d')]=_0x5ad8ef[_0x8bd8('0x2d')]['length']?_0x5ad8ef[_0x8bd8('0x2d')]:_0x76591d[_0x8bd8('0x2c')];_0x5ad8ef[_0x8bd8('0x32')]=qs['sort'](_0x2a1bfe[_0x8bd8('0x2b')][_0x8bd8('0x33')]);_0x5ad8ef['where']=qs[_0x8bd8('0x47')](_[_0x8bd8('0x48')](_0x2a1bfe[_0x8bd8('0x2b')],_0x76591d[_0x8bd8('0x47')]));if(_0x2a1bfe['query'][_0x8bd8('0x35')]){_0x5ad8ef[_0x8bd8('0x34')]=_[_0x8bd8('0x40')](_0x5ad8ef[_0x8bd8('0x34')],{'$or':_[_0x8bd8('0x27')](_0x5ad8ef[_0x8bd8('0x2d')],function(_0xc6c092){var _0x48a0ee={};_0x48a0ee[_0xc6c092]={'$like':'%'+_0x2a1bfe[_0x8bd8('0x2b')]['filter']+'%'};return _0x48a0ee;})});}_0x5ad8ef=_['merge']({},_0x5ad8ef,_0x2a1bfe['options']);return _0x3acc46[_0x8bd8('0x45')](_0x5ad8ef);}})['then'](function(_0x237f50){if(_0x237f50){_0x59cf63=_0x237f50[_0x8bd8('0x3f')];if(!_0x2a1bfe['query']['hasOwnProperty']('nolimit')){_0x5ad8ef[_0x8bd8('0x1a')]=qs[_0x8bd8('0x1a')](_0x2a1bfe[_0x8bd8('0x2b')][_0x8bd8('0x1a')]);_0x5ad8ef[_0x8bd8('0x18')]=qs['offset'](_0x2a1bfe['query']['offset']);}return _0x3acc46['getConfigurations'](_0x5ad8ef);}})['then'](function(_0x223613){if(_0x223613){return _0x223613?{'count':_0x59cf63,'rows':_0x223613}:null;}})[_0x8bd8('0x22')](respondWithResult(_0x451f3b,null))[_0x8bd8('0x3b')](handleError(_0x451f3b,null));};exports[_0x8bd8('0x49')]=function(_0x45905b,_0x2c5312,_0x241295){if(_0x45905b['body']['id']){delete _0x45905b[_0x8bd8('0x42')]['id'];}return db[_0x8bd8('0x28')][_0x8bd8('0x4a')]({'where':{'id':_0x45905b[_0x8bd8('0x3c')]['id']}})[_0x8bd8('0x22')](handleEntityNotFound(_0x2c5312,null))['then'](function(_0x17991b){if(_0x17991b){_0x45905b[_0x8bd8('0x42')][_0x8bd8('0x4b')]=_0x17991b['id'];_0x45905b[_0x8bd8('0x42')]['Subjects']=integrations[_0x8bd8('0x4c')](_0x45905b[_0x8bd8('0x42')]['channel'],_0x45905b[_0x8bd8('0x42')]['type']);_0x45905b[_0x8bd8('0x42')][_0x8bd8('0x4d')]=integrations['getDescriptions'](_0x45905b[_0x8bd8('0x42')]['channel'],_0x45905b['body'][_0x8bd8('0x29')]);return db['ServicenowConfiguration'][_0x8bd8('0x41')](_0x45905b[_0x8bd8('0x42')],{'include':[{'model':db[_0x8bd8('0x4e')],'as':_0x8bd8('0x4f')},{'model':db[_0x8bd8('0x4e')],'as':_0x8bd8('0x4d')}]});}return null;})[_0x8bd8('0x22')](respondWithResult(_0x2c5312,null))['catch'](handleError(_0x2c5312,null));};exports[_0x8bd8('0x50')]=function(_0x3b66b2,_0x29546d,_0x5449f5){var _0x58073a=['made_sla',_0x8bd8('0x51'),_0x8bd8('0x52'),_0x8bd8('0x53'),'close_code',_0x8bd8('0x54'),_0x8bd8('0x55'),_0x8bd8('0x56'),_0x8bd8('0x57')];var _0x248a38=['parent','made_sla',_0x8bd8('0x58'),_0x8bd8('0x59'),'upon_reject',_0x8bd8('0x5a'),_0x8bd8('0x5b'),_0x8bd8('0x51'),_0x8bd8('0x5c'),_0x8bd8('0x5d'),_0x8bd8('0x5e'),_0x8bd8('0x5f'),'opened_by',_0x8bd8('0x60'),_0x8bd8('0x61'),_0x8bd8('0x62'),_0x8bd8('0x63'),'sys_created_by','knowledge',_0x8bd8('0x32'),_0x8bd8('0x64'),_0x8bd8('0x65'),'cmdb_ci',_0x8bd8('0x66'),_0x8bd8('0x67'),_0x8bd8('0x68'),'work_notes_list','business_service',_0x8bd8('0x69'),_0x8bd8('0x6a'),_0x8bd8('0x6b'),'time_worked',_0x8bd8('0x6c'),_0x8bd8('0x6d'),'business_duration',_0x8bd8('0x6e'),'work_end',_0x8bd8('0x6f'),_0x8bd8('0x70'),'caller_id','approval_set',_0x8bd8('0x53'),_0x8bd8('0x71'),'short_description',_0x8bd8('0x72'),'correlation_display',_0x8bd8('0x73'),_0x8bd8('0x74'),'assignment_group',_0x8bd8('0x75'),'additional_assignee_list',_0x8bd8('0x76'),_0x8bd8('0x77'),_0x8bd8('0x54'),'sys_class_name',_0x8bd8('0x78'),_0x8bd8('0x79'),_0x8bd8('0x7a'),_0x8bd8('0x7b'),_0x8bd8('0x7c'),_0x8bd8('0x7d'),_0x8bd8('0x7e'),'incident_state',_0x8bd8('0x7f'),_0x8bd8('0x80'),'company',_0x8bd8('0x81'),'activity_due',_0x8bd8('0x82'),_0x8bd8('0x56'),'comments',_0x8bd8('0x83'),_0x8bd8('0x84'),_0x8bd8('0x85'),_0x8bd8('0x86'),_0x8bd8('0x87'),_0x8bd8('0x88'),'sys_tags','escalation',_0x8bd8('0x89'),_0x8bd8('0x8a'),_0x8bd8('0x8b'),_0x8bd8('0x57')];var _0x1230bc='';var _0x3c7847='';var _0x29c55b=[];var _0x720d52='';var _0x1503ea='';var _0x4177aa=[];var _0x47ec37='';var _0x41b079='';var _0x1a93e2={};var _0x58e991='';return db[_0x8bd8('0x28')]['findOne']({'where':{'id':_0x3b66b2[_0x8bd8('0x3c')]['id']},'attributes':['id','username',_0x8bd8('0x8c'),_0x8bd8('0x8d'),'remoteUri','serverUrl']})['then'](handleEntityNotFound(_0x29546d,null))['then'](function(_0x3e7844){if(_0x3e7844){_0x58e991=_0x3e7844['remoteUri'];var _0x28c93e=_0x58e991[_0x8bd8('0x8e')](-0x1);if(_0x28c93e==='/'){_0x58e991=_0x58e991['substring'](0x0,_0x58e991['lastIndexOf'](_0x28c93e));}_0x41b079=util[_0x8bd8('0x8f')](_0x8bd8('0x90'),_0x58e991);_0x47ec37=util['format'](_0x8bd8('0x91'),_0x58e991);_0x1a93e2={'user':_0x3e7844[_0x8bd8('0x92')],'pass':_0x3e7844[_0x8bd8('0x8c')]};var _0x1f9620={'method':_0x8bd8('0x93'),'uri':_0x41b079+_0x8bd8('0x94'),'auth':_0x1a93e2,'json':!![]};return rp(_0x1f9620);}})[_0x8bd8('0x22')](function(_0x47e384){if(_0x47e384['result'][_0x8bd8('0x3f')]>0x0){_0x1230bc=_0x47e384[_0x8bd8('0x95')];}console['log'](_0x8bd8('0x96'),_0x1230bc);_0x4177aa=[];_0x3c7847=Object[_0x8bd8('0x97')]([],_0x1230bc);_[_0x8bd8('0x98')](_0x3c7847,function(_0x44afb2){return!_0x58073a[_0x8bd8('0x99')](_0x44afb2[_0x8bd8('0x24')]);});_0x3c7847[_0x8bd8('0x9a')](function(_0x1d60ea){var _0xca0da0=createFieldObject(_0x47ec37,_0x1a93e2,_0x1d60ea['internalType'],_0x1d60ea['name'],_0x1d60ea[_0x8bd8('0x9b')],![]);_0x4177aa[_0x8bd8('0x9c')](_0xca0da0);});return Promise[_0x8bd8('0x9d')](_0x4177aa);})[_0x8bd8('0x22')](function(_0x2219c9){_0x29c55b=_0x2219c9;_0x720d52=Object[_0x8bd8('0x97')]([],_0x1230bc);console[_0x8bd8('0x9e')]('TCL:\x20_object',_0x1230bc);_[_0x8bd8('0x98')](_0x720d52,function(_0x5553d5){return _0x248a38[_0x8bd8('0x99')](_0x5553d5[_0x8bd8('0x24')]);});console['log'](_0x8bd8('0x9f'),_0x720d52);_0x4177aa=[];_0x720d52[_0x8bd8('0x9a')](function(_0x59f78d){var _0x53f12c=createFieldObject(_0x47ec37,_0x1a93e2,_0x59f78d[_0x8bd8('0xa0')],_0x59f78d[_0x8bd8('0x24')],_0x59f78d[_0x8bd8('0x9b')],!![]);_0x4177aa[_0x8bd8('0x9c')](_0x53f12c);});return Promise[_0x8bd8('0x9d')](_0x4177aa);})[_0x8bd8('0x22')](function(_0x308ed8){_0x1503ea=_0x308ed8;var _0x57b999=_0x29c55b[_0x8bd8('0xa1')](_0x1503ea);return{'count':_0x57b999[_0x8bd8('0x3f')],'rows':_0x57b999};})[_0x8bd8('0x22')](respondWithResult(_0x29546d,null))[_0x8bd8('0x3b')](function(_0x41236d){console[_0x8bd8('0x9e')]('ServiceNow\x20error:\x20'+_0x41236d);var _0x397269=_0x3b66b2[_0x8bd8('0x2b')][_0x8bd8('0xa2')]?0x1f4:_0x41236d[_0x8bd8('0xa3')]||0x1f4;logger[_0x8bd8('0xa4')](_0x41236d[_0x8bd8('0x23')]);delete _0x41236d[_0x8bd8('0x24')];if(_0x397269===0x191){_0x397269=0x190;}_0x29546d[_0x8bd8('0x16')](_0x397269)[_0x8bd8('0x25')](_0x3b66b2[_0x8bd8('0x2b')]['test']?{'message':_0x8bd8('0xa5'),'statusCode':_0x41236d[_0x8bd8('0xa3')]}:_0x41236d);});};function createFieldObject(_0x5e410c,_0x5169f0,_0xcb5294,_0x11bc01,_0x1bf806,_0x512197){return new Promise(function(_0x22bae2,_0x3dc27c){var _0x2c902e={'id':_0x11bc01,'name':_0x1bf806,'custom':_0x512197};if(_0xcb5294===_0x8bd8('0xa6')){_0x2c902e[_0x8bd8('0x37')]=[{'name':_0x8bd8('0xa7'),'value':_0x8bd8('0xa8')},{'name':_0x8bd8('0xa9'),'value':'false'}];_0x22bae2(_0x2c902e);}else{var _0x5a795a={'method':'GET','uri':_0x5e410c+'sys_choice?sysparm_query=name=incident^element='+_0x11bc01,'auth':_0x5169f0,'json':!![]};return rp(_0x5a795a)[_0x8bd8('0x22')](function(_0x504e93){var _0x568079=[];if(_0x504e93[_0x8bd8('0x95')][_0x8bd8('0x3f')]>0x0){_0x504e93[_0x8bd8('0x95')][_0x8bd8('0x9a')](function(_0x57192f){if(_0x57192f['inactive']===_0x8bd8('0xaa')){var _0x34c4e6={'name':_0x57192f[_0x8bd8('0x9b')],'value':_0x57192f['value']};_0x568079[_0x8bd8('0x9c')](_0x34c4e6);}});}_0x2c902e[_0x8bd8('0x37')]=_0x568079;if(_0x2c902e['options'][_0x8bd8('0x3f')]>0x0){_0x22bae2(_0x2c902e);}else{if(_0x512197==![]){_0x22bae2();}else{_0x22bae2(_0x2c902e);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index e535a86..b8ba656 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 _0x2bd8=['bluebird','request-promise','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment'];(function(_0x5e04e2,_0x3454f9){var _0x19b33c=function(_0x4ab476){while(--_0x4ab476){_0x5e04e2['push'](_0x5e04e2['shift']());}};_0x19b33c(++_0x3454f9);}(_0x2bd8,0x130));var _0x82bd=function(_0x2f16dd,_0xc4124b){_0x2f16dd=_0x2f16dd-0x0;var _0x4fc274=_0x2bd8[_0x2f16dd];return _0x4fc274;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var logger=require(_0x82bd('0x1'))(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var BPromise=require(_0x82bd('0x4'));var rp=require(_0x82bd('0x5'));var fs=require('fs');var path=require(_0x82bd('0x6'));var rimraf=require(_0x82bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x82bd('0x8'));var integrations=require(_0x82bd('0x9'));module[_0x82bd('0xa')]=function(_0x5ceb60,_0x19dbb1){return _0x5ceb60[_0x82bd('0xb')](_0x82bd('0xc'),attributes,{'tableName':_0x82bd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['api','moment','bluebird','request-promise','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger'];(function(_0x228eb4,_0x1cb31a){var _0x5bd0d8=function(_0xc81601){while(--_0xc81601){_0x228eb4['push'](_0x228eb4['shift']());}};_0x5bd0d8(++_0x1cb31a);}(_0x7217,0x19e));var _0x7721=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x7217[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));var integrations=require(_0x7721('0x8'));module[_0x7721('0x9')]=function(_0xb239e0,_0xf7ff37){return _0xb239e0[_0x7721('0xa')](_0x7721('0xb'),attributes,{'tableName':_0x7721('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 099aac4..adb7df7 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 _0x8796=['ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','include','map','model','ShowServicenowAccount','find','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x672e63,_0x5151b4){var _0x34aaa2=function(_0x30bfed){while(--_0x30bfed){_0x672e63['push'](_0x672e63['shift']());}};_0x34aaa2(++_0x5151b4);}(_0x8796,0x71));var _0x6879=function(_0x4eca44,_0x3482ee){_0x4eca44=_0x4eca44-0x0;var _0x1a8b00=_0x8796[_0x4eca44];return _0x1a8b00;};'use strict';var _=require(_0x6879('0x0'));var util=require(_0x6879('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6879('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6879('0x3'))['db'];var utils=require(_0x6879('0x4'));var logger=require(_0x6879('0x5'))('rpc');var config=require(_0x6879('0x6'));var jayson=require(_0x6879('0x7'));var client=jayson['client'][_0x6879('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a08ad,_0x454a78,_0x5bd503){return new BPromise(function(_0x151abe,_0x294e3b){return client[_0x6879('0x9')](_0x1a08ad,_0x5bd503)[_0x6879('0xa')](function(_0x5bbc2f){logger[_0x6879('0xb')](_0x6879('0xc'),_0x454a78,_0x6879('0xd'));logger[_0x6879('0xe')](_0x6879('0xf'),_0x454a78,'request\x20sent',JSON[_0x6879('0x10')](_0x5bbc2f));if(_0x5bbc2f['error']){if(_0x5bbc2f[_0x6879('0x11')][_0x6879('0x12')]===0x1f4){logger[_0x6879('0x11')](_0x6879('0xc'),_0x454a78,_0x5bbc2f['error'][_0x6879('0x13')]);return _0x294e3b(_0x5bbc2f[_0x6879('0x11')][_0x6879('0x13')]);}logger['error'](_0x6879('0xc'),_0x454a78,_0x5bbc2f[_0x6879('0x11')]['message']);return _0x151abe(_0x5bbc2f['error'][_0x6879('0x13')]);}else{logger['info'](_0x6879('0xc'),_0x454a78,_0x6879('0xd'));_0x151abe(_0x5bbc2f['result'][_0x6879('0x13')]);}})[_0x6879('0x14')](function(_0x56466d){logger[_0x6879('0x11')](_0x6879('0xc'),_0x454a78,_0x56466d);_0x294e3b(_0x56466d);});});}exports[_0x6879('0x15')]=function(_0x3ac073){var _0x79abf3=this;return new Promise(function(_0x1a87f2,_0x214980){return db[_0x6879('0x16')]['findAll']({'raw':_0x3ac073[_0x6879('0x17')]?_0x3ac073['options'][_0x6879('0x18')]===undefined?!![]:![]:!![],'where':_0x3ac073[_0x6879('0x17')]?_0x3ac073[_0x6879('0x17')][_0x6879('0x19')]||null:null,'attributes':_0x3ac073[_0x6879('0x17')]?_0x3ac073[_0x6879('0x17')][_0x6879('0x1a')]||null:null,'limit':_0x3ac073[_0x6879('0x17')]?_0x3ac073[_0x6879('0x17')]['limit']||null:null,'include':_0x3ac073[_0x6879('0x17')]?_0x3ac073[_0x6879('0x17')][_0x6879('0x1b')]?_[_0x6879('0x1c')](_0x3ac073['options'][_0x6879('0x1b')],function(_0x4968ce){return{'model':db[_0x4968ce[_0x6879('0x1d')]],'as':_0x4968ce['as'],'attributes':_0x4968ce[_0x6879('0x1a')],'include':_0x4968ce[_0x6879('0x1b')]?_[_0x6879('0x1c')](_0x4968ce['include'],function(_0x45515c){return{'model':db[_0x45515c[_0x6879('0x1d')]],'as':_0x45515c['as'],'attributes':_0x45515c[_0x6879('0x1a')],'include':_0x45515c[_0x6879('0x1b')]?_[_0x6879('0x1c')](_0x45515c[_0x6879('0x1b')],function(_0x45c082){return{'model':db[_0x45c082[_0x6879('0x1d')]],'as':_0x45c082['as'],'attributes':_0x45c082[_0x6879('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6879('0xa')](function(_0x33d105){logger[_0x6879('0xb')](_0x6879('0x15'),_0x3ac073);logger[_0x6879('0xe')](_0x6879('0x15'),_0x3ac073,JSON[_0x6879('0x10')](_0x33d105));_0x1a87f2(_0x33d105);})[_0x6879('0x14')](function(_0x51843a){logger[_0x6879('0x11')](_0x6879('0x15'),_0x51843a['message'],_0x3ac073);_0x214980(_0x79abf3['error'](0x1f4,_0x51843a['message']));});});};exports[_0x6879('0x1e')]=function(_0x5875f0){var _0x3feafe=this;return new Promise(function(_0x512c03,_0x4cfd20){return db[_0x6879('0x16')][_0x6879('0x1f')]({'raw':_0x5875f0['options']?_0x5875f0[_0x6879('0x17')][_0x6879('0x18')]===undefined?!![]:![]:!![],'where':_0x5875f0[_0x6879('0x17')]?_0x5875f0[_0x6879('0x17')]['where']||null:null,'attributes':_0x5875f0['options']?_0x5875f0['options'][_0x6879('0x1a')]||null:null,'include':_0x5875f0[_0x6879('0x17')]?_0x5875f0[_0x6879('0x17')][_0x6879('0x1b')]?_[_0x6879('0x1c')](_0x5875f0[_0x6879('0x17')][_0x6879('0x1b')],function(_0x392ff3){return{'model':db[_0x392ff3[_0x6879('0x1d')]],'as':_0x392ff3['as'],'attributes':_0x392ff3[_0x6879('0x1a')],'include':_0x392ff3[_0x6879('0x1b')]?_[_0x6879('0x1c')](_0x392ff3[_0x6879('0x1b')],function(_0x154447){return{'model':db[_0x154447['model']],'as':_0x154447['as'],'attributes':_0x154447[_0x6879('0x1a')],'include':_0x154447['include']?_[_0x6879('0x1c')](_0x154447[_0x6879('0x1b')],function(_0x42c08d){return{'model':db[_0x42c08d[_0x6879('0x1d')]],'as':_0x42c08d['as'],'attributes':_0x42c08d['attributes']};}):[]};}):[]};}):[]:[]})[_0x6879('0xa')](function(_0x1eeab5){logger[_0x6879('0xb')](_0x6879('0x1e'),_0x5875f0);logger[_0x6879('0xe')]('ShowServicenowAccount',_0x5875f0,JSON['stringify'](_0x1eeab5));_0x512c03(_0x1eeab5);})['catch'](function(_0x57af27){logger[_0x6879('0x11')](_0x6879('0x1e'),_0x57af27[_0x6879('0x13')],_0x5875f0);_0x4cfd20(_0x3feafe[_0x6879('0x11')](0x1f4,_0x57af27[_0x6879('0x13')]));});});}; \ No newline at end of file +var _0x510c=['message','info','catch','GetServicenowAccount','findAll','options','raw','where','attributes','include','map','model','then','ShowServicenowAccount','ServicenowAccount','find','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request\x20sent','debug','stringify','error','code','ServicenowAccount,\x20%s,\x20%s'];(function(_0x4ed145,_0x2c6f11){var _0x1943e7=function(_0x288002){while(--_0x288002){_0x4ed145['push'](_0x4ed145['shift']());}};_0x1943e7(++_0x2c6f11);}(_0x510c,0x88));var _0xc510=function(_0x5cb16a,_0x1be389){_0x5cb16a=_0x5cb16a-0x0;var _0x268649=_0x510c[_0x5cb16a];return _0x268649;};'use strict';var _=require('lodash');var util=require(_0xc510('0x0'));var moment=require(_0xc510('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc510('0x2'));var db=require(_0xc510('0x3'))['db'];var utils=require(_0xc510('0x4'));var logger=require('../../config/logger')(_0xc510('0x5'));var config=require(_0xc510('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc510('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1fe051,_0x2c3ce4,_0xdda155){return new BPromise(function(_0x6ea460,_0x421b36){return client['request'](_0x1fe051,_0xdda155)['then'](function(_0x3d3fa3){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x2c3ce4,_0xc510('0x8'));logger[_0xc510('0x9')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x2c3ce4,_0xc510('0x8'),JSON[_0xc510('0xa')](_0x3d3fa3));if(_0x3d3fa3[_0xc510('0xb')]){if(_0x3d3fa3[_0xc510('0xb')][_0xc510('0xc')]===0x1f4){logger[_0xc510('0xb')](_0xc510('0xd'),_0x2c3ce4,_0x3d3fa3[_0xc510('0xb')][_0xc510('0xe')]);return _0x421b36(_0x3d3fa3[_0xc510('0xb')][_0xc510('0xe')]);}logger[_0xc510('0xb')](_0xc510('0xd'),_0x2c3ce4,_0x3d3fa3['error'][_0xc510('0xe')]);return _0x6ea460(_0x3d3fa3[_0xc510('0xb')][_0xc510('0xe')]);}else{logger[_0xc510('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x2c3ce4,'request\x20sent');_0x6ea460(_0x3d3fa3['result']['message']);}})[_0xc510('0x10')](function(_0x44d919){logger[_0xc510('0xb')](_0xc510('0xd'),_0x2c3ce4,_0x44d919);_0x421b36(_0x44d919);});});}exports[_0xc510('0x11')]=function(_0xc88f36){var _0x28a74e=this;return new Promise(function(_0x4723fb,_0x1caec8){return db['ServicenowAccount'][_0xc510('0x12')]({'raw':_0xc88f36[_0xc510('0x13')]?_0xc88f36[_0xc510('0x13')][_0xc510('0x14')]===undefined?!![]:![]:!![],'where':_0xc88f36[_0xc510('0x13')]?_0xc88f36[_0xc510('0x13')][_0xc510('0x15')]||null:null,'attributes':_0xc88f36[_0xc510('0x13')]?_0xc88f36[_0xc510('0x13')][_0xc510('0x16')]||null:null,'limit':_0xc88f36['options']?_0xc88f36[_0xc510('0x13')]['limit']||null:null,'include':_0xc88f36[_0xc510('0x13')]?_0xc88f36[_0xc510('0x13')][_0xc510('0x17')]?_[_0xc510('0x18')](_0xc88f36['options']['include'],function(_0x2f682c){return{'model':db[_0x2f682c[_0xc510('0x19')]],'as':_0x2f682c['as'],'attributes':_0x2f682c['attributes'],'include':_0x2f682c[_0xc510('0x17')]?_[_0xc510('0x18')](_0x2f682c['include'],function(_0x41dc2c){return{'model':db[_0x41dc2c[_0xc510('0x19')]],'as':_0x41dc2c['as'],'attributes':_0x41dc2c[_0xc510('0x16')],'include':_0x41dc2c[_0xc510('0x17')]?_[_0xc510('0x18')](_0x41dc2c[_0xc510('0x17')],function(_0xc11617){return{'model':db[_0xc11617[_0xc510('0x19')]],'as':_0xc11617['as'],'attributes':_0xc11617['attributes']};}):[]};}):[]};}):[]:[]})[_0xc510('0x1a')](function(_0x36d6ff){logger[_0xc510('0xf')]('GetServicenowAccount',_0xc88f36);logger[_0xc510('0x9')](_0xc510('0x11'),_0xc88f36,JSON[_0xc510('0xa')](_0x36d6ff));_0x4723fb(_0x36d6ff);})[_0xc510('0x10')](function(_0x3d53a6){logger[_0xc510('0xb')](_0xc510('0x11'),_0x3d53a6[_0xc510('0xe')],_0xc88f36);_0x1caec8(_0x28a74e[_0xc510('0xb')](0x1f4,_0x3d53a6[_0xc510('0xe')]));});});};exports[_0xc510('0x1b')]=function(_0x1d3f2a){var _0x1aa948=this;return new Promise(function(_0x3f6ac2,_0x52af93){return db[_0xc510('0x1c')][_0xc510('0x1d')]({'raw':_0x1d3f2a[_0xc510('0x13')]?_0x1d3f2a[_0xc510('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x1d3f2a['options']?_0x1d3f2a[_0xc510('0x13')]['where']||null:null,'attributes':_0x1d3f2a[_0xc510('0x13')]?_0x1d3f2a[_0xc510('0x13')]['attributes']||null:null,'include':_0x1d3f2a[_0xc510('0x13')]?_0x1d3f2a[_0xc510('0x13')][_0xc510('0x17')]?_['map'](_0x1d3f2a[_0xc510('0x13')][_0xc510('0x17')],function(_0x2ffcbc){return{'model':db[_0x2ffcbc[_0xc510('0x19')]],'as':_0x2ffcbc['as'],'attributes':_0x2ffcbc[_0xc510('0x16')],'include':_0x2ffcbc[_0xc510('0x17')]?_['map'](_0x2ffcbc[_0xc510('0x17')],function(_0x163a91){return{'model':db[_0x163a91[_0xc510('0x19')]],'as':_0x163a91['as'],'attributes':_0x163a91[_0xc510('0x16')],'include':_0x163a91[_0xc510('0x17')]?_['map'](_0x163a91[_0xc510('0x17')],function(_0x59dffe){return{'model':db[_0x59dffe[_0xc510('0x19')]],'as':_0x59dffe['as'],'attributes':_0x59dffe[_0xc510('0x16')]};}):[]};}):[]};}):[]:[]})[_0xc510('0x1a')](function(_0x2bd25c){logger[_0xc510('0xf')](_0xc510('0x1b'),_0x1d3f2a);logger[_0xc510('0x9')](_0xc510('0x1b'),_0x1d3f2a,JSON[_0xc510('0xa')](_0x2bd25c));_0x3f6ac2(_0x2bd25c);})[_0xc510('0x10')](function(_0x2ed328){logger['error']('ShowServicenowAccount',_0x2ed328[_0xc510('0xe')],_0x1d3f2a);_0x52af93(_0x1aa948[_0xc510('0xb')](0x1f4,_0x2ed328[_0xc510('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 32a4772..68fb97c 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 _0xecdf=['getSubjects','/:id/descriptions','getDescriptions','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects'];(function(_0x2f9762,_0x1c251e){var _0x17b6ae=function(_0x50de8f){while(--_0x50de8f){_0x2f9762['push'](_0x2f9762['shift']());}};_0x17b6ae(++_0x1c251e);}(_0xecdf,0x198));var _0xfecd=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xecdf[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xfecd('0x0'));var util=require(_0xfecd('0x1'));var path=require(_0xfecd('0x2'));var timeout=require(_0xfecd('0x3'));var express=require(_0xfecd('0x4'));var router=express[_0xfecd('0x5')]();var fs_extra=require(_0xfecd('0x6'));var auth=require(_0xfecd('0x7'));var interaction=require(_0xfecd('0x8'));var config=require(_0xfecd('0x9'));var controller=require('./intServicenowConfiguration.controller');router[_0xfecd('0xa')]('/',auth[_0xfecd('0xb')](),controller[_0xfecd('0xc')]);router[_0xfecd('0xa')](_0xfecd('0xd'),auth[_0xfecd('0xb')](),controller[_0xfecd('0xe')]);router[_0xfecd('0xa')](_0xfecd('0xf'),auth[_0xfecd('0xb')](),controller['getFields']);router['get'](_0xfecd('0x10'),auth[_0xfecd('0xb')](),controller[_0xfecd('0x11')]);router[_0xfecd('0xa')](_0xfecd('0x12'),auth['isAuthenticated'](),controller[_0xfecd('0x13')]);router[_0xfecd('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfecd('0x15')](_0xfecd('0xd'),auth[_0xfecd('0xb')](),controller[_0xfecd('0x16')]);router['delete'](_0xfecd('0xd'),auth['isAuthenticated'](),controller[_0xfecd('0x17')]);module[_0xfecd('0x18')]=router; \ No newline at end of file +var _0x2fd0=['index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated'];(function(_0x3ea05d,_0x43f0fd){var _0x403fe6=function(_0x4a89aa){while(--_0x4a89aa){_0x3ea05d['push'](_0x3ea05d['shift']());}};_0x403fe6(++_0x43f0fd);}(_0x2fd0,0x69));var _0x02fd=function(_0x3053a6,_0x4faaba){_0x3053a6=_0x3053a6-0x0;var _0x185913=_0x2fd0[_0x3053a6];return _0x185913;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x02fd('0x0'));var express=require(_0x02fd('0x1'));var router=express[_0x02fd('0x2')]();var fs_extra=require(_0x02fd('0x3'));var auth=require(_0x02fd('0x4'));var interaction=require(_0x02fd('0x5'));var config=require(_0x02fd('0x6'));var controller=require(_0x02fd('0x7'));router[_0x02fd('0x8')]('/',auth[_0x02fd('0x9')](),controller[_0x02fd('0xa')]);router[_0x02fd('0x8')](_0x02fd('0xb'),auth[_0x02fd('0x9')](),controller[_0x02fd('0xc')]);router[_0x02fd('0x8')](_0x02fd('0xd'),auth[_0x02fd('0x9')](),controller['getFields']);router[_0x02fd('0x8')](_0x02fd('0xe'),auth['isAuthenticated'](),controller[_0x02fd('0xf')]);router['get'](_0x02fd('0x10'),auth[_0x02fd('0x9')](),controller[_0x02fd('0x11')]);router[_0x02fd('0x12')]('/',auth[_0x02fd('0x9')](),controller[_0x02fd('0x13')]);router['put']('/:id',auth[_0x02fd('0x9')](),controller[_0x02fd('0x14')]);router[_0x02fd('0x15')](_0x02fd('0xb'),auth['isAuthenticated'](),controller[_0x02fd('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 3faf76c..cc36aad 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 _0x6b80=['exports','STRING','sequelize'];(function(_0x1f76fb,_0x1efac4){var _0x2d82e5=function(_0x2ae07d){while(--_0x2ae07d){_0x1f76fb['push'](_0x1f76fb['shift']());}};_0x2d82e5(++_0x1efac4);}(_0x6b80,0x110));var _0x06b8=function(_0x528bb5,_0x119c5b){_0x528bb5=_0x528bb5-0x0;var _0x58e8ca=_0x6b80[_0x528bb5];return _0x58e8ca;};'use strict';var Sequelize=require(_0x06b8('0x0'));module[_0x06b8('0x1')]={'name':{'type':Sequelize[_0x06b8('0x2')]},'description':{'type':Sequelize[_0x06b8('0x2')]}}; \ No newline at end of file +var _0xe174=['sequelize','exports','STRING'];(function(_0x4f6b51,_0x3d1d2f){var _0x53a364=function(_0x31a281){while(--_0x31a281){_0x4f6b51['push'](_0x4f6b51['shift']());}};_0x53a364(++_0x3d1d2f);}(_0xe174,0x129));var _0x4e17=function(_0x599d6b,_0x50b07d){_0x599d6b=_0x599d6b-0x0;var _0x38cac5=_0xe174[_0x599d6b];return _0x38cac5;};'use strict';var Sequelize=require(_0x4e17('0x0'));module[_0x4e17('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4e17('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index a75ccf7..077dda6 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 _0x5fb0=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','map','fieldName','type','model','query','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','ServicenowConfiguration','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','fields','length','create','body','find','getFields','findOne','ServicenowField','getSubjects','options','nolimit','getDescriptions','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x448e92,_0x4273c8){var _0x37c4c3=function(_0x417e58){while(--_0x417e58){_0x448e92['push'](_0x448e92['shift']());}};_0x37c4c3(++_0x4273c8);}(_0x5fb0,0x8b));var _0x05fb=function(_0x525f61,_0x352690){_0x525f61=_0x525f61-0x0;var _0x197ab2=_0x5fb0[_0x525f61];return _0x197ab2;};'use strict';var emlformat=require(_0x05fb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x05fb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05fb('0x2'));var moment=require('moment');var BPromise=require(_0x05fb('0x3'));var Mustache=require(_0x05fb('0x4'));var util=require(_0x05fb('0x5'));var path=require(_0x05fb('0x6'));var sox=require(_0x05fb('0x7'));var csv=require(_0x05fb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x05fb('0x9'));var _=require(_0x05fb('0xa'));var squel=require('squel');var crypto=require(_0x05fb('0xb'));var jsforce=require(_0x05fb('0xc'));var deskjs=require(_0x05fb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x05fb('0xe'));var Papa=require(_0x05fb('0xf'));var Redis=require(_0x05fb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x05fb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05fb('0x12'));var logger=require(_0x05fb('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x05fb('0x14'))['db'];function respondWithStatusCode(_0x2fc54b,_0x107474){_0x107474=_0x107474||0xcc;return function(_0x358af8){if(_0x358af8){return _0x2fc54b['sendStatus'](_0x107474);}return _0x2fc54b['status'](_0x107474)['end']();};}function respondWithResult(_0x5647b2,_0x5cf522){_0x5cf522=_0x5cf522||0xc8;return function(_0x58d814){if(_0x58d814){return _0x5647b2[_0x05fb('0x15')](_0x5cf522)[_0x05fb('0x16')](_0x58d814);}};}function respondWithFilteredResult(_0x334e89,_0x3f88c8){return function(_0x26cc68){if(_0x26cc68){var _0x669a68=typeof _0x3f88c8[_0x05fb('0x17')]===_0x05fb('0x18')&&typeof _0x3f88c8[_0x05fb('0x19')]===_0x05fb('0x18');var _0x157cf1=_0x26cc68[_0x05fb('0x1a')];var _0x43f908=_0x669a68?0x0:_0x3f88c8[_0x05fb('0x17')];var _0x4c5113=_0x669a68?_0x26cc68['count']:_0x3f88c8[_0x05fb('0x17')]+_0x3f88c8[_0x05fb('0x19')];var _0x42aeb9;if(_0x4c5113>=_0x157cf1){_0x4c5113=_0x157cf1;_0x42aeb9=0xc8;}else{_0x42aeb9=0xce;}_0x334e89[_0x05fb('0x15')](_0x42aeb9);return _0x334e89[_0x05fb('0x1b')](_0x05fb('0x1c'),_0x43f908+'-'+_0x4c5113+'/'+_0x157cf1)[_0x05fb('0x16')](_0x26cc68);}return null;};}function patchUpdates(_0x1ff3da){return function(_0x30f429){try{jsonpatch[_0x05fb('0x1d')](_0x30f429,_0x1ff3da,!![]);}catch(_0xf65060){return BPromise[_0x05fb('0x1e')](_0xf65060);}return _0x30f429['save']();};}function saveUpdates(_0x181884,_0x460463){return function(_0x17150c){if(_0x17150c){return _0x17150c[_0x05fb('0x1f')](_0x181884)[_0x05fb('0x20')](function(_0xfb8707){return _0xfb8707;});}return null;};}function removeEntity(_0x27b04a,_0x10c1b9){return function(_0x29d43a){if(_0x29d43a){return _0x29d43a[_0x05fb('0x21')]()[_0x05fb('0x20')](function(){_0x27b04a[_0x05fb('0x15')](0xcc)[_0x05fb('0x22')]();});}};}function handleEntityNotFound(_0x3ae20a,_0x178912){return function(_0x2f27d6){if(!_0x2f27d6){_0x3ae20a[_0x05fb('0x23')](0x194);}return _0x2f27d6;};}function handleError(_0x958cc7,_0x24de96){_0x24de96=_0x24de96||0x1f4;return function(_0x97666a){logger[_0x05fb('0x24')](_0x97666a[_0x05fb('0x25')]);if(_0x97666a[_0x05fb('0x26')]){delete _0x97666a[_0x05fb('0x26')];}_0x958cc7[_0x05fb('0x15')](_0x24de96)[_0x05fb('0x27')](_0x97666a);};}exports['index']=function(_0x462cb5,_0x4aed87){var _0xbce976={},_0x5e1381={},_0xfcb7bb={'count':0x0,'rows':[]};var _0x43514a=_[_0x05fb('0x28')](db['ServicenowConfiguration']['rawAttributes'],function(_0x15dd67){return{'name':_0x15dd67[_0x05fb('0x29')],'type':_0x15dd67[_0x05fb('0x2a')]['key']};});_0x5e1381[_0x05fb('0x2b')]=_[_0x05fb('0x28')](_0x43514a,'name');_0x5e1381[_0x05fb('0x2c')]=_['keys'](_0x462cb5[_0x05fb('0x2c')]);_0x5e1381[_0x05fb('0x2d')]=_[_0x05fb('0x2e')](_0x5e1381[_0x05fb('0x2b')],_0x5e1381['query']);_0xbce976[_0x05fb('0x2f')]=_[_0x05fb('0x2e')](_0x5e1381['model'],qs['fields'](_0x462cb5[_0x05fb('0x2c')]['fields']));_0xbce976[_0x05fb('0x2f')]=_0xbce976['attributes']['length']?_0xbce976['attributes']:_0x5e1381[_0x05fb('0x2b')];if(!_0x462cb5[_0x05fb('0x2c')][_0x05fb('0x30')]('nolimit')){_0xbce976[_0x05fb('0x19')]=qs[_0x05fb('0x19')](_0x462cb5[_0x05fb('0x2c')][_0x05fb('0x19')]);_0xbce976[_0x05fb('0x17')]=qs[_0x05fb('0x17')](_0x462cb5[_0x05fb('0x2c')][_0x05fb('0x17')]);}_0xbce976[_0x05fb('0x31')]=qs[_0x05fb('0x32')](_0x462cb5[_0x05fb('0x2c')][_0x05fb('0x32')]);_0xbce976[_0x05fb('0x33')]=qs[_0x05fb('0x2d')](_[_0x05fb('0x34')](_0x462cb5[_0x05fb('0x2c')],_0x5e1381['filters']),_0x43514a);if(_0x462cb5['query'][_0x05fb('0x35')]){_0xbce976[_0x05fb('0x33')]=_[_0x05fb('0x36')](_0xbce976['where'],{'$or':_[_0x05fb('0x28')](_0x43514a,function(_0x222679){if(_0x222679[_0x05fb('0x2a')]!==_0x05fb('0x37')){var _0x9c1a15={};_0x9c1a15[_0x222679[_0x05fb('0x26')]]={'$like':'%'+_0x462cb5[_0x05fb('0x2c')][_0x05fb('0x35')]+'%'};return _0x9c1a15;}})});}_0xbce976=_['merge']({},_0xbce976,_0x462cb5['options']);var _0x18bbff={'where':_0xbce976['where']};return db[_0x05fb('0x38')][_0x05fb('0x1a')](_0x18bbff)[_0x05fb('0x20')](function(_0x5bc68e){_0xfcb7bb[_0x05fb('0x1a')]=_0x5bc68e;if(_0x462cb5['query'][_0x05fb('0x39')]){_0xbce976[_0x05fb('0x3a')]=[{'all':!![]}];}return db[_0x05fb('0x38')][_0x05fb('0x3b')](_0xbce976);})[_0x05fb('0x20')](function(_0x6c48b5){_0xfcb7bb[_0x05fb('0x3c')]=_0x6c48b5;return _0xfcb7bb;})[_0x05fb('0x20')](respondWithFilteredResult(_0x4aed87,_0xbce976))[_0x05fb('0x3d')](handleError(_0x4aed87,null));};exports['show']=function(_0x33595d,_0x12cb05){var _0x709a90={'raw':![],'where':{'id':_0x33595d[_0x05fb('0x3e')]['id']}},_0x3294a9={};_0x3294a9[_0x05fb('0x2b')]=_[_0x05fb('0x3f')](db['ServicenowConfiguration'][_0x05fb('0x40')]);_0x3294a9[_0x05fb('0x2c')]=_[_0x05fb('0x3f')](_0x33595d[_0x05fb('0x2c')]);_0x3294a9[_0x05fb('0x2d')]=_[_0x05fb('0x2e')](_0x3294a9[_0x05fb('0x2b')],_0x3294a9[_0x05fb('0x2c')]);_0x709a90[_0x05fb('0x2f')]=_[_0x05fb('0x2e')](_0x3294a9[_0x05fb('0x2b')],qs['fields'](_0x33595d[_0x05fb('0x2c')][_0x05fb('0x41')]));_0x709a90[_0x05fb('0x2f')]=_0x709a90[_0x05fb('0x2f')][_0x05fb('0x42')]?_0x709a90[_0x05fb('0x2f')]:_0x3294a9[_0x05fb('0x2b')];if(_0x33595d['query'][_0x05fb('0x39')]){_0x709a90[_0x05fb('0x3a')]=[{'all':!![]}];}_0x709a90=_['merge']({},_0x709a90,_0x33595d['options']);return db[_0x05fb('0x38')]['find'](_0x709a90)[_0x05fb('0x20')](handleEntityNotFound(_0x12cb05,null))['then'](respondWithResult(_0x12cb05,null))[_0x05fb('0x3d')](handleError(_0x12cb05,null));};exports[_0x05fb('0x43')]=function(_0x592c6f,_0x5537c2){return db[_0x05fb('0x38')][_0x05fb('0x43')](_0x592c6f[_0x05fb('0x44')],{})['then'](respondWithResult(_0x5537c2,0xc9))['catch'](handleError(_0x5537c2,null));};exports[_0x05fb('0x1f')]=function(_0x228b16,_0x1519b2){if(_0x228b16[_0x05fb('0x44')]['id']){delete _0x228b16[_0x05fb('0x44')]['id'];}return db[_0x05fb('0x38')][_0x05fb('0x45')]({'where':{'id':_0x228b16[_0x05fb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1519b2,null))['then'](saveUpdates(_0x228b16['body'],null))[_0x05fb('0x20')](respondWithResult(_0x1519b2,null))[_0x05fb('0x3d')](handleError(_0x1519b2,null));};exports[_0x05fb('0x21')]=function(_0x1d5144,_0x253f20){return db[_0x05fb('0x38')]['find']({'where':{'id':_0x1d5144[_0x05fb('0x3e')]['id']}})[_0x05fb('0x20')](handleEntityNotFound(_0x253f20,null))['then'](removeEntity(_0x253f20,null))[_0x05fb('0x3d')](handleError(_0x253f20,null));};exports[_0x05fb('0x46')]=function(_0x3648f3,_0x4e69b5,_0x567f1d){var _0x520318={};var _0x28b338={};var _0xfc5da6;var _0x475a7a;return db[_0x05fb('0x38')][_0x05fb('0x47')]({'where':{'id':_0x3648f3[_0x05fb('0x3e')]['id']}})[_0x05fb('0x20')](handleEntityNotFound(_0x4e69b5,null))[_0x05fb('0x20')](function(_0x45961b){if(_0x45961b){_0xfc5da6=_0x45961b;_0x28b338['model']=_[_0x05fb('0x3f')](db[_0x05fb('0x48')]['rawAttributes']);_0x28b338[_0x05fb('0x2c')]=_[_0x05fb('0x3f')](_0x3648f3[_0x05fb('0x2c')]);_0x28b338['filters']=_[_0x05fb('0x2e')](_0x28b338[_0x05fb('0x2b')],_0x28b338[_0x05fb('0x2c')]);_0x520318[_0x05fb('0x2f')]=_[_0x05fb('0x2e')](_0x28b338[_0x05fb('0x2b')],qs[_0x05fb('0x41')](_0x3648f3['query'][_0x05fb('0x41')]));_0x520318['attributes']=_0x520318[_0x05fb('0x2f')][_0x05fb('0x42')]?_0x520318['attributes']:_0x28b338[_0x05fb('0x2b')];_0x520318['order']=qs['sort'](_0x3648f3['query'][_0x05fb('0x32')]);_0x520318[_0x05fb('0x33')]=qs[_0x05fb('0x2d')](_[_0x05fb('0x34')](_0x3648f3[_0x05fb('0x2c')],_0x28b338[_0x05fb('0x2d')]));if(_0x3648f3[_0x05fb('0x2c')][_0x05fb('0x35')]){_0x520318[_0x05fb('0x33')]=_['merge'](_0x520318[_0x05fb('0x33')],{'$or':_[_0x05fb('0x28')](_0x520318[_0x05fb('0x2f')],function(_0x49b819){var _0x224556={};_0x224556[_0x49b819]={'$like':'%'+_0x3648f3['query'][_0x05fb('0x35')]+'%'};return _0x224556;})});}_0x520318=_[_0x05fb('0x36')]({},_0x520318,_0x3648f3['options']);return _0xfc5da6['getFields'](_0x520318);}})[_0x05fb('0x20')](function(_0x2db5c5){if(_0x2db5c5){_0x475a7a=_0x2db5c5['length'];if(!_0x3648f3[_0x05fb('0x2c')]['hasOwnProperty']('nolimit')){_0x520318[_0x05fb('0x19')]=qs[_0x05fb('0x19')](_0x3648f3[_0x05fb('0x2c')][_0x05fb('0x19')]);_0x520318['offset']=qs[_0x05fb('0x17')](_0x3648f3[_0x05fb('0x2c')][_0x05fb('0x17')]);}return _0xfc5da6[_0x05fb('0x46')](_0x520318);}})[_0x05fb('0x20')](function(_0x4a3d03){if(_0x4a3d03){return _0x4a3d03?{'count':_0x475a7a,'rows':_0x4a3d03}:null;}})[_0x05fb('0x20')](respondWithResult(_0x4e69b5,null))[_0x05fb('0x3d')](handleError(_0x4e69b5,null));};exports[_0x05fb('0x49')]=function(_0x40bb9c,_0x55fe8a,_0x1cda4e){var _0x105cd1={};var _0x450ec2={};var _0x343f12;var _0xcb671b;return db[_0x05fb('0x38')][_0x05fb('0x47')]({'where':{'id':_0x40bb9c[_0x05fb('0x3e')]['id']}})[_0x05fb('0x20')](handleEntityNotFound(_0x55fe8a,null))[_0x05fb('0x20')](function(_0x4c9a12){if(_0x4c9a12){_0x343f12=_0x4c9a12;_0x450ec2['model']=_[_0x05fb('0x3f')](db[_0x05fb('0x48')][_0x05fb('0x40')]);_0x450ec2['query']=_[_0x05fb('0x3f')](_0x40bb9c[_0x05fb('0x2c')]);_0x450ec2[_0x05fb('0x2d')]=_['intersection'](_0x450ec2[_0x05fb('0x2b')],_0x450ec2[_0x05fb('0x2c')]);_0x105cd1['attributes']=_[_0x05fb('0x2e')](_0x450ec2[_0x05fb('0x2b')],qs[_0x05fb('0x41')](_0x40bb9c[_0x05fb('0x2c')]['fields']));_0x105cd1[_0x05fb('0x2f')]=_0x105cd1[_0x05fb('0x2f')][_0x05fb('0x42')]?_0x105cd1[_0x05fb('0x2f')]:_0x450ec2[_0x05fb('0x2b')];_0x105cd1[_0x05fb('0x31')]=qs[_0x05fb('0x32')](_0x40bb9c[_0x05fb('0x2c')][_0x05fb('0x32')]);_0x105cd1['where']=qs[_0x05fb('0x2d')](_[_0x05fb('0x34')](_0x40bb9c[_0x05fb('0x2c')],_0x450ec2['filters']));if(_0x40bb9c[_0x05fb('0x2c')][_0x05fb('0x35')]){_0x105cd1[_0x05fb('0x33')]=_['merge'](_0x105cd1['where'],{'$or':_[_0x05fb('0x28')](_0x105cd1['attributes'],function(_0x56c595){var _0x3c7769={};_0x3c7769[_0x56c595]={'$like':'%'+_0x40bb9c[_0x05fb('0x2c')][_0x05fb('0x35')]+'%'};return _0x3c7769;})});}_0x105cd1=_[_0x05fb('0x36')]({},_0x105cd1,_0x40bb9c[_0x05fb('0x4a')]);return _0x343f12[_0x05fb('0x49')](_0x105cd1);}})['then'](function(_0x5430b0){if(_0x5430b0){_0xcb671b=_0x5430b0[_0x05fb('0x42')];if(!_0x40bb9c['query']['hasOwnProperty'](_0x05fb('0x4b'))){_0x105cd1[_0x05fb('0x19')]=qs[_0x05fb('0x19')](_0x40bb9c[_0x05fb('0x2c')][_0x05fb('0x19')]);_0x105cd1[_0x05fb('0x17')]=qs[_0x05fb('0x17')](_0x40bb9c[_0x05fb('0x2c')][_0x05fb('0x17')]);}return _0x343f12[_0x05fb('0x49')](_0x105cd1);}})[_0x05fb('0x20')](function(_0x39317d){if(_0x39317d){return _0x39317d?{'count':_0xcb671b,'rows':_0x39317d}:null;}})[_0x05fb('0x20')](respondWithResult(_0x55fe8a,null))[_0x05fb('0x3d')](handleError(_0x55fe8a,null));};exports[_0x05fb('0x4c')]=function(_0x4f5400,_0x459b12,_0x571d46){var _0xc9ced9={};var _0x30f8a2={};var _0x305788;var _0x87a756;return db[_0x05fb('0x38')][_0x05fb('0x47')]({'where':{'id':_0x4f5400['params']['id']}})[_0x05fb('0x20')](handleEntityNotFound(_0x459b12,null))['then'](function(_0x3e97e4){if(_0x3e97e4){_0x305788=_0x3e97e4;_0x30f8a2[_0x05fb('0x2b')]=_['keys'](db[_0x05fb('0x48')]['rawAttributes']);_0x30f8a2[_0x05fb('0x2c')]=_[_0x05fb('0x3f')](_0x4f5400[_0x05fb('0x2c')]);_0x30f8a2['filters']=_['intersection'](_0x30f8a2[_0x05fb('0x2b')],_0x30f8a2[_0x05fb('0x2c')]);_0xc9ced9[_0x05fb('0x2f')]=_[_0x05fb('0x2e')](_0x30f8a2[_0x05fb('0x2b')],qs[_0x05fb('0x41')](_0x4f5400[_0x05fb('0x2c')]['fields']));_0xc9ced9[_0x05fb('0x2f')]=_0xc9ced9[_0x05fb('0x2f')][_0x05fb('0x42')]?_0xc9ced9[_0x05fb('0x2f')]:_0x30f8a2['model'];_0xc9ced9[_0x05fb('0x31')]=qs[_0x05fb('0x32')](_0x4f5400[_0x05fb('0x2c')]['sort']);_0xc9ced9[_0x05fb('0x33')]=qs['filters'](_[_0x05fb('0x34')](_0x4f5400[_0x05fb('0x2c')],_0x30f8a2[_0x05fb('0x2d')]));if(_0x4f5400[_0x05fb('0x2c')][_0x05fb('0x35')]){_0xc9ced9[_0x05fb('0x33')]=_['merge'](_0xc9ced9['where'],{'$or':_[_0x05fb('0x28')](_0xc9ced9[_0x05fb('0x2f')],function(_0x54f4c3){var _0x1dd093={};_0x1dd093[_0x54f4c3]={'$like':'%'+_0x4f5400[_0x05fb('0x2c')]['filter']+'%'};return _0x1dd093;})});}_0xc9ced9=_['merge']({},_0xc9ced9,_0x4f5400['options']);return _0x305788['getDescriptions'](_0xc9ced9);}})[_0x05fb('0x20')](function(_0x10378e){if(_0x10378e){_0x87a756=_0x10378e[_0x05fb('0x42')];if(!_0x4f5400[_0x05fb('0x2c')][_0x05fb('0x30')](_0x05fb('0x4b'))){_0xc9ced9['limit']=qs[_0x05fb('0x19')](_0x4f5400['query'][_0x05fb('0x19')]);_0xc9ced9[_0x05fb('0x17')]=qs[_0x05fb('0x17')](_0x4f5400[_0x05fb('0x2c')]['offset']);}return _0x305788[_0x05fb('0x4c')](_0xc9ced9);}})['then'](function(_0x13688d){if(_0x13688d){return _0x13688d?{'count':_0x87a756,'rows':_0x13688d}:null;}})[_0x05fb('0x20')](respondWithResult(_0x459b12,null))[_0x05fb('0x3d')](handleError(_0x459b12,null));}; \ No newline at end of file +var _0x1e1f=['fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','options','include','ServicenowConfiguration','rows','catch','params','includeAll','create','body','find','getFields','findOne','ServicenowField','pick','getSubjects','getDescriptions','eml-format','rimraf'];(function(_0x396deb,_0x40b22c){var _0x3a8745=function(_0x169267){while(--_0x169267){_0x396deb['push'](_0x396deb['shift']());}};_0x3a8745(++_0x40b22c);}(_0x1e1f,0x184));var _0xf1e1=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x1e1f[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xf1e1('0x0'));var rimraf=require(_0xf1e1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf1e1('0x2'));var rp=require('request-promise');var moment=require(_0xf1e1('0x3'));var BPromise=require(_0xf1e1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf1e1('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf1e1('0x6'));var fs=require('fs');var fs_extra=require(_0xf1e1('0x7'));var _=require(_0xf1e1('0x8'));var squel=require(_0xf1e1('0x9'));var crypto=require(_0xf1e1('0xa'));var jsforce=require(_0xf1e1('0xb'));var deskjs=require(_0xf1e1('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf1e1('0xd'));var Papa=require('papaparse');var Redis=require(_0xf1e1('0xe'));var authService=require(_0xf1e1('0xf'));var qs=require(_0xf1e1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1e1('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xf1e1('0x12'));var config=require(_0xf1e1('0x13'));var licenseUtil=require(_0xf1e1('0x14'));var db=require(_0xf1e1('0x15'))['db'];function respondWithStatusCode(_0x4265b4,_0x53dccd){_0x53dccd=_0x53dccd||0xcc;return function(_0x46ffb4){if(_0x46ffb4){return _0x4265b4[_0xf1e1('0x16')](_0x53dccd);}return _0x4265b4[_0xf1e1('0x17')](_0x53dccd)[_0xf1e1('0x18')]();};}function respondWithResult(_0x39be09,_0x542e60){_0x542e60=_0x542e60||0xc8;return function(_0xec5e8a){if(_0xec5e8a){return _0x39be09['status'](_0x542e60)['json'](_0xec5e8a);}};}function respondWithFilteredResult(_0x2c2455,_0x2b65fc){return function(_0xc26923){if(_0xc26923){var _0x3bedd0=typeof _0x2b65fc['offset']==='undefined'&&typeof _0x2b65fc['limit']==='undefined';var _0x42febe=_0xc26923[_0xf1e1('0x19')];var _0x4f612f=_0x3bedd0?0x0:_0x2b65fc[_0xf1e1('0x1a')];var _0x20714a=_0x3bedd0?_0xc26923['count']:_0x2b65fc[_0xf1e1('0x1a')]+_0x2b65fc['limit'];var _0x123ae4;if(_0x20714a>=_0x42febe){_0x20714a=_0x42febe;_0x123ae4=0xc8;}else{_0x123ae4=0xce;}_0x2c2455[_0xf1e1('0x17')](_0x123ae4);return _0x2c2455[_0xf1e1('0x1b')](_0xf1e1('0x1c'),_0x4f612f+'-'+_0x20714a+'/'+_0x42febe)[_0xf1e1('0x1d')](_0xc26923);}return null;};}function patchUpdates(_0x2bc2a2){return function(_0x54a365){try{jsonpatch[_0xf1e1('0x1e')](_0x54a365,_0x2bc2a2,!![]);}catch(_0x3abb67){return BPromise[_0xf1e1('0x1f')](_0x3abb67);}return _0x54a365[_0xf1e1('0x20')]();};}function saveUpdates(_0x3df24b,_0x15145c){return function(_0x57610d){if(_0x57610d){return _0x57610d[_0xf1e1('0x21')](_0x3df24b)[_0xf1e1('0x22')](function(_0x2ed5d2){return _0x2ed5d2;});}return null;};}function removeEntity(_0x1401a0,_0x5686a9){return function(_0x41bdd9){if(_0x41bdd9){return _0x41bdd9[_0xf1e1('0x23')]()[_0xf1e1('0x22')](function(){_0x1401a0[_0xf1e1('0x17')](0xcc)[_0xf1e1('0x18')]();});}};}function handleEntityNotFound(_0x1aa2b8,_0x2ab0d0){return function(_0x1524e7){if(!_0x1524e7){_0x1aa2b8[_0xf1e1('0x16')](0x194);}return _0x1524e7;};}function handleError(_0x377224,_0x3211ac){_0x3211ac=_0x3211ac||0x1f4;return function(_0x446964){logger[_0xf1e1('0x24')](_0x446964[_0xf1e1('0x25')]);if(_0x446964['name']){delete _0x446964['name'];}_0x377224[_0xf1e1('0x17')](_0x3211ac)['send'](_0x446964);};}exports[_0xf1e1('0x26')]=function(_0x2193f3,_0x105bd8){var _0x37058b={},_0x142291={},_0xe0f1f5={'count':0x0,'rows':[]};var _0x3b9f98=_[_0xf1e1('0x27')](db['ServicenowConfiguration'][_0xf1e1('0x28')],function(_0x2373b9){return{'name':_0x2373b9[_0xf1e1('0x29')],'type':_0x2373b9[_0xf1e1('0x2a')][_0xf1e1('0x2b')]};});_0x142291[_0xf1e1('0x2c')]=_[_0xf1e1('0x27')](_0x3b9f98,_0xf1e1('0x2d'));_0x142291[_0xf1e1('0x2e')]=_[_0xf1e1('0x2f')](_0x2193f3[_0xf1e1('0x2e')]);_0x142291[_0xf1e1('0x30')]=_['intersection'](_0x142291[_0xf1e1('0x2c')],_0x142291[_0xf1e1('0x2e')]);_0x37058b[_0xf1e1('0x31')]=_[_0xf1e1('0x32')](_0x142291[_0xf1e1('0x2c')],qs[_0xf1e1('0x33')](_0x2193f3[_0xf1e1('0x2e')][_0xf1e1('0x33')]));_0x37058b[_0xf1e1('0x31')]=_0x37058b[_0xf1e1('0x31')][_0xf1e1('0x34')]?_0x37058b[_0xf1e1('0x31')]:_0x142291[_0xf1e1('0x2c')];if(!_0x2193f3[_0xf1e1('0x2e')][_0xf1e1('0x35')](_0xf1e1('0x36'))){_0x37058b[_0xf1e1('0x37')]=qs[_0xf1e1('0x37')](_0x2193f3['query'][_0xf1e1('0x37')]);_0x37058b[_0xf1e1('0x1a')]=qs[_0xf1e1('0x1a')](_0x2193f3[_0xf1e1('0x2e')][_0xf1e1('0x1a')]);}_0x37058b[_0xf1e1('0x38')]=qs['sort'](_0x2193f3[_0xf1e1('0x2e')][_0xf1e1('0x39')]);_0x37058b['where']=qs['filters'](_['pick'](_0x2193f3[_0xf1e1('0x2e')],_0x142291['filters']),_0x3b9f98);if(_0x2193f3[_0xf1e1('0x2e')][_0xf1e1('0x3a')]){_0x37058b[_0xf1e1('0x3b')]=_[_0xf1e1('0x3c')](_0x37058b[_0xf1e1('0x3b')],{'$or':_[_0xf1e1('0x27')](_0x3b9f98,function(_0x26b0f2){if(_0x26b0f2['type']!==_0xf1e1('0x3d')){var _0x1b8d81={};_0x1b8d81[_0x26b0f2[_0xf1e1('0x2d')]]={'$like':'%'+_0x2193f3[_0xf1e1('0x2e')]['filter']+'%'};return _0x1b8d81;}})});}_0x37058b=_['merge']({},_0x37058b,_0x2193f3[_0xf1e1('0x3e')]);var _0x201a48={'where':_0x37058b[_0xf1e1('0x3b')]};return db['ServicenowConfiguration'][_0xf1e1('0x19')](_0x201a48)['then'](function(_0x1f1244){_0xe0f1f5['count']=_0x1f1244;if(_0x2193f3[_0xf1e1('0x2e')]['includeAll']){_0x37058b[_0xf1e1('0x3f')]=[{'all':!![]}];}return db[_0xf1e1('0x40')]['findAll'](_0x37058b);})['then'](function(_0x5971e4){_0xe0f1f5[_0xf1e1('0x41')]=_0x5971e4;return _0xe0f1f5;})[_0xf1e1('0x22')](respondWithFilteredResult(_0x105bd8,_0x37058b))[_0xf1e1('0x42')](handleError(_0x105bd8,null));};exports['show']=function(_0x17b2c8,_0x3e659b){var _0x4e872b={'raw':![],'where':{'id':_0x17b2c8[_0xf1e1('0x43')]['id']}},_0x5a64d5={};_0x5a64d5[_0xf1e1('0x2c')]=_['keys'](db[_0xf1e1('0x40')]['rawAttributes']);_0x5a64d5['query']=_[_0xf1e1('0x2f')](_0x17b2c8[_0xf1e1('0x2e')]);_0x5a64d5['filters']=_[_0xf1e1('0x32')](_0x5a64d5['model'],_0x5a64d5[_0xf1e1('0x2e')]);_0x4e872b[_0xf1e1('0x31')]=_['intersection'](_0x5a64d5[_0xf1e1('0x2c')],qs[_0xf1e1('0x33')](_0x17b2c8['query'][_0xf1e1('0x33')]));_0x4e872b['attributes']=_0x4e872b['attributes']['length']?_0x4e872b[_0xf1e1('0x31')]:_0x5a64d5[_0xf1e1('0x2c')];if(_0x17b2c8['query'][_0xf1e1('0x44')]){_0x4e872b[_0xf1e1('0x3f')]=[{'all':!![]}];}_0x4e872b=_['merge']({},_0x4e872b,_0x17b2c8[_0xf1e1('0x3e')]);return db[_0xf1e1('0x40')]['find'](_0x4e872b)[_0xf1e1('0x22')](handleEntityNotFound(_0x3e659b,null))[_0xf1e1('0x22')](respondWithResult(_0x3e659b,null))[_0xf1e1('0x42')](handleError(_0x3e659b,null));};exports[_0xf1e1('0x45')]=function(_0xb1b622,_0x332e0f){return db['ServicenowConfiguration'][_0xf1e1('0x45')](_0xb1b622['body'],{})[_0xf1e1('0x22')](respondWithResult(_0x332e0f,0xc9))[_0xf1e1('0x42')](handleError(_0x332e0f,null));};exports[_0xf1e1('0x21')]=function(_0x1c348b,_0x45608d){if(_0x1c348b[_0xf1e1('0x46')]['id']){delete _0x1c348b[_0xf1e1('0x46')]['id'];}return db['ServicenowConfiguration'][_0xf1e1('0x47')]({'where':{'id':_0x1c348b[_0xf1e1('0x43')]['id']}})['then'](handleEntityNotFound(_0x45608d,null))[_0xf1e1('0x22')](saveUpdates(_0x1c348b[_0xf1e1('0x46')],null))['then'](respondWithResult(_0x45608d,null))['catch'](handleError(_0x45608d,null));};exports[_0xf1e1('0x23')]=function(_0x414733,_0x50bce1){return db[_0xf1e1('0x40')][_0xf1e1('0x47')]({'where':{'id':_0x414733[_0xf1e1('0x43')]['id']}})[_0xf1e1('0x22')](handleEntityNotFound(_0x50bce1,null))[_0xf1e1('0x22')](removeEntity(_0x50bce1,null))['catch'](handleError(_0x50bce1,null));};exports[_0xf1e1('0x48')]=function(_0x347b07,_0x4460e1,_0x32ab18){var _0x3f7e44={};var _0x41de95={};var _0x5aed9a;var _0x30b645;return db[_0xf1e1('0x40')][_0xf1e1('0x49')]({'where':{'id':_0x347b07[_0xf1e1('0x43')]['id']}})['then'](handleEntityNotFound(_0x4460e1,null))[_0xf1e1('0x22')](function(_0x49dc03){if(_0x49dc03){_0x5aed9a=_0x49dc03;_0x41de95[_0xf1e1('0x2c')]=_[_0xf1e1('0x2f')](db[_0xf1e1('0x4a')][_0xf1e1('0x28')]);_0x41de95['query']=_['keys'](_0x347b07[_0xf1e1('0x2e')]);_0x41de95[_0xf1e1('0x30')]=_[_0xf1e1('0x32')](_0x41de95[_0xf1e1('0x2c')],_0x41de95[_0xf1e1('0x2e')]);_0x3f7e44[_0xf1e1('0x31')]=_[_0xf1e1('0x32')](_0x41de95[_0xf1e1('0x2c')],qs[_0xf1e1('0x33')](_0x347b07[_0xf1e1('0x2e')][_0xf1e1('0x33')]));_0x3f7e44[_0xf1e1('0x31')]=_0x3f7e44[_0xf1e1('0x31')][_0xf1e1('0x34')]?_0x3f7e44[_0xf1e1('0x31')]:_0x41de95[_0xf1e1('0x2c')];_0x3f7e44[_0xf1e1('0x38')]=qs[_0xf1e1('0x39')](_0x347b07[_0xf1e1('0x2e')]['sort']);_0x3f7e44[_0xf1e1('0x3b')]=qs[_0xf1e1('0x30')](_[_0xf1e1('0x4b')](_0x347b07[_0xf1e1('0x2e')],_0x41de95[_0xf1e1('0x30')]));if(_0x347b07[_0xf1e1('0x2e')][_0xf1e1('0x3a')]){_0x3f7e44['where']=_[_0xf1e1('0x3c')](_0x3f7e44[_0xf1e1('0x3b')],{'$or':_['map'](_0x3f7e44[_0xf1e1('0x31')],function(_0x1f2bdc){var _0xb17e94={};_0xb17e94[_0x1f2bdc]={'$like':'%'+_0x347b07[_0xf1e1('0x2e')]['filter']+'%'};return _0xb17e94;})});}_0x3f7e44=_['merge']({},_0x3f7e44,_0x347b07['options']);return _0x5aed9a['getFields'](_0x3f7e44);}})[_0xf1e1('0x22')](function(_0x46499d){if(_0x46499d){_0x30b645=_0x46499d[_0xf1e1('0x34')];if(!_0x347b07[_0xf1e1('0x2e')]['hasOwnProperty']('nolimit')){_0x3f7e44[_0xf1e1('0x37')]=qs[_0xf1e1('0x37')](_0x347b07[_0xf1e1('0x2e')][_0xf1e1('0x37')]);_0x3f7e44[_0xf1e1('0x1a')]=qs[_0xf1e1('0x1a')](_0x347b07['query'][_0xf1e1('0x1a')]);}return _0x5aed9a[_0xf1e1('0x48')](_0x3f7e44);}})[_0xf1e1('0x22')](function(_0x1ed394){if(_0x1ed394){return _0x1ed394?{'count':_0x30b645,'rows':_0x1ed394}:null;}})[_0xf1e1('0x22')](respondWithResult(_0x4460e1,null))[_0xf1e1('0x42')](handleError(_0x4460e1,null));};exports['getSubjects']=function(_0x4c2603,_0x21d651,_0x23ee76){var _0x3726ec={};var _0x5a67d4={};var _0x3d9e45;var _0x561c01;return db[_0xf1e1('0x40')][_0xf1e1('0x49')]({'where':{'id':_0x4c2603['params']['id']}})[_0xf1e1('0x22')](handleEntityNotFound(_0x21d651,null))[_0xf1e1('0x22')](function(_0x4db1de){if(_0x4db1de){_0x3d9e45=_0x4db1de;_0x5a67d4[_0xf1e1('0x2c')]=_[_0xf1e1('0x2f')](db[_0xf1e1('0x4a')]['rawAttributes']);_0x5a67d4[_0xf1e1('0x2e')]=_[_0xf1e1('0x2f')](_0x4c2603[_0xf1e1('0x2e')]);_0x5a67d4['filters']=_[_0xf1e1('0x32')](_0x5a67d4['model'],_0x5a67d4[_0xf1e1('0x2e')]);_0x3726ec[_0xf1e1('0x31')]=_['intersection'](_0x5a67d4[_0xf1e1('0x2c')],qs[_0xf1e1('0x33')](_0x4c2603[_0xf1e1('0x2e')][_0xf1e1('0x33')]));_0x3726ec[_0xf1e1('0x31')]=_0x3726ec[_0xf1e1('0x31')][_0xf1e1('0x34')]?_0x3726ec['attributes']:_0x5a67d4[_0xf1e1('0x2c')];_0x3726ec[_0xf1e1('0x38')]=qs['sort'](_0x4c2603['query']['sort']);_0x3726ec['where']=qs[_0xf1e1('0x30')](_[_0xf1e1('0x4b')](_0x4c2603[_0xf1e1('0x2e')],_0x5a67d4['filters']));if(_0x4c2603[_0xf1e1('0x2e')][_0xf1e1('0x3a')]){_0x3726ec[_0xf1e1('0x3b')]=_[_0xf1e1('0x3c')](_0x3726ec[_0xf1e1('0x3b')],{'$or':_[_0xf1e1('0x27')](_0x3726ec[_0xf1e1('0x31')],function(_0x4a6ca3){var _0x56b4f5={};_0x56b4f5[_0x4a6ca3]={'$like':'%'+_0x4c2603[_0xf1e1('0x2e')][_0xf1e1('0x3a')]+'%'};return _0x56b4f5;})});}_0x3726ec=_[_0xf1e1('0x3c')]({},_0x3726ec,_0x4c2603[_0xf1e1('0x3e')]);return _0x3d9e45[_0xf1e1('0x4c')](_0x3726ec);}})[_0xf1e1('0x22')](function(_0x543482){if(_0x543482){_0x561c01=_0x543482[_0xf1e1('0x34')];if(!_0x4c2603[_0xf1e1('0x2e')]['hasOwnProperty']('nolimit')){_0x3726ec[_0xf1e1('0x37')]=qs[_0xf1e1('0x37')](_0x4c2603[_0xf1e1('0x2e')][_0xf1e1('0x37')]);_0x3726ec[_0xf1e1('0x1a')]=qs[_0xf1e1('0x1a')](_0x4c2603[_0xf1e1('0x2e')][_0xf1e1('0x1a')]);}return _0x3d9e45[_0xf1e1('0x4c')](_0x3726ec);}})[_0xf1e1('0x22')](function(_0x526a9f){if(_0x526a9f){return _0x526a9f?{'count':_0x561c01,'rows':_0x526a9f}:null;}})[_0xf1e1('0x22')](respondWithResult(_0x21d651,null))[_0xf1e1('0x42')](handleError(_0x21d651,null));};exports[_0xf1e1('0x4d')]=function(_0x329fc0,_0x467f1e,_0x412370){var _0x277eb9={};var _0x51a866={};var _0x5efe5d;var _0x392487;return db[_0xf1e1('0x40')][_0xf1e1('0x49')]({'where':{'id':_0x329fc0['params']['id']}})[_0xf1e1('0x22')](handleEntityNotFound(_0x467f1e,null))[_0xf1e1('0x22')](function(_0x2116e1){if(_0x2116e1){_0x5efe5d=_0x2116e1;_0x51a866[_0xf1e1('0x2c')]=_[_0xf1e1('0x2f')](db[_0xf1e1('0x4a')][_0xf1e1('0x28')]);_0x51a866[_0xf1e1('0x2e')]=_[_0xf1e1('0x2f')](_0x329fc0['query']);_0x51a866[_0xf1e1('0x30')]=_[_0xf1e1('0x32')](_0x51a866[_0xf1e1('0x2c')],_0x51a866['query']);_0x277eb9[_0xf1e1('0x31')]=_[_0xf1e1('0x32')](_0x51a866[_0xf1e1('0x2c')],qs[_0xf1e1('0x33')](_0x329fc0[_0xf1e1('0x2e')][_0xf1e1('0x33')]));_0x277eb9[_0xf1e1('0x31')]=_0x277eb9[_0xf1e1('0x31')][_0xf1e1('0x34')]?_0x277eb9[_0xf1e1('0x31')]:_0x51a866['model'];_0x277eb9[_0xf1e1('0x38')]=qs[_0xf1e1('0x39')](_0x329fc0['query'][_0xf1e1('0x39')]);_0x277eb9[_0xf1e1('0x3b')]=qs[_0xf1e1('0x30')](_[_0xf1e1('0x4b')](_0x329fc0['query'],_0x51a866[_0xf1e1('0x30')]));if(_0x329fc0[_0xf1e1('0x2e')]['filter']){_0x277eb9[_0xf1e1('0x3b')]=_[_0xf1e1('0x3c')](_0x277eb9[_0xf1e1('0x3b')],{'$or':_[_0xf1e1('0x27')](_0x277eb9[_0xf1e1('0x31')],function(_0x344027){var _0x47648f={};_0x47648f[_0x344027]={'$like':'%'+_0x329fc0[_0xf1e1('0x2e')][_0xf1e1('0x3a')]+'%'};return _0x47648f;})});}_0x277eb9=_['merge']({},_0x277eb9,_0x329fc0[_0xf1e1('0x3e')]);return _0x5efe5d[_0xf1e1('0x4d')](_0x277eb9);}})['then'](function(_0x52b17a){if(_0x52b17a){_0x392487=_0x52b17a[_0xf1e1('0x34')];if(!_0x329fc0[_0xf1e1('0x2e')][_0xf1e1('0x35')]('nolimit')){_0x277eb9[_0xf1e1('0x37')]=qs[_0xf1e1('0x37')](_0x329fc0[_0xf1e1('0x2e')][_0xf1e1('0x37')]);_0x277eb9[_0xf1e1('0x1a')]=qs[_0xf1e1('0x1a')](_0x329fc0[_0xf1e1('0x2e')][_0xf1e1('0x1a')]);}return _0x5efe5d[_0xf1e1('0x4d')](_0x277eb9);}})['then'](function(_0x23b855){if(_0x23b855){return _0x23b855?{'count':_0x392487,'rows':_0x23b855}:null;}})['then'](respondWithResult(_0x467f1e,null))['catch'](handleError(_0x467f1e,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 2889012..45084b1 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 _0xf34f=['int_servicenow_configurations','lodash','../../config/logger','moment','request-promise','path','rimraf','./intServicenowConfiguration.attributes','define'];(function(_0x17b8ef,_0x33c318){var _0x4b2c5f=function(_0x45454b){while(--_0x45454b){_0x17b8ef['push'](_0x17b8ef['shift']());}};_0x4b2c5f(++_0x33c318);}(_0xf34f,0x64));var _0xff34=function(_0x3cea1c,_0x1ddf45){_0x3cea1c=_0x3cea1c-0x0;var _0x5b7ce8=_0xf34f[_0x3cea1c];return _0x5b7ce8;};'use strict';var _=require(_0xff34('0x0'));var util=require('util');var logger=require(_0xff34('0x1'))('api');var moment=require(_0xff34('0x2'));var BPromise=require('bluebird');var rp=require(_0xff34('0x3'));var fs=require('fs');var path=require(_0xff34('0x4'));var rimraf=require(_0xff34('0x5'));var config=require('../../config/environment');var attributes=require(_0xff34('0x6'));module['exports']=function(_0x1f436c,_0x5ba057){return _0x1f436c[_0xff34('0x7')]('ServicenowConfiguration',attributes,{'tableName':_0xff34('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e7b=['exports','define','ServicenowConfiguration','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x95beec,_0xe890bd){var _0x391573=function(_0x2a850e){while(--_0x2a850e){_0x95beec['push'](_0x95beec['shift']());}};_0x391573(++_0xe890bd);}(_0x4e7b,0xf3));var _0xb4e7=function(_0x5a3fd7,_0x237bfe){_0x5a3fd7=_0x5a3fd7-0x0;var _0x45392a=_0x4e7b[_0x5a3fd7];return _0x45392a;};'use strict';var _=require(_0xb4e7('0x0'));var util=require(_0xb4e7('0x1'));var logger=require('../../config/logger')(_0xb4e7('0x2'));var moment=require('moment');var BPromise=require(_0xb4e7('0x3'));var rp=require(_0xb4e7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4e7('0x5'));var config=require(_0xb4e7('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xb4e7('0x7')]=function(_0x3351aa,_0x271dbf){return _0x3351aa[_0xb4e7('0x8')](_0xb4e7('0x9'),attributes,{'tableName':'int_servicenow_configurations','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 51fc9a4..004f7e8 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 _0x60b1=['moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x289a56,_0x1d3256){var _0x3e9c3e=function(_0x3a4bfc){while(--_0x3a4bfc){_0x289a56['push'](_0x289a56['shift']());}};_0x3e9c3e(++_0x1d3256);}(_0x60b1,0x116));var _0x160b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x60b1[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x160b('0x0'));var util=require(_0x160b('0x1'));var moment=require(_0x160b('0x2'));var BPromise=require('bluebird');var rs=require(_0x160b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x160b('0x4'))['db'];var utils=require(_0x160b('0x5'));var logger=require('../../config/logger')(_0x160b('0x6'));var config=require(_0x160b('0x7'));var jayson=require(_0x160b('0x8'));var client=jayson[_0x160b('0x9')][_0x160b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbd88cc,_0x5af5e4,_0x1ee53c){return new BPromise(function(_0x5dde78,_0x400646){return client['request'](_0xbd88cc,_0x1ee53c)[_0x160b('0xb')](function(_0x2bec35){logger[_0x160b('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5af5e4,_0x160b('0xd'));logger['debug'](_0x160b('0xe'),_0x5af5e4,'request\x20sent',JSON['stringify'](_0x2bec35));if(_0x2bec35[_0x160b('0xf')]){if(_0x2bec35[_0x160b('0xf')][_0x160b('0x10')]===0x1f4){logger[_0x160b('0xf')](_0x160b('0x11'),_0x5af5e4,_0x2bec35[_0x160b('0xf')]['message']);return _0x400646(_0x2bec35[_0x160b('0xf')][_0x160b('0x12')]);}logger[_0x160b('0xf')](_0x160b('0x11'),_0x5af5e4,_0x2bec35[_0x160b('0xf')][_0x160b('0x12')]);return _0x5dde78(_0x2bec35[_0x160b('0xf')][_0x160b('0x12')]);}else{logger[_0x160b('0xc')](_0x160b('0x11'),_0x5af5e4,_0x160b('0xd'));_0x5dde78(_0x2bec35['result'][_0x160b('0x12')]);}})[_0x160b('0x13')](function(_0x2da3ff){logger[_0x160b('0xf')](_0x160b('0x11'),_0x5af5e4,_0x2da3ff);_0x400646(_0x2da3ff);});});} \ No newline at end of file +var _0x855e=['rpc','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x379f26,_0x3d327f){var _0x381b03=function(_0x1411ad){while(--_0x1411ad){_0x379f26['push'](_0x379f26['shift']());}};_0x381b03(++_0x3d327f);}(_0x855e,0x1f2));var _0xe855=function(_0x5c9844,_0x14354f){_0x5c9844=_0x5c9844-0x0;var _0x3663b8=_0x855e[_0x5c9844];return _0x3663b8;};'use strict';var _=require(_0xe855('0x0'));var util=require(_0xe855('0x1'));var moment=require(_0xe855('0x2'));var BPromise=require(_0xe855('0x3'));var rs=require(_0xe855('0x4'));var fs=require('fs');var Redis=require(_0xe855('0x5'));var db=require(_0xe855('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe855('0x7'))(_0xe855('0x8'));var config=require('../../config/environment');var jayson=require(_0xe855('0x9'));var client=jayson[_0xe855('0xa')][_0xe855('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12e649,_0x3a4782,_0x259097){return new BPromise(function(_0x23cfb3,_0x3f1437){return client[_0xe855('0xc')](_0x12e649,_0x259097)[_0xe855('0xd')](function(_0x481620){logger[_0xe855('0xe')](_0xe855('0xf'),_0x3a4782,_0xe855('0x10'));logger[_0xe855('0x11')](_0xe855('0x12'),_0x3a4782,_0xe855('0x10'),JSON['stringify'](_0x481620));if(_0x481620[_0xe855('0x13')]){if(_0x481620[_0xe855('0x13')][_0xe855('0x14')]===0x1f4){logger[_0xe855('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3a4782,_0x481620[_0xe855('0x13')][_0xe855('0x15')]);return _0x3f1437(_0x481620['error'][_0xe855('0x15')]);}logger[_0xe855('0x13')](_0xe855('0xf'),_0x3a4782,_0x481620['error'][_0xe855('0x15')]);return _0x23cfb3(_0x481620['error'][_0xe855('0x15')]);}else{logger[_0xe855('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3a4782,'request\x20sent');_0x23cfb3(_0x481620[_0xe855('0x16')][_0xe855('0x15')]);}})['catch'](function(_0x7522be){logger[_0xe855('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3a4782,_0x7522be);_0x3f1437(_0x7522be);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f78eb75..54cc6d0 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 _0x2ddf=['multer','util','path','Router','fs-extra','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0xa9ad05,_0x2fbcac){var _0x3634cc=function(_0x52c7f2){while(--_0x52c7f2){_0xa9ad05['push'](_0xa9ad05['shift']());}};_0x3634cc(++_0x2fbcac);}(_0x2ddf,0x10a));var _0xf2dd=function(_0x347423,_0x214c31){_0x347423=_0x347423-0x0;var _0x1c8849=_0x2ddf[_0x347423];return _0x1c8849;};'use strict';var multer=require(_0xf2dd('0x0'));var util=require(_0xf2dd('0x1'));var path=require(_0xf2dd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf2dd('0x3')]();var fs_extra=require(_0xf2dd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf2dd('0x5'));var config=require('../../config/environment');var controller=require(_0xf2dd('0x6'));router[_0xf2dd('0x7')]('/',auth[_0xf2dd('0x8')](),controller[_0xf2dd('0x9')]);router[_0xf2dd('0x7')]('/:id',auth[_0xf2dd('0x8')](),controller[_0xf2dd('0xa')]);router[_0xf2dd('0xb')]('/',auth['isAuthenticated'](),controller[_0xf2dd('0xc')]);router[_0xf2dd('0xd')](_0xf2dd('0xe'),auth['isAuthenticated'](),controller[_0xf2dd('0xf')]);router[_0xf2dd('0x10')](_0xf2dd('0xe'),auth[_0xf2dd('0x8')](),controller[_0xf2dd('0x11')]);module[_0xf2dd('0x12')]=router; \ No newline at end of file +var _0x69d6=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','post','create','put','destroy','multer','util','path'];(function(_0x1486e5,_0x39684f){var _0x29d89b=function(_0x4a0a80){while(--_0x4a0a80){_0x1486e5['push'](_0x1486e5['shift']());}};_0x29d89b(++_0x39684f);}(_0x69d6,0x1dd));var _0x669d=function(_0x38ac0f,_0x57e18a){_0x38ac0f=_0x38ac0f-0x0;var _0x140f20=_0x69d6[_0x38ac0f];return _0x140f20;};'use strict';var multer=require(_0x669d('0x0'));var util=require(_0x669d('0x1'));var path=require(_0x669d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x669d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x669d('0x4'));var interaction=require(_0x669d('0x5'));var config=require(_0x669d('0x6'));var controller=require(_0x669d('0x7'));router[_0x669d('0x8')]('/',auth[_0x669d('0x9')](),controller['index']);router[_0x669d('0x8')](_0x669d('0xa'),auth[_0x669d('0x9')](),controller['show']);router[_0x669d('0xb')]('/',auth[_0x669d('0x9')](),controller[_0x669d('0xc')]);router[_0x669d('0xd')](_0x669d('0xa'),auth[_0x669d('0x9')](),controller['update']);router['delete'](_0x669d('0xa'),auth[_0x669d('0x9')](),controller[_0x669d('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index dcd9d5f..c740fb0 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 _0x1c1a=['customVariable','keyValue','picklist','STRING','ENUM','variable','BOOLEAN','exports','string'];(function(_0x440fbd,_0x1adf8a){var _0x5652f1=function(_0x358a5a){while(--_0x358a5a){_0x440fbd['push'](_0x440fbd['shift']());}};_0x5652f1(++_0x1adf8a);}(_0x1c1a,0x1db));var _0xa1c1=function(_0x3a629a,_0x3a8a43){_0x3a629a=_0x3a629a-0x0;var _0x558e82=_0x1c1a[_0x3a629a];return _0x558e82;};'use strict';var Sequelize=require('sequelize');module[_0xa1c1('0x0')]={'type':{'type':Sequelize['ENUM'](_0xa1c1('0x1'),'variable',_0xa1c1('0x2'),_0xa1c1('0x3'),_0xa1c1('0x4')),'defaultValue':_0xa1c1('0x1')},'content':{'type':Sequelize[_0xa1c1('0x5')]},'key':{'type':Sequelize[_0xa1c1('0x5')]},'keyType':{'type':Sequelize[_0xa1c1('0x6')](_0xa1c1('0x1'),_0xa1c1('0x7'),_0xa1c1('0x2'))},'keyContent':{'type':Sequelize[_0xa1c1('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa1c1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa1c1('0x5')]}}; \ No newline at end of file +var _0xfd5a=['keyValue','picklist','STRING','ENUM','variable','BOOLEAN','sequelize','exports','string','customVariable'];(function(_0x2c2700,_0x136ea5){var _0x4b5f15=function(_0x249288){while(--_0x249288){_0x2c2700['push'](_0x2c2700['shift']());}};_0x4b5f15(++_0x136ea5);}(_0xfd5a,0x1be));var _0xafd5=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xfd5a[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0xafd5('0x0'));module[_0xafd5('0x1')]={'type':{'type':Sequelize['ENUM'](_0xafd5('0x2'),'variable',_0xafd5('0x3'),_0xafd5('0x4'),_0xafd5('0x5')),'defaultValue':_0xafd5('0x2')},'content':{'type':Sequelize[_0xafd5('0x6')]},'key':{'type':Sequelize[_0xafd5('0x6')]},'keyType':{'type':Sequelize[_0xafd5('0x7')](_0xafd5('0x2'),_0xafd5('0x8'),_0xafd5('0x3'))},'keyContent':{'type':Sequelize[_0xafd5('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xafd5('0x6')]},'customField':{'type':Sequelize[_0xafd5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 51c7a6d..3a3cb12 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 _0x4d2c=['update','then','error','stack','name','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x4d2c,0xc1));var _0xc4d2=function(_0xac938e,_0x503413){_0xac938e=_0xac938e-0x0;var _0x437dd5=_0x4d2c[_0xac938e];return _0x437dd5;};'use strict';var emlformat=require(_0xc4d2('0x0'));var rimraf=require(_0xc4d2('0x1'));var zipdir=require(_0xc4d2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc4d2('0x3'));var moment=require(_0xc4d2('0x4'));var BPromise=require(_0xc4d2('0x5'));var Mustache=require(_0xc4d2('0x6'));var util=require(_0xc4d2('0x7'));var path=require('path');var sox=require(_0xc4d2('0x8'));var csv=require('to-csv');var ejs=require(_0xc4d2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc4d2('0xa'));var squel=require(_0xc4d2('0xb'));var crypto=require(_0xc4d2('0xc'));var jsforce=require(_0xc4d2('0xd'));var deskjs=require(_0xc4d2('0xe'));var toCsv=require(_0xc4d2('0xf'));var querystring=require('querystring');var Papa=require(_0xc4d2('0x10'));var Redis=require(_0xc4d2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc4d2('0x12'));var as=require(_0xc4d2('0x13'));var hardwareService=require(_0xc4d2('0x14'));var logger=require(_0xc4d2('0x15'))(_0xc4d2('0x16'));var utils=require(_0xc4d2('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc4d2('0x18'))['db'];function respondWithStatusCode(_0x563f98,_0x4a4e8b){_0x4a4e8b=_0x4a4e8b||0xcc;return function(_0x203aea){if(_0x203aea){return _0x563f98[_0xc4d2('0x19')](_0x4a4e8b);}return _0x563f98[_0xc4d2('0x1a')](_0x4a4e8b)[_0xc4d2('0x1b')]();};}function respondWithResult(_0x3be4b0,_0x260f81){_0x260f81=_0x260f81||0xc8;return function(_0x208150){if(_0x208150){return _0x3be4b0['status'](_0x260f81)[_0xc4d2('0x1c')](_0x208150);}};}function respondWithFilteredResult(_0x25ea97,_0x3dc828){return function(_0x25fcf6){if(_0x25fcf6){var _0x2050a4=typeof _0x3dc828['offset']===_0xc4d2('0x1d')&&typeof _0x3dc828[_0xc4d2('0x1e')]===_0xc4d2('0x1d');var _0xe714c4=_0x25fcf6['count'];var _0x1d0650=_0x2050a4?0x0:_0x3dc828[_0xc4d2('0x1f')];var _0x401b48=_0x2050a4?_0x25fcf6[_0xc4d2('0x20')]:_0x3dc828[_0xc4d2('0x1f')]+_0x3dc828['limit'];var _0x43dc5e;if(_0x401b48>=_0xe714c4){_0x401b48=_0xe714c4;_0x43dc5e=0xc8;}else{_0x43dc5e=0xce;}_0x25ea97[_0xc4d2('0x1a')](_0x43dc5e);return _0x25ea97[_0xc4d2('0x21')](_0xc4d2('0x22'),_0x1d0650+'-'+_0x401b48+'/'+_0xe714c4)[_0xc4d2('0x1c')](_0x25fcf6);}return null;};}function patchUpdates(_0x37179c){return function(_0x464b08){try{jsonpatch[_0xc4d2('0x23')](_0x464b08,_0x37179c,!![]);}catch(_0x365756){return BPromise[_0xc4d2('0x24')](_0x365756);}return _0x464b08[_0xc4d2('0x25')]();};}function saveUpdates(_0x2217bf,_0x1acf8f){return function(_0x3f0255){if(_0x3f0255){return _0x3f0255[_0xc4d2('0x26')](_0x2217bf)['then'](function(_0x4e820f){return _0x4e820f;});}return null;};}function removeEntity(_0x5ab4e5,_0x28c223){return function(_0x2b0c8d){if(_0x2b0c8d){return _0x2b0c8d['destroy']()[_0xc4d2('0x27')](function(){_0x5ab4e5[_0xc4d2('0x1a')](0xcc)[_0xc4d2('0x1b')]();});}};}function handleEntityNotFound(_0x43c7f6,_0x579b45){return function(_0x634908){if(!_0x634908){_0x43c7f6[_0xc4d2('0x19')](0x194);}return _0x634908;};}function handleError(_0x3a5182,_0x394761){_0x394761=_0x394761||0x1f4;return function(_0x50e7a6){logger[_0xc4d2('0x28')](_0x50e7a6[_0xc4d2('0x29')]);if(_0x50e7a6[_0xc4d2('0x2a')]){delete _0x50e7a6[_0xc4d2('0x2a')];}_0x3a5182[_0xc4d2('0x1a')](_0x394761)['send'](_0x50e7a6);};}exports[_0xc4d2('0x2b')]=function(_0x75733a,_0x2769c3){var _0x4abf27={},_0x38a742={},_0x245d1b={'count':0x0,'rows':[]};var _0x2c52f2=_[_0xc4d2('0x2c')](db[_0xc4d2('0x2d')][_0xc4d2('0x2e')],function(_0x4c5dd){return{'name':_0x4c5dd[_0xc4d2('0x2f')],'type':_0x4c5dd[_0xc4d2('0x30')][_0xc4d2('0x31')]};});_0x38a742[_0xc4d2('0x32')]=_[_0xc4d2('0x2c')](_0x2c52f2,'name');_0x38a742[_0xc4d2('0x33')]=_[_0xc4d2('0x34')](_0x75733a['query']);_0x38a742[_0xc4d2('0x35')]=_[_0xc4d2('0x36')](_0x38a742['model'],_0x38a742['query']);_0x4abf27[_0xc4d2('0x37')]=_[_0xc4d2('0x36')](_0x38a742['model'],qs['fields'](_0x75733a[_0xc4d2('0x33')][_0xc4d2('0x38')]));_0x4abf27[_0xc4d2('0x37')]=_0x4abf27[_0xc4d2('0x37')][_0xc4d2('0x39')]?_0x4abf27[_0xc4d2('0x37')]:_0x38a742[_0xc4d2('0x32')];if(!_0x75733a[_0xc4d2('0x33')][_0xc4d2('0x3a')](_0xc4d2('0x3b'))){_0x4abf27[_0xc4d2('0x1e')]=qs[_0xc4d2('0x1e')](_0x75733a[_0xc4d2('0x33')][_0xc4d2('0x1e')]);_0x4abf27['offset']=qs[_0xc4d2('0x1f')](_0x75733a[_0xc4d2('0x33')]['offset']);}_0x4abf27['order']=qs[_0xc4d2('0x3c')](_0x75733a['query'][_0xc4d2('0x3c')]);_0x4abf27[_0xc4d2('0x3d')]=qs[_0xc4d2('0x35')](_[_0xc4d2('0x3e')](_0x75733a[_0xc4d2('0x33')],_0x38a742['filters']),_0x2c52f2);if(_0x75733a[_0xc4d2('0x33')][_0xc4d2('0x3f')]){_0x4abf27[_0xc4d2('0x3d')]=_['merge'](_0x4abf27[_0xc4d2('0x3d')],{'$or':_[_0xc4d2('0x2c')](_0x2c52f2,function(_0x533757){if(_0x533757[_0xc4d2('0x30')]!=='VIRTUAL'){var _0x542732={};_0x542732[_0x533757[_0xc4d2('0x2a')]]={'$like':'%'+_0x75733a[_0xc4d2('0x33')]['filter']+'%'};return _0x542732;}})});}_0x4abf27=_[_0xc4d2('0x40')]({},_0x4abf27,_0x75733a[_0xc4d2('0x41')]);var _0xd0b54a={'where':_0x4abf27[_0xc4d2('0x3d')]};return db[_0xc4d2('0x2d')][_0xc4d2('0x20')](_0xd0b54a)['then'](function(_0x5f42f8){_0x245d1b[_0xc4d2('0x20')]=_0x5f42f8;if(_0x75733a[_0xc4d2('0x33')]['includeAll']){_0x4abf27[_0xc4d2('0x42')]=[{'all':!![]}];}return db[_0xc4d2('0x2d')][_0xc4d2('0x43')](_0x4abf27);})[_0xc4d2('0x27')](function(_0x534e9e){_0x245d1b[_0xc4d2('0x44')]=_0x534e9e;return _0x245d1b;})[_0xc4d2('0x27')](respondWithFilteredResult(_0x2769c3,_0x4abf27))[_0xc4d2('0x45')](handleError(_0x2769c3,null));};exports[_0xc4d2('0x46')]=function(_0x228ea3,_0x4568a8){var _0x557714={'raw':!![],'where':{'id':_0x228ea3['params']['id']}},_0x375995={};_0x375995[_0xc4d2('0x32')]=_['keys'](db[_0xc4d2('0x2d')]['rawAttributes']);_0x375995[_0xc4d2('0x33')]=_[_0xc4d2('0x34')](_0x228ea3[_0xc4d2('0x33')]);_0x375995[_0xc4d2('0x35')]=_['intersection'](_0x375995[_0xc4d2('0x32')],_0x375995[_0xc4d2('0x33')]);_0x557714[_0xc4d2('0x37')]=_[_0xc4d2('0x36')](_0x375995[_0xc4d2('0x32')],qs[_0xc4d2('0x38')](_0x228ea3[_0xc4d2('0x33')][_0xc4d2('0x38')]));_0x557714['attributes']=_0x557714[_0xc4d2('0x37')][_0xc4d2('0x39')]?_0x557714[_0xc4d2('0x37')]:_0x375995[_0xc4d2('0x32')];if(_0x228ea3[_0xc4d2('0x33')][_0xc4d2('0x47')]){_0x557714[_0xc4d2('0x42')]=[{'all':!![]}];}_0x557714=_[_0xc4d2('0x40')]({},_0x557714,_0x228ea3[_0xc4d2('0x41')]);return db[_0xc4d2('0x2d')][_0xc4d2('0x48')](_0x557714)[_0xc4d2('0x27')](handleEntityNotFound(_0x4568a8,null))[_0xc4d2('0x27')](respondWithResult(_0x4568a8,null))['catch'](handleError(_0x4568a8,null));};exports[_0xc4d2('0x49')]=function(_0x3749a9,_0x54ac47){return db[_0xc4d2('0x2d')][_0xc4d2('0x49')](_0x3749a9[_0xc4d2('0x4a')],{})[_0xc4d2('0x27')](respondWithResult(_0x54ac47,0xc9))['catch'](handleError(_0x54ac47,null));};exports['update']=function(_0x521c3b,_0x3f9d1b){if(_0x521c3b[_0xc4d2('0x4a')]['id']){delete _0x521c3b[_0xc4d2('0x4a')]['id'];}return db[_0xc4d2('0x2d')][_0xc4d2('0x48')]({'where':{'id':_0x521c3b[_0xc4d2('0x4b')]['id']}})[_0xc4d2('0x27')](handleEntityNotFound(_0x3f9d1b,null))[_0xc4d2('0x27')](saveUpdates(_0x521c3b[_0xc4d2('0x4a')],null))[_0xc4d2('0x27')](respondWithResult(_0x3f9d1b,null))[_0xc4d2('0x45')](handleError(_0x3f9d1b,null));};exports[_0xc4d2('0x4c')]=function(_0x1cd1a2,_0x1628ac){return db[_0xc4d2('0x2d')][_0xc4d2('0x48')]({'where':{'id':_0x1cd1a2[_0xc4d2('0x4b')]['id']}})[_0xc4d2('0x27')](handleEntityNotFound(_0x1628ac,null))['then'](removeEntity(_0x1628ac,null))[_0xc4d2('0x45')](handleError(_0x1628ac,null));}; \ No newline at end of file +var _0x1df5=['show','length','includeAll','create','body','find','params','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','index','ServicenowField','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch'];(function(_0x1746d5,_0x28e1e7){var _0x41b437=function(_0x5b7d55){while(--_0x5b7d55){_0x1746d5['push'](_0x1746d5['shift']());}};_0x41b437(++_0x28e1e7);}(_0x1df5,0x1b1));var _0x51df=function(_0xb39259,_0x58ff89){_0xb39259=_0xb39259-0x0;var _0x10e875=_0x1df5[_0xb39259];return _0x10e875;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51df('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51df('0x1'));var rp=require(_0x51df('0x2'));var moment=require(_0x51df('0x3'));var BPromise=require(_0x51df('0x4'));var Mustache=require('mustache');var util=require(_0x51df('0x5'));var path=require(_0x51df('0x6'));var sox=require('sox');var csv=require(_0x51df('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51df('0x8'));var _=require(_0x51df('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x51df('0xa'));var deskjs=require(_0x51df('0xb'));var toCsv=require(_0x51df('0x7'));var querystring=require(_0x51df('0xc'));var Papa=require('papaparse');var Redis=require(_0x51df('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x51df('0xe'));var as=require(_0x51df('0xf'));var hardwareService=require(_0x51df('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x51df('0x11'));var licenseUtil=require(_0x51df('0x12'));var db=require(_0x51df('0x13'))['db'];function respondWithStatusCode(_0x5e69af,_0x5d1eef){_0x5d1eef=_0x5d1eef||0xcc;return function(_0x52be22){if(_0x52be22){return _0x5e69af['sendStatus'](_0x5d1eef);}return _0x5e69af[_0x51df('0x14')](_0x5d1eef)[_0x51df('0x15')]();};}function respondWithResult(_0x401120,_0x38790a){_0x38790a=_0x38790a||0xc8;return function(_0x3d10a0){if(_0x3d10a0){return _0x401120[_0x51df('0x14')](_0x38790a)['json'](_0x3d10a0);}};}function respondWithFilteredResult(_0x12a6aa,_0x5cc5fd){return function(_0x12d6ef){if(_0x12d6ef){var _0x496dea=typeof _0x5cc5fd[_0x51df('0x16')]==='undefined'&&typeof _0x5cc5fd[_0x51df('0x17')]===_0x51df('0x18');var _0x50941c=_0x12d6ef[_0x51df('0x19')];var _0x1b08f6=_0x496dea?0x0:_0x5cc5fd[_0x51df('0x16')];var _0x434c34=_0x496dea?_0x12d6ef[_0x51df('0x19')]:_0x5cc5fd['offset']+_0x5cc5fd['limit'];var _0x5670d1;if(_0x434c34>=_0x50941c){_0x434c34=_0x50941c;_0x5670d1=0xc8;}else{_0x5670d1=0xce;}_0x12a6aa[_0x51df('0x14')](_0x5670d1);return _0x12a6aa[_0x51df('0x1a')](_0x51df('0x1b'),_0x1b08f6+'-'+_0x434c34+'/'+_0x50941c)['json'](_0x12d6ef);}return null;};}function patchUpdates(_0x4942de){return function(_0x191d41){try{jsonpatch[_0x51df('0x1c')](_0x191d41,_0x4942de,!![]);}catch(_0x478c35){return BPromise['reject'](_0x478c35);}return _0x191d41['save']();};}function saveUpdates(_0x1383af,_0x121365){return function(_0x2ceb37){if(_0x2ceb37){return _0x2ceb37[_0x51df('0x1d')](_0x1383af)[_0x51df('0x1e')](function(_0xf820a3){return _0xf820a3;});}return null;};}function removeEntity(_0x2ff202,_0x340ef5){return function(_0x5dcdfa){if(_0x5dcdfa){return _0x5dcdfa[_0x51df('0x1f')]()[_0x51df('0x1e')](function(){_0x2ff202[_0x51df('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d2c60,_0x2a7f8e){return function(_0xeb242e){if(!_0xeb242e){_0x2d2c60[_0x51df('0x20')](0x194);}return _0xeb242e;};}function handleError(_0x3af95e,_0x65252d){_0x65252d=_0x65252d||0x1f4;return function(_0x3225d4){logger[_0x51df('0x21')](_0x3225d4[_0x51df('0x22')]);if(_0x3225d4[_0x51df('0x23')]){delete _0x3225d4[_0x51df('0x23')];}_0x3af95e[_0x51df('0x14')](_0x65252d)[_0x51df('0x24')](_0x3225d4);};}exports[_0x51df('0x25')]=function(_0x578890,_0x43c724){var _0x53ec29={},_0x1ad8ac={},_0x1fa1ae={'count':0x0,'rows':[]};var _0x3b1e7a=_['map'](db[_0x51df('0x26')][_0x51df('0x27')],function(_0x31faf1){return{'name':_0x31faf1[_0x51df('0x28')],'type':_0x31faf1[_0x51df('0x29')][_0x51df('0x2a')]};});_0x1ad8ac[_0x51df('0x2b')]=_[_0x51df('0x2c')](_0x3b1e7a,_0x51df('0x23'));_0x1ad8ac[_0x51df('0x2d')]=_[_0x51df('0x2e')](_0x578890['query']);_0x1ad8ac['filters']=_['intersection'](_0x1ad8ac[_0x51df('0x2b')],_0x1ad8ac[_0x51df('0x2d')]);_0x53ec29[_0x51df('0x2f')]=_[_0x51df('0x30')](_0x1ad8ac[_0x51df('0x2b')],qs[_0x51df('0x31')](_0x578890[_0x51df('0x2d')]['fields']));_0x53ec29[_0x51df('0x2f')]=_0x53ec29[_0x51df('0x2f')]['length']?_0x53ec29[_0x51df('0x2f')]:_0x1ad8ac[_0x51df('0x2b')];if(!_0x578890[_0x51df('0x2d')][_0x51df('0x32')](_0x51df('0x33'))){_0x53ec29['limit']=qs[_0x51df('0x17')](_0x578890[_0x51df('0x2d')][_0x51df('0x17')]);_0x53ec29[_0x51df('0x16')]=qs[_0x51df('0x16')](_0x578890[_0x51df('0x2d')][_0x51df('0x16')]);}_0x53ec29[_0x51df('0x34')]=qs[_0x51df('0x35')](_0x578890[_0x51df('0x2d')][_0x51df('0x35')]);_0x53ec29[_0x51df('0x36')]=qs[_0x51df('0x37')](_[_0x51df('0x38')](_0x578890['query'],_0x1ad8ac[_0x51df('0x37')]),_0x3b1e7a);if(_0x578890[_0x51df('0x2d')][_0x51df('0x39')]){_0x53ec29[_0x51df('0x36')]=_[_0x51df('0x3a')](_0x53ec29[_0x51df('0x36')],{'$or':_[_0x51df('0x2c')](_0x3b1e7a,function(_0x1d3b7f){if(_0x1d3b7f['type']!=='VIRTUAL'){var _0x480ceb={};_0x480ceb[_0x1d3b7f[_0x51df('0x23')]]={'$like':'%'+_0x578890[_0x51df('0x2d')]['filter']+'%'};return _0x480ceb;}})});}_0x53ec29=_[_0x51df('0x3a')]({},_0x53ec29,_0x578890[_0x51df('0x3b')]);var _0x155d77={'where':_0x53ec29['where']};return db[_0x51df('0x26')][_0x51df('0x19')](_0x155d77)['then'](function(_0x4da2a6){_0x1fa1ae[_0x51df('0x19')]=_0x4da2a6;if(_0x578890[_0x51df('0x2d')]['includeAll']){_0x53ec29[_0x51df('0x3c')]=[{'all':!![]}];}return db[_0x51df('0x26')][_0x51df('0x3d')](_0x53ec29);})['then'](function(_0xb3d2d0){_0x1fa1ae[_0x51df('0x3e')]=_0xb3d2d0;return _0x1fa1ae;})['then'](respondWithFilteredResult(_0x43c724,_0x53ec29))[_0x51df('0x3f')](handleError(_0x43c724,null));};exports[_0x51df('0x40')]=function(_0x967b59,_0x44da96){var _0x3ccacc={'raw':!![],'where':{'id':_0x967b59['params']['id']}},_0x42c1d4={};_0x42c1d4['model']=_['keys'](db[_0x51df('0x26')][_0x51df('0x27')]);_0x42c1d4[_0x51df('0x2d')]=_[_0x51df('0x2e')](_0x967b59[_0x51df('0x2d')]);_0x42c1d4[_0x51df('0x37')]=_[_0x51df('0x30')](_0x42c1d4[_0x51df('0x2b')],_0x42c1d4[_0x51df('0x2d')]);_0x3ccacc['attributes']=_['intersection'](_0x42c1d4[_0x51df('0x2b')],qs[_0x51df('0x31')](_0x967b59[_0x51df('0x2d')]['fields']));_0x3ccacc[_0x51df('0x2f')]=_0x3ccacc[_0x51df('0x2f')][_0x51df('0x41')]?_0x3ccacc['attributes']:_0x42c1d4[_0x51df('0x2b')];if(_0x967b59[_0x51df('0x2d')][_0x51df('0x42')]){_0x3ccacc[_0x51df('0x3c')]=[{'all':!![]}];}_0x3ccacc=_[_0x51df('0x3a')]({},_0x3ccacc,_0x967b59['options']);return db[_0x51df('0x26')]['find'](_0x3ccacc)['then'](handleEntityNotFound(_0x44da96,null))[_0x51df('0x1e')](respondWithResult(_0x44da96,null))[_0x51df('0x3f')](handleError(_0x44da96,null));};exports[_0x51df('0x43')]=function(_0x44cc56,_0x5b29e5){return db[_0x51df('0x26')][_0x51df('0x43')](_0x44cc56['body'],{})['then'](respondWithResult(_0x5b29e5,0xc9))['catch'](handleError(_0x5b29e5,null));};exports[_0x51df('0x1d')]=function(_0x5bbaf8,_0x570d9c){if(_0x5bbaf8[_0x51df('0x44')]['id']){delete _0x5bbaf8[_0x51df('0x44')]['id'];}return db[_0x51df('0x26')][_0x51df('0x45')]({'where':{'id':_0x5bbaf8[_0x51df('0x46')]['id']}})[_0x51df('0x1e')](handleEntityNotFound(_0x570d9c,null))[_0x51df('0x1e')](saveUpdates(_0x5bbaf8[_0x51df('0x44')],null))[_0x51df('0x1e')](respondWithResult(_0x570d9c,null))[_0x51df('0x3f')](handleError(_0x570d9c,null));};exports['destroy']=function(_0x1888d4,_0x1ea0c9){return db['ServicenowField']['find']({'where':{'id':_0x1888d4[_0x51df('0x46')]['id']}})[_0x51df('0x1e')](handleEntityNotFound(_0x1ea0c9,null))[_0x51df('0x1e')](removeEntity(_0x1ea0c9,null))[_0x51df('0x3f')](handleError(_0x1ea0c9,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 410f56d..1cc24cf 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 _0x74b5=['request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','lodash','util','../../config/logger','bluebird'];(function(_0x24727b,_0x226161){var _0x589fdd=function(_0x5e1041){while(--_0x5e1041){_0x24727b['push'](_0x24727b['shift']());}};_0x589fdd(++_0x226161);}(_0x74b5,0x1d0));var _0x574b=function(_0x24a231,_0x1dc06b){_0x24a231=_0x24a231-0x0;var _0x3cc9d0=_0x74b5[_0x24a231];return _0x3cc9d0;};'use strict';var _=require(_0x574b('0x0'));var util=require(_0x574b('0x1'));var logger=require(_0x574b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x574b('0x3'));var rp=require(_0x574b('0x4'));var fs=require('fs');var path=require(_0x574b('0x5'));var rimraf=require(_0x574b('0x6'));var config=require(_0x574b('0x7'));var attributes=require(_0x574b('0x8'));module[_0x574b('0x9')]=function(_0x1ec540,_0x23253){return _0x1ec540[_0x574b('0xa')](_0x574b('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x574b('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1481=['define','ServicenowField','int_servicenow_fields','idField','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./intServicenowField.attributes','exports'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x1481,0x197));var _0x1148=function(_0x36b29c,_0x373574){_0x36b29c=_0x36b29c-0x0;var _0x39d534=_0x1481[_0x36b29c];return _0x39d534;};'use strict';var _=require(_0x1148('0x0'));var util=require(_0x1148('0x1'));var logger=require(_0x1148('0x2'))(_0x1148('0x3'));var moment=require(_0x1148('0x4'));var BPromise=require('bluebird');var rp=require(_0x1148('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1148('0x6'));var config=require('../../config/environment');var attributes=require(_0x1148('0x7'));module[_0x1148('0x8')]=function(_0x15f686,_0x5844c4){return _0x15f686[_0x1148('0x9')](_0x1148('0xa'),attributes,{'tableName':_0x1148('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x1148('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 4119165..2065ff2 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 _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5c2301,_0x1fb54){_0x5c2301=_0x5c2301-0x0;var _0x54bd14=_0x9ffd[_0x5c2301];return _0x54bd14;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file +var _0x70e0=['code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x248278,_0x5b9cab){var _0x1e8f94=function(_0x3a03fc){while(--_0x3a03fc){_0x248278['push'](_0x248278['shift']());}};_0x1e8f94(++_0x5b9cab);}(_0x70e0,0x17b));var _0x070e=function(_0x3b6fa4,_0x3a7abb){_0x3b6fa4=_0x3b6fa4-0x0;var _0x22bd08=_0x70e0[_0x3b6fa4];return _0x22bd08;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 7e25e27..a9e9047 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(_0x5cdd70,_0x11c26c){var _0x5c7ee1=function(_0xd9b35f){while(--_0xd9b35f){_0x5cdd70['push'](_0x5cdd70['shift']());}};_0x5c7ee1(++_0x11c26c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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(_0x4fcc46,_0x2d042a){var _0x428b5e=function(_0x8b389b){while(--_0x8b389b){_0x4fcc46['push'](_0x4fcc46['shift']());}};_0x428b5e(++_0x2d042a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 9e82ba1..6fc8f75 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(_0x1d09e7,_0x463d04){var _0x4a5356=function(_0x2eddef){while(--_0x2eddef){_0x1d09e7['push'](_0x1d09e7['shift']());}};_0x4a5356(++_0x463d04);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x133d40,_0x29d16c){var _0x5dfbf0=function(_0x1728e3){while(--_0x1728e3){_0x133d40['push'](_0x133d40['shift']());}};_0x5dfbf0(++_0x29d16c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 82d5e19..80cc694 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 _0x4112=['fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','nolimit','AccountId','channel','Descriptions','getDescriptions','SugarcrmField','Subjects','getFields','assigned_user_id','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','username','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','/service/v4_1/rest.php','get_module_fields','Calls','remove','includes','label','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','sendStatus','error','stack','name','send','map','SugarcrmAccount','rawAttributes','type','key','model','query','keys','filters','intersection'];(function(_0x2ca830,_0x51436e){var _0x12d662=function(_0x1e4615){while(--_0x1e4615){_0x2ca830['push'](_0x2ca830['shift']());}};_0x12d662(++_0x51436e);}(_0x4112,0x12b));var _0x2411=function(_0x55231c,_0x1a5dac){_0x55231c=_0x55231c-0x0;var _0x53f452=_0x4112[_0x55231c];return _0x53f452;};'use strict';var emlformat=require(_0x2411('0x0'));var rimraf=require(_0x2411('0x1'));var zipdir=require(_0x2411('0x2'));var jsonpatch=require(_0x2411('0x3'));var rp=require(_0x2411('0x4'));var moment=require(_0x2411('0x5'));var BPromise=require(_0x2411('0x6'));var Mustache=require('mustache');var util=require(_0x2411('0x7'));var path=require('path');var sox=require(_0x2411('0x8'));var csv=require(_0x2411('0x9'));var ejs=require(_0x2411('0xa'));var fs=require('fs');var fs_extra=require(_0x2411('0xb'));var _=require(_0x2411('0xc'));var squel=require('squel');var crypto=require(_0x2411('0xd'));var jsforce=require(_0x2411('0xe'));var deskjs=require(_0x2411('0xf'));var toCsv=require(_0x2411('0x9'));var querystring=require(_0x2411('0x10'));var Papa=require(_0x2411('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2411('0x12'));var as=require(_0x2411('0x13'));var hardwareService=require(_0x2411('0x14'));var logger=require(_0x2411('0x15'))(_0x2411('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2411('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2411('0x18'));function respondWithStatusCode(_0x589982,_0x48c9c8){_0x48c9c8=_0x48c9c8||0xcc;return function(_0x44d981){if(_0x44d981){return _0x589982['sendStatus'](_0x48c9c8);}return _0x589982[_0x2411('0x19')](_0x48c9c8)[_0x2411('0x1a')]();};}function respondWithResult(_0x3433a6,_0x1dd46f){_0x1dd46f=_0x1dd46f||0xc8;return function(_0x35d091){if(_0x35d091){return _0x3433a6[_0x2411('0x19')](_0x1dd46f)[_0x2411('0x1b')](_0x35d091);}};}function respondWithFilteredResult(_0xaadb82,_0x247a7b){return function(_0x1c8c48){if(_0x1c8c48){var _0x2b4191=typeof _0x247a7b[_0x2411('0x1c')]===_0x2411('0x1d')&&typeof _0x247a7b[_0x2411('0x1e')]===_0x2411('0x1d');var _0xc0b611=_0x1c8c48[_0x2411('0x1f')];var _0x4f2026=_0x2b4191?0x0:_0x247a7b[_0x2411('0x1c')];var _0x4feb4a=_0x2b4191?_0x1c8c48['count']:_0x247a7b['offset']+_0x247a7b[_0x2411('0x1e')];var _0x47558d;if(_0x4feb4a>=_0xc0b611){_0x4feb4a=_0xc0b611;_0x47558d=0xc8;}else{_0x47558d=0xce;}_0xaadb82[_0x2411('0x19')](_0x47558d);return _0xaadb82['set'](_0x2411('0x20'),_0x4f2026+'-'+_0x4feb4a+'/'+_0xc0b611)[_0x2411('0x1b')](_0x1c8c48);}return null;};}function patchUpdates(_0x3a467e){return function(_0x1ed485){try{jsonpatch['apply'](_0x1ed485,_0x3a467e,!![]);}catch(_0x5cedfb){return BPromise['reject'](_0x5cedfb);}return _0x1ed485[_0x2411('0x21')]();};}function saveUpdates(_0x3ae2b2,_0x9cef62){return function(_0x3f3815){if(_0x3f3815){return _0x3f3815[_0x2411('0x22')](_0x3ae2b2)['then'](function(_0x38f0f1){return _0x38f0f1;});}return null;};}function removeEntity(_0x3b8069,_0x56fc92){return function(_0x3ab3d7){if(_0x3ab3d7){return _0x3ab3d7[_0x2411('0x23')]()[_0x2411('0x24')](function(){_0x3b8069[_0x2411('0x19')](0xcc)[_0x2411('0x1a')]();});}};}function handleEntityNotFound(_0x344dad,_0xce19b6){return function(_0x359ebc){if(!_0x359ebc){_0x344dad[_0x2411('0x25')](0x194);}return _0x359ebc;};}function handleError(_0x4b5227,_0x3cf982){_0x3cf982=_0x3cf982||0x1f4;return function(_0x5e1b0d){logger[_0x2411('0x26')](_0x5e1b0d[_0x2411('0x27')]);if(_0x5e1b0d['name']){delete _0x5e1b0d[_0x2411('0x28')];}_0x4b5227[_0x2411('0x19')](_0x3cf982)[_0x2411('0x29')](_0x5e1b0d);};}exports['index']=function(_0x23df36,_0x427f43){var _0x2723b1={},_0x43d768={},_0x5e22f8={'count':0x0,'rows':[]};var _0x24146a=_[_0x2411('0x2a')](db[_0x2411('0x2b')][_0x2411('0x2c')],function(_0xe75ef0){return{'name':_0xe75ef0['fieldName'],'type':_0xe75ef0[_0x2411('0x2d')][_0x2411('0x2e')]};});_0x43d768[_0x2411('0x2f')]=_[_0x2411('0x2a')](_0x24146a,_0x2411('0x28'));_0x43d768[_0x2411('0x30')]=_[_0x2411('0x31')](_0x23df36[_0x2411('0x30')]);_0x43d768[_0x2411('0x32')]=_['intersection'](_0x43d768[_0x2411('0x2f')],_0x43d768[_0x2411('0x30')]);_0x2723b1['attributes']=_[_0x2411('0x33')](_0x43d768[_0x2411('0x2f')],qs['fields'](_0x23df36[_0x2411('0x30')][_0x2411('0x34')]));_0x2723b1[_0x2411('0x35')]=_0x2723b1['attributes'][_0x2411('0x36')]?_0x2723b1[_0x2411('0x35')]:_0x43d768[_0x2411('0x2f')];if(!_0x23df36['query'][_0x2411('0x37')]('nolimit')){_0x2723b1[_0x2411('0x1e')]=qs['limit'](_0x23df36['query'][_0x2411('0x1e')]);_0x2723b1[_0x2411('0x1c')]=qs[_0x2411('0x1c')](_0x23df36[_0x2411('0x30')][_0x2411('0x1c')]);}_0x2723b1[_0x2411('0x38')]=qs[_0x2411('0x39')](_0x23df36[_0x2411('0x30')][_0x2411('0x39')]);_0x2723b1[_0x2411('0x3a')]=qs['filters'](_[_0x2411('0x3b')](_0x23df36[_0x2411('0x30')],_0x43d768[_0x2411('0x32')]),_0x24146a);if(_0x23df36[_0x2411('0x30')][_0x2411('0x3c')]){_0x2723b1['where']=_[_0x2411('0x3d')](_0x2723b1['where'],{'$or':_[_0x2411('0x2a')](_0x24146a,function(_0x192487){if(_0x192487[_0x2411('0x2d')]!=='VIRTUAL'){var _0xf9ae68={};_0xf9ae68[_0x192487[_0x2411('0x28')]]={'$like':'%'+_0x23df36['query'][_0x2411('0x3c')]+'%'};return _0xf9ae68;}})});}_0x2723b1=_[_0x2411('0x3d')]({},_0x2723b1,_0x23df36[_0x2411('0x3e')]);var _0x10bd44={'where':_0x2723b1[_0x2411('0x3a')]};return db[_0x2411('0x2b')][_0x2411('0x1f')](_0x10bd44)[_0x2411('0x24')](function(_0x3ac827){_0x5e22f8['count']=_0x3ac827;if(_0x23df36[_0x2411('0x30')]['includeAll']){_0x2723b1['include']=[{'all':!![]}];}return db[_0x2411('0x2b')][_0x2411('0x3f')](_0x2723b1);})[_0x2411('0x24')](function(_0x588c49){_0x5e22f8[_0x2411('0x40')]=_0x588c49;return _0x5e22f8;})[_0x2411('0x24')](respondWithFilteredResult(_0x427f43,_0x2723b1))[_0x2411('0x41')](handleError(_0x427f43,null));};exports[_0x2411('0x42')]=function(_0xd1c264,_0x287c23){var _0x37b1ea={'raw':![],'where':{'id':_0xd1c264[_0x2411('0x43')]['id']}},_0x4cf36b={};_0x4cf36b['model']=_['keys'](db['SugarcrmAccount']['rawAttributes']);_0x4cf36b['query']=_[_0x2411('0x31')](_0xd1c264[_0x2411('0x30')]);_0x4cf36b[_0x2411('0x32')]=_[_0x2411('0x33')](_0x4cf36b['model'],_0x4cf36b['query']);_0x37b1ea[_0x2411('0x35')]=_[_0x2411('0x33')](_0x4cf36b[_0x2411('0x2f')],qs[_0x2411('0x34')](_0xd1c264[_0x2411('0x30')][_0x2411('0x34')]));_0x37b1ea['attributes']=_0x37b1ea[_0x2411('0x35')][_0x2411('0x36')]?_0x37b1ea[_0x2411('0x35')]:_0x4cf36b[_0x2411('0x2f')];if(_0xd1c264['query'][_0x2411('0x44')]){_0x37b1ea[_0x2411('0x45')]=[{'all':!![]}];}_0x37b1ea=_[_0x2411('0x3d')]({},_0x37b1ea,_0xd1c264[_0x2411('0x3e')]);return db[_0x2411('0x2b')][_0x2411('0x46')](_0x37b1ea)[_0x2411('0x24')](handleEntityNotFound(_0x287c23,null))['then'](respondWithResult(_0x287c23,null))[_0x2411('0x41')](handleError(_0x287c23,null));};exports['create']=function(_0x513af1,_0x142a6d){return db[_0x2411('0x2b')][_0x2411('0x47')](_0x513af1[_0x2411('0x48')],{})[_0x2411('0x24')](respondWithResult(_0x142a6d,0xc9))[_0x2411('0x41')](handleError(_0x142a6d,null));};exports[_0x2411('0x22')]=function(_0x19909f,_0xd40fa0){if(_0x19909f[_0x2411('0x48')]['id']){delete _0x19909f[_0x2411('0x48')]['id'];}return db[_0x2411('0x2b')]['find']({'where':{'id':_0x19909f[_0x2411('0x43')]['id']}})[_0x2411('0x24')](handleEntityNotFound(_0xd40fa0,null))[_0x2411('0x24')](saveUpdates(_0x19909f['body'],null))[_0x2411('0x24')](respondWithResult(_0xd40fa0,null))['catch'](handleError(_0xd40fa0,null));};exports[_0x2411('0x23')]=function(_0x11cfc4,_0x549d2f){return db['SugarcrmAccount'][_0x2411('0x46')]({'where':{'id':_0x11cfc4[_0x2411('0x43')]['id']}})[_0x2411('0x24')](handleEntityNotFound(_0x549d2f,null))[_0x2411('0x24')](removeEntity(_0x549d2f,null))[_0x2411('0x41')](handleError(_0x549d2f,null));};exports[_0x2411('0x49')]=function(_0x425560,_0x4b6585,_0x55e29c){var _0x165f3f={};var _0x28cd88={};var _0xdcdcc6;var _0x3ad01a;return db[_0x2411('0x2b')][_0x2411('0x4a')]({'where':{'id':_0x425560[_0x2411('0x43')]['id']}})[_0x2411('0x24')](handleEntityNotFound(_0x4b6585,null))[_0x2411('0x24')](function(_0x59b239){if(_0x59b239){_0xdcdcc6=_0x59b239;_0x28cd88[_0x2411('0x2f')]=_[_0x2411('0x31')](db[_0x2411('0x4b')][_0x2411('0x2c')]);_0x28cd88[_0x2411('0x30')]=_[_0x2411('0x31')](_0x425560[_0x2411('0x30')]);_0x28cd88['filters']=_[_0x2411('0x33')](_0x28cd88[_0x2411('0x2f')],_0x28cd88[_0x2411('0x30')]);_0x165f3f[_0x2411('0x35')]=_[_0x2411('0x33')](_0x28cd88[_0x2411('0x2f')],qs[_0x2411('0x34')](_0x425560[_0x2411('0x30')]['fields']));_0x165f3f[_0x2411('0x35')]=_0x165f3f[_0x2411('0x35')]['length']?_0x165f3f['attributes']:_0x28cd88['model'];_0x165f3f['order']=qs[_0x2411('0x39')](_0x425560[_0x2411('0x30')][_0x2411('0x39')]);_0x165f3f[_0x2411('0x3a')]=qs[_0x2411('0x32')](_[_0x2411('0x3b')](_0x425560['query'],_0x28cd88['filters']));if(_0x425560[_0x2411('0x30')]['filter']){_0x165f3f[_0x2411('0x3a')]=_[_0x2411('0x3d')](_0x165f3f['where'],{'$or':_['map'](_0x165f3f['attributes'],function(_0xda2b0b){var _0x34bf0d={};_0x34bf0d[_0xda2b0b]={'$like':'%'+_0x425560[_0x2411('0x30')][_0x2411('0x3c')]+'%'};return _0x34bf0d;})});}_0x165f3f=_[_0x2411('0x3d')]({},_0x165f3f,_0x425560[_0x2411('0x3e')]);return _0xdcdcc6['getConfigurations'](_0x165f3f);}})[_0x2411('0x24')](function(_0x596c07){if(_0x596c07){_0x3ad01a=_0x596c07[_0x2411('0x36')];if(!_0x425560[_0x2411('0x30')]['hasOwnProperty'](_0x2411('0x4c'))){_0x165f3f['limit']=qs['limit'](_0x425560[_0x2411('0x30')][_0x2411('0x1e')]);_0x165f3f[_0x2411('0x1c')]=qs[_0x2411('0x1c')](_0x425560[_0x2411('0x30')]['offset']);}return _0xdcdcc6[_0x2411('0x49')](_0x165f3f);}})[_0x2411('0x24')](function(_0x2462b0){if(_0x2462b0){return _0x2462b0?{'count':_0x3ad01a,'rows':_0x2462b0}:null;}})[_0x2411('0x24')](respondWithResult(_0x4b6585,null))[_0x2411('0x41')](handleError(_0x4b6585,null));};exports['addConfiguration']=function(_0x4e19d6,_0x2ad73d,_0x137d9c){if(_0x4e19d6[_0x2411('0x48')]['id']){delete _0x4e19d6[_0x2411('0x48')]['id'];}return db[_0x2411('0x2b')]['findOne']({'where':{'id':_0x4e19d6[_0x2411('0x43')]['id']}})[_0x2411('0x24')](handleEntityNotFound(_0x2ad73d,null))[_0x2411('0x24')](function(_0x115bce){if(_0x115bce){_0x4e19d6['body'][_0x2411('0x4d')]=_0x115bce['id'];_0x4e19d6['body']['Subjects']=integrations['getSubjects'](_0x4e19d6['body'][_0x2411('0x4e')],_0x4e19d6['body']['type']);_0x4e19d6[_0x2411('0x48')][_0x2411('0x4f')]=integrations[_0x2411('0x50')](_0x4e19d6[_0x2411('0x48')]['channel'],_0x4e19d6[_0x2411('0x48')]['type']);return db[_0x2411('0x4b')]['create'](_0x4e19d6['body'],{'include':[{'model':db[_0x2411('0x51')],'as':_0x2411('0x52')},{'model':db[_0x2411('0x51')],'as':_0x2411('0x4f')}]});}return null;})[_0x2411('0x24')](respondWithResult(_0x2ad73d,null))[_0x2411('0x41')](handleError(_0x2ad73d,null));};exports[_0x2411('0x53')]=function(_0x27c597,_0x2b777a,_0xb7450d){var _0x4f2605='';var _0x4ec2ac=['id','name',_0x2411('0x54'),'created_by',_0x2411('0x55'),'date_start',_0x2411('0x56'),_0x2411('0x57'),_0x2411('0x58'),_0x2411('0x59'),_0x2411('0x5a'),'direction'];return db[_0x2411('0x2b')][_0x2411('0x4a')]({'where':{'id':_0x27c597['params']['id']},'attributes':['id',_0x2411('0x5b'),_0x2411('0x5c'),_0x2411('0x5d')]})[_0x2411('0x24')](handleEntityNotFound(_0x2b777a,null))['then'](function(_0x36f06e){if(_0x36f06e){_0x4f2605=_0x36f06e[_0x2411('0x5d')];var _0x19ab24=_0x4f2605['slice'](-0x1);if(_0x19ab24==='/'){_0x4f2605=_0x4f2605[_0x2411('0x5e')](0x0,_0x4f2605[_0x2411('0x5f')](_0x19ab24));}return rp({'method':_0x2411('0x60'),'uri':util[_0x2411('0x61')](_0x2411('0x62'),_0x4f2605,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x2411('0x63'),'input_type':_0x2411('0x64'),'response_type':_0x2411('0x64'),'rest_data':JSON[_0x2411('0x65')]({'user_auth':{'user_name':_0x36f06e['username'],'password':_0x36f06e[_0x2411('0x5c')],'encryption':_0x2411('0x66')},'application':_0x2411('0x67')})}});}})['then'](function(_0x1f7af0){if(_0x1f7af0&&_0x1f7af0[_0x2411('0x28')]!==_0x2411('0x68')&&_0x1f7af0['name']!=='Password\x20Expired'){return rp({'method':_0x2411('0x60'),'uri':util[_0x2411('0x61')](_0x2411('0x62'),_0x4f2605,_0x2411('0x69')),'json':!![],'form':{'method':_0x2411('0x6a'),'input_type':_0x2411('0x64'),'response_type':_0x2411('0x64'),'rest_data':JSON[_0x2411('0x65')]({'session':_0x1f7af0['id'],'module_name':_0x2411('0x6b')})}})[_0x2411('0x24')](function(_0x375911){if(_0x375911){var _0x4bd16e=_['values'](_0x375911['module_fields']);_[_0x2411('0x6c')](_0x4bd16e,function(_0x5a949a){return _0x4ec2ac[_0x2411('0x6d')](_0x5a949a[_0x2411('0x28')]);});return{'count':_0x4bd16e[_0x2411('0x36')],'rows':_[_0x2411('0x2a')](_0x4bd16e,function(_0x12abf6){return{'id':_0x12abf6[_0x2411('0x28')],'name':_0x12abf6[_0x2411('0x6e')],'custom':_['endsWith'](_0x12abf6[_0x2411('0x28')],'_c')?!![]:![],'options':_0x12abf6[_0x2411('0x3e')]?_['map'](_[_0x2411('0x6f')](_0x12abf6[_0x2411('0x3e')]),function(_0x29f305){return{'name':_0x29f305[_0x2411('0x70')],'value':_0x29f305[_0x2411('0x28')]};}):[]};})};}})[_0x2411('0x24')](respondWithResult(_0x2b777a,null))[_0x2411('0x41')](function(_0x355e2b){var _0x46e907=_0x27c597[_0x2411('0x30')][_0x2411('0x71')]?0x1f4:_0x355e2b[_0x2411('0x72')]||0x1f4;logger['error'](_0x2411('0x73'),_0x2411('0x53'),_0x46e907,JSON[_0x2411('0x65')](_0x355e2b));delete _0x355e2b[_0x2411('0x28')];if(_0x46e907===0x191){_0x46e907=0x190;}_0x2b777a[_0x2411('0x19')](_0x46e907)[_0x2411('0x29')](_0x27c597['query']['test']?{'message':_0x2411('0x74'),'statusCode':_0x355e2b[_0x2411('0x72')]}:_0x355e2b);});}else{var _0x9e80c7=0x1f4;_0x2b777a['status'](_0x9e80c7)[_0x2411('0x29')]({'message':_0x2411('0x74'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x7fbb=['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','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','SugarcrmAccount','rawAttributes','type','key','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','findAll','catch','show','params','includeAll','find','create','body','destroy','getConfigurations','findOne','options','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','SugarcrmConfiguration','SugarcrmField','Subjects','Descriptions','assigned_user_id','created_by','description','date_start','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','get_module_fields','module_fields','remove','label','endsWith','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7fbb,0x71));var _0xb7fb=function(_0x5542e4,_0x51f559){_0x5542e4=_0x5542e4-0x0;var _0x58d6aa=_0x7fbb[_0x5542e4];return _0x58d6aa;};'use strict';var emlformat=require(_0xb7fb('0x0'));var rimraf=require(_0xb7fb('0x1'));var zipdir=require(_0xb7fb('0x2'));var jsonpatch=require(_0xb7fb('0x3'));var rp=require(_0xb7fb('0x4'));var moment=require(_0xb7fb('0x5'));var BPromise=require(_0xb7fb('0x6'));var Mustache=require(_0xb7fb('0x7'));var util=require(_0xb7fb('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xb7fb('0x9'));var ejs=require(_0xb7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xb7fb('0xb'));var _=require(_0xb7fb('0xc'));var squel=require(_0xb7fb('0xd'));var crypto=require(_0xb7fb('0xe'));var jsforce=require(_0xb7fb('0xf'));var deskjs=require(_0xb7fb('0x10'));var toCsv=require(_0xb7fb('0x9'));var querystring=require('querystring');var Papa=require(_0xb7fb('0x11'));var Redis=require('ioredis');var authService=require(_0xb7fb('0x12'));var qs=require(_0xb7fb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7fb('0x14'));var logger=require(_0xb7fb('0x15'))('api');var utils=require(_0xb7fb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb7fb('0x17'));var db=require(_0xb7fb('0x18'))['db'];var integrations=require(_0xb7fb('0x19'));function respondWithStatusCode(_0x26d55d,_0x43dc33){_0x43dc33=_0x43dc33||0xcc;return function(_0x420d0e){if(_0x420d0e){return _0x26d55d[_0xb7fb('0x1a')](_0x43dc33);}return _0x26d55d[_0xb7fb('0x1b')](_0x43dc33)[_0xb7fb('0x1c')]();};}function respondWithResult(_0xa48844,_0x66cfb1){_0x66cfb1=_0x66cfb1||0xc8;return function(_0x50eb15){if(_0x50eb15){return _0xa48844[_0xb7fb('0x1b')](_0x66cfb1)[_0xb7fb('0x1d')](_0x50eb15);}};}function respondWithFilteredResult(_0x42d05c,_0x5c8bbe){return function(_0x341f69){if(_0x341f69){var _0x7210=typeof _0x5c8bbe[_0xb7fb('0x1e')]===_0xb7fb('0x1f')&&typeof _0x5c8bbe[_0xb7fb('0x20')]==='undefined';var _0x345c40=_0x341f69[_0xb7fb('0x21')];var _0x5e12e3=_0x7210?0x0:_0x5c8bbe[_0xb7fb('0x1e')];var _0x319d93=_0x7210?_0x341f69[_0xb7fb('0x21')]:_0x5c8bbe['offset']+_0x5c8bbe['limit'];var _0x31590a;if(_0x319d93>=_0x345c40){_0x319d93=_0x345c40;_0x31590a=0xc8;}else{_0x31590a=0xce;}_0x42d05c[_0xb7fb('0x1b')](_0x31590a);return _0x42d05c[_0xb7fb('0x22')](_0xb7fb('0x23'),_0x5e12e3+'-'+_0x319d93+'/'+_0x345c40)[_0xb7fb('0x1d')](_0x341f69);}return null;};}function patchUpdates(_0x12870b){return function(_0xa8eb17){try{jsonpatch[_0xb7fb('0x24')](_0xa8eb17,_0x12870b,!![]);}catch(_0x16fb90){return BPromise[_0xb7fb('0x25')](_0x16fb90);}return _0xa8eb17[_0xb7fb('0x26')]();};}function saveUpdates(_0x2c145a,_0x2188aa){return function(_0x464f34){if(_0x464f34){return _0x464f34[_0xb7fb('0x27')](_0x2c145a)[_0xb7fb('0x28')](function(_0x49cf90){return _0x49cf90;});}return null;};}function removeEntity(_0x4bc0ef,_0x3e2b14){return function(_0x6317b5){if(_0x6317b5){return _0x6317b5['destroy']()['then'](function(){_0x4bc0ef[_0xb7fb('0x1b')](0xcc)[_0xb7fb('0x1c')]();});}};}function handleEntityNotFound(_0x2e290f,_0x55c1a9){return function(_0x37e49a){if(!_0x37e49a){_0x2e290f[_0xb7fb('0x1a')](0x194);}return _0x37e49a;};}function handleError(_0x3c3bf0,_0x30708a){_0x30708a=_0x30708a||0x1f4;return function(_0x6bf47e){logger[_0xb7fb('0x29')](_0x6bf47e['stack']);if(_0x6bf47e[_0xb7fb('0x2a')]){delete _0x6bf47e['name'];}_0x3c3bf0['status'](_0x30708a)[_0xb7fb('0x2b')](_0x6bf47e);};}exports[_0xb7fb('0x2c')]=function(_0x2fe917,_0x470f70){var _0x43a4df={},_0x258b4f={},_0x3fdc66={'count':0x0,'rows':[]};var _0x1146ce=_['map'](db[_0xb7fb('0x2d')][_0xb7fb('0x2e')],function(_0x51908b){return{'name':_0x51908b['fieldName'],'type':_0x51908b[_0xb7fb('0x2f')][_0xb7fb('0x30')]};});_0x258b4f['model']=_['map'](_0x1146ce,_0xb7fb('0x2a'));_0x258b4f['query']=_[_0xb7fb('0x31')](_0x2fe917[_0xb7fb('0x32')]);_0x258b4f[_0xb7fb('0x33')]=_[_0xb7fb('0x34')](_0x258b4f['model'],_0x258b4f[_0xb7fb('0x32')]);_0x43a4df[_0xb7fb('0x35')]=_['intersection'](_0x258b4f[_0xb7fb('0x36')],qs['fields'](_0x2fe917[_0xb7fb('0x32')][_0xb7fb('0x37')]));_0x43a4df['attributes']=_0x43a4df['attributes'][_0xb7fb('0x38')]?_0x43a4df[_0xb7fb('0x35')]:_0x258b4f[_0xb7fb('0x36')];if(!_0x2fe917['query']['hasOwnProperty'](_0xb7fb('0x39'))){_0x43a4df['limit']=qs[_0xb7fb('0x20')](_0x2fe917['query'][_0xb7fb('0x20')]);_0x43a4df[_0xb7fb('0x1e')]=qs['offset'](_0x2fe917[_0xb7fb('0x32')]['offset']);}_0x43a4df[_0xb7fb('0x3a')]=qs['sort'](_0x2fe917['query'][_0xb7fb('0x3b')]);_0x43a4df[_0xb7fb('0x3c')]=qs[_0xb7fb('0x33')](_[_0xb7fb('0x3d')](_0x2fe917[_0xb7fb('0x32')],_0x258b4f['filters']),_0x1146ce);if(_0x2fe917[_0xb7fb('0x32')][_0xb7fb('0x3e')]){_0x43a4df[_0xb7fb('0x3c')]=_[_0xb7fb('0x3f')](_0x43a4df['where'],{'$or':_[_0xb7fb('0x40')](_0x1146ce,function(_0x338e26){if(_0x338e26[_0xb7fb('0x2f')]!==_0xb7fb('0x41')){var _0x3f2109={};_0x3f2109[_0x338e26['name']]={'$like':'%'+_0x2fe917['query']['filter']+'%'};return _0x3f2109;}})});}_0x43a4df=_['merge']({},_0x43a4df,_0x2fe917['options']);var _0x5bdef9={'where':_0x43a4df[_0xb7fb('0x3c')]};return db['SugarcrmAccount'][_0xb7fb('0x21')](_0x5bdef9)[_0xb7fb('0x28')](function(_0x537f0d){_0x3fdc66[_0xb7fb('0x21')]=_0x537f0d;if(_0x2fe917[_0xb7fb('0x32')]['includeAll']){_0x43a4df[_0xb7fb('0x42')]=[{'all':!![]}];}return db[_0xb7fb('0x2d')][_0xb7fb('0x43')](_0x43a4df);})[_0xb7fb('0x28')](function(_0x2e16c6){_0x3fdc66['rows']=_0x2e16c6;return _0x3fdc66;})[_0xb7fb('0x28')](respondWithFilteredResult(_0x470f70,_0x43a4df))[_0xb7fb('0x44')](handleError(_0x470f70,null));};exports[_0xb7fb('0x45')]=function(_0x8e1bbe,_0x53d27b){var _0x835cb0={'raw':![],'where':{'id':_0x8e1bbe[_0xb7fb('0x46')]['id']}},_0x584390={};_0x584390[_0xb7fb('0x36')]=_[_0xb7fb('0x31')](db[_0xb7fb('0x2d')][_0xb7fb('0x2e')]);_0x584390['query']=_['keys'](_0x8e1bbe[_0xb7fb('0x32')]);_0x584390[_0xb7fb('0x33')]=_[_0xb7fb('0x34')](_0x584390['model'],_0x584390[_0xb7fb('0x32')]);_0x835cb0[_0xb7fb('0x35')]=_[_0xb7fb('0x34')](_0x584390['model'],qs[_0xb7fb('0x37')](_0x8e1bbe[_0xb7fb('0x32')]['fields']));_0x835cb0['attributes']=_0x835cb0[_0xb7fb('0x35')][_0xb7fb('0x38')]?_0x835cb0[_0xb7fb('0x35')]:_0x584390['model'];if(_0x8e1bbe[_0xb7fb('0x32')][_0xb7fb('0x47')]){_0x835cb0[_0xb7fb('0x42')]=[{'all':!![]}];}_0x835cb0=_[_0xb7fb('0x3f')]({},_0x835cb0,_0x8e1bbe['options']);return db[_0xb7fb('0x2d')][_0xb7fb('0x48')](_0x835cb0)['then'](handleEntityNotFound(_0x53d27b,null))[_0xb7fb('0x28')](respondWithResult(_0x53d27b,null))[_0xb7fb('0x44')](handleError(_0x53d27b,null));};exports[_0xb7fb('0x49')]=function(_0x91e59e,_0x4690da){return db['SugarcrmAccount']['create'](_0x91e59e[_0xb7fb('0x4a')],{})['then'](respondWithResult(_0x4690da,0xc9))['catch'](handleError(_0x4690da,null));};exports[_0xb7fb('0x27')]=function(_0x301554,_0x1ed459){if(_0x301554['body']['id']){delete _0x301554[_0xb7fb('0x4a')]['id'];}return db[_0xb7fb('0x2d')][_0xb7fb('0x48')]({'where':{'id':_0x301554[_0xb7fb('0x46')]['id']}})[_0xb7fb('0x28')](handleEntityNotFound(_0x1ed459,null))[_0xb7fb('0x28')](saveUpdates(_0x301554[_0xb7fb('0x4a')],null))[_0xb7fb('0x28')](respondWithResult(_0x1ed459,null))[_0xb7fb('0x44')](handleError(_0x1ed459,null));};exports[_0xb7fb('0x4b')]=function(_0xc27d6b,_0x10db92){return db[_0xb7fb('0x2d')][_0xb7fb('0x48')]({'where':{'id':_0xc27d6b[_0xb7fb('0x46')]['id']}})[_0xb7fb('0x28')](handleEntityNotFound(_0x10db92,null))['then'](removeEntity(_0x10db92,null))[_0xb7fb('0x44')](handleError(_0x10db92,null));};exports[_0xb7fb('0x4c')]=function(_0x4c9b77,_0x3e7074,_0x3d0e19){var _0x587f94={};var _0x61627={};var _0x47a880;var _0x5ba9e0;return db[_0xb7fb('0x2d')][_0xb7fb('0x4d')]({'where':{'id':_0x4c9b77['params']['id']}})[_0xb7fb('0x28')](handleEntityNotFound(_0x3e7074,null))[_0xb7fb('0x28')](function(_0x886c4c){if(_0x886c4c){_0x47a880=_0x886c4c;_0x61627[_0xb7fb('0x36')]=_[_0xb7fb('0x31')](db['SugarcrmConfiguration']['rawAttributes']);_0x61627[_0xb7fb('0x32')]=_['keys'](_0x4c9b77[_0xb7fb('0x32')]);_0x61627['filters']=_[_0xb7fb('0x34')](_0x61627['model'],_0x61627[_0xb7fb('0x32')]);_0x587f94[_0xb7fb('0x35')]=_[_0xb7fb('0x34')](_0x61627[_0xb7fb('0x36')],qs[_0xb7fb('0x37')](_0x4c9b77['query'][_0xb7fb('0x37')]));_0x587f94[_0xb7fb('0x35')]=_0x587f94[_0xb7fb('0x35')][_0xb7fb('0x38')]?_0x587f94[_0xb7fb('0x35')]:_0x61627[_0xb7fb('0x36')];_0x587f94[_0xb7fb('0x3a')]=qs[_0xb7fb('0x3b')](_0x4c9b77[_0xb7fb('0x32')][_0xb7fb('0x3b')]);_0x587f94['where']=qs['filters'](_['pick'](_0x4c9b77[_0xb7fb('0x32')],_0x61627[_0xb7fb('0x33')]));if(_0x4c9b77[_0xb7fb('0x32')][_0xb7fb('0x3e')]){_0x587f94['where']=_['merge'](_0x587f94['where'],{'$or':_[_0xb7fb('0x40')](_0x587f94['attributes'],function(_0x1bdd38){var _0x5131ca={};_0x5131ca[_0x1bdd38]={'$like':'%'+_0x4c9b77['query'][_0xb7fb('0x3e')]+'%'};return _0x5131ca;})});}_0x587f94=_[_0xb7fb('0x3f')]({},_0x587f94,_0x4c9b77[_0xb7fb('0x4e')]);return _0x47a880[_0xb7fb('0x4c')](_0x587f94);}})[_0xb7fb('0x28')](function(_0x17a404){if(_0x17a404){_0x5ba9e0=_0x17a404[_0xb7fb('0x38')];if(!_0x4c9b77['query'][_0xb7fb('0x4f')](_0xb7fb('0x39'))){_0x587f94['limit']=qs['limit'](_0x4c9b77[_0xb7fb('0x32')]['limit']);_0x587f94[_0xb7fb('0x1e')]=qs[_0xb7fb('0x1e')](_0x4c9b77[_0xb7fb('0x32')]['offset']);}return _0x47a880[_0xb7fb('0x4c')](_0x587f94);}})[_0xb7fb('0x28')](function(_0x18b374){if(_0x18b374){return _0x18b374?{'count':_0x5ba9e0,'rows':_0x18b374}:null;}})[_0xb7fb('0x28')](respondWithResult(_0x3e7074,null))[_0xb7fb('0x44')](handleError(_0x3e7074,null));};exports[_0xb7fb('0x50')]=function(_0x5a5d1c,_0x48af91,_0x48d747){if(_0x5a5d1c[_0xb7fb('0x4a')]['id']){delete _0x5a5d1c[_0xb7fb('0x4a')]['id'];}return db[_0xb7fb('0x2d')]['findOne']({'where':{'id':_0x5a5d1c['params']['id']}})[_0xb7fb('0x28')](handleEntityNotFound(_0x48af91,null))[_0xb7fb('0x28')](function(_0x206d7c){if(_0x206d7c){_0x5a5d1c['body'][_0xb7fb('0x51')]=_0x206d7c['id'];_0x5a5d1c[_0xb7fb('0x4a')]['Subjects']=integrations[_0xb7fb('0x52')](_0x5a5d1c[_0xb7fb('0x4a')]['channel'],_0x5a5d1c['body']['type']);_0x5a5d1c[_0xb7fb('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x5a5d1c['body'][_0xb7fb('0x53')],_0x5a5d1c[_0xb7fb('0x4a')]['type']);return db[_0xb7fb('0x54')]['create'](_0x5a5d1c[_0xb7fb('0x4a')],{'include':[{'model':db[_0xb7fb('0x55')],'as':_0xb7fb('0x56')},{'model':db[_0xb7fb('0x55')],'as':_0xb7fb('0x57')}]});}return null;})[_0xb7fb('0x28')](respondWithResult(_0x48af91,null))[_0xb7fb('0x44')](handleError(_0x48af91,null));};exports['getFields']=function(_0x1c38a0,_0x4a2ba3,_0x5b5435){var _0x3d4d5f='';var _0x4e21d3=['id','name',_0xb7fb('0x58'),_0xb7fb('0x59'),_0xb7fb('0x5a'),_0xb7fb('0x5b'),'duration_hours','duration_minutes',_0xb7fb('0x5c'),_0xb7fb('0x5d'),_0xb7fb('0x5e'),_0xb7fb('0x5f')];return db[_0xb7fb('0x2d')]['findOne']({'where':{'id':_0x1c38a0['params']['id']},'attributes':['id',_0xb7fb('0x60'),_0xb7fb('0x61'),'remoteUri']})[_0xb7fb('0x28')](handleEntityNotFound(_0x4a2ba3,null))[_0xb7fb('0x28')](function(_0x585f1f){if(_0x585f1f){_0x3d4d5f=_0x585f1f[_0xb7fb('0x62')];var _0x456474=_0x3d4d5f[_0xb7fb('0x63')](-0x1);if(_0x456474==='/'){_0x3d4d5f=_0x3d4d5f[_0xb7fb('0x64')](0x0,_0x3d4d5f['lastIndexOf'](_0x456474));}return rp({'method':_0xb7fb('0x65'),'uri':util[_0xb7fb('0x66')](_0xb7fb('0x67'),_0x3d4d5f,_0xb7fb('0x68')),'json':!![],'form':{'method':_0xb7fb('0x69'),'input_type':_0xb7fb('0x6a'),'response_type':'JSON','rest_data':JSON[_0xb7fb('0x6b')]({'user_auth':{'user_name':_0x585f1f[_0xb7fb('0x60')],'password':_0x585f1f['password'],'encryption':_0xb7fb('0x6c')},'application':_0xb7fb('0x6d')})}});}})[_0xb7fb('0x28')](function(_0x453e31){if(_0x453e31&&_0x453e31[_0xb7fb('0x2a')]!=='Invalid\x20Login'&&_0x453e31['name']!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0xb7fb('0x66')](_0xb7fb('0x67'),_0x3d4d5f,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xb7fb('0x6e'),'input_type':_0xb7fb('0x6a'),'response_type':_0xb7fb('0x6a'),'rest_data':JSON[_0xb7fb('0x6b')]({'session':_0x453e31['id'],'module_name':'Calls'})}})[_0xb7fb('0x28')](function(_0x509466){if(_0x509466){var _0x12b029=_['values'](_0x509466[_0xb7fb('0x6f')]);_[_0xb7fb('0x70')](_0x12b029,function(_0x1e62e2){return _0x4e21d3['includes'](_0x1e62e2[_0xb7fb('0x2a')]);});return{'count':_0x12b029[_0xb7fb('0x38')],'rows':_[_0xb7fb('0x40')](_0x12b029,function(_0x516f52){return{'id':_0x516f52['name'],'name':_0x516f52[_0xb7fb('0x71')],'custom':_[_0xb7fb('0x72')](_0x516f52[_0xb7fb('0x2a')],'_c')?!![]:![],'options':_0x516f52[_0xb7fb('0x4e')]?_[_0xb7fb('0x40')](_[_0xb7fb('0x73')](_0x516f52[_0xb7fb('0x4e')]),function(_0x444a04){return{'name':_0x444a04[_0xb7fb('0x74')],'value':_0x444a04[_0xb7fb('0x2a')]};}):[]};})};}})['then'](respondWithResult(_0x4a2ba3,null))[_0xb7fb('0x44')](function(_0x4ec31a){var _0x477a7c=_0x1c38a0[_0xb7fb('0x32')][_0xb7fb('0x75')]?0x1f4:_0x4ec31a[_0xb7fb('0x76')]||0x1f4;logger[_0xb7fb('0x29')](_0xb7fb('0x77'),_0xb7fb('0x78'),_0x477a7c,JSON[_0xb7fb('0x6b')](_0x4ec31a));delete _0x4ec31a['name'];if(_0x477a7c===0x191){_0x477a7c=0x190;}_0x4a2ba3[_0xb7fb('0x1b')](_0x477a7c)['send'](_0x1c38a0[_0xb7fb('0x32')][_0xb7fb('0x75')]?{'message':_0xb7fb('0x79'),'statusCode':_0x4ec31a[_0xb7fb('0x76')]}:_0x4ec31a);});}else{var _0x539b51=0x1f4;_0x4a2ba3['status'](_0x539b51)[_0xb7fb('0x2b')]({'message':_0xb7fb('0x79'),'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 62bdef7..d0c2610 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 _0xfe99=['../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x400846,_0xd26609){var _0x51d34c=function(_0x29d363){while(--_0x29d363){_0x400846['push'](_0x400846['shift']());}};_0x51d34c(++_0xd26609);}(_0xfe99,0x11f));var _0x9fe9=function(_0x88c88b,_0x18d9ba){_0x88c88b=_0x88c88b-0x0;var _0x4a3fc0=_0xfe99[_0x88c88b];return _0x4a3fc0;};'use strict';var _=require('lodash');var util=require(_0x9fe9('0x0'));var logger=require(_0x9fe9('0x1'))(_0x9fe9('0x2'));var moment=require(_0x9fe9('0x3'));var BPromise=require(_0x9fe9('0x4'));var rp=require(_0x9fe9('0x5'));var fs=require('fs');var path=require(_0x9fe9('0x6'));var rimraf=require('rimraf');var config=require(_0x9fe9('0x7'));var attributes=require(_0x9fe9('0x8'));var integrations=require(_0x9fe9('0x9'));module[_0x9fe9('0xa')]=function(_0x25cd36,_0x46e6c5){return _0x25cd36[_0x9fe9('0xb')](_0x9fe9('0xc'),attributes,{'tableName':_0x9fe9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cb1=['request-promise','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','../../config/logger','api','moment','bluebird'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x4cb1,0x167));var _0x14cb=function(_0x26b8cd,_0x5913b2){_0x26b8cd=_0x26b8cd-0x0;var _0x14ce5f=_0x4cb1[_0x26b8cd];return _0x14ce5f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x14cb('0x0'))(_0x14cb('0x1'));var moment=require(_0x14cb('0x2'));var BPromise=require(_0x14cb('0x3'));var rp=require(_0x14cb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x14cb('0x5'));var integrations=require(_0x14cb('0x6'));module[_0x14cb('0x7')]=function(_0x6de6d9,_0x23aa5f){return _0x6de6d9[_0x14cb('0x8')](_0x14cb('0x9'),attributes,{'tableName':_0x14cb('0xa'),'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 9c335f2..a2d0ecc 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 _0xad4e=['catch','SugarcrmAccount','findAll','options','raw','where','attributes','include','model','map','GetSugarcrmAccount','stringify','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','request\x20sent','debug','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xad4e,0xb2));var _0xead4=function(_0xce5ff,_0x507b97){_0xce5ff=_0xce5ff-0x0;var _0xf2ddfa=_0xad4e[_0xce5ff];return _0xf2ddfa;};'use strict';var _=require(_0xead4('0x0'));var util=require(_0xead4('0x1'));var moment=require(_0xead4('0x2'));var BPromise=require(_0xead4('0x3'));var rs=require(_0xead4('0x4'));var fs=require('fs');var Redis=require(_0xead4('0x5'));var db=require(_0xead4('0x6'))['db'];var utils=require(_0xead4('0x7'));var logger=require('../../config/logger')(_0xead4('0x8'));var config=require(_0xead4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xead4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x179885,_0x1e621f,_0x15cc09){return new BPromise(function(_0x1dd146,_0x5da7ca){return client['request'](_0x179885,_0x15cc09)[_0xead4('0xb')](function(_0x3358ec){logger[_0xead4('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x1e621f,_0xead4('0xd'));logger[_0xead4('0xe')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1e621f,'request\x20sent',JSON['stringify'](_0x3358ec));if(_0x3358ec[_0xead4('0xf')]){if(_0x3358ec[_0xead4('0xf')][_0xead4('0x10')]===0x1f4){logger[_0xead4('0xf')](_0xead4('0x11'),_0x1e621f,_0x3358ec[_0xead4('0xf')][_0xead4('0x12')]);return _0x5da7ca(_0x3358ec[_0xead4('0xf')][_0xead4('0x12')]);}logger[_0xead4('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x1e621f,_0x3358ec[_0xead4('0xf')][_0xead4('0x12')]);return _0x1dd146(_0x3358ec[_0xead4('0xf')][_0xead4('0x12')]);}else{logger[_0xead4('0xc')](_0xead4('0x11'),_0x1e621f,'request\x20sent');_0x1dd146(_0x3358ec[_0xead4('0x13')][_0xead4('0x12')]);}})[_0xead4('0x14')](function(_0x13fe97){logger[_0xead4('0xf')](_0xead4('0x11'),_0x1e621f,_0x13fe97);_0x5da7ca(_0x13fe97);});});}exports['GetSugarcrmAccount']=function(_0x27ca9e){var _0xcdf76e=this;return new Promise(function(_0x4ac088,_0x14af07){return db[_0xead4('0x15')][_0xead4('0x16')]({'raw':_0x27ca9e[_0xead4('0x17')]?_0x27ca9e[_0xead4('0x17')][_0xead4('0x18')]===undefined?!![]:![]:!![],'where':_0x27ca9e['options']?_0x27ca9e[_0xead4('0x17')][_0xead4('0x19')]||null:null,'attributes':_0x27ca9e[_0xead4('0x17')]?_0x27ca9e[_0xead4('0x17')][_0xead4('0x1a')]||null:null,'limit':_0x27ca9e['options']?_0x27ca9e[_0xead4('0x17')]['limit']||null:null,'include':_0x27ca9e[_0xead4('0x17')]?_0x27ca9e['options'][_0xead4('0x1b')]?_['map'](_0x27ca9e[_0xead4('0x17')]['include'],function(_0x1bc6c8){return{'model':db[_0x1bc6c8[_0xead4('0x1c')]],'as':_0x1bc6c8['as'],'attributes':_0x1bc6c8[_0xead4('0x1a')],'include':_0x1bc6c8[_0xead4('0x1b')]?_[_0xead4('0x1d')](_0x1bc6c8[_0xead4('0x1b')],function(_0x396a5f){return{'model':db[_0x396a5f[_0xead4('0x1c')]],'as':_0x396a5f['as'],'attributes':_0x396a5f[_0xead4('0x1a')],'include':_0x396a5f['include']?_[_0xead4('0x1d')](_0x396a5f[_0xead4('0x1b')],function(_0x61903){return{'model':db[_0x61903['model']],'as':_0x61903['as'],'attributes':_0x61903[_0xead4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xead4('0xb')](function(_0xa79ae6){logger[_0xead4('0xc')]('GetSugarcrmAccount',_0x27ca9e);logger[_0xead4('0xe')](_0xead4('0x1e'),_0x27ca9e,JSON[_0xead4('0x1f')](_0xa79ae6));_0x4ac088(_0xa79ae6);})[_0xead4('0x14')](function(_0x202271){logger[_0xead4('0xf')]('GetSugarcrmAccount',_0x202271[_0xead4('0x12')],_0x27ca9e);_0x14af07(_0xcdf76e[_0xead4('0xf')](0x1f4,_0x202271[_0xead4('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x1a0197){var _0x5a0746=this;return new Promise(function(_0x1e958e,_0x30f7dd){return db[_0xead4('0x15')]['find']({'raw':_0x1a0197[_0xead4('0x17')]?_0x1a0197[_0xead4('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1a0197[_0xead4('0x17')]?_0x1a0197[_0xead4('0x17')][_0xead4('0x19')]||null:null,'attributes':_0x1a0197[_0xead4('0x17')]?_0x1a0197['options']['attributes']||null:null,'include':_0x1a0197[_0xead4('0x17')]?_0x1a0197[_0xead4('0x17')][_0xead4('0x1b')]?_['map'](_0x1a0197[_0xead4('0x17')][_0xead4('0x1b')],function(_0x3198ae){return{'model':db[_0x3198ae[_0xead4('0x1c')]],'as':_0x3198ae['as'],'attributes':_0x3198ae[_0xead4('0x1a')],'include':_0x3198ae[_0xead4('0x1b')]?_[_0xead4('0x1d')](_0x3198ae['include'],function(_0x1b7061){return{'model':db[_0x1b7061[_0xead4('0x1c')]],'as':_0x1b7061['as'],'attributes':_0x1b7061['attributes'],'include':_0x1b7061[_0xead4('0x1b')]?_[_0xead4('0x1d')](_0x1b7061[_0xead4('0x1b')],function(_0xc3f5b6){return{'model':db[_0xc3f5b6[_0xead4('0x1c')]],'as':_0xc3f5b6['as'],'attributes':_0xc3f5b6[_0xead4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xead4('0xb')](function(_0x519c35){logger[_0xead4('0xc')](_0xead4('0x20'),_0x1a0197);logger[_0xead4('0xe')]('ShowSugarcrmAccount',_0x1a0197,JSON['stringify'](_0x519c35));_0x1e958e(_0x519c35);})[_0xead4('0x14')](function(_0x5d8d48){logger[_0xead4('0xf')]('ShowSugarcrmAccount',_0x5d8d48[_0xead4('0x12')],_0x1a0197);_0x30f7dd(_0x5a0746[_0xead4('0xf')](0x1f4,_0x5d8d48[_0xead4('0x12')]));});});}; \ No newline at end of file +var _0xb68a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit','include','map','model','find','where','ShowSugarcrmAccount','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb68a,0xb3));var _0xab68=function(_0x3cdb4a,_0x233b8e){_0x3cdb4a=_0x3cdb4a-0x0;var _0x5d3c4f=_0xb68a[_0x3cdb4a];return _0x5d3c4f;};'use strict';var _=require(_0xab68('0x0'));var util=require(_0xab68('0x1'));var moment=require('moment');var BPromise=require(_0xab68('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab68('0x3'));var db=require(_0xab68('0x4'))['db'];var utils=require(_0xab68('0x5'));var logger=require(_0xab68('0x6'))(_0xab68('0x7'));var config=require(_0xab68('0x8'));var jayson=require(_0xab68('0x9'));var client=jayson[_0xab68('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ea1fb,_0x48589e,_0x2c163d){return new BPromise(function(_0x127403,_0x5d123f){return client[_0xab68('0xb')](_0x2ea1fb,_0x2c163d)[_0xab68('0xc')](function(_0x1cda4a){logger['info'](_0xab68('0xd'),_0x48589e,_0xab68('0xe'));logger[_0xab68('0xf')](_0xab68('0x10'),_0x48589e,_0xab68('0xe'),JSON[_0xab68('0x11')](_0x1cda4a));if(_0x1cda4a[_0xab68('0x12')]){if(_0x1cda4a[_0xab68('0x12')][_0xab68('0x13')]===0x1f4){logger[_0xab68('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x48589e,_0x1cda4a['error'][_0xab68('0x14')]);return _0x5d123f(_0x1cda4a['error']['message']);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x48589e,_0x1cda4a[_0xab68('0x12')][_0xab68('0x14')]);return _0x127403(_0x1cda4a[_0xab68('0x12')][_0xab68('0x14')]);}else{logger[_0xab68('0x15')](_0xab68('0xd'),_0x48589e,'request\x20sent');_0x127403(_0x1cda4a[_0xab68('0x16')][_0xab68('0x14')]);}})[_0xab68('0x17')](function(_0x4b2183){logger['error'](_0xab68('0xd'),_0x48589e,_0x4b2183);_0x5d123f(_0x4b2183);});});}exports[_0xab68('0x18')]=function(_0x572579){var _0x818a82=this;return new Promise(function(_0x38a858,_0x479063){return db[_0xab68('0x19')][_0xab68('0x1a')]({'raw':_0x572579[_0xab68('0x1b')]?_0x572579['options'][_0xab68('0x1c')]===undefined?!![]:![]:!![],'where':_0x572579['options']?_0x572579[_0xab68('0x1b')]['where']||null:null,'attributes':_0x572579['options']?_0x572579[_0xab68('0x1b')][_0xab68('0x1d')]||null:null,'limit':_0x572579[_0xab68('0x1b')]?_0x572579['options'][_0xab68('0x1e')]||null:null,'include':_0x572579[_0xab68('0x1b')]?_0x572579['options'][_0xab68('0x1f')]?_[_0xab68('0x20')](_0x572579[_0xab68('0x1b')][_0xab68('0x1f')],function(_0x5574c8){return{'model':db[_0x5574c8[_0xab68('0x21')]],'as':_0x5574c8['as'],'attributes':_0x5574c8[_0xab68('0x1d')],'include':_0x5574c8[_0xab68('0x1f')]?_[_0xab68('0x20')](_0x5574c8[_0xab68('0x1f')],function(_0x4a45f3){return{'model':db[_0x4a45f3[_0xab68('0x21')]],'as':_0x4a45f3['as'],'attributes':_0x4a45f3[_0xab68('0x1d')],'include':_0x4a45f3[_0xab68('0x1f')]?_[_0xab68('0x20')](_0x4a45f3['include'],function(_0x26fee4){return{'model':db[_0x26fee4[_0xab68('0x21')]],'as':_0x26fee4['as'],'attributes':_0x26fee4['attributes']};}):[]};}):[]};}):[]:[]})[_0xab68('0xc')](function(_0x547403){logger[_0xab68('0x15')](_0xab68('0x18'),_0x572579);logger['debug'](_0xab68('0x18'),_0x572579,JSON['stringify'](_0x547403));_0x38a858(_0x547403);})[_0xab68('0x17')](function(_0x5101ac){logger[_0xab68('0x12')](_0xab68('0x18'),_0x5101ac[_0xab68('0x14')],_0x572579);_0x479063(_0x818a82[_0xab68('0x12')](0x1f4,_0x5101ac[_0xab68('0x14')]));});});};exports['ShowSugarcrmAccount']=function(_0xd426d0){var _0x951b8e=this;return new Promise(function(_0x5c08de,_0x999d5e){return db[_0xab68('0x19')][_0xab68('0x22')]({'raw':_0xd426d0[_0xab68('0x1b')]?_0xd426d0[_0xab68('0x1b')][_0xab68('0x1c')]===undefined?!![]:![]:!![],'where':_0xd426d0['options']?_0xd426d0['options'][_0xab68('0x23')]||null:null,'attributes':_0xd426d0[_0xab68('0x1b')]?_0xd426d0[_0xab68('0x1b')][_0xab68('0x1d')]||null:null,'include':_0xd426d0[_0xab68('0x1b')]?_0xd426d0[_0xab68('0x1b')][_0xab68('0x1f')]?_[_0xab68('0x20')](_0xd426d0[_0xab68('0x1b')][_0xab68('0x1f')],function(_0x5b619f){return{'model':db[_0x5b619f[_0xab68('0x21')]],'as':_0x5b619f['as'],'attributes':_0x5b619f[_0xab68('0x1d')],'include':_0x5b619f[_0xab68('0x1f')]?_[_0xab68('0x20')](_0x5b619f['include'],function(_0x744d28){return{'model':db[_0x744d28['model']],'as':_0x744d28['as'],'attributes':_0x744d28[_0xab68('0x1d')],'include':_0x744d28[_0xab68('0x1f')]?_[_0xab68('0x20')](_0x744d28[_0xab68('0x1f')],function(_0x5d517f){return{'model':db[_0x5d517f[_0xab68('0x21')]],'as':_0x5d517f['as'],'attributes':_0x5d517f[_0xab68('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e21ec){logger[_0xab68('0x15')](_0xab68('0x24'),_0xd426d0);logger[_0xab68('0xf')]('ShowSugarcrmAccount',_0xd426d0,JSON['stringify'](_0x2e21ec));_0x5c08de(_0x2e21ec);})['catch'](function(_0x513e4d){logger[_0xab68('0x12')](_0xab68('0x24'),_0x513e4d['message'],_0xd426d0);_0x999d5e(_0x951b8e['error'](0x1f4,_0x513e4d[_0xab68('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 33106c5..1b6e0b2 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 _0x62ce=['getSubjects','getDescriptions','post','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','getFields','/:id/subjects'];(function(_0xbd9364,_0x585be1){var _0x31768e=function(_0x170409){while(--_0x170409){_0xbd9364['push'](_0xbd9364['shift']());}};_0x31768e(++_0x585be1);}(_0x62ce,0x16d));var _0xe62c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x62ce[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe62c('0x0'));var timeout=require(_0xe62c('0x1'));var express=require(_0xe62c('0x2'));var router=express[_0xe62c('0x3')]();var fs_extra=require(_0xe62c('0x4'));var auth=require(_0xe62c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe62c('0x6'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xe62c('0x7')]('/',auth[_0xe62c('0x8')](),controller[_0xe62c('0x9')]);router[_0xe62c('0x7')](_0xe62c('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xe62c('0x7')]('/:id/fields',auth[_0xe62c('0x8')](),controller[_0xe62c('0xb')]);router[_0xe62c('0x7')](_0xe62c('0xc'),auth[_0xe62c('0x8')](),controller[_0xe62c('0xd')]);router[_0xe62c('0x7')]('/:id/descriptions',auth[_0xe62c('0x8')](),controller[_0xe62c('0xe')]);router[_0xe62c('0xf')]('/',auth[_0xe62c('0x8')](),controller['create']);router[_0xe62c('0x10')](_0xe62c('0xa'),auth[_0xe62c('0x8')](),controller[_0xe62c('0x11')]);router[_0xe62c('0x12')](_0xe62c('0xa'),auth[_0xe62c('0x8')](),controller[_0xe62c('0x13')]);module[_0xe62c('0x14')]=router; \ No newline at end of file +var _0x344e=['/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','show'];(function(_0x5869f5,_0x176fd5){var _0x6beba1=function(_0x253e04){while(--_0x253e04){_0x5869f5['push'](_0x5869f5['shift']());}};_0x6beba1(++_0x176fd5);}(_0x344e,0x14c));var _0xe344=function(_0x12dda7,_0x5f498a){_0x12dda7=_0x12dda7-0x0;var _0x522ffa=_0x344e[_0x12dda7];return _0x522ffa;};'use strict';var multer=require(_0xe344('0x0'));var util=require(_0xe344('0x1'));var path=require(_0xe344('0x2'));var timeout=require(_0xe344('0x3'));var express=require(_0xe344('0x4'));var router=express[_0xe344('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe344('0x6'));var interaction=require(_0xe344('0x7'));var config=require('../../config/environment');var controller=require(_0xe344('0x8'));router['get']('/',auth[_0xe344('0x9')](),controller[_0xe344('0xa')]);router[_0xe344('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xe344('0xc')]);router[_0xe344('0xb')](_0xe344('0xd'),auth[_0xe344('0x9')](),controller['getFields']);router[_0xe344('0xb')](_0xe344('0xe'),auth[_0xe344('0x9')](),controller[_0xe344('0xf')]);router[_0xe344('0xb')](_0xe344('0x10'),auth[_0xe344('0x9')](),controller[_0xe344('0x11')]);router['post']('/',auth[_0xe344('0x9')](),controller[_0xe344('0x12')]);router['put'](_0xe344('0x13'),auth[_0xe344('0x9')](),controller[_0xe344('0x14')]);router['delete'](_0xe344('0x13'),auth[_0xe344('0x9')](),controller[_0xe344('0x15')]);module[_0xe344('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 81968b4..8b825c8 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 _0xbcb9=['exports','STRING','sequelize'];(function(_0x1a4561,_0x499f2a){var _0x28e9c1=function(_0x3bf6b5){while(--_0x3bf6b5){_0x1a4561['push'](_0x1a4561['shift']());}};_0x28e9c1(++_0x499f2a);}(_0xbcb9,0x143));var _0x9bcb=function(_0x577669,_0x3fa500){_0x577669=_0x577669-0x0;var _0x3eaca4=_0xbcb9[_0x577669];return _0x3eaca4;};'use strict';var Sequelize=require(_0x9bcb('0x0'));module[_0x9bcb('0x1')]={'name':{'type':Sequelize[_0x9bcb('0x2')]},'description':{'type':Sequelize[_0x9bcb('0x2')]}}; \ No newline at end of file +var _0x5716=['sequelize','STRING'];(function(_0x2a84bf,_0x137157){var _0x11fcfd=function(_0x4749b3){while(--_0x4749b3){_0x2a84bf['push'](_0x2a84bf['shift']());}};_0x11fcfd(++_0x137157);}(_0x5716,0x198));var _0x6571=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0x5716[_0x35fb56];return _0x2fd52c;};'use strict';var Sequelize=require(_0x6571('0x0'));module['exports']={'name':{'type':Sequelize[_0x6571('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 927654c..8cfede8 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 _0x8c64=['bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','SugarcrmConfiguration','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','then','include','findAll','rows','catch','show','params','includeAll','find','create','body','getFields','SugarcrmField','rawAttributes','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0x8c64,0x140));var _0x48c6=function(_0x42efea,_0x128aad){_0x42efea=_0x42efea-0x0;var _0x4162c5=_0x8c64[_0x42efea];return _0x4162c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x48c6('0x0'));var zipdir=require(_0x48c6('0x1'));var jsonpatch=require(_0x48c6('0x2'));var rp=require('request-promise');var moment=require(_0x48c6('0x3'));var BPromise=require(_0x48c6('0x4'));var Mustache=require('mustache');var util=require(_0x48c6('0x5'));var path=require(_0x48c6('0x6'));var sox=require(_0x48c6('0x7'));var csv=require(_0x48c6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x48c6('0x9'));var crypto=require(_0x48c6('0xa'));var jsforce=require(_0x48c6('0xb'));var deskjs=require(_0x48c6('0xc'));var toCsv=require(_0x48c6('0x8'));var querystring=require(_0x48c6('0xd'));var Papa=require(_0x48c6('0xe'));var Redis=require(_0x48c6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x48c6('0x10'));var as=require(_0x48c6('0x11'));var hardwareService=require(_0x48c6('0x12'));var logger=require(_0x48c6('0x13'))(_0x48c6('0x14'));var utils=require(_0x48c6('0x15'));var config=require(_0x48c6('0x16'));var licenseUtil=require(_0x48c6('0x17'));var db=require(_0x48c6('0x18'))['db'];function respondWithStatusCode(_0x29be97,_0x169a79){_0x169a79=_0x169a79||0xcc;return function(_0x3ec362){if(_0x3ec362){return _0x29be97[_0x48c6('0x19')](_0x169a79);}return _0x29be97[_0x48c6('0x1a')](_0x169a79)[_0x48c6('0x1b')]();};}function respondWithResult(_0x89b309,_0x409616){_0x409616=_0x409616||0xc8;return function(_0x5eb191){if(_0x5eb191){return _0x89b309['status'](_0x409616)[_0x48c6('0x1c')](_0x5eb191);}};}function respondWithFilteredResult(_0x3d0c98,_0x1c3475){return function(_0x5ebbe2){if(_0x5ebbe2){var _0x4f1d9e=typeof _0x1c3475[_0x48c6('0x1d')]===_0x48c6('0x1e')&&typeof _0x1c3475[_0x48c6('0x1f')]==='undefined';var _0x2f06d3=_0x5ebbe2[_0x48c6('0x20')];var _0x3de4cc=_0x4f1d9e?0x0:_0x1c3475[_0x48c6('0x1d')];var _0x5cb065=_0x4f1d9e?_0x5ebbe2['count']:_0x1c3475[_0x48c6('0x1d')]+_0x1c3475[_0x48c6('0x1f')];var _0x2f0cfb;if(_0x5cb065>=_0x2f06d3){_0x5cb065=_0x2f06d3;_0x2f0cfb=0xc8;}else{_0x2f0cfb=0xce;}_0x3d0c98['status'](_0x2f0cfb);return _0x3d0c98[_0x48c6('0x21')](_0x48c6('0x22'),_0x3de4cc+'-'+_0x5cb065+'/'+_0x2f06d3)['json'](_0x5ebbe2);}return null;};}function patchUpdates(_0x33cb68){return function(_0x4b29ed){try{jsonpatch[_0x48c6('0x23')](_0x4b29ed,_0x33cb68,!![]);}catch(_0x57a1eb){return BPromise[_0x48c6('0x24')](_0x57a1eb);}return _0x4b29ed['save']();};}function saveUpdates(_0x476128,_0x3c9a34){return function(_0x35fc75){if(_0x35fc75){return _0x35fc75[_0x48c6('0x25')](_0x476128)['then'](function(_0xd4b1e5){return _0xd4b1e5;});}return null;};}function removeEntity(_0x2ad412,_0x53e1ce){return function(_0x2a0a9b){if(_0x2a0a9b){return _0x2a0a9b[_0x48c6('0x26')]()['then'](function(){_0x2ad412[_0x48c6('0x1a')](0xcc)[_0x48c6('0x1b')]();});}};}function handleEntityNotFound(_0x44d0ba,_0x15fb94){return function(_0x53ed49){if(!_0x53ed49){_0x44d0ba[_0x48c6('0x19')](0x194);}return _0x53ed49;};}function handleError(_0x5c86f6,_0x2f85fc){_0x2f85fc=_0x2f85fc||0x1f4;return function(_0x583e8d){logger['error'](_0x583e8d[_0x48c6('0x27')]);if(_0x583e8d[_0x48c6('0x28')]){delete _0x583e8d[_0x48c6('0x28')];}_0x5c86f6[_0x48c6('0x1a')](_0x2f85fc)[_0x48c6('0x29')](_0x583e8d);};}exports[_0x48c6('0x2a')]=function(_0x234170,_0x4197e9){var _0x2ab678={},_0x5d106b={},_0x405615={'count':0x0,'rows':[]};var _0x25fe15=_[_0x48c6('0x2b')](db[_0x48c6('0x2c')]['rawAttributes'],function(_0x25079a){return{'name':_0x25079a['fieldName'],'type':_0x25079a['type']['key']};});_0x5d106b[_0x48c6('0x2d')]=_[_0x48c6('0x2b')](_0x25fe15,_0x48c6('0x28'));_0x5d106b[_0x48c6('0x2e')]=_[_0x48c6('0x2f')](_0x234170['query']);_0x5d106b[_0x48c6('0x30')]=_[_0x48c6('0x31')](_0x5d106b['model'],_0x5d106b['query']);_0x2ab678[_0x48c6('0x32')]=_[_0x48c6('0x31')](_0x5d106b[_0x48c6('0x2d')],qs[_0x48c6('0x33')](_0x234170[_0x48c6('0x2e')][_0x48c6('0x33')]));_0x2ab678[_0x48c6('0x32')]=_0x2ab678['attributes'][_0x48c6('0x34')]?_0x2ab678[_0x48c6('0x32')]:_0x5d106b[_0x48c6('0x2d')];if(!_0x234170[_0x48c6('0x2e')][_0x48c6('0x35')](_0x48c6('0x36'))){_0x2ab678[_0x48c6('0x1f')]=qs[_0x48c6('0x1f')](_0x234170['query'][_0x48c6('0x1f')]);_0x2ab678[_0x48c6('0x1d')]=qs[_0x48c6('0x1d')](_0x234170[_0x48c6('0x2e')][_0x48c6('0x1d')]);}_0x2ab678[_0x48c6('0x37')]=qs[_0x48c6('0x38')](_0x234170['query'][_0x48c6('0x38')]);_0x2ab678[_0x48c6('0x39')]=qs[_0x48c6('0x30')](_[_0x48c6('0x3a')](_0x234170['query'],_0x5d106b[_0x48c6('0x30')]),_0x25fe15);if(_0x234170[_0x48c6('0x2e')][_0x48c6('0x3b')]){_0x2ab678[_0x48c6('0x39')]=_[_0x48c6('0x3c')](_0x2ab678[_0x48c6('0x39')],{'$or':_['map'](_0x25fe15,function(_0x30717d){if(_0x30717d[_0x48c6('0x3d')]!==_0x48c6('0x3e')){var _0x3321b3={};_0x3321b3[_0x30717d[_0x48c6('0x28')]]={'$like':'%'+_0x234170[_0x48c6('0x2e')]['filter']+'%'};return _0x3321b3;}})});}_0x2ab678=_[_0x48c6('0x3c')]({},_0x2ab678,_0x234170[_0x48c6('0x3f')]);var _0x3c036b={'where':_0x2ab678['where']};return db[_0x48c6('0x2c')][_0x48c6('0x20')](_0x3c036b)[_0x48c6('0x40')](function(_0x549edb){_0x405615[_0x48c6('0x20')]=_0x549edb;if(_0x234170[_0x48c6('0x2e')]['includeAll']){_0x2ab678[_0x48c6('0x41')]=[{'all':!![]}];}return db[_0x48c6('0x2c')][_0x48c6('0x42')](_0x2ab678);})[_0x48c6('0x40')](function(_0x1f865b){_0x405615[_0x48c6('0x43')]=_0x1f865b;return _0x405615;})[_0x48c6('0x40')](respondWithFilteredResult(_0x4197e9,_0x2ab678))[_0x48c6('0x44')](handleError(_0x4197e9,null));};exports[_0x48c6('0x45')]=function(_0x593dee,_0x2bbe7e){var _0x57fd1e={'raw':![],'where':{'id':_0x593dee[_0x48c6('0x46')]['id']}},_0x5cf9ee={};_0x5cf9ee[_0x48c6('0x2d')]=_[_0x48c6('0x2f')](db[_0x48c6('0x2c')]['rawAttributes']);_0x5cf9ee['query']=_[_0x48c6('0x2f')](_0x593dee[_0x48c6('0x2e')]);_0x5cf9ee['filters']=_[_0x48c6('0x31')](_0x5cf9ee[_0x48c6('0x2d')],_0x5cf9ee[_0x48c6('0x2e')]);_0x57fd1e['attributes']=_[_0x48c6('0x31')](_0x5cf9ee['model'],qs[_0x48c6('0x33')](_0x593dee[_0x48c6('0x2e')][_0x48c6('0x33')]));_0x57fd1e['attributes']=_0x57fd1e['attributes'][_0x48c6('0x34')]?_0x57fd1e['attributes']:_0x5cf9ee[_0x48c6('0x2d')];if(_0x593dee[_0x48c6('0x2e')][_0x48c6('0x47')]){_0x57fd1e['include']=[{'all':!![]}];}_0x57fd1e=_['merge']({},_0x57fd1e,_0x593dee[_0x48c6('0x3f')]);return db[_0x48c6('0x2c')][_0x48c6('0x48')](_0x57fd1e)[_0x48c6('0x40')](handleEntityNotFound(_0x2bbe7e,null))['then'](respondWithResult(_0x2bbe7e,null))['catch'](handleError(_0x2bbe7e,null));};exports[_0x48c6('0x49')]=function(_0x529bc6,_0x575b4b){return db[_0x48c6('0x2c')][_0x48c6('0x49')](_0x529bc6[_0x48c6('0x4a')],{})[_0x48c6('0x40')](respondWithResult(_0x575b4b,0xc9))[_0x48c6('0x44')](handleError(_0x575b4b,null));};exports[_0x48c6('0x25')]=function(_0x16918e,_0x30f94d){if(_0x16918e[_0x48c6('0x4a')]['id']){delete _0x16918e['body']['id'];}return db[_0x48c6('0x2c')]['find']({'where':{'id':_0x16918e[_0x48c6('0x46')]['id']}})['then'](handleEntityNotFound(_0x30f94d,null))[_0x48c6('0x40')](saveUpdates(_0x16918e[_0x48c6('0x4a')],null))[_0x48c6('0x40')](respondWithResult(_0x30f94d,null))['catch'](handleError(_0x30f94d,null));};exports[_0x48c6('0x26')]=function(_0xdbacbd,_0x334c55){return db[_0x48c6('0x2c')][_0x48c6('0x48')]({'where':{'id':_0xdbacbd['params']['id']}})[_0x48c6('0x40')](handleEntityNotFound(_0x334c55,null))[_0x48c6('0x40')](removeEntity(_0x334c55,null))['catch'](handleError(_0x334c55,null));};exports[_0x48c6('0x4b')]=function(_0x31a94d,_0xa5fe96,_0x1005c5){var _0x4f4b47={};var _0x4dfbe7={};var _0x269e18;var _0x4d73ac;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x31a94d['params']['id']}})['then'](handleEntityNotFound(_0xa5fe96,null))[_0x48c6('0x40')](function(_0x842519){if(_0x842519){_0x269e18=_0x842519;_0x4dfbe7['model']=_['keys'](db[_0x48c6('0x4c')][_0x48c6('0x4d')]);_0x4dfbe7[_0x48c6('0x2e')]=_[_0x48c6('0x2f')](_0x31a94d[_0x48c6('0x2e')]);_0x4dfbe7[_0x48c6('0x30')]=_['intersection'](_0x4dfbe7[_0x48c6('0x2d')],_0x4dfbe7['query']);_0x4f4b47['attributes']=_[_0x48c6('0x31')](_0x4dfbe7[_0x48c6('0x2d')],qs['fields'](_0x31a94d[_0x48c6('0x2e')][_0x48c6('0x33')]));_0x4f4b47[_0x48c6('0x32')]=_0x4f4b47[_0x48c6('0x32')][_0x48c6('0x34')]?_0x4f4b47['attributes']:_0x4dfbe7[_0x48c6('0x2d')];_0x4f4b47[_0x48c6('0x37')]=qs[_0x48c6('0x38')](_0x31a94d[_0x48c6('0x2e')]['sort']);_0x4f4b47[_0x48c6('0x39')]=qs[_0x48c6('0x30')](_[_0x48c6('0x3a')](_0x31a94d[_0x48c6('0x2e')],_0x4dfbe7[_0x48c6('0x30')]));if(_0x31a94d['query'][_0x48c6('0x3b')]){_0x4f4b47['where']=_['merge'](_0x4f4b47[_0x48c6('0x39')],{'$or':_[_0x48c6('0x2b')](_0x4f4b47['attributes'],function(_0x56776b){var _0x24fe8b={};_0x24fe8b[_0x56776b]={'$like':'%'+_0x31a94d['query'][_0x48c6('0x3b')]+'%'};return _0x24fe8b;})});}_0x4f4b47=_['merge']({},_0x4f4b47,_0x31a94d['options']);return _0x269e18[_0x48c6('0x4b')](_0x4f4b47);}})[_0x48c6('0x40')](function(_0x3c00b1){if(_0x3c00b1){_0x4d73ac=_0x3c00b1[_0x48c6('0x34')];if(!_0x31a94d[_0x48c6('0x2e')][_0x48c6('0x35')](_0x48c6('0x36'))){_0x4f4b47[_0x48c6('0x1f')]=qs[_0x48c6('0x1f')](_0x31a94d[_0x48c6('0x2e')][_0x48c6('0x1f')]);_0x4f4b47[_0x48c6('0x1d')]=qs[_0x48c6('0x1d')](_0x31a94d['query'][_0x48c6('0x1d')]);}return _0x269e18[_0x48c6('0x4b')](_0x4f4b47);}})[_0x48c6('0x40')](function(_0x1ba508){if(_0x1ba508){return _0x1ba508?{'count':_0x4d73ac,'rows':_0x1ba508}:null;}})[_0x48c6('0x40')](respondWithResult(_0xa5fe96,null))['catch'](handleError(_0xa5fe96,null));};exports[_0x48c6('0x4e')]=function(_0xfcd988,_0x218bb0,_0x4c9901){var _0x34ffff={};var _0x37ee3c={};var _0x342354;var _0x59f458;return db[_0x48c6('0x2c')][_0x48c6('0x4f')]({'where':{'id':_0xfcd988[_0x48c6('0x46')]['id']}})[_0x48c6('0x40')](handleEntityNotFound(_0x218bb0,null))[_0x48c6('0x40')](function(_0x16fc41){if(_0x16fc41){_0x342354=_0x16fc41;_0x37ee3c[_0x48c6('0x2d')]=_[_0x48c6('0x2f')](db[_0x48c6('0x4c')][_0x48c6('0x4d')]);_0x37ee3c[_0x48c6('0x2e')]=_[_0x48c6('0x2f')](_0xfcd988[_0x48c6('0x2e')]);_0x37ee3c['filters']=_[_0x48c6('0x31')](_0x37ee3c[_0x48c6('0x2d')],_0x37ee3c[_0x48c6('0x2e')]);_0x34ffff[_0x48c6('0x32')]=_[_0x48c6('0x31')](_0x37ee3c[_0x48c6('0x2d')],qs['fields'](_0xfcd988['query'][_0x48c6('0x33')]));_0x34ffff['attributes']=_0x34ffff[_0x48c6('0x32')][_0x48c6('0x34')]?_0x34ffff[_0x48c6('0x32')]:_0x37ee3c[_0x48c6('0x2d')];_0x34ffff[_0x48c6('0x37')]=qs[_0x48c6('0x38')](_0xfcd988[_0x48c6('0x2e')][_0x48c6('0x38')]);_0x34ffff[_0x48c6('0x39')]=qs[_0x48c6('0x30')](_[_0x48c6('0x3a')](_0xfcd988['query'],_0x37ee3c[_0x48c6('0x30')]));if(_0xfcd988[_0x48c6('0x2e')][_0x48c6('0x3b')]){_0x34ffff[_0x48c6('0x39')]=_[_0x48c6('0x3c')](_0x34ffff[_0x48c6('0x39')],{'$or':_[_0x48c6('0x2b')](_0x34ffff[_0x48c6('0x32')],function(_0x1cdfb5){var _0x122b0f={};_0x122b0f[_0x1cdfb5]={'$like':'%'+_0xfcd988[_0x48c6('0x2e')][_0x48c6('0x3b')]+'%'};return _0x122b0f;})});}_0x34ffff=_[_0x48c6('0x3c')]({},_0x34ffff,_0xfcd988['options']);return _0x342354['getSubjects'](_0x34ffff);}})['then'](function(_0x58f3cd){if(_0x58f3cd){_0x59f458=_0x58f3cd[_0x48c6('0x34')];if(!_0xfcd988[_0x48c6('0x2e')]['hasOwnProperty'](_0x48c6('0x36'))){_0x34ffff[_0x48c6('0x1f')]=qs[_0x48c6('0x1f')](_0xfcd988[_0x48c6('0x2e')]['limit']);_0x34ffff[_0x48c6('0x1d')]=qs[_0x48c6('0x1d')](_0xfcd988[_0x48c6('0x2e')][_0x48c6('0x1d')]);}return _0x342354['getSubjects'](_0x34ffff);}})[_0x48c6('0x40')](function(_0x312180){if(_0x312180){return _0x312180?{'count':_0x59f458,'rows':_0x312180}:null;}})['then'](respondWithResult(_0x218bb0,null))[_0x48c6('0x44')](handleError(_0x218bb0,null));};exports[_0x48c6('0x50')]=function(_0x415712,_0x1a8345,_0xd17d83){var _0x234bae={};var _0x5d1cfe={};var _0x622af5;var _0x401b6b;return db[_0x48c6('0x2c')][_0x48c6('0x4f')]({'where':{'id':_0x415712[_0x48c6('0x46')]['id']}})[_0x48c6('0x40')](handleEntityNotFound(_0x1a8345,null))[_0x48c6('0x40')](function(_0x1677bd){if(_0x1677bd){_0x622af5=_0x1677bd;_0x5d1cfe[_0x48c6('0x2d')]=_[_0x48c6('0x2f')](db['SugarcrmField'][_0x48c6('0x4d')]);_0x5d1cfe[_0x48c6('0x2e')]=_[_0x48c6('0x2f')](_0x415712[_0x48c6('0x2e')]);_0x5d1cfe[_0x48c6('0x30')]=_[_0x48c6('0x31')](_0x5d1cfe[_0x48c6('0x2d')],_0x5d1cfe[_0x48c6('0x2e')]);_0x234bae[_0x48c6('0x32')]=_[_0x48c6('0x31')](_0x5d1cfe[_0x48c6('0x2d')],qs[_0x48c6('0x33')](_0x415712[_0x48c6('0x2e')][_0x48c6('0x33')]));_0x234bae[_0x48c6('0x32')]=_0x234bae[_0x48c6('0x32')][_0x48c6('0x34')]?_0x234bae[_0x48c6('0x32')]:_0x5d1cfe[_0x48c6('0x2d')];_0x234bae[_0x48c6('0x37')]=qs['sort'](_0x415712[_0x48c6('0x2e')]['sort']);_0x234bae['where']=qs[_0x48c6('0x30')](_[_0x48c6('0x3a')](_0x415712['query'],_0x5d1cfe[_0x48c6('0x30')]));if(_0x415712[_0x48c6('0x2e')][_0x48c6('0x3b')]){_0x234bae['where']=_['merge'](_0x234bae[_0x48c6('0x39')],{'$or':_[_0x48c6('0x2b')](_0x234bae[_0x48c6('0x32')],function(_0x5d1a86){var _0x4575ac={};_0x4575ac[_0x5d1a86]={'$like':'%'+_0x415712[_0x48c6('0x2e')][_0x48c6('0x3b')]+'%'};return _0x4575ac;})});}_0x234bae=_[_0x48c6('0x3c')]({},_0x234bae,_0x415712[_0x48c6('0x3f')]);return _0x622af5[_0x48c6('0x50')](_0x234bae);}})[_0x48c6('0x40')](function(_0x4c3660){if(_0x4c3660){_0x401b6b=_0x4c3660['length'];if(!_0x415712[_0x48c6('0x2e')][_0x48c6('0x35')](_0x48c6('0x36'))){_0x234bae[_0x48c6('0x1f')]=qs['limit'](_0x415712[_0x48c6('0x2e')]['limit']);_0x234bae[_0x48c6('0x1d')]=qs[_0x48c6('0x1d')](_0x415712['query'][_0x48c6('0x1d')]);}return _0x622af5['getDescriptions'](_0x234bae);}})['then'](function(_0x16efc1){if(_0x16efc1){return _0x16efc1?{'count':_0x401b6b,'rows':_0x16efc1}:null;}})[_0x48c6('0x40')](respondWithResult(_0x1a8345,null))[_0x48c6('0x44')](handleError(_0x1a8345,null));}; \ No newline at end of file +var _0xf2b2=['reject','save','update','then','error','stack','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','destroy','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf2b2,0x163));var _0x2f2b=function(_0x26ca7c,_0x5b66f8){_0x26ca7c=_0x26ca7c-0x0;var _0x2d8503=_0xf2b2[_0x26ca7c];return _0x2d8503;};'use strict';var emlformat=require(_0x2f2b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2f2b('0x1'));var jsonpatch=require(_0x2f2b('0x2'));var rp=require('request-promise');var moment=require(_0x2f2b('0x3'));var BPromise=require(_0x2f2b('0x4'));var Mustache=require('mustache');var util=require(_0x2f2b('0x5'));var path=require(_0x2f2b('0x6'));var sox=require(_0x2f2b('0x7'));var csv=require(_0x2f2b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f2b('0x9'));var squel=require(_0x2f2b('0xa'));var crypto=require('crypto');var jsforce=require(_0x2f2b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2f2b('0x8'));var querystring=require(_0x2f2b('0xc'));var Papa=require(_0x2f2b('0xd'));var Redis=require(_0x2f2b('0xe'));var authService=require(_0x2f2b('0xf'));var qs=require(_0x2f2b('0x10'));var as=require(_0x2f2b('0x11'));var hardwareService=require(_0x2f2b('0x12'));var logger=require('../../config/logger')(_0x2f2b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2f2b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe24d4c,_0x448a43){_0x448a43=_0x448a43||0xcc;return function(_0x310d92){if(_0x310d92){return _0xe24d4c['sendStatus'](_0x448a43);}return _0xe24d4c[_0x2f2b('0x15')](_0x448a43)[_0x2f2b('0x16')]();};}function respondWithResult(_0x1c02ec,_0x7dfad2){_0x7dfad2=_0x7dfad2||0xc8;return function(_0x52a485){if(_0x52a485){return _0x1c02ec[_0x2f2b('0x15')](_0x7dfad2)[_0x2f2b('0x17')](_0x52a485);}};}function respondWithFilteredResult(_0x9c8e97,_0x3dbb84){return function(_0x534b17){if(_0x534b17){var _0x1f4620=typeof _0x3dbb84['offset']===_0x2f2b('0x18')&&typeof _0x3dbb84[_0x2f2b('0x19')]===_0x2f2b('0x18');var _0x22f623=_0x534b17[_0x2f2b('0x1a')];var _0x5164b9=_0x1f4620?0x0:_0x3dbb84[_0x2f2b('0x1b')];var _0x3e873b=_0x1f4620?_0x534b17[_0x2f2b('0x1a')]:_0x3dbb84['offset']+_0x3dbb84['limit'];var _0x167de9;if(_0x3e873b>=_0x22f623){_0x3e873b=_0x22f623;_0x167de9=0xc8;}else{_0x167de9=0xce;}_0x9c8e97['status'](_0x167de9);return _0x9c8e97[_0x2f2b('0x1c')](_0x2f2b('0x1d'),_0x5164b9+'-'+_0x3e873b+'/'+_0x22f623)[_0x2f2b('0x17')](_0x534b17);}return null;};}function patchUpdates(_0x9d2c02){return function(_0x33f175){try{jsonpatch['apply'](_0x33f175,_0x9d2c02,!![]);}catch(_0xb4726e){return BPromise[_0x2f2b('0x1e')](_0xb4726e);}return _0x33f175[_0x2f2b('0x1f')]();};}function saveUpdates(_0x52840d,_0x4ce2d8){return function(_0x2280e8){if(_0x2280e8){return _0x2280e8[_0x2f2b('0x20')](_0x52840d)[_0x2f2b('0x21')](function(_0x129986){return _0x129986;});}return null;};}function removeEntity(_0x4da004,_0x3389b6){return function(_0x1d04c5){if(_0x1d04c5){return _0x1d04c5['destroy']()['then'](function(){_0x4da004[_0x2f2b('0x15')](0xcc)[_0x2f2b('0x16')]();});}};}function handleEntityNotFound(_0x18fc75,_0x1d9d1a){return function(_0x5db682){if(!_0x5db682){_0x18fc75['sendStatus'](0x194);}return _0x5db682;};}function handleError(_0x25256d,_0x1f9a55){_0x1f9a55=_0x1f9a55||0x1f4;return function(_0x3767d5){logger[_0x2f2b('0x22')](_0x3767d5[_0x2f2b('0x23')]);if(_0x3767d5[_0x2f2b('0x24')]){delete _0x3767d5[_0x2f2b('0x24')];}_0x25256d[_0x2f2b('0x15')](_0x1f9a55)[_0x2f2b('0x25')](_0x3767d5);};}exports['index']=function(_0x54ad46,_0x1562a1){var _0x4d48e4={},_0x48da47={},_0x27e14d={'count':0x0,'rows':[]};var _0x2d452e=_[_0x2f2b('0x26')](db[_0x2f2b('0x27')][_0x2f2b('0x28')],function(_0x44727b){return{'name':_0x44727b[_0x2f2b('0x29')],'type':_0x44727b['type'][_0x2f2b('0x2a')]};});_0x48da47['model']=_[_0x2f2b('0x26')](_0x2d452e,_0x2f2b('0x24'));_0x48da47[_0x2f2b('0x2b')]=_[_0x2f2b('0x2c')](_0x54ad46[_0x2f2b('0x2b')]);_0x48da47[_0x2f2b('0x2d')]=_['intersection'](_0x48da47['model'],_0x48da47[_0x2f2b('0x2b')]);_0x4d48e4['attributes']=_[_0x2f2b('0x2e')](_0x48da47[_0x2f2b('0x2f')],qs['fields'](_0x54ad46[_0x2f2b('0x2b')][_0x2f2b('0x30')]));_0x4d48e4[_0x2f2b('0x31')]=_0x4d48e4[_0x2f2b('0x31')][_0x2f2b('0x32')]?_0x4d48e4[_0x2f2b('0x31')]:_0x48da47['model'];if(!_0x54ad46['query'][_0x2f2b('0x33')](_0x2f2b('0x34'))){_0x4d48e4['limit']=qs['limit'](_0x54ad46[_0x2f2b('0x2b')][_0x2f2b('0x19')]);_0x4d48e4['offset']=qs['offset'](_0x54ad46[_0x2f2b('0x2b')][_0x2f2b('0x1b')]);}_0x4d48e4[_0x2f2b('0x35')]=qs[_0x2f2b('0x36')](_0x54ad46['query'][_0x2f2b('0x36')]);_0x4d48e4[_0x2f2b('0x37')]=qs['filters'](_[_0x2f2b('0x38')](_0x54ad46[_0x2f2b('0x2b')],_0x48da47[_0x2f2b('0x2d')]),_0x2d452e);if(_0x54ad46[_0x2f2b('0x2b')][_0x2f2b('0x39')]){_0x4d48e4[_0x2f2b('0x37')]=_[_0x2f2b('0x3a')](_0x4d48e4[_0x2f2b('0x37')],{'$or':_[_0x2f2b('0x26')](_0x2d452e,function(_0x1ce94b){if(_0x1ce94b[_0x2f2b('0x3b')]!==_0x2f2b('0x3c')){var _0x4d5e9c={};_0x4d5e9c[_0x1ce94b['name']]={'$like':'%'+_0x54ad46[_0x2f2b('0x2b')][_0x2f2b('0x39')]+'%'};return _0x4d5e9c;}})});}_0x4d48e4=_[_0x2f2b('0x3a')]({},_0x4d48e4,_0x54ad46['options']);var _0x5b8c99={'where':_0x4d48e4[_0x2f2b('0x37')]};return db['SugarcrmConfiguration']['count'](_0x5b8c99)['then'](function(_0x8c7df5){_0x27e14d['count']=_0x8c7df5;if(_0x54ad46['query'][_0x2f2b('0x3d')]){_0x4d48e4[_0x2f2b('0x3e')]=[{'all':!![]}];}return db[_0x2f2b('0x27')][_0x2f2b('0x3f')](_0x4d48e4);})[_0x2f2b('0x21')](function(_0x199ad8){_0x27e14d['rows']=_0x199ad8;return _0x27e14d;})['then'](respondWithFilteredResult(_0x1562a1,_0x4d48e4))[_0x2f2b('0x40')](handleError(_0x1562a1,null));};exports[_0x2f2b('0x41')]=function(_0x5c31a1,_0xe0fa33){var _0x2eb367={'raw':![],'where':{'id':_0x5c31a1[_0x2f2b('0x42')]['id']}},_0x2a0817={};_0x2a0817[_0x2f2b('0x2f')]=_[_0x2f2b('0x2c')](db['SugarcrmConfiguration'][_0x2f2b('0x28')]);_0x2a0817['query']=_[_0x2f2b('0x2c')](_0x5c31a1[_0x2f2b('0x2b')]);_0x2a0817[_0x2f2b('0x2d')]=_[_0x2f2b('0x2e')](_0x2a0817['model'],_0x2a0817[_0x2f2b('0x2b')]);_0x2eb367[_0x2f2b('0x31')]=_[_0x2f2b('0x2e')](_0x2a0817[_0x2f2b('0x2f')],qs[_0x2f2b('0x30')](_0x5c31a1[_0x2f2b('0x2b')]['fields']));_0x2eb367[_0x2f2b('0x31')]=_0x2eb367['attributes']['length']?_0x2eb367['attributes']:_0x2a0817[_0x2f2b('0x2f')];if(_0x5c31a1[_0x2f2b('0x2b')][_0x2f2b('0x3d')]){_0x2eb367[_0x2f2b('0x3e')]=[{'all':!![]}];}_0x2eb367=_[_0x2f2b('0x3a')]({},_0x2eb367,_0x5c31a1[_0x2f2b('0x43')]);return db[_0x2f2b('0x27')][_0x2f2b('0x44')](_0x2eb367)[_0x2f2b('0x21')](handleEntityNotFound(_0xe0fa33,null))['then'](respondWithResult(_0xe0fa33,null))[_0x2f2b('0x40')](handleError(_0xe0fa33,null));};exports[_0x2f2b('0x45')]=function(_0x4d28c9,_0x3419f1){return db[_0x2f2b('0x27')][_0x2f2b('0x45')](_0x4d28c9[_0x2f2b('0x46')],{})[_0x2f2b('0x21')](respondWithResult(_0x3419f1,0xc9))[_0x2f2b('0x40')](handleError(_0x3419f1,null));};exports[_0x2f2b('0x20')]=function(_0xc40c20,_0x31b6a2){if(_0xc40c20[_0x2f2b('0x46')]['id']){delete _0xc40c20[_0x2f2b('0x46')]['id'];}return db[_0x2f2b('0x27')]['find']({'where':{'id':_0xc40c20[_0x2f2b('0x42')]['id']}})['then'](handleEntityNotFound(_0x31b6a2,null))[_0x2f2b('0x21')](saveUpdates(_0xc40c20[_0x2f2b('0x46')],null))[_0x2f2b('0x21')](respondWithResult(_0x31b6a2,null))[_0x2f2b('0x40')](handleError(_0x31b6a2,null));};exports[_0x2f2b('0x47')]=function(_0x50c38d,_0x83dac1){return db[_0x2f2b('0x27')][_0x2f2b('0x44')]({'where':{'id':_0x50c38d[_0x2f2b('0x42')]['id']}})['then'](handleEntityNotFound(_0x83dac1,null))['then'](removeEntity(_0x83dac1,null))[_0x2f2b('0x40')](handleError(_0x83dac1,null));};exports[_0x2f2b('0x48')]=function(_0x335ee5,_0xa9681,_0x13cdc6){var _0x39b60b={};var _0x5dbf43={};var _0x5919ca;var _0x5e1d7d;return db[_0x2f2b('0x27')][_0x2f2b('0x49')]({'where':{'id':_0x335ee5[_0x2f2b('0x42')]['id']}})[_0x2f2b('0x21')](handleEntityNotFound(_0xa9681,null))[_0x2f2b('0x21')](function(_0x3a99bc){if(_0x3a99bc){_0x5919ca=_0x3a99bc;_0x5dbf43['model']=_[_0x2f2b('0x2c')](db[_0x2f2b('0x4a')][_0x2f2b('0x28')]);_0x5dbf43[_0x2f2b('0x2b')]=_[_0x2f2b('0x2c')](_0x335ee5[_0x2f2b('0x2b')]);_0x5dbf43[_0x2f2b('0x2d')]=_[_0x2f2b('0x2e')](_0x5dbf43['model'],_0x5dbf43[_0x2f2b('0x2b')]);_0x39b60b['attributes']=_['intersection'](_0x5dbf43[_0x2f2b('0x2f')],qs[_0x2f2b('0x30')](_0x335ee5[_0x2f2b('0x2b')][_0x2f2b('0x30')]));_0x39b60b[_0x2f2b('0x31')]=_0x39b60b[_0x2f2b('0x31')][_0x2f2b('0x32')]?_0x39b60b[_0x2f2b('0x31')]:_0x5dbf43[_0x2f2b('0x2f')];_0x39b60b[_0x2f2b('0x35')]=qs[_0x2f2b('0x36')](_0x335ee5['query'][_0x2f2b('0x36')]);_0x39b60b[_0x2f2b('0x37')]=qs[_0x2f2b('0x2d')](_[_0x2f2b('0x38')](_0x335ee5[_0x2f2b('0x2b')],_0x5dbf43[_0x2f2b('0x2d')]));if(_0x335ee5[_0x2f2b('0x2b')][_0x2f2b('0x39')]){_0x39b60b['where']=_[_0x2f2b('0x3a')](_0x39b60b['where'],{'$or':_[_0x2f2b('0x26')](_0x39b60b[_0x2f2b('0x31')],function(_0x16104f){var _0x509ff0={};_0x509ff0[_0x16104f]={'$like':'%'+_0x335ee5[_0x2f2b('0x2b')][_0x2f2b('0x39')]+'%'};return _0x509ff0;})});}_0x39b60b=_[_0x2f2b('0x3a')]({},_0x39b60b,_0x335ee5['options']);return _0x5919ca[_0x2f2b('0x48')](_0x39b60b);}})['then'](function(_0x2a6fca){if(_0x2a6fca){_0x5e1d7d=_0x2a6fca[_0x2f2b('0x32')];if(!_0x335ee5['query']['hasOwnProperty'](_0x2f2b('0x34'))){_0x39b60b[_0x2f2b('0x19')]=qs[_0x2f2b('0x19')](_0x335ee5[_0x2f2b('0x2b')][_0x2f2b('0x19')]);_0x39b60b[_0x2f2b('0x1b')]=qs[_0x2f2b('0x1b')](_0x335ee5[_0x2f2b('0x2b')][_0x2f2b('0x1b')]);}return _0x5919ca['getFields'](_0x39b60b);}})[_0x2f2b('0x21')](function(_0x2dbfbf){if(_0x2dbfbf){return _0x2dbfbf?{'count':_0x5e1d7d,'rows':_0x2dbfbf}:null;}})[_0x2f2b('0x21')](respondWithResult(_0xa9681,null))['catch'](handleError(_0xa9681,null));};exports[_0x2f2b('0x4b')]=function(_0x4b1297,_0x1772b7,_0x36b791){var _0x3efe80={};var _0xdec3b8={};var _0x17e5a5;var _0x3dd579;return db[_0x2f2b('0x27')][_0x2f2b('0x49')]({'where':{'id':_0x4b1297[_0x2f2b('0x42')]['id']}})[_0x2f2b('0x21')](handleEntityNotFound(_0x1772b7,null))['then'](function(_0x159897){if(_0x159897){_0x17e5a5=_0x159897;_0xdec3b8[_0x2f2b('0x2f')]=_[_0x2f2b('0x2c')](db[_0x2f2b('0x4a')][_0x2f2b('0x28')]);_0xdec3b8[_0x2f2b('0x2b')]=_[_0x2f2b('0x2c')](_0x4b1297[_0x2f2b('0x2b')]);_0xdec3b8[_0x2f2b('0x2d')]=_[_0x2f2b('0x2e')](_0xdec3b8[_0x2f2b('0x2f')],_0xdec3b8['query']);_0x3efe80[_0x2f2b('0x31')]=_['intersection'](_0xdec3b8[_0x2f2b('0x2f')],qs['fields'](_0x4b1297['query'][_0x2f2b('0x30')]));_0x3efe80[_0x2f2b('0x31')]=_0x3efe80[_0x2f2b('0x31')][_0x2f2b('0x32')]?_0x3efe80[_0x2f2b('0x31')]:_0xdec3b8[_0x2f2b('0x2f')];_0x3efe80[_0x2f2b('0x35')]=qs[_0x2f2b('0x36')](_0x4b1297[_0x2f2b('0x2b')][_0x2f2b('0x36')]);_0x3efe80[_0x2f2b('0x37')]=qs[_0x2f2b('0x2d')](_[_0x2f2b('0x38')](_0x4b1297[_0x2f2b('0x2b')],_0xdec3b8[_0x2f2b('0x2d')]));if(_0x4b1297['query'][_0x2f2b('0x39')]){_0x3efe80['where']=_['merge'](_0x3efe80[_0x2f2b('0x37')],{'$or':_[_0x2f2b('0x26')](_0x3efe80[_0x2f2b('0x31')],function(_0x535abe){var _0x38b0a1={};_0x38b0a1[_0x535abe]={'$like':'%'+_0x4b1297[_0x2f2b('0x2b')][_0x2f2b('0x39')]+'%'};return _0x38b0a1;})});}_0x3efe80=_[_0x2f2b('0x3a')]({},_0x3efe80,_0x4b1297[_0x2f2b('0x43')]);return _0x17e5a5[_0x2f2b('0x4b')](_0x3efe80);}})[_0x2f2b('0x21')](function(_0x453d69){if(_0x453d69){_0x3dd579=_0x453d69['length'];if(!_0x4b1297['query'][_0x2f2b('0x33')](_0x2f2b('0x34'))){_0x3efe80[_0x2f2b('0x19')]=qs[_0x2f2b('0x19')](_0x4b1297[_0x2f2b('0x2b')][_0x2f2b('0x19')]);_0x3efe80['offset']=qs[_0x2f2b('0x1b')](_0x4b1297[_0x2f2b('0x2b')][_0x2f2b('0x1b')]);}return _0x17e5a5[_0x2f2b('0x4b')](_0x3efe80);}})[_0x2f2b('0x21')](function(_0x39e724){if(_0x39e724){return _0x39e724?{'count':_0x3dd579,'rows':_0x39e724}:null;}})['then'](respondWithResult(_0x1772b7,null))['catch'](handleError(_0x1772b7,null));};exports[_0x2f2b('0x4c')]=function(_0x1131be,_0x5b753b,_0x4a0ea1){var _0x7860c3={};var _0x40d051={};var _0x32a1f4;var _0x1dc286;return db['SugarcrmConfiguration'][_0x2f2b('0x49')]({'where':{'id':_0x1131be[_0x2f2b('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b753b,null))[_0x2f2b('0x21')](function(_0x433ee0){if(_0x433ee0){_0x32a1f4=_0x433ee0;_0x40d051[_0x2f2b('0x2f')]=_[_0x2f2b('0x2c')](db[_0x2f2b('0x4a')][_0x2f2b('0x28')]);_0x40d051[_0x2f2b('0x2b')]=_[_0x2f2b('0x2c')](_0x1131be[_0x2f2b('0x2b')]);_0x40d051[_0x2f2b('0x2d')]=_[_0x2f2b('0x2e')](_0x40d051[_0x2f2b('0x2f')],_0x40d051['query']);_0x7860c3[_0x2f2b('0x31')]=_[_0x2f2b('0x2e')](_0x40d051[_0x2f2b('0x2f')],qs[_0x2f2b('0x30')](_0x1131be['query'][_0x2f2b('0x30')]));_0x7860c3[_0x2f2b('0x31')]=_0x7860c3[_0x2f2b('0x31')][_0x2f2b('0x32')]?_0x7860c3[_0x2f2b('0x31')]:_0x40d051[_0x2f2b('0x2f')];_0x7860c3[_0x2f2b('0x35')]=qs[_0x2f2b('0x36')](_0x1131be[_0x2f2b('0x2b')][_0x2f2b('0x36')]);_0x7860c3[_0x2f2b('0x37')]=qs[_0x2f2b('0x2d')](_[_0x2f2b('0x38')](_0x1131be['query'],_0x40d051['filters']));if(_0x1131be[_0x2f2b('0x2b')]['filter']){_0x7860c3[_0x2f2b('0x37')]=_['merge'](_0x7860c3[_0x2f2b('0x37')],{'$or':_[_0x2f2b('0x26')](_0x7860c3[_0x2f2b('0x31')],function(_0xd9ab95){var _0x35bb79={};_0x35bb79[_0xd9ab95]={'$like':'%'+_0x1131be['query'][_0x2f2b('0x39')]+'%'};return _0x35bb79;})});}_0x7860c3=_[_0x2f2b('0x3a')]({},_0x7860c3,_0x1131be[_0x2f2b('0x43')]);return _0x32a1f4[_0x2f2b('0x4c')](_0x7860c3);}})[_0x2f2b('0x21')](function(_0x8adbdc){if(_0x8adbdc){_0x1dc286=_0x8adbdc[_0x2f2b('0x32')];if(!_0x1131be[_0x2f2b('0x2b')]['hasOwnProperty'](_0x2f2b('0x34'))){_0x7860c3[_0x2f2b('0x19')]=qs[_0x2f2b('0x19')](_0x1131be['query'][_0x2f2b('0x19')]);_0x7860c3[_0x2f2b('0x1b')]=qs[_0x2f2b('0x1b')](_0x1131be['query'][_0x2f2b('0x1b')]);}return _0x32a1f4['getDescriptions'](_0x7860c3);}})[_0x2f2b('0x21')](function(_0x2840c4){if(_0x2840c4){return _0x2840c4?{'count':_0x1dc286,'rows':_0x2840c4}:null;}})['then'](respondWithResult(_0x5b753b,null))['catch'](handleError(_0x5b753b,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index cfd239e..b415e15 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 _0xe083=['moment','bluebird','request-promise','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api'];(function(_0x293a83,_0x114af6){var _0x191559=function(_0x51b6f8){while(--_0x51b6f8){_0x293a83['push'](_0x293a83['shift']());}};_0x191559(++_0x114af6);}(_0xe083,0x64));var _0x3e08=function(_0x10c43a,_0x2a510e){_0x10c43a=_0x10c43a-0x0;var _0x55d396=_0xe083[_0x10c43a];return _0x55d396;};'use strict';var _=require(_0x3e08('0x0'));var util=require(_0x3e08('0x1'));var logger=require(_0x3e08('0x2'))(_0x3e08('0x3'));var moment=require(_0x3e08('0x4'));var BPromise=require(_0x3e08('0x5'));var rp=require(_0x3e08('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3e08('0x7'));var attributes=require(_0x3e08('0x8'));module[_0x3e08('0x9')]=function(_0x44581d,_0x4c29c3){return _0x44581d[_0x3e08('0xa')](_0x3e08('0xb'),attributes,{'tableName':_0x3e08('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4db=['path','rimraf','../../config/environment','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1933d6,_0x57d544){var _0x506fd2=function(_0xa67919){while(--_0xa67919){_0x1933d6['push'](_0x1933d6['shift']());}};_0x506fd2(++_0x57d544);}(_0xf4db,0x19e));var _0xbf4d=function(_0x1e8dd5,_0x571f6d){_0x1e8dd5=_0x1e8dd5-0x0;var _0x9aa844=_0xf4db[_0x1e8dd5];return _0x9aa844;};'use strict';var _=require(_0xbf4d('0x0'));var util=require(_0xbf4d('0x1'));var logger=require(_0xbf4d('0x2'))(_0xbf4d('0x3'));var moment=require(_0xbf4d('0x4'));var BPromise=require(_0xbf4d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf4d('0x6'));var rimraf=require(_0xbf4d('0x7'));var config=require(_0xbf4d('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xbf4d('0x9')]=function(_0x40689c,_0x400377){return _0x40689c['define'](_0xbf4d('0xa'),attributes,{'tableName':_0xbf4d('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 1ab0b8d..e9b223e 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 _0x454c=['debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x454c,0x6f));var _0xc454=function(_0x53afe9,_0x2c9f40){_0x53afe9=_0x53afe9-0x0;var _0x396396=_0x454c[_0x53afe9];return _0x396396;};'use strict';var _=require(_0xc454('0x0'));var util=require(_0xc454('0x1'));var moment=require(_0xc454('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc454('0x3'));var db=require(_0xc454('0x4'))['db'];var utils=require(_0xc454('0x5'));var logger=require('../../config/logger')(_0xc454('0x6'));var config=require('../../config/environment');var jayson=require(_0xc454('0x7'));var client=jayson[_0xc454('0x8')][_0xc454('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1563e2,_0x38853f,_0x202e7a){return new BPromise(function(_0x4f267e,_0x11950a){return client[_0xc454('0xa')](_0x1563e2,_0x202e7a)[_0xc454('0xb')](function(_0x3a6c88){logger[_0xc454('0xc')](_0xc454('0xd'),_0x38853f,_0xc454('0xe'));logger[_0xc454('0xf')](_0xc454('0x10'),_0x38853f,_0xc454('0xe'),JSON[_0xc454('0x11')](_0x3a6c88));if(_0x3a6c88[_0xc454('0x12')]){if(_0x3a6c88[_0xc454('0x12')]['code']===0x1f4){logger[_0xc454('0x12')](_0xc454('0xd'),_0x38853f,_0x3a6c88[_0xc454('0x12')][_0xc454('0x13')]);return _0x11950a(_0x3a6c88[_0xc454('0x12')]['message']);}logger['error'](_0xc454('0xd'),_0x38853f,_0x3a6c88[_0xc454('0x12')][_0xc454('0x13')]);return _0x4f267e(_0x3a6c88[_0xc454('0x12')][_0xc454('0x13')]);}else{logger[_0xc454('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x38853f,_0xc454('0xe'));_0x4f267e(_0x3a6c88['result'][_0xc454('0x13')]);}})[_0xc454('0x14')](function(_0xc0216){logger[_0xc454('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x38853f,_0xc0216);_0x11950a(_0xc0216);});});} \ No newline at end of file +var _0x4773=['SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x29ae80,_0x3579f1){var _0x5d6d71=function(_0xfaffe2){while(--_0xfaffe2){_0x29ae80['push'](_0x29ae80['shift']());}};_0x5d6d71(++_0x3579f1);}(_0x4773,0x195));var _0x3477=function(_0x2f46ee,_0x3105eb){_0x2f46ee=_0x2f46ee-0x0;var _0x42d6e5=_0x4773[_0x2f46ee];return _0x42d6e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3477('0x0'));var rs=require(_0x3477('0x1'));var fs=require('fs');var Redis=require(_0x3477('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3477('0x3'));var logger=require(_0x3477('0x4'))(_0x3477('0x5'));var config=require(_0x3477('0x6'));var jayson=require(_0x3477('0x7'));var client=jayson[_0x3477('0x8')][_0x3477('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43dc8f,_0x3e1f35,_0x234ccd){return new BPromise(function(_0x48fae7,_0x3e5968){return client[_0x3477('0xa')](_0x43dc8f,_0x234ccd)[_0x3477('0xb')](function(_0x5ca037){logger[_0x3477('0xc')](_0x3477('0xd'),_0x3e1f35,_0x3477('0xe'));logger[_0x3477('0xf')](_0x3477('0x10'),_0x3e1f35,_0x3477('0xe'),JSON[_0x3477('0x11')](_0x5ca037));if(_0x5ca037[_0x3477('0x12')]){if(_0x5ca037['error'][_0x3477('0x13')]===0x1f4){logger[_0x3477('0x12')](_0x3477('0xd'),_0x3e1f35,_0x5ca037[_0x3477('0x12')][_0x3477('0x14')]);return _0x3e5968(_0x5ca037[_0x3477('0x12')]['message']);}logger[_0x3477('0x12')](_0x3477('0xd'),_0x3e1f35,_0x5ca037[_0x3477('0x12')][_0x3477('0x14')]);return _0x48fae7(_0x5ca037[_0x3477('0x12')][_0x3477('0x14')]);}else{logger[_0x3477('0xc')](_0x3477('0xd'),_0x3e1f35,_0x3477('0xe'));_0x48fae7(_0x5ca037[_0x3477('0x15')]['message']);}})['catch'](function(_0x108cb6){logger[_0x3477('0x12')](_0x3477('0xd'),_0x3e1f35,_0x108cb6);_0x3e5968(_0x108cb6);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index e423ecc..b8fb79c 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 _0x8221=['Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x4a9e2a,_0x46815c){var _0x5ff162=function(_0x412c7b){while(--_0x412c7b){_0x4a9e2a['push'](_0x4a9e2a['shift']());}};_0x5ff162(++_0x46815c);}(_0x8221,0x1f4));var _0x1822=function(_0x20cb20,_0x256051){_0x20cb20=_0x20cb20-0x0;var _0x2fcf4b=_0x8221[_0x20cb20];return _0x2fcf4b;};'use strict';var multer=require('multer');var util=require(_0x1822('0x0'));var path=require(_0x1822('0x1'));var timeout=require(_0x1822('0x2'));var express=require(_0x1822('0x3'));var router=express[_0x1822('0x4')]();var fs_extra=require(_0x1822('0x5'));var auth=require(_0x1822('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1822('0x7'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1822('0x8')](_0x1822('0x9'),auth[_0x1822('0xa')](),controller['show']);router[_0x1822('0xb')]('/',auth[_0x1822('0xa')](),controller[_0x1822('0xc')]);router[_0x1822('0xd')](_0x1822('0x9'),auth['isAuthenticated'](),controller[_0x1822('0xe')]);router[_0x1822('0xf')](_0x1822('0x9'),auth[_0x1822('0xa')](),controller[_0x1822('0x10')]);module[_0x1822('0x11')]=router; \ No newline at end of file +var _0x8f63=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','path','connect-timeout'];(function(_0x56c197,_0x35ba1d){var _0x2689ef=function(_0x2d050f){while(--_0x2d050f){_0x56c197['push'](_0x56c197['shift']());}};_0x2689ef(++_0x35ba1d);}(_0x8f63,0x11b));var _0x38f6=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0x8f63[_0x34bc6c];return _0x168820;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x38f6('0x0'));var timeout=require(_0x38f6('0x1'));var express=require(_0x38f6('0x2'));var router=express[_0x38f6('0x3')]();var fs_extra=require(_0x38f6('0x4'));var auth=require(_0x38f6('0x5'));var interaction=require(_0x38f6('0x6'));var config=require('../../config/environment');var controller=require(_0x38f6('0x7'));router[_0x38f6('0x8')]('/',auth['isAuthenticated'](),controller[_0x38f6('0x9')]);router[_0x38f6('0x8')](_0x38f6('0xa'),auth[_0x38f6('0xb')](),controller[_0x38f6('0xc')]);router[_0x38f6('0xd')]('/',auth[_0x38f6('0xb')](),controller['create']);router[_0x38f6('0xe')](_0x38f6('0xa'),auth[_0x38f6('0xb')](),controller[_0x38f6('0xf')]);router[_0x38f6('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x38f6('0x11')]);module[_0x38f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 82148ee..16a2237 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 _0xece5=['variable','customVariable','sequelize','exports','string','picklist','STRING'];(function(_0x6c1937,_0x2d0ead){var _0x2d8804=function(_0x24f0b1){while(--_0x24f0b1){_0x6c1937['push'](_0x6c1937['shift']());}};_0x2d8804(++_0x2d0ead);}(_0xece5,0x12f));var _0x5ece=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xece5[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require(_0x5ece('0x0'));module[_0x5ece('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5ece('0x2'),'variable','customVariable','keyValue',_0x5ece('0x3')),'defaultValue':_0x5ece('0x2')},'content':{'type':Sequelize[_0x5ece('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x5ece('0x2'),_0x5ece('0x5'),_0x5ece('0x6'))},'keyContent':{'type':Sequelize[_0x5ece('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5ece('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5ece('0x4')]}}; \ No newline at end of file +var _0xbd0c=['customVariable','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x1caaca,_0x34ee5c){var _0x122e21=function(_0xcfa449){while(--_0xcfa449){_0x1caaca['push'](_0x1caaca['shift']());}};_0x122e21(++_0x34ee5c);}(_0xbd0c,0x1e4));var _0xcbd0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbd0c[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xcbd0('0x0'));module[_0xcbd0('0x1')]={'type':{'type':Sequelize[_0xcbd0('0x2')](_0xcbd0('0x3'),'variable',_0xcbd0('0x4'),'keyValue','picklist'),'defaultValue':_0xcbd0('0x3')},'content':{'type':Sequelize[_0xcbd0('0x5')]},'key':{'type':Sequelize[_0xcbd0('0x5')]},'keyType':{'type':Sequelize[_0xcbd0('0x2')](_0xcbd0('0x3'),_0xcbd0('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xcbd0('0x5')]},'idField':{'type':Sequelize[_0xcbd0('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xcbd0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcbd0('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index c3c9b55..5f23500 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 _0x20d4=['hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','include','catch','show','params','rawAttributes','includeAll','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','map','SugarcrmField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x83422d,_0x5500d7){var _0x6313c=function(_0x36d3ac){while(--_0x36d3ac){_0x83422d['push'](_0x83422d['shift']());}};_0x6313c(++_0x5500d7);}(_0x20d4,0x1e1));var _0x420d=function(_0x4786da,_0x2468aa){_0x4786da=_0x4786da-0x0;var _0x4f25ae=_0x20d4[_0x4786da];return _0x4f25ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x420d('0x0'));var zipdir=require(_0x420d('0x1'));var jsonpatch=require(_0x420d('0x2'));var rp=require(_0x420d('0x3'));var moment=require(_0x420d('0x4'));var BPromise=require(_0x420d('0x5'));var Mustache=require(_0x420d('0x6'));var util=require(_0x420d('0x7'));var path=require(_0x420d('0x8'));var sox=require(_0x420d('0x9'));var csv=require(_0x420d('0xa'));var ejs=require(_0x420d('0xb'));var fs=require('fs');var fs_extra=require(_0x420d('0xc'));var _=require(_0x420d('0xd'));var squel=require('squel');var crypto=require(_0x420d('0xe'));var jsforce=require(_0x420d('0xf'));var deskjs=require(_0x420d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x420d('0x11'));var Redis=require('ioredis');var authService=require(_0x420d('0x12'));var qs=require(_0x420d('0x13'));var as=require(_0x420d('0x14'));var hardwareService=require(_0x420d('0x15'));var logger=require('../../config/logger')(_0x420d('0x16'));var utils=require(_0x420d('0x17'));var config=require(_0x420d('0x18'));var licenseUtil=require(_0x420d('0x19'));var db=require(_0x420d('0x1a'))['db'];function respondWithStatusCode(_0x298fda,_0x3618a2){_0x3618a2=_0x3618a2||0xcc;return function(_0x221fcc){if(_0x221fcc){return _0x298fda[_0x420d('0x1b')](_0x3618a2);}return _0x298fda['status'](_0x3618a2)[_0x420d('0x1c')]();};}function respondWithResult(_0x17bbf2,_0x173b81){_0x173b81=_0x173b81||0xc8;return function(_0x4ef400){if(_0x4ef400){return _0x17bbf2[_0x420d('0x1d')](_0x173b81)['json'](_0x4ef400);}};}function respondWithFilteredResult(_0x4944d4,_0x436471){return function(_0x4b6806){if(_0x4b6806){var _0x49e530=typeof _0x436471[_0x420d('0x1e')]===_0x420d('0x1f')&&typeof _0x436471[_0x420d('0x20')]===_0x420d('0x1f');var _0x557cf5=_0x4b6806[_0x420d('0x21')];var _0x5644bb=_0x49e530?0x0:_0x436471['offset'];var _0x84392b=_0x49e530?_0x4b6806[_0x420d('0x21')]:_0x436471[_0x420d('0x1e')]+_0x436471[_0x420d('0x20')];var _0x1a8daa;if(_0x84392b>=_0x557cf5){_0x84392b=_0x557cf5;_0x1a8daa=0xc8;}else{_0x1a8daa=0xce;}_0x4944d4[_0x420d('0x1d')](_0x1a8daa);return _0x4944d4[_0x420d('0x22')](_0x420d('0x23'),_0x5644bb+'-'+_0x84392b+'/'+_0x557cf5)[_0x420d('0x24')](_0x4b6806);}return null;};}function patchUpdates(_0x377215){return function(_0x7f6b2c){try{jsonpatch[_0x420d('0x25')](_0x7f6b2c,_0x377215,!![]);}catch(_0x3d5813){return BPromise['reject'](_0x3d5813);}return _0x7f6b2c[_0x420d('0x26')]();};}function saveUpdates(_0x338cc7,_0x247e3d){return function(_0x106c86){if(_0x106c86){return _0x106c86[_0x420d('0x27')](_0x338cc7)[_0x420d('0x28')](function(_0x1cfe7e){return _0x1cfe7e;});}return null;};}function removeEntity(_0x35ce48,_0x390157){return function(_0x2fad7e){if(_0x2fad7e){return _0x2fad7e[_0x420d('0x29')]()[_0x420d('0x28')](function(){_0x35ce48[_0x420d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a719,_0x5563af){return function(_0x5db1ba){if(!_0x5db1ba){_0x47a719['sendStatus'](0x194);}return _0x5db1ba;};}function handleError(_0x219a3e,_0x61c250){_0x61c250=_0x61c250||0x1f4;return function(_0x4fb421){logger[_0x420d('0x2a')](_0x4fb421[_0x420d('0x2b')]);if(_0x4fb421[_0x420d('0x2c')]){delete _0x4fb421[_0x420d('0x2c')];}_0x219a3e['status'](_0x61c250)['send'](_0x4fb421);};}exports['index']=function(_0x33a14b,_0x1a6e1f){var _0x4b48f9={},_0x519ff7={},_0x5e129b={'count':0x0,'rows':[]};var _0x5e6a5d=_[_0x420d('0x2d')](db[_0x420d('0x2e')]['rawAttributes'],function(_0x47dd35){return{'name':_0x47dd35[_0x420d('0x2f')],'type':_0x47dd35[_0x420d('0x30')][_0x420d('0x31')]};});_0x519ff7[_0x420d('0x32')]=_[_0x420d('0x2d')](_0x5e6a5d,_0x420d('0x2c'));_0x519ff7[_0x420d('0x33')]=_[_0x420d('0x34')](_0x33a14b[_0x420d('0x33')]);_0x519ff7[_0x420d('0x35')]=_[_0x420d('0x36')](_0x519ff7[_0x420d('0x32')],_0x519ff7[_0x420d('0x33')]);_0x4b48f9[_0x420d('0x37')]=_[_0x420d('0x36')](_0x519ff7[_0x420d('0x32')],qs[_0x420d('0x38')](_0x33a14b['query'][_0x420d('0x38')]));_0x4b48f9[_0x420d('0x37')]=_0x4b48f9[_0x420d('0x37')][_0x420d('0x39')]?_0x4b48f9[_0x420d('0x37')]:_0x519ff7[_0x420d('0x32')];if(!_0x33a14b[_0x420d('0x33')][_0x420d('0x3a')](_0x420d('0x3b'))){_0x4b48f9['limit']=qs['limit'](_0x33a14b[_0x420d('0x33')][_0x420d('0x20')]);_0x4b48f9[_0x420d('0x1e')]=qs[_0x420d('0x1e')](_0x33a14b[_0x420d('0x33')][_0x420d('0x1e')]);}_0x4b48f9[_0x420d('0x3c')]=qs[_0x420d('0x3d')](_0x33a14b['query'][_0x420d('0x3d')]);_0x4b48f9[_0x420d('0x3e')]=qs[_0x420d('0x35')](_[_0x420d('0x3f')](_0x33a14b[_0x420d('0x33')],_0x519ff7[_0x420d('0x35')]),_0x5e6a5d);if(_0x33a14b[_0x420d('0x33')]['filter']){_0x4b48f9[_0x420d('0x3e')]=_['merge'](_0x4b48f9['where'],{'$or':_[_0x420d('0x2d')](_0x5e6a5d,function(_0x1c8b39){if(_0x1c8b39[_0x420d('0x30')]!==_0x420d('0x40')){var _0xe60cb9={};_0xe60cb9[_0x1c8b39[_0x420d('0x2c')]]={'$like':'%'+_0x33a14b[_0x420d('0x33')][_0x420d('0x41')]+'%'};return _0xe60cb9;}})});}_0x4b48f9=_[_0x420d('0x42')]({},_0x4b48f9,_0x33a14b[_0x420d('0x43')]);var _0x51fdce={'where':_0x4b48f9[_0x420d('0x3e')]};return db['SugarcrmField']['count'](_0x51fdce)['then'](function(_0x4adc7f){_0x5e129b[_0x420d('0x21')]=_0x4adc7f;if(_0x33a14b[_0x420d('0x33')]['includeAll']){_0x4b48f9[_0x420d('0x44')]=[{'all':!![]}];}return db[_0x420d('0x2e')]['findAll'](_0x4b48f9);})[_0x420d('0x28')](function(_0x42bd82){_0x5e129b['rows']=_0x42bd82;return _0x5e129b;})[_0x420d('0x28')](respondWithFilteredResult(_0x1a6e1f,_0x4b48f9))[_0x420d('0x45')](handleError(_0x1a6e1f,null));};exports[_0x420d('0x46')]=function(_0x872f39,_0x2a487d){var _0x227149={'raw':!![],'where':{'id':_0x872f39[_0x420d('0x47')]['id']}},_0x422c80={};_0x422c80[_0x420d('0x32')]=_[_0x420d('0x34')](db[_0x420d('0x2e')][_0x420d('0x48')]);_0x422c80[_0x420d('0x33')]=_[_0x420d('0x34')](_0x872f39['query']);_0x422c80[_0x420d('0x35')]=_[_0x420d('0x36')](_0x422c80[_0x420d('0x32')],_0x422c80[_0x420d('0x33')]);_0x227149[_0x420d('0x37')]=_['intersection'](_0x422c80[_0x420d('0x32')],qs[_0x420d('0x38')](_0x872f39[_0x420d('0x33')][_0x420d('0x38')]));_0x227149['attributes']=_0x227149[_0x420d('0x37')][_0x420d('0x39')]?_0x227149[_0x420d('0x37')]:_0x422c80[_0x420d('0x32')];if(_0x872f39[_0x420d('0x33')][_0x420d('0x49')]){_0x227149[_0x420d('0x44')]=[{'all':!![]}];}_0x227149=_[_0x420d('0x42')]({},_0x227149,_0x872f39['options']);return db[_0x420d('0x2e')]['find'](_0x227149)[_0x420d('0x28')](handleEntityNotFound(_0x2a487d,null))[_0x420d('0x28')](respondWithResult(_0x2a487d,null))['catch'](handleError(_0x2a487d,null));};exports[_0x420d('0x4a')]=function(_0x18f8c3,_0x3ea939){return db['SugarcrmField']['create'](_0x18f8c3[_0x420d('0x4b')],{})[_0x420d('0x28')](respondWithResult(_0x3ea939,0xc9))['catch'](handleError(_0x3ea939,null));};exports[_0x420d('0x27')]=function(_0x3b0217,_0x245fae){if(_0x3b0217[_0x420d('0x4b')]['id']){delete _0x3b0217[_0x420d('0x4b')]['id'];}return db['SugarcrmField'][_0x420d('0x4c')]({'where':{'id':_0x3b0217[_0x420d('0x47')]['id']}})[_0x420d('0x28')](handleEntityNotFound(_0x245fae,null))[_0x420d('0x28')](saveUpdates(_0x3b0217[_0x420d('0x4b')],null))[_0x420d('0x28')](respondWithResult(_0x245fae,null))[_0x420d('0x45')](handleError(_0x245fae,null));};exports[_0x420d('0x29')]=function(_0x4d8fca,_0x14a4f1){return db[_0x420d('0x2e')][_0x420d('0x4c')]({'where':{'id':_0x4d8fca['params']['id']}})[_0x420d('0x28')](handleEntityNotFound(_0x14a4f1,null))['then'](removeEntity(_0x14a4f1,null))[_0x420d('0x45')](handleError(_0x14a4f1,null));}; \ No newline at end of file +var _0xb7cb=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','save','update','then','destroy','error','name','send','SugarcrmField','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','length','find','body','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x47f7da,_0x4f3ff8){var _0x9fd378=function(_0x502f74){while(--_0x502f74){_0x47f7da['push'](_0x47f7da['shift']());}};_0x9fd378(++_0x4f3ff8);}(_0xb7cb,0x101));var _0xbb7c=function(_0x196f40,_0x417e6e){_0x196f40=_0x196f40-0x0;var _0x544d7b=_0xb7cb[_0x196f40];return _0x544d7b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb7c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb7c('0x1'));var rp=require(_0xbb7c('0x2'));var moment=require('moment');var BPromise=require(_0xbb7c('0x3'));var Mustache=require('mustache');var util=require(_0xbb7c('0x4'));var path=require(_0xbb7c('0x5'));var sox=require(_0xbb7c('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb7c('0x7'));var _=require(_0xbb7c('0x8'));var squel=require('squel');var crypto=require(_0xbb7c('0x9'));var jsforce=require(_0xbb7c('0xa'));var deskjs=require(_0xbb7c('0xb'));var toCsv=require(_0xbb7c('0xc'));var querystring=require(_0xbb7c('0xd'));var Papa=require(_0xbb7c('0xe'));var Redis=require(_0xbb7c('0xf'));var authService=require(_0xbb7c('0x10'));var qs=require(_0xbb7c('0x11'));var as=require(_0xbb7c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb7c('0x13'))('api');var utils=require(_0xbb7c('0x14'));var config=require(_0xbb7c('0x15'));var licenseUtil=require(_0xbb7c('0x16'));var db=require(_0xbb7c('0x17'))['db'];function respondWithStatusCode(_0xf16a8e,_0x518988){_0x518988=_0x518988||0xcc;return function(_0x46ec4e){if(_0x46ec4e){return _0xf16a8e[_0xbb7c('0x18')](_0x518988);}return _0xf16a8e[_0xbb7c('0x19')](_0x518988)[_0xbb7c('0x1a')]();};}function respondWithResult(_0xef654a,_0x5bcb27){_0x5bcb27=_0x5bcb27||0xc8;return function(_0x971ac9){if(_0x971ac9){return _0xef654a[_0xbb7c('0x19')](_0x5bcb27)[_0xbb7c('0x1b')](_0x971ac9);}};}function respondWithFilteredResult(_0x41b81f,_0x4f96b1){return function(_0x2303a1){if(_0x2303a1){var _0x34bdaa=typeof _0x4f96b1[_0xbb7c('0x1c')]===_0xbb7c('0x1d')&&typeof _0x4f96b1[_0xbb7c('0x1e')]===_0xbb7c('0x1d');var _0x28d4a3=_0x2303a1[_0xbb7c('0x1f')];var _0x40259e=_0x34bdaa?0x0:_0x4f96b1[_0xbb7c('0x1c')];var _0x1fc44f=_0x34bdaa?_0x2303a1[_0xbb7c('0x1f')]:_0x4f96b1[_0xbb7c('0x1c')]+_0x4f96b1[_0xbb7c('0x1e')];var _0x584497;if(_0x1fc44f>=_0x28d4a3){_0x1fc44f=_0x28d4a3;_0x584497=0xc8;}else{_0x584497=0xce;}_0x41b81f[_0xbb7c('0x19')](_0x584497);return _0x41b81f['set']('Content-Range',_0x40259e+'-'+_0x1fc44f+'/'+_0x28d4a3)[_0xbb7c('0x1b')](_0x2303a1);}return null;};}function patchUpdates(_0x243016){return function(_0x50c831){try{jsonpatch['apply'](_0x50c831,_0x243016,!![]);}catch(_0x34b174){return BPromise['reject'](_0x34b174);}return _0x50c831[_0xbb7c('0x20')]();};}function saveUpdates(_0x498c42,_0x3500d9){return function(_0x4d4f88){if(_0x4d4f88){return _0x4d4f88[_0xbb7c('0x21')](_0x498c42)[_0xbb7c('0x22')](function(_0x4a93a7){return _0x4a93a7;});}return null;};}function removeEntity(_0x3a3fb5,_0x1e0de1){return function(_0x164e8f){if(_0x164e8f){return _0x164e8f[_0xbb7c('0x23')]()[_0xbb7c('0x22')](function(){_0x3a3fb5[_0xbb7c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15a403,_0x2a40f3){return function(_0x25b34a){if(!_0x25b34a){_0x15a403[_0xbb7c('0x18')](0x194);}return _0x25b34a;};}function handleError(_0x1cdc37,_0x3b5908){_0x3b5908=_0x3b5908||0x1f4;return function(_0xbb289b){logger[_0xbb7c('0x24')](_0xbb289b['stack']);if(_0xbb289b[_0xbb7c('0x25')]){delete _0xbb289b[_0xbb7c('0x25')];}_0x1cdc37[_0xbb7c('0x19')](_0x3b5908)[_0xbb7c('0x26')](_0xbb289b);};}exports['index']=function(_0x1cc0ed,_0x4dda47){var _0x480cb7={},_0x4edd80={},_0x5d90bb={'count':0x0,'rows':[]};var _0x2a3ad1=_['map'](db[_0xbb7c('0x27')]['rawAttributes'],function(_0x50f81e){return{'name':_0x50f81e[_0xbb7c('0x28')],'type':_0x50f81e[_0xbb7c('0x29')][_0xbb7c('0x2a')]};});_0x4edd80[_0xbb7c('0x2b')]=_[_0xbb7c('0x2c')](_0x2a3ad1,_0xbb7c('0x25'));_0x4edd80[_0xbb7c('0x2d')]=_[_0xbb7c('0x2e')](_0x1cc0ed[_0xbb7c('0x2d')]);_0x4edd80[_0xbb7c('0x2f')]=_[_0xbb7c('0x30')](_0x4edd80[_0xbb7c('0x2b')],_0x4edd80['query']);_0x480cb7[_0xbb7c('0x31')]=_['intersection'](_0x4edd80['model'],qs[_0xbb7c('0x32')](_0x1cc0ed['query'][_0xbb7c('0x32')]));_0x480cb7['attributes']=_0x480cb7[_0xbb7c('0x31')]['length']?_0x480cb7[_0xbb7c('0x31')]:_0x4edd80[_0xbb7c('0x2b')];if(!_0x1cc0ed[_0xbb7c('0x2d')][_0xbb7c('0x33')](_0xbb7c('0x34'))){_0x480cb7['limit']=qs[_0xbb7c('0x1e')](_0x1cc0ed[_0xbb7c('0x2d')][_0xbb7c('0x1e')]);_0x480cb7[_0xbb7c('0x1c')]=qs['offset'](_0x1cc0ed[_0xbb7c('0x2d')]['offset']);}_0x480cb7[_0xbb7c('0x35')]=qs['sort'](_0x1cc0ed[_0xbb7c('0x2d')][_0xbb7c('0x36')]);_0x480cb7[_0xbb7c('0x37')]=qs[_0xbb7c('0x2f')](_[_0xbb7c('0x38')](_0x1cc0ed[_0xbb7c('0x2d')],_0x4edd80[_0xbb7c('0x2f')]),_0x2a3ad1);if(_0x1cc0ed['query'][_0xbb7c('0x39')]){_0x480cb7[_0xbb7c('0x37')]=_['merge'](_0x480cb7[_0xbb7c('0x37')],{'$or':_['map'](_0x2a3ad1,function(_0x58a4da){if(_0x58a4da['type']!=='VIRTUAL'){var _0x322998={};_0x322998[_0x58a4da[_0xbb7c('0x25')]]={'$like':'%'+_0x1cc0ed[_0xbb7c('0x2d')][_0xbb7c('0x39')]+'%'};return _0x322998;}})});}_0x480cb7=_[_0xbb7c('0x3a')]({},_0x480cb7,_0x1cc0ed[_0xbb7c('0x3b')]);var _0x12567d={'where':_0x480cb7[_0xbb7c('0x37')]};return db[_0xbb7c('0x27')][_0xbb7c('0x1f')](_0x12567d)[_0xbb7c('0x22')](function(_0x542d84){_0x5d90bb[_0xbb7c('0x1f')]=_0x542d84;if(_0x1cc0ed[_0xbb7c('0x2d')][_0xbb7c('0x3c')]){_0x480cb7[_0xbb7c('0x3d')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x480cb7);})[_0xbb7c('0x22')](function(_0x572a8d){_0x5d90bb[_0xbb7c('0x3e')]=_0x572a8d;return _0x5d90bb;})[_0xbb7c('0x22')](respondWithFilteredResult(_0x4dda47,_0x480cb7))[_0xbb7c('0x3f')](handleError(_0x4dda47,null));};exports[_0xbb7c('0x40')]=function(_0x4fce8a,_0x469978){var _0x30a173={'raw':!![],'where':{'id':_0x4fce8a[_0xbb7c('0x41')]['id']}},_0x1300ca={};_0x1300ca[_0xbb7c('0x2b')]=_[_0xbb7c('0x2e')](db[_0xbb7c('0x27')]['rawAttributes']);_0x1300ca[_0xbb7c('0x2d')]=_['keys'](_0x4fce8a[_0xbb7c('0x2d')]);_0x1300ca['filters']=_['intersection'](_0x1300ca['model'],_0x1300ca[_0xbb7c('0x2d')]);_0x30a173[_0xbb7c('0x31')]=_['intersection'](_0x1300ca['model'],qs['fields'](_0x4fce8a[_0xbb7c('0x2d')]['fields']));_0x30a173[_0xbb7c('0x31')]=_0x30a173[_0xbb7c('0x31')][_0xbb7c('0x42')]?_0x30a173[_0xbb7c('0x31')]:_0x1300ca[_0xbb7c('0x2b')];if(_0x4fce8a[_0xbb7c('0x2d')][_0xbb7c('0x3c')]){_0x30a173[_0xbb7c('0x3d')]=[{'all':!![]}];}_0x30a173=_['merge']({},_0x30a173,_0x4fce8a[_0xbb7c('0x3b')]);return db['SugarcrmField'][_0xbb7c('0x43')](_0x30a173)[_0xbb7c('0x22')](handleEntityNotFound(_0x469978,null))[_0xbb7c('0x22')](respondWithResult(_0x469978,null))[_0xbb7c('0x3f')](handleError(_0x469978,null));};exports['create']=function(_0x1a1cce,_0x5a5d3a){return db[_0xbb7c('0x27')]['create'](_0x1a1cce[_0xbb7c('0x44')],{})[_0xbb7c('0x22')](respondWithResult(_0x5a5d3a,0xc9))[_0xbb7c('0x3f')](handleError(_0x5a5d3a,null));};exports[_0xbb7c('0x21')]=function(_0x22f6dc,_0x2f699d){if(_0x22f6dc[_0xbb7c('0x44')]['id']){delete _0x22f6dc[_0xbb7c('0x44')]['id'];}return db[_0xbb7c('0x27')]['find']({'where':{'id':_0x22f6dc[_0xbb7c('0x41')]['id']}})[_0xbb7c('0x22')](handleEntityNotFound(_0x2f699d,null))[_0xbb7c('0x22')](saveUpdates(_0x22f6dc[_0xbb7c('0x44')],null))[_0xbb7c('0x22')](respondWithResult(_0x2f699d,null))['catch'](handleError(_0x2f699d,null));};exports[_0xbb7c('0x23')]=function(_0x2e02bb,_0x1b9d7c){return db[_0xbb7c('0x27')][_0xbb7c('0x43')]({'where':{'id':_0x2e02bb[_0xbb7c('0x41')]['id']}})[_0xbb7c('0x22')](handleEntityNotFound(_0x1b9d7c,null))[_0xbb7c('0x22')](removeEntity(_0x1b9d7c,null))[_0xbb7c('0x3f')](handleError(_0x1b9d7c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 1002ced..3936bec 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 _0xd50c=['rimraf','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','lodash','util','api','moment','path'];(function(_0x2406f2,_0x2fe1e2){var _0x2f5eb6=function(_0x4737e0){while(--_0x4737e0){_0x2406f2['push'](_0x2406f2['shift']());}};_0x2f5eb6(++_0x2fe1e2);}(_0xd50c,0x7f));var _0xcd50=function(_0x53dc41,_0x4a8c49){_0x53dc41=_0x53dc41-0x0;var _0x1c70c6=_0xd50c[_0x53dc41];return _0x1c70c6;};'use strict';var _=require(_0xcd50('0x0'));var util=require(_0xcd50('0x1'));var logger=require('../../config/logger')(_0xcd50('0x2'));var moment=require(_0xcd50('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd50('0x4'));var rimraf=require(_0xcd50('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module[_0xcd50('0x6')]=function(_0x5cf18d,_0x387be1){return _0x5cf18d[_0xcd50('0x7')](_0xcd50('0x8'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xcd50('0x9'),'fields':[_0xcd50('0xa'),_0xcd50('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f6c=['idField','FieldId','lodash','util','bluebird','request-promise','rimraf','./intSugarcrmField.attributes','SugarcrmField','sugarcrm_unique_index'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x8f6c,0x1a6));var _0xc8f6=function(_0x2aa54d,_0x1ce1c7){_0x2aa54d=_0x2aa54d-0x0;var _0x492951=_0x8f6c[_0x2aa54d];return _0x492951;};'use strict';var _=require(_0xc8f6('0x0'));var util=require(_0xc8f6('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc8f6('0x2'));var rp=require(_0xc8f6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8f6('0x4'));var config=require('../../config/environment');var attributes=require(_0xc8f6('0x5'));module['exports']=function(_0x29ab92,_0x16074e){return _0x29ab92['define'](_0xc8f6('0x6'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xc8f6('0x7'),'fields':[_0xc8f6('0x8'),_0xc8f6('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 8b1156c..b474bb0 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 _0x440d=['request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','SugarcrmField,\x20%s,\x20%s'];(function(_0x9a51b3,_0x34ac18){var _0x4ca7b1=function(_0x455c6d){while(--_0x455c6d){_0x9a51b3['push'](_0x9a51b3['shift']());}};_0x4ca7b1(++_0x34ac18);}(_0x440d,0x111));var _0xd440=function(_0x2627c5,_0x3a0394){_0x2627c5=_0x2627c5-0x0;var _0x4f11fd=_0x440d[_0x2627c5];return _0x4f11fd;};'use strict';var _=require(_0xd440('0x0'));var util=require('util');var moment=require(_0xd440('0x1'));var BPromise=require(_0xd440('0x2'));var rs=require(_0xd440('0x3'));var fs=require('fs');var Redis=require(_0xd440('0x4'));var db=require(_0xd440('0x5'))['db'];var utils=require(_0xd440('0x6'));var logger=require(_0xd440('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd440('0x8'));var client=jayson[_0xd440('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7df9d9,_0x3e9c48,_0x4b58ed){return new BPromise(function(_0xe3c180,_0x2f4f40){return client[_0xd440('0xa')](_0x7df9d9,_0x4b58ed)['then'](function(_0x4a8756){logger[_0xd440('0xb')](_0xd440('0xc'),_0x3e9c48,_0xd440('0xd'));logger[_0xd440('0xe')](_0xd440('0xf'),_0x3e9c48,_0xd440('0xd'),JSON[_0xd440('0x10')](_0x4a8756));if(_0x4a8756[_0xd440('0x11')]){if(_0x4a8756[_0xd440('0x11')][_0xd440('0x12')]===0x1f4){logger['error'](_0xd440('0xc'),_0x3e9c48,_0x4a8756[_0xd440('0x11')][_0xd440('0x13')]);return _0x2f4f40(_0x4a8756[_0xd440('0x11')][_0xd440('0x13')]);}logger[_0xd440('0x11')](_0xd440('0xc'),_0x3e9c48,_0x4a8756[_0xd440('0x11')]['message']);return _0xe3c180(_0x4a8756['error'][_0xd440('0x13')]);}else{logger[_0xd440('0xb')](_0xd440('0xc'),_0x3e9c48,'request\x20sent');_0xe3c180(_0x4a8756[_0xd440('0x14')][_0xd440('0x13')]);}})[_0xd440('0x15')](function(_0x5b55b0){logger[_0xd440('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x3e9c48,_0x5b55b0);_0x2f4f40(_0x5b55b0);});});} \ No newline at end of file +var _0x625c=['info','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xa43518,_0x2a4c6b){var _0x5e9b94=function(_0x3d3c7f){while(--_0x3d3c7f){_0xa43518['push'](_0xa43518['shift']());}};_0x5e9b94(++_0x2a4c6b);}(_0x625c,0x142));var _0xc625=function(_0x58bc74,_0x53dc35){_0x58bc74=_0x58bc74-0x0;var _0x34626b=_0x625c[_0x58bc74];return _0x34626b;};'use strict';var _=require('lodash');var util=require(_0xc625('0x0'));var moment=require(_0xc625('0x1'));var BPromise=require(_0xc625('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc625('0x3'));var db=require(_0xc625('0x4'))['db'];var utils=require(_0xc625('0x5'));var logger=require(_0xc625('0x6'))(_0xc625('0x7'));var config=require('../../config/environment');var jayson=require(_0xc625('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a40e9,_0x3df4df,_0x42c063){return new BPromise(function(_0x38ac10,_0x5a9245){return client[_0xc625('0x9')](_0x5a40e9,_0x42c063)['then'](function(_0x3aef6f){logger['info'](_0xc625('0xa'),_0x3df4df,_0xc625('0xb'));logger[_0xc625('0xc')](_0xc625('0xd'),_0x3df4df,_0xc625('0xb'),JSON[_0xc625('0xe')](_0x3aef6f));if(_0x3aef6f[_0xc625('0xf')]){if(_0x3aef6f[_0xc625('0xf')][_0xc625('0x10')]===0x1f4){logger[_0xc625('0xf')](_0xc625('0xa'),_0x3df4df,_0x3aef6f[_0xc625('0xf')][_0xc625('0x11')]);return _0x5a9245(_0x3aef6f[_0xc625('0xf')][_0xc625('0x11')]);}logger[_0xc625('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x3df4df,_0x3aef6f[_0xc625('0xf')][_0xc625('0x11')]);return _0x38ac10(_0x3aef6f[_0xc625('0xf')]['message']);}else{logger[_0xc625('0x12')](_0xc625('0xa'),_0x3df4df,_0xc625('0xb'));_0x38ac10(_0x3aef6f['result']['message']);}})[_0xc625('0x13')](function(_0x4367c2){logger[_0xc625('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x3df4df,_0x4367c2);_0x5a9245(_0x4367c2);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 9008d47..6e235f5 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 _0x5636=['post','addConfiguration','put','update','delete','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields'];(function(_0x1f504c,_0x319b4f){var _0x50d2e6=function(_0x47f98d){while(--_0x47f98d){_0x1f504c['push'](_0x1f504c['shift']());}};_0x50d2e6(++_0x319b4f);}(_0x5636,0x102));var _0x6563=function(_0x452ebd,_0x1cfc8c){_0x452ebd=_0x452ebd-0x0;var _0x52f25d=_0x5636[_0x452ebd];return _0x52f25d;};'use strict';var multer=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6563('0x2')]();var fs_extra=require(_0x6563('0x3'));var auth=require(_0x6563('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6563('0x5'));var controller=require(_0x6563('0x6'));router[_0x6563('0x7')]('/',auth[_0x6563('0x8')](),controller[_0x6563('0x9')]);router[_0x6563('0x7')](_0x6563('0xa'),auth[_0x6563('0x8')](),controller[_0x6563('0xb')]);router[_0x6563('0x7')](_0x6563('0xc'),auth[_0x6563('0x8')](),controller[_0x6563('0xd')]);router['get']('/:id/fields',auth[_0x6563('0x8')](),controller[_0x6563('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6563('0xf')](_0x6563('0xc'),auth[_0x6563('0x8')](),controller[_0x6563('0x10')]);router[_0x6563('0x11')](_0x6563('0xa'),auth[_0x6563('0x8')](),controller[_0x6563('0x12')]);router[_0x6563('0x13')]('/:id',auth[_0x6563('0x8')](),controller['destroy']);module[_0x6563('0x14')]=router; \ No newline at end of file +var _0x57ae=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x57ae,0xb4));var _0xe57a=function(_0x4482d7,_0x17e24d){_0x4482d7=_0x4482d7-0x0;var _0xebb2a6=_0x57ae[_0x4482d7];return _0xebb2a6;};'use strict';var multer=require('multer');var util=require(_0xe57a('0x0'));var path=require(_0xe57a('0x1'));var timeout=require(_0xe57a('0x2'));var express=require(_0xe57a('0x3'));var router=express[_0xe57a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe57a('0x5'));var interaction=require(_0xe57a('0x6'));var config=require(_0xe57a('0x7'));var controller=require(_0xe57a('0x8'));router['get']('/',auth[_0xe57a('0x9')](),controller[_0xe57a('0xa')]);router['get']('/:id',auth[_0xe57a('0x9')](),controller[_0xe57a('0xb')]);router[_0xe57a('0xc')](_0xe57a('0xd'),auth[_0xe57a('0x9')](),controller[_0xe57a('0xe')]);router['get'](_0xe57a('0xf'),auth[_0xe57a('0x9')](),controller[_0xe57a('0x10')]);router[_0xe57a('0x11')]('/',auth[_0xe57a('0x9')](),controller['create']);router[_0xe57a('0x11')](_0xe57a('0xd'),auth[_0xe57a('0x9')](),controller[_0xe57a('0x12')]);router[_0xe57a('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xe57a('0x14')]);router[_0xe57a('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xe57a('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 6c079ff..c1f7823 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 _0xa70f=['STRING','HelpDesk','sequelize','exports'];(function(_0x229764,_0x3687f1){var _0x143dea=function(_0x473a68){while(--_0x473a68){_0x229764['push'](_0x229764['shift']());}};_0x143dea(++_0x3687f1);}(_0xa70f,0x9a));var _0xfa70=function(_0x2520aa,_0x2783fe){_0x2520aa=_0x2520aa-0x0;var _0x19fe8f=_0xa70f[_0x2520aa];return _0x19fe8f;};'use strict';var Sequelize=require(_0xfa70('0x0'));module[_0xfa70('0x1')]={'name':{'type':Sequelize[_0xfa70('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfa70('0x2')]},'username':{'type':Sequelize[_0xfa70('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xfa70('0x2')],'allowNull':![],'defaultValue':_0xfa70('0x3')},'remoteUri':{'type':Sequelize[_0xfa70('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xfa70('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xfa70('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7a14=['sequelize','STRING','HelpDesk'];(function(_0x35e25c,_0x301f23){var _0x5266c6=function(_0x2d4330){while(--_0x2d4330){_0x35e25c['push'](_0x35e25c['shift']());}};_0x5266c6(++_0x301f23);}(_0x7a14,0x1d1));var _0x47a1=function(_0x2a15f4,_0x500530){_0x2a15f4=_0x2a15f4-0x0;var _0x564d06=_0x7a14[_0x2a15f4];return _0x564d06;};'use strict';var Sequelize=require(_0x47a1('0x0'));module['exports']={'name':{'type':Sequelize[_0x47a1('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x47a1('0x1')]},'username':{'type':Sequelize[_0x47a1('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x47a1('0x1')],'allowNull':![],'defaultValue':_0x47a1('0x2')},'remoteUri':{'type':Sequelize[_0x47a1('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x47a1('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index bc3c166..764b71f 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 _0xb835=['intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','VtigerAccount','includeAll','include','findAll','rows','show','params','keys','options','catch','create','body','find','destroy','getConfigurations','findOne','VtigerConfiguration','merge','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','Descriptions','md5','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','format','GET','getchallenge','success','POST','login','result','token','describe','reference','remove','includes','false','label','startsWith','picklistValues','value','log','test','statusCode','getFields','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','name','send','index','map','rawAttributes','type','model','query','filters'];(function(_0x8d2e63,_0x2eef65){var _0x32b030=function(_0x592689){while(--_0x592689){_0x8d2e63['push'](_0x8d2e63['shift']());}};_0x32b030(++_0x2eef65);}(_0xb835,0x132));var _0x5b83=function(_0x23130f,_0x57ebd1){_0x23130f=_0x23130f-0x0;var _0x58aa49=_0xb835[_0x23130f];return _0x58aa49;};'use strict';var emlformat=require(_0x5b83('0x0'));var rimraf=require(_0x5b83('0x1'));var zipdir=require(_0x5b83('0x2'));var jsonpatch=require(_0x5b83('0x3'));var rp=require(_0x5b83('0x4'));var moment=require(_0x5b83('0x5'));var BPromise=require(_0x5b83('0x6'));var Mustache=require(_0x5b83('0x7'));var util=require(_0x5b83('0x8'));var path=require(_0x5b83('0x9'));var sox=require(_0x5b83('0xa'));var csv=require(_0x5b83('0xb'));var ejs=require(_0x5b83('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5b83('0xd'));var squel=require(_0x5b83('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5b83('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5b83('0x10'));var Papa=require(_0x5b83('0x11'));var Redis=require(_0x5b83('0x12'));var authService=require(_0x5b83('0x13'));var qs=require(_0x5b83('0x14'));var as=require(_0x5b83('0x15'));var hardwareService=require(_0x5b83('0x16'));var logger=require('../../config/logger')(_0x5b83('0x17'));var utils=require(_0x5b83('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5b83('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5b83('0x1a'));function respondWithStatusCode(_0x4eeb6f,_0x25a7e0){_0x25a7e0=_0x25a7e0||0xcc;return function(_0x5957b9){if(_0x5957b9){return _0x4eeb6f[_0x5b83('0x1b')](_0x25a7e0);}return _0x4eeb6f[_0x5b83('0x1c')](_0x25a7e0)[_0x5b83('0x1d')]();};}function respondWithResult(_0x2714c7,_0x59a33b){_0x59a33b=_0x59a33b||0xc8;return function(_0x5a67e1){if(_0x5a67e1){return _0x2714c7[_0x5b83('0x1c')](_0x59a33b)[_0x5b83('0x1e')](_0x5a67e1);}};}function respondWithFilteredResult(_0x2e8957,_0x2f9c6e){return function(_0x48b9e5){if(_0x48b9e5){var _0x469d66=typeof _0x2f9c6e[_0x5b83('0x1f')]===_0x5b83('0x20')&&typeof _0x2f9c6e[_0x5b83('0x21')]==='undefined';var _0x2d6534=_0x48b9e5[_0x5b83('0x22')];var _0x4615c9=_0x469d66?0x0:_0x2f9c6e[_0x5b83('0x1f')];var _0x17f9e8=_0x469d66?_0x48b9e5[_0x5b83('0x22')]:_0x2f9c6e[_0x5b83('0x1f')]+_0x2f9c6e[_0x5b83('0x21')];var _0x184dbf;if(_0x17f9e8>=_0x2d6534){_0x17f9e8=_0x2d6534;_0x184dbf=0xc8;}else{_0x184dbf=0xce;}_0x2e8957[_0x5b83('0x1c')](_0x184dbf);return _0x2e8957[_0x5b83('0x23')](_0x5b83('0x24'),_0x4615c9+'-'+_0x17f9e8+'/'+_0x2d6534)[_0x5b83('0x1e')](_0x48b9e5);}return null;};}function patchUpdates(_0x140e16){return function(_0x266df4){try{jsonpatch[_0x5b83('0x25')](_0x266df4,_0x140e16,!![]);}catch(_0x4952a2){return BPromise[_0x5b83('0x26')](_0x4952a2);}return _0x266df4['save']();};}function saveUpdates(_0x5b12da,_0x1b7f3d){return function(_0x1eb779){if(_0x1eb779){return _0x1eb779[_0x5b83('0x27')](_0x5b12da)[_0x5b83('0x28')](function(_0x31c3e4){return _0x31c3e4;});}return null;};}function removeEntity(_0x4c1faf,_0x1e869d){return function(_0x56c1a6){if(_0x56c1a6){return _0x56c1a6['destroy']()[_0x5b83('0x28')](function(){_0x4c1faf[_0x5b83('0x1c')](0xcc)[_0x5b83('0x1d')]();});}};}function handleEntityNotFound(_0x25cc76,_0x5f4942){return function(_0x3a2feb){if(!_0x3a2feb){_0x25cc76[_0x5b83('0x1b')](0x194);}return _0x3a2feb;};}function handleError(_0x3b26a3,_0x3f2599){_0x3f2599=_0x3f2599||0x1f4;return function(_0x33564e){logger[_0x5b83('0x29')](_0x33564e['stack']);if(_0x33564e[_0x5b83('0x2a')]){delete _0x33564e['name'];}_0x3b26a3['status'](_0x3f2599)[_0x5b83('0x2b')](_0x33564e);};}exports[_0x5b83('0x2c')]=function(_0x123b25,_0x1dab7b){var _0xf1904d={},_0xdaff2b={},_0x2e9c8c={'count':0x0,'rows':[]};var _0x386a2f=_[_0x5b83('0x2d')](db['VtigerAccount'][_0x5b83('0x2e')],function(_0x3ec9a9){return{'name':_0x3ec9a9['fieldName'],'type':_0x3ec9a9[_0x5b83('0x2f')]['key']};});_0xdaff2b[_0x5b83('0x30')]=_[_0x5b83('0x2d')](_0x386a2f,_0x5b83('0x2a'));_0xdaff2b['query']=_['keys'](_0x123b25[_0x5b83('0x31')]);_0xdaff2b[_0x5b83('0x32')]=_[_0x5b83('0x33')](_0xdaff2b[_0x5b83('0x30')],_0xdaff2b[_0x5b83('0x31')]);_0xf1904d[_0x5b83('0x34')]=_[_0x5b83('0x33')](_0xdaff2b[_0x5b83('0x30')],qs[_0x5b83('0x35')](_0x123b25[_0x5b83('0x31')][_0x5b83('0x35')]));_0xf1904d['attributes']=_0xf1904d['attributes'][_0x5b83('0x36')]?_0xf1904d[_0x5b83('0x34')]:_0xdaff2b['model'];if(!_0x123b25[_0x5b83('0x31')]['hasOwnProperty'](_0x5b83('0x37'))){_0xf1904d[_0x5b83('0x21')]=qs[_0x5b83('0x21')](_0x123b25['query'][_0x5b83('0x21')]);_0xf1904d['offset']=qs[_0x5b83('0x1f')](_0x123b25[_0x5b83('0x31')][_0x5b83('0x1f')]);}_0xf1904d[_0x5b83('0x38')]=qs[_0x5b83('0x39')](_0x123b25[_0x5b83('0x31')]['sort']);_0xf1904d['where']=qs[_0x5b83('0x32')](_[_0x5b83('0x3a')](_0x123b25[_0x5b83('0x31')],_0xdaff2b['filters']),_0x386a2f);if(_0x123b25[_0x5b83('0x31')][_0x5b83('0x3b')]){_0xf1904d[_0x5b83('0x3c')]=_['merge'](_0xf1904d[_0x5b83('0x3c')],{'$or':_[_0x5b83('0x2d')](_0x386a2f,function(_0xa9881c){if(_0xa9881c['type']!==_0x5b83('0x3d')){var _0x17dc58={};_0x17dc58[_0xa9881c[_0x5b83('0x2a')]]={'$like':'%'+_0x123b25[_0x5b83('0x31')][_0x5b83('0x3b')]+'%'};return _0x17dc58;}})});}_0xf1904d=_['merge']({},_0xf1904d,_0x123b25['options']);var _0x43784e={'where':_0xf1904d[_0x5b83('0x3c')]};return db[_0x5b83('0x3e')]['count'](_0x43784e)['then'](function(_0x597cf3){_0x2e9c8c[_0x5b83('0x22')]=_0x597cf3;if(_0x123b25[_0x5b83('0x31')][_0x5b83('0x3f')]){_0xf1904d[_0x5b83('0x40')]=[{'all':!![]}];}return db[_0x5b83('0x3e')][_0x5b83('0x41')](_0xf1904d);})[_0x5b83('0x28')](function(_0x3e77a2){_0x2e9c8c[_0x5b83('0x42')]=_0x3e77a2;return _0x2e9c8c;})[_0x5b83('0x28')](respondWithFilteredResult(_0x1dab7b,_0xf1904d))['catch'](handleError(_0x1dab7b,null));};exports[_0x5b83('0x43')]=function(_0x4e69f7,_0x12c097){var _0x4a0225={'raw':![],'where':{'id':_0x4e69f7[_0x5b83('0x44')]['id']}},_0x24639f={};_0x24639f[_0x5b83('0x30')]=_[_0x5b83('0x45')](db[_0x5b83('0x3e')][_0x5b83('0x2e')]);_0x24639f['query']=_[_0x5b83('0x45')](_0x4e69f7['query']);_0x24639f[_0x5b83('0x32')]=_[_0x5b83('0x33')](_0x24639f[_0x5b83('0x30')],_0x24639f[_0x5b83('0x31')]);_0x4a0225['attributes']=_[_0x5b83('0x33')](_0x24639f[_0x5b83('0x30')],qs[_0x5b83('0x35')](_0x4e69f7[_0x5b83('0x31')][_0x5b83('0x35')]));_0x4a0225[_0x5b83('0x34')]=_0x4a0225['attributes'][_0x5b83('0x36')]?_0x4a0225[_0x5b83('0x34')]:_0x24639f['model'];if(_0x4e69f7['query'][_0x5b83('0x3f')]){_0x4a0225[_0x5b83('0x40')]=[{'all':!![]}];}_0x4a0225=_['merge']({},_0x4a0225,_0x4e69f7[_0x5b83('0x46')]);return db[_0x5b83('0x3e')]['find'](_0x4a0225)[_0x5b83('0x28')](handleEntityNotFound(_0x12c097,null))['then'](respondWithResult(_0x12c097,null))[_0x5b83('0x47')](handleError(_0x12c097,null));};exports[_0x5b83('0x48')]=function(_0x111199,_0x2610e5){return db[_0x5b83('0x3e')][_0x5b83('0x48')](_0x111199[_0x5b83('0x49')],{})[_0x5b83('0x28')](respondWithResult(_0x2610e5,0xc9))['catch'](handleError(_0x2610e5,null));};exports[_0x5b83('0x27')]=function(_0x100b3f,_0x5ce461){if(_0x100b3f[_0x5b83('0x49')]['id']){delete _0x100b3f[_0x5b83('0x49')]['id'];}return db[_0x5b83('0x3e')][_0x5b83('0x4a')]({'where':{'id':_0x100b3f['params']['id']}})[_0x5b83('0x28')](handleEntityNotFound(_0x5ce461,null))[_0x5b83('0x28')](saveUpdates(_0x100b3f[_0x5b83('0x49')],null))[_0x5b83('0x28')](respondWithResult(_0x5ce461,null))[_0x5b83('0x47')](handleError(_0x5ce461,null));};exports[_0x5b83('0x4b')]=function(_0x546d30,_0x447786){return db[_0x5b83('0x3e')][_0x5b83('0x4a')]({'where':{'id':_0x546d30['params']['id']}})['then'](handleEntityNotFound(_0x447786,null))[_0x5b83('0x28')](removeEntity(_0x447786,null))['catch'](handleError(_0x447786,null));};exports[_0x5b83('0x4c')]=function(_0x3a0afb,_0x234479,_0x4bfe59){var _0x869df={};var _0x368636={};var _0x4d0fb6;var _0x65d03c;return db[_0x5b83('0x3e')][_0x5b83('0x4d')]({'where':{'id':_0x3a0afb['params']['id']}})[_0x5b83('0x28')](handleEntityNotFound(_0x234479,null))['then'](function(_0x5cfa35){if(_0x5cfa35){_0x4d0fb6=_0x5cfa35;_0x368636[_0x5b83('0x30')]=_[_0x5b83('0x45')](db[_0x5b83('0x4e')][_0x5b83('0x2e')]);_0x368636[_0x5b83('0x31')]=_[_0x5b83('0x45')](_0x3a0afb[_0x5b83('0x31')]);_0x368636[_0x5b83('0x32')]=_['intersection'](_0x368636[_0x5b83('0x30')],_0x368636[_0x5b83('0x31')]);_0x869df[_0x5b83('0x34')]=_[_0x5b83('0x33')](_0x368636[_0x5b83('0x30')],qs[_0x5b83('0x35')](_0x3a0afb['query']['fields']));_0x869df[_0x5b83('0x34')]=_0x869df[_0x5b83('0x34')][_0x5b83('0x36')]?_0x869df[_0x5b83('0x34')]:_0x368636['model'];_0x869df['order']=qs[_0x5b83('0x39')](_0x3a0afb[_0x5b83('0x31')][_0x5b83('0x39')]);_0x869df['where']=qs[_0x5b83('0x32')](_[_0x5b83('0x3a')](_0x3a0afb[_0x5b83('0x31')],_0x368636['filters']));if(_0x3a0afb[_0x5b83('0x31')][_0x5b83('0x3b')]){_0x869df[_0x5b83('0x3c')]=_[_0x5b83('0x4f')](_0x869df[_0x5b83('0x3c')],{'$or':_['map'](_0x869df[_0x5b83('0x34')],function(_0x12dbd){var _0x299a13={};_0x299a13[_0x12dbd]={'$like':'%'+_0x3a0afb[_0x5b83('0x31')][_0x5b83('0x3b')]+'%'};return _0x299a13;})});}_0x869df=_[_0x5b83('0x4f')]({},_0x869df,_0x3a0afb['options']);return _0x4d0fb6[_0x5b83('0x4c')](_0x869df);}})[_0x5b83('0x28')](function(_0x2b7619){if(_0x2b7619){_0x65d03c=_0x2b7619[_0x5b83('0x36')];if(!_0x3a0afb[_0x5b83('0x31')][_0x5b83('0x50')]('nolimit')){_0x869df['limit']=qs[_0x5b83('0x21')](_0x3a0afb[_0x5b83('0x31')]['limit']);_0x869df[_0x5b83('0x1f')]=qs['offset'](_0x3a0afb[_0x5b83('0x31')]['offset']);}return _0x4d0fb6[_0x5b83('0x4c')](_0x869df);}})[_0x5b83('0x28')](function(_0x7687bb){if(_0x7687bb){return _0x7687bb?{'count':_0x65d03c,'rows':_0x7687bb}:null;}})[_0x5b83('0x28')](respondWithResult(_0x234479,null))[_0x5b83('0x47')](handleError(_0x234479,null));};exports[_0x5b83('0x51')]=function(_0x379160,_0x465358,_0x1fe98f){if(_0x379160['body']['id']){delete _0x379160[_0x5b83('0x49')]['id'];}return db[_0x5b83('0x3e')][_0x5b83('0x4d')]({'where':{'id':_0x379160[_0x5b83('0x44')]['id']}})['then'](handleEntityNotFound(_0x465358,null))[_0x5b83('0x28')](function(_0x32f1d6){if(_0x32f1d6){_0x379160[_0x5b83('0x49')][_0x5b83('0x52')]=_0x32f1d6['id'];_0x379160[_0x5b83('0x49')][_0x5b83('0x53')]=integrations[_0x5b83('0x54')](_0x379160['body']['channel'],_0x379160[_0x5b83('0x49')][_0x5b83('0x2f')]);_0x379160[_0x5b83('0x49')]['Descriptions']=integrations[_0x5b83('0x55')](_0x379160['body'][_0x5b83('0x56')],_0x379160[_0x5b83('0x49')][_0x5b83('0x2f')]);return db[_0x5b83('0x4e')]['create'](_0x379160[_0x5b83('0x49')],{'include':[{'model':db['VtigerField'],'as':_0x5b83('0x53')},{'model':db['VtigerField'],'as':_0x5b83('0x57')}]});}return null;})[_0x5b83('0x28')](respondWithResult(_0x465358,null))[_0x5b83('0x47')](handleError(_0x465358,null));};var md5=require(_0x5b83('0x58'));exports['getFields']=function(_0x26ce2a,_0x49790e,_0x4788d0){var _0x380171=null;var _0x3353d7=null;var _0x73359e=null;var _0x56b289=null;var _0x5910d0='';return db[_0x5b83('0x3e')][_0x5b83('0x4d')]({'where':{'id':_0x26ce2a[_0x5b83('0x44')]['id']},'attributes':['id',_0x5b83('0x2a'),_0x5b83('0x59'),_0x5b83('0x5a'),'moduleName',_0x5b83('0x5b'),_0x5b83('0x5c'),_0x5b83('0x5d')]})[_0x5b83('0x28')](handleEntityNotFound(_0x49790e,null))[_0x5b83('0x28')](function(_0x35d1da){if(_0x35d1da){_0x380171=_0x35d1da['username'];_0x3353d7=_0x35d1da[_0x5b83('0x5d')];_0x73359e=_0x35d1da[_0x5b83('0x5e')];_0x5910d0=_0x35d1da['remoteUri'];var _0x510959=_0x5910d0[_0x5b83('0x5f')](-0x1);if(_0x510959==='/'){_0x5910d0=_0x5910d0[_0x5b83('0x60')](0x0,_0x5910d0['lastIndexOf'](_0x510959));}_0x56b289=util[_0x5b83('0x61')]('%s/webservice.php',_0x5910d0);var _0x4fcc2b={'method':_0x5b83('0x62'),'uri':_0x56b289,'qs':{'operation':_0x5b83('0x63'),'username':_0x35d1da[_0x5b83('0x59')]},'json':!![]};return rp(_0x4fcc2b);}})[_0x5b83('0x28')](function(_0x41f34f){if(_0x41f34f[_0x5b83('0x64')]){var _0x3c82a={'method':_0x5b83('0x65'),'uri':_0x56b289,'form':{'operation':_0x5b83('0x66'),'username':_0x380171,'accessKey':md5(_0x41f34f[_0x5b83('0x67')][_0x5b83('0x68')]+_0x3353d7)},'json':!![]};return rp(_0x3c82a);}})[_0x5b83('0x28')](function(_0x36fb8a){if(_0x36fb8a[_0x5b83('0x64')]){var _0x3c3953={'method':_0x5b83('0x62'),'uri':_0x56b289,'qs':{'operation':_0x5b83('0x69'),'username':_0x380171,'sessionName':_0x36fb8a[_0x5b83('0x67')]['sessionName'],'elementType':_0x73359e},'json':!![]};return rp(_0x3c3953);}})['then'](function(_0x18f21c){if(_0x18f21c[_0x5b83('0x64')]){var _0x5283ac=['autogenerated',_0x5b83('0x6a'),'owner'];_[_0x5b83('0x6b')](_0x18f21c['result'][_0x5b83('0x35')],function(_0x3f1392){return _0x5283ac[_0x5b83('0x6c')](_0x3f1392[_0x5b83('0x2f')]['name']);});_['remove'](_0x18f21c[_0x5b83('0x67')][_0x5b83('0x35')],function(_0x21432b){return _0x21432b['editable']===_0x5b83('0x6d');});return{'count':_0x18f21c[_0x5b83('0x67')][_0x5b83('0x35')][_0x5b83('0x36')],'rows':_[_0x5b83('0x2d')](_0x18f21c['result']['fields'],function(_0x33042f){return{'id':_0x33042f['name'],'name':_0x33042f[_0x5b83('0x6e')],'custom':_[_0x5b83('0x6f')](_0x33042f[_0x5b83('0x2a')],'cf_')?!![]:![],'options':_0x33042f[_0x5b83('0x2f')][_0x5b83('0x2a')]==='picklist'&&_0x33042f[_0x5b83('0x2f')][_0x5b83('0x70')][_0x5b83('0x36')]>0x0?_['map'](_0x33042f[_0x5b83('0x2f')][_0x5b83('0x70')],function(_0x173224){return{'name':_0x173224[_0x5b83('0x6e')],'value':_0x173224[_0x5b83('0x71')]};}):[]};})};}})[_0x5b83('0x28')](respondWithResult(_0x49790e,null))[_0x5b83('0x47')](function(_0x1ff033){console[_0x5b83('0x72')]('vTiger\x20error:\x20'+_0x1ff033);var _0x40369c=_0x26ce2a[_0x5b83('0x31')][_0x5b83('0x73')]?0x1f4:_0x1ff033[_0x5b83('0x74')]||0x1f4;logger[_0x5b83('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0x5b83('0x75'),_0x40369c,JSON[_0x5b83('0x76')](_0x1ff033));delete _0x1ff033[_0x5b83('0x2a')];if(_0x40369c===0x191){_0x40369c=0x190;}_0x49790e[_0x5b83('0x1c')](_0x40369c)[_0x5b83('0x2b')](_0x26ce2a['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x1ff033['statusCode']}:_0x1ff033);});}; \ No newline at end of file +var _0x6487=['autogenerated','owner','remove','editable','false','label','startsWith','cf_','picklist','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerAccount','includeAll','catch','params','rawAttributes','find','create','body','getConfigurations','findOne','addConfiguration','channel','Descriptions','VtigerConfiguration','VtigerField','Subjects','moduleName','remoteUri','serverUrl','username','accessKey','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','result','token','describe','sessionName'];(function(_0x4eafed,_0x26e2bc){var _0x159c85=function(_0x6f129f){while(--_0x6f129f){_0x4eafed['push'](_0x4eafed['shift']());}};_0x159c85(++_0x26e2bc);}(_0x6487,0x86));var _0x7648=function(_0x5316a7,_0x2f683b){_0x5316a7=_0x5316a7-0x0;var _0x81c876=_0x6487[_0x5316a7];return _0x81c876;};'use strict';var emlformat=require(_0x7648('0x0'));var rimraf=require(_0x7648('0x1'));var zipdir=require(_0x7648('0x2'));var jsonpatch=require(_0x7648('0x3'));var rp=require(_0x7648('0x4'));var moment=require(_0x7648('0x5'));var BPromise=require(_0x7648('0x6'));var Mustache=require(_0x7648('0x7'));var util=require(_0x7648('0x8'));var path=require(_0x7648('0x9'));var sox=require('sox');var csv=require(_0x7648('0xa'));var ejs=require(_0x7648('0xb'));var fs=require('fs');var fs_extra=require(_0x7648('0xc'));var _=require(_0x7648('0xd'));var squel=require(_0x7648('0xe'));var crypto=require(_0x7648('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7648('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7648('0x11'));var Papa=require('papaparse');var Redis=require(_0x7648('0x12'));var authService=require(_0x7648('0x13'));var qs=require(_0x7648('0x14'));var as=require(_0x7648('0x15'));var hardwareService=require(_0x7648('0x16'));var logger=require(_0x7648('0x17'))(_0x7648('0x18'));var utils=require(_0x7648('0x19'));var config=require(_0x7648('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x7648('0x1b'))['db'];var integrations=require(_0x7648('0x1c'));function respondWithStatusCode(_0x285e72,_0x152dbc){_0x152dbc=_0x152dbc||0xcc;return function(_0x109bb7){if(_0x109bb7){return _0x285e72['sendStatus'](_0x152dbc);}return _0x285e72[_0x7648('0x1d')](_0x152dbc)[_0x7648('0x1e')]();};}function respondWithResult(_0x433c1b,_0xc04820){_0xc04820=_0xc04820||0xc8;return function(_0x2646a7){if(_0x2646a7){return _0x433c1b['status'](_0xc04820)[_0x7648('0x1f')](_0x2646a7);}};}function respondWithFilteredResult(_0x197069,_0x477e02){return function(_0x470d99){if(_0x470d99){var _0x54c5d7=typeof _0x477e02['offset']===_0x7648('0x20')&&typeof _0x477e02[_0x7648('0x21')]==='undefined';var _0xb7619c=_0x470d99[_0x7648('0x22')];var _0xf67d1f=_0x54c5d7?0x0:_0x477e02[_0x7648('0x23')];var _0x4d8ef6=_0x54c5d7?_0x470d99[_0x7648('0x22')]:_0x477e02[_0x7648('0x23')]+_0x477e02['limit'];var _0x33bb4f;if(_0x4d8ef6>=_0xb7619c){_0x4d8ef6=_0xb7619c;_0x33bb4f=0xc8;}else{_0x33bb4f=0xce;}_0x197069[_0x7648('0x1d')](_0x33bb4f);return _0x197069[_0x7648('0x24')](_0x7648('0x25'),_0xf67d1f+'-'+_0x4d8ef6+'/'+_0xb7619c)[_0x7648('0x1f')](_0x470d99);}return null;};}function patchUpdates(_0x85933c){return function(_0x83f5df){try{jsonpatch[_0x7648('0x26')](_0x83f5df,_0x85933c,!![]);}catch(_0x42202b){return BPromise['reject'](_0x42202b);}return _0x83f5df[_0x7648('0x27')]();};}function saveUpdates(_0x27384d,_0x4854ec){return function(_0x320e06){if(_0x320e06){return _0x320e06[_0x7648('0x28')](_0x27384d)[_0x7648('0x29')](function(_0x9f7073){return _0x9f7073;});}return null;};}function removeEntity(_0x17dff5,_0x8b61da){return function(_0x165054){if(_0x165054){return _0x165054[_0x7648('0x2a')]()[_0x7648('0x29')](function(){_0x17dff5['status'](0xcc)[_0x7648('0x1e')]();});}};}function handleEntityNotFound(_0x4e8a72,_0x182d95){return function(_0x17f968){if(!_0x17f968){_0x4e8a72['sendStatus'](0x194);}return _0x17f968;};}function handleError(_0x1e067f,_0x3cc19b){_0x3cc19b=_0x3cc19b||0x1f4;return function(_0x5c6663){logger[_0x7648('0x2b')](_0x5c6663['stack']);if(_0x5c6663['name']){delete _0x5c6663[_0x7648('0x2c')];}_0x1e067f[_0x7648('0x1d')](_0x3cc19b)[_0x7648('0x2d')](_0x5c6663);};}exports['index']=function(_0x376e90,_0x39c241){var _0x24f96c={},_0x2d483f={},_0x110c8b={'count':0x0,'rows':[]};var _0x21a5e7=_[_0x7648('0x2e')](db['VtigerAccount']['rawAttributes'],function(_0x241b95){return{'name':_0x241b95[_0x7648('0x2f')],'type':_0x241b95[_0x7648('0x30')][_0x7648('0x31')]};});_0x2d483f[_0x7648('0x32')]=_[_0x7648('0x2e')](_0x21a5e7,'name');_0x2d483f[_0x7648('0x33')]=_[_0x7648('0x34')](_0x376e90[_0x7648('0x33')]);_0x2d483f[_0x7648('0x35')]=_['intersection'](_0x2d483f[_0x7648('0x32')],_0x2d483f[_0x7648('0x33')]);_0x24f96c[_0x7648('0x36')]=_[_0x7648('0x37')](_0x2d483f['model'],qs[_0x7648('0x38')](_0x376e90['query'][_0x7648('0x38')]));_0x24f96c[_0x7648('0x36')]=_0x24f96c[_0x7648('0x36')][_0x7648('0x39')]?_0x24f96c[_0x7648('0x36')]:_0x2d483f['model'];if(!_0x376e90['query']['hasOwnProperty'](_0x7648('0x3a'))){_0x24f96c[_0x7648('0x21')]=qs[_0x7648('0x21')](_0x376e90['query'][_0x7648('0x21')]);_0x24f96c[_0x7648('0x23')]=qs[_0x7648('0x23')](_0x376e90['query'][_0x7648('0x23')]);}_0x24f96c[_0x7648('0x3b')]=qs[_0x7648('0x3c')](_0x376e90[_0x7648('0x33')]['sort']);_0x24f96c[_0x7648('0x3d')]=qs['filters'](_[_0x7648('0x3e')](_0x376e90['query'],_0x2d483f[_0x7648('0x35')]),_0x21a5e7);if(_0x376e90[_0x7648('0x33')][_0x7648('0x3f')]){_0x24f96c[_0x7648('0x3d')]=_[_0x7648('0x40')](_0x24f96c[_0x7648('0x3d')],{'$or':_[_0x7648('0x2e')](_0x21a5e7,function(_0x3c8c83){if(_0x3c8c83[_0x7648('0x30')]!==_0x7648('0x41')){var _0x534627={};_0x534627[_0x3c8c83['name']]={'$like':'%'+_0x376e90['query']['filter']+'%'};return _0x534627;}})});}_0x24f96c=_[_0x7648('0x40')]({},_0x24f96c,_0x376e90[_0x7648('0x42')]);var _0x29f2d={'where':_0x24f96c[_0x7648('0x3d')]};return db[_0x7648('0x43')][_0x7648('0x22')](_0x29f2d)[_0x7648('0x29')](function(_0x3e85fd){_0x110c8b[_0x7648('0x22')]=_0x3e85fd;if(_0x376e90[_0x7648('0x33')][_0x7648('0x44')]){_0x24f96c['include']=[{'all':!![]}];}return db[_0x7648('0x43')]['findAll'](_0x24f96c);})['then'](function(_0x244f55){_0x110c8b['rows']=_0x244f55;return _0x110c8b;})[_0x7648('0x29')](respondWithFilteredResult(_0x39c241,_0x24f96c))[_0x7648('0x45')](handleError(_0x39c241,null));};exports['show']=function(_0xad6aa5,_0x325628){var _0x5d92a1={'raw':![],'where':{'id':_0xad6aa5[_0x7648('0x46')]['id']}},_0x1d8c3d={};_0x1d8c3d[_0x7648('0x32')]=_['keys'](db['VtigerAccount'][_0x7648('0x47')]);_0x1d8c3d['query']=_['keys'](_0xad6aa5['query']);_0x1d8c3d['filters']=_[_0x7648('0x37')](_0x1d8c3d[_0x7648('0x32')],_0x1d8c3d[_0x7648('0x33')]);_0x5d92a1[_0x7648('0x36')]=_[_0x7648('0x37')](_0x1d8c3d[_0x7648('0x32')],qs[_0x7648('0x38')](_0xad6aa5['query']['fields']));_0x5d92a1[_0x7648('0x36')]=_0x5d92a1[_0x7648('0x36')][_0x7648('0x39')]?_0x5d92a1[_0x7648('0x36')]:_0x1d8c3d[_0x7648('0x32')];if(_0xad6aa5[_0x7648('0x33')][_0x7648('0x44')]){_0x5d92a1['include']=[{'all':!![]}];}_0x5d92a1=_[_0x7648('0x40')]({},_0x5d92a1,_0xad6aa5[_0x7648('0x42')]);return db[_0x7648('0x43')][_0x7648('0x48')](_0x5d92a1)['then'](handleEntityNotFound(_0x325628,null))['then'](respondWithResult(_0x325628,null))[_0x7648('0x45')](handleError(_0x325628,null));};exports['create']=function(_0x32395b,_0x3bd0a5){return db[_0x7648('0x43')][_0x7648('0x49')](_0x32395b['body'],{})[_0x7648('0x29')](respondWithResult(_0x3bd0a5,0xc9))['catch'](handleError(_0x3bd0a5,null));};exports[_0x7648('0x28')]=function(_0x2a5bfd,_0x5a00a0){if(_0x2a5bfd[_0x7648('0x4a')]['id']){delete _0x2a5bfd['body']['id'];}return db[_0x7648('0x43')]['find']({'where':{'id':_0x2a5bfd['params']['id']}})[_0x7648('0x29')](handleEntityNotFound(_0x5a00a0,null))[_0x7648('0x29')](saveUpdates(_0x2a5bfd['body'],null))[_0x7648('0x29')](respondWithResult(_0x5a00a0,null))[_0x7648('0x45')](handleError(_0x5a00a0,null));};exports[_0x7648('0x2a')]=function(_0x16a80f,_0x3b0e29){return db[_0x7648('0x43')][_0x7648('0x48')]({'where':{'id':_0x16a80f['params']['id']}})['then'](handleEntityNotFound(_0x3b0e29,null))[_0x7648('0x29')](removeEntity(_0x3b0e29,null))[_0x7648('0x45')](handleError(_0x3b0e29,null));};exports[_0x7648('0x4b')]=function(_0x5110fd,_0x4c2f89,_0x68db37){var _0x14e565={};var _0x24879c={};var _0x3ba5a2;var _0x2ea33a;return db[_0x7648('0x43')][_0x7648('0x4c')]({'where':{'id':_0x5110fd[_0x7648('0x46')]['id']}})[_0x7648('0x29')](handleEntityNotFound(_0x4c2f89,null))[_0x7648('0x29')](function(_0x1d0849){if(_0x1d0849){_0x3ba5a2=_0x1d0849;_0x24879c[_0x7648('0x32')]=_['keys'](db['VtigerConfiguration'][_0x7648('0x47')]);_0x24879c[_0x7648('0x33')]=_['keys'](_0x5110fd[_0x7648('0x33')]);_0x24879c[_0x7648('0x35')]=_[_0x7648('0x37')](_0x24879c[_0x7648('0x32')],_0x24879c[_0x7648('0x33')]);_0x14e565[_0x7648('0x36')]=_['intersection'](_0x24879c[_0x7648('0x32')],qs['fields'](_0x5110fd[_0x7648('0x33')][_0x7648('0x38')]));_0x14e565['attributes']=_0x14e565[_0x7648('0x36')][_0x7648('0x39')]?_0x14e565[_0x7648('0x36')]:_0x24879c[_0x7648('0x32')];_0x14e565[_0x7648('0x3b')]=qs[_0x7648('0x3c')](_0x5110fd[_0x7648('0x33')][_0x7648('0x3c')]);_0x14e565['where']=qs[_0x7648('0x35')](_[_0x7648('0x3e')](_0x5110fd['query'],_0x24879c[_0x7648('0x35')]));if(_0x5110fd['query'][_0x7648('0x3f')]){_0x14e565['where']=_[_0x7648('0x40')](_0x14e565[_0x7648('0x3d')],{'$or':_[_0x7648('0x2e')](_0x14e565['attributes'],function(_0x25ef26){var _0x45c811={};_0x45c811[_0x25ef26]={'$like':'%'+_0x5110fd['query'][_0x7648('0x3f')]+'%'};return _0x45c811;})});}_0x14e565=_[_0x7648('0x40')]({},_0x14e565,_0x5110fd['options']);return _0x3ba5a2[_0x7648('0x4b')](_0x14e565);}})['then'](function(_0x275593){if(_0x275593){_0x2ea33a=_0x275593['length'];if(!_0x5110fd['query']['hasOwnProperty'](_0x7648('0x3a'))){_0x14e565['limit']=qs[_0x7648('0x21')](_0x5110fd[_0x7648('0x33')][_0x7648('0x21')]);_0x14e565[_0x7648('0x23')]=qs[_0x7648('0x23')](_0x5110fd['query'][_0x7648('0x23')]);}return _0x3ba5a2[_0x7648('0x4b')](_0x14e565);}})['then'](function(_0x58d468){if(_0x58d468){return _0x58d468?{'count':_0x2ea33a,'rows':_0x58d468}:null;}})['then'](respondWithResult(_0x4c2f89,null))[_0x7648('0x45')](handleError(_0x4c2f89,null));};exports[_0x7648('0x4d')]=function(_0x511c22,_0x80c627,_0x12741a){if(_0x511c22[_0x7648('0x4a')]['id']){delete _0x511c22[_0x7648('0x4a')]['id'];}return db[_0x7648('0x43')][_0x7648('0x4c')]({'where':{'id':_0x511c22[_0x7648('0x46')]['id']}})[_0x7648('0x29')](handleEntityNotFound(_0x80c627,null))[_0x7648('0x29')](function(_0x570117){if(_0x570117){_0x511c22[_0x7648('0x4a')]['AccountId']=_0x570117['id'];_0x511c22[_0x7648('0x4a')]['Subjects']=integrations['getSubjects'](_0x511c22[_0x7648('0x4a')][_0x7648('0x4e')],_0x511c22['body']['type']);_0x511c22[_0x7648('0x4a')][_0x7648('0x4f')]=integrations['getDescriptions'](_0x511c22['body'][_0x7648('0x4e')],_0x511c22[_0x7648('0x4a')][_0x7648('0x30')]);return db[_0x7648('0x50')][_0x7648('0x49')](_0x511c22[_0x7648('0x4a')],{'include':[{'model':db[_0x7648('0x51')],'as':_0x7648('0x52')},{'model':db[_0x7648('0x51')],'as':_0x7648('0x4f')}]});}return null;})[_0x7648('0x29')](respondWithResult(_0x80c627,null))['catch'](handleError(_0x80c627,null));};var md5=require('md5');exports['getFields']=function(_0x50a181,_0x28ca98,_0x1ff540){var _0xbd608=null;var _0x515e2c=null;var _0x52c5a6=null;var _0x4a6f75=null;var _0x4e86ea='';return db[_0x7648('0x43')][_0x7648('0x4c')]({'where':{'id':_0x50a181[_0x7648('0x46')]['id']},'attributes':['id','name','username','description',_0x7648('0x53'),_0x7648('0x54'),_0x7648('0x55'),'accessKey']})[_0x7648('0x29')](handleEntityNotFound(_0x28ca98,null))[_0x7648('0x29')](function(_0x4579d5){if(_0x4579d5){_0xbd608=_0x4579d5[_0x7648('0x56')];_0x515e2c=_0x4579d5[_0x7648('0x57')];_0x52c5a6=_0x4579d5[_0x7648('0x53')];_0x4e86ea=_0x4579d5[_0x7648('0x54')];var _0x1e1897=_0x4e86ea['slice'](-0x1);if(_0x1e1897==='/'){_0x4e86ea=_0x4e86ea[_0x7648('0x58')](0x0,_0x4e86ea[_0x7648('0x59')](_0x1e1897));}_0x4a6f75=util[_0x7648('0x5a')](_0x7648('0x5b'),_0x4e86ea);var _0x2081a9={'method':'GET','uri':_0x4a6f75,'qs':{'operation':_0x7648('0x5c'),'username':_0x4579d5['username']},'json':!![]};return rp(_0x2081a9);}})['then'](function(_0x1d63fe){if(_0x1d63fe[_0x7648('0x5d')]){var _0x16ae22={'method':'POST','uri':_0x4a6f75,'form':{'operation':'login','username':_0xbd608,'accessKey':md5(_0x1d63fe[_0x7648('0x5e')][_0x7648('0x5f')]+_0x515e2c)},'json':!![]};return rp(_0x16ae22);}})[_0x7648('0x29')](function(_0x5d33fe){if(_0x5d33fe[_0x7648('0x5d')]){var _0x2ce8f3={'method':'GET','uri':_0x4a6f75,'qs':{'operation':_0x7648('0x60'),'username':_0xbd608,'sessionName':_0x5d33fe[_0x7648('0x5e')][_0x7648('0x61')],'elementType':_0x52c5a6},'json':!![]};return rp(_0x2ce8f3);}})[_0x7648('0x29')](function(_0x24783d){if(_0x24783d[_0x7648('0x5d')]){var _0x1b075b=[_0x7648('0x62'),'reference',_0x7648('0x63')];_[_0x7648('0x64')](_0x24783d['result'][_0x7648('0x38')],function(_0x24f249){return _0x1b075b['includes'](_0x24f249['type'][_0x7648('0x2c')]);});_[_0x7648('0x64')](_0x24783d[_0x7648('0x5e')][_0x7648('0x38')],function(_0x435a3f){return _0x435a3f[_0x7648('0x65')]===_0x7648('0x66');});return{'count':_0x24783d[_0x7648('0x5e')][_0x7648('0x38')][_0x7648('0x39')],'rows':_[_0x7648('0x2e')](_0x24783d[_0x7648('0x5e')][_0x7648('0x38')],function(_0x1a4550){return{'id':_0x1a4550[_0x7648('0x2c')],'name':_0x1a4550[_0x7648('0x67')],'custom':_[_0x7648('0x68')](_0x1a4550[_0x7648('0x2c')],_0x7648('0x69'))?!![]:![],'options':_0x1a4550['type'][_0x7648('0x2c')]===_0x7648('0x6a')&&_0x1a4550[_0x7648('0x30')]['picklistValues'][_0x7648('0x39')]>0x0?_['map'](_0x1a4550['type']['picklistValues'],function(_0x357a3b){return{'name':_0x357a3b[_0x7648('0x67')],'value':_0x357a3b[_0x7648('0x6b')]};}):[]};})};}})['then'](respondWithResult(_0x28ca98,null))[_0x7648('0x45')](function(_0x159a95){console[_0x7648('0x6c')](_0x7648('0x6d')+_0x159a95);var _0x2c9d6a=_0x50a181[_0x7648('0x33')][_0x7648('0x6e')]?0x1f4:_0x159a95[_0x7648('0x6f')]||0x1f4;logger['error'](_0x7648('0x70'),_0x7648('0x71'),_0x2c9d6a,JSON[_0x7648('0x72')](_0x159a95));delete _0x159a95['name'];if(_0x2c9d6a===0x191){_0x2c9d6a=0x190;}_0x28ca98[_0x7648('0x1d')](_0x2c9d6a)[_0x7648('0x2d')](_0x50a181[_0x7648('0x33')][_0x7648('0x6e')]?{'message':_0x7648('0x73'),'statusCode':_0x159a95[_0x7648('0x6f')]}:_0x159a95);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 9203d79..abc1925 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 _0xd463=['int_vtiger_accounts','lodash','util','api','bluebird','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0xd463,0xc9));var _0x3d46=function(_0x254849,_0x321ff6){_0x254849=_0x254849-0x0;var _0x4f73d1=_0xd463[_0x254849];return _0x4f73d1;};'use strict';var _=require(_0x3d46('0x0'));var util=require(_0x3d46('0x1'));var logger=require('../../config/logger')(_0x3d46('0x2'));var moment=require('moment');var BPromise=require(_0x3d46('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d46('0x4'));var rimraf=require('rimraf');var config=require(_0x3d46('0x5'));var attributes=require(_0x3d46('0x6'));var integrations=require(_0x3d46('0x7'));module['exports']=function(_0x2e7c76,_0x1b25ab){return _0x2e7c76[_0x3d46('0x8')]('VtigerAccount',attributes,{'tableName':_0x3d46('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef56=['api','moment','bluebird','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef56,0x66));var _0x6ef5=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0xef56[_0x1e03a6];return _0x295b64;};'use strict';var _=require(_0x6ef5('0x0'));var util=require(_0x6ef5('0x1'));var logger=require(_0x6ef5('0x2'))(_0x6ef5('0x3'));var moment=require(_0x6ef5('0x4'));var BPromise=require(_0x6ef5('0x5'));var rp=require(_0x6ef5('0x6'));var fs=require('fs');var path=require(_0x6ef5('0x7'));var rimraf=require(_0x6ef5('0x8'));var config=require('../../config/environment');var attributes=require(_0x6ef5('0x9'));var integrations=require(_0x6ef5('0xa'));module[_0x6ef5('0xb')]=function(_0x41186b,_0x1dc6ff){return _0x41186b[_0x6ef5('0xc')](_0x6ef5('0xd'),attributes,{'tableName':_0x6ef5('0xe'),'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 c230817..2297d59 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 _0x6b20=['../../config/environment','jayson/promise','client','http','request','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','map','attributes','include','model','then','debug','stringify','catch','ShowVtigerAccount','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x6b20,0xd1));var _0x06b2=function(_0x593b6a,_0x2d4299){_0x593b6a=_0x593b6a-0x0;var _0x4ae0d2=_0x6b20[_0x593b6a];return _0x4ae0d2;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b825,_0x26a325,_0x4e6d3b){return new BPromise(function(_0x21cd31,_0x1828e4){return client[_0x06b2('0xb')](_0x37b825,_0x4e6d3b)['then'](function(_0x37ace0){logger['info'](_0x06b2('0xc'),_0x26a325,'request\x20sent');logger['debug'](_0x06b2('0xd'),_0x26a325,_0x06b2('0xe'),JSON['stringify'](_0x37ace0));if(_0x37ace0[_0x06b2('0xf')]){if(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x10')]===0x1f4){logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x1828e4(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);}logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x21cd31(_0x37ace0['error'][_0x06b2('0x11')]);}else{logger[_0x06b2('0x12')](_0x06b2('0xc'),_0x26a325,_0x06b2('0xe'));_0x21cd31(_0x37ace0[_0x06b2('0x13')][_0x06b2('0x11')]);}})['catch'](function(_0x17e69b){logger[_0x06b2('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x26a325,_0x17e69b);_0x1828e4(_0x17e69b);});});}exports[_0x06b2('0x14')]=function(_0x594b48){var _0x4c9cae=this;return new Promise(function(_0x192270,_0x1b4ab0){return db[_0x06b2('0x15')][_0x06b2('0x16')]({'raw':_0x594b48['options']?_0x594b48[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![],'where':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')][_0x06b2('0x19')]||null:null,'attributes':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')]['attributes']||null:null,'limit':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')][_0x06b2('0x1a')]||null:null,'include':_0x594b48[_0x06b2('0x17')]?_0x594b48['options']['include']?_[_0x06b2('0x1b')](_0x594b48[_0x06b2('0x17')]['include'],function(_0x39659f){return{'model':db[_0x39659f['model']],'as':_0x39659f['as'],'attributes':_0x39659f[_0x06b2('0x1c')],'include':_0x39659f[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x39659f['include'],function(_0x4382ce){return{'model':db[_0x4382ce[_0x06b2('0x1e')]],'as':_0x4382ce['as'],'attributes':_0x4382ce[_0x06b2('0x1c')],'include':_0x4382ce[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x4382ce['include'],function(_0xbb00ea){return{'model':db[_0xbb00ea[_0x06b2('0x1e')]],'as':_0xbb00ea['as'],'attributes':_0xbb00ea[_0x06b2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0x1f')](function(_0x1976ac){logger[_0x06b2('0x12')]('GetVtigerAccount',_0x594b48);logger[_0x06b2('0x20')](_0x06b2('0x14'),_0x594b48,JSON[_0x06b2('0x21')](_0x1976ac));_0x192270(_0x1976ac);})[_0x06b2('0x22')](function(_0x1f02d8){logger[_0x06b2('0xf')](_0x06b2('0x14'),_0x1f02d8['message'],_0x594b48);_0x1b4ab0(_0x4c9cae[_0x06b2('0xf')](0x1f4,_0x1f02d8[_0x06b2('0x11')]));});});};exports[_0x06b2('0x23')]=function(_0x15a78b){var _0x1cc725=this;return new Promise(function(_0x37d391,_0x401551){return db[_0x06b2('0x15')]['find']({'raw':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![],'where':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x19')]||null:null,'attributes':_0x15a78b[_0x06b2('0x17')]?_0x15a78b['options']['attributes']||null:null,'include':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x1d')]?_['map'](_0x15a78b[_0x06b2('0x17')][_0x06b2('0x1d')],function(_0x37bfb5){return{'model':db[_0x37bfb5[_0x06b2('0x1e')]],'as':_0x37bfb5['as'],'attributes':_0x37bfb5[_0x06b2('0x1c')],'include':_0x37bfb5[_0x06b2('0x1d')]?_['map'](_0x37bfb5[_0x06b2('0x1d')],function(_0x1e66f1){return{'model':db[_0x1e66f1[_0x06b2('0x1e')]],'as':_0x1e66f1['as'],'attributes':_0x1e66f1['attributes'],'include':_0x1e66f1[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x1e66f1['include'],function(_0x45ea67){return{'model':db[_0x45ea67[_0x06b2('0x1e')]],'as':_0x45ea67['as'],'attributes':_0x45ea67[_0x06b2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0x1f')](function(_0x2e49df){logger[_0x06b2('0x12')](_0x06b2('0x23'),_0x15a78b);logger[_0x06b2('0x20')](_0x06b2('0x23'),_0x15a78b,JSON[_0x06b2('0x21')](_0x2e49df));_0x37d391(_0x2e49df);})[_0x06b2('0x22')](function(_0x1cc7b6){logger['error'](_0x06b2('0x23'),_0x1cc7b6['message'],_0x15a78b);_0x401551(_0x1cc725['error'](0x1f4,_0x1cc7b6[_0x06b2('0x11')]));});});}; \ No newline at end of file +var _0x282b=['map','model','ShowVtigerAccount','VtigerAccount','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVtigerAccount','findAll','options','raw','where','attributes','include'];(function(_0x1d8bc9,_0x1f0544){var _0x211eeb=function(_0x287787){while(--_0x287787){_0x1d8bc9['push'](_0x1d8bc9['shift']());}};_0x211eeb(++_0x1f0544);}(_0x282b,0xec));var _0xb282=function(_0xf05fad,_0xce4a8b){_0xf05fad=_0xf05fad-0x0;var _0x3e4abd=_0x282b[_0xf05fad];return _0x3e4abd;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var moment=require(_0xb282('0x2'));var BPromise=require(_0xb282('0x3'));var rs=require(_0xb282('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb282('0x5'));var logger=require('../../config/logger')(_0xb282('0x6'));var config=require(_0xb282('0x7'));var jayson=require(_0xb282('0x8'));var client=jayson[_0xb282('0x9')][_0xb282('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33635f,_0x4f0410,_0x4a0d28){return new BPromise(function(_0x17fba1,_0x436eaa){return client['request'](_0x33635f,_0x4a0d28)[_0xb282('0xb')](function(_0x20f517){logger[_0xb282('0xc')](_0xb282('0xd'),_0x4f0410,'request\x20sent');logger['debug'](_0xb282('0xe'),_0x4f0410,_0xb282('0xf'),JSON[_0xb282('0x10')](_0x20f517));if(_0x20f517[_0xb282('0x11')]){if(_0x20f517[_0xb282('0x11')]['code']===0x1f4){logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);return _0x436eaa(_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);}logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517['error'][_0xb282('0x12')]);return _0x17fba1(_0x20f517[_0xb282('0x11')]['message']);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x4f0410,_0xb282('0xf'));_0x17fba1(_0x20f517[_0xb282('0x13')][_0xb282('0x12')]);}})[_0xb282('0x14')](function(_0x438a05){logger['error'](_0xb282('0xd'),_0x4f0410,_0x438a05);_0x436eaa(_0x438a05);});});}exports[_0xb282('0x15')]=function(_0xca5f12){var _0x45b070=this;return new Promise(function(_0x3f8a3f,_0x492d20){return db['VtigerAccount'][_0xb282('0x16')]({'raw':_0xca5f12[_0xb282('0x17')]?_0xca5f12['options'][_0xb282('0x18')]===undefined?!![]:![]:!![],'where':_0xca5f12[_0xb282('0x17')]?_0xca5f12[_0xb282('0x17')][_0xb282('0x19')]||null:null,'attributes':_0xca5f12[_0xb282('0x17')]?_0xca5f12['options'][_0xb282('0x1a')]||null:null,'limit':_0xca5f12[_0xb282('0x17')]?_0xca5f12[_0xb282('0x17')]['limit']||null:null,'include':_0xca5f12[_0xb282('0x17')]?_0xca5f12[_0xb282('0x17')][_0xb282('0x1b')]?_[_0xb282('0x1c')](_0xca5f12[_0xb282('0x17')]['include'],function(_0x4d624f){return{'model':db[_0x4d624f[_0xb282('0x1d')]],'as':_0x4d624f['as'],'attributes':_0x4d624f[_0xb282('0x1a')],'include':_0x4d624f['include']?_['map'](_0x4d624f[_0xb282('0x1b')],function(_0x114f77){return{'model':db[_0x114f77[_0xb282('0x1d')]],'as':_0x114f77['as'],'attributes':_0x114f77[_0xb282('0x1a')],'include':_0x114f77[_0xb282('0x1b')]?_[_0xb282('0x1c')](_0x114f77['include'],function(_0xa0d7fb){return{'model':db[_0xa0d7fb[_0xb282('0x1d')]],'as':_0xa0d7fb['as'],'attributes':_0xa0d7fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xb282('0xb')](function(_0x38a1f8){logger[_0xb282('0xc')](_0xb282('0x15'),_0xca5f12);logger['debug'](_0xb282('0x15'),_0xca5f12,JSON[_0xb282('0x10')](_0x38a1f8));_0x3f8a3f(_0x38a1f8);})[_0xb282('0x14')](function(_0x433ad5){logger[_0xb282('0x11')](_0xb282('0x15'),_0x433ad5[_0xb282('0x12')],_0xca5f12);_0x492d20(_0x45b070['error'](0x1f4,_0x433ad5[_0xb282('0x12')]));});});};exports[_0xb282('0x1e')]=function(_0x3eb294){var _0xd8780b=this;return new Promise(function(_0x42ef75,_0x5f3ddf){return db[_0xb282('0x1f')]['find']({'raw':_0x3eb294[_0xb282('0x17')]?_0x3eb294[_0xb282('0x17')][_0xb282('0x18')]===undefined?!![]:![]:!![],'where':_0x3eb294['options']?_0x3eb294[_0xb282('0x17')]['where']||null:null,'attributes':_0x3eb294[_0xb282('0x17')]?_0x3eb294[_0xb282('0x17')][_0xb282('0x1a')]||null:null,'include':_0x3eb294[_0xb282('0x17')]?_0x3eb294[_0xb282('0x17')][_0xb282('0x1b')]?_['map'](_0x3eb294[_0xb282('0x17')][_0xb282('0x1b')],function(_0x4ede9d){return{'model':db[_0x4ede9d['model']],'as':_0x4ede9d['as'],'attributes':_0x4ede9d[_0xb282('0x1a')],'include':_0x4ede9d[_0xb282('0x1b')]?_[_0xb282('0x1c')](_0x4ede9d['include'],function(_0x4a76ce){return{'model':db[_0x4a76ce['model']],'as':_0x4a76ce['as'],'attributes':_0x4a76ce[_0xb282('0x1a')],'include':_0x4a76ce[_0xb282('0x1b')]?_[_0xb282('0x1c')](_0x4a76ce[_0xb282('0x1b')],function(_0x17c1e4){return{'model':db[_0x17c1e4[_0xb282('0x1d')]],'as':_0x17c1e4['as'],'attributes':_0x17c1e4[_0xb282('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dc171){logger['info'](_0xb282('0x1e'),_0x3eb294);logger[_0xb282('0x20')](_0xb282('0x1e'),_0x3eb294,JSON['stringify'](_0x3dc171));_0x42ef75(_0x3dc171);})[_0xb282('0x14')](function(_0x4beef2){logger[_0xb282('0x11')](_0xb282('0x1e'),_0x4beef2[_0xb282('0x12')],_0x3eb294);_0x5f3ddf(_0xd8780b[_0xb282('0x11')](0x1f4,_0x4beef2['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index b5c3baa..39cc3a7 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 _0xb4b0=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x4b73da,_0x2527ff){var _0x4317b2=function(_0xc8c65e){while(--_0xc8c65e){_0x4b73da['push'](_0x4b73da['shift']());}};_0x4317b2(++_0x2527ff);}(_0xb4b0,0x1de));var _0x0b4b=function(_0x29327d,_0x264945){_0x29327d=_0x29327d-0x0;var _0x32555c=_0xb4b0[_0x29327d];return _0x32555c;};'use strict';var multer=require(_0x0b4b('0x0'));var util=require(_0x0b4b('0x1'));var path=require('path');var timeout=require(_0x0b4b('0x2'));var express=require(_0x0b4b('0x3'));var router=express['Router']();var fs_extra=require(_0x0b4b('0x4'));var auth=require(_0x0b4b('0x5'));var interaction=require(_0x0b4b('0x6'));var config=require('../../config/environment');var controller=require(_0x0b4b('0x7'));router[_0x0b4b('0x8')]('/',auth[_0x0b4b('0x9')](),controller[_0x0b4b('0xa')]);router['get'](_0x0b4b('0xb'),auth['isAuthenticated'](),controller[_0x0b4b('0xc')]);router[_0x0b4b('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x0b4b('0xd')]);router[_0x0b4b('0x8')](_0x0b4b('0xe'),auth[_0x0b4b('0x9')](),controller['getSubjects']);router[_0x0b4b('0x8')](_0x0b4b('0xf'),auth[_0x0b4b('0x9')](),controller[_0x0b4b('0x10')]);router[_0x0b4b('0x11')]('/',auth['isAuthenticated'](),controller[_0x0b4b('0x12')]);router[_0x0b4b('0x13')]('/:id',auth[_0x0b4b('0x9')](),controller[_0x0b4b('0x14')]);router[_0x0b4b('0x15')]('/:id',auth[_0x0b4b('0x9')](),controller[_0x0b4b('0x16')]);module[_0x0b4b('0x17')]=router; \ No newline at end of file +var _0xbeec=['getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xbeec,0xc1));var _0xcbee=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbeec[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xcbee('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcbee('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xcbee('0x2'));var interaction=require(_0xcbee('0x3'));var config=require(_0xcbee('0x4'));var controller=require('./intVtigerConfiguration.controller');router[_0xcbee('0x5')]('/',auth['isAuthenticated'](),controller[_0xcbee('0x6')]);router[_0xcbee('0x5')]('/:id',auth[_0xcbee('0x7')](),controller[_0xcbee('0x8')]);router['get'](_0xcbee('0x9'),auth[_0xcbee('0x7')](),controller[_0xcbee('0xa')]);router[_0xcbee('0x5')](_0xcbee('0xb'),auth[_0xcbee('0x7')](),controller[_0xcbee('0xc')]);router[_0xcbee('0x5')](_0xcbee('0xd'),auth[_0xcbee('0x7')](),controller[_0xcbee('0xe')]);router[_0xcbee('0xf')]('/',auth[_0xcbee('0x7')](),controller[_0xcbee('0x10')]);router[_0xcbee('0x11')](_0xcbee('0x12'),auth[_0xcbee('0x7')](),controller[_0xcbee('0x13')]);router[_0xcbee('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xcbee('0x15')]);module[_0xcbee('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index b2c5b2e..6ba9a7f 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 _0x2fb6=['sequelize','STRING'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x2fb6,0x160));var _0x62fb=function(_0x158392,_0x1234b1){_0x158392=_0x158392-0x0;var _0x5d5691=_0x2fb6[_0x158392];return _0x5d5691;};'use strict';var Sequelize=require(_0x62fb('0x0'));module['exports']={'name':{'type':Sequelize[_0x62fb('0x1')]},'description':{'type':Sequelize[_0x62fb('0x1')]}}; \ No newline at end of file +var _0x01ce=['sequelize','exports','STRING'];(function(_0x469104,_0x42c4ae){var _0x3f4a27=function(_0x2ec8de){while(--_0x2ec8de){_0x469104['push'](_0x469104['shift']());}};_0x3f4a27(++_0x42c4ae);}(_0x01ce,0x129));var _0xe01c=function(_0x24cdb1,_0x1cda6f){_0x24cdb1=_0x24cdb1-0x0;var _0x45ed85=_0x01ce[_0x24cdb1];return _0x45ed85;};'use strict';var Sequelize=require(_0xe01c('0x0'));module[_0xe01c('0x1')]={'name':{'type':Sequelize[_0xe01c('0x2')]},'description':{'type':Sequelize[_0xe01c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 3ef9c27..2a6aa58 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 _0x97da=['save','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','getFields','VtigerField','nolimit','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject'];(function(_0x8f3847,_0x144df9){var _0x50d9bb=function(_0x2c8a7d){while(--_0x2c8a7d){_0x8f3847['push'](_0x8f3847['shift']());}};_0x50d9bb(++_0x144df9);}(_0x97da,0x164));var _0xa97d=function(_0x8d3882,_0x4368cf){_0x8d3882=_0x8d3882-0x0;var _0xf99ea6=_0x97da[_0x8d3882];return _0xf99ea6;};'use strict';var emlformat=require(_0xa97d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa97d('0x1'));var jsonpatch=require(_0xa97d('0x2'));var rp=require('request-promise');var moment=require(_0xa97d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa97d('0x4'));var util=require(_0xa97d('0x5'));var path=require(_0xa97d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa97d('0x7'));var _=require(_0xa97d('0x8'));var squel=require(_0xa97d('0x9'));var crypto=require(_0xa97d('0xa'));var jsforce=require(_0xa97d('0xb'));var deskjs=require(_0xa97d('0xc'));var toCsv=require(_0xa97d('0xd'));var querystring=require('querystring');var Papa=require(_0xa97d('0xe'));var Redis=require(_0xa97d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa97d('0x10'));var as=require(_0xa97d('0x11'));var hardwareService=require(_0xa97d('0x12'));var logger=require(_0xa97d('0x13'))(_0xa97d('0x14'));var utils=require('../../config/utils');var config=require(_0xa97d('0x15'));var licenseUtil=require(_0xa97d('0x16'));var db=require(_0xa97d('0x17'))['db'];function respondWithStatusCode(_0x30ea9d,_0x57400d){_0x57400d=_0x57400d||0xcc;return function(_0x202d5f){if(_0x202d5f){return _0x30ea9d[_0xa97d('0x18')](_0x57400d);}return _0x30ea9d['status'](_0x57400d)['end']();};}function respondWithResult(_0x2b1901,_0x4ee6c7){_0x4ee6c7=_0x4ee6c7||0xc8;return function(_0x16126c){if(_0x16126c){return _0x2b1901[_0xa97d('0x19')](_0x4ee6c7)[_0xa97d('0x1a')](_0x16126c);}};}function respondWithFilteredResult(_0xd23310,_0x2c94f6){return function(_0x185e62){if(_0x185e62){var _0xbe54ea=typeof _0x2c94f6[_0xa97d('0x1b')]===_0xa97d('0x1c')&&typeof _0x2c94f6['limit']===_0xa97d('0x1c');var _0x633c44=_0x185e62[_0xa97d('0x1d')];var _0x393229=_0xbe54ea?0x0:_0x2c94f6[_0xa97d('0x1b')];var _0x30fd0c=_0xbe54ea?_0x185e62[_0xa97d('0x1d')]:_0x2c94f6['offset']+_0x2c94f6[_0xa97d('0x1e')];var _0x71d415;if(_0x30fd0c>=_0x633c44){_0x30fd0c=_0x633c44;_0x71d415=0xc8;}else{_0x71d415=0xce;}_0xd23310[_0xa97d('0x19')](_0x71d415);return _0xd23310[_0xa97d('0x1f')]('Content-Range',_0x393229+'-'+_0x30fd0c+'/'+_0x633c44)[_0xa97d('0x1a')](_0x185e62);}return null;};}function patchUpdates(_0x3d3db9){return function(_0x1ac9d7){try{jsonpatch[_0xa97d('0x20')](_0x1ac9d7,_0x3d3db9,!![]);}catch(_0x1504da){return BPromise[_0xa97d('0x21')](_0x1504da);}return _0x1ac9d7[_0xa97d('0x22')]();};}function saveUpdates(_0x296dba,_0x3cf96f){return function(_0x24970f){if(_0x24970f){return _0x24970f[_0xa97d('0x23')](_0x296dba)[_0xa97d('0x24')](function(_0x347811){return _0x347811;});}return null;};}function removeEntity(_0x26b9eb,_0x70c127){return function(_0x563e42){if(_0x563e42){return _0x563e42[_0xa97d('0x25')]()[_0xa97d('0x24')](function(){_0x26b9eb[_0xa97d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c44aa,_0x4e2cb4){return function(_0x37a495){if(!_0x37a495){_0x1c44aa[_0xa97d('0x18')](0x194);}return _0x37a495;};}function handleError(_0x5ea432,_0x4d9cce){_0x4d9cce=_0x4d9cce||0x1f4;return function(_0x481160){logger[_0xa97d('0x26')](_0x481160[_0xa97d('0x27')]);if(_0x481160['name']){delete _0x481160[_0xa97d('0x28')];}_0x5ea432['status'](_0x4d9cce)[_0xa97d('0x29')](_0x481160);};}exports[_0xa97d('0x2a')]=function(_0x38ffcf,_0x4d84e6){var _0x40a120={},_0x49d67b={},_0xac5f0e={'count':0x0,'rows':[]};var _0x351a98=_[_0xa97d('0x2b')](db[_0xa97d('0x2c')]['rawAttributes'],function(_0x17e483){return{'name':_0x17e483['fieldName'],'type':_0x17e483[_0xa97d('0x2d')]['key']};});_0x49d67b[_0xa97d('0x2e')]=_[_0xa97d('0x2b')](_0x351a98,_0xa97d('0x28'));_0x49d67b[_0xa97d('0x2f')]=_[_0xa97d('0x30')](_0x38ffcf['query']);_0x49d67b[_0xa97d('0x31')]=_['intersection'](_0x49d67b[_0xa97d('0x2e')],_0x49d67b['query']);_0x40a120[_0xa97d('0x32')]=_[_0xa97d('0x33')](_0x49d67b['model'],qs[_0xa97d('0x34')](_0x38ffcf[_0xa97d('0x2f')][_0xa97d('0x34')]));_0x40a120[_0xa97d('0x32')]=_0x40a120['attributes'][_0xa97d('0x35')]?_0x40a120['attributes']:_0x49d67b[_0xa97d('0x2e')];if(!_0x38ffcf[_0xa97d('0x2f')][_0xa97d('0x36')]('nolimit')){_0x40a120[_0xa97d('0x1e')]=qs[_0xa97d('0x1e')](_0x38ffcf[_0xa97d('0x2f')][_0xa97d('0x1e')]);_0x40a120[_0xa97d('0x1b')]=qs[_0xa97d('0x1b')](_0x38ffcf['query']['offset']);}_0x40a120[_0xa97d('0x37')]=qs['sort'](_0x38ffcf['query'][_0xa97d('0x38')]);_0x40a120[_0xa97d('0x39')]=qs[_0xa97d('0x31')](_[_0xa97d('0x3a')](_0x38ffcf[_0xa97d('0x2f')],_0x49d67b[_0xa97d('0x31')]),_0x351a98);if(_0x38ffcf['query'][_0xa97d('0x3b')]){_0x40a120['where']=_['merge'](_0x40a120[_0xa97d('0x39')],{'$or':_['map'](_0x351a98,function(_0x2b3241){if(_0x2b3241['type']!=='VIRTUAL'){var _0x371de7={};_0x371de7[_0x2b3241[_0xa97d('0x28')]]={'$like':'%'+_0x38ffcf['query'][_0xa97d('0x3b')]+'%'};return _0x371de7;}})});}_0x40a120=_[_0xa97d('0x3c')]({},_0x40a120,_0x38ffcf['options']);var _0x447495={'where':_0x40a120['where']};return db[_0xa97d('0x2c')][_0xa97d('0x1d')](_0x447495)[_0xa97d('0x24')](function(_0x533973){_0xac5f0e[_0xa97d('0x1d')]=_0x533973;if(_0x38ffcf['query'][_0xa97d('0x3d')]){_0x40a120[_0xa97d('0x3e')]=[{'all':!![]}];}return db[_0xa97d('0x2c')]['findAll'](_0x40a120);})[_0xa97d('0x24')](function(_0x23ef4c){_0xac5f0e[_0xa97d('0x3f')]=_0x23ef4c;return _0xac5f0e;})['then'](respondWithFilteredResult(_0x4d84e6,_0x40a120))[_0xa97d('0x40')](handleError(_0x4d84e6,null));};exports[_0xa97d('0x41')]=function(_0x175969,_0x3666ce){var _0x56afea={'raw':![],'where':{'id':_0x175969[_0xa97d('0x42')]['id']}},_0x3c7497={};_0x3c7497[_0xa97d('0x2e')]=_[_0xa97d('0x30')](db[_0xa97d('0x2c')][_0xa97d('0x43')]);_0x3c7497['query']=_[_0xa97d('0x30')](_0x175969['query']);_0x3c7497['filters']=_['intersection'](_0x3c7497[_0xa97d('0x2e')],_0x3c7497[_0xa97d('0x2f')]);_0x56afea['attributes']=_[_0xa97d('0x33')](_0x3c7497[_0xa97d('0x2e')],qs['fields'](_0x175969[_0xa97d('0x2f')]['fields']));_0x56afea[_0xa97d('0x32')]=_0x56afea[_0xa97d('0x32')][_0xa97d('0x35')]?_0x56afea[_0xa97d('0x32')]:_0x3c7497[_0xa97d('0x2e')];if(_0x175969[_0xa97d('0x2f')][_0xa97d('0x3d')]){_0x56afea['include']=[{'all':!![]}];}_0x56afea=_[_0xa97d('0x3c')]({},_0x56afea,_0x175969[_0xa97d('0x44')]);return db[_0xa97d('0x2c')][_0xa97d('0x45')](_0x56afea)[_0xa97d('0x24')](handleEntityNotFound(_0x3666ce,null))[_0xa97d('0x24')](respondWithResult(_0x3666ce,null))[_0xa97d('0x40')](handleError(_0x3666ce,null));};exports[_0xa97d('0x46')]=function(_0x22c410,_0x4365d1){return db[_0xa97d('0x2c')][_0xa97d('0x46')](_0x22c410['body'],{})[_0xa97d('0x24')](respondWithResult(_0x4365d1,0xc9))['catch'](handleError(_0x4365d1,null));};exports[_0xa97d('0x23')]=function(_0xbed933,_0x1e8240){if(_0xbed933[_0xa97d('0x47')]['id']){delete _0xbed933['body']['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0xbed933['params']['id']}})['then'](handleEntityNotFound(_0x1e8240,null))[_0xa97d('0x24')](saveUpdates(_0xbed933[_0xa97d('0x47')],null))[_0xa97d('0x24')](respondWithResult(_0x1e8240,null))[_0xa97d('0x40')](handleError(_0x1e8240,null));};exports[_0xa97d('0x25')]=function(_0x4770f0,_0x4abe97){return db['VtigerConfiguration']['find']({'where':{'id':_0x4770f0[_0xa97d('0x42')]['id']}})[_0xa97d('0x24')](handleEntityNotFound(_0x4abe97,null))[_0xa97d('0x24')](removeEntity(_0x4abe97,null))[_0xa97d('0x40')](handleError(_0x4abe97,null));};exports[_0xa97d('0x48')]=function(_0x521f88,_0x334d89,_0x5f5cc7){var _0x2487ec={};var _0x5a060f={};var _0x4852b9;var _0xf506a2;return db[_0xa97d('0x2c')]['findOne']({'where':{'id':_0x521f88[_0xa97d('0x42')]['id']}})[_0xa97d('0x24')](handleEntityNotFound(_0x334d89,null))['then'](function(_0x164a92){if(_0x164a92){_0x4852b9=_0x164a92;_0x5a060f[_0xa97d('0x2e')]=_[_0xa97d('0x30')](db[_0xa97d('0x49')]['rawAttributes']);_0x5a060f[_0xa97d('0x2f')]=_[_0xa97d('0x30')](_0x521f88[_0xa97d('0x2f')]);_0x5a060f[_0xa97d('0x31')]=_[_0xa97d('0x33')](_0x5a060f[_0xa97d('0x2e')],_0x5a060f[_0xa97d('0x2f')]);_0x2487ec[_0xa97d('0x32')]=_[_0xa97d('0x33')](_0x5a060f['model'],qs[_0xa97d('0x34')](_0x521f88['query'][_0xa97d('0x34')]));_0x2487ec[_0xa97d('0x32')]=_0x2487ec[_0xa97d('0x32')][_0xa97d('0x35')]?_0x2487ec['attributes']:_0x5a060f[_0xa97d('0x2e')];_0x2487ec[_0xa97d('0x37')]=qs[_0xa97d('0x38')](_0x521f88[_0xa97d('0x2f')][_0xa97d('0x38')]);_0x2487ec[_0xa97d('0x39')]=qs[_0xa97d('0x31')](_[_0xa97d('0x3a')](_0x521f88[_0xa97d('0x2f')],_0x5a060f[_0xa97d('0x31')]));if(_0x521f88[_0xa97d('0x2f')][_0xa97d('0x3b')]){_0x2487ec[_0xa97d('0x39')]=_[_0xa97d('0x3c')](_0x2487ec[_0xa97d('0x39')],{'$or':_[_0xa97d('0x2b')](_0x2487ec[_0xa97d('0x32')],function(_0x35d928){var _0x26ed2a={};_0x26ed2a[_0x35d928]={'$like':'%'+_0x521f88[_0xa97d('0x2f')]['filter']+'%'};return _0x26ed2a;})});}_0x2487ec=_[_0xa97d('0x3c')]({},_0x2487ec,_0x521f88[_0xa97d('0x44')]);return _0x4852b9[_0xa97d('0x48')](_0x2487ec);}})[_0xa97d('0x24')](function(_0xbeb690){if(_0xbeb690){_0xf506a2=_0xbeb690[_0xa97d('0x35')];if(!_0x521f88[_0xa97d('0x2f')]['hasOwnProperty'](_0xa97d('0x4a'))){_0x2487ec[_0xa97d('0x1e')]=qs[_0xa97d('0x1e')](_0x521f88['query'][_0xa97d('0x1e')]);_0x2487ec[_0xa97d('0x1b')]=qs['offset'](_0x521f88[_0xa97d('0x2f')]['offset']);}return _0x4852b9[_0xa97d('0x48')](_0x2487ec);}})[_0xa97d('0x24')](function(_0x5f0827){if(_0x5f0827){return _0x5f0827?{'count':_0xf506a2,'rows':_0x5f0827}:null;}})['then'](respondWithResult(_0x334d89,null))[_0xa97d('0x40')](handleError(_0x334d89,null));};exports[_0xa97d('0x4b')]=function(_0x32874a,_0x20481d,_0x5ad03a){var _0x36f968={};var _0x352356={};var _0x5ce470;var _0x50dfbd;return db['VtigerConfiguration'][_0xa97d('0x4c')]({'where':{'id':_0x32874a[_0xa97d('0x42')]['id']}})['then'](handleEntityNotFound(_0x20481d,null))['then'](function(_0x514c1f){if(_0x514c1f){_0x5ce470=_0x514c1f;_0x352356[_0xa97d('0x2e')]=_[_0xa97d('0x30')](db[_0xa97d('0x49')][_0xa97d('0x43')]);_0x352356[_0xa97d('0x2f')]=_[_0xa97d('0x30')](_0x32874a[_0xa97d('0x2f')]);_0x352356[_0xa97d('0x31')]=_[_0xa97d('0x33')](_0x352356[_0xa97d('0x2e')],_0x352356[_0xa97d('0x2f')]);_0x36f968[_0xa97d('0x32')]=_[_0xa97d('0x33')](_0x352356[_0xa97d('0x2e')],qs[_0xa97d('0x34')](_0x32874a[_0xa97d('0x2f')][_0xa97d('0x34')]));_0x36f968[_0xa97d('0x32')]=_0x36f968[_0xa97d('0x32')][_0xa97d('0x35')]?_0x36f968[_0xa97d('0x32')]:_0x352356[_0xa97d('0x2e')];_0x36f968['order']=qs[_0xa97d('0x38')](_0x32874a['query'][_0xa97d('0x38')]);_0x36f968[_0xa97d('0x39')]=qs[_0xa97d('0x31')](_[_0xa97d('0x3a')](_0x32874a['query'],_0x352356['filters']));if(_0x32874a['query']['filter']){_0x36f968[_0xa97d('0x39')]=_[_0xa97d('0x3c')](_0x36f968[_0xa97d('0x39')],{'$or':_[_0xa97d('0x2b')](_0x36f968[_0xa97d('0x32')],function(_0x497ccd){var _0x52eea5={};_0x52eea5[_0x497ccd]={'$like':'%'+_0x32874a[_0xa97d('0x2f')][_0xa97d('0x3b')]+'%'};return _0x52eea5;})});}_0x36f968=_[_0xa97d('0x3c')]({},_0x36f968,_0x32874a[_0xa97d('0x44')]);return _0x5ce470['getSubjects'](_0x36f968);}})[_0xa97d('0x24')](function(_0x5228a0){if(_0x5228a0){_0x50dfbd=_0x5228a0['length'];if(!_0x32874a['query']['hasOwnProperty'](_0xa97d('0x4a'))){_0x36f968['limit']=qs[_0xa97d('0x1e')](_0x32874a[_0xa97d('0x2f')][_0xa97d('0x1e')]);_0x36f968[_0xa97d('0x1b')]=qs[_0xa97d('0x1b')](_0x32874a[_0xa97d('0x2f')][_0xa97d('0x1b')]);}return _0x5ce470['getSubjects'](_0x36f968);}})[_0xa97d('0x24')](function(_0x5d4283){if(_0x5d4283){return _0x5d4283?{'count':_0x50dfbd,'rows':_0x5d4283}:null;}})[_0xa97d('0x24')](respondWithResult(_0x20481d,null))[_0xa97d('0x40')](handleError(_0x20481d,null));};exports[_0xa97d('0x4d')]=function(_0x1b7a68,_0x1c55d2,_0x116061){var _0x21942c={};var _0x4de9c9={};var _0x176981;var _0xcca783;return db['VtigerConfiguration'][_0xa97d('0x4c')]({'where':{'id':_0x1b7a68['params']['id']}})['then'](handleEntityNotFound(_0x1c55d2,null))[_0xa97d('0x24')](function(_0x29f369){if(_0x29f369){_0x176981=_0x29f369;_0x4de9c9[_0xa97d('0x2e')]=_[_0xa97d('0x30')](db[_0xa97d('0x49')][_0xa97d('0x43')]);_0x4de9c9[_0xa97d('0x2f')]=_[_0xa97d('0x30')](_0x1b7a68[_0xa97d('0x2f')]);_0x4de9c9[_0xa97d('0x31')]=_[_0xa97d('0x33')](_0x4de9c9[_0xa97d('0x2e')],_0x4de9c9[_0xa97d('0x2f')]);_0x21942c[_0xa97d('0x32')]=_[_0xa97d('0x33')](_0x4de9c9[_0xa97d('0x2e')],qs[_0xa97d('0x34')](_0x1b7a68['query'][_0xa97d('0x34')]));_0x21942c['attributes']=_0x21942c[_0xa97d('0x32')]['length']?_0x21942c['attributes']:_0x4de9c9[_0xa97d('0x2e')];_0x21942c[_0xa97d('0x37')]=qs[_0xa97d('0x38')](_0x1b7a68['query'][_0xa97d('0x38')]);_0x21942c[_0xa97d('0x39')]=qs['filters'](_[_0xa97d('0x3a')](_0x1b7a68[_0xa97d('0x2f')],_0x4de9c9['filters']));if(_0x1b7a68[_0xa97d('0x2f')][_0xa97d('0x3b')]){_0x21942c['where']=_[_0xa97d('0x3c')](_0x21942c[_0xa97d('0x39')],{'$or':_[_0xa97d('0x2b')](_0x21942c[_0xa97d('0x32')],function(_0x2f7fbf){var _0x21fbdc={};_0x21fbdc[_0x2f7fbf]={'$like':'%'+_0x1b7a68['query'][_0xa97d('0x3b')]+'%'};return _0x21fbdc;})});}_0x21942c=_['merge']({},_0x21942c,_0x1b7a68['options']);return _0x176981[_0xa97d('0x4d')](_0x21942c);}})[_0xa97d('0x24')](function(_0x25ab01){if(_0x25ab01){_0xcca783=_0x25ab01[_0xa97d('0x35')];if(!_0x1b7a68[_0xa97d('0x2f')][_0xa97d('0x36')](_0xa97d('0x4a'))){_0x21942c[_0xa97d('0x1e')]=qs[_0xa97d('0x1e')](_0x1b7a68[_0xa97d('0x2f')]['limit']);_0x21942c[_0xa97d('0x1b')]=qs[_0xa97d('0x1b')](_0x1b7a68[_0xa97d('0x2f')][_0xa97d('0x1b')]);}return _0x176981[_0xa97d('0x4d')](_0x21942c);}})[_0xa97d('0x24')](function(_0x54ceac){if(_0x54ceac){return _0x54ceac?{'count':_0xcca783,'rows':_0x54ceac}:null;}})[_0xa97d('0x24')](respondWithResult(_0x1c55d2,null))[_0xa97d('0x40')](handleError(_0x1c55d2,null));}; \ No newline at end of file +var _0x87cb=['crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VtigerConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','fields','length','find','create','body','getFields','findOne','pick','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel'];(function(_0x6c33fd,_0x3a68da){var _0x3add18=function(_0x4f52aa){while(--_0x4f52aa){_0x6c33fd['push'](_0x6c33fd['shift']());}};_0x3add18(++_0x3a68da);}(_0x87cb,0xdc));var _0xb87c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x87cb[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xb87c('0x0'));var rimraf=require(_0xb87c('0x1'));var zipdir=require(_0xb87c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb87c('0x3'));var moment=require(_0xb87c('0x4'));var BPromise=require(_0xb87c('0x5'));var Mustache=require('mustache');var util=require(_0xb87c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb87c('0x7'));var ejs=require(_0xb87c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb87c('0x9'));var squel=require(_0xb87c('0xa'));var crypto=require(_0xb87c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb87c('0x7'));var querystring=require(_0xb87c('0xc'));var Papa=require('papaparse');var Redis=require(_0xb87c('0xd'));var authService=require(_0xb87c('0xe'));var qs=require(_0xb87c('0xf'));var as=require(_0xb87c('0x10'));var hardwareService=require(_0xb87c('0x11'));var logger=require(_0xb87c('0x12'))('api');var utils=require(_0xb87c('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb87c('0x14'))['db'];function respondWithStatusCode(_0x2606a4,_0x427ddf){_0x427ddf=_0x427ddf||0xcc;return function(_0x4b2407){if(_0x4b2407){return _0x2606a4[_0xb87c('0x15')](_0x427ddf);}return _0x2606a4[_0xb87c('0x16')](_0x427ddf)[_0xb87c('0x17')]();};}function respondWithResult(_0x2c56da,_0xa1a65d){_0xa1a65d=_0xa1a65d||0xc8;return function(_0xd69e3e){if(_0xd69e3e){return _0x2c56da['status'](_0xa1a65d)[_0xb87c('0x18')](_0xd69e3e);}};}function respondWithFilteredResult(_0x2d38bf,_0x215d83){return function(_0xaea86e){if(_0xaea86e){var _0x2621b7=typeof _0x215d83['offset']===_0xb87c('0x19')&&typeof _0x215d83[_0xb87c('0x1a')]===_0xb87c('0x19');var _0x38cc45=_0xaea86e[_0xb87c('0x1b')];var _0x3797c5=_0x2621b7?0x0:_0x215d83[_0xb87c('0x1c')];var _0x20dcbf=_0x2621b7?_0xaea86e['count']:_0x215d83[_0xb87c('0x1c')]+_0x215d83['limit'];var _0x13723c;if(_0x20dcbf>=_0x38cc45){_0x20dcbf=_0x38cc45;_0x13723c=0xc8;}else{_0x13723c=0xce;}_0x2d38bf[_0xb87c('0x16')](_0x13723c);return _0x2d38bf[_0xb87c('0x1d')](_0xb87c('0x1e'),_0x3797c5+'-'+_0x20dcbf+'/'+_0x38cc45)[_0xb87c('0x18')](_0xaea86e);}return null;};}function patchUpdates(_0x46f15b){return function(_0x5db5d0){try{jsonpatch[_0xb87c('0x1f')](_0x5db5d0,_0x46f15b,!![]);}catch(_0x22e853){return BPromise['reject'](_0x22e853);}return _0x5db5d0[_0xb87c('0x20')]();};}function saveUpdates(_0x3a5d83,_0x121970){return function(_0x27c135){if(_0x27c135){return _0x27c135[_0xb87c('0x21')](_0x3a5d83)[_0xb87c('0x22')](function(_0x270e88){return _0x270e88;});}return null;};}function removeEntity(_0x1e17e1,_0x51592a){return function(_0x113c8c){if(_0x113c8c){return _0x113c8c[_0xb87c('0x23')]()[_0xb87c('0x22')](function(){_0x1e17e1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56bccb,_0x3a4e5c){return function(_0x1fa1e0){if(!_0x1fa1e0){_0x56bccb[_0xb87c('0x15')](0x194);}return _0x1fa1e0;};}function handleError(_0x34ce42,_0x183848){_0x183848=_0x183848||0x1f4;return function(_0xaf0208){logger['error'](_0xaf0208[_0xb87c('0x24')]);if(_0xaf0208[_0xb87c('0x25')]){delete _0xaf0208[_0xb87c('0x25')];}_0x34ce42[_0xb87c('0x16')](_0x183848)[_0xb87c('0x26')](_0xaf0208);};}exports[_0xb87c('0x27')]=function(_0x3cea63,_0x5ac6e0){var _0x5ce03e={},_0x4a3c27={},_0xc114bc={'count':0x0,'rows':[]};var _0xd6c581=_['map'](db[_0xb87c('0x28')][_0xb87c('0x29')],function(_0x30b694){return{'name':_0x30b694[_0xb87c('0x2a')],'type':_0x30b694[_0xb87c('0x2b')][_0xb87c('0x2c')]};});_0x4a3c27[_0xb87c('0x2d')]=_[_0xb87c('0x2e')](_0xd6c581,'name');_0x4a3c27[_0xb87c('0x2f')]=_[_0xb87c('0x30')](_0x3cea63[_0xb87c('0x2f')]);_0x4a3c27[_0xb87c('0x31')]=_[_0xb87c('0x32')](_0x4a3c27[_0xb87c('0x2d')],_0x4a3c27[_0xb87c('0x2f')]);_0x5ce03e['attributes']=_['intersection'](_0x4a3c27[_0xb87c('0x2d')],qs['fields'](_0x3cea63['query']['fields']));_0x5ce03e[_0xb87c('0x33')]=_0x5ce03e[_0xb87c('0x33')]['length']?_0x5ce03e['attributes']:_0x4a3c27[_0xb87c('0x2d')];if(!_0x3cea63[_0xb87c('0x2f')]['hasOwnProperty'](_0xb87c('0x34'))){_0x5ce03e[_0xb87c('0x1a')]=qs[_0xb87c('0x1a')](_0x3cea63[_0xb87c('0x2f')][_0xb87c('0x1a')]);_0x5ce03e['offset']=qs[_0xb87c('0x1c')](_0x3cea63[_0xb87c('0x2f')]['offset']);}_0x5ce03e[_0xb87c('0x35')]=qs[_0xb87c('0x36')](_0x3cea63[_0xb87c('0x2f')]['sort']);_0x5ce03e[_0xb87c('0x37')]=qs[_0xb87c('0x31')](_['pick'](_0x3cea63[_0xb87c('0x2f')],_0x4a3c27[_0xb87c('0x31')]),_0xd6c581);if(_0x3cea63[_0xb87c('0x2f')][_0xb87c('0x38')]){_0x5ce03e[_0xb87c('0x37')]=_[_0xb87c('0x39')](_0x5ce03e[_0xb87c('0x37')],{'$or':_[_0xb87c('0x2e')](_0xd6c581,function(_0x2c2269){if(_0x2c2269['type']!==_0xb87c('0x3a')){var _0x1e734d={};_0x1e734d[_0x2c2269[_0xb87c('0x25')]]={'$like':'%'+_0x3cea63[_0xb87c('0x2f')][_0xb87c('0x38')]+'%'};return _0x1e734d;}})});}_0x5ce03e=_['merge']({},_0x5ce03e,_0x3cea63[_0xb87c('0x3b')]);var _0x41e1b8={'where':_0x5ce03e[_0xb87c('0x37')]};return db[_0xb87c('0x28')][_0xb87c('0x1b')](_0x41e1b8)[_0xb87c('0x22')](function(_0x5dd7b8){_0xc114bc['count']=_0x5dd7b8;if(_0x3cea63[_0xb87c('0x2f')][_0xb87c('0x3c')]){_0x5ce03e[_0xb87c('0x3d')]=[{'all':!![]}];}return db[_0xb87c('0x28')][_0xb87c('0x3e')](_0x5ce03e);})[_0xb87c('0x22')](function(_0x45580c){_0xc114bc['rows']=_0x45580c;return _0xc114bc;})[_0xb87c('0x22')](respondWithFilteredResult(_0x5ac6e0,_0x5ce03e))[_0xb87c('0x3f')](handleError(_0x5ac6e0,null));};exports[_0xb87c('0x40')]=function(_0x270139,_0x3e1690){var _0x37f1ea={'raw':![],'where':{'id':_0x270139[_0xb87c('0x41')]['id']}},_0x40b61c={};_0x40b61c[_0xb87c('0x2d')]=_[_0xb87c('0x30')](db[_0xb87c('0x28')][_0xb87c('0x29')]);_0x40b61c[_0xb87c('0x2f')]=_[_0xb87c('0x30')](_0x270139['query']);_0x40b61c[_0xb87c('0x31')]=_['intersection'](_0x40b61c[_0xb87c('0x2d')],_0x40b61c[_0xb87c('0x2f')]);_0x37f1ea[_0xb87c('0x33')]=_[_0xb87c('0x32')](_0x40b61c[_0xb87c('0x2d')],qs[_0xb87c('0x42')](_0x270139['query'][_0xb87c('0x42')]));_0x37f1ea['attributes']=_0x37f1ea[_0xb87c('0x33')][_0xb87c('0x43')]?_0x37f1ea[_0xb87c('0x33')]:_0x40b61c[_0xb87c('0x2d')];if(_0x270139['query']['includeAll']){_0x37f1ea[_0xb87c('0x3d')]=[{'all':!![]}];}_0x37f1ea=_[_0xb87c('0x39')]({},_0x37f1ea,_0x270139[_0xb87c('0x3b')]);return db[_0xb87c('0x28')][_0xb87c('0x44')](_0x37f1ea)[_0xb87c('0x22')](handleEntityNotFound(_0x3e1690,null))[_0xb87c('0x22')](respondWithResult(_0x3e1690,null))[_0xb87c('0x3f')](handleError(_0x3e1690,null));};exports[_0xb87c('0x45')]=function(_0x1a49e0,_0x41b1e2){return db['VtigerConfiguration'][_0xb87c('0x45')](_0x1a49e0[_0xb87c('0x46')],{})[_0xb87c('0x22')](respondWithResult(_0x41b1e2,0xc9))['catch'](handleError(_0x41b1e2,null));};exports[_0xb87c('0x21')]=function(_0x368154,_0x9a193e){if(_0x368154[_0xb87c('0x46')]['id']){delete _0x368154['body']['id'];}return db[_0xb87c('0x28')][_0xb87c('0x44')]({'where':{'id':_0x368154[_0xb87c('0x41')]['id']}})[_0xb87c('0x22')](handleEntityNotFound(_0x9a193e,null))[_0xb87c('0x22')](saveUpdates(_0x368154[_0xb87c('0x46')],null))['then'](respondWithResult(_0x9a193e,null))[_0xb87c('0x3f')](handleError(_0x9a193e,null));};exports[_0xb87c('0x23')]=function(_0x14e770,_0xa1db78){return db['VtigerConfiguration'][_0xb87c('0x44')]({'where':{'id':_0x14e770[_0xb87c('0x41')]['id']}})[_0xb87c('0x22')](handleEntityNotFound(_0xa1db78,null))[_0xb87c('0x22')](removeEntity(_0xa1db78,null))[_0xb87c('0x3f')](handleError(_0xa1db78,null));};exports[_0xb87c('0x47')]=function(_0x58b991,_0x41356c,_0x72022d){var _0x17c527={};var _0x57e71c={};var _0x4d0515;var _0x353b8d;return db['VtigerConfiguration'][_0xb87c('0x48')]({'where':{'id':_0x58b991[_0xb87c('0x41')]['id']}})['then'](handleEntityNotFound(_0x41356c,null))['then'](function(_0x5aa56e){if(_0x5aa56e){_0x4d0515=_0x5aa56e;_0x57e71c[_0xb87c('0x2d')]=_[_0xb87c('0x30')](db['VtigerField'][_0xb87c('0x29')]);_0x57e71c['query']=_[_0xb87c('0x30')](_0x58b991[_0xb87c('0x2f')]);_0x57e71c[_0xb87c('0x31')]=_[_0xb87c('0x32')](_0x57e71c[_0xb87c('0x2d')],_0x57e71c['query']);_0x17c527[_0xb87c('0x33')]=_['intersection'](_0x57e71c['model'],qs[_0xb87c('0x42')](_0x58b991['query'][_0xb87c('0x42')]));_0x17c527['attributes']=_0x17c527['attributes'][_0xb87c('0x43')]?_0x17c527[_0xb87c('0x33')]:_0x57e71c[_0xb87c('0x2d')];_0x17c527[_0xb87c('0x35')]=qs['sort'](_0x58b991['query']['sort']);_0x17c527[_0xb87c('0x37')]=qs[_0xb87c('0x31')](_[_0xb87c('0x49')](_0x58b991[_0xb87c('0x2f')],_0x57e71c['filters']));if(_0x58b991[_0xb87c('0x2f')][_0xb87c('0x38')]){_0x17c527['where']=_[_0xb87c('0x39')](_0x17c527[_0xb87c('0x37')],{'$or':_[_0xb87c('0x2e')](_0x17c527[_0xb87c('0x33')],function(_0x4ff767){var _0x1cf224={};_0x1cf224[_0x4ff767]={'$like':'%'+_0x58b991[_0xb87c('0x2f')][_0xb87c('0x38')]+'%'};return _0x1cf224;})});}_0x17c527=_[_0xb87c('0x39')]({},_0x17c527,_0x58b991[_0xb87c('0x3b')]);return _0x4d0515[_0xb87c('0x47')](_0x17c527);}})[_0xb87c('0x22')](function(_0x11abe1){if(_0x11abe1){_0x353b8d=_0x11abe1[_0xb87c('0x43')];if(!_0x58b991['query']['hasOwnProperty'](_0xb87c('0x34'))){_0x17c527[_0xb87c('0x1a')]=qs[_0xb87c('0x1a')](_0x58b991[_0xb87c('0x2f')][_0xb87c('0x1a')]);_0x17c527[_0xb87c('0x1c')]=qs[_0xb87c('0x1c')](_0x58b991[_0xb87c('0x2f')][_0xb87c('0x1c')]);}return _0x4d0515[_0xb87c('0x47')](_0x17c527);}})[_0xb87c('0x22')](function(_0x17d8e8){if(_0x17d8e8){return _0x17d8e8?{'count':_0x353b8d,'rows':_0x17d8e8}:null;}})[_0xb87c('0x22')](respondWithResult(_0x41356c,null))[_0xb87c('0x3f')](handleError(_0x41356c,null));};exports[_0xb87c('0x4a')]=function(_0x212d89,_0x52592e,_0x1864ce){var _0x11b71b={};var _0x2ca1e4={};var _0x344595;var _0x319982;return db[_0xb87c('0x28')][_0xb87c('0x48')]({'where':{'id':_0x212d89['params']['id']}})['then'](handleEntityNotFound(_0x52592e,null))[_0xb87c('0x22')](function(_0x324f5c){if(_0x324f5c){_0x344595=_0x324f5c;_0x2ca1e4['model']=_['keys'](db['VtigerField']['rawAttributes']);_0x2ca1e4[_0xb87c('0x2f')]=_[_0xb87c('0x30')](_0x212d89[_0xb87c('0x2f')]);_0x2ca1e4[_0xb87c('0x31')]=_[_0xb87c('0x32')](_0x2ca1e4[_0xb87c('0x2d')],_0x2ca1e4[_0xb87c('0x2f')]);_0x11b71b[_0xb87c('0x33')]=_[_0xb87c('0x32')](_0x2ca1e4[_0xb87c('0x2d')],qs[_0xb87c('0x42')](_0x212d89[_0xb87c('0x2f')][_0xb87c('0x42')]));_0x11b71b['attributes']=_0x11b71b[_0xb87c('0x33')]['length']?_0x11b71b[_0xb87c('0x33')]:_0x2ca1e4[_0xb87c('0x2d')];_0x11b71b['order']=qs[_0xb87c('0x36')](_0x212d89[_0xb87c('0x2f')][_0xb87c('0x36')]);_0x11b71b[_0xb87c('0x37')]=qs['filters'](_[_0xb87c('0x49')](_0x212d89[_0xb87c('0x2f')],_0x2ca1e4[_0xb87c('0x31')]));if(_0x212d89[_0xb87c('0x2f')][_0xb87c('0x38')]){_0x11b71b[_0xb87c('0x37')]=_['merge'](_0x11b71b[_0xb87c('0x37')],{'$or':_[_0xb87c('0x2e')](_0x11b71b[_0xb87c('0x33')],function(_0x24c55b){var _0x4d7eca={};_0x4d7eca[_0x24c55b]={'$like':'%'+_0x212d89['query'][_0xb87c('0x38')]+'%'};return _0x4d7eca;})});}_0x11b71b=_[_0xb87c('0x39')]({},_0x11b71b,_0x212d89[_0xb87c('0x3b')]);return _0x344595['getSubjects'](_0x11b71b);}})[_0xb87c('0x22')](function(_0x2c88cc){if(_0x2c88cc){_0x319982=_0x2c88cc[_0xb87c('0x43')];if(!_0x212d89['query'][_0xb87c('0x4b')](_0xb87c('0x34'))){_0x11b71b[_0xb87c('0x1a')]=qs[_0xb87c('0x1a')](_0x212d89[_0xb87c('0x2f')][_0xb87c('0x1a')]);_0x11b71b[_0xb87c('0x1c')]=qs[_0xb87c('0x1c')](_0x212d89[_0xb87c('0x2f')][_0xb87c('0x1c')]);}return _0x344595[_0xb87c('0x4a')](_0x11b71b);}})[_0xb87c('0x22')](function(_0x2e2648){if(_0x2e2648){return _0x2e2648?{'count':_0x319982,'rows':_0x2e2648}:null;}})[_0xb87c('0x22')](respondWithResult(_0x52592e,null))[_0xb87c('0x3f')](handleError(_0x52592e,null));};exports['getDescriptions']=function(_0x4a5e3b,_0x16ee07,_0x359d20){var _0x5e936c={};var _0x109ca4={};var _0x11e70b;var _0x3d4e0c;return db[_0xb87c('0x28')][_0xb87c('0x48')]({'where':{'id':_0x4a5e3b[_0xb87c('0x41')]['id']}})['then'](handleEntityNotFound(_0x16ee07,null))['then'](function(_0x21a3e0){if(_0x21a3e0){_0x11e70b=_0x21a3e0;_0x109ca4[_0xb87c('0x2d')]=_[_0xb87c('0x30')](db['VtigerField'][_0xb87c('0x29')]);_0x109ca4['query']=_['keys'](_0x4a5e3b['query']);_0x109ca4[_0xb87c('0x31')]=_['intersection'](_0x109ca4[_0xb87c('0x2d')],_0x109ca4['query']);_0x5e936c[_0xb87c('0x33')]=_[_0xb87c('0x32')](_0x109ca4[_0xb87c('0x2d')],qs['fields'](_0x4a5e3b[_0xb87c('0x2f')][_0xb87c('0x42')]));_0x5e936c[_0xb87c('0x33')]=_0x5e936c[_0xb87c('0x33')][_0xb87c('0x43')]?_0x5e936c[_0xb87c('0x33')]:_0x109ca4[_0xb87c('0x2d')];_0x5e936c[_0xb87c('0x35')]=qs['sort'](_0x4a5e3b['query']['sort']);_0x5e936c[_0xb87c('0x37')]=qs[_0xb87c('0x31')](_[_0xb87c('0x49')](_0x4a5e3b[_0xb87c('0x2f')],_0x109ca4['filters']));if(_0x4a5e3b[_0xb87c('0x2f')]['filter']){_0x5e936c[_0xb87c('0x37')]=_[_0xb87c('0x39')](_0x5e936c[_0xb87c('0x37')],{'$or':_['map'](_0x5e936c['attributes'],function(_0x341a60){var _0x18312a={};_0x18312a[_0x341a60]={'$like':'%'+_0x4a5e3b[_0xb87c('0x2f')][_0xb87c('0x38')]+'%'};return _0x18312a;})});}_0x5e936c=_[_0xb87c('0x39')]({},_0x5e936c,_0x4a5e3b[_0xb87c('0x3b')]);return _0x11e70b[_0xb87c('0x4c')](_0x5e936c);}})[_0xb87c('0x22')](function(_0x4723b8){if(_0x4723b8){_0x3d4e0c=_0x4723b8[_0xb87c('0x43')];if(!_0x4a5e3b['query'][_0xb87c('0x4b')](_0xb87c('0x34'))){_0x5e936c[_0xb87c('0x1a')]=qs[_0xb87c('0x1a')](_0x4a5e3b[_0xb87c('0x2f')][_0xb87c('0x1a')]);_0x5e936c[_0xb87c('0x1c')]=qs['offset'](_0x4a5e3b[_0xb87c('0x2f')][_0xb87c('0x1c')]);}return _0x11e70b[_0xb87c('0x4c')](_0x5e936c);}})[_0xb87c('0x22')](function(_0x104515){if(_0x104515){return _0x104515?{'count':_0x3d4e0c,'rows':_0x104515}:null;}})[_0xb87c('0x22')](respondWithResult(_0x16ee07,null))['catch'](handleError(_0x16ee07,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index b711390..c3329e5 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 _0xb7d7=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x480d79,_0x312de5){var _0x3b31b2=function(_0x510423){while(--_0x510423){_0x480d79['push'](_0x480d79['shift']());}};_0x3b31b2(++_0x312de5);}(_0xb7d7,0xe4));var _0x7b7d=function(_0x35ddbd,_0x5731e0){_0x35ddbd=_0x35ddbd-0x0;var _0xae88c6=_0xb7d7[_0x35ddbd];return _0xae88c6;};'use strict';var _=require(_0x7b7d('0x0'));var util=require(_0x7b7d('0x1'));var logger=require(_0x7b7d('0x2'))(_0x7b7d('0x3'));var moment=require('moment');var BPromise=require(_0x7b7d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b7d('0x5'));var rimraf=require(_0x7b7d('0x6'));var config=require(_0x7b7d('0x7'));var attributes=require(_0x7b7d('0x8'));module[_0x7b7d('0x9')]=function(_0x316ff1,_0x16ae7a){return _0x316ff1[_0x7b7d('0xa')](_0x7b7d('0xb'),attributes,{'tableName':_0x7b7d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1b8=['path','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations','util','api','moment','bluebird','request-promise'];(function(_0x2630eb,_0x11679c){var _0x552bec=function(_0x3719d7){while(--_0x3719d7){_0x2630eb['push'](_0x2630eb['shift']());}};_0x552bec(++_0x11679c);}(_0xe1b8,0x119));var _0x8e1b=function(_0xd89b56,_0x327810){_0xd89b56=_0xd89b56-0x0;var _0x4a1a21=_0xe1b8[_0xd89b56];return _0x4a1a21;};'use strict';var _=require('lodash');var util=require(_0x8e1b('0x0'));var logger=require('../../config/logger')(_0x8e1b('0x1'));var moment=require(_0x8e1b('0x2'));var BPromise=require(_0x8e1b('0x3'));var rp=require(_0x8e1b('0x4'));var fs=require('fs');var path=require(_0x8e1b('0x5'));var rimraf=require('rimraf');var config=require(_0x8e1b('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x8e1b('0x7')]=function(_0x1bf644,_0x5de53e){return _0x1bf644[_0x8e1b('0x8')](_0x8e1b('0x9'),attributes,{'tableName':_0x8e1b('0xa'),'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 3d22e75..3925433 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 _0x1d4e=['catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x4a91b0,_0x144c08){var _0x2bb6fc=function(_0x53c280){while(--_0x53c280){_0x4a91b0['push'](_0x4a91b0['shift']());}};_0x2bb6fc(++_0x144c08);}(_0x1d4e,0x13c));var _0xe1d4=function(_0x2aa3ef,_0x1b0227){_0x2aa3ef=_0x2aa3ef-0x0;var _0x2e80d1=_0x1d4e[_0x2aa3ef];return _0x2e80d1;};'use strict';var _=require('lodash');var util=require(_0xe1d4('0x0'));var moment=require('moment');var BPromise=require(_0xe1d4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe1d4('0x2'));var db=require(_0xe1d4('0x3'))['db'];var utils=require(_0xe1d4('0x4'));var logger=require('../../config/logger')(_0xe1d4('0x5'));var config=require(_0xe1d4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe1d4('0x7')][_0xe1d4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e324a,_0x1fc55b,_0xaab000){return new BPromise(function(_0x201cc0,_0x40bfc6){return client[_0xe1d4('0x9')](_0x5e324a,_0xaab000)[_0xe1d4('0xa')](function(_0x50201c){logger[_0xe1d4('0xb')](_0xe1d4('0xc'),_0x1fc55b,_0xe1d4('0xd'));logger[_0xe1d4('0xe')](_0xe1d4('0xf'),_0x1fc55b,_0xe1d4('0xd'),JSON['stringify'](_0x50201c));if(_0x50201c[_0xe1d4('0x10')]){if(_0x50201c[_0xe1d4('0x10')][_0xe1d4('0x11')]===0x1f4){logger[_0xe1d4('0x10')](_0xe1d4('0xc'),_0x1fc55b,_0x50201c[_0xe1d4('0x10')][_0xe1d4('0x12')]);return _0x40bfc6(_0x50201c[_0xe1d4('0x10')][_0xe1d4('0x12')]);}logger[_0xe1d4('0x10')](_0xe1d4('0xc'),_0x1fc55b,_0x50201c[_0xe1d4('0x10')][_0xe1d4('0x12')]);return _0x201cc0(_0x50201c[_0xe1d4('0x10')][_0xe1d4('0x12')]);}else{logger['info'](_0xe1d4('0xc'),_0x1fc55b,_0xe1d4('0xd'));_0x201cc0(_0x50201c[_0xe1d4('0x13')]['message']);}})[_0xe1d4('0x14')](function(_0x370230){logger[_0xe1d4('0x10')](_0xe1d4('0xc'),_0x1fc55b,_0x370230);_0x40bfc6(_0x370230);});});} \ No newline at end of file +var _0x0a39=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x0a39,0xda));var _0x90a3=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0a39[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x90a3('0x0'));var BPromise=require(_0x90a3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90a3('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x90a3('0x3'))(_0x90a3('0x4'));var config=require(_0x90a3('0x5'));var jayson=require(_0x90a3('0x6'));var client=jayson['client'][_0x90a3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1de74d,_0x2dbc9d,_0x5e916c){return new BPromise(function(_0x33b86c,_0x42f622){return client[_0x90a3('0x8')](_0x1de74d,_0x5e916c)['then'](function(_0x2069ec){logger[_0x90a3('0x9')](_0x90a3('0xa'),_0x2dbc9d,'request\x20sent');logger[_0x90a3('0xb')](_0x90a3('0xc'),_0x2dbc9d,_0x90a3('0xd'),JSON[_0x90a3('0xe')](_0x2069ec));if(_0x2069ec[_0x90a3('0xf')]){if(_0x2069ec[_0x90a3('0xf')][_0x90a3('0x10')]===0x1f4){logger[_0x90a3('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x2dbc9d,_0x2069ec['error'][_0x90a3('0x11')]);return _0x42f622(_0x2069ec[_0x90a3('0xf')][_0x90a3('0x11')]);}logger[_0x90a3('0xf')](_0x90a3('0xa'),_0x2dbc9d,_0x2069ec['error']['message']);return _0x33b86c(_0x2069ec[_0x90a3('0xf')]['message']);}else{logger[_0x90a3('0x9')]('VtigerConfiguration,\x20%s,\x20%s',_0x2dbc9d,_0x90a3('0xd'));_0x33b86c(_0x2069ec[_0x90a3('0x12')]['message']);}})[_0x90a3('0x13')](function(_0x49d475){logger[_0x90a3('0xf')](_0x90a3('0xa'),_0x2dbc9d,_0x49d475);_0x42f622(_0x49d475);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 2f3296e..cd864a7 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 _0xe51d=['index','get','post','create','put','/:id','update','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated'];(function(_0x5100e7,_0x134b0b){var _0x5afab8=function(_0x39e3f9){while(--_0x39e3f9){_0x5100e7['push'](_0x5100e7['shift']());}};_0x5afab8(++_0x134b0b);}(_0xe51d,0xab));var _0xde51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe51d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xde51('0x0'));var util=require(_0xde51('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xde51('0x2'));var router=express['Router']();var fs_extra=require(_0xde51('0x3'));var auth=require(_0xde51('0x4'));var interaction=require(_0xde51('0x5'));var config=require(_0xde51('0x6'));var controller=require(_0xde51('0x7'));router['get']('/',auth[_0xde51('0x8')](),controller[_0xde51('0x9')]);router[_0xde51('0xa')]('/:id',auth[_0xde51('0x8')](),controller['show']);router[_0xde51('0xb')]('/',auth[_0xde51('0x8')](),controller[_0xde51('0xc')]);router[_0xde51('0xd')](_0xde51('0xe'),auth[_0xde51('0x8')](),controller[_0xde51('0xf')]);router['delete'](_0xde51('0xe'),auth['isAuthenticated'](),controller[_0xde51('0x10')]);module[_0xde51('0x11')]=router; \ No newline at end of file +var _0xcb8a=['path','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x2ecc65,_0xd75c48){var _0x103cc3=function(_0x3f856b){while(--_0x3f856b){_0x2ecc65['push'](_0x2ecc65['shift']());}};_0x103cc3(++_0xd75c48);}(_0xcb8a,0x154));var _0xacb8=function(_0x51137b,_0x2f9dea){_0x51137b=_0x51137b-0x0;var _0x128885=_0xcb8a[_0x51137b];return _0x128885;};'use strict';var multer=require(_0xacb8('0x0'));var util=require(_0xacb8('0x1'));var path=require(_0xacb8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xacb8('0x3')]();var fs_extra=require(_0xacb8('0x4'));var auth=require(_0xacb8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xacb8('0x6'));var controller=require(_0xacb8('0x7'));router[_0xacb8('0x8')]('/',auth[_0xacb8('0x9')](),controller[_0xacb8('0xa')]);router[_0xacb8('0x8')](_0xacb8('0xb'),auth[_0xacb8('0x9')](),controller[_0xacb8('0xc')]);router[_0xacb8('0xd')]('/',auth['isAuthenticated'](),controller[_0xacb8('0xe')]);router[_0xacb8('0xf')](_0xacb8('0xb'),auth[_0xacb8('0x9')](),controller[_0xacb8('0x10')]);router['delete']('/:id',auth[_0xacb8('0x9')](),controller[_0xacb8('0x11')]);module[_0xacb8('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 894618b..f826350 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 _0xc0bb=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc0bb,0xd4));var _0xbc0b=function(_0x586837,_0x4f9ed1){_0x586837=_0x586837-0x0;var _0xea18c3=_0xc0bb[_0x586837];return _0xea18c3;};'use strict';var Sequelize=require(_0xbc0b('0x0'));module[_0xbc0b('0x1')]={'type':{'type':Sequelize[_0xbc0b('0x2')](_0xbc0b('0x3'),_0xbc0b('0x4'),_0xbc0b('0x5'),_0xbc0b('0x6'),_0xbc0b('0x7')),'defaultValue':_0xbc0b('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbc0b('0x2')]('string',_0xbc0b('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xbc0b('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xbc0b('0x8')]},'customField':{'type':Sequelize[_0xbc0b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbc0b('0x8')]}}; \ No newline at end of file +var _0xc601=['string','customVariable','picklist','STRING','variable','BOOLEAN','exports','ENUM'];(function(_0x19b980,_0x40c574){var _0x320fd8=function(_0x58f323){while(--_0x58f323){_0x19b980['push'](_0x19b980['shift']());}};_0x320fd8(++_0x40c574);}(_0xc601,0xfe));var _0x1c60=function(_0x547212,_0x3e0112){_0x547212=_0x547212-0x0;var _0x1366d5=_0xc601[_0x547212];return _0x1366d5;};'use strict';var Sequelize=require('sequelize');module[_0x1c60('0x0')]={'type':{'type':Sequelize[_0x1c60('0x1')](_0x1c60('0x2'),'variable',_0x1c60('0x3'),'keyValue',_0x1c60('0x4')),'defaultValue':_0x1c60('0x2')},'content':{'type':Sequelize[_0x1c60('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1c60('0x1')](_0x1c60('0x2'),_0x1c60('0x6'),_0x1c60('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1c60('0x5')]},'nameField':{'type':Sequelize[_0x1c60('0x5')]},'customField':{'type':Sequelize[_0x1c60('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 862739b..fe5d31f 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 _0x5409=['error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','type','VIRTUAL','options','include','rows','catch','params','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end'];(function(_0x5d9b23,_0x4b15ad){var _0x11aa9d=function(_0x366f4c){while(--_0x366f4c){_0x5d9b23['push'](_0x5d9b23['shift']());}};_0x11aa9d(++_0x4b15ad);}(_0x5409,0x1e6));var _0x9540=function(_0x473d85,_0x32e402){_0x473d85=_0x473d85-0x0;var _0x4de5a4=_0x5409[_0x473d85];return _0x4de5a4;};'use strict';var emlformat=require(_0x9540('0x0'));var rimraf=require(_0x9540('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9540('0x2'));var rp=require(_0x9540('0x3'));var moment=require(_0x9540('0x4'));var BPromise=require(_0x9540('0x5'));var Mustache=require(_0x9540('0x6'));var util=require(_0x9540('0x7'));var path=require(_0x9540('0x8'));var sox=require('sox');var csv=require(_0x9540('0x9'));var ejs=require(_0x9540('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9540('0xb'));var crypto=require('crypto');var jsforce=require(_0x9540('0xc'));var deskjs=require(_0x9540('0xd'));var toCsv=require(_0x9540('0x9'));var querystring=require(_0x9540('0xe'));var Papa=require('papaparse');var Redis=require(_0x9540('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9540('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9540('0x11'));var logger=require(_0x9540('0x12'))(_0x9540('0x13'));var utils=require('../../config/utils');var config=require(_0x9540('0x14'));var licenseUtil=require(_0x9540('0x15'));var db=require(_0x9540('0x16'))['db'];function respondWithStatusCode(_0x158075,_0x216e27){_0x216e27=_0x216e27||0xcc;return function(_0x3e2c17){if(_0x3e2c17){return _0x158075[_0x9540('0x17')](_0x216e27);}return _0x158075['status'](_0x216e27)['end']();};}function respondWithResult(_0x8845f9,_0x192b2d){_0x192b2d=_0x192b2d||0xc8;return function(_0x183cc7){if(_0x183cc7){return _0x8845f9[_0x9540('0x18')](_0x192b2d)[_0x9540('0x19')](_0x183cc7);}};}function respondWithFilteredResult(_0x47a080,_0x5147e5){return function(_0x4eb204){if(_0x4eb204){var _0x158049=typeof _0x5147e5[_0x9540('0x1a')]==='undefined'&&typeof _0x5147e5['limit']===_0x9540('0x1b');var _0x2cce65=_0x4eb204[_0x9540('0x1c')];var _0x67f3f9=_0x158049?0x0:_0x5147e5[_0x9540('0x1a')];var _0x4d342d=_0x158049?_0x4eb204[_0x9540('0x1c')]:_0x5147e5[_0x9540('0x1a')]+_0x5147e5[_0x9540('0x1d')];var _0x25a2f0;if(_0x4d342d>=_0x2cce65){_0x4d342d=_0x2cce65;_0x25a2f0=0xc8;}else{_0x25a2f0=0xce;}_0x47a080[_0x9540('0x18')](_0x25a2f0);return _0x47a080[_0x9540('0x1e')](_0x9540('0x1f'),_0x67f3f9+'-'+_0x4d342d+'/'+_0x2cce65)[_0x9540('0x19')](_0x4eb204);}return null;};}function patchUpdates(_0x11eb35){return function(_0x1aa364){try{jsonpatch[_0x9540('0x20')](_0x1aa364,_0x11eb35,!![]);}catch(_0x27a0fd){return BPromise[_0x9540('0x21')](_0x27a0fd);}return _0x1aa364[_0x9540('0x22')]();};}function saveUpdates(_0x339add,_0x3e71bd){return function(_0x13c4ce){if(_0x13c4ce){return _0x13c4ce[_0x9540('0x23')](_0x339add)[_0x9540('0x24')](function(_0x4985cd){return _0x4985cd;});}return null;};}function removeEntity(_0x264802,_0x436781){return function(_0x48e7d3){if(_0x48e7d3){return _0x48e7d3[_0x9540('0x25')]()[_0x9540('0x24')](function(){_0x264802[_0x9540('0x18')](0xcc)[_0x9540('0x26')]();});}};}function handleEntityNotFound(_0x4a6111,_0x19cd3f){return function(_0x2329b7){if(!_0x2329b7){_0x4a6111['sendStatus'](0x194);}return _0x2329b7;};}function handleError(_0x5046b4,_0x5304b7){_0x5304b7=_0x5304b7||0x1f4;return function(_0xb7df6c){logger[_0x9540('0x27')](_0xb7df6c[_0x9540('0x28')]);if(_0xb7df6c[_0x9540('0x29')]){delete _0xb7df6c[_0x9540('0x29')];}_0x5046b4[_0x9540('0x18')](_0x5304b7)[_0x9540('0x2a')](_0xb7df6c);};}exports[_0x9540('0x2b')]=function(_0x54aa20,_0x3870a7){var _0x9ec116={},_0x47e16b={},_0x2f174f={'count':0x0,'rows':[]};var _0x555741=_[_0x9540('0x2c')](db[_0x9540('0x2d')][_0x9540('0x2e')],function(_0x1971d5){return{'name':_0x1971d5[_0x9540('0x2f')],'type':_0x1971d5['type'][_0x9540('0x30')]};});_0x47e16b['model']=_[_0x9540('0x2c')](_0x555741,_0x9540('0x29'));_0x47e16b[_0x9540('0x31')]=_[_0x9540('0x32')](_0x54aa20['query']);_0x47e16b[_0x9540('0x33')]=_[_0x9540('0x34')](_0x47e16b[_0x9540('0x35')],_0x47e16b[_0x9540('0x31')]);_0x9ec116[_0x9540('0x36')]=_[_0x9540('0x34')](_0x47e16b[_0x9540('0x35')],qs[_0x9540('0x37')](_0x54aa20[_0x9540('0x31')][_0x9540('0x37')]));_0x9ec116[_0x9540('0x36')]=_0x9ec116['attributes'][_0x9540('0x38')]?_0x9ec116[_0x9540('0x36')]:_0x47e16b[_0x9540('0x35')];if(!_0x54aa20[_0x9540('0x31')][_0x9540('0x39')]('nolimit')){_0x9ec116[_0x9540('0x1d')]=qs[_0x9540('0x1d')](_0x54aa20[_0x9540('0x31')]['limit']);_0x9ec116[_0x9540('0x1a')]=qs[_0x9540('0x1a')](_0x54aa20[_0x9540('0x31')][_0x9540('0x1a')]);}_0x9ec116[_0x9540('0x3a')]=qs[_0x9540('0x3b')](_0x54aa20[_0x9540('0x31')][_0x9540('0x3b')]);_0x9ec116['where']=qs[_0x9540('0x33')](_[_0x9540('0x3c')](_0x54aa20[_0x9540('0x31')],_0x47e16b['filters']),_0x555741);if(_0x54aa20['query'][_0x9540('0x3d')]){_0x9ec116['where']=_[_0x9540('0x3e')](_0x9ec116[_0x9540('0x3f')],{'$or':_[_0x9540('0x2c')](_0x555741,function(_0x479f22){if(_0x479f22[_0x9540('0x40')]!==_0x9540('0x41')){var _0x6d4b8c={};_0x6d4b8c[_0x479f22['name']]={'$like':'%'+_0x54aa20[_0x9540('0x31')][_0x9540('0x3d')]+'%'};return _0x6d4b8c;}})});}_0x9ec116=_['merge']({},_0x9ec116,_0x54aa20[_0x9540('0x42')]);var _0xb83b15={'where':_0x9ec116[_0x9540('0x3f')]};return db[_0x9540('0x2d')][_0x9540('0x1c')](_0xb83b15)[_0x9540('0x24')](function(_0x55e28d){_0x2f174f[_0x9540('0x1c')]=_0x55e28d;if(_0x54aa20[_0x9540('0x31')]['includeAll']){_0x9ec116[_0x9540('0x43')]=[{'all':!![]}];}return db[_0x9540('0x2d')]['findAll'](_0x9ec116);})[_0x9540('0x24')](function(_0x33f0c4){_0x2f174f[_0x9540('0x44')]=_0x33f0c4;return _0x2f174f;})[_0x9540('0x24')](respondWithFilteredResult(_0x3870a7,_0x9ec116))[_0x9540('0x45')](handleError(_0x3870a7,null));};exports['show']=function(_0x1dad7a,_0x5e1116){var _0x37db4d={'raw':!![],'where':{'id':_0x1dad7a[_0x9540('0x46')]['id']}},_0x4e6705={};_0x4e6705[_0x9540('0x35')]=_[_0x9540('0x32')](db[_0x9540('0x2d')][_0x9540('0x2e')]);_0x4e6705[_0x9540('0x31')]=_[_0x9540('0x32')](_0x1dad7a[_0x9540('0x31')]);_0x4e6705['filters']=_[_0x9540('0x34')](_0x4e6705[_0x9540('0x35')],_0x4e6705['query']);_0x37db4d['attributes']=_[_0x9540('0x34')](_0x4e6705[_0x9540('0x35')],qs[_0x9540('0x37')](_0x1dad7a[_0x9540('0x31')][_0x9540('0x37')]));_0x37db4d['attributes']=_0x37db4d['attributes'][_0x9540('0x38')]?_0x37db4d[_0x9540('0x36')]:_0x4e6705[_0x9540('0x35')];if(_0x1dad7a[_0x9540('0x31')][_0x9540('0x47')]){_0x37db4d[_0x9540('0x43')]=[{'all':!![]}];}_0x37db4d=_[_0x9540('0x3e')]({},_0x37db4d,_0x1dad7a[_0x9540('0x42')]);return db[_0x9540('0x2d')][_0x9540('0x48')](_0x37db4d)[_0x9540('0x24')](handleEntityNotFound(_0x5e1116,null))[_0x9540('0x24')](respondWithResult(_0x5e1116,null))[_0x9540('0x45')](handleError(_0x5e1116,null));};exports[_0x9540('0x49')]=function(_0x2dfe0f,_0x540ada){return db[_0x9540('0x2d')][_0x9540('0x49')](_0x2dfe0f[_0x9540('0x4a')],{})['then'](respondWithResult(_0x540ada,0xc9))[_0x9540('0x45')](handleError(_0x540ada,null));};exports[_0x9540('0x23')]=function(_0x6a7bf,_0x4cc0fd){if(_0x6a7bf[_0x9540('0x4a')]['id']){delete _0x6a7bf[_0x9540('0x4a')]['id'];}return db[_0x9540('0x2d')]['find']({'where':{'id':_0x6a7bf[_0x9540('0x46')]['id']}})[_0x9540('0x24')](handleEntityNotFound(_0x4cc0fd,null))[_0x9540('0x24')](saveUpdates(_0x6a7bf[_0x9540('0x4a')],null))[_0x9540('0x24')](respondWithResult(_0x4cc0fd,null))[_0x9540('0x45')](handleError(_0x4cc0fd,null));};exports[_0x9540('0x25')]=function(_0x2fb6cd,_0x1ee444){return db['VtigerField'][_0x9540('0x48')]({'where':{'id':_0x2fb6cd[_0x9540('0x46')]['id']}})[_0x9540('0x24')](handleEntityNotFound(_0x1ee444,null))[_0x9540('0x24')](removeEntity(_0x1ee444,null))['catch'](handleError(_0x1ee444,null));}; \ No newline at end of file +var _0x4ca0=['filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','error','stack','send','map','VtigerField','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x4f01de,_0x1ec9f6){var _0x22ae66=function(_0x1ddd95){while(--_0x1ddd95){_0x4f01de['push'](_0x4f01de['shift']());}};_0x22ae66(++_0x1ec9f6);}(_0x4ca0,0xf3));var _0x04ca=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x4ca0[_0x164eca];return _0x2ce562;};'use strict';var emlformat=require(_0x04ca('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x04ca('0x1'));var rp=require(_0x04ca('0x2'));var moment=require(_0x04ca('0x3'));var BPromise=require(_0x04ca('0x4'));var Mustache=require(_0x04ca('0x5'));var util=require(_0x04ca('0x6'));var path=require(_0x04ca('0x7'));var sox=require(_0x04ca('0x8'));var csv=require(_0x04ca('0x9'));var ejs=require(_0x04ca('0xa'));var fs=require('fs');var fs_extra=require(_0x04ca('0xb'));var _=require(_0x04ca('0xc'));var squel=require('squel');var crypto=require(_0x04ca('0xd'));var jsforce=require(_0x04ca('0xe'));var deskjs=require(_0x04ca('0xf'));var toCsv=require(_0x04ca('0x9'));var querystring=require(_0x04ca('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x04ca('0x11'));var qs=require(_0x04ca('0x12'));var as=require(_0x04ca('0x13'));var hardwareService=require(_0x04ca('0x14'));var logger=require('../../config/logger')(_0x04ca('0x15'));var utils=require('../../config/utils');var config=require(_0x04ca('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x04ca('0x17'))['db'];function respondWithStatusCode(_0x31168e,_0x199062){_0x199062=_0x199062||0xcc;return function(_0x16d345){if(_0x16d345){return _0x31168e[_0x04ca('0x18')](_0x199062);}return _0x31168e[_0x04ca('0x19')](_0x199062)[_0x04ca('0x1a')]();};}function respondWithResult(_0x31d233,_0x19a51e){_0x19a51e=_0x19a51e||0xc8;return function(_0x265045){if(_0x265045){return _0x31d233['status'](_0x19a51e)[_0x04ca('0x1b')](_0x265045);}};}function respondWithFilteredResult(_0x393328,_0x485084){return function(_0x315706){if(_0x315706){var _0x53c4e8=typeof _0x485084[_0x04ca('0x1c')]==='undefined'&&typeof _0x485084[_0x04ca('0x1d')]===_0x04ca('0x1e');var _0x48231d=_0x315706[_0x04ca('0x1f')];var _0x52b5a0=_0x53c4e8?0x0:_0x485084[_0x04ca('0x1c')];var _0x3c167e=_0x53c4e8?_0x315706['count']:_0x485084['offset']+_0x485084[_0x04ca('0x1d')];var _0x1606c2;if(_0x3c167e>=_0x48231d){_0x3c167e=_0x48231d;_0x1606c2=0xc8;}else{_0x1606c2=0xce;}_0x393328[_0x04ca('0x19')](_0x1606c2);return _0x393328['set'](_0x04ca('0x20'),_0x52b5a0+'-'+_0x3c167e+'/'+_0x48231d)['json'](_0x315706);}return null;};}function patchUpdates(_0x41b24d){return function(_0x52f3df){try{jsonpatch[_0x04ca('0x21')](_0x52f3df,_0x41b24d,!![]);}catch(_0x1f975f){return BPromise[_0x04ca('0x22')](_0x1f975f);}return _0x52f3df['save']();};}function saveUpdates(_0x5601ae,_0x20972f){return function(_0x21344f){if(_0x21344f){return _0x21344f[_0x04ca('0x23')](_0x5601ae)['then'](function(_0xff4dd2){return _0xff4dd2;});}return null;};}function removeEntity(_0x4aab21,_0x5d69c4){return function(_0x5e5a8c){if(_0x5e5a8c){return _0x5e5a8c['destroy']()[_0x04ca('0x24')](function(){_0x4aab21[_0x04ca('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3746a4,_0x579563){return function(_0x223fdb){if(!_0x223fdb){_0x3746a4[_0x04ca('0x18')](0x194);}return _0x223fdb;};}function handleError(_0x18c3d5,_0x1acf84){_0x1acf84=_0x1acf84||0x1f4;return function(_0x40174e){logger[_0x04ca('0x25')](_0x40174e[_0x04ca('0x26')]);if(_0x40174e['name']){delete _0x40174e['name'];}_0x18c3d5[_0x04ca('0x19')](_0x1acf84)[_0x04ca('0x27')](_0x40174e);};}exports['index']=function(_0x44e91b,_0x528f80){var _0x5cf6c3={},_0x530b40={},_0x1d8b0e={'count':0x0,'rows':[]};var _0x4be0e1=_[_0x04ca('0x28')](db[_0x04ca('0x29')][_0x04ca('0x2a')],function(_0x443ce9){return{'name':_0x443ce9[_0x04ca('0x2b')],'type':_0x443ce9[_0x04ca('0x2c')][_0x04ca('0x2d')]};});_0x530b40[_0x04ca('0x2e')]=_[_0x04ca('0x28')](_0x4be0e1,_0x04ca('0x2f'));_0x530b40['query']=_['keys'](_0x44e91b[_0x04ca('0x30')]);_0x530b40[_0x04ca('0x31')]=_[_0x04ca('0x32')](_0x530b40['model'],_0x530b40[_0x04ca('0x30')]);_0x5cf6c3[_0x04ca('0x33')]=_[_0x04ca('0x32')](_0x530b40[_0x04ca('0x2e')],qs[_0x04ca('0x34')](_0x44e91b[_0x04ca('0x30')][_0x04ca('0x34')]));_0x5cf6c3[_0x04ca('0x33')]=_0x5cf6c3[_0x04ca('0x33')][_0x04ca('0x35')]?_0x5cf6c3[_0x04ca('0x33')]:_0x530b40[_0x04ca('0x2e')];if(!_0x44e91b['query']['hasOwnProperty'](_0x04ca('0x36'))){_0x5cf6c3[_0x04ca('0x1d')]=qs[_0x04ca('0x1d')](_0x44e91b[_0x04ca('0x30')][_0x04ca('0x1d')]);_0x5cf6c3[_0x04ca('0x1c')]=qs[_0x04ca('0x1c')](_0x44e91b[_0x04ca('0x30')][_0x04ca('0x1c')]);}_0x5cf6c3['order']=qs[_0x04ca('0x37')](_0x44e91b[_0x04ca('0x30')]['sort']);_0x5cf6c3['where']=qs[_0x04ca('0x31')](_[_0x04ca('0x38')](_0x44e91b[_0x04ca('0x30')],_0x530b40[_0x04ca('0x31')]),_0x4be0e1);if(_0x44e91b[_0x04ca('0x30')][_0x04ca('0x39')]){_0x5cf6c3['where']=_[_0x04ca('0x3a')](_0x5cf6c3[_0x04ca('0x3b')],{'$or':_[_0x04ca('0x28')](_0x4be0e1,function(_0x584406){if(_0x584406['type']!==_0x04ca('0x3c')){var _0x472f0c={};_0x472f0c[_0x584406[_0x04ca('0x2f')]]={'$like':'%'+_0x44e91b[_0x04ca('0x30')]['filter']+'%'};return _0x472f0c;}})});}_0x5cf6c3=_[_0x04ca('0x3a')]({},_0x5cf6c3,_0x44e91b[_0x04ca('0x3d')]);var _0x1c0ddc={'where':_0x5cf6c3['where']};return db[_0x04ca('0x29')]['count'](_0x1c0ddc)[_0x04ca('0x24')](function(_0x1b1da3){_0x1d8b0e[_0x04ca('0x1f')]=_0x1b1da3;if(_0x44e91b[_0x04ca('0x30')][_0x04ca('0x3e')]){_0x5cf6c3[_0x04ca('0x3f')]=[{'all':!![]}];}return db['VtigerField'][_0x04ca('0x40')](_0x5cf6c3);})[_0x04ca('0x24')](function(_0x24bbd6){_0x1d8b0e[_0x04ca('0x41')]=_0x24bbd6;return _0x1d8b0e;})[_0x04ca('0x24')](respondWithFilteredResult(_0x528f80,_0x5cf6c3))[_0x04ca('0x42')](handleError(_0x528f80,null));};exports[_0x04ca('0x43')]=function(_0x1c1a2d,_0x352a0a){var _0x3dbb99={'raw':!![],'where':{'id':_0x1c1a2d[_0x04ca('0x44')]['id']}},_0x453e9a={};_0x453e9a[_0x04ca('0x2e')]=_['keys'](db[_0x04ca('0x29')][_0x04ca('0x2a')]);_0x453e9a['query']=_['keys'](_0x1c1a2d['query']);_0x453e9a[_0x04ca('0x31')]=_['intersection'](_0x453e9a[_0x04ca('0x2e')],_0x453e9a['query']);_0x3dbb99['attributes']=_[_0x04ca('0x32')](_0x453e9a['model'],qs['fields'](_0x1c1a2d[_0x04ca('0x30')]['fields']));_0x3dbb99[_0x04ca('0x33')]=_0x3dbb99[_0x04ca('0x33')][_0x04ca('0x35')]?_0x3dbb99[_0x04ca('0x33')]:_0x453e9a[_0x04ca('0x2e')];if(_0x1c1a2d[_0x04ca('0x30')][_0x04ca('0x3e')]){_0x3dbb99['include']=[{'all':!![]}];}_0x3dbb99=_[_0x04ca('0x3a')]({},_0x3dbb99,_0x1c1a2d[_0x04ca('0x3d')]);return db[_0x04ca('0x29')][_0x04ca('0x45')](_0x3dbb99)[_0x04ca('0x24')](handleEntityNotFound(_0x352a0a,null))[_0x04ca('0x24')](respondWithResult(_0x352a0a,null))['catch'](handleError(_0x352a0a,null));};exports[_0x04ca('0x46')]=function(_0x2551cc,_0x46bc6d){return db[_0x04ca('0x29')][_0x04ca('0x46')](_0x2551cc[_0x04ca('0x47')],{})['then'](respondWithResult(_0x46bc6d,0xc9))[_0x04ca('0x42')](handleError(_0x46bc6d,null));};exports[_0x04ca('0x23')]=function(_0x2f9eec,_0x147068){if(_0x2f9eec[_0x04ca('0x47')]['id']){delete _0x2f9eec[_0x04ca('0x47')]['id'];}return db[_0x04ca('0x29')]['find']({'where':{'id':_0x2f9eec[_0x04ca('0x44')]['id']}})[_0x04ca('0x24')](handleEntityNotFound(_0x147068,null))['then'](saveUpdates(_0x2f9eec[_0x04ca('0x47')],null))[_0x04ca('0x24')](respondWithResult(_0x147068,null))[_0x04ca('0x42')](handleError(_0x147068,null));};exports[_0x04ca('0x48')]=function(_0x3c49ce,_0x11e169){return db['VtigerField'][_0x04ca('0x45')]({'where':{'id':_0x3c49ce[_0x04ca('0x44')]['id']}})[_0x04ca('0x24')](handleEntityNotFound(_0x11e169,null))[_0x04ca('0x24')](removeEntity(_0x11e169,null))[_0x04ca('0x42')](handleError(_0x11e169,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 5d1c933..6e2887e 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 _0x5eb3=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash'];(function(_0xf2f332,_0x299fbf){var _0x56cce3=function(_0x5f37e0){while(--_0x5f37e0){_0xf2f332['push'](_0xf2f332['shift']());}};_0x56cce3(++_0x299fbf);}(_0x5eb3,0x10f));var _0x35eb=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x5eb3[_0x4b73a2];return _0x383c66;};'use strict';var _=require(_0x35eb('0x0'));var util=require(_0x35eb('0x1'));var logger=require(_0x35eb('0x2'))(_0x35eb('0x3'));var moment=require(_0x35eb('0x4'));var BPromise=require(_0x35eb('0x5'));var rp=require(_0x35eb('0x6'));var fs=require('fs');var path=require(_0x35eb('0x7'));var rimraf=require(_0x35eb('0x8'));var config=require('../../config/environment');var attributes=require(_0x35eb('0x9'));module[_0x35eb('0xa')]=function(_0x6ab588,_0x3d247f){return _0x6ab588[_0x35eb('0xb')](_0x35eb('0xc'),attributes,{'tableName':_0x35eb('0xd'),'paranoid':![],'indexes':[{'name':_0x35eb('0xe'),'fields':[_0x35eb('0xf'),_0x35eb('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3099=['VtigerField','vtiger_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','define'];(function(_0x5e2fa2,_0xfb00c4){var _0x1e9c17=function(_0x42d007){while(--_0x42d007){_0x5e2fa2['push'](_0x5e2fa2['shift']());}};_0x1e9c17(++_0xfb00c4);}(_0x3099,0x1f2));var _0x9309=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3099[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x9309('0x0'));var logger=require(_0x9309('0x1'))('api');var moment=require(_0x9309('0x2'));var BPromise=require(_0x9309('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9309('0x4'));var rimraf=require(_0x9309('0x5'));var config=require(_0x9309('0x6'));var attributes=require(_0x9309('0x7'));module['exports']=function(_0x457331,_0x29a00f){return _0x457331[_0x9309('0x8')](_0x9309('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x9309('0xa'),'fields':[_0x9309('0xb'),_0x9309('0xc')],'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 ea41121..279db35 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 _0x96c3=['error','code','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x96c3,0x1df));var _0x396c=function(_0x3a94b2,_0x233396){_0x3a94b2=_0x3a94b2-0x0;var _0x63c015=_0x96c3[_0x3a94b2];return _0x63c015;};'use strict';var _=require('lodash');var util=require(_0x396c('0x0'));var moment=require('moment');var BPromise=require(_0x396c('0x1'));var rs=require(_0x396c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x396c('0x3'))['db'];var utils=require(_0x396c('0x4'));var logger=require(_0x396c('0x5'))(_0x396c('0x6'));var config=require('../../config/environment');var jayson=require(_0x396c('0x7'));var client=jayson['client'][_0x396c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24580b,_0x86216e,_0x4c0f89){return new BPromise(function(_0x4d0e04,_0x20c62f){return client[_0x396c('0x9')](_0x24580b,_0x4c0f89)[_0x396c('0xa')](function(_0x457967){logger['info'](_0x396c('0xb'),_0x86216e,_0x396c('0xc'));logger[_0x396c('0xd')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x86216e,_0x396c('0xc'),JSON[_0x396c('0xe')](_0x457967));if(_0x457967[_0x396c('0xf')]){if(_0x457967[_0x396c('0xf')][_0x396c('0x10')]===0x1f4){logger[_0x396c('0xf')](_0x396c('0xb'),_0x86216e,_0x457967[_0x396c('0xf')][_0x396c('0x11')]);return _0x20c62f(_0x457967[_0x396c('0xf')][_0x396c('0x11')]);}logger[_0x396c('0xf')]('VtigerField,\x20%s,\x20%s',_0x86216e,_0x457967[_0x396c('0xf')][_0x396c('0x11')]);return _0x4d0e04(_0x457967[_0x396c('0xf')][_0x396c('0x11')]);}else{logger['info'](_0x396c('0xb'),_0x86216e,'request\x20sent');_0x4d0e04(_0x457967['result']['message']);}})[_0x396c('0x12')](function(_0x52ab7f){logger['error'](_0x396c('0xb'),_0x86216e,_0x52ab7f);_0x20c62f(_0x52ab7f);});});} \ No newline at end of file +var _0x6899=['VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x34f273,_0x37a8c3){var _0x1f2544=function(_0x1b9a6b){while(--_0x1b9a6b){_0x34f273['push'](_0x34f273['shift']());}};_0x1f2544(++_0x37a8c3);}(_0x6899,0x132));var _0x9689=function(_0x598172,_0x5c1277){_0x598172=_0x598172-0x0;var _0x255d30=_0x6899[_0x598172];return _0x255d30;};'use strict';var _=require(_0x9689('0x0'));var util=require(_0x9689('0x1'));var moment=require(_0x9689('0x2'));var BPromise=require(_0x9689('0x3'));var rs=require(_0x9689('0x4'));var fs=require('fs');var Redis=require(_0x9689('0x5'));var db=require(_0x9689('0x6'))['db'];var utils=require(_0x9689('0x7'));var logger=require(_0x9689('0x8'))(_0x9689('0x9'));var config=require('../../config/environment');var jayson=require(_0x9689('0xa'));var client=jayson[_0x9689('0xb')][_0x9689('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xbcf078,_0x1c2ebe,_0x144582){return new BPromise(function(_0x244f4c,_0xbe8c9f){return client[_0x9689('0xd')](_0xbcf078,_0x144582)[_0x9689('0xe')](function(_0x377525){logger[_0x9689('0xf')](_0x9689('0x10'),_0x1c2ebe,_0x9689('0x11'));logger[_0x9689('0x12')](_0x9689('0x13'),_0x1c2ebe,_0x9689('0x11'),JSON[_0x9689('0x14')](_0x377525));if(_0x377525[_0x9689('0x15')]){if(_0x377525['error'][_0x9689('0x16')]===0x1f4){logger[_0x9689('0x15')]('VtigerField,\x20%s,\x20%s',_0x1c2ebe,_0x377525[_0x9689('0x15')]['message']);return _0xbe8c9f(_0x377525[_0x9689('0x15')][_0x9689('0x17')]);}logger[_0x9689('0x15')](_0x9689('0x10'),_0x1c2ebe,_0x377525['error'][_0x9689('0x17')]);return _0x244f4c(_0x377525[_0x9689('0x15')]['message']);}else{logger[_0x9689('0xf')]('VtigerField,\x20%s,\x20%s',_0x1c2ebe,_0x9689('0x11'));_0x244f4c(_0x377525['result'][_0x9689('0x17')]);}})[_0x9689('0x18')](function(_0x26ab12){logger[_0x9689('0x15')]('VtigerField,\x20%s,\x20%s',_0x1c2ebe,_0x26ab12);_0xbe8c9f(_0x26ab12);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 4c2dc88..229f4f1 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 _0xfbb3=['delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xfbb3,0x17c));var _0x3fbb=function(_0x3483eb,_0x1f5d3e){_0x3483eb=_0x3483eb-0x0;var _0x4f3867=_0xfbb3[_0x3483eb];return _0x4f3867;};'use strict';var multer=require('multer');var util=require(_0x3fbb('0x0'));var path=require(_0x3fbb('0x1'));var timeout=require('connect-timeout');var express=require(_0x3fbb('0x2'));var router=express[_0x3fbb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3fbb('0x4'));var interaction=require(_0x3fbb('0x5'));var config=require(_0x3fbb('0x6'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x3fbb('0x7')](),controller[_0x3fbb('0x8')]);router[_0x3fbb('0x9')](_0x3fbb('0xa'),auth['isAuthenticated'](),controller[_0x3fbb('0xb')]);router[_0x3fbb('0x9')](_0x3fbb('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x3fbb('0x9')](_0x3fbb('0xd'),auth[_0x3fbb('0x7')](),controller['getFields']);router[_0x3fbb('0xe')]('/',auth[_0x3fbb('0x7')](),controller[_0x3fbb('0xf')]);router[_0x3fbb('0xe')](_0x3fbb('0xc'),auth[_0x3fbb('0x7')](),controller[_0x3fbb('0x10')]);router[_0x3fbb('0x11')](_0x3fbb('0xa'),auth['isAuthenticated'](),controller[_0x3fbb('0x12')]);router[_0x3fbb('0x13')](_0x3fbb('0xa'),auth[_0x3fbb('0x7')](),controller[_0x3fbb('0x14')]);module['exports']=router; \ No newline at end of file +var _0x01d7=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x01d7,0x9f));var _0x701d=function(_0x54b952,_0x2a282e){_0x54b952=_0x54b952-0x0;var _0x4b062e=_0x01d7[_0x54b952];return _0x4b062e;};'use strict';var multer=require(_0x701d('0x0'));var util=require(_0x701d('0x1'));var path=require(_0x701d('0x2'));var timeout=require(_0x701d('0x3'));var express=require(_0x701d('0x4'));var router=express[_0x701d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x701d('0x6'));var interaction=require(_0x701d('0x7'));var config=require(_0x701d('0x8'));var controller=require(_0x701d('0x9'));router[_0x701d('0xa')]('/',auth[_0x701d('0xb')](),controller[_0x701d('0xc')]);router[_0x701d('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x701d('0xa')]('/:id/configurations',auth[_0x701d('0xb')](),controller[_0x701d('0xd')]);router[_0x701d('0xa')](_0x701d('0xe'),auth['isAuthenticated'](),controller[_0x701d('0xf')]);router[_0x701d('0x10')]('/',auth[_0x701d('0xb')](),controller[_0x701d('0x11')]);router['post'](_0x701d('0x12'),auth[_0x701d('0xb')](),controller[_0x701d('0x13')]);router[_0x701d('0x14')](_0x701d('0x15'),auth[_0x701d('0xb')](),controller[_0x701d('0x16')]);router[_0x701d('0x17')](_0x701d('0x15'),auth[_0x701d('0xb')](),controller[_0x701d('0x18')]);module[_0x701d('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 0be1391..526f90d 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 _0x6455=['STRING','username','remoteUri','ENUM','password','token','integrationTab','sequelize'];(function(_0x523976,_0x2a80f6){var _0x51900f=function(_0x1b7dc4){while(--_0x1b7dc4){_0x523976['push'](_0x523976['shift']());}};_0x51900f(++_0x2a80f6);}(_0x6455,0x97));var _0x5645=function(_0x527b45,_0x2f2edb){_0x527b45=_0x527b45-0x0;var _0xd02f61=_0x6455[_0x527b45];return _0xd02f61;};'use strict';var Sequelize=require(_0x5645('0x0'));module['exports']={'name':{'type':Sequelize[_0x5645('0x1')]},'description':{'type':Sequelize[_0x5645('0x1')]},'username':{'type':Sequelize[_0x5645('0x1')],'unique':_0x5645('0x2')},'password':{'type':Sequelize[_0x5645('0x1')]},'token':{'type':Sequelize[_0x5645('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x5645('0x3')},'authType':{'type':Sequelize[_0x5645('0x4')](_0x5645('0x5'),_0x5645('0x6')),'defaultValue':_0x5645('0x5')},'serverUrl':{'type':Sequelize[_0x5645('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5645('0x4')](_0x5645('0x7'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x0650=['password','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x222179,_0x2d1e07){var _0x230581=function(_0x23371d){while(--_0x23371d){_0x222179['push'](_0x222179['shift']());}};_0x230581(++_0x2d1e07);}(_0x0650,0x1aa));var _0x0065=function(_0x206711,_0x4125b4){_0x206711=_0x206711-0x0;var _0x4fe02b=_0x0650[_0x206711];return _0x4fe02b;};'use strict';var Sequelize=require(_0x0065('0x0'));module[_0x0065('0x1')]={'name':{'type':Sequelize[_0x0065('0x2')]},'description':{'type':Sequelize[_0x0065('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x0065('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0065('0x2')],'unique':_0x0065('0x4')},'authType':{'type':Sequelize[_0x0065('0x5')]('password','token'),'defaultValue':_0x0065('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':_0x0065('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 6344d49..ac5cb76 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 _0x9c00=['options','getConfigurations','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','ZendeskConfiguration','ZendeskField','Subjects','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','%s:%s','toString','base64','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','includeAll','include','findAll','catch','show','find','create','body','update','params','destroy','findOne','filter'];(function(_0x270f89,_0x4c12d7){var _0x587b0b=function(_0xfbf346){while(--_0xfbf346){_0x270f89['push'](_0x270f89['shift']());}};_0x587b0b(++_0x4c12d7);}(_0x9c00,0x1a0));var _0x09c0=function(_0x5ecde7,_0x411905){_0x5ecde7=_0x5ecde7-0x0;var _0x4c037e=_0x9c00[_0x5ecde7];return _0x4c037e;};'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'];var integrations=require(_0x09c0('0x1b'));function respondWithStatusCode(_0x3b95cc,_0x331905){_0x331905=_0x331905||0xcc;return function(_0x6149a8){if(_0x6149a8){return _0x3b95cc[_0x09c0('0x1c')](_0x331905);}return _0x3b95cc[_0x09c0('0x1d')](_0x331905)[_0x09c0('0x1e')]();};}function respondWithResult(_0x16e490,_0x254598){_0x254598=_0x254598||0xc8;return function(_0x152140){if(_0x152140){return _0x16e490[_0x09c0('0x1d')](_0x254598)[_0x09c0('0x1f')](_0x152140);}};}function respondWithFilteredResult(_0x2fdf11,_0x4ff6b7){return function(_0x590129){if(_0x590129){var _0x558b4f=typeof _0x4ff6b7[_0x09c0('0x20')]===_0x09c0('0x21')&&typeof _0x4ff6b7[_0x09c0('0x22')]===_0x09c0('0x21');var _0x5dcab7=_0x590129[_0x09c0('0x23')];var _0x4aa8a5=_0x558b4f?0x0:_0x4ff6b7['offset'];var _0x2c12da=_0x558b4f?_0x590129['count']:_0x4ff6b7[_0x09c0('0x20')]+_0x4ff6b7[_0x09c0('0x22')];var _0x2da257;if(_0x2c12da>=_0x5dcab7){_0x2c12da=_0x5dcab7;_0x2da257=0xc8;}else{_0x2da257=0xce;}_0x2fdf11['status'](_0x2da257);return _0x2fdf11[_0x09c0('0x24')](_0x09c0('0x25'),_0x4aa8a5+'-'+_0x2c12da+'/'+_0x5dcab7)[_0x09c0('0x1f')](_0x590129);}return null;};}function patchUpdates(_0x3447c5){return function(_0x12bba7){try{jsonpatch[_0x09c0('0x26')](_0x12bba7,_0x3447c5,!![]);}catch(_0x8c6b9a){return BPromise['reject'](_0x8c6b9a);}return _0x12bba7[_0x09c0('0x27')]();};}function saveUpdates(_0x46f171,_0x473fbd){return function(_0x1d18e9){if(_0x1d18e9){return _0x1d18e9['update'](_0x46f171)['then'](function(_0x321bcc){return _0x321bcc;});}return null;};}function removeEntity(_0x25fdb5,_0x1e8a1c){return function(_0x3a5370){if(_0x3a5370){return _0x3a5370['destroy']()[_0x09c0('0x28')](function(){_0x25fdb5[_0x09c0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7202,_0x163a59){return function(_0x2e3d4d){if(!_0x2e3d4d){_0x2c7202[_0x09c0('0x1c')](0x194);}return _0x2e3d4d;};}function handleError(_0x1f8131,_0x1d2d9d){_0x1d2d9d=_0x1d2d9d||0x1f4;return function(_0x45cc64){logger[_0x09c0('0x29')](_0x45cc64[_0x09c0('0x2a')]);if(_0x45cc64[_0x09c0('0x2b')]){delete _0x45cc64[_0x09c0('0x2b')];}_0x1f8131['status'](_0x1d2d9d)[_0x09c0('0x2c')](_0x45cc64);};}exports[_0x09c0('0x2d')]=function(_0x53a7b8,_0x1d09e0){var _0x5aa0b9={},_0x3f5b10={},_0x4d6bdc={'count':0x0,'rows':[]};var _0x3ac8e4=_[_0x09c0('0x2e')](db[_0x09c0('0x2f')][_0x09c0('0x30')],function(_0x4e999a){return{'name':_0x4e999a['fieldName'],'type':_0x4e999a[_0x09c0('0x31')][_0x09c0('0x32')]};});_0x3f5b10[_0x09c0('0x33')]=_['map'](_0x3ac8e4,_0x09c0('0x2b'));_0x3f5b10['query']=_[_0x09c0('0x34')](_0x53a7b8[_0x09c0('0x35')]);_0x3f5b10[_0x09c0('0x36')]=_['intersection'](_0x3f5b10[_0x09c0('0x33')],_0x3f5b10[_0x09c0('0x35')]);_0x5aa0b9[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x3f5b10[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0x53a7b8[_0x09c0('0x35')]['fields']));_0x5aa0b9[_0x09c0('0x37')]=_0x5aa0b9[_0x09c0('0x37')][_0x09c0('0x3a')]?_0x5aa0b9[_0x09c0('0x37')]:_0x3f5b10[_0x09c0('0x33')];if(!_0x53a7b8['query'][_0x09c0('0x3b')](_0x09c0('0x3c'))){_0x5aa0b9[_0x09c0('0x22')]=qs[_0x09c0('0x22')](_0x53a7b8[_0x09c0('0x35')]['limit']);_0x5aa0b9[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x53a7b8[_0x09c0('0x35')][_0x09c0('0x20')]);}_0x5aa0b9[_0x09c0('0x3d')]=qs[_0x09c0('0x3e')](_0x53a7b8[_0x09c0('0x35')]['sort']);_0x5aa0b9[_0x09c0('0x3f')]=qs[_0x09c0('0x36')](_[_0x09c0('0x40')](_0x53a7b8[_0x09c0('0x35')],_0x3f5b10[_0x09c0('0x36')]),_0x3ac8e4);if(_0x53a7b8['query']['filter']){_0x5aa0b9['where']=_['merge'](_0x5aa0b9[_0x09c0('0x3f')],{'$or':_[_0x09c0('0x2e')](_0x3ac8e4,function(_0xfd295b){if(_0xfd295b[_0x09c0('0x31')]!==_0x09c0('0x41')){var _0x4bd637={};_0x4bd637[_0xfd295b[_0x09c0('0x2b')]]={'$like':'%'+_0x53a7b8[_0x09c0('0x35')]['filter']+'%'};return _0x4bd637;}})});}_0x5aa0b9=_[_0x09c0('0x42')]({},_0x5aa0b9,_0x53a7b8['options']);var _0x3ee063={'where':_0x5aa0b9['where']};return db[_0x09c0('0x2f')][_0x09c0('0x23')](_0x3ee063)['then'](function(_0x26a21c){_0x4d6bdc[_0x09c0('0x23')]=_0x26a21c;if(_0x53a7b8['query'][_0x09c0('0x43')]){_0x5aa0b9[_0x09c0('0x44')]=[{'all':!![]}];}return db[_0x09c0('0x2f')][_0x09c0('0x45')](_0x5aa0b9);})[_0x09c0('0x28')](function(_0x34326c){_0x4d6bdc['rows']=_0x34326c;return _0x4d6bdc;})[_0x09c0('0x28')](respondWithFilteredResult(_0x1d09e0,_0x5aa0b9))[_0x09c0('0x46')](handleError(_0x1d09e0,null));};exports[_0x09c0('0x47')]=function(_0x57835c,_0x193ed2){var _0x30c0c5={'raw':![],'where':{'id':_0x57835c['params']['id']}},_0x447224={};_0x447224[_0x09c0('0x33')]=_[_0x09c0('0x34')](db['ZendeskAccount']['rawAttributes']);_0x447224[_0x09c0('0x35')]=_[_0x09c0('0x34')](_0x57835c['query']);_0x447224[_0x09c0('0x36')]=_[_0x09c0('0x38')](_0x447224['model'],_0x447224[_0x09c0('0x35')]);_0x30c0c5[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x447224[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0x57835c['query'][_0x09c0('0x39')]));_0x30c0c5['attributes']=_0x30c0c5['attributes'][_0x09c0('0x3a')]?_0x30c0c5[_0x09c0('0x37')]:_0x447224[_0x09c0('0x33')];if(_0x57835c[_0x09c0('0x35')][_0x09c0('0x43')]){_0x30c0c5[_0x09c0('0x44')]=[{'all':!![]}];}_0x30c0c5=_['merge']({},_0x30c0c5,_0x57835c['options']);return db['ZendeskAccount'][_0x09c0('0x48')](_0x30c0c5)[_0x09c0('0x28')](handleEntityNotFound(_0x193ed2,null))[_0x09c0('0x28')](respondWithResult(_0x193ed2,null))['catch'](handleError(_0x193ed2,null));};exports[_0x09c0('0x49')]=function(_0xff9650,_0x2016f1){return db[_0x09c0('0x2f')][_0x09c0('0x49')](_0xff9650[_0x09c0('0x4a')],{})[_0x09c0('0x28')](respondWithResult(_0x2016f1,0xc9))[_0x09c0('0x46')](handleError(_0x2016f1,null));};exports[_0x09c0('0x4b')]=function(_0x38085c,_0x1b0198){if(_0x38085c[_0x09c0('0x4a')]['id']){delete _0x38085c[_0x09c0('0x4a')]['id'];}return db[_0x09c0('0x2f')][_0x09c0('0x48')]({'where':{'id':_0x38085c[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x1b0198,null))[_0x09c0('0x28')](saveUpdates(_0x38085c[_0x09c0('0x4a')],null))[_0x09c0('0x28')](respondWithResult(_0x1b0198,null))['catch'](handleError(_0x1b0198,null));};exports[_0x09c0('0x4d')]=function(_0x44befb,_0x15b0a2){return db[_0x09c0('0x2f')][_0x09c0('0x48')]({'where':{'id':_0x44befb['params']['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x15b0a2,null))[_0x09c0('0x28')](removeEntity(_0x15b0a2,null))[_0x09c0('0x46')](handleError(_0x15b0a2,null));};exports['getConfigurations']=function(_0xe0b82a,_0x18c728,_0x14b701){var _0x25a36a={};var _0x55b0f0={};var _0xebfd6d;var _0x45ecd0;return db['ZendeskAccount'][_0x09c0('0x4e')]({'where':{'id':_0xe0b82a[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x18c728,null))[_0x09c0('0x28')](function(_0x21fe00){if(_0x21fe00){_0xebfd6d=_0x21fe00;_0x55b0f0[_0x09c0('0x33')]=_[_0x09c0('0x34')](db['ZendeskConfiguration']['rawAttributes']);_0x55b0f0[_0x09c0('0x35')]=_[_0x09c0('0x34')](_0xe0b82a[_0x09c0('0x35')]);_0x55b0f0['filters']=_[_0x09c0('0x38')](_0x55b0f0['model'],_0x55b0f0[_0x09c0('0x35')]);_0x25a36a[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x55b0f0[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x39')]));_0x25a36a['attributes']=_0x25a36a[_0x09c0('0x37')][_0x09c0('0x3a')]?_0x25a36a[_0x09c0('0x37')]:_0x55b0f0[_0x09c0('0x33')];_0x25a36a[_0x09c0('0x3d')]=qs[_0x09c0('0x3e')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x3e')]);_0x25a36a[_0x09c0('0x3f')]=qs[_0x09c0('0x36')](_[_0x09c0('0x40')](_0xe0b82a['query'],_0x55b0f0[_0x09c0('0x36')]));if(_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x4f')]){_0x25a36a[_0x09c0('0x3f')]=_['merge'](_0x25a36a[_0x09c0('0x3f')],{'$or':_['map'](_0x25a36a[_0x09c0('0x37')],function(_0x9a4f4){var _0x1cfdb3={};_0x1cfdb3[_0x9a4f4]={'$like':'%'+_0xe0b82a['query']['filter']+'%'};return _0x1cfdb3;})});}_0x25a36a=_[_0x09c0('0x42')]({},_0x25a36a,_0xe0b82a[_0x09c0('0x50')]);return _0xebfd6d[_0x09c0('0x51')](_0x25a36a);}})[_0x09c0('0x28')](function(_0x4b65c7){if(_0x4b65c7){_0x45ecd0=_0x4b65c7[_0x09c0('0x3a')];if(!_0xe0b82a[_0x09c0('0x35')]['hasOwnProperty'](_0x09c0('0x3c'))){_0x25a36a[_0x09c0('0x22')]=qs[_0x09c0('0x22')](_0xe0b82a[_0x09c0('0x35')]['limit']);_0x25a36a[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x20')]);}return _0xebfd6d[_0x09c0('0x51')](_0x25a36a);}})[_0x09c0('0x28')](function(_0x30d976){if(_0x30d976){return _0x30d976?{'count':_0x45ecd0,'rows':_0x30d976}:null;}})[_0x09c0('0x28')](respondWithResult(_0x18c728,null))[_0x09c0('0x46')](handleError(_0x18c728,null));};exports[_0x09c0('0x52')]=function(_0x85adc7,_0x2906cb,_0x2d67e8){if(_0x85adc7['body']['id']){delete _0x85adc7[_0x09c0('0x4a')]['id'];}return db[_0x09c0('0x2f')][_0x09c0('0x4e')]({'where':{'id':_0x85adc7[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x2906cb,null))['then'](function(_0x1205da){if(_0x1205da){_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x53')]=_0x1205da['id'];_0x85adc7[_0x09c0('0x4a')]['Subjects']=integrations[_0x09c0('0x54')](_0x85adc7[_0x09c0('0x4a')]['channel'],_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x31')]);_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x55')]=integrations[_0x09c0('0x56')](_0x85adc7['body'][_0x09c0('0x57')],_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x31')]);return db[_0x09c0('0x58')][_0x09c0('0x49')](_0x85adc7['body'],{'include':[{'model':db[_0x09c0('0x59')],'as':_0x09c0('0x5a')},{'model':db[_0x09c0('0x59')],'as':_0x09c0('0x55')}]});}return null;})[_0x09c0('0x28')](respondWithResult(_0x2906cb,null))[_0x09c0('0x46')](handleError(_0x2906cb,null));};exports['getFields']=function(_0x51fc84,_0x583c0d,_0x52fe65){var _0x7c1cb8='';return db[_0x09c0('0x2f')][_0x09c0('0x4e')]({'where':{'id':_0x51fc84['params']['id']},'attributes':['id',_0x09c0('0x5b'),'password',_0x09c0('0x5c'),_0x09c0('0x5d'),'remoteUri']})[_0x09c0('0x28')](handleEntityNotFound(_0x583c0d,null))['then'](function(_0x4a42c4){if(_0x4a42c4){_0x7c1cb8=_0x4a42c4[_0x09c0('0x5e')];var _0x111647=_0x7c1cb8[_0x09c0('0x5f')](-0x1);if(_0x111647==='/'){_0x7c1cb8=_0x7c1cb8[_0x09c0('0x60')](0x0,_0x7c1cb8[_0x09c0('0x61')](_0x111647));}var _0x3ffd37={'method':_0x09c0('0x62'),'uri':util[_0x09c0('0x63')](_0x09c0('0x64'),_0x7c1cb8,_0x09c0('0x65')),'json':!![]};switch(_0x4a42c4['authType']){case _0x09c0('0x66'):_0x3ffd37[_0x09c0('0x67')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x09c0('0x63')](_0x09c0('0x68'),_0x4a42c4[_0x09c0('0x5b')],_0x4a42c4[_0x09c0('0x66')]))[_0x09c0('0x69')](_0x09c0('0x6a')))};break;case _0x09c0('0x5c'):_0x3ffd37['headers']={'Authorization':util[_0x09c0('0x63')]('Basic\x20%s',new Buffer(util[_0x09c0('0x63')](_0x09c0('0x6b'),_0x4a42c4[_0x09c0('0x5b')],_0x4a42c4[_0x09c0('0x5c')]))[_0x09c0('0x69')]('base64'))};break;default:throw new db[(_0x09c0('0x6c'))]['ValidationError'](_0x09c0('0x6d'));}return rp(_0x3ffd37);}})['then'](function(_0x35c446){if(_0x35c446){var _0x3e8b19=[_0x09c0('0x6e'),_0x09c0('0x6f'),_0x09c0('0x70'),_0x09c0('0x71')];_[_0x09c0('0x72')](_0x35c446['ticket_fields'],function(_0x4ab50d){return _0x3e8b19[_0x09c0('0x73')](_0x4ab50d[_0x09c0('0x31')]);});return{'count':_0x35c446[_0x09c0('0x65')][_0x09c0('0x3a')],'rows':_[_0x09c0('0x2e')](_0x35c446[_0x09c0('0x65')],function(_0x4060bb){return{'id':_0x4060bb['id'],'name':_0x4060bb[_0x09c0('0x74')]>0x7?_0x4060bb[_0x09c0('0x75')]:_0x4060bb[_0x09c0('0x31')],'custom':_0x4060bb['position']>0x7?!![]:![],'options':_0x4060bb['system_field_options']?_0x4060bb['system_field_options']:_0x4060bb[_0x09c0('0x76')]?_0x4060bb[_0x09c0('0x76')]:[]};})};}})[_0x09c0('0x28')](respondWithResult(_0x583c0d,null))['catch'](function(_0x5f1857){var _0x1618de=_0x51fc84['query'][_0x09c0('0x77')]?0x1f4:_0x5f1857[_0x09c0('0x78')]||0x1f4;logger['error'](_0x09c0('0x79'),'getFields',_0x1618de,JSON[_0x09c0('0x7a')](_0x5f1857));delete _0x5f1857[_0x09c0('0x2b')];if(_0x1618de===0x191){_0x1618de=0x190;}_0x583c0d[_0x09c0('0x1d')](_0x1618de)['send'](_0x51fc84[_0x09c0('0x35')][_0x09c0('0x77')]?{'message':_0x09c0('0x7b'),'statusCode':_0x5f1857[_0x09c0('0x78')]}:_0x5f1857);});}; \ No newline at end of file +var _0xbfcc=['position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','apply','save','update','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ZendeskAccount','count','include','findAll','rows','then','catch','show','params','includeAll','find','create','body','findOne','ZendeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','getFields','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','ticket_fields','headers','Basic\x20%s','format','%s:%s','password','toString','base64','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','includes'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xbfcc[_0x10004e];return _0x5af990;};'use strict';var emlformat=require(_0xcbfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbfc('0x1'));var rp=require(_0xcbfc('0x2'));var moment=require(_0xcbfc('0x3'));var BPromise=require(_0xcbfc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcbfc('0x5'));var ejs=require(_0xcbfc('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbfc('0x7'));var squel=require('squel');var crypto=require(_0xcbfc('0x8'));var jsforce=require(_0xcbfc('0x9'));var deskjs=require(_0xcbfc('0xa'));var toCsv=require(_0xcbfc('0x5'));var querystring=require('querystring');var Papa=require(_0xcbfc('0xb'));var Redis=require(_0xcbfc('0xc'));var authService=require(_0xcbfc('0xd'));var qs=require(_0xcbfc('0xe'));var as=require(_0xcbfc('0xf'));var hardwareService=require(_0xcbfc('0x10'));var logger=require('../../config/logger')(_0xcbfc('0x11'));var utils=require(_0xcbfc('0x12'));var config=require(_0xcbfc('0x13'));var licenseUtil=require(_0xcbfc('0x14'));var db=require(_0xcbfc('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3bfd05,_0x86f67c){_0x86f67c=_0x86f67c||0xcc;return function(_0x80d08d){if(_0x80d08d){return _0x3bfd05['sendStatus'](_0x86f67c);}return _0x3bfd05[_0xcbfc('0x16')](_0x86f67c)[_0xcbfc('0x17')]();};}function respondWithResult(_0x2f2bdd,_0x45a5cc){_0x45a5cc=_0x45a5cc||0xc8;return function(_0x16b659){if(_0x16b659){return _0x2f2bdd['status'](_0x45a5cc)[_0xcbfc('0x18')](_0x16b659);}};}function respondWithFilteredResult(_0x1963de,_0x1ec8c4){return function(_0x4317e4){if(_0x4317e4){var _0x50c6b6=typeof _0x1ec8c4['offset']===_0xcbfc('0x19')&&typeof _0x1ec8c4[_0xcbfc('0x1a')]===_0xcbfc('0x19');var _0x4d6946=_0x4317e4['count'];var _0x33f731=_0x50c6b6?0x0:_0x1ec8c4[_0xcbfc('0x1b')];var _0x344510=_0x50c6b6?_0x4317e4['count']:_0x1ec8c4[_0xcbfc('0x1b')]+_0x1ec8c4['limit'];var _0x28f7fb;if(_0x344510>=_0x4d6946){_0x344510=_0x4d6946;_0x28f7fb=0xc8;}else{_0x28f7fb=0xce;}_0x1963de[_0xcbfc('0x16')](_0x28f7fb);return _0x1963de[_0xcbfc('0x1c')](_0xcbfc('0x1d'),_0x33f731+'-'+_0x344510+'/'+_0x4d6946)[_0xcbfc('0x18')](_0x4317e4);}return null;};}function patchUpdates(_0x2653b1){return function(_0x5f09b0){try{jsonpatch[_0xcbfc('0x1e')](_0x5f09b0,_0x2653b1,!![]);}catch(_0x37ec3e){return BPromise['reject'](_0x37ec3e);}return _0x5f09b0[_0xcbfc('0x1f')]();};}function saveUpdates(_0x5a449b,_0x4cc8b3){return function(_0x4e2427){if(_0x4e2427){return _0x4e2427[_0xcbfc('0x20')](_0x5a449b)['then'](function(_0x4a1915){return _0x4a1915;});}return null;};}function removeEntity(_0x1b3e42,_0x34cffa){return function(_0x3ceeff){if(_0x3ceeff){return _0x3ceeff[_0xcbfc('0x21')]()['then'](function(){_0x1b3e42[_0xcbfc('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x280b78,_0x75bca0){return function(_0x53951a){if(!_0x53951a){_0x280b78[_0xcbfc('0x22')](0x194);}return _0x53951a;};}function handleError(_0x3b73a3,_0x4ab48e){_0x4ab48e=_0x4ab48e||0x1f4;return function(_0x1b2c01){logger[_0xcbfc('0x23')](_0x1b2c01[_0xcbfc('0x24')]);if(_0x1b2c01[_0xcbfc('0x25')]){delete _0x1b2c01['name'];}_0x3b73a3[_0xcbfc('0x16')](_0x4ab48e)[_0xcbfc('0x26')](_0x1b2c01);};}exports['index']=function(_0x1f6a14,_0x26463f){var _0x7cbdfa={},_0x388d41={},_0x2b4286={'count':0x0,'rows':[]};var _0x19d2e=_[_0xcbfc('0x27')](db['ZendeskAccount'][_0xcbfc('0x28')],function(_0x433300){return{'name':_0x433300[_0xcbfc('0x29')],'type':_0x433300[_0xcbfc('0x2a')]['key']};});_0x388d41[_0xcbfc('0x2b')]=_[_0xcbfc('0x27')](_0x19d2e,_0xcbfc('0x25'));_0x388d41[_0xcbfc('0x2c')]=_[_0xcbfc('0x2d')](_0x1f6a14[_0xcbfc('0x2c')]);_0x388d41[_0xcbfc('0x2e')]=_['intersection'](_0x388d41[_0xcbfc('0x2b')],_0x388d41[_0xcbfc('0x2c')]);_0x7cbdfa['attributes']=_[_0xcbfc('0x2f')](_0x388d41[_0xcbfc('0x2b')],qs[_0xcbfc('0x30')](_0x1f6a14['query']['fields']));_0x7cbdfa['attributes']=_0x7cbdfa[_0xcbfc('0x31')][_0xcbfc('0x32')]?_0x7cbdfa[_0xcbfc('0x31')]:_0x388d41[_0xcbfc('0x2b')];if(!_0x1f6a14[_0xcbfc('0x2c')][_0xcbfc('0x33')](_0xcbfc('0x34'))){_0x7cbdfa[_0xcbfc('0x1a')]=qs['limit'](_0x1f6a14[_0xcbfc('0x2c')][_0xcbfc('0x1a')]);_0x7cbdfa['offset']=qs[_0xcbfc('0x1b')](_0x1f6a14['query'][_0xcbfc('0x1b')]);}_0x7cbdfa[_0xcbfc('0x35')]=qs[_0xcbfc('0x36')](_0x1f6a14['query'][_0xcbfc('0x36')]);_0x7cbdfa['where']=qs['filters'](_[_0xcbfc('0x37')](_0x1f6a14[_0xcbfc('0x2c')],_0x388d41[_0xcbfc('0x2e')]),_0x19d2e);if(_0x1f6a14[_0xcbfc('0x2c')][_0xcbfc('0x38')]){_0x7cbdfa[_0xcbfc('0x39')]=_[_0xcbfc('0x3a')](_0x7cbdfa[_0xcbfc('0x39')],{'$or':_['map'](_0x19d2e,function(_0x15fb08){if(_0x15fb08['type']!==_0xcbfc('0x3b')){var _0x44064d={};_0x44064d[_0x15fb08[_0xcbfc('0x25')]]={'$like':'%'+_0x1f6a14[_0xcbfc('0x2c')]['filter']+'%'};return _0x44064d;}})});}_0x7cbdfa=_['merge']({},_0x7cbdfa,_0x1f6a14[_0xcbfc('0x3c')]);var _0x1c678b={'where':_0x7cbdfa[_0xcbfc('0x39')]};return db[_0xcbfc('0x3d')][_0xcbfc('0x3e')](_0x1c678b)['then'](function(_0x1901b4){_0x2b4286[_0xcbfc('0x3e')]=_0x1901b4;if(_0x1f6a14[_0xcbfc('0x2c')]['includeAll']){_0x7cbdfa[_0xcbfc('0x3f')]=[{'all':!![]}];}return db[_0xcbfc('0x3d')][_0xcbfc('0x40')](_0x7cbdfa);})['then'](function(_0x28266c){_0x2b4286[_0xcbfc('0x41')]=_0x28266c;return _0x2b4286;})[_0xcbfc('0x42')](respondWithFilteredResult(_0x26463f,_0x7cbdfa))[_0xcbfc('0x43')](handleError(_0x26463f,null));};exports[_0xcbfc('0x44')]=function(_0x28447a,_0x1e14bb){var _0x561544={'raw':![],'where':{'id':_0x28447a[_0xcbfc('0x45')]['id']}},_0x2de7fe={};_0x2de7fe['model']=_[_0xcbfc('0x2d')](db[_0xcbfc('0x3d')][_0xcbfc('0x28')]);_0x2de7fe[_0xcbfc('0x2c')]=_[_0xcbfc('0x2d')](_0x28447a[_0xcbfc('0x2c')]);_0x2de7fe[_0xcbfc('0x2e')]=_[_0xcbfc('0x2f')](_0x2de7fe['model'],_0x2de7fe[_0xcbfc('0x2c')]);_0x561544[_0xcbfc('0x31')]=_[_0xcbfc('0x2f')](_0x2de7fe[_0xcbfc('0x2b')],qs[_0xcbfc('0x30')](_0x28447a[_0xcbfc('0x2c')][_0xcbfc('0x30')]));_0x561544['attributes']=_0x561544[_0xcbfc('0x31')][_0xcbfc('0x32')]?_0x561544['attributes']:_0x2de7fe[_0xcbfc('0x2b')];if(_0x28447a[_0xcbfc('0x2c')][_0xcbfc('0x46')]){_0x561544['include']=[{'all':!![]}];}_0x561544=_[_0xcbfc('0x3a')]({},_0x561544,_0x28447a[_0xcbfc('0x3c')]);return db[_0xcbfc('0x3d')][_0xcbfc('0x47')](_0x561544)[_0xcbfc('0x42')](handleEntityNotFound(_0x1e14bb,null))[_0xcbfc('0x42')](respondWithResult(_0x1e14bb,null))[_0xcbfc('0x43')](handleError(_0x1e14bb,null));};exports['create']=function(_0x5a87b6,_0x237f30){return db[_0xcbfc('0x3d')][_0xcbfc('0x48')](_0x5a87b6[_0xcbfc('0x49')],{})['then'](respondWithResult(_0x237f30,0xc9))['catch'](handleError(_0x237f30,null));};exports[_0xcbfc('0x20')]=function(_0xe5c5ef,_0x12340f){if(_0xe5c5ef['body']['id']){delete _0xe5c5ef[_0xcbfc('0x49')]['id'];}return db[_0xcbfc('0x3d')][_0xcbfc('0x47')]({'where':{'id':_0xe5c5ef['params']['id']}})[_0xcbfc('0x42')](handleEntityNotFound(_0x12340f,null))[_0xcbfc('0x42')](saveUpdates(_0xe5c5ef[_0xcbfc('0x49')],null))[_0xcbfc('0x42')](respondWithResult(_0x12340f,null))[_0xcbfc('0x43')](handleError(_0x12340f,null));};exports[_0xcbfc('0x21')]=function(_0x222b58,_0x374998){return db[_0xcbfc('0x3d')][_0xcbfc('0x47')]({'where':{'id':_0x222b58['params']['id']}})[_0xcbfc('0x42')](handleEntityNotFound(_0x374998,null))[_0xcbfc('0x42')](removeEntity(_0x374998,null))[_0xcbfc('0x43')](handleError(_0x374998,null));};exports['getConfigurations']=function(_0x28ae7f,_0x1a89c1,_0x4b7038){var _0x54de8={};var _0x5ce8e3={};var _0x38db76;var _0x25e48d;return db['ZendeskAccount'][_0xcbfc('0x4a')]({'where':{'id':_0x28ae7f[_0xcbfc('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a89c1,null))[_0xcbfc('0x42')](function(_0x34db13){if(_0x34db13){_0x38db76=_0x34db13;_0x5ce8e3[_0xcbfc('0x2b')]=_[_0xcbfc('0x2d')](db[_0xcbfc('0x4b')][_0xcbfc('0x28')]);_0x5ce8e3[_0xcbfc('0x2c')]=_[_0xcbfc('0x2d')](_0x28ae7f[_0xcbfc('0x2c')]);_0x5ce8e3[_0xcbfc('0x2e')]=_['intersection'](_0x5ce8e3[_0xcbfc('0x2b')],_0x5ce8e3['query']);_0x54de8['attributes']=_['intersection'](_0x5ce8e3[_0xcbfc('0x2b')],qs[_0xcbfc('0x30')](_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x30')]));_0x54de8[_0xcbfc('0x31')]=_0x54de8[_0xcbfc('0x31')][_0xcbfc('0x32')]?_0x54de8[_0xcbfc('0x31')]:_0x5ce8e3['model'];_0x54de8[_0xcbfc('0x35')]=qs[_0xcbfc('0x36')](_0x28ae7f[_0xcbfc('0x2c')]['sort']);_0x54de8[_0xcbfc('0x39')]=qs[_0xcbfc('0x2e')](_[_0xcbfc('0x37')](_0x28ae7f[_0xcbfc('0x2c')],_0x5ce8e3[_0xcbfc('0x2e')]));if(_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x38')]){_0x54de8['where']=_[_0xcbfc('0x3a')](_0x54de8['where'],{'$or':_[_0xcbfc('0x27')](_0x54de8[_0xcbfc('0x31')],function(_0x5de047){var _0x2c6b23={};_0x2c6b23[_0x5de047]={'$like':'%'+_0x28ae7f['query'][_0xcbfc('0x38')]+'%'};return _0x2c6b23;})});}_0x54de8=_[_0xcbfc('0x3a')]({},_0x54de8,_0x28ae7f[_0xcbfc('0x3c')]);return _0x38db76[_0xcbfc('0x4c')](_0x54de8);}})[_0xcbfc('0x42')](function(_0x1b2b24){if(_0x1b2b24){_0x25e48d=_0x1b2b24['length'];if(!_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x33')]('nolimit')){_0x54de8[_0xcbfc('0x1a')]=qs[_0xcbfc('0x1a')](_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x1a')]);_0x54de8[_0xcbfc('0x1b')]=qs[_0xcbfc('0x1b')](_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x1b')]);}return _0x38db76['getConfigurations'](_0x54de8);}})[_0xcbfc('0x42')](function(_0x3f01da){if(_0x3f01da){return _0x3f01da?{'count':_0x25e48d,'rows':_0x3f01da}:null;}})[_0xcbfc('0x42')](respondWithResult(_0x1a89c1,null))[_0xcbfc('0x43')](handleError(_0x1a89c1,null));};exports[_0xcbfc('0x4d')]=function(_0x2fb0c2,_0x209d61,_0x380539){if(_0x2fb0c2[_0xcbfc('0x49')]['id']){delete _0x2fb0c2[_0xcbfc('0x49')]['id'];}return db['ZendeskAccount'][_0xcbfc('0x4a')]({'where':{'id':_0x2fb0c2[_0xcbfc('0x45')]['id']}})['then'](handleEntityNotFound(_0x209d61,null))[_0xcbfc('0x42')](function(_0x510a43){if(_0x510a43){_0x2fb0c2['body'][_0xcbfc('0x4e')]=_0x510a43['id'];_0x2fb0c2[_0xcbfc('0x49')][_0xcbfc('0x4f')]=integrations[_0xcbfc('0x50')](_0x2fb0c2[_0xcbfc('0x49')]['channel'],_0x2fb0c2['body'][_0xcbfc('0x2a')]);_0x2fb0c2[_0xcbfc('0x49')][_0xcbfc('0x51')]=integrations[_0xcbfc('0x52')](_0x2fb0c2[_0xcbfc('0x49')]['channel'],_0x2fb0c2[_0xcbfc('0x49')][_0xcbfc('0x2a')]);return db[_0xcbfc('0x4b')]['create'](_0x2fb0c2['body'],{'include':[{'model':db['ZendeskField'],'as':_0xcbfc('0x4f')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0xcbfc('0x42')](respondWithResult(_0x209d61,null))['catch'](handleError(_0x209d61,null));};exports[_0xcbfc('0x53')]=function(_0x34e671,_0xed28ff,_0x461e5b){var _0x16d91a='';return db[_0xcbfc('0x3d')][_0xcbfc('0x4a')]({'where':{'id':_0x34e671[_0xcbfc('0x45')]['id']},'attributes':['id',_0xcbfc('0x54'),'password',_0xcbfc('0x55'),_0xcbfc('0x56'),_0xcbfc('0x57')]})['then'](handleEntityNotFound(_0xed28ff,null))[_0xcbfc('0x42')](function(_0x1640e9){if(_0x1640e9){_0x16d91a=_0x1640e9[_0xcbfc('0x57')];var _0x318346=_0x16d91a[_0xcbfc('0x58')](-0x1);if(_0x318346==='/'){_0x16d91a=_0x16d91a[_0xcbfc('0x59')](0x0,_0x16d91a[_0xcbfc('0x5a')](_0x318346));}var _0x562380={'method':_0xcbfc('0x5b'),'uri':util['format'](_0xcbfc('0x5c'),_0x16d91a,_0xcbfc('0x5d')),'json':!![]};switch(_0x1640e9[_0xcbfc('0x56')]){case'password':_0x562380[_0xcbfc('0x5e')]={'Authorization':util['format'](_0xcbfc('0x5f'),new Buffer(util[_0xcbfc('0x60')](_0xcbfc('0x61'),_0x1640e9[_0xcbfc('0x54')],_0x1640e9[_0xcbfc('0x62')]))[_0xcbfc('0x63')](_0xcbfc('0x64')))};break;case'token':_0x562380[_0xcbfc('0x5e')]={'Authorization':util[_0xcbfc('0x60')](_0xcbfc('0x5f'),new Buffer(util['format'](_0xcbfc('0x65'),_0x1640e9['username'],_0x1640e9[_0xcbfc('0x55')]))[_0xcbfc('0x63')](_0xcbfc('0x64')))};break;default:throw new db['Sequelize'][(_0xcbfc('0x66'))](_0xcbfc('0x67'));}return rp(_0x562380);}})['then'](function(_0xb3378d){if(_0xb3378d){var _0x58be73=[_0xcbfc('0x68'),'description',_0xcbfc('0x69'),_0xcbfc('0x6a')];_['remove'](_0xb3378d[_0xcbfc('0x5d')],function(_0x4cf2e1){return _0x58be73[_0xcbfc('0x6b')](_0x4cf2e1[_0xcbfc('0x2a')]);});return{'count':_0xb3378d[_0xcbfc('0x5d')][_0xcbfc('0x32')],'rows':_['map'](_0xb3378d[_0xcbfc('0x5d')],function(_0x4c1e0a){return{'id':_0x4c1e0a['id'],'name':_0x4c1e0a[_0xcbfc('0x6c')]>0x7?_0x4c1e0a[_0xcbfc('0x6d')]:_0x4c1e0a[_0xcbfc('0x2a')],'custom':_0x4c1e0a[_0xcbfc('0x6c')]>0x7?!![]:![],'options':_0x4c1e0a[_0xcbfc('0x6e')]?_0x4c1e0a[_0xcbfc('0x6e')]:_0x4c1e0a[_0xcbfc('0x6f')]?_0x4c1e0a[_0xcbfc('0x6f')]:[]};})};}})[_0xcbfc('0x42')](respondWithResult(_0xed28ff,null))[_0xcbfc('0x43')](function(_0x3a3b24){var _0x297513=_0x34e671[_0xcbfc('0x2c')][_0xcbfc('0x70')]?0x1f4:_0x3a3b24[_0xcbfc('0x71')]||0x1f4;logger[_0xcbfc('0x23')](_0xcbfc('0x72'),'getFields',_0x297513,JSON[_0xcbfc('0x73')](_0x3a3b24));delete _0x3a3b24['name'];if(_0x297513===0x191){_0x297513=0x190;}_0xed28ff[_0xcbfc('0x16')](_0x297513)['send'](_0x34e671[_0xcbfc('0x2c')][_0xcbfc('0x70')]?{'message':_0xcbfc('0x74'),'statusCode':_0x3a3b24[_0xcbfc('0x71')]}:_0x3a3b24);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index e3df384..9016731 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 _0x9999=['../../config/logger','api','moment','bluebird','path','./intZendeskAccount.attributes','exports','define','int_zendesk_accounts','lodash'];(function(_0x4af5d9,_0x1198c8){var _0xf6a1fd=function(_0x4db7a7){while(--_0x4db7a7){_0x4af5d9['push'](_0x4af5d9['shift']());}};_0xf6a1fd(++_0x1198c8);}(_0x9999,0x15d));var _0x9999=function(_0x599b92,_0x4e1461){_0x599b92=_0x599b92-0x0;var _0x5ebd37=_0x9999[_0x599b92];return _0x5ebd37;};'use strict';var _=require(_0x9999('0x0'));var util=require('util');var logger=require(_0x9999('0x1'))(_0x9999('0x2'));var moment=require(_0x9999('0x3'));var BPromise=require(_0x9999('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9999('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9999('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x9999('0x7')]=function(_0x5b526f,_0x572bc5){return _0x5b526f[_0x9999('0x8')]('ZendeskAccount',attributes,{'tableName':_0x9999('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e10=['moment','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','util','api'];(function(_0x127cec,_0x2fe1a6){var _0x3abdc5=function(_0x1a23bf){while(--_0x1a23bf){_0x127cec['push'](_0x127cec['shift']());}};_0x3abdc5(++_0x2fe1a6);}(_0x5e10,0x72));var _0x05e1=function(_0x2e4cbf,_0x8763d3){_0x2e4cbf=_0x2e4cbf-0x0;var _0x52840f=_0x5e10[_0x2e4cbf];return _0x52840f;};'use strict';var _=require(_0x05e1('0x0'));var util=require(_0x05e1('0x1'));var logger=require('../../config/logger')(_0x05e1('0x2'));var moment=require(_0x05e1('0x3'));var BPromise=require(_0x05e1('0x4'));var rp=require(_0x05e1('0x5'));var fs=require('fs');var path=require(_0x05e1('0x6'));var rimraf=require('rimraf');var config=require(_0x05e1('0x7'));var attributes=require(_0x05e1('0x8'));var integrations=require(_0x05e1('0x9'));module[_0x05e1('0xa')]=function(_0x413812,_0x78aa91){return _0x413812[_0x05e1('0xb')]('ZendeskAccount',attributes,{'tableName':_0x05e1('0xc'),'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 162ee75..384bae5 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 _0x0361=['include','map','then','GetZendeskAccount','ZendeskAccount','find','raw','model','ShowZendeskAccount','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','findAll','options','attributes','limit'];(function(_0x7488c6,_0x1b2889){var _0x50fafa=function(_0x5dbf64){while(--_0x5dbf64){_0x7488c6['push'](_0x7488c6['shift']());}};_0x50fafa(++_0x1b2889);}(_0x0361,0x91));var _0x1036=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0361[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x1036('0x0'));var moment=require(_0x1036('0x1'));var BPromise=require(_0x1036('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1036('0x3'))['db'];var utils=require(_0x1036('0x4'));var logger=require(_0x1036('0x5'))(_0x1036('0x6'));var config=require('../../config/environment');var jayson=require(_0x1036('0x7'));var client=jayson[_0x1036('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40747b,_0x234d2e,_0x39f32d){return new BPromise(function(_0x1d5d6d,_0x403c0b){return client[_0x1036('0x9')](_0x40747b,_0x39f32d)['then'](function(_0x5169d7){logger[_0x1036('0xa')]('ZendeskAccount,\x20%s,\x20%s',_0x234d2e,_0x1036('0xb'));logger[_0x1036('0xc')](_0x1036('0xd'),_0x234d2e,_0x1036('0xb'),JSON[_0x1036('0xe')](_0x5169d7));if(_0x5169d7[_0x1036('0xf')]){if(_0x5169d7[_0x1036('0xf')][_0x1036('0x10')]===0x1f4){logger[_0x1036('0xf')](_0x1036('0x11'),_0x234d2e,_0x5169d7[_0x1036('0xf')]['message']);return _0x403c0b(_0x5169d7[_0x1036('0xf')]['message']);}logger[_0x1036('0xf')](_0x1036('0x11'),_0x234d2e,_0x5169d7[_0x1036('0xf')][_0x1036('0x12')]);return _0x1d5d6d(_0x5169d7[_0x1036('0xf')]['message']);}else{logger[_0x1036('0xa')](_0x1036('0x11'),_0x234d2e,_0x1036('0xb'));_0x1d5d6d(_0x5169d7[_0x1036('0x13')][_0x1036('0x12')]);}})[_0x1036('0x14')](function(_0x4be73c){logger[_0x1036('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x234d2e,_0x4be73c);_0x403c0b(_0x4be73c);});});}exports['GetZendeskAccount']=function(_0x48083b){var _0x1ed4c1=this;return new Promise(function(_0x3990f8,_0x31c4b6){return db['ZendeskAccount'][_0x1036('0x15')]({'raw':_0x48083b[_0x1036('0x16')]?_0x48083b[_0x1036('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x48083b[_0x1036('0x16')]?_0x48083b[_0x1036('0x16')]['where']||null:null,'attributes':_0x48083b[_0x1036('0x16')]?_0x48083b[_0x1036('0x16')][_0x1036('0x17')]||null:null,'limit':_0x48083b['options']?_0x48083b[_0x1036('0x16')][_0x1036('0x18')]||null:null,'include':_0x48083b[_0x1036('0x16')]?_0x48083b[_0x1036('0x16')][_0x1036('0x19')]?_[_0x1036('0x1a')](_0x48083b[_0x1036('0x16')][_0x1036('0x19')],function(_0x5a71ab){return{'model':db[_0x5a71ab['model']],'as':_0x5a71ab['as'],'attributes':_0x5a71ab['attributes'],'include':_0x5a71ab[_0x1036('0x19')]?_[_0x1036('0x1a')](_0x5a71ab[_0x1036('0x19')],function(_0xa05bb1){return{'model':db[_0xa05bb1['model']],'as':_0xa05bb1['as'],'attributes':_0xa05bb1['attributes'],'include':_0xa05bb1['include']?_['map'](_0xa05bb1[_0x1036('0x19')],function(_0xafe344){return{'model':db[_0xafe344['model']],'as':_0xafe344['as'],'attributes':_0xafe344[_0x1036('0x17')]};}):[]};}):[]};}):[]:[]})[_0x1036('0x1b')](function(_0xdb8607){logger[_0x1036('0xa')](_0x1036('0x1c'),_0x48083b);logger[_0x1036('0xc')](_0x1036('0x1c'),_0x48083b,JSON[_0x1036('0xe')](_0xdb8607));_0x3990f8(_0xdb8607);})[_0x1036('0x14')](function(_0x498d1c){logger[_0x1036('0xf')](_0x1036('0x1c'),_0x498d1c[_0x1036('0x12')],_0x48083b);_0x31c4b6(_0x1ed4c1[_0x1036('0xf')](0x1f4,_0x498d1c[_0x1036('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x4d1e28){var _0x19738e=this;return new Promise(function(_0xe902df,_0x5975af){return db[_0x1036('0x1d')][_0x1036('0x1e')]({'raw':_0x4d1e28[_0x1036('0x16')]?_0x4d1e28[_0x1036('0x16')][_0x1036('0x1f')]===undefined?!![]:![]:!![],'where':_0x4d1e28[_0x1036('0x16')]?_0x4d1e28[_0x1036('0x16')]['where']||null:null,'attributes':_0x4d1e28['options']?_0x4d1e28['options'][_0x1036('0x17')]||null:null,'include':_0x4d1e28['options']?_0x4d1e28['options']['include']?_[_0x1036('0x1a')](_0x4d1e28[_0x1036('0x16')][_0x1036('0x19')],function(_0x32e62a){return{'model':db[_0x32e62a[_0x1036('0x20')]],'as':_0x32e62a['as'],'attributes':_0x32e62a[_0x1036('0x17')],'include':_0x32e62a[_0x1036('0x19')]?_[_0x1036('0x1a')](_0x32e62a[_0x1036('0x19')],function(_0x1b47ee){return{'model':db[_0x1b47ee['model']],'as':_0x1b47ee['as'],'attributes':_0x1b47ee[_0x1036('0x17')],'include':_0x1b47ee[_0x1036('0x19')]?_[_0x1036('0x1a')](_0x1b47ee[_0x1036('0x19')],function(_0x49835d){return{'model':db[_0x49835d['model']],'as':_0x49835d['as'],'attributes':_0x49835d[_0x1036('0x17')]};}):[]};}):[]};}):[]:[]})[_0x1036('0x1b')](function(_0x3ae37c){logger[_0x1036('0xa')]('ShowZendeskAccount',_0x4d1e28);logger['debug'](_0x1036('0x21'),_0x4d1e28,JSON['stringify'](_0x3ae37c));_0xe902df(_0x3ae37c);})['catch'](function(_0x1795fe){logger[_0x1036('0xf')](_0x1036('0x21'),_0x1795fe[_0x1036('0x12')],_0x4d1e28);_0x5975af(_0x19738e[_0x1036('0xf')](0x1f4,_0x1795fe[_0x1036('0x12')]));});});}; \ No newline at end of file +var _0xb401=['lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','map','include','model','ShowZendeskAccount','find'];(function(_0x21331a,_0x57fc48){var _0x325c55=function(_0x770dfa){while(--_0x770dfa){_0x21331a['push'](_0x21331a['shift']());}};_0x325c55(++_0x57fc48);}(_0xb401,0x1e0));var _0x1b40=function(_0x3ff244,_0x1513a1){_0x3ff244=_0x3ff244-0x0;var _0x1f59d3=_0xb401[_0x3ff244];return _0x1f59d3;};'use strict';var _=require(_0x1b40('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b40('0x1'));var fs=require('fs');var Redis=require(_0x1b40('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b40('0x3'));var logger=require('../../config/logger')(_0x1b40('0x4'));var config=require(_0x1b40('0x5'));var jayson=require(_0x1b40('0x6'));var client=jayson[_0x1b40('0x7')][_0x1b40('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7ad50,_0x3873ed,_0x3af61a){return new BPromise(function(_0xa8efb,_0x35fe1e){return client[_0x1b40('0x9')](_0x7ad50,_0x3af61a)[_0x1b40('0xa')](function(_0x4de2f5){logger[_0x1b40('0xb')](_0x1b40('0xc'),_0x3873ed,_0x1b40('0xd'));logger[_0x1b40('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x3873ed,_0x1b40('0xd'),JSON[_0x1b40('0xf')](_0x4de2f5));if(_0x4de2f5[_0x1b40('0x10')]){if(_0x4de2f5[_0x1b40('0x10')][_0x1b40('0x11')]===0x1f4){logger[_0x1b40('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x3873ed,_0x4de2f5[_0x1b40('0x10')]['message']);return _0x35fe1e(_0x4de2f5[_0x1b40('0x10')][_0x1b40('0x12')]);}logger[_0x1b40('0x10')](_0x1b40('0xc'),_0x3873ed,_0x4de2f5['error'][_0x1b40('0x12')]);return _0xa8efb(_0x4de2f5[_0x1b40('0x10')]['message']);}else{logger[_0x1b40('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x3873ed,_0x1b40('0xd'));_0xa8efb(_0x4de2f5[_0x1b40('0x13')][_0x1b40('0x12')]);}})[_0x1b40('0x14')](function(_0x2a56d2){logger['error'](_0x1b40('0xc'),_0x3873ed,_0x2a56d2);_0x35fe1e(_0x2a56d2);});});}exports[_0x1b40('0x15')]=function(_0x491b0c){var _0x586015=this;return new Promise(function(_0x87895c,_0x359951){return db[_0x1b40('0x16')]['findAll']({'raw':_0x491b0c[_0x1b40('0x17')]?_0x491b0c[_0x1b40('0x17')][_0x1b40('0x18')]===undefined?!![]:![]:!![],'where':_0x491b0c[_0x1b40('0x17')]?_0x491b0c[_0x1b40('0x17')][_0x1b40('0x19')]||null:null,'attributes':_0x491b0c['options']?_0x491b0c[_0x1b40('0x17')][_0x1b40('0x1a')]||null:null,'limit':_0x491b0c[_0x1b40('0x17')]?_0x491b0c[_0x1b40('0x17')]['limit']||null:null,'include':_0x491b0c[_0x1b40('0x17')]?_0x491b0c[_0x1b40('0x17')]['include']?_[_0x1b40('0x1b')](_0x491b0c[_0x1b40('0x17')][_0x1b40('0x1c')],function(_0x6c94bc){return{'model':db[_0x6c94bc[_0x1b40('0x1d')]],'as':_0x6c94bc['as'],'attributes':_0x6c94bc[_0x1b40('0x1a')],'include':_0x6c94bc[_0x1b40('0x1c')]?_['map'](_0x6c94bc[_0x1b40('0x1c')],function(_0x1c64bc){return{'model':db[_0x1c64bc[_0x1b40('0x1d')]],'as':_0x1c64bc['as'],'attributes':_0x1c64bc[_0x1b40('0x1a')],'include':_0x1c64bc[_0x1b40('0x1c')]?_[_0x1b40('0x1b')](_0x1c64bc[_0x1b40('0x1c')],function(_0x300a06){return{'model':db[_0x300a06[_0x1b40('0x1d')]],'as':_0x300a06['as'],'attributes':_0x300a06[_0x1b40('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1b40('0xa')](function(_0x51d367){logger[_0x1b40('0xb')](_0x1b40('0x15'),_0x491b0c);logger['debug'](_0x1b40('0x15'),_0x491b0c,JSON[_0x1b40('0xf')](_0x51d367));_0x87895c(_0x51d367);})[_0x1b40('0x14')](function(_0x36f6fe){logger[_0x1b40('0x10')](_0x1b40('0x15'),_0x36f6fe[_0x1b40('0x12')],_0x491b0c);_0x359951(_0x586015[_0x1b40('0x10')](0x1f4,_0x36f6fe[_0x1b40('0x12')]));});});};exports[_0x1b40('0x1e')]=function(_0x36c3be){var _0x468b57=this;return new Promise(function(_0x1ee8e9,_0x3d5f7d){return db[_0x1b40('0x16')][_0x1b40('0x1f')]({'raw':_0x36c3be[_0x1b40('0x17')]?_0x36c3be[_0x1b40('0x17')][_0x1b40('0x18')]===undefined?!![]:![]:!![],'where':_0x36c3be[_0x1b40('0x17')]?_0x36c3be[_0x1b40('0x17')][_0x1b40('0x19')]||null:null,'attributes':_0x36c3be[_0x1b40('0x17')]?_0x36c3be[_0x1b40('0x17')][_0x1b40('0x1a')]||null:null,'include':_0x36c3be['options']?_0x36c3be[_0x1b40('0x17')][_0x1b40('0x1c')]?_[_0x1b40('0x1b')](_0x36c3be[_0x1b40('0x17')][_0x1b40('0x1c')],function(_0x4a5a3f){return{'model':db[_0x4a5a3f[_0x1b40('0x1d')]],'as':_0x4a5a3f['as'],'attributes':_0x4a5a3f['attributes'],'include':_0x4a5a3f[_0x1b40('0x1c')]?_[_0x1b40('0x1b')](_0x4a5a3f['include'],function(_0x441627){return{'model':db[_0x441627[_0x1b40('0x1d')]],'as':_0x441627['as'],'attributes':_0x441627[_0x1b40('0x1a')],'include':_0x441627['include']?_[_0x1b40('0x1b')](_0x441627[_0x1b40('0x1c')],function(_0x506a32){return{'model':db[_0x506a32[_0x1b40('0x1d')]],'as':_0x506a32['as'],'attributes':_0x506a32['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b40('0xa')](function(_0x55a184){logger[_0x1b40('0xb')](_0x1b40('0x1e'),_0x36c3be);logger[_0x1b40('0xe')](_0x1b40('0x1e'),_0x36c3be,JSON[_0x1b40('0xf')](_0x55a184));_0x1ee8e9(_0x55a184);})[_0x1b40('0x14')](function(_0x437420){logger[_0x1b40('0x10')](_0x1b40('0x1e'),_0x437420[_0x1b40('0x12')],_0x36c3be);_0x3d5f7d(_0x468b57[_0x1b40('0x10')](0x1f4,_0x437420['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index db35c7b..43b9d04 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x331c5a,_0x10b42b){var _0x25b091=function(_0x444e0c){while(--_0x444e0c){_0x331c5a['push'](_0x331c5a['shift']());}};_0x25b091(++_0x10b42b);}(_0xe706,0xa3));var _0x6e70=function(_0x265721,_0x1503f2){_0x265721=_0x265721-0x0;var _0x11ec95=_0xe706[_0x265721];return _0x11ec95;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0x0bb5=['put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags'];(function(_0x119e10,_0x196186){var _0xbc1e00=function(_0x205acf){while(--_0x205acf){_0x119e10['push'](_0x119e10['shift']());}};_0xbc1e00(++_0x196186);}(_0x0bb5,0x148));var _0x50bb=function(_0x1bbfdb,_0x5e9be4){_0x1bbfdb=_0x1bbfdb-0x0;var _0x213285=_0x0bb5[_0x1bbfdb];return _0x213285;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id/fields',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x9')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x9')](_0x50bb('0x12'),auth['isAuthenticated'](),controller[_0x50bb('0x13')]);router['post']('/',auth[_0x50bb('0xb')](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')]('/:id/tags',auth[_0x50bb('0xb')](),controller[_0x50bb('0x16')]);router[_0x50bb('0x17')]('/:id',auth[_0x50bb('0xb')](),controller['update']);router[_0x50bb('0x18')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x19')]);module[_0x50bb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index df88128..f12920d 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 _0x3c4f=['STRING','sequelize','exports'];(function(_0x1aae3d,_0x466e40){var _0x215f8a=function(_0x3ed7be){while(--_0x3ed7be){_0x1aae3d['push'](_0x1aae3d['shift']());}};_0x215f8a(++_0x466e40);}(_0x3c4f,0x103));var _0xf3c4=function(_0x34dd2b,_0x2360c6){_0x34dd2b=_0x34dd2b-0x0;var _0x24bb84=_0x3c4f[_0x34dd2b];return _0x24bb84;};'use strict';var Sequelize=require(_0xf3c4('0x0'));module[_0xf3c4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf3c4('0x2')]}}; \ No newline at end of file +var _0x332b=['STRING','sequelize','exports'];(function(_0x2589bf,_0x5dd2e7){var _0x2fb103=function(_0x493d9d){while(--_0x493d9d){_0x2589bf['push'](_0x2589bf['shift']());}};_0x2fb103(++_0x5dd2e7);}(_0x332b,0xaf));var _0xb332=function(_0x154ceb,_0x2f69a1){_0x154ceb=_0x154ceb-0x0;var _0x154048=_0x332b[_0x154ceb];return _0x154048;};'use strict';var Sequelize=require(_0xb332('0x0'));module[_0xb332('0x1')]={'name':{'type':Sequelize[_0xb332('0x2')]},'description':{'type':Sequelize[_0xb332('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d5ec2aa..2b46020 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 _0xd25e=['ZendeskField','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','filters','include','create','body','find','destroy','getFields','findOne'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xd25e,0xba));var _0xed25=function(_0x2c38a8,_0x5897a8){_0x2c38a8=_0x2c38a8-0x0;var _0x5f3f2d=_0xd25e[_0x2c38a8];return _0x5f3f2d;};'use strict';var emlformat=require(_0xed25('0x0'));var rimraf=require(_0xed25('0x1'));var zipdir=require(_0xed25('0x2'));var jsonpatch=require(_0xed25('0x3'));var rp=require(_0xed25('0x4'));var moment=require('moment');var BPromise=require(_0xed25('0x5'));var Mustache=require(_0xed25('0x6'));var util=require(_0xed25('0x7'));var path=require(_0xed25('0x8'));var sox=require('sox');var csv=require(_0xed25('0x9'));var ejs=require(_0xed25('0xa'));var fs=require('fs');var fs_extra=require(_0xed25('0xb'));var _=require(_0xed25('0xc'));var squel=require(_0xed25('0xd'));var crypto=require('crypto');var jsforce=require(_0xed25('0xe'));var deskjs=require(_0xed25('0xf'));var toCsv=require(_0xed25('0x9'));var querystring=require(_0xed25('0x10'));var Papa=require(_0xed25('0x11'));var Redis=require(_0xed25('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xed25('0x13'));var as=require(_0xed25('0x14'));var hardwareService=require(_0xed25('0x15'));var logger=require(_0xed25('0x16'))('api');var utils=require(_0xed25('0x17'));var config=require(_0xed25('0x18'));var licenseUtil=require(_0xed25('0x19'));var db=require(_0xed25('0x1a'))['db'];function respondWithStatusCode(_0x2eefb5,_0x3254f0){_0x3254f0=_0x3254f0||0xcc;return function(_0x5155c7){if(_0x5155c7){return _0x2eefb5[_0xed25('0x1b')](_0x3254f0);}return _0x2eefb5[_0xed25('0x1c')](_0x3254f0)[_0xed25('0x1d')]();};}function respondWithResult(_0x476a46,_0x4f2f41){_0x4f2f41=_0x4f2f41||0xc8;return function(_0x49f0a3){if(_0x49f0a3){return _0x476a46['status'](_0x4f2f41)[_0xed25('0x1e')](_0x49f0a3);}};}function respondWithFilteredResult(_0x22fc6f,_0x42c603){return function(_0x3ea763){if(_0x3ea763){var _0x5258dc=typeof _0x42c603[_0xed25('0x1f')]===_0xed25('0x20')&&typeof _0x42c603[_0xed25('0x21')]==='undefined';var _0x389038=_0x3ea763['count'];var _0x18a6c4=_0x5258dc?0x0:_0x42c603[_0xed25('0x1f')];var _0x3a83ce=_0x5258dc?_0x3ea763[_0xed25('0x22')]:_0x42c603[_0xed25('0x1f')]+_0x42c603['limit'];var _0x452ee1;if(_0x3a83ce>=_0x389038){_0x3a83ce=_0x389038;_0x452ee1=0xc8;}else{_0x452ee1=0xce;}_0x22fc6f[_0xed25('0x1c')](_0x452ee1);return _0x22fc6f['set'](_0xed25('0x23'),_0x18a6c4+'-'+_0x3a83ce+'/'+_0x389038)['json'](_0x3ea763);}return null;};}function patchUpdates(_0x5f3e35){return function(_0x4c342a){try{jsonpatch[_0xed25('0x24')](_0x4c342a,_0x5f3e35,!![]);}catch(_0x4db7c5){return BPromise[_0xed25('0x25')](_0x4db7c5);}return _0x4c342a['save']();};}function saveUpdates(_0x43d8e,_0x43e1f4){return function(_0x5a58bb){if(_0x5a58bb){return _0x5a58bb[_0xed25('0x26')](_0x43d8e)[_0xed25('0x27')](function(_0x4213cc){return _0x4213cc;});}return null;};}function removeEntity(_0x16a487,_0xc33884){return function(_0x5a4ec9){if(_0x5a4ec9){return _0x5a4ec9['destroy']()[_0xed25('0x27')](function(){_0x16a487[_0xed25('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4822d1,_0x51bd1a){return function(_0x57b83f){if(!_0x57b83f){_0x4822d1[_0xed25('0x1b')](0x194);}return _0x57b83f;};}function handleError(_0x2bee3c,_0x2440e5){_0x2440e5=_0x2440e5||0x1f4;return function(_0x8c7f70){logger[_0xed25('0x28')](_0x8c7f70[_0xed25('0x29')]);if(_0x8c7f70['name']){delete _0x8c7f70[_0xed25('0x2a')];}_0x2bee3c[_0xed25('0x1c')](_0x2440e5)[_0xed25('0x2b')](_0x8c7f70);};}exports[_0xed25('0x2c')]=function(_0x319d2e,_0x43d9ce){var _0x32db2c={},_0x31f34c={},_0x206ff4={'count':0x0,'rows':[]};var _0xfd5824=_[_0xed25('0x2d')](db[_0xed25('0x2e')][_0xed25('0x2f')],function(_0x286d11){return{'name':_0x286d11[_0xed25('0x30')],'type':_0x286d11['type'][_0xed25('0x31')]};});_0x31f34c[_0xed25('0x32')]=_['map'](_0xfd5824,_0xed25('0x2a'));_0x31f34c[_0xed25('0x33')]=_[_0xed25('0x34')](_0x319d2e[_0xed25('0x33')]);_0x31f34c['filters']=_[_0xed25('0x35')](_0x31f34c[_0xed25('0x32')],_0x31f34c['query']);_0x32db2c[_0xed25('0x36')]=_['intersection'](_0x31f34c['model'],qs['fields'](_0x319d2e['query'][_0xed25('0x37')]));_0x32db2c[_0xed25('0x36')]=_0x32db2c[_0xed25('0x36')][_0xed25('0x38')]?_0x32db2c[_0xed25('0x36')]:_0x31f34c[_0xed25('0x32')];if(!_0x319d2e[_0xed25('0x33')][_0xed25('0x39')]('nolimit')){_0x32db2c[_0xed25('0x21')]=qs[_0xed25('0x21')](_0x319d2e[_0xed25('0x33')][_0xed25('0x21')]);_0x32db2c[_0xed25('0x1f')]=qs[_0xed25('0x1f')](_0x319d2e[_0xed25('0x33')][_0xed25('0x1f')]);}_0x32db2c[_0xed25('0x3a')]=qs[_0xed25('0x3b')](_0x319d2e[_0xed25('0x33')][_0xed25('0x3b')]);_0x32db2c[_0xed25('0x3c')]=qs['filters'](_[_0xed25('0x3d')](_0x319d2e['query'],_0x31f34c['filters']),_0xfd5824);if(_0x319d2e['query']['filter']){_0x32db2c['where']=_[_0xed25('0x3e')](_0x32db2c[_0xed25('0x3c')],{'$or':_[_0xed25('0x2d')](_0xfd5824,function(_0x331cce){if(_0x331cce[_0xed25('0x3f')]!==_0xed25('0x40')){var _0x1bed79={};_0x1bed79[_0x331cce[_0xed25('0x2a')]]={'$like':'%'+_0x319d2e[_0xed25('0x33')][_0xed25('0x41')]+'%'};return _0x1bed79;}})});}_0x32db2c=_[_0xed25('0x3e')]({},_0x32db2c,_0x319d2e[_0xed25('0x42')]);var _0x3c6fc7={'where':_0x32db2c[_0xed25('0x3c')]};return db[_0xed25('0x2e')][_0xed25('0x22')](_0x3c6fc7)[_0xed25('0x27')](function(_0x3cf298){_0x206ff4[_0xed25('0x22')]=_0x3cf298;if(_0x319d2e[_0xed25('0x33')][_0xed25('0x43')]){_0x32db2c['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xed25('0x44')](_0x32db2c);})[_0xed25('0x27')](function(_0x22b92d){_0x206ff4[_0xed25('0x45')]=_0x22b92d;return _0x206ff4;})[_0xed25('0x27')](respondWithFilteredResult(_0x43d9ce,_0x32db2c))[_0xed25('0x46')](handleError(_0x43d9ce,null));};exports[_0xed25('0x47')]=function(_0x27b0ae,_0x3d9234){var _0x2cf610={'raw':![],'where':{'id':_0x27b0ae[_0xed25('0x48')]['id']}},_0x1a0a43={};_0x1a0a43['model']=_[_0xed25('0x34')](db[_0xed25('0x2e')][_0xed25('0x2f')]);_0x1a0a43[_0xed25('0x33')]=_[_0xed25('0x34')](_0x27b0ae['query']);_0x1a0a43[_0xed25('0x49')]=_[_0xed25('0x35')](_0x1a0a43[_0xed25('0x32')],_0x1a0a43[_0xed25('0x33')]);_0x2cf610[_0xed25('0x36')]=_[_0xed25('0x35')](_0x1a0a43[_0xed25('0x32')],qs[_0xed25('0x37')](_0x27b0ae[_0xed25('0x33')][_0xed25('0x37')]));_0x2cf610['attributes']=_0x2cf610[_0xed25('0x36')][_0xed25('0x38')]?_0x2cf610[_0xed25('0x36')]:_0x1a0a43[_0xed25('0x32')];if(_0x27b0ae['query'][_0xed25('0x43')]){_0x2cf610[_0xed25('0x4a')]=[{'all':!![]}];}_0x2cf610=_[_0xed25('0x3e')]({},_0x2cf610,_0x27b0ae[_0xed25('0x42')]);return db[_0xed25('0x2e')]['find'](_0x2cf610)[_0xed25('0x27')](handleEntityNotFound(_0x3d9234,null))['then'](respondWithResult(_0x3d9234,null))[_0xed25('0x46')](handleError(_0x3d9234,null));};exports[_0xed25('0x4b')]=function(_0x4111d9,_0x9151fb){return db[_0xed25('0x2e')][_0xed25('0x4b')](_0x4111d9[_0xed25('0x4c')],{})[_0xed25('0x27')](respondWithResult(_0x9151fb,0xc9))[_0xed25('0x46')](handleError(_0x9151fb,null));};exports['update']=function(_0x33290e,_0x43cc52){if(_0x33290e[_0xed25('0x4c')]['id']){delete _0x33290e[_0xed25('0x4c')]['id'];}return db['ZendeskConfiguration'][_0xed25('0x4d')]({'where':{'id':_0x33290e[_0xed25('0x48')]['id']}})[_0xed25('0x27')](handleEntityNotFound(_0x43cc52,null))[_0xed25('0x27')](saveUpdates(_0x33290e['body'],null))['then'](respondWithResult(_0x43cc52,null))['catch'](handleError(_0x43cc52,null));};exports[_0xed25('0x4e')]=function(_0x506235,_0x3cb961){return db[_0xed25('0x2e')][_0xed25('0x4d')]({'where':{'id':_0x506235[_0xed25('0x48')]['id']}})[_0xed25('0x27')](handleEntityNotFound(_0x3cb961,null))[_0xed25('0x27')](removeEntity(_0x3cb961,null))[_0xed25('0x46')](handleError(_0x3cb961,null));};exports[_0xed25('0x4f')]=function(_0x498b2b,_0x508807,_0x454da8){var _0x42390e={};var _0xe6509f={};var _0x4011bc;var _0x241822;return db[_0xed25('0x2e')][_0xed25('0x50')]({'where':{'id':_0x498b2b[_0xed25('0x48')]['id']}})[_0xed25('0x27')](handleEntityNotFound(_0x508807,null))[_0xed25('0x27')](function(_0x313c01){if(_0x313c01){_0x4011bc=_0x313c01;_0xe6509f[_0xed25('0x32')]=_[_0xed25('0x34')](db[_0xed25('0x51')][_0xed25('0x2f')]);_0xe6509f['query']=_[_0xed25('0x34')](_0x498b2b[_0xed25('0x33')]);_0xe6509f[_0xed25('0x49')]=_[_0xed25('0x35')](_0xe6509f['model'],_0xe6509f[_0xed25('0x33')]);_0x42390e[_0xed25('0x36')]=_['intersection'](_0xe6509f[_0xed25('0x32')],qs[_0xed25('0x37')](_0x498b2b[_0xed25('0x33')][_0xed25('0x37')]));_0x42390e[_0xed25('0x36')]=_0x42390e['attributes']['length']?_0x42390e['attributes']:_0xe6509f['model'];_0x42390e[_0xed25('0x3a')]=qs[_0xed25('0x3b')](_0x498b2b['query'][_0xed25('0x3b')]);_0x42390e[_0xed25('0x3c')]=qs[_0xed25('0x49')](_['pick'](_0x498b2b[_0xed25('0x33')],_0xe6509f[_0xed25('0x49')]));if(_0x498b2b['query'][_0xed25('0x41')]){_0x42390e[_0xed25('0x3c')]=_[_0xed25('0x3e')](_0x42390e[_0xed25('0x3c')],{'$or':_['map'](_0x42390e[_0xed25('0x36')],function(_0x31ed40){var _0x5c8003={};_0x5c8003[_0x31ed40]={'$like':'%'+_0x498b2b[_0xed25('0x33')]['filter']+'%'};return _0x5c8003;})});}_0x42390e=_[_0xed25('0x3e')]({},_0x42390e,_0x498b2b['options']);return _0x4011bc[_0xed25('0x4f')](_0x42390e);}})[_0xed25('0x27')](function(_0x48f139){if(_0x48f139){_0x241822=_0x48f139[_0xed25('0x38')];if(!_0x498b2b[_0xed25('0x33')][_0xed25('0x39')](_0xed25('0x52'))){_0x42390e[_0xed25('0x21')]=qs[_0xed25('0x21')](_0x498b2b['query'][_0xed25('0x21')]);_0x42390e[_0xed25('0x1f')]=qs[_0xed25('0x1f')](_0x498b2b[_0xed25('0x33')][_0xed25('0x1f')]);}return _0x4011bc['getFields'](_0x42390e);}})[_0xed25('0x27')](function(_0x11f745){if(_0x11f745){return _0x11f745?{'count':_0x241822,'rows':_0x11f745}:null;}})['then'](respondWithResult(_0x508807,null))[_0xed25('0x46')](handleError(_0x508807,null));};exports[_0xed25('0x53')]=function(_0x5b33d9,_0x34d968,_0x1e2c60){var _0x1dbecc={};var _0x50109e={};var _0x547b00;var _0xc2dd92;return db[_0xed25('0x2e')]['findOne']({'where':{'id':_0x5b33d9[_0xed25('0x48')]['id']}})[_0xed25('0x27')](handleEntityNotFound(_0x34d968,null))[_0xed25('0x27')](function(_0x4303c5){if(_0x4303c5){_0x547b00=_0x4303c5;_0x50109e[_0xed25('0x32')]=_[_0xed25('0x34')](db['ZendeskField']['rawAttributes']);_0x50109e[_0xed25('0x33')]=_['keys'](_0x5b33d9[_0xed25('0x33')]);_0x50109e[_0xed25('0x49')]=_[_0xed25('0x35')](_0x50109e[_0xed25('0x32')],_0x50109e['query']);_0x1dbecc[_0xed25('0x36')]=_['intersection'](_0x50109e[_0xed25('0x32')],qs[_0xed25('0x37')](_0x5b33d9[_0xed25('0x33')][_0xed25('0x37')]));_0x1dbecc[_0xed25('0x36')]=_0x1dbecc[_0xed25('0x36')][_0xed25('0x38')]?_0x1dbecc[_0xed25('0x36')]:_0x50109e[_0xed25('0x32')];_0x1dbecc[_0xed25('0x3a')]=qs[_0xed25('0x3b')](_0x5b33d9[_0xed25('0x33')]['sort']);_0x1dbecc[_0xed25('0x3c')]=qs[_0xed25('0x49')](_[_0xed25('0x3d')](_0x5b33d9[_0xed25('0x33')],_0x50109e[_0xed25('0x49')]));if(_0x5b33d9[_0xed25('0x33')]['filter']){_0x1dbecc[_0xed25('0x3c')]=_[_0xed25('0x3e')](_0x1dbecc['where'],{'$or':_[_0xed25('0x2d')](_0x1dbecc['attributes'],function(_0x12f362){var _0x433176={};_0x433176[_0x12f362]={'$like':'%'+_0x5b33d9[_0xed25('0x33')][_0xed25('0x41')]+'%'};return _0x433176;})});}_0x1dbecc=_[_0xed25('0x3e')]({},_0x1dbecc,_0x5b33d9[_0xed25('0x42')]);return _0x547b00[_0xed25('0x53')](_0x1dbecc);}})[_0xed25('0x27')](function(_0x16413a){if(_0x16413a){_0xc2dd92=_0x16413a[_0xed25('0x38')];if(!_0x5b33d9[_0xed25('0x33')][_0xed25('0x39')]('nolimit')){_0x1dbecc[_0xed25('0x21')]=qs[_0xed25('0x21')](_0x5b33d9[_0xed25('0x33')][_0xed25('0x21')]);_0x1dbecc[_0xed25('0x1f')]=qs[_0xed25('0x1f')](_0x5b33d9[_0xed25('0x33')]['offset']);}return _0x547b00[_0xed25('0x53')](_0x1dbecc);}})['then'](function(_0x4e09e9){if(_0x4e09e9){return _0x4e09e9?{'count':_0xc2dd92,'rows':_0x4e09e9}:null;}})[_0xed25('0x27')](respondWithResult(_0x34d968,null))[_0xed25('0x46')](handleError(_0x34d968,null));};exports[_0xed25('0x54')]=function(_0x1bb911,_0x1f3cd1,_0x15df5d){var _0x37dcf2={};var _0x1740e5={};var _0x19757c;var _0x10a93c;return db[_0xed25('0x2e')][_0xed25('0x50')]({'where':{'id':_0x1bb911[_0xed25('0x48')]['id']}})[_0xed25('0x27')](handleEntityNotFound(_0x1f3cd1,null))['then'](function(_0x3c0460){if(_0x3c0460){_0x19757c=_0x3c0460;_0x1740e5[_0xed25('0x32')]=_[_0xed25('0x34')](db['ZendeskField'][_0xed25('0x2f')]);_0x1740e5[_0xed25('0x33')]=_[_0xed25('0x34')](_0x1bb911['query']);_0x1740e5[_0xed25('0x49')]=_[_0xed25('0x35')](_0x1740e5['model'],_0x1740e5[_0xed25('0x33')]);_0x37dcf2[_0xed25('0x36')]=_[_0xed25('0x35')](_0x1740e5[_0xed25('0x32')],qs['fields'](_0x1bb911[_0xed25('0x33')]['fields']));_0x37dcf2[_0xed25('0x36')]=_0x37dcf2[_0xed25('0x36')]['length']?_0x37dcf2[_0xed25('0x36')]:_0x1740e5[_0xed25('0x32')];_0x37dcf2[_0xed25('0x3a')]=qs['sort'](_0x1bb911[_0xed25('0x33')]['sort']);_0x37dcf2[_0xed25('0x3c')]=qs[_0xed25('0x49')](_[_0xed25('0x3d')](_0x1bb911[_0xed25('0x33')],_0x1740e5[_0xed25('0x49')]));if(_0x1bb911[_0xed25('0x33')][_0xed25('0x41')]){_0x37dcf2[_0xed25('0x3c')]=_['merge'](_0x37dcf2[_0xed25('0x3c')],{'$or':_[_0xed25('0x2d')](_0x37dcf2[_0xed25('0x36')],function(_0x355daf){var _0x4f90c6={};_0x4f90c6[_0x355daf]={'$like':'%'+_0x1bb911[_0xed25('0x33')][_0xed25('0x41')]+'%'};return _0x4f90c6;})});}_0x37dcf2=_[_0xed25('0x3e')]({},_0x37dcf2,_0x1bb911[_0xed25('0x42')]);return _0x19757c[_0xed25('0x54')](_0x37dcf2);}})[_0xed25('0x27')](function(_0x1f06cc){if(_0x1f06cc){_0x10a93c=_0x1f06cc[_0xed25('0x38')];if(!_0x1bb911[_0xed25('0x33')][_0xed25('0x39')]('nolimit')){_0x37dcf2[_0xed25('0x21')]=qs[_0xed25('0x21')](_0x1bb911[_0xed25('0x33')][_0xed25('0x21')]);_0x37dcf2[_0xed25('0x1f')]=qs[_0xed25('0x1f')](_0x1bb911['query'][_0xed25('0x1f')]);}return _0x19757c[_0xed25('0x54')](_0x37dcf2);}})[_0xed25('0x27')](function(_0x5b7b17){if(_0x5b7b17){return _0x5b7b17?{'count':_0x10a93c,'rows':_0x5b7b17}:null;}})['then'](respondWithResult(_0x1f3cd1,null))[_0xed25('0x46')](handleError(_0x1f3cd1,null));};exports[_0xed25('0x55')]=function(_0x4733d6,_0x571830,_0x5a61d1){var _0x3b3e04={};var _0xb07c78={};var _0x235771;var _0x3bda51;return db[_0xed25('0x2e')]['findOne']({'where':{'id':_0x4733d6[_0xed25('0x48')]['id']}})[_0xed25('0x27')](handleEntityNotFound(_0x571830,null))[_0xed25('0x27')](function(_0x248c73){if(_0x248c73){_0x235771=_0x248c73;_0xb07c78[_0xed25('0x32')]=_[_0xed25('0x34')](db[_0xed25('0x56')]['rawAttributes']);_0xb07c78[_0xed25('0x33')]=_[_0xed25('0x34')](_0x4733d6[_0xed25('0x33')]);_0xb07c78[_0xed25('0x49')]=_[_0xed25('0x35')](_0xb07c78[_0xed25('0x32')],_0xb07c78['query']);_0x3b3e04['attributes']=_[_0xed25('0x35')](_0xb07c78[_0xed25('0x32')],qs[_0xed25('0x37')](_0x4733d6[_0xed25('0x33')][_0xed25('0x37')]));_0x3b3e04[_0xed25('0x36')]=_0x3b3e04['attributes'][_0xed25('0x38')]?_0x3b3e04[_0xed25('0x36')]:_0xb07c78['model'];_0x3b3e04[_0xed25('0x3a')]=qs[_0xed25('0x3b')](_0x4733d6['query'][_0xed25('0x3b')]);_0x3b3e04['where']=qs[_0xed25('0x49')](_['pick'](_0x4733d6[_0xed25('0x33')],_0xb07c78[_0xed25('0x49')]));if(_0x4733d6['query'][_0xed25('0x41')]){_0x3b3e04[_0xed25('0x3c')]=_[_0xed25('0x3e')](_0x3b3e04[_0xed25('0x3c')],{'$or':_[_0xed25('0x2d')](_0x3b3e04[_0xed25('0x36')],function(_0x3ee730){var _0x3464e9={};_0x3464e9[_0x3ee730]={'$like':'%'+_0x4733d6[_0xed25('0x33')][_0xed25('0x41')]+'%'};return _0x3464e9;})});}_0x3b3e04=_[_0xed25('0x3e')]({},_0x3b3e04,_0x4733d6[_0xed25('0x42')]);return _0x235771[_0xed25('0x55')](_0x3b3e04);}})[_0xed25('0x27')](function(_0x529b39){if(_0x529b39){_0x3bda51=_0x529b39['length'];if(!_0x4733d6[_0xed25('0x33')][_0xed25('0x39')](_0xed25('0x52'))){_0x3b3e04['limit']=qs['limit'](_0x4733d6[_0xed25('0x33')][_0xed25('0x21')]);_0x3b3e04['offset']=qs['offset'](_0x4733d6['query'][_0xed25('0x1f')]);}return _0x235771['getTags'](_0x3b3e04);}})[_0xed25('0x27')](function(_0x45054d){if(_0x45054d){return _0x45054d?{'count':_0x3bda51,'rows':_0x45054d}:null;}})['then'](respondWithResult(_0x571830,null))[_0xed25('0x46')](handleError(_0x571830,null));};exports['setTags']=function(_0x527c90,_0x243c4e,_0x9e632b){if(_0x527c90['body']['id']){delete _0x527c90['body']['id'];}return db[_0xed25('0x2e')][_0xed25('0x50')]({'where':{'id':_0x527c90[_0xed25('0x48')]['id']}})['then'](handleEntityNotFound(_0x243c4e,null))[_0xed25('0x27')](function(_0x4e66ed){if(_0x4e66ed){return _0x4e66ed[_0xed25('0x57')](_0x527c90[_0xed25('0x4c')][_0xed25('0x58')]||[]);}return null;})[_0xed25('0x27')](respondWithResult(_0x243c4e,null))['catch'](handleError(_0x243c4e,null));}; \ No newline at end of file +var _0x1798=['rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','ZendeskConfiguration','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getFields','findOne','ZendeskField','nolimit','getSubjects','order','getDescriptions','getTags','ids','eml-format'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x1798,0xa7));var _0x8179=function(_0x1af2c6,_0x3b0895){_0x1af2c6=_0x1af2c6-0x0;var _0x4e41d3=_0x1798[_0x1af2c6];return _0x4e41d3;};'use strict';var emlformat=require(_0x8179('0x0'));var rimraf=require(_0x8179('0x1'));var zipdir=require(_0x8179('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8179('0x3'));var BPromise=require(_0x8179('0x4'));var Mustache=require(_0x8179('0x5'));var util=require(_0x8179('0x6'));var path=require(_0x8179('0x7'));var sox=require(_0x8179('0x8'));var csv=require(_0x8179('0x9'));var ejs=require(_0x8179('0xa'));var fs=require('fs');var fs_extra=require(_0x8179('0xb'));var _=require(_0x8179('0xc'));var squel=require(_0x8179('0xd'));var crypto=require(_0x8179('0xe'));var jsforce=require(_0x8179('0xf'));var deskjs=require(_0x8179('0x10'));var toCsv=require(_0x8179('0x9'));var querystring=require(_0x8179('0x11'));var Papa=require(_0x8179('0x12'));var Redis=require(_0x8179('0x13'));var authService=require(_0x8179('0x14'));var qs=require(_0x8179('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8179('0x16'));var logger=require('../../config/logger')(_0x8179('0x17'));var utils=require(_0x8179('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8179('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x303ca4,_0x503756){_0x503756=_0x503756||0xcc;return function(_0xb9c896){if(_0xb9c896){return _0x303ca4[_0x8179('0x1a')](_0x503756);}return _0x303ca4[_0x8179('0x1b')](_0x503756)[_0x8179('0x1c')]();};}function respondWithResult(_0x11dc57,_0x4bdd66){_0x4bdd66=_0x4bdd66||0xc8;return function(_0x59a240){if(_0x59a240){return _0x11dc57['status'](_0x4bdd66)[_0x8179('0x1d')](_0x59a240);}};}function respondWithFilteredResult(_0x19d623,_0x89c9ef){return function(_0x1e1e8d){if(_0x1e1e8d){var _0x2c4e0f=typeof _0x89c9ef[_0x8179('0x1e')]===_0x8179('0x1f')&&typeof _0x89c9ef['limit']===_0x8179('0x1f');var _0x5f4ee3=_0x1e1e8d[_0x8179('0x20')];var _0x408093=_0x2c4e0f?0x0:_0x89c9ef['offset'];var _0x3ea362=_0x2c4e0f?_0x1e1e8d[_0x8179('0x20')]:_0x89c9ef[_0x8179('0x1e')]+_0x89c9ef[_0x8179('0x21')];var _0x504afc;if(_0x3ea362>=_0x5f4ee3){_0x3ea362=_0x5f4ee3;_0x504afc=0xc8;}else{_0x504afc=0xce;}_0x19d623['status'](_0x504afc);return _0x19d623[_0x8179('0x22')]('Content-Range',_0x408093+'-'+_0x3ea362+'/'+_0x5f4ee3)[_0x8179('0x1d')](_0x1e1e8d);}return null;};}function patchUpdates(_0x14602a){return function(_0xd49acb){try{jsonpatch[_0x8179('0x23')](_0xd49acb,_0x14602a,!![]);}catch(_0x47bf3a){return BPromise['reject'](_0x47bf3a);}return _0xd49acb['save']();};}function saveUpdates(_0x4ebdcb,_0x353438){return function(_0x20459d){if(_0x20459d){return _0x20459d[_0x8179('0x24')](_0x4ebdcb)[_0x8179('0x25')](function(_0x3427c8){return _0x3427c8;});}return null;};}function removeEntity(_0x3db45a,_0x563926){return function(_0xbeacd8){if(_0xbeacd8){return _0xbeacd8[_0x8179('0x26')]()[_0x8179('0x25')](function(){_0x3db45a[_0x8179('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x445897,_0x51c6f8){return function(_0x3c95b9){if(!_0x3c95b9){_0x445897[_0x8179('0x1a')](0x194);}return _0x3c95b9;};}function handleError(_0x194bcb,_0x4d734a){_0x4d734a=_0x4d734a||0x1f4;return function(_0x5445c0){logger[_0x8179('0x27')](_0x5445c0[_0x8179('0x28')]);if(_0x5445c0[_0x8179('0x29')]){delete _0x5445c0['name'];}_0x194bcb['status'](_0x4d734a)['send'](_0x5445c0);};}exports[_0x8179('0x2a')]=function(_0x306a88,_0x5db153){var _0x5b6de2={},_0x7a430e={},_0x4181c1={'count':0x0,'rows':[]};var _0x22de1c=_[_0x8179('0x2b')](db['ZendeskConfiguration']['rawAttributes'],function(_0x3a614a){return{'name':_0x3a614a[_0x8179('0x2c')],'type':_0x3a614a[_0x8179('0x2d')][_0x8179('0x2e')]};});_0x7a430e[_0x8179('0x2f')]=_[_0x8179('0x2b')](_0x22de1c,_0x8179('0x29'));_0x7a430e[_0x8179('0x30')]=_[_0x8179('0x31')](_0x306a88[_0x8179('0x30')]);_0x7a430e[_0x8179('0x32')]=_[_0x8179('0x33')](_0x7a430e[_0x8179('0x2f')],_0x7a430e[_0x8179('0x30')]);_0x5b6de2[_0x8179('0x34')]=_['intersection'](_0x7a430e['model'],qs[_0x8179('0x35')](_0x306a88[_0x8179('0x30')][_0x8179('0x35')]));_0x5b6de2[_0x8179('0x34')]=_0x5b6de2['attributes'][_0x8179('0x36')]?_0x5b6de2['attributes']:_0x7a430e[_0x8179('0x2f')];if(!_0x306a88[_0x8179('0x30')][_0x8179('0x37')]('nolimit')){_0x5b6de2['limit']=qs[_0x8179('0x21')](_0x306a88['query'][_0x8179('0x21')]);_0x5b6de2[_0x8179('0x1e')]=qs[_0x8179('0x1e')](_0x306a88['query'][_0x8179('0x1e')]);}_0x5b6de2['order']=qs['sort'](_0x306a88['query'][_0x8179('0x38')]);_0x5b6de2['where']=qs[_0x8179('0x32')](_[_0x8179('0x39')](_0x306a88[_0x8179('0x30')],_0x7a430e[_0x8179('0x32')]),_0x22de1c);if(_0x306a88[_0x8179('0x30')][_0x8179('0x3a')]){_0x5b6de2[_0x8179('0x3b')]=_[_0x8179('0x3c')](_0x5b6de2['where'],{'$or':_['map'](_0x22de1c,function(_0x46ef2d){if(_0x46ef2d[_0x8179('0x2d')]!==_0x8179('0x3d')){var _0x1b3308={};_0x1b3308[_0x46ef2d[_0x8179('0x29')]]={'$like':'%'+_0x306a88[_0x8179('0x30')]['filter']+'%'};return _0x1b3308;}})});}_0x5b6de2=_[_0x8179('0x3c')]({},_0x5b6de2,_0x306a88[_0x8179('0x3e')]);var _0x45d025={'where':_0x5b6de2[_0x8179('0x3b')]};return db[_0x8179('0x3f')]['count'](_0x45d025)[_0x8179('0x25')](function(_0x1f07b7){_0x4181c1[_0x8179('0x20')]=_0x1f07b7;if(_0x306a88['query']['includeAll']){_0x5b6de2[_0x8179('0x40')]=[{'all':!![]}];}return db[_0x8179('0x3f')][_0x8179('0x41')](_0x5b6de2);})[_0x8179('0x25')](function(_0x4567c6){_0x4181c1[_0x8179('0x42')]=_0x4567c6;return _0x4181c1;})['then'](respondWithFilteredResult(_0x5db153,_0x5b6de2))[_0x8179('0x43')](handleError(_0x5db153,null));};exports[_0x8179('0x44')]=function(_0x1ebc98,_0x27abb7){var _0x55fc1f={'raw':![],'where':{'id':_0x1ebc98[_0x8179('0x45')]['id']}},_0xae736f={};_0xae736f[_0x8179('0x2f')]=_[_0x8179('0x31')](db[_0x8179('0x3f')][_0x8179('0x46')]);_0xae736f['query']=_[_0x8179('0x31')](_0x1ebc98[_0x8179('0x30')]);_0xae736f['filters']=_['intersection'](_0xae736f['model'],_0xae736f[_0x8179('0x30')]);_0x55fc1f['attributes']=_[_0x8179('0x33')](_0xae736f[_0x8179('0x2f')],qs[_0x8179('0x35')](_0x1ebc98[_0x8179('0x30')][_0x8179('0x35')]));_0x55fc1f[_0x8179('0x34')]=_0x55fc1f['attributes']['length']?_0x55fc1f[_0x8179('0x34')]:_0xae736f['model'];if(_0x1ebc98['query'][_0x8179('0x47')]){_0x55fc1f[_0x8179('0x40')]=[{'all':!![]}];}_0x55fc1f=_[_0x8179('0x3c')]({},_0x55fc1f,_0x1ebc98[_0x8179('0x3e')]);return db[_0x8179('0x3f')][_0x8179('0x48')](_0x55fc1f)[_0x8179('0x25')](handleEntityNotFound(_0x27abb7,null))[_0x8179('0x25')](respondWithResult(_0x27abb7,null))[_0x8179('0x43')](handleError(_0x27abb7,null));};exports[_0x8179('0x49')]=function(_0xbad1e1,_0xd18068){return db[_0x8179('0x3f')][_0x8179('0x49')](_0xbad1e1[_0x8179('0x4a')],{})[_0x8179('0x25')](respondWithResult(_0xd18068,0xc9))[_0x8179('0x43')](handleError(_0xd18068,null));};exports[_0x8179('0x24')]=function(_0x4caecd,_0x1a481e){if(_0x4caecd[_0x8179('0x4a')]['id']){delete _0x4caecd[_0x8179('0x4a')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x4caecd[_0x8179('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a481e,null))[_0x8179('0x25')](saveUpdates(_0x4caecd[_0x8179('0x4a')],null))['then'](respondWithResult(_0x1a481e,null))[_0x8179('0x43')](handleError(_0x1a481e,null));};exports[_0x8179('0x26')]=function(_0x4b3527,_0x7a3fd2){return db[_0x8179('0x3f')][_0x8179('0x48')]({'where':{'id':_0x4b3527[_0x8179('0x45')]['id']}})[_0x8179('0x25')](handleEntityNotFound(_0x7a3fd2,null))[_0x8179('0x25')](removeEntity(_0x7a3fd2,null))['catch'](handleError(_0x7a3fd2,null));};exports[_0x8179('0x4b')]=function(_0x1693e5,_0x4ed1d7,_0x3538a2){var _0x7708a5={};var _0x539531={};var _0x3ef14d;var _0x58f5e9;return db[_0x8179('0x3f')][_0x8179('0x4c')]({'where':{'id':_0x1693e5[_0x8179('0x45')]['id']}})[_0x8179('0x25')](handleEntityNotFound(_0x4ed1d7,null))[_0x8179('0x25')](function(_0x2ad3fb){if(_0x2ad3fb){_0x3ef14d=_0x2ad3fb;_0x539531[_0x8179('0x2f')]=_[_0x8179('0x31')](db[_0x8179('0x4d')][_0x8179('0x46')]);_0x539531[_0x8179('0x30')]=_[_0x8179('0x31')](_0x1693e5[_0x8179('0x30')]);_0x539531[_0x8179('0x32')]=_[_0x8179('0x33')](_0x539531[_0x8179('0x2f')],_0x539531[_0x8179('0x30')]);_0x7708a5[_0x8179('0x34')]=_[_0x8179('0x33')](_0x539531[_0x8179('0x2f')],qs[_0x8179('0x35')](_0x1693e5[_0x8179('0x30')][_0x8179('0x35')]));_0x7708a5[_0x8179('0x34')]=_0x7708a5[_0x8179('0x34')][_0x8179('0x36')]?_0x7708a5[_0x8179('0x34')]:_0x539531[_0x8179('0x2f')];_0x7708a5['order']=qs[_0x8179('0x38')](_0x1693e5[_0x8179('0x30')][_0x8179('0x38')]);_0x7708a5[_0x8179('0x3b')]=qs[_0x8179('0x32')](_[_0x8179('0x39')](_0x1693e5[_0x8179('0x30')],_0x539531[_0x8179('0x32')]));if(_0x1693e5[_0x8179('0x30')][_0x8179('0x3a')]){_0x7708a5[_0x8179('0x3b')]=_[_0x8179('0x3c')](_0x7708a5['where'],{'$or':_[_0x8179('0x2b')](_0x7708a5['attributes'],function(_0x124a2f){var _0x47765e={};_0x47765e[_0x124a2f]={'$like':'%'+_0x1693e5[_0x8179('0x30')][_0x8179('0x3a')]+'%'};return _0x47765e;})});}_0x7708a5=_['merge']({},_0x7708a5,_0x1693e5[_0x8179('0x3e')]);return _0x3ef14d[_0x8179('0x4b')](_0x7708a5);}})[_0x8179('0x25')](function(_0x338a5b){if(_0x338a5b){_0x58f5e9=_0x338a5b['length'];if(!_0x1693e5[_0x8179('0x30')][_0x8179('0x37')](_0x8179('0x4e'))){_0x7708a5[_0x8179('0x21')]=qs[_0x8179('0x21')](_0x1693e5[_0x8179('0x30')][_0x8179('0x21')]);_0x7708a5['offset']=qs['offset'](_0x1693e5[_0x8179('0x30')][_0x8179('0x1e')]);}return _0x3ef14d[_0x8179('0x4b')](_0x7708a5);}})[_0x8179('0x25')](function(_0x1ccff3){if(_0x1ccff3){return _0x1ccff3?{'count':_0x58f5e9,'rows':_0x1ccff3}:null;}})[_0x8179('0x25')](respondWithResult(_0x4ed1d7,null))['catch'](handleError(_0x4ed1d7,null));};exports[_0x8179('0x4f')]=function(_0x578526,_0x51b687,_0x58b65a){var _0x4fea19={};var _0x3e498b={};var _0x20a652;var _0x4815e8;return db[_0x8179('0x3f')][_0x8179('0x4c')]({'where':{'id':_0x578526[_0x8179('0x45')]['id']}})[_0x8179('0x25')](handleEntityNotFound(_0x51b687,null))[_0x8179('0x25')](function(_0x1772f1){if(_0x1772f1){_0x20a652=_0x1772f1;_0x3e498b[_0x8179('0x2f')]=_[_0x8179('0x31')](db[_0x8179('0x4d')][_0x8179('0x46')]);_0x3e498b[_0x8179('0x30')]=_['keys'](_0x578526[_0x8179('0x30')]);_0x3e498b[_0x8179('0x32')]=_[_0x8179('0x33')](_0x3e498b[_0x8179('0x2f')],_0x3e498b[_0x8179('0x30')]);_0x4fea19[_0x8179('0x34')]=_['intersection'](_0x3e498b[_0x8179('0x2f')],qs[_0x8179('0x35')](_0x578526['query'][_0x8179('0x35')]));_0x4fea19[_0x8179('0x34')]=_0x4fea19[_0x8179('0x34')][_0x8179('0x36')]?_0x4fea19[_0x8179('0x34')]:_0x3e498b[_0x8179('0x2f')];_0x4fea19[_0x8179('0x50')]=qs[_0x8179('0x38')](_0x578526[_0x8179('0x30')][_0x8179('0x38')]);_0x4fea19[_0x8179('0x3b')]=qs['filters'](_['pick'](_0x578526[_0x8179('0x30')],_0x3e498b[_0x8179('0x32')]));if(_0x578526[_0x8179('0x30')][_0x8179('0x3a')]){_0x4fea19[_0x8179('0x3b')]=_[_0x8179('0x3c')](_0x4fea19['where'],{'$or':_[_0x8179('0x2b')](_0x4fea19[_0x8179('0x34')],function(_0xfefb9a){var _0x275cf4={};_0x275cf4[_0xfefb9a]={'$like':'%'+_0x578526[_0x8179('0x30')][_0x8179('0x3a')]+'%'};return _0x275cf4;})});}_0x4fea19=_[_0x8179('0x3c')]({},_0x4fea19,_0x578526[_0x8179('0x3e')]);return _0x20a652[_0x8179('0x4f')](_0x4fea19);}})[_0x8179('0x25')](function(_0x2971be){if(_0x2971be){_0x4815e8=_0x2971be[_0x8179('0x36')];if(!_0x578526[_0x8179('0x30')][_0x8179('0x37')](_0x8179('0x4e'))){_0x4fea19[_0x8179('0x21')]=qs[_0x8179('0x21')](_0x578526[_0x8179('0x30')][_0x8179('0x21')]);_0x4fea19['offset']=qs[_0x8179('0x1e')](_0x578526[_0x8179('0x30')][_0x8179('0x1e')]);}return _0x20a652[_0x8179('0x4f')](_0x4fea19);}})[_0x8179('0x25')](function(_0x237313){if(_0x237313){return _0x237313?{'count':_0x4815e8,'rows':_0x237313}:null;}})[_0x8179('0x25')](respondWithResult(_0x51b687,null))[_0x8179('0x43')](handleError(_0x51b687,null));};exports[_0x8179('0x51')]=function(_0x20790e,_0x469048,_0x552c8d){var _0x43be8a={};var _0x596e9b={};var _0x363746;var _0x5c5a5a;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x20790e[_0x8179('0x45')]['id']}})['then'](handleEntityNotFound(_0x469048,null))[_0x8179('0x25')](function(_0x291b83){if(_0x291b83){_0x363746=_0x291b83;_0x596e9b['model']=_[_0x8179('0x31')](db[_0x8179('0x4d')][_0x8179('0x46')]);_0x596e9b[_0x8179('0x30')]=_[_0x8179('0x31')](_0x20790e['query']);_0x596e9b[_0x8179('0x32')]=_[_0x8179('0x33')](_0x596e9b[_0x8179('0x2f')],_0x596e9b[_0x8179('0x30')]);_0x43be8a[_0x8179('0x34')]=_[_0x8179('0x33')](_0x596e9b['model'],qs[_0x8179('0x35')](_0x20790e[_0x8179('0x30')]['fields']));_0x43be8a[_0x8179('0x34')]=_0x43be8a[_0x8179('0x34')][_0x8179('0x36')]?_0x43be8a[_0x8179('0x34')]:_0x596e9b['model'];_0x43be8a[_0x8179('0x50')]=qs[_0x8179('0x38')](_0x20790e[_0x8179('0x30')][_0x8179('0x38')]);_0x43be8a[_0x8179('0x3b')]=qs[_0x8179('0x32')](_[_0x8179('0x39')](_0x20790e[_0x8179('0x30')],_0x596e9b[_0x8179('0x32')]));if(_0x20790e['query'][_0x8179('0x3a')]){_0x43be8a[_0x8179('0x3b')]=_[_0x8179('0x3c')](_0x43be8a[_0x8179('0x3b')],{'$or':_[_0x8179('0x2b')](_0x43be8a[_0x8179('0x34')],function(_0x9d8f32){var _0x361376={};_0x361376[_0x9d8f32]={'$like':'%'+_0x20790e['query']['filter']+'%'};return _0x361376;})});}_0x43be8a=_[_0x8179('0x3c')]({},_0x43be8a,_0x20790e['options']);return _0x363746[_0x8179('0x51')](_0x43be8a);}})[_0x8179('0x25')](function(_0xeafe){if(_0xeafe){_0x5c5a5a=_0xeafe[_0x8179('0x36')];if(!_0x20790e[_0x8179('0x30')][_0x8179('0x37')](_0x8179('0x4e'))){_0x43be8a['limit']=qs[_0x8179('0x21')](_0x20790e['query'][_0x8179('0x21')]);_0x43be8a[_0x8179('0x1e')]=qs['offset'](_0x20790e[_0x8179('0x30')][_0x8179('0x1e')]);}return _0x363746[_0x8179('0x51')](_0x43be8a);}})[_0x8179('0x25')](function(_0x6c053e){if(_0x6c053e){return _0x6c053e?{'count':_0x5c5a5a,'rows':_0x6c053e}:null;}})[_0x8179('0x25')](respondWithResult(_0x469048,null))[_0x8179('0x43')](handleError(_0x469048,null));};exports[_0x8179('0x52')]=function(_0x441038,_0x192efe,_0x35fbc0){var _0x98dca={};var _0x196d06={};var _0x496773;var _0x52da7b;return db[_0x8179('0x3f')][_0x8179('0x4c')]({'where':{'id':_0x441038['params']['id']}})[_0x8179('0x25')](handleEntityNotFound(_0x192efe,null))[_0x8179('0x25')](function(_0x1e549f){if(_0x1e549f){_0x496773=_0x1e549f;_0x196d06['model']=_[_0x8179('0x31')](db['Tag']['rawAttributes']);_0x196d06[_0x8179('0x30')]=_[_0x8179('0x31')](_0x441038[_0x8179('0x30')]);_0x196d06[_0x8179('0x32')]=_[_0x8179('0x33')](_0x196d06[_0x8179('0x2f')],_0x196d06[_0x8179('0x30')]);_0x98dca[_0x8179('0x34')]=_['intersection'](_0x196d06[_0x8179('0x2f')],qs['fields'](_0x441038[_0x8179('0x30')]['fields']));_0x98dca[_0x8179('0x34')]=_0x98dca['attributes'][_0x8179('0x36')]?_0x98dca[_0x8179('0x34')]:_0x196d06['model'];_0x98dca[_0x8179('0x50')]=qs[_0x8179('0x38')](_0x441038[_0x8179('0x30')]['sort']);_0x98dca[_0x8179('0x3b')]=qs[_0x8179('0x32')](_[_0x8179('0x39')](_0x441038[_0x8179('0x30')],_0x196d06['filters']));if(_0x441038[_0x8179('0x30')][_0x8179('0x3a')]){_0x98dca['where']=_[_0x8179('0x3c')](_0x98dca[_0x8179('0x3b')],{'$or':_[_0x8179('0x2b')](_0x98dca[_0x8179('0x34')],function(_0xc3caee){var _0x12626e={};_0x12626e[_0xc3caee]={'$like':'%'+_0x441038[_0x8179('0x30')]['filter']+'%'};return _0x12626e;})});}_0x98dca=_[_0x8179('0x3c')]({},_0x98dca,_0x441038[_0x8179('0x3e')]);return _0x496773['getTags'](_0x98dca);}})[_0x8179('0x25')](function(_0x1baba5){if(_0x1baba5){_0x52da7b=_0x1baba5[_0x8179('0x36')];if(!_0x441038[_0x8179('0x30')][_0x8179('0x37')](_0x8179('0x4e'))){_0x98dca[_0x8179('0x21')]=qs['limit'](_0x441038[_0x8179('0x30')][_0x8179('0x21')]);_0x98dca[_0x8179('0x1e')]=qs[_0x8179('0x1e')](_0x441038[_0x8179('0x30')][_0x8179('0x1e')]);}return _0x496773[_0x8179('0x52')](_0x98dca);}})['then'](function(_0x23537e){if(_0x23537e){return _0x23537e?{'count':_0x52da7b,'rows':_0x23537e}:null;}})['then'](respondWithResult(_0x192efe,null))[_0x8179('0x43')](handleError(_0x192efe,null));};exports['setTags']=function(_0x198d98,_0x3ec6a9,_0x5436c2){if(_0x198d98[_0x8179('0x4a')]['id']){delete _0x198d98[_0x8179('0x4a')]['id'];}return db[_0x8179('0x3f')][_0x8179('0x4c')]({'where':{'id':_0x198d98[_0x8179('0x45')]['id']}})[_0x8179('0x25')](handleEntityNotFound(_0x3ec6a9,null))[_0x8179('0x25')](function(_0x38b183){if(_0x38b183){return _0x38b183['setTags'](_0x198d98[_0x8179('0x4a')][_0x8179('0x53')]||[]);}return null;})[_0x8179('0x25')](respondWithResult(_0x3ec6a9,null))[_0x8179('0x43')](handleError(_0x3ec6a9,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 6989709..90b19be 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 _0x1399=['ZendeskConfiguration','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define'];(function(_0x551413,_0xeddc6b){var _0x306143=function(_0x2fb924){while(--_0x2fb924){_0x551413['push'](_0x551413['shift']());}};_0x306143(++_0xeddc6b);}(_0x1399,0x16c));var _0x9139=function(_0x437bf5,_0x12de66){_0x437bf5=_0x437bf5-0x0;var _0x3a963c=_0x1399[_0x437bf5];return _0x3a963c;};'use strict';var _=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var logger=require('../../config/logger')(_0x9139('0x2'));var moment=require('moment');var BPromise=require(_0x9139('0x3'));var rp=require(_0x9139('0x4'));var fs=require('fs');var path=require(_0x9139('0x5'));var rimraf=require(_0x9139('0x6'));var config=require(_0x9139('0x7'));var attributes=require(_0x9139('0x8'));module['exports']=function(_0x54af2d,_0x8f086b){return _0x54af2d[_0x9139('0x9')](_0x9139('0xa'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea28=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3da9ce,_0x1af8eb){var _0x819246=function(_0x5b1bb8){while(--_0x5b1bb8){_0x3da9ce['push'](_0x3da9ce['shift']());}};_0x819246(++_0x1af8eb);}(_0xea28,0x13a));var _0x8ea2=function(_0xca85ec,_0x4a5e1d){_0xca85ec=_0xca85ec-0x0;var _0x159b07=_0xea28[_0xca85ec];return _0x159b07;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var logger=require(_0x8ea2('0x2'))(_0x8ea2('0x3'));var moment=require(_0x8ea2('0x4'));var BPromise=require(_0x8ea2('0x5'));var rp=require(_0x8ea2('0x6'));var fs=require('fs');var path=require(_0x8ea2('0x7'));var rimraf=require('rimraf');var config=require(_0x8ea2('0x8'));var attributes=require(_0x8ea2('0x9'));module[_0x8ea2('0xa')]=function(_0x513a0d,_0x29b82b){return _0x513a0d[_0x8ea2('0xb')](_0x8ea2('0xc'),attributes,{'tableName':_0x8ea2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 51c20d5..e316b2a 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 _0x24e5=['jayson/promise','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x24e5,0x14c));var _0x524e=function(_0x1d78eb,_0x595be4){_0x1d78eb=_0x1d78eb-0x0;var _0x1d7be4=_0x24e5[_0x1d78eb];return _0x1d7be4;};'use strict';var _=require(_0x524e('0x0'));var util=require(_0x524e('0x1'));var moment=require(_0x524e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x524e('0x3'));var db=require(_0x524e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x524e('0x5'))(_0x524e('0x6'));var config=require(_0x524e('0x7'));var jayson=require(_0x524e('0x8'));var client=jayson['client'][_0x524e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40ecd9,_0x4d72a5,_0x1a71fa){return new BPromise(function(_0x579ddd,_0x253f3a){return client[_0x524e('0xa')](_0x40ecd9,_0x1a71fa)[_0x524e('0xb')](function(_0x4da2fc){logger['info'](_0x524e('0xc'),_0x4d72a5,_0x524e('0xd'));logger[_0x524e('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4d72a5,_0x524e('0xd'),JSON['stringify'](_0x4da2fc));if(_0x4da2fc[_0x524e('0xf')]){if(_0x4da2fc[_0x524e('0xf')][_0x524e('0x10')]===0x1f4){logger[_0x524e('0xf')](_0x524e('0xc'),_0x4d72a5,_0x4da2fc['error'][_0x524e('0x11')]);return _0x253f3a(_0x4da2fc[_0x524e('0xf')][_0x524e('0x11')]);}logger[_0x524e('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4d72a5,_0x4da2fc[_0x524e('0xf')][_0x524e('0x11')]);return _0x579ddd(_0x4da2fc['error']['message']);}else{logger[_0x524e('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4d72a5,_0x524e('0xd'));_0x579ddd(_0x4da2fc['result']['message']);}})[_0x524e('0x13')](function(_0x131064){logger[_0x524e('0xf')](_0x524e('0xc'),_0x4d72a5,_0x131064);_0x253f3a(_0x131064);});});} \ No newline at end of file +var _0x7646=['lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch'];(function(_0x2ee8c3,_0x295892){var _0x4bd0fb=function(_0x10c113){while(--_0x10c113){_0x2ee8c3['push'](_0x2ee8c3['shift']());}};_0x4bd0fb(++_0x295892);}(_0x7646,0x1b8));var _0x6764=function(_0x3989ae,_0x3777b6){_0x3989ae=_0x3989ae-0x0;var _0x5b955b=_0x7646[_0x3989ae];return _0x5b955b;};'use strict';var _=require(_0x6764('0x0'));var util=require(_0x6764('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6764('0x2'));var db=require(_0x6764('0x3'))['db'];var utils=require(_0x6764('0x4'));var logger=require(_0x6764('0x5'))(_0x6764('0x6'));var config=require('../../config/environment');var jayson=require(_0x6764('0x7'));var client=jayson[_0x6764('0x8')][_0x6764('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1268dc,_0x516ff1,_0x4c0e77){return new BPromise(function(_0x4f593e,_0x217e74){return client[_0x6764('0xa')](_0x1268dc,_0x4c0e77)[_0x6764('0xb')](function(_0x4be1b9){logger[_0x6764('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x516ff1,_0x6764('0xd'));logger[_0x6764('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x516ff1,_0x6764('0xd'),JSON['stringify'](_0x4be1b9));if(_0x4be1b9[_0x6764('0xf')]){if(_0x4be1b9['error']['code']===0x1f4){logger[_0x6764('0xf')](_0x6764('0x10'),_0x516ff1,_0x4be1b9[_0x6764('0xf')][_0x6764('0x11')]);return _0x217e74(_0x4be1b9[_0x6764('0xf')][_0x6764('0x11')]);}logger['error'](_0x6764('0x10'),_0x516ff1,_0x4be1b9[_0x6764('0xf')][_0x6764('0x11')]);return _0x4f593e(_0x4be1b9[_0x6764('0xf')]['message']);}else{logger['info'](_0x6764('0x10'),_0x516ff1,_0x6764('0xd'));_0x4f593e(_0x4be1b9[_0x6764('0x12')][_0x6764('0x11')]);}})[_0x6764('0x13')](function(_0x41d35b){logger[_0x6764('0xf')](_0x6764('0x10'),_0x516ff1,_0x41d35b);_0x217e74(_0x41d35b);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index b16fa30..8cad28d 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 _0xfbd4=['./intZendeskField.controller','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x216e58,_0x497adc){var _0x5adcad=function(_0x22197f){while(--_0x22197f){_0x216e58['push'](_0x216e58['shift']());}};_0x5adcad(++_0x497adc);}(_0xfbd4,0xdb));var _0x4fbd=function(_0x13d10f,_0x2a287b){_0x13d10f=_0x13d10f-0x0;var _0x49e0d5=_0xfbd4[_0x13d10f];return _0x49e0d5;};'use strict';var multer=require(_0x4fbd('0x0'));var util=require(_0x4fbd('0x1'));var path=require(_0x4fbd('0x2'));var timeout=require(_0x4fbd('0x3'));var express=require(_0x4fbd('0x4'));var router=express['Router']();var fs_extra=require(_0x4fbd('0x5'));var auth=require(_0x4fbd('0x6'));var interaction=require(_0x4fbd('0x7'));var config=require(_0x4fbd('0x8'));var controller=require(_0x4fbd('0x9'));router['get']('/',auth[_0x4fbd('0xa')](),controller[_0x4fbd('0xb')]);router['get'](_0x4fbd('0xc'),auth[_0x4fbd('0xa')](),controller[_0x4fbd('0xd')]);router[_0x4fbd('0xe')]('/',auth[_0x4fbd('0xa')](),controller['create']);router['put'](_0x4fbd('0xc'),auth['isAuthenticated'](),controller[_0x4fbd('0xf')]);router[_0x4fbd('0x10')](_0x4fbd('0xc'),auth[_0x4fbd('0xa')](),controller[_0x4fbd('0x11')]);module[_0x4fbd('0x12')]=router; \ No newline at end of file +var _0x9a54=['./intZendeskField.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3ee8a4,_0x450a4c){var _0x28f12c=function(_0x234250){while(--_0x234250){_0x3ee8a4['push'](_0x3ee8a4['shift']());}};_0x28f12c(++_0x450a4c);}(_0x9a54,0x162));var _0x49a5=function(_0x3ea5cd,_0x407716){_0x3ea5cd=_0x3ea5cd-0x0;var _0x384157=_0x9a54[_0x3ea5cd];return _0x384157;};'use strict';var multer=require(_0x49a5('0x0'));var util=require('util');var path=require(_0x49a5('0x1'));var timeout=require('connect-timeout');var express=require(_0x49a5('0x2'));var router=express[_0x49a5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x49a5('0x4'));var interaction=require(_0x49a5('0x5'));var config=require('../../config/environment');var controller=require(_0x49a5('0x6'));router['get']('/',auth[_0x49a5('0x7')](),controller[_0x49a5('0x8')]);router[_0x49a5('0x9')](_0x49a5('0xa'),auth[_0x49a5('0x7')](),controller[_0x49a5('0xb')]);router[_0x49a5('0xc')]('/',auth[_0x49a5('0x7')](),controller['create']);router[_0x49a5('0xd')](_0x49a5('0xa'),auth['isAuthenticated'](),controller[_0x49a5('0xe')]);router[_0x49a5('0xf')](_0x49a5('0xa'),auth[_0x49a5('0x7')](),controller[_0x49a5('0x10')]);module[_0x49a5('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 103b551..597042e 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 _0xb87f=['keyValue','STRING','ENUM','sequelize','exports','string','variable'];(function(_0x299566,_0x2b1a0e){var _0xf3bbba=function(_0x5790f1){while(--_0x5790f1){_0x299566['push'](_0x299566['shift']());}};_0xf3bbba(++_0x2b1a0e);}(_0xb87f,0xa4));var _0xfb87=function(_0x2185ac,_0x4ec43c){_0x2185ac=_0x2185ac-0x0;var _0x2e90a0=_0xb87f[_0x2185ac];return _0x2e90a0;};'use strict';var Sequelize=require(_0xfb87('0x0'));module[_0xfb87('0x1')]={'type':{'type':Sequelize['ENUM'](_0xfb87('0x2'),_0xfb87('0x3'),'customVariable',_0xfb87('0x4'),'picklist'),'defaultValue':_0xfb87('0x2')},'content':{'type':Sequelize[_0xfb87('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xfb87('0x6')](_0xfb87('0x2'),_0xfb87('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xfb87('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xfb87('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfb87('0x5')]}}; \ No newline at end of file +var _0x97b1=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x39c34,_0x3577d6){var _0x11152c=function(_0x59743e){while(--_0x59743e){_0x39c34['push'](_0x39c34['shift']());}};_0x11152c(++_0x3577d6);}(_0x97b1,0x18f));var _0x197b=function(_0xe501ff,_0x955b7e){_0xe501ff=_0xe501ff-0x0;var _0x17135d=_0x97b1[_0xe501ff];return _0x17135d;};'use strict';var Sequelize=require(_0x197b('0x0'));module[_0x197b('0x1')]={'type':{'type':Sequelize[_0x197b('0x2')](_0x197b('0x3'),_0x197b('0x4'),_0x197b('0x5'),_0x197b('0x6'),_0x197b('0x7')),'defaultValue':_0x197b('0x3')},'content':{'type':Sequelize[_0x197b('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x197b('0x3'),'variable',_0x197b('0x5'))},'keyContent':{'type':Sequelize[_0x197b('0x8')]},'idField':{'type':Sequelize[_0x197b('0x8')]},'nameField':{'type':Sequelize[_0x197b('0x8')]},'customField':{'type':Sequelize[_0x197b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x197b('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index af06a5d..6c304b8 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 _0x2c5f=['where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','show','keys','merge','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','nolimit','order','sort'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x2c5f,0x139));var _0xf2c5=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x2c5f[_0x32f7d7];return _0x133d09;};'use strict';var emlformat=require(_0xf2c5('0x0'));var rimraf=require(_0xf2c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf2c5('0x2'));var rp=require('request-promise');var moment=require(_0xf2c5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf2c5('0x4'));var util=require(_0xf2c5('0x5'));var path=require(_0xf2c5('0x6'));var sox=require(_0xf2c5('0x7'));var csv=require(_0xf2c5('0x8'));var ejs=require(_0xf2c5('0x9'));var fs=require('fs');var fs_extra=require(_0xf2c5('0xa'));var _=require(_0xf2c5('0xb'));var squel=require(_0xf2c5('0xc'));var crypto=require(_0xf2c5('0xd'));var jsforce=require(_0xf2c5('0xe'));var deskjs=require(_0xf2c5('0xf'));var toCsv=require(_0xf2c5('0x8'));var querystring=require(_0xf2c5('0x10'));var Papa=require(_0xf2c5('0x11'));var Redis=require(_0xf2c5('0x12'));var authService=require(_0xf2c5('0x13'));var qs=require(_0xf2c5('0x14'));var as=require(_0xf2c5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf2c5('0x16'));var db=require(_0xf2c5('0x17'))['db'];function respondWithStatusCode(_0x17584d,_0x4eb01c){_0x4eb01c=_0x4eb01c||0xcc;return function(_0xa658a){if(_0xa658a){return _0x17584d[_0xf2c5('0x18')](_0x4eb01c);}return _0x17584d[_0xf2c5('0x19')](_0x4eb01c)[_0xf2c5('0x1a')]();};}function respondWithResult(_0x58c39a,_0x5e2f41){_0x5e2f41=_0x5e2f41||0xc8;return function(_0x2b360a){if(_0x2b360a){return _0x58c39a[_0xf2c5('0x19')](_0x5e2f41)[_0xf2c5('0x1b')](_0x2b360a);}};}function respondWithFilteredResult(_0x527c40,_0xfef83a){return function(_0x3ad188){if(_0x3ad188){var _0x14a696=typeof _0xfef83a['offset']==='undefined'&&typeof _0xfef83a[_0xf2c5('0x1c')]===_0xf2c5('0x1d');var _0x1fefb8=_0x3ad188[_0xf2c5('0x1e')];var _0x225f1d=_0x14a696?0x0:_0xfef83a[_0xf2c5('0x1f')];var _0x5c7e68=_0x14a696?_0x3ad188[_0xf2c5('0x1e')]:_0xfef83a['offset']+_0xfef83a[_0xf2c5('0x1c')];var _0x27b22f;if(_0x5c7e68>=_0x1fefb8){_0x5c7e68=_0x1fefb8;_0x27b22f=0xc8;}else{_0x27b22f=0xce;}_0x527c40[_0xf2c5('0x19')](_0x27b22f);return _0x527c40['set'](_0xf2c5('0x20'),_0x225f1d+'-'+_0x5c7e68+'/'+_0x1fefb8)['json'](_0x3ad188);}return null;};}function patchUpdates(_0x1bd38a){return function(_0x1fcf71){try{jsonpatch[_0xf2c5('0x21')](_0x1fcf71,_0x1bd38a,!![]);}catch(_0x9b6932){return BPromise[_0xf2c5('0x22')](_0x9b6932);}return _0x1fcf71[_0xf2c5('0x23')]();};}function saveUpdates(_0xf08496,_0x1c4dbc){return function(_0x1ad5e5){if(_0x1ad5e5){return _0x1ad5e5[_0xf2c5('0x24')](_0xf08496)['then'](function(_0x5395df){return _0x5395df;});}return null;};}function removeEntity(_0x7a2a8a,_0x64a560){return function(_0x1a3619){if(_0x1a3619){return _0x1a3619[_0xf2c5('0x25')]()[_0xf2c5('0x26')](function(){_0x7a2a8a[_0xf2c5('0x19')](0xcc)[_0xf2c5('0x1a')]();});}};}function handleEntityNotFound(_0x530469,_0x224886){return function(_0xed4da6){if(!_0xed4da6){_0x530469[_0xf2c5('0x18')](0x194);}return _0xed4da6;};}function handleError(_0x224cf1,_0x375090){_0x375090=_0x375090||0x1f4;return function(_0x133330){logger[_0xf2c5('0x27')](_0x133330[_0xf2c5('0x28')]);if(_0x133330['name']){delete _0x133330[_0xf2c5('0x29')];}_0x224cf1['status'](_0x375090)[_0xf2c5('0x2a')](_0x133330);};}exports[_0xf2c5('0x2b')]=function(_0x55968c,_0x4af1ad){var _0x19c377={},_0x5e0ecc={},_0x4f89f0={'count':0x0,'rows':[]};var _0x3ee102=_[_0xf2c5('0x2c')](db[_0xf2c5('0x2d')][_0xf2c5('0x2e')],function(_0x2f43f5){return{'name':_0x2f43f5[_0xf2c5('0x2f')],'type':_0x2f43f5['type']['key']};});_0x5e0ecc[_0xf2c5('0x30')]=_['map'](_0x3ee102,_0xf2c5('0x29'));_0x5e0ecc[_0xf2c5('0x31')]=_['keys'](_0x55968c[_0xf2c5('0x31')]);_0x5e0ecc['filters']=_[_0xf2c5('0x32')](_0x5e0ecc[_0xf2c5('0x30')],_0x5e0ecc[_0xf2c5('0x31')]);_0x19c377[_0xf2c5('0x33')]=_[_0xf2c5('0x32')](_0x5e0ecc[_0xf2c5('0x30')],qs[_0xf2c5('0x34')](_0x55968c[_0xf2c5('0x31')][_0xf2c5('0x34')]));_0x19c377[_0xf2c5('0x33')]=_0x19c377[_0xf2c5('0x33')][_0xf2c5('0x35')]?_0x19c377[_0xf2c5('0x33')]:_0x5e0ecc[_0xf2c5('0x30')];if(!_0x55968c[_0xf2c5('0x31')]['hasOwnProperty'](_0xf2c5('0x36'))){_0x19c377[_0xf2c5('0x1c')]=qs[_0xf2c5('0x1c')](_0x55968c[_0xf2c5('0x31')][_0xf2c5('0x1c')]);_0x19c377['offset']=qs['offset'](_0x55968c[_0xf2c5('0x31')][_0xf2c5('0x1f')]);}_0x19c377[_0xf2c5('0x37')]=qs[_0xf2c5('0x38')](_0x55968c[_0xf2c5('0x31')][_0xf2c5('0x38')]);_0x19c377[_0xf2c5('0x39')]=qs['filters'](_[_0xf2c5('0x3a')](_0x55968c['query'],_0x5e0ecc['filters']),_0x3ee102);if(_0x55968c[_0xf2c5('0x31')][_0xf2c5('0x3b')]){_0x19c377[_0xf2c5('0x39')]=_['merge'](_0x19c377[_0xf2c5('0x39')],{'$or':_['map'](_0x3ee102,function(_0x2e462e){if(_0x2e462e[_0xf2c5('0x3c')]!==_0xf2c5('0x3d')){var _0x76ed51={};_0x76ed51[_0x2e462e[_0xf2c5('0x29')]]={'$like':'%'+_0x55968c[_0xf2c5('0x31')][_0xf2c5('0x3b')]+'%'};return _0x76ed51;}})});}_0x19c377=_['merge']({},_0x19c377,_0x55968c[_0xf2c5('0x3e')]);var _0xafeb99={'where':_0x19c377['where']};return db[_0xf2c5('0x2d')]['count'](_0xafeb99)['then'](function(_0x52fd1b){_0x4f89f0[_0xf2c5('0x1e')]=_0x52fd1b;if(_0x55968c['query'][_0xf2c5('0x3f')]){_0x19c377[_0xf2c5('0x40')]=[{'all':!![]}];}return db[_0xf2c5('0x2d')][_0xf2c5('0x41')](_0x19c377);})[_0xf2c5('0x26')](function(_0x3cd702){_0x4f89f0['rows']=_0x3cd702;return _0x4f89f0;})['then'](respondWithFilteredResult(_0x4af1ad,_0x19c377))['catch'](handleError(_0x4af1ad,null));};exports[_0xf2c5('0x42')]=function(_0x14cc34,_0x2bcf86){var _0x4a3f61={'raw':!![],'where':{'id':_0x14cc34['params']['id']}},_0x81ade1={};_0x81ade1[_0xf2c5('0x30')]=_['keys'](db['ZendeskField'][_0xf2c5('0x2e')]);_0x81ade1['query']=_[_0xf2c5('0x43')](_0x14cc34[_0xf2c5('0x31')]);_0x81ade1['filters']=_[_0xf2c5('0x32')](_0x81ade1[_0xf2c5('0x30')],_0x81ade1['query']);_0x4a3f61[_0xf2c5('0x33')]=_[_0xf2c5('0x32')](_0x81ade1['model'],qs[_0xf2c5('0x34')](_0x14cc34[_0xf2c5('0x31')]['fields']));_0x4a3f61[_0xf2c5('0x33')]=_0x4a3f61[_0xf2c5('0x33')][_0xf2c5('0x35')]?_0x4a3f61[_0xf2c5('0x33')]:_0x81ade1[_0xf2c5('0x30')];if(_0x14cc34['query'][_0xf2c5('0x3f')]){_0x4a3f61[_0xf2c5('0x40')]=[{'all':!![]}];}_0x4a3f61=_[_0xf2c5('0x44')]({},_0x4a3f61,_0x14cc34['options']);return db['ZendeskField'][_0xf2c5('0x45')](_0x4a3f61)['then'](handleEntityNotFound(_0x2bcf86,null))[_0xf2c5('0x26')](respondWithResult(_0x2bcf86,null))[_0xf2c5('0x46')](handleError(_0x2bcf86,null));};exports[_0xf2c5('0x47')]=function(_0x1b80c2,_0xc62128){return db[_0xf2c5('0x2d')][_0xf2c5('0x47')](_0x1b80c2[_0xf2c5('0x48')],{})[_0xf2c5('0x26')](respondWithResult(_0xc62128,0xc9))['catch'](handleError(_0xc62128,null));};exports['update']=function(_0x23ef79,_0x52303d){if(_0x23ef79[_0xf2c5('0x48')]['id']){delete _0x23ef79[_0xf2c5('0x48')]['id'];}return db[_0xf2c5('0x2d')]['find']({'where':{'id':_0x23ef79['params']['id']}})[_0xf2c5('0x26')](handleEntityNotFound(_0x52303d,null))[_0xf2c5('0x26')](saveUpdates(_0x23ef79['body'],null))[_0xf2c5('0x26')](respondWithResult(_0x52303d,null))[_0xf2c5('0x46')](handleError(_0x52303d,null));};exports[_0xf2c5('0x25')]=function(_0x1b7543,_0x127d09){return db[_0xf2c5('0x2d')][_0xf2c5('0x45')]({'where':{'id':_0x1b7543[_0xf2c5('0x49')]['id']}})[_0xf2c5('0x26')](handleEntityNotFound(_0x127d09,null))['then'](removeEntity(_0x127d09,null))['catch'](handleError(_0x127d09,null));}; \ No newline at end of file +var _0x473d=['where','filters','pick','merge','options','ZendeskField','includeAll','findAll','catch','show','keys','length','include','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','order','sort'];(function(_0x20f39f,_0x1b6b7a){var _0x1f65cd=function(_0x4fbc1b){while(--_0x4fbc1b){_0x20f39f['push'](_0x20f39f['shift']());}};_0x1f65cd(++_0x1b6b7a);}(_0x473d,0x184));var _0xd473=function(_0x2651bc,_0x4d67be){_0x2651bc=_0x2651bc-0x0;var _0x8497bc=_0x473d[_0x2651bc];return _0x8497bc;};'use strict';var emlformat=require(_0xd473('0x0'));var rimraf=require(_0xd473('0x1'));var zipdir=require(_0xd473('0x2'));var jsonpatch=require(_0xd473('0x3'));var rp=require(_0xd473('0x4'));var moment=require('moment');var BPromise=require(_0xd473('0x5'));var Mustache=require(_0xd473('0x6'));var util=require(_0xd473('0x7'));var path=require(_0xd473('0x8'));var sox=require(_0xd473('0x9'));var csv=require(_0xd473('0xa'));var ejs=require(_0xd473('0xb'));var fs=require('fs');var fs_extra=require(_0xd473('0xc'));var _=require('lodash');var squel=require(_0xd473('0xd'));var crypto=require(_0xd473('0xe'));var jsforce=require(_0xd473('0xf'));var deskjs=require(_0xd473('0x10'));var toCsv=require(_0xd473('0xa'));var querystring=require(_0xd473('0x11'));var Papa=require(_0xd473('0x12'));var Redis=require(_0xd473('0x13'));var authService=require(_0xd473('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd473('0x15'));var logger=require(_0xd473('0x16'))(_0xd473('0x17'));var utils=require(_0xd473('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd473('0x19'));var db=require(_0xd473('0x1a'))['db'];function respondWithStatusCode(_0x4e7fe2,_0x2054df){_0x2054df=_0x2054df||0xcc;return function(_0x33e038){if(_0x33e038){return _0x4e7fe2[_0xd473('0x1b')](_0x2054df);}return _0x4e7fe2['status'](_0x2054df)[_0xd473('0x1c')]();};}function respondWithResult(_0x3838ae,_0xa7f414){_0xa7f414=_0xa7f414||0xc8;return function(_0x16e479){if(_0x16e479){return _0x3838ae[_0xd473('0x1d')](_0xa7f414)[_0xd473('0x1e')](_0x16e479);}};}function respondWithFilteredResult(_0x4f822a,_0x37dce4){return function(_0x4f8756){if(_0x4f8756){var _0x194c88=typeof _0x37dce4['offset']===_0xd473('0x1f')&&typeof _0x37dce4['limit']===_0xd473('0x1f');var _0x1df550=_0x4f8756[_0xd473('0x20')];var _0x1e7b77=_0x194c88?0x0:_0x37dce4[_0xd473('0x21')];var _0x4036b6=_0x194c88?_0x4f8756['count']:_0x37dce4[_0xd473('0x21')]+_0x37dce4[_0xd473('0x22')];var _0x520337;if(_0x4036b6>=_0x1df550){_0x4036b6=_0x1df550;_0x520337=0xc8;}else{_0x520337=0xce;}_0x4f822a['status'](_0x520337);return _0x4f822a[_0xd473('0x23')](_0xd473('0x24'),_0x1e7b77+'-'+_0x4036b6+'/'+_0x1df550)[_0xd473('0x1e')](_0x4f8756);}return null;};}function patchUpdates(_0x2c6c25){return function(_0x583ac8){try{jsonpatch[_0xd473('0x25')](_0x583ac8,_0x2c6c25,!![]);}catch(_0x5b0d04){return BPromise['reject'](_0x5b0d04);}return _0x583ac8['save']();};}function saveUpdates(_0xdc15d7,_0x509199){return function(_0x487a6c){if(_0x487a6c){return _0x487a6c[_0xd473('0x26')](_0xdc15d7)[_0xd473('0x27')](function(_0x56639d){return _0x56639d;});}return null;};}function removeEntity(_0x3a9038,_0x27ced9){return function(_0x10048a){if(_0x10048a){return _0x10048a['destroy']()[_0xd473('0x27')](function(){_0x3a9038[_0xd473('0x1d')](0xcc)[_0xd473('0x1c')]();});}};}function handleEntityNotFound(_0x5aebc4,_0xf2630d){return function(_0x4d2262){if(!_0x4d2262){_0x5aebc4[_0xd473('0x1b')](0x194);}return _0x4d2262;};}function handleError(_0x2bfd95,_0x40e3c6){_0x40e3c6=_0x40e3c6||0x1f4;return function(_0x50cb92){logger[_0xd473('0x28')](_0x50cb92['stack']);if(_0x50cb92[_0xd473('0x29')]){delete _0x50cb92[_0xd473('0x29')];}_0x2bfd95[_0xd473('0x1d')](_0x40e3c6)[_0xd473('0x2a')](_0x50cb92);};}exports[_0xd473('0x2b')]=function(_0x3b1ea0,_0x29dc9e){var _0x5ab0dd={},_0x2c1ce4={},_0x85e804={'count':0x0,'rows':[]};var _0x421dea=_[_0xd473('0x2c')](db['ZendeskField'][_0xd473('0x2d')],function(_0xaa59ed){return{'name':_0xaa59ed[_0xd473('0x2e')],'type':_0xaa59ed[_0xd473('0x2f')][_0xd473('0x30')]};});_0x2c1ce4[_0xd473('0x31')]=_[_0xd473('0x2c')](_0x421dea,'name');_0x2c1ce4[_0xd473('0x32')]=_['keys'](_0x3b1ea0[_0xd473('0x32')]);_0x2c1ce4['filters']=_[_0xd473('0x33')](_0x2c1ce4[_0xd473('0x31')],_0x2c1ce4[_0xd473('0x32')]);_0x5ab0dd['attributes']=_[_0xd473('0x33')](_0x2c1ce4[_0xd473('0x31')],qs[_0xd473('0x34')](_0x3b1ea0['query'][_0xd473('0x34')]));_0x5ab0dd[_0xd473('0x35')]=_0x5ab0dd[_0xd473('0x35')]['length']?_0x5ab0dd[_0xd473('0x35')]:_0x2c1ce4[_0xd473('0x31')];if(!_0x3b1ea0[_0xd473('0x32')]['hasOwnProperty']('nolimit')){_0x5ab0dd[_0xd473('0x22')]=qs[_0xd473('0x22')](_0x3b1ea0[_0xd473('0x32')][_0xd473('0x22')]);_0x5ab0dd[_0xd473('0x21')]=qs[_0xd473('0x21')](_0x3b1ea0[_0xd473('0x32')][_0xd473('0x21')]);}_0x5ab0dd[_0xd473('0x36')]=qs[_0xd473('0x37')](_0x3b1ea0[_0xd473('0x32')]['sort']);_0x5ab0dd[_0xd473('0x38')]=qs[_0xd473('0x39')](_[_0xd473('0x3a')](_0x3b1ea0[_0xd473('0x32')],_0x2c1ce4[_0xd473('0x39')]),_0x421dea);if(_0x3b1ea0[_0xd473('0x32')]['filter']){_0x5ab0dd['where']=_[_0xd473('0x3b')](_0x5ab0dd['where'],{'$or':_['map'](_0x421dea,function(_0x14d59a){if(_0x14d59a[_0xd473('0x2f')]!=='VIRTUAL'){var _0x4d8657={};_0x4d8657[_0x14d59a['name']]={'$like':'%'+_0x3b1ea0[_0xd473('0x32')]['filter']+'%'};return _0x4d8657;}})});}_0x5ab0dd=_['merge']({},_0x5ab0dd,_0x3b1ea0[_0xd473('0x3c')]);var _0x974d72={'where':_0x5ab0dd[_0xd473('0x38')]};return db[_0xd473('0x3d')][_0xd473('0x20')](_0x974d72)[_0xd473('0x27')](function(_0x20116e){_0x85e804[_0xd473('0x20')]=_0x20116e;if(_0x3b1ea0[_0xd473('0x32')][_0xd473('0x3e')]){_0x5ab0dd['include']=[{'all':!![]}];}return db[_0xd473('0x3d')][_0xd473('0x3f')](_0x5ab0dd);})[_0xd473('0x27')](function(_0x3d1caf){_0x85e804['rows']=_0x3d1caf;return _0x85e804;})[_0xd473('0x27')](respondWithFilteredResult(_0x29dc9e,_0x5ab0dd))[_0xd473('0x40')](handleError(_0x29dc9e,null));};exports[_0xd473('0x41')]=function(_0x3337fb,_0x46fe2d){var _0x3d2e44={'raw':!![],'where':{'id':_0x3337fb['params']['id']}},_0xede03a={};_0xede03a[_0xd473('0x31')]=_['keys'](db[_0xd473('0x3d')]['rawAttributes']);_0xede03a['query']=_[_0xd473('0x42')](_0x3337fb[_0xd473('0x32')]);_0xede03a[_0xd473('0x39')]=_['intersection'](_0xede03a[_0xd473('0x31')],_0xede03a[_0xd473('0x32')]);_0x3d2e44[_0xd473('0x35')]=_[_0xd473('0x33')](_0xede03a['model'],qs[_0xd473('0x34')](_0x3337fb[_0xd473('0x32')][_0xd473('0x34')]));_0x3d2e44[_0xd473('0x35')]=_0x3d2e44[_0xd473('0x35')][_0xd473('0x43')]?_0x3d2e44[_0xd473('0x35')]:_0xede03a['model'];if(_0x3337fb[_0xd473('0x32')]['includeAll']){_0x3d2e44[_0xd473('0x44')]=[{'all':!![]}];}_0x3d2e44=_[_0xd473('0x3b')]({},_0x3d2e44,_0x3337fb[_0xd473('0x3c')]);return db[_0xd473('0x3d')][_0xd473('0x45')](_0x3d2e44)[_0xd473('0x27')](handleEntityNotFound(_0x46fe2d,null))[_0xd473('0x27')](respondWithResult(_0x46fe2d,null))['catch'](handleError(_0x46fe2d,null));};exports[_0xd473('0x46')]=function(_0x189272,_0xdadb53){return db[_0xd473('0x3d')]['create'](_0x189272[_0xd473('0x47')],{})['then'](respondWithResult(_0xdadb53,0xc9))[_0xd473('0x40')](handleError(_0xdadb53,null));};exports[_0xd473('0x26')]=function(_0x1872d5,_0x21400d){if(_0x1872d5[_0xd473('0x47')]['id']){delete _0x1872d5['body']['id'];}return db['ZendeskField'][_0xd473('0x45')]({'where':{'id':_0x1872d5[_0xd473('0x48')]['id']}})[_0xd473('0x27')](handleEntityNotFound(_0x21400d,null))[_0xd473('0x27')](saveUpdates(_0x1872d5['body'],null))[_0xd473('0x27')](respondWithResult(_0x21400d,null))[_0xd473('0x40')](handleError(_0x21400d,null));};exports[_0xd473('0x49')]=function(_0x537c0d,_0x2ae785){return db[_0xd473('0x3d')][_0xd473('0x45')]({'where':{'id':_0x537c0d['params']['id']}})[_0xd473('0x27')](handleEntityNotFound(_0x2ae785,null))[_0xd473('0x27')](removeEntity(_0x2ae785,null))['catch'](handleError(_0x2ae785,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index ea15f13..abadbda 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 _0xb0ed=['./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1ad9fa,_0x34b1e2){var _0x22718b=function(_0x2fb916){while(--_0x2fb916){_0x1ad9fa['push'](_0x1ad9fa['shift']());}};_0x22718b(++_0x34b1e2);}(_0xb0ed,0xd3));var _0xdb0e=function(_0x41300b,_0x4a2a08){_0x41300b=_0x41300b-0x0;var _0x40af33=_0xb0ed[_0x41300b];return _0x40af33;};'use strict';var _=require(_0xdb0e('0x0'));var util=require(_0xdb0e('0x1'));var logger=require(_0xdb0e('0x2'))(_0xdb0e('0x3'));var moment=require(_0xdb0e('0x4'));var BPromise=require(_0xdb0e('0x5'));var rp=require(_0xdb0e('0x6'));var fs=require('fs');var path=require(_0xdb0e('0x7'));var rimraf=require(_0xdb0e('0x8'));var config=require(_0xdb0e('0x9'));var attributes=require(_0xdb0e('0xa'));module['exports']=function(_0x29df72,_0x21a635){return _0x29df72[_0xdb0e('0xb')](_0xdb0e('0xc'),attributes,{'tableName':_0xdb0e('0xd'),'paranoid':![],'indexes':[{'name':_0xdb0e('0xe'),'fields':[_0xdb0e('0xf'),_0xdb0e('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7b81=['lodash','util','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7b81,0xd2));var _0x17b8=function(_0x2940e2,_0x4d19b1){_0x2940e2=_0x2940e2-0x0;var _0x34b2e0=_0x7b81[_0x2940e2];return _0x34b2e0;};'use strict';var _=require(_0x17b8('0x0'));var util=require(_0x17b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x17b8('0x2'));var BPromise=require('bluebird');var rp=require(_0x17b8('0x3'));var fs=require('fs');var path=require(_0x17b8('0x4'));var rimraf=require(_0x17b8('0x5'));var config=require(_0x17b8('0x6'));var attributes=require(_0x17b8('0x7'));module[_0x17b8('0x8')]=function(_0x3ec381,_0x52bb08){return _0x3ec381[_0x17b8('0x9')](_0x17b8('0xa'),attributes,{'tableName':_0x17b8('0xb'),'paranoid':![],'indexes':[{'name':_0x17b8('0xc'),'fields':['idField',_0x17b8('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 850954b..4a5124e 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 _0x2a98=['request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s'];(function(_0x33154d,_0x854047){var _0x3b2f03=function(_0x35f7a6){while(--_0x35f7a6){_0x33154d['push'](_0x33154d['shift']());}};_0x3b2f03(++_0x854047);}(_0x2a98,0xc9));var _0x82a9=function(_0x867887,_0xd6eeb8){_0x867887=_0x867887-0x0;var _0x1cc048=_0x2a98[_0x867887];return _0x1cc048;};'use strict';var _=require(_0x82a9('0x0'));var util=require(_0x82a9('0x1'));var moment=require(_0x82a9('0x2'));var BPromise=require(_0x82a9('0x3'));var rs=require(_0x82a9('0x4'));var fs=require('fs');var Redis=require(_0x82a9('0x5'));var db=require(_0x82a9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x82a9('0x7'))('rpc');var config=require(_0x82a9('0x8'));var jayson=require(_0x82a9('0x9'));var client=jayson[_0x82a9('0xa')][_0x82a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50f325,_0x2e5d6f,_0x1aa6fc){return new BPromise(function(_0x13bb9a,_0x229f0d){return client[_0x82a9('0xc')](_0x50f325,_0x1aa6fc)[_0x82a9('0xd')](function(_0x1b0f2d){logger['info'](_0x82a9('0xe'),_0x2e5d6f,_0x82a9('0xf'));logger[_0x82a9('0x10')](_0x82a9('0x11'),_0x2e5d6f,_0x82a9('0xf'),JSON[_0x82a9('0x12')](_0x1b0f2d));if(_0x1b0f2d[_0x82a9('0x13')]){if(_0x1b0f2d[_0x82a9('0x13')][_0x82a9('0x14')]===0x1f4){logger[_0x82a9('0x13')](_0x82a9('0xe'),_0x2e5d6f,_0x1b0f2d[_0x82a9('0x13')][_0x82a9('0x15')]);return _0x229f0d(_0x1b0f2d[_0x82a9('0x13')]['message']);}logger[_0x82a9('0x13')](_0x82a9('0xe'),_0x2e5d6f,_0x1b0f2d[_0x82a9('0x13')][_0x82a9('0x15')]);return _0x13bb9a(_0x1b0f2d[_0x82a9('0x13')][_0x82a9('0x15')]);}else{logger[_0x82a9('0x16')](_0x82a9('0xe'),_0x2e5d6f,_0x82a9('0xf'));_0x13bb9a(_0x1b0f2d['result'][_0x82a9('0x15')]);}})[_0x82a9('0x17')](function(_0x13dc7c){logger[_0x82a9('0x13')]('ZendeskField,\x20%s,\x20%s',_0x2e5d6f,_0x13dc7c);_0x229f0d(_0x13dc7c);});});} \ No newline at end of file +var _0xe191=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x7f0006,_0x2abc77){var _0xe61ff4=function(_0xaaf2af){while(--_0xaaf2af){_0x7f0006['push'](_0x7f0006['shift']());}};_0xe61ff4(++_0x2abc77);}(_0xe191,0x1d3));var _0x1e19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe191[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1e19('0x0'));var moment=require('moment');var BPromise=require(_0x1e19('0x1'));var rs=require(_0x1e19('0x2'));var fs=require('fs');var Redis=require(_0x1e19('0x3'));var db=require(_0x1e19('0x4'))['db'];var utils=require(_0x1e19('0x5'));var logger=require(_0x1e19('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1e19('0x7'));var client=jayson['client'][_0x1e19('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17fbd9,_0x31ec74,_0x22bf16){return new BPromise(function(_0x57bde9,_0xaeb834){return client[_0x1e19('0x9')](_0x17fbd9,_0x22bf16)[_0x1e19('0xa')](function(_0x3fea9c){logger[_0x1e19('0xb')](_0x1e19('0xc'),_0x31ec74,'request\x20sent');logger[_0x1e19('0xd')](_0x1e19('0xe'),_0x31ec74,_0x1e19('0xf'),JSON[_0x1e19('0x10')](_0x3fea9c));if(_0x3fea9c[_0x1e19('0x11')]){if(_0x3fea9c['error'][_0x1e19('0x12')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x31ec74,_0x3fea9c[_0x1e19('0x11')][_0x1e19('0x13')]);return _0xaeb834(_0x3fea9c['error'][_0x1e19('0x13')]);}logger[_0x1e19('0x11')](_0x1e19('0xc'),_0x31ec74,_0x3fea9c[_0x1e19('0x11')][_0x1e19('0x13')]);return _0x57bde9(_0x3fea9c['error'][_0x1e19('0x13')]);}else{logger[_0x1e19('0xb')](_0x1e19('0xc'),_0x31ec74,_0x1e19('0xf'));_0x57bde9(_0x3fea9c[_0x1e19('0x14')]['message']);}})[_0x1e19('0x15')](function(_0x30e950){logger[_0x1e19('0x11')]('ZendeskField,\x20%s,\x20%s',_0x31ec74,_0x30e950);_0xaeb834(_0x30e950);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index af5c812..8d85282 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 _0x589b=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','update','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x589b,0x1b2));var _0xb589=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x589b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb589('0x0'));var util=require(_0xb589('0x1'));var path=require('path');var timeout=require(_0xb589('0x2'));var express=require(_0xb589('0x3'));var router=express[_0xb589('0x4')]();var fs_extra=require(_0xb589('0x5'));var auth=require(_0xb589('0x6'));var interaction=require(_0xb589('0x7'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0xb589('0x8')]('/',auth['isAuthenticated'](),controller[_0xb589('0x9')]);router[_0xb589('0x8')](_0xb589('0xa'),auth[_0xb589('0xb')](),controller[_0xb589('0xc')]);router['get'](_0xb589('0xd'),auth[_0xb589('0xb')](),controller[_0xb589('0xe')]);router['get'](_0xb589('0xf'),auth[_0xb589('0xb')](),controller[_0xb589('0x10')]);router['post']('/',auth[_0xb589('0xb')](),controller['create']);router['post'](_0xb589('0xd'),auth[_0xb589('0xb')](),controller[_0xb589('0x11')]);router['put'](_0xb589('0xa'),auth['isAuthenticated'](),controller[_0xb589('0x12')]);router['delete'](_0xb589('0xa'),auth[_0xb589('0xb')](),controller['destroy']);module[_0xb589('0x13')]=router; \ No newline at end of file +var _0xfbbd=['get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','isAuthenticated','index'];(function(_0xd06969,_0x4302a6){var _0xfa260e=function(_0x280053){while(--_0x280053){_0xd06969['push'](_0xd06969['shift']());}};_0xfa260e(++_0x4302a6);}(_0xfbbd,0xcd));var _0xdfbb=function(_0x1a272a,_0x73916e){_0x1a272a=_0x1a272a-0x0;var _0x307fd6=_0xfbbd[_0x1a272a];return _0x307fd6;};'use strict';var multer=require(_0xdfbb('0x0'));var util=require(_0xdfbb('0x1'));var path=require(_0xdfbb('0x2'));var timeout=require(_0xdfbb('0x3'));var express=require('express');var router=express[_0xdfbb('0x4')]();var fs_extra=require(_0xdfbb('0x5'));var auth=require(_0xdfbb('0x6'));var interaction=require(_0xdfbb('0x7'));var config=require('../../config/environment');var controller=require(_0xdfbb('0x8'));router['get']('/',auth[_0xdfbb('0x9')](),controller[_0xdfbb('0xa')]);router[_0xdfbb('0xb')](_0xdfbb('0xc'),auth[_0xdfbb('0x9')](),controller[_0xdfbb('0xd')]);router[_0xdfbb('0xb')](_0xdfbb('0xe'),auth[_0xdfbb('0x9')](),controller[_0xdfbb('0xf')]);router[_0xdfbb('0xb')](_0xdfbb('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0xdfbb('0x11')]('/',auth[_0xdfbb('0x9')](),controller[_0xdfbb('0x12')]);router['post'](_0xdfbb('0xe'),auth[_0xdfbb('0x9')](),controller[_0xdfbb('0x13')]);router[_0xdfbb('0x14')]('/:id',auth[_0xdfbb('0x9')](),controller[_0xdfbb('0x15')]);router['delete'](_0xdfbb('0xc'),auth[_0xdfbb('0x9')](),controller[_0xdfbb('0x16')]);module[_0xdfbb('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 033f07a..8f0b27d 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 _0x9bde=['STRING','exports'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0x9bde,0xe1));var _0xe9bd=function(_0x57f723,_0x31fb67){_0x57f723=_0x57f723-0x0;var _0x4e49cd=_0x9bde[_0x57f723];return _0x4e49cd;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe9bd('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xe9bd('0x1')]},'clientId':{'type':Sequelize[_0xe9bd('0x1')]},'clientSecret':{'type':Sequelize[_0xe9bd('0x1')]},'serverUrl':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe9bd('0x1')]},'refreshToken':{'type':Sequelize[_0xe9bd('0x1')]}}; \ No newline at end of file +var _0x55e0=['STRING','sequelize','exports'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x55e0,0xdc));var _0x055e=function(_0x2a9e9f,_0xf513b8){_0x2a9e9f=_0x2a9e9f-0x0;var _0x46b9ba=_0x55e0[_0x2a9e9f];return _0x46b9ba;};'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 diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index adb062d..e831cd6 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 _0xd57f=['Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','count','set','json','reject','save','update','then','destroy','end','error','stack','send','index','map','ZohoAccount','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','rawAttributes','length','find','catch','create','body','getConfigurations','keys','options','Subjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','findOne','host','serverUrl','code','refreshToken','zoho.eu','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','name'];(function(_0x755a60,_0x4e0df5){var _0x5ad7b1=function(_0x11dbc2){while(--_0x11dbc2){_0x755a60['push'](_0x755a60['shift']());}};_0x5ad7b1(++_0x4e0df5);}(_0xd57f,0x175));var _0xfd57=function(_0x3934f3,_0x302172){_0x3934f3=_0x3934f3-0x0;var _0x3ce840=_0xd57f[_0x3934f3];return _0x3ce840;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfd57('0x0'));var zipdir=require(_0xfd57('0x1'));var jsonpatch=require(_0xfd57('0x2'));var rp=require(_0xfd57('0x3'));var moment=require(_0xfd57('0x4'));var BPromise=require(_0xfd57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfd57('0x6'));var fs=require('fs');var fs_extra=require(_0xfd57('0x7'));var _=require('lodash');var squel=require(_0xfd57('0x8'));var crypto=require(_0xfd57('0x9'));var jsforce=require(_0xfd57('0xa'));var deskjs=require(_0xfd57('0xb'));var toCsv=require(_0xfd57('0xc'));var querystring=require(_0xfd57('0xd'));var Papa=require('papaparse');var Redis=require(_0xfd57('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfd57('0xf'));var as=require(_0xfd57('0x10'));var hardwareService=require(_0xfd57('0x11'));var logger=require(_0xfd57('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfd57('0x13'))['db'];var integrations=require(_0xfd57('0x14'));function respondWithStatusCode(_0x5becdf,_0x185270){_0x185270=_0x185270||0xcc;return function(_0x597462){if(_0x597462){return _0x5becdf[_0xfd57('0x15')](_0x185270);}return _0x5becdf['status'](_0x185270)['end']();};}function respondWithResult(_0x2c841e,_0x2e9198){_0x2e9198=_0x2e9198||0xc8;return function(_0xa6cd98){if(_0xa6cd98){return _0x2c841e[_0xfd57('0x16')](_0x2e9198)['json'](_0xa6cd98);}};}function respondWithFilteredResult(_0x3dec51,_0x10a9a1){return function(_0x38bfc7){if(_0x38bfc7){var _0x9fc731=typeof _0x10a9a1[_0xfd57('0x17')]===_0xfd57('0x18')&&typeof _0x10a9a1['limit']===_0xfd57('0x18');var _0x2cd1b8=_0x38bfc7['count'];var _0x125982=_0x9fc731?0x0:_0x10a9a1[_0xfd57('0x17')];var _0x5ed854=_0x9fc731?_0x38bfc7[_0xfd57('0x19')]:_0x10a9a1['offset']+_0x10a9a1['limit'];var _0x4de9a3;if(_0x5ed854>=_0x2cd1b8){_0x5ed854=_0x2cd1b8;_0x4de9a3=0xc8;}else{_0x4de9a3=0xce;}_0x3dec51[_0xfd57('0x16')](_0x4de9a3);return _0x3dec51[_0xfd57('0x1a')]('Content-Range',_0x125982+'-'+_0x5ed854+'/'+_0x2cd1b8)[_0xfd57('0x1b')](_0x38bfc7);}return null;};}function patchUpdates(_0x549dbf){return function(_0xd28b76){try{jsonpatch['apply'](_0xd28b76,_0x549dbf,!![]);}catch(_0x569d99){return BPromise[_0xfd57('0x1c')](_0x569d99);}return _0xd28b76[_0xfd57('0x1d')]();};}function saveUpdates(_0x574d2a,_0x30773a){return function(_0x42eb0d){if(_0x42eb0d){return _0x42eb0d[_0xfd57('0x1e')](_0x574d2a)[_0xfd57('0x1f')](function(_0x114f04){return _0x114f04;});}return null;};}function removeEntity(_0xbe0b0d,_0x498e48){return function(_0x300296){if(_0x300296){return _0x300296[_0xfd57('0x20')]()['then'](function(){_0xbe0b0d[_0xfd57('0x16')](0xcc)[_0xfd57('0x21')]();});}};}function handleEntityNotFound(_0x269bda,_0x5a5477){return function(_0x5149d9){if(!_0x5149d9){_0x269bda[_0xfd57('0x15')](0x194);}return _0x5149d9;};}function handleError(_0x17a349,_0x5bd63c){_0x5bd63c=_0x5bd63c||0x1f4;return function(_0x5dd09a){logger[_0xfd57('0x22')](_0x5dd09a[_0xfd57('0x23')]);if(_0x5dd09a['name']){delete _0x5dd09a['name'];}_0x17a349[_0xfd57('0x16')](_0x5bd63c)[_0xfd57('0x24')](_0x5dd09a);};}exports[_0xfd57('0x25')]=function(_0x3dee66,_0x24e511){var _0x279245={},_0x2e9b4={},_0x3c0a38={'count':0x0,'rows':[]};var _0x3ff801=_[_0xfd57('0x26')](db[_0xfd57('0x27')]['rawAttributes'],function(_0xe8151d){return{'name':_0xe8151d['fieldName'],'type':_0xe8151d[_0xfd57('0x28')][_0xfd57('0x29')]};});_0x2e9b4[_0xfd57('0x2a')]=_[_0xfd57('0x26')](_0x3ff801,'name');_0x2e9b4[_0xfd57('0x2b')]=_['keys'](_0x3dee66[_0xfd57('0x2b')]);_0x2e9b4[_0xfd57('0x2c')]=_[_0xfd57('0x2d')](_0x2e9b4['model'],_0x2e9b4['query']);_0x279245[_0xfd57('0x2e')]=_[_0xfd57('0x2d')](_0x2e9b4[_0xfd57('0x2a')],qs[_0xfd57('0x2f')](_0x3dee66[_0xfd57('0x2b')][_0xfd57('0x2f')]));_0x279245[_0xfd57('0x2e')]=_0x279245[_0xfd57('0x2e')]['length']?_0x279245[_0xfd57('0x2e')]:_0x2e9b4[_0xfd57('0x2a')];if(!_0x3dee66[_0xfd57('0x2b')][_0xfd57('0x30')](_0xfd57('0x31'))){_0x279245[_0xfd57('0x32')]=qs[_0xfd57('0x32')](_0x3dee66['query'][_0xfd57('0x32')]);_0x279245[_0xfd57('0x17')]=qs['offset'](_0x3dee66[_0xfd57('0x2b')][_0xfd57('0x17')]);}_0x279245[_0xfd57('0x33')]=qs[_0xfd57('0x34')](_0x3dee66['query']['sort']);_0x279245[_0xfd57('0x35')]=qs['filters'](_[_0xfd57('0x36')](_0x3dee66[_0xfd57('0x2b')],_0x2e9b4[_0xfd57('0x2c')]),_0x3ff801);if(_0x3dee66[_0xfd57('0x2b')][_0xfd57('0x37')]){_0x279245[_0xfd57('0x35')]=_[_0xfd57('0x38')](_0x279245[_0xfd57('0x35')],{'$or':_['map'](_0x3ff801,function(_0x58160e){if(_0x58160e['type']!==_0xfd57('0x39')){var _0x5dca08={};_0x5dca08[_0x58160e['name']]={'$like':'%'+_0x3dee66[_0xfd57('0x2b')][_0xfd57('0x37')]+'%'};return _0x5dca08;}})});}_0x279245=_[_0xfd57('0x38')]({},_0x279245,_0x3dee66['options']);var _0x324be8={'where':_0x279245[_0xfd57('0x35')]};return db[_0xfd57('0x27')]['count'](_0x324be8)[_0xfd57('0x1f')](function(_0x12ea09){_0x3c0a38[_0xfd57('0x19')]=_0x12ea09;if(_0x3dee66[_0xfd57('0x2b')][_0xfd57('0x3a')]){_0x279245[_0xfd57('0x3b')]=[{'all':!![]}];}return db[_0xfd57('0x27')][_0xfd57('0x3c')](_0x279245);})['then'](function(_0x1ca314){_0x3c0a38[_0xfd57('0x3d')]=_0x1ca314;return _0x3c0a38;})[_0xfd57('0x1f')](respondWithFilteredResult(_0x24e511,_0x279245))['catch'](handleError(_0x24e511,null));};exports['show']=function(_0x45f6ee,_0x1d4550){var _0xdb1a54={'raw':![],'where':{'id':_0x45f6ee[_0xfd57('0x3e')]['id']}},_0x57bef7={};_0x57bef7[_0xfd57('0x2a')]=_['keys'](db[_0xfd57('0x27')][_0xfd57('0x3f')]);_0x57bef7[_0xfd57('0x2b')]=_['keys'](_0x45f6ee[_0xfd57('0x2b')]);_0x57bef7['filters']=_['intersection'](_0x57bef7[_0xfd57('0x2a')],_0x57bef7[_0xfd57('0x2b')]);_0xdb1a54[_0xfd57('0x2e')]=_[_0xfd57('0x2d')](_0x57bef7['model'],qs['fields'](_0x45f6ee[_0xfd57('0x2b')][_0xfd57('0x2f')]));_0xdb1a54[_0xfd57('0x2e')]=_0xdb1a54[_0xfd57('0x2e')][_0xfd57('0x40')]?_0xdb1a54[_0xfd57('0x2e')]:_0x57bef7[_0xfd57('0x2a')];if(_0x45f6ee['query'][_0xfd57('0x3a')]){_0xdb1a54[_0xfd57('0x3b')]=[{'all':!![]}];}_0xdb1a54=_[_0xfd57('0x38')]({},_0xdb1a54,_0x45f6ee['options']);return db['ZohoAccount'][_0xfd57('0x41')](_0xdb1a54)[_0xfd57('0x1f')](handleEntityNotFound(_0x1d4550,null))[_0xfd57('0x1f')](respondWithResult(_0x1d4550,null))[_0xfd57('0x42')](handleError(_0x1d4550,null));};exports[_0xfd57('0x43')]=function(_0x4927ca,_0x24996b){return db[_0xfd57('0x27')][_0xfd57('0x43')](_0x4927ca[_0xfd57('0x44')],{})[_0xfd57('0x1f')](respondWithResult(_0x24996b,0xc9))[_0xfd57('0x42')](handleError(_0x24996b,null));};exports[_0xfd57('0x1e')]=function(_0x1c55cd,_0x567b95){if(_0x1c55cd[_0xfd57('0x44')]['id']){delete _0x1c55cd[_0xfd57('0x44')]['id'];}return db[_0xfd57('0x27')][_0xfd57('0x41')]({'where':{'id':_0x1c55cd['params']['id']}})[_0xfd57('0x1f')](handleEntityNotFound(_0x567b95,null))[_0xfd57('0x1f')](saveUpdates(_0x1c55cd[_0xfd57('0x44')],null))[_0xfd57('0x1f')](respondWithResult(_0x567b95,null))[_0xfd57('0x42')](handleError(_0x567b95,null));};exports[_0xfd57('0x20')]=function(_0x1c16e2,_0x2e563e){return db['ZohoAccount'][_0xfd57('0x41')]({'where':{'id':_0x1c16e2[_0xfd57('0x3e')]['id']}})[_0xfd57('0x1f')](handleEntityNotFound(_0x2e563e,null))[_0xfd57('0x1f')](removeEntity(_0x2e563e,null))[_0xfd57('0x42')](handleError(_0x2e563e,null));};exports[_0xfd57('0x45')]=function(_0x50a094,_0x1e3249,_0x235270){var _0x4b6c1d={};var _0x3a602e={};var _0x31643c;var _0x15917d;return db[_0xfd57('0x27')]['findOne']({'where':{'id':_0x50a094[_0xfd57('0x3e')]['id']}})[_0xfd57('0x1f')](handleEntityNotFound(_0x1e3249,null))['then'](function(_0x15a146){if(_0x15a146){_0x31643c=_0x15a146;_0x3a602e[_0xfd57('0x2a')]=_[_0xfd57('0x46')](db['ZohoConfiguration'][_0xfd57('0x3f')]);_0x3a602e[_0xfd57('0x2b')]=_[_0xfd57('0x46')](_0x50a094[_0xfd57('0x2b')]);_0x3a602e[_0xfd57('0x2c')]=_[_0xfd57('0x2d')](_0x3a602e[_0xfd57('0x2a')],_0x3a602e[_0xfd57('0x2b')]);_0x4b6c1d[_0xfd57('0x2e')]=_[_0xfd57('0x2d')](_0x3a602e[_0xfd57('0x2a')],qs['fields'](_0x50a094[_0xfd57('0x2b')][_0xfd57('0x2f')]));_0x4b6c1d[_0xfd57('0x2e')]=_0x4b6c1d[_0xfd57('0x2e')][_0xfd57('0x40')]?_0x4b6c1d[_0xfd57('0x2e')]:_0x3a602e['model'];_0x4b6c1d['order']=qs[_0xfd57('0x34')](_0x50a094[_0xfd57('0x2b')][_0xfd57('0x34')]);_0x4b6c1d['where']=qs[_0xfd57('0x2c')](_[_0xfd57('0x36')](_0x50a094['query'],_0x3a602e[_0xfd57('0x2c')]));if(_0x50a094[_0xfd57('0x2b')]['filter']){_0x4b6c1d[_0xfd57('0x35')]=_[_0xfd57('0x38')](_0x4b6c1d['where'],{'$or':_['map'](_0x4b6c1d[_0xfd57('0x2e')],function(_0xbcdddf){var _0x142cf1={};_0x142cf1[_0xbcdddf]={'$like':'%'+_0x50a094[_0xfd57('0x2b')][_0xfd57('0x37')]+'%'};return _0x142cf1;})});}_0x4b6c1d=_[_0xfd57('0x38')]({},_0x4b6c1d,_0x50a094[_0xfd57('0x47')]);return _0x31643c['getConfigurations'](_0x4b6c1d);}})['then'](function(_0x1acc8b){if(_0x1acc8b){_0x15917d=_0x1acc8b[_0xfd57('0x40')];if(!_0x50a094[_0xfd57('0x2b')][_0xfd57('0x30')](_0xfd57('0x31'))){_0x4b6c1d[_0xfd57('0x32')]=qs[_0xfd57('0x32')](_0x50a094[_0xfd57('0x2b')][_0xfd57('0x32')]);_0x4b6c1d['offset']=qs['offset'](_0x50a094[_0xfd57('0x2b')]['offset']);}return _0x31643c[_0xfd57('0x45')](_0x4b6c1d);}})[_0xfd57('0x1f')](function(_0x99552e){if(_0x99552e){return _0x99552e?{'count':_0x15917d,'rows':_0x99552e}:null;}})['then'](respondWithResult(_0x1e3249,null))[_0xfd57('0x42')](handleError(_0x1e3249,null));};exports['addConfiguration']=function(_0x2c7173,_0x2fae84,_0x4156f5){if(_0x2c7173[_0xfd57('0x44')]['id']){delete _0x2c7173[_0xfd57('0x44')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x2c7173[_0xfd57('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2fae84,null))[_0xfd57('0x1f')](function(_0x1814c1){if(_0x1814c1){_0x2c7173[_0xfd57('0x44')]['AccountId']=_0x1814c1['id'];_0x2c7173['body'][_0xfd57('0x48')]=integrations['getSubjects'](_0x2c7173[_0xfd57('0x44')][_0xfd57('0x49')],_0x2c7173['body']['type']);_0x2c7173['body'][_0xfd57('0x4a')]=integrations[_0xfd57('0x4b')](_0x2c7173[_0xfd57('0x44')][_0xfd57('0x49')],_0x2c7173[_0xfd57('0x44')]['type']);return db[_0xfd57('0x4c')][_0xfd57('0x43')](_0x2c7173[_0xfd57('0x44')],{'include':[{'model':db[_0xfd57('0x4d')],'as':_0xfd57('0x48')},{'model':db[_0xfd57('0x4d')],'as':_0xfd57('0x4a')}]});}return null;})[_0xfd57('0x1f')](respondWithResult(_0x2fae84,null))['catch'](handleError(_0x2fae84,null));};function getAccessToken(_0x5c994c){return new Promise(function(_0x8cc350,_0x4a0218){var _0x360d76;switch(_0x5c994c[_0xfd57('0x4e')]){case'US':_0x360d76=_0xfd57('0x4f');break;case'AU':_0x360d76=_0xfd57('0x50');break;case'EU':_0x360d76=_0xfd57('0x51');break;case'IN':_0x360d76='https://accounts.zoho.in';break;case'CN':_0x360d76='https://accounts.zoho.com.cn';break;default:_0x360d76=_0xfd57('0x51');break;}var _0x509c24={'method':_0xfd57('0x52'),'uri':_0x360d76+_0xfd57('0x53'),'qs':{'refresh_token':_0x5c994c['refreshToken'],'client_id':_0x5c994c[_0xfd57('0x54')],'client_secret':_0x5c994c[_0xfd57('0x55')],'grant_type':_0xfd57('0x56')},'json':!![]};return rp(_0x509c24)[_0xfd57('0x1f')](function(_0x449441){if(_0x449441['access_token']){_0x8cc350(_0x449441[_0xfd57('0x57')]);}else{_0x4a0218(_0xfd57('0x58'));}})[_0xfd57('0x42')](function(_0x53d4eb){_0x4a0218(_0x53d4eb);});});}exports['getFields']=function(_0x1463fe,_0x4ea618,_0x41c45f){var _0x5c9036,_0x2fa088,_0x5c172e,_0x4d484b,_0x496109;return db['ZohoAccount'][_0xfd57('0x59')]({'where':{'id':_0x1463fe['params']['id']},'attributes':['id',_0xfd57('0x5a'),_0xfd57('0x4e'),_0xfd57('0x54'),'clientSecret',_0xfd57('0x5b'),_0xfd57('0x5c'),_0xfd57('0x5d')]})[_0xfd57('0x1f')](handleEntityNotFound(_0x4ea618,null))['then'](function(_0x4b1dab){_0x496109=_0x4b1dab;_0x5c9036=_0x496109[_0xfd57('0x5a')];_0x2fa088=_0x5c9036===_0xfd57('0x5e')?'eu':'com';_0x5c172e=_0x496109['serverUrl'];var _0x331caf=_0x5c172e['slice'](-0x1);if(_0x331caf==='/'||_0x331caf==='\x5c'||_0x331caf===':'){_0x5c172e=_0x5c172e[_0xfd57('0x5f')](0x0,_0x5c172e[_0xfd57('0x60')](_0x331caf));}if(!_0x496109[_0xfd57('0x5d')]){throw new Error(_0xfd57('0x61'));}return getAccessToken(_0x496109);})[_0xfd57('0x1f')](function(_0x13994c){if(_0x13994c){return rp({'method':'GET','uri':util[_0xfd57('0x62')](_0xfd57('0x63'),_0x2fa088),'qs':{'module':'Calls'},'headers':{'Authorization':_0xfd57('0x64')+_0x13994c},'json':!![]});}})[_0xfd57('0x1f')](function(_0x525807){if(_0x525807){if(_0x525807[_0xfd57('0x65')]&&_0x525807[_0xfd57('0x65')][_0xfd57('0x22')]){throw new Error(_0x525807['response'][_0xfd57('0x22')]['message']);}var _0x131a13=[];var _0x33058e=[];var _0x5a8739=[_0xfd57('0x66'),'Subject','Description',_0xfd57('0x67'),_0xfd57('0x68'),_0xfd57('0x69'),_0xfd57('0x6a'),_0xfd57('0x6b')];_0x33058e=_[_0xfd57('0x6c')](_0x525807['fields'],function(_0x181eae){return _0x5a8739[_0xfd57('0x6d')](_0x181eae[_0xfd57('0x6e')]);});for(var _0x2f6cfe=0x0;_0x2f6cfe<_0x33058e[_0xfd57('0x40')];_0x2f6cfe++){if(_0x33058e[_0x2f6cfe][_0xfd57('0x6f')]===![]){_0x131a13[_0xfd57('0x70')]({'id':_0x33058e[_0x2f6cfe]['id'],'name':_0x33058e[_0x2f6cfe]['display_label'],'custom':_0x33058e[_0x2f6cfe][_0xfd57('0x71')],'options':_0x33058e[_0x2f6cfe][_0xfd57('0x72')]===_0xfd57('0x73')&&_0x33058e[_0x2f6cfe]['pick_list_values'][_0xfd57('0x40')]>-0x1?_[_0xfd57('0x26')](_0x33058e[_0x2f6cfe][_0xfd57('0x74')],function(_0x11e886){return{'name':_0x11e886,'value':_0x11e886};}):[]});}}return{'count':_0x131a13['length'],'rows':_0x131a13};}else{return{'count':0x0,'rows':[]};}})[_0xfd57('0x1f')](respondWithResult(_0x4ea618,null))[_0xfd57('0x42')](function(_0x55f385){var _0x45c0d5=_0x1463fe[_0xfd57('0x2b')][_0xfd57('0x75')]?0x1f4:_0x55f385[_0xfd57('0x76')]||0x1f4;logger[_0xfd57('0x22')](_0xfd57('0x77'),_0xfd57('0x78'),_0x45c0d5,JSON[_0xfd57('0x79')](_0x55f385));delete _0x55f385[_0xfd57('0x7a')];if(_0x45c0d5===0x191){_0x45c0d5=0x190;}_0x4ea618[_0xfd57('0x16')](_0x45c0d5)[_0xfd57('0x24')](_0x1463fe[_0xfd57('0x2b')][_0xfd57('0x75')]?{'message':_0xfd57('0x7b'),'statusCode':_0x55f385[_0xfd57('0x76')]}:_0x55f385);});}; \ No newline at end of file +var _0xdd00=['name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','findOne','ZohoConfiguration','sort','getConfigurations','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','Subjects','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','clientId','access_token','getFields','host','zone','clientSecret','serverUrl','com','slice','substring','refreshToken','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Description','WhoId','Call_Duration','Call_Result','remove','includes','picklist','pick_list_values','map','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','sendStatus','error','stack'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0xdd00,0xc5));var _0x0dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd00[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0dd0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0dd0('0x1'));var rp=require('request-promise');var moment=require(_0x0dd0('0x2'));var BPromise=require(_0x0dd0('0x3'));var Mustache=require(_0x0dd0('0x4'));var util=require(_0x0dd0('0x5'));var path=require(_0x0dd0('0x6'));var sox=require(_0x0dd0('0x7'));var csv=require(_0x0dd0('0x8'));var ejs=require(_0x0dd0('0x9'));var fs=require('fs');var fs_extra=require(_0x0dd0('0xa'));var _=require('lodash');var squel=require(_0x0dd0('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0dd0('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0dd0('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x0dd0('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0dd0('0xf'));var logger=require(_0x0dd0('0x10'))('api');var utils=require(_0x0dd0('0x11'));var config=require(_0x0dd0('0x12'));var licenseUtil=require(_0x0dd0('0x13'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3e7f3e,_0xcf633c){_0xcf633c=_0xcf633c||0xcc;return function(_0xf2228a){if(_0xf2228a){return _0x3e7f3e['sendStatus'](_0xcf633c);}return _0x3e7f3e[_0x0dd0('0x14')](_0xcf633c)[_0x0dd0('0x15')]();};}function respondWithResult(_0x4968e7,_0x5cf0c1){_0x5cf0c1=_0x5cf0c1||0xc8;return function(_0x4fb561){if(_0x4fb561){return _0x4968e7[_0x0dd0('0x14')](_0x5cf0c1)[_0x0dd0('0x16')](_0x4fb561);}};}function respondWithFilteredResult(_0x3b3d21,_0x211344){return function(_0x5a04b4){if(_0x5a04b4){var _0x341cdc=typeof _0x211344[_0x0dd0('0x17')]===_0x0dd0('0x18')&&typeof _0x211344[_0x0dd0('0x19')]===_0x0dd0('0x18');var _0x221dbc=_0x5a04b4['count'];var _0x1bb96c=_0x341cdc?0x0:_0x211344[_0x0dd0('0x17')];var _0x1913b0=_0x341cdc?_0x5a04b4[_0x0dd0('0x1a')]:_0x211344[_0x0dd0('0x17')]+_0x211344['limit'];var _0x2fbfa2;if(_0x1913b0>=_0x221dbc){_0x1913b0=_0x221dbc;_0x2fbfa2=0xc8;}else{_0x2fbfa2=0xce;}_0x3b3d21[_0x0dd0('0x14')](_0x2fbfa2);return _0x3b3d21['set']('Content-Range',_0x1bb96c+'-'+_0x1913b0+'/'+_0x221dbc)[_0x0dd0('0x16')](_0x5a04b4);}return null;};}function patchUpdates(_0x4dcfc3){return function(_0x19cdca){try{jsonpatch[_0x0dd0('0x1b')](_0x19cdca,_0x4dcfc3,!![]);}catch(_0x236c15){return BPromise[_0x0dd0('0x1c')](_0x236c15);}return _0x19cdca[_0x0dd0('0x1d')]();};}function saveUpdates(_0x3cfc68,_0x9186a0){return function(_0x5d1f00){if(_0x5d1f00){return _0x5d1f00['update'](_0x3cfc68)[_0x0dd0('0x1e')](function(_0x5a59ef){return _0x5a59ef;});}return null;};}function removeEntity(_0x4f6a16,_0xecca65){return function(_0x2b4859){if(_0x2b4859){return _0x2b4859[_0x0dd0('0x1f')]()[_0x0dd0('0x1e')](function(){_0x4f6a16['status'](0xcc)[_0x0dd0('0x15')]();});}};}function handleEntityNotFound(_0x1b5823,_0xb0b82e){return function(_0x1606f3){if(!_0x1606f3){_0x1b5823[_0x0dd0('0x20')](0x194);}return _0x1606f3;};}function handleError(_0x39d4dc,_0x4a3925){_0x4a3925=_0x4a3925||0x1f4;return function(_0x3b22ec){logger[_0x0dd0('0x21')](_0x3b22ec[_0x0dd0('0x22')]);if(_0x3b22ec[_0x0dd0('0x23')]){delete _0x3b22ec['name'];}_0x39d4dc[_0x0dd0('0x14')](_0x4a3925)[_0x0dd0('0x24')](_0x3b22ec);};}exports[_0x0dd0('0x25')]=function(_0x52f095,_0x4a9dfb){var _0x46a4ac={},_0x182fa5={},_0x44f0cb={'count':0x0,'rows':[]};var _0x4b16d6=_['map'](db[_0x0dd0('0x26')][_0x0dd0('0x27')],function(_0x515d63){return{'name':_0x515d63[_0x0dd0('0x28')],'type':_0x515d63[_0x0dd0('0x29')][_0x0dd0('0x2a')]};});_0x182fa5['model']=_['map'](_0x4b16d6,'name');_0x182fa5[_0x0dd0('0x2b')]=_[_0x0dd0('0x2c')](_0x52f095[_0x0dd0('0x2b')]);_0x182fa5[_0x0dd0('0x2d')]=_[_0x0dd0('0x2e')](_0x182fa5[_0x0dd0('0x2f')],_0x182fa5[_0x0dd0('0x2b')]);_0x46a4ac['attributes']=_[_0x0dd0('0x2e')](_0x182fa5[_0x0dd0('0x2f')],qs[_0x0dd0('0x30')](_0x52f095['query'][_0x0dd0('0x30')]));_0x46a4ac[_0x0dd0('0x31')]=_0x46a4ac['attributes'][_0x0dd0('0x32')]?_0x46a4ac[_0x0dd0('0x31')]:_0x182fa5[_0x0dd0('0x2f')];if(!_0x52f095[_0x0dd0('0x2b')]['hasOwnProperty'](_0x0dd0('0x33'))){_0x46a4ac[_0x0dd0('0x19')]=qs[_0x0dd0('0x19')](_0x52f095[_0x0dd0('0x2b')]['limit']);_0x46a4ac[_0x0dd0('0x17')]=qs[_0x0dd0('0x17')](_0x52f095[_0x0dd0('0x2b')][_0x0dd0('0x17')]);}_0x46a4ac[_0x0dd0('0x34')]=qs['sort'](_0x52f095[_0x0dd0('0x2b')]['sort']);_0x46a4ac[_0x0dd0('0x35')]=qs[_0x0dd0('0x2d')](_[_0x0dd0('0x36')](_0x52f095[_0x0dd0('0x2b')],_0x182fa5['filters']),_0x4b16d6);if(_0x52f095[_0x0dd0('0x2b')][_0x0dd0('0x37')]){_0x46a4ac['where']=_[_0x0dd0('0x38')](_0x46a4ac[_0x0dd0('0x35')],{'$or':_['map'](_0x4b16d6,function(_0x42850b){if(_0x42850b[_0x0dd0('0x29')]!==_0x0dd0('0x39')){var _0x41fa77={};_0x41fa77[_0x42850b[_0x0dd0('0x23')]]={'$like':'%'+_0x52f095[_0x0dd0('0x2b')][_0x0dd0('0x37')]+'%'};return _0x41fa77;}})});}_0x46a4ac=_[_0x0dd0('0x38')]({},_0x46a4ac,_0x52f095[_0x0dd0('0x3a')]);var _0x222f15={'where':_0x46a4ac[_0x0dd0('0x35')]};return db[_0x0dd0('0x26')][_0x0dd0('0x1a')](_0x222f15)[_0x0dd0('0x1e')](function(_0x3ac209){_0x44f0cb[_0x0dd0('0x1a')]=_0x3ac209;if(_0x52f095[_0x0dd0('0x2b')][_0x0dd0('0x3b')]){_0x46a4ac[_0x0dd0('0x3c')]=[{'all':!![]}];}return db[_0x0dd0('0x26')][_0x0dd0('0x3d')](_0x46a4ac);})[_0x0dd0('0x1e')](function(_0x384c88){_0x44f0cb[_0x0dd0('0x3e')]=_0x384c88;return _0x44f0cb;})[_0x0dd0('0x1e')](respondWithFilteredResult(_0x4a9dfb,_0x46a4ac))[_0x0dd0('0x3f')](handleError(_0x4a9dfb,null));};exports[_0x0dd0('0x40')]=function(_0x267b59,_0x3ac2a2){var _0x8757a4={'raw':![],'where':{'id':_0x267b59[_0x0dd0('0x41')]['id']}},_0x40bec3={};_0x40bec3[_0x0dd0('0x2f')]=_[_0x0dd0('0x2c')](db[_0x0dd0('0x26')]['rawAttributes']);_0x40bec3[_0x0dd0('0x2b')]=_['keys'](_0x267b59['query']);_0x40bec3['filters']=_['intersection'](_0x40bec3[_0x0dd0('0x2f')],_0x40bec3['query']);_0x8757a4[_0x0dd0('0x31')]=_[_0x0dd0('0x2e')](_0x40bec3['model'],qs[_0x0dd0('0x30')](_0x267b59[_0x0dd0('0x2b')][_0x0dd0('0x30')]));_0x8757a4[_0x0dd0('0x31')]=_0x8757a4['attributes'][_0x0dd0('0x32')]?_0x8757a4['attributes']:_0x40bec3['model'];if(_0x267b59[_0x0dd0('0x2b')][_0x0dd0('0x3b')]){_0x8757a4[_0x0dd0('0x3c')]=[{'all':!![]}];}_0x8757a4=_[_0x0dd0('0x38')]({},_0x8757a4,_0x267b59[_0x0dd0('0x3a')]);return db['ZohoAccount']['find'](_0x8757a4)[_0x0dd0('0x1e')](handleEntityNotFound(_0x3ac2a2,null))['then'](respondWithResult(_0x3ac2a2,null))[_0x0dd0('0x3f')](handleError(_0x3ac2a2,null));};exports[_0x0dd0('0x42')]=function(_0xb0325,_0x18c23d){return db[_0x0dd0('0x26')][_0x0dd0('0x42')](_0xb0325[_0x0dd0('0x43')],{})[_0x0dd0('0x1e')](respondWithResult(_0x18c23d,0xc9))[_0x0dd0('0x3f')](handleError(_0x18c23d,null));};exports['update']=function(_0x47d6d4,_0x40d042){if(_0x47d6d4[_0x0dd0('0x43')]['id']){delete _0x47d6d4['body']['id'];}return db[_0x0dd0('0x26')][_0x0dd0('0x44')]({'where':{'id':_0x47d6d4[_0x0dd0('0x41')]['id']}})[_0x0dd0('0x1e')](handleEntityNotFound(_0x40d042,null))[_0x0dd0('0x1e')](saveUpdates(_0x47d6d4['body'],null))[_0x0dd0('0x1e')](respondWithResult(_0x40d042,null))['catch'](handleError(_0x40d042,null));};exports[_0x0dd0('0x1f')]=function(_0x5ec264,_0x189bd3){return db['ZohoAccount'][_0x0dd0('0x44')]({'where':{'id':_0x5ec264[_0x0dd0('0x41')]['id']}})[_0x0dd0('0x1e')](handleEntityNotFound(_0x189bd3,null))[_0x0dd0('0x1e')](removeEntity(_0x189bd3,null))[_0x0dd0('0x3f')](handleError(_0x189bd3,null));};exports['getConfigurations']=function(_0x1e1087,_0x5ef90e,_0x2aaf7a){var _0x352f98={};var _0x262dcf={};var _0x10aea;var _0x487028;return db[_0x0dd0('0x26')][_0x0dd0('0x45')]({'where':{'id':_0x1e1087[_0x0dd0('0x41')]['id']}})['then'](handleEntityNotFound(_0x5ef90e,null))['then'](function(_0x5f09fc){if(_0x5f09fc){_0x10aea=_0x5f09fc;_0x262dcf[_0x0dd0('0x2f')]=_[_0x0dd0('0x2c')](db[_0x0dd0('0x46')][_0x0dd0('0x27')]);_0x262dcf[_0x0dd0('0x2b')]=_['keys'](_0x1e1087[_0x0dd0('0x2b')]);_0x262dcf[_0x0dd0('0x2d')]=_[_0x0dd0('0x2e')](_0x262dcf[_0x0dd0('0x2f')],_0x262dcf[_0x0dd0('0x2b')]);_0x352f98[_0x0dd0('0x31')]=_[_0x0dd0('0x2e')](_0x262dcf[_0x0dd0('0x2f')],qs[_0x0dd0('0x30')](_0x1e1087['query'][_0x0dd0('0x30')]));_0x352f98[_0x0dd0('0x31')]=_0x352f98[_0x0dd0('0x31')][_0x0dd0('0x32')]?_0x352f98[_0x0dd0('0x31')]:_0x262dcf['model'];_0x352f98[_0x0dd0('0x34')]=qs[_0x0dd0('0x47')](_0x1e1087[_0x0dd0('0x2b')][_0x0dd0('0x47')]);_0x352f98['where']=qs[_0x0dd0('0x2d')](_['pick'](_0x1e1087['query'],_0x262dcf[_0x0dd0('0x2d')]));if(_0x1e1087['query'][_0x0dd0('0x37')]){_0x352f98[_0x0dd0('0x35')]=_['merge'](_0x352f98['where'],{'$or':_['map'](_0x352f98['attributes'],function(_0x11e612){var _0xa8a5cc={};_0xa8a5cc[_0x11e612]={'$like':'%'+_0x1e1087[_0x0dd0('0x2b')]['filter']+'%'};return _0xa8a5cc;})});}_0x352f98=_[_0x0dd0('0x38')]({},_0x352f98,_0x1e1087[_0x0dd0('0x3a')]);return _0x10aea[_0x0dd0('0x48')](_0x352f98);}})['then'](function(_0xf6ace8){if(_0xf6ace8){_0x487028=_0xf6ace8[_0x0dd0('0x32')];if(!_0x1e1087[_0x0dd0('0x2b')]['hasOwnProperty'](_0x0dd0('0x33'))){_0x352f98[_0x0dd0('0x19')]=qs['limit'](_0x1e1087[_0x0dd0('0x2b')][_0x0dd0('0x19')]);_0x352f98[_0x0dd0('0x17')]=qs[_0x0dd0('0x17')](_0x1e1087[_0x0dd0('0x2b')][_0x0dd0('0x17')]);}return _0x10aea[_0x0dd0('0x48')](_0x352f98);}})['then'](function(_0x393212){if(_0x393212){return _0x393212?{'count':_0x487028,'rows':_0x393212}:null;}})[_0x0dd0('0x1e')](respondWithResult(_0x5ef90e,null))[_0x0dd0('0x3f')](handleError(_0x5ef90e,null));};exports['addConfiguration']=function(_0x2e8372,_0x2435f0,_0x21e42c){if(_0x2e8372[_0x0dd0('0x43')]['id']){delete _0x2e8372[_0x0dd0('0x43')]['id'];}return db[_0x0dd0('0x26')]['findOne']({'where':{'id':_0x2e8372[_0x0dd0('0x41')]['id']}})[_0x0dd0('0x1e')](handleEntityNotFound(_0x2435f0,null))[_0x0dd0('0x1e')](function(_0x2e86fe){if(_0x2e86fe){_0x2e8372['body'][_0x0dd0('0x49')]=_0x2e86fe['id'];_0x2e8372[_0x0dd0('0x43')]['Subjects']=integrations[_0x0dd0('0x4a')](_0x2e8372['body'][_0x0dd0('0x4b')],_0x2e8372[_0x0dd0('0x43')]['type']);_0x2e8372['body'][_0x0dd0('0x4c')]=integrations[_0x0dd0('0x4d')](_0x2e8372['body'][_0x0dd0('0x4b')],_0x2e8372[_0x0dd0('0x43')][_0x0dd0('0x29')]);return db['ZohoConfiguration'][_0x0dd0('0x42')](_0x2e8372[_0x0dd0('0x43')],{'include':[{'model':db[_0x0dd0('0x4e')],'as':_0x0dd0('0x4f')},{'model':db['ZohoField'],'as':_0x0dd0('0x4c')}]});}return null;})[_0x0dd0('0x1e')](respondWithResult(_0x2435f0,null))['catch'](handleError(_0x2435f0,null));};function getAccessToken(_0x4b1fbf){return new Promise(function(_0x2d82c7,_0x52099e){var _0x53abee;switch(_0x4b1fbf['zone']){case'US':_0x53abee=_0x0dd0('0x50');break;case'AU':_0x53abee='https://accounts.zoho.com.au';break;case'EU':_0x53abee='https://accounts.zoho.eu';break;case'IN':_0x53abee=_0x0dd0('0x51');break;case'CN':_0x53abee=_0x0dd0('0x52');break;default:_0x53abee='https://accounts.zoho.eu';break;}var _0x259b37={'method':'POST','uri':_0x53abee+'/oauth/v2/token','qs':{'refresh_token':_0x4b1fbf['refreshToken'],'client_id':_0x4b1fbf[_0x0dd0('0x53')],'client_secret':_0x4b1fbf['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x259b37)[_0x0dd0('0x1e')](function(_0x57d941){if(_0x57d941[_0x0dd0('0x54')]){_0x2d82c7(_0x57d941[_0x0dd0('0x54')]);}else{_0x52099e('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x47a4d6){_0x52099e(_0x47a4d6);});});}exports[_0x0dd0('0x55')]=function(_0xee5d71,_0x3d3884,_0x5a52b2){var _0x1defee,_0x39ade4,_0x2697d3,_0x3f73e1,_0x297e2e;return db['ZohoAccount']['findOne']({'where':{'id':_0xee5d71[_0x0dd0('0x41')]['id']},'attributes':['id',_0x0dd0('0x56'),_0x0dd0('0x57'),_0x0dd0('0x53'),_0x0dd0('0x58'),_0x0dd0('0x59'),'code','refreshToken']})[_0x0dd0('0x1e')](handleEntityNotFound(_0x3d3884,null))[_0x0dd0('0x1e')](function(_0x381b6b){_0x297e2e=_0x381b6b;_0x1defee=_0x297e2e['host'];_0x39ade4=_0x1defee==='zoho.eu'?'eu':_0x0dd0('0x5a');_0x2697d3=_0x297e2e[_0x0dd0('0x59')];var _0x27e70e=_0x2697d3[_0x0dd0('0x5b')](-0x1);if(_0x27e70e==='/'||_0x27e70e==='\x5c'||_0x27e70e===':'){_0x2697d3=_0x2697d3[_0x0dd0('0x5c')](0x0,_0x2697d3['lastIndexOf'](_0x27e70e));}if(!_0x297e2e[_0x0dd0('0x5d')]){throw new Error(_0x0dd0('0x5e'));}return getAccessToken(_0x297e2e);})[_0x0dd0('0x1e')](function(_0x331efd){if(_0x331efd){return rp({'method':_0x0dd0('0x5f'),'uri':util[_0x0dd0('0x60')](_0x0dd0('0x61'),_0x39ade4),'qs':{'module':_0x0dd0('0x62')},'headers':{'Authorization':_0x0dd0('0x63')+_0x331efd},'json':!![]});}})['then'](function(_0x453db1){if(_0x453db1){if(_0x453db1[_0x0dd0('0x64')]&&_0x453db1[_0x0dd0('0x64')][_0x0dd0('0x21')]){throw new Error(_0x453db1[_0x0dd0('0x64')]['error']['message']);}var _0x46c15c=[];var _0x51f079=[];var _0x2d4bca=[_0x0dd0('0x65'),'Subject',_0x0dd0('0x66'),_0x0dd0('0x67'),_0x0dd0('0x68'),_0x0dd0('0x69'),'Call_Start_Time','Call_Type'];_0x51f079=_[_0x0dd0('0x6a')](_0x453db1['fields'],function(_0x1a90a0){return _0x2d4bca[_0x0dd0('0x6b')](_0x1a90a0['api_name']);});for(var _0x1dadce=0x0;_0x1dadce<_0x51f079[_0x0dd0('0x32')];_0x1dadce++){if(_0x51f079[_0x1dadce]['system_mandatory']===![]){_0x46c15c['push']({'id':_0x51f079[_0x1dadce]['id'],'name':_0x51f079[_0x1dadce]['display_label'],'custom':_0x51f079[_0x1dadce]['custom_field'],'options':_0x51f079[_0x1dadce]['data_type']===_0x0dd0('0x6c')&&_0x51f079[_0x1dadce][_0x0dd0('0x6d')][_0x0dd0('0x32')]>-0x1?_[_0x0dd0('0x6e')](_0x51f079[_0x1dadce][_0x0dd0('0x6d')],function(_0x33dc3b){return{'name':_0x33dc3b,'value':_0x33dc3b};}):[]});}}return{'count':_0x46c15c[_0x0dd0('0x32')],'rows':_0x46c15c};}else{return{'count':0x0,'rows':[]};}})[_0x0dd0('0x1e')](respondWithResult(_0x3d3884,null))[_0x0dd0('0x3f')](function(_0x14fbba){var _0x3424f6=_0xee5d71[_0x0dd0('0x2b')][_0x0dd0('0x6f')]?0x1f4:_0x14fbba['statusCode']||0x1f4;logger[_0x0dd0('0x21')](_0x0dd0('0x70'),_0x0dd0('0x55'),_0x3424f6,JSON[_0x0dd0('0x71')](_0x14fbba));delete _0x14fbba[_0x0dd0('0x23')];if(_0x3424f6===0x191){_0x3424f6=0x190;}_0x3d3884[_0x0dd0('0x14')](_0x3424f6)[_0x0dd0('0x24')](_0xee5d71['query'][_0x0dd0('0x6f')]?{'message':_0x0dd0('0x72'),'statusCode':_0x14fbba[_0x0dd0('0x73')]}:_0x14fbba);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 129e1a4..92465d2 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 _0x9581=['POST','clientSecret','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','zone','serverUrl','clientId','code','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','/oauth/v2/token','authorization_code','then','parse','refresh_token','refreshToken','info','format','name','error','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','substring','https://accounts.zoho.com.cn','https://accounts.zoho.eu'];(function(_0xbdd6f3,_0x1ded90){var _0x5debef=function(_0xe3e2e2){while(--_0xe3e2e2){_0xbdd6f3['push'](_0xbdd6f3['shift']());}};_0x5debef(++_0x1ded90);}(_0x9581,0x144));var _0x1958=function(_0x2a378e,_0x3f0d68){_0x2a378e=_0x2a378e-0x0;var _0x2e041d=_0x9581[_0x2a378e];return _0x2e041d;};'use strict';var _=require(_0x1958('0x0'));var util=require('util');var logger=require(_0x1958('0x1'))(_0x1958('0x2'));var moment=require('moment');var BPromise=require(_0x1958('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1958('0x4'));var rimraf=require(_0x1958('0x5'));var config=require(_0x1958('0x6'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x1958('0x7'));module[_0x1958('0x8')]=function(_0x44fc1c,_0x4f5b8c){return _0x44fc1c[_0x1958('0x9')]('ZohoAccount',attributes,{'tableName':_0x1958('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xf17e8d,_0x3d38a0,_0x38143d){if(_0xf17e8d[_0x1958('0xb')](_0x1958('0xc'))||_0xf17e8d['changed'](_0x1958('0xd'))||_0xf17e8d['changed'](_0x1958('0xe'))||_0xf17e8d['changed']('clientSecret')||_0xf17e8d[_0x1958('0xb')](_0x1958('0xf'))||_0xf17e8d[_0x1958('0xb')]('host')){var _0x1b1113,_0x291276;_0x1b1113=_0xf17e8d['serverUrl'];var _0x50cfaf=_0x1b1113[_0x1958('0x10')](-0x1);if(_0x50cfaf==='/'||_0x50cfaf==='\x5c'||_0x50cfaf===':'){_0x1b1113=_0x1b1113['substring'](0x0,_0x1b1113[_0x1958('0x11')](_0x50cfaf));}switch(_0xf17e8d[_0x1958('0xc')]){case'US':_0x291276=_0x1958('0x12');break;case'AU':_0x291276=_0x1958('0x13');break;case'IN':_0x291276=_0x1958('0x14');break;case'CN':_0x291276='https://accounts.zoho.com.cn';break;default:_0x291276='https://accounts.zoho.eu';break;}var _0x124e6={'method':'POST','uri':_0x291276+_0x1958('0x15'),'form':{'grant_type':_0x1958('0x16'),'client_id':_0xf17e8d[_0x1958('0xe')],'client_secret':_0xf17e8d['clientSecret'],'redirect_uri':_0xf17e8d[_0x1958('0xd')],'code':_0xf17e8d[_0x1958('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x124e6)[_0x1958('0x17')](function(_0x5ec6c9){var _0x1900e4=JSON[_0x1958('0x18')](_0x5ec6c9);if(_0x1900e4[_0x1958('0x19')]){_0xf17e8d[_0x1958('0x1a')]=_0x1900e4[_0x1958('0x19')];logger[_0x1958('0x1b')](util[_0x1958('0x1c')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0xf17e8d[_0x1958('0x1d')],_0xf17e8d['id']));}else{logger[_0x1958('0x1e')](util[_0x1958('0x1c')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xf17e8d[_0x1958('0x1d')],_0xf17e8d['id']),util['inspect'](_0x1900e4,{'showHidden':![],'depth':null}));}return _0x38143d(null,_0x3d38a0);})[_0x1958('0x1f')](function(_0x28f216){logger[_0x1958('0x1e')](util[_0x1958('0x1c')](_0x1958('0x20'),_0xf17e8d[_0x1958('0x1d')],_0xf17e8d['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x38143d(_0x28f216);});}else{return _0x38143d(null,_0x3d38a0);}},'beforeUpdate':function(_0x5030a8,_0x1c246b,_0x47a357){if(_0x5030a8[_0x1958('0xb')](_0x1958('0xc'))||_0x5030a8['changed']('serverUrl')||_0x5030a8['changed']('clientId')||_0x5030a8['changed']('clientSecret')||_0x5030a8[_0x1958('0xb')]('code')||_0x5030a8[_0x1958('0xb')]('host')){var _0x51f6b0,_0x2dcee8;_0x51f6b0=_0x5030a8[_0x1958('0xd')];var _0x21e08=_0x51f6b0['slice'](-0x1);if(_0x21e08==='/'||_0x21e08==='\x5c'||_0x21e08===':'){_0x51f6b0=_0x51f6b0[_0x1958('0x21')](0x0,_0x51f6b0['lastIndexOf'](_0x21e08));}switch(_0x5030a8[_0x1958('0xc')]){case'US':_0x2dcee8='https://accounts.zoho.com';break;case'AU':_0x2dcee8='https://accounts.zoho.com.au';break;case'IN':_0x2dcee8=_0x1958('0x14');break;case'CN':_0x2dcee8=_0x1958('0x22');break;default:_0x2dcee8=_0x1958('0x23');break;}var _0x4decd2={'method':_0x1958('0x24'),'uri':_0x2dcee8+'/oauth/v2/token','form':{'grant_type':_0x1958('0x16'),'client_id':_0x5030a8['clientId'],'client_secret':_0x5030a8[_0x1958('0x25')],'redirect_uri':_0x5030a8[_0x1958('0xd')],'code':_0x5030a8[_0x1958('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4decd2)['then'](function(_0x503dc5){var _0x58fd56=JSON[_0x1958('0x18')](_0x503dc5);if(_0x58fd56[_0x1958('0x19')]){_0x5030a8[_0x1958('0x1a')]=_0x58fd56[_0x1958('0x19')];logger[_0x1958('0x1b')](util[_0x1958('0x1c')](_0x1958('0x26'),_0x5030a8[_0x1958('0x1d')],_0x5030a8['id']));}else{logger[_0x1958('0x1e')](util[_0x1958('0x1c')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5030a8[_0x1958('0x1d')],_0x5030a8['id']),util[_0x1958('0x27')](_0x58fd56,{'showHidden':![],'depth':null}));}return _0x47a357(null,_0x1c246b);})[_0x1958('0x1f')](function(_0x2c8bb0){logger[_0x1958('0x1e')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5030a8[_0x1958('0x1d')],_0x5030a8['id']),util[_0x1958('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x47a357(_0x2c8bb0);});}else{return _0x47a357(null,_0x1c246b);}}}});}; \ No newline at end of file +var _0x40a9=['api','moment','bluebird','request-promise','../../config/environment','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientId','code','slice','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','parse','refreshToken','refresh_token','info','format','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','host','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','../../config/logger'];(function(_0x422516,_0x2b8a2c){var _0x11d5b4=function(_0x1d2a9){while(--_0x1d2a9){_0x422516['push'](_0x422516['shift']());}};_0x11d5b4(++_0x2b8a2c);}(_0x40a9,0x1c1));var _0x940a=function(_0x23f657,_0x5a13b3){_0x23f657=_0x23f657-0x0;var _0x31c783=_0x40a9[_0x23f657];return _0x31c783;};'use strict';var _=require(_0x940a('0x0'));var util=require('util');var logger=require(_0x940a('0x1'))(_0x940a('0x2'));var moment=require(_0x940a('0x3'));var BPromise=require(_0x940a('0x4'));var rp=require(_0x940a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x940a('0x6'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x940a('0x7')]=function(_0x52d896,_0xb5d46d){return _0x52d896[_0x940a('0x8')](_0x940a('0x9'),attributes,{'tableName':_0x940a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x179dce,_0xcd4157,_0xc8555){if(_0x179dce['changed'](_0x940a('0xb'))||_0x179dce[_0x940a('0xc')](_0x940a('0xd'))||_0x179dce[_0x940a('0xc')](_0x940a('0xe'))||_0x179dce[_0x940a('0xc')]('clientSecret')||_0x179dce[_0x940a('0xc')](_0x940a('0xf'))||_0x179dce['changed']('host')){var _0x4b66d4,_0x163179;_0x4b66d4=_0x179dce[_0x940a('0xd')];var _0x19897a=_0x4b66d4[_0x940a('0x10')](-0x1);if(_0x19897a==='/'||_0x19897a==='\x5c'||_0x19897a===':'){_0x4b66d4=_0x4b66d4['substring'](0x0,_0x4b66d4[_0x940a('0x11')](_0x19897a));}switch(_0x179dce[_0x940a('0xb')]){case'US':_0x163179='https://accounts.zoho.com';break;case'AU':_0x163179='https://accounts.zoho.com.au';break;case'IN':_0x163179=_0x940a('0x12');break;case'CN':_0x163179=_0x940a('0x13');break;default:_0x163179='https://accounts.zoho.eu';break;}var _0xcbe903={'method':_0x940a('0x14'),'uri':_0x163179+_0x940a('0x15'),'form':{'grant_type':_0x940a('0x16'),'client_id':_0x179dce['clientId'],'client_secret':_0x179dce[_0x940a('0x17')],'redirect_uri':_0x179dce[_0x940a('0xd')],'code':_0x179dce[_0x940a('0xf')]},'headers':{'Content-Type':_0x940a('0x18')}};return rp(_0xcbe903)['then'](function(_0x2f9c34){var _0x4aa7eb=JSON[_0x940a('0x19')](_0x2f9c34);if(_0x4aa7eb['refresh_token']){_0x179dce[_0x940a('0x1a')]=_0x4aa7eb[_0x940a('0x1b')];logger[_0x940a('0x1c')](util[_0x940a('0x1d')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x179dce[_0x940a('0x1e')],_0x179dce['id']));}else{logger[_0x940a('0x1f')](util[_0x940a('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x179dce[_0x940a('0x1e')],_0x179dce['id']),util[_0x940a('0x20')](_0x4aa7eb,{'showHidden':![],'depth':null}));}return _0xc8555(null,_0xcd4157);})[_0x940a('0x21')](function(_0x27d0c6){logger[_0x940a('0x1f')](util[_0x940a('0x1d')](_0x940a('0x22'),_0x179dce[_0x940a('0x1e')],_0x179dce['id']),util[_0x940a('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0xc8555(_0x27d0c6);});}else{return _0xc8555(null,_0xcd4157);}},'beforeUpdate':function(_0x3ad579,_0x4e634a,_0x31cfe0){if(_0x3ad579['changed']('zone')||_0x3ad579[_0x940a('0xc')](_0x940a('0xd'))||_0x3ad579['changed']('clientId')||_0x3ad579[_0x940a('0xc')]('clientSecret')||_0x3ad579[_0x940a('0xc')](_0x940a('0xf'))||_0x3ad579['changed'](_0x940a('0x23'))){var _0x2dfe03,_0x3cd824;_0x2dfe03=_0x3ad579[_0x940a('0xd')];var _0x5beb4b=_0x2dfe03[_0x940a('0x10')](-0x1);if(_0x5beb4b==='/'||_0x5beb4b==='\x5c'||_0x5beb4b===':'){_0x2dfe03=_0x2dfe03[_0x940a('0x24')](0x0,_0x2dfe03[_0x940a('0x11')](_0x5beb4b));}switch(_0x3ad579[_0x940a('0xb')]){case'US':_0x3cd824=_0x940a('0x25');break;case'AU':_0x3cd824=_0x940a('0x26');break;case'IN':_0x3cd824=_0x940a('0x12');break;case'CN':_0x3cd824=_0x940a('0x13');break;default:_0x3cd824=_0x940a('0x27');break;}var _0x3c98a0={'method':_0x940a('0x14'),'uri':_0x3cd824+_0x940a('0x15'),'form':{'grant_type':_0x940a('0x16'),'client_id':_0x3ad579[_0x940a('0xe')],'client_secret':_0x3ad579[_0x940a('0x17')],'redirect_uri':_0x3ad579['serverUrl'],'code':_0x3ad579[_0x940a('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3c98a0)['then'](function(_0x3b8762){var _0x209fa7=JSON['parse'](_0x3b8762);if(_0x209fa7[_0x940a('0x1b')]){_0x3ad579[_0x940a('0x1a')]=_0x209fa7[_0x940a('0x1b')];logger[_0x940a('0x1c')](util[_0x940a('0x1d')](_0x940a('0x28'),_0x3ad579[_0x940a('0x1e')],_0x3ad579['id']));}else{logger[_0x940a('0x1f')](util[_0x940a('0x1d')](_0x940a('0x22'),_0x3ad579[_0x940a('0x1e')],_0x3ad579['id']),util['inspect'](_0x209fa7,{'showHidden':![],'depth':null}));}return _0x31cfe0(null,_0x4e634a);})[_0x940a('0x21')](function(_0x1643a2){logger['error'](util['format'](_0x940a('0x22'),_0x3ad579[_0x940a('0x1e')],_0x3ad579['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x31cfe0(_0x1643a2);});}else{return _0x31cfe0(null,_0x4e634a);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 1fc05a2..6745e9f 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 _0x1893=['request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','catch','ShowZohoAccount','find','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ZohoAccount,\x20%s,\x20%s'];(function(_0x41bfd6,_0x19992f){var _0x35945e=function(_0x55b5cc){while(--_0x55b5cc){_0x41bfd6['push'](_0x41bfd6['shift']());}};_0x35945e(++_0x19992f);}(_0x1893,0xa2));var _0x3189=function(_0x9ac2cb,_0x1b0500){_0x9ac2cb=_0x9ac2cb-0x0;var _0x217bf3=_0x1893[_0x9ac2cb];return _0x217bf3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3189('0x0'));var BPromise=require(_0x3189('0x1'));var rs=require(_0x3189('0x2'));var fs=require('fs');var Redis=require(_0x3189('0x3'));var db=require(_0x3189('0x4'))['db'];var utils=require(_0x3189('0x5'));var logger=require(_0x3189('0x6'))('rpc');var config=require(_0x3189('0x7'));var jayson=require(_0x3189('0x8'));var client=jayson[_0x3189('0x9')][_0x3189('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x77c566,_0x118970,_0x14d84b){return new BPromise(function(_0x1f6764,_0x5312a3){return client[_0x3189('0xb')](_0x77c566,_0x14d84b)['then'](function(_0x127449){logger['info'](_0x3189('0xc'),_0x118970,_0x3189('0xd'));logger[_0x3189('0xe')](_0x3189('0xf'),_0x118970,'request\x20sent',JSON[_0x3189('0x10')](_0x127449));if(_0x127449[_0x3189('0x11')]){if(_0x127449[_0x3189('0x11')][_0x3189('0x12')]===0x1f4){logger[_0x3189('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x5312a3(_0x127449[_0x3189('0x11')][_0x3189('0x13')]);}logger[_0x3189('0x11')](_0x3189('0xc'),_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x1f6764(_0x127449['error'][_0x3189('0x13')]);}else{logger[_0x3189('0x14')](_0x3189('0xc'),_0x118970,_0x3189('0xd'));_0x1f6764(_0x127449['result'][_0x3189('0x13')]);}})['catch'](function(_0x55f432){logger[_0x3189('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x118970,_0x55f432);_0x5312a3(_0x55f432);});});}exports[_0x3189('0x15')]=function(_0xf8aed7){var _0x22c7ba=this;return new Promise(function(_0x9905c4,_0x4c4d9b){return db[_0x3189('0x16')][_0x3189('0x17')]({'raw':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7['options'][_0x3189('0x19')]===undefined?!![]:![]:!![],'where':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7[_0x3189('0x18')][_0x3189('0x1a')]||null:null,'attributes':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7['options'][_0x3189('0x1b')]||null:null,'limit':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7[_0x3189('0x18')]['limit']||null:null,'include':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7['options'][_0x3189('0x1c')]?_[_0x3189('0x1d')](_0xf8aed7[_0x3189('0x18')][_0x3189('0x1c')],function(_0x1cbe33){return{'model':db[_0x1cbe33[_0x3189('0x1e')]],'as':_0x1cbe33['as'],'attributes':_0x1cbe33['attributes'],'include':_0x1cbe33['include']?_[_0x3189('0x1d')](_0x1cbe33[_0x3189('0x1c')],function(_0x1dc1c8){return{'model':db[_0x1dc1c8[_0x3189('0x1e')]],'as':_0x1dc1c8['as'],'attributes':_0x1dc1c8[_0x3189('0x1b')],'include':_0x1dc1c8[_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x1dc1c8[_0x3189('0x1c')],function(_0x17b540){return{'model':db[_0x17b540[_0x3189('0x1e')]],'as':_0x17b540['as'],'attributes':_0x17b540['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5aa34a){logger[_0x3189('0x14')](_0x3189('0x15'),_0xf8aed7);logger[_0x3189('0xe')](_0x3189('0x15'),_0xf8aed7,JSON[_0x3189('0x10')](_0x5aa34a));_0x9905c4(_0x5aa34a);})[_0x3189('0x1f')](function(_0x4d453a){logger[_0x3189('0x11')](_0x3189('0x15'),_0x4d453a['message'],_0xf8aed7);_0x4c4d9b(_0x22c7ba[_0x3189('0x11')](0x1f4,_0x4d453a[_0x3189('0x13')]));});});};exports[_0x3189('0x20')]=function(_0x5c7a36){var _0x168dc2=this;return new Promise(function(_0x32bba1,_0x23798e){return db['ZohoAccount'][_0x3189('0x21')]({'raw':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36['options'][_0x3189('0x19')]===undefined?!![]:![]:!![],'where':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36[_0x3189('0x18')][_0x3189('0x1a')]||null:null,'attributes':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36['options']['attributes']||null:null,'include':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36['options'][_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x5c7a36[_0x3189('0x18')][_0x3189('0x1c')],function(_0x231d72){return{'model':db[_0x231d72[_0x3189('0x1e')]],'as':_0x231d72['as'],'attributes':_0x231d72[_0x3189('0x1b')],'include':_0x231d72[_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x231d72['include'],function(_0x453e4b){return{'model':db[_0x453e4b[_0x3189('0x1e')]],'as':_0x453e4b['as'],'attributes':_0x453e4b[_0x3189('0x1b')],'include':_0x453e4b[_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x453e4b[_0x3189('0x1c')],function(_0xd1ee0){return{'model':db[_0xd1ee0['model']],'as':_0xd1ee0['as'],'attributes':_0xd1ee0['attributes']};}):[]};}):[]};}):[]:[]})[_0x3189('0x22')](function(_0x580064){logger[_0x3189('0x14')](_0x3189('0x20'),_0x5c7a36);logger['debug'](_0x3189('0x20'),_0x5c7a36,JSON[_0x3189('0x10')](_0x580064));_0x32bba1(_0x580064);})[_0x3189('0x1f')](function(_0x254135){logger['error'](_0x3189('0x20'),_0x254135['message'],_0x5c7a36);_0x23798e(_0x168dc2['error'](0x1f4,_0x254135[_0x3189('0x13')]));});});}; \ No newline at end of file +var _0x631c=['code','message','result','catch','ZohoAccount','findAll','options','raw','limit','include','map','attributes','model','GetZohoAccount','debug','ShowZohoAccount','find','where','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x11ad65,_0x352d3c){var _0x35590c=function(_0x2c3845){while(--_0x2c3845){_0x11ad65['push'](_0x11ad65['shift']());}};_0x35590c(++_0x352d3c);}(_0x631c,0x1b6));var _0xc631=function(_0x9c3932,_0x44e0a8){_0x9c3932=_0x9c3932-0x0;var _0x1519e7=_0x631c[_0x9c3932];return _0x1519e7;};'use strict';var _=require(_0xc631('0x0'));var util=require(_0xc631('0x1'));var moment=require('moment');var BPromise=require(_0xc631('0x2'));var rs=require(_0xc631('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc631('0x4'))['db'];var utils=require(_0xc631('0x5'));var logger=require(_0xc631('0x6'))('rpc');var config=require(_0xc631('0x7'));var jayson=require(_0xc631('0x8'));var client=jayson['client'][_0xc631('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x556c29,_0x348b52,_0x25c5c1){return new BPromise(function(_0x5605cb,_0x4d53a7){return client['request'](_0x556c29,_0x25c5c1)[_0xc631('0xa')](function(_0x578473){logger[_0xc631('0xb')](_0xc631('0xc'),_0x348b52,_0xc631('0xd'));logger['debug'](_0xc631('0xe'),_0x348b52,_0xc631('0xd'),JSON[_0xc631('0xf')](_0x578473));if(_0x578473[_0xc631('0x10')]){if(_0x578473[_0xc631('0x10')][_0xc631('0x11')]===0x1f4){logger['error'](_0xc631('0xc'),_0x348b52,_0x578473[_0xc631('0x10')][_0xc631('0x12')]);return _0x4d53a7(_0x578473[_0xc631('0x10')][_0xc631('0x12')]);}logger['error'](_0xc631('0xc'),_0x348b52,_0x578473[_0xc631('0x10')]['message']);return _0x5605cb(_0x578473[_0xc631('0x10')][_0xc631('0x12')]);}else{logger[_0xc631('0xb')](_0xc631('0xc'),_0x348b52,_0xc631('0xd'));_0x5605cb(_0x578473[_0xc631('0x13')][_0xc631('0x12')]);}})[_0xc631('0x14')](function(_0x30758f){logger['error'](_0xc631('0xc'),_0x348b52,_0x30758f);_0x4d53a7(_0x30758f);});});}exports['GetZohoAccount']=function(_0x1943ce){var _0x5843ce=this;return new Promise(function(_0x2bf21a,_0x5dc64b){return db[_0xc631('0x15')][_0xc631('0x16')]({'raw':_0x1943ce[_0xc631('0x17')]?_0x1943ce[_0xc631('0x17')][_0xc631('0x18')]===undefined?!![]:![]:!![],'where':_0x1943ce[_0xc631('0x17')]?_0x1943ce[_0xc631('0x17')]['where']||null:null,'attributes':_0x1943ce[_0xc631('0x17')]?_0x1943ce[_0xc631('0x17')]['attributes']||null:null,'limit':_0x1943ce[_0xc631('0x17')]?_0x1943ce['options'][_0xc631('0x19')]||null:null,'include':_0x1943ce[_0xc631('0x17')]?_0x1943ce[_0xc631('0x17')][_0xc631('0x1a')]?_[_0xc631('0x1b')](_0x1943ce[_0xc631('0x17')][_0xc631('0x1a')],function(_0x2486f3){return{'model':db[_0x2486f3['model']],'as':_0x2486f3['as'],'attributes':_0x2486f3[_0xc631('0x1c')],'include':_0x2486f3[_0xc631('0x1a')]?_['map'](_0x2486f3[_0xc631('0x1a')],function(_0x5e7404){return{'model':db[_0x5e7404[_0xc631('0x1d')]],'as':_0x5e7404['as'],'attributes':_0x5e7404['attributes'],'include':_0x5e7404[_0xc631('0x1a')]?_[_0xc631('0x1b')](_0x5e7404['include'],function(_0x43c2f8){return{'model':db[_0x43c2f8[_0xc631('0x1d')]],'as':_0x43c2f8['as'],'attributes':_0x43c2f8[_0xc631('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5679d6){logger[_0xc631('0xb')](_0xc631('0x1e'),_0x1943ce);logger[_0xc631('0x1f')]('GetZohoAccount',_0x1943ce,JSON[_0xc631('0xf')](_0x5679d6));_0x2bf21a(_0x5679d6);})[_0xc631('0x14')](function(_0x16467a){logger[_0xc631('0x10')](_0xc631('0x1e'),_0x16467a['message'],_0x1943ce);_0x5dc64b(_0x5843ce[_0xc631('0x10')](0x1f4,_0x16467a[_0xc631('0x12')]));});});};exports[_0xc631('0x20')]=function(_0x4ea347){var _0x1e0202=this;return new Promise(function(_0x3f7586,_0x57a784){return db[_0xc631('0x15')][_0xc631('0x21')]({'raw':_0x4ea347[_0xc631('0x17')]?_0x4ea347[_0xc631('0x17')][_0xc631('0x18')]===undefined?!![]:![]:!![],'where':_0x4ea347[_0xc631('0x17')]?_0x4ea347[_0xc631('0x17')][_0xc631('0x22')]||null:null,'attributes':_0x4ea347[_0xc631('0x17')]?_0x4ea347[_0xc631('0x17')][_0xc631('0x1c')]||null:null,'include':_0x4ea347['options']?_0x4ea347['options']['include']?_['map'](_0x4ea347[_0xc631('0x17')][_0xc631('0x1a')],function(_0x59a6eb){return{'model':db[_0x59a6eb['model']],'as':_0x59a6eb['as'],'attributes':_0x59a6eb[_0xc631('0x1c')],'include':_0x59a6eb[_0xc631('0x1a')]?_[_0xc631('0x1b')](_0x59a6eb['include'],function(_0x2ffda9){return{'model':db[_0x2ffda9[_0xc631('0x1d')]],'as':_0x2ffda9['as'],'attributes':_0x2ffda9['attributes'],'include':_0x2ffda9[_0xc631('0x1a')]?_[_0xc631('0x1b')](_0x2ffda9[_0xc631('0x1a')],function(_0x1f20b9){return{'model':db[_0x1f20b9['model']],'as':_0x1f20b9['as'],'attributes':_0x1f20b9[_0xc631('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc631('0xa')](function(_0x384c04){logger[_0xc631('0xb')]('ShowZohoAccount',_0x4ea347);logger[_0xc631('0x1f')](_0xc631('0x20'),_0x4ea347,JSON[_0xc631('0xf')](_0x384c04));_0x3f7586(_0x384c04);})[_0xc631('0x14')](function(_0x556b49){logger[_0xc631('0x10')](_0xc631('0x20'),_0x556b49['message'],_0x4ea347);_0x57a784(_0x1e0202[_0xc631('0x10')](0x1f4,_0x556b49[_0xc631('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index f62a03d..759fcec 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 _0x0a38=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','getDescriptions','post','create','put','update','delete','destroy','multer','util','path','express'];(function(_0xbb82b5,_0x4b4fff){var _0x42ff2c=function(_0x25f3db){while(--_0x25f3db){_0xbb82b5['push'](_0xbb82b5['shift']());}};_0x42ff2c(++_0x4b4fff);}(_0x0a38,0x6f));var _0x80a3=function(_0x111183,_0x35a594){_0x111183=_0x111183-0x0;var _0x28e722=_0x0a38[_0x111183];return _0x28e722;};'use strict';var multer=require(_0x80a3('0x0'));var util=require(_0x80a3('0x1'));var path=require(_0x80a3('0x2'));var timeout=require('connect-timeout');var express=require(_0x80a3('0x3'));var router=express[_0x80a3('0x4')]();var fs_extra=require(_0x80a3('0x5'));var auth=require(_0x80a3('0x6'));var interaction=require(_0x80a3('0x7'));var config=require('../../config/environment');var controller=require(_0x80a3('0x8'));router[_0x80a3('0x9')]('/',auth['isAuthenticated'](),controller[_0x80a3('0xa')]);router[_0x80a3('0x9')](_0x80a3('0xb'),auth[_0x80a3('0xc')](),controller[_0x80a3('0xd')]);router[_0x80a3('0x9')](_0x80a3('0xe'),auth[_0x80a3('0xc')](),controller[_0x80a3('0xf')]);router[_0x80a3('0x9')]('/:id/subjects',auth[_0x80a3('0xc')](),controller['getSubjects']);router[_0x80a3('0x9')]('/:id/descriptions',auth[_0x80a3('0xc')](),controller[_0x80a3('0x10')]);router[_0x80a3('0x11')]('/',auth[_0x80a3('0xc')](),controller[_0x80a3('0x12')]);router[_0x80a3('0x13')](_0x80a3('0xb'),auth[_0x80a3('0xc')](),controller[_0x80a3('0x14')]);router[_0x80a3('0x15')](_0x80a3('0xb'),auth[_0x80a3('0xc')](),controller[_0x80a3('0x16')]);module['exports']=router; \ No newline at end of file +var _0xe3cd=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id'];(function(_0x210126,_0x15c37d){var _0x30a56e=function(_0x4a9fe5){while(--_0x4a9fe5){_0x210126['push'](_0x210126['shift']());}};_0x30a56e(++_0x15c37d);}(_0xe3cd,0x1bc));var _0xde3c=function(_0x4794e0,_0xd02355){_0x4794e0=_0x4794e0-0x0;var _0x21a288=_0xe3cd[_0x4794e0];return _0x21a288;};'use strict';var multer=require(_0xde3c('0x0'));var util=require(_0xde3c('0x1'));var path=require(_0xde3c('0x2'));var timeout=require('connect-timeout');var express=require(_0xde3c('0x3'));var router=express[_0xde3c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xde3c('0x5'));var interaction=require(_0xde3c('0x6'));var config=require(_0xde3c('0x7'));var controller=require(_0xde3c('0x8'));router[_0xde3c('0x9')]('/',auth[_0xde3c('0xa')](),controller[_0xde3c('0xb')]);router[_0xde3c('0x9')]('/:id',auth[_0xde3c('0xa')](),controller[_0xde3c('0xc')]);router[_0xde3c('0x9')](_0xde3c('0xd'),auth[_0xde3c('0xa')](),controller['getFields']);router[_0xde3c('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xde3c('0xe')]);router[_0xde3c('0x9')](_0xde3c('0xf'),auth[_0xde3c('0xa')](),controller[_0xde3c('0x10')]);router['post']('/',auth[_0xde3c('0xa')](),controller['create']);router['put'](_0xde3c('0x11'),auth[_0xde3c('0xa')](),controller[_0xde3c('0x12')]);router[_0xde3c('0x13')](_0xde3c('0x11'),auth['isAuthenticated'](),controller[_0xde3c('0x14')]);module[_0xde3c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 27a36b1..0fa64d0 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 _0x0a7f=['contact_lead','STRING','ENUM','lead','contact','nothing'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x0a7f,0xdf));var _0xf0a7=function(_0x230949,_0x790da6){_0x230949=_0x230949-0x0;var _0x54a3dd=_0x0a7f[_0x230949];return _0x54a3dd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf0a7('0x0')]},'moduleCreate':{'type':Sequelize[_0xf0a7('0x1')](_0xf0a7('0x2'),_0xf0a7('0x3'),_0xf0a7('0x4')),'defaultValue':_0xf0a7('0x2')},'moduleSearch':{'type':Sequelize[_0xf0a7('0x1')](_0xf0a7('0x5'),_0xf0a7('0x3'),_0xf0a7('0x2')),'defaultValue':_0xf0a7('0x5')},'description':{'type':Sequelize[_0xf0a7('0x0')]}}; \ No newline at end of file +var _0x9b34=['nothing','contact_lead','sequelize','exports','STRING','ENUM','lead'];(function(_0x480cca,_0x33709f){var _0x22bcdb=function(_0x15ab17){while(--_0x15ab17){_0x480cca['push'](_0x480cca['shift']());}};_0x22bcdb(++_0x33709f);}(_0x9b34,0x1c2));var _0x49b3=function(_0xe76541,_0x55d5f6){_0xe76541=_0xe76541-0x0;var _0x1d3eda=_0x9b34[_0xe76541];return _0x1d3eda;};'use strict';var Sequelize=require(_0x49b3('0x0'));module[_0x49b3('0x1')]={'name':{'type':Sequelize[_0x49b3('0x2')]},'moduleCreate':{'type':Sequelize[_0x49b3('0x3')](_0x49b3('0x4'),'contact',_0x49b3('0x5')),'defaultValue':_0x49b3('0x4')},'moduleSearch':{'type':Sequelize[_0x49b3('0x3')]('contact_lead','contact',_0x49b3('0x4')),'defaultValue':_0x49b3('0x6')},'description':{'type':Sequelize[_0x49b3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 1458e8b..9562917 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 _0xd768=['error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','destroy','findOne','ZohoField','options','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','count','offset','set','apply','reject','save','update','then','end'];(function(_0x17a260,_0x37243c){var _0x1ccb07=function(_0x115cf9){while(--_0x115cf9){_0x17a260['push'](_0x17a260['shift']());}};_0x1ccb07(++_0x37243c);}(_0xd768,0x12a));var _0x8d76=function(_0x5d6e35,_0x4d1ac0){_0x5d6e35=_0x5d6e35-0x0;var _0x5d7ada=_0xd768[_0x5d6e35];return _0x5d7ada;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d76('0x0'));var zipdir=require(_0x8d76('0x1'));var jsonpatch=require(_0x8d76('0x2'));var rp=require(_0x8d76('0x3'));var moment=require(_0x8d76('0x4'));var BPromise=require(_0x8d76('0x5'));var Mustache=require(_0x8d76('0x6'));var util=require(_0x8d76('0x7'));var path=require(_0x8d76('0x8'));var sox=require('sox');var csv=require(_0x8d76('0x9'));var ejs=require(_0x8d76('0xa'));var fs=require('fs');var fs_extra=require(_0x8d76('0xb'));var _=require(_0x8d76('0xc'));var squel=require(_0x8d76('0xd'));var crypto=require(_0x8d76('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8d76('0x9'));var querystring=require(_0x8d76('0xf'));var Papa=require('papaparse');var Redis=require(_0x8d76('0x10'));var authService=require(_0x8d76('0x11'));var qs=require(_0x8d76('0x12'));var as=require(_0x8d76('0x13'));var hardwareService=require(_0x8d76('0x14'));var logger=require(_0x8d76('0x15'))(_0x8d76('0x16'));var utils=require(_0x8d76('0x17'));var config=require(_0x8d76('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8d76('0x19'))['db'];function respondWithStatusCode(_0x5d3c39,_0x5f12f0){_0x5f12f0=_0x5f12f0||0xcc;return function(_0x5ac92e){if(_0x5ac92e){return _0x5d3c39['sendStatus'](_0x5f12f0);}return _0x5d3c39[_0x8d76('0x1a')](_0x5f12f0)['end']();};}function respondWithResult(_0x33bf40,_0x3d5ac8){_0x3d5ac8=_0x3d5ac8||0xc8;return function(_0x5e44e2){if(_0x5e44e2){return _0x33bf40['status'](_0x3d5ac8)[_0x8d76('0x1b')](_0x5e44e2);}};}function respondWithFilteredResult(_0x15e6d2,_0x4a6cb5){return function(_0x14816c){if(_0x14816c){var _0x2fbdb1=typeof _0x4a6cb5['offset']===_0x8d76('0x1c')&&typeof _0x4a6cb5['limit']===_0x8d76('0x1c');var _0x55a518=_0x14816c[_0x8d76('0x1d')];var _0x1fdee5=_0x2fbdb1?0x0:_0x4a6cb5[_0x8d76('0x1e')];var _0x3c84e1=_0x2fbdb1?_0x14816c['count']:_0x4a6cb5[_0x8d76('0x1e')]+_0x4a6cb5['limit'];var _0x14d932;if(_0x3c84e1>=_0x55a518){_0x3c84e1=_0x55a518;_0x14d932=0xc8;}else{_0x14d932=0xce;}_0x15e6d2['status'](_0x14d932);return _0x15e6d2[_0x8d76('0x1f')]('Content-Range',_0x1fdee5+'-'+_0x3c84e1+'/'+_0x55a518)['json'](_0x14816c);}return null;};}function patchUpdates(_0x3d12a0){return function(_0x4b568a){try{jsonpatch[_0x8d76('0x20')](_0x4b568a,_0x3d12a0,!![]);}catch(_0x23f14e){return BPromise[_0x8d76('0x21')](_0x23f14e);}return _0x4b568a[_0x8d76('0x22')]();};}function saveUpdates(_0x5c5b54,_0x342df7){return function(_0x57c7cb){if(_0x57c7cb){return _0x57c7cb[_0x8d76('0x23')](_0x5c5b54)[_0x8d76('0x24')](function(_0x10d980){return _0x10d980;});}return null;};}function removeEntity(_0x459a24,_0x4ff28b){return function(_0x4d3d87){if(_0x4d3d87){return _0x4d3d87['destroy']()[_0x8d76('0x24')](function(){_0x459a24[_0x8d76('0x1a')](0xcc)[_0x8d76('0x25')]();});}};}function handleEntityNotFound(_0x539ecc,_0x20b411){return function(_0x314eb6){if(!_0x314eb6){_0x539ecc['sendStatus'](0x194);}return _0x314eb6;};}function handleError(_0x35287b,_0x1faeb9){_0x1faeb9=_0x1faeb9||0x1f4;return function(_0x21e85a){logger[_0x8d76('0x26')](_0x21e85a[_0x8d76('0x27')]);if(_0x21e85a[_0x8d76('0x28')]){delete _0x21e85a[_0x8d76('0x28')];}_0x35287b[_0x8d76('0x1a')](_0x1faeb9)[_0x8d76('0x29')](_0x21e85a);};}exports[_0x8d76('0x2a')]=function(_0x3e635d,_0x23b8af){var _0xa5337e={},_0x1302bd={},_0x2382aa={'count':0x0,'rows':[]};var _0x37e48d=_[_0x8d76('0x2b')](db[_0x8d76('0x2c')][_0x8d76('0x2d')],function(_0x209c77){return{'name':_0x209c77[_0x8d76('0x2e')],'type':_0x209c77['type'][_0x8d76('0x2f')]};});_0x1302bd[_0x8d76('0x30')]=_[_0x8d76('0x2b')](_0x37e48d,_0x8d76('0x28'));_0x1302bd[_0x8d76('0x31')]=_['keys'](_0x3e635d[_0x8d76('0x31')]);_0x1302bd[_0x8d76('0x32')]=_[_0x8d76('0x33')](_0x1302bd['model'],_0x1302bd[_0x8d76('0x31')]);_0xa5337e[_0x8d76('0x34')]=_[_0x8d76('0x33')](_0x1302bd[_0x8d76('0x30')],qs[_0x8d76('0x35')](_0x3e635d[_0x8d76('0x31')]['fields']));_0xa5337e['attributes']=_0xa5337e['attributes'][_0x8d76('0x36')]?_0xa5337e[_0x8d76('0x34')]:_0x1302bd[_0x8d76('0x30')];if(!_0x3e635d[_0x8d76('0x31')][_0x8d76('0x37')](_0x8d76('0x38'))){_0xa5337e[_0x8d76('0x39')]=qs['limit'](_0x3e635d['query'][_0x8d76('0x39')]);_0xa5337e[_0x8d76('0x1e')]=qs[_0x8d76('0x1e')](_0x3e635d[_0x8d76('0x31')][_0x8d76('0x1e')]);}_0xa5337e[_0x8d76('0x3a')]=qs[_0x8d76('0x3b')](_0x3e635d[_0x8d76('0x31')][_0x8d76('0x3b')]);_0xa5337e[_0x8d76('0x3c')]=qs[_0x8d76('0x32')](_[_0x8d76('0x3d')](_0x3e635d[_0x8d76('0x31')],_0x1302bd[_0x8d76('0x32')]),_0x37e48d);if(_0x3e635d['query'][_0x8d76('0x3e')]){_0xa5337e[_0x8d76('0x3c')]=_[_0x8d76('0x3f')](_0xa5337e[_0x8d76('0x3c')],{'$or':_[_0x8d76('0x2b')](_0x37e48d,function(_0x444ad9){if(_0x444ad9[_0x8d76('0x40')]!==_0x8d76('0x41')){var _0x4fdc20={};_0x4fdc20[_0x444ad9['name']]={'$like':'%'+_0x3e635d[_0x8d76('0x31')][_0x8d76('0x3e')]+'%'};return _0x4fdc20;}})});}_0xa5337e=_[_0x8d76('0x3f')]({},_0xa5337e,_0x3e635d['options']);var _0x5997f7={'where':_0xa5337e[_0x8d76('0x3c')]};return db[_0x8d76('0x2c')]['count'](_0x5997f7)['then'](function(_0x3b796b){_0x2382aa[_0x8d76('0x1d')]=_0x3b796b;if(_0x3e635d[_0x8d76('0x31')][_0x8d76('0x42')]){_0xa5337e['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0x8d76('0x43')](_0xa5337e);})[_0x8d76('0x24')](function(_0x3e3b05){_0x2382aa[_0x8d76('0x44')]=_0x3e3b05;return _0x2382aa;})[_0x8d76('0x24')](respondWithFilteredResult(_0x23b8af,_0xa5337e))[_0x8d76('0x45')](handleError(_0x23b8af,null));};exports[_0x8d76('0x46')]=function(_0x58fd61,_0x3d7871){var _0x5c3fa4={'raw':![],'where':{'id':_0x58fd61[_0x8d76('0x47')]['id']}},_0x4d9936={};_0x4d9936[_0x8d76('0x30')]=_[_0x8d76('0x48')](db['ZohoConfiguration'][_0x8d76('0x2d')]);_0x4d9936['query']=_[_0x8d76('0x48')](_0x58fd61['query']);_0x4d9936['filters']=_['intersection'](_0x4d9936[_0x8d76('0x30')],_0x4d9936[_0x8d76('0x31')]);_0x5c3fa4[_0x8d76('0x34')]=_[_0x8d76('0x33')](_0x4d9936[_0x8d76('0x30')],qs['fields'](_0x58fd61[_0x8d76('0x31')][_0x8d76('0x35')]));_0x5c3fa4[_0x8d76('0x34')]=_0x5c3fa4['attributes']['length']?_0x5c3fa4[_0x8d76('0x34')]:_0x4d9936['model'];if(_0x58fd61[_0x8d76('0x31')][_0x8d76('0x42')]){_0x5c3fa4[_0x8d76('0x49')]=[{'all':!![]}];}_0x5c3fa4=_[_0x8d76('0x3f')]({},_0x5c3fa4,_0x58fd61['options']);return db[_0x8d76('0x2c')][_0x8d76('0x4a')](_0x5c3fa4)[_0x8d76('0x24')](handleEntityNotFound(_0x3d7871,null))['then'](respondWithResult(_0x3d7871,null))[_0x8d76('0x45')](handleError(_0x3d7871,null));};exports[_0x8d76('0x4b')]=function(_0x11553b,_0x221cad){return db[_0x8d76('0x2c')]['create'](_0x11553b[_0x8d76('0x4c')],{})[_0x8d76('0x24')](respondWithResult(_0x221cad,0xc9))[_0x8d76('0x45')](handleError(_0x221cad,null));};exports[_0x8d76('0x23')]=function(_0x456786,_0x496afb){if(_0x456786[_0x8d76('0x4c')]['id']){delete _0x456786[_0x8d76('0x4c')]['id'];}return db[_0x8d76('0x2c')][_0x8d76('0x4a')]({'where':{'id':_0x456786[_0x8d76('0x47')]['id']}})[_0x8d76('0x24')](handleEntityNotFound(_0x496afb,null))['then'](saveUpdates(_0x456786[_0x8d76('0x4c')],null))[_0x8d76('0x24')](respondWithResult(_0x496afb,null))[_0x8d76('0x45')](handleError(_0x496afb,null));};exports[_0x8d76('0x4d')]=function(_0x2a377d,_0x182c0a){return db[_0x8d76('0x2c')][_0x8d76('0x4a')]({'where':{'id':_0x2a377d[_0x8d76('0x47')]['id']}})[_0x8d76('0x24')](handleEntityNotFound(_0x182c0a,null))[_0x8d76('0x24')](removeEntity(_0x182c0a,null))[_0x8d76('0x45')](handleError(_0x182c0a,null));};exports['getFields']=function(_0x5987f9,_0x5b87bc,_0x4378f4){var _0x3ae2c1={};var _0x459aa7={};var _0x2d1196;var _0x48a66e;return db[_0x8d76('0x2c')][_0x8d76('0x4e')]({'where':{'id':_0x5987f9[_0x8d76('0x47')]['id']}})[_0x8d76('0x24')](handleEntityNotFound(_0x5b87bc,null))['then'](function(_0x56854a){if(_0x56854a){_0x2d1196=_0x56854a;_0x459aa7[_0x8d76('0x30')]=_[_0x8d76('0x48')](db[_0x8d76('0x4f')][_0x8d76('0x2d')]);_0x459aa7['query']=_[_0x8d76('0x48')](_0x5987f9[_0x8d76('0x31')]);_0x459aa7[_0x8d76('0x32')]=_['intersection'](_0x459aa7[_0x8d76('0x30')],_0x459aa7[_0x8d76('0x31')]);_0x3ae2c1[_0x8d76('0x34')]=_[_0x8d76('0x33')](_0x459aa7[_0x8d76('0x30')],qs['fields'](_0x5987f9['query']['fields']));_0x3ae2c1[_0x8d76('0x34')]=_0x3ae2c1[_0x8d76('0x34')]['length']?_0x3ae2c1['attributes']:_0x459aa7[_0x8d76('0x30')];_0x3ae2c1[_0x8d76('0x3a')]=qs[_0x8d76('0x3b')](_0x5987f9[_0x8d76('0x31')][_0x8d76('0x3b')]);_0x3ae2c1['where']=qs[_0x8d76('0x32')](_[_0x8d76('0x3d')](_0x5987f9[_0x8d76('0x31')],_0x459aa7['filters']));if(_0x5987f9['query'][_0x8d76('0x3e')]){_0x3ae2c1[_0x8d76('0x3c')]=_['merge'](_0x3ae2c1[_0x8d76('0x3c')],{'$or':_['map'](_0x3ae2c1[_0x8d76('0x34')],function(_0x42f45d){var _0x4b3aa7={};_0x4b3aa7[_0x42f45d]={'$like':'%'+_0x5987f9['query'][_0x8d76('0x3e')]+'%'};return _0x4b3aa7;})});}_0x3ae2c1=_[_0x8d76('0x3f')]({},_0x3ae2c1,_0x5987f9[_0x8d76('0x50')]);return _0x2d1196[_0x8d76('0x51')](_0x3ae2c1);}})[_0x8d76('0x24')](function(_0x1e6305){if(_0x1e6305){_0x48a66e=_0x1e6305['length'];if(!_0x5987f9[_0x8d76('0x31')][_0x8d76('0x37')](_0x8d76('0x38'))){_0x3ae2c1[_0x8d76('0x39')]=qs[_0x8d76('0x39')](_0x5987f9[_0x8d76('0x31')][_0x8d76('0x39')]);_0x3ae2c1['offset']=qs[_0x8d76('0x1e')](_0x5987f9['query'][_0x8d76('0x1e')]);}return _0x2d1196[_0x8d76('0x51')](_0x3ae2c1);}})['then'](function(_0x21b012){if(_0x21b012){return _0x21b012?{'count':_0x48a66e,'rows':_0x21b012}:null;}})['then'](respondWithResult(_0x5b87bc,null))['catch'](handleError(_0x5b87bc,null));};exports[_0x8d76('0x52')]=function(_0x327b69,_0x555d9d,_0xb1c205){var _0x1623f3={};var _0x46c874={};var _0x478da9;var _0x24aace;return db[_0x8d76('0x2c')][_0x8d76('0x4e')]({'where':{'id':_0x327b69[_0x8d76('0x47')]['id']}})[_0x8d76('0x24')](handleEntityNotFound(_0x555d9d,null))['then'](function(_0x24def4){if(_0x24def4){_0x478da9=_0x24def4;_0x46c874[_0x8d76('0x30')]=_[_0x8d76('0x48')](db[_0x8d76('0x4f')]['rawAttributes']);_0x46c874[_0x8d76('0x31')]=_[_0x8d76('0x48')](_0x327b69['query']);_0x46c874[_0x8d76('0x32')]=_[_0x8d76('0x33')](_0x46c874[_0x8d76('0x30')],_0x46c874[_0x8d76('0x31')]);_0x1623f3[_0x8d76('0x34')]=_[_0x8d76('0x33')](_0x46c874[_0x8d76('0x30')],qs['fields'](_0x327b69[_0x8d76('0x31')][_0x8d76('0x35')]));_0x1623f3[_0x8d76('0x34')]=_0x1623f3[_0x8d76('0x34')]['length']?_0x1623f3[_0x8d76('0x34')]:_0x46c874['model'];_0x1623f3[_0x8d76('0x3a')]=qs[_0x8d76('0x3b')](_0x327b69[_0x8d76('0x31')][_0x8d76('0x3b')]);_0x1623f3['where']=qs['filters'](_[_0x8d76('0x3d')](_0x327b69[_0x8d76('0x31')],_0x46c874[_0x8d76('0x32')]));if(_0x327b69[_0x8d76('0x31')][_0x8d76('0x3e')]){_0x1623f3['where']=_[_0x8d76('0x3f')](_0x1623f3[_0x8d76('0x3c')],{'$or':_[_0x8d76('0x2b')](_0x1623f3[_0x8d76('0x34')],function(_0x2cc787){var _0x472a59={};_0x472a59[_0x2cc787]={'$like':'%'+_0x327b69[_0x8d76('0x31')][_0x8d76('0x3e')]+'%'};return _0x472a59;})});}_0x1623f3=_[_0x8d76('0x3f')]({},_0x1623f3,_0x327b69[_0x8d76('0x50')]);return _0x478da9[_0x8d76('0x52')](_0x1623f3);}})[_0x8d76('0x24')](function(_0x504490){if(_0x504490){_0x24aace=_0x504490[_0x8d76('0x36')];if(!_0x327b69[_0x8d76('0x31')][_0x8d76('0x37')](_0x8d76('0x38'))){_0x1623f3[_0x8d76('0x39')]=qs[_0x8d76('0x39')](_0x327b69['query'][_0x8d76('0x39')]);_0x1623f3[_0x8d76('0x1e')]=qs[_0x8d76('0x1e')](_0x327b69[_0x8d76('0x31')][_0x8d76('0x1e')]);}return _0x478da9[_0x8d76('0x52')](_0x1623f3);}})[_0x8d76('0x24')](function(_0x5962c9){if(_0x5962c9){return _0x5962c9?{'count':_0x24aace,'rows':_0x5962c9}:null;}})[_0x8d76('0x24')](respondWithResult(_0x555d9d,null))[_0x8d76('0x45')](handleError(_0x555d9d,null));};exports['getDescriptions']=function(_0x4fac9a,_0x3febc7,_0x29dff9){var _0x2fbdf5={};var _0x54849b={};var _0x157990;var _0x576543;return db[_0x8d76('0x2c')][_0x8d76('0x4e')]({'where':{'id':_0x4fac9a['params']['id']}})[_0x8d76('0x24')](handleEntityNotFound(_0x3febc7,null))['then'](function(_0x2516ce){if(_0x2516ce){_0x157990=_0x2516ce;_0x54849b[_0x8d76('0x30')]=_[_0x8d76('0x48')](db[_0x8d76('0x4f')]['rawAttributes']);_0x54849b[_0x8d76('0x31')]=_[_0x8d76('0x48')](_0x4fac9a[_0x8d76('0x31')]);_0x54849b[_0x8d76('0x32')]=_['intersection'](_0x54849b[_0x8d76('0x30')],_0x54849b[_0x8d76('0x31')]);_0x2fbdf5['attributes']=_[_0x8d76('0x33')](_0x54849b[_0x8d76('0x30')],qs[_0x8d76('0x35')](_0x4fac9a[_0x8d76('0x31')]['fields']));_0x2fbdf5[_0x8d76('0x34')]=_0x2fbdf5[_0x8d76('0x34')][_0x8d76('0x36')]?_0x2fbdf5[_0x8d76('0x34')]:_0x54849b[_0x8d76('0x30')];_0x2fbdf5['order']=qs['sort'](_0x4fac9a[_0x8d76('0x31')]['sort']);_0x2fbdf5[_0x8d76('0x3c')]=qs[_0x8d76('0x32')](_[_0x8d76('0x3d')](_0x4fac9a[_0x8d76('0x31')],_0x54849b[_0x8d76('0x32')]));if(_0x4fac9a[_0x8d76('0x31')][_0x8d76('0x3e')]){_0x2fbdf5[_0x8d76('0x3c')]=_[_0x8d76('0x3f')](_0x2fbdf5[_0x8d76('0x3c')],{'$or':_[_0x8d76('0x2b')](_0x2fbdf5[_0x8d76('0x34')],function(_0x2e1a5e){var _0xd68a57={};_0xd68a57[_0x2e1a5e]={'$like':'%'+_0x4fac9a[_0x8d76('0x31')][_0x8d76('0x3e')]+'%'};return _0xd68a57;})});}_0x2fbdf5=_['merge']({},_0x2fbdf5,_0x4fac9a[_0x8d76('0x50')]);return _0x157990['getDescriptions'](_0x2fbdf5);}})[_0x8d76('0x24')](function(_0x2508e3){if(_0x2508e3){_0x576543=_0x2508e3[_0x8d76('0x36')];if(!_0x4fac9a['query'][_0x8d76('0x37')](_0x8d76('0x38'))){_0x2fbdf5[_0x8d76('0x39')]=qs['limit'](_0x4fac9a[_0x8d76('0x31')]['limit']);_0x2fbdf5[_0x8d76('0x1e')]=qs[_0x8d76('0x1e')](_0x4fac9a[_0x8d76('0x31')][_0x8d76('0x1e')]);}return _0x157990[_0x8d76('0x53')](_0x2fbdf5);}})[_0x8d76('0x24')](function(_0x1a31d8){if(_0x1a31d8){return _0x1a31d8?{'count':_0x576543,'rows':_0x1a31d8}:null;}})['then'](respondWithResult(_0x3febc7,null))[_0x8d76('0x45')](handleError(_0x3febc7,null));}; \ No newline at end of file +var _0xede0=['params','rawAttributes','keys','options','find','create','body','findOne','ZohoField','pick','getFields','getSubjects','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','includeAll','include','ZohoConfiguration','rows','catch'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0xede0,0x18a));var _0x0ede=function(_0x5361d1,_0x28d46e){_0x5361d1=_0x5361d1-0x0;var _0x5ca916=_0xede0[_0x5361d1];return _0x5ca916;};'use strict';var emlformat=require(_0x0ede('0x0'));var rimraf=require(_0x0ede('0x1'));var zipdir=require(_0x0ede('0x2'));var jsonpatch=require(_0x0ede('0x3'));var rp=require(_0x0ede('0x4'));var moment=require(_0x0ede('0x5'));var BPromise=require(_0x0ede('0x6'));var Mustache=require('mustache');var util=require(_0x0ede('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0ede('0x8'));var ejs=require(_0x0ede('0x9'));var fs=require('fs');var fs_extra=require(_0x0ede('0xa'));var _=require(_0x0ede('0xb'));var squel=require(_0x0ede('0xc'));var crypto=require(_0x0ede('0xd'));var jsforce=require(_0x0ede('0xe'));var deskjs=require(_0x0ede('0xf'));var toCsv=require(_0x0ede('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0ede('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0ede('0x11'));var as=require(_0x0ede('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ede('0x13'))(_0x0ede('0x14'));var utils=require('../../config/utils');var config=require(_0x0ede('0x15'));var licenseUtil=require(_0x0ede('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x497d49,_0x35f488){_0x35f488=_0x35f488||0xcc;return function(_0x6edd71){if(_0x6edd71){return _0x497d49[_0x0ede('0x17')](_0x35f488);}return _0x497d49[_0x0ede('0x18')](_0x35f488)[_0x0ede('0x19')]();};}function respondWithResult(_0x5a6c8d,_0x2f414a){_0x2f414a=_0x2f414a||0xc8;return function(_0x3c6d73){if(_0x3c6d73){return _0x5a6c8d[_0x0ede('0x18')](_0x2f414a)[_0x0ede('0x1a')](_0x3c6d73);}};}function respondWithFilteredResult(_0x523786,_0x235f39){return function(_0x42fd32){if(_0x42fd32){var _0x4e3908=typeof _0x235f39[_0x0ede('0x1b')]===_0x0ede('0x1c')&&typeof _0x235f39[_0x0ede('0x1d')]===_0x0ede('0x1c');var _0xb6a8b=_0x42fd32[_0x0ede('0x1e')];var _0x53ef14=_0x4e3908?0x0:_0x235f39[_0x0ede('0x1b')];var _0x5a3db4=_0x4e3908?_0x42fd32[_0x0ede('0x1e')]:_0x235f39['offset']+_0x235f39[_0x0ede('0x1d')];var _0x5d081a;if(_0x5a3db4>=_0xb6a8b){_0x5a3db4=_0xb6a8b;_0x5d081a=0xc8;}else{_0x5d081a=0xce;}_0x523786[_0x0ede('0x18')](_0x5d081a);return _0x523786['set'](_0x0ede('0x1f'),_0x53ef14+'-'+_0x5a3db4+'/'+_0xb6a8b)[_0x0ede('0x1a')](_0x42fd32);}return null;};}function patchUpdates(_0x34c836){return function(_0x187803){try{jsonpatch[_0x0ede('0x20')](_0x187803,_0x34c836,!![]);}catch(_0x29a994){return BPromise['reject'](_0x29a994);}return _0x187803[_0x0ede('0x21')]();};}function saveUpdates(_0x188f8a,_0x7dc38){return function(_0x301d04){if(_0x301d04){return _0x301d04[_0x0ede('0x22')](_0x188f8a)[_0x0ede('0x23')](function(_0x2c6bd7){return _0x2c6bd7;});}return null;};}function removeEntity(_0x341d31,_0x242ed9){return function(_0x2e27e6){if(_0x2e27e6){return _0x2e27e6[_0x0ede('0x24')]()[_0x0ede('0x23')](function(){_0x341d31[_0x0ede('0x18')](0xcc)[_0x0ede('0x19')]();});}};}function handleEntityNotFound(_0x25be4c,_0x112be6){return function(_0x47da83){if(!_0x47da83){_0x25be4c[_0x0ede('0x17')](0x194);}return _0x47da83;};}function handleError(_0x4e3506,_0x1f226b){_0x1f226b=_0x1f226b||0x1f4;return function(_0x7ff859){logger[_0x0ede('0x25')](_0x7ff859[_0x0ede('0x26')]);if(_0x7ff859[_0x0ede('0x27')]){delete _0x7ff859[_0x0ede('0x27')];}_0x4e3506['status'](_0x1f226b)[_0x0ede('0x28')](_0x7ff859);};}exports['index']=function(_0x11cd39,_0x3810ce){var _0x21eb3d={},_0xd7f081={},_0x3de276={'count':0x0,'rows':[]};var _0x26c528=_['map'](db['ZohoConfiguration']['rawAttributes'],function(_0x51bc51){return{'name':_0x51bc51[_0x0ede('0x29')],'type':_0x51bc51[_0x0ede('0x2a')]['key']};});_0xd7f081[_0x0ede('0x2b')]=_[_0x0ede('0x2c')](_0x26c528,_0x0ede('0x27'));_0xd7f081[_0x0ede('0x2d')]=_['keys'](_0x11cd39['query']);_0xd7f081[_0x0ede('0x2e')]=_[_0x0ede('0x2f')](_0xd7f081[_0x0ede('0x2b')],_0xd7f081[_0x0ede('0x2d')]);_0x21eb3d[_0x0ede('0x30')]=_['intersection'](_0xd7f081[_0x0ede('0x2b')],qs[_0x0ede('0x31')](_0x11cd39['query']['fields']));_0x21eb3d['attributes']=_0x21eb3d[_0x0ede('0x30')][_0x0ede('0x32')]?_0x21eb3d[_0x0ede('0x30')]:_0xd7f081[_0x0ede('0x2b')];if(!_0x11cd39[_0x0ede('0x2d')][_0x0ede('0x33')](_0x0ede('0x34'))){_0x21eb3d[_0x0ede('0x1d')]=qs[_0x0ede('0x1d')](_0x11cd39[_0x0ede('0x2d')][_0x0ede('0x1d')]);_0x21eb3d[_0x0ede('0x1b')]=qs[_0x0ede('0x1b')](_0x11cd39[_0x0ede('0x2d')]['offset']);}_0x21eb3d['order']=qs[_0x0ede('0x35')](_0x11cd39['query'][_0x0ede('0x35')]);_0x21eb3d[_0x0ede('0x36')]=qs['filters'](_['pick'](_0x11cd39[_0x0ede('0x2d')],_0xd7f081[_0x0ede('0x2e')]),_0x26c528);if(_0x11cd39[_0x0ede('0x2d')][_0x0ede('0x37')]){_0x21eb3d[_0x0ede('0x36')]=_[_0x0ede('0x38')](_0x21eb3d['where'],{'$or':_[_0x0ede('0x2c')](_0x26c528,function(_0x360cc9){if(_0x360cc9[_0x0ede('0x2a')]!=='VIRTUAL'){var _0x333f86={};_0x333f86[_0x360cc9[_0x0ede('0x27')]]={'$like':'%'+_0x11cd39[_0x0ede('0x2d')][_0x0ede('0x37')]+'%'};return _0x333f86;}})});}_0x21eb3d=_[_0x0ede('0x38')]({},_0x21eb3d,_0x11cd39['options']);var _0x14a78f={'where':_0x21eb3d['where']};return db['ZohoConfiguration'][_0x0ede('0x1e')](_0x14a78f)[_0x0ede('0x23')](function(_0x1b2102){_0x3de276[_0x0ede('0x1e')]=_0x1b2102;if(_0x11cd39[_0x0ede('0x2d')][_0x0ede('0x39')]){_0x21eb3d[_0x0ede('0x3a')]=[{'all':!![]}];}return db[_0x0ede('0x3b')]['findAll'](_0x21eb3d);})[_0x0ede('0x23')](function(_0x763d66){_0x3de276[_0x0ede('0x3c')]=_0x763d66;return _0x3de276;})[_0x0ede('0x23')](respondWithFilteredResult(_0x3810ce,_0x21eb3d))[_0x0ede('0x3d')](handleError(_0x3810ce,null));};exports['show']=function(_0x3b2d29,_0x440155){var _0x23af80={'raw':![],'where':{'id':_0x3b2d29[_0x0ede('0x3e')]['id']}},_0x438fc0={};_0x438fc0[_0x0ede('0x2b')]=_['keys'](db[_0x0ede('0x3b')][_0x0ede('0x3f')]);_0x438fc0['query']=_[_0x0ede('0x40')](_0x3b2d29[_0x0ede('0x2d')]);_0x438fc0[_0x0ede('0x2e')]=_[_0x0ede('0x2f')](_0x438fc0['model'],_0x438fc0[_0x0ede('0x2d')]);_0x23af80[_0x0ede('0x30')]=_[_0x0ede('0x2f')](_0x438fc0['model'],qs[_0x0ede('0x31')](_0x3b2d29[_0x0ede('0x2d')]['fields']));_0x23af80[_0x0ede('0x30')]=_0x23af80[_0x0ede('0x30')][_0x0ede('0x32')]?_0x23af80['attributes']:_0x438fc0[_0x0ede('0x2b')];if(_0x3b2d29[_0x0ede('0x2d')][_0x0ede('0x39')]){_0x23af80[_0x0ede('0x3a')]=[{'all':!![]}];}_0x23af80=_[_0x0ede('0x38')]({},_0x23af80,_0x3b2d29[_0x0ede('0x41')]);return db[_0x0ede('0x3b')][_0x0ede('0x42')](_0x23af80)[_0x0ede('0x23')](handleEntityNotFound(_0x440155,null))[_0x0ede('0x23')](respondWithResult(_0x440155,null))[_0x0ede('0x3d')](handleError(_0x440155,null));};exports[_0x0ede('0x43')]=function(_0x2b343e,_0x355c0a){return db[_0x0ede('0x3b')][_0x0ede('0x43')](_0x2b343e['body'],{})[_0x0ede('0x23')](respondWithResult(_0x355c0a,0xc9))['catch'](handleError(_0x355c0a,null));};exports[_0x0ede('0x22')]=function(_0x5520a6,_0x408591){if(_0x5520a6[_0x0ede('0x44')]['id']){delete _0x5520a6['body']['id'];}return db[_0x0ede('0x3b')]['find']({'where':{'id':_0x5520a6[_0x0ede('0x3e')]['id']}})[_0x0ede('0x23')](handleEntityNotFound(_0x408591,null))[_0x0ede('0x23')](saveUpdates(_0x5520a6[_0x0ede('0x44')],null))['then'](respondWithResult(_0x408591,null))[_0x0ede('0x3d')](handleError(_0x408591,null));};exports[_0x0ede('0x24')]=function(_0x8b295e,_0x2bb40f){return db[_0x0ede('0x3b')][_0x0ede('0x42')]({'where':{'id':_0x8b295e[_0x0ede('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2bb40f,null))[_0x0ede('0x23')](removeEntity(_0x2bb40f,null))[_0x0ede('0x3d')](handleError(_0x2bb40f,null));};exports['getFields']=function(_0x60b62d,_0x556da4,_0x277b44){var _0xc47ad3={};var _0x4332b7={};var _0x1b4231;var _0x11189f;return db[_0x0ede('0x3b')][_0x0ede('0x45')]({'where':{'id':_0x60b62d[_0x0ede('0x3e')]['id']}})[_0x0ede('0x23')](handleEntityNotFound(_0x556da4,null))['then'](function(_0x257cc8){if(_0x257cc8){_0x1b4231=_0x257cc8;_0x4332b7[_0x0ede('0x2b')]=_[_0x0ede('0x40')](db[_0x0ede('0x46')]['rawAttributes']);_0x4332b7[_0x0ede('0x2d')]=_[_0x0ede('0x40')](_0x60b62d[_0x0ede('0x2d')]);_0x4332b7[_0x0ede('0x2e')]=_[_0x0ede('0x2f')](_0x4332b7[_0x0ede('0x2b')],_0x4332b7[_0x0ede('0x2d')]);_0xc47ad3[_0x0ede('0x30')]=_[_0x0ede('0x2f')](_0x4332b7[_0x0ede('0x2b')],qs[_0x0ede('0x31')](_0x60b62d[_0x0ede('0x2d')][_0x0ede('0x31')]));_0xc47ad3[_0x0ede('0x30')]=_0xc47ad3['attributes'][_0x0ede('0x32')]?_0xc47ad3[_0x0ede('0x30')]:_0x4332b7[_0x0ede('0x2b')];_0xc47ad3['order']=qs[_0x0ede('0x35')](_0x60b62d[_0x0ede('0x2d')]['sort']);_0xc47ad3['where']=qs['filters'](_[_0x0ede('0x47')](_0x60b62d['query'],_0x4332b7[_0x0ede('0x2e')]));if(_0x60b62d['query'][_0x0ede('0x37')]){_0xc47ad3['where']=_['merge'](_0xc47ad3[_0x0ede('0x36')],{'$or':_['map'](_0xc47ad3[_0x0ede('0x30')],function(_0x4c0b72){var _0x3962b5={};_0x3962b5[_0x4c0b72]={'$like':'%'+_0x60b62d[_0x0ede('0x2d')][_0x0ede('0x37')]+'%'};return _0x3962b5;})});}_0xc47ad3=_[_0x0ede('0x38')]({},_0xc47ad3,_0x60b62d[_0x0ede('0x41')]);return _0x1b4231[_0x0ede('0x48')](_0xc47ad3);}})[_0x0ede('0x23')](function(_0x3f9eb7){if(_0x3f9eb7){_0x11189f=_0x3f9eb7[_0x0ede('0x32')];if(!_0x60b62d[_0x0ede('0x2d')][_0x0ede('0x33')]('nolimit')){_0xc47ad3[_0x0ede('0x1d')]=qs['limit'](_0x60b62d[_0x0ede('0x2d')][_0x0ede('0x1d')]);_0xc47ad3[_0x0ede('0x1b')]=qs[_0x0ede('0x1b')](_0x60b62d['query'][_0x0ede('0x1b')]);}return _0x1b4231[_0x0ede('0x48')](_0xc47ad3);}})[_0x0ede('0x23')](function(_0x483019){if(_0x483019){return _0x483019?{'count':_0x11189f,'rows':_0x483019}:null;}})['then'](respondWithResult(_0x556da4,null))[_0x0ede('0x3d')](handleError(_0x556da4,null));};exports[_0x0ede('0x49')]=function(_0x16bb91,_0x2ea872,_0x1458e4){var _0x206c22={};var _0x500fe2={};var _0x997ddf;var _0xcd624e;return db['ZohoConfiguration'][_0x0ede('0x45')]({'where':{'id':_0x16bb91[_0x0ede('0x3e')]['id']}})[_0x0ede('0x23')](handleEntityNotFound(_0x2ea872,null))['then'](function(_0x34312f){if(_0x34312f){_0x997ddf=_0x34312f;_0x500fe2[_0x0ede('0x2b')]=_['keys'](db[_0x0ede('0x46')][_0x0ede('0x3f')]);_0x500fe2['query']=_['keys'](_0x16bb91[_0x0ede('0x2d')]);_0x500fe2[_0x0ede('0x2e')]=_[_0x0ede('0x2f')](_0x500fe2[_0x0ede('0x2b')],_0x500fe2['query']);_0x206c22[_0x0ede('0x30')]=_[_0x0ede('0x2f')](_0x500fe2[_0x0ede('0x2b')],qs[_0x0ede('0x31')](_0x16bb91[_0x0ede('0x2d')][_0x0ede('0x31')]));_0x206c22['attributes']=_0x206c22[_0x0ede('0x30')][_0x0ede('0x32')]?_0x206c22[_0x0ede('0x30')]:_0x500fe2[_0x0ede('0x2b')];_0x206c22[_0x0ede('0x4a')]=qs['sort'](_0x16bb91[_0x0ede('0x2d')][_0x0ede('0x35')]);_0x206c22['where']=qs[_0x0ede('0x2e')](_[_0x0ede('0x47')](_0x16bb91[_0x0ede('0x2d')],_0x500fe2[_0x0ede('0x2e')]));if(_0x16bb91[_0x0ede('0x2d')][_0x0ede('0x37')]){_0x206c22[_0x0ede('0x36')]=_['merge'](_0x206c22[_0x0ede('0x36')],{'$or':_[_0x0ede('0x2c')](_0x206c22['attributes'],function(_0x2248ab){var _0x1b6e7e={};_0x1b6e7e[_0x2248ab]={'$like':'%'+_0x16bb91['query'][_0x0ede('0x37')]+'%'};return _0x1b6e7e;})});}_0x206c22=_[_0x0ede('0x38')]({},_0x206c22,_0x16bb91['options']);return _0x997ddf[_0x0ede('0x49')](_0x206c22);}})[_0x0ede('0x23')](function(_0x5280bc){if(_0x5280bc){_0xcd624e=_0x5280bc[_0x0ede('0x32')];if(!_0x16bb91[_0x0ede('0x2d')][_0x0ede('0x33')](_0x0ede('0x34'))){_0x206c22['limit']=qs[_0x0ede('0x1d')](_0x16bb91[_0x0ede('0x2d')][_0x0ede('0x1d')]);_0x206c22['offset']=qs[_0x0ede('0x1b')](_0x16bb91[_0x0ede('0x2d')][_0x0ede('0x1b')]);}return _0x997ddf['getSubjects'](_0x206c22);}})[_0x0ede('0x23')](function(_0xa78b9c){if(_0xa78b9c){return _0xa78b9c?{'count':_0xcd624e,'rows':_0xa78b9c}:null;}})[_0x0ede('0x23')](respondWithResult(_0x2ea872,null))['catch'](handleError(_0x2ea872,null));};exports[_0x0ede('0x4b')]=function(_0xdbd3a1,_0xbdf44d,_0x2601bd){var _0x4c97bd={};var _0xba6e90={};var _0xaf3cb2;var _0x22d8d1;return db[_0x0ede('0x3b')][_0x0ede('0x45')]({'where':{'id':_0xdbd3a1[_0x0ede('0x3e')]['id']}})[_0x0ede('0x23')](handleEntityNotFound(_0xbdf44d,null))[_0x0ede('0x23')](function(_0x44d8c1){if(_0x44d8c1){_0xaf3cb2=_0x44d8c1;_0xba6e90['model']=_[_0x0ede('0x40')](db[_0x0ede('0x46')][_0x0ede('0x3f')]);_0xba6e90[_0x0ede('0x2d')]=_[_0x0ede('0x40')](_0xdbd3a1[_0x0ede('0x2d')]);_0xba6e90[_0x0ede('0x2e')]=_[_0x0ede('0x2f')](_0xba6e90['model'],_0xba6e90[_0x0ede('0x2d')]);_0x4c97bd['attributes']=_[_0x0ede('0x2f')](_0xba6e90[_0x0ede('0x2b')],qs['fields'](_0xdbd3a1[_0x0ede('0x2d')][_0x0ede('0x31')]));_0x4c97bd[_0x0ede('0x30')]=_0x4c97bd[_0x0ede('0x30')][_0x0ede('0x32')]?_0x4c97bd[_0x0ede('0x30')]:_0xba6e90['model'];_0x4c97bd['order']=qs[_0x0ede('0x35')](_0xdbd3a1[_0x0ede('0x2d')][_0x0ede('0x35')]);_0x4c97bd[_0x0ede('0x36')]=qs[_0x0ede('0x2e')](_[_0x0ede('0x47')](_0xdbd3a1[_0x0ede('0x2d')],_0xba6e90[_0x0ede('0x2e')]));if(_0xdbd3a1[_0x0ede('0x2d')][_0x0ede('0x37')]){_0x4c97bd[_0x0ede('0x36')]=_['merge'](_0x4c97bd['where'],{'$or':_[_0x0ede('0x2c')](_0x4c97bd[_0x0ede('0x30')],function(_0x576715){var _0x2d013b={};_0x2d013b[_0x576715]={'$like':'%'+_0xdbd3a1[_0x0ede('0x2d')][_0x0ede('0x37')]+'%'};return _0x2d013b;})});}_0x4c97bd=_[_0x0ede('0x38')]({},_0x4c97bd,_0xdbd3a1[_0x0ede('0x41')]);return _0xaf3cb2[_0x0ede('0x4b')](_0x4c97bd);}})[_0x0ede('0x23')](function(_0x3de9b6){if(_0x3de9b6){_0x22d8d1=_0x3de9b6[_0x0ede('0x32')];if(!_0xdbd3a1[_0x0ede('0x2d')][_0x0ede('0x33')]('nolimit')){_0x4c97bd[_0x0ede('0x1d')]=qs[_0x0ede('0x1d')](_0xdbd3a1[_0x0ede('0x2d')][_0x0ede('0x1d')]);_0x4c97bd[_0x0ede('0x1b')]=qs[_0x0ede('0x1b')](_0xdbd3a1['query'][_0x0ede('0x1b')]);}return _0xaf3cb2[_0x0ede('0x4b')](_0x4c97bd);}})[_0x0ede('0x23')](function(_0x2d9854){if(_0x2d9854){return _0x2d9854?{'count':_0x22d8d1,'rows':_0x2d9854}:null;}})[_0x0ede('0x23')](respondWithResult(_0xbdf44d,null))[_0x0ede('0x3d')](handleError(_0xbdf44d,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 604c341..8b52e1c 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 _0x88a6=['define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','bluebird','path','../../config/environment','./intZohoConfiguration.attributes'];(function(_0x45913b,_0x5198f3){var _0x3952f3=function(_0x21eee0){while(--_0x21eee0){_0x45913b['push'](_0x45913b['shift']());}};_0x3952f3(++_0x5198f3);}(_0x88a6,0x111));var _0x688a=function(_0x4b9d59,_0x910c53){_0x4b9d59=_0x4b9d59-0x0;var _0x2426ba=_0x88a6[_0x4b9d59];return _0x2426ba;};'use strict';var _=require(_0x688a('0x0'));var util=require('util');var logger=require(_0x688a('0x1'))(_0x688a('0x2'));var moment=require('moment');var BPromise=require(_0x688a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x688a('0x4'));var rimraf=require('rimraf');var config=require(_0x688a('0x5'));var attributes=require(_0x688a('0x6'));module['exports']=function(_0x221ddc,_0xed83a3){return _0x221ddc[_0x688a('0x7')](_0x688a('0x8'),attributes,{'tableName':_0x688a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a9c=['rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','../../config/logger','moment','bluebird','path'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0x1a9c,0xc1));var _0xc1a9=function(_0x4d4cb7,_0x39c03f){_0x4d4cb7=_0x4d4cb7-0x0;var _0x27824a=_0x1a9c[_0x4d4cb7];return _0x27824a;};'use strict';var _=require(_0xc1a9('0x0'));var util=require('util');var logger=require(_0xc1a9('0x1'))('api');var moment=require(_0xc1a9('0x2'));var BPromise=require(_0xc1a9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1a9('0x4'));var rimraf=require(_0xc1a9('0x5'));var config=require(_0xc1a9('0x6'));var attributes=require(_0xc1a9('0x7'));module[_0xc1a9('0x8')]=function(_0xbc06bf,_0x15dd32){return _0xbc06bf[_0xc1a9('0x9')](_0xc1a9('0xa'),attributes,{'tableName':'int_zoho_configurations','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 765e46a..103d7cf 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 _0x59c4=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','ZohoConfiguration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x4e6e7f,_0x48a86c){var _0x2fa09c=function(_0x3b63e0){while(--_0x3b63e0){_0x4e6e7f['push'](_0x4e6e7f['shift']());}};_0x2fa09c(++_0x48a86c);}(_0x59c4,0x1c7));var _0x459c=function(_0x2c6222,_0x54f713){_0x2c6222=_0x2c6222-0x0;var _0x53b1c9=_0x59c4[_0x2c6222];return _0x53b1c9;};'use strict';var _=require(_0x459c('0x0'));var util=require(_0x459c('0x1'));var moment=require(_0x459c('0x2'));var BPromise=require(_0x459c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x459c('0x4'));var db=require(_0x459c('0x5'))['db'];var utils=require(_0x459c('0x6'));var logger=require('../../config/logger')(_0x459c('0x7'));var config=require('../../config/environment');var jayson=require(_0x459c('0x8'));var client=jayson['client'][_0x459c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cacff,_0x45b1b3,_0x47b87b){return new BPromise(function(_0x114334,_0x5d2ce9){return client[_0x459c('0xa')](_0x2cacff,_0x47b87b)[_0x459c('0xb')](function(_0x8afdd6){logger[_0x459c('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x45b1b3,'request\x20sent');logger[_0x459c('0xd')](_0x459c('0xe'),_0x45b1b3,'request\x20sent',JSON['stringify'](_0x8afdd6));if(_0x8afdd6['error']){if(_0x8afdd6['error']['code']===0x1f4){logger[_0x459c('0xf')](_0x459c('0x10'),_0x45b1b3,_0x8afdd6[_0x459c('0xf')][_0x459c('0x11')]);return _0x5d2ce9(_0x8afdd6[_0x459c('0xf')][_0x459c('0x11')]);}logger[_0x459c('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x45b1b3,_0x8afdd6[_0x459c('0xf')][_0x459c('0x11')]);return _0x114334(_0x8afdd6[_0x459c('0xf')]['message']);}else{logger['info'](_0x459c('0x10'),_0x45b1b3,'request\x20sent');_0x114334(_0x8afdd6['result'][_0x459c('0x11')]);}})[_0x459c('0x12')](function(_0x12a2d4){logger[_0x459c('0xf')](_0x459c('0x10'),_0x45b1b3,_0x12a2d4);_0x5d2ce9(_0x12a2d4);});});} \ No newline at end of file +var _0xe3b5=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x4f8b44,_0x4eda31){var _0x45727b=function(_0x566b10){while(--_0x566b10){_0x4f8b44['push'](_0x4f8b44['shift']());}};_0x45727b(++_0x4eda31);}(_0xe3b5,0x1a6));var _0x5e3b=function(_0x258f9b,_0x219294){_0x258f9b=_0x258f9b-0x0;var _0xfe4c92=_0xe3b5[_0x258f9b];return _0xfe4c92;};'use strict';var _=require(_0x5e3b('0x0'));var util=require(_0x5e3b('0x1'));var moment=require(_0x5e3b('0x2'));var BPromise=require(_0x5e3b('0x3'));var rs=require(_0x5e3b('0x4'));var fs=require('fs');var Redis=require(_0x5e3b('0x5'));var db=require(_0x5e3b('0x6'))['db'];var utils=require(_0x5e3b('0x7'));var logger=require(_0x5e3b('0x8'))(_0x5e3b('0x9'));var config=require(_0x5e3b('0xa'));var jayson=require(_0x5e3b('0xb'));var client=jayson[_0x5e3b('0xc')][_0x5e3b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x271c7c,_0x49f766,_0x2ee8d9){return new BPromise(function(_0x57116d,_0x35271d){return client[_0x5e3b('0xe')](_0x271c7c,_0x2ee8d9)['then'](function(_0x5cc9cb){logger[_0x5e3b('0xf')](_0x5e3b('0x10'),_0x49f766,_0x5e3b('0x11'));logger[_0x5e3b('0x12')](_0x5e3b('0x13'),_0x49f766,_0x5e3b('0x11'),JSON[_0x5e3b('0x14')](_0x5cc9cb));if(_0x5cc9cb['error']){if(_0x5cc9cb[_0x5e3b('0x15')][_0x5e3b('0x16')]===0x1f4){logger[_0x5e3b('0x15')](_0x5e3b('0x10'),_0x49f766,_0x5cc9cb[_0x5e3b('0x15')][_0x5e3b('0x17')]);return _0x35271d(_0x5cc9cb['error'][_0x5e3b('0x17')]);}logger[_0x5e3b('0x15')]('ZohoConfiguration,\x20%s,\x20%s',_0x49f766,_0x5cc9cb[_0x5e3b('0x15')][_0x5e3b('0x17')]);return _0x57116d(_0x5cc9cb[_0x5e3b('0x15')][_0x5e3b('0x17')]);}else{logger[_0x5e3b('0xf')](_0x5e3b('0x10'),_0x49f766,_0x5e3b('0x11'));_0x57116d(_0x5cc9cb[_0x5e3b('0x18')][_0x5e3b('0x17')]);}})[_0x5e3b('0x19')](function(_0x1a9913){logger[_0x5e3b('0x15')](_0x5e3b('0x10'),_0x49f766,_0x1a9913);_0x35271d(_0x1a9913);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index ee22e83..fd29b87 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 _0x1ddc=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','util','path'];(function(_0x218414,_0x1925e9){var _0xc5a63=function(_0x5c1c94){while(--_0x5c1c94){_0x218414['push'](_0x218414['shift']());}};_0xc5a63(++_0x1925e9);}(_0x1ddc,0x91));var _0xc1dd=function(_0x27f87f,_0x276933){_0x27f87f=_0x27f87f-0x0;var _0x525ce4=_0x1ddc[_0x27f87f];return _0x525ce4;};'use strict';var multer=require('multer');var util=require(_0xc1dd('0x0'));var path=require(_0xc1dd('0x1'));var timeout=require(_0xc1dd('0x2'));var express=require(_0xc1dd('0x3'));var router=express[_0xc1dd('0x4')]();var fs_extra=require(_0xc1dd('0x5'));var auth=require(_0xc1dd('0x6'));var interaction=require(_0xc1dd('0x7'));var config=require(_0xc1dd('0x8'));var controller=require(_0xc1dd('0x9'));router[_0xc1dd('0xa')]('/',auth[_0xc1dd('0xb')](),controller[_0xc1dd('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc1dd('0xd')]);router[_0xc1dd('0xe')]('/',auth[_0xc1dd('0xb')](),controller[_0xc1dd('0xf')]);router[_0xc1dd('0x10')](_0xc1dd('0x11'),auth[_0xc1dd('0xb')](),controller[_0xc1dd('0x12')]);router['delete'](_0xc1dd('0x11'),auth[_0xc1dd('0xb')](),controller[_0xc1dd('0x13')]);module[_0xc1dd('0x14')]=router; \ No newline at end of file +var _0xa37c=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','post','create','update','delete','exports','multer'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xa37c,0x87));var _0xca37=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xa37c[_0x2a5099];return _0x2802f1;};'use strict';var multer=require(_0xca37('0x0'));var util=require(_0xca37('0x1'));var path=require('path');var timeout=require(_0xca37('0x2'));var express=require(_0xca37('0x3'));var router=express[_0xca37('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xca37('0x5'));var interaction=require(_0xca37('0x6'));var config=require('../../config/environment');var controller=require(_0xca37('0x7'));router[_0xca37('0x8')]('/',auth[_0xca37('0x9')](),controller[_0xca37('0xa')]);router[_0xca37('0x8')](_0xca37('0xb'),auth[_0xca37('0x9')](),controller['show']);router[_0xca37('0xc')]('/',auth[_0xca37('0x9')](),controller[_0xca37('0xd')]);router['put'](_0xca37('0xb'),auth[_0xca37('0x9')](),controller[_0xca37('0xe')]);router[_0xca37('0xf')](_0xca37('0xb'),auth[_0xca37('0x9')](),controller['destroy']);module[_0xca37('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 191c8f3..77a587b 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 _0x7dc4=['STRING','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x5e2eb5,_0x3f4e6c){var _0x180baf=function(_0x3e97d1){while(--_0x3e97d1){_0x5e2eb5['push'](_0x5e2eb5['shift']());}};_0x180baf(++_0x3f4e6c);}(_0x7dc4,0x1cf));var _0x47dc=function(_0x49524d,_0x5ae7a9){_0x49524d=_0x49524d-0x0;var _0x221976=_0x7dc4[_0x49524d];return _0x221976;};'use strict';var Sequelize=require('sequelize');module[_0x47dc('0x0')]={'type':{'type':Sequelize[_0x47dc('0x1')](_0x47dc('0x2'),_0x47dc('0x3'),_0x47dc('0x4'),'keyValue',_0x47dc('0x5')),'defaultValue':_0x47dc('0x2')},'content':{'type':Sequelize[_0x47dc('0x6')]},'key':{'type':Sequelize[_0x47dc('0x6')]},'keyType':{'type':Sequelize[_0x47dc('0x1')](_0x47dc('0x2'),_0x47dc('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x47dc('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x47dc('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x47dc('0x6')]}}; \ No newline at end of file +var _0xcd88=['customVariable','BOOLEAN','ENUM','string','keyValue','STRING','variable'];(function(_0x530be7,_0x309fbc){var _0x1deb90=function(_0x189ee4){while(--_0x189ee4){_0x530be7['push'](_0x530be7['shift']());}};_0x1deb90(++_0x309fbc);}(_0xcd88,0xd4));var _0x8cd8=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xcd88[_0x38ced4];return _0x547c07;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x8cd8('0x0')](_0x8cd8('0x1'),'variable','customVariable',_0x8cd8('0x2'),'picklist'),'defaultValue':_0x8cd8('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8cd8('0x3')]},'keyType':{'type':Sequelize[_0x8cd8('0x0')](_0x8cd8('0x1'),_0x8cd8('0x4'),_0x8cd8('0x5'))},'keyContent':{'type':Sequelize[_0x8cd8('0x3')]},'idField':{'type':Sequelize[_0x8cd8('0x3')]},'nameField':{'type':Sequelize[_0x8cd8('0x3')]},'customField':{'type':Sequelize[_0x8cd8('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 54cc5fd..aeba8c3 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 _0x058d=['lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','name','map','ZohoField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','then','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs'];(function(_0x36be81,_0x1f6cc4){var _0x10dcb1=function(_0x20e7f4){while(--_0x20e7f4){_0x36be81['push'](_0x36be81['shift']());}};_0x10dcb1(++_0x1f6cc4);}(_0x058d,0x111));var _0xd058=function(_0xeaa7bd,_0x29bee9){_0xeaa7bd=_0xeaa7bd-0x0;var _0x104347=_0x058d[_0xeaa7bd];return _0x104347;};'use strict';var emlformat=require(_0xd058('0x0'));var rimraf=require(_0xd058('0x1'));var zipdir=require(_0xd058('0x2'));var jsonpatch=require(_0xd058('0x3'));var rp=require(_0xd058('0x4'));var moment=require(_0xd058('0x5'));var BPromise=require(_0xd058('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd058('0x7'));var sox=require(_0xd058('0x8'));var csv=require(_0xd058('0x9'));var ejs=require(_0xd058('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd058('0xb'));var squel=require('squel');var crypto=require(_0xd058('0xc'));var jsforce=require(_0xd058('0xd'));var deskjs=require(_0xd058('0xe'));var toCsv=require(_0xd058('0x9'));var querystring=require(_0xd058('0xf'));var Papa=require(_0xd058('0x10'));var Redis=require('ioredis');var authService=require(_0xd058('0x11'));var qs=require(_0xd058('0x12'));var as=require(_0xd058('0x13'));var hardwareService=require(_0xd058('0x14'));var logger=require('../../config/logger')(_0xd058('0x15'));var utils=require('../../config/utils');var config=require(_0xd058('0x16'));var licenseUtil=require(_0xd058('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22a9b6,_0x1c8020){_0x1c8020=_0x1c8020||0xcc;return function(_0x56dab0){if(_0x56dab0){return _0x22a9b6[_0xd058('0x18')](_0x1c8020);}return _0x22a9b6[_0xd058('0x19')](_0x1c8020)[_0xd058('0x1a')]();};}function respondWithResult(_0x16f6af,_0x5db945){_0x5db945=_0x5db945||0xc8;return function(_0x18f06f){if(_0x18f06f){return _0x16f6af[_0xd058('0x19')](_0x5db945)[_0xd058('0x1b')](_0x18f06f);}};}function respondWithFilteredResult(_0x5a93f0,_0x59f356){return function(_0x28e9ca){if(_0x28e9ca){var _0x58658e=typeof _0x59f356[_0xd058('0x1c')]===_0xd058('0x1d')&&typeof _0x59f356[_0xd058('0x1e')]===_0xd058('0x1d');var _0x2a07ac=_0x28e9ca[_0xd058('0x1f')];var _0x1bfbfc=_0x58658e?0x0:_0x59f356[_0xd058('0x1c')];var _0x489f37=_0x58658e?_0x28e9ca['count']:_0x59f356[_0xd058('0x1c')]+_0x59f356[_0xd058('0x1e')];var _0x25ffc3;if(_0x489f37>=_0x2a07ac){_0x489f37=_0x2a07ac;_0x25ffc3=0xc8;}else{_0x25ffc3=0xce;}_0x5a93f0['status'](_0x25ffc3);return _0x5a93f0[_0xd058('0x20')](_0xd058('0x21'),_0x1bfbfc+'-'+_0x489f37+'/'+_0x2a07ac)[_0xd058('0x1b')](_0x28e9ca);}return null;};}function patchUpdates(_0x2c1e75){return function(_0x423640){try{jsonpatch[_0xd058('0x22')](_0x423640,_0x2c1e75,!![]);}catch(_0x16680d){return BPromise[_0xd058('0x23')](_0x16680d);}return _0x423640['save']();};}function saveUpdates(_0x550f50,_0x90d53f){return function(_0x1163d6){if(_0x1163d6){return _0x1163d6[_0xd058('0x24')](_0x550f50)['then'](function(_0x2e2a12){return _0x2e2a12;});}return null;};}function removeEntity(_0x5d0499,_0x7f6ce3){return function(_0x2a70a7){if(_0x2a70a7){return _0x2a70a7[_0xd058('0x25')]()['then'](function(){_0x5d0499[_0xd058('0x19')](0xcc)[_0xd058('0x1a')]();});}};}function handleEntityNotFound(_0x2616f8,_0xd808a0){return function(_0x3702ee){if(!_0x3702ee){_0x2616f8[_0xd058('0x18')](0x194);}return _0x3702ee;};}function handleError(_0x2ed94c,_0x178e1e){_0x178e1e=_0x178e1e||0x1f4;return function(_0x28097d){logger[_0xd058('0x26')](_0x28097d['stack']);if(_0x28097d[_0xd058('0x27')]){delete _0x28097d[_0xd058('0x27')];}_0x2ed94c[_0xd058('0x19')](_0x178e1e)['send'](_0x28097d);};}exports['index']=function(_0x903614,_0x4578a5){var _0x404c2b={},_0x21dab6={},_0xed5407={'count':0x0,'rows':[]};var _0x33f99e=_[_0xd058('0x28')](db[_0xd058('0x29')][_0xd058('0x2a')],function(_0x30bc1f){return{'name':_0x30bc1f[_0xd058('0x2b')],'type':_0x30bc1f[_0xd058('0x2c')][_0xd058('0x2d')]};});_0x21dab6[_0xd058('0x2e')]=_[_0xd058('0x28')](_0x33f99e,_0xd058('0x27'));_0x21dab6['query']=_[_0xd058('0x2f')](_0x903614[_0xd058('0x30')]);_0x21dab6[_0xd058('0x31')]=_[_0xd058('0x32')](_0x21dab6[_0xd058('0x2e')],_0x21dab6[_0xd058('0x30')]);_0x404c2b['attributes']=_['intersection'](_0x21dab6[_0xd058('0x2e')],qs[_0xd058('0x33')](_0x903614[_0xd058('0x30')]['fields']));_0x404c2b[_0xd058('0x34')]=_0x404c2b['attributes']['length']?_0x404c2b['attributes']:_0x21dab6[_0xd058('0x2e')];if(!_0x903614[_0xd058('0x30')][_0xd058('0x35')](_0xd058('0x36'))){_0x404c2b['limit']=qs['limit'](_0x903614[_0xd058('0x30')][_0xd058('0x1e')]);_0x404c2b[_0xd058('0x1c')]=qs[_0xd058('0x1c')](_0x903614['query'][_0xd058('0x1c')]);}_0x404c2b['order']=qs[_0xd058('0x37')](_0x903614[_0xd058('0x30')]['sort']);_0x404c2b[_0xd058('0x38')]=qs[_0xd058('0x31')](_['pick'](_0x903614[_0xd058('0x30')],_0x21dab6[_0xd058('0x31')]),_0x33f99e);if(_0x903614[_0xd058('0x30')][_0xd058('0x39')]){_0x404c2b[_0xd058('0x38')]=_[_0xd058('0x3a')](_0x404c2b['where'],{'$or':_[_0xd058('0x28')](_0x33f99e,function(_0x2f086f){if(_0x2f086f[_0xd058('0x2c')]!=='VIRTUAL'){var _0x24d0cf={};_0x24d0cf[_0x2f086f[_0xd058('0x27')]]={'$like':'%'+_0x903614[_0xd058('0x30')][_0xd058('0x39')]+'%'};return _0x24d0cf;}})});}_0x404c2b=_[_0xd058('0x3a')]({},_0x404c2b,_0x903614[_0xd058('0x3b')]);var _0x30ad65={'where':_0x404c2b[_0xd058('0x38')]};return db['ZohoField'][_0xd058('0x1f')](_0x30ad65)['then'](function(_0x2e1cd5){_0xed5407['count']=_0x2e1cd5;if(_0x903614[_0xd058('0x30')][_0xd058('0x3c')]){_0x404c2b[_0xd058('0x3d')]=[{'all':!![]}];}return db[_0xd058('0x29')][_0xd058('0x3e')](_0x404c2b);})['then'](function(_0x19c661){_0xed5407[_0xd058('0x3f')]=_0x19c661;return _0xed5407;})[_0xd058('0x40')](respondWithFilteredResult(_0x4578a5,_0x404c2b))[_0xd058('0x41')](handleError(_0x4578a5,null));};exports[_0xd058('0x42')]=function(_0x28554c,_0x49118f){var _0x107589={'raw':!![],'where':{'id':_0x28554c['params']['id']}},_0x5b082a={};_0x5b082a['model']=_[_0xd058('0x2f')](db[_0xd058('0x29')]['rawAttributes']);_0x5b082a[_0xd058('0x30')]=_[_0xd058('0x2f')](_0x28554c[_0xd058('0x30')]);_0x5b082a['filters']=_['intersection'](_0x5b082a[_0xd058('0x2e')],_0x5b082a['query']);_0x107589[_0xd058('0x34')]=_[_0xd058('0x32')](_0x5b082a[_0xd058('0x2e')],qs['fields'](_0x28554c[_0xd058('0x30')][_0xd058('0x33')]));_0x107589[_0xd058('0x34')]=_0x107589[_0xd058('0x34')]['length']?_0x107589[_0xd058('0x34')]:_0x5b082a[_0xd058('0x2e')];if(_0x28554c['query'][_0xd058('0x3c')]){_0x107589[_0xd058('0x3d')]=[{'all':!![]}];}_0x107589=_[_0xd058('0x3a')]({},_0x107589,_0x28554c[_0xd058('0x3b')]);return db[_0xd058('0x29')][_0xd058('0x43')](_0x107589)[_0xd058('0x40')](handleEntityNotFound(_0x49118f,null))[_0xd058('0x40')](respondWithResult(_0x49118f,null))[_0xd058('0x41')](handleError(_0x49118f,null));};exports[_0xd058('0x44')]=function(_0x367f0f,_0xc5c86){return db[_0xd058('0x29')]['create'](_0x367f0f[_0xd058('0x45')],{})[_0xd058('0x40')](respondWithResult(_0xc5c86,0xc9))[_0xd058('0x41')](handleError(_0xc5c86,null));};exports[_0xd058('0x24')]=function(_0x20babe,_0x4be4b9){if(_0x20babe['body']['id']){delete _0x20babe[_0xd058('0x45')]['id'];}return db['ZohoField'][_0xd058('0x43')]({'where':{'id':_0x20babe['params']['id']}})['then'](handleEntityNotFound(_0x4be4b9,null))[_0xd058('0x40')](saveUpdates(_0x20babe[_0xd058('0x45')],null))[_0xd058('0x40')](respondWithResult(_0x4be4b9,null))[_0xd058('0x41')](handleError(_0x4be4b9,null));};exports['destroy']=function(_0xb999be,_0x23cf8e){return db[_0xd058('0x29')][_0xd058('0x43')]({'where':{'id':_0xb999be[_0xd058('0x46')]['id']}})[_0xd058('0x40')](handleEntityNotFound(_0x23cf8e,null))[_0xd058('0x40')](removeEntity(_0x23cf8e,null))[_0xd058('0x41')](handleError(_0x23cf8e,null));}; \ No newline at end of file +var _0x72d7=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','save','update','then','destroy','error','stack','name','send','map','ZohoField','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','includeAll','include','rows','params','rawAttributes','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x72d7,0x19b));var _0x772d=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x72d7[_0xe66cf2];return _0x2d84e7;};'use strict';var emlformat=require(_0x772d('0x0'));var rimraf=require(_0x772d('0x1'));var zipdir=require(_0x772d('0x2'));var jsonpatch=require(_0x772d('0x3'));var rp=require(_0x772d('0x4'));var moment=require(_0x772d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x772d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x772d('0x7'));var csv=require(_0x772d('0x8'));var ejs=require(_0x772d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x772d('0xa'));var squel=require(_0x772d('0xb'));var crypto=require(_0x772d('0xc'));var jsforce=require(_0x772d('0xd'));var deskjs=require(_0x772d('0xe'));var toCsv=require(_0x772d('0x8'));var querystring=require(_0x772d('0xf'));var Papa=require('papaparse');var Redis=require(_0x772d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x772d('0x11'));var logger=require(_0x772d('0x12'))(_0x772d('0x13'));var utils=require(_0x772d('0x14'));var config=require(_0x772d('0x15'));var licenseUtil=require(_0x772d('0x16'));var db=require(_0x772d('0x17'))['db'];function respondWithStatusCode(_0x3a2939,_0x4a0865){_0x4a0865=_0x4a0865||0xcc;return function(_0x342bad){if(_0x342bad){return _0x3a2939[_0x772d('0x18')](_0x4a0865);}return _0x3a2939[_0x772d('0x19')](_0x4a0865)[_0x772d('0x1a')]();};}function respondWithResult(_0x3719b3,_0x489c48){_0x489c48=_0x489c48||0xc8;return function(_0x38fbed){if(_0x38fbed){return _0x3719b3['status'](_0x489c48)['json'](_0x38fbed);}};}function respondWithFilteredResult(_0x1325bc,_0x3fc786){return function(_0x54457d){if(_0x54457d){var _0x5880f0=typeof _0x3fc786[_0x772d('0x1b')]===_0x772d('0x1c')&&typeof _0x3fc786['limit']===_0x772d('0x1c');var _0x281577=_0x54457d[_0x772d('0x1d')];var _0x485b75=_0x5880f0?0x0:_0x3fc786[_0x772d('0x1b')];var _0x36055f=_0x5880f0?_0x54457d[_0x772d('0x1d')]:_0x3fc786[_0x772d('0x1b')]+_0x3fc786['limit'];var _0x545fee;if(_0x36055f>=_0x281577){_0x36055f=_0x281577;_0x545fee=0xc8;}else{_0x545fee=0xce;}_0x1325bc[_0x772d('0x19')](_0x545fee);return _0x1325bc[_0x772d('0x1e')](_0x772d('0x1f'),_0x485b75+'-'+_0x36055f+'/'+_0x281577)[_0x772d('0x20')](_0x54457d);}return null;};}function patchUpdates(_0x3e8ece){return function(_0x491b22){try{jsonpatch['apply'](_0x491b22,_0x3e8ece,!![]);}catch(_0x43cd58){return BPromise['reject'](_0x43cd58);}return _0x491b22[_0x772d('0x21')]();};}function saveUpdates(_0x54c0ac,_0x56dd11){return function(_0x2a423e){if(_0x2a423e){return _0x2a423e[_0x772d('0x22')](_0x54c0ac)[_0x772d('0x23')](function(_0x5777cd){return _0x5777cd;});}return null;};}function removeEntity(_0xb9dca4,_0x356c6d){return function(_0x28f4a0){if(_0x28f4a0){return _0x28f4a0[_0x772d('0x24')]()[_0x772d('0x23')](function(){_0xb9dca4[_0x772d('0x19')](0xcc)[_0x772d('0x1a')]();});}};}function handleEntityNotFound(_0x2f4587,_0x530c3c){return function(_0x34b647){if(!_0x34b647){_0x2f4587[_0x772d('0x18')](0x194);}return _0x34b647;};}function handleError(_0x51cbd6,_0x2aab30){_0x2aab30=_0x2aab30||0x1f4;return function(_0x186d8e){logger[_0x772d('0x25')](_0x186d8e[_0x772d('0x26')]);if(_0x186d8e['name']){delete _0x186d8e[_0x772d('0x27')];}_0x51cbd6[_0x772d('0x19')](_0x2aab30)[_0x772d('0x28')](_0x186d8e);};}exports['index']=function(_0x59a04b,_0x1fd695){var _0x1ded63={},_0x1cb0e3={},_0x2c1537={'count':0x0,'rows':[]};var _0x3f2926=_[_0x772d('0x29')](db[_0x772d('0x2a')]['rawAttributes'],function(_0x15177c){return{'name':_0x15177c['fieldName'],'type':_0x15177c[_0x772d('0x2b')][_0x772d('0x2c')]};});_0x1cb0e3[_0x772d('0x2d')]=_[_0x772d('0x29')](_0x3f2926,_0x772d('0x27'));_0x1cb0e3[_0x772d('0x2e')]=_[_0x772d('0x2f')](_0x59a04b[_0x772d('0x2e')]);_0x1cb0e3[_0x772d('0x30')]=_[_0x772d('0x31')](_0x1cb0e3[_0x772d('0x2d')],_0x1cb0e3['query']);_0x1ded63[_0x772d('0x32')]=_['intersection'](_0x1cb0e3[_0x772d('0x2d')],qs[_0x772d('0x33')](_0x59a04b[_0x772d('0x2e')][_0x772d('0x33')]));_0x1ded63[_0x772d('0x32')]=_0x1ded63['attributes'][_0x772d('0x34')]?_0x1ded63['attributes']:_0x1cb0e3['model'];if(!_0x59a04b[_0x772d('0x2e')][_0x772d('0x35')](_0x772d('0x36'))){_0x1ded63['limit']=qs['limit'](_0x59a04b[_0x772d('0x2e')][_0x772d('0x37')]);_0x1ded63[_0x772d('0x1b')]=qs[_0x772d('0x1b')](_0x59a04b[_0x772d('0x2e')][_0x772d('0x1b')]);}_0x1ded63[_0x772d('0x38')]=qs[_0x772d('0x39')](_0x59a04b[_0x772d('0x2e')][_0x772d('0x39')]);_0x1ded63[_0x772d('0x3a')]=qs[_0x772d('0x30')](_[_0x772d('0x3b')](_0x59a04b[_0x772d('0x2e')],_0x1cb0e3['filters']),_0x3f2926);if(_0x59a04b['query'][_0x772d('0x3c')]){_0x1ded63['where']=_[_0x772d('0x3d')](_0x1ded63[_0x772d('0x3a')],{'$or':_['map'](_0x3f2926,function(_0x1d2ab0){if(_0x1d2ab0[_0x772d('0x2b')]!=='VIRTUAL'){var _0x3a0f97={};_0x3a0f97[_0x1d2ab0[_0x772d('0x27')]]={'$like':'%'+_0x59a04b[_0x772d('0x2e')][_0x772d('0x3c')]+'%'};return _0x3a0f97;}})});}_0x1ded63=_[_0x772d('0x3d')]({},_0x1ded63,_0x59a04b['options']);var _0x5ab75c={'where':_0x1ded63[_0x772d('0x3a')]};return db[_0x772d('0x2a')][_0x772d('0x1d')](_0x5ab75c)['then'](function(_0x5a29f6){_0x2c1537[_0x772d('0x1d')]=_0x5a29f6;if(_0x59a04b[_0x772d('0x2e')][_0x772d('0x3e')]){_0x1ded63[_0x772d('0x3f')]=[{'all':!![]}];}return db[_0x772d('0x2a')]['findAll'](_0x1ded63);})[_0x772d('0x23')](function(_0x21a881){_0x2c1537[_0x772d('0x40')]=_0x21a881;return _0x2c1537;})[_0x772d('0x23')](respondWithFilteredResult(_0x1fd695,_0x1ded63))['catch'](handleError(_0x1fd695,null));};exports['show']=function(_0x4a81a4,_0x8586ff){var _0xeea979={'raw':!![],'where':{'id':_0x4a81a4[_0x772d('0x41')]['id']}},_0x113b4a={};_0x113b4a[_0x772d('0x2d')]=_[_0x772d('0x2f')](db['ZohoField'][_0x772d('0x42')]);_0x113b4a[_0x772d('0x2e')]=_[_0x772d('0x2f')](_0x4a81a4[_0x772d('0x2e')]);_0x113b4a[_0x772d('0x30')]=_[_0x772d('0x31')](_0x113b4a[_0x772d('0x2d')],_0x113b4a[_0x772d('0x2e')]);_0xeea979[_0x772d('0x32')]=_[_0x772d('0x31')](_0x113b4a[_0x772d('0x2d')],qs['fields'](_0x4a81a4[_0x772d('0x2e')][_0x772d('0x33')]));_0xeea979[_0x772d('0x32')]=_0xeea979[_0x772d('0x32')]['length']?_0xeea979[_0x772d('0x32')]:_0x113b4a[_0x772d('0x2d')];if(_0x4a81a4[_0x772d('0x2e')][_0x772d('0x3e')]){_0xeea979[_0x772d('0x3f')]=[{'all':!![]}];}_0xeea979=_['merge']({},_0xeea979,_0x4a81a4[_0x772d('0x43')]);return db[_0x772d('0x2a')][_0x772d('0x44')](_0xeea979)[_0x772d('0x23')](handleEntityNotFound(_0x8586ff,null))[_0x772d('0x23')](respondWithResult(_0x8586ff,null))[_0x772d('0x45')](handleError(_0x8586ff,null));};exports[_0x772d('0x46')]=function(_0x26a7c5,_0xc79524){return db[_0x772d('0x2a')][_0x772d('0x46')](_0x26a7c5[_0x772d('0x47')],{})[_0x772d('0x23')](respondWithResult(_0xc79524,0xc9))[_0x772d('0x45')](handleError(_0xc79524,null));};exports['update']=function(_0xa82965,_0x40b667){if(_0xa82965['body']['id']){delete _0xa82965[_0x772d('0x47')]['id'];}return db[_0x772d('0x2a')][_0x772d('0x44')]({'where':{'id':_0xa82965[_0x772d('0x41')]['id']}})[_0x772d('0x23')](handleEntityNotFound(_0x40b667,null))['then'](saveUpdates(_0xa82965[_0x772d('0x47')],null))[_0x772d('0x23')](respondWithResult(_0x40b667,null))['catch'](handleError(_0x40b667,null));};exports[_0x772d('0x24')]=function(_0x18b0f1,_0x12af39){return db[_0x772d('0x2a')]['find']({'where':{'id':_0x18b0f1[_0x772d('0x41')]['id']}})[_0x772d('0x23')](handleEntityNotFound(_0x12af39,null))[_0x772d('0x23')](removeEntity(_0x12af39,null))['catch'](handleError(_0x12af39,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 720ff3f..092bf8f 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 _0x5204=['util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash'];(function(_0x343dfb,_0xed8587){var _0x297fe2=function(_0x19cbbd){while(--_0x19cbbd){_0x343dfb['push'](_0x343dfb['shift']());}};_0x297fe2(++_0xed8587);}(_0x5204,0xdf));var _0x4520=function(_0x4f4d19,_0x574245){_0x4f4d19=_0x4f4d19-0x0;var _0x27a258=_0x5204[_0x4f4d19];return _0x27a258;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var logger=require('../../config/logger')(_0x4520('0x2'));var moment=require(_0x4520('0x3'));var BPromise=require(_0x4520('0x4'));var rp=require(_0x4520('0x5'));var fs=require('fs');var path=require(_0x4520('0x6'));var rimraf=require('rimraf');var config=require(_0x4520('0x7'));var attributes=require('./intZohoField.attributes');module[_0x4520('0x8')]=function(_0x209381,_0xe0a256){return _0x209381[_0x4520('0x9')](_0x4520('0xa'),attributes,{'tableName':_0x4520('0xb'),'paranoid':![],'indexes':[{'name':_0x4520('0xc'),'fields':['idField',_0x4520('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x430c=['api','moment','bluebird','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash'];(function(_0x2c7b27,_0x2c6abe){var _0x12c26f=function(_0x13e6ee){while(--_0x13e6ee){_0x2c7b27['push'](_0x2c7b27['shift']());}};_0x12c26f(++_0x2c6abe);}(_0x430c,0x1a1));var _0xc430=function(_0x190ff6,_0x515cfd){_0x190ff6=_0x190ff6-0x0;var _0x5356d2=_0x430c[_0x190ff6];return _0x5356d2;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc430('0x1'));var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('0x3'));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(_0xc430('0x4'));module[_0xc430('0x5')]=function(_0x50b256,_0x42aa9c){return _0x50b256['define'](_0xc430('0x6'),attributes,{'tableName':_0xc430('0x7'),'paranoid':![],'indexes':[{'name':_0xc430('0x8'),'fields':[_0xc430('0x9'),_0xc430('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index ba6f665..efa22fc 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 _0xd407=['info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xd407,0x196));var _0x7d40=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd407[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7d40('0x0'));var util=require(_0x7d40('0x1'));var moment=require('moment');var BPromise=require(_0x7d40('0x2'));var rs=require(_0x7d40('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d40('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7d40('0x5'));var config=require(_0x7d40('0x6'));var jayson=require(_0x7d40('0x7'));var client=jayson[_0x7d40('0x8')][_0x7d40('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c7d71,_0x482368,_0x127d88){return new BPromise(function(_0x533a7b,_0x4ea095){return client[_0x7d40('0xa')](_0x5c7d71,_0x127d88)[_0x7d40('0xb')](function(_0x5424fa){logger[_0x7d40('0xc')](_0x7d40('0xd'),_0x482368,_0x7d40('0xe'));logger[_0x7d40('0xf')](_0x7d40('0x10'),_0x482368,_0x7d40('0xe'),JSON['stringify'](_0x5424fa));if(_0x5424fa['error']){if(_0x5424fa[_0x7d40('0x11')][_0x7d40('0x12')]===0x1f4){logger[_0x7d40('0x11')](_0x7d40('0xd'),_0x482368,_0x5424fa[_0x7d40('0x11')][_0x7d40('0x13')]);return _0x4ea095(_0x5424fa[_0x7d40('0x11')][_0x7d40('0x13')]);}logger[_0x7d40('0x11')](_0x7d40('0xd'),_0x482368,_0x5424fa[_0x7d40('0x11')][_0x7d40('0x13')]);return _0x533a7b(_0x5424fa['error'][_0x7d40('0x13')]);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x482368,_0x7d40('0xe'));_0x533a7b(_0x5424fa[_0x7d40('0x14')]['message']);}})[_0x7d40('0x15')](function(_0x53af31){logger[_0x7d40('0x11')]('ZohoField,\x20%s,\x20%s',_0x482368,_0x53af31);_0x4ea095(_0x53af31);});});} \ No newline at end of file +var _0xa9e7=['request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2eb02d,_0x42fda6){var _0x4675d1=function(_0x2965e3){while(--_0x2965e3){_0x2eb02d['push'](_0x2eb02d['shift']());}};_0x4675d1(++_0x42fda6);}(_0xa9e7,0x19b));var _0x7a9e=function(_0x5a5c6b,_0x5baa12){_0x5a5c6b=_0x5a5c6b-0x0;var _0x5e24fc=_0xa9e7[_0x5a5c6b];return _0x5e24fc;};'use strict';var _=require(_0x7a9e('0x0'));var util=require(_0x7a9e('0x1'));var moment=require(_0x7a9e('0x2'));var BPromise=require(_0x7a9e('0x3'));var rs=require(_0x7a9e('0x4'));var fs=require('fs');var Redis=require(_0x7a9e('0x5'));var db=require(_0x7a9e('0x6'))['db'];var utils=require(_0x7a9e('0x7'));var logger=require(_0x7a9e('0x8'))(_0x7a9e('0x9'));var config=require(_0x7a9e('0xa'));var jayson=require(_0x7a9e('0xb'));var client=jayson[_0x7a9e('0xc')][_0x7a9e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x152f68,_0xd1ba95,_0x16968e){return new BPromise(function(_0xcf2b8d,_0x4b6d63){return client[_0x7a9e('0xe')](_0x152f68,_0x16968e)[_0x7a9e('0xf')](function(_0x1e9726){logger['info'](_0x7a9e('0x10'),_0xd1ba95,_0x7a9e('0x11'));logger[_0x7a9e('0x12')](_0x7a9e('0x13'),_0xd1ba95,'request\x20sent',JSON['stringify'](_0x1e9726));if(_0x1e9726[_0x7a9e('0x14')]){if(_0x1e9726['error'][_0x7a9e('0x15')]===0x1f4){logger[_0x7a9e('0x14')]('ZohoField,\x20%s,\x20%s',_0xd1ba95,_0x1e9726[_0x7a9e('0x14')][_0x7a9e('0x16')]);return _0x4b6d63(_0x1e9726[_0x7a9e('0x14')][_0x7a9e('0x16')]);}logger['error'](_0x7a9e('0x10'),_0xd1ba95,_0x1e9726[_0x7a9e('0x14')]['message']);return _0xcf2b8d(_0x1e9726['error'][_0x7a9e('0x16')]);}else{logger['info'](_0x7a9e('0x10'),_0xd1ba95,_0x7a9e('0x11'));_0xcf2b8d(_0x1e9726[_0x7a9e('0x17')]['message']);}})[_0x7a9e('0x18')](function(_0x24683b){logger[_0x7a9e('0x14')](_0x7a9e('0x10'),_0xd1ba95,_0x24683b);_0x4b6d63(_0x24683b);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 64242c5..facc6f3 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x21bb2f,_0x4199b9){var _0x279b0e=function(_0x4014b5){while(--_0x4014b5){_0x21bb2f['push'](_0x21bb2f['shift']());}};_0x279b0e(++_0x4199b9);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4595cd,_0x379662){var _0x38e3c4=function(_0x102d93){while(--_0x102d93){_0x4595cd['push'](_0x4595cd['shift']());}};_0x38e3c4(++_0x379662);}(_0xe706,0xa3));var _0x6e70=function(_0x2107a6,_0xe8360d){_0x2107a6=_0x2107a6-0x0;var _0x2f09ef=_0xe706[_0x2107a6];return _0x2f09ef;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index aa48b7c..3373062 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 _0xe5ae=['state','sequelize','exports','STRING','unique_name_and_version','app.js','BOOLEAN'];(function(_0x264b61,_0x4a5017){var _0x8fff4f=function(_0x25c21e){while(--_0x25c21e){_0x264b61['push'](_0x264b61['shift']());}};_0x8fff4f(++_0x4a5017);}(_0xe5ae,0x120));var _0xee5a=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0xe5ae[_0x2e2681];return _0x368a64;};'use strict';var Sequelize=require(_0xee5a('0x0'));module[_0xee5a('0x1')]={'name':{'type':Sequelize[_0xee5a('0x2')],'allowNull':![],'unique':_0xee5a('0x3')},'version':{'type':Sequelize[_0xee5a('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xee5a('0x2')],'defaultValue':_0xee5a('0x4')},'filename':{'type':Sequelize[_0xee5a('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xee5a('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xee5a('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xee5a('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xee5a('0x2')],'unique':_0xee5a('0x6')},'description':{'type':Sequelize[_0xee5a('0x2')]},'title':{'type':Sequelize[_0xee5a('0x2')]},'remoteUri':{'type':Sequelize[_0xee5a('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x759c=['BOOLEAN','state','exports','STRING','unique_name_and_version','INTEGER'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0x759c,0x1e2));var _0xc759=function(_0x228c56,_0x2d8828){_0x228c56=_0x228c56-0x0;var _0x36f685=_0x759c[_0x228c56];return _0x36f685;};'use strict';var Sequelize=require('sequelize');module[_0xc759('0x0')]={'name':{'type':Sequelize[_0xc759('0x1')],'allowNull':![],'unique':_0xc759('0x2')},'version':{'type':Sequelize[_0xc759('0x1')],'allowNull':![],'unique':_0xc759('0x2')},'main':{'type':Sequelize[_0xc759('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xc759('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc759('0x1')]},'size':{'type':Sequelize[_0xc759('0x3')]},'active':{'type':Sequelize[_0xc759('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xc759('0x1')]},'logo':{'type':Sequelize[_0xc759('0x1')]},'state':{'type':Sequelize[_0xc759('0x1')],'unique':_0xc759('0x5')},'description':{'type':Sequelize[_0xc759('0x1')]},'title':{'type':Sequelize[_0xc759('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xc759('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 6d6c7e8..ec05adf 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 _0x4137=['map','Integration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index'];(function(_0x2e6f8f,_0x8dcf21){var _0x287b8e=function(_0x548f1d){while(--_0x548f1d){_0x2e6f8f['push'](_0x2e6f8f['shift']());}};_0x287b8e(++_0x8dcf21);}(_0x4137,0xf8));var _0x7413=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4137[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['Integration'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['Integration']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));}; \ No newline at end of file +var _0x6343=['hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','Integration','then','rows','catch','show','params','keys','includeAll','include','create','body','find','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'];(function(_0xc85d76,_0x48ea83){var _0x1a363f=function(_0x1c7f75){while(--_0x1c7f75){_0xc85d76['push'](_0xc85d76['shift']());}};_0x1a363f(++_0x48ea83);}(_0x6343,0x168));var _0x3634=function(_0x2a8acc,_0x1f2320){_0x2a8acc=_0x2a8acc-0x0;var _0x1cd84d=_0x6343[_0x2a8acc];return _0x1cd84d;};'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['Integration'][_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));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index bd66bb5..fcb4a9c 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 _0xb553=['integrations','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./integration.attributes','exports','Integration'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xb553,0xf1));var _0x3b55=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xb553[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x3b55('0x0'));var util=require('util');var logger=require(_0x3b55('0x1'))('api');var moment=require(_0x3b55('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b55('0x3'));var rimraf=require(_0x3b55('0x4'));var config=require(_0x3b55('0x5'));var attributes=require(_0x3b55('0x6'));module[_0x3b55('0x7')]=function(_0xa92788,_0x41318a){return _0xa92788['define'](_0x3b55('0x8'),attributes,{'tableName':_0x3b55('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc763=['bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','integrations','lodash','util','moment'];(function(_0x43cc9e,_0x32e608){var _0x57eb4e=function(_0x28519d){while(--_0x28519d){_0x43cc9e['push'](_0x43cc9e['shift']());}};_0x57eb4e(++_0x32e608);}(_0xc763,0x11d));var _0x3c76=function(_0x2ee985,_0x2b9405){_0x2ee985=_0x2ee985-0x0;var _0xb6d656=_0xc763[_0x2ee985];return _0xb6d656;};'use strict';var _=require(_0x3c76('0x0'));var util=require(_0x3c76('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3c76('0x2'));var BPromise=require(_0x3c76('0x3'));var rp=require(_0x3c76('0x4'));var fs=require('fs');var path=require(_0x3c76('0x5'));var rimraf=require(_0x3c76('0x6'));var config=require(_0x3c76('0x7'));var attributes=require(_0x3c76('0x8'));module[_0x3c76('0x9')]=function(_0x3ef12c,_0x33b5f2){return _0x3ef12c[_0x3c76('0xa')]('Integration',attributes,{'tableName':_0x3c76('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 76bf692..a5895eb 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 _0x955f=['Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info'];(function(_0x4330f6,_0x4ebc4a){var _0x54a02a=function(_0x477f44){while(--_0x477f44){_0x4330f6['push'](_0x4330f6['shift']());}};_0x54a02a(++_0x4ebc4a);}(_0x955f,0x1eb));var _0xf955=function(_0x1321b0,_0x15076d){_0x1321b0=_0x1321b0-0x0;var _0x15855d=_0x955f[_0x1321b0];return _0x15855d;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d5b3,_0x18432f,_0x20c096){return new BPromise(function(_0x4f58fb,_0x254b38){return client[_0xf955('0xa')](_0x59d5b3,_0x20c096)[_0xf955('0xb')](function(_0x38b190){logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,_0xf955('0xe'));logger['debug'](_0xf955('0xf'),_0x18432f,'request\x20sent',JSON[_0xf955('0x10')](_0x38b190));if(_0x38b190[_0xf955('0x11')]){if(_0x38b190[_0xf955('0x11')]['code']===0x1f4){logger[_0xf955('0x11')]('Integration,\x20%s,\x20%s',_0x18432f,_0x38b190[_0xf955('0x11')]['message']);return _0x254b38(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);return _0x4f58fb(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}else{logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,'request\x20sent');_0x4f58fb(_0x38b190[_0xf955('0x13')]['message']);}})[_0xf955('0x14')](function(_0x3a814f){logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x3a814f);_0x254b38(_0x3a814f);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x20c12a,_0x2585e5){var _0x1f7791=function(_0x55a79e){while(--_0x55a79e){_0x20c12a['push'](_0x20c12a['shift']());}};_0x1f7791(++_0x2585e5);}(_0x2ef3,0xba));var _0x32ef=function(_0xd0f39c,_0xd143bb){_0xd0f39c=_0xd0f39c-0x0;var _0x105635=_0x2ef3[_0xd0f39c];return _0x105635;};'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')]('Integration,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('Integration,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 0880c5e..96b1e10 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xdb28,0x106));var _0x8db2=function(_0x196587,_0x8d8815){_0x196587=_0x196587-0x0;var _0x291496=_0xdb28[_0x196587];return _0x291496;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./integrationReport.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('0x13')]=router; \ No newline at end of file +var _0xef0f=['update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x2d9ad3,_0x3aba45){var _0x1b1a8b=function(_0xbd849b){while(--_0xbd849b){_0x2d9ad3['push'](_0x2d9ad3['shift']());}};_0x1b1a8b(++_0x3aba45);}(_0xef0f,0x168));var _0xfef0=function(_0x11e6a5,_0x3d3855){_0x11e6a5=_0x11e6a5-0x0;var _0x341df5=_0xef0f[_0x11e6a5];return _0x341df5;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x11')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x13')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 5e44ab6..5260d51 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 _0xcf90=['SENT','SENDING','FAILED','sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM'];(function(_0x35bdfb,_0x2d11f3){var _0xda60ca=function(_0x56fb55){while(--_0x56fb55){_0x35bdfb['push'](_0x35bdfb['shift']());}};_0xda60ca(++_0x2d11f3);}(_0xcf90,0xd5));var _0x0cf9=function(_0x4cd2bf,_0x36b00a){_0x4cd2bf=_0x4cd2bf-0x0;var _0xe16efe=_0xcf90[_0x4cd2bf];return _0xe16efe;};'use strict';var Sequelize=require(_0x0cf9('0x0'));module['exports']={'integration':{'type':Sequelize[_0x0cf9('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x0cf9('0x1')]},'integrationId':{'type':Sequelize[_0x0cf9('0x2')]},'contacts':{'type':Sequelize[_0x0cf9('0x1')]},'uniqueid':{'type':Sequelize[_0x0cf9('0x1')]},'calleridnum':{'type':Sequelize[_0x0cf9('0x1')]},'calleridname':{'type':Sequelize[_0x0cf9('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x0cf9('0x1')]},'membername':{'type':Sequelize[_0x0cf9('0x1')]},'agentcalledAt':{'type':Sequelize[_0x0cf9('0x3')]},'agentconnectAt':{'type':Sequelize[_0x0cf9('0x3')]},'holdtime':{'type':Sequelize[_0x0cf9('0x2')]},'agentcomplete':{'type':Sequelize[_0x0cf9('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x0cf9('0x3')]},'talktime':{'type':Sequelize[_0x0cf9('0x2')]},'agentacw':{'type':Sequelize[_0x0cf9('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x0cf9('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x0cf9('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x0cf9('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x0cf9('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0cf9('0x1')]},'connectedlinename':{'type':Sequelize[_0x0cf9('0x1')]},'language':{'type':Sequelize[_0x0cf9('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0cf9('0x1')]},'exten':{'type':Sequelize[_0x0cf9('0x1')]},'priority':{'type':Sequelize[_0x0cf9('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x0cf9('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x0cf9('0x1')]},'destcalleridnum':{'type':Sequelize[_0x0cf9('0x1')]},'destcalleridname':{'type':Sequelize[_0x0cf9('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x0cf9('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x0cf9('0x1')]},'destlanguage':{'type':Sequelize[_0x0cf9('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x0cf9('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x0cf9('0x1')]},'messageId':{'type':Sequelize[_0x0cf9('0x1')]},'inReplyTo':{'type':Sequelize[_0x0cf9('0x1')]},'subject':{'type':Sequelize[_0x0cf9('0x1')]},'from':{'type':Sequelize[_0x0cf9('0x1')]},'to':{'type':Sequelize[_0x0cf9('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x0cf9('0x5')]},'text':{'type':Sequelize[_0x0cf9('0x5')]},'status':{'type':Sequelize[_0x0cf9('0x6')](_0x0cf9('0x7'),_0x0cf9('0x8'),'RECEIVED',_0x0cf9('0x9'))},'url':{'type':Sequelize[_0x0cf9('0x1')]},'app':{'type':Sequelize[_0x0cf9('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x0cf9('0x2')]}}; \ No newline at end of file +var _0xdf8c=['SENT','RECEIVED','FAILED','sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x504dee,_0x3cefd3){var _0x3fb6c0=function(_0x188524){while(--_0x188524){_0x504dee['push'](_0x504dee['shift']());}};_0x3fb6c0(++_0x3cefd3);}(_0xdf8c,0x9c));var _0xcdf8=function(_0x68edb8,_0x578f50){_0x68edb8=_0x68edb8-0x0;var _0x14eb12=_0xdf8c[_0x68edb8];return _0x14eb12;};'use strict';var Sequelize=require(_0xcdf8('0x0'));module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xcdf8('0x1')]},'exitStatus':{'type':Sequelize[_0xcdf8('0x1')]},'ticketId':{'type':Sequelize[_0xcdf8('0x1')]},'integrationId':{'type':Sequelize[_0xcdf8('0x2')]},'contacts':{'type':Sequelize[_0xcdf8('0x1')]},'uniqueid':{'type':Sequelize[_0xcdf8('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xcdf8('0x1')]},'interface':{'type':Sequelize[_0xcdf8('0x1')]},'membername':{'type':Sequelize[_0xcdf8('0x1')]},'agentcalledAt':{'type':Sequelize[_0xcdf8('0x3')]},'agentconnectAt':{'type':Sequelize[_0xcdf8('0x3')]},'holdtime':{'type':Sequelize[_0xcdf8('0x2')]},'agentcomplete':{'type':Sequelize[_0xcdf8('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xcdf8('0x3')]},'talktime':{'type':Sequelize[_0xcdf8('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xcdf8('0x3')]},'agentdump':{'type':Sequelize[_0xcdf8('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xcdf8('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xcdf8('0x2')]},'channelstatedesc':{'type':Sequelize[_0xcdf8('0x1')]},'connectedlinenum':{'type':Sequelize[_0xcdf8('0x1')]},'connectedlinename':{'type':Sequelize[_0xcdf8('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xcdf8('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xcdf8('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xcdf8('0x1')]},'destcalleridname':{'type':Sequelize[_0xcdf8('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xcdf8('0x1')]},'destlanguage':{'type':Sequelize[_0xcdf8('0x1')]},'destaccountcode':{'type':Sequelize[_0xcdf8('0x1')]},'destcontext':{'type':Sequelize[_0xcdf8('0x1')]},'destexten':{'type':Sequelize[_0xcdf8('0x1')]},'destpriority':{'type':Sequelize[_0xcdf8('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xcdf8('0x1')]},'inReplyTo':{'type':Sequelize[_0xcdf8('0x1')]},'subject':{'type':Sequelize[_0xcdf8('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xcdf8('0x1')]},'cc':{'type':Sequelize[_0xcdf8('0x1')]},'attachment':{'type':Sequelize[_0xcdf8('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xcdf8('0x5')]},'status':{'type':Sequelize['ENUM'](_0xcdf8('0x6'),'SENDING',_0xcdf8('0x7'),_0xcdf8('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xcdf8('0x1')]},'appdata':{'type':Sequelize[_0xcdf8('0x1')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 11b24d6..5ac8ef1 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 _0x457d=['params','rawAttributes','find','catch','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','end','error','stack','name','send','map','IntegrationReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','show'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0x457d,0x175));var _0xd457=function(_0x55ae99,_0x5ab789){_0x55ae99=_0x55ae99-0x0;var _0x4297e1=_0x457d[_0x55ae99];return _0x4297e1;};'use strict';var emlformat=require(_0xd457('0x0'));var rimraf=require(_0xd457('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd457('0x2'));var rp=require(_0xd457('0x3'));var moment=require(_0xd457('0x4'));var BPromise=require(_0xd457('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd457('0x6'));var sox=require(_0xd457('0x7'));var csv=require(_0xd457('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd457('0x9'));var _=require(_0xd457('0xa'));var squel=require(_0xd457('0xb'));var crypto=require('crypto');var jsforce=require(_0xd457('0xc'));var deskjs=require(_0xd457('0xd'));var toCsv=require(_0xd457('0x8'));var querystring=require('querystring');var Papa=require(_0xd457('0xe'));var Redis=require(_0xd457('0xf'));var authService=require(_0xd457('0x10'));var qs=require(_0xd457('0x11'));var as=require(_0xd457('0x12'));var hardwareService=require(_0xd457('0x13'));var logger=require('../../config/logger')(_0xd457('0x14'));var utils=require('../../config/utils');var config=require(_0xd457('0x15'));var licenseUtil=require(_0xd457('0x16'));var db=require(_0xd457('0x17'))['db'];function respondWithStatusCode(_0x2905c5,_0x43713c){_0x43713c=_0x43713c||0xcc;return function(_0x134641){if(_0x134641){return _0x2905c5[_0xd457('0x18')](_0x43713c);}return _0x2905c5[_0xd457('0x19')](_0x43713c)['end']();};}function respondWithResult(_0x37c2ab,_0x396745){_0x396745=_0x396745||0xc8;return function(_0x4d5ab2){if(_0x4d5ab2){return _0x37c2ab[_0xd457('0x19')](_0x396745)[_0xd457('0x1a')](_0x4d5ab2);}};}function respondWithFilteredResult(_0x30ec6e,_0x32c604){return function(_0x5c57d1){if(_0x5c57d1){var _0x1e2414=typeof _0x32c604[_0xd457('0x1b')]===_0xd457('0x1c')&&typeof _0x32c604[_0xd457('0x1d')]===_0xd457('0x1c');var _0x21ab41=_0x5c57d1[_0xd457('0x1e')];var _0x5ac70c=_0x1e2414?0x0:_0x32c604[_0xd457('0x1b')];var _0x2eca8c=_0x1e2414?_0x5c57d1[_0xd457('0x1e')]:_0x32c604[_0xd457('0x1b')]+_0x32c604[_0xd457('0x1d')];var _0x41704a;if(_0x2eca8c>=_0x21ab41){_0x2eca8c=_0x21ab41;_0x41704a=0xc8;}else{_0x41704a=0xce;}_0x30ec6e[_0xd457('0x19')](_0x41704a);return _0x30ec6e[_0xd457('0x1f')]('Content-Range',_0x5ac70c+'-'+_0x2eca8c+'/'+_0x21ab41)[_0xd457('0x1a')](_0x5c57d1);}return null;};}function patchUpdates(_0x1dcb0c){return function(_0x4c1e44){try{jsonpatch[_0xd457('0x20')](_0x4c1e44,_0x1dcb0c,!![]);}catch(_0x17f673){return BPromise[_0xd457('0x21')](_0x17f673);}return _0x4c1e44[_0xd457('0x22')]();};}function saveUpdates(_0x4ec96c,_0x4bdc54){return function(_0x246f1d){if(_0x246f1d){return _0x246f1d['update'](_0x4ec96c)[_0xd457('0x23')](function(_0x5e78cc){return _0x5e78cc;});}return null;};}function removeEntity(_0x3de41f,_0x1363e6){return function(_0x1316d6){if(_0x1316d6){return _0x1316d6[_0xd457('0x24')]()[_0xd457('0x23')](function(){_0x3de41f[_0xd457('0x19')](0xcc)[_0xd457('0x25')]();});}};}function handleEntityNotFound(_0x9a088,_0x26f272){return function(_0x388b1f){if(!_0x388b1f){_0x9a088[_0xd457('0x18')](0x194);}return _0x388b1f;};}function handleError(_0x2201e9,_0x423901){_0x423901=_0x423901||0x1f4;return function(_0x3baeb8){logger[_0xd457('0x26')](_0x3baeb8[_0xd457('0x27')]);if(_0x3baeb8['name']){delete _0x3baeb8[_0xd457('0x28')];}_0x2201e9['status'](_0x423901)[_0xd457('0x29')](_0x3baeb8);};}exports['index']=function(_0x195114,_0x1c2529){var _0x542881={},_0x13148b={},_0x263dbd={'count':0x0,'rows':[]};var _0x10a147=_[_0xd457('0x2a')](db[_0xd457('0x2b')]['rawAttributes'],function(_0x5d5fa2){return{'name':_0x5d5fa2['fieldName'],'type':_0x5d5fa2[_0xd457('0x2c')][_0xd457('0x2d')]};});_0x13148b[_0xd457('0x2e')]=_['map'](_0x10a147,_0xd457('0x28'));_0x13148b[_0xd457('0x2f')]=_[_0xd457('0x30')](_0x195114['query']);_0x13148b[_0xd457('0x31')]=_[_0xd457('0x32')](_0x13148b[_0xd457('0x2e')],_0x13148b[_0xd457('0x2f')]);_0x542881[_0xd457('0x33')]=_[_0xd457('0x32')](_0x13148b[_0xd457('0x2e')],qs[_0xd457('0x34')](_0x195114[_0xd457('0x2f')][_0xd457('0x34')]));_0x542881[_0xd457('0x33')]=_0x542881[_0xd457('0x33')][_0xd457('0x35')]?_0x542881['attributes']:_0x13148b['model'];if(!_0x195114[_0xd457('0x2f')]['hasOwnProperty']('nolimit')){_0x542881['limit']=qs[_0xd457('0x1d')](_0x195114[_0xd457('0x2f')][_0xd457('0x1d')]);_0x542881['offset']=qs[_0xd457('0x1b')](_0x195114[_0xd457('0x2f')][_0xd457('0x1b')]);}_0x542881[_0xd457('0x36')]=qs['sort'](_0x195114[_0xd457('0x2f')][_0xd457('0x37')]);_0x542881[_0xd457('0x38')]=qs[_0xd457('0x31')](_[_0xd457('0x39')](_0x195114[_0xd457('0x2f')],_0x13148b['filters']),_0x10a147);if(_0x195114[_0xd457('0x2f')]['filter']){_0x542881[_0xd457('0x38')]=_[_0xd457('0x3a')](_0x542881[_0xd457('0x38')],{'$or':_[_0xd457('0x2a')](_0x10a147,function(_0x47bc42){if(_0x47bc42['type']!==_0xd457('0x3b')){var _0x4d6cc7={};_0x4d6cc7[_0x47bc42[_0xd457('0x28')]]={'$like':'%'+_0x195114[_0xd457('0x2f')][_0xd457('0x3c')]+'%'};return _0x4d6cc7;}})});}_0x542881=_[_0xd457('0x3a')]({},_0x542881,_0x195114[_0xd457('0x3d')]);var _0x26721c={'where':_0x542881[_0xd457('0x38')]};return db['IntegrationReport']['count'](_0x26721c)['then'](function(_0x446ef4){_0x263dbd['count']=_0x446ef4;if(_0x195114[_0xd457('0x2f')]['includeAll']){_0x542881[_0xd457('0x3e')]=[{'all':!![]}];}return db[_0xd457('0x2b')][_0xd457('0x3f')](_0x542881);})[_0xd457('0x23')](function(_0x4b8c97){_0x263dbd['rows']=_0x4b8c97;return _0x263dbd;})[_0xd457('0x23')](respondWithFilteredResult(_0x1c2529,_0x542881))['catch'](handleError(_0x1c2529,null));};exports[_0xd457('0x40')]=function(_0xcdb7e2,_0x36015d){var _0x4d9ff9={'raw':![],'where':{'id':_0xcdb7e2[_0xd457('0x41')]['id']}},_0x241213={};_0x241213[_0xd457('0x2e')]=_[_0xd457('0x30')](db['IntegrationReport'][_0xd457('0x42')]);_0x241213[_0xd457('0x2f')]=_[_0xd457('0x30')](_0xcdb7e2['query']);_0x241213['filters']=_[_0xd457('0x32')](_0x241213['model'],_0x241213[_0xd457('0x2f')]);_0x4d9ff9[_0xd457('0x33')]=_['intersection'](_0x241213['model'],qs[_0xd457('0x34')](_0xcdb7e2[_0xd457('0x2f')][_0xd457('0x34')]));_0x4d9ff9[_0xd457('0x33')]=_0x4d9ff9[_0xd457('0x33')]['length']?_0x4d9ff9[_0xd457('0x33')]:_0x241213[_0xd457('0x2e')];if(_0xcdb7e2['query']['includeAll']){_0x4d9ff9['include']=[{'all':!![]}];}_0x4d9ff9=_[_0xd457('0x3a')]({},_0x4d9ff9,_0xcdb7e2[_0xd457('0x3d')]);return db[_0xd457('0x2b')][_0xd457('0x43')](_0x4d9ff9)['then'](handleEntityNotFound(_0x36015d,null))['then'](respondWithResult(_0x36015d,null))[_0xd457('0x44')](handleError(_0x36015d,null));};exports['create']=function(_0x2f2e9e,_0xd84e58){return db[_0xd457('0x2b')][_0xd457('0x45')](_0x2f2e9e[_0xd457('0x46')],{})[_0xd457('0x23')](respondWithResult(_0xd84e58,0xc9))[_0xd457('0x44')](handleError(_0xd84e58,null));};exports[_0xd457('0x47')]=function(_0x5a6f9c,_0x55ffdf){if(_0x5a6f9c[_0xd457('0x46')]['id']){delete _0x5a6f9c['body']['id'];}return db['IntegrationReport'][_0xd457('0x43')]({'where':{'id':_0x5a6f9c[_0xd457('0x41')]['id']}})[_0xd457('0x23')](handleEntityNotFound(_0x55ffdf,null))[_0xd457('0x23')](saveUpdates(_0x5a6f9c['body'],null))['then'](respondWithResult(_0x55ffdf,null))[_0xd457('0x44')](handleError(_0x55ffdf,null));};exports[_0xd457('0x24')]=function(_0x1460e4,_0x324ce5){return db[_0xd457('0x2b')][_0xd457('0x43')]({'where':{'id':_0x1460e4[_0xd457('0x41')]['id']}})[_0xd457('0x23')](handleEntityNotFound(_0x324ce5,null))[_0xd457('0x23')](removeEntity(_0x324ce5,null))['catch'](handleError(_0x324ce5,null));};exports[_0xd457('0x48')]=function(_0x519676,_0x5c6a6c){return db['IntegrationReport'][_0xd457('0x48')]()[_0xd457('0x23')](respondWithResult(_0x5c6a6c,null))[_0xd457('0x44')](handleError(_0x5c6a6c,null));}; \ No newline at end of file +var _0x776a=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','destroy','then','sendStatus','stack','name','index','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','params','intersection','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0xf94ea7,_0x25a780){var _0x5a3ecd=function(_0x5a15f7){while(--_0x5a15f7){_0xf94ea7['push'](_0xf94ea7['shift']());}};_0x5a3ecd(++_0x25a780);}(_0x776a,0x11a));var _0xa776=function(_0x230b94,_0x4c37a1){_0x230b94=_0x230b94-0x0;var _0x380f4b=_0x776a[_0x230b94];return _0x380f4b;};'use strict';var emlformat=require(_0xa776('0x0'));var rimraf=require(_0xa776('0x1'));var zipdir=require(_0xa776('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa776('0x3'));var moment=require(_0xa776('0x4'));var BPromise=require(_0xa776('0x5'));var Mustache=require(_0xa776('0x6'));var util=require('util');var path=require(_0xa776('0x7'));var sox=require('sox');var csv=require(_0xa776('0x8'));var ejs=require(_0xa776('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa776('0xa'));var squel=require(_0xa776('0xb'));var crypto=require(_0xa776('0xc'));var jsforce=require(_0xa776('0xd'));var deskjs=require(_0xa776('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa776('0xf'));var Redis=require(_0xa776('0x10'));var authService=require(_0xa776('0x11'));var qs=require(_0xa776('0x12'));var as=require(_0xa776('0x13'));var hardwareService=require(_0xa776('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xa776('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa776('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d7197,_0x1cc1ea){_0x1cc1ea=_0x1cc1ea||0xcc;return function(_0x51cf6f){if(_0x51cf6f){return _0x3d7197['sendStatus'](_0x1cc1ea);}return _0x3d7197['status'](_0x1cc1ea)[_0xa776('0x17')]();};}function respondWithResult(_0x516504,_0x412e4a){_0x412e4a=_0x412e4a||0xc8;return function(_0x5de1dd){if(_0x5de1dd){return _0x516504[_0xa776('0x18')](_0x412e4a)[_0xa776('0x19')](_0x5de1dd);}};}function respondWithFilteredResult(_0x1f76e6,_0x1b7f1d){return function(_0x2be613){if(_0x2be613){var _0x34a514=typeof _0x1b7f1d['offset']===_0xa776('0x1a')&&typeof _0x1b7f1d[_0xa776('0x1b')]===_0xa776('0x1a');var _0x842019=_0x2be613['count'];var _0x471c54=_0x34a514?0x0:_0x1b7f1d[_0xa776('0x1c')];var _0x11b896=_0x34a514?_0x2be613[_0xa776('0x1d')]:_0x1b7f1d[_0xa776('0x1c')]+_0x1b7f1d[_0xa776('0x1b')];var _0x133c01;if(_0x11b896>=_0x842019){_0x11b896=_0x842019;_0x133c01=0xc8;}else{_0x133c01=0xce;}_0x1f76e6[_0xa776('0x18')](_0x133c01);return _0x1f76e6[_0xa776('0x1e')](_0xa776('0x1f'),_0x471c54+'-'+_0x11b896+'/'+_0x842019)[_0xa776('0x19')](_0x2be613);}return null;};}function patchUpdates(_0x107e4c){return function(_0x3d6629){try{jsonpatch[_0xa776('0x20')](_0x3d6629,_0x107e4c,!![]);}catch(_0x376891){return BPromise[_0xa776('0x21')](_0x376891);}return _0x3d6629[_0xa776('0x22')]();};}function saveUpdates(_0x365ecb,_0x4474a5){return function(_0x52036e){if(_0x52036e){return _0x52036e['update'](_0x365ecb)['then'](function(_0xb0852){return _0xb0852;});}return null;};}function removeEntity(_0x60ed92,_0x1a01e4){return function(_0x30326a){if(_0x30326a){return _0x30326a[_0xa776('0x23')]()[_0xa776('0x24')](function(){_0x60ed92[_0xa776('0x18')](0xcc)[_0xa776('0x17')]();});}};}function handleEntityNotFound(_0x2d9bdc,_0x573b6f){return function(_0x1de6a1){if(!_0x1de6a1){_0x2d9bdc[_0xa776('0x25')](0x194);}return _0x1de6a1;};}function handleError(_0x16cc46,_0x2df8d4){_0x2df8d4=_0x2df8d4||0x1f4;return function(_0x54a164){logger['error'](_0x54a164[_0xa776('0x26')]);if(_0x54a164[_0xa776('0x27')]){delete _0x54a164[_0xa776('0x27')];}_0x16cc46[_0xa776('0x18')](_0x2df8d4)['send'](_0x54a164);};}exports[_0xa776('0x28')]=function(_0x4a1f0a,_0x38adc4){var _0x1741ba={},_0x18d98d={},_0x35222d={'count':0x0,'rows':[]};var _0x116c81=_[_0xa776('0x29')](db[_0xa776('0x2a')][_0xa776('0x2b')],function(_0x4c1e98){return{'name':_0x4c1e98[_0xa776('0x2c')],'type':_0x4c1e98[_0xa776('0x2d')]['key']};});_0x18d98d[_0xa776('0x2e')]=_[_0xa776('0x29')](_0x116c81,'name');_0x18d98d[_0xa776('0x2f')]=_[_0xa776('0x30')](_0x4a1f0a[_0xa776('0x2f')]);_0x18d98d[_0xa776('0x31')]=_['intersection'](_0x18d98d[_0xa776('0x2e')],_0x18d98d[_0xa776('0x2f')]);_0x1741ba[_0xa776('0x32')]=_['intersection'](_0x18d98d[_0xa776('0x2e')],qs[_0xa776('0x33')](_0x4a1f0a[_0xa776('0x2f')][_0xa776('0x33')]));_0x1741ba[_0xa776('0x32')]=_0x1741ba['attributes'][_0xa776('0x34')]?_0x1741ba[_0xa776('0x32')]:_0x18d98d[_0xa776('0x2e')];if(!_0x4a1f0a[_0xa776('0x2f')][_0xa776('0x35')](_0xa776('0x36'))){_0x1741ba['limit']=qs['limit'](_0x4a1f0a['query'][_0xa776('0x1b')]);_0x1741ba[_0xa776('0x1c')]=qs['offset'](_0x4a1f0a[_0xa776('0x2f')][_0xa776('0x1c')]);}_0x1741ba[_0xa776('0x37')]=qs[_0xa776('0x38')](_0x4a1f0a['query'][_0xa776('0x38')]);_0x1741ba['where']=qs['filters'](_[_0xa776('0x39')](_0x4a1f0a['query'],_0x18d98d[_0xa776('0x31')]),_0x116c81);if(_0x4a1f0a[_0xa776('0x2f')][_0xa776('0x3a')]){_0x1741ba['where']=_[_0xa776('0x3b')](_0x1741ba[_0xa776('0x3c')],{'$or':_[_0xa776('0x29')](_0x116c81,function(_0x1e855b){if(_0x1e855b[_0xa776('0x2d')]!==_0xa776('0x3d')){var _0x1eab18={};_0x1eab18[_0x1e855b[_0xa776('0x27')]]={'$like':'%'+_0x4a1f0a[_0xa776('0x2f')]['filter']+'%'};return _0x1eab18;}})});}_0x1741ba=_[_0xa776('0x3b')]({},_0x1741ba,_0x4a1f0a[_0xa776('0x3e')]);var _0x578583={'where':_0x1741ba[_0xa776('0x3c')]};return db[_0xa776('0x2a')]['count'](_0x578583)[_0xa776('0x24')](function(_0x3ee3ef){_0x35222d['count']=_0x3ee3ef;if(_0x4a1f0a[_0xa776('0x2f')][_0xa776('0x3f')]){_0x1741ba['include']=[{'all':!![]}];}return db[_0xa776('0x2a')][_0xa776('0x40')](_0x1741ba);})[_0xa776('0x24')](function(_0x533fef){_0x35222d[_0xa776('0x41')]=_0x533fef;return _0x35222d;})[_0xa776('0x24')](respondWithFilteredResult(_0x38adc4,_0x1741ba))[_0xa776('0x42')](handleError(_0x38adc4,null));};exports['show']=function(_0x5e3e34,_0x513803){var _0x3fa894={'raw':![],'where':{'id':_0x5e3e34[_0xa776('0x43')]['id']}},_0xfa74ba={};_0xfa74ba[_0xa776('0x2e')]=_[_0xa776('0x30')](db[_0xa776('0x2a')]['rawAttributes']);_0xfa74ba[_0xa776('0x2f')]=_[_0xa776('0x30')](_0x5e3e34[_0xa776('0x2f')]);_0xfa74ba['filters']=_[_0xa776('0x44')](_0xfa74ba['model'],_0xfa74ba[_0xa776('0x2f')]);_0x3fa894[_0xa776('0x32')]=_[_0xa776('0x44')](_0xfa74ba['model'],qs[_0xa776('0x33')](_0x5e3e34[_0xa776('0x2f')][_0xa776('0x33')]));_0x3fa894[_0xa776('0x32')]=_0x3fa894[_0xa776('0x32')][_0xa776('0x34')]?_0x3fa894[_0xa776('0x32')]:_0xfa74ba[_0xa776('0x2e')];if(_0x5e3e34[_0xa776('0x2f')]['includeAll']){_0x3fa894[_0xa776('0x45')]=[{'all':!![]}];}_0x3fa894=_[_0xa776('0x3b')]({},_0x3fa894,_0x5e3e34['options']);return db[_0xa776('0x2a')][_0xa776('0x46')](_0x3fa894)[_0xa776('0x24')](handleEntityNotFound(_0x513803,null))['then'](respondWithResult(_0x513803,null))[_0xa776('0x42')](handleError(_0x513803,null));};exports[_0xa776('0x47')]=function(_0x1ae4b4,_0x4ea25c){return db['IntegrationReport'][_0xa776('0x47')](_0x1ae4b4[_0xa776('0x48')],{})[_0xa776('0x24')](respondWithResult(_0x4ea25c,0xc9))[_0xa776('0x42')](handleError(_0x4ea25c,null));};exports[_0xa776('0x49')]=function(_0x3b8f0c,_0x3af63f){if(_0x3b8f0c['body']['id']){delete _0x3b8f0c[_0xa776('0x48')]['id'];}return db[_0xa776('0x2a')][_0xa776('0x46')]({'where':{'id':_0x3b8f0c[_0xa776('0x43')]['id']}})[_0xa776('0x24')](handleEntityNotFound(_0x3af63f,null))[_0xa776('0x24')](saveUpdates(_0x3b8f0c['body'],null))['then'](respondWithResult(_0x3af63f,null))[_0xa776('0x42')](handleError(_0x3af63f,null));};exports[_0xa776('0x23')]=function(_0xc691ce,_0x4dd807){return db['IntegrationReport'][_0xa776('0x46')]({'where':{'id':_0xc691ce['params']['id']}})[_0xa776('0x24')](handleEntityNotFound(_0x4dd807,null))[_0xa776('0x24')](removeEntity(_0x4dd807,null))[_0xa776('0x42')](handleError(_0x4dd807,null));};exports[_0xa776('0x4a')]=function(_0x1caeb9,_0x547880){return db['IntegrationReport'][_0xa776('0x4a')]()[_0xa776('0x24')](respondWithResult(_0x547880,null))['catch'](handleError(_0x547880,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 869c4a0..859e784 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 _0x0379=['rimraf','../../config/environment','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1b0f54,_0xf5bc6a){var _0x4ade7d=function(_0x312ccb){while(--_0x312ccb){_0x1b0f54['push'](_0x1b0f54['shift']());}};_0x4ade7d(++_0xf5bc6a);}(_0x0379,0xf4));var _0x9037=function(_0x56e93a,_0x3434e8){_0x56e93a=_0x56e93a-0x0;var _0x585f2d=_0x0379[_0x56e93a];return _0x585f2d;};'use strict';var _=require(_0x9037('0x0'));var util=require(_0x9037('0x1'));var logger=require(_0x9037('0x2'))(_0x9037('0x3'));var moment=require(_0x9037('0x4'));var BPromise=require(_0x9037('0x5'));var rp=require(_0x9037('0x6'));var fs=require('fs');var path=require(_0x9037('0x7'));var rimraf=require(_0x9037('0x8'));var config=require(_0x9037('0x9'));var attributes=require('./integrationReport.attributes');module[_0x9037('0xa')]=function(_0x32a3e4,_0x2a7b02){return _0x32a3e4[_0x9037('0xb')](_0x9037('0xc'),attributes,{'tableName':_0x9037('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75f4=['report_integration','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','IntegrationReport'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0x75f4,0xc7));var _0x475f=function(_0x5aef17,_0x592cd4){_0x5aef17=_0x5aef17-0x0;var _0x43f9d0=_0x75f4[_0x5aef17];return _0x43f9d0;};'use strict';var _=require(_0x475f('0x0'));var util=require(_0x475f('0x1'));var logger=require(_0x475f('0x2'))(_0x475f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x475f('0x4'));var fs=require('fs');var path=require(_0x475f('0x5'));var rimraf=require(_0x475f('0x6'));var config=require(_0x475f('0x7'));var attributes=require(_0x475f('0x8'));module['exports']=function(_0x313b22,_0x1547d2){return _0x313b22['define'](_0x475f('0x9'),attributes,{'tableName':_0x475f('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 1e97c3c..4eeb49a 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 _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x1040cb,_0x12e647){var _0xe9cd5=function(_0x34405f){while(--_0x34405f){_0x1040cb['push'](_0x1040cb['shift']());}};_0xe9cd5(++_0x12e647);}(_0x187d,0x93));var _0xd187=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x187d[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x310832,_0xe72c7e){var _0x103f74=function(_0x4a217c){while(--_0x4a217c){_0x310832['push'](_0x310832['shift']());}};_0x103f74(++_0xe72c7e);}(_0xadb5,0xad));var _0x5adb=function(_0x1e5f95,_0x17acff){_0x1e5f95=_0x1e5f95-0x0;var _0x4132fe=_0xadb5[_0x1e5f95];return _0x4132fe;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index a7b30b5..c3c51bb 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 _0x8375=['/:id/sub_intervals/create_many','addIntervals','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','post','create'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8375,0x132));var _0x5837=function(_0x420ede,_0x31fb0a){_0x420ede=_0x420ede-0x0;var _0x14edeb=_0x8375[_0x420ede];return _0x14edeb;};'use strict';var multer=require('multer');var util=require(_0x5837('0x0'));var path=require(_0x5837('0x1'));var timeout=require(_0x5837('0x2'));var express=require(_0x5837('0x3'));var router=express[_0x5837('0x4')]();var fs_extra=require(_0x5837('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5837('0x6'));var config=require(_0x5837('0x7'));var controller=require('./interval.controller');router[_0x5837('0x8')]('/',auth[_0x5837('0x9')](),controller[_0x5837('0xa')]);router[_0x5837('0x8')]('/:id',auth[_0x5837('0x9')](),controller[_0x5837('0xb')]);router[_0x5837('0x8')](_0x5837('0xc'),auth[_0x5837('0x9')](),controller[_0x5837('0xd')]);router[_0x5837('0xe')]('/',auth[_0x5837('0x9')](),controller[_0x5837('0xf')]);router['post'](_0x5837('0xc'),auth[_0x5837('0x9')](),controller['addInterval']);router[_0x5837('0xe')](_0x5837('0x10'),auth['isAuthenticated'](),controller[_0x5837('0x11')]);router['put'](_0x5837('0x12'),auth[_0x5837('0x9')](),controller[_0x5837('0x13')]);router[_0x5837('0x14')]('/:id',auth[_0x5837('0x9')](),controller[_0x5837('0x15')]);module[_0x5837('0x16')]=router; \ No newline at end of file +var _0xe191=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','/:id'];(function(_0x1a9882,_0x7a70bf){var _0x23304e=function(_0x39638e){while(--_0x39638e){_0x1a9882['push'](_0x1a9882['shift']());}};_0x23304e(++_0x7a70bf);}(_0xe191,0x98));var _0x1e19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe191[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1e19('0x0'));var util=require(_0x1e19('0x1'));var path=require(_0x1e19('0x2'));var timeout=require(_0x1e19('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1e19('0x4'));var auth=require(_0x1e19('0x5'));var interaction=require(_0x1e19('0x6'));var config=require('../../config/environment');var controller=require(_0x1e19('0x7'));router[_0x1e19('0x8')]('/',auth[_0x1e19('0x9')](),controller['index']);router[_0x1e19('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e19('0xa')]);router[_0x1e19('0x8')](_0x1e19('0xb'),auth['isAuthenticated'](),controller[_0x1e19('0xc')]);router[_0x1e19('0xd')]('/',auth[_0x1e19('0x9')](),controller[_0x1e19('0xe')]);router[_0x1e19('0xd')](_0x1e19('0xb'),auth[_0x1e19('0x9')](),controller[_0x1e19('0xf')]);router[_0x1e19('0xd')](_0x1e19('0x10'),auth[_0x1e19('0x9')](),controller[_0x1e19('0x11')]);router['put'](_0x1e19('0x12'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1e19('0x12'),auth[_0x1e19('0x9')](),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 243fea0..466a767 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 _0x0534=['exports','STRING'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x0534,0x196));var _0x4053=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x0534[_0x5a6644];return _0x3a2a5d;};'use strict';var Sequelize=require('sequelize');module[_0x4053('0x0')]={'name':{'type':Sequelize[_0x4053('0x1')]},'description':{'type':Sequelize[_0x4053('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xe188=['STRING','sequelize','exports'];(function(_0x305d54,_0x48d43c){var _0x598d36=function(_0x357ba2){while(--_0x357ba2){_0x305d54['push'](_0x305d54['shift']());}};_0x598d36(++_0x48d43c);}(_0xe188,0xd0));var _0x8e18=function(_0x7f37da,_0x30a906){_0x7f37da=_0x7f37da-0x0;var _0x474378=_0xe188[_0x7f37da];return _0x474378;};'use strict';var Sequelize=require(_0x8e18('0x0'));module[_0x8e18('0x1')]={'name':{'type':Sequelize[_0x8e18('0x2')]},'description':{'type':Sequelize[_0x8e18('0x2')]},'interval':{'type':Sequelize[_0x8e18('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index e916188..0f379a8 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 _0x4951=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','IntervalId','getIntervals','findOne','addIntervals','transaction','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','includeAll','find','create','body'];(function(_0x421791,_0x3625d8){var _0x495838=function(_0x5190c3){while(--_0x5190c3){_0x421791['push'](_0x421791['shift']());}};_0x495838(++_0x3625d8);}(_0x4951,0x169));var _0x1495=function(_0x4bcddd,_0x26a897){_0x4bcddd=_0x4bcddd-0x0;var _0x5d4fd7=_0x4951[_0x4bcddd];return _0x5d4fd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1495('0x0'));var zipdir=require(_0x1495('0x1'));var jsonpatch=require(_0x1495('0x2'));var rp=require(_0x1495('0x3'));var moment=require(_0x1495('0x4'));var BPromise=require(_0x1495('0x5'));var Mustache=require('mustache');var util=require(_0x1495('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1495('0x7'));var ejs=require(_0x1495('0x8'));var fs=require('fs');var fs_extra=require(_0x1495('0x9'));var _=require('lodash');var squel=require(_0x1495('0xa'));var crypto=require(_0x1495('0xb'));var jsforce=require(_0x1495('0xc'));var deskjs=require(_0x1495('0xd'));var toCsv=require(_0x1495('0x7'));var querystring=require(_0x1495('0xe'));var Papa=require('papaparse');var Redis=require(_0x1495('0xf'));var authService=require(_0x1495('0x10'));var qs=require(_0x1495('0x11'));var as=require(_0x1495('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1495('0x13'))('api');var utils=require(_0x1495('0x14'));var config=require(_0x1495('0x15'));var licenseUtil=require(_0x1495('0x16'));var db=require('../../mysqldb')['db'];var extensions=require(_0x1495('0x17'));function respondWithStatusCode(_0x9b4892,_0xffb92){_0xffb92=_0xffb92||0xcc;return function(_0x577e64){if(_0x577e64){return _0x9b4892[_0x1495('0x18')](_0xffb92);}return _0x9b4892[_0x1495('0x19')](_0xffb92)[_0x1495('0x1a')]();};}function respondWithResult(_0x5442f4,_0x4b65b8){_0x4b65b8=_0x4b65b8||0xc8;return function(_0x22f388){if(_0x22f388){return _0x5442f4['status'](_0x4b65b8)[_0x1495('0x1b')](_0x22f388);}};}function respondWithFilteredResult(_0x2048f0,_0x2621da){return function(_0x46e6bd){if(_0x46e6bd){var _0x58c5f3=typeof _0x2621da[_0x1495('0x1c')]===_0x1495('0x1d')&&typeof _0x2621da[_0x1495('0x1e')]==='undefined';var _0x5545bb=_0x46e6bd[_0x1495('0x1f')];var _0x4bd2c0=_0x58c5f3?0x0:_0x2621da[_0x1495('0x1c')];var _0x4d4495=_0x58c5f3?_0x46e6bd[_0x1495('0x1f')]:_0x2621da[_0x1495('0x1c')]+_0x2621da[_0x1495('0x1e')];var _0xff2fd6;if(_0x4d4495>=_0x5545bb){_0x4d4495=_0x5545bb;_0xff2fd6=0xc8;}else{_0xff2fd6=0xce;}_0x2048f0[_0x1495('0x19')](_0xff2fd6);return _0x2048f0['set']('Content-Range',_0x4bd2c0+'-'+_0x4d4495+'/'+_0x5545bb)['json'](_0x46e6bd);}return null;};}function patchUpdates(_0x31c4e0){return function(_0xb2961e){try{jsonpatch[_0x1495('0x20')](_0xb2961e,_0x31c4e0,!![]);}catch(_0x4a1ce8){return BPromise['reject'](_0x4a1ce8);}return _0xb2961e[_0x1495('0x21')]();};}function saveUpdates(_0x2831a7,_0x3572cb){return function(_0x3f27e1){if(_0x3f27e1){return _0x3f27e1[_0x1495('0x22')](_0x2831a7)[_0x1495('0x23')](function(_0x432289){return _0x432289;});}return null;};}function removeEntity(_0x3b5fa5,_0x5b8d86){return function(_0x1cd69d){if(_0x1cd69d){return _0x1cd69d[_0x1495('0x24')]()[_0x1495('0x23')](function(){var _0x5bba59=_0x1cd69d[_0x1495('0x25')]({'plain':!![]});var _0xa85e4b=_0x1495('0x26');return db[_0x1495('0x27')][_0x1495('0x24')]({'where':{'type':_0xa85e4b,'resourceId':_0x5bba59['id']}})['then'](function(){return _0x1cd69d;});})['then'](function(){_0x3b5fa5['status'](0xcc)[_0x1495('0x1a')]();});}};}function handleEntityNotFound(_0x5be711,_0x507832){return function(_0x32e55c){if(!_0x32e55c){_0x5be711['sendStatus'](0x194);}return _0x32e55c;};}function handleError(_0x54497a,_0x47a0be){_0x47a0be=_0x47a0be||0x1f4;return function(_0x295e5e){logger[_0x1495('0x28')](_0x295e5e[_0x1495('0x29')]);if(_0x295e5e[_0x1495('0x2a')]){delete _0x295e5e[_0x1495('0x2a')];}_0x54497a[_0x1495('0x19')](_0x47a0be)[_0x1495('0x2b')](_0x295e5e);};}exports[_0x1495('0x2c')]=function(_0x442791,_0x4924d8){var _0xadda4e={},_0x43a6f6={},_0x381fdc={'count':0x0,'rows':[]};var _0x12b154=_['map'](db[_0x1495('0x2d')][_0x1495('0x2e')],function(_0x1c8a3a){return{'name':_0x1c8a3a[_0x1495('0x2f')],'type':_0x1c8a3a['type']['key']};});_0x43a6f6[_0x1495('0x30')]=_[_0x1495('0x31')](_0x12b154,_0x1495('0x2a'));_0x43a6f6[_0x1495('0x32')]=_[_0x1495('0x33')](_0x442791[_0x1495('0x32')]);_0x43a6f6[_0x1495('0x34')]=_['intersection'](_0x43a6f6[_0x1495('0x30')],_0x43a6f6[_0x1495('0x32')]);_0xadda4e[_0x1495('0x35')]=_[_0x1495('0x36')](_0x43a6f6[_0x1495('0x30')],qs[_0x1495('0x37')](_0x442791['query'][_0x1495('0x37')]));_0xadda4e['attributes']=_0xadda4e[_0x1495('0x35')][_0x1495('0x38')]?_0xadda4e['attributes']:_0x43a6f6[_0x1495('0x30')];if(!_0x442791['query'][_0x1495('0x39')](_0x1495('0x3a'))){_0xadda4e['limit']=qs[_0x1495('0x1e')](_0x442791['query']['limit']);_0xadda4e[_0x1495('0x1c')]=qs[_0x1495('0x1c')](_0x442791[_0x1495('0x32')][_0x1495('0x1c')]);}_0xadda4e[_0x1495('0x3b')]=qs[_0x1495('0x3c')](_0x442791[_0x1495('0x32')][_0x1495('0x3c')]);_0xadda4e[_0x1495('0x3d')]=qs[_0x1495('0x34')](_[_0x1495('0x3e')](_0x442791[_0x1495('0x32')],_0x43a6f6['filters']),_0x12b154);if(_0x442791[_0x1495('0x32')][_0x1495('0x3f')]){_0xadda4e['where']=_[_0x1495('0x40')](_0xadda4e['where'],{'$or':_[_0x1495('0x31')](_0x12b154,function(_0x3a6a7d){if(_0x3a6a7d['type']!=='VIRTUAL'){var _0x264327={};_0x264327[_0x3a6a7d['name']]={'$like':'%'+_0x442791[_0x1495('0x32')][_0x1495('0x3f')]+'%'};return _0x264327;}})});}_0xadda4e=_['merge']({},_0xadda4e,_0x442791['options']);var _0x2beab2={'where':_0xadda4e[_0x1495('0x3d')]};return db['Interval'][_0x1495('0x1f')](_0x2beab2)[_0x1495('0x23')](function(_0x4f278b){_0x381fdc[_0x1495('0x1f')]=_0x4f278b;if(_0x442791[_0x1495('0x32')]['includeAll']){_0xadda4e[_0x1495('0x41')]=[{'all':!![]}];}return db['Interval'][_0x1495('0x42')](_0xadda4e);})[_0x1495('0x23')](function(_0xe63733){_0x381fdc[_0x1495('0x43')]=_0xe63733;return _0x381fdc;})[_0x1495('0x23')](respondWithFilteredResult(_0x4924d8,_0xadda4e))[_0x1495('0x44')](handleError(_0x4924d8,null));};exports[_0x1495('0x45')]=function(_0x467fad,_0x3d05e7){var _0x49ac2a={'raw':!![],'where':{'id':_0x467fad['params']['id']}},_0x483399={};_0x483399[_0x1495('0x30')]=_[_0x1495('0x33')](db[_0x1495('0x2d')]['rawAttributes']);_0x483399[_0x1495('0x32')]=_[_0x1495('0x33')](_0x467fad[_0x1495('0x32')]);_0x483399['filters']=_[_0x1495('0x36')](_0x483399[_0x1495('0x30')],_0x483399['query']);_0x49ac2a[_0x1495('0x35')]=_[_0x1495('0x36')](_0x483399[_0x1495('0x30')],qs[_0x1495('0x37')](_0x467fad[_0x1495('0x32')][_0x1495('0x37')]));_0x49ac2a[_0x1495('0x35')]=_0x49ac2a[_0x1495('0x35')][_0x1495('0x38')]?_0x49ac2a[_0x1495('0x35')]:_0x483399['model'];if(_0x467fad[_0x1495('0x32')][_0x1495('0x46')]){_0x49ac2a[_0x1495('0x41')]=[{'all':!![]}];}_0x49ac2a=_[_0x1495('0x40')]({},_0x49ac2a,_0x467fad['options']);return db[_0x1495('0x2d')][_0x1495('0x47')](_0x49ac2a)[_0x1495('0x23')](handleEntityNotFound(_0x3d05e7,null))[_0x1495('0x23')](respondWithResult(_0x3d05e7,null))[_0x1495('0x44')](handleError(_0x3d05e7,null));};exports[_0x1495('0x48')]=function(_0x36d57c,_0x52d77a){return db[_0x1495('0x2d')][_0x1495('0x48')](_0x36d57c[_0x1495('0x49')],{})[_0x1495('0x23')](function(_0x4b2218){var _0x3f0f91=_0x36d57c[_0x1495('0x4a')][_0x1495('0x25')]({'plain':!![]});if(!_0x3f0f91)throw new Error(_0x1495('0x4b'));if(_0x3f0f91[_0x1495('0x4c')]==='user'){var _0x477613=_0x4b2218[_0x1495('0x25')]({'plain':!![]});var _0x2dd423='Intervals';return db[_0x1495('0x4d')]['find']({'where':{'name':_0x2dd423,'userProfileId':_0x3f0f91[_0x1495('0x4e')]},'raw':!![]})[_0x1495('0x23')](function(_0x4a8a65){if(_0x4a8a65&&_0x4a8a65['autoAssociation']===0x0){return db[_0x1495('0x27')]['create']({'name':_0x477613['name'],'resourceId':_0x477613['id'],'type':_0x4a8a65[_0x1495('0x2a')],'sectionId':_0x4a8a65['id']},{})['then'](function(){return _0x4b2218;});}else{return _0x4b2218;}})[_0x1495('0x44')](function(_0x611ca5){logger[_0x1495('0x28')](_0x1495('0x4f'),_0x611ca5);throw _0x611ca5;});}return _0x4b2218;})[_0x1495('0x23')](respondWithResult(_0x52d77a,0xc9))['catch'](handleError(_0x52d77a,null));};exports[_0x1495('0x22')]=function(_0x1a0cec,_0x3bb8da){if(_0x1a0cec[_0x1495('0x49')]['id']){delete _0x1a0cec[_0x1495('0x49')]['id'];}return db[_0x1495('0x2d')]['find']({'where':{'id':_0x1a0cec['params']['id']}})[_0x1495('0x23')](handleEntityNotFound(_0x3bb8da,null))[_0x1495('0x23')](saveUpdates(_0x1a0cec['body'],null))[_0x1495('0x23')](respondWithResult(_0x3bb8da,null))['catch'](handleError(_0x3bb8da,null));};exports[_0x1495('0x24')]=function(_0x4268ae,_0x3f3122){return db[_0x1495('0x2d')][_0x1495('0x47')]({'where':{'id':_0x4268ae[_0x1495('0x50')]['id']}})[_0x1495('0x23')](handleEntityNotFound(_0x3f3122,null))['then'](removeEntity(_0x3f3122,null))[_0x1495('0x44')](handleError(_0x3f3122,null));};exports['addInterval']=function(_0x465e19,_0x4edf00,_0x385b7d){if(_0x465e19[_0x1495('0x49')]['id']){delete _0x465e19[_0x1495('0x49')]['id'];}return db[_0x1495('0x2d')][_0x1495('0x47')]({'where':{'id':_0x465e19[_0x1495('0x50')]['id']}})['then'](handleEntityNotFound(_0x4edf00,null))[_0x1495('0x23')](function(_0x4d995a){if(_0x4d995a){_0x465e19['body'][_0x1495('0x51')]=_0x4d995a['id'];return db[_0x1495('0x2d')][_0x1495('0x48')](_0x465e19[_0x1495('0x49')]);}})['then'](respondWithResult(_0x4edf00,null))[_0x1495('0x44')](handleError(_0x4edf00,null));};exports[_0x1495('0x52')]=function(_0x21668e,_0x48d060,_0x2facc2){var _0x235131={};var _0x2c3756={};var _0x2bad7e;var _0x1c9820;return db['Interval'][_0x1495('0x53')]({'where':{'id':_0x21668e[_0x1495('0x50')]['id']}})[_0x1495('0x23')](handleEntityNotFound(_0x48d060,null))[_0x1495('0x23')](function(_0x5e3508){if(_0x5e3508){_0x2bad7e=_0x5e3508;_0x2c3756['model']=_[_0x1495('0x33')](db['Interval'][_0x1495('0x2e')]);_0x2c3756[_0x1495('0x32')]=_[_0x1495('0x33')](_0x21668e[_0x1495('0x32')]);_0x2c3756[_0x1495('0x34')]=_[_0x1495('0x36')](_0x2c3756[_0x1495('0x30')],_0x2c3756['query']);_0x235131[_0x1495('0x35')]=_[_0x1495('0x36')](_0x2c3756['model'],qs[_0x1495('0x37')](_0x21668e[_0x1495('0x32')]['fields']));_0x235131['attributes']=_0x235131[_0x1495('0x35')][_0x1495('0x38')]?_0x235131['attributes']:_0x2c3756['model'];_0x235131['order']=qs[_0x1495('0x3c')](_0x21668e['query'][_0x1495('0x3c')]);_0x235131[_0x1495('0x3d')]=qs[_0x1495('0x34')](_[_0x1495('0x3e')](_0x21668e[_0x1495('0x32')],_0x2c3756[_0x1495('0x34')]));if(_0x21668e[_0x1495('0x32')][_0x1495('0x3f')]){_0x235131['where']=_['merge'](_0x235131[_0x1495('0x3d')],{'$or':_[_0x1495('0x31')](_0x235131[_0x1495('0x35')],function(_0x3d0bde){var _0x1941da={};_0x1941da[_0x3d0bde]={'$like':'%'+_0x21668e[_0x1495('0x32')][_0x1495('0x3f')]+'%'};return _0x1941da;})});}_0x235131=_['merge']({},_0x235131,_0x21668e['options']);return _0x2bad7e[_0x1495('0x52')](_0x235131);}})[_0x1495('0x23')](function(_0x4466a3){if(_0x4466a3){_0x1c9820=_0x4466a3[_0x1495('0x38')];if(!_0x21668e[_0x1495('0x32')][_0x1495('0x39')](_0x1495('0x3a'))){_0x235131['limit']=qs[_0x1495('0x1e')](_0x21668e[_0x1495('0x32')][_0x1495('0x1e')]);_0x235131['offset']=qs[_0x1495('0x1c')](_0x21668e[_0x1495('0x32')]['offset']);}return _0x2bad7e[_0x1495('0x52')](_0x235131);}})[_0x1495('0x23')](function(_0x2b9201){if(_0x2b9201){return _0x2b9201?{'count':_0x1c9820,'rows':_0x2b9201}:null;}})[_0x1495('0x23')](respondWithResult(_0x48d060,null))[_0x1495('0x44')](handleError(_0x48d060,null));};exports[_0x1495('0x54')]=function(_0xb57724,_0x1419df,_0x437b56){return db[_0x1495('0x2d')][_0x1495('0x53')]({'where':{'id':_0xb57724['params']['id']}})[_0x1495('0x23')](handleEntityNotFound(_0x1419df,null))['then'](function(_0xf5d456){if(_0xf5d456){return db['sequelize'][_0x1495('0x55')](function(_0x4a318a){return db['Interval'][_0x1495('0x24')]({'where':{'IntervalId':_0xb57724[_0x1495('0x50')]['id']},'transaction':_0x4a318a})[_0x1495('0x23')](function(_0x26da2d){var _0xcdf0d1=_[_0x1495('0x31')](_0xb57724[_0x1495('0x49')],function(_0x1f4a70){delete _0x1f4a70['id'];_0x1f4a70[_0x1495('0x51')]=_0xb57724[_0x1495('0x50')]['id'];return _0x1f4a70;});return db[_0x1495('0x2d')][_0x1495('0x56')](_0xcdf0d1,{'transaction':_0x4a318a});});})[_0x1495('0x23')](function(){return db[_0x1495('0x2d')][_0x1495('0x42')]({'where':{'IntervalId':_0xb57724[_0x1495('0x50')]['id']}});});}})[_0x1495('0x23')](respondWithResult(_0x1419df,null))[_0x1495('0x44')](handleError(_0x1419df,null));}; \ No newline at end of file +var _0xe2bc=['json','undefined','limit','offset','count','set','apply','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','fieldName','type','model','map','query','keys','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','getIntervals','findOne','hasOwnProperty','addIntervals','sequelize','IntervalId','bulkCreate','findAll','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','end'];(function(_0x508767,_0x369e53){var _0x2480fe=function(_0x25957e){while(--_0x25957e){_0x508767['push'](_0x508767['shift']());}};_0x2480fe(++_0x369e53);}(_0xe2bc,0x1e3));var _0xce2b=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xe2bc[_0x173441];return _0x2423a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce2b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce2b('0x1'));var rp=require(_0xce2b('0x2'));var moment=require(_0xce2b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xce2b('0x4'));var util=require(_0xce2b('0x5'));var path=require(_0xce2b('0x6'));var sox=require(_0xce2b('0x7'));var csv=require(_0xce2b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce2b('0x9'));var _=require(_0xce2b('0xa'));var squel=require(_0xce2b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xce2b('0xc'));var toCsv=require(_0xce2b('0x8'));var querystring=require('querystring');var Papa=require(_0xce2b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xce2b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xce2b('0xf'));var config=require(_0xce2b('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xce2b('0x11'))['db'];var extensions=require(_0xce2b('0x12'));function respondWithStatusCode(_0x105304,_0x37fef6){_0x37fef6=_0x37fef6||0xcc;return function(_0x4ec1dd){if(_0x4ec1dd){return _0x105304[_0xce2b('0x13')](_0x37fef6);}return _0x105304['status'](_0x37fef6)[_0xce2b('0x14')]();};}function respondWithResult(_0x23e649,_0x2cf103){_0x2cf103=_0x2cf103||0xc8;return function(_0x3fde50){if(_0x3fde50){return _0x23e649['status'](_0x2cf103)[_0xce2b('0x15')](_0x3fde50);}};}function respondWithFilteredResult(_0x531f06,_0x1937e2){return function(_0x3d4d76){if(_0x3d4d76){var _0x287e85=typeof _0x1937e2['offset']===_0xce2b('0x16')&&typeof _0x1937e2[_0xce2b('0x17')]===_0xce2b('0x16');var _0x177610=_0x3d4d76['count'];var _0x7fffb0=_0x287e85?0x0:_0x1937e2[_0xce2b('0x18')];var _0x22034b=_0x287e85?_0x3d4d76[_0xce2b('0x19')]:_0x1937e2[_0xce2b('0x18')]+_0x1937e2[_0xce2b('0x17')];var _0x1f60b8;if(_0x22034b>=_0x177610){_0x22034b=_0x177610;_0x1f60b8=0xc8;}else{_0x1f60b8=0xce;}_0x531f06['status'](_0x1f60b8);return _0x531f06[_0xce2b('0x1a')]('Content-Range',_0x7fffb0+'-'+_0x22034b+'/'+_0x177610)[_0xce2b('0x15')](_0x3d4d76);}return null;};}function patchUpdates(_0x45da13){return function(_0x3da8b3){try{jsonpatch[_0xce2b('0x1b')](_0x3da8b3,_0x45da13,!![]);}catch(_0x20f6e6){return BPromise['reject'](_0x20f6e6);}return _0x3da8b3['save']();};}function saveUpdates(_0x535e84,_0x2f9206){return function(_0x30514a){if(_0x30514a){return _0x30514a['update'](_0x535e84)[_0xce2b('0x1c')](function(_0x37ee4e){return _0x37ee4e;});}return null;};}function removeEntity(_0x301581,_0x159af8){return function(_0x1b5210){if(_0x1b5210){return _0x1b5210[_0xce2b('0x1d')]()[_0xce2b('0x1c')](function(){var _0x4184ec=_0x1b5210[_0xce2b('0x1e')]({'plain':!![]});var _0x379024=_0xce2b('0x1f');return db[_0xce2b('0x20')]['destroy']({'where':{'type':_0x379024,'resourceId':_0x4184ec['id']}})[_0xce2b('0x1c')](function(){return _0x1b5210;});})[_0xce2b('0x1c')](function(){_0x301581['status'](0xcc)[_0xce2b('0x14')]();});}};}function handleEntityNotFound(_0x22b51e,_0x456de2){return function(_0x21030e){if(!_0x21030e){_0x22b51e[_0xce2b('0x13')](0x194);}return _0x21030e;};}function handleError(_0x457b19,_0x1e2c19){_0x1e2c19=_0x1e2c19||0x1f4;return function(_0x4c16e2){logger[_0xce2b('0x21')](_0x4c16e2[_0xce2b('0x22')]);if(_0x4c16e2[_0xce2b('0x23')]){delete _0x4c16e2[_0xce2b('0x23')];}_0x457b19['status'](_0x1e2c19)[_0xce2b('0x24')](_0x4c16e2);};}exports[_0xce2b('0x25')]=function(_0x55cea5,_0x5ef181){var _0x4b650e={},_0x4356cf={},_0x3017b0={'count':0x0,'rows':[]};var _0x2bc9c5=_['map'](db[_0xce2b('0x26')][_0xce2b('0x27')],function(_0x212a05){return{'name':_0x212a05[_0xce2b('0x28')],'type':_0x212a05[_0xce2b('0x29')]['key']};});_0x4356cf[_0xce2b('0x2a')]=_[_0xce2b('0x2b')](_0x2bc9c5,_0xce2b('0x23'));_0x4356cf[_0xce2b('0x2c')]=_[_0xce2b('0x2d')](_0x55cea5['query']);_0x4356cf['filters']=_['intersection'](_0x4356cf[_0xce2b('0x2a')],_0x4356cf[_0xce2b('0x2c')]);_0x4b650e[_0xce2b('0x2e')]=_['intersection'](_0x4356cf['model'],qs[_0xce2b('0x2f')](_0x55cea5['query'][_0xce2b('0x2f')]));_0x4b650e['attributes']=_0x4b650e[_0xce2b('0x2e')][_0xce2b('0x30')]?_0x4b650e[_0xce2b('0x2e')]:_0x4356cf['model'];if(!_0x55cea5['query']['hasOwnProperty'](_0xce2b('0x31'))){_0x4b650e['limit']=qs['limit'](_0x55cea5[_0xce2b('0x2c')]['limit']);_0x4b650e[_0xce2b('0x18')]=qs[_0xce2b('0x18')](_0x55cea5['query']['offset']);}_0x4b650e[_0xce2b('0x32')]=qs[_0xce2b('0x33')](_0x55cea5[_0xce2b('0x2c')][_0xce2b('0x33')]);_0x4b650e[_0xce2b('0x34')]=qs[_0xce2b('0x35')](_[_0xce2b('0x36')](_0x55cea5[_0xce2b('0x2c')],_0x4356cf['filters']),_0x2bc9c5);if(_0x55cea5[_0xce2b('0x2c')][_0xce2b('0x37')]){_0x4b650e[_0xce2b('0x34')]=_[_0xce2b('0x38')](_0x4b650e[_0xce2b('0x34')],{'$or':_[_0xce2b('0x2b')](_0x2bc9c5,function(_0x2e52d5){if(_0x2e52d5[_0xce2b('0x29')]!==_0xce2b('0x39')){var _0x10e1fe={};_0x10e1fe[_0x2e52d5['name']]={'$like':'%'+_0x55cea5['query'][_0xce2b('0x37')]+'%'};return _0x10e1fe;}})});}_0x4b650e=_[_0xce2b('0x38')]({},_0x4b650e,_0x55cea5[_0xce2b('0x3a')]);var _0x518e03={'where':_0x4b650e[_0xce2b('0x34')]};return db['Interval']['count'](_0x518e03)['then'](function(_0x2645a1){_0x3017b0['count']=_0x2645a1;if(_0x55cea5[_0xce2b('0x2c')][_0xce2b('0x3b')]){_0x4b650e[_0xce2b('0x3c')]=[{'all':!![]}];}return db[_0xce2b('0x26')]['findAll'](_0x4b650e);})[_0xce2b('0x1c')](function(_0x2b4bd8){_0x3017b0['rows']=_0x2b4bd8;return _0x3017b0;})[_0xce2b('0x1c')](respondWithFilteredResult(_0x5ef181,_0x4b650e))[_0xce2b('0x3d')](handleError(_0x5ef181,null));};exports[_0xce2b('0x3e')]=function(_0xd310a1,_0x5e4cb5){var _0xe52d97={'raw':!![],'where':{'id':_0xd310a1[_0xce2b('0x3f')]['id']}},_0x16e125={};_0x16e125[_0xce2b('0x2a')]=_[_0xce2b('0x2d')](db[_0xce2b('0x26')][_0xce2b('0x27')]);_0x16e125[_0xce2b('0x2c')]=_[_0xce2b('0x2d')](_0xd310a1[_0xce2b('0x2c')]);_0x16e125[_0xce2b('0x35')]=_[_0xce2b('0x40')](_0x16e125[_0xce2b('0x2a')],_0x16e125['query']);_0xe52d97[_0xce2b('0x2e')]=_[_0xce2b('0x40')](_0x16e125['model'],qs[_0xce2b('0x2f')](_0xd310a1[_0xce2b('0x2c')][_0xce2b('0x2f')]));_0xe52d97[_0xce2b('0x2e')]=_0xe52d97['attributes'][_0xce2b('0x30')]?_0xe52d97[_0xce2b('0x2e')]:_0x16e125[_0xce2b('0x2a')];if(_0xd310a1['query']['includeAll']){_0xe52d97[_0xce2b('0x3c')]=[{'all':!![]}];}_0xe52d97=_[_0xce2b('0x38')]({},_0xe52d97,_0xd310a1[_0xce2b('0x3a')]);return db[_0xce2b('0x26')][_0xce2b('0x41')](_0xe52d97)['then'](handleEntityNotFound(_0x5e4cb5,null))[_0xce2b('0x1c')](respondWithResult(_0x5e4cb5,null))[_0xce2b('0x3d')](handleError(_0x5e4cb5,null));};exports[_0xce2b('0x42')]=function(_0x138613,_0x1552c8){return db[_0xce2b('0x26')][_0xce2b('0x42')](_0x138613[_0xce2b('0x43')],{})[_0xce2b('0x1c')](function(_0x1da9b1){var _0x35d690=_0x138613[_0xce2b('0x44')][_0xce2b('0x1e')]({'plain':!![]});if(!_0x35d690)throw new Error(_0xce2b('0x45'));if(_0x35d690[_0xce2b('0x46')]==='user'){var _0x41d6e1=_0x1da9b1['get']({'plain':!![]});var _0x193004='Intervals';return db[_0xce2b('0x47')][_0xce2b('0x41')]({'where':{'name':_0x193004,'userProfileId':_0x35d690['userProfileId']},'raw':!![]})[_0xce2b('0x1c')](function(_0x75d180){if(_0x75d180&&_0x75d180[_0xce2b('0x48')]===0x0){return db[_0xce2b('0x20')][_0xce2b('0x42')]({'name':_0x41d6e1['name'],'resourceId':_0x41d6e1['id'],'type':_0x75d180['name'],'sectionId':_0x75d180['id']},{})[_0xce2b('0x1c')](function(){return _0x1da9b1;});}else{return _0x1da9b1;}})[_0xce2b('0x3d')](function(_0x47573f){logger[_0xce2b('0x21')](_0xce2b('0x49'),_0x47573f);throw _0x47573f;});}return _0x1da9b1;})[_0xce2b('0x1c')](respondWithResult(_0x1552c8,0xc9))[_0xce2b('0x3d')](handleError(_0x1552c8,null));};exports[_0xce2b('0x4a')]=function(_0x4296e9,_0x277360){if(_0x4296e9[_0xce2b('0x43')]['id']){delete _0x4296e9[_0xce2b('0x43')]['id'];}return db['Interval']['find']({'where':{'id':_0x4296e9[_0xce2b('0x3f')]['id']}})[_0xce2b('0x1c')](handleEntityNotFound(_0x277360,null))[_0xce2b('0x1c')](saveUpdates(_0x4296e9[_0xce2b('0x43')],null))['then'](respondWithResult(_0x277360,null))[_0xce2b('0x3d')](handleError(_0x277360,null));};exports[_0xce2b('0x1d')]=function(_0x4d64a1,_0x379415){return db[_0xce2b('0x26')][_0xce2b('0x41')]({'where':{'id':_0x4d64a1[_0xce2b('0x3f')]['id']}})[_0xce2b('0x1c')](handleEntityNotFound(_0x379415,null))[_0xce2b('0x1c')](removeEntity(_0x379415,null))[_0xce2b('0x3d')](handleError(_0x379415,null));};exports[_0xce2b('0x4b')]=function(_0xd4e2c9,_0xa3628d,_0x23a6d6){if(_0xd4e2c9[_0xce2b('0x43')]['id']){delete _0xd4e2c9[_0xce2b('0x43')]['id'];}return db['Interval'][_0xce2b('0x41')]({'where':{'id':_0xd4e2c9['params']['id']}})[_0xce2b('0x1c')](handleEntityNotFound(_0xa3628d,null))['then'](function(_0x117dbc){if(_0x117dbc){_0xd4e2c9[_0xce2b('0x43')]['IntervalId']=_0x117dbc['id'];return db[_0xce2b('0x26')][_0xce2b('0x42')](_0xd4e2c9[_0xce2b('0x43')]);}})[_0xce2b('0x1c')](respondWithResult(_0xa3628d,null))[_0xce2b('0x3d')](handleError(_0xa3628d,null));};exports[_0xce2b('0x4c')]=function(_0x2b1fa7,_0x217bef,_0xb22a0){var _0x55825e={};var _0x189346={};var _0x56d1b8;var _0x22170f;return db[_0xce2b('0x26')][_0xce2b('0x4d')]({'where':{'id':_0x2b1fa7[_0xce2b('0x3f')]['id']}})[_0xce2b('0x1c')](handleEntityNotFound(_0x217bef,null))[_0xce2b('0x1c')](function(_0x22202d){if(_0x22202d){_0x56d1b8=_0x22202d;_0x189346[_0xce2b('0x2a')]=_['keys'](db[_0xce2b('0x26')][_0xce2b('0x27')]);_0x189346[_0xce2b('0x2c')]=_[_0xce2b('0x2d')](_0x2b1fa7[_0xce2b('0x2c')]);_0x189346[_0xce2b('0x35')]=_[_0xce2b('0x40')](_0x189346[_0xce2b('0x2a')],_0x189346[_0xce2b('0x2c')]);_0x55825e[_0xce2b('0x2e')]=_[_0xce2b('0x40')](_0x189346[_0xce2b('0x2a')],qs[_0xce2b('0x2f')](_0x2b1fa7[_0xce2b('0x2c')][_0xce2b('0x2f')]));_0x55825e[_0xce2b('0x2e')]=_0x55825e[_0xce2b('0x2e')][_0xce2b('0x30')]?_0x55825e['attributes']:_0x189346[_0xce2b('0x2a')];_0x55825e[_0xce2b('0x32')]=qs[_0xce2b('0x33')](_0x2b1fa7[_0xce2b('0x2c')]['sort']);_0x55825e[_0xce2b('0x34')]=qs[_0xce2b('0x35')](_[_0xce2b('0x36')](_0x2b1fa7['query'],_0x189346[_0xce2b('0x35')]));if(_0x2b1fa7['query']['filter']){_0x55825e[_0xce2b('0x34')]=_[_0xce2b('0x38')](_0x55825e['where'],{'$or':_[_0xce2b('0x2b')](_0x55825e['attributes'],function(_0x599d8f){var _0x1f2460={};_0x1f2460[_0x599d8f]={'$like':'%'+_0x2b1fa7[_0xce2b('0x2c')][_0xce2b('0x37')]+'%'};return _0x1f2460;})});}_0x55825e=_[_0xce2b('0x38')]({},_0x55825e,_0x2b1fa7[_0xce2b('0x3a')]);return _0x56d1b8[_0xce2b('0x4c')](_0x55825e);}})[_0xce2b('0x1c')](function(_0x3b996d){if(_0x3b996d){_0x22170f=_0x3b996d[_0xce2b('0x30')];if(!_0x2b1fa7[_0xce2b('0x2c')][_0xce2b('0x4e')](_0xce2b('0x31'))){_0x55825e[_0xce2b('0x17')]=qs[_0xce2b('0x17')](_0x2b1fa7[_0xce2b('0x2c')][_0xce2b('0x17')]);_0x55825e[_0xce2b('0x18')]=qs[_0xce2b('0x18')](_0x2b1fa7[_0xce2b('0x2c')][_0xce2b('0x18')]);}return _0x56d1b8[_0xce2b('0x4c')](_0x55825e);}})[_0xce2b('0x1c')](function(_0x452196){if(_0x452196){return _0x452196?{'count':_0x22170f,'rows':_0x452196}:null;}})[_0xce2b('0x1c')](respondWithResult(_0x217bef,null))[_0xce2b('0x3d')](handleError(_0x217bef,null));};exports[_0xce2b('0x4f')]=function(_0x1b9176,_0x7e986b,_0x1977e1){return db[_0xce2b('0x26')][_0xce2b('0x4d')]({'where':{'id':_0x1b9176[_0xce2b('0x3f')]['id']}})[_0xce2b('0x1c')](handleEntityNotFound(_0x7e986b,null))[_0xce2b('0x1c')](function(_0x551465){if(_0x551465){return db[_0xce2b('0x50')]['transaction'](function(_0x3475bf){return db['Interval'][_0xce2b('0x1d')]({'where':{'IntervalId':_0x1b9176[_0xce2b('0x3f')]['id']},'transaction':_0x3475bf})[_0xce2b('0x1c')](function(_0x1c54ce){var _0x38ae9b=_['map'](_0x1b9176[_0xce2b('0x43')],function(_0x3235df){delete _0x3235df['id'];_0x3235df[_0xce2b('0x51')]=_0x1b9176['params']['id'];return _0x3235df;});return db[_0xce2b('0x26')][_0xce2b('0x52')](_0x38ae9b,{'transaction':_0x3475bf});});})['then'](function(){return db[_0xce2b('0x26')][_0xce2b('0x53')]({'where':{'IntervalId':_0x1b9176[_0xce2b('0x3f')]['id']}});});}})['then'](respondWithResult(_0x7e986b,null))[_0xce2b('0x3d')](handleError(_0x7e986b,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 03c1adb..ad68142 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 _0x3bf0=['moment','bluebird','request-promise','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','lodash','util','../../config/logger','api'];(function(_0x5a3548,_0x493765){var _0x291237=function(_0x5eb634){while(--_0x5eb634){_0x5a3548['push'](_0x5a3548['shift']());}};_0x291237(++_0x493765);}(_0x3bf0,0x83));var _0x03bf=function(_0x231d50,_0x31c43c){_0x231d50=_0x231d50-0x0;var _0x22a105=_0x3bf0[_0x231d50];return _0x22a105;};'use strict';var _=require(_0x03bf('0x0'));var util=require(_0x03bf('0x1'));var logger=require(_0x03bf('0x2'))(_0x03bf('0x3'));var moment=require(_0x03bf('0x4'));var BPromise=require(_0x03bf('0x5'));var rp=require(_0x03bf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03bf('0x7'));var config=require(_0x03bf('0x8'));var attributes=require(_0x03bf('0x9'));var extensions=require(_0x03bf('0xa'));module[_0x03bf('0xb')]=function(_0x534e38,_0x2c37c7){return _0x534e38[_0x03bf('0xc')]('Interval',attributes,{'tableName':_0x03bf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x143717,_0x151297){extensions['rewrite'](_0x534e38,_0x143717);},'afterBulkCreate':function(_0x126981,_0x3ddbb8,_0x3946e5){_0x3946e5();extensions[_0x03bf('0xe')](_0x534e38,_0x126981[0x0]);},'afterUpdate':function(_0x374024,_0xee1a5e){extensions[_0x03bf('0xe')](_0x534e38,_0x374024);},'afterDestroy':function(_0x33152f,_0x325495){extensions[_0x03bf('0xe')](_0x534e38,_0x33152f);}}});}; \ No newline at end of file +var _0x7a16=['../../config/environment','./interval.attributes','../../components/extensions/rewrite','tools_intervals','rewrite','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x513cfc,_0x44f40b){var _0x272aaf=function(_0x119bfb){while(--_0x119bfb){_0x513cfc['push'](_0x513cfc['shift']());}};_0x272aaf(++_0x44f40b);}(_0x7a16,0x171));var _0x67a1=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7a16[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x67a1('0x0'));var util=require('util');var logger=require(_0x67a1('0x1'))(_0x67a1('0x2'));var moment=require(_0x67a1('0x3'));var BPromise=require(_0x67a1('0x4'));var rp=require(_0x67a1('0x5'));var fs=require('fs');var path=require(_0x67a1('0x6'));var rimraf=require(_0x67a1('0x7'));var config=require(_0x67a1('0x8'));var attributes=require(_0x67a1('0x9'));var extensions=require(_0x67a1('0xa'));module['exports']=function(_0x216e3f,_0x5abca4){return _0x216e3f['define']('Interval',attributes,{'tableName':_0x67a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x245dbd,_0x84e851){extensions[_0x67a1('0xc')](_0x216e3f,_0x245dbd);},'afterBulkCreate':function(_0x3a7a51,_0xdeacb5,_0x55b78f){_0x55b78f();extensions[_0x67a1('0xc')](_0x216e3f,_0x3a7a51[0x0]);},'afterUpdate':function(_0x270047,_0x5a8c45){extensions[_0x67a1('0xc')](_0x216e3f,_0x270047);},'afterDestroy':function(_0x1f3958,_0x5dbeae){extensions[_0x67a1('0xc')](_0x216e3f,_0x1f3958);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 83c20b3..2aa943b 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(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 0a1b424..510a3ea 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x0b0e,0x187));var _0xe0b0=function(_0x319fc1,_0x29179b){_0x319fc1=_0x319fc1-0x0;var _0xb768af=_0x0b0e[_0x319fc1];return _0xb768af;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x274a9a,_0x46eb7d){var _0x1d5e4e=function(_0x4d56d6){while(--_0x4d56d6){_0x274a9a['push'](_0x274a9a['shift']());}};_0x1d5e4e(++_0x46eb7d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3e478c,_0x3afee8){_0x3e478c=_0x3e478c-0x0;var _0x3a0906=_0x5f2f[_0x3e478c];return _0x3a0906;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 5ccae3c..b277bc3 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 _0x6be6=['Report','\x20from\x20','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','name','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','status','statusCode','json','parse','error','api.jira','end','openIssue','send','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','summary'];(function(_0x3ecc30,_0x75412b){var _0x2682bc=function(_0x34c384){while(--_0x34c384){_0x3ecc30['push'](_0x3ecc30['shift']());}};_0x2682bc(++_0x75412b);}(_0x6be6,0x16a));var _0x66be=function(_0x5a3bca,_0x49a660){_0x5a3bca=_0x5a3bca-0x0;var _0x4b8b33=_0x6be6[_0x5a3bca];return _0x4b8b33;};'use strict';var BPromise=require(_0x66be('0x0'));var https=require('https');var logger=require(_0x66be('0x1'))('api');var USERNAME=_0x66be('0x2');var PASSWORD=_0x66be('0x3');function openIssue(_0x5c44bb,_0x9b4954){var _0x26aa23={'fields':{'project':{'key':_0x5c44bb[_0x66be('0x4')]||_0x66be('0x5')},'summary':(_0x5c44bb[_0x66be('0x6')]||_0x66be('0x7'))+_0x66be('0x8')+_0x5c44bb['ip'],'description':_0x5c44bb['description']||JSON[_0x66be('0x9')](_0x5c44bb),'issuetype':{'name':_0x5c44bb[_0x66be('0xa')]||_0x66be('0xb')}}};_0x26aa23[_0x66be('0xc')][_0x66be('0xd')]=_0x5c44bb[_0x66be('0xe')];_0x26aa23[_0x66be('0xc')][_0x66be('0xf')]=_0x5c44bb['oldToken'];_0x26aa23[_0x66be('0xc')][_0x66be('0x10')]=_0x5c44bb[_0x66be('0x11')];_0x26aa23['fields']['customfield_11503']=_0x5c44bb[_0x66be('0x12')];_0x26aa23[_0x66be('0xc')]['customfield_11504']=_0x5c44bb['reason'];_0x26aa23[_0x66be('0xc')][_0x66be('0x13')]=_0x5c44bb['ip'];var _0x178a31={'host':_0x66be('0x14'),'port':0x1bb,'path':_0x66be('0x15'),'method':_0x66be('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x66be('0x17'),'Authorization':_0x66be('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x66be('0x19')](_0x66be('0x1a'))}};var _0x4f7971=JSON[_0x66be('0x9')](_0x26aa23);var _0x31511c=https['request'](_0x178a31,function(_0x4262fb){_0x4262fb['setEncoding']('utf8');var _0x22bd19='';_0x4262fb['on']('data',function(_0x5c8dd9){_0x22bd19+=_0x5c8dd9;});_0x4262fb['on']('end',function(){if(_0x9b4954){return _0x9b4954[_0x66be('0x1b')](_0x4262fb[_0x66be('0x1c')])[_0x66be('0x1d')](JSON[_0x66be('0x1e')](_0x22bd19));}});});_0x31511c['on'](_0x66be('0x1f'),function(_0x438d8f){if(_0x9b4954){return _0x9b4954[_0x66be('0x1b')](0x1f4)[_0x66be('0x1d')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x66be('0x20')}]});}});_0x31511c['write'](_0x4f7971);_0x31511c[_0x66be('0x21')]();}exports[_0x66be('0x22')]=openIssue;exports[_0x66be('0x23')]=function(_0x85db25,_0x2e51bc){_0x85db25['body']['ip']=_0x85db25['headers'][_0x66be('0x24')]||_0x85db25[_0x66be('0x25')][_0x66be('0x26')]||_0x85db25[_0x66be('0x27')][_0x66be('0x26')]||_0x85db25[_0x66be('0x25')][_0x66be('0x27')][_0x66be('0x26')];return openIssue(_0x85db25[_0x66be('0x28')],_0x2e51bc);}; \ No newline at end of file +var _0x6024=['error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','headers','x-forwarded-for','connection','remoteAddress','socket','body','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','stringify','Bug','fields','customfield_11500','email','customfield_11502','newToken','customfield_11503','name','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','data','status','statusCode','json','parse'];(function(_0x5e71c5,_0x45d15b){var _0x26885b=function(_0x1ced42){while(--_0x1ced42){_0x5e71c5['push'](_0x5e71c5['shift']());}};_0x26885b(++_0x45d15b);}(_0x6024,0x147));var _0x4602=function(_0x2d4725,_0x37e2e9){_0x2d4725=_0x2d4725-0x0;var _0x24858a=_0x6024[_0x2d4725];return _0x24858a;};'use strict';var BPromise=require('bluebird');var https=require(_0x4602('0x0'));var logger=require('../../config/logger')(_0x4602('0x1'));var USERNAME=_0x4602('0x2');var PASSWORD=_0x4602('0x3');function openIssue(_0x150a8e,_0x562ac8){var _0x5bb9ee={'fields':{'project':{'key':_0x150a8e[_0x4602('0x4')]||_0x4602('0x5')},'summary':(_0x150a8e[_0x4602('0x6')]||_0x4602('0x7'))+_0x4602('0x8')+_0x150a8e['ip'],'description':_0x150a8e['description']||JSON[_0x4602('0x9')](_0x150a8e),'issuetype':{'name':_0x150a8e['issuetype']||_0x4602('0xa')}}};_0x5bb9ee[_0x4602('0xb')][_0x4602('0xc')]=_0x150a8e[_0x4602('0xd')];_0x5bb9ee[_0x4602('0xb')]['customfield_11501']=_0x150a8e['oldToken'];_0x5bb9ee['fields'][_0x4602('0xe')]=_0x150a8e[_0x4602('0xf')];_0x5bb9ee[_0x4602('0xb')][_0x4602('0x10')]=_0x150a8e[_0x4602('0x11')];_0x5bb9ee[_0x4602('0xb')]['customfield_11504']=_0x150a8e['reason'];_0x5bb9ee[_0x4602('0xb')][_0x4602('0x12')]=_0x150a8e['ip'];var _0x347b50={'host':_0x4602('0x13'),'port':0x1bb,'path':_0x4602('0x14'),'method':_0x4602('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x4602('0x16'),'Authorization':_0x4602('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x4602('0x18')](_0x4602('0x19'))}};var _0x58fb41=JSON[_0x4602('0x9')](_0x5bb9ee);var _0x275485=https[_0x4602('0x1a')](_0x347b50,function(_0x592443){_0x592443[_0x4602('0x1b')]('utf8');var _0x150f30='';_0x592443['on'](_0x4602('0x1c'),function(_0x1dc0c5){_0x150f30+=_0x1dc0c5;});_0x592443['on']('end',function(){if(_0x562ac8){return _0x562ac8[_0x4602('0x1d')](_0x592443[_0x4602('0x1e')])[_0x4602('0x1f')](JSON[_0x4602('0x20')](_0x150f30));}});});_0x275485['on'](_0x4602('0x21'),function(_0x3c0bf7){if(_0x562ac8){return _0x562ac8[_0x4602('0x1d')](0x1f4)[_0x4602('0x1f')]({'errors':[{'message':_0x4602('0x22'),'type':_0x4602('0x23')}]});}});_0x275485[_0x4602('0x24')](_0x58fb41);_0x275485['end']();}exports[_0x4602('0x25')]=openIssue;exports[_0x4602('0x26')]=function(_0x100fd4,_0x7a445e){_0x100fd4['body']['ip']=_0x100fd4[_0x4602('0x27')][_0x4602('0x28')]||_0x100fd4[_0x4602('0x29')][_0x4602('0x2a')]||_0x100fd4['socket']['remoteAddress']||_0x100fd4[_0x4602('0x29')][_0x4602('0x2b')]['remoteAddress'];return openIssue(_0x100fd4[_0x4602('0x2c')],_0x7a445e);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 85230be..51d26a3 100644 --- a/server/api/jscriptyAnswerReport/index.js +++ b/server/api/jscriptyAnswerReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put'];(function(_0x3a069b,_0x587a1c){var _0x15d113=function(_0x3a50df){while(--_0x3a50df){_0x3a069b['push'](_0x3a069b['shift']());}};_0x15d113(++_0x587a1c);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0xe')]('/:id',auth[_0x49c4('0x7')](),controller[_0x49c4('0xf')]);router['delete']('/:id',auth[_0x49c4('0x7')](),controller[_0x49c4('0x10')]);module['exports']=router; \ No newline at end of file +var _0xec56=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x2f5179,_0x526005){var _0x3acd21=function(_0x4b2a0c){while(--_0x4b2a0c){_0x2f5179['push'](_0x2f5179['shift']());}};_0x3acd21(++_0x526005);}(_0xec56,0x1bd));var _0x6ec5=function(_0x97afca,_0x28eedf){_0x97afca=_0x97afca-0x0;var _0x39550e=_0xec56[_0x97afca];return _0x39550e;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['post']('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x10')]);router[_0x6ec5('0x11')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x12')]);router[_0x6ec5('0x13')]('/:id',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x14')]);module[_0x6ec5('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 2d1a7ca..b356ebc 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(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x7a54,0x106));var _0x47a5=function(_0x17fd76,_0x201219){_0x17fd76=_0x17fd76-0x0;var _0x2dff17=_0x7a54[_0x17fd76];return _0x2dff17;};'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(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x7a54,0x106));var _0x47a5=function(_0x2cf31a,_0x58edab){_0x2cf31a=_0x2cf31a-0x0;var _0x444ccc=_0x7a54[_0x2cf31a];return _0x444ccc;};'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 046ca06..fc2abdb 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 _0x975b=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','length','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x188a57,_0x3f7985){var _0x4800c0=function(_0x2fb34a){while(--_0x2fb34a){_0x188a57['push'](_0x188a57['shift']());}};_0x4800c0(++_0x3f7985);}(_0x975b,0x1c9));var _0xb975=function(_0x45a6fe,_0xa15083){_0x45a6fe=_0x45a6fe-0x0;var _0x50ab33=_0x975b[_0x45a6fe];return _0x50ab33;};'use strict';var emlformat=require(_0xb975('0x0'));var rimraf=require(_0xb975('0x1'));var zipdir=require(_0xb975('0x2'));var jsonpatch=require(_0xb975('0x3'));var rp=require(_0xb975('0x4'));var moment=require(_0xb975('0x5'));var BPromise=require(_0xb975('0x6'));var Mustache=require('mustache');var util=require(_0xb975('0x7'));var path=require(_0xb975('0x8'));var sox=require(_0xb975('0x9'));var csv=require(_0xb975('0xa'));var ejs=require(_0xb975('0xb'));var fs=require('fs');var fs_extra=require(_0xb975('0xc'));var _=require(_0xb975('0xd'));var squel=require('squel');var crypto=require(_0xb975('0xe'));var jsforce=require(_0xb975('0xf'));var deskjs=require(_0xb975('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb975('0x11'));var Papa=require(_0xb975('0x12'));var Redis=require(_0xb975('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb975('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb975('0x15'));var logger=require('../../config/logger')(_0xb975('0x16'));var utils=require('../../config/utils');var config=require(_0xb975('0x17'));var licenseUtil=require(_0xb975('0x18'));var db=require(_0xb975('0x19'))['db'];function respondWithStatusCode(_0x1c4b77,_0x13ca28){_0x13ca28=_0x13ca28||0xcc;return function(_0x558727){if(_0x558727){return _0x1c4b77[_0xb975('0x1a')](_0x13ca28);}return _0x1c4b77[_0xb975('0x1b')](_0x13ca28)[_0xb975('0x1c')]();};}function respondWithResult(_0x24919e,_0x5cea50){_0x5cea50=_0x5cea50||0xc8;return function(_0x470ead){if(_0x470ead){return _0x24919e[_0xb975('0x1b')](_0x5cea50)[_0xb975('0x1d')](_0x470ead);}};}function respondWithFilteredResult(_0x4b1ede,_0x24f8ec){return function(_0x3da9e9){if(_0x3da9e9){var _0x36d959=typeof _0x24f8ec['offset']===_0xb975('0x1e')&&typeof _0x24f8ec['limit']===_0xb975('0x1e');var _0x34e062=_0x3da9e9[_0xb975('0x1f')];var _0x347a04=_0x36d959?0x0:_0x24f8ec[_0xb975('0x20')];var _0x327728=_0x36d959?_0x3da9e9[_0xb975('0x1f')]:_0x24f8ec['offset']+_0x24f8ec['limit'];var _0x2abb84;if(_0x327728>=_0x34e062){_0x327728=_0x34e062;_0x2abb84=0xc8;}else{_0x2abb84=0xce;}_0x4b1ede[_0xb975('0x1b')](_0x2abb84);return _0x4b1ede[_0xb975('0x21')](_0xb975('0x22'),_0x347a04+'-'+_0x327728+'/'+_0x34e062)['json'](_0x3da9e9);}return null;};}function patchUpdates(_0x39af85){return function(_0x49adfa){try{jsonpatch[_0xb975('0x23')](_0x49adfa,_0x39af85,!![]);}catch(_0x3f0876){return BPromise[_0xb975('0x24')](_0x3f0876);}return _0x49adfa['save']();};}function saveUpdates(_0xe7a5f0,_0x493c0b){return function(_0x5d1312){if(_0x5d1312){return _0x5d1312[_0xb975('0x25')](_0xe7a5f0)[_0xb975('0x26')](function(_0x226f21){return _0x226f21;});}return null;};}function removeEntity(_0xa4d4c,_0x35dcc6){return function(_0x5620fc){if(_0x5620fc){return _0x5620fc[_0xb975('0x27')]()['then'](function(){_0xa4d4c[_0xb975('0x1b')](0xcc)[_0xb975('0x1c')]();});}};}function handleEntityNotFound(_0xc0d861,_0x263f73){return function(_0x5309c6){if(!_0x5309c6){_0xc0d861[_0xb975('0x1a')](0x194);}return _0x5309c6;};}function handleError(_0x2824bf,_0x41905e){_0x41905e=_0x41905e||0x1f4;return function(_0xed596){logger['error'](_0xed596[_0xb975('0x28')]);if(_0xed596[_0xb975('0x29')]){delete _0xed596[_0xb975('0x29')];}_0x2824bf[_0xb975('0x1b')](_0x41905e)[_0xb975('0x2a')](_0xed596);};}exports[_0xb975('0x2b')]=function(_0x442bc6,_0x135cc9){var _0x2d730d={},_0x514451={},_0x2b1319={'count':0x0,'rows':[]};var _0x2b3ec2=_[_0xb975('0x2c')](db[_0xb975('0x2d')][_0xb975('0x2e')],function(_0x3bd5cb){return{'name':_0x3bd5cb[_0xb975('0x2f')],'type':_0x3bd5cb[_0xb975('0x30')][_0xb975('0x31')]};});_0x514451[_0xb975('0x32')]=_[_0xb975('0x2c')](_0x2b3ec2,'name');_0x514451[_0xb975('0x33')]=_['keys'](_0x442bc6['query']);_0x514451[_0xb975('0x34')]=_['intersection'](_0x514451[_0xb975('0x32')],_0x514451[_0xb975('0x33')]);_0x2d730d['attributes']=_[_0xb975('0x35')](_0x514451['model'],qs[_0xb975('0x36')](_0x442bc6[_0xb975('0x33')][_0xb975('0x36')]));_0x2d730d[_0xb975('0x37')]=_0x2d730d[_0xb975('0x37')]['length']?_0x2d730d[_0xb975('0x37')]:_0x514451['model'];if(!_0x442bc6['query'][_0xb975('0x38')](_0xb975('0x39'))){_0x2d730d[_0xb975('0x3a')]=qs[_0xb975('0x3a')](_0x442bc6[_0xb975('0x33')][_0xb975('0x3a')]);_0x2d730d[_0xb975('0x20')]=qs[_0xb975('0x20')](_0x442bc6['query'][_0xb975('0x20')]);}_0x2d730d[_0xb975('0x3b')]=qs['sort'](_0x442bc6[_0xb975('0x33')][_0xb975('0x3c')]);_0x2d730d[_0xb975('0x3d')]=qs[_0xb975('0x34')](_[_0xb975('0x3e')](_0x442bc6[_0xb975('0x33')],_0x514451[_0xb975('0x34')]),_0x2b3ec2);if(_0x442bc6['query'][_0xb975('0x3f')]){_0x2d730d['where']=_[_0xb975('0x40')](_0x2d730d[_0xb975('0x3d')],{'$or':_['map'](_0x2b3ec2,function(_0x2341e6){if(_0x2341e6['type']!==_0xb975('0x41')){var _0x378e54={};_0x378e54[_0x2341e6[_0xb975('0x29')]]={'$like':'%'+_0x442bc6[_0xb975('0x33')][_0xb975('0x3f')]+'%'};return _0x378e54;}})});}_0x2d730d=_[_0xb975('0x40')]({},_0x2d730d,_0x442bc6[_0xb975('0x42')]);var _0x2781ab={'where':_0x2d730d['where']};return db[_0xb975('0x2d')][_0xb975('0x1f')](_0x2781ab)[_0xb975('0x26')](function(_0x562e0d){_0x2b1319['count']=_0x562e0d;if(_0x442bc6[_0xb975('0x33')][_0xb975('0x43')]){_0x2d730d[_0xb975('0x44')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x2d730d);})[_0xb975('0x26')](function(_0x335011){_0x2b1319[_0xb975('0x45')]=_0x335011;return _0x2b1319;})[_0xb975('0x26')](respondWithFilteredResult(_0x135cc9,_0x2d730d))['catch'](handleError(_0x135cc9,null));};exports[_0xb975('0x46')]=function(_0x17d594,_0xe5c7e7){var _0x160e58={'raw':!![],'where':{'id':_0x17d594[_0xb975('0x47')]['id']}},_0x55f550={};_0x55f550[_0xb975('0x32')]=_['keys'](db['JscriptyAnswerReport'][_0xb975('0x2e')]);_0x55f550['query']=_['keys'](_0x17d594[_0xb975('0x33')]);_0x55f550['filters']=_[_0xb975('0x35')](_0x55f550[_0xb975('0x32')],_0x55f550['query']);_0x160e58[_0xb975('0x37')]=_[_0xb975('0x35')](_0x55f550[_0xb975('0x32')],qs[_0xb975('0x36')](_0x17d594[_0xb975('0x33')]['fields']));_0x160e58[_0xb975('0x37')]=_0x160e58[_0xb975('0x37')][_0xb975('0x48')]?_0x160e58['attributes']:_0x55f550[_0xb975('0x32')];if(_0x17d594[_0xb975('0x33')][_0xb975('0x43')]){_0x160e58['include']=[{'all':!![]}];}_0x160e58=_[_0xb975('0x40')]({},_0x160e58,_0x17d594[_0xb975('0x42')]);return db[_0xb975('0x2d')][_0xb975('0x49')](_0x160e58)['then'](handleEntityNotFound(_0xe5c7e7,null))['then'](respondWithResult(_0xe5c7e7,null))['catch'](handleError(_0xe5c7e7,null));};exports[_0xb975('0x4a')]=function(_0x4483ba,_0x15bc77){return db[_0xb975('0x2d')][_0xb975('0x4a')](_0x4483ba[_0xb975('0x4b')],{})[_0xb975('0x26')](respondWithResult(_0x15bc77,0xc9))[_0xb975('0x4c')](handleError(_0x15bc77,null));};exports[_0xb975('0x25')]=function(_0x466251,_0x1a3268){if(_0x466251['body']['id']){delete _0x466251[_0xb975('0x4b')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x466251['params']['id']}})[_0xb975('0x26')](handleEntityNotFound(_0x1a3268,null))[_0xb975('0x26')](saveUpdates(_0x466251['body'],null))[_0xb975('0x26')](respondWithResult(_0x1a3268,null))[_0xb975('0x4c')](handleError(_0x1a3268,null));};exports[_0xb975('0x27')]=function(_0x22743c,_0x1f9544){return db[_0xb975('0x2d')][_0xb975('0x49')]({'where':{'id':_0x22743c[_0xb975('0x47')]['id']}})[_0xb975('0x26')](handleEntityNotFound(_0x1f9544,null))['then'](removeEntity(_0x1f9544,null))['catch'](handleError(_0x1f9544,null));};exports['describe']=function(_0x3cedf9,_0x1a1f97){return db['JscriptyAnswerReport'][_0xb975('0x4d')]()[_0xb975('0x26')](respondWithResult(_0x1a1f97,null))[_0xb975('0x4c')](handleError(_0x1a1f97,null));}; \ No newline at end of file +var _0xfd7b=['stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','key','keys','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','reject','update','then','destroy','end','error'];(function(_0x1763d5,_0x3c874f){var _0x58c751=function(_0x2ed378){while(--_0x2ed378){_0x1763d5['push'](_0x1763d5['shift']());}};_0x58c751(++_0x3c874f);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xfd7b[_0x369151];return _0x4292d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbfd7('0x0'));var zipdir=require(_0xbfd7('0x1'));var jsonpatch=require(_0xbfd7('0x2'));var rp=require(_0xbfd7('0x3'));var moment=require(_0xbfd7('0x4'));var BPromise=require(_0xbfd7('0x5'));var Mustache=require(_0xbfd7('0x6'));var util=require(_0xbfd7('0x7'));var path=require(_0xbfd7('0x8'));var sox=require(_0xbfd7('0x9'));var csv=require(_0xbfd7('0xa'));var ejs=require(_0xbfd7('0xb'));var fs=require('fs');var fs_extra=require(_0xbfd7('0xc'));var _=require('lodash');var squel=require(_0xbfd7('0xd'));var crypto=require('crypto');var jsforce=require(_0xbfd7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbfd7('0xa'));var querystring=require(_0xbfd7('0xf'));var Papa=require(_0xbfd7('0x10'));var Redis=require(_0xbfd7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbfd7('0x12'));var as=require(_0xbfd7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbfd7('0x14'));var utils=require(_0xbfd7('0x15'));var config=require(_0xbfd7('0x16'));var licenseUtil=require(_0xbfd7('0x17'));var db=require(_0xbfd7('0x18'))['db'];function respondWithStatusCode(_0x559eca,_0x46feae){_0x46feae=_0x46feae||0xcc;return function(_0x534d66){if(_0x534d66){return _0x559eca[_0xbfd7('0x19')](_0x46feae);}return _0x559eca['status'](_0x46feae)['end']();};}function respondWithResult(_0x44847e,_0x4fec16){_0x4fec16=_0x4fec16||0xc8;return function(_0x3789b7){if(_0x3789b7){return _0x44847e[_0xbfd7('0x1a')](_0x4fec16)['json'](_0x3789b7);}};}function respondWithFilteredResult(_0x5efd54,_0x48f4a4){return function(_0x37e777){if(_0x37e777){var _0x115a34=typeof _0x48f4a4[_0xbfd7('0x1b')]===_0xbfd7('0x1c')&&typeof _0x48f4a4[_0xbfd7('0x1d')]===_0xbfd7('0x1c');var _0x137d50=_0x37e777[_0xbfd7('0x1e')];var _0x3053f3=_0x115a34?0x0:_0x48f4a4['offset'];var _0x5b718b=_0x115a34?_0x37e777[_0xbfd7('0x1e')]:_0x48f4a4[_0xbfd7('0x1b')]+_0x48f4a4['limit'];var _0x5ea27a;if(_0x5b718b>=_0x137d50){_0x5b718b=_0x137d50;_0x5ea27a=0xc8;}else{_0x5ea27a=0xce;}_0x5efd54[_0xbfd7('0x1a')](_0x5ea27a);return _0x5efd54['set']('Content-Range',_0x3053f3+'-'+_0x5b718b+'/'+_0x137d50)[_0xbfd7('0x1f')](_0x37e777);}return null;};}function patchUpdates(_0x5eab37){return function(_0x594792){try{jsonpatch[_0xbfd7('0x20')](_0x594792,_0x5eab37,!![]);}catch(_0x1db6de){return BPromise[_0xbfd7('0x21')](_0x1db6de);}return _0x594792['save']();};}function saveUpdates(_0xb38f6b,_0x32a489){return function(_0x152893){if(_0x152893){return _0x152893[_0xbfd7('0x22')](_0xb38f6b)[_0xbfd7('0x23')](function(_0x2639b6){return _0x2639b6;});}return null;};}function removeEntity(_0x51b13d,_0x2402fb){return function(_0x1c765b){if(_0x1c765b){return _0x1c765b[_0xbfd7('0x24')]()['then'](function(){_0x51b13d[_0xbfd7('0x1a')](0xcc)[_0xbfd7('0x25')]();});}};}function handleEntityNotFound(_0x18dd74,_0x2d0549){return function(_0x358549){if(!_0x358549){_0x18dd74['sendStatus'](0x194);}return _0x358549;};}function handleError(_0x2a7749,_0x6ef5aa){_0x6ef5aa=_0x6ef5aa||0x1f4;return function(_0x120e39){logger[_0xbfd7('0x26')](_0x120e39[_0xbfd7('0x27')]);if(_0x120e39[_0xbfd7('0x28')]){delete _0x120e39[_0xbfd7('0x28')];}_0x2a7749['status'](_0x6ef5aa)[_0xbfd7('0x29')](_0x120e39);};}exports[_0xbfd7('0x2a')]=function(_0x4d7ef4,_0x2971ea){var _0x33583b={},_0x2ec4a5={},_0x14c55d={'count':0x0,'rows':[]};var _0x510506=_[_0xbfd7('0x2b')](db[_0xbfd7('0x2c')][_0xbfd7('0x2d')],function(_0x489365){return{'name':_0x489365[_0xbfd7('0x2e')],'type':_0x489365['type'][_0xbfd7('0x2f')]};});_0x2ec4a5['model']=_[_0xbfd7('0x2b')](_0x510506,_0xbfd7('0x28'));_0x2ec4a5['query']=_[_0xbfd7('0x30')](_0x4d7ef4[_0xbfd7('0x31')]);_0x2ec4a5['filters']=_[_0xbfd7('0x32')](_0x2ec4a5[_0xbfd7('0x33')],_0x2ec4a5[_0xbfd7('0x31')]);_0x33583b['attributes']=_[_0xbfd7('0x32')](_0x2ec4a5[_0xbfd7('0x33')],qs[_0xbfd7('0x34')](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x34')]));_0x33583b[_0xbfd7('0x35')]=_0x33583b[_0xbfd7('0x35')][_0xbfd7('0x36')]?_0x33583b[_0xbfd7('0x35')]:_0x2ec4a5[_0xbfd7('0x33')];if(!_0x4d7ef4[_0xbfd7('0x31')]['hasOwnProperty'](_0xbfd7('0x37'))){_0x33583b['limit']=qs['limit'](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x1d')]);_0x33583b[_0xbfd7('0x1b')]=qs[_0xbfd7('0x1b')](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x1b')]);}_0x33583b[_0xbfd7('0x38')]=qs[_0xbfd7('0x39')](_0x4d7ef4['query']['sort']);_0x33583b[_0xbfd7('0x3a')]=qs[_0xbfd7('0x3b')](_['pick'](_0x4d7ef4[_0xbfd7('0x31')],_0x2ec4a5[_0xbfd7('0x3b')]),_0x510506);if(_0x4d7ef4['query']['filter']){_0x33583b[_0xbfd7('0x3a')]=_[_0xbfd7('0x3c')](_0x33583b['where'],{'$or':_[_0xbfd7('0x2b')](_0x510506,function(_0xfee712){if(_0xfee712[_0xbfd7('0x3d')]!==_0xbfd7('0x3e')){var _0x68f13={};_0x68f13[_0xfee712['name']]={'$like':'%'+_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x3f')]+'%'};return _0x68f13;}})});}_0x33583b=_[_0xbfd7('0x3c')]({},_0x33583b,_0x4d7ef4[_0xbfd7('0x40')]);var _0x25ac4a={'where':_0x33583b[_0xbfd7('0x3a')]};return db[_0xbfd7('0x2c')][_0xbfd7('0x1e')](_0x25ac4a)['then'](function(_0x32df79){_0x14c55d['count']=_0x32df79;if(_0x4d7ef4['query'][_0xbfd7('0x41')]){_0x33583b[_0xbfd7('0x42')]=[{'all':!![]}];}return db[_0xbfd7('0x2c')][_0xbfd7('0x43')](_0x33583b);})[_0xbfd7('0x23')](function(_0x1236dd){_0x14c55d['rows']=_0x1236dd;return _0x14c55d;})[_0xbfd7('0x23')](respondWithFilteredResult(_0x2971ea,_0x33583b))['catch'](handleError(_0x2971ea,null));};exports[_0xbfd7('0x44')]=function(_0x3b7d7f,_0x12f99b){var _0x159c20={'raw':!![],'where':{'id':_0x3b7d7f[_0xbfd7('0x45')]['id']}},_0x1df6a3={};_0x1df6a3[_0xbfd7('0x33')]=_['keys'](db[_0xbfd7('0x2c')][_0xbfd7('0x2d')]);_0x1df6a3[_0xbfd7('0x31')]=_[_0xbfd7('0x30')](_0x3b7d7f[_0xbfd7('0x31')]);_0x1df6a3[_0xbfd7('0x3b')]=_[_0xbfd7('0x32')](_0x1df6a3['model'],_0x1df6a3[_0xbfd7('0x31')]);_0x159c20[_0xbfd7('0x35')]=_[_0xbfd7('0x32')](_0x1df6a3['model'],qs['fields'](_0x3b7d7f['query'][_0xbfd7('0x34')]));_0x159c20[_0xbfd7('0x35')]=_0x159c20[_0xbfd7('0x35')][_0xbfd7('0x36')]?_0x159c20['attributes']:_0x1df6a3[_0xbfd7('0x33')];if(_0x3b7d7f['query'][_0xbfd7('0x41')]){_0x159c20[_0xbfd7('0x42')]=[{'all':!![]}];}_0x159c20=_['merge']({},_0x159c20,_0x3b7d7f[_0xbfd7('0x40')]);return db['JscriptyAnswerReport'][_0xbfd7('0x46')](_0x159c20)[_0xbfd7('0x23')](handleEntityNotFound(_0x12f99b,null))[_0xbfd7('0x23')](respondWithResult(_0x12f99b,null))['catch'](handleError(_0x12f99b,null));};exports['create']=function(_0x356f58,_0xb8b319){return db['JscriptyAnswerReport']['create'](_0x356f58[_0xbfd7('0x47')],{})[_0xbfd7('0x23')](respondWithResult(_0xb8b319,0xc9))[_0xbfd7('0x48')](handleError(_0xb8b319,null));};exports[_0xbfd7('0x22')]=function(_0x1cea7d,_0x14bc15){if(_0x1cea7d[_0xbfd7('0x47')]['id']){delete _0x1cea7d['body']['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x1cea7d[_0xbfd7('0x45')]['id']}})[_0xbfd7('0x23')](handleEntityNotFound(_0x14bc15,null))[_0xbfd7('0x23')](saveUpdates(_0x1cea7d['body'],null))[_0xbfd7('0x23')](respondWithResult(_0x14bc15,null))[_0xbfd7('0x48')](handleError(_0x14bc15,null));};exports['destroy']=function(_0x4a7a72,_0xc89535){return db[_0xbfd7('0x2c')][_0xbfd7('0x46')]({'where':{'id':_0x4a7a72['params']['id']}})[_0xbfd7('0x23')](handleEntityNotFound(_0xc89535,null))[_0xbfd7('0x23')](removeEntity(_0xc89535,null))[_0xbfd7('0x48')](handleError(_0xc89535,null));};exports['describe']=function(_0x371d01,_0x15c0fe){return db[_0xbfd7('0x2c')][_0xbfd7('0x49')]()['then'](respondWithResult(_0x15c0fe,null))[_0xbfd7('0x48')](handleError(_0x15c0fe,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 7417273..f9189e4 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 _0x9c7c=['exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x51aa5b,_0x512fc0){var _0x5066d8=function(_0x2bdda9){while(--_0x2bdda9){_0x51aa5b['push'](_0x51aa5b['shift']());}};_0x5066d8(++_0x512fc0);}(_0x9c7c,0xd4));var _0xc9c7=function(_0x2609b9,_0x5fbbb2){_0x2609b9=_0x2609b9-0x0;var _0x4b7048=_0x9c7c[_0x2609b9];return _0x4b7048;};'use strict';var _=require(_0xc9c7('0x0'));var util=require(_0xc9c7('0x1'));var logger=require(_0xc9c7('0x2'))(_0xc9c7('0x3'));var moment=require(_0xc9c7('0x4'));var BPromise=require(_0xc9c7('0x5'));var rp=require(_0xc9c7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9c7('0x7'));var config=require(_0xc9c7('0x8'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xc9c7('0x9')]=function(_0x57cb46,_0x4eb9cf){return _0x57cb46[_0xc9c7('0xa')](_0xc9c7('0xb'),attributes,{'tableName':_0xc9c7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd4e=['rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd4e,0x85));var _0xedd4=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xdd4e[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xedd4('0x0'));var util=require('util');var logger=require(_0xedd4('0x1'))(_0xedd4('0x2'));var moment=require(_0xedd4('0x3'));var BPromise=require(_0xedd4('0x4'));var rp=require(_0xedd4('0x5'));var fs=require('fs');var path=require(_0xedd4('0x6'));var rimraf=require(_0xedd4('0x7'));var config=require(_0xedd4('0x8'));var attributes=require(_0xedd4('0x9'));module[_0xedd4('0xa')]=function(_0x58f5d4,_0x511f51){return _0x58f5d4[_0xedd4('0xb')](_0xedd4('0xc'),attributes,{'tableName':_0xedd4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 743ba25..11326e6 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 _0xc379=['error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x27dba4,_0x419253){var _0x35ec9d=function(_0x2d13b2){while(--_0x2d13b2){_0x27dba4['push'](_0x27dba4['shift']());}};_0x35ec9d(++_0x419253);}(_0xc379,0x1d0));var _0x9c37=function(_0x4275b0,_0x4014b7){_0x4275b0=_0x4275b0-0x0;var _0x588936=_0xc379[_0x4275b0];return _0x588936;};'use strict';var _=require(_0x9c37('0x0'));var util=require(_0x9c37('0x1'));var moment=require(_0x9c37('0x2'));var BPromise=require(_0x9c37('0x3'));var rs=require(_0x9c37('0x4'));var fs=require('fs');var Redis=require(_0x9c37('0x5'));var db=require(_0x9c37('0x6'))['db'];var utils=require(_0x9c37('0x7'));var logger=require(_0x9c37('0x8'))(_0x9c37('0x9'));var config=require(_0x9c37('0xa'));var jayson=require(_0x9c37('0xb'));var client=jayson['client'][_0x9c37('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55261b,_0x298e2e,_0x163353){return new BPromise(function(_0xcf7f57,_0x413d90){return client['request'](_0x55261b,_0x163353)['then'](function(_0x4642c4){logger[_0x9c37('0xd')](_0x9c37('0xe'),_0x298e2e,_0x9c37('0xf'));logger[_0x9c37('0x10')](_0x9c37('0x11'),_0x298e2e,_0x9c37('0xf'),JSON[_0x9c37('0x12')](_0x4642c4));if(_0x4642c4[_0x9c37('0x13')]){if(_0x4642c4['error']['code']===0x1f4){logger[_0x9c37('0x13')](_0x9c37('0xe'),_0x298e2e,_0x4642c4['error']['message']);return _0x413d90(_0x4642c4[_0x9c37('0x13')][_0x9c37('0x14')]);}logger[_0x9c37('0x13')](_0x9c37('0xe'),_0x298e2e,_0x4642c4[_0x9c37('0x13')][_0x9c37('0x14')]);return _0xcf7f57(_0x4642c4[_0x9c37('0x13')][_0x9c37('0x14')]);}else{logger[_0x9c37('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x298e2e,_0x9c37('0xf'));_0xcf7f57(_0x4642c4['result'][_0x9c37('0x14')]);}})['catch'](function(_0x42892f){logger[_0x9c37('0x13')](_0x9c37('0xe'),_0x298e2e,_0x42892f);_0x413d90(_0x42892f);});});} \ No newline at end of file +var _0x3a79=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x8b631b,_0x386724){var _0x3e6832=function(_0x17a132){while(--_0x17a132){_0x8b631b['push'](_0x8b631b['shift']());}};_0x3e6832(++_0x386724);}(_0x3a79,0xa4));var _0x93a7=function(_0x1b7dab,_0x48468a){_0x1b7dab=_0x1b7dab-0x0;var _0x399550=_0x3a79[_0x1b7dab];return _0x399550;};'use strict';var _=require(_0x93a7('0x0'));var util=require(_0x93a7('0x1'));var moment=require(_0x93a7('0x2'));var BPromise=require(_0x93a7('0x3'));var rs=require(_0x93a7('0x4'));var fs=require('fs');var Redis=require(_0x93a7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x93a7('0x6'));var logger=require(_0x93a7('0x7'))(_0x93a7('0x8'));var config=require(_0x93a7('0x9'));var jayson=require(_0x93a7('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x58e00b,_0x2ab891,_0x186c85){return new BPromise(function(_0x5f3d20,_0x314af6){return client['request'](_0x58e00b,_0x186c85)[_0x93a7('0xb')](function(_0x3f4ff3){logger['info'](_0x93a7('0xc'),_0x2ab891,_0x93a7('0xd'));logger[_0x93a7('0xe')](_0x93a7('0xf'),_0x2ab891,_0x93a7('0xd'),JSON[_0x93a7('0x10')](_0x3f4ff3));if(_0x3f4ff3[_0x93a7('0x11')]){if(_0x3f4ff3[_0x93a7('0x11')][_0x93a7('0x12')]===0x1f4){logger[_0x93a7('0x11')](_0x93a7('0xc'),_0x2ab891,_0x3f4ff3[_0x93a7('0x11')][_0x93a7('0x13')]);return _0x314af6(_0x3f4ff3['error'][_0x93a7('0x13')]);}logger['error'](_0x93a7('0xc'),_0x2ab891,_0x3f4ff3[_0x93a7('0x11')]['message']);return _0x5f3d20(_0x3f4ff3[_0x93a7('0x11')][_0x93a7('0x13')]);}else{logger[_0x93a7('0x14')](_0x93a7('0xc'),_0x2ab891,'request\x20sent');_0x5f3d20(_0x3f4ff3[_0x93a7('0x15')]['message']);}})[_0x93a7('0x16')](function(_0xeb7408){logger[_0x93a7('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ab891,_0xeb7408);_0x314af6(_0xeb7408);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 6d3341a..ddeadae 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 _0xe5e4=['./jscriptyProject.controller','isAuthenticated','index','get','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','put','delete','destroy','exports','multer','util','path','../../components/auth/service','../../config/environment'];(function(_0x397b8c,_0x2c8d54){var _0x218110=function(_0x3305be){while(--_0x3305be){_0x397b8c['push'](_0x397b8c['shift']());}};_0x218110(++_0x2c8d54);}(_0xe5e4,0x10f));var _0x4e5e=function(_0x4b7852,_0x1e534d){_0x4b7852=_0x4b7852-0x0;var _0x5b1e1a=_0xe5e4[_0x4b7852];return _0x5b1e1a;};'use strict';var multer=require(_0x4e5e('0x0'));var util=require(_0x4e5e('0x1'));var path=require(_0x4e5e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4e5e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4e5e('0x4'));var controller=require(_0x4e5e('0x5'));router['get']('/',auth[_0x4e5e('0x6')](),controller[_0x4e5e('0x7')]);router[_0x4e5e('0x8')](_0x4e5e('0x9'),auth['isAuthenticated'](),controller[_0x4e5e('0xa')]);router[_0x4e5e('0x8')](_0x4e5e('0xb'),auth[_0x4e5e('0x6')](),controller[_0x4e5e('0xc')]);router[_0x4e5e('0x8')](_0x4e5e('0xd'),auth[_0x4e5e('0x6')](),controller[_0x4e5e('0xe')]);router[_0x4e5e('0x8')](_0x4e5e('0xf'),auth['isAuthenticated'](),timeout(_0x4e5e('0x10')),controller[_0x4e5e('0x11')]);router[_0x4e5e('0x12')]('/',auth[_0x4e5e('0x6')](),controller['create']);router[_0x4e5e('0x12')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0x4e5e('0x13')](_0x4e5e('0x9'),auth[_0x4e5e('0x6')](),controller['update']);router[_0x4e5e('0x14')](_0x4e5e('0x9'),auth['isAuthenticated'](),controller[_0x4e5e('0x15')]);module[_0x4e5e('0x16')]=router; \ No newline at end of file +var _0x11f7=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','getSessions','getAnswers','30s','post','create','clone','put','/:id','delete','destroy','multer'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x11f7,0x1af));var _0x711f=function(_0xc86993,_0xa7cfb9){_0xc86993=_0xc86993-0x0;var _0x540bc6=_0x11f7[_0xc86993];return _0x540bc6;};'use strict';var multer=require(_0x711f('0x0'));var util=require(_0x711f('0x1'));var path=require(_0x711f('0x2'));var timeout=require(_0x711f('0x3'));var express=require(_0x711f('0x4'));var router=express[_0x711f('0x5')]();var fs_extra=require(_0x711f('0x6'));var auth=require(_0x711f('0x7'));var interaction=require(_0x711f('0x8'));var config=require(_0x711f('0x9'));var controller=require('./jscriptyProject.controller');router[_0x711f('0xa')]('/',auth['isAuthenticated'](),controller[_0x711f('0xb')]);router[_0x711f('0xa')]('/:id',auth[_0x711f('0xc')](),controller[_0x711f('0xd')]);router[_0x711f('0xa')]('/:id/sessions',auth[_0x711f('0xc')](),controller[_0x711f('0xe')]);router[_0x711f('0xa')]('/:id/answers',auth[_0x711f('0xc')](),controller[_0x711f('0xf')]);router['get']('/:id/summary',auth[_0x711f('0xc')](),timeout(_0x711f('0x10')),controller['getSummary']);router[_0x711f('0x11')]('/',auth[_0x711f('0xc')](),controller[_0x711f('0x12')]);router['post']('/:id/clone',auth[_0x711f('0xc')](),controller[_0x711f('0x13')]);router[_0x711f('0x14')](_0x711f('0x15'),auth[_0x711f('0xc')](),controller['update']);router[_0x711f('0x16')](_0x711f('0x15'),auth['isAuthenticated'](),controller[_0x711f('0x17')]);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 975d11e..d1439b7 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 _0x4ca0=['getDataValue','description','BOOLEAN','sequelize','lodash','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format'];(function(_0x37222f,_0x25a5ab){var _0x5c5a6d=function(_0x27218b){while(--_0x27218b){_0x37222f['push'](_0x37222f['shift']());}};_0x5c5a6d(++_0x25a5ab);}(_0x4ca0,0x12f));var _0x04ca=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x4ca0[_0x243b2f];return _0xcb3c2d;};'use strict';var Sequelize=require(_0x04ca('0x0'));var _=require(_0x04ca('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0x04ca('0x2')],'unique':_0x04ca('0x3')},'description':{'type':Sequelize[_0x04ca('0x2')]},'formData':{'type':Sequelize[_0x04ca('0x4')](_0x04ca('0x5')),'set':function(_0x20ca09){if(_[_0x04ca('0x6')](_0x20ca09)){this[_0x04ca('0x7')](_0x04ca('0x8'),JSON[_0x04ca('0x9')](_0x20ca09));}else if(_[_0x04ca('0xa')](_0x20ca09)){this[_0x04ca('0x7')](_0x04ca('0x8'),_0x20ca09);}else{this[_0x04ca('0x7')](_0x04ca('0x8'),util[_0x04ca('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x04ca('0xc')](_0x04ca('0x3'))||'',this[_0x04ca('0xc')](_0x04ca('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x04ca('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x04ca('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x3aca=['stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','sequelize','lodash','util','exports','STRING','name','TEXT','long','setDataValue'];(function(_0x28ddbc,_0x5a4535){var _0x14a00b=function(_0x2f1ad7){while(--_0x2f1ad7){_0x28ddbc['push'](_0x28ddbc['shift']());}};_0x14a00b(++_0x5a4535);}(_0x3aca,0x141));var _0xa3ac=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x3aca[_0xbeb808];return _0x5d6909;};'use strict';var Sequelize=require(_0xa3ac('0x0'));var _=require(_0xa3ac('0x1'));var util=require(_0xa3ac('0x2'));module[_0xa3ac('0x3')]={'name':{'type':Sequelize[_0xa3ac('0x4')],'unique':_0xa3ac('0x5')},'description':{'type':Sequelize[_0xa3ac('0x4')]},'formData':{'type':Sequelize[_0xa3ac('0x6')](_0xa3ac('0x7')),'set':function(_0x2b3888){if(_['isObjectLike'](_0x2b3888)){this[_0xa3ac('0x8')]('formData',JSON[_0xa3ac('0x9')](_0x2b3888));}else if(_[_0xa3ac('0xa')](_0x2b3888)){this[_0xa3ac('0x8')](_0xa3ac('0xb'),_0x2b3888);}else{this[_0xa3ac('0x8')](_0xa3ac('0xb'),util[_0xa3ac('0xc')](_0xa3ac('0xd'),this[_0xa3ac('0xe')](_0xa3ac('0x5'))||'',this[_0xa3ac('0xe')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index a46ec75..f0ec49d 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 _0x8dd1=['download','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','get','Projects','UserProfileResource','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','keys','filters','attributes','fields','query','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','intersection','length','catch','create','body','role','user','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','getSessions','findOne','JscriptySessionReport','order','ProjectId','getAnswers','number','fromCharCode','apply','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv'];(function(_0x4ff14a,_0x119b59){var _0x20876e=function(_0x3be209){while(--_0x3be209){_0x4ff14a['push'](_0x4ff14a['shift']());}};_0x20876e(++_0x119b59);}(_0x8dd1,0x1e5));var _0x18dd=function(_0x33bcca,_0xaa0775){_0x33bcca=_0x33bcca-0x0;var _0x13907e=_0x8dd1[_0x33bcca];return _0x13907e;};'use strict';var emlformat=require(_0x18dd('0x0'));var rimraf=require(_0x18dd('0x1'));var zipdir=require(_0x18dd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x18dd('0x3'));var moment=require('moment');var BPromise=require(_0x18dd('0x4'));var Mustache=require(_0x18dd('0x5'));var util=require(_0x18dd('0x6'));var path=require(_0x18dd('0x7'));var sox=require('sox');var csv=require(_0x18dd('0x8'));var ejs=require(_0x18dd('0x9'));var fs=require('fs');var fs_extra=require(_0x18dd('0xa'));var _=require(_0x18dd('0xb'));var squel=require(_0x18dd('0xc'));var crypto=require(_0x18dd('0xd'));var jsforce=require(_0x18dd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x18dd('0x8'));var querystring=require('querystring');var Papa=require(_0x18dd('0xf'));var Redis=require(_0x18dd('0x10'));var authService=require(_0x18dd('0x11'));var qs=require(_0x18dd('0x12'));var as=require(_0x18dd('0x13'));var hardwareService=require(_0x18dd('0x14'));var logger=require(_0x18dd('0x15'))('api');var utils=require(_0x18dd('0x16'));var config=require(_0x18dd('0x17'));var licenseUtil=require(_0x18dd('0x18'));var db=require(_0x18dd('0x19'))['db'];function respondWithStatusCode(_0x63183,_0x4897e9){_0x4897e9=_0x4897e9||0xcc;return function(_0x25e8e4){if(_0x25e8e4){return _0x63183[_0x18dd('0x1a')](_0x4897e9);}return _0x63183[_0x18dd('0x1b')](_0x4897e9)[_0x18dd('0x1c')]();};}function respondWithResult(_0x3dbbde,_0x38fd98){_0x38fd98=_0x38fd98||0xc8;return function(_0x196be0){if(_0x196be0){return _0x3dbbde[_0x18dd('0x1b')](_0x38fd98)[_0x18dd('0x1d')](_0x196be0);}};}function respondWithFilteredResult(_0x492b90,_0x2759cc){return function(_0x1b077d){if(_0x1b077d){var _0x357af1=typeof _0x2759cc['offset']===_0x18dd('0x1e')&&typeof _0x2759cc[_0x18dd('0x1f')]==='undefined';var _0x200772=_0x1b077d[_0x18dd('0x20')];var _0x32f833=_0x357af1?0x0:_0x2759cc[_0x18dd('0x21')];var _0x131ba7=_0x357af1?_0x1b077d['count']:_0x2759cc['offset']+_0x2759cc[_0x18dd('0x1f')];var _0x1134dd;if(_0x131ba7>=_0x200772){_0x131ba7=_0x200772;_0x1134dd=0xc8;}else{_0x1134dd=0xce;}_0x492b90[_0x18dd('0x1b')](_0x1134dd);return _0x492b90[_0x18dd('0x22')](_0x18dd('0x23'),_0x32f833+'-'+_0x131ba7+'/'+_0x200772)[_0x18dd('0x1d')](_0x1b077d);}return null;};}function patchUpdates(_0x382fef){return function(_0x39ad01){try{jsonpatch['apply'](_0x39ad01,_0x382fef,!![]);}catch(_0x2073d9){return BPromise[_0x18dd('0x24')](_0x2073d9);}return _0x39ad01['save']();};}function saveUpdates(_0x3f9491,_0x5cae41){return function(_0x20bc7a){if(_0x20bc7a){return _0x20bc7a[_0x18dd('0x25')](_0x3f9491)[_0x18dd('0x26')](function(_0x535261){return _0x535261;});}return null;};}function removeEntity(_0x372f41,_0x52e5fb){return function(_0x3561ee){if(_0x3561ee){return _0x3561ee[_0x18dd('0x27')]()['then'](function(){var _0x3619fb=_0x3561ee[_0x18dd('0x28')]({'plain':!![]});var _0x20675b=_0x18dd('0x29');return db[_0x18dd('0x2a')][_0x18dd('0x27')]({'where':{'type':_0x20675b,'resourceId':_0x3619fb['id']}})[_0x18dd('0x26')](function(){return _0x3561ee;});})[_0x18dd('0x26')](function(){_0x372f41[_0x18dd('0x1b')](0xcc)[_0x18dd('0x1c')]();});}};}function handleEntityNotFound(_0x2178f1,_0x14e7a7){return function(_0x3eabc4){if(!_0x3eabc4){_0x2178f1[_0x18dd('0x1a')](0x194);}return _0x3eabc4;};}function handleError(_0x11b6cc,_0x5b99cd){_0x5b99cd=_0x5b99cd||0x1f4;return function(_0x553145){logger['error'](_0x553145['stack']);if(_0x553145[_0x18dd('0x2b')]){delete _0x553145[_0x18dd('0x2b')];}_0x11b6cc['status'](_0x5b99cd)[_0x18dd('0x2c')](_0x553145);};}exports[_0x18dd('0x2d')]=function(_0x3998e8,_0x31632e){var _0x43d9b6={},_0x54e09e={},_0x1dc6ef={'count':0x0,'rows':[]};var _0x3bae34=_[_0x18dd('0x2e')](db[_0x18dd('0x2f')][_0x18dd('0x30')],function(_0x4ec73f){return{'name':_0x4ec73f[_0x18dd('0x31')],'type':_0x4ec73f[_0x18dd('0x32')][_0x18dd('0x33')]};});_0x54e09e[_0x18dd('0x34')]=_[_0x18dd('0x2e')](_0x3bae34,_0x18dd('0x2b'));_0x54e09e['query']=_[_0x18dd('0x35')](_0x3998e8['query']);_0x54e09e[_0x18dd('0x36')]=_['intersection'](_0x54e09e[_0x18dd('0x34')],_0x54e09e['query']);_0x43d9b6[_0x18dd('0x37')]=_['intersection'](_0x54e09e[_0x18dd('0x34')],qs[_0x18dd('0x38')](_0x3998e8['query']['fields']));_0x43d9b6['attributes']=_0x43d9b6[_0x18dd('0x37')]['length']?_0x43d9b6[_0x18dd('0x37')]:_0x54e09e['model'];if(!_0x3998e8[_0x18dd('0x39')][_0x18dd('0x3a')](_0x18dd('0x3b'))){_0x43d9b6[_0x18dd('0x1f')]=qs[_0x18dd('0x1f')](_0x3998e8[_0x18dd('0x39')][_0x18dd('0x1f')]);_0x43d9b6[_0x18dd('0x21')]=qs[_0x18dd('0x21')](_0x3998e8[_0x18dd('0x39')]['offset']);}_0x43d9b6['order']=qs[_0x18dd('0x3c')](_0x3998e8[_0x18dd('0x39')]['sort']);_0x43d9b6[_0x18dd('0x3d')]=qs[_0x18dd('0x36')](_[_0x18dd('0x3e')](_0x3998e8[_0x18dd('0x39')],_0x54e09e['filters']),_0x3bae34);if(_0x3998e8[_0x18dd('0x39')]['filter']){_0x43d9b6[_0x18dd('0x3d')]=_['merge'](_0x43d9b6['where'],{'$or':_['map'](_0x3bae34,function(_0xad89df){if(_0xad89df[_0x18dd('0x32')]!==_0x18dd('0x3f')){var _0x27c084={};_0x27c084[_0xad89df[_0x18dd('0x2b')]]={'$like':'%'+_0x3998e8[_0x18dd('0x39')][_0x18dd('0x40')]+'%'};return _0x27c084;}})});}_0x43d9b6=_[_0x18dd('0x41')]({},_0x43d9b6,_0x3998e8[_0x18dd('0x42')]);var _0x4fd6ff={'where':_0x43d9b6[_0x18dd('0x3d')]};return db[_0x18dd('0x2f')][_0x18dd('0x20')](_0x4fd6ff)[_0x18dd('0x26')](function(_0x505df7){_0x1dc6ef[_0x18dd('0x20')]=_0x505df7;if(_0x3998e8[_0x18dd('0x39')][_0x18dd('0x43')]){_0x43d9b6[_0x18dd('0x44')]=[{'all':!![]}];}return db['JscriptyProject'][_0x18dd('0x45')](_0x43d9b6);})[_0x18dd('0x26')](function(_0x263565){_0x1dc6ef[_0x18dd('0x46')]=_0x263565;return _0x1dc6ef;})[_0x18dd('0x26')](respondWithFilteredResult(_0x31632e,_0x43d9b6))['catch'](handleError(_0x31632e,null));};exports[_0x18dd('0x47')]=function(_0x43ff0f,_0x5a163f){var _0x4bceb2={'raw':![],'where':{'id':_0x43ff0f[_0x18dd('0x48')]['id']}},_0x1d7f93={};_0x1d7f93[_0x18dd('0x34')]=_[_0x18dd('0x35')](db[_0x18dd('0x2f')][_0x18dd('0x30')]);_0x1d7f93[_0x18dd('0x39')]=_[_0x18dd('0x35')](_0x43ff0f[_0x18dd('0x39')]);_0x1d7f93[_0x18dd('0x36')]=_[_0x18dd('0x49')](_0x1d7f93[_0x18dd('0x34')],_0x1d7f93[_0x18dd('0x39')]);_0x4bceb2[_0x18dd('0x37')]=_['intersection'](_0x1d7f93[_0x18dd('0x34')],qs['fields'](_0x43ff0f[_0x18dd('0x39')][_0x18dd('0x38')]));_0x4bceb2['attributes']=_0x4bceb2[_0x18dd('0x37')][_0x18dd('0x4a')]?_0x4bceb2[_0x18dd('0x37')]:_0x1d7f93[_0x18dd('0x34')];if(_0x43ff0f['query']['includeAll']){_0x4bceb2[_0x18dd('0x44')]=[{'all':!![]}];}_0x4bceb2=_[_0x18dd('0x41')]({},_0x4bceb2,_0x43ff0f[_0x18dd('0x42')]);return db[_0x18dd('0x2f')]['find'](_0x4bceb2)['then'](handleEntityNotFound(_0x5a163f,null))[_0x18dd('0x26')](respondWithResult(_0x5a163f,null))[_0x18dd('0x4b')](handleError(_0x5a163f,null));};exports[_0x18dd('0x4c')]=function(_0x44a847,_0x59c61f){return db[_0x18dd('0x2f')]['create'](_0x44a847[_0x18dd('0x4d')],{})[_0x18dd('0x26')](function(_0x594e70){var _0x40971c=_0x44a847['user'][_0x18dd('0x28')]({'plain':!![]});if(!_0x40971c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40971c[_0x18dd('0x4e')]===_0x18dd('0x4f')){var _0x89780b=_0x594e70[_0x18dd('0x28')]({'plain':!![]});var _0x27fcf2='Projects';return db['UserProfileSection'][_0x18dd('0x50')]({'where':{'name':_0x27fcf2,'userProfileId':_0x40971c[_0x18dd('0x51')]},'raw':!![]})[_0x18dd('0x26')](function(_0x4c88e5){if(_0x4c88e5&&_0x4c88e5[_0x18dd('0x52')]===0x0){return db[_0x18dd('0x2a')][_0x18dd('0x4c')]({'name':_0x89780b['name'],'resourceId':_0x89780b['id'],'type':_0x4c88e5[_0x18dd('0x2b')],'sectionId':_0x4c88e5['id']},{})['then'](function(){return _0x594e70;});}else{return _0x594e70;}})[_0x18dd('0x4b')](function(_0x3b4f3e){logger[_0x18dd('0x53')](_0x18dd('0x54'),_0x3b4f3e);throw _0x3b4f3e;});}return _0x594e70;})['then'](respondWithResult(_0x59c61f,0xc9))['catch'](handleError(_0x59c61f,null));};exports[_0x18dd('0x55')]=function(_0x75bf7e,_0x1e6b52){var _0x1734d3={'where':{'id':_0x75bf7e[_0x18dd('0x48')]['id']}},_0x38afd3={};_0x38afd3[_0x18dd('0x34')]=_[_0x18dd('0x35')](db[_0x18dd('0x2f')]['rawAttributes']);_0x1734d3[_0x18dd('0x37')]=_[_0x18dd('0x49')](_0x38afd3[_0x18dd('0x34')],qs[_0x18dd('0x38')](_0x75bf7e[_0x18dd('0x39')][_0x18dd('0x38')]));_0x1734d3[_0x18dd('0x37')]=_0x1734d3[_0x18dd('0x37')][_0x18dd('0x4a')]?_0x1734d3[_0x18dd('0x37')]:_0x38afd3[_0x18dd('0x34')];if(_0x75bf7e['query'][_0x18dd('0x43')]){_0x1734d3[_0x18dd('0x44')]=[{'all':!![]}];}_0x1734d3=_[_0x18dd('0x41')]({},_0x1734d3,_0x75bf7e['options']);return db[_0x18dd('0x2f')][_0x18dd('0x50')](_0x1734d3)['then'](handleEntityNotFound(_0x1e6b52,null))['then'](function(_0x3ec18a){if(_0x3ec18a){var _0x8b8ef7=_0x3ec18a[_0x18dd('0x28')]({'plain':!![]});_0x8b8ef7=qs[_0x18dd('0x56')](_0x8b8ef7,['id',_0x18dd('0x57'),_0x18dd('0x58')]);_0x75bf7e[_0x18dd('0x4d')]=_[_0x18dd('0x56')](_0x75bf7e[_0x18dd('0x4d')],['id',_0x18dd('0x57'),_0x18dd('0x58')]);return db['JscriptyProject']['create'](_['merge'](_0x8b8ef7,_0x75bf7e[_0x18dd('0x4d')]),{'include':_0x75bf7e['query']['includeAll']?[{'all':!![]}]:undefined})[_0x18dd('0x26')](function(_0x26717c){var _0x297f3c=_0x75bf7e[_0x18dd('0x4f')]['get']({'plain':!![]});if(!_0x297f3c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x297f3c['role']==='user'){var _0x1d8a4c=_0x26717c[_0x18dd('0x28')]({'plain':!![]});var _0x51965c='Projects';return db[_0x18dd('0x59')][_0x18dd('0x50')]({'where':{'name':_0x51965c,'userProfileId':_0x297f3c['userProfileId']},'raw':!![]})[_0x18dd('0x26')](function(_0x5002c9){if(_0x5002c9&&_0x5002c9[_0x18dd('0x52')]===0x0){return db[_0x18dd('0x2a')][_0x18dd('0x4c')]({'name':_0x1d8a4c[_0x18dd('0x2b')],'resourceId':_0x1d8a4c['id'],'type':_0x5002c9['name'],'sectionId':_0x5002c9['id']},{})[_0x18dd('0x26')](function(){return _0x26717c;});}else{return _0x26717c;}})[_0x18dd('0x4b')](function(_0x3d6f05){logger[_0x18dd('0x53')](_0x18dd('0x54'),_0x3d6f05);throw _0x3d6f05;});}return _0x26717c;});}})[_0x18dd('0x26')](respondWithResult(_0x1e6b52,0xc9))[_0x18dd('0x4b')](handleError(_0x1e6b52,null));};exports['update']=function(_0x5bbfab,_0x1578f0){if(_0x5bbfab[_0x18dd('0x4d')]['id']){delete _0x5bbfab[_0x18dd('0x4d')]['id'];}return db[_0x18dd('0x2f')][_0x18dd('0x50')]({'where':{'id':_0x5bbfab[_0x18dd('0x48')]['id']}})[_0x18dd('0x26')](handleEntityNotFound(_0x1578f0,null))[_0x18dd('0x26')](saveUpdates(_0x5bbfab[_0x18dd('0x4d')],null))[_0x18dd('0x26')](respondWithResult(_0x1578f0,null))[_0x18dd('0x4b')](handleError(_0x1578f0,null));};exports[_0x18dd('0x27')]=function(_0x49cf2,_0x115e2b){return db[_0x18dd('0x2f')][_0x18dd('0x50')]({'where':{'id':_0x49cf2['params']['id']}})[_0x18dd('0x26')](handleEntityNotFound(_0x115e2b,null))[_0x18dd('0x26')](removeEntity(_0x115e2b,null))[_0x18dd('0x4b')](handleError(_0x115e2b,null));};exports[_0x18dd('0x5a')]=function(_0x360cbf,_0x1cb14b,_0x401945){var _0x501565={'raw':!![],'where':{}};var _0x4935fa={};var _0x21bbaf={'count':0x0,'rows':[]};return db[_0x18dd('0x2f')][_0x18dd('0x5b')]({'where':{'id':_0x360cbf['params']['id']}})['then'](handleEntityNotFound(_0x1cb14b,null))[_0x18dd('0x26')](function(_0x555dc4){if(_0x555dc4){_0x4935fa[_0x18dd('0x34')]=_[_0x18dd('0x35')](db[_0x18dd('0x5c')][_0x18dd('0x30')]);_0x4935fa['query']=_[_0x18dd('0x35')](_0x360cbf[_0x18dd('0x39')]);_0x4935fa['filters']=_[_0x18dd('0x49')](_0x4935fa['model'],_0x4935fa[_0x18dd('0x39')]);_0x501565['attributes']=_[_0x18dd('0x49')](_0x4935fa[_0x18dd('0x34')],qs[_0x18dd('0x38')](_0x360cbf[_0x18dd('0x39')][_0x18dd('0x38')]));_0x501565[_0x18dd('0x37')]=_0x501565[_0x18dd('0x37')][_0x18dd('0x4a')]?_0x501565[_0x18dd('0x37')]:_0x4935fa[_0x18dd('0x34')];if(!_0x360cbf['query'][_0x18dd('0x3a')](_0x18dd('0x3b'))){_0x501565['limit']=qs['limit'](_0x360cbf[_0x18dd('0x39')][_0x18dd('0x1f')]);_0x501565[_0x18dd('0x21')]=qs[_0x18dd('0x21')](_0x360cbf[_0x18dd('0x39')]['offset']);}_0x501565[_0x18dd('0x5d')]=qs[_0x18dd('0x3c')](_0x360cbf[_0x18dd('0x39')]['sort']);_0x501565['where']=qs[_0x18dd('0x36')](_['pick'](_0x360cbf[_0x18dd('0x39')],_0x4935fa[_0x18dd('0x36')]));_0x501565[_0x18dd('0x3d')][_0x18dd('0x5e')]=_0x555dc4['id'];if(_0x360cbf['query']['filter']){_0x501565[_0x18dd('0x3d')]=_[_0x18dd('0x41')](_0x501565[_0x18dd('0x3d')],{'$or':_[_0x18dd('0x2e')](_0x501565[_0x18dd('0x37')],function(_0x245c79){var _0x5d09e4={};_0x5d09e4[_0x245c79]={'$like':'%'+_0x360cbf[_0x18dd('0x39')]['filter']+'%'};return _0x5d09e4;})});}_0x501565=_[_0x18dd('0x41')]({},_0x501565,_0x360cbf[_0x18dd('0x42')]);return db['JscriptySessionReport'][_0x18dd('0x20')]({'where':_0x501565['where']})[_0x18dd('0x26')](function(_0x1b8d51){_0x21bbaf[_0x18dd('0x20')]=_0x1b8d51;if(_0x360cbf['query'][_0x18dd('0x43')]){_0x501565[_0x18dd('0x44')]=[{'all':!![]}];}return db[_0x18dd('0x5c')][_0x18dd('0x45')](_0x501565);})['then'](function(_0x35061d){_0x21bbaf[_0x18dd('0x46')]=_0x35061d;return _0x21bbaf;});}})[_0x18dd('0x26')](respondWithFilteredResult(_0x1cb14b,_0x501565))['catch'](handleError(_0x1cb14b,null));};exports[_0x18dd('0x5f')]=function(_0x37625b,_0x3f2988,_0x58dc49){var _0x1a7b24={'raw':!![],'where':{}};var _0x4d0644={};var _0x1b1a87={'count':0x0,'rows':[]};return db[_0x18dd('0x2f')][_0x18dd('0x5b')]({'where':{'id':_0x37625b[_0x18dd('0x48')]['id']}})['then'](handleEntityNotFound(_0x3f2988,null))['then'](function(_0x567719){if(_0x567719){_0x4d0644[_0x18dd('0x34')]=_[_0x18dd('0x35')](db['JscriptyAnswerReport'][_0x18dd('0x30')]);_0x4d0644[_0x18dd('0x39')]=_[_0x18dd('0x35')](_0x37625b[_0x18dd('0x39')]);_0x4d0644[_0x18dd('0x36')]=_['intersection'](_0x4d0644[_0x18dd('0x34')],_0x4d0644[_0x18dd('0x39')]);_0x1a7b24['attributes']=_[_0x18dd('0x49')](_0x4d0644[_0x18dd('0x34')],qs[_0x18dd('0x38')](_0x37625b['query'][_0x18dd('0x38')]));_0x1a7b24[_0x18dd('0x37')]=_0x1a7b24['attributes']['length']?_0x1a7b24[_0x18dd('0x37')]:_0x4d0644['model'];if(!_0x37625b[_0x18dd('0x39')][_0x18dd('0x3a')]('nolimit')){_0x1a7b24[_0x18dd('0x1f')]=qs[_0x18dd('0x1f')](_0x37625b[_0x18dd('0x39')][_0x18dd('0x1f')]);_0x1a7b24[_0x18dd('0x21')]=qs[_0x18dd('0x21')](_0x37625b[_0x18dd('0x39')][_0x18dd('0x21')]);}_0x1a7b24[_0x18dd('0x5d')]=qs['sort'](_0x37625b[_0x18dd('0x39')][_0x18dd('0x3c')]);_0x1a7b24[_0x18dd('0x3d')]=qs[_0x18dd('0x36')](_[_0x18dd('0x3e')](_0x37625b[_0x18dd('0x39')],_0x4d0644[_0x18dd('0x36')]));_0x1a7b24[_0x18dd('0x3d')]['ProjectId']=_0x567719['id'];if(_0x37625b[_0x18dd('0x39')]['filter']){_0x1a7b24[_0x18dd('0x3d')]=_[_0x18dd('0x41')](_0x1a7b24[_0x18dd('0x3d')],{'$or':_[_0x18dd('0x2e')](_0x1a7b24['attributes'],function(_0x317659){var _0x346ab1={};_0x346ab1[_0x317659]={'$like':'%'+_0x37625b[_0x18dd('0x39')][_0x18dd('0x40')]+'%'};return _0x346ab1;})});}_0x1a7b24=_[_0x18dd('0x41')]({},_0x1a7b24,_0x37625b[_0x18dd('0x42')]);return db['JscriptyAnswerReport'][_0x18dd('0x20')]({'where':_0x1a7b24[_0x18dd('0x3d')]})[_0x18dd('0x26')](function(_0x2f40fe){_0x1b1a87[_0x18dd('0x20')]=_0x2f40fe;if(_0x37625b[_0x18dd('0x39')]['includeAll']){_0x1a7b24[_0x18dd('0x44')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x1a7b24);})[_0x18dd('0x26')](function(_0x4d8d71){_0x1b1a87[_0x18dd('0x46')]=_0x4d8d71;return _0x1b1a87;});}})[_0x18dd('0x26')](respondWithFilteredResult(_0x3f2988,_0x1a7b24))[_0x18dd('0x4b')](handleError(_0x3f2988,null));};function char(_0x53e86e){return _0x18dd('0x60')===typeof _0x53e86e?String[_0x18dd('0x61')][_0x18dd('0x62')](null,arguments):_0x53e86e;}function needsEncapsulation(_0x1024b6){return!!_0x1024b6&&(_0x1024b6[_0x18dd('0x63')]()['indexOf'](char(0xd))>=0x0||_0x1024b6[_0x18dd('0x63')]()['indexOf'](char(0xa))>=0x0||_0x1024b6[_0x18dd('0x63')]()[_0x18dd('0x64')](char(0x2c))>=0x0||_0x1024b6[_0x18dd('0x63')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x28feae){var _0x5e989a=char(0x22),_0x515b4f='\x5c'+char(0x22),_0x53b041=_0x28feae[_0x18dd('0x63')]()[_0x18dd('0x65')](new RegExp(_0x5e989a,'g'),_0x515b4f);return _0x5e989a+_0x53b041+_0x5e989a;}exports['getSummary']=function(_0x11af1f,_0x357c1d,_0x2eb2e9){var _0x279ff0,_0x2b9aa8;var _0x55983b={'where':{'ProjectId':_0x11af1f[_0x18dd('0x48')]['id']}};if(_0x11af1f['query'][_0x18dd('0x66')]){_0x55983b[_0x18dd('0x3d')][_0x18dd('0x67')]=JSON[_0x18dd('0x68')](_0x11af1f[_0x18dd('0x39')][_0x18dd('0x66')]);}return db[_0x18dd('0x5c')][_0x18dd('0x45')](_0x55983b)[_0x18dd('0x26')](handleEntityNotFound(_0x357c1d,null))[_0x18dd('0x26')](function(_0x19bfba){if(_0x19bfba){_0x279ff0=_0x19bfba;return db[_0x18dd('0x69')][_0x18dd('0x45')]({'where':{'SessionId':{'$in':_['map'](_0x279ff0,'id')},'ProjectId':_0x11af1f[_0x18dd('0x48')]['id']},'order':_0x18dd('0x6a')});}})[_0x18dd('0x26')](handleEntityNotFound(_0x357c1d,null))[_0x18dd('0x26')](function(_0x58ad84){if(_0x58ad84){_0x2b9aa8=_0x58ad84;var _0x1dc3ad={};for(var _0x52d24f=0x0,_0x11aa0b=_0x2b9aa8[_0x18dd('0x4a')];_0x52d24f<_0x11aa0b;_0x52d24f++){if(!_0x1dc3ad[_0x18dd('0x3a')](_0x2b9aa8[_0x52d24f][_0x18dd('0x6b')])){_0x1dc3ad[_0x2b9aa8[_0x52d24f]['questionId']]=needsEncapsulation(_0x2b9aa8[_0x52d24f][_0x18dd('0x6c')])?encapsulate(_0x2b9aa8[_0x52d24f][_0x18dd('0x6c')]):_0x2b9aa8[_0x52d24f][_0x18dd('0x6c')];}}var _0x3f13f3=[],_0x37c6ce={};for(var _0x4d5371=0x0,_0x35a071=_0x279ff0['length'];_0x4d5371<_0x35a071;_0x4d5371++){_0x37c6ce={'ProjectId':_0x11af1f[_0x18dd('0x48')]['id'],'SessionId':_0x279ff0[_0x4d5371]['id'],'StartTime':moment(_0x279ff0[_0x4d5371][_0x18dd('0x67')])[_0x18dd('0x6d')](_0x18dd('0x6e'))};for(var _0x113c6f=0x0,_0x3a3565=_0x2b9aa8[_0x18dd('0x4a')];_0x113c6f<_0x3a3565;_0x113c6f++){if(_0x2b9aa8[_0x113c6f][_0x18dd('0x6f')]==_0x279ff0[_0x4d5371]['id']&&_0x1dc3ad[_0x18dd('0x3a')](_0x2b9aa8[_0x113c6f]['questionId'])){_0x37c6ce[_0x1dc3ad[_0x2b9aa8[_0x113c6f][_0x18dd('0x6b')]]]=_0x2b9aa8[_0x113c6f]['answer'];}}for(var _0x5e4f6c in _0x1dc3ad){if(!_0x37c6ce[_0x18dd('0x3a')](_0x1dc3ad[_0x5e4f6c])){_0x37c6ce[_0x1dc3ad[_0x5e4f6c]]=null;}}_0x3f13f3['push'](_0x37c6ce);}return _0x3f13f3;}})[_0x18dd('0x26')](function(_0x16d9cd){if(!_[_0x18dd('0x70')](_0x16d9cd)){var _0x167e0b=toCsv(_0x16d9cd);var _0x358d60=Date[_0x18dd('0x71')]();fs[_0x18dd('0x72')](util[_0x18dd('0x6d')](_0x18dd('0x73'),_0x11af1f[_0x18dd('0x48')]['id'],_0x358d60),_0x167e0b);_0x357c1d['setHeader'](_0x18dd('0x74'),'attachment;\x20filename='+util[_0x18dd('0x6d')](_0x18dd('0x75'),_0x11af1f[_0x18dd('0x48')]['id'],_0x358d60));_0x357c1d['setHeader'](_0x18dd('0x76'),_0x18dd('0x77'));return _0x357c1d[_0x18dd('0x78')](util['format'](_0x18dd('0x73'),_0x11af1f[_0x18dd('0x48')]['id'],_0x358d60));}else{return _0x357c1d[_0x18dd('0x1a')](0xcc);}})['catch'](handleError(_0x357c1d,null));}; \ No newline at end of file +var _0xf4c9=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','JscriptyProject','includeAll','include','rows','catch','show','keys','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Projects','findOne','ProjectId','JscriptySessionReport','JscriptyAnswerReport','findAll','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','reject','update','destroy','then','get','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xf4c9[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require(_0x9f4c('0x0'));var rimraf=require(_0x9f4c('0x1'));var zipdir=require(_0x9f4c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f4c('0x3'));var moment=require('moment');var BPromise=require(_0x9f4c('0x4'));var Mustache=require(_0x9f4c('0x5'));var util=require(_0x9f4c('0x6'));var path=require('path');var sox=require(_0x9f4c('0x7'));var csv=require('to-csv');var ejs=require(_0x9f4c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9f4c('0x9'));var jsforce=require(_0x9f4c('0xa'));var deskjs=require(_0x9f4c('0xb'));var toCsv=require(_0x9f4c('0xc'));var querystring=require(_0x9f4c('0xd'));var Papa=require(_0x9f4c('0xe'));var Redis=require('ioredis');var authService=require(_0x9f4c('0xf'));var qs=require(_0x9f4c('0x10'));var as=require(_0x9f4c('0x11'));var hardwareService=require(_0x9f4c('0x12'));var logger=require(_0x9f4c('0x13'))(_0x9f4c('0x14'));var utils=require(_0x9f4c('0x15'));var config=require(_0x9f4c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d71a9,_0x124492){_0x124492=_0x124492||0xcc;return function(_0x53159a){if(_0x53159a){return _0x4d71a9['sendStatus'](_0x124492);}return _0x4d71a9[_0x9f4c('0x17')](_0x124492)['end']();};}function respondWithResult(_0x5a9cb0,_0xf217d4){_0xf217d4=_0xf217d4||0xc8;return function(_0x4ce352){if(_0x4ce352){return _0x5a9cb0['status'](_0xf217d4)[_0x9f4c('0x18')](_0x4ce352);}};}function respondWithFilteredResult(_0x516787,_0x25f8ed){return function(_0x336fc2){if(_0x336fc2){var _0x46abfe=typeof _0x25f8ed[_0x9f4c('0x19')]===_0x9f4c('0x1a')&&typeof _0x25f8ed[_0x9f4c('0x1b')]==='undefined';var _0x2be1ba=_0x336fc2[_0x9f4c('0x1c')];var _0x143335=_0x46abfe?0x0:_0x25f8ed[_0x9f4c('0x19')];var _0x3f862c=_0x46abfe?_0x336fc2['count']:_0x25f8ed[_0x9f4c('0x19')]+_0x25f8ed[_0x9f4c('0x1b')];var _0x8efbfe;if(_0x3f862c>=_0x2be1ba){_0x3f862c=_0x2be1ba;_0x8efbfe=0xc8;}else{_0x8efbfe=0xce;}_0x516787['status'](_0x8efbfe);return _0x516787['set']('Content-Range',_0x143335+'-'+_0x3f862c+'/'+_0x2be1ba)['json'](_0x336fc2);}return null;};}function patchUpdates(_0x2040a5){return function(_0x47accd){try{jsonpatch['apply'](_0x47accd,_0x2040a5,!![]);}catch(_0x603a8d){return BPromise[_0x9f4c('0x1d')](_0x603a8d);}return _0x47accd['save']();};}function saveUpdates(_0x341693,_0x1d0df9){return function(_0x57b636){if(_0x57b636){return _0x57b636[_0x9f4c('0x1e')](_0x341693)['then'](function(_0x5e6632){return _0x5e6632;});}return null;};}function removeEntity(_0x36e15f,_0x49d6d6){return function(_0xa4a8e9){if(_0xa4a8e9){return _0xa4a8e9[_0x9f4c('0x1f')]()[_0x9f4c('0x20')](function(){var _0x4698b3=_0xa4a8e9[_0x9f4c('0x21')]({'plain':!![]});var _0x10c9a9='Projects';return db[_0x9f4c('0x22')][_0x9f4c('0x1f')]({'where':{'type':_0x10c9a9,'resourceId':_0x4698b3['id']}})[_0x9f4c('0x20')](function(){return _0xa4a8e9;});})[_0x9f4c('0x20')](function(){_0x36e15f[_0x9f4c('0x17')](0xcc)[_0x9f4c('0x23')]();});}};}function handleEntityNotFound(_0x945f00,_0xadd84c){return function(_0x3bcc3f){if(!_0x3bcc3f){_0x945f00[_0x9f4c('0x24')](0x194);}return _0x3bcc3f;};}function handleError(_0x4712c7,_0x4f0d37){_0x4f0d37=_0x4f0d37||0x1f4;return function(_0x168ed8){logger[_0x9f4c('0x25')](_0x168ed8[_0x9f4c('0x26')]);if(_0x168ed8[_0x9f4c('0x27')]){delete _0x168ed8[_0x9f4c('0x27')];}_0x4712c7[_0x9f4c('0x17')](_0x4f0d37)[_0x9f4c('0x28')](_0x168ed8);};}exports[_0x9f4c('0x29')]=function(_0x20d2f4,_0x2158ac){var _0x4e9b77={},_0x4b6d91={},_0x52ef31={'count':0x0,'rows':[]};var _0x101c13=_[_0x9f4c('0x2a')](db['JscriptyProject'][_0x9f4c('0x2b')],function(_0x8cd2b3){return{'name':_0x8cd2b3[_0x9f4c('0x2c')],'type':_0x8cd2b3['type']['key']};});_0x4b6d91[_0x9f4c('0x2d')]=_[_0x9f4c('0x2a')](_0x101c13,'name');_0x4b6d91[_0x9f4c('0x2e')]=_['keys'](_0x20d2f4['query']);_0x4b6d91[_0x9f4c('0x2f')]=_[_0x9f4c('0x30')](_0x4b6d91[_0x9f4c('0x2d')],_0x4b6d91[_0x9f4c('0x2e')]);_0x4e9b77[_0x9f4c('0x31')]=_[_0x9f4c('0x30')](_0x4b6d91['model'],qs[_0x9f4c('0x32')](_0x20d2f4[_0x9f4c('0x2e')][_0x9f4c('0x32')]));_0x4e9b77[_0x9f4c('0x31')]=_0x4e9b77[_0x9f4c('0x31')][_0x9f4c('0x33')]?_0x4e9b77[_0x9f4c('0x31')]:_0x4b6d91[_0x9f4c('0x2d')];if(!_0x20d2f4[_0x9f4c('0x2e')][_0x9f4c('0x34')](_0x9f4c('0x35'))){_0x4e9b77[_0x9f4c('0x1b')]=qs[_0x9f4c('0x1b')](_0x20d2f4['query'][_0x9f4c('0x1b')]);_0x4e9b77['offset']=qs[_0x9f4c('0x19')](_0x20d2f4[_0x9f4c('0x2e')][_0x9f4c('0x19')]);}_0x4e9b77[_0x9f4c('0x36')]=qs[_0x9f4c('0x37')](_0x20d2f4[_0x9f4c('0x2e')][_0x9f4c('0x37')]);_0x4e9b77[_0x9f4c('0x38')]=qs[_0x9f4c('0x2f')](_[_0x9f4c('0x39')](_0x20d2f4[_0x9f4c('0x2e')],_0x4b6d91[_0x9f4c('0x2f')]),_0x101c13);if(_0x20d2f4['query'][_0x9f4c('0x3a')]){_0x4e9b77[_0x9f4c('0x38')]=_[_0x9f4c('0x3b')](_0x4e9b77['where'],{'$or':_[_0x9f4c('0x2a')](_0x101c13,function(_0x380c08){if(_0x380c08[_0x9f4c('0x3c')]!=='VIRTUAL'){var _0xb58e5a={};_0xb58e5a[_0x380c08[_0x9f4c('0x27')]]={'$like':'%'+_0x20d2f4[_0x9f4c('0x2e')][_0x9f4c('0x3a')]+'%'};return _0xb58e5a;}})});}_0x4e9b77=_[_0x9f4c('0x3b')]({},_0x4e9b77,_0x20d2f4[_0x9f4c('0x3d')]);var _0x44b920={'where':_0x4e9b77[_0x9f4c('0x38')]};return db[_0x9f4c('0x3e')][_0x9f4c('0x1c')](_0x44b920)['then'](function(_0x167363){_0x52ef31[_0x9f4c('0x1c')]=_0x167363;if(_0x20d2f4['query'][_0x9f4c('0x3f')]){_0x4e9b77[_0x9f4c('0x40')]=[{'all':!![]}];}return db[_0x9f4c('0x3e')]['findAll'](_0x4e9b77);})[_0x9f4c('0x20')](function(_0x4da3ed){_0x52ef31[_0x9f4c('0x41')]=_0x4da3ed;return _0x52ef31;})['then'](respondWithFilteredResult(_0x2158ac,_0x4e9b77))[_0x9f4c('0x42')](handleError(_0x2158ac,null));};exports[_0x9f4c('0x43')]=function(_0x10437e,_0x437558){var _0x3ee559={'raw':![],'where':{'id':_0x10437e['params']['id']}},_0x51553d={};_0x51553d[_0x9f4c('0x2d')]=_[_0x9f4c('0x44')](db[_0x9f4c('0x3e')]['rawAttributes']);_0x51553d[_0x9f4c('0x2e')]=_['keys'](_0x10437e['query']);_0x51553d[_0x9f4c('0x2f')]=_['intersection'](_0x51553d[_0x9f4c('0x2d')],_0x51553d[_0x9f4c('0x2e')]);_0x3ee559[_0x9f4c('0x31')]=_['intersection'](_0x51553d[_0x9f4c('0x2d')],qs['fields'](_0x10437e[_0x9f4c('0x2e')][_0x9f4c('0x32')]));_0x3ee559[_0x9f4c('0x31')]=_0x3ee559[_0x9f4c('0x31')]['length']?_0x3ee559[_0x9f4c('0x31')]:_0x51553d['model'];if(_0x10437e[_0x9f4c('0x2e')]['includeAll']){_0x3ee559[_0x9f4c('0x40')]=[{'all':!![]}];}_0x3ee559=_[_0x9f4c('0x3b')]({},_0x3ee559,_0x10437e['options']);return db[_0x9f4c('0x3e')][_0x9f4c('0x45')](_0x3ee559)['then'](handleEntityNotFound(_0x437558,null))[_0x9f4c('0x20')](respondWithResult(_0x437558,null))['catch'](handleError(_0x437558,null));};exports[_0x9f4c('0x46')]=function(_0x384f47,_0x5b8fca){return db['JscriptyProject']['create'](_0x384f47[_0x9f4c('0x47')],{})[_0x9f4c('0x20')](function(_0x5e93ae){var _0x2c7f9a=_0x384f47[_0x9f4c('0x48')][_0x9f4c('0x21')]({'plain':!![]});if(!_0x2c7f9a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c7f9a[_0x9f4c('0x49')]==='user'){var _0x1830e7=_0x5e93ae[_0x9f4c('0x21')]({'plain':!![]});var _0x50edbd='Projects';return db[_0x9f4c('0x4a')][_0x9f4c('0x45')]({'where':{'name':_0x50edbd,'userProfileId':_0x2c7f9a['userProfileId']},'raw':!![]})[_0x9f4c('0x20')](function(_0x885938){if(_0x885938&&_0x885938[_0x9f4c('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x1830e7[_0x9f4c('0x27')],'resourceId':_0x1830e7['id'],'type':_0x885938[_0x9f4c('0x27')],'sectionId':_0x885938['id']},{})[_0x9f4c('0x20')](function(){return _0x5e93ae;});}else{return _0x5e93ae;}})[_0x9f4c('0x42')](function(_0x558102){logger[_0x9f4c('0x25')](_0x9f4c('0x4c'),_0x558102);throw _0x558102;});}return _0x5e93ae;})[_0x9f4c('0x20')](respondWithResult(_0x5b8fca,0xc9))[_0x9f4c('0x42')](handleError(_0x5b8fca,null));};exports[_0x9f4c('0x4d')]=function(_0x200190,_0x2fbaaa){var _0x1e88b0={'where':{'id':_0x200190[_0x9f4c('0x4e')]['id']}},_0x20ea33={};_0x20ea33[_0x9f4c('0x2d')]=_['keys'](db[_0x9f4c('0x3e')][_0x9f4c('0x2b')]);_0x1e88b0[_0x9f4c('0x31')]=_[_0x9f4c('0x30')](_0x20ea33[_0x9f4c('0x2d')],qs['fields'](_0x200190['query'][_0x9f4c('0x32')]));_0x1e88b0['attributes']=_0x1e88b0[_0x9f4c('0x31')]['length']?_0x1e88b0[_0x9f4c('0x31')]:_0x20ea33[_0x9f4c('0x2d')];if(_0x200190[_0x9f4c('0x2e')][_0x9f4c('0x3f')]){_0x1e88b0[_0x9f4c('0x40')]=[{'all':!![]}];}_0x1e88b0=_[_0x9f4c('0x3b')]({},_0x1e88b0,_0x200190['options']);return db[_0x9f4c('0x3e')][_0x9f4c('0x45')](_0x1e88b0)[_0x9f4c('0x20')](handleEntityNotFound(_0x2fbaaa,null))[_0x9f4c('0x20')](function(_0x440576){if(_0x440576){var _0x584744=_0x440576[_0x9f4c('0x21')]({'plain':!![]});_0x584744=qs[_0x9f4c('0x4f')](_0x584744,['id',_0x9f4c('0x50'),_0x9f4c('0x51')]);_0x200190[_0x9f4c('0x47')]=_[_0x9f4c('0x4f')](_0x200190[_0x9f4c('0x47')],['id',_0x9f4c('0x50'),_0x9f4c('0x51')]);return db['JscriptyProject'][_0x9f4c('0x46')](_[_0x9f4c('0x3b')](_0x584744,_0x200190[_0x9f4c('0x47')]),{'include':_0x200190[_0x9f4c('0x2e')][_0x9f4c('0x3f')]?[{'all':!![]}]:undefined})[_0x9f4c('0x20')](function(_0x5ae1ef){var _0x36d619=_0x200190[_0x9f4c('0x48')][_0x9f4c('0x21')]({'plain':!![]});if(!_0x36d619)throw new Error(_0x9f4c('0x52'));if(_0x36d619[_0x9f4c('0x49')]===_0x9f4c('0x48')){var _0x4a488f=_0x5ae1ef['get']({'plain':!![]});var _0x484151=_0x9f4c('0x53');return db[_0x9f4c('0x4a')][_0x9f4c('0x45')]({'where':{'name':_0x484151,'userProfileId':_0x36d619['userProfileId']},'raw':!![]})[_0x9f4c('0x20')](function(_0x108bee){if(_0x108bee&&_0x108bee[_0x9f4c('0x4b')]===0x0){return db[_0x9f4c('0x22')][_0x9f4c('0x46')]({'name':_0x4a488f[_0x9f4c('0x27')],'resourceId':_0x4a488f['id'],'type':_0x108bee[_0x9f4c('0x27')],'sectionId':_0x108bee['id']},{})[_0x9f4c('0x20')](function(){return _0x5ae1ef;});}else{return _0x5ae1ef;}})[_0x9f4c('0x42')](function(_0x10ba77){logger['error'](_0x9f4c('0x4c'),_0x10ba77);throw _0x10ba77;});}return _0x5ae1ef;});}})[_0x9f4c('0x20')](respondWithResult(_0x2fbaaa,0xc9))[_0x9f4c('0x42')](handleError(_0x2fbaaa,null));};exports[_0x9f4c('0x1e')]=function(_0x528cc5,_0x5294a2){if(_0x528cc5['body']['id']){delete _0x528cc5[_0x9f4c('0x47')]['id'];}return db[_0x9f4c('0x3e')]['find']({'where':{'id':_0x528cc5[_0x9f4c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5294a2,null))['then'](saveUpdates(_0x528cc5[_0x9f4c('0x47')],null))['then'](respondWithResult(_0x5294a2,null))[_0x9f4c('0x42')](handleError(_0x5294a2,null));};exports[_0x9f4c('0x1f')]=function(_0x4e3904,_0x13c7a7){return db['JscriptyProject']['find']({'where':{'id':_0x4e3904[_0x9f4c('0x4e')]['id']}})[_0x9f4c('0x20')](handleEntityNotFound(_0x13c7a7,null))[_0x9f4c('0x20')](removeEntity(_0x13c7a7,null))[_0x9f4c('0x42')](handleError(_0x13c7a7,null));};exports['getSessions']=function(_0x33967a,_0x5514a1,_0x5505f3){var _0x161e0d={'raw':!![],'where':{}};var _0x558648={};var _0x108845={'count':0x0,'rows':[]};return db[_0x9f4c('0x3e')][_0x9f4c('0x54')]({'where':{'id':_0x33967a[_0x9f4c('0x4e')]['id']}})[_0x9f4c('0x20')](handleEntityNotFound(_0x5514a1,null))['then'](function(_0x5c0366){if(_0x5c0366){_0x558648['model']=_[_0x9f4c('0x44')](db['JscriptySessionReport'][_0x9f4c('0x2b')]);_0x558648[_0x9f4c('0x2e')]=_[_0x9f4c('0x44')](_0x33967a['query']);_0x558648[_0x9f4c('0x2f')]=_[_0x9f4c('0x30')](_0x558648[_0x9f4c('0x2d')],_0x558648[_0x9f4c('0x2e')]);_0x161e0d['attributes']=_[_0x9f4c('0x30')](_0x558648[_0x9f4c('0x2d')],qs[_0x9f4c('0x32')](_0x33967a[_0x9f4c('0x2e')]['fields']));_0x161e0d['attributes']=_0x161e0d['attributes']['length']?_0x161e0d['attributes']:_0x558648[_0x9f4c('0x2d')];if(!_0x33967a['query'][_0x9f4c('0x34')](_0x9f4c('0x35'))){_0x161e0d['limit']=qs['limit'](_0x33967a[_0x9f4c('0x2e')][_0x9f4c('0x1b')]);_0x161e0d[_0x9f4c('0x19')]=qs[_0x9f4c('0x19')](_0x33967a['query'][_0x9f4c('0x19')]);}_0x161e0d['order']=qs['sort'](_0x33967a['query'][_0x9f4c('0x37')]);_0x161e0d[_0x9f4c('0x38')]=qs['filters'](_[_0x9f4c('0x39')](_0x33967a[_0x9f4c('0x2e')],_0x558648[_0x9f4c('0x2f')]));_0x161e0d[_0x9f4c('0x38')][_0x9f4c('0x55')]=_0x5c0366['id'];if(_0x33967a[_0x9f4c('0x2e')][_0x9f4c('0x3a')]){_0x161e0d[_0x9f4c('0x38')]=_[_0x9f4c('0x3b')](_0x161e0d[_0x9f4c('0x38')],{'$or':_[_0x9f4c('0x2a')](_0x161e0d[_0x9f4c('0x31')],function(_0x289028){var _0x4804af={};_0x4804af[_0x289028]={'$like':'%'+_0x33967a[_0x9f4c('0x2e')][_0x9f4c('0x3a')]+'%'};return _0x4804af;})});}_0x161e0d=_[_0x9f4c('0x3b')]({},_0x161e0d,_0x33967a[_0x9f4c('0x3d')]);return db[_0x9f4c('0x56')]['count']({'where':_0x161e0d[_0x9f4c('0x38')]})['then'](function(_0x416d88){_0x108845[_0x9f4c('0x1c')]=_0x416d88;if(_0x33967a['query'][_0x9f4c('0x3f')]){_0x161e0d['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x161e0d);})['then'](function(_0x11112c){_0x108845[_0x9f4c('0x41')]=_0x11112c;return _0x108845;});}})[_0x9f4c('0x20')](respondWithFilteredResult(_0x5514a1,_0x161e0d))[_0x9f4c('0x42')](handleError(_0x5514a1,null));};exports['getAnswers']=function(_0x2138f1,_0x36cbc6,_0x12bf39){var _0x55a4ac={'raw':!![],'where':{}};var _0x2aa997={};var _0x1ffbd6={'count':0x0,'rows':[]};return db[_0x9f4c('0x3e')]['findOne']({'where':{'id':_0x2138f1[_0x9f4c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x36cbc6,null))['then'](function(_0x12603f){if(_0x12603f){_0x2aa997[_0x9f4c('0x2d')]=_[_0x9f4c('0x44')](db['JscriptyAnswerReport'][_0x9f4c('0x2b')]);_0x2aa997[_0x9f4c('0x2e')]=_[_0x9f4c('0x44')](_0x2138f1['query']);_0x2aa997[_0x9f4c('0x2f')]=_[_0x9f4c('0x30')](_0x2aa997[_0x9f4c('0x2d')],_0x2aa997['query']);_0x55a4ac['attributes']=_[_0x9f4c('0x30')](_0x2aa997[_0x9f4c('0x2d')],qs[_0x9f4c('0x32')](_0x2138f1['query'][_0x9f4c('0x32')]));_0x55a4ac[_0x9f4c('0x31')]=_0x55a4ac['attributes'][_0x9f4c('0x33')]?_0x55a4ac[_0x9f4c('0x31')]:_0x2aa997[_0x9f4c('0x2d')];if(!_0x2138f1[_0x9f4c('0x2e')]['hasOwnProperty'](_0x9f4c('0x35'))){_0x55a4ac[_0x9f4c('0x1b')]=qs[_0x9f4c('0x1b')](_0x2138f1[_0x9f4c('0x2e')]['limit']);_0x55a4ac[_0x9f4c('0x19')]=qs['offset'](_0x2138f1[_0x9f4c('0x2e')][_0x9f4c('0x19')]);}_0x55a4ac[_0x9f4c('0x36')]=qs[_0x9f4c('0x37')](_0x2138f1[_0x9f4c('0x2e')][_0x9f4c('0x37')]);_0x55a4ac[_0x9f4c('0x38')]=qs[_0x9f4c('0x2f')](_[_0x9f4c('0x39')](_0x2138f1[_0x9f4c('0x2e')],_0x2aa997['filters']));_0x55a4ac[_0x9f4c('0x38')]['ProjectId']=_0x12603f['id'];if(_0x2138f1[_0x9f4c('0x2e')][_0x9f4c('0x3a')]){_0x55a4ac[_0x9f4c('0x38')]=_[_0x9f4c('0x3b')](_0x55a4ac[_0x9f4c('0x38')],{'$or':_[_0x9f4c('0x2a')](_0x55a4ac[_0x9f4c('0x31')],function(_0x5db3be){var _0x19b09b={};_0x19b09b[_0x5db3be]={'$like':'%'+_0x2138f1[_0x9f4c('0x2e')]['filter']+'%'};return _0x19b09b;})});}_0x55a4ac=_[_0x9f4c('0x3b')]({},_0x55a4ac,_0x2138f1[_0x9f4c('0x3d')]);return db[_0x9f4c('0x57')][_0x9f4c('0x1c')]({'where':_0x55a4ac[_0x9f4c('0x38')]})[_0x9f4c('0x20')](function(_0x44cc1f){_0x1ffbd6[_0x9f4c('0x1c')]=_0x44cc1f;if(_0x2138f1[_0x9f4c('0x2e')]['includeAll']){_0x55a4ac[_0x9f4c('0x40')]=[{'all':!![]}];}return db[_0x9f4c('0x57')][_0x9f4c('0x58')](_0x55a4ac);})[_0x9f4c('0x20')](function(_0x371e82){_0x1ffbd6[_0x9f4c('0x41')]=_0x371e82;return _0x1ffbd6;});}})[_0x9f4c('0x20')](respondWithFilteredResult(_0x36cbc6,_0x55a4ac))['catch'](handleError(_0x36cbc6,null));};function char(_0x49c366){return _0x9f4c('0x59')===typeof _0x49c366?String[_0x9f4c('0x5a')][_0x9f4c('0x5b')](null,arguments):_0x49c366;}function needsEncapsulation(_0x127215){return!!_0x127215&&(_0x127215[_0x9f4c('0x5c')]()['indexOf'](char(0xd))>=0x0||_0x127215[_0x9f4c('0x5c')]()[_0x9f4c('0x5d')](char(0xa))>=0x0||_0x127215[_0x9f4c('0x5c')]()[_0x9f4c('0x5d')](char(0x2c))>=0x0||_0x127215[_0x9f4c('0x5c')]()[_0x9f4c('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x224eb5){var _0x498cc8=char(0x22),_0x214e48='\x5c'+char(0x22),_0x1de423=_0x224eb5['toString']()[_0x9f4c('0x5e')](new RegExp(_0x498cc8,'g'),_0x214e48);return _0x498cc8+_0x1de423+_0x498cc8;}exports[_0x9f4c('0x5f')]=function(_0x22ef54,_0x1912c9,_0x1b49cd){var _0xcb283d,_0x3fbb63;var _0x472946={'where':{'ProjectId':_0x22ef54['params']['id']}};if(_0x22ef54[_0x9f4c('0x2e')]['startTime']){_0x472946[_0x9f4c('0x38')]['starttime']=JSON['parse'](_0x22ef54[_0x9f4c('0x2e')][_0x9f4c('0x60')]);}return db[_0x9f4c('0x56')][_0x9f4c('0x58')](_0x472946)[_0x9f4c('0x20')](handleEntityNotFound(_0x1912c9,null))[_0x9f4c('0x20')](function(_0x632ae){if(_0x632ae){_0xcb283d=_0x632ae;return db[_0x9f4c('0x61')][_0x9f4c('0x58')]({'where':{'SessionId':{'$in':_[_0x9f4c('0x2a')](_0xcb283d,'id')},'ProjectId':_0x22ef54[_0x9f4c('0x4e')]['id']},'order':_0x9f4c('0x62')});}})[_0x9f4c('0x20')](handleEntityNotFound(_0x1912c9,null))[_0x9f4c('0x20')](function(_0x285722){if(_0x285722){_0x3fbb63=_0x285722;var _0x2c8f1c={};for(var _0x333edd=0x0,_0x406d47=_0x3fbb63[_0x9f4c('0x33')];_0x333edd<_0x406d47;_0x333edd++){if(!_0x2c8f1c[_0x9f4c('0x34')](_0x3fbb63[_0x333edd][_0x9f4c('0x63')])){_0x2c8f1c[_0x3fbb63[_0x333edd][_0x9f4c('0x63')]]=needsEncapsulation(_0x3fbb63[_0x333edd][_0x9f4c('0x64')])?encapsulate(_0x3fbb63[_0x333edd][_0x9f4c('0x64')]):_0x3fbb63[_0x333edd][_0x9f4c('0x64')];}}var _0x104d21=[],_0x29e563={};for(var _0x5568a3=0x0,_0x7c5300=_0xcb283d[_0x9f4c('0x33')];_0x5568a3<_0x7c5300;_0x5568a3++){_0x29e563={'ProjectId':_0x22ef54[_0x9f4c('0x4e')]['id'],'SessionId':_0xcb283d[_0x5568a3]['id'],'StartTime':moment(_0xcb283d[_0x5568a3][_0x9f4c('0x65')])[_0x9f4c('0x66')](_0x9f4c('0x67'))};for(var _0x594f15=0x0,_0x302a65=_0x3fbb63['length'];_0x594f15<_0x302a65;_0x594f15++){if(_0x3fbb63[_0x594f15][_0x9f4c('0x68')]==_0xcb283d[_0x5568a3]['id']&&_0x2c8f1c[_0x9f4c('0x34')](_0x3fbb63[_0x594f15][_0x9f4c('0x63')])){_0x29e563[_0x2c8f1c[_0x3fbb63[_0x594f15][_0x9f4c('0x63')]]]=_0x3fbb63[_0x594f15][_0x9f4c('0x69')];}}for(var _0x1bef4c in _0x2c8f1c){if(!_0x29e563[_0x9f4c('0x34')](_0x2c8f1c[_0x1bef4c])){_0x29e563[_0x2c8f1c[_0x1bef4c]]=null;}}_0x104d21[_0x9f4c('0x6a')](_0x29e563);}return _0x104d21;}})[_0x9f4c('0x20')](function(_0x3b5658){if(!_[_0x9f4c('0x6b')](_0x3b5658)){var _0x1cb837=toCsv(_0x3b5658);var _0x5f4596=Date[_0x9f4c('0x6c')]();fs[_0x9f4c('0x6d')](util[_0x9f4c('0x66')](_0x9f4c('0x6e'),_0x22ef54[_0x9f4c('0x4e')]['id'],_0x5f4596),_0x1cb837);_0x1912c9[_0x9f4c('0x6f')](_0x9f4c('0x70'),_0x9f4c('0x71')+util['format'](_0x9f4c('0x72'),_0x22ef54[_0x9f4c('0x4e')]['id'],_0x5f4596));_0x1912c9[_0x9f4c('0x6f')](_0x9f4c('0x73'),_0x9f4c('0x74'));return _0x1912c9[_0x9f4c('0x75')](util[_0x9f4c('0x66')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x22ef54['params']['id'],_0x5f4596));}else{return _0x1912c9[_0x9f4c('0x24')](0xcc);}})['catch'](handleError(_0x1912c9,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 810efa8..0b5bb89 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 _0x39a9=['JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','define'];(function(_0x5e3220,_0x17fb02){var _0x361268=function(_0x22b4bc){while(--_0x22b4bc){_0x5e3220['push'](_0x5e3220['shift']());}};_0x361268(++_0x17fb02);}(_0x39a9,0x1d0));var _0x939a=function(_0x383627,_0x5be16e){_0x383627=_0x383627-0x0;var _0x2c16a0=_0x39a9[_0x383627];return _0x2c16a0;};'use strict';var _=require(_0x939a('0x0'));var util=require(_0x939a('0x1'));var logger=require(_0x939a('0x2'))(_0x939a('0x3'));var moment=require(_0x939a('0x4'));var BPromise=require(_0x939a('0x5'));var rp=require(_0x939a('0x6'));var fs=require('fs');var path=require(_0x939a('0x7'));var rimraf=require(_0x939a('0x8'));var config=require(_0x939a('0x9'));var attributes=require(_0x939a('0xa'));module['exports']=function(_0x5793fe,_0xed3974){return _0x5793fe[_0x939a('0xb')](_0x939a('0xc'),attributes,{'tableName':_0x939a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98a8=['jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0x98a8,0x12c));var _0x898a=function(_0x4a4cb4,_0x111acc){_0x4a4cb4=_0x4a4cb4-0x0;var _0x2e84a2=_0x98a8[_0x4a4cb4];return _0x2e84a2;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var logger=require(_0x898a('0x2'))(_0x898a('0x3'));var moment=require(_0x898a('0x4'));var BPromise=require(_0x898a('0x5'));var rp=require(_0x898a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var attributes=require(_0x898a('0x9'));module[_0x898a('0xa')]=function(_0x3e7ddd,_0x5d7e59){return _0x3e7ddd[_0x898a('0xb')]('JscriptyProject',attributes,{'tableName':_0x898a('0xc'),'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 0284a73..0231ba4 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x12d04e,_0x134d77){var _0x30612d=function(_0x13dc3c){while(--_0x13dc3c){_0x12d04e['push'](_0x12d04e['shift']());}};_0x30612d(++_0x134d77);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x533ca6,_0x4ed3fb){var _0x34f0bd=function(_0x2cc877){while(--_0x2cc877){_0x533ca6['push'](_0x533ca6['shift']());}};_0x34f0bd(++_0x4ed3fb);}(_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 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/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 5d194db..c5496bd 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 _0xba48=['show','post','create','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id'];(function(_0x9eb2b0,_0x387c06){var _0x3936bf=function(_0x3f14dc){while(--_0x3f14dc){_0x9eb2b0['push'](_0x9eb2b0['shift']());}};_0x3936bf(++_0x387c06);}(_0xba48,0x78));var _0x8ba4=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xba48[_0x5037ab];return _0x512adb;};'use strict';var multer=require(_0x8ba4('0x0'));var util=require(_0x8ba4('0x1'));var path=require('path');var timeout=require(_0x8ba4('0x2'));var express=require(_0x8ba4('0x3'));var router=express[_0x8ba4('0x4')]();var fs_extra=require(_0x8ba4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8ba4('0x6'));var config=require(_0x8ba4('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0x8ba4('0x8')]('/',auth['isAuthenticated'](),controller[_0x8ba4('0x9')]);router[_0x8ba4('0x8')]('/describe',auth[_0x8ba4('0xa')](),controller[_0x8ba4('0xb')]);router[_0x8ba4('0x8')](_0x8ba4('0xc'),auth['isAuthenticated'](),controller[_0x8ba4('0xd')]);router[_0x8ba4('0xe')]('/',auth[_0x8ba4('0xa')](),controller[_0x8ba4('0xf')]);router['put'](_0x8ba4('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x8ba4('0x10')](_0x8ba4('0xc'),auth['isAuthenticated'](),controller[_0x8ba4('0x11')]);module[_0x8ba4('0x12')]=router; \ No newline at end of file +var _0x63e2=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra'];(function(_0x2f1d7a,_0x528503){var _0x12e2e4=function(_0x200c3d){while(--_0x200c3d){_0x2f1d7a['push'](_0x2f1d7a['shift']());}};_0x12e2e4(++_0x528503);}(_0x63e2,0x130));var _0x263e=function(_0x5e3d07,_0x2b7265){_0x5e3d07=_0x5e3d07-0x0;var _0x5b883a=_0x63e2[_0x5e3d07];return _0x5b883a;};'use strict';var multer=require(_0x263e('0x0'));var util=require(_0x263e('0x1'));var path=require('path');var timeout=require(_0x263e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x263e('0x3'));var auth=require(_0x263e('0x4'));var interaction=require(_0x263e('0x5'));var config=require(_0x263e('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x263e('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x263e('0x8')](),controller['describe']);router[_0x263e('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x263e('0x9')]('/',auth[_0x263e('0x8')](),controller['create']);router['put']('/:id',auth[_0x263e('0x8')](),controller[_0x263e('0xa')]);router[_0x263e('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x263e('0xc')]);module[_0x263e('0xd')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 753cea6..e200616 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(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7a54,0x106));var _0x47a5=function(_0x59d7de,_0x5eca6b){_0x59d7de=_0x59d7de-0x0;var _0x348a39=_0x7a54[_0x59d7de];return _0x348a39;};'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(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7a54,0x106));var _0x47a5=function(_0x5c6f59,_0x3f8d39){_0x5c6f59=_0x5c6f59-0x0;var _0x5ae779=_0x7a54[_0x5c6f59];return _0x5ae779;};'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 f117069..de4e3d7 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 _0xd37b=['destroy','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','save','update','then'];(function(_0x1e2d66,_0x466a9a){var _0x1f2b4e=function(_0x389c6f){while(--_0x389c6f){_0x1e2d66['push'](_0x1e2d66['shift']());}};_0x1f2b4e(++_0x466a9a);}(_0xd37b,0x19a));var _0xbd37=function(_0x1116f9,_0x546174){_0x1116f9=_0x1116f9-0x0;var _0x4289a8=_0xd37b[_0x1116f9];return _0x4289a8;};'use strict';var emlformat=require(_0xbd37('0x0'));var rimraf=require(_0xbd37('0x1'));var zipdir=require(_0xbd37('0x2'));var jsonpatch=require(_0xbd37('0x3'));var rp=require(_0xbd37('0x4'));var moment=require('moment');var BPromise=require(_0xbd37('0x5'));var Mustache=require(_0xbd37('0x6'));var util=require(_0xbd37('0x7'));var path=require(_0xbd37('0x8'));var sox=require('sox');var csv=require(_0xbd37('0x9'));var ejs=require(_0xbd37('0xa'));var fs=require('fs');var fs_extra=require(_0xbd37('0xb'));var _=require(_0xbd37('0xc'));var squel=require(_0xbd37('0xd'));var crypto=require(_0xbd37('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbd37('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbd37('0x10'));var Papa=require(_0xbd37('0x11'));var Redis=require(_0xbd37('0x12'));var authService=require(_0xbd37('0x13'));var qs=require(_0xbd37('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd37('0x15'));var logger=require(_0xbd37('0x16'))(_0xbd37('0x17'));var utils=require(_0xbd37('0x18'));var config=require(_0xbd37('0x19'));var licenseUtil=require(_0xbd37('0x1a'));var db=require(_0xbd37('0x1b'))['db'];function respondWithStatusCode(_0x32c1ee,_0x50c218){_0x50c218=_0x50c218||0xcc;return function(_0x3419b8){if(_0x3419b8){return _0x32c1ee[_0xbd37('0x1c')](_0x50c218);}return _0x32c1ee[_0xbd37('0x1d')](_0x50c218)[_0xbd37('0x1e')]();};}function respondWithResult(_0x261b4a,_0x3a484f){_0x3a484f=_0x3a484f||0xc8;return function(_0xcc8511){if(_0xcc8511){return _0x261b4a[_0xbd37('0x1d')](_0x3a484f)['json'](_0xcc8511);}};}function respondWithFilteredResult(_0x23ff6d,_0x598f66){return function(_0x2768a3){if(_0x2768a3){var _0x553c1f=typeof _0x598f66['offset']===_0xbd37('0x1f')&&typeof _0x598f66['limit']===_0xbd37('0x1f');var _0x8808e1=_0x2768a3[_0xbd37('0x20')];var _0x126db0=_0x553c1f?0x0:_0x598f66[_0xbd37('0x21')];var _0x331510=_0x553c1f?_0x2768a3[_0xbd37('0x20')]:_0x598f66[_0xbd37('0x21')]+_0x598f66[_0xbd37('0x22')];var _0x37995e;if(_0x331510>=_0x8808e1){_0x331510=_0x8808e1;_0x37995e=0xc8;}else{_0x37995e=0xce;}_0x23ff6d[_0xbd37('0x1d')](_0x37995e);return _0x23ff6d[_0xbd37('0x23')](_0xbd37('0x24'),_0x126db0+'-'+_0x331510+'/'+_0x8808e1)['json'](_0x2768a3);}return null;};}function patchUpdates(_0x45cbfe){return function(_0xd417b0){try{jsonpatch['apply'](_0xd417b0,_0x45cbfe,!![]);}catch(_0x567774){return BPromise['reject'](_0x567774);}return _0xd417b0[_0xbd37('0x25')]();};}function saveUpdates(_0x7e66a1,_0x35adf2){return function(_0x2e5f69){if(_0x2e5f69){return _0x2e5f69[_0xbd37('0x26')](_0x7e66a1)[_0xbd37('0x27')](function(_0x466a32){return _0x466a32;});}return null;};}function removeEntity(_0x2f23a8,_0x33b6f0){return function(_0x58b02d){if(_0x58b02d){return _0x58b02d[_0xbd37('0x28')]()[_0xbd37('0x27')](function(){_0x2f23a8[_0xbd37('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37d9b7,_0x59712a){return function(_0x46a83b){if(!_0x46a83b){_0x37d9b7[_0xbd37('0x1c')](0x194);}return _0x46a83b;};}function handleError(_0x4f11ae,_0x3aeb1d){_0x3aeb1d=_0x3aeb1d||0x1f4;return function(_0x523734){logger['error'](_0x523734[_0xbd37('0x29')]);if(_0x523734[_0xbd37('0x2a')]){delete _0x523734['name'];}_0x4f11ae['status'](_0x3aeb1d)['send'](_0x523734);};}exports[_0xbd37('0x2b')]=function(_0x1ca804,_0xa753c6){var _0x550093={},_0x4b0738={},_0x257109={'count':0x0,'rows':[]};var _0x20073e=_[_0xbd37('0x2c')](db[_0xbd37('0x2d')][_0xbd37('0x2e')],function(_0x22c963){return{'name':_0x22c963[_0xbd37('0x2f')],'type':_0x22c963[_0xbd37('0x30')]['key']};});_0x4b0738['model']=_[_0xbd37('0x2c')](_0x20073e,_0xbd37('0x2a'));_0x4b0738['query']=_[_0xbd37('0x31')](_0x1ca804[_0xbd37('0x32')]);_0x4b0738[_0xbd37('0x33')]=_[_0xbd37('0x34')](_0x4b0738[_0xbd37('0x35')],_0x4b0738['query']);_0x550093[_0xbd37('0x36')]=_['intersection'](_0x4b0738['model'],qs[_0xbd37('0x37')](_0x1ca804['query']['fields']));_0x550093[_0xbd37('0x36')]=_0x550093['attributes'][_0xbd37('0x38')]?_0x550093[_0xbd37('0x36')]:_0x4b0738[_0xbd37('0x35')];if(!_0x1ca804[_0xbd37('0x32')]['hasOwnProperty'](_0xbd37('0x39'))){_0x550093['limit']=qs[_0xbd37('0x22')](_0x1ca804[_0xbd37('0x32')][_0xbd37('0x22')]);_0x550093[_0xbd37('0x21')]=qs[_0xbd37('0x21')](_0x1ca804[_0xbd37('0x32')][_0xbd37('0x21')]);}_0x550093[_0xbd37('0x3a')]=qs[_0xbd37('0x3b')](_0x1ca804[_0xbd37('0x32')][_0xbd37('0x3b')]);_0x550093[_0xbd37('0x3c')]=qs[_0xbd37('0x33')](_['pick'](_0x1ca804[_0xbd37('0x32')],_0x4b0738[_0xbd37('0x33')]),_0x20073e);if(_0x1ca804[_0xbd37('0x32')][_0xbd37('0x3d')]){_0x550093[_0xbd37('0x3c')]=_['merge'](_0x550093[_0xbd37('0x3c')],{'$or':_['map'](_0x20073e,function(_0x59f59d){if(_0x59f59d['type']!==_0xbd37('0x3e')){var _0x12394d={};_0x12394d[_0x59f59d['name']]={'$like':'%'+_0x1ca804[_0xbd37('0x32')][_0xbd37('0x3d')]+'%'};return _0x12394d;}})});}_0x550093=_['merge']({},_0x550093,_0x1ca804['options']);var _0x15195a={'where':_0x550093[_0xbd37('0x3c')]};return db[_0xbd37('0x2d')][_0xbd37('0x20')](_0x15195a)[_0xbd37('0x27')](function(_0x3147a3){_0x257109[_0xbd37('0x20')]=_0x3147a3;if(_0x1ca804[_0xbd37('0x32')][_0xbd37('0x3f')]){_0x550093[_0xbd37('0x40')]=[{'all':!![]}];}return db[_0xbd37('0x2d')][_0xbd37('0x41')](_0x550093);})['then'](function(_0x286195){_0x257109[_0xbd37('0x42')]=_0x286195;return _0x257109;})[_0xbd37('0x27')](respondWithFilteredResult(_0xa753c6,_0x550093))[_0xbd37('0x43')](handleError(_0xa753c6,null));};exports[_0xbd37('0x44')]=function(_0x2bcbb7,_0x147c85){var _0x4cb8dc={'raw':!![],'where':{'id':_0x2bcbb7[_0xbd37('0x45')]['id']}},_0x4fceac={};_0x4fceac['model']=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0x4fceac[_0xbd37('0x32')]=_[_0xbd37('0x31')](_0x2bcbb7[_0xbd37('0x32')]);_0x4fceac[_0xbd37('0x33')]=_[_0xbd37('0x34')](_0x4fceac[_0xbd37('0x35')],_0x4fceac[_0xbd37('0x32')]);_0x4cb8dc['attributes']=_[_0xbd37('0x34')](_0x4fceac[_0xbd37('0x35')],qs[_0xbd37('0x37')](_0x2bcbb7[_0xbd37('0x32')][_0xbd37('0x37')]));_0x4cb8dc[_0xbd37('0x36')]=_0x4cb8dc[_0xbd37('0x36')][_0xbd37('0x38')]?_0x4cb8dc[_0xbd37('0x36')]:_0x4fceac[_0xbd37('0x35')];if(_0x2bcbb7['query'][_0xbd37('0x3f')]){_0x4cb8dc[_0xbd37('0x40')]=[{'all':!![]}];}_0x4cb8dc=_['merge']({},_0x4cb8dc,_0x2bcbb7[_0xbd37('0x46')]);return db[_0xbd37('0x2d')][_0xbd37('0x47')](_0x4cb8dc)[_0xbd37('0x27')](handleEntityNotFound(_0x147c85,null))[_0xbd37('0x27')](respondWithResult(_0x147c85,null))[_0xbd37('0x43')](handleError(_0x147c85,null));};exports[_0xbd37('0x48')]=function(_0x2d4d25,_0x5a3962){return db[_0xbd37('0x2d')][_0xbd37('0x48')](_0x2d4d25[_0xbd37('0x49')],{})['then'](respondWithResult(_0x5a3962,0xc9))[_0xbd37('0x43')](handleError(_0x5a3962,null));};exports['update']=function(_0x584f12,_0x32408d){if(_0x584f12[_0xbd37('0x49')]['id']){delete _0x584f12['body']['id'];}return db[_0xbd37('0x2d')]['find']({'where':{'id':_0x584f12[_0xbd37('0x45')]['id']}})[_0xbd37('0x27')](handleEntityNotFound(_0x32408d,null))[_0xbd37('0x27')](saveUpdates(_0x584f12[_0xbd37('0x49')],null))[_0xbd37('0x27')](respondWithResult(_0x32408d,null))[_0xbd37('0x43')](handleError(_0x32408d,null));};exports['destroy']=function(_0x39acca,_0x5cfa00){return db[_0xbd37('0x2d')][_0xbd37('0x47')]({'where':{'id':_0x39acca[_0xbd37('0x45')]['id']}})[_0xbd37('0x27')](handleEntityNotFound(_0x5cfa00,null))[_0xbd37('0x27')](removeEntity(_0x5cfa00,null))[_0xbd37('0x43')](handleError(_0x5cfa00,null));};exports[_0xbd37('0x4a')]=function(_0x344b04,_0xbb9b46){return db['JscriptyQuestionReport']['describe']()[_0xbd37('0x27')](respondWithResult(_0xbb9b46,null))[_0xbd37('0x43')](handleError(_0xbb9b46,null));}; \ No newline at end of file +var _0x5036=['set','Content-Range','json','apply','save','update','then','destroy','error','stack','map','JscriptyQuestionReport','rawAttributes','type','key','name','query','keys','filters','intersection','model','attributes','fields','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count'];(function(_0xbf7088,_0x18895c){var _0x44011f=function(_0x58e8bc){while(--_0x58e8bc){_0xbf7088['push'](_0xbf7088['shift']());}};_0x44011f(++_0x18895c);}(_0x5036,0xbf));var _0x6503=function(_0x5ef55a,_0x2a03b1){_0x5ef55a=_0x5ef55a-0x0;var _0x20ae40=_0x5036[_0x5ef55a];return _0x20ae40;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6503('0x0'));var zipdir=require(_0x6503('0x1'));var jsonpatch=require(_0x6503('0x2'));var rp=require(_0x6503('0x3'));var moment=require(_0x6503('0x4'));var BPromise=require(_0x6503('0x5'));var Mustache=require(_0x6503('0x6'));var util=require(_0x6503('0x7'));var path=require('path');var sox=require(_0x6503('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6503('0x9'));var _=require(_0x6503('0xa'));var squel=require(_0x6503('0xb'));var crypto=require(_0x6503('0xc'));var jsforce=require(_0x6503('0xd'));var deskjs=require(_0x6503('0xe'));var toCsv=require(_0x6503('0xf'));var querystring=require(_0x6503('0x10'));var Papa=require('papaparse');var Redis=require(_0x6503('0x11'));var authService=require(_0x6503('0x12'));var qs=require(_0x6503('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6503('0x14'));var logger=require(_0x6503('0x15'))(_0x6503('0x16'));var utils=require(_0x6503('0x17'));var config=require(_0x6503('0x18'));var licenseUtil=require(_0x6503('0x19'));var db=require(_0x6503('0x1a'))['db'];function respondWithStatusCode(_0x589208,_0x19129f){_0x19129f=_0x19129f||0xcc;return function(_0x1a3644){if(_0x1a3644){return _0x589208[_0x6503('0x1b')](_0x19129f);}return _0x589208[_0x6503('0x1c')](_0x19129f)[_0x6503('0x1d')]();};}function respondWithResult(_0x2b5455,_0x1040d4){_0x1040d4=_0x1040d4||0xc8;return function(_0xc576d){if(_0xc576d){return _0x2b5455[_0x6503('0x1c')](_0x1040d4)['json'](_0xc576d);}};}function respondWithFilteredResult(_0x172db7,_0x6e72b7){return function(_0x46ce2e){if(_0x46ce2e){var _0x1ee849=typeof _0x6e72b7[_0x6503('0x1e')]===_0x6503('0x1f')&&typeof _0x6e72b7[_0x6503('0x20')]===_0x6503('0x1f');var _0x2cd478=_0x46ce2e[_0x6503('0x21')];var _0x5ef388=_0x1ee849?0x0:_0x6e72b7[_0x6503('0x1e')];var _0x233ede=_0x1ee849?_0x46ce2e[_0x6503('0x21')]:_0x6e72b7['offset']+_0x6e72b7[_0x6503('0x20')];var _0x5b4a2d;if(_0x233ede>=_0x2cd478){_0x233ede=_0x2cd478;_0x5b4a2d=0xc8;}else{_0x5b4a2d=0xce;}_0x172db7[_0x6503('0x1c')](_0x5b4a2d);return _0x172db7[_0x6503('0x22')](_0x6503('0x23'),_0x5ef388+'-'+_0x233ede+'/'+_0x2cd478)[_0x6503('0x24')](_0x46ce2e);}return null;};}function patchUpdates(_0x39b62a){return function(_0x332139){try{jsonpatch[_0x6503('0x25')](_0x332139,_0x39b62a,!![]);}catch(_0x296137){return BPromise['reject'](_0x296137);}return _0x332139[_0x6503('0x26')]();};}function saveUpdates(_0xd18c25,_0x22fc5a){return function(_0x20344e){if(_0x20344e){return _0x20344e[_0x6503('0x27')](_0xd18c25)[_0x6503('0x28')](function(_0x45c767){return _0x45c767;});}return null;};}function removeEntity(_0x39c4c8,_0x52e345){return function(_0x38a355){if(_0x38a355){return _0x38a355[_0x6503('0x29')]()[_0x6503('0x28')](function(){_0x39c4c8[_0x6503('0x1c')](0xcc)[_0x6503('0x1d')]();});}};}function handleEntityNotFound(_0x12eede,_0x682833){return function(_0x2d7cfb){if(!_0x2d7cfb){_0x12eede[_0x6503('0x1b')](0x194);}return _0x2d7cfb;};}function handleError(_0x368a8a,_0xfa7797){_0xfa7797=_0xfa7797||0x1f4;return function(_0x4f3a72){logger[_0x6503('0x2a')](_0x4f3a72[_0x6503('0x2b')]);if(_0x4f3a72['name']){delete _0x4f3a72['name'];}_0x368a8a[_0x6503('0x1c')](_0xfa7797)['send'](_0x4f3a72);};}exports['index']=function(_0x4a477a,_0x5203a6){var _0x4db345={},_0x4d659e={},_0x403976={'count':0x0,'rows':[]};var _0x575a34=_[_0x6503('0x2c')](db[_0x6503('0x2d')][_0x6503('0x2e')],function(_0x409856){return{'name':_0x409856['fieldName'],'type':_0x409856[_0x6503('0x2f')][_0x6503('0x30')]};});_0x4d659e['model']=_[_0x6503('0x2c')](_0x575a34,_0x6503('0x31'));_0x4d659e[_0x6503('0x32')]=_[_0x6503('0x33')](_0x4a477a[_0x6503('0x32')]);_0x4d659e[_0x6503('0x34')]=_[_0x6503('0x35')](_0x4d659e[_0x6503('0x36')],_0x4d659e[_0x6503('0x32')]);_0x4db345[_0x6503('0x37')]=_[_0x6503('0x35')](_0x4d659e[_0x6503('0x36')],qs[_0x6503('0x38')](_0x4a477a['query'][_0x6503('0x38')]));_0x4db345[_0x6503('0x37')]=_0x4db345[_0x6503('0x37')]['length']?_0x4db345[_0x6503('0x37')]:_0x4d659e[_0x6503('0x36')];if(!_0x4a477a['query']['hasOwnProperty']('nolimit')){_0x4db345[_0x6503('0x20')]=qs[_0x6503('0x20')](_0x4a477a[_0x6503('0x32')][_0x6503('0x20')]);_0x4db345[_0x6503('0x1e')]=qs[_0x6503('0x1e')](_0x4a477a[_0x6503('0x32')][_0x6503('0x1e')]);}_0x4db345[_0x6503('0x39')]=qs[_0x6503('0x3a')](_0x4a477a[_0x6503('0x32')][_0x6503('0x3a')]);_0x4db345[_0x6503('0x3b')]=qs['filters'](_['pick'](_0x4a477a['query'],_0x4d659e[_0x6503('0x34')]),_0x575a34);if(_0x4a477a['query'][_0x6503('0x3c')]){_0x4db345[_0x6503('0x3b')]=_[_0x6503('0x3d')](_0x4db345[_0x6503('0x3b')],{'$or':_['map'](_0x575a34,function(_0x592455){if(_0x592455[_0x6503('0x2f')]!==_0x6503('0x3e')){var _0xdd7744={};_0xdd7744[_0x592455[_0x6503('0x31')]]={'$like':'%'+_0x4a477a[_0x6503('0x32')]['filter']+'%'};return _0xdd7744;}})});}_0x4db345=_[_0x6503('0x3d')]({},_0x4db345,_0x4a477a[_0x6503('0x3f')]);var _0xa3dd34={'where':_0x4db345[_0x6503('0x3b')]};return db[_0x6503('0x2d')][_0x6503('0x21')](_0xa3dd34)[_0x6503('0x28')](function(_0x2b7148){_0x403976[_0x6503('0x21')]=_0x2b7148;if(_0x4a477a['query'][_0x6503('0x40')]){_0x4db345[_0x6503('0x41')]=[{'all':!![]}];}return db[_0x6503('0x2d')][_0x6503('0x42')](_0x4db345);})[_0x6503('0x28')](function(_0xb47815){_0x403976[_0x6503('0x43')]=_0xb47815;return _0x403976;})['then'](respondWithFilteredResult(_0x5203a6,_0x4db345))[_0x6503('0x44')](handleError(_0x5203a6,null));};exports['show']=function(_0x1a38a6,_0x519ae0){var _0x5ac660={'raw':!![],'where':{'id':_0x1a38a6[_0x6503('0x45')]['id']}},_0x218afb={};_0x218afb[_0x6503('0x36')]=_[_0x6503('0x33')](db[_0x6503('0x2d')][_0x6503('0x2e')]);_0x218afb[_0x6503('0x32')]=_[_0x6503('0x33')](_0x1a38a6[_0x6503('0x32')]);_0x218afb['filters']=_[_0x6503('0x35')](_0x218afb[_0x6503('0x36')],_0x218afb[_0x6503('0x32')]);_0x5ac660['attributes']=_['intersection'](_0x218afb[_0x6503('0x36')],qs[_0x6503('0x38')](_0x1a38a6[_0x6503('0x32')][_0x6503('0x38')]));_0x5ac660[_0x6503('0x37')]=_0x5ac660[_0x6503('0x37')][_0x6503('0x46')]?_0x5ac660['attributes']:_0x218afb[_0x6503('0x36')];if(_0x1a38a6[_0x6503('0x32')][_0x6503('0x40')]){_0x5ac660[_0x6503('0x41')]=[{'all':!![]}];}_0x5ac660=_['merge']({},_0x5ac660,_0x1a38a6[_0x6503('0x3f')]);return db[_0x6503('0x2d')][_0x6503('0x47')](_0x5ac660)['then'](handleEntityNotFound(_0x519ae0,null))['then'](respondWithResult(_0x519ae0,null))['catch'](handleError(_0x519ae0,null));};exports['create']=function(_0x419c11,_0x7d966c){return db['JscriptyQuestionReport'][_0x6503('0x48')](_0x419c11[_0x6503('0x49')],{})[_0x6503('0x28')](respondWithResult(_0x7d966c,0xc9))[_0x6503('0x44')](handleError(_0x7d966c,null));};exports[_0x6503('0x27')]=function(_0x11666c,_0x844f2d){if(_0x11666c[_0x6503('0x49')]['id']){delete _0x11666c[_0x6503('0x49')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x11666c['params']['id']}})[_0x6503('0x28')](handleEntityNotFound(_0x844f2d,null))[_0x6503('0x28')](saveUpdates(_0x11666c[_0x6503('0x49')],null))[_0x6503('0x28')](respondWithResult(_0x844f2d,null))[_0x6503('0x44')](handleError(_0x844f2d,null));};exports[_0x6503('0x29')]=function(_0x203f35,_0x48c59b){return db['JscriptyQuestionReport'][_0x6503('0x47')]({'where':{'id':_0x203f35[_0x6503('0x45')]['id']}})['then'](handleEntityNotFound(_0x48c59b,null))['then'](removeEntity(_0x48c59b,null))[_0x6503('0x44')](handleError(_0x48c59b,null));};exports[_0x6503('0x4a')]=function(_0x1c5ad5,_0x314ade){return db[_0x6503('0x2d')]['describe']()[_0x6503('0x28')](respondWithResult(_0x314ade,null))[_0x6503('0x44')](handleError(_0x314ade,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 42e6e0d..cd551dc 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 _0x1f81=['moment','path','../../config/environment','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger'];(function(_0x190d72,_0x1a7de9){var _0x2292db=function(_0x43c33c){while(--_0x43c33c){_0x190d72['push'](_0x190d72['shift']());}};_0x2292db(++_0x1a7de9);}(_0x1f81,0x12b));var _0x11f8=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x1f81[_0xbc346f];return _0x9f9260;};'use strict';var _=require(_0x11f8('0x0'));var util=require('util');var logger=require(_0x11f8('0x1'))('api');var moment=require(_0x11f8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x11f8('0x3'));var rimraf=require('rimraf');var config=require(_0x11f8('0x4'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x2aebe0,_0x502528){return _0x2aebe0['define'](_0x11f8('0x5'),attributes,{'tableName':_0x11f8('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1838=['request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash','api','moment','bluebird'];(function(_0x10465a,_0x20f2b3){var _0x1c72fd=function(_0x48c0ed){while(--_0x48c0ed){_0x10465a['push'](_0x10465a['shift']());}};_0x1c72fd(++_0x20f2b3);}(_0x1838,0xe3));var _0x8183=function(_0x28febe,_0x31eb8a){_0x28febe=_0x28febe-0x0;var _0x3cc2a1=_0x1838[_0x28febe];return _0x3cc2a1;};'use strict';var _=require(_0x8183('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8183('0x1'));var moment=require(_0x8183('0x2'));var BPromise=require(_0x8183('0x3'));var rp=require(_0x8183('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8183('0x5'));var config=require(_0x8183('0x6'));var attributes=require(_0x8183('0x7'));module['exports']=function(_0x4a591f,_0x469977){return _0x4a591f[_0x8183('0x8')](_0x8183('0x9'),attributes,{'tableName':_0x8183('0xa'),'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 ce5b434..74ac257 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 _0x17db=['lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x1953a3,_0x232d24){var _0x25f41e=function(_0x14651a){while(--_0x14651a){_0x1953a3['push'](_0x1953a3['shift']());}};_0x25f41e(++_0x232d24);}(_0x17db,0x18f));var _0xb17d=function(_0x1666c8,_0x10d04f){_0x1666c8=_0x1666c8-0x0;var _0x38ae80=_0x17db[_0x1666c8];return _0x38ae80;};'use strict';var _=require(_0xb17d('0x0'));var util=require(_0xb17d('0x1'));var moment=require(_0xb17d('0x2'));var BPromise=require(_0xb17d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb17d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb17d('0x5'))(_0xb17d('0x6'));var config=require(_0xb17d('0x7'));var jayson=require(_0xb17d('0x8'));var client=jayson['client'][_0xb17d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x548b79,_0x38c160,_0x4854f3){return new BPromise(function(_0x1a8b2b,_0x3a9859){return client['request'](_0x548b79,_0x4854f3)[_0xb17d('0xa')](function(_0x182760){logger['info'](_0xb17d('0xb'),_0x38c160,_0xb17d('0xc'));logger[_0xb17d('0xd')](_0xb17d('0xe'),_0x38c160,_0xb17d('0xc'),JSON[_0xb17d('0xf')](_0x182760));if(_0x182760[_0xb17d('0x10')]){if(_0x182760[_0xb17d('0x10')]['code']===0x1f4){logger[_0xb17d('0x10')](_0xb17d('0xb'),_0x38c160,_0x182760[_0xb17d('0x10')][_0xb17d('0x11')]);return _0x3a9859(_0x182760[_0xb17d('0x10')][_0xb17d('0x11')]);}logger['error'](_0xb17d('0xb'),_0x38c160,_0x182760[_0xb17d('0x10')][_0xb17d('0x11')]);return _0x1a8b2b(_0x182760[_0xb17d('0x10')]['message']);}else{logger[_0xb17d('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x38c160,'request\x20sent');_0x1a8b2b(_0x182760[_0xb17d('0x13')][_0xb17d('0x11')]);}})[_0xb17d('0x14')](function(_0x501b77){logger[_0xb17d('0x10')](_0xb17d('0xb'),_0x38c160,_0x501b77);_0x3a9859(_0x501b77);});});} \ No newline at end of file +var _0xcfa5=['message','result','catch','util','moment','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4789fa,_0x524861){var _0x4726ba=function(_0x16a9b3){while(--_0x16a9b3){_0x4789fa['push'](_0x4789fa['shift']());}};_0x4726ba(++_0x524861);}(_0xcfa5,0x1cb));var _0x5cfa=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcfa5[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x5cfa('0x0'));var moment=require(_0x5cfa('0x1'));var BPromise=require('bluebird');var rs=require(_0x5cfa('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5cfa('0x3'));var config=require(_0x5cfa('0x4'));var jayson=require(_0x5cfa('0x5'));var client=jayson[_0x5cfa('0x6')][_0x5cfa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28d47e,_0x31dd13,_0x539660){return new BPromise(function(_0x31b646,_0xbd91cd){return client[_0x5cfa('0x8')](_0x28d47e,_0x539660)[_0x5cfa('0x9')](function(_0x29e2fa){logger[_0x5cfa('0xa')](_0x5cfa('0xb'),_0x31dd13,'request\x20sent');logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x31dd13,_0x5cfa('0xc'),JSON[_0x5cfa('0xd')](_0x29e2fa));if(_0x29e2fa[_0x5cfa('0xe')]){if(_0x29e2fa[_0x5cfa('0xe')][_0x5cfa('0xf')]===0x1f4){logger['error'](_0x5cfa('0xb'),_0x31dd13,_0x29e2fa['error'][_0x5cfa('0x10')]);return _0xbd91cd(_0x29e2fa['error']['message']);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x31dd13,_0x29e2fa['error']['message']);return _0x31b646(_0x29e2fa[_0x5cfa('0xe')]['message']);}else{logger[_0x5cfa('0xa')](_0x5cfa('0xb'),_0x31dd13,_0x5cfa('0xc'));_0x31b646(_0x29e2fa[_0x5cfa('0x11')]['message']);}})[_0x5cfa('0x12')](function(_0x23f527){logger[_0x5cfa('0xe')](_0x5cfa('0xb'),_0x31dd13,_0x23f527);_0xbd91cd(_0x23f527);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 83339ac..0ad6cfa 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 _0x0f86=['getQuestions','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','index','get','isAuthenticated','/:id','show','/:id/questions'];(function(_0x12caa0,_0x4f8ae5){var _0x43becb=function(_0x4cfe41){while(--_0x4cfe41){_0x12caa0['push'](_0x12caa0['shift']());}};_0x43becb(++_0x4f8ae5);}(_0x0f86,0x16f));var _0x60f8=function(_0x25d12d,_0x5a3481){_0x25d12d=_0x25d12d-0x0;var _0x336336=_0x0f86[_0x25d12d];return _0x336336;};'use strict';var multer=require(_0x60f8('0x0'));var util=require(_0x60f8('0x1'));var path=require(_0x60f8('0x2'));var timeout=require(_0x60f8('0x3'));var express=require(_0x60f8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x60f8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x60f8('0x6'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x60f8('0x7')]);router[_0x60f8('0x8')]('/describe',auth[_0x60f8('0x9')](),controller['describe']);router[_0x60f8('0x8')](_0x60f8('0xa'),auth['isAuthenticated'](),controller[_0x60f8('0xb')]);router[_0x60f8('0x8')](_0x60f8('0xc'),auth['isAuthenticated'](),controller[_0x60f8('0xd')]);router[_0x60f8('0xe')]('/',auth[_0x60f8('0x9')](),controller[_0x60f8('0xf')]);router['put'](_0x60f8('0xa'),auth[_0x60f8('0x9')](),controller[_0x60f8('0x10')]);router[_0x60f8('0x11')]('/:id',auth[_0x60f8('0x9')](),controller[_0x60f8('0x12')]);module['exports']=router; \ No newline at end of file +var _0x94ec=['connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/questions','post','create','/:id','destroy','exports','multer','path'];(function(_0x513d65,_0x156ef6){var _0x307aa9=function(_0x3885d3){while(--_0x3885d3){_0x513d65['push'](_0x513d65['shift']());}};_0x307aa9(++_0x156ef6);}(_0x94ec,0x1e4));var _0xc94e=function(_0x36ddd4,_0x4d667a){_0x36ddd4=_0x36ddd4-0x0;var _0x1f99c5=_0x94ec[_0x36ddd4];return _0x1f99c5;};'use strict';var multer=require(_0xc94e('0x0'));var util=require('util');var path=require(_0xc94e('0x1'));var timeout=require(_0xc94e('0x2'));var express=require(_0xc94e('0x3'));var router=express[_0xc94e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc94e('0x5'));var controller=require('./jscriptySessionReport.controller');router[_0xc94e('0x6')]('/',auth[_0xc94e('0x7')](),controller[_0xc94e('0x8')]);router[_0xc94e('0x6')](_0xc94e('0x9'),auth[_0xc94e('0x7')](),controller[_0xc94e('0xa')]);router[_0xc94e('0x6')]('/:id',auth[_0xc94e('0x7')](),controller[_0xc94e('0xb')]);router[_0xc94e('0x6')](_0xc94e('0xc'),auth[_0xc94e('0x7')](),controller['getQuestions']);router[_0xc94e('0xd')]('/',auth[_0xc94e('0x7')](),controller[_0xc94e('0xe')]);router['put'](_0xc94e('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc94e('0xf'),auth[_0xc94e('0x7')](),controller[_0xc94e('0x10')]);module[_0xc94e('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index d3a6d36..50dd82a 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 _0x266a=['moment','sequelize','exports','DATE','starttime','setDataValue','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x2850c0,_0x1363a7){var _0x21e830=function(_0x3ec70a){while(--_0x3ec70a){_0x2850c0['push'](_0x2850c0['shift']());}};_0x21e830(++_0x1363a7);}(_0x266a,0x144));var _0xa266=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x266a[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xa266('0x0'));var Sequelize=require(_0xa266('0x1'));module[_0xa266('0x2')]={'starttime':{'type':Sequelize[_0xa266('0x3')],'set':function(_0x3e011f){this['setDataValue'](_0xa266('0x4'),_0x3e011f);this[_0xa266('0x5')]('endtime',moment()['format'](_0xa266('0x6')));}},'endtime':{'type':Sequelize[_0xa266('0x3')]},'membername':{'type':Sequelize[_0xa266('0x7')]},'projectname':{'type':Sequelize[_0xa266('0x7')]},'queue':{'type':Sequelize[_0xa266('0x7')]},'uniqueid':{'type':Sequelize[_0xa266('0x7')]},'calleridname':{'type':Sequelize[_0xa266('0x7')]},'calleridnum':{'type':Sequelize[_0xa266('0x7')]},'completed':{'type':Sequelize[_0xa266('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xc812=['starttime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports','setDataValue'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc812,0xbc));var _0x2c81=function(_0x14807d,_0x4cef56){_0x14807d=_0x14807d-0x0;var _0x15b6ce=_0xc812[_0x14807d];return _0x15b6ce;};'use strict';var moment=require(_0x2c81('0x0'));var Sequelize=require(_0x2c81('0x1'));module[_0x2c81('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x143b6d){this[_0x2c81('0x3')](_0x2c81('0x4'),_0x143b6d);this[_0x2c81('0x3')]('endtime',moment()[_0x2c81('0x5')](_0x2c81('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x2c81('0x7')]},'projectname':{'type':Sequelize[_0x2c81('0x7')]},'queue':{'type':Sequelize[_0x2c81('0x7')]},'uniqueid':{'type':Sequelize[_0x2c81('0x7')]},'calleridname':{'type':Sequelize[_0x2c81('0x7')]},'calleridnum':{'type':Sequelize[_0x2c81('0x7')]},'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 6474365..41448c6 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 _0xa633=['map','JscriptySessionReport','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','pick','eml-format','rimraf','zip-dir','moment','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','../../config/license/util','status','offset','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','stack','send','index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa633,0x10d));var _0x3a63=function(_0xa8dc05,_0x329d79){_0xa8dc05=_0xa8dc05-0x0;var _0x47de80=_0xa633[_0xa8dc05];return _0x47de80;};'use strict';var emlformat=require(_0x3a63('0x0'));var rimraf=require(_0x3a63('0x1'));var zipdir=require(_0x3a63('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3a63('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3a63('0x4'));var sox=require(_0x3a63('0x5'));var csv=require(_0x3a63('0x6'));var ejs=require(_0x3a63('0x7'));var fs=require('fs');var fs_extra=require(_0x3a63('0x8'));var _=require(_0x3a63('0x9'));var squel=require(_0x3a63('0xa'));var crypto=require(_0x3a63('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3a63('0xc'));var toCsv=require(_0x3a63('0x6'));var querystring=require(_0x3a63('0xd'));var Papa=require(_0x3a63('0xe'));var Redis=require(_0x3a63('0xf'));var authService=require(_0x3a63('0x10'));var qs=require(_0x3a63('0x11'));var as=require(_0x3a63('0x12'));var hardwareService=require(_0x3a63('0x13'));var logger=require(_0x3a63('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3a63('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15c0a9,_0x4afa49){_0x4afa49=_0x4afa49||0xcc;return function(_0x4720c5){if(_0x4720c5){return _0x15c0a9['sendStatus'](_0x4afa49);}return _0x15c0a9[_0x3a63('0x16')](_0x4afa49)['end']();};}function respondWithResult(_0x44e7be,_0x2ad8f5){_0x2ad8f5=_0x2ad8f5||0xc8;return function(_0x3df74c){if(_0x3df74c){return _0x44e7be[_0x3a63('0x16')](_0x2ad8f5)['json'](_0x3df74c);}};}function respondWithFilteredResult(_0x5dac88,_0x22bbee){return function(_0x5c90e3){if(_0x5c90e3){var _0x3c6cbd=typeof _0x22bbee[_0x3a63('0x17')]==='undefined'&&typeof _0x22bbee[_0x3a63('0x18')]==='undefined';var _0x78cac4=_0x5c90e3[_0x3a63('0x19')];var _0x3eae6b=_0x3c6cbd?0x0:_0x22bbee[_0x3a63('0x17')];var _0x1dcacc=_0x3c6cbd?_0x5c90e3['count']:_0x22bbee['offset']+_0x22bbee['limit'];var _0x220a9e;if(_0x1dcacc>=_0x78cac4){_0x1dcacc=_0x78cac4;_0x220a9e=0xc8;}else{_0x220a9e=0xce;}_0x5dac88[_0x3a63('0x16')](_0x220a9e);return _0x5dac88['set'](_0x3a63('0x1a'),_0x3eae6b+'-'+_0x1dcacc+'/'+_0x78cac4)[_0x3a63('0x1b')](_0x5c90e3);}return null;};}function patchUpdates(_0x367c69){return function(_0x1d53c6){try{jsonpatch[_0x3a63('0x1c')](_0x1d53c6,_0x367c69,!![]);}catch(_0x16a4b7){return BPromise[_0x3a63('0x1d')](_0x16a4b7);}return _0x1d53c6[_0x3a63('0x1e')]();};}function saveUpdates(_0x10940c,_0x2bdaea){return function(_0x186669){if(_0x186669){return _0x186669[_0x3a63('0x1f')](_0x10940c)[_0x3a63('0x20')](function(_0x57d879){return _0x57d879;});}return null;};}function removeEntity(_0x57aa41,_0x5d7bc4){return function(_0x484060){if(_0x484060){return _0x484060[_0x3a63('0x21')]()[_0x3a63('0x20')](function(){_0x57aa41['status'](0xcc)[_0x3a63('0x22')]();});}};}function handleEntityNotFound(_0x5cd8d5,_0x57373a){return function(_0x332df4){if(!_0x332df4){_0x5cd8d5[_0x3a63('0x23')](0x194);}return _0x332df4;};}function handleError(_0x2cf89a,_0x2cdb1c){_0x2cdb1c=_0x2cdb1c||0x1f4;return function(_0x264cf1){logger['error'](_0x264cf1[_0x3a63('0x24')]);if(_0x264cf1['name']){delete _0x264cf1['name'];}_0x2cf89a['status'](_0x2cdb1c)[_0x3a63('0x25')](_0x264cf1);};}exports[_0x3a63('0x26')]=function(_0x165b24,_0x562d93){var _0x2b49d3={},_0x135cf1={},_0x539d7f={'count':0x0,'rows':[]};var _0x14a36b=_[_0x3a63('0x27')](db[_0x3a63('0x28')][_0x3a63('0x29')],function(_0x28e7a7){return{'name':_0x28e7a7[_0x3a63('0x2a')],'type':_0x28e7a7[_0x3a63('0x2b')][_0x3a63('0x2c')]};});_0x135cf1['model']=_[_0x3a63('0x27')](_0x14a36b,_0x3a63('0x2d'));_0x135cf1[_0x3a63('0x2e')]=_[_0x3a63('0x2f')](_0x165b24['query']);_0x135cf1[_0x3a63('0x30')]=_[_0x3a63('0x31')](_0x135cf1['model'],_0x135cf1['query']);_0x2b49d3[_0x3a63('0x32')]=_[_0x3a63('0x31')](_0x135cf1[_0x3a63('0x33')],qs[_0x3a63('0x34')](_0x165b24[_0x3a63('0x2e')][_0x3a63('0x34')]));_0x2b49d3[_0x3a63('0x32')]=_0x2b49d3[_0x3a63('0x32')][_0x3a63('0x35')]?_0x2b49d3['attributes']:_0x135cf1[_0x3a63('0x33')];if(!_0x165b24['query']['hasOwnProperty'](_0x3a63('0x36'))){_0x2b49d3[_0x3a63('0x18')]=qs[_0x3a63('0x18')](_0x165b24['query'][_0x3a63('0x18')]);_0x2b49d3[_0x3a63('0x17')]=qs[_0x3a63('0x17')](_0x165b24[_0x3a63('0x2e')][_0x3a63('0x17')]);}_0x2b49d3[_0x3a63('0x37')]=qs[_0x3a63('0x38')](_0x165b24[_0x3a63('0x2e')][_0x3a63('0x38')]);_0x2b49d3[_0x3a63('0x39')]=qs[_0x3a63('0x30')](_['pick'](_0x165b24[_0x3a63('0x2e')],_0x135cf1[_0x3a63('0x30')]),_0x14a36b);if(_0x165b24[_0x3a63('0x2e')][_0x3a63('0x3a')]){_0x2b49d3[_0x3a63('0x39')]=_[_0x3a63('0x3b')](_0x2b49d3[_0x3a63('0x39')],{'$or':_[_0x3a63('0x27')](_0x14a36b,function(_0xc4ebea){if(_0xc4ebea[_0x3a63('0x2b')]!==_0x3a63('0x3c')){var _0x195668={};_0x195668[_0xc4ebea[_0x3a63('0x2d')]]={'$like':'%'+_0x165b24[_0x3a63('0x2e')]['filter']+'%'};return _0x195668;}})});}_0x2b49d3=_['merge']({},_0x2b49d3,_0x165b24['options']);var _0x35c05f={'where':_0x2b49d3[_0x3a63('0x39')]};return db['JscriptySessionReport'][_0x3a63('0x19')](_0x35c05f)[_0x3a63('0x20')](function(_0x558276){_0x539d7f[_0x3a63('0x19')]=_0x558276;if(_0x165b24[_0x3a63('0x2e')][_0x3a63('0x3d')]){_0x2b49d3[_0x3a63('0x3e')]=[{'all':!![]}];}return db[_0x3a63('0x28')][_0x3a63('0x3f')](_0x2b49d3);})[_0x3a63('0x20')](function(_0x4a9044){_0x539d7f['rows']=_0x4a9044;return _0x539d7f;})[_0x3a63('0x20')](respondWithFilteredResult(_0x562d93,_0x2b49d3))[_0x3a63('0x40')](handleError(_0x562d93,null));};exports[_0x3a63('0x41')]=function(_0x2a5ffb,_0x1e7d7c){var _0x165919={'raw':!![],'where':{'id':_0x2a5ffb[_0x3a63('0x42')]['id']}},_0x574a43={};_0x574a43['model']=_[_0x3a63('0x2f')](db['JscriptySessionReport']['rawAttributes']);_0x574a43[_0x3a63('0x2e')]=_[_0x3a63('0x2f')](_0x2a5ffb[_0x3a63('0x2e')]);_0x574a43['filters']=_[_0x3a63('0x31')](_0x574a43[_0x3a63('0x33')],_0x574a43['query']);_0x165919[_0x3a63('0x32')]=_[_0x3a63('0x31')](_0x574a43[_0x3a63('0x33')],qs[_0x3a63('0x34')](_0x2a5ffb[_0x3a63('0x2e')]['fields']));_0x165919['attributes']=_0x165919[_0x3a63('0x32')][_0x3a63('0x35')]?_0x165919[_0x3a63('0x32')]:_0x574a43[_0x3a63('0x33')];if(_0x2a5ffb['query'][_0x3a63('0x3d')]){_0x165919[_0x3a63('0x3e')]=[{'all':!![]}];}_0x165919=_['merge']({},_0x165919,_0x2a5ffb[_0x3a63('0x43')]);return db[_0x3a63('0x28')][_0x3a63('0x44')](_0x165919)['then'](handleEntityNotFound(_0x1e7d7c,null))[_0x3a63('0x20')](respondWithResult(_0x1e7d7c,null))[_0x3a63('0x40')](handleError(_0x1e7d7c,null));};exports[_0x3a63('0x45')]=function(_0x4d7cc6,_0x4c9489){return db[_0x3a63('0x28')]['create'](_0x4d7cc6['body'],{})[_0x3a63('0x20')](respondWithResult(_0x4c9489,0xc9))[_0x3a63('0x40')](handleError(_0x4c9489,null));};exports[_0x3a63('0x1f')]=function(_0x9bdcc7,_0x221ed9){if(_0x9bdcc7[_0x3a63('0x46')]['id']){delete _0x9bdcc7[_0x3a63('0x46')]['id'];}return db[_0x3a63('0x28')][_0x3a63('0x44')]({'where':{'id':_0x9bdcc7['params']['id']}})[_0x3a63('0x20')](handleEntityNotFound(_0x221ed9,null))[_0x3a63('0x20')](saveUpdates(_0x9bdcc7[_0x3a63('0x46')],null))[_0x3a63('0x20')](respondWithResult(_0x221ed9,null))[_0x3a63('0x40')](handleError(_0x221ed9,null));};exports['destroy']=function(_0x543c2c,_0x2c02cd){return db[_0x3a63('0x28')][_0x3a63('0x44')]({'where':{'id':_0x543c2c[_0x3a63('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c02cd,null))[_0x3a63('0x20')](removeEntity(_0x2c02cd,null))[_0x3a63('0x40')](handleError(_0x2c02cd,null));};exports[_0x3a63('0x47')]=function(_0x8be2a1,_0x288ab8){return db['JscriptySessionReport'][_0x3a63('0x47')]()[_0x3a63('0x20')](respondWithResult(_0x288ab8,null))[_0x3a63('0x40')](handleError(_0x288ab8,null));};exports[_0x3a63('0x48')]=function(_0x271405,_0x3df531,_0x1ac7eb){var _0x1f8c94={'raw':!![],'where':{}};var _0x154a86={};var _0x2ff8aa={'count':0x0,'rows':[]};return db[_0x3a63('0x28')][_0x3a63('0x49')]({'where':{'id':_0x271405[_0x3a63('0x42')]['id']}})[_0x3a63('0x20')](handleEntityNotFound(_0x3df531,null))[_0x3a63('0x20')](function(_0x34dba5){if(_0x34dba5){_0x154a86[_0x3a63('0x33')]=_['keys'](db[_0x3a63('0x4a')][_0x3a63('0x29')]);_0x154a86[_0x3a63('0x2e')]=_['keys'](_0x271405['query']);_0x154a86['filters']=_[_0x3a63('0x31')](_0x154a86[_0x3a63('0x33')],_0x154a86['query']);_0x1f8c94['attributes']=_[_0x3a63('0x31')](_0x154a86[_0x3a63('0x33')],qs[_0x3a63('0x34')](_0x271405[_0x3a63('0x2e')]['fields']));_0x1f8c94[_0x3a63('0x32')]=_0x1f8c94[_0x3a63('0x32')][_0x3a63('0x35')]?_0x1f8c94[_0x3a63('0x32')]:_0x154a86[_0x3a63('0x33')];if(!_0x271405[_0x3a63('0x2e')][_0x3a63('0x4b')](_0x3a63('0x36'))){_0x1f8c94['limit']=qs[_0x3a63('0x18')](_0x271405[_0x3a63('0x2e')]['limit']);_0x1f8c94[_0x3a63('0x17')]=qs[_0x3a63('0x17')](_0x271405['query'][_0x3a63('0x17')]);}_0x1f8c94[_0x3a63('0x37')]=qs[_0x3a63('0x38')](_0x271405[_0x3a63('0x2e')][_0x3a63('0x38')]);_0x1f8c94[_0x3a63('0x39')]=qs[_0x3a63('0x30')](_[_0x3a63('0x4c')](_0x271405[_0x3a63('0x2e')],_0x154a86[_0x3a63('0x30')]));_0x1f8c94[_0x3a63('0x39')]['SessionId']=_0x34dba5['id'];if(_0x271405['query'][_0x3a63('0x3a')]){_0x1f8c94['where']=_[_0x3a63('0x3b')](_0x1f8c94[_0x3a63('0x39')],{'$or':_['map'](_0x1f8c94[_0x3a63('0x32')],function(_0x55a8a1){var _0x51978a={};_0x51978a[_0x55a8a1]={'$like':'%'+_0x271405['query']['filter']+'%'};return _0x51978a;})});}_0x1f8c94=_[_0x3a63('0x3b')]({},_0x1f8c94,_0x271405[_0x3a63('0x43')]);return db['JscriptyQuestionReport']['count']({'where':_0x1f8c94[_0x3a63('0x39')]})[_0x3a63('0x20')](function(_0x5d2347){_0x2ff8aa['count']=_0x5d2347;if(_0x271405[_0x3a63('0x2e')][_0x3a63('0x3d')]){_0x1f8c94[_0x3a63('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x1f8c94);})['then'](function(_0x39428f){_0x2ff8aa['rows']=_0x39428f;return _0x2ff8aa;});}})[_0x3a63('0x20')](respondWithFilteredResult(_0x3df531,_0x1f8c94))[_0x3a63('0x40')](handleError(_0x3df531,null));}; \ No newline at end of file +var _0x01af=['error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','pick','filters','filter','merge','where','VIRTUAL','options','then','includeAll','include','findAll','catch','params','length','create','body','find','describe','getQuestions','JscriptyQuestionReport','hasOwnProperty','rows','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','end'];(function(_0x4ca4ae,_0x106b1b){var _0x464bd5=function(_0x46f575){while(--_0x46f575){_0x4ca4ae['push'](_0x4ca4ae['shift']());}};_0x464bd5(++_0x106b1b);}(_0x01af,0x79));var _0xf01a=function(_0x22d78a,_0x266ee0){_0x22d78a=_0x22d78a-0x0;var _0x46b80a=_0x01af[_0x22d78a];return _0x46b80a;};'use strict';var emlformat=require(_0xf01a('0x0'));var rimraf=require(_0xf01a('0x1'));var zipdir=require(_0xf01a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf01a('0x3'));var moment=require(_0xf01a('0x4'));var BPromise=require(_0xf01a('0x5'));var Mustache=require('mustache');var util=require(_0xf01a('0x6'));var path=require(_0xf01a('0x7'));var sox=require(_0xf01a('0x8'));var csv=require(_0xf01a('0x9'));var ejs=require(_0xf01a('0xa'));var fs=require('fs');var fs_extra=require(_0xf01a('0xb'));var _=require(_0xf01a('0xc'));var squel=require(_0xf01a('0xd'));var crypto=require(_0xf01a('0xe'));var jsforce=require(_0xf01a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf01a('0x9'));var querystring=require(_0xf01a('0x10'));var Papa=require('papaparse');var Redis=require(_0xf01a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf01a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf01a('0x13'));var logger=require(_0xf01a('0x14'))('api');var utils=require(_0xf01a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf01a('0x16'));var db=require(_0xf01a('0x17'))['db'];function respondWithStatusCode(_0x2833f6,_0x4396c0){_0x4396c0=_0x4396c0||0xcc;return function(_0x1291bd){if(_0x1291bd){return _0x2833f6[_0xf01a('0x18')](_0x4396c0);}return _0x2833f6[_0xf01a('0x19')](_0x4396c0)['end']();};}function respondWithResult(_0x350290,_0x5be677){_0x5be677=_0x5be677||0xc8;return function(_0x53d2b2){if(_0x53d2b2){return _0x350290[_0xf01a('0x19')](_0x5be677)[_0xf01a('0x1a')](_0x53d2b2);}};}function respondWithFilteredResult(_0x55277d,_0x13485b){return function(_0x110455){if(_0x110455){var _0x1c95db=typeof _0x13485b['offset']===_0xf01a('0x1b')&&typeof _0x13485b[_0xf01a('0x1c')]===_0xf01a('0x1b');var _0x1d86c1=_0x110455[_0xf01a('0x1d')];var _0x30a99c=_0x1c95db?0x0:_0x13485b['offset'];var _0x38da6d=_0x1c95db?_0x110455[_0xf01a('0x1d')]:_0x13485b[_0xf01a('0x1e')]+_0x13485b[_0xf01a('0x1c')];var _0x8891a3;if(_0x38da6d>=_0x1d86c1){_0x38da6d=_0x1d86c1;_0x8891a3=0xc8;}else{_0x8891a3=0xce;}_0x55277d[_0xf01a('0x19')](_0x8891a3);return _0x55277d[_0xf01a('0x1f')](_0xf01a('0x20'),_0x30a99c+'-'+_0x38da6d+'/'+_0x1d86c1)[_0xf01a('0x1a')](_0x110455);}return null;};}function patchUpdates(_0x5e0b9d){return function(_0x3535a0){try{jsonpatch[_0xf01a('0x21')](_0x3535a0,_0x5e0b9d,!![]);}catch(_0x5ae5c3){return BPromise['reject'](_0x5ae5c3);}return _0x3535a0['save']();};}function saveUpdates(_0xd73211,_0x2b8782){return function(_0x44ee9f){if(_0x44ee9f){return _0x44ee9f[_0xf01a('0x22')](_0xd73211)['then'](function(_0x16e022){return _0x16e022;});}return null;};}function removeEntity(_0x2e9330,_0x37f4e4){return function(_0x205d1b){if(_0x205d1b){return _0x205d1b[_0xf01a('0x23')]()['then'](function(){_0x2e9330[_0xf01a('0x19')](0xcc)[_0xf01a('0x24')]();});}};}function handleEntityNotFound(_0xdeb609,_0x1222d9){return function(_0x43205a){if(!_0x43205a){_0xdeb609[_0xf01a('0x18')](0x194);}return _0x43205a;};}function handleError(_0x58981a,_0x1cbfbf){_0x1cbfbf=_0x1cbfbf||0x1f4;return function(_0x222055){logger[_0xf01a('0x25')](_0x222055[_0xf01a('0x26')]);if(_0x222055[_0xf01a('0x27')]){delete _0x222055['name'];}_0x58981a[_0xf01a('0x19')](_0x1cbfbf)[_0xf01a('0x28')](_0x222055);};}exports[_0xf01a('0x29')]=function(_0x3b6ab0,_0x11b679){var _0x327999={},_0x224327={},_0x2b3d55={'count':0x0,'rows':[]};var _0x301cc3=_[_0xf01a('0x2a')](db[_0xf01a('0x2b')][_0xf01a('0x2c')],function(_0x409d7b){return{'name':_0x409d7b[_0xf01a('0x2d')],'type':_0x409d7b[_0xf01a('0x2e')][_0xf01a('0x2f')]};});_0x224327[_0xf01a('0x30')]=_['map'](_0x301cc3,_0xf01a('0x27'));_0x224327[_0xf01a('0x31')]=_[_0xf01a('0x32')](_0x3b6ab0[_0xf01a('0x31')]);_0x224327['filters']=_[_0xf01a('0x33')](_0x224327[_0xf01a('0x30')],_0x224327['query']);_0x327999['attributes']=_[_0xf01a('0x33')](_0x224327[_0xf01a('0x30')],qs[_0xf01a('0x34')](_0x3b6ab0[_0xf01a('0x31')]['fields']));_0x327999[_0xf01a('0x35')]=_0x327999['attributes']['length']?_0x327999['attributes']:_0x224327[_0xf01a('0x30')];if(!_0x3b6ab0['query']['hasOwnProperty'](_0xf01a('0x36'))){_0x327999['limit']=qs['limit'](_0x3b6ab0[_0xf01a('0x31')][_0xf01a('0x1c')]);_0x327999[_0xf01a('0x1e')]=qs[_0xf01a('0x1e')](_0x3b6ab0['query'][_0xf01a('0x1e')]);}_0x327999[_0xf01a('0x37')]=qs[_0xf01a('0x38')](_0x3b6ab0[_0xf01a('0x31')][_0xf01a('0x38')]);_0x327999['where']=qs['filters'](_[_0xf01a('0x39')](_0x3b6ab0[_0xf01a('0x31')],_0x224327[_0xf01a('0x3a')]),_0x301cc3);if(_0x3b6ab0[_0xf01a('0x31')][_0xf01a('0x3b')]){_0x327999['where']=_[_0xf01a('0x3c')](_0x327999[_0xf01a('0x3d')],{'$or':_[_0xf01a('0x2a')](_0x301cc3,function(_0x198b21){if(_0x198b21[_0xf01a('0x2e')]!==_0xf01a('0x3e')){var _0x2124a6={};_0x2124a6[_0x198b21[_0xf01a('0x27')]]={'$like':'%'+_0x3b6ab0[_0xf01a('0x31')][_0xf01a('0x3b')]+'%'};return _0x2124a6;}})});}_0x327999=_[_0xf01a('0x3c')]({},_0x327999,_0x3b6ab0[_0xf01a('0x3f')]);var _0x1ad606={'where':_0x327999['where']};return db[_0xf01a('0x2b')][_0xf01a('0x1d')](_0x1ad606)[_0xf01a('0x40')](function(_0x323a80){_0x2b3d55[_0xf01a('0x1d')]=_0x323a80;if(_0x3b6ab0[_0xf01a('0x31')][_0xf01a('0x41')]){_0x327999[_0xf01a('0x42')]=[{'all':!![]}];}return db[_0xf01a('0x2b')][_0xf01a('0x43')](_0x327999);})[_0xf01a('0x40')](function(_0x5522c4){_0x2b3d55['rows']=_0x5522c4;return _0x2b3d55;})['then'](respondWithFilteredResult(_0x11b679,_0x327999))[_0xf01a('0x44')](handleError(_0x11b679,null));};exports['show']=function(_0x3e43e9,_0x5914d5){var _0x4fb0c5={'raw':!![],'where':{'id':_0x3e43e9[_0xf01a('0x45')]['id']}},_0xdb3946={};_0xdb3946['model']=_[_0xf01a('0x32')](db['JscriptySessionReport']['rawAttributes']);_0xdb3946[_0xf01a('0x31')]=_['keys'](_0x3e43e9[_0xf01a('0x31')]);_0xdb3946[_0xf01a('0x3a')]=_[_0xf01a('0x33')](_0xdb3946[_0xf01a('0x30')],_0xdb3946[_0xf01a('0x31')]);_0x4fb0c5[_0xf01a('0x35')]=_[_0xf01a('0x33')](_0xdb3946[_0xf01a('0x30')],qs['fields'](_0x3e43e9[_0xf01a('0x31')][_0xf01a('0x34')]));_0x4fb0c5[_0xf01a('0x35')]=_0x4fb0c5[_0xf01a('0x35')][_0xf01a('0x46')]?_0x4fb0c5[_0xf01a('0x35')]:_0xdb3946[_0xf01a('0x30')];if(_0x3e43e9[_0xf01a('0x31')][_0xf01a('0x41')]){_0x4fb0c5['include']=[{'all':!![]}];}_0x4fb0c5=_['merge']({},_0x4fb0c5,_0x3e43e9[_0xf01a('0x3f')]);return db[_0xf01a('0x2b')]['find'](_0x4fb0c5)['then'](handleEntityNotFound(_0x5914d5,null))[_0xf01a('0x40')](respondWithResult(_0x5914d5,null))[_0xf01a('0x44')](handleError(_0x5914d5,null));};exports[_0xf01a('0x47')]=function(_0x227002,_0x2b0571){return db[_0xf01a('0x2b')]['create'](_0x227002[_0xf01a('0x48')],{})[_0xf01a('0x40')](respondWithResult(_0x2b0571,0xc9))[_0xf01a('0x44')](handleError(_0x2b0571,null));};exports[_0xf01a('0x22')]=function(_0x368dba,_0x178349){if(_0x368dba[_0xf01a('0x48')]['id']){delete _0x368dba[_0xf01a('0x48')]['id'];}return db[_0xf01a('0x2b')]['find']({'where':{'id':_0x368dba['params']['id']}})['then'](handleEntityNotFound(_0x178349,null))[_0xf01a('0x40')](saveUpdates(_0x368dba[_0xf01a('0x48')],null))[_0xf01a('0x40')](respondWithResult(_0x178349,null))['catch'](handleError(_0x178349,null));};exports[_0xf01a('0x23')]=function(_0x35be6c,_0x1b62e8){return db[_0xf01a('0x2b')][_0xf01a('0x49')]({'where':{'id':_0x35be6c[_0xf01a('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b62e8,null))[_0xf01a('0x40')](removeEntity(_0x1b62e8,null))[_0xf01a('0x44')](handleError(_0x1b62e8,null));};exports[_0xf01a('0x4a')]=function(_0x301a3a,_0x251c7f){return db[_0xf01a('0x2b')][_0xf01a('0x4a')]()[_0xf01a('0x40')](respondWithResult(_0x251c7f,null))['catch'](handleError(_0x251c7f,null));};exports[_0xf01a('0x4b')]=function(_0x543921,_0x22ea85,_0x1b6e93){var _0x54409a={'raw':!![],'where':{}};var _0x270c87={};var _0xa622f={'count':0x0,'rows':[]};return db[_0xf01a('0x2b')]['findOne']({'where':{'id':_0x543921[_0xf01a('0x45')]['id']}})[_0xf01a('0x40')](handleEntityNotFound(_0x22ea85,null))[_0xf01a('0x40')](function(_0x55f6dc){if(_0x55f6dc){_0x270c87[_0xf01a('0x30')]=_[_0xf01a('0x32')](db[_0xf01a('0x4c')]['rawAttributes']);_0x270c87[_0xf01a('0x31')]=_[_0xf01a('0x32')](_0x543921[_0xf01a('0x31')]);_0x270c87[_0xf01a('0x3a')]=_['intersection'](_0x270c87[_0xf01a('0x30')],_0x270c87[_0xf01a('0x31')]);_0x54409a[_0xf01a('0x35')]=_[_0xf01a('0x33')](_0x270c87[_0xf01a('0x30')],qs[_0xf01a('0x34')](_0x543921[_0xf01a('0x31')]['fields']));_0x54409a[_0xf01a('0x35')]=_0x54409a[_0xf01a('0x35')][_0xf01a('0x46')]?_0x54409a[_0xf01a('0x35')]:_0x270c87[_0xf01a('0x30')];if(!_0x543921[_0xf01a('0x31')][_0xf01a('0x4d')](_0xf01a('0x36'))){_0x54409a['limit']=qs[_0xf01a('0x1c')](_0x543921['query'][_0xf01a('0x1c')]);_0x54409a[_0xf01a('0x1e')]=qs[_0xf01a('0x1e')](_0x543921[_0xf01a('0x31')][_0xf01a('0x1e')]);}_0x54409a['order']=qs[_0xf01a('0x38')](_0x543921[_0xf01a('0x31')][_0xf01a('0x38')]);_0x54409a[_0xf01a('0x3d')]=qs[_0xf01a('0x3a')](_[_0xf01a('0x39')](_0x543921[_0xf01a('0x31')],_0x270c87['filters']));_0x54409a[_0xf01a('0x3d')]['SessionId']=_0x55f6dc['id'];if(_0x543921['query'][_0xf01a('0x3b')]){_0x54409a[_0xf01a('0x3d')]=_[_0xf01a('0x3c')](_0x54409a['where'],{'$or':_[_0xf01a('0x2a')](_0x54409a[_0xf01a('0x35')],function(_0x28fc9d){var _0x30c091={};_0x30c091[_0x28fc9d]={'$like':'%'+_0x543921[_0xf01a('0x31')][_0xf01a('0x3b')]+'%'};return _0x30c091;})});}_0x54409a=_[_0xf01a('0x3c')]({},_0x54409a,_0x543921[_0xf01a('0x3f')]);return db[_0xf01a('0x4c')][_0xf01a('0x1d')]({'where':_0x54409a[_0xf01a('0x3d')]})[_0xf01a('0x40')](function(_0x495a67){_0xa622f[_0xf01a('0x1d')]=_0x495a67;if(_0x543921[_0xf01a('0x31')]['includeAll']){_0x54409a[_0xf01a('0x42')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x54409a);})[_0xf01a('0x40')](function(_0x128c33){_0xa622f[_0xf01a('0x4e')]=_0x128c33;return _0xa622f;});}})[_0xf01a('0x40')](respondWithFilteredResult(_0x22ea85,_0x54409a))[_0xf01a('0x44')](handleError(_0x22ea85,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index fb7d7ff..f1f76da 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 _0xe2fe=['../../config/environment','exports','define','JscriptySessionReport','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./jscriptySessionReport.attributes');module[_0xee2f('0x7')]=function(_0x2b7e7c,_0x49926b){return _0x2b7e7c[_0xee2f('0x8')](_0xee2f('0x9'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11e5=['path','../../config/environment','define','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x2fba31,_0x513c9e){var _0x100f38=function(_0x2e9462){while(--_0x2e9462){_0x2fba31['push'](_0x2fba31['shift']());}};_0x100f38(++_0x513c9e);}(_0x11e5,0x8b));var _0x511e=function(_0x46dc29,_0x18c45a){_0x46dc29=_0x46dc29-0x0;var _0x4bbb8d=_0x11e5[_0x46dc29];return _0x4bbb8d;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var logger=require(_0x511e('0x1'))(_0x511e('0x2'));var moment=require('moment');var BPromise=require(_0x511e('0x3'));var rp=require(_0x511e('0x4'));var fs=require('fs');var path=require(_0x511e('0x5'));var rimraf=require('rimraf');var config=require(_0x511e('0x6'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x342539,_0x323f8c){return _0x342539[_0x511e('0x7')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 06339fb..bd55479 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 _0x1893=['../../config/logger','../../config/environment','jayson/promise','client','http','request','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x455eed,_0x822290){var _0x31cb46=function(_0x54e871){while(--_0x54e871){_0x455eed['push'](_0x455eed['shift']());}};_0x31cb46(++_0x822290);}(_0x1893,0xa2));var _0x3189=function(_0x7a78d7,_0x4aa57c){_0x7a78d7=_0x7a78d7-0x0;var _0x33a5da=_0x1893[_0x7a78d7];return _0x33a5da;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3189('0x0'));var BPromise=require(_0x3189('0x1'));var rs=require(_0x3189('0x2'));var fs=require('fs');var Redis=require(_0x3189('0x3'));var db=require(_0x3189('0x4'))['db'];var utils=require(_0x3189('0x5'));var logger=require(_0x3189('0x6'))('rpc');var config=require(_0x3189('0x7'));var jayson=require(_0x3189('0x8'));var client=jayson[_0x3189('0x9')][_0x3189('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x77c566,_0x118970,_0x14d84b){return new BPromise(function(_0x1f6764,_0x5312a3){return client[_0x3189('0xb')](_0x77c566,_0x14d84b)['then'](function(_0x127449){logger['info'](_0x3189('0xc'),_0x118970,_0x3189('0xd'));logger[_0x3189('0xe')](_0x3189('0xf'),_0x118970,'request\x20sent',JSON[_0x3189('0x10')](_0x127449));if(_0x127449[_0x3189('0x11')]){if(_0x127449[_0x3189('0x11')][_0x3189('0x12')]===0x1f4){logger[_0x3189('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x5312a3(_0x127449[_0x3189('0x11')][_0x3189('0x13')]);}logger[_0x3189('0x11')](_0x3189('0xc'),_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x1f6764(_0x127449['error'][_0x3189('0x13')]);}else{logger[_0x3189('0x14')](_0x3189('0xc'),_0x118970,_0x3189('0xd'));_0x1f6764(_0x127449['result'][_0x3189('0x13')]);}})['catch'](function(_0x55f432){logger[_0x3189('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x118970,_0x55f432);_0x5312a3(_0x55f432);});});} \ No newline at end of file +var _0x0295=['client','http','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x65c7b2,_0x444b73){var _0x30a949=function(_0x5452e1){while(--_0x5452e1){_0x65c7b2['push'](_0x65c7b2['shift']());}};_0x30a949(++_0x444b73);}(_0x0295,0x1f0));var _0x5029=function(_0x286c4a,_0x3d559d){_0x286c4a=_0x286c4a-0x0;var _0x476a25=_0x0295[_0x286c4a];return _0x476a25;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index e1b18dc..6e80bea 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 _0x5b04=['path','connect-timeout','express','Router','../../components/interaction/service','./license.controller','get','put','/:id','update','downloadLogFile','exports','multer','util'];(function(_0x2aae31,_0x1014a2){var _0x379006=function(_0x5345ae){while(--_0x5345ae){_0x2aae31['push'](_0x2aae31['shift']());}};_0x379006(++_0x1014a2);}(_0x5b04,0xfa));var _0x45b0=function(_0x3273c4,_0x487f85){_0x3273c4=_0x3273c4-0x0;var _0x1f7d73=_0x5b04[_0x3273c4];return _0x1f7d73;};'use strict';var multer=require(_0x45b0('0x0'));var util=require(_0x45b0('0x1'));var path=require(_0x45b0('0x2'));var timeout=require(_0x45b0('0x3'));var express=require(_0x45b0('0x4'));var router=express[_0x45b0('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x45b0('0x6'));var config=require('../../config/environment');var controller=require(_0x45b0('0x7'));router[_0x45b0('0x8')]('/',controller['index']);router[_0x45b0('0x9')](_0x45b0('0xa'),auth['isAuthenticated'](),controller[_0x45b0('0xb')]);router[_0x45b0('0x8')]('/download_log_file',auth['isAuthenticated'](),controller[_0x45b0('0xc')]);module[_0x45b0('0xd')]=router; \ No newline at end of file +var _0x51e6=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','update','/download_log_file','downloadLogFile','exports','multer','util'];(function(_0x335730,_0x5e9163){var _0x184974=function(_0x3ce6fb){while(--_0x3ce6fb){_0x335730['push'](_0x335730['shift']());}};_0x184974(++_0x5e9163);}(_0x51e6,0x18e));var _0x651e=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0x51e6[_0x462fe4];return _0x82b23a;};'use strict';var multer=require(_0x651e('0x0'));var util=require(_0x651e('0x1'));var path=require(_0x651e('0x2'));var timeout=require(_0x651e('0x3'));var express=require('express');var router=express[_0x651e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x651e('0x5'));var interaction=require(_0x651e('0x6'));var config=require(_0x651e('0x7'));var controller=require(_0x651e('0x8'));router[_0x651e('0x9')]('/',controller[_0x651e('0xa')]);router['put'](_0x651e('0xb'),auth['isAuthenticated'](),controller[_0x651e('0xc')]);router['get'](_0x651e('0xd'),auth['isAuthenticated'](),controller[_0x651e('0xe')]);module[_0x651e('0xf')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 0d0fe46..216d3c6 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 _0xaace=['STRING','INTEGER','exports','TEXT'];(function(_0x369dd0,_0x44a3ba){var _0x1d8bf9=function(_0x3e0da0){while(--_0x3e0da0){_0x369dd0['push'](_0x369dd0['shift']());}};_0x1d8bf9(++_0x44a3ba);}(_0xaace,0x19e));var _0xeaac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaace[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xeaac('0x0')]={'license':{'type':Sequelize[_0xeaac('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xeaac('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xeaac('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x05ed=['sequelize','exports','TEXT','STRING'];(function(_0x196122,_0x575261){var _0x1b0836=function(_0x5b4dc2){while(--_0x5b4dc2){_0x196122['push'](_0x196122['shift']());}};_0x1b0836(++_0x575261);}(_0x05ed,0x1a0));var _0xd05e=function(_0x276ab9,_0x13fc29){_0x276ab9=_0x276ab9-0x0;var _0x58317d=_0x05ed[_0x276ab9];return _0x58317d;};'use strict';var Sequelize=require(_0xd05e('0x0'));module[_0xd05e('0x1')]={'license':{'type':Sequelize[_0xd05e('0x2')]},'data1':{'type':Sequelize[_0xd05e('0x3')]},'data2':{'type':Sequelize[_0xd05e('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'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 9fe2447..fef209f 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 _0x8ef7=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','model','License','rawAttributes','query','keys','filters','attributes','fields','length','body','find','params','get','checkLicense','key','demo','catch','downloadLogFile','license-info.log','join','/var','log','xcally','Content-disposition','attachment;\x20filename=','set','Content-Type','download','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ef7,0x134));var _0x78ef=function(_0x549cf9,_0x56fa13){_0x549cf9=_0x549cf9-0x0;var _0x53f9bf=_0x8ef7[_0x549cf9];return _0x53f9bf;};'use strict';var emlformat=require(_0x78ef('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x78ef('0x1'));var rp=require(_0x78ef('0x2'));var moment=require('moment');var BPromise=require(_0x78ef('0x3'));var Mustache=require(_0x78ef('0x4'));var util=require(_0x78ef('0x5'));var path=require('path');var sox=require(_0x78ef('0x6'));var csv=require(_0x78ef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78ef('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x78ef('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x78ef('0xa'));var toCsv=require(_0x78ef('0x7'));var querystring=require(_0x78ef('0xb'));var Papa=require(_0x78ef('0xc'));var Redis=require('ioredis');var authService=require(_0x78ef('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x78ef('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x78ef('0xf'))(_0x78ef('0x10'));var utils=require(_0x78ef('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x78ef('0x12'));var db=require(_0x78ef('0x13'))['db'];function respondWithStatusCode(_0x570308,_0x30caf9){_0x30caf9=_0x30caf9||0xcc;return function(_0x485c16){if(_0x485c16){return _0x570308[_0x78ef('0x14')](_0x30caf9);}return _0x570308[_0x78ef('0x15')](_0x30caf9)[_0x78ef('0x16')]();};}function respondWithResult(_0x21b6b7,_0x284afe){_0x284afe=_0x284afe||0xc8;return function(_0x448603){if(_0x448603){return _0x21b6b7[_0x78ef('0x15')](_0x284afe)[_0x78ef('0x17')](_0x448603);}};}function respondWithFilteredResult(_0x42a356,_0x17c1ce){return function(_0x3e7657){if(_0x3e7657){var _0x398d08=typeof _0x17c1ce[_0x78ef('0x18')]===_0x78ef('0x19')&&typeof _0x17c1ce[_0x78ef('0x1a')]==='undefined';var _0x38cca0=_0x3e7657[_0x78ef('0x1b')];var _0x1bdee2=_0x398d08?0x0:_0x17c1ce[_0x78ef('0x18')];var _0x13d732=_0x398d08?_0x3e7657[_0x78ef('0x1b')]:_0x17c1ce['offset']+_0x17c1ce[_0x78ef('0x1a')];var _0x30733c;if(_0x13d732>=_0x38cca0){_0x13d732=_0x38cca0;_0x30733c=0xc8;}else{_0x30733c=0xce;}_0x42a356[_0x78ef('0x15')](_0x30733c);return _0x42a356['set'](_0x78ef('0x1c'),_0x1bdee2+'-'+_0x13d732+'/'+_0x38cca0)[_0x78ef('0x17')](_0x3e7657);}return null;};}function patchUpdates(_0x325e68){return function(_0x4826a1){try{jsonpatch[_0x78ef('0x1d')](_0x4826a1,_0x325e68,!![]);}catch(_0x296bfb){return BPromise[_0x78ef('0x1e')](_0x296bfb);}return _0x4826a1['save']();};}function saveUpdates(_0x2b8969,_0x5b46cb){return function(_0x3d7d33){if(_0x3d7d33){return _0x3d7d33[_0x78ef('0x1f')](_0x2b8969)[_0x78ef('0x20')](function(_0x57f82b){return _0x57f82b;});}return null;};}function removeEntity(_0x3f93c7,_0x41696d){return function(_0x26a5ae){if(_0x26a5ae){return _0x26a5ae[_0x78ef('0x21')]()['then'](function(){_0x3f93c7[_0x78ef('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53f1a7,_0x41c676){return function(_0x152bf0){if(!_0x152bf0){_0x53f1a7[_0x78ef('0x14')](0x194);}return _0x152bf0;};}function handleError(_0x4ee023,_0x401b4f){_0x401b4f=_0x401b4f||0x1f4;return function(_0x485b3e){logger[_0x78ef('0x22')](_0x485b3e[_0x78ef('0x23')]);if(_0x485b3e['name']){delete _0x485b3e[_0x78ef('0x24')];}_0x4ee023[_0x78ef('0x15')](_0x401b4f)['send'](_0x485b3e);};}var utilLicense=require(_0x78ef('0x12'));exports['index']=function(_0x346e7f,_0x5a7329){var _0x491ce2={'raw':!![],'where':{'id':0x1}},_0x56ef35={};_0x56ef35[_0x78ef('0x25')]=_['keys'](db[_0x78ef('0x26')][_0x78ef('0x27')]);_0x56ef35[_0x78ef('0x28')]=_[_0x78ef('0x29')](_0x346e7f['query']);_0x56ef35[_0x78ef('0x2a')]=_['intersection'](_0x56ef35[_0x78ef('0x25')],_0x56ef35[_0x78ef('0x28')]);_0x491ce2[_0x78ef('0x2b')]=_['intersection'](_0x56ef35[_0x78ef('0x25')],qs[_0x78ef('0x2c')](_0x346e7f[_0x78ef('0x28')][_0x78ef('0x2c')]));_0x491ce2[_0x78ef('0x2b')]=_0x491ce2['attributes'][_0x78ef('0x2d')]?_0x491ce2[_0x78ef('0x2b')]:_0x56ef35[_0x78ef('0x25')];_0x491ce2=_['merge']({},_0x491ce2,_0x346e7f['options']);return utilLicense['getLicense'](_0x491ce2)[_0x78ef('0x20')](respondWithResult(_0x5a7329,null))['catch'](handleError(_0x5a7329,null));};exports[_0x78ef('0x1f')]=function(_0x32c808,_0x2bc9d6){if(_0x32c808[_0x78ef('0x2e')]['id']){delete _0x32c808[_0x78ef('0x2e')]['id'];}return db[_0x78ef('0x26')][_0x78ef('0x2f')]({'where':{'id':_0x32c808[_0x78ef('0x30')]['id']}})[_0x78ef('0x20')](handleEntityNotFound(_0x2bc9d6,null))[_0x78ef('0x20')](function(_0x36905e){var _0x355ff6=_0x36905e[_0x78ef('0x31')]({'plain':!![]});return utilLicense[_0x78ef('0x32')](_0x355ff6,_0x32c808[_0x78ef('0x2e')][_0x78ef('0x33')]);})[_0x78ef('0x20')](function(_0x57e76f){if(!_0x57e76f[_0x78ef('0x34')]){return saveUpdates(_0x32c808[_0x78ef('0x2e')],null);}return _0x57e76f;})[_0x78ef('0x20')](respondWithResult(_0x2bc9d6,null))[_0x78ef('0x35')](handleError(_0x2bc9d6,null));};exports[_0x78ef('0x36')]=function(_0x2abbe9,_0x143058){var _0x206adf=_0x78ef('0x37');var _0x51e3d0=path[_0x78ef('0x38')](_0x78ef('0x39'),_0x78ef('0x3a'),_0x78ef('0x3b'),_0x206adf);_0x143058['setHeader'](_0x78ef('0x3c'),_0x78ef('0x3d')+_0x206adf);_0x143058[_0x78ef('0x3e')](_0x78ef('0x3f'),'text/plain');_0x143058[_0x78ef('0x40')](_0x51e3d0);}; \ No newline at end of file +var _0x0698=['sendStatus','end','status','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','model','keys','License','query','intersection','fields','attributes','length','merge','options','catch','body','find','params','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x30a1e3,_0xdf0cdc){var _0x57b900=function(_0x333b62){while(--_0x333b62){_0x30a1e3['push'](_0x30a1e3['shift']());}};_0x57b900(++_0xdf0cdc);}(_0x0698,0xc4));var _0x8069=function(_0x2fe915,_0x2da030){_0x2fe915=_0x2fe915-0x0;var _0x4fc095=_0x0698[_0x2fe915];return _0x4fc095;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8069('0x0'));var zipdir=require(_0x8069('0x1'));var jsonpatch=require(_0x8069('0x2'));var rp=require(_0x8069('0x3'));var moment=require(_0x8069('0x4'));var BPromise=require(_0x8069('0x5'));var Mustache=require(_0x8069('0x6'));var util=require(_0x8069('0x7'));var path=require(_0x8069('0x8'));var sox=require(_0x8069('0x9'));var csv=require('to-csv');var ejs=require(_0x8069('0xa'));var fs=require('fs');var fs_extra=require(_0x8069('0xb'));var _=require(_0x8069('0xc'));var squel=require(_0x8069('0xd'));var crypto=require(_0x8069('0xe'));var jsforce=require(_0x8069('0xf'));var deskjs=require(_0x8069('0x10'));var toCsv=require(_0x8069('0x11'));var querystring=require(_0x8069('0x12'));var Papa=require(_0x8069('0x13'));var Redis=require(_0x8069('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x8069('0x15'));var as=require(_0x8069('0x16'));var hardwareService=require(_0x8069('0x17'));var logger=require(_0x8069('0x18'))(_0x8069('0x19'));var utils=require(_0x8069('0x1a'));var config=require(_0x8069('0x1b'));var licenseUtil=require(_0x8069('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c6014,_0x567098){_0x567098=_0x567098||0xcc;return function(_0x3bdf22){if(_0x3bdf22){return _0x4c6014[_0x8069('0x1d')](_0x567098);}return _0x4c6014['status'](_0x567098)[_0x8069('0x1e')]();};}function respondWithResult(_0x1137ee,_0x3b5257){_0x3b5257=_0x3b5257||0xc8;return function(_0x6ed029){if(_0x6ed029){return _0x1137ee[_0x8069('0x1f')](_0x3b5257)['json'](_0x6ed029);}};}function respondWithFilteredResult(_0x7192ed,_0x4de1c1){return function(_0x541e0a){if(_0x541e0a){var _0x3a63cb=typeof _0x4de1c1[_0x8069('0x20')]===_0x8069('0x21')&&typeof _0x4de1c1[_0x8069('0x22')]===_0x8069('0x21');var _0x2410e2=_0x541e0a['count'];var _0x4fb86b=_0x3a63cb?0x0:_0x4de1c1[_0x8069('0x20')];var _0x53e6db=_0x3a63cb?_0x541e0a['count']:_0x4de1c1[_0x8069('0x20')]+_0x4de1c1['limit'];var _0x1637b2;if(_0x53e6db>=_0x2410e2){_0x53e6db=_0x2410e2;_0x1637b2=0xc8;}else{_0x1637b2=0xce;}_0x7192ed[_0x8069('0x1f')](_0x1637b2);return _0x7192ed[_0x8069('0x23')](_0x8069('0x24'),_0x4fb86b+'-'+_0x53e6db+'/'+_0x2410e2)['json'](_0x541e0a);}return null;};}function patchUpdates(_0x2bbfee){return function(_0x4d9acf){try{jsonpatch[_0x8069('0x25')](_0x4d9acf,_0x2bbfee,!![]);}catch(_0x399688){return BPromise[_0x8069('0x26')](_0x399688);}return _0x4d9acf[_0x8069('0x27')]();};}function saveUpdates(_0x37b180,_0x47bbc1){return function(_0x5a3c22){if(_0x5a3c22){return _0x5a3c22[_0x8069('0x28')](_0x37b180)[_0x8069('0x29')](function(_0x237842){return _0x237842;});}return null;};}function removeEntity(_0x3960ff,_0x8bfffb){return function(_0x4cfdfc){if(_0x4cfdfc){return _0x4cfdfc[_0x8069('0x2a')]()[_0x8069('0x29')](function(){_0x3960ff[_0x8069('0x1f')](0xcc)[_0x8069('0x1e')]();});}};}function handleEntityNotFound(_0x501d43,_0x283536){return function(_0x308ba4){if(!_0x308ba4){_0x501d43['sendStatus'](0x194);}return _0x308ba4;};}function handleError(_0x3a6cec,_0x1b3964){_0x1b3964=_0x1b3964||0x1f4;return function(_0x5d1312){logger['error'](_0x5d1312[_0x8069('0x2b')]);if(_0x5d1312[_0x8069('0x2c')]){delete _0x5d1312[_0x8069('0x2c')];}_0x3a6cec[_0x8069('0x1f')](_0x1b3964)[_0x8069('0x2d')](_0x5d1312);};}var utilLicense=require('../../config/license/util');exports[_0x8069('0x2e')]=function(_0x30b613,_0x3e1e9d){var _0x5c5f64={'raw':!![],'where':{'id':0x1}},_0x5f15f={};_0x5f15f[_0x8069('0x2f')]=_[_0x8069('0x30')](db[_0x8069('0x31')]['rawAttributes']);_0x5f15f['query']=_['keys'](_0x30b613[_0x8069('0x32')]);_0x5f15f['filters']=_[_0x8069('0x33')](_0x5f15f[_0x8069('0x2f')],_0x5f15f[_0x8069('0x32')]);_0x5c5f64['attributes']=_['intersection'](_0x5f15f[_0x8069('0x2f')],qs[_0x8069('0x34')](_0x30b613[_0x8069('0x32')]['fields']));_0x5c5f64[_0x8069('0x35')]=_0x5c5f64[_0x8069('0x35')][_0x8069('0x36')]?_0x5c5f64[_0x8069('0x35')]:_0x5f15f[_0x8069('0x2f')];_0x5c5f64=_[_0x8069('0x37')]({},_0x5c5f64,_0x30b613[_0x8069('0x38')]);return utilLicense['getLicense'](_0x5c5f64)[_0x8069('0x29')](respondWithResult(_0x3e1e9d,null))[_0x8069('0x39')](handleError(_0x3e1e9d,null));};exports['update']=function(_0x264307,_0x2f71cf){if(_0x264307[_0x8069('0x3a')]['id']){delete _0x264307['body']['id'];}return db[_0x8069('0x31')][_0x8069('0x3b')]({'where':{'id':_0x264307[_0x8069('0x3c')]['id']}})[_0x8069('0x29')](handleEntityNotFound(_0x2f71cf,null))[_0x8069('0x29')](function(_0x4c6c5){var _0x2d3cd8=_0x4c6c5['get']({'plain':!![]});return utilLicense[_0x8069('0x3d')](_0x2d3cd8,_0x264307[_0x8069('0x3a')][_0x8069('0x3e')]);})[_0x8069('0x29')](function(_0xcf918f){if(!_0xcf918f[_0x8069('0x3f')]){return saveUpdates(_0x264307[_0x8069('0x3a')],null);}return _0xcf918f;})[_0x8069('0x29')](respondWithResult(_0x2f71cf,null))[_0x8069('0x39')](handleError(_0x2f71cf,null));};exports[_0x8069('0x40')]=function(_0x66054b,_0x36b03f){var _0x147b33=_0x8069('0x41');var _0x327d3b=path[_0x8069('0x42')](_0x8069('0x43'),_0x8069('0x44'),_0x8069('0x45'),_0x147b33);_0x36b03f[_0x8069('0x46')](_0x8069('0x47'),_0x8069('0x48')+_0x147b33);_0x36b03f[_0x8069('0x23')](_0x8069('0x49'),'text/plain');_0x36b03f[_0x8069('0x4a')](_0x327d3b);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 5ea78de..ffd599c 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 _0x38e9=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','lodash','util','../../config/logger'];(function(_0xcc3d40,_0x3c0f3c){var _0x4160a3=function(_0x6289e0){while(--_0x6289e0){_0xcc3d40['push'](_0xcc3d40['shift']());}};_0x4160a3(++_0x3c0f3c);}(_0x38e9,0xef));var _0x938e=function(_0x9fce47,_0x38c3e6){_0x9fce47=_0x9fce47-0x0;var _0x29e671=_0x38e9[_0x9fce47];return _0x29e671;};'use strict';var _=require(_0x938e('0x0'));var util=require(_0x938e('0x1'));var logger=require(_0x938e('0x2'))(_0x938e('0x3'));var moment=require(_0x938e('0x4'));var BPromise=require(_0x938e('0x5'));var rp=require(_0x938e('0x6'));var fs=require('fs');var path=require(_0x938e('0x7'));var rimraf=require(_0x938e('0x8'));var config=require(_0x938e('0x9'));var attributes=require('./license.attributes');module[_0x938e('0xa')]=function(_0x2e2820,_0x149bd3){return _0x2e2820['define']('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d16=['api','moment','bluebird','path','rimraf','./license.attributes','define','util','../../config/logger'];(function(_0x5d7185,_0x31fa85){var _0x2909e9=function(_0x3e927a){while(--_0x3e927a){_0x5d7185['push'](_0x5d7185['shift']());}};_0x2909e9(++_0x31fa85);}(_0x2d16,0x1c9));var _0x62d1=function(_0x17ecde,_0x4e8d9c){_0x17ecde=_0x17ecde-0x0;var _0xa97788=_0x2d16[_0x17ecde];return _0xa97788;};'use strict';var _=require('lodash');var util=require(_0x62d1('0x0'));var logger=require(_0x62d1('0x1'))(_0x62d1('0x2'));var moment=require(_0x62d1('0x3'));var BPromise=require(_0x62d1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x62d1('0x5'));var rimraf=require(_0x62d1('0x6'));var config=require('../../config/environment');var attributes=require(_0x62d1('0x7'));module['exports']=function(_0x222f97,_0x559688){return _0x222f97[_0x62d1('0x8')]('License',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 7f857ac..3cc9f1f 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 _0xb411=['info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x45df7e,_0x5bbfe2){var _0x5a34e7=function(_0x53de2d){while(--_0x53de2d){_0x45df7e['push'](_0x45df7e['shift']());}};_0x5a34e7(++_0x5bbfe2);}(_0xb411,0x143));var _0x1b41=function(_0x4c782b,_0x95f75e){_0x4c782b=_0x4c782b-0x0;var _0x3889e8=_0xb411[_0x4c782b];return _0x3889e8;};'use strict';var _=require(_0x1b41('0x0'));var util=require(_0x1b41('0x1'));var moment=require(_0x1b41('0x2'));var BPromise=require(_0x1b41('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b41('0x4'));var db=require(_0x1b41('0x5'))['db'];var utils=require(_0x1b41('0x6'));var logger=require('../../config/logger')(_0x1b41('0x7'));var config=require(_0x1b41('0x8'));var jayson=require(_0x1b41('0x9'));var client=jayson[_0x1b41('0xa')][_0x1b41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x350cd1,_0x125c0b,_0x542f6b){return new BPromise(function(_0x3af40b,_0x5a9494){return client[_0x1b41('0xc')](_0x350cd1,_0x542f6b)['then'](function(_0x6b431a){logger[_0x1b41('0xd')](_0x1b41('0xe'),_0x125c0b,_0x1b41('0xf'));logger[_0x1b41('0x10')](_0x1b41('0x11'),_0x125c0b,_0x1b41('0xf'),JSON['stringify'](_0x6b431a));if(_0x6b431a[_0x1b41('0x12')]){if(_0x6b431a['error']['code']===0x1f4){logger['error'](_0x1b41('0xe'),_0x125c0b,_0x6b431a[_0x1b41('0x12')][_0x1b41('0x13')]);return _0x5a9494(_0x6b431a['error']['message']);}logger[_0x1b41('0x12')]('License,\x20%s,\x20%s',_0x125c0b,_0x6b431a[_0x1b41('0x12')][_0x1b41('0x13')]);return _0x3af40b(_0x6b431a['error']['message']);}else{logger['info'](_0x1b41('0xe'),_0x125c0b,_0x1b41('0xf'));_0x3af40b(_0x6b431a['result']['message']);}})[_0x1b41('0x14')](function(_0x1a1664){logger[_0x1b41('0x12')](_0x1b41('0xe'),_0x125c0b,_0x1a1664);_0x5a9494(_0x1a1664);});});} \ No newline at end of file +var _0x5304=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','License,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x5ec983,_0x466c52){var _0xba7456=function(_0x585179){while(--_0x585179){_0x5ec983['push'](_0x5ec983['shift']());}};_0xba7456(++_0x466c52);}(_0x5304,0x1ca));var _0x4530=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0x5304[_0x5d8018];return _0x151ac4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4530('0x0'));var BPromise=require(_0x4530('0x1'));var rs=require(_0x4530('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4530('0x3'));var logger=require(_0x4530('0x4'))(_0x4530('0x5'));var config=require(_0x4530('0x6'));var jayson=require(_0x4530('0x7'));var client=jayson['client'][_0x4530('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x356abf,_0x49308f,_0x558823){return new BPromise(function(_0x171310,_0x5ca90d){return client[_0x4530('0x9')](_0x356abf,_0x558823)[_0x4530('0xa')](function(_0x3febb3){logger[_0x4530('0xb')]('License,\x20%s,\x20%s',_0x49308f,_0x4530('0xc'));logger[_0x4530('0xd')](_0x4530('0xe'),_0x49308f,_0x4530('0xc'),JSON['stringify'](_0x3febb3));if(_0x3febb3[_0x4530('0xf')]){if(_0x3febb3[_0x4530('0xf')][_0x4530('0x10')]===0x1f4){logger['error'](_0x4530('0x11'),_0x49308f,_0x3febb3['error'][_0x4530('0x12')]);return _0x5ca90d(_0x3febb3[_0x4530('0xf')][_0x4530('0x12')]);}logger[_0x4530('0xf')](_0x4530('0x11'),_0x49308f,_0x3febb3[_0x4530('0xf')][_0x4530('0x12')]);return _0x171310(_0x3febb3[_0x4530('0xf')]['message']);}else{logger[_0x4530('0xb')](_0x4530('0x11'),_0x49308f,_0x4530('0xc'));_0x171310(_0x3febb3[_0x4530('0x13')][_0x4530('0x12')]);}})[_0x4530('0x14')](function(_0x76f6c5){logger[_0x4530('0xf')](_0x4530('0x11'),_0x49308f,_0x76f6c5);_0x5ca90d(_0x76f6c5);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index fa7cd6e..79e53bb 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 _0xa20a=['verifySmtp','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addApplications','/:id/send','send','/:id/users','addAgents','put','update','delete','removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify'];(function(_0x1e6aa7,_0x3282c6){var _0x5f20c3=function(_0x1dd529){while(--_0x1dd529){_0x1e6aa7['push'](_0x1e6aa7['shift']());}};_0x5f20c3(++_0x3282c6);}(_0xa20a,0x130));var _0xaa20=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0xa20a[_0x2b9b7f];return _0x4ed19a;};'use strict';var multer=require(_0xaa20('0x0'));var util=require('util');var path=require(_0xaa20('0x1'));var timeout=require(_0xaa20('0x2'));var express=require('express');var router=express[_0xaa20('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xaa20('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xaa20('0x5'));var controller=require('./mailAccount.controller');router[_0xaa20('0x6')]('/',auth[_0xaa20('0x7')](),controller[_0xaa20('0x8')]);router[_0xaa20('0x6')]('/describe',auth[_0xaa20('0x7')](),controller[_0xaa20('0x9')]);router[_0xaa20('0x6')](_0xaa20('0xa'),auth[_0xaa20('0x7')](),controller[_0xaa20('0xb')]);router[_0xaa20('0x6')](_0xaa20('0xc'),auth['isAuthenticated'](),controller[_0xaa20('0xd')]);router['get'](_0xaa20('0xe'),auth['isAuthenticated'](),controller[_0xaa20('0xf')]);router['get'](_0xaa20('0x10'),auth[_0xaa20('0x7')](),controller[_0xaa20('0x11')]);router[_0xaa20('0x6')](_0xaa20('0x12'),auth['isAuthenticated'](),controller['getSmtp']);router['get'](_0xaa20('0x13'),auth[_0xaa20('0x7')](),controller[_0xaa20('0x14')]);router[_0xaa20('0x6')](_0xaa20('0x15'),auth[_0xaa20('0x7')](),controller[_0xaa20('0x16')]);router[_0xaa20('0x6')](_0xaa20('0x17'),auth[_0xaa20('0x7')](),controller['getMessages']);router['get'](_0xaa20('0x18'),auth[_0xaa20('0x7')](),controller[_0xaa20('0x19')]);router[_0xaa20('0x6')]('/:id/users',auth[_0xaa20('0x7')](),controller[_0xaa20('0x1a')]);router[_0xaa20('0x1b')](_0xaa20('0xc'),auth[_0xaa20('0x7')](),controller[_0xaa20('0x1c')]);router[_0xaa20('0x1b')](_0xaa20('0xe'),auth[_0xaa20('0x7')](),controller[_0xaa20('0x1d')]);router['post']('/',auth[_0xaa20('0x7')](),controller[_0xaa20('0x1e')]);router[_0xaa20('0x1b')]('/:id/in_servers',auth[_0xaa20('0x7')](),controller[_0xaa20('0x1f')]);router[_0xaa20('0x1b')]('/:id/out_servers',auth[_0xaa20('0x7')](),controller[_0xaa20('0x20')]);router[_0xaa20('0x1b')](_0xaa20('0x13'),auth[_0xaa20('0x7')](),controller['addInteraction']);router['post'](_0xaa20('0x15'),auth['isAuthenticated'](),controller[_0xaa20('0x21')]);router[_0xaa20('0x1b')](_0xaa20('0x22'),auth[_0xaa20('0x7')](),controller[_0xaa20('0x23')]);router[_0xaa20('0x1b')](_0xaa20('0x24'),auth[_0xaa20('0x7')](),controller[_0xaa20('0x25')]);router[_0xaa20('0x26')]('/:id',auth[_0xaa20('0x7')](),controller[_0xaa20('0x27')]);router[_0xaa20('0x28')](_0xaa20('0xc'),auth[_0xaa20('0x7')](),controller[_0xaa20('0x29')]);router[_0xaa20('0x28')](_0xaa20('0xe'),auth[_0xaa20('0x7')](),controller[_0xaa20('0x2a')]);router[_0xaa20('0x28')](_0xaa20('0x10'),auth[_0xaa20('0x7')](),controller['removeImap']);router['delete'](_0xaa20('0x12'),auth[_0xaa20('0x7')](),controller[_0xaa20('0x2b')]);router[_0xaa20('0x28')]('/:id',auth[_0xaa20('0x7')](),controller[_0xaa20('0x2c')]);router[_0xaa20('0x28')]('/:id/users',auth[_0xaa20('0x7')](),controller[_0xaa20('0x2d')]);module[_0xaa20('0x2e')]=router; \ No newline at end of file +var _0xde30=['removeAnswers','removeSmtp','destroy','removeAgents','exports','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','addAnswer','create','/:id/out_servers','addSmtp','/:id/interactions','addApplications','/:id/send','/:id/users','addAgents','delete'];(function(_0x1d4a35,_0x34f8f0){var _0x5a2940=function(_0x1a9285){while(--_0x1a9285){_0x1d4a35['push'](_0x1d4a35['shift']());}};_0x5a2940(++_0x34f8f0);}(_0xde30,0x1e5));var _0x0de3=function(_0x5c5276,_0x3c2823){_0x5c5276=_0x5c5276-0x0;var _0x583519=_0xde30[_0x5c5276];return _0x583519;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0de3('0x0'));var timeout=require(_0x0de3('0x1'));var express=require('express');var router=express[_0x0de3('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0de3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0de3('0x4'));var controller=require(_0x0de3('0x5'));router[_0x0de3('0x6')]('/',auth[_0x0de3('0x7')](),controller[_0x0de3('0x8')]);router[_0x0de3('0x6')]('/describe',auth[_0x0de3('0x7')](),controller[_0x0de3('0x9')]);router[_0x0de3('0x6')](_0x0de3('0xa'),auth['isAuthenticated'](),controller[_0x0de3('0xb')]);router['get'](_0x0de3('0xc'),auth[_0x0de3('0x7')](),controller['getDispositions']);router['get'](_0x0de3('0xd'),auth['isAuthenticated'](),controller[_0x0de3('0xe')]);router['get'](_0x0de3('0xf'),auth[_0x0de3('0x7')](),controller[_0x0de3('0x10')]);router['get']('/:id/out_servers',auth[_0x0de3('0x7')](),controller[_0x0de3('0x11')]);router['get']('/:id/interactions',auth[_0x0de3('0x7')](),controller['getInteractions']);router[_0x0de3('0x6')](_0x0de3('0x12'),auth[_0x0de3('0x7')](),controller['getApplications']);router[_0x0de3('0x6')](_0x0de3('0x13'),auth['isAuthenticated'](),controller[_0x0de3('0x14')]);router[_0x0de3('0x6')](_0x0de3('0x15'),auth[_0x0de3('0x7')](),controller[_0x0de3('0x16')]);router['get']('/:id/users',auth[_0x0de3('0x7')](),controller[_0x0de3('0x17')]);router[_0x0de3('0x18')](_0x0de3('0xc'),auth[_0x0de3('0x7')](),controller['addDisposition']);router[_0x0de3('0x18')](_0x0de3('0xd'),auth[_0x0de3('0x7')](),controller[_0x0de3('0x19')]);router[_0x0de3('0x18')]('/',auth[_0x0de3('0x7')](),controller[_0x0de3('0x1a')]);router['post'](_0x0de3('0xf'),auth['isAuthenticated'](),controller['addImap']);router[_0x0de3('0x18')](_0x0de3('0x1b'),auth[_0x0de3('0x7')](),controller[_0x0de3('0x1c')]);router[_0x0de3('0x18')](_0x0de3('0x1d'),auth[_0x0de3('0x7')](),controller['addInteraction']);router[_0x0de3('0x18')]('/:id/applications',auth['isAuthenticated'](),controller[_0x0de3('0x1e')]);router[_0x0de3('0x18')](_0x0de3('0x1f'),auth[_0x0de3('0x7')](),controller['send']);router[_0x0de3('0x18')](_0x0de3('0x20'),auth[_0x0de3('0x7')](),controller[_0x0de3('0x21')]);router['put']('/:id',auth[_0x0de3('0x7')](),controller['update']);router[_0x0de3('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x0de3('0x22')](_0x0de3('0xd'),auth['isAuthenticated'](),controller[_0x0de3('0x23')]);router[_0x0de3('0x22')](_0x0de3('0xf'),auth[_0x0de3('0x7')](),controller['removeImap']);router[_0x0de3('0x22')](_0x0de3('0x1b'),auth[_0x0de3('0x7')](),controller[_0x0de3('0x24')]);router[_0x0de3('0x22')](_0x0de3('0xa'),auth[_0x0de3('0x7')](),controller[_0x0de3('0x25')]);router['delete'](_0x0de3('0x20'),auth[_0x0de3('0x7')](),controller[_0x0de3('0x26')]);module[_0x0de3('0x27')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 7cf141d..474cf5b 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 _0x2bf3=['exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize'];(function(_0x4e3fb9,_0x47ec2d){var _0x4aecce=function(_0x2861bf){while(--_0x2861bf){_0x4e3fb9['push'](_0x4e3fb9['shift']());}};_0x4aecce(++_0x47ec2d);}(_0x2bf3,0xdb));var _0x32bf=function(_0x438a80,_0x1f30d6){_0x438a80=_0x438a80-0x0;var _0x491f0b=_0x2bf3[_0x438a80];return _0x491f0b;};'use strict';var Sequelize=require(_0x32bf('0x0'));module[_0x32bf('0x1')]={'description':{'type':Sequelize[_0x32bf('0x2')]},'name':{'type':Sequelize[_0x32bf('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x32bf('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x32bf('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x32bf('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x32bf('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x32bf('0x4')]},'markAsUnread':{'type':Sequelize[_0x32bf('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x32bf('0x5')},'fontSize':{'type':Sequelize[_0x32bf('0x6')](0x2)[_0x32bf('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x32bf('0x8');}},'notificationSound':{'type':Sequelize[_0x32bf('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x32bf('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x32bf('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x32bf('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x32bf('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x32bf('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x32bf('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x32bf('0x3')],'defaultValue':![],'comment':_0x32bf('0xa'),'set':function(_0x2aa415){if(!_0x2aa415)this['setDataValue'](_0x32bf('0xb'),null);this[_0x32bf('0xc')](_0x32bf('0xd'),_0x2aa415);}},'provider':{'type':Sequelize[_0x32bf('0xe')](_0x32bf('0xf'),_0x32bf('0x10'),_0x32bf('0x11'),_0x32bf('0x12')),'defaultValue':null,'get':function(){if(!this[_0x32bf('0x13')](_0x32bf('0x14')))return'custom';return this[_0x32bf('0x13')](_0x32bf('0x14'));},'set':function(_0x1eaa42){if(_0x1eaa42===_0x32bf('0x15'))_0x1eaa42=null;return this['setDataValue'](_0x32bf('0x14'),_0x1eaa42);}}}; \ No newline at end of file +var _0xae57=['provider','custom','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue'];(function(_0x400351,_0x1d8225){var _0x40c282=function(_0x5306d6){while(--_0x5306d6){_0x400351['push'](_0x400351['shift']());}};_0x40c282(++_0x1d8225);}(_0xae57,0x156));var _0x7ae5=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xae57[_0x1caf6a];return _0x1bf493;};'use strict';var Sequelize=require(_0x7ae5('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7ae5('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x7ae5('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x7ae5('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x7ae5('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x7ae5('0x3')]},'markAsUnread':{'type':Sequelize[_0x7ae5('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7ae5('0x1')],'allowNull':![],'defaultValue':_0x7ae5('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x7ae5('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7ae5('0x6');}},'notificationSound':{'type':Sequelize[_0x7ae5('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7ae5('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7ae5('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7ae5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7ae5('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7ae5('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x7ae5('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x7ae5('0x2')],'defaultValue':![],'comment':_0x7ae5('0x9'),'set':function(_0x11245c){if(!_0x11245c)this['setDataValue'](_0x7ae5('0xa'),null);this['setDataValue'](_0x7ae5('0xb'),_0x11245c);}},'provider':{'type':Sequelize[_0x7ae5('0xc')](_0x7ae5('0xd'),_0x7ae5('0xe'),_0x7ae5('0xf'),_0x7ae5('0x10')),'defaultValue':null,'get':function(){if(!this[_0x7ae5('0x11')](_0x7ae5('0x12')))return _0x7ae5('0x13');return this[_0x7ae5('0x11')](_0x7ae5('0x12'));},'set':function(_0x565e8b){if(_0x565e8b===_0x7ae5('0x13'))_0x565e8b=null;return this['setDataValue'](_0x7ae5('0x12'),_0x565e8b);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index e9692cc..1243ef6 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 _0x5177=['isArray','getAgents','util','lodash','juice','ioredis','../../components/parsers/qs','api','defaults','localhost','socket.io-emitter','redis','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','destroy','get','MailAccounts','UserProfileResource','name','send','index','MailServerOut','Smtp','mandatoryDispositionPause','map','type','model','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','MailAccount','includeAll','findAll','rows','show','MailServerIn','Imap','Pause','keys','rawAttributes','length','include','options','find','update','body','modernAuthentication','CloudProviderId','params','describe','addDisposition','Disposition','create','findOne','hasOwnProperty','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','key','provider','custom','email','isNil','active','description','user','username','password','pass','service','host','port','authentication','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','User','fullname','internal','color','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','CmList','Contacts','updatedAt','DESC','from','attachments','join','root','auth','secure','SendMail','List\x20not\x20found','List','ListId','subject','attach','out','messageId','Messages','verifySmtp','CloudProvider','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x5177,0x166));var _0x7517=function(_0x356c57,_0x259268){_0x356c57=_0x356c57-0x0;var _0x427d09=_0x5177[_0x356c57];return _0x427d09;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x7517('0x0'));var path=require('path');var _=require(_0x7517('0x1'));var juice=require(_0x7517('0x2'));var Redis=require(_0x7517('0x3'));var qs=require(_0x7517('0x4'));var logger=require('../../config/logger')(_0x7517('0x5'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x7517('0x6')](config['redis'],{'host':_0x7517('0x7'),'port':0x18eb});var socket=require(_0x7517('0x8'))(new Redis(config[_0x7517('0x9')]));require(_0x7517('0xa'))[_0x7517('0xb')](socket);var jayson=require(_0x7517('0xc'));var client=jayson[_0x7517('0xd')][_0x7517('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x3a3d77,_0x5b9542,_0x441881,_0x2d4922){return new BPromise(function(_0xe08ea1,_0x136ad9){var _0x22a963=_0x2d4922||client;return _0x22a963[_0x7517('0xf')](_0x3a3d77,_0x441881)[_0x7517('0x10')](function(_0x1062c1){logger[_0x7517('0x11')](_0x7517('0x12'),_0x5b9542,_0x7517('0x13'));logger[_0x7517('0x14')](_0x7517('0x15'),_0x5b9542,_0x7517('0x13'),JSON[_0x7517('0x16')](_0x1062c1));if(_0x1062c1[_0x7517('0x17')]){if(_0x1062c1[_0x7517('0x17')][_0x7517('0x18')]===0x1f4){logger['error'](_0x7517('0x12'),_0x5b9542,_0x1062c1[_0x7517('0x17')][_0x7517('0x19')]);return _0x136ad9(_0x1062c1[_0x7517('0x17')][_0x7517('0x19')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5b9542,_0x1062c1[_0x7517('0x17')][_0x7517('0x19')]);return _0xe08ea1(_0x1062c1[_0x7517('0x17')][_0x7517('0x19')]);}else{logger[_0x7517('0x11')](_0x7517('0x12'),_0x5b9542,'request\x20sent');_0xe08ea1(_0x1062c1[_0x7517('0x1a')][_0x7517('0x19')]);}})[_0x7517('0x1b')](function(_0x4ae29d){logger[_0x7517('0x17')](_0x7517('0x12'),_0x5b9542,_0x4ae29d);_0x136ad9(_0x4ae29d);});});}function respondWithStatusCode(_0x3ac855,_0x41cbcc){_0x41cbcc=_0x41cbcc||0xcc;return function(_0x1300a9){if(_0x1300a9){return _0x3ac855[_0x7517('0x1c')](_0x41cbcc);}return _0x3ac855[_0x7517('0x1d')](_0x41cbcc)[_0x7517('0x1e')]();};}function respondWithResult(_0x4891e0,_0x4325a4){_0x4325a4=_0x4325a4||0xc8;return function(_0x349d59){if(_0x349d59){return _0x4891e0['status'](_0x4325a4)[_0x7517('0x1f')](_0x349d59);}};}function respondWithFilteredResult(_0x2c83ee,_0x1dcad0){return function(_0x505c95){if(_0x505c95){var _0x16f3c2=typeof _0x1dcad0['offset']===_0x7517('0x20')&&typeof _0x1dcad0[_0x7517('0x21')]===_0x7517('0x20');var _0x380a65=_0x505c95[_0x7517('0x22')];var _0xb02ad8=_0x16f3c2?0x0:_0x1dcad0['offset'];var _0x1b53fb=_0x16f3c2?_0x505c95['count']:_0x1dcad0[_0x7517('0x23')]+_0x1dcad0['limit'];var _0x581b5f;if(_0x1b53fb>=_0x380a65){_0x1b53fb=_0x380a65;_0x581b5f=0xc8;}else{_0x581b5f=0xce;}_0x2c83ee[_0x7517('0x1d')](_0x581b5f);return _0x2c83ee['set'](_0x7517('0x24'),_0xb02ad8+'-'+_0x1b53fb+'/'+_0x380a65)[_0x7517('0x1f')](_0x505c95);}return null;};}function saveUpdates(_0x16d67d){return function(_0x2a2ccb){if(_0x2a2ccb){return _0x2a2ccb['update'](_0x16d67d)[_0x7517('0x10')](function(_0x2ddece){return _0x2ddece;});}return null;};}function removeEntity(_0x1d76ee){return function(_0x30c8e0){if(_0x30c8e0){return _0x30c8e0[_0x7517('0x25')]()[_0x7517('0x10')](function(){var _0x5a851b=_0x30c8e0[_0x7517('0x26')]({'plain':!![]});var _0x4e9564=_0x7517('0x27');return db[_0x7517('0x28')][_0x7517('0x25')]({'where':{'type':_0x4e9564,'resourceId':_0x5a851b['id']}})[_0x7517('0x10')](function(){return _0x30c8e0;});})[_0x7517('0x10')](function(){_0x1d76ee[_0x7517('0x1d')](0xcc)[_0x7517('0x1e')]();});}};}function handleEntityNotFound(_0x5acb34){return function(_0x874def){if(!_0x874def){_0x5acb34[_0x7517('0x1c')](0x194);}return _0x874def;};}function handleError(_0x1cae7f,_0x2ef9ec){_0x2ef9ec=_0x2ef9ec||0x1f4;return function(_0x5efa25){logger[_0x7517('0x17')](_0x5efa25['stack']);if(_0x5efa25[_0x7517('0x29')]){delete _0x5efa25[_0x7517('0x29')];}_0x1cae7f[_0x7517('0x1d')](_0x2ef9ec)[_0x7517('0x2a')](_0x5efa25);};}exports[_0x7517('0x2b')]=function(_0x256f63,_0x4270e3){var _0x10c27a={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x7517('0x2c')],'as':_0x7517('0x2d')},{'model':db['Pause'],'as':_0x7517('0x2e')}]},_0x50f721={},_0x2c8c91={'count':0x0,'rows':[]};var _0x48ded7=_[_0x7517('0x2f')](db['MailAccount']['rawAttributes'],function(_0x5bcd4b){return{'name':_0x5bcd4b['fieldName'],'type':_0x5bcd4b[_0x7517('0x30')]['key']};});_0x50f721[_0x7517('0x31')]=_[_0x7517('0x2f')](_0x48ded7,'name');_0x50f721['query']=_['keys'](_0x256f63[_0x7517('0x32')]);_0x50f721[_0x7517('0x33')]=_[_0x7517('0x34')](_0x50f721[_0x7517('0x31')],_0x50f721[_0x7517('0x32')]);_0x10c27a[_0x7517('0x35')]=_[_0x7517('0x34')](_0x50f721[_0x7517('0x31')],qs['fields'](_0x256f63[_0x7517('0x32')][_0x7517('0x36')]));_0x10c27a[_0x7517('0x35')]=_0x10c27a[_0x7517('0x35')]['length']?_0x10c27a[_0x7517('0x35')]:_0x50f721[_0x7517('0x31')];if(!_0x256f63[_0x7517('0x32')]['hasOwnProperty'](_0x7517('0x37'))){_0x10c27a[_0x7517('0x21')]=qs[_0x7517('0x21')](_0x256f63[_0x7517('0x32')][_0x7517('0x21')]);_0x10c27a[_0x7517('0x23')]=qs[_0x7517('0x23')](_0x256f63[_0x7517('0x32')][_0x7517('0x23')]);}_0x10c27a[_0x7517('0x38')]=qs[_0x7517('0x39')](_0x256f63[_0x7517('0x32')][_0x7517('0x39')]);_0x10c27a['where']=qs[_0x7517('0x33')](_[_0x7517('0x3a')](_0x256f63[_0x7517('0x32')],_0x50f721[_0x7517('0x33')]),_0x48ded7);if(_0x256f63[_0x7517('0x32')]['filter']){_0x10c27a[_0x7517('0x3b')]=_['merge'](_0x10c27a[_0x7517('0x3b')],{'$or':_[_0x7517('0x2f')](_0x48ded7,function(_0x589a27){if(_0x589a27[_0x7517('0x30')]!==_0x7517('0x3c')){var _0x48338a={};_0x48338a[_0x589a27['name']]={'$like':'%'+_0x256f63[_0x7517('0x32')][_0x7517('0x3d')]+'%'};return _0x48338a;}})});}_0x10c27a=_[_0x7517('0x3e')]({},_0x10c27a,_0x256f63['options']);var _0xe9b414={'where':_0x10c27a[_0x7517('0x3b')]};return db[_0x7517('0x3f')][_0x7517('0x22')](_0xe9b414)['then'](function(_0x5f06f0){_0x2c8c91[_0x7517('0x22')]=_0x5f06f0;if(_0x256f63[_0x7517('0x32')][_0x7517('0x40')]){_0x10c27a['include']=[{'all':!![]}];}return db[_0x7517('0x3f')][_0x7517('0x41')](_0x10c27a);})['then'](function(_0x1a77f4){_0x2c8c91[_0x7517('0x42')]=_0x1a77f4;return _0x2c8c91;})[_0x7517('0x10')](respondWithFilteredResult(_0x4270e3,_0x10c27a))[_0x7517('0x1b')](handleError(_0x4270e3,null));};exports[_0x7517('0x43')]=function(_0x29a818,_0x5204d0){var _0x5304ac={'raw':![],'where':{'id':_0x29a818['params']['id']},'include':[{'model':db[_0x7517('0x44')],'as':_0x7517('0x45')},{'model':db[_0x7517('0x2c')],'as':_0x7517('0x2d')},{'model':db[_0x7517('0x46')],'as':_0x7517('0x2e')}]},_0x3598c3={};_0x3598c3[_0x7517('0x31')]=_[_0x7517('0x47')](db[_0x7517('0x3f')][_0x7517('0x48')]);_0x3598c3[_0x7517('0x32')]=_[_0x7517('0x47')](_0x29a818['query']);_0x3598c3[_0x7517('0x33')]=_[_0x7517('0x34')](_0x3598c3[_0x7517('0x31')],_0x3598c3['query']);_0x5304ac['attributes']=_[_0x7517('0x34')](_0x3598c3['model'],qs['fields'](_0x29a818[_0x7517('0x32')]['fields']));_0x5304ac[_0x7517('0x35')]=_0x5304ac[_0x7517('0x35')][_0x7517('0x49')]?_0x5304ac[_0x7517('0x35')]:_0x3598c3[_0x7517('0x31')];if(_0x29a818[_0x7517('0x32')][_0x7517('0x40')]){_0x5304ac[_0x7517('0x4a')]=[{'all':!![]}];}_0x5304ac=_[_0x7517('0x3e')]({},_0x5304ac,_0x29a818[_0x7517('0x4b')]);return db[_0x7517('0x3f')][_0x7517('0x4c')](_0x5304ac)[_0x7517('0x10')](handleEntityNotFound(_0x5204d0,null))['then'](respondWithResult(_0x5204d0,null))['catch'](handleError(_0x5204d0,null));};exports[_0x7517('0x4d')]=function(_0x41d1c5,_0x30e3c0){if(_0x41d1c5[_0x7517('0x4e')]['id']){delete _0x41d1c5['body']['id'];}if(_0x41d1c5[_0x7517('0x4e')][_0x7517('0x45')]){if(!_0x41d1c5[_0x7517('0x4e')][_0x7517('0x45')][_0x7517('0x4f')]){_0x41d1c5[_0x7517('0x4e')][_0x7517('0x45')]['CloudProviderId']=null;}}if(_0x41d1c5[_0x7517('0x4e')][_0x7517('0x2d')]){if(!_0x41d1c5[_0x7517('0x4e')][_0x7517('0x2d')][_0x7517('0x4f')]){_0x41d1c5['body'][_0x7517('0x2d')][_0x7517('0x50')]=null;}}return db[_0x7517('0x3f')][_0x7517('0x4c')]({'where':{'id':_0x41d1c5[_0x7517('0x51')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x7517('0x45')},{'model':db[_0x7517('0x2c')],'as':_0x7517('0x2d')},{'model':db[_0x7517('0x46')],'as':_0x7517('0x2e')}]})['then'](handleEntityNotFound(_0x30e3c0,null))[_0x7517('0x10')](saveUpdates(_0x41d1c5['body'],null))[_0x7517('0x10')](function(_0x305c4c){if(_0x305c4c&&_0x41d1c5[_0x7517('0x4e')]['Imap']){return db[_0x7517('0x44')][_0x7517('0x4d')](_0x41d1c5['body'][_0x7517('0x45')],{'where':{'MailAccountId':_0x305c4c['id']}})[_0x7517('0x10')](function(){return _0x305c4c;});}return _0x305c4c;})['then'](function(_0x26d7ef){if(_0x26d7ef&&_0x41d1c5['body'][_0x7517('0x2d')]){return db['MailServerOut'][_0x7517('0x4d')](_0x41d1c5[_0x7517('0x4e')][_0x7517('0x2d')],{'where':{'MailAccountId':_0x26d7ef['id']}})['then'](function(){return _0x26d7ef;});}return _0x26d7ef;})[_0x7517('0x10')](respondWithResult(_0x30e3c0,null))[_0x7517('0x1b')](handleError(_0x30e3c0,null));};exports[_0x7517('0x52')]=function(_0x47b195,_0xdb63c3){return db[_0x7517('0x3f')][_0x7517('0x52')]()[_0x7517('0x10')](respondWithResult(_0xdb63c3,null))['catch'](handleError(_0xdb63c3,null));};exports[_0x7517('0x53')]=function(_0xe0a7eb,_0x5b6945){if(_0xe0a7eb[_0x7517('0x4e')]['id']){delete _0xe0a7eb[_0x7517('0x4e')]['id'];}return db[_0x7517('0x3f')][_0x7517('0x4c')]({'where':{'id':_0xe0a7eb['params']['id']}})['then'](handleEntityNotFound(_0x5b6945,null))[_0x7517('0x10')](function(_0x1f34f2){if(_0x1f34f2){_0xe0a7eb[_0x7517('0x4e')]['MailAccountId']=_0x1f34f2['id'];return db[_0x7517('0x54')][_0x7517('0x55')](_0xe0a7eb[_0x7517('0x4e')]);}})[_0x7517('0x10')](respondWithResult(_0x5b6945,null))[_0x7517('0x1b')](handleError(_0x5b6945,null));};exports['getDispositions']=function(_0x1041be,_0xe7b1b4){var _0x3e1110={'raw':![],'where':{}};var _0x227969={};var _0x1938d4={'count':0x0,'rows':[]};return db['MailAccount'][_0x7517('0x56')]({'where':{'id':_0x1041be['params']['id']}})[_0x7517('0x10')](handleEntityNotFound(_0xe7b1b4,null))['then'](function(_0x443b1b){if(_0x443b1b){_0x227969[_0x7517('0x31')]=_[_0x7517('0x47')](db[_0x7517('0x54')][_0x7517('0x48')]);_0x227969['query']=_[_0x7517('0x47')](_0x1041be[_0x7517('0x32')]);_0x227969[_0x7517('0x33')]=_[_0x7517('0x34')](_0x227969[_0x7517('0x31')],_0x227969[_0x7517('0x32')]);_0x3e1110[_0x7517('0x35')]=_['intersection'](_0x227969['model'],qs[_0x7517('0x36')](_0x1041be[_0x7517('0x32')][_0x7517('0x36')]));_0x3e1110[_0x7517('0x35')]=_0x3e1110[_0x7517('0x35')][_0x7517('0x49')]?_0x3e1110[_0x7517('0x35')]:_0x227969[_0x7517('0x31')];if(!_0x1041be[_0x7517('0x32')][_0x7517('0x57')](_0x7517('0x37'))){_0x3e1110['limit']=qs[_0x7517('0x21')](_0x1041be[_0x7517('0x32')][_0x7517('0x21')]);_0x3e1110[_0x7517('0x23')]=qs[_0x7517('0x23')](_0x1041be[_0x7517('0x32')]['offset']);}_0x3e1110['order']=qs[_0x7517('0x39')](_0x1041be[_0x7517('0x32')][_0x7517('0x39')]);_0x3e1110[_0x7517('0x3b')]=qs[_0x7517('0x33')](_[_0x7517('0x3a')](_0x1041be[_0x7517('0x32')],_0x227969[_0x7517('0x33')]));_0x3e1110[_0x7517('0x3b')][_0x7517('0x58')]=_0x443b1b['id'];if(_0x1041be[_0x7517('0x32')]['filter']){_0x3e1110[_0x7517('0x3b')]=_[_0x7517('0x3e')](_0x3e1110[_0x7517('0x3b')],{'$or':_[_0x7517('0x2f')](_0x3e1110[_0x7517('0x35')],function(_0x1f4604){var _0x1fd6ce={};_0x1fd6ce[_0x1f4604]={'$like':'%'+_0x1041be['query'][_0x7517('0x3d')]+'%'};return _0x1fd6ce;})});}_0x3e1110=_['merge']({},_0x3e1110,_0x1041be['options']);return db[_0x7517('0x54')][_0x7517('0x22')]({'where':_0x3e1110['where']})['then'](function(_0x59020f){_0x1938d4['count']=_0x59020f;if(_0x1041be['query']['includeAll']){_0x3e1110['include']=[{'all':!![]}];}return db[_0x7517('0x54')]['findAll'](_0x3e1110);})['then'](function(_0x21bfb2){_0x1938d4[_0x7517('0x42')]=_0x21bfb2;return _0x1938d4;});}})[_0x7517('0x10')](respondWithFilteredResult(_0xe7b1b4,_0x3e1110))[_0x7517('0x1b')](handleError(_0xe7b1b4,null));};exports['removeDispositions']=function(_0x53df63,_0x36e12a){return db[_0x7517('0x3f')][_0x7517('0x4c')]({'where':{'id':_0x53df63['params']['id']}})['then'](handleEntityNotFound(_0x36e12a,null))['then'](function(_0x55525b){if(_0x55525b){return _0x55525b[_0x7517('0x59')](_0x53df63['query'][_0x7517('0x5a')]);}})[_0x7517('0x10')](respondWithStatusCode(_0x36e12a,null))[_0x7517('0x1b')](handleError(_0x36e12a,null));};exports[_0x7517('0x5b')]=function(_0x32d809,_0x4cecd2){if(_0x32d809['body']['id']){delete _0x32d809[_0x7517('0x4e')]['id'];}return db['MailAccount'][_0x7517('0x4c')]({'where':{'id':_0x32d809[_0x7517('0x51')]['id']}})[_0x7517('0x10')](handleEntityNotFound(_0x4cecd2,null))[_0x7517('0x10')](function(_0x7aa94a){if(_0x7aa94a){_0x32d809[_0x7517('0x4e')][_0x7517('0x58')]=_0x7aa94a['id'];return db[_0x7517('0x5c')][_0x7517('0x55')](_0x32d809[_0x7517('0x4e')]);}})[_0x7517('0x10')](respondWithResult(_0x4cecd2,null))[_0x7517('0x1b')](handleError(_0x4cecd2,null));};exports[_0x7517('0x5d')]=function(_0x826e6b,_0x372f79){var _0x90f2f={'raw':![],'where':{}};var _0x5e43cc={};var _0xb1507e={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x826e6b[_0x7517('0x51')]['id']}})['then'](handleEntityNotFound(_0x372f79,null))[_0x7517('0x10')](function(_0x314dea){if(_0x314dea){_0x5e43cc[_0x7517('0x31')]=_['keys'](db['CannedAnswer'][_0x7517('0x48')]);_0x5e43cc['query']=_[_0x7517('0x47')](_0x826e6b[_0x7517('0x32')]);_0x5e43cc[_0x7517('0x33')]=_[_0x7517('0x34')](_0x5e43cc[_0x7517('0x31')],_0x5e43cc['query']);_0x90f2f[_0x7517('0x35')]=_[_0x7517('0x34')](_0x5e43cc[_0x7517('0x31')],qs[_0x7517('0x36')](_0x826e6b[_0x7517('0x32')][_0x7517('0x36')]));_0x90f2f['attributes']=_0x90f2f[_0x7517('0x35')][_0x7517('0x49')]?_0x90f2f['attributes']:_0x5e43cc[_0x7517('0x31')];if(!_0x826e6b[_0x7517('0x32')]['hasOwnProperty'](_0x7517('0x37'))){_0x90f2f['limit']=qs['limit'](_0x826e6b[_0x7517('0x32')]['limit']);_0x90f2f['offset']=qs[_0x7517('0x23')](_0x826e6b['query']['offset']);}_0x90f2f[_0x7517('0x38')]=qs[_0x7517('0x39')](_0x826e6b[_0x7517('0x32')]['sort']);_0x90f2f['where']=qs['filters'](_[_0x7517('0x3a')](_0x826e6b[_0x7517('0x32')],_0x5e43cc['filters']));_0x90f2f['where'][_0x7517('0x58')]=_0x314dea['id'];if(_0x826e6b[_0x7517('0x32')][_0x7517('0x3d')]){_0x90f2f['where']=_[_0x7517('0x3e')](_0x90f2f[_0x7517('0x3b')],{'$or':_['map'](_0x90f2f[_0x7517('0x35')],function(_0x34b504){var _0x290e3e={};_0x290e3e[_0x34b504]={'$like':'%'+_0x826e6b['query'][_0x7517('0x3d')]+'%'};return _0x290e3e;})});}_0x90f2f=_[_0x7517('0x3e')]({},_0x90f2f,_0x826e6b[_0x7517('0x4b')]);return db[_0x7517('0x5c')][_0x7517('0x22')]({'where':_0x90f2f['where']})[_0x7517('0x10')](function(_0xa7c978){_0xb1507e[_0x7517('0x22')]=_0xa7c978;if(_0x826e6b[_0x7517('0x32')]['includeAll']){_0x90f2f['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x7517('0x41')](_0x90f2f);})['then'](function(_0x47cbc3){_0xb1507e['rows']=_0x47cbc3;return _0xb1507e;});}})[_0x7517('0x10')](respondWithFilteredResult(_0x372f79,_0x90f2f))[_0x7517('0x1b')](handleError(_0x372f79,null));};exports[_0x7517('0x5e')]=function(_0x10aaa1,_0x3ad346){return db['MailAccount'][_0x7517('0x4c')]({'where':{'id':_0x10aaa1[_0x7517('0x51')]['id']}})[_0x7517('0x10')](handleEntityNotFound(_0x3ad346,null))[_0x7517('0x10')](function(_0x502f19){if(_0x502f19){return _0x502f19[_0x7517('0x5e')](_0x10aaa1[_0x7517('0x32')][_0x7517('0x5a')]);}})[_0x7517('0x10')](respondWithStatusCode(_0x3ad346,null))[_0x7517('0x1b')](handleError(_0x3ad346,null));};exports[_0x7517('0x55')]=function(_0x5fc5b3,_0x244877){var _0x308c7c={'name':_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x29')],'key':_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x5f')],'provider':_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x60')]===_0x7517('0x61')?null:_0x5fc5b3['body'][_0x7517('0x60')],'email':_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x62')],'ListId':_0x5fc5b3[_0x7517('0x4e')]['ListId'],'active':!_[_0x7517('0x63')](_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x64')])?_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x64')]:!![],'description':_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x65')]||null,'Imap':{},'Smtp':{}};if(_0x308c7c['provider']){_0x308c7c[_0x7517('0x45')][_0x7517('0x66')]=_0x308c7c[_0x7517('0x2d')][_0x7517('0x66')]=_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x67')];_0x308c7c['Imap'][_0x7517('0x68')]=_0x308c7c[_0x7517('0x2d')][_0x7517('0x69')]=_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x68')];if(_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x4f')]){_0x308c7c[_0x7517('0x45')][_0x7517('0x4f')]=_0x308c7c[_0x7517('0x2d')]['modernAuthentication']=!![];_0x308c7c['Imap'][_0x7517('0x50')]=_0x308c7c['Smtp'][_0x7517('0x50')]=_0x5fc5b3['body'][_0x7517('0x50')];_0x308c7c[_0x7517('0x45')][_0x7517('0x68')]=_0x308c7c[_0x7517('0x2d')][_0x7517('0x69')]=null;}else{_0x308c7c[_0x7517('0x45')]['CloudProviderId']=_0x308c7c[_0x7517('0x2d')][_0x7517('0x50')]=null;}_0x308c7c[_0x7517('0x45')][_0x7517('0x6a')]=_0x308c7c[_0x7517('0x2d')][_0x7517('0x6a')]=null;_0x308c7c[_0x7517('0x45')]['host']=_0x308c7c['Smtp'][_0x7517('0x6b')]=null;_0x308c7c[_0x7517('0x45')][_0x7517('0x6c')]=_0x308c7c['Smtp'][_0x7517('0x6c')]=null;}else{if(_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x6d')]){_0x308c7c['Imap'][_0x7517('0x66')]=_0x308c7c['Smtp'][_0x7517('0x66')]=_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x67')];_0x308c7c[_0x7517('0x45')][_0x7517('0x68')]=_0x308c7c[_0x7517('0x2d')]['pass']=_0x5fc5b3['body'][_0x7517('0x68')];}else{_0x308c7c['Imap'][_0x7517('0x6d')]=_0x308c7c['Smtp']['authentication']=![];_0x308c7c[_0x7517('0x45')][_0x7517('0x66')]=_0x308c7c[_0x7517('0x2d')][_0x7517('0x66')]=null;_0x308c7c['Imap']['password']=_0x308c7c['Smtp']['pass']=null;}_0x308c7c[_0x7517('0x45')][_0x7517('0x6b')]=_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x45')]['host'];_0x308c7c[_0x7517('0x45')][_0x7517('0x6c')]=_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x45')]['port'];_0x308c7c[_0x7517('0x2d')][_0x7517('0x6b')]=_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x2d')][_0x7517('0x6b')];_0x308c7c[_0x7517('0x2d')][_0x7517('0x6c')]=_0x5fc5b3[_0x7517('0x4e')][_0x7517('0x2d')][_0x7517('0x6c')];}return db[_0x7517('0x3f')][_0x7517('0x55')](_0x308c7c,{'include':[{'model':db[_0x7517('0x2c')],'as':'Smtp'},{'model':db[_0x7517('0x44')],'as':_0x7517('0x45')}]})['then'](function(_0x436595){var _0x4c8559=_0x5fc5b3['user'][_0x7517('0x26')]({'plain':!![]});if(!_0x4c8559)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c8559[_0x7517('0x6e')]===_0x7517('0x66')){var _0x15b449=_0x436595[_0x7517('0x26')]({'plain':!![]});return db[_0x7517('0x6f')]['find']({'where':{'name':_0x7517('0x27'),'userProfileId':_0x4c8559[_0x7517('0x70')]},'raw':!![]})['then'](function(_0x4f4c93){if(_0x4f4c93&&_0x4f4c93[_0x7517('0x71')]===0x0){return db[_0x7517('0x28')][_0x7517('0x55')]({'name':_0x15b449['name'],'resourceId':_0x15b449['id'],'type':_0x4f4c93[_0x7517('0x29')],'sectionId':_0x4f4c93['id']},{})[_0x7517('0x10')](function(){return _0x436595;});}else{return _0x436595;}})[_0x7517('0x1b')](function(_0x2afc81){logger[_0x7517('0x17')](_0x7517('0x72'),_0x2afc81);throw _0x2afc81;});}return _0x436595;})['then'](respondWithResult(_0x244877,0xc9))['catch'](handleError(_0x244877,null));};exports[_0x7517('0x73')]=function(_0x1d4d7c,_0x3d2c3c){return db[_0x7517('0x3f')]['findOne']({'where':{'id':_0x1d4d7c[_0x7517('0x51')]['id']}})[_0x7517('0x10')](handleEntityNotFound(_0x3d2c3c,null))[_0x7517('0x10')](function(_0x2a6755){if(_0x2a6755){return _0x2a6755[_0x7517('0x73')]();}return null;})[_0x7517('0x10')](respondWithResult(_0x3d2c3c,null))[_0x7517('0x1b')](handleError(_0x3d2c3c,null));};exports['addImap']=function(_0x48a44c,_0x1dadb5){if(_0x48a44c[_0x7517('0x4e')]['id']){delete _0x48a44c[_0x7517('0x4e')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x48a44c[_0x7517('0x51')]['id']}})[_0x7517('0x10')](handleEntityNotFound(_0x1dadb5,null))[_0x7517('0x10')](function(_0x3abdd2){if(_0x3abdd2){_0x48a44c[_0x7517('0x4e')][_0x7517('0x58')]=_0x3abdd2['id'];return db[_0x7517('0x44')][_0x7517('0x55')](_0x48a44c['body']);}})[_0x7517('0x10')](respondWithResult(_0x1dadb5,null))['catch'](handleError(_0x1dadb5,null));};exports[_0x7517('0x74')]=function(_0x49926c,_0x537528){return db[_0x7517('0x3f')]['findOne']({'where':{'id':_0x49926c[_0x7517('0x51')]['id']}})[_0x7517('0x10')](handleEntityNotFound(_0x537528,null))[_0x7517('0x10')](function(_0x5140eb){if(_0x5140eb){return _0x5140eb[_0x7517('0x75')](null);}return null;})[_0x7517('0x10')](respondWithStatusCode(_0x537528,null))[_0x7517('0x1b')](handleError(_0x537528,null));};exports[_0x7517('0x76')]=function(_0x2a8ebe,_0x3f34be){return db[_0x7517('0x3f')][_0x7517('0x56')]({'where':{'id':_0x2a8ebe[_0x7517('0x51')]['id']}})[_0x7517('0x10')](handleEntityNotFound(_0x3f34be,null))[_0x7517('0x10')](function(_0x1cce25){if(_0x1cce25){return _0x1cce25['getSmtp']();}return null;})[_0x7517('0x10')](respondWithResult(_0x3f34be,null))['catch'](handleError(_0x3f34be,null));};exports['addSmtp']=function(_0x194cc4,_0x1d4878){if(_0x194cc4[_0x7517('0x4e')]['id']){delete _0x194cc4[_0x7517('0x4e')]['id'];}return db[_0x7517('0x3f')][_0x7517('0x4c')]({'where':{'id':_0x194cc4[_0x7517('0x51')]['id']}})['then'](handleEntityNotFound(_0x1d4878,null))[_0x7517('0x10')](function(_0x47e179){if(_0x47e179){_0x194cc4[_0x7517('0x4e')]['MailAccountId']=_0x47e179['id'];return db['MailServerOut'][_0x7517('0x55')](_0x194cc4['body']);}})[_0x7517('0x10')](respondWithResult(_0x1d4878,null))[_0x7517('0x1b')](handleError(_0x1d4878,null));};exports[_0x7517('0x77')]=function(_0x5de06f,_0x25b53e){return db[_0x7517('0x3f')][_0x7517('0x56')]({'where':{'id':_0x5de06f[_0x7517('0x51')]['id']}})[_0x7517('0x10')](handleEntityNotFound(_0x25b53e,null))[_0x7517('0x10')](function(_0x21f77b){if(_0x21f77b){return _0x21f77b[_0x7517('0x78')](null);}return null;})[_0x7517('0x10')](respondWithStatusCode(_0x25b53e,null))[_0x7517('0x1b')](handleError(_0x25b53e,null));};exports['addInteraction']=function(_0x4a29c8,_0x2f7b96){return db['MailInteraction'][_0x7517('0x4c')]({'where':{'id':_0x4a29c8['params']['id']}})['then'](handleEntityNotFound(_0x2f7b96,null))[_0x7517('0x10')](function(_0x9864c2){if(_0x9864c2){return _0x9864c2[_0x7517('0x79')](_0x4a29c8['body'][_0x7517('0x5a')],_[_0x7517('0x7a')](_0x4a29c8['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x2f7b96,null))[_0x7517('0x1b')](handleError(_0x2f7b96,null));};exports[_0x7517('0x7b')]=function(_0x4aeccb,_0x48dea5){var _0x5baed8={'raw':![],'where':{}};var _0x2d569={};var _0x30c46e={'count':0x0,'rows':[]};return db[_0x7517('0x3f')][_0x7517('0x56')]({'where':{'id':_0x4aeccb[_0x7517('0x51')]['id']}})[_0x7517('0x10')](handleEntityNotFound(_0x48dea5,null))[_0x7517('0x10')](function(_0x96144b){if(_0x96144b){_0x2d569[_0x7517('0x31')]=_[_0x7517('0x47')](db['MailInteraction'][_0x7517('0x48')]);_0x2d569[_0x7517('0x32')]=_['keys'](_0x4aeccb['query']);_0x2d569[_0x7517('0x33')]=_[_0x7517('0x34')](_0x2d569['model'],_0x2d569['query']);_0x5baed8[_0x7517('0x35')]=_[_0x7517('0x34')](_0x2d569[_0x7517('0x31')],qs[_0x7517('0x36')](_0x4aeccb['query'][_0x7517('0x36')]));_0x5baed8[_0x7517('0x35')]=_0x5baed8[_0x7517('0x35')][_0x7517('0x49')]?_0x5baed8['attributes']:_0x2d569['model'];if(!_0x4aeccb['query'][_0x7517('0x57')]('nolimit')){_0x5baed8['limit']=qs[_0x7517('0x21')](_0x4aeccb[_0x7517('0x32')][_0x7517('0x21')]);_0x5baed8[_0x7517('0x23')]=qs['offset'](_0x4aeccb[_0x7517('0x32')][_0x7517('0x23')]);}_0x5baed8[_0x7517('0x38')]=qs[_0x7517('0x39')](_0x4aeccb['query'][_0x7517('0x39')]);_0x5baed8[_0x7517('0x3b')]=qs[_0x7517('0x33')](_['pick'](_0x4aeccb[_0x7517('0x32')],_0x2d569[_0x7517('0x33')]));_0x5baed8['where'][_0x7517('0x58')]=_0x96144b['id'];if(_0x4aeccb[_0x7517('0x32')][_0x7517('0x3d')]){_0x5baed8[_0x7517('0x3b')]=_[_0x7517('0x3e')](_0x5baed8['where'],{'$or':_[_0x7517('0x2f')](_0x5baed8[_0x7517('0x35')],function(_0x104947){var _0x3a2d78={};_0x3a2d78[_0x104947]={'$like':'%'+_0x4aeccb[_0x7517('0x32')]['filter']+'%'};return _0x3a2d78;})});}_0x5baed8=_['merge']({},_0x5baed8,_0x4aeccb['options']);return db[_0x7517('0x7c')]['count']({'where':_0x5baed8[_0x7517('0x3b')]})[_0x7517('0x10')](function(_0x5a6846){_0x30c46e[_0x7517('0x22')]=_0x5a6846;if(_0x4aeccb[_0x7517('0x32')][_0x7517('0x40')]){_0x5baed8[_0x7517('0x4a')]=[{'model':db[_0x7517('0x7d')],'as':'Contact','required':![]},{'model':db[_0x7517('0x7e')],'as':'Owner','attributes':[_0x7517('0x29'),_0x7517('0x7f'),_0x7517('0x80')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x7517('0x29'),_0x7517('0x81')],'where':_0x4aeccb[_0x7517('0x32')]['tag']?{'id':_0x4aeccb[_0x7517('0x32')]['tag']}:undefined,'required':_0x4aeccb['query']['tag']?!![]:![]}];}return db['MailInteraction'][_0x7517('0x41')](_0x5baed8);})[_0x7517('0x10')](function(_0x4a8f8c){_0x30c46e[_0x7517('0x42')]=_0x4a8f8c;return _0x30c46e;});}})['then'](respondWithFilteredResult(_0x48dea5,_0x5baed8))[_0x7517('0x1b')](handleError(_0x48dea5,null));};exports[_0x7517('0x82')]=function addApplications(_0x4c32c0,_0x45b68d){var _0x3cec98=_0x4c32c0[_0x7517('0x51')]['id'];var _0x256183=_0x4c32c0[_0x7517('0x4e')];var _0x37844b=0xc8;var _0x5ced67=null;return db['sequelize'][_0x7517('0x83')]({'isolationLevel':db[_0x7517('0x84')][_0x7517('0x85')]['ISOLATION_LEVELS'][_0x7517('0x86')]},function(_0x44c0e0){return db[_0x7517('0x3f')][_0x7517('0x56')]({'where':{'id':_0x3cec98},'transaction':_0x44c0e0})[_0x7517('0x10')](function(_0x3b6022){if(_0x3b6022){return db[_0x7517('0x87')][_0x7517('0x25')]({'where':{'MailAccountId':_0x3cec98},'transaction':_0x44c0e0})[_0x7517('0x10')](function(){var _0x5f38ba=_[_0x7517('0x2f')](_0x256183,function(_0x58239d){_0x58239d['MailAccountId']=_0x3cec98;return _0x58239d;});return db[_0x7517('0x87')][_0x7517('0x88')](_0x5f38ba,{'transaction':_0x44c0e0});});}else{_0x37844b=0x194;_0x5ced67=[];}});})['then'](function(){if(_0x37844b!==0x194){return db[_0x7517('0x87')][_0x7517('0x89')]({'where':{'MailAccountId':_0x3cec98},'order':_0x7517('0x8a')})[_0x7517('0x10')](function(_0x49e532){_0x5ced67=_0x49e532;});}})[_0x7517('0x1b')](function(_0x95e9f2){_0x37844b=0x1f4;logger[_0x7517('0x17')](_0x95e9f2['stack']);if(_0x95e9f2['name']){delete _0x95e9f2['name'];}_0x5ced67=_0x95e9f2;})[_0x7517('0x8b')](function(){if(_0x5ced67===null){_0x45b68d[_0x7517('0x1c')](_0x37844b);}else{if(_0x37844b===0x1f4){_0x45b68d['status'](_0x37844b)[_0x7517('0x2a')](_0x5ced67);}else{_0x45b68d[_0x7517('0x1d')](_0x37844b)[_0x7517('0x1f')](_0x5ced67);}}});};exports[_0x7517('0x8c')]=function(_0x3a3eaf,_0x9f8c5a){var _0x326d3d={};var _0x10f6e6={};var _0x23fec9;var _0x351a96;return db[_0x7517('0x3f')][_0x7517('0x56')]({'where':{'id':_0x3a3eaf[_0x7517('0x51')]['id']}})[_0x7517('0x10')](handleEntityNotFound(_0x9f8c5a,null))[_0x7517('0x10')](function(_0x4dc9be){if(_0x4dc9be){_0x23fec9=_0x4dc9be;_0x10f6e6[_0x7517('0x31')]=_['keys'](db[_0x7517('0x87')][_0x7517('0x48')]);_0x10f6e6[_0x7517('0x32')]=_[_0x7517('0x47')](_0x3a3eaf[_0x7517('0x32')]);_0x10f6e6['filters']=_[_0x7517('0x34')](_0x10f6e6[_0x7517('0x31')],_0x10f6e6[_0x7517('0x32')]);_0x326d3d[_0x7517('0x35')]=_['intersection'](_0x10f6e6['model'],qs['fields'](_0x3a3eaf[_0x7517('0x32')][_0x7517('0x36')]));_0x326d3d[_0x7517('0x35')]=_0x326d3d[_0x7517('0x35')][_0x7517('0x49')]?_0x326d3d[_0x7517('0x35')]:_0x10f6e6[_0x7517('0x31')];_0x326d3d['order']=qs[_0x7517('0x39')](_0x3a3eaf['query'][_0x7517('0x39')]);_0x326d3d[_0x7517('0x3b')]=qs[_0x7517('0x33')](_[_0x7517('0x3a')](_0x3a3eaf[_0x7517('0x32')],_0x10f6e6[_0x7517('0x33')]));if(_0x3a3eaf['query']['filter']){_0x326d3d[_0x7517('0x3b')]=_[_0x7517('0x3e')](_0x326d3d[_0x7517('0x3b')],{'$or':_[_0x7517('0x2f')](_0x326d3d[_0x7517('0x35')],function(_0xac6f4e){var _0x2b6058={};_0x2b6058[_0xac6f4e]={'$like':'%'+_0x3a3eaf[_0x7517('0x32')][_0x7517('0x3d')]+'%'};return _0x2b6058;})});}_0x326d3d=_[_0x7517('0x3e')]({},_0x326d3d,_0x3a3eaf[_0x7517('0x4b')]);return _0x23fec9[_0x7517('0x8c')](_0x326d3d);}})[_0x7517('0x10')](function(_0x4f261f){if(_0x4f261f){_0x351a96=_0x4f261f[_0x7517('0x49')];if(!_0x3a3eaf[_0x7517('0x32')][_0x7517('0x57')]('nolimit')){_0x326d3d['limit']=qs['limit'](_0x3a3eaf[_0x7517('0x32')]['limit']);_0x326d3d[_0x7517('0x23')]=qs[_0x7517('0x23')](_0x3a3eaf[_0x7517('0x32')][_0x7517('0x23')]);}return _0x23fec9[_0x7517('0x8c')](_0x326d3d);}})[_0x7517('0x10')](function(_0x513a4b){if(_0x513a4b){return _0x513a4b?{'count':_0x351a96,'rows':_0x513a4b}:null;}})[_0x7517('0x10')](respondWithResult(_0x9f8c5a,null))[_0x7517('0x1b')](handleError(_0x9f8c5a,null));};exports['getMessages']=function(_0x47b4fc,_0x96227c){var _0x25fe54={'raw':!![],'where':{}};var _0x6149e7={};var _0x277df2={'count':0x0,'rows':[]};return db[_0x7517('0x3f')]['findOne']({'where':{'id':_0x47b4fc[_0x7517('0x51')]['id']}})[_0x7517('0x10')](handleEntityNotFound(_0x96227c,null))[_0x7517('0x10')](function(_0x9b8601){if(_0x9b8601){_0x6149e7[_0x7517('0x31')]=_[_0x7517('0x47')](db[_0x7517('0x8d')][_0x7517('0x48')]);_0x6149e7[_0x7517('0x32')]=_['keys'](_0x47b4fc[_0x7517('0x32')]);_0x6149e7[_0x7517('0x33')]=_[_0x7517('0x34')](_0x6149e7[_0x7517('0x31')],_0x6149e7['query']);_0x25fe54['attributes']=_['intersection'](_0x6149e7[_0x7517('0x31')],qs['fields'](_0x47b4fc[_0x7517('0x32')][_0x7517('0x36')]));_0x25fe54[_0x7517('0x35')]=_0x25fe54[_0x7517('0x35')][_0x7517('0x49')]?_0x25fe54[_0x7517('0x35')]:_0x6149e7['model'];if(!_0x47b4fc[_0x7517('0x32')][_0x7517('0x57')](_0x7517('0x37'))){_0x25fe54[_0x7517('0x21')]=qs[_0x7517('0x21')](_0x47b4fc['query'][_0x7517('0x21')]);_0x25fe54['offset']=qs['offset'](_0x47b4fc[_0x7517('0x32')][_0x7517('0x23')]);}_0x25fe54[_0x7517('0x38')]=qs[_0x7517('0x39')](_0x47b4fc[_0x7517('0x32')][_0x7517('0x39')]);_0x25fe54[_0x7517('0x3b')]=qs[_0x7517('0x33')](_[_0x7517('0x3a')](_0x47b4fc['query'],_0x6149e7[_0x7517('0x33')]));_0x25fe54[_0x7517('0x3b')][_0x7517('0x58')]=_0x9b8601['id'];if(_0x47b4fc[_0x7517('0x32')]['filter']){_0x25fe54[_0x7517('0x3b')]=_[_0x7517('0x3e')](_0x25fe54[_0x7517('0x3b')],{'$or':_[_0x7517('0x2f')](_0x25fe54['attributes'],function(_0xeafa7e){var _0x2878b8={};_0x2878b8[_0xeafa7e]={'$like':'%'+_0x47b4fc[_0x7517('0x32')][_0x7517('0x3d')]+'%'};return _0x2878b8;})});}if(_0x47b4fc[_0x7517('0x32')][_0x7517('0x8e')]){var _0x2e9b5e=_0x47b4fc[_0x7517('0x32')]['$gte']['split'](',');var _0x1095bf={};_0x1095bf[_0x2e9b5e[0x0]]={'$gte':moment(_0x2e9b5e[0x1])[_0x7517('0x8f')](_0x7517('0x90'))};_0x25fe54[_0x7517('0x3b')]=_['merge'](_0x25fe54[_0x7517('0x3b')],_0x1095bf);}_0x25fe54=_[_0x7517('0x3e')]({},_0x25fe54,_0x47b4fc[_0x7517('0x4b')]);return db[_0x7517('0x8d')]['count']({'where':_0x25fe54[_0x7517('0x3b')]})['then'](function(_0x181669){_0x277df2[_0x7517('0x22')]=_0x181669;if(_0x47b4fc['query'][_0x7517('0x40')]){_0x25fe54[_0x7517('0x4a')]=[{'all':!![]}];}return db['MailMessage'][_0x7517('0x41')](_0x25fe54);})['then'](function(_0x932449){if(_0x47b4fc[_0x7517('0x32')][_0x7517('0x91')]===_0x7517('0x92')){for(var _0x58784b=0x0;_0x58784b<_0x932449['length'];_0x58784b++){_0x932449[_0x58784b]['body']=juice(_0x932449[_0x58784b][_0x7517('0x4e')]);}}_0x277df2[_0x7517('0x42')]=_0x932449;return _0x277df2;});}})[_0x7517('0x10')](respondWithFilteredResult(_0x96227c,_0x25fe54))['catch'](handleError(_0x96227c,null));};exports[_0x7517('0x2a')]=function(_0x3b7d47,_0x2e2c1e){var _0xb7d1ee,_0x16ad26={},_0x214507;if(_0x3b7d47[_0x7517('0x4e')]['to']){_0x214507=_0x3b7d47[_0x7517('0x4e')]['to'][_0x7517('0x93')](',')[0x0];}return db[_0x7517('0x3f')][_0x7517('0x4c')]({'where':{'id':_0x3b7d47[_0x7517('0x51')]['id']},'include':[{'model':db[_0x7517('0x94')],'as':'List','include':[{'model':db['CmContact'],'as':_0x7517('0x95'),'where':{'email':_0x214507},'limit':0x1,'order':[[_0x7517('0x96'),_0x7517('0x97')]]}]},{'model':db[_0x7517('0x2c')],'as':_0x7517('0x2d'),'raw':!![]}]})[_0x7517('0x10')](handleEntityNotFound(_0x2e2c1e,null))[_0x7517('0x10')](function(_0x4b61de){if(_0x4b61de){_0xb7d1ee=_0x4b61de;if(_0x4b61de[_0x7517('0x2d')]){if(_[_0x7517('0x63')](_0x3b7d47['body'][_0x7517('0x98')])){_0x3b7d47[_0x7517('0x4e')][_0x7517('0x98')]=util[_0x7517('0x8f')]('%s\x20<%s>',_0x4b61de['name'],_0x4b61de[_0x7517('0x62')]||_0x4b61de[_0x7517('0x2d')][_0x7517('0x66')]);}if(_0x3b7d47[_0x7517('0x4e')][_0x7517('0x99')]&&_0x3b7d47[_0x7517('0x4e')][_0x7517('0x99')]['length']){for(var _0x4928b5=0x0;_0x4928b5<_0x3b7d47[_0x7517('0x4e')][_0x7517('0x99')][_0x7517('0x49')];_0x4928b5+=0x1){_0x3b7d47[_0x7517('0x4e')][_0x7517('0x99')][_0x4928b5]={'filename':_0x3b7d47[_0x7517('0x4e')][_0x7517('0x99')][_0x4928b5]['name'],'path':path[_0x7517('0x9a')](config[_0x7517('0x9b')],'server/files/attachments',_0x3b7d47[_0x7517('0x4e')][_0x7517('0x99')][_0x4928b5]['basename'])};}}var _0x1c41ff={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x4b61de[_0x7517('0x2d')][_0x7517('0x6a')])){if(_0x4b61de[_0x7517('0x2d')]['authentication']){_0x1c41ff[_0x7517('0x9c')]={'user':_0x4b61de[_0x7517('0x2d')][_0x7517('0x66')],'pass':_0x4b61de['Smtp']['pass']};}_0x1c41ff[_0x7517('0x6b')]=_0x4b61de[_0x7517('0x2d')][_0x7517('0x6b')];_0x1c41ff['port']=_0x4b61de[_0x7517('0x2d')][_0x7517('0x6c')];_0x1c41ff['secure']=_0x4b61de[_0x7517('0x2d')][_0x7517('0x9d')];}else{_0x1c41ff[_0x7517('0x6a')]=_0x4b61de[_0x7517('0x2d')][_0x7517('0x6a')];_0x1c41ff[_0x7517('0x9c')]={'user':_0x4b61de[_0x7517('0x2d')][_0x7517('0x66')],'pass':_0x4b61de[_0x7517('0x2d')]['pass']};}return respondWithRpcPromise(_0x7517('0x9e'),'sendMail',{'account':_0x1c41ff,'message':_0x3b7d47[_0x7517('0x4e')]});}else{throw new Error(_0x7517('0x9f'));}}})['then'](function(_0x1715bc){if(_0x1715bc){_0x16ad26=_0x1715bc;if(_0xb7d1ee[_0x7517('0xa0')]){if(_0xb7d1ee[_0x7517('0xa0')][_0x7517('0x95')][_0x7517('0x49')]){return _0xb7d1ee['List'][_0x7517('0x95')][0x0];}else{return db[_0x7517('0x7d')][_0x7517('0x55')](_[_0x7517('0x6')](_0x3b7d47[_0x7517('0x4e')],{'firstName':_0x3b7d47[_0x7517('0x4e')]['to'],'email':_0x3b7d47[_0x7517('0x4e')]['to'],'phone':_0x3b7d47[_0x7517('0x4e')]['to'],'ListId':_0xb7d1ee[_0x7517('0xa1')]}));}}else{throw new Error(_0x7517('0x9f'));}}})['then'](function(_0x3beca8){if(_0x3beca8){var _0x31f8be={'UserId':_0x3b7d47[_0x7517('0x66')]['id'],'ContactId':_0x3beca8['id'],'MailAccountId':_0xb7d1ee['id'],'inReplyTo':_0x16ad26['messageId'],'to':_0x3b7d47[_0x7517('0x4e')][_0x7517('0x98')],'cc':_0x3b7d47[_0x7517('0x4e')]['cc'],'subject':_0x3b7d47[_0x7517('0x4e')][_0x7517('0xa2')],'attach':_0x3b7d47[_0x7517('0x4e')][_0x7517('0xa3')],'firstMsgDirection':_0x7517('0xa4'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x7517('0xa4'),'Messages':[_['merge'](_0x3b7d47[_0x7517('0x4e')],{'messageId':_0x16ad26[_0x7517('0xa5')],'sentAt':moment()[_0x7517('0x8f')](_0x7517('0x90')),'read':!![],'MailAccountId':_0xb7d1ee['id'],'UserId':_0x3b7d47[_0x7517('0x66')]['id'],'ContactId':_0x3beca8['id']})]};if(_0x3b7d47[_0x7517('0x4e')]['Interaction']){_0x31f8be=_[_0x7517('0x3e')](_0x31f8be,_0x3b7d47[_0x7517('0x4e')]['Interaction']);}return db['MailInteraction'][_0x7517('0x55')](_0x31f8be,{'include':[{'model':db[_0x7517('0x8d')],'as':_0x7517('0xa6')}]});}})[_0x7517('0x10')](respondWithResult(_0x2e2c1e,null))[_0x7517('0x1b')](handleError(_0x2e2c1e,null));};exports[_0x7517('0xa7')]=function(_0x28a1b9,_0x547e63){return db[_0x7517('0x3f')][_0x7517('0x4c')]({'where':{'id':_0x28a1b9[_0x7517('0x51')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x7517('0x2d'),'raw':!![],'include':[{'model':db[_0x7517('0xa8')],'as':_0x7517('0xa8'),'raw':!![]}]}]})[_0x7517('0x10')](handleEntityNotFound(_0x547e63,null))['then'](function(_0x194321){if(!_0x194321['Smtp'])return;var _0x3f445d={'id':_0x194321['id'],'tls':{'rejectUnauthorized':![]}};if(_0x194321[_0x7517('0x60')]!==_0x7517('0x61')){_0x3f445d[_0x7517('0x6a')]=_0x194321['provider'];}else{_0x3f445d[_0x7517('0x6b')]=_0x194321['Smtp'][_0x7517('0x6b')];_0x3f445d['port']=_0x194321[_0x7517('0x2d')][_0x7517('0x6c')];_0x3f445d[_0x7517('0x9d')]=_0x194321[_0x7517('0x2d')][_0x7517('0x9d')];}if(_0x194321['Smtp'][_0x7517('0x6d')]){if(_0x194321[_0x7517('0x2d')][_0x7517('0x4f')]){_0x3f445d[_0x7517('0x9c')]={'type':'OAuth2','user':_0x194321[_0x7517('0x2d')][_0x7517('0x66')],'accessToken':_0x194321[_0x7517('0x2d')][_0x7517('0xa8')]['data5']};}else{_0x3f445d[_0x7517('0x9c')]={'user':_0x194321[_0x7517('0x2d')][_0x7517('0x66')],'pass':_0x194321[_0x7517('0x2d')][_0x7517('0x69')]};}}return respondWithRpcPromise(_0x7517('0xa9'),_0x7517('0xa7'),{'account':_0x3f445d});})[_0x7517('0x10')](respondWithResult(_0x547e63,null))['catch'](handleError(_0x547e63,null));};exports[_0x7517('0x25')]=function(_0x5e8d72,_0x5c5c1a){return db[_0x7517('0x3f')][_0x7517('0x4c')]({'where':{'id':_0x5e8d72[_0x7517('0x51')]['id']}})[_0x7517('0x10')](handleEntityNotFound(_0x5c5c1a,null))[_0x7517('0x10')](function(_0x4a19d2){if(_0x4a19d2&&_0x4a19d2['service']){throw new db['Sequelize'][(_0x7517('0xaa'))](_0x7517('0xab'));}return _0x4a19d2;})[_0x7517('0x10')](removeEntity(_0x5c5c1a,null))['catch'](handleError(_0x5c5c1a,null));};exports[_0x7517('0xac')]=function(_0x4a4a84,_0x4b3b8d){return db['MailAccount'][_0x7517('0x4c')]({'where':{'id':_0x4a4a84[_0x7517('0x51')]['id']}})[_0x7517('0x10')](handleEntityNotFound(_0x4b3b8d,null))[_0x7517('0x10')](function(_0x4f1135){if(_0x4f1135){return _0x4f1135[_0x7517('0xac')](_0x4a4a84[_0x7517('0x4e')][_0x7517('0x5a')],_[_0x7517('0x7a')](_0x4a4a84['body'],[_0x7517('0x5a'),'id'])||{})[_0x7517('0xad')](function(_0x46a93a){for(var _0x3ef757=0x0;_0x3ef757<_0x4a4a84[_0x7517('0x4e')][_0x7517('0x5a')][_0x7517('0x49')];_0x3ef757+=0x1){socket[_0x7517('0xae')]('userMailAccount:save',{'UserId':Number(_0x4a4a84['body'][_0x7517('0x5a')][_0x3ef757]),'MailAccountId':Number(_0x4a4a84[_0x7517('0x51')]['id'])});}return _0x46a93a;});}})['then'](respondWithResult(_0x4b3b8d,null))[_0x7517('0x1b')](handleError(_0x4b3b8d,null));};exports[_0x7517('0xaf')]=function(_0x4a5394,_0x4c7ff2){return db[_0x7517('0x3f')]['find']({'where':{'id':_0x4a5394[_0x7517('0x51')]['id']}})['then'](handleEntityNotFound(_0x4c7ff2,null))[_0x7517('0x10')](function(_0x2c87a7){if(_0x2c87a7){return _0x2c87a7['removeAgents'](_0x4a5394['query'][_0x7517('0x5a')])[_0x7517('0x10')](function(){if(_[_0x7517('0xb0')](_0x4a5394[_0x7517('0x32')][_0x7517('0x5a')])){for(var _0x54bfd1=0x0;_0x54bfd1<_0x4a5394[_0x7517('0x32')]['ids']['length'];_0x54bfd1+=0x1){socket[_0x7517('0xae')]('userMailAccount:remove',{'UserId':Number(_0x4a5394[_0x7517('0x32')]['ids'][_0x54bfd1]),'MailAccountId':Number(_0x4a5394[_0x7517('0x51')]['id'])});}}else{socket[_0x7517('0xae')]('userMailAccount:remove',{'UserId':Number(_0x4a5394[_0x7517('0x32')][_0x7517('0x5a')]),'MailAccountId':Number(_0x4a5394[_0x7517('0x51')]['id'])});}});}})['then'](respondWithStatusCode(_0x4c7ff2,null))[_0x7517('0x1b')](handleError(_0x4c7ff2,null));};exports[_0x7517('0xb1')]=function(_0x59750d,_0x439bb0){var _0x355ff3={};var _0x205267={};var _0x1ee192;var _0x52b959;return db[_0x7517('0x3f')][_0x7517('0x56')]({'where':{'id':_0x59750d[_0x7517('0x51')]['id']}})[_0x7517('0x10')](handleEntityNotFound(_0x439bb0,null))[_0x7517('0x10')](function(_0x182fc0){if(_0x182fc0){_0x1ee192=_0x182fc0;_0x205267[_0x7517('0x31')]=_[_0x7517('0x47')](db[_0x7517('0x7e')][_0x7517('0x48')]);_0x205267[_0x7517('0x32')]=_[_0x7517('0x47')](_0x59750d['query']);_0x205267['filters']=_['intersection'](_0x205267[_0x7517('0x31')],_0x205267[_0x7517('0x32')]);_0x355ff3[_0x7517('0x35')]=_[_0x7517('0x34')](_0x205267[_0x7517('0x31')],qs[_0x7517('0x36')](_0x59750d['query'][_0x7517('0x36')]));_0x355ff3[_0x7517('0x35')]=_0x355ff3['attributes']['length']?_0x355ff3[_0x7517('0x35')]:_0x205267['model'];_0x355ff3[_0x7517('0x38')]=qs[_0x7517('0x39')](_0x59750d['query'][_0x7517('0x39')]);_0x355ff3[_0x7517('0x3b')]=qs['filters'](_[_0x7517('0x3a')](_0x59750d['query'],_0x205267[_0x7517('0x33')]));if(_0x59750d[_0x7517('0x32')][_0x7517('0x3d')]){_0x355ff3['where']=_[_0x7517('0x3e')](_0x355ff3[_0x7517('0x3b')],{'$or':_[_0x7517('0x2f')](_0x355ff3[_0x7517('0x35')],function(_0x4deb09){var _0x48a2e4={};_0x48a2e4[_0x4deb09]={'$like':'%'+_0x59750d[_0x7517('0x32')]['filter']+'%'};return _0x48a2e4;})});}_0x355ff3=_['merge']({},_0x355ff3,_0x59750d[_0x7517('0x4b')]);return _0x1ee192[_0x7517('0xb1')](_0x355ff3);}})[_0x7517('0x10')](function(_0x288eab){if(_0x288eab){_0x52b959=_0x288eab[_0x7517('0x49')];if(!_0x59750d['query']['hasOwnProperty']('nolimit')){_0x355ff3['limit']=qs['limit'](_0x59750d[_0x7517('0x32')][_0x7517('0x21')]);_0x355ff3[_0x7517('0x23')]=qs[_0x7517('0x23')](_0x59750d['query'][_0x7517('0x23')]);}return _0x1ee192['getAgents'](_0x355ff3);}})[_0x7517('0x10')](function(_0x164166){if(_0x164166){return _0x164166?{'count':_0x52b959,'rows':_0x164166}:null;}})[_0x7517('0x10')](respondWithResult(_0x439bb0,null))[_0x7517('0x1b')](handleError(_0x439bb0,null));}; \ No newline at end of file +var _0x48e1=['rows','show','MailServerOut','update','body','modernAuthentication','CloudProviderId','find','describe','addDisposition','params','Disposition','create','findOne','nolimit','pick','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','hasOwnProperty','removeAnswers','provider','custom','email','ListId','active','description','user','username','password','pass','service','host','port','authentication','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','getInteractions','CmContact','Contact','User','Owner','internal','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','stack','finally','send','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','isNil','secure','auth','SendMail','sendMail','Contacts','List\x20not\x20found','subject','attach','out','messageId','Messages','verifySmtp','CloudProvider','OAuth2','data5','Sequelize','ValidationError','addAgents','omit','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailAccount,\x20%s,\x20%s','end','status','json','undefined','limit','count','offset','set','MailAccounts','UserProfileResource','destroy','sendStatus','name','index','MailServerIn','Imap','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','options','includeAll','include','findAll'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x48e1,0x75));var _0x148e=function(_0x71ace2,_0x5d003d){_0x71ace2=_0x71ace2-0x0;var _0x3bd375=_0x48e1[_0x71ace2];return _0x3bd375;};'use strict';var moment=require(_0x148e('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var _=require(_0x148e('0x1'));var juice=require(_0x148e('0x2'));var Redis=require(_0x148e('0x3'));var qs=require(_0x148e('0x4'));var logger=require(_0x148e('0x5'))('api');var config=require('../../config/environment');var db=require(_0x148e('0x6'))['db'];config['redis']=_[_0x148e('0x7')](config[_0x148e('0x8')],{'host':_0x148e('0x9'),'port':0x18eb});var socket=require(_0x148e('0xa'))(new Redis(config[_0x148e('0x8')]));require(_0x148e('0xb'))['register'](socket);var jayson=require(_0x148e('0xc'));var client=jayson[_0x148e('0xd')]['http']({'port':0x232b});function respondWithRpcPromise(_0x213b43,_0x398515,_0x36e5e3,_0x5253e9){return new BPromise(function(_0x480daf,_0x389536){var _0x2b06ca=_0x5253e9||client;return _0x2b06ca[_0x148e('0xe')](_0x213b43,_0x36e5e3)[_0x148e('0xf')](function(_0x6e45bf){logger[_0x148e('0x10')]('MailAccount,\x20%s,\x20%s',_0x398515,_0x148e('0x11'));logger[_0x148e('0x12')](_0x148e('0x13'),_0x398515,_0x148e('0x11'),JSON['stringify'](_0x6e45bf));if(_0x6e45bf[_0x148e('0x14')]){if(_0x6e45bf[_0x148e('0x14')][_0x148e('0x15')]===0x1f4){logger[_0x148e('0x14')]('MailAccount,\x20%s,\x20%s',_0x398515,_0x6e45bf[_0x148e('0x14')][_0x148e('0x16')]);return _0x389536(_0x6e45bf['error']['message']);}logger[_0x148e('0x14')]('MailAccount,\x20%s,\x20%s',_0x398515,_0x6e45bf['error']['message']);return _0x480daf(_0x6e45bf['error'][_0x148e('0x16')]);}else{logger[_0x148e('0x10')]('MailAccount,\x20%s,\x20%s',_0x398515,_0x148e('0x11'));_0x480daf(_0x6e45bf[_0x148e('0x17')][_0x148e('0x16')]);}})[_0x148e('0x18')](function(_0x2369e3){logger[_0x148e('0x14')](_0x148e('0x19'),_0x398515,_0x2369e3);_0x389536(_0x2369e3);});});}function respondWithStatusCode(_0x381c51,_0x292eef){_0x292eef=_0x292eef||0xcc;return function(_0x571ef5){if(_0x571ef5){return _0x381c51['sendStatus'](_0x292eef);}return _0x381c51['status'](_0x292eef)[_0x148e('0x1a')]();};}function respondWithResult(_0x5c2e46,_0x793470){_0x793470=_0x793470||0xc8;return function(_0x4e321c){if(_0x4e321c){return _0x5c2e46[_0x148e('0x1b')](_0x793470)[_0x148e('0x1c')](_0x4e321c);}};}function respondWithFilteredResult(_0x4ab584,_0x1c2ff5){return function(_0x2a135f){if(_0x2a135f){var _0x1fb3b8=typeof _0x1c2ff5['offset']===_0x148e('0x1d')&&typeof _0x1c2ff5[_0x148e('0x1e')]===_0x148e('0x1d');var _0xbaad31=_0x2a135f[_0x148e('0x1f')];var _0x15b221=_0x1fb3b8?0x0:_0x1c2ff5[_0x148e('0x20')];var _0x566004=_0x1fb3b8?_0x2a135f[_0x148e('0x1f')]:_0x1c2ff5[_0x148e('0x20')]+_0x1c2ff5[_0x148e('0x1e')];var _0x48e5b0;if(_0x566004>=_0xbaad31){_0x566004=_0xbaad31;_0x48e5b0=0xc8;}else{_0x48e5b0=0xce;}_0x4ab584[_0x148e('0x1b')](_0x48e5b0);return _0x4ab584[_0x148e('0x21')]('Content-Range',_0x15b221+'-'+_0x566004+'/'+_0xbaad31)[_0x148e('0x1c')](_0x2a135f);}return null;};}function saveUpdates(_0x32132d){return function(_0x313223){if(_0x313223){return _0x313223['update'](_0x32132d)[_0x148e('0xf')](function(_0x422673){return _0x422673;});}return null;};}function removeEntity(_0x2208f1){return function(_0x360d4e){if(_0x360d4e){return _0x360d4e['destroy']()[_0x148e('0xf')](function(){var _0x29193e=_0x360d4e['get']({'plain':!![]});var _0x1927ad=_0x148e('0x22');return db[_0x148e('0x23')][_0x148e('0x24')]({'where':{'type':_0x1927ad,'resourceId':_0x29193e['id']}})[_0x148e('0xf')](function(){return _0x360d4e;});})[_0x148e('0xf')](function(){_0x2208f1[_0x148e('0x1b')](0xcc)[_0x148e('0x1a')]();});}};}function handleEntityNotFound(_0x49687d){return function(_0x2d3975){if(!_0x2d3975){_0x49687d[_0x148e('0x25')](0x194);}return _0x2d3975;};}function handleError(_0x423cde,_0xa80d29){_0xa80d29=_0xa80d29||0x1f4;return function(_0x3935a0){logger['error'](_0x3935a0['stack']);if(_0x3935a0[_0x148e('0x26')]){delete _0x3935a0[_0x148e('0x26')];}_0x423cde['status'](_0xa80d29)['send'](_0x3935a0);};}exports[_0x148e('0x27')]=function(_0x1e66d6,_0x443355){var _0x27fb4f={'include':[{'model':db[_0x148e('0x28')],'as':_0x148e('0x29')},{'model':db['MailServerOut'],'as':_0x148e('0x2a')},{'model':db[_0x148e('0x2b')],'as':_0x148e('0x2c')}]},_0x28a7f0={},_0x40cc19={'count':0x0,'rows':[]};var _0x2a9d95=_[_0x148e('0x2d')](db[_0x148e('0x2e')][_0x148e('0x2f')],function(_0x38ed94){return{'name':_0x38ed94[_0x148e('0x30')],'type':_0x38ed94['type'][_0x148e('0x31')]};});_0x28a7f0[_0x148e('0x32')]=_[_0x148e('0x2d')](_0x2a9d95,_0x148e('0x26'));_0x28a7f0[_0x148e('0x33')]=_[_0x148e('0x34')](_0x1e66d6['query']);_0x28a7f0[_0x148e('0x35')]=_[_0x148e('0x36')](_0x28a7f0[_0x148e('0x32')],_0x28a7f0['query']);_0x27fb4f['attributes']=_[_0x148e('0x36')](_0x28a7f0[_0x148e('0x32')],qs[_0x148e('0x37')](_0x1e66d6['query'][_0x148e('0x37')]));_0x27fb4f[_0x148e('0x38')]=_0x27fb4f[_0x148e('0x38')][_0x148e('0x39')]?_0x27fb4f[_0x148e('0x38')]:_0x28a7f0['model'];if(!_0x1e66d6[_0x148e('0x33')]['hasOwnProperty']('nolimit')){_0x27fb4f[_0x148e('0x1e')]=qs[_0x148e('0x1e')](_0x1e66d6[_0x148e('0x33')][_0x148e('0x1e')]);_0x27fb4f[_0x148e('0x20')]=qs[_0x148e('0x20')](_0x1e66d6['query'][_0x148e('0x20')]);}_0x27fb4f[_0x148e('0x3a')]=qs[_0x148e('0x3b')](_0x1e66d6[_0x148e('0x33')][_0x148e('0x3b')]);_0x27fb4f[_0x148e('0x3c')]=qs[_0x148e('0x35')](_['pick'](_0x1e66d6[_0x148e('0x33')],_0x28a7f0['filters']),_0x2a9d95);if(_0x1e66d6[_0x148e('0x33')][_0x148e('0x3d')]){_0x27fb4f['where']=_[_0x148e('0x3e')](_0x27fb4f[_0x148e('0x3c')],{'$or':_[_0x148e('0x2d')](_0x2a9d95,function(_0x309746){if(_0x309746['type']!=='VIRTUAL'){var _0x2b4ccd={};_0x2b4ccd[_0x309746[_0x148e('0x26')]]={'$like':'%'+_0x1e66d6[_0x148e('0x33')][_0x148e('0x3d')]+'%'};return _0x2b4ccd;}})});}_0x27fb4f=_[_0x148e('0x3e')]({},_0x27fb4f,_0x1e66d6[_0x148e('0x3f')]);var _0x424f59={'where':_0x27fb4f[_0x148e('0x3c')]};return db[_0x148e('0x2e')][_0x148e('0x1f')](_0x424f59)['then'](function(_0x2ac4e4){_0x40cc19[_0x148e('0x1f')]=_0x2ac4e4;if(_0x1e66d6[_0x148e('0x33')][_0x148e('0x40')]){_0x27fb4f[_0x148e('0x41')]=[{'all':!![]}];}return db['MailAccount'][_0x148e('0x42')](_0x27fb4f);})['then'](function(_0x4bdc6e){_0x40cc19[_0x148e('0x43')]=_0x4bdc6e;return _0x40cc19;})['then'](respondWithFilteredResult(_0x443355,_0x27fb4f))[_0x148e('0x18')](handleError(_0x443355,null));};exports[_0x148e('0x44')]=function(_0x3dd316,_0x16bd42){var _0x1b0ff3={'raw':![],'where':{'id':_0x3dd316['params']['id']},'include':[{'model':db[_0x148e('0x28')],'as':_0x148e('0x29')},{'model':db[_0x148e('0x45')],'as':_0x148e('0x2a')},{'model':db[_0x148e('0x2b')],'as':'mandatoryDispositionPause'}]},_0x36d60c={};_0x36d60c[_0x148e('0x32')]=_[_0x148e('0x34')](db[_0x148e('0x2e')][_0x148e('0x2f')]);_0x36d60c[_0x148e('0x33')]=_[_0x148e('0x34')](_0x3dd316[_0x148e('0x33')]);_0x36d60c['filters']=_[_0x148e('0x36')](_0x36d60c[_0x148e('0x32')],_0x36d60c['query']);_0x1b0ff3[_0x148e('0x38')]=_['intersection'](_0x36d60c[_0x148e('0x32')],qs['fields'](_0x3dd316[_0x148e('0x33')][_0x148e('0x37')]));_0x1b0ff3[_0x148e('0x38')]=_0x1b0ff3[_0x148e('0x38')][_0x148e('0x39')]?_0x1b0ff3['attributes']:_0x36d60c['model'];if(_0x3dd316['query'][_0x148e('0x40')]){_0x1b0ff3[_0x148e('0x41')]=[{'all':!![]}];}_0x1b0ff3=_[_0x148e('0x3e')]({},_0x1b0ff3,_0x3dd316[_0x148e('0x3f')]);return db['MailAccount']['find'](_0x1b0ff3)[_0x148e('0xf')](handleEntityNotFound(_0x16bd42,null))[_0x148e('0xf')](respondWithResult(_0x16bd42,null))[_0x148e('0x18')](handleError(_0x16bd42,null));};exports[_0x148e('0x46')]=function(_0x42ca08,_0x43458b){if(_0x42ca08[_0x148e('0x47')]['id']){delete _0x42ca08['body']['id'];}if(_0x42ca08['body'][_0x148e('0x29')]){if(!_0x42ca08[_0x148e('0x47')][_0x148e('0x29')][_0x148e('0x48')]){_0x42ca08[_0x148e('0x47')]['Imap'][_0x148e('0x49')]=null;}}if(_0x42ca08[_0x148e('0x47')][_0x148e('0x2a')]){if(!_0x42ca08[_0x148e('0x47')]['Smtp'][_0x148e('0x48')]){_0x42ca08[_0x148e('0x47')]['Smtp'][_0x148e('0x49')]=null;}}return db[_0x148e('0x2e')][_0x148e('0x4a')]({'where':{'id':_0x42ca08['params']['id']},'include':[{'model':db[_0x148e('0x28')],'as':'Imap'},{'model':db[_0x148e('0x45')],'as':_0x148e('0x2a')},{'model':db[_0x148e('0x2b')],'as':_0x148e('0x2c')}]})['then'](handleEntityNotFound(_0x43458b,null))[_0x148e('0xf')](saveUpdates(_0x42ca08['body'],null))['then'](function(_0x15d5e3){if(_0x15d5e3&&_0x42ca08[_0x148e('0x47')][_0x148e('0x29')]){return db[_0x148e('0x28')][_0x148e('0x46')](_0x42ca08[_0x148e('0x47')][_0x148e('0x29')],{'where':{'MailAccountId':_0x15d5e3['id']}})[_0x148e('0xf')](function(){return _0x15d5e3;});}return _0x15d5e3;})['then'](function(_0x34ea63){if(_0x34ea63&&_0x42ca08[_0x148e('0x47')][_0x148e('0x2a')]){return db[_0x148e('0x45')][_0x148e('0x46')](_0x42ca08['body'][_0x148e('0x2a')],{'where':{'MailAccountId':_0x34ea63['id']}})[_0x148e('0xf')](function(){return _0x34ea63;});}return _0x34ea63;})[_0x148e('0xf')](respondWithResult(_0x43458b,null))[_0x148e('0x18')](handleError(_0x43458b,null));};exports[_0x148e('0x4b')]=function(_0x189064,_0x49cd13){return db[_0x148e('0x2e')][_0x148e('0x4b')]()[_0x148e('0xf')](respondWithResult(_0x49cd13,null))['catch'](handleError(_0x49cd13,null));};exports[_0x148e('0x4c')]=function(_0x56577d,_0x49913e){if(_0x56577d[_0x148e('0x47')]['id']){delete _0x56577d[_0x148e('0x47')]['id'];}return db[_0x148e('0x2e')][_0x148e('0x4a')]({'where':{'id':_0x56577d[_0x148e('0x4d')]['id']}})[_0x148e('0xf')](handleEntityNotFound(_0x49913e,null))[_0x148e('0xf')](function(_0x3d1a89){if(_0x3d1a89){_0x56577d[_0x148e('0x47')]['MailAccountId']=_0x3d1a89['id'];return db[_0x148e('0x4e')][_0x148e('0x4f')](_0x56577d[_0x148e('0x47')]);}})[_0x148e('0xf')](respondWithResult(_0x49913e,null))[_0x148e('0x18')](handleError(_0x49913e,null));};exports['getDispositions']=function(_0xc176e8,_0x3d4446){var _0x4e88af={'raw':![],'where':{}};var _0x12e4d4={};var _0x4e3dc9={'count':0x0,'rows':[]};return db[_0x148e('0x2e')][_0x148e('0x50')]({'where':{'id':_0xc176e8[_0x148e('0x4d')]['id']}})[_0x148e('0xf')](handleEntityNotFound(_0x3d4446,null))[_0x148e('0xf')](function(_0x457ea9){if(_0x457ea9){_0x12e4d4[_0x148e('0x32')]=_[_0x148e('0x34')](db[_0x148e('0x4e')][_0x148e('0x2f')]);_0x12e4d4['query']=_['keys'](_0xc176e8['query']);_0x12e4d4[_0x148e('0x35')]=_[_0x148e('0x36')](_0x12e4d4[_0x148e('0x32')],_0x12e4d4[_0x148e('0x33')]);_0x4e88af[_0x148e('0x38')]=_[_0x148e('0x36')](_0x12e4d4['model'],qs[_0x148e('0x37')](_0xc176e8[_0x148e('0x33')]['fields']));_0x4e88af[_0x148e('0x38')]=_0x4e88af['attributes'][_0x148e('0x39')]?_0x4e88af[_0x148e('0x38')]:_0x12e4d4[_0x148e('0x32')];if(!_0xc176e8['query']['hasOwnProperty'](_0x148e('0x51'))){_0x4e88af[_0x148e('0x1e')]=qs[_0x148e('0x1e')](_0xc176e8[_0x148e('0x33')]['limit']);_0x4e88af[_0x148e('0x20')]=qs[_0x148e('0x20')](_0xc176e8[_0x148e('0x33')][_0x148e('0x20')]);}_0x4e88af[_0x148e('0x3a')]=qs[_0x148e('0x3b')](_0xc176e8[_0x148e('0x33')]['sort']);_0x4e88af[_0x148e('0x3c')]=qs[_0x148e('0x35')](_[_0x148e('0x52')](_0xc176e8[_0x148e('0x33')],_0x12e4d4[_0x148e('0x35')]));_0x4e88af[_0x148e('0x3c')][_0x148e('0x53')]=_0x457ea9['id'];if(_0xc176e8[_0x148e('0x33')][_0x148e('0x3d')]){_0x4e88af[_0x148e('0x3c')]=_[_0x148e('0x3e')](_0x4e88af[_0x148e('0x3c')],{'$or':_[_0x148e('0x2d')](_0x4e88af[_0x148e('0x38')],function(_0x1d3a70){var _0x4a873b={};_0x4a873b[_0x1d3a70]={'$like':'%'+_0xc176e8[_0x148e('0x33')][_0x148e('0x3d')]+'%'};return _0x4a873b;})});}_0x4e88af=_[_0x148e('0x3e')]({},_0x4e88af,_0xc176e8[_0x148e('0x3f')]);return db['Disposition'][_0x148e('0x1f')]({'where':_0x4e88af[_0x148e('0x3c')]})[_0x148e('0xf')](function(_0x2e70b7){_0x4e3dc9[_0x148e('0x1f')]=_0x2e70b7;if(_0xc176e8['query']['includeAll']){_0x4e88af['include']=[{'all':!![]}];}return db[_0x148e('0x4e')][_0x148e('0x42')](_0x4e88af);})['then'](function(_0x29ec1e){_0x4e3dc9[_0x148e('0x43')]=_0x29ec1e;return _0x4e3dc9;});}})[_0x148e('0xf')](respondWithFilteredResult(_0x3d4446,_0x4e88af))['catch'](handleError(_0x3d4446,null));};exports[_0x148e('0x54')]=function(_0x2ada2b,_0x2c78a7){return db[_0x148e('0x2e')]['find']({'where':{'id':_0x2ada2b['params']['id']}})[_0x148e('0xf')](handleEntityNotFound(_0x2c78a7,null))[_0x148e('0xf')](function(_0x4bc7bd){if(_0x4bc7bd){return _0x4bc7bd[_0x148e('0x54')](_0x2ada2b[_0x148e('0x33')][_0x148e('0x55')]);}})[_0x148e('0xf')](respondWithStatusCode(_0x2c78a7,null))[_0x148e('0x18')](handleError(_0x2c78a7,null));};exports[_0x148e('0x56')]=function(_0x2660d2,_0x1b6306){if(_0x2660d2[_0x148e('0x47')]['id']){delete _0x2660d2['body']['id'];}return db[_0x148e('0x2e')][_0x148e('0x4a')]({'where':{'id':_0x2660d2[_0x148e('0x4d')]['id']}})[_0x148e('0xf')](handleEntityNotFound(_0x1b6306,null))[_0x148e('0xf')](function(_0x2f0997){if(_0x2f0997){_0x2660d2[_0x148e('0x47')]['MailAccountId']=_0x2f0997['id'];return db[_0x148e('0x57')][_0x148e('0x4f')](_0x2660d2[_0x148e('0x47')]);}})[_0x148e('0xf')](respondWithResult(_0x1b6306,null))['catch'](handleError(_0x1b6306,null));};exports['getAnswers']=function(_0x50a0f7,_0x367766){var _0xd55f9c={'raw':![],'where':{}};var _0xabdd51={};var _0x46a7e8={'count':0x0,'rows':[]};return db['MailAccount'][_0x148e('0x50')]({'where':{'id':_0x50a0f7['params']['id']}})[_0x148e('0xf')](handleEntityNotFound(_0x367766,null))[_0x148e('0xf')](function(_0x4c1125){if(_0x4c1125){_0xabdd51['model']=_[_0x148e('0x34')](db[_0x148e('0x57')]['rawAttributes']);_0xabdd51[_0x148e('0x33')]=_[_0x148e('0x34')](_0x50a0f7[_0x148e('0x33')]);_0xabdd51[_0x148e('0x35')]=_['intersection'](_0xabdd51[_0x148e('0x32')],_0xabdd51['query']);_0xd55f9c[_0x148e('0x38')]=_[_0x148e('0x36')](_0xabdd51[_0x148e('0x32')],qs[_0x148e('0x37')](_0x50a0f7[_0x148e('0x33')][_0x148e('0x37')]));_0xd55f9c[_0x148e('0x38')]=_0xd55f9c[_0x148e('0x38')][_0x148e('0x39')]?_0xd55f9c[_0x148e('0x38')]:_0xabdd51['model'];if(!_0x50a0f7[_0x148e('0x33')][_0x148e('0x58')](_0x148e('0x51'))){_0xd55f9c[_0x148e('0x1e')]=qs['limit'](_0x50a0f7[_0x148e('0x33')][_0x148e('0x1e')]);_0xd55f9c['offset']=qs[_0x148e('0x20')](_0x50a0f7['query'][_0x148e('0x20')]);}_0xd55f9c[_0x148e('0x3a')]=qs['sort'](_0x50a0f7[_0x148e('0x33')][_0x148e('0x3b')]);_0xd55f9c['where']=qs[_0x148e('0x35')](_[_0x148e('0x52')](_0x50a0f7[_0x148e('0x33')],_0xabdd51[_0x148e('0x35')]));_0xd55f9c[_0x148e('0x3c')][_0x148e('0x53')]=_0x4c1125['id'];if(_0x50a0f7[_0x148e('0x33')][_0x148e('0x3d')]){_0xd55f9c[_0x148e('0x3c')]=_[_0x148e('0x3e')](_0xd55f9c[_0x148e('0x3c')],{'$or':_['map'](_0xd55f9c[_0x148e('0x38')],function(_0x5e0ed2){var _0x5e0e76={};_0x5e0e76[_0x5e0ed2]={'$like':'%'+_0x50a0f7[_0x148e('0x33')][_0x148e('0x3d')]+'%'};return _0x5e0e76;})});}_0xd55f9c=_[_0x148e('0x3e')]({},_0xd55f9c,_0x50a0f7[_0x148e('0x3f')]);return db[_0x148e('0x57')]['count']({'where':_0xd55f9c[_0x148e('0x3c')]})[_0x148e('0xf')](function(_0x12785c){_0x46a7e8[_0x148e('0x1f')]=_0x12785c;if(_0x50a0f7['query'][_0x148e('0x40')]){_0xd55f9c[_0x148e('0x41')]=[{'all':!![]}];}return db['CannedAnswer'][_0x148e('0x42')](_0xd55f9c);})[_0x148e('0xf')](function(_0x4184d8){_0x46a7e8[_0x148e('0x43')]=_0x4184d8;return _0x46a7e8;});}})['then'](respondWithFilteredResult(_0x367766,_0xd55f9c))[_0x148e('0x18')](handleError(_0x367766,null));};exports[_0x148e('0x59')]=function(_0x2e8599,_0x4f77e3){return db[_0x148e('0x2e')][_0x148e('0x4a')]({'where':{'id':_0x2e8599['params']['id']}})[_0x148e('0xf')](handleEntityNotFound(_0x4f77e3,null))[_0x148e('0xf')](function(_0x1397de){if(_0x1397de){return _0x1397de[_0x148e('0x59')](_0x2e8599[_0x148e('0x33')][_0x148e('0x55')]);}})[_0x148e('0xf')](respondWithStatusCode(_0x4f77e3,null))[_0x148e('0x18')](handleError(_0x4f77e3,null));};exports['create']=function(_0x443547,_0x159108){var _0x2279d6={'name':_0x443547['body'][_0x148e('0x26')],'key':_0x443547['body'][_0x148e('0x31')],'provider':_0x443547[_0x148e('0x47')][_0x148e('0x5a')]===_0x148e('0x5b')?null:_0x443547['body'][_0x148e('0x5a')],'email':_0x443547[_0x148e('0x47')][_0x148e('0x5c')],'ListId':_0x443547['body'][_0x148e('0x5d')],'active':!_['isNil'](_0x443547[_0x148e('0x47')][_0x148e('0x5e')])?_0x443547['body']['active']:!![],'description':_0x443547['body'][_0x148e('0x5f')]||null,'Imap':{},'Smtp':{}};if(_0x2279d6[_0x148e('0x5a')]){_0x2279d6[_0x148e('0x29')][_0x148e('0x60')]=_0x2279d6[_0x148e('0x2a')]['user']=_0x443547[_0x148e('0x47')][_0x148e('0x61')];_0x2279d6['Imap'][_0x148e('0x62')]=_0x2279d6[_0x148e('0x2a')][_0x148e('0x63')]=_0x443547[_0x148e('0x47')][_0x148e('0x62')];if(_0x443547[_0x148e('0x47')][_0x148e('0x48')]){_0x2279d6[_0x148e('0x29')][_0x148e('0x48')]=_0x2279d6[_0x148e('0x2a')][_0x148e('0x48')]=!![];_0x2279d6[_0x148e('0x29')][_0x148e('0x49')]=_0x2279d6['Smtp'][_0x148e('0x49')]=_0x443547[_0x148e('0x47')]['CloudProviderId'];_0x2279d6[_0x148e('0x29')][_0x148e('0x62')]=_0x2279d6['Smtp'][_0x148e('0x63')]=null;}else{_0x2279d6[_0x148e('0x29')][_0x148e('0x49')]=_0x2279d6['Smtp']['CloudProviderId']=null;}_0x2279d6[_0x148e('0x29')]['service']=_0x2279d6['Smtp'][_0x148e('0x64')]=null;_0x2279d6[_0x148e('0x29')][_0x148e('0x65')]=_0x2279d6['Smtp']['host']=null;_0x2279d6[_0x148e('0x29')][_0x148e('0x66')]=_0x2279d6['Smtp']['port']=null;}else{if(_0x443547[_0x148e('0x47')][_0x148e('0x67')]){_0x2279d6[_0x148e('0x29')][_0x148e('0x60')]=_0x2279d6[_0x148e('0x2a')]['user']=_0x443547[_0x148e('0x47')]['username'];_0x2279d6[_0x148e('0x29')][_0x148e('0x62')]=_0x2279d6['Smtp'][_0x148e('0x63')]=_0x443547['body'][_0x148e('0x62')];}else{_0x2279d6['Imap']['authentication']=_0x2279d6[_0x148e('0x2a')][_0x148e('0x67')]=![];_0x2279d6[_0x148e('0x29')][_0x148e('0x60')]=_0x2279d6['Smtp'][_0x148e('0x60')]=null;_0x2279d6[_0x148e('0x29')]['password']=_0x2279d6[_0x148e('0x2a')][_0x148e('0x63')]=null;}_0x2279d6[_0x148e('0x29')]['host']=_0x443547['body'][_0x148e('0x29')][_0x148e('0x65')];_0x2279d6[_0x148e('0x29')][_0x148e('0x66')]=_0x443547[_0x148e('0x47')][_0x148e('0x29')][_0x148e('0x66')];_0x2279d6['Smtp'][_0x148e('0x65')]=_0x443547['body']['Smtp'][_0x148e('0x65')];_0x2279d6[_0x148e('0x2a')]['port']=_0x443547[_0x148e('0x47')]['Smtp'][_0x148e('0x66')];}return db[_0x148e('0x2e')][_0x148e('0x4f')](_0x2279d6,{'include':[{'model':db[_0x148e('0x45')],'as':_0x148e('0x2a')},{'model':db[_0x148e('0x28')],'as':_0x148e('0x29')}]})[_0x148e('0xf')](function(_0x260e9f){var _0x31f16b=_0x443547[_0x148e('0x60')]['get']({'plain':!![]});if(!_0x31f16b)throw new Error(_0x148e('0x68'));if(_0x31f16b[_0x148e('0x69')]===_0x148e('0x60')){var _0xecfec5=_0x260e9f[_0x148e('0x6a')]({'plain':!![]});return db['UserProfileSection'][_0x148e('0x4a')]({'where':{'name':_0x148e('0x22'),'userProfileId':_0x31f16b[_0x148e('0x6b')]},'raw':!![]})[_0x148e('0xf')](function(_0x366e22){if(_0x366e22&&_0x366e22[_0x148e('0x6c')]===0x0){return db[_0x148e('0x23')][_0x148e('0x4f')]({'name':_0xecfec5['name'],'resourceId':_0xecfec5['id'],'type':_0x366e22['name'],'sectionId':_0x366e22['id']},{})[_0x148e('0xf')](function(){return _0x260e9f;});}else{return _0x260e9f;}})[_0x148e('0x18')](function(_0x391f0d){logger[_0x148e('0x14')](_0x148e('0x6d'),_0x391f0d);throw _0x391f0d;});}return _0x260e9f;})[_0x148e('0xf')](respondWithResult(_0x159108,0xc9))[_0x148e('0x18')](handleError(_0x159108,null));};exports['getImap']=function(_0x29c711,_0x12faee){return db[_0x148e('0x2e')][_0x148e('0x50')]({'where':{'id':_0x29c711[_0x148e('0x4d')]['id']}})[_0x148e('0xf')](handleEntityNotFound(_0x12faee,null))[_0x148e('0xf')](function(_0x41084e){if(_0x41084e){return _0x41084e[_0x148e('0x6e')]();}return null;})[_0x148e('0xf')](respondWithResult(_0x12faee,null))[_0x148e('0x18')](handleError(_0x12faee,null));};exports[_0x148e('0x6f')]=function(_0x73e7cc,_0x2cf176){if(_0x73e7cc[_0x148e('0x47')]['id']){delete _0x73e7cc['body']['id'];}return db[_0x148e('0x2e')][_0x148e('0x4a')]({'where':{'id':_0x73e7cc[_0x148e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2cf176,null))[_0x148e('0xf')](function(_0x17d5ba){if(_0x17d5ba){_0x73e7cc[_0x148e('0x47')][_0x148e('0x53')]=_0x17d5ba['id'];return db[_0x148e('0x28')][_0x148e('0x4f')](_0x73e7cc[_0x148e('0x47')]);}})[_0x148e('0xf')](respondWithResult(_0x2cf176,null))[_0x148e('0x18')](handleError(_0x2cf176,null));};exports[_0x148e('0x70')]=function(_0x10d078,_0x1acf94){return db['MailAccount'][_0x148e('0x50')]({'where':{'id':_0x10d078[_0x148e('0x4d')]['id']}})[_0x148e('0xf')](handleEntityNotFound(_0x1acf94,null))[_0x148e('0xf')](function(_0x4f27ad){if(_0x4f27ad){return _0x4f27ad[_0x148e('0x71')](null);}return null;})[_0x148e('0xf')](respondWithStatusCode(_0x1acf94,null))[_0x148e('0x18')](handleError(_0x1acf94,null));};exports[_0x148e('0x72')]=function(_0x13e784,_0x45cdc8){return db['MailAccount'][_0x148e('0x50')]({'where':{'id':_0x13e784[_0x148e('0x4d')]['id']}})[_0x148e('0xf')](handleEntityNotFound(_0x45cdc8,null))['then'](function(_0x3f4156){if(_0x3f4156){return _0x3f4156[_0x148e('0x72')]();}return null;})['then'](respondWithResult(_0x45cdc8,null))['catch'](handleError(_0x45cdc8,null));};exports[_0x148e('0x73')]=function(_0x2ec7e5,_0xc7f7d4){if(_0x2ec7e5[_0x148e('0x47')]['id']){delete _0x2ec7e5[_0x148e('0x47')]['id'];}return db[_0x148e('0x2e')][_0x148e('0x4a')]({'where':{'id':_0x2ec7e5['params']['id']}})[_0x148e('0xf')](handleEntityNotFound(_0xc7f7d4,null))['then'](function(_0x4f2fa2){if(_0x4f2fa2){_0x2ec7e5[_0x148e('0x47')]['MailAccountId']=_0x4f2fa2['id'];return db[_0x148e('0x45')][_0x148e('0x4f')](_0x2ec7e5[_0x148e('0x47')]);}})['then'](respondWithResult(_0xc7f7d4,null))[_0x148e('0x18')](handleError(_0xc7f7d4,null));};exports[_0x148e('0x74')]=function(_0x11ae95,_0x5799e2){return db[_0x148e('0x2e')]['findOne']({'where':{'id':_0x11ae95['params']['id']}})[_0x148e('0xf')](handleEntityNotFound(_0x5799e2,null))[_0x148e('0xf')](function(_0x1d4faf){if(_0x1d4faf){return _0x1d4faf[_0x148e('0x75')](null);}return null;})[_0x148e('0xf')](respondWithStatusCode(_0x5799e2,null))['catch'](handleError(_0x5799e2,null));};exports['addInteraction']=function(_0x390419,_0x373b6e){return db[_0x148e('0x76')][_0x148e('0x4a')]({'where':{'id':_0x390419[_0x148e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x373b6e,null))['then'](function(_0x2b7da6){if(_0x2b7da6){return _0x2b7da6[_0x148e('0x77')](_0x390419[_0x148e('0x47')][_0x148e('0x55')],_['omit'](_0x390419[_0x148e('0x47')],[_0x148e('0x55'),'id'])||{});}})[_0x148e('0xf')](respondWithResult(_0x373b6e,null))[_0x148e('0x18')](handleError(_0x373b6e,null));};exports[_0x148e('0x78')]=function(_0x4aab75,_0x5c5d39){var _0x3c9016={'raw':![],'where':{}};var _0x59f109={};var _0x193c66={'count':0x0,'rows':[]};return db[_0x148e('0x2e')][_0x148e('0x50')]({'where':{'id':_0x4aab75[_0x148e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5c5d39,null))[_0x148e('0xf')](function(_0x5a9253){if(_0x5a9253){_0x59f109[_0x148e('0x32')]=_['keys'](db[_0x148e('0x76')][_0x148e('0x2f')]);_0x59f109[_0x148e('0x33')]=_['keys'](_0x4aab75[_0x148e('0x33')]);_0x59f109[_0x148e('0x35')]=_['intersection'](_0x59f109[_0x148e('0x32')],_0x59f109[_0x148e('0x33')]);_0x3c9016[_0x148e('0x38')]=_[_0x148e('0x36')](_0x59f109['model'],qs[_0x148e('0x37')](_0x4aab75['query'][_0x148e('0x37')]));_0x3c9016[_0x148e('0x38')]=_0x3c9016['attributes'][_0x148e('0x39')]?_0x3c9016[_0x148e('0x38')]:_0x59f109[_0x148e('0x32')];if(!_0x4aab75['query'][_0x148e('0x58')](_0x148e('0x51'))){_0x3c9016['limit']=qs[_0x148e('0x1e')](_0x4aab75[_0x148e('0x33')][_0x148e('0x1e')]);_0x3c9016[_0x148e('0x20')]=qs[_0x148e('0x20')](_0x4aab75[_0x148e('0x33')][_0x148e('0x20')]);}_0x3c9016[_0x148e('0x3a')]=qs['sort'](_0x4aab75[_0x148e('0x33')][_0x148e('0x3b')]);_0x3c9016[_0x148e('0x3c')]=qs[_0x148e('0x35')](_['pick'](_0x4aab75[_0x148e('0x33')],_0x59f109['filters']));_0x3c9016[_0x148e('0x3c')][_0x148e('0x53')]=_0x5a9253['id'];if(_0x4aab75['query'][_0x148e('0x3d')]){_0x3c9016[_0x148e('0x3c')]=_[_0x148e('0x3e')](_0x3c9016['where'],{'$or':_[_0x148e('0x2d')](_0x3c9016[_0x148e('0x38')],function(_0x37cb46){var _0x1cfdf0={};_0x1cfdf0[_0x37cb46]={'$like':'%'+_0x4aab75['query']['filter']+'%'};return _0x1cfdf0;})});}_0x3c9016=_[_0x148e('0x3e')]({},_0x3c9016,_0x4aab75[_0x148e('0x3f')]);return db[_0x148e('0x76')][_0x148e('0x1f')]({'where':_0x3c9016[_0x148e('0x3c')]})[_0x148e('0xf')](function(_0x69ac0e){_0x193c66[_0x148e('0x1f')]=_0x69ac0e;if(_0x4aab75['query'][_0x148e('0x40')]){_0x3c9016[_0x148e('0x41')]=[{'model':db[_0x148e('0x79')],'as':_0x148e('0x7a'),'required':![]},{'model':db[_0x148e('0x7b')],'as':_0x148e('0x7c'),'attributes':[_0x148e('0x26'),'fullname',_0x148e('0x7d')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x148e('0x26'),_0x148e('0x7e')],'where':_0x4aab75['query']['tag']?{'id':_0x4aab75['query'][_0x148e('0x7f')]}:undefined,'required':_0x4aab75[_0x148e('0x33')][_0x148e('0x7f')]?!![]:![]}];}return db[_0x148e('0x76')][_0x148e('0x42')](_0x3c9016);})[_0x148e('0xf')](function(_0x216acc){_0x193c66[_0x148e('0x43')]=_0x216acc;return _0x193c66;});}})[_0x148e('0xf')](respondWithFilteredResult(_0x5c5d39,_0x3c9016))[_0x148e('0x18')](handleError(_0x5c5d39,null));};exports['addApplications']=function addApplications(_0x33eebb,_0x2f672f){var _0x268d28=_0x33eebb['params']['id'];var _0x598106=_0x33eebb[_0x148e('0x47')];var _0x4477cb=0xc8;var _0x5e0dde=null;return db[_0x148e('0x80')][_0x148e('0x81')]({'isolationLevel':db['sequelize'][_0x148e('0x82')][_0x148e('0x83')][_0x148e('0x84')]},function(_0x5f4ec3){return db['MailAccount'][_0x148e('0x50')]({'where':{'id':_0x268d28},'transaction':_0x5f4ec3})[_0x148e('0xf')](function(_0x44550d){if(_0x44550d){return db[_0x148e('0x85')][_0x148e('0x24')]({'where':{'MailAccountId':_0x268d28},'transaction':_0x5f4ec3})[_0x148e('0xf')](function(){var _0x2cbc86=_['map'](_0x598106,function(_0x4310f5){_0x4310f5[_0x148e('0x53')]=_0x268d28;return _0x4310f5;});return db[_0x148e('0x85')][_0x148e('0x86')](_0x2cbc86,{'transaction':_0x5f4ec3});});}else{_0x4477cb=0x194;_0x5e0dde=[];}});})[_0x148e('0xf')](function(){if(_0x4477cb!==0x194){return db[_0x148e('0x85')][_0x148e('0x87')]({'where':{'MailAccountId':_0x268d28},'order':_0x148e('0x88')})['then'](function(_0x129e59){_0x5e0dde=_0x129e59;});}})[_0x148e('0x18')](function(_0x5090be){_0x4477cb=0x1f4;logger[_0x148e('0x14')](_0x5090be[_0x148e('0x89')]);if(_0x5090be[_0x148e('0x26')]){delete _0x5090be['name'];}_0x5e0dde=_0x5090be;})[_0x148e('0x8a')](function(){if(_0x5e0dde===null){_0x2f672f[_0x148e('0x25')](_0x4477cb);}else{if(_0x4477cb===0x1f4){_0x2f672f[_0x148e('0x1b')](_0x4477cb)[_0x148e('0x8b')](_0x5e0dde);}else{_0x2f672f[_0x148e('0x1b')](_0x4477cb)['json'](_0x5e0dde);}}});};exports[_0x148e('0x8c')]=function(_0x2cc857,_0xea2732){var _0x1e8185={};var _0x430774={};var _0x486437;var _0x57ccdc;return db[_0x148e('0x2e')][_0x148e('0x50')]({'where':{'id':_0x2cc857[_0x148e('0x4d')]['id']}})[_0x148e('0xf')](handleEntityNotFound(_0xea2732,null))['then'](function(_0x2bd0e7){if(_0x2bd0e7){_0x486437=_0x2bd0e7;_0x430774['model']=_[_0x148e('0x34')](db['MailApplication']['rawAttributes']);_0x430774[_0x148e('0x33')]=_[_0x148e('0x34')](_0x2cc857[_0x148e('0x33')]);_0x430774[_0x148e('0x35')]=_[_0x148e('0x36')](_0x430774['model'],_0x430774['query']);_0x1e8185[_0x148e('0x38')]=_[_0x148e('0x36')](_0x430774[_0x148e('0x32')],qs['fields'](_0x2cc857[_0x148e('0x33')][_0x148e('0x37')]));_0x1e8185[_0x148e('0x38')]=_0x1e8185['attributes'][_0x148e('0x39')]?_0x1e8185['attributes']:_0x430774['model'];_0x1e8185[_0x148e('0x3a')]=qs['sort'](_0x2cc857[_0x148e('0x33')][_0x148e('0x3b')]);_0x1e8185[_0x148e('0x3c')]=qs['filters'](_[_0x148e('0x52')](_0x2cc857['query'],_0x430774[_0x148e('0x35')]));if(_0x2cc857[_0x148e('0x33')][_0x148e('0x3d')]){_0x1e8185[_0x148e('0x3c')]=_[_0x148e('0x3e')](_0x1e8185[_0x148e('0x3c')],{'$or':_['map'](_0x1e8185[_0x148e('0x38')],function(_0x1e8b93){var _0x395595={};_0x395595[_0x1e8b93]={'$like':'%'+_0x2cc857[_0x148e('0x33')][_0x148e('0x3d')]+'%'};return _0x395595;})});}_0x1e8185=_[_0x148e('0x3e')]({},_0x1e8185,_0x2cc857[_0x148e('0x3f')]);return _0x486437[_0x148e('0x8c')](_0x1e8185);}})[_0x148e('0xf')](function(_0x4ebcf3){if(_0x4ebcf3){_0x57ccdc=_0x4ebcf3[_0x148e('0x39')];if(!_0x2cc857[_0x148e('0x33')]['hasOwnProperty'](_0x148e('0x51'))){_0x1e8185[_0x148e('0x1e')]=qs[_0x148e('0x1e')](_0x2cc857[_0x148e('0x33')][_0x148e('0x1e')]);_0x1e8185[_0x148e('0x20')]=qs['offset'](_0x2cc857[_0x148e('0x33')][_0x148e('0x20')]);}return _0x486437[_0x148e('0x8c')](_0x1e8185);}})['then'](function(_0x261440){if(_0x261440){return _0x261440?{'count':_0x57ccdc,'rows':_0x261440}:null;}})['then'](respondWithResult(_0xea2732,null))['catch'](handleError(_0xea2732,null));};exports[_0x148e('0x8d')]=function(_0xbbf1ed,_0x1bc4b6){var _0x4f0e37={'raw':!![],'where':{}};var _0x1a5d3b={};var _0x30663d={'count':0x0,'rows':[]};return db[_0x148e('0x2e')]['findOne']({'where':{'id':_0xbbf1ed[_0x148e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1bc4b6,null))[_0x148e('0xf')](function(_0x5d4ca0){if(_0x5d4ca0){_0x1a5d3b[_0x148e('0x32')]=_['keys'](db[_0x148e('0x8e')][_0x148e('0x2f')]);_0x1a5d3b[_0x148e('0x33')]=_['keys'](_0xbbf1ed[_0x148e('0x33')]);_0x1a5d3b['filters']=_['intersection'](_0x1a5d3b['model'],_0x1a5d3b[_0x148e('0x33')]);_0x4f0e37[_0x148e('0x38')]=_[_0x148e('0x36')](_0x1a5d3b[_0x148e('0x32')],qs['fields'](_0xbbf1ed['query'][_0x148e('0x37')]));_0x4f0e37[_0x148e('0x38')]=_0x4f0e37['attributes'][_0x148e('0x39')]?_0x4f0e37['attributes']:_0x1a5d3b[_0x148e('0x32')];if(!_0xbbf1ed[_0x148e('0x33')][_0x148e('0x58')](_0x148e('0x51'))){_0x4f0e37[_0x148e('0x1e')]=qs[_0x148e('0x1e')](_0xbbf1ed['query'][_0x148e('0x1e')]);_0x4f0e37['offset']=qs['offset'](_0xbbf1ed[_0x148e('0x33')]['offset']);}_0x4f0e37[_0x148e('0x3a')]=qs[_0x148e('0x3b')](_0xbbf1ed[_0x148e('0x33')][_0x148e('0x3b')]);_0x4f0e37['where']=qs['filters'](_[_0x148e('0x52')](_0xbbf1ed[_0x148e('0x33')],_0x1a5d3b[_0x148e('0x35')]));_0x4f0e37[_0x148e('0x3c')][_0x148e('0x53')]=_0x5d4ca0['id'];if(_0xbbf1ed[_0x148e('0x33')][_0x148e('0x3d')]){_0x4f0e37[_0x148e('0x3c')]=_[_0x148e('0x3e')](_0x4f0e37[_0x148e('0x3c')],{'$or':_[_0x148e('0x2d')](_0x4f0e37[_0x148e('0x38')],function(_0x4d3339){var _0x48815a={};_0x48815a[_0x4d3339]={'$like':'%'+_0xbbf1ed[_0x148e('0x33')][_0x148e('0x3d')]+'%'};return _0x48815a;})});}if(_0xbbf1ed[_0x148e('0x33')][_0x148e('0x8f')]){var _0xc96e75=_0xbbf1ed[_0x148e('0x33')][_0x148e('0x8f')][_0x148e('0x90')](',');var _0x4026d0={};_0x4026d0[_0xc96e75[0x0]]={'$gte':moment(_0xc96e75[0x1])[_0x148e('0x91')](_0x148e('0x92'))};_0x4f0e37[_0x148e('0x3c')]=_[_0x148e('0x3e')](_0x4f0e37[_0x148e('0x3c')],_0x4026d0);}_0x4f0e37=_['merge']({},_0x4f0e37,_0xbbf1ed['options']);return db['MailMessage'][_0x148e('0x1f')]({'where':_0x4f0e37[_0x148e('0x3c')]})['then'](function(_0x5f3f15){_0x30663d['count']=_0x5f3f15;if(_0xbbf1ed[_0x148e('0x33')][_0x148e('0x40')]){_0x4f0e37[_0x148e('0x41')]=[{'all':!![]}];}return db[_0x148e('0x8e')][_0x148e('0x42')](_0x4f0e37);})[_0x148e('0xf')](function(_0x20cb2d){if(_0xbbf1ed[_0x148e('0x33')]['inlineCss']==='true'){for(var _0x1bffa4=0x0;_0x1bffa4<_0x20cb2d[_0x148e('0x39')];_0x1bffa4++){_0x20cb2d[_0x1bffa4][_0x148e('0x47')]=juice(_0x20cb2d[_0x1bffa4][_0x148e('0x47')]);}}_0x30663d[_0x148e('0x43')]=_0x20cb2d;return _0x30663d;});}})[_0x148e('0xf')](respondWithFilteredResult(_0x1bc4b6,_0x4f0e37))[_0x148e('0x18')](handleError(_0x1bc4b6,null));};exports[_0x148e('0x8b')]=function(_0x73bc3f,_0x3c2943){var _0x9abfbe,_0xfe445a={},_0x5400e3;if(_0x73bc3f[_0x148e('0x47')]['to']){_0x5400e3=_0x73bc3f[_0x148e('0x47')]['to']['split'](',')[0x0];}return db[_0x148e('0x2e')][_0x148e('0x4a')]({'where':{'id':_0x73bc3f[_0x148e('0x4d')]['id']},'include':[{'model':db[_0x148e('0x93')],'as':_0x148e('0x94'),'include':[{'model':db[_0x148e('0x79')],'as':'Contacts','where':{'email':_0x5400e3},'limit':0x1,'order':[[_0x148e('0x95'),_0x148e('0x96')]]}]},{'model':db[_0x148e('0x45')],'as':_0x148e('0x2a'),'raw':!![]}]})[_0x148e('0xf')](handleEntityNotFound(_0x3c2943,null))[_0x148e('0xf')](function(_0x5bfa03){if(_0x5bfa03){_0x9abfbe=_0x5bfa03;if(_0x5bfa03['Smtp']){if(_['isNil'](_0x73bc3f[_0x148e('0x47')][_0x148e('0x97')])){_0x73bc3f[_0x148e('0x47')][_0x148e('0x97')]=util[_0x148e('0x91')](_0x148e('0x98'),_0x5bfa03['name'],_0x5bfa03[_0x148e('0x5c')]||_0x5bfa03[_0x148e('0x2a')][_0x148e('0x60')]);}if(_0x73bc3f[_0x148e('0x47')]['attachments']&&_0x73bc3f['body'][_0x148e('0x99')][_0x148e('0x39')]){for(var _0x3ba03c=0x0;_0x3ba03c<_0x73bc3f[_0x148e('0x47')]['attachments'][_0x148e('0x39')];_0x3ba03c+=0x1){_0x73bc3f['body'][_0x148e('0x99')][_0x3ba03c]={'filename':_0x73bc3f[_0x148e('0x47')][_0x148e('0x99')][_0x3ba03c][_0x148e('0x26')],'path':path[_0x148e('0x9a')](config[_0x148e('0x9b')],_0x148e('0x9c'),_0x73bc3f[_0x148e('0x47')][_0x148e('0x99')][_0x3ba03c][_0x148e('0x9d')])};}}var _0x2f4a7b={'tls':{'rejectUnauthorized':![]}};if(_[_0x148e('0x9e')](_0x5bfa03[_0x148e('0x2a')][_0x148e('0x64')])){if(_0x5bfa03['Smtp'][_0x148e('0x67')]){_0x2f4a7b['auth']={'user':_0x5bfa03['Smtp'][_0x148e('0x60')],'pass':_0x5bfa03[_0x148e('0x2a')][_0x148e('0x63')]};}_0x2f4a7b[_0x148e('0x65')]=_0x5bfa03['Smtp'][_0x148e('0x65')];_0x2f4a7b[_0x148e('0x66')]=_0x5bfa03['Smtp'][_0x148e('0x66')];_0x2f4a7b[_0x148e('0x9f')]=_0x5bfa03[_0x148e('0x2a')][_0x148e('0x9f')];}else{_0x2f4a7b[_0x148e('0x64')]=_0x5bfa03[_0x148e('0x2a')]['service'];_0x2f4a7b[_0x148e('0xa0')]={'user':_0x5bfa03['Smtp'][_0x148e('0x60')],'pass':_0x5bfa03[_0x148e('0x2a')]['pass']};}return respondWithRpcPromise(_0x148e('0xa1'),_0x148e('0xa2'),{'account':_0x2f4a7b,'message':_0x73bc3f[_0x148e('0x47')]});}else{throw new Error('List\x20not\x20found');}}})[_0x148e('0xf')](function(_0x511523){if(_0x511523){_0xfe445a=_0x511523;if(_0x9abfbe['List']){if(_0x9abfbe[_0x148e('0x94')][_0x148e('0xa3')][_0x148e('0x39')]){return _0x9abfbe['List'][_0x148e('0xa3')][0x0];}else{return db[_0x148e('0x79')]['create'](_[_0x148e('0x7')](_0x73bc3f['body'],{'firstName':_0x73bc3f['body']['to'],'email':_0x73bc3f['body']['to'],'phone':_0x73bc3f[_0x148e('0x47')]['to'],'ListId':_0x9abfbe[_0x148e('0x5d')]}));}}else{throw new Error(_0x148e('0xa4'));}}})[_0x148e('0xf')](function(_0x7988d6){if(_0x7988d6){var _0x456353={'UserId':_0x73bc3f[_0x148e('0x60')]['id'],'ContactId':_0x7988d6['id'],'MailAccountId':_0x9abfbe['id'],'inReplyTo':_0xfe445a['messageId'],'to':_0x73bc3f[_0x148e('0x47')]['from'],'cc':_0x73bc3f['body']['cc'],'subject':_0x73bc3f[_0x148e('0x47')][_0x148e('0xa5')],'attach':_0x73bc3f[_0x148e('0x47')][_0x148e('0xa6')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x148e('0x91')](_0x148e('0x92')),'lastMsgDirection':_0x148e('0xa7'),'Messages':[_[_0x148e('0x3e')](_0x73bc3f[_0x148e('0x47')],{'messageId':_0xfe445a[_0x148e('0xa8')],'sentAt':moment()[_0x148e('0x91')](_0x148e('0x92')),'read':!![],'MailAccountId':_0x9abfbe['id'],'UserId':_0x73bc3f[_0x148e('0x60')]['id'],'ContactId':_0x7988d6['id']})]};if(_0x73bc3f[_0x148e('0x47')]['Interaction']){_0x456353=_[_0x148e('0x3e')](_0x456353,_0x73bc3f[_0x148e('0x47')]['Interaction']);}return db[_0x148e('0x76')]['create'](_0x456353,{'include':[{'model':db[_0x148e('0x8e')],'as':_0x148e('0xa9')}]});}})['then'](respondWithResult(_0x3c2943,null))['catch'](handleError(_0x3c2943,null));};exports[_0x148e('0xaa')]=function(_0x23121a,_0xe267a5){return db[_0x148e('0x2e')]['find']({'where':{'id':_0x23121a[_0x148e('0x4d')]['id']},'include':[{'model':db[_0x148e('0x45')],'as':_0x148e('0x2a'),'raw':!![],'include':[{'model':db[_0x148e('0xab')],'as':_0x148e('0xab'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0xe267a5,null))['then'](function(_0x99e33a){if(!_0x99e33a[_0x148e('0x2a')])return;var _0xed22d6={'id':_0x99e33a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x99e33a[_0x148e('0x5a')]!=='custom'){_0xed22d6[_0x148e('0x64')]=_0x99e33a[_0x148e('0x5a')];}else{_0xed22d6[_0x148e('0x65')]=_0x99e33a[_0x148e('0x2a')][_0x148e('0x65')];_0xed22d6[_0x148e('0x66')]=_0x99e33a[_0x148e('0x2a')]['port'];_0xed22d6[_0x148e('0x9f')]=_0x99e33a['Smtp'][_0x148e('0x9f')];}if(_0x99e33a[_0x148e('0x2a')]['authentication']){if(_0x99e33a[_0x148e('0x2a')][_0x148e('0x48')]){_0xed22d6['auth']={'type':_0x148e('0xac'),'user':_0x99e33a[_0x148e('0x2a')][_0x148e('0x60')],'accessToken':_0x99e33a[_0x148e('0x2a')][_0x148e('0xab')][_0x148e('0xad')]};}else{_0xed22d6['auth']={'user':_0x99e33a[_0x148e('0x2a')]['user'],'pass':_0x99e33a[_0x148e('0x2a')][_0x148e('0x63')]};}}return respondWithRpcPromise('VerifySmtp',_0x148e('0xaa'),{'account':_0xed22d6});})[_0x148e('0xf')](respondWithResult(_0xe267a5,null))['catch'](handleError(_0xe267a5,null));};exports[_0x148e('0x24')]=function(_0x2b3c2e,_0x545aa4){return db[_0x148e('0x2e')][_0x148e('0x4a')]({'where':{'id':_0x2b3c2e[_0x148e('0x4d')]['id']}})[_0x148e('0xf')](handleEntityNotFound(_0x545aa4,null))[_0x148e('0xf')](function(_0x4ec510){if(_0x4ec510&&_0x4ec510[_0x148e('0x64')]){throw new db[(_0x148e('0xae'))][(_0x148e('0xaf'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x4ec510;})[_0x148e('0xf')](removeEntity(_0x545aa4,null))[_0x148e('0x18')](handleError(_0x545aa4,null));};exports[_0x148e('0xb0')]=function(_0x410af0,_0x591563){return db['MailAccount'][_0x148e('0x4a')]({'where':{'id':_0x410af0[_0x148e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x591563,null))[_0x148e('0xf')](function(_0x27f715){if(_0x27f715){return _0x27f715['addAgents'](_0x410af0[_0x148e('0x47')][_0x148e('0x55')],_[_0x148e('0xb1')](_0x410af0[_0x148e('0x47')],[_0x148e('0x55'),'id'])||{})['spread'](function(_0x3955c8){for(var _0x2303e7=0x0;_0x2303e7<_0x410af0['body'][_0x148e('0x55')][_0x148e('0x39')];_0x2303e7+=0x1){socket[_0x148e('0xb2')](_0x148e('0xb3'),{'UserId':Number(_0x410af0[_0x148e('0x47')][_0x148e('0x55')][_0x2303e7]),'MailAccountId':Number(_0x410af0[_0x148e('0x4d')]['id'])});}return _0x3955c8;});}})[_0x148e('0xf')](respondWithResult(_0x591563,null))[_0x148e('0x18')](handleError(_0x591563,null));};exports['removeAgents']=function(_0xdaca6e,_0x2264aa){return db[_0x148e('0x2e')][_0x148e('0x4a')]({'where':{'id':_0xdaca6e[_0x148e('0x4d')]['id']}})[_0x148e('0xf')](handleEntityNotFound(_0x2264aa,null))[_0x148e('0xf')](function(_0xec981d){if(_0xec981d){return _0xec981d[_0x148e('0xb4')](_0xdaca6e['query'][_0x148e('0x55')])['then'](function(){if(_[_0x148e('0xb5')](_0xdaca6e[_0x148e('0x33')][_0x148e('0x55')])){for(var _0x1c1ec0=0x0;_0x1c1ec0<_0xdaca6e[_0x148e('0x33')][_0x148e('0x55')][_0x148e('0x39')];_0x1c1ec0+=0x1){socket['emit'](_0x148e('0xb6'),{'UserId':Number(_0xdaca6e[_0x148e('0x33')][_0x148e('0x55')][_0x1c1ec0]),'MailAccountId':Number(_0xdaca6e[_0x148e('0x4d')]['id'])});}}else{socket[_0x148e('0xb2')](_0x148e('0xb6'),{'UserId':Number(_0xdaca6e['query'][_0x148e('0x55')]),'MailAccountId':Number(_0xdaca6e['params']['id'])});}});}})[_0x148e('0xf')](respondWithStatusCode(_0x2264aa,null))[_0x148e('0x18')](handleError(_0x2264aa,null));};exports[_0x148e('0xb7')]=function(_0x56dea9,_0xb2064d){var _0xe97080={};var _0xdeca8b={};var _0x3009d9;var _0x3917da;return db[_0x148e('0x2e')][_0x148e('0x50')]({'where':{'id':_0x56dea9[_0x148e('0x4d')]['id']}})[_0x148e('0xf')](handleEntityNotFound(_0xb2064d,null))[_0x148e('0xf')](function(_0x48d03b){if(_0x48d03b){_0x3009d9=_0x48d03b;_0xdeca8b['model']=_[_0x148e('0x34')](db[_0x148e('0x7b')][_0x148e('0x2f')]);_0xdeca8b[_0x148e('0x33')]=_['keys'](_0x56dea9[_0x148e('0x33')]);_0xdeca8b[_0x148e('0x35')]=_['intersection'](_0xdeca8b['model'],_0xdeca8b[_0x148e('0x33')]);_0xe97080[_0x148e('0x38')]=_[_0x148e('0x36')](_0xdeca8b[_0x148e('0x32')],qs[_0x148e('0x37')](_0x56dea9['query'][_0x148e('0x37')]));_0xe97080['attributes']=_0xe97080[_0x148e('0x38')][_0x148e('0x39')]?_0xe97080[_0x148e('0x38')]:_0xdeca8b[_0x148e('0x32')];_0xe97080[_0x148e('0x3a')]=qs[_0x148e('0x3b')](_0x56dea9[_0x148e('0x33')][_0x148e('0x3b')]);_0xe97080[_0x148e('0x3c')]=qs[_0x148e('0x35')](_['pick'](_0x56dea9['query'],_0xdeca8b[_0x148e('0x35')]));if(_0x56dea9[_0x148e('0x33')][_0x148e('0x3d')]){_0xe97080['where']=_[_0x148e('0x3e')](_0xe97080['where'],{'$or':_['map'](_0xe97080[_0x148e('0x38')],function(_0x49dfc1){var _0x2131f1={};_0x2131f1[_0x49dfc1]={'$like':'%'+_0x56dea9[_0x148e('0x33')][_0x148e('0x3d')]+'%'};return _0x2131f1;})});}_0xe97080=_[_0x148e('0x3e')]({},_0xe97080,_0x56dea9[_0x148e('0x3f')]);return _0x3009d9[_0x148e('0xb7')](_0xe97080);}})[_0x148e('0xf')](function(_0x1fa491){if(_0x1fa491){_0x3917da=_0x1fa491[_0x148e('0x39')];if(!_0x56dea9[_0x148e('0x33')]['hasOwnProperty'](_0x148e('0x51'))){_0xe97080['limit']=qs[_0x148e('0x1e')](_0x56dea9[_0x148e('0x33')][_0x148e('0x1e')]);_0xe97080[_0x148e('0x20')]=qs['offset'](_0x56dea9[_0x148e('0x33')][_0x148e('0x20')]);}return _0x3009d9['getAgents'](_0xe97080);}})[_0x148e('0xf')](function(_0x415407){if(_0x415407){return _0x415407?{'count':_0x3917da,'rows':_0x415407}:null;}})[_0x148e('0xf')](respondWithResult(_0xb2064d,null))[_0x148e('0x18')](handleError(_0xb2064d,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 88ee536..18bc7ca 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 _0x9261=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9261,0x1de));var _0x1926=function(_0x1352f0,_0x4cd565){_0x1352f0=_0x1352f0-0x0;var _0x1c2a82=_0x9261[_0x1352f0];return _0x1c2a82;};'use strict';var EventEmitter=require(_0x1926('0x0'));var MailAccount=require(_0x1926('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1926('0x2')](0x0);var events={'afterCreate':_0x1926('0x3'),'afterUpdate':_0x1926('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1b2b33){return function(_0x2fb805,_0x269cb1,_0x31eef2){MailAccountEvents[_0x1926('0x5')](_0x1b2b33+':'+_0x2fb805['id'],_0x2fb805);MailAccountEvents['emit'](_0x1b2b33,_0x2fb805);_0x31eef2(null);};}for(var e in events){if(events[_0x1926('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x1926('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xff6f=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x5c0bc6,_0x47c289){var _0x4462e1=function(_0x166452){while(--_0x166452){_0x5c0bc6['push'](_0x5c0bc6['shift']());}};_0x4462e1(++_0x47c289);}(_0xff6f,0x11e));var _0xfff6=function(_0x5376c1,_0x106f0d){_0x5376c1=_0x5376c1-0x0;var _0x3335c2=_0xff6f[_0x5376c1];return _0x3335c2;};'use strict';var EventEmitter=require(_0xfff6('0x0'));var MailAccount=require(_0xfff6('0x1'))['db'][_0xfff6('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xfff6('0x3')](0x0);var events={'afterCreate':_0xfff6('0x4'),'afterUpdate':_0xfff6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1dbf72){return function(_0x5d8fd4,_0x252763,_0x4f5b5e){MailAccountEvents[_0xfff6('0x6')](_0x1dbf72+':'+_0x5d8fd4['id'],_0x5d8fd4);MailAccountEvents['emit'](_0x1dbf72,_0x5d8fd4);_0x4f5b5e(null);};}for(var e in events){if(events[_0xfff6('0x7')](e)){var event=events[e];MailAccount[_0xfff6('0x8')](e,emitEvent(event));}}module[_0xfff6('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 5eb908b..1749bb7 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 _0x7a7f=['define','mail_accounts','lodash','../../config/logger','moment','bluebird','path','rimraf','./mailAccount.attributes','exports'];(function(_0x25fa5c,_0x421141){var _0x1bade2=function(_0x3faf20){while(--_0x3faf20){_0x25fa5c['push'](_0x25fa5c['shift']());}};_0x1bade2(++_0x421141);}(_0x7a7f,0x192));var _0xf7a7=function(_0x7a40c9,_0x29a39c){_0x7a40c9=_0x7a40c9-0x0;var _0x4a0c00=_0x7a7f[_0x7a40c9];return _0x4a0c00;};'use strict';var _=require(_0xf7a7('0x0'));var util=require('util');var logger=require(_0xf7a7('0x1'))('api');var moment=require(_0xf7a7('0x2'));var BPromise=require(_0xf7a7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf7a7('0x4'));var rimraf=require(_0xf7a7('0x5'));var config=require('../../config/environment');var attributes=require(_0xf7a7('0x6'));module[_0xf7a7('0x7')]=function(_0x196937,_0x3af61b){return _0x196937[_0xf7a7('0x8')]('MailAccount',attributes,{'tableName':_0xf7a7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x645d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','define','MailAccount','mail_accounts'];(function(_0x296bc9,_0x1b2414){var _0x5d1ea9=function(_0x2a209a){while(--_0x2a209a){_0x296bc9['push'](_0x296bc9['shift']());}};_0x5d1ea9(++_0x1b2414);}(_0x645d,0xd2));var _0xd645=function(_0x539eb6,_0x3843f8){_0x539eb6=_0x539eb6-0x0;var _0x2e3478=_0x645d[_0x539eb6];return _0x2e3478;};'use strict';var _=require(_0xd645('0x0'));var util=require(_0xd645('0x1'));var logger=require(_0xd645('0x2'))(_0xd645('0x3'));var moment=require(_0xd645('0x4'));var BPromise=require(_0xd645('0x5'));var rp=require(_0xd645('0x6'));var fs=require('fs');var path=require(_0xd645('0x7'));var rimraf=require(_0xd645('0x8'));var config=require(_0xd645('0x9'));var attributes=require(_0xd645('0xa'));module['exports']=function(_0x29ce11,_0x240b97){return _0x29ce11[_0xd645('0xb')](_0xd645('0xc'),attributes,{'tableName':_0xd645('0xd'),'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 6ecef3a..73412e5 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 _0xf65c=['../../config/environment','jayson/promise','client','redis','./mailAccount.socket','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','MailAccount','findAll','options','limit','include','model','attributes','map','GetMailAccount','catch','find','raw','ShowMailAccount','mail','difference','keys','CmContact','createdAt','CompanyId','ListId','body','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','List','DESC','MailApplication','MailServerOut','Smtp','get','omit','applications','Applications','list','orderBy','priority','asc','autoclose','push','close','*,*,*,*','Contacts','length','defaults','create','messageId','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','Start','startRouting','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2ffaab,_0x216a91){var _0x2c1d0a=function(_0xa1c5e6){while(--_0xa1c5e6){_0x2ffaab['push'](_0x2ffaab['shift']());}};_0x2c1d0a(++_0x216a91);}(_0xf65c,0xc1));var _0xcf65=function(_0x39f442,_0x2002da){_0x39f442=_0x39f442-0x0;var _0x49781d=_0xf65c[_0x39f442];return _0x49781d;};'use strict';var _=require('lodash');var util=require(_0xcf65('0x0'));var moment=require(_0xcf65('0x1'));var BPromise=require(_0xcf65('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf65('0x3'));var db=require(_0xcf65('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf65('0x5'))(_0xcf65('0x6'));var config=require(_0xcf65('0x7'));var jayson=require(_0xcf65('0x8'));var client=jayson[_0xcf65('0x9')]['http']({'port':0x232c});config[_0xcf65('0xa')]=_['defaults'](config[_0xcf65('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf65('0xa')]));require(_0xcf65('0xb'))['register'](socket);function respondWithRpcPromise(_0x3f4d72,_0x1d880d,_0x1e9dec){return new BPromise(function(_0x152b23,_0x59692d){return client['request'](_0x3f4d72,_0x1e9dec)[_0xcf65('0xc')](function(_0x3f91b9){logger['info'](_0xcf65('0xd'),_0x1d880d,'request\x20sent');logger[_0xcf65('0xe')](_0xcf65('0xf'),_0x1d880d,_0xcf65('0x10'),JSON[_0xcf65('0x11')](_0x3f91b9));if(_0x3f91b9[_0xcf65('0x12')]){if(_0x3f91b9[_0xcf65('0x12')][_0xcf65('0x13')]===0x1f4){logger[_0xcf65('0x12')](_0xcf65('0xd'),_0x1d880d,_0x3f91b9[_0xcf65('0x12')][_0xcf65('0x14')]);return _0x59692d(_0x3f91b9['error'][_0xcf65('0x14')]);}logger[_0xcf65('0x12')](_0xcf65('0xd'),_0x1d880d,_0x3f91b9[_0xcf65('0x12')][_0xcf65('0x14')]);return _0x152b23(_0x3f91b9[_0xcf65('0x12')]['message']);}else{logger[_0xcf65('0x15')]('MailAccount,\x20%s,\x20%s',_0x1d880d,'request\x20sent');_0x152b23(_0x3f91b9[_0xcf65('0x16')][_0xcf65('0x14')]);}})['catch'](function(_0x1d639a){logger[_0xcf65('0x12')](_0xcf65('0xd'),_0x1d880d,_0x1d639a);_0x59692d(_0x1d639a);});});}exports['GetMailAccount']=function(_0x447d01){var _0x5181e8=this;return new Promise(function(_0x14aa92,_0x216220){return db[_0xcf65('0x17')][_0xcf65('0x18')]({'raw':_0x447d01[_0xcf65('0x19')]?_0x447d01[_0xcf65('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x447d01[_0xcf65('0x19')]?_0x447d01['options']['where']||null:null,'attributes':_0x447d01[_0xcf65('0x19')]?_0x447d01[_0xcf65('0x19')]['attributes']||null:null,'limit':_0x447d01[_0xcf65('0x19')]?_0x447d01['options'][_0xcf65('0x1a')]||null:null,'include':_0x447d01[_0xcf65('0x19')]?_0x447d01[_0xcf65('0x19')][_0xcf65('0x1b')]?_['map'](_0x447d01[_0xcf65('0x19')]['include'],function(_0x446e78){return{'model':db[_0x446e78[_0xcf65('0x1c')]],'as':_0x446e78['as'],'attributes':_0x446e78[_0xcf65('0x1d')],'include':_0x446e78[_0xcf65('0x1b')]?_[_0xcf65('0x1e')](_0x446e78['include'],function(_0x41065f){return{'model':db[_0x41065f[_0xcf65('0x1c')]],'as':_0x41065f['as'],'attributes':_0x41065f[_0xcf65('0x1d')],'include':_0x41065f[_0xcf65('0x1b')]?_[_0xcf65('0x1e')](_0x41065f[_0xcf65('0x1b')],function(_0x461c23){return{'model':db[_0x461c23['model']],'as':_0x461c23['as'],'attributes':_0x461c23[_0xcf65('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcf65('0xc')](function(_0x10f67c){logger[_0xcf65('0x15')](_0xcf65('0x1f'),_0x447d01);logger[_0xcf65('0xe')](_0xcf65('0x1f'),_0x447d01,JSON[_0xcf65('0x11')](_0x10f67c));_0x14aa92(_0x10f67c);})[_0xcf65('0x20')](function(_0x220fe4){logger['error'](_0xcf65('0x1f'),_0x220fe4[_0xcf65('0x14')],_0x447d01);_0x216220(_0x5181e8['error'](0x1f4,_0x220fe4['message']));});});};exports['ShowMailAccount']=function(_0x38c50a){var _0x4f4f91=this;return new Promise(function(_0x3c0547,_0x426439){return db['MailAccount'][_0xcf65('0x21')]({'raw':_0x38c50a['options']?_0x38c50a[_0xcf65('0x19')][_0xcf65('0x22')]===undefined?!![]:![]:!![],'where':_0x38c50a['options']?_0x38c50a[_0xcf65('0x19')]['where']||null:null,'attributes':_0x38c50a[_0xcf65('0x19')]?_0x38c50a[_0xcf65('0x19')][_0xcf65('0x1d')]||null:null,'include':_0x38c50a[_0xcf65('0x19')]?_0x38c50a[_0xcf65('0x19')]['include']?_[_0xcf65('0x1e')](_0x38c50a[_0xcf65('0x19')][_0xcf65('0x1b')],function(_0x5cb71f){return{'model':db[_0x5cb71f['model']],'as':_0x5cb71f['as'],'attributes':_0x5cb71f[_0xcf65('0x1d')],'include':_0x5cb71f[_0xcf65('0x1b')]?_[_0xcf65('0x1e')](_0x5cb71f[_0xcf65('0x1b')],function(_0x3a6fee){return{'model':db[_0x3a6fee[_0xcf65('0x1c')]],'as':_0x3a6fee['as'],'attributes':_0x3a6fee[_0xcf65('0x1d')],'include':_0x3a6fee[_0xcf65('0x1b')]?_[_0xcf65('0x1e')](_0x3a6fee[_0xcf65('0x1b')],function(_0x695dde){return{'model':db[_0x695dde[_0xcf65('0x1c')]],'as':_0x695dde['as'],'attributes':_0x695dde[_0xcf65('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcf65('0xc')](function(_0x34409b){logger[_0xcf65('0x15')](_0xcf65('0x23'),_0x38c50a);logger['debug'](_0xcf65('0x23'),_0x38c50a,JSON[_0xcf65('0x11')](_0x34409b));_0x3c0547(_0x34409b);})['catch'](function(_0x486540){logger[_0xcf65('0x12')](_0xcf65('0x23'),_0x486540[_0xcf65('0x14')],_0x38c50a);_0x426439(_0x4f4f91[_0xcf65('0x12')](0x1f4,_0x486540[_0xcf65('0x14')]));});});};exports['NotifyMailAccount']=function(_0x58d5e7){var _0x5eb1f8=this;return new Promise(function(_0x548ba1,_0xf1b08){var _0x183694={'body':_0x58d5e7['body'],'channel':_0xcf65('0x24')};var _0x3dc8f8=_[_0xcf65('0x25')](_[_0xcf65('0x26')](db[_0xcf65('0x27')]['rawAttributes']),[_0xcf65('0x28'),'updatedAt',_0xcf65('0x29'),_0xcf65('0x2a')]);var _0x39c4f7=![];if(_0x58d5e7['body']['id']){delete _0x58d5e7[_0xcf65('0x2b')]['id'];}if(_[_0xcf65('0x2c')](_0x58d5e7[_0xcf65('0x2b')]['from'])){return _0xf1b08(_0x5eb1f8['error'](0x1f4,_0xcf65('0x2d')));}if(_[_0xcf65('0x2c')](_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x2b')])||_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x2b')]===''){return _0xf1b08(_0x5eb1f8[_0xcf65('0x12')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xcf65('0x2c')](_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x2e')])){return _0xf1b08(_0x5eb1f8[_0xcf65('0x12')](0x1f4,_0xcf65('0x2f')+_0x3dc8f8));}if(!_['includes'](_0x3dc8f8,_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x2e')])){return _0xf1b08(_0x5eb1f8['error'](0x1f4,_0xcf65('0x30')+_0x3dc8f8));}var _0xd41064={};_0xd41064[_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x2e')]]=_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x31')];return db[_0xcf65('0x17')][_0xcf65('0x21')]({'where':{'id':_0x58d5e7[_0xcf65('0x32')]['id']},'include':[{'model':db['CmList'],'as':_0xcf65('0x33'),'include':[{'model':db[_0xcf65('0x27')],'as':'Contacts','where':_0xd41064,'limit':0x1,'order':[['updatedAt',_0xcf65('0x34')]]}]},{'model':db[_0xcf65('0x35')],'as':'Applications'},{'model':db[_0xcf65('0x36')],'as':_0xcf65('0x37')}]})['then'](function(_0x4d4dc0){if(_0x4d4dc0&&_0x4d4dc0[_0xcf65('0x33')]){var _0x47158a=_0x4d4dc0[_0xcf65('0x38')]({'plain':!![]});_0x183694[_0xcf65('0x32')]=_[_0xcf65('0x39')](_0x47158a,['Applications',_0xcf65('0x33')]);_0x183694[_0xcf65('0x3a')]=_0x47158a[_0xcf65('0x3b')];_0x183694[_0xcf65('0x3c')]=_0x47158a[_0xcf65('0x33')];_0x183694[_0xcf65('0x3a')]=_[_0xcf65('0x3d')](_0x183694[_0xcf65('0x3a')],[_0xcf65('0x3e')],[_0xcf65('0x3f')]);if(_0x183694[_0xcf65('0x32')]&&_0x183694[_0xcf65('0x32')][_0xcf65('0x40')]){_0x183694[_0xcf65('0x3a')][_0xcf65('0x41')]({'id':0x0,'priority':_0x183694[_0xcf65('0x3a')]['length']+0x1,'app':_0xcf65('0x42'),'appdata':'autoclose','interval':_0xcf65('0x43')});}if(_0x183694['account']['Applications']){delete _0x183694[_0xcf65('0x32')]['Applications'];}if(_0x183694[_0xcf65('0x32')]['List']){delete _0x183694[_0xcf65('0x32')]['List'];}if(_0x47158a[_0xcf65('0x33')][_0xcf65('0x44')][_0xcf65('0x45')]){return _0x47158a['List'][_0xcf65('0x44')][0x0];}var _0x107ca4=_[_0xcf65('0x46')](_0x58d5e7[_0xcf65('0x2b')],{'firstName':_0x58d5e7[_0xcf65('0x2b')]['from'],'ListId':_0x47158a[_0xcf65('0x2a')]});_0x107ca4[_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x2e')]]=_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x31')];return db['CmContact'][_0xcf65('0x47')](_0x107ca4);}else{throw new Error('List\x20not\x20found');}})[_0xcf65('0xc')](function(_0x105867){_0x183694['contact']=_0x105867;if(_0x105867){if(!_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')][_0xcf65('0x48')]){_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')]['messageId']=rs['generate']()+'\x20'+_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')][_0xcf65('0x31')];}var _0x566027={'ContactId':_0x105867['id'],'MailAccountId':_0x58d5e7[_0xcf65('0x32')]['id'],'inReplyTo':_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')][_0xcf65('0x48')],'to':_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')][_0xcf65('0x31')],'cc':_0x58d5e7['body'][_0xcf65('0x14')]['cc'],'subject':_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')][_0xcf65('0x49')],'attach':_0x58d5e7[_0xcf65('0x2b')]['message'][_0xcf65('0x4a')],'lastMsgAt':moment()[_0xcf65('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xcf65('0x4c')][_0xcf65('0x21')]({'where':{'closed':![],'MailAccountId':_0x58d5e7[_0xcf65('0x32')]['id']},'include':[{'model':db[_0xcf65('0x4d')],'as':_0xcf65('0x4e'),'attributes':[_0xcf65('0x48')],'where':{'messageId':_0x58d5e7['body'][_0xcf65('0x14')][_0xcf65('0x4f')]}}]})[_0xcf65('0xc')](function(_0x2a3fc8){if(_0x2a3fc8){return[_0x2a3fc8,![]];}return db[_0xcf65('0x4c')][_0xcf65('0x47')](_0x566027)['then'](function(_0x566ec9){return[_0x566ec9,!![]];});});}else{throw new Error(_0xcf65('0x50'));}})[_0xcf65('0x51')](function(_0x28fdad,_0x36d710){if(_0x28fdad){_0x39c4f7=_0x36d710;if(!_0x36d710){return _0x28fdad[_0xcf65('0x52')]({'inReplyTo':_0x58d5e7[_0xcf65('0x2b')]['message'][_0xcf65('0x48')],'to':_0x58d5e7['body']['message'][_0xcf65('0x31')],'cc':_0x58d5e7['body']['message']['cc'],'subject':_0x58d5e7[_0xcf65('0x2b')]['message'][_0xcf65('0x49')],'attach':_0x28fdad[_0xcf65('0x4a')]?_0x28fdad[_0xcf65('0x4a')]:_0x58d5e7[_0xcf65('0x2b')]['message'][_0xcf65('0x4a')],'substatus':null,'substatusAt':moment()[_0xcf65('0x4b')](_0xcf65('0x53')),'lastMsgAt':moment()[_0xcf65('0x4b')](_0xcf65('0x53')),'lastMsgDirection':'in'});}else{return _0x28fdad;}}})['then'](function(_0x28cbbb){_0x183694[_0xcf65('0x54')]=_0x28cbbb[_0xcf65('0x38')]({'plain':!![]});_0x183694[_0xcf65('0x54')][_0xcf65('0x55')]=_0x39c4f7;return db[_0xcf65('0x4d')][_0xcf65('0x47')]({'body':_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x2b')],'MailAccountId':_0x58d5e7['account']['id'],'MailInteractionId':_0x28cbbb['id'],'direction':'in','ContactId':_0x183694['contact']['id'],'messageId':_0x58d5e7['body'][_0xcf65('0x14')][_0xcf65('0x48')],'from':_0x58d5e7['body'][_0xcf65('0x14')]['from'],'to':_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')]['to'],'cc':_0x58d5e7['body'][_0xcf65('0x14')]['cc'],'subject':_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')][_0xcf65('0x49')],'attach':_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')][_0xcf65('0x4a')],'Attachments':_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')][_0xcf65('0x56')],'originTo':_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')]['originTo'],'originCc':_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')][_0xcf65('0x57')],'bcc':_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')][_0xcf65('0x58')],'ChatWebsiteId':_0x58d5e7[_0xcf65('0x2b')]['message'][_0xcf65('0x59')]||null,'originChannel':_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')][_0xcf65('0x5a')]||_0xcf65('0x5b'),'ChatOfflineMessageId':_0x58d5e7[_0xcf65('0x2b')][_0xcf65('0x14')][_0xcf65('0x5c')]||null},{'include':[{'model':db[_0xcf65('0x5d')],'as':'Attachments'}]});})[_0xcf65('0xc')](function(_0x48ce0b){_0x183694[_0xcf65('0x14')]=_0x48ce0b;if(_0x183694[_0xcf65('0x54')][_0xcf65('0x5e')]){return db[_0xcf65('0x5f')]['find']({'attributes':['id',_0xcf65('0x60')],'where':{'id':_0x183694[_0xcf65('0x54')][_0xcf65('0x5e')]}})[_0xcf65('0xc')](function(_0x4ebd28){if(_0x4ebd28){_0x183694[_0xcf65('0x3a')][_0xcf65('0x61')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4ebd28[_0xcf65('0x60')]+','+(_0x183694[_0xcf65('0x32')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xcf65('0x62'),_0xcf65('0x63'),_0x183694);});}return respondWithRpcPromise(_0xcf65('0x62'),_0xcf65('0x63'),_0x183694);})[_0xcf65('0xc')](function(_0x1d0aa9){_0x548ba1(_0x1d0aa9);})[_0xcf65('0x20')](function(_0x3c3b82){_0xf1b08(_0x5eb1f8['error'](0x1f4,_0x3c3b82[_0xcf65('0x14')]));});});}; \ No newline at end of file +var _0x482f=['moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','MailAccount','findAll','options','raw','limit','map','include','model','attributes','GetMailAccount','stringify','ShowMailAccount','where','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','account','MailApplication','Applications','MailServerOut','List','omit','applications','list','orderBy','asc','autoclose','push','length','close','*,*,*,*','Contacts','create','List\x20not\x20found','contact','messageId','attach','format','MailInteraction','find','inReplyTo','Contact\x20not\x20found','update','YYYY-MM-DD\x20HH:mm:ss','interaction','get','created','MailMessage','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','Start','startRouting','lodash','util'];(function(_0xdfcef0,_0xde916e){var _0x4e9c7f=function(_0x366922){while(--_0x366922){_0xdfcef0['push'](_0xdfcef0['shift']());}};_0x4e9c7f(++_0xde916e);}(_0x482f,0x1a6));var _0xf482=function(_0x476cbb,_0xadaec){_0x476cbb=_0x476cbb-0x0;var _0xe02938=_0x482f[_0x476cbb];return _0xe02938;};'use strict';var _=require(_0xf482('0x0'));var util=require(_0xf482('0x1'));var moment=require(_0xf482('0x2'));var BPromise=require(_0xf482('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf482('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf482('0x5'))(_0xf482('0x6'));var config=require('../../config/environment');var jayson=require(_0xf482('0x7'));var client=jayson[_0xf482('0x8')][_0xf482('0x9')]({'port':0x232c});config[_0xf482('0xa')]=_[_0xf482('0xb')](config['redis'],{'host':_0xf482('0xc'),'port':0x18eb});var socket=require(_0xf482('0xd'))(new Redis(config[_0xf482('0xa')]));require('./mailAccount.socket')[_0xf482('0xe')](socket);function respondWithRpcPromise(_0x447b5b,_0x569e97,_0x5548d8){return new BPromise(function(_0x30cc4b,_0x441325){return client[_0xf482('0xf')](_0x447b5b,_0x5548d8)[_0xf482('0x10')](function(_0x14104a){logger['info'](_0xf482('0x11'),_0x569e97,_0xf482('0x12'));logger[_0xf482('0x13')](_0xf482('0x14'),_0x569e97,_0xf482('0x12'),JSON['stringify'](_0x14104a));if(_0x14104a['error']){if(_0x14104a[_0xf482('0x15')][_0xf482('0x16')]===0x1f4){logger[_0xf482('0x15')]('MailAccount,\x20%s,\x20%s',_0x569e97,_0x14104a['error']['message']);return _0x441325(_0x14104a[_0xf482('0x15')][_0xf482('0x17')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x569e97,_0x14104a[_0xf482('0x15')]['message']);return _0x30cc4b(_0x14104a['error']['message']);}else{logger[_0xf482('0x18')](_0xf482('0x11'),_0x569e97,_0xf482('0x12'));_0x30cc4b(_0x14104a[_0xf482('0x19')][_0xf482('0x17')]);}})[_0xf482('0x1a')](function(_0xccfc98){logger[_0xf482('0x15')](_0xf482('0x11'),_0x569e97,_0xccfc98);_0x441325(_0xccfc98);});});}exports['GetMailAccount']=function(_0x42e06b){var _0x338681=this;return new Promise(function(_0x1f910d,_0x4a7708){return db[_0xf482('0x1b')][_0xf482('0x1c')]({'raw':_0x42e06b['options']?_0x42e06b[_0xf482('0x1d')][_0xf482('0x1e')]===undefined?!![]:![]:!![],'where':_0x42e06b['options']?_0x42e06b['options']['where']||null:null,'attributes':_0x42e06b['options']?_0x42e06b[_0xf482('0x1d')]['attributes']||null:null,'limit':_0x42e06b[_0xf482('0x1d')]?_0x42e06b[_0xf482('0x1d')][_0xf482('0x1f')]||null:null,'include':_0x42e06b[_0xf482('0x1d')]?_0x42e06b[_0xf482('0x1d')]['include']?_[_0xf482('0x20')](_0x42e06b[_0xf482('0x1d')][_0xf482('0x21')],function(_0x2b64ff){return{'model':db[_0x2b64ff[_0xf482('0x22')]],'as':_0x2b64ff['as'],'attributes':_0x2b64ff[_0xf482('0x23')],'include':_0x2b64ff[_0xf482('0x21')]?_[_0xf482('0x20')](_0x2b64ff[_0xf482('0x21')],function(_0x431fcb){return{'model':db[_0x431fcb[_0xf482('0x22')]],'as':_0x431fcb['as'],'attributes':_0x431fcb[_0xf482('0x23')],'include':_0x431fcb[_0xf482('0x21')]?_[_0xf482('0x20')](_0x431fcb[_0xf482('0x21')],function(_0x5860c7){return{'model':db[_0x5860c7[_0xf482('0x22')]],'as':_0x5860c7['as'],'attributes':_0x5860c7[_0xf482('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf482('0x10')](function(_0x35aadd){logger[_0xf482('0x18')](_0xf482('0x24'),_0x42e06b);logger[_0xf482('0x13')](_0xf482('0x24'),_0x42e06b,JSON[_0xf482('0x25')](_0x35aadd));_0x1f910d(_0x35aadd);})[_0xf482('0x1a')](function(_0x5bbf40){logger['error'](_0xf482('0x24'),_0x5bbf40[_0xf482('0x17')],_0x42e06b);_0x4a7708(_0x338681[_0xf482('0x15')](0x1f4,_0x5bbf40[_0xf482('0x17')]));});});};exports[_0xf482('0x26')]=function(_0x2e1a44){var _0x571c30=this;return new Promise(function(_0x3c591a,_0x54ce2b){return db[_0xf482('0x1b')]['find']({'raw':_0x2e1a44[_0xf482('0x1d')]?_0x2e1a44['options'][_0xf482('0x1e')]===undefined?!![]:![]:!![],'where':_0x2e1a44['options']?_0x2e1a44[_0xf482('0x1d')][_0xf482('0x27')]||null:null,'attributes':_0x2e1a44[_0xf482('0x1d')]?_0x2e1a44[_0xf482('0x1d')]['attributes']||null:null,'include':_0x2e1a44['options']?_0x2e1a44['options']['include']?_[_0xf482('0x20')](_0x2e1a44[_0xf482('0x1d')][_0xf482('0x21')],function(_0xd29578){return{'model':db[_0xd29578[_0xf482('0x22')]],'as':_0xd29578['as'],'attributes':_0xd29578[_0xf482('0x23')],'include':_0xd29578[_0xf482('0x21')]?_['map'](_0xd29578['include'],function(_0x15671f){return{'model':db[_0x15671f['model']],'as':_0x15671f['as'],'attributes':_0x15671f['attributes'],'include':_0x15671f['include']?_[_0xf482('0x20')](_0x15671f['include'],function(_0xe699e8){return{'model':db[_0xe699e8[_0xf482('0x22')]],'as':_0xe699e8['as'],'attributes':_0xe699e8[_0xf482('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf482('0x10')](function(_0x3b9968){logger[_0xf482('0x18')](_0xf482('0x26'),_0x2e1a44);logger[_0xf482('0x13')](_0xf482('0x26'),_0x2e1a44,JSON[_0xf482('0x25')](_0x3b9968));_0x3c591a(_0x3b9968);})[_0xf482('0x1a')](function(_0x40519d){logger[_0xf482('0x15')](_0xf482('0x26'),_0x40519d[_0xf482('0x17')],_0x2e1a44);_0x54ce2b(_0x571c30[_0xf482('0x15')](0x1f4,_0x40519d['message']));});});};exports[_0xf482('0x28')]=function(_0x531e54){var _0x3497d8=this;return new Promise(function(_0x21dcff,_0x55fab1){var _0xe1b5c={'body':_0x531e54[_0xf482('0x29')],'channel':_0xf482('0x2a')};var _0x304145=_[_0xf482('0x2b')](_[_0xf482('0x2c')](db[_0xf482('0x2d')][_0xf482('0x2e')]),[_0xf482('0x2f'),_0xf482('0x30'),_0xf482('0x31'),_0xf482('0x32')]);var _0x475fc7=![];if(_0x531e54['body']['id']){delete _0x531e54[_0xf482('0x29')]['id'];}if(_['isNil'](_0x531e54[_0xf482('0x29')][_0xf482('0x33')])){return _0x55fab1(_0x3497d8[_0xf482('0x15')](0x1f4,_0xf482('0x34')));}if(_[_0xf482('0x35')](_0x531e54['body']['body'])||_0x531e54['body'][_0xf482('0x29')]===''){return _0x55fab1(_0x3497d8[_0xf482('0x15')](0x1f4,_0xf482('0x36')));}if(_[_0xf482('0x35')](_0x531e54['body'][_0xf482('0x37')])){return _0x55fab1(_0x3497d8[_0xf482('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x304145));}if(!_[_0xf482('0x38')](_0x304145,_0x531e54['body'][_0xf482('0x37')])){return _0x55fab1(_0x3497d8[_0xf482('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x304145));}var _0x4ec00e={};_0x4ec00e[_0x531e54[_0xf482('0x29')][_0xf482('0x37')]]=_0x531e54[_0xf482('0x29')]['from'];return db[_0xf482('0x1b')]['find']({'where':{'id':_0x531e54[_0xf482('0x39')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4ec00e,'limit':0x1,'order':[[_0xf482('0x30'),'DESC']]}]},{'model':db[_0xf482('0x3a')],'as':_0xf482('0x3b')},{'model':db[_0xf482('0x3c')],'as':'Smtp'}]})[_0xf482('0x10')](function(_0x34ff3c){if(_0x34ff3c&&_0x34ff3c[_0xf482('0x3d')]){var _0x4e46f5=_0x34ff3c['get']({'plain':!![]});_0xe1b5c['account']=_[_0xf482('0x3e')](_0x4e46f5,[_0xf482('0x3b'),_0xf482('0x3d')]);_0xe1b5c[_0xf482('0x3f')]=_0x4e46f5[_0xf482('0x3b')];_0xe1b5c[_0xf482('0x40')]=_0x4e46f5[_0xf482('0x3d')];_0xe1b5c[_0xf482('0x3f')]=_[_0xf482('0x41')](_0xe1b5c[_0xf482('0x3f')],['priority'],[_0xf482('0x42')]);if(_0xe1b5c['account']&&_0xe1b5c[_0xf482('0x39')][_0xf482('0x43')]){_0xe1b5c[_0xf482('0x3f')][_0xf482('0x44')]({'id':0x0,'priority':_0xe1b5c[_0xf482('0x3f')][_0xf482('0x45')]+0x1,'app':_0xf482('0x46'),'appdata':_0xf482('0x43'),'interval':_0xf482('0x47')});}if(_0xe1b5c[_0xf482('0x39')][_0xf482('0x3b')]){delete _0xe1b5c[_0xf482('0x39')][_0xf482('0x3b')];}if(_0xe1b5c[_0xf482('0x39')][_0xf482('0x3d')]){delete _0xe1b5c['account'][_0xf482('0x3d')];}if(_0x4e46f5[_0xf482('0x3d')][_0xf482('0x48')][_0xf482('0x45')]){return _0x4e46f5[_0xf482('0x3d')][_0xf482('0x48')][0x0];}var _0xfef0ea=_[_0xf482('0xb')](_0x531e54['body'],{'firstName':_0x531e54[_0xf482('0x29')]['from'],'ListId':_0x4e46f5[_0xf482('0x32')]});_0xfef0ea[_0x531e54['body'][_0xf482('0x37')]]=_0x531e54[_0xf482('0x29')][_0xf482('0x33')];return db[_0xf482('0x2d')][_0xf482('0x49')](_0xfef0ea);}else{throw new Error(_0xf482('0x4a'));}})[_0xf482('0x10')](function(_0x1f42a4){_0xe1b5c[_0xf482('0x4b')]=_0x1f42a4;if(_0x1f42a4){if(!_0x531e54[_0xf482('0x29')][_0xf482('0x17')][_0xf482('0x4c')]){_0x531e54[_0xf482('0x29')][_0xf482('0x17')][_0xf482('0x4c')]=rs['generate']()+'\x20'+_0x531e54[_0xf482('0x29')][_0xf482('0x17')]['from'];}var _0x52dfa9={'ContactId':_0x1f42a4['id'],'MailAccountId':_0x531e54[_0xf482('0x39')]['id'],'inReplyTo':_0x531e54['body'][_0xf482('0x17')]['messageId'],'to':_0x531e54[_0xf482('0x29')][_0xf482('0x17')]['from'],'cc':_0x531e54[_0xf482('0x29')][_0xf482('0x17')]['cc'],'subject':_0x531e54[_0xf482('0x29')][_0xf482('0x17')]['subject'],'attach':_0x531e54['body'][_0xf482('0x17')][_0xf482('0x4d')],'lastMsgAt':moment()[_0xf482('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xf482('0x4f')][_0xf482('0x50')]({'where':{'closed':![],'MailAccountId':_0x531e54[_0xf482('0x39')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x531e54[_0xf482('0x29')][_0xf482('0x17')][_0xf482('0x51')]}}]})['then'](function(_0x214f9a){if(_0x214f9a){return[_0x214f9a,![]];}return db[_0xf482('0x4f')][_0xf482('0x49')](_0x52dfa9)[_0xf482('0x10')](function(_0xa4a31e){return[_0xa4a31e,!![]];});});}else{throw new Error(_0xf482('0x52'));}})['spread'](function(_0x421561,_0x4e23b9){if(_0x421561){_0x475fc7=_0x4e23b9;if(!_0x4e23b9){return _0x421561[_0xf482('0x53')]({'inReplyTo':_0x531e54['body'][_0xf482('0x17')][_0xf482('0x4c')],'to':_0x531e54[_0xf482('0x29')][_0xf482('0x17')]['from'],'cc':_0x531e54[_0xf482('0x29')][_0xf482('0x17')]['cc'],'subject':_0x531e54[_0xf482('0x29')][_0xf482('0x17')]['subject'],'attach':_0x421561['attach']?_0x421561[_0xf482('0x4d')]:_0x531e54['body']['message'][_0xf482('0x4d')],'substatus':null,'substatusAt':moment()[_0xf482('0x4e')](_0xf482('0x54')),'lastMsgAt':moment()[_0xf482('0x4e')](_0xf482('0x54')),'lastMsgDirection':'in'});}else{return _0x421561;}}})[_0xf482('0x10')](function(_0x229397){_0xe1b5c[_0xf482('0x55')]=_0x229397[_0xf482('0x56')]({'plain':!![]});_0xe1b5c[_0xf482('0x55')][_0xf482('0x57')]=_0x475fc7;return db[_0xf482('0x58')][_0xf482('0x49')]({'body':_0x531e54[_0xf482('0x29')][_0xf482('0x29')],'MailAccountId':_0x531e54[_0xf482('0x39')]['id'],'MailInteractionId':_0x229397['id'],'direction':'in','ContactId':_0xe1b5c[_0xf482('0x4b')]['id'],'messageId':_0x531e54[_0xf482('0x29')][_0xf482('0x17')][_0xf482('0x4c')],'from':_0x531e54[_0xf482('0x29')]['message'][_0xf482('0x33')],'to':_0x531e54[_0xf482('0x29')][_0xf482('0x17')]['to'],'cc':_0x531e54[_0xf482('0x29')][_0xf482('0x17')]['cc'],'subject':_0x531e54['body'][_0xf482('0x17')]['subject'],'attach':_0x531e54[_0xf482('0x29')][_0xf482('0x17')][_0xf482('0x4d')],'Attachments':_0x531e54[_0xf482('0x29')][_0xf482('0x17')][_0xf482('0x59')],'originTo':_0x531e54[_0xf482('0x29')][_0xf482('0x17')][_0xf482('0x5a')],'originCc':_0x531e54[_0xf482('0x29')]['message'][_0xf482('0x5b')],'bcc':_0x531e54[_0xf482('0x29')]['message'][_0xf482('0x5c')],'ChatWebsiteId':_0x531e54['body'][_0xf482('0x17')][_0xf482('0x5d')]||null,'originChannel':_0x531e54['body'][_0xf482('0x17')][_0xf482('0x5e')]||_0xf482('0x5f'),'ChatOfflineMessageId':_0x531e54[_0xf482('0x29')][_0xf482('0x17')][_0xf482('0x60')]||null},{'include':[{'model':db[_0xf482('0x61')],'as':_0xf482('0x62')}]});})[_0xf482('0x10')](function(_0x1e94be){_0xe1b5c['message']=_0x1e94be;if(_0xe1b5c[_0xf482('0x55')][_0xf482('0x63')]){return db[_0xf482('0x64')][_0xf482('0x50')]({'attributes':['id',_0xf482('0x65')],'where':{'id':_0xe1b5c[_0xf482('0x55')][_0xf482('0x63')]}})[_0xf482('0x10')](function(_0x36f676){if(_0x36f676){_0xe1b5c[_0xf482('0x3f')][_0xf482('0x66')]({'id':0x0,'priority':0x0,'app':_0xf482('0x67'),'appdata':_0x36f676[_0xf482('0x65')]+','+(_0xe1b5c[_0xf482('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0xf482('0x47')});}return respondWithRpcPromise('Start','startRouting',_0xe1b5c);});}return respondWithRpcPromise(_0xf482('0x68'),_0xf482('0x69'),_0xe1b5c);})['then'](function(_0x18199a){_0x21dcff(_0x18199a);})[_0xf482('0x1a')](function(_0x6433ad){_0x55fab1(_0x3497d8[_0xf482('0x15')](0x1f4,_0x6433ad[_0xf482('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 21a0cb8..9c84ca9 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 _0x4af8=['emit','removeListener','length'];(function(_0x49f118,_0x5138e4){var _0x3a0443=function(_0x557a45){while(--_0x557a45){_0x49f118['push'](_0x49f118['shift']());}};_0x3a0443(++_0x5138e4);}(_0x4af8,0x1ad));var _0x84af=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x4af8[_0x6c993a];return _0x27f547;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save','remove','update'];function createListener(_0x10d2d2,_0xd9cfa1){return function(_0x1b876a){_0xd9cfa1[_0x84af('0x0')](_0x10d2d2,_0x1b876a);};}function removeListener(_0x482825,_0x294e04){return function(){MailAccountEvents[_0x84af('0x1')](_0x482825,_0x294e04);};}exports['register']=function(_0x37c4f9){for(var _0x3971f1=0x0,_0x550ee6=events[_0x84af('0x2')];_0x3971f1<_0x550ee6;_0x3971f1++){var _0x294bc8=events[_0x3971f1];var _0x483ecc=createListener('mailAccount:'+_0x294bc8,_0x37c4f9);MailAccountEvents['on'](_0x294bc8,_0x483ecc);}}; \ No newline at end of file +var _0x7257=['register','length','mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0x2bc367,_0x3e1a96){var _0x125800=function(_0x573983){while(--_0x573983){_0x2bc367['push'](_0x2bc367['shift']());}};_0x125800(++_0x3e1a96);}(_0x7257,0x7b));var _0x7725=function(_0x9ea933,_0x565d76){_0x9ea933=_0x9ea933-0x0;var _0x4fdcd0=_0x7257[_0x9ea933];return _0x4fdcd0;};'use strict';var MailAccountEvents=require(_0x7725('0x0'));var events=[_0x7725('0x1'),_0x7725('0x2'),_0x7725('0x3')];function createListener(_0x3b0871,_0x3d34ff){return function(_0x3aba37){_0x3d34ff[_0x7725('0x4')](_0x3b0871,_0x3aba37);};}function removeListener(_0x20e8a5,_0x337e76){return function(){MailAccountEvents['removeListener'](_0x20e8a5,_0x337e76);};}exports[_0x7725('0x5')]=function(_0x190618){for(var _0x67dd44=0x0,_0x2e2ded=events[_0x7725('0x6')];_0x67dd44<_0x2e2ded;_0x67dd44++){var _0xf3e5f3=events[_0x67dd44];var _0x4666b8=createListener(_0x7725('0x7')+_0xf3e5f3,_0x190618);MailAccountEvents['on'](_0xf3e5f3,_0x4666b8);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 5febe07..ff166e9 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 _0x6e0c=['../../config/environment','get','/:id','isAuthenticated','show','put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x465d8c,_0x101ece){var _0x28f93e=function(_0x2584d8){while(--_0x2584d8){_0x465d8c['push'](_0x465d8c['shift']());}};_0x28f93e(++_0x101ece);}(_0x6e0c,0x134));var _0xc6e0=function(_0x595324,_0x5c25fc){_0x595324=_0x595324-0x0;var _0x506510=_0x6e0c[_0x595324];return _0x506510;};'use strict';var multer=require(_0xc6e0('0x0'));var util=require(_0xc6e0('0x1'));var path=require(_0xc6e0('0x2'));var timeout=require(_0xc6e0('0x3'));var express=require('express');var router=express[_0xc6e0('0x4')]();var fs_extra=require(_0xc6e0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc6e0('0x6'));var config=require(_0xc6e0('0x7'));var controller=require('./mailApplication.controller');router[_0xc6e0('0x8')](_0xc6e0('0x9'),auth[_0xc6e0('0xa')](),controller[_0xc6e0('0xb')]);router[_0xc6e0('0xc')](_0xc6e0('0x9'),auth[_0xc6e0('0xa')](),controller['update']);router['delete'](_0xc6e0('0x9'),auth[_0xc6e0('0xa')](),controller[_0xc6e0('0xd')]);module[_0xc6e0('0xe')]=router; \ No newline at end of file +var _0x5378=['destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','put','/:id','delete'];(function(_0x2b9747,_0x78dffc){var _0x3ba264=function(_0x97df6a){while(--_0x97df6a){_0x2b9747['push'](_0x2b9747['shift']());}};_0x3ba264(++_0x78dffc);}(_0x5378,0x13d));var _0x8537=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5378[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x8537('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8537('0x1'));var router=express[_0x8537('0x2')]();var fs_extra=require(_0x8537('0x3'));var auth=require(_0x8537('0x4'));var interaction=require(_0x8537('0x5'));var config=require(_0x8537('0x6'));var controller=require(_0x8537('0x7'));router[_0x8537('0x8')]('/:id',auth[_0x8537('0x9')](),controller['show']);router[_0x8537('0xa')](_0x8537('0xb'),auth[_0x8537('0x9')](),controller['update']);router[_0x8537('0xc')](_0x8537('0xb'),auth[_0x8537('0x9')](),controller[_0x8537('0xd')]);module[_0x8537('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 0513ac3..6a9d50a 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 _0xf5e9=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x3b1f8e,_0x3cbf46){var _0x1a932c=function(_0x2e23bd){while(--_0x2e23bd){_0x3b1f8e['push'](_0x3b1f8e['shift']());}};_0x1a932c(++_0x3cbf46);}(_0xf5e9,0x1b9));var _0x9f5e=function(_0xc3555a,_0x599225){_0xc3555a=_0xc3555a-0x0;var _0x5b6b8a=_0xf5e9[_0xc3555a];return _0x5b6b8a;};'use strict';var Sequelize=require(_0x9f5e('0x0'));module[_0x9f5e('0x1')]={'priority':{'type':Sequelize[_0x9f5e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9f5e('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9f5e('0x4')]()},'description':{'type':Sequelize[_0x9f5e('0x3')]},'interval':{'type':Sequelize[_0x9f5e('0x3')],'defaultValue':_0x9f5e('0x5')}}; \ No newline at end of file +var _0xe6c3=['*,*,*,*','sequelize','exports','INTEGER','TEXT','STRING'];(function(_0x5c0b22,_0x56d46a){var _0x16a8a6=function(_0x268ef6){while(--_0x268ef6){_0x5c0b22['push'](_0x5c0b22['shift']());}};_0x16a8a6(++_0x56d46a);}(_0xe6c3,0x151));var _0x3e6c=function(_0xc720e3,_0xfadccb){_0xc720e3=_0xc720e3-0x0;var _0x310716=_0xe6c3[_0xc720e3];return _0x310716;};'use strict';var Sequelize=require(_0x3e6c('0x0'));module[_0x3e6c('0x1')]={'priority':{'type':Sequelize[_0x3e6c('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3e6c('0x3')]()},'description':{'type':Sequelize[_0x3e6c('0x4')]},'interval':{'type':Sequelize[_0x3e6c('0x4')],'defaultValue':_0x3e6c('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 887a63a..b0d43b9 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 _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x1a12c8,_0x2df4dc){var _0x305109=function(_0x438bfb){while(--_0x438bfb){_0x1a12c8['push'](_0x1a12c8['shift']());}};_0x305109(++_0x2df4dc);}(_0x70e0,0x17b));var _0x070e=function(_0x53806f,_0x1d6115){_0x53806f=_0x53806f-0x0;var _0x36ad40=_0x70e0[_0x53806f];return _0x36ad40;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));}; \ No newline at end of file +var _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x4001ad,_0x1e22dd){var _0x4c7ec2=function(_0x24cb8a){while(--_0x24cb8a){_0x4001ad['push'](_0x4001ad['shift']());}};_0x4c7ec2(++_0x1e22dd);}(_0x70e0,0x17b));var _0x070e=function(_0x3f5720,_0x49d058){_0x3f5720=_0x3f5720-0x0;var _0x4446c6=_0x70e0[_0x3f5720];return _0x4446c6;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 32c4487..9c270f0 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 _0x9f47=['rimraf','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x54e0ce,_0xc469c8){var _0x1e6d82=function(_0x557f13){while(--_0x557f13){_0x54e0ce['push'](_0x54e0ce['shift']());}};_0x1e6d82(++_0xc469c8);}(_0x9f47,0x1ce));var _0x79f4=function(_0x305521,_0x1512fa){_0x305521=_0x305521-0x0;var _0xded8e3=_0x9f47[_0x305521];return _0xded8e3;};'use strict';var _=require(_0x79f4('0x0'));var util=require(_0x79f4('0x1'));var logger=require(_0x79f4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x79f4('0x3'));var rp=require(_0x79f4('0x4'));var fs=require('fs');var path=require(_0x79f4('0x5'));var rimraf=require(_0x79f4('0x6'));var config=require('../../config/environment');var attributes=require(_0x79f4('0x7'));module['exports']=function(_0x4f6412,_0x6a2e22){return _0x4f6412[_0x79f4('0x8')](_0x79f4('0x9'),attributes,{'tableName':_0x79f4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x79f4('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa067=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','MailApplication','mail_applications'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa067,0x1b4));var _0x7a06=function(_0xb07721,_0x1afb65){_0xb07721=_0xb07721-0x0;var _0xaed244=_0xa067[_0xb07721];return _0xaed244;};'use strict';var _=require(_0x7a06('0x0'));var util=require(_0x7a06('0x1'));var logger=require(_0x7a06('0x2'))(_0x7a06('0x3'));var moment=require(_0x7a06('0x4'));var BPromise=require(_0x7a06('0x5'));var rp=require(_0x7a06('0x6'));var fs=require('fs');var path=require(_0x7a06('0x7'));var rimraf=require(_0x7a06('0x8'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module['exports']=function(_0x56875e,_0x1b0c75){return _0x56875e[_0x7a06('0x9')](_0x7a06('0xa'),attributes,{'tableName':_0x7a06('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7a06('0xc'),'collate':_0x7a06('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 41c824f..84d1d14 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 _0xe3f7=['debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','UpdateMailApplication','MailApplication','body','options','raw','attributes','limit','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent'];(function(_0x27a95e,_0x16132e){var _0x2ad2b6=function(_0x484aba){while(--_0x484aba){_0x27a95e['push'](_0x27a95e['shift']());}};_0x2ad2b6(++_0x16132e);}(_0xe3f7,0x1d1));var _0x7e3f=function(_0x3cd793,_0x11dde7){_0x3cd793=_0x3cd793-0x0;var _0x28a1df=_0xe3f7[_0x3cd793];return _0x28a1df;};'use strict';var _=require(_0x7e3f('0x0'));var util=require(_0x7e3f('0x1'));var moment=require(_0x7e3f('0x2'));var BPromise=require('bluebird');var rs=require(_0x7e3f('0x3'));var fs=require('fs');var Redis=require(_0x7e3f('0x4'));var db=require(_0x7e3f('0x5'))['db'];var utils=require(_0x7e3f('0x6'));var logger=require(_0x7e3f('0x7'))(_0x7e3f('0x8'));var config=require(_0x7e3f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7e3f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14120e,_0x494724,_0x14c6a8){return new BPromise(function(_0x1a8821,_0x3b88f1){return client[_0x7e3f('0xb')](_0x14120e,_0x14c6a8)[_0x7e3f('0xc')](function(_0xa42d6d){logger[_0x7e3f('0xd')]('MailApplication,\x20%s,\x20%s',_0x494724,_0x7e3f('0xe'));logger[_0x7e3f('0xf')](_0x7e3f('0x10'),_0x494724,_0x7e3f('0xe'),JSON[_0x7e3f('0x11')](_0xa42d6d));if(_0xa42d6d[_0x7e3f('0x12')]){if(_0xa42d6d[_0x7e3f('0x12')][_0x7e3f('0x13')]===0x1f4){logger['error'](_0x7e3f('0x14'),_0x494724,_0xa42d6d[_0x7e3f('0x12')][_0x7e3f('0x15')]);return _0x3b88f1(_0xa42d6d[_0x7e3f('0x12')]['message']);}logger[_0x7e3f('0x12')]('MailApplication,\x20%s,\x20%s',_0x494724,_0xa42d6d[_0x7e3f('0x12')]['message']);return _0x1a8821(_0xa42d6d['error'][_0x7e3f('0x15')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x494724,'request\x20sent');_0x1a8821(_0xa42d6d['result'][_0x7e3f('0x15')]);}})['catch'](function(_0x409b15){logger[_0x7e3f('0x12')](_0x7e3f('0x14'),_0x494724,_0x409b15);_0x3b88f1(_0x409b15);});});}exports[_0x7e3f('0x16')]=function(_0x37c823){var _0x4a4995=this;return new Promise(function(_0x4c93cc,_0xdf5a7a){return db[_0x7e3f('0x17')]['update'](_0x37c823[_0x7e3f('0x18')],{'raw':_0x37c823[_0x7e3f('0x19')]?_0x37c823[_0x7e3f('0x19')][_0x7e3f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37c823['options']?_0x37c823['options']['where']||null:null,'attributes':_0x37c823[_0x7e3f('0x19')]?_0x37c823[_0x7e3f('0x19')][_0x7e3f('0x1b')]||null:null,'limit':_0x37c823[_0x7e3f('0x19')]?_0x37c823[_0x7e3f('0x19')][_0x7e3f('0x1c')]||null:null})['then'](function(_0xa7065b){logger[_0x7e3f('0xd')]('UpdateMailApplication',_0x37c823);logger['debug'](_0x7e3f('0x16'),_0x37c823,JSON['stringify'](_0xa7065b));_0x4c93cc(_0xa7065b);})[_0x7e3f('0x1d')](function(_0x3b2f40){logger[_0x7e3f('0x12')](_0x7e3f('0x16'),_0x3b2f40['message'],_0x37c823);_0xdf5a7a(_0x4a4995[_0x7e3f('0x12')](0x1f4,_0x3b2f40['message']));});});}; \ No newline at end of file +var _0x0a68=['options','raw','attributes','limit','then','info','UpdateMailApplication','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','MailApplication','body'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0a68,0xd2));var _0x80a6=function(_0x45a81c,_0x510b0d){_0x45a81c=_0x45a81c-0x0;var _0x518135=_0x0a68[_0x45a81c];return _0x518135;};'use strict';var _=require(_0x80a6('0x0'));var util=require(_0x80a6('0x1'));var moment=require('moment');var BPromise=require(_0x80a6('0x2'));var rs=require(_0x80a6('0x3'));var fs=require('fs');var Redis=require(_0x80a6('0x4'));var db=require(_0x80a6('0x5'))['db'];var utils=require(_0x80a6('0x6'));var logger=require(_0x80a6('0x7'))(_0x80a6('0x8'));var config=require(_0x80a6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x80a6('0xa')][_0x80a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8a7496,_0x566d69,_0x55ea1d){return new BPromise(function(_0xf694b7,_0x25f155){return client['request'](_0x8a7496,_0x55ea1d)['then'](function(_0xa0688f){logger['info'](_0x80a6('0xc'),_0x566d69,_0x80a6('0xd'));logger[_0x80a6('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x566d69,_0x80a6('0xd'),JSON[_0x80a6('0xf')](_0xa0688f));if(_0xa0688f[_0x80a6('0x10')]){if(_0xa0688f[_0x80a6('0x10')]['code']===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x566d69,_0xa0688f[_0x80a6('0x10')][_0x80a6('0x11')]);return _0x25f155(_0xa0688f[_0x80a6('0x10')]['message']);}logger[_0x80a6('0x10')]('MailApplication,\x20%s,\x20%s',_0x566d69,_0xa0688f[_0x80a6('0x10')][_0x80a6('0x11')]);return _0xf694b7(_0xa0688f[_0x80a6('0x10')][_0x80a6('0x11')]);}else{logger['info'](_0x80a6('0xc'),_0x566d69,_0x80a6('0xd'));_0xf694b7(_0xa0688f[_0x80a6('0x12')][_0x80a6('0x11')]);}})[_0x80a6('0x13')](function(_0x43add7){logger['error'](_0x80a6('0xc'),_0x566d69,_0x43add7);_0x25f155(_0x43add7);});});}exports['UpdateMailApplication']=function(_0x5d934e){var _0x42c0f6=this;return new Promise(function(_0x44faaa,_0x8dea90){return db[_0x80a6('0x14')]['update'](_0x5d934e[_0x80a6('0x15')],{'raw':_0x5d934e[_0x80a6('0x16')]?_0x5d934e['options'][_0x80a6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d934e[_0x80a6('0x16')]?_0x5d934e[_0x80a6('0x16')]['where']||null:null,'attributes':_0x5d934e['options']?_0x5d934e['options'][_0x80a6('0x18')]||null:null,'limit':_0x5d934e[_0x80a6('0x16')]?_0x5d934e['options'][_0x80a6('0x19')]||null:null})[_0x80a6('0x1a')](function(_0x4ca807){logger[_0x80a6('0x1b')](_0x80a6('0x1c'),_0x5d934e);logger[_0x80a6('0xe')](_0x80a6('0x1c'),_0x5d934e,JSON[_0x80a6('0xf')](_0x4ca807));_0x44faaa(_0x4ca807);})[_0x80a6('0x13')](function(_0x364c82){logger[_0x80a6('0x10')](_0x80a6('0x1c'),_0x364c82[_0x80a6('0x11')],_0x5d934e);_0x8dea90(_0x42c0f6[_0x80a6('0x10')](0x1f4,_0x364c82[_0x80a6('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 02d12cd..64c7932 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 _0xf29d=['express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','tracked','mail','mailinteraction:addtags','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf29d,0x90));var _0xdf29=function(_0x131546,_0x320b29){_0x131546=_0x131546-0x0;var _0x3685e9=_0xf29d[_0x131546];return _0x3685e9;};'use strict';var express=require(_0xdf29('0x0'));var router=express[_0xdf29('0x1')]();var auth=require(_0xdf29('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0xdf29('0x3'));router[_0xdf29('0x4')]('/',auth[_0xdf29('0x5')](),controller['index']);router[_0xdf29('0x4')](_0xdf29('0x6'),auth[_0xdf29('0x5')](),controller[_0xdf29('0x7')]);router['get'](_0xdf29('0x8'),auth[_0xdf29('0x5')](),controller[_0xdf29('0x9')]);router[_0xdf29('0x4')](_0xdf29('0xa'),auth[_0xdf29('0x5')](),controller[_0xdf29('0xb')]);router[_0xdf29('0x4')]('/:id/download',auth[_0xdf29('0x5')](),controller[_0xdf29('0xc')]);router[_0xdf29('0xd')]('/',auth[_0xdf29('0x5')](),controller['create']);router[_0xdf29('0xd')]('/:id/messages',auth[_0xdf29('0x5')](),controller['addMessage']);router['post']('/:id/tags',auth[_0xdf29('0x5')](),interaction[_0xdf29('0xe')](_0xdf29('0xf'),_0xdf29('0x10')),controller['addTags']);router['put'](_0xdf29('0x8'),auth[_0xdf29('0x5')](),interaction[_0xdf29('0xe')](_0xdf29('0xf'),_0xdf29('0x11')),controller[_0xdf29('0x12')]);router[_0xdf29('0x13')](_0xdf29('0x8'),auth['isAuthenticated'](),interaction[_0xdf29('0xe')](_0xdf29('0xf'),_0xdf29('0x14')),controller[_0xdf29('0x15')]);router[_0xdf29('0x13')](_0xdf29('0x16'),auth[_0xdf29('0x5')](),controller[_0xdf29('0x17')]);module['exports']=router; \ No newline at end of file +var _0x2bbc=['delete','mailinteraction:destroy','destroy','/:id/tags','exports','express','Router','isAuthenticated','index','get','describe','show','/:id/messages','/:id/download','post','create','tracked','addTags','/:id','mail','mailinteraction:update','update'];(function(_0x147cfa,_0x5c27bc){var _0x161e6d=function(_0x29702e){while(--_0x29702e){_0x147cfa['push'](_0x147cfa['shift']());}};_0x161e6d(++_0x5c27bc);}(_0x2bbc,0x123));var _0xc2bb=function(_0x5d7adf,_0x57df6c){_0x5d7adf=_0x5d7adf-0x0;var _0x13d079=_0x2bbc[_0x5d7adf];return _0x13d079;};'use strict';var express=require(_0xc2bb('0x0'));var router=express[_0xc2bb('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router['get']('/',auth[_0xc2bb('0x2')](),controller[_0xc2bb('0x3')]);router[_0xc2bb('0x4')]('/describe',auth['isAuthenticated'](),controller[_0xc2bb('0x5')]);router[_0xc2bb('0x4')]('/:id',auth[_0xc2bb('0x2')](),controller[_0xc2bb('0x6')]);router[_0xc2bb('0x4')](_0xc2bb('0x7'),auth[_0xc2bb('0x2')](),controller['getMessages']);router[_0xc2bb('0x4')](_0xc2bb('0x8'),auth[_0xc2bb('0x2')](),controller['download']);router[_0xc2bb('0x9')]('/',auth[_0xc2bb('0x2')](),controller[_0xc2bb('0xa')]);router[_0xc2bb('0x9')]('/:id/messages',auth[_0xc2bb('0x2')](),controller['addMessage']);router[_0xc2bb('0x9')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xc2bb('0xb')]('mail','mailinteraction:addtags'),controller[_0xc2bb('0xc')]);router['put'](_0xc2bb('0xd'),auth[_0xc2bb('0x2')](),interaction['tracked'](_0xc2bb('0xe'),_0xc2bb('0xf')),controller[_0xc2bb('0x10')]);router[_0xc2bb('0x11')](_0xc2bb('0xd'),auth[_0xc2bb('0x2')](),interaction['tracked']('mail',_0xc2bb('0x12')),controller[_0xc2bb('0x13')]);router[_0xc2bb('0x11')](_0xc2bb('0x14'),auth[_0xc2bb('0x2')](),controller['removeTags']);module[_0xc2bb('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 5b3dc8b..f11c68e 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 _0x1be4=['TEXT','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1be4,0x198));var _0x41be=function(_0x153e72,_0x1cde75){_0x153e72=_0x153e72-0x0;var _0x2d060f=_0x1be4[_0x153e72];return _0x2d060f;};'use strict';var Sequelize=require(_0x41be('0x0'));var iconv=require(_0x41be('0x1'));module[_0x41be('0x2')]={'closed':{'type':Sequelize[_0x41be('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x41be('0x4')]},'disposition':{'type':Sequelize[_0x41be('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x41be('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x41be('0x5')](0x1fe)},'to':{'type':Sequelize[_0x41be('0x5')]},'cc':{'type':Sequelize[_0x41be('0x6')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x41be('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x41be('0x4')]},'substatus':{'type':Sequelize[_0x41be('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x41be('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x41be('0x7')]('in',_0x41be('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x41be('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x41be('0x7')]('in',_0x41be('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb9a0=['DATE','STRING','TEXT','long','out','ENUM','sequelize','iconv','exports','BOOLEAN'];(function(_0x3569b1,_0x2c6ac4){var _0x432f51=function(_0x35a51f){while(--_0x35a51f){_0x3569b1['push'](_0x3569b1['shift']());}};_0x432f51(++_0x2c6ac4);}(_0xb9a0,0x146));var _0x0b9a=function(_0xe50651,_0x78b476){_0xe50651=_0xe50651-0x0;var _0xc8931c=_0xb9a0[_0xe50651];return _0xc8931c;};'use strict';var Sequelize=require(_0x0b9a('0x0'));var iconv=require(_0x0b9a('0x1'));module[_0x0b9a('0x2')]={'closed':{'type':Sequelize[_0x0b9a('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0b9a('0x4')]},'disposition':{'type':Sequelize[_0x0b9a('0x5')]},'secondDisposition':{'type':Sequelize[_0x0b9a('0x5')]},'thirdDisposition':{'type':Sequelize[_0x0b9a('0x5')]},'note':{'type':Sequelize[_0x0b9a('0x5')]},'inReplyTo':{'type':Sequelize[_0x0b9a('0x5')](0x1fe)},'to':{'type':Sequelize[_0x0b9a('0x5')]},'cc':{'type':Sequelize[_0x0b9a('0x6')](_0x0b9a('0x7'))},'subject':{'type':Sequelize[_0x0b9a('0x6')]()},'attach':{'type':Sequelize[_0x0b9a('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0b9a('0x4')]},'substatus':{'type':Sequelize[_0x0b9a('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x0b9a('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0b9a('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0b9a('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x0b9a('0x9')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0b9a('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index c681fab..ba18a42 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 _0xb242=['basename','readFileSync','build','writeFileSync','download','unlinkSync','sendStatus','rimraf','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','html-entities','defaults','redis','socket.io-emitter','./mailInteraction.socket','register','status','end','json','undefined','limit','count','offset','set','destroy','name','send','Users','map','fullname','Tags','forEach','push','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','catch','talking','answered','total','closed','UserId','waiting','unmanaged','index','MailInteraction','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','sort','select','field','color','tools_tags','u.fullname','ui.MailInteractionId','from','user_has_mail_interactions','users','u.id\x20=\x20ui.UserId','mail_interactions','left_join','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','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','unreadMessages','`\x20=\x200','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)','ContactId','buildExpression','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','keys','some','compact','isEmpty','where','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','MailAccountId','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','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','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','TagIds','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','all','show','params','includeAll','include','merge','options','create','update','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','MailInteractionId','filter','$gte','format','findAll','inlineCss','rows','addTags','setTags','spread','emit','removeTags','join','files','tmp','root','server','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','get','mkdirSync','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc'];(function(_0x1a87b3,_0x45ba68){var _0x37e84d=function(_0x39f49e){while(--_0x39f49e){_0x1a87b3['push'](_0x1a87b3['shift']());}};_0x37e84d(++_0x45ba68);}(_0xb242,0x1f3));var _0x2b24=function(_0x3b594b,_0x5835c3){_0x3b594b=_0x3b594b-0x0;var _0x1ea5f8=_0xb242[_0x3b594b];return _0x1ea5f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b24('0x0'));var zipdir=require(_0x2b24('0x1'));var moment=require(_0x2b24('0x2'));var BPromise=require(_0x2b24('0x3'));var util=require(_0x2b24('0x4'));var path=require(_0x2b24('0x5'));var fs=require('fs');var _=require(_0x2b24('0x6'));var squel=require('squel');var juice=require('juice');var Redis=require(_0x2b24('0x7'));var qs=require(_0x2b24('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x2b24('0x9'))(_0x2b24('0xa'));var config=require(_0x2b24('0xb'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x2b24('0xc'));config['redis']=_[_0x2b24('0xd')](config[_0x2b24('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x2b24('0xf'))(new Redis(config['redis']));require(_0x2b24('0x10'))[_0x2b24('0x11')](socket);function respondWithStatusCode(_0x5e219d,_0x5d2ef5){_0x5d2ef5=_0x5d2ef5||0xcc;return function(_0x341be1){if(_0x341be1){return _0x5e219d['sendStatus'](_0x5d2ef5);}return _0x5e219d[_0x2b24('0x12')](_0x5d2ef5)[_0x2b24('0x13')]();};}function respondWithResult(_0x2aed32,_0x3917e5){_0x3917e5=_0x3917e5||0xc8;return function(_0x57df0e){if(_0x57df0e){return _0x2aed32['status'](_0x3917e5)[_0x2b24('0x14')](_0x57df0e);}};}function respondWithFilteredResult(_0x42ff81,_0x3d818a){return function(_0x1e44db){if(_0x1e44db){var _0x1a99ea=typeof _0x3d818a['offset']===_0x2b24('0x15')&&typeof _0x3d818a[_0x2b24('0x16')]==='undefined';var _0x38cd5d=_0x1e44db[_0x2b24('0x17')];var _0x486d9a=_0x1a99ea?0x0:_0x3d818a[_0x2b24('0x18')];var _0x46f786=_0x1a99ea?_0x1e44db[_0x2b24('0x17')]:_0x3d818a[_0x2b24('0x18')]+_0x3d818a['limit'];var _0x46c930;if(_0x46f786>=_0x38cd5d){_0x46f786=_0x38cd5d;_0x46c930=0xc8;}else{_0x46c930=0xce;}_0x42ff81[_0x2b24('0x12')](_0x46c930);return _0x42ff81[_0x2b24('0x19')]('Content-Range',_0x486d9a+'-'+_0x46f786+'/'+_0x38cd5d)[_0x2b24('0x14')](_0x1e44db);}return null;};}function saveUpdates(_0xa45843){return function(_0x2e1fa2){if(_0x2e1fa2){return _0x2e1fa2['update'](_0xa45843)['then'](function(_0x30f993){return _0x30f993;});}return null;};}function removeEntity(_0x271827){return function(_0xb6e4f8){if(_0xb6e4f8){return _0xb6e4f8[_0x2b24('0x1a')]()['then'](function(){_0x271827[_0x2b24('0x12')](0xcc)[_0x2b24('0x13')]();});}};}function handleEntityNotFound(_0x1cac48){return function(_0x2b94d3){if(!_0x2b94d3){_0x1cac48['sendStatus'](0x194);}return _0x2b94d3;};}function handleError(_0x504ecf,_0x22c8c5){_0x22c8c5=_0x22c8c5||0x1f4;return function(_0x5d97e1){logger['error'](_0x5d97e1['stack']);if(_0x5d97e1['name']){delete _0x5d97e1[_0x2b24('0x1b')];}_0x504ecf[_0x2b24('0x12')](_0x22c8c5)[_0x2b24('0x1c')](_0x5d97e1);};}function getInteractionUsers(_0x22ab09,_0x5cd375){return new BPromise(function(_0x5042bf,_0x4d25e4){try{if(_0x5cd375[_0x22ab09['id']]){_0x22ab09[_0x2b24('0x1d')]=_[_0x2b24('0x1e')](_0x5cd375[_0x22ab09['id']],function(_0x3abc82){return{'id':_0x3abc82['id'],'fullname':_0x3abc82[_0x2b24('0x1f')]};});}}catch(_0x55fce4){_0x4d25e4(_0x55fce4);}_0x5042bf(_0x22ab09);});}function getInteractionTags(_0x5c9efb,_0x9f8a8d){return new BPromise(function(_0x3bd10a,_0x4e1908){try{if(_0x5c9efb['TagIds']){_0x5c9efb[_0x2b24('0x20')]=[];_0x5c9efb['TagIds']['split'](',')[_0x2b24('0x21')](function(_0x476753){_0x5c9efb[_0x2b24('0x20')][_0x2b24('0x22')](_0x9f8a8d[_0x476753]);});}delete _0x5c9efb['TagIds'];}catch(_0x652aa3){_0x4e1908(_0x652aa3);}_0x3bd10a(_0x5c9efb);});}function getLastMessageText(_0x48fd91){return new BPromise(function(_0x3aa992,_0xe62db0){return db[_0x2b24('0x23')][_0x2b24('0x24')]({'where':{'$and':[{'MailInteractionId':_0x48fd91['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x2b24('0x25')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x2b24('0x26')],'order':_0x2b24('0x27'),'raw':!![]})[_0x2b24('0x28')](function(_0x1cb530){if(_0x1cb530&&_0x1cb530[_0x2b24('0x26')]){_0x48fd91[_0x2b24('0x29')]=_['trimStart'](_0x1cb530[_0x2b24('0x26')]);}_0x3aa992(_0x48fd91);})['catch'](function(_0x19225d){_0xe62db0(_0x19225d);});});}function updateMailInteraction(_0x4eea3d,_0x16bc65,_0x26d9c2,_0x57c6fd){return new BPromise(function(_0xa6d1a,_0x2c489c){return getInteractionUsers(_0x4eea3d,_0x26d9c2)['then'](function(_0x2173e1){return getInteractionTags(_0x2173e1,_0x16bc65);})[_0x2b24('0x28')](function(_0x243ed5){return getStateInteraction(_0x243ed5);})['then'](function(_0x3fb9d0){if(_0x57c6fd){_0xa6d1a(getLastMessageText(_0x3fb9d0));}else{_0xa6d1a(_0x3fb9d0);}})[_0x2b24('0x2a')](function(_0x4b8703){_0x2c489c(_0x4b8703);});});}function getStateInteraction(_0x44d10f){return new BPromise(function(_0x45ddd4){_0x44d10f['waiting']=0x0;_0x44d10f[_0x2b24('0x2b')]=0x0;_0x44d10f[_0x2b24('0x2c')]=0x0;_0x44d10f['unmanaged']=0x0;_0x44d10f[_0x2b24('0x2d')]=0x0;if(!_0x44d10f[_0x2b24('0x2e')]&&!_0x44d10f[_0x2b24('0x2f')]){_0x44d10f['waiting']+=0x1;}if(!_0x44d10f[_0x2b24('0x2e')]&&_0x44d10f[_0x2b24('0x2f')]){_0x44d10f[_0x2b24('0x2b')]+=0x1;if(_0x44d10f[_0x2b24('0x30')]){_0x44d10f['waiting']-=0x1;}}if(_0x44d10f[_0x2b24('0x2e')]&&_0x44d10f[_0x2b24('0x2f')]){_0x44d10f[_0x2b24('0x2c')]+=0x1;if(_0x44d10f[_0x2b24('0x2b')]){_0x44d10f[_0x2b24('0x2b')]-=0x1;}}if(_0x44d10f[_0x2b24('0x2e')]&&!_0x44d10f['UserId']){_0x44d10f[_0x2b24('0x31')]+=0x1;if(_0x44d10f[_0x2b24('0x30')]){_0x44d10f[_0x2b24('0x30')]-=0x1;}}_0x44d10f[_0x2b24('0x2d')]+=0x1;_0x45ddd4(_0x44d10f);});}exports[_0x2b24('0x32')]=function(_0x5e284e,_0x138bd0){var _0x1cc185={},_0x4c9182={},_0xd709c3={'count':0x0,'rows':[]};var _0x36d5c0=_['map'](db[_0x2b24('0x33')][_0x2b24('0x34')],function(_0x2fd258){return{'name':_0x2fd258[_0x2b24('0x35')],'type':_0x2fd258[_0x2b24('0x36')][_0x2b24('0x37')]};});_0x4c9182['model']=_[_0x2b24('0x1e')](_0x36d5c0,_0x2b24('0x1b'));_0x4c9182['query']=_['keys'](_0x5e284e[_0x2b24('0x38')]);_0x4c9182[_0x2b24('0x39')]=_['intersection'](_0x4c9182['model'],_0x4c9182['query']);_0x1cc185['attributes']=_[_0x2b24('0x3a')](_0x4c9182[_0x2b24('0x3b')],qs[_0x2b24('0x3c')](_0x5e284e[_0x2b24('0x38')][_0x2b24('0x3c')]));_0x1cc185[_0x2b24('0x3d')]=_0x1cc185['attributes']['length']?_0x1cc185['attributes']:_0x4c9182[_0x2b24('0x3b')];if(!_0x5e284e[_0x2b24('0x38')][_0x2b24('0x3e')]('nolimit')){_0x1cc185[_0x2b24('0x16')]=qs['limit'](_0x5e284e[_0x2b24('0x38')][_0x2b24('0x16')]);_0x1cc185[_0x2b24('0x18')]=qs[_0x2b24('0x18')](_0x5e284e[_0x2b24('0x38')][_0x2b24('0x18')]);}_0x1cc185['order']=qs[_0x2b24('0x3f')](_0x5e284e[_0x2b24('0x38')][_0x2b24('0x3f')]);_0x1cc185['where']=qs[_0x2b24('0x39')](_['pick'](_0x5e284e[_0x2b24('0x38')],_0x4c9182['filters']),_0x36d5c0);var _0x19d816=[];var _0x12dafe=squel[_0x2b24('0x40')]()[_0x2b24('0x41')]('id')[_0x2b24('0x41')](_0x2b24('0x1b'))[_0x2b24('0x41')](_0x2b24('0x42'))['from'](_0x2b24('0x43'));var _0xb2ebe5=squel[_0x2b24('0x40')]()[_0x2b24('0x41')]('u.id')[_0x2b24('0x41')](_0x2b24('0x44'))[_0x2b24('0x41')](_0x2b24('0x45'))[_0x2b24('0x46')](_0x2b24('0x47'),'ui')['left_join'](_0x2b24('0x48'),'u',_0x2b24('0x49'));var _0x5e8b44=squel[_0x2b24('0x40')]()['from'](_0x2b24('0x4a'),'i')[_0x2b24('0x4b')](_0x2b24('0x4c'),'c',_0x2b24('0x4d'))[_0x2b24('0x4b')](_0x2b24('0x48'),'o',_0x2b24('0x4e'))['left_join'](_0x2b24('0x4f'),'a',_0x2b24('0x50'))[_0x2b24('0x4b')](_0x2b24('0x51'),'me',_0x2b24('0x52'))[_0x2b24('0x4b')]('mail_interaction_has_tags','it',_0x2b24('0x53'))[_0x2b24('0x4b')]('tools_tags','t',_0x2b24('0x54'));var _0x4abba3=squel[_0x2b24('0x55')]();var _0x49db16=[];var _0x21ebc5=squel[_0x2b24('0x55')]();var _0x180ab3;if(_0x5e284e[_0x2b24('0x38')]['search']){_0x180ab3=as['parseSearch'](_0x5e284e[_0x2b24('0x38')][_0x2b24('0x56')]);var _0x4b8463=_0x180ab3[_0x2b24('0x57')];for(var _0x38209a=0x0;_0x38209a<_0x180ab3[_0x2b24('0x58')][_0x2b24('0x59')];_0x38209a++){var _0x22e96f=_0x180ab3[_0x2b24('0x58')][_0x38209a];var _0x22b0af='i';var _0x38b199=_['find'](_0x36d5c0,[_0x2b24('0x1b'),_0x22e96f[_0x2b24('0x41')]]);if(!_0x38b199){switch(_0x22e96f[_0x2b24('0x41')]){case _0x2b24('0x5a'):if(_0x22e96f['value']==0x1){_0x5e8b44['having']('`'+_0x22e96f[_0x2b24('0x41')]+_0x2b24('0x5b'));}else{_0x5e8b44[_0x2b24('0x5c')]('`'+_0x22e96f['field']+_0x2b24('0x5d'));}break;case _0x2b24('0x5e'):if(_0x22e96f[_0x2b24('0x5f')]===_0x2b24('0x60')){if(_0x22e96f[_0x2b24('0x61')][_0x2b24('0x62')]('\x20')[_0x2b24('0x59')]>0x1){_0x4abba3[_0x4b8463](_0x2b24('0x63'),qs['getFullTextValue'](_0x22e96f['value']),null);}else{var _0x2cacb1='%'+_0x22e96f[_0x2b24('0x61')]+'%';_0x4abba3[_0x4b8463]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2cacb1,_0x2cacb1,_0x2cacb1);}}else{_0x38b199=_['find'](_0x36d5c0,[_0x2b24('0x1b'),'ContactId']);_0x22e96f['field']=_0x2b24('0x64');_0x5172d8=as[_0x2b24('0x65')](_0x22b0af,_0x38b199['type'],_0x22e96f);_0x4abba3[_0x4b8463](_0x5172d8[_0x2b24('0x66')],_0x5172d8[_0x2b24('0x61')][_0x2b24('0x67')],_0x5172d8[_0x2b24('0x61')][_0x2b24('0x13')]);}break;case _0x2b24('0x68'):var _0x429ef3=_0x22e96f[_0x2b24('0x61')][_0x2b24('0x62')](',')['map'](function(_0x4d3957){return Number(_0x4d3957);});_0x429ef3[_0x2b24('0x21')](function(_0x3e5d90){_0x21ebc5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3e5d90+',%');});_0x49db16=_[_0x2b24('0x69')](_0x49db16,_0x429ef3);break;case _0x2b24('0x6a'):if(_0x22e96f[_0x2b24('0x5f')]===_0x2b24('0x60')){_0x4abba3[_0x4b8463](_0x2b24('0x6b'),'%'+_0x22e96f[_0x2b24('0x61')]+'%',null);}else{_0x38b199=_[_0x2b24('0x6c')](_0x36d5c0,['name',_0x2b24('0x2f')]);_0x22e96f[_0x2b24('0x41')]=_0x2b24('0x2f');_0x5172d8=as[_0x2b24('0x65')](_0x22b0af,_0x38b199[_0x2b24('0x36')],_0x22e96f);_0x4abba3[_0x4b8463](_0x5172d8[_0x2b24('0x66')],_0x5172d8[_0x2b24('0x61')]['start'],_0x5172d8[_0x2b24('0x61')][_0x2b24('0x13')]);}break;case _0x2b24('0x26'):_0x5172d8=as['buildExpression']('me',null,_0x22e96f);_0x4abba3[_0x4b8463](_0x5172d8[_0x2b24('0x66')],_0x5172d8['value'][_0x2b24('0x67')],_0x5172d8['value'][_0x2b24('0x13')]);break;}}else{var _0x5172d8=as[_0x2b24('0x65')](_0x22b0af,_0x38b199[_0x2b24('0x36')],_0x22e96f);_0x4abba3[_0x4b8463](_0x5172d8[_0x2b24('0x66')],_0x5172d8[_0x2b24('0x61')][_0x2b24('0x67')],_0x5172d8[_0x2b24('0x61')][_0x2b24('0x13')]);}}}else{var _0x3ec532=_(_0x5e284e[_0x2b24('0x38')])[_0x2b24('0x6d')]()['map'](function(_0x20ab72){return _[_0x2b24('0x6e')](_0x36d5c0,[_0x2b24('0x1b'),_0x20ab72])?_0x20ab72:undefined;})[_0x2b24('0x6f')]()[_0x2b24('0x61')]();if(!_[_0x2b24('0x70')](_0x3ec532)){_0x3ec532[_0x2b24('0x21')](function(_0x549c21){if(_0x549c21==='MailAccountId'){_0x5e8b44[_0x2b24('0x71')]('i.MailAccountId\x20IN\x20?',[][_0x2b24('0x72')](_0x5e284e[_0x2b24('0x38')][_0x549c21]));}else if(_0x549c21===_0x2b24('0x73')){var _0x21405e=JSON[_0x2b24('0x74')](_0x5e284e[_0x2b24('0x38')][_0x549c21])['$gte'];var _0x4a7db1=JSON[_0x2b24('0x74')](_0x5e284e[_0x2b24('0x38')][_0x549c21])[_0x2b24('0x75')];_0x5e8b44[_0x2b24('0x71')](_0x2b24('0x76'),_0x21405e,_0x4a7db1);}else{if(_0x5e284e[_0x2b24('0x38')][_0x549c21]===_0x2b24('0x77')){_0x5e8b44[_0x2b24('0x71')]('i.'+_0x549c21+_0x2b24('0x78'));}else{_0x5e8b44[_0x2b24('0x71')]('i.'+_0x549c21+_0x2b24('0x79'),_0x5e284e[_0x2b24('0x38')][_0x549c21]);}}});}if(_0x5e284e['query'][_0x2b24('0x7a')]){if(_0x5e284e[_0x2b24('0x38')][_0x2b24('0x7a')]==0x1){_0x5e8b44[_0x2b24('0x5c')](_0x2b24('0x7b'));}else{_0x5e8b44['having'](_0x2b24('0x7c'));}}if(_0x5e284e[_0x2b24('0x38')][_0x2b24('0x7d')]){_0x49db16=_[_0x2b24('0x7e')](_0x5e284e[_0x2b24('0x38')][_0x2b24('0x7d')])?_0x5e284e[_0x2b24('0x38')][_0x2b24('0x7d')]:new Array(_0x5e284e[_0x2b24('0x38')][_0x2b24('0x7d')]);_0x49db16[_0x2b24('0x21')](function(_0x43e7aa){_0x21ebc5['or'](_0x2b24('0x7f'),'%,'+_0x43e7aa+',%');});}if(_0x5e284e[_0x2b24('0x38')]['filter']){var _0x3f014a=_0x5e284e[_0x2b24('0x38')]['filter'][_0x2b24('0x80')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x2b24('0x81')](_0x3f014a)){_0x4abba3['or'](_0x2b24('0x82'),_0x3f014a+'%');}else if(qs[_0x2b24('0x83')](_0x3f014a)){_0x4abba3['or']('c.email\x20LIKE\x20?',_0x3f014a+'%');}else{_0x4abba3['or'](_0x2b24('0x84'),qs[_0x2b24('0x85')](_0x3f014a))['or'](_0x2b24('0x86'),qs[_0x2b24('0x85')](_0x3f014a));}}}_0x5e8b44[_0x2b24('0x71')](_0x4abba3);_0x5e8b44[_0x2b24('0x87')](_0x2b24('0x88'));var _0x20098c={'type':db['Sequelize'][_0x2b24('0x89')]['SELECT'],'raw':!![]};var _0x48f256=_0x5e8b44['clone']();_0x48f256[_0x2b24('0x41')]('i.id');_0x48f256['field'](_0x2b24('0x8a'),_0x2b24('0x5a'));if(_0x1cc185['order']){_0x1cc185[_0x2b24('0x8b')][_0x2b24('0x21')](function(_0x5d087d){var _0x3d2dc6=_0x5d087d[0x0]===_0x2b24('0x8c')?_0x5d087d[0x0]:'i.'+_0x5d087d[0x0];_0x5e8b44['order'](_0x3d2dc6,_0x5d087d[0x1]===_0x2b24('0x8d')?![]:!![]);});}if(!_[_0x2b24('0x70')](_0x49db16)){_0x5e8b44[_0x2b24('0x5c')](_0x21ebc5);_0x48f256['where'](_0x2b24('0x8e'),_0x49db16);}BPromise[_0x2b24('0x8f')]()[_0x2b24('0x28')](function(){if(!_0x180ab3){if(_0x5e284e[_0x2b24('0x38')]['MailAccountId'])return;_0x48f256['where'](_0x2b24('0x90'));_0x5e8b44[_0x2b24('0x71')](_0x2b24('0x90'));return;}if(_0x5e284e[_0x2b24('0x91')][_0x2b24('0x92')]!==_0x2b24('0x93'))return;return _0x5e284e[_0x2b24('0x91')][_0x2b24('0x94')]({'attributes':['id'],'raw':!![]})[_0x2b24('0x28')](function(_0x4e9d9d){if(_[_0x2b24('0x70')](_0x4e9d9d)){_0x48f256[_0x2b24('0x71')](_0x2b24('0x95'));_0x5e8b44[_0x2b24('0x71')](_0x2b24('0x95'));}else{_0x48f256[_0x2b24('0x71')](_0x2b24('0x96'),_[_0x2b24('0x1e')](_0x4e9d9d,'id'));_0x5e8b44[_0x2b24('0x71')](_0x2b24('0x96'),_[_0x2b24('0x1e')](_0x4e9d9d,'id'));}});})[_0x2b24('0x28')](function(){if(_0x5e284e[_0x2b24('0x91')]['role']===_0x2b24('0x93')&&!_0x180ab3&&!_0x5e284e[_0x2b24('0x38')][_0x2b24('0x97')])return[];return db[_0x2b24('0x98')]['query'](_0x48f256[_0x2b24('0x99')](),_0x20098c);})[_0x2b24('0x28')](function(_0x451b5a){_0xd709c3['count']=_0x451b5a['length'];if(_0xd709c3[_0x2b24('0x17')]===0x0)return[];return db[_0x2b24('0x98')]['query'](_0x12dafe[_0x2b24('0x99')](),_0x20098c)[_0x2b24('0x28')](function(_0x487878){_0x19d816=_[_0x2b24('0x9a')](_0x487878,'id');_0x20098c=_['merge'](_0x20098c,{'model':db[_0x2b24('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5e284e[_0x2b24('0x38')][_0x2b24('0x3c')]){_0x1cc185[_0x2b24('0x3d')][_0x2b24('0x21')](function(_0x4eb8d8){_0x5e8b44[_0x2b24('0x41')]('i.'+_0x4eb8d8);});}else{_0x5e8b44[_0x2b24('0x41')](_0x2b24('0x8a'),_0x2b24('0x5a'));_0x5e8b44[_0x2b24('0x41')]('a.key',_0x2b24('0x9b'));_0x5e8b44[_0x2b24('0x41')](_0x2b24('0x9c'),_0x2b24('0x9d'));_0x5e8b44[_0x2b24('0x41')](_0x2b24('0x9e'),'contactName');_0x5e8b44['field'](_0x2b24('0x88'));_0x5e8b44['field'](_0x2b24('0x9f'));_0x5e8b44['field'](_0x2b24('0xa0'));_0x5e8b44[_0x2b24('0x41')](_0x2b24('0xa1'));_0x5e8b44[_0x2b24('0x41')](_0x2b24('0xa2'));_0x5e8b44['field'](_0x2b24('0xa3'));_0x5e8b44['field'](_0x2b24('0xa4'));_0x5e8b44[_0x2b24('0x41')](_0x2b24('0xa5'));_0x5e8b44['field'](_0x2b24('0xa6'));_0x5e8b44[_0x2b24('0x41')](_0x2b24('0xa7'));_0x5e8b44['field'](_0x2b24('0xa8'));_0x5e8b44[_0x2b24('0x41')](_0x2b24('0xa9'));_0x5e8b44[_0x2b24('0x41')](_0x2b24('0xaa'));_0x5e8b44['field'](_0x2b24('0xab'));_0x5e8b44[_0x2b24('0x41')](_0x2b24('0xac'));_0x5e8b44[_0x2b24('0x41')](_0x2b24('0xad'));_0x5e8b44[_0x2b24('0x41')]('i.UserId');_0x5e8b44['field']('c.firstName',_0x2b24('0xae'));_0x5e8b44['field'](_0x2b24('0xaf'),'Contact.lastName');_0x5e8b44[_0x2b24('0x41')](_0x2b24('0xb0'),_0x2b24('0xb1'));_0x5e8b44['field'](_0x2b24('0xb2'),_0x2b24('0xb3'));_0x5e8b44[_0x2b24('0x41')](_0x2b24('0xb4'),_0x2b24('0xb5'));_0x5e8b44[_0x2b24('0x41')]('c.fax',_0x2b24('0xb6'));_0x5e8b44[_0x2b24('0x41')](_0x2b24('0xb7'),_0x2b24('0xb8'));_0x5e8b44[_0x2b24('0x41')](_0x2b24('0xb9'),_0x2b24('0xba'));_0x5e8b44[_0x2b24('0x41')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2b24('0xbb'));}if(_0x1cc185[_0x2b24('0x16')])_0x5e8b44['limit'](_0x1cc185[_0x2b24('0x16')]);if(_0x1cc185[_0x2b24('0x18')])_0x5e8b44['offset'](_0x1cc185['offset']);return db[_0x2b24('0x98')]['query'](_0x5e8b44[_0x2b24('0x99')](),_0x20098c);})[_0x2b24('0x28')](function(_0x3f9548){if(_0x3f9548[_0x2b24('0x59')]>0x0)_0xb2ebe5[_0x2b24('0x71')](_0x2b24('0xbc'),_[_0x2b24('0x1e')](_0x3f9548,'id'));return db[_0x2b24('0x98')][_0x2b24('0x38')](_0xb2ebe5[_0x2b24('0x99')](),_0x20098c)[_0x2b24('0x28')](function(_0x59ea57){var _0x366109=_[_0x2b24('0xbd')](_0x59ea57,'MailInteractionId');var _0x12b39a=[];return db[_0x2b24('0xbe')][_0x2b24('0x24')]({'attributes':[_0x2b24('0xbf')],'raw':!![]})[_0x2b24('0x28')](function(_0x1934e4){var _0x4ee594=_0x1934e4[_0x2b24('0xbf')];_0x3f9548[_0x2b24('0x21')](function(_0x316aca){_0x12b39a[_0x2b24('0x22')](updateMailInteraction(_0x316aca,_0x19d816,_0x366109,_0x4ee594));});return BPromise[_0x2b24('0xc0')](_0x12b39a);});});});})[_0x2b24('0x28')](function(_0x3a8196){_0xd709c3['rows']=_0x3a8196;return _0xd709c3;})[_0x2b24('0x28')](respondWithFilteredResult(_0x138bd0,_0x1cc185))[_0x2b24('0x2a')](handleError(_0x138bd0,null));};exports[_0x2b24('0xc1')]=function(_0x4b08ca,_0x3b17b8){var _0x22f274={'raw':![],'where':{'id':_0x4b08ca[_0x2b24('0xc2')]['id']}},_0x54105c={};_0x54105c['model']=_[_0x2b24('0x6d')](db[_0x2b24('0x33')][_0x2b24('0x34')]);_0x54105c[_0x2b24('0x38')]=_[_0x2b24('0x6d')](_0x4b08ca[_0x2b24('0x38')]);_0x54105c[_0x2b24('0x39')]=_[_0x2b24('0x3a')](_0x54105c[_0x2b24('0x3b')],_0x54105c[_0x2b24('0x38')]);_0x22f274[_0x2b24('0x3d')]=_['intersection'](_0x54105c[_0x2b24('0x3b')],qs[_0x2b24('0x3c')](_0x4b08ca[_0x2b24('0x38')][_0x2b24('0x3c')]));_0x22f274[_0x2b24('0x3d')]=_0x22f274[_0x2b24('0x3d')][_0x2b24('0x59')]?_0x22f274[_0x2b24('0x3d')]:_0x54105c[_0x2b24('0x3b')];if(_0x4b08ca[_0x2b24('0x38')][_0x2b24('0xc3')]){_0x22f274[_0x2b24('0xc4')]=[{'all':!![]}];}_0x22f274=_[_0x2b24('0xc5')]({},_0x22f274,_0x4b08ca[_0x2b24('0xc6')]);return db[_0x2b24('0x33')]['find'](_0x22f274)[_0x2b24('0x28')](handleEntityNotFound(_0x3b17b8,null))[_0x2b24('0x28')](respondWithResult(_0x3b17b8,null))[_0x2b24('0x2a')](handleError(_0x3b17b8,null));};exports[_0x2b24('0xc7')]=function(_0x506b43,_0x362184){return db[_0x2b24('0x33')][_0x2b24('0xc7')](_0x506b43['body'],{})['then'](respondWithResult(_0x362184,0xc9))[_0x2b24('0x2a')](handleError(_0x362184,null));};exports[_0x2b24('0xc8')]=function(_0x436ceb,_0x335eff){if(_0x436ceb[_0x2b24('0xc9')]['id']){delete _0x436ceb[_0x2b24('0xc9')]['id'];}return db[_0x2b24('0x33')][_0x2b24('0x6c')]({'where':{'id':_0x436ceb[_0x2b24('0xc2')]['id']}})[_0x2b24('0x28')](handleEntityNotFound(_0x335eff,null))[_0x2b24('0x28')](saveUpdates(_0x436ceb[_0x2b24('0xc9')],null))['then'](respondWithResult(_0x335eff,null))[_0x2b24('0x2a')](handleError(_0x335eff,null));};exports[_0x2b24('0x1a')]=function(_0x2cc822,_0x140921){return db[_0x2b24('0x33')][_0x2b24('0x6c')]({'where':{'id':_0x2cc822[_0x2b24('0xc2')]['id']}})['then'](handleEntityNotFound(_0x140921,null))[_0x2b24('0x28')](removeEntity(_0x140921,null))['catch'](handleError(_0x140921,null));};exports[_0x2b24('0xca')]=function(_0x12e9d4,_0x2361e1){return db[_0x2b24('0x33')][_0x2b24('0xca')]()[_0x2b24('0x28')](respondWithResult(_0x2361e1,null))['catch'](handleError(_0x2361e1,null));};exports['addMessage']=function(_0x4ed780,_0x2520e6){return db[_0x2b24('0x23')][_0x2b24('0x6c')]({'where':{'id':_0x4ed780[_0x2b24('0xc2')]['id']}})[_0x2b24('0x28')](handleEntityNotFound(_0x2520e6,null))[_0x2b24('0x28')](function(_0x956ac7){if(_0x956ac7){return _0x956ac7[_0x2b24('0xcb')](_0x4ed780[_0x2b24('0xc9')][_0x2b24('0xcc')],_[_0x2b24('0xcd')](_0x4ed780[_0x2b24('0xc9')],[_0x2b24('0xcc'),'id'])||{});}})[_0x2b24('0x28')](respondWithResult(_0x2520e6,null))['catch'](handleError(_0x2520e6,null));};exports[_0x2b24('0xce')]=function(_0x4c22b0,_0x157832){var _0x2f69fa={'raw':![],'where':{}};var _0xff7872={};var _0x48cdef={'count':0x0,'rows':[]};return db[_0x2b24('0x33')][_0x2b24('0x24')]({'where':{'id':_0x4c22b0[_0x2b24('0xc2')]['id']}})[_0x2b24('0x28')](handleEntityNotFound(_0x157832,null))[_0x2b24('0x28')](function(_0x1df838){if(_0x1df838){_0xff7872[_0x2b24('0x3b')]=_[_0x2b24('0x6d')](db['MailMessage'][_0x2b24('0x34')]);_0xff7872[_0x2b24('0x38')]=_[_0x2b24('0x6d')](_0x4c22b0['query']);_0xff7872[_0x2b24('0x39')]=_[_0x2b24('0x3a')](_0xff7872[_0x2b24('0x3b')],_0xff7872[_0x2b24('0x38')]);_0x2f69fa[_0x2b24('0x3d')]=_[_0x2b24('0x3a')](_0xff7872['model'],qs[_0x2b24('0x3c')](_0x4c22b0[_0x2b24('0x38')]['fields']));_0x2f69fa[_0x2b24('0x3d')]=_0x2f69fa['attributes'][_0x2b24('0x59')]?_0x2f69fa[_0x2b24('0x3d')]:_0xff7872[_0x2b24('0x3b')];if(!_0x4c22b0[_0x2b24('0x38')][_0x2b24('0x3e')](_0x2b24('0xcf'))){_0x2f69fa[_0x2b24('0x16')]=qs['limit'](_0x4c22b0[_0x2b24('0x38')][_0x2b24('0x16')]);_0x2f69fa[_0x2b24('0x18')]=qs[_0x2b24('0x18')](_0x4c22b0[_0x2b24('0x38')]['offset']);}_0x2f69fa['order']=qs['sort'](_0x4c22b0[_0x2b24('0x38')][_0x2b24('0x3f')]);_0x2f69fa[_0x2b24('0x71')]=qs[_0x2b24('0x39')](_[_0x2b24('0xd0')](_0x4c22b0[_0x2b24('0x38')],_0xff7872[_0x2b24('0x39')]));_0x2f69fa[_0x2b24('0x71')][_0x2b24('0xd1')]=_0x1df838['id'];if(_0x4c22b0['query'][_0x2b24('0xd2')]){_0x2f69fa[_0x2b24('0x71')]=_[_0x2b24('0xc5')](_0x2f69fa['where'],{'$or':_[_0x2b24('0x1e')](_0x2f69fa[_0x2b24('0x3d')],function(_0xcc7793){var _0x53ccbb={};_0x53ccbb[_0xcc7793]={'$like':'%'+_0x4c22b0['query'][_0x2b24('0xd2')]+'%'};return _0x53ccbb;})});}if(_0x4c22b0['query'][_0x2b24('0xd3')]){var _0x45b7d8=_0x4c22b0[_0x2b24('0x38')]['$gte'][_0x2b24('0x62')](',');var _0x232c4d={};_0x232c4d[_0x45b7d8[0x0]]={'$gte':moment(_0x45b7d8[0x1])[_0x2b24('0xd4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2f69fa[_0x2b24('0x71')]=_[_0x2b24('0xc5')](_0x2f69fa[_0x2b24('0x71')],_0x232c4d);}_0x2f69fa=_['merge']({},_0x2f69fa,_0x4c22b0['options']);return db['MailMessage'][_0x2b24('0x17')]({'where':_0x2f69fa[_0x2b24('0x71')]})[_0x2b24('0x28')](function(_0x138145){_0x48cdef[_0x2b24('0x17')]=_0x138145;if(_0x4c22b0[_0x2b24('0x38')]['includeAll']){_0x2f69fa['include']=[{'all':!![]}];}return db[_0x2b24('0x23')][_0x2b24('0xd5')](_0x2f69fa);})[_0x2b24('0x28')](function(_0x27df3e){if(_0x4c22b0['query'][_0x2b24('0xd6')]==='true'){for(var _0x59c85d=0x0;_0x59c85d<_0x27df3e[_0x2b24('0x59')];_0x59c85d++){_0x27df3e[_0x59c85d][_0x2b24('0xc9')]=juice(_0x27df3e[_0x59c85d][_0x2b24('0xc9')]);}}_0x48cdef[_0x2b24('0xd7')]=_0x27df3e;return _0x48cdef;});}})[_0x2b24('0x28')](respondWithFilteredResult(_0x157832,_0x2f69fa))[_0x2b24('0x2a')](handleError(_0x157832,null));};exports[_0x2b24('0xd8')]=function(_0x10e192,_0x4183c9){return db['MailInteraction'][_0x2b24('0x6c')]({'where':{'id':_0x10e192[_0x2b24('0xc2')]['id']}})[_0x2b24('0x28')](handleEntityNotFound(_0x4183c9,null))[_0x2b24('0x28')](function(_0x14d1eb){if(_0x14d1eb){return _0x14d1eb[_0x2b24('0xd9')](_0x10e192[_0x2b24('0xc9')][_0x2b24('0xcc')],_[_0x2b24('0xcd')](_0x10e192['body'],[_0x2b24('0xcc'),'id'])||{})[_0x2b24('0xda')](function(){return db[_0x2b24('0x68')]['findAll']({'attributes':['id',_0x2b24('0x1b'),_0x2b24('0x42')],'where':{'id':_0x10e192['body'][_0x2b24('0xcc')]}});})[_0x2b24('0x28')](function(_0x508a30){socket[_0x2b24('0xdb')]('mailInteractionTags:save',{'id':Number(_0x10e192['params']['id']),'tags':_0x508a30||[]});return{'id':Number(_0x10e192[_0x2b24('0xc2')]['id']),'tags':_0x508a30||[]};});}})[_0x2b24('0x28')](respondWithResult(_0x4183c9,null))[_0x2b24('0x2a')](handleError(_0x4183c9,null));};exports[_0x2b24('0xdc')]=function(_0x963c91,_0x43680e){return db[_0x2b24('0x33')][_0x2b24('0x6c')]({'where':{'id':_0x963c91[_0x2b24('0xc2')]['id']}})[_0x2b24('0x28')](handleEntityNotFound(_0x43680e,null))[_0x2b24('0x28')](function(_0x25e42c){if(_0x25e42c){return _0x25e42c[_0x2b24('0xdc')](_0x963c91[_0x2b24('0x38')]['ids']);}})['then'](respondWithStatusCode(_0x43680e,null))[_0x2b24('0x2a')](handleError(_0x43680e,null));};exports['download']=function(_0x616cd1,_0x24083c){var _0x1d9b94=moment()['unix']()[_0x2b24('0x99')]();var _0x440f3b=path[_0x2b24('0xdd')](config['root'],'server',_0x2b24('0xde'),_0x2b24('0xdf'));var _0x9eaa92=path['join'](config[_0x2b24('0xe0')],_0x2b24('0xe1'),_0x2b24('0xde'),_0x2b24('0xe2'));var _0x3ac4ab=path['join'](_0x440f3b,_0x1d9b94);var _0x32fbde=util['format'](_0x2b24('0xe3'),_0x616cd1['params']['id'],_0x1d9b94);var _0x6e520b=path['join'](_0x440f3b,_0x32fbde);var _0x1822a8=[];if(_0x616cd1[_0x2b24('0x38')][_0x2b24('0xe2')]){_0x1822a8[_0x2b24('0x22')]({'model':db[_0x2b24('0xe4')],'as':_0x2b24('0xe5'),'raw':!![]});}var _0x13293a=[{'model':db[_0x2b24('0x23')],'as':_0x2b24('0xe6'),'attributes':['id',_0x2b24('0xc9'),_0x2b24('0x46'),'to','cc',_0x2b24('0xe7'),'subject',_0x2b24('0x73')],'where':{'secret':![]},'order':qs[_0x2b24('0x3f')]('id'),'include':_0x1822a8}];return db[_0x2b24('0x33')][_0x2b24('0x6c')]({'where':{'id':_0x616cd1[_0x2b24('0xc2')]['id']},'include':_0x13293a})[_0x2b24('0x28')](handleEntityNotFound(_0x24083c,null))[_0x2b24('0x28')](function(_0x1083d0){if(_0x1083d0&&_0x1083d0[_0x2b24('0xe6')]){var _0x5a2c13=_0x1083d0[_0x2b24('0xe8')]({'plain':!![]});fs[_0x2b24('0xe9')](_0x3ac4ab);return BPromise['each'](_0x5a2c13['Messages'],function(_0xc853c2,_0x1b0612){var _0x3091c8={'from':_0xc853c2['from'],'to':_0xc853c2['to'],'subject':_0xc853c2[_0x2b24('0xea')],'html':htmlEntities[_0x2b24('0xeb')](_0xc853c2[_0x2b24('0xc9')]),'headers':{'Date':moment(_0xc853c2[_0x2b24('0x73')])['format'](_0x2b24('0xec'))},'attachments':[]};if(_0xc853c2['cc']){_0x3091c8[_0x2b24('0xed')]['Cc']=_0xc853c2['cc'];}if(_0xc853c2[_0x2b24('0xe7')]){_0x3091c8['headers'][_0x2b24('0xee')]=_0xc853c2[_0x2b24('0xe7')];}return new BPromise(function(_0x2ac118,_0xedafab){if(_0xc853c2['Attachments']){for(var _0x324494=0x0;_0x324494<_0xc853c2[_0x2b24('0xe5')][_0x2b24('0x59')];_0x324494++){var _0x1a91ba=_0xc853c2[_0x2b24('0xe5')][_0x324494];var _0x58e05b=path[_0x2b24('0xdd')](_0x9eaa92,_0x1a91ba[_0x2b24('0xef')]);if(fs['existsSync'](_0x58e05b)){_0x3091c8[_0x2b24('0xe2')][_0x2b24('0x22')]({'name':_0x1a91ba[_0x2b24('0x1b')],'contentType':_0x1a91ba[_0x2b24('0x36')],'data':fs[_0x2b24('0xf0')](_0x58e05b)});}}}emlformat[_0x2b24('0xf1')](_0x3091c8,function(_0x3f29ed,_0x59f5fb){if(_0x3f29ed)return _0xedafab(_0x3f29ed);fs[_0x2b24('0xf2')](path[_0x2b24('0xdd')](_0x3ac4ab,util['format']('message%d.eml',_0x1b0612)),_0x59f5fb);return _0x2ac118(_0x59f5fb);});});})[_0x2b24('0x28')](function(){return new BPromise(function(_0x8083c1,_0x575ed3){zipdir(_0x3ac4ab,{'saveTo':_0x6e520b},function(_0x5ea730,_0x48e385){if(_0x5ea730)return _0x575ed3(_0x5ea730);return _0x8083c1(_0x48e385);});})['then'](function(){return new BPromise(function(_0x39fcb7,_0x1491cc){rimraf(_0x3ac4ab,function(_0x4fb75e){if(_0x4fb75e)_0x1491cc(_0x4fb75e);return _0x39fcb7();});});})['then'](function(){return _0x24083c[_0x2b24('0xf3')](_0x6e520b,_0x32fbde,function(_0x1c89b8){if(!_0x1c89b8)fs[_0x2b24('0xf4')](_0x6e520b);});});});}else{return _0x24083c[_0x2b24('0xf5')](0xc8);}})[_0x2b24('0x2a')](handleError(_0x24083c,null));}; \ No newline at end of file +var _0x0d4d=['i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.ContactId','i.MailAccountId','Contact.firstName','c.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','spread','emit','mailInteractionTags:save','removeTags','join','tmp','root','server','files','attachments','transcript-%d-%s.zip','Attachments','Messages','bcc','subject','createdAt','get','mkdirSync','each','decode','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','lodash','juice','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','then','destroy','error','stack','name','Users','fullname','TagIds','split','forEach','Tags','push','MailMessage','findOne','out','plainBody','-id','trimStart','catch','talking','answered','unmanaged','closed','UserId','waiting','total','index','map','MailInteraction','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','field','tools_tags','select','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','t.id\x20=\x20it.TagId','search','sqlOperator','length','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys','some','MailAccountId','i.MailAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','SELECT','clone','contactName','isEmpty','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','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','i.id','i.updatedAt','i.closed','i.closedAt','i.attach'];(function(_0x154983,_0xc29edf){var _0x3d1243=function(_0x5cb7a4){while(--_0x5cb7a4){_0x154983['push'](_0x154983['shift']());}};_0x3d1243(++_0xc29edf);}(_0x0d4d,0x132));var _0xd0d4=function(_0x14aea2,_0x3e4017){_0x14aea2=_0x14aea2-0x0;var _0x519265=_0x0d4d[_0x14aea2];return _0x519265;};'use strict';var emlformat=require(_0xd0d4('0x0'));var rimraf=require(_0xd0d4('0x1'));var zipdir=require(_0xd0d4('0x2'));var moment=require(_0xd0d4('0x3'));var BPromise=require(_0xd0d4('0x4'));var util=require(_0xd0d4('0x5'));var path=require('path');var fs=require('fs');var _=require(_0xd0d4('0x6'));var squel=require('squel');var juice=require(_0xd0d4('0x7'));var Redis=require(_0xd0d4('0x8'));var qs=require('../../components/parsers/qs');var as=require(_0xd0d4('0x9'));var logger=require(_0xd0d4('0xa'))(_0xd0d4('0xb'));var config=require('../../config/environment');var db=require(_0xd0d4('0xc'))['db'];var htmlEntities=require('html-entities');config[_0xd0d4('0xd')]=_['defaults'](config[_0xd0d4('0xd')],{'host':_0xd0d4('0xe'),'port':0x18eb});var socket=require(_0xd0d4('0xf'))(new Redis(config['redis']));require(_0xd0d4('0x10'))[_0xd0d4('0x11')](socket);function respondWithStatusCode(_0x2a9607,_0xe102db){_0xe102db=_0xe102db||0xcc;return function(_0x1be3fd){if(_0x1be3fd){return _0x2a9607[_0xd0d4('0x12')](_0xe102db);}return _0x2a9607['status'](_0xe102db)[_0xd0d4('0x13')]();};}function respondWithResult(_0x37ac04,_0x29ee49){_0x29ee49=_0x29ee49||0xc8;return function(_0x2ddeca){if(_0x2ddeca){return _0x37ac04[_0xd0d4('0x14')](_0x29ee49)[_0xd0d4('0x15')](_0x2ddeca);}};}function respondWithFilteredResult(_0x583c05,_0x3dc332){return function(_0x2131c8){if(_0x2131c8){var _0x10a175=typeof _0x3dc332['offset']==='undefined'&&typeof _0x3dc332[_0xd0d4('0x16')]===_0xd0d4('0x17');var _0x553b47=_0x2131c8[_0xd0d4('0x18')];var _0x1e8608=_0x10a175?0x0:_0x3dc332['offset'];var _0x5d7e66=_0x10a175?_0x2131c8[_0xd0d4('0x18')]:_0x3dc332[_0xd0d4('0x19')]+_0x3dc332[_0xd0d4('0x16')];var _0x5079d5;if(_0x5d7e66>=_0x553b47){_0x5d7e66=_0x553b47;_0x5079d5=0xc8;}else{_0x5079d5=0xce;}_0x583c05['status'](_0x5079d5);return _0x583c05['set'](_0xd0d4('0x1a'),_0x1e8608+'-'+_0x5d7e66+'/'+_0x553b47)[_0xd0d4('0x15')](_0x2131c8);}return null;};}function saveUpdates(_0x1e8409){return function(_0x5de0e2){if(_0x5de0e2){return _0x5de0e2['update'](_0x1e8409)[_0xd0d4('0x1b')](function(_0x4b3b77){return _0x4b3b77;});}return null;};}function removeEntity(_0x2e6bbf){return function(_0x272580){if(_0x272580){return _0x272580[_0xd0d4('0x1c')]()['then'](function(){_0x2e6bbf[_0xd0d4('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x522f30){return function(_0x3e7c4e){if(!_0x3e7c4e){_0x522f30[_0xd0d4('0x12')](0x194);}return _0x3e7c4e;};}function handleError(_0x49b6f0,_0x50f959){_0x50f959=_0x50f959||0x1f4;return function(_0x8b0b9f){logger[_0xd0d4('0x1d')](_0x8b0b9f[_0xd0d4('0x1e')]);if(_0x8b0b9f[_0xd0d4('0x1f')]){delete _0x8b0b9f[_0xd0d4('0x1f')];}_0x49b6f0[_0xd0d4('0x14')](_0x50f959)['send'](_0x8b0b9f);};}function getInteractionUsers(_0x2d3346,_0x504a21){return new BPromise(function(_0x3ef814,_0x1b03ef){try{if(_0x504a21[_0x2d3346['id']]){_0x2d3346[_0xd0d4('0x20')]=_['map'](_0x504a21[_0x2d3346['id']],function(_0x4f2d3c){return{'id':_0x4f2d3c['id'],'fullname':_0x4f2d3c[_0xd0d4('0x21')]};});}}catch(_0x4e7cc1){_0x1b03ef(_0x4e7cc1);}_0x3ef814(_0x2d3346);});}function getInteractionTags(_0x50e7f0,_0xfc8035){return new BPromise(function(_0x29948c,_0x324fd5){try{if(_0x50e7f0[_0xd0d4('0x22')]){_0x50e7f0['Tags']=[];_0x50e7f0[_0xd0d4('0x22')][_0xd0d4('0x23')](',')[_0xd0d4('0x24')](function(_0x22e142){_0x50e7f0[_0xd0d4('0x25')][_0xd0d4('0x26')](_0xfc8035[_0x22e142]);});}delete _0x50e7f0[_0xd0d4('0x22')];}catch(_0x266b91){_0x324fd5(_0x266b91);}_0x29948c(_0x50e7f0);});}function getLastMessageText(_0x7bc460){return new BPromise(function(_0x5533f1,_0x2a04ea){return db[_0xd0d4('0x27')][_0xd0d4('0x28')]({'where':{'$and':[{'MailInteractionId':_0x7bc460['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd0d4('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xd0d4('0x2a')],'order':_0xd0d4('0x2b'),'raw':!![]})['then'](function(_0x5aa0b3){if(_0x5aa0b3&&_0x5aa0b3[_0xd0d4('0x2a')]){_0x7bc460['lastMsgText']=_[_0xd0d4('0x2c')](_0x5aa0b3[_0xd0d4('0x2a')]);}_0x5533f1(_0x7bc460);})[_0xd0d4('0x2d')](function(_0x446763){_0x2a04ea(_0x446763);});});}function updateMailInteraction(_0x1548db,_0x26c577,_0x16804f,_0x54d940){return new BPromise(function(_0x50fe05,_0x1a1733){return getInteractionUsers(_0x1548db,_0x16804f)[_0xd0d4('0x1b')](function(_0x5d148e){return getInteractionTags(_0x5d148e,_0x26c577);})[_0xd0d4('0x1b')](function(_0x4ac760){return getStateInteraction(_0x4ac760);})['then'](function(_0x151aa3){if(_0x54d940){_0x50fe05(getLastMessageText(_0x151aa3));}else{_0x50fe05(_0x151aa3);}})[_0xd0d4('0x2d')](function(_0x3fd1b1){_0x1a1733(_0x3fd1b1);});});}function getStateInteraction(_0x26a080){return new BPromise(function(_0x5011dd){_0x26a080['waiting']=0x0;_0x26a080[_0xd0d4('0x2e')]=0x0;_0x26a080[_0xd0d4('0x2f')]=0x0;_0x26a080[_0xd0d4('0x30')]=0x0;_0x26a080['total']=0x0;if(!_0x26a080[_0xd0d4('0x31')]&&!_0x26a080[_0xd0d4('0x32')]){_0x26a080[_0xd0d4('0x33')]+=0x1;}if(!_0x26a080[_0xd0d4('0x31')]&&_0x26a080[_0xd0d4('0x32')]){_0x26a080[_0xd0d4('0x2e')]+=0x1;if(_0x26a080[_0xd0d4('0x33')]){_0x26a080[_0xd0d4('0x33')]-=0x1;}}if(_0x26a080['closed']&&_0x26a080[_0xd0d4('0x32')]){_0x26a080['answered']+=0x1;if(_0x26a080['talking']){_0x26a080[_0xd0d4('0x2e')]-=0x1;}}if(_0x26a080['closed']&&!_0x26a080[_0xd0d4('0x32')]){_0x26a080[_0xd0d4('0x30')]+=0x1;if(_0x26a080[_0xd0d4('0x33')]){_0x26a080[_0xd0d4('0x33')]-=0x1;}}_0x26a080[_0xd0d4('0x34')]+=0x1;_0x5011dd(_0x26a080);});}exports[_0xd0d4('0x35')]=function(_0x560e77,_0xc6d50a){var _0x182934={},_0x548a80={},_0x554885={'count':0x0,'rows':[]};var _0x19c4cf=_[_0xd0d4('0x36')](db[_0xd0d4('0x37')]['rawAttributes'],function(_0x125115){return{'name':_0x125115[_0xd0d4('0x38')],'type':_0x125115[_0xd0d4('0x39')][_0xd0d4('0x3a')]};});_0x548a80[_0xd0d4('0x3b')]=_[_0xd0d4('0x36')](_0x19c4cf,_0xd0d4('0x1f'));_0x548a80[_0xd0d4('0x3c')]=_['keys'](_0x560e77[_0xd0d4('0x3c')]);_0x548a80[_0xd0d4('0x3d')]=_[_0xd0d4('0x3e')](_0x548a80['model'],_0x548a80[_0xd0d4('0x3c')]);_0x182934[_0xd0d4('0x3f')]=_['intersection'](_0x548a80[_0xd0d4('0x3b')],qs[_0xd0d4('0x40')](_0x560e77[_0xd0d4('0x3c')][_0xd0d4('0x40')]));_0x182934[_0xd0d4('0x3f')]=_0x182934[_0xd0d4('0x3f')]['length']?_0x182934[_0xd0d4('0x3f')]:_0x548a80[_0xd0d4('0x3b')];if(!_0x560e77[_0xd0d4('0x3c')][_0xd0d4('0x41')]('nolimit')){_0x182934[_0xd0d4('0x16')]=qs[_0xd0d4('0x16')](_0x560e77[_0xd0d4('0x3c')][_0xd0d4('0x16')]);_0x182934[_0xd0d4('0x19')]=qs[_0xd0d4('0x19')](_0x560e77[_0xd0d4('0x3c')]['offset']);}_0x182934[_0xd0d4('0x42')]=qs[_0xd0d4('0x43')](_0x560e77['query'][_0xd0d4('0x43')]);_0x182934[_0xd0d4('0x44')]=qs[_0xd0d4('0x3d')](_[_0xd0d4('0x45')](_0x560e77[_0xd0d4('0x3c')],_0x548a80[_0xd0d4('0x3d')]),_0x19c4cf);var _0x580c97=[];var _0x4761fd=squel['select']()[_0xd0d4('0x46')]('id')[_0xd0d4('0x46')]('name')[_0xd0d4('0x46')]('color')['from'](_0xd0d4('0x47'));var _0x52ff40=squel[_0xd0d4('0x48')]()[_0xd0d4('0x46')]('u.id')[_0xd0d4('0x46')]('u.fullname')[_0xd0d4('0x46')](_0xd0d4('0x49'))[_0xd0d4('0x4a')](_0xd0d4('0x4b'),'ui')[_0xd0d4('0x4c')](_0xd0d4('0x4d'),'u',_0xd0d4('0x4e'));var _0x13d2ba=squel[_0xd0d4('0x48')]()['from']('mail_interactions','i')[_0xd0d4('0x4c')](_0xd0d4('0x4f'),'c',_0xd0d4('0x50'))[_0xd0d4('0x4c')](_0xd0d4('0x4d'),'o',_0xd0d4('0x51'))[_0xd0d4('0x4c')](_0xd0d4('0x52'),'a',_0xd0d4('0x53'))['left_join'](_0xd0d4('0x54'),'me','me.MailInteractionId\x20=\x20i.id')['left_join'](_0xd0d4('0x55'),'it','it.MailInteractionId\x20=\x20i.id')[_0xd0d4('0x4c')](_0xd0d4('0x47'),'t',_0xd0d4('0x56'));var _0x41f2b1=squel['expr']();var _0x4134cc=[];var _0x350e06=squel['expr']();var _0x1ac91f;if(_0x560e77[_0xd0d4('0x3c')][_0xd0d4('0x57')]){_0x1ac91f=as['parseSearch'](_0x560e77[_0xd0d4('0x3c')]['search']);var _0xc5047e=_0x1ac91f[_0xd0d4('0x58')];for(var _0x45325e=0x0;_0x45325e<_0x1ac91f['conditions'][_0xd0d4('0x59')];_0x45325e++){var _0x3518a4=_0x1ac91f[_0xd0d4('0x5a')][_0x45325e];var _0x2306ed='i';var _0x359261=_[_0xd0d4('0x5b')](_0x19c4cf,[_0xd0d4('0x1f'),_0x3518a4[_0xd0d4('0x46')]]);if(!_0x359261){switch(_0x3518a4[_0xd0d4('0x46')]){case _0xd0d4('0x5c'):if(_0x3518a4[_0xd0d4('0x5d')]==0x1){_0x13d2ba['having']('`'+_0x3518a4[_0xd0d4('0x46')]+_0xd0d4('0x5e'));}else{_0x13d2ba[_0xd0d4('0x5f')]('`'+_0x3518a4['field']+_0xd0d4('0x60'));}break;case _0xd0d4('0x61'):if(_0x3518a4['operator']===_0xd0d4('0x62')){if(_0x3518a4[_0xd0d4('0x5d')][_0xd0d4('0x23')]('\x20')[_0xd0d4('0x59')]>0x1){_0x41f2b1[_0xc5047e](_0xd0d4('0x63'),qs['getFullTextValue'](_0x3518a4[_0xd0d4('0x5d')]),null);}else{var _0x41968a='%'+_0x3518a4[_0xd0d4('0x5d')]+'%';_0x41f2b1[_0xc5047e]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x41968a,_0x41968a,_0x41968a);}}else{_0x359261=_[_0xd0d4('0x5b')](_0x19c4cf,[_0xd0d4('0x1f'),_0xd0d4('0x64')]);_0x3518a4[_0xd0d4('0x46')]=_0xd0d4('0x64');_0x433b24=as[_0xd0d4('0x65')](_0x2306ed,_0x359261[_0xd0d4('0x39')],_0x3518a4);_0x41f2b1[_0xc5047e](_0x433b24[_0xd0d4('0x66')],_0x433b24[_0xd0d4('0x5d')][_0xd0d4('0x67')],_0x433b24[_0xd0d4('0x5d')]['end']);}break;case _0xd0d4('0x68'):var _0x55718e=_0x3518a4['value'][_0xd0d4('0x23')](',')[_0xd0d4('0x36')](function(_0x3beff5){return Number(_0x3beff5);});_0x55718e[_0xd0d4('0x24')](function(_0x2e1c49){_0x350e06['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2e1c49+',%');});_0x4134cc=_[_0xd0d4('0x69')](_0x4134cc,_0x55718e);break;case _0xd0d4('0x6a'):if(_0x3518a4[_0xd0d4('0x6b')]===_0xd0d4('0x62')){_0x41f2b1[_0xc5047e](_0xd0d4('0x6c'),'%'+_0x3518a4[_0xd0d4('0x5d')]+'%',null);}else{_0x359261=_[_0xd0d4('0x5b')](_0x19c4cf,[_0xd0d4('0x1f'),_0xd0d4('0x32')]);_0x3518a4['field']=_0xd0d4('0x32');_0x433b24=as[_0xd0d4('0x65')](_0x2306ed,_0x359261[_0xd0d4('0x39')],_0x3518a4);_0x41f2b1[_0xc5047e](_0x433b24['text'],_0x433b24[_0xd0d4('0x5d')][_0xd0d4('0x67')],_0x433b24['value'][_0xd0d4('0x13')]);}break;case'plainBody':_0x433b24=as['buildExpression']('me',null,_0x3518a4);_0x41f2b1[_0xc5047e](_0x433b24[_0xd0d4('0x66')],_0x433b24[_0xd0d4('0x5d')][_0xd0d4('0x67')],_0x433b24[_0xd0d4('0x5d')][_0xd0d4('0x13')]);break;}}else{var _0x433b24=as['buildExpression'](_0x2306ed,_0x359261[_0xd0d4('0x39')],_0x3518a4);_0x41f2b1[_0xc5047e](_0x433b24[_0xd0d4('0x66')],_0x433b24[_0xd0d4('0x5d')][_0xd0d4('0x67')],_0x433b24[_0xd0d4('0x5d')][_0xd0d4('0x13')]);}}}else{var _0x11626b=_(_0x560e77[_0xd0d4('0x3c')])[_0xd0d4('0x6d')]()[_0xd0d4('0x36')](function(_0x1b47bf){return _[_0xd0d4('0x6e')](_0x19c4cf,[_0xd0d4('0x1f'),_0x1b47bf])?_0x1b47bf:undefined;})['compact']()[_0xd0d4('0x5d')]();if(!_['isEmpty'](_0x11626b)){_0x11626b[_0xd0d4('0x24')](function(_0x437b6e){if(_0x437b6e===_0xd0d4('0x6f')){_0x13d2ba[_0xd0d4('0x44')](_0xd0d4('0x70'),[][_0xd0d4('0x71')](_0x560e77[_0xd0d4('0x3c')][_0x437b6e]));}else if(_0x437b6e==='createdAt'){var _0x27ecae=JSON[_0xd0d4('0x72')](_0x560e77['query'][_0x437b6e])[_0xd0d4('0x73')];var _0xd9d75a=JSON[_0xd0d4('0x72')](_0x560e77[_0xd0d4('0x3c')][_0x437b6e])[_0xd0d4('0x74')];_0x13d2ba[_0xd0d4('0x44')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x27ecae,_0xd9d75a);}else{if(_0x560e77[_0xd0d4('0x3c')][_0x437b6e]===_0xd0d4('0x75')){_0x13d2ba[_0xd0d4('0x44')]('i.'+_0x437b6e+_0xd0d4('0x76'));}else{_0x13d2ba[_0xd0d4('0x44')]('i.'+_0x437b6e+_0xd0d4('0x77'),_0x560e77[_0xd0d4('0x3c')][_0x437b6e]);}}});}if(_0x560e77[_0xd0d4('0x3c')][_0xd0d4('0x78')]){if(_0x560e77[_0xd0d4('0x3c')][_0xd0d4('0x78')]==0x1){_0x13d2ba[_0xd0d4('0x5f')]('`unreadMessages`\x20=\x200');}else{_0x13d2ba[_0xd0d4('0x5f')](_0xd0d4('0x79'));}}if(_0x560e77[_0xd0d4('0x3c')][_0xd0d4('0x7a')]){_0x4134cc=_[_0xd0d4('0x7b')](_0x560e77[_0xd0d4('0x3c')][_0xd0d4('0x7a')])?_0x560e77[_0xd0d4('0x3c')][_0xd0d4('0x7a')]:new Array(_0x560e77[_0xd0d4('0x3c')][_0xd0d4('0x7a')]);_0x4134cc[_0xd0d4('0x24')](function(_0xce4a32){_0x350e06['or'](_0xd0d4('0x7c'),'%,'+_0xce4a32+',%');});}if(_0x560e77[_0xd0d4('0x3c')][_0xd0d4('0x7d')]){var _0x2d5eb8=_0x560e77[_0xd0d4('0x3c')][_0xd0d4('0x7d')][_0xd0d4('0x7e')]('\x5c','\x5c\x5c')[_0xd0d4('0x7e')](/'/g,'\x27\x27');if(qs[_0xd0d4('0x7f')](_0x2d5eb8)){_0x41f2b1['or'](_0xd0d4('0x80'),_0x2d5eb8+'%');}else if(qs[_0xd0d4('0x81')](_0x2d5eb8)){_0x41f2b1['or'](_0xd0d4('0x82'),_0x2d5eb8+'%');}else{_0x41f2b1['or'](_0xd0d4('0x83'),qs[_0xd0d4('0x84')](_0x2d5eb8))['or'](_0xd0d4('0x85'),qs[_0xd0d4('0x84')](_0x2d5eb8));}}}_0x13d2ba[_0xd0d4('0x44')](_0x41f2b1);_0x13d2ba['group']('i.id');var _0x462ae4={'type':db[_0xd0d4('0x86')]['QueryTypes'][_0xd0d4('0x87')],'raw':!![]};var _0x35cb86=_0x13d2ba[_0xd0d4('0x88')]();_0x35cb86[_0xd0d4('0x46')]('i.id');_0x35cb86[_0xd0d4('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd0d4('0x5c'));if(_0x182934[_0xd0d4('0x42')]){_0x182934['order'][_0xd0d4('0x24')](function(_0xc7c50d){var _0x17b891=_0xc7c50d[0x0]===_0xd0d4('0x89')?_0xc7c50d[0x0]:'i.'+_0xc7c50d[0x0];_0x13d2ba['order'](_0x17b891,_0xc7c50d[0x1]==='DESC'?![]:!![]);});}if(!_[_0xd0d4('0x8a')](_0x4134cc)){_0x13d2ba['having'](_0x350e06);_0x35cb86[_0xd0d4('0x44')]('t.id\x20IN\x20?',_0x4134cc);}BPromise[_0xd0d4('0x8b')]()[_0xd0d4('0x1b')](function(){if(!_0x1ac91f){if(_0x560e77[_0xd0d4('0x3c')]['MailAccountId'])return;_0x35cb86[_0xd0d4('0x44')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x13d2ba[_0xd0d4('0x44')](_0xd0d4('0x8c'));return;}if(_0x560e77[_0xd0d4('0x8d')][_0xd0d4('0x8e')]!==_0xd0d4('0x8f'))return;return _0x560e77[_0xd0d4('0x8d')][_0xd0d4('0x90')]({'attributes':['id'],'raw':!![]})[_0xd0d4('0x1b')](function(_0x3505b8){if(_[_0xd0d4('0x8a')](_0x3505b8)){_0x35cb86[_0xd0d4('0x44')](_0xd0d4('0x91'));_0x13d2ba[_0xd0d4('0x44')](_0xd0d4('0x91'));}else{_0x35cb86['where'](_0xd0d4('0x70'),_['map'](_0x3505b8,'id'));_0x13d2ba[_0xd0d4('0x44')]('i.MailAccountId\x20IN\x20?',_[_0xd0d4('0x36')](_0x3505b8,'id'));}});})[_0xd0d4('0x1b')](function(){if(_0x560e77['user'][_0xd0d4('0x8e')]===_0xd0d4('0x8f')&&!_0x1ac91f&&!_0x560e77[_0xd0d4('0x3c')][_0xd0d4('0x6f')])return[];return db[_0xd0d4('0x92')][_0xd0d4('0x3c')](_0x35cb86[_0xd0d4('0x93')](),_0x462ae4);})[_0xd0d4('0x1b')](function(_0x3e5a26){_0x554885['count']=_0x3e5a26['length'];if(_0x554885[_0xd0d4('0x18')]===0x0)return[];return db['sequelize']['query'](_0x4761fd['toString'](),_0x462ae4)[_0xd0d4('0x1b')](function(_0x2c3f3a){_0x580c97=_['keyBy'](_0x2c3f3a,'id');_0x462ae4=_[_0xd0d4('0x94')](_0x462ae4,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x560e77[_0xd0d4('0x3c')]['fields']){_0x182934[_0xd0d4('0x3f')][_0xd0d4('0x24')](function(_0x3d5f5e){_0x13d2ba[_0xd0d4('0x46')]('i.'+_0x3d5f5e);});}else{_0x13d2ba['field'](_0xd0d4('0x95'),_0xd0d4('0x5c'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0x96'),_0xd0d4('0x97'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0x98'),_0xd0d4('0x99'));_0x13d2ba['field'](_0xd0d4('0x9a'),_0xd0d4('0x89'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0x9b'));_0x13d2ba[_0xd0d4('0x46')]('i.createdAt');_0x13d2ba['field'](_0xd0d4('0x9c'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0x9d'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0x9e'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0x9f'));_0x13d2ba['field'](_0xd0d4('0xa0'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0xa1'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0xa2'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0xa3'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0xa4'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0xa5'));_0x13d2ba['field'](_0xd0d4('0xa6'));_0x13d2ba[_0xd0d4('0x46')]('i.to');_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0xa7'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0xa8'));_0x13d2ba['field']('i.UserId');_0x13d2ba[_0xd0d4('0x46')]('c.firstName',_0xd0d4('0xa9'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0xaa'),'Contact.lastName');_0x13d2ba['field'](_0xd0d4('0xab'),'Contact.email');_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0xac'),'Contact.phone');_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0xad'),_0xd0d4('0xae'));_0x13d2ba['field'](_0xd0d4('0xaf'),_0xd0d4('0xb0'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0xb1'),_0xd0d4('0xb2'));_0x13d2ba[_0xd0d4('0x46')]('o.internal',_0xd0d4('0xb3'));_0x13d2ba[_0xd0d4('0x46')](_0xd0d4('0xb4'),'TagIds');}if(_0x182934['limit'])_0x13d2ba[_0xd0d4('0x16')](_0x182934[_0xd0d4('0x16')]);if(_0x182934[_0xd0d4('0x19')])_0x13d2ba[_0xd0d4('0x19')](_0x182934[_0xd0d4('0x19')]);return db[_0xd0d4('0x92')][_0xd0d4('0x3c')](_0x13d2ba['toString'](),_0x462ae4);})['then'](function(_0xf81537){if(_0xf81537[_0xd0d4('0x59')]>0x0)_0x52ff40[_0xd0d4('0x44')](_0xd0d4('0xb5'),_[_0xd0d4('0x36')](_0xf81537,'id'));return db[_0xd0d4('0x92')][_0xd0d4('0x3c')](_0x52ff40[_0xd0d4('0x93')](),_0x462ae4)['then'](function(_0xa4103d){var _0x418a39=_[_0xd0d4('0xb6')](_0xa4103d,_0xd0d4('0xb7'));var _0x53aa2a=[];return db[_0xd0d4('0xb8')][_0xd0d4('0x28')]({'attributes':[_0xd0d4('0xb9')],'raw':!![]})[_0xd0d4('0x1b')](function(_0xbcccea){var _0x4cbfa5=_0xbcccea['enableEmailPreview'];_0xf81537[_0xd0d4('0x24')](function(_0x5597e8){_0x53aa2a[_0xd0d4('0x26')](updateMailInteraction(_0x5597e8,_0x580c97,_0x418a39,_0x4cbfa5));});return BPromise[_0xd0d4('0xba')](_0x53aa2a);});});});})[_0xd0d4('0x1b')](function(_0x476bc6){_0x554885[_0xd0d4('0xbb')]=_0x476bc6;return _0x554885;})[_0xd0d4('0x1b')](respondWithFilteredResult(_0xc6d50a,_0x182934))['catch'](handleError(_0xc6d50a,null));};exports['show']=function(_0x3267a1,_0x2078ca){var _0x14eb8c={'raw':![],'where':{'id':_0x3267a1[_0xd0d4('0xbc')]['id']}},_0x5be9d6={};_0x5be9d6['model']=_[_0xd0d4('0x6d')](db['MailInteraction']['rawAttributes']);_0x5be9d6[_0xd0d4('0x3c')]=_[_0xd0d4('0x6d')](_0x3267a1[_0xd0d4('0x3c')]);_0x5be9d6[_0xd0d4('0x3d')]=_[_0xd0d4('0x3e')](_0x5be9d6[_0xd0d4('0x3b')],_0x5be9d6[_0xd0d4('0x3c')]);_0x14eb8c[_0xd0d4('0x3f')]=_[_0xd0d4('0x3e')](_0x5be9d6['model'],qs['fields'](_0x3267a1['query']['fields']));_0x14eb8c[_0xd0d4('0x3f')]=_0x14eb8c[_0xd0d4('0x3f')][_0xd0d4('0x59')]?_0x14eb8c[_0xd0d4('0x3f')]:_0x5be9d6[_0xd0d4('0x3b')];if(_0x3267a1[_0xd0d4('0x3c')][_0xd0d4('0xbd')]){_0x14eb8c[_0xd0d4('0xbe')]=[{'all':!![]}];}_0x14eb8c=_[_0xd0d4('0x94')]({},_0x14eb8c,_0x3267a1[_0xd0d4('0xbf')]);return db[_0xd0d4('0x37')][_0xd0d4('0x5b')](_0x14eb8c)[_0xd0d4('0x1b')](handleEntityNotFound(_0x2078ca,null))[_0xd0d4('0x1b')](respondWithResult(_0x2078ca,null))['catch'](handleError(_0x2078ca,null));};exports[_0xd0d4('0xc0')]=function(_0x1e4420,_0x1b789b){return db[_0xd0d4('0x37')][_0xd0d4('0xc0')](_0x1e4420[_0xd0d4('0xc1')],{})['then'](respondWithResult(_0x1b789b,0xc9))['catch'](handleError(_0x1b789b,null));};exports['update']=function(_0x7cc770,_0x401e96){if(_0x7cc770['body']['id']){delete _0x7cc770[_0xd0d4('0xc1')]['id'];}return db[_0xd0d4('0x37')][_0xd0d4('0x5b')]({'where':{'id':_0x7cc770['params']['id']}})[_0xd0d4('0x1b')](handleEntityNotFound(_0x401e96,null))['then'](saveUpdates(_0x7cc770[_0xd0d4('0xc1')],null))[_0xd0d4('0x1b')](respondWithResult(_0x401e96,null))[_0xd0d4('0x2d')](handleError(_0x401e96,null));};exports[_0xd0d4('0x1c')]=function(_0x594c91,_0x3d6cc3){return db['MailInteraction'][_0xd0d4('0x5b')]({'where':{'id':_0x594c91[_0xd0d4('0xbc')]['id']}})[_0xd0d4('0x1b')](handleEntityNotFound(_0x3d6cc3,null))[_0xd0d4('0x1b')](removeEntity(_0x3d6cc3,null))[_0xd0d4('0x2d')](handleError(_0x3d6cc3,null));};exports['describe']=function(_0xcca5ab,_0x2177b4){return db['MailInteraction']['describe']()[_0xd0d4('0x1b')](respondWithResult(_0x2177b4,null))[_0xd0d4('0x2d')](handleError(_0x2177b4,null));};exports[_0xd0d4('0xc2')]=function(_0x3096bf,_0xd310f4){return db[_0xd0d4('0x27')]['find']({'where':{'id':_0x3096bf[_0xd0d4('0xbc')]['id']}})['then'](handleEntityNotFound(_0xd310f4,null))[_0xd0d4('0x1b')](function(_0x6aeec){if(_0x6aeec){return _0x6aeec[_0xd0d4('0xc2')](_0x3096bf['body'][_0xd0d4('0xc3')],_[_0xd0d4('0xc4')](_0x3096bf[_0xd0d4('0xc1')],[_0xd0d4('0xc3'),'id'])||{});}})[_0xd0d4('0x1b')](respondWithResult(_0xd310f4,null))[_0xd0d4('0x2d')](handleError(_0xd310f4,null));};exports[_0xd0d4('0xc5')]=function(_0x17a071,_0x1f63b5){var _0x50b1f7={'raw':![],'where':{}};var _0x5cad56={};var _0x18f1ea={'count':0x0,'rows':[]};return db[_0xd0d4('0x37')]['findOne']({'where':{'id':_0x17a071[_0xd0d4('0xbc')]['id']}})[_0xd0d4('0x1b')](handleEntityNotFound(_0x1f63b5,null))[_0xd0d4('0x1b')](function(_0x41b2b9){if(_0x41b2b9){_0x5cad56[_0xd0d4('0x3b')]=_[_0xd0d4('0x6d')](db[_0xd0d4('0x27')]['rawAttributes']);_0x5cad56[_0xd0d4('0x3c')]=_['keys'](_0x17a071[_0xd0d4('0x3c')]);_0x5cad56['filters']=_[_0xd0d4('0x3e')](_0x5cad56[_0xd0d4('0x3b')],_0x5cad56[_0xd0d4('0x3c')]);_0x50b1f7[_0xd0d4('0x3f')]=_[_0xd0d4('0x3e')](_0x5cad56[_0xd0d4('0x3b')],qs[_0xd0d4('0x40')](_0x17a071[_0xd0d4('0x3c')]['fields']));_0x50b1f7[_0xd0d4('0x3f')]=_0x50b1f7[_0xd0d4('0x3f')][_0xd0d4('0x59')]?_0x50b1f7[_0xd0d4('0x3f')]:_0x5cad56['model'];if(!_0x17a071[_0xd0d4('0x3c')][_0xd0d4('0x41')](_0xd0d4('0xc6'))){_0x50b1f7[_0xd0d4('0x16')]=qs[_0xd0d4('0x16')](_0x17a071[_0xd0d4('0x3c')][_0xd0d4('0x16')]);_0x50b1f7['offset']=qs['offset'](_0x17a071['query'][_0xd0d4('0x19')]);}_0x50b1f7[_0xd0d4('0x42')]=qs['sort'](_0x17a071[_0xd0d4('0x3c')][_0xd0d4('0x43')]);_0x50b1f7['where']=qs[_0xd0d4('0x3d')](_[_0xd0d4('0x45')](_0x17a071['query'],_0x5cad56[_0xd0d4('0x3d')]));_0x50b1f7[_0xd0d4('0x44')][_0xd0d4('0xb7')]=_0x41b2b9['id'];if(_0x17a071[_0xd0d4('0x3c')][_0xd0d4('0x7d')]){_0x50b1f7[_0xd0d4('0x44')]=_[_0xd0d4('0x94')](_0x50b1f7[_0xd0d4('0x44')],{'$or':_[_0xd0d4('0x36')](_0x50b1f7[_0xd0d4('0x3f')],function(_0x4adfbc){var _0xdc8bbb={};_0xdc8bbb[_0x4adfbc]={'$like':'%'+_0x17a071[_0xd0d4('0x3c')]['filter']+'%'};return _0xdc8bbb;})});}if(_0x17a071[_0xd0d4('0x3c')]['$gte']){var _0x28107=_0x17a071[_0xd0d4('0x3c')][_0xd0d4('0x73')]['split'](',');var _0x588cf2={};_0x588cf2[_0x28107[0x0]]={'$gte':moment(_0x28107[0x1])[_0xd0d4('0xc7')](_0xd0d4('0xc8'))};_0x50b1f7[_0xd0d4('0x44')]=_[_0xd0d4('0x94')](_0x50b1f7[_0xd0d4('0x44')],_0x588cf2);}_0x50b1f7=_[_0xd0d4('0x94')]({},_0x50b1f7,_0x17a071[_0xd0d4('0xbf')]);return db[_0xd0d4('0x27')][_0xd0d4('0x18')]({'where':_0x50b1f7[_0xd0d4('0x44')]})[_0xd0d4('0x1b')](function(_0x2a607d){_0x18f1ea[_0xd0d4('0x18')]=_0x2a607d;if(_0x17a071[_0xd0d4('0x3c')]['includeAll']){_0x50b1f7[_0xd0d4('0xbe')]=[{'all':!![]}];}return db[_0xd0d4('0x27')][_0xd0d4('0xc9')](_0x50b1f7);})[_0xd0d4('0x1b')](function(_0x52d27e){if(_0x17a071[_0xd0d4('0x3c')][_0xd0d4('0xca')]==='true'){for(var _0x4403ef=0x0;_0x4403ef<_0x52d27e['length'];_0x4403ef++){_0x52d27e[_0x4403ef]['body']=juice(_0x52d27e[_0x4403ef][_0xd0d4('0xc1')]);}}_0x18f1ea[_0xd0d4('0xbb')]=_0x52d27e;return _0x18f1ea;});}})[_0xd0d4('0x1b')](respondWithFilteredResult(_0x1f63b5,_0x50b1f7))['catch'](handleError(_0x1f63b5,null));};exports['addTags']=function(_0x3db1ae,_0x230bce){return db[_0xd0d4('0x37')][_0xd0d4('0x5b')]({'where':{'id':_0x3db1ae[_0xd0d4('0xbc')]['id']}})[_0xd0d4('0x1b')](handleEntityNotFound(_0x230bce,null))[_0xd0d4('0x1b')](function(_0x1d0f53){if(_0x1d0f53){return _0x1d0f53['setTags'](_0x3db1ae[_0xd0d4('0xc1')][_0xd0d4('0xc3')],_['omit'](_0x3db1ae['body'],[_0xd0d4('0xc3'),'id'])||{})[_0xd0d4('0xcb')](function(){return db[_0xd0d4('0x68')][_0xd0d4('0xc9')]({'attributes':['id',_0xd0d4('0x1f'),'color'],'where':{'id':_0x3db1ae[_0xd0d4('0xc1')]['ids']}});})[_0xd0d4('0x1b')](function(_0x1e379c){socket[_0xd0d4('0xcc')](_0xd0d4('0xcd'),{'id':Number(_0x3db1ae[_0xd0d4('0xbc')]['id']),'tags':_0x1e379c||[]});return{'id':Number(_0x3db1ae[_0xd0d4('0xbc')]['id']),'tags':_0x1e379c||[]};});}})[_0xd0d4('0x1b')](respondWithResult(_0x230bce,null))[_0xd0d4('0x2d')](handleError(_0x230bce,null));};exports[_0xd0d4('0xce')]=function(_0x4bf89b,_0xed0ef9){return db[_0xd0d4('0x37')][_0xd0d4('0x5b')]({'where':{'id':_0x4bf89b[_0xd0d4('0xbc')]['id']}})[_0xd0d4('0x1b')](handleEntityNotFound(_0xed0ef9,null))[_0xd0d4('0x1b')](function(_0x139970){if(_0x139970){return _0x139970[_0xd0d4('0xce')](_0x4bf89b[_0xd0d4('0x3c')]['ids']);}})[_0xd0d4('0x1b')](respondWithStatusCode(_0xed0ef9,null))[_0xd0d4('0x2d')](handleError(_0xed0ef9,null));};exports['download']=function(_0x3609b1,_0x2530fc){var _0x296b27=moment()['unix']()[_0xd0d4('0x93')]();var _0x3966e2=path[_0xd0d4('0xcf')](config['root'],'server','files',_0xd0d4('0xd0'));var _0x2d6126=path[_0xd0d4('0xcf')](config[_0xd0d4('0xd1')],_0xd0d4('0xd2'),_0xd0d4('0xd3'),_0xd0d4('0xd4'));var _0x4587ef=path['join'](_0x3966e2,_0x296b27);var _0x345f7b=util[_0xd0d4('0xc7')](_0xd0d4('0xd5'),_0x3609b1[_0xd0d4('0xbc')]['id'],_0x296b27);var _0xc99f63=path[_0xd0d4('0xcf')](_0x3966e2,_0x345f7b);var _0x20c15f=[];if(_0x3609b1['query']['attachments']){_0x20c15f[_0xd0d4('0x26')]({'model':db['Attachment'],'as':_0xd0d4('0xd6'),'raw':!![]});}var _0x42c6ec=[{'model':db[_0xd0d4('0x27')],'as':_0xd0d4('0xd7'),'attributes':['id',_0xd0d4('0xc1'),_0xd0d4('0x4a'),'to','cc',_0xd0d4('0xd8'),_0xd0d4('0xd9'),_0xd0d4('0xda')],'where':{'secret':![]},'order':qs[_0xd0d4('0x43')]('id'),'include':_0x20c15f}];return db[_0xd0d4('0x37')][_0xd0d4('0x5b')]({'where':{'id':_0x3609b1['params']['id']},'include':_0x42c6ec})[_0xd0d4('0x1b')](handleEntityNotFound(_0x2530fc,null))[_0xd0d4('0x1b')](function(_0x4fe382){if(_0x4fe382&&_0x4fe382[_0xd0d4('0xd7')]){var _0x3c6061=_0x4fe382[_0xd0d4('0xdb')]({'plain':!![]});fs[_0xd0d4('0xdc')](_0x4587ef);return BPromise[_0xd0d4('0xdd')](_0x3c6061[_0xd0d4('0xd7')],function(_0x258f08,_0x3a3226){var _0x43f84e={'from':_0x258f08['from'],'to':_0x258f08['to'],'subject':_0x258f08[_0xd0d4('0xd9')],'html':htmlEntities[_0xd0d4('0xde')](_0x258f08[_0xd0d4('0xc1')]),'headers':{'Date':moment(_0x258f08['createdAt'])[_0xd0d4('0xc7')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x258f08['cc']){_0x43f84e[_0xd0d4('0xdf')]['Cc']=_0x258f08['cc'];}if(_0x258f08[_0xd0d4('0xd8')]){_0x43f84e['headers'][_0xd0d4('0xe0')]=_0x258f08[_0xd0d4('0xd8')];}return new BPromise(function(_0x3e0489,_0x579b04){if(_0x258f08[_0xd0d4('0xd6')]){for(var _0x3c7f43=0x0;_0x3c7f43<_0x258f08[_0xd0d4('0xd6')][_0xd0d4('0x59')];_0x3c7f43++){var _0x281eae=_0x258f08[_0xd0d4('0xd6')][_0x3c7f43];var _0x331b8d=path[_0xd0d4('0xcf')](_0x2d6126,_0x281eae[_0xd0d4('0xe1')]);if(fs[_0xd0d4('0xe2')](_0x331b8d)){_0x43f84e[_0xd0d4('0xd4')][_0xd0d4('0x26')]({'name':_0x281eae['name'],'contentType':_0x281eae[_0xd0d4('0x39')],'data':fs[_0xd0d4('0xe3')](_0x331b8d)});}}}emlformat[_0xd0d4('0xe4')](_0x43f84e,function(_0xa2b556,_0x49026a){if(_0xa2b556)return _0x579b04(_0xa2b556);fs[_0xd0d4('0xe5')](path[_0xd0d4('0xcf')](_0x4587ef,util[_0xd0d4('0xc7')](_0xd0d4('0xe6'),_0x3a3226)),_0x49026a);return _0x3e0489(_0x49026a);});});})[_0xd0d4('0x1b')](function(){return new BPromise(function(_0xef74e4,_0x2db842){zipdir(_0x4587ef,{'saveTo':_0xc99f63},function(_0x21d7fc,_0x317349){if(_0x21d7fc)return _0x2db842(_0x21d7fc);return _0xef74e4(_0x317349);});})[_0xd0d4('0x1b')](function(){return new BPromise(function(_0x481804,_0x1588ee){rimraf(_0x4587ef,function(_0xe20699){if(_0xe20699)_0x1588ee(_0xe20699);return _0x481804();});});})[_0xd0d4('0x1b')](function(){return _0x2530fc[_0xd0d4('0xe7')](_0xc99f63,_0x345f7b,function(_0x496ec2){if(!_0x496ec2)fs[_0xd0d4('0xe8')](_0xc99f63);});});});}else{return _0x2530fc[_0xd0d4('0x12')](0xc8);}})['catch'](handleError(_0x2530fc,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 66ad16b..c712340 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 _0x49ac=['catch','exports','events','../../mysqldb','MailInteraction','MailMessage','save','update','remove','getUsers','then','setDataValue','findAll','unreadMessages','emit'];(function(_0x528657,_0x1784ec){var _0x2da56f=function(_0xb1098c){while(--_0xb1098c){_0x528657['push'](_0x528657['shift']());}};_0x2da56f(++_0x1784ec);}(_0x49ac,0x11f));var _0xc49a=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0x49ac[_0x2cef86];return _0x46dfd6;};'use strict';var EventEmitter=require(_0xc49a('0x0'));var MailInteraction=require(_0xc49a('0x1'))['db'][_0xc49a('0x2')];var MailMessage=require(_0xc49a('0x1'))['db'][_0xc49a('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc49a('0x4'),'afterUpdate':_0xc49a('0x5'),'afterDestroy':_0xc49a('0x6')};function emitEvent(_0x22b532){return function(_0x37ef03,_0x165aeb,_0x104492){_0x37ef03[_0xc49a('0x7')]({'attributes':['id'],'raw':!![]})[_0xc49a('0x8')](function(_0x55b96b){_0x37ef03[_0xc49a('0x9')]('Users',_0x55b96b['map'](function(_0x19ff00){return{'id':_0x19ff00['id']};}));return MailMessage[_0xc49a('0xa')]({'where':{'MailInteractionId':_0x37ef03['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc49a('0x8')](function(_0x1ac192){_0x37ef03[_0xc49a('0x9')](_0xc49a('0xb'),_0x1ac192['length']);MailInteractionEvents[_0xc49a('0xc')](_0x22b532+':'+_0x37ef03['id'],_0x37ef03);MailInteractionEvents[_0xc49a('0xc')](_0x22b532,_0x37ef03);_0x104492(null);})[_0xc49a('0xd')](_0x104492(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xc49a('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0x40d2=['save','update','remove','getUsers','then','map','findAll','setDataValue','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage'];(function(_0xbd3a05,_0xe6c6b7){var _0x101f90=function(_0x34fbcb){while(--_0x34fbcb){_0xbd3a05['push'](_0xbd3a05['shift']());}};_0x101f90(++_0xe6c6b7);}(_0x40d2,0x13d));var _0x240d=function(_0xab840,_0x48ed14){_0xab840=_0xab840-0x0;var _0x2e6dbc=_0x40d2[_0xab840];return _0x2e6dbc;};'use strict';var EventEmitter=require(_0x240d('0x0'));var MailInteraction=require(_0x240d('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0x240d('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x240d('0x3'),'afterUpdate':_0x240d('0x4'),'afterDestroy':_0x240d('0x5')};function emitEvent(_0x59571c){return function(_0x54f6b8,_0xca7df,_0x100a32){_0x54f6b8[_0x240d('0x6')]({'attributes':['id'],'raw':!![]})[_0x240d('0x7')](function(_0x5a0193){_0x54f6b8['setDataValue']('Users',_0x5a0193[_0x240d('0x8')](function(_0x4ae350){return{'id':_0x4ae350['id']};}));return MailMessage[_0x240d('0x9')]({'where':{'MailInteractionId':_0x54f6b8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x240d('0x7')](function(_0x4542a6){_0x54f6b8[_0x240d('0xa')](_0x240d('0xb'),_0x4542a6['length']);MailInteractionEvents[_0x240d('0xc')](_0x59571c+':'+_0x54f6b8['id'],_0x54f6b8);MailInteractionEvents['emit'](_0x59571c,_0x54f6b8);_0x100a32(null);})['catch'](_0x100a32(null));};}for(var e in events){if(events[_0x240d('0xd')](e)){var event=events[e];MailInteraction[_0x240d('0xe')](e,emitEvent(event));}}module[_0x240d('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 9d87d61..8bb2c74 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 _0xbedd=['substatus','substatusAt','format','closed','YYYY-MM-DD\x20HH:mm:ss','changed','closedAt','get','MailMessage','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','FULLTEXT'];(function(_0x1ff120,_0x45f657){var _0x1eec64=function(_0x15f366){while(--_0x15f366){_0x1ff120['push'](_0x1ff120['shift']());}};_0x1eec64(++_0x45f657);}(_0xbedd,0x124));var _0xdbed=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0xbedd[_0x3fe042];return _0x7d4a1f;};'use strict';var _=require(_0xdbed('0x0'));var util=require(_0xdbed('0x1'));var logger=require(_0xdbed('0x2'))(_0xdbed('0x3'));var moment=require(_0xdbed('0x4'));var BPromise=require(_0xdbed('0x5'));var rp=require(_0xdbed('0x6'));var fs=require('fs');var path=require(_0xdbed('0x7'));var rimraf=require(_0xdbed('0x8'));var config=require(_0xdbed('0x9'));var attributes=require(_0xdbed('0xa'));module[_0xdbed('0xb')]=function(_0x4582d8,_0x440c06){return _0x4582d8[_0xdbed('0xc')]('MailInteraction',attributes,{'tableName':_0xdbed('0xd'),'paranoid':![],'indexes':[{'name':_0xdbed('0xe'),'fields':['subject','to'],'type':_0xdbed('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5b796a,_0x10b556,_0x5e0ecf){if(_0x5b796a[_0xdbed('0x10')]){_0x5b796a[_0xdbed('0x11')]=moment()[_0xdbed('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5b796a[_0xdbed('0x13')]){_0x5b796a['closedAt']=moment()['format'](_0xdbed('0x14'));}_0x5e0ecf(null,_0x10b556);},'beforeUpdate':function(_0x435fe3,_0x44dce5,_0x778b83){if(_0x435fe3[_0xdbed('0x15')](_0xdbed('0x10'))){_0x435fe3['substatusAt']=_0x435fe3[_0xdbed('0x10')]?moment()[_0xdbed('0x12')](_0xdbed('0x14')):null;}if(_0x435fe3['changed']('closed')){_0x435fe3[_0xdbed('0x16')]=moment()[_0xdbed('0x12')](_0xdbed('0x14'));_0x435fe3[_0xdbed('0x10')]=null;_0x435fe3[_0xdbed('0x11')]=null;}_0x778b83(null,_0x435fe3);},'afterUpdate':function(_0x46be65,_0x33dd46,_0x3ae226){var _0x3e3e9d=_0x4582d8['models'];var _0x175947=_0x46be65[_0xdbed('0x17')]({'plain':!![]});if(_0x175947['closed']){return _0x3e3e9d[_0xdbed('0x18')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x175947['id']}})[_0xdbed('0x19')](function(){_0x3ae226();})['catch'](function(_0x4ee2ef){_0x3ae226(_0x4ee2ef);});}else{_0x3ae226();}}},'charset':_0xdbed('0x1a'),'collate':_0xdbed('0x1b')});}; \ No newline at end of file +var _0x4f8f=['MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','closed','closedAt','changed','YYYY-MM-DD\x20HH:mm:ss','models','get','update','then','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define'];(function(_0x23aea6,_0x34312d){var _0x48934a=function(_0x3db574){while(--_0x3db574){_0x23aea6['push'](_0x23aea6['shift']());}};_0x48934a(++_0x34312d);}(_0x4f8f,0x1d0));var _0xf4f8=function(_0x515a66,_0x271a17){_0x515a66=_0x515a66-0x0;var _0x14c41d=_0x4f8f[_0x515a66];return _0x14c41d;};'use strict';var _=require(_0xf4f8('0x0'));var util=require(_0xf4f8('0x1'));var logger=require(_0xf4f8('0x2'))(_0xf4f8('0x3'));var moment=require(_0xf4f8('0x4'));var BPromise=require('bluebird');var rp=require(_0xf4f8('0x5'));var fs=require('fs');var path=require(_0xf4f8('0x6'));var rimraf=require(_0xf4f8('0x7'));var config=require(_0xf4f8('0x8'));var attributes=require(_0xf4f8('0x9'));module[_0xf4f8('0xa')]=function(_0xeea36c,_0x2f1ad4){return _0xeea36c[_0xf4f8('0xb')](_0xf4f8('0xc'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xf4f8('0xd'),'fields':[_0xf4f8('0xe'),'to'],'type':_0xf4f8('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x7104ff,_0x44c9cd,_0x239864){if(_0x7104ff[_0xf4f8('0x10')]){_0x7104ff[_0xf4f8('0x11')]=moment()[_0xf4f8('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x7104ff[_0xf4f8('0x13')]){_0x7104ff[_0xf4f8('0x14')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x239864(null,_0x44c9cd);},'beforeUpdate':function(_0x1582e8,_0x103653,_0x4bca37){if(_0x1582e8[_0xf4f8('0x15')](_0xf4f8('0x10'))){_0x1582e8[_0xf4f8('0x11')]=_0x1582e8['substatus']?moment()[_0xf4f8('0x12')](_0xf4f8('0x16')):null;}if(_0x1582e8[_0xf4f8('0x15')](_0xf4f8('0x13'))){_0x1582e8[_0xf4f8('0x14')]=moment()[_0xf4f8('0x12')](_0xf4f8('0x16'));_0x1582e8[_0xf4f8('0x10')]=null;_0x1582e8[_0xf4f8('0x11')]=null;}_0x4bca37(null,_0x1582e8);},'afterUpdate':function(_0x514f3c,_0x4acd73,_0x2c245c){var _0x2dc2a=_0xeea36c[_0xf4f8('0x17')];var _0x323503=_0x514f3c[_0xf4f8('0x18')]({'plain':!![]});if(_0x323503[_0xf4f8('0x13')]){return _0x2dc2a['MailMessage'][_0xf4f8('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x323503['id']}})[_0xf4f8('0x1a')](function(){_0x2c245c();})['catch'](function(_0x22d2af){_0x2c245c(_0x22d2af);});}else{_0x2c245c();}}},'charset':_0xf4f8('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index e34c8c8..cc00c61 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 _0x14b2=['localhost','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','MailInteraction','options','raw','where','attributes','limit','UpdateMailInteraction','debug','stringify','catch','AddTagsToMailInteraction','ids','omit','body','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults'];(function(_0x3f7b0d,_0x5b0767){var _0x1d0a31=function(_0x254f57){while(--_0x254f57){_0x3f7b0d['push'](_0x3f7b0d['shift']());}};_0x1d0a31(++_0x5b0767);}(_0x14b2,0x1a1));var _0x214b=function(_0x2ad08e,_0x31c75e){_0x2ad08e=_0x2ad08e-0x0;var _0x6e79c5=_0x14b2[_0x2ad08e];return _0x6e79c5;};'use strict';var _=require(_0x214b('0x0'));var util=require(_0x214b('0x1'));var moment=require('moment');var BPromise=require(_0x214b('0x2'));var rs=require(_0x214b('0x3'));var fs=require('fs');var Redis=require(_0x214b('0x4'));var db=require(_0x214b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x214b('0x6'))(_0x214b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x214b('0x8')][_0x214b('0x9')]({'port':0x232a});config[_0x214b('0xa')]=_[_0x214b('0xb')](config[_0x214b('0xa')],{'host':_0x214b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x214b('0xa')]));require('./mailInteraction.socket')[_0x214b('0xd')](socket);function respondWithRpcPromise(_0x53d959,_0x322c4c,_0x5256ad){return new BPromise(function(_0x5ccdfd,_0x4cae5e){return client[_0x214b('0xe')](_0x53d959,_0x5256ad)[_0x214b('0xf')](function(_0x49acef){logger[_0x214b('0x10')](_0x214b('0x11'),_0x322c4c,_0x214b('0x12'));logger['debug'](_0x214b('0x13'),_0x322c4c,'request\x20sent',JSON['stringify'](_0x49acef));if(_0x49acef[_0x214b('0x14')]){if(_0x49acef[_0x214b('0x14')][_0x214b('0x15')]===0x1f4){logger[_0x214b('0x14')](_0x214b('0x11'),_0x322c4c,_0x49acef[_0x214b('0x14')]['message']);return _0x4cae5e(_0x49acef[_0x214b('0x14')]['message']);}logger[_0x214b('0x14')](_0x214b('0x11'),_0x322c4c,_0x49acef[_0x214b('0x14')]['message']);return _0x5ccdfd(_0x49acef['error'][_0x214b('0x16')]);}else{logger['info'](_0x214b('0x11'),_0x322c4c,_0x214b('0x12'));_0x5ccdfd(_0x49acef['result'][_0x214b('0x16')]);}})['catch'](function(_0x44028f){logger[_0x214b('0x14')](_0x214b('0x11'),_0x322c4c,_0x44028f);_0x4cae5e(_0x44028f);});});}exports['UpdateMailInteraction']=function(_0x14c45c){var _0x1e80bc=this;return new Promise(function(_0x2dacc1,_0x3dc351){return db[_0x214b('0x17')]['update'](_0x14c45c['body'],{'raw':_0x14c45c[_0x214b('0x18')]?_0x14c45c[_0x214b('0x18')][_0x214b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14c45c[_0x214b('0x18')]?_0x14c45c['options'][_0x214b('0x1a')]||null:null,'attributes':_0x14c45c[_0x214b('0x18')]?_0x14c45c[_0x214b('0x18')][_0x214b('0x1b')]||null:null,'limit':_0x14c45c['options']?_0x14c45c[_0x214b('0x18')][_0x214b('0x1c')]||null:null})[_0x214b('0xf')](function(_0x220d38){logger[_0x214b('0x10')](_0x214b('0x1d'),_0x14c45c);logger[_0x214b('0x1e')](_0x214b('0x1d'),_0x14c45c,JSON[_0x214b('0x1f')](_0x220d38));_0x2dacc1(_0x220d38);})[_0x214b('0x20')](function(_0x2aaaf1){logger['error']('UpdateMailInteraction',_0x2aaaf1[_0x214b('0x16')],_0x14c45c);_0x3dc351(_0x1e80bc[_0x214b('0x14')](0x1f4,_0x2aaaf1[_0x214b('0x16')]));});});};exports[_0x214b('0x21')]=function(_0x49bed4){return new Promise(function(_0xf137ee,_0x787560){return db['MailInteraction']['find']({'where':_0x49bed4[_0x214b('0x18')]?_0x49bed4[_0x214b('0x18')][_0x214b('0x1a')]||null:null})['then'](function(_0x1b3a94){if(_0x1b3a94){return _0x1b3a94['addTags'](_0x49bed4['body'][_0x214b('0x22')],_[_0x214b('0x23')](_0x49bed4[_0x214b('0x24')],[_0x214b('0x22'),'id'])||{});}})[_0x214b('0x25')](function(_0x42a9d3){logger[_0x214b('0x10')](_0x214b('0x26'),_0x49bed4);logger['debug']('AddTags',_0x49bed4,JSON[_0x214b('0x1f')](_0x42a9d3));_0xf137ee(_0x42a9d3);})[_0x214b('0x20')](function(_0x131860){logger[_0x214b('0x14')]('AddTags',_0x131860['message'],_0x49bed4);_0x787560(_this[_0x214b('0x14')](0x1f4,_0x131860[_0x214b('0x16')]));});});}; \ No newline at end of file +var _0xfa74=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateMailInteraction','MailInteraction','body','options','where','attributes','limit','AddTagsToMailInteraction','find','addTags','ids','omit','AddTags'];(function(_0x190430,_0x133e0b){var _0x3aa808=function(_0x193a21){while(--_0x193a21){_0x190430['push'](_0x190430['shift']());}};_0x3aa808(++_0x133e0b);}(_0xfa74,0x1b0));var _0x4fa7=function(_0x3f9029,_0x5c86a6){_0x3f9029=_0x3f9029-0x0;var _0xd3b70d=_0xfa74[_0x3f9029];return _0xd3b70d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4fa7('0x0'));var BPromise=require('bluebird');var rs=require(_0x4fa7('0x1'));var fs=require('fs');var Redis=require(_0x4fa7('0x2'));var db=require(_0x4fa7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4fa7('0x4'))(_0x4fa7('0x5'));var config=require(_0x4fa7('0x6'));var jayson=require(_0x4fa7('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x4fa7('0x8')]=_['defaults'](config[_0x4fa7('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x4fa7('0x9'))(new Redis(config['redis']));require(_0x4fa7('0xa'))[_0x4fa7('0xb')](socket);function respondWithRpcPromise(_0x18d650,_0xd437f4,_0xdadb3f){return new BPromise(function(_0x4945a8,_0x309db8){return client[_0x4fa7('0xc')](_0x18d650,_0xdadb3f)[_0x4fa7('0xd')](function(_0x38425e){logger[_0x4fa7('0xe')](_0x4fa7('0xf'),_0xd437f4,_0x4fa7('0x10'));logger[_0x4fa7('0x11')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0xd437f4,'request\x20sent',JSON[_0x4fa7('0x12')](_0x38425e));if(_0x38425e[_0x4fa7('0x13')]){if(_0x38425e[_0x4fa7('0x13')][_0x4fa7('0x14')]===0x1f4){logger[_0x4fa7('0x13')](_0x4fa7('0xf'),_0xd437f4,_0x38425e[_0x4fa7('0x13')][_0x4fa7('0x15')]);return _0x309db8(_0x38425e[_0x4fa7('0x13')][_0x4fa7('0x15')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0xd437f4,_0x38425e['error'][_0x4fa7('0x15')]);return _0x4945a8(_0x38425e[_0x4fa7('0x13')][_0x4fa7('0x15')]);}else{logger[_0x4fa7('0xe')](_0x4fa7('0xf'),_0xd437f4,_0x4fa7('0x10'));_0x4945a8(_0x38425e['result']['message']);}})[_0x4fa7('0x16')](function(_0x531f10){logger['error'](_0x4fa7('0xf'),_0xd437f4,_0x531f10);_0x309db8(_0x531f10);});});}exports[_0x4fa7('0x17')]=function(_0x3bdbc3){var _0x40f6b8=this;return new Promise(function(_0x34976b,_0x4869ef){return db[_0x4fa7('0x18')]['update'](_0x3bdbc3[_0x4fa7('0x19')],{'raw':_0x3bdbc3['options']?_0x3bdbc3['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bdbc3[_0x4fa7('0x1a')]?_0x3bdbc3[_0x4fa7('0x1a')][_0x4fa7('0x1b')]||null:null,'attributes':_0x3bdbc3[_0x4fa7('0x1a')]?_0x3bdbc3['options'][_0x4fa7('0x1c')]||null:null,'limit':_0x3bdbc3['options']?_0x3bdbc3[_0x4fa7('0x1a')][_0x4fa7('0x1d')]||null:null})[_0x4fa7('0xd')](function(_0x4b2f4d){logger[_0x4fa7('0xe')]('UpdateMailInteraction',_0x3bdbc3);logger[_0x4fa7('0x11')](_0x4fa7('0x17'),_0x3bdbc3,JSON[_0x4fa7('0x12')](_0x4b2f4d));_0x34976b(_0x4b2f4d);})[_0x4fa7('0x16')](function(_0x164795){logger[_0x4fa7('0x13')](_0x4fa7('0x17'),_0x164795[_0x4fa7('0x15')],_0x3bdbc3);_0x4869ef(_0x40f6b8[_0x4fa7('0x13')](0x1f4,_0x164795[_0x4fa7('0x15')]));});});};exports[_0x4fa7('0x1e')]=function(_0x28c058){return new Promise(function(_0x3a8bf0,_0x541d6c){return db[_0x4fa7('0x18')][_0x4fa7('0x1f')]({'where':_0x28c058[_0x4fa7('0x1a')]?_0x28c058[_0x4fa7('0x1a')][_0x4fa7('0x1b')]||null:null})[_0x4fa7('0xd')](function(_0x26b935){if(_0x26b935){return _0x26b935[_0x4fa7('0x20')](_0x28c058[_0x4fa7('0x19')][_0x4fa7('0x21')],_[_0x4fa7('0x22')](_0x28c058[_0x4fa7('0x19')],['ids','id'])||{});}})['spread'](function(_0x3a97c0){logger['info'](_0x4fa7('0x23'),_0x28c058);logger['debug']('AddTags',_0x28c058,JSON[_0x4fa7('0x12')](_0x3a97c0));_0x3a8bf0(_0x3a97c0);})[_0x4fa7('0x16')](function(_0x57466b){logger[_0x4fa7('0x13')](_0x4fa7('0x23'),_0x57466b[_0x4fa7('0x15')],_0x28c058);_0x541d6c(_this[_0x4fa7('0x13')](0x1f4,_0x57466b['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 80f223a..8b26648 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 _0x3b48=['./mailInteraction.events','remove','update','removeListener','register','length'];(function(_0x24065b,_0x1775ba){var _0x88b0b7=function(_0x1143fc){while(--_0x1143fc){_0x24065b['push'](_0x24065b['shift']());}};_0x88b0b7(++_0x1775ba);}(_0x3b48,0x66));var _0x83b4=function(_0x32c58c,_0x24a551){_0x32c58c=_0x32c58c-0x0;var _0x5c1383=_0x3b48[_0x32c58c];return _0x5c1383;};'use strict';var MailInteractionEvents=require(_0x83b4('0x0'));var events=['save',_0x83b4('0x1'),_0x83b4('0x2')];function createListener(_0x11ad5e,_0xd496b2){return function(_0x6ea8e8){_0xd496b2['emit'](_0x11ad5e,_0x6ea8e8);};}function removeListener(_0x5d5057,_0x46a98d){return function(){MailInteractionEvents[_0x83b4('0x3')](_0x5d5057,_0x46a98d);};}exports[_0x83b4('0x4')]=function(_0xb0901d){for(var _0x4d9d9f=0x0,_0x6e5ce6=events[_0x83b4('0x5')];_0x4d9d9f<_0x6e5ce6;_0x4d9d9f++){var _0x31d094=events[_0x4d9d9f];var _0x9840c=createListener('mailInteraction:'+_0x31d094,_0xb0901d);MailInteractionEvents['on'](_0x31d094,_0x9840c);}}; \ No newline at end of file +var _0xeec6=['register','length','mailInteraction:','./mailInteraction.events','save','remove','emit','removeListener'];(function(_0x561e8c,_0x5a1abd){var _0x333db6=function(_0x15fd8e){while(--_0x15fd8e){_0x561e8c['push'](_0x561e8c['shift']());}};_0x333db6(++_0x5a1abd);}(_0xeec6,0x1c3));var _0x6eec=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0xeec6[_0x2a0183];return _0x158c3a;};'use strict';var MailInteractionEvents=require(_0x6eec('0x0'));var events=[_0x6eec('0x1'),_0x6eec('0x2'),'update'];function createListener(_0x5d6acb,_0x36abf7){return function(_0x38ad22){_0x36abf7[_0x6eec('0x3')](_0x5d6acb,_0x38ad22);};}function removeListener(_0xcdec44,_0x5b66cc){return function(){MailInteractionEvents[_0x6eec('0x4')](_0xcdec44,_0x5b66cc);};}exports[_0x6eec('0x5')]=function(_0x4490b7){for(var _0x372baf=0x0,_0x5840ca=events[_0x6eec('0x6')];_0x372baf<_0x5840ca;_0x372baf++){var _0x46a3c7=events[_0x372baf];var _0x17b7e8=createListener(_0x6eec('0x7')+_0x46a3c7,_0x4490b7);MailInteractionEvents['on'](_0x46a3c7,_0x17b7e8);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index c03777c..97c0a20 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 _0x4a1d=['/:id/download','download','tracked','mail','create','put','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4a1d,0x77));var _0xd4a1=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x4a1d[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0xd4a1('0x0'));var util=require(_0xd4a1('0x1'));var path=require(_0xd4a1('0x2'));var timeout=require(_0xd4a1('0x3'));var express=require(_0xd4a1('0x4'));var router=express['Router']();var fs_extra=require(_0xd4a1('0x5'));var auth=require(_0xd4a1('0x6'));var interaction=require(_0xd4a1('0x7'));var config=require(_0xd4a1('0x8'));var controller=require(_0xd4a1('0x9'));router[_0xd4a1('0xa')]('/',auth[_0xd4a1('0xb')](),controller[_0xd4a1('0xc')]);router['get'](_0xd4a1('0xd'),auth[_0xd4a1('0xb')](),controller[_0xd4a1('0xe')]);router[_0xd4a1('0xa')](_0xd4a1('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xd4a1('0xa')](_0xd4a1('0x10'),auth[_0xd4a1('0xb')](),controller[_0xd4a1('0x11')]);router['post']('/',auth[_0xd4a1('0xb')](),interaction[_0xd4a1('0x12')](_0xd4a1('0x13'),'mailmessage:create'),controller[_0xd4a1('0x14')]);router[_0xd4a1('0x15')](_0xd4a1('0xf'),auth[_0xd4a1('0xb')](),controller['update']);router[_0xd4a1('0x15')](_0xd4a1('0x16'),auth[_0xd4a1('0xb')](),controller['accept']);router[_0xd4a1('0x15')](_0xd4a1('0x17'),auth[_0xd4a1('0xb')](),controller[_0xd4a1('0x18')]);router['delete']('/:id',auth[_0xd4a1('0xb')](),controller[_0xd4a1('0x19')]);module[_0xd4a1('0x1a')]=router; \ No newline at end of file +var _0x3308=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','create','update','put','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x3308,0x160));var _0x8330=function(_0x3081f4,_0x3d465d){_0x3081f4=_0x3081f4-0x0;var _0x68ec2a=_0x3308[_0x3081f4];return _0x68ec2a;};'use strict';var multer=require(_0x8330('0x0'));var util=require(_0x8330('0x1'));var path=require(_0x8330('0x2'));var timeout=require(_0x8330('0x3'));var express=require(_0x8330('0x4'));var router=express[_0x8330('0x5')]();var fs_extra=require(_0x8330('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8330('0x7'));var controller=require('./mailMessage.controller');router[_0x8330('0x8')]('/',auth[_0x8330('0x9')](),controller[_0x8330('0xa')]);router['get'](_0x8330('0xb'),auth[_0x8330('0x9')](),controller[_0x8330('0xc')]);router[_0x8330('0x8')](_0x8330('0xd'),auth[_0x8330('0x9')](),controller['show']);router[_0x8330('0x8')](_0x8330('0xe'),auth[_0x8330('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),interaction['tracked']('mail','mailmessage:create'),controller[_0x8330('0xf')]);router['put'](_0x8330('0xd'),auth[_0x8330('0x9')](),controller[_0x8330('0x10')]);router[_0x8330('0x11')](_0x8330('0x12'),auth['isAuthenticated'](),controller[_0x8330('0x13')]);router['put'](_0x8330('0x14'),auth[_0x8330('0x9')](),controller[_0x8330('0x15')]);router[_0x8330('0x16')](_0x8330('0xd'),auth[_0x8330('0x9')](),controller[_0x8330('0x17')]);module[_0x8330('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 6a5549d..7a12faa 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 _0x97dd=['TEXT','medium','BOOLEAN','INTEGER','DATE','ENUM','Chat','Email','sequelize','long'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x97dd,0xd0));var _0xd97d=function(_0x1207ac,_0xb1e3fb){_0x1207ac=_0x1207ac-0x0;var _0x56b6b8=_0x97dd[_0x1207ac];return _0x56b6b8;};'use strict';var Sequelize=require(_0xd97d('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize['TEXT'](_0xd97d('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xd97d('0x2')](_0xd97d('0x3'))},'read':{'type':Sequelize[_0xd97d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xd97d('0x2')](_0xd97d('0x1'))},'cc':{'type':Sequelize[_0xd97d('0x2')](_0xd97d('0x1'))},'bcc':{'type':Sequelize[_0xd97d('0x2')](_0xd97d('0x1'))},'subject':{'type':Sequelize[_0xd97d('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xd97d('0x5')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xd97d('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xd97d('0x6')]},'originTo':{'type':Sequelize[_0xd97d('0x2')](_0xd97d('0x1'))},'originCc':{'type':Sequelize['TEXT'](_0xd97d('0x1'))},'originChannel':{'type':Sequelize[_0xd97d('0x7')]('Email',_0xd97d('0x8')),'defaultValue':_0xd97d('0x9'),'allowNull':![]}}; \ No newline at end of file +var _0xb3e3=['Email','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER'];(function(_0x5de214,_0x107e9d){var _0x4df627=function(_0x4199e1){while(--_0x4199e1){_0x5de214['push'](_0x5de214['shift']());}};_0x4df627(++_0x107e9d);}(_0xb3e3,0x194));var _0x3b3e=function(_0x1a0c0b,_0x2884c2){_0x1a0c0b=_0x1a0c0b-0x0;var _0x26bb83=_0xb3e3[_0x1a0c0b];return _0x26bb83;};'use strict';var Sequelize=require(_0x3b3e('0x0'));var _=require(_0x3b3e('0x1'));module[_0x3b3e('0x2')]={'body':{'type':Sequelize[_0x3b3e('0x3')](_0x3b3e('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x3b3e('0x3')](_0x3b3e('0x5'))},'read':{'type':Sequelize[_0x3b3e('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3b3e('0x7')]('in',_0x3b3e('0x8')),'defaultValue':_0x3b3e('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3b3e('0x9')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x3b3e('0x3')]('long')},'cc':{'type':Sequelize[_0x3b3e('0x3')](_0x3b3e('0x4'))},'bcc':{'type':Sequelize[_0x3b3e('0x3')](_0x3b3e('0x4'))},'subject':{'type':Sequelize[_0x3b3e('0x3')]},'sentAt':{'type':Sequelize[_0x3b3e('0xa')]},'attach':{'type':Sequelize[_0x3b3e('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x3b3e('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x3b3e('0xa')]},'originTo':{'type':Sequelize[_0x3b3e('0x3')](_0x3b3e('0x4'))},'originCc':{'type':Sequelize[_0x3b3e('0x3')]('long')},'originChannel':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0xc'),'Chat'),'defaultValue':_0x3b3e('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 27eb7e5..50a3655 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 _0x6759=['secure','authentication','user','pass','auth','attachments','join','root','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','mail','readAt','format','UserId','agent','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','User','motionChannel','fromString','rejectmessage','unix','toString','files','tmp','from','bcc','subject','createdAt','Attachment','Attachments','decode','headers','Bcc','push','readFileSync','build','writeFileSync','download','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','json','undefined','count','offset','set','Content-Range','update','destroy','name','send','index','MailMessage','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','includeAll','rows','catch','show','params','keys','rawAttributes','include','options','find','body','describe','create','out','secret','split','MailAccount','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port'];(function(_0x11121c,_0x1075e0){var _0x2ef372=function(_0x4faa10){while(--_0x4faa10){_0x11121c['push'](_0x11121c['shift']());}};_0x2ef372(++_0x1075e0);}(_0x6759,0xf2));var _0x9675=function(_0x4b3ec4,_0x3c573c){_0x4b3ec4=_0x4b3ec4-0x0;var _0x192836=_0x6759[_0x4b3ec4];return _0x192836;};'use strict';var emlformat=require(_0x9675('0x0'));var moment=require(_0x9675('0x1'));var BPromise=require(_0x9675('0x2'));var util=require(_0x9675('0x3'));var path=require(_0x9675('0x4'));var fs=require('fs');var _=require(_0x9675('0x5'));var Redis=require(_0x9675('0x6'));var htmlToText=require(_0x9675('0x7'));var qs=require(_0x9675('0x8'));var logger=require(_0x9675('0x9'))('api');var interaction_log=require(_0x9675('0x9'))(_0x9675('0xa'));var config=require(_0x9675('0xb'));var db=require(_0x9675('0xc'))['db'];config[_0x9675('0xd')]=_[_0x9675('0xe')](config['redis'],{'host':_0x9675('0xf'),'port':0x18eb});var socket=require(_0x9675('0x10'))(new Redis(config[_0x9675('0xd')]));var htmlEntities=require(_0x9675('0x11'));require('./mailMessage.socket')['register'](socket);var jayson=require(_0x9675('0x12'));var client=jayson['client'][_0x9675('0x13')]({'port':0x232c});var client9003=jayson[_0x9675('0x14')][_0x9675('0x13')]({'port':0x232b});var client9002=jayson['client'][_0x9675('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x5b38d0,_0x16388a,_0x2ecd60,_0x510afe){return new BPromise(function(_0x3ab62a,_0x37b254){var _0x1dfaad=_0x510afe||client;return _0x1dfaad[_0x9675('0x15')](_0x5b38d0,_0x2ecd60)[_0x9675('0x16')](function(_0x293bc4){logger[_0x9675('0x17')](_0x9675('0x18'),_0x16388a,'request\x20sent');logger[_0x9675('0x19')](_0x9675('0x1a'),_0x16388a,_0x9675('0x1b'),JSON[_0x9675('0x1c')](_0x293bc4));if(_0x293bc4[_0x9675('0x1d')]){if(_0x293bc4[_0x9675('0x1d')][_0x9675('0x1e')]===0x1f4){logger[_0x9675('0x1d')](_0x9675('0x18'),_0x16388a,_0x293bc4[_0x9675('0x1d')][_0x9675('0x1f')]);return _0x37b254(_0x293bc4[_0x9675('0x1d')][_0x9675('0x1f')]);}logger[_0x9675('0x1d')]('MailMessage,\x20%s,\x20%s',_0x16388a,_0x293bc4[_0x9675('0x1d')][_0x9675('0x1f')]);return _0x3ab62a(_0x293bc4[_0x9675('0x1d')][_0x9675('0x1f')]);}else{logger[_0x9675('0x17')](_0x9675('0x18'),_0x16388a,_0x9675('0x1b'));_0x3ab62a(_0x293bc4[_0x9675('0x20')][_0x9675('0x1f')]);}})['catch'](function(_0x166c4f){logger[_0x9675('0x1d')]('MailMessage,\x20%s,\x20%s',_0x16388a,_0x166c4f);_0x37b254(_0x166c4f);});});}function respondWithResult(_0x2bec45,_0x4b1b94){_0x4b1b94=_0x4b1b94||0xc8;return function(_0x16085a){if(_0x16085a){return _0x2bec45[_0x9675('0x21')](_0x4b1b94)[_0x9675('0x22')](_0x16085a);}};}function respondWithFilteredResult(_0xee0050,_0x3b35ec){return function(_0x1b12a4){if(_0x1b12a4){var _0x3ec76c=typeof _0x3b35ec['offset']===_0x9675('0x23')&&typeof _0x3b35ec['limit']===_0x9675('0x23');var _0x49c4aa=_0x1b12a4[_0x9675('0x24')];var _0xbeb645=_0x3ec76c?0x0:_0x3b35ec[_0x9675('0x25')];var _0x1c7c03=_0x3ec76c?_0x1b12a4['count']:_0x3b35ec['offset']+_0x3b35ec['limit'];var _0x38152d;if(_0x1c7c03>=_0x49c4aa){_0x1c7c03=_0x49c4aa;_0x38152d=0xc8;}else{_0x38152d=0xce;}_0xee0050[_0x9675('0x21')](_0x38152d);return _0xee0050[_0x9675('0x26')](_0x9675('0x27'),_0xbeb645+'-'+_0x1c7c03+'/'+_0x49c4aa)[_0x9675('0x22')](_0x1b12a4);}return null;};}function saveUpdates(_0x56eadd){return function(_0x42cd99){if(_0x42cd99){return _0x42cd99[_0x9675('0x28')](_0x56eadd)[_0x9675('0x16')](function(_0xf6822f){return _0xf6822f;});}return null;};}function removeEntity(_0x28b24b){return function(_0x506146){if(_0x506146){return _0x506146[_0x9675('0x29')]()[_0x9675('0x16')](function(){_0x28b24b[_0x9675('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e2e0f){return function(_0x4c543d){if(!_0x4c543d){_0x2e2e0f['sendStatus'](0x194);}return _0x4c543d;};}function handleError(_0x303431,_0x25e584){_0x25e584=_0x25e584||0x1f4;return function(_0x606d3f){logger['error'](_0x606d3f['stack']);if(_0x606d3f[_0x9675('0x2a')]){delete _0x606d3f[_0x9675('0x2a')];}_0x303431[_0x9675('0x21')](_0x25e584)[_0x9675('0x2b')](_0x606d3f);};}exports[_0x9675('0x2c')]=function(_0x168aff,_0x5573b0){var _0x175dfe={},_0x4f2a57={},_0x16e54f={'count':0x0,'rows':[]};var _0x25a5c0=_['map'](db[_0x9675('0x2d')]['rawAttributes'],function(_0x42f8a1){return{'name':_0x42f8a1[_0x9675('0x2e')],'type':_0x42f8a1[_0x9675('0x2f')][_0x9675('0x30')]};});_0x4f2a57[_0x9675('0x31')]=_['map'](_0x25a5c0,_0x9675('0x2a'));_0x4f2a57['query']=_['keys'](_0x168aff[_0x9675('0x32')]);_0x4f2a57['filters']=_[_0x9675('0x33')](_0x4f2a57[_0x9675('0x31')],_0x4f2a57[_0x9675('0x32')]);_0x175dfe[_0x9675('0x34')]=_[_0x9675('0x33')](_0x4f2a57[_0x9675('0x31')],qs['fields'](_0x168aff['query'][_0x9675('0x35')]));_0x175dfe[_0x9675('0x34')]=_0x175dfe[_0x9675('0x34')][_0x9675('0x36')]?_0x175dfe[_0x9675('0x34')]:_0x4f2a57[_0x9675('0x31')];if(!_0x168aff[_0x9675('0x32')][_0x9675('0x37')](_0x9675('0x38'))){_0x175dfe['limit']=qs[_0x9675('0x39')](_0x168aff[_0x9675('0x32')][_0x9675('0x39')]);_0x175dfe[_0x9675('0x25')]=qs[_0x9675('0x25')](_0x168aff[_0x9675('0x32')][_0x9675('0x25')]);}_0x175dfe[_0x9675('0x3a')]=qs[_0x9675('0x3b')](_0x168aff[_0x9675('0x32')][_0x9675('0x3b')]);_0x175dfe[_0x9675('0x3c')]=qs[_0x9675('0x3d')](_[_0x9675('0x3e')](_0x168aff[_0x9675('0x32')],_0x4f2a57['filters']),_0x25a5c0);if(_0x168aff[_0x9675('0x32')][_0x9675('0x3f')]){_0x175dfe['where']=_[_0x9675('0x40')](_0x175dfe[_0x9675('0x3c')],{'$or':_[_0x9675('0x41')](_0x25a5c0,function(_0xec271d){if(_0xec271d[_0x9675('0x2f')]!==_0x9675('0x42')){var _0x1d791b={};_0x1d791b[_0xec271d[_0x9675('0x2a')]]={'$like':'%'+_0x168aff[_0x9675('0x32')][_0x9675('0x3f')]+'%'};return _0x1d791b;}})});}_0x175dfe=_[_0x9675('0x40')]({},_0x175dfe,_0x168aff['options']);var _0x88fcb2={'where':_0x175dfe[_0x9675('0x3c')]};return db[_0x9675('0x2d')]['count'](_0x88fcb2)[_0x9675('0x16')](function(_0x10d7d5){_0x16e54f['count']=_0x10d7d5;if(_0x168aff['query'][_0x9675('0x43')]){_0x175dfe['include']=[{'all':!![]}];}return db[_0x9675('0x2d')]['findAll'](_0x175dfe);})['then'](function(_0x4adee5){_0x16e54f[_0x9675('0x44')]=_0x4adee5;return _0x16e54f;})[_0x9675('0x16')](respondWithFilteredResult(_0x5573b0,_0x175dfe))[_0x9675('0x45')](handleError(_0x5573b0,null));};exports[_0x9675('0x46')]=function(_0x2d75b7,_0x4a63d2){var _0x4499cc={'raw':!![],'where':{'id':_0x2d75b7[_0x9675('0x47')]['id']}},_0x474475={};_0x474475[_0x9675('0x31')]=_[_0x9675('0x48')](db[_0x9675('0x2d')][_0x9675('0x49')]);_0x474475[_0x9675('0x32')]=_['keys'](_0x2d75b7['query']);_0x474475[_0x9675('0x3d')]=_[_0x9675('0x33')](_0x474475['model'],_0x474475[_0x9675('0x32')]);_0x4499cc[_0x9675('0x34')]=_[_0x9675('0x33')](_0x474475[_0x9675('0x31')],qs[_0x9675('0x35')](_0x2d75b7[_0x9675('0x32')][_0x9675('0x35')]));_0x4499cc[_0x9675('0x34')]=_0x4499cc[_0x9675('0x34')][_0x9675('0x36')]?_0x4499cc['attributes']:_0x474475['model'];if(_0x2d75b7[_0x9675('0x32')]['includeAll']){_0x4499cc[_0x9675('0x4a')]=[{'all':!![]}];}_0x4499cc=_['merge']({},_0x4499cc,_0x2d75b7[_0x9675('0x4b')]);return db[_0x9675('0x2d')][_0x9675('0x4c')](_0x4499cc)[_0x9675('0x16')](handleEntityNotFound(_0x4a63d2,null))[_0x9675('0x16')](respondWithResult(_0x4a63d2,null))[_0x9675('0x45')](handleError(_0x4a63d2,null));};exports[_0x9675('0x28')]=function(_0x15126f,_0x3cb441){if(_0x15126f[_0x9675('0x4d')]['id']){delete _0x15126f[_0x9675('0x4d')]['id'];}return db[_0x9675('0x2d')][_0x9675('0x4c')]({'where':{'id':_0x15126f['params']['id']}})[_0x9675('0x16')](handleEntityNotFound(_0x3cb441,null))['then'](saveUpdates(_0x15126f[_0x9675('0x4d')],null))['then'](respondWithResult(_0x3cb441,null))[_0x9675('0x45')](handleError(_0x3cb441,null));};exports[_0x9675('0x29')]=function(_0x237b29,_0x34dc60){return db[_0x9675('0x2d')][_0x9675('0x4c')]({'where':{'id':_0x237b29['params']['id']}})[_0x9675('0x16')](handleEntityNotFound(_0x34dc60,null))[_0x9675('0x16')](removeEntity(_0x34dc60,null))[_0x9675('0x45')](handleError(_0x34dc60,null));};exports[_0x9675('0x4e')]=function(_0x136b1e,_0x8dcd22){return db[_0x9675('0x2d')][_0x9675('0x4e')]()['then'](respondWithResult(_0x8dcd22,null))[_0x9675('0x45')](handleError(_0x8dcd22,null));};exports['create']=function(_0x8e0f4f,_0x35f7d0){return db['MailMessage'][_0x9675('0x4f')](_0x8e0f4f['body'])['then'](function(_0x1c4d1b){if(_0x1c4d1b){if(_0x1c4d1b['direction']===_0x9675('0x50')&&!_0x1c4d1b[_0x9675('0x51')]){var _0x2ac9cf,_0x1e5ecc,_0x3cbd12;if(_0x8e0f4f[_0x9675('0x4d')]['to']){_0x1e5ecc=_0x8e0f4f[_0x9675('0x4d')]['to'][_0x9675('0x52')](',')[0x0];}return db[_0x9675('0x53')]['findOne']({'where':{'id':_0x1c4d1b[_0x9675('0x54')]},'include':[{'model':db[_0x9675('0x55')],'as':'List','include':[{'model':db[_0x9675('0x56')],'as':_0x9675('0x57'),'where':{'email':_0x1e5ecc},'limit':0x1,'order':[[_0x9675('0x58'),_0x9675('0x59')]]}]},{'model':db[_0x9675('0x5a')],'as':_0x9675('0x5b'),'raw':!![]}]})[_0x9675('0x16')](function(_0x3fc737){_0x2ac9cf=_0x3fc737;if(_0x2ac9cf&&_0x2ac9cf[_0x9675('0x5b')]){var _0x454c98={'tls':{'rejectUnauthorized':![]}};if(_[_0x9675('0x5c')](_0x2ac9cf['Smtp'][_0x9675('0x5d')])){_0x454c98[_0x9675('0x5e')]=_0x2ac9cf[_0x9675('0x5b')][_0x9675('0x5e')];_0x454c98[_0x9675('0x5f')]=_0x2ac9cf[_0x9675('0x5b')][_0x9675('0x5f')];_0x454c98[_0x9675('0x60')]=_0x2ac9cf[_0x9675('0x5b')][_0x9675('0x60')];if(_0x2ac9cf[_0x9675('0x5b')][_0x9675('0x61')]){_0x454c98['auth']={'user':_0x2ac9cf['Smtp'][_0x9675('0x62')],'pass':_0x2ac9cf[_0x9675('0x5b')][_0x9675('0x63')]};}}else{_0x454c98[_0x9675('0x5d')]=_0x2ac9cf[_0x9675('0x5b')][_0x9675('0x5d')];_0x454c98[_0x9675('0x64')]={'user':_0x2ac9cf[_0x9675('0x5b')][_0x9675('0x62')],'pass':_0x2ac9cf[_0x9675('0x5b')][_0x9675('0x63')]};_0x454c98[_0x9675('0x60')]=_0x2ac9cf[_0x9675('0x5b')][_0x9675('0x60')];}if(_0x8e0f4f['body'][_0x9675('0x65')]&&_0x8e0f4f[_0x9675('0x4d')][_0x9675('0x65')][_0x9675('0x36')]){for(var _0x275efe=0x0;_0x275efe<_0x8e0f4f['body']['attachments'][_0x9675('0x36')];_0x275efe+=0x1){_0x8e0f4f[_0x9675('0x4d')][_0x9675('0x65')][_0x275efe]={'filename':_0x8e0f4f[_0x9675('0x4d')][_0x9675('0x65')][_0x275efe][_0x9675('0x2a')],'path':path[_0x9675('0x66')](config[_0x9675('0x67')],'server/files/attachments',_0x8e0f4f['body'][_0x9675('0x65')][_0x275efe][_0x9675('0x68')])};}}_0x3cbd12={'account':_0x454c98,'message':_0x8e0f4f[_0x9675('0x4d')]};return;}})[_0x9675('0x16')](function(){if(_0x2ac9cf[_0x9675('0x69')]){if(_0x2ac9cf['List']['Contacts'][_0x9675('0x36')]){return _0x2ac9cf['List'][_0x9675('0x57')][0x0];}else{return db[_0x9675('0x56')][_0x9675('0x4f')](_[_0x9675('0xe')](_0x8e0f4f['body'],{'firstName':_0x8e0f4f['body']['to'],'email':_0x8e0f4f[_0x9675('0x4d')]['to'],'phone':_0x8e0f4f[_0x9675('0x4d')]['to'],'ListId':_0x2ac9cf[_0x9675('0x6a')]}));}}else{throw new Error(_0x9675('0x6b'));}})[_0x9675('0x16')](function(){if(_0x3cbd12){return respondWithRpcPromise(_0x9675('0x6c'),_0x9675('0x6d'),_0x3cbd12,client9003)['then'](function(_0x32e7a9){return _0x1c4d1b[_0x9675('0x28')]({'read':!![],'messageId':_0x32e7a9[_0x9675('0x6e')],'sentAt':moment()['format'](_0x9675('0x6f'))});})[_0x9675('0x45')](function(_0x444aa6){logger['error']('%s',JSON['stringify'](_0x444aa6));return _0x1c4d1b;});}return _0x1c4d1b;});}return _0x1c4d1b;}})[_0x9675('0x16')](respondWithResult(_0x35f7d0,0xc9))[_0x9675('0x45')](handleError(_0x35f7d0,null));};exports['accept']=function(_0x258d78,_0xd61e07){var _0x30602e={'agent':{},'channel':_0x9675('0x70')};if(_0x258d78[_0x9675('0x4d')]['id']){delete _0x258d78[_0x9675('0x4d')]['id'];}_0x258d78[_0x9675('0x4d')]['read']=!![];_0x258d78[_0x9675('0x4d')][_0x9675('0x71')]=moment()[_0x9675('0x72')]('YYYY-MM-DD\x20HH:mm:ss');_0x258d78[_0x9675('0x4d')][_0x9675('0x73')]=_0x258d78['body']['UserId']||_0x258d78['user']['id'];_0x30602e[_0x9675('0x74')]['id']=_0x258d78['body'][_0x9675('0x73')];return db[_0x9675('0x2d')][_0x9675('0x4c')]({'where':{'id':_0x258d78[_0x9675('0x47')]['id'],'UserId':null}})[_0x9675('0x16')](handleEntityNotFound(_0xd61e07,null))[_0x9675('0x16')](saveUpdates(_0x258d78[_0x9675('0x4d')],null))[_0x9675('0x16')](function(_0x315d8f){if(_0x315d8f){_0x30602e[_0x9675('0x1f')]=_0x315d8f[_0x9675('0x75')]({'plain':!![]});return db[_0x9675('0x76')][_0x9675('0x4c')]({'where':{'id':_0x315d8f['MailInteractionId']}});}return null;})[_0x9675('0x16')](handleEntityNotFound(_0xd61e07,null))[_0x9675('0x16')](function(_0xbb3851){if(_0xbb3851){return _0xbb3851[_0x9675('0x28')]({'UserId':_0x258d78[_0x9675('0x4d')][_0x9675('0x73')],'read1stAt':_[_0x9675('0x5c')](_0xbb3851[_0x9675('0x77')])?moment()[_0x9675('0x72')](_0x9675('0x6f')):undefined});}return null;})['then'](function(_0x2c7766){if(_0x2c7766){_0x30602e[_0x9675('0x78')]=_0x2c7766[_0x9675('0x75')]({'plain':!![]});interaction_log['info'](_0x9675('0x79'),_0x258d78['user']['id'],_0x258d78[_0x9675('0x62')]['name'],_0x258d78['user'][_0x9675('0x7a')],_0x30602e[_0x9675('0x78')]['id'],_0x258d78[_0x9675('0x4d')]?JSON[_0x9675('0x1c')](_0x258d78[_0x9675('0x4d')]):_0x9675('0x7b'));return respondWithRpcPromise(_0x9675('0x7c'),_0x9675('0x7d'),_0x30602e);}return null;})[_0x9675('0x16')](function(_0x496583){var _0x2f58f0=_0x9675('0x7e')+_0x496583[_0x9675('0x1f')][_0x9675('0x7f')];return db['sequelize'][_0x9675('0x32')](_0x2f58f0,{'type':db[_0x9675('0x80')][_0x9675('0x81')][_0x9675('0x82')],'raw':!![]})['then'](function(_0x4f79dd){return _0x4f79dd;});})['then'](function(_0x42c85a){if(_0x42c85a){_0x30602e[_0x9675('0x1f')][_0x9675('0x83')]=_0x42c85a[0x0];if(!_0x258d78['body'][_0x9675('0x73')])return;return db['User']['find']({'where':{'id':_0x258d78['body'][_0x9675('0x73')],'role':_0x9675('0x74')},'attributes':['id',_0x9675('0x2a'),_0x9675('0x84'),_0x9675('0x85'),_0x9675('0x86')],'raw':!![]});}return null;})[_0x9675('0x16')](function(_0x377c57){if(!_0x377c57)return null;_0x30602e[_0x9675('0x1f')][_0x9675('0x74')]=_0x377c57;return _0x30602e;})['then'](function(_0x34bf07){if(_0x34bf07){if(_0x258d78[_0x9675('0x4d')][_0x9675('0x87')]){_0x30602e[_0x9675('0x1f')][_0x9675('0x88')]=util[_0x9675('0x72')](_0x9675('0x89'),_0x258d78[_0x9675('0x62')][_0x9675('0x2a')]);_0x30602e[_0x9675('0x1f')]['channel']=_0x30602e[_0x9675('0x8a')];_0x30602e[_0x9675('0x1f')]['motionChannel']=_0x30602e['channel'];_0x30602e['message'][_0x9675('0x8b')]=_0x9675('0x8c');_0x30602e[_0x9675('0x1f')]['body']=htmlToText['fromString'](_0x30602e[_0x9675('0x1f')][_0x9675('0x4d')]);return respondWithRpcPromise(_0x9675('0x8d'),_0x9675('0x8d'),{'event':_0x9675('0x8e'),'message':_0x30602e[_0x9675('0x1f')]},client9002)['then'](function(){return _0x30602e;});}return _0x30602e;}return null;})['then'](respondWithResult(_0xd61e07,null))[_0x9675('0x45')](handleError(_0xd61e07,null));};exports[_0x9675('0x8f')]=function(_0x122213,_0x5111f4){var _0x529f45={'agent':{},'channel':_0x9675('0x70')};if(_0x122213[_0x9675('0x4d')]['id']){delete _0x122213[_0x9675('0x4d')]['id'];}_0x122213[_0x9675('0x4d')][_0x9675('0x73')]=_0x122213[_0x9675('0x4d')][_0x9675('0x73')]||_0x122213[_0x9675('0x62')]['id'];_0x529f45[_0x9675('0x74')]['id']=_0x122213[_0x9675('0x4d')][_0x9675('0x73')];return db[_0x9675('0x2d')]['find']({'where':{'id':_0x122213[_0x9675('0x47')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5111f4,null))['then'](function(_0x3da104){if(_0x3da104){_0x529f45[_0x9675('0x1f')]=_0x3da104['get']({'plain':!![]});return db['MailInteraction'][_0x9675('0x4c')]({'where':{'id':_0x3da104[_0x9675('0x90')]}});}return null;})[_0x9675('0x16')](handleEntityNotFound(_0x5111f4,null))[_0x9675('0x16')](function(_0x4b4d79){if(_0x4b4d79){_0x529f45[_0x9675('0x78')]=_0x4b4d79[_0x9675('0x75')]({'plain':!![]});interaction_log[_0x9675('0x17')](_0x9675('0x91'),_0x122213['user']['id'],_0x122213['user'][_0x9675('0x2a')],_0x122213[_0x9675('0x62')][_0x9675('0x7a')],_0x529f45[_0x9675('0x78')]['id'],_0x122213[_0x9675('0x4d')]?JSON[_0x9675('0x1c')](_0x122213[_0x9675('0x4d')]):_0x9675('0x7b'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x529f45);}return null;})[_0x9675('0x16')](function(_0x3672e5){var _0x262f54=_0x9675('0x7e')+_0x3672e5['message'][_0x9675('0x7f')];return db['sequelize']['query'](_0x262f54,{'type':db[_0x9675('0x80')]['QueryTypes']['SELECT'],'raw':!![]})[_0x9675('0x16')](function(_0x521f7e){return _0x521f7e;});})[_0x9675('0x16')](function(_0x11c459){if(_0x11c459){_0x529f45[_0x9675('0x1f')][_0x9675('0x83')]=_0x11c459[0x0];if(!_0x122213[_0x9675('0x4d')][_0x9675('0x73')])return;return db[_0x9675('0x92')][_0x9675('0x4c')]({'where':{'id':_0x122213[_0x9675('0x4d')]['UserId'],'role':_0x9675('0x74')},'attributes':['id',_0x9675('0x2a'),_0x9675('0x84'),_0x9675('0x85'),_0x9675('0x86')],'raw':!![]});}return null;})['then'](function(_0x357295){if(!_0x357295)return null;_0x529f45[_0x9675('0x1f')][_0x9675('0x74')]=_0x357295;return _0x529f45;})[_0x9675('0x16')](function(_0x3a13d4){if(_0x3a13d4){_0x3a13d4[_0x9675('0x1f')]['interface']=util[_0x9675('0x72')]('SIP/%s',_0x122213['user'][_0x9675('0x2a')]);_0x3a13d4[_0x9675('0x1f')][_0x9675('0x8a')]=_0x529f45[_0x9675('0x8a')];_0x3a13d4[_0x9675('0x1f')][_0x9675('0x93')]=_0x529f45['channel'];_0x3a13d4[_0x9675('0x1f')][_0x9675('0x8b')]=_0x9675('0x8f');_0x3a13d4[_0x9675('0x1f')][_0x9675('0x4d')]=htmlToText[_0x9675('0x94')](_0x529f45[_0x9675('0x1f')][_0x9675('0x4d')]);respondWithRpcPromise(_0x9675('0x8d'),'EventManager',{'event':_0x9675('0x95'),'message':_0x3a13d4['message']},client9002);return _0x529f45;}return null;})[_0x9675('0x16')](respondWithResult(_0x5111f4,null))['catch'](handleError(_0x5111f4,null));};exports['download']=function(_0x3b37c5,_0xdadcc7){var _0x2174bb=moment()[_0x9675('0x96')]()[_0x9675('0x97')]();var _0x61d421=path[_0x9675('0x66')](config[_0x9675('0x67')],'server',_0x9675('0x98'),_0x9675('0x99'));var _0x4f2a73=path['join'](config['root'],'server',_0x9675('0x98'),_0x9675('0x65'));var _0x30b436=util[_0x9675('0x72')]('message-%s.eml',_0x2174bb);return db[_0x9675('0x2d')][_0x9675('0x4c')]({'where':{'id':_0x3b37c5['params']['id']},'attributes':['id',_0x9675('0x4d'),_0x9675('0x9a'),'to','cc',_0x9675('0x9b'),_0x9675('0x9c'),_0x9675('0x9d')],'include':_0x3b37c5[_0x9675('0x32')][_0x9675('0x65')]?[{'model':db[_0x9675('0x9e')],'as':_0x9675('0x9f')}]:undefined})[_0x9675('0x16')](handleEntityNotFound(_0xdadcc7,null))['then'](function(_0x831b5e){if(_0x831b5e){var _0x4155a6=_0x831b5e;var _0x52ee02={'from':_0x4155a6[_0x9675('0x9a')],'to':_0x4155a6['to'],'subject':_0x4155a6['subject'],'html':htmlEntities[_0x9675('0xa0')](_0x4155a6[_0x9675('0x4d')]),'headers':{'Date':moment(_0x4155a6['createdAt'])[_0x9675('0x72')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x831b5e['cc']){_0x52ee02[_0x9675('0xa1')]['Cc']=_0x831b5e['cc'];}if(_0x831b5e[_0x9675('0x9b')]){_0x52ee02[_0x9675('0xa1')][_0x9675('0xa2')]=_0x831b5e[_0x9675('0x9b')];}return new BPromise(function(_0x4e3b49,_0x34a969){if(_0x831b5e[_0x9675('0x9f')]){for(var _0x31731e=0x0;_0x31731e<_0x831b5e[_0x9675('0x9f')]['length'];_0x31731e++){var _0x496b01=_0x831b5e['Attachments'][_0x31731e];var _0x1aca79=path[_0x9675('0x66')](_0x4f2a73,_0x496b01[_0x9675('0x68')]);if(fs['existsSync'](_0x1aca79)){_0x52ee02[_0x9675('0x65')][_0x9675('0xa3')]({'name':_0x496b01[_0x9675('0x2a')],'contentType':_0x496b01[_0x9675('0x2f')],'data':fs[_0x9675('0xa4')](_0x1aca79)});}}}emlformat[_0x9675('0xa5')](_0x52ee02,function(_0x40122a,_0x5d5b5a){if(_0x40122a)return _0x34a969(_0x40122a);fs[_0x9675('0xa6')](path[_0x9675('0x66')](_0x61d421,_0x30b436),_0x5d5b5a);return _0x4e3b49(_0x5d5b5a);});});}})[_0x9675('0x16')](function(_0x4e48f2){if(_0x4e48f2){return _0xdadcc7[_0x9675('0xa7')](path[_0x9675('0x66')](_0x61d421,_0x30b436),_0x30b436,function(_0x5b273b){if(!_0x5b273b)fs[_0x9675('0xa8')](path[_0x9675('0x66')](_0x61d421,_0x30b436));});}})['catch'](handleError(_0xdadcc7,null));}; \ No newline at end of file +var _0xa45f=['destroy','end','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','params','include','options','find','describe','create','body','direction','secret','split','MailAccount','findOne','MailAccountId','List','CmContact','Contacts','DESC','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','ListId','SendMail','sendMail','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','interface','format','SIP/%s','channel','motionChannel','event','fromString','EventManager','reject','mail','RejectMessage','sequelize','contact','internal','rejectmessage','download','unix','server','files','tmp','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','readFileSync','build','writeFileSync','unlinkSync','eml-format','bluebird','util','path','lodash','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','update'];(function(_0x505184,_0x9f670d){var _0x1f741e=function(_0x3d833f){while(--_0x3d833f){_0x505184['push'](_0x505184['shift']());}};_0x1f741e(++_0x9f670d);}(_0xa45f,0x11a));var _0xfa45=function(_0x3ec803,_0x343601){_0x3ec803=_0x3ec803-0x0;var _0xfcebc8=_0xa45f[_0x3ec803];return _0xfcebc8;};'use strict';var emlformat=require(_0xfa45('0x0'));var moment=require('moment');var BPromise=require(_0xfa45('0x1'));var util=require(_0xfa45('0x2'));var path=require(_0xfa45('0x3'));var fs=require('fs');var _=require(_0xfa45('0x4'));var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0xfa45('0x5'));var logger=require('../../config/logger')(_0xfa45('0x6'));var interaction_log=require(_0xfa45('0x7'))(_0xfa45('0x8'));var config=require(_0xfa45('0x9'));var db=require(_0xfa45('0xa'))['db'];config[_0xfa45('0xb')]=_[_0xfa45('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfa45('0xb')]));var htmlEntities=require(_0xfa45('0xd'));require(_0xfa45('0xe'))[_0xfa45('0xf')](socket);var jayson=require(_0xfa45('0x10'));var client=jayson[_0xfa45('0x11')][_0xfa45('0x12')]({'port':0x232c});var client9003=jayson[_0xfa45('0x11')][_0xfa45('0x12')]({'port':0x232b});var client9002=jayson[_0xfa45('0x11')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b3f7e,_0x47824a,_0x8855f4,_0x1bd22b){return new BPromise(function(_0x30509e,_0x6ec847){var _0x4ac838=_0x1bd22b||client;return _0x4ac838[_0xfa45('0x13')](_0x4b3f7e,_0x8855f4)[_0xfa45('0x14')](function(_0x2181e5){logger[_0xfa45('0x15')](_0xfa45('0x16'),_0x47824a,_0xfa45('0x17'));logger[_0xfa45('0x18')](_0xfa45('0x19'),_0x47824a,'request\x20sent',JSON[_0xfa45('0x1a')](_0x2181e5));if(_0x2181e5['error']){if(_0x2181e5['error']['code']===0x1f4){logger[_0xfa45('0x1b')]('MailMessage,\x20%s,\x20%s',_0x47824a,_0x2181e5[_0xfa45('0x1b')][_0xfa45('0x1c')]);return _0x6ec847(_0x2181e5[_0xfa45('0x1b')]['message']);}logger[_0xfa45('0x1b')](_0xfa45('0x16'),_0x47824a,_0x2181e5[_0xfa45('0x1b')][_0xfa45('0x1c')]);return _0x30509e(_0x2181e5['error'][_0xfa45('0x1c')]);}else{logger['info'](_0xfa45('0x16'),_0x47824a,'request\x20sent');_0x30509e(_0x2181e5[_0xfa45('0x1d')]['message']);}})[_0xfa45('0x1e')](function(_0x565b64){logger[_0xfa45('0x1b')](_0xfa45('0x16'),_0x47824a,_0x565b64);_0x6ec847(_0x565b64);});});}function respondWithResult(_0x241436,_0x104c10){_0x104c10=_0x104c10||0xc8;return function(_0x4c4e6d){if(_0x4c4e6d){return _0x241436[_0xfa45('0x1f')](_0x104c10)[_0xfa45('0x20')](_0x4c4e6d);}};}function respondWithFilteredResult(_0x24470a,_0x583a66){return function(_0x135530){if(_0x135530){var _0xf4c58b=typeof _0x583a66['offset']===_0xfa45('0x21')&&typeof _0x583a66[_0xfa45('0x22')]===_0xfa45('0x21');var _0x509330=_0x135530[_0xfa45('0x23')];var _0x2193bb=_0xf4c58b?0x0:_0x583a66[_0xfa45('0x24')];var _0x372849=_0xf4c58b?_0x135530[_0xfa45('0x23')]:_0x583a66[_0xfa45('0x24')]+_0x583a66['limit'];var _0x3a75f9;if(_0x372849>=_0x509330){_0x372849=_0x509330;_0x3a75f9=0xc8;}else{_0x3a75f9=0xce;}_0x24470a[_0xfa45('0x1f')](_0x3a75f9);return _0x24470a[_0xfa45('0x25')](_0xfa45('0x26'),_0x2193bb+'-'+_0x372849+'/'+_0x509330)[_0xfa45('0x20')](_0x135530);}return null;};}function saveUpdates(_0x2d0af4){return function(_0x3d9fe1){if(_0x3d9fe1){return _0x3d9fe1[_0xfa45('0x27')](_0x2d0af4)[_0xfa45('0x14')](function(_0x315c91){return _0x315c91;});}return null;};}function removeEntity(_0x32ee7f){return function(_0x2fd69e){if(_0x2fd69e){return _0x2fd69e[_0xfa45('0x28')]()[_0xfa45('0x14')](function(){_0x32ee7f['status'](0xcc)[_0xfa45('0x29')]();});}};}function handleEntityNotFound(_0x13a0cf){return function(_0x4b6cf3){if(!_0x4b6cf3){_0x13a0cf['sendStatus'](0x194);}return _0x4b6cf3;};}function handleError(_0x2366de,_0x5a5105){_0x5a5105=_0x5a5105||0x1f4;return function(_0x5c36dd){logger[_0xfa45('0x1b')](_0x5c36dd[_0xfa45('0x2a')]);if(_0x5c36dd[_0xfa45('0x2b')]){delete _0x5c36dd[_0xfa45('0x2b')];}_0x2366de[_0xfa45('0x1f')](_0x5a5105)['send'](_0x5c36dd);};}exports[_0xfa45('0x2c')]=function(_0x5417d0,_0x176d6c){var _0x10d682={},_0x4f57df={},_0x5f2c8b={'count':0x0,'rows':[]};var _0x710cdf=_[_0xfa45('0x2d')](db[_0xfa45('0x2e')][_0xfa45('0x2f')],function(_0x466692){return{'name':_0x466692[_0xfa45('0x30')],'type':_0x466692[_0xfa45('0x31')]['key']};});_0x4f57df[_0xfa45('0x32')]=_['map'](_0x710cdf,_0xfa45('0x2b'));_0x4f57df[_0xfa45('0x33')]=_[_0xfa45('0x34')](_0x5417d0['query']);_0x4f57df[_0xfa45('0x35')]=_[_0xfa45('0x36')](_0x4f57df[_0xfa45('0x32')],_0x4f57df[_0xfa45('0x33')]);_0x10d682[_0xfa45('0x37')]=_[_0xfa45('0x36')](_0x4f57df[_0xfa45('0x32')],qs[_0xfa45('0x38')](_0x5417d0[_0xfa45('0x33')][_0xfa45('0x38')]));_0x10d682[_0xfa45('0x37')]=_0x10d682[_0xfa45('0x37')][_0xfa45('0x39')]?_0x10d682[_0xfa45('0x37')]:_0x4f57df[_0xfa45('0x32')];if(!_0x5417d0['query'][_0xfa45('0x3a')](_0xfa45('0x3b'))){_0x10d682[_0xfa45('0x22')]=qs[_0xfa45('0x22')](_0x5417d0[_0xfa45('0x33')][_0xfa45('0x22')]);_0x10d682[_0xfa45('0x24')]=qs[_0xfa45('0x24')](_0x5417d0[_0xfa45('0x33')]['offset']);}_0x10d682[_0xfa45('0x3c')]=qs['sort'](_0x5417d0[_0xfa45('0x33')][_0xfa45('0x3d')]);_0x10d682[_0xfa45('0x3e')]=qs[_0xfa45('0x35')](_[_0xfa45('0x3f')](_0x5417d0[_0xfa45('0x33')],_0x4f57df[_0xfa45('0x35')]),_0x710cdf);if(_0x5417d0['query'][_0xfa45('0x40')]){_0x10d682[_0xfa45('0x3e')]=_[_0xfa45('0x41')](_0x10d682[_0xfa45('0x3e')],{'$or':_[_0xfa45('0x2d')](_0x710cdf,function(_0x318016){if(_0x318016[_0xfa45('0x31')]!==_0xfa45('0x42')){var _0x1d07ef={};_0x1d07ef[_0x318016[_0xfa45('0x2b')]]={'$like':'%'+_0x5417d0[_0xfa45('0x33')][_0xfa45('0x40')]+'%'};return _0x1d07ef;}})});}_0x10d682=_[_0xfa45('0x41')]({},_0x10d682,_0x5417d0['options']);var _0x986c03={'where':_0x10d682[_0xfa45('0x3e')]};return db[_0xfa45('0x2e')][_0xfa45('0x23')](_0x986c03)[_0xfa45('0x14')](function(_0x23cb6a){_0x5f2c8b['count']=_0x23cb6a;if(_0x5417d0[_0xfa45('0x33')][_0xfa45('0x43')]){_0x10d682['include']=[{'all':!![]}];}return db['MailMessage'][_0xfa45('0x44')](_0x10d682);})['then'](function(_0x5a8378){_0x5f2c8b[_0xfa45('0x45')]=_0x5a8378;return _0x5f2c8b;})[_0xfa45('0x14')](respondWithFilteredResult(_0x176d6c,_0x10d682))['catch'](handleError(_0x176d6c,null));};exports['show']=function(_0x384d14,_0x4c0de7){var _0x5edc68={'raw':!![],'where':{'id':_0x384d14[_0xfa45('0x46')]['id']}},_0x4c43c6={};_0x4c43c6['model']=_[_0xfa45('0x34')](db[_0xfa45('0x2e')][_0xfa45('0x2f')]);_0x4c43c6['query']=_[_0xfa45('0x34')](_0x384d14[_0xfa45('0x33')]);_0x4c43c6[_0xfa45('0x35')]=_['intersection'](_0x4c43c6['model'],_0x4c43c6['query']);_0x5edc68['attributes']=_['intersection'](_0x4c43c6[_0xfa45('0x32')],qs[_0xfa45('0x38')](_0x384d14[_0xfa45('0x33')][_0xfa45('0x38')]));_0x5edc68[_0xfa45('0x37')]=_0x5edc68[_0xfa45('0x37')][_0xfa45('0x39')]?_0x5edc68['attributes']:_0x4c43c6[_0xfa45('0x32')];if(_0x384d14[_0xfa45('0x33')][_0xfa45('0x43')]){_0x5edc68[_0xfa45('0x47')]=[{'all':!![]}];}_0x5edc68=_[_0xfa45('0x41')]({},_0x5edc68,_0x384d14[_0xfa45('0x48')]);return db[_0xfa45('0x2e')]['find'](_0x5edc68)[_0xfa45('0x14')](handleEntityNotFound(_0x4c0de7,null))['then'](respondWithResult(_0x4c0de7,null))[_0xfa45('0x1e')](handleError(_0x4c0de7,null));};exports[_0xfa45('0x27')]=function(_0x1491af,_0x5d36d8){if(_0x1491af['body']['id']){delete _0x1491af['body']['id'];}return db[_0xfa45('0x2e')][_0xfa45('0x49')]({'where':{'id':_0x1491af[_0xfa45('0x46')]['id']}})[_0xfa45('0x14')](handleEntityNotFound(_0x5d36d8,null))[_0xfa45('0x14')](saveUpdates(_0x1491af['body'],null))[_0xfa45('0x14')](respondWithResult(_0x5d36d8,null))['catch'](handleError(_0x5d36d8,null));};exports['destroy']=function(_0x23740f,_0x43be6b){return db['MailMessage'][_0xfa45('0x49')]({'where':{'id':_0x23740f[_0xfa45('0x46')]['id']}})[_0xfa45('0x14')](handleEntityNotFound(_0x43be6b,null))[_0xfa45('0x14')](removeEntity(_0x43be6b,null))[_0xfa45('0x1e')](handleError(_0x43be6b,null));};exports[_0xfa45('0x4a')]=function(_0x1f2f44,_0x3914fa){return db[_0xfa45('0x2e')]['describe']()[_0xfa45('0x14')](respondWithResult(_0x3914fa,null))[_0xfa45('0x1e')](handleError(_0x3914fa,null));};exports['create']=function(_0x367644,_0x47770f){return db['MailMessage'][_0xfa45('0x4b')](_0x367644[_0xfa45('0x4c')])[_0xfa45('0x14')](function(_0x127bcd){if(_0x127bcd){if(_0x127bcd[_0xfa45('0x4d')]==='out'&&!_0x127bcd[_0xfa45('0x4e')]){var _0x42c378,_0x49dcb0,_0x2a6cf5;if(_0x367644['body']['to']){_0x49dcb0=_0x367644[_0xfa45('0x4c')]['to'][_0xfa45('0x4f')](',')[0x0];}return db[_0xfa45('0x50')][_0xfa45('0x51')]({'where':{'id':_0x127bcd[_0xfa45('0x52')]},'include':[{'model':db['CmList'],'as':_0xfa45('0x53'),'include':[{'model':db[_0xfa45('0x54')],'as':_0xfa45('0x55'),'where':{'email':_0x49dcb0},'limit':0x1,'order':[['updatedAt',_0xfa45('0x56')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xfa45('0x14')](function(_0x38176f){_0x42c378=_0x38176f;if(_0x42c378&&_0x42c378[_0xfa45('0x57')]){var _0x242ea2={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x42c378[_0xfa45('0x57')][_0xfa45('0x58')])){_0x242ea2[_0xfa45('0x59')]=_0x42c378[_0xfa45('0x57')][_0xfa45('0x59')];_0x242ea2[_0xfa45('0x5a')]=_0x42c378[_0xfa45('0x57')][_0xfa45('0x5a')];_0x242ea2[_0xfa45('0x5b')]=_0x42c378[_0xfa45('0x57')][_0xfa45('0x5b')];if(_0x42c378[_0xfa45('0x57')][_0xfa45('0x5c')]){_0x242ea2[_0xfa45('0x5d')]={'user':_0x42c378[_0xfa45('0x57')][_0xfa45('0x5e')],'pass':_0x42c378[_0xfa45('0x57')][_0xfa45('0x5f')]};}}else{_0x242ea2[_0xfa45('0x58')]=_0x42c378[_0xfa45('0x57')][_0xfa45('0x58')];_0x242ea2[_0xfa45('0x5d')]={'user':_0x42c378['Smtp']['user'],'pass':_0x42c378[_0xfa45('0x57')]['pass']};_0x242ea2[_0xfa45('0x5b')]=_0x42c378[_0xfa45('0x57')][_0xfa45('0x5b')];}if(_0x367644[_0xfa45('0x4c')]['attachments']&&_0x367644['body']['attachments'][_0xfa45('0x39')]){for(var _0x3404fc=0x0;_0x3404fc<_0x367644[_0xfa45('0x4c')][_0xfa45('0x60')][_0xfa45('0x39')];_0x3404fc+=0x1){_0x367644[_0xfa45('0x4c')][_0xfa45('0x60')][_0x3404fc]={'filename':_0x367644[_0xfa45('0x4c')][_0xfa45('0x60')][_0x3404fc]['name'],'path':path[_0xfa45('0x61')](config[_0xfa45('0x62')],_0xfa45('0x63'),_0x367644[_0xfa45('0x4c')][_0xfa45('0x60')][_0x3404fc][_0xfa45('0x64')])};}}_0x2a6cf5={'account':_0x242ea2,'message':_0x367644[_0xfa45('0x4c')]};return;}})[_0xfa45('0x14')](function(){if(_0x42c378[_0xfa45('0x53')]){if(_0x42c378['List']['Contacts']['length']){return _0x42c378[_0xfa45('0x53')][_0xfa45('0x55')][0x0];}else{return db['CmContact'][_0xfa45('0x4b')](_[_0xfa45('0xc')](_0x367644[_0xfa45('0x4c')],{'firstName':_0x367644[_0xfa45('0x4c')]['to'],'email':_0x367644[_0xfa45('0x4c')]['to'],'phone':_0x367644['body']['to'],'ListId':_0x42c378[_0xfa45('0x65')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x2a6cf5){return respondWithRpcPromise(_0xfa45('0x66'),_0xfa45('0x67'),_0x2a6cf5,client9003)[_0xfa45('0x14')](function(_0x3281b1){return _0x127bcd[_0xfa45('0x27')]({'read':!![],'messageId':_0x3281b1['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x547516){logger[_0xfa45('0x1b')]('%s',JSON[_0xfa45('0x1a')](_0x547516));return _0x127bcd;});}return _0x127bcd;});}return _0x127bcd;}})[_0xfa45('0x14')](respondWithResult(_0x47770f,0xc9))[_0xfa45('0x1e')](handleError(_0x47770f,null));};exports[_0xfa45('0x68')]=function(_0x226e0f,_0x233c3e){var _0x1bd431={'agent':{},'channel':'mail'};if(_0x226e0f[_0xfa45('0x4c')]['id']){delete _0x226e0f['body']['id'];}_0x226e0f[_0xfa45('0x4c')][_0xfa45('0x69')]=!![];_0x226e0f[_0xfa45('0x4c')][_0xfa45('0x6a')]=moment()['format'](_0xfa45('0x6b'));_0x226e0f[_0xfa45('0x4c')][_0xfa45('0x6c')]=_0x226e0f[_0xfa45('0x4c')][_0xfa45('0x6c')]||_0x226e0f['user']['id'];_0x1bd431[_0xfa45('0x6d')]['id']=_0x226e0f[_0xfa45('0x4c')][_0xfa45('0x6c')];return db['MailMessage'][_0xfa45('0x49')]({'where':{'id':_0x226e0f[_0xfa45('0x46')]['id'],'UserId':null}})[_0xfa45('0x14')](handleEntityNotFound(_0x233c3e,null))['then'](saveUpdates(_0x226e0f[_0xfa45('0x4c')],null))['then'](function(_0x4467a7){if(_0x4467a7){_0x1bd431['message']=_0x4467a7[_0xfa45('0x6e')]({'plain':!![]});return db[_0xfa45('0x6f')]['find']({'where':{'id':_0x4467a7[_0xfa45('0x70')]}});}return null;})[_0xfa45('0x14')](handleEntityNotFound(_0x233c3e,null))[_0xfa45('0x14')](function(_0xfc4c27){if(_0xfc4c27){return _0xfc4c27[_0xfa45('0x27')]({'UserId':_0x226e0f[_0xfa45('0x4c')][_0xfa45('0x6c')],'read1stAt':_[_0xfa45('0x71')](_0xfc4c27[_0xfa45('0x72')])?moment()['format'](_0xfa45('0x6b')):undefined});}return null;})[_0xfa45('0x14')](function(_0xa12307){if(_0xa12307){_0x1bd431[_0xfa45('0x73')]=_0xa12307['get']({'plain':!![]});interaction_log['info'](_0xfa45('0x74'),_0x226e0f[_0xfa45('0x5e')]['id'],_0x226e0f[_0xfa45('0x5e')][_0xfa45('0x2b')],_0x226e0f[_0xfa45('0x5e')][_0xfa45('0x75')],_0x1bd431[_0xfa45('0x73')]['id'],_0x226e0f[_0xfa45('0x4c')]?JSON['stringify'](_0x226e0f[_0xfa45('0x4c')]):_0xfa45('0x76'));return respondWithRpcPromise('AcceptMessage',_0xfa45('0x77'),_0x1bd431);}return null;})['then'](function(_0x3795cf){var _0x46a7d4=_0xfa45('0x78')+_0x3795cf[_0xfa45('0x1c')][_0xfa45('0x79')];return db['sequelize'][_0xfa45('0x33')](_0x46a7d4,{'type':db[_0xfa45('0x7a')][_0xfa45('0x7b')][_0xfa45('0x7c')],'raw':!![]})[_0xfa45('0x14')](function(_0x56d1e7){return _0x56d1e7;});})[_0xfa45('0x14')](function(_0x228e8f){if(_0x228e8f){_0x1bd431[_0xfa45('0x1c')]['contact']=_0x228e8f[0x0];if(!_0x226e0f[_0xfa45('0x4c')]['UserId'])return;return db[_0xfa45('0x7d')]['find']({'where':{'id':_0x226e0f[_0xfa45('0x4c')][_0xfa45('0x6c')],'role':_0xfa45('0x6d')},'attributes':['id',_0xfa45('0x2b'),_0xfa45('0x7e'),_0xfa45('0x7f'),'internal'],'raw':!![]});}return null;})[_0xfa45('0x14')](function(_0x354c13){if(!_0x354c13)return null;_0x1bd431[_0xfa45('0x1c')]['agent']=_0x354c13;return _0x1bd431;})[_0xfa45('0x14')](function(_0x1ae82d){if(_0x1ae82d){if(_0x226e0f[_0xfa45('0x4c')]['manual']){_0x1bd431[_0xfa45('0x1c')][_0xfa45('0x80')]=util[_0xfa45('0x81')](_0xfa45('0x82'),_0x226e0f[_0xfa45('0x5e')][_0xfa45('0x2b')]);_0x1bd431['message'][_0xfa45('0x83')]=_0x1bd431[_0xfa45('0x83')];_0x1bd431[_0xfa45('0x1c')][_0xfa45('0x84')]=_0x1bd431[_0xfa45('0x83')];_0x1bd431['message'][_0xfa45('0x85')]=_0xfa45('0x68');_0x1bd431[_0xfa45('0x1c')][_0xfa45('0x4c')]=htmlToText[_0xfa45('0x86')](_0x1bd431['message'][_0xfa45('0x4c')]);return respondWithRpcPromise(_0xfa45('0x87'),_0xfa45('0x87'),{'event':'acceptmessage','message':_0x1bd431[_0xfa45('0x1c')]},client9002)['then'](function(){return _0x1bd431;});}return _0x1bd431;}return null;})['then'](respondWithResult(_0x233c3e,null))[_0xfa45('0x1e')](handleError(_0x233c3e,null));};exports[_0xfa45('0x88')]=function(_0x286ab6,_0x1daf15){var _0x4c6536={'agent':{},'channel':_0xfa45('0x89')};if(_0x286ab6[_0xfa45('0x4c')]['id']){delete _0x286ab6[_0xfa45('0x4c')]['id'];}_0x286ab6[_0xfa45('0x4c')][_0xfa45('0x6c')]=_0x286ab6[_0xfa45('0x4c')][_0xfa45('0x6c')]||_0x286ab6[_0xfa45('0x5e')]['id'];_0x4c6536[_0xfa45('0x6d')]['id']=_0x286ab6[_0xfa45('0x4c')][_0xfa45('0x6c')];return db[_0xfa45('0x2e')][_0xfa45('0x49')]({'where':{'id':_0x286ab6['params']['id'],'UserId':null}})[_0xfa45('0x14')](handleEntityNotFound(_0x1daf15,null))[_0xfa45('0x14')](function(_0x2859ac){if(_0x2859ac){_0x4c6536[_0xfa45('0x1c')]=_0x2859ac['get']({'plain':!![]});return db['MailInteraction'][_0xfa45('0x49')]({'where':{'id':_0x2859ac[_0xfa45('0x70')]}});}return null;})['then'](handleEntityNotFound(_0x1daf15,null))[_0xfa45('0x14')](function(_0x11fe68){if(_0x11fe68){_0x4c6536[_0xfa45('0x73')]=_0x11fe68[_0xfa45('0x6e')]({'plain':!![]});interaction_log[_0xfa45('0x15')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x286ab6[_0xfa45('0x5e')]['id'],_0x286ab6[_0xfa45('0x5e')][_0xfa45('0x2b')],_0x286ab6['user'][_0xfa45('0x75')],_0x4c6536[_0xfa45('0x73')]['id'],_0x286ab6['body']?JSON['stringify'](_0x286ab6['body']):_0xfa45('0x76'));return respondWithRpcPromise(_0xfa45('0x8a'),'rejectMessage',_0x4c6536);}return null;})[_0xfa45('0x14')](function(_0x503764){var _0x2e1ea9=_0xfa45('0x78')+_0x503764['message'][_0xfa45('0x79')];return db[_0xfa45('0x8b')][_0xfa45('0x33')](_0x2e1ea9,{'type':db[_0xfa45('0x7a')][_0xfa45('0x7b')][_0xfa45('0x7c')],'raw':!![]})[_0xfa45('0x14')](function(_0x34d20c){return _0x34d20c;});})[_0xfa45('0x14')](function(_0x19e681){if(_0x19e681){_0x4c6536[_0xfa45('0x1c')][_0xfa45('0x8c')]=_0x19e681[0x0];if(!_0x286ab6[_0xfa45('0x4c')]['UserId'])return;return db[_0xfa45('0x7d')][_0xfa45('0x49')]({'where':{'id':_0x286ab6[_0xfa45('0x4c')][_0xfa45('0x6c')],'role':'agent'},'attributes':['id','name',_0xfa45('0x7e'),_0xfa45('0x7f'),_0xfa45('0x8d')],'raw':!![]});}return null;})[_0xfa45('0x14')](function(_0x5ccd21){if(!_0x5ccd21)return null;_0x4c6536[_0xfa45('0x1c')][_0xfa45('0x6d')]=_0x5ccd21;return _0x4c6536;})['then'](function(_0x2457d4){if(_0x2457d4){_0x2457d4[_0xfa45('0x1c')][_0xfa45('0x80')]=util['format']('SIP/%s',_0x286ab6['user'][_0xfa45('0x2b')]);_0x2457d4[_0xfa45('0x1c')][_0xfa45('0x83')]=_0x4c6536[_0xfa45('0x83')];_0x2457d4['message']['motionChannel']=_0x4c6536[_0xfa45('0x83')];_0x2457d4[_0xfa45('0x1c')][_0xfa45('0x85')]='reject';_0x2457d4[_0xfa45('0x1c')][_0xfa45('0x4c')]=htmlToText['fromString'](_0x4c6536['message'][_0xfa45('0x4c')]);respondWithRpcPromise(_0xfa45('0x87'),_0xfa45('0x87'),{'event':_0xfa45('0x8e'),'message':_0x2457d4['message']},client9002);return _0x4c6536;}return null;})['then'](respondWithResult(_0x1daf15,null))[_0xfa45('0x1e')](handleError(_0x1daf15,null));};exports[_0xfa45('0x8f')]=function(_0x11fae0,_0x2c00f8){var _0x50500b=moment()[_0xfa45('0x90')]()['toString']();var _0x5a01b1=path[_0xfa45('0x61')](config[_0xfa45('0x62')],_0xfa45('0x91'),_0xfa45('0x92'),_0xfa45('0x93'));var _0x46995f=path[_0xfa45('0x61')](config[_0xfa45('0x62')],'server',_0xfa45('0x92'),'attachments');var _0x199b67=util['format'](_0xfa45('0x94'),_0x50500b);return db['MailMessage'][_0xfa45('0x49')]({'where':{'id':_0x11fae0['params']['id']},'attributes':['id',_0xfa45('0x4c'),_0xfa45('0x95'),'to','cc',_0xfa45('0x96'),'subject',_0xfa45('0x97')],'include':_0x11fae0[_0xfa45('0x33')]['attachments']?[{'model':db[_0xfa45('0x98')],'as':_0xfa45('0x99')}]:undefined})[_0xfa45('0x14')](handleEntityNotFound(_0x2c00f8,null))[_0xfa45('0x14')](function(_0x270589){if(_0x270589){var _0x5f396c=_0x270589;var _0x58e078={'from':_0x5f396c['from'],'to':_0x5f396c['to'],'subject':_0x5f396c['subject'],'html':htmlEntities[_0xfa45('0x9a')](_0x5f396c[_0xfa45('0x4c')]),'headers':{'Date':moment(_0x5f396c['createdAt'])[_0xfa45('0x81')](_0xfa45('0x9b'))},'attachments':[]};if(_0x270589['cc']){_0x58e078['headers']['Cc']=_0x270589['cc'];}if(_0x270589[_0xfa45('0x96')]){_0x58e078[_0xfa45('0x9c')]['Bcc']=_0x270589[_0xfa45('0x96')];}return new BPromise(function(_0x8603f9,_0x2b8b3c){if(_0x270589['Attachments']){for(var _0x1e7fc6=0x0;_0x1e7fc6<_0x270589[_0xfa45('0x99')][_0xfa45('0x39')];_0x1e7fc6++){var _0x335c85=_0x270589[_0xfa45('0x99')][_0x1e7fc6];var _0x581efe=path[_0xfa45('0x61')](_0x46995f,_0x335c85[_0xfa45('0x64')]);if(fs['existsSync'](_0x581efe)){_0x58e078['attachments']['push']({'name':_0x335c85[_0xfa45('0x2b')],'contentType':_0x335c85[_0xfa45('0x31')],'data':fs[_0xfa45('0x9d')](_0x581efe)});}}}emlformat[_0xfa45('0x9e')](_0x58e078,function(_0x364d77,_0x3af283){if(_0x364d77)return _0x2b8b3c(_0x364d77);fs[_0xfa45('0x9f')](path[_0xfa45('0x61')](_0x5a01b1,_0x199b67),_0x3af283);return _0x8603f9(_0x3af283);});});}})['then'](function(_0x41ce06){if(_0x41ce06){return _0x2c00f8[_0xfa45('0x8f')](path[_0xfa45('0x61')](_0x5a01b1,_0x199b67),_0x199b67,function(_0x1888e8){if(!_0x1888e8)fs[_0xfa45('0xa0')](path[_0xfa45('0x61')](_0x5a01b1,_0x199b67));});}})[_0xfa45('0x1e')](handleError(_0x2c00f8,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index a7fad27..814f251 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 _0x077b=['exports','events','../../mysqldb','MailMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x372d53,_0x17c68d){var _0x2cb610=function(_0x3c1d1f){while(--_0x3c1d1f){_0x372d53['push'](_0x372d53['shift']());}};_0x2cb610(++_0x17c68d);}(_0x077b,0x17d));var _0xb077=function(_0x1ee433,_0x55738d){_0x1ee433=_0x1ee433-0x0;var _0x4c59b7=_0x077b[_0x1ee433];return _0x4c59b7;};'use strict';var EventEmitter=require(_0xb077('0x0'));var MailMessage=require(_0xb077('0x1'))['db'][_0xb077('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xb077('0x3')](0x0);var events={'afterCreate':_0xb077('0x4'),'afterUpdate':'update','afterDestroy':_0xb077('0x5')};function emitEvent(_0x3b5e85){return function(_0x14485c,_0x72b2b4,_0x19fd91){MailMessageEvents[_0xb077('0x6')](_0x3b5e85+':'+_0x14485c['id'],_0x14485c);MailMessageEvents[_0xb077('0x6')](_0x3b5e85,_0x14485c);_0x19fd91(null);};}for(var e in events){if(events[_0xb077('0x7')](e)){var event=events[e];MailMessage[_0xb077('0x8')](e,emitEvent(event));}}module[_0xb077('0x9')]=MailMessageEvents; \ No newline at end of file +var _0xab9c=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailMessage','setMaxListeners','update'];(function(_0x22de21,_0x3b12b9){var _0x340e76=function(_0x2f69bd){while(--_0x2f69bd){_0x22de21['push'](_0x22de21['shift']());}};_0x340e76(++_0x3b12b9);}(_0xab9c,0x1f3));var _0xcab9=function(_0x1ea12f,_0x4a3d19){_0x1ea12f=_0x1ea12f-0x0;var _0x3ffb04=_0xab9c[_0x1ea12f];return _0x3ffb04;};'use strict';var EventEmitter=require(_0xcab9('0x0'));var MailMessage=require(_0xcab9('0x1'))['db'][_0xcab9('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xcab9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcab9('0x4'),'afterDestroy':_0xcab9('0x5')};function emitEvent(_0x251fc7){return function(_0x505156,_0x274cb7,_0x9ea715){MailMessageEvents['emit'](_0x251fc7+':'+_0x505156['id'],_0x505156);MailMessageEvents[_0xcab9('0x6')](_0x251fc7,_0x505156);_0x9ea715(null);};}for(var e in events){if(events[_0xcab9('0x7')](e)){var event=events[e];MailMessage[_0xcab9('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index da6bb57..d4791db 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 _0x3006=['UserId','MailInteraction','findOne','MailInteractionId','then','update','catch','utf8mb4','lodash','api','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','MailMessage','messageId','fti_mail_messages','FULLTEXT','body','plainBody','fromString','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x55b2ac,_0x3a5577){var _0xaf2d66=function(_0x532dd1){while(--_0x532dd1){_0x55b2ac['push'](_0x55b2ac['shift']());}};_0xaf2d66(++_0x3a5577);}(_0x3006,0x1ba));var _0x6300=function(_0xe0297f,_0xcecab7){_0xe0297f=_0xe0297f-0x0;var _0x449f69=_0x3006[_0xe0297f];return _0x449f69;};'use strict';var _=require(_0x6300('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6300('0x1'));var moment=require('moment');var BPromise=require(_0x6300('0x2'));var rp=require(_0x6300('0x3'));var htmlToText=require(_0x6300('0x4'));var fs=require('fs');var path=require(_0x6300('0x5'));var rimraf=require(_0x6300('0x6'));var config=require(_0x6300('0x7'));var attributes=require('./mailMessage.attributes');module[_0x6300('0x8')]=function(_0x324f15,_0x27a1a6){return _0x324f15['define'](_0x6300('0x9'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x6300('0xa'),'fields':[_0x6300('0xa')]},{'name':_0x6300('0xb'),'fields':['plainBody','subject'],'type':_0x6300('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3b7606,_0x85fc8c,_0x197e77){if(_0x3b7606[_0x6300('0xd')]){_0x3b7606[_0x6300('0xe')]=htmlToText[_0x6300('0xf')](_0x3b7606[_0x6300('0xd')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x197e77(null,_0x85fc8c);},'afterCreate':function(_0x5eb5eb,_0x316ef5,_0x4a6f2f){var _0x42215c=_0x324f15[_0x6300('0x10')];var _0x5b6d22=_0x5eb5eb[_0x6300('0x11')]({'plain':!![]});if(_0x5b6d22[_0x6300('0x12')][_0x6300('0x13')]()==='in'||_0x5b6d22[_0x6300('0x12')][_0x6300('0x13')]()===_0x6300('0x14')&&!_0x5b6d22[_0x6300('0x15')]&&!_[_0x6300('0x16')](_0x5b6d22[_0x6300('0x17')])){_0x42215c[_0x6300('0x18')][_0x6300('0x19')]({'where':{'id':_0x5b6d22[_0x6300('0x1a')]}})[_0x6300('0x1b')](function(_0x71b16c){if(_0x71b16c){_0x71b16c[_0x6300('0x1c')]({'lastMsgAt':_0x5b6d22['createdAt'],'lastMsgDirection':_0x5b6d22[_0x6300('0x12')]['toLowerCase']()});}})[_0x6300('0x1d')](function(_0x278427){console['error'](_0x278427);});}_0x4a6f2f();}},'charset':_0x6300('0x1e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb28c=['subject','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','then','createdAt','error','utf8mb4','lodash','util','../../config/logger','moment','request-promise','html-to-text','path','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody'];(function(_0x38ca2d,_0x32240f){var _0x3d8356=function(_0x14abb9){while(--_0x14abb9){_0x38ca2d['push'](_0x38ca2d['shift']());}};_0x3d8356(++_0x32240f);}(_0xb28c,0x177));var _0xcb28=function(_0x42befa,_0x571a1c){_0x42befa=_0x42befa-0x0;var _0x4d6b2e=_0xb28c[_0x42befa];return _0x4d6b2e;};'use strict';var _=require(_0xcb28('0x0'));var util=require(_0xcb28('0x1'));var logger=require(_0xcb28('0x2'))('api');var moment=require(_0xcb28('0x3'));var BPromise=require('bluebird');var rp=require(_0xcb28('0x4'));var htmlToText=require(_0xcb28('0x5'));var fs=require('fs');var path=require(_0xcb28('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcb28('0x7'));module[_0xcb28('0x8')]=function(_0x4cdcce,_0x580d69){return _0x4cdcce[_0xcb28('0x9')](_0xcb28('0xa'),attributes,{'tableName':_0xcb28('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xcb28('0xc')]},{'name':_0xcb28('0xd'),'fields':[_0xcb28('0xe'),_0xcb28('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xbd9b37,_0x2616bb,_0x20a6fe){if(_0xbd9b37[_0xcb28('0x10')]){_0xbd9b37['plainBody']=htmlToText['fromString'](_0xbd9b37[_0xcb28('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x20a6fe(null,_0x2616bb);},'afterCreate':function(_0x438d64,_0x3bfe0b,_0x175e86){var _0x325ece=_0x4cdcce[_0xcb28('0x11')];var _0x5f47f4=_0x438d64[_0xcb28('0x12')]({'plain':!![]});if(_0x5f47f4[_0xcb28('0x13')][_0xcb28('0x14')]()==='in'||_0x5f47f4[_0xcb28('0x13')][_0xcb28('0x14')]()===_0xcb28('0x15')&&!_0x5f47f4[_0xcb28('0x16')]&&!_[_0xcb28('0x17')](_0x5f47f4[_0xcb28('0x18')])){_0x325ece[_0xcb28('0x19')]['findOne']({'where':{'id':_0x5f47f4['MailInteractionId']}})[_0xcb28('0x1a')](function(_0x3d563c){if(_0x3d563c){_0x3d563c['update']({'lastMsgAt':_0x5f47f4[_0xcb28('0x1b')],'lastMsgDirection':_0x5f47f4[_0xcb28('0x13')][_0xcb28('0x14')]()});}})['catch'](function(_0x354820){console[_0xcb28('0x1c')](_0x354820);});}_0x175e86();}},'charset':_0xcb28('0x1d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 40dd51f..3945ecf 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 _0x4024=['debug','stringify','error','code','message','info','catch','CreateMailMessage','MailMessage','create','body','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','redis','then','MailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x4d6cc4,_0xdd6cc3){var _0x4f2d4c=function(_0x30214b){while(--_0x30214b){_0x4d6cc4['push'](_0x4d6cc4['shift']());}};_0x4f2d4c(++_0xdd6cc3);}(_0x4024,0x89));var _0x4402=function(_0x23405c,_0x2972e5){_0x23405c=_0x23405c-0x0;var _0x8a1f0a=_0x4024[_0x23405c];return _0x8a1f0a;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});config[_0x4402('0x9')]=_['defaults'](config[_0x4402('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4402('0x9')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x30fd34,_0x4f56aa,_0x1a4a47){return new BPromise(function(_0x4e1a7e,_0x34b4a6){return client['request'](_0x30fd34,_0x1a4a47)[_0x4402('0xa')](function(_0x251286){logger['info'](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));logger[_0x4402('0xd')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x4f56aa,_0x4402('0xc'),JSON[_0x4402('0xe')](_0x251286));if(_0x251286[_0x4402('0xf')]){if(_0x251286[_0x4402('0xf')][_0x4402('0x10')]===0x1f4){logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x34b4a6(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x4e1a7e(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}else{logger[_0x4402('0x12')](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));_0x4e1a7e(_0x251286['result']['message']);}})[_0x4402('0x13')](function(_0x2a7afc){logger['error'](_0x4402('0xb'),_0x4f56aa,_0x2a7afc);_0x34b4a6(_0x2a7afc);});});}exports[_0x4402('0x14')]=function(_0x5cb0c5){var _0x38b459=this;return new Promise(function(_0x4e0340,_0x55cc8c){return db[_0x4402('0x15')][_0x4402('0x16')](_0x5cb0c5[_0x4402('0x17')],{'raw':_0x5cb0c5['options']?_0x5cb0c5[_0x4402('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x6f1f72){logger[_0x4402('0x12')](_0x4402('0x14'),_0x5cb0c5);logger[_0x4402('0xd')](_0x4402('0x14'),_0x5cb0c5,JSON[_0x4402('0xe')](_0x6f1f72));_0x4e0340(_0x6f1f72);})[_0x4402('0x13')](function(_0x6b1fc5){logger[_0x4402('0xf')]('CreateMailMessage',_0x6b1fc5[_0x4402('0x11')],_0x5cb0c5);_0x55cc8c(_0x38b459['error'](0x1f4,_0x6b1fc5[_0x4402('0x11')]));});});}; \ No newline at end of file +var _0x7334=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','create','body','options','raw','CreateMailMessage','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x11b11e,_0x2ab616){var _0x34813b=function(_0x2cc43f){while(--_0x2cc43f){_0x11b11e['push'](_0x11b11e['shift']());}};_0x34813b(++_0x2ab616);}(_0x7334,0x184));var _0x4733=function(_0x52dfda,_0x1ee1c0){_0x52dfda=_0x52dfda-0x0;var _0x254f6a=_0x7334[_0x52dfda];return _0x254f6a;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});config[_0x4733('0xb')]=_[_0x4733('0xc')](config[_0x4733('0xb')],{'host':_0x4733('0xd'),'port':0x18eb});var socket=require(_0x4733('0xe'))(new Redis(config[_0x4733('0xb')]));require(_0x4733('0xf'))[_0x4733('0x10')](socket);function respondWithRpcPromise(_0x1bc511,_0x2bafad,_0x49032d){return new BPromise(function(_0x42b97f,_0x1e6fcf){return client['request'](_0x1bc511,_0x49032d)[_0x4733('0x11')](function(_0x5240a4){logger[_0x4733('0x12')](_0x4733('0x13'),_0x2bafad,_0x4733('0x14'));logger[_0x4733('0x15')](_0x4733('0x16'),_0x2bafad,_0x4733('0x14'),JSON[_0x4733('0x17')](_0x5240a4));if(_0x5240a4['error']){if(_0x5240a4[_0x4733('0x18')]['code']===0x1f4){logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);return _0x1e6fcf(_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);}logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x5240a4[_0x4733('0x18')]['message']);return _0x42b97f(_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);}else{logger['info'](_0x4733('0x13'),_0x2bafad,_0x4733('0x14'));_0x42b97f(_0x5240a4[_0x4733('0x1a')][_0x4733('0x19')]);}})['catch'](function(_0x517fbc){logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x517fbc);_0x1e6fcf(_0x517fbc);});});}exports['CreateMailMessage']=function(_0x32f166){var _0x1943bc=this;return new Promise(function(_0x15339c,_0x7a4e0){return db['MailMessage'][_0x4733('0x1b')](_0x32f166[_0x4733('0x1c')],{'raw':_0x32f166['options']?_0x32f166[_0x4733('0x1d')][_0x4733('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x15a291){logger[_0x4733('0x12')](_0x4733('0x1f'),_0x32f166);logger[_0x4733('0x15')](_0x4733('0x1f'),_0x32f166,JSON[_0x4733('0x17')](_0x15a291));_0x15339c(_0x15a291);})[_0x4733('0x20')](function(_0x2bb78f){logger['error'](_0x4733('0x1f'),_0x2bb78f[_0x4733('0x19')],_0x32f166);_0x7a4e0(_0x1943bc[_0x4733('0x18')](0x1f4,_0x2bb78f[_0x4733('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 307a31b..cf55829 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 _0xd245=['remove','emit','register','length','mailMessage:','./mailMessage.events','save'];(function(_0x42020e,_0x4b92fb){var _0x561551=function(_0xf8216){while(--_0xf8216){_0x42020e['push'](_0x42020e['shift']());}};_0x561551(++_0x4b92fb);}(_0xd245,0x1e8));var _0x5d24=function(_0x5a4400,_0xfae3b6){_0x5a4400=_0x5a4400-0x0;var _0xf9b532=_0xd245[_0x5a4400];return _0xf9b532;};'use strict';var MailMessageEvents=require(_0x5d24('0x0'));var events=[_0x5d24('0x1'),_0x5d24('0x2'),'update'];function createListener(_0x4f008d,_0x7ee700){return function(_0x29866d){_0x7ee700[_0x5d24('0x3')](_0x4f008d,_0x29866d);};}function removeListener(_0x2027b4,_0x289b1c){return function(){MailMessageEvents['removeListener'](_0x2027b4,_0x289b1c);};}exports[_0x5d24('0x4')]=function(_0x7d2d9){for(var _0x13930d=0x0,_0x1e2379=events[_0x5d24('0x5')];_0x13930d<_0x1e2379;_0x13930d++){var _0x3fc1df=events[_0x13930d];var _0x435711=createListener(_0x5d24('0x6')+_0x3fc1df,_0x7d2d9);MailMessageEvents['on'](_0x3fc1df,_0x435711);}}; \ No newline at end of file +var _0xe914=['length','./mailMessage.events','save','update','emit','removeListener','register'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xe914,0x7f));var _0x4e91=function(_0x48bb44,_0x15d56f){_0x48bb44=_0x48bb44-0x0;var _0x2c4261=_0xe914[_0x48bb44];return _0x2c4261;};'use strict';var MailMessageEvents=require(_0x4e91('0x0'));var events=[_0x4e91('0x1'),'remove',_0x4e91('0x2')];function createListener(_0x430932,_0x13a12e){return function(_0x471f1d){_0x13a12e[_0x4e91('0x3')](_0x430932,_0x471f1d);};}function removeListener(_0x59e102,_0x4f4e88){return function(){MailMessageEvents[_0x4e91('0x4')](_0x59e102,_0x4f4e88);};}exports[_0x4e91('0x5')]=function(_0x5d4c14){for(var _0x29c27c=0x0,_0x1d4bd6=events[_0x4e91('0x6')];_0x29c27c<_0x1d4bd6;_0x29c27c++){var _0x2f2098=events[_0x29c27c];var _0x532b72=createListener('mailMessage:'+_0x2f2098,_0x5d4c14);MailMessageEvents['on'](_0x2f2098,_0x532b72);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 3b02c29..ca98a1b 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 _0xfdbe=['get','isAuthenticated','index','/:id','/:id/members','getMembers','/:id/users','getAgents','create','/:id/teams','addTeams','post','addAgents','put','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x185e9c,_0x576b93){var _0x33e8e3=function(_0x36195b){while(--_0x36195b){_0x185e9c['push'](_0x185e9c['shift']());}};_0x33e8e3(++_0x576b93);}(_0xfdbe,0x1bb));var _0xefdb=function(_0x2b2b33,_0x56606f){_0x2b2b33=_0x2b2b33-0x0;var _0x229157=_0xfdbe[_0x2b2b33];return _0x229157;};'use strict';var multer=require(_0xefdb('0x0'));var util=require(_0xefdb('0x1'));var path=require(_0xefdb('0x2'));var timeout=require(_0xefdb('0x3'));var express=require(_0xefdb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xefdb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xefdb('0x6'));var controller=require('./mailQueue.controller');router[_0xefdb('0x7')]('/',auth[_0xefdb('0x8')](),controller[_0xefdb('0x9')]);router[_0xefdb('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xefdb('0xa'),auth[_0xefdb('0x8')](),controller['show']);router[_0xefdb('0x7')](_0xefdb('0xb'),auth['isAuthenticated'](),controller[_0xefdb('0xc')]);router[_0xefdb('0x7')]('/:id/teams',auth[_0xefdb('0x8')](),controller['getTeams']);router[_0xefdb('0x7')](_0xefdb('0xd'),auth[_0xefdb('0x8')](),controller[_0xefdb('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xefdb('0xf')]);router['post'](_0xefdb('0x10'),auth['isAuthenticated'](),controller[_0xefdb('0x11')]);router[_0xefdb('0x12')](_0xefdb('0xd'),auth[_0xefdb('0x8')](),controller[_0xefdb('0x13')]);router[_0xefdb('0x14')]('/:id',auth[_0xefdb('0x8')](),controller['update']);router[_0xefdb('0x15')](_0xefdb('0xa'),auth[_0xefdb('0x8')](),controller[_0xefdb('0x16')]);router[_0xefdb('0x15')]('/:id/teams',auth['isAuthenticated'](),controller[_0xefdb('0x17')]);router[_0xefdb('0x15')]('/:id/users',auth[_0xefdb('0x8')](),controller['removeAgents']);module[_0xefdb('0x18')]=router; \ No newline at end of file +var _0x311e=['create','addAgents','put','delete','destroy','removeTeams','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x3b6d03,_0x518294){var _0x1de3af=function(_0x405640){while(--_0x405640){_0x3b6d03['push'](_0x3b6d03['shift']());}};_0x1de3af(++_0x518294);}(_0x311e,0x1d6));var _0xe311=function(_0x2b5c6b,_0x3226bd){_0x2b5c6b=_0x2b5c6b-0x0;var _0x26a88e=_0x311e[_0x2b5c6b];return _0x26a88e;};'use strict';var multer=require(_0xe311('0x0'));var util=require('util');var path=require(_0xe311('0x1'));var timeout=require(_0xe311('0x2'));var express=require(_0xe311('0x3'));var router=express[_0xe311('0x4')]();var fs_extra=require(_0xe311('0x5'));var auth=require(_0xe311('0x6'));var interaction=require(_0xe311('0x7'));var config=require(_0xe311('0x8'));var controller=require(_0xe311('0x9'));router[_0xe311('0xa')]('/',auth[_0xe311('0xb')](),controller[_0xe311('0xc')]);router[_0xe311('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xe311('0xd')]);router[_0xe311('0xa')](_0xe311('0xe'),auth['isAuthenticated'](),controller[_0xe311('0xf')]);router[_0xe311('0xa')](_0xe311('0x10'),auth[_0xe311('0xb')](),controller[_0xe311('0x11')]);router[_0xe311('0xa')](_0xe311('0x12'),auth['isAuthenticated'](),controller[_0xe311('0x13')]);router[_0xe311('0xa')](_0xe311('0x14'),auth[_0xe311('0xb')](),controller[_0xe311('0x15')]);router[_0xe311('0x16')]('/',auth['isAuthenticated'](),controller[_0xe311('0x17')]);router[_0xe311('0x16')](_0xe311('0x12'),auth[_0xe311('0xb')](),controller['addTeams']);router['post'](_0xe311('0x14'),auth['isAuthenticated'](),controller[_0xe311('0x18')]);router[_0xe311('0x19')](_0xe311('0xe'),auth[_0xe311('0xb')](),controller['update']);router[_0xe311('0x1a')](_0xe311('0xe'),auth[_0xe311('0xb')](),controller[_0xe311('0x1b')]);router[_0xe311('0x1a')](_0xe311('0x12'),auth['isAuthenticated'](),controller[_0xe311('0x1c')]);router[_0xe311('0x1a')]('/:id/users',auth[_0xe311('0xb')](),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 1c2788b..bf1e409 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 _0xe21c=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xe21c,0x19d));var _0xce21=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0xe21c[_0x3cae69];return _0x3128eb;};'use strict';var Sequelize=require(_0xce21('0x0'));module[_0xce21('0x1')]={'name':{'type':Sequelize[_0xce21('0x2')],'unique':_0xce21('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xce21('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xce21('0x5')](_0xce21('0x6'),_0xce21('0x7'),_0xce21('0x8'))}}; \ No newline at end of file +var _0xd741=['ENUM','rrmemory','beepall','roundrobin','exports','name','INTEGER'];(function(_0x3dfa60,_0xcfc2e3){var _0x5bad3b=function(_0x1cf770){while(--_0x1cf770){_0x3dfa60['push'](_0x3dfa60['shift']());}};_0x5bad3b(++_0xcfc2e3);}(_0xd741,0x1e0));var _0x1d74=function(_0x4e48c1,_0x45bffd){_0x4e48c1=_0x4e48c1-0x0;var _0x146060=_0xd741[_0x4e48c1];return _0x146060;};'use strict';var Sequelize=require('sequelize');module[_0x1d74('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x1d74('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1d74('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1d74('0x3')](_0x1d74('0x4'),_0x1d74('0x5'),_0x1d74('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 7d1ca9a..ac55571 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 _0xa854=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','apply','save','update','destroy','then','get','MailQueues','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','order','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','online','voicePause','interface','sequelize','transaction','findOrCreate','forEach','userMailQueue:save','removeTeams','Agents','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','union','compact','value','ids','emit','addAgents','omit','removeAgents','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x1f2422,_0x125fd2){var _0x4fb420=function(_0x1b8cc6){while(--_0x1b8cc6){_0x1f2422['push'](_0x1f2422['shift']());}};_0x4fb420(++_0x125fd2);}(_0xa854,0x103));var _0x4a85=function(_0x2ed866,_0x177791){_0x2ed866=_0x2ed866-0x0;var _0x34dc2b=_0xa854[_0x2ed866];return _0x34dc2b;};'use strict';var emlformat=require(_0x4a85('0x0'));var rimraf=require(_0x4a85('0x1'));var zipdir=require(_0x4a85('0x2'));var jsonpatch=require(_0x4a85('0x3'));var rp=require(_0x4a85('0x4'));var moment=require('moment');var BPromise=require(_0x4a85('0x5'));var Mustache=require('mustache');var util=require(_0x4a85('0x6'));var path=require('path');var sox=require(_0x4a85('0x7'));var csv=require(_0x4a85('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a85('0x9'));var _=require(_0x4a85('0xa'));var squel=require('squel');var crypto=require(_0x4a85('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4a85('0xc'));var toCsv=require(_0x4a85('0x8'));var querystring=require(_0x4a85('0xd'));var Papa=require(_0x4a85('0xe'));var Redis=require(_0x4a85('0xf'));var authService=require(_0x4a85('0x10'));var qs=require(_0x4a85('0x11'));var as=require(_0x4a85('0x12'));var hardwareService=require(_0x4a85('0x13'));var logger=require('../../config/logger')(_0x4a85('0x14'));var utils=require(_0x4a85('0x15'));var config=require(_0x4a85('0x16'));var licenseUtil=require(_0x4a85('0x17'));var db=require(_0x4a85('0x18'))['db'];config[_0x4a85('0x19')]=_[_0x4a85('0x1a')](config[_0x4a85('0x19')],{'host':_0x4a85('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a85('0x19')]));require(_0x4a85('0x1c'))[_0x4a85('0x1d')](socket);function respondWithStatusCode(_0x153d39,_0x1d5e1d){_0x1d5e1d=_0x1d5e1d||0xcc;return function(_0x1249d2){if(_0x1249d2){return _0x153d39[_0x4a85('0x1e')](_0x1d5e1d);}return _0x153d39[_0x4a85('0x1f')](_0x1d5e1d)[_0x4a85('0x20')]();};}function respondWithResult(_0x397f4a,_0x6f362b){_0x6f362b=_0x6f362b||0xc8;return function(_0x52504e){if(_0x52504e){return _0x397f4a[_0x4a85('0x1f')](_0x6f362b)[_0x4a85('0x21')](_0x52504e);}};}function respondWithFilteredResult(_0x5c9b9f,_0x20701f){return function(_0x159ed0){if(_0x159ed0){var _0x4435db=typeof _0x20701f['offset']===_0x4a85('0x22')&&typeof _0x20701f[_0x4a85('0x23')]===_0x4a85('0x22');var _0x496b8a=_0x159ed0['count'];var _0x171629=_0x4435db?0x0:_0x20701f[_0x4a85('0x24')];var _0x31e1e4=_0x4435db?_0x159ed0[_0x4a85('0x25')]:_0x20701f[_0x4a85('0x24')]+_0x20701f[_0x4a85('0x23')];var _0x382af0;if(_0x31e1e4>=_0x496b8a){_0x31e1e4=_0x496b8a;_0x382af0=0xc8;}else{_0x382af0=0xce;}_0x5c9b9f[_0x4a85('0x1f')](_0x382af0);return _0x5c9b9f['set']('Content-Range',_0x171629+'-'+_0x31e1e4+'/'+_0x496b8a)['json'](_0x159ed0);}return null;};}function patchUpdates(_0x4219a7){return function(_0x83fd88){try{jsonpatch[_0x4a85('0x26')](_0x83fd88,_0x4219a7,!![]);}catch(_0x408581){return BPromise['reject'](_0x408581);}return _0x83fd88[_0x4a85('0x27')]();};}function saveUpdates(_0x27f9c1,_0x2a3d14){return function(_0x3f3894){if(_0x3f3894){return _0x3f3894[_0x4a85('0x28')](_0x27f9c1)['then'](function(_0x1075e2){return _0x1075e2;});}return null;};}function removeEntity(_0x1a9a8c,_0x1b3f6b){return function(_0x3a640c){if(_0x3a640c){return _0x3a640c[_0x4a85('0x29')]()[_0x4a85('0x2a')](function(){var _0x4a34d5=_0x3a640c[_0x4a85('0x2b')]({'plain':!![]});var _0x343dfe=_0x4a85('0x2c');return db['UserProfileResource'][_0x4a85('0x29')]({'where':{'type':_0x343dfe,'resourceId':_0x4a34d5['id']}})['then'](function(){return _0x3a640c;});})[_0x4a85('0x2a')](function(){_0x1a9a8c[_0x4a85('0x1f')](0xcc)[_0x4a85('0x20')]();});}};}function handleEntityNotFound(_0x3ade10,_0x4596c6){return function(_0x37095a){if(!_0x37095a){_0x3ade10[_0x4a85('0x1e')](0x194);}return _0x37095a;};}function handleError(_0x131eb8,_0x563393){_0x563393=_0x563393||0x1f4;return function(_0x45ec8f){logger['error'](_0x45ec8f[_0x4a85('0x2d')]);if(_0x45ec8f[_0x4a85('0x2e')]){delete _0x45ec8f['name'];}_0x131eb8[_0x4a85('0x1f')](_0x563393)[_0x4a85('0x2f')](_0x45ec8f);};}exports[_0x4a85('0x30')]=function(_0x290ced,_0x9b33c6){var _0x181dfa={},_0x16a1b5={},_0x3af5e7={'count':0x0,'rows':[]};var _0x609f0a=_[_0x4a85('0x31')](db[_0x4a85('0x32')][_0x4a85('0x33')],function(_0x5326a8){return{'name':_0x5326a8[_0x4a85('0x34')],'type':_0x5326a8[_0x4a85('0x35')][_0x4a85('0x36')]};});_0x16a1b5[_0x4a85('0x37')]=_['map'](_0x609f0a,_0x4a85('0x2e'));_0x16a1b5[_0x4a85('0x38')]=_[_0x4a85('0x39')](_0x290ced[_0x4a85('0x38')]);_0x16a1b5[_0x4a85('0x3a')]=_[_0x4a85('0x3b')](_0x16a1b5[_0x4a85('0x37')],_0x16a1b5['query']);_0x181dfa[_0x4a85('0x3c')]=_[_0x4a85('0x3b')](_0x16a1b5['model'],qs[_0x4a85('0x3d')](_0x290ced[_0x4a85('0x38')][_0x4a85('0x3d')]));_0x181dfa['attributes']=_0x181dfa[_0x4a85('0x3c')][_0x4a85('0x3e')]?_0x181dfa[_0x4a85('0x3c')]:_0x16a1b5[_0x4a85('0x37')];if(!_0x290ced[_0x4a85('0x38')][_0x4a85('0x3f')](_0x4a85('0x40'))){_0x181dfa[_0x4a85('0x23')]=qs[_0x4a85('0x23')](_0x290ced['query'][_0x4a85('0x23')]);_0x181dfa[_0x4a85('0x24')]=qs[_0x4a85('0x24')](_0x290ced['query'][_0x4a85('0x24')]);}_0x181dfa['order']=qs[_0x4a85('0x41')](_0x290ced[_0x4a85('0x38')]['sort']);_0x181dfa[_0x4a85('0x42')]=qs[_0x4a85('0x3a')](_[_0x4a85('0x43')](_0x290ced['query'],_0x16a1b5['filters']),_0x609f0a);if(_0x290ced[_0x4a85('0x38')][_0x4a85('0x44')]){_0x181dfa['where']=_['merge'](_0x181dfa['where'],{'$or':_[_0x4a85('0x31')](_0x609f0a,function(_0x405f2b){if(_0x405f2b['type']!=='VIRTUAL'){var _0x41bd99={};_0x41bd99[_0x405f2b[_0x4a85('0x2e')]]={'$like':'%'+_0x290ced[_0x4a85('0x38')][_0x4a85('0x44')]+'%'};return _0x41bd99;}})});}_0x181dfa=_[_0x4a85('0x45')]({},_0x181dfa,_0x290ced[_0x4a85('0x46')]);var _0x306810={'where':_0x181dfa[_0x4a85('0x42')]};return db['MailQueue']['count'](_0x306810)[_0x4a85('0x2a')](function(_0x49bd4e){_0x3af5e7['count']=_0x49bd4e;if(_0x290ced[_0x4a85('0x38')][_0x4a85('0x47')]){_0x181dfa[_0x4a85('0x48')]=[{'all':!![]}];}return db[_0x4a85('0x32')][_0x4a85('0x49')](_0x181dfa);})[_0x4a85('0x2a')](function(_0x38f7f7){_0x3af5e7[_0x4a85('0x4a')]=_0x38f7f7;return _0x3af5e7;})['then'](respondWithFilteredResult(_0x9b33c6,_0x181dfa))['catch'](handleError(_0x9b33c6,null));};exports[_0x4a85('0x4b')]=function(_0x407db0,_0x2a96d1){var _0x320d3f={'raw':!![],'where':{'id':_0x407db0['params']['id']}},_0x241ae7={};_0x241ae7['model']=_[_0x4a85('0x39')](db[_0x4a85('0x32')][_0x4a85('0x33')]);_0x241ae7[_0x4a85('0x38')]=_[_0x4a85('0x39')](_0x407db0[_0x4a85('0x38')]);_0x241ae7[_0x4a85('0x3a')]=_[_0x4a85('0x3b')](_0x241ae7[_0x4a85('0x37')],_0x241ae7[_0x4a85('0x38')]);_0x320d3f[_0x4a85('0x3c')]=_[_0x4a85('0x3b')](_0x241ae7[_0x4a85('0x37')],qs['fields'](_0x407db0[_0x4a85('0x38')][_0x4a85('0x3d')]));_0x320d3f[_0x4a85('0x3c')]=_0x320d3f['attributes'][_0x4a85('0x3e')]?_0x320d3f[_0x4a85('0x3c')]:_0x241ae7['model'];if(_0x407db0[_0x4a85('0x38')][_0x4a85('0x47')]){_0x320d3f['include']=[{'all':!![]}];}_0x320d3f=_['merge']({},_0x320d3f,_0x407db0[_0x4a85('0x46')]);return db['MailQueue'][_0x4a85('0x4c')](_0x320d3f)[_0x4a85('0x2a')](handleEntityNotFound(_0x2a96d1,null))[_0x4a85('0x2a')](respondWithResult(_0x2a96d1,null))[_0x4a85('0x4d')](handleError(_0x2a96d1,null));};exports[_0x4a85('0x4e')]=function(_0x1cdb00,_0x5cb813){return db['MailQueue'][_0x4a85('0x4e')](_0x1cdb00[_0x4a85('0x4f')],{})[_0x4a85('0x2a')](function(_0xf27adc){var _0xd44e84=_0x1cdb00[_0x4a85('0x50')][_0x4a85('0x2b')]({'plain':!![]});if(!_0xd44e84)throw new Error(_0x4a85('0x51'));if(_0xd44e84[_0x4a85('0x52')]===_0x4a85('0x50')){var _0x43eb42=_0xf27adc[_0x4a85('0x2b')]({'plain':!![]});var _0x1b25ca=_0x4a85('0x2c');return db['UserProfileSection'][_0x4a85('0x4c')]({'where':{'name':_0x1b25ca,'userProfileId':_0xd44e84[_0x4a85('0x53')]},'raw':!![]})['then'](function(_0x4af105){if(_0x4af105&&_0x4af105[_0x4a85('0x54')]===0x0){return db[_0x4a85('0x55')]['create']({'name':_0x43eb42[_0x4a85('0x2e')],'resourceId':_0x43eb42['id'],'type':_0x4af105[_0x4a85('0x2e')],'sectionId':_0x4af105['id']},{})['then'](function(){return _0xf27adc;});}else{return _0xf27adc;}})[_0x4a85('0x4d')](function(_0x5d5db3){logger[_0x4a85('0x56')](_0x4a85('0x57'),_0x5d5db3);throw _0x5d5db3;});}return _0xf27adc;})[_0x4a85('0x2a')](respondWithResult(_0x5cb813,0xc9))[_0x4a85('0x4d')](handleError(_0x5cb813,null));};exports[_0x4a85('0x28')]=function(_0x25ac9c,_0x2f8fda){if(_0x25ac9c[_0x4a85('0x4f')]['id']){delete _0x25ac9c[_0x4a85('0x4f')]['id'];}return db['MailQueue'][_0x4a85('0x4c')]({'where':{'id':_0x25ac9c[_0x4a85('0x58')]['id']}})[_0x4a85('0x2a')](handleEntityNotFound(_0x2f8fda,null))[_0x4a85('0x2a')](saveUpdates(_0x25ac9c[_0x4a85('0x4f')],null))['then'](respondWithResult(_0x2f8fda,null))[_0x4a85('0x4d')](handleError(_0x2f8fda,null));};exports['destroy']=function(_0x120392,_0x449d39){return db[_0x4a85('0x32')]['find']({'where':{'id':_0x120392[_0x4a85('0x58')]['id']}})[_0x4a85('0x2a')](handleEntityNotFound(_0x449d39,null))[_0x4a85('0x2a')](removeEntity(_0x449d39,null))[_0x4a85('0x4d')](handleError(_0x449d39,null));};exports[_0x4a85('0x59')]=function(_0x198b35,_0x56c636){return db['MailQueue'][_0x4a85('0x59')]()[_0x4a85('0x2a')](respondWithResult(_0x56c636,null))[_0x4a85('0x4d')](handleError(_0x56c636,null));};exports[_0x4a85('0x5a')]=function(_0x24126a,_0x47f640,_0x761760){var _0x5c414c={'raw':!![],'where':{}},_0x2dcc1d={},_0x48cc3f;return db['MailQueue'][_0x4a85('0x5b')]({'where':{'id':_0x24126a[_0x4a85('0x58')]['id']}})[_0x4a85('0x2a')](handleEntityNotFound(_0x47f640,null))[_0x4a85('0x2a')](function(_0x141d75){if(_0x141d75){_0x48cc3f=_0x141d75[_0x4a85('0x2b')]({'plain':!![]});_0x2dcc1d[_0x4a85('0x37')]=_[_0x4a85('0x39')](db['UserMailQueue'][_0x4a85('0x33')]);_0x2dcc1d[_0x4a85('0x38')]=_['keys'](_0x24126a['query']);_0x2dcc1d[_0x4a85('0x3a')]=_[_0x4a85('0x3b')](_0x2dcc1d[_0x4a85('0x37')],_0x2dcc1d['query']);_0x5c414c[_0x4a85('0x3c')]=_[_0x4a85('0x3b')](_0x2dcc1d[_0x4a85('0x37')],qs[_0x4a85('0x3d')](_0x24126a[_0x4a85('0x38')][_0x4a85('0x3d')]));_0x5c414c[_0x4a85('0x3c')]=_0x5c414c[_0x4a85('0x3c')][_0x4a85('0x3e')]?_0x5c414c['attributes']:_0x2dcc1d[_0x4a85('0x37')];if(!_0x24126a[_0x4a85('0x38')]['hasOwnProperty'](_0x4a85('0x40'))){_0x5c414c[_0x4a85('0x23')]=qs[_0x4a85('0x23')](_0x24126a['query']['limit']);_0x5c414c[_0x4a85('0x24')]=qs[_0x4a85('0x24')](_0x24126a[_0x4a85('0x38')][_0x4a85('0x24')]);}_0x5c414c[_0x4a85('0x5c')]=qs[_0x4a85('0x41')](_0x24126a['query']['sort']);_0x5c414c[_0x4a85('0x42')]=qs[_0x4a85('0x3a')](_[_0x4a85('0x43')](_0x24126a[_0x4a85('0x38')],_0x2dcc1d[_0x4a85('0x3a')]));_0x5c414c['where'][_0x4a85('0x5d')]=_0x141d75['id'];if(_0x24126a[_0x4a85('0x38')][_0x4a85('0x44')]){_0x5c414c['where']=_[_0x4a85('0x45')](_0x5c414c[_0x4a85('0x42')],{'$or':_['map'](_0x5c414c[_0x4a85('0x3c')],function(_0x5339d2){var _0x1db94f={};_0x1db94f[_0x5339d2]={'$like':'%'+_0x24126a[_0x4a85('0x38')][_0x4a85('0x44')]+'%'};return _0x1db94f;})});}_0x5c414c=_[_0x4a85('0x45')]({},_0x5c414c,_0x24126a[_0x4a85('0x46')]);return db[_0x4a85('0x5e')][_0x4a85('0x49')](_0x5c414c);}})[_0x4a85('0x2a')](function(_0x56b9f3){if(_0x56b9f3){return db[_0x4a85('0x5f')][_0x4a85('0x60')]({'where':{'id':_[_0x4a85('0x31')](_0x56b9f3,_0x4a85('0x61')),'role':'agent'},'attributes':['id',_0x4a85('0x2e'),_0x4a85('0x62'),_0x4a85('0x63'),_0x4a85('0x64')]});}})['then'](function(_0x1e99f9){if(_0x1e99f9){return{'count':_0x1e99f9[_0x4a85('0x25')],'rows':_[_0x4a85('0x31')](_0x1e99f9[_0x4a85('0x4a')],function(_0xbae200){return{'membername':_0xbae200['name'],'UserId':_0xbae200['id'],'queue_name':_0x48cc3f[_0x4a85('0x2e')],'MailQueueId':_0x48cc3f['id'],'interface':util[_0x4a85('0x65')](_0x4a85('0x66'),_0x4a85('0x67'),_0xbae200[_0x4a85('0x2e')]),'penalty':0x0,'paused':_0xbae200['mailPause'],'createdAt':_0xbae200[_0x4a85('0x64')],'updatedAt':_0xbae200[_0x4a85('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4a85('0x2a')](respondWithFilteredResult(_0x47f640,_0x5c414c))[_0x4a85('0x4d')](handleError(_0x47f640,null));};exports['getTeams']=function(_0x5f2813,_0x43d341,_0x2b3202){var _0x5cc1c5={};var _0x506f1c={};var _0xabb8e5;var _0x1001a9;return db[_0x4a85('0x32')][_0x4a85('0x5b')]({'where':{'id':_0x5f2813[_0x4a85('0x58')]['id']}})[_0x4a85('0x2a')](handleEntityNotFound(_0x43d341,null))[_0x4a85('0x2a')](function(_0x594d10){if(_0x594d10){_0xabb8e5=_0x594d10;_0x506f1c[_0x4a85('0x37')]=_[_0x4a85('0x39')](db[_0x4a85('0x68')][_0x4a85('0x33')]);_0x506f1c[_0x4a85('0x38')]=_[_0x4a85('0x39')](_0x5f2813[_0x4a85('0x38')]);_0x506f1c['filters']=_[_0x4a85('0x3b')](_0x506f1c[_0x4a85('0x37')],_0x506f1c['query']);_0x5cc1c5[_0x4a85('0x3c')]=_[_0x4a85('0x3b')](_0x506f1c[_0x4a85('0x37')],qs[_0x4a85('0x3d')](_0x5f2813[_0x4a85('0x38')][_0x4a85('0x3d')]));_0x5cc1c5[_0x4a85('0x3c')]=_0x5cc1c5['attributes'][_0x4a85('0x3e')]?_0x5cc1c5['attributes']:_0x506f1c[_0x4a85('0x37')];_0x5cc1c5['order']=qs[_0x4a85('0x41')](_0x5f2813[_0x4a85('0x38')][_0x4a85('0x41')]);_0x5cc1c5[_0x4a85('0x42')]=qs[_0x4a85('0x3a')](_[_0x4a85('0x43')](_0x5f2813[_0x4a85('0x38')],_0x506f1c[_0x4a85('0x3a')]));if(_0x5f2813[_0x4a85('0x38')][_0x4a85('0x44')]){_0x5cc1c5[_0x4a85('0x42')]=_['merge'](_0x5cc1c5[_0x4a85('0x42')],{'$or':_[_0x4a85('0x31')](_0x5cc1c5['attributes'],function(_0x27988e){var _0x4eed={};_0x4eed[_0x27988e]={'$like':'%'+_0x5f2813[_0x4a85('0x38')][_0x4a85('0x44')]+'%'};return _0x4eed;})});}_0x5cc1c5=_[_0x4a85('0x45')]({},_0x5cc1c5,_0x5f2813['options']);return _0xabb8e5[_0x4a85('0x69')](_0x5cc1c5);}})[_0x4a85('0x2a')](function(_0x4c3186){if(_0x4c3186){_0x1001a9=_0x4c3186[_0x4a85('0x3e')];if(!_0x5f2813[_0x4a85('0x38')][_0x4a85('0x3f')]('nolimit')){_0x5cc1c5[_0x4a85('0x23')]=qs[_0x4a85('0x23')](_0x5f2813[_0x4a85('0x38')][_0x4a85('0x23')]);_0x5cc1c5[_0x4a85('0x24')]=qs[_0x4a85('0x24')](_0x5f2813[_0x4a85('0x38')][_0x4a85('0x24')]);}return _0xabb8e5[_0x4a85('0x69')](_0x5cc1c5);}})[_0x4a85('0x2a')](function(_0x25c97b){if(_0x25c97b){return _0x25c97b?{'count':_0x1001a9,'rows':_0x25c97b}:null;}})[_0x4a85('0x2a')](respondWithResult(_0x43d341,null))[_0x4a85('0x4d')](handleError(_0x43d341,null));};exports[_0x4a85('0x6a')]=function(_0x490cb4,_0x21118e,_0x18bd0c){var _0x5231b0=_0x490cb4[_0x4a85('0x4f')]['ids'];return db[_0x4a85('0x68')][_0x4a85('0x49')]({'where':{'id':_0x5231b0},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x4a85('0x6b'),_0x4a85('0x6c'),_0x4a85('0x6d')],'raw':!![]}]})[_0x4a85('0x2a')](function(_0x35b7fd){if(_0x35b7fd){var _0x471f66=_['flatMap'](_0x35b7fd,function(_0x552846){var _0x59e0bf=_0x552846[_0x4a85('0x2b')]({'plain':!![]});return _0x59e0bf['Agents'];});return db['MailQueue'][_0x4a85('0x4c')]({'where':{'id':_0x490cb4[_0x4a85('0x58')]['id']}})[_0x4a85('0x2a')](function(_0x550c2d){return db[_0x4a85('0x6e')][_0x4a85('0x6f')](function(_0x51f899){return _0x550c2d[_0x4a85('0x6a')](_0x5231b0,{'transaction':_0x51f899})[_0x4a85('0x2a')](function(){return BPromise['each'](_0x471f66,function(_0x3ad579){return db[_0x4a85('0x5e')][_0x4a85('0x70')]({'where':{'UserId':_0x3ad579['id'],'MailQueueId':_0x490cb4['params']['id']},'transaction':_0x51f899});});})[_0x4a85('0x2a')](function(){_0x471f66[_0x4a85('0x71')](function(_0x4eae32){socket['emit'](_0x4a85('0x72'),{'UserId':_0x4eae32['id'],'MailQueueId':_0x550c2d['id']});});});});});}})[_0x4a85('0x2a')](respondWithStatusCode(_0x21118e,null))[_0x4a85('0x4d')](handleError(_0x21118e,null));};exports[_0x4a85('0x73')]=function(_0x53075d,_0x299a81,_0x4eee65){return db[_0x4a85('0x68')]['findAll']({'where':{'id':_0x53075d[_0x4a85('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4a85('0x5f')],'as':_0x4a85('0x74'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x299a81,null))[_0x4a85('0x2a')](function(_0x58bc27){var _0x41725f=_[_0x4a85('0x31')](_0x58bc27,'id');var _0x5cde58=[];var _0x711c63=[];var _0x3a1800=squel[_0x4a85('0x75')]();_0x3a1800[_0x4a85('0x76')](_0x4a85('0x77'))['from'](_0x4a85('0x78'),'tq')[_0x4a85('0x79')](_0x4a85('0x7a'),'ut',_0x4a85('0x7b'))['where']('MailQueueId\x20=\x20?',_0x53075d[_0x4a85('0x58')]['id']);for(var _0x303ef5=0x0;_0x303ef5<_0x58bc27['length'];_0x303ef5+=0x1){let _0x41e906=_0x58bc27[_0x303ef5];for(var _0x255b39=0x0;_0x255b39<_0x41e906[_0x4a85('0x74')][_0x4a85('0x3e')];_0x255b39+=0x1){let _0x168edd=_0x41e906[_0x4a85('0x74')][_0x255b39];var _0x48bcee=_0x3a1800[_0x4a85('0x7c')]();_0x48bcee[_0x4a85('0x42')](_0x4a85('0x7d'),_0x168edd['id']);_0x711c63['push'](db[_0x4a85('0x6e')][_0x4a85('0x38')](_0x48bcee[_0x4a85('0x7e')](),{'type':db[_0x4a85('0x6e')]['QueryTypes'][_0x4a85('0x7f')]})[_0x4a85('0x2a')](function(_0x4ea716){if(_0x4ea716[_0x4a85('0x3e')]===0x1){return _0x168edd['id'];}else{var _0x200c35=_['every'](_[_0x4a85('0x31')](_0x4ea716,_0x4a85('0x80')),function(_0x2162fe){return _[_0x4a85('0x81')](_0x41725f,_0x2162fe);});if(_0x200c35){return _0x168edd['id'];}}}));}}return BPromise['all'](_0x711c63)[_0x4a85('0x2a')](function(_0x1dc440){_0x5cde58=_(_0x5cde58)[_0x4a85('0x82')](_0x1dc440)[_0x4a85('0x83')]()[_0x4a85('0x84')]();return db[_0x4a85('0x32')]['find']({'where':{'id':_0x53075d[_0x4a85('0x58')]['id']}})[_0x4a85('0x2a')](function(_0xb5bcb){return db['sequelize'][_0x4a85('0x6f')](function(_0x2b6ba0){return _0xb5bcb[_0x4a85('0x73')](_0x53075d[_0x4a85('0x38')][_0x4a85('0x85')],{'transaction':_0x2b6ba0})[_0x4a85('0x2a')](function(){if(!_['isEmpty'](_0x5cde58)){return _0xb5bcb['removeAgents'](_0x5cde58,{'transaction':_0x2b6ba0});}})['then'](function(){_0x5cde58[_0x4a85('0x71')](function(_0x56379b){socket[_0x4a85('0x86')]('userMailQueue:remove',{'UserId':_0x56379b,'MailQueueId':_0xb5bcb['id']});});});});});});})[_0x4a85('0x2a')](respondWithStatusCode(_0x299a81,null))['catch'](handleError(_0x299a81,null));};exports[_0x4a85('0x87')]=function(_0x92172d,_0x26e332,_0x491671){return db['MailQueue'][_0x4a85('0x4c')]({'where':{'id':_0x92172d[_0x4a85('0x58')]['id']}})[_0x4a85('0x2a')](handleEntityNotFound(_0x26e332,null))['then'](function(_0x2d70ba){if(_0x2d70ba){return _0x2d70ba['addAgents'](_0x92172d[_0x4a85('0x4f')][_0x4a85('0x85')],_[_0x4a85('0x88')](_0x92172d[_0x4a85('0x4f')],[_0x4a85('0x85'),'id'])||{})['spread'](function(_0x1bb367){for(var _0x2cfb61=0x0;_0x2cfb61<_0x92172d[_0x4a85('0x4f')][_0x4a85('0x85')]['length'];_0x2cfb61+=0x1){socket[_0x4a85('0x86')](_0x4a85('0x72'),{'UserId':Number(_0x92172d[_0x4a85('0x4f')][_0x4a85('0x85')][_0x2cfb61]),'MailQueueId':Number(_0x92172d[_0x4a85('0x58')]['id'])});}return _0x1bb367;});}})[_0x4a85('0x2a')](respondWithResult(_0x26e332,null))[_0x4a85('0x4d')](handleError(_0x26e332,null));};exports[_0x4a85('0x89')]=function(_0x183085,_0x35e15b,_0x5aa8aa){return db['MailQueue'][_0x4a85('0x4c')]({'where':{'id':_0x183085[_0x4a85('0x58')]['id']}})[_0x4a85('0x2a')](handleEntityNotFound(_0x35e15b,null))[_0x4a85('0x2a')](function(_0x17aa28){if(_0x17aa28){return _0x17aa28['removeAgents'](_0x183085[_0x4a85('0x38')]['ids'])[_0x4a85('0x2a')](function(){if(_['isArray'](_0x183085[_0x4a85('0x38')]['ids'])){for(var _0x2a89d3=0x0;_0x2a89d3<_0x183085[_0x4a85('0x38')]['ids'][_0x4a85('0x3e')];_0x2a89d3+=0x1){socket['emit'](_0x4a85('0x8a'),{'UserId':Number(_0x183085[_0x4a85('0x38')][_0x4a85('0x85')][_0x2a89d3]),'MailQueueId':Number(_0x183085[_0x4a85('0x58')]['id'])});}}else{socket[_0x4a85('0x86')]('userMailQueue:remove',{'UserId':Number(_0x183085[_0x4a85('0x38')][_0x4a85('0x85')]),'MailQueueId':Number(_0x183085[_0x4a85('0x58')]['id'])});}});}})[_0x4a85('0x2a')](respondWithStatusCode(_0x35e15b,null))[_0x4a85('0x4d')](handleError(_0x35e15b,null));};exports['getAgents']=function(_0x482ff6,_0x5b30f2,_0x5ba801){var _0x201ef6={};var _0x5abf7f={};var _0x25135b;var _0x3bf992;return db[_0x4a85('0x32')][_0x4a85('0x5b')]({'where':{'id':_0x482ff6[_0x4a85('0x58')]['id']}})[_0x4a85('0x2a')](handleEntityNotFound(_0x5b30f2,null))[_0x4a85('0x2a')](function(_0x53ef9e){if(_0x53ef9e){_0x25135b=_0x53ef9e;_0x5abf7f[_0x4a85('0x37')]=_[_0x4a85('0x39')](db[_0x4a85('0x5f')][_0x4a85('0x33')]);_0x5abf7f[_0x4a85('0x38')]=_['keys'](_0x482ff6[_0x4a85('0x38')]);_0x5abf7f['filters']=_[_0x4a85('0x3b')](_0x5abf7f[_0x4a85('0x37')],_0x5abf7f[_0x4a85('0x38')]);_0x201ef6[_0x4a85('0x3c')]=_['intersection'](_0x5abf7f[_0x4a85('0x37')],qs['fields'](_0x482ff6[_0x4a85('0x38')][_0x4a85('0x3d')]));_0x201ef6[_0x4a85('0x3c')]=_0x201ef6[_0x4a85('0x3c')][_0x4a85('0x3e')]?_0x201ef6[_0x4a85('0x3c')]:_0x5abf7f['model'];_0x201ef6['order']=qs[_0x4a85('0x41')](_0x482ff6[_0x4a85('0x38')][_0x4a85('0x41')]);_0x201ef6[_0x4a85('0x42')]=qs['filters'](_['pick'](_0x482ff6[_0x4a85('0x38')],_0x5abf7f[_0x4a85('0x3a')]));if(_0x482ff6['query'][_0x4a85('0x44')]){_0x201ef6[_0x4a85('0x42')]=_[_0x4a85('0x45')](_0x201ef6['where'],{'$or':_['map'](_0x201ef6[_0x4a85('0x3c')],function(_0x3d8cac){var _0x1b53b2={};_0x1b53b2[_0x3d8cac]={'$like':'%'+_0x482ff6[_0x4a85('0x38')]['filter']+'%'};return _0x1b53b2;})});}_0x201ef6=_[_0x4a85('0x45')]({},_0x201ef6,_0x482ff6[_0x4a85('0x46')]);return _0x25135b[_0x4a85('0x8b')](_0x201ef6);}})[_0x4a85('0x2a')](function(_0x3bb46b){if(_0x3bb46b){_0x3bf992=_0x3bb46b[_0x4a85('0x3e')];if(!_0x482ff6[_0x4a85('0x38')]['hasOwnProperty'](_0x4a85('0x40'))){_0x201ef6['limit']=qs['limit'](_0x482ff6['query'][_0x4a85('0x23')]);_0x201ef6[_0x4a85('0x24')]=qs[_0x4a85('0x24')](_0x482ff6[_0x4a85('0x38')]['offset']);}return _0x25135b['getAgents'](_0x201ef6);}})[_0x4a85('0x2a')](function(_0x2e97af){if(_0x2e97af){return _0x2e97af?{'count':_0x3bf992,'rows':_0x2e97af}:null;}})['then'](respondWithResult(_0x5b30f2,null))[_0x4a85('0x4d')](handleError(_0x5b30f2,null));}; \ No newline at end of file +var _0x4be8=['offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','MailQueues','UserProfileResource','error','stack','name','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','order','MailQueueId','UserMailQueue','User','UserId','mailPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','options','hasOwnProperty','nolimit','addTeams','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','TeamId','union','compact','value','ids','isEmpty','userMailQueue:remove','addAgents','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','register','status','end','json'];(function(_0x36cfe3,_0x2cca39){var _0x5c203f=function(_0x33486b){while(--_0x33486b){_0x36cfe3['push'](_0x36cfe3['shift']());}};_0x5c203f(++_0x2cca39);}(_0x4be8,0x17f));var _0x84be=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x4be8[_0x1573ea];return _0x51c0e2;};'use strict';var emlformat=require(_0x84be('0x0'));var rimraf=require(_0x84be('0x1'));var zipdir=require(_0x84be('0x2'));var jsonpatch=require(_0x84be('0x3'));var rp=require(_0x84be('0x4'));var moment=require(_0x84be('0x5'));var BPromise=require(_0x84be('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x84be('0x7'));var sox=require(_0x84be('0x8'));var csv=require(_0x84be('0x9'));var ejs=require(_0x84be('0xa'));var fs=require('fs');var fs_extra=require(_0x84be('0xb'));var _=require(_0x84be('0xc'));var squel=require('squel');var crypto=require(_0x84be('0xd'));var jsforce=require(_0x84be('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x84be('0x9'));var querystring=require(_0x84be('0xf'));var Papa=require('papaparse');var Redis=require(_0x84be('0x10'));var authService=require(_0x84be('0x11'));var qs=require(_0x84be('0x12'));var as=require(_0x84be('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84be('0x14'))(_0x84be('0x15'));var utils=require(_0x84be('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x84be('0x17'));var db=require('../../mysqldb')['db'];config[_0x84be('0x18')]=_[_0x84be('0x19')](config[_0x84be('0x18')],{'host':_0x84be('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailQueue.socket')[_0x84be('0x1b')](socket);function respondWithStatusCode(_0x3d84af,_0x22d557){_0x22d557=_0x22d557||0xcc;return function(_0x87aa41){if(_0x87aa41){return _0x3d84af['sendStatus'](_0x22d557);}return _0x3d84af[_0x84be('0x1c')](_0x22d557)[_0x84be('0x1d')]();};}function respondWithResult(_0x2e4d55,_0x982ebd){_0x982ebd=_0x982ebd||0xc8;return function(_0x3c965d){if(_0x3c965d){return _0x2e4d55[_0x84be('0x1c')](_0x982ebd)[_0x84be('0x1e')](_0x3c965d);}};}function respondWithFilteredResult(_0x546e08,_0x5d0916){return function(_0x1854c4){if(_0x1854c4){var _0x56abf7=typeof _0x5d0916[_0x84be('0x1f')]==='undefined'&&typeof _0x5d0916[_0x84be('0x20')]==='undefined';var _0x4292ef=_0x1854c4[_0x84be('0x21')];var _0x2f2ee0=_0x56abf7?0x0:_0x5d0916[_0x84be('0x1f')];var _0x139c13=_0x56abf7?_0x1854c4[_0x84be('0x21')]:_0x5d0916['offset']+_0x5d0916['limit'];var _0x457223;if(_0x139c13>=_0x4292ef){_0x139c13=_0x4292ef;_0x457223=0xc8;}else{_0x457223=0xce;}_0x546e08[_0x84be('0x1c')](_0x457223);return _0x546e08['set'](_0x84be('0x22'),_0x2f2ee0+'-'+_0x139c13+'/'+_0x4292ef)['json'](_0x1854c4);}return null;};}function patchUpdates(_0x4b19fa){return function(_0x6f7ce){try{jsonpatch[_0x84be('0x23')](_0x6f7ce,_0x4b19fa,!![]);}catch(_0x2915a5){return BPromise[_0x84be('0x24')](_0x2915a5);}return _0x6f7ce[_0x84be('0x25')]();};}function saveUpdates(_0x486a3c,_0x135f95){return function(_0x265ed6){if(_0x265ed6){return _0x265ed6[_0x84be('0x26')](_0x486a3c)[_0x84be('0x27')](function(_0x3f664e){return _0x3f664e;});}return null;};}function removeEntity(_0x252fe8,_0x5691fe){return function(_0x1c5e0f){if(_0x1c5e0f){return _0x1c5e0f[_0x84be('0x28')]()[_0x84be('0x27')](function(){var _0x588ecb=_0x1c5e0f['get']({'plain':!![]});var _0x3bfe2=_0x84be('0x29');return db[_0x84be('0x2a')]['destroy']({'where':{'type':_0x3bfe2,'resourceId':_0x588ecb['id']}})[_0x84be('0x27')](function(){return _0x1c5e0f;});})[_0x84be('0x27')](function(){_0x252fe8[_0x84be('0x1c')](0xcc)[_0x84be('0x1d')]();});}};}function handleEntityNotFound(_0x5329bb,_0x34db0e){return function(_0x209bc6){if(!_0x209bc6){_0x5329bb['sendStatus'](0x194);}return _0x209bc6;};}function handleError(_0x220f00,_0x4ef656){_0x4ef656=_0x4ef656||0x1f4;return function(_0x67943b){logger[_0x84be('0x2b')](_0x67943b[_0x84be('0x2c')]);if(_0x67943b['name']){delete _0x67943b[_0x84be('0x2d')];}_0x220f00[_0x84be('0x1c')](_0x4ef656)['send'](_0x67943b);};}exports[_0x84be('0x2e')]=function(_0x327f23,_0x55b691){var _0x1e7438={},_0x4233d3={},_0x63abfa={'count':0x0,'rows':[]};var _0x38a7a8=_[_0x84be('0x2f')](db[_0x84be('0x30')][_0x84be('0x31')],function(_0x37cc12){return{'name':_0x37cc12[_0x84be('0x32')],'type':_0x37cc12[_0x84be('0x33')][_0x84be('0x34')]};});_0x4233d3[_0x84be('0x35')]=_[_0x84be('0x2f')](_0x38a7a8,_0x84be('0x2d'));_0x4233d3[_0x84be('0x36')]=_[_0x84be('0x37')](_0x327f23[_0x84be('0x36')]);_0x4233d3[_0x84be('0x38')]=_[_0x84be('0x39')](_0x4233d3[_0x84be('0x35')],_0x4233d3[_0x84be('0x36')]);_0x1e7438[_0x84be('0x3a')]=_[_0x84be('0x39')](_0x4233d3[_0x84be('0x35')],qs[_0x84be('0x3b')](_0x327f23[_0x84be('0x36')]['fields']));_0x1e7438[_0x84be('0x3a')]=_0x1e7438[_0x84be('0x3a')][_0x84be('0x3c')]?_0x1e7438[_0x84be('0x3a')]:_0x4233d3['model'];if(!_0x327f23[_0x84be('0x36')]['hasOwnProperty']('nolimit')){_0x1e7438[_0x84be('0x20')]=qs[_0x84be('0x20')](_0x327f23[_0x84be('0x36')]['limit']);_0x1e7438[_0x84be('0x1f')]=qs[_0x84be('0x1f')](_0x327f23[_0x84be('0x36')]['offset']);}_0x1e7438['order']=qs[_0x84be('0x3d')](_0x327f23[_0x84be('0x36')][_0x84be('0x3d')]);_0x1e7438[_0x84be('0x3e')]=qs[_0x84be('0x38')](_[_0x84be('0x3f')](_0x327f23['query'],_0x4233d3[_0x84be('0x38')]),_0x38a7a8);if(_0x327f23['query'][_0x84be('0x40')]){_0x1e7438[_0x84be('0x3e')]=_[_0x84be('0x41')](_0x1e7438['where'],{'$or':_[_0x84be('0x2f')](_0x38a7a8,function(_0x4b7bb1){if(_0x4b7bb1['type']!==_0x84be('0x42')){var _0x4189c9={};_0x4189c9[_0x4b7bb1['name']]={'$like':'%'+_0x327f23[_0x84be('0x36')][_0x84be('0x40')]+'%'};return _0x4189c9;}})});}_0x1e7438=_[_0x84be('0x41')]({},_0x1e7438,_0x327f23['options']);var _0x5f3000={'where':_0x1e7438['where']};return db['MailQueue'][_0x84be('0x21')](_0x5f3000)[_0x84be('0x27')](function(_0x407b9d){_0x63abfa[_0x84be('0x21')]=_0x407b9d;if(_0x327f23['query'][_0x84be('0x43')]){_0x1e7438[_0x84be('0x44')]=[{'all':!![]}];}return db[_0x84be('0x30')][_0x84be('0x45')](_0x1e7438);})[_0x84be('0x27')](function(_0x2d3596){_0x63abfa[_0x84be('0x46')]=_0x2d3596;return _0x63abfa;})[_0x84be('0x27')](respondWithFilteredResult(_0x55b691,_0x1e7438))['catch'](handleError(_0x55b691,null));};exports[_0x84be('0x47')]=function(_0x11f028,_0x372bae){var _0x38bbac={'raw':!![],'where':{'id':_0x11f028[_0x84be('0x48')]['id']}},_0x291b83={};_0x291b83['model']=_[_0x84be('0x37')](db['MailQueue'][_0x84be('0x31')]);_0x291b83[_0x84be('0x36')]=_['keys'](_0x11f028[_0x84be('0x36')]);_0x291b83[_0x84be('0x38')]=_[_0x84be('0x39')](_0x291b83[_0x84be('0x35')],_0x291b83[_0x84be('0x36')]);_0x38bbac[_0x84be('0x3a')]=_[_0x84be('0x39')](_0x291b83[_0x84be('0x35')],qs['fields'](_0x11f028[_0x84be('0x36')]['fields']));_0x38bbac['attributes']=_0x38bbac[_0x84be('0x3a')]['length']?_0x38bbac['attributes']:_0x291b83[_0x84be('0x35')];if(_0x11f028['query']['includeAll']){_0x38bbac[_0x84be('0x44')]=[{'all':!![]}];}_0x38bbac=_[_0x84be('0x41')]({},_0x38bbac,_0x11f028['options']);return db[_0x84be('0x30')][_0x84be('0x49')](_0x38bbac)[_0x84be('0x27')](handleEntityNotFound(_0x372bae,null))['then'](respondWithResult(_0x372bae,null))[_0x84be('0x4a')](handleError(_0x372bae,null));};exports[_0x84be('0x4b')]=function(_0x2929c1,_0x2d4790){return db[_0x84be('0x30')][_0x84be('0x4b')](_0x2929c1[_0x84be('0x4c')],{})[_0x84be('0x27')](function(_0x380eca){var _0x17099b=_0x2929c1[_0x84be('0x4d')]['get']({'plain':!![]});if(!_0x17099b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17099b[_0x84be('0x4e')]===_0x84be('0x4d')){var _0x1678a8=_0x380eca[_0x84be('0x4f')]({'plain':!![]});var _0xcea41=_0x84be('0x29');return db[_0x84be('0x50')][_0x84be('0x49')]({'where':{'name':_0xcea41,'userProfileId':_0x17099b[_0x84be('0x51')]},'raw':!![]})[_0x84be('0x27')](function(_0x432f9c){if(_0x432f9c&&_0x432f9c['autoAssociation']===0x0){return db[_0x84be('0x2a')][_0x84be('0x4b')]({'name':_0x1678a8['name'],'resourceId':_0x1678a8['id'],'type':_0x432f9c[_0x84be('0x2d')],'sectionId':_0x432f9c['id']},{})[_0x84be('0x27')](function(){return _0x380eca;});}else{return _0x380eca;}})[_0x84be('0x4a')](function(_0x4e477a){logger[_0x84be('0x2b')](_0x84be('0x52'),_0x4e477a);throw _0x4e477a;});}return _0x380eca;})[_0x84be('0x27')](respondWithResult(_0x2d4790,0xc9))['catch'](handleError(_0x2d4790,null));};exports[_0x84be('0x26')]=function(_0x180e3c,_0x40d892){if(_0x180e3c[_0x84be('0x4c')]['id']){delete _0x180e3c[_0x84be('0x4c')]['id'];}return db[_0x84be('0x30')][_0x84be('0x49')]({'where':{'id':_0x180e3c[_0x84be('0x48')]['id']}})['then'](handleEntityNotFound(_0x40d892,null))[_0x84be('0x27')](saveUpdates(_0x180e3c[_0x84be('0x4c')],null))[_0x84be('0x27')](respondWithResult(_0x40d892,null))[_0x84be('0x4a')](handleError(_0x40d892,null));};exports[_0x84be('0x28')]=function(_0x4db266,_0x480b0b){return db['MailQueue'][_0x84be('0x49')]({'where':{'id':_0x4db266['params']['id']}})[_0x84be('0x27')](handleEntityNotFound(_0x480b0b,null))['then'](removeEntity(_0x480b0b,null))['catch'](handleError(_0x480b0b,null));};exports[_0x84be('0x53')]=function(_0x43b55c,_0x572064){return db[_0x84be('0x30')][_0x84be('0x53')]()[_0x84be('0x27')](respondWithResult(_0x572064,null))['catch'](handleError(_0x572064,null));};exports['getMembers']=function(_0x22f2a5,_0x48ddec,_0x3edfe8){var _0x2db5fe={'raw':!![],'where':{}},_0x337ede={},_0x3046ad;return db[_0x84be('0x30')][_0x84be('0x54')]({'where':{'id':_0x22f2a5[_0x84be('0x48')]['id']}})[_0x84be('0x27')](handleEntityNotFound(_0x48ddec,null))[_0x84be('0x27')](function(_0x39e648){if(_0x39e648){_0x3046ad=_0x39e648[_0x84be('0x4f')]({'plain':!![]});_0x337ede[_0x84be('0x35')]=_['keys'](db['UserMailQueue']['rawAttributes']);_0x337ede['query']=_[_0x84be('0x37')](_0x22f2a5[_0x84be('0x36')]);_0x337ede[_0x84be('0x38')]=_['intersection'](_0x337ede[_0x84be('0x35')],_0x337ede[_0x84be('0x36')]);_0x2db5fe[_0x84be('0x3a')]=_[_0x84be('0x39')](_0x337ede[_0x84be('0x35')],qs[_0x84be('0x3b')](_0x22f2a5[_0x84be('0x36')][_0x84be('0x3b')]));_0x2db5fe[_0x84be('0x3a')]=_0x2db5fe[_0x84be('0x3a')]['length']?_0x2db5fe[_0x84be('0x3a')]:_0x337ede['model'];if(!_0x22f2a5['query']['hasOwnProperty']('nolimit')){_0x2db5fe[_0x84be('0x20')]=qs[_0x84be('0x20')](_0x22f2a5[_0x84be('0x36')][_0x84be('0x20')]);_0x2db5fe[_0x84be('0x1f')]=qs[_0x84be('0x1f')](_0x22f2a5[_0x84be('0x36')]['offset']);}_0x2db5fe[_0x84be('0x55')]=qs[_0x84be('0x3d')](_0x22f2a5[_0x84be('0x36')]['sort']);_0x2db5fe[_0x84be('0x3e')]=qs['filters'](_[_0x84be('0x3f')](_0x22f2a5[_0x84be('0x36')],_0x337ede[_0x84be('0x38')]));_0x2db5fe['where'][_0x84be('0x56')]=_0x39e648['id'];if(_0x22f2a5[_0x84be('0x36')]['filter']){_0x2db5fe['where']=_[_0x84be('0x41')](_0x2db5fe['where'],{'$or':_[_0x84be('0x2f')](_0x2db5fe[_0x84be('0x3a')],function(_0x2d6d99){var _0x345cb7={};_0x345cb7[_0x2d6d99]={'$like':'%'+_0x22f2a5[_0x84be('0x36')][_0x84be('0x40')]+'%'};return _0x345cb7;})});}_0x2db5fe=_[_0x84be('0x41')]({},_0x2db5fe,_0x22f2a5['options']);return db[_0x84be('0x57')][_0x84be('0x45')](_0x2db5fe);}})[_0x84be('0x27')](function(_0x5d3e94){if(_0x5d3e94){return db[_0x84be('0x58')]['findAndCountAll']({'where':{'id':_[_0x84be('0x2f')](_0x5d3e94,_0x84be('0x59')),'role':'agent'},'attributes':['id',_0x84be('0x2d'),_0x84be('0x5a'),_0x84be('0x5b'),'createdAt']});}})[_0x84be('0x27')](function(_0x1a14b5){if(_0x1a14b5){return{'count':_0x1a14b5['count'],'rows':_['map'](_0x1a14b5[_0x84be('0x46')],function(_0x28357d){return{'membername':_0x28357d[_0x84be('0x2d')],'UserId':_0x28357d['id'],'queue_name':_0x3046ad[_0x84be('0x2d')],'MailQueueId':_0x3046ad['id'],'interface':util[_0x84be('0x5c')](_0x84be('0x5d'),_0x84be('0x5e'),_0x28357d[_0x84be('0x2d')]),'penalty':0x0,'paused':_0x28357d[_0x84be('0x5a')],'createdAt':_0x28357d[_0x84be('0x5f')],'updatedAt':_0x28357d[_0x84be('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x84be('0x27')](respondWithFilteredResult(_0x48ddec,_0x2db5fe))['catch'](handleError(_0x48ddec,null));};exports[_0x84be('0x60')]=function(_0xd3f518,_0x23c60c,_0x38c800){var _0x12149f={};var _0x6e6022={};var _0x1ad1c5;var _0x3e41dc;return db[_0x84be('0x30')][_0x84be('0x54')]({'where':{'id':_0xd3f518[_0x84be('0x48')]['id']}})[_0x84be('0x27')](handleEntityNotFound(_0x23c60c,null))[_0x84be('0x27')](function(_0x2085de){if(_0x2085de){_0x1ad1c5=_0x2085de;_0x6e6022[_0x84be('0x35')]=_[_0x84be('0x37')](db[_0x84be('0x61')][_0x84be('0x31')]);_0x6e6022[_0x84be('0x36')]=_['keys'](_0xd3f518[_0x84be('0x36')]);_0x6e6022[_0x84be('0x38')]=_[_0x84be('0x39')](_0x6e6022['model'],_0x6e6022[_0x84be('0x36')]);_0x12149f[_0x84be('0x3a')]=_[_0x84be('0x39')](_0x6e6022['model'],qs[_0x84be('0x3b')](_0xd3f518[_0x84be('0x36')]['fields']));_0x12149f[_0x84be('0x3a')]=_0x12149f[_0x84be('0x3a')]['length']?_0x12149f[_0x84be('0x3a')]:_0x6e6022[_0x84be('0x35')];_0x12149f[_0x84be('0x55')]=qs[_0x84be('0x3d')](_0xd3f518[_0x84be('0x36')][_0x84be('0x3d')]);_0x12149f[_0x84be('0x3e')]=qs[_0x84be('0x38')](_[_0x84be('0x3f')](_0xd3f518[_0x84be('0x36')],_0x6e6022[_0x84be('0x38')]));if(_0xd3f518[_0x84be('0x36')][_0x84be('0x40')]){_0x12149f[_0x84be('0x3e')]=_['merge'](_0x12149f[_0x84be('0x3e')],{'$or':_[_0x84be('0x2f')](_0x12149f[_0x84be('0x3a')],function(_0x57c7f0){var _0xab027={};_0xab027[_0x57c7f0]={'$like':'%'+_0xd3f518[_0x84be('0x36')]['filter']+'%'};return _0xab027;})});}_0x12149f=_[_0x84be('0x41')]({},_0x12149f,_0xd3f518[_0x84be('0x62')]);return _0x1ad1c5[_0x84be('0x60')](_0x12149f);}})['then'](function(_0x121d24){if(_0x121d24){_0x3e41dc=_0x121d24[_0x84be('0x3c')];if(!_0xd3f518[_0x84be('0x36')][_0x84be('0x63')](_0x84be('0x64'))){_0x12149f[_0x84be('0x20')]=qs[_0x84be('0x20')](_0xd3f518['query'][_0x84be('0x20')]);_0x12149f[_0x84be('0x1f')]=qs[_0x84be('0x1f')](_0xd3f518[_0x84be('0x36')][_0x84be('0x1f')]);}return _0x1ad1c5['getTeams'](_0x12149f);}})[_0x84be('0x27')](function(_0x473198){if(_0x473198){return _0x473198?{'count':_0x3e41dc,'rows':_0x473198}:null;}})[_0x84be('0x27')](respondWithResult(_0x23c60c,null))[_0x84be('0x4a')](handleError(_0x23c60c,null));};exports[_0x84be('0x65')]=function(_0x36fb49,_0x4e2e2c,_0x38cfcd){var _0x56c635=_0x36fb49[_0x84be('0x4c')]['ids'];return db[_0x84be('0x61')][_0x84be('0x45')]({'where':{'id':_0x56c635},'attributes':['id'],'include':[{'model':db[_0x84be('0x58')],'as':_0x84be('0x66'),'attributes':['id',_0x84be('0x2d'),'online',_0x84be('0x67'),_0x84be('0x68')],'raw':!![]}]})[_0x84be('0x27')](function(_0x1fdc59){if(_0x1fdc59){var _0x3e4c9e=_['flatMap'](_0x1fdc59,function(_0x23f210){var _0x42f675=_0x23f210['get']({'plain':!![]});return _0x42f675[_0x84be('0x66')];});return db[_0x84be('0x30')][_0x84be('0x49')]({'where':{'id':_0x36fb49[_0x84be('0x48')]['id']}})[_0x84be('0x27')](function(_0x23da53){return db[_0x84be('0x69')][_0x84be('0x6a')](function(_0x359a51){return _0x23da53[_0x84be('0x65')](_0x56c635,{'transaction':_0x359a51})['then'](function(){return BPromise[_0x84be('0x6b')](_0x3e4c9e,function(_0x28558e){return db[_0x84be('0x57')][_0x84be('0x6c')]({'where':{'UserId':_0x28558e['id'],'MailQueueId':_0x36fb49['params']['id']},'transaction':_0x359a51});});})[_0x84be('0x27')](function(){_0x3e4c9e[_0x84be('0x6d')](function(_0x58c04d){socket[_0x84be('0x6e')](_0x84be('0x6f'),{'UserId':_0x58c04d['id'],'MailQueueId':_0x23da53['id']});});});});});}})['then'](respondWithStatusCode(_0x4e2e2c,null))[_0x84be('0x4a')](handleError(_0x4e2e2c,null));};exports[_0x84be('0x70')]=function(_0x12b02e,_0x2651ae,_0x5d6f5c){return db[_0x84be('0x61')][_0x84be('0x45')]({'where':{'id':_0x12b02e['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x84be('0x58')],'as':_0x84be('0x66'),'attributes':['id'],'raw':!![]}]})[_0x84be('0x27')](handleEntityNotFound(_0x2651ae,null))[_0x84be('0x27')](function(_0x4c1bf5){var _0x4ca686=_[_0x84be('0x2f')](_0x4c1bf5,'id');var _0x3f02c9=[];var _0x105bc5=[];var _0x1881f0=squel[_0x84be('0x71')]();_0x1881f0[_0x84be('0x72')](_0x84be('0x73'))[_0x84be('0x74')](_0x84be('0x75'),'tq')[_0x84be('0x76')](_0x84be('0x77'),'ut',_0x84be('0x78'))['where'](_0x84be('0x79'),_0x12b02e[_0x84be('0x48')]['id']);for(var _0x4796e7=0x0;_0x4796e7<_0x4c1bf5[_0x84be('0x3c')];_0x4796e7+=0x1){let _0x572813=_0x4c1bf5[_0x4796e7];for(var _0x22d5cd=0x0;_0x22d5cd<_0x572813[_0x84be('0x66')][_0x84be('0x3c')];_0x22d5cd+=0x1){let _0x974894=_0x572813['Agents'][_0x22d5cd];var _0x1631fa=_0x1881f0[_0x84be('0x7a')]();_0x1631fa[_0x84be('0x3e')]('ut.UserId\x20=\x20?',_0x974894['id']);_0x105bc5[_0x84be('0x7b')](db[_0x84be('0x69')][_0x84be('0x36')](_0x1631fa[_0x84be('0x7c')](),{'type':db[_0x84be('0x69')][_0x84be('0x7d')][_0x84be('0x7e')]})[_0x84be('0x27')](function(_0x2a1837){if(_0x2a1837[_0x84be('0x3c')]===0x1){return _0x974894['id'];}else{var _0x59245b=_['every'](_[_0x84be('0x2f')](_0x2a1837,_0x84be('0x7f')),function(_0x56656e){return _['includes'](_0x4ca686,_0x56656e);});if(_0x59245b){return _0x974894['id'];}}}));}}return BPromise['all'](_0x105bc5)['then'](function(_0x29ff7c){_0x3f02c9=_(_0x3f02c9)[_0x84be('0x80')](_0x29ff7c)[_0x84be('0x81')]()[_0x84be('0x82')]();return db[_0x84be('0x30')][_0x84be('0x49')]({'where':{'id':_0x12b02e['params']['id']}})[_0x84be('0x27')](function(_0x481cbe){return db['sequelize'][_0x84be('0x6a')](function(_0xfdf1a5){return _0x481cbe[_0x84be('0x70')](_0x12b02e[_0x84be('0x36')][_0x84be('0x83')],{'transaction':_0xfdf1a5})['then'](function(){if(!_[_0x84be('0x84')](_0x3f02c9)){return _0x481cbe['removeAgents'](_0x3f02c9,{'transaction':_0xfdf1a5});}})[_0x84be('0x27')](function(){_0x3f02c9[_0x84be('0x6d')](function(_0x3aff5a){socket[_0x84be('0x6e')](_0x84be('0x85'),{'UserId':_0x3aff5a,'MailQueueId':_0x481cbe['id']});});});});});});})[_0x84be('0x27')](respondWithStatusCode(_0x2651ae,null))[_0x84be('0x4a')](handleError(_0x2651ae,null));};exports[_0x84be('0x86')]=function(_0xd52f31,_0x2ac090,_0x50b25b){return db[_0x84be('0x30')]['find']({'where':{'id':_0xd52f31[_0x84be('0x48')]['id']}})[_0x84be('0x27')](handleEntityNotFound(_0x2ac090,null))[_0x84be('0x27')](function(_0xd94c26){if(_0xd94c26){return _0xd94c26[_0x84be('0x86')](_0xd52f31[_0x84be('0x4c')][_0x84be('0x83')],_['omit'](_0xd52f31[_0x84be('0x4c')],['ids','id'])||{})['spread'](function(_0x72b707){for(var _0x36b29f=0x0;_0x36b29f<_0xd52f31[_0x84be('0x4c')][_0x84be('0x83')][_0x84be('0x3c')];_0x36b29f+=0x1){socket[_0x84be('0x6e')](_0x84be('0x6f'),{'UserId':Number(_0xd52f31[_0x84be('0x4c')][_0x84be('0x83')][_0x36b29f]),'MailQueueId':Number(_0xd52f31['params']['id'])});}return _0x72b707;});}})[_0x84be('0x27')](respondWithResult(_0x2ac090,null))['catch'](handleError(_0x2ac090,null));};exports[_0x84be('0x87')]=function(_0x39f764,_0x1e7391,_0x56b9e6){return db[_0x84be('0x30')][_0x84be('0x49')]({'where':{'id':_0x39f764[_0x84be('0x48')]['id']}})[_0x84be('0x27')](handleEntityNotFound(_0x1e7391,null))[_0x84be('0x27')](function(_0xc312c4){if(_0xc312c4){return _0xc312c4[_0x84be('0x87')](_0x39f764[_0x84be('0x36')][_0x84be('0x83')])[_0x84be('0x27')](function(){if(_[_0x84be('0x88')](_0x39f764[_0x84be('0x36')][_0x84be('0x83')])){for(var _0x4b3576=0x0;_0x4b3576<_0x39f764[_0x84be('0x36')][_0x84be('0x83')][_0x84be('0x3c')];_0x4b3576+=0x1){socket[_0x84be('0x6e')](_0x84be('0x85'),{'UserId':Number(_0x39f764[_0x84be('0x36')][_0x84be('0x83')][_0x4b3576]),'MailQueueId':Number(_0x39f764[_0x84be('0x48')]['id'])});}}else{socket['emit'](_0x84be('0x85'),{'UserId':Number(_0x39f764['query'][_0x84be('0x83')]),'MailQueueId':Number(_0x39f764[_0x84be('0x48')]['id'])});}});}})[_0x84be('0x27')](respondWithStatusCode(_0x1e7391,null))[_0x84be('0x4a')](handleError(_0x1e7391,null));};exports[_0x84be('0x89')]=function(_0x3e08ed,_0x512324,_0x567b42){var _0x4eb12e={};var _0x403f66={};var _0x5328af;var _0xad6b3c;return db[_0x84be('0x30')][_0x84be('0x54')]({'where':{'id':_0x3e08ed[_0x84be('0x48')]['id']}})[_0x84be('0x27')](handleEntityNotFound(_0x512324,null))[_0x84be('0x27')](function(_0x167541){if(_0x167541){_0x5328af=_0x167541;_0x403f66[_0x84be('0x35')]=_[_0x84be('0x37')](db[_0x84be('0x58')][_0x84be('0x31')]);_0x403f66[_0x84be('0x36')]=_[_0x84be('0x37')](_0x3e08ed[_0x84be('0x36')]);_0x403f66[_0x84be('0x38')]=_[_0x84be('0x39')](_0x403f66[_0x84be('0x35')],_0x403f66[_0x84be('0x36')]);_0x4eb12e[_0x84be('0x3a')]=_[_0x84be('0x39')](_0x403f66[_0x84be('0x35')],qs[_0x84be('0x3b')](_0x3e08ed[_0x84be('0x36')][_0x84be('0x3b')]));_0x4eb12e[_0x84be('0x3a')]=_0x4eb12e['attributes'][_0x84be('0x3c')]?_0x4eb12e[_0x84be('0x3a')]:_0x403f66[_0x84be('0x35')];_0x4eb12e[_0x84be('0x55')]=qs['sort'](_0x3e08ed[_0x84be('0x36')]['sort']);_0x4eb12e[_0x84be('0x3e')]=qs[_0x84be('0x38')](_[_0x84be('0x3f')](_0x3e08ed[_0x84be('0x36')],_0x403f66[_0x84be('0x38')]));if(_0x3e08ed[_0x84be('0x36')][_0x84be('0x40')]){_0x4eb12e[_0x84be('0x3e')]=_['merge'](_0x4eb12e[_0x84be('0x3e')],{'$or':_[_0x84be('0x2f')](_0x4eb12e[_0x84be('0x3a')],function(_0x29183f){var _0x46bac0={};_0x46bac0[_0x29183f]={'$like':'%'+_0x3e08ed['query'][_0x84be('0x40')]+'%'};return _0x46bac0;})});}_0x4eb12e=_[_0x84be('0x41')]({},_0x4eb12e,_0x3e08ed['options']);return _0x5328af[_0x84be('0x89')](_0x4eb12e);}})[_0x84be('0x27')](function(_0x182082){if(_0x182082){_0xad6b3c=_0x182082['length'];if(!_0x3e08ed[_0x84be('0x36')][_0x84be('0x63')]('nolimit')){_0x4eb12e['limit']=qs[_0x84be('0x20')](_0x3e08ed[_0x84be('0x36')][_0x84be('0x20')]);_0x4eb12e['offset']=qs[_0x84be('0x1f')](_0x3e08ed[_0x84be('0x36')][_0x84be('0x1f')]);}return _0x5328af[_0x84be('0x89')](_0x4eb12e);}})['then'](function(_0x4bd21b){if(_0x4bd21b){return _0x4bd21b?{'count':_0xad6b3c,'rows':_0x4bd21b}:null;}})[_0x84be('0x27')](respondWithResult(_0x512324,null))[_0x84be('0x4a')](handleError(_0x512324,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 817e5a8..7601954 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 _0x1d85=['emit','hook','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x146a85,_0x529b52){var _0x1b59bf=function(_0x4af0fd){while(--_0x4af0fd){_0x146a85['push'](_0x146a85['shift']());}};_0x1b59bf(++_0x529b52);}(_0x1d85,0x137));var _0x51d8=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1d85[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x51d8('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x51d8('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x51d8('0x2'),'afterDestroy':_0x51d8('0x3')};function emitEvent(_0x268247){return function(_0x4eafff,_0x5b07a2,_0x33706b){MailQueueEvents[_0x51d8('0x4')](_0x268247+':'+_0x4eafff['id'],_0x4eafff);MailQueueEvents['emit'](_0x268247,_0x4eafff);_0x33706b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x51d8('0x5')](e,emitEvent(event));}}module[_0x51d8('0x6')]=MailQueueEvents; \ No newline at end of file +var _0xf032=['events','MailQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x5a446e,_0x1f2886){var _0x2aec65=function(_0x37ad8b){while(--_0x37ad8b){_0x5a446e['push'](_0x5a446e['shift']());}};_0x2aec65(++_0x1f2886);}(_0xf032,0x170));var _0x2f03=function(_0x279a91,_0x2c6dbf){_0x279a91=_0x279a91-0x0;var _0x5c7d99=_0xf032[_0x279a91];return _0x5c7d99;};'use strict';var EventEmitter=require(_0x2f03('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x2f03('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x2f03('0x2')](0x0);var events={'afterCreate':_0x2f03('0x3'),'afterUpdate':_0x2f03('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5eadfd){return function(_0x7b686,_0x59a2c3,_0x1dd434){MailQueueEvents['emit'](_0x5eadfd+':'+_0x7b686['id'],_0x7b686);MailQueueEvents[_0x2f03('0x5')](_0x5eadfd,_0x7b686);_0x1dd434(null);};}for(var e in events){if(events[_0x2f03('0x6')](e)){var event=events[e];MailQueue[_0x2f03('0x7')](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 a453777..1b0672c 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 _0x9a48=['mail_queues','../../config/logger','api','moment','bluebird','./mailQueue.attributes','exports','define'];(function(_0x4fc80b,_0xfe1b3d){var _0x119dba=function(_0x16ed12){while(--_0x16ed12){_0x4fc80b['push'](_0x4fc80b['shift']());}};_0x119dba(++_0xfe1b3d);}(_0x9a48,0x171));var _0x89a4=function(_0x1a077a,_0xe2bb6b){_0x1a077a=_0x1a077a-0x0;var _0x2d6e4c=_0x9a48[_0x1a077a];return _0x2d6e4c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x89a4('0x0'))(_0x89a4('0x1'));var moment=require(_0x89a4('0x2'));var BPromise=require(_0x89a4('0x3'));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(_0x89a4('0x4'));module[_0x89a4('0x5')]=function(_0x59db0a,_0x326970){return _0x59db0a[_0x89a4('0x6')]('MailQueue',attributes,{'tableName':_0x89a4('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2099=['util','../../config/logger','moment','bluebird','path','../../config/environment','./mailQueue.attributes','MailQueue','mail_queues'];(function(_0x5a20f2,_0x15afb0){var _0x54b275=function(_0x3736e4){while(--_0x3736e4){_0x5a20f2['push'](_0x5a20f2['shift']());}};_0x54b275(++_0x15afb0);}(_0x2099,0xf3));var _0x9209=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2099[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x9209('0x0'));var logger=require(_0x9209('0x1'))('api');var moment=require(_0x9209('0x2'));var BPromise=require(_0x9209('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9209('0x4'));var rimraf=require('rimraf');var config=require(_0x9209('0x5'));var attributes=require(_0x9209('0x6'));module['exports']=function(_0xbd943b,_0x69be66){return _0xbd943b['define'](_0x9209('0x7'),attributes,{'tableName':_0x9209('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 f7f40d1..4720d9c 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 _0x6623=['model','ShowMailQueue','MailQueue','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetMailQueue','options','raw','where','attributes','limit','map','include'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x6623,0x189));var _0x3662=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x6623[_0x3e112d];return _0x531c31;};'use strict';var _=require('lodash');var util=require(_0x3662('0x0'));var moment=require(_0x3662('0x1'));var BPromise=require(_0x3662('0x2'));var rs=require(_0x3662('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3662('0x4'));var logger=require(_0x3662('0x5'))(_0x3662('0x6'));var config=require(_0x3662('0x7'));var jayson=require(_0x3662('0x8'));var client=jayson[_0x3662('0x9')][_0x3662('0xa')]({'port':0x232a});config[_0x3662('0xb')]=_[_0x3662('0xc')](config['redis'],{'host':_0x3662('0xd'),'port':0x18eb});var socket=require(_0x3662('0xe'))(new Redis(config[_0x3662('0xb')]));require(_0x3662('0xf'))['register'](socket);function respondWithRpcPromise(_0x1cc373,_0x173701,_0x2350cc){return new BPromise(function(_0x27c807,_0x5455e3){return client[_0x3662('0x10')](_0x1cc373,_0x2350cc)[_0x3662('0x11')](function(_0x12700f){logger[_0x3662('0x12')](_0x3662('0x13'),_0x173701,'request\x20sent');logger[_0x3662('0x14')](_0x3662('0x15'),_0x173701,_0x3662('0x16'),JSON[_0x3662('0x17')](_0x12700f));if(_0x12700f[_0x3662('0x18')]){if(_0x12700f[_0x3662('0x18')][_0x3662('0x19')]===0x1f4){logger[_0x3662('0x18')](_0x3662('0x13'),_0x173701,_0x12700f[_0x3662('0x18')][_0x3662('0x1a')]);return _0x5455e3(_0x12700f['error']['message']);}logger[_0x3662('0x18')]('MailQueue,\x20%s,\x20%s',_0x173701,_0x12700f[_0x3662('0x18')][_0x3662('0x1a')]);return _0x27c807(_0x12700f[_0x3662('0x18')]['message']);}else{logger[_0x3662('0x12')]('MailQueue,\x20%s,\x20%s',_0x173701,_0x3662('0x16'));_0x27c807(_0x12700f['result'][_0x3662('0x1a')]);}})[_0x3662('0x1b')](function(_0x1cd7b6){logger[_0x3662('0x18')](_0x3662('0x13'),_0x173701,_0x1cd7b6);_0x5455e3(_0x1cd7b6);});});}exports[_0x3662('0x1c')]=function(_0x531bb7){var _0x1eac84=this;return new Promise(function(_0x25cd94,_0x43eeb6){return db['MailQueue']['findAll']({'raw':_0x531bb7[_0x3662('0x1d')]?_0x531bb7[_0x3662('0x1d')][_0x3662('0x1e')]===undefined?!![]:![]:!![],'where':_0x531bb7[_0x3662('0x1d')]?_0x531bb7['options'][_0x3662('0x1f')]||null:null,'attributes':_0x531bb7[_0x3662('0x1d')]?_0x531bb7[_0x3662('0x1d')][_0x3662('0x20')]||null:null,'limit':_0x531bb7[_0x3662('0x1d')]?_0x531bb7['options'][_0x3662('0x21')]||null:null,'include':_0x531bb7['options']?_0x531bb7[_0x3662('0x1d')]['include']?_[_0x3662('0x22')](_0x531bb7[_0x3662('0x1d')][_0x3662('0x23')],function(_0x470729){return{'model':db[_0x470729['model']],'as':_0x470729['as'],'attributes':_0x470729[_0x3662('0x20')],'include':_0x470729[_0x3662('0x23')]?_[_0x3662('0x22')](_0x470729[_0x3662('0x23')],function(_0x1e690e){return{'model':db[_0x1e690e[_0x3662('0x24')]],'as':_0x1e690e['as'],'attributes':_0x1e690e[_0x3662('0x20')],'include':_0x1e690e[_0x3662('0x23')]?_[_0x3662('0x22')](_0x1e690e[_0x3662('0x23')],function(_0x5ed766){return{'model':db[_0x5ed766[_0x3662('0x24')]],'as':_0x5ed766['as'],'attributes':_0x5ed766[_0x3662('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15d6d6){logger['info'](_0x3662('0x1c'),_0x531bb7);logger[_0x3662('0x14')]('GetMailQueue',_0x531bb7,JSON[_0x3662('0x17')](_0x15d6d6));_0x25cd94(_0x15d6d6);})['catch'](function(_0x3c7fc7){logger[_0x3662('0x18')](_0x3662('0x1c'),_0x3c7fc7[_0x3662('0x1a')],_0x531bb7);_0x43eeb6(_0x1eac84[_0x3662('0x18')](0x1f4,_0x3c7fc7[_0x3662('0x1a')]));});});};exports[_0x3662('0x25')]=function(_0x59afb3){var _0x36d2eb=this;return new Promise(function(_0x2cb7b4,_0x3af84b){return db[_0x3662('0x26')]['find']({'raw':_0x59afb3[_0x3662('0x1d')]?_0x59afb3[_0x3662('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x59afb3['options']?_0x59afb3[_0x3662('0x1d')][_0x3662('0x1f')]||null:null,'attributes':_0x59afb3[_0x3662('0x1d')]?_0x59afb3[_0x3662('0x1d')]['attributes']||null:null,'include':_0x59afb3[_0x3662('0x1d')]?_0x59afb3[_0x3662('0x1d')][_0x3662('0x23')]?_['map'](_0x59afb3['options']['include'],function(_0x5d627d){return{'model':db[_0x5d627d['model']],'as':_0x5d627d['as'],'attributes':_0x5d627d[_0x3662('0x20')],'include':_0x5d627d['include']?_[_0x3662('0x22')](_0x5d627d['include'],function(_0x270d1a){return{'model':db[_0x270d1a[_0x3662('0x24')]],'as':_0x270d1a['as'],'attributes':_0x270d1a[_0x3662('0x20')],'include':_0x270d1a[_0x3662('0x23')]?_[_0x3662('0x22')](_0x270d1a[_0x3662('0x23')],function(_0x3f76ef){return{'model':db[_0x3f76ef[_0x3662('0x24')]],'as':_0x3f76ef['as'],'attributes':_0x3f76ef[_0x3662('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3662('0x11')](function(_0x45dfd4){logger['info'](_0x3662('0x25'),_0x59afb3);logger['debug'](_0x3662('0x25'),_0x59afb3,JSON[_0x3662('0x17')](_0x45dfd4));_0x2cb7b4(_0x45dfd4);})[_0x3662('0x1b')](function(_0x1b8bcc){logger[_0x3662('0x18')](_0x3662('0x25'),_0x1b8bcc[_0x3662('0x1a')],_0x59afb3);_0x3af84b(_0x36d2eb['error'](0x1f4,_0x1b8bcc[_0x3662('0x1a')]));});});}; \ No newline at end of file +var _0x35f6=['findAll','options','raw','attributes','limit','include','model','map','stringify','ShowMailQueue','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','./mailQueue.socket','register','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','MailQueue'];(function(_0x403504,_0x27b365){var _0x3af19d=function(_0x1d67f7){while(--_0x1d67f7){_0x403504['push'](_0x403504['shift']());}};_0x3af19d(++_0x27b365);}(_0x35f6,0x11c));var _0x635f=function(_0x42efd8,_0x7741b8){_0x42efd8=_0x42efd8-0x0;var _0x1458bc=_0x35f6[_0x42efd8];return _0x1458bc;};'use strict';var _=require('lodash');var util=require(_0x635f('0x0'));var moment=require('moment');var BPromise=require(_0x635f('0x1'));var rs=require(_0x635f('0x2'));var fs=require('fs');var Redis=require(_0x635f('0x3'));var db=require(_0x635f('0x4'))['db'];var utils=require(_0x635f('0x5'));var logger=require('../../config/logger')(_0x635f('0x6'));var config=require(_0x635f('0x7'));var jayson=require(_0x635f('0x8'));var client=jayson['client'][_0x635f('0x9')]({'port':0x232a});config[_0x635f('0xa')]=_['defaults'](config[_0x635f('0xa')],{'host':_0x635f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x635f('0xa')]));require(_0x635f('0xc'))[_0x635f('0xd')](socket);function respondWithRpcPromise(_0x4b9632,_0xd77752,_0x434ac8){return new BPromise(function(_0x5a3096,_0x1d00a8){return client[_0x635f('0xe')](_0x4b9632,_0x434ac8)[_0x635f('0xf')](function(_0x5451a9){logger[_0x635f('0x10')]('MailQueue,\x20%s,\x20%s',_0xd77752,_0x635f('0x11'));logger[_0x635f('0x12')](_0x635f('0x13'),_0xd77752,'request\x20sent',JSON['stringify'](_0x5451a9));if(_0x5451a9[_0x635f('0x14')]){if(_0x5451a9[_0x635f('0x14')][_0x635f('0x15')]===0x1f4){logger[_0x635f('0x14')](_0x635f('0x16'),_0xd77752,_0x5451a9['error'][_0x635f('0x17')]);return _0x1d00a8(_0x5451a9[_0x635f('0x14')][_0x635f('0x17')]);}logger[_0x635f('0x14')](_0x635f('0x16'),_0xd77752,_0x5451a9['error'][_0x635f('0x17')]);return _0x5a3096(_0x5451a9[_0x635f('0x14')][_0x635f('0x17')]);}else{logger[_0x635f('0x10')](_0x635f('0x16'),_0xd77752,_0x635f('0x11'));_0x5a3096(_0x5451a9[_0x635f('0x18')][_0x635f('0x17')]);}})[_0x635f('0x19')](function(_0xd06a4b){logger['error'](_0x635f('0x16'),_0xd77752,_0xd06a4b);_0x1d00a8(_0xd06a4b);});});}exports[_0x635f('0x1a')]=function(_0x2701c2){var _0x2a8528=this;return new Promise(function(_0x84ab31,_0x13f23d){return db[_0x635f('0x1b')][_0x635f('0x1c')]({'raw':_0x2701c2[_0x635f('0x1d')]?_0x2701c2[_0x635f('0x1d')][_0x635f('0x1e')]===undefined?!![]:![]:!![],'where':_0x2701c2[_0x635f('0x1d')]?_0x2701c2['options']['where']||null:null,'attributes':_0x2701c2[_0x635f('0x1d')]?_0x2701c2[_0x635f('0x1d')][_0x635f('0x1f')]||null:null,'limit':_0x2701c2[_0x635f('0x1d')]?_0x2701c2[_0x635f('0x1d')][_0x635f('0x20')]||null:null,'include':_0x2701c2[_0x635f('0x1d')]?_0x2701c2['options'][_0x635f('0x21')]?_['map'](_0x2701c2[_0x635f('0x1d')][_0x635f('0x21')],function(_0x4644de){return{'model':db[_0x4644de[_0x635f('0x22')]],'as':_0x4644de['as'],'attributes':_0x4644de[_0x635f('0x1f')],'include':_0x4644de[_0x635f('0x21')]?_[_0x635f('0x23')](_0x4644de[_0x635f('0x21')],function(_0x2a5e6e){return{'model':db[_0x2a5e6e['model']],'as':_0x2a5e6e['as'],'attributes':_0x2a5e6e[_0x635f('0x1f')],'include':_0x2a5e6e[_0x635f('0x21')]?_[_0x635f('0x23')](_0x2a5e6e[_0x635f('0x21')],function(_0x3a2da5){return{'model':db[_0x3a2da5[_0x635f('0x22')]],'as':_0x3a2da5['as'],'attributes':_0x3a2da5[_0x635f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x635f('0xf')](function(_0x37ddd9){logger['info'](_0x635f('0x1a'),_0x2701c2);logger[_0x635f('0x12')](_0x635f('0x1a'),_0x2701c2,JSON[_0x635f('0x24')](_0x37ddd9));_0x84ab31(_0x37ddd9);})[_0x635f('0x19')](function(_0x2f6fb7){logger[_0x635f('0x14')](_0x635f('0x1a'),_0x2f6fb7['message'],_0x2701c2);_0x13f23d(_0x2a8528['error'](0x1f4,_0x2f6fb7[_0x635f('0x17')]));});});};exports[_0x635f('0x25')]=function(_0x14ce30){var _0x1e4812=this;return new Promise(function(_0x3dc0ec,_0x2a519c){return db[_0x635f('0x1b')][_0x635f('0x26')]({'raw':_0x14ce30[_0x635f('0x1d')]?_0x14ce30[_0x635f('0x1d')][_0x635f('0x1e')]===undefined?!![]:![]:!![],'where':_0x14ce30[_0x635f('0x1d')]?_0x14ce30[_0x635f('0x1d')]['where']||null:null,'attributes':_0x14ce30[_0x635f('0x1d')]?_0x14ce30[_0x635f('0x1d')]['attributes']||null:null,'include':_0x14ce30[_0x635f('0x1d')]?_0x14ce30[_0x635f('0x1d')]['include']?_['map'](_0x14ce30['options'][_0x635f('0x21')],function(_0x1b9b74){return{'model':db[_0x1b9b74[_0x635f('0x22')]],'as':_0x1b9b74['as'],'attributes':_0x1b9b74[_0x635f('0x1f')],'include':_0x1b9b74[_0x635f('0x21')]?_[_0x635f('0x23')](_0x1b9b74[_0x635f('0x21')],function(_0x2b6c31){return{'model':db[_0x2b6c31[_0x635f('0x22')]],'as':_0x2b6c31['as'],'attributes':_0x2b6c31['attributes'],'include':_0x2b6c31[_0x635f('0x21')]?_[_0x635f('0x23')](_0x2b6c31[_0x635f('0x21')],function(_0x23ec2e){return{'model':db[_0x23ec2e[_0x635f('0x22')]],'as':_0x23ec2e['as'],'attributes':_0x23ec2e[_0x635f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x635f('0xf')](function(_0xcfe0f5){logger[_0x635f('0x10')](_0x635f('0x25'),_0x14ce30);logger[_0x635f('0x12')](_0x635f('0x25'),_0x14ce30,JSON[_0x635f('0x24')](_0xcfe0f5));_0x3dc0ec(_0xcfe0f5);})[_0x635f('0x19')](function(_0x40e4fa){logger['error'](_0x635f('0x25'),_0x40e4fa['message'],_0x14ce30);_0x2a519c(_0x1e4812[_0x635f('0x14')](0x1f4,_0x40e4fa[_0x635f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index bd5c309..737ebf6 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 _0x0c71=['update','removeListener','register','length','mailQueue:','save'];(function(_0x46a40f,_0x2765a8){var _0x4b15e4=function(_0x5cc296){while(--_0x5cc296){_0x46a40f['push'](_0x46a40f['shift']());}};_0x4b15e4(++_0x2765a8);}(_0x0c71,0xfb));var _0x10c7=function(_0x2e9c72,_0x59d245){_0x2e9c72=_0x2e9c72-0x0;var _0x63b4ba=_0x0c71[_0x2e9c72];return _0x63b4ba;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x10c7('0x0'),'remove',_0x10c7('0x1')];function createListener(_0xac267a,_0x1dfbb9){return function(_0x4858c1){_0x1dfbb9['emit'](_0xac267a,_0x4858c1);};}function removeListener(_0xa72176,_0x57f92f){return function(){MailQueueEvents[_0x10c7('0x2')](_0xa72176,_0x57f92f);};}exports[_0x10c7('0x3')]=function(_0x21da60){for(var _0x4480c2=0x0,_0x2dbe32=events[_0x10c7('0x4')];_0x4480c2<_0x2dbe32;_0x4480c2++){var _0x4d8fc8=events[_0x4480c2];var _0x3cbcd7=createListener(_0x10c7('0x5')+_0x4d8fc8,_0x21da60);MailQueueEvents['on'](_0x4d8fc8,_0x3cbcd7);}}; \ No newline at end of file +var _0xb612=['register','length','mailQueue:','save','remove','update','emit'];(function(_0x4d89fd,_0x411fe1){var _0x3262a6=function(_0x2c7505){while(--_0x2c7505){_0x4d89fd['push'](_0x4d89fd['shift']());}};_0x3262a6(++_0x411fe1);}(_0xb612,0x1a7));var _0x2b61=function(_0x3ab287,_0x5103b8){_0x3ab287=_0x3ab287-0x0;var _0x38a448=_0xb612[_0x3ab287];return _0x38a448;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x2b61('0x0'),_0x2b61('0x1'),_0x2b61('0x2')];function createListener(_0x2c9ee2,_0xbbd54c){return function(_0x2e0538){_0xbbd54c[_0x2b61('0x3')](_0x2c9ee2,_0x2e0538);};}function removeListener(_0x20c393,_0x224572){return function(){MailQueueEvents['removeListener'](_0x20c393,_0x224572);};}exports[_0x2b61('0x4')]=function(_0x57cb4b){for(var _0x10c376=0x0,_0x422f67=events[_0x2b61('0x5')];_0x10c376<_0x422f67;_0x10c376++){var _0x237851=events[_0x10c376];var _0x83542f=createListener(_0x2b61('0x6')+_0x237851,_0x57cb4b);MailQueueEvents['on'](_0x237851,_0x83542f);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index e8d9b65..e2e66b3 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 _0x0d2c=['describe','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0d2c,0xaf));var _0xc0d2=function(_0x34179d,_0x2ac36f){_0x34179d=_0x34179d-0x0;var _0x186bf5=_0x0d2c[_0x34179d];return _0x186bf5;};'use strict';var multer=require(_0xc0d2('0x0'));var util=require(_0xc0d2('0x1'));var path=require(_0xc0d2('0x2'));var timeout=require(_0xc0d2('0x3'));var express=require(_0xc0d2('0x4'));var router=express['Router']();var fs_extra=require(_0xc0d2('0x5'));var auth=require(_0xc0d2('0x6'));var interaction=require(_0xc0d2('0x7'));var config=require(_0xc0d2('0x8'));var controller=require(_0xc0d2('0x9'));router[_0xc0d2('0xa')]('/',auth[_0xc0d2('0xb')](),controller[_0xc0d2('0xc')]);router[_0xc0d2('0xa')](_0xc0d2('0xd'),auth['isAuthenticated'](),controller[_0xc0d2('0xe')]);router[_0xc0d2('0xa')]('/:id',auth[_0xc0d2('0xb')](),controller['show']);router[_0xc0d2('0xf')]('/',auth[_0xc0d2('0xb')](),controller[_0xc0d2('0x10')]);router[_0xc0d2('0x11')](_0xc0d2('0x12'),auth[_0xc0d2('0xb')](),controller['update']);router[_0xc0d2('0x13')](_0xc0d2('0x12'),auth['isAuthenticated'](),controller[_0xc0d2('0x14')]);module['exports']=router; \ No newline at end of file +var _0x9c3f=['post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0xfde41b,_0x3b91f8){var _0x536f19=function(_0xbbb57d){while(--_0xbbb57d){_0xfde41b['push'](_0xfde41b['shift']());}};_0x536f19(++_0x3b91f8);}(_0x9c3f,0x15a));var _0xf9c3=function(_0x38832a,_0x3c3603){_0x38832a=_0x38832a-0x0;var _0x12bde6=_0x9c3f[_0x38832a];return _0x12bde6;};'use strict';var multer=require(_0xf9c3('0x0'));var util=require('util');var path=require(_0xf9c3('0x1'));var timeout=require('connect-timeout');var express=require(_0xf9c3('0x2'));var router=express[_0xf9c3('0x3')]();var fs_extra=require(_0xf9c3('0x4'));var auth=require(_0xf9c3('0x5'));var interaction=require(_0xf9c3('0x6'));var config=require('../../config/environment');var controller=require(_0xf9c3('0x7'));router[_0xf9c3('0x8')]('/',auth[_0xf9c3('0x9')](),controller[_0xf9c3('0xa')]);router[_0xf9c3('0x8')]('/describe',auth[_0xf9c3('0x9')](),controller[_0xf9c3('0xb')]);router[_0xf9c3('0x8')](_0xf9c3('0xc'),auth['isAuthenticated'](),controller[_0xf9c3('0xd')]);router[_0xf9c3('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf9c3('0xf')]('/:id',auth[_0xf9c3('0x9')](),controller[_0xf9c3('0x10')]);router[_0xf9c3('0x11')](_0xf9c3('0xc'),auth[_0xf9c3('0x9')](),controller[_0xf9c3('0x12')]);module[_0xf9c3('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 c7f9619..429cfa6 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 _0x8981=['exports','STRING','DATE','moment','sequelize'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8981,0x76));var _0x1898=function(_0x1b1cc7,_0x29e88d){_0x1b1cc7=_0x1b1cc7-0x0;var _0x2329a9=_0x8981[_0x1b1cc7];return _0x2329a9;};'use strict';var moment=require(_0x1898('0x0'));var Sequelize=require(_0x1898('0x1'));module[_0x1898('0x2')]={'uniqueid':{'type':Sequelize[_0x1898('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1898('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1898('0x4')]},'acceptAt':{'type':Sequelize[_0x1898('0x4')]},'exitAt':{'type':Sequelize[_0x1898('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcdd0=['STRING','DATE','moment','sequelize','exports'];(function(_0x5aeec6,_0x25a36e){var _0x1affe9=function(_0x3a152c){while(--_0x3a152c){_0x5aeec6['push'](_0x5aeec6['shift']());}};_0x1affe9(++_0x25a36e);}(_0xcdd0,0xd9));var _0x0cdd=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xcdd0[_0x521929];return _0x632436;};'use strict';var moment=require(_0x0cdd('0x0'));var Sequelize=require(_0x0cdd('0x1'));module[_0x0cdd('0x2')]={'uniqueid':{'type':Sequelize[_0x0cdd('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0cdd('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0cdd('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 220cb46..ad1ca2d 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 _0x4991=['hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','MailQueueReport','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x2b67f2,_0x2aa834){var _0x34ddcc=function(_0x24b326){while(--_0x24b326){_0x2b67f2['push'](_0x2b67f2['shift']());}};_0x34ddcc(++_0x2aa834);}(_0x4991,0xf7));var _0x1499=function(_0x36e6ad,_0x1d75e0){_0x36e6ad=_0x36e6ad-0x0;var _0x5b6fc7=_0x4991[_0x36e6ad];return _0x5b6fc7;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3039ce,_0x274bc1){_0x274bc1=_0x274bc1||0xcc;return function(_0x34a928){if(_0x34a928){return _0x3039ce[_0x1499('0x17')](_0x274bc1);}return _0x3039ce[_0x1499('0x18')](_0x274bc1)['end']();};}function respondWithResult(_0x5f34f2,_0x308177){_0x308177=_0x308177||0xc8;return function(_0x4e5195){if(_0x4e5195){return _0x5f34f2[_0x1499('0x18')](_0x308177)[_0x1499('0x19')](_0x4e5195);}};}function respondWithFilteredResult(_0x308318,_0x3ab605){return function(_0x48f654){if(_0x48f654){var _0x1ed43b=typeof _0x3ab605[_0x1499('0x1a')]==='undefined'&&typeof _0x3ab605[_0x1499('0x1b')]===_0x1499('0x1c');var _0x46b364=_0x48f654[_0x1499('0x1d')];var _0x1e45a9=_0x1ed43b?0x0:_0x3ab605[_0x1499('0x1a')];var _0x5b9859=_0x1ed43b?_0x48f654['count']:_0x3ab605['offset']+_0x3ab605[_0x1499('0x1b')];var _0xad534b;if(_0x5b9859>=_0x46b364){_0x5b9859=_0x46b364;_0xad534b=0xc8;}else{_0xad534b=0xce;}_0x308318['status'](_0xad534b);return _0x308318[_0x1499('0x1e')](_0x1499('0x1f'),_0x1e45a9+'-'+_0x5b9859+'/'+_0x46b364)[_0x1499('0x19')](_0x48f654);}return null;};}function patchUpdates(_0x18e4a6){return function(_0x21e887){try{jsonpatch[_0x1499('0x20')](_0x21e887,_0x18e4a6,!![]);}catch(_0x2b0458){return BPromise[_0x1499('0x21')](_0x2b0458);}return _0x21e887[_0x1499('0x22')]();};}function saveUpdates(_0x15bcd4,_0x2bb71f){return function(_0x836081){if(_0x836081){return _0x836081[_0x1499('0x23')](_0x15bcd4)[_0x1499('0x24')](function(_0x4ec57a){return _0x4ec57a;});}return null;};}function removeEntity(_0x1e2c51,_0x2c7f57){return function(_0x5615b4){if(_0x5615b4){return _0x5615b4[_0x1499('0x25')]()[_0x1499('0x24')](function(){_0x1e2c51[_0x1499('0x18')](0xcc)[_0x1499('0x26')]();});}};}function handleEntityNotFound(_0x3968e0,_0x16d036){return function(_0x54f3c2){if(!_0x54f3c2){_0x3968e0['sendStatus'](0x194);}return _0x54f3c2;};}function handleError(_0x12739b,_0x3c9aca){_0x3c9aca=_0x3c9aca||0x1f4;return function(_0x3b9259){logger[_0x1499('0x27')](_0x3b9259[_0x1499('0x28')]);if(_0x3b9259['name']){delete _0x3b9259[_0x1499('0x29')];}_0x12739b['status'](_0x3c9aca)['send'](_0x3b9259);};}exports['index']=function(_0x21d204,_0x103efa){var _0x40932a={},_0x1b460b={},_0x3dad86={'count':0x0,'rows':[]};var _0x388513=_[_0x1499('0x2a')](db['MailQueueReport'][_0x1499('0x2b')],function(_0x1a2c99){return{'name':_0x1a2c99[_0x1499('0x2c')],'type':_0x1a2c99['type'][_0x1499('0x2d')]};});_0x1b460b[_0x1499('0x2e')]=_['map'](_0x388513,_0x1499('0x29'));_0x1b460b[_0x1499('0x2f')]=_['keys'](_0x21d204[_0x1499('0x2f')]);_0x1b460b[_0x1499('0x30')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],_0x1b460b[_0x1499('0x2f')]);_0x40932a[_0x1499('0x32')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x21d204[_0x1499('0x2f')][_0x1499('0x33')]));_0x40932a[_0x1499('0x32')]=_0x40932a[_0x1499('0x32')][_0x1499('0x34')]?_0x40932a[_0x1499('0x32')]:_0x1b460b[_0x1499('0x2e')];if(!_0x21d204[_0x1499('0x2f')][_0x1499('0x35')](_0x1499('0x36'))){_0x40932a[_0x1499('0x1b')]=qs['limit'](_0x21d204[_0x1499('0x2f')][_0x1499('0x1b')]);_0x40932a[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x21d204[_0x1499('0x2f')][_0x1499('0x1a')]);}_0x40932a[_0x1499('0x37')]=qs[_0x1499('0x38')](_0x21d204[_0x1499('0x2f')][_0x1499('0x38')]);_0x40932a[_0x1499('0x39')]=qs['filters'](_['pick'](_0x21d204[_0x1499('0x2f')],_0x1b460b['filters']),_0x388513);if(_0x21d204[_0x1499('0x2f')]['filter']){_0x40932a[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x40932a[_0x1499('0x39')],{'$or':_[_0x1499('0x2a')](_0x388513,function(_0x531933){if(_0x531933[_0x1499('0x3b')]!=='VIRTUAL'){var _0x2f9c59={};_0x2f9c59[_0x531933[_0x1499('0x29')]]={'$like':'%'+_0x21d204[_0x1499('0x2f')][_0x1499('0x3c')]+'%'};return _0x2f9c59;}})});}_0x40932a=_['merge']({},_0x40932a,_0x21d204[_0x1499('0x3d')]);var _0x815a99={'where':_0x40932a[_0x1499('0x39')]};return db[_0x1499('0x3e')]['count'](_0x815a99)[_0x1499('0x24')](function(_0x4cc411){_0x3dad86[_0x1499('0x1d')]=_0x4cc411;if(_0x21d204[_0x1499('0x2f')][_0x1499('0x3f')]){_0x40932a[_0x1499('0x40')]=[{'all':!![]}];}return db[_0x1499('0x3e')][_0x1499('0x41')](_0x40932a);})[_0x1499('0x24')](function(_0xcb85eb){_0x3dad86[_0x1499('0x42')]=_0xcb85eb;return _0x3dad86;})[_0x1499('0x24')](respondWithFilteredResult(_0x103efa,_0x40932a))['catch'](handleError(_0x103efa,null));};exports[_0x1499('0x43')]=function(_0x5dd36c,_0x2cfdaf){var _0x1af1a1={'raw':!![],'where':{'id':_0x5dd36c[_0x1499('0x44')]['id']}},_0x5646cf={};_0x5646cf[_0x1499('0x2e')]=_[_0x1499('0x45')](db[_0x1499('0x3e')][_0x1499('0x2b')]);_0x5646cf['query']=_['keys'](_0x5dd36c[_0x1499('0x2f')]);_0x5646cf[_0x1499('0x30')]=_['intersection'](_0x5646cf[_0x1499('0x2e')],_0x5646cf[_0x1499('0x2f')]);_0x1af1a1['attributes']=_['intersection'](_0x5646cf[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x5dd36c[_0x1499('0x2f')]['fields']));_0x1af1a1[_0x1499('0x32')]=_0x1af1a1[_0x1499('0x32')][_0x1499('0x34')]?_0x1af1a1[_0x1499('0x32')]:_0x5646cf['model'];if(_0x5dd36c[_0x1499('0x2f')][_0x1499('0x3f')]){_0x1af1a1[_0x1499('0x40')]=[{'all':!![]}];}_0x1af1a1=_[_0x1499('0x3a')]({},_0x1af1a1,_0x5dd36c['options']);return db[_0x1499('0x3e')][_0x1499('0x46')](_0x1af1a1)[_0x1499('0x24')](handleEntityNotFound(_0x2cfdaf,null))['then'](respondWithResult(_0x2cfdaf,null))['catch'](handleError(_0x2cfdaf,null));};exports[_0x1499('0x47')]=function(_0x491777,_0x7fa101){return db[_0x1499('0x3e')][_0x1499('0x47')](_0x491777[_0x1499('0x48')],{})[_0x1499('0x24')](respondWithResult(_0x7fa101,0xc9))[_0x1499('0x49')](handleError(_0x7fa101,null));};exports[_0x1499('0x23')]=function(_0x591aa8,_0x420d16){if(_0x591aa8['body']['id']){delete _0x591aa8[_0x1499('0x48')]['id'];}return db[_0x1499('0x3e')]['find']({'where':{'id':_0x591aa8[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x420d16,null))[_0x1499('0x24')](saveUpdates(_0x591aa8['body'],null))[_0x1499('0x24')](respondWithResult(_0x420d16,null))[_0x1499('0x49')](handleError(_0x420d16,null));};exports[_0x1499('0x25')]=function(_0x29ac0f,_0x305599){return db[_0x1499('0x3e')][_0x1499('0x46')]({'where':{'id':_0x29ac0f[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x305599,null))[_0x1499('0x24')](removeEntity(_0x305599,null))['catch'](handleError(_0x305599,null));};exports[_0x1499('0x4a')]=function(_0x9f0520,_0x278178){return db['MailQueueReport'][_0x1499('0x4a')]()[_0x1499('0x24')](respondWithResult(_0x278178,null))['catch'](handleError(_0x278178,null));}; \ No newline at end of file +var _0xa46e=['body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','set','Content-Range','reject','update','then','destroy','stack','name','send','index','map','MailQueueReport','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create'];(function(_0x162ade,_0x3d460b){var _0x56030b=function(_0x4d7d04){while(--_0x4d7d04){_0x162ade['push'](_0x162ade['shift']());}};_0x56030b(++_0x3d460b);}(_0xa46e,0x8a));var _0xea46=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0xa46e[_0x503950];return _0x1657a9;};'use strict';var emlformat=require(_0xea46('0x0'));var rimraf=require(_0xea46('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea46('0x2'));var rp=require(_0xea46('0x3'));var moment=require(_0xea46('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xea46('0x5'));var util=require('util');var path=require(_0xea46('0x6'));var sox=require('sox');var csv=require(_0xea46('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea46('0x8'));var _=require(_0xea46('0x9'));var squel=require('squel');var crypto=require(_0xea46('0xa'));var jsforce=require(_0xea46('0xb'));var deskjs=require(_0xea46('0xc'));var toCsv=require(_0xea46('0x7'));var querystring=require(_0xea46('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xea46('0xe'));var as=require(_0xea46('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea46('0x10'))(_0xea46('0x11'));var utils=require(_0xea46('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xea46('0x13'));var db=require(_0xea46('0x14'))['db'];function respondWithStatusCode(_0x4e10f3,_0x13390c){_0x13390c=_0x13390c||0xcc;return function(_0x1a4fe2){if(_0x1a4fe2){return _0x4e10f3['sendStatus'](_0x13390c);}return _0x4e10f3[_0xea46('0x15')](_0x13390c)['end']();};}function respondWithResult(_0x3024af,_0x42c328){_0x42c328=_0x42c328||0xc8;return function(_0x6c4bc4){if(_0x6c4bc4){return _0x3024af[_0xea46('0x15')](_0x42c328)[_0xea46('0x16')](_0x6c4bc4);}};}function respondWithFilteredResult(_0x2ef436,_0x81ee45){return function(_0x20a79c){if(_0x20a79c){var _0x176ad2=typeof _0x81ee45['offset']===_0xea46('0x17')&&typeof _0x81ee45[_0xea46('0x18')]===_0xea46('0x17');var _0x59f28e=_0x20a79c['count'];var _0x19d5c1=_0x176ad2?0x0:_0x81ee45[_0xea46('0x19')];var _0x5cf5dd=_0x176ad2?_0x20a79c['count']:_0x81ee45[_0xea46('0x19')]+_0x81ee45[_0xea46('0x18')];var _0x4ff93d;if(_0x5cf5dd>=_0x59f28e){_0x5cf5dd=_0x59f28e;_0x4ff93d=0xc8;}else{_0x4ff93d=0xce;}_0x2ef436[_0xea46('0x15')](_0x4ff93d);return _0x2ef436[_0xea46('0x1a')](_0xea46('0x1b'),_0x19d5c1+'-'+_0x5cf5dd+'/'+_0x59f28e)[_0xea46('0x16')](_0x20a79c);}return null;};}function patchUpdates(_0x53b8db){return function(_0x2b6491){try{jsonpatch['apply'](_0x2b6491,_0x53b8db,!![]);}catch(_0x515e32){return BPromise[_0xea46('0x1c')](_0x515e32);}return _0x2b6491['save']();};}function saveUpdates(_0x4cc673,_0x5064d8){return function(_0x3b25fe){if(_0x3b25fe){return _0x3b25fe[_0xea46('0x1d')](_0x4cc673)[_0xea46('0x1e')](function(_0x5beb44){return _0x5beb44;});}return null;};}function removeEntity(_0x16f8fa,_0x59b10d){return function(_0x12e688){if(_0x12e688){return _0x12e688[_0xea46('0x1f')]()['then'](function(){_0x16f8fa[_0xea46('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b3a8f,_0x114bf9){return function(_0xd4cf78){if(!_0xd4cf78){_0x2b3a8f['sendStatus'](0x194);}return _0xd4cf78;};}function handleError(_0x5d2de1,_0x44e797){_0x44e797=_0x44e797||0x1f4;return function(_0x38ac07){logger['error'](_0x38ac07[_0xea46('0x20')]);if(_0x38ac07['name']){delete _0x38ac07[_0xea46('0x21')];}_0x5d2de1['status'](_0x44e797)[_0xea46('0x22')](_0x38ac07);};}exports[_0xea46('0x23')]=function(_0x6710ae,_0x44517d){var _0x146995={},_0x174345={},_0x4a5149={'count':0x0,'rows':[]};var _0x382bbc=_[_0xea46('0x24')](db[_0xea46('0x25')]['rawAttributes'],function(_0x3e7856){return{'name':_0x3e7856[_0xea46('0x26')],'type':_0x3e7856[_0xea46('0x27')]['key']};});_0x174345['model']=_['map'](_0x382bbc,_0xea46('0x21'));_0x174345[_0xea46('0x28')]=_[_0xea46('0x29')](_0x6710ae[_0xea46('0x28')]);_0x174345[_0xea46('0x2a')]=_[_0xea46('0x2b')](_0x174345[_0xea46('0x2c')],_0x174345[_0xea46('0x28')]);_0x146995[_0xea46('0x2d')]=_[_0xea46('0x2b')](_0x174345[_0xea46('0x2c')],qs['fields'](_0x6710ae[_0xea46('0x28')][_0xea46('0x2e')]));_0x146995[_0xea46('0x2d')]=_0x146995[_0xea46('0x2d')][_0xea46('0x2f')]?_0x146995[_0xea46('0x2d')]:_0x174345[_0xea46('0x2c')];if(!_0x6710ae['query'][_0xea46('0x30')](_0xea46('0x31'))){_0x146995[_0xea46('0x18')]=qs[_0xea46('0x18')](_0x6710ae[_0xea46('0x28')]['limit']);_0x146995['offset']=qs[_0xea46('0x19')](_0x6710ae[_0xea46('0x28')]['offset']);}_0x146995[_0xea46('0x32')]=qs[_0xea46('0x33')](_0x6710ae[_0xea46('0x28')][_0xea46('0x33')]);_0x146995['where']=qs['filters'](_[_0xea46('0x34')](_0x6710ae['query'],_0x174345[_0xea46('0x2a')]),_0x382bbc);if(_0x6710ae[_0xea46('0x28')]['filter']){_0x146995[_0xea46('0x35')]=_[_0xea46('0x36')](_0x146995['where'],{'$or':_[_0xea46('0x24')](_0x382bbc,function(_0xefad3e){if(_0xefad3e['type']!==_0xea46('0x37')){var _0x41e9e8={};_0x41e9e8[_0xefad3e[_0xea46('0x21')]]={'$like':'%'+_0x6710ae[_0xea46('0x28')]['filter']+'%'};return _0x41e9e8;}})});}_0x146995=_[_0xea46('0x36')]({},_0x146995,_0x6710ae[_0xea46('0x38')]);var _0x338c2d={'where':_0x146995[_0xea46('0x35')]};return db[_0xea46('0x25')]['count'](_0x338c2d)[_0xea46('0x1e')](function(_0xdb2e11){_0x4a5149['count']=_0xdb2e11;if(_0x6710ae[_0xea46('0x28')][_0xea46('0x39')]){_0x146995[_0xea46('0x3a')]=[{'all':!![]}];}return db[_0xea46('0x25')]['findAll'](_0x146995);})[_0xea46('0x1e')](function(_0x1cc8f8){_0x4a5149[_0xea46('0x3b')]=_0x1cc8f8;return _0x4a5149;})['then'](respondWithFilteredResult(_0x44517d,_0x146995))[_0xea46('0x3c')](handleError(_0x44517d,null));};exports[_0xea46('0x3d')]=function(_0x2c9491,_0x32c81c){var _0x3164c5={'raw':!![],'where':{'id':_0x2c9491[_0xea46('0x3e')]['id']}},_0xc45d74={};_0xc45d74[_0xea46('0x2c')]=_[_0xea46('0x29')](db[_0xea46('0x25')][_0xea46('0x3f')]);_0xc45d74[_0xea46('0x28')]=_[_0xea46('0x29')](_0x2c9491[_0xea46('0x28')]);_0xc45d74[_0xea46('0x2a')]=_['intersection'](_0xc45d74['model'],_0xc45d74[_0xea46('0x28')]);_0x3164c5[_0xea46('0x2d')]=_[_0xea46('0x2b')](_0xc45d74[_0xea46('0x2c')],qs['fields'](_0x2c9491['query']['fields']));_0x3164c5[_0xea46('0x2d')]=_0x3164c5[_0xea46('0x2d')]['length']?_0x3164c5[_0xea46('0x2d')]:_0xc45d74[_0xea46('0x2c')];if(_0x2c9491[_0xea46('0x28')][_0xea46('0x39')]){_0x3164c5[_0xea46('0x3a')]=[{'all':!![]}];}_0x3164c5=_['merge']({},_0x3164c5,_0x2c9491[_0xea46('0x38')]);return db['MailQueueReport'][_0xea46('0x40')](_0x3164c5)[_0xea46('0x1e')](handleEntityNotFound(_0x32c81c,null))[_0xea46('0x1e')](respondWithResult(_0x32c81c,null))[_0xea46('0x3c')](handleError(_0x32c81c,null));};exports[_0xea46('0x41')]=function(_0x1260d1,_0x36f697){return db['MailQueueReport'][_0xea46('0x41')](_0x1260d1[_0xea46('0x42')],{})['then'](respondWithResult(_0x36f697,0xc9))[_0xea46('0x3c')](handleError(_0x36f697,null));};exports[_0xea46('0x1d')]=function(_0x24d929,_0x548572){if(_0x24d929['body']['id']){delete _0x24d929[_0xea46('0x42')]['id'];}return db[_0xea46('0x25')][_0xea46('0x40')]({'where':{'id':_0x24d929[_0xea46('0x3e')]['id']}})[_0xea46('0x1e')](handleEntityNotFound(_0x548572,null))[_0xea46('0x1e')](saveUpdates(_0x24d929[_0xea46('0x42')],null))[_0xea46('0x1e')](respondWithResult(_0x548572,null))[_0xea46('0x3c')](handleError(_0x548572,null));};exports[_0xea46('0x1f')]=function(_0x48ad1c,_0x2144a0){return db['MailQueueReport'][_0xea46('0x40')]({'where':{'id':_0x48ad1c[_0xea46('0x3e')]['id']}})[_0xea46('0x1e')](handleEntityNotFound(_0x2144a0,null))['then'](removeEntity(_0x2144a0,null))[_0xea46('0x3c')](handleError(_0x2144a0,null));};exports[_0xea46('0x43')]=function(_0x334937,_0x2f49c8){return db['MailQueueReport']['describe']()[_0xea46('0x1e')](respondWithResult(_0x2f49c8,null))[_0xea46('0x3c')](handleError(_0x2f49c8,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index b72ef05..938de89 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 _0x40bf=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','report_mail_queue','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0x40bf,0x1a6));var _0xf40b=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x40bf[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0xf40b('0x0'));var util=require(_0xf40b('0x1'));var logger=require(_0xf40b('0x2'))(_0xf40b('0x3'));var moment=require(_0xf40b('0x4'));var BPromise=require('bluebird');var rp=require(_0xf40b('0x5'));var fs=require('fs');var path=require(_0xf40b('0x6'));var rimraf=require(_0xf40b('0x7'));var config=require(_0xf40b('0x8'));var attributes=require(_0xf40b('0x9'));module[_0xf40b('0xa')]=function(_0xb285bb,_0x4067dd){return _0xb285bb[_0xf40b('0xb')]('MailQueueReport',attributes,{'tableName':_0xf40b('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1a7f=['moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','report_mail_queue','uniqueid','lodash','../../config/logger','api'];(function(_0x3759c4,_0x25968e){var _0x33695e=function(_0x1fed8e){while(--_0x1fed8e){_0x3759c4['push'](_0x3759c4['shift']());}};_0x33695e(++_0x25968e);}(_0x1a7f,0xb1));var _0xf1a7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x1a7f[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xf1a7('0x0'));var util=require('util');var logger=require(_0xf1a7('0x1'))(_0xf1a7('0x2'));var moment=require(_0xf1a7('0x3'));var BPromise=require(_0xf1a7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1a7('0x5'));var rimraf=require(_0xf1a7('0x6'));var config=require(_0xf1a7('0x7'));var attributes=require(_0xf1a7('0x8'));module[_0xf1a7('0x9')]=function(_0x38142c,_0x306aea){return _0x38142c['define']('MailQueueReport',attributes,{'tableName':_0xf1a7('0xa'),'paranoid':![],'indexes':[{'name':_0xf1a7('0xb'),'fields':[_0xf1a7('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 7303ea5..82176ee 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 _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3c7aeb,_0x1c2e25){var _0x3d0e7e=function(_0x43c028){while(--_0x43c028){_0x3c7aeb['push'](_0x3c7aeb['shift']());}};_0x3d0e7e(++_0x1c2e25);}(_0xadb5,0xad));var _0x5adb=function(_0x4d52d2,_0x463ded){_0x4d52d2=_0x4d52d2-0x0;var _0x4951f6=_0xadb5[_0x4d52d2];return _0x4951f6;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2da2fd,_0x41363e){var _0x26660d=function(_0x5898a6){while(--_0x5898a6){_0x2da2fd['push'](_0x2da2fd['shift']());}};_0x26660d(++_0x41363e);}(_0x326f,0xd1));var _0xf326=function(_0x4a2fd9,_0x39a04d){_0x4a2fd9=_0x4a2fd9-0x0;var _0x5450a7=_0x326f[_0x4a2fd9];return _0x5450a7;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 87cd490..692f406 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x20c11f,_0x2fb373){var _0x28fa49=function(_0x54f672){while(--_0x54f672){_0x20c11f['push'](_0x20c11f['shift']());}};_0x28fa49(++_0x2fb373);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x422be2,_0x1c439e){_0x422be2=_0x422be2-0x0;var _0x1b820e=_0xcb91[_0x422be2];return _0x1b820e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x914a10,_0x24862c){var _0x3583b9=function(_0x17782e){while(--_0x17782e){_0x914a10['push'](_0x914a10['shift']());}};_0x3583b9(++_0x24862c);}(_0xe706,0xa3));var _0x6e70=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xe706[_0x31cb5f];return _0x586042;};'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 9c6b397..3fa2712 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 _0x2499=['exports','BOOLEAN','STRING','INTEGER'];(function(_0xcd4eba,_0x21022f){var _0xb5a205=function(_0x261211){while(--_0x261211){_0xcd4eba['push'](_0xcd4eba['shift']());}};_0xb5a205(++_0x21022f);}(_0x2499,0xa4));var _0x9249=function(_0x127ba1,_0x572c82){_0x127ba1=_0x127ba1-0x0;var _0x5da4bd=_0x2499[_0x127ba1];return _0x5da4bd;};'use strict';var Sequelize=require('sequelize');module[_0x9249('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x9249('0x1')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x9249('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x9249('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9249('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x9249('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9249('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x9249('0x2')]},'modernAuthentication':{'type':Sequelize[_0x9249('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x53aa=['STRING','BOOLEAN','INTEGER','INBOX','exports'];(function(_0x5444b0,_0x430ca7){var _0x58b58d=function(_0xf9b027){while(--_0xf9b027){_0x5444b0['push'](_0x5444b0['shift']());}};_0x58b58d(++_0x430ca7);}(_0x53aa,0x1ee));var _0xa53a=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x53aa[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require('sequelize');module[_0xa53a('0x0')]={'description':{'type':Sequelize[_0xa53a('0x1')]},'host':{'type':Sequelize[_0xa53a('0x1')]},'authentication':{'type':Sequelize[_0xa53a('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xa53a('0x1')]},'password':{'type':Sequelize[_0xa53a('0x1')]},'port':{'type':Sequelize[_0xa53a('0x3')]},'tls':{'type':Sequelize[_0xa53a('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xa53a('0x1')],'defaultValue':_0xa53a('0x4')},'connTimeout':{'type':Sequelize[_0xa53a('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xa53a('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xa53a('0x1')]},'modernAuthentication':{'type':Sequelize[_0xa53a('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index e5b42e6..21595dd 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 _0xd373=['exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0x4cd690,_0x4797cc){var _0x4a74a9=function(_0x4cbbc5){while(--_0x4cbbc5){_0x4cd690['push'](_0x4cd690['shift']());}};_0x4a74a9(++_0x4797cc);}(_0xd373,0x1d2));var _0x3d37=function(_0x6a5db8,_0x189d5e){_0x6a5db8=_0x6a5db8-0x0;var _0x32d157=_0xd373[_0x6a5db8];return _0x32d157;};'use strict';var _=require(_0x3d37('0x0'));var util=require(_0x3d37('0x1'));var logger=require(_0x3d37('0x2'))(_0x3d37('0x3'));var moment=require(_0x3d37('0x4'));var BPromise=require('bluebird');var rp=require(_0x3d37('0x5'));var fs=require('fs');var path=require(_0x3d37('0x6'));var rimraf=require(_0x3d37('0x7'));var config=require(_0x3d37('0x8'));var attributes=require(_0x3d37('0x9'));module[_0x3d37('0xa')]=function(_0x5a33e7,_0x4156ac){return _0x5a33e7[_0x3d37('0xb')](_0x3d37('0xc'),attributes,{'tableName':_0x3d37('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6433=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./mailServerIn.attributes','mail_servers_in','util'];(function(_0x4b8156,_0x437af2){var _0x4a819c=function(_0xe21347){while(--_0xe21347){_0x4b8156['push'](_0x4b8156['shift']());}};_0x4a819c(++_0x437af2);}(_0x6433,0x143));var _0x3643=function(_0x45ea5f,_0x2d8b5f){_0x45ea5f=_0x45ea5f-0x0;var _0x35852e=_0x6433[_0x45ea5f];return _0x35852e;};'use strict';var _=require('lodash');var util=require(_0x3643('0x0'));var logger=require(_0x3643('0x1'))('api');var moment=require(_0x3643('0x2'));var BPromise=require(_0x3643('0x3'));var rp=require(_0x3643('0x4'));var fs=require('fs');var path=require(_0x3643('0x5'));var rimraf=require(_0x3643('0x6'));var config=require('../../config/environment');var attributes=require(_0x3643('0x7'));module['exports']=function(_0x215c28,_0x3d1ed5){return _0x215c28['define']('MailServerIn',attributes,{'tableName':_0x3643('0x8'),'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 2cb4822..ff03dc7 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 _0xfe17=['catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','limit','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailServerIn,\x20%s,\x20%s','message','result'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xfe17,0x147));var _0x7fe1=function(_0x139dfe,_0x1927a1){_0x139dfe=_0x139dfe-0x0;var _0x3af649=_0xfe17[_0x139dfe];return _0x3af649;};'use strict';var _=require(_0x7fe1('0x0'));var util=require(_0x7fe1('0x1'));var moment=require(_0x7fe1('0x2'));var BPromise=require(_0x7fe1('0x3'));var rs=require(_0x7fe1('0x4'));var fs=require('fs');var Redis=require(_0x7fe1('0x5'));var db=require(_0x7fe1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7fe1('0x7'))(_0x7fe1('0x8'));var config=require(_0x7fe1('0x9'));var jayson=require(_0x7fe1('0xa'));var client=jayson[_0x7fe1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b9be3,_0x2328d1,_0x163940){return new BPromise(function(_0x37b6a0,_0x856a9a){return client[_0x7fe1('0xc')](_0x2b9be3,_0x163940)[_0x7fe1('0xd')](function(_0x112e3e){logger[_0x7fe1('0xe')]('MailServerIn,\x20%s,\x20%s',_0x2328d1,'request\x20sent');logger[_0x7fe1('0xf')](_0x7fe1('0x10'),_0x2328d1,_0x7fe1('0x11'),JSON[_0x7fe1('0x12')](_0x112e3e));if(_0x112e3e[_0x7fe1('0x13')]){if(_0x112e3e[_0x7fe1('0x13')]['code']===0x1f4){logger[_0x7fe1('0x13')](_0x7fe1('0x14'),_0x2328d1,_0x112e3e[_0x7fe1('0x13')][_0x7fe1('0x15')]);return _0x856a9a(_0x112e3e['error']['message']);}logger[_0x7fe1('0x13')]('MailServerIn,\x20%s,\x20%s',_0x2328d1,_0x112e3e['error']['message']);return _0x37b6a0(_0x112e3e['error'][_0x7fe1('0x15')]);}else{logger['info'](_0x7fe1('0x14'),_0x2328d1,_0x7fe1('0x11'));_0x37b6a0(_0x112e3e[_0x7fe1('0x16')][_0x7fe1('0x15')]);}})[_0x7fe1('0x17')](function(_0x241029){logger[_0x7fe1('0x13')](_0x7fe1('0x14'),_0x2328d1,_0x241029);_0x856a9a(_0x241029);});});}exports[_0x7fe1('0x18')]=function(_0x344842){var _0x1296ff=this;return new Promise(function(_0x5d941b,_0x3a63d7){return db[_0x7fe1('0x19')][_0x7fe1('0x1a')]({'raw':_0x344842[_0x7fe1('0x1b')]?_0x344842[_0x7fe1('0x1b')][_0x7fe1('0x1c')]===undefined?!![]:![]:!![],'where':_0x344842[_0x7fe1('0x1b')]?_0x344842[_0x7fe1('0x1b')][_0x7fe1('0x1d')]||null:null,'attributes':_0x344842[_0x7fe1('0x1b')]?_0x344842[_0x7fe1('0x1b')]['attributes']||null:null,'limit':_0x344842[_0x7fe1('0x1b')]?_0x344842[_0x7fe1('0x1b')][_0x7fe1('0x1e')]||null:null,'include':_0x344842[_0x7fe1('0x1b')]?_0x344842[_0x7fe1('0x1b')][_0x7fe1('0x1f')]?_[_0x7fe1('0x20')](_0x344842[_0x7fe1('0x1b')][_0x7fe1('0x1f')],function(_0x4814cb){return{'model':db[_0x4814cb[_0x7fe1('0x21')]],'as':_0x4814cb['as'],'attributes':_0x4814cb[_0x7fe1('0x22')],'include':_0x4814cb[_0x7fe1('0x1f')]?_['map'](_0x4814cb[_0x7fe1('0x1f')],function(_0x25920d){return{'model':db[_0x25920d[_0x7fe1('0x21')]],'as':_0x25920d['as'],'attributes':_0x25920d[_0x7fe1('0x22')],'include':_0x25920d[_0x7fe1('0x1f')]?_[_0x7fe1('0x20')](_0x25920d[_0x7fe1('0x1f')],function(_0x311c88){return{'model':db[_0x311c88[_0x7fe1('0x21')]],'as':_0x311c88['as'],'attributes':_0x311c88[_0x7fe1('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7fe1('0xd')](function(_0x18e726){logger['info']('GetMailServerIn',_0x344842);logger[_0x7fe1('0xf')]('GetMailServerIn',_0x344842,JSON[_0x7fe1('0x12')](_0x18e726));_0x5d941b(_0x18e726);})[_0x7fe1('0x17')](function(_0x599b02){logger[_0x7fe1('0x13')](_0x7fe1('0x18'),_0x599b02[_0x7fe1('0x15')],_0x344842);_0x3a63d7(_0x1296ff[_0x7fe1('0x13')](0x1f4,_0x599b02[_0x7fe1('0x15')]));});});}; \ No newline at end of file +var _0xcbdd=['MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetMailServerIn','MailServerIn','findAll','raw','options','where','attributes','map','include','model','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info'];(function(_0x41473a,_0x3db164){var _0x5a3cc3=function(_0x500032){while(--_0x500032){_0x41473a['push'](_0x41473a['shift']());}};_0x5a3cc3(++_0x3db164);}(_0xcbdd,0xec));var _0xdcbd=function(_0x2bfbff,_0x1919a4){_0x2bfbff=_0x2bfbff-0x0;var _0x12a505=_0xcbdd[_0x2bfbff];return _0x12a505;};'use strict';var _=require(_0xdcbd('0x0'));var util=require('util');var moment=require(_0xdcbd('0x1'));var BPromise=require(_0xdcbd('0x2'));var rs=require(_0xdcbd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcbd('0x4'))['db'];var utils=require(_0xdcbd('0x5'));var logger=require(_0xdcbd('0x6'))('rpc');var config=require(_0xdcbd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdcbd('0x8')][_0xdcbd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3787ba,_0x17926d,_0x368f8e){return new BPromise(function(_0x3dcc40,_0x852ee2){return client[_0xdcbd('0xa')](_0x3787ba,_0x368f8e)['then'](function(_0x5ded4a){logger[_0xdcbd('0xb')](_0xdcbd('0xc'),_0x17926d,_0xdcbd('0xd'));logger[_0xdcbd('0xe')](_0xdcbd('0xf'),_0x17926d,_0xdcbd('0xd'),JSON[_0xdcbd('0x10')](_0x5ded4a));if(_0x5ded4a[_0xdcbd('0x11')]){if(_0x5ded4a[_0xdcbd('0x11')][_0xdcbd('0x12')]===0x1f4){logger[_0xdcbd('0x11')](_0xdcbd('0xc'),_0x17926d,_0x5ded4a[_0xdcbd('0x11')][_0xdcbd('0x13')]);return _0x852ee2(_0x5ded4a[_0xdcbd('0x11')][_0xdcbd('0x13')]);}logger[_0xdcbd('0x11')](_0xdcbd('0xc'),_0x17926d,_0x5ded4a[_0xdcbd('0x11')]['message']);return _0x3dcc40(_0x5ded4a[_0xdcbd('0x11')][_0xdcbd('0x13')]);}else{logger[_0xdcbd('0xb')](_0xdcbd('0xc'),_0x17926d,_0xdcbd('0xd'));_0x3dcc40(_0x5ded4a['result'][_0xdcbd('0x13')]);}})['catch'](function(_0x2ab84c){logger['error'](_0xdcbd('0xc'),_0x17926d,_0x2ab84c);_0x852ee2(_0x2ab84c);});});}exports[_0xdcbd('0x14')]=function(_0x4c3de0){var _0x3da27a=this;return new Promise(function(_0x5a9624,_0x1fd296){return db[_0xdcbd('0x15')][_0xdcbd('0x16')]({'raw':_0x4c3de0['options']?_0x4c3de0['options'][_0xdcbd('0x17')]===undefined?!![]:![]:!![],'where':_0x4c3de0[_0xdcbd('0x18')]?_0x4c3de0[_0xdcbd('0x18')][_0xdcbd('0x19')]||null:null,'attributes':_0x4c3de0['options']?_0x4c3de0['options'][_0xdcbd('0x1a')]||null:null,'limit':_0x4c3de0[_0xdcbd('0x18')]?_0x4c3de0['options']['limit']||null:null,'include':_0x4c3de0[_0xdcbd('0x18')]?_0x4c3de0[_0xdcbd('0x18')]['include']?_[_0xdcbd('0x1b')](_0x4c3de0[_0xdcbd('0x18')][_0xdcbd('0x1c')],function(_0x9cfbe0){return{'model':db[_0x9cfbe0[_0xdcbd('0x1d')]],'as':_0x9cfbe0['as'],'attributes':_0x9cfbe0[_0xdcbd('0x1a')],'include':_0x9cfbe0['include']?_[_0xdcbd('0x1b')](_0x9cfbe0[_0xdcbd('0x1c')],function(_0x503294){return{'model':db[_0x503294[_0xdcbd('0x1d')]],'as':_0x503294['as'],'attributes':_0x503294['attributes'],'include':_0x503294[_0xdcbd('0x1c')]?_[_0xdcbd('0x1b')](_0x503294[_0xdcbd('0x1c')],function(_0x3ac9f4){return{'model':db[_0x3ac9f4[_0xdcbd('0x1d')]],'as':_0x3ac9f4['as'],'attributes':_0x3ac9f4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x55950b){logger[_0xdcbd('0xb')]('GetMailServerIn',_0x4c3de0);logger[_0xdcbd('0xe')](_0xdcbd('0x14'),_0x4c3de0,JSON[_0xdcbd('0x10')](_0x55950b));_0x5a9624(_0x55950b);})[_0xdcbd('0x1e')](function(_0x493311){logger[_0xdcbd('0x11')](_0xdcbd('0x14'),_0x493311[_0xdcbd('0x13')],_0x4c3de0);_0x1fd296(_0x3da27a[_0xdcbd('0x11')](0x1f4,_0x493311[_0xdcbd('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 65d86ae..af2b6ac 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(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x7a54,0x106));var _0x47a5=function(_0x2572da,_0x6041bf){_0x2572da=_0x2572da-0x0;var _0x2a9d5a=_0x7a54[_0x2572da];return _0x2a9d5a;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 2ea2a0d..d90813a 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 _0xd914=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x5d5141,_0x3abcb1){var _0x402273=function(_0x4aa5a5){while(--_0x4aa5a5){_0x5d5141['push'](_0x5d5141['shift']());}};_0x402273(++_0x3abcb1);}(_0xd914,0x17f));var _0x4d91=function(_0x5caf7e,_0x52e1bc){_0x5caf7e=_0x5caf7e-0x0;var _0x5c3435=_0xd914[_0x5caf7e];return _0x5c3435;};'use strict';var Sequelize=require(_0x4d91('0x0'));module[_0x4d91('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x4d91('0x2')]},'user':{'type':Sequelize[_0x4d91('0x2')]},'pass':{'type':Sequelize[_0x4d91('0x2')]},'port':{'type':Sequelize[_0x4d91('0x3')]},'secure':{'type':Sequelize[_0x4d91('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x4d91('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x4d91('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xe511=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x3b45d7,_0xbc2848){var _0x4690e8=function(_0x209c3b){while(--_0x209c3b){_0x3b45d7['push'](_0x3b45d7['shift']());}};_0x4690e8(++_0xbc2848);}(_0xe511,0x16f));var _0x1e51=function(_0xbf722c,_0x48d1da){_0xbf722c=_0xbf722c-0x0;var _0x3cec15=_0xe511[_0xbf722c];return _0x3cec15;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x1e51('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x1e51('0x2')]},'port':{'type':Sequelize[_0x1e51('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x1e51('0x2')]},'authentication':{'type':Sequelize[_0x1e51('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x1e51('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 cd118c9..bbf0c96 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 _0x98d1=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','MailServerOut','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','include','show','params','includeAll','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x94b068,_0x25c928){var _0x433b44=function(_0x21006e){while(--_0x21006e){_0x94b068['push'](_0x94b068['shift']());}};_0x433b44(++_0x25c928);}(_0x98d1,0x1f4));var _0x198d=function(_0x3f5fbb,_0x507080){_0x3f5fbb=_0x3f5fbb-0x0;var _0x22545e=_0x98d1[_0x3f5fbb];return _0x22545e;};'use strict';var emlformat=require(_0x198d('0x0'));var rimraf=require(_0x198d('0x1'));var zipdir=require(_0x198d('0x2'));var jsonpatch=require(_0x198d('0x3'));var rp=require(_0x198d('0x4'));var moment=require(_0x198d('0x5'));var BPromise=require(_0x198d('0x6'));var Mustache=require(_0x198d('0x7'));var util=require(_0x198d('0x8'));var path=require(_0x198d('0x9'));var sox=require(_0x198d('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x198d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x198d('0xc'));var deskjs=require(_0x198d('0xd'));var toCsv=require(_0x198d('0xe'));var querystring=require(_0x198d('0xf'));var Papa=require(_0x198d('0x10'));var Redis=require('ioredis');var authService=require(_0x198d('0x11'));var qs=require(_0x198d('0x12'));var as=require(_0x198d('0x13'));var hardwareService=require(_0x198d('0x14'));var logger=require(_0x198d('0x15'))(_0x198d('0x16'));var utils=require(_0x198d('0x17'));var config=require(_0x198d('0x18'));var licenseUtil=require(_0x198d('0x19'));var db=require(_0x198d('0x1a'))['db'];function respondWithStatusCode(_0xb30948,_0x4de88d){_0x4de88d=_0x4de88d||0xcc;return function(_0x379029){if(_0x379029){return _0xb30948[_0x198d('0x1b')](_0x4de88d);}return _0xb30948['status'](_0x4de88d)[_0x198d('0x1c')]();};}function respondWithResult(_0x5b4f84,_0x4c884c){_0x4c884c=_0x4c884c||0xc8;return function(_0x266262){if(_0x266262){return _0x5b4f84[_0x198d('0x1d')](_0x4c884c)[_0x198d('0x1e')](_0x266262);}};}function respondWithFilteredResult(_0x447492,_0x3f16a5){return function(_0x36b5ae){if(_0x36b5ae){var _0x4a2cb4=typeof _0x3f16a5['offset']===_0x198d('0x1f')&&typeof _0x3f16a5[_0x198d('0x20')]===_0x198d('0x1f');var _0x23bf5c=_0x36b5ae['count'];var _0x483e32=_0x4a2cb4?0x0:_0x3f16a5[_0x198d('0x21')];var _0x332e93=_0x4a2cb4?_0x36b5ae[_0x198d('0x22')]:_0x3f16a5[_0x198d('0x21')]+_0x3f16a5[_0x198d('0x20')];var _0x349ddb;if(_0x332e93>=_0x23bf5c){_0x332e93=_0x23bf5c;_0x349ddb=0xc8;}else{_0x349ddb=0xce;}_0x447492[_0x198d('0x1d')](_0x349ddb);return _0x447492[_0x198d('0x23')](_0x198d('0x24'),_0x483e32+'-'+_0x332e93+'/'+_0x23bf5c)[_0x198d('0x1e')](_0x36b5ae);}return null;};}function patchUpdates(_0x1a1de9){return function(_0x4165bd){try{jsonpatch[_0x198d('0x25')](_0x4165bd,_0x1a1de9,!![]);}catch(_0x3cdb6e){return BPromise['reject'](_0x3cdb6e);}return _0x4165bd[_0x198d('0x26')]();};}function saveUpdates(_0x386ddd,_0x1a42d4){return function(_0x20043f){if(_0x20043f){return _0x20043f[_0x198d('0x27')](_0x386ddd)[_0x198d('0x28')](function(_0x2be863){return _0x2be863;});}return null;};}function removeEntity(_0xd3872c,_0x420501){return function(_0x259e79){if(_0x259e79){return _0x259e79[_0x198d('0x29')]()['then'](function(){_0xd3872c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46dbc2,_0x4878e5){return function(_0x4b35dc){if(!_0x4b35dc){_0x46dbc2[_0x198d('0x1b')](0x194);}return _0x4b35dc;};}function handleError(_0x386eb7,_0x390d57){_0x390d57=_0x390d57||0x1f4;return function(_0x48c9bd){logger[_0x198d('0x2a')](_0x48c9bd[_0x198d('0x2b')]);if(_0x48c9bd[_0x198d('0x2c')]){delete _0x48c9bd['name'];}_0x386eb7[_0x198d('0x1d')](_0x390d57)['send'](_0x48c9bd);};}exports[_0x198d('0x2d')]=function(_0x281cdd,_0x50eaaf){var _0x352068={},_0xf26caa={},_0x2a5828={'count':0x0,'rows':[]};var _0x29801f=_[_0x198d('0x2e')](db[_0x198d('0x2f')][_0x198d('0x30')],function(_0x331e05){return{'name':_0x331e05[_0x198d('0x31')],'type':_0x331e05['type'][_0x198d('0x32')]};});_0xf26caa[_0x198d('0x33')]=_['map'](_0x29801f,'name');_0xf26caa[_0x198d('0x34')]=_[_0x198d('0x35')](_0x281cdd['query']);_0xf26caa[_0x198d('0x36')]=_[_0x198d('0x37')](_0xf26caa[_0x198d('0x33')],_0xf26caa[_0x198d('0x34')]);_0x352068['attributes']=_[_0x198d('0x37')](_0xf26caa[_0x198d('0x33')],qs['fields'](_0x281cdd[_0x198d('0x34')][_0x198d('0x38')]));_0x352068[_0x198d('0x39')]=_0x352068[_0x198d('0x39')][_0x198d('0x3a')]?_0x352068[_0x198d('0x39')]:_0xf26caa[_0x198d('0x33')];if(!_0x281cdd[_0x198d('0x34')]['hasOwnProperty'](_0x198d('0x3b'))){_0x352068[_0x198d('0x20')]=qs[_0x198d('0x20')](_0x281cdd[_0x198d('0x34')][_0x198d('0x20')]);_0x352068['offset']=qs[_0x198d('0x21')](_0x281cdd[_0x198d('0x34')]['offset']);}_0x352068[_0x198d('0x3c')]=qs[_0x198d('0x3d')](_0x281cdd[_0x198d('0x34')]['sort']);_0x352068[_0x198d('0x3e')]=qs['filters'](_['pick'](_0x281cdd[_0x198d('0x34')],_0xf26caa[_0x198d('0x36')]),_0x29801f);if(_0x281cdd[_0x198d('0x34')][_0x198d('0x3f')]){_0x352068['where']=_[_0x198d('0x40')](_0x352068[_0x198d('0x3e')],{'$or':_['map'](_0x29801f,function(_0x3e5705){if(_0x3e5705[_0x198d('0x41')]!==_0x198d('0x42')){var _0x28b216={};_0x28b216[_0x3e5705[_0x198d('0x2c')]]={'$like':'%'+_0x281cdd[_0x198d('0x34')][_0x198d('0x3f')]+'%'};return _0x28b216;}})});}_0x352068=_[_0x198d('0x40')]({},_0x352068,_0x281cdd['options']);var _0xa4782e={'where':_0x352068[_0x198d('0x3e')]};return db[_0x198d('0x2f')]['count'](_0xa4782e)[_0x198d('0x28')](function(_0x2d4c37){_0x2a5828[_0x198d('0x22')]=_0x2d4c37;if(_0x281cdd[_0x198d('0x34')]['includeAll']){_0x352068[_0x198d('0x43')]=[{'all':!![]}];}return db[_0x198d('0x2f')]['findAll'](_0x352068);})[_0x198d('0x28')](function(_0x5aa3ba){_0x2a5828['rows']=_0x5aa3ba;return _0x2a5828;})[_0x198d('0x28')](respondWithFilteredResult(_0x50eaaf,_0x352068))['catch'](handleError(_0x50eaaf,null));};exports[_0x198d('0x44')]=function(_0x33dfc2,_0x23a8a2){var _0x28205e={'raw':!![],'where':{'id':_0x33dfc2[_0x198d('0x45')]['id']}},_0x3d09ec={};_0x3d09ec[_0x198d('0x33')]=_['keys'](db[_0x198d('0x2f')]['rawAttributes']);_0x3d09ec['query']=_[_0x198d('0x35')](_0x33dfc2[_0x198d('0x34')]);_0x3d09ec[_0x198d('0x36')]=_['intersection'](_0x3d09ec[_0x198d('0x33')],_0x3d09ec[_0x198d('0x34')]);_0x28205e[_0x198d('0x39')]=_['intersection'](_0x3d09ec[_0x198d('0x33')],qs[_0x198d('0x38')](_0x33dfc2[_0x198d('0x34')][_0x198d('0x38')]));_0x28205e[_0x198d('0x39')]=_0x28205e['attributes'][_0x198d('0x3a')]?_0x28205e[_0x198d('0x39')]:_0x3d09ec[_0x198d('0x33')];if(_0x33dfc2[_0x198d('0x34')][_0x198d('0x46')]){_0x28205e[_0x198d('0x43')]=[{'all':!![]}];}_0x28205e=_[_0x198d('0x40')]({},_0x28205e,_0x33dfc2[_0x198d('0x47')]);return db[_0x198d('0x2f')][_0x198d('0x48')](_0x28205e)[_0x198d('0x28')](handleEntityNotFound(_0x23a8a2,null))['then'](respondWithResult(_0x23a8a2,null))[_0x198d('0x49')](handleError(_0x23a8a2,null));};exports['create']=function(_0x34db99,_0x502a82){return db[_0x198d('0x2f')]['create'](_0x34db99[_0x198d('0x4a')],{})[_0x198d('0x28')](respondWithResult(_0x502a82,0xc9))[_0x198d('0x49')](handleError(_0x502a82,null));};exports['update']=function(_0x55b807,_0xcbfc0b){if(_0x55b807[_0x198d('0x4a')]['id']){delete _0x55b807[_0x198d('0x4a')]['id'];}return db[_0x198d('0x2f')][_0x198d('0x48')]({'where':{'id':_0x55b807[_0x198d('0x45')]['id']}})['then'](handleEntityNotFound(_0xcbfc0b,null))['then'](saveUpdates(_0x55b807[_0x198d('0x4a')],null))[_0x198d('0x28')](respondWithResult(_0xcbfc0b,null))[_0x198d('0x49')](handleError(_0xcbfc0b,null));};exports[_0x198d('0x29')]=function(_0x2f56ce,_0x157658){return db[_0x198d('0x2f')][_0x198d('0x48')]({'where':{'id':_0x2f56ce[_0x198d('0x45')]['id']}})[_0x198d('0x28')](handleEntityNotFound(_0x157658,null))['then'](removeEntity(_0x157658,null))[_0x198d('0x49')](handleError(_0x157658,null));}; \ No newline at end of file +var _0xe59d=['pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','merge','find','create','body','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','end','sendStatus','error','stack','send','index','MailServerOut','fieldName','type','key','map','name','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4a1622,_0x243d82){var _0x4e46f8=function(_0x253de2){while(--_0x253de2){_0x4a1622['push'](_0x4a1622['shift']());}};_0x4e46f8(++_0x243d82);}(_0xe59d,0xf9));var _0xde59=function(_0x3bb947,_0x34b6f3){_0x3bb947=_0x3bb947-0x0;var _0x122b67=_0xe59d[_0x3bb947];return _0x122b67;};'use strict';var emlformat=require(_0xde59('0x0'));var rimraf=require(_0xde59('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde59('0x2'));var rp=require(_0xde59('0x3'));var moment=require(_0xde59('0x4'));var BPromise=require(_0xde59('0x5'));var Mustache=require('mustache');var util=require(_0xde59('0x6'));var path=require(_0xde59('0x7'));var sox=require(_0xde59('0x8'));var csv=require(_0xde59('0x9'));var ejs=require(_0xde59('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde59('0xb'));var squel=require('squel');var crypto=require(_0xde59('0xc'));var jsforce=require(_0xde59('0xd'));var deskjs=require(_0xde59('0xe'));var toCsv=require('to-csv');var querystring=require(_0xde59('0xf'));var Papa=require(_0xde59('0x10'));var Redis=require(_0xde59('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xde59('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xde59('0x13'));var utils=require(_0xde59('0x14'));var config=require(_0xde59('0x15'));var licenseUtil=require(_0xde59('0x16'));var db=require(_0xde59('0x17'))['db'];function respondWithStatusCode(_0x1f0f63,_0x204e32){_0x204e32=_0x204e32||0xcc;return function(_0x3851c1){if(_0x3851c1){return _0x1f0f63['sendStatus'](_0x204e32);}return _0x1f0f63[_0xde59('0x18')](_0x204e32)['end']();};}function respondWithResult(_0x412399,_0x1d5d36){_0x1d5d36=_0x1d5d36||0xc8;return function(_0x22f0c1){if(_0x22f0c1){return _0x412399['status'](_0x1d5d36)[_0xde59('0x19')](_0x22f0c1);}};}function respondWithFilteredResult(_0x12b0a8,_0x3e27d5){return function(_0x3cc7cd){if(_0x3cc7cd){var _0x3ad91d=typeof _0x3e27d5[_0xde59('0x1a')]===_0xde59('0x1b')&&typeof _0x3e27d5[_0xde59('0x1c')]===_0xde59('0x1b');var _0x321116=_0x3cc7cd[_0xde59('0x1d')];var _0x3cf54f=_0x3ad91d?0x0:_0x3e27d5[_0xde59('0x1a')];var _0x46bc25=_0x3ad91d?_0x3cc7cd[_0xde59('0x1d')]:_0x3e27d5['offset']+_0x3e27d5[_0xde59('0x1c')];var _0x3604e2;if(_0x46bc25>=_0x321116){_0x46bc25=_0x321116;_0x3604e2=0xc8;}else{_0x3604e2=0xce;}_0x12b0a8[_0xde59('0x18')](_0x3604e2);return _0x12b0a8[_0xde59('0x1e')](_0xde59('0x1f'),_0x3cf54f+'-'+_0x46bc25+'/'+_0x321116)[_0xde59('0x19')](_0x3cc7cd);}return null;};}function patchUpdates(_0x4ae0b0){return function(_0x2f3198){try{jsonpatch['apply'](_0x2f3198,_0x4ae0b0,!![]);}catch(_0xd86cb7){return BPromise[_0xde59('0x20')](_0xd86cb7);}return _0x2f3198['save']();};}function saveUpdates(_0x23ef11,_0x2600ee){return function(_0x314231){if(_0x314231){return _0x314231[_0xde59('0x21')](_0x23ef11)['then'](function(_0x321c62){return _0x321c62;});}return null;};}function removeEntity(_0x211cca,_0x2b64fb){return function(_0x43615e){if(_0x43615e){return _0x43615e['destroy']()[_0xde59('0x22')](function(){_0x211cca[_0xde59('0x18')](0xcc)[_0xde59('0x23')]();});}};}function handleEntityNotFound(_0x304b86,_0x1a7394){return function(_0x2ff020){if(!_0x2ff020){_0x304b86[_0xde59('0x24')](0x194);}return _0x2ff020;};}function handleError(_0x138c47,_0x42b8d1){_0x42b8d1=_0x42b8d1||0x1f4;return function(_0x2049d7){logger[_0xde59('0x25')](_0x2049d7[_0xde59('0x26')]);if(_0x2049d7['name']){delete _0x2049d7['name'];}_0x138c47[_0xde59('0x18')](_0x42b8d1)[_0xde59('0x27')](_0x2049d7);};}exports[_0xde59('0x28')]=function(_0x3bd27d,_0x2837d8){var _0x427e2e={},_0x1096c1={},_0x104122={'count':0x0,'rows':[]};var _0x20f79d=_['map'](db[_0xde59('0x29')]['rawAttributes'],function(_0xc8cb09){return{'name':_0xc8cb09[_0xde59('0x2a')],'type':_0xc8cb09[_0xde59('0x2b')][_0xde59('0x2c')]};});_0x1096c1['model']=_[_0xde59('0x2d')](_0x20f79d,_0xde59('0x2e'));_0x1096c1[_0xde59('0x2f')]=_[_0xde59('0x30')](_0x3bd27d[_0xde59('0x2f')]);_0x1096c1[_0xde59('0x31')]=_[_0xde59('0x32')](_0x1096c1[_0xde59('0x33')],_0x1096c1[_0xde59('0x2f')]);_0x427e2e['attributes']=_[_0xde59('0x32')](_0x1096c1['model'],qs['fields'](_0x3bd27d[_0xde59('0x2f')][_0xde59('0x34')]));_0x427e2e[_0xde59('0x35')]=_0x427e2e[_0xde59('0x35')]['length']?_0x427e2e[_0xde59('0x35')]:_0x1096c1['model'];if(!_0x3bd27d[_0xde59('0x2f')][_0xde59('0x36')](_0xde59('0x37'))){_0x427e2e[_0xde59('0x1c')]=qs['limit'](_0x3bd27d[_0xde59('0x2f')][_0xde59('0x1c')]);_0x427e2e[_0xde59('0x1a')]=qs[_0xde59('0x1a')](_0x3bd27d['query'][_0xde59('0x1a')]);}_0x427e2e[_0xde59('0x38')]=qs[_0xde59('0x39')](_0x3bd27d['query'][_0xde59('0x39')]);_0x427e2e[_0xde59('0x3a')]=qs[_0xde59('0x31')](_[_0xde59('0x3b')](_0x3bd27d[_0xde59('0x2f')],_0x1096c1['filters']),_0x20f79d);if(_0x3bd27d[_0xde59('0x2f')]['filter']){_0x427e2e[_0xde59('0x3a')]=_['merge'](_0x427e2e['where'],{'$or':_[_0xde59('0x2d')](_0x20f79d,function(_0x46c724){if(_0x46c724['type']!==_0xde59('0x3c')){var _0x41698b={};_0x41698b[_0x46c724[_0xde59('0x2e')]]={'$like':'%'+_0x3bd27d[_0xde59('0x2f')][_0xde59('0x3d')]+'%'};return _0x41698b;}})});}_0x427e2e=_['merge']({},_0x427e2e,_0x3bd27d[_0xde59('0x3e')]);var _0x3cb2ca={'where':_0x427e2e[_0xde59('0x3a')]};return db['MailServerOut'][_0xde59('0x1d')](_0x3cb2ca)[_0xde59('0x22')](function(_0x4385dd){_0x104122[_0xde59('0x1d')]=_0x4385dd;if(_0x3bd27d[_0xde59('0x2f')][_0xde59('0x3f')]){_0x427e2e[_0xde59('0x40')]=[{'all':!![]}];}return db[_0xde59('0x29')][_0xde59('0x41')](_0x427e2e);})[_0xde59('0x22')](function(_0x59827e){_0x104122[_0xde59('0x42')]=_0x59827e;return _0x104122;})[_0xde59('0x22')](respondWithFilteredResult(_0x2837d8,_0x427e2e))[_0xde59('0x43')](handleError(_0x2837d8,null));};exports[_0xde59('0x44')]=function(_0x55242e,_0x4c23c8){var _0x350822={'raw':!![],'where':{'id':_0x55242e['params']['id']}},_0x315f00={};_0x315f00[_0xde59('0x33')]=_[_0xde59('0x30')](db[_0xde59('0x29')][_0xde59('0x45')]);_0x315f00[_0xde59('0x2f')]=_[_0xde59('0x30')](_0x55242e[_0xde59('0x2f')]);_0x315f00[_0xde59('0x31')]=_[_0xde59('0x32')](_0x315f00['model'],_0x315f00[_0xde59('0x2f')]);_0x350822[_0xde59('0x35')]=_[_0xde59('0x32')](_0x315f00[_0xde59('0x33')],qs[_0xde59('0x34')](_0x55242e['query']['fields']));_0x350822['attributes']=_0x350822[_0xde59('0x35')][_0xde59('0x46')]?_0x350822[_0xde59('0x35')]:_0x315f00[_0xde59('0x33')];if(_0x55242e[_0xde59('0x2f')][_0xde59('0x3f')]){_0x350822[_0xde59('0x40')]=[{'all':!![]}];}_0x350822=_[_0xde59('0x47')]({},_0x350822,_0x55242e[_0xde59('0x3e')]);return db[_0xde59('0x29')][_0xde59('0x48')](_0x350822)['then'](handleEntityNotFound(_0x4c23c8,null))[_0xde59('0x22')](respondWithResult(_0x4c23c8,null))['catch'](handleError(_0x4c23c8,null));};exports['create']=function(_0x5964b5,_0x3d95b5){return db[_0xde59('0x29')][_0xde59('0x49')](_0x5964b5[_0xde59('0x4a')],{})[_0xde59('0x22')](respondWithResult(_0x3d95b5,0xc9))['catch'](handleError(_0x3d95b5,null));};exports[_0xde59('0x21')]=function(_0x5dd0f9,_0x488e92){if(_0x5dd0f9[_0xde59('0x4a')]['id']){delete _0x5dd0f9['body']['id'];}return db[_0xde59('0x29')][_0xde59('0x48')]({'where':{'id':_0x5dd0f9[_0xde59('0x4b')]['id']}})[_0xde59('0x22')](handleEntityNotFound(_0x488e92,null))['then'](saveUpdates(_0x5dd0f9[_0xde59('0x4a')],null))[_0xde59('0x22')](respondWithResult(_0x488e92,null))['catch'](handleError(_0x488e92,null));};exports[_0xde59('0x4c')]=function(_0x1ce882,_0xd002d7){return db[_0xde59('0x29')][_0xde59('0x48')]({'where':{'id':_0x1ce882[_0xde59('0x4b')]['id']}})[_0xde59('0x22')](handleEntityNotFound(_0xd002d7,null))[_0xde59('0x22')](removeEntity(_0xd002d7,null))['catch'](handleError(_0xd002d7,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 810ae08..f24f9b2 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 _0x287c=['exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x53373c,_0x14bc5e){var _0x37d0df=function(_0x532c44){while(--_0x532c44){_0x53373c['push'](_0x53373c['shift']());}};_0x37d0df(++_0x14bc5e);}(_0x287c,0x160));var _0xc287=function(_0x34d7bc,_0xfbc8f1){_0x34d7bc=_0x34d7bc-0x0;var _0x3ae495=_0x287c[_0x34d7bc];return _0x3ae495;};'use strict';var _=require(_0xc287('0x0'));var util=require(_0xc287('0x1'));var logger=require(_0xc287('0x2'))(_0xc287('0x3'));var moment=require(_0xc287('0x4'));var BPromise=require(_0xc287('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc287('0x6'));var rimraf=require('rimraf');var config=require(_0xc287('0x7'));var attributes=require('./mailServerOut.attributes');module[_0xc287('0x8')]=function(_0xb02871,_0x27f6fc){return _0xb02871[_0xc287('0x9')](_0xc287('0xa'),attributes,{'tableName':_0xc287('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3399=['mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x37e0a5,_0x3dd992){var _0x339012=function(_0x3ce7c8){while(--_0x3ce7c8){_0x37e0a5['push'](_0x37e0a5['shift']());}};_0x339012(++_0x3dd992);}(_0x3399,0x12d));var _0x9339=function(_0x1b6e21,_0xb692e1){_0x1b6e21=_0x1b6e21-0x0;var _0xbaf115=_0x3399[_0x1b6e21];return _0xbaf115;};'use strict';var _=require(_0x9339('0x0'));var util=require(_0x9339('0x1'));var logger=require(_0x9339('0x2'))(_0x9339('0x3'));var moment=require(_0x9339('0x4'));var BPromise=require(_0x9339('0x5'));var rp=require(_0x9339('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9339('0x7'));var config=require(_0x9339('0x8'));var attributes=require(_0x9339('0x9'));module[_0x9339('0xa')]=function(_0x355819,_0x1203a4){return _0x355819['define']('MailServerOut',attributes,{'tableName':_0x9339('0xb'),'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 ce06649..a641db0 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(_0x3de903,_0x1805bc){var _0x414edd=function(_0xc2b4be){while(--_0xc2b4be){_0x3de903['push'](_0x3de903['shift']());}};_0x414edd(++_0x1805bc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var 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(_0x3d6e68,_0x455d10){var _0x51f6e4=function(_0x1d067c){while(--_0x1d067c){_0x3d6e68['push'](_0x3d6e68['shift']());}};_0x51f6e4(++_0x455d10);}(_0x2ef3,0xba));var _0x32ef=function(_0x40e5a7,_0xc4156b){_0x40e5a7=_0x40e5a7-0x0;var _0x174d9d=_0x2ef3[_0x40e5a7];return _0x174d9d;};'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 7e15624..0dd1526 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 _0x6b68=['multer','connect-timeout','express','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','exports'];(function(_0x1854b0,_0x346a44){var _0xe61ab6=function(_0x2f0271){while(--_0x2f0271){_0x1854b0['push'](_0x1854b0['shift']());}};_0xe61ab6(++_0x346a44);}(_0x6b68,0xe0));var _0x86b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b68[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x86b6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x86b6('0x1'));var express=require(_0x86b6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x86b6('0x3'));var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router[_0x86b6('0x4')]('/',auth[_0x86b6('0x5')](),controller[_0x86b6('0x6')]);router[_0x86b6('0x4')](_0x86b6('0x7'),auth[_0x86b6('0x5')](),controller['describe']);router[_0x86b6('0x4')](_0x86b6('0x8'),auth[_0x86b6('0x5')](),controller[_0x86b6('0x9')]);router[_0x86b6('0xa')]('/',auth[_0x86b6('0x5')](),controller[_0x86b6('0xb')]);router[_0x86b6('0xc')](_0x86b6('0x8'),auth[_0x86b6('0x5')](),controller[_0x86b6('0xd')]);router[_0x86b6('0xe')](_0x86b6('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x86b6('0xf')]=router; \ No newline at end of file +var _0xbd6b=['/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated'];(function(_0x22cb5f,_0x2cdd63){var _0x274d36=function(_0x421472){while(--_0x421472){_0x22cb5f['push'](_0x22cb5f['shift']());}};_0x274d36(++_0x2cdd63);}(_0xbd6b,0x15f));var _0xbbd6=function(_0x145a3f,_0x2c075e){_0x145a3f=_0x145a3f-0x0;var _0x559890=_0xbd6b[_0x145a3f];return _0x559890;};'use strict';var multer=require(_0xbbd6('0x0'));var util=require(_0xbbd6('0x1'));var path=require(_0xbbd6('0x2'));var timeout=require('connect-timeout');var express=require(_0xbbd6('0x3'));var router=express[_0xbbd6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbbd6('0x5'));var interaction=require(_0xbbd6('0x6'));var config=require('../../config/environment');var controller=require(_0xbbd6('0x7'));router[_0xbbd6('0x8')]('/',auth[_0xbbd6('0x9')](),controller['index']);router[_0xbbd6('0x8')](_0xbbd6('0xa'),auth[_0xbbd6('0x9')](),controller[_0xbbd6('0xb')]);router['get'](_0xbbd6('0xc'),auth[_0xbbd6('0x9')](),controller[_0xbbd6('0xd')]);router['post']('/',auth[_0xbbd6('0x9')](),controller[_0xbbd6('0xe')]);router['put'](_0xbbd6('0xc'),auth[_0xbbd6('0x9')](),controller[_0xbbd6('0xf')]);router[_0xbbd6('0x10')]('/:id',auth[_0xbbd6('0x9')](),controller[_0xbbd6('0x11')]);module[_0xbbd6('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 48a32d6..8db37f6 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 _0x2eb2=['name','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2eb2,0x19f));var _0x22eb=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x2eb2[_0x54d4a8];return _0x3b321b;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'unique':_0x22eb('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x22eb('0x1')]}}; \ No newline at end of file +var _0xe944=['sequelize','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe944,0x174));var _0x4e94=function(_0x212a3b,_0xb6c1a3){_0x212a3b=_0x212a3b-0x0;var _0x4c0872=_0xe944[_0x212a3b];return _0x4c0872;};'use strict';var Sequelize=require(_0x4e94('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4e94('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 454c9c2..d4b8da2 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 _0xd13d=['moment','util','path','sox','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/license/util','../../mysqldb','status','end','offset','undefined','count','limit','Content-Range','reject','update','then','destroy','name','index','map','MailSubstatus','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0xd13d,0x155));var _0xdd13=function(_0x3f6b11,_0x42411e){_0x3f6b11=_0x3f6b11-0x0;var _0x59d56b=_0xd13d[_0x3f6b11];return _0x59d56b;};'use strict';var emlformat=require(_0xdd13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd13('0x1'));var jsonpatch=require(_0xdd13('0x2'));var rp=require(_0xdd13('0x3'));var moment=require(_0xdd13('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdd13('0x5'));var path=require(_0xdd13('0x6'));var sox=require(_0xdd13('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd13('0x8'));var _=require(_0xdd13('0x9'));var squel=require(_0xdd13('0xa'));var crypto=require(_0xdd13('0xb'));var jsforce=require(_0xdd13('0xc'));var deskjs=require(_0xdd13('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdd13('0xe'));var Redis=require(_0xdd13('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdd13('0x10'));var as=require(_0xdd13('0x11'));var hardwareService=require(_0xdd13('0x12'));var logger=require(_0xdd13('0x13'))(_0xdd13('0x14'));var utils=require(_0xdd13('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdd13('0x16'));var db=require(_0xdd13('0x17'))['db'];function respondWithStatusCode(_0x31371a,_0x235ff9){_0x235ff9=_0x235ff9||0xcc;return function(_0x2de15e){if(_0x2de15e){return _0x31371a['sendStatus'](_0x235ff9);}return _0x31371a[_0xdd13('0x18')](_0x235ff9)[_0xdd13('0x19')]();};}function respondWithResult(_0x3db555,_0x466ec3){_0x466ec3=_0x466ec3||0xc8;return function(_0x3bb7c3){if(_0x3bb7c3){return _0x3db555[_0xdd13('0x18')](_0x466ec3)['json'](_0x3bb7c3);}};}function respondWithFilteredResult(_0x50edad,_0x137881){return function(_0x149b58){if(_0x149b58){var _0x208107=typeof _0x137881[_0xdd13('0x1a')]===_0xdd13('0x1b')&&typeof _0x137881['limit']===_0xdd13('0x1b');var _0x2c73dd=_0x149b58[_0xdd13('0x1c')];var _0x5126a9=_0x208107?0x0:_0x137881[_0xdd13('0x1a')];var _0x21002f=_0x208107?_0x149b58[_0xdd13('0x1c')]:_0x137881[_0xdd13('0x1a')]+_0x137881[_0xdd13('0x1d')];var _0x5d6809;if(_0x21002f>=_0x2c73dd){_0x21002f=_0x2c73dd;_0x5d6809=0xc8;}else{_0x5d6809=0xce;}_0x50edad[_0xdd13('0x18')](_0x5d6809);return _0x50edad['set'](_0xdd13('0x1e'),_0x5126a9+'-'+_0x21002f+'/'+_0x2c73dd)['json'](_0x149b58);}return null;};}function patchUpdates(_0x4c9d86){return function(_0x477062){try{jsonpatch['apply'](_0x477062,_0x4c9d86,!![]);}catch(_0x9e9505){return BPromise[_0xdd13('0x1f')](_0x9e9505);}return _0x477062['save']();};}function saveUpdates(_0x5e5ada,_0x3d0e9d){return function(_0x35134e){if(_0x35134e){return _0x35134e[_0xdd13('0x20')](_0x5e5ada)[_0xdd13('0x21')](function(_0x12419f){return _0x12419f;});}return null;};}function removeEntity(_0x4ef17c,_0x1dc116){return function(_0x192b7c){if(_0x192b7c){return _0x192b7c[_0xdd13('0x22')]()[_0xdd13('0x21')](function(){_0x4ef17c[_0xdd13('0x18')](0xcc)[_0xdd13('0x19')]();});}};}function handleEntityNotFound(_0x11a7f3,_0x320645){return function(_0x435473){if(!_0x435473){_0x11a7f3['sendStatus'](0x194);}return _0x435473;};}function handleError(_0x529ffa,_0xea4464){_0xea4464=_0xea4464||0x1f4;return function(_0x3f40d0){logger['error'](_0x3f40d0['stack']);if(_0x3f40d0[_0xdd13('0x23')]){delete _0x3f40d0[_0xdd13('0x23')];}_0x529ffa[_0xdd13('0x18')](_0xea4464)['send'](_0x3f40d0);};}exports[_0xdd13('0x24')]=function(_0x5c52ec,_0x579f71){var _0x424a65={},_0xf2c9d5={},_0xb2113b={'count':0x0,'rows':[]};var _0x4a2a8c=_[_0xdd13('0x25')](db[_0xdd13('0x26')]['rawAttributes'],function(_0x17b6b2){return{'name':_0x17b6b2['fieldName'],'type':_0x17b6b2['type']['key']};});_0xf2c9d5[_0xdd13('0x27')]=_[_0xdd13('0x25')](_0x4a2a8c,_0xdd13('0x23'));_0xf2c9d5[_0xdd13('0x28')]=_[_0xdd13('0x29')](_0x5c52ec[_0xdd13('0x28')]);_0xf2c9d5['filters']=_[_0xdd13('0x2a')](_0xf2c9d5[_0xdd13('0x27')],_0xf2c9d5[_0xdd13('0x28')]);_0x424a65['attributes']=_[_0xdd13('0x2a')](_0xf2c9d5[_0xdd13('0x27')],qs[_0xdd13('0x2b')](_0x5c52ec[_0xdd13('0x28')][_0xdd13('0x2b')]));_0x424a65[_0xdd13('0x2c')]=_0x424a65[_0xdd13('0x2c')]['length']?_0x424a65[_0xdd13('0x2c')]:_0xf2c9d5['model'];if(!_0x5c52ec['query'][_0xdd13('0x2d')](_0xdd13('0x2e'))){_0x424a65[_0xdd13('0x1d')]=qs[_0xdd13('0x1d')](_0x5c52ec['query'][_0xdd13('0x1d')]);_0x424a65['offset']=qs['offset'](_0x5c52ec[_0xdd13('0x28')]['offset']);}_0x424a65[_0xdd13('0x2f')]=qs['sort'](_0x5c52ec[_0xdd13('0x28')][_0xdd13('0x30')]);_0x424a65['where']=qs[_0xdd13('0x31')](_[_0xdd13('0x32')](_0x5c52ec[_0xdd13('0x28')],_0xf2c9d5[_0xdd13('0x31')]),_0x4a2a8c);if(_0x5c52ec[_0xdd13('0x28')]['filter']){_0x424a65[_0xdd13('0x33')]=_[_0xdd13('0x34')](_0x424a65['where'],{'$or':_[_0xdd13('0x25')](_0x4a2a8c,function(_0x33f4f4){if(_0x33f4f4[_0xdd13('0x35')]!==_0xdd13('0x36')){var _0x6df259={};_0x6df259[_0x33f4f4['name']]={'$like':'%'+_0x5c52ec[_0xdd13('0x28')][_0xdd13('0x37')]+'%'};return _0x6df259;}})});}_0x424a65=_[_0xdd13('0x34')]({},_0x424a65,_0x5c52ec[_0xdd13('0x38')]);var _0x211c88={'where':_0x424a65[_0xdd13('0x33')]};return db[_0xdd13('0x26')][_0xdd13('0x1c')](_0x211c88)[_0xdd13('0x21')](function(_0x16e769){_0xb2113b['count']=_0x16e769;if(_0x5c52ec[_0xdd13('0x28')][_0xdd13('0x39')]){_0x424a65[_0xdd13('0x3a')]=[{'all':!![]}];}return db[_0xdd13('0x26')][_0xdd13('0x3b')](_0x424a65);})[_0xdd13('0x21')](function(_0x2ba6e5){_0xb2113b['rows']=_0x2ba6e5;return _0xb2113b;})[_0xdd13('0x21')](respondWithFilteredResult(_0x579f71,_0x424a65))[_0xdd13('0x3c')](handleError(_0x579f71,null));};exports[_0xdd13('0x3d')]=function(_0x56ca6e,_0xa018ad){var _0x36fb93={'raw':!![],'where':{'id':_0x56ca6e[_0xdd13('0x3e')]['id']}},_0x562983={};_0x562983[_0xdd13('0x27')]=_[_0xdd13('0x29')](db[_0xdd13('0x26')][_0xdd13('0x3f')]);_0x562983[_0xdd13('0x28')]=_[_0xdd13('0x29')](_0x56ca6e[_0xdd13('0x28')]);_0x562983['filters']=_['intersection'](_0x562983[_0xdd13('0x27')],_0x562983[_0xdd13('0x28')]);_0x36fb93[_0xdd13('0x2c')]=_[_0xdd13('0x2a')](_0x562983[_0xdd13('0x27')],qs[_0xdd13('0x2b')](_0x56ca6e[_0xdd13('0x28')][_0xdd13('0x2b')]));_0x36fb93[_0xdd13('0x2c')]=_0x36fb93['attributes'][_0xdd13('0x40')]?_0x36fb93[_0xdd13('0x2c')]:_0x562983[_0xdd13('0x27')];if(_0x56ca6e[_0xdd13('0x28')]['includeAll']){_0x36fb93[_0xdd13('0x3a')]=[{'all':!![]}];}_0x36fb93=_['merge']({},_0x36fb93,_0x56ca6e[_0xdd13('0x38')]);return db['MailSubstatus'][_0xdd13('0x41')](_0x36fb93)['then'](handleEntityNotFound(_0xa018ad,null))['then'](respondWithResult(_0xa018ad,null))[_0xdd13('0x3c')](handleError(_0xa018ad,null));};exports[_0xdd13('0x42')]=function(_0x406072,_0x4752cd){return db[_0xdd13('0x26')][_0xdd13('0x42')](_0x406072['body'],{})[_0xdd13('0x21')](respondWithResult(_0x4752cd,0xc9))[_0xdd13('0x3c')](handleError(_0x4752cd,null));};exports[_0xdd13('0x20')]=function(_0x39c293,_0xed4b08){if(_0x39c293[_0xdd13('0x43')]['id']){delete _0x39c293['body']['id'];}return db[_0xdd13('0x26')][_0xdd13('0x41')]({'where':{'id':_0x39c293[_0xdd13('0x3e')]['id']}})[_0xdd13('0x21')](handleEntityNotFound(_0xed4b08,null))[_0xdd13('0x21')](saveUpdates(_0x39c293[_0xdd13('0x43')],null))[_0xdd13('0x21')](respondWithResult(_0xed4b08,null))[_0xdd13('0x3c')](handleError(_0xed4b08,null));};exports[_0xdd13('0x22')]=function(_0x2adc3c,_0x250377){return db[_0xdd13('0x26')][_0xdd13('0x41')]({'where':{'id':_0x2adc3c['params']['id']}})[_0xdd13('0x21')](handleEntityNotFound(_0x250377,null))[_0xdd13('0x21')](removeEntity(_0x250377,null))[_0xdd13('0x3c')](handleError(_0x250377,null));};exports[_0xdd13('0x44')]=function(_0x4b8dd0,_0x51448e){return db[_0xdd13('0x26')][_0xdd13('0x44')]()[_0xdd13('0x21')](respondWithResult(_0x51448e,null))[_0xdd13('0x3c')](handleError(_0x51448e,null));}; \ No newline at end of file +var _0xf817=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','VIRTUAL','merge','options','where','includeAll','include','rows','show','keys','catch','create','body','params','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xf817,0x161));var _0x7f81=function(_0x22bad0,_0x5c8d63){_0x22bad0=_0x22bad0-0x0;var _0x305748=_0xf817[_0x22bad0];return _0x305748;};'use strict';var emlformat=require(_0x7f81('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7f81('0x1'));var jsonpatch=require(_0x7f81('0x2'));var rp=require(_0x7f81('0x3'));var moment=require(_0x7f81('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7f81('0x5'));var util=require(_0x7f81('0x6'));var path=require('path');var sox=require(_0x7f81('0x7'));var csv=require('to-csv');var ejs=require(_0x7f81('0x8'));var fs=require('fs');var fs_extra=require(_0x7f81('0x9'));var _=require(_0x7f81('0xa'));var squel=require(_0x7f81('0xb'));var crypto=require(_0x7f81('0xc'));var jsforce=require(_0x7f81('0xd'));var deskjs=require(_0x7f81('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7f81('0xf'));var Papa=require(_0x7f81('0x10'));var Redis=require(_0x7f81('0x11'));var authService=require(_0x7f81('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f81('0x13'));var hardwareService=require(_0x7f81('0x14'));var logger=require(_0x7f81('0x15'))('api');var utils=require(_0x7f81('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7f81('0x17'));var db=require(_0x7f81('0x18'))['db'];function respondWithStatusCode(_0x257839,_0x34abce){_0x34abce=_0x34abce||0xcc;return function(_0x3030c2){if(_0x3030c2){return _0x257839[_0x7f81('0x19')](_0x34abce);}return _0x257839[_0x7f81('0x1a')](_0x34abce)['end']();};}function respondWithResult(_0x228954,_0x414c50){_0x414c50=_0x414c50||0xc8;return function(_0x54391e){if(_0x54391e){return _0x228954[_0x7f81('0x1a')](_0x414c50)[_0x7f81('0x1b')](_0x54391e);}};}function respondWithFilteredResult(_0x370309,_0x599c2a){return function(_0x371c27){if(_0x371c27){var _0x1f6d42=typeof _0x599c2a['offset']===_0x7f81('0x1c')&&typeof _0x599c2a[_0x7f81('0x1d')]==='undefined';var _0x1f6886=_0x371c27['count'];var _0x5b3deb=_0x1f6d42?0x0:_0x599c2a[_0x7f81('0x1e')];var _0x70b6e0=_0x1f6d42?_0x371c27[_0x7f81('0x1f')]:_0x599c2a[_0x7f81('0x1e')]+_0x599c2a[_0x7f81('0x1d')];var _0x59de17;if(_0x70b6e0>=_0x1f6886){_0x70b6e0=_0x1f6886;_0x59de17=0xc8;}else{_0x59de17=0xce;}_0x370309[_0x7f81('0x1a')](_0x59de17);return _0x370309['set'](_0x7f81('0x20'),_0x5b3deb+'-'+_0x70b6e0+'/'+_0x1f6886)['json'](_0x371c27);}return null;};}function patchUpdates(_0x327374){return function(_0x2b0119){try{jsonpatch[_0x7f81('0x21')](_0x2b0119,_0x327374,!![]);}catch(_0x1b0fc0){return BPromise[_0x7f81('0x22')](_0x1b0fc0);}return _0x2b0119[_0x7f81('0x23')]();};}function saveUpdates(_0x5110d7,_0x47afb5){return function(_0x64880f){if(_0x64880f){return _0x64880f[_0x7f81('0x24')](_0x5110d7)[_0x7f81('0x25')](function(_0x3b0154){return _0x3b0154;});}return null;};}function removeEntity(_0x3790ad,_0x6cdaac){return function(_0x3f268f){if(_0x3f268f){return _0x3f268f[_0x7f81('0x26')]()[_0x7f81('0x25')](function(){_0x3790ad[_0x7f81('0x1a')](0xcc)[_0x7f81('0x27')]();});}};}function handleEntityNotFound(_0x24d1c7,_0x36d826){return function(_0x309b67){if(!_0x309b67){_0x24d1c7[_0x7f81('0x19')](0x194);}return _0x309b67;};}function handleError(_0x515c99,_0x5d95bd){_0x5d95bd=_0x5d95bd||0x1f4;return function(_0x1eb9f6){logger['error'](_0x1eb9f6[_0x7f81('0x28')]);if(_0x1eb9f6[_0x7f81('0x29')]){delete _0x1eb9f6[_0x7f81('0x29')];}_0x515c99['status'](_0x5d95bd)[_0x7f81('0x2a')](_0x1eb9f6);};}exports['index']=function(_0x31dda0,_0x25d2aa){var _0x22712a={},_0x6732a4={},_0x2f7266={'count':0x0,'rows':[]};var _0x4139c4=_[_0x7f81('0x2b')](db[_0x7f81('0x2c')][_0x7f81('0x2d')],function(_0x32d8ee){return{'name':_0x32d8ee[_0x7f81('0x2e')],'type':_0x32d8ee[_0x7f81('0x2f')]['key']};});_0x6732a4[_0x7f81('0x30')]=_[_0x7f81('0x2b')](_0x4139c4,_0x7f81('0x29'));_0x6732a4[_0x7f81('0x31')]=_['keys'](_0x31dda0['query']);_0x6732a4[_0x7f81('0x32')]=_[_0x7f81('0x33')](_0x6732a4['model'],_0x6732a4[_0x7f81('0x31')]);_0x22712a['attributes']=_[_0x7f81('0x33')](_0x6732a4[_0x7f81('0x30')],qs[_0x7f81('0x34')](_0x31dda0[_0x7f81('0x31')][_0x7f81('0x34')]));_0x22712a[_0x7f81('0x35')]=_0x22712a['attributes'][_0x7f81('0x36')]?_0x22712a[_0x7f81('0x35')]:_0x6732a4['model'];if(!_0x31dda0[_0x7f81('0x31')]['hasOwnProperty'](_0x7f81('0x37'))){_0x22712a['limit']=qs['limit'](_0x31dda0[_0x7f81('0x31')][_0x7f81('0x1d')]);_0x22712a[_0x7f81('0x1e')]=qs[_0x7f81('0x1e')](_0x31dda0[_0x7f81('0x31')][_0x7f81('0x1e')]);}_0x22712a[_0x7f81('0x38')]=qs[_0x7f81('0x39')](_0x31dda0[_0x7f81('0x31')][_0x7f81('0x39')]);_0x22712a['where']=qs['filters'](_['pick'](_0x31dda0[_0x7f81('0x31')],_0x6732a4['filters']),_0x4139c4);if(_0x31dda0[_0x7f81('0x31')][_0x7f81('0x3a')]){_0x22712a['where']=_['merge'](_0x22712a['where'],{'$or':_[_0x7f81('0x2b')](_0x4139c4,function(_0x4ea8de){if(_0x4ea8de['type']!==_0x7f81('0x3b')){var _0x9e9ab9={};_0x9e9ab9[_0x4ea8de['name']]={'$like':'%'+_0x31dda0['query'][_0x7f81('0x3a')]+'%'};return _0x9e9ab9;}})});}_0x22712a=_[_0x7f81('0x3c')]({},_0x22712a,_0x31dda0[_0x7f81('0x3d')]);var _0x3922be={'where':_0x22712a[_0x7f81('0x3e')]};return db[_0x7f81('0x2c')][_0x7f81('0x1f')](_0x3922be)[_0x7f81('0x25')](function(_0x2c1708){_0x2f7266[_0x7f81('0x1f')]=_0x2c1708;if(_0x31dda0[_0x7f81('0x31')][_0x7f81('0x3f')]){_0x22712a[_0x7f81('0x40')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x22712a);})[_0x7f81('0x25')](function(_0x374211){_0x2f7266[_0x7f81('0x41')]=_0x374211;return _0x2f7266;})[_0x7f81('0x25')](respondWithFilteredResult(_0x25d2aa,_0x22712a))['catch'](handleError(_0x25d2aa,null));};exports[_0x7f81('0x42')]=function(_0x244156,_0x321640){var _0x5b4de1={'raw':!![],'where':{'id':_0x244156['params']['id']}},_0x979737={};_0x979737[_0x7f81('0x30')]=_['keys'](db['MailSubstatus'][_0x7f81('0x2d')]);_0x979737['query']=_[_0x7f81('0x43')](_0x244156[_0x7f81('0x31')]);_0x979737['filters']=_[_0x7f81('0x33')](_0x979737['model'],_0x979737[_0x7f81('0x31')]);_0x5b4de1[_0x7f81('0x35')]=_[_0x7f81('0x33')](_0x979737[_0x7f81('0x30')],qs[_0x7f81('0x34')](_0x244156[_0x7f81('0x31')][_0x7f81('0x34')]));_0x5b4de1[_0x7f81('0x35')]=_0x5b4de1[_0x7f81('0x35')][_0x7f81('0x36')]?_0x5b4de1['attributes']:_0x979737[_0x7f81('0x30')];if(_0x244156[_0x7f81('0x31')][_0x7f81('0x3f')]){_0x5b4de1['include']=[{'all':!![]}];}_0x5b4de1=_[_0x7f81('0x3c')]({},_0x5b4de1,_0x244156['options']);return db[_0x7f81('0x2c')]['find'](_0x5b4de1)[_0x7f81('0x25')](handleEntityNotFound(_0x321640,null))[_0x7f81('0x25')](respondWithResult(_0x321640,null))[_0x7f81('0x44')](handleError(_0x321640,null));};exports[_0x7f81('0x45')]=function(_0xf4236,_0x501fcd){return db[_0x7f81('0x2c')][_0x7f81('0x45')](_0xf4236[_0x7f81('0x46')],{})[_0x7f81('0x25')](respondWithResult(_0x501fcd,0xc9))[_0x7f81('0x44')](handleError(_0x501fcd,null));};exports[_0x7f81('0x24')]=function(_0x3a0b4c,_0x5a6a48){if(_0x3a0b4c[_0x7f81('0x46')]['id']){delete _0x3a0b4c['body']['id'];}return db[_0x7f81('0x2c')]['find']({'where':{'id':_0x3a0b4c[_0x7f81('0x47')]['id']}})['then'](handleEntityNotFound(_0x5a6a48,null))[_0x7f81('0x25')](saveUpdates(_0x3a0b4c[_0x7f81('0x46')],null))['then'](respondWithResult(_0x5a6a48,null))[_0x7f81('0x44')](handleError(_0x5a6a48,null));};exports['destroy']=function(_0xd74bb2,_0x33a8ec){return db[_0x7f81('0x2c')][_0x7f81('0x48')]({'where':{'id':_0xd74bb2[_0x7f81('0x47')]['id']}})['then'](handleEntityNotFound(_0x33a8ec,null))[_0x7f81('0x25')](removeEntity(_0x33a8ec,null))[_0x7f81('0x44')](handleError(_0x33a8ec,null));};exports[_0x7f81('0x49')]=function(_0x4b4e59,_0x1cb2e3){return db['MailSubstatus'][_0x7f81('0x49')]()['then'](respondWithResult(_0x1cb2e3,null))[_0x7f81('0x44')](handleError(_0x1cb2e3,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 2432f43..5b18142 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea21=['events','../../mysqldb','MailSubstatus','update','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea21,0x100));var _0x1ea2=function(_0x24668e,_0x30901b){_0x24668e=_0x24668e-0x0;var _0x3e653c=_0xea21[_0x24668e];return _0x3e653c;};'use strict';var EventEmitter=require(_0x1ea2('0x0'));var MailSubstatus=require(_0x1ea2('0x1'))['db'][_0x1ea2('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x1ea2('0x3')};function emitEvent(_0x2d38ef){return function(_0x4b07ab,_0x35784b,_0xad6ab6){MailSubstatusEvents[_0x1ea2('0x4')](_0x2d38ef+':'+_0x4b07ab['id'],_0x4b07ab);MailSubstatusEvents['emit'](_0x2d38ef,_0x4b07ab);_0xad6ab6(null);};}for(var e in events){if(events[_0x1ea2('0x5')](e)){var event=events[e];MailSubstatus[_0x1ea2('0x6')](e,emitEvent(event));}}module[_0x1ea2('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0xf59d=['hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf59d,0x142));var _0xdf59=function(_0x261c5a,_0x1c2dfa){_0x261c5a=_0x261c5a-0x0;var _0x4d8c6c=_0xf59d[_0x261c5a];return _0x4d8c6c;};'use strict';var EventEmitter=require(_0xdf59('0x0'));var MailSubstatus=require(_0xdf59('0x1'))['db'][_0xdf59('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xdf59('0x3')](0x0);var events={'afterUpdate':_0xdf59('0x4')};function emitEvent(_0x2bc04a){return function(_0x463969,_0x2801d6,_0x5de5b9){MailSubstatusEvents['emit'](_0x2bc04a+':'+_0x463969['id'],_0x463969);MailSubstatusEvents[_0xdf59('0x5')](_0x2bc04a,_0x463969);_0x5de5b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xdf59('0x6')](e,emitEvent(event));}}module[_0xdf59('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 0bccbf9..63db49f 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 _0x9447=['mail_substatuses','Condition','mailSubstatus','_previousDataValues','./mailSubstatus.attributes','exports','define','MailSubstatus'];(function(_0x1a4b4a,_0x26b892){var _0x50d7d9=function(_0x3dd5b5){while(--_0x3dd5b5){_0x1a4b4a['push'](_0x1a4b4a['shift']());}};_0x50d7d9(++_0x26b892);}(_0x9447,0x164));var _0x7944=function(_0x347553,_0x4a84ee){_0x347553=_0x347553-0x0;var _0x231841=_0x9447[_0x347553];return _0x231841;};'use strict';var attributes=require(_0x7944('0x0'));module[_0x7944('0x1')]=function(_0x59600b){var _0xd36058=_0x59600b['models'];return _0x59600b[_0x7944('0x2')](_0x7944('0x3'),attributes,{'tableName':_0x7944('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x252600,_0x2f99e2,_0x1540b5){return _0xd36058[_0x7944('0x5')]['update']({'value':_0x252600['name']},{'where':{'field':_0x7944('0x6'),'value':_0x252600[_0x7944('0x7')]['name']}})['then'](function(){_0x1540b5();})['catch'](function(_0x294c30){_0x1540b5(_0x294c30);});}}});}; \ No newline at end of file +var _0xbc36=['./mailSubstatus.attributes','exports','models','MailSubstatus','Condition','update','name','mailSubstatus','_previousDataValues','then','catch'];(function(_0x57dae8,_0x8a67da){var _0x504624=function(_0x2ab53d){while(--_0x2ab53d){_0x57dae8['push'](_0x57dae8['shift']());}};_0x504624(++_0x8a67da);}(_0xbc36,0x1a2));var _0x6bc3=function(_0x18ad17,_0x126a32){_0x18ad17=_0x18ad17-0x0;var _0x45af48=_0xbc36[_0x18ad17];return _0x45af48;};'use strict';var attributes=require(_0x6bc3('0x0'));module[_0x6bc3('0x1')]=function(_0x5d0e99){var _0x1304b4=_0x5d0e99[_0x6bc3('0x2')];return _0x5d0e99['define'](_0x6bc3('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5bc194,_0xad005,_0x193c95){return _0x1304b4[_0x6bc3('0x4')][_0x6bc3('0x5')]({'value':_0x5bc194[_0x6bc3('0x6')]},{'where':{'field':_0x6bc3('0x7'),'value':_0x5bc194[_0x6bc3('0x8')][_0x6bc3('0x6')]}})[_0x6bc3('0x9')](function(){_0x193c95();})[_0x6bc3('0xa')](function(_0x523511){_0x193c95(_0x523511);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index c69d984..d9c2a59 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 _0x8258=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x844866,_0x57ee1e){var _0x26343c=function(_0x61601d){while(--_0x61601d){_0x844866['push'](_0x844866['shift']());}};_0x26343c(++_0x57ee1e);}(_0x8258,0x1f2));var _0x8825=function(_0x2594b5,_0x1f0ec9){_0x2594b5=_0x2594b5-0x0;var _0x989874=_0x8258[_0x2594b5];return _0x989874;};'use strict';var _=require(_0x8825('0x0'));var util=require(_0x8825('0x1'));var moment=require(_0x8825('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8825('0x3'));var db=require(_0x8825('0x4'))['db'];var utils=require(_0x8825('0x5'));var logger=require(_0x8825('0x6'))(_0x8825('0x7'));var config=require(_0x8825('0x8'));var jayson=require(_0x8825('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e4e5d,_0x2bd1a2,_0x32e764){return new BPromise(function(_0x42c43a,_0x4b47cb){return client[_0x8825('0xa')](_0x4e4e5d,_0x32e764)[_0x8825('0xb')](function(_0x32a991){logger[_0x8825('0xc')](_0x8825('0xd'),_0x2bd1a2,_0x8825('0xe'));logger[_0x8825('0xf')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x2bd1a2,_0x8825('0xe'),JSON['stringify'](_0x32a991));if(_0x32a991[_0x8825('0x10')]){if(_0x32a991['error'][_0x8825('0x11')]===0x1f4){logger[_0x8825('0x10')](_0x8825('0xd'),_0x2bd1a2,_0x32a991[_0x8825('0x10')]['message']);return _0x4b47cb(_0x32a991['error'][_0x8825('0x12')]);}logger[_0x8825('0x10')](_0x8825('0xd'),_0x2bd1a2,_0x32a991[_0x8825('0x10')]['message']);return _0x42c43a(_0x32a991['error'][_0x8825('0x12')]);}else{logger[_0x8825('0xc')](_0x8825('0xd'),_0x2bd1a2,_0x8825('0xe'));_0x42c43a(_0x32a991[_0x8825('0x13')][_0x8825('0x12')]);}})[_0x8825('0x14')](function(_0x3d0f22){logger[_0x8825('0x10')](_0x8825('0xd'),_0x2bd1a2,_0x3d0f22);_0x4b47cb(_0x3d0f22);});});} \ No newline at end of file +var _0x86ae=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0x86ae,0xfa));var _0xe86a=function(_0x5b7b0f,_0xf9a06d){_0x5b7b0f=_0x5b7b0f-0x0;var _0xe4703c=_0x86ae[_0x5b7b0f];return _0xe4703c;};'use strict';var _=require('lodash');var util=require(_0xe86a('0x0'));var moment=require(_0xe86a('0x1'));var BPromise=require(_0xe86a('0x2'));var rs=require(_0xe86a('0x3'));var fs=require('fs');var Redis=require(_0xe86a('0x4'));var db=require(_0xe86a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe86a('0x6'));var config=require(_0xe86a('0x7'));var jayson=require(_0xe86a('0x8'));var client=jayson[_0xe86a('0x9')][_0xe86a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39fe5a,_0x5c2dc0,_0x1003ba){return new BPromise(function(_0x4ef640,_0x380d3d){return client[_0xe86a('0xb')](_0x39fe5a,_0x1003ba)['then'](function(_0xfd542){logger[_0xe86a('0xc')](_0xe86a('0xd'),_0x5c2dc0,_0xe86a('0xe'));logger[_0xe86a('0xf')](_0xe86a('0x10'),_0x5c2dc0,_0xe86a('0xe'),JSON[_0xe86a('0x11')](_0xfd542));if(_0xfd542['error']){if(_0xfd542[_0xe86a('0x12')][_0xe86a('0x13')]===0x1f4){logger[_0xe86a('0x12')](_0xe86a('0xd'),_0x5c2dc0,_0xfd542['error']['message']);return _0x380d3d(_0xfd542[_0xe86a('0x12')][_0xe86a('0x14')]);}logger[_0xe86a('0x12')](_0xe86a('0xd'),_0x5c2dc0,_0xfd542[_0xe86a('0x12')][_0xe86a('0x14')]);return _0x4ef640(_0xfd542[_0xe86a('0x12')][_0xe86a('0x14')]);}else{logger[_0xe86a('0xc')](_0xe86a('0xd'),_0x5c2dc0,_0xe86a('0xe'));_0x4ef640(_0xfd542['result'][_0xe86a('0x14')]);}})['catch'](function(_0x217a47){logger[_0xe86a('0x12')](_0xe86a('0xd'),_0x5c2dc0,_0x217a47);_0x380d3d(_0x217a47);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 716c809..c9d5d52 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 _0x0c3c=['connect-timeout','express','Router','../../components/auth/service','./mailTransferReport.controller','get','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','destroy','exports','multer','util','path'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x0c3c,0x115));var _0xc0c3=function(_0x112db5,_0x38a06d){_0x112db5=_0x112db5-0x0;var _0x1d7d06=_0x0c3c[_0x112db5];return _0x1d7d06;};'use strict';var multer=require(_0xc0c3('0x0'));var util=require(_0xc0c3('0x1'));var path=require(_0xc0c3('0x2'));var timeout=require(_0xc0c3('0x3'));var express=require(_0xc0c3('0x4'));var router=express[_0xc0c3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc0c3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc0c3('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc0c3('0x8')](_0xc0c3('0x9'),auth[_0xc0c3('0xa')](),controller[_0xc0c3('0xb')]);router[_0xc0c3('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc0c3('0xc')]);router[_0xc0c3('0xd')]('/',auth[_0xc0c3('0xa')](),controller[_0xc0c3('0xe')]);router[_0xc0c3('0xf')](_0xc0c3('0x10'),auth['isAuthenticated'](),controller[_0xc0c3('0x11')]);router['delete'](_0xc0c3('0x10'),auth[_0xc0c3('0xa')](),controller[_0xc0c3('0x12')]);module[_0xc0c3('0x13')]=router; \ No newline at end of file +var _0xeb86=['./mailTransferReport.controller','get','isAuthenticated','/describe','/:id','show','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4b8596,_0xa55202){var _0x4aba96=function(_0x32167a){while(--_0x32167a){_0x4b8596['push'](_0x4b8596['shift']());}};_0x4aba96(++_0xa55202);}(_0xeb86,0x1d8));var _0x6eb8=function(_0x4869d6,_0x55952b){_0x4869d6=_0x4869d6-0x0;var _0x25da94=_0xeb86[_0x4869d6];return _0x25da94;};'use strict';var multer=require(_0x6eb8('0x0'));var util=require('util');var path=require(_0x6eb8('0x1'));var timeout=require('connect-timeout');var express=require(_0x6eb8('0x2'));var router=express[_0x6eb8('0x3')]();var fs_extra=require(_0x6eb8('0x4'));var auth=require(_0x6eb8('0x5'));var interaction=require(_0x6eb8('0x6'));var config=require(_0x6eb8('0x7'));var controller=require(_0x6eb8('0x8'));router[_0x6eb8('0x9')]('/',auth[_0x6eb8('0xa')](),controller['index']);router[_0x6eb8('0x9')](_0x6eb8('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x6eb8('0x9')](_0x6eb8('0xc'),auth[_0x6eb8('0xa')](),controller[_0x6eb8('0xd')]);router[_0x6eb8('0xe')]('/',auth[_0x6eb8('0xa')](),controller['create']);router[_0x6eb8('0xf')](_0x6eb8('0xc'),auth[_0x6eb8('0xa')](),controller[_0x6eb8('0x10')]);router[_0x6eb8('0x11')](_0x6eb8('0xc'),auth[_0x6eb8('0xa')](),controller[_0x6eb8('0x12')]);module[_0x6eb8('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index a64f0de..f226e24 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x342b8a,_0x3436bb){var _0x92fc8b=function(_0x399a66){while(--_0x399a66){_0x342b8a['push'](_0x342b8a['shift']());}};_0x92fc8b(++_0x3436bb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0xcb91[_0x4bcf38];return _0x4a89be;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x3810f6,_0x41f38f){var _0x442125=function(_0x394205){while(--_0x394205){_0x3810f6['push'](_0x3810f6['shift']());}};_0x442125(++_0x41f38f);}(_0x34e8,0x12c));var _0x834e=function(_0x344904,_0x47c5b8){_0x344904=_0x344904-0x0;var _0xc151c5=_0x34e8[_0x344904];return _0xc151c5;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index ac2364d..4df85de 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 _0x43a9=['destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','MailTransferReport','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','merge','find','create','body'];(function(_0x51472d,_0x592b0b){var _0x5f00f1=function(_0x4a9b97){while(--_0x4a9b97){_0x51472d['push'](_0x51472d['shift']());}};_0x5f00f1(++_0x592b0b);}(_0x43a9,0x1c4));var _0x943a=function(_0x5627fc,_0x41a07f){_0x5627fc=_0x5627fc-0x0;var _0x22ebd3=_0x43a9[_0x5627fc];return _0x22ebd3;};'use strict';var emlformat=require(_0x943a('0x0'));var rimraf=require(_0x943a('0x1'));var zipdir=require(_0x943a('0x2'));var jsonpatch=require(_0x943a('0x3'));var rp=require(_0x943a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x943a('0x5'));var util=require(_0x943a('0x6'));var path=require('path');var sox=require(_0x943a('0x7'));var csv=require('to-csv');var ejs=require(_0x943a('0x8'));var fs=require('fs');var fs_extra=require(_0x943a('0x9'));var _=require(_0x943a('0xa'));var squel=require(_0x943a('0xb'));var crypto=require('crypto');var jsforce=require(_0x943a('0xc'));var deskjs=require(_0x943a('0xd'));var toCsv=require(_0x943a('0xe'));var querystring=require('querystring');var Papa=require(_0x943a('0xf'));var Redis=require(_0x943a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x943a('0x11'));var as=require(_0x943a('0x12'));var hardwareService=require(_0x943a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x943a('0x14'));var config=require(_0x943a('0x15'));var licenseUtil=require(_0x943a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x568659,_0x19b698){_0x19b698=_0x19b698||0xcc;return function(_0x1a6864){if(_0x1a6864){return _0x568659[_0x943a('0x17')](_0x19b698);}return _0x568659[_0x943a('0x18')](_0x19b698)[_0x943a('0x19')]();};}function respondWithResult(_0x290fa1,_0x2d6fa0){_0x2d6fa0=_0x2d6fa0||0xc8;return function(_0x5ccefd){if(_0x5ccefd){return _0x290fa1[_0x943a('0x18')](_0x2d6fa0)[_0x943a('0x1a')](_0x5ccefd);}};}function respondWithFilteredResult(_0x129a9d,_0x364725){return function(_0x51d6c1){if(_0x51d6c1){var _0x5b4fa9=typeof _0x364725[_0x943a('0x1b')]==='undefined'&&typeof _0x364725[_0x943a('0x1c')]===_0x943a('0x1d');var _0x4e94c5=_0x51d6c1[_0x943a('0x1e')];var _0x3108b3=_0x5b4fa9?0x0:_0x364725[_0x943a('0x1b')];var _0xa81a54=_0x5b4fa9?_0x51d6c1[_0x943a('0x1e')]:_0x364725[_0x943a('0x1b')]+_0x364725[_0x943a('0x1c')];var _0x966f7;if(_0xa81a54>=_0x4e94c5){_0xa81a54=_0x4e94c5;_0x966f7=0xc8;}else{_0x966f7=0xce;}_0x129a9d[_0x943a('0x18')](_0x966f7);return _0x129a9d[_0x943a('0x1f')](_0x943a('0x20'),_0x3108b3+'-'+_0xa81a54+'/'+_0x4e94c5)[_0x943a('0x1a')](_0x51d6c1);}return null;};}function patchUpdates(_0x4df918){return function(_0x3d5ef2){try{jsonpatch[_0x943a('0x21')](_0x3d5ef2,_0x4df918,!![]);}catch(_0x51c3dc){return BPromise[_0x943a('0x22')](_0x51c3dc);}return _0x3d5ef2['save']();};}function saveUpdates(_0x393ade,_0xe9c8a7){return function(_0x3b441d){if(_0x3b441d){return _0x3b441d[_0x943a('0x23')](_0x393ade)[_0x943a('0x24')](function(_0x4f81dc){return _0x4f81dc;});}return null;};}function removeEntity(_0x34f9b7,_0x5817ec){return function(_0x136ee0){if(_0x136ee0){return _0x136ee0['destroy']()[_0x943a('0x24')](function(){_0x34f9b7[_0x943a('0x18')](0xcc)[_0x943a('0x19')]();});}};}function handleEntityNotFound(_0x3d37ab,_0x4c0f6c){return function(_0x2bf6fe){if(!_0x2bf6fe){_0x3d37ab['sendStatus'](0x194);}return _0x2bf6fe;};}function handleError(_0x5e5b1b,_0x91eee){_0x91eee=_0x91eee||0x1f4;return function(_0x1b2a93){logger[_0x943a('0x25')](_0x1b2a93[_0x943a('0x26')]);if(_0x1b2a93['name']){delete _0x1b2a93[_0x943a('0x27')];}_0x5e5b1b[_0x943a('0x18')](_0x91eee)[_0x943a('0x28')](_0x1b2a93);};}exports[_0x943a('0x29')]=function(_0x3fa316,_0x41840a){var _0x1deead={},_0x67b8ea={},_0x4b0a50={'count':0x0,'rows':[]};var _0x5d7d86=_[_0x943a('0x2a')](db[_0x943a('0x2b')]['rawAttributes'],function(_0x3d5ae5){return{'name':_0x3d5ae5['fieldName'],'type':_0x3d5ae5['type'][_0x943a('0x2c')]};});_0x67b8ea[_0x943a('0x2d')]=_[_0x943a('0x2a')](_0x5d7d86,'name');_0x67b8ea[_0x943a('0x2e')]=_['keys'](_0x3fa316[_0x943a('0x2e')]);_0x67b8ea[_0x943a('0x2f')]=_[_0x943a('0x30')](_0x67b8ea['model'],_0x67b8ea[_0x943a('0x2e')]);_0x1deead[_0x943a('0x31')]=_[_0x943a('0x30')](_0x67b8ea['model'],qs[_0x943a('0x32')](_0x3fa316[_0x943a('0x2e')][_0x943a('0x32')]));_0x1deead[_0x943a('0x31')]=_0x1deead[_0x943a('0x31')][_0x943a('0x33')]?_0x1deead[_0x943a('0x31')]:_0x67b8ea[_0x943a('0x2d')];if(!_0x3fa316[_0x943a('0x2e')][_0x943a('0x34')](_0x943a('0x35'))){_0x1deead['limit']=qs['limit'](_0x3fa316[_0x943a('0x2e')]['limit']);_0x1deead['offset']=qs[_0x943a('0x1b')](_0x3fa316[_0x943a('0x2e')][_0x943a('0x1b')]);}_0x1deead[_0x943a('0x36')]=qs['sort'](_0x3fa316['query']['sort']);_0x1deead[_0x943a('0x37')]=qs[_0x943a('0x2f')](_[_0x943a('0x38')](_0x3fa316['query'],_0x67b8ea[_0x943a('0x2f')]),_0x5d7d86);if(_0x3fa316['query'][_0x943a('0x39')]){_0x1deead[_0x943a('0x37')]=_['merge'](_0x1deead[_0x943a('0x37')],{'$or':_['map'](_0x5d7d86,function(_0x5240e){if(_0x5240e['type']!==_0x943a('0x3a')){var _0x426a1d={};_0x426a1d[_0x5240e[_0x943a('0x27')]]={'$like':'%'+_0x3fa316[_0x943a('0x2e')][_0x943a('0x39')]+'%'};return _0x426a1d;}})});}_0x1deead=_['merge']({},_0x1deead,_0x3fa316[_0x943a('0x3b')]);var _0x36f7ee={'where':_0x1deead['where']};return db[_0x943a('0x2b')][_0x943a('0x1e')](_0x36f7ee)[_0x943a('0x24')](function(_0x4e47bd){_0x4b0a50['count']=_0x4e47bd;if(_0x3fa316[_0x943a('0x2e')][_0x943a('0x3c')]){_0x1deead[_0x943a('0x3d')]=[{'all':!![]}];}return db[_0x943a('0x2b')][_0x943a('0x3e')](_0x1deead);})[_0x943a('0x24')](function(_0x56ca77){_0x4b0a50[_0x943a('0x3f')]=_0x56ca77;return _0x4b0a50;})[_0x943a('0x24')](respondWithFilteredResult(_0x41840a,_0x1deead))[_0x943a('0x40')](handleError(_0x41840a,null));};exports[_0x943a('0x41')]=function(_0xb6d0db,_0x1884ed){var _0x3b8f80={'raw':!![],'where':{'id':_0xb6d0db[_0x943a('0x42')]['id']}},_0xf5338={};_0xf5338[_0x943a('0x2d')]=_[_0x943a('0x43')](db['MailTransferReport'][_0x943a('0x44')]);_0xf5338[_0x943a('0x2e')]=_[_0x943a('0x43')](_0xb6d0db['query']);_0xf5338[_0x943a('0x2f')]=_['intersection'](_0xf5338[_0x943a('0x2d')],_0xf5338[_0x943a('0x2e')]);_0x3b8f80[_0x943a('0x31')]=_[_0x943a('0x30')](_0xf5338['model'],qs[_0x943a('0x32')](_0xb6d0db[_0x943a('0x2e')][_0x943a('0x32')]));_0x3b8f80[_0x943a('0x31')]=_0x3b8f80[_0x943a('0x31')]['length']?_0x3b8f80['attributes']:_0xf5338[_0x943a('0x2d')];if(_0xb6d0db['query'][_0x943a('0x3c')]){_0x3b8f80[_0x943a('0x3d')]=[{'all':!![]}];}_0x3b8f80=_[_0x943a('0x45')]({},_0x3b8f80,_0xb6d0db[_0x943a('0x3b')]);return db[_0x943a('0x2b')][_0x943a('0x46')](_0x3b8f80)[_0x943a('0x24')](handleEntityNotFound(_0x1884ed,null))[_0x943a('0x24')](respondWithResult(_0x1884ed,null))[_0x943a('0x40')](handleError(_0x1884ed,null));};exports[_0x943a('0x47')]=function(_0x520b31,_0x110c91){return db['MailTransferReport']['create'](_0x520b31['body'],{})['then'](respondWithResult(_0x110c91,0xc9))[_0x943a('0x40')](handleError(_0x110c91,null));};exports['update']=function(_0x23869f,_0x3d9c96){if(_0x23869f[_0x943a('0x48')]['id']){delete _0x23869f['body']['id'];}return db[_0x943a('0x2b')][_0x943a('0x46')]({'where':{'id':_0x23869f[_0x943a('0x42')]['id']}})[_0x943a('0x24')](handleEntityNotFound(_0x3d9c96,null))[_0x943a('0x24')](saveUpdates(_0x23869f[_0x943a('0x48')],null))[_0x943a('0x24')](respondWithResult(_0x3d9c96,null))[_0x943a('0x40')](handleError(_0x3d9c96,null));};exports[_0x943a('0x49')]=function(_0x375675,_0x59c39c){return db['MailTransferReport'][_0x943a('0x46')]({'where':{'id':_0x375675[_0x943a('0x42')]['id']}})[_0x943a('0x24')](handleEntityNotFound(_0x59c39c,null))[_0x943a('0x24')](removeEntity(_0x59c39c,null))[_0x943a('0x40')](handleError(_0x59c39c,null));};exports[_0x943a('0x4a')]=function(_0x427220,_0x52db49){return db[_0x943a('0x2b')][_0x943a('0x4a')]()[_0x943a('0x24')](respondWithResult(_0x52db49,null))[_0x943a('0x40')](handleError(_0x52db49,null));}; \ No newline at end of file +var _0x90cb=['model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','MailTransferReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x90cb,0x141));var _0xb90c=function(_0x33c8cb,_0x56cff2){_0x33c8cb=_0x33c8cb-0x0;var _0x2d28bb=_0x90cb[_0x33c8cb];return _0x2d28bb;};'use strict';var emlformat=require(_0xb90c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb90c('0x1'));var jsonpatch=require(_0xb90c('0x2'));var rp=require(_0xb90c('0x3'));var moment=require('moment');var BPromise=require(_0xb90c('0x4'));var Mustache=require(_0xb90c('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb90c('0x6'));var csv=require('to-csv');var ejs=require(_0xb90c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb90c('0x8'));var squel=require(_0xb90c('0x9'));var crypto=require(_0xb90c('0xa'));var jsforce=require(_0xb90c('0xb'));var deskjs=require(_0xb90c('0xc'));var toCsv=require(_0xb90c('0xd'));var querystring=require('querystring');var Papa=require(_0xb90c('0xe'));var Redis=require('ioredis');var authService=require(_0xb90c('0xf'));var qs=require(_0xb90c('0x10'));var as=require(_0xb90c('0x11'));var hardwareService=require(_0xb90c('0x12'));var logger=require(_0xb90c('0x13'))(_0xb90c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb90c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20ded7,_0x230d75){_0x230d75=_0x230d75||0xcc;return function(_0x38b72f){if(_0x38b72f){return _0x20ded7['sendStatus'](_0x230d75);}return _0x20ded7[_0xb90c('0x16')](_0x230d75)[_0xb90c('0x17')]();};}function respondWithResult(_0x56dce2,_0x35b76d){_0x35b76d=_0x35b76d||0xc8;return function(_0x3bc5a8){if(_0x3bc5a8){return _0x56dce2['status'](_0x35b76d)[_0xb90c('0x18')](_0x3bc5a8);}};}function respondWithFilteredResult(_0x2f85d8,_0x257375){return function(_0x268912){if(_0x268912){var _0x562a8b=typeof _0x257375[_0xb90c('0x19')]===_0xb90c('0x1a')&&typeof _0x257375[_0xb90c('0x1b')]===_0xb90c('0x1a');var _0x43814a=_0x268912[_0xb90c('0x1c')];var _0x230af6=_0x562a8b?0x0:_0x257375[_0xb90c('0x19')];var _0x223dc4=_0x562a8b?_0x268912[_0xb90c('0x1c')]:_0x257375['offset']+_0x257375[_0xb90c('0x1b')];var _0x7f4fc;if(_0x223dc4>=_0x43814a){_0x223dc4=_0x43814a;_0x7f4fc=0xc8;}else{_0x7f4fc=0xce;}_0x2f85d8['status'](_0x7f4fc);return _0x2f85d8[_0xb90c('0x1d')](_0xb90c('0x1e'),_0x230af6+'-'+_0x223dc4+'/'+_0x43814a)[_0xb90c('0x18')](_0x268912);}return null;};}function patchUpdates(_0x2cce0e){return function(_0xb3f16b){try{jsonpatch[_0xb90c('0x1f')](_0xb3f16b,_0x2cce0e,!![]);}catch(_0x222854){return BPromise[_0xb90c('0x20')](_0x222854);}return _0xb3f16b[_0xb90c('0x21')]();};}function saveUpdates(_0x5ed0a9,_0x1d6925){return function(_0x21a2b9){if(_0x21a2b9){return _0x21a2b9[_0xb90c('0x22')](_0x5ed0a9)[_0xb90c('0x23')](function(_0x528f2d){return _0x528f2d;});}return null;};}function removeEntity(_0x1555e9,_0x21a552){return function(_0x2619dd){if(_0x2619dd){return _0x2619dd[_0xb90c('0x24')]()[_0xb90c('0x23')](function(){_0x1555e9[_0xb90c('0x16')](0xcc)[_0xb90c('0x17')]();});}};}function handleEntityNotFound(_0x1337b3,_0x30523b){return function(_0x5274da){if(!_0x5274da){_0x1337b3['sendStatus'](0x194);}return _0x5274da;};}function handleError(_0x23d1c6,_0x48f903){_0x48f903=_0x48f903||0x1f4;return function(_0x505313){logger[_0xb90c('0x25')](_0x505313['stack']);if(_0x505313[_0xb90c('0x26')]){delete _0x505313[_0xb90c('0x26')];}_0x23d1c6[_0xb90c('0x16')](_0x48f903)[_0xb90c('0x27')](_0x505313);};}exports['index']=function(_0x2c18bd,_0x103875){var _0x140ecf={},_0x4ebcc0={},_0x2b9197={'count':0x0,'rows':[]};var _0x414306=_[_0xb90c('0x28')](db['MailTransferReport'][_0xb90c('0x29')],function(_0x54cab7){return{'name':_0x54cab7[_0xb90c('0x2a')],'type':_0x54cab7[_0xb90c('0x2b')]['key']};});_0x4ebcc0[_0xb90c('0x2c')]=_[_0xb90c('0x28')](_0x414306,_0xb90c('0x26'));_0x4ebcc0[_0xb90c('0x2d')]=_['keys'](_0x2c18bd[_0xb90c('0x2d')]);_0x4ebcc0[_0xb90c('0x2e')]=_['intersection'](_0x4ebcc0[_0xb90c('0x2c')],_0x4ebcc0['query']);_0x140ecf[_0xb90c('0x2f')]=_[_0xb90c('0x30')](_0x4ebcc0[_0xb90c('0x2c')],qs[_0xb90c('0x31')](_0x2c18bd[_0xb90c('0x2d')]['fields']));_0x140ecf['attributes']=_0x140ecf[_0xb90c('0x2f')][_0xb90c('0x32')]?_0x140ecf[_0xb90c('0x2f')]:_0x4ebcc0[_0xb90c('0x2c')];if(!_0x2c18bd[_0xb90c('0x2d')]['hasOwnProperty'](_0xb90c('0x33'))){_0x140ecf[_0xb90c('0x1b')]=qs[_0xb90c('0x1b')](_0x2c18bd[_0xb90c('0x2d')][_0xb90c('0x1b')]);_0x140ecf[_0xb90c('0x19')]=qs[_0xb90c('0x19')](_0x2c18bd[_0xb90c('0x2d')][_0xb90c('0x19')]);}_0x140ecf[_0xb90c('0x34')]=qs['sort'](_0x2c18bd[_0xb90c('0x2d')][_0xb90c('0x35')]);_0x140ecf['where']=qs['filters'](_[_0xb90c('0x36')](_0x2c18bd['query'],_0x4ebcc0[_0xb90c('0x2e')]),_0x414306);if(_0x2c18bd[_0xb90c('0x2d')][_0xb90c('0x37')]){_0x140ecf[_0xb90c('0x38')]=_[_0xb90c('0x39')](_0x140ecf[_0xb90c('0x38')],{'$or':_[_0xb90c('0x28')](_0x414306,function(_0xa2fed6){if(_0xa2fed6[_0xb90c('0x2b')]!==_0xb90c('0x3a')){var _0x13202b={};_0x13202b[_0xa2fed6[_0xb90c('0x26')]]={'$like':'%'+_0x2c18bd[_0xb90c('0x2d')]['filter']+'%'};return _0x13202b;}})});}_0x140ecf=_[_0xb90c('0x39')]({},_0x140ecf,_0x2c18bd[_0xb90c('0x3b')]);var _0x5ef811={'where':_0x140ecf[_0xb90c('0x38')]};return db[_0xb90c('0x3c')][_0xb90c('0x1c')](_0x5ef811)['then'](function(_0x414ae6){_0x2b9197['count']=_0x414ae6;if(_0x2c18bd[_0xb90c('0x2d')][_0xb90c('0x3d')]){_0x140ecf[_0xb90c('0x3e')]=[{'all':!![]}];}return db[_0xb90c('0x3c')][_0xb90c('0x3f')](_0x140ecf);})[_0xb90c('0x23')](function(_0x1ac011){_0x2b9197[_0xb90c('0x40')]=_0x1ac011;return _0x2b9197;})[_0xb90c('0x23')](respondWithFilteredResult(_0x103875,_0x140ecf))[_0xb90c('0x41')](handleError(_0x103875,null));};exports[_0xb90c('0x42')]=function(_0x22028d,_0x1eb999){var _0x147186={'raw':!![],'where':{'id':_0x22028d[_0xb90c('0x43')]['id']}},_0x5e6608={};_0x5e6608[_0xb90c('0x2c')]=_[_0xb90c('0x44')](db[_0xb90c('0x3c')][_0xb90c('0x29')]);_0x5e6608[_0xb90c('0x2d')]=_[_0xb90c('0x44')](_0x22028d[_0xb90c('0x2d')]);_0x5e6608[_0xb90c('0x2e')]=_['intersection'](_0x5e6608[_0xb90c('0x2c')],_0x5e6608[_0xb90c('0x2d')]);_0x147186['attributes']=_[_0xb90c('0x30')](_0x5e6608[_0xb90c('0x2c')],qs[_0xb90c('0x31')](_0x22028d['query'][_0xb90c('0x31')]));_0x147186[_0xb90c('0x2f')]=_0x147186[_0xb90c('0x2f')]['length']?_0x147186[_0xb90c('0x2f')]:_0x5e6608[_0xb90c('0x2c')];if(_0x22028d[_0xb90c('0x2d')]['includeAll']){_0x147186[_0xb90c('0x3e')]=[{'all':!![]}];}_0x147186=_[_0xb90c('0x39')]({},_0x147186,_0x22028d[_0xb90c('0x3b')]);return db[_0xb90c('0x3c')][_0xb90c('0x45')](_0x147186)[_0xb90c('0x23')](handleEntityNotFound(_0x1eb999,null))[_0xb90c('0x23')](respondWithResult(_0x1eb999,null))[_0xb90c('0x41')](handleError(_0x1eb999,null));};exports[_0xb90c('0x46')]=function(_0x10e58a,_0x520573){return db[_0xb90c('0x3c')][_0xb90c('0x46')](_0x10e58a[_0xb90c('0x47')],{})[_0xb90c('0x23')](respondWithResult(_0x520573,0xc9))[_0xb90c('0x41')](handleError(_0x520573,null));};exports['update']=function(_0x5a45ce,_0x4960c0){if(_0x5a45ce[_0xb90c('0x47')]['id']){delete _0x5a45ce[_0xb90c('0x47')]['id'];}return db['MailTransferReport'][_0xb90c('0x45')]({'where':{'id':_0x5a45ce[_0xb90c('0x43')]['id']}})['then'](handleEntityNotFound(_0x4960c0,null))['then'](saveUpdates(_0x5a45ce['body'],null))[_0xb90c('0x23')](respondWithResult(_0x4960c0,null))['catch'](handleError(_0x4960c0,null));};exports[_0xb90c('0x24')]=function(_0x3dc8a9,_0x1491ec){return db[_0xb90c('0x3c')][_0xb90c('0x45')]({'where':{'id':_0x3dc8a9[_0xb90c('0x43')]['id']}})['then'](handleEntityNotFound(_0x1491ec,null))[_0xb90c('0x23')](removeEntity(_0x1491ec,null))[_0xb90c('0x41')](handleError(_0x1491ec,null));};exports[_0xb90c('0x48')]=function(_0x2ee113,_0x468ac1){return db[_0xb90c('0x3c')]['describe']()[_0xb90c('0x23')](respondWithResult(_0x468ac1,null))[_0xb90c('0x41')](handleError(_0x468ac1,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 62d5e1b..f0ef574 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 _0x34aa=['exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0x1764fd,_0x256895){var _0x13189e=function(_0x31d1a4){while(--_0x31d1a4){_0x1764fd['push'](_0x1764fd['shift']());}};_0x13189e(++_0x256895);}(_0x34aa,0x171));var _0xa34a=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x34aa[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0xa34a('0x0'));var util=require('util');var logger=require(_0xa34a('0x1'))(_0xa34a('0x2'));var moment=require(_0xa34a('0x3'));var BPromise=require(_0xa34a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa34a('0x5'));var rimraf=require(_0xa34a('0x6'));var config=require(_0xa34a('0x7'));var attributes=require(_0xa34a('0x8'));module[_0xa34a('0x9')]=function(_0x475f8f,_0x27349c){return _0x475f8f[_0xa34a('0xa')](_0xa34a('0xb'),attributes,{'tableName':_0xa34a('0xc'),'paranoid':![],'indexes':[{'name':_0xa34a('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe57d=['../../config/logger','api','request-promise','path','rimraf','./mailTransferReport.attributes','define','uniqueid','lodash'];(function(_0x2bf9fc,_0x41da49){var _0x5d702a=function(_0x2811c0){while(--_0x2811c0){_0x2bf9fc['push'](_0x2bf9fc['shift']());}};_0x5d702a(++_0x41da49);}(_0xe57d,0xd7));var _0xde57=function(_0x2ba740,_0x62a305){_0x2ba740=_0x2ba740-0x0;var _0x358bda=_0xe57d[_0x2ba740];return _0x358bda;};'use strict';var _=require(_0xde57('0x0'));var util=require('util');var logger=require(_0xde57('0x1'))(_0xde57('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xde57('0x3'));var fs=require('fs');var path=require(_0xde57('0x4'));var rimraf=require(_0xde57('0x5'));var config=require('../../config/environment');var attributes=require(_0xde57('0x6'));module['exports']=function(_0x3aae1b,_0x3ddf39){return _0x3aae1b[_0xde57('0x7')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xde57('0x8'),'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 de58472..3b60974 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 _0x8b9e=['error','code','message','info','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xf44d98,_0x12a472){var _0x5ebb04=function(_0x930c33){while(--_0x930c33){_0xf44d98['push'](_0xf44d98['shift']());}};_0x5ebb04(++_0x12a472);}(_0x8b9e,0x6f));var _0xe8b9=function(_0x300491,_0x19e47c){_0x300491=_0x300491-0x0;var _0x1cfba8=_0x8b9e[_0x300491];return _0x1cfba8;};'use strict';var _=require(_0xe8b9('0x0'));var util=require(_0xe8b9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe8b9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8b9('0x3'))['db'];var utils=require(_0xe8b9('0x4'));var logger=require('../../config/logger')(_0xe8b9('0x5'));var config=require(_0xe8b9('0x6'));var jayson=require(_0xe8b9('0x7'));var client=jayson[_0xe8b9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x153c37,_0x4918b9,_0x392a58){return new BPromise(function(_0xa81853,_0x47bfff){return client['request'](_0x153c37,_0x392a58)[_0xe8b9('0x9')](function(_0x512571){logger['info'](_0xe8b9('0xa'),_0x4918b9,_0xe8b9('0xb'));logger[_0xe8b9('0xc')](_0xe8b9('0xd'),_0x4918b9,_0xe8b9('0xb'),JSON[_0xe8b9('0xe')](_0x512571));if(_0x512571['error']){if(_0x512571[_0xe8b9('0xf')][_0xe8b9('0x10')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x4918b9,_0x512571[_0xe8b9('0xf')][_0xe8b9('0x11')]);return _0x47bfff(_0x512571[_0xe8b9('0xf')][_0xe8b9('0x11')]);}logger[_0xe8b9('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x4918b9,_0x512571[_0xe8b9('0xf')][_0xe8b9('0x11')]);return _0xa81853(_0x512571[_0xe8b9('0xf')][_0xe8b9('0x11')]);}else{logger[_0xe8b9('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x4918b9,_0xe8b9('0xb'));_0xa81853(_0x512571[_0xe8b9('0x13')][_0xe8b9('0x11')]);}})[_0xe8b9('0x14')](function(_0xff666e){logger[_0xe8b9('0xf')](_0xe8b9('0xa'),_0x4918b9,_0xff666e);_0x47bfff(_0xff666e);});});} \ No newline at end of file +var _0x3397=['request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x3397,0xe3));var _0x7339=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0x3397[_0x1a0ef3];return _0x2b86da;};'use strict';var _=require(_0x7339('0x0'));var util=require(_0x7339('0x1'));var moment=require('moment');var BPromise=require(_0x7339('0x2'));var rs=require(_0x7339('0x3'));var fs=require('fs');var Redis=require(_0x7339('0x4'));var db=require(_0x7339('0x5'))['db'];var utils=require(_0x7339('0x6'));var logger=require(_0x7339('0x7'))(_0x7339('0x8'));var config=require(_0x7339('0x9'));var jayson=require(_0x7339('0xa'));var client=jayson[_0x7339('0xb')][_0x7339('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51d200,_0x399f07,_0x4d2f8e){return new BPromise(function(_0x536914,_0x517967){return client[_0x7339('0xd')](_0x51d200,_0x4d2f8e)[_0x7339('0xe')](function(_0x125289){logger[_0x7339('0xf')](_0x7339('0x10'),_0x399f07,_0x7339('0x11'));logger[_0x7339('0x12')](_0x7339('0x13'),_0x399f07,_0x7339('0x11'),JSON[_0x7339('0x14')](_0x125289));if(_0x125289[_0x7339('0x15')]){if(_0x125289[_0x7339('0x15')]['code']===0x1f4){logger[_0x7339('0x15')]('MailTransferReport,\x20%s,\x20%s',_0x399f07,_0x125289[_0x7339('0x15')][_0x7339('0x16')]);return _0x517967(_0x125289['error'][_0x7339('0x16')]);}logger['error'](_0x7339('0x10'),_0x399f07,_0x125289['error']['message']);return _0x536914(_0x125289[_0x7339('0x15')]['message']);}else{logger[_0x7339('0xf')](_0x7339('0x10'),_0x399f07,'request\x20sent');_0x536914(_0x125289[_0x7339('0x17')][_0x7339('0x16')]);}})['catch'](function(_0x496548){logger['error'](_0x7339('0x10'),_0x399f07,_0x496548);_0x517967(_0x496548);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index b045b15..5d40145 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 _0x9e43=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5679b8,_0x129b77){var _0x3f4434=function(_0x2831ff){while(--_0x2831ff){_0x5679b8['push'](_0x5679b8['shift']());}};_0x3f4434(++_0x129b77);}(_0x9e43,0x8a));var _0x39e4=function(_0x138676,_0x27a8d5){_0x138676=_0x138676-0x0;var _0xf72f74=_0x9e43[_0x138676];return _0xf72f74;};'use strict';var multer=require(_0x39e4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x39e4('0x1'));var express=require(_0x39e4('0x2'));var router=express[_0x39e4('0x3')]();var fs_extra=require(_0x39e4('0x4'));var auth=require(_0x39e4('0x5'));var interaction=require(_0x39e4('0x6'));var config=require(_0x39e4('0x7'));var controller=require('./memberReport.controller');router[_0x39e4('0x8')]('/',auth[_0x39e4('0x9')](),controller[_0x39e4('0xa')]);router[_0x39e4('0x8')]('/describe',auth[_0x39e4('0x9')](),controller['describe']);router[_0x39e4('0x8')](_0x39e4('0xb'),auth['isAuthenticated'](),controller[_0x39e4('0xc')]);router[_0x39e4('0xd')]('/',auth[_0x39e4('0x9')](),controller[_0x39e4('0xe')]);router[_0x39e4('0xf')](_0x39e4('0xb'),auth[_0x39e4('0x9')](),controller[_0x39e4('0x10')]);router['delete'](_0x39e4('0xb'),auth[_0x39e4('0x9')](),controller['destroy']);module[_0x39e4('0x11')]=router; \ No newline at end of file +var _0xe954=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','multer','util','express','Router','fs-extra'];(function(_0x13ee11,_0x129ca5){var _0xfe3915=function(_0x11b6c6){while(--_0x11b6c6){_0x13ee11['push'](_0x13ee11['shift']());}};_0xfe3915(++_0x129ca5);}(_0xe954,0xc7));var _0x4e95=function(_0x4d5f76,_0x11295c){_0x4d5f76=_0x4d5f76-0x0;var _0xb1e4a4=_0xe954[_0x4d5f76];return _0xb1e4a4;};'use strict';var multer=require(_0x4e95('0x0'));var util=require(_0x4e95('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4e95('0x2'));var router=express[_0x4e95('0x3')]();var fs_extra=require(_0x4e95('0x4'));var auth=require(_0x4e95('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4e95('0x6'));var controller=require('./memberReport.controller');router['get']('/',auth[_0x4e95('0x7')](),controller[_0x4e95('0x8')]);router[_0x4e95('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x4e95('0x9')](_0x4e95('0xa'),auth[_0x4e95('0x7')](),controller[_0x4e95('0xb')]);router[_0x4e95('0xc')]('/',auth[_0x4e95('0x7')](),controller[_0x4e95('0xd')]);router[_0x4e95('0xe')](_0x4e95('0xa'),auth[_0x4e95('0x7')](),controller['update']);router[_0x4e95('0xf')](_0x4e95('0xa'),auth[_0x4e95('0x7')](),controller[_0x4e95('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index f732e3f..323dbda 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 _0x1ac7=['duration','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt'];(function(_0x151381,_0x97b314){var _0x2afab6=function(_0x4b3941){while(--_0x4b3941){_0x151381['push'](_0x151381['shift']());}};_0x2afab6(++_0x97b314);}(_0x1ac7,0x7c));var _0x71ac=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x1ac7[_0xd09668];return _0x68726;};'use strict';var Sequelize=require(_0x71ac('0x0'));var moment=require(_0x71ac('0x1'));module['exports']={'channel':{'type':Sequelize[_0x71ac('0x2')]},'membername':{'type':Sequelize[_0x71ac('0x2')]},'interface':{'type':Sequelize[_0x71ac('0x2')]},'type':{'type':Sequelize[_0x71ac('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x71ac('0x3')},'duration':{'type':Sequelize[_0x71ac('0x4')]},'enterAt':{'type':Sequelize[_0x71ac('0x5')]},'exitAt':{'type':Sequelize[_0x71ac('0x5')],'set':function(_0x86a043){var _0xded3ca=moment(_0x86a043);var _0x5c58d2=moment(this[_0x71ac('0x6')](_0x71ac('0x7')));var _0xd8058b=_0xded3ca['diff'](_0x5c58d2,_0x71ac('0x8'));this[_0x71ac('0x9')](_0x71ac('0xa'),_0x86a043);this[_0x71ac('0x9')](_0x71ac('0xb'),_0xd8058b>=0x0?_0xd8058b:null);}},'data1':{'type':Sequelize[_0x71ac('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x71ac('0x2')],'comment':_0x71ac('0xc')},'data3':{'type':Sequelize[_0x71ac('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x71ac('0x2')],'comment':_0x71ac('0xd')},'data5':{'type':Sequelize[_0x71ac('0x2')],'comment':_0x71ac('0xe')},'role':{'type':Sequelize[_0x71ac('0x2')]},'internal':{'type':Sequelize[_0x71ac('0x4')]},'uniqueid':{'type':Sequelize[_0x71ac('0x2')]}}; \ No newline at end of file +var _0x2aa9=['getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x2aa9,0x1c0));var _0x92aa=function(_0x548af0,_0x2f9fd8){_0x548af0=_0x548af0-0x0;var _0x595aeb=_0x2aa9[_0x548af0];return _0x595aeb;};'use strict';var Sequelize=require(_0x92aa('0x0'));var moment=require(_0x92aa('0x1'));module[_0x92aa('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x92aa('0x3')]},'type':{'type':Sequelize[_0x92aa('0x3')],'defaultValue':_0x92aa('0x4'),'comment':_0x92aa('0x5')},'duration':{'type':Sequelize[_0x92aa('0x6')]},'enterAt':{'type':Sequelize[_0x92aa('0x7')]},'exitAt':{'type':Sequelize[_0x92aa('0x7')],'set':function(_0x17e2f2){var _0x2e7781=moment(_0x17e2f2);var _0x4125af=moment(this[_0x92aa('0x8')](_0x92aa('0x9')));var _0x12860b=_0x2e7781[_0x92aa('0xa')](_0x4125af,_0x92aa('0xb'));this[_0x92aa('0xc')](_0x92aa('0xd'),_0x17e2f2);this[_0x92aa('0xc')](_0x92aa('0xe'),_0x12860b>=0x0?_0x12860b:null);}},'data1':{'type':Sequelize[_0x92aa('0x3')],'comment':_0x92aa('0xf')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0x92aa('0x10')},'data4':{'type':Sequelize['STRING'],'comment':_0x92aa('0x11')},'data5':{'type':Sequelize[_0x92aa('0x3')],'comment':_0x92aa('0x12')},'role':{'type':Sequelize[_0x92aa('0x3')]},'internal':{'type':Sequelize[_0x92aa('0x6')]},'uniqueid':{'type':Sequelize[_0x92aa('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 07f55b7..1b8a869 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(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x55ca,0x126));var _0xa55c=function(_0x31a8fd,_0x3b069e){_0x31a8fd=_0x31a8fd-0x0;var _0x3c9f87=_0x55ca[_0x31a8fd];return _0x3c9f87;};'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 _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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'];(function(_0x452767,_0x46483b){var _0x3d7508=function(_0x12b9d8){while(--_0x12b9d8){_0x452767['push'](_0x452767['shift']());}};_0x3d7508(++_0x46483b);}(_0x008c,0x188));var _0xc008=function(_0x39c0fe,_0x285b08){_0x39c0fe=_0x39c0fe-0x0;var _0x381a92=_0x008c[_0x39c0fe];return _0x381a92;};'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(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index a3a0229..041b7dc 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 _0xaa3f=['bluebird','request-promise','path','rimraf','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment'];(function(_0x913163,_0x2227b6){var _0x1c7d5c=function(_0x5bade3){while(--_0x5bade3){_0x913163['push'](_0x913163['shift']());}};_0x1c7d5c(++_0x2227b6);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x22912b,_0x3902b7){_0x22912b=_0x22912b-0x0;var _0x59d364=_0xaa3f[_0x22912b];return _0x59d364;};'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('./memberReport.attributes');module[_0xfaa3('0x9')]=function(_0x4bac92,_0x3d09aa){return _0x4bac92[_0xfaa3('0xa')](_0xfaa3('0xb'),attributes,{'tableName':_0xfaa3('0xc'),'paranoid':![],'indexes':[{'name':_0xfaa3('0xd'),'fields':[_0xfaa3('0xe'),_0xfaa3('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x161d=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash'];(function(_0x4266b4,_0x281ed6){var _0x2ac26a=function(_0x5d4460){while(--_0x5d4460){_0x4266b4['push'](_0x4266b4['shift']());}};_0x2ac26a(++_0x281ed6);}(_0x161d,0x65));var _0xd161=function(_0x1b6728,_0x25dd9f){_0x1b6728=_0x1b6728-0x0;var _0x54934f=_0x161d[_0x1b6728];return _0x54934f;};'use strict';var _=require(_0xd161('0x0'));var util=require(_0xd161('0x1'));var logger=require(_0xd161('0x2'))(_0xd161('0x3'));var moment=require(_0xd161('0x4'));var BPromise=require(_0xd161('0x5'));var rp=require(_0xd161('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd161('0x7'));var config=require(_0xd161('0x8'));var attributes=require(_0xd161('0x9'));module[_0xd161('0xa')]=function(_0x1570ae,_0x246f7c){return _0x1570ae[_0xd161('0xb')](_0xd161('0xc'),attributes,{'tableName':_0xd161('0xd'),'paranoid':![],'indexes':[{'name':_0xd161('0xe'),'fields':[_0xd161('0xf'),_0xd161('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 25752e8..b1e88e8 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 _0xc677=['../../config/utils','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','catch','CreateMemberReport','create','body','UpdateMemberReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x208832,_0x9d6d2b){var _0x50269d=function(_0x3d37e3){while(--_0x3d37e3){_0x208832['push'](_0x208832['shift']());}};_0x50269d(++_0x9d6d2b);}(_0xc677,0x16c));var _0x7c67=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc677[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x7c67('0x0'));var moment=require(_0x7c67('0x1'));var BPromise=require(_0x7c67('0x2'));var rs=require(_0x7c67('0x3'));var fs=require('fs');var Redis=require(_0x7c67('0x4'));var db=require(_0x7c67('0x5'))['db'];var utils=require(_0x7c67('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7c67('0x7')][_0x7c67('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57e852,_0x1e916c,_0x5475af){return new BPromise(function(_0x187378,_0x4dd1c0){return client[_0x7c67('0x9')](_0x57e852,_0x5475af)[_0x7c67('0xa')](function(_0x25a118){logger[_0x7c67('0xb')](_0x7c67('0xc'),_0x1e916c,_0x7c67('0xd'));logger[_0x7c67('0xe')](_0x7c67('0xf'),_0x1e916c,_0x7c67('0xd'),JSON[_0x7c67('0x10')](_0x25a118));if(_0x25a118[_0x7c67('0x11')]){if(_0x25a118[_0x7c67('0x11')]['code']===0x1f4){logger[_0x7c67('0x11')](_0x7c67('0xc'),_0x1e916c,_0x25a118[_0x7c67('0x11')]['message']);return _0x4dd1c0(_0x25a118[_0x7c67('0x11')]['message']);}logger['error'](_0x7c67('0xc'),_0x1e916c,_0x25a118[_0x7c67('0x11')][_0x7c67('0x12')]);return _0x187378(_0x25a118[_0x7c67('0x11')][_0x7c67('0x12')]);}else{logger[_0x7c67('0xb')](_0x7c67('0xc'),_0x1e916c,_0x7c67('0xd'));_0x187378(_0x25a118[_0x7c67('0x13')][_0x7c67('0x12')]);}})['catch'](function(_0x47794d){logger[_0x7c67('0x11')](_0x7c67('0xc'),_0x1e916c,_0x47794d);_0x4dd1c0(_0x47794d);});});}exports[_0x7c67('0x14')]=function(_0x35d227){var _0x18de29=this;return new Promise(function(_0x197de0,_0x14d4c2){return db[_0x7c67('0x15')][_0x7c67('0x16')]({'raw':_0x35d227[_0x7c67('0x17')]?_0x35d227[_0x7c67('0x17')][_0x7c67('0x18')]===undefined?!![]:![]:!![],'where':_0x35d227[_0x7c67('0x17')]?_0x35d227[_0x7c67('0x17')][_0x7c67('0x19')]||null:null,'attributes':_0x35d227[_0x7c67('0x17')]?_0x35d227['options'][_0x7c67('0x1a')]||null:null,'limit':_0x35d227['options']?_0x35d227[_0x7c67('0x17')][_0x7c67('0x1b')]||null:null,'include':_0x35d227[_0x7c67('0x17')]?_0x35d227[_0x7c67('0x17')]['include']?_['map'](_0x35d227[_0x7c67('0x17')][_0x7c67('0x1c')],function(_0x42a3d3){return{'model':db[_0x42a3d3['model']],'as':_0x42a3d3['as'],'attributes':_0x42a3d3['attributes'],'include':_0x42a3d3[_0x7c67('0x1c')]?_[_0x7c67('0x1d')](_0x42a3d3[_0x7c67('0x1c')],function(_0x670d50){return{'model':db[_0x670d50[_0x7c67('0x1e')]],'as':_0x670d50['as'],'attributes':_0x670d50[_0x7c67('0x1a')],'include':_0x670d50['include']?_[_0x7c67('0x1d')](_0x670d50[_0x7c67('0x1c')],function(_0x52bc2b){return{'model':db[_0x52bc2b['model']],'as':_0x52bc2b['as'],'attributes':_0x52bc2b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b0c0f){logger['info'](_0x7c67('0x14'),_0x35d227);logger[_0x7c67('0xe')](_0x7c67('0x14'),_0x35d227,JSON[_0x7c67('0x10')](_0x2b0c0f));_0x197de0(_0x2b0c0f);})[_0x7c67('0x1f')](function(_0x51b48f){logger[_0x7c67('0x11')](_0x7c67('0x14'),_0x51b48f[_0x7c67('0x12')],_0x35d227);_0x14d4c2(_0x18de29['error'](0x1f4,_0x51b48f[_0x7c67('0x12')]));});});};exports[_0x7c67('0x20')]=function(_0x556535){var _0x322d21=this;return new Promise(function(_0x22679b,_0x5bbbc7){return db['MemberReport'][_0x7c67('0x21')](_0x556535[_0x7c67('0x22')],{'raw':_0x556535[_0x7c67('0x17')]?_0x556535[_0x7c67('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x42c5f5){logger[_0x7c67('0xb')](_0x7c67('0x20'),_0x556535);logger['debug'](_0x7c67('0x20'),_0x556535,JSON[_0x7c67('0x10')](_0x42c5f5));_0x22679b(_0x42c5f5);})['catch'](function(_0x31939d){logger[_0x7c67('0x11')](_0x7c67('0x20'),_0x31939d['message'],_0x556535);_0x5bbbc7(_0x322d21[_0x7c67('0x11')](0x1f4,_0x31939d[_0x7c67('0x12')]));});});};exports[_0x7c67('0x23')]=function(_0x1b11b8){var _0x1db6e4=this;return new Promise(function(_0x30cd84,_0x5244e1){return db[_0x7c67('0x15')][_0x7c67('0x24')](_0x1b11b8['body'],{'raw':_0x1b11b8[_0x7c67('0x17')]?_0x1b11b8['options'][_0x7c67('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b11b8[_0x7c67('0x17')]?_0x1b11b8['options'][_0x7c67('0x19')]||null:null,'attributes':_0x1b11b8[_0x7c67('0x17')]?_0x1b11b8[_0x7c67('0x17')]['attributes']||null:null,'limit':_0x1b11b8['options']?_0x1b11b8[_0x7c67('0x17')]['limit']||null:null})[_0x7c67('0xa')](function(_0x5728e5){logger[_0x7c67('0xb')]('UpdateMemberReport',_0x1b11b8);logger[_0x7c67('0xe')](_0x7c67('0x23'),_0x1b11b8,JSON[_0x7c67('0x10')](_0x5728e5));_0x30cd84(_0x5728e5);})['catch'](function(_0x30c0aa){logger[_0x7c67('0x11')]('UpdateMemberReport',_0x30c0aa[_0x7c67('0x12')],_0x1b11b8);_0x5244e1(_0x1db6e4['error'](0x1f4,_0x30c0aa[_0x7c67('0x12')]));});});}; \ No newline at end of file +var _0xb242=['message','catch','GetMemberReport','MemberReport','findAll','raw','options','where','attributes','model','include','map','CreateMemberReport','create','body','UpdateMemberReport','update','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','MemberReport,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb242,0x1f3));var _0x2b24=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb242[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x2b24('0x0'));var moment=require(_0x2b24('0x1'));var BPromise=require(_0x2b24('0x2'));var rs=require(_0x2b24('0x3'));var fs=require('fs');var Redis=require(_0x2b24('0x4'));var db=require(_0x2b24('0x5'))['db'];var utils=require(_0x2b24('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2b24('0x7'));var jayson=require(_0x2b24('0x8'));var client=jayson['client'][_0x2b24('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x477e45,_0x179d9a,_0x53345b){return new BPromise(function(_0x475271,_0x56c14a){return client[_0x2b24('0xa')](_0x477e45,_0x53345b)[_0x2b24('0xb')](function(_0x529939){logger[_0x2b24('0xc')]('MemberReport,\x20%s,\x20%s',_0x179d9a,_0x2b24('0xd'));logger[_0x2b24('0xe')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x179d9a,'request\x20sent',JSON[_0x2b24('0xf')](_0x529939));if(_0x529939['error']){if(_0x529939[_0x2b24('0x10')][_0x2b24('0x11')]===0x1f4){logger[_0x2b24('0x10')](_0x2b24('0x12'),_0x179d9a,_0x529939['error']['message']);return _0x56c14a(_0x529939[_0x2b24('0x10')][_0x2b24('0x13')]);}logger[_0x2b24('0x10')](_0x2b24('0x12'),_0x179d9a,_0x529939[_0x2b24('0x10')]['message']);return _0x475271(_0x529939[_0x2b24('0x10')][_0x2b24('0x13')]);}else{logger['info'](_0x2b24('0x12'),_0x179d9a,_0x2b24('0xd'));_0x475271(_0x529939['result'][_0x2b24('0x13')]);}})[_0x2b24('0x14')](function(_0x2fdc73){logger[_0x2b24('0x10')]('MemberReport,\x20%s,\x20%s',_0x179d9a,_0x2fdc73);_0x56c14a(_0x2fdc73);});});}exports[_0x2b24('0x15')]=function(_0x2815dc){var _0x135261=this;return new Promise(function(_0x4951af,_0x1eb73f){return db[_0x2b24('0x16')][_0x2b24('0x17')]({'raw':_0x2815dc['options']?_0x2815dc['options'][_0x2b24('0x18')]===undefined?!![]:![]:!![],'where':_0x2815dc[_0x2b24('0x19')]?_0x2815dc[_0x2b24('0x19')][_0x2b24('0x1a')]||null:null,'attributes':_0x2815dc['options']?_0x2815dc[_0x2b24('0x19')][_0x2b24('0x1b')]||null:null,'limit':_0x2815dc[_0x2b24('0x19')]?_0x2815dc[_0x2b24('0x19')]['limit']||null:null,'include':_0x2815dc['options']?_0x2815dc[_0x2b24('0x19')]['include']?_['map'](_0x2815dc['options']['include'],function(_0x2acfcf){return{'model':db[_0x2acfcf[_0x2b24('0x1c')]],'as':_0x2acfcf['as'],'attributes':_0x2acfcf[_0x2b24('0x1b')],'include':_0x2acfcf[_0x2b24('0x1d')]?_['map'](_0x2acfcf['include'],function(_0x4d25e4){return{'model':db[_0x4d25e4[_0x2b24('0x1c')]],'as':_0x4d25e4['as'],'attributes':_0x4d25e4[_0x2b24('0x1b')],'include':_0x4d25e4[_0x2b24('0x1d')]?_[_0x2b24('0x1e')](_0x4d25e4['include'],function(_0x5c9efb){return{'model':db[_0x5c9efb[_0x2b24('0x1c')]],'as':_0x5c9efb['as'],'attributes':_0x5c9efb[_0x2b24('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5765b5){logger[_0x2b24('0xc')]('GetMemberReport',_0x2815dc);logger['debug'](_0x2b24('0x15'),_0x2815dc,JSON[_0x2b24('0xf')](_0x5765b5));_0x4951af(_0x5765b5);})[_0x2b24('0x14')](function(_0x3183cd){logger['error'](_0x2b24('0x15'),_0x3183cd['message'],_0x2815dc);_0x1eb73f(_0x135261[_0x2b24('0x10')](0x1f4,_0x3183cd[_0x2b24('0x13')]));});});};exports[_0x2b24('0x1f')]=function(_0x12c529){var _0x316253=this;return new Promise(function(_0x8717e,_0x3ca905){return db[_0x2b24('0x16')][_0x2b24('0x20')](_0x12c529[_0x2b24('0x21')],{'raw':_0x12c529[_0x2b24('0x19')]?_0x12c529['options'][_0x2b24('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x19225d){logger['info'](_0x2b24('0x1f'),_0x12c529);logger[_0x2b24('0xe')]('CreateMemberReport',_0x12c529,JSON[_0x2b24('0xf')](_0x19225d));_0x8717e(_0x19225d);})[_0x2b24('0x14')](function(_0x5a230b){logger[_0x2b24('0x10')](_0x2b24('0x1f'),_0x5a230b[_0x2b24('0x13')],_0x12c529);_0x3ca905(_0x316253['error'](0x1f4,_0x5a230b[_0x2b24('0x13')]));});});};exports[_0x2b24('0x22')]=function(_0x4b8703){var _0x44d10f=this;return new Promise(function(_0x45ddd4,_0x5e6630){return db[_0x2b24('0x16')][_0x2b24('0x23')](_0x4b8703['body'],{'raw':_0x4b8703[_0x2b24('0x19')]?_0x4b8703[_0x2b24('0x19')][_0x2b24('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b8703['options']?_0x4b8703[_0x2b24('0x19')][_0x2b24('0x1a')]||null:null,'attributes':_0x4b8703[_0x2b24('0x19')]?_0x4b8703[_0x2b24('0x19')]['attributes']||null:null,'limit':_0x4b8703[_0x2b24('0x19')]?_0x4b8703[_0x2b24('0x19')][_0x2b24('0x24')]||null:null})[_0x2b24('0xb')](function(_0x3f2491){logger[_0x2b24('0xc')]('UpdateMemberReport',_0x4b8703);logger[_0x2b24('0xe')](_0x2b24('0x22'),_0x4b8703,JSON[_0x2b24('0xf')](_0x3f2491));_0x45ddd4(_0x3f2491);})[_0x2b24('0x14')](function(_0x171cb8){logger['error'](_0x2b24('0x22'),_0x171cb8[_0x2b24('0x13')],_0x4b8703);_0x5e6630(_0x44d10f['error'](0x1f4,_0x171cb8[_0x2b24('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 467531f..f1aed19 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 _0x511a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','multer','util','path','express'];(function(_0x3be426,_0x2df1b5){var _0x4389e1=function(_0x4f1fe3){while(--_0x4f1fe3){_0x3be426['push'](_0x3be426['shift']());}};_0x4389e1(++_0x2df1b5);}(_0x511a,0x101));var _0xa511=function(_0x58c320,_0x2b8dc6){_0x58c320=_0x58c320-0x0;var _0x3c8643=_0x511a[_0x58c320];return _0x3c8643;};'use strict';var multer=require(_0xa511('0x0'));var util=require(_0xa511('0x1'));var path=require(_0xa511('0x2'));var timeout=require('connect-timeout');var express=require(_0xa511('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa511('0x4'));var interaction=require(_0xa511('0x5'));var config=require(_0xa511('0x6'));var controller=require(_0xa511('0x7'));router[_0xa511('0x8')]('/',controller['index']);module['exports']=router; \ No newline at end of file +var _0x9e0d=['fs-extra','../../config/environment','index','multer','util','path','connect-timeout','express'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9e0d,0x12b));var _0xd9e0=function(_0x52efc5,_0x5a1d26){_0x52efc5=_0x52efc5-0x0;var _0xc9e03b=_0x9e0d[_0x52efc5];return _0xc9e03b;};'use strict';var multer=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var path=require(_0xd9e0('0x2'));var timeout=require(_0xd9e0('0x3'));var express=require(_0xd9e0('0x4'));var router=express['Router']();var fs_extra=require(_0xd9e0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd9e0('0x6'));var controller=require('./migration.controller');router['get']('/',controller[_0xd9e0('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 6b89332..fcda30c 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 _0xe8aa=['exports','STRING','sequelize'];(function(_0x5af89d,_0xa40ecd){var _0x44e390=function(_0x296473){while(--_0x296473){_0x5af89d['push'](_0x5af89d['shift']());}};_0x44e390(++_0xa40ecd);}(_0xe8aa,0x191));var _0xae8a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe8aa[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xae8a('0x0'));module[_0xae8a('0x1')]={'version':{'type':Sequelize[_0xae8a('0x2')],'unique':'version'}}; \ No newline at end of file +var _0x0a8b=['version'];(function(_0x3636b4,_0x4cd071){var _0x5a5854=function(_0x23c674){while(--_0x23c674){_0x3636b4['push'](_0x3636b4['shift']());}};_0x5a5854(++_0x4cd071);}(_0x0a8b,0x72));var _0xb0a8=function(_0x1d2968,_0x2200ad){_0x1d2968=_0x1d2968-0x0;var _0x23c555=_0x0a8b[_0x1d2968];return _0x23c555;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0xb0a8('0x0')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 9b43dd5..929db9b 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 _0x1ddd=['query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','Migration','includeAll','include','findAll','catch','eml-format','rimraf','zip-dir','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/logger','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ddd,0x123));var _0xd1dd=function(_0x25bf45,_0x4dee97){_0x25bf45=_0x25bf45-0x0;var _0x2cb681=_0x1ddd[_0x25bf45];return _0x2cb681;};'use strict';var emlformat=require(_0xd1dd('0x0'));var rimraf=require(_0xd1dd('0x1'));var zipdir=require(_0xd1dd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd1dd('0x3'));var BPromise=require(_0xd1dd('0x4'));var Mustache=require('mustache');var util=require(_0xd1dd('0x5'));var path=require(_0xd1dd('0x6'));var sox=require('sox');var csv=require(_0xd1dd('0x7'));var ejs=require(_0xd1dd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd1dd('0x9'));var squel=require(_0xd1dd('0xa'));var crypto=require(_0xd1dd('0xb'));var jsforce=require(_0xd1dd('0xc'));var deskjs=require(_0xd1dd('0xd'));var toCsv=require(_0xd1dd('0x7'));var querystring=require(_0xd1dd('0xe'));var Papa=require(_0xd1dd('0xf'));var Redis=require(_0xd1dd('0x10'));var authService=require(_0xd1dd('0x11'));var qs=require(_0xd1dd('0x12'));var as=require(_0xd1dd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd1dd('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd1dd('0x15'));var licenseUtil=require(_0xd1dd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b71a2,_0x3f7d0c){_0x3f7d0c=_0x3f7d0c||0xcc;return function(_0x149f17){if(_0x149f17){return _0x4b71a2[_0xd1dd('0x17')](_0x3f7d0c);}return _0x4b71a2['status'](_0x3f7d0c)['end']();};}function respondWithResult(_0x589026,_0x1a4513){_0x1a4513=_0x1a4513||0xc8;return function(_0xd583f2){if(_0xd583f2){return _0x589026['status'](_0x1a4513)[_0xd1dd('0x18')](_0xd583f2);}};}function respondWithFilteredResult(_0x5e9460,_0x4fd941){return function(_0x5564ff){if(_0x5564ff){var _0x2e68d6=typeof _0x4fd941[_0xd1dd('0x19')]===_0xd1dd('0x1a')&&typeof _0x4fd941[_0xd1dd('0x1b')]==='undefined';var _0xbf34e9=_0x5564ff[_0xd1dd('0x1c')];var _0x2a3440=_0x2e68d6?0x0:_0x4fd941[_0xd1dd('0x19')];var _0x100a12=_0x2e68d6?_0x5564ff[_0xd1dd('0x1c')]:_0x4fd941[_0xd1dd('0x19')]+_0x4fd941[_0xd1dd('0x1b')];var _0x4f020e;if(_0x100a12>=_0xbf34e9){_0x100a12=_0xbf34e9;_0x4f020e=0xc8;}else{_0x4f020e=0xce;}_0x5e9460[_0xd1dd('0x1d')](_0x4f020e);return _0x5e9460[_0xd1dd('0x1e')](_0xd1dd('0x1f'),_0x2a3440+'-'+_0x100a12+'/'+_0xbf34e9)[_0xd1dd('0x18')](_0x5564ff);}return null;};}function patchUpdates(_0xaab3cb){return function(_0x5c6a90){try{jsonpatch['apply'](_0x5c6a90,_0xaab3cb,!![]);}catch(_0x2b50b5){return BPromise[_0xd1dd('0x20')](_0x2b50b5);}return _0x5c6a90[_0xd1dd('0x21')]();};}function saveUpdates(_0x1319a9,_0x2ecefa){return function(_0x3b8a2f){if(_0x3b8a2f){return _0x3b8a2f['update'](_0x1319a9)[_0xd1dd('0x22')](function(_0x3bcb7e){return _0x3bcb7e;});}return null;};}function removeEntity(_0x1c5c22,_0x538f5a){return function(_0xfe0f25){if(_0xfe0f25){return _0xfe0f25[_0xd1dd('0x23')]()[_0xd1dd('0x22')](function(){_0x1c5c22[_0xd1dd('0x1d')](0xcc)[_0xd1dd('0x24')]();});}};}function handleEntityNotFound(_0x22e2d8,_0x4255e9){return function(_0x2d7dab){if(!_0x2d7dab){_0x22e2d8[_0xd1dd('0x17')](0x194);}return _0x2d7dab;};}function handleError(_0x19fd2c,_0x7bfebe){_0x7bfebe=_0x7bfebe||0x1f4;return function(_0x10122b){logger[_0xd1dd('0x25')](_0x10122b[_0xd1dd('0x26')]);if(_0x10122b['name']){delete _0x10122b[_0xd1dd('0x27')];}_0x19fd2c[_0xd1dd('0x1d')](_0x7bfebe)[_0xd1dd('0x28')](_0x10122b);};}exports['index']=function(_0x10eb07,_0x17c412){var _0x2aa2c5={},_0x5918e8={},_0xf7e0c5={'count':0x0,'rows':[]};var _0x40afbb=_[_0xd1dd('0x29')](db['Migration'][_0xd1dd('0x2a')],function(_0xb3e958){return{'name':_0xb3e958[_0xd1dd('0x2b')],'type':_0xb3e958[_0xd1dd('0x2c')][_0xd1dd('0x2d')]};});_0x5918e8[_0xd1dd('0x2e')]=_[_0xd1dd('0x29')](_0x40afbb,_0xd1dd('0x27'));_0x5918e8['query']=_[_0xd1dd('0x2f')](_0x10eb07['query']);_0x5918e8[_0xd1dd('0x30')]=_['intersection'](_0x5918e8[_0xd1dd('0x2e')],_0x5918e8[_0xd1dd('0x31')]);_0x2aa2c5[_0xd1dd('0x32')]=_[_0xd1dd('0x33')](_0x5918e8[_0xd1dd('0x2e')],qs['fields'](_0x10eb07[_0xd1dd('0x31')][_0xd1dd('0x34')]));_0x2aa2c5['attributes']=_0x2aa2c5[_0xd1dd('0x32')][_0xd1dd('0x35')]?_0x2aa2c5['attributes']:_0x5918e8[_0xd1dd('0x2e')];if(!_0x10eb07['query'][_0xd1dd('0x36')]('nolimit')){_0x2aa2c5[_0xd1dd('0x1b')]=qs['limit'](_0x10eb07[_0xd1dd('0x31')][_0xd1dd('0x1b')]);_0x2aa2c5[_0xd1dd('0x19')]=qs[_0xd1dd('0x19')](_0x10eb07['query']['offset']);}_0x2aa2c5[_0xd1dd('0x37')]=qs['sort'](_0x10eb07[_0xd1dd('0x31')][_0xd1dd('0x38')]);_0x2aa2c5[_0xd1dd('0x39')]=qs[_0xd1dd('0x30')](_[_0xd1dd('0x3a')](_0x10eb07[_0xd1dd('0x31')],_0x5918e8['filters']),_0x40afbb);if(_0x10eb07[_0xd1dd('0x31')][_0xd1dd('0x3b')]){_0x2aa2c5['where']=_['merge'](_0x2aa2c5[_0xd1dd('0x39')],{'$or':_[_0xd1dd('0x29')](_0x40afbb,function(_0x8dbed0){if(_0x8dbed0[_0xd1dd('0x2c')]!==_0xd1dd('0x3c')){var _0x342a2f={};_0x342a2f[_0x8dbed0[_0xd1dd('0x27')]]={'$like':'%'+_0x10eb07[_0xd1dd('0x31')][_0xd1dd('0x3b')]+'%'};return _0x342a2f;}})});}_0x2aa2c5=_[_0xd1dd('0x3d')]({},_0x2aa2c5,_0x10eb07[_0xd1dd('0x3e')]);var _0x23ae33={'where':_0x2aa2c5[_0xd1dd('0x39')]};return db[_0xd1dd('0x3f')]['count'](_0x23ae33)[_0xd1dd('0x22')](function(_0x592376){_0xf7e0c5[_0xd1dd('0x1c')]=_0x592376;if(_0x10eb07['query'][_0xd1dd('0x40')]){_0x2aa2c5[_0xd1dd('0x41')]=[{'all':!![]}];}return db['Migration'][_0xd1dd('0x42')](_0x2aa2c5);})[_0xd1dd('0x22')](function(_0x5324f3){_0xf7e0c5['rows']=_0x5324f3;return _0xf7e0c5;})[_0xd1dd('0x22')](respondWithFilteredResult(_0x17c412,_0x2aa2c5))[_0xd1dd('0x43')](handleError(_0x17c412,null));}; \ No newline at end of file +var _0xabaf=['fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','options','Migration','includeAll','include','catch','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xabaf,0x1c7));var _0xfaba=function(_0x4a91e3,_0x423dcf){_0x4a91e3=_0x4a91e3-0x0;var _0x3e8066=_0xabaf[_0x4a91e3];return _0x3e8066;};'use strict';var emlformat=require(_0xfaba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfaba('0x1'));var jsonpatch=require(_0xfaba('0x2'));var rp=require('request-promise');var moment=require(_0xfaba('0x3'));var BPromise=require(_0xfaba('0x4'));var Mustache=require('mustache');var util=require(_0xfaba('0x5'));var path=require(_0xfaba('0x6'));var sox=require(_0xfaba('0x7'));var csv=require(_0xfaba('0x8'));var ejs=require(_0xfaba('0x9'));var fs=require('fs');var fs_extra=require(_0xfaba('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfaba('0xb'));var deskjs=require(_0xfaba('0xc'));var toCsv=require(_0xfaba('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfaba('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xfaba('0xe'));var as=require(_0xfaba('0xf'));var hardwareService=require(_0xfaba('0x10'));var logger=require(_0xfaba('0x11'))('api');var utils=require(_0xfaba('0x12'));var config=require(_0xfaba('0x13'));var licenseUtil=require(_0xfaba('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x542f81,_0x5023b5){_0x5023b5=_0x5023b5||0xcc;return function(_0x4d6b55){if(_0x4d6b55){return _0x542f81[_0xfaba('0x15')](_0x5023b5);}return _0x542f81[_0xfaba('0x16')](_0x5023b5)['end']();};}function respondWithResult(_0x40910d,_0x1a0aff){_0x1a0aff=_0x1a0aff||0xc8;return function(_0x1c0574){if(_0x1c0574){return _0x40910d[_0xfaba('0x16')](_0x1a0aff)[_0xfaba('0x17')](_0x1c0574);}};}function respondWithFilteredResult(_0x2322b0,_0x146374){return function(_0x10bbb0){if(_0x10bbb0){var _0x26b382=typeof _0x146374[_0xfaba('0x18')]===_0xfaba('0x19')&&typeof _0x146374[_0xfaba('0x1a')]===_0xfaba('0x19');var _0x519575=_0x10bbb0[_0xfaba('0x1b')];var _0x185d35=_0x26b382?0x0:_0x146374[_0xfaba('0x18')];var _0x1a37d8=_0x26b382?_0x10bbb0[_0xfaba('0x1b')]:_0x146374['offset']+_0x146374[_0xfaba('0x1a')];var _0x5bc195;if(_0x1a37d8>=_0x519575){_0x1a37d8=_0x519575;_0x5bc195=0xc8;}else{_0x5bc195=0xce;}_0x2322b0['status'](_0x5bc195);return _0x2322b0[_0xfaba('0x1c')](_0xfaba('0x1d'),_0x185d35+'-'+_0x1a37d8+'/'+_0x519575)[_0xfaba('0x17')](_0x10bbb0);}return null;};}function patchUpdates(_0x2a9d00){return function(_0x35c4fb){try{jsonpatch['apply'](_0x35c4fb,_0x2a9d00,!![]);}catch(_0x224b2f){return BPromise[_0xfaba('0x1e')](_0x224b2f);}return _0x35c4fb[_0xfaba('0x1f')]();};}function saveUpdates(_0x270587,_0x477ecf){return function(_0x4d67cd){if(_0x4d67cd){return _0x4d67cd[_0xfaba('0x20')](_0x270587)[_0xfaba('0x21')](function(_0x368920){return _0x368920;});}return null;};}function removeEntity(_0xd117b0,_0x24a541){return function(_0x42b98d){if(_0x42b98d){return _0x42b98d[_0xfaba('0x22')]()[_0xfaba('0x21')](function(){_0xd117b0[_0xfaba('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x376c0c,_0x44b3b5){return function(_0x5c5830){if(!_0x5c5830){_0x376c0c['sendStatus'](0x194);}return _0x5c5830;};}function handleError(_0x17ee2e,_0x2aa499){_0x2aa499=_0x2aa499||0x1f4;return function(_0x1094f9){logger[_0xfaba('0x23')](_0x1094f9[_0xfaba('0x24')]);if(_0x1094f9['name']){delete _0x1094f9[_0xfaba('0x25')];}_0x17ee2e[_0xfaba('0x16')](_0x2aa499)[_0xfaba('0x26')](_0x1094f9);};}exports[_0xfaba('0x27')]=function(_0x389146,_0x59a0c7){var _0x42dad4={},_0x4188a1={},_0x4d9f4d={'count':0x0,'rows':[]};var _0x5e5e87=_[_0xfaba('0x28')](db['Migration']['rawAttributes'],function(_0x511fdb){return{'name':_0x511fdb[_0xfaba('0x29')],'type':_0x511fdb[_0xfaba('0x2a')][_0xfaba('0x2b')]};});_0x4188a1[_0xfaba('0x2c')]=_['map'](_0x5e5e87,'name');_0x4188a1[_0xfaba('0x2d')]=_['keys'](_0x389146['query']);_0x4188a1[_0xfaba('0x2e')]=_[_0xfaba('0x2f')](_0x4188a1[_0xfaba('0x2c')],_0x4188a1['query']);_0x42dad4[_0xfaba('0x30')]=_[_0xfaba('0x2f')](_0x4188a1[_0xfaba('0x2c')],qs['fields'](_0x389146[_0xfaba('0x2d')][_0xfaba('0x31')]));_0x42dad4[_0xfaba('0x30')]=_0x42dad4[_0xfaba('0x30')][_0xfaba('0x32')]?_0x42dad4[_0xfaba('0x30')]:_0x4188a1[_0xfaba('0x2c')];if(!_0x389146['query'][_0xfaba('0x33')](_0xfaba('0x34'))){_0x42dad4[_0xfaba('0x1a')]=qs['limit'](_0x389146[_0xfaba('0x2d')][_0xfaba('0x1a')]);_0x42dad4['offset']=qs[_0xfaba('0x18')](_0x389146[_0xfaba('0x2d')]['offset']);}_0x42dad4[_0xfaba('0x35')]=qs[_0xfaba('0x36')](_0x389146[_0xfaba('0x2d')][_0xfaba('0x36')]);_0x42dad4[_0xfaba('0x37')]=qs[_0xfaba('0x2e')](_['pick'](_0x389146[_0xfaba('0x2d')],_0x4188a1[_0xfaba('0x2e')]),_0x5e5e87);if(_0x389146[_0xfaba('0x2d')]['filter']){_0x42dad4[_0xfaba('0x37')]=_[_0xfaba('0x38')](_0x42dad4[_0xfaba('0x37')],{'$or':_[_0xfaba('0x28')](_0x5e5e87,function(_0x88d019){if(_0x88d019[_0xfaba('0x2a')]!=='VIRTUAL'){var _0x26569e={};_0x26569e[_0x88d019[_0xfaba('0x25')]]={'$like':'%'+_0x389146['query']['filter']+'%'};return _0x26569e;}})});}_0x42dad4=_[_0xfaba('0x38')]({},_0x42dad4,_0x389146[_0xfaba('0x39')]);var _0x2a828e={'where':_0x42dad4['where']};return db[_0xfaba('0x3a')]['count'](_0x2a828e)['then'](function(_0x13747c){_0x4d9f4d[_0xfaba('0x1b')]=_0x13747c;if(_0x389146[_0xfaba('0x2d')][_0xfaba('0x3b')]){_0x42dad4[_0xfaba('0x3c')]=[{'all':!![]}];}return db[_0xfaba('0x3a')]['findAll'](_0x42dad4);})[_0xfaba('0x21')](function(_0x28ceb5){_0x4d9f4d['rows']=_0x28ceb5;return _0x4d9f4d;})['then'](respondWithFilteredResult(_0x59a0c7,_0x42dad4))[_0xfaba('0x3d')](handleError(_0x59a0c7,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 588dd06..681e302 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 _0x0dba=['migrations','util','../../config/logger','moment','path','rimraf','../../config/environment','exports','define','Migration'];(function(_0x2e2ac8,_0x34c678){var _0x8db4c6=function(_0x5aa209){while(--_0x5aa209){_0x2e2ac8['push'](_0x2e2ac8['shift']());}};_0x8db4c6(++_0x34c678);}(_0x0dba,0x1c3));var _0xa0db=function(_0x3eb6e4,_0x1c1118){_0x3eb6e4=_0x3eb6e4-0x0;var _0x18de10=_0x0dba[_0x3eb6e4];return _0x18de10;};'use strict';var _=require('lodash');var util=require(_0xa0db('0x0'));var logger=require(_0xa0db('0x1'))('api');var moment=require(_0xa0db('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0db('0x3'));var rimraf=require(_0xa0db('0x4'));var config=require(_0xa0db('0x5'));var attributes=require('./migration.attributes');module[_0xa0db('0x6')]=function(_0x48e304,_0x2526e9){return _0x48e304[_0xa0db('0x7')](_0xa0db('0x8'),attributes,{'tableName':_0xa0db('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3758=['bluebird','request-promise','path','rimraf','exports','define','lodash','../../config/logger','api','moment'];(function(_0x5b89d0,_0x13dcf5){var _0xa7ba8f=function(_0x58ed42){while(--_0x58ed42){_0x5b89d0['push'](_0x5b89d0['shift']());}};_0xa7ba8f(++_0x13dcf5);}(_0x3758,0x146));var _0x8375=function(_0x5eafca,_0x5008e2){_0x5eafca=_0x5eafca-0x0;var _0x2b4fa0=_0x3758[_0x5eafca];return _0x2b4fa0;};'use strict';var _=require(_0x8375('0x0'));var util=require('util');var logger=require(_0x8375('0x1'))(_0x8375('0x2'));var moment=require(_0x8375('0x3'));var BPromise=require(_0x8375('0x4'));var rp=require(_0x8375('0x5'));var fs=require('fs');var path=require(_0x8375('0x6'));var rimraf=require(_0x8375('0x7'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0x8375('0x8')]=function(_0x1f4e15,_0x48fd53){return _0x1f4e15[_0x8375('0x9')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 8bbfd57..c7274b2 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 _0xd240=['../../config/logger','rpc','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1c0c2b,_0x1c991c){var _0xaeab08=function(_0x8656e2){while(--_0x8656e2){_0x1c0c2b['push'](_0x1c0c2b['shift']());}};_0xaeab08(++_0x1c991c);}(_0xd240,0x1c7));var _0x0d24=function(_0x56d229,_0x1783af){_0x56d229=_0x56d229-0x0;var _0x3c2e18=_0xd240[_0x56d229];return _0x3c2e18;};'use strict';var _=require('lodash');var util=require(_0x0d24('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0d24('0x1'));var fs=require('fs');var Redis=require(_0x0d24('0x2'));var db=require(_0x0d24('0x3'))['db'];var utils=require(_0x0d24('0x4'));var logger=require(_0x0d24('0x5'))(_0x0d24('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d24('0x7')][_0x0d24('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1005ff,_0x250141,_0x48fb91){return new BPromise(function(_0xdb2d81,_0x2fdf4a){return client[_0x0d24('0x9')](_0x1005ff,_0x48fb91)[_0x0d24('0xa')](function(_0x58b925){logger[_0x0d24('0xb')](_0x0d24('0xc'),_0x250141,'request\x20sent');logger[_0x0d24('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x250141,_0x0d24('0xe'),JSON['stringify'](_0x58b925));if(_0x58b925[_0x0d24('0xf')]){if(_0x58b925[_0x0d24('0xf')][_0x0d24('0x10')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x250141,_0x58b925[_0x0d24('0xf')][_0x0d24('0x11')]);return _0x2fdf4a(_0x58b925[_0x0d24('0xf')]['message']);}logger[_0x0d24('0xf')](_0x0d24('0xc'),_0x250141,_0x58b925['error']['message']);return _0xdb2d81(_0x58b925[_0x0d24('0xf')][_0x0d24('0x11')]);}else{logger[_0x0d24('0xb')](_0x0d24('0xc'),_0x250141,_0x0d24('0xe'));_0xdb2d81(_0x58b925[_0x0d24('0x12')][_0x0d24('0x11')]);}})[_0x0d24('0x13')](function(_0x47ee4b){logger[_0x0d24('0xf')](_0x0d24('0xc'),_0x250141,_0x47ee4b);_0x2fdf4a(_0x47ee4b);});});} \ No newline at end of file +var _0x063c=['ioredis','../../mysqldb','../../config/logger','client','http','then','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring'];(function(_0x3f4d50,_0x2a6dac){var _0x52bba7=function(_0xe00b06){while(--_0xe00b06){_0x3f4d50['push'](_0x3f4d50['shift']());}};_0x52bba7(++_0x2a6dac);}(_0x063c,0xba));var _0xc063=function(_0x46b728,_0x25b8b1){_0x46b728=_0x46b728-0x0;var _0x553418=_0x063c[_0x46b728];return _0x553418;};'use strict';var _=require('lodash');var util=require(_0xc063('0x0'));var moment=require(_0xc063('0x1'));var BPromise=require(_0xc063('0x2'));var rs=require(_0xc063('0x3'));var fs=require('fs');var Redis=require(_0xc063('0x4'));var db=require(_0xc063('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc063('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc063('0x7')][_0xc063('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57ba85,_0x3dbe7c,_0x10716b){return new BPromise(function(_0x3f286a,_0x2f2915){return client['request'](_0x57ba85,_0x10716b)[_0xc063('0x9')](function(_0x421328){logger['info'](_0xc063('0xa'),_0x3dbe7c,_0xc063('0xb'));logger['debug'](_0xc063('0xc'),_0x3dbe7c,'request\x20sent',JSON['stringify'](_0x421328));if(_0x421328['error']){if(_0x421328[_0xc063('0xd')][_0xc063('0xe')]===0x1f4){logger['error'](_0xc063('0xa'),_0x3dbe7c,_0x421328['error'][_0xc063('0xf')]);return _0x2f2915(_0x421328[_0xc063('0xd')][_0xc063('0xf')]);}logger['error'](_0xc063('0xa'),_0x3dbe7c,_0x421328[_0xc063('0xd')][_0xc063('0xf')]);return _0x3f286a(_0x421328[_0xc063('0xd')][_0xc063('0xf')]);}else{logger[_0xc063('0x10')](_0xc063('0xa'),_0x3dbe7c,_0xc063('0xb'));_0x3f286a(_0x421328[_0xc063('0x11')]['message']);}})[_0xc063('0x12')](function(_0xfddf5c){logger['error'](_0xc063('0xa'),_0x3dbe7c,_0xfddf5c);_0x2f2915(_0xfddf5c);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 3ad4f29..a773c47 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 _0x3f3c=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','/:id','post','create','update','delete','exports'];(function(_0x285b4a,_0x440aee){var _0x525ef5=function(_0x30f17e){while(--_0x30f17e){_0x285b4a['push'](_0x285b4a['shift']());}};_0x525ef5(++_0x440aee);}(_0x3f3c,0x1e0));var _0xc3f3=function(_0x2bdfd1,_0x42da09){_0x2bdfd1=_0x2bdfd1-0x0;var _0x1a3d8=_0x3f3c[_0x2bdfd1];return _0x1a3d8;};'use strict';var multer=require('multer');var util=require(_0xc3f3('0x0'));var path=require(_0xc3f3('0x1'));var timeout=require('connect-timeout');var express=require(_0xc3f3('0x2'));var router=express[_0xc3f3('0x3')]();var fs_extra=require(_0xc3f3('0x4'));var auth=require(_0xc3f3('0x5'));var interaction=require(_0xc3f3('0x6'));var config=require('../../config/environment');var controller=require(_0xc3f3('0x7'));router[_0xc3f3('0x8')]('/',auth[_0xc3f3('0x9')](),controller['index']);router['get'](_0xc3f3('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xc3f3('0xb')]('/',auth[_0xc3f3('0x9')](),controller[_0xc3f3('0xc')]);router['put'](_0xc3f3('0xa'),auth['isAuthenticated'](),controller[_0xc3f3('0xd')]);router[_0xc3f3('0xe')]('/:id',auth[_0xc3f3('0x9')](),controller['destroy']);module[_0xc3f3('0xf')]=router; \ No newline at end of file +var _0x2484=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x13b330,_0x297092){var _0x1f666c=function(_0x5ebc84){while(--_0x5ebc84){_0x13b330['push'](_0x13b330['shift']());}};_0x1f666c(++_0x297092);}(_0x2484,0x178));var _0x4248=function(_0x470e67,_0x4a596d){_0x470e67=_0x470e67-0x0;var _0x28bbde=_0x2484[_0x470e67];return _0x28bbde;};'use strict';var multer=require(_0x4248('0x0'));var util=require(_0x4248('0x1'));var path=require('path');var timeout=require(_0x4248('0x2'));var express=require(_0x4248('0x3'));var router=express[_0x4248('0x4')]();var fs_extra=require(_0x4248('0x5'));var auth=require(_0x4248('0x6'));var interaction=require(_0x4248('0x7'));var config=require(_0x4248('0x8'));var controller=require('./network.controller');router[_0x4248('0x9')]('/',auth[_0x4248('0xa')](),controller[_0x4248('0xb')]);router[_0x4248('0x9')](_0x4248('0xc'),auth[_0x4248('0xa')](),controller['show']);router[_0x4248('0xd')]('/',auth[_0x4248('0xa')](),controller[_0x4248('0xe')]);router[_0x4248('0xf')](_0x4248('0xc'),auth[_0x4248('0xa')](),controller[_0x4248('0x10')]);router['delete'](_0x4248('0xc'),auth['isAuthenticated'](),controller[_0x4248('0x11')]);module[_0x4248('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 352b64b..b7b717d 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 _0xfdeb=['STRING','exports','externip','stun','turn'];(function(_0x305117,_0x289f1a){var _0x184cb7=function(_0x48887c){while(--_0x48887c){_0x305117['push'](_0x305117['shift']());}};_0x184cb7(++_0x289f1a);}(_0xfdeb,0xdd));var _0xbfde=function(_0x305486,_0x24acd4){_0x305486=_0x305486-0x0;var _0xa04940=_0xfdeb[_0x305486];return _0xa04940;};'use strict';var Sequelize=require('sequelize');module[_0xbfde('0x0')]={'type':{'type':Sequelize['ENUM']('localnet',_0xbfde('0x1'),_0xbfde('0x2'),_0xbfde('0x3'))},'value':{'type':Sequelize[_0xbfde('0x4')]},'username':{'type':Sequelize[_0xbfde('0x4')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xca38=['ENUM','localnet','externip','stun','STRING','sequelize','exports'];(function(_0xf89245,_0x1646e3){var _0x295fba=function(_0x4c8ea9){while(--_0x4c8ea9){_0xf89245['push'](_0xf89245['shift']());}};_0x295fba(++_0x1646e3);}(_0xca38,0x163));var _0x8ca3=function(_0x4e2867,_0x11f259){_0x4e2867=_0x4e2867-0x0;var _0x3c454b=_0xca38[_0x4e2867];return _0x3c454b;};'use strict';var Sequelize=require(_0x8ca3('0x0'));module[_0x8ca3('0x1')]={'type':{'type':Sequelize[_0x8ca3('0x2')](_0x8ca3('0x3'),_0x8ca3('0x4'),_0x8ca3('0x5'),'turn')},'value':{'type':Sequelize[_0x8ca3('0x6')]},'username':{'type':Sequelize[_0x8ca3('0x6')]},'password':{'type':Sequelize[_0x8ca3('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index ffd5ad9..fccefd3 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 _0xf3be=['merge','type','VIRTUAL','filter','options','Network','includeAll','include','findAll','rows','show','params','keys','find','create','sequelize','transaction','body','toUpperCase','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','res_stun_monitor.so','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','update','STUN','/etc/asterisk/stun_xcally.conf','TURN','chan_sip.so','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','debug','request\x20sent','error','code','Network,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','undefined','count','status','apply','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','pick','where'];(function(_0x2b45be,_0x18edcf){var _0x296fa5=function(_0x5223e9){while(--_0x5223e9){_0x2b45be['push'](_0x2b45be['shift']());}};_0x296fa5(++_0x18edcf);}(_0xf3be,0x178));var _0xef3b=function(_0x4d357b,_0x2e82da){_0x4d357b=_0x4d357b-0x0;var _0x19a243=_0xf3be[_0x4d357b];return _0x19a243;};'use strict';var emlformat=require(_0xef3b('0x0'));var rimraf=require(_0xef3b('0x1'));var zipdir=require(_0xef3b('0x2'));var jsonpatch=require(_0xef3b('0x3'));var rp=require(_0xef3b('0x4'));var moment=require(_0xef3b('0x5'));var BPromise=require(_0xef3b('0x6'));var Mustache=require(_0xef3b('0x7'));var util=require(_0xef3b('0x8'));var path=require(_0xef3b('0x9'));var sox=require(_0xef3b('0xa'));var csv=require(_0xef3b('0xb'));var ejs=require(_0xef3b('0xc'));var fs=require('fs');var fs_extra=require(_0xef3b('0xd'));var _=require(_0xef3b('0xe'));var squel=require(_0xef3b('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xef3b('0x10'));var toCsv=require(_0xef3b('0xb'));var querystring=require(_0xef3b('0x11'));var Papa=require(_0xef3b('0x12'));var Redis=require(_0xef3b('0x13'));var authService=require(_0xef3b('0x14'));var qs=require(_0xef3b('0x15'));var as=require(_0xef3b('0x16'));var hardwareService=require(_0xef3b('0x17'));var logger=require('../../config/logger')(_0xef3b('0x18'));var utils=require(_0xef3b('0x19'));var config=require(_0xef3b('0x1a'));var licenseUtil=require(_0xef3b('0x1b'));var db=require(_0xef3b('0x1c'))['db'];var jayson=require(_0xef3b('0x1d'));var client=jayson[_0xef3b('0x1e')][_0xef3b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x51289e,_0x4fd18a,_0xd45701,_0x90ac4){return new BPromise(function(_0x409f69,_0x23e6b1){var _0x5ae67d=_0x90ac4||client;return _0x5ae67d[_0xef3b('0x20')](_0x51289e,_0xd45701)['then'](function(_0x244db1){logger[_0xef3b('0x21')]('Network,\x20%s,\x20%s',_0x4fd18a,'request\x20sent');logger[_0xef3b('0x22')]('Network,\x20%s,\x20%s,\x20%s',_0x4fd18a,_0xef3b('0x23'),JSON['stringify'](_0x244db1));if(_0x244db1[_0xef3b('0x24')]){if(_0x244db1[_0xef3b('0x24')][_0xef3b('0x25')]===0x1f4){logger[_0xef3b('0x24')](_0xef3b('0x26'),_0x4fd18a,_0x244db1['error'][_0xef3b('0x27')]);return _0x23e6b1(_0x244db1[_0xef3b('0x24')]['message']);}logger[_0xef3b('0x24')]('Network,\x20%s,\x20%s',_0x4fd18a,_0x244db1[_0xef3b('0x24')][_0xef3b('0x27')]);return _0x409f69(_0x244db1[_0xef3b('0x24')][_0xef3b('0x27')]);}else{logger['info'](_0xef3b('0x26'),_0x4fd18a,_0xef3b('0x23'));_0x409f69(_0x244db1[_0xef3b('0x28')][_0xef3b('0x27')]);}})[_0xef3b('0x29')](function(_0x42b51e){logger[_0xef3b('0x24')](_0xef3b('0x26'),_0x4fd18a,_0x42b51e);_0x23e6b1(_0x42b51e);});});}function respondWithStatusCode(_0x322096,_0x4621ce){_0x4621ce=_0x4621ce||0xcc;return function(_0x32f312){if(_0x32f312){return _0x322096[_0xef3b('0x2a')](_0x4621ce);}return _0x322096['status'](_0x4621ce)[_0xef3b('0x2b')]();};}function respondWithResult(_0x8e440c,_0x47dde4){_0x47dde4=_0x47dde4||0xc8;return function(_0x36d89b){if(_0x36d89b){return _0x8e440c['status'](_0x47dde4)[_0xef3b('0x2c')](_0x36d89b);}};}function respondWithFilteredResult(_0x28d2c8,_0x3a7efd){return function(_0x1faf33){if(_0x1faf33){var _0x55eba6=typeof _0x3a7efd[_0xef3b('0x2d')]===_0xef3b('0x2e')&&typeof _0x3a7efd['limit']==='undefined';var _0x2a6b86=_0x1faf33[_0xef3b('0x2f')];var _0x3bd3b0=_0x55eba6?0x0:_0x3a7efd[_0xef3b('0x2d')];var _0x34f2d5=_0x55eba6?_0x1faf33[_0xef3b('0x2f')]:_0x3a7efd['offset']+_0x3a7efd['limit'];var _0x58a77c;if(_0x34f2d5>=_0x2a6b86){_0x34f2d5=_0x2a6b86;_0x58a77c=0xc8;}else{_0x58a77c=0xce;}_0x28d2c8[_0xef3b('0x30')](_0x58a77c);return _0x28d2c8['set']('Content-Range',_0x3bd3b0+'-'+_0x34f2d5+'/'+_0x2a6b86)['json'](_0x1faf33);}return null;};}function patchUpdates(_0x103fb8){return function(_0x1ca442){try{jsonpatch[_0xef3b('0x31')](_0x1ca442,_0x103fb8,!![]);}catch(_0x292688){return BPromise['reject'](_0x292688);}return _0x1ca442['save']();};}function saveUpdates(_0x3efb1c,_0x440e25){return function(_0x1640f0){if(_0x1640f0){return _0x1640f0['update'](_0x3efb1c)[_0xef3b('0x32')](function(_0x5c94b8){return _0x5c94b8;});}return null;};}function removeEntity(_0x215047,_0x1fe8d2){return function(_0x16b832){if(_0x16b832){return _0x16b832['destroy']()[_0xef3b('0x32')](function(){_0x215047[_0xef3b('0x30')](0xcc)[_0xef3b('0x2b')]();});}};}function handleEntityNotFound(_0x269b6b,_0x5abf0f){return function(_0x165fa8){if(!_0x165fa8){_0x269b6b[_0xef3b('0x2a')](0x194);}return _0x165fa8;};}function handleError(_0x339cb6,_0x4a833e){_0x4a833e=_0x4a833e||0x1f4;return function(_0x456a25){logger[_0xef3b('0x24')](_0x456a25[_0xef3b('0x33')]);if(_0x456a25[_0xef3b('0x34')]){delete _0x456a25['name'];}_0x339cb6['status'](_0x4a833e)[_0xef3b('0x35')](_0x456a25);};}exports[_0xef3b('0x36')]=function(_0xd8d31,_0x46a5f3){var _0x5ecba6={},_0x1435a9={},_0x378b5c={'count':0x0,'rows':[]};var _0x4bbf18=_[_0xef3b('0x37')](db['Network'][_0xef3b('0x38')],function(_0x4f1f1a){return{'name':_0x4f1f1a[_0xef3b('0x39')],'type':_0x4f1f1a['type'][_0xef3b('0x3a')]};});_0x1435a9[_0xef3b('0x3b')]=_[_0xef3b('0x37')](_0x4bbf18,'name');_0x1435a9[_0xef3b('0x3c')]=_['keys'](_0xd8d31['query']);_0x1435a9[_0xef3b('0x3d')]=_[_0xef3b('0x3e')](_0x1435a9['model'],_0x1435a9[_0xef3b('0x3c')]);_0x5ecba6['attributes']=_[_0xef3b('0x3e')](_0x1435a9[_0xef3b('0x3b')],qs[_0xef3b('0x3f')](_0xd8d31[_0xef3b('0x3c')][_0xef3b('0x3f')]));_0x5ecba6[_0xef3b('0x40')]=_0x5ecba6[_0xef3b('0x40')][_0xef3b('0x41')]?_0x5ecba6[_0xef3b('0x40')]:_0x1435a9[_0xef3b('0x3b')];if(!_0xd8d31[_0xef3b('0x3c')]['hasOwnProperty'](_0xef3b('0x42'))){_0x5ecba6[_0xef3b('0x43')]=qs[_0xef3b('0x43')](_0xd8d31[_0xef3b('0x3c')][_0xef3b('0x43')]);_0x5ecba6[_0xef3b('0x2d')]=qs[_0xef3b('0x2d')](_0xd8d31[_0xef3b('0x3c')][_0xef3b('0x2d')]);}_0x5ecba6[_0xef3b('0x44')]=qs[_0xef3b('0x45')](_0xd8d31[_0xef3b('0x3c')][_0xef3b('0x45')]);_0x5ecba6['where']=qs[_0xef3b('0x3d')](_[_0xef3b('0x46')](_0xd8d31['query'],_0x1435a9[_0xef3b('0x3d')]),_0x4bbf18);if(_0xd8d31[_0xef3b('0x3c')]['filter']){_0x5ecba6[_0xef3b('0x47')]=_[_0xef3b('0x48')](_0x5ecba6['where'],{'$or':_['map'](_0x4bbf18,function(_0x1c906e){if(_0x1c906e[_0xef3b('0x49')]!==_0xef3b('0x4a')){var _0x14a678={};_0x14a678[_0x1c906e[_0xef3b('0x34')]]={'$like':'%'+_0xd8d31[_0xef3b('0x3c')][_0xef3b('0x4b')]+'%'};return _0x14a678;}})});}_0x5ecba6=_[_0xef3b('0x48')]({},_0x5ecba6,_0xd8d31[_0xef3b('0x4c')]);var _0x2350e1={'where':_0x5ecba6['where']};return db[_0xef3b('0x4d')][_0xef3b('0x2f')](_0x2350e1)['then'](function(_0x30f94d){_0x378b5c['count']=_0x30f94d;if(_0xd8d31[_0xef3b('0x3c')][_0xef3b('0x4e')]){_0x5ecba6[_0xef3b('0x4f')]=[{'all':!![]}];}return db[_0xef3b('0x4d')][_0xef3b('0x50')](_0x5ecba6);})['then'](function(_0x9cd44e){_0x378b5c[_0xef3b('0x51')]=_0x9cd44e;return _0x378b5c;})[_0xef3b('0x32')](respondWithFilteredResult(_0x46a5f3,_0x5ecba6))[_0xef3b('0x29')](handleError(_0x46a5f3,null));};exports[_0xef3b('0x52')]=function(_0x2e6e5d,_0x507d8a){var _0x223224={'raw':!![],'where':{'id':_0x2e6e5d[_0xef3b('0x53')]['id']}},_0x51e7a4={};_0x51e7a4['model']=_[_0xef3b('0x54')](db[_0xef3b('0x4d')][_0xef3b('0x38')]);_0x51e7a4[_0xef3b('0x3c')]=_[_0xef3b('0x54')](_0x2e6e5d['query']);_0x51e7a4[_0xef3b('0x3d')]=_[_0xef3b('0x3e')](_0x51e7a4[_0xef3b('0x3b')],_0x51e7a4['query']);_0x223224['attributes']=_[_0xef3b('0x3e')](_0x51e7a4[_0xef3b('0x3b')],qs[_0xef3b('0x3f')](_0x2e6e5d[_0xef3b('0x3c')][_0xef3b('0x3f')]));_0x223224[_0xef3b('0x40')]=_0x223224[_0xef3b('0x40')][_0xef3b('0x41')]?_0x223224[_0xef3b('0x40')]:_0x51e7a4[_0xef3b('0x3b')];if(_0x2e6e5d['query'][_0xef3b('0x4e')]){_0x223224[_0xef3b('0x4f')]=[{'all':!![]}];}_0x223224=_[_0xef3b('0x48')]({},_0x223224,_0x2e6e5d[_0xef3b('0x4c')]);return db[_0xef3b('0x4d')][_0xef3b('0x55')](_0x223224)[_0xef3b('0x32')](handleEntityNotFound(_0x507d8a,null))['then'](respondWithResult(_0x507d8a,null))[_0xef3b('0x29')](handleError(_0x507d8a,null));};exports[_0xef3b('0x56')]=function(_0x36e26c,_0x40cd90,_0x8986a8){var _0x3e8316;return db[_0xef3b('0x57')][_0xef3b('0x58')](function(_0x227b00){return db[_0xef3b('0x4d')][_0xef3b('0x56')](_0x36e26c[_0xef3b('0x59')],{'raw':!![]})[_0xef3b('0x32')](function(_0x21da81){_0x3e8316=_0x21da81;return db[_0xef3b('0x4d')][_0xef3b('0x50')]({'where':{'type':_0x36e26c[_0xef3b('0x59')][_0xef3b('0x49')]},'raw':!![]});})[_0xef3b('0x32')](function(_0x453b65){if(_0x3e8316[_0xef3b('0x49')][_0xef3b('0x5a')]()=='STUN'){var _0x239180=fs['readFileSync'](path[_0xef3b('0x5b')](config[_0xef3b('0x5c')],_0xef3b('0x5d')),_0xef3b('0x5e'));var _0x1603a2=ejs[_0xef3b('0x5f')](_0x239180,{'networks':_0x453b65||[]});fs[_0xef3b('0x60')]('/etc/asterisk/stun_xcally.conf',_0x1603a2);return respondWithRpcPromise(_0xef3b('0x61'),_0xef3b('0x56'),{'module':_0xef3b('0x62')});}else if(_0x3e8316[_0xef3b('0x49')]['toUpperCase']()=='TURN'){var _0x1482ea=fs[_0xef3b('0x63')](path[_0xef3b('0x5b')](config[_0xef3b('0x5c')],_0xef3b('0x64')),_0xef3b('0x5e'));var _0x281127=ejs[_0xef3b('0x5f')](_0x1482ea,{'networks':_0x453b65||[]});fs['writeFileSync'](_0xef3b('0x65'),_0x281127);return respondWithRpcPromise('Reload','create',{'module':_0xef3b('0x62')});}else{var _0x1fad61=fs[_0xef3b('0x63')](path['join'](config['root'],_0xef3b('0x66')),'utf8');var _0xc19f43=ejs[_0xef3b('0x5f')](_0x1fad61,{'networks':_0x453b65||[]});fs[_0xef3b('0x60')](util[_0xef3b('0x67')](_0xef3b('0x68'),_0x36e26c[_0xef3b('0x59')][_0xef3b('0x49')][_0xef3b('0x69')]()),_0xc19f43);return respondWithRpcPromise(_0xef3b('0x61'),'create',{'module':'chan_sip.so'});}return null;})[_0xef3b('0x32')](function(){return _0x3e8316;});})[_0xef3b('0x32')](respondWithResult(_0x40cd90,0xc9))['catch'](handleError(_0x40cd90,null));};exports[_0xef3b('0x6a')]=function(_0x42a997,_0xf70674,_0xa9311b){var _0x12a28d;return db[_0xef3b('0x57')]['transaction'](function(_0x25ac0c){return db[_0xef3b('0x4d')]['find']({'where':{'id':_0x42a997[_0xef3b('0x53')]['id']}})[_0xef3b('0x32')](handleEntityNotFound(_0xf70674,null))[_0xef3b('0x32')](saveUpdates(_0x42a997[_0xef3b('0x59')],null))[_0xef3b('0x32')](function(_0x4af38b){if(_0x4af38b){_0x12a28d=_0x4af38b;return db[_0xef3b('0x4d')]['findAll']({'where':{'type':_0x12a28d[_0xef3b('0x49')]},'raw':!![]});}return null;})[_0xef3b('0x32')](function(_0x5ec051){if(_0x12a28d['type'][_0xef3b('0x5a')]()==_0xef3b('0x6b')){var _0x39e347=fs['readFileSync'](path[_0xef3b('0x5b')](config[_0xef3b('0x5c')],_0xef3b('0x5d')),_0xef3b('0x5e'));var _0x189a12=ejs[_0xef3b('0x5f')](_0x39e347,{'networks':_0x5ec051||[]});fs[_0xef3b('0x60')](_0xef3b('0x6c'),_0x189a12);return respondWithRpcPromise(_0xef3b('0x61'),_0xef3b('0x6a'),{'module':_0xef3b('0x62')});}else if(_0x12a28d[_0xef3b('0x49')][_0xef3b('0x5a')]()==_0xef3b('0x6d')){var _0x4f909f=fs[_0xef3b('0x63')](path[_0xef3b('0x5b')](config[_0xef3b('0x5c')],'server/files/templates/turn_multiple.ejs'),_0xef3b('0x5e'));var _0x303046=ejs[_0xef3b('0x5f')](_0x4f909f,{'networks':_0x5ec051||[]});fs[_0xef3b('0x60')](_0xef3b('0x65'),_0x303046);return respondWithRpcPromise(_0xef3b('0x61'),_0xef3b('0x6a'),{'module':_0xef3b('0x62')});}else{var _0x365d10=fs[_0xef3b('0x63')](path[_0xef3b('0x5b')](config[_0xef3b('0x5c')],_0xef3b('0x66')),'utf8');var _0x30e7fb=ejs['render'](_0x365d10,{'networks':_0x5ec051||[]});fs[_0xef3b('0x60')](util[_0xef3b('0x67')](_0xef3b('0x68'),_0x42a997['body'][_0xef3b('0x49')]['toLowerCase']()),_0x30e7fb);return respondWithRpcPromise(_0xef3b('0x61'),_0xef3b('0x6a'),{'module':_0xef3b('0x6e')});}return null;})[_0xef3b('0x32')](function(_0x108e1){if(_0x108e1){return _0x12a28d;}return null;});})[_0xef3b('0x32')](respondWithResult(_0xf70674,null))[_0xef3b('0x29')](handleError(_0xf70674,null));};exports[_0xef3b('0x6f')]=function(_0x1084e2,_0x3bae56,_0x4b42ab){var _0x3ee9fa;return db[_0xef3b('0x4d')][_0xef3b('0x55')]({'where':{'id':_0x1084e2[_0xef3b('0x53')]['id']}})[_0xef3b('0x32')](function(_0x371b8c){_0x3ee9fa=_0x371b8c;return _0x371b8c;})[_0xef3b('0x32')](handleEntityNotFound(_0x3bae56,null))['then'](removeEntity(_0x3bae56,null))[_0xef3b('0x32')](function(){if(_0x3ee9fa){return db['Network'][_0xef3b('0x50')]({'where':{'type':_0x3ee9fa[_0xef3b('0x49')]},'raw':!![]});}})[_0xef3b('0x32')](function(_0x38e3c9){if(_0x3ee9fa[_0xef3b('0x49')][_0xef3b('0x5a')]()==_0xef3b('0x6b')){var _0x52ec61=fs['readFileSync'](path['join'](config['root'],'server/files/templates/stun_multiple.ejs'),_0xef3b('0x5e'));var _0xdccdb1=ejs['render'](_0x52ec61,{'networks':_0x38e3c9||[]});fs[_0xef3b('0x60')](_0xef3b('0x6c'),_0xdccdb1);return respondWithRpcPromise('Reload',_0xef3b('0x6f'),{'module':_0xef3b('0x62')});}else if(_0x3ee9fa['type'][_0xef3b('0x5a')]()=='TURN'){var _0x18b91c=fs[_0xef3b('0x63')](path[_0xef3b('0x5b')](config[_0xef3b('0x5c')],_0xef3b('0x64')),_0xef3b('0x5e'));var _0x17a346=ejs[_0xef3b('0x5f')](_0x18b91c,{'networks':_0x38e3c9||[]});fs['writeFileSync'](_0xef3b('0x65'),_0x17a346);return respondWithRpcPromise(_0xef3b('0x61'),_0xef3b('0x6f'),{'module':_0xef3b('0x62')});}else{var _0x461a79=fs['readFileSync'](path[_0xef3b('0x5b')](config[_0xef3b('0x5c')],_0xef3b('0x66')),'utf8');var _0x3a0b96=ejs[_0xef3b('0x5f')](_0x461a79,{'networks':_0x38e3c9||[]});fs[_0xef3b('0x60')](util[_0xef3b('0x67')](_0xef3b('0x68'),_0x1084e2[_0xef3b('0x59')][_0xef3b('0x49')]['toLowerCase']()),_0x3a0b96);return respondWithRpcPromise('Reload',_0xef3b('0x6f'),{'module':_0xef3b('0x6e')});}return null;})[_0xef3b('0x29')](handleError(_0x3bae56,null));}; \ No newline at end of file +var _0x8f82=['res_stun_monitor.so','TURN','readFileSync','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','update','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format','catch','chan_sip.so','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','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','info','result','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','destroy','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','find','create','body','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload'];(function(_0x365875,_0x3a9957){var _0x284d75=function(_0x597744){while(--_0x597744){_0x365875['push'](_0x365875['shift']());}};_0x284d75(++_0x3a9957);}(_0x8f82,0x77));var _0x28f8=function(_0x6178a4,_0x2ada0e){_0x6178a4=_0x6178a4-0x0;var _0x26b716=_0x8f82[_0x6178a4];return _0x26b716;};'use strict';var emlformat=require(_0x28f8('0x0'));var rimraf=require(_0x28f8('0x1'));var zipdir=require(_0x28f8('0x2'));var jsonpatch=require(_0x28f8('0x3'));var rp=require(_0x28f8('0x4'));var moment=require('moment');var BPromise=require(_0x28f8('0x5'));var Mustache=require(_0x28f8('0x6'));var util=require(_0x28f8('0x7'));var path=require(_0x28f8('0x8'));var sox=require(_0x28f8('0x9'));var csv=require(_0x28f8('0xa'));var ejs=require(_0x28f8('0xb'));var fs=require('fs');var fs_extra=require(_0x28f8('0xc'));var _=require(_0x28f8('0xd'));var squel=require(_0x28f8('0xe'));var crypto=require('crypto');var jsforce=require(_0x28f8('0xf'));var deskjs=require(_0x28f8('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x28f8('0x11'));var Redis=require('ioredis');var authService=require(_0x28f8('0x12'));var qs=require(_0x28f8('0x13'));var as=require(_0x28f8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28f8('0x15'))(_0x28f8('0x16'));var utils=require(_0x28f8('0x17'));var config=require(_0x28f8('0x18'));var licenseUtil=require(_0x28f8('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0x28f8('0x1a'));var client=jayson[_0x28f8('0x1b')][_0x28f8('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3571b7,_0x9a473a,_0x11605f,_0x23c2ef){return new BPromise(function(_0x3ba13b,_0x48f8af){var _0x3adf13=_0x23c2ef||client;return _0x3adf13[_0x28f8('0x1d')](_0x3571b7,_0x11605f)[_0x28f8('0x1e')](function(_0x46cd9c){logger['info'](_0x28f8('0x1f'),_0x9a473a,_0x28f8('0x20'));logger[_0x28f8('0x21')](_0x28f8('0x22'),_0x9a473a,_0x28f8('0x20'),JSON['stringify'](_0x46cd9c));if(_0x46cd9c[_0x28f8('0x23')]){if(_0x46cd9c['error'][_0x28f8('0x24')]===0x1f4){logger[_0x28f8('0x23')](_0x28f8('0x1f'),_0x9a473a,_0x46cd9c[_0x28f8('0x23')][_0x28f8('0x25')]);return _0x48f8af(_0x46cd9c[_0x28f8('0x23')][_0x28f8('0x25')]);}logger['error'](_0x28f8('0x1f'),_0x9a473a,_0x46cd9c[_0x28f8('0x23')]['message']);return _0x3ba13b(_0x46cd9c[_0x28f8('0x23')][_0x28f8('0x25')]);}else{logger[_0x28f8('0x26')](_0x28f8('0x1f'),_0x9a473a,'request\x20sent');_0x3ba13b(_0x46cd9c[_0x28f8('0x27')]['message']);}})['catch'](function(_0x590390){logger[_0x28f8('0x23')](_0x28f8('0x1f'),_0x9a473a,_0x590390);_0x48f8af(_0x590390);});});}function respondWithStatusCode(_0x38de1e,_0xac2fca){_0xac2fca=_0xac2fca||0xcc;return function(_0x909ad8){if(_0x909ad8){return _0x38de1e[_0x28f8('0x28')](_0xac2fca);}return _0x38de1e[_0x28f8('0x29')](_0xac2fca)[_0x28f8('0x2a')]();};}function respondWithResult(_0x1b988e,_0x4e5237){_0x4e5237=_0x4e5237||0xc8;return function(_0x6c936e){if(_0x6c936e){return _0x1b988e[_0x28f8('0x29')](_0x4e5237)['json'](_0x6c936e);}};}function respondWithFilteredResult(_0x470e61,_0x28bcbe){return function(_0x53aade){if(_0x53aade){var _0x558aed=typeof _0x28bcbe[_0x28f8('0x2b')]===_0x28f8('0x2c')&&typeof _0x28bcbe['limit']===_0x28f8('0x2c');var _0x29639d=_0x53aade[_0x28f8('0x2d')];var _0x4c4453=_0x558aed?0x0:_0x28bcbe['offset'];var _0x4c9a2c=_0x558aed?_0x53aade[_0x28f8('0x2d')]:_0x28bcbe[_0x28f8('0x2b')]+_0x28bcbe[_0x28f8('0x2e')];var _0x12d3f4;if(_0x4c9a2c>=_0x29639d){_0x4c9a2c=_0x29639d;_0x12d3f4=0xc8;}else{_0x12d3f4=0xce;}_0x470e61[_0x28f8('0x29')](_0x12d3f4);return _0x470e61[_0x28f8('0x2f')](_0x28f8('0x30'),_0x4c4453+'-'+_0x4c9a2c+'/'+_0x29639d)[_0x28f8('0x31')](_0x53aade);}return null;};}function patchUpdates(_0x84ad0e){return function(_0x501ba3){try{jsonpatch['apply'](_0x501ba3,_0x84ad0e,!![]);}catch(_0x5d710a){return BPromise[_0x28f8('0x32')](_0x5d710a);}return _0x501ba3['save']();};}function saveUpdates(_0x420b9f,_0x49f189){return function(_0x527ea3){if(_0x527ea3){return _0x527ea3['update'](_0x420b9f)[_0x28f8('0x1e')](function(_0x4045a0){return _0x4045a0;});}return null;};}function removeEntity(_0x446633,_0x1bf11a){return function(_0x485433){if(_0x485433){return _0x485433[_0x28f8('0x33')]()[_0x28f8('0x1e')](function(){_0x446633[_0x28f8('0x29')](0xcc)[_0x28f8('0x2a')]();});}};}function handleEntityNotFound(_0x376c4e,_0x53a1bc){return function(_0x1da768){if(!_0x1da768){_0x376c4e[_0x28f8('0x28')](0x194);}return _0x1da768;};}function handleError(_0xc3e6ad,_0x48a13a){_0x48a13a=_0x48a13a||0x1f4;return function(_0x3264f6){logger[_0x28f8('0x23')](_0x3264f6['stack']);if(_0x3264f6[_0x28f8('0x34')]){delete _0x3264f6[_0x28f8('0x34')];}_0xc3e6ad[_0x28f8('0x29')](_0x48a13a)[_0x28f8('0x35')](_0x3264f6);};}exports[_0x28f8('0x36')]=function(_0x3de31f,_0x42d4de){var _0x32cb77={},_0x4cc9e5={},_0x25ddec={'count':0x0,'rows':[]};var _0x33ae95=_[_0x28f8('0x37')](db[_0x28f8('0x38')][_0x28f8('0x39')],function(_0x10bb20){return{'name':_0x10bb20[_0x28f8('0x3a')],'type':_0x10bb20[_0x28f8('0x3b')][_0x28f8('0x3c')]};});_0x4cc9e5[_0x28f8('0x3d')]=_[_0x28f8('0x37')](_0x33ae95,_0x28f8('0x34'));_0x4cc9e5[_0x28f8('0x3e')]=_[_0x28f8('0x3f')](_0x3de31f[_0x28f8('0x3e')]);_0x4cc9e5['filters']=_[_0x28f8('0x40')](_0x4cc9e5['model'],_0x4cc9e5[_0x28f8('0x3e')]);_0x32cb77['attributes']=_['intersection'](_0x4cc9e5[_0x28f8('0x3d')],qs[_0x28f8('0x41')](_0x3de31f[_0x28f8('0x3e')]['fields']));_0x32cb77[_0x28f8('0x42')]=_0x32cb77[_0x28f8('0x42')][_0x28f8('0x43')]?_0x32cb77[_0x28f8('0x42')]:_0x4cc9e5[_0x28f8('0x3d')];if(!_0x3de31f[_0x28f8('0x3e')][_0x28f8('0x44')](_0x28f8('0x45'))){_0x32cb77[_0x28f8('0x2e')]=qs[_0x28f8('0x2e')](_0x3de31f['query'][_0x28f8('0x2e')]);_0x32cb77[_0x28f8('0x2b')]=qs[_0x28f8('0x2b')](_0x3de31f[_0x28f8('0x3e')]['offset']);}_0x32cb77[_0x28f8('0x46')]=qs['sort'](_0x3de31f[_0x28f8('0x3e')]['sort']);_0x32cb77[_0x28f8('0x47')]=qs[_0x28f8('0x48')](_['pick'](_0x3de31f[_0x28f8('0x3e')],_0x4cc9e5[_0x28f8('0x48')]),_0x33ae95);if(_0x3de31f[_0x28f8('0x3e')][_0x28f8('0x49')]){_0x32cb77['where']=_[_0x28f8('0x4a')](_0x32cb77[_0x28f8('0x47')],{'$or':_['map'](_0x33ae95,function(_0x5c1561){if(_0x5c1561[_0x28f8('0x3b')]!==_0x28f8('0x4b')){var _0x5b1000={};_0x5b1000[_0x5c1561[_0x28f8('0x34')]]={'$like':'%'+_0x3de31f['query'][_0x28f8('0x49')]+'%'};return _0x5b1000;}})});}_0x32cb77=_[_0x28f8('0x4a')]({},_0x32cb77,_0x3de31f[_0x28f8('0x4c')]);var _0x3ff30c={'where':_0x32cb77[_0x28f8('0x47')]};return db[_0x28f8('0x38')][_0x28f8('0x2d')](_0x3ff30c)[_0x28f8('0x1e')](function(_0x414598){_0x25ddec[_0x28f8('0x2d')]=_0x414598;if(_0x3de31f['query']['includeAll']){_0x32cb77[_0x28f8('0x4d')]=[{'all':!![]}];}return db['Network'][_0x28f8('0x4e')](_0x32cb77);})['then'](function(_0x6bdce7){_0x25ddec[_0x28f8('0x4f')]=_0x6bdce7;return _0x25ddec;})[_0x28f8('0x1e')](respondWithFilteredResult(_0x42d4de,_0x32cb77))['catch'](handleError(_0x42d4de,null));};exports['show']=function(_0xf00c12,_0x25f9d2){var _0x142afb={'raw':!![],'where':{'id':_0xf00c12[_0x28f8('0x50')]['id']}},_0x3fc56a={};_0x3fc56a[_0x28f8('0x3d')]=_[_0x28f8('0x3f')](db[_0x28f8('0x38')][_0x28f8('0x39')]);_0x3fc56a[_0x28f8('0x3e')]=_['keys'](_0xf00c12[_0x28f8('0x3e')]);_0x3fc56a[_0x28f8('0x48')]=_[_0x28f8('0x40')](_0x3fc56a[_0x28f8('0x3d')],_0x3fc56a[_0x28f8('0x3e')]);_0x142afb[_0x28f8('0x42')]=_[_0x28f8('0x40')](_0x3fc56a[_0x28f8('0x3d')],qs[_0x28f8('0x41')](_0xf00c12[_0x28f8('0x3e')][_0x28f8('0x41')]));_0x142afb[_0x28f8('0x42')]=_0x142afb[_0x28f8('0x42')][_0x28f8('0x43')]?_0x142afb['attributes']:_0x3fc56a[_0x28f8('0x3d')];if(_0xf00c12[_0x28f8('0x3e')][_0x28f8('0x51')]){_0x142afb[_0x28f8('0x4d')]=[{'all':!![]}];}_0x142afb=_['merge']({},_0x142afb,_0xf00c12[_0x28f8('0x4c')]);return db[_0x28f8('0x38')][_0x28f8('0x52')](_0x142afb)[_0x28f8('0x1e')](handleEntityNotFound(_0x25f9d2,null))[_0x28f8('0x1e')](respondWithResult(_0x25f9d2,null))['catch'](handleError(_0x25f9d2,null));};exports['create']=function(_0x463ff3,_0x50e7b5,_0xf5c02c){var _0x1d07c2;return db['sequelize']['transaction'](function(_0x447246){return db[_0x28f8('0x38')][_0x28f8('0x53')](_0x463ff3[_0x28f8('0x54')],{'raw':!![]})[_0x28f8('0x1e')](function(_0xa87cd3){_0x1d07c2=_0xa87cd3;return db[_0x28f8('0x38')][_0x28f8('0x4e')]({'where':{'type':_0x463ff3[_0x28f8('0x54')][_0x28f8('0x3b')]},'raw':!![]});})['then'](function(_0x538398){if(_0x1d07c2[_0x28f8('0x3b')][_0x28f8('0x55')]()==_0x28f8('0x56')){var _0x3ec35a=fs['readFileSync'](path[_0x28f8('0x57')](config[_0x28f8('0x58')],_0x28f8('0x59')),_0x28f8('0x5a'));var _0x27304d=ejs[_0x28f8('0x5b')](_0x3ec35a,{'networks':_0x538398||[]});fs[_0x28f8('0x5c')](_0x28f8('0x5d'),_0x27304d);return respondWithRpcPromise(_0x28f8('0x5e'),_0x28f8('0x53'),{'module':_0x28f8('0x5f')});}else if(_0x1d07c2[_0x28f8('0x3b')]['toUpperCase']()==_0x28f8('0x60')){var _0x4fa110=fs[_0x28f8('0x61')](path[_0x28f8('0x57')](config[_0x28f8('0x58')],'server/files/templates/turn_multiple.ejs'),_0x28f8('0x5a'));var _0x2b824a=ejs['render'](_0x4fa110,{'networks':_0x538398||[]});fs[_0x28f8('0x5c')](_0x28f8('0x62'),_0x2b824a);return respondWithRpcPromise('Reload',_0x28f8('0x53'),{'module':_0x28f8('0x5f')});}else{var _0x260b80=fs[_0x28f8('0x61')](path['join'](config[_0x28f8('0x58')],'server/files/templates/network.ejs'),_0x28f8('0x5a'));var _0x5b9d7e=ejs[_0x28f8('0x5b')](_0x260b80,{'networks':_0x538398||[]});fs['writeFileSync'](util['format'](_0x28f8('0x63'),_0x463ff3[_0x28f8('0x54')][_0x28f8('0x3b')][_0x28f8('0x64')]()),_0x5b9d7e);return respondWithRpcPromise(_0x28f8('0x5e'),'create',{'module':'chan_sip.so'});}return null;})[_0x28f8('0x1e')](function(){return _0x1d07c2;});})['then'](respondWithResult(_0x50e7b5,0xc9))['catch'](handleError(_0x50e7b5,null));};exports[_0x28f8('0x65')]=function(_0x13a9b5,_0x2ddd1b,_0xa9d4e4){var _0x1c73b4;return db['sequelize']['transaction'](function(_0xec80c0){return db[_0x28f8('0x38')][_0x28f8('0x52')]({'where':{'id':_0x13a9b5[_0x28f8('0x50')]['id']}})['then'](handleEntityNotFound(_0x2ddd1b,null))['then'](saveUpdates(_0x13a9b5[_0x28f8('0x54')],null))[_0x28f8('0x1e')](function(_0x1ba2a1){if(_0x1ba2a1){_0x1c73b4=_0x1ba2a1;return db['Network']['findAll']({'where':{'type':_0x1c73b4[_0x28f8('0x3b')]},'raw':!![]});}return null;})[_0x28f8('0x1e')](function(_0x16664d){if(_0x1c73b4[_0x28f8('0x3b')][_0x28f8('0x55')]()==_0x28f8('0x56')){var _0xdc3cf=fs[_0x28f8('0x61')](path[_0x28f8('0x57')](config[_0x28f8('0x58')],_0x28f8('0x59')),'utf8');var _0x357efa=ejs[_0x28f8('0x5b')](_0xdc3cf,{'networks':_0x16664d||[]});fs[_0x28f8('0x5c')](_0x28f8('0x5d'),_0x357efa);return respondWithRpcPromise(_0x28f8('0x5e'),_0x28f8('0x65'),{'module':_0x28f8('0x5f')});}else if(_0x1c73b4[_0x28f8('0x3b')][_0x28f8('0x55')]()=='TURN'){var _0xbd720d=fs[_0x28f8('0x61')](path[_0x28f8('0x57')](config[_0x28f8('0x58')],_0x28f8('0x66')),_0x28f8('0x5a'));var _0x268aee=ejs[_0x28f8('0x5b')](_0xbd720d,{'networks':_0x16664d||[]});fs[_0x28f8('0x5c')](_0x28f8('0x62'),_0x268aee);return respondWithRpcPromise(_0x28f8('0x5e'),_0x28f8('0x65'),{'module':_0x28f8('0x5f')});}else{var _0x42080f=fs['readFileSync'](path[_0x28f8('0x57')](config['root'],_0x28f8('0x67')),_0x28f8('0x5a'));var _0x2b84ad=ejs[_0x28f8('0x5b')](_0x42080f,{'networks':_0x16664d||[]});fs['writeFileSync'](util[_0x28f8('0x68')]('/etc/asterisk/sip_xcally_%s.conf',_0x13a9b5['body'][_0x28f8('0x3b')]['toLowerCase']()),_0x2b84ad);return respondWithRpcPromise(_0x28f8('0x5e'),'update',{'module':'chan_sip.so'});}return null;})['then'](function(_0x35e923){if(_0x35e923){return _0x1c73b4;}return null;});})[_0x28f8('0x1e')](respondWithResult(_0x2ddd1b,null))[_0x28f8('0x69')](handleError(_0x2ddd1b,null));};exports[_0x28f8('0x33')]=function(_0x29fc61,_0x59765e,_0x24cb57){var _0x308efe;return db[_0x28f8('0x38')][_0x28f8('0x52')]({'where':{'id':_0x29fc61[_0x28f8('0x50')]['id']}})[_0x28f8('0x1e')](function(_0x2ef291){_0x308efe=_0x2ef291;return _0x2ef291;})[_0x28f8('0x1e')](handleEntityNotFound(_0x59765e,null))[_0x28f8('0x1e')](removeEntity(_0x59765e,null))[_0x28f8('0x1e')](function(){if(_0x308efe){return db[_0x28f8('0x38')][_0x28f8('0x4e')]({'where':{'type':_0x308efe[_0x28f8('0x3b')]},'raw':!![]});}})[_0x28f8('0x1e')](function(_0x4bfd43){if(_0x308efe[_0x28f8('0x3b')][_0x28f8('0x55')]()==_0x28f8('0x56')){var _0x4974ad=fs['readFileSync'](path['join'](config[_0x28f8('0x58')],'server/files/templates/stun_multiple.ejs'),_0x28f8('0x5a'));var _0xce7ec3=ejs[_0x28f8('0x5b')](_0x4974ad,{'networks':_0x4bfd43||[]});fs[_0x28f8('0x5c')]('/etc/asterisk/stun_xcally.conf',_0xce7ec3);return respondWithRpcPromise(_0x28f8('0x5e'),_0x28f8('0x33'),{'module':_0x28f8('0x5f')});}else if(_0x308efe[_0x28f8('0x3b')][_0x28f8('0x55')]()==_0x28f8('0x60')){var _0x1a020d=fs[_0x28f8('0x61')](path[_0x28f8('0x57')](config['root'],_0x28f8('0x66')),_0x28f8('0x5a'));var _0x2cad4c=ejs[_0x28f8('0x5b')](_0x1a020d,{'networks':_0x4bfd43||[]});fs[_0x28f8('0x5c')](_0x28f8('0x62'),_0x2cad4c);return respondWithRpcPromise('Reload',_0x28f8('0x33'),{'module':_0x28f8('0x5f')});}else{var _0x483cc2=fs[_0x28f8('0x61')](path['join'](config[_0x28f8('0x58')],_0x28f8('0x67')),_0x28f8('0x5a'));var _0x568c5c=ejs[_0x28f8('0x5b')](_0x483cc2,{'networks':_0x4bfd43||[]});fs[_0x28f8('0x5c')](util[_0x28f8('0x68')](_0x28f8('0x63'),_0x29fc61[_0x28f8('0x54')][_0x28f8('0x3b')][_0x28f8('0x64')]()),_0x568c5c);return respondWithRpcPromise('Reload',_0x28f8('0x33'),{'module':_0x28f8('0x6a')});}return null;})[_0x28f8('0x69')](handleError(_0x59765e,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index c8e50e1..6b00feb 100644 --- a/server/api/network/network.model.js +++ b/server/api/network/network.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe812=['bluebird','request-promise','rimraf','../../config/environment','exports','define','Network','network','util','../../config/logger'];(function(_0x5b3950,_0x4e5556){var _0x41e436=function(_0x139e30){while(--_0x139e30){_0x5b3950['push'](_0x5b3950['shift']());}};_0x41e436(++_0x4e5556);}(_0xe812,0x1f2));var _0x2e81=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe812[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x2e81('0x0'));var logger=require(_0x2e81('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2e81('0x2'));var rp=require(_0x2e81('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e81('0x4'));var config=require(_0x2e81('0x5'));var attributes=require('./network.attributes');module[_0x2e81('0x6')]=function(_0x251244,_0x4f6864){return _0x251244[_0x2e81('0x7')](_0x2e81('0x8'),attributes,{'tableName':_0x2e81('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b32=['exports','define','Network','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes'];(function(_0x4df491,_0x45bfb8){var _0x44d9b0=function(_0x555d30){while(--_0x555d30){_0x4df491['push'](_0x4df491['shift']());}};_0x44d9b0(++_0x45bfb8);}(_0x1b32,0x85));var _0x21b3=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x1b32[_0x17928f];return _0x500b63;};'use strict';var _=require('lodash');var util=require(_0x21b3('0x0'));var logger=require(_0x21b3('0x1'))(_0x21b3('0x2'));var moment=require(_0x21b3('0x3'));var BPromise=require(_0x21b3('0x4'));var rp=require(_0x21b3('0x5'));var fs=require('fs');var path=require(_0x21b3('0x6'));var rimraf=require(_0x21b3('0x7'));var config=require(_0x21b3('0x8'));var attributes=require(_0x21b3('0x9'));module[_0x21b3('0xa')]=function(_0x403803,_0x37859f){return _0x403803[_0x21b3('0xb')](_0x21b3('0xc'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 2a11d1a..fff8d7b 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x40cea9,_0x2c1e62){_0x40cea9=_0x40cea9-0x0;var _0x56dc48=_0x7a54[_0x40cea9];return _0x56dc48;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x33c6a4,_0x43fc7a){_0x33c6a4=_0x33c6a4-0x0;var _0x1c2195=_0x7a54[_0x33c6a4];return _0x1c2195;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index f398e4b..87a3a9f 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 _0x80c5=['/:id/notify','notify','addAgents','/:id/send','put','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x80c5,0x114));var _0x580c=function(_0x1e691e,_0x442116){_0x1e691e=_0x1e691e-0x0;var _0xfcd107=_0x80c5[_0x1e691e];return _0xfcd107;};'use strict';var multer=require(_0x580c('0x0'));var util=require(_0x580c('0x1'));var path=require(_0x580c('0x2'));var timeout=require(_0x580c('0x3'));var express=require(_0x580c('0x4'));var router=express[_0x580c('0x5')]();var fs_extra=require(_0x580c('0x6'));var auth=require(_0x580c('0x7'));var interaction=require(_0x580c('0x8'));var config=require('../../config/environment');var controller=require(_0x580c('0x9'));router[_0x580c('0xa')]('/',auth[_0x580c('0xb')](),controller['index']);router[_0x580c('0xa')](_0x580c('0xc'),auth[_0x580c('0xb')](),controller[_0x580c('0xd')]);router[_0x580c('0xa')](_0x580c('0xe'),auth[_0x580c('0xb')](),controller[_0x580c('0xf')]);router[_0x580c('0xa')](_0x580c('0x10'),auth[_0x580c('0xb')](),controller['getDispositions']);router[_0x580c('0xa')](_0x580c('0x11'),auth[_0x580c('0xb')](),controller[_0x580c('0x12')]);router[_0x580c('0xa')](_0x580c('0x13'),auth[_0x580c('0xb')](),controller['getApplications']);router['get'](_0x580c('0x14'),auth['isAuthenticated'](),controller[_0x580c('0x15')]);router['get'](_0x580c('0x16'),auth[_0x580c('0xb')](),controller[_0x580c('0x17')]);router[_0x580c('0x18')]('/',auth['isAuthenticated'](),controller[_0x580c('0x19')]);router[_0x580c('0x18')](_0x580c('0x10'),auth['isAuthenticated'](),controller[_0x580c('0x1a')]);router['post'](_0x580c('0x11'),auth[_0x580c('0xb')](),controller[_0x580c('0x1b')]);router['post'](_0x580c('0x1c'),controller[_0x580c('0x1d')]);router[_0x580c('0x18')](_0x580c('0x13'),auth[_0x580c('0xb')](),controller['addApplications']);router['post'](_0x580c('0x16'),auth[_0x580c('0xb')](),controller[_0x580c('0x1e')]);router['post'](_0x580c('0x1f'),auth[_0x580c('0xb')](),controller['send']);router[_0x580c('0x20')](_0x580c('0xe'),auth[_0x580c('0xb')](),controller['update']);router[_0x580c('0x21')](_0x580c('0xe'),auth['isAuthenticated'](),controller[_0x580c('0x22')]);router[_0x580c('0x21')](_0x580c('0x10'),auth['isAuthenticated'](),controller[_0x580c('0x23')]);router['delete'](_0x580c('0x11'),auth[_0x580c('0xb')](),controller['removeAnswers']);router[_0x580c('0x21')](_0x580c('0x16'),auth[_0x580c('0xb')](),controller[_0x580c('0x24')]);module[_0x580c('0x25')]=router; \ No newline at end of file +var _0xbdd3=['../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','addDisposition','addAnswer','/:id/notify','addApplications','addAgents','send','update','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x47a443,_0x2e1be1){var _0x3ad43e=function(_0xe69fc8){while(--_0xe69fc8){_0x47a443['push'](_0x47a443['shift']());}};_0x3ad43e(++_0x2e1be1);}(_0xbdd3,0x8d));var _0x3bdd=function(_0x48d3a6,_0x5b7c6a){_0x48d3a6=_0x48d3a6-0x0;var _0x3e4872=_0xbdd3[_0x48d3a6];return _0x3e4872;};'use strict';var multer=require(_0x3bdd('0x0'));var util=require(_0x3bdd('0x1'));var path=require(_0x3bdd('0x2'));var timeout=require(_0x3bdd('0x3'));var express=require(_0x3bdd('0x4'));var router=express['Router']();var fs_extra=require(_0x3bdd('0x5'));var auth=require(_0x3bdd('0x6'));var interaction=require(_0x3bdd('0x7'));var config=require('../../config/environment');var controller=require(_0x3bdd('0x8'));router['get']('/',auth[_0x3bdd('0x9')](),controller['index']);router[_0x3bdd('0xa')](_0x3bdd('0xb'),auth['isAuthenticated'](),controller[_0x3bdd('0xc')]);router[_0x3bdd('0xa')](_0x3bdd('0xd'),auth['isAuthenticated'](),controller[_0x3bdd('0xe')]);router['get'](_0x3bdd('0xf'),auth[_0x3bdd('0x9')](),controller[_0x3bdd('0x10')]);router[_0x3bdd('0xa')](_0x3bdd('0x11'),auth[_0x3bdd('0x9')](),controller['getAnswers']);router['get'](_0x3bdd('0x12'),auth[_0x3bdd('0x9')](),controller[_0x3bdd('0x13')]);router[_0x3bdd('0xa')](_0x3bdd('0x14'),auth['isAuthenticated'](),controller[_0x3bdd('0x15')]);router[_0x3bdd('0xa')](_0x3bdd('0x16'),auth[_0x3bdd('0x9')](),controller[_0x3bdd('0x17')]);router['post']('/',auth[_0x3bdd('0x9')](),controller[_0x3bdd('0x18')]);router[_0x3bdd('0x19')](_0x3bdd('0xf'),auth[_0x3bdd('0x9')](),controller[_0x3bdd('0x1a')]);router[_0x3bdd('0x19')]('/:id/canned_answers',auth[_0x3bdd('0x9')](),controller[_0x3bdd('0x1b')]);router[_0x3bdd('0x19')](_0x3bdd('0x1c'),controller['notify']);router['post'](_0x3bdd('0x12'),auth[_0x3bdd('0x9')](),controller[_0x3bdd('0x1d')]);router['post'](_0x3bdd('0x16'),auth[_0x3bdd('0x9')](),controller[_0x3bdd('0x1e')]);router[_0x3bdd('0x19')]('/:id/send',auth[_0x3bdd('0x9')](),controller[_0x3bdd('0x1f')]);router['put'](_0x3bdd('0xd'),auth[_0x3bdd('0x9')](),controller[_0x3bdd('0x20')]);router[_0x3bdd('0x21')](_0x3bdd('0xd'),auth[_0x3bdd('0x9')](),controller['destroy']);router[_0x3bdd('0x21')](_0x3bdd('0xf'),auth[_0x3bdd('0x9')](),controller[_0x3bdd('0x22')]);router[_0x3bdd('0x21')](_0x3bdd('0x11'),auth[_0x3bdd('0x9')](),controller['removeAnswers']);router[_0x3bdd('0x21')](_0x3bdd('0x16'),auth[_0x3bdd('0x9')](),controller[_0x3bdd('0x23')]);module[_0x3bdd('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 3ca79d7..91792b8 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 _0x88f4=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','STRING','name'];(function(_0x5c1fa5,_0x58101b){var _0x458b77=function(_0x41f9ed){while(--_0x41f9ed){_0x5c1fa5['push'](_0x5c1fa5['shift']());}};_0x458b77(++_0x58101b);}(_0x88f4,0x138));var _0x488f=function(_0x545a27,_0x4e5a95){_0x545a27=_0x545a27-0x0;var _0x420567=_0x88f4[_0x545a27];return _0x420567;};'use strict';var Sequelize=require(_0x488f('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x488f('0x1')],'unique':_0x488f('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x488f('0x1')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x488f('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x488f('0x1')],'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[_0x488f('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x488f('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x488f('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x488f('0x1')]},'queueTransfer':{'type':Sequelize[_0x488f('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x488f('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x488f('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x488f('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x488f('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x488f('0x5')},'mandatoryDisposition':{'type':Sequelize[_0x488f('0x3')],'defaultValue':![],'comment':_0x488f('0x6'),'set':function(_0x5afa48){if(!_0x5afa48)this[_0x488f('0x7')]('mandatoryDispositionPauseId',null);this[_0x488f('0x7')](_0x488f('0x8'),_0x5afa48);}}}; \ No newline at end of file +var _0x4961=['sequelize','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x4961,0xaa));var _0x1496=function(_0x3e09f7,_0x26088a){_0x3e09f7=_0x3e09f7-0x0;var _0x1b697f=_0x4961[_0x3e09f7];return _0x1b697f;};'use strict';var Sequelize=require(_0x1496('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x1496('0x1')],'unique':_0x1496('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1496('0x1')]},'token':{'type':Sequelize[_0x1496('0x1')],'defaultValue':function(){return rs[_0x1496('0x3')]();}},'replyUri':{'type':Sequelize[_0x1496('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1496('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1496('0x4')],'defaultValue':function(){return _0x1496('0x5');}},'notificationSound':{'type':Sequelize[_0x1496('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1496('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x1496('0x1')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1496('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1496('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1496('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1496('0x6')],'defaultValue':![],'comment':_0x1496('0x8'),'set':function(_0x4b62d3){if(!_0x4b62d3)this['setDataValue'](_0x1496('0x9'),null);this['setDataValue']('mandatoryDisposition',_0x4b62d3);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 1887503..cf40014 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 _0x8606=['describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','Contacts','DESC','Applications','account','list','applications','priority','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','User','unshift','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','json','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','OpenchannelAccount','rawAttributes','fieldName','model','map','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','show','params','mandatoryDispositionPause','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x8606,0x114));var _0x6860=function(_0x3b407d,_0x19cbdb){_0x3b407d=_0x3b407d-0x0;var _0x1fec09=_0x8606[_0x3b407d];return _0x1fec09;};'use strict';var emlformat=require(_0x6860('0x0'));var rimraf=require(_0x6860('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6860('0x2'));var rp=require(_0x6860('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6860('0x4'));var sox=require(_0x6860('0x5'));var csv=require('to-csv');var ejs=require(_0x6860('0x6'));var fs=require('fs');var fs_extra=require(_0x6860('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6860('0x8'));var jsforce=require(_0x6860('0x9'));var deskjs=require(_0x6860('0xa'));var toCsv=require(_0x6860('0xb'));var querystring=require('querystring');var Papa=require(_0x6860('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6860('0xd'));var hardwareService=require(_0x6860('0xe'));var logger=require(_0x6860('0xf'))(_0x6860('0x10'));var utils=require('../../config/utils');var config=require(_0x6860('0x11'));var licenseUtil=require(_0x6860('0x12'));var db=require('../../mysqldb')['db'];config[_0x6860('0x13')]=_[_0x6860('0x14')](config[_0x6860('0x13')],{'host':_0x6860('0x15'),'port':0x18eb});var socket=require(_0x6860('0x16'))(new Redis(config['redis']));require(_0x6860('0x17'))[_0x6860('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6860('0x19')][_0x6860('0x1a')]({'port':0x232c});var client9002=jayson[_0x6860('0x19')][_0x6860('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3daf8f,_0x3d68d6,_0x18c405,_0x38e1a3){return new BPromise(function(_0x315cd1,_0xad35c0){var _0x5d30ec=_0x38e1a3||client;return _0x5d30ec[_0x6860('0x1b')](_0x3daf8f,_0x18c405)[_0x6860('0x1c')](function(_0x3b8151){logger[_0x6860('0x1d')](_0x6860('0x1e'),_0x3d68d6,_0x6860('0x1f'));logger[_0x6860('0x20')](_0x6860('0x21'),_0x3d68d6,_0x6860('0x1f'),JSON[_0x6860('0x22')](_0x3b8151));if(_0x3b8151[_0x6860('0x23')]){if(_0x3b8151[_0x6860('0x23')]['code']===0x1f4){logger[_0x6860('0x23')](_0x6860('0x1e'),_0x3d68d6,_0x3b8151[_0x6860('0x23')][_0x6860('0x24')]);return _0xad35c0(_0x3b8151[_0x6860('0x23')]['message']);}logger['error'](_0x6860('0x1e'),_0x3d68d6,_0x3b8151[_0x6860('0x23')][_0x6860('0x24')]);return _0x315cd1(_0x3b8151[_0x6860('0x23')]['message']);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x3d68d6,_0x6860('0x1f'));_0x315cd1(_0x3b8151[_0x6860('0x25')]['message']);}})[_0x6860('0x26')](function(_0x2944a9){logger[_0x6860('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x3d68d6,_0x2944a9);_0xad35c0(_0x2944a9);});});}function respondWithStatusCode(_0x4bf227,_0x32b2a5){_0x32b2a5=_0x32b2a5||0xcc;return function(_0x5ca2f7){if(_0x5ca2f7){return _0x4bf227['sendStatus'](_0x32b2a5);}return _0x4bf227['status'](_0x32b2a5)[_0x6860('0x27')]();};}function respondWithResult(_0x5b784e,_0x3ce50b){_0x3ce50b=_0x3ce50b||0xc8;return function(_0x9ac82){if(_0x9ac82){return _0x5b784e[_0x6860('0x28')](_0x3ce50b)[_0x6860('0x29')](_0x9ac82);}};}function respondWithFilteredResult(_0x5d0c9c,_0x47b681){return function(_0x582216){if(_0x582216){var _0x5ea913=typeof _0x47b681['offset']===_0x6860('0x2a')&&typeof _0x47b681[_0x6860('0x2b')]===_0x6860('0x2a');var _0x1c9b54=_0x582216['count'];var _0x451498=_0x5ea913?0x0:_0x47b681['offset'];var _0x14e38f=_0x5ea913?_0x582216[_0x6860('0x2c')]:_0x47b681['offset']+_0x47b681[_0x6860('0x2b')];var _0x4791ea;if(_0x14e38f>=_0x1c9b54){_0x14e38f=_0x1c9b54;_0x4791ea=0xc8;}else{_0x4791ea=0xce;}_0x5d0c9c[_0x6860('0x28')](_0x4791ea);return _0x5d0c9c['set'](_0x6860('0x2d'),_0x451498+'-'+_0x14e38f+'/'+_0x1c9b54)['json'](_0x582216);}return null;};}function patchUpdates(_0xedb6be){return function(_0x4aabb9){try{jsonpatch[_0x6860('0x2e')](_0x4aabb9,_0xedb6be,!![]);}catch(_0x53c021){return BPromise[_0x6860('0x2f')](_0x53c021);}return _0x4aabb9[_0x6860('0x30')]();};}function saveUpdates(_0x3a7c45,_0x26d2b1){return function(_0x3d28fc){if(_0x3d28fc){return _0x3d28fc[_0x6860('0x31')](_0x3a7c45)[_0x6860('0x1c')](function(_0x269a71){return _0x269a71;});}return null;};}function removeEntity(_0x2ce668,_0x953fcf){return function(_0x1a391d){if(_0x1a391d){return _0x1a391d[_0x6860('0x32')]()[_0x6860('0x1c')](function(){var _0x46dbfa=_0x1a391d['get']({'plain':!![]});var _0x5736a6=_0x6860('0x33');return db[_0x6860('0x34')][_0x6860('0x32')]({'where':{'type':_0x5736a6,'resourceId':_0x46dbfa['id']}})[_0x6860('0x1c')](function(){return _0x1a391d;});})[_0x6860('0x1c')](function(){_0x2ce668['status'](0xcc)[_0x6860('0x27')]();});}};}function handleEntityNotFound(_0x23bd77,_0x3d4c22){return function(_0x34724e){if(!_0x34724e){_0x23bd77['sendStatus'](0x194);}return _0x34724e;};}function handleError(_0x1610ef,_0x57d627){_0x57d627=_0x57d627||0x1f4;return function(_0xd7ff85){logger[_0x6860('0x23')](_0xd7ff85[_0x6860('0x35')]);if(_0xd7ff85[_0x6860('0x36')]){delete _0xd7ff85[_0x6860('0x36')];}_0x1610ef['status'](_0x57d627)[_0x6860('0x37')](_0xd7ff85);};}exports[_0x6860('0x38')]=function(_0x15115b,_0xd59a57){var _0x39e506={'include':[{'model':db[_0x6860('0x39')],'as':'mandatoryDispositionPause'}]},_0x15fe37={},_0x36f9d2={'count':0x0,'rows':[]};var _0x7f3381=_['map'](db[_0x6860('0x3a')][_0x6860('0x3b')],function(_0x282dad){return{'name':_0x282dad[_0x6860('0x3c')],'type':_0x282dad['type']['key']};});_0x15fe37[_0x6860('0x3d')]=_[_0x6860('0x3e')](_0x7f3381,'name');_0x15fe37['query']=_[_0x6860('0x3f')](_0x15115b[_0x6860('0x40')]);_0x15fe37[_0x6860('0x41')]=_['intersection'](_0x15fe37['model'],_0x15fe37['query']);_0x39e506[_0x6860('0x42')]=_[_0x6860('0x43')](_0x15fe37['model'],qs['fields'](_0x15115b[_0x6860('0x40')][_0x6860('0x44')]));_0x39e506[_0x6860('0x42')]=_0x39e506[_0x6860('0x42')]['length']?_0x39e506[_0x6860('0x42')]:_0x15fe37[_0x6860('0x3d')];if(!_0x15115b[_0x6860('0x40')][_0x6860('0x45')](_0x6860('0x46'))){_0x39e506[_0x6860('0x2b')]=qs[_0x6860('0x2b')](_0x15115b[_0x6860('0x40')][_0x6860('0x2b')]);_0x39e506[_0x6860('0x47')]=qs[_0x6860('0x47')](_0x15115b['query'][_0x6860('0x47')]);}_0x39e506[_0x6860('0x48')]=qs[_0x6860('0x49')](_0x15115b['query']['sort']);_0x39e506[_0x6860('0x4a')]=qs[_0x6860('0x41')](_[_0x6860('0x4b')](_0x15115b['query'],_0x15fe37['filters']),_0x7f3381);if(_0x15115b['query'][_0x6860('0x4c')]){_0x39e506[_0x6860('0x4a')]=_[_0x6860('0x4d')](_0x39e506[_0x6860('0x4a')],{'$or':_['map'](_0x7f3381,function(_0x936112){if(_0x936112[_0x6860('0x4e')]!==_0x6860('0x4f')){var _0x4e3ada={};_0x4e3ada[_0x936112[_0x6860('0x36')]]={'$like':'%'+_0x15115b[_0x6860('0x40')][_0x6860('0x4c')]+'%'};return _0x4e3ada;}})});}_0x39e506=_[_0x6860('0x4d')]({},_0x39e506,_0x15115b[_0x6860('0x50')]);var _0x5f59b2={'where':_0x39e506[_0x6860('0x4a')]};return db[_0x6860('0x3a')][_0x6860('0x2c')](_0x5f59b2)[_0x6860('0x1c')](function(_0x44fce7){_0x36f9d2[_0x6860('0x2c')]=_0x44fce7;if(_0x15115b[_0x6860('0x40')]['includeAll']){_0x39e506[_0x6860('0x51')]=[{'all':!![]}];}return db[_0x6860('0x3a')]['findAll'](_0x39e506);})['then'](function(_0x3c04bf){_0x36f9d2[_0x6860('0x52')]=_0x3c04bf;return _0x36f9d2;})['then'](respondWithFilteredResult(_0xd59a57,_0x39e506))[_0x6860('0x26')](handleError(_0xd59a57,null));};exports[_0x6860('0x53')]=function(_0x384ad2,_0xe8ab5c){var _0x50415a={'raw':![],'where':{'id':_0x384ad2[_0x6860('0x54')]['id']},'include':[{'model':db[_0x6860('0x39')],'as':_0x6860('0x55')}]},_0x50f11={};_0x50f11[_0x6860('0x3d')]=_['keys'](db[_0x6860('0x3a')]['rawAttributes']);_0x50f11[_0x6860('0x40')]=_[_0x6860('0x3f')](_0x384ad2[_0x6860('0x40')]);_0x50f11['filters']=_[_0x6860('0x43')](_0x50f11['model'],_0x50f11[_0x6860('0x40')]);_0x50415a[_0x6860('0x42')]=_[_0x6860('0x43')](_0x50f11[_0x6860('0x3d')],qs[_0x6860('0x44')](_0x384ad2['query']['fields']));_0x50415a[_0x6860('0x42')]=_0x50415a[_0x6860('0x42')][_0x6860('0x56')]?_0x50415a[_0x6860('0x42')]:_0x50f11[_0x6860('0x3d')];if(_0x384ad2['query'][_0x6860('0x57')]){_0x50415a[_0x6860('0x51')]=[{'all':!![]}];}_0x50415a=_[_0x6860('0x4d')]({},_0x50415a,_0x384ad2[_0x6860('0x50')]);return db[_0x6860('0x3a')][_0x6860('0x58')](_0x50415a)[_0x6860('0x1c')](handleEntityNotFound(_0xe8ab5c,null))[_0x6860('0x1c')](respondWithResult(_0xe8ab5c,null))[_0x6860('0x26')](handleError(_0xe8ab5c,null));};exports[_0x6860('0x59')]=function(_0x176bfa,_0x4fd2c6){return db[_0x6860('0x3a')][_0x6860('0x59')](_0x176bfa[_0x6860('0x5a')],{})['then'](function(_0x3228eb){var _0x8c220a=_0x176bfa[_0x6860('0x5b')]['get']({'plain':!![]});if(!_0x8c220a)throw new Error(_0x6860('0x5c'));if(_0x8c220a[_0x6860('0x5d')]===_0x6860('0x5b')){var _0x3bdb88=_0x3228eb[_0x6860('0x5e')]({'plain':!![]});var _0x2361c4=_0x6860('0x33');return db['UserProfileSection'][_0x6860('0x58')]({'where':{'name':_0x2361c4,'userProfileId':_0x8c220a['userProfileId']},'raw':!![]})[_0x6860('0x1c')](function(_0x2e75cb){if(_0x2e75cb&&_0x2e75cb['autoAssociation']===0x0){return db[_0x6860('0x34')][_0x6860('0x59')]({'name':_0x3bdb88[_0x6860('0x36')],'resourceId':_0x3bdb88['id'],'type':_0x2e75cb['name'],'sectionId':_0x2e75cb['id']},{})[_0x6860('0x1c')](function(){return _0x3228eb;});}else{return _0x3228eb;}})[_0x6860('0x26')](function(_0x1d705e){logger['error'](_0x6860('0x5f'),_0x1d705e);throw _0x1d705e;});}return _0x3228eb;})['then'](respondWithResult(_0x4fd2c6,0xc9))[_0x6860('0x26')](handleError(_0x4fd2c6,null));};exports[_0x6860('0x31')]=function(_0x19282a,_0x25f694){if(_0x19282a[_0x6860('0x5a')]['id']){delete _0x19282a['body']['id'];}return db[_0x6860('0x3a')]['find']({'where':{'id':_0x19282a[_0x6860('0x54')]['id']},'include':[{'model':db[_0x6860('0x39')],'as':_0x6860('0x55')}]})[_0x6860('0x1c')](handleEntityNotFound(_0x25f694,null))[_0x6860('0x1c')](saveUpdates(_0x19282a['body'],null))[_0x6860('0x1c')](respondWithResult(_0x25f694,null))[_0x6860('0x26')](handleError(_0x25f694,null));};exports[_0x6860('0x32')]=function(_0x4f7e8d,_0x37f8f8){return db[_0x6860('0x3a')][_0x6860('0x58')]({'where':{'id':_0x4f7e8d[_0x6860('0x54')]['id']}})['then'](handleEntityNotFound(_0x37f8f8,null))[_0x6860('0x1c')](removeEntity(_0x37f8f8,null))[_0x6860('0x26')](handleError(_0x37f8f8,null));};exports[_0x6860('0x60')]=function(_0x5b760e,_0x4827ee){return db[_0x6860('0x3a')][_0x6860('0x60')]()[_0x6860('0x1c')](respondWithResult(_0x4827ee,null))['catch'](handleError(_0x4827ee,null));};exports[_0x6860('0x61')]=function(_0x5ccd26,_0x2522dc,_0x2f9474){if(_0x5ccd26[_0x6860('0x5a')]['id']){delete _0x5ccd26[_0x6860('0x5a')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x5ccd26[_0x6860('0x54')]['id']}})[_0x6860('0x1c')](handleEntityNotFound(_0x2522dc,null))['then'](function(_0x1868e7){if(_0x1868e7){_0x5ccd26[_0x6860('0x5a')][_0x6860('0x62')]=_0x1868e7['id'];return db[_0x6860('0x63')][_0x6860('0x59')](_0x5ccd26[_0x6860('0x5a')]);}})['then'](respondWithResult(_0x2522dc,null))[_0x6860('0x26')](handleError(_0x2522dc,null));};exports[_0x6860('0x64')]=function(_0x3108da,_0x43dc39,_0xe6c80f){var _0x1d2a20={'raw':![],'where':{}};var _0x2fca7c={};var _0x4bd3d4={'count':0x0,'rows':[]};return db[_0x6860('0x3a')][_0x6860('0x65')]({'where':{'id':_0x3108da['params']['id']}})[_0x6860('0x1c')](handleEntityNotFound(_0x43dc39,null))['then'](function(_0x11cf58){if(_0x11cf58){_0x2fca7c['model']=_[_0x6860('0x3f')](db['Disposition']['rawAttributes']);_0x2fca7c[_0x6860('0x40')]=_[_0x6860('0x3f')](_0x3108da['query']);_0x2fca7c[_0x6860('0x41')]=_['intersection'](_0x2fca7c['model'],_0x2fca7c[_0x6860('0x40')]);_0x1d2a20[_0x6860('0x42')]=_[_0x6860('0x43')](_0x2fca7c[_0x6860('0x3d')],qs[_0x6860('0x44')](_0x3108da[_0x6860('0x40')][_0x6860('0x44')]));_0x1d2a20[_0x6860('0x42')]=_0x1d2a20['attributes']['length']?_0x1d2a20[_0x6860('0x42')]:_0x2fca7c['model'];if(!_0x3108da['query']['hasOwnProperty'](_0x6860('0x46'))){_0x1d2a20['limit']=qs['limit'](_0x3108da[_0x6860('0x40')]['limit']);_0x1d2a20[_0x6860('0x47')]=qs[_0x6860('0x47')](_0x3108da[_0x6860('0x40')][_0x6860('0x47')]);}_0x1d2a20[_0x6860('0x48')]=qs['sort'](_0x3108da[_0x6860('0x40')][_0x6860('0x49')]);_0x1d2a20['where']=qs[_0x6860('0x41')](_['pick'](_0x3108da['query'],_0x2fca7c['filters']));_0x1d2a20[_0x6860('0x4a')][_0x6860('0x62')]=_0x11cf58['id'];if(_0x3108da['query'][_0x6860('0x4c')]){_0x1d2a20[_0x6860('0x4a')]=_[_0x6860('0x4d')](_0x1d2a20['where'],{'$or':_[_0x6860('0x3e')](_0x1d2a20[_0x6860('0x42')],function(_0x4f60a4){var _0x3be1a9={};_0x3be1a9[_0x4f60a4]={'$like':'%'+_0x3108da['query']['filter']+'%'};return _0x3be1a9;})});}_0x1d2a20=_[_0x6860('0x4d')]({},_0x1d2a20,_0x3108da['options']);return db[_0x6860('0x63')][_0x6860('0x2c')]({'where':_0x1d2a20[_0x6860('0x4a')]})[_0x6860('0x1c')](function(_0x4c99be){_0x4bd3d4[_0x6860('0x2c')]=_0x4c99be;if(_0x3108da[_0x6860('0x40')][_0x6860('0x57')]){_0x1d2a20[_0x6860('0x51')]=[{'all':!![]}];}return db['Disposition'][_0x6860('0x66')](_0x1d2a20);})[_0x6860('0x1c')](function(_0x3208f2){_0x4bd3d4[_0x6860('0x52')]=_0x3208f2;return _0x4bd3d4;});}})[_0x6860('0x1c')](respondWithFilteredResult(_0x43dc39,_0x1d2a20))[_0x6860('0x26')](handleError(_0x43dc39,null));};exports['removeDispositions']=function(_0x2dbca1,_0x4a1164,_0x372d3f){return db['OpenchannelAccount']['find']({'where':{'id':_0x2dbca1[_0x6860('0x54')]['id']}})[_0x6860('0x1c')](handleEntityNotFound(_0x4a1164,null))[_0x6860('0x1c')](function(_0x40d262){if(_0x40d262){return _0x40d262[_0x6860('0x67')](_0x2dbca1[_0x6860('0x40')][_0x6860('0x68')]);}})[_0x6860('0x1c')](respondWithStatusCode(_0x4a1164,null))[_0x6860('0x26')](handleError(_0x4a1164,null));};exports[_0x6860('0x69')]=function(_0x2d591a,_0x134bb1,_0x1cb50b){if(_0x2d591a['body']['id']){delete _0x2d591a[_0x6860('0x5a')]['id'];}return db[_0x6860('0x3a')][_0x6860('0x58')]({'where':{'id':_0x2d591a[_0x6860('0x54')]['id']}})[_0x6860('0x1c')](handleEntityNotFound(_0x134bb1,null))[_0x6860('0x1c')](function(_0xf9f861){if(_0xf9f861){_0x2d591a['body'][_0x6860('0x62')]=_0xf9f861['id'];return db[_0x6860('0x6a')][_0x6860('0x59')](_0x2d591a[_0x6860('0x5a')]);}})['then'](respondWithResult(_0x134bb1,null))[_0x6860('0x26')](handleError(_0x134bb1,null));};exports['getAnswers']=function(_0x420594,_0x207c79,_0x4f9b7f){var _0x96672a={'raw':![],'where':{}};var _0x1b5f00={};var _0x43c036={'count':0x0,'rows':[]};return db[_0x6860('0x3a')][_0x6860('0x65')]({'where':{'id':_0x420594[_0x6860('0x54')]['id']}})[_0x6860('0x1c')](handleEntityNotFound(_0x207c79,null))[_0x6860('0x1c')](function(_0x57638c){if(_0x57638c){_0x1b5f00[_0x6860('0x3d')]=_[_0x6860('0x3f')](db[_0x6860('0x6a')][_0x6860('0x3b')]);_0x1b5f00[_0x6860('0x40')]=_['keys'](_0x420594[_0x6860('0x40')]);_0x1b5f00['filters']=_[_0x6860('0x43')](_0x1b5f00[_0x6860('0x3d')],_0x1b5f00[_0x6860('0x40')]);_0x96672a[_0x6860('0x42')]=_[_0x6860('0x43')](_0x1b5f00[_0x6860('0x3d')],qs['fields'](_0x420594[_0x6860('0x40')][_0x6860('0x44')]));_0x96672a[_0x6860('0x42')]=_0x96672a[_0x6860('0x42')]['length']?_0x96672a[_0x6860('0x42')]:_0x1b5f00[_0x6860('0x3d')];if(!_0x420594[_0x6860('0x40')][_0x6860('0x45')](_0x6860('0x46'))){_0x96672a[_0x6860('0x2b')]=qs[_0x6860('0x2b')](_0x420594[_0x6860('0x40')][_0x6860('0x2b')]);_0x96672a[_0x6860('0x47')]=qs[_0x6860('0x47')](_0x420594[_0x6860('0x40')][_0x6860('0x47')]);}_0x96672a['order']=qs[_0x6860('0x49')](_0x420594['query'][_0x6860('0x49')]);_0x96672a[_0x6860('0x4a')]=qs['filters'](_[_0x6860('0x4b')](_0x420594[_0x6860('0x40')],_0x1b5f00[_0x6860('0x41')]));_0x96672a[_0x6860('0x4a')]['OpenchannelAccountId']=_0x57638c['id'];if(_0x420594[_0x6860('0x40')][_0x6860('0x4c')]){_0x96672a[_0x6860('0x4a')]=_[_0x6860('0x4d')](_0x96672a[_0x6860('0x4a')],{'$or':_[_0x6860('0x3e')](_0x96672a[_0x6860('0x42')],function(_0x71a8a9){var _0x58226f={};_0x58226f[_0x71a8a9]={'$like':'%'+_0x420594[_0x6860('0x40')][_0x6860('0x4c')]+'%'};return _0x58226f;})});}_0x96672a=_[_0x6860('0x4d')]({},_0x96672a,_0x420594['options']);return db[_0x6860('0x6a')][_0x6860('0x2c')]({'where':_0x96672a['where']})[_0x6860('0x1c')](function(_0x4f6e30){_0x43c036[_0x6860('0x2c')]=_0x4f6e30;if(_0x420594[_0x6860('0x40')][_0x6860('0x57')]){_0x96672a[_0x6860('0x51')]=[{'all':!![]}];}return db[_0x6860('0x6a')]['findAll'](_0x96672a);})[_0x6860('0x1c')](function(_0x3608ac){_0x43c036['rows']=_0x3608ac;return _0x43c036;});}})[_0x6860('0x1c')](respondWithFilteredResult(_0x207c79,_0x96672a))[_0x6860('0x26')](handleError(_0x207c79,null));};exports[_0x6860('0x6b')]=function(_0x1c4916,_0x11924b,_0x5b1b5a){return db[_0x6860('0x3a')]['find']({'where':{'id':_0x1c4916[_0x6860('0x54')]['id']}})[_0x6860('0x1c')](handleEntityNotFound(_0x11924b,null))['then'](function(_0x447411){if(_0x447411){return _0x447411['removeAnswers'](_0x1c4916[_0x6860('0x40')][_0x6860('0x68')]);}})[_0x6860('0x1c')](respondWithStatusCode(_0x11924b,null))[_0x6860('0x26')](handleError(_0x11924b,null));};exports[_0x6860('0x6c')]=function(_0x1185b6,_0x2c493c,_0x33908c){var _0x9a3891={'body':_0x1185b6[_0x6860('0x5a')],'channel':_0x6860('0x6d')};var _0x2c3f93=[];var _0x89fc23=[];var _0x350542={};var _0x3b27fe=![];return db[_0x6860('0x6e')][_0x6860('0x60')]()[_0x6860('0x1c')](function(_0x39a746){if(!_0x39a746){throw new db[(_0x6860('0x6f'))]['ValidationError'](_0x6860('0x70'));}_0x2c3f93=_[_0x6860('0x71')](_[_0x6860('0x3f')](_0x39a746),[_0x6860('0x72'),_0x6860('0x73')]);_0x89fc23=_[_0x6860('0x71')](_['keys'](_0x39a746),['createdAt',_0x6860('0x73'),'CompanyId',_0x6860('0x74')]);if(_0x1185b6[_0x6860('0x5a')]['id']){delete _0x1185b6[_0x6860('0x5a')]['id'];}if(_[_0x6860('0x75')](_0x1185b6['body']['from'])){throw new db[(_0x6860('0x6f'))][(_0x6860('0x76'))](_0x6860('0x77'));}if(_[_0x6860('0x75')](_0x1185b6[_0x6860('0x5a')][_0x6860('0x5a')])||_0x1185b6['body']['body']===''){throw new db[(_0x6860('0x6f'))][(_0x6860('0x76'))](_0x6860('0x78'));}if(_['isNil'](_0x1185b6['body'][_0x6860('0x79')])){throw new db[(_0x6860('0x6f'))][(_0x6860('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x89fc23);}if(!_[_0x6860('0x7a')](_0x89fc23,_0x1185b6[_0x6860('0x5a')][_0x6860('0x79')])){throw new db['Sequelize'][(_0x6860('0x76'))](_0x6860('0x7b')+_0x89fc23);}_0x350542[_0x1185b6[_0x6860('0x5a')][_0x6860('0x79')]]=_0x1185b6['body'][_0x6860('0x7c')];})['then'](function(){return db[_0x6860('0x3a')][_0x6860('0x58')]({'where':{'id':_0x1185b6['params']['id']},'include':[{'model':db['CmList'],'as':_0x6860('0x7d'),'include':[{'model':db['CmContact'],'as':_0x6860('0x7e'),'where':_0x350542,'limit':0x1,'order':[[_0x6860('0x73'),_0x6860('0x7f')]]}]},{'model':db['OpenchannelApplication'],'as':_0x6860('0x80')}]});})[_0x6860('0x1c')](handleEntityNotFound(_0x2c493c,null))[_0x6860('0x1c')](function(_0x3c2ebf){if(_0x3c2ebf&&_0x3c2ebf[_0x6860('0x7d')]){_0x9a3891[_0x6860('0x81')]=_0x3c2ebf;_0x9a3891['applications']=_0x3c2ebf[_0x6860('0x80')];_0x9a3891[_0x6860('0x82')]=_0x3c2ebf[_0x6860('0x7d')];_0x9a3891[_0x6860('0x83')]=_['orderBy'](_0x9a3891['applications'],[_0x6860('0x84')],['asc']);if(_0x9a3891[_0x6860('0x81')][_0x6860('0x80')]){delete _0x9a3891[_0x6860('0x81')][_0x6860('0x80')];}if(_0x9a3891['account']['List']&&_0x9a3891['account']['List'][_0x6860('0x7e')]['length']){return _0x9a3891['account'][_0x6860('0x7d')][_0x6860('0x7e')][0x0];}var _0x564dd=_[_0x6860('0x14')](_0x1185b6[_0x6860('0x5a')],{'firstName':_0x1185b6[_0x6860('0x5a')][_0x6860('0x7c')],'ListId':_0x3c2ebf[_0x6860('0x74')]});_0x564dd[_0x1185b6[_0x6860('0x5a')][_0x6860('0x79')]]=_0x1185b6[_0x6860('0x5a')][_0x6860('0x7c')];return db[_0x6860('0x6e')][_0x6860('0x59')](_0x564dd,{'fields':_0x2c3f93,'raw':!![]});}})['then'](handleEntityNotFound(_0x2c493c,null))[_0x6860('0x1c')](function(_0x7213d4){_0x9a3891['contact']=_0x7213d4;if(_0x7213d4){var _0x3eca53={'ContactId':_0x7213d4['id'],'OpenchannelAccountId':_0x1185b6[_0x6860('0x54')]['id'],'from':(_0x7213d4[_0x6860('0x85')]||'')+'\x20'+(_0x7213d4[_0x6860('0x86')]||'')};var _0x525b82={'OpenchannelAccountId':_0x1185b6[_0x6860('0x54')]['id'],'closed':![]};if(_0x1185b6[_0x6860('0x5a')][_0x6860('0x87')]){_0x525b82[_0x6860('0x87')]=_0x1185b6[_0x6860('0x5a')][_0x6860('0x87')];return db[_0x6860('0x88')][_0x6860('0x58')]({'where':_0x525b82})[_0x6860('0x1c')](function(_0x2ba701){if(_0x2ba701){return[_0x2ba701,![]];}_0x3eca53[_0x6860('0x87')]=_0x1185b6['body'][_0x6860('0x87')];_0x3eca53[_0x6860('0x89')]=_0x1185b6['body'][_0x6860('0x89')];return db[_0x6860('0x88')][_0x6860('0x59')](_0x3eca53)[_0x6860('0x1c')](function(_0x3630ab){return[_0x3630ab,!![]];});});}else{_0x525b82[_0x6860('0x87')]=null;}_0x525b82[_0x6860('0x8a')]=_0x7213d4['id'];return db[_0x6860('0x88')]['find']({'where':_0x525b82})[_0x6860('0x1c')](function(_0x42d121){if(_0x42d121){return[_0x42d121,![]];}return db[_0x6860('0x88')][_0x6860('0x59')](_0x3eca53)[_0x6860('0x1c')](function(_0x2e6cb9){return[_0x2e6cb9,!![]];});});}})[_0x6860('0x8b')](function(_0x30b178,_0x2982b0){if(_0x30b178){_0x3b27fe=_0x2982b0;if(!_0x2982b0){var _0x227c64={'from':(_0x9a3891[_0x6860('0x8c')]['firstName']||'')+'\x20'+(_0x9a3891[_0x6860('0x8c')]['lastName']||'')};if(_0x1185b6[_0x6860('0x5a')][_0x6860('0x87')]&&_0x1185b6['body']['messageId']&&_0x1185b6[_0x6860('0x5a')]['threadId']!=_0x1185b6[_0x6860('0x5a')][_0x6860('0x8d')]){_0x227c64[_0x6860('0x87')]=_0x1185b6[_0x6860('0x5a')]['messageId'];}return _0x30b178[_0x6860('0x31')](_0x227c64);}else{return _0x30b178;}}})[_0x6860('0x1c')](function(_0x32455f){_0x9a3891[_0x6860('0x8e')]=_0x32455f[_0x6860('0x5e')]({'plain':!![]});_0x9a3891['interaction']['created']=_0x3b27fe;if(_0x9a3891[_0x6860('0x8e')][_0x6860('0x8f')]){if(_0x9a3891[_0x6860('0x81')][_0x6860('0x90')]){_0x9a3891[_0x6860('0x83')][_0x6860('0x91')]({'id':0x0,'priority':_0x9a3891[_0x6860('0x83')]['length']+0x1,'app':_0x6860('0x92'),'appdata':_0x6860('0x93'),'interval':_0x6860('0x94')});}}return db[_0x6860('0x95')][_0x6860('0x59')]({'body':_0x1185b6['body']['body'],'OpenchannelAccountId':_0x1185b6[_0x6860('0x54')]['id'],'OpenchannelInteractionId':_0x32455f['id'],'direction':'in','ContactId':_0x9a3891['contact']['id'],'AttachmentId':_0x1185b6[_0x6860('0x5a')]['AttachmentId']});})['then'](function(_0x52f40f){_0x9a3891[_0x6860('0x24')]=_0x52f40f;if(_0x9a3891[_0x6860('0x8e')]['UserId']){return db[_0x6860('0x96')][_0x6860('0x58')]({'attributes':['id',_0x6860('0x36')],'where':{'id':_0x9a3891[_0x6860('0x8e')]['UserId']}})[_0x6860('0x1c')](function(_0x4b39aa){if(_0x4b39aa){_0x9a3891[_0x6860('0x83')][_0x6860('0x97')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4b39aa['name']+','+(_0x9a3891[_0x6860('0x81')][_0x6860('0x98')]||0xa),'interval':'*,*,*,*'});_0x9a3891[_0x6860('0x99')]=![];}return respondWithRpcPromise('Start',_0x6860('0x9a'),_0x9a3891);});}return respondWithRpcPromise('Start',_0x6860('0x9a'),_0x9a3891);})[_0x6860('0x1c')](function(_0x17575b){respondWithRpcPromise(_0x6860('0x9b'),_0x6860('0x9b'),{'event':_0x6860('0x6c'),'message':_0x17575b},client9002);return _0x17575b;})[_0x6860('0x1c')](respondWithResult(_0x2c493c,null))['catch'](handleError(_0x2c493c,null));};exports[_0x6860('0x9c')]=function(_0x337749,_0x2f741e){var _0xed0213=_0x337749[_0x6860('0x54')]['id'];var _0x52cc47=_0x337749['body'];var _0x3164e9=0xc8;var _0x1d67a7=null;return db[_0x6860('0x9d')][_0x6860('0x9e')]({'isolationLevel':db[_0x6860('0x9d')][_0x6860('0x9f')][_0x6860('0xa0')][_0x6860('0xa1')]},function(_0x298283){return db[_0x6860('0x3a')][_0x6860('0x65')]({'where':{'id':_0xed0213},'transaction':_0x298283})[_0x6860('0x1c')](function(_0x2e24c7){if(_0x2e24c7){return db['OpenchannelApplication'][_0x6860('0x32')]({'where':{'OpenchannelAccountId':_0xed0213},'transaction':_0x298283})[_0x6860('0x1c')](function(){var _0x12e8db=_[_0x6860('0x3e')](_0x52cc47,function(_0x2d0e8a){_0x2d0e8a[_0x6860('0x62')]=_0xed0213;return _0x2d0e8a;});return db[_0x6860('0xa2')][_0x6860('0xa3')](_0x12e8db,{'transaction':_0x298283});});}else{_0x3164e9=0x194;_0x1d67a7=[];}});})[_0x6860('0x1c')](function(){if(_0x3164e9!==0x194){return db[_0x6860('0xa2')][_0x6860('0xa4')]({'where':{'OpenchannelAccountId':_0xed0213},'order':_0x6860('0x84')})[_0x6860('0x1c')](function(_0x2bf98b){_0x1d67a7=_0x2bf98b;});}})[_0x6860('0x26')](function(_0x377c34){_0x3164e9=0x1f4;logger['error'](_0x377c34[_0x6860('0x35')]);if(_0x377c34['name']){delete _0x377c34[_0x6860('0x36')];}_0x1d67a7=_0x377c34;})[_0x6860('0xa5')](function(){if(_0x1d67a7===null){_0x2f741e['sendStatus'](_0x3164e9);}else{if(_0x3164e9===0x1f4){_0x2f741e[_0x6860('0x28')](_0x3164e9)[_0x6860('0x37')](_0x1d67a7);}else{_0x2f741e[_0x6860('0x28')](_0x3164e9)[_0x6860('0x29')](_0x1d67a7);}}});};exports[_0x6860('0xa6')]=function(_0xede049,_0x5e8b9e,_0x195220){var _0xeecdfa={};var _0x4128b4={};var _0xb51592;var _0x4a3c2d;return db[_0x6860('0x3a')][_0x6860('0x65')]({'where':{'id':_0xede049['params']['id']}})[_0x6860('0x1c')](handleEntityNotFound(_0x5e8b9e,null))[_0x6860('0x1c')](function(_0x1f0acb){if(_0x1f0acb){_0xb51592=_0x1f0acb;_0x4128b4[_0x6860('0x3d')]=_[_0x6860('0x3f')](db['OpenchannelApplication'][_0x6860('0x3b')]);_0x4128b4[_0x6860('0x40')]=_[_0x6860('0x3f')](_0xede049[_0x6860('0x40')]);_0x4128b4[_0x6860('0x41')]=_[_0x6860('0x43')](_0x4128b4['model'],_0x4128b4['query']);_0xeecdfa[_0x6860('0x42')]=_[_0x6860('0x43')](_0x4128b4[_0x6860('0x3d')],qs[_0x6860('0x44')](_0xede049[_0x6860('0x40')]['fields']));_0xeecdfa[_0x6860('0x42')]=_0xeecdfa[_0x6860('0x42')][_0x6860('0x56')]?_0xeecdfa['attributes']:_0x4128b4[_0x6860('0x3d')];_0xeecdfa[_0x6860('0x48')]=qs[_0x6860('0x49')](_0xede049[_0x6860('0x40')][_0x6860('0x49')]);_0xeecdfa['where']=qs[_0x6860('0x41')](_[_0x6860('0x4b')](_0xede049[_0x6860('0x40')],_0x4128b4[_0x6860('0x41')]));if(_0xede049[_0x6860('0x40')]['filter']){_0xeecdfa[_0x6860('0x4a')]=_[_0x6860('0x4d')](_0xeecdfa[_0x6860('0x4a')],{'$or':_[_0x6860('0x3e')](_0xeecdfa[_0x6860('0x42')],function(_0x3a44a0){var _0x2ab11e={};_0x2ab11e[_0x3a44a0]={'$like':'%'+_0xede049[_0x6860('0x40')][_0x6860('0x4c')]+'%'};return _0x2ab11e;})});}_0xeecdfa=_[_0x6860('0x4d')]({},_0xeecdfa,_0xede049[_0x6860('0x50')]);return _0xb51592['getApplications'](_0xeecdfa);}})[_0x6860('0x1c')](function(_0x1bd441){if(_0x1bd441){_0x4a3c2d=_0x1bd441['length'];if(!_0xede049[_0x6860('0x40')][_0x6860('0x45')](_0x6860('0x46'))){_0xeecdfa[_0x6860('0x2b')]=qs[_0x6860('0x2b')](_0xede049[_0x6860('0x40')][_0x6860('0x2b')]);_0xeecdfa['offset']=qs['offset'](_0xede049[_0x6860('0x40')]['offset']);}return _0xb51592[_0x6860('0xa6')](_0xeecdfa);}})[_0x6860('0x1c')](function(_0x415984){if(_0x415984){return _0x415984?{'count':_0x4a3c2d,'rows':_0x415984}:null;}})[_0x6860('0x1c')](respondWithResult(_0x5e8b9e,null))['catch'](handleError(_0x5e8b9e,null));};exports[_0x6860('0xa7')]=function(_0x31b2be,_0x4a2100,_0x1da37b){var _0x4a9aae={'raw':![],'where':{}};var _0x307230={};var _0x13738f={'count':0x0,'rows':[]};return db[_0x6860('0x3a')][_0x6860('0x65')]({'where':{'id':_0x31b2be[_0x6860('0x54')]['id']}})['then'](handleEntityNotFound(_0x4a2100,null))[_0x6860('0x1c')](function(_0x1d277c){if(_0x1d277c){_0x307230[_0x6860('0x3d')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x307230[_0x6860('0x40')]=_[_0x6860('0x3f')](_0x31b2be[_0x6860('0x40')]);_0x307230[_0x6860('0x41')]=_['intersection'](_0x307230['model'],_0x307230['query']);_0x4a9aae[_0x6860('0x42')]=_[_0x6860('0x43')](_0x307230[_0x6860('0x3d')],qs[_0x6860('0x44')](_0x31b2be[_0x6860('0x40')][_0x6860('0x44')]));_0x4a9aae[_0x6860('0x42')]=_0x4a9aae[_0x6860('0x42')][_0x6860('0x56')]?_0x4a9aae[_0x6860('0x42')]:_0x307230[_0x6860('0x3d')];if(!_0x31b2be[_0x6860('0x40')][_0x6860('0x45')](_0x6860('0x46'))){_0x4a9aae['limit']=qs[_0x6860('0x2b')](_0x31b2be[_0x6860('0x40')][_0x6860('0x2b')]);_0x4a9aae[_0x6860('0x47')]=qs[_0x6860('0x47')](_0x31b2be['query']['offset']);}_0x4a9aae['order']=qs[_0x6860('0x49')](_0x31b2be[_0x6860('0x40')][_0x6860('0x49')]);_0x4a9aae[_0x6860('0x4a')]=qs['filters'](_['pick'](_0x31b2be['query'],_0x307230[_0x6860('0x41')]));_0x4a9aae[_0x6860('0x4a')][_0x6860('0x62')]=_0x1d277c['id'];if(_0x31b2be[_0x6860('0x40')][_0x6860('0x4c')]){_0x4a9aae[_0x6860('0x4a')]=_[_0x6860('0x4d')](_0x4a9aae[_0x6860('0x4a')],{'$or':_['map'](_0x4a9aae[_0x6860('0x42')],function(_0x2e1df1){var _0x474513={};_0x474513[_0x2e1df1]={'$like':'%'+_0x31b2be[_0x6860('0x40')][_0x6860('0x4c')]+'%'};return _0x474513;})});}_0x4a9aae=_[_0x6860('0x4d')]({},_0x4a9aae,_0x31b2be[_0x6860('0x50')]);return db['OpenchannelInteraction'][_0x6860('0x2c')]({'where':_0x4a9aae[_0x6860('0x4a')]})[_0x6860('0x1c')](function(_0x560c00){_0x13738f[_0x6860('0x2c')]=_0x560c00;if(_0x31b2be[_0x6860('0x40')][_0x6860('0x57')]){_0x4a9aae[_0x6860('0x51')]=[{'model':db[_0x6860('0x6e')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x6860('0xa8'),'attributes':[_0x6860('0x36'),_0x6860('0xa9'),_0x6860('0xaa')],'required':![]},{'model':db[_0x6860('0xab')],'as':_0x6860('0xac'),'attributes':['id',_0x6860('0x36'),'color'],'where':_0x31b2be[_0x6860('0x40')]['tag']?{'id':_0x31b2be['query'][_0x6860('0xad')]}:undefined,'required':_0x31b2be[_0x6860('0x40')][_0x6860('0xad')]?!![]:![]}];}return db[_0x6860('0x88')]['findAll'](_0x4a9aae);})['then'](function(_0x56a5f0){_0x13738f[_0x6860('0x52')]=_0x56a5f0;return _0x13738f;});}})['then'](respondWithFilteredResult(_0x4a2100,_0x4a9aae))[_0x6860('0x26')](handleError(_0x4a2100,null));};exports[_0x6860('0xae')]=function(_0x2e64bc,_0x2a98a9,_0xf62712){return db['OpenchannelAccount'][_0x6860('0x58')]({'where':{'id':_0x2e64bc[_0x6860('0x54')]['id']}})[_0x6860('0x1c')](handleEntityNotFound(_0x2a98a9,null))[_0x6860('0x1c')](function(_0x423abb){if(_0x423abb){return _0x423abb['addAgents'](_0x2e64bc['body'][_0x6860('0x68')],_[_0x6860('0xaf')](_0x2e64bc[_0x6860('0x5a')],[_0x6860('0x68'),'id'])||{})['spread'](function(_0x1cb73c){for(var _0x2349f9=0x0;_0x2349f9<_0x2e64bc[_0x6860('0x5a')][_0x6860('0x68')][_0x6860('0x56')];_0x2349f9+=0x1){socket[_0x6860('0xb0')](_0x6860('0xb1'),{'UserId':Number(_0x2e64bc[_0x6860('0x5a')][_0x6860('0x68')][_0x2349f9]),'OpenchannelAccountId':Number(_0x2e64bc['params']['id'])});}return _0x1cb73c;});}})[_0x6860('0x1c')](respondWithResult(_0x2a98a9,null))[_0x6860('0x26')](handleError(_0x2a98a9,null));};exports[_0x6860('0xb2')]=function(_0x3dbdec,_0x5743bf,_0x5da7c7){return db[_0x6860('0x3a')][_0x6860('0x58')]({'where':{'id':_0x3dbdec[_0x6860('0x54')]['id']}})[_0x6860('0x1c')](handleEntityNotFound(_0x5743bf,null))[_0x6860('0x1c')](function(_0x85850f){if(_0x85850f){return _0x85850f[_0x6860('0xb2')](_0x3dbdec[_0x6860('0x40')]['ids'])[_0x6860('0x1c')](function(){if(_[_0x6860('0xb3')](_0x3dbdec[_0x6860('0x40')][_0x6860('0x68')])){for(var _0x3505d4=0x0;_0x3505d4<_0x3dbdec[_0x6860('0x40')][_0x6860('0x68')]['length'];_0x3505d4+=0x1){socket['emit'](_0x6860('0xb4'),{'UserId':Number(_0x3dbdec[_0x6860('0x40')]['ids'][_0x3505d4]),'OpenchannelAccountId':Number(_0x3dbdec[_0x6860('0x54')]['id'])});}}else{socket[_0x6860('0xb0')](_0x6860('0xb4'),{'UserId':Number(_0x3dbdec[_0x6860('0x40')][_0x6860('0x68')]),'OpenchannelAccountId':Number(_0x3dbdec[_0x6860('0x54')]['id'])});}});}})[_0x6860('0x1c')](respondWithStatusCode(_0x5743bf,null))[_0x6860('0x26')](handleError(_0x5743bf,null));};exports[_0x6860('0xb5')]=function(_0x26c154,_0x4b53ad,_0x233249){var _0x9ccf9f={};var _0x56b152={};var _0x546339;var _0x45a8e9;return db[_0x6860('0x3a')][_0x6860('0x65')]({'where':{'id':_0x26c154[_0x6860('0x54')]['id']}})[_0x6860('0x1c')](handleEntityNotFound(_0x4b53ad,null))['then'](function(_0x2b92c5){if(_0x2b92c5){_0x546339=_0x2b92c5;_0x56b152[_0x6860('0x3d')]=_[_0x6860('0x3f')](db[_0x6860('0x96')][_0x6860('0x3b')]);_0x56b152['query']=_[_0x6860('0x3f')](_0x26c154[_0x6860('0x40')]);_0x56b152[_0x6860('0x41')]=_[_0x6860('0x43')](_0x56b152[_0x6860('0x3d')],_0x56b152['query']);_0x9ccf9f[_0x6860('0x42')]=_['intersection'](_0x56b152['model'],qs[_0x6860('0x44')](_0x26c154[_0x6860('0x40')][_0x6860('0x44')]));_0x9ccf9f[_0x6860('0x42')]=_0x9ccf9f['attributes'][_0x6860('0x56')]?_0x9ccf9f['attributes']:_0x56b152[_0x6860('0x3d')];_0x9ccf9f[_0x6860('0x48')]=qs[_0x6860('0x49')](_0x26c154[_0x6860('0x40')][_0x6860('0x49')]);_0x9ccf9f[_0x6860('0x4a')]=qs[_0x6860('0x41')](_[_0x6860('0x4b')](_0x26c154['query'],_0x56b152[_0x6860('0x41')]));if(_0x26c154[_0x6860('0x40')]['filter']){_0x9ccf9f[_0x6860('0x4a')]=_[_0x6860('0x4d')](_0x9ccf9f['where'],{'$or':_[_0x6860('0x3e')](_0x9ccf9f['attributes'],function(_0x5ba3f3){var _0x227538={};_0x227538[_0x5ba3f3]={'$like':'%'+_0x26c154[_0x6860('0x40')][_0x6860('0x4c')]+'%'};return _0x227538;})});}_0x9ccf9f=_[_0x6860('0x4d')]({},_0x9ccf9f,_0x26c154['options']);return _0x546339[_0x6860('0xb5')](_0x9ccf9f);}})['then'](function(_0x27b8db){if(_0x27b8db){_0x45a8e9=_0x27b8db['length'];if(!_0x26c154['query']['hasOwnProperty'](_0x6860('0x46'))){_0x9ccf9f[_0x6860('0x2b')]=qs[_0x6860('0x2b')](_0x26c154[_0x6860('0x40')][_0x6860('0x2b')]);_0x9ccf9f['offset']=qs[_0x6860('0x47')](_0x26c154[_0x6860('0x40')][_0x6860('0x47')]);}return _0x546339['getAgents'](_0x9ccf9f);}})[_0x6860('0x1c')](function(_0x29a53e){if(_0x29a53e){return _0x29a53e?{'count':_0x45a8e9,'rows':_0x29a53e}:null;}})[_0x6860('0x1c')](respondWithResult(_0x4b53ad,null))[_0x6860('0x26')](handleError(_0x4b53ad,null));};exports[_0x6860('0x37')]=function(_0x1c8f05,_0x2ce94b,_0x9fcfd3){var _0x593791,_0x4a1280,_0x44b3cb;if(_[_0x6860('0x75')](_0x1c8f05[_0x6860('0x5a')][_0x6860('0x5a')])||_0x1c8f05['body'][_0x6860('0x5a')]===''){throw new db[(_0x6860('0x6f'))][(_0x6860('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6860('0x75')](_0x1c8f05[_0x6860('0x5a')]['to'])){}_0x593791=_0x1c8f05[_0x6860('0x5a')]['to'];return db[_0x6860('0x3a')][_0x6860('0x65')]({'where':{'id':_0x1c8f05[_0x6860('0x54')]['id']}})['then'](handleEntityNotFound(_0x2ce94b,null))[_0x6860('0x1c')](function(_0x36d4e6){if(_0x36d4e6){return db[_0x6860('0x3a')][_0x6860('0x58')]({'where':{'id':_0x36d4e6['id']},'include':[{'model':db[_0x6860('0xb6')],'as':_0x6860('0x7d'),'include':[{'model':db[_0x6860('0x6e')],'as':_0x6860('0x7e'),'where':{[_0x36d4e6[_0x6860('0x79')]]:_0x593791},'limit':0x1,'order':[[_0x6860('0x73'),_0x6860('0x7f')]]}]}]})[_0x6860('0x1c')](handleEntityNotFound(_0x2ce94b,null))[_0x6860('0x1c')](function(_0x1a7908){if(_0x1a7908&&_0x1a7908[_0x6860('0x7d')]){_0x4a1280=_0x1a7908[_0x6860('0x5e')]({'plain':!![]});if(_0x4a1280[_0x6860('0x7d')]&&_0x4a1280[_0x6860('0x7d')]['Contacts']['length']){return _0x4a1280[_0x6860('0x7d')][_0x6860('0x7e')][0x0];}return db[_0x6860('0x6e')][_0x6860('0x59')](_[_0x6860('0x14')](_0x1c8f05[_0x6860('0x5a')],{'firstName':_0x593791,[_0x1a7908[_0x6860('0x79')]]:_0x593791,'phone':_0x593791,'ListId':_0x4a1280[_0x6860('0x74')]}));}})[_0x6860('0x1c')](handleEntityNotFound(_0x2ce94b,null))[_0x6860('0x1c')](function(_0x14a050){if(_0x14a050){_0x44b3cb=_0x14a050;return db['OpenchannelInteraction'][_0x6860('0x58')]({'where':{'ContactId':_0x44b3cb['id'],'closed':![],'OpenchannelAccountId':_0x4a1280['id']}})[_0x6860('0x1c')](function(_0x4bfb5a){if(_0x4bfb5a){return[_0x4bfb5a,![]];}return db[_0x6860('0x88')][_0x6860('0x59')]({'UserId':_0x1c8f05[_0x6860('0x5b')]['id'],'ContactId':_0x44b3cb['id'],'OpenchannelAccountId':_0x4a1280['id'],'lastMsgDirection':_0x6860('0xb7'),'Messages':[_[_0x6860('0x4d')](_0x1c8f05[_0x6860('0x5a')],{'read':![],'body':_0x1c8f05[_0x6860('0x5a')]['body'],'OpenchannelAccountId':_0x4a1280['id'],'UserId':_0x1c8f05[_0x6860('0x5b')]['id'],'ContactId':_0x44b3cb['id']})]},{'include':[{'model':db[_0x6860('0x95')],'as':_0x6860('0xb8')}]})[_0x6860('0x1c')](function(_0x11073f){return[_0x11073f,!![]];});});}})[_0x6860('0x8b')](function(_0x249861,_0x5403ef){if(_0x5403ef){return _0x249861;}return db['OpenchannelMessage']['create'](_['merge'](_0x1c8f05['body'],{'read':![],'body':_0x1c8f05[_0x6860('0x5a')]['body'],'OpenchannelAccountId':_0x4a1280['id'],'OpenchannelInteractionId':_0x249861['id'],'UserId':_0x1c8f05[_0x6860('0x5b')]['id'],'ContactId':_0x44b3cb['id']}))[_0x6860('0x1c')](function(_0x9097fc){_0x249861['dataValues'][_0x6860('0xb8')]=[];_0x249861[_0x6860('0xb9')][_0x6860('0xb8')]['push'](_0x9097fc[_0x6860('0xb9')]);return _0x249861;});});}})[_0x6860('0x1c')](respondWithResult(_0x2ce94b,null))[_0x6860('0x26')](handleError(_0x2ce94b,null));}; \ No newline at end of file +var _0xba08=['filters','pick','filter','where','merge','map','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','Pause','mandatoryDispositionPause','keys','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','hasOwnProperty','order','removeDispositions','CannedAnswer','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','applications','orderBy','priority','asc','account','ListId','contact','threadId','OpenchannelInteraction','externalUrl','spread','firstName','messageId','interaction','created','unmanaged','OpenchannelMessage','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','sendStatus','getApplications','getInteractions','Owner','Tag','Tags','tag','addAgents','ids','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','push','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','rawAttributes','type','query','model','fields','attributes','length','nolimit','sort'];(function(_0x32f3b2,_0x15a711){var _0x2afa24=function(_0x3ac9c1){while(--_0x3ac9c1){_0x32f3b2['push'](_0x32f3b2['shift']());}};_0x2afa24(++_0x15a711);}(_0xba08,0x72));var _0x8ba0=function(_0x5e51c3,_0x405bde){_0x5e51c3=_0x5e51c3-0x0;var _0x36ecd7=_0xba08[_0x5e51c3];return _0x36ecd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ba0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8ba0('0x1'));var rp=require(_0x8ba0('0x2'));var moment=require('moment');var BPromise=require(_0x8ba0('0x3'));var Mustache=require(_0x8ba0('0x4'));var util=require(_0x8ba0('0x5'));var path=require(_0x8ba0('0x6'));var sox=require(_0x8ba0('0x7'));var csv=require('to-csv');var ejs=require(_0x8ba0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ba0('0x9'));var squel=require('squel');var crypto=require(_0x8ba0('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ba0('0xb'));var querystring=require(_0x8ba0('0xc'));var Papa=require(_0x8ba0('0xd'));var Redis=require(_0x8ba0('0xe'));var authService=require(_0x8ba0('0xf'));var qs=require(_0x8ba0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ba0('0x11'))(_0x8ba0('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8ba0('0x13')]=_[_0x8ba0('0x14')](config[_0x8ba0('0x13')],{'host':_0x8ba0('0x15'),'port':0x18eb});var socket=require(_0x8ba0('0x16'))(new Redis(config[_0x8ba0('0x13')]));require(_0x8ba0('0x17'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8ba0('0x18')][_0x8ba0('0x19')]({'port':0x232c});var client9002=jayson[_0x8ba0('0x18')][_0x8ba0('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x8777dd,_0x4f5a13,_0x574113,_0x4fa8c6){return new BPromise(function(_0x40fd74,_0x178e40){var _0x2873de=_0x4fa8c6||client;return _0x2873de[_0x8ba0('0x1a')](_0x8777dd,_0x574113)['then'](function(_0x1ab4ac){logger[_0x8ba0('0x1b')](_0x8ba0('0x1c'),_0x4f5a13,_0x8ba0('0x1d'));logger[_0x8ba0('0x1e')](_0x8ba0('0x1f'),_0x4f5a13,_0x8ba0('0x1d'),JSON[_0x8ba0('0x20')](_0x1ab4ac));if(_0x1ab4ac[_0x8ba0('0x21')]){if(_0x1ab4ac[_0x8ba0('0x21')]['code']===0x1f4){logger[_0x8ba0('0x21')](_0x8ba0('0x1c'),_0x4f5a13,_0x1ab4ac[_0x8ba0('0x21')][_0x8ba0('0x22')]);return _0x178e40(_0x1ab4ac[_0x8ba0('0x21')][_0x8ba0('0x22')]);}logger[_0x8ba0('0x21')](_0x8ba0('0x1c'),_0x4f5a13,_0x1ab4ac['error'][_0x8ba0('0x22')]);return _0x40fd74(_0x1ab4ac['error'][_0x8ba0('0x22')]);}else{logger[_0x8ba0('0x1b')](_0x8ba0('0x1c'),_0x4f5a13,'request\x20sent');_0x40fd74(_0x1ab4ac[_0x8ba0('0x23')][_0x8ba0('0x22')]);}})[_0x8ba0('0x24')](function(_0x36d5d5){logger['error'](_0x8ba0('0x1c'),_0x4f5a13,_0x36d5d5);_0x178e40(_0x36d5d5);});});}function respondWithStatusCode(_0x24e527,_0x19d938){_0x19d938=_0x19d938||0xcc;return function(_0x46c3ab){if(_0x46c3ab){return _0x24e527['sendStatus'](_0x19d938);}return _0x24e527[_0x8ba0('0x25')](_0x19d938)['end']();};}function respondWithResult(_0x4449cf,_0x216caf){_0x216caf=_0x216caf||0xc8;return function(_0x50326d){if(_0x50326d){return _0x4449cf[_0x8ba0('0x25')](_0x216caf)[_0x8ba0('0x26')](_0x50326d);}};}function respondWithFilteredResult(_0x31c6f9,_0x326cf6){return function(_0x2cfc17){if(_0x2cfc17){var _0x44bfe5=typeof _0x326cf6[_0x8ba0('0x27')]==='undefined'&&typeof _0x326cf6[_0x8ba0('0x28')]===_0x8ba0('0x29');var _0x3301d6=_0x2cfc17[_0x8ba0('0x2a')];var _0x1e5321=_0x44bfe5?0x0:_0x326cf6['offset'];var _0x3119ce=_0x44bfe5?_0x2cfc17[_0x8ba0('0x2a')]:_0x326cf6[_0x8ba0('0x27')]+_0x326cf6['limit'];var _0x45d44f;if(_0x3119ce>=_0x3301d6){_0x3119ce=_0x3301d6;_0x45d44f=0xc8;}else{_0x45d44f=0xce;}_0x31c6f9[_0x8ba0('0x25')](_0x45d44f);return _0x31c6f9[_0x8ba0('0x2b')](_0x8ba0('0x2c'),_0x1e5321+'-'+_0x3119ce+'/'+_0x3301d6)[_0x8ba0('0x26')](_0x2cfc17);}return null;};}function patchUpdates(_0x1a98ae){return function(_0x667c55){try{jsonpatch[_0x8ba0('0x2d')](_0x667c55,_0x1a98ae,!![]);}catch(_0x5375d7){return BPromise['reject'](_0x5375d7);}return _0x667c55[_0x8ba0('0x2e')]();};}function saveUpdates(_0x62d34e,_0x4d2d49){return function(_0x1a3b17){if(_0x1a3b17){return _0x1a3b17['update'](_0x62d34e)[_0x8ba0('0x2f')](function(_0xc4411){return _0xc4411;});}return null;};}function removeEntity(_0x36a9f7,_0x56fc8c){return function(_0x4b4bb4){if(_0x4b4bb4){return _0x4b4bb4[_0x8ba0('0x30')]()[_0x8ba0('0x2f')](function(){var _0x3d9c8f=_0x4b4bb4[_0x8ba0('0x31')]({'plain':!![]});var _0x137209=_0x8ba0('0x32');return db[_0x8ba0('0x33')][_0x8ba0('0x30')]({'where':{'type':_0x137209,'resourceId':_0x3d9c8f['id']}})[_0x8ba0('0x2f')](function(){return _0x4b4bb4;});})[_0x8ba0('0x2f')](function(){_0x36a9f7[_0x8ba0('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f347a,_0x265e9f){return function(_0x525d7e){if(!_0x525d7e){_0x1f347a['sendStatus'](0x194);}return _0x525d7e;};}function handleError(_0x215334,_0x311251){_0x311251=_0x311251||0x1f4;return function(_0x4d183e){logger[_0x8ba0('0x21')](_0x4d183e[_0x8ba0('0x34')]);if(_0x4d183e[_0x8ba0('0x35')]){delete _0x4d183e['name'];}_0x215334[_0x8ba0('0x25')](_0x311251)[_0x8ba0('0x36')](_0x4d183e);};}exports[_0x8ba0('0x37')]=function(_0x4745e6,_0xbf819b){var _0x50e69f={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x18269a={},_0x338d3e={'count':0x0,'rows':[]};var _0x384528=_['map'](db['OpenchannelAccount'][_0x8ba0('0x38')],function(_0x266a1f){return{'name':_0x266a1f['fieldName'],'type':_0x266a1f[_0x8ba0('0x39')]['key']};});_0x18269a['model']=_['map'](_0x384528,_0x8ba0('0x35'));_0x18269a[_0x8ba0('0x3a')]=_['keys'](_0x4745e6[_0x8ba0('0x3a')]);_0x18269a['filters']=_['intersection'](_0x18269a[_0x8ba0('0x3b')],_0x18269a[_0x8ba0('0x3a')]);_0x50e69f['attributes']=_['intersection'](_0x18269a[_0x8ba0('0x3b')],qs[_0x8ba0('0x3c')](_0x4745e6[_0x8ba0('0x3a')][_0x8ba0('0x3c')]));_0x50e69f[_0x8ba0('0x3d')]=_0x50e69f[_0x8ba0('0x3d')][_0x8ba0('0x3e')]?_0x50e69f[_0x8ba0('0x3d')]:_0x18269a[_0x8ba0('0x3b')];if(!_0x4745e6[_0x8ba0('0x3a')]['hasOwnProperty'](_0x8ba0('0x3f'))){_0x50e69f[_0x8ba0('0x28')]=qs['limit'](_0x4745e6[_0x8ba0('0x3a')][_0x8ba0('0x28')]);_0x50e69f[_0x8ba0('0x27')]=qs[_0x8ba0('0x27')](_0x4745e6[_0x8ba0('0x3a')][_0x8ba0('0x27')]);}_0x50e69f['order']=qs['sort'](_0x4745e6[_0x8ba0('0x3a')][_0x8ba0('0x40')]);_0x50e69f['where']=qs[_0x8ba0('0x41')](_[_0x8ba0('0x42')](_0x4745e6[_0x8ba0('0x3a')],_0x18269a[_0x8ba0('0x41')]),_0x384528);if(_0x4745e6[_0x8ba0('0x3a')][_0x8ba0('0x43')]){_0x50e69f[_0x8ba0('0x44')]=_[_0x8ba0('0x45')](_0x50e69f[_0x8ba0('0x44')],{'$or':_[_0x8ba0('0x46')](_0x384528,function(_0x962a09){if(_0x962a09[_0x8ba0('0x39')]!=='VIRTUAL'){var _0x31725b={};_0x31725b[_0x962a09[_0x8ba0('0x35')]]={'$like':'%'+_0x4745e6['query']['filter']+'%'};return _0x31725b;}})});}_0x50e69f=_[_0x8ba0('0x45')]({},_0x50e69f,_0x4745e6[_0x8ba0('0x47')]);var _0x58479e={'where':_0x50e69f[_0x8ba0('0x44')]};return db[_0x8ba0('0x48')]['count'](_0x58479e)['then'](function(_0x393554){_0x338d3e[_0x8ba0('0x2a')]=_0x393554;if(_0x4745e6[_0x8ba0('0x3a')][_0x8ba0('0x49')]){_0x50e69f[_0x8ba0('0x4a')]=[{'all':!![]}];}return db[_0x8ba0('0x48')][_0x8ba0('0x4b')](_0x50e69f);})[_0x8ba0('0x2f')](function(_0x296257){_0x338d3e[_0x8ba0('0x4c')]=_0x296257;return _0x338d3e;})[_0x8ba0('0x2f')](respondWithFilteredResult(_0xbf819b,_0x50e69f))[_0x8ba0('0x24')](handleError(_0xbf819b,null));};exports[_0x8ba0('0x4d')]=function(_0x359636,_0x1b2828){var _0x373bff={'raw':![],'where':{'id':_0x359636[_0x8ba0('0x4e')]['id']},'include':[{'model':db[_0x8ba0('0x4f')],'as':_0x8ba0('0x50')}]},_0x4f6ea6={};_0x4f6ea6['model']=_[_0x8ba0('0x51')](db[_0x8ba0('0x48')][_0x8ba0('0x38')]);_0x4f6ea6[_0x8ba0('0x3a')]=_[_0x8ba0('0x51')](_0x359636[_0x8ba0('0x3a')]);_0x4f6ea6['filters']=_[_0x8ba0('0x52')](_0x4f6ea6['model'],_0x4f6ea6[_0x8ba0('0x3a')]);_0x373bff[_0x8ba0('0x3d')]=_[_0x8ba0('0x52')](_0x4f6ea6[_0x8ba0('0x3b')],qs[_0x8ba0('0x3c')](_0x359636[_0x8ba0('0x3a')]['fields']));_0x373bff[_0x8ba0('0x3d')]=_0x373bff[_0x8ba0('0x3d')][_0x8ba0('0x3e')]?_0x373bff[_0x8ba0('0x3d')]:_0x4f6ea6[_0x8ba0('0x3b')];if(_0x359636[_0x8ba0('0x3a')]['includeAll']){_0x373bff[_0x8ba0('0x4a')]=[{'all':!![]}];}_0x373bff=_[_0x8ba0('0x45')]({},_0x373bff,_0x359636['options']);return db['OpenchannelAccount'][_0x8ba0('0x53')](_0x373bff)[_0x8ba0('0x2f')](handleEntityNotFound(_0x1b2828,null))[_0x8ba0('0x2f')](respondWithResult(_0x1b2828,null))[_0x8ba0('0x24')](handleError(_0x1b2828,null));};exports[_0x8ba0('0x54')]=function(_0x4a9f76,_0x7cc248){return db[_0x8ba0('0x48')][_0x8ba0('0x54')](_0x4a9f76[_0x8ba0('0x55')],{})[_0x8ba0('0x2f')](function(_0x5e20c6){var _0x35ced8=_0x4a9f76['user']['get']({'plain':!![]});if(!_0x35ced8)throw new Error(_0x8ba0('0x56'));if(_0x35ced8['role']===_0x8ba0('0x57')){var _0x5670b4=_0x5e20c6[_0x8ba0('0x31')]({'plain':!![]});var _0x5a9a43=_0x8ba0('0x32');return db[_0x8ba0('0x58')]['find']({'where':{'name':_0x5a9a43,'userProfileId':_0x35ced8[_0x8ba0('0x59')]},'raw':!![]})[_0x8ba0('0x2f')](function(_0x23d69f){if(_0x23d69f&&_0x23d69f[_0x8ba0('0x5a')]===0x0){return db[_0x8ba0('0x33')][_0x8ba0('0x54')]({'name':_0x5670b4[_0x8ba0('0x35')],'resourceId':_0x5670b4['id'],'type':_0x23d69f['name'],'sectionId':_0x23d69f['id']},{})[_0x8ba0('0x2f')](function(){return _0x5e20c6;});}else{return _0x5e20c6;}})[_0x8ba0('0x24')](function(_0x3974d5){logger[_0x8ba0('0x21')](_0x8ba0('0x5b'),_0x3974d5);throw _0x3974d5;});}return _0x5e20c6;})[_0x8ba0('0x2f')](respondWithResult(_0x7cc248,0xc9))[_0x8ba0('0x24')](handleError(_0x7cc248,null));};exports[_0x8ba0('0x5c')]=function(_0x5bede9,_0x4d185a){if(_0x5bede9[_0x8ba0('0x55')]['id']){delete _0x5bede9['body']['id'];}return db[_0x8ba0('0x48')][_0x8ba0('0x53')]({'where':{'id':_0x5bede9['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x8ba0('0x2f')](handleEntityNotFound(_0x4d185a,null))[_0x8ba0('0x2f')](saveUpdates(_0x5bede9[_0x8ba0('0x55')],null))['then'](respondWithResult(_0x4d185a,null))[_0x8ba0('0x24')](handleError(_0x4d185a,null));};exports[_0x8ba0('0x30')]=function(_0x4f44ae,_0x29f261){return db['OpenchannelAccount'][_0x8ba0('0x53')]({'where':{'id':_0x4f44ae['params']['id']}})[_0x8ba0('0x2f')](handleEntityNotFound(_0x29f261,null))[_0x8ba0('0x2f')](removeEntity(_0x29f261,null))[_0x8ba0('0x24')](handleError(_0x29f261,null));};exports['describe']=function(_0x201cfe,_0x171be1){return db['OpenchannelAccount'][_0x8ba0('0x5d')]()[_0x8ba0('0x2f')](respondWithResult(_0x171be1,null))['catch'](handleError(_0x171be1,null));};exports[_0x8ba0('0x5e')]=function(_0x1d3a03,_0x30754c,_0x574d9a){if(_0x1d3a03['body']['id']){delete _0x1d3a03['body']['id'];}return db[_0x8ba0('0x48')][_0x8ba0('0x53')]({'where':{'id':_0x1d3a03[_0x8ba0('0x4e')]['id']}})['then'](handleEntityNotFound(_0x30754c,null))[_0x8ba0('0x2f')](function(_0x4d5e43){if(_0x4d5e43){_0x1d3a03[_0x8ba0('0x55')][_0x8ba0('0x5f')]=_0x4d5e43['id'];return db['Disposition'][_0x8ba0('0x54')](_0x1d3a03[_0x8ba0('0x55')]);}})[_0x8ba0('0x2f')](respondWithResult(_0x30754c,null))[_0x8ba0('0x24')](handleError(_0x30754c,null));};exports[_0x8ba0('0x60')]=function(_0x4e3f98,_0x5ab019,_0x498fb7){var _0x4d7ffd={'raw':![],'where':{}};var _0x27549e={};var _0x188b64={'count':0x0,'rows':[]};return db[_0x8ba0('0x48')][_0x8ba0('0x61')]({'where':{'id':_0x4e3f98[_0x8ba0('0x4e')]['id']}})[_0x8ba0('0x2f')](handleEntityNotFound(_0x5ab019,null))[_0x8ba0('0x2f')](function(_0x5ae9b9){if(_0x5ae9b9){_0x27549e[_0x8ba0('0x3b')]=_[_0x8ba0('0x51')](db[_0x8ba0('0x62')]['rawAttributes']);_0x27549e['query']=_[_0x8ba0('0x51')](_0x4e3f98[_0x8ba0('0x3a')]);_0x27549e['filters']=_[_0x8ba0('0x52')](_0x27549e['model'],_0x27549e[_0x8ba0('0x3a')]);_0x4d7ffd[_0x8ba0('0x3d')]=_[_0x8ba0('0x52')](_0x27549e[_0x8ba0('0x3b')],qs[_0x8ba0('0x3c')](_0x4e3f98[_0x8ba0('0x3a')][_0x8ba0('0x3c')]));_0x4d7ffd[_0x8ba0('0x3d')]=_0x4d7ffd[_0x8ba0('0x3d')][_0x8ba0('0x3e')]?_0x4d7ffd[_0x8ba0('0x3d')]:_0x27549e[_0x8ba0('0x3b')];if(!_0x4e3f98[_0x8ba0('0x3a')][_0x8ba0('0x63')](_0x8ba0('0x3f'))){_0x4d7ffd['limit']=qs[_0x8ba0('0x28')](_0x4e3f98[_0x8ba0('0x3a')][_0x8ba0('0x28')]);_0x4d7ffd[_0x8ba0('0x27')]=qs[_0x8ba0('0x27')](_0x4e3f98['query'][_0x8ba0('0x27')]);}_0x4d7ffd[_0x8ba0('0x64')]=qs[_0x8ba0('0x40')](_0x4e3f98[_0x8ba0('0x3a')][_0x8ba0('0x40')]);_0x4d7ffd[_0x8ba0('0x44')]=qs['filters'](_[_0x8ba0('0x42')](_0x4e3f98[_0x8ba0('0x3a')],_0x27549e[_0x8ba0('0x41')]));_0x4d7ffd[_0x8ba0('0x44')][_0x8ba0('0x5f')]=_0x5ae9b9['id'];if(_0x4e3f98[_0x8ba0('0x3a')][_0x8ba0('0x43')]){_0x4d7ffd[_0x8ba0('0x44')]=_[_0x8ba0('0x45')](_0x4d7ffd[_0x8ba0('0x44')],{'$or':_['map'](_0x4d7ffd[_0x8ba0('0x3d')],function(_0x561b57){var _0x15817e={};_0x15817e[_0x561b57]={'$like':'%'+_0x4e3f98['query'][_0x8ba0('0x43')]+'%'};return _0x15817e;})});}_0x4d7ffd=_[_0x8ba0('0x45')]({},_0x4d7ffd,_0x4e3f98[_0x8ba0('0x47')]);return db[_0x8ba0('0x62')][_0x8ba0('0x2a')]({'where':_0x4d7ffd[_0x8ba0('0x44')]})[_0x8ba0('0x2f')](function(_0x31f190){_0x188b64['count']=_0x31f190;if(_0x4e3f98[_0x8ba0('0x3a')]['includeAll']){_0x4d7ffd[_0x8ba0('0x4a')]=[{'all':!![]}];}return db[_0x8ba0('0x62')][_0x8ba0('0x4b')](_0x4d7ffd);})[_0x8ba0('0x2f')](function(_0x4aaa22){_0x188b64['rows']=_0x4aaa22;return _0x188b64;});}})['then'](respondWithFilteredResult(_0x5ab019,_0x4d7ffd))[_0x8ba0('0x24')](handleError(_0x5ab019,null));};exports[_0x8ba0('0x65')]=function(_0x741cae,_0x1dff80,_0x13aab0){return db[_0x8ba0('0x48')][_0x8ba0('0x53')]({'where':{'id':_0x741cae[_0x8ba0('0x4e')]['id']}})[_0x8ba0('0x2f')](handleEntityNotFound(_0x1dff80,null))[_0x8ba0('0x2f')](function(_0x4c2664){if(_0x4c2664){return _0x4c2664[_0x8ba0('0x65')](_0x741cae['query']['ids']);}})['then'](respondWithStatusCode(_0x1dff80,null))[_0x8ba0('0x24')](handleError(_0x1dff80,null));};exports['addAnswer']=function(_0x11b970,_0x3b55af,_0x25eb84){if(_0x11b970[_0x8ba0('0x55')]['id']){delete _0x11b970[_0x8ba0('0x55')]['id'];}return db['OpenchannelAccount'][_0x8ba0('0x53')]({'where':{'id':_0x11b970['params']['id']}})['then'](handleEntityNotFound(_0x3b55af,null))[_0x8ba0('0x2f')](function(_0x33378f){if(_0x33378f){_0x11b970[_0x8ba0('0x55')][_0x8ba0('0x5f')]=_0x33378f['id'];return db[_0x8ba0('0x66')][_0x8ba0('0x54')](_0x11b970[_0x8ba0('0x55')]);}})[_0x8ba0('0x2f')](respondWithResult(_0x3b55af,null))[_0x8ba0('0x24')](handleError(_0x3b55af,null));};exports['getAnswers']=function(_0x469624,_0x331d0d,_0x4c7d60){var _0x22b4e6={'raw':![],'where':{}};var _0xae3896={};var _0x1619fd={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8ba0('0x61')]({'where':{'id':_0x469624[_0x8ba0('0x4e')]['id']}})['then'](handleEntityNotFound(_0x331d0d,null))[_0x8ba0('0x2f')](function(_0x40426a){if(_0x40426a){_0xae3896[_0x8ba0('0x3b')]=_[_0x8ba0('0x51')](db[_0x8ba0('0x66')][_0x8ba0('0x38')]);_0xae3896[_0x8ba0('0x3a')]=_[_0x8ba0('0x51')](_0x469624[_0x8ba0('0x3a')]);_0xae3896[_0x8ba0('0x41')]=_[_0x8ba0('0x52')](_0xae3896[_0x8ba0('0x3b')],_0xae3896[_0x8ba0('0x3a')]);_0x22b4e6['attributes']=_[_0x8ba0('0x52')](_0xae3896['model'],qs['fields'](_0x469624[_0x8ba0('0x3a')][_0x8ba0('0x3c')]));_0x22b4e6[_0x8ba0('0x3d')]=_0x22b4e6[_0x8ba0('0x3d')][_0x8ba0('0x3e')]?_0x22b4e6[_0x8ba0('0x3d')]:_0xae3896[_0x8ba0('0x3b')];if(!_0x469624[_0x8ba0('0x3a')]['hasOwnProperty']('nolimit')){_0x22b4e6[_0x8ba0('0x28')]=qs[_0x8ba0('0x28')](_0x469624[_0x8ba0('0x3a')][_0x8ba0('0x28')]);_0x22b4e6[_0x8ba0('0x27')]=qs['offset'](_0x469624['query'][_0x8ba0('0x27')]);}_0x22b4e6['order']=qs[_0x8ba0('0x40')](_0x469624['query'][_0x8ba0('0x40')]);_0x22b4e6[_0x8ba0('0x44')]=qs[_0x8ba0('0x41')](_[_0x8ba0('0x42')](_0x469624[_0x8ba0('0x3a')],_0xae3896[_0x8ba0('0x41')]));_0x22b4e6[_0x8ba0('0x44')][_0x8ba0('0x5f')]=_0x40426a['id'];if(_0x469624['query'][_0x8ba0('0x43')]){_0x22b4e6[_0x8ba0('0x44')]=_['merge'](_0x22b4e6[_0x8ba0('0x44')],{'$or':_[_0x8ba0('0x46')](_0x22b4e6[_0x8ba0('0x3d')],function(_0x25ba86){var _0x318fff={};_0x318fff[_0x25ba86]={'$like':'%'+_0x469624[_0x8ba0('0x3a')][_0x8ba0('0x43')]+'%'};return _0x318fff;})});}_0x22b4e6=_[_0x8ba0('0x45')]({},_0x22b4e6,_0x469624[_0x8ba0('0x47')]);return db['CannedAnswer'][_0x8ba0('0x2a')]({'where':_0x22b4e6['where']})[_0x8ba0('0x2f')](function(_0x3d9380){_0x1619fd[_0x8ba0('0x2a')]=_0x3d9380;if(_0x469624['query'][_0x8ba0('0x49')]){_0x22b4e6['include']=[{'all':!![]}];}return db[_0x8ba0('0x66')][_0x8ba0('0x4b')](_0x22b4e6);})['then'](function(_0x447740){_0x1619fd[_0x8ba0('0x4c')]=_0x447740;return _0x1619fd;});}})[_0x8ba0('0x2f')](respondWithFilteredResult(_0x331d0d,_0x22b4e6))[_0x8ba0('0x24')](handleError(_0x331d0d,null));};exports[_0x8ba0('0x67')]=function(_0x54dd79,_0x2c071c,_0xe5fec8){return db[_0x8ba0('0x48')][_0x8ba0('0x53')]({'where':{'id':_0x54dd79[_0x8ba0('0x4e')]['id']}})[_0x8ba0('0x2f')](handleEntityNotFound(_0x2c071c,null))['then'](function(_0x10e5bc){if(_0x10e5bc){return _0x10e5bc[_0x8ba0('0x67')](_0x54dd79['query']['ids']);}})[_0x8ba0('0x2f')](respondWithStatusCode(_0x2c071c,null))[_0x8ba0('0x24')](handleError(_0x2c071c,null));};exports[_0x8ba0('0x68')]=function(_0x3a825e,_0x5b2ea3,_0x5001a5){var _0x5d4f36={'body':_0x3a825e['body'],'channel':_0x8ba0('0x69')};var _0x4d1cb2=[];var _0xee4eca=[];var _0x57972f={};var _0x238f55=![];return db['CmContact'][_0x8ba0('0x5d')]()[_0x8ba0('0x2f')](function(_0x1103b){if(!_0x1103b){throw new db[(_0x8ba0('0x6a'))][(_0x8ba0('0x6b'))](_0x8ba0('0x6c'));}_0x4d1cb2=_[_0x8ba0('0x6d')](_[_0x8ba0('0x51')](_0x1103b),[_0x8ba0('0x6e'),_0x8ba0('0x6f')]);_0xee4eca=_['difference'](_[_0x8ba0('0x51')](_0x1103b),[_0x8ba0('0x6e'),_0x8ba0('0x6f'),'CompanyId','ListId']);if(_0x3a825e[_0x8ba0('0x55')]['id']){delete _0x3a825e[_0x8ba0('0x55')]['id'];}if(_['isNil'](_0x3a825e[_0x8ba0('0x55')]['from'])){throw new db[(_0x8ba0('0x6a'))][(_0x8ba0('0x6b'))](_0x8ba0('0x70'));}if(_[_0x8ba0('0x71')](_0x3a825e[_0x8ba0('0x55')][_0x8ba0('0x55')])||_0x3a825e[_0x8ba0('0x55')][_0x8ba0('0x55')]===''){throw new db['Sequelize'][(_0x8ba0('0x6b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8ba0('0x71')](_0x3a825e[_0x8ba0('0x55')][_0x8ba0('0x72')])){throw new db[(_0x8ba0('0x6a'))][(_0x8ba0('0x6b'))](_0x8ba0('0x73')+_0xee4eca);}if(!_[_0x8ba0('0x74')](_0xee4eca,_0x3a825e[_0x8ba0('0x55')][_0x8ba0('0x72')])){throw new db[(_0x8ba0('0x6a'))][(_0x8ba0('0x6b'))](_0x8ba0('0x75')+_0xee4eca);}_0x57972f[_0x3a825e[_0x8ba0('0x55')]['mapKey']]=_0x3a825e[_0x8ba0('0x55')][_0x8ba0('0x76')];})[_0x8ba0('0x2f')](function(){return db[_0x8ba0('0x48')][_0x8ba0('0x53')]({'where':{'id':_0x3a825e['params']['id']},'include':[{'model':db['CmList'],'as':_0x8ba0('0x77'),'include':[{'model':db[_0x8ba0('0x78')],'as':_0x8ba0('0x79'),'where':_0x57972f,'limit':0x1,'order':[[_0x8ba0('0x6f'),_0x8ba0('0x7a')]]}]},{'model':db[_0x8ba0('0x7b')],'as':_0x8ba0('0x7c')}]});})[_0x8ba0('0x2f')](handleEntityNotFound(_0x5b2ea3,null))[_0x8ba0('0x2f')](function(_0x56ba0e){if(_0x56ba0e&&_0x56ba0e['List']){_0x5d4f36['account']=_0x56ba0e;_0x5d4f36['applications']=_0x56ba0e['Applications'];_0x5d4f36['list']=_0x56ba0e[_0x8ba0('0x77')];_0x5d4f36[_0x8ba0('0x7d')]=_[_0x8ba0('0x7e')](_0x5d4f36[_0x8ba0('0x7d')],[_0x8ba0('0x7f')],[_0x8ba0('0x80')]);if(_0x5d4f36[_0x8ba0('0x81')][_0x8ba0('0x7c')]){delete _0x5d4f36[_0x8ba0('0x81')][_0x8ba0('0x7c')];}if(_0x5d4f36[_0x8ba0('0x81')][_0x8ba0('0x77')]&&_0x5d4f36[_0x8ba0('0x81')]['List'][_0x8ba0('0x79')][_0x8ba0('0x3e')]){return _0x5d4f36['account'][_0x8ba0('0x77')]['Contacts'][0x0];}var _0x660ad6=_[_0x8ba0('0x14')](_0x3a825e[_0x8ba0('0x55')],{'firstName':_0x3a825e['body'][_0x8ba0('0x76')],'ListId':_0x56ba0e[_0x8ba0('0x82')]});_0x660ad6[_0x3a825e[_0x8ba0('0x55')][_0x8ba0('0x72')]]=_0x3a825e[_0x8ba0('0x55')][_0x8ba0('0x76')];return db[_0x8ba0('0x78')][_0x8ba0('0x54')](_0x660ad6,{'fields':_0x4d1cb2,'raw':!![]});}})['then'](handleEntityNotFound(_0x5b2ea3,null))[_0x8ba0('0x2f')](function(_0x240815){_0x5d4f36[_0x8ba0('0x83')]=_0x240815;if(_0x240815){var _0x526dad={'ContactId':_0x240815['id'],'OpenchannelAccountId':_0x3a825e[_0x8ba0('0x4e')]['id'],'from':(_0x240815['firstName']||'')+'\x20'+(_0x240815['lastName']||'')};var _0x280091={'OpenchannelAccountId':_0x3a825e['params']['id'],'closed':![]};if(_0x3a825e[_0x8ba0('0x55')][_0x8ba0('0x84')]){_0x280091[_0x8ba0('0x84')]=_0x3a825e[_0x8ba0('0x55')][_0x8ba0('0x84')];return db[_0x8ba0('0x85')][_0x8ba0('0x53')]({'where':_0x280091})[_0x8ba0('0x2f')](function(_0x35ac36){if(_0x35ac36){return[_0x35ac36,![]];}_0x526dad['threadId']=_0x3a825e[_0x8ba0('0x55')][_0x8ba0('0x84')];_0x526dad['externalUrl']=_0x3a825e[_0x8ba0('0x55')][_0x8ba0('0x86')];return db[_0x8ba0('0x85')][_0x8ba0('0x54')](_0x526dad)[_0x8ba0('0x2f')](function(_0x20f873){return[_0x20f873,!![]];});});}else{_0x280091[_0x8ba0('0x84')]=null;}_0x280091['ContactId']=_0x240815['id'];return db[_0x8ba0('0x85')]['find']({'where':_0x280091})[_0x8ba0('0x2f')](function(_0x161653){if(_0x161653){return[_0x161653,![]];}return db['OpenchannelInteraction']['create'](_0x526dad)[_0x8ba0('0x2f')](function(_0x135169){return[_0x135169,!![]];});});}})[_0x8ba0('0x87')](function(_0x2e89df,_0x4e3e90){if(_0x2e89df){_0x238f55=_0x4e3e90;if(!_0x4e3e90){var _0x49545d={'from':(_0x5d4f36[_0x8ba0('0x83')][_0x8ba0('0x88')]||'')+'\x20'+(_0x5d4f36[_0x8ba0('0x83')]['lastName']||'')};if(_0x3a825e[_0x8ba0('0x55')]['threadId']&&_0x3a825e['body']['messageId']&&_0x3a825e[_0x8ba0('0x55')][_0x8ba0('0x84')]!=_0x3a825e['body'][_0x8ba0('0x89')]){_0x49545d['threadId']=_0x3a825e['body']['messageId'];}return _0x2e89df[_0x8ba0('0x5c')](_0x49545d);}else{return _0x2e89df;}}})[_0x8ba0('0x2f')](function(_0x29816c){_0x5d4f36['interaction']=_0x29816c[_0x8ba0('0x31')]({'plain':!![]});_0x5d4f36[_0x8ba0('0x8a')][_0x8ba0('0x8b')]=_0x238f55;if(_0x5d4f36[_0x8ba0('0x8a')]['created']){if(_0x5d4f36[_0x8ba0('0x81')]['autoclose']){_0x5d4f36[_0x8ba0('0x7d')]['push']({'id':0x0,'priority':_0x5d4f36[_0x8ba0('0x7d')][_0x8ba0('0x3e')]+0x1,'app':'close','appdata':_0x8ba0('0x8c'),'interval':'*,*,*,*'});}}return db[_0x8ba0('0x8d')][_0x8ba0('0x54')]({'body':_0x3a825e['body'][_0x8ba0('0x55')],'OpenchannelAccountId':_0x3a825e['params']['id'],'OpenchannelInteractionId':_0x29816c['id'],'direction':'in','ContactId':_0x5d4f36['contact']['id'],'AttachmentId':_0x3a825e[_0x8ba0('0x55')]['AttachmentId']});})[_0x8ba0('0x2f')](function(_0x3fea54){_0x5d4f36['message']=_0x3fea54;if(_0x5d4f36['interaction']['UserId']){return db[_0x8ba0('0x8e')][_0x8ba0('0x53')]({'attributes':['id',_0x8ba0('0x35')],'where':{'id':_0x5d4f36[_0x8ba0('0x8a')]['UserId']}})[_0x8ba0('0x2f')](function(_0x2d6958){if(_0x2d6958){_0x5d4f36['applications'][_0x8ba0('0x8f')]({'id':0x0,'priority':0x0,'app':_0x8ba0('0x90'),'appdata':_0x2d6958[_0x8ba0('0x35')]+','+(_0x5d4f36[_0x8ba0('0x81')][_0x8ba0('0x91')]||0xa),'interval':_0x8ba0('0x92')});_0x5d4f36[_0x8ba0('0x93')]=![];}return respondWithRpcPromise('Start','startRouting',_0x5d4f36);});}return respondWithRpcPromise(_0x8ba0('0x94'),_0x8ba0('0x95'),_0x5d4f36);})['then'](function(_0x3d9371){respondWithRpcPromise('EventManager',_0x8ba0('0x96'),{'event':'notify','message':_0x3d9371},client9002);return _0x3d9371;})[_0x8ba0('0x2f')](respondWithResult(_0x5b2ea3,null))[_0x8ba0('0x24')](handleError(_0x5b2ea3,null));};exports[_0x8ba0('0x97')]=function(_0x5b5051,_0x25fb0d){var _0x28668d=_0x5b5051[_0x8ba0('0x4e')]['id'];var _0x5e5780=_0x5b5051[_0x8ba0('0x55')];var _0x185b5a=0xc8;var _0x115d13=null;return db[_0x8ba0('0x98')][_0x8ba0('0x99')]({'isolationLevel':db[_0x8ba0('0x98')][_0x8ba0('0x9a')][_0x8ba0('0x9b')]['READ_COMMITTED']},function(_0x2d3fb8){return db['OpenchannelAccount'][_0x8ba0('0x61')]({'where':{'id':_0x28668d},'transaction':_0x2d3fb8})[_0x8ba0('0x2f')](function(_0x3af50b){if(_0x3af50b){return db[_0x8ba0('0x7b')][_0x8ba0('0x30')]({'where':{'OpenchannelAccountId':_0x28668d},'transaction':_0x2d3fb8})[_0x8ba0('0x2f')](function(){var _0x2013d4=_[_0x8ba0('0x46')](_0x5e5780,function(_0x270724){_0x270724['OpenchannelAccountId']=_0x28668d;return _0x270724;});return db[_0x8ba0('0x7b')][_0x8ba0('0x9c')](_0x2013d4,{'transaction':_0x2d3fb8});});}else{_0x185b5a=0x194;_0x115d13=[];}});})[_0x8ba0('0x2f')](function(){if(_0x185b5a!==0x194){return db[_0x8ba0('0x7b')][_0x8ba0('0x9d')]({'where':{'OpenchannelAccountId':_0x28668d},'order':_0x8ba0('0x7f')})[_0x8ba0('0x2f')](function(_0x3f174a){_0x115d13=_0x3f174a;});}})[_0x8ba0('0x24')](function(_0x5b3f25){_0x185b5a=0x1f4;logger[_0x8ba0('0x21')](_0x5b3f25[_0x8ba0('0x34')]);if(_0x5b3f25[_0x8ba0('0x35')]){delete _0x5b3f25[_0x8ba0('0x35')];}_0x115d13=_0x5b3f25;})['finally'](function(){if(_0x115d13===null){_0x25fb0d[_0x8ba0('0x9e')](_0x185b5a);}else{if(_0x185b5a===0x1f4){_0x25fb0d[_0x8ba0('0x25')](_0x185b5a)[_0x8ba0('0x36')](_0x115d13);}else{_0x25fb0d['status'](_0x185b5a)[_0x8ba0('0x26')](_0x115d13);}}});};exports[_0x8ba0('0x9f')]=function(_0x1fda10,_0x66225d,_0x11f7fb){var _0x690bea={};var _0x4176bd={};var _0x3403a2;var _0x35d6e1;return db['OpenchannelAccount'][_0x8ba0('0x61')]({'where':{'id':_0x1fda10[_0x8ba0('0x4e')]['id']}})[_0x8ba0('0x2f')](handleEntityNotFound(_0x66225d,null))[_0x8ba0('0x2f')](function(_0x1a29a6){if(_0x1a29a6){_0x3403a2=_0x1a29a6;_0x4176bd[_0x8ba0('0x3b')]=_['keys'](db[_0x8ba0('0x7b')][_0x8ba0('0x38')]);_0x4176bd['query']=_[_0x8ba0('0x51')](_0x1fda10[_0x8ba0('0x3a')]);_0x4176bd['filters']=_[_0x8ba0('0x52')](_0x4176bd[_0x8ba0('0x3b')],_0x4176bd[_0x8ba0('0x3a')]);_0x690bea[_0x8ba0('0x3d')]=_[_0x8ba0('0x52')](_0x4176bd[_0x8ba0('0x3b')],qs[_0x8ba0('0x3c')](_0x1fda10['query']['fields']));_0x690bea[_0x8ba0('0x3d')]=_0x690bea['attributes'][_0x8ba0('0x3e')]?_0x690bea[_0x8ba0('0x3d')]:_0x4176bd[_0x8ba0('0x3b')];_0x690bea['order']=qs[_0x8ba0('0x40')](_0x1fda10[_0x8ba0('0x3a')]['sort']);_0x690bea[_0x8ba0('0x44')]=qs[_0x8ba0('0x41')](_[_0x8ba0('0x42')](_0x1fda10[_0x8ba0('0x3a')],_0x4176bd[_0x8ba0('0x41')]));if(_0x1fda10[_0x8ba0('0x3a')]['filter']){_0x690bea[_0x8ba0('0x44')]=_['merge'](_0x690bea[_0x8ba0('0x44')],{'$or':_['map'](_0x690bea[_0x8ba0('0x3d')],function(_0x2db512){var _0x543499={};_0x543499[_0x2db512]={'$like':'%'+_0x1fda10['query'][_0x8ba0('0x43')]+'%'};return _0x543499;})});}_0x690bea=_[_0x8ba0('0x45')]({},_0x690bea,_0x1fda10['options']);return _0x3403a2[_0x8ba0('0x9f')](_0x690bea);}})[_0x8ba0('0x2f')](function(_0x3c1c07){if(_0x3c1c07){_0x35d6e1=_0x3c1c07[_0x8ba0('0x3e')];if(!_0x1fda10[_0x8ba0('0x3a')][_0x8ba0('0x63')](_0x8ba0('0x3f'))){_0x690bea[_0x8ba0('0x28')]=qs[_0x8ba0('0x28')](_0x1fda10[_0x8ba0('0x3a')][_0x8ba0('0x28')]);_0x690bea[_0x8ba0('0x27')]=qs[_0x8ba0('0x27')](_0x1fda10[_0x8ba0('0x3a')][_0x8ba0('0x27')]);}return _0x3403a2[_0x8ba0('0x9f')](_0x690bea);}})[_0x8ba0('0x2f')](function(_0x1e295a){if(_0x1e295a){return _0x1e295a?{'count':_0x35d6e1,'rows':_0x1e295a}:null;}})['then'](respondWithResult(_0x66225d,null))['catch'](handleError(_0x66225d,null));};exports[_0x8ba0('0xa0')]=function(_0x3f59a2,_0x26ea77,_0x514472){var _0x4264e9={'raw':![],'where':{}};var _0x2f5fec={};var _0xf4b6ed={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3f59a2[_0x8ba0('0x4e')]['id']}})[_0x8ba0('0x2f')](handleEntityNotFound(_0x26ea77,null))['then'](function(_0x19fc2e){if(_0x19fc2e){_0x2f5fec[_0x8ba0('0x3b')]=_[_0x8ba0('0x51')](db[_0x8ba0('0x85')][_0x8ba0('0x38')]);_0x2f5fec[_0x8ba0('0x3a')]=_[_0x8ba0('0x51')](_0x3f59a2[_0x8ba0('0x3a')]);_0x2f5fec[_0x8ba0('0x41')]=_[_0x8ba0('0x52')](_0x2f5fec[_0x8ba0('0x3b')],_0x2f5fec['query']);_0x4264e9[_0x8ba0('0x3d')]=_[_0x8ba0('0x52')](_0x2f5fec[_0x8ba0('0x3b')],qs[_0x8ba0('0x3c')](_0x3f59a2['query'][_0x8ba0('0x3c')]));_0x4264e9[_0x8ba0('0x3d')]=_0x4264e9[_0x8ba0('0x3d')][_0x8ba0('0x3e')]?_0x4264e9[_0x8ba0('0x3d')]:_0x2f5fec[_0x8ba0('0x3b')];if(!_0x3f59a2[_0x8ba0('0x3a')][_0x8ba0('0x63')](_0x8ba0('0x3f'))){_0x4264e9[_0x8ba0('0x28')]=qs['limit'](_0x3f59a2['query'][_0x8ba0('0x28')]);_0x4264e9['offset']=qs['offset'](_0x3f59a2[_0x8ba0('0x3a')]['offset']);}_0x4264e9[_0x8ba0('0x64')]=qs[_0x8ba0('0x40')](_0x3f59a2['query']['sort']);_0x4264e9[_0x8ba0('0x44')]=qs['filters'](_[_0x8ba0('0x42')](_0x3f59a2['query'],_0x2f5fec[_0x8ba0('0x41')]));_0x4264e9[_0x8ba0('0x44')][_0x8ba0('0x5f')]=_0x19fc2e['id'];if(_0x3f59a2[_0x8ba0('0x3a')][_0x8ba0('0x43')]){_0x4264e9['where']=_[_0x8ba0('0x45')](_0x4264e9[_0x8ba0('0x44')],{'$or':_[_0x8ba0('0x46')](_0x4264e9[_0x8ba0('0x3d')],function(_0x132b1f){var _0x1b6f0d={};_0x1b6f0d[_0x132b1f]={'$like':'%'+_0x3f59a2[_0x8ba0('0x3a')][_0x8ba0('0x43')]+'%'};return _0x1b6f0d;})});}_0x4264e9=_[_0x8ba0('0x45')]({},_0x4264e9,_0x3f59a2[_0x8ba0('0x47')]);return db[_0x8ba0('0x85')][_0x8ba0('0x2a')]({'where':_0x4264e9['where']})['then'](function(_0x4c698a){_0xf4b6ed[_0x8ba0('0x2a')]=_0x4c698a;if(_0x3f59a2[_0x8ba0('0x3a')][_0x8ba0('0x49')]){_0x4264e9[_0x8ba0('0x4a')]=[{'model':db[_0x8ba0('0x78')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x8ba0('0xa1'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0x8ba0('0xa2')],'as':_0x8ba0('0xa3'),'attributes':['id',_0x8ba0('0x35'),'color'],'where':_0x3f59a2[_0x8ba0('0x3a')][_0x8ba0('0xa4')]?{'id':_0x3f59a2[_0x8ba0('0x3a')][_0x8ba0('0xa4')]}:undefined,'required':_0x3f59a2[_0x8ba0('0x3a')]['tag']?!![]:![]}];}return db[_0x8ba0('0x85')][_0x8ba0('0x4b')](_0x4264e9);})['then'](function(_0x3cf042){_0xf4b6ed[_0x8ba0('0x4c')]=_0x3cf042;return _0xf4b6ed;});}})[_0x8ba0('0x2f')](respondWithFilteredResult(_0x26ea77,_0x4264e9))['catch'](handleError(_0x26ea77,null));};exports[_0x8ba0('0xa5')]=function(_0x52efbf,_0x50eb94,_0x2ab16e){return db[_0x8ba0('0x48')][_0x8ba0('0x53')]({'where':{'id':_0x52efbf[_0x8ba0('0x4e')]['id']}})[_0x8ba0('0x2f')](handleEntityNotFound(_0x50eb94,null))['then'](function(_0x55a958){if(_0x55a958){return _0x55a958[_0x8ba0('0xa5')](_0x52efbf['body'][_0x8ba0('0xa6')],_[_0x8ba0('0xa7')](_0x52efbf[_0x8ba0('0x55')],[_0x8ba0('0xa6'),'id'])||{})[_0x8ba0('0x87')](function(_0xf08257){for(var _0x27743c=0x0;_0x27743c<_0x52efbf[_0x8ba0('0x55')]['ids'][_0x8ba0('0x3e')];_0x27743c+=0x1){socket[_0x8ba0('0xa8')](_0x8ba0('0xa9'),{'UserId':Number(_0x52efbf[_0x8ba0('0x55')][_0x8ba0('0xa6')][_0x27743c]),'OpenchannelAccountId':Number(_0x52efbf[_0x8ba0('0x4e')]['id'])});}return _0xf08257;});}})[_0x8ba0('0x2f')](respondWithResult(_0x50eb94,null))[_0x8ba0('0x24')](handleError(_0x50eb94,null));};exports['removeAgents']=function(_0x5de438,_0x149d14,_0x3886a3){return db['OpenchannelAccount']['find']({'where':{'id':_0x5de438[_0x8ba0('0x4e')]['id']}})[_0x8ba0('0x2f')](handleEntityNotFound(_0x149d14,null))['then'](function(_0x2ce075){if(_0x2ce075){return _0x2ce075[_0x8ba0('0xaa')](_0x5de438[_0x8ba0('0x3a')][_0x8ba0('0xa6')])[_0x8ba0('0x2f')](function(){if(_[_0x8ba0('0xab')](_0x5de438[_0x8ba0('0x3a')]['ids'])){for(var _0x4533ea=0x0;_0x4533ea<_0x5de438[_0x8ba0('0x3a')][_0x8ba0('0xa6')]['length'];_0x4533ea+=0x1){socket[_0x8ba0('0xa8')](_0x8ba0('0xac'),{'UserId':Number(_0x5de438['query'][_0x8ba0('0xa6')][_0x4533ea]),'OpenchannelAccountId':Number(_0x5de438[_0x8ba0('0x4e')]['id'])});}}else{socket[_0x8ba0('0xa8')](_0x8ba0('0xac'),{'UserId':Number(_0x5de438[_0x8ba0('0x3a')][_0x8ba0('0xa6')]),'OpenchannelAccountId':Number(_0x5de438[_0x8ba0('0x4e')]['id'])});}});}})[_0x8ba0('0x2f')](respondWithStatusCode(_0x149d14,null))[_0x8ba0('0x24')](handleError(_0x149d14,null));};exports[_0x8ba0('0xad')]=function(_0x531820,_0x3da400,_0x315c64){var _0x28ce05={};var _0x3b2dbb={};var _0x17c90e;var _0x23f5f4;return db[_0x8ba0('0x48')][_0x8ba0('0x61')]({'where':{'id':_0x531820[_0x8ba0('0x4e')]['id']}})[_0x8ba0('0x2f')](handleEntityNotFound(_0x3da400,null))['then'](function(_0x199438){if(_0x199438){_0x17c90e=_0x199438;_0x3b2dbb['model']=_[_0x8ba0('0x51')](db[_0x8ba0('0x8e')][_0x8ba0('0x38')]);_0x3b2dbb['query']=_[_0x8ba0('0x51')](_0x531820[_0x8ba0('0x3a')]);_0x3b2dbb[_0x8ba0('0x41')]=_[_0x8ba0('0x52')](_0x3b2dbb[_0x8ba0('0x3b')],_0x3b2dbb['query']);_0x28ce05['attributes']=_[_0x8ba0('0x52')](_0x3b2dbb['model'],qs['fields'](_0x531820['query'][_0x8ba0('0x3c')]));_0x28ce05[_0x8ba0('0x3d')]=_0x28ce05[_0x8ba0('0x3d')][_0x8ba0('0x3e')]?_0x28ce05[_0x8ba0('0x3d')]:_0x3b2dbb[_0x8ba0('0x3b')];_0x28ce05[_0x8ba0('0x64')]=qs[_0x8ba0('0x40')](_0x531820[_0x8ba0('0x3a')]['sort']);_0x28ce05['where']=qs['filters'](_['pick'](_0x531820[_0x8ba0('0x3a')],_0x3b2dbb[_0x8ba0('0x41')]));if(_0x531820[_0x8ba0('0x3a')][_0x8ba0('0x43')]){_0x28ce05[_0x8ba0('0x44')]=_[_0x8ba0('0x45')](_0x28ce05[_0x8ba0('0x44')],{'$or':_['map'](_0x28ce05[_0x8ba0('0x3d')],function(_0x2ce053){var _0x36c5ec={};_0x36c5ec[_0x2ce053]={'$like':'%'+_0x531820[_0x8ba0('0x3a')][_0x8ba0('0x43')]+'%'};return _0x36c5ec;})});}_0x28ce05=_[_0x8ba0('0x45')]({},_0x28ce05,_0x531820[_0x8ba0('0x47')]);return _0x17c90e[_0x8ba0('0xad')](_0x28ce05);}})[_0x8ba0('0x2f')](function(_0x454426){if(_0x454426){_0x23f5f4=_0x454426['length'];if(!_0x531820['query']['hasOwnProperty']('nolimit')){_0x28ce05[_0x8ba0('0x28')]=qs[_0x8ba0('0x28')](_0x531820[_0x8ba0('0x3a')][_0x8ba0('0x28')]);_0x28ce05[_0x8ba0('0x27')]=qs[_0x8ba0('0x27')](_0x531820[_0x8ba0('0x3a')][_0x8ba0('0x27')]);}return _0x17c90e[_0x8ba0('0xad')](_0x28ce05);}})[_0x8ba0('0x2f')](function(_0x2ad2e2){if(_0x2ad2e2){return _0x2ad2e2?{'count':_0x23f5f4,'rows':_0x2ad2e2}:null;}})['then'](respondWithResult(_0x3da400,null))[_0x8ba0('0x24')](handleError(_0x3da400,null));};exports['send']=function(_0x54ae31,_0x2d6288,_0x29b72f){var _0x5871b4,_0x379254,_0x4da279;if(_[_0x8ba0('0x71')](_0x54ae31[_0x8ba0('0x55')][_0x8ba0('0x55')])||_0x54ae31['body'][_0x8ba0('0x55')]===''){throw new db['Sequelize'][(_0x8ba0('0x6b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8ba0('0x71')](_0x54ae31[_0x8ba0('0x55')]['to'])){}_0x5871b4=_0x54ae31[_0x8ba0('0x55')]['to'];return db[_0x8ba0('0x48')]['findOne']({'where':{'id':_0x54ae31[_0x8ba0('0x4e')]['id']}})[_0x8ba0('0x2f')](handleEntityNotFound(_0x2d6288,null))[_0x8ba0('0x2f')](function(_0x586972){if(_0x586972){return db[_0x8ba0('0x48')][_0x8ba0('0x53')]({'where':{'id':_0x586972['id']},'include':[{'model':db[_0x8ba0('0xae')],'as':_0x8ba0('0x77'),'include':[{'model':db[_0x8ba0('0x78')],'as':_0x8ba0('0x79'),'where':{[_0x586972[_0x8ba0('0x72')]]:_0x5871b4},'limit':0x1,'order':[['updatedAt',_0x8ba0('0x7a')]]}]}]})['then'](handleEntityNotFound(_0x2d6288,null))[_0x8ba0('0x2f')](function(_0x2c26aa){if(_0x2c26aa&&_0x2c26aa['List']){_0x379254=_0x2c26aa[_0x8ba0('0x31')]({'plain':!![]});if(_0x379254[_0x8ba0('0x77')]&&_0x379254[_0x8ba0('0x77')][_0x8ba0('0x79')][_0x8ba0('0x3e')]){return _0x379254[_0x8ba0('0x77')][_0x8ba0('0x79')][0x0];}return db[_0x8ba0('0x78')][_0x8ba0('0x54')](_['defaults'](_0x54ae31[_0x8ba0('0x55')],{'firstName':_0x5871b4,[_0x2c26aa['mapKey']]:_0x5871b4,'phone':_0x5871b4,'ListId':_0x379254['ListId']}));}})[_0x8ba0('0x2f')](handleEntityNotFound(_0x2d6288,null))[_0x8ba0('0x2f')](function(_0x33300f){if(_0x33300f){_0x4da279=_0x33300f;return db['OpenchannelInteraction'][_0x8ba0('0x53')]({'where':{'ContactId':_0x4da279['id'],'closed':![],'OpenchannelAccountId':_0x379254['id']}})['then'](function(_0x5176e7){if(_0x5176e7){return[_0x5176e7,![]];}return db[_0x8ba0('0x85')][_0x8ba0('0x54')]({'UserId':_0x54ae31[_0x8ba0('0x57')]['id'],'ContactId':_0x4da279['id'],'OpenchannelAccountId':_0x379254['id'],'lastMsgDirection':_0x8ba0('0xaf'),'Messages':[_[_0x8ba0('0x45')](_0x54ae31[_0x8ba0('0x55')],{'read':![],'body':_0x54ae31[_0x8ba0('0x55')][_0x8ba0('0x55')],'OpenchannelAccountId':_0x379254['id'],'UserId':_0x54ae31[_0x8ba0('0x57')]['id'],'ContactId':_0x4da279['id']})]},{'include':[{'model':db[_0x8ba0('0x8d')],'as':_0x8ba0('0xb0')}]})[_0x8ba0('0x2f')](function(_0x1ebc86){return[_0x1ebc86,!![]];});});}})[_0x8ba0('0x87')](function(_0x171e5b,_0xadf022){if(_0xadf022){return _0x171e5b;}return db['OpenchannelMessage']['create'](_['merge'](_0x54ae31['body'],{'read':![],'body':_0x54ae31[_0x8ba0('0x55')][_0x8ba0('0x55')],'OpenchannelAccountId':_0x379254['id'],'OpenchannelInteractionId':_0x171e5b['id'],'UserId':_0x54ae31[_0x8ba0('0x57')]['id'],'ContactId':_0x4da279['id']}))[_0x8ba0('0x2f')](function(_0x1ba693){_0x171e5b[_0x8ba0('0xb1')]['Messages']=[];_0x171e5b['dataValues'][_0x8ba0('0xb0')][_0x8ba0('0xb2')](_0x1ba693['dataValues']);return _0x171e5b;});});}})['then'](respondWithResult(_0x2d6288,null))['catch'](handleError(_0x2d6288,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 309e5de..68fbb77 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 _0x70e0=['emit','events','../../mysqldb','OpenchannelAccount','update','remove'];(function(_0x5cf3d9,_0x14f2c6){var _0x356795=function(_0x1077e5){while(--_0x1077e5){_0x5cf3d9['push'](_0x5cf3d9['shift']());}};_0x356795(++_0x14f2c6);}(_0x70e0,0x17b));var _0x070e=function(_0x14e627,_0x44af2c){_0x14e627=_0x14e627-0x0;var _0x395afa=_0x70e0[_0x14e627];return _0x395afa;};'use strict';var EventEmitter=require(_0x070e('0x0'));var OpenchannelAccount=require(_0x070e('0x1'))['db'][_0x070e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x070e('0x3'),'afterDestroy':_0x070e('0x4')};function emitEvent(_0x277d32){return function(_0x2593e5,_0x5c90fc,_0x7bce9b){OpenchannelAccountEvents['emit'](_0x277d32+':'+_0x2593e5['id'],_0x2593e5);OpenchannelAccountEvents[_0x070e('0x5')](_0x277d32,_0x2593e5);_0x7bce9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xcb91=['save','update','emit','hasOwnProperty','hook','OpenchannelAccount','setMaxListeners'];(function(_0x5a3e3f,_0x2d38c8){var _0x300b3b=function(_0x20f207){while(--_0x20f207){_0x5a3e3f['push'](_0x5a3e3f['shift']());}};_0x300b3b(++_0x2d38c8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0xcb91[_0x22e47a];return _0x15a12a;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x1cb9('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x1cb9('0x1')](0x0);var events={'afterCreate':_0x1cb9('0x2'),'afterUpdate':_0x1cb9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8c392f){return function(_0x2c17b8,_0x545a34,_0x13d5fd){OpenchannelAccountEvents[_0x1cb9('0x4')](_0x8c392f+':'+_0x2c17b8['id'],_0x2c17b8);OpenchannelAccountEvents['emit'](_0x8c392f,_0x2c17b8);_0x13d5fd(null);};}for(var e in events){if(events[_0x1cb9('0x5')](e)){var event=events[e];OpenchannelAccount[_0x1cb9('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index f171d8d..8e39411 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(_0x34b28d,_0x51ef4f){var _0x1c0f56=function(_0x3c743d){while(--_0x3c743d){_0x34b28d['push'](_0x34b28d['shift']());}};_0x1c0f56(++_0x51ef4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x4fe049,_0x3c4c70){var _0x3a99a2=function(_0x2ca2c8){while(--_0x2ca2c8){_0x4fe049['push'](_0x4fe049['shift']());}};_0x3a99a2(++_0x3c4c70);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 8490cbd..4b47e3d 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 _0xe9e8=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x5129fe,_0x5f62e0){var _0x143b7b=function(_0x31f1a2){while(--_0x31f1a2){_0x5129fe['push'](_0x5129fe['shift']());}};_0x143b7b(++_0x5f62e0);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x441488,_0x5cc1a0){_0x441488=_0x441488-0x0;var _0x1c5e34=_0xe9e8[_0x441488];return _0x1c5e34;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var moment=require(_0x8e9e('0x2'));var BPromise=require(_0x8e9e('0x3'));var rs=require(_0x8e9e('0x4'));var fs=require('fs');var Redis=require(_0x8e9e('0x5'));var db=require(_0x8e9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e9e('0x7'))(_0x8e9e('0x8'));var config=require(_0x8e9e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8e9e('0xa')][_0x8e9e('0xb')]({'port':0x232a});config[_0x8e9e('0xc')]=_[_0x8e9e('0xd')](config['redis'],{'host':_0x8e9e('0xe'),'port':0x18eb});var socket=require(_0x8e9e('0xf'))(new Redis(config[_0x8e9e('0xc')]));require('./openchannelAccount.socket')[_0x8e9e('0x10')](socket);function respondWithRpcPromise(_0x29edcb,_0x449f72,_0x57ffc0){return new BPromise(function(_0xbcfd72,_0x303402){return client[_0x8e9e('0x11')](_0x29edcb,_0x57ffc0)[_0x8e9e('0x12')](function(_0x35f014){logger[_0x8e9e('0x13')](_0x8e9e('0x14'),_0x449f72,'request\x20sent');logger[_0x8e9e('0x15')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x449f72,_0x8e9e('0x16'),JSON[_0x8e9e('0x17')](_0x35f014));if(_0x35f014[_0x8e9e('0x18')]){if(_0x35f014[_0x8e9e('0x18')][_0x8e9e('0x19')]===0x1f4){logger[_0x8e9e('0x18')](_0x8e9e('0x14'),_0x449f72,_0x35f014['error']['message']);return _0x303402(_0x35f014[_0x8e9e('0x18')][_0x8e9e('0x1a')]);}logger['error'](_0x8e9e('0x14'),_0x449f72,_0x35f014[_0x8e9e('0x18')][_0x8e9e('0x1a')]);return _0xbcfd72(_0x35f014[_0x8e9e('0x18')][_0x8e9e('0x1a')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x449f72,_0x8e9e('0x16'));_0xbcfd72(_0x35f014[_0x8e9e('0x1b')][_0x8e9e('0x1a')]);}})[_0x8e9e('0x1c')](function(_0xa079b5){logger[_0x8e9e('0x18')](_0x8e9e('0x14'),_0x449f72,_0xa079b5);_0x303402(_0xa079b5);});});} \ No newline at end of file +var _0xb58b=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','util','moment','bluebird'];(function(_0x2c6d59,_0x1fd655){var _0x3d844f=function(_0x5cdfe3){while(--_0x5cdfe3){_0x2c6d59['push'](_0x2c6d59['shift']());}};_0x3d844f(++_0x1fd655);}(_0xb58b,0x1f1));var _0xbb58=function(_0x1e0f3a,_0x2cb502){_0x1e0f3a=_0x1e0f3a-0x0;var _0x4d54f6=_0xb58b[_0x1e0f3a];return _0x4d54f6;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var moment=require(_0xbb58('0x1'));var BPromise=require(_0xbb58('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb58('0x3'));var db=require(_0xbb58('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb58('0x5'))('rpc');var config=require(_0xbb58('0x6'));var jayson=require(_0xbb58('0x7'));var client=jayson[_0xbb58('0x8')]['http']({'port':0x232a});config[_0xbb58('0x9')]=_[_0xbb58('0xa')](config[_0xbb58('0x9')],{'host':_0xbb58('0xb'),'port':0x18eb});var socket=require(_0xbb58('0xc'))(new Redis(config[_0xbb58('0x9')]));require(_0xbb58('0xd'))[_0xbb58('0xe')](socket);function respondWithRpcPromise(_0x429e75,_0x261d00,_0x27f77f){return new BPromise(function(_0x4bb8c5,_0x80ab3a){return client['request'](_0x429e75,_0x27f77f)[_0xbb58('0xf')](function(_0x440392){logger[_0xbb58('0x10')](_0xbb58('0x11'),_0x261d00,'request\x20sent');logger[_0xbb58('0x12')](_0xbb58('0x13'),_0x261d00,'request\x20sent',JSON[_0xbb58('0x14')](_0x440392));if(_0x440392[_0xbb58('0x15')]){if(_0x440392[_0xbb58('0x15')][_0xbb58('0x16')]===0x1f4){logger[_0xbb58('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x261d00,_0x440392[_0xbb58('0x15')][_0xbb58('0x17')]);return _0x80ab3a(_0x440392['error']['message']);}logger[_0xbb58('0x15')](_0xbb58('0x11'),_0x261d00,_0x440392[_0xbb58('0x15')]['message']);return _0x4bb8c5(_0x440392['error']['message']);}else{logger['info'](_0xbb58('0x11'),_0x261d00,_0xbb58('0x18'));_0x4bb8c5(_0x440392['result'][_0xbb58('0x17')]);}})['catch'](function(_0x2cf892){logger[_0xbb58('0x15')](_0xbb58('0x11'),_0x261d00,_0x2cf892);_0x80ab3a(_0x2cf892);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index be388eb..d109d95 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 _0x032a=['save','update','emit','removeListener','register'];(function(_0x15f817,_0x4f356f){var _0x50decc=function(_0xcdc95e){while(--_0xcdc95e){_0x15f817['push'](_0x15f817['shift']());}};_0x50decc(++_0x4f356f);}(_0x032a,0xf0));var _0xa032=function(_0x212fcc,_0x1a8867){_0x212fcc=_0x212fcc-0x0;var _0x4d8190=_0x032a[_0x212fcc];return _0x4d8190;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xa032('0x0'),'remove',_0xa032('0x1')];function createListener(_0x39053e,_0x40e5b5){return function(_0x2ee4ef){_0x40e5b5[_0xa032('0x2')](_0x39053e,_0x2ee4ef);};}function removeListener(_0x23ad84,_0x24612f){return function(){OpenchannelAccountEvents[_0xa032('0x3')](_0x23ad84,_0x24612f);};}exports[_0xa032('0x4')]=function(_0x2b1445){for(var _0x43d0f5=0x0,_0x40128a=events['length'];_0x43d0f5<_0x40128a;_0x43d0f5++){var _0x616437=events[_0x43d0f5];var _0x4a5d8e=createListener('openchannelAccount:'+_0x616437,_0x2b1445);OpenchannelAccountEvents['on'](_0x616437,_0x4a5d8e);}}; \ No newline at end of file +var _0xc788=['./openchannelAccount.events','save','remove','emit','register','length','openchannelAccount:'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xc788,0xc4));var _0x8c78=function(_0x3e1555,_0xd901c2){_0x3e1555=_0x3e1555-0x0;var _0x14824b=_0xc788[_0x3e1555];return _0x14824b;};'use strict';var OpenchannelAccountEvents=require(_0x8c78('0x0'));var events=[_0x8c78('0x1'),_0x8c78('0x2'),'update'];function createListener(_0x4ce125,_0x1c7ff3){return function(_0x1af8e2){_0x1c7ff3[_0x8c78('0x3')](_0x4ce125,_0x1af8e2);};}function removeListener(_0x1d0670,_0x386f0a){return function(){OpenchannelAccountEvents['removeListener'](_0x1d0670,_0x386f0a);};}exports[_0x8c78('0x4')]=function(_0x4555da){for(var _0x329152=0x0,_0x1ac27f=events[_0x8c78('0x5')];_0x329152<_0x1ac27f;_0x329152++){var _0x4d54a5=events[_0x329152];var _0x247188=createListener(_0x8c78('0x6')+_0x4d54a5,_0x4555da);OpenchannelAccountEvents['on'](_0x4d54a5,_0x247188);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index ba6c826..14be2da 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 _0x1f55=['fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete','util','path','Router'];(function(_0x182563,_0x7bfd78){var _0x4f5fb4=function(_0x543a88){while(--_0x543a88){_0x182563['push'](_0x182563['shift']());}};_0x4f5fb4(++_0x7bfd78);}(_0x1f55,0xbd));var _0x51f5=function(_0x5e312e,_0x324cef){_0x5e312e=_0x5e312e-0x0;var _0x10db09=_0x1f55[_0x5e312e];return _0x10db09;};'use strict';var multer=require('multer');var util=require(_0x51f5('0x0'));var path=require(_0x51f5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x51f5('0x2')]();var fs_extra=require(_0x51f5('0x3'));var auth=require(_0x51f5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x51f5('0x5'));var controller=require(_0x51f5('0x6'));router[_0x51f5('0x7')]('/',auth[_0x51f5('0x8')](),controller[_0x51f5('0x9')]);router[_0x51f5('0x7')]('/:id',auth[_0x51f5('0x8')](),controller['show']);router[_0x51f5('0xa')]('/',auth[_0x51f5('0x8')](),controller[_0x51f5('0xb')]);router[_0x51f5('0xc')](_0x51f5('0xd'),auth[_0x51f5('0x8')](),controller[_0x51f5('0xe')]);router[_0x51f5('0xf')](_0x51f5('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8091=['Router','../../components/auth/service','./openchannelApplication.controller','isAuthenticated','get','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','express'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x8091,0x73));var _0x1809=function(_0x3d4191,_0x5bce45){_0x3d4191=_0x3d4191-0x0;var _0x5a73f0=_0x8091[_0x3d4191];return _0x5a73f0;};'use strict';var multer=require(_0x1809('0x0'));var util=require(_0x1809('0x1'));var path=require(_0x1809('0x2'));var timeout=require('connect-timeout');var express=require(_0x1809('0x3'));var router=express[_0x1809('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1809('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1809('0x6'));router['get']('/',auth[_0x1809('0x7')](),controller['index']);router[_0x1809('0x8')]('/:id',auth[_0x1809('0x7')](),controller[_0x1809('0x9')]);router[_0x1809('0xa')]('/',auth[_0x1809('0x7')](),controller['create']);router[_0x1809('0xb')](_0x1809('0xc'),auth[_0x1809('0x7')](),controller[_0x1809('0xd')]);router[_0x1809('0xe')](_0x1809('0xc'),auth['isAuthenticated'](),controller[_0x1809('0xf')]);module[_0x1809('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 3918bec..6a40dca 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 _0x25f3=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x25f3,0x19b));var _0x325f=function(_0x453721,_0x55b8c9){_0x453721=_0x453721-0x0;var _0x480a22=_0x25f3[_0x453721];return _0x480a22;};'use strict';var Sequelize=require(_0x325f('0x0'));module[_0x325f('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x325f('0x2')],'allowNull':![],'defaultValue':_0x325f('0x3')},'appdata':{'type':Sequelize[_0x325f('0x4')]()},'description':{'type':Sequelize[_0x325f('0x2')]},'interval':{'type':Sequelize[_0x325f('0x2')],'defaultValue':_0x325f('0x5')}}; \ No newline at end of file +var _0x28d4=['STRING','sequelize','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x28d4,0xbb));var _0x428d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x28d4[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x428d('0x0'));module[_0x428d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x428d('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x428d('0x2')]},'interval':{'type':Sequelize[_0x428d('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 6b9d601..c575cde 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 _0xf17b=['model','fields','attributes','sort','where','filters','pick','filter','merge','type','options','OpenchannelApplication','includeAll','catch','params','rawAttributes','length','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','key','query','keys','intersection'];(function(_0x38697a,_0x2af2f2){var _0x2995e3=function(_0x1a7de0){while(--_0x1a7de0){_0x38697a['push'](_0x38697a['shift']());}};_0x2995e3(++_0x2af2f2);}(_0xf17b,0x12d));var _0xbf17=function(_0x334619,_0x4d049e){_0x334619=_0x334619-0x0;var _0x174dea=_0xf17b[_0x334619];return _0x174dea;};'use strict';var emlformat=require(_0xbf17('0x0'));var rimraf=require(_0xbf17('0x1'));var zipdir=require(_0xbf17('0x2'));var jsonpatch=require(_0xbf17('0x3'));var rp=require(_0xbf17('0x4'));var moment=require(_0xbf17('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf17('0x6'));var path=require(_0xbf17('0x7'));var sox=require('sox');var csv=require(_0xbf17('0x8'));var ejs=require(_0xbf17('0x9'));var fs=require('fs');var fs_extra=require(_0xbf17('0xa'));var _=require(_0xbf17('0xb'));var squel=require(_0xbf17('0xc'));var crypto=require(_0xbf17('0xd'));var jsforce=require(_0xbf17('0xe'));var deskjs=require(_0xbf17('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbf17('0x10'));var Papa=require(_0xbf17('0x11'));var Redis=require(_0xbf17('0x12'));var authService=require(_0xbf17('0x13'));var qs=require(_0xbf17('0x14'));var as=require(_0xbf17('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf17('0x16'))('api');var utils=require(_0xbf17('0x17'));var config=require(_0xbf17('0x18'));var licenseUtil=require(_0xbf17('0x19'));var db=require(_0xbf17('0x1a'))['db'];function respondWithStatusCode(_0x4a06a9,_0x3e2b29){_0x3e2b29=_0x3e2b29||0xcc;return function(_0x540b37){if(_0x540b37){return _0x4a06a9['sendStatus'](_0x3e2b29);}return _0x4a06a9[_0xbf17('0x1b')](_0x3e2b29)['end']();};}function respondWithResult(_0x388cf2,_0x13bdb5){_0x13bdb5=_0x13bdb5||0xc8;return function(_0x561b65){if(_0x561b65){return _0x388cf2[_0xbf17('0x1b')](_0x13bdb5)[_0xbf17('0x1c')](_0x561b65);}};}function respondWithFilteredResult(_0x222835,_0x5ce313){return function(_0x3a3090){if(_0x3a3090){var _0x2edc60=typeof _0x5ce313[_0xbf17('0x1d')]==='undefined'&&typeof _0x5ce313[_0xbf17('0x1e')]==='undefined';var _0x1a3a1b=_0x3a3090[_0xbf17('0x1f')];var _0x55ba24=_0x2edc60?0x0:_0x5ce313['offset'];var _0x5b7591=_0x2edc60?_0x3a3090['count']:_0x5ce313['offset']+_0x5ce313[_0xbf17('0x1e')];var _0x478904;if(_0x5b7591>=_0x1a3a1b){_0x5b7591=_0x1a3a1b;_0x478904=0xc8;}else{_0x478904=0xce;}_0x222835['status'](_0x478904);return _0x222835[_0xbf17('0x20')](_0xbf17('0x21'),_0x55ba24+'-'+_0x5b7591+'/'+_0x1a3a1b)[_0xbf17('0x1c')](_0x3a3090);}return null;};}function patchUpdates(_0x3a4cb1){return function(_0x3d7dda){try{jsonpatch['apply'](_0x3d7dda,_0x3a4cb1,!![]);}catch(_0x44fa09){return BPromise[_0xbf17('0x22')](_0x44fa09);}return _0x3d7dda['save']();};}function saveUpdates(_0x26794c,_0x41196c){return function(_0x188d0c){if(_0x188d0c){return _0x188d0c[_0xbf17('0x23')](_0x26794c)[_0xbf17('0x24')](function(_0x2bb9cf){return _0x2bb9cf;});}return null;};}function removeEntity(_0x5e1b7b,_0x1691d7){return function(_0x22c097){if(_0x22c097){return _0x22c097[_0xbf17('0x25')]()['then'](function(){_0x5e1b7b[_0xbf17('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cf845,_0x15e43f){return function(_0x135d29){if(!_0x135d29){_0x4cf845[_0xbf17('0x26')](0x194);}return _0x135d29;};}function handleError(_0x3bbd29,_0x5add7a){_0x5add7a=_0x5add7a||0x1f4;return function(_0x57614f){logger[_0xbf17('0x27')](_0x57614f[_0xbf17('0x28')]);if(_0x57614f[_0xbf17('0x29')]){delete _0x57614f[_0xbf17('0x29')];}_0x3bbd29[_0xbf17('0x1b')](_0x5add7a)[_0xbf17('0x2a')](_0x57614f);};}exports[_0xbf17('0x2b')]=function(_0x4d3146,_0x260196){var _0x16470c={},_0x514f12={},_0x5b315f={'count':0x0,'rows':[]};var _0x4f28d5=_[_0xbf17('0x2c')](db['OpenchannelApplication']['rawAttributes'],function(_0x28e219){return{'name':_0x28e219['fieldName'],'type':_0x28e219['type'][_0xbf17('0x2d')]};});_0x514f12['model']=_['map'](_0x4f28d5,_0xbf17('0x29'));_0x514f12[_0xbf17('0x2e')]=_[_0xbf17('0x2f')](_0x4d3146[_0xbf17('0x2e')]);_0x514f12['filters']=_[_0xbf17('0x30')](_0x514f12[_0xbf17('0x31')],_0x514f12[_0xbf17('0x2e')]);_0x16470c['attributes']=_['intersection'](_0x514f12[_0xbf17('0x31')],qs[_0xbf17('0x32')](_0x4d3146[_0xbf17('0x2e')]['fields']));_0x16470c[_0xbf17('0x33')]=_0x16470c['attributes']['length']?_0x16470c['attributes']:_0x514f12[_0xbf17('0x31')];if(!_0x4d3146['query']['hasOwnProperty']('nolimit')){_0x16470c[_0xbf17('0x1e')]=qs[_0xbf17('0x1e')](_0x4d3146[_0xbf17('0x2e')][_0xbf17('0x1e')]);_0x16470c[_0xbf17('0x1d')]=qs[_0xbf17('0x1d')](_0x4d3146[_0xbf17('0x2e')]['offset']);}_0x16470c['order']=qs[_0xbf17('0x34')](_0x4d3146[_0xbf17('0x2e')][_0xbf17('0x34')]);_0x16470c[_0xbf17('0x35')]=qs[_0xbf17('0x36')](_[_0xbf17('0x37')](_0x4d3146['query'],_0x514f12['filters']),_0x4f28d5);if(_0x4d3146[_0xbf17('0x2e')][_0xbf17('0x38')]){_0x16470c[_0xbf17('0x35')]=_[_0xbf17('0x39')](_0x16470c['where'],{'$or':_[_0xbf17('0x2c')](_0x4f28d5,function(_0xeb804f){if(_0xeb804f[_0xbf17('0x3a')]!=='VIRTUAL'){var _0x50c2b5={};_0x50c2b5[_0xeb804f[_0xbf17('0x29')]]={'$like':'%'+_0x4d3146['query'][_0xbf17('0x38')]+'%'};return _0x50c2b5;}})});}_0x16470c=_[_0xbf17('0x39')]({},_0x16470c,_0x4d3146[_0xbf17('0x3b')]);var _0x371e3d={'where':_0x16470c[_0xbf17('0x35')]};return db[_0xbf17('0x3c')]['count'](_0x371e3d)['then'](function(_0x2c35a8){_0x5b315f[_0xbf17('0x1f')]=_0x2c35a8;if(_0x4d3146[_0xbf17('0x2e')][_0xbf17('0x3d')]){_0x16470c['include']=[{'all':!![]}];}return db[_0xbf17('0x3c')]['findAll'](_0x16470c);})['then'](function(_0xe8f720){_0x5b315f['rows']=_0xe8f720;return _0x5b315f;})['then'](respondWithFilteredResult(_0x260196,_0x16470c))[_0xbf17('0x3e')](handleError(_0x260196,null));};exports['show']=function(_0x5b7382,_0x1cb177){var _0xba438c={'raw':!![],'where':{'id':_0x5b7382[_0xbf17('0x3f')]['id']}},_0x4520bf={};_0x4520bf[_0xbf17('0x31')]=_[_0xbf17('0x2f')](db[_0xbf17('0x3c')][_0xbf17('0x40')]);_0x4520bf['query']=_[_0xbf17('0x2f')](_0x5b7382[_0xbf17('0x2e')]);_0x4520bf[_0xbf17('0x36')]=_['intersection'](_0x4520bf[_0xbf17('0x31')],_0x4520bf[_0xbf17('0x2e')]);_0xba438c[_0xbf17('0x33')]=_[_0xbf17('0x30')](_0x4520bf['model'],qs[_0xbf17('0x32')](_0x5b7382['query'][_0xbf17('0x32')]));_0xba438c[_0xbf17('0x33')]=_0xba438c[_0xbf17('0x33')][_0xbf17('0x41')]?_0xba438c[_0xbf17('0x33')]:_0x4520bf[_0xbf17('0x31')];if(_0x5b7382[_0xbf17('0x2e')]['includeAll']){_0xba438c[_0xbf17('0x42')]=[{'all':!![]}];}_0xba438c=_[_0xbf17('0x39')]({},_0xba438c,_0x5b7382[_0xbf17('0x3b')]);return db[_0xbf17('0x3c')][_0xbf17('0x43')](_0xba438c)[_0xbf17('0x24')](handleEntityNotFound(_0x1cb177,null))[_0xbf17('0x24')](respondWithResult(_0x1cb177,null))[_0xbf17('0x3e')](handleError(_0x1cb177,null));};exports[_0xbf17('0x44')]=function(_0x42e8f0,_0x1c0fe7){return db[_0xbf17('0x3c')][_0xbf17('0x44')](_0x42e8f0[_0xbf17('0x45')],{})[_0xbf17('0x24')](respondWithResult(_0x1c0fe7,0xc9))[_0xbf17('0x3e')](handleError(_0x1c0fe7,null));};exports[_0xbf17('0x23')]=function(_0x3a6af1,_0x9c632d){if(_0x3a6af1[_0xbf17('0x45')]['id']){delete _0x3a6af1['body']['id'];}return db[_0xbf17('0x3c')][_0xbf17('0x43')]({'where':{'id':_0x3a6af1['params']['id']}})[_0xbf17('0x24')](handleEntityNotFound(_0x9c632d,null))['then'](saveUpdates(_0x3a6af1[_0xbf17('0x45')],null))[_0xbf17('0x24')](respondWithResult(_0x9c632d,null))['catch'](handleError(_0x9c632d,null));};exports[_0xbf17('0x25')]=function(_0x15b57a,_0x3b1535){return db[_0xbf17('0x3c')][_0xbf17('0x43')]({'where':{'id':_0x15b57a[_0xbf17('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3b1535,null))[_0xbf17('0x24')](removeEntity(_0x3b1535,null))[_0xbf17('0x3e')](handleError(_0x3b1535,null));}; \ No newline at end of file +var _0xae4f=['end','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','then','error','stack','send','map','OpenchannelApplication','fieldName','type','key','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','findAll','catch','show','params','rawAttributes','includeAll','include','options','find','create','body','update','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x24f1ff,_0x4014c9){var _0x349109=function(_0x253267){while(--_0x253267){_0x24f1ff['push'](_0x24f1ff['shift']());}};_0x349109(++_0x4014c9);}(_0xae4f,0x16b));var _0xfae4=function(_0x2e4b91,_0x8db0e5){_0x2e4b91=_0x2e4b91-0x0;var _0x572d95=_0xae4f[_0x2e4b91];return _0x572d95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfae4('0x0'));var zipdir=require(_0xfae4('0x1'));var jsonpatch=require(_0xfae4('0x2'));var rp=require(_0xfae4('0x3'));var moment=require(_0xfae4('0x4'));var BPromise=require(_0xfae4('0x5'));var Mustache=require(_0xfae4('0x6'));var util=require(_0xfae4('0x7'));var path=require(_0xfae4('0x8'));var sox=require(_0xfae4('0x9'));var csv=require('to-csv');var ejs=require(_0xfae4('0xa'));var fs=require('fs');var fs_extra=require(_0xfae4('0xb'));var _=require(_0xfae4('0xc'));var squel=require(_0xfae4('0xd'));var crypto=require('crypto');var jsforce=require(_0xfae4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfae4('0xf'));var querystring=require('querystring');var Papa=require(_0xfae4('0x10'));var Redis=require(_0xfae4('0x11'));var authService=require(_0xfae4('0x12'));var qs=require(_0xfae4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfae4('0x14'));var logger=require(_0xfae4('0x15'))(_0xfae4('0x16'));var utils=require(_0xfae4('0x17'));var config=require(_0xfae4('0x18'));var licenseUtil=require(_0xfae4('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb4e8f4,_0x247f4c){_0x247f4c=_0x247f4c||0xcc;return function(_0xdeb964){if(_0xdeb964){return _0xb4e8f4[_0xfae4('0x1a')](_0x247f4c);}return _0xb4e8f4['status'](_0x247f4c)[_0xfae4('0x1b')]();};}function respondWithResult(_0x331463,_0x3862c9){_0x3862c9=_0x3862c9||0xc8;return function(_0x529ed2){if(_0x529ed2){return _0x331463[_0xfae4('0x1c')](_0x3862c9)['json'](_0x529ed2);}};}function respondWithFilteredResult(_0x334df2,_0x42d7a8){return function(_0x52e5c8){if(_0x52e5c8){var _0x212424=typeof _0x42d7a8['offset']===_0xfae4('0x1d')&&typeof _0x42d7a8[_0xfae4('0x1e')]==='undefined';var _0x49837c=_0x52e5c8['count'];var _0x482ee3=_0x212424?0x0:_0x42d7a8[_0xfae4('0x1f')];var _0x3f428c=_0x212424?_0x52e5c8[_0xfae4('0x20')]:_0x42d7a8[_0xfae4('0x1f')]+_0x42d7a8[_0xfae4('0x1e')];var _0x2f2f74;if(_0x3f428c>=_0x49837c){_0x3f428c=_0x49837c;_0x2f2f74=0xc8;}else{_0x2f2f74=0xce;}_0x334df2[_0xfae4('0x1c')](_0x2f2f74);return _0x334df2[_0xfae4('0x21')](_0xfae4('0x22'),_0x482ee3+'-'+_0x3f428c+'/'+_0x49837c)[_0xfae4('0x23')](_0x52e5c8);}return null;};}function patchUpdates(_0x2eae5e){return function(_0x55a274){try{jsonpatch[_0xfae4('0x24')](_0x55a274,_0x2eae5e,!![]);}catch(_0x258f84){return BPromise[_0xfae4('0x25')](_0x258f84);}return _0x55a274[_0xfae4('0x26')]();};}function saveUpdates(_0x11e96c,_0x4f9f65){return function(_0x13132e){if(_0x13132e){return _0x13132e['update'](_0x11e96c)[_0xfae4('0x27')](function(_0x20fb44){return _0x20fb44;});}return null;};}function removeEntity(_0x1b3725,_0x3fb146){return function(_0x588cb5){if(_0x588cb5){return _0x588cb5['destroy']()['then'](function(){_0x1b3725[_0xfae4('0x1c')](0xcc)[_0xfae4('0x1b')]();});}};}function handleEntityNotFound(_0x1a81a1,_0xa48a2c){return function(_0x5b3c71){if(!_0x5b3c71){_0x1a81a1[_0xfae4('0x1a')](0x194);}return _0x5b3c71;};}function handleError(_0x5a8606,_0x5c8ce3){_0x5c8ce3=_0x5c8ce3||0x1f4;return function(_0x116f2d){logger[_0xfae4('0x28')](_0x116f2d[_0xfae4('0x29')]);if(_0x116f2d['name']){delete _0x116f2d['name'];}_0x5a8606[_0xfae4('0x1c')](_0x5c8ce3)[_0xfae4('0x2a')](_0x116f2d);};}exports['index']=function(_0x241547,_0x405ab0){var _0x10af5e={},_0x4563d2={},_0x2ca6a5={'count':0x0,'rows':[]};var _0x22e53a=_[_0xfae4('0x2b')](db[_0xfae4('0x2c')]['rawAttributes'],function(_0x2466ca){return{'name':_0x2466ca[_0xfae4('0x2d')],'type':_0x2466ca[_0xfae4('0x2e')][_0xfae4('0x2f')]};});_0x4563d2[_0xfae4('0x30')]=_['map'](_0x22e53a,_0xfae4('0x31'));_0x4563d2['query']=_[_0xfae4('0x32')](_0x241547[_0xfae4('0x33')]);_0x4563d2[_0xfae4('0x34')]=_[_0xfae4('0x35')](_0x4563d2[_0xfae4('0x30')],_0x4563d2['query']);_0x10af5e['attributes']=_[_0xfae4('0x35')](_0x4563d2[_0xfae4('0x30')],qs[_0xfae4('0x36')](_0x241547[_0xfae4('0x33')][_0xfae4('0x36')]));_0x10af5e[_0xfae4('0x37')]=_0x10af5e[_0xfae4('0x37')][_0xfae4('0x38')]?_0x10af5e['attributes']:_0x4563d2[_0xfae4('0x30')];if(!_0x241547[_0xfae4('0x33')][_0xfae4('0x39')]('nolimit')){_0x10af5e[_0xfae4('0x1e')]=qs[_0xfae4('0x1e')](_0x241547['query'][_0xfae4('0x1e')]);_0x10af5e[_0xfae4('0x1f')]=qs[_0xfae4('0x1f')](_0x241547[_0xfae4('0x33')][_0xfae4('0x1f')]);}_0x10af5e[_0xfae4('0x3a')]=qs['sort'](_0x241547[_0xfae4('0x33')][_0xfae4('0x3b')]);_0x10af5e['where']=qs[_0xfae4('0x34')](_[_0xfae4('0x3c')](_0x241547[_0xfae4('0x33')],_0x4563d2[_0xfae4('0x34')]),_0x22e53a);if(_0x241547[_0xfae4('0x33')][_0xfae4('0x3d')]){_0x10af5e[_0xfae4('0x3e')]=_[_0xfae4('0x3f')](_0x10af5e[_0xfae4('0x3e')],{'$or':_[_0xfae4('0x2b')](_0x22e53a,function(_0x5406b5){if(_0x5406b5[_0xfae4('0x2e')]!==_0xfae4('0x40')){var _0x39204c={};_0x39204c[_0x5406b5[_0xfae4('0x31')]]={'$like':'%'+_0x241547[_0xfae4('0x33')][_0xfae4('0x3d')]+'%'};return _0x39204c;}})});}_0x10af5e=_['merge']({},_0x10af5e,_0x241547['options']);var _0x711b4={'where':_0x10af5e[_0xfae4('0x3e')]};return db[_0xfae4('0x2c')][_0xfae4('0x20')](_0x711b4)[_0xfae4('0x27')](function(_0x41038d){_0x2ca6a5['count']=_0x41038d;if(_0x241547[_0xfae4('0x33')]['includeAll']){_0x10af5e['include']=[{'all':!![]}];}return db[_0xfae4('0x2c')][_0xfae4('0x41')](_0x10af5e);})[_0xfae4('0x27')](function(_0x4ff2c8){_0x2ca6a5['rows']=_0x4ff2c8;return _0x2ca6a5;})[_0xfae4('0x27')](respondWithFilteredResult(_0x405ab0,_0x10af5e))[_0xfae4('0x42')](handleError(_0x405ab0,null));};exports[_0xfae4('0x43')]=function(_0xa91e89,_0x473f80){var _0x374f0b={'raw':!![],'where':{'id':_0xa91e89[_0xfae4('0x44')]['id']}},_0x3694be={};_0x3694be['model']=_[_0xfae4('0x32')](db[_0xfae4('0x2c')][_0xfae4('0x45')]);_0x3694be[_0xfae4('0x33')]=_[_0xfae4('0x32')](_0xa91e89[_0xfae4('0x33')]);_0x3694be[_0xfae4('0x34')]=_[_0xfae4('0x35')](_0x3694be[_0xfae4('0x30')],_0x3694be[_0xfae4('0x33')]);_0x374f0b[_0xfae4('0x37')]=_[_0xfae4('0x35')](_0x3694be[_0xfae4('0x30')],qs[_0xfae4('0x36')](_0xa91e89[_0xfae4('0x33')][_0xfae4('0x36')]));_0x374f0b[_0xfae4('0x37')]=_0x374f0b[_0xfae4('0x37')][_0xfae4('0x38')]?_0x374f0b[_0xfae4('0x37')]:_0x3694be[_0xfae4('0x30')];if(_0xa91e89['query'][_0xfae4('0x46')]){_0x374f0b[_0xfae4('0x47')]=[{'all':!![]}];}_0x374f0b=_[_0xfae4('0x3f')]({},_0x374f0b,_0xa91e89[_0xfae4('0x48')]);return db[_0xfae4('0x2c')][_0xfae4('0x49')](_0x374f0b)['then'](handleEntityNotFound(_0x473f80,null))['then'](respondWithResult(_0x473f80,null))[_0xfae4('0x42')](handleError(_0x473f80,null));};exports['create']=function(_0x2a3012,_0x5eafcf){return db[_0xfae4('0x2c')][_0xfae4('0x4a')](_0x2a3012[_0xfae4('0x4b')],{})['then'](respondWithResult(_0x5eafcf,0xc9))['catch'](handleError(_0x5eafcf,null));};exports[_0xfae4('0x4c')]=function(_0xb12d7d,_0x1f9f6c){if(_0xb12d7d[_0xfae4('0x4b')]['id']){delete _0xb12d7d[_0xfae4('0x4b')]['id'];}return db[_0xfae4('0x2c')][_0xfae4('0x49')]({'where':{'id':_0xb12d7d[_0xfae4('0x44')]['id']}})[_0xfae4('0x27')](handleEntityNotFound(_0x1f9f6c,null))[_0xfae4('0x27')](saveUpdates(_0xb12d7d[_0xfae4('0x4b')],null))[_0xfae4('0x27')](respondWithResult(_0x1f9f6c,null))['catch'](handleError(_0x1f9f6c,null));};exports[_0xfae4('0x4d')]=function(_0x442768,_0x1d655d){return db[_0xfae4('0x2c')][_0xfae4('0x49')]({'where':{'id':_0x442768[_0xfae4('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d655d,null))[_0xfae4('0x27')](removeEntity(_0x1d655d,null))[_0xfae4('0x42')](handleError(_0x1d655d,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 5698964..1790699 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 _0x6e9c=['utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0x6e9c,0x139));var _0xc6e9=function(_0x2411cb,_0x15da03){_0x2411cb=_0x2411cb-0x0;var _0x317f74=_0x6e9c[_0x2411cb];return _0x317f74;};'use strict';var _=require('lodash');var util=require(_0xc6e9('0x0'));var logger=require('../../config/logger')(_0xc6e9('0x1'));var moment=require(_0xc6e9('0x2'));var BPromise=require(_0xc6e9('0x3'));var rp=require(_0xc6e9('0x4'));var fs=require('fs');var path=require(_0xc6e9('0x5'));var rimraf=require(_0xc6e9('0x6'));var config=require('../../config/environment');var attributes=require(_0xc6e9('0x7'));module[_0xc6e9('0x8')]=function(_0x4bc558,_0xb03b01){return _0x4bc558[_0xc6e9('0x9')](_0xc6e9('0xa'),attributes,{'tableName':_0xc6e9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc6e9('0xc')});}; \ No newline at end of file +var _0x4128=['exports','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./openchannelApplication.attributes'];(function(_0x426c90,_0x384ebf){var _0x3c31e8=function(_0x1acf0e){while(--_0x1acf0e){_0x426c90['push'](_0x426c90['shift']());}};_0x3c31e8(++_0x384ebf);}(_0x4128,0x171));var _0x8412=function(_0xefcd51,_0xd21a0f){_0xefcd51=_0xefcd51-0x0;var _0x298432=_0x4128[_0xefcd51];return _0x298432;};'use strict';var _=require(_0x8412('0x0'));var util=require('util');var logger=require(_0x8412('0x1'))(_0x8412('0x2'));var moment=require(_0x8412('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8412('0x4'));var rimraf=require(_0x8412('0x5'));var config=require(_0x8412('0x6'));var attributes=require(_0x8412('0x7'));module[_0x8412('0x8')]=function(_0x2260b9,_0x120d79){return _0x2260b9[_0x8412('0x9')]('OpenchannelApplication',attributes,{'tableName':_0x8412('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8412('0xb'),'collate':_0x8412('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 856c9c5..5600029 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 _0x8e27=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateOpenchannelApplication','options','raw','where','attributes','stringify'];(function(_0x2a1dc2,_0x1e2ab0){var _0x4d038f=function(_0x574c45){while(--_0x574c45){_0x2a1dc2['push'](_0x2a1dc2['shift']());}};_0x4d038f(++_0x1e2ab0);}(_0x8e27,0x15c));var _0x78e2=function(_0x536c1d,_0x4bac2d){_0x536c1d=_0x536c1d-0x0;var _0x399e88=_0x8e27[_0x536c1d];return _0x399e88;};'use strict';var _=require('lodash');var util=require(_0x78e2('0x0'));var moment=require(_0x78e2('0x1'));var BPromise=require(_0x78e2('0x2'));var rs=require(_0x78e2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78e2('0x4'))['db'];var utils=require(_0x78e2('0x5'));var logger=require(_0x78e2('0x6'))(_0x78e2('0x7'));var config=require('../../config/environment');var jayson=require(_0x78e2('0x8'));var client=jayson[_0x78e2('0x9')][_0x78e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fcc01,_0x4b3452,_0x278af6){return new BPromise(function(_0x418a52,_0x54bd13){return client[_0x78e2('0xb')](_0x2fcc01,_0x278af6)[_0x78e2('0xc')](function(_0x327be8){logger[_0x78e2('0xd')](_0x78e2('0xe'),_0x4b3452,'request\x20sent');logger[_0x78e2('0xf')](_0x78e2('0x10'),_0x4b3452,_0x78e2('0x11'),JSON['stringify'](_0x327be8));if(_0x327be8[_0x78e2('0x12')]){if(_0x327be8[_0x78e2('0x12')][_0x78e2('0x13')]===0x1f4){logger['error'](_0x78e2('0xe'),_0x4b3452,_0x327be8[_0x78e2('0x12')][_0x78e2('0x14')]);return _0x54bd13(_0x327be8[_0x78e2('0x12')][_0x78e2('0x14')]);}logger[_0x78e2('0x12')](_0x78e2('0xe'),_0x4b3452,_0x327be8[_0x78e2('0x12')][_0x78e2('0x14')]);return _0x418a52(_0x327be8['error'][_0x78e2('0x14')]);}else{logger['info'](_0x78e2('0xe'),_0x4b3452,_0x78e2('0x11'));_0x418a52(_0x327be8[_0x78e2('0x15')][_0x78e2('0x14')]);}})[_0x78e2('0x16')](function(_0x391ce3){logger[_0x78e2('0x12')](_0x78e2('0xe'),_0x4b3452,_0x391ce3);_0x54bd13(_0x391ce3);});});}exports[_0x78e2('0x17')]=function(_0x367b28){var _0x2f013a=this;return new Promise(function(_0x11c1d4,_0xb3c7f9){return db['OpenchannelApplication']['update'](_0x367b28['body'],{'raw':_0x367b28[_0x78e2('0x18')]?_0x367b28['options'][_0x78e2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x367b28[_0x78e2('0x18')]?_0x367b28['options'][_0x78e2('0x1a')]||null:null,'attributes':_0x367b28[_0x78e2('0x18')]?_0x367b28[_0x78e2('0x18')][_0x78e2('0x1b')]||null:null,'limit':_0x367b28['options']?_0x367b28[_0x78e2('0x18')]['limit']||null:null})[_0x78e2('0xc')](function(_0x4fd027){logger['info']('UpdateOpenchannelApplication',_0x367b28);logger['debug'](_0x78e2('0x17'),_0x367b28,JSON[_0x78e2('0x1c')](_0x4fd027));_0x11c1d4(_0x4fd027);})['catch'](function(_0x2f3b59){logger['error'](_0x78e2('0x17'),_0x2f3b59[_0x78e2('0x14')],_0x367b28);_0xb3c7f9(_0x2f013a[_0x78e2('0x12')](0x1f4,_0x2f3b59[_0x78e2('0x14')]));});});}; \ No newline at end of file +var _0x91b6=['stringify','error','message','result','catch','UpdateOpenchannelApplication','update','body','options','attributes','limit','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s'];(function(_0x1e75d6,_0xc20846){var _0x25f918=function(_0x1e0669){while(--_0x1e0669){_0x1e75d6['push'](_0x1e75d6['shift']());}};_0x25f918(++_0xc20846);}(_0x91b6,0x177));var _0x691b=function(_0x89329b,_0x6d14a9){_0x89329b=_0x89329b-0x0;var _0x34879a=_0x91b6[_0x89329b];return _0x34879a;};'use strict';var _=require(_0x691b('0x0'));var util=require(_0x691b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x691b('0x2'));var db=require(_0x691b('0x3'))['db'];var utils=require(_0x691b('0x4'));var logger=require(_0x691b('0x5'))('rpc');var config=require(_0x691b('0x6'));var jayson=require(_0x691b('0x7'));var client=jayson[_0x691b('0x8')][_0x691b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38b7ca,_0x2fb028,_0x274039){return new BPromise(function(_0x5344b2,_0x4c6470){return client[_0x691b('0xa')](_0x38b7ca,_0x274039)[_0x691b('0xb')](function(_0x1daa52){logger[_0x691b('0xc')](_0x691b('0xd'),_0x2fb028,_0x691b('0xe'));logger[_0x691b('0xf')](_0x691b('0x10'),_0x2fb028,'request\x20sent',JSON[_0x691b('0x11')](_0x1daa52));if(_0x1daa52[_0x691b('0x12')]){if(_0x1daa52[_0x691b('0x12')]['code']===0x1f4){logger[_0x691b('0x12')](_0x691b('0xd'),_0x2fb028,_0x1daa52['error'][_0x691b('0x13')]);return _0x4c6470(_0x1daa52[_0x691b('0x12')][_0x691b('0x13')]);}logger[_0x691b('0x12')](_0x691b('0xd'),_0x2fb028,_0x1daa52[_0x691b('0x12')][_0x691b('0x13')]);return _0x5344b2(_0x1daa52['error']['message']);}else{logger[_0x691b('0xc')](_0x691b('0xd'),_0x2fb028,_0x691b('0xe'));_0x5344b2(_0x1daa52[_0x691b('0x14')][_0x691b('0x13')]);}})[_0x691b('0x15')](function(_0x2481cf){logger['error'](_0x691b('0xd'),_0x2fb028,_0x2481cf);_0x4c6470(_0x2481cf);});});}exports[_0x691b('0x16')]=function(_0x4f24b4){var _0x126a6d=this;return new Promise(function(_0x924d74,_0x455adb){return db['OpenchannelApplication'][_0x691b('0x17')](_0x4f24b4[_0x691b('0x18')],{'raw':_0x4f24b4['options']?_0x4f24b4[_0x691b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f24b4['options']?_0x4f24b4['options']['where']||null:null,'attributes':_0x4f24b4[_0x691b('0x19')]?_0x4f24b4['options'][_0x691b('0x1a')]||null:null,'limit':_0x4f24b4[_0x691b('0x19')]?_0x4f24b4[_0x691b('0x19')][_0x691b('0x1b')]||null:null})[_0x691b('0xb')](function(_0x44bae1){logger[_0x691b('0xc')](_0x691b('0x16'),_0x4f24b4);logger[_0x691b('0xf')](_0x691b('0x16'),_0x4f24b4,JSON[_0x691b('0x11')](_0x44bae1));_0x924d74(_0x44bae1);})[_0x691b('0x15')](function(_0x4a8c81){logger[_0x691b('0x12')](_0x691b('0x16'),_0x4a8c81[_0x691b('0x13')],_0x4f24b4);_0x455adb(_0x126a6d[_0x691b('0x12')](0x1f4,_0x4a8c81['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index e0ca73e..1dee091 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 _0xc96b=['../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc96b,0x1a6));var _0xbc96=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc96b[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc96('0x0'));var timeout=require(_0xbc96('0x1'));var express=require(_0xbc96('0x2'));var router=express[_0xbc96('0x3')]();var fs_extra=require(_0xbc96('0x4'));var auth=require(_0xbc96('0x5'));var interaction=require(_0xbc96('0x6'));var config=require(_0xbc96('0x7'));var controller=require(_0xbc96('0x8'));router[_0xbc96('0x9')]('/',auth[_0xbc96('0xa')](),controller['index']);router[_0xbc96('0x9')](_0xbc96('0xb'),auth[_0xbc96('0xa')](),controller[_0xbc96('0xc')]);router[_0xbc96('0x9')](_0xbc96('0xd'),auth[_0xbc96('0xa')](),controller[_0xbc96('0xe')]);router[_0xbc96('0x9')]('/:id/messages',auth[_0xbc96('0xa')](),controller[_0xbc96('0xf')]);router[_0xbc96('0x9')](_0xbc96('0x10'),auth['isAuthenticated'](),controller[_0xbc96('0x11')]);router['post']('/',auth[_0xbc96('0xa')](),controller['create']);router[_0xbc96('0x12')](_0xbc96('0x13'),auth[_0xbc96('0xa')](),controller[_0xbc96('0x14')]);router[_0xbc96('0x12')](_0xbc96('0x15'),auth[_0xbc96('0xa')](),interaction[_0xbc96('0x16')](_0xbc96('0x17'),_0xbc96('0x18')),controller['addTags']);router[_0xbc96('0x19')](_0xbc96('0xd'),auth[_0xbc96('0xa')](),interaction[_0xbc96('0x16')](_0xbc96('0x17'),_0xbc96('0x1a')),controller[_0xbc96('0x1b')]);router[_0xbc96('0x1c')](_0xbc96('0xd'),auth[_0xbc96('0xa')](),interaction[_0xbc96('0x16')](_0xbc96('0x17'),_0xbc96('0x1d')),controller[_0xbc96('0x1e')]);router[_0xbc96('0x1c')](_0xbc96('0x15'),auth[_0xbc96('0xa')](),controller[_0xbc96('0x1f')]);module[_0xbc96('0x20')]=router; \ No newline at end of file +var _0x4b0e=['/:id/messages','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','tracked','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','getMessages','/:id/download','download','post','create'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x4b0e,0x1da));var _0xe4b0=function(_0x38e660,_0x59bb24){_0x38e660=_0x38e660-0x0;var _0xc9a1ea=_0x4b0e[_0x38e660];return _0xc9a1ea;};'use strict';var multer=require(_0xe4b0('0x0'));var util=require(_0xe4b0('0x1'));var path=require(_0xe4b0('0x2'));var timeout=require(_0xe4b0('0x3'));var express=require(_0xe4b0('0x4'));var router=express[_0xe4b0('0x5')]();var fs_extra=require(_0xe4b0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe4b0('0x7'));var config=require(_0xe4b0('0x8'));var controller=require(_0xe4b0('0x9'));router[_0xe4b0('0xa')]('/',auth['isAuthenticated'](),controller[_0xe4b0('0xb')]);router['get'](_0xe4b0('0xc'),auth[_0xe4b0('0xd')](),controller[_0xe4b0('0xe')]);router[_0xe4b0('0xa')](_0xe4b0('0xf'),auth[_0xe4b0('0xd')](),controller['show']);router['get']('/:id/messages',auth[_0xe4b0('0xd')](),controller[_0xe4b0('0x10')]);router[_0xe4b0('0xa')](_0xe4b0('0x11'),auth[_0xe4b0('0xd')](),controller[_0xe4b0('0x12')]);router[_0xe4b0('0x13')]('/',auth['isAuthenticated'](),controller[_0xe4b0('0x14')]);router[_0xe4b0('0x13')](_0xe4b0('0x15'),auth['isAuthenticated'](),controller[_0xe4b0('0x16')]);router['post'](_0xe4b0('0x17'),auth[_0xe4b0('0xd')](),interaction['tracked'](_0xe4b0('0x18'),_0xe4b0('0x19')),controller[_0xe4b0('0x1a')]);router[_0xe4b0('0x1b')](_0xe4b0('0xf'),auth[_0xe4b0('0xd')](),interaction[_0xe4b0('0x1c')]('openchannel','openchannelinteraction:update'),controller['update']);router[_0xe4b0('0x1d')](_0xe4b0('0xf'),auth['isAuthenticated'](),interaction[_0xe4b0('0x1c')]('openchannel',_0xe4b0('0x1e')),controller[_0xe4b0('0x1f')]);router[_0xe4b0('0x1d')](_0xe4b0('0x17'),auth[_0xe4b0('0xd')](),controller[_0xe4b0('0x20')]);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 3ef278d..fc43329 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 _0x7764=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7764,0xa4));var _0x4776=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0x7764[_0x4b2cc6];return _0x3e0b08;};'use strict';var Sequelize=require(_0x4776('0x0'));module[_0x4776('0x1')]={'closed':{'type':Sequelize[_0x4776('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4776('0x3')]},'disposition':{'type':Sequelize[_0x4776('0x4')]},'secondDisposition':{'type':Sequelize[_0x4776('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4776('0x4')]},'note':{'type':Sequelize[_0x4776('0x4')]},'read1stAt':{'type':Sequelize[_0x4776('0x3')]},'threadId':{'type':Sequelize[_0x4776('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4776('0x5')]('in',_0x4776('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x4776('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x8ff9=['DATE','ENUM','sequelize','exports','BOOLEAN','STRING'];(function(_0xb62719,_0xc93130){var _0x45cc9a=function(_0x19f2c1){while(--_0x19f2c1){_0xb62719['push'](_0xb62719['shift']());}};_0x45cc9a(++_0xc93130);}(_0x8ff9,0x188));var _0x98ff=function(_0x239b6f,_0x459c10){_0x239b6f=_0x239b6f-0x0;var _0x4cb9b0=_0x8ff9[_0x239b6f];return _0x4cb9b0;};'use strict';var Sequelize=require(_0x98ff('0x0'));module[_0x98ff('0x1')]={'closed':{'type':Sequelize[_0x98ff('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x98ff('0x3')]},'secondDisposition':{'type':Sequelize[_0x98ff('0x3')]},'thirdDisposition':{'type':Sequelize[_0x98ff('0x3')]},'note':{'type':Sequelize[_0x98ff('0x3')]},'read1stAt':{'type':Sequelize[_0x98ff('0x4')]},'threadId':{'type':Sequelize[_0x98ff('0x3')]},'externalUrl':{'type':Sequelize[_0x98ff('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x98ff('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x98ff('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x98ff('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 2a527af..7adbddd 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 _0xe59b=['reject','save','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','push','waiting','answered','unmanaged','closed','UserId','talking','index','OpenchannelInteraction','rawAttributes','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','unreadMessages','value','having','operator','$substring','getFullTextValue','ContactId','buildExpression','text','start','end','Tag','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','user','role','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','all','rows','show','params','include','options','create','catch','update','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','format','findAll','addTags','setTags','spread','openchannelInteractionTags:save','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','Attachment','Messages','secret','OpenchannelAccount','Account','Owner','get','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','threadId','Public','Private','basename','existsSync','pipe','out','lastName','direction','renderFile','downloadInteraction.ejs','transcript-','Openchannel','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','apply'];(function(_0x710418,_0x123ee2){var _0x15d8ef=function(_0x10c9d9){while(--_0x10c9d9){_0x710418['push'](_0x710418['shift']());}};_0x15d8ef(++_0x123ee2);}(_0xe59b,0xcd));var _0xbe59=function(_0x219f0b,_0x2fc5c7){_0x219f0b=_0x219f0b-0x0;var _0x2af029=_0xe59b[_0x219f0b];return _0x2af029;};'use strict';var emlformat=require(_0xbe59('0x0'));var rimraf=require(_0xbe59('0x1'));var zipdir=require(_0xbe59('0x2'));var jsonpatch=require(_0xbe59('0x3'));var rp=require(_0xbe59('0x4'));var moment=require(_0xbe59('0x5'));var BPromise=require(_0xbe59('0x6'));var Mustache=require(_0xbe59('0x7'));var util=require('util');var path=require(_0xbe59('0x8'));var sox=require(_0xbe59('0x9'));var csv=require(_0xbe59('0xa'));var ejs=require(_0xbe59('0xb'));var fs=require('fs');var fs_extra=require(_0xbe59('0xc'));var _=require(_0xbe59('0xd'));var squel=require(_0xbe59('0xe'));var crypto=require(_0xbe59('0xf'));var jsforce=require(_0xbe59('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xbe59('0xa'));var querystring=require(_0xbe59('0x11'));var Papa=require(_0xbe59('0x12'));var Redis=require(_0xbe59('0x13'));var authService=require(_0xbe59('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xbe59('0x15'));var pdf=require(_0xbe59('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe59('0x17'))(_0xbe59('0x18'));var utils=require(_0xbe59('0x19'));var config=require(_0xbe59('0x1a'));var licenseUtil=require(_0xbe59('0x1b'));var db=require(_0xbe59('0x1c'))['db'];config[_0xbe59('0x1d')]=_[_0xbe59('0x1e')](config[_0xbe59('0x1d')],{'host':_0xbe59('0x1f'),'port':0x18eb});var socket=require(_0xbe59('0x20'))(new Redis(config['redis']));require(_0xbe59('0x21'))[_0xbe59('0x22')](socket);function respondWithStatusCode(_0x1c9919,_0x6c6e07){_0x6c6e07=_0x6c6e07||0xcc;return function(_0x5e4104){if(_0x5e4104){return _0x1c9919[_0xbe59('0x23')](_0x6c6e07);}return _0x1c9919[_0xbe59('0x24')](_0x6c6e07)['end']();};}function respondWithResult(_0x3289e3,_0x137b4e){_0x137b4e=_0x137b4e||0xc8;return function(_0x1a4b7a){if(_0x1a4b7a){return _0x3289e3['status'](_0x137b4e)[_0xbe59('0x25')](_0x1a4b7a);}};}function respondWithFilteredResult(_0xac8a58,_0x216788){return function(_0x43376d){if(_0x43376d){var _0x2cc7d6=typeof _0x216788[_0xbe59('0x26')]===_0xbe59('0x27')&&typeof _0x216788[_0xbe59('0x28')]===_0xbe59('0x27');var _0x46b15b=_0x43376d[_0xbe59('0x29')];var _0x17cc64=_0x2cc7d6?0x0:_0x216788[_0xbe59('0x26')];var _0x1e9af0=_0x2cc7d6?_0x43376d[_0xbe59('0x29')]:_0x216788[_0xbe59('0x26')]+_0x216788['limit'];var _0x58ef59;if(_0x1e9af0>=_0x46b15b){_0x1e9af0=_0x46b15b;_0x58ef59=0xc8;}else{_0x58ef59=0xce;}_0xac8a58['status'](_0x58ef59);return _0xac8a58['set']('Content-Range',_0x17cc64+'-'+_0x1e9af0+'/'+_0x46b15b)[_0xbe59('0x25')](_0x43376d);}return null;};}function patchUpdates(_0x47da0d){return function(_0x2a6e4c){try{jsonpatch[_0xbe59('0x2a')](_0x2a6e4c,_0x47da0d,!![]);}catch(_0x1cff93){return BPromise[_0xbe59('0x2b')](_0x1cff93);}return _0x2a6e4c[_0xbe59('0x2c')]();};}function saveUpdates(_0x42c16d,_0x58f047){return function(_0x1a900b){if(_0x1a900b){return _0x1a900b['update'](_0x42c16d)[_0xbe59('0x2d')](function(_0x1ba885){return _0x1ba885;});}return null;};}function removeEntity(_0x3b4639,_0x30bc3c){return function(_0x414ea0){if(_0x414ea0){return _0x414ea0['destroy']()[_0xbe59('0x2d')](function(){_0x3b4639[_0xbe59('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3262ba,_0x3f7b19){return function(_0x4e1a60){if(!_0x4e1a60){_0x3262ba[_0xbe59('0x23')](0x194);}return _0x4e1a60;};}function handleError(_0x14895f,_0x4be2a2){_0x4be2a2=_0x4be2a2||0x1f4;return function(_0x3a3b4f){logger[_0xbe59('0x2e')](_0x3a3b4f[_0xbe59('0x2f')]);if(_0x3a3b4f[_0xbe59('0x30')]){delete _0x3a3b4f[_0xbe59('0x30')];}_0x14895f[_0xbe59('0x24')](_0x4be2a2)[_0xbe59('0x31')](_0x3a3b4f);};}function getInteractionUsers(_0x4060da,_0x57d556){return new BPromise(function(_0x131b40,_0x554e81){try{if(_0x57d556[_0x4060da['id']]){_0x4060da[_0xbe59('0x32')]=_[_0xbe59('0x33')](_0x57d556[_0x4060da['id']],function(_0x2f1966){return{'id':_0x2f1966['id'],'fullname':_0x2f1966[_0xbe59('0x34')]};});}}catch(_0xe1e275){_0x554e81(_0xe1e275);}_0x131b40(_0x4060da);});}function getInteractionTags(_0x5589d7,_0x356fdb){return new BPromise(function(_0x5df35c,_0x1b052d){try{if(_0x5589d7[_0xbe59('0x35')]){_0x5589d7[_0xbe59('0x36')]=[];_0x5589d7[_0xbe59('0x35')]['split'](',')['forEach'](function(_0x4fc498){_0x5589d7['Tags'][_0xbe59('0x37')](_0x356fdb[_0x4fc498]);});}delete _0x5589d7['TagIds'];}catch(_0x382f75){_0x1b052d(_0x382f75);}_0x5df35c(_0x5589d7);});}function updateOpenchannelInteraction(_0x3a1ad3,_0xfd180e,_0x501fbc){return new BPromise(function(_0x106666,_0x2808c0){return getInteractionUsers(_0x3a1ad3,_0x501fbc)[_0xbe59('0x2d')](function(_0x48f815){return getInteractionTags(_0x48f815,_0xfd180e);})[_0xbe59('0x2d')](function(_0x208096){return getStateInteraction(_0x208096);})[_0xbe59('0x2d')](function(_0x425618){_0x106666(_0x425618);})['catch'](function(_0x58fff2){_0x2808c0(_0x58fff2);});});}function getStateInteraction(_0x15690d){return new BPromise(function(_0x4ccf8d){_0x15690d[_0xbe59('0x38')]=0x0;_0x15690d['talking']=0x0;_0x15690d[_0xbe59('0x39')]=0x0;_0x15690d[_0xbe59('0x3a')]=0x0;_0x15690d['total']=0x0;if(!_0x15690d[_0xbe59('0x3b')]&&!_0x15690d[_0xbe59('0x3c')]){_0x15690d['waiting']+=0x1;}if(!_0x15690d['closed']&&_0x15690d[_0xbe59('0x3c')]){_0x15690d[_0xbe59('0x3d')]+=0x1;if(_0x15690d[_0xbe59('0x38')]){_0x15690d[_0xbe59('0x38')]-=0x1;}}if(_0x15690d[_0xbe59('0x3b')]&&_0x15690d[_0xbe59('0x3c')]){_0x15690d['answered']+=0x1;if(_0x15690d[_0xbe59('0x3d')]){_0x15690d['talking']-=0x1;}}if(_0x15690d['closed']&&!_0x15690d['UserId']){_0x15690d[_0xbe59('0x3a')]+=0x1;if(_0x15690d[_0xbe59('0x38')]){_0x15690d[_0xbe59('0x38')]-=0x1;}}_0x15690d['total']+=0x1;_0x4ccf8d(_0x15690d);});}exports[_0xbe59('0x3e')]=function(_0x11b05f,_0x158f2b){var _0x257a58={},_0x155360={},_0xc37ae5={'count':0x0,'rows':[]};var _0x400317=_[_0xbe59('0x33')](db[_0xbe59('0x3f')][_0xbe59('0x40')],function(_0x58017f){return{'name':_0x58017f['fieldName'],'type':_0x58017f[_0xbe59('0x41')]['key']};});_0x155360[_0xbe59('0x42')]=_[_0xbe59('0x33')](_0x400317,'name');_0x155360['query']=_[_0xbe59('0x43')](_0x11b05f[_0xbe59('0x44')]);_0x155360[_0xbe59('0x45')]=_['intersection'](_0x155360[_0xbe59('0x42')],_0x155360[_0xbe59('0x44')]);_0x257a58['attributes']=_[_0xbe59('0x46')](_0x155360[_0xbe59('0x42')],qs[_0xbe59('0x47')](_0x11b05f['query'][_0xbe59('0x47')]));_0x257a58[_0xbe59('0x48')]=_0x257a58[_0xbe59('0x48')][_0xbe59('0x49')]?_0x257a58[_0xbe59('0x48')]:_0x155360[_0xbe59('0x42')];if(!_0x11b05f[_0xbe59('0x44')][_0xbe59('0x4a')](_0xbe59('0x4b'))){_0x257a58[_0xbe59('0x28')]=qs[_0xbe59('0x28')](_0x11b05f[_0xbe59('0x44')][_0xbe59('0x28')]);_0x257a58['offset']=qs[_0xbe59('0x26')](_0x11b05f[_0xbe59('0x44')][_0xbe59('0x26')]);}_0x257a58[_0xbe59('0x4c')]=qs[_0xbe59('0x4d')](_0x11b05f['query'][_0xbe59('0x4d')]);_0x257a58[_0xbe59('0x4e')]=qs[_0xbe59('0x45')](_[_0xbe59('0x4f')](_0x11b05f['query'],_0x155360[_0xbe59('0x45')]),_0x400317);var _0x3cc20c=[];var _0x452453=squel[_0xbe59('0x50')]()['field']('id')[_0xbe59('0x51')]('name')[_0xbe59('0x51')](_0xbe59('0x52'))[_0xbe59('0x53')](_0xbe59('0x54'));var _0x21f0ac=squel[_0xbe59('0x50')]()[_0xbe59('0x51')](_0xbe59('0x55'))[_0xbe59('0x51')](_0xbe59('0x56'))[_0xbe59('0x51')]('ui.OpenchannelInteractionId')[_0xbe59('0x53')](_0xbe59('0x57'),'ui')[_0xbe59('0x58')](_0xbe59('0x59'),'u',_0xbe59('0x5a'));var _0x148102=squel['select']()[_0xbe59('0x53')](_0xbe59('0x5b'),'i')[_0xbe59('0x58')](_0xbe59('0x5c'),'c',_0xbe59('0x5d'))[_0xbe59('0x58')](_0xbe59('0x59'),'o',_0xbe59('0x5e'))['left_join'](_0xbe59('0x5f'),'a',_0xbe59('0x60'))[_0xbe59('0x58')](_0xbe59('0x61'),'me',_0xbe59('0x62'))['left_join'](_0xbe59('0x63'),'it',_0xbe59('0x64'))['left_join'](_0xbe59('0x54'),'t','t.id\x20=\x20it.TagId');var _0x596ad1=squel[_0xbe59('0x65')]();var _0x476686=[];var _0x212637=squel[_0xbe59('0x65')]();var _0x5dd1d1;if(_0x11b05f['query'][_0xbe59('0x66')]){_0x5dd1d1=as[_0xbe59('0x67')](_0x11b05f[_0xbe59('0x44')][_0xbe59('0x66')]);var _0x4c6ccb=_0x5dd1d1['sqlOperator'];for(var _0x65340d=0x0;_0x65340d<_0x5dd1d1[_0xbe59('0x68')][_0xbe59('0x49')];_0x65340d++){var _0x3efd20=_0x5dd1d1[_0xbe59('0x68')][_0x65340d];var _0x38e74f='i';var _0x39a9bd=_[_0xbe59('0x69')](_0x400317,['name',_0x3efd20[_0xbe59('0x51')]]);if(!_0x39a9bd){switch(_0x3efd20[_0xbe59('0x51')]){case _0xbe59('0x6a'):if(_0x3efd20[_0xbe59('0x6b')]==0x1){_0x148102[_0xbe59('0x6c')]('`'+_0x3efd20[_0xbe59('0x51')]+'`\x20=\x200');}else{_0x148102['having']('`'+_0x3efd20[_0xbe59('0x51')]+'`\x20>\x200');}break;case'Contact':if(_0x3efd20[_0xbe59('0x6d')]===_0xbe59('0x6e')){if(_0x3efd20[_0xbe59('0x6b')]['split']('\x20')[_0xbe59('0x49')]>0x1){_0x596ad1[_0x4c6ccb]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbe59('0x6f')](_0x3efd20[_0xbe59('0x6b')]),null);}else{var _0x157e9f='%'+_0x3efd20[_0xbe59('0x6b')]+'%';_0x596ad1[_0x4c6ccb]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x157e9f,_0x157e9f,_0x157e9f);}}else{_0x39a9bd=_[_0xbe59('0x69')](_0x400317,[_0xbe59('0x30'),_0xbe59('0x70')]);_0x3efd20[_0xbe59('0x51')]=_0xbe59('0x70');_0x1c6838=as[_0xbe59('0x71')](_0x38e74f,_0x39a9bd[_0xbe59('0x41')],_0x3efd20);_0x596ad1[_0x4c6ccb](_0x1c6838[_0xbe59('0x72')],_0x1c6838[_0xbe59('0x6b')][_0xbe59('0x73')],_0x1c6838[_0xbe59('0x6b')][_0xbe59('0x74')]);}break;case _0xbe59('0x75'):var _0x2c199e=_0x3efd20['value'][_0xbe59('0x76')](',')[_0xbe59('0x33')](function(_0x1f8187){return Number(_0x1f8187);});_0x2c199e[_0xbe59('0x77')](function(_0x11c585){_0x212637['or'](_0xbe59('0x78'),'%,'+_0x11c585+',%');});_0x476686=_['union'](_0x476686,_0x2c199e);break;case _0xbe59('0x79'):if(_0x3efd20[_0xbe59('0x6d')]==='$substring'){_0x596ad1[_0x4c6ccb](_0xbe59('0x7a'),'%'+_0x3efd20[_0xbe59('0x6b')]+'%',null);}else{_0x39a9bd=_[_0xbe59('0x69')](_0x400317,['name',_0xbe59('0x3c')]);_0x3efd20[_0xbe59('0x51')]=_0xbe59('0x3c');_0x1c6838=as['buildExpression'](_0x38e74f,_0x39a9bd[_0xbe59('0x41')],_0x3efd20);_0x596ad1[_0x4c6ccb](_0x1c6838[_0xbe59('0x72')],_0x1c6838[_0xbe59('0x6b')][_0xbe59('0x73')],_0x1c6838[_0xbe59('0x6b')][_0xbe59('0x74')]);}break;case _0xbe59('0x7b'):_0x1c6838=as[_0xbe59('0x71')]('me',null,_0x3efd20);_0x596ad1[_0x4c6ccb](_0x1c6838[_0xbe59('0x72')],_0x1c6838[_0xbe59('0x6b')][_0xbe59('0x73')],_0x1c6838[_0xbe59('0x6b')][_0xbe59('0x74')]);break;}}else{var _0x1c6838=as[_0xbe59('0x71')](_0x38e74f,_0x39a9bd['type'],_0x3efd20);_0x596ad1[_0x4c6ccb](_0x1c6838['text'],_0x1c6838[_0xbe59('0x6b')][_0xbe59('0x73')],_0x1c6838[_0xbe59('0x6b')][_0xbe59('0x74')]);}}}else{var _0x3b4d77=_(_0x11b05f[_0xbe59('0x44')])[_0xbe59('0x43')]()[_0xbe59('0x33')](function(_0x780105){return _[_0xbe59('0x7c')](_0x400317,[_0xbe59('0x30'),_0x780105])?_0x780105:undefined;})['compact']()[_0xbe59('0x6b')]();if(!_[_0xbe59('0x7d')](_0x3b4d77)){_0x3b4d77[_0xbe59('0x77')](function(_0x42bf26){if(_0x42bf26===_0xbe59('0x7e')){_0x148102['where'](_0xbe59('0x7f'),[][_0xbe59('0x80')](_0x11b05f[_0xbe59('0x44')][_0x42bf26]));}else if(_0x42bf26===_0xbe59('0x81')){var _0x3972d6=JSON['parse'](_0x11b05f['query'][_0x42bf26])[_0xbe59('0x82')];var _0x38b83c=JSON[_0xbe59('0x83')](_0x11b05f['query'][_0x42bf26])[_0xbe59('0x84')];_0x148102[_0xbe59('0x4e')](_0xbe59('0x85'),_0x3972d6,_0x38b83c);}else{if(_0x11b05f[_0xbe59('0x44')][_0x42bf26]===_0xbe59('0x86')){_0x148102[_0xbe59('0x4e')]('i.'+_0x42bf26+_0xbe59('0x87'));}else{_0x148102['where']('i.'+_0x42bf26+_0xbe59('0x88'),_0x11b05f[_0xbe59('0x44')][_0x42bf26]);}}});}if(_0x11b05f[_0xbe59('0x44')][_0xbe59('0x89')]){if(_0x11b05f['query'][_0xbe59('0x89')]==0x1){_0x148102[_0xbe59('0x6c')](_0xbe59('0x8a'));}else{_0x148102['having'](_0xbe59('0x8b'));}}if(_0x11b05f['query'][_0xbe59('0x8c')]){_0x476686=_[_0xbe59('0x8d')](_0x11b05f['query'][_0xbe59('0x8c')])?_0x11b05f[_0xbe59('0x44')][_0xbe59('0x8c')]:new Array(_0x11b05f[_0xbe59('0x44')][_0xbe59('0x8c')]);_0x476686[_0xbe59('0x77')](function(_0x5a0a3c){_0x212637['or'](_0xbe59('0x78'),'%,'+_0x5a0a3c+',%');});}if(_0x11b05f['query']['filter']){var _0x249b8a=_0x11b05f[_0xbe59('0x44')][_0xbe59('0x8e')]['replace']('\x5c','\x5c\x5c')[_0xbe59('0x8f')](/'/g,'\x27\x27');if(qs[_0xbe59('0x90')](_0x249b8a)){_0x596ad1['or'](_0xbe59('0x91'),_0x249b8a+'%');}else{_0x596ad1['or'](_0xbe59('0x92'),qs[_0xbe59('0x6f')](_0x249b8a))['or'](_0xbe59('0x93'),_0x249b8a+'%')['or'](_0xbe59('0x94'),_0x249b8a+'%');}}}_0x148102[_0xbe59('0x4e')](_0x596ad1);_0x148102[_0xbe59('0x95')](_0xbe59('0x96'));var _0x520bf7={'type':db[_0xbe59('0x97')]['QueryTypes']['SELECT'],'raw':!![]};var _0x52fd4f=_0x148102[_0xbe59('0x98')]();_0x52fd4f['field'](_0xbe59('0x96'));_0x52fd4f[_0xbe59('0x51')](_0xbe59('0x99'),_0xbe59('0x6a'));if(_0x257a58['order']){_0x257a58[_0xbe59('0x4c')][_0xbe59('0x77')](function(_0x294c2d){var _0x4674e1=_0x294c2d[0x0]===_0xbe59('0x9a')?_0x294c2d[0x0]:'i.'+_0x294c2d[0x0];_0x148102[_0xbe59('0x4c')](_0x4674e1,_0x294c2d[0x1]===_0xbe59('0x9b')?![]:!![]);});}if(!_[_0xbe59('0x7d')](_0x476686)){_0x148102[_0xbe59('0x6c')](_0x212637);_0x52fd4f['where']('t.id\x20IN\x20?',_0x476686);}BPromise[_0xbe59('0x9c')]()[_0xbe59('0x2d')](function(){if(!_0x5dd1d1){if(_0x11b05f[_0xbe59('0x44')][_0xbe59('0x7e')])return;_0x52fd4f['where'](_0xbe59('0x9d'));_0x148102[_0xbe59('0x4e')](_0xbe59('0x9d'));return;}if(_0x11b05f['user']['role']!==_0xbe59('0x9e'))return;return _0x11b05f['user'][_0xbe59('0x9f')]({'attributes':['id'],'raw':!![]})[_0xbe59('0x2d')](function(_0x865348){if(_[_0xbe59('0x7d')](_0x865348)){_0x52fd4f[_0xbe59('0x4e')](_0xbe59('0xa0'));_0x148102[_0xbe59('0x4e')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x52fd4f[_0xbe59('0x4e')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x865348,'id'));_0x148102[_0xbe59('0x4e')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x865348,'id'));}});})[_0xbe59('0x2d')](function(){if(_0x11b05f[_0xbe59('0xa1')][_0xbe59('0xa2')]==='agent'&&!_0x5dd1d1&&!_0x11b05f[_0xbe59('0x44')][_0xbe59('0x7e')])return[];return db[_0xbe59('0xa3')][_0xbe59('0x44')](_0x52fd4f[_0xbe59('0xa4')](),_0x520bf7);})[_0xbe59('0x2d')](function(_0x39c840){_0xc37ae5[_0xbe59('0x29')]=_0x39c840[_0xbe59('0x49')];if(_0xc37ae5[_0xbe59('0x29')]===0x0)return[];return db[_0xbe59('0xa3')]['query'](_0x452453[_0xbe59('0xa4')](),_0x520bf7)['then'](function(_0x2ca6e2){_0x3cc20c=_[_0xbe59('0xa5')](_0x2ca6e2,'id');_0x520bf7=_[_0xbe59('0xa6')](_0x520bf7,{'model':db[_0xbe59('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x11b05f[_0xbe59('0x44')][_0xbe59('0x47')]){_0x257a58[_0xbe59('0x48')][_0xbe59('0x77')](function(_0x18bb29){_0x148102['field']('i.'+_0x18bb29);});}else{_0x148102['field'](_0xbe59('0x99'),_0xbe59('0x6a'));_0x148102[_0xbe59('0x51')](_0xbe59('0xa7'),_0xbe59('0xa8'));_0x148102['field']('a.mandatoryDisposition',_0xbe59('0xa9'));_0x148102[_0xbe59('0x51')]('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',_0xbe59('0x9a'));_0x148102[_0xbe59('0x51')](_0xbe59('0xaa'));_0x148102[_0xbe59('0x51')](_0xbe59('0xab'),_0xbe59('0xac'));_0x148102[_0xbe59('0x51')]('c.lastName',_0xbe59('0xad'));_0x148102[_0xbe59('0x51')](_0xbe59('0xae'),_0xbe59('0xaf'));_0x148102[_0xbe59('0x51')](_0xbe59('0xb0'),_0xbe59('0xb1'));_0x148102['field']('c.mobile',_0xbe59('0xb2'));_0x148102['field'](_0xbe59('0xb3'),_0xbe59('0xb4'));_0x148102['field'](_0xbe59('0xb5'),_0xbe59('0xb6'));_0x148102['field'](_0xbe59('0xb7'),_0xbe59('0xb8'));_0x148102[_0xbe59('0x51')](_0xbe59('0xb9'),_0xbe59('0x35'));}if(_0x257a58[_0xbe59('0x28')])_0x148102[_0xbe59('0x28')](_0x257a58[_0xbe59('0x28')]);if(_0x257a58[_0xbe59('0x26')])_0x148102['offset'](_0x257a58[_0xbe59('0x26')]);return db[_0xbe59('0xa3')][_0xbe59('0x44')](_0x148102[_0xbe59('0xa4')](),_0x520bf7);})[_0xbe59('0x2d')](function(_0x4062fd){if(_0x4062fd['length']>0x0)_0x21f0ac['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xbe59('0x33')](_0x4062fd,'id'));return db[_0xbe59('0xa3')][_0xbe59('0x44')](_0x21f0ac[_0xbe59('0xa4')](),_0x520bf7)['then'](function(_0x198a5f){var _0xce1f30=_[_0xbe59('0xba')](_0x198a5f,_0xbe59('0xbb'));var _0x28cdf5=[];_0x4062fd[_0xbe59('0x77')](function(_0x2a8d49){_0x28cdf5[_0xbe59('0x37')](updateOpenchannelInteraction(_0x2a8d49,_0x3cc20c,_0xce1f30));});return BPromise[_0xbe59('0xbc')](_0x28cdf5);});});})[_0xbe59('0x2d')](function(_0x4e63b2){_0xc37ae5[_0xbe59('0xbd')]=_0x4e63b2;return _0xc37ae5;})['then'](respondWithFilteredResult(_0x158f2b,_0x257a58))['catch'](handleError(_0x158f2b,null));};exports[_0xbe59('0xbe')]=function(_0x3ab41c,_0x3c6c9b){var _0x50bd3e={};if(_0x3ab41c['query'][_0xbe59('0x41')]&&_0x3ab41c[_0xbe59('0x44')][_0xbe59('0x41')]===_0xbe59('0x53')){_0x50bd3e['from']=_0x3ab41c['params']['id'];}else{_0x50bd3e['id']=_0x3ab41c[_0xbe59('0xbf')]['id'];}var _0x1971eb={'raw':![],'where':_0x50bd3e},_0x401ad3={};_0x401ad3[_0xbe59('0x42')]=_['keys'](db[_0xbe59('0x3f')]['rawAttributes']);_0x401ad3['query']=_[_0xbe59('0x43')](_0x3ab41c[_0xbe59('0x44')]);_0x401ad3[_0xbe59('0x45')]=_[_0xbe59('0x46')](_0x401ad3[_0xbe59('0x42')],_0x401ad3[_0xbe59('0x44')]);_0x1971eb['attributes']=_['intersection'](_0x401ad3[_0xbe59('0x42')],qs[_0xbe59('0x47')](_0x3ab41c['query'][_0xbe59('0x47')]));_0x1971eb[_0xbe59('0x48')]=_0x1971eb[_0xbe59('0x48')][_0xbe59('0x49')]?_0x1971eb['attributes']:_0x401ad3[_0xbe59('0x42')];if(_0x3ab41c[_0xbe59('0x44')]['includeAll']){_0x1971eb[_0xbe59('0xc0')]=[{'all':!![]}];}_0x1971eb=_[_0xbe59('0xa6')]({},_0x1971eb,_0x3ab41c[_0xbe59('0xc1')]);return db['OpenchannelInteraction'][_0xbe59('0x69')](_0x1971eb)[_0xbe59('0x2d')](handleEntityNotFound(_0x3c6c9b,null))[_0xbe59('0x2d')](respondWithResult(_0x3c6c9b,null))['catch'](handleError(_0x3c6c9b,null));};exports[_0xbe59('0xc2')]=function(_0x1c2b84,_0x4ae262){return db[_0xbe59('0x3f')]['create'](_0x1c2b84[_0xbe59('0x7b')],{})[_0xbe59('0x2d')](respondWithResult(_0x4ae262,0xc9))[_0xbe59('0xc3')](handleError(_0x4ae262,null));};exports[_0xbe59('0xc4')]=function(_0x2cea57,_0x2e99fc){if(_0x2cea57[_0xbe59('0x7b')]['id']){delete _0x2cea57['body']['id'];}return db[_0xbe59('0x3f')][_0xbe59('0x69')]({'where':{'id':_0x2cea57[_0xbe59('0xbf')]['id']}})[_0xbe59('0x2d')](handleEntityNotFound(_0x2e99fc,null))[_0xbe59('0x2d')](saveUpdates(_0x2cea57[_0xbe59('0x7b')],null))[_0xbe59('0x2d')](respondWithResult(_0x2e99fc,null))[_0xbe59('0xc3')](handleError(_0x2e99fc,null));};exports[_0xbe59('0xc5')]=function(_0x4558e0,_0x1bf02f){return db[_0xbe59('0x3f')][_0xbe59('0x69')]({'where':{'id':_0x4558e0[_0xbe59('0xbf')]['id']}})[_0xbe59('0x2d')](handleEntityNotFound(_0x1bf02f,null))['then'](removeEntity(_0x1bf02f,null))['catch'](handleError(_0x1bf02f,null));};exports['describe']=function(_0x1d7deb,_0x117939){return db[_0xbe59('0x3f')][_0xbe59('0xc6')]()['then'](respondWithResult(_0x117939,null))[_0xbe59('0xc3')](handleError(_0x117939,null));};exports[_0xbe59('0xc7')]=function(_0x304410,_0xdff1e9,_0x4d7e71){return db[_0xbe59('0xc8')][_0xbe59('0x69')]({'where':{'id':_0x304410[_0xbe59('0xbf')]['id']}})['then'](handleEntityNotFound(_0xdff1e9,null))['then'](function(_0x26953e){if(_0x26953e){return _0x26953e[_0xbe59('0xc7')](_0x304410[_0xbe59('0x7b')][_0xbe59('0xc9')],_[_0xbe59('0xca')](_0x304410['body'],[_0xbe59('0xc9'),'id'])||{});}})[_0xbe59('0x2d')](respondWithResult(_0xdff1e9,null))[_0xbe59('0xc3')](handleError(_0xdff1e9,null));};exports[_0xbe59('0xcb')]=function(_0x209e0b,_0x33b9ca,_0xb45c64){var _0x1b04fe={'raw':![],'where':{}};var _0x146f5c={};var _0x1e457d={'count':0x0,'rows':[]};return db[_0xbe59('0x3f')][_0xbe59('0xcc')]({'where':{'id':_0x209e0b[_0xbe59('0xbf')]['id']}})[_0xbe59('0x2d')](handleEntityNotFound(_0x33b9ca,null))[_0xbe59('0x2d')](function(_0x2bf0d2){if(_0x2bf0d2){_0x146f5c[_0xbe59('0x42')]=_[_0xbe59('0x43')](db[_0xbe59('0xc8')][_0xbe59('0x40')]);_0x146f5c[_0xbe59('0x44')]=_[_0xbe59('0x43')](_0x209e0b[_0xbe59('0x44')]);_0x146f5c[_0xbe59('0x45')]=_[_0xbe59('0x46')](_0x146f5c[_0xbe59('0x42')],_0x146f5c[_0xbe59('0x44')]);_0x1b04fe['attributes']=_[_0xbe59('0x46')](_0x146f5c[_0xbe59('0x42')],qs[_0xbe59('0x47')](_0x209e0b[_0xbe59('0x44')][_0xbe59('0x47')]));_0x1b04fe['attributes']=_0x1b04fe[_0xbe59('0x48')][_0xbe59('0x49')]?_0x1b04fe['attributes']:_0x146f5c[_0xbe59('0x42')];if(!_0x209e0b[_0xbe59('0x44')]['hasOwnProperty'](_0xbe59('0x4b'))){_0x1b04fe['limit']=qs['limit'](_0x209e0b[_0xbe59('0x44')]['limit']);_0x1b04fe[_0xbe59('0x26')]=qs[_0xbe59('0x26')](_0x209e0b['query'][_0xbe59('0x26')]);}_0x1b04fe[_0xbe59('0x4c')]=qs[_0xbe59('0x4d')](_0x209e0b['query'][_0xbe59('0x4d')]);_0x1b04fe[_0xbe59('0x4e')]=qs[_0xbe59('0x45')](_[_0xbe59('0x4f')](_0x209e0b['query'],_0x146f5c[_0xbe59('0x45')]));_0x1b04fe['where'][_0xbe59('0xbb')]=_0x2bf0d2['id'];if(_0x209e0b[_0xbe59('0x44')][_0xbe59('0x8e')]){_0x1b04fe['where']=_[_0xbe59('0xa6')](_0x1b04fe[_0xbe59('0x4e')],{'$or':_['map'](_0x1b04fe[_0xbe59('0x48')],function(_0x79bc36){var _0x284fe6={};_0x284fe6[_0x79bc36]={'$like':'%'+_0x209e0b[_0xbe59('0x44')]['filter']+'%'};return _0x284fe6;})});}if(_0x209e0b['query'][_0xbe59('0x82')]){var _0x3377e8=_0x209e0b['query'][_0xbe59('0x82')][_0xbe59('0x76')](',');var _0x54fa9f={};_0x54fa9f[_0x3377e8[0x0]]={'$gte':moment(_0x3377e8[0x1])[_0xbe59('0xcd')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1b04fe[_0xbe59('0x4e')]=_['merge'](_0x1b04fe[_0xbe59('0x4e')],_0x54fa9f);}_0x1b04fe=_[_0xbe59('0xa6')]({},_0x1b04fe,_0x209e0b[_0xbe59('0xc1')]);return db['OpenchannelMessage']['count']({'where':_0x1b04fe[_0xbe59('0x4e')]})[_0xbe59('0x2d')](function(_0x3fbce6){_0x1e457d[_0xbe59('0x29')]=_0x3fbce6;if(_0x209e0b[_0xbe59('0x44')]['includeAll']){_0x1b04fe[_0xbe59('0xc0')]=[{'all':!![]}];}return db[_0xbe59('0xc8')][_0xbe59('0xce')](_0x1b04fe);})[_0xbe59('0x2d')](function(_0x4d54d5){_0x1e457d[_0xbe59('0xbd')]=_0x4d54d5;return _0x1e457d;});}})[_0xbe59('0x2d')](respondWithFilteredResult(_0x33b9ca,_0x1b04fe))[_0xbe59('0xc3')](handleError(_0x33b9ca,null));};exports[_0xbe59('0xcf')]=function(_0xf2bb70,_0x41b4e3,_0x11075b){return db[_0xbe59('0x3f')][_0xbe59('0x69')]({'where':{'id':_0xf2bb70[_0xbe59('0xbf')]['id']}})[_0xbe59('0x2d')](handleEntityNotFound(_0x41b4e3,null))[_0xbe59('0x2d')](function(_0x550cd6){if(_0x550cd6){return _0x550cd6[_0xbe59('0xd0')](_0xf2bb70[_0xbe59('0x7b')]['ids'],_[_0xbe59('0xca')](_0xf2bb70[_0xbe59('0x7b')],[_0xbe59('0xc9'),'id'])||{})[_0xbe59('0xd1')](function(){return db[_0xbe59('0x75')][_0xbe59('0xce')]({'attributes':['id',_0xbe59('0x30'),_0xbe59('0x52')],'where':{'id':_0xf2bb70[_0xbe59('0x7b')]['ids']}});})['then'](function(_0x4dc7dd){socket['emit'](_0xbe59('0xd2'),{'id':Number(_0xf2bb70[_0xbe59('0xbf')]['id']),'tags':_0x4dc7dd||[]});return{'id':Number(_0xf2bb70[_0xbe59('0xbf')]['id']),'tags':_0x4dc7dd||[]};});}})[_0xbe59('0x2d')](respondWithResult(_0x41b4e3,null))['catch'](handleError(_0x41b4e3,null));};exports['removeTags']=function(_0xb8e370,_0x2e1001,_0x5e2ceb){return db['OpenchannelInteraction']['find']({'where':{'id':_0xb8e370[_0xbe59('0xbf')]['id']}})[_0xbe59('0x2d')](handleEntityNotFound(_0x2e1001,null))[_0xbe59('0x2d')](function(_0x37f21f){if(_0x37f21f){return _0x37f21f['removeTags'](_0xb8e370[_0xbe59('0x44')][_0xbe59('0xc9')]);}})[_0xbe59('0x2d')](respondWithStatusCode(_0x2e1001,null))[_0xbe59('0xc3')](handleError(_0x2e1001,null));};exports[_0xbe59('0xd3')]=function(_0x4d641f,_0x5b9fdf){var _0x449bb2=moment()[_0xbe59('0xd4')]()[_0xbe59('0xa4')]();var _0xf87ab8=path[_0xbe59('0xd5')](config[_0xbe59('0xd6')],_0xbe59('0xd7'),'files',_0xbe59('0xd8'));var _0x3f2b18=path[_0xbe59('0xd5')](config[_0xbe59('0xd6')],_0xbe59('0xd7'),_0xbe59('0xd9'),_0xbe59('0xda'));var _0x2d415e=path[_0xbe59('0xd5')](_0xf87ab8,_0x449bb2);var _0x30a78d=util[_0xbe59('0xcd')](_0xbe59('0xdb'),_0x4d641f[_0xbe59('0xbf')]['id'],_0x449bb2);var _0x2b7ff6=path[_0xbe59('0xd5')](_0xf87ab8,_0x30a78d);var _0x2d2c8a=[];_0x2d2c8a[_0xbe59('0x37')]({'model':db['User'],'as':_0xbe59('0x79'),'attributes':['id',_0xbe59('0x34')],'raw':!![]});_0x2d2c8a['push']({'model':db[_0xbe59('0xdc')],'as':_0xbe59('0xdd'),'attributes':['id',_0xbe59('0xde'),'lastName'],'raw':!![]});if(_0x4d641f[_0xbe59('0x44')][_0xbe59('0xda')]){_0x2d2c8a[_0xbe59('0x37')]({'model':db[_0xbe59('0xdf')],'as':_0xbe59('0xdf'),'raw':!![]});}var _0x2a9824=[{'model':db[_0xbe59('0xc8')],'as':_0xbe59('0xe0'),'attributes':['id',_0xbe59('0x7b'),_0xbe59('0x81'),'direction',_0xbe59('0xe1'),_0xbe59('0x89')],'include':_0x2d2c8a}];_0x2a9824[_0xbe59('0x37')]({'model':db[_0xbe59('0xe2')],'as':_0xbe59('0xe3'),'attributes':['id',_0xbe59('0x30')]});_0x2a9824['push']({'model':db['User'],'as':_0xbe59('0xe4'),'attributes':['id',_0xbe59('0x34')]});return db[_0xbe59('0x3f')][_0xbe59('0x69')]({'where':{'id':_0x4d641f['params']['id']},'include':_0x2a9824})[_0xbe59('0x2d')](handleEntityNotFound(_0x5b9fdf,null))['then'](function(_0x4ee333){if(_0x4ee333){var _0x326a3b=_0x4ee333[_0xbe59('0xe5')]({'plain':!![]});fs['mkdirSync'](_0x2d415e);var _0x17a78e={'channel':'Openchannel','account':_0x326a3b[_0xbe59('0xe3')][_0xbe59('0x30')],'agent':_0x326a3b[_0xbe59('0xe4')]?_0x326a3b['Owner']['fullname']:_0xbe59('0xe6'),'createdAt':moment(_0x326a3b[_0xbe59('0x81')])['format'](_0xbe59('0xe7'))[_0xbe59('0xa4')](),'closedAt':_0x326a3b[_0xbe59('0x3b')]?moment(_0x326a3b[_0xbe59('0xe8')])[_0xbe59('0xcd')](_0xbe59('0xe7'))[_0xbe59('0xa4')]():'','disposition':_0x326a3b[_0xbe59('0xe9')],'visibility':_0x326a3b[_0xbe59('0xea')]?_0xbe59('0xeb'):_0xbe59('0xec'),'messages':_(_0x326a3b[_0xbe59('0xe0')])[_0xbe59('0x8e')]({'secret':![]})[_0xbe59('0x33')](function(_0x534f6c){if(_0x534f6c[_0xbe59('0xdf')]){var _0x164645=path[_0xbe59('0xd5')](_0x3f2b18,_0x534f6c[_0xbe59('0xdf')][_0xbe59('0xed')]);if(fs[_0xbe59('0xee')](_0x164645)){fs['createReadStream'](_0x164645)[_0xbe59('0xef')](fs['createWriteStream'](path[_0xbe59('0xd5')](_0x2d415e,_0x534f6c['Attachment'][_0xbe59('0xed')])));}}return{'date':moment(_0x534f6c[_0xbe59('0x81')])[_0xbe59('0xcd')](_0xbe59('0xe7'))['toString'](),'sender':_0x534f6c['direction']===_0xbe59('0xf0')?_0x534f6c[_0xbe59('0x79')]?_0x534f6c['User'][_0xbe59('0x34')]:'System':_0x534f6c['Contact'][_0xbe59('0xde')]+(_0x534f6c[_0xbe59('0xdd')]['lastName']?'\x20'+_0x534f6c[_0xbe59('0xdd')][_0xbe59('0xf1')]:''),'body':_0x534f6c[_0xbe59('0xdf')]?_0x534f6c[_0xbe59('0xdf')][_0xbe59('0xed')]:_0x534f6c[_0xbe59('0x7b')],'direction':_0x534f6c[_0xbe59('0xf2')]===_0xbe59('0xf0')?'A':'C','secret':_0x534f6c[_0xbe59('0xe1')],'read':_0x534f6c[_0xbe59('0x89')],'attachment':_0x534f6c[_0xbe59('0xdf')]};})[_0xbe59('0x6b')]()};return ejs[_0xbe59('0xf3')](path[_0xbe59('0xd5')](config['root'],_0xbe59('0xd7'),'views',_0xbe59('0xf4')),{'interaction':_0x17a78e})[_0xbe59('0x2d')](function(_0x424204){var _0x4485b8=path[_0xbe59('0xd5')](_0x2d415e,_0xbe59('0xf5')+_0x326a3b['id']+'-'+_0x449bb2+'.pdf');var _0x44a136={'path':_0x4485b8,'channel':_0xbe59('0xf6'),'interactionId':_0x326a3b['id']};return pdf['createPdfFromHTML'](_0x424204,_0x44a136);})[_0xbe59('0x2d')](function(){return new BPromise(function(_0x5ce6da,_0x272530){zipdir(_0x2d415e,{'saveTo':_0x2b7ff6},function(_0x14268c,_0x46dfaf){if(_0x14268c)return _0x272530(_0x14268c);return _0x5ce6da(_0x46dfaf);});})[_0xbe59('0x2d')](function(){return new BPromise(function(_0x12e8ca,_0x3b7cfb){rimraf(_0x2d415e,function(_0x591607){if(_0x591607)_0x3b7cfb(_0x591607);return _0x12e8ca();});});})[_0xbe59('0x2d')](function(){return _0x5b9fdf[_0xbe59('0xd3')](_0x2b7ff6,_0x30a78d,function(_0x19cac6){if(_0x19cac6){console['log'](_0xbe59('0xf7'),_0x19cac6);}else{fs['unlinkSync'](_0x2b7ff6);}});});});}else{return _0x5b9fdf['sendStatus'](0xc8);}})[_0xbe59('0xc3')](handleError(_0x5b9fdf,null));}; \ No newline at end of file +var _0xd461=['parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','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','start','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','where','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','isEmpty','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','params','model','includeAll','include','options','create','update','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','pick','format','findAll','rows','spread','Tag','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','createdAt','OpenchannelAccount','Account','get','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','threadId','Public','Private','createReadStream','pipe','System','basename','direction','out','secret','views','downloadInteraction.ejs','Openchannel','createPdfFromHTML','log','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../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','../../mysqldb','redis','defaults','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','catch','waiting','talking','unmanaged','total','closed','UserId','index','OpenchannelInteraction','rawAttributes','type','key','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','select','field','color','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','expr','search'];(function(_0x566654,_0x9bb7c1){var _0x5480c1=function(_0x674be6){while(--_0x674be6){_0x566654['push'](_0x566654['shift']());}};_0x5480c1(++_0x9bb7c1);}(_0xd461,0x17a));var _0x1d46=function(_0x1f1df1,_0x1e883f){_0x1f1df1=_0x1f1df1-0x0;var _0x21ae3b=_0xd461[_0x1f1df1];return _0x21ae3b;};'use strict';var emlformat=require(_0x1d46('0x0'));var rimraf=require(_0x1d46('0x1'));var zipdir=require(_0x1d46('0x2'));var jsonpatch=require(_0x1d46('0x3'));var rp=require('request-promise');var moment=require(_0x1d46('0x4'));var BPromise=require(_0x1d46('0x5'));var Mustache=require(_0x1d46('0x6'));var util=require(_0x1d46('0x7'));var path=require('path');var sox=require(_0x1d46('0x8'));var csv=require(_0x1d46('0x9'));var ejs=require(_0x1d46('0xa'));var fs=require('fs');var fs_extra=require(_0x1d46('0xb'));var _=require(_0x1d46('0xc'));var squel=require(_0x1d46('0xd'));var crypto=require(_0x1d46('0xe'));var jsforce=require(_0x1d46('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1d46('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1d46('0x10'));var qs=require(_0x1d46('0x11'));var as=require(_0x1d46('0x12'));var pdf=require(_0x1d46('0x13'));var hardwareService=require(_0x1d46('0x14'));var logger=require(_0x1d46('0x15'))(_0x1d46('0x16'));var utils=require(_0x1d46('0x17'));var config=require(_0x1d46('0x18'));var licenseUtil=require(_0x1d46('0x19'));var db=require(_0x1d46('0x1a'))['db'];config[_0x1d46('0x1b')]=_[_0x1d46('0x1c')](config[_0x1d46('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x1d46('0x1d')](socket);function respondWithStatusCode(_0x31920f,_0x311488){_0x311488=_0x311488||0xcc;return function(_0x3faf21){if(_0x3faf21){return _0x31920f[_0x1d46('0x1e')](_0x311488);}return _0x31920f[_0x1d46('0x1f')](_0x311488)[_0x1d46('0x20')]();};}function respondWithResult(_0x3c018c,_0x4326cd){_0x4326cd=_0x4326cd||0xc8;return function(_0x29187f){if(_0x29187f){return _0x3c018c[_0x1d46('0x1f')](_0x4326cd)['json'](_0x29187f);}};}function respondWithFilteredResult(_0x1799b1,_0x300982){return function(_0x5720af){if(_0x5720af){var _0x25afb8=typeof _0x300982[_0x1d46('0x21')]===_0x1d46('0x22')&&typeof _0x300982[_0x1d46('0x23')]==='undefined';var _0x598492=_0x5720af[_0x1d46('0x24')];var _0x157925=_0x25afb8?0x0:_0x300982[_0x1d46('0x21')];var _0x51136a=_0x25afb8?_0x5720af[_0x1d46('0x24')]:_0x300982[_0x1d46('0x21')]+_0x300982[_0x1d46('0x23')];var _0x104865;if(_0x51136a>=_0x598492){_0x51136a=_0x598492;_0x104865=0xc8;}else{_0x104865=0xce;}_0x1799b1[_0x1d46('0x1f')](_0x104865);return _0x1799b1['set'](_0x1d46('0x25'),_0x157925+'-'+_0x51136a+'/'+_0x598492)[_0x1d46('0x26')](_0x5720af);}return null;};}function patchUpdates(_0x8dad44){return function(_0x5e20c0){try{jsonpatch[_0x1d46('0x27')](_0x5e20c0,_0x8dad44,!![]);}catch(_0x386d88){return BPromise[_0x1d46('0x28')](_0x386d88);}return _0x5e20c0[_0x1d46('0x29')]();};}function saveUpdates(_0x64aa74,_0x135402){return function(_0xe04446){if(_0xe04446){return _0xe04446['update'](_0x64aa74)['then'](function(_0x3f2e41){return _0x3f2e41;});}return null;};}function removeEntity(_0xb97100,_0x2ad207){return function(_0x281afe){if(_0x281afe){return _0x281afe[_0x1d46('0x2a')]()[_0x1d46('0x2b')](function(){_0xb97100[_0x1d46('0x1f')](0xcc)[_0x1d46('0x20')]();});}};}function handleEntityNotFound(_0x20665b,_0x38959f){return function(_0x46e4db){if(!_0x46e4db){_0x20665b['sendStatus'](0x194);}return _0x46e4db;};}function handleError(_0x42c98f,_0x1afccc){_0x1afccc=_0x1afccc||0x1f4;return function(_0x2b9816){logger[_0x1d46('0x2c')](_0x2b9816[_0x1d46('0x2d')]);if(_0x2b9816[_0x1d46('0x2e')]){delete _0x2b9816['name'];}_0x42c98f[_0x1d46('0x1f')](_0x1afccc)[_0x1d46('0x2f')](_0x2b9816);};}function getInteractionUsers(_0x50e985,_0x2715b4){return new BPromise(function(_0x250380,_0x495aff){try{if(_0x2715b4[_0x50e985['id']]){_0x50e985[_0x1d46('0x30')]=_[_0x1d46('0x31')](_0x2715b4[_0x50e985['id']],function(_0x35193f){return{'id':_0x35193f['id'],'fullname':_0x35193f[_0x1d46('0x32')]};});}}catch(_0x1da0c7){_0x495aff(_0x1da0c7);}_0x250380(_0x50e985);});}function getInteractionTags(_0x483883,_0x557f5e){return new BPromise(function(_0x3b29ec,_0x20d785){try{if(_0x483883[_0x1d46('0x33')]){_0x483883[_0x1d46('0x34')]=[];_0x483883['TagIds'][_0x1d46('0x35')](',')[_0x1d46('0x36')](function(_0x289a07){_0x483883['Tags']['push'](_0x557f5e[_0x289a07]);});}delete _0x483883['TagIds'];}catch(_0x5b869e){_0x20d785(_0x5b869e);}_0x3b29ec(_0x483883);});}function updateOpenchannelInteraction(_0x2cef28,_0x547b42,_0x4789e4){return new BPromise(function(_0x5ea2ca,_0x5f4c3c){return getInteractionUsers(_0x2cef28,_0x4789e4)[_0x1d46('0x2b')](function(_0x2a638b){return getInteractionTags(_0x2a638b,_0x547b42);})[_0x1d46('0x2b')](function(_0x22f4dd){return getStateInteraction(_0x22f4dd);})[_0x1d46('0x2b')](function(_0x2ba3c4){_0x5ea2ca(_0x2ba3c4);})[_0x1d46('0x37')](function(_0x3363e7){_0x5f4c3c(_0x3363e7);});});}function getStateInteraction(_0x3e15e0){return new BPromise(function(_0x1058be){_0x3e15e0[_0x1d46('0x38')]=0x0;_0x3e15e0[_0x1d46('0x39')]=0x0;_0x3e15e0['answered']=0x0;_0x3e15e0[_0x1d46('0x3a')]=0x0;_0x3e15e0[_0x1d46('0x3b')]=0x0;if(!_0x3e15e0[_0x1d46('0x3c')]&&!_0x3e15e0[_0x1d46('0x3d')]){_0x3e15e0[_0x1d46('0x38')]+=0x1;}if(!_0x3e15e0[_0x1d46('0x3c')]&&_0x3e15e0[_0x1d46('0x3d')]){_0x3e15e0[_0x1d46('0x39')]+=0x1;if(_0x3e15e0[_0x1d46('0x38')]){_0x3e15e0['waiting']-=0x1;}}if(_0x3e15e0[_0x1d46('0x3c')]&&_0x3e15e0[_0x1d46('0x3d')]){_0x3e15e0['answered']+=0x1;if(_0x3e15e0[_0x1d46('0x39')]){_0x3e15e0['talking']-=0x1;}}if(_0x3e15e0[_0x1d46('0x3c')]&&!_0x3e15e0[_0x1d46('0x3d')]){_0x3e15e0['unmanaged']+=0x1;if(_0x3e15e0['waiting']){_0x3e15e0[_0x1d46('0x38')]-=0x1;}}_0x3e15e0[_0x1d46('0x3b')]+=0x1;_0x1058be(_0x3e15e0);});}exports[_0x1d46('0x3e')]=function(_0x2de828,_0x5e0524){var _0x4def6b={},_0x2ea86d={},_0x446be0={'count':0x0,'rows':[]};var _0x41a344=_[_0x1d46('0x31')](db[_0x1d46('0x3f')][_0x1d46('0x40')],function(_0xe6378b){return{'name':_0xe6378b['fieldName'],'type':_0xe6378b[_0x1d46('0x41')][_0x1d46('0x42')]};});_0x2ea86d['model']=_['map'](_0x41a344,'name');_0x2ea86d['query']=_[_0x1d46('0x43')](_0x2de828[_0x1d46('0x44')]);_0x2ea86d[_0x1d46('0x45')]=_[_0x1d46('0x46')](_0x2ea86d['model'],_0x2ea86d[_0x1d46('0x44')]);_0x4def6b[_0x1d46('0x47')]=_['intersection'](_0x2ea86d['model'],qs[_0x1d46('0x48')](_0x2de828[_0x1d46('0x44')][_0x1d46('0x48')]));_0x4def6b[_0x1d46('0x47')]=_0x4def6b[_0x1d46('0x47')][_0x1d46('0x49')]?_0x4def6b['attributes']:_0x2ea86d['model'];if(!_0x2de828['query'][_0x1d46('0x4a')]('nolimit')){_0x4def6b[_0x1d46('0x23')]=qs[_0x1d46('0x23')](_0x2de828['query'][_0x1d46('0x23')]);_0x4def6b[_0x1d46('0x21')]=qs[_0x1d46('0x21')](_0x2de828['query'][_0x1d46('0x21')]);}_0x4def6b[_0x1d46('0x4b')]=qs[_0x1d46('0x4c')](_0x2de828['query'][_0x1d46('0x4c')]);_0x4def6b['where']=qs['filters'](_['pick'](_0x2de828[_0x1d46('0x44')],_0x2ea86d[_0x1d46('0x45')]),_0x41a344);var _0xdf2a5b=[];var _0x238d98=squel[_0x1d46('0x4d')]()[_0x1d46('0x4e')]('id')['field'](_0x1d46('0x2e'))['field'](_0x1d46('0x4f'))[_0x1d46('0x50')]('tools_tags');var _0x471213=squel[_0x1d46('0x4d')]()[_0x1d46('0x4e')]('u.id')[_0x1d46('0x4e')]('u.fullname')[_0x1d46('0x4e')]('ui.OpenchannelInteractionId')[_0x1d46('0x50')](_0x1d46('0x51'),'ui')[_0x1d46('0x52')](_0x1d46('0x53'),'u',_0x1d46('0x54'));var _0x5362a8=squel[_0x1d46('0x4d')]()[_0x1d46('0x50')](_0x1d46('0x55'),'i')['left_join']('cm_contacts','c',_0x1d46('0x56'))['left_join'](_0x1d46('0x53'),'o',_0x1d46('0x57'))['left_join'](_0x1d46('0x58'),'a',_0x1d46('0x59'))[_0x1d46('0x52')]('openchannel_messages','me',_0x1d46('0x5a'))[_0x1d46('0x52')](_0x1d46('0x5b'),'it',_0x1d46('0x5c'))[_0x1d46('0x52')](_0x1d46('0x5d'),'t','t.id\x20=\x20it.TagId');var _0x41a403=squel[_0x1d46('0x5e')]();var _0x422926=[];var _0x4739db=squel[_0x1d46('0x5e')]();var _0x1fbf1f;if(_0x2de828[_0x1d46('0x44')][_0x1d46('0x5f')]){_0x1fbf1f=as[_0x1d46('0x60')](_0x2de828[_0x1d46('0x44')][_0x1d46('0x5f')]);var _0x2f828b=_0x1fbf1f[_0x1d46('0x61')];for(var _0x43a932=0x0;_0x43a932<_0x1fbf1f[_0x1d46('0x62')]['length'];_0x43a932++){var _0xed2322=_0x1fbf1f[_0x1d46('0x62')][_0x43a932];var _0x2f257e='i';var _0x58ccb9=_[_0x1d46('0x63')](_0x41a344,[_0x1d46('0x2e'),_0xed2322[_0x1d46('0x4e')]]);if(!_0x58ccb9){switch(_0xed2322[_0x1d46('0x4e')]){case _0x1d46('0x64'):if(_0xed2322['value']==0x1){_0x5362a8[_0x1d46('0x65')]('`'+_0xed2322[_0x1d46('0x4e')]+_0x1d46('0x66'));}else{_0x5362a8[_0x1d46('0x65')]('`'+_0xed2322[_0x1d46('0x4e')]+_0x1d46('0x67'));}break;case _0x1d46('0x68'):if(_0xed2322['operator']===_0x1d46('0x69')){if(_0xed2322['value'][_0x1d46('0x35')]('\x20')[_0x1d46('0x49')]>0x1){_0x41a403[_0x2f828b](_0x1d46('0x6a'),qs[_0x1d46('0x6b')](_0xed2322[_0x1d46('0x6c')]),null);}else{var _0xa6db7a='%'+_0xed2322[_0x1d46('0x6c')]+'%';_0x41a403[_0x2f828b](_0x1d46('0x6d'),_0xa6db7a,_0xa6db7a,_0xa6db7a);}}else{_0x58ccb9=_[_0x1d46('0x63')](_0x41a344,[_0x1d46('0x2e'),_0x1d46('0x6e')]);_0xed2322['field']=_0x1d46('0x6e');_0x470722=as[_0x1d46('0x6f')](_0x2f257e,_0x58ccb9[_0x1d46('0x41')],_0xed2322);_0x41a403[_0x2f828b](_0x470722[_0x1d46('0x70')],_0x470722[_0x1d46('0x6c')][_0x1d46('0x71')],_0x470722[_0x1d46('0x6c')][_0x1d46('0x20')]);}break;case'Tag':var _0x40f98d=_0xed2322['value'][_0x1d46('0x35')](',')[_0x1d46('0x31')](function(_0x2fc617){return Number(_0x2fc617);});_0x40f98d[_0x1d46('0x36')](function(_0x40d828){_0x4739db['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x40d828+',%');});_0x422926=_[_0x1d46('0x72')](_0x422926,_0x40f98d);break;case _0x1d46('0x73'):if(_0xed2322[_0x1d46('0x74')]===_0x1d46('0x69')){_0x41a403[_0x2f828b](_0x1d46('0x75'),'%'+_0xed2322[_0x1d46('0x6c')]+'%',null);}else{_0x58ccb9=_[_0x1d46('0x63')](_0x41a344,['name','UserId']);_0xed2322[_0x1d46('0x4e')]=_0x1d46('0x3d');_0x470722=as['buildExpression'](_0x2f257e,_0x58ccb9[_0x1d46('0x41')],_0xed2322);_0x41a403[_0x2f828b](_0x470722[_0x1d46('0x70')],_0x470722[_0x1d46('0x6c')][_0x1d46('0x71')],_0x470722['value']['end']);}break;case _0x1d46('0x76'):_0x470722=as[_0x1d46('0x6f')]('me',null,_0xed2322);_0x41a403[_0x2f828b](_0x470722[_0x1d46('0x70')],_0x470722[_0x1d46('0x6c')][_0x1d46('0x71')],_0x470722['value'][_0x1d46('0x20')]);break;}}else{var _0x470722=as[_0x1d46('0x6f')](_0x2f257e,_0x58ccb9['type'],_0xed2322);_0x41a403[_0x2f828b](_0x470722[_0x1d46('0x70')],_0x470722[_0x1d46('0x6c')][_0x1d46('0x71')],_0x470722[_0x1d46('0x6c')][_0x1d46('0x20')]);}}}else{var _0xf8c07f=_(_0x2de828[_0x1d46('0x44')])[_0x1d46('0x43')]()[_0x1d46('0x31')](function(_0x3a03bd){return _['some'](_0x41a344,['name',_0x3a03bd])?_0x3a03bd:undefined;})[_0x1d46('0x77')]()['value']();if(!_['isEmpty'](_0xf8c07f)){_0xf8c07f[_0x1d46('0x36')](function(_0x58dbd4){if(_0x58dbd4==='OpenchannelAccountId'){_0x5362a8[_0x1d46('0x78')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x2de828[_0x1d46('0x44')][_0x58dbd4]));}else if(_0x58dbd4==='createdAt'){var _0x579506=JSON['parse'](_0x2de828['query'][_0x58dbd4])[_0x1d46('0x79')];var _0x48b873=JSON[_0x1d46('0x7a')](_0x2de828[_0x1d46('0x44')][_0x58dbd4])[_0x1d46('0x7b')];_0x5362a8[_0x1d46('0x78')](_0x1d46('0x7c'),_0x579506,_0x48b873);}else{if(_0x2de828[_0x1d46('0x44')][_0x58dbd4]===_0x1d46('0x7d')){_0x5362a8['where']('i.'+_0x58dbd4+_0x1d46('0x7e'));}else{_0x5362a8[_0x1d46('0x78')]('i.'+_0x58dbd4+_0x1d46('0x7f'),_0x2de828['query'][_0x58dbd4]);}}});}if(_0x2de828[_0x1d46('0x44')][_0x1d46('0x80')]){if(_0x2de828[_0x1d46('0x44')][_0x1d46('0x80')]==0x1){_0x5362a8[_0x1d46('0x65')]('`unreadMessages`\x20=\x200');}else{_0x5362a8['having'](_0x1d46('0x81'));}}if(_0x2de828[_0x1d46('0x44')][_0x1d46('0x82')]){_0x422926=_['isArray'](_0x2de828[_0x1d46('0x44')][_0x1d46('0x82')])?_0x2de828[_0x1d46('0x44')][_0x1d46('0x82')]:new Array(_0x2de828[_0x1d46('0x44')][_0x1d46('0x82')]);_0x422926[_0x1d46('0x36')](function(_0x2d6ced){_0x4739db['or'](_0x1d46('0x83'),'%,'+_0x2d6ced+',%');});}if(_0x2de828[_0x1d46('0x44')][_0x1d46('0x84')]){var _0x467ef2=_0x2de828[_0x1d46('0x44')][_0x1d46('0x84')][_0x1d46('0x85')]('\x5c','\x5c\x5c')[_0x1d46('0x85')](/'/g,'\x27\x27');if(qs[_0x1d46('0x86')](_0x467ef2)){_0x41a403['or'](_0x1d46('0x87'),_0x467ef2+'%');}else{_0x41a403['or'](_0x1d46('0x88'),qs[_0x1d46('0x6b')](_0x467ef2))['or'](_0x1d46('0x89'),_0x467ef2+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x467ef2+'%');}}}_0x5362a8[_0x1d46('0x78')](_0x41a403);_0x5362a8[_0x1d46('0x8a')](_0x1d46('0x8b'));var _0x80fb1={'type':db['Sequelize'][_0x1d46('0x8c')][_0x1d46('0x8d')],'raw':!![]};var _0x48a4e3=_0x5362a8['clone']();_0x48a4e3[_0x1d46('0x4e')](_0x1d46('0x8b'));_0x48a4e3[_0x1d46('0x4e')](_0x1d46('0x8e'),_0x1d46('0x64'));if(_0x4def6b['order']){_0x4def6b[_0x1d46('0x4b')][_0x1d46('0x36')](function(_0xcf78df){var _0x307e1b=_0xcf78df[0x0]===_0x1d46('0x8f')?_0xcf78df[0x0]:'i.'+_0xcf78df[0x0];_0x5362a8[_0x1d46('0x4b')](_0x307e1b,_0xcf78df[0x1]==='DESC'?![]:!![]);});}if(!_[_0x1d46('0x90')](_0x422926)){_0x5362a8[_0x1d46('0x65')](_0x4739db);_0x48a4e3[_0x1d46('0x78')](_0x1d46('0x91'),_0x422926);}BPromise[_0x1d46('0x92')]()[_0x1d46('0x2b')](function(){if(!_0x1fbf1f){if(_0x2de828[_0x1d46('0x44')][_0x1d46('0x93')])return;_0x48a4e3[_0x1d46('0x78')](_0x1d46('0x94'));_0x5362a8[_0x1d46('0x78')](_0x1d46('0x94'));return;}if(_0x2de828[_0x1d46('0x95')][_0x1d46('0x96')]!==_0x1d46('0x97'))return;return _0x2de828[_0x1d46('0x95')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x1d46('0x2b')](function(_0x284280){if(_[_0x1d46('0x90')](_0x284280)){_0x48a4e3['where'](_0x1d46('0x98'));_0x5362a8[_0x1d46('0x78')](_0x1d46('0x98'));}else{_0x48a4e3[_0x1d46('0x78')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x284280,'id'));_0x5362a8[_0x1d46('0x78')](_0x1d46('0x99'),_[_0x1d46('0x31')](_0x284280,'id'));}});})['then'](function(){if(_0x2de828[_0x1d46('0x95')][_0x1d46('0x96')]===_0x1d46('0x97')&&!_0x1fbf1f&&!_0x2de828[_0x1d46('0x44')][_0x1d46('0x93')])return[];return db[_0x1d46('0x9a')]['query'](_0x48a4e3[_0x1d46('0x9b')](),_0x80fb1);})[_0x1d46('0x2b')](function(_0x433e70){_0x446be0[_0x1d46('0x24')]=_0x433e70[_0x1d46('0x49')];if(_0x446be0[_0x1d46('0x24')]===0x0)return[];return db['sequelize'][_0x1d46('0x44')](_0x238d98[_0x1d46('0x9b')](),_0x80fb1)[_0x1d46('0x2b')](function(_0x774acc){_0xdf2a5b=_[_0x1d46('0x9c')](_0x774acc,'id');_0x80fb1=_[_0x1d46('0x9d')](_0x80fb1,{'model':db[_0x1d46('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2de828[_0x1d46('0x44')]['fields']){_0x4def6b[_0x1d46('0x47')][_0x1d46('0x36')](function(_0x5a778e){_0x5362a8['field']('i.'+_0x5a778e);});}else{_0x5362a8[_0x1d46('0x4e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1d46('0x64'));_0x5362a8[_0x1d46('0x4e')]('a.key','Account.key');_0x5362a8['field'](_0x1d46('0x9e'),_0x1d46('0x9f'));_0x5362a8[_0x1d46('0x4e')](_0x1d46('0xa0'),_0x1d46('0x8f'));_0x5362a8[_0x1d46('0x4e')](_0x1d46('0xa1'));_0x5362a8[_0x1d46('0x4e')](_0x1d46('0xa2'),'Contact.firstName');_0x5362a8[_0x1d46('0x4e')]('c.lastName',_0x1d46('0xa3'));_0x5362a8[_0x1d46('0x4e')](_0x1d46('0xa4'),_0x1d46('0xa5'));_0x5362a8['field']('c.phone','Contact.phone');_0x5362a8[_0x1d46('0x4e')](_0x1d46('0xa6'),_0x1d46('0xa7'));_0x5362a8[_0x1d46('0x4e')](_0x1d46('0xa8'),'Contact.fax');_0x5362a8[_0x1d46('0x4e')](_0x1d46('0xa9'),_0x1d46('0xaa'));_0x5362a8[_0x1d46('0x4e')](_0x1d46('0xab'),_0x1d46('0xac'));_0x5362a8[_0x1d46('0x4e')](_0x1d46('0xad'),_0x1d46('0x33'));}if(_0x4def6b[_0x1d46('0x23')])_0x5362a8[_0x1d46('0x23')](_0x4def6b[_0x1d46('0x23')]);if(_0x4def6b['offset'])_0x5362a8['offset'](_0x4def6b[_0x1d46('0x21')]);return db[_0x1d46('0x9a')][_0x1d46('0x44')](_0x5362a8[_0x1d46('0x9b')](),_0x80fb1);})[_0x1d46('0x2b')](function(_0x3f0456){if(_0x3f0456[_0x1d46('0x49')]>0x0)_0x471213['where'](_0x1d46('0xae'),_['map'](_0x3f0456,'id'));return db[_0x1d46('0x9a')][_0x1d46('0x44')](_0x471213[_0x1d46('0x9b')](),_0x80fb1)[_0x1d46('0x2b')](function(_0x2f8a24){var _0x33f600=_[_0x1d46('0xaf')](_0x2f8a24,_0x1d46('0xb0'));var _0x4da6e7=[];_0x3f0456['forEach'](function(_0x28517e){_0x4da6e7[_0x1d46('0xb1')](updateOpenchannelInteraction(_0x28517e,_0xdf2a5b,_0x33f600));});return BPromise[_0x1d46('0xb2')](_0x4da6e7);});});})[_0x1d46('0x2b')](function(_0x55046a){_0x446be0['rows']=_0x55046a;return _0x446be0;})[_0x1d46('0x2b')](respondWithFilteredResult(_0x5e0524,_0x4def6b))[_0x1d46('0x37')](handleError(_0x5e0524,null));};exports['show']=function(_0x1fae00,_0x2f2b1f){var _0x3c78cb={};if(_0x1fae00[_0x1d46('0x44')][_0x1d46('0x41')]&&_0x1fae00['query'][_0x1d46('0x41')]==='from'){_0x3c78cb[_0x1d46('0x50')]=_0x1fae00[_0x1d46('0xb3')]['id'];}else{_0x3c78cb['id']=_0x1fae00[_0x1d46('0xb3')]['id'];}var _0x3ffb74={'raw':![],'where':_0x3c78cb},_0x2c944a={};_0x2c944a[_0x1d46('0xb4')]=_[_0x1d46('0x43')](db['OpenchannelInteraction'][_0x1d46('0x40')]);_0x2c944a[_0x1d46('0x44')]=_[_0x1d46('0x43')](_0x1fae00[_0x1d46('0x44')]);_0x2c944a[_0x1d46('0x45')]=_[_0x1d46('0x46')](_0x2c944a[_0x1d46('0xb4')],_0x2c944a['query']);_0x3ffb74['attributes']=_[_0x1d46('0x46')](_0x2c944a[_0x1d46('0xb4')],qs[_0x1d46('0x48')](_0x1fae00[_0x1d46('0x44')][_0x1d46('0x48')]));_0x3ffb74[_0x1d46('0x47')]=_0x3ffb74[_0x1d46('0x47')]['length']?_0x3ffb74[_0x1d46('0x47')]:_0x2c944a[_0x1d46('0xb4')];if(_0x1fae00[_0x1d46('0x44')][_0x1d46('0xb5')]){_0x3ffb74[_0x1d46('0xb6')]=[{'all':!![]}];}_0x3ffb74=_[_0x1d46('0x9d')]({},_0x3ffb74,_0x1fae00[_0x1d46('0xb7')]);return db['OpenchannelInteraction']['find'](_0x3ffb74)[_0x1d46('0x2b')](handleEntityNotFound(_0x2f2b1f,null))[_0x1d46('0x2b')](respondWithResult(_0x2f2b1f,null))[_0x1d46('0x37')](handleError(_0x2f2b1f,null));};exports[_0x1d46('0xb8')]=function(_0xd09d3c,_0x547248){return db[_0x1d46('0x3f')][_0x1d46('0xb8')](_0xd09d3c[_0x1d46('0x76')],{})[_0x1d46('0x2b')](respondWithResult(_0x547248,0xc9))['catch'](handleError(_0x547248,null));};exports[_0x1d46('0xb9')]=function(_0x28cb14,_0x1c6cca){if(_0x28cb14['body']['id']){delete _0x28cb14[_0x1d46('0x76')]['id'];}return db[_0x1d46('0x3f')][_0x1d46('0x63')]({'where':{'id':_0x28cb14[_0x1d46('0xb3')]['id']}})[_0x1d46('0x2b')](handleEntityNotFound(_0x1c6cca,null))[_0x1d46('0x2b')](saveUpdates(_0x28cb14[_0x1d46('0x76')],null))[_0x1d46('0x2b')](respondWithResult(_0x1c6cca,null))[_0x1d46('0x37')](handleError(_0x1c6cca,null));};exports[_0x1d46('0x2a')]=function(_0x424148,_0x107951){return db['OpenchannelInteraction'][_0x1d46('0x63')]({'where':{'id':_0x424148['params']['id']}})[_0x1d46('0x2b')](handleEntityNotFound(_0x107951,null))[_0x1d46('0x2b')](removeEntity(_0x107951,null))[_0x1d46('0x37')](handleError(_0x107951,null));};exports[_0x1d46('0xba')]=function(_0x2fb093,_0x1f4207){return db[_0x1d46('0x3f')][_0x1d46('0xba')]()[_0x1d46('0x2b')](respondWithResult(_0x1f4207,null))['catch'](handleError(_0x1f4207,null));};exports[_0x1d46('0xbb')]=function(_0xbb64b1,_0x18d128,_0x5f4f92){return db[_0x1d46('0xbc')][_0x1d46('0x63')]({'where':{'id':_0xbb64b1[_0x1d46('0xb3')]['id']}})[_0x1d46('0x2b')](handleEntityNotFound(_0x18d128,null))[_0x1d46('0x2b')](function(_0x46605b){if(_0x46605b){return _0x46605b['addMessage'](_0xbb64b1[_0x1d46('0x76')][_0x1d46('0xbd')],_[_0x1d46('0xbe')](_0xbb64b1[_0x1d46('0x76')],[_0x1d46('0xbd'),'id'])||{});}})[_0x1d46('0x2b')](respondWithResult(_0x18d128,null))['catch'](handleError(_0x18d128,null));};exports[_0x1d46('0xbf')]=function(_0x116d99,_0x2a3cc6,_0x537132){var _0x3329e6={'raw':![],'where':{}};var _0x3e231e={};var _0x37c773={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x1d46('0xc0')]({'where':{'id':_0x116d99[_0x1d46('0xb3')]['id']}})[_0x1d46('0x2b')](handleEntityNotFound(_0x2a3cc6,null))[_0x1d46('0x2b')](function(_0xef639b){if(_0xef639b){_0x3e231e[_0x1d46('0xb4')]=_[_0x1d46('0x43')](db['OpenchannelMessage'][_0x1d46('0x40')]);_0x3e231e[_0x1d46('0x44')]=_[_0x1d46('0x43')](_0x116d99['query']);_0x3e231e[_0x1d46('0x45')]=_[_0x1d46('0x46')](_0x3e231e['model'],_0x3e231e[_0x1d46('0x44')]);_0x3329e6[_0x1d46('0x47')]=_[_0x1d46('0x46')](_0x3e231e[_0x1d46('0xb4')],qs[_0x1d46('0x48')](_0x116d99[_0x1d46('0x44')]['fields']));_0x3329e6[_0x1d46('0x47')]=_0x3329e6[_0x1d46('0x47')][_0x1d46('0x49')]?_0x3329e6[_0x1d46('0x47')]:_0x3e231e[_0x1d46('0xb4')];if(!_0x116d99[_0x1d46('0x44')][_0x1d46('0x4a')]('nolimit')){_0x3329e6[_0x1d46('0x23')]=qs[_0x1d46('0x23')](_0x116d99[_0x1d46('0x44')][_0x1d46('0x23')]);_0x3329e6['offset']=qs[_0x1d46('0x21')](_0x116d99[_0x1d46('0x44')]['offset']);}_0x3329e6['order']=qs[_0x1d46('0x4c')](_0x116d99[_0x1d46('0x44')][_0x1d46('0x4c')]);_0x3329e6[_0x1d46('0x78')]=qs[_0x1d46('0x45')](_[_0x1d46('0xc1')](_0x116d99[_0x1d46('0x44')],_0x3e231e[_0x1d46('0x45')]));_0x3329e6['where']['OpenchannelInteractionId']=_0xef639b['id'];if(_0x116d99['query'][_0x1d46('0x84')]){_0x3329e6[_0x1d46('0x78')]=_['merge'](_0x3329e6[_0x1d46('0x78')],{'$or':_[_0x1d46('0x31')](_0x3329e6[_0x1d46('0x47')],function(_0x585d72){var _0x487da8={};_0x487da8[_0x585d72]={'$like':'%'+_0x116d99[_0x1d46('0x44')]['filter']+'%'};return _0x487da8;})});}if(_0x116d99[_0x1d46('0x44')][_0x1d46('0x79')]){var _0x112926=_0x116d99[_0x1d46('0x44')][_0x1d46('0x79')][_0x1d46('0x35')](',');var _0x3671f5={};_0x3671f5[_0x112926[0x0]]={'$gte':moment(_0x112926[0x1])[_0x1d46('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3329e6[_0x1d46('0x78')]=_[_0x1d46('0x9d')](_0x3329e6[_0x1d46('0x78')],_0x3671f5);}_0x3329e6=_['merge']({},_0x3329e6,_0x116d99[_0x1d46('0xb7')]);return db['OpenchannelMessage'][_0x1d46('0x24')]({'where':_0x3329e6[_0x1d46('0x78')]})[_0x1d46('0x2b')](function(_0x2ec0c9){_0x37c773[_0x1d46('0x24')]=_0x2ec0c9;if(_0x116d99[_0x1d46('0x44')][_0x1d46('0xb5')]){_0x3329e6[_0x1d46('0xb6')]=[{'all':!![]}];}return db[_0x1d46('0xbc')][_0x1d46('0xc3')](_0x3329e6);})[_0x1d46('0x2b')](function(_0x2cbd77){_0x37c773[_0x1d46('0xc4')]=_0x2cbd77;return _0x37c773;});}})[_0x1d46('0x2b')](respondWithFilteredResult(_0x2a3cc6,_0x3329e6))[_0x1d46('0x37')](handleError(_0x2a3cc6,null));};exports['addTags']=function(_0x5b169e,_0x1eeeab,_0x71e50e){return db[_0x1d46('0x3f')][_0x1d46('0x63')]({'where':{'id':_0x5b169e[_0x1d46('0xb3')]['id']}})[_0x1d46('0x2b')](handleEntityNotFound(_0x1eeeab,null))[_0x1d46('0x2b')](function(_0x38218e){if(_0x38218e){return _0x38218e['setTags'](_0x5b169e['body'][_0x1d46('0xbd')],_[_0x1d46('0xbe')](_0x5b169e[_0x1d46('0x76')],[_0x1d46('0xbd'),'id'])||{})[_0x1d46('0xc5')](function(){return db[_0x1d46('0xc6')][_0x1d46('0xc3')]({'attributes':['id',_0x1d46('0x2e'),_0x1d46('0x4f')],'where':{'id':_0x5b169e[_0x1d46('0x76')]['ids']}});})[_0x1d46('0x2b')](function(_0x519c2d){socket['emit'](_0x1d46('0xc7'),{'id':Number(_0x5b169e[_0x1d46('0xb3')]['id']),'tags':_0x519c2d||[]});return{'id':Number(_0x5b169e[_0x1d46('0xb3')]['id']),'tags':_0x519c2d||[]};});}})['then'](respondWithResult(_0x1eeeab,null))[_0x1d46('0x37')](handleError(_0x1eeeab,null));};exports[_0x1d46('0xc8')]=function(_0x56c405,_0x4b5238,_0x5a1273){return db['OpenchannelInteraction'][_0x1d46('0x63')]({'where':{'id':_0x56c405['params']['id']}})[_0x1d46('0x2b')](handleEntityNotFound(_0x4b5238,null))[_0x1d46('0x2b')](function(_0x14a77d){if(_0x14a77d){return _0x14a77d[_0x1d46('0xc8')](_0x56c405[_0x1d46('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x4b5238,null))[_0x1d46('0x37')](handleError(_0x4b5238,null));};exports['download']=function(_0x74cad1,_0x1ea8ce){var _0x59c543=moment()[_0x1d46('0xc9')]()[_0x1d46('0x9b')]();var _0x2b4128=path[_0x1d46('0xca')](config[_0x1d46('0xcb')],_0x1d46('0xcc'),_0x1d46('0xcd'),'tmp');var _0x4432d3=path[_0x1d46('0xca')](config[_0x1d46('0xcb')],_0x1d46('0xcc'),_0x1d46('0xcd'),_0x1d46('0xce'));var _0x1289c3=path[_0x1d46('0xca')](_0x2b4128,_0x59c543);var _0x104ab0=util[_0x1d46('0xc2')](_0x1d46('0xcf'),_0x74cad1[_0x1d46('0xb3')]['id'],_0x59c543);var _0x49fd9f=path['join'](_0x2b4128,_0x104ab0);var _0x48ad47=[];_0x48ad47[_0x1d46('0xb1')]({'model':db[_0x1d46('0x73')],'as':_0x1d46('0x73'),'attributes':['id','fullname'],'raw':!![]});_0x48ad47['push']({'model':db[_0x1d46('0xd0')],'as':_0x1d46('0x68'),'attributes':['id',_0x1d46('0xd1'),_0x1d46('0xd2')],'raw':!![]});if(_0x74cad1[_0x1d46('0x44')][_0x1d46('0xce')]){_0x48ad47[_0x1d46('0xb1')]({'model':db[_0x1d46('0xd3')],'as':_0x1d46('0xd3'),'raw':!![]});}var _0x5dc0ab=[{'model':db[_0x1d46('0xbc')],'as':_0x1d46('0xd4'),'attributes':['id',_0x1d46('0x76'),_0x1d46('0xd5'),'direction','secret','read'],'include':_0x48ad47}];_0x5dc0ab[_0x1d46('0xb1')]({'model':db[_0x1d46('0xd6')],'as':_0x1d46('0xd7'),'attributes':['id',_0x1d46('0x2e')]});_0x5dc0ab[_0x1d46('0xb1')]({'model':db[_0x1d46('0x73')],'as':'Owner','attributes':['id',_0x1d46('0x32')]});return db['OpenchannelInteraction'][_0x1d46('0x63')]({'where':{'id':_0x74cad1['params']['id']},'include':_0x5dc0ab})[_0x1d46('0x2b')](handleEntityNotFound(_0x1ea8ce,null))[_0x1d46('0x2b')](function(_0x611ced){if(_0x611ced){var _0x2311c9=_0x611ced[_0x1d46('0xd8')]({'plain':!![]});fs['mkdirSync'](_0x1289c3);var _0x5021dc={'channel':'Openchannel','account':_0x2311c9[_0x1d46('0xd7')]['name'],'agent':_0x2311c9[_0x1d46('0xd9')]?_0x2311c9[_0x1d46('0xd9')]['fullname']:_0x1d46('0xda'),'createdAt':moment(_0x2311c9['createdAt'])[_0x1d46('0xc2')](_0x1d46('0xdb'))[_0x1d46('0x9b')](),'closedAt':_0x2311c9[_0x1d46('0x3c')]?moment(_0x2311c9[_0x1d46('0xdc')])['format'](_0x1d46('0xdb'))[_0x1d46('0x9b')]():'','disposition':_0x2311c9[_0x1d46('0xdd')],'visibility':_0x2311c9[_0x1d46('0xde')]?_0x1d46('0xdf'):_0x1d46('0xe0'),'messages':_(_0x2311c9[_0x1d46('0xd4')])[_0x1d46('0x84')]({'secret':![]})[_0x1d46('0x31')](function(_0x1b983e){if(_0x1b983e[_0x1d46('0xd3')]){var _0x3320ed=path[_0x1d46('0xca')](_0x4432d3,_0x1b983e['Attachment']['basename']);if(fs['existsSync'](_0x3320ed)){fs[_0x1d46('0xe1')](_0x3320ed)[_0x1d46('0xe2')](fs['createWriteStream'](path[_0x1d46('0xca')](_0x1289c3,_0x1b983e[_0x1d46('0xd3')]['basename'])));}}return{'date':moment(_0x1b983e[_0x1d46('0xd5')])[_0x1d46('0xc2')](_0x1d46('0xdb'))[_0x1d46('0x9b')](),'sender':_0x1b983e['direction']==='out'?_0x1b983e[_0x1d46('0x73')]?_0x1b983e[_0x1d46('0x73')][_0x1d46('0x32')]:_0x1d46('0xe3'):_0x1b983e[_0x1d46('0x68')][_0x1d46('0xd1')]+(_0x1b983e[_0x1d46('0x68')][_0x1d46('0xd2')]?'\x20'+_0x1b983e['Contact']['lastName']:''),'body':_0x1b983e[_0x1d46('0xd3')]?_0x1b983e['Attachment'][_0x1d46('0xe4')]:_0x1b983e[_0x1d46('0x76')],'direction':_0x1b983e[_0x1d46('0xe5')]===_0x1d46('0xe6')?'A':'C','secret':_0x1b983e[_0x1d46('0xe7')],'read':_0x1b983e[_0x1d46('0x80')],'attachment':_0x1b983e[_0x1d46('0xd3')]};})[_0x1d46('0x6c')]()};return ejs['renderFile'](path[_0x1d46('0xca')](config[_0x1d46('0xcb')],_0x1d46('0xcc'),_0x1d46('0xe8'),_0x1d46('0xe9')),{'interaction':_0x5021dc})['then'](function(_0x43dd2f){var _0x3e96aa=path[_0x1d46('0xca')](_0x1289c3,'transcript-'+_0x2311c9['id']+'-'+_0x59c543+'.pdf');var _0x467b81={'path':_0x3e96aa,'channel':_0x1d46('0xea'),'interactionId':_0x2311c9['id']};return pdf[_0x1d46('0xeb')](_0x43dd2f,_0x467b81);})['then'](function(){return new BPromise(function(_0x540276,_0x55faca){zipdir(_0x1289c3,{'saveTo':_0x49fd9f},function(_0x14cfe4,_0x4c6fb6){if(_0x14cfe4)return _0x55faca(_0x14cfe4);return _0x540276(_0x4c6fb6);});})[_0x1d46('0x2b')](function(){return new BPromise(function(_0x3f33aa,_0x391daa){rimraf(_0x1289c3,function(_0x4e9ddb){if(_0x4e9ddb)_0x391daa(_0x4e9ddb);return _0x3f33aa();});});})[_0x1d46('0x2b')](function(){return _0x1ea8ce['download'](_0x49fd9f,_0x104ab0,function(_0x27a7cb){if(_0x27a7cb){console[_0x1d46('0xec')]('err',_0x27a7cb);}else{fs['unlinkSync'](_0x49fd9f);}});});});}else{return _0x1ea8ce['sendStatus'](0xc8);}})[_0x1d46('0x37')](handleError(_0x1ea8ce,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index c0273c1..a58f2a2 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 _0x030c=['setMaxListeners','update','remove','getUsers','Users','map','findAll','then','setDataValue','unreadMessages','length','emit','catch','hook','events','../../mysqldb'];(function(_0x498fbc,_0x106519){var _0x10af45=function(_0x1932ea){while(--_0x1932ea){_0x498fbc['push'](_0x498fbc['shift']());}};_0x10af45(++_0x106519);}(_0x030c,0x10e));var _0xc030=function(_0x12738c,_0x55cdee){_0x12738c=_0x12738c-0x0;var _0x4d00e1=_0x030c[_0x12738c];return _0x4d00e1;};'use strict';var EventEmitter=require(_0xc030('0x0'));var OpenchannelInteraction=require(_0xc030('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xc030('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xc030('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc030('0x3'),'afterDestroy':_0xc030('0x4')};function emitEvent(_0x23a6bd){return function(_0x90066e,_0x510415,_0x15b9ca){_0x90066e[_0xc030('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x491afa){_0x90066e['setDataValue'](_0xc030('0x6'),_0x491afa[_0xc030('0x7')](function(_0x37cf5b){return{'id':_0x37cf5b['id']};}));return OpenchannelMessage[_0xc030('0x8')]({'where':{'OpenchannelInteractionId':_0x90066e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc030('0x9')](function(_0x153633){_0x90066e[_0xc030('0xa')](_0xc030('0xb'),_0x153633[_0xc030('0xc')]);OpenchannelInteractionEvents['emit'](_0x23a6bd+':'+_0x90066e['id'],_0x90066e);OpenchannelInteractionEvents[_0xc030('0xd')](_0x23a6bd,_0x90066e);_0x15b9ca(null);})[_0xc030('0xe')](_0x15b9ca(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xc030('0xf')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x84a5=['../../mysqldb','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x132631,_0x20e707){var _0x1d9d13=function(_0x3bd0c8){while(--_0x3bd0c8){_0x132631['push'](_0x132631['shift']());}};_0x1d9d13(++_0x20e707);}(_0x84a5,0x1db));var _0x584a=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x84a5[_0x5f0089];return _0x193892;};'use strict';var EventEmitter=require(_0x584a('0x0'));var OpenchannelInteraction=require(_0x584a('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x584a('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x584a('0x2')](0x0);var events={'afterCreate':_0x584a('0x3'),'afterUpdate':'update','afterDestroy':_0x584a('0x4')};function emitEvent(_0xbcdff0){return function(_0x5d342f,_0x520994,_0x10ae73){_0x5d342f[_0x584a('0x5')]({'attributes':['id'],'raw':!![]})[_0x584a('0x6')](function(_0x35fade){_0x5d342f[_0x584a('0x7')](_0x584a('0x8'),_0x35fade['map'](function(_0x337522){return{'id':_0x337522['id']};}));return OpenchannelMessage[_0x584a('0x9')]({'where':{'OpenchannelInteractionId':_0x5d342f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x584a('0x6')](function(_0x2e3061){_0x5d342f[_0x584a('0x7')](_0x584a('0xa'),_0x2e3061[_0x584a('0xb')]);OpenchannelInteractionEvents[_0x584a('0xc')](_0xbcdff0+':'+_0x5d342f['id'],_0x5d342f);OpenchannelInteractionEvents[_0x584a('0xc')](_0xbcdff0,_0x5d342f);_0x10ae73(null);})[_0x584a('0xd')](_0x10ae73(null));};}for(var e in events){if(events[_0x584a('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x584a('0xf')](e,emitEvent(event));}}module[_0x584a('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 f4095e0..4dda34a 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 _0xf820=['define','OpenchannelInteraction','utf8mb4_unicode_ci','closed','closedAt','format','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes'];(function(_0x318ff4,_0x5913d6){var _0x20f3b0=function(_0x32c5e4){while(--_0x32c5e4){_0x318ff4['push'](_0x318ff4['shift']());}};_0x20f3b0(++_0x5913d6);}(_0xf820,0x86));var _0x0f82=function(_0x5af6d9,_0x1a6463){_0x5af6d9=_0x5af6d9-0x0;var _0x1c7d7c=_0xf820[_0x5af6d9];return _0x1c7d7c;};'use strict';var _=require(_0x0f82('0x0'));var util=require(_0x0f82('0x1'));var logger=require(_0x0f82('0x2'))('api');var moment=require(_0x0f82('0x3'));var BPromise=require(_0x0f82('0x4'));var rp=require(_0x0f82('0x5'));var fs=require('fs');var path=require(_0x0f82('0x6'));var rimraf=require(_0x0f82('0x7'));var config=require(_0x0f82('0x8'));var attributes=require(_0x0f82('0x9'));module['exports']=function(_0x169e1c,_0x3c8dd5){return _0x169e1c[_0x0f82('0xa')](_0x0f82('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0f82('0xc'),'hooks':{'beforeUpdate':function(_0x4a186b,_0x4183b3,_0x22a121){if(_0x4a186b['changed'](_0x0f82('0xd'))){_0x4a186b[_0x0f82('0xe')]=moment()[_0x0f82('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x22a121(null,_0x4a186b);}}});}; \ No newline at end of file +var _0x38d5=['rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3a86b4,_0x8874ba){var _0x5ae7df=function(_0x10e3e5){while(--_0x10e3e5){_0x3a86b4['push'](_0x3a86b4['shift']());}};_0x5ae7df(++_0x8874ba);}(_0x38d5,0x66));var _0x538d=function(_0x533971,_0x3e91e6){_0x533971=_0x533971-0x0;var _0x184ae7=_0x38d5[_0x533971];return _0x184ae7;};'use strict';var _=require(_0x538d('0x0'));var util=require('util');var logger=require(_0x538d('0x1'))(_0x538d('0x2'));var moment=require(_0x538d('0x3'));var BPromise=require(_0x538d('0x4'));var rp=require(_0x538d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x538d('0x6'));var config=require(_0x538d('0x7'));var attributes=require(_0x538d('0x8'));module[_0x538d('0x9')]=function(_0x5bcdcf,_0x421271){return _0x5bcdcf[_0x538d('0xa')]('OpenchannelInteraction',attributes,{'tableName':_0x538d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x538d('0xc'),'collate':_0x538d('0xd'),'hooks':{'beforeUpdate':function(_0x3fcc04,_0x4ef308,_0x36ca23){if(_0x3fcc04[_0x538d('0xe')]('closed')){_0x3fcc04[_0x538d('0xf')]=moment()[_0x538d('0x10')](_0x538d('0x11'));}_0x36ca23(null,_0x3fcc04);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 5eefdef..f740349 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 _0xa4bb=['rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','attributes','limit','then','AddTagsToOpenchannelInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xa4bb,0x186));var _0xba4b=function(_0x2bc8c7,_0xa54f13){_0x2bc8c7=_0x2bc8c7-0x0;var _0x27a330=_0xa4bb[_0x2bc8c7];return _0x27a330;};'use strict';var _=require(_0xba4b('0x0'));var util=require(_0xba4b('0x1'));var moment=require(_0xba4b('0x2'));var BPromise=require(_0xba4b('0x3'));var rs=require(_0xba4b('0x4'));var fs=require('fs');var Redis=require(_0xba4b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xba4b('0x6'));var config=require(_0xba4b('0x7'));var jayson=require(_0xba4b('0x8'));var client=jayson[_0xba4b('0x9')][_0xba4b('0xa')]({'port':0x232a});config['redis']=_[_0xba4b('0xb')](config['redis'],{'host':_0xba4b('0xc'),'port':0x18eb});var socket=require(_0xba4b('0xd'))(new Redis(config[_0xba4b('0xe')]));require(_0xba4b('0xf'))[_0xba4b('0x10')](socket);function respondWithRpcPromise(_0x22fb29,_0x12ea62,_0x4e8e69){return new BPromise(function(_0x3e400b,_0x4dddfc){return client[_0xba4b('0x11')](_0x22fb29,_0x4e8e69)['then'](function(_0x43392b){logger[_0xba4b('0x12')](_0xba4b('0x13'),_0x12ea62,'request\x20sent');logger[_0xba4b('0x14')](_0xba4b('0x15'),_0x12ea62,'request\x20sent',JSON[_0xba4b('0x16')](_0x43392b));if(_0x43392b[_0xba4b('0x17')]){if(_0x43392b[_0xba4b('0x17')]['code']===0x1f4){logger[_0xba4b('0x17')](_0xba4b('0x13'),_0x12ea62,_0x43392b[_0xba4b('0x17')]['message']);return _0x4dddfc(_0x43392b[_0xba4b('0x17')]['message']);}logger[_0xba4b('0x17')](_0xba4b('0x13'),_0x12ea62,_0x43392b[_0xba4b('0x17')]['message']);return _0x3e400b(_0x43392b[_0xba4b('0x17')][_0xba4b('0x18')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x12ea62,_0xba4b('0x19'));_0x3e400b(_0x43392b[_0xba4b('0x1a')]['message']);}})[_0xba4b('0x1b')](function(_0xf27ccf){logger[_0xba4b('0x17')](_0xba4b('0x13'),_0x12ea62,_0xf27ccf);_0x4dddfc(_0xf27ccf);});});}exports[_0xba4b('0x1c')]=function(_0x17d9c2){var _0x5ab8f3=this;return new Promise(function(_0x370492,_0xc52b2d){return db[_0xba4b('0x1d')]['update'](_0x17d9c2[_0xba4b('0x1e')],{'raw':_0x17d9c2[_0xba4b('0x1f')]?_0x17d9c2[_0xba4b('0x1f')][_0xba4b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17d9c2[_0xba4b('0x1f')]?_0x17d9c2['options']['where']||null:null,'attributes':_0x17d9c2[_0xba4b('0x1f')]?_0x17d9c2[_0xba4b('0x1f')][_0xba4b('0x21')]||null:null,'limit':_0x17d9c2[_0xba4b('0x1f')]?_0x17d9c2[_0xba4b('0x1f')][_0xba4b('0x22')]||null:null})[_0xba4b('0x23')](function(_0x482523){logger[_0xba4b('0x12')](_0xba4b('0x1c'),_0x17d9c2);logger[_0xba4b('0x14')](_0xba4b('0x1c'),_0x17d9c2,JSON[_0xba4b('0x16')](_0x482523));_0x370492(_0x482523);})[_0xba4b('0x1b')](function(_0x5823c3){logger[_0xba4b('0x17')](_0xba4b('0x1c'),_0x5823c3['message'],_0x17d9c2);_0xc52b2d(_0x5ab8f3[_0xba4b('0x17')](0x1f4,_0x5823c3[_0xba4b('0x18')]));});});};exports[_0xba4b('0x24')]=function(_0x7f6877){return new Promise(function(_0x1d66d2,_0x1c58d7){return db['OpenchannelInteraction'][_0xba4b('0x25')]({'where':_0x7f6877[_0xba4b('0x1f')]?_0x7f6877[_0xba4b('0x1f')][_0xba4b('0x26')]||null:null})[_0xba4b('0x23')](function(_0x39cd6b){if(_0x39cd6b){return _0x39cd6b[_0xba4b('0x27')](_0x7f6877[_0xba4b('0x1e')][_0xba4b('0x28')],_[_0xba4b('0x29')](_0x7f6877[_0xba4b('0x1e')],[_0xba4b('0x28'),'id'])||{});}})[_0xba4b('0x2a')](function(_0x4e4cd4){logger['info']('AddTags',_0x7f6877);logger[_0xba4b('0x14')](_0xba4b('0x2b'),_0x7f6877,JSON['stringify'](_0x4e4cd4));_0x1d66d2(_0x4e4cd4);})['catch'](function(_0x2eeb01){logger[_0xba4b('0x17')](_0xba4b('0x2b'),_0x2eeb01[_0xba4b('0x18')],_0x7f6877);_0x1c58d7(_this[_0xba4b('0x17')](0x1f4,_0x2eeb01[_0xba4b('0x18')]));});});}; \ No newline at end of file +var _0x424f=['stringify','error','code','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x424f,0x92));var _0xf424=function(_0x51eae3,_0xbf7aa2){_0x51eae3=_0x51eae3-0x0;var _0xe9d627=_0x424f[_0x51eae3];return _0xe9d627;};'use strict';var _=require(_0xf424('0x0'));var util=require('util');var moment=require(_0xf424('0x1'));var BPromise=require(_0xf424('0x2'));var rs=require(_0xf424('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf424('0x4'))(_0xf424('0x5'));var config=require(_0xf424('0x6'));var jayson=require(_0xf424('0x7'));var client=jayson['client'][_0xf424('0x8')]({'port':0x232a});config[_0xf424('0x9')]=_['defaults'](config[_0xf424('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf424('0xa'))(new Redis(config[_0xf424('0x9')]));require(_0xf424('0xb'))[_0xf424('0xc')](socket);function respondWithRpcPromise(_0x3cb7b6,_0x369b78,_0x5248a7){return new BPromise(function(_0x4f3735,_0x4ced1f){return client[_0xf424('0xd')](_0x3cb7b6,_0x5248a7)[_0xf424('0xe')](function(_0x1accd6){logger['info'](_0xf424('0xf'),_0x369b78,_0xf424('0x10'));logger[_0xf424('0x11')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x369b78,_0xf424('0x10'),JSON[_0xf424('0x12')](_0x1accd6));if(_0x1accd6[_0xf424('0x13')]){if(_0x1accd6[_0xf424('0x13')][_0xf424('0x14')]===0x1f4){logger[_0xf424('0x13')](_0xf424('0xf'),_0x369b78,_0x1accd6[_0xf424('0x13')][_0xf424('0x15')]);return _0x4ced1f(_0x1accd6[_0xf424('0x13')][_0xf424('0x15')]);}logger[_0xf424('0x13')](_0xf424('0xf'),_0x369b78,_0x1accd6['error'][_0xf424('0x15')]);return _0x4f3735(_0x1accd6[_0xf424('0x13')][_0xf424('0x15')]);}else{logger[_0xf424('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x369b78,_0xf424('0x10'));_0x4f3735(_0x1accd6[_0xf424('0x17')]['message']);}})[_0xf424('0x18')](function(_0xb9855b){logger[_0xf424('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x369b78,_0xb9855b);_0x4ced1f(_0xb9855b);});});}exports[_0xf424('0x19')]=function(_0x3ef983){var _0x3f6c35=this;return new Promise(function(_0x4063c4,_0x48915a){return db[_0xf424('0x1a')][_0xf424('0x1b')](_0x3ef983['body'],{'raw':_0x3ef983['options']?_0x3ef983[_0xf424('0x1c')][_0xf424('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ef983['options']?_0x3ef983[_0xf424('0x1c')][_0xf424('0x1e')]||null:null,'attributes':_0x3ef983[_0xf424('0x1c')]?_0x3ef983[_0xf424('0x1c')][_0xf424('0x1f')]||null:null,'limit':_0x3ef983[_0xf424('0x1c')]?_0x3ef983['options'][_0xf424('0x20')]||null:null})[_0xf424('0xe')](function(_0x4a685b){logger[_0xf424('0x16')](_0xf424('0x19'),_0x3ef983);logger[_0xf424('0x11')](_0xf424('0x19'),_0x3ef983,JSON['stringify'](_0x4a685b));_0x4063c4(_0x4a685b);})[_0xf424('0x18')](function(_0x4d9bb3){logger[_0xf424('0x13')](_0xf424('0x19'),_0x4d9bb3[_0xf424('0x15')],_0x3ef983);_0x48915a(_0x3f6c35[_0xf424('0x13')](0x1f4,_0x4d9bb3[_0xf424('0x15')]));});});};exports[_0xf424('0x21')]=function(_0x31e2a6){return new Promise(function(_0x1610b5,_0x3cea7a){return db['OpenchannelInteraction'][_0xf424('0x22')]({'where':_0x31e2a6['options']?_0x31e2a6[_0xf424('0x1c')][_0xf424('0x1e')]||null:null})[_0xf424('0xe')](function(_0x49dc2a){if(_0x49dc2a){return _0x49dc2a[_0xf424('0x23')](_0x31e2a6[_0xf424('0x24')][_0xf424('0x25')],_[_0xf424('0x26')](_0x31e2a6['body'],['ids','id'])||{});}})[_0xf424('0x27')](function(_0x3a426e){logger[_0xf424('0x16')](_0xf424('0x28'),_0x31e2a6);logger[_0xf424('0x11')](_0xf424('0x28'),_0x31e2a6,JSON[_0xf424('0x12')](_0x3a426e));_0x1610b5(_0x3a426e);})[_0xf424('0x18')](function(_0xcdf117){logger[_0xf424('0x13')](_0xf424('0x28'),_0xcdf117[_0xf424('0x15')],_0x31e2a6);_0x3cea7a(_this['error'](0x1f4,_0xcdf117[_0xf424('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index ac5f4ed..ae4e7b5 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 _0xc4f5=['emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update'];(function(_0x46cf69,_0x4111c4){var _0x560f9a=function(_0x12f994){while(--_0x12f994){_0x46cf69['push'](_0x46cf69['shift']());}};_0x560f9a(++_0x4111c4);}(_0xc4f5,0xb9));var _0x5c4f=function(_0x3ee99e,_0x4affec){_0x3ee99e=_0x3ee99e-0x0;var _0x1b56e1=_0xc4f5[_0x3ee99e];return _0x1b56e1;};'use strict';var OpenchannelInteractionEvents=require(_0x5c4f('0x0'));var events=[_0x5c4f('0x1'),_0x5c4f('0x2'),_0x5c4f('0x3')];function createListener(_0x1407a1,_0x29644c){return function(_0xc9045e){_0x29644c[_0x5c4f('0x4')](_0x1407a1,_0xc9045e);};}function removeListener(_0x57e5a9,_0x4a9da7){return function(){OpenchannelInteractionEvents[_0x5c4f('0x5')](_0x57e5a9,_0x4a9da7);};}exports[_0x5c4f('0x6')]=function(_0x1974c8){for(var _0x2aec92=0x0,_0x669baf=events[_0x5c4f('0x7')];_0x2aec92<_0x669baf;_0x2aec92++){var _0x4f1c32=events[_0x2aec92];var _0x441f67=createListener(_0x5c4f('0x8')+_0x4f1c32,_0x1974c8);OpenchannelInteractionEvents['on'](_0x4f1c32,_0x441f67);}}; \ No newline at end of file +var _0xeefd=['openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit','removeListener','length'];(function(_0x5dc13f,_0x8f445f){var _0x387bdd=function(_0x56dee9){while(--_0x56dee9){_0x5dc13f['push'](_0x5dc13f['shift']());}};_0x387bdd(++_0x8f445f);}(_0xeefd,0x131));var _0xdeef=function(_0x1bd05e,_0x1b789e){_0x1bd05e=_0x1bd05e-0x0;var _0x18b092=_0xeefd[_0x1bd05e];return _0x18b092;};'use strict';var OpenchannelInteractionEvents=require(_0xdeef('0x0'));var events=[_0xdeef('0x1'),_0xdeef('0x2'),_0xdeef('0x3')];function createListener(_0x403467,_0x26d2c5){return function(_0x416f47){_0x26d2c5[_0xdeef('0x4')](_0x403467,_0x416f47);};}function removeListener(_0x80faf6,_0x3ec5d5){return function(){OpenchannelInteractionEvents[_0xdeef('0x5')](_0x80faf6,_0x3ec5d5);};}exports['register']=function(_0x80f627){for(var _0x2d2adf=0x0,_0x17e751=events[_0xdeef('0x6')];_0x2d2adf<_0x17e751;_0x2d2adf++){var _0x13c40c=events[_0x2d2adf];var _0x2a2dbe=createListener(_0xdeef('0x7')+_0x13c40c,_0x80f627);OpenchannelInteractionEvents['on'](_0x13c40c,_0x2a2dbe);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 57eb355..d41745b 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x569294,_0x196aad){var _0x3daeaf=function(_0x561c43){while(--_0x561c43){_0x569294['push'](_0x569294['shift']());}};_0x3daeaf(++_0x196aad);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file +var _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(_0x4648e0,_0xc38a18){var _0x42c4b7=function(_0x2fa56a){while(--_0x2fa56a){_0x4648e0['push'](_0x4648e0['shift']());}};_0x42c4b7(++_0xc38a18);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 6cbcf1e..ce3e3c6 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 _0x1c52=['TEXT','medium','out','STRING','sequelize','exports'];(function(_0x379c3e,_0x5c9d34){var _0x20fa30=function(_0x5cd11f){while(--_0x5cd11f){_0x379c3e['push'](_0x379c3e['shift']());}};_0x20fa30(++_0x5c9d34);}(_0x1c52,0x7c));var _0x21c5=function(_0x1ddcfc,_0x25839b){_0x1ddcfc=_0x1ddcfc-0x0;var _0x18cb95=_0x1c52[_0x1ddcfc];return _0x18cb95;};'use strict';var Sequelize=require(_0x21c5('0x0'));module[_0x21c5('0x1')]={'body':{'type':Sequelize[_0x21c5('0x2')](_0x21c5('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x21c5('0x4')),'defaultValue':_0x21c5('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x21c5('0x5')]},'providerResponse':{'type':Sequelize[_0x21c5('0x2')]}}; \ No newline at end of file +var _0x28f2=['TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x373ce6,_0xe38d2){var _0x1497ea=function(_0x5360df){while(--_0x5360df){_0x373ce6['push'](_0x373ce6['shift']());}};_0x1497ea(++_0xe38d2);}(_0x28f2,0x193));var _0x228f=function(_0x397168,_0x1cb305){_0x397168=_0x397168-0x0;var _0x18d521=_0x28f2[_0x397168];return _0x18d521;};'use strict';var Sequelize=require(_0x228f('0x0'));module[_0x228f('0x1')]={'body':{'type':Sequelize[_0x228f('0x2')](_0x228f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x228f('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x228f('0x5')]('in',_0x228f('0x6')),'defaultValue':_0x228f('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x228f('0x7')]},'providerName':{'type':Sequelize[_0x228f('0x8')]},'providerResponse':{'type':Sequelize[_0x228f('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 03251d0..f393680 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 _0xff00=['include','findAll','rows','catch','params','create','body','find','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','Sequelize','SELECT','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','internal','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','register','jayson/promise','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','destroy','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','count','includeAll'];(function(_0xd3243c,_0x19721e){var _0x1991fa=function(_0x33178b){while(--_0x33178b){_0xd3243c['push'](_0xd3243c['shift']());}};_0x1991fa(++_0x19721e);}(_0xff00,0x1a6));var _0x0ff0=function(_0x34a9e3,_0x383032){_0x34a9e3=_0x34a9e3-0x0;var _0x332fa3=_0xff00[_0x34a9e3];return _0x332fa3;};'use strict';var emlformat=require(_0x0ff0('0x0'));var rimraf=require(_0x0ff0('0x1'));var zipdir=require(_0x0ff0('0x2'));var jsonpatch=require(_0x0ff0('0x3'));var rp=require('request-promise');var moment=require(_0x0ff0('0x4'));var BPromise=require(_0x0ff0('0x5'));var Mustache=require('mustache');var util=require(_0x0ff0('0x6'));var path=require(_0x0ff0('0x7'));var sox=require(_0x0ff0('0x8'));var csv=require(_0x0ff0('0x9'));var ejs=require(_0x0ff0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ff0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0ff0('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ff0('0xd'));var Redis=require('ioredis');var authService=require(_0x0ff0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0ff0('0xf'));var hardwareService=require(_0x0ff0('0x10'));var logger=require(_0x0ff0('0x11'))(_0x0ff0('0x12'));var utils=require('../../config/utils');var config=require(_0x0ff0('0x13'));var licenseUtil=require(_0x0ff0('0x14'));var db=require('../../mysqldb')['db'];config[_0x0ff0('0x15')]=_[_0x0ff0('0x16')](config[_0x0ff0('0x15')],{'host':_0x0ff0('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelMessage.socket')[_0x0ff0('0x18')](socket);var jayson=require(_0x0ff0('0x19'));var client=jayson['client'][_0x0ff0('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0x0ff0('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x10d422,_0x43bd62,_0x5eef2f,_0xc15830){return new BPromise(function(_0x307127,_0xba175d){var _0x55ad62=_0xc15830||client;return _0x55ad62[_0x0ff0('0x1b')](_0x10d422,_0x5eef2f)[_0x0ff0('0x1c')](function(_0x1cdb63){logger[_0x0ff0('0x1d')](_0x0ff0('0x1e'),_0x43bd62,_0x0ff0('0x1f'));logger['debug'](_0x0ff0('0x20'),_0x43bd62,_0x0ff0('0x1f'),JSON[_0x0ff0('0x21')](_0x1cdb63));if(_0x1cdb63['error']){if(_0x1cdb63[_0x0ff0('0x22')][_0x0ff0('0x23')]===0x1f4){logger[_0x0ff0('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x43bd62,_0x1cdb63[_0x0ff0('0x22')][_0x0ff0('0x24')]);return _0xba175d(_0x1cdb63[_0x0ff0('0x22')][_0x0ff0('0x24')]);}logger[_0x0ff0('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x43bd62,_0x1cdb63[_0x0ff0('0x22')][_0x0ff0('0x24')]);return _0x307127(_0x1cdb63[_0x0ff0('0x22')][_0x0ff0('0x24')]);}else{logger[_0x0ff0('0x1d')](_0x0ff0('0x1e'),_0x43bd62,_0x0ff0('0x1f'));_0x307127(_0x1cdb63[_0x0ff0('0x25')][_0x0ff0('0x24')]);}})['catch'](function(_0x1a9d06){logger[_0x0ff0('0x22')](_0x0ff0('0x1e'),_0x43bd62,_0x1a9d06);_0xba175d(_0x1a9d06);});});}function respondWithStatusCode(_0x5479f7,_0x1b43ec){_0x1b43ec=_0x1b43ec||0xcc;return function(_0x56666d){if(_0x56666d){return _0x5479f7[_0x0ff0('0x26')](_0x1b43ec);}return _0x5479f7[_0x0ff0('0x27')](_0x1b43ec)[_0x0ff0('0x28')]();};}function respondWithResult(_0x514655,_0x104977){_0x104977=_0x104977||0xc8;return function(_0x4c1915){if(_0x4c1915){return _0x514655['status'](_0x104977)[_0x0ff0('0x29')](_0x4c1915);}};}function respondWithFilteredResult(_0x28c66b,_0x22e92b){return function(_0x4acec8){if(_0x4acec8){var _0x56abec=typeof _0x22e92b[_0x0ff0('0x2a')]==='undefined'&&typeof _0x22e92b[_0x0ff0('0x2b')]===_0x0ff0('0x2c');var _0x5736a4=_0x4acec8['count'];var _0x5116ba=_0x56abec?0x0:_0x22e92b[_0x0ff0('0x2a')];var _0xec1ce2=_0x56abec?_0x4acec8['count']:_0x22e92b[_0x0ff0('0x2a')]+_0x22e92b[_0x0ff0('0x2b')];var _0x484b5d;if(_0xec1ce2>=_0x5736a4){_0xec1ce2=_0x5736a4;_0x484b5d=0xc8;}else{_0x484b5d=0xce;}_0x28c66b[_0x0ff0('0x27')](_0x484b5d);return _0x28c66b['set'](_0x0ff0('0x2d'),_0x5116ba+'-'+_0xec1ce2+'/'+_0x5736a4)[_0x0ff0('0x29')](_0x4acec8);}return null;};}function patchUpdates(_0x47cc4e){return function(_0x2556f9){try{jsonpatch[_0x0ff0('0x2e')](_0x2556f9,_0x47cc4e,!![]);}catch(_0xaaf14){return BPromise[_0x0ff0('0x2f')](_0xaaf14);}return _0x2556f9['save']();};}function saveUpdates(_0x44ef9e,_0x3d7271){return function(_0x20b6ca){if(_0x20b6ca){return _0x20b6ca['update'](_0x44ef9e)['then'](function(_0x5e54d9){return _0x5e54d9;});}return null;};}function removeEntity(_0xce3cbb,_0x4de7d2){return function(_0x3c5fe7){if(_0x3c5fe7){return _0x3c5fe7[_0x0ff0('0x30')]()[_0x0ff0('0x1c')](function(){_0xce3cbb[_0x0ff0('0x27')](0xcc)[_0x0ff0('0x28')]();});}};}function handleEntityNotFound(_0x58503b,_0x2c74c8){return function(_0x15a499){if(!_0x15a499){_0x58503b['sendStatus'](0x194);}return _0x15a499;};}function handleError(_0x2bf6bc,_0x59c799){_0x59c799=_0x59c799||0x1f4;return function(_0x1638ad){logger[_0x0ff0('0x22')](_0x1638ad['stack']);if(_0x1638ad[_0x0ff0('0x31')]){delete _0x1638ad[_0x0ff0('0x31')];}_0x2bf6bc['status'](_0x59c799)[_0x0ff0('0x32')](_0x1638ad);};}exports[_0x0ff0('0x33')]=function(_0x409a35,_0x59d1f8){var _0x47255e={},_0x2f4b93={},_0x38b12a={'count':0x0,'rows':[]};var _0x4433ed=_['map'](db[_0x0ff0('0x34')][_0x0ff0('0x35')],function(_0x16a53d){return{'name':_0x16a53d[_0x0ff0('0x36')],'type':_0x16a53d[_0x0ff0('0x37')]['key']};});_0x2f4b93[_0x0ff0('0x38')]=_[_0x0ff0('0x39')](_0x4433ed,_0x0ff0('0x31'));_0x2f4b93[_0x0ff0('0x3a')]=_[_0x0ff0('0x3b')](_0x409a35[_0x0ff0('0x3a')]);_0x2f4b93[_0x0ff0('0x3c')]=_[_0x0ff0('0x3d')](_0x2f4b93['model'],_0x2f4b93[_0x0ff0('0x3a')]);_0x47255e[_0x0ff0('0x3e')]=_['intersection'](_0x2f4b93['model'],qs[_0x0ff0('0x3f')](_0x409a35[_0x0ff0('0x3a')][_0x0ff0('0x3f')]));_0x47255e['attributes']=_0x47255e[_0x0ff0('0x3e')][_0x0ff0('0x40')]?_0x47255e['attributes']:_0x2f4b93[_0x0ff0('0x38')];if(!_0x409a35[_0x0ff0('0x3a')][_0x0ff0('0x41')](_0x0ff0('0x42'))){_0x47255e[_0x0ff0('0x2b')]=qs[_0x0ff0('0x2b')](_0x409a35['query'][_0x0ff0('0x2b')]);_0x47255e['offset']=qs[_0x0ff0('0x2a')](_0x409a35[_0x0ff0('0x3a')][_0x0ff0('0x2a')]);}_0x47255e['order']=qs[_0x0ff0('0x43')](_0x409a35[_0x0ff0('0x3a')][_0x0ff0('0x43')]);_0x47255e[_0x0ff0('0x44')]=qs['filters'](_['pick'](_0x409a35[_0x0ff0('0x3a')],_0x2f4b93[_0x0ff0('0x3c')]),_0x4433ed);if(_0x409a35[_0x0ff0('0x3a')][_0x0ff0('0x45')]){_0x47255e[_0x0ff0('0x44')]=_['merge'](_0x47255e[_0x0ff0('0x44')],{'$or':_['map'](_0x4433ed,function(_0x208645){if(_0x208645[_0x0ff0('0x37')]!=='VIRTUAL'){var _0x8b14b1={};_0x8b14b1[_0x208645['name']]={'$like':'%'+_0x409a35[_0x0ff0('0x3a')][_0x0ff0('0x45')]+'%'};return _0x8b14b1;}})});}_0x47255e=_[_0x0ff0('0x46')]({},_0x47255e,_0x409a35[_0x0ff0('0x47')]);var _0x3982a3={'where':_0x47255e['where']};return db[_0x0ff0('0x34')][_0x0ff0('0x48')](_0x3982a3)['then'](function(_0x178848){_0x38b12a[_0x0ff0('0x48')]=_0x178848;if(_0x409a35[_0x0ff0('0x3a')][_0x0ff0('0x49')]){_0x47255e[_0x0ff0('0x4a')]=[{'all':!![]}];}return db[_0x0ff0('0x34')][_0x0ff0('0x4b')](_0x47255e);})[_0x0ff0('0x1c')](function(_0x44629a){_0x38b12a[_0x0ff0('0x4c')]=_0x44629a;return _0x38b12a;})[_0x0ff0('0x1c')](respondWithFilteredResult(_0x59d1f8,_0x47255e))[_0x0ff0('0x4d')](handleError(_0x59d1f8,null));};exports['show']=function(_0x98bc45,_0x5812da){var _0x55ebde={'raw':!![],'where':{'id':_0x98bc45[_0x0ff0('0x4e')]['id']}},_0x431073={};_0x431073[_0x0ff0('0x38')]=_[_0x0ff0('0x3b')](db[_0x0ff0('0x34')]['rawAttributes']);_0x431073[_0x0ff0('0x3a')]=_[_0x0ff0('0x3b')](_0x98bc45[_0x0ff0('0x3a')]);_0x431073[_0x0ff0('0x3c')]=_[_0x0ff0('0x3d')](_0x431073[_0x0ff0('0x38')],_0x431073['query']);_0x55ebde['attributes']=_[_0x0ff0('0x3d')](_0x431073[_0x0ff0('0x38')],qs['fields'](_0x98bc45[_0x0ff0('0x3a')][_0x0ff0('0x3f')]));_0x55ebde[_0x0ff0('0x3e')]=_0x55ebde['attributes']['length']?_0x55ebde[_0x0ff0('0x3e')]:_0x431073['model'];if(_0x98bc45[_0x0ff0('0x3a')][_0x0ff0('0x49')]){_0x55ebde[_0x0ff0('0x4a')]=[{'all':!![]}];}_0x55ebde=_[_0x0ff0('0x46')]({},_0x55ebde,_0x98bc45[_0x0ff0('0x47')]);return db[_0x0ff0('0x34')]['find'](_0x55ebde)['then'](handleEntityNotFound(_0x5812da,null))[_0x0ff0('0x1c')](respondWithResult(_0x5812da,null))[_0x0ff0('0x4d')](handleError(_0x5812da,null));};exports[_0x0ff0('0x4f')]=function(_0x2f4870,_0x363eb7){return db[_0x0ff0('0x34')][_0x0ff0('0x4f')](_0x2f4870[_0x0ff0('0x50')],{})['then'](respondWithResult(_0x363eb7,0xc9))[_0x0ff0('0x4d')](handleError(_0x363eb7,null));};exports['update']=function(_0x148963,_0x28e294){if(_0x148963[_0x0ff0('0x50')]['id']){delete _0x148963[_0x0ff0('0x50')]['id'];}return db[_0x0ff0('0x34')]['find']({'where':{'id':_0x148963[_0x0ff0('0x4e')]['id']}})[_0x0ff0('0x1c')](handleEntityNotFound(_0x28e294,null))[_0x0ff0('0x1c')](saveUpdates(_0x148963[_0x0ff0('0x50')],null))['then'](respondWithResult(_0x28e294,null))[_0x0ff0('0x4d')](handleError(_0x28e294,null));};exports[_0x0ff0('0x30')]=function(_0xcce81f,_0x4c87e6){return db['OpenchannelMessage'][_0x0ff0('0x51')]({'where':{'id':_0xcce81f[_0x0ff0('0x4e')]['id']}})[_0x0ff0('0x1c')](handleEntityNotFound(_0x4c87e6,null))[_0x0ff0('0x1c')](removeEntity(_0x4c87e6,null))[_0x0ff0('0x4d')](handleError(_0x4c87e6,null));};exports[_0x0ff0('0x52')]=function(_0x5dc5fa,_0x4ffc49){return db['OpenchannelMessage']['describe']()[_0x0ff0('0x1c')](respondWithResult(_0x4ffc49,null))[_0x0ff0('0x4d')](handleError(_0x4ffc49,null));};var interaction_log=require(_0x0ff0('0x11'))(_0x0ff0('0x53'));exports['accept']=function(_0x257111,_0x55352a,_0x23459e){var _0x5dd2f5={'agent':{},'channel':_0x0ff0('0x54')};if(_0x257111[_0x0ff0('0x50')]['id']){delete _0x257111['body']['id'];}_0x257111[_0x0ff0('0x50')][_0x0ff0('0x55')]=!![];_0x257111['body'][_0x0ff0('0x56')]=moment()[_0x0ff0('0x57')](_0x0ff0('0x58'));_0x257111['body'][_0x0ff0('0x59')]=_0x257111[_0x0ff0('0x50')]['UserId']||_0x257111[_0x0ff0('0x5a')]['id'];_0x5dd2f5[_0x0ff0('0x5b')]['id']=_0x257111['body'][_0x0ff0('0x59')];return db['OpenchannelMessage']['find']({'where':{'id':_0x257111[_0x0ff0('0x4e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x55352a,null))[_0x0ff0('0x1c')](saveUpdates(_0x257111[_0x0ff0('0x50')],null))['then'](function(_0x4274ba){if(_0x4274ba){_0x5dd2f5[_0x0ff0('0x24')]=_0x4274ba[_0x0ff0('0x5c')]({'plain':!![]});return db[_0x0ff0('0x5d')][_0x0ff0('0x51')]({'where':{'id':_0x4274ba['OpenchannelInteractionId']}});}return null;})[_0x0ff0('0x1c')](handleEntityNotFound(_0x55352a,null))[_0x0ff0('0x1c')](function(_0x19ce49){if(_0x19ce49){return _0x19ce49['update']({'UserId':_0x257111['body']['UserId'],'read1stAt':_[_0x0ff0('0x5e')](_0x19ce49[_0x0ff0('0x5f')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0ff0('0x1c')](function(_0x3c3f37){if(_0x3c3f37){_0x5dd2f5[_0x0ff0('0x60')]=_0x3c3f37[_0x0ff0('0x5c')]({'plain':!![]});interaction_log[_0x0ff0('0x1d')](_0x0ff0('0x61'),_0x257111[_0x0ff0('0x5a')]['id'],_0x257111['user'][_0x0ff0('0x31')],_0x257111['user'][_0x0ff0('0x62')],_0x5dd2f5[_0x0ff0('0x60')]['id'],_0x257111['body']?JSON[_0x0ff0('0x21')](_0x257111['body']):_0x0ff0('0x63'));return respondWithRpcPromise(_0x0ff0('0x64'),_0x0ff0('0x65'),_0x5dd2f5);}return null;})['then'](function(_0x16ba12){var _0x2bbb19='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x16ba12[_0x0ff0('0x24')]['ContactId'];return db['sequelize'][_0x0ff0('0x3a')](_0x2bbb19,{'type':db[_0x0ff0('0x66')]['QueryTypes'][_0x0ff0('0x67')],'raw':!![]})[_0x0ff0('0x1c')](function(_0x5638e4){return _0x5638e4;});})['then'](function(_0x4b8420){if(_0x4b8420){_0x5dd2f5[_0x0ff0('0x24')]['contact']=_0x4b8420[0x0];if(!_0x257111[_0x0ff0('0x50')]['UserId'])return;return db[_0x0ff0('0x68')][_0x0ff0('0x51')]({'where':{'id':_0x257111[_0x0ff0('0x50')]['UserId'],'role':_0x0ff0('0x5b')},'attributes':['id',_0x0ff0('0x31'),_0x0ff0('0x69'),_0x0ff0('0x6a'),'internal'],'raw':!![]});}return null;})[_0x0ff0('0x1c')](function(_0x2cb439){if(!_0x2cb439)return null;_0x5dd2f5[_0x0ff0('0x24')][_0x0ff0('0x5b')]=_0x2cb439;return _0x5dd2f5;})['then'](function(_0x2c7e24){if(_0x2c7e24){if(_0x257111['body'][_0x0ff0('0x6b')]){_0x5dd2f5['message'][_0x0ff0('0x6c')]=util[_0x0ff0('0x57')](_0x0ff0('0x6d'),_0x257111[_0x0ff0('0x5a')][_0x0ff0('0x31')]);_0x5dd2f5['message']['channel']=_0x5dd2f5[_0x0ff0('0x6e')];_0x5dd2f5['message'][_0x0ff0('0x6f')]=_0x5dd2f5[_0x0ff0('0x6e')];_0x5dd2f5['message'][_0x0ff0('0x70')]='accept';return respondWithRpcPromise(_0x0ff0('0x71'),'EventManager',{'event':'acceptmessage','message':_0x5dd2f5['message']},client9002)[_0x0ff0('0x1c')](function(){return _0x5dd2f5;});}return _0x5dd2f5;}return null;})['then'](respondWithResult(_0x55352a,null))['catch'](handleError(_0x55352a,null));};var interaction_log=require(_0x0ff0('0x11'))(_0x0ff0('0x53'));exports[_0x0ff0('0x2f')]=function(_0x246749,_0xfabe4d,_0x332b14){var _0x163d32={'agent':{},'channel':'openchannel'};if(_0x246749[_0x0ff0('0x50')]['id']){delete _0x246749[_0x0ff0('0x50')]['id'];}_0x246749[_0x0ff0('0x50')][_0x0ff0('0x59')]=_0x246749[_0x0ff0('0x50')][_0x0ff0('0x59')]||_0x246749[_0x0ff0('0x5a')]['id'];_0x163d32[_0x0ff0('0x5b')]['id']=_0x246749['body']['UserId'];return db[_0x0ff0('0x34')][_0x0ff0('0x51')]({'where':{'id':_0x246749[_0x0ff0('0x4e')]['id'],'UserId':null}})[_0x0ff0('0x1c')](handleEntityNotFound(_0xfabe4d,null))[_0x0ff0('0x1c')](function(_0x1df378){if(_0x1df378){_0x163d32[_0x0ff0('0x24')]=_0x1df378['get']({'plain':!![]});return db[_0x0ff0('0x5d')][_0x0ff0('0x51')]({'where':{'id':_0x1df378[_0x0ff0('0x72')]}});}return null;})[_0x0ff0('0x1c')](handleEntityNotFound(_0xfabe4d,null))[_0x0ff0('0x1c')](function(_0x1f5e8c){if(_0x1f5e8c){_0x163d32[_0x0ff0('0x60')]=_0x1f5e8c[_0x0ff0('0x5c')]({'plain':!![]});interaction_log[_0x0ff0('0x1d')](_0x0ff0('0x73'),_0x246749['user']['id'],_0x246749[_0x0ff0('0x5a')][_0x0ff0('0x31')],_0x246749['user'][_0x0ff0('0x62')],_0x163d32[_0x0ff0('0x60')]['id'],_0x246749['body']?JSON[_0x0ff0('0x21')](_0x246749['body']):_0x0ff0('0x63'));return respondWithRpcPromise(_0x0ff0('0x74'),_0x0ff0('0x75'),_0x163d32);}return null;})[_0x0ff0('0x1c')](function(_0x4e508a){var _0x1db09a=_0x0ff0('0x76')+_0x4e508a[_0x0ff0('0x24')][_0x0ff0('0x77')];return db[_0x0ff0('0x78')][_0x0ff0('0x3a')](_0x1db09a,{'type':db[_0x0ff0('0x66')]['QueryTypes'][_0x0ff0('0x67')],'raw':!![]})[_0x0ff0('0x1c')](function(_0x5ad347){return _0x5ad347;});})[_0x0ff0('0x1c')](function(_0x3d8740){if(_0x3d8740){_0x163d32[_0x0ff0('0x24')][_0x0ff0('0x79')]=_0x3d8740[0x0];if(!_0x246749[_0x0ff0('0x50')][_0x0ff0('0x59')])return;return db[_0x0ff0('0x68')][_0x0ff0('0x51')]({'where':{'id':_0x246749[_0x0ff0('0x50')][_0x0ff0('0x59')],'role':'agent'},'attributes':['id',_0x0ff0('0x31'),_0x0ff0('0x69'),_0x0ff0('0x6a'),_0x0ff0('0x7a')],'raw':!![]});}return null;})[_0x0ff0('0x1c')](function(_0x52e34f){if(!_0x52e34f)return null;_0x163d32[_0x0ff0('0x24')][_0x0ff0('0x5b')]=_0x52e34f;return _0x163d32;})[_0x0ff0('0x1c')](function(_0x3a09c3){if(_0x3a09c3){_0x3a09c3['message']['interface']=util[_0x0ff0('0x57')](_0x0ff0('0x6d'),_0x246749[_0x0ff0('0x5a')][_0x0ff0('0x31')]);_0x3a09c3[_0x0ff0('0x24')]['channel']=_0x163d32[_0x0ff0('0x6e')];_0x3a09c3[_0x0ff0('0x24')][_0x0ff0('0x6f')]=_0x163d32[_0x0ff0('0x6e')];_0x3a09c3[_0x0ff0('0x24')][_0x0ff0('0x70')]=_0x0ff0('0x2f');respondWithRpcPromise(_0x0ff0('0x71'),_0x0ff0('0x71'),{'event':_0x0ff0('0x7b'),'message':_0x3a09c3['message']},client9002);return _0x163d32;}return null;})['then'](respondWithResult(_0xfabe4d,null))['catch'](handleError(_0xfabe4d,null));}; \ No newline at end of file +var _0xee87=['internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','OpenchannelInteractionId','null','RejectMessage','rejectMessage','QueryTypes','rejectmessage','rimraf','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','limit','count','Content-Range','reject','update','destroy','sendStatus','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','find','create','body','describe','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','read1stAt','interaction','get','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname'];(function(_0x3ad711,_0x2497f2){var _0x77625e=function(_0x41eca6){while(--_0x41eca6){_0x3ad711['push'](_0x3ad711['shift']());}};_0x77625e(++_0x2497f2);}(_0xee87,0x193));var _0x7ee8=function(_0x2f39d6,_0x12509f){_0x2f39d6=_0x2f39d6-0x0;var _0x4b93bc=_0xee87[_0x2f39d6];return _0x4b93bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ee8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7ee8('0x1'));var BPromise=require(_0x7ee8('0x2'));var Mustache=require(_0x7ee8('0x3'));var util=require('util');var path=require(_0x7ee8('0x4'));var sox=require(_0x7ee8('0x5'));var csv=require('to-csv');var ejs=require(_0x7ee8('0x6'));var fs=require('fs');var fs_extra=require(_0x7ee8('0x7'));var _=require(_0x7ee8('0x8'));var squel=require(_0x7ee8('0x9'));var crypto=require(_0x7ee8('0xa'));var jsforce=require(_0x7ee8('0xb'));var deskjs=require(_0x7ee8('0xc'));var toCsv=require(_0x7ee8('0xd'));var querystring=require(_0x7ee8('0xe'));var Papa=require(_0x7ee8('0xf'));var Redis=require(_0x7ee8('0x10'));var authService=require(_0x7ee8('0x11'));var qs=require(_0x7ee8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ee8('0x13'));var logger=require(_0x7ee8('0x14'))(_0x7ee8('0x15'));var utils=require(_0x7ee8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7ee8('0x17'));var db=require(_0x7ee8('0x18'))['db'];config[_0x7ee8('0x19')]=_[_0x7ee8('0x1a')](config[_0x7ee8('0x19')],{'host':_0x7ee8('0x1b'),'port':0x18eb});var socket=require(_0x7ee8('0x1c'))(new Redis(config[_0x7ee8('0x19')]));require(_0x7ee8('0x1d'))[_0x7ee8('0x1e')](socket);var jayson=require(_0x7ee8('0x1f'));var client=jayson[_0x7ee8('0x20')][_0x7ee8('0x21')]({'port':0x232c});var client9002=jayson[_0x7ee8('0x20')][_0x7ee8('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xd275fb,_0x1ddb6a,_0x7865bc,_0x154272){return new BPromise(function(_0x3b2c7e,_0x4935f2){var _0x3b167c=_0x154272||client;return _0x3b167c[_0x7ee8('0x22')](_0xd275fb,_0x7865bc)[_0x7ee8('0x23')](function(_0x155790){logger[_0x7ee8('0x24')](_0x7ee8('0x25'),_0x1ddb6a,_0x7ee8('0x26'));logger['debug'](_0x7ee8('0x27'),_0x1ddb6a,'request\x20sent',JSON[_0x7ee8('0x28')](_0x155790));if(_0x155790['error']){if(_0x155790[_0x7ee8('0x29')][_0x7ee8('0x2a')]===0x1f4){logger[_0x7ee8('0x29')](_0x7ee8('0x25'),_0x1ddb6a,_0x155790[_0x7ee8('0x29')][_0x7ee8('0x2b')]);return _0x4935f2(_0x155790[_0x7ee8('0x29')][_0x7ee8('0x2b')]);}logger[_0x7ee8('0x29')](_0x7ee8('0x25'),_0x1ddb6a,_0x155790[_0x7ee8('0x29')]['message']);return _0x3b2c7e(_0x155790[_0x7ee8('0x29')][_0x7ee8('0x2b')]);}else{logger[_0x7ee8('0x24')](_0x7ee8('0x25'),_0x1ddb6a,_0x7ee8('0x26'));_0x3b2c7e(_0x155790['result'][_0x7ee8('0x2b')]);}})[_0x7ee8('0x2c')](function(_0x1aaa8f){logger[_0x7ee8('0x29')](_0x7ee8('0x25'),_0x1ddb6a,_0x1aaa8f);_0x4935f2(_0x1aaa8f);});});}function respondWithStatusCode(_0x1b19eb,_0x5698bd){_0x5698bd=_0x5698bd||0xcc;return function(_0x331966){if(_0x331966){return _0x1b19eb['sendStatus'](_0x5698bd);}return _0x1b19eb[_0x7ee8('0x2d')](_0x5698bd)[_0x7ee8('0x2e')]();};}function respondWithResult(_0x12e0fa,_0xb24832){_0xb24832=_0xb24832||0xc8;return function(_0x5aa58c){if(_0x5aa58c){return _0x12e0fa[_0x7ee8('0x2d')](_0xb24832)[_0x7ee8('0x2f')](_0x5aa58c);}};}function respondWithFilteredResult(_0x3792fa,_0x43fe07){return function(_0x4a5e5c){if(_0x4a5e5c){var _0x1b604c=typeof _0x43fe07[_0x7ee8('0x30')]==='undefined'&&typeof _0x43fe07[_0x7ee8('0x31')]==='undefined';var _0x1a8943=_0x4a5e5c[_0x7ee8('0x32')];var _0x224ec5=_0x1b604c?0x0:_0x43fe07[_0x7ee8('0x30')];var _0x39f8e4=_0x1b604c?_0x4a5e5c['count']:_0x43fe07['offset']+_0x43fe07[_0x7ee8('0x31')];var _0x39b22a;if(_0x39f8e4>=_0x1a8943){_0x39f8e4=_0x1a8943;_0x39b22a=0xc8;}else{_0x39b22a=0xce;}_0x3792fa[_0x7ee8('0x2d')](_0x39b22a);return _0x3792fa['set'](_0x7ee8('0x33'),_0x224ec5+'-'+_0x39f8e4+'/'+_0x1a8943)[_0x7ee8('0x2f')](_0x4a5e5c);}return null;};}function patchUpdates(_0x1d1a01){return function(_0x59f47e){try{jsonpatch['apply'](_0x59f47e,_0x1d1a01,!![]);}catch(_0x579657){return BPromise[_0x7ee8('0x34')](_0x579657);}return _0x59f47e['save']();};}function saveUpdates(_0x5f4f6c,_0x467961){return function(_0x2da688){if(_0x2da688){return _0x2da688[_0x7ee8('0x35')](_0x5f4f6c)[_0x7ee8('0x23')](function(_0x3d1b6f){return _0x3d1b6f;});}return null;};}function removeEntity(_0xf91fe3,_0x2906a7){return function(_0x4a0aa3){if(_0x4a0aa3){return _0x4a0aa3[_0x7ee8('0x36')]()[_0x7ee8('0x23')](function(){_0xf91fe3[_0x7ee8('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c0544,_0x32009f){return function(_0x3e1b4f){if(!_0x3e1b4f){_0x2c0544[_0x7ee8('0x37')](0x194);}return _0x3e1b4f;};}function handleError(_0x4500dd,_0x20ca78){_0x20ca78=_0x20ca78||0x1f4;return function(_0x593e36){logger['error'](_0x593e36['stack']);if(_0x593e36[_0x7ee8('0x38')]){delete _0x593e36[_0x7ee8('0x38')];}_0x4500dd[_0x7ee8('0x2d')](_0x20ca78)[_0x7ee8('0x39')](_0x593e36);};}exports[_0x7ee8('0x3a')]=function(_0x276d30,_0x2e2ce9){var _0x3dbd6e={},_0x16d181={},_0x4d941f={'count':0x0,'rows':[]};var _0x2fa231=_[_0x7ee8('0x3b')](db[_0x7ee8('0x3c')][_0x7ee8('0x3d')],function(_0x11dc71){return{'name':_0x11dc71[_0x7ee8('0x3e')],'type':_0x11dc71[_0x7ee8('0x3f')][_0x7ee8('0x40')]};});_0x16d181[_0x7ee8('0x41')]=_['map'](_0x2fa231,_0x7ee8('0x38'));_0x16d181[_0x7ee8('0x42')]=_[_0x7ee8('0x43')](_0x276d30[_0x7ee8('0x42')]);_0x16d181[_0x7ee8('0x44')]=_[_0x7ee8('0x45')](_0x16d181['model'],_0x16d181[_0x7ee8('0x42')]);_0x3dbd6e['attributes']=_[_0x7ee8('0x45')](_0x16d181[_0x7ee8('0x41')],qs[_0x7ee8('0x46')](_0x276d30['query']['fields']));_0x3dbd6e[_0x7ee8('0x47')]=_0x3dbd6e[_0x7ee8('0x47')][_0x7ee8('0x48')]?_0x3dbd6e[_0x7ee8('0x47')]:_0x16d181[_0x7ee8('0x41')];if(!_0x276d30[_0x7ee8('0x42')][_0x7ee8('0x49')](_0x7ee8('0x4a'))){_0x3dbd6e['limit']=qs[_0x7ee8('0x31')](_0x276d30['query']['limit']);_0x3dbd6e['offset']=qs[_0x7ee8('0x30')](_0x276d30[_0x7ee8('0x42')][_0x7ee8('0x30')]);}_0x3dbd6e[_0x7ee8('0x4b')]=qs[_0x7ee8('0x4c')](_0x276d30[_0x7ee8('0x42')][_0x7ee8('0x4c')]);_0x3dbd6e['where']=qs[_0x7ee8('0x44')](_[_0x7ee8('0x4d')](_0x276d30[_0x7ee8('0x42')],_0x16d181[_0x7ee8('0x44')]),_0x2fa231);if(_0x276d30[_0x7ee8('0x42')]['filter']){_0x3dbd6e[_0x7ee8('0x4e')]=_[_0x7ee8('0x4f')](_0x3dbd6e[_0x7ee8('0x4e')],{'$or':_[_0x7ee8('0x3b')](_0x2fa231,function(_0x2da8b7){if(_0x2da8b7[_0x7ee8('0x3f')]!==_0x7ee8('0x50')){var _0x556b0e={};_0x556b0e[_0x2da8b7[_0x7ee8('0x38')]]={'$like':'%'+_0x276d30[_0x7ee8('0x42')][_0x7ee8('0x51')]+'%'};return _0x556b0e;}})});}_0x3dbd6e=_[_0x7ee8('0x4f')]({},_0x3dbd6e,_0x276d30[_0x7ee8('0x52')]);var _0x257bfd={'where':_0x3dbd6e[_0x7ee8('0x4e')]};return db[_0x7ee8('0x3c')]['count'](_0x257bfd)[_0x7ee8('0x23')](function(_0x1e0c80){_0x4d941f[_0x7ee8('0x32')]=_0x1e0c80;if(_0x276d30['query'][_0x7ee8('0x53')]){_0x3dbd6e['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x7ee8('0x54')](_0x3dbd6e);})[_0x7ee8('0x23')](function(_0x3cb4f0){_0x4d941f[_0x7ee8('0x55')]=_0x3cb4f0;return _0x4d941f;})[_0x7ee8('0x23')](respondWithFilteredResult(_0x2e2ce9,_0x3dbd6e))[_0x7ee8('0x2c')](handleError(_0x2e2ce9,null));};exports[_0x7ee8('0x56')]=function(_0x1cc924,_0x33d358){var _0x172c4e={'raw':!![],'where':{'id':_0x1cc924[_0x7ee8('0x57')]['id']}},_0x3ac815={};_0x3ac815['model']=_['keys'](db[_0x7ee8('0x3c')][_0x7ee8('0x3d')]);_0x3ac815['query']=_[_0x7ee8('0x43')](_0x1cc924[_0x7ee8('0x42')]);_0x3ac815['filters']=_[_0x7ee8('0x45')](_0x3ac815[_0x7ee8('0x41')],_0x3ac815[_0x7ee8('0x42')]);_0x172c4e['attributes']=_['intersection'](_0x3ac815[_0x7ee8('0x41')],qs['fields'](_0x1cc924[_0x7ee8('0x42')][_0x7ee8('0x46')]));_0x172c4e[_0x7ee8('0x47')]=_0x172c4e['attributes'][_0x7ee8('0x48')]?_0x172c4e[_0x7ee8('0x47')]:_0x3ac815[_0x7ee8('0x41')];if(_0x1cc924[_0x7ee8('0x42')][_0x7ee8('0x53')]){_0x172c4e['include']=[{'all':!![]}];}_0x172c4e=_['merge']({},_0x172c4e,_0x1cc924[_0x7ee8('0x52')]);return db[_0x7ee8('0x3c')][_0x7ee8('0x58')](_0x172c4e)['then'](handleEntityNotFound(_0x33d358,null))[_0x7ee8('0x23')](respondWithResult(_0x33d358,null))[_0x7ee8('0x2c')](handleError(_0x33d358,null));};exports[_0x7ee8('0x59')]=function(_0x142e7d,_0x363a79){return db['OpenchannelMessage'][_0x7ee8('0x59')](_0x142e7d['body'],{})['then'](respondWithResult(_0x363a79,0xc9))[_0x7ee8('0x2c')](handleError(_0x363a79,null));};exports[_0x7ee8('0x35')]=function(_0x225c3b,_0x3b4f20){if(_0x225c3b[_0x7ee8('0x5a')]['id']){delete _0x225c3b[_0x7ee8('0x5a')]['id'];}return db[_0x7ee8('0x3c')][_0x7ee8('0x58')]({'where':{'id':_0x225c3b[_0x7ee8('0x57')]['id']}})[_0x7ee8('0x23')](handleEntityNotFound(_0x3b4f20,null))[_0x7ee8('0x23')](saveUpdates(_0x225c3b['body'],null))[_0x7ee8('0x23')](respondWithResult(_0x3b4f20,null))[_0x7ee8('0x2c')](handleError(_0x3b4f20,null));};exports[_0x7ee8('0x36')]=function(_0x74fd1e,_0x100a7b){return db[_0x7ee8('0x3c')][_0x7ee8('0x58')]({'where':{'id':_0x74fd1e[_0x7ee8('0x57')]['id']}})[_0x7ee8('0x23')](handleEntityNotFound(_0x100a7b,null))[_0x7ee8('0x23')](removeEntity(_0x100a7b,null))[_0x7ee8('0x2c')](handleError(_0x100a7b,null));};exports[_0x7ee8('0x5b')]=function(_0x27592b,_0x4d8a2d){return db[_0x7ee8('0x3c')]['describe']()[_0x7ee8('0x23')](respondWithResult(_0x4d8a2d,null))[_0x7ee8('0x2c')](handleError(_0x4d8a2d,null));};var interaction_log=require(_0x7ee8('0x14'))('openchannel-interactions');exports[_0x7ee8('0x5c')]=function(_0x1fcca7,_0x3bb8c9,_0x5b1f1a){var _0x19728a={'agent':{},'channel':_0x7ee8('0x5d')};if(_0x1fcca7[_0x7ee8('0x5a')]['id']){delete _0x1fcca7['body']['id'];}_0x1fcca7['body']['read']=!![];_0x1fcca7[_0x7ee8('0x5a')][_0x7ee8('0x5e')]=moment()[_0x7ee8('0x5f')](_0x7ee8('0x60'));_0x1fcca7[_0x7ee8('0x5a')][_0x7ee8('0x61')]=_0x1fcca7[_0x7ee8('0x5a')][_0x7ee8('0x61')]||_0x1fcca7['user']['id'];_0x19728a[_0x7ee8('0x62')]['id']=_0x1fcca7[_0x7ee8('0x5a')][_0x7ee8('0x61')];return db['OpenchannelMessage'][_0x7ee8('0x58')]({'where':{'id':_0x1fcca7['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3bb8c9,null))[_0x7ee8('0x23')](saveUpdates(_0x1fcca7[_0x7ee8('0x5a')],null))[_0x7ee8('0x23')](function(_0x461917){if(_0x461917){_0x19728a[_0x7ee8('0x2b')]=_0x461917['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x7ee8('0x58')]({'where':{'id':_0x461917['OpenchannelInteractionId']}});}return null;})[_0x7ee8('0x23')](handleEntityNotFound(_0x3bb8c9,null))[_0x7ee8('0x23')](function(_0x4f2711){if(_0x4f2711){return _0x4f2711[_0x7ee8('0x35')]({'UserId':_0x1fcca7['body']['UserId'],'read1stAt':_['isNil'](_0x4f2711[_0x7ee8('0x63')])?moment()['format'](_0x7ee8('0x60')):undefined});}return null;})[_0x7ee8('0x23')](function(_0x3bccf0){if(_0x3bccf0){_0x19728a[_0x7ee8('0x64')]=_0x3bccf0[_0x7ee8('0x65')]({'plain':!![]});interaction_log[_0x7ee8('0x24')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1fcca7[_0x7ee8('0x66')]['id'],_0x1fcca7[_0x7ee8('0x66')][_0x7ee8('0x38')],_0x1fcca7[_0x7ee8('0x66')][_0x7ee8('0x67')],_0x19728a[_0x7ee8('0x64')]['id'],_0x1fcca7[_0x7ee8('0x5a')]?JSON[_0x7ee8('0x28')](_0x1fcca7['body']):'null');return respondWithRpcPromise(_0x7ee8('0x68'),'acceptMessage',_0x19728a);}return null;})[_0x7ee8('0x23')](function(_0x97b20b){var _0x33d439=_0x7ee8('0x69')+_0x97b20b['message'][_0x7ee8('0x6a')];return db[_0x7ee8('0x6b')][_0x7ee8('0x42')](_0x33d439,{'type':db[_0x7ee8('0x6c')]['QueryTypes'][_0x7ee8('0x6d')],'raw':!![]})[_0x7ee8('0x23')](function(_0x5f4ab3){return _0x5f4ab3;});})['then'](function(_0x3d8d23){if(_0x3d8d23){_0x19728a[_0x7ee8('0x2b')][_0x7ee8('0x6e')]=_0x3d8d23[0x0];if(!_0x1fcca7[_0x7ee8('0x5a')]['UserId'])return;return db[_0x7ee8('0x6f')][_0x7ee8('0x58')]({'where':{'id':_0x1fcca7[_0x7ee8('0x5a')][_0x7ee8('0x61')],'role':_0x7ee8('0x62')},'attributes':['id','name',_0x7ee8('0x70'),'email',_0x7ee8('0x71')],'raw':!![]});}return null;})[_0x7ee8('0x23')](function(_0x5beffe){if(!_0x5beffe)return null;_0x19728a[_0x7ee8('0x2b')][_0x7ee8('0x62')]=_0x5beffe;return _0x19728a;})['then'](function(_0x236c1b){if(_0x236c1b){if(_0x1fcca7[_0x7ee8('0x5a')][_0x7ee8('0x72')]){_0x19728a[_0x7ee8('0x2b')][_0x7ee8('0x73')]=util['format'](_0x7ee8('0x74'),_0x1fcca7[_0x7ee8('0x66')][_0x7ee8('0x38')]);_0x19728a[_0x7ee8('0x2b')][_0x7ee8('0x75')]=_0x19728a[_0x7ee8('0x75')];_0x19728a[_0x7ee8('0x2b')][_0x7ee8('0x76')]=_0x19728a[_0x7ee8('0x75')];_0x19728a[_0x7ee8('0x2b')][_0x7ee8('0x77')]=_0x7ee8('0x5c');return respondWithRpcPromise(_0x7ee8('0x78'),_0x7ee8('0x78'),{'event':_0x7ee8('0x79'),'message':_0x19728a[_0x7ee8('0x2b')]},client9002)[_0x7ee8('0x23')](function(){return _0x19728a;});}return _0x19728a;}return null;})[_0x7ee8('0x23')](respondWithResult(_0x3bb8c9,null))[_0x7ee8('0x2c')](handleError(_0x3bb8c9,null));};var interaction_log=require(_0x7ee8('0x14'))(_0x7ee8('0x7a'));exports[_0x7ee8('0x34')]=function(_0x273c2d,_0x59f9c1,_0x2072f5){var _0x3c1fa8={'agent':{},'channel':_0x7ee8('0x5d')};if(_0x273c2d[_0x7ee8('0x5a')]['id']){delete _0x273c2d['body']['id'];}_0x273c2d[_0x7ee8('0x5a')][_0x7ee8('0x61')]=_0x273c2d[_0x7ee8('0x5a')][_0x7ee8('0x61')]||_0x273c2d[_0x7ee8('0x66')]['id'];_0x3c1fa8[_0x7ee8('0x62')]['id']=_0x273c2d[_0x7ee8('0x5a')][_0x7ee8('0x61')];return db[_0x7ee8('0x3c')][_0x7ee8('0x58')]({'where':{'id':_0x273c2d['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x59f9c1,null))[_0x7ee8('0x23')](function(_0x58d1d9){if(_0x58d1d9){_0x3c1fa8[_0x7ee8('0x2b')]=_0x58d1d9[_0x7ee8('0x65')]({'plain':!![]});return db['OpenchannelInteraction'][_0x7ee8('0x58')]({'where':{'id':_0x58d1d9[_0x7ee8('0x7b')]}});}return null;})[_0x7ee8('0x23')](handleEntityNotFound(_0x59f9c1,null))[_0x7ee8('0x23')](function(_0x2c6224){if(_0x2c6224){_0x3c1fa8[_0x7ee8('0x64')]=_0x2c6224[_0x7ee8('0x65')]({'plain':!![]});interaction_log[_0x7ee8('0x24')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x273c2d['user']['id'],_0x273c2d[_0x7ee8('0x66')][_0x7ee8('0x38')],_0x273c2d['user'][_0x7ee8('0x67')],_0x3c1fa8[_0x7ee8('0x64')]['id'],_0x273c2d['body']?JSON[_0x7ee8('0x28')](_0x273c2d['body']):_0x7ee8('0x7c'));return respondWithRpcPromise(_0x7ee8('0x7d'),_0x7ee8('0x7e'),_0x3c1fa8);}return null;})[_0x7ee8('0x23')](function(_0x1cc2c8){var _0x4e1be0=_0x7ee8('0x69')+_0x1cc2c8['message'][_0x7ee8('0x6a')];return db[_0x7ee8('0x6b')][_0x7ee8('0x42')](_0x4e1be0,{'type':db[_0x7ee8('0x6c')][_0x7ee8('0x7f')][_0x7ee8('0x6d')],'raw':!![]})[_0x7ee8('0x23')](function(_0x5c82b5){return _0x5c82b5;});})['then'](function(_0x2553ae){if(_0x2553ae){_0x3c1fa8[_0x7ee8('0x2b')][_0x7ee8('0x6e')]=_0x2553ae[0x0];if(!_0x273c2d['body']['UserId'])return;return db[_0x7ee8('0x6f')][_0x7ee8('0x58')]({'where':{'id':_0x273c2d[_0x7ee8('0x5a')][_0x7ee8('0x61')],'role':_0x7ee8('0x62')},'attributes':['id',_0x7ee8('0x38'),'fullname','email',_0x7ee8('0x71')],'raw':!![]});}return null;})['then'](function(_0x409e93){if(!_0x409e93)return null;_0x3c1fa8[_0x7ee8('0x2b')]['agent']=_0x409e93;return _0x3c1fa8;})[_0x7ee8('0x23')](function(_0xaf2125){if(_0xaf2125){_0xaf2125['message'][_0x7ee8('0x73')]=util[_0x7ee8('0x5f')](_0x7ee8('0x74'),_0x273c2d[_0x7ee8('0x66')]['name']);_0xaf2125[_0x7ee8('0x2b')][_0x7ee8('0x75')]=_0x3c1fa8[_0x7ee8('0x75')];_0xaf2125[_0x7ee8('0x2b')]['motionChannel']=_0x3c1fa8[_0x7ee8('0x75')];_0xaf2125[_0x7ee8('0x2b')][_0x7ee8('0x77')]=_0x7ee8('0x34');respondWithRpcPromise(_0x7ee8('0x78'),_0x7ee8('0x78'),{'event':_0x7ee8('0x80'),'message':_0xaf2125[_0x7ee8('0x2b')]},client9002);return _0x3c1fa8;}return null;})[_0x7ee8('0x23')](respondWithResult(_0x59f9c1,null))['catch'](handleError(_0x59f9c1,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 101cd5f..01cd464 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 _0x926c=['remove','emit','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x407309,_0x5a9f06){var _0x402686=function(_0x127327){while(--_0x127327){_0x407309['push'](_0x407309['shift']());}};_0x402686(++_0x5a9f06);}(_0x926c,0x13a));var _0xc926=function(_0x35ac23,_0x1c2599){_0x35ac23=_0x35ac23-0x0;var _0x3e8d81=_0x926c[_0x35ac23];return _0x3e8d81;};'use strict';var EventEmitter=require(_0xc926('0x0'));var OpenchannelMessage=require(_0xc926('0x1'))['db'][_0xc926('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xc926('0x3')](0x0);var events={'afterCreate':_0xc926('0x4'),'afterUpdate':_0xc926('0x5'),'afterDestroy':_0xc926('0x6')};function emitEvent(_0x1fcf5f){return function(_0x206f7c,_0x9a4ea8,_0x11a4ed){OpenchannelMessageEvents[_0xc926('0x7')](_0x1fcf5f+':'+_0x206f7c['id'],_0x206f7c);OpenchannelMessageEvents['emit'](_0x1fcf5f,_0x206f7c);_0x11a4ed(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xc926('0x8')](e,emitEvent(event));}}module[_0xc926('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xd34b=['emit','hasOwnProperty','exports','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x949b20,_0x2e9cbf){var _0x48bb33=function(_0x6595d){while(--_0x6595d){_0x949b20['push'](_0x949b20['shift']());}};_0x48bb33(++_0x2e9cbf);}(_0xd34b,0xff));var _0xbd34=function(_0x3b3283,_0x48bdcd){_0x3b3283=_0x3b3283-0x0;var _0x2cb8cf=_0xd34b[_0x3b3283];return _0x2cb8cf;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0xbd34('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xbd34('0x1')](0x0);var events={'afterCreate':_0xbd34('0x2'),'afterUpdate':_0xbd34('0x3'),'afterDestroy':'remove'};function emitEvent(_0x38a35b){return function(_0x3e2ba2,_0x5ae6bb,_0x339ef3){OpenchannelMessageEvents[_0xbd34('0x4')](_0x38a35b+':'+_0x3e2ba2['id'],_0x3e2ba2);OpenchannelMessageEvents['emit'](_0x38a35b,_0x3e2ba2);_0x339ef3(null);};}for(var e in events){if(events[_0xbd34('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xbd34('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 33db77a..d3c505a 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 _0x1775=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','find','OpenchannelAccountId','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','Interaction','omit','POST','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x29924d,_0x4b13f9){var _0x110c3d=function(_0x573a61){while(--_0x573a61){_0x29924d['push'](_0x29924d['shift']());}};_0x110c3d(++_0x4b13f9);}(_0x1775,0x1db));var _0x5177=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1775[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var logger=require(_0x5177('0x1'))(_0x5177('0x2'));var moment=require(_0x5177('0x3'));var BPromise=require(_0x5177('0x4'));var rp=require(_0x5177('0x5'));var fs=require('fs');var path=require(_0x5177('0x6'));var rimraf=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var attributes=require(_0x5177('0x9'));module[_0x5177('0xa')]=function(_0x2c5c42,_0x153c1a){return _0x2c5c42[_0x5177('0xb')](_0x5177('0xc'),attributes,{'tableName':_0x5177('0xd'),'paranoid':![],'indexes':[{'name':_0x5177('0xe'),'fields':[_0x5177('0xf')],'type':_0x5177('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e5a3b,_0x2c23d8,_0x206035){var _0x5bdca9=_0x2c5c42['models'];var _0x13c7f6=_0x2e5a3b[_0x5177('0x11')]({'plain':!![]});if(_0x13c7f6[_0x5177('0x12')][_0x5177('0x13')]()==='in'||_0x13c7f6[_0x5177('0x12')]['toLowerCase']()===_0x5177('0x14')&&!_0x13c7f6[_0x5177('0x15')]&&!_[_0x5177('0x16')](_0x13c7f6[_0x5177('0x17')])){_0x5bdca9[_0x5177('0x18')][_0x5177('0x19')]({'where':{'id':_0x13c7f6[_0x5177('0x1a')]}})[_0x5177('0x1b')](function(_0x3e6224){if(_0x3e6224){_0x3e6224[_0x5177('0x1c')]({'lastMsgAt':_0x13c7f6[_0x5177('0x1d')],'lastMsgDirection':_0x13c7f6[_0x5177('0x12')][_0x5177('0x13')]()});}})[_0x5177('0x1e')](function(_0x1b32e6){console[_0x5177('0x1f')](_0x1b32e6);});}if(_0x13c7f6[_0x5177('0x12')]===_0x5177('0x14')&&!_0x13c7f6[_0x5177('0x15')]){var _0x50ce2c;_0x5bdca9[_0x5177('0x20')][_0x5177('0x21')]()[_0x5177('0x1b')](function(_0x1b4102){return _0x5bdca9['OpenchannelAccount'][_0x5177('0x22')]({'where':{'id':_0x13c7f6[_0x5177('0x23')]},'include':[{'model':_0x5bdca9[_0x5177('0x18')],'as':'Interactions','where':{'id':_0x13c7f6[_0x5177('0x1a')]},'limit':0x1,'include':[{'model':_0x5bdca9['CmContact'],'as':_0x5177('0x24'),'attributes':_[_0x5177('0x25')](_0x1b4102)}]}]});})[_0x5177('0x1b')](function(_0x27b732){_0x50ce2c=_0x27b732[_0x5177('0x11')]({'plain':!![]});if(_0x50ce2c&&_0x50ce2c[_0x5177('0x26')]){logger[_0x5177('0x27')](_0x5177('0x28'),_0x5177('0x29'),util[_0x5177('0x2a')](_0x5177('0x2b'),_0x13c7f6['id'],_0x50ce2c[_0x5177('0x26')]));if(_0x50ce2c['Interactions']&&_0x50ce2c[_0x5177('0x2c')]['length']){_0x13c7f6[_0x5177('0x2d')]=_[_0x5177('0x2e')](_0x50ce2c[_0x5177('0x2c')][0x0],_0x5177('0x24'));_0x13c7f6['Contact']=_0x50ce2c[_0x5177('0x2c')][0x0]['Contact'];}var _0x2c23d8={'method':_0x5177('0x2f'),'uri':encodeURI(_0x50ce2c[_0x5177('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2c23d8['method']){case _0x5177('0x30'):_0x2c23d8['qs']=_0x13c7f6;break;case'POST':_0x2c23d8[_0x5177('0xf')]=_0x13c7f6;break;}return rp(_0x2c23d8)[_0x5177('0x1b')](function(_0x58846c){logger[_0x5177('0x27')](_0x5177('0x28'),_0x5177('0x29'),util[_0x5177('0x2a')](_0x5177('0x31'),_0x13c7f6['id'],_0x50ce2c[_0x5177('0x26')]));if(_0x58846c['body']['threadId']&&_0x58846c[_0x5177('0xf')][_0x5177('0x32')]!=_0x13c7f6[_0x5177('0x2d')][_0x5177('0x32')]){return _0x5bdca9[_0x5177('0x18')][_0x5177('0x1c')]({'threadId':_0x58846c[_0x5177('0xf')][_0x5177('0x32')]},{'logging':!![],'where':{'id':_0x13c7f6['Interaction']['id']}});}else{return;}})[_0x5177('0x1b')](function(){return _0x2e5a3b[_0x5177('0x1c')]({'read':!![]});})['catch'](function(_0x32bea9){logger['error'](_0x5177('0x28'),_0x5177('0x29'),util[_0x5177('0x33')](_0x32bea9,{'showHidden':![],'depth':null}));_0x206035();});}else{_0x206035();}})['finally'](function(){_0x206035();});}else{_0x206035();}}},'charset':'utf8mb4','collate':_0x5177('0x34')});}; \ No newline at end of file +var _0xed3c=['OpenchannelInteractionId','createdAt','catch','error','CmContact','describe','find','OpenchannelAccountId','Interactions','Contact','keys','then','get','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','omit','replyUri','GET','POST','body','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','OpenchannelMessage,\x20%s,\x20%s','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','./openchannelMessage.attributes','exports','fti_openchannel_messages','models','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne'];(function(_0x4ec520,_0x15fee2){var _0xed49d7=function(_0x3031f2){while(--_0x3031f2){_0x4ec520['push'](_0x4ec520['shift']());}};_0xed49d7(++_0x15fee2);}(_0xed3c,0x1a6));var _0xced3=function(_0x219143,_0x451ca3){_0x219143=_0x219143-0x0;var _0x501e6b=_0xed3c[_0x219143];return _0x501e6b;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var logger=require(_0xced3('0x2'))(_0xced3('0x3'));var moment=require('moment');var BPromise=require(_0xced3('0x4'));var rp=require(_0xced3('0x5'));var fs=require('fs');var path=require(_0xced3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xced3('0x7'));module[_0xced3('0x8')]=function(_0x2f92f8,_0x1cd694){return _0x2f92f8['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xced3('0x9'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4be020,_0x19a727,_0x321c42){var _0x3e5a04=_0x2f92f8[_0xced3('0xa')];var _0x1cb639=_0x4be020['get']({'plain':!![]});if(_0x1cb639[_0xced3('0xb')][_0xced3('0xc')]()==='in'||_0x1cb639[_0xced3('0xb')]['toLowerCase']()===_0xced3('0xd')&&!_0x1cb639[_0xced3('0xe')]&&!_[_0xced3('0xf')](_0x1cb639[_0xced3('0x10')])){_0x3e5a04[_0xced3('0x11')][_0xced3('0x12')]({'where':{'id':_0x1cb639[_0xced3('0x13')]}})['then'](function(_0x65bb58){if(_0x65bb58){_0x65bb58['update']({'lastMsgAt':_0x1cb639[_0xced3('0x14')],'lastMsgDirection':_0x1cb639[_0xced3('0xb')][_0xced3('0xc')]()});}})[_0xced3('0x15')](function(_0x4dd4c3){console[_0xced3('0x16')](_0x4dd4c3);});}if(_0x1cb639[_0xced3('0xb')]==='out'&&!_0x1cb639[_0xced3('0xe')]){var _0x37e2d5;_0x3e5a04[_0xced3('0x17')][_0xced3('0x18')]()['then'](function(_0x4569af){return _0x3e5a04['OpenchannelAccount'][_0xced3('0x19')]({'where':{'id':_0x1cb639[_0xced3('0x1a')]},'include':[{'model':_0x3e5a04[_0xced3('0x11')],'as':_0xced3('0x1b'),'where':{'id':_0x1cb639[_0xced3('0x13')]},'limit':0x1,'include':[{'model':_0x3e5a04[_0xced3('0x17')],'as':_0xced3('0x1c'),'attributes':_[_0xced3('0x1d')](_0x4569af)}]}]});})[_0xced3('0x1e')](function(_0x17c011){_0x37e2d5=_0x17c011[_0xced3('0x1f')]({'plain':!![]});if(_0x37e2d5&&_0x37e2d5['replyUri']){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xced3('0x20'),util[_0xced3('0x21')](_0xced3('0x22'),_0x1cb639['id'],_0x37e2d5['replyUri']));if(_0x37e2d5[_0xced3('0x1b')]&&_0x37e2d5[_0xced3('0x1b')]['length']){_0x1cb639['Interaction']=_[_0xced3('0x23')](_0x37e2d5[_0xced3('0x1b')][0x0],_0xced3('0x1c'));_0x1cb639[_0xced3('0x1c')]=_0x37e2d5['Interactions'][0x0][_0xced3('0x1c')];}var _0x19a727={'method':'POST','uri':encodeURI(_0x37e2d5[_0xced3('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x19a727['method']){case _0xced3('0x25'):_0x19a727['qs']=_0x1cb639;break;case _0xced3('0x26'):_0x19a727[_0xced3('0x27')]=_0x1cb639;break;}return rp(_0x19a727)[_0xced3('0x1e')](function(_0x2ec2c4){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xced3('0x20'),util['format'](_0xced3('0x28'),_0x1cb639['id'],_0x37e2d5[_0xced3('0x24')]));if(_0x2ec2c4['body'][_0xced3('0x29')]&&_0x2ec2c4[_0xced3('0x27')][_0xced3('0x29')]!=_0x1cb639[_0xced3('0x2a')][_0xced3('0x29')]){return _0x3e5a04[_0xced3('0x11')][_0xced3('0x2b')]({'threadId':_0x2ec2c4[_0xced3('0x27')][_0xced3('0x29')]},{'logging':!![],'where':{'id':_0x1cb639['Interaction']['id']}});}else{return;}})[_0xced3('0x1e')](function(){return _0x4be020[_0xced3('0x2b')]({'read':!![]});})[_0xced3('0x15')](function(_0x5867af){logger[_0xced3('0x16')](_0xced3('0x2c'),_0xced3('0x20'),util[_0xced3('0x2d')](_0x5867af,{'showHidden':![],'depth':null}));_0x321c42();});}else{_0x321c42();}})[_0xced3('0x2e')](function(){_0x321c42();});}else{_0x321c42();}}},'charset':_0xced3('0x2f'),'collate':_0xced3('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index fadba8b..47834b8 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(_0x148ecb,_0x40d47c){var _0x9e9967=function(_0x54a18b){while(--_0x54a18b){_0x148ecb['push'](_0x148ecb['shift']());}};_0x9e9967(++_0x40d47c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x0b0e[_0x1b4b23];return _0x2a325b;};'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(_0x402a3d,_0x15ce48){var _0x336ba9=function(_0x18a0c6){while(--_0x18a0c6){_0x402a3d['push'](_0x402a3d['shift']());}};_0x336ba9(++_0x15ce48);}(_0x7a54,0x106));var _0x47a5=function(_0x307afb,_0x2a4eba){_0x307afb=_0x307afb-0x0;var _0x5ba889=_0x7a54[_0x307afb];return _0x5ba889;};'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 9d3b8f0..c6af8f9 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 _0x0af1=['removeListener','register','length','remove','update','emit'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x0af1,0x135));var _0x10af=function(_0x2bbcb9,_0x205cbe){_0x2bbcb9=_0x2bbcb9-0x0;var _0x5e645b=_0x0af1[_0x2bbcb9];return _0x5e645b;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x10af('0x0'),_0x10af('0x1')];function createListener(_0x130907,_0x3966fa){return function(_0x48170c){_0x3966fa[_0x10af('0x2')](_0x130907,_0x48170c);};}function removeListener(_0x30a103,_0x570384){return function(){OpenchannelMessageEvents[_0x10af('0x3')](_0x30a103,_0x570384);};}exports[_0x10af('0x4')]=function(_0x4b904a){for(var _0x3b9359=0x0,_0x35dab8=events[_0x10af('0x5')];_0x3b9359<_0x35dab8;_0x3b9359++){var _0x1e6b92=events[_0x3b9359];var _0xf73035=createListener('openchannelMessage:'+_0x1e6b92,_0x4b904a);OpenchannelMessageEvents['on'](_0x1e6b92,_0xf73035);}}; \ No newline at end of file +var _0xda19=['removeListener','register','length','save','remove'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xda19,0xd5));var _0x9da1=function(_0xaa6095,_0xbf2cee){_0xaa6095=_0xaa6095-0x0;var _0x4a77e1=_0xda19[_0xaa6095];return _0x4a77e1;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x9da1('0x0'),_0x9da1('0x1'),'update'];function createListener(_0x175479,_0x503770){return function(_0x435076){_0x503770['emit'](_0x175479,_0x435076);};}function removeListener(_0x2a77c7,_0xef6f5a){return function(){OpenchannelMessageEvents[_0x9da1('0x2')](_0x2a77c7,_0xef6f5a);};}exports[_0x9da1('0x3')]=function(_0x156faf){for(var _0x2dcbc6=0x0,_0x23e4f7=events[_0x9da1('0x4')];_0x2dcbc6<_0x23e4f7;_0x2dcbc6++){var _0x1c24e6=events[_0x2dcbc6];var _0x5e2d18=createListener('openchannelMessage:'+_0x1c24e6,_0x156faf);OpenchannelMessageEvents['on'](_0x1c24e6,_0x5e2d18);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index d18b8cf..092faf8 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 _0xc020=['describe','/:id','/:id/members','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','destroy','removeTeams','delete','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x464434,_0x26a674){var _0x45cea2=function(_0x2a56d2){while(--_0x2a56d2){_0x464434['push'](_0x464434['shift']());}};_0x45cea2(++_0x26a674);}(_0xc020,0x18a));var _0x0c02=function(_0x25cd2c,_0x57498e){_0x25cd2c=_0x25cd2c-0x0;var _0x1e364c=_0xc020[_0x25cd2c];return _0x1e364c;};'use strict';var multer=require(_0x0c02('0x0'));var util=require('util');var path=require(_0x0c02('0x1'));var timeout=require(_0x0c02('0x2'));var express=require(_0x0c02('0x3'));var router=express[_0x0c02('0x4')]();var fs_extra=require(_0x0c02('0x5'));var auth=require(_0x0c02('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0c02('0x7'));router[_0x0c02('0x8')]('/',auth[_0x0c02('0x9')](),controller[_0x0c02('0xa')]);router[_0x0c02('0x8')](_0x0c02('0xb'),auth[_0x0c02('0x9')](),controller[_0x0c02('0xc')]);router[_0x0c02('0x8')](_0x0c02('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x0c02('0x8')](_0x0c02('0xe'),auth['isAuthenticated'](),controller['getMembers']);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x0c02('0xf')]);router[_0x0c02('0x8')](_0x0c02('0x10'),auth[_0x0c02('0x9')](),controller[_0x0c02('0x11')]);router[_0x0c02('0x12')]('/',auth[_0x0c02('0x9')](),controller[_0x0c02('0x13')]);router[_0x0c02('0x12')](_0x0c02('0x14'),auth[_0x0c02('0x9')](),controller[_0x0c02('0x15')]);router[_0x0c02('0x12')](_0x0c02('0x10'),auth[_0x0c02('0x9')](),controller[_0x0c02('0x16')]);router[_0x0c02('0x17')]('/:id',auth[_0x0c02('0x9')](),controller[_0x0c02('0x18')]);router['delete'](_0x0c02('0xd'),auth[_0x0c02('0x9')](),controller[_0x0c02('0x19')]);router['delete']('/:id/teams',auth[_0x0c02('0x9')](),controller[_0x0c02('0x1a')]);router[_0x0c02('0x1b')](_0x0c02('0x10'),auth[_0x0c02('0x9')](),controller[_0x0c02('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x8a7e=['/describe','describe','/:id','show','/:id/members','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','delete','destroy','/:id/teams','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','get'];(function(_0x411dc3,_0x447538){var _0x3265f2=function(_0x3ecb17){while(--_0x3ecb17){_0x411dc3['push'](_0x411dc3['shift']());}};_0x3265f2(++_0x447538);}(_0x8a7e,0x87));var _0xe8a7=function(_0x397a54,_0x247dca){_0x397a54=_0x397a54-0x0;var _0x1d160f=_0x8a7e[_0x397a54];return _0x1d160f;};'use strict';var multer=require(_0xe8a7('0x0'));var util=require('util');var path=require(_0xe8a7('0x1'));var timeout=require(_0xe8a7('0x2'));var express=require(_0xe8a7('0x3'));var router=express[_0xe8a7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe8a7('0x5'));var config=require(_0xe8a7('0x6'));var controller=require(_0xe8a7('0x7'));router['get']('/',auth[_0xe8a7('0x8')](),controller['index']);router[_0xe8a7('0x9')](_0xe8a7('0xa'),auth['isAuthenticated'](),controller[_0xe8a7('0xb')]);router['get'](_0xe8a7('0xc'),auth[_0xe8a7('0x8')](),controller[_0xe8a7('0xd')]);router[_0xe8a7('0x9')](_0xe8a7('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0xe8a7('0x9')]('/:id/teams',auth[_0xe8a7('0x8')](),controller[_0xe8a7('0xf')]);router[_0xe8a7('0x9')]('/:id/users',auth[_0xe8a7('0x8')](),controller[_0xe8a7('0x10')]);router[_0xe8a7('0x11')]('/',auth['isAuthenticated'](),controller[_0xe8a7('0x12')]);router[_0xe8a7('0x11')]('/:id/teams',auth[_0xe8a7('0x8')](),controller[_0xe8a7('0x13')]);router[_0xe8a7('0x11')](_0xe8a7('0x14'),auth[_0xe8a7('0x8')](),controller[_0xe8a7('0x15')]);router[_0xe8a7('0x16')](_0xe8a7('0xc'),auth[_0xe8a7('0x8')](),controller['update']);router[_0xe8a7('0x17')](_0xe8a7('0xc'),auth[_0xe8a7('0x8')](),controller[_0xe8a7('0x18')]);router[_0xe8a7('0x17')](_0xe8a7('0x19'),auth[_0xe8a7('0x8')](),controller[_0xe8a7('0x1a')]);router[_0xe8a7('0x17')](_0xe8a7('0x14'),auth[_0xe8a7('0x8')](),controller[_0xe8a7('0x1b')]);module[_0xe8a7('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 2ca6b61..1df3e62 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 _0xc590=['name','INTEGER','rrmemory','beepall','STRING'];(function(_0x2b7c9e,_0x195bf2){var _0x57f1e5=function(_0x5c415e){while(--_0x5c415e){_0x2b7c9e['push'](_0x2b7c9e['shift']());}};_0x57f1e5(++_0x195bf2);}(_0xc590,0xb3));var _0x0c59=function(_0x736c06,_0x9f97c0){_0x736c06=_0x736c06-0x0;var _0xf61589=_0xc590[_0x736c06];return _0xf61589;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0c59('0x0')],'unique':_0x0c59('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0c59('0x0')]},'timeout':{'type':Sequelize[_0x0c59('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x0c59('0x3'),_0x0c59('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x278f=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x5781cc,_0x475ec6){var _0x6e0111=function(_0x3c7918){while(--_0x3c7918){_0x5781cc['push'](_0x5781cc['shift']());}};_0x6e0111(++_0x475ec6);}(_0x278f,0xf9));var _0xf278=function(_0x1ee50e,_0x11112b){_0x1ee50e=_0x1ee50e-0x0;var _0x1f2800=_0x278f[_0x1ee50e];return _0x1f2800;};'use strict';var Sequelize=require(_0xf278('0x0'));module[_0xf278('0x1')]={'name':{'type':Sequelize[_0xf278('0x2')],'unique':_0xf278('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf278('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf278('0x5')](_0xf278('0x6'),_0xf278('0x7'),_0xf278('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index b9620db..aaaf49e 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 _0x7f3f=['bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','fieldName','type','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','filter','where','VIRTUAL','merge','options','findAll','rows','catch','show','rawAttributes','length','includeAll','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','describe','params','get','hasOwnProperty','OpenchannelQueueId','UserOpenchannelQueue','findAndCountAll','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','sequelize','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','User','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','all','compact','value','transaction','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents','pick'];(function(_0x4702ee,_0xaf6a45){var _0x62ca7d=function(_0x5b3af7){while(--_0x5b3af7){_0x4702ee['push'](_0x4702ee['shift']());}};_0x62ca7d(++_0xaf6a45);}(_0x7f3f,0x86));var _0xf7f3=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0x7f3f[_0x4f8f3b];return _0x4c250c;};'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('moment');var BPromise=require(_0xf7f3('0x0'));var Mustache=require(_0xf7f3('0x1'));var util=require('util');var path=require(_0xf7f3('0x2'));var sox=require(_0xf7f3('0x3'));var csv=require(_0xf7f3('0x4'));var ejs=require(_0xf7f3('0x5'));var fs=require('fs');var fs_extra=require(_0xf7f3('0x6'));var _=require(_0xf7f3('0x7'));var squel=require('squel');var crypto=require(_0xf7f3('0x8'));var jsforce=require(_0xf7f3('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xf7f3('0x4'));var querystring=require(_0xf7f3('0xa'));var Papa=require(_0xf7f3('0xb'));var Redis=require(_0xf7f3('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf7f3('0xd'));var hardwareService=require(_0xf7f3('0xe'));var logger=require(_0xf7f3('0xf'))('api');var utils=require(_0xf7f3('0x10'));var config=require(_0xf7f3('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xf7f3('0x12'))['db'];config[_0xf7f3('0x13')]=_[_0xf7f3('0x14')](config[_0xf7f3('0x13')],{'host':_0xf7f3('0x15'),'port':0x18eb});var socket=require(_0xf7f3('0x16'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xf7f3('0x17')](socket);function respondWithStatusCode(_0x1dadb9,_0x4fc752){_0x4fc752=_0x4fc752||0xcc;return function(_0x567a86){if(_0x567a86){return _0x1dadb9[_0xf7f3('0x18')](_0x4fc752);}return _0x1dadb9['status'](_0x4fc752)[_0xf7f3('0x19')]();};}function respondWithResult(_0x1c1c3e,_0x4ff844){_0x4ff844=_0x4ff844||0xc8;return function(_0x9ae23f){if(_0x9ae23f){return _0x1c1c3e['status'](_0x4ff844)[_0xf7f3('0x1a')](_0x9ae23f);}};}function respondWithFilteredResult(_0x47a3c8,_0x2e4c5a){return function(_0x117d6f){if(_0x117d6f){var _0x3a5dd7=typeof _0x2e4c5a[_0xf7f3('0x1b')]===_0xf7f3('0x1c')&&typeof _0x2e4c5a['limit']===_0xf7f3('0x1c');var _0x104c38=_0x117d6f[_0xf7f3('0x1d')];var _0x3416c0=_0x3a5dd7?0x0:_0x2e4c5a[_0xf7f3('0x1b')];var _0x4bc744=_0x3a5dd7?_0x117d6f[_0xf7f3('0x1d')]:_0x2e4c5a[_0xf7f3('0x1b')]+_0x2e4c5a[_0xf7f3('0x1e')];var _0x38f598;if(_0x4bc744>=_0x104c38){_0x4bc744=_0x104c38;_0x38f598=0xc8;}else{_0x38f598=0xce;}_0x47a3c8[_0xf7f3('0x1f')](_0x38f598);return _0x47a3c8[_0xf7f3('0x20')](_0xf7f3('0x21'),_0x3416c0+'-'+_0x4bc744+'/'+_0x104c38)['json'](_0x117d6f);}return null;};}function patchUpdates(_0xaa51b8){return function(_0x38f594){try{jsonpatch[_0xf7f3('0x22')](_0x38f594,_0xaa51b8,!![]);}catch(_0x34c825){return BPromise[_0xf7f3('0x23')](_0x34c825);}return _0x38f594[_0xf7f3('0x24')]();};}function saveUpdates(_0x317c0b,_0x84d23){return function(_0x42d9d8){if(_0x42d9d8){return _0x42d9d8[_0xf7f3('0x25')](_0x317c0b)[_0xf7f3('0x26')](function(_0x4294df){return _0x4294df;});}return null;};}function removeEntity(_0x5e11a0,_0x3a0f7e){return function(_0x26aefc){if(_0x26aefc){return _0x26aefc[_0xf7f3('0x27')]()[_0xf7f3('0x26')](function(){var _0x1db927=_0x26aefc['get']({'plain':!![]});var _0x4595e2='OpenchannelQueues';return db[_0xf7f3('0x28')][_0xf7f3('0x27')]({'where':{'type':_0x4595e2,'resourceId':_0x1db927['id']}})[_0xf7f3('0x26')](function(){return _0x26aefc;});})[_0xf7f3('0x26')](function(){_0x5e11a0[_0xf7f3('0x1f')](0xcc)[_0xf7f3('0x19')]();});}};}function handleEntityNotFound(_0x26d7d7,_0xb185b8){return function(_0x3ba11a){if(!_0x3ba11a){_0x26d7d7[_0xf7f3('0x18')](0x194);}return _0x3ba11a;};}function handleError(_0x7eef9d,_0x31abae){_0x31abae=_0x31abae||0x1f4;return function(_0x2a0e86){logger[_0xf7f3('0x29')](_0x2a0e86[_0xf7f3('0x2a')]);if(_0x2a0e86['name']){delete _0x2a0e86[_0xf7f3('0x2b')];}_0x7eef9d[_0xf7f3('0x1f')](_0x31abae)[_0xf7f3('0x2c')](_0x2a0e86);};}exports[_0xf7f3('0x2d')]=function(_0x1370ef,_0x3682f0){var _0x2a90e9={},_0xb6f15c={},_0x32279a={'count':0x0,'rows':[]};var _0x3285d7=_[_0xf7f3('0x2e')](db[_0xf7f3('0x2f')]['rawAttributes'],function(_0x5deb6d){return{'name':_0x5deb6d[_0xf7f3('0x30')],'type':_0x5deb6d[_0xf7f3('0x31')]['key']};});_0xb6f15c[_0xf7f3('0x32')]=_[_0xf7f3('0x2e')](_0x3285d7,_0xf7f3('0x2b'));_0xb6f15c[_0xf7f3('0x33')]=_[_0xf7f3('0x34')](_0x1370ef[_0xf7f3('0x33')]);_0xb6f15c[_0xf7f3('0x35')]=_[_0xf7f3('0x36')](_0xb6f15c[_0xf7f3('0x32')],_0xb6f15c['query']);_0x2a90e9['attributes']=_['intersection'](_0xb6f15c['model'],qs['fields'](_0x1370ef[_0xf7f3('0x33')][_0xf7f3('0x37')]));_0x2a90e9[_0xf7f3('0x38')]=_0x2a90e9[_0xf7f3('0x38')]['length']?_0x2a90e9['attributes']:_0xb6f15c['model'];if(!_0x1370ef[_0xf7f3('0x33')]['hasOwnProperty'](_0xf7f3('0x39'))){_0x2a90e9[_0xf7f3('0x1e')]=qs['limit'](_0x1370ef['query'][_0xf7f3('0x1e')]);_0x2a90e9[_0xf7f3('0x1b')]=qs['offset'](_0x1370ef[_0xf7f3('0x33')][_0xf7f3('0x1b')]);}_0x2a90e9[_0xf7f3('0x3a')]=qs[_0xf7f3('0x3b')](_0x1370ef[_0xf7f3('0x33')]['sort']);_0x2a90e9['where']=qs[_0xf7f3('0x35')](_['pick'](_0x1370ef[_0xf7f3('0x33')],_0xb6f15c[_0xf7f3('0x35')]),_0x3285d7);if(_0x1370ef[_0xf7f3('0x33')][_0xf7f3('0x3c')]){_0x2a90e9[_0xf7f3('0x3d')]=_['merge'](_0x2a90e9[_0xf7f3('0x3d')],{'$or':_[_0xf7f3('0x2e')](_0x3285d7,function(_0x546da1){if(_0x546da1[_0xf7f3('0x31')]!==_0xf7f3('0x3e')){var _0x1ee97a={};_0x1ee97a[_0x546da1['name']]={'$like':'%'+_0x1370ef[_0xf7f3('0x33')]['filter']+'%'};return _0x1ee97a;}})});}_0x2a90e9=_[_0xf7f3('0x3f')]({},_0x2a90e9,_0x1370ef[_0xf7f3('0x40')]);var _0x1fef06={'where':_0x2a90e9[_0xf7f3('0x3d')]};return db[_0xf7f3('0x2f')][_0xf7f3('0x1d')](_0x1fef06)['then'](function(_0x5357e2){_0x32279a[_0xf7f3('0x1d')]=_0x5357e2;if(_0x1370ef[_0xf7f3('0x33')]['includeAll']){_0x2a90e9['include']=[{'all':!![]}];}return db[_0xf7f3('0x2f')][_0xf7f3('0x41')](_0x2a90e9);})['then'](function(_0x4ebb14){_0x32279a[_0xf7f3('0x42')]=_0x4ebb14;return _0x32279a;})[_0xf7f3('0x26')](respondWithFilteredResult(_0x3682f0,_0x2a90e9))[_0xf7f3('0x43')](handleError(_0x3682f0,null));};exports[_0xf7f3('0x44')]=function(_0x108017,_0x5c8054){var _0x2465e9={'raw':!![],'where':{'id':_0x108017['params']['id']}},_0x1b74da={};_0x1b74da[_0xf7f3('0x32')]=_[_0xf7f3('0x34')](db[_0xf7f3('0x2f')][_0xf7f3('0x45')]);_0x1b74da[_0xf7f3('0x33')]=_[_0xf7f3('0x34')](_0x108017[_0xf7f3('0x33')]);_0x1b74da[_0xf7f3('0x35')]=_[_0xf7f3('0x36')](_0x1b74da['model'],_0x1b74da[_0xf7f3('0x33')]);_0x2465e9[_0xf7f3('0x38')]=_[_0xf7f3('0x36')](_0x1b74da[_0xf7f3('0x32')],qs['fields'](_0x108017[_0xf7f3('0x33')][_0xf7f3('0x37')]));_0x2465e9[_0xf7f3('0x38')]=_0x2465e9[_0xf7f3('0x38')][_0xf7f3('0x46')]?_0x2465e9[_0xf7f3('0x38')]:_0x1b74da[_0xf7f3('0x32')];if(_0x108017[_0xf7f3('0x33')][_0xf7f3('0x47')]){_0x2465e9[_0xf7f3('0x48')]=[{'all':!![]}];}_0x2465e9=_[_0xf7f3('0x3f')]({},_0x2465e9,_0x108017['options']);return db['OpenchannelQueue'][_0xf7f3('0x49')](_0x2465e9)[_0xf7f3('0x26')](handleEntityNotFound(_0x5c8054,null))[_0xf7f3('0x26')](respondWithResult(_0x5c8054,null))[_0xf7f3('0x43')](handleError(_0x5c8054,null));};exports[_0xf7f3('0x4a')]=function(_0x2170e7,_0x3b8c58){return db['OpenchannelQueue']['create'](_0x2170e7[_0xf7f3('0x4b')],{})[_0xf7f3('0x26')](function(_0x57560e){var _0x2e05c6=_0x2170e7[_0xf7f3('0x4c')]['get']({'plain':!![]});if(!_0x2e05c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e05c6[_0xf7f3('0x4d')]==='user'){var _0x32ec27=_0x57560e['get']({'plain':!![]});var _0xd823d7='OpenchannelQueues';return db[_0xf7f3('0x4e')][_0xf7f3('0x49')]({'where':{'name':_0xd823d7,'userProfileId':_0x2e05c6[_0xf7f3('0x4f')]},'raw':!![]})['then'](function(_0x4a63f5){if(_0x4a63f5&&_0x4a63f5[_0xf7f3('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x32ec27[_0xf7f3('0x2b')],'resourceId':_0x32ec27['id'],'type':_0x4a63f5[_0xf7f3('0x2b')],'sectionId':_0x4a63f5['id']},{})[_0xf7f3('0x26')](function(){return _0x57560e;});}else{return _0x57560e;}})[_0xf7f3('0x43')](function(_0x592b22){logger[_0xf7f3('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x592b22);throw _0x592b22;});}return _0x57560e;})[_0xf7f3('0x26')](respondWithResult(_0x3b8c58,0xc9))['catch'](handleError(_0x3b8c58,null));};exports['update']=function(_0x3644ad,_0x10c6ed){if(_0x3644ad[_0xf7f3('0x4b')]['id']){delete _0x3644ad[_0xf7f3('0x4b')]['id'];}return db[_0xf7f3('0x2f')][_0xf7f3('0x49')]({'where':{'id':_0x3644ad['params']['id']}})[_0xf7f3('0x26')](handleEntityNotFound(_0x10c6ed,null))['then'](saveUpdates(_0x3644ad['body'],null))[_0xf7f3('0x26')](respondWithResult(_0x10c6ed,null))[_0xf7f3('0x43')](handleError(_0x10c6ed,null));};exports[_0xf7f3('0x27')]=function(_0x50f391,_0x1bad8e){return db[_0xf7f3('0x2f')]['find']({'where':{'id':_0x50f391['params']['id']}})[_0xf7f3('0x26')](handleEntityNotFound(_0x1bad8e,null))[_0xf7f3('0x26')](removeEntity(_0x1bad8e,null))[_0xf7f3('0x43')](handleError(_0x1bad8e,null));};exports['describe']=function(_0x459096,_0x4cfecf){return db['OpenchannelQueue'][_0xf7f3('0x51')]()[_0xf7f3('0x26')](respondWithResult(_0x4cfecf,null))[_0xf7f3('0x43')](handleError(_0x4cfecf,null));};exports['getMembers']=function(_0x5a879c,_0x3b7978,_0x2c1c61){var _0x10836c={'raw':!![],'where':{}},_0xf3d6d4={},_0x674b9;return db[_0xf7f3('0x2f')]['findOne']({'where':{'id':_0x5a879c[_0xf7f3('0x52')]['id']}})[_0xf7f3('0x26')](handleEntityNotFound(_0x3b7978,null))[_0xf7f3('0x26')](function(_0x12020e){if(_0x12020e){_0x674b9=_0x12020e[_0xf7f3('0x53')]({'plain':!![]});_0xf3d6d4[_0xf7f3('0x32')]=_['keys'](db['UserOpenchannelQueue'][_0xf7f3('0x45')]);_0xf3d6d4[_0xf7f3('0x33')]=_[_0xf7f3('0x34')](_0x5a879c['query']);_0xf3d6d4['filters']=_[_0xf7f3('0x36')](_0xf3d6d4[_0xf7f3('0x32')],_0xf3d6d4[_0xf7f3('0x33')]);_0x10836c[_0xf7f3('0x38')]=_['intersection'](_0xf3d6d4[_0xf7f3('0x32')],qs[_0xf7f3('0x37')](_0x5a879c[_0xf7f3('0x33')]['fields']));_0x10836c[_0xf7f3('0x38')]=_0x10836c[_0xf7f3('0x38')][_0xf7f3('0x46')]?_0x10836c[_0xf7f3('0x38')]:_0xf3d6d4[_0xf7f3('0x32')];if(!_0x5a879c[_0xf7f3('0x33')][_0xf7f3('0x54')]('nolimit')){_0x10836c[_0xf7f3('0x1e')]=qs['limit'](_0x5a879c[_0xf7f3('0x33')][_0xf7f3('0x1e')]);_0x10836c['offset']=qs[_0xf7f3('0x1b')](_0x5a879c[_0xf7f3('0x33')][_0xf7f3('0x1b')]);}_0x10836c[_0xf7f3('0x3a')]=qs['sort'](_0x5a879c[_0xf7f3('0x33')][_0xf7f3('0x3b')]);_0x10836c['where']=qs['filters'](_['pick'](_0x5a879c['query'],_0xf3d6d4[_0xf7f3('0x35')]));_0x10836c[_0xf7f3('0x3d')][_0xf7f3('0x55')]=_0x12020e['id'];if(_0x5a879c[_0xf7f3('0x33')][_0xf7f3('0x3c')]){_0x10836c[_0xf7f3('0x3d')]=_[_0xf7f3('0x3f')](_0x10836c[_0xf7f3('0x3d')],{'$or':_[_0xf7f3('0x2e')](_0x10836c[_0xf7f3('0x38')],function(_0x573af3){var _0x1d1466={};_0x1d1466[_0x573af3]={'$like':'%'+_0x5a879c[_0xf7f3('0x33')][_0xf7f3('0x3c')]+'%'};return _0x1d1466;})});}_0x10836c=_['merge']({},_0x10836c,_0x5a879c[_0xf7f3('0x40')]);return db[_0xf7f3('0x56')][_0xf7f3('0x41')](_0x10836c);}})['then'](function(_0x30ad84){if(_0x30ad84){return db['User'][_0xf7f3('0x57')]({'where':{'id':_[_0xf7f3('0x2e')](_0x30ad84,_0xf7f3('0x58')),'role':_0xf7f3('0x59')},'attributes':['id','name',_0xf7f3('0x5a'),'updatedAt',_0xf7f3('0x5b')]});}})[_0xf7f3('0x26')](function(_0x5df963){if(_0x5df963){return{'count':_0x5df963[_0xf7f3('0x1d')],'rows':_[_0xf7f3('0x2e')](_0x5df963[_0xf7f3('0x42')],function(_0x1e89ad){return{'membername':_0x1e89ad['name'],'UserId':_0x1e89ad['id'],'queue_name':_0x674b9[_0xf7f3('0x2b')],'OpenchannelQueueId':_0x674b9['id'],'interface':util[_0xf7f3('0x5c')](_0xf7f3('0x5d'),_0xf7f3('0x5e'),_0x1e89ad[_0xf7f3('0x2b')]),'penalty':0x0,'paused':_0x1e89ad[_0xf7f3('0x5a')],'createdAt':_0x1e89ad[_0xf7f3('0x5b')],'updatedAt':_0x1e89ad['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf7f3('0x26')](respondWithFilteredResult(_0x3b7978,_0x10836c))['catch'](handleError(_0x3b7978,null));};exports[_0xf7f3('0x5f')]=function(_0x23a5d5,_0x1b78f8,_0x25c346){var _0x5b5791={};var _0x2453c3={};var _0x18368d;var _0x186c07;return db['OpenchannelQueue'][_0xf7f3('0x60')]({'where':{'id':_0x23a5d5[_0xf7f3('0x52')]['id']}})[_0xf7f3('0x26')](handleEntityNotFound(_0x1b78f8,null))[_0xf7f3('0x26')](function(_0x3d11c1){if(_0x3d11c1){_0x18368d=_0x3d11c1;_0x2453c3[_0xf7f3('0x32')]=_[_0xf7f3('0x34')](db[_0xf7f3('0x61')][_0xf7f3('0x45')]);_0x2453c3[_0xf7f3('0x33')]=_[_0xf7f3('0x34')](_0x23a5d5[_0xf7f3('0x33')]);_0x2453c3['filters']=_[_0xf7f3('0x36')](_0x2453c3[_0xf7f3('0x32')],_0x2453c3['query']);_0x5b5791[_0xf7f3('0x38')]=_[_0xf7f3('0x36')](_0x2453c3[_0xf7f3('0x32')],qs[_0xf7f3('0x37')](_0x23a5d5[_0xf7f3('0x33')]['fields']));_0x5b5791[_0xf7f3('0x38')]=_0x5b5791[_0xf7f3('0x38')]['length']?_0x5b5791[_0xf7f3('0x38')]:_0x2453c3['model'];_0x5b5791['order']=qs[_0xf7f3('0x3b')](_0x23a5d5['query']['sort']);_0x5b5791[_0xf7f3('0x3d')]=qs['filters'](_['pick'](_0x23a5d5[_0xf7f3('0x33')],_0x2453c3[_0xf7f3('0x35')]));if(_0x23a5d5[_0xf7f3('0x33')]['filter']){_0x5b5791[_0xf7f3('0x3d')]=_[_0xf7f3('0x3f')](_0x5b5791[_0xf7f3('0x3d')],{'$or':_[_0xf7f3('0x2e')](_0x5b5791[_0xf7f3('0x38')],function(_0x1dbde9){var _0x2fdc77={};_0x2fdc77[_0x1dbde9]={'$like':'%'+_0x23a5d5[_0xf7f3('0x33')][_0xf7f3('0x3c')]+'%'};return _0x2fdc77;})});}_0x5b5791=_[_0xf7f3('0x3f')]({},_0x5b5791,_0x23a5d5[_0xf7f3('0x40')]);return _0x18368d[_0xf7f3('0x5f')](_0x5b5791);}})[_0xf7f3('0x26')](function(_0x584aa4){if(_0x584aa4){_0x186c07=_0x584aa4[_0xf7f3('0x46')];if(!_0x23a5d5[_0xf7f3('0x33')][_0xf7f3('0x54')](_0xf7f3('0x39'))){_0x5b5791['limit']=qs['limit'](_0x23a5d5['query'][_0xf7f3('0x1e')]);_0x5b5791[_0xf7f3('0x1b')]=qs[_0xf7f3('0x1b')](_0x23a5d5[_0xf7f3('0x33')]['offset']);}return _0x18368d['getTeams'](_0x5b5791);}})[_0xf7f3('0x26')](function(_0x151cef){if(_0x151cef){return _0x151cef?{'count':_0x186c07,'rows':_0x151cef}:null;}})[_0xf7f3('0x26')](respondWithResult(_0x1b78f8,null))['catch'](handleError(_0x1b78f8,null));};exports[_0xf7f3('0x62')]=function(_0x14b6cb,_0x5815d0,_0x2609bb){var _0x51fd6d=_0x14b6cb[_0xf7f3('0x4b')][_0xf7f3('0x63')];return db[_0xf7f3('0x61')]['findAll']({'where':{'id':_0x51fd6d},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf7f3('0x64'),'attributes':['id',_0xf7f3('0x2b'),'online','voicePause','interface'],'raw':!![]}]})[_0xf7f3('0x26')](function(_0x417ab4){if(_0x417ab4){var _0xb0f521=_['flatMap'](_0x417ab4,function(_0x2e037c){var _0x2f21fd=_0x2e037c[_0xf7f3('0x53')]({'plain':!![]});return _0x2f21fd[_0xf7f3('0x64')];});return db[_0xf7f3('0x2f')]['find']({'where':{'id':_0x14b6cb[_0xf7f3('0x52')]['id']}})[_0xf7f3('0x26')](function(_0x340a4a){return db[_0xf7f3('0x65')]['transaction'](function(_0x195ea3){return _0x340a4a[_0xf7f3('0x62')](_0x51fd6d,{'transaction':_0x195ea3})[_0xf7f3('0x26')](function(){return BPromise[_0xf7f3('0x66')](_0xb0f521,function(_0x515733){return db[_0xf7f3('0x56')][_0xf7f3('0x67')]({'where':{'UserId':_0x515733['id'],'OpenchannelQueueId':_0x14b6cb['params']['id']},'transaction':_0x195ea3});});})[_0xf7f3('0x26')](function(){_0xb0f521[_0xf7f3('0x68')](function(_0x80c2ae){socket['emit'](_0xf7f3('0x69'),{'UserId':_0x80c2ae['id'],'OpenchannelQueueId':_0x340a4a['id']});});});});});}})[_0xf7f3('0x26')](respondWithStatusCode(_0x5815d0,null))[_0xf7f3('0x43')](handleError(_0x5815d0,null));};exports[_0xf7f3('0x6a')]=function(_0x56bbce,_0x9e42a1,_0x5342d9){return db[_0xf7f3('0x61')][_0xf7f3('0x41')]({'where':{'id':_0x56bbce[_0xf7f3('0x33')][_0xf7f3('0x63')]},'attributes':['id'],'include':[{'model':db[_0xf7f3('0x6b')],'as':_0xf7f3('0x64'),'attributes':['id'],'raw':!![]}]})[_0xf7f3('0x26')](handleEntityNotFound(_0x9e42a1,null))[_0xf7f3('0x26')](function(_0x45822){var _0x4b3e6f=_[_0xf7f3('0x2e')](_0x45822,'id');var _0x4b8684=[];var _0xb05289=[];var _0x433aa2=squel['select']();_0x433aa2[_0xf7f3('0x6c')]('tq.TeamId')[_0xf7f3('0x6d')]('team_has_openchannel_queues','tq')[_0xf7f3('0x6e')](_0xf7f3('0x6f'),'ut',_0xf7f3('0x70'))['where'](_0xf7f3('0x71'),_0x56bbce[_0xf7f3('0x52')]['id']);for(var _0x517cf1=0x0;_0x517cf1<_0x45822[_0xf7f3('0x46')];_0x517cf1+=0x1){let _0x3555f2=_0x45822[_0x517cf1];for(var _0x50b763=0x0;_0x50b763<_0x3555f2[_0xf7f3('0x64')][_0xf7f3('0x46')];_0x50b763+=0x1){let _0x5e7673=_0x3555f2[_0xf7f3('0x64')][_0x50b763];var _0x23b2a2=_0x433aa2[_0xf7f3('0x72')]();_0x23b2a2['where'](_0xf7f3('0x73'),_0x5e7673['id']);_0xb05289[_0xf7f3('0x74')](db[_0xf7f3('0x65')][_0xf7f3('0x33')](_0x23b2a2[_0xf7f3('0x75')](),{'type':db[_0xf7f3('0x65')][_0xf7f3('0x76')][_0xf7f3('0x77')]})[_0xf7f3('0x26')](function(_0x24832a){if(_0x24832a['length']===0x1){return _0x5e7673['id'];}else{var _0x57253b=_['every'](_['map'](_0x24832a,'TeamId'),function(_0x54626e){return _[_0xf7f3('0x78')](_0x4b3e6f,_0x54626e);});if(_0x57253b){return _0x5e7673['id'];}}}));}}return BPromise[_0xf7f3('0x79')](_0xb05289)['then'](function(_0x39c498){_0x4b8684=_(_0x4b8684)['union'](_0x39c498)[_0xf7f3('0x7a')]()[_0xf7f3('0x7b')]();return db[_0xf7f3('0x2f')][_0xf7f3('0x49')]({'where':{'id':_0x56bbce[_0xf7f3('0x52')]['id']}})[_0xf7f3('0x26')](function(_0x531f2d){return db[_0xf7f3('0x65')][_0xf7f3('0x7c')](function(_0x536c6f){return _0x531f2d[_0xf7f3('0x6a')](_0x56bbce[_0xf7f3('0x33')][_0xf7f3('0x63')],{'transaction':_0x536c6f})['then'](function(){if(!_[_0xf7f3('0x7d')](_0x4b8684)){return _0x531f2d[_0xf7f3('0x7e')](_0x4b8684,{'transaction':_0x536c6f});}})[_0xf7f3('0x26')](function(){_0x4b8684[_0xf7f3('0x68')](function(_0x49c807){socket[_0xf7f3('0x7f')](_0xf7f3('0x80'),{'UserId':_0x49c807,'OpenchannelQueueId':_0x531f2d['id']});});});});});});})['then'](respondWithStatusCode(_0x9e42a1,null))[_0xf7f3('0x43')](handleError(_0x9e42a1,null));};exports[_0xf7f3('0x81')]=function(_0x400247,_0x55078e,_0x45ea06){return db['OpenchannelQueue'][_0xf7f3('0x49')]({'where':{'id':_0x400247[_0xf7f3('0x52')]['id']}})[_0xf7f3('0x26')](handleEntityNotFound(_0x55078e,null))['then'](function(_0x580b11){if(_0x580b11){return _0x580b11[_0xf7f3('0x81')](_0x400247[_0xf7f3('0x4b')][_0xf7f3('0x63')],_['omit'](_0x400247[_0xf7f3('0x4b')],['ids','id'])||{})[_0xf7f3('0x82')](function(_0x2f8b97){for(var _0x275283=0x0;_0x275283<_0x400247['body']['ids'][_0xf7f3('0x46')];_0x275283+=0x1){socket[_0xf7f3('0x7f')]('userOpenchannelQueue:save',{'UserId':Number(_0x400247['body'][_0xf7f3('0x63')][_0x275283]),'OpenchannelQueueId':Number(_0x400247[_0xf7f3('0x52')]['id'])});}return _0x2f8b97;});}})[_0xf7f3('0x26')](respondWithResult(_0x55078e,null))['catch'](handleError(_0x55078e,null));};exports[_0xf7f3('0x7e')]=function(_0x1af5f0,_0x8d8c5,_0x1a3342){return db[_0xf7f3('0x2f')][_0xf7f3('0x49')]({'where':{'id':_0x1af5f0[_0xf7f3('0x52')]['id']}})['then'](handleEntityNotFound(_0x8d8c5,null))[_0xf7f3('0x26')](function(_0x3f87f7){if(_0x3f87f7){return _0x3f87f7['removeAgents'](_0x1af5f0[_0xf7f3('0x33')]['ids'])[_0xf7f3('0x26')](function(){if(_[_0xf7f3('0x83')](_0x1af5f0[_0xf7f3('0x33')]['ids'])){for(var _0xb1fd97=0x0;_0xb1fd97<_0x1af5f0[_0xf7f3('0x33')]['ids']['length'];_0xb1fd97+=0x1){socket[_0xf7f3('0x7f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x1af5f0['query']['ids'][_0xb1fd97]),'OpenchannelQueueId':Number(_0x1af5f0[_0xf7f3('0x52')]['id'])});}}else{socket[_0xf7f3('0x7f')](_0xf7f3('0x80'),{'UserId':Number(_0x1af5f0['query'][_0xf7f3('0x63')]),'OpenchannelQueueId':Number(_0x1af5f0[_0xf7f3('0x52')]['id'])});}});}})[_0xf7f3('0x26')](respondWithStatusCode(_0x8d8c5,null))[_0xf7f3('0x43')](handleError(_0x8d8c5,null));};exports[_0xf7f3('0x84')]=function(_0x20d517,_0x2328b8,_0x109875){var _0x520718={};var _0x54fa7c={};var _0x22b169;var _0x27c110;return db[_0xf7f3('0x2f')][_0xf7f3('0x60')]({'where':{'id':_0x20d517[_0xf7f3('0x52')]['id']}})[_0xf7f3('0x26')](handleEntityNotFound(_0x2328b8,null))[_0xf7f3('0x26')](function(_0x3e766c){if(_0x3e766c){_0x22b169=_0x3e766c;_0x54fa7c['model']=_['keys'](db[_0xf7f3('0x6b')][_0xf7f3('0x45')]);_0x54fa7c[_0xf7f3('0x33')]=_[_0xf7f3('0x34')](_0x20d517[_0xf7f3('0x33')]);_0x54fa7c['filters']=_[_0xf7f3('0x36')](_0x54fa7c['model'],_0x54fa7c[_0xf7f3('0x33')]);_0x520718[_0xf7f3('0x38')]=_[_0xf7f3('0x36')](_0x54fa7c['model'],qs[_0xf7f3('0x37')](_0x20d517[_0xf7f3('0x33')][_0xf7f3('0x37')]));_0x520718[_0xf7f3('0x38')]=_0x520718[_0xf7f3('0x38')][_0xf7f3('0x46')]?_0x520718[_0xf7f3('0x38')]:_0x54fa7c[_0xf7f3('0x32')];_0x520718['order']=qs[_0xf7f3('0x3b')](_0x20d517[_0xf7f3('0x33')][_0xf7f3('0x3b')]);_0x520718['where']=qs[_0xf7f3('0x35')](_[_0xf7f3('0x85')](_0x20d517[_0xf7f3('0x33')],_0x54fa7c['filters']));if(_0x20d517[_0xf7f3('0x33')][_0xf7f3('0x3c')]){_0x520718['where']=_['merge'](_0x520718[_0xf7f3('0x3d')],{'$or':_['map'](_0x520718[_0xf7f3('0x38')],function(_0x56e6f0){var _0x4119b5={};_0x4119b5[_0x56e6f0]={'$like':'%'+_0x20d517[_0xf7f3('0x33')][_0xf7f3('0x3c')]+'%'};return _0x4119b5;})});}_0x520718=_['merge']({},_0x520718,_0x20d517[_0xf7f3('0x40')]);return _0x22b169['getAgents'](_0x520718);}})[_0xf7f3('0x26')](function(_0x25e7b1){if(_0x25e7b1){_0x27c110=_0x25e7b1[_0xf7f3('0x46')];if(!_0x20d517[_0xf7f3('0x33')]['hasOwnProperty'](_0xf7f3('0x39'))){_0x520718[_0xf7f3('0x1e')]=qs[_0xf7f3('0x1e')](_0x20d517[_0xf7f3('0x33')][_0xf7f3('0x1e')]);_0x520718[_0xf7f3('0x1b')]=qs[_0xf7f3('0x1b')](_0x20d517[_0xf7f3('0x33')][_0xf7f3('0x1b')]);}return _0x22b169[_0xf7f3('0x84')](_0x520718);}})['then'](function(_0x396a9a){if(_0x396a9a){return _0x396a9a?{'count':_0x27c110,'rows':_0x396a9a}:null;}})['then'](respondWithResult(_0x2328b8,null))[_0xf7f3('0x43')](handleError(_0x2328b8,null));}; \ No newline at end of file +var _0x482f=['rows','catch','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','describe','getMembers','findOne','pick','options','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','removeTeams','Team','tq.TeamId','from','team_has_openchannel_queues','join','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','compact','value','userOpenchannelQueue:remove','addAgents','spread','userOpenchannelQueue:save','removeAgents','emit','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','get','OpenchannelQueues','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','OpenchannelQueue','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll'];(function(_0x194b1b,_0x443375){var _0x5830c5=function(_0x344ac2){while(--_0x344ac2){_0x194b1b['push'](_0x194b1b['shift']());}};_0x5830c5(++_0x443375);}(_0x482f,0x1cc));var _0xf482=function(_0x544ab5,_0x26d0ab){_0x544ab5=_0x544ab5-0x0;var _0x3cee2c=_0x482f[_0x544ab5];return _0x3cee2c;};'use strict';var emlformat=require(_0xf482('0x0'));var rimraf=require(_0xf482('0x1'));var zipdir=require(_0xf482('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf482('0x3'));var moment=require('moment');var BPromise=require(_0xf482('0x4'));var Mustache=require('mustache');var util=require(_0xf482('0x5'));var path=require(_0xf482('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf482('0x7'));var fs=require('fs');var fs_extra=require(_0xf482('0x8'));var _=require(_0xf482('0x9'));var squel=require(_0xf482('0xa'));var crypto=require(_0xf482('0xb'));var jsforce=require(_0xf482('0xc'));var deskjs=require(_0xf482('0xd'));var toCsv=require(_0xf482('0xe'));var querystring=require(_0xf482('0xf'));var Papa=require('papaparse');var Redis=require(_0xf482('0x10'));var authService=require(_0xf482('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf482('0x12'));var logger=require(_0xf482('0x13'))(_0xf482('0x14'));var utils=require(_0xf482('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf482('0x16'))['db'];config[_0xf482('0x17')]=_[_0xf482('0x18')](config[_0xf482('0x17')],{'host':_0xf482('0x19'),'port':0x18eb});var socket=require(_0xf482('0x1a'))(new Redis(config[_0xf482('0x17')]));require(_0xf482('0x1b'))['register'](socket);function respondWithStatusCode(_0x13d1f5,_0x3313b8){_0x3313b8=_0x3313b8||0xcc;return function(_0x259cc4){if(_0x259cc4){return _0x13d1f5['sendStatus'](_0x3313b8);}return _0x13d1f5[_0xf482('0x1c')](_0x3313b8)[_0xf482('0x1d')]();};}function respondWithResult(_0x5924be,_0x1be940){_0x1be940=_0x1be940||0xc8;return function(_0x21c0cc){if(_0x21c0cc){return _0x5924be[_0xf482('0x1c')](_0x1be940)[_0xf482('0x1e')](_0x21c0cc);}};}function respondWithFilteredResult(_0x21634c,_0x39b794){return function(_0x5eab14){if(_0x5eab14){var _0x563c81=typeof _0x39b794[_0xf482('0x1f')]===_0xf482('0x20')&&typeof _0x39b794[_0xf482('0x21')]===_0xf482('0x20');var _0x2081d0=_0x5eab14['count'];var _0x5ad783=_0x563c81?0x0:_0x39b794['offset'];var _0x3f7ddd=_0x563c81?_0x5eab14[_0xf482('0x22')]:_0x39b794[_0xf482('0x1f')]+_0x39b794[_0xf482('0x21')];var _0x5e230f;if(_0x3f7ddd>=_0x2081d0){_0x3f7ddd=_0x2081d0;_0x5e230f=0xc8;}else{_0x5e230f=0xce;}_0x21634c[_0xf482('0x1c')](_0x5e230f);return _0x21634c[_0xf482('0x23')]('Content-Range',_0x5ad783+'-'+_0x3f7ddd+'/'+_0x2081d0)[_0xf482('0x1e')](_0x5eab14);}return null;};}function patchUpdates(_0x5e6a03){return function(_0x1af64d){try{jsonpatch[_0xf482('0x24')](_0x1af64d,_0x5e6a03,!![]);}catch(_0x5a2492){return BPromise[_0xf482('0x25')](_0x5a2492);}return _0x1af64d['save']();};}function saveUpdates(_0x1cc6d9,_0xef4b2f){return function(_0x16cea9){if(_0x16cea9){return _0x16cea9[_0xf482('0x26')](_0x1cc6d9)[_0xf482('0x27')](function(_0xa5dde6){return _0xa5dde6;});}return null;};}function removeEntity(_0x1d773b,_0x36126b){return function(_0x4500b7){if(_0x4500b7){return _0x4500b7['destroy']()['then'](function(){var _0x497a05=_0x4500b7[_0xf482('0x28')]({'plain':!![]});var _0x329d89=_0xf482('0x29');return db[_0xf482('0x2a')][_0xf482('0x2b')]({'where':{'type':_0x329d89,'resourceId':_0x497a05['id']}})[_0xf482('0x27')](function(){return _0x4500b7;});})[_0xf482('0x27')](function(){_0x1d773b[_0xf482('0x1c')](0xcc)[_0xf482('0x1d')]();});}};}function handleEntityNotFound(_0x5c4cd1,_0x5a4c5d){return function(_0x130794){if(!_0x130794){_0x5c4cd1[_0xf482('0x2c')](0x194);}return _0x130794;};}function handleError(_0x4a6699,_0x38a073){_0x38a073=_0x38a073||0x1f4;return function(_0x33c3b4){logger[_0xf482('0x2d')](_0x33c3b4[_0xf482('0x2e')]);if(_0x33c3b4[_0xf482('0x2f')]){delete _0x33c3b4['name'];}_0x4a6699[_0xf482('0x1c')](_0x38a073)['send'](_0x33c3b4);};}exports[_0xf482('0x30')]=function(_0x1c9c14,_0x122089){var _0x3d17cb={},_0x2ab581={},_0x27b3b0={'count':0x0,'rows':[]};var _0x4333b8=_[_0xf482('0x31')](db[_0xf482('0x32')]['rawAttributes'],function(_0x11c70b){return{'name':_0x11c70b[_0xf482('0x33')],'type':_0x11c70b[_0xf482('0x34')][_0xf482('0x35')]};});_0x2ab581['model']=_[_0xf482('0x31')](_0x4333b8,_0xf482('0x2f'));_0x2ab581[_0xf482('0x36')]=_[_0xf482('0x37')](_0x1c9c14[_0xf482('0x36')]);_0x2ab581[_0xf482('0x38')]=_[_0xf482('0x39')](_0x2ab581['model'],_0x2ab581[_0xf482('0x36')]);_0x3d17cb[_0xf482('0x3a')]=_['intersection'](_0x2ab581[_0xf482('0x3b')],qs[_0xf482('0x3c')](_0x1c9c14[_0xf482('0x36')][_0xf482('0x3c')]));_0x3d17cb[_0xf482('0x3a')]=_0x3d17cb['attributes'][_0xf482('0x3d')]?_0x3d17cb[_0xf482('0x3a')]:_0x2ab581[_0xf482('0x3b')];if(!_0x1c9c14['query'][_0xf482('0x3e')](_0xf482('0x3f'))){_0x3d17cb[_0xf482('0x21')]=qs[_0xf482('0x21')](_0x1c9c14['query'][_0xf482('0x21')]);_0x3d17cb[_0xf482('0x1f')]=qs[_0xf482('0x1f')](_0x1c9c14['query'][_0xf482('0x1f')]);}_0x3d17cb[_0xf482('0x40')]=qs[_0xf482('0x41')](_0x1c9c14[_0xf482('0x36')][_0xf482('0x41')]);_0x3d17cb[_0xf482('0x42')]=qs['filters'](_['pick'](_0x1c9c14[_0xf482('0x36')],_0x2ab581[_0xf482('0x38')]),_0x4333b8);if(_0x1c9c14[_0xf482('0x36')][_0xf482('0x43')]){_0x3d17cb['where']=_[_0xf482('0x44')](_0x3d17cb[_0xf482('0x42')],{'$or':_['map'](_0x4333b8,function(_0x3937d7){if(_0x3937d7[_0xf482('0x34')]!=='VIRTUAL'){var _0x1695d4={};_0x1695d4[_0x3937d7[_0xf482('0x2f')]]={'$like':'%'+_0x1c9c14[_0xf482('0x36')]['filter']+'%'};return _0x1695d4;}})});}_0x3d17cb=_['merge']({},_0x3d17cb,_0x1c9c14['options']);var _0x16ea68={'where':_0x3d17cb[_0xf482('0x42')]};return db['OpenchannelQueue']['count'](_0x16ea68)['then'](function(_0x4e4700){_0x27b3b0[_0xf482('0x22')]=_0x4e4700;if(_0x1c9c14[_0xf482('0x36')][_0xf482('0x45')]){_0x3d17cb[_0xf482('0x46')]=[{'all':!![]}];}return db[_0xf482('0x32')][_0xf482('0x47')](_0x3d17cb);})[_0xf482('0x27')](function(_0x25a309){_0x27b3b0[_0xf482('0x48')]=_0x25a309;return _0x27b3b0;})['then'](respondWithFilteredResult(_0x122089,_0x3d17cb))[_0xf482('0x49')](handleError(_0x122089,null));};exports['show']=function(_0x25a158,_0x2e0316){var _0x3bd0fe={'raw':!![],'where':{'id':_0x25a158['params']['id']}},_0x130227={};_0x130227[_0xf482('0x3b')]=_['keys'](db['OpenchannelQueue'][_0xf482('0x4a')]);_0x130227[_0xf482('0x36')]=_['keys'](_0x25a158['query']);_0x130227[_0xf482('0x38')]=_['intersection'](_0x130227[_0xf482('0x3b')],_0x130227[_0xf482('0x36')]);_0x3bd0fe[_0xf482('0x3a')]=_[_0xf482('0x39')](_0x130227[_0xf482('0x3b')],qs[_0xf482('0x3c')](_0x25a158[_0xf482('0x36')][_0xf482('0x3c')]));_0x3bd0fe[_0xf482('0x3a')]=_0x3bd0fe[_0xf482('0x3a')]['length']?_0x3bd0fe['attributes']:_0x130227[_0xf482('0x3b')];if(_0x25a158[_0xf482('0x36')][_0xf482('0x45')]){_0x3bd0fe[_0xf482('0x46')]=[{'all':!![]}];}_0x3bd0fe=_['merge']({},_0x3bd0fe,_0x25a158['options']);return db['OpenchannelQueue'][_0xf482('0x4b')](_0x3bd0fe)[_0xf482('0x27')](handleEntityNotFound(_0x2e0316,null))['then'](respondWithResult(_0x2e0316,null))['catch'](handleError(_0x2e0316,null));};exports[_0xf482('0x4c')]=function(_0x3e51bc,_0x41849e){return db[_0xf482('0x32')][_0xf482('0x4c')](_0x3e51bc[_0xf482('0x4d')],{})[_0xf482('0x27')](function(_0x2ba9d6){var _0xbbb6fa=_0x3e51bc[_0xf482('0x4e')][_0xf482('0x28')]({'plain':!![]});if(!_0xbbb6fa)throw new Error(_0xf482('0x4f'));if(_0xbbb6fa[_0xf482('0x50')]===_0xf482('0x4e')){var _0x3369bc=_0x2ba9d6[_0xf482('0x28')]({'plain':!![]});var _0x1db128=_0xf482('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x1db128,'userProfileId':_0xbbb6fa[_0xf482('0x51')]},'raw':!![]})['then'](function(_0x516de4){if(_0x516de4&&_0x516de4[_0xf482('0x52')]===0x0){return db[_0xf482('0x2a')][_0xf482('0x4c')]({'name':_0x3369bc[_0xf482('0x2f')],'resourceId':_0x3369bc['id'],'type':_0x516de4[_0xf482('0x2f')],'sectionId':_0x516de4['id']},{})[_0xf482('0x27')](function(){return _0x2ba9d6;});}else{return _0x2ba9d6;}})[_0xf482('0x49')](function(_0x188bde){logger[_0xf482('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x188bde);throw _0x188bde;});}return _0x2ba9d6;})[_0xf482('0x27')](respondWithResult(_0x41849e,0xc9))['catch'](handleError(_0x41849e,null));};exports['update']=function(_0xe5bc8,_0x12b2bf){if(_0xe5bc8[_0xf482('0x4d')]['id']){delete _0xe5bc8[_0xf482('0x4d')]['id'];}return db[_0xf482('0x32')][_0xf482('0x4b')]({'where':{'id':_0xe5bc8[_0xf482('0x53')]['id']}})['then'](handleEntityNotFound(_0x12b2bf,null))[_0xf482('0x27')](saveUpdates(_0xe5bc8['body'],null))[_0xf482('0x27')](respondWithResult(_0x12b2bf,null))['catch'](handleError(_0x12b2bf,null));};exports[_0xf482('0x2b')]=function(_0x4c2c52,_0x54b81a){return db['OpenchannelQueue'][_0xf482('0x4b')]({'where':{'id':_0x4c2c52['params']['id']}})[_0xf482('0x27')](handleEntityNotFound(_0x54b81a,null))['then'](removeEntity(_0x54b81a,null))[_0xf482('0x49')](handleError(_0x54b81a,null));};exports[_0xf482('0x54')]=function(_0x5431a7,_0x448128){return db['OpenchannelQueue']['describe']()[_0xf482('0x27')](respondWithResult(_0x448128,null))['catch'](handleError(_0x448128,null));};exports[_0xf482('0x55')]=function(_0x26a776,_0x164298,_0x370f93){var _0x904c85={'raw':!![],'where':{}},_0x95be02={},_0x7a2e8c;return db['OpenchannelQueue'][_0xf482('0x56')]({'where':{'id':_0x26a776[_0xf482('0x53')]['id']}})['then'](handleEntityNotFound(_0x164298,null))[_0xf482('0x27')](function(_0x52e795){if(_0x52e795){_0x7a2e8c=_0x52e795['get']({'plain':!![]});_0x95be02[_0xf482('0x3b')]=_[_0xf482('0x37')](db['UserOpenchannelQueue'][_0xf482('0x4a')]);_0x95be02[_0xf482('0x36')]=_['keys'](_0x26a776[_0xf482('0x36')]);_0x95be02[_0xf482('0x38')]=_[_0xf482('0x39')](_0x95be02['model'],_0x95be02['query']);_0x904c85[_0xf482('0x3a')]=_[_0xf482('0x39')](_0x95be02[_0xf482('0x3b')],qs['fields'](_0x26a776[_0xf482('0x36')]['fields']));_0x904c85['attributes']=_0x904c85[_0xf482('0x3a')][_0xf482('0x3d')]?_0x904c85[_0xf482('0x3a')]:_0x95be02[_0xf482('0x3b')];if(!_0x26a776['query']['hasOwnProperty'](_0xf482('0x3f'))){_0x904c85[_0xf482('0x21')]=qs[_0xf482('0x21')](_0x26a776[_0xf482('0x36')][_0xf482('0x21')]);_0x904c85[_0xf482('0x1f')]=qs[_0xf482('0x1f')](_0x26a776[_0xf482('0x36')]['offset']);}_0x904c85['order']=qs[_0xf482('0x41')](_0x26a776[_0xf482('0x36')][_0xf482('0x41')]);_0x904c85[_0xf482('0x42')]=qs[_0xf482('0x38')](_[_0xf482('0x57')](_0x26a776[_0xf482('0x36')],_0x95be02[_0xf482('0x38')]));_0x904c85['where']['OpenchannelQueueId']=_0x52e795['id'];if(_0x26a776['query'][_0xf482('0x43')]){_0x904c85[_0xf482('0x42')]=_[_0xf482('0x44')](_0x904c85[_0xf482('0x42')],{'$or':_['map'](_0x904c85[_0xf482('0x3a')],function(_0x478800){var _0x1b67e2={};_0x1b67e2[_0x478800]={'$like':'%'+_0x26a776[_0xf482('0x36')][_0xf482('0x43')]+'%'};return _0x1b67e2;})});}_0x904c85=_['merge']({},_0x904c85,_0x26a776[_0xf482('0x58')]);return db[_0xf482('0x59')][_0xf482('0x47')](_0x904c85);}})[_0xf482('0x27')](function(_0x40314c){if(_0x40314c){return db[_0xf482('0x5a')][_0xf482('0x5b')]({'where':{'id':_[_0xf482('0x31')](_0x40314c,_0xf482('0x5c')),'role':_0xf482('0x5d')},'attributes':['id',_0xf482('0x2f'),_0xf482('0x5e'),_0xf482('0x5f'),_0xf482('0x60')]});}})[_0xf482('0x27')](function(_0x56404d){if(_0x56404d){return{'count':_0x56404d[_0xf482('0x22')],'rows':_['map'](_0x56404d['rows'],function(_0x14b6b7){return{'membername':_0x14b6b7[_0xf482('0x2f')],'UserId':_0x14b6b7['id'],'queue_name':_0x7a2e8c['name'],'OpenchannelQueueId':_0x7a2e8c['id'],'interface':util[_0xf482('0x61')](_0xf482('0x62'),'SIP',_0x14b6b7[_0xf482('0x2f')]),'penalty':0x0,'paused':_0x14b6b7[_0xf482('0x5e')],'createdAt':_0x14b6b7[_0xf482('0x60')],'updatedAt':_0x14b6b7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x164298,_0x904c85))[_0xf482('0x49')](handleError(_0x164298,null));};exports['getTeams']=function(_0x24a069,_0x16e6c5,_0x1efd3f){var _0x3988c4={};var _0x3142b1={};var _0x1b98ac;var _0x49cf58;return db[_0xf482('0x32')]['findOne']({'where':{'id':_0x24a069['params']['id']}})['then'](handleEntityNotFound(_0x16e6c5,null))[_0xf482('0x27')](function(_0x415a3d){if(_0x415a3d){_0x1b98ac=_0x415a3d;_0x3142b1[_0xf482('0x3b')]=_[_0xf482('0x37')](db['Team']['rawAttributes']);_0x3142b1[_0xf482('0x36')]=_[_0xf482('0x37')](_0x24a069[_0xf482('0x36')]);_0x3142b1[_0xf482('0x38')]=_[_0xf482('0x39')](_0x3142b1['model'],_0x3142b1[_0xf482('0x36')]);_0x3988c4[_0xf482('0x3a')]=_[_0xf482('0x39')](_0x3142b1[_0xf482('0x3b')],qs[_0xf482('0x3c')](_0x24a069[_0xf482('0x36')][_0xf482('0x3c')]));_0x3988c4[_0xf482('0x3a')]=_0x3988c4[_0xf482('0x3a')][_0xf482('0x3d')]?_0x3988c4[_0xf482('0x3a')]:_0x3142b1['model'];_0x3988c4['order']=qs[_0xf482('0x41')](_0x24a069['query'][_0xf482('0x41')]);_0x3988c4[_0xf482('0x42')]=qs[_0xf482('0x38')](_[_0xf482('0x57')](_0x24a069[_0xf482('0x36')],_0x3142b1['filters']));if(_0x24a069[_0xf482('0x36')][_0xf482('0x43')]){_0x3988c4[_0xf482('0x42')]=_[_0xf482('0x44')](_0x3988c4[_0xf482('0x42')],{'$or':_[_0xf482('0x31')](_0x3988c4[_0xf482('0x3a')],function(_0x5cbebb){var _0x36a07e={};_0x36a07e[_0x5cbebb]={'$like':'%'+_0x24a069['query']['filter']+'%'};return _0x36a07e;})});}_0x3988c4=_[_0xf482('0x44')]({},_0x3988c4,_0x24a069[_0xf482('0x58')]);return _0x1b98ac['getTeams'](_0x3988c4);}})['then'](function(_0x334435){if(_0x334435){_0x49cf58=_0x334435['length'];if(!_0x24a069[_0xf482('0x36')]['hasOwnProperty'](_0xf482('0x3f'))){_0x3988c4[_0xf482('0x21')]=qs[_0xf482('0x21')](_0x24a069[_0xf482('0x36')][_0xf482('0x21')]);_0x3988c4[_0xf482('0x1f')]=qs[_0xf482('0x1f')](_0x24a069['query'][_0xf482('0x1f')]);}return _0x1b98ac[_0xf482('0x63')](_0x3988c4);}})[_0xf482('0x27')](function(_0x42130d){if(_0x42130d){return _0x42130d?{'count':_0x49cf58,'rows':_0x42130d}:null;}})['then'](respondWithResult(_0x16e6c5,null))[_0xf482('0x49')](handleError(_0x16e6c5,null));};exports[_0xf482('0x64')]=function(_0x34482e,_0x8cf3ba,_0x35c4eb){var _0x2dc779=_0x34482e[_0xf482('0x4d')][_0xf482('0x65')];return db['Team'][_0xf482('0x47')]({'where':{'id':_0x2dc779},'attributes':['id'],'include':[{'model':db[_0xf482('0x5a')],'as':_0xf482('0x66'),'attributes':['id',_0xf482('0x2f'),_0xf482('0x67'),_0xf482('0x68'),_0xf482('0x69')],'raw':!![]}]})['then'](function(_0x30aabe){if(_0x30aabe){var _0x5daf67=_[_0xf482('0x6a')](_0x30aabe,function(_0x2e974a){var _0x109efe=_0x2e974a[_0xf482('0x28')]({'plain':!![]});return _0x109efe['Agents'];});return db[_0xf482('0x32')][_0xf482('0x4b')]({'where':{'id':_0x34482e[_0xf482('0x53')]['id']}})['then'](function(_0x29b859){return db[_0xf482('0x6b')]['transaction'](function(_0x31c25c){return _0x29b859['addTeams'](_0x2dc779,{'transaction':_0x31c25c})[_0xf482('0x27')](function(){return BPromise[_0xf482('0x6c')](_0x5daf67,function(_0x3346f6){return db['UserOpenchannelQueue'][_0xf482('0x6d')]({'where':{'UserId':_0x3346f6['id'],'OpenchannelQueueId':_0x34482e[_0xf482('0x53')]['id']},'transaction':_0x31c25c});});})[_0xf482('0x27')](function(){_0x5daf67[_0xf482('0x6e')](function(_0x8384cc){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x8384cc['id'],'OpenchannelQueueId':_0x29b859['id']});});});});});}})[_0xf482('0x27')](respondWithStatusCode(_0x8cf3ba,null))['catch'](handleError(_0x8cf3ba,null));};exports[_0xf482('0x6f')]=function(_0x442ebd,_0x2fcab6,_0xf335cb){return db[_0xf482('0x70')][_0xf482('0x47')]({'where':{'id':_0x442ebd[_0xf482('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf482('0x5a')],'as':_0xf482('0x66'),'attributes':['id'],'raw':!![]}]})[_0xf482('0x27')](handleEntityNotFound(_0x2fcab6,null))[_0xf482('0x27')](function(_0x2726a8){var _0xa959da=_[_0xf482('0x31')](_0x2726a8,'id');var _0x14308b=[];var _0x588cf4=[];var _0x5e6d0d=squel['select']();_0x5e6d0d['field'](_0xf482('0x71'))[_0xf482('0x72')](_0xf482('0x73'),'tq')[_0xf482('0x74')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf482('0x42')]('OpenchannelQueueId\x20=\x20?',_0x442ebd['params']['id']);for(var _0x37b8b2=0x0;_0x37b8b2<_0x2726a8['length'];_0x37b8b2+=0x1){let _0xf98046=_0x2726a8[_0x37b8b2];for(var _0x12ad34=0x0;_0x12ad34<_0xf98046['Agents']['length'];_0x12ad34+=0x1){let _0x51a6e=_0xf98046[_0xf482('0x66')][_0x12ad34];var _0x399053=_0x5e6d0d['clone']();_0x399053[_0xf482('0x42')](_0xf482('0x75'),_0x51a6e['id']);_0x588cf4[_0xf482('0x76')](db[_0xf482('0x6b')][_0xf482('0x36')](_0x399053['toString'](),{'type':db['sequelize'][_0xf482('0x77')][_0xf482('0x78')]})['then'](function(_0x47bf2c){if(_0x47bf2c['length']===0x1){return _0x51a6e['id'];}else{var _0x89339e=_[_0xf482('0x79')](_['map'](_0x47bf2c,_0xf482('0x7a')),function(_0x22332c){return _['includes'](_0xa959da,_0x22332c);});if(_0x89339e){return _0x51a6e['id'];}}}));}}return BPromise[_0xf482('0x7b')](_0x588cf4)[_0xf482('0x27')](function(_0x53606a){_0x14308b=_(_0x14308b)['union'](_0x53606a)[_0xf482('0x7c')]()[_0xf482('0x7d')]();return db[_0xf482('0x32')][_0xf482('0x4b')]({'where':{'id':_0x442ebd['params']['id']}})[_0xf482('0x27')](function(_0x23b45b){return db[_0xf482('0x6b')]['transaction'](function(_0x46981d){return _0x23b45b[_0xf482('0x6f')](_0x442ebd['query'][_0xf482('0x65')],{'transaction':_0x46981d})[_0xf482('0x27')](function(){if(!_['isEmpty'](_0x14308b)){return _0x23b45b['removeAgents'](_0x14308b,{'transaction':_0x46981d});}})[_0xf482('0x27')](function(){_0x14308b['forEach'](function(_0x5eb7f5){socket['emit'](_0xf482('0x7e'),{'UserId':_0x5eb7f5,'OpenchannelQueueId':_0x23b45b['id']});});});});});});})[_0xf482('0x27')](respondWithStatusCode(_0x2fcab6,null))['catch'](handleError(_0x2fcab6,null));};exports[_0xf482('0x7f')]=function(_0x343a4f,_0x2ed3cf,_0x2513de){return db[_0xf482('0x32')][_0xf482('0x4b')]({'where':{'id':_0x343a4f[_0xf482('0x53')]['id']}})[_0xf482('0x27')](handleEntityNotFound(_0x2ed3cf,null))[_0xf482('0x27')](function(_0x37672a){if(_0x37672a){return _0x37672a[_0xf482('0x7f')](_0x343a4f['body'][_0xf482('0x65')],_['omit'](_0x343a4f[_0xf482('0x4d')],[_0xf482('0x65'),'id'])||{})[_0xf482('0x80')](function(_0x15a7f6){for(var _0x20c795=0x0;_0x20c795<_0x343a4f[_0xf482('0x4d')][_0xf482('0x65')][_0xf482('0x3d')];_0x20c795+=0x1){socket['emit'](_0xf482('0x81'),{'UserId':Number(_0x343a4f[_0xf482('0x4d')]['ids'][_0x20c795]),'OpenchannelQueueId':Number(_0x343a4f[_0xf482('0x53')]['id'])});}return _0x15a7f6;});}})['then'](respondWithResult(_0x2ed3cf,null))[_0xf482('0x49')](handleError(_0x2ed3cf,null));};exports[_0xf482('0x82')]=function(_0x6273,_0x4f64c8,_0x307dcc){return db[_0xf482('0x32')][_0xf482('0x4b')]({'where':{'id':_0x6273[_0xf482('0x53')]['id']}})[_0xf482('0x27')](handleEntityNotFound(_0x4f64c8,null))[_0xf482('0x27')](function(_0x5bc0bf){if(_0x5bc0bf){return _0x5bc0bf[_0xf482('0x82')](_0x6273[_0xf482('0x36')][_0xf482('0x65')])['then'](function(){if(_['isArray'](_0x6273[_0xf482('0x36')][_0xf482('0x65')])){for(var _0x3ee8b0=0x0;_0x3ee8b0<_0x6273[_0xf482('0x36')]['ids'][_0xf482('0x3d')];_0x3ee8b0+=0x1){socket[_0xf482('0x83')](_0xf482('0x7e'),{'UserId':Number(_0x6273[_0xf482('0x36')][_0xf482('0x65')][_0x3ee8b0]),'OpenchannelQueueId':Number(_0x6273[_0xf482('0x53')]['id'])});}}else{socket[_0xf482('0x83')](_0xf482('0x7e'),{'UserId':Number(_0x6273[_0xf482('0x36')]['ids']),'OpenchannelQueueId':Number(_0x6273[_0xf482('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x4f64c8,null))[_0xf482('0x49')](handleError(_0x4f64c8,null));};exports['getAgents']=function(_0x1a7052,_0x3f537f,_0x499765){var _0x2f9bd9={};var _0x5a6b20={};var _0x5e8804;var _0x549e8a;return db[_0xf482('0x32')][_0xf482('0x56')]({'where':{'id':_0x1a7052[_0xf482('0x53')]['id']}})[_0xf482('0x27')](handleEntityNotFound(_0x3f537f,null))[_0xf482('0x27')](function(_0xdd9fd){if(_0xdd9fd){_0x5e8804=_0xdd9fd;_0x5a6b20[_0xf482('0x3b')]=_[_0xf482('0x37')](db['User'][_0xf482('0x4a')]);_0x5a6b20[_0xf482('0x36')]=_[_0xf482('0x37')](_0x1a7052[_0xf482('0x36')]);_0x5a6b20[_0xf482('0x38')]=_[_0xf482('0x39')](_0x5a6b20[_0xf482('0x3b')],_0x5a6b20[_0xf482('0x36')]);_0x2f9bd9['attributes']=_['intersection'](_0x5a6b20[_0xf482('0x3b')],qs[_0xf482('0x3c')](_0x1a7052[_0xf482('0x36')][_0xf482('0x3c')]));_0x2f9bd9[_0xf482('0x3a')]=_0x2f9bd9[_0xf482('0x3a')][_0xf482('0x3d')]?_0x2f9bd9['attributes']:_0x5a6b20[_0xf482('0x3b')];_0x2f9bd9[_0xf482('0x40')]=qs['sort'](_0x1a7052[_0xf482('0x36')][_0xf482('0x41')]);_0x2f9bd9[_0xf482('0x42')]=qs['filters'](_[_0xf482('0x57')](_0x1a7052['query'],_0x5a6b20[_0xf482('0x38')]));if(_0x1a7052[_0xf482('0x36')][_0xf482('0x43')]){_0x2f9bd9[_0xf482('0x42')]=_[_0xf482('0x44')](_0x2f9bd9[_0xf482('0x42')],{'$or':_[_0xf482('0x31')](_0x2f9bd9[_0xf482('0x3a')],function(_0x5c6686){var _0x8eb8b6={};_0x8eb8b6[_0x5c6686]={'$like':'%'+_0x1a7052[_0xf482('0x36')][_0xf482('0x43')]+'%'};return _0x8eb8b6;})});}_0x2f9bd9=_[_0xf482('0x44')]({},_0x2f9bd9,_0x1a7052['options']);return _0x5e8804[_0xf482('0x84')](_0x2f9bd9);}})['then'](function(_0x47dc8c){if(_0x47dc8c){_0x549e8a=_0x47dc8c[_0xf482('0x3d')];if(!_0x1a7052[_0xf482('0x36')][_0xf482('0x3e')](_0xf482('0x3f'))){_0x2f9bd9[_0xf482('0x21')]=qs[_0xf482('0x21')](_0x1a7052[_0xf482('0x36')]['limit']);_0x2f9bd9[_0xf482('0x1f')]=qs[_0xf482('0x1f')](_0x1a7052[_0xf482('0x36')][_0xf482('0x1f')]);}return _0x5e8804[_0xf482('0x84')](_0x2f9bd9);}})['then'](function(_0x64bf6d){if(_0x64bf6d){return _0x64bf6d?{'count':_0x549e8a,'rows':_0x64bf6d}:null;}})[_0xf482('0x27')](respondWithResult(_0x3f537f,null))['catch'](handleError(_0x3f537f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 7b335c4..254defd 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 _0xb914=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0xb914,0x91));var _0x4b91=function(_0x325994,_0x3feae8){_0x325994=_0x325994-0x0;var _0x557034=_0xb914[_0x325994];return _0x557034;};'use strict';var EventEmitter=require(_0x4b91('0x0'));var OpenchannelQueue=require(_0x4b91('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4b91('0x2')](0x0);var events={'afterCreate':_0x4b91('0x3'),'afterUpdate':_0x4b91('0x4'),'afterDestroy':_0x4b91('0x5')};function emitEvent(_0x5b3578){return function(_0x218f5d,_0x7d0eaa,_0x8f3cbc){OpenchannelQueueEvents[_0x4b91('0x6')](_0x5b3578+':'+_0x218f5d['id'],_0x218f5d);OpenchannelQueueEvents[_0x4b91('0x6')](_0x5b3578,_0x218f5d);_0x8f3cbc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x4b91('0x7')](e,emitEvent(event));}}module[_0x4b91('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x1631=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x248f9e,_0x590b5){var _0x40b6a2=function(_0x4702ff){while(--_0x4702ff){_0x248f9e['push'](_0x248f9e['shift']());}};_0x40b6a2(++_0x590b5);}(_0x1631,0xfb));var _0x1163=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x1631[_0x18ab2a];return _0x16dcee;};'use strict';var EventEmitter=require(_0x1163('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x1163('0x1')](0x0);var events={'afterCreate':_0x1163('0x2'),'afterUpdate':'update','afterDestroy':_0x1163('0x3')};function emitEvent(_0x3e8cd5){return function(_0x305eac,_0x1853c4,_0x413fcc){OpenchannelQueueEvents[_0x1163('0x4')](_0x3e8cd5+':'+_0x305eac['id'],_0x305eac);OpenchannelQueueEvents[_0x1163('0x4')](_0x3e8cd5,_0x305eac);_0x413fcc(null);};}for(var e in events){if(events[_0x1163('0x5')](e)){var event=events[e];OpenchannelQueue[_0x1163('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index f6034c0..1010c54 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 _0x7cf0=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','define','lodash','util'];(function(_0x57862e,_0x2c787f){var _0x1f44ba=function(_0x25aa7e){while(--_0x25aa7e){_0x57862e['push'](_0x57862e['shift']());}};_0x1f44ba(++_0x2c787f);}(_0x7cf0,0x1c0));var _0x07cf=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x7cf0[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x07cf('0x0'));var util=require(_0x07cf('0x1'));var logger=require(_0x07cf('0x2'))(_0x07cf('0x3'));var moment=require(_0x07cf('0x4'));var BPromise=require('bluebird');var rp=require(_0x07cf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07cf('0x6'));var config=require(_0x07cf('0x7'));var attributes=require(_0x07cf('0x8'));module['exports']=function(_0x3f8dbe,_0x50cd32){return _0x3f8dbe[_0x07cf('0x9')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x775a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util'];(function(_0xe896bf,_0x4f8e5e){var _0x4c7a8a=function(_0x410ff2){while(--_0x410ff2){_0xe896bf['push'](_0xe896bf['shift']());}};_0x4c7a8a(++_0x4f8e5e);}(_0x775a,0xde));var _0xa775=function(_0x10c4ce,_0x1cd053){_0x10c4ce=_0x10c4ce-0x0;var _0x1b937a=_0x775a[_0x10c4ce];return _0x1b937a;};'use strict';var _=require(_0xa775('0x0'));var util=require(_0xa775('0x1'));var logger=require('../../config/logger')(_0xa775('0x2'));var moment=require(_0xa775('0x3'));var BPromise=require(_0xa775('0x4'));var rp=require(_0xa775('0x5'));var fs=require('fs');var path=require(_0xa775('0x6'));var rimraf=require(_0xa775('0x7'));var config=require(_0xa775('0x8'));var attributes=require(_0xa775('0x9'));module[_0xa775('0xa')]=function(_0x110d24,_0x9dd65){return _0x110d24[_0xa775('0xb')](_0xa775('0xc'),attributes,{'tableName':_0xa775('0xd'),'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 0c62639..7542ca1 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 _0x787d=['error','OpenchannelQueue,\x20%s,\x20%s','message','info','result','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','map','include','model','then','debug','catch','ShowOpenchannelQueue','find','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request\x20sent','stringify'];(function(_0x32f85c,_0x4d4d1b){var _0x527283=function(_0x314936){while(--_0x314936){_0x32f85c['push'](_0x32f85c['shift']());}};_0x527283(++_0x4d4d1b);}(_0x787d,0xb0));var _0xd787=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0x787d[_0x548627];return _0x844a84;};'use strict';var _=require(_0xd787('0x0'));var util=require('util');var moment=require(_0xd787('0x1'));var BPromise=require(_0xd787('0x2'));var rs=require(_0xd787('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd787('0x4'));var logger=require(_0xd787('0x5'))(_0xd787('0x6'));var config=require(_0xd787('0x7'));var jayson=require(_0xd787('0x8'));var client=jayson[_0xd787('0x9')][_0xd787('0xa')]({'port':0x232a});config['redis']=_[_0xd787('0xb')](config[_0xd787('0xc')],{'host':_0xd787('0xd'),'port':0x18eb});var socket=require(_0xd787('0xe'))(new Redis(config[_0xd787('0xc')]));require(_0xd787('0xf'))[_0xd787('0x10')](socket);function respondWithRpcPromise(_0x85c37f,_0x34852b,_0x37edb1){return new BPromise(function(_0x33212c,_0x27459f){return client['request'](_0x85c37f,_0x37edb1)['then'](function(_0x24b740){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x34852b,_0xd787('0x11'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x34852b,_0xd787('0x11'),JSON[_0xd787('0x12')](_0x24b740));if(_0x24b740[_0xd787('0x13')]){if(_0x24b740[_0xd787('0x13')]['code']===0x1f4){logger['error'](_0xd787('0x14'),_0x34852b,_0x24b740[_0xd787('0x13')]['message']);return _0x27459f(_0x24b740['error']['message']);}logger[_0xd787('0x13')](_0xd787('0x14'),_0x34852b,_0x24b740['error'][_0xd787('0x15')]);return _0x33212c(_0x24b740[_0xd787('0x13')][_0xd787('0x15')]);}else{logger[_0xd787('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x34852b,_0xd787('0x11'));_0x33212c(_0x24b740[_0xd787('0x17')]['message']);}})['catch'](function(_0x3f3dea){logger['error'](_0xd787('0x14'),_0x34852b,_0x3f3dea);_0x27459f(_0x3f3dea);});});}exports[_0xd787('0x18')]=function(_0x469fa9){var _0x503365=this;return new Promise(function(_0xadb6ee,_0x5b624a){return db[_0xd787('0x19')]['findAll']({'raw':_0x469fa9[_0xd787('0x1a')]?_0x469fa9['options'][_0xd787('0x1b')]===undefined?!![]:![]:!![],'where':_0x469fa9[_0xd787('0x1a')]?_0x469fa9[_0xd787('0x1a')][_0xd787('0x1c')]||null:null,'attributes':_0x469fa9['options']?_0x469fa9[_0xd787('0x1a')][_0xd787('0x1d')]||null:null,'limit':_0x469fa9['options']?_0x469fa9[_0xd787('0x1a')][_0xd787('0x1e')]||null:null,'include':_0x469fa9[_0xd787('0x1a')]?_0x469fa9['options']['include']?_[_0xd787('0x1f')](_0x469fa9[_0xd787('0x1a')][_0xd787('0x20')],function(_0x38e389){return{'model':db[_0x38e389['model']],'as':_0x38e389['as'],'attributes':_0x38e389[_0xd787('0x1d')],'include':_0x38e389[_0xd787('0x20')]?_[_0xd787('0x1f')](_0x38e389[_0xd787('0x20')],function(_0xfae49d){return{'model':db[_0xfae49d['model']],'as':_0xfae49d['as'],'attributes':_0xfae49d[_0xd787('0x1d')],'include':_0xfae49d['include']?_[_0xd787('0x1f')](_0xfae49d[_0xd787('0x20')],function(_0x5a185c){return{'model':db[_0x5a185c[_0xd787('0x21')]],'as':_0x5a185c['as'],'attributes':_0x5a185c[_0xd787('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd787('0x22')](function(_0x153acb){logger['info'](_0xd787('0x18'),_0x469fa9);logger[_0xd787('0x23')](_0xd787('0x18'),_0x469fa9,JSON[_0xd787('0x12')](_0x153acb));_0xadb6ee(_0x153acb);})[_0xd787('0x24')](function(_0x1eb716){logger[_0xd787('0x13')](_0xd787('0x18'),_0x1eb716[_0xd787('0x15')],_0x469fa9);_0x5b624a(_0x503365['error'](0x1f4,_0x1eb716[_0xd787('0x15')]));});});};exports[_0xd787('0x25')]=function(_0x1fe01e){var _0x3a264d=this;return new Promise(function(_0x180791,_0x58e426){return db[_0xd787('0x19')][_0xd787('0x26')]({'raw':_0x1fe01e['options']?_0x1fe01e[_0xd787('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1fe01e[_0xd787('0x1a')]?_0x1fe01e[_0xd787('0x1a')]['where']||null:null,'attributes':_0x1fe01e[_0xd787('0x1a')]?_0x1fe01e[_0xd787('0x1a')][_0xd787('0x1d')]||null:null,'include':_0x1fe01e[_0xd787('0x1a')]?_0x1fe01e[_0xd787('0x1a')][_0xd787('0x20')]?_['map'](_0x1fe01e[_0xd787('0x1a')][_0xd787('0x20')],function(_0xe2399c){return{'model':db[_0xe2399c[_0xd787('0x21')]],'as':_0xe2399c['as'],'attributes':_0xe2399c[_0xd787('0x1d')],'include':_0xe2399c[_0xd787('0x20')]?_['map'](_0xe2399c[_0xd787('0x20')],function(_0x25f40b){return{'model':db[_0x25f40b[_0xd787('0x21')]],'as':_0x25f40b['as'],'attributes':_0x25f40b[_0xd787('0x1d')],'include':_0x25f40b['include']?_[_0xd787('0x1f')](_0x25f40b['include'],function(_0x177367){return{'model':db[_0x177367[_0xd787('0x21')]],'as':_0x177367['as'],'attributes':_0x177367[_0xd787('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd787('0x22')](function(_0xe94b31){logger[_0xd787('0x16')](_0xd787('0x25'),_0x1fe01e);logger[_0xd787('0x23')](_0xd787('0x25'),_0x1fe01e,JSON[_0xd787('0x12')](_0xe94b31));_0x180791(_0xe94b31);})[_0xd787('0x24')](function(_0x4db613){logger['error'](_0xd787('0x25'),_0x4db613[_0xd787('0x15')],_0x1fe01e);_0x58e426(_0x3a264d['error'](0x1f4,_0x4db613[_0xd787('0x15')]));});});}; \ No newline at end of file +var _0x2483=['map','model','then','GetOpenchannelQueue','ShowOpenchannelQueue','OpenchannelQueue','find','debug','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include'];(function(_0x246360,_0x46ed80){var _0x3d3aea=function(_0x18275c){while(--_0x18275c){_0x246360['push'](_0x246360['shift']());}};_0x3d3aea(++_0x46ed80);}(_0x2483,0xa8));var _0x3248=function(_0x4767fb,_0x3842f7){_0x4767fb=_0x4767fb-0x0;var _0x3f9248=_0x2483[_0x4767fb];return _0x3f9248;};'use strict';var _=require(_0x3248('0x0'));var util=require(_0x3248('0x1'));var moment=require(_0x3248('0x2'));var BPromise=require('bluebird');var rs=require(_0x3248('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3248('0x4'));var logger=require(_0x3248('0x5'))('rpc');var config=require(_0x3248('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3248('0x7')][_0x3248('0x8')]({'port':0x232a});config[_0x3248('0x9')]=_[_0x3248('0xa')](config['redis'],{'host':_0x3248('0xb'),'port':0x18eb});var socket=require(_0x3248('0xc'))(new Redis(config['redis']));require(_0x3248('0xd'))[_0x3248('0xe')](socket);function respondWithRpcPromise(_0x327be9,_0x4c1baa,_0x558d99){return new BPromise(function(_0x49b108,_0x5a981f){return client[_0x3248('0xf')](_0x327be9,_0x558d99)['then'](function(_0x1c2516){logger[_0x3248('0x10')](_0x3248('0x11'),_0x4c1baa,_0x3248('0x12'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4c1baa,_0x3248('0x12'),JSON[_0x3248('0x13')](_0x1c2516));if(_0x1c2516[_0x3248('0x14')]){if(_0x1c2516[_0x3248('0x14')][_0x3248('0x15')]===0x1f4){logger['error'](_0x3248('0x11'),_0x4c1baa,_0x1c2516['error'][_0x3248('0x16')]);return _0x5a981f(_0x1c2516[_0x3248('0x14')][_0x3248('0x16')]);}logger['error'](_0x3248('0x11'),_0x4c1baa,_0x1c2516[_0x3248('0x14')]['message']);return _0x49b108(_0x1c2516[_0x3248('0x14')][_0x3248('0x16')]);}else{logger[_0x3248('0x10')](_0x3248('0x11'),_0x4c1baa,_0x3248('0x12'));_0x49b108(_0x1c2516[_0x3248('0x17')][_0x3248('0x16')]);}})[_0x3248('0x18')](function(_0x5ec770){logger[_0x3248('0x14')](_0x3248('0x11'),_0x4c1baa,_0x5ec770);_0x5a981f(_0x5ec770);});});}exports['GetOpenchannelQueue']=function(_0x1e1faa){var _0x713e44=this;return new Promise(function(_0x17305d,_0xbc50c1){return db['OpenchannelQueue'][_0x3248('0x19')]({'raw':_0x1e1faa['options']?_0x1e1faa[_0x3248('0x1a')][_0x3248('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e1faa[_0x3248('0x1a')]?_0x1e1faa['options'][_0x3248('0x1c')]||null:null,'attributes':_0x1e1faa[_0x3248('0x1a')]?_0x1e1faa['options'][_0x3248('0x1d')]||null:null,'limit':_0x1e1faa[_0x3248('0x1a')]?_0x1e1faa[_0x3248('0x1a')][_0x3248('0x1e')]||null:null,'include':_0x1e1faa['options']?_0x1e1faa[_0x3248('0x1a')][_0x3248('0x1f')]?_[_0x3248('0x20')](_0x1e1faa[_0x3248('0x1a')][_0x3248('0x1f')],function(_0x3b75c3){return{'model':db[_0x3b75c3[_0x3248('0x21')]],'as':_0x3b75c3['as'],'attributes':_0x3b75c3[_0x3248('0x1d')],'include':_0x3b75c3[_0x3248('0x1f')]?_[_0x3248('0x20')](_0x3b75c3[_0x3248('0x1f')],function(_0x45602b){return{'model':db[_0x45602b[_0x3248('0x21')]],'as':_0x45602b['as'],'attributes':_0x45602b[_0x3248('0x1d')],'include':_0x45602b[_0x3248('0x1f')]?_[_0x3248('0x20')](_0x45602b[_0x3248('0x1f')],function(_0x53f764){return{'model':db[_0x53f764[_0x3248('0x21')]],'as':_0x53f764['as'],'attributes':_0x53f764[_0x3248('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3248('0x22')](function(_0x5ad929){logger['info']('GetOpenchannelQueue',_0x1e1faa);logger['debug'](_0x3248('0x23'),_0x1e1faa,JSON[_0x3248('0x13')](_0x5ad929));_0x17305d(_0x5ad929);})[_0x3248('0x18')](function(_0x5efd1d){logger[_0x3248('0x14')](_0x3248('0x23'),_0x5efd1d[_0x3248('0x16')],_0x1e1faa);_0xbc50c1(_0x713e44['error'](0x1f4,_0x5efd1d[_0x3248('0x16')]));});});};exports[_0x3248('0x24')]=function(_0x4472bb){var _0x3a0594=this;return new Promise(function(_0x140a46,_0x496c88){return db[_0x3248('0x25')][_0x3248('0x26')]({'raw':_0x4472bb[_0x3248('0x1a')]?_0x4472bb[_0x3248('0x1a')][_0x3248('0x1b')]===undefined?!![]:![]:!![],'where':_0x4472bb[_0x3248('0x1a')]?_0x4472bb[_0x3248('0x1a')][_0x3248('0x1c')]||null:null,'attributes':_0x4472bb[_0x3248('0x1a')]?_0x4472bb[_0x3248('0x1a')]['attributes']||null:null,'include':_0x4472bb[_0x3248('0x1a')]?_0x4472bb[_0x3248('0x1a')][_0x3248('0x1f')]?_['map'](_0x4472bb[_0x3248('0x1a')][_0x3248('0x1f')],function(_0x21cc12){return{'model':db[_0x21cc12['model']],'as':_0x21cc12['as'],'attributes':_0x21cc12[_0x3248('0x1d')],'include':_0x21cc12[_0x3248('0x1f')]?_[_0x3248('0x20')](_0x21cc12[_0x3248('0x1f')],function(_0x3337e7){return{'model':db[_0x3337e7['model']],'as':_0x3337e7['as'],'attributes':_0x3337e7[_0x3248('0x1d')],'include':_0x3337e7[_0x3248('0x1f')]?_['map'](_0x3337e7[_0x3248('0x1f')],function(_0x17729b){return{'model':db[_0x17729b[_0x3248('0x21')]],'as':_0x17729b['as'],'attributes':_0x17729b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x366729){logger['info'](_0x3248('0x24'),_0x4472bb);logger[_0x3248('0x27')]('ShowOpenchannelQueue',_0x4472bb,JSON[_0x3248('0x13')](_0x366729));_0x140a46(_0x366729);})[_0x3248('0x18')](function(_0x2f7e79){logger['error']('ShowOpenchannelQueue',_0x2f7e79[_0x3248('0x16')],_0x4472bb);_0x496c88(_0x3a0594[_0x3248('0x14')](0x1f4,_0x2f7e79[_0x3248('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index ccc6e5d..7711e18 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 _0xa2f4=['update','emit','removeListener','register','length','openchannelQueue:','save'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0xa2f4,0xa7));var _0x4a2f=function(_0x99facc,_0x548cd6){_0x99facc=_0x99facc-0x0;var _0xd39ed0=_0xa2f4[_0x99facc];return _0xd39ed0;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x4a2f('0x0'),'remove',_0x4a2f('0x1')];function createListener(_0x1ccc5c,_0xee1ac3){return function(_0x3d60ea){_0xee1ac3[_0x4a2f('0x2')](_0x1ccc5c,_0x3d60ea);};}function removeListener(_0x1fdf7d,_0x161394){return function(){OpenchannelQueueEvents[_0x4a2f('0x3')](_0x1fdf7d,_0x161394);};}exports[_0x4a2f('0x4')]=function(_0x24f781){for(var _0x454c6d=0x0,_0x371e6c=events[_0x4a2f('0x5')];_0x454c6d<_0x371e6c;_0x454c6d++){var _0x3a21b3=events[_0x454c6d];var _0x488381=createListener(_0x4a2f('0x6')+_0x3a21b3,_0x24f781);OpenchannelQueueEvents['on'](_0x3a21b3,_0x488381);}}; \ No newline at end of file +var _0x158f=['removeListener','length','./openchannelQueue.events','save','remove','update','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x158f,0x105));var _0xf158=function(_0x18bca7,_0x13ccb8){_0x18bca7=_0x18bca7-0x0;var _0x1158e5=_0x158f[_0x18bca7];return _0x1158e5;};'use strict';var OpenchannelQueueEvents=require(_0xf158('0x0'));var events=[_0xf158('0x1'),_0xf158('0x2'),_0xf158('0x3')];function createListener(_0x29b28d,_0x5991ad){return function(_0x3b422f){_0x5991ad[_0xf158('0x4')](_0x29b28d,_0x3b422f);};}function removeListener(_0x1eea8e,_0xb88ac0){return function(){OpenchannelQueueEvents[_0xf158('0x5')](_0x1eea8e,_0xb88ac0);};}exports['register']=function(_0x4c5a16){for(var _0x376245=0x0,_0x43520c=events[_0xf158('0x6')];_0x376245<_0x43520c;_0x376245++){var _0x1cde6c=events[_0x376245];var _0x529e25=createListener('openchannelQueue:'+_0x1cde6c,_0x4c5a16);OpenchannelQueueEvents['on'](_0x1cde6c,_0x529e25);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 4cd112c..6ecf6ec 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 _0xabc0=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','/describe','get','/:id','show','put','destroy','exports'];(function(_0x4d8a8f,_0x2afd4c){var _0xfc4adc=function(_0xb89886){while(--_0xb89886){_0x4d8a8f['push'](_0x4d8a8f['shift']());}};_0xfc4adc(++_0x2afd4c);}(_0xabc0,0xa2));var _0x0abc=function(_0x516613,_0xa783f5){_0x516613=_0x516613-0x0;var _0xfeebc1=_0xabc0[_0x516613];return _0xfeebc1;};'use strict';var multer=require(_0x0abc('0x0'));var util=require('util');var path=require(_0x0abc('0x1'));var timeout=require(_0x0abc('0x2'));var express=require(_0x0abc('0x3'));var router=express[_0x0abc('0x4')]();var fs_extra=require(_0x0abc('0x5'));var auth=require(_0x0abc('0x6'));var interaction=require(_0x0abc('0x7'));var config=require(_0x0abc('0x8'));var controller=require(_0x0abc('0x9'));router['get']('/',auth[_0x0abc('0xa')](),controller['index']);router['get'](_0x0abc('0xb'),auth[_0x0abc('0xa')](),controller['describe']);router[_0x0abc('0xc')](_0x0abc('0xd'),auth['isAuthenticated'](),controller[_0x0abc('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0abc('0xf')]('/:id',auth[_0x0abc('0xa')](),controller['update']);router['delete'](_0x0abc('0xd'),auth['isAuthenticated'](),controller[_0x0abc('0x10')]);module[_0x0abc('0x11')]=router; \ No newline at end of file +var _0x6746=['exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','create','put','update','/:id','destroy'];(function(_0x27f5de,_0x577080){var _0x484149=function(_0x7e9adb){while(--_0x7e9adb){_0x27f5de['push'](_0x27f5de['shift']());}};_0x484149(++_0x577080);}(_0x6746,0xb5));var _0x6674=function(_0x4cee4b,_0x1dfff3){_0x4cee4b=_0x4cee4b-0x0;var _0x4d891d=_0x6746[_0x4cee4b];return _0x4d891d;};'use strict';var multer=require(_0x6674('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6674('0x1'));var express=require(_0x6674('0x2'));var router=express['Router']();var fs_extra=require(_0x6674('0x3'));var auth=require(_0x6674('0x4'));var interaction=require(_0x6674('0x5'));var config=require(_0x6674('0x6'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x6674('0x7')](),controller[_0x6674('0x8')]);router[_0x6674('0x9')](_0x6674('0xa'),auth[_0x6674('0x7')](),controller[_0x6674('0xb')]);router['get']('/:id',auth[_0x6674('0x7')](),controller['show']);router['post']('/',auth[_0x6674('0x7')](),controller[_0x6674('0xc')]);router[_0x6674('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x6674('0xe')]);router['delete'](_0x6674('0xf'),auth[_0x6674('0x7')](),controller[_0x6674('0x10')]);module[_0x6674('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 3cc0540..b2f5828 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 _0x058f=['STRING','DATE','moment','sequelize'];(function(_0x5b8685,_0x1a1c28){var _0xa3ef57=function(_0xa91aad){while(--_0xa91aad){_0x5b8685['push'](_0x5b8685['shift']());}};_0xa3ef57(++_0x1a1c28);}(_0x058f,0xc6));var _0xf058=function(_0x2ad4bf,_0x4e9e63){_0x2ad4bf=_0x2ad4bf-0x0;var _0x8730dd=_0x058f[_0x2ad4bf];return _0x8730dd;};'use strict';var moment=require(_0xf058('0x0'));var Sequelize=require(_0xf058('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xf058('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf058('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf058('0x3')]},'acceptAt':{'type':Sequelize[_0xf058('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf058('0x2')]}}; \ No newline at end of file +var _0x138f=['DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x138f,0xbf));var _0xf138=function(_0x87239,_0x38c793){_0x87239=_0x87239-0x0;var _0x53af1e=_0x138f[_0x87239];return _0x53af1e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xf138('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0xf138('0x0')]},'joinAt':{'type':Sequelize[_0xf138('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xf138('0x1')]},'exitAt':{'type':Sequelize[_0xf138('0x1')]},'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 c153cc4..d3b7703 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 _0x70a0=['stack','name','send','index','map','OpenchannelQueueReport','fieldName','key','query','keys','attributes','fields','model','nolimit','order','sort','where','filters','VIRTUAL','merge','options','includeAll','findAll','rows','catch','rawAttributes','intersection','length','include','find','create','body','params','destroy','describe','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','sendStatus','error'];(function(_0x3d8330,_0x4c5dcd){var _0x305e9d=function(_0x34e496){while(--_0x34e496){_0x3d8330['push'](_0x3d8330['shift']());}};_0x305e9d(++_0x4c5dcd);}(_0x70a0,0x186));var _0x070a=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x70a0[_0x87b0ff];return _0x3bc0b2;};'use strict';var emlformat=require(_0x070a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070a('0x1'));var moment=require(_0x070a('0x2'));var BPromise=require(_0x070a('0x3'));var Mustache=require('mustache');var util=require(_0x070a('0x4'));var path=require(_0x070a('0x5'));var sox=require(_0x070a('0x6'));var csv=require(_0x070a('0x7'));var ejs=require(_0x070a('0x8'));var fs=require('fs');var fs_extra=require(_0x070a('0x9'));var _=require(_0x070a('0xa'));var squel=require(_0x070a('0xb'));var crypto=require('crypto');var jsforce=require(_0x070a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x070a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x070a('0xe'));var as=require(_0x070a('0xf'));var hardwareService=require(_0x070a('0x10'));var logger=require(_0x070a('0x11'))(_0x070a('0x12'));var utils=require(_0x070a('0x13'));var config=require(_0x070a('0x14'));var licenseUtil=require(_0x070a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x376ae3,_0x3dd891){_0x3dd891=_0x3dd891||0xcc;return function(_0x2329a2){if(_0x2329a2){return _0x376ae3['sendStatus'](_0x3dd891);}return _0x376ae3[_0x070a('0x16')](_0x3dd891)[_0x070a('0x17')]();};}function respondWithResult(_0x55604d,_0x487219){_0x487219=_0x487219||0xc8;return function(_0x2188e8){if(_0x2188e8){return _0x55604d['status'](_0x487219)[_0x070a('0x18')](_0x2188e8);}};}function respondWithFilteredResult(_0x443c0d,_0x40392d){return function(_0x4fafc4){if(_0x4fafc4){var _0x44aa08=typeof _0x40392d[_0x070a('0x19')]===_0x070a('0x1a')&&typeof _0x40392d[_0x070a('0x1b')]===_0x070a('0x1a');var _0x54e610=_0x4fafc4[_0x070a('0x1c')];var _0x4c32a5=_0x44aa08?0x0:_0x40392d[_0x070a('0x19')];var _0x3a08d3=_0x44aa08?_0x4fafc4[_0x070a('0x1c')]:_0x40392d[_0x070a('0x19')]+_0x40392d[_0x070a('0x1b')];var _0xddae83;if(_0x3a08d3>=_0x54e610){_0x3a08d3=_0x54e610;_0xddae83=0xc8;}else{_0xddae83=0xce;}_0x443c0d[_0x070a('0x16')](_0xddae83);return _0x443c0d['set'](_0x070a('0x1d'),_0x4c32a5+'-'+_0x3a08d3+'/'+_0x54e610)[_0x070a('0x18')](_0x4fafc4);}return null;};}function patchUpdates(_0x31ccdc){return function(_0x11293b){try{jsonpatch['apply'](_0x11293b,_0x31ccdc,!![]);}catch(_0x139d85){return BPromise[_0x070a('0x1e')](_0x139d85);}return _0x11293b[_0x070a('0x1f')]();};}function saveUpdates(_0x53377d,_0x4ad56f){return function(_0x21329e){if(_0x21329e){return _0x21329e[_0x070a('0x20')](_0x53377d)[_0x070a('0x21')](function(_0x59d175){return _0x59d175;});}return null;};}function removeEntity(_0x25d6f3,_0x21cbdc){return function(_0x13577a){if(_0x13577a){return _0x13577a['destroy']()[_0x070a('0x21')](function(){_0x25d6f3['status'](0xcc)[_0x070a('0x17')]();});}};}function handleEntityNotFound(_0x4e699c,_0x243345){return function(_0x55645e){if(!_0x55645e){_0x4e699c[_0x070a('0x22')](0x194);}return _0x55645e;};}function handleError(_0x3b6b39,_0x2ce40){_0x2ce40=_0x2ce40||0x1f4;return function(_0x51bd9a){logger[_0x070a('0x23')](_0x51bd9a[_0x070a('0x24')]);if(_0x51bd9a[_0x070a('0x25')]){delete _0x51bd9a['name'];}_0x3b6b39[_0x070a('0x16')](_0x2ce40)[_0x070a('0x26')](_0x51bd9a);};}exports[_0x070a('0x27')]=function(_0x7e8973,_0x19d79d){var _0x24fe2e={},_0xf71daf={},_0x3e8172={'count':0x0,'rows':[]};var _0x4666f6=_[_0x070a('0x28')](db[_0x070a('0x29')]['rawAttributes'],function(_0x3f199d){return{'name':_0x3f199d[_0x070a('0x2a')],'type':_0x3f199d['type'][_0x070a('0x2b')]};});_0xf71daf['model']=_[_0x070a('0x28')](_0x4666f6,_0x070a('0x25'));_0xf71daf[_0x070a('0x2c')]=_[_0x070a('0x2d')](_0x7e8973[_0x070a('0x2c')]);_0xf71daf['filters']=_['intersection'](_0xf71daf['model'],_0xf71daf[_0x070a('0x2c')]);_0x24fe2e[_0x070a('0x2e')]=_['intersection'](_0xf71daf['model'],qs[_0x070a('0x2f')](_0x7e8973[_0x070a('0x2c')]['fields']));_0x24fe2e['attributes']=_0x24fe2e[_0x070a('0x2e')]['length']?_0x24fe2e['attributes']:_0xf71daf[_0x070a('0x30')];if(!_0x7e8973['query']['hasOwnProperty'](_0x070a('0x31'))){_0x24fe2e[_0x070a('0x1b')]=qs[_0x070a('0x1b')](_0x7e8973[_0x070a('0x2c')][_0x070a('0x1b')]);_0x24fe2e['offset']=qs[_0x070a('0x19')](_0x7e8973[_0x070a('0x2c')][_0x070a('0x19')]);}_0x24fe2e[_0x070a('0x32')]=qs[_0x070a('0x33')](_0x7e8973[_0x070a('0x2c')][_0x070a('0x33')]);_0x24fe2e[_0x070a('0x34')]=qs[_0x070a('0x35')](_['pick'](_0x7e8973[_0x070a('0x2c')],_0xf71daf[_0x070a('0x35')]),_0x4666f6);if(_0x7e8973[_0x070a('0x2c')]['filter']){_0x24fe2e[_0x070a('0x34')]=_['merge'](_0x24fe2e['where'],{'$or':_[_0x070a('0x28')](_0x4666f6,function(_0x35ccf7){if(_0x35ccf7['type']!==_0x070a('0x36')){var _0x31cebb={};_0x31cebb[_0x35ccf7[_0x070a('0x25')]]={'$like':'%'+_0x7e8973['query']['filter']+'%'};return _0x31cebb;}})});}_0x24fe2e=_[_0x070a('0x37')]({},_0x24fe2e,_0x7e8973[_0x070a('0x38')]);var _0x21a38c={'where':_0x24fe2e['where']};return db[_0x070a('0x29')][_0x070a('0x1c')](_0x21a38c)['then'](function(_0xaf059d){_0x3e8172['count']=_0xaf059d;if(_0x7e8973[_0x070a('0x2c')][_0x070a('0x39')]){_0x24fe2e['include']=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x070a('0x3a')](_0x24fe2e);})['then'](function(_0x47a82a){_0x3e8172[_0x070a('0x3b')]=_0x47a82a;return _0x3e8172;})['then'](respondWithFilteredResult(_0x19d79d,_0x24fe2e))[_0x070a('0x3c')](handleError(_0x19d79d,null));};exports['show']=function(_0x1dd0fe,_0x44e70e){var _0x4ac2bc={'raw':!![],'where':{'id':_0x1dd0fe['params']['id']}},_0x1d9705={};_0x1d9705[_0x070a('0x30')]=_[_0x070a('0x2d')](db[_0x070a('0x29')][_0x070a('0x3d')]);_0x1d9705[_0x070a('0x2c')]=_[_0x070a('0x2d')](_0x1dd0fe[_0x070a('0x2c')]);_0x1d9705['filters']=_[_0x070a('0x3e')](_0x1d9705['model'],_0x1d9705[_0x070a('0x2c')]);_0x4ac2bc[_0x070a('0x2e')]=_[_0x070a('0x3e')](_0x1d9705[_0x070a('0x30')],qs['fields'](_0x1dd0fe[_0x070a('0x2c')][_0x070a('0x2f')]));_0x4ac2bc[_0x070a('0x2e')]=_0x4ac2bc[_0x070a('0x2e')][_0x070a('0x3f')]?_0x4ac2bc['attributes']:_0x1d9705[_0x070a('0x30')];if(_0x1dd0fe['query']['includeAll']){_0x4ac2bc[_0x070a('0x40')]=[{'all':!![]}];}_0x4ac2bc=_['merge']({},_0x4ac2bc,_0x1dd0fe[_0x070a('0x38')]);return db[_0x070a('0x29')][_0x070a('0x41')](_0x4ac2bc)['then'](handleEntityNotFound(_0x44e70e,null))[_0x070a('0x21')](respondWithResult(_0x44e70e,null))[_0x070a('0x3c')](handleError(_0x44e70e,null));};exports['create']=function(_0x3f0db2,_0x1f67ec){return db[_0x070a('0x29')][_0x070a('0x42')](_0x3f0db2['body'],{})[_0x070a('0x21')](respondWithResult(_0x1f67ec,0xc9))[_0x070a('0x3c')](handleError(_0x1f67ec,null));};exports[_0x070a('0x20')]=function(_0x2374f4,_0x33762a){if(_0x2374f4[_0x070a('0x43')]['id']){delete _0x2374f4['body']['id'];}return db[_0x070a('0x29')]['find']({'where':{'id':_0x2374f4[_0x070a('0x44')]['id']}})['then'](handleEntityNotFound(_0x33762a,null))[_0x070a('0x21')](saveUpdates(_0x2374f4[_0x070a('0x43')],null))[_0x070a('0x21')](respondWithResult(_0x33762a,null))[_0x070a('0x3c')](handleError(_0x33762a,null));};exports[_0x070a('0x45')]=function(_0x313826,_0x12a574){return db[_0x070a('0x29')][_0x070a('0x41')]({'where':{'id':_0x313826[_0x070a('0x44')]['id']}})[_0x070a('0x21')](handleEntityNotFound(_0x12a574,null))['then'](removeEntity(_0x12a574,null))[_0x070a('0x3c')](handleError(_0x12a574,null));};exports['describe']=function(_0x13c560,_0x462672){return db['OpenchannelQueueReport'][_0x070a('0x46')]()[_0x070a('0x21')](respondWithResult(_0x462672,null))[_0x070a('0x3c')](handleError(_0x462672,null));}; \ No newline at end of file +var _0x07b3=['name','send','index','map','OpenchannelQueueReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','Content-Range','json','apply','save','update','then','destroy','error','stack'];(function(_0x4604a2,_0xa92cfd){var _0xc9895f=function(_0x3b9b51){while(--_0x3b9b51){_0x4604a2['push'](_0x4604a2['shift']());}};_0xc9895f(++_0xa92cfd);}(_0x07b3,0x1d9));var _0x307b=function(_0x30c9b7,_0x6344c0){_0x30c9b7=_0x30c9b7-0x0;var _0x26a9b9=_0x07b3[_0x30c9b7];return _0x26a9b9;};'use strict';var emlformat=require(_0x307b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x307b('0x1'));var jsonpatch=require(_0x307b('0x2'));var rp=require('request-promise');var moment=require(_0x307b('0x3'));var BPromise=require(_0x307b('0x4'));var Mustache=require(_0x307b('0x5'));var util=require(_0x307b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x307b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x307b('0x8'));var _=require(_0x307b('0x9'));var squel=require(_0x307b('0xa'));var crypto=require(_0x307b('0xb'));var jsforce=require(_0x307b('0xc'));var deskjs=require(_0x307b('0xd'));var toCsv=require(_0x307b('0x7'));var querystring=require(_0x307b('0xe'));var Papa=require(_0x307b('0xf'));var Redis=require('ioredis');var authService=require(_0x307b('0x10'));var qs=require(_0x307b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x307b('0x12'))('api');var utils=require(_0x307b('0x13'));var config=require(_0x307b('0x14'));var licenseUtil=require(_0x307b('0x15'));var db=require(_0x307b('0x16'))['db'];function respondWithStatusCode(_0x2de89b,_0x34ca64){_0x34ca64=_0x34ca64||0xcc;return function(_0x1af40e){if(_0x1af40e){return _0x2de89b['sendStatus'](_0x34ca64);}return _0x2de89b['status'](_0x34ca64)[_0x307b('0x17')]();};}function respondWithResult(_0x4eba54,_0x2579c5){_0x2579c5=_0x2579c5||0xc8;return function(_0x35b16f){if(_0x35b16f){return _0x4eba54[_0x307b('0x18')](_0x2579c5)['json'](_0x35b16f);}};}function respondWithFilteredResult(_0x16f2a2,_0x4c77d2){return function(_0x2d09fa){if(_0x2d09fa){var _0x369a4e=typeof _0x4c77d2['offset']===_0x307b('0x19')&&typeof _0x4c77d2[_0x307b('0x1a')]==='undefined';var _0x19ab1a=_0x2d09fa['count'];var _0x1abd32=_0x369a4e?0x0:_0x4c77d2['offset'];var _0x54fd8c=_0x369a4e?_0x2d09fa[_0x307b('0x1b')]:_0x4c77d2[_0x307b('0x1c')]+_0x4c77d2['limit'];var _0x29d6db;if(_0x54fd8c>=_0x19ab1a){_0x54fd8c=_0x19ab1a;_0x29d6db=0xc8;}else{_0x29d6db=0xce;}_0x16f2a2[_0x307b('0x18')](_0x29d6db);return _0x16f2a2['set'](_0x307b('0x1d'),_0x1abd32+'-'+_0x54fd8c+'/'+_0x19ab1a)[_0x307b('0x1e')](_0x2d09fa);}return null;};}function patchUpdates(_0x1e52a5){return function(_0x39fb3c){try{jsonpatch[_0x307b('0x1f')](_0x39fb3c,_0x1e52a5,!![]);}catch(_0x2c4999){return BPromise['reject'](_0x2c4999);}return _0x39fb3c[_0x307b('0x20')]();};}function saveUpdates(_0x3515d2,_0x2b2423){return function(_0x357f95){if(_0x357f95){return _0x357f95[_0x307b('0x21')](_0x3515d2)[_0x307b('0x22')](function(_0x46a17f){return _0x46a17f;});}return null;};}function removeEntity(_0x49b1ed,_0x5451c2){return function(_0x19de6b){if(_0x19de6b){return _0x19de6b[_0x307b('0x23')]()['then'](function(){_0x49b1ed[_0x307b('0x18')](0xcc)[_0x307b('0x17')]();});}};}function handleEntityNotFound(_0x30f07d,_0x731d34){return function(_0x412327){if(!_0x412327){_0x30f07d['sendStatus'](0x194);}return _0x412327;};}function handleError(_0x496ab9,_0x33bf17){_0x33bf17=_0x33bf17||0x1f4;return function(_0x18d0e1){logger[_0x307b('0x24')](_0x18d0e1[_0x307b('0x25')]);if(_0x18d0e1[_0x307b('0x26')]){delete _0x18d0e1[_0x307b('0x26')];}_0x496ab9[_0x307b('0x18')](_0x33bf17)[_0x307b('0x27')](_0x18d0e1);};}exports[_0x307b('0x28')]=function(_0x3803a9,_0xfce449){var _0x39eb74={},_0x346dfa={},_0x27cdd0={'count':0x0,'rows':[]};var _0x4771b3=_[_0x307b('0x29')](db[_0x307b('0x2a')]['rawAttributes'],function(_0x472652){return{'name':_0x472652[_0x307b('0x2b')],'type':_0x472652[_0x307b('0x2c')][_0x307b('0x2d')]};});_0x346dfa[_0x307b('0x2e')]=_['map'](_0x4771b3,_0x307b('0x26'));_0x346dfa['query']=_['keys'](_0x3803a9[_0x307b('0x2f')]);_0x346dfa[_0x307b('0x30')]=_[_0x307b('0x31')](_0x346dfa[_0x307b('0x2e')],_0x346dfa[_0x307b('0x2f')]);_0x39eb74[_0x307b('0x32')]=_['intersection'](_0x346dfa[_0x307b('0x2e')],qs[_0x307b('0x33')](_0x3803a9[_0x307b('0x2f')][_0x307b('0x33')]));_0x39eb74[_0x307b('0x32')]=_0x39eb74[_0x307b('0x32')]['length']?_0x39eb74[_0x307b('0x32')]:_0x346dfa[_0x307b('0x2e')];if(!_0x3803a9[_0x307b('0x2f')][_0x307b('0x34')]('nolimit')){_0x39eb74[_0x307b('0x1a')]=qs['limit'](_0x3803a9[_0x307b('0x2f')][_0x307b('0x1a')]);_0x39eb74[_0x307b('0x1c')]=qs['offset'](_0x3803a9[_0x307b('0x2f')]['offset']);}_0x39eb74[_0x307b('0x35')]=qs['sort'](_0x3803a9[_0x307b('0x2f')][_0x307b('0x36')]);_0x39eb74[_0x307b('0x37')]=qs[_0x307b('0x30')](_[_0x307b('0x38')](_0x3803a9[_0x307b('0x2f')],_0x346dfa[_0x307b('0x30')]),_0x4771b3);if(_0x3803a9[_0x307b('0x2f')][_0x307b('0x39')]){_0x39eb74[_0x307b('0x37')]=_[_0x307b('0x3a')](_0x39eb74[_0x307b('0x37')],{'$or':_[_0x307b('0x29')](_0x4771b3,function(_0x8a0e1a){if(_0x8a0e1a[_0x307b('0x2c')]!=='VIRTUAL'){var _0x51628b={};_0x51628b[_0x8a0e1a[_0x307b('0x26')]]={'$like':'%'+_0x3803a9[_0x307b('0x2f')]['filter']+'%'};return _0x51628b;}})});}_0x39eb74=_[_0x307b('0x3a')]({},_0x39eb74,_0x3803a9[_0x307b('0x3b')]);var _0x423d77={'where':_0x39eb74[_0x307b('0x37')]};return db['OpenchannelQueueReport'][_0x307b('0x1b')](_0x423d77)[_0x307b('0x22')](function(_0x40cedf){_0x27cdd0['count']=_0x40cedf;if(_0x3803a9[_0x307b('0x2f')][_0x307b('0x3c')]){_0x39eb74[_0x307b('0x3d')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x307b('0x3e')](_0x39eb74);})['then'](function(_0x272a62){_0x27cdd0[_0x307b('0x3f')]=_0x272a62;return _0x27cdd0;})['then'](respondWithFilteredResult(_0xfce449,_0x39eb74))[_0x307b('0x40')](handleError(_0xfce449,null));};exports[_0x307b('0x41')]=function(_0x341605,_0x353aee){var _0x3a951e={'raw':!![],'where':{'id':_0x341605[_0x307b('0x42')]['id']}},_0x56925a={};_0x56925a[_0x307b('0x2e')]=_[_0x307b('0x43')](db[_0x307b('0x2a')]['rawAttributes']);_0x56925a[_0x307b('0x2f')]=_[_0x307b('0x43')](_0x341605[_0x307b('0x2f')]);_0x56925a[_0x307b('0x30')]=_[_0x307b('0x31')](_0x56925a['model'],_0x56925a[_0x307b('0x2f')]);_0x3a951e['attributes']=_[_0x307b('0x31')](_0x56925a['model'],qs[_0x307b('0x33')](_0x341605['query'][_0x307b('0x33')]));_0x3a951e[_0x307b('0x32')]=_0x3a951e[_0x307b('0x32')][_0x307b('0x44')]?_0x3a951e[_0x307b('0x32')]:_0x56925a['model'];if(_0x341605[_0x307b('0x2f')][_0x307b('0x3c')]){_0x3a951e[_0x307b('0x3d')]=[{'all':!![]}];}_0x3a951e=_['merge']({},_0x3a951e,_0x341605[_0x307b('0x3b')]);return db['OpenchannelQueueReport'][_0x307b('0x45')](_0x3a951e)[_0x307b('0x22')](handleEntityNotFound(_0x353aee,null))['then'](respondWithResult(_0x353aee,null))['catch'](handleError(_0x353aee,null));};exports[_0x307b('0x46')]=function(_0xd8f98f,_0x254a28){return db[_0x307b('0x2a')][_0x307b('0x46')](_0xd8f98f['body'],{})['then'](respondWithResult(_0x254a28,0xc9))[_0x307b('0x40')](handleError(_0x254a28,null));};exports[_0x307b('0x21')]=function(_0x5463e0,_0x49b304){if(_0x5463e0[_0x307b('0x47')]['id']){delete _0x5463e0[_0x307b('0x47')]['id'];}return db[_0x307b('0x2a')][_0x307b('0x45')]({'where':{'id':_0x5463e0['params']['id']}})[_0x307b('0x22')](handleEntityNotFound(_0x49b304,null))['then'](saveUpdates(_0x5463e0['body'],null))[_0x307b('0x22')](respondWithResult(_0x49b304,null))['catch'](handleError(_0x49b304,null));};exports[_0x307b('0x23')]=function(_0x203931,_0x41795d){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x203931['params']['id']}})[_0x307b('0x22')](handleEntityNotFound(_0x41795d,null))[_0x307b('0x22')](removeEntity(_0x41795d,null))[_0x307b('0x40')](handleError(_0x41795d,null));};exports[_0x307b('0x48')]=function(_0x33cbb4,_0x4ea06a){return db[_0x307b('0x2a')][_0x307b('0x48')]()[_0x307b('0x22')](respondWithResult(_0x4ea06a,null))[_0x307b('0x40')](handleError(_0x4ea06a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index a3e94f5..580523d 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x834746,_0x369c54){var _0x516edc=function(_0x2b3285){while(--_0x2b3285){_0x834746['push'](_0x834746['shift']());}};_0x516edc(++_0x369c54);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1afabf,_0x56fdcc){_0x1afabf=_0x1afabf-0x0;var _0x497ff1=_0x5fc3[_0x1afabf];return _0x497ff1;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x28bbd1,_0x54c623){var _0x2f2b7c=function(_0x5c6312){while(--_0x5c6312){_0x28bbd1['push'](_0x28bbd1['shift']());}};_0x2f2b7c(++_0x54c623);}(_0x326f,0xd1));var _0xf326=function(_0x11f4d2,_0x8793d8){_0x11f4d2=_0x11f4d2-0x0;var _0x230e74=_0x326f[_0x11f4d2];return _0x230e74;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index dd45cf3..100596a 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 _0x17a7=['info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','debug','catch','update','raw','attributes','limit','UpdateOpenchannelQueueReport','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then'];(function(_0x2c7bf7,_0x349742){var _0x37afc0=function(_0x5ac6c9){while(--_0x5ac6c9){_0x2c7bf7['push'](_0x2c7bf7['shift']());}};_0x37afc0(++_0x349742);}(_0x17a7,0xc2));var _0x717a=function(_0x4fb725,_0x30b057){_0x4fb725=_0x4fb725-0x0;var _0x4d63aa=_0x17a7[_0x4fb725];return _0x4d63aa;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x717a('0x0'));var rs=require(_0x717a('0x1'));var fs=require('fs');var Redis=require(_0x717a('0x2'));var db=require(_0x717a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x717a('0x4'))('rpc');var config=require(_0x717a('0x5'));var jayson=require(_0x717a('0x6'));var client=jayson['client'][_0x717a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ca7a6,_0xd7d2ce,_0x311738){return new BPromise(function(_0x536824,_0x1066d4){return client['request'](_0x1ca7a6,_0x311738)[_0x717a('0x8')](function(_0x567130){logger[_0x717a('0x9')](_0x717a('0xa'),_0xd7d2ce,_0x717a('0xb'));logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'),JSON[_0x717a('0xc')](_0x567130));if(_0x567130[_0x717a('0xd')]){if(_0x567130[_0x717a('0xd')][_0x717a('0xe')]===0x1f4){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x567130['error'][_0x717a('0xf')]);return _0x1066d4(_0x567130['error']['message']);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xd7d2ce,_0x567130[_0x717a('0xd')]['message']);return _0x536824(_0x567130[_0x717a('0xd')]['message']);}else{logger[_0x717a('0x9')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'));_0x536824(_0x567130[_0x717a('0x10')][_0x717a('0xf')]);}})['catch'](function(_0x186b4d){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x186b4d);_0x1066d4(_0x186b4d);});});}exports[_0x717a('0x11')]=function(_0x152e10){var _0x8b295=this;return new Promise(function(_0x45dc38,_0x2fe7a7){return db[_0x717a('0x12')][_0x717a('0x13')](_0x152e10[_0x717a('0x14')],{'raw':_0x152e10[_0x717a('0x15')]?_0x152e10['options']['raw']===undefined?!![]:![]:!![]})[_0x717a('0x8')](function(_0x1d7ebd){logger[_0x717a('0x9')](_0x717a('0x11'),_0x152e10);logger[_0x717a('0x16')](_0x717a('0x11'),_0x152e10,JSON[_0x717a('0xc')](_0x1d7ebd));_0x45dc38(_0x1d7ebd);})[_0x717a('0x17')](function(_0x4e95dc){logger[_0x717a('0xd')](_0x717a('0x11'),_0x4e95dc[_0x717a('0xf')],_0x152e10);_0x2fe7a7(_0x8b295[_0x717a('0xd')](0x1f4,_0x4e95dc[_0x717a('0xf')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x345d54){var _0x630617=this;return new Promise(function(_0x3bae98,_0x5e578e){return db[_0x717a('0x12')][_0x717a('0x18')](_0x345d54['body'],{'raw':_0x345d54[_0x717a('0x15')]?_0x345d54[_0x717a('0x15')][_0x717a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x345d54[_0x717a('0x15')]?_0x345d54[_0x717a('0x15')]['where']||null:null,'attributes':_0x345d54[_0x717a('0x15')]?_0x345d54[_0x717a('0x15')][_0x717a('0x1a')]||null:null,'limit':_0x345d54[_0x717a('0x15')]?_0x345d54[_0x717a('0x15')][_0x717a('0x1b')]||null:null})[_0x717a('0x8')](function(_0x5dccb8){logger[_0x717a('0x9')](_0x717a('0x1c'),_0x345d54);logger[_0x717a('0x16')]('UpdateOpenchannelQueueReport',_0x345d54,JSON['stringify'](_0x5dccb8));_0x3bae98(_0x5dccb8);})[_0x717a('0x17')](function(_0x45847a){logger[_0x717a('0xd')]('UpdateOpenchannelQueueReport',_0x45847a[_0x717a('0xf')],_0x345d54);_0x5e578e(_0x630617[_0x717a('0xd')](0x1f4,_0x45847a['message']));});});}; \ No newline at end of file +var _0xa7fa=['info','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','update','raw','where','limit','UpdateOpenchannelQueueReport','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1d020a,_0x1b5dd3){var _0x504b2f=function(_0xff2f01){while(--_0xff2f01){_0x1d020a['push'](_0x1d020a['shift']());}};_0x504b2f(++_0x1b5dd3);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa7fa[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa7f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaa7f('0x1'));var rs=require(_0xaa7f('0x2'));var fs=require('fs');var Redis=require(_0xaa7f('0x3'));var db=require(_0xaa7f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa7f('0x5'))(_0xaa7f('0x6'));var config=require(_0xaa7f('0x7'));var jayson=require(_0xaa7f('0x8'));var client=jayson['client'][_0xaa7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48105b,_0x50bab6,_0x3898a3){return new BPromise(function(_0x506a91,_0x3ac236){return client[_0xaa7f('0xa')](_0x48105b,_0x3898a3)[_0xaa7f('0xb')](function(_0x2dbcb6){logger['info'](_0xaa7f('0xc'),_0x50bab6,_0xaa7f('0xd'));logger['debug'](_0xaa7f('0xe'),_0x50bab6,_0xaa7f('0xd'),JSON[_0xaa7f('0xf')](_0x2dbcb6));if(_0x2dbcb6[_0xaa7f('0x10')]){if(_0x2dbcb6['error']['code']===0x1f4){logger[_0xaa7f('0x10')](_0xaa7f('0xc'),_0x50bab6,_0x2dbcb6[_0xaa7f('0x10')][_0xaa7f('0x11')]);return _0x3ac236(_0x2dbcb6[_0xaa7f('0x10')][_0xaa7f('0x11')]);}logger[_0xaa7f('0x10')](_0xaa7f('0xc'),_0x50bab6,_0x2dbcb6[_0xaa7f('0x10')]['message']);return _0x506a91(_0x2dbcb6[_0xaa7f('0x10')]['message']);}else{logger[_0xaa7f('0x12')](_0xaa7f('0xc'),_0x50bab6,_0xaa7f('0xd'));_0x506a91(_0x2dbcb6['result'][_0xaa7f('0x11')]);}})[_0xaa7f('0x13')](function(_0x1bd3f9){logger[_0xaa7f('0x10')](_0xaa7f('0xc'),_0x50bab6,_0x1bd3f9);_0x3ac236(_0x1bd3f9);});});}exports[_0xaa7f('0x14')]=function(_0x2c17c4){var _0x4fbd09=this;return new Promise(function(_0x90863a,_0x1e18a6){return db[_0xaa7f('0x15')][_0xaa7f('0x16')](_0x2c17c4['body'],{'raw':_0x2c17c4['options']?_0x2c17c4[_0xaa7f('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xaa7f('0xb')](function(_0x21e870){logger['info'](_0xaa7f('0x14'),_0x2c17c4);logger['debug'](_0xaa7f('0x14'),_0x2c17c4,JSON[_0xaa7f('0xf')](_0x21e870));_0x90863a(_0x21e870);})[_0xaa7f('0x13')](function(_0x516d7e){logger[_0xaa7f('0x10')](_0xaa7f('0x14'),_0x516d7e[_0xaa7f('0x11')],_0x2c17c4);_0x1e18a6(_0x4fbd09[_0xaa7f('0x10')](0x1f4,_0x516d7e['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x28d627){var _0x3effde=this;return new Promise(function(_0x3076f4,_0x246a18){return db[_0xaa7f('0x15')][_0xaa7f('0x18')](_0x28d627['body'],{'raw':_0x28d627['options']?_0x28d627['options'][_0xaa7f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28d627['options']?_0x28d627[_0xaa7f('0x17')][_0xaa7f('0x1a')]||null:null,'attributes':_0x28d627['options']?_0x28d627[_0xaa7f('0x17')]['attributes']||null:null,'limit':_0x28d627[_0xaa7f('0x17')]?_0x28d627[_0xaa7f('0x17')][_0xaa7f('0x1b')]||null:null})[_0xaa7f('0xb')](function(_0x223321){logger['info'](_0xaa7f('0x1c'),_0x28d627);logger[_0xaa7f('0x1d')](_0xaa7f('0x1c'),_0x28d627,JSON['stringify'](_0x223321));_0x3076f4(_0x223321);})[_0xaa7f('0x13')](function(_0x1b17e2){logger[_0xaa7f('0x10')](_0xaa7f('0x1c'),_0x1b17e2[_0xaa7f('0x11')],_0x28d627);_0x246a18(_0x3effde[_0xaa7f('0x10')](0x1f4,_0x1b17e2['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index acc6319..f9071e0 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 _0xac46=['isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xac46,0x11c));var _0x6ac4=function(_0x47de22,_0xdceab5){_0x47de22=_0x47de22-0x0;var _0x10d2c1=_0xac46[_0x47de22];return _0x10d2c1;};'use strict';var multer=require(_0x6ac4('0x0'));var util=require(_0x6ac4('0x1'));var path=require(_0x6ac4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ac4('0x3')]();var fs_extra=require(_0x6ac4('0x4'));var auth=require(_0x6ac4('0x5'));var interaction=require(_0x6ac4('0x6'));var config=require(_0x6ac4('0x7'));var controller=require(_0x6ac4('0x8'));router[_0x6ac4('0x9')]('/',auth[_0x6ac4('0xa')](),controller[_0x6ac4('0xb')]);router['get'](_0x6ac4('0xc'),auth['isAuthenticated'](),controller[_0x6ac4('0xd')]);router[_0x6ac4('0x9')](_0x6ac4('0xe'),auth[_0x6ac4('0xa')](),controller['show']);router[_0x6ac4('0xf')]('/',auth[_0x6ac4('0xa')](),controller[_0x6ac4('0x10')]);router[_0x6ac4('0x11')]('/:id',auth[_0x6ac4('0xa')](),controller[_0x6ac4('0x12')]);router[_0x6ac4('0x13')]('/:id',auth[_0x6ac4('0xa')](),controller['destroy']);module[_0x6ac4('0x14')]=router; \ No newline at end of file +var _0x1d58=['update','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put'];(function(_0x100211,_0x3d76fe){var _0x311655=function(_0x46be7e){while(--_0x46be7e){_0x100211['push'](_0x100211['shift']());}};_0x311655(++_0x3d76fe);}(_0x1d58,0x120));var _0x81d5=function(_0x2e079b,_0x3442df){_0x2e079b=_0x2e079b-0x0;var _0x2a4749=_0x1d58[_0x2e079b];return _0x2a4749;};'use strict';var multer=require('multer');var util=require(_0x81d5('0x0'));var path=require(_0x81d5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x81d5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x81d5('0x3'));var interaction=require(_0x81d5('0x4'));var config=require(_0x81d5('0x5'));var controller=require(_0x81d5('0x6'));router['get']('/',auth[_0x81d5('0x7')](),controller['index']);router[_0x81d5('0x8')](_0x81d5('0x9'),auth[_0x81d5('0x7')](),controller[_0x81d5('0xa')]);router[_0x81d5('0x8')](_0x81d5('0xb'),auth[_0x81d5('0x7')](),controller[_0x81d5('0xc')]);router[_0x81d5('0xd')]('/',auth[_0x81d5('0x7')](),controller[_0x81d5('0xe')]);router[_0x81d5('0xf')](_0x81d5('0xb'),auth[_0x81d5('0x7')](),controller[_0x81d5('0x10')]);router['delete']('/:id',auth[_0x81d5('0x7')](),controller[_0x81d5('0x11')]);module[_0x81d5('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 3bef833..597862a 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x46c61f,_0x2165a2){var _0xd58304=function(_0xa1ffa1){while(--_0xa1ffa1){_0x46c61f['push'](_0x46c61f['shift']());}};_0xd58304(++_0x2165a2);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5e944a,_0x2847b4){_0x5e944a=_0x5e944a-0x0;var _0x38f07b=_0xf3cd[_0x5e944a];return _0x38f07b;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x34ac75,_0x75b3a2){var _0x389365=function(_0x4a47dc){while(--_0x4a47dc){_0x34ac75['push'](_0x34ac75['shift']());}};_0x389365(++_0x75b3a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 3e0e388..8377094 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 _0xc809=['then','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','catch','params','keys','include','find','create','body','destroy','describe','eml-format','request-promise','bluebird','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','save','update'];(function(_0x17f10f,_0x529d1a){var _0x17cbea=function(_0x3246e7){while(--_0x3246e7){_0x17f10f['push'](_0x17f10f['shift']());}};_0x17cbea(++_0x529d1a);}(_0xc809,0x139));var _0x9c80=function(_0x409a02,_0x60b286){_0x409a02=_0x409a02-0x0;var _0x456066=_0xc809[_0x409a02];return _0x456066;};'use strict';var emlformat=require(_0x9c80('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9c80('0x1'));var moment=require('moment');var BPromise=require(_0x9c80('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9c80('0x3'));var sox=require('sox');var csv=require(_0x9c80('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c80('0x5'));var _=require(_0x9c80('0x6'));var squel=require(_0x9c80('0x7'));var crypto=require(_0x9c80('0x8'));var jsforce=require(_0x9c80('0x9'));var deskjs=require(_0x9c80('0xa'));var toCsv=require(_0x9c80('0x4'));var querystring=require(_0x9c80('0xb'));var Papa=require(_0x9c80('0xc'));var Redis=require(_0x9c80('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9c80('0xe'));var as=require(_0x9c80('0xf'));var hardwareService=require(_0x9c80('0x10'));var logger=require(_0x9c80('0x11'))('api');var utils=require(_0x9c80('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9c80('0x13'));var db=require(_0x9c80('0x14'))['db'];function respondWithStatusCode(_0x5647d7,_0x22b34a){_0x22b34a=_0x22b34a||0xcc;return function(_0x7362c2){if(_0x7362c2){return _0x5647d7[_0x9c80('0x15')](_0x22b34a);}return _0x5647d7[_0x9c80('0x16')](_0x22b34a)['end']();};}function respondWithResult(_0xb77972,_0x238da7){_0x238da7=_0x238da7||0xc8;return function(_0x33f1d3){if(_0x33f1d3){return _0xb77972[_0x9c80('0x16')](_0x238da7)[_0x9c80('0x17')](_0x33f1d3);}};}function respondWithFilteredResult(_0x3bc6b1,_0x2a9c73){return function(_0x2b6f0c){if(_0x2b6f0c){var _0x35b3ae=typeof _0x2a9c73['offset']==='undefined'&&typeof _0x2a9c73[_0x9c80('0x18')]===_0x9c80('0x19');var _0x16c5c5=_0x2b6f0c['count'];var _0x53fa07=_0x35b3ae?0x0:_0x2a9c73['offset'];var _0x4ae206=_0x35b3ae?_0x2b6f0c[_0x9c80('0x1a')]:_0x2a9c73[_0x9c80('0x1b')]+_0x2a9c73[_0x9c80('0x18')];var _0x4b4384;if(_0x4ae206>=_0x16c5c5){_0x4ae206=_0x16c5c5;_0x4b4384=0xc8;}else{_0x4b4384=0xce;}_0x3bc6b1[_0x9c80('0x16')](_0x4b4384);return _0x3bc6b1[_0x9c80('0x1c')]('Content-Range',_0x53fa07+'-'+_0x4ae206+'/'+_0x16c5c5)['json'](_0x2b6f0c);}return null;};}function patchUpdates(_0x12ff2b){return function(_0x42f665){try{jsonpatch[_0x9c80('0x1d')](_0x42f665,_0x12ff2b,!![]);}catch(_0x316c2b){return BPromise['reject'](_0x316c2b);}return _0x42f665[_0x9c80('0x1e')]();};}function saveUpdates(_0x3a752b,_0x46f7bf){return function(_0x218bac){if(_0x218bac){return _0x218bac[_0x9c80('0x1f')](_0x3a752b)[_0x9c80('0x20')](function(_0x5d2f9a){return _0x5d2f9a;});}return null;};}function removeEntity(_0x2c2113,_0x581924){return function(_0x1fbe08){if(_0x1fbe08){return _0x1fbe08['destroy']()['then'](function(){_0x2c2113[_0x9c80('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53dde6,_0x5b7e9c){return function(_0x4bec86){if(!_0x4bec86){_0x53dde6['sendStatus'](0x194);}return _0x4bec86;};}function handleError(_0x50d035,_0x34f58d){_0x34f58d=_0x34f58d||0x1f4;return function(_0x3b159f){logger[_0x9c80('0x21')](_0x3b159f[_0x9c80('0x22')]);if(_0x3b159f[_0x9c80('0x23')]){delete _0x3b159f['name'];}_0x50d035[_0x9c80('0x16')](_0x34f58d)[_0x9c80('0x24')](_0x3b159f);};}exports[_0x9c80('0x25')]=function(_0xb750b,_0x51b2cc){var _0x5dcf6e={},_0x16af6b={},_0x3056a4={'count':0x0,'rows':[]};var _0xf48e2c=_['map'](db[_0x9c80('0x26')][_0x9c80('0x27')],function(_0x399149){return{'name':_0x399149[_0x9c80('0x28')],'type':_0x399149[_0x9c80('0x29')]['key']};});_0x16af6b[_0x9c80('0x2a')]=_[_0x9c80('0x2b')](_0xf48e2c,'name');_0x16af6b[_0x9c80('0x2c')]=_['keys'](_0xb750b[_0x9c80('0x2c')]);_0x16af6b[_0x9c80('0x2d')]=_[_0x9c80('0x2e')](_0x16af6b[_0x9c80('0x2a')],_0x16af6b[_0x9c80('0x2c')]);_0x5dcf6e['attributes']=_[_0x9c80('0x2e')](_0x16af6b[_0x9c80('0x2a')],qs[_0x9c80('0x2f')](_0xb750b[_0x9c80('0x2c')][_0x9c80('0x2f')]));_0x5dcf6e[_0x9c80('0x30')]=_0x5dcf6e[_0x9c80('0x30')][_0x9c80('0x31')]?_0x5dcf6e['attributes']:_0x16af6b[_0x9c80('0x2a')];if(!_0xb750b[_0x9c80('0x2c')][_0x9c80('0x32')](_0x9c80('0x33'))){_0x5dcf6e[_0x9c80('0x18')]=qs[_0x9c80('0x18')](_0xb750b[_0x9c80('0x2c')][_0x9c80('0x18')]);_0x5dcf6e[_0x9c80('0x1b')]=qs['offset'](_0xb750b[_0x9c80('0x2c')][_0x9c80('0x1b')]);}_0x5dcf6e[_0x9c80('0x34')]=qs[_0x9c80('0x35')](_0xb750b[_0x9c80('0x2c')]['sort']);_0x5dcf6e[_0x9c80('0x36')]=qs[_0x9c80('0x2d')](_['pick'](_0xb750b[_0x9c80('0x2c')],_0x16af6b[_0x9c80('0x2d')]),_0xf48e2c);if(_0xb750b['query'][_0x9c80('0x37')]){_0x5dcf6e[_0x9c80('0x36')]=_[_0x9c80('0x38')](_0x5dcf6e[_0x9c80('0x36')],{'$or':_['map'](_0xf48e2c,function(_0x58d06e){if(_0x58d06e[_0x9c80('0x29')]!==_0x9c80('0x39')){var _0xcdbb94={};_0xcdbb94[_0x58d06e[_0x9c80('0x23')]]={'$like':'%'+_0xb750b[_0x9c80('0x2c')][_0x9c80('0x37')]+'%'};return _0xcdbb94;}})});}_0x5dcf6e=_[_0x9c80('0x38')]({},_0x5dcf6e,_0xb750b[_0x9c80('0x3a')]);var _0x838dd8={'where':_0x5dcf6e[_0x9c80('0x36')]};return db[_0x9c80('0x26')][_0x9c80('0x1a')](_0x838dd8)[_0x9c80('0x20')](function(_0x46737f){_0x3056a4[_0x9c80('0x1a')]=_0x46737f;if(_0xb750b[_0x9c80('0x2c')][_0x9c80('0x3b')]){_0x5dcf6e['include']=[{'all':!![]}];}return db[_0x9c80('0x26')]['findAll'](_0x5dcf6e);})['then'](function(_0x14f6a5){_0x3056a4['rows']=_0x14f6a5;return _0x3056a4;})[_0x9c80('0x20')](respondWithFilteredResult(_0x51b2cc,_0x5dcf6e))[_0x9c80('0x3c')](handleError(_0x51b2cc,null));};exports['show']=function(_0x20f339,_0x239940){var _0x5302d8={'raw':!![],'where':{'id':_0x20f339[_0x9c80('0x3d')]['id']}},_0x5f0b08={};_0x5f0b08[_0x9c80('0x2a')]=_[_0x9c80('0x3e')](db[_0x9c80('0x26')][_0x9c80('0x27')]);_0x5f0b08['query']=_[_0x9c80('0x3e')](_0x20f339[_0x9c80('0x2c')]);_0x5f0b08[_0x9c80('0x2d')]=_['intersection'](_0x5f0b08[_0x9c80('0x2a')],_0x5f0b08[_0x9c80('0x2c')]);_0x5302d8[_0x9c80('0x30')]=_[_0x9c80('0x2e')](_0x5f0b08[_0x9c80('0x2a')],qs[_0x9c80('0x2f')](_0x20f339[_0x9c80('0x2c')][_0x9c80('0x2f')]));_0x5302d8['attributes']=_0x5302d8['attributes']['length']?_0x5302d8[_0x9c80('0x30')]:_0x5f0b08[_0x9c80('0x2a')];if(_0x20f339[_0x9c80('0x2c')][_0x9c80('0x3b')]){_0x5302d8[_0x9c80('0x3f')]=[{'all':!![]}];}_0x5302d8=_[_0x9c80('0x38')]({},_0x5302d8,_0x20f339[_0x9c80('0x3a')]);return db['OpenchannelTransferReport'][_0x9c80('0x40')](_0x5302d8)['then'](handleEntityNotFound(_0x239940,null))[_0x9c80('0x20')](respondWithResult(_0x239940,null))['catch'](handleError(_0x239940,null));};exports[_0x9c80('0x41')]=function(_0x14fb7b,_0xb22cc5){return db['OpenchannelTransferReport'][_0x9c80('0x41')](_0x14fb7b[_0x9c80('0x42')],{})[_0x9c80('0x20')](respondWithResult(_0xb22cc5,0xc9))[_0x9c80('0x3c')](handleError(_0xb22cc5,null));};exports[_0x9c80('0x1f')]=function(_0x4b91d9,_0x1a7e7a){if(_0x4b91d9[_0x9c80('0x42')]['id']){delete _0x4b91d9[_0x9c80('0x42')]['id'];}return db[_0x9c80('0x26')][_0x9c80('0x40')]({'where':{'id':_0x4b91d9[_0x9c80('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1a7e7a,null))['then'](saveUpdates(_0x4b91d9['body'],null))[_0x9c80('0x20')](respondWithResult(_0x1a7e7a,null))[_0x9c80('0x3c')](handleError(_0x1a7e7a,null));};exports[_0x9c80('0x43')]=function(_0x1dfad4,_0x11c39c){return db[_0x9c80('0x26')][_0x9c80('0x40')]({'where':{'id':_0x1dfad4['params']['id']}})[_0x9c80('0x20')](handleEntityNotFound(_0x11c39c,null))[_0x9c80('0x20')](removeEntity(_0x11c39c,null))[_0x9c80('0x3c')](handleError(_0x11c39c,null));};exports[_0x9c80('0x44')]=function(_0x298a1b,_0x290606){return db[_0x9c80('0x26')]['describe']()[_0x9c80('0x20')](respondWithResult(_0x290606,null))['catch'](handleError(_0x290606,null));}; \ No newline at end of file +var _0x75ec=['filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','json','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3f3798,_0x5c8a3d){var _0x207216=function(_0x572087){while(--_0x572087){_0x3f3798['push'](_0x3f3798['shift']());}};_0x207216(++_0x5c8a3d);}(_0x75ec,0x152));var _0xc75e=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x75ec[_0x1969a7];return _0x3d665f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc75e('0x0'));var zipdir=require(_0xc75e('0x1'));var jsonpatch=require(_0xc75e('0x2'));var rp=require(_0xc75e('0x3'));var moment=require(_0xc75e('0x4'));var BPromise=require(_0xc75e('0x5'));var Mustache=require(_0xc75e('0x6'));var util=require('util');var path=require(_0xc75e('0x7'));var sox=require(_0xc75e('0x8'));var csv=require(_0xc75e('0x9'));var ejs=require(_0xc75e('0xa'));var fs=require('fs');var fs_extra=require(_0xc75e('0xb'));var _=require(_0xc75e('0xc'));var squel=require('squel');var crypto=require(_0xc75e('0xd'));var jsforce=require(_0xc75e('0xe'));var deskjs=require(_0xc75e('0xf'));var toCsv=require(_0xc75e('0x9'));var querystring=require(_0xc75e('0x10'));var Papa=require(_0xc75e('0x11'));var Redis=require(_0xc75e('0x12'));var authService=require(_0xc75e('0x13'));var qs=require(_0xc75e('0x14'));var as=require(_0xc75e('0x15'));var hardwareService=require(_0xc75e('0x16'));var logger=require('../../config/logger')(_0xc75e('0x17'));var utils=require(_0xc75e('0x18'));var config=require(_0xc75e('0x19'));var licenseUtil=require(_0xc75e('0x1a'));var db=require(_0xc75e('0x1b'))['db'];function respondWithStatusCode(_0x1d3502,_0x3c868d){_0x3c868d=_0x3c868d||0xcc;return function(_0x55b848){if(_0x55b848){return _0x1d3502['sendStatus'](_0x3c868d);}return _0x1d3502[_0xc75e('0x1c')](_0x3c868d)['end']();};}function respondWithResult(_0x4922fd,_0x293a59){_0x293a59=_0x293a59||0xc8;return function(_0x4cdce0){if(_0x4cdce0){return _0x4922fd[_0xc75e('0x1c')](_0x293a59)['json'](_0x4cdce0);}};}function respondWithFilteredResult(_0x107f7e,_0x345960){return function(_0x54b47e){if(_0x54b47e){var _0x5bd0f6=typeof _0x345960[_0xc75e('0x1d')]==='undefined'&&typeof _0x345960[_0xc75e('0x1e')]===_0xc75e('0x1f');var _0x592c2a=_0x54b47e[_0xc75e('0x20')];var _0x2d2025=_0x5bd0f6?0x0:_0x345960['offset'];var _0xd139af=_0x5bd0f6?_0x54b47e['count']:_0x345960[_0xc75e('0x1d')]+_0x345960[_0xc75e('0x1e')];var _0x39fb9a;if(_0xd139af>=_0x592c2a){_0xd139af=_0x592c2a;_0x39fb9a=0xc8;}else{_0x39fb9a=0xce;}_0x107f7e[_0xc75e('0x1c')](_0x39fb9a);return _0x107f7e[_0xc75e('0x21')]('Content-Range',_0x2d2025+'-'+_0xd139af+'/'+_0x592c2a)[_0xc75e('0x22')](_0x54b47e);}return null;};}function patchUpdates(_0x4c6440){return function(_0x48832c){try{jsonpatch[_0xc75e('0x23')](_0x48832c,_0x4c6440,!![]);}catch(_0x420ac5){return BPromise[_0xc75e('0x24')](_0x420ac5);}return _0x48832c[_0xc75e('0x25')]();};}function saveUpdates(_0x305b7b,_0x3e78ff){return function(_0x541d34){if(_0x541d34){return _0x541d34['update'](_0x305b7b)[_0xc75e('0x26')](function(_0x5b5159){return _0x5b5159;});}return null;};}function removeEntity(_0x2a92be,_0xdb7763){return function(_0x3851f5){if(_0x3851f5){return _0x3851f5[_0xc75e('0x27')]()[_0xc75e('0x26')](function(){_0x2a92be[_0xc75e('0x1c')](0xcc)[_0xc75e('0x28')]();});}};}function handleEntityNotFound(_0x227d8a,_0x1927b7){return function(_0x4a9346){if(!_0x4a9346){_0x227d8a[_0xc75e('0x29')](0x194);}return _0x4a9346;};}function handleError(_0x13d1e2,_0x4fe88f){_0x4fe88f=_0x4fe88f||0x1f4;return function(_0x4f42fe){logger[_0xc75e('0x2a')](_0x4f42fe[_0xc75e('0x2b')]);if(_0x4f42fe[_0xc75e('0x2c')]){delete _0x4f42fe[_0xc75e('0x2c')];}_0x13d1e2[_0xc75e('0x1c')](_0x4fe88f)['send'](_0x4f42fe);};}exports[_0xc75e('0x2d')]=function(_0x54e02a,_0x38d7e3){var _0x4a2129={},_0x44f524={},_0x4a5adb={'count':0x0,'rows':[]};var _0x55fc03=_[_0xc75e('0x2e')](db[_0xc75e('0x2f')][_0xc75e('0x30')],function(_0x13c5b7){return{'name':_0x13c5b7['fieldName'],'type':_0x13c5b7[_0xc75e('0x31')][_0xc75e('0x32')]};});_0x44f524[_0xc75e('0x33')]=_[_0xc75e('0x2e')](_0x55fc03,_0xc75e('0x2c'));_0x44f524[_0xc75e('0x34')]=_[_0xc75e('0x35')](_0x54e02a[_0xc75e('0x34')]);_0x44f524['filters']=_[_0xc75e('0x36')](_0x44f524[_0xc75e('0x33')],_0x44f524[_0xc75e('0x34')]);_0x4a2129[_0xc75e('0x37')]=_[_0xc75e('0x36')](_0x44f524[_0xc75e('0x33')],qs[_0xc75e('0x38')](_0x54e02a['query'][_0xc75e('0x38')]));_0x4a2129[_0xc75e('0x37')]=_0x4a2129['attributes']['length']?_0x4a2129[_0xc75e('0x37')]:_0x44f524[_0xc75e('0x33')];if(!_0x54e02a[_0xc75e('0x34')][_0xc75e('0x39')](_0xc75e('0x3a'))){_0x4a2129['limit']=qs['limit'](_0x54e02a['query'][_0xc75e('0x1e')]);_0x4a2129['offset']=qs[_0xc75e('0x1d')](_0x54e02a[_0xc75e('0x34')][_0xc75e('0x1d')]);}_0x4a2129[_0xc75e('0x3b')]=qs[_0xc75e('0x3c')](_0x54e02a[_0xc75e('0x34')][_0xc75e('0x3c')]);_0x4a2129[_0xc75e('0x3d')]=qs[_0xc75e('0x3e')](_['pick'](_0x54e02a[_0xc75e('0x34')],_0x44f524['filters']),_0x55fc03);if(_0x54e02a['query'][_0xc75e('0x3f')]){_0x4a2129[_0xc75e('0x3d')]=_[_0xc75e('0x40')](_0x4a2129[_0xc75e('0x3d')],{'$or':_[_0xc75e('0x2e')](_0x55fc03,function(_0x504490){if(_0x504490[_0xc75e('0x31')]!==_0xc75e('0x41')){var _0x141741={};_0x141741[_0x504490['name']]={'$like':'%'+_0x54e02a[_0xc75e('0x34')][_0xc75e('0x3f')]+'%'};return _0x141741;}})});}_0x4a2129=_[_0xc75e('0x40')]({},_0x4a2129,_0x54e02a[_0xc75e('0x42')]);var _0x24bd0e={'where':_0x4a2129['where']};return db[_0xc75e('0x2f')]['count'](_0x24bd0e)[_0xc75e('0x26')](function(_0x4ed737){_0x4a5adb[_0xc75e('0x20')]=_0x4ed737;if(_0x54e02a[_0xc75e('0x34')][_0xc75e('0x43')]){_0x4a2129['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xc75e('0x44')](_0x4a2129);})[_0xc75e('0x26')](function(_0x1f5f41){_0x4a5adb[_0xc75e('0x45')]=_0x1f5f41;return _0x4a5adb;})['then'](respondWithFilteredResult(_0x38d7e3,_0x4a2129))[_0xc75e('0x46')](handleError(_0x38d7e3,null));};exports[_0xc75e('0x47')]=function(_0x329033,_0x14d07c){var _0x1b1079={'raw':!![],'where':{'id':_0x329033['params']['id']}},_0x440ef4={};_0x440ef4['model']=_['keys'](db[_0xc75e('0x2f')][_0xc75e('0x30')]);_0x440ef4[_0xc75e('0x34')]=_[_0xc75e('0x35')](_0x329033['query']);_0x440ef4[_0xc75e('0x3e')]=_[_0xc75e('0x36')](_0x440ef4[_0xc75e('0x33')],_0x440ef4[_0xc75e('0x34')]);_0x1b1079[_0xc75e('0x37')]=_['intersection'](_0x440ef4[_0xc75e('0x33')],qs[_0xc75e('0x38')](_0x329033[_0xc75e('0x34')][_0xc75e('0x38')]));_0x1b1079['attributes']=_0x1b1079['attributes'][_0xc75e('0x48')]?_0x1b1079[_0xc75e('0x37')]:_0x440ef4[_0xc75e('0x33')];if(_0x329033[_0xc75e('0x34')][_0xc75e('0x43')]){_0x1b1079[_0xc75e('0x49')]=[{'all':!![]}];}_0x1b1079=_['merge']({},_0x1b1079,_0x329033[_0xc75e('0x42')]);return db[_0xc75e('0x2f')][_0xc75e('0x4a')](_0x1b1079)[_0xc75e('0x26')](handleEntityNotFound(_0x14d07c,null))['then'](respondWithResult(_0x14d07c,null))[_0xc75e('0x46')](handleError(_0x14d07c,null));};exports[_0xc75e('0x4b')]=function(_0x29476f,_0x4dddd4){return db[_0xc75e('0x2f')]['create'](_0x29476f[_0xc75e('0x4c')],{})[_0xc75e('0x26')](respondWithResult(_0x4dddd4,0xc9))[_0xc75e('0x46')](handleError(_0x4dddd4,null));};exports[_0xc75e('0x4d')]=function(_0x39f58c,_0x2f0b7e){if(_0x39f58c[_0xc75e('0x4c')]['id']){delete _0x39f58c['body']['id'];}return db['OpenchannelTransferReport'][_0xc75e('0x4a')]({'where':{'id':_0x39f58c[_0xc75e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2f0b7e,null))[_0xc75e('0x26')](saveUpdates(_0x39f58c[_0xc75e('0x4c')],null))[_0xc75e('0x26')](respondWithResult(_0x2f0b7e,null))[_0xc75e('0x46')](handleError(_0x2f0b7e,null));};exports[_0xc75e('0x27')]=function(_0x3ba6ae,_0x4e2958){return db[_0xc75e('0x2f')][_0xc75e('0x4a')]({'where':{'id':_0x3ba6ae[_0xc75e('0x4e')]['id']}})[_0xc75e('0x26')](handleEntityNotFound(_0x4e2958,null))['then'](removeEntity(_0x4e2958,null))['catch'](handleError(_0x4e2958,null));};exports['describe']=function(_0x2a14eb,_0x5b149c){return db[_0xc75e('0x2f')][_0xc75e('0x4f')]()[_0xc75e('0x26')](respondWithResult(_0x5b149c,null))['catch'](handleError(_0x5b149c,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 11e0e92..59ad404 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 _0xcd3c=['uniqueid','util','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0x2e97bf,_0x569e2b){var _0x3b2110=function(_0x558783){while(--_0x558783){_0x2e97bf['push'](_0x2e97bf['shift']());}};_0x3b2110(++_0x569e2b);}(_0xcd3c,0x105));var _0xccd3=function(_0x3a7349,_0x15c523){_0x3a7349=_0x3a7349-0x0;var _0x467c70=_0xcd3c[_0x3a7349];return _0x467c70;};'use strict';var _=require('lodash');var util=require(_0xccd3('0x0'));var logger=require('../../config/logger')(_0xccd3('0x1'));var moment=require(_0xccd3('0x2'));var BPromise=require(_0xccd3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xccd3('0x4'));var rimraf=require(_0xccd3('0x5'));var config=require(_0xccd3('0x6'));var attributes=require(_0xccd3('0x7'));module[_0xccd3('0x8')]=function(_0x154275,_0x24fe08){return _0x154275[_0xccd3('0x9')](_0xccd3('0xa'),attributes,{'tableName':_0xccd3('0xb'),'paranoid':![],'indexes':[{'name':_0xccd3('0xc'),'fields':[_0xccd3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8018=['define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports'];(function(_0x113b90,_0x379516){var _0x382df4=function(_0x49cb24){while(--_0x49cb24){_0x113b90['push'](_0x113b90['shift']());}};_0x382df4(++_0x379516);}(_0x8018,0xd6));var _0x8801=function(_0x3841d6,_0x1ea65e){_0x3841d6=_0x3841d6-0x0;var _0x57b09e=_0x8018[_0x3841d6];return _0x57b09e;};'use strict';var _=require('lodash');var util=require(_0x8801('0x0'));var logger=require(_0x8801('0x1'))(_0x8801('0x2'));var moment=require(_0x8801('0x3'));var BPromise=require(_0x8801('0x4'));var rp=require(_0x8801('0x5'));var fs=require('fs');var path=require(_0x8801('0x6'));var rimraf=require(_0x8801('0x7'));var config=require(_0x8801('0x8'));var attributes=require(_0x8801('0x9'));module[_0x8801('0xa')]=function(_0x56cc9e,_0xea2dcf){return _0x56cc9e[_0x8801('0xb')](_0x8801('0xc'),attributes,{'tableName':_0x8801('0xd'),'paranoid':![],'indexes':[{'name':_0x8801('0xe'),'fields':[_0x8801('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 7542fb4..01dd309 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 _0x8d0a=['OpenchannelTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2f82fd,_0x11368a){var _0xffb63e=function(_0x4abc5b){while(--_0x4abc5b){_0x2f82fd['push'](_0x2f82fd['shift']());}};_0xffb63e(++_0x11368a);}(_0x8d0a,0x65));var _0xa8d0=function(_0x38b1da,_0x5ee672){_0x38b1da=_0x38b1da-0x0;var _0x5dd0b8=_0x8d0a[_0x38b1da];return _0x5dd0b8;};'use strict';var _=require(_0xa8d0('0x0'));var util=require('util');var moment=require(_0xa8d0('0x1'));var BPromise=require(_0xa8d0('0x2'));var rs=require(_0xa8d0('0x3'));var fs=require('fs');var Redis=require(_0xa8d0('0x4'));var db=require(_0xa8d0('0x5'))['db'];var utils=require(_0xa8d0('0x6'));var logger=require(_0xa8d0('0x7'))(_0xa8d0('0x8'));var config=require(_0xa8d0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa8d0('0xa')][_0xa8d0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f95a7,_0x1f8b78,_0x3ee6b4){return new BPromise(function(_0x55ffc0,_0x508238){return client[_0xa8d0('0xc')](_0x1f95a7,_0x3ee6b4)[_0xa8d0('0xd')](function(_0x49e137){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f8b78,_0xa8d0('0xe'));logger['debug'](_0xa8d0('0xf'),_0x1f8b78,_0xa8d0('0xe'),JSON[_0xa8d0('0x10')](_0x49e137));if(_0x49e137[_0xa8d0('0x11')]){if(_0x49e137[_0xa8d0('0x11')][_0xa8d0('0x12')]===0x1f4){logger[_0xa8d0('0x11')](_0xa8d0('0x13'),_0x1f8b78,_0x49e137[_0xa8d0('0x11')][_0xa8d0('0x14')]);return _0x508238(_0x49e137[_0xa8d0('0x11')]['message']);}logger[_0xa8d0('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f8b78,_0x49e137['error'][_0xa8d0('0x14')]);return _0x55ffc0(_0x49e137[_0xa8d0('0x11')]['message']);}else{logger[_0xa8d0('0x15')](_0xa8d0('0x13'),_0x1f8b78,_0xa8d0('0xe'));_0x55ffc0(_0x49e137[_0xa8d0('0x16')][_0xa8d0('0x14')]);}})[_0xa8d0('0x17')](function(_0x4ef7bf){logger[_0xa8d0('0x11')](_0xa8d0('0x13'),_0x1f8b78,_0x4ef7bf);_0x508238(_0x4ef7bf);});});} \ No newline at end of file +var _0x5a2a=['catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x25da3f,_0x4e685e){var _0x5c2af6=function(_0x4e6812){while(--_0x4e6812){_0x25da3f['push'](_0x25da3f['shift']());}};_0x5c2af6(++_0x4e685e);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x103d85,_0x3da782){_0x103d85=_0x103d85-0x0;var _0x5b75fe=_0x5a2a[_0x103d85];return _0x5b75fe;};'use strict';var _=require(_0xa5a2('0x0'));var util=require(_0xa5a2('0x1'));var moment=require(_0xa5a2('0x2'));var BPromise=require(_0xa5a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa5a2('0x4'));var logger=require(_0xa5a2('0x5'))('rpc');var config=require(_0xa5a2('0x6'));var jayson=require(_0xa5a2('0x7'));var client=jayson[_0xa5a2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x179722,_0x563461,_0x38a5fe){return new BPromise(function(_0x97f75c,_0x43e0d8){return client['request'](_0x179722,_0x38a5fe)['then'](function(_0x1227d7){logger[_0xa5a2('0x9')](_0xa5a2('0xa'),_0x563461,_0xa5a2('0xb'));logger[_0xa5a2('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x563461,_0xa5a2('0xb'),JSON[_0xa5a2('0xd')](_0x1227d7));if(_0x1227d7[_0xa5a2('0xe')]){if(_0x1227d7[_0xa5a2('0xe')][_0xa5a2('0xf')]===0x1f4){logger[_0xa5a2('0xe')](_0xa5a2('0xa'),_0x563461,_0x1227d7['error']['message']);return _0x43e0d8(_0x1227d7[_0xa5a2('0xe')][_0xa5a2('0x10')]);}logger[_0xa5a2('0xe')](_0xa5a2('0xa'),_0x563461,_0x1227d7[_0xa5a2('0xe')]['message']);return _0x97f75c(_0x1227d7[_0xa5a2('0xe')][_0xa5a2('0x10')]);}else{logger['info'](_0xa5a2('0xa'),_0x563461,_0xa5a2('0xb'));_0x97f75c(_0x1227d7['result'][_0xa5a2('0x10')]);}})[_0xa5a2('0x11')](function(_0x599599){logger[_0xa5a2('0xe')](_0xa5a2('0xa'),_0x563461,_0x599599);_0x43e0d8(_0x599599);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index ba99c36..d76ba98 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 _0x8c53=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','delete','exports'];(function(_0x486f9c,_0x31c956){var _0x95037d=function(_0x53f27b){while(--_0x53f27b){_0x486f9c['push'](_0x486f9c['shift']());}};_0x95037d(++_0x31c956);}(_0x8c53,0x88));var _0x38c5=function(_0x8774d0,_0x5989f9){_0x8774d0=_0x8774d0-0x0;var _0x27ebed=_0x8c53[_0x8774d0];return _0x27ebed;};'use strict';var multer=require('multer');var util=require(_0x38c5('0x0'));var path=require(_0x38c5('0x1'));var timeout=require('connect-timeout');var express=require(_0x38c5('0x2'));var router=express['Router']();var fs_extra=require(_0x38c5('0x3'));var auth=require(_0x38c5('0x4'));var interaction=require(_0x38c5('0x5'));var config=require(_0x38c5('0x6'));var controller=require(_0x38c5('0x7'));router[_0x38c5('0x8')]('/',auth[_0x38c5('0x9')](),controller[_0x38c5('0xa')]);router[_0x38c5('0x8')](_0x38c5('0xb'),auth[_0x38c5('0x9')](),controller[_0x38c5('0xc')]);router[_0x38c5('0xd')]('/',auth[_0x38c5('0x9')](),controller[_0x38c5('0xe')]);router['put'](_0x38c5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x38c5('0xf')](_0x38c5('0xb'),auth[_0x38c5('0x9')](),controller['destroy']);module[_0x38c5('0x10')]=router; \ No newline at end of file +var _0x80c1=['express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','multer','connect-timeout'];(function(_0x3c8098,_0x14d989){var _0x123130=function(_0x560192){while(--_0x560192){_0x3c8098['push'](_0x3c8098['shift']());}};_0x123130(++_0x14d989);}(_0x80c1,0x1ae));var _0x180c=function(_0x261c7d,_0x2c6455){_0x261c7d=_0x261c7d-0x0;var _0x658b60=_0x80c1[_0x261c7d];return _0x658b60;};'use strict';var multer=require(_0x180c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x180c('0x1'));var express=require(_0x180c('0x2'));var router=express[_0x180c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x180c('0x4'));var interaction=require(_0x180c('0x5'));var config=require('../../config/environment');var controller=require('./pause.controller');router['get']('/',auth[_0x180c('0x6')](),controller[_0x180c('0x7')]);router[_0x180c('0x8')](_0x180c('0x9'),auth[_0x180c('0x6')](),controller[_0x180c('0xa')]);router[_0x180c('0xb')]('/',auth[_0x180c('0x6')](),controller[_0x180c('0xc')]);router[_0x180c('0xd')](_0x180c('0x9'),auth['isAuthenticated'](),controller[_0x180c('0xe')]);router[_0x180c('0xf')]('/:id',auth[_0x180c('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index a73b3de..faa5444 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 _0x0146=['STRING','name','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0146,0xc2));var _0x6014=function(_0x1c6089,_0x3816e2){_0x1c6089=_0x1c6089-0x0;var _0x4d97c1=_0x0146[_0x1c6089];return _0x4d97c1;};'use strict';var Sequelize=require('sequelize');module[_0x6014('0x0')]={'name':{'type':Sequelize[_0x6014('0x1')],'unique':_0x6014('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x6014('0x1')]}}; \ No newline at end of file +var _0xcc47=['name','STRING'];(function(_0x1ca53a,_0x1d8df1){var _0x2fc418=function(_0x4f16f9){while(--_0x4f16f9){_0x1ca53a['push'](_0x1ca53a['shift']());}};_0x2fc418(++_0x1d8df1);}(_0xcc47,0x12b));var _0x7cc4=function(_0x2c2b7c,_0x3f92e9){_0x2c2b7c=_0x2c2b7c-0x0;var _0x82bbb0=_0xcc47[_0x2c2b7c];return _0x82bbb0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7cc4('0x0')],'unique':_0x7cc4('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x7cc4('0x0')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index c763075..acf25c5 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 _0xe09c=['count','set','Content-Range','apply','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','length','find','create','body','user','role','Pauses','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x5a5288,_0x139202){var _0x345b9a=function(_0x9843e9){while(--_0x9843e9){_0x5a5288['push'](_0x5a5288['shift']());}};_0x345b9a(++_0x139202);}(_0xe09c,0x179));var _0xce09=function(_0x5479b8,_0xea443){_0x5479b8=_0x5479b8-0x0;var _0x678fdd=_0xe09c[_0x5479b8];return _0x678fdd;};'use strict';var emlformat=require(_0xce09('0x0'));var rimraf=require(_0xce09('0x1'));var zipdir=require(_0xce09('0x2'));var jsonpatch=require(_0xce09('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xce09('0x4'));var Mustache=require(_0xce09('0x5'));var util=require(_0xce09('0x6'));var path=require(_0xce09('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xce09('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce09('0x9'));var squel=require(_0xce09('0xa'));var crypto=require(_0xce09('0xb'));var jsforce=require(_0xce09('0xc'));var deskjs=require(_0xce09('0xd'));var toCsv=require(_0xce09('0xe'));var querystring=require(_0xce09('0xf'));var Papa=require(_0xce09('0x10'));var Redis=require(_0xce09('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xce09('0x12'));var as=require(_0xce09('0x13'));var hardwareService=require(_0xce09('0x14'));var logger=require(_0xce09('0x15'))('api');var utils=require(_0xce09('0x16'));var config=require(_0xce09('0x17'));var licenseUtil=require(_0xce09('0x18'));var db=require(_0xce09('0x19'))['db'];function respondWithStatusCode(_0x7eb4eb,_0x11225a){_0x11225a=_0x11225a||0xcc;return function(_0x28c832){if(_0x28c832){return _0x7eb4eb[_0xce09('0x1a')](_0x11225a);}return _0x7eb4eb[_0xce09('0x1b')](_0x11225a)[_0xce09('0x1c')]();};}function respondWithResult(_0x5522eb,_0x1a559a){_0x1a559a=_0x1a559a||0xc8;return function(_0x293759){if(_0x293759){return _0x5522eb[_0xce09('0x1b')](_0x1a559a)[_0xce09('0x1d')](_0x293759);}};}function respondWithFilteredResult(_0x1a5de5,_0x1a86ff){return function(_0x4bd0dd){if(_0x4bd0dd){var _0x219ed5=typeof _0x1a86ff[_0xce09('0x1e')]===_0xce09('0x1f')&&typeof _0x1a86ff[_0xce09('0x20')]==='undefined';var _0xb805fe=_0x4bd0dd['count'];var _0x5e4b3d=_0x219ed5?0x0:_0x1a86ff[_0xce09('0x1e')];var _0x444d97=_0x219ed5?_0x4bd0dd[_0xce09('0x21')]:_0x1a86ff[_0xce09('0x1e')]+_0x1a86ff[_0xce09('0x20')];var _0x294883;if(_0x444d97>=_0xb805fe){_0x444d97=_0xb805fe;_0x294883=0xc8;}else{_0x294883=0xce;}_0x1a5de5[_0xce09('0x1b')](_0x294883);return _0x1a5de5[_0xce09('0x22')](_0xce09('0x23'),_0x5e4b3d+'-'+_0x444d97+'/'+_0xb805fe)[_0xce09('0x1d')](_0x4bd0dd);}return null;};}function patchUpdates(_0x2274ba){return function(_0x3e9237){try{jsonpatch[_0xce09('0x24')](_0x3e9237,_0x2274ba,!![]);}catch(_0x469f13){return BPromise['reject'](_0x469f13);}return _0x3e9237['save']();};}function saveUpdates(_0x1c4031,_0x1968ef){return function(_0x3430ba){if(_0x3430ba){return _0x3430ba[_0xce09('0x25')](_0x1c4031)[_0xce09('0x26')](function(_0x2c492d){return _0x2c492d;});}return null;};}function removeEntity(_0x374d14,_0x4c6f89){return function(_0x23b04d){if(_0x23b04d){return _0x23b04d[_0xce09('0x27')]()[_0xce09('0x26')](function(){var _0x3e3090=_0x23b04d['get']({'plain':!![]});var _0x18f420='Pauses';return db[_0xce09('0x28')][_0xce09('0x27')]({'where':{'type':_0x18f420,'resourceId':_0x3e3090['id']}})[_0xce09('0x26')](function(){return _0x23b04d;});})[_0xce09('0x26')](function(){_0x374d14[_0xce09('0x1b')](0xcc)[_0xce09('0x1c')]();});}};}function handleEntityNotFound(_0x1ba102,_0x42be63){return function(_0x298418){if(!_0x298418){_0x1ba102['sendStatus'](0x194);}return _0x298418;};}function handleError(_0x296f62,_0x1b3e84){_0x1b3e84=_0x1b3e84||0x1f4;return function(_0x220cfe){logger[_0xce09('0x29')](_0x220cfe[_0xce09('0x2a')]);if(_0x220cfe[_0xce09('0x2b')]){delete _0x220cfe[_0xce09('0x2b')];}_0x296f62['status'](_0x1b3e84)[_0xce09('0x2c')](_0x220cfe);};}exports[_0xce09('0x2d')]=function(_0x122a22,_0x5877e6){var _0xfe9c79={},_0x1f4c97={},_0x4c5660={'count':0x0,'rows':[]};var _0x2e558f=_[_0xce09('0x2e')](db[_0xce09('0x2f')][_0xce09('0x30')],function(_0x3fe3bd){return{'name':_0x3fe3bd[_0xce09('0x31')],'type':_0x3fe3bd[_0xce09('0x32')][_0xce09('0x33')]};});_0x1f4c97[_0xce09('0x34')]=_[_0xce09('0x2e')](_0x2e558f,_0xce09('0x2b'));_0x1f4c97['query']=_[_0xce09('0x35')](_0x122a22[_0xce09('0x36')]);_0x1f4c97[_0xce09('0x37')]=_['intersection'](_0x1f4c97['model'],_0x1f4c97[_0xce09('0x36')]);_0xfe9c79['attributes']=_[_0xce09('0x38')](_0x1f4c97['model'],qs[_0xce09('0x39')](_0x122a22['query'][_0xce09('0x39')]));_0xfe9c79[_0xce09('0x3a')]=_0xfe9c79[_0xce09('0x3a')]['length']?_0xfe9c79['attributes']:_0x1f4c97[_0xce09('0x34')];if(!_0x122a22[_0xce09('0x36')]['hasOwnProperty'](_0xce09('0x3b'))){_0xfe9c79['limit']=qs[_0xce09('0x20')](_0x122a22['query'][_0xce09('0x20')]);_0xfe9c79['offset']=qs['offset'](_0x122a22[_0xce09('0x36')][_0xce09('0x1e')]);}_0xfe9c79[_0xce09('0x3c')]=qs[_0xce09('0x3d')](_0x122a22[_0xce09('0x36')][_0xce09('0x3d')]);_0xfe9c79[_0xce09('0x3e')]=qs[_0xce09('0x37')](_['pick'](_0x122a22[_0xce09('0x36')],_0x1f4c97['filters']),_0x2e558f);if(_0x122a22[_0xce09('0x36')][_0xce09('0x3f')]){_0xfe9c79['where']=_[_0xce09('0x40')](_0xfe9c79['where'],{'$or':_[_0xce09('0x2e')](_0x2e558f,function(_0x2e5ab2){if(_0x2e5ab2[_0xce09('0x32')]!==_0xce09('0x41')){var _0x2550ba={};_0x2550ba[_0x2e5ab2['name']]={'$like':'%'+_0x122a22[_0xce09('0x36')][_0xce09('0x3f')]+'%'};return _0x2550ba;}})});}_0xfe9c79=_[_0xce09('0x40')]({},_0xfe9c79,_0x122a22[_0xce09('0x42')]);var _0x2b5252={'where':_0xfe9c79[_0xce09('0x3e')]};return db[_0xce09('0x2f')][_0xce09('0x21')](_0x2b5252)[_0xce09('0x26')](function(_0x5140a0){_0x4c5660[_0xce09('0x21')]=_0x5140a0;if(_0x122a22[_0xce09('0x36')]['includeAll']){_0xfe9c79[_0xce09('0x43')]=[{'all':!![]}];}return db[_0xce09('0x2f')][_0xce09('0x44')](_0xfe9c79);})[_0xce09('0x26')](function(_0x3ae9a3){_0x4c5660['rows']=_0x3ae9a3;return _0x4c5660;})[_0xce09('0x26')](respondWithFilteredResult(_0x5877e6,_0xfe9c79))[_0xce09('0x45')](handleError(_0x5877e6,null));};exports['show']=function(_0x198c3b,_0x5b7b38){var _0x565d8e={'raw':!![],'where':{'id':_0x198c3b['params']['id']}},_0x809332={};_0x809332[_0xce09('0x34')]=_[_0xce09('0x35')](db[_0xce09('0x2f')]['rawAttributes']);_0x809332['query']=_[_0xce09('0x35')](_0x198c3b[_0xce09('0x36')]);_0x809332[_0xce09('0x37')]=_[_0xce09('0x38')](_0x809332[_0xce09('0x34')],_0x809332['query']);_0x565d8e['attributes']=_['intersection'](_0x809332[_0xce09('0x34')],qs[_0xce09('0x39')](_0x198c3b[_0xce09('0x36')]['fields']));_0x565d8e['attributes']=_0x565d8e[_0xce09('0x3a')][_0xce09('0x46')]?_0x565d8e[_0xce09('0x3a')]:_0x809332[_0xce09('0x34')];if(_0x198c3b[_0xce09('0x36')]['includeAll']){_0x565d8e[_0xce09('0x43')]=[{'all':!![]}];}_0x565d8e=_[_0xce09('0x40')]({},_0x565d8e,_0x198c3b[_0xce09('0x42')]);return db[_0xce09('0x2f')][_0xce09('0x47')](_0x565d8e)[_0xce09('0x26')](handleEntityNotFound(_0x5b7b38,null))[_0xce09('0x26')](respondWithResult(_0x5b7b38,null))[_0xce09('0x45')](handleError(_0x5b7b38,null));};exports[_0xce09('0x48')]=function(_0x316324,_0x39a9c3){return db[_0xce09('0x2f')]['create'](_0x316324[_0xce09('0x49')],{})[_0xce09('0x26')](function(_0x2499b9){var _0x392191=_0x316324[_0xce09('0x4a')]['get']({'plain':!![]});if(!_0x392191)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x392191[_0xce09('0x4b')]===_0xce09('0x4a')){var _0x1ad74b=_0x2499b9['get']({'plain':!![]});var _0x498372=_0xce09('0x4c');return db[_0xce09('0x4d')]['find']({'where':{'name':_0x498372,'userProfileId':_0x392191[_0xce09('0x4e')]},'raw':!![]})['then'](function(_0x15e064){if(_0x15e064&&_0x15e064[_0xce09('0x4f')]===0x0){return db['UserProfileResource'][_0xce09('0x48')]({'name':_0x1ad74b[_0xce09('0x2b')],'resourceId':_0x1ad74b['id'],'type':_0x15e064[_0xce09('0x2b')],'sectionId':_0x15e064['id']},{})['then'](function(){return _0x2499b9;});}else{return _0x2499b9;}})[_0xce09('0x45')](function(_0x1916de){logger['error'](_0xce09('0x50'),_0x1916de);throw _0x1916de;});}return _0x2499b9;})[_0xce09('0x26')](respondWithResult(_0x39a9c3,0xc9))[_0xce09('0x45')](handleError(_0x39a9c3,null));};exports[_0xce09('0x25')]=function(_0x29b482,_0x74ba30){if(_0x29b482[_0xce09('0x49')]['id']){delete _0x29b482[_0xce09('0x49')]['id'];}return db[_0xce09('0x2f')][_0xce09('0x47')]({'where':{'id':_0x29b482[_0xce09('0x51')]['id']}})[_0xce09('0x26')](handleEntityNotFound(_0x74ba30,null))[_0xce09('0x26')](saveUpdates(_0x29b482[_0xce09('0x49')],null))[_0xce09('0x26')](respondWithResult(_0x74ba30,null))['catch'](handleError(_0x74ba30,null));};exports[_0xce09('0x27')]=function(_0x4cc9f7,_0x5f440c){return db[_0xce09('0x2f')][_0xce09('0x47')]({'where':{'id':_0x4cc9f7[_0xce09('0x51')]['id']}})['then'](handleEntityNotFound(_0x5f440c,null))['then'](removeEntity(_0x5f440c,null))['catch'](handleError(_0x5f440c,null));}; \ No newline at end of file +var _0x8127=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','destroy','then','get','Pauses','UserProfileResource','end','error','stack','name','send','index','map','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','Pause','includeAll','include','findAll','rows','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1be1f6,_0x5e7089){var _0x2bd577=function(_0x210461){while(--_0x210461){_0x1be1f6['push'](_0x1be1f6['shift']());}};_0x2bd577(++_0x5e7089);}(_0x8127,0xea));var _0x7812=function(_0x2f85ce,_0x251cab){_0x2f85ce=_0x2f85ce-0x0;var _0x232760=_0x8127[_0x2f85ce];return _0x232760;};'use strict';var emlformat=require(_0x7812('0x0'));var rimraf=require(_0x7812('0x1'));var zipdir=require(_0x7812('0x2'));var jsonpatch=require(_0x7812('0x3'));var rp=require(_0x7812('0x4'));var moment=require('moment');var BPromise=require(_0x7812('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7812('0x6'));var sox=require(_0x7812('0x7'));var csv=require(_0x7812('0x8'));var ejs=require(_0x7812('0x9'));var fs=require('fs');var fs_extra=require(_0x7812('0xa'));var _=require(_0x7812('0xb'));var squel=require(_0x7812('0xc'));var crypto=require('crypto');var jsforce=require(_0x7812('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7812('0x8'));var querystring=require(_0x7812('0xe'));var Papa=require(_0x7812('0xf'));var Redis=require(_0x7812('0x10'));var authService=require(_0x7812('0x11'));var qs=require(_0x7812('0x12'));var as=require(_0x7812('0x13'));var hardwareService=require(_0x7812('0x14'));var logger=require(_0x7812('0x15'))(_0x7812('0x16'));var utils=require(_0x7812('0x17'));var config=require(_0x7812('0x18'));var licenseUtil=require(_0x7812('0x19'));var db=require(_0x7812('0x1a'))['db'];function respondWithStatusCode(_0x4162d3,_0x32a995){_0x32a995=_0x32a995||0xcc;return function(_0x87d65f){if(_0x87d65f){return _0x4162d3[_0x7812('0x1b')](_0x32a995);}return _0x4162d3['status'](_0x32a995)['end']();};}function respondWithResult(_0x48e394,_0x42ad6a){_0x42ad6a=_0x42ad6a||0xc8;return function(_0x3da46d){if(_0x3da46d){return _0x48e394['status'](_0x42ad6a)[_0x7812('0x1c')](_0x3da46d);}};}function respondWithFilteredResult(_0x39411a,_0x303dbc){return function(_0x56e5c5){if(_0x56e5c5){var _0xe71909=typeof _0x303dbc[_0x7812('0x1d')]===_0x7812('0x1e')&&typeof _0x303dbc[_0x7812('0x1f')]===_0x7812('0x1e');var _0x20614e=_0x56e5c5[_0x7812('0x20')];var _0x5eedef=_0xe71909?0x0:_0x303dbc[_0x7812('0x1d')];var _0xa477ba=_0xe71909?_0x56e5c5[_0x7812('0x20')]:_0x303dbc[_0x7812('0x1d')]+_0x303dbc['limit'];var _0x11644e;if(_0xa477ba>=_0x20614e){_0xa477ba=_0x20614e;_0x11644e=0xc8;}else{_0x11644e=0xce;}_0x39411a[_0x7812('0x21')](_0x11644e);return _0x39411a[_0x7812('0x22')](_0x7812('0x23'),_0x5eedef+'-'+_0xa477ba+'/'+_0x20614e)[_0x7812('0x1c')](_0x56e5c5);}return null;};}function patchUpdates(_0x2a7f8c){return function(_0x42347a){try{jsonpatch[_0x7812('0x24')](_0x42347a,_0x2a7f8c,!![]);}catch(_0x3db044){return BPromise[_0x7812('0x25')](_0x3db044);}return _0x42347a[_0x7812('0x26')]();};}function saveUpdates(_0xa34664,_0x179b8b){return function(_0x516d4d){if(_0x516d4d){return _0x516d4d['update'](_0xa34664)['then'](function(_0xb94c0e){return _0xb94c0e;});}return null;};}function removeEntity(_0x55f989,_0x62f15a){return function(_0x1600f5){if(_0x1600f5){return _0x1600f5[_0x7812('0x27')]()[_0x7812('0x28')](function(){var _0x13da89=_0x1600f5[_0x7812('0x29')]({'plain':!![]});var _0x4268cb=_0x7812('0x2a');return db[_0x7812('0x2b')][_0x7812('0x27')]({'where':{'type':_0x4268cb,'resourceId':_0x13da89['id']}})['then'](function(){return _0x1600f5;});})[_0x7812('0x28')](function(){_0x55f989[_0x7812('0x21')](0xcc)[_0x7812('0x2c')]();});}};}function handleEntityNotFound(_0x17702b,_0x25cb5f){return function(_0x5d3fb5){if(!_0x5d3fb5){_0x17702b['sendStatus'](0x194);}return _0x5d3fb5;};}function handleError(_0x30f73a,_0x5c2e4e){_0x5c2e4e=_0x5c2e4e||0x1f4;return function(_0x5efd7e){logger[_0x7812('0x2d')](_0x5efd7e[_0x7812('0x2e')]);if(_0x5efd7e['name']){delete _0x5efd7e[_0x7812('0x2f')];}_0x30f73a['status'](_0x5c2e4e)[_0x7812('0x30')](_0x5efd7e);};}exports[_0x7812('0x31')]=function(_0x2cbc16,_0x2311fa){var _0x205a97={},_0x55cca3={},_0x588395={'count':0x0,'rows':[]};var _0x7757f3=_[_0x7812('0x32')](db['Pause']['rawAttributes'],function(_0x2e3d64){return{'name':_0x2e3d64['fieldName'],'type':_0x2e3d64[_0x7812('0x33')][_0x7812('0x34')]};});_0x55cca3['model']=_['map'](_0x7757f3,_0x7812('0x2f'));_0x55cca3[_0x7812('0x35')]=_[_0x7812('0x36')](_0x2cbc16[_0x7812('0x35')]);_0x55cca3[_0x7812('0x37')]=_['intersection'](_0x55cca3[_0x7812('0x38')],_0x55cca3['query']);_0x205a97['attributes']=_['intersection'](_0x55cca3[_0x7812('0x38')],qs['fields'](_0x2cbc16[_0x7812('0x35')][_0x7812('0x39')]));_0x205a97[_0x7812('0x3a')]=_0x205a97[_0x7812('0x3a')][_0x7812('0x3b')]?_0x205a97[_0x7812('0x3a')]:_0x55cca3[_0x7812('0x38')];if(!_0x2cbc16[_0x7812('0x35')][_0x7812('0x3c')]('nolimit')){_0x205a97['limit']=qs[_0x7812('0x1f')](_0x2cbc16[_0x7812('0x35')][_0x7812('0x1f')]);_0x205a97[_0x7812('0x1d')]=qs[_0x7812('0x1d')](_0x2cbc16['query'][_0x7812('0x1d')]);}_0x205a97[_0x7812('0x3d')]=qs['sort'](_0x2cbc16[_0x7812('0x35')][_0x7812('0x3e')]);_0x205a97[_0x7812('0x3f')]=qs[_0x7812('0x37')](_['pick'](_0x2cbc16[_0x7812('0x35')],_0x55cca3['filters']),_0x7757f3);if(_0x2cbc16['query'][_0x7812('0x40')]){_0x205a97[_0x7812('0x3f')]=_[_0x7812('0x41')](_0x205a97[_0x7812('0x3f')],{'$or':_[_0x7812('0x32')](_0x7757f3,function(_0x5da509){if(_0x5da509['type']!==_0x7812('0x42')){var _0x8a6c23={};_0x8a6c23[_0x5da509[_0x7812('0x2f')]]={'$like':'%'+_0x2cbc16[_0x7812('0x35')][_0x7812('0x40')]+'%'};return _0x8a6c23;}})});}_0x205a97=_[_0x7812('0x41')]({},_0x205a97,_0x2cbc16[_0x7812('0x43')]);var _0x1a5dee={'where':_0x205a97[_0x7812('0x3f')]};return db[_0x7812('0x44')][_0x7812('0x20')](_0x1a5dee)[_0x7812('0x28')](function(_0x20db12){_0x588395[_0x7812('0x20')]=_0x20db12;if(_0x2cbc16['query'][_0x7812('0x45')]){_0x205a97[_0x7812('0x46')]=[{'all':!![]}];}return db[_0x7812('0x44')][_0x7812('0x47')](_0x205a97);})[_0x7812('0x28')](function(_0x32fdba){_0x588395[_0x7812('0x48')]=_0x32fdba;return _0x588395;})['then'](respondWithFilteredResult(_0x2311fa,_0x205a97))['catch'](handleError(_0x2311fa,null));};exports['show']=function(_0x5c03ae,_0x554dac){var _0x35cc87={'raw':!![],'where':{'id':_0x5c03ae['params']['id']}},_0x3e5bd2={};_0x3e5bd2[_0x7812('0x38')]=_[_0x7812('0x36')](db[_0x7812('0x44')][_0x7812('0x49')]);_0x3e5bd2[_0x7812('0x35')]=_[_0x7812('0x36')](_0x5c03ae[_0x7812('0x35')]);_0x3e5bd2[_0x7812('0x37')]=_[_0x7812('0x4a')](_0x3e5bd2['model'],_0x3e5bd2['query']);_0x35cc87[_0x7812('0x3a')]=_[_0x7812('0x4a')](_0x3e5bd2['model'],qs['fields'](_0x5c03ae[_0x7812('0x35')][_0x7812('0x39')]));_0x35cc87['attributes']=_0x35cc87[_0x7812('0x3a')][_0x7812('0x3b')]?_0x35cc87['attributes']:_0x3e5bd2[_0x7812('0x38')];if(_0x5c03ae['query'][_0x7812('0x45')]){_0x35cc87[_0x7812('0x46')]=[{'all':!![]}];}_0x35cc87=_[_0x7812('0x41')]({},_0x35cc87,_0x5c03ae[_0x7812('0x43')]);return db[_0x7812('0x44')][_0x7812('0x4b')](_0x35cc87)['then'](handleEntityNotFound(_0x554dac,null))[_0x7812('0x28')](respondWithResult(_0x554dac,null))[_0x7812('0x4c')](handleError(_0x554dac,null));};exports[_0x7812('0x4d')]=function(_0x3b625e,_0x1b0f61){return db[_0x7812('0x44')][_0x7812('0x4d')](_0x3b625e[_0x7812('0x4e')],{})[_0x7812('0x28')](function(_0x153d63){var _0x4d0cf5=_0x3b625e[_0x7812('0x4f')][_0x7812('0x29')]({'plain':!![]});if(!_0x4d0cf5)throw new Error(_0x7812('0x50'));if(_0x4d0cf5['role']===_0x7812('0x4f')){var _0x3b00f1=_0x153d63['get']({'plain':!![]});var _0x579c55=_0x7812('0x2a');return db[_0x7812('0x51')][_0x7812('0x4b')]({'where':{'name':_0x579c55,'userProfileId':_0x4d0cf5[_0x7812('0x52')]},'raw':!![]})[_0x7812('0x28')](function(_0x4ebeea){if(_0x4ebeea&&_0x4ebeea['autoAssociation']===0x0){return db[_0x7812('0x2b')][_0x7812('0x4d')]({'name':_0x3b00f1['name'],'resourceId':_0x3b00f1['id'],'type':_0x4ebeea['name'],'sectionId':_0x4ebeea['id']},{})['then'](function(){return _0x153d63;});}else{return _0x153d63;}})[_0x7812('0x4c')](function(_0x27c104){logger['error'](_0x7812('0x53'),_0x27c104);throw _0x27c104;});}return _0x153d63;})[_0x7812('0x28')](respondWithResult(_0x1b0f61,0xc9))[_0x7812('0x4c')](handleError(_0x1b0f61,null));};exports[_0x7812('0x54')]=function(_0x45db14,_0x34c32f){if(_0x45db14['body']['id']){delete _0x45db14[_0x7812('0x4e')]['id'];}return db[_0x7812('0x44')][_0x7812('0x4b')]({'where':{'id':_0x45db14[_0x7812('0x55')]['id']}})[_0x7812('0x28')](handleEntityNotFound(_0x34c32f,null))[_0x7812('0x28')](saveUpdates(_0x45db14[_0x7812('0x4e')],null))['then'](respondWithResult(_0x34c32f,null))['catch'](handleError(_0x34c32f,null));};exports[_0x7812('0x27')]=function(_0x1291d4,_0x3dc32c){return db[_0x7812('0x44')][_0x7812('0x4b')]({'where':{'id':_0x1291d4[_0x7812('0x55')]['id']}})['then'](handleEntityNotFound(_0x3dc32c,null))[_0x7812('0x28')](removeEntity(_0x3dc32c,null))['catch'](handleError(_0x3dc32c,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index cb96d79..742fdd6 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 _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x28359f,_0x4127a5){var _0x1cd032=function(_0x500303){while(--_0x500303){_0x28359f['push'](_0x28359f['shift']());}};_0x1cd032(++_0x4127a5);}(_0x53ec,0x192));var _0xc53e=function(_0xabca41,_0xbfdf4a){_0xabca41=_0xabca41-0x0;var _0x404ccb=_0x53ec[_0xabca41];return _0x404ccb;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./pause.attributes','exports','define','tools_pauses','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3a9635,_0x1ab817){var _0x10d08c=function(_0x222242){while(--_0x222242){_0x3a9635['push'](_0x3a9635['shift']());}};_0x10d08c(++_0x1ab817);}(_0x55ca,0x126));var _0xa55c=function(_0x4d6bfd,_0x8d79ff){_0x4d6bfd=_0x4d6bfd-0x0;var _0x243a46=_0x55ca[_0x4d6bfd];return _0x243a46;};'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')]('Pause',attributes,{'tableName':_0xa55c('0x9'),'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 b893900..6a664e9 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0xcdae1c,_0x78dc34){var _0x394335=function(_0x42403d){while(--_0x42403d){_0xcdae1c['push'](_0xcdae1c['shift']());}};_0x394335(++_0x78dc34);}(_0xb10b,0x12a));var _0xbb10=function(_0x313dab,_0x53179c){_0x313dab=_0x313dab-0x0;var _0x18ee37=_0xb10b[_0x313dab];return _0x18ee37;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x2819c5,_0x3ecc70){var _0x112f61=function(_0x59bf57){while(--_0x59bf57){_0x2819c5['push'](_0x2819c5['shift']());}};_0x112f61(++_0x3ecc70);}(_0x7a54,0x106));var _0x47a5=function(_0x9d041a,_0x34bb8d){_0x9d041a=_0x9d041a-0x0;var _0x4012c1=_0x7a54[_0x9d041a];return _0x4012c1;};'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 e513a45..f70146d 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 _0xb43b=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','index','/webhook','webhookGet','get','/:id','isAuthenticated','/:id/download','download','diskStorage','join','server/files/plugins','originalname','format','basename','extname','file','webhookPost','put','delete','exports','multer'];(function(_0xa3a76e,_0x55edec){var _0x125fce=function(_0x1f5af7){while(--_0x1f5af7){_0xa3a76e['push'](_0xa3a76e['shift']());}};_0x125fce(++_0x55edec);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4df512,_0x398335){_0x4df512=_0x4df512-0x0;var _0x9d9c6f=_0xb43b[_0x4df512];return _0x9d9c6f;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['get'](_0xbb43('0xa'),controller[_0xbb43('0xb')]);router[_0xbb43('0xc')](_0xbb43('0xd'),auth[_0xbb43('0xe')](),controller['show']);router[_0xbb43('0xc')](_0xbb43('0xf'),auth['isAuthenticated'](),controller[_0xbb43('0x10')]);var upload=multer({'storage':multer[_0xbb43('0x11')]({'destination':function(_0xd37cdf,_0x5e3611,_0xfac791){_0xfac791(null,path[_0xbb43('0x12')](config['root'],_0xbb43('0x13')));},'filename':function(_0x2a5a4d,_0x50e2c0,_0x578392){_0x50e2c0[_0xbb43('0x14')]=_0x50e2c0['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x578392(null,util[_0xbb43('0x15')]('%s-%s%s',path[_0xbb43('0x16')](_0x50e2c0[_0xbb43('0x14')],path['extname'](_0x50e2c0['originalname'])),Date['now'](),path[_0xbb43('0x17')](_0x50e2c0[_0xbb43('0x14')])));}})});router['post']('/',upload['single'](_0xbb43('0x18')),controller['upload']);router['post'](_0xbb43('0xa'),controller[_0xbb43('0x19')]);router[_0xbb43('0x1a')]('/:id',auth[_0xbb43('0xe')](),controller['update']);router[_0xbb43('0x1b')](_0xbb43('0xd'),auth['isAuthenticated'](),controller['delete']);module[_0xbb43('0x1c')]=router; \ No newline at end of file +var _0x303a=['show','/:id/download','download','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','/:id','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook'];(function(_0x4c0a0e,_0x2e4b1a){var _0x284bd0=function(_0x3b4f3d){while(--_0x3b4f3d){_0x4c0a0e['push'](_0x4c0a0e['shift']());}};_0x284bd0(++_0x2e4b1a);}(_0x303a,0x1a0));var _0xa303=function(_0x567d04,_0x3d13a1){_0x567d04=_0x567d04-0x0;var _0x58ee79=_0x303a[_0x567d04];return _0x58ee79;};'use strict';var multer=require(_0xa303('0x0'));var util=require('util');var path=require(_0xa303('0x1'));var timeout=require(_0xa303('0x2'));var express=require(_0xa303('0x3'));var router=express[_0xa303('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa303('0x5'));var interaction=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var controller=require(_0xa303('0x8'));router[_0xa303('0x9')]('/',auth[_0xa303('0xa')](),controller[_0xa303('0xb')]);router[_0xa303('0x9')](_0xa303('0xc'),controller['webhookGet']);router['get']('/:id',auth[_0xa303('0xa')](),controller[_0xa303('0xd')]);router['get'](_0xa303('0xe'),auth['isAuthenticated'](),controller[_0xa303('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29cd60,_0x17dfcd,_0x382cfd){_0x382cfd(null,path[_0xa303('0x10')](config['root'],_0xa303('0x11')));},'filename':function(_0x4c0169,_0xf5df1e,_0x43a054){_0xf5df1e[_0xa303('0x12')]=_0xf5df1e['originalname'][_0xa303('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x43a054(null,util[_0xa303('0x14')](_0xa303('0x15'),path[_0xa303('0x16')](_0xf5df1e[_0xa303('0x12')],path[_0xa303('0x17')](_0xf5df1e[_0xa303('0x12')])),Date[_0xa303('0x18')](),path['extname'](_0xf5df1e[_0xa303('0x12')])));}})});router[_0xa303('0x19')]('/',upload[_0xa303('0x1a')](_0xa303('0x1b')),controller[_0xa303('0x1c')]);router[_0xa303('0x19')]('/webhook',controller[_0xa303('0x1d')]);router['put'](_0xa303('0x1e'),auth['isAuthenticated'](),controller[_0xa303('0x1f')]);router['delete'](_0xa303('0x1e'),auth[_0xa303('0xa')](),controller[_0xa303('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 2411298..36e57d6 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 _0x30a9=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always'];(function(_0x14ad54,_0x507fb8){var _0x39fdc4=function(_0xac880f){while(--_0xac880f){_0x14ad54['push'](_0x14ad54['shift']());}};_0x39fdc4(++_0x507fb8);}(_0x30a9,0x169));var _0x930a=function(_0x555db3,_0x56a2c8){_0x555db3=_0x555db3-0x0;var _0x4f518b=_0x30a9[_0x555db3];return _0x4f518b;};'use strict';var Sequelize=require(_0x930a('0x0'));module[_0x930a('0x1')]={'name':{'type':Sequelize[_0x930a('0x2')]},'type':{'type':Sequelize[_0x930a('0x3')]('html',_0x930a('0x4'))},'description':{'type':Sequelize[_0x930a('0x5')]},'version':{'type':Sequelize[_0x930a('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0x930a('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x930a('0x7')},'sidebar':{'type':Sequelize[_0x930a('0x3')](_0x930a('0x8'),_0x930a('0x9'),_0x930a('0xa'),'never'),'defaultValue':_0x930a('0xa'),'comment':_0x930a('0xb')},'icon':{'type':Sequelize[_0x930a('0x2')]},'adminUrl':{'type':Sequelize[_0x930a('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x930a('0x2')]}}; \ No newline at end of file +var _0xc1e4=['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.','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x1c4903,_0x2c8ecd){var _0x1f0af5=function(_0x90ceaa){while(--_0x90ceaa){_0x1c4903['push'](_0x1c4903['shift']());}};_0x1f0af5(++_0x2c8ecd);}(_0xc1e4,0x17f));var _0x4c1e=function(_0x28695,_0x5f5207){_0x28695=_0x28695-0x0;var _0x20cb89=_0xc1e4[_0x28695];return _0x20cb89;};'use strict';var Sequelize=require(_0x4c1e('0x0'));module[_0x4c1e('0x1')]={'name':{'type':Sequelize[_0x4c1e('0x2')]},'type':{'type':Sequelize[_0x4c1e('0x3')](_0x4c1e('0x4'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x4c1e('0x5')]},'path':{'type':Sequelize[_0x4c1e('0x2')],'comment':_0x4c1e('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4c1e('0x7')},'sidebar':{'type':Sequelize[_0x4c1e('0x3')](_0x4c1e('0x8'),'agentOnly',_0x4c1e('0x9'),_0x4c1e('0xa')),'defaultValue':'always','comment':_0x4c1e('0xb')},'icon':{'type':Sequelize[_0x4c1e('0x2')]},'adminUrl':{'type':Sequelize[_0x4c1e('0x2')]},'agentUrl':{'type':Sequelize[_0x4c1e('0x2')]},'scriptName':{'type':Sequelize[_0x4c1e('0x2')]},'scriptPath':{'type':Sequelize[_0x4c1e('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index a858740..59453d3 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 _0x4c6d=['agent','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','create','role','body','userProfileId','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./plugin.socket','register','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','get','Plugins','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','model','query','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','Plugin','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','filters','merge','options','find','download','join','root','format','%s.zip','basename','createWriteStream','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','parameters'];(function(_0x504bc5,_0x594db4){var _0x50cf50=function(_0x34e8eb){while(--_0x34e8eb){_0x504bc5['push'](_0x504bc5['shift']());}};_0x50cf50(++_0x594db4);}(_0x4c6d,0x17e));var _0xd4c6=function(_0x59ab6e,_0x493ff4){_0x59ab6e=_0x59ab6e-0x0;var _0x13994a=_0x4c6d[_0x59ab6e];return _0x13994a;};'use strict';var emlformat=require(_0xd4c6('0x0'));var rimraf=require(_0xd4c6('0x1'));var zipdir=require(_0xd4c6('0x2'));var jsonpatch=require(_0xd4c6('0x3'));var rp=require(_0xd4c6('0x4'));var moment=require('moment');var BPromise=require(_0xd4c6('0x5'));var Mustache=require(_0xd4c6('0x6'));var util=require(_0xd4c6('0x7'));var path=require(_0xd4c6('0x8'));var sox=require(_0xd4c6('0x9'));var csv=require(_0xd4c6('0xa'));var ejs=require(_0xd4c6('0xb'));var fs=require('fs');var fs_extra=require(_0xd4c6('0xc'));var _=require('lodash');var squel=require(_0xd4c6('0xd'));var crypto=require(_0xd4c6('0xe'));var jsforce=require(_0xd4c6('0xf'));var deskjs=require(_0xd4c6('0x10'));var toCsv=require(_0xd4c6('0xa'));var querystring=require(_0xd4c6('0x11'));var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require(_0xd4c6('0x1'));var archiver=require(_0xd4c6('0x12'));var Redis=require(_0xd4c6('0x13'));var authService=require(_0xd4c6('0x14'));var qs=require(_0xd4c6('0x15'));var as=require(_0xd4c6('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4c6('0x17'))('api');var utils=require(_0xd4c6('0x18'));var config=require(_0xd4c6('0x19'));var licenseUtil=require(_0xd4c6('0x1a'));var db=require(_0xd4c6('0x1b'))['db'];config[_0xd4c6('0x1c')]=_[_0xd4c6('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd4c6('0x1c')]));require(_0xd4c6('0x1e'))[_0xd4c6('0x1f')](socket);function respondWithStatusCode(_0x10a6e1,_0x53c73a){_0x53c73a=_0x53c73a||0xcc;return function(_0x461872){if(_0x461872){return _0x10a6e1['sendStatus'](_0x53c73a);}return _0x10a6e1[_0xd4c6('0x20')](_0x53c73a)[_0xd4c6('0x21')]();};}function respondWithResult(_0x2d2f87,_0x4351d8){_0x4351d8=_0x4351d8||0xc8;return function(_0x3879d3){if(_0x3879d3){return _0x2d2f87[_0xd4c6('0x20')](_0x4351d8)[_0xd4c6('0x22')](_0x3879d3);}};}function respondWithFilteredResult(_0x5ec4f1,_0x2036c0){return function(_0x1ace58){if(_0x1ace58){var _0x101d76=typeof _0x2036c0[_0xd4c6('0x23')]===_0xd4c6('0x24')&&typeof _0x2036c0['limit']===_0xd4c6('0x24');var _0x54aa3b=_0x1ace58[_0xd4c6('0x25')];var _0x4a8b5b=_0x101d76?0x0:_0x2036c0[_0xd4c6('0x23')];var _0xe8105c=_0x101d76?_0x1ace58['count']:_0x2036c0[_0xd4c6('0x23')]+_0x2036c0[_0xd4c6('0x26')];var _0x48ea27;if(_0xe8105c>=_0x54aa3b){_0xe8105c=_0x54aa3b;_0x48ea27=0xc8;}else{_0x48ea27=0xce;}_0x5ec4f1[_0xd4c6('0x20')](_0x48ea27);return _0x5ec4f1[_0xd4c6('0x27')]('Content-Range',_0x4a8b5b+'-'+_0xe8105c+'/'+_0x54aa3b)[_0xd4c6('0x22')](_0x1ace58);}return null;};}function patchUpdates(_0x2c9abf){return function(_0x339846){try{jsonpatch[_0xd4c6('0x28')](_0x339846,_0x2c9abf,!![]);}catch(_0x3caafa){return BPromise[_0xd4c6('0x29')](_0x3caafa);}return _0x339846[_0xd4c6('0x2a')]();};}function saveUpdates(_0x1c80fe,_0x1592b6){return function(_0x419f49){if(_0x419f49){return _0x419f49[_0xd4c6('0x2b')](_0x1c80fe)[_0xd4c6('0x2c')](function(_0x515d60){return _0x515d60;});}return null;};}function removeEntity(_0x1ca909,_0x393f84){return function(_0x7f6d8b){if(_0x7f6d8b){return _0x7f6d8b['destroy']()[_0xd4c6('0x2c')](function(){var _0x35e00a=_0x7f6d8b[_0xd4c6('0x2d')]({'plain':!![]});var _0x2ab427=_0xd4c6('0x2e');return db[_0xd4c6('0x2f')][_0xd4c6('0x30')]({'where':{'type':_0x2ab427,'resourceId':_0x35e00a['id']}})[_0xd4c6('0x2c')](function(){return _0x7f6d8b;});})[_0xd4c6('0x2c')](function(){_0x1ca909[_0xd4c6('0x20')](0xcc)[_0xd4c6('0x21')]();});}};}function handleEntityNotFound(_0x4b8b3c,_0x4f00b4){return function(_0x489de){if(!_0x489de){_0x4b8b3c[_0xd4c6('0x31')](0x194);}return _0x489de;};}function handleError(_0x37db81,_0x5c5ce6){_0x5c5ce6=_0x5c5ce6||0x1f4;return function(_0x45f367){logger[_0xd4c6('0x32')](_0x45f367[_0xd4c6('0x33')]);if(_0x45f367[_0xd4c6('0x34')]){delete _0x45f367[_0xd4c6('0x34')];}_0x37db81['status'](_0x5c5ce6)[_0xd4c6('0x35')](_0x45f367);};}exports[_0xd4c6('0x36')]=function(_0x32f5d1,_0x77660f){var _0x4c7187={},_0x3d7667={},_0x42cf33={'count':0x0,'rows':[]};var _0x1c6336=_[_0xd4c6('0x37')](db['Plugin']['rawAttributes'],function(_0x5aebc6){return{'name':_0x5aebc6[_0xd4c6('0x38')],'type':_0x5aebc6[_0xd4c6('0x39')]['key']};});_0x3d7667[_0xd4c6('0x3a')]=_[_0xd4c6('0x37')](_0x1c6336,'name');_0x3d7667[_0xd4c6('0x3b')]=_['keys'](_0x32f5d1['query']);_0x3d7667['filters']=_['intersection'](_0x3d7667['model'],_0x3d7667[_0xd4c6('0x3b')]);_0x4c7187[_0xd4c6('0x3c')]=_[_0xd4c6('0x3d')](_0x3d7667[_0xd4c6('0x3a')],qs['fields'](_0x32f5d1['query']['fields']));_0x4c7187[_0xd4c6('0x3c')]=_0x4c7187['attributes'][_0xd4c6('0x3e')]?_0x4c7187['attributes']:_0x3d7667[_0xd4c6('0x3a')];if(!_0x32f5d1[_0xd4c6('0x3b')][_0xd4c6('0x3f')](_0xd4c6('0x40'))){_0x4c7187['limit']=qs[_0xd4c6('0x26')](_0x32f5d1[_0xd4c6('0x3b')]['limit']);_0x4c7187[_0xd4c6('0x23')]=qs[_0xd4c6('0x23')](_0x32f5d1[_0xd4c6('0x3b')][_0xd4c6('0x23')]);}_0x4c7187['order']=qs[_0xd4c6('0x41')](_0x32f5d1[_0xd4c6('0x3b')][_0xd4c6('0x41')]);_0x4c7187[_0xd4c6('0x42')]=qs['filters'](_[_0xd4c6('0x43')](_0x32f5d1[_0xd4c6('0x3b')],_0x3d7667['filters']),_0x1c6336);if(_0x32f5d1[_0xd4c6('0x3b')][_0xd4c6('0x44')]){_0x4c7187[_0xd4c6('0x42')]=_['merge'](_0x4c7187['where'],{'$or':_[_0xd4c6('0x37')](_0x1c6336,function(_0x4843a3){if(_0x4843a3[_0xd4c6('0x39')]!==_0xd4c6('0x45')){var _0xa04b7f={};_0xa04b7f[_0x4843a3[_0xd4c6('0x34')]]={'$like':'%'+_0x32f5d1['query'][_0xd4c6('0x44')]+'%'};return _0xa04b7f;}})});}_0x4c7187=_['merge']({},_0x4c7187,_0x32f5d1['options']);var _0x1943dc={'where':_0x4c7187['where']};return db[_0xd4c6('0x46')]['count'](_0x1943dc)[_0xd4c6('0x2c')](function(_0x5254a8){_0x42cf33[_0xd4c6('0x25')]=_0x5254a8;if(_0x32f5d1[_0xd4c6('0x3b')][_0xd4c6('0x47')]){_0x4c7187[_0xd4c6('0x48')]=[{'all':!![]}];}return db[_0xd4c6('0x46')][_0xd4c6('0x49')](_0x4c7187);})['then'](function(_0x360cea){_0x42cf33[_0xd4c6('0x4a')]=_0x360cea;return _0x42cf33;})['then'](respondWithFilteredResult(_0x77660f,_0x4c7187))[_0xd4c6('0x4b')](handleError(_0x77660f,null));};exports[_0xd4c6('0x4c')]=function(_0x131465,_0xa3cf6b){var _0x5b6d7c={'raw':!![],'where':{'id':_0x131465[_0xd4c6('0x4d')]['id']}},_0x27b9d9={};_0x27b9d9[_0xd4c6('0x3a')]=_['keys'](db[_0xd4c6('0x46')][_0xd4c6('0x4e')]);_0x27b9d9['query']=_[_0xd4c6('0x4f')](_0x131465[_0xd4c6('0x3b')]);_0x27b9d9[_0xd4c6('0x50')]=_[_0xd4c6('0x3d')](_0x27b9d9['model'],_0x27b9d9['query']);_0x5b6d7c[_0xd4c6('0x3c')]=_[_0xd4c6('0x3d')](_0x27b9d9[_0xd4c6('0x3a')],qs['fields'](_0x131465[_0xd4c6('0x3b')]['fields']));_0x5b6d7c[_0xd4c6('0x3c')]=_0x5b6d7c[_0xd4c6('0x3c')][_0xd4c6('0x3e')]?_0x5b6d7c[_0xd4c6('0x3c')]:_0x27b9d9[_0xd4c6('0x3a')];if(_0x131465[_0xd4c6('0x3b')][_0xd4c6('0x47')]){_0x5b6d7c[_0xd4c6('0x48')]=[{'all':!![]}];}_0x5b6d7c=_[_0xd4c6('0x51')]({},_0x5b6d7c,_0x131465[_0xd4c6('0x52')]);return db[_0xd4c6('0x46')][_0xd4c6('0x53')](_0x5b6d7c)[_0xd4c6('0x2c')](handleEntityNotFound(_0xa3cf6b,null))[_0xd4c6('0x2c')](respondWithResult(_0xa3cf6b,null))[_0xd4c6('0x4b')](handleError(_0xa3cf6b,null));};exports[_0xd4c6('0x54')]=function(_0x3672d6,_0x28cafe,_0x59a2e3){return db['Plugin'][_0xd4c6('0x53')]({'where':{'id':_0x3672d6[_0xd4c6('0x4d')]['id']},'attributes':[_0xd4c6('0x34'),_0xd4c6('0x8')],'raw':!![]})[_0xd4c6('0x2c')](handleEntityNotFound(_0x28cafe,null))['then'](function(_0x49fff3){if(_0x49fff3){var _0x36078b=path[_0xd4c6('0x55')](config[_0xd4c6('0x56')],'server/files/plugins',util[_0xd4c6('0x57')](_0xd4c6('0x58'),path[_0xd4c6('0x59')](_0x49fff3[_0xd4c6('0x8')])));var _0x4b0ed3=fs[_0xd4c6('0x5a')](_0x36078b);var _0x4a1c0b=archiver('zip',{'zlib':{'level':0x9}});_0x4a1c0b['on']('warning',function(_0x51f395){if(_0x51f395[_0xd4c6('0x5b')]==='ENOENT'){logger[_0xd4c6('0x32')](_0x51f395);}else{throw new db[(_0xd4c6('0x5c'))][(_0xd4c6('0x5d'))](_0xd4c6('0x5e'));}});_0x4a1c0b['on'](_0xd4c6('0x32'),function(_0x309cad){throw new db[(_0xd4c6('0x5c'))]['Error'](_0xd4c6('0x5e'));});_0x4a1c0b[_0xd4c6('0x5f')](_0x4b0ed3);_0x4a1c0b[_0xd4c6('0x60')](_0xd4c6('0x61'),{'cwd':path[_0xd4c6('0x55')](config['root'],_0xd4c6('0x62'),path[_0xd4c6('0x63')](_0x49fff3[_0xd4c6('0x8')])),'ignore':[path[_0xd4c6('0x55')](path[_0xd4c6('0x59')](_0x49fff3[_0xd4c6('0x8')]),_0xd4c6('0x64')),path[_0xd4c6('0x55')](path['basename'](_0x49fff3[_0xd4c6('0x8')]),_0xd4c6('0x65'))],'nodir':!![]})['finalize']();_0x4b0ed3['on'](_0xd4c6('0x66'),function(){if(!fs[_0xd4c6('0x67')](_0x36078b)){throw new db[(_0xd4c6('0x5c'))][(_0xd4c6('0x5d'))](_0xd4c6('0x68'));}return _0x28cafe['download'](_0x36078b,util[_0xd4c6('0x57')](_0xd4c6('0x58'),path[_0xd4c6('0x59')](_0x49fff3[_0xd4c6('0x8')])),function(_0x4be808){if(_0x4be808){throw new db[(_0xd4c6('0x5c'))][(_0xd4c6('0x5d'))](_0xd4c6('0x69'));}fs[_0xd4c6('0x6a')](_0x36078b);logger[_0xd4c6('0x6b')](_0xd4c6('0x6c'));logger['info'](_0xd4c6('0x6d'));});});}return null;})[_0xd4c6('0x4b')](handleError(_0x28cafe,null));};exports[_0xd4c6('0x6e')]=function(_0x3de182,_0x5d44b2,_0x13957e){var _0x1d45c0=path['basename'](_0x3de182[_0xd4c6('0x6f')][_0xd4c6('0x70')],path['extname'](_0x3de182['file'][_0xd4c6('0x70')]));var _0x5d3154=path[_0xd4c6('0x55')](config[_0xd4c6('0x56')],_0xd4c6('0x62'),_0x3de182[_0xd4c6('0x6f')]['filename']);var _0x46108a=path[_0xd4c6('0x55')](config[_0xd4c6('0x56')],_0xd4c6('0x62'),_0x1d45c0);logger[_0xd4c6('0x6b')](_0xd4c6('0x71'),_0x5d3154);logger[_0xd4c6('0x6b')]('Plugin\x20upload\x20destination:\x20%s',_0x46108a);try{fs[_0xd4c6('0x72')](_0x5d3154,parseInt(_0xd4c6('0x73'),0x8));extract(_0x5d3154,{'dir':_0x46108a},function(_0x37ee1d){if(_0x37ee1d){logger[_0xd4c6('0x32')](_0x37ee1d);handleError(_0x37ee1d,!![]);};var _0x237835=fs[_0xd4c6('0x74')](_0x46108a);if(_0x237835[_0xd4c6('0x3e')]>0x1){removeReferences(_0x5d3154,_0x46108a);logger[_0xd4c6('0x32')]('Invalid\x20plugin\x20structure');return _0x13957e(new Error(_0xd4c6('0x75')));}var _0x334555=fs[_0xd4c6('0x76')](path['join'](_0x46108a,_0x237835[0x0]));if(_0x334555[_0xd4c6('0x77')]()){removeReferences(_0x5d3154,_0x46108a);logger[_0xd4c6('0x32')](_0xd4c6('0x75'));return _0x13957e(new Error('Invalid\x20plugin\x20structure'));}if(_0x334555[_0xd4c6('0x78')]()){var _0x289365=fs['readdirSync'](path[_0xd4c6('0x55')](_0x46108a,_0x237835[0x0]));if(_0x289365['length']===0x0){removeReferences(_0x5d3154,_0x46108a);logger[_0xd4c6('0x32')]('Invalid\x20plugin\x20structure');return _0x13957e(new Error('Invalid\x20plugin\x20structure'));}var _0xbb4011=_0x289365[_0xd4c6('0x79')](function(_0x51f71e){return _0x51f71e===_0xd4c6('0x7a');});if(!_0xbb4011){return _0x13957e(new Error(_0xd4c6('0x7b')));}var _0x1d9a3b=fs[_0xd4c6('0x7c')](path[_0xd4c6('0x55')](_0x46108a,_0x237835[0x0],_0xd4c6('0x7a')));var _0x8ee192=JSON[_0xd4c6('0x7d')](_0x1d9a3b);if('undefined'==typeof _0x8ee192['name']){return _0x13957e(new Error(_0xd4c6('0x7e')));}if(_0xd4c6('0x24')==typeof _0x8ee192[_0xd4c6('0x39')]){return _0x13957e(new Error(_0xd4c6('0x7f')));}if(_0xd4c6('0x24')==typeof _0x8ee192[_0xd4c6('0x80')]){return _0x13957e(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xd4c6('0x24')==typeof _0x8ee192['parameters']){return _0x13957e(new Error(_0xd4c6('0x81')));}if(_0x8ee192['type']==='html'){if(_0xd4c6('0x24')==typeof _0x8ee192['parameters'][_0xd4c6('0x82')]){return _0x13957e(new Error(_0xd4c6('0x83')));}if(_0xd4c6('0x24')==typeof _0x8ee192['parameters'][_0xd4c6('0x82')][_0xd4c6('0x84')]&&'undefined'==typeof _0x8ee192[_0xd4c6('0x85')][_0xd4c6('0x82')][_0xd4c6('0x86')]){return _0x13957e(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x8ee192[_0xd4c6('0x39')]==='script'){if(_0xd4c6('0x24')==typeof _0x8ee192[_0xd4c6('0x85')]['scriptName']){return _0x13957e(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x8ee192[_0xd4c6('0x85')][_0xd4c6('0x87')]){return _0x13957e(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x13957e(new Error(_0xd4c6('0x88')));}var _0x29f24f=_0x8ee192[_0xd4c6('0x34')];var _0x3b039e=_0x8ee192[_0xd4c6('0x89')];var _0x28ee4d=_0x8ee192[_0xd4c6('0x39')];var _0x5e2501=_0x8ee192['sidebar']?_0x8ee192[_0xd4c6('0x8a')]:_0xd4c6('0x8b');var _0x26d78a=_0x8ee192[_0xd4c6('0x8c')]?_0x8ee192['icon']:_0xd4c6('0x8d');var _0x155ffb='';var _0x79d921='';var _0x236d9d='';var _0x506441='';var _0x3d1dbd=_0x8ee192[_0xd4c6('0x80')];if(_0x28ee4d==='html'){if(_0xd4c6('0x24')!=typeof _0x8ee192[_0xd4c6('0x85')][_0xd4c6('0x82')]['admin']){var _0xa73142=_0x8ee192[_0xd4c6('0x85')][_0xd4c6('0x82')][_0xd4c6('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xd4c6('0x8e')](_0xa73142)){_0x155ffb=path[_0xd4c6('0x55')]('plugins',_0x1d45c0,_0x237835[0x0],_0xa73142);}else{_0x155ffb=_0xa73142;}}else{logger['info'](_0xd4c6('0x8f'));}if(_0xd4c6('0x24')!=typeof _0x8ee192[_0xd4c6('0x85')][_0xd4c6('0x82')][_0xd4c6('0x86')]){var _0x458beb=_0x8ee192[_0xd4c6('0x85')][_0xd4c6('0x82')][_0xd4c6('0x86')];if(!/^(f|ht)tps?:\/\//i['test'](_0x458beb)){_0x79d921=path['join'](_0xd4c6('0x90'),_0x1d45c0,_0x237835[0x0],_0x458beb);}else{_0x79d921=_0x458beb;}}else{logger['info'](_0xd4c6('0x91'));}}else if(_0x28ee4d===_0xd4c6('0x92')){_0x236d9d=_0x8ee192['parameters'][_0xd4c6('0x93')];_0x506441=_0x8ee192[_0xd4c6('0x85')][_0xd4c6('0x87')];if('undefined'!=typeof _0x8ee192[_0xd4c6('0x85')][_0xd4c6('0x82')]){if(_0xd4c6('0x24')!=typeof _0x8ee192[_0xd4c6('0x85')][_0xd4c6('0x82')][_0xd4c6('0x84')]){var _0xa73142=_0x8ee192[_0xd4c6('0x85')][_0xd4c6('0x82')][_0xd4c6('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xd4c6('0x8e')](_0xa73142)){_0x155ffb=path['join'](_0xd4c6('0x90'),_0x1d45c0,_0x237835[0x0],_0xa73142);}else{_0x155ffb=_0xa73142;}}if(_0xd4c6('0x24')!=typeof _0x8ee192['parameters'][_0xd4c6('0x82')]['agent']){var _0x458beb=_0x8ee192[_0xd4c6('0x85')][_0xd4c6('0x82')][_0xd4c6('0x86')];if(!/^(f|ht)tps?:\/\//i[_0xd4c6('0x8e')](_0x458beb)){_0x79d921=path[_0xd4c6('0x55')](_0xd4c6('0x90'),_0x1d45c0,_0x237835[0x0],_0x458beb);}else{_0x79d921=_0x458beb;}}}}var _0x49ccac={'name':_0x29f24f,'description':_0x3b039e,'path':path[_0xd4c6('0x55')](_0x1d45c0,_0x237835[0x0]),'type':_0x28ee4d,'sidebar':_0x5e2501,'icon':_0x26d78a,'adminUrl':_0x155ffb,'agentUrl':_0x79d921,'scriptName':_0x236d9d,'scriptPath':_0x506441,'version':_0x3d1dbd};removeReferences(_0x5d3154,null);return db[_0xd4c6('0x46')][_0xd4c6('0x94')](_0x49ccac)[_0xd4c6('0x2c')](function(_0x1383a3){var _0x169be1={'role':_0x3de182['body'][_0xd4c6('0x95')],'userProfileId':_0x3de182[_0xd4c6('0x96')][_0xd4c6('0x97')]};if(!_0x169be1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x169be1[_0xd4c6('0x95')]==='user'){var _0x56eb0f=_0x1383a3[_0xd4c6('0x2d')]({'plain':!![]});return db[_0xd4c6('0x98')]['find']({'where':{'name':_0xd4c6('0x2e'),'userProfileId':_0x169be1[_0xd4c6('0x97')]},'raw':!![]})['then'](function(_0x190a02){if(_0x190a02&&_0x190a02[_0xd4c6('0x99')]===0x0){return db[_0xd4c6('0x2f')][_0xd4c6('0x94')]({'name':_0x56eb0f['name'],'resourceId':_0x56eb0f['id'],'type':_0x190a02['name'],'sectionId':_0x190a02['id']},{})[_0xd4c6('0x2c')](function(){return _0x1383a3;});}else{return _0x1383a3;}})['catch'](function(_0x4372ee){logger['error'](_0xd4c6('0x9a'),_0x4372ee);throw _0x4372ee;});}return _0x1383a3;})[_0xd4c6('0x2c')](respondWithResult(_0x5d44b2,null))[_0xd4c6('0x4b')](handleError(_0x5d44b2,null));}});}catch(_0x50a725){_0x5d44b2[_0xd4c6('0x20')](0x1f4)[_0xd4c6('0x35')](_0x50a725);}};function removeReferences(_0x33e905,_0x59bf44){try{if(_0x33e905){fs[_0xd4c6('0x6a')](_0x33e905);logger[_0xd4c6('0x6b')](_0xd4c6('0x9b'));}if(_0x59bf44){rimraf(_0x59bf44,function(){});logger[_0xd4c6('0x6b')](_0xd4c6('0x9c'));}}catch(_0x5915ba){logger[_0xd4c6('0x32')](_0x5915ba);}}exports[_0xd4c6('0x2b')]=function(_0x3a9ffa,_0xe71915,_0x44ee4b){return db['Plugin'][_0xd4c6('0x53')]({'where':{'id':_0x3a9ffa['params']['id']}})[_0xd4c6('0x2c')](handleEntityNotFound(_0xe71915,null))[_0xd4c6('0x2c')](saveUpdates(_0x3a9ffa[_0xd4c6('0x96')],null))[_0xd4c6('0x2c')](respondWithResult(_0xe71915,null))['catch'](handleError(_0xe71915,null));};exports['delete']=function(_0x4428fe,_0x2784ad,_0x2cf768){return db[_0xd4c6('0x46')][_0xd4c6('0x53')]({'where':{'id':_0x4428fe[_0xd4c6('0x4d')]['id']}})['then'](function(_0x22ac1b){if(_0x22ac1b){return _0x22ac1b[_0xd4c6('0x30')]();}})[_0xd4c6('0x2c')](function(_0x21ad57){rimraf(path[_0xd4c6('0x55')](config[_0xd4c6('0x56')],'server/files/plugins',path['dirname'](_0x21ad57['path'])),function(){});return _0x21ad57;})[_0xd4c6('0x2c')](handleEntityNotFound(_0x2784ad,null))['then'](respondWithStatusCode(_0x2784ad,null))[_0xd4c6('0x4b')](handleError(_0x2784ad,null));};exports[_0xd4c6('0x9d')]=function(_0x595654,_0x3f3429,_0x527eed){return BPromise[_0xd4c6('0x9e')]()['then'](function(){if(!_0x595654[_0xd4c6('0x3b')][_0xd4c6('0x8')]){throw new Error(_0xd4c6('0x9f'));}if(!_0x595654[_0xd4c6('0x3b')][_0xd4c6('0xa0')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x330978=_0x595654['query']['hostname']?_0x595654[_0xd4c6('0x3b')][_0xd4c6('0xa1')]+':'+_0x595654['query'][_0xd4c6('0xa0')]:_0xd4c6('0xa2')+_0x595654[_0xd4c6('0x3b')][_0xd4c6('0xa0')];var _0x2047f1=_0x595654[_0xd4c6('0x3b')]['json']?_0x595654['query'][_0xd4c6('0x22')]:!![];var _0x1cabba=_0x595654[_0xd4c6('0x3b')][_0xd4c6('0xa3')]?_0x595654[_0xd4c6('0x3b')]['encoding']:null;var _0x3ae661={'method':_0x595654[_0xd4c6('0xa4')],'uri':util[_0xd4c6('0x57')](_0xd4c6('0xa5'),_0x330978,_0x595654[_0xd4c6('0x3b')][_0xd4c6('0x8')]),'json':_0x2047f1,'resolveWithFullResponse':!![],'encoding':_0x1cabba,'qs':_0x595654[_0xd4c6('0x3b')]};if(_0x595654[_0xd4c6('0xa6')]){_0x3ae661[_0xd4c6('0xa6')]=_0x595654['headers'];if(_0x3ae661[_0xd4c6('0xa6')][_0xd4c6('0xa7')]){delete _0x3ae661[_0xd4c6('0xa6')]['content-length'];}}if(_0x3ae661['headers'][_0xd4c6('0xa8')]){delete _0x3ae661[_0xd4c6('0xa6')][_0xd4c6('0xa8')];}return rp(_0x3ae661);})[_0xd4c6('0x2c')](function(_0x56693e){if(_0x56693e){_0x3f3429[_0xd4c6('0x27')](_0x56693e['headers']);logger[_0xd4c6('0x6b')](_0x56693e[_0xd4c6('0x96')]);if(_[_0xd4c6('0xa9')](_0x595654['query'][_0xd4c6('0x8')],_0xd4c6('0x54'))&&_0x56693e[_0xd4c6('0xaa')]==0x1f4){return _0x3f3429['sendStatus'](_0x56693e['statusCode']);}else{return _0x3f3429[_0xd4c6('0x20')](_0x56693e[_0xd4c6('0xaa')])['send'](_0x56693e[_0xd4c6('0x96')]);}}else{return _0x3f3429[_0xd4c6('0x31')](0xc8);}})[_0xd4c6('0x4b')](handleError(_0x3f3429,null));};exports[_0xd4c6('0xab')]=function(_0x59d2e6,_0x2ce1cd,_0x1f7b10){return BPromise[_0xd4c6('0x9e')]()['then'](function(){if(!_0x59d2e6[_0xd4c6('0x3b')]['path']){throw new Error(_0xd4c6('0x9f'));}if(!_0x59d2e6[_0xd4c6('0x3b')][_0xd4c6('0xa0')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3674ae=_0x59d2e6[_0xd4c6('0x3b')][_0xd4c6('0xa1')]?_0x59d2e6[_0xd4c6('0x3b')][_0xd4c6('0xa1')]+':'+_0x59d2e6['query']['port']:_0xd4c6('0xa2')+_0x59d2e6[_0xd4c6('0x3b')][_0xd4c6('0xa0')];var _0x50dd87=_0x59d2e6[_0xd4c6('0x3b')][_0xd4c6('0x22')]?_0x59d2e6[_0xd4c6('0x3b')]['json']:!![];var _0x3ef632=_0x59d2e6['query'][_0xd4c6('0xa3')]?_0x59d2e6[_0xd4c6('0x3b')][_0xd4c6('0xa3')]:null;var _0x1795d2={'method':_0x59d2e6[_0xd4c6('0xa4')],'uri':util[_0xd4c6('0x57')](_0xd4c6('0xa5'),_0x3674ae,_0x59d2e6[_0xd4c6('0x3b')]['path']),'json':_0x50dd87,'resolveWithFullResponse':!![],'encoding':_0x3ef632,'body':_0x59d2e6[_0xd4c6('0x96')]};if(_0x59d2e6[_0xd4c6('0xa6')]){_0x1795d2['headers']=_0x59d2e6['headers'];if(_0x1795d2[_0xd4c6('0xa6')][_0xd4c6('0xa7')]){delete _0x1795d2[_0xd4c6('0xa6')][_0xd4c6('0xa7')];}}if(_0x1795d2['headers'][_0xd4c6('0xa8')]){delete _0x1795d2[_0xd4c6('0xa6')]['content-type'];}return rp(_0x1795d2);})['then'](function(_0x1f0439){if(_0x1f0439){_0x2ce1cd[_0xd4c6('0x27')](_0x1f0439[_0xd4c6('0xa6')]);logger[_0xd4c6('0x6b')](_0x1f0439['body']);return _0x2ce1cd[_0xd4c6('0x20')](_0x1f0439[_0xd4c6('0xaa')])[_0xd4c6('0x35')](_0x1f0439['body']);}else{return _0x2ce1cd['sendStatus'](0xc8);}})[_0xd4c6('0x4b')](handleError(_0x2ce1cd,null));}; \ No newline at end of file +var _0x5425=['squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./plugin.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','end','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','length','find','catch','download','join','root','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','script','scriptPath','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','create','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','hostname','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x3340c8,_0x3d67d7){var _0x30ca8a=function(_0x435fff){while(--_0x435fff){_0x3340c8['push'](_0x3340c8['shift']());}};_0x30ca8a(++_0x3d67d7);}(_0x5425,0xa3));var _0x5542=function(_0x36a1d6,_0x5b72a9){_0x36a1d6=_0x36a1d6-0x0;var _0x49734e=_0x5425[_0x36a1d6];return _0x49734e;};'use strict';var emlformat=require(_0x5542('0x0'));var rimraf=require(_0x5542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5542('0x2'));var moment=require(_0x5542('0x3'));var BPromise=require(_0x5542('0x4'));var Mustache=require(_0x5542('0x5'));var util=require(_0x5542('0x6'));var path=require(_0x5542('0x7'));var sox=require(_0x5542('0x8'));var csv=require(_0x5542('0x9'));var ejs=require(_0x5542('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5542('0xb'));var squel=require(_0x5542('0xc'));var crypto=require(_0x5542('0xd'));var jsforce=require(_0x5542('0xe'));var deskjs=require(_0x5542('0xf'));var toCsv=require(_0x5542('0x9'));var querystring=require(_0x5542('0x10'));var Papa=require(_0x5542('0x11'));var extract=require(_0x5542('0x12'));var rimraf=require(_0x5542('0x1'));var archiver=require(_0x5542('0x13'));var Redis=require('ioredis');var authService=require(_0x5542('0x14'));var qs=require(_0x5542('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5542('0x16'));var logger=require(_0x5542('0x17'))(_0x5542('0x18'));var utils=require('../../config/utils');var config=require(_0x5542('0x19'));var licenseUtil=require(_0x5542('0x1a'));var db=require(_0x5542('0x1b'))['db'];config[_0x5542('0x1c')]=_[_0x5542('0x1d')](config[_0x5542('0x1c')],{'host':_0x5542('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5542('0x1f'))[_0x5542('0x20')](socket);function respondWithStatusCode(_0x533e10,_0xf93cf1){_0xf93cf1=_0xf93cf1||0xcc;return function(_0x4bd826){if(_0x4bd826){return _0x533e10[_0x5542('0x21')](_0xf93cf1);}return _0x533e10['status'](_0xf93cf1)['end']();};}function respondWithResult(_0x15deec,_0x46fa0e){_0x46fa0e=_0x46fa0e||0xc8;return function(_0x5d1ad3){if(_0x5d1ad3){return _0x15deec[_0x5542('0x22')](_0x46fa0e)[_0x5542('0x23')](_0x5d1ad3);}};}function respondWithFilteredResult(_0x99ac42,_0xe48937){return function(_0x1a3889){if(_0x1a3889){var _0x177b16=typeof _0xe48937[_0x5542('0x24')]==='undefined'&&typeof _0xe48937[_0x5542('0x25')]==='undefined';var _0x984963=_0x1a3889[_0x5542('0x26')];var _0x23d9e6=_0x177b16?0x0:_0xe48937['offset'];var _0x22d7c0=_0x177b16?_0x1a3889[_0x5542('0x26')]:_0xe48937[_0x5542('0x24')]+_0xe48937[_0x5542('0x25')];var _0x206946;if(_0x22d7c0>=_0x984963){_0x22d7c0=_0x984963;_0x206946=0xc8;}else{_0x206946=0xce;}_0x99ac42[_0x5542('0x22')](_0x206946);return _0x99ac42[_0x5542('0x27')](_0x5542('0x28'),_0x23d9e6+'-'+_0x22d7c0+'/'+_0x984963)[_0x5542('0x23')](_0x1a3889);}return null;};}function patchUpdates(_0x24ed0c){return function(_0x429b80){try{jsonpatch[_0x5542('0x29')](_0x429b80,_0x24ed0c,!![]);}catch(_0x30b7a3){return BPromise[_0x5542('0x2a')](_0x30b7a3);}return _0x429b80[_0x5542('0x2b')]();};}function saveUpdates(_0x779284,_0x892edc){return function(_0x8f6a96){if(_0x8f6a96){return _0x8f6a96[_0x5542('0x2c')](_0x779284)['then'](function(_0x40431c){return _0x40431c;});}return null;};}function removeEntity(_0x36b513,_0x36c4da){return function(_0x5c6543){if(_0x5c6543){return _0x5c6543[_0x5542('0x2d')]()[_0x5542('0x2e')](function(){var _0x115be4=_0x5c6543[_0x5542('0x2f')]({'plain':!![]});var _0x17dd62=_0x5542('0x30');return db[_0x5542('0x31')]['destroy']({'where':{'type':_0x17dd62,'resourceId':_0x115be4['id']}})[_0x5542('0x2e')](function(){return _0x5c6543;});})['then'](function(){_0x36b513['status'](0xcc)[_0x5542('0x32')]();});}};}function handleEntityNotFound(_0xaeb789,_0x22c2f5){return function(_0x581a63){if(!_0x581a63){_0xaeb789[_0x5542('0x21')](0x194);}return _0x581a63;};}function handleError(_0x2f7e7a,_0x3aa8f9){_0x3aa8f9=_0x3aa8f9||0x1f4;return function(_0x178ed9){logger[_0x5542('0x33')](_0x178ed9[_0x5542('0x34')]);if(_0x178ed9[_0x5542('0x35')]){delete _0x178ed9['name'];}_0x2f7e7a['status'](_0x3aa8f9)[_0x5542('0x36')](_0x178ed9);};}exports[_0x5542('0x37')]=function(_0x1207d4,_0x1ab0fd){var _0x3aca48={},_0x319fa1={},_0x59cec4={'count':0x0,'rows':[]};var _0x2e9ed9=_[_0x5542('0x38')](db[_0x5542('0x39')][_0x5542('0x3a')],function(_0x1a3088){return{'name':_0x1a3088[_0x5542('0x3b')],'type':_0x1a3088[_0x5542('0x3c')]['key']};});_0x319fa1['model']=_[_0x5542('0x38')](_0x2e9ed9,_0x5542('0x35'));_0x319fa1[_0x5542('0x3d')]=_['keys'](_0x1207d4[_0x5542('0x3d')]);_0x319fa1[_0x5542('0x3e')]=_[_0x5542('0x3f')](_0x319fa1[_0x5542('0x40')],_0x319fa1[_0x5542('0x3d')]);_0x3aca48['attributes']=_['intersection'](_0x319fa1[_0x5542('0x40')],qs[_0x5542('0x41')](_0x1207d4[_0x5542('0x3d')]['fields']));_0x3aca48[_0x5542('0x42')]=_0x3aca48['attributes']['length']?_0x3aca48[_0x5542('0x42')]:_0x319fa1[_0x5542('0x40')];if(!_0x1207d4['query'][_0x5542('0x43')](_0x5542('0x44'))){_0x3aca48[_0x5542('0x25')]=qs[_0x5542('0x25')](_0x1207d4[_0x5542('0x3d')]['limit']);_0x3aca48[_0x5542('0x24')]=qs['offset'](_0x1207d4[_0x5542('0x3d')]['offset']);}_0x3aca48[_0x5542('0x45')]=qs[_0x5542('0x46')](_0x1207d4[_0x5542('0x3d')]['sort']);_0x3aca48[_0x5542('0x47')]=qs[_0x5542('0x3e')](_[_0x5542('0x48')](_0x1207d4[_0x5542('0x3d')],_0x319fa1[_0x5542('0x3e')]),_0x2e9ed9);if(_0x1207d4[_0x5542('0x3d')][_0x5542('0x49')]){_0x3aca48['where']=_[_0x5542('0x4a')](_0x3aca48['where'],{'$or':_[_0x5542('0x38')](_0x2e9ed9,function(_0x2790aa){if(_0x2790aa[_0x5542('0x3c')]!==_0x5542('0x4b')){var _0x128489={};_0x128489[_0x2790aa[_0x5542('0x35')]]={'$like':'%'+_0x1207d4[_0x5542('0x3d')][_0x5542('0x49')]+'%'};return _0x128489;}})});}_0x3aca48=_[_0x5542('0x4a')]({},_0x3aca48,_0x1207d4[_0x5542('0x4c')]);var _0x14b372={'where':_0x3aca48[_0x5542('0x47')]};return db[_0x5542('0x39')][_0x5542('0x26')](_0x14b372)[_0x5542('0x2e')](function(_0x58bd8d){_0x59cec4[_0x5542('0x26')]=_0x58bd8d;if(_0x1207d4[_0x5542('0x3d')][_0x5542('0x4d')]){_0x3aca48[_0x5542('0x4e')]=[{'all':!![]}];}return db[_0x5542('0x39')]['findAll'](_0x3aca48);})[_0x5542('0x2e')](function(_0x5f2f37){_0x59cec4[_0x5542('0x4f')]=_0x5f2f37;return _0x59cec4;})['then'](respondWithFilteredResult(_0x1ab0fd,_0x3aca48))['catch'](handleError(_0x1ab0fd,null));};exports[_0x5542('0x50')]=function(_0x2a224e,_0x4de8e6){var _0x5955e8={'raw':!![],'where':{'id':_0x2a224e[_0x5542('0x51')]['id']}},_0x362742={};_0x362742['model']=_[_0x5542('0x52')](db[_0x5542('0x39')]['rawAttributes']);_0x362742[_0x5542('0x3d')]=_[_0x5542('0x52')](_0x2a224e[_0x5542('0x3d')]);_0x362742[_0x5542('0x3e')]=_[_0x5542('0x3f')](_0x362742['model'],_0x362742[_0x5542('0x3d')]);_0x5955e8['attributes']=_['intersection'](_0x362742['model'],qs[_0x5542('0x41')](_0x2a224e[_0x5542('0x3d')][_0x5542('0x41')]));_0x5955e8[_0x5542('0x42')]=_0x5955e8[_0x5542('0x42')][_0x5542('0x53')]?_0x5955e8[_0x5542('0x42')]:_0x362742['model'];if(_0x2a224e[_0x5542('0x3d')]['includeAll']){_0x5955e8[_0x5542('0x4e')]=[{'all':!![]}];}_0x5955e8=_[_0x5542('0x4a')]({},_0x5955e8,_0x2a224e['options']);return db[_0x5542('0x39')][_0x5542('0x54')](_0x5955e8)['then'](handleEntityNotFound(_0x4de8e6,null))[_0x5542('0x2e')](respondWithResult(_0x4de8e6,null))[_0x5542('0x55')](handleError(_0x4de8e6,null));};exports[_0x5542('0x56')]=function(_0x54d6c1,_0x3c4d54,_0x25cf4a){return db[_0x5542('0x39')][_0x5542('0x54')]({'where':{'id':_0x54d6c1['params']['id']},'attributes':['name',_0x5542('0x7')],'raw':!![]})[_0x5542('0x2e')](handleEntityNotFound(_0x3c4d54,null))[_0x5542('0x2e')](function(_0x17d661){if(_0x17d661){var _0x384c39=path[_0x5542('0x57')](config[_0x5542('0x58')],_0x5542('0x59'),util[_0x5542('0x5a')](_0x5542('0x5b'),path['basename'](_0x17d661[_0x5542('0x7')])));var _0xfc802c=fs[_0x5542('0x5c')](_0x384c39);var _0x56ddeb=archiver(_0x5542('0x5d'),{'zlib':{'level':0x9}});_0x56ddeb['on'](_0x5542('0x5e'),function(_0x589987){if(_0x589987[_0x5542('0x5f')]===_0x5542('0x60')){logger[_0x5542('0x33')](_0x589987);}else{throw new db[(_0x5542('0x61'))][(_0x5542('0x62'))](_0x5542('0x63'));}});_0x56ddeb['on']('error',function(_0x50a72a){throw new db[(_0x5542('0x61'))][(_0x5542('0x62'))](_0x5542('0x63'));});_0x56ddeb['pipe'](_0xfc802c);_0x56ddeb['glob'](_0x5542('0x64'),{'cwd':path[_0x5542('0x57')](config['root'],_0x5542('0x59'),path[_0x5542('0x65')](_0x17d661['path'])),'ignore':[path[_0x5542('0x57')](path[_0x5542('0x66')](_0x17d661[_0x5542('0x7')]),_0x5542('0x67')),path[_0x5542('0x57')](path[_0x5542('0x66')](_0x17d661['path']),_0x5542('0x68'))],'nodir':!![]})[_0x5542('0x69')]();_0xfc802c['on'](_0x5542('0x6a'),function(){if(!fs[_0x5542('0x6b')](_0x384c39)){throw new db[(_0x5542('0x61'))][(_0x5542('0x62'))]('Plugin\x20not\x20found');}return _0x3c4d54[_0x5542('0x56')](_0x384c39,util[_0x5542('0x5a')](_0x5542('0x5b'),path[_0x5542('0x66')](_0x17d661[_0x5542('0x7')])),function(_0x19545d){if(_0x19545d){throw new db['Sequelize'][(_0x5542('0x62'))](_0x5542('0x6c'));}fs[_0x5542('0x6d')](_0x384c39);logger[_0x5542('0x6e')](_0x5542('0x6f'));logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0x5542('0x55')](handleError(_0x3c4d54,null));};exports[_0x5542('0x70')]=function(_0x553e6b,_0x372e79,_0x4c0f93){var _0x567a08=path['basename'](_0x553e6b[_0x5542('0x71')]['filename'],path[_0x5542('0x72')](_0x553e6b[_0x5542('0x71')]['filename']));var _0x544dec=path['join'](config['root'],'server/files/plugins',_0x553e6b['file'][_0x5542('0x73')]);var _0x2fa2d2=path[_0x5542('0x57')](config[_0x5542('0x58')],'server/files/plugins',_0x567a08);logger[_0x5542('0x6e')](_0x5542('0x74'),_0x544dec);logger['info'](_0x5542('0x75'),_0x2fa2d2);try{fs[_0x5542('0x76')](_0x544dec,parseInt('0777',0x8));extract(_0x544dec,{'dir':_0x2fa2d2},function(_0x345be9){if(_0x345be9){logger[_0x5542('0x33')](_0x345be9);handleError(_0x345be9,!![]);};var _0x3bcb8f=fs['readdirSync'](_0x2fa2d2);if(_0x3bcb8f[_0x5542('0x53')]>0x1){removeReferences(_0x544dec,_0x2fa2d2);logger['error'](_0x5542('0x77'));return _0x4c0f93(new Error(_0x5542('0x77')));}var _0x244c21=fs[_0x5542('0x78')](path['join'](_0x2fa2d2,_0x3bcb8f[0x0]));if(_0x244c21[_0x5542('0x79')]()){removeReferences(_0x544dec,_0x2fa2d2);logger[_0x5542('0x33')](_0x5542('0x77'));return _0x4c0f93(new Error(_0x5542('0x77')));}if(_0x244c21[_0x5542('0x7a')]()){var _0x110889=fs['readdirSync'](path['join'](_0x2fa2d2,_0x3bcb8f[0x0]));if(_0x110889['length']===0x0){removeReferences(_0x544dec,_0x2fa2d2);logger[_0x5542('0x33')](_0x5542('0x77'));return _0x4c0f93(new Error(_0x5542('0x77')));}var _0x1f07fd=_0x110889[_0x5542('0x7b')](function(_0x5f4006){return _0x5f4006===_0x5542('0x7c');});if(!_0x1f07fd){return _0x4c0f93(new Error('Plugin\x20manifest\x20missing'));}var _0xdf679e=fs['readFileSync'](path['join'](_0x2fa2d2,_0x3bcb8f[0x0],_0x5542('0x7c')));var _0x379c5e=JSON[_0x5542('0x7d')](_0xdf679e);if(_0x5542('0x7e')==typeof _0x379c5e[_0x5542('0x35')]){return _0x4c0f93(new Error(_0x5542('0x7f')));}if('undefined'==typeof _0x379c5e[_0x5542('0x3c')]){return _0x4c0f93(new Error(_0x5542('0x80')));}if(_0x5542('0x7e')==typeof _0x379c5e[_0x5542('0x81')]){return _0x4c0f93(new Error(_0x5542('0x82')));}if(_0x5542('0x7e')==typeof _0x379c5e[_0x5542('0x83')]){return _0x4c0f93(new Error(_0x5542('0x84')));}if(_0x379c5e['type']===_0x5542('0x85')){if(_0x5542('0x7e')==typeof _0x379c5e[_0x5542('0x83')][_0x5542('0x86')]){return _0x4c0f93(new Error(_0x5542('0x87')));}if(_0x5542('0x7e')==typeof _0x379c5e[_0x5542('0x83')][_0x5542('0x86')][_0x5542('0x88')]&&_0x5542('0x7e')==typeof _0x379c5e[_0x5542('0x83')]['views'][_0x5542('0x89')]){return _0x4c0f93(new Error(_0x5542('0x8a')));}}else if(_0x379c5e['type']==='script'){if('undefined'==typeof _0x379c5e[_0x5542('0x83')][_0x5542('0x8b')]){return _0x4c0f93(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x5542('0x7e')==typeof _0x379c5e[_0x5542('0x83')]['scriptPath']){return _0x4c0f93(new Error(_0x5542('0x8c')));}}else{return _0x4c0f93(new Error(_0x5542('0x8d')));}var _0x44dc6d=_0x379c5e['name'];var _0x45df3f=_0x379c5e['description'];var _0x47af09=_0x379c5e['type'];var _0x42afec=_0x379c5e[_0x5542('0x8e')]?_0x379c5e[_0x5542('0x8e')]:_0x5542('0x8f');var _0x230f98=_0x379c5e['icon']?_0x379c5e[_0x5542('0x90')]:_0x5542('0x91');var _0x4c0fad='';var _0xbbb16f='';var _0x2281e8='';var _0x1407b5='';var _0x39dd13=_0x379c5e[_0x5542('0x81')];if(_0x47af09===_0x5542('0x85')){if('undefined'!=typeof _0x379c5e[_0x5542('0x83')][_0x5542('0x86')][_0x5542('0x88')]){var _0xe45f=_0x379c5e['parameters'][_0x5542('0x86')][_0x5542('0x88')];if(!/^(f|ht)tps?:\/\//i[_0x5542('0x92')](_0xe45f)){_0x4c0fad=path[_0x5542('0x57')]('plugins',_0x567a08,_0x3bcb8f[0x0],_0xe45f);}else{_0x4c0fad=_0xe45f;}}else{logger[_0x5542('0x6e')](_0x5542('0x93'));}if(_0x5542('0x7e')!=typeof _0x379c5e[_0x5542('0x83')][_0x5542('0x86')][_0x5542('0x89')]){var _0x1c56ae=_0x379c5e['parameters'][_0x5542('0x86')][_0x5542('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x5542('0x92')](_0x1c56ae)){_0xbbb16f=path[_0x5542('0x57')](_0x5542('0x94'),_0x567a08,_0x3bcb8f[0x0],_0x1c56ae);}else{_0xbbb16f=_0x1c56ae;}}else{logger[_0x5542('0x6e')](_0x5542('0x95'));}}else if(_0x47af09===_0x5542('0x96')){_0x2281e8=_0x379c5e[_0x5542('0x83')]['scriptName'];_0x1407b5=_0x379c5e[_0x5542('0x83')][_0x5542('0x97')];if('undefined'!=typeof _0x379c5e[_0x5542('0x83')]['views']){if(_0x5542('0x7e')!=typeof _0x379c5e[_0x5542('0x83')][_0x5542('0x86')]['admin']){var _0xe45f=_0x379c5e[_0x5542('0x83')][_0x5542('0x86')][_0x5542('0x88')];if(!/^(f|ht)tps?:\/\//i[_0x5542('0x92')](_0xe45f)){_0x4c0fad=path[_0x5542('0x57')](_0x5542('0x94'),_0x567a08,_0x3bcb8f[0x0],_0xe45f);}else{_0x4c0fad=_0xe45f;}}if(_0x5542('0x7e')!=typeof _0x379c5e[_0x5542('0x83')][_0x5542('0x86')][_0x5542('0x89')]){var _0x1c56ae=_0x379c5e[_0x5542('0x83')][_0x5542('0x86')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x5542('0x92')](_0x1c56ae)){_0xbbb16f=path['join'](_0x5542('0x94'),_0x567a08,_0x3bcb8f[0x0],_0x1c56ae);}else{_0xbbb16f=_0x1c56ae;}}}}var _0x5a928d={'name':_0x44dc6d,'description':_0x45df3f,'path':path['join'](_0x567a08,_0x3bcb8f[0x0]),'type':_0x47af09,'sidebar':_0x42afec,'icon':_0x230f98,'adminUrl':_0x4c0fad,'agentUrl':_0xbbb16f,'scriptName':_0x2281e8,'scriptPath':_0x1407b5,'version':_0x39dd13};removeReferences(_0x544dec,null);return db['Plugin']['create'](_0x5a928d)[_0x5542('0x2e')](function(_0x5959fa){var _0xdd4169={'role':_0x553e6b[_0x5542('0x98')]['role'],'userProfileId':_0x553e6b[_0x5542('0x98')][_0x5542('0x99')]};if(!_0xdd4169)throw new Error(_0x5542('0x9a'));if(_0xdd4169[_0x5542('0x9b')]==='user'){var _0x4551cf=_0x5959fa[_0x5542('0x2f')]({'plain':!![]});return db['UserProfileSection'][_0x5542('0x54')]({'where':{'name':_0x5542('0x30'),'userProfileId':_0xdd4169[_0x5542('0x99')]},'raw':!![]})[_0x5542('0x2e')](function(_0x3fe2e3){if(_0x3fe2e3&&_0x3fe2e3['autoAssociation']===0x0){return db[_0x5542('0x31')][_0x5542('0x9c')]({'name':_0x4551cf[_0x5542('0x35')],'resourceId':_0x4551cf['id'],'type':_0x3fe2e3[_0x5542('0x35')],'sectionId':_0x3fe2e3['id']},{})['then'](function(){return _0x5959fa;});}else{return _0x5959fa;}})[_0x5542('0x55')](function(_0x34832f){logger[_0x5542('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34832f);throw _0x34832f;});}return _0x5959fa;})[_0x5542('0x2e')](respondWithResult(_0x372e79,null))[_0x5542('0x55')](handleError(_0x372e79,null));}});}catch(_0x382280){_0x372e79[_0x5542('0x22')](0x1f4)[_0x5542('0x36')](_0x382280);}};function removeReferences(_0x4e799a,_0x4f4f2a){try{if(_0x4e799a){fs[_0x5542('0x6d')](_0x4e799a);logger[_0x5542('0x6e')](_0x5542('0x9d'));}if(_0x4f4f2a){rimraf(_0x4f4f2a,function(){});logger['info'](_0x5542('0x9e'));}}catch(_0x10865c){logger['error'](_0x10865c);}}exports[_0x5542('0x2c')]=function(_0x1754f5,_0x2f2602,_0x3df4ae){return db['Plugin'][_0x5542('0x54')]({'where':{'id':_0x1754f5[_0x5542('0x51')]['id']}})[_0x5542('0x2e')](handleEntityNotFound(_0x2f2602,null))[_0x5542('0x2e')](saveUpdates(_0x1754f5[_0x5542('0x98')],null))[_0x5542('0x2e')](respondWithResult(_0x2f2602,null))[_0x5542('0x55')](handleError(_0x2f2602,null));};exports[_0x5542('0x9f')]=function(_0x3e4eef,_0x5d2403,_0x518eb3){return db[_0x5542('0x39')]['find']({'where':{'id':_0x3e4eef[_0x5542('0x51')]['id']}})[_0x5542('0x2e')](function(_0x3f4be9){if(_0x3f4be9){return _0x3f4be9[_0x5542('0x2d')]();}})[_0x5542('0x2e')](function(_0x3e4b29){rimraf(path[_0x5542('0x57')](config['root'],_0x5542('0x59'),path['dirname'](_0x3e4b29['path'])),function(){});return _0x3e4b29;})[_0x5542('0x2e')](handleEntityNotFound(_0x5d2403,null))['then'](respondWithStatusCode(_0x5d2403,null))[_0x5542('0x55')](handleError(_0x5d2403,null));};exports[_0x5542('0xa0')]=function(_0x170240,_0x167b42,_0x2ea44b){return BPromise[_0x5542('0xa1')]()[_0x5542('0x2e')](function(){if(!_0x170240[_0x5542('0x3d')][_0x5542('0x7')]){throw new Error(_0x5542('0xa2'));}if(!_0x170240['query'][_0x5542('0xa3')]){throw new Error(_0x5542('0xa4'));}var _0x14feeb=_0x170240[_0x5542('0x3d')]['hostname']?_0x170240['query']['hostname']+':'+_0x170240[_0x5542('0x3d')]['port']:_0x5542('0xa5')+_0x170240['query']['port'];var _0x1c2b24=_0x170240[_0x5542('0x3d')][_0x5542('0x23')]?_0x170240[_0x5542('0x3d')]['json']:!![];var _0x52c22b=_0x170240['query'][_0x5542('0xa6')]?_0x170240[_0x5542('0x3d')][_0x5542('0xa6')]:null;var _0x564d78={'method':_0x170240[_0x5542('0xa7')],'uri':util[_0x5542('0x5a')](_0x5542('0xa8'),_0x14feeb,_0x170240['query'][_0x5542('0x7')]),'json':_0x1c2b24,'resolveWithFullResponse':!![],'encoding':_0x52c22b,'qs':_0x170240[_0x5542('0x3d')]};if(_0x170240['headers']){_0x564d78[_0x5542('0xa9')]=_0x170240[_0x5542('0xa9')];if(_0x564d78[_0x5542('0xa9')][_0x5542('0xaa')]){delete _0x564d78[_0x5542('0xa9')][_0x5542('0xaa')];}}if(_0x564d78[_0x5542('0xa9')]['content-type']){delete _0x564d78[_0x5542('0xa9')][_0x5542('0xab')];}return rp(_0x564d78);})[_0x5542('0x2e')](function(_0xab0c65){if(_0xab0c65){_0x167b42[_0x5542('0x27')](_0xab0c65[_0x5542('0xa9')]);logger['info'](_0xab0c65[_0x5542('0x98')]);if(_['endsWith'](_0x170240[_0x5542('0x3d')]['path'],_0x5542('0x56'))&&_0xab0c65[_0x5542('0xac')]==0x1f4){return _0x167b42[_0x5542('0x21')](_0xab0c65[_0x5542('0xac')]);}else{return _0x167b42[_0x5542('0x22')](_0xab0c65[_0x5542('0xac')])[_0x5542('0x36')](_0xab0c65[_0x5542('0x98')]);}}else{return _0x167b42['sendStatus'](0xc8);}})[_0x5542('0x55')](handleError(_0x167b42,null));};exports[_0x5542('0xad')]=function(_0x101de8,_0x231fde,_0x3e1269){return BPromise['resolve']()['then'](function(){if(!_0x101de8[_0x5542('0x3d')][_0x5542('0x7')]){throw new Error(_0x5542('0xa2'));}if(!_0x101de8[_0x5542('0x3d')][_0x5542('0xa3')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x371e29=_0x101de8['query'][_0x5542('0xae')]?_0x101de8[_0x5542('0x3d')]['hostname']+':'+_0x101de8['query'][_0x5542('0xa3')]:'http://localhost:'+_0x101de8[_0x5542('0x3d')][_0x5542('0xa3')];var _0x51a81d=_0x101de8[_0x5542('0x3d')][_0x5542('0x23')]?_0x101de8[_0x5542('0x3d')][_0x5542('0x23')]:!![];var _0x353986=_0x101de8[_0x5542('0x3d')][_0x5542('0xa6')]?_0x101de8[_0x5542('0x3d')]['encoding']:null;var _0x3ccf50={'method':_0x101de8[_0x5542('0xa7')],'uri':util['format']('%s%s',_0x371e29,_0x101de8[_0x5542('0x3d')][_0x5542('0x7')]),'json':_0x51a81d,'resolveWithFullResponse':!![],'encoding':_0x353986,'body':_0x101de8['body']};if(_0x101de8[_0x5542('0xa9')]){_0x3ccf50['headers']=_0x101de8[_0x5542('0xa9')];if(_0x3ccf50[_0x5542('0xa9')][_0x5542('0xaa')]){delete _0x3ccf50[_0x5542('0xa9')][_0x5542('0xaa')];}}if(_0x3ccf50[_0x5542('0xa9')][_0x5542('0xab')]){delete _0x3ccf50[_0x5542('0xa9')]['content-type'];}return rp(_0x3ccf50);})[_0x5542('0x2e')](function(_0x53858d){if(_0x53858d){_0x231fde[_0x5542('0x27')](_0x53858d[_0x5542('0xa9')]);logger[_0x5542('0x6e')](_0x53858d[_0x5542('0x98')]);return _0x231fde[_0x5542('0x22')](_0x53858d[_0x5542('0xac')])['send'](_0x53858d[_0x5542('0x98')]);}else{return _0x231fde[_0x5542('0x21')](0xc8);}})[_0x5542('0x55')](handleError(_0x231fde,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 47c7434..b464859 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 _0x0c75=['hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x349eb0,_0x542752){var _0x5588c8=function(_0x4d1da9){while(--_0x4d1da9){_0x349eb0['push'](_0x349eb0['shift']());}};_0x5588c8(++_0x542752);}(_0x0c75,0x6a));var _0x50c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0c75[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x50c7('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x50c7('0x1')](0x0);var events={'afterCreate':_0x50c7('0x2'),'afterUpdate':_0x50c7('0x3'),'afterDestroy':_0x50c7('0x4')};function emitEvent(_0x41ebd8){return function(_0x344563,_0x3c0314,_0x5d8fad){PluginEvents[_0x50c7('0x5')](_0x41ebd8+':'+_0x344563['id'],_0x344563);PluginEvents['emit'](_0x41ebd8,_0x344563);_0x5d8fad(null);};}for(var e in events){if(events[_0x50c7('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x50c7('0x7')]=PluginEvents; \ No newline at end of file +var _0xf31b=['save','update','remove','emit','hook','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x1bf8cc,_0x118778){var _0x322d20=function(_0x36953d){while(--_0x36953d){_0x1bf8cc['push'](_0x1bf8cc['shift']());}};_0x322d20(++_0x118778);}(_0xf31b,0x1a0));var _0xbf31=function(_0x37e31d,_0x1b58f6){_0x37e31d=_0x37e31d-0x0;var _0x28c7fa=_0xf31b[_0x37e31d];return _0x28c7fa;};'use strict';var EventEmitter=require(_0xbf31('0x0'));var Plugin=require(_0xbf31('0x1'))['db'][_0xbf31('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xbf31('0x3')](0x0);var events={'afterCreate':_0xbf31('0x4'),'afterUpdate':_0xbf31('0x5'),'afterDestroy':_0xbf31('0x6')};function emitEvent(_0x5caf83){return function(_0x2a32c2,_0x205975,_0x5c989f){PluginEvents['emit'](_0x5caf83+':'+_0x2a32c2['id'],_0x2a32c2);PluginEvents[_0xbf31('0x7')](_0x5caf83,_0x2a32c2);_0x5c989f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xbf31('0x8')](e,emitEvent(event));}}module[_0xbf31('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 3cea47f..bc950f1 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 _0x1257=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1257,0x15d));var _0x7125=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1257[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7125('0x0'));var util=require(_0x7125('0x1'));var logger=require(_0x7125('0x2'))('api');var moment=require(_0x7125('0x3'));var BPromise=require(_0x7125('0x4'));var rp=require(_0x7125('0x5'));var fs=require('fs');var path=require(_0x7125('0x6'));var rimraf=require(_0x7125('0x7'));var config=require(_0x7125('0x8'));var attributes=require(_0x7125('0x9'));module[_0x7125('0xa')]=function(_0x3f5c2e,_0x4d0b6f){return _0x3f5c2e[_0x7125('0xb')](_0x7125('0xc'),attributes,{'tableName':_0x7125('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76cd=['bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','define','lodash','util','../../config/logger','api','moment'];(function(_0x14d20b,_0x383121){var _0x3c181b=function(_0x8ec565){while(--_0x8ec565){_0x14d20b['push'](_0x14d20b['shift']());}};_0x3c181b(++_0x383121);}(_0x76cd,0x1b7));var _0xd76c=function(_0x4774b4,_0x503ec9){_0x4774b4=_0x4774b4-0x0;var _0x119785=_0x76cd[_0x4774b4];return _0x119785;};'use strict';var _=require(_0xd76c('0x0'));var util=require(_0xd76c('0x1'));var logger=require(_0xd76c('0x2'))(_0xd76c('0x3'));var moment=require(_0xd76c('0x4'));var BPromise=require(_0xd76c('0x5'));var rp=require(_0xd76c('0x6'));var fs=require('fs');var path=require(_0xd76c('0x7'));var rimraf=require(_0xd76c('0x8'));var config=require(_0xd76c('0x9'));var attributes=require(_0xd76c('0xa'));module['exports']=function(_0x14b81a,_0x5d50ff){return _0x14b81a[_0xd76c('0xb')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 1fc3c57..28e26f2 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 _0x721e=['catch','CreatePlugin','Plugin','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./plugin.socket','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x55e95b,_0x54eef4){var _0x575aaf=function(_0x366669){while(--_0x366669){_0x55e95b['push'](_0x55e95b['shift']());}};_0x575aaf(++_0x54eef4);}(_0x721e,0x188));var _0xe721=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x721e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe721('0x0'));var util=require(_0xe721('0x1'));var moment=require(_0xe721('0x2'));var BPromise=require(_0xe721('0x3'));var rs=require(_0xe721('0x4'));var fs=require('fs');var Redis=require(_0xe721('0x5'));var db=require(_0xe721('0x6'))['db'];var utils=require(_0xe721('0x7'));var logger=require(_0xe721('0x8'))(_0xe721('0x9'));var config=require(_0xe721('0xa'));var jayson=require(_0xe721('0xb'));var client=jayson['client'][_0xe721('0xc')]({'port':0x232a});config[_0xe721('0xd')]=_['defaults'](config[_0xe721('0xd')],{'host':_0xe721('0xe'),'port':0x18eb});var socket=require(_0xe721('0xf'))(new Redis(config['redis']));require(_0xe721('0x10'))['register'](socket);function respondWithRpcPromise(_0xcfe1c6,_0x58add5,_0x36350e){return new BPromise(function(_0x32479d,_0x162d59){return client[_0xe721('0x11')](_0xcfe1c6,_0x36350e)[_0xe721('0x12')](function(_0x129a1e){logger[_0xe721('0x13')](_0xe721('0x14'),_0x58add5,_0xe721('0x15'));logger[_0xe721('0x16')](_0xe721('0x17'),_0x58add5,_0xe721('0x15'),JSON['stringify'](_0x129a1e));if(_0x129a1e[_0xe721('0x18')]){if(_0x129a1e['error'][_0xe721('0x19')]===0x1f4){logger['error'](_0xe721('0x14'),_0x58add5,_0x129a1e[_0xe721('0x18')][_0xe721('0x1a')]);return _0x162d59(_0x129a1e[_0xe721('0x18')]['message']);}logger[_0xe721('0x18')](_0xe721('0x14'),_0x58add5,_0x129a1e[_0xe721('0x18')][_0xe721('0x1a')]);return _0x32479d(_0x129a1e['error'][_0xe721('0x1a')]);}else{logger[_0xe721('0x13')](_0xe721('0x14'),_0x58add5,_0xe721('0x15'));_0x32479d(_0x129a1e[_0xe721('0x1b')][_0xe721('0x1a')]);}})[_0xe721('0x1c')](function(_0x1c33c5){logger[_0xe721('0x18')](_0xe721('0x14'),_0x58add5,_0x1c33c5);_0x162d59(_0x1c33c5);});});}exports[_0xe721('0x1d')]=function(_0x44ffac){var _0x27d1fd=this;return new Promise(function(_0x477310,_0x37f160){return db[_0xe721('0x1e')][_0xe721('0x1f')](_0x44ffac['body'],{'raw':_0x44ffac[_0xe721('0x20')]?_0x44ffac[_0xe721('0x20')][_0xe721('0x21')]===undefined?!![]:![]:!![]})[_0xe721('0x12')](function(_0x15f50f){logger[_0xe721('0x13')]('CreatePlugin',_0x44ffac);logger[_0xe721('0x16')](_0xe721('0x1d'),_0x44ffac,JSON[_0xe721('0x22')](_0x15f50f));_0x477310(_0x15f50f);})['catch'](function(_0x4a3f81){logger[_0xe721('0x18')](_0xe721('0x1d'),_0x4a3f81[_0xe721('0x1a')],_0x44ffac);_0x37f160(_0x27d1fd[_0xe721('0x18')](0x1f4,_0x4a3f81['message']));});});}; \ No newline at end of file +var _0x9fce=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Plugin','create','body','options','CreatePlugin','catch','util','bluebird','randomstring','../../mysqldb'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x9fce,0xb6));var _0xe9fc=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0x9fce[_0x334651];return _0x29657c;};'use strict';var _=require('lodash');var util=require(_0xe9fc('0x0'));var moment=require('moment');var BPromise=require(_0xe9fc('0x1'));var rs=require(_0xe9fc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9fc('0x3'))['db'];var utils=require(_0xe9fc('0x4'));var logger=require('../../config/logger')(_0xe9fc('0x5'));var config=require(_0xe9fc('0x6'));var jayson=require(_0xe9fc('0x7'));var client=jayson[_0xe9fc('0x8')][_0xe9fc('0x9')]({'port':0x232a});config[_0xe9fc('0xa')]=_['defaults'](config[_0xe9fc('0xa')],{'host':_0xe9fc('0xb'),'port':0x18eb});var socket=require(_0xe9fc('0xc'))(new Redis(config['redis']));require('./plugin.socket')[_0xe9fc('0xd')](socket);function respondWithRpcPromise(_0x27794c,_0x590f34,_0x2c0a5d){return new BPromise(function(_0x5dca0b,_0x178afb){return client[_0xe9fc('0xe')](_0x27794c,_0x2c0a5d)[_0xe9fc('0xf')](function(_0x497e93){logger[_0xe9fc('0x10')](_0xe9fc('0x11'),_0x590f34,_0xe9fc('0x12'));logger['debug'](_0xe9fc('0x13'),_0x590f34,_0xe9fc('0x12'),JSON[_0xe9fc('0x14')](_0x497e93));if(_0x497e93['error']){if(_0x497e93[_0xe9fc('0x15')][_0xe9fc('0x16')]===0x1f4){logger['error'](_0xe9fc('0x11'),_0x590f34,_0x497e93[_0xe9fc('0x15')][_0xe9fc('0x17')]);return _0x178afb(_0x497e93[_0xe9fc('0x15')][_0xe9fc('0x17')]);}logger[_0xe9fc('0x15')](_0xe9fc('0x11'),_0x590f34,_0x497e93[_0xe9fc('0x15')][_0xe9fc('0x17')]);return _0x5dca0b(_0x497e93[_0xe9fc('0x15')][_0xe9fc('0x17')]);}else{logger[_0xe9fc('0x10')](_0xe9fc('0x11'),_0x590f34,_0xe9fc('0x12'));_0x5dca0b(_0x497e93[_0xe9fc('0x18')][_0xe9fc('0x17')]);}})['catch'](function(_0x397f5){logger['error'](_0xe9fc('0x11'),_0x590f34,_0x397f5);_0x178afb(_0x397f5);});});}exports['CreatePlugin']=function(_0x3f06fb){var _0x1deff9=this;return new Promise(function(_0x53214c,_0x3b5682){return db[_0xe9fc('0x19')][_0xe9fc('0x1a')](_0x3f06fb[_0xe9fc('0x1b')],{'raw':_0x3f06fb[_0xe9fc('0x1c')]?_0x3f06fb[_0xe9fc('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xe9fc('0xf')](function(_0x3441e5){logger[_0xe9fc('0x10')](_0xe9fc('0x1d'),_0x3f06fb);logger['debug']('CreatePlugin',_0x3f06fb,JSON['stringify'](_0x3441e5));_0x53214c(_0x3441e5);})[_0xe9fc('0x1e')](function(_0x34dca2){logger[_0xe9fc('0x15')](_0xe9fc('0x1d'),_0x34dca2[_0xe9fc('0x17')],_0x3f06fb);_0x3b5682(_0x1deff9[_0xe9fc('0x15')](0x1f4,_0x34dca2[_0xe9fc('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 903bb6a..4ebfb4f 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 _0x7f7c=['plugin:','./plugin.events','save','remove','update','removeListener','register'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7f7c,0xd3));var _0xc7f7=function(_0x586180,_0x67c06){_0x586180=_0x586180-0x0;var _0x4e47ae=_0x7f7c[_0x586180];return _0x4e47ae;};'use strict';var PluginEvents=require(_0xc7f7('0x0'));var events=[_0xc7f7('0x1'),_0xc7f7('0x2'),_0xc7f7('0x3')];function createListener(_0x4c0a3c,_0x2f6b33){return function(_0x329d16){_0x2f6b33['emit'](_0x4c0a3c,_0x329d16);};}function removeListener(_0xc72b37,_0x41ca9a){return function(){PluginEvents[_0xc7f7('0x4')](_0xc72b37,_0x41ca9a);};}exports[_0xc7f7('0x5')]=function(_0x308829){for(var _0x196472=0x0,_0x35f72c=events['length'];_0x196472<_0x35f72c;_0x196472++){var _0x8e85b4=events[_0x196472];var _0x3a1930=createListener(_0xc7f7('0x6')+_0x8e85b4,_0x308829);PluginEvents['on'](_0x8e85b4,_0x3a1930);}}; \ No newline at end of file +var _0x760e=['save','remove','update','length','./plugin.events'];(function(_0x3d65ea,_0x1bbc0c){var _0x238032=function(_0x254437){while(--_0x254437){_0x3d65ea['push'](_0x3d65ea['shift']());}};_0x238032(++_0x1bbc0c);}(_0x760e,0x1a3));var _0xe760=function(_0x4994e8,_0x28d57b){_0x4994e8=_0x4994e8-0x0;var _0x4b44b7=_0x760e[_0x4994e8];return _0x4b44b7;};'use strict';var PluginEvents=require(_0xe760('0x0'));var events=[_0xe760('0x1'),_0xe760('0x2'),_0xe760('0x3')];function createListener(_0x5c829a,_0x179c44){return function(_0x358047){_0x179c44['emit'](_0x5c829a,_0x358047);};}function removeListener(_0x3f51f4,_0x155caf){return function(){PluginEvents['removeListener'](_0x3f51f4,_0x155caf);};}exports['register']=function(_0x4b029e){for(var _0x5aaa04=0x0,_0x38003d=events[_0xe760('0x4')];_0x5aaa04<_0x38003d;_0x5aaa04++){var _0x35c65e=events[_0x5aaa04];var _0x398709=createListener('plugin:'+_0x35c65e,_0x4b029e);PluginEvents['on'](_0x35c65e,_0x398709);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 863215f..0f2db6c 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(_0x5dfec0,_0x138016){var _0x422da9=function(_0x4f35c3){while(--_0x4f35c3){_0x5dfec0['push'](_0x5dfec0['shift']());}};_0x422da9(++_0x138016);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x522a70,_0x109a8e){var _0x48a3d7=function(_0x9f17a1){while(--_0x9f17a1){_0x522a70['push'](_0x522a70['shift']());}};_0x48a3d7(++_0x109a8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 6204095..4643c44 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 _0xa8a8=['dirname','start','dump','update','restart','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','child_process','exec','bluebird','sendStatus','status','json','name','send','npm\x20install','info','error','list','then','reject','length','catch','show','describe','params','create','script','join','../../files/plugins','body','cwd','chdir'];(function(_0x1c7889,_0x24cd26){var _0x2f14e5=function(_0x9ae1b1){while(--_0x9ae1b1){_0x1c7889['push'](_0x1c7889['shift']());}};_0x2f14e5(++_0x24cd26);}(_0xa8a8,0xec));var _0x8a8a=function(_0x3f3853,_0x579974){_0x3f3853=_0x3f3853-0x0;var _0x20ecfa=_0xa8a8[_0x3f3853];return _0x20ecfa;};'use strict';var _=require(_0x8a8a('0x0'));var pm2=require(_0x8a8a('0x1'));var logger=require(_0x8a8a('0x2'))(_0x8a8a('0x3'));var path=require('path');var exec=require(_0x8a8a('0x4'))[_0x8a8a('0x5')];var BPromise=require(_0x8a8a('0x6'));function handleEntityNotFound(_0x3ed1de,_0x45515d){return function(_0x1cecd4){if(!_0x1cecd4){_0x3ed1de[_0x8a8a('0x7')](0x194);;}return _0x1cecd4;};}function respondWithResult(_0x12db82,_0x2e8193){_0x2e8193=_0x2e8193||0xc8;return function(_0x315fe9){if(_0x315fe9){return _0x12db82[_0x8a8a('0x8')](_0x2e8193)[_0x8a8a('0x9')](_0x315fe9);}return null;};}function handleError(_0x4225b9,_0xecaa6f){_0xecaa6f=_0xecaa6f||0x1f4;return function(_0x3287f5){logger['error'](_0x3287f5['stack']);if(_0x3287f5[_0x8a8a('0xa')]){delete _0x3287f5['name'];}_0x4225b9[_0x8a8a('0x8')](_0xecaa6f)[_0x8a8a('0xb')](_0x3287f5);};}function execChildProcess(){return new BPromise(function(_0x532621,_0x118380){exec(_0x8a8a('0xc'),function(_0xb13fca,_0x5e448d,_0x679da2){logger[_0x8a8a('0xd')](_0x5e448d);logger[_0x8a8a('0xd')](_0x679da2);if(_0xb13fca){logger[_0x8a8a('0xe')](_0xb13fca);return _0x118380(_0xb13fca);}return _0x532621(_0x5e448d);});});}exports['index']=function(_0x23febf,_0x4e5d74){return pm2[_0x8a8a('0xf')]()[_0x8a8a('0x10')](function(_0x787eec){if(_0x787eec){var _0x2f6e33=_[_0x8a8a('0x11')](_0x787eec,function(_0x78b0f0){return _0x78b0f0[_0x8a8a('0xa')]==='express'||_0x78b0f0[_0x8a8a('0xa')]==='motion2';});return{'rows':_0x2f6e33,'count':_0x2f6e33[_0x8a8a('0x12')]};}return null;})[_0x8a8a('0x10')](respondWithResult(_0x4e5d74,null))[_0x8a8a('0x13')](handleError(_0x4e5d74,null));};exports[_0x8a8a('0x14')]=function(_0x42e8b6,_0x5dd616){return pm2[_0x8a8a('0x15')](_0x42e8b6[_0x8a8a('0x16')]['id'])[_0x8a8a('0x10')](respondWithResult(_0x5dd616,null))[_0x8a8a('0x10')](handleEntityNotFound(_0x5dd616,null))[_0x8a8a('0x13')](handleError(_0x5dd616,null));};exports[_0x8a8a('0x17')]=function(_0x4d7a45,_0x5dc5ae){if(_0x4d7a45['body']['name']&&_0x4d7a45['body'][_0x8a8a('0x18')]){var _0x45095b=path[_0x8a8a('0x19')](__dirname,_0x8a8a('0x1a'),_0x4d7a45[_0x8a8a('0x1b')][_0x8a8a('0x18')]);var _0x242bac=process[_0x8a8a('0x1c')]();process[_0x8a8a('0x1d')](path[_0x8a8a('0x1e')](_0x45095b));return execChildProcess()[_0x8a8a('0x10')](function(_0x3aa2bb){process[_0x8a8a('0x1d')](_0x242bac);return pm2[_0x8a8a('0x1f')]({'name':_0x4d7a45[_0x8a8a('0x1b')]['name'],'script':_0x45095b});})[_0x8a8a('0x10')](function(_0x16c55b){pm2[_0x8a8a('0x20')]();return _0x16c55b[0x0];})[_0x8a8a('0x10')](respondWithResult(_0x5dc5ae,0xc9))[_0x8a8a('0x13')](handleError(_0x5dc5ae,null));}else{return _0x5dc5ae[_0x8a8a('0x8')](0x1f4)[_0x8a8a('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8a8a('0x21')]=function(_0x38c1e0,_0x2e217a){if(_0x38c1e0['body']['id']){delete _0x38c1e0['body']['id'];}var _0x2dafcd={'online':_0x8a8a('0x22'),'stopped':'stop'};if(_0x2dafcd['hasOwnProperty'](_0x38c1e0['body'][_0x8a8a('0x8')])){return pm2[_0x2dafcd[_0x38c1e0['body'][_0x8a8a('0x8')]]](_0x38c1e0[_0x8a8a('0x16')]['id'])['then'](respondWithResult(_0x2e217a,0xc8))[_0x8a8a('0x13')](handleError(_0x2e217a,null));}else{return _0x2e217a[_0x8a8a('0x8')](0x1f4)[_0x8a8a('0xb')]({'message':_0x8a8a('0x23')});}};exports[_0x8a8a('0x24')]=function(_0x3d6594,_0x3e73b1){if(_0x3d6594[_0x8a8a('0x1b')]['id']){delete _0x3d6594['body']['id'];}if(_0x3d6594['params']['id']){return pm2['delete'](_0x3d6594[_0x8a8a('0x16')]['id'])[_0x8a8a('0x10')](function(_0x5f301e){pm2[_0x8a8a('0x20')]();return _0x5f301e[0x0];})[_0x8a8a('0x10')](respondWithResult(_0x3e73b1,null))['catch'](handleError(_0x3e73b1,null));}else{return _0x3e73b1[_0x8a8a('0x8')](0x1f4)[_0x8a8a('0xb')]({'message':_0x8a8a('0x25')});}}; \ No newline at end of file +var _0x6324=['params','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','child_process','bluebird','sendStatus','json','error','stack','status','send','npm\x20install','info','index','list','reject','name','motion2','length','then','catch','describe','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','destroy'];(function(_0x4bd235,_0x174377){var _0x5317f4=function(_0x14beb4){while(--_0x14beb4){_0x4bd235['push'](_0x4bd235['shift']());}};_0x5317f4(++_0x174377);}(_0x6324,0x142));var _0x4632=function(_0x2df387,_0x1d3ea1){_0x2df387=_0x2df387-0x0;var _0x3b1708=_0x6324[_0x2df387];return _0x3b1708;};'use strict';var _=require(_0x4632('0x0'));var pm2=require(_0x4632('0x1'));var logger=require(_0x4632('0x2'))(_0x4632('0x3'));var path=require('path');var exec=require(_0x4632('0x4'))['exec'];var BPromise=require(_0x4632('0x5'));function handleEntityNotFound(_0x54c200,_0x13b218){return function(_0x592e39){if(!_0x592e39){_0x54c200[_0x4632('0x6')](0x194);;}return _0x592e39;};}function respondWithResult(_0x24aba6,_0x1f3077){_0x1f3077=_0x1f3077||0xc8;return function(_0x126e9a){if(_0x126e9a){return _0x24aba6['status'](_0x1f3077)[_0x4632('0x7')](_0x126e9a);}return null;};}function handleError(_0x44dd6d,_0x390a46){_0x390a46=_0x390a46||0x1f4;return function(_0x5a523b){logger[_0x4632('0x8')](_0x5a523b[_0x4632('0x9')]);if(_0x5a523b['name']){delete _0x5a523b['name'];}_0x44dd6d[_0x4632('0xa')](_0x390a46)[_0x4632('0xb')](_0x5a523b);};}function execChildProcess(){return new BPromise(function(_0x30a7cf,_0x3e26d9){exec(_0x4632('0xc'),function(_0xe28f38,_0x1b2729,_0x17f9d1){logger['info'](_0x1b2729);logger[_0x4632('0xd')](_0x17f9d1);if(_0xe28f38){logger['error'](_0xe28f38);return _0x3e26d9(_0xe28f38);}return _0x30a7cf(_0x1b2729);});});}exports[_0x4632('0xe')]=function(_0x299073,_0x3ef228){return pm2[_0x4632('0xf')]()['then'](function(_0x3ba361){if(_0x3ba361){var _0x255882=_[_0x4632('0x10')](_0x3ba361,function(_0x37d798){return _0x37d798[_0x4632('0x11')]==='express'||_0x37d798['name']===_0x4632('0x12');});return{'rows':_0x255882,'count':_0x255882[_0x4632('0x13')]};}return null;})[_0x4632('0x14')](respondWithResult(_0x3ef228,null))[_0x4632('0x15')](handleError(_0x3ef228,null));};exports['show']=function(_0x158831,_0x113872){return pm2[_0x4632('0x16')](_0x158831['params']['id'])[_0x4632('0x14')](respondWithResult(_0x113872,null))[_0x4632('0x14')](handleEntityNotFound(_0x113872,null))['catch'](handleError(_0x113872,null));};exports['create']=function(_0x1c0523,_0x3cf2bd){if(_0x1c0523[_0x4632('0x17')][_0x4632('0x11')]&&_0x1c0523[_0x4632('0x17')][_0x4632('0x18')]){var _0x9ab826=path[_0x4632('0x19')](__dirname,_0x4632('0x1a'),_0x1c0523[_0x4632('0x17')][_0x4632('0x18')]);var _0x2d656a=process[_0x4632('0x1b')]();process[_0x4632('0x1c')](path[_0x4632('0x1d')](_0x9ab826));return execChildProcess()[_0x4632('0x14')](function(_0x4264d5){process[_0x4632('0x1c')](_0x2d656a);return pm2[_0x4632('0x1e')]({'name':_0x1c0523[_0x4632('0x17')][_0x4632('0x11')],'script':_0x9ab826});})[_0x4632('0x14')](function(_0x3b0823){pm2[_0x4632('0x1f')]();return _0x3b0823[0x0];})[_0x4632('0x14')](respondWithResult(_0x3cf2bd,0xc9))[_0x4632('0x15')](handleError(_0x3cf2bd,null));}else{return _0x3cf2bd[_0x4632('0xa')](0x1f4)[_0x4632('0xb')]({'message':_0x4632('0x20')});}};exports[_0x4632('0x21')]=function(_0x22d0f5,_0x2a0b11){if(_0x22d0f5[_0x4632('0x17')]['id']){delete _0x22d0f5['body']['id'];}var _0x57798a={'online':_0x4632('0x22'),'stopped':_0x4632('0x23')};if(_0x57798a[_0x4632('0x24')](_0x22d0f5[_0x4632('0x17')][_0x4632('0xa')])){return pm2[_0x57798a[_0x22d0f5[_0x4632('0x17')][_0x4632('0xa')]]](_0x22d0f5['params']['id'])[_0x4632('0x14')](respondWithResult(_0x2a0b11,0xc8))[_0x4632('0x15')](handleError(_0x2a0b11,null));}else{return _0x2a0b11['status'](0x1f4)[_0x4632('0xb')]({'message':'Unknown\x20status'});}};exports[_0x4632('0x25')]=function(_0x4cb661,_0x4fda35){if(_0x4cb661[_0x4632('0x17')]['id']){delete _0x4cb661[_0x4632('0x17')]['id'];}if(_0x4cb661[_0x4632('0x26')]['id']){return pm2['delete'](_0x4cb661['params']['id'])[_0x4632('0x14')](function(_0x7671ab){pm2['dump']();return _0x7671ab[0x0];})['then'](respondWithResult(_0x4fda35,null))[_0x4632('0x15')](handleError(_0x4fda35,null));}else{return _0x4fda35[_0x4632('0xa')](0x1f4)['send']({'message':_0x4632('0x27')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index bbc5cf0..49141c1 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 _0x0d5e=['getQueues','exports','Router','get','/agents','isAuthenticated'];(function(_0x486ff4,_0x471e09){var _0x1d4cce=function(_0x14be88){while(--_0x14be88){_0x486ff4['push'](_0x486ff4['shift']());}};_0x1d4cce(++_0x471e09);}(_0x0d5e,0x1c4));var _0xe0d5=function(_0x8af759,_0x340c5f){_0x8af759=_0x8af759-0x0;var _0x4268d7=_0x0d5e[_0x8af759];return _0x4268d7;};'use strict';var express=require('express');var router=express[_0xe0d5('0x0')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0xe0d5('0x1')](_0xe0d5('0x2'),auth['isAuthenticated'](),controller['getAgents']);router[_0xe0d5('0x1')]('/queues',auth[_0xe0d5('0x3')](),controller[_0xe0d5('0x4')]);module[_0xe0d5('0x5')]=router; \ No newline at end of file +var _0xb85c=['getQueues','exports','express','Router','get','/agents','isAuthenticated','getAgents','/queues'];(function(_0x48ed98,_0x22c3f4){var _0x37057f=function(_0x5d60a4){while(--_0x5d60a4){_0x48ed98['push'](_0x48ed98['shift']());}};_0x37057f(++_0x22c3f4);}(_0xb85c,0x89));var _0xcb85=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xb85c[_0x468b0f];return _0x3e74d9;};'use strict';var express=require(_0xcb85('0x0'));var router=express[_0xcb85('0x1')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0xcb85('0x2')](_0xcb85('0x3'),auth[_0xcb85('0x4')](),controller[_0xcb85('0x5')]);router[_0xcb85('0x2')](_0xcb85('0x6'),auth['isAuthenticated'](),controller[_0xcb85('0x7')]);module[_0xcb85('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index c06b4e5..9a1cf78 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 _0x1261=['rawAttributes','fieldName','type','key','query','user','agent','nolimit','sort','UserProfile','getResources','findAndCountAll','rows','merge','omit','globalStatus','pauseTypeFilter','getQueues','chat','sms','openchannel','fax','whatsapp','channel','includes','toLowerCase','Invalid\x20channel','getOptions','role','userProfileId','QueueCampaigns','all','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','undefined','limit','count','offset','set','json','error','stack','name','status','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','talking','paused','outbound','pTalking','message','dialMethod','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','map','agents','loggedInDb','voice','busy','find','pick','filter','queue','length','some','internal','toString','getMembers','UserId','accountcode','online','voiceStatus','User','Queue','Pause','findAll','idle','unavailable','ringing','chatPause','faxPause','mailPause','smsPause','voicePause','whatsappPause','every','chatStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','unknown','getAgents','userpic','lastPauseAt','pauseType','address','openchannelPause','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','resolve'];(function(_0x4370c7,_0x5dbfb0){var _0xce78a9=function(_0x157b2c){while(--_0x157b2c){_0x4370c7['push'](_0x4370c7['shift']());}};_0xce78a9(++_0x5dbfb0);}(_0x1261,0x144));var _0x1126=function(_0x12e3e3,_0x501eaf){_0x12e3e3=_0x12e3e3-0x0;var _0x26602e=_0x1261[_0x12e3e3];return _0x26602e;};'use strict';var util=require('util');var _=require(_0x1126('0x0'));var jayson=require(_0x1126('0x1'));var qs=require(_0x1126('0x2'));var logger=require(_0x1126('0x3'))(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var amiClient=jayson[_0x1126('0x6')][_0x1126('0x7')]({'port':0x232a});var routingClient=jayson[_0x1126('0x6')][_0x1126('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x5a2189,_0x5c68c8){return function(_0x40ba58){if(_0x40ba58){var _0x907180=typeof _0x5c68c8['offset']===_0x1126('0x8')&&typeof _0x5c68c8[_0x1126('0x9')]===_0x1126('0x8');var _0x3abb0b=_0x40ba58[_0x1126('0xa')];var _0x59cfa1=_0x907180?0x0:_0x5c68c8[_0x1126('0xb')];var _0x18dbe6=_0x907180?_0x40ba58[_0x1126('0xa')]:_0x5c68c8['offset']+_0x5c68c8[_0x1126('0x9')];var _0x5d581b;if(_0x18dbe6>=_0x3abb0b){_0x18dbe6=_0x3abb0b;_0x5d581b=0xc8;}else{_0x5d581b=0xce;}_0x5a2189['status'](_0x5d581b);return _0x5a2189[_0x1126('0xc')]('Content-Range',_0x59cfa1+'-'+_0x18dbe6+'/'+_0x3abb0b)[_0x1126('0xd')](_0x40ba58);}return null;};}function handleError(_0x1b364a,_0xd26a32){_0xd26a32=_0xd26a32||0x1f4;return function(_0x273896){logger[_0x1126('0xe')](_0x273896[_0x1126('0xf')]);if(_0x273896[_0x1126('0x10')]){delete _0x273896[_0x1126('0x10')];}_0x1b364a[_0x1126('0x11')](_0xd26a32)['send'](_0x273896);};}function getRealtimeAgents(){return new Promise(function(_0x5de9a7,_0x1af673){return amiClient[_0x1126('0x12')](_0x1126('0x13'),{})['then'](function(_0x45149c){if(_0x45149c['error'])throw new Error(_0x1126('0x14'));var _0x42f379=_0x45149c[_0x1126('0x15')];return routingClient['request'](_0x1126('0x13'),{})[_0x1126('0x16')](function(_0x4a7b49){if(_0x4a7b49['error'])throw new Error(_0x1126('0x17'));var _0x2b2487=_0x4a7b49['result'];return _0x5de9a7(_['merge']({},_0x42f379,_0x2b2487));});})[_0x1126('0x18')](function(_0x58b109){_0x1af673(_0x58b109);});});}function getRealtimeQueues(_0x22ed37,_0x1d6d19){return new Promise(function(_0x2f70ac,_0x54400a){var _0x2a08ba=_0x1d6d19==='voice'?amiClient:routingClient;return _0x2a08ba['request'](_[_0x1126('0x19')](_0x1d6d19)+_0x1126('0x1a'),_0x22ed37)[_0x1126('0x16')](function(_0x36d254){if(_0x36d254['error'])throw new Error(util[_0x1126('0x1b')](_0x1126('0x1c'),_0x1d6d19));return _0x2f70ac(_0x36d254['result']);})[_0x1126('0x18')](function(_0x59cd8e){_0x54400a(_0x59cd8e);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x529dd9,_0x4b57ab){return amiClient[_0x1126('0x12')](_0x1126('0x1d'),{})[_0x1126('0x16')](function(_0x34bcf1){if(_0x34bcf1[_0x1126('0xe')])throw new Error(_0x1126('0x1e'));return _0x529dd9(_0x34bcf1[_0x1126('0x15')]);})[_0x1126('0x18')](function(_0x589725){_0x4b57ab(_0x589725);});});}function initializeQueues(_0x35eec3,_0x375e59,_0xa293f4,_0x5ddf63){var _0x541bc9=[_0x1126('0x1f'),_0x1126('0x20'),'waiting',_0x1126('0x21'),_0x1126('0x22')];if(_0xa293f4==='voice'&&_0x5ddf63===_0x1126('0x23')){_0x541bc9['push'](_0x1126('0x24'),'originated',_0x1126('0x25'),'dialActive',_0x1126('0x26'),'Trunk','startPredictive','startProgressive',_0x1126('0x27'),_0x1126('0x28'),_0x1126('0x29'),'erlangBusyFactor',_0x1126('0x2a'),_0x1126('0x2b'),'dialPredictiveIntervalMinThreshold',_0x1126('0x2c'),_0x1126('0x2d'),_0x1126('0x2e'),_0x1126('0x2f'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0x1126('0x30'));}return _0x35eec3[_0x1126('0x31')](function(_0x2d9bd2){var _0x2c67eb=_0x2d9bd2['get']({'plain':!![]});_0x2c67eb[_0x1126('0x32')]=[];_0x2c67eb[_0x1126('0x22')]=0x0;_0x2c67eb[_0x1126('0x33')]=0x0;_0x2c67eb[_0x1126('0x1f')]=0x0;_0x2c67eb[_0x1126('0x20')]=0x0;_0x2c67eb['waiting']=0x0;if(_0xa293f4===_0x1126('0x34')){_0x2c67eb[_0x1126('0x21')]=0x0;_0x2c67eb[_0x1126('0x35')]=0x0;if(_0x5ddf63===_0x1126('0x23')){_0x2c67eb['pTalking']=0x0;_0x2c67eb['originated']=0x0;}}var _0x22827a=_[_0x1126('0x36')](_0x375e59,['id',_0x2c67eb['id']]);if(_0x22827a)_['merge'](_0x2c67eb,_[_0x1126('0x37')](_0x22827a,_0x541bc9));return _0x2c67eb;});}function updateAgentVoiceStatus(_0xf3c21b,_0x11b0f6,_0x5c08b9){var _0x4b3859=_[_0x1126('0x38')](_0x5c08b9,[_0x1126('0x39'),_0x11b0f6[_0x1126('0x10')]]);if(_0x4b3859[_0x1126('0x3a')]===0x0)return _0xf3c21b['busy']=!![];if(_[_0x1126('0x3b')](_0x4b3859,['connectedlinenum',_0xf3c21b[_0x1126('0x3c')][_0x1126('0x3d')]()]))return _0xf3c21b[_0x1126('0x21')]=!![];if(!_0xf3c21b[_0x1126('0x21')])return _0xf3c21b[_0x1126('0x35')]=!![];}function getVoiceQueueAgents(_0x5746f6,_0x1da59f,_0x3ea9de,_0x2939a9){var _0x397e3b=_[_0x1126('0x36')](_0x1da59f,['id',_0x5746f6['id']]);if(!_0x397e3b)return _0x5746f6;return _0x397e3b[_0x1126('0x3e')]({'raw':!![]})[_0x1126('0x16')](function(_0x4faaa3){for(var _0x1c8d8a=0x0;_0x1c8d8a<_0x4faaa3[_0x1126('0x3a')];_0x1c8d8a++){var _0x227a6b=_[_0x1126('0x36')](_0x3ea9de,['id',_0x4faaa3[_0x1c8d8a][_0x1126('0x3f')]]);if(!_0x227a6b){_0x227a6b={'id':_0x4faaa3[_0x1c8d8a]['UserId'],'name':_0x4faaa3[_0x1c8d8a]['UserId'],'accountcode':'','online':![]};}var _0x1c4f06={'id':_0x227a6b['id'],'name':_0x227a6b[_0x1126('0x10')],'internal':_0x227a6b[_0x1126('0x40')],'online':Boolean(_0x227a6b[_0x1126('0x41')]),'paused':Boolean(_0x4faaa3[_0x1c8d8a][_0x1126('0x22')])};if(_0x227a6b[_0x1126('0x42')]==='talking')updateAgentVoiceStatus(_0x1c4f06,_0x5746f6,_0x2939a9);if(_0x1c4f06['online'])_0x5746f6['loggedInDb']++;if(_0x1c4f06[_0x1126('0x35')])_0x5746f6['busy']++;if(_0x1c4f06[_0x1126('0x22')]&&!_0x1c4f06[_0x1126('0x35')]&&!_0x1c4f06[_0x1126('0x21')])_0x5746f6[_0x1126('0x22')]++;_0x5746f6['agents']['push'](_0x1c4f06);}return _0x5746f6;});}function getQueueAgents(_0x353042,_0xa93167,_0x1d63b9){var _0x5f5d3a=_0x1126('0x43')+_['startCase'](_0x1d63b9)+_0x1126('0x44');var _0x51a5be=_0x1d63b9+_0x1126('0x45');return db[_0x5f5d3a][_0x1126('0x46')]({'where':{[_[_0x1126('0x19')](_0x1d63b9)+'QueueId']:_0x353042['id']},'raw':!![]})[_0x1126('0x16')](function(_0x2ffccc){for(var _0xf8ec5f=0x0;_0xf8ec5f<_0x2ffccc['length'];_0xf8ec5f++){var _0x58ff3a=_['find'](_0xa93167,['id',_0x2ffccc[_0xf8ec5f][_0x1126('0x3f')]]);if(!_0x58ff3a){_0x58ff3a={'id':_0x2ffccc[_0xf8ec5f]['UserId'],'name':_0x2ffccc[_0xf8ec5f][_0x1126('0x3f')],'online':![],['pauseField']:![]};}var _0x507568={'id':_0x58ff3a['id'],'name':_0x58ff3a[_0x1126('0x10')],'online':Boolean(_0x58ff3a[_0x1126('0x41')]),'paused':Boolean(_0x58ff3a[_0x51a5be])};if(_0x507568[_0x1126('0x41')])_0x353042[_0x1126('0x33')]++;_0x353042[_0x1126('0x32')]['push'](_0x507568);}return _0x353042;});}function isIdle(_0x198173){return _0x198173===_0x1126('0x47')||_0x198173==='unknown'||_0x198173===_0x1126('0x48')||_0x198173===_0x1126('0x49')||_['isNil'](_0x198173);}function isAgentPaused(_0x5f6d73,_0x1ffa2b){var _0x518e0a=[_0x5f6d73[_0x1126('0x4a')],_0x5f6d73[_0x1126('0x4b')],_0x5f6d73[_0x1126('0x4c')],_0x5f6d73['openchannelPause'],_0x5f6d73[_0x1126('0x4d')],_0x5f6d73[_0x1126('0x4e')],_0x5f6d73[_0x1126('0x4f')]];if(!_0x1ffa2b)return _[_0x1126('0x50')](_0x518e0a);var _0x224456=_[_0x1126('0x38')](_0x518e0a);return _0x224456[_0x1126('0x3a')]>0x0&&_0x224456[_0x1126('0x3a')]<_0x518e0a['length']?!![]:![];}function isAgentIdle(_0x1b8b83){if(_0x1b8b83['voiceStatus']!==_0x1126('0x47')&&_0x1b8b83[_0x1126('0x4e')]){_0x1b8b83['voiceStatus']='pause';return![];}return _[_0x1126('0x50')]([_0x1b8b83[_0x1126('0x51')],_0x1b8b83[_0x1126('0x52')],_0x1b8b83['mailStatus'],_0x1b8b83[_0x1126('0x53')],_0x1b8b83[_0x1126('0x54')],_0x1b8b83[_0x1126('0x42')],_0x1b8b83[_0x1126('0x55')]],isIdle);}function getAgentStatus(_0x533e25){var _0x30d1b3=_0x1126('0x56');if(isAgentPaused(_0x533e25))_0x30d1b3='pause';else if(isAgentPaused(_0x533e25,!![]))_0x30d1b3='*pause';else if(isAgentIdle(_0x533e25))_0x30d1b3='idle';else _0x30d1b3='busy';return _0x30d1b3;}exports[_0x1126('0x57')]=function(_0x3bf090,_0x4dc8cd){var _0x16552b={'count':0x0,'rows':[]},_0x1c7a2b={},_0x38093e,_0x38f521,_0x29bc7d=[_0x1126('0x58'),_0x1126('0x41'),'lastLoginAt',_0x1126('0x59'),_0x1126('0x5a'),_0x1126('0x59'),_0x1126('0x3c'),_0x1126('0x5b'),'chatPause',_0x1126('0x5c'),'mailPause',_0x1126('0x4d'),_0x1126('0x4f'),_0x1126('0x4b'),'voicePause',_0x1126('0x5d'),_0x1126('0x5e'),'mailCapacity',_0x1126('0x5f'),_0x1126('0x60'),_0x1126('0x61'),'chatCurrentCapacity',_0x1126('0x62'),_0x1126('0x63'),_0x1126('0x64'),_0x1126('0x65'),_0x1126('0x66'),_0x1126('0x51'),_0x1126('0x53'),_0x1126('0x67'),'smsStatus',_0x1126('0x55'),_0x1126('0x52'),_0x1126('0x42'),_0x1126('0x68'),_0x1126('0x69'),'mailStatusTime',_0x1126('0x6a'),_0x1126('0x6b'),'faxStatusTime',_0x1126('0x6c'),'queue',_0x1126('0x6d'),_0x1126('0x6e'),'phoneBarEnableScreenRecordingByAgent',_0x1126('0x6f'),_0x1126('0x70')],_0x4e4d49=[_0x1126('0x4a'),'openchannelPause',_0x1126('0x4c'),'smsPause','whatsappPause',_0x1126('0x4b'),_0x1126('0x4e'),_0x1126('0x41')];Promise[_0x1126('0x71')]()[_0x1126('0x16')](function(){var _0x1b4ebf=_[_0x1126('0x31')](db['User'][_0x1126('0x72')],function(_0x43ec00){return{'name':_0x43ec00[_0x1126('0x73')],'type':_0x43ec00[_0x1126('0x74')][_0x1126('0x75')]};});_0x3bf090[_0x1126('0x76')]['role']='agent';_0x3bf090[_0x1126('0x76')][_0x1126('0x41')]=!![];_0x1c7a2b=qs['getOptions'](_0x1b4ebf,_0x3bf090);_0x1c7a2b['raw']=!![];if(_0x3bf090['user']['role']===_0x1126('0x77')){var _0x37b1ab={'params':{'id':_0x3bf090[_0x1126('0x77')]['userProfileId']},'query':{'section':_0x1126('0x13'),'role':_0x1126('0x78'),'online':!![],'nolimit':_0x3bf090[_0x1126('0x76')][_0x1126('0x79')],'sort':_0x3bf090[_0x1126('0x76')][_0x1126('0x7a')],'filter':_0x3bf090[_0x1126('0x76')]['filter'],'raw':!![]}};return db[_0x1126('0x7b')][_0x1126('0x7c')](_0x37b1ab);}return db[_0x1126('0x43')][_0x1126('0x7d')](_0x1c7a2b);})[_0x1126('0x16')](function(_0x56c003){_0x16552b['count']=_0x56c003[_0x1126('0xa')];_0x38093e=_0x56c003[_0x1126('0x7e')];return getRealtimeAgents();})['then'](function(_0x3bf25d){_0x38f521=_0x3bf25d[_0x1126('0x7e')];return _0x38093e[_0x1126('0x31')](function(_0x6a41c0){var _0x2828d4=_[_0x1126('0x36')](_0x38f521,['id',_0x6a41c0['id']]);if(_0x2828d4)_[_0x1126('0x7f')](_0x6a41c0,_[_0x1126('0x37')](_[_0x1126('0x80')](_0x2828d4,_0x4e4d49),_0x29bc7d));_0x6a41c0[_0x1126('0x81')]=getAgentStatus(_0x6a41c0);return _0x6a41c0;});})[_0x1126('0x16')](function(_0x1228cf){if(_0x3bf090[_0x1126('0x76')]['globalStatusFilter']){var _0x111f49=_[_0x1126('0x38')](_0x1228cf,[_0x1126('0x81'),_0x3bf090['query']['globalStatusFilter']]);if(_0x3bf090[_0x1126('0x76')][_0x1126('0x82')]){_0x111f49=_[_0x1126('0x38')](_0x111f49,[_0x1126('0x5a'),_0x3bf090['query']['pauseTypeFilter']]);}}_0x16552b['rows']=_0x111f49||_0x1228cf;return _0x16552b;})[_0x1126('0x16')](respondWithFilteredResult(_0x4dc8cd,_0x1c7a2b))[_0x1126('0x18')](handleError(_0x4dc8cd,null));};exports[_0x1126('0x83')]=function(_0xdedb8f,_0x54a72e){var _0x1870ed=['mail',_0x1126('0x84'),_0x1126('0x85'),_0x1126('0x86'),_0x1126('0x87'),_0x1126('0x88'),_0x1126('0x34')];var _0x9a61b1={'count':0x0,'rows':[]},_0x5f5a36={},_0xfd2d9,_0x57ece2,_0x3c1dda,_0x906531,_0x4dd275;Promise[_0x1126('0x71')]()[_0x1126('0x16')](function(){if(_0xdedb8f['query'][_0x1126('0x89')]){if(!_[_0x1126('0x8a')](_0x1870ed,_0xdedb8f['query']['channel'][_0x1126('0x8b')]()))throw new Error(_0x1126('0x8c'));_0xfd2d9=_0xdedb8f[_0x1126('0x76')]['channel']['toLowerCase']();}var _0x4b0fab=_[_0x1126('0x19')](_0xfd2d9)+'Queue';var _0x4cfbed=_[_0x1126('0x31')](db[_0x4b0fab]['rawAttributes'],function(_0x1f320e){return{'name':_0x1f320e[_0x1126('0x73')],'type':_0x1f320e['type'][_0x1126('0x75')]};});_0x5f5a36=qs[_0x1126('0x8d')](_0x4cfbed,_0xdedb8f);if(_0xdedb8f[_0x1126('0x77')][_0x1126('0x8e')]===_0x1126('0x77')){var _0x5e9872={'params':{'id':_0xdedb8f[_0x1126('0x77')][_0x1126('0x8f')]},'query':{'section':_0xfd2d9==='voice'&&_0xdedb8f[_0x1126('0x76')][_0x1126('0x74')]===_0x1126('0x23')?_0x1126('0x90'):_[_0x1126('0x19')](_0xfd2d9)+_0x1126('0x1a'),'type':_0xdedb8f[_0x1126('0x76')][_0x1126('0x74')],'nolimit':!![],'sort':_0x1126('0x10'),'filter':_0xdedb8f[_0x1126('0x76')][_0x1126('0x38')]}};return db[_0x1126('0x7b')][_0x1126('0x7c')](_0x5e9872);}return db[_0x4b0fab][_0x1126('0x7d')](_0x5f5a36);})[_0x1126('0x16')](function(_0x171210){_0x9a61b1['count']=_0x171210[_0x1126('0xa')];_0x57ece2=_0x171210[_0x1126('0x7e')];return getRealtimeQueues(_0xdedb8f,_0xfd2d9);})[_0x1126('0x16')](function(_0x1483f4){_0x906531=_0x1483f4[_0x1126('0x7e')];return getRealtimeAgents();})['then'](function(_0xd11e1f){_0x3c1dda=_0xd11e1f['rows'];if(_0xfd2d9!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x1126('0x16')](function(_0x2b1884){_0x4dd275=_0x2b1884?_0x2b1884['rows']:[];return initializeQueues(_0x57ece2,_0x906531,_0xfd2d9,_0xdedb8f['query'][_0x1126('0x74')]);})[_0x1126('0x16')](function(_0x228552){var _0x1ee970=_0x228552[_0x1126('0x31')](function(_0x37c7ee){if(_0xfd2d9===_0x1126('0x34'))return getVoiceQueueAgents(_0x37c7ee,_0x57ece2,_0x3c1dda,_0x4dd275);else return getQueueAgents(_0x37c7ee,_0x3c1dda,_0xfd2d9);});return Promise[_0x1126('0x91')](_0x1ee970);})[_0x1126('0x16')](function(_0x5644ea){_0x9a61b1[_0x1126('0x7e')]=_0x5644ea;return _0x9a61b1;})[_0x1126('0x16')](respondWithFilteredResult(_0x54a72e,_0x5f5a36))[_0x1126('0x18')](handleError(_0x54a72e,null));}; \ No newline at end of file +var _0x9536=['talking','busy','pick','filter','queue','length','some','connectedlinenum','internal','toString','find','UserId','accountcode','online','voiceStatus','agents','push','Pause','findAll','loggedInDb','idle','unknown','unavailable','isNil','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','pause','chatStatus','faxStatus','whatsappStatus','*pause','userpic','lastPauseAt','pauseType','chatCapacity','smsCapacity','whatsappCapacity','faxCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','mailStatus','smsStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','resolve','rawAttributes','fieldName','type','key','agent','getOptions','raw','user','userProfileId','query','nolimit','sort','UserProfile','getResources','User','rows','globalStatusFilter','globalStatus','pauseTypeFilter','mail','sms','openchannel','fax','whatsapp','channel','includes','toLowerCase','Queue','role','QueueCampaigns','Queues','findAndCountAll','all','util','lodash','jayson/promise','../../components/parsers/qs','api','client','http','offset','undefined','limit','count','status','set','Content-Range','json','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','startCase','format','VoiceQueuesChannels','loggedIn','waiting','paused','voice','outbound','pTalking','originated','message','dialMethod','Trunk','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','available'];(function(_0x31b47a,_0x217713){var _0x2b3a23=function(_0x25a3ea){while(--_0x25a3ea){_0x31b47a['push'](_0x31b47a['shift']());}};_0x2b3a23(++_0x217713);}(_0x9536,0x179));var _0x6953=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0x9536[_0x4d82ea];return _0x257f4a;};'use strict';var util=require(_0x6953('0x0'));var _=require(_0x6953('0x1'));var jayson=require(_0x6953('0x2'));var qs=require(_0x6953('0x3'));var logger=require('../../config/logger')(_0x6953('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x6953('0x5')][_0x6953('0x6')]({'port':0x232a});var routingClient=jayson[_0x6953('0x5')][_0x6953('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x2f3cc3,_0x494ac2){return function(_0x2b273e){if(_0x2b273e){var _0x2bb026=typeof _0x494ac2[_0x6953('0x7')]===_0x6953('0x8')&&typeof _0x494ac2[_0x6953('0x9')]==='undefined';var _0x3e8786=_0x2b273e[_0x6953('0xa')];var _0x449acb=_0x2bb026?0x0:_0x494ac2['offset'];var _0x41f41b=_0x2bb026?_0x2b273e[_0x6953('0xa')]:_0x494ac2[_0x6953('0x7')]+_0x494ac2[_0x6953('0x9')];var _0x448c89;if(_0x41f41b>=_0x3e8786){_0x41f41b=_0x3e8786;_0x448c89=0xc8;}else{_0x448c89=0xce;}_0x2f3cc3[_0x6953('0xb')](_0x448c89);return _0x2f3cc3[_0x6953('0xc')](_0x6953('0xd'),_0x449acb+'-'+_0x41f41b+'/'+_0x3e8786)[_0x6953('0xe')](_0x2b273e);}return null;};}function handleError(_0x57652e,_0x358388){_0x358388=_0x358388||0x1f4;return function(_0x513dd0){logger[_0x6953('0xf')](_0x513dd0[_0x6953('0x10')]);if(_0x513dd0[_0x6953('0x11')]){delete _0x513dd0[_0x6953('0x11')];}_0x57652e[_0x6953('0xb')](_0x358388)[_0x6953('0x12')](_0x513dd0);};}function getRealtimeAgents(){return new Promise(function(_0x175fa9,_0x27a57c){return amiClient[_0x6953('0x13')](_0x6953('0x14'),{})[_0x6953('0x15')](function(_0x548473){if(_0x548473['error'])throw new Error(_0x6953('0x16'));var _0x44e8a2=_0x548473[_0x6953('0x17')];return routingClient[_0x6953('0x13')]('Agents',{})[_0x6953('0x15')](function(_0x2da771){if(_0x2da771['error'])throw new Error(_0x6953('0x18'));var _0x3207dd=_0x2da771[_0x6953('0x17')];return _0x175fa9(_[_0x6953('0x19')]({},_0x44e8a2,_0x3207dd));});})[_0x6953('0x1a')](function(_0x4a450c){_0x27a57c(_0x4a450c);});});}function getRealtimeQueues(_0x3a93e1,_0x1b7123){return new Promise(function(_0x31d5fd,_0x2ba433){var _0x41f021=_0x1b7123==='voice'?amiClient:routingClient;return _0x41f021[_0x6953('0x13')](_[_0x6953('0x1b')](_0x1b7123)+'Queues',_0x3a93e1)[_0x6953('0x15')](function(_0x40c9d1){if(_0x40c9d1[_0x6953('0xf')])throw new Error(util[_0x6953('0x1c')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x1b7123));return _0x31d5fd(_0x40c9d1[_0x6953('0x17')]);})[_0x6953('0x1a')](function(_0x2a7f6a){_0x2ba433(_0x2a7f6a);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x508ea7,_0x495ebd){return amiClient['request'](_0x6953('0x1d'),{})[_0x6953('0x15')](function(_0x550be4){if(_0x550be4[_0x6953('0xf')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x508ea7(_0x550be4[_0x6953('0x17')]);})[_0x6953('0x1a')](function(_0xcdbce8){_0x495ebd(_0xcdbce8);});});}function initializeQueues(_0x2cc01e,_0x191d80,_0x1497e3,_0x53d3dc){var _0x3dd890=[_0x6953('0x1e'),'available',_0x6953('0x1f'),'talking',_0x6953('0x20')];if(_0x1497e3===_0x6953('0x21')&&_0x53d3dc===_0x6953('0x22')){_0x3dd890['push'](_0x6953('0x23'),_0x6953('0x24'),_0x6953('0x25'),'dialActive',_0x6953('0x26'),_0x6953('0x27'),'startPredictive','startProgressive',_0x6953('0x28'),_0x6953('0x29'),_0x6953('0x2a'),_0x6953('0x2b'),_0x6953('0x2c'),'dialPredictiveIntervalMaxThreshold',_0x6953('0x2d'),'predictiveIntervalAvailable',_0x6953('0x2e'),_0x6953('0x2f'),'predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit',_0x6953('0x30'),_0x6953('0x31'));}return _0x2cc01e[_0x6953('0x32')](function(_0x4ffa69){var _0x28cb92=_0x4ffa69['get']({'plain':!![]});_0x28cb92['agents']=[];_0x28cb92['paused']=0x0;_0x28cb92['loggedInDb']=0x0;_0x28cb92[_0x6953('0x1e')]=0x0;_0x28cb92[_0x6953('0x33')]=0x0;_0x28cb92[_0x6953('0x1f')]=0x0;if(_0x1497e3===_0x6953('0x21')){_0x28cb92[_0x6953('0x34')]=0x0;_0x28cb92[_0x6953('0x35')]=0x0;if(_0x53d3dc==='outbound'){_0x28cb92[_0x6953('0x23')]=0x0;_0x28cb92['originated']=0x0;}}var _0x199c67=_['find'](_0x191d80,['id',_0x28cb92['id']]);if(_0x199c67)_[_0x6953('0x19')](_0x28cb92,_[_0x6953('0x36')](_0x199c67,_0x3dd890));return _0x28cb92;});}function updateAgentVoiceStatus(_0xd81149,_0x248fe7,_0x562792){var _0x13c677=_[_0x6953('0x37')](_0x562792,[_0x6953('0x38'),_0x248fe7[_0x6953('0x11')]]);if(_0x13c677[_0x6953('0x39')]===0x0)return _0xd81149[_0x6953('0x35')]=!![];if(_[_0x6953('0x3a')](_0x13c677,[_0x6953('0x3b'),_0xd81149[_0x6953('0x3c')][_0x6953('0x3d')]()]))return _0xd81149[_0x6953('0x34')]=!![];if(!_0xd81149['talking'])return _0xd81149[_0x6953('0x35')]=!![];}function getVoiceQueueAgents(_0x3c03ab,_0x1f6571,_0x5dff18,_0x47e7e7){var _0x44faff=_['find'](_0x1f6571,['id',_0x3c03ab['id']]);if(!_0x44faff)return _0x3c03ab;return _0x44faff['getMembers']({'raw':!![]})[_0x6953('0x15')](function(_0x7e7b68){for(var _0x4b5e1c=0x0;_0x4b5e1c<_0x7e7b68[_0x6953('0x39')];_0x4b5e1c++){var _0x263728=_[_0x6953('0x3e')](_0x5dff18,['id',_0x7e7b68[_0x4b5e1c][_0x6953('0x3f')]]);if(!_0x263728){_0x263728={'id':_0x7e7b68[_0x4b5e1c][_0x6953('0x3f')],'name':_0x7e7b68[_0x4b5e1c][_0x6953('0x3f')],'accountcode':'','online':![]};}var _0x51137b={'id':_0x263728['id'],'name':_0x263728[_0x6953('0x11')],'internal':_0x263728[_0x6953('0x40')],'online':Boolean(_0x263728[_0x6953('0x41')]),'paused':Boolean(_0x7e7b68[_0x4b5e1c][_0x6953('0x20')])};if(_0x263728[_0x6953('0x42')]===_0x6953('0x34'))updateAgentVoiceStatus(_0x51137b,_0x3c03ab,_0x47e7e7);if(_0x51137b['online'])_0x3c03ab['loggedInDb']++;if(_0x51137b[_0x6953('0x35')])_0x3c03ab['busy']++;if(_0x51137b['paused']&&!_0x51137b[_0x6953('0x35')]&&!_0x51137b[_0x6953('0x34')])_0x3c03ab[_0x6953('0x20')]++;_0x3c03ab[_0x6953('0x43')][_0x6953('0x44')](_0x51137b);}return _0x3c03ab;});}function getQueueAgents(_0x5ac8f7,_0x4d43fd,_0x1de4e4){var _0x452b69='User'+_[_0x6953('0x1b')](_0x1de4e4)+'Queue';var _0x166b13=_0x1de4e4+_0x6953('0x45');return db[_0x452b69][_0x6953('0x46')]({'where':{[_[_0x6953('0x1b')](_0x1de4e4)+'QueueId']:_0x5ac8f7['id']},'raw':!![]})[_0x6953('0x15')](function(_0x424621){for(var _0x4d3868=0x0;_0x4d3868<_0x424621[_0x6953('0x39')];_0x4d3868++){var _0x296d81=_[_0x6953('0x3e')](_0x4d43fd,['id',_0x424621[_0x4d3868][_0x6953('0x3f')]]);if(!_0x296d81){_0x296d81={'id':_0x424621[_0x4d3868][_0x6953('0x3f')],'name':_0x424621[_0x4d3868][_0x6953('0x3f')],'online':![],['pauseField']:![]};}var _0x13d1a6={'id':_0x296d81['id'],'name':_0x296d81[_0x6953('0x11')],'online':Boolean(_0x296d81[_0x6953('0x41')]),'paused':Boolean(_0x296d81[_0x166b13])};if(_0x13d1a6[_0x6953('0x41')])_0x5ac8f7[_0x6953('0x47')]++;_0x5ac8f7['agents'][_0x6953('0x44')](_0x13d1a6);}return _0x5ac8f7;});}function isIdle(_0x4c9d36){return _0x4c9d36===_0x6953('0x48')||_0x4c9d36===_0x6953('0x49')||_0x4c9d36===_0x6953('0x4a')||_0x4c9d36==='ringing'||_[_0x6953('0x4b')](_0x4c9d36);}function isAgentPaused(_0x2a4e54,_0x506561){var _0x525145=[_0x2a4e54[_0x6953('0x4c')],_0x2a4e54[_0x6953('0x4d')],_0x2a4e54[_0x6953('0x4e')],_0x2a4e54[_0x6953('0x4f')],_0x2a4e54[_0x6953('0x50')],_0x2a4e54[_0x6953('0x51')],_0x2a4e54[_0x6953('0x52')]];if(!_0x506561)return _[_0x6953('0x53')](_0x525145);var _0x2baf90=_[_0x6953('0x37')](_0x525145);return _0x2baf90[_0x6953('0x39')]>0x0&&_0x2baf90['length']<_0x525145['length']?!![]:![];}function isAgentIdle(_0x14a7bf){if(_0x14a7bf[_0x6953('0x42')]!==_0x6953('0x48')&&_0x14a7bf[_0x6953('0x51')]){_0x14a7bf[_0x6953('0x42')]=_0x6953('0x54');return![];}return _[_0x6953('0x53')]([_0x14a7bf[_0x6953('0x55')],_0x14a7bf[_0x6953('0x56')],_0x14a7bf['mailStatus'],_0x14a7bf['openchannelStatus'],_0x14a7bf['smsStatus'],_0x14a7bf['voiceStatus'],_0x14a7bf[_0x6953('0x57')]],isIdle);}function getAgentStatus(_0x20ceda){var _0x51372b='unknown';if(isAgentPaused(_0x20ceda))_0x51372b='pause';else if(isAgentPaused(_0x20ceda,!![]))_0x51372b=_0x6953('0x58');else if(isAgentIdle(_0x20ceda))_0x51372b=_0x6953('0x48');else _0x51372b=_0x6953('0x35');return _0x51372b;}exports['getAgents']=function(_0x5b696e,_0x400486){var _0x40033a={'count':0x0,'rows':[]},_0x53e631={},_0x58fcb3,_0x29937b,_0xafbd35=[_0x6953('0x59'),_0x6953('0x41'),'lastLoginAt',_0x6953('0x5a'),_0x6953('0x5b'),'lastPauseAt',_0x6953('0x3c'),'address',_0x6953('0x4c'),_0x6953('0x4f'),_0x6953('0x4e'),_0x6953('0x50'),'whatsappPause',_0x6953('0x4d'),_0x6953('0x51'),_0x6953('0x5c'),'openchannelCapacity','mailCapacity',_0x6953('0x5d'),_0x6953('0x5e'),_0x6953('0x5f'),'chatCurrentCapacity','openchannelCurrentCapacity',_0x6953('0x60'),_0x6953('0x61'),'whatsappCurrentCapacity',_0x6953('0x62'),_0x6953('0x55'),'openchannelStatus',_0x6953('0x63'),_0x6953('0x64'),_0x6953('0x57'),_0x6953('0x56'),_0x6953('0x42'),'chatStatusTime',_0x6953('0x65'),_0x6953('0x66'),_0x6953('0x67'),'whatsappStatusTime','faxStatusTime',_0x6953('0x68'),_0x6953('0x38'),_0x6953('0x69'),_0x6953('0x6a'),_0x6953('0x6b'),'phoneBarEnableAutomaticScreenRecording',_0x6953('0x6c')],_0x414096=[_0x6953('0x4c'),_0x6953('0x4f'),_0x6953('0x4e'),_0x6953('0x50'),_0x6953('0x52'),_0x6953('0x4d'),_0x6953('0x51'),_0x6953('0x41')];Promise[_0x6953('0x6d')]()[_0x6953('0x15')](function(){var _0x390ba0=_[_0x6953('0x32')](db['User'][_0x6953('0x6e')],function(_0x1d264a){return{'name':_0x1d264a[_0x6953('0x6f')],'type':_0x1d264a[_0x6953('0x70')][_0x6953('0x71')]};});_0x5b696e['query']['role']=_0x6953('0x72');_0x5b696e['query'][_0x6953('0x41')]=!![];_0x53e631=qs[_0x6953('0x73')](_0x390ba0,_0x5b696e);_0x53e631[_0x6953('0x74')]=!![];if(_0x5b696e[_0x6953('0x75')]['role']===_0x6953('0x75')){var _0x3091fc={'params':{'id':_0x5b696e[_0x6953('0x75')][_0x6953('0x76')]},'query':{'section':_0x6953('0x14'),'role':_0x6953('0x72'),'online':!![],'nolimit':_0x5b696e[_0x6953('0x77')][_0x6953('0x78')],'sort':_0x5b696e[_0x6953('0x77')][_0x6953('0x79')],'filter':_0x5b696e[_0x6953('0x77')][_0x6953('0x37')],'raw':!![]}};return db[_0x6953('0x7a')][_0x6953('0x7b')](_0x3091fc);}return db[_0x6953('0x7c')]['findAndCountAll'](_0x53e631);})[_0x6953('0x15')](function(_0x3624fc){_0x40033a[_0x6953('0xa')]=_0x3624fc[_0x6953('0xa')];_0x58fcb3=_0x3624fc[_0x6953('0x7d')];return getRealtimeAgents();})[_0x6953('0x15')](function(_0x3e19f1){_0x29937b=_0x3e19f1['rows'];return _0x58fcb3[_0x6953('0x32')](function(_0x403d81){var _0x4eba55=_[_0x6953('0x3e')](_0x29937b,['id',_0x403d81['id']]);if(_0x4eba55)_[_0x6953('0x19')](_0x403d81,_[_0x6953('0x36')](_['omit'](_0x4eba55,_0x414096),_0xafbd35));_0x403d81['globalStatus']=getAgentStatus(_0x403d81);return _0x403d81;});})[_0x6953('0x15')](function(_0x12987e){if(_0x5b696e[_0x6953('0x77')][_0x6953('0x7e')]){var _0x1ad883=_[_0x6953('0x37')](_0x12987e,[_0x6953('0x7f'),_0x5b696e[_0x6953('0x77')][_0x6953('0x7e')]]);if(_0x5b696e['query'][_0x6953('0x80')]){_0x1ad883=_[_0x6953('0x37')](_0x1ad883,[_0x6953('0x5b'),_0x5b696e[_0x6953('0x77')]['pauseTypeFilter']]);}}_0x40033a[_0x6953('0x7d')]=_0x1ad883||_0x12987e;return _0x40033a;})[_0x6953('0x15')](respondWithFilteredResult(_0x400486,_0x53e631))[_0x6953('0x1a')](handleError(_0x400486,null));};exports['getQueues']=function(_0x16898a,_0x12285e){var _0x208038=[_0x6953('0x81'),'chat',_0x6953('0x82'),_0x6953('0x83'),_0x6953('0x84'),_0x6953('0x85'),'voice'];var _0x4eaebb={'count':0x0,'rows':[]},_0x513495={},_0x2310b2,_0x5c9f02,_0x5a7607,_0x3ebd20,_0x147cd4;Promise[_0x6953('0x6d')]()[_0x6953('0x15')](function(){if(_0x16898a['query'][_0x6953('0x86')]){if(!_[_0x6953('0x87')](_0x208038,_0x16898a['query'][_0x6953('0x86')][_0x6953('0x88')]()))throw new Error('Invalid\x20channel');_0x2310b2=_0x16898a['query']['channel'][_0x6953('0x88')]();}var _0x1cdee0=_[_0x6953('0x1b')](_0x2310b2)+_0x6953('0x89');var _0x1efbb9=_[_0x6953('0x32')](db[_0x1cdee0][_0x6953('0x6e')],function(_0x24b888){return{'name':_0x24b888['fieldName'],'type':_0x24b888[_0x6953('0x70')][_0x6953('0x71')]};});_0x513495=qs[_0x6953('0x73')](_0x1efbb9,_0x16898a);if(_0x16898a[_0x6953('0x75')][_0x6953('0x8a')]===_0x6953('0x75')){var _0x481102={'params':{'id':_0x16898a[_0x6953('0x75')]['userProfileId']},'query':{'section':_0x2310b2===_0x6953('0x21')&&_0x16898a['query'][_0x6953('0x70')]===_0x6953('0x22')?_0x6953('0x8b'):_['startCase'](_0x2310b2)+_0x6953('0x8c'),'type':_0x16898a[_0x6953('0x77')][_0x6953('0x70')],'nolimit':!![],'sort':_0x6953('0x11'),'filter':_0x16898a[_0x6953('0x77')][_0x6953('0x37')]}};return db['UserProfile'][_0x6953('0x7b')](_0x481102);}return db[_0x1cdee0][_0x6953('0x8d')](_0x513495);})[_0x6953('0x15')](function(_0x4464d1){_0x4eaebb[_0x6953('0xa')]=_0x4464d1[_0x6953('0xa')];_0x5c9f02=_0x4464d1[_0x6953('0x7d')];return getRealtimeQueues(_0x16898a,_0x2310b2);})[_0x6953('0x15')](function(_0xefb593){_0x3ebd20=_0xefb593[_0x6953('0x7d')];return getRealtimeAgents();})[_0x6953('0x15')](function(_0x47c935){_0x5a7607=_0x47c935[_0x6953('0x7d')];if(_0x2310b2!=_0x6953('0x21'))return;return getRealtimeVoiceQueueChannels();})[_0x6953('0x15')](function(_0x396a9f){_0x147cd4=_0x396a9f?_0x396a9f[_0x6953('0x7d')]:[];return initializeQueues(_0x5c9f02,_0x3ebd20,_0x2310b2,_0x16898a[_0x6953('0x77')][_0x6953('0x70')]);})[_0x6953('0x15')](function(_0x384021){var _0x39dd70=_0x384021[_0x6953('0x32')](function(_0x590d1f){if(_0x2310b2===_0x6953('0x21'))return getVoiceQueueAgents(_0x590d1f,_0x5c9f02,_0x5a7607,_0x147cd4);else return getQueueAgents(_0x590d1f,_0x5a7607,_0x2310b2);});return Promise[_0x6953('0x8e')](_0x39dd70);})[_0x6953('0x15')](function(_0x5a74ab){_0x4eaebb[_0x6953('0x7d')]=_0x5a74ab;return _0x4eaebb;})['then'](respondWithFilteredResult(_0x12285e,_0x513495))['catch'](handleError(_0x12285e,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 30577f1..bbd0bb4 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4f9a82,_0x85d3bd){var _0xfb242d=function(_0x12bff6){while(--_0x12bff6){_0x4f9a82['push'](_0x4f9a82['shift']());}};_0xfb242d(++_0x85d3bd);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0xcb91[_0x513545];return _0x18b7c5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4fa9c7,_0x237626){var _0x418986=function(_0x1ac196){while(--_0x1ac196){_0x4fa9c7['push'](_0x4fa9c7['shift']());}};_0x418986(++_0x237626);}(_0xe706,0xa3));var _0x6e70=function(_0x519b55,_0x1597a7){_0x519b55=_0x519b55-0x0;var _0x5baf3d=_0xe706[_0x519b55];return _0x5baf3d;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 2b1a4fe..ba7a845 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 _0xdb2a=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0xf110e1,_0x3fabe1){var _0x2e9ac0=function(_0x531b88){while(--_0x531b88){_0xf110e1['push'](_0xf110e1['shift']());}};_0x2e9ac0(++_0x3fabe1);}(_0xdb2a,0x16f));var _0xadb2=function(_0x5aa54f,_0xe70877){_0x5aa54f=_0x5aa54f-0x0;var _0x4d1edc=_0xdb2a[_0x5aa54f];return _0x4d1edc;};'use strict';var Sequelize=require(_0xadb2('0x0'));module[_0xadb2('0x1')]={'state':{'type':Sequelize[_0xadb2('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xadb2('0x3')]},'starttime':{'type':Sequelize[_0xadb2('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xadb2('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xadb2('0x3')]},'membername':{'type':Sequelize[_0xadb2('0x3')]}}; \ No newline at end of file +var _0xa1f6=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x5a8e83,_0x3447fd){var _0x2834f9=function(_0x11026c){while(--_0x11026c){_0x5a8e83['push'](_0x5a8e83['shift']());}};_0x2834f9(++_0x3447fd);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x542da8,_0x509c26){_0x542da8=_0x542da8-0x0;var _0x533d7e=_0xa1f6[_0x542da8];return _0x533d7e;};'use strict';var Sequelize=require(_0x6a1f('0x0'));module[_0x6a1f('0x1')]={'state':{'type':Sequelize[_0x6a1f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6a1f('0x3')]},'scheduledat':{'type':Sequelize[_0x6a1f('0x4')]},'uniqueid':{'type':Sequelize[_0x6a1f('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6a1f('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 9b48b85..169aa11 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 _0xe8a4=['ReportAgentPreview','report_agent_preview','lodash','util','api','moment','bluebird','./reportAgentPreview.attributes','exports','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe8a4,0x19c));var _0x4e8a=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xe8a4[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x4e8a('0x0'));var util=require(_0x4e8a('0x1'));var logger=require('../../config/logger')(_0x4e8a('0x2'));var moment=require(_0x4e8a('0x3'));var BPromise=require(_0x4e8a('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(_0x4e8a('0x5'));module[_0x4e8a('0x6')]=function(_0xe8fbe7,_0xc1ccbb){return _0xe8fbe7[_0x4e8a('0x7')](_0x4e8a('0x8'),attributes,{'tableName':_0x4e8a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4af=['define','ReportAgentPreview','report_agent_preview','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports'];(function(_0xe7f5c5,_0x2505dd){var _0xb2b2cd=function(_0x3e2876){while(--_0x3e2876){_0xe7f5c5['push'](_0xe7f5c5['shift']());}};_0xb2b2cd(++_0x2505dd);}(_0xf4af,0x1ef));var _0xff4a=function(_0x10b7a5,_0xd3f792){_0x10b7a5=_0x10b7a5-0x0;var _0x1764b9=_0xf4af[_0x10b7a5];return _0x1764b9;};'use strict';var _=require('lodash');var util=require(_0xff4a('0x0'));var logger=require(_0xff4a('0x1'))('api');var moment=require('moment');var BPromise=require(_0xff4a('0x2'));var rp=require(_0xff4a('0x3'));var fs=require('fs');var path=require(_0xff4a('0x4'));var rimraf=require(_0xff4a('0x5'));var config=require(_0xff4a('0x6'));var attributes=require(_0xff4a('0x7'));module[_0xff4a('0x8')]=function(_0x84032c,_0xc0da0d){return _0x84032c[_0xff4a('0x9')](_0xff4a('0xa'),attributes,{'tableName':_0xff4a('0xb'),'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 ee97975..180dccd 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 _0xc42f=['rpc','../../config/environment','jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0xdfa841,_0x1eaa4d){var _0x3c5f90=function(_0x5badd0){while(--_0x5badd0){_0xdfa841['push'](_0xdfa841['shift']());}};_0x3c5f90(++_0x1eaa4d);}(_0xc42f,0x182));var _0xfc42=function(_0x354556,_0x1264de){_0x354556=_0x354556-0x0;var _0x351ed2=_0xc42f[_0x354556];return _0x351ed2;};'use strict';var _=require(_0xfc42('0x0'));var util=require('util');var moment=require(_0xfc42('0x1'));var BPromise=require(_0xfc42('0x2'));var rs=require(_0xfc42('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc42('0x4'))['db'];var utils=require(_0xfc42('0x5'));var logger=require('../../config/logger')(_0xfc42('0x6'));var config=require(_0xfc42('0x7'));var jayson=require(_0xfc42('0x8'));var client=jayson[_0xfc42('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ff2fe,_0x1be816,_0x381402){return new BPromise(function(_0x623588,_0x443af4){return client[_0xfc42('0xa')](_0x3ff2fe,_0x381402)[_0xfc42('0xb')](function(_0x209d09){logger[_0xfc42('0xc')](_0xfc42('0xd'),_0x1be816,_0xfc42('0xe'));logger[_0xfc42('0xf')](_0xfc42('0x10'),_0x1be816,_0xfc42('0xe'),JSON[_0xfc42('0x11')](_0x209d09));if(_0x209d09[_0xfc42('0x12')]){if(_0x209d09['error'][_0xfc42('0x13')]===0x1f4){logger[_0xfc42('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x1be816,_0x209d09['error'][_0xfc42('0x14')]);return _0x443af4(_0x209d09[_0xfc42('0x12')][_0xfc42('0x14')]);}logger[_0xfc42('0x12')](_0xfc42('0xd'),_0x1be816,_0x209d09['error'][_0xfc42('0x14')]);return _0x623588(_0x209d09[_0xfc42('0x12')]['message']);}else{logger['info'](_0xfc42('0xd'),_0x1be816,_0xfc42('0xe'));_0x623588(_0x209d09['result'][_0xfc42('0x14')]);}})[_0xfc42('0x15')](function(_0x2698e9){logger[_0xfc42('0x12')](_0xfc42('0xd'),_0x1be816,_0x2698e9);_0x443af4(_0x2698e9);});});}exports[_0xfc42('0x16')]=function(_0x561f90){var _0xf568b8=this;return new Promise(function(_0x171b4f,_0x13fa9d){return db[_0xfc42('0x17')][_0xfc42('0x18')](_0x561f90[_0xfc42('0x19')],{'raw':_0x561f90['options']?_0x561f90[_0xfc42('0x1a')][_0xfc42('0x1b')]===undefined?!![]:![]:!![]})[_0xfc42('0xb')](function(_0x63a602){logger[_0xfc42('0xc')]('CreateReportAgentPreview',_0x561f90);logger[_0xfc42('0xf')](_0xfc42('0x16'),_0x561f90,JSON['stringify'](_0x63a602));_0x171b4f(_0x63a602);})[_0xfc42('0x15')](function(_0x3edd85){logger[_0xfc42('0x12')]('CreateReportAgentPreview',_0x3edd85[_0xfc42('0x14')],_0x561f90);_0x13fa9d(_0xf568b8['error'](0x1f4,_0x3edd85[_0xfc42('0x14')]));});});}; \ No newline at end of file +var _0xf626=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateReportAgentPreview','ReportAgentPreview','options','raw','debug','catch','lodash','util'];(function(_0x50faaa,_0x59d114){var _0x48300e=function(_0x4cdf0f){while(--_0x4cdf0f){_0x50faaa['push'](_0x50faaa['shift']());}};_0x48300e(++_0x59d114);}(_0xf626,0xac));var _0x6f62=function(_0x15330a,_0x38657a){_0x15330a=_0x15330a-0x0;var _0x3e97a4=_0xf626[_0x15330a];return _0x3e97a4;};'use strict';var _=require(_0x6f62('0x0'));var util=require(_0x6f62('0x1'));var moment=require(_0x6f62('0x2'));var BPromise=require(_0x6f62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f62('0x4'));var db=require(_0x6f62('0x5'))['db'];var utils=require(_0x6f62('0x6'));var logger=require(_0x6f62('0x7'))(_0x6f62('0x8'));var config=require(_0x6f62('0x9'));var jayson=require(_0x6f62('0xa'));var client=jayson[_0x6f62('0xb')][_0x6f62('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x291a0e,_0x5340c8,_0x3029fd){return new BPromise(function(_0x3dcd6d,_0x504651){return client['request'](_0x291a0e,_0x3029fd)[_0x6f62('0xd')](function(_0x254151){logger['info'](_0x6f62('0xe'),_0x5340c8,_0x6f62('0xf'));logger['debug'](_0x6f62('0x10'),_0x5340c8,_0x6f62('0xf'),JSON[_0x6f62('0x11')](_0x254151));if(_0x254151[_0x6f62('0x12')]){if(_0x254151['error'][_0x6f62('0x13')]===0x1f4){logger[_0x6f62('0x12')](_0x6f62('0xe'),_0x5340c8,_0x254151[_0x6f62('0x12')][_0x6f62('0x14')]);return _0x504651(_0x254151[_0x6f62('0x12')][_0x6f62('0x14')]);}logger['error'](_0x6f62('0xe'),_0x5340c8,_0x254151[_0x6f62('0x12')][_0x6f62('0x14')]);return _0x3dcd6d(_0x254151[_0x6f62('0x12')][_0x6f62('0x14')]);}else{logger[_0x6f62('0x15')](_0x6f62('0xe'),_0x5340c8,_0x6f62('0xf'));_0x3dcd6d(_0x254151[_0x6f62('0x16')][_0x6f62('0x14')]);}})['catch'](function(_0x3e357f){logger[_0x6f62('0x12')](_0x6f62('0xe'),_0x5340c8,_0x3e357f);_0x504651(_0x3e357f);});});}exports[_0x6f62('0x17')]=function(_0x533693){var _0x2b20ac=this;return new Promise(function(_0x1c6301,_0x1fd678){return db[_0x6f62('0x18')]['create'](_0x533693['body'],{'raw':_0x533693[_0x6f62('0x19')]?_0x533693['options'][_0x6f62('0x1a')]===undefined?!![]:![]:!![]})[_0x6f62('0xd')](function(_0x3952cf){logger[_0x6f62('0x15')](_0x6f62('0x17'),_0x533693);logger[_0x6f62('0x1b')](_0x6f62('0x17'),_0x533693,JSON[_0x6f62('0x11')](_0x3952cf));_0x1c6301(_0x3952cf);})[_0x6f62('0x1c')](function(_0x35af11){logger['error'](_0x6f62('0x17'),_0x35af11[_0x6f62('0x14')],_0x533693);_0x1fd678(_0x2b20ac[_0x6f62('0x12')](0x1f4,_0x35af11[_0x6f62('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 64c09b8..7d1f19b 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 _0xeda3=['../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','outbound','/outbound/channels','outboundChannels','/agents','agents','agentCapacity','/telephones','/trunks','trunks','/campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','express'];(function(_0xfc2d29,_0x37c077){var _0x129511=function(_0x1fd9c6){while(--_0x1fd9c6){_0xfc2d29['push'](_0xfc2d29['shift']());}};_0x129511(++_0x37c077);}(_0xeda3,0x17f));var _0x3eda=function(_0xa421ef,_0x3ad9e1){_0xa421ef=_0xa421ef-0x0;var _0xe7055a=_0xeda3[_0xa421ef];return _0xe7055a;};'use strict';var multer=require(_0x3eda('0x0'));var util=require('util');var path=require('path');var express=require(_0x3eda('0x1'));var router=express['Router']();var auth=require(_0x3eda('0x2'));var controller=require(_0x3eda('0x3'));router[_0x3eda('0x4')](_0x3eda('0x5'),auth['isAuthenticated'](),controller[_0x3eda('0x6')]);router[_0x3eda('0x4')](_0x3eda('0x7'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x9')]);router['get'](_0x3eda('0xa'),auth[_0x3eda('0x8')](),controller[_0x3eda('0xb')]);router['get'](_0x3eda('0xc'),auth['isAuthenticated'](),controller[_0x3eda('0xd')]);router[_0x3eda('0x4')](_0x3eda('0xe'),auth[_0x3eda('0x8')](),controller[_0x3eda('0xf')]);router[_0x3eda('0x4')]('/mail/queues',auth[_0x3eda('0x8')](),controller[_0x3eda('0x10')]);router[_0x3eda('0x4')](_0x3eda('0x11'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x12')]);router[_0x3eda('0x4')](_0x3eda('0x13'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x14')]);router[_0x3eda('0x4')](_0x3eda('0x15'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x16')]);router[_0x3eda('0x4')](_0x3eda('0x17'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x18')]);router[_0x3eda('0x4')](_0x3eda('0x19'),auth['isAuthenticated'](),controller[_0x3eda('0x1a')]);router[_0x3eda('0x4')](_0x3eda('0x1b'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x1c')]);router[_0x3eda('0x4')]('/voice/queues/channels',auth['isAuthenticated'](),controller['voiceQueuesChannels']);router['get'](_0x3eda('0x1d'),auth['isAuthenticated'](),controller[_0x3eda('0x1e')]);router[_0x3eda('0x4')](_0x3eda('0x1f'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x20')]);router[_0x3eda('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x3eda('0x8')](),controller[_0x3eda('0x21')]);router[_0x3eda('0x4')](_0x3eda('0x22'),auth['isAuthenticated'](),controller[_0x3eda('0x23')]);router[_0x3eda('0x24')](_0x3eda('0x22'),auth[_0x3eda('0x8')](),controller['updateVoiceQueue']);router[_0x3eda('0x4')]('/outbound',auth[_0x3eda('0x8')](),controller[_0x3eda('0x25')]);router[_0x3eda('0x4')](_0x3eda('0x26'),auth['isAuthenticated'](),controller[_0x3eda('0x27')]);router[_0x3eda('0x4')](_0x3eda('0x28'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x29')]);router[_0x3eda('0x24')]('/agents/:id/capacity',auth[_0x3eda('0x8')](),controller[_0x3eda('0x2a')]);router[_0x3eda('0x4')](_0x3eda('0x2b'),auth[_0x3eda('0x8')](),controller['telephones']);router[_0x3eda('0x4')](_0x3eda('0x2c'),auth['isAuthenticated'](),controller[_0x3eda('0x2d')]);router[_0x3eda('0x4')](_0x3eda('0x2e'),auth[_0x3eda('0x8')](),controller['campaigns']);router['get']('/fax/accounts',auth[_0x3eda('0x8')](),controller[_0x3eda('0x2f')]);router['get'](_0x3eda('0x30'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x31')]);router['get'](_0x3eda('0x32'),auth[_0x3eda('0x8')](),controller['mailQueuesWaitingInteractions']);router[_0x3eda('0x4')]('/openchannel/queues/waitinginteractions',auth[_0x3eda('0x8')](),controller['openchannelQueuesWaitingInteractions']);router['get'](_0x3eda('0x33'),auth[_0x3eda('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x3eda('0x4')]('/sms/queues/waitinginteractions',auth[_0x3eda('0x8')](),controller['smsQueuesWaitingInteractions']);router['get']('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x3eda('0x34')]);router[_0x3eda('0x4')](_0x3eda('0x35'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x36')]);router[_0x3eda('0x37')]('/mail/queues/:id/notify',auth[_0x3eda('0x8')](),controller[_0x3eda('0x38')](_0x3eda('0x39')));router[_0x3eda('0x4')]('/mail/queues/:id',auth[_0x3eda('0x8')](),controller['showMailQueues']);router['post'](_0x3eda('0x3a'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x38')](_0x3eda('0x3b')));router[_0x3eda('0x4')](_0x3eda('0x3c'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x3d')]);router['post'](_0x3eda('0x3e'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x38')]('fax'));router[_0x3eda('0x4')](_0x3eda('0x3f'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x40')]);router[_0x3eda('0x37')]('/openchannel/queues/:id/notify',auth[_0x3eda('0x8')](),controller[_0x3eda('0x38')](_0x3eda('0x41')));router['get'](_0x3eda('0x42'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x43')]);router['post'](_0x3eda('0x44'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x38')]('sms'));router[_0x3eda('0x37')](_0x3eda('0x45'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x38')](_0x3eda('0x46')));router[_0x3eda('0x4')](_0x3eda('0x47'),auth[_0x3eda('0x8')](),controller[_0x3eda('0x48')]);router[_0x3eda('0x4')](_0x3eda('0x49'),auth['isAuthenticated'](),controller[_0x3eda('0x4a')]);router[_0x3eda('0x37')](_0x3eda('0x4b'),auth['isAuthenticated'](),controller['agentNotify']);module[_0x3eda('0x4c')]=router; \ No newline at end of file +var _0x233e=['/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','agentCapacity','telephones','/trunks','trunks','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','chat','/chat/queues/:id','showChatQueues','queueNotify','fax','/fax/queues/:id','showFaxQueues','openchannel','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','util','path','Router','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues'];(function(_0x493dda,_0x1528d3){var _0x31a5a6=function(_0x43c676){while(--_0x43c676){_0x493dda['push'](_0x493dda['shift']());}};_0x31a5a6(++_0x1528d3);}(_0x233e,0x1dd));var _0xe233=function(_0xe46d49,_0xcde98e){_0xe46d49=_0xe46d49-0x0;var _0x495889=_0x233e[_0xe46d49];return _0x495889;};'use strict';var multer=require('multer');var util=require(_0xe233('0x0'));var path=require(_0xe233('0x1'));var express=require('express');var router=express[_0xe233('0x2')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0xe233('0x3')](_0xe233('0x4'),auth[_0xe233('0x5')](),controller[_0xe233('0x6')]);router[_0xe233('0x3')](_0xe233('0x7'),auth['isAuthenticated'](),controller[_0xe233('0x8')]);router[_0xe233('0x3')](_0xe233('0x9'),auth[_0xe233('0x5')](),controller[_0xe233('0xa')]);router[_0xe233('0x3')](_0xe233('0xb'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0xe233('0x3')](_0xe233('0xc'),auth[_0xe233('0x5')](),controller[_0xe233('0xd')]);router[_0xe233('0x3')]('/mail/queues',auth[_0xe233('0x5')](),controller[_0xe233('0xe')]);router[_0xe233('0x3')](_0xe233('0xf'),auth[_0xe233('0x5')](),controller[_0xe233('0x10')]);router[_0xe233('0x3')](_0xe233('0x11'),auth[_0xe233('0x5')](),controller[_0xe233('0x12')]);router[_0xe233('0x3')](_0xe233('0x13'),auth[_0xe233('0x5')](),controller[_0xe233('0x14')]);router[_0xe233('0x3')](_0xe233('0x15'),auth['isAuthenticated'](),controller['whatsappQueues']);router['get'](_0xe233('0x16'),auth[_0xe233('0x5')](),controller[_0xe233('0x17')]);router[_0xe233('0x3')](_0xe233('0x18'),auth[_0xe233('0x5')](),controller[_0xe233('0x19')]);router['get'](_0xe233('0x1a'),auth['isAuthenticated'](),controller[_0xe233('0x1b')]);router['get'](_0xe233('0x1c'),auth['isAuthenticated'](),controller[_0xe233('0x1d')]);router[_0xe233('0x3')](_0xe233('0x1e'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0xe233('0x3')](_0xe233('0x1f'),auth['isAuthenticated'](),controller[_0xe233('0x20')]);router['get'](_0xe233('0x21'),auth[_0xe233('0x5')](),controller['showVoiceQueues']);router[_0xe233('0x22')](_0xe233('0x21'),auth[_0xe233('0x5')](),controller[_0xe233('0x23')]);router[_0xe233('0x3')](_0xe233('0x24'),auth[_0xe233('0x5')](),controller[_0xe233('0x25')]);router['get']('/outbound/channels',auth['isAuthenticated'](),controller[_0xe233('0x26')]);router[_0xe233('0x3')](_0xe233('0x27'),auth[_0xe233('0x5')](),controller[_0xe233('0x28')]);router[_0xe233('0x22')]('/agents/:id/capacity',auth[_0xe233('0x5')](),controller[_0xe233('0x29')]);router[_0xe233('0x3')]('/telephones',auth[_0xe233('0x5')](),controller[_0xe233('0x2a')]);router[_0xe233('0x3')](_0xe233('0x2b'),auth[_0xe233('0x5')](),controller[_0xe233('0x2c')]);router[_0xe233('0x3')]('/campaigns',auth[_0xe233('0x5')](),controller['campaigns']);router[_0xe233('0x3')](_0xe233('0x2d'),auth[_0xe233('0x5')](),controller[_0xe233('0x2e')]);router[_0xe233('0x3')](_0xe233('0x2f'),auth[_0xe233('0x5')](),controller[_0xe233('0x30')]);router[_0xe233('0x3')](_0xe233('0x31'),auth['isAuthenticated'](),controller[_0xe233('0x32')]);router[_0xe233('0x3')](_0xe233('0x33'),auth[_0xe233('0x5')](),controller[_0xe233('0x34')]);router[_0xe233('0x3')](_0xe233('0x35'),auth[_0xe233('0x5')](),controller[_0xe233('0x36')]);router[_0xe233('0x3')](_0xe233('0x37'),auth['isAuthenticated'](),controller[_0xe233('0x38')]);router[_0xe233('0x3')](_0xe233('0x39'),auth['isAuthenticated'](),controller[_0xe233('0x3a')]);router['get'](_0xe233('0x3b'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0xe233('0x3c')](_0xe233('0x3d'),auth[_0xe233('0x5')](),controller['queueNotify'](_0xe233('0x3e')));router['get'](_0xe233('0x3f'),auth['isAuthenticated'](),controller[_0xe233('0x40')]);router[_0xe233('0x3c')]('/chat/queues/:id/notify',auth[_0xe233('0x5')](),controller['queueNotify'](_0xe233('0x41')));router[_0xe233('0x3')](_0xe233('0x42'),auth[_0xe233('0x5')](),controller[_0xe233('0x43')]);router[_0xe233('0x3c')]('/fax/queues/:id/notify',auth[_0xe233('0x5')](),controller[_0xe233('0x44')](_0xe233('0x45')));router['get'](_0xe233('0x46'),auth[_0xe233('0x5')](),controller[_0xe233('0x47')]);router[_0xe233('0x3c')]('/openchannel/queues/:id/notify',auth[_0xe233('0x5')](),controller['queueNotify'](_0xe233('0x48')));router[_0xe233('0x3')]('/openchannel/queues/:id',auth[_0xe233('0x5')](),controller['showOpenchannelQueues']);router[_0xe233('0x3c')](_0xe233('0x49'),auth[_0xe233('0x5')](),controller[_0xe233('0x44')](_0xe233('0x4a')));router[_0xe233('0x3c')](_0xe233('0x4b'),auth[_0xe233('0x5')](),controller['queueNotify'](_0xe233('0x4c')));router[_0xe233('0x3')](_0xe233('0x4d'),auth[_0xe233('0x5')](),controller[_0xe233('0x4e')]);router[_0xe233('0x3')](_0xe233('0x4f'),auth[_0xe233('0x5')](),controller[_0xe233('0x50')]);router[_0xe233('0x3c')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0xe233('0x51')]);module[_0xe233('0x52')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 1de4282..61e1bdd 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 _0xac9d=['SIP/%s','INTERACTION','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq','indexOf','queue_id','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','messageId','Interaction','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','\x20Message\x20not\x20found','update','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','json','sendStatus','stack','name','status','send','isNil','find','rows','voiceChannels','VoiceChannels','voiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','findOrCreate','interface','format'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0xac9d,0x14d));var _0xdac9=function(_0x3411a4,_0x60d585){_0x3411a4=_0x3411a4-0x0;var _0x4eb325=_0xac9d[_0x3411a4];return _0x4eb325;};'use strict';var BPromise=require(_0xdac9('0x0'));var moment=require(_0xdac9('0x1'));var _=require(_0xdac9('0x2'));var util=require(_0xdac9('0x3'));var db=require(_0xdac9('0x4'))['db'];var logger=require(_0xdac9('0x5'))(_0xdac9('0x6'));var jayson=require(_0xdac9('0x7'));var amiClient=jayson['client'][_0xdac9('0x8')]({'port':0x232a});var mailClient=jayson['client'][_0xdac9('0x8')]({'port':0x232b});var routingClient=jayson[_0xdac9('0x9')][_0xdac9('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){var _0x47d9fd=_0x39f560?_0x39f560:amiClient;return _0x47d9fd[_0xdac9('0xa')](_0x776b6c,_0x1c78c5)[_0xdac9('0xb')](function(_0x39c92c){if(_0x39c92c[_0xdac9('0xc')]){if(_0x39c92c[_0xdac9('0xc')][_0xdac9('0xd')]===0x1f4){return _0x2b1d6f(_0x39c92c[_0xdac9('0xc')][_0xdac9('0xe')]);}return _0x5531af(_0x39c92c[_0xdac9('0xc')]['message']);}else{_0x5531af(_0x39c92c[_0xdac9('0xf')]);}})[_0xdac9('0x10')](function(_0x5a9bde){_0x2b1d6f(_0x5a9bde);});});}function respondWithResult(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xc8;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['status'](_0xeddbc1)[_0xdac9('0x11')](_0xbfe6d8);}return _0x3d8e97[_0xdac9('0x12')](0x194);};}function handleError(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0x1f4;return function(_0x5dd536){logger[_0xdac9('0xc')](_0x5dd536[_0xdac9('0x13')]);if(_0x5dd536['name']){delete _0x5dd536[_0xdac9('0x14')];}_0x9e1bf6[_0xdac9('0x15')](_0x5f0bbd)[_0xdac9('0x16')](_0x5dd536);};}function findById(_0x5b2f1b){return function(_0x2221f8){if(!_[_0xdac9('0x17')](_0x5b2f1b)&&!_[_0xdac9('0x17')](_0x2221f8)&&!_[_0xdac9('0x17')](_0x2221f8['rows'])){return _[_0xdac9('0x18')](_0x2221f8[_0xdac9('0x19')],function(_0x571e07){return _0x571e07['id']==_0x5b2f1b;});}return null;};}exports[_0xdac9('0x1a')]=function(_0xa57f2d,_0x171df1){return respondWithRpcPromise(_0xdac9('0x1b'),_0xa57f2d['query'])['then'](respondWithResult(_0x171df1,null))[_0xdac9('0x10')](handleError(_0x171df1,null));};exports[_0xdac9('0x1c')]=function(_0x2b9d91,_0x395ec7){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xdac9('0x1d')](_0x2b9d91[_0xdac9('0x1e')],_0x2b9d91[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x395ec7,null))[_0xdac9('0x10')](handleError(_0x395ec7,null));};exports[_0xdac9('0x20')]=function(_0x41335a,_0xa1f726){return respondWithRpcPromise(_0xdac9('0x21'),_[_0xdac9('0x1d')](_0x41335a['query'],_0x41335a[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0xa1f726,null))[_0xdac9('0x10')](handleError(_0xa1f726,null));};exports[_0xdac9('0x22')]=function(_0x5ca076,_0x1e631a){return respondWithRpcPromise('VoiceQueues',_0x5ca076[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x1e631a,null))['catch'](handleError(_0x1e631a,null));};exports[_0xdac9('0x23')]=function(_0x5105f1,_0x450f91){return respondWithRpcPromise(_0xdac9('0x24'),_0x5105f1[_0xdac9('0x1e')])[_0xdac9('0xb')](findById(_0x5105f1['params']['id']))['then'](respondWithResult(_0x450f91,null))[_0xdac9('0x10')](handleError(_0x450f91,null));};exports[_0xdac9('0x25')]=function(_0x4fe3bd,_0x4c4e21){return respondWithRpcPromise(_0xdac9('0x26'),_[_0xdac9('0x1d')](_0x4fe3bd[_0xdac9('0x27')],_0x4fe3bd[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x4c4e21,null))[_0xdac9('0x10')](handleError(_0x4c4e21,null));};exports[_0xdac9('0x28')]=function(_0x2cda4d,_0x406ed0){return respondWithRpcPromise(_0xdac9('0x29'),_[_0xdac9('0x1d')](_0x2cda4d[_0xdac9('0x1e')],_0x2cda4d[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x406ed0,null))[_0xdac9('0x10')](handleError(_0x406ed0,null));};exports[_0xdac9('0x2a')]=function(_0x372f02,_0x44eff2){return respondWithRpcPromise(_0xdac9('0x2b'),_0x372f02[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x44eff2,null))['catch'](handleError(_0x44eff2,null));};exports['voiceQueuesChannel']=function(_0x1e6832,_0x416501){return respondWithRpcPromise(_0xdac9('0x2c'),_[_0xdac9('0x1d')](_0x1e6832[_0xdac9('0x1e')],_0x1e6832['params']))[_0xdac9('0xb')](respondWithResult(_0x416501,null))['catch'](handleError(_0x416501,null));};exports[_0xdac9('0x2d')]=function(_0x2a611e,_0x5cfebf){return respondWithRpcPromise(_0xdac9('0x2e'),_['merge'](_0x2a611e['query'],_0x2a611e[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x5cfebf,null))[_0xdac9('0x10')](handleError(_0x5cfebf,null));};exports[_0xdac9('0x2f')]=function(_0x3bab10,_0x363d93){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xdac9('0x1d')](_0x3bab10[_0xdac9('0x1e')],_0x3bab10['params']))[_0xdac9('0xb')](respondWithResult(_0x363d93,null))[_0xdac9('0x10')](handleError(_0x363d93,null));};exports[_0xdac9('0x30')]=function(_0x27bdfb,_0x35aa58){return respondWithRpcPromise(_0xdac9('0x31'),_0x27bdfb[_0xdac9('0x1e')])['then'](respondWithResult(_0x35aa58,null))[_0xdac9('0x10')](handleError(_0x35aa58,null));};exports[_0xdac9('0x32')]=function(_0x238769,_0x4b6b09){return respondWithRpcPromise(_0xdac9('0x33'),_0x238769[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x4b6b09,null))[_0xdac9('0x10')](handleError(_0x4b6b09,null));};exports['agents']=function(_0x58fd14,_0x1d0243){var _0xe47a3c;return respondWithRpcPromise(_0xdac9('0x34'),_0x58fd14[_0xdac9('0x1e')])[_0xdac9('0xb')](function(_0x579581){_0xe47a3c=_0x579581;return respondWithRpcPromise(_0xdac9('0x34'),_0x58fd14['query'],routingClient);})[_0xdac9('0xb')](function(_0xaca43c){return _[_0xdac9('0x1d')]({},_0xaca43c,_0xe47a3c);})[_0xdac9('0xb')](respondWithResult(_0x1d0243,null))[_0xdac9('0x10')](handleError(_0x1d0243,null));};exports[_0xdac9('0x35')]=function(_0x413fb1,_0xb176e0){if(_0x413fb1[_0xdac9('0x27')]&&_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')]&&_0x413fb1[_0xdac9('0x37')]&&_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')]){for(var _0x5335ae in _0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')]){if(_0x413fb1['body'][_0xdac9('0x36')][_0xdac9('0x38')](_0x5335ae)){db[_0xdac9('0x39')][_0xdac9('0x3a')]({'where':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x413fb1[_0xdac9('0x27')]['interaction'][_0x5335ae]&&_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0xdac9('0x3b')]?{'$notIn':_0x413fb1[_0xdac9('0x27')]['interaction'][_0x5335ae]}:{'$ne':null}}})['then'](function(_0x585f08){var _0xcb7b82=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4159fd=0x0,_0x15c332=_0x585f08['length'];_0x4159fd<_0x15c332;_0x4159fd+=0x1){_0x585f08[_0x4159fd]['updateAttributes']({'exitAt':_0xcb7b82});}});for(var _0x1666c5=0x0;_0x1666c5<_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0xdac9('0x3b')];_0x1666c5+=0x1){db[_0xdac9('0x39')][_0xdac9('0x3c')]({'where':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'type':'INTERACTION','uniqueid':_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0x1666c5],'exitAt':null},'defaults':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'interface':_[_0xdac9('0x17')](_0x413fb1[_0xdac9('0x37')][_0xdac9('0x3d')])?util[_0xdac9('0x3e')](_0xdac9('0x3f'),_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')]):_0x413fb1[_0xdac9('0x37')][_0xdac9('0x3d')],'type':_0xdac9('0x40'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x41')],'uniqueid':_0x413fb1['body'][_0xdac9('0x36')][_0x5335ae][_0x1666c5]}});}}}}return respondWithRpcPromise(_0xdac9('0x42'),{'id':_0x413fb1[_0xdac9('0x1f')]['id'],'capacity':_0x413fb1['body'][_0xdac9('0x43')]},routingClient)[_0xdac9('0xb')](respondWithResult(_0xb176e0,null))['catch'](handleError(_0xb176e0,null));};exports['telephones']=function(_0x46f1c0,_0x4469d8){return respondWithRpcPromise(_0xdac9('0x44'),_0x46f1c0[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x4469d8,null))[_0xdac9('0x10')](handleError(_0x4469d8,null));};exports[_0xdac9('0x45')]=function(_0x3a77e3,_0x298c72){return respondWithRpcPromise(_0xdac9('0x46'),_0x3a77e3[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x298c72,null))[_0xdac9('0x10')](handleError(_0x298c72,null));};exports[_0xdac9('0x47')]=function(_0x35a378,_0x5d0b43){return respondWithRpcPromise(_0xdac9('0x48'),_0x35a378[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x5d0b43,null))[_0xdac9('0x10')](handleError(_0x5d0b43,null));};exports[_0xdac9('0x49')]=function(_0x3a391a,_0x4b118e){return respondWithRpcPromise(_0xdac9('0x4a'),_0x3a391a[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x4b118e,null))[_0xdac9('0x10')](handleError(_0x4b118e,null));};exports[_0xdac9('0x4b')]=function(_0x2a5bf9,_0x1eec39){return respondWithRpcPromise(_0xdac9('0x4a'),_0x2a5bf9[_0xdac9('0x1e')],routingClient)['then'](findById(_0x2a5bf9[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x1eec39,null))[_0xdac9('0x10')](handleError(_0x1eec39,null));};exports[_0xdac9('0x4c')]=function(_0x2ca15d,_0x21ab3d){return respondWithRpcPromise('MailQueues',_0x2ca15d['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x21ab3d,null))[_0xdac9('0x10')](handleError(_0x21ab3d,null));};exports[_0xdac9('0x4d')]=function(_0x46017d,_0x1c1f5f){return respondWithRpcPromise(_0xdac9('0x4e'),_0x46017d['query'],routingClient)['then'](findById(_0x46017d['params']['id']))[_0xdac9('0xb')](respondWithResult(_0x1c1f5f,null))[_0xdac9('0x10')](handleError(_0x1c1f5f,null));};exports[_0xdac9('0x4f')]=function(_0x2f581b,_0x52ad7b){return respondWithRpcPromise(_0xdac9('0x50'),_0x2f581b[_0xdac9('0x1e')],mailClient)[_0xdac9('0xb')](respondWithResult(_0x52ad7b,null))[_0xdac9('0x10')](handleError(_0x52ad7b,null));};exports[_0xdac9('0x51')]=function(_0x496d9c,_0x19a46e){return respondWithRpcPromise('OpenchannelQueues',_0x496d9c[_0xdac9('0x1e')],routingClient)['then'](respondWithResult(_0x19a46e,null))[_0xdac9('0x10')](handleError(_0x19a46e,null));};exports[_0xdac9('0x52')]=function(_0x2fd7c8,_0x360499){return respondWithRpcPromise(_0xdac9('0x53'),_0x2fd7c8[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x2fd7c8['params']['id']))['then'](respondWithResult(_0x360499,null))['catch'](handleError(_0x360499,null));};exports[_0xdac9('0x54')]=function(_0x42ba53,_0x830d54){return respondWithRpcPromise(_0xdac9('0x55'),_0x42ba53[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x830d54,null))[_0xdac9('0x10')](handleError(_0x830d54,null));};exports['showSmsQueues']=function(_0x2d81fc,_0x5b63d8){return respondWithRpcPromise('SmsQueues',_0x2d81fc[_0xdac9('0x1e')],routingClient)['then'](findById(_0x2d81fc['params']['id']))[_0xdac9('0xb')](respondWithResult(_0x5b63d8,null))[_0xdac9('0x10')](handleError(_0x5b63d8,null));};exports[_0xdac9('0x56')]=function(_0x55ce14,_0x552cac){return respondWithRpcPromise(_0xdac9('0x57'),_0x55ce14[_0xdac9('0x1e')],routingClient)['then'](respondWithResult(_0x552cac,null))[_0xdac9('0x10')](handleError(_0x552cac,null));};exports[_0xdac9('0x58')]=function(_0x26b9b5,_0x272f14){return respondWithRpcPromise(_0xdac9('0x57'),_0x26b9b5[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x26b9b5[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x272f14,null))[_0xdac9('0x10')](handleError(_0x272f14,null));};exports[_0xdac9('0x59')]=function(_0x1e2e7b,_0x5401e6){return respondWithRpcPromise(_0xdac9('0x5a'),_0x1e2e7b['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x5401e6,null))[_0xdac9('0x10')](handleError(_0x5401e6,null));};exports['showFaxQueues']=function(_0x3a6c78,_0x3bee81){return respondWithRpcPromise(_0xdac9('0x5a'),_0x3a6c78[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x3a6c78[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x3bee81,null))[_0xdac9('0x10')](handleError(_0x3bee81,null));};exports[_0xdac9('0x5b')]=function(_0x45f183,_0x263b84){return respondWithRpcPromise(_0xdac9('0x5c'),_0x45f183[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x263b84,null))[_0xdac9('0x10')](handleError(_0x263b84,null));};exports[_0xdac9('0x5d')]=function(_0x4c4a7b,_0x3a457b){return respondWithRpcPromise(_0xdac9('0x5e'),_0x4c4a7b[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x3a457b,null))['catch'](handleError(_0x3a457b,null));};exports[_0xdac9('0x5f')]=function(_0x31f56e,_0x1b6a68){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x31f56e[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x1b6a68,null))['catch'](handleError(_0x1b6a68,null));};exports[_0xdac9('0x60')]=function(_0x1b8ad9,_0x2a4d12){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1b8ad9[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x2a4d12,null))[_0xdac9('0x10')](handleError(_0x2a4d12,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x5c39e9,_0x108e03){return respondWithRpcPromise(_0xdac9('0x61'),_0x5c39e9[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](function(_0x4110da){if(_0x5c39e9[_0xdac9('0x1e')][_0xdac9('0x62')]!==undefined){var _0x2de535=_(_0x4110da[_0xdac9('0x19')])[_0xdac9('0x63')]([_0x5c39e9[_0xdac9('0x1e')][_0xdac9('0x62')],_0x5c39e9[_0xdac9('0x1f')]['id']])['map']('queue_id')[_0xdac9('0x64')]()['value']();return _0x4110da['rows'][_0xdac9('0x63')](function(_0x199518){return _0x2de535[_0xdac9('0x65')](_0x199518[_0xdac9('0x66')])>-0x1;});}else{return _0x4110da['rows'][_0xdac9('0x63')](function(_0xff5be){return _0xff5be[_0xdac9('0x66')]===parseInt(_0x5c39e9['params']['id']);});}})[_0xdac9('0xb')](respondWithResult(_0x108e03,null))[_0xdac9('0x10')](handleError(_0x108e03,null));};exports['smsQueuesWaitingInteractions']=function(_0x3cc0f9,_0x59b5b2){return respondWithRpcPromise(_0xdac9('0x67'),_0x3cc0f9['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x59b5b2,null))[_0xdac9('0x10')](handleError(_0x59b5b2,null));};exports[_0xdac9('0x68')]=function(_0x251011,_0x9981f){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x251011[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x9981f,null))[_0xdac9('0x10')](handleError(_0x9981f,null));};exports[_0xdac9('0x69')]=function(_0x13be64,_0x227857){return respondWithRpcPromise(_0xdac9('0x6a'),_0x13be64[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x227857,null))['catch'](handleError(_0x227857,null));};exports[_0xdac9('0x6b')]=function(_0x300738){return function(_0x12c15b,_0x4f7f63){var _0x571130,_0x5650d1;var _0x5adc83=_['capitalize'](_0x300738);var _0x325407=_0x300738===_0xdac9('0x6c')?_0xdac9('0x6d'):_0xdac9('0x6e');return db[_0x5adc83+'Queue'][_0xdac9('0x6f')]({'raw':!![],'where':{'id':_0x12c15b['params']['id']}})[_0xdac9('0xb')](function(_0x750de7){if(_[_0xdac9('0x17')](_0x750de7)){throw new Error(_0x5adc83+_0xdac9('0x70'));}_0x571130=_0x750de7;return db[_0x5adc83+'Message'][_0xdac9('0x6f')]({'where':{'id':_0x12c15b[_0xdac9('0x27')][_0xdac9('0x71')]},'include':[{'model':db[_0x5adc83+_0xdac9('0x72')],'as':'Interaction'},{'model':db[_0x5adc83+_0x325407],'as':'Account'}]});})[_0xdac9('0xb')](function(_0x414f8a){if(_[_0xdac9('0x17')](_0x414f8a)){throw new Error(_0x5adc83+'\x20Message\x20not\x20found');}_0x5650d1=_0x414f8a;return _0x414f8a['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xdac9('0xb')](function(){var _0x111bff={'uniqueid':_0x300738+'.'+_0x5650d1['id']+'.'+_0x5650d1[_0xdac9('0x72')]['id'],'FromUserId':_0x12c15b[_0xdac9('0x37')]['id'],'type':_0xdac9('0x73')};_0x111bff[_0x5adc83+_0xdac9('0x74')]=_0x5650d1['id'];_0x111bff[_0x5adc83+_0xdac9('0x75')]=_0x5650d1[_0xdac9('0x72')]['id'];_0x111bff[_0xdac9('0x76')+_0x5adc83+_0x325407+'Id']=_0x5650d1[_0xdac9('0x6e')]['id'];_0x111bff['To'+_0x5adc83+_0xdac9('0x77')]=_0x571130['id'];return db[_0x5adc83+_0xdac9('0x78')][_0xdac9('0x79')](_0x111bff);})['then'](function(){return respondWithRpcPromise(_0xdac9('0x7a'),{'channel':_0x300738,'interaction':_0x5650d1[_0xdac9('0x72')],'message':_0x5650d1,'account':_0x5650d1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xdac9('0x73'),'appdata':_0x571130['name']+','+(_0x5650d1[_0xdac9('0x6e')][_0xdac9('0x7b')]||0x12c),'interval':_0xdac9('0x7c')}]},routingClient);})[_0xdac9('0xb')](respondWithResult(_0x4f7f63,null))[_0xdac9('0x10')](handleError(_0x4f7f63,null));};};exports[_0xdac9('0x7d')]=function(_0x232876,_0x4463ca){var _0x171d38,_0x328fa2;if(_[_0xdac9('0x17')](_0x232876['body'][_0xdac9('0x7e')])){throw new Error(_0xdac9('0x7f'));}var _0x284247=_0x232876[_0xdac9('0x27')][_0xdac9('0x7e')];var _0x4d7208=_['capitalize'](_0x284247);var _0x363541=_0x284247==='chat'?'Website':_0xdac9('0x6e');return db[_0xdac9('0x80')][_0xdac9('0x6f')]({'raw':!![],'where':{'id':_0x232876[_0xdac9('0x1f')]['id'],'role':'agent'}})[_0xdac9('0xb')](function(_0x8f37df){if(_[_0xdac9('0x17')](_0x8f37df)){throw new Error('Agent\x20not\x20found');}_0x171d38=_0x8f37df;return db[_0x4d7208+'Message'][_0xdac9('0x6f')]({'where':{'id':_0x232876[_0xdac9('0x27')]['messageId']},'include':[{'model':db[_0x4d7208+'Interaction'],'as':'Interaction'},{'model':db[_0x4d7208+_0x363541],'as':_0xdac9('0x6e')}]});})[_0xdac9('0xb')](function(_0x131c78){if(_['isNil'](_0x131c78)){throw new Error(_0x4d7208+_0xdac9('0x81'));}_0x328fa2=_0x131c78;return _0x131c78[_0xdac9('0x82')]({'read':0x0,'readAt':null,'UserId':null});})[_0xdac9('0xb')](function(){var _0x2ab89f={'uniqueid':_0x284247+'.'+_0x328fa2['id']+'.'+_0x328fa2[_0xdac9('0x72')]['id'],'FromUserId':_0x232876['user']['id'],'type':_0xdac9('0x73'),'ToUserId':_0x171d38['id']};_0x2ab89f[_0x4d7208+_0xdac9('0x74')]=_0x328fa2['id'];_0x2ab89f[_0x4d7208+'InteractionId']=_0x328fa2[_0xdac9('0x72')]['id'];_0x2ab89f[_0xdac9('0x76')+_0x4d7208+_0x363541+'Id']=_0x328fa2[_0xdac9('0x6e')]['id'];return db[_0x4d7208+_0xdac9('0x78')]['create'](_0x2ab89f);})['then'](function(){return respondWithRpcPromise(_0xdac9('0x7a'),{'channel':_0x284247,'interaction':_0x328fa2[_0xdac9('0x72')],'message':_0x328fa2,'account':_0x328fa2['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x171d38[_0xdac9('0x14')]+','+(_0x328fa2['Account'][_0xdac9('0x83')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x4463ca,null))[_0xdac9('0x10')](handleError(_0x4463ca,null));}; \ No newline at end of file +var _0x31f0=['YYYY-MM-DD\x20HH:mm:ss','MemberReport','findOrCreate','interface','SIP/%s','capacity','telephones','Telephones','trunks','Trunks','chatQueues','ChatQueues','MailQueues','showMailQueues','MailAccounts','OpenchannelQueues','smsQueues','SmsQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','map','uniq','value','filter','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','InteractionId','From','create','Start','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','chat','agent','Agent\x20not\x20found','MessageId','TransferReport','agentTransferTimeout','bluebird','lodash','../../mysqldb','../../config/logger','api','jayson/promise','http','client','then','error','code','message','result','catch','status','sendStatus','name','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','length','format'];(function(_0x4ae32d,_0x256489){var _0x550537=function(_0x534d63){while(--_0x534d63){_0x4ae32d['push'](_0x4ae32d['shift']());}};_0x550537(++_0x256489);}(_0x31f0,0xb7));var _0x031f=function(_0x406560,_0x377b33){_0x406560=_0x406560-0x0;var _0xbe75eb=_0x31f0[_0x406560];return _0xbe75eb;};'use strict';var BPromise=require(_0x031f('0x0'));var moment=require('moment');var _=require(_0x031f('0x1'));var util=require('util');var db=require(_0x031f('0x2'))['db'];var logger=require(_0x031f('0x3'))(_0x031f('0x4'));var jayson=require(_0x031f('0x5'));var amiClient=jayson['client'][_0x031f('0x6')]({'port':0x232a});var mailClient=jayson[_0x031f('0x7')]['http']({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){var _0x3e41ed=_0x365f59?_0x365f59:amiClient;return _0x3e41ed['request'](_0x3dc98e,_0x487e65)[_0x031f('0x8')](function(_0x24145f){if(_0x24145f[_0x031f('0x9')]){if(_0x24145f[_0x031f('0x9')][_0x031f('0xa')]===0x1f4){return _0x2569b6(_0x24145f[_0x031f('0x9')][_0x031f('0xb')]);}return _0x4300b4(_0x24145f[_0x031f('0x9')]['message']);}else{_0x4300b4(_0x24145f[_0x031f('0xc')]);}})[_0x031f('0xd')](function(_0x28da6e){_0x2569b6(_0x28da6e);});});}function respondWithResult(_0x351052,_0x3819bb){_0x3819bb=_0x3819bb||0xc8;return function(_0x405896){if(_0x405896){return _0x351052[_0x031f('0xe')](_0x3819bb)['json'](_0x405896);}return _0x351052[_0x031f('0xf')](0x194);};}function handleError(_0x23b40c,_0x17a699){_0x17a699=_0x17a699||0x1f4;return function(_0x2e3dfe){logger[_0x031f('0x9')](_0x2e3dfe['stack']);if(_0x2e3dfe['name']){delete _0x2e3dfe[_0x031f('0x10')];}_0x23b40c[_0x031f('0xe')](_0x17a699)[_0x031f('0x11')](_0x2e3dfe);};}function findById(_0x286177){return function(_0x5196b1){if(!_[_0x031f('0x12')](_0x286177)&&!_[_0x031f('0x12')](_0x5196b1)&&!_['isNil'](_0x5196b1[_0x031f('0x13')])){return _['find'](_0x5196b1[_0x031f('0x13')],function(_0x5f2199){return _0x5f2199['id']==_0x286177;});}return null;};}exports[_0x031f('0x14')]=function(_0xaa155,_0x1ceddc){return respondWithRpcPromise(_0x031f('0x15'),_0xaa155[_0x031f('0x16')])[_0x031f('0x8')](respondWithResult(_0x1ceddc,null))[_0x031f('0xd')](handleError(_0x1ceddc,null));};exports[_0x031f('0x17')]=function(_0x29dd6e,_0x48a76e){return respondWithRpcPromise(_0x031f('0x18'),_[_0x031f('0x19')](_0x29dd6e[_0x031f('0x16')],_0x29dd6e['params']))['then'](respondWithResult(_0x48a76e,null))[_0x031f('0xd')](handleError(_0x48a76e,null));};exports['voiceChannelStopMixMonitor']=function(_0x3472a2,_0x57f6c4){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x3472a2[_0x031f('0x16')],_0x3472a2[_0x031f('0x1a')]))[_0x031f('0x8')](respondWithResult(_0x57f6c4,null))[_0x031f('0xd')](handleError(_0x57f6c4,null));};exports['voiceQueues']=function(_0x374b65,_0x5a64c0){return respondWithRpcPromise(_0x031f('0x1b'),_0x374b65[_0x031f('0x16')])[_0x031f('0x8')](respondWithResult(_0x5a64c0,null))['catch'](handleError(_0x5a64c0,null));};exports[_0x031f('0x1c')]=function(_0x3b2a51,_0x54b44e){return respondWithRpcPromise(_0x031f('0x1b'),_0x3b2a51[_0x031f('0x16')])[_0x031f('0x8')](findById(_0x3b2a51['params']['id']))[_0x031f('0x8')](respondWithResult(_0x54b44e,null))[_0x031f('0xd')](handleError(_0x54b44e,null));};exports[_0x031f('0x1d')]=function(_0xaf5bea,_0xfaa36){return respondWithRpcPromise(_0x031f('0x1e'),_['merge'](_0xaf5bea[_0x031f('0x1f')],_0xaf5bea[_0x031f('0x1a')]))[_0x031f('0x8')](respondWithResult(_0xfaa36,null))[_0x031f('0xd')](handleError(_0xfaa36,null));};exports[_0x031f('0x20')]=function(_0x2d24f0,_0x378692){return respondWithRpcPromise(_0x031f('0x21'),_[_0x031f('0x19')](_0x2d24f0[_0x031f('0x16')],_0x2d24f0[_0x031f('0x1a')]))['then'](respondWithResult(_0x378692,null))[_0x031f('0xd')](handleError(_0x378692,null));};exports[_0x031f('0x22')]=function(_0xb3a6bd,_0x2f2616){return respondWithRpcPromise(_0x031f('0x23'),_0xb3a6bd[_0x031f('0x16')])[_0x031f('0x8')](respondWithResult(_0x2f2616,null))[_0x031f('0xd')](handleError(_0x2f2616,null));};exports[_0x031f('0x24')]=function(_0xb7284d,_0x12bd77){return respondWithRpcPromise(_0x031f('0x25'),_[_0x031f('0x19')](_0xb7284d['query'],_0xb7284d[_0x031f('0x1a')]))[_0x031f('0x8')](respondWithResult(_0x12bd77,null))['catch'](handleError(_0x12bd77,null));};exports[_0x031f('0x26')]=function(_0x1fde6b,_0x4ec696){return respondWithRpcPromise(_0x031f('0x27'),_[_0x031f('0x19')](_0x1fde6b[_0x031f('0x16')],_0x1fde6b[_0x031f('0x1a')]))['then'](respondWithResult(_0x4ec696,null))['catch'](handleError(_0x4ec696,null));};exports[_0x031f('0x28')]=function(_0x555b89,_0x43ab76){return respondWithRpcPromise(_0x031f('0x29'),_[_0x031f('0x19')](_0x555b89['query'],_0x555b89['params']))[_0x031f('0x8')](respondWithResult(_0x43ab76,null))['catch'](handleError(_0x43ab76,null));};exports['outbound']=function(_0x2d489a,_0x45e3a4){return respondWithRpcPromise(_0x031f('0x2a'),_0x2d489a[_0x031f('0x16')])[_0x031f('0x8')](respondWithResult(_0x45e3a4,null))[_0x031f('0xd')](handleError(_0x45e3a4,null));};exports[_0x031f('0x2b')]=function(_0x55c85f,_0x17a970){return respondWithRpcPromise(_0x031f('0x2c'),_0x55c85f[_0x031f('0x16')])[_0x031f('0x8')](respondWithResult(_0x17a970,null))['catch'](handleError(_0x17a970,null));};exports[_0x031f('0x2d')]=function(_0x10f590,_0x2dba8b){var _0x5895f6;return respondWithRpcPromise(_0x031f('0x2e'),_0x10f590[_0x031f('0x16')])['then'](function(_0x36bafa){_0x5895f6=_0x36bafa;return respondWithRpcPromise(_0x031f('0x2e'),_0x10f590['query'],routingClient);})['then'](function(_0x178135){return _[_0x031f('0x19')]({},_0x178135,_0x5895f6);})[_0x031f('0x8')](respondWithResult(_0x2dba8b,null))[_0x031f('0xd')](handleError(_0x2dba8b,null));};exports[_0x031f('0x2f')]=function(_0xf0fb95,_0xe07087){if(_0xf0fb95['body']&&_0xf0fb95[_0x031f('0x1f')][_0x031f('0x30')]&&_0xf0fb95['user']&&_0xf0fb95[_0x031f('0x31')]['name']){for(var _0x456a98 in _0xf0fb95[_0x031f('0x1f')]['interaction']){if(_0xf0fb95[_0x031f('0x1f')][_0x031f('0x30')][_0x031f('0x32')](_0x456a98)){db['MemberReport'][_0x031f('0x33')]({'where':{'channel':_0x456a98,'membername':_0xf0fb95[_0x031f('0x31')][_0x031f('0x10')],'type':_0x031f('0x34'),'exitAt':null,'uniqueid':_0xf0fb95[_0x031f('0x1f')][_0x031f('0x30')][_0x456a98]&&_0xf0fb95[_0x031f('0x1f')][_0x031f('0x30')][_0x456a98][_0x031f('0x35')]?{'$notIn':_0xf0fb95['body'][_0x031f('0x30')][_0x456a98]}:{'$ne':null}}})[_0x031f('0x8')](function(_0x28f2b3){var _0x3205ce=moment()[_0x031f('0x36')](_0x031f('0x37'));for(var _0x2111c5=0x0,_0x33d24b=_0x28f2b3[_0x031f('0x35')];_0x2111c5<_0x33d24b;_0x2111c5+=0x1){_0x28f2b3[_0x2111c5]['updateAttributes']({'exitAt':_0x3205ce});}});for(var _0x38539a=0x0;_0x38539a<_0xf0fb95['body']['interaction'][_0x456a98][_0x031f('0x35')];_0x38539a+=0x1){db[_0x031f('0x38')][_0x031f('0x39')]({'where':{'channel':_0x456a98,'membername':_0xf0fb95[_0x031f('0x31')][_0x031f('0x10')],'type':'INTERACTION','uniqueid':_0xf0fb95[_0x031f('0x1f')][_0x031f('0x30')][_0x456a98][_0x38539a],'exitAt':null},'defaults':{'channel':_0x456a98,'membername':_0xf0fb95[_0x031f('0x31')]['name'],'interface':_[_0x031f('0x12')](_0xf0fb95[_0x031f('0x31')][_0x031f('0x3a')])?util[_0x031f('0x36')](_0x031f('0x3b'),_0xf0fb95[_0x031f('0x31')]['name']):_0xf0fb95['user'][_0x031f('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x031f('0x36')](_0x031f('0x37')),'role':'agent','internal':_0xf0fb95[_0x031f('0x31')]['internal'],'uniqueid':_0xf0fb95['body'][_0x031f('0x30')][_0x456a98][_0x38539a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xf0fb95[_0x031f('0x1a')]['id'],'capacity':_0xf0fb95['body'][_0x031f('0x3c')]},routingClient)[_0x031f('0x8')](respondWithResult(_0xe07087,null))['catch'](handleError(_0xe07087,null));};exports[_0x031f('0x3d')]=function(_0x2e7abe,_0x57e32d){return respondWithRpcPromise(_0x031f('0x3e'),_0x2e7abe['query'])[_0x031f('0x8')](respondWithResult(_0x57e32d,null))['catch'](handleError(_0x57e32d,null));};exports[_0x031f('0x3f')]=function(_0x24848b,_0x393807){return respondWithRpcPromise(_0x031f('0x40'),_0x24848b[_0x031f('0x16')])['then'](respondWithResult(_0x393807,null))[_0x031f('0xd')](handleError(_0x393807,null));};exports['campaigns']=function(_0x186957,_0x414350){return respondWithRpcPromise('Campaigns',_0x186957[_0x031f('0x16')])[_0x031f('0x8')](respondWithResult(_0x414350,null))['catch'](handleError(_0x414350,null));};exports[_0x031f('0x41')]=function(_0x154ad2,_0x22a547){return respondWithRpcPromise('ChatQueues',_0x154ad2[_0x031f('0x16')],routingClient)['then'](respondWithResult(_0x22a547,null))[_0x031f('0xd')](handleError(_0x22a547,null));};exports['showChatQueues']=function(_0x3bd6f4,_0x561a2b){return respondWithRpcPromise(_0x031f('0x42'),_0x3bd6f4[_0x031f('0x16')],routingClient)['then'](findById(_0x3bd6f4['params']['id']))[_0x031f('0x8')](respondWithResult(_0x561a2b,null))[_0x031f('0xd')](handleError(_0x561a2b,null));};exports['mailQueues']=function(_0x434c0f,_0xb44c73){return respondWithRpcPromise(_0x031f('0x43'),_0x434c0f[_0x031f('0x16')],routingClient)[_0x031f('0x8')](respondWithResult(_0xb44c73,null))[_0x031f('0xd')](handleError(_0xb44c73,null));};exports[_0x031f('0x44')]=function(_0x405398,_0x4b25e5){return respondWithRpcPromise(_0x031f('0x43'),_0x405398[_0x031f('0x16')],routingClient)[_0x031f('0x8')](findById(_0x405398['params']['id']))[_0x031f('0x8')](respondWithResult(_0x4b25e5,null))[_0x031f('0xd')](handleError(_0x4b25e5,null));};exports['mailAccounts']=function(_0xb86dcd,_0x14506b){return respondWithRpcPromise(_0x031f('0x45'),_0xb86dcd[_0x031f('0x16')],mailClient)['then'](respondWithResult(_0x14506b,null))['catch'](handleError(_0x14506b,null));};exports['openchannelQueues']=function(_0x4e2d0d,_0x9f76f3){return respondWithRpcPromise(_0x031f('0x46'),_0x4e2d0d['query'],routingClient)[_0x031f('0x8')](respondWithResult(_0x9f76f3,null))[_0x031f('0xd')](handleError(_0x9f76f3,null));};exports['showOpenchannelQueues']=function(_0x110495,_0x26ecb0){return respondWithRpcPromise(_0x031f('0x46'),_0x110495[_0x031f('0x16')],routingClient)[_0x031f('0x8')](findById(_0x110495[_0x031f('0x1a')]['id']))[_0x031f('0x8')](respondWithResult(_0x26ecb0,null))[_0x031f('0xd')](handleError(_0x26ecb0,null));};exports[_0x031f('0x47')]=function(_0x557a32,_0x138e0d){return respondWithRpcPromise('SmsQueues',_0x557a32[_0x031f('0x16')],routingClient)[_0x031f('0x8')](respondWithResult(_0x138e0d,null))[_0x031f('0xd')](handleError(_0x138e0d,null));};exports['showSmsQueues']=function(_0x4c1b74,_0xdb3d45){return respondWithRpcPromise(_0x031f('0x48'),_0x4c1b74[_0x031f('0x16')],routingClient)[_0x031f('0x8')](findById(_0x4c1b74['params']['id']))[_0x031f('0x8')](respondWithResult(_0xdb3d45,null))['catch'](handleError(_0xdb3d45,null));};exports['whatsappQueues']=function(_0x2179ee,_0x534bae){return respondWithRpcPromise('WhatsappQueues',_0x2179ee[_0x031f('0x16')],routingClient)[_0x031f('0x8')](respondWithResult(_0x534bae,null))[_0x031f('0xd')](handleError(_0x534bae,null));};exports[_0x031f('0x49')]=function(_0xe125d9,_0x584899){return respondWithRpcPromise('WhatsappQueues',_0xe125d9[_0x031f('0x16')],routingClient)['then'](findById(_0xe125d9[_0x031f('0x1a')]['id']))[_0x031f('0x8')](respondWithResult(_0x584899,null))['catch'](handleError(_0x584899,null));};exports[_0x031f('0x4a')]=function(_0xee136c,_0x439095){return respondWithRpcPromise(_0x031f('0x4b'),_0xee136c[_0x031f('0x16')],routingClient)[_0x031f('0x8')](respondWithResult(_0x439095,null))['catch'](handleError(_0x439095,null));};exports['showFaxQueues']=function(_0x3bcc7e,_0x232b62){return respondWithRpcPromise(_0x031f('0x4b'),_0x3bcc7e[_0x031f('0x16')],routingClient)[_0x031f('0x8')](findById(_0x3bcc7e[_0x031f('0x1a')]['id']))[_0x031f('0x8')](respondWithResult(_0x232b62,null))['catch'](handleError(_0x232b62,null));};exports['faxAccounts']=function(_0x4bd283,_0x5ddf46){return respondWithRpcPromise(_0x031f('0x4c'),_0x4bd283[_0x031f('0x16')])[_0x031f('0x8')](respondWithResult(_0x5ddf46,null))['catch'](handleError(_0x5ddf46,null));};exports[_0x031f('0x4d')]=function(_0x2e56e3,_0x5133a6){return respondWithRpcPromise(_0x031f('0x4e'),_0x2e56e3[_0x031f('0x16')],routingClient)[_0x031f('0x8')](respondWithResult(_0x5133a6,null))[_0x031f('0xd')](handleError(_0x5133a6,null));};exports[_0x031f('0x4f')]=function(_0x1e10f6,_0x982c1b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x1e10f6['query'],routingClient)[_0x031f('0x8')](respondWithResult(_0x982c1b,null))['catch'](handleError(_0x982c1b,null));};exports[_0x031f('0x50')]=function(_0x523f69,_0x13251c){return respondWithRpcPromise(_0x031f('0x51'),_0x523f69[_0x031f('0x16')],routingClient)['then'](respondWithResult(_0x13251c,null))[_0x031f('0xd')](handleError(_0x13251c,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0xa31a3,_0xffb00){return respondWithRpcPromise(_0x031f('0x51'),_0xa31a3['query'],routingClient)[_0x031f('0x8')](function(_0x398e7c){if(_0xa31a3[_0x031f('0x16')][_0x031f('0x52')]!==undefined){var _0x45330f=_(_0x398e7c['rows'])['filter']([_0xa31a3[_0x031f('0x16')][_0x031f('0x52')],_0xa31a3['params']['id']])[_0x031f('0x53')]('queue_id')[_0x031f('0x54')]()[_0x031f('0x55')]();return _0x398e7c[_0x031f('0x13')][_0x031f('0x56')](function(_0x52bb92){return _0x45330f[_0x031f('0x57')](_0x52bb92[_0x031f('0x58')])>-0x1;});}else{return _0x398e7c[_0x031f('0x13')]['filter'](function(_0x1328ba){return _0x1328ba[_0x031f('0x58')]===parseInt(_0xa31a3['params']['id']);});}})[_0x031f('0x8')](respondWithResult(_0xffb00,null))[_0x031f('0xd')](handleError(_0xffb00,null));};exports[_0x031f('0x59')]=function(_0x2fb2a8,_0x104025){return respondWithRpcPromise(_0x031f('0x5a'),_0x2fb2a8[_0x031f('0x16')],routingClient)['then'](respondWithResult(_0x104025,null))[_0x031f('0xd')](handleError(_0x104025,null));};exports[_0x031f('0x5b')]=function(_0x23cc40,_0x5b19c1){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x23cc40[_0x031f('0x16')],routingClient)['then'](respondWithResult(_0x5b19c1,null))['catch'](handleError(_0x5b19c1,null));};exports[_0x031f('0x5c')]=function(_0x184bbd,_0x1c8055){return respondWithRpcPromise(_0x031f('0x5d'),_0x184bbd[_0x031f('0x16')],routingClient)[_0x031f('0x8')](respondWithResult(_0x1c8055,null))[_0x031f('0xd')](handleError(_0x1c8055,null));};exports[_0x031f('0x5e')]=function(_0xecbfed){return function(_0x30a3ea,_0x3166bb){var _0x49505e,_0x1a5fd2;var _0x2d867f=_[_0x031f('0x5f')](_0xecbfed);var _0x8290bf=_0xecbfed==='chat'?_0x031f('0x60'):'Account';return db[_0x2d867f+'Queue'][_0x031f('0x61')]({'raw':!![],'where':{'id':_0x30a3ea[_0x031f('0x1a')]['id']}})['then'](function(_0x510bb6){if(_[_0x031f('0x12')](_0x510bb6)){throw new Error(_0x2d867f+_0x031f('0x62'));}_0x49505e=_0x510bb6;return db[_0x2d867f+_0x031f('0x63')][_0x031f('0x61')]({'where':{'id':_0x30a3ea[_0x031f('0x1f')][_0x031f('0x64')]},'include':[{'model':db[_0x2d867f+'Interaction'],'as':_0x031f('0x65')},{'model':db[_0x2d867f+_0x8290bf],'as':_0x031f('0x66')}]});})['then'](function(_0x25ea89){if(_[_0x031f('0x12')](_0x25ea89)){throw new Error(_0x2d867f+_0x031f('0x67'));}_0x1a5fd2=_0x25ea89;return _0x25ea89[_0x031f('0x68')]({'read':0x0,'readAt':null,'UserId':null});})[_0x031f('0x8')](function(){var _0x20a8c6={'uniqueid':_0xecbfed+'.'+_0x1a5fd2['id']+'.'+_0x1a5fd2[_0x031f('0x65')]['id'],'FromUserId':_0x30a3ea['user']['id'],'type':_0x031f('0x69')};_0x20a8c6[_0x2d867f+'MessageId']=_0x1a5fd2['id'];_0x20a8c6[_0x2d867f+_0x031f('0x6a')]=_0x1a5fd2[_0x031f('0x65')]['id'];_0x20a8c6[_0x031f('0x6b')+_0x2d867f+_0x8290bf+'Id']=_0x1a5fd2['Account']['id'];_0x20a8c6['To'+_0x2d867f+'QueueId']=_0x49505e['id'];return db[_0x2d867f+'TransferReport'][_0x031f('0x6c')](_0x20a8c6);})[_0x031f('0x8')](function(){return respondWithRpcPromise(_0x031f('0x6d'),{'channel':_0xecbfed,'interaction':_0x1a5fd2[_0x031f('0x65')],'message':_0x1a5fd2,'account':_0x1a5fd2[_0x031f('0x66')],'applications':[{'id':0x0,'priority':0x1,'app':_0x031f('0x69'),'appdata':_0x49505e[_0x031f('0x10')]+','+(_0x1a5fd2['Account']['queueTransferTimeout']||0x12c),'interval':_0x031f('0x6e')}]},routingClient);})[_0x031f('0x8')](respondWithResult(_0x3166bb,null))['catch'](handleError(_0x3166bb,null));};};exports[_0x031f('0x6f')]=function(_0x4afad0,_0x1c31d5){var _0x20d85a,_0x5a6db6;if(_[_0x031f('0x12')](_0x4afad0[_0x031f('0x1f')]['channel'])){throw new Error(_0x031f('0x70'));}var _0x3c7dee=_0x4afad0[_0x031f('0x1f')]['channel'];var _0xa9b5e2=_[_0x031f('0x5f')](_0x3c7dee);var _0x1f6f71=_0x3c7dee===_0x031f('0x71')?_0x031f('0x60'):_0x031f('0x66');return db['User'][_0x031f('0x61')]({'raw':!![],'where':{'id':_0x4afad0[_0x031f('0x1a')]['id'],'role':_0x031f('0x72')}})[_0x031f('0x8')](function(_0x4ef395){if(_[_0x031f('0x12')](_0x4ef395)){throw new Error(_0x031f('0x73'));}_0x20d85a=_0x4ef395;return db[_0xa9b5e2+'Message'][_0x031f('0x61')]({'where':{'id':_0x4afad0[_0x031f('0x1f')][_0x031f('0x64')]},'include':[{'model':db[_0xa9b5e2+_0x031f('0x65')],'as':_0x031f('0x65')},{'model':db[_0xa9b5e2+_0x1f6f71],'as':_0x031f('0x66')}]});})[_0x031f('0x8')](function(_0xb35eef){if(_[_0x031f('0x12')](_0xb35eef)){throw new Error(_0xa9b5e2+_0x031f('0x67'));}_0x5a6db6=_0xb35eef;return _0xb35eef[_0x031f('0x68')]({'read':0x0,'readAt':null,'UserId':null});})[_0x031f('0x8')](function(){var _0x4b077c={'uniqueid':_0x3c7dee+'.'+_0x5a6db6['id']+'.'+_0x5a6db6[_0x031f('0x65')]['id'],'FromUserId':_0x4afad0[_0x031f('0x31')]['id'],'type':'queue','ToUserId':_0x20d85a['id']};_0x4b077c[_0xa9b5e2+_0x031f('0x74')]=_0x5a6db6['id'];_0x4b077c[_0xa9b5e2+_0x031f('0x6a')]=_0x5a6db6[_0x031f('0x65')]['id'];_0x4b077c[_0x031f('0x6b')+_0xa9b5e2+_0x1f6f71+'Id']=_0x5a6db6[_0x031f('0x66')]['id'];return db[_0xa9b5e2+_0x031f('0x75')]['create'](_0x4b077c);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x3c7dee,'interaction':_0x5a6db6[_0x031f('0x65')],'message':_0x5a6db6,'account':_0x5a6db6[_0x031f('0x66')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20d85a[_0x031f('0x10')]+','+(_0x5a6db6[_0x031f('0x66')][_0x031f('0x76')]||0x12c),'interval':_0x031f('0x6e')}]},routingClient);})['then'](respondWithResult(_0x1c31d5,null))[_0x031f('0xd')](handleError(_0x1c31d5,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index fd105c6..52394b5 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 _0x223d=['delete','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','create','put'];(function(_0x5cafb8,_0x208df9){var _0x5ccca6=function(_0x27cdb6){while(--_0x27cdb6){_0x5cafb8['push'](_0x5cafb8['shift']());}};_0x5ccca6(++_0x208df9);}(_0x223d,0xd2));var _0xd223=function(_0x550350,_0x4cb095){_0x550350=_0x550350-0x0;var _0x1e7082=_0x223d[_0x550350];return _0x1e7082;};'use strict';var multer=require('multer');var util=require(_0xd223('0x0'));var path=require(_0xd223('0x1'));var timeout=require(_0xd223('0x2'));var express=require(_0xd223('0x3'));var router=express[_0xd223('0x4')]();var fs_extra=require(_0xd223('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd223('0x6'));var controller=require(_0xd223('0x7'));router[_0xd223('0x8')]('/',auth[_0xd223('0x9')](),controller[_0xd223('0xa')]);router[_0xd223('0x8')](_0xd223('0xb'),auth[_0xd223('0x9')](),controller[_0xd223('0xc')]);router[_0xd223('0x8')](_0xd223('0xd'),auth[_0xd223('0x9')](),controller[_0xd223('0xe')]);router[_0xd223('0xf')]('/',auth[_0xd223('0x9')](),controller[_0xd223('0x10')]);router[_0xd223('0x11')](_0xd223('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xd223('0x12')](_0xd223('0xb'),auth[_0xd223('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x72c0=['create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','/:id','show','/:id/run','run'];(function(_0xd4365c,_0x176595){var _0x538f83=function(_0x47670e){while(--_0x47670e){_0xd4365c['push'](_0xd4365c['shift']());}};_0x538f83(++_0x176595);}(_0x72c0,0xcc));var _0x072c=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x72c0[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x072c('0x0'));var util=require(_0x072c('0x1'));var path=require(_0x072c('0x2'));var timeout=require(_0x072c('0x3'));var express=require(_0x072c('0x4'));var router=express[_0x072c('0x5')]();var fs_extra=require(_0x072c('0x6'));var auth=require(_0x072c('0x7'));var interaction=require(_0x072c('0x8'));var config=require('../../config/environment');var controller=require(_0x072c('0x9'));router[_0x072c('0xa')]('/',auth[_0x072c('0xb')](),controller['index']);router[_0x072c('0xa')](_0x072c('0xc'),auth[_0x072c('0xb')](),controller[_0x072c('0xd')]);router['get'](_0x072c('0xe'),auth[_0x072c('0xb')](),controller[_0x072c('0xf')]);router['post']('/',auth[_0x072c('0xb')](),controller[_0x072c('0x10')]);router[_0x072c('0x11')]('/:id',auth[_0x072c('0xb')](),controller[_0x072c('0x12')]);router['delete'](_0x072c('0xc'),auth[_0x072c('0xb')](),controller['destroy']);module[_0x072c('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 6464a3f..9f8cea1 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 _0x48be=['custom','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','months','weeks','days','hours','csv','pdf','xlsx'];(function(_0x1979eb,_0x5b374e){var _0x136002=function(_0x22f9a0){while(--_0x22f9a0){_0x1979eb['push'](_0x1979eb['shift']());}};_0x136002(++_0x5b374e);}(_0x48be,0xd2));var _0xe48b=function(_0x2944b2,_0x4eadb6){_0x2944b2=_0x2944b2-0x0;var _0x3ccbf7=_0x48be[_0x2944b2];return _0x3ccbf7;};'use strict';var Sequelize=require('sequelize');module[_0xe48b('0x0')]={'name':{'type':Sequelize[_0xe48b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe48b('0x1')]},'active':{'type':Sequelize[_0xe48b('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe48b('0x1')],'allowNull':![],'defaultValue':_0xe48b('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xe48b('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xe48b('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xe48b('0x6')]('years','quarters',_0xe48b('0x7'),_0xe48b('0x8'),_0xe48b('0x9'),_0xe48b('0xa'),'minutes'),'allowNull':![],'defaultValue':_0xe48b('0x9')},'output':{'type':Sequelize['ENUM'](_0xe48b('0xb'),_0xe48b('0xc'),_0xe48b('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0xe48b('0xe'),'default'),'allowNull':![],'defaultValue':_0xe48b('0xe')},'sendMail':{'type':Sequelize[_0xe48b('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xe48b('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xe48b('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa1e0=['months','weeks','hours','minutes','days','csv','ENUM','custom','default','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','quarters'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa1e0,0x11a));var _0x0a1e=function(_0x5872ca,_0x1da63d){_0x5872ca=_0x5872ca-0x0;var _0x5ec827=_0xa1e0[_0x5872ca];return _0x5ec827;};'use strict';var Sequelize=require(_0x0a1e('0x0'));module['exports']={'name':{'type':Sequelize[_0x0a1e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0a1e('0x1')]},'active':{'type':Sequelize[_0x0a1e('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x0a1e('0x1')],'allowNull':![],'defaultValue':_0x0a1e('0x3')},'startAt':{'type':Sequelize[_0x0a1e('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x0a1e('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0x0a1e('0x5'),_0x0a1e('0x6'),_0x0a1e('0x7'),'days',_0x0a1e('0x8'),_0x0a1e('0x9')),'allowNull':![],'defaultValue':_0x0a1e('0xa')},'output':{'type':Sequelize['ENUM'](_0x0a1e('0xb'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x0a1e('0xc')](_0x0a1e('0xd'),_0x0a1e('0xe')),'allowNull':![],'defaultValue':_0x0a1e('0xd')},'sendMail':{'type':Sequelize[_0x0a1e('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x0a1e('0xf')]},'bcc':{'type':Sequelize[_0x0a1e('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x0a1e('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index df2a06a..b4c056f 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 _0x3c15=['include','findAll','rows','show','params','includeAll','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','status','send','map','Schedule','rawAttributes','fieldName','type','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x3c15,0x66));var _0x53c1=function(_0x1753e0,_0x32ccd4){_0x1753e0=_0x1753e0-0x0;var _0xc9f908=_0x3c15[_0x1753e0];return _0xc9f908;};'use strict';var emlformat=require(_0x53c1('0x0'));var rimraf=require(_0x53c1('0x1'));var zipdir=require(_0x53c1('0x2'));var jsonpatch=require(_0x53c1('0x3'));var rp=require(_0x53c1('0x4'));var moment=require(_0x53c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x53c1('0x6'));var util=require(_0x53c1('0x7'));var path=require(_0x53c1('0x8'));var sox=require(_0x53c1('0x9'));var csv=require(_0x53c1('0xa'));var ejs=require(_0x53c1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x53c1('0xc'));var crypto=require(_0x53c1('0xd'));var jsforce=require(_0x53c1('0xe'));var deskjs=require(_0x53c1('0xf'));var toCsv=require(_0x53c1('0xa'));var querystring=require(_0x53c1('0x10'));var Papa=require(_0x53c1('0x11'));var Redis=require('ioredis');var authService=require(_0x53c1('0x12'));var qs=require(_0x53c1('0x13'));var as=require(_0x53c1('0x14'));var hardwareService=require(_0x53c1('0x15'));var logger=require(_0x53c1('0x16'))('api');var utils=require(_0x53c1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x53c1('0x18'));var db=require(_0x53c1('0x19'))['db'];function respondWithStatusCode(_0x3c7260,_0x489e08){_0x489e08=_0x489e08||0xcc;return function(_0x394541){if(_0x394541){return _0x3c7260[_0x53c1('0x1a')](_0x489e08);}return _0x3c7260['status'](_0x489e08)[_0x53c1('0x1b')]();};}function respondWithResult(_0x46c7e8,_0x2e91cb){_0x2e91cb=_0x2e91cb||0xc8;return function(_0x5c10a3){if(_0x5c10a3){return _0x46c7e8['status'](_0x2e91cb)[_0x53c1('0x1c')](_0x5c10a3);}};}function respondWithFilteredResult(_0x7368c1,_0x3bf537){return function(_0x2ffcdb){if(_0x2ffcdb){var _0x2976f8=typeof _0x3bf537[_0x53c1('0x1d')]===_0x53c1('0x1e')&&typeof _0x3bf537['limit']===_0x53c1('0x1e');var _0x452eb6=_0x2ffcdb[_0x53c1('0x1f')];var _0x25cbec=_0x2976f8?0x0:_0x3bf537[_0x53c1('0x1d')];var _0x504af0=_0x2976f8?_0x2ffcdb[_0x53c1('0x1f')]:_0x3bf537[_0x53c1('0x1d')]+_0x3bf537[_0x53c1('0x20')];var _0x3883bd;if(_0x504af0>=_0x452eb6){_0x504af0=_0x452eb6;_0x3883bd=0xc8;}else{_0x3883bd=0xce;}_0x7368c1['status'](_0x3883bd);return _0x7368c1[_0x53c1('0x21')](_0x53c1('0x22'),_0x25cbec+'-'+_0x504af0+'/'+_0x452eb6)[_0x53c1('0x1c')](_0x2ffcdb);}return null;};}function patchUpdates(_0xbb2830){return function(_0x596b6b){try{jsonpatch[_0x53c1('0x23')](_0x596b6b,_0xbb2830,!![]);}catch(_0x434f28){return BPromise[_0x53c1('0x24')](_0x434f28);}return _0x596b6b[_0x53c1('0x25')]();};}function saveUpdates(_0x4b1361,_0xbd23b1){return function(_0x946179){if(_0x946179){return _0x946179[_0x53c1('0x26')](_0x4b1361)[_0x53c1('0x27')](function(_0x1cc558){return _0x1cc558;});}return null;};}function removeEntity(_0x5013f4,_0x696bbe){return function(_0x2760d3){if(_0x2760d3){return _0x2760d3[_0x53c1('0x28')]()[_0x53c1('0x27')](function(){var _0x1fcf04=_0x2760d3[_0x53c1('0x29')]({'plain':!![]});var _0x2f66fc=_0x53c1('0x2a');return db[_0x53c1('0x2b')][_0x53c1('0x28')]({'where':{'type':_0x2f66fc,'resourceId':_0x1fcf04['id']}})[_0x53c1('0x27')](function(){return _0x2760d3;});})['then'](function(){_0x5013f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16252f,_0x49400f){return function(_0x33ea53){if(!_0x33ea53){_0x16252f['sendStatus'](0x194);}return _0x33ea53;};}function handleError(_0x1c774c,_0xf9c236){_0xf9c236=_0xf9c236||0x1f4;return function(_0x2f1291){logger[_0x53c1('0x2c')](_0x2f1291[_0x53c1('0x2d')]);if(_0x2f1291[_0x53c1('0x2e')]){delete _0x2f1291[_0x53c1('0x2e')];}_0x1c774c[_0x53c1('0x2f')](_0xf9c236)[_0x53c1('0x30')](_0x2f1291);};}exports['index']=function(_0x335128,_0x599e39){var _0x385dcf={},_0x1a507d={},_0x4fa514={'count':0x0,'rows':[]};var _0x5ed988=_[_0x53c1('0x31')](db[_0x53c1('0x32')][_0x53c1('0x33')],function(_0x4b4dee){return{'name':_0x4b4dee[_0x53c1('0x34')],'type':_0x4b4dee[_0x53c1('0x35')][_0x53c1('0x36')]};});_0x1a507d[_0x53c1('0x37')]=_[_0x53c1('0x31')](_0x5ed988,_0x53c1('0x2e'));_0x1a507d['query']=_[_0x53c1('0x38')](_0x335128['query']);_0x1a507d['filters']=_[_0x53c1('0x39')](_0x1a507d[_0x53c1('0x37')],_0x1a507d[_0x53c1('0x3a')]);_0x385dcf['attributes']=_[_0x53c1('0x39')](_0x1a507d[_0x53c1('0x37')],qs[_0x53c1('0x3b')](_0x335128[_0x53c1('0x3a')][_0x53c1('0x3b')]));_0x385dcf['attributes']=_0x385dcf[_0x53c1('0x3c')][_0x53c1('0x3d')]?_0x385dcf[_0x53c1('0x3c')]:_0x1a507d[_0x53c1('0x37')];if(!_0x335128[_0x53c1('0x3a')][_0x53c1('0x3e')]('nolimit')){_0x385dcf[_0x53c1('0x20')]=qs[_0x53c1('0x20')](_0x335128[_0x53c1('0x3a')][_0x53c1('0x20')]);_0x385dcf[_0x53c1('0x1d')]=qs[_0x53c1('0x1d')](_0x335128[_0x53c1('0x3a')][_0x53c1('0x1d')]);}_0x385dcf[_0x53c1('0x3f')]=qs[_0x53c1('0x40')](_0x335128[_0x53c1('0x3a')][_0x53c1('0x40')]);_0x385dcf[_0x53c1('0x41')]=qs[_0x53c1('0x42')](_[_0x53c1('0x43')](_0x335128[_0x53c1('0x3a')],_0x1a507d['filters']),_0x5ed988);if(_0x335128['query'][_0x53c1('0x44')]){_0x385dcf['where']=_['merge'](_0x385dcf[_0x53c1('0x41')],{'$or':_[_0x53c1('0x31')](_0x5ed988,function(_0x393988){if(_0x393988[_0x53c1('0x35')]!==_0x53c1('0x45')){var _0x2b0690={};_0x2b0690[_0x393988['name']]={'$like':'%'+_0x335128[_0x53c1('0x3a')][_0x53c1('0x44')]+'%'};return _0x2b0690;}})});}_0x385dcf=_[_0x53c1('0x46')]({},_0x385dcf,_0x335128[_0x53c1('0x47')]);var _0x4772e8={'where':_0x385dcf[_0x53c1('0x41')]};return db[_0x53c1('0x32')]['count'](_0x4772e8)[_0x53c1('0x27')](function(_0x1e806f){_0x4fa514[_0x53c1('0x1f')]=_0x1e806f;if(_0x335128['query']['includeAll']){_0x385dcf[_0x53c1('0x48')]=[{'all':!![]}];}return db[_0x53c1('0x32')][_0x53c1('0x49')](_0x385dcf);})[_0x53c1('0x27')](function(_0x1a61dd){_0x4fa514[_0x53c1('0x4a')]=_0x1a61dd;return _0x4fa514;})[_0x53c1('0x27')](respondWithFilteredResult(_0x599e39,_0x385dcf))['catch'](handleError(_0x599e39,null));};exports[_0x53c1('0x4b')]=function(_0x511681,_0x4bdf49){var _0x507873={'raw':![],'where':{'id':_0x511681[_0x53c1('0x4c')]['id']}},_0x3dbf7e={};_0x3dbf7e['model']=_[_0x53c1('0x38')](db['Schedule'][_0x53c1('0x33')]);_0x3dbf7e['query']=_[_0x53c1('0x38')](_0x511681[_0x53c1('0x3a')]);_0x3dbf7e[_0x53c1('0x42')]=_[_0x53c1('0x39')](_0x3dbf7e[_0x53c1('0x37')],_0x3dbf7e[_0x53c1('0x3a')]);_0x507873[_0x53c1('0x3c')]=_['intersection'](_0x3dbf7e[_0x53c1('0x37')],qs[_0x53c1('0x3b')](_0x511681[_0x53c1('0x3a')][_0x53c1('0x3b')]));_0x507873[_0x53c1('0x3c')]=_0x507873[_0x53c1('0x3c')]['length']?_0x507873[_0x53c1('0x3c')]:_0x3dbf7e['model'];if(_0x511681['query'][_0x53c1('0x4d')]){_0x507873[_0x53c1('0x48')]=[{'all':!![]}];}_0x507873=_[_0x53c1('0x46')]({},_0x507873,_0x511681[_0x53c1('0x47')]);return db[_0x53c1('0x32')][_0x53c1('0x4e')](_0x507873)[_0x53c1('0x27')](handleEntityNotFound(_0x4bdf49,null))['then'](respondWithResult(_0x4bdf49,null))[_0x53c1('0x4f')](handleError(_0x4bdf49,null));};exports['create']=function(_0xfba407,_0x22ef04){return db[_0x53c1('0x32')]['create'](_0xfba407[_0x53c1('0x50')],{})[_0x53c1('0x27')](function(_0x3abf1b){var _0x40af9f=_0xfba407[_0x53c1('0x51')][_0x53c1('0x29')]({'plain':!![]});if(!_0x40af9f)throw new Error(_0x53c1('0x52'));if(_0x40af9f['role']===_0x53c1('0x51')){var _0x3daaa8=_0x3abf1b[_0x53c1('0x29')]({'plain':!![]});var _0x18a347=_0x53c1('0x2a');return db['UserProfileSection'][_0x53c1('0x4e')]({'where':{'name':_0x18a347,'userProfileId':_0x40af9f['userProfileId']},'raw':!![]})['then'](function(_0x160785){if(_0x160785&&_0x160785[_0x53c1('0x53')]===0x0){return db[_0x53c1('0x2b')][_0x53c1('0x54')]({'name':_0x3daaa8['name'],'resourceId':_0x3daaa8['id'],'type':_0x160785[_0x53c1('0x2e')],'sectionId':_0x160785['id']},{})['then'](function(){return _0x3abf1b;});}else{return _0x3abf1b;}})[_0x53c1('0x4f')](function(_0x10f896){logger['error'](_0x53c1('0x55'),_0x10f896);throw _0x10f896;});}return _0x3abf1b;})[_0x53c1('0x27')](respondWithResult(_0x22ef04,0xc9))['catch'](handleError(_0x22ef04,null));};exports[_0x53c1('0x26')]=function(_0x53d5d6,_0x55463d){if(_0x53d5d6[_0x53c1('0x50')]['id']){delete _0x53d5d6[_0x53c1('0x50')]['id'];}return db['Schedule'][_0x53c1('0x4e')]({'where':{'id':_0x53d5d6['params']['id']}})[_0x53c1('0x27')](handleEntityNotFound(_0x55463d,null))['then'](saveUpdates(_0x53d5d6['body'],null))['then'](respondWithResult(_0x55463d,null))['catch'](handleError(_0x55463d,null));};exports[_0x53c1('0x28')]=function(_0xbb0ac0,_0x461f34){return db[_0x53c1('0x32')][_0x53c1('0x4e')]({'where':{'id':_0xbb0ac0[_0x53c1('0x4c')]['id']}})[_0x53c1('0x27')](handleEntityNotFound(_0x461f34,null))['then'](removeEntity(_0x461f34,null))[_0x53c1('0x4f')](handleError(_0x461f34,null));};exports[_0x53c1('0x56')]=function(_0x1f0bfe,_0x5534f0,_0x3912bd){var _0x1db49d=require('../../config/schedule');return db[_0x53c1('0x32')]['find']({'where':{'id':_0x1f0bfe[_0x53c1('0x4c')]['id']},'raw':!![]})[_0x53c1('0x27')](handleEntityNotFound(_0x5534f0,null))[_0x53c1('0x27')](function(){_0x1db49d['run'](_0x1f0bfe[_0x53c1('0x4c')]['id']);})[_0x53c1('0x27')](respondWithStatusCode(_0x5534f0,null))['catch'](handleError(_0x5534f0,null));}; \ No newline at end of file +var _0x44d3=['apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','map','rawAttributes','type','key','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','Schedule','count','include','findAll','catch','params','model','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','run','../../config/schedule','eml-format','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range'];(function(_0x244862,_0x3da79e){var _0x2bce23=function(_0x235ae5){while(--_0x235ae5){_0x244862['push'](_0x244862['shift']());}};_0x2bce23(++_0x3da79e);}(_0x44d3,0x125));var _0x344d=function(_0x376103,_0x55c2c1){_0x376103=_0x376103-0x0;var _0x104cdd=_0x44d3[_0x376103];return _0x104cdd;};'use strict';var emlformat=require(_0x344d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x344d('0x1'));var moment=require('moment');var BPromise=require(_0x344d('0x2'));var Mustache=require(_0x344d('0x3'));var util=require('util');var path=require(_0x344d('0x4'));var sox=require(_0x344d('0x5'));var csv=require(_0x344d('0x6'));var ejs=require(_0x344d('0x7'));var fs=require('fs');var fs_extra=require(_0x344d('0x8'));var _=require(_0x344d('0x9'));var squel=require(_0x344d('0xa'));var crypto=require(_0x344d('0xb'));var jsforce=require(_0x344d('0xc'));var deskjs=require(_0x344d('0xd'));var toCsv=require(_0x344d('0x6'));var querystring=require('querystring');var Papa=require(_0x344d('0xe'));var Redis=require(_0x344d('0xf'));var authService=require(_0x344d('0x10'));var qs=require(_0x344d('0x11'));var as=require(_0x344d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x344d('0x13'));var utils=require(_0x344d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x344d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c2380,_0xb947b){_0xb947b=_0xb947b||0xcc;return function(_0xddb6f1){if(_0xddb6f1){return _0x3c2380[_0x344d('0x16')](_0xb947b);}return _0x3c2380[_0x344d('0x17')](_0xb947b)[_0x344d('0x18')]();};}function respondWithResult(_0x35e83c,_0x31cc85){_0x31cc85=_0x31cc85||0xc8;return function(_0x5fd3c9){if(_0x5fd3c9){return _0x35e83c[_0x344d('0x17')](_0x31cc85)[_0x344d('0x19')](_0x5fd3c9);}};}function respondWithFilteredResult(_0x4c1e7b,_0x41e9c2){return function(_0x449899){if(_0x449899){var _0xb85465=typeof _0x41e9c2[_0x344d('0x1a')]==='undefined'&&typeof _0x41e9c2[_0x344d('0x1b')]===_0x344d('0x1c');var _0x1a0e21=_0x449899['count'];var _0x2bf28d=_0xb85465?0x0:_0x41e9c2['offset'];var _0x31c410=_0xb85465?_0x449899['count']:_0x41e9c2[_0x344d('0x1a')]+_0x41e9c2[_0x344d('0x1b')];var _0x46ac5e;if(_0x31c410>=_0x1a0e21){_0x31c410=_0x1a0e21;_0x46ac5e=0xc8;}else{_0x46ac5e=0xce;}_0x4c1e7b[_0x344d('0x17')](_0x46ac5e);return _0x4c1e7b[_0x344d('0x1d')](_0x344d('0x1e'),_0x2bf28d+'-'+_0x31c410+'/'+_0x1a0e21)[_0x344d('0x19')](_0x449899);}return null;};}function patchUpdates(_0xdd8d0a){return function(_0x1178f8){try{jsonpatch[_0x344d('0x1f')](_0x1178f8,_0xdd8d0a,!![]);}catch(_0x15d820){return BPromise[_0x344d('0x20')](_0x15d820);}return _0x1178f8[_0x344d('0x21')]();};}function saveUpdates(_0x260599,_0x14a8a0){return function(_0x4a84c9){if(_0x4a84c9){return _0x4a84c9[_0x344d('0x22')](_0x260599)[_0x344d('0x23')](function(_0x166876){return _0x166876;});}return null;};}function removeEntity(_0x52fa41,_0x5ee761){return function(_0x1d581a){if(_0x1d581a){return _0x1d581a[_0x344d('0x24')]()[_0x344d('0x23')](function(){var _0x43cd3e=_0x1d581a[_0x344d('0x25')]({'plain':!![]});var _0x39884a=_0x344d('0x26');return db[_0x344d('0x27')][_0x344d('0x24')]({'where':{'type':_0x39884a,'resourceId':_0x43cd3e['id']}})[_0x344d('0x23')](function(){return _0x1d581a;});})[_0x344d('0x23')](function(){_0x52fa41[_0x344d('0x17')](0xcc)[_0x344d('0x18')]();});}};}function handleEntityNotFound(_0xaa05d6,_0x2648a9){return function(_0x2b5c39){if(!_0x2b5c39){_0xaa05d6['sendStatus'](0x194);}return _0x2b5c39;};}function handleError(_0x4b2316,_0x13c476){_0x13c476=_0x13c476||0x1f4;return function(_0x418278){logger[_0x344d('0x28')](_0x418278[_0x344d('0x29')]);if(_0x418278['name']){delete _0x418278[_0x344d('0x2a')];}_0x4b2316[_0x344d('0x17')](_0x13c476)[_0x344d('0x2b')](_0x418278);};}exports['index']=function(_0x52ef07,_0x134873){var _0x10515d={},_0x55646a={},_0x7ea5e1={'count':0x0,'rows':[]};var _0xae5ac4=_[_0x344d('0x2c')](db['Schedule'][_0x344d('0x2d')],function(_0x532212){return{'name':_0x532212['fieldName'],'type':_0x532212[_0x344d('0x2e')][_0x344d('0x2f')]};});_0x55646a['model']=_[_0x344d('0x2c')](_0xae5ac4,'name');_0x55646a[_0x344d('0x30')]=_[_0x344d('0x31')](_0x52ef07[_0x344d('0x30')]);_0x55646a['filters']=_[_0x344d('0x32')](_0x55646a['model'],_0x55646a[_0x344d('0x30')]);_0x10515d[_0x344d('0x33')]=_['intersection'](_0x55646a['model'],qs[_0x344d('0x34')](_0x52ef07[_0x344d('0x30')]['fields']));_0x10515d[_0x344d('0x33')]=_0x10515d['attributes']['length']?_0x10515d[_0x344d('0x33')]:_0x55646a['model'];if(!_0x52ef07[_0x344d('0x30')][_0x344d('0x35')](_0x344d('0x36'))){_0x10515d[_0x344d('0x1b')]=qs[_0x344d('0x1b')](_0x52ef07[_0x344d('0x30')][_0x344d('0x1b')]);_0x10515d['offset']=qs[_0x344d('0x1a')](_0x52ef07[_0x344d('0x30')][_0x344d('0x1a')]);}_0x10515d[_0x344d('0x37')]=qs[_0x344d('0x38')](_0x52ef07['query']['sort']);_0x10515d[_0x344d('0x39')]=qs[_0x344d('0x3a')](_['pick'](_0x52ef07[_0x344d('0x30')],_0x55646a[_0x344d('0x3a')]),_0xae5ac4);if(_0x52ef07[_0x344d('0x30')][_0x344d('0x3b')]){_0x10515d[_0x344d('0x39')]=_[_0x344d('0x3c')](_0x10515d['where'],{'$or':_['map'](_0xae5ac4,function(_0x375bdf){if(_0x375bdf[_0x344d('0x2e')]!==_0x344d('0x3d')){var _0x4b095e={};_0x4b095e[_0x375bdf['name']]={'$like':'%'+_0x52ef07[_0x344d('0x30')][_0x344d('0x3b')]+'%'};return _0x4b095e;}})});}_0x10515d=_['merge']({},_0x10515d,_0x52ef07['options']);var _0x2a059c={'where':_0x10515d[_0x344d('0x39')]};return db[_0x344d('0x3e')][_0x344d('0x3f')](_0x2a059c)[_0x344d('0x23')](function(_0x1c9fa9){_0x7ea5e1[_0x344d('0x3f')]=_0x1c9fa9;if(_0x52ef07['query']['includeAll']){_0x10515d[_0x344d('0x40')]=[{'all':!![]}];}return db[_0x344d('0x3e')][_0x344d('0x41')](_0x10515d);})[_0x344d('0x23')](function(_0x2bd93d){_0x7ea5e1['rows']=_0x2bd93d;return _0x7ea5e1;})[_0x344d('0x23')](respondWithFilteredResult(_0x134873,_0x10515d))[_0x344d('0x42')](handleError(_0x134873,null));};exports['show']=function(_0x53c628,_0x275406){var _0x294ba6={'raw':![],'where':{'id':_0x53c628[_0x344d('0x43')]['id']}},_0x43c8b8={};_0x43c8b8[_0x344d('0x44')]=_[_0x344d('0x31')](db[_0x344d('0x3e')][_0x344d('0x2d')]);_0x43c8b8[_0x344d('0x30')]=_['keys'](_0x53c628[_0x344d('0x30')]);_0x43c8b8['filters']=_[_0x344d('0x32')](_0x43c8b8[_0x344d('0x44')],_0x43c8b8[_0x344d('0x30')]);_0x294ba6[_0x344d('0x33')]=_[_0x344d('0x32')](_0x43c8b8[_0x344d('0x44')],qs[_0x344d('0x34')](_0x53c628[_0x344d('0x30')][_0x344d('0x34')]));_0x294ba6['attributes']=_0x294ba6[_0x344d('0x33')]['length']?_0x294ba6['attributes']:_0x43c8b8[_0x344d('0x44')];if(_0x53c628[_0x344d('0x30')]['includeAll']){_0x294ba6[_0x344d('0x40')]=[{'all':!![]}];}_0x294ba6=_[_0x344d('0x3c')]({},_0x294ba6,_0x53c628[_0x344d('0x45')]);return db['Schedule'][_0x344d('0x46')](_0x294ba6)['then'](handleEntityNotFound(_0x275406,null))[_0x344d('0x23')](respondWithResult(_0x275406,null))['catch'](handleError(_0x275406,null));};exports[_0x344d('0x47')]=function(_0x3a0a98,_0x488ef1){return db['Schedule'][_0x344d('0x47')](_0x3a0a98[_0x344d('0x48')],{})[_0x344d('0x23')](function(_0x5519d1){var _0x11b6f8=_0x3a0a98[_0x344d('0x49')][_0x344d('0x25')]({'plain':!![]});if(!_0x11b6f8)throw new Error(_0x344d('0x4a'));if(_0x11b6f8[_0x344d('0x4b')]==='user'){var _0x54aab1=_0x5519d1[_0x344d('0x25')]({'plain':!![]});var _0x972eae=_0x344d('0x26');return db[_0x344d('0x4c')][_0x344d('0x46')]({'where':{'name':_0x972eae,'userProfileId':_0x11b6f8[_0x344d('0x4d')]},'raw':!![]})[_0x344d('0x23')](function(_0x3c5efa){if(_0x3c5efa&&_0x3c5efa[_0x344d('0x4e')]===0x0){return db[_0x344d('0x27')][_0x344d('0x47')]({'name':_0x54aab1[_0x344d('0x2a')],'resourceId':_0x54aab1['id'],'type':_0x3c5efa['name'],'sectionId':_0x3c5efa['id']},{})[_0x344d('0x23')](function(){return _0x5519d1;});}else{return _0x5519d1;}})[_0x344d('0x42')](function(_0x1bf4e0){logger[_0x344d('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bf4e0);throw _0x1bf4e0;});}return _0x5519d1;})['then'](respondWithResult(_0x488ef1,0xc9))[_0x344d('0x42')](handleError(_0x488ef1,null));};exports['update']=function(_0xa7972f,_0x2d4e49){if(_0xa7972f[_0x344d('0x48')]['id']){delete _0xa7972f[_0x344d('0x48')]['id'];}return db[_0x344d('0x3e')]['find']({'where':{'id':_0xa7972f[_0x344d('0x43')]['id']}})[_0x344d('0x23')](handleEntityNotFound(_0x2d4e49,null))[_0x344d('0x23')](saveUpdates(_0xa7972f['body'],null))[_0x344d('0x23')](respondWithResult(_0x2d4e49,null))['catch'](handleError(_0x2d4e49,null));};exports[_0x344d('0x24')]=function(_0x1b37fe,_0x60ca21){return db[_0x344d('0x3e')][_0x344d('0x46')]({'where':{'id':_0x1b37fe[_0x344d('0x43')]['id']}})[_0x344d('0x23')](handleEntityNotFound(_0x60ca21,null))[_0x344d('0x23')](removeEntity(_0x60ca21,null))[_0x344d('0x42')](handleError(_0x60ca21,null));};exports[_0x344d('0x4f')]=function(_0x1c497c,_0x3aff99,_0x2a92f3){var _0x27ef87=require(_0x344d('0x50'));return db[_0x344d('0x3e')][_0x344d('0x46')]({'where':{'id':_0x1c497c['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3aff99,null))['then'](function(){_0x27ef87[_0x344d('0x4f')](_0x1c497c['params']['id']);})[_0x344d('0x23')](respondWithStatusCode(_0x3aff99,null))['catch'](handleError(_0x3aff99,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 006d848..0c6fbaf 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 _0x6ea6=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','lodash','../../config/logger'];(function(_0x54496d,_0x5b8572){var _0x40e626=function(_0xb6475c){while(--_0xb6475c){_0x54496d['push'](_0x54496d['shift']());}};_0x40e626(++_0x5b8572);}(_0x6ea6,0xf8));var _0x66ea=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0x6ea6[_0x5179a5];return _0x15c8ce;};'use strict';var _=require(_0x66ea('0x0'));var util=require('util');var logger=require(_0x66ea('0x1'))(_0x66ea('0x2'));var moment=require(_0x66ea('0x3'));var BPromise=require(_0x66ea('0x4'));var rp=require(_0x66ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66ea('0x6'));var config=require(_0x66ea('0x7'));var attributes=require('./schedule.attributes');module[_0x66ea('0x8')]=function(_0x12f33f,_0x19f986){return _0x12f33f[_0x66ea('0x9')]('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab4c=['exports','define','tools_schedules','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xab4c,0x121));var _0xcab4=function(_0x4241c6,_0x21977d){_0x4241c6=_0x4241c6-0x0;var _0xca4395=_0xab4c[_0x4241c6];return _0xca4395;};'use strict';var _=require(_0xcab4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcab4('0x1'));var moment=require(_0xcab4('0x2'));var BPromise=require(_0xcab4('0x3'));var rp=require(_0xcab4('0x4'));var fs=require('fs');var path=require(_0xcab4('0x5'));var rimraf=require(_0xcab4('0x6'));var config=require(_0xcab4('0x7'));var attributes=require('./schedule.attributes');module[_0xcab4('0x8')]=function(_0x5d9104,_0x59d01b){return _0x5d9104[_0xcab4('0x9')]('Schedule',attributes,{'tableName':_0xcab4('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 9bbfb23..27af0cf 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 _0xa710=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message','result','catch','util','moment','bluebird'];(function(_0x1b3b96,_0x5c0378){var _0x50f162=function(_0x1f56d6){while(--_0x1f56d6){_0x1b3b96['push'](_0x1b3b96['shift']());}};_0x50f162(++_0x5c0378);}(_0xa710,0x14d));var _0x0a71=function(_0x3b9bb7,_0x4e24df){_0x3b9bb7=_0x3b9bb7-0x0;var _0x4c0b9e=_0xa710[_0x3b9bb7];return _0x4c0b9e;};'use strict';var _=require('lodash');var util=require(_0x0a71('0x0'));var moment=require(_0x0a71('0x1'));var BPromise=require(_0x0a71('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a71('0x3'));var db=require(_0x0a71('0x4'))['db'];var utils=require(_0x0a71('0x5'));var logger=require(_0x0a71('0x6'))(_0x0a71('0x7'));var config=require(_0x0a71('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a71('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17ff7b,_0x597aff,_0x32f170){return new BPromise(function(_0x2cb147,_0x53fafd){return client[_0x0a71('0xa')](_0x17ff7b,_0x32f170)['then'](function(_0x4e96d0){logger[_0x0a71('0xb')]('Schedule,\x20%s,\x20%s',_0x597aff,_0x0a71('0xc'));logger['debug'](_0x0a71('0xd'),_0x597aff,_0x0a71('0xc'),JSON[_0x0a71('0xe')](_0x4e96d0));if(_0x4e96d0[_0x0a71('0xf')]){if(_0x4e96d0[_0x0a71('0xf')][_0x0a71('0x10')]===0x1f4){logger[_0x0a71('0xf')](_0x0a71('0x11'),_0x597aff,_0x4e96d0[_0x0a71('0xf')][_0x0a71('0x12')]);return _0x53fafd(_0x4e96d0[_0x0a71('0xf')][_0x0a71('0x12')]);}logger[_0x0a71('0xf')](_0x0a71('0x11'),_0x597aff,_0x4e96d0['error'][_0x0a71('0x12')]);return _0x2cb147(_0x4e96d0[_0x0a71('0xf')]['message']);}else{logger['info'](_0x0a71('0x11'),_0x597aff,'request\x20sent');_0x2cb147(_0x4e96d0[_0x0a71('0x13')][_0x0a71('0x12')]);}})[_0x0a71('0x14')](function(_0x370b94){logger['error'](_0x0a71('0x11'),_0x597aff,_0x370b94);_0x53fafd(_0x370b94);});});} \ No newline at end of file +var _0x2d2a=['http','request','then','info','request\x20sent','debug','error','code','message','Schedule,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x793366,_0x117316){var _0x28cb8d=function(_0x344f23){while(--_0x344f23){_0x793366['push'](_0x793366['shift']());}};_0x28cb8d(++_0x117316);}(_0x2d2a,0x1f0));var _0xa2d2=function(_0x4ac707,_0x44e1ff){_0x4ac707=_0x4ac707-0x0;var _0x135595=_0x2d2a[_0x4ac707];return _0x135595;};'use strict';var _=require(_0xa2d2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa2d2('0x1'));var rs=require(_0xa2d2('0x2'));var fs=require('fs');var Redis=require(_0xa2d2('0x3'));var db=require(_0xa2d2('0x4'))['db'];var utils=require(_0xa2d2('0x5'));var logger=require(_0xa2d2('0x6'))('rpc');var config=require(_0xa2d2('0x7'));var jayson=require(_0xa2d2('0x8'));var client=jayson[_0xa2d2('0x9')][_0xa2d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a26da,_0xa1dd38,_0x6b359d){return new BPromise(function(_0x31a67b,_0x2f300f){return client[_0xa2d2('0xb')](_0x3a26da,_0x6b359d)[_0xa2d2('0xc')](function(_0x1a1f53){logger[_0xa2d2('0xd')]('Schedule,\x20%s,\x20%s',_0xa1dd38,_0xa2d2('0xe'));logger[_0xa2d2('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0xa1dd38,_0xa2d2('0xe'),JSON['stringify'](_0x1a1f53));if(_0x1a1f53[_0xa2d2('0x10')]){if(_0x1a1f53[_0xa2d2('0x10')][_0xa2d2('0x11')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0xa1dd38,_0x1a1f53[_0xa2d2('0x10')][_0xa2d2('0x12')]);return _0x2f300f(_0x1a1f53[_0xa2d2('0x10')][_0xa2d2('0x12')]);}logger[_0xa2d2('0x10')](_0xa2d2('0x13'),_0xa1dd38,_0x1a1f53[_0xa2d2('0x10')][_0xa2d2('0x12')]);return _0x31a67b(_0x1a1f53['error'][_0xa2d2('0x12')]);}else{logger[_0xa2d2('0xd')](_0xa2d2('0x13'),_0xa1dd38,'request\x20sent');_0x31a67b(_0x1a1f53[_0xa2d2('0x14')][_0xa2d2('0x12')]);}})[_0xa2d2('0x15')](function(_0x4edfa9){logger[_0xa2d2('0x10')](_0xa2d2('0x13'),_0xa1dd38,_0x4edfa9);_0x2f300f(_0x4edfa9);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 7d4dd05..dd73d7a 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 _0x940b=['post','put','/:id','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','/describe','isAuthenticated','show','/:id/download','download'];(function(_0x2676ca,_0x5d11e5){var _0x2bea6c=function(_0x2c2d31){while(--_0x2c2d31){_0x2676ca['push'](_0x2676ca['shift']());}};_0x2bea6c(++_0x5d11e5);}(_0x940b,0x1d2));var _0xb940=function(_0x1f8bca,_0x585fc2){_0x1f8bca=_0x1f8bca-0x0;var _0x2f6093=_0x940b[_0x1f8bca];return _0x2f6093;};'use strict';var multer=require(_0xb940('0x0'));var util=require(_0xb940('0x1'));var path=require(_0xb940('0x2'));var timeout=require(_0xb940('0x3'));var express=require(_0xb940('0x4'));var router=express[_0xb940('0x5')]();var fs_extra=require(_0xb940('0x6'));var auth=require(_0xb940('0x7'));var interaction=require(_0xb940('0x8'));var config=require(_0xb940('0x9'));var controller=require(_0xb940('0xa'));router[_0xb940('0xb')]('/',auth['isAuthenticated'](),controller[_0xb940('0xc')]);router['get'](_0xb940('0xd'),auth[_0xb940('0xe')](),controller['describe']);router[_0xb940('0xb')]('/:id',auth[_0xb940('0xe')](),controller[_0xb940('0xf')]);router[_0xb940('0xb')](_0xb940('0x10'),auth['isAuthenticated'](),controller[_0xb940('0x11')]);router[_0xb940('0x12')]('/',auth[_0xb940('0xe')](),controller['create']);router[_0xb940('0x13')](_0xb940('0x14'),auth[_0xb940('0xe')](),controller[_0xb940('0x15')]);router['delete'](_0xb940('0x14'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0900=['./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0x0900,0xe1));var _0x0090=function(_0x17ab65,_0x2d3304){_0x17ab65=_0x17ab65-0x0;var _0x346aa6=_0x0900[_0x17ab65];return _0x346aa6;};'use strict';var multer=require(_0x0090('0x0'));var util=require(_0x0090('0x1'));var path=require('path');var timeout=require(_0x0090('0x2'));var express=require(_0x0090('0x3'));var router=express['Router']();var fs_extra=require(_0x0090('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0090('0x5'));var controller=require(_0x0090('0x6'));router[_0x0090('0x7')]('/',auth[_0x0090('0x8')](),controller[_0x0090('0x9')]);router[_0x0090('0x7')](_0x0090('0xa'),auth[_0x0090('0x8')](),controller[_0x0090('0xb')]);router[_0x0090('0x7')](_0x0090('0xc'),auth[_0x0090('0x8')](),controller[_0x0090('0xd')]);router[_0x0090('0x7')](_0x0090('0xe'),auth[_0x0090('0x8')](),controller[_0x0090('0xf')]);router[_0x0090('0x10')]('/',auth[_0x0090('0x8')](),controller['create']);router[_0x0090('0x11')](_0x0090('0xc'),auth['isAuthenticated'](),controller[_0x0090('0x12')]);router[_0x0090('0x13')]('/:id',auth[_0x0090('0x8')](),controller['destroy']);module[_0x0090('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index b97130d..8d5cf30 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 _0x6fad=['path','../../config/environment','exports','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','MM-DD-YYYY\x20HH:mm','toString','format','sequelize','moment'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x6fad,0x17a));var _0xd6fa=function(_0x18bbf3,_0x534e5c){_0x18bbf3=_0x18bbf3-0x0;var _0xce70bd=_0x6fad[_0x18bbf3];return _0xce70bd;};'use strict';var Sequelize=require(_0xd6fa('0x0'));var moment=require(_0xd6fa('0x1'));var path=require(_0xd6fa('0x2'));var config=require(_0xd6fa('0x3'));module[_0xd6fa('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd6fa('0x5')]('value')?path[_0xd6fa('0x6')](this['getDataValue'](_0xd6fa('0x7'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd6fa('0x8')]},'value':{'type':Sequelize[_0xd6fa('0x8')],'set':function(_0x2ed68a){var _0x1d5e36=_0x2ed68a[_0xd6fa('0x9')](/\\/g,'/');this[_0xd6fa('0xa')](_0xd6fa('0x7'),_0x1d5e36);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xd6fa('0xb')],'set':function(_0x48092f){this[_0xd6fa('0xa')](_0xd6fa('0xc'),moment()[_0xd6fa('0xd')](_0x48092f,'ms'));this[_0xd6fa('0xa')](_0xd6fa('0xe'),moment());this['setDataValue']('duration',_0x48092f);}},'startedAt':{'type':Sequelize[_0xd6fa('0xf')],'get':function(){return moment(this[_0xd6fa('0x5')](_0xd6fa('0xc')))['format'](_0xd6fa('0x10'))[_0xd6fa('0x11')]();}},'closedAt':{'type':Sequelize[_0xd6fa('0xf')],'get':function(){return moment(this[_0xd6fa('0x5')](_0xd6fa('0xe')))[_0xd6fa('0x12')](_0xd6fa('0x10'))['toString']();}},'createdAt':{'type':Sequelize[_0xd6fa('0xf')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0xd6fa('0x12')](_0xd6fa('0x10'))['toString']();}},'updatedAt':{'type':Sequelize[_0xd6fa('0xf')],'get':function(){return moment(this[_0xd6fa('0x5')]('updatedAt'))[_0xd6fa('0x12')](_0xd6fa('0x10'))[_0xd6fa('0x11')]();}}}; \ No newline at end of file +var _0x731b=['subtract','closedAt','duration','DATE','format','toString','MM-DD-YYYY\x20HH:mm','sequelize','moment','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','startedAt'];(function(_0x1bfcfc,_0x140f5b){var _0x1041ff=function(_0x2d48fc){while(--_0x2d48fc){_0x1bfcfc['push'](_0x1bfcfc['shift']());}};_0x1041ff(++_0x140f5b);}(_0x731b,0xf7));var _0xb731=function(_0x48f63d,_0x386fa5){_0x48f63d=_0x48f63d-0x0;var _0x397b47=_0x731b[_0x48f63d];return _0x397b47;};'use strict';var Sequelize=require(_0xb731('0x0'));var moment=require(_0xb731('0x1'));var path=require('path');var config=require(_0xb731('0x2'));module[_0xb731('0x3')]={'format':{'type':Sequelize[_0xb731('0x4')],'get':function(){return this[_0xb731('0x5')](_0xb731('0x6'))?path[_0xb731('0x7')](this['getDataValue'](_0xb731('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xb731('0x8')]},'channel':{'type':Sequelize[_0xb731('0x8')]},'value':{'type':Sequelize[_0xb731('0x8')],'set':function(_0x12c59b){var _0x2b475d=_0x12c59b[_0xb731('0x9')](/\\/g,'/');this['setDataValue'](_0xb731('0x6'),_0x2b475d);}},'rating':{'type':Sequelize[_0xb731('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xb731('0xa')],'set':function(_0x26488c){this[_0xb731('0xb')](_0xb731('0xc'),moment()[_0xb731('0xd')](_0x26488c,'ms'));this[_0xb731('0xb')](_0xb731('0xe'),moment());this[_0xb731('0xb')](_0xb731('0xf'),_0x26488c);}},'startedAt':{'type':Sequelize[_0xb731('0x10')],'get':function(){return moment(this[_0xb731('0x5')](_0xb731('0xc')))[_0xb731('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xb731('0x12')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xb731('0x5')](_0xb731('0xe')))[_0xb731('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xb731('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('createdAt'))[_0xb731('0x11')](_0xb731('0x13'))['toString']();}},'updatedAt':{'type':Sequelize[_0xb731('0x10')],'get':function(){return moment(this[_0xb731('0x5')]('updatedAt'))[_0xb731('0x11')](_0xb731('0x13'))[_0xb731('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index afba7f3..79af233 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(_0x1932eb,_0x29c8d6){var _0xad1157=function(_0x3ccfc5){while(--_0x3ccfc5){_0x1932eb['push'](_0x1932eb['shift']());}};_0xad1157(++_0x29c8d6);}(_0x55ca,0x126));var _0xa55c=function(_0x49a3a5,_0x5a8caf){_0x49a3a5=_0x49a3a5-0x0;var _0xf6b7fb=_0x55ca[_0x49a3a5];return _0xf6b7fb;};'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 _0x3eea=['filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','find','create','body','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','format','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','download','filename','extname','Not\x20found','isNil','root','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys'];(function(_0x94633e,_0x21955c){var _0x1e0ae3=function(_0x52ff4d){while(--_0x52ff4d){_0x94633e['push'](_0x94633e['shift']());}};_0x1e0ae3(++_0x21955c);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x5bb398,_0x3a6ccd){_0x5bb398=_0x5bb398-0x0;var _0x23cfdf=_0x3eea[_0x5bb398];return _0x23cfdf;};'use strict';var emlformat=require(_0xa3ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3ee('0x1'));var jsonpatch=require(_0xa3ee('0x2'));var rp=require(_0xa3ee('0x3'));var moment=require(_0xa3ee('0x4'));var BPromise=require(_0xa3ee('0x5'));var Mustache=require(_0xa3ee('0x6'));var util=require(_0xa3ee('0x7'));var path=require(_0xa3ee('0x8'));var sox=require(_0xa3ee('0x9'));var csv=require(_0xa3ee('0xa'));var ejs=require(_0xa3ee('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa3ee('0xc'));var crypto=require('crypto');var jsforce=require(_0xa3ee('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa3ee('0xa'));var querystring=require('querystring');var Papa=require(_0xa3ee('0xe'));var Redis=require('ioredis');var authService=require(_0xa3ee('0xf'));var qs=require(_0xa3ee('0x10'));var as=require(_0xa3ee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3ee('0x12'))(_0xa3ee('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa3ee('0x14'));var db=require(_0xa3ee('0x15'))['db'];function respondWithStatusCode(_0x403518,_0x4363d1){_0x4363d1=_0x4363d1||0xcc;return function(_0x594c88){if(_0x594c88){return _0x403518[_0xa3ee('0x16')](_0x4363d1);}return _0x403518['status'](_0x4363d1)[_0xa3ee('0x17')]();};}function respondWithResult(_0x20535f,_0x2c34cf){_0x2c34cf=_0x2c34cf||0xc8;return function(_0x150e20){if(_0x150e20){return _0x20535f['status'](_0x2c34cf)[_0xa3ee('0x18')](_0x150e20);}};}function respondWithFilteredResult(_0x23df7d,_0x5da681){return function(_0x5358aa){if(_0x5358aa){var _0x4b2c66=typeof _0x5da681[_0xa3ee('0x19')]===_0xa3ee('0x1a')&&typeof _0x5da681[_0xa3ee('0x1b')]===_0xa3ee('0x1a');var _0x4cc8bb=_0x5358aa[_0xa3ee('0x1c')];var _0x40ffdb=_0x4b2c66?0x0:_0x5da681[_0xa3ee('0x19')];var _0x299b1e=_0x4b2c66?_0x5358aa[_0xa3ee('0x1c')]:_0x5da681['offset']+_0x5da681[_0xa3ee('0x1b')];var _0x18b738;if(_0x299b1e>=_0x4cc8bb){_0x299b1e=_0x4cc8bb;_0x18b738=0xc8;}else{_0x18b738=0xce;}_0x23df7d[_0xa3ee('0x1d')](_0x18b738);return _0x23df7d[_0xa3ee('0x1e')](_0xa3ee('0x1f'),_0x40ffdb+'-'+_0x299b1e+'/'+_0x4cc8bb)[_0xa3ee('0x18')](_0x5358aa);}return null;};}function patchUpdates(_0x4f8c56){return function(_0x3f5d70){try{jsonpatch[_0xa3ee('0x20')](_0x3f5d70,_0x4f8c56,!![]);}catch(_0x4b8445){return BPromise[_0xa3ee('0x21')](_0x4b8445);}return _0x3f5d70['save']();};}function saveUpdates(_0x2fab5,_0x29df43){return function(_0x1d3022){if(_0x1d3022){return _0x1d3022[_0xa3ee('0x22')](_0x2fab5)[_0xa3ee('0x23')](function(_0x47108f){return _0x47108f;});}return null;};}function removeEntity(_0x3ce61b,_0x12108e){return function(_0x5ae0a1){if(_0x5ae0a1){return _0x5ae0a1[_0xa3ee('0x24')]()['then'](function(){_0x3ce61b[_0xa3ee('0x1d')](0xcc)[_0xa3ee('0x17')]();});}};}function handleEntityNotFound(_0x157071,_0x1fe4b4){return function(_0x2c48db){if(!_0x2c48db){_0x157071['sendStatus'](0x194);}return _0x2c48db;};}function handleError(_0x3c68f9,_0x1b766e){_0x1b766e=_0x1b766e||0x1f4;return function(_0x146493){logger[_0xa3ee('0x25')](_0x146493[_0xa3ee('0x26')]);if(_0x146493[_0xa3ee('0x27')]){delete _0x146493[_0xa3ee('0x27')];}_0x3c68f9[_0xa3ee('0x1d')](_0x1b766e)[_0xa3ee('0x28')](_0x146493);};}exports[_0xa3ee('0x29')]=function(_0x59c6f9,_0x5ba571){var _0x4abf49={},_0x78e581={},_0x481358={'count':0x0,'rows':[]};var _0x3fa094=_[_0xa3ee('0x2a')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')],function(_0x26b222){return{'name':_0x26b222[_0xa3ee('0x2d')],'type':_0x26b222[_0xa3ee('0x2e')][_0xa3ee('0x2f')]};});_0x78e581[_0xa3ee('0x30')]=_[_0xa3ee('0x31')](_['map'](_0x3fa094,_0xa3ee('0x27')),['format']);_0x78e581[_0xa3ee('0x32')]=_[_0xa3ee('0x33')](_0x59c6f9['query']);_0x78e581[_0xa3ee('0x34')]=_['intersection'](_0x78e581[_0xa3ee('0x30')],_0x78e581['query']);_0x4abf49[_0xa3ee('0x35')]=_[_0xa3ee('0x36')](_0x78e581[_0xa3ee('0x30')],qs[_0xa3ee('0x37')](_0x59c6f9[_0xa3ee('0x32')]['fields']));_0x4abf49[_0xa3ee('0x35')]=_0x4abf49[_0xa3ee('0x35')][_0xa3ee('0x38')]?_0x4abf49['attributes']:_0x78e581[_0xa3ee('0x30')];if(!_0x59c6f9['query'][_0xa3ee('0x39')]('nolimit')){_0x4abf49[_0xa3ee('0x1b')]=qs['limit'](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x1b')]);_0x4abf49[_0xa3ee('0x19')]=qs[_0xa3ee('0x19')](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x19')]);}_0x4abf49[_0xa3ee('0x3a')]=qs[_0xa3ee('0x3b')](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3b')]);_0x4abf49[_0xa3ee('0x3c')]=qs[_0xa3ee('0x34')](_[_0xa3ee('0x3d')](_0x59c6f9['query'],_0x78e581[_0xa3ee('0x34')]),_0x3fa094);if(_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3e')]){_0x4abf49[_0xa3ee('0x3c')]=_['merge'](_0x4abf49[_0xa3ee('0x3c')],{'$or':_[_0xa3ee('0x2a')](_0x3fa094,function(_0x1a9b63){if(_0x1a9b63['type']!==_0xa3ee('0x3f')){var _0x3554eb={};_0x3554eb[_0x1a9b63['name']]={'$like':'%'+_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3e')]+'%'};return _0x3554eb;}})});}_0x4abf49=_['merge']({},_0x4abf49,_0x59c6f9[_0xa3ee('0x40')]);var _0x6dd235={'where':_0x4abf49[_0xa3ee('0x3c')]};return db[_0xa3ee('0x2b')][_0xa3ee('0x1c')](_0x6dd235)[_0xa3ee('0x23')](function(_0x2ca04f){_0x481358[_0xa3ee('0x1c')]=_0x2ca04f;if(_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x41')]){_0x4abf49[_0xa3ee('0x42')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x4abf49);})['then'](function(_0x45aeec){_0x481358[_0xa3ee('0x43')]=_0x45aeec;return _0x481358;})['then'](respondWithFilteredResult(_0x5ba571,_0x4abf49))[_0xa3ee('0x44')](handleError(_0x5ba571,null));};exports[_0xa3ee('0x45')]=function(_0x279834,_0x55f47f){var _0x1af10b={'raw':![],'where':{'id':_0x279834[_0xa3ee('0x46')]['id']}},_0x559cc1={};_0x559cc1[_0xa3ee('0x30')]=_[_0xa3ee('0x33')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')]);_0x559cc1[_0xa3ee('0x32')]=_[_0xa3ee('0x33')](_0x279834[_0xa3ee('0x32')]);_0x559cc1[_0xa3ee('0x34')]=_[_0xa3ee('0x36')](_0x559cc1[_0xa3ee('0x30')],_0x559cc1[_0xa3ee('0x32')]);_0x1af10b[_0xa3ee('0x35')]=_[_0xa3ee('0x36')](_0x559cc1[_0xa3ee('0x30')],qs[_0xa3ee('0x37')](_0x279834[_0xa3ee('0x32')][_0xa3ee('0x37')]));_0x1af10b['attributes']=_0x1af10b[_0xa3ee('0x35')][_0xa3ee('0x38')]?_0x1af10b[_0xa3ee('0x35')]:_0x559cc1[_0xa3ee('0x30')];if(_0x279834['query'][_0xa3ee('0x41')]){_0x1af10b['include']=[{'all':!![]}];}_0x1af10b=_[_0xa3ee('0x47')]({},_0x1af10b,_0x279834[_0xa3ee('0x40')]);return db[_0xa3ee('0x2b')][_0xa3ee('0x48')](_0x1af10b)[_0xa3ee('0x23')](handleEntityNotFound(_0x55f47f,null))[_0xa3ee('0x23')](respondWithResult(_0x55f47f,null))[_0xa3ee('0x44')](handleError(_0x55f47f,null));};exports[_0xa3ee('0x49')]=function(_0x3c3677,_0xd6160e){return db['ScreenRecording'][_0xa3ee('0x49')](_0x3c3677['body'],{})['then'](respondWithResult(_0xd6160e,0xc9))[_0xa3ee('0x44')](handleError(_0xd6160e,null));};exports[_0xa3ee('0x22')]=function(_0x45029f,_0x1ec479){if(_0x45029f[_0xa3ee('0x4a')]['id']){delete _0x45029f[_0xa3ee('0x4a')]['id'];}delete _0x45029f[_0xa3ee('0x4a')]['duration'];delete _0x45029f[_0xa3ee('0x4a')][_0xa3ee('0x4b')];delete _0x45029f['body'][_0xa3ee('0x4c')];delete _0x45029f[_0xa3ee('0x4a')][_0xa3ee('0x4d')];return db['ScreenRecording']['find']({'where':{'id':_0x45029f[_0xa3ee('0x46')]['id']}})[_0xa3ee('0x23')](handleEntityNotFound(_0x1ec479,null))[_0xa3ee('0x23')](saveUpdates(_0x45029f[_0xa3ee('0x4a')],null))[_0xa3ee('0x23')](respondWithResult(_0x1ec479,null))['catch'](handleError(_0x1ec479,null));};exports['describe']=function(_0x15b55e,_0x441b23){return db['ScreenRecording'][_0xa3ee('0x4e')]()[_0xa3ee('0x23')](respondWithResult(_0x441b23,null))[_0xa3ee('0x44')](handleError(_0x441b23,null));};exports['download']=function(_0x505444,_0x2388f7,_0x49057c){var _0x172a73=require(_0xa3ee('0x4f'));var _0x5b8e79=![];var _0x4232e0={};if(_0x505444[_0xa3ee('0x32')][_0xa3ee('0x2e')]&&_0x505444['query'][_0xa3ee('0x2e')]===_0xa3ee('0x50')){_0x4232e0['uniqueid']=_0x505444[_0xa3ee('0x46')]['id'];}else{_0x4232e0['id']=_0x505444[_0xa3ee('0x46')]['id'];}return db[_0xa3ee('0x2b')]['find']({'where':_0x4232e0,'attributes':['id','value'],'raw':!![]})[_0xa3ee('0x23')](handleEntityNotFound(_0x2388f7,null))[_0xa3ee('0x23')](function(_0x4a1a2f){if(_0x4a1a2f){var _0x1f9913=path[_0xa3ee('0x51')](config['root'],'server/files/screen_recordings',_0x4a1a2f[_0xa3ee('0x4d')]);var _0x659491=util[_0xa3ee('0x52')]('%s.cypher',_0x1f9913);if(fs[_0xa3ee('0x53')](_0x659491)){_0x5b8e79=!![];return _0x172a73[_0xa3ee('0x54')](_0x659491,_0x1f9913,config[_0xa3ee('0x55')][_0xa3ee('0x56')])[_0xa3ee('0x23')](function(){return _0x4a1a2f;});}return _0x4a1a2f;}})[_0xa3ee('0x23')](function(_0x497be4){if(_0x497be4){var _0x10f508=path[_0xa3ee('0x51')](config['root'],_0xa3ee('0x57'),_0x497be4[_0xa3ee('0x4d')]);if(!fs[_0xa3ee('0x53')](_0x10f508)){throw new db[(_0xa3ee('0x58'))][(_0xa3ee('0x59'))](_0xa3ee('0x5a'));}if(_0x497be4['filename']){return _0x2388f7[_0xa3ee('0x5b')](_0x10f508,_0x497be4[_0xa3ee('0x5c')]+path[_0xa3ee('0x5d')](_0x10f508),function(){if(_0x5b8e79){fs['unlink'](_0x10f508);}});}else{return _0x2388f7[_0xa3ee('0x5b')](_0x10f508,function(_0x13b81b){if(_0x5b8e79){fs['unlink'](_0x10f508);}});}}})['catch'](function(_0x4df186){if(_0x4df186['message']===_0xa3ee('0x5a')){_0x2388f7[_0xa3ee('0x1d')](0x194)[_0xa3ee('0x28')](_0xa3ee('0x5e'));}else{return handleError(_0x2388f7,null);}});};exports[_0xa3ee('0x24')]=function(_0x18a164,_0x4000ee){return db['ScreenRecording'][_0xa3ee('0x48')]({'where':{'id':_0x18a164[_0xa3ee('0x46')]['id']}})[_0xa3ee('0x23')](function(_0xaff641){if(_[_0xa3ee('0x5f')](_0xaff641)){throw new ReferenceError('Entity\x20not\x20found');}return _0xaff641;})['then'](function(_0x7b1e97){var _0x303b71=path[_0xa3ee('0x51')](config[_0xa3ee('0x60')],_0xa3ee('0x57'),_0x7b1e97[_0xa3ee('0x4d')]);logger[_0xa3ee('0x61')](_0xa3ee('0x62'),_0x303b71);if(!_[_0xa3ee('0x5f')](_0x7b1e97[_0xa3ee('0x4d')])&&fs[_0xa3ee('0x53')](_0x303b71)){logger[_0xa3ee('0x61')](_0xa3ee('0x63')+_0x303b71+_0xa3ee('0x64'));fs[_0xa3ee('0x65')](_0x303b71);}_0x303b71=_0x303b71+'.cypher';if(!_[_0xa3ee('0x5f')](_0x7b1e97['value'])&&fs['existsSync'](_0x303b71)){logger[_0xa3ee('0x61')]('File:\x20\x22'+_0x303b71+_0xa3ee('0x64'));fs[_0xa3ee('0x65')](_0x303b71);}return _0x7b1e97;})[_0xa3ee('0x23')](function(_0x221deb){if(!_0x221deb)throw new InternalError();return _0x221deb['destroy']();})[_0xa3ee('0x23')](function(){_0x4000ee[_0xa3ee('0x1d')](0xcc)[_0xa3ee('0x17')]();})[_0xa3ee('0x44')](handleError(_0x4000ee,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 6039c21..5067d3d 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 _0x12f7=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','./screenRecording.attributes','exports','define','interactionid','lodash'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x12f7,0x1ee));var _0x712f=function(_0x3cc834,_0x1fcf76){_0x3cc834=_0x3cc834-0x0;var _0x326713=_0x12f7[_0x3cc834];return _0x326713;};'use strict';var _=require(_0x712f('0x0'));var util=require(_0x712f('0x1'));var logger=require(_0x712f('0x2'))(_0x712f('0x3'));var moment=require('moment');var BPromise=require(_0x712f('0x4'));var rp=require(_0x712f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x712f('0x6'));var attributes=require(_0x712f('0x7'));module[_0x712f('0x8')]=function(_0x1e02d1,_0x36c3a9){return _0x1e02d1[_0x712f('0x9')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x712f('0xa'),'fields':[_0x712f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2eb=['../../config/logger','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util'];(function(_0x2f1107,_0x2f46ce){var _0x214931=function(_0x5e9011){while(--_0x5e9011){_0x2f1107['push'](_0x2f1107['shift']());}};_0x214931(++_0x2f46ce);}(_0xe2eb,0x9a));var _0xbe2e=function(_0x275fcc,_0x424570){_0x275fcc=_0x275fcc-0x0;var _0x3057c5=_0xe2eb[_0x275fcc];return _0x3057c5;};'use strict';var _=require(_0xbe2e('0x0'));var util=require(_0xbe2e('0x1'));var logger=require(_0xbe2e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbe2e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe2e('0x4'));var rimraf=require(_0xbe2e('0x5'));var config=require(_0xbe2e('0x6'));var attributes=require(_0xbe2e('0x7'));module[_0xbe2e('0x8')]=function(_0xa92fa3,_0x31d247){return _0xa92fa3[_0xbe2e('0x9')](_0xbe2e('0xa'),attributes,{'tableName':_0xbe2e('0xb'),'paranoid':![],'indexes':[{'name':_0xbe2e('0xc'),'fields':[_0xbe2e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 5f8a37b..0f8788c 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 _0x5228=['debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','info','ScreenRecording,\x20%s,\x20%s'];(function(_0xaf8280,_0x5c1176){var _0x1b92a5=function(_0xd78685){while(--_0xd78685){_0xaf8280['push'](_0xaf8280['shift']());}};_0x1b92a5(++_0x5c1176);}(_0x5228,0x1ab));var _0x8522=function(_0x54620c,_0x572752){_0x54620c=_0x54620c-0x0;var _0x2196fc=_0x5228[_0x54620c];return _0x2196fc;};'use strict';var _=require(_0x8522('0x0'));var util=require(_0x8522('0x1'));var moment=require(_0x8522('0x2'));var BPromise=require('bluebird');var rs=require(_0x8522('0x3'));var fs=require('fs');var Redis=require(_0x8522('0x4'));var db=require(_0x8522('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8522('0x6'))(_0x8522('0x7'));var config=require('../../config/environment');var jayson=require(_0x8522('0x8'));var client=jayson['client'][_0x8522('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x607246,_0x3ee753,_0x4fd3d){return new BPromise(function(_0x8d9324,_0x1a0e23){return client[_0x8522('0xa')](_0x607246,_0x4fd3d)['then'](function(_0x502daa){logger[_0x8522('0xb')](_0x8522('0xc'),_0x3ee753,'request\x20sent');logger[_0x8522('0xd')](_0x8522('0xe'),_0x3ee753,_0x8522('0xf'),JSON[_0x8522('0x10')](_0x502daa));if(_0x502daa[_0x8522('0x11')]){if(_0x502daa[_0x8522('0x11')][_0x8522('0x12')]===0x1f4){logger[_0x8522('0x11')](_0x8522('0xc'),_0x3ee753,_0x502daa['error'][_0x8522('0x13')]);return _0x1a0e23(_0x502daa['error'][_0x8522('0x13')]);}logger[_0x8522('0x11')](_0x8522('0xc'),_0x3ee753,_0x502daa['error'][_0x8522('0x13')]);return _0x8d9324(_0x502daa[_0x8522('0x11')][_0x8522('0x13')]);}else{logger[_0x8522('0xb')](_0x8522('0xc'),_0x3ee753,_0x8522('0xf'));_0x8d9324(_0x502daa[_0x8522('0x14')][_0x8522('0x13')]);}})[_0x8522('0x15')](function(_0x1f7c9c){logger['error'](_0x8522('0xc'),_0x3ee753,_0x1f7c9c);_0x1a0e23(_0x1f7c9c);});});} \ No newline at end of file +var _0x2fc8=['request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x26af67,_0x16e0a1){var _0x30fb7b=function(_0x5c22ac){while(--_0x5c22ac){_0x26af67['push'](_0x26af67['shift']());}};_0x30fb7b(++_0x16e0a1);}(_0x2fc8,0xb3));var _0x82fc=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x2fc8[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x82fc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x82fc('0x1'));var rs=require(_0x82fc('0x2'));var fs=require('fs');var Redis=require(_0x82fc('0x3'));var db=require(_0x82fc('0x4'))['db'];var utils=require(_0x82fc('0x5'));var logger=require(_0x82fc('0x6'))('rpc');var config=require(_0x82fc('0x7'));var jayson=require(_0x82fc('0x8'));var client=jayson[_0x82fc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46d491,_0x14ea3f,_0x305770){return new BPromise(function(_0x17e547,_0x1105a3){return client[_0x82fc('0xa')](_0x46d491,_0x305770)[_0x82fc('0xb')](function(_0x2c5712){logger[_0x82fc('0xc')](_0x82fc('0xd'),_0x14ea3f,_0x82fc('0xe'));logger['debug'](_0x82fc('0xf'),_0x14ea3f,_0x82fc('0xe'),JSON[_0x82fc('0x10')](_0x2c5712));if(_0x2c5712[_0x82fc('0x11')]){if(_0x2c5712[_0x82fc('0x11')][_0x82fc('0x12')]===0x1f4){logger[_0x82fc('0x11')](_0x82fc('0xd'),_0x14ea3f,_0x2c5712[_0x82fc('0x11')][_0x82fc('0x13')]);return _0x1105a3(_0x2c5712[_0x82fc('0x11')][_0x82fc('0x13')]);}logger[_0x82fc('0x11')](_0x82fc('0xd'),_0x14ea3f,_0x2c5712['error']['message']);return _0x17e547(_0x2c5712[_0x82fc('0x11')]['message']);}else{logger[_0x82fc('0xc')](_0x82fc('0xd'),_0x14ea3f,_0x82fc('0xe'));_0x17e547(_0x2c5712['result'][_0x82fc('0x13')]);}})[_0x82fc('0x14')](function(_0xfbc560){logger[_0x82fc('0x11')](_0x82fc('0xd'),_0x14ea3f,_0xfbc560);_0x1105a3(_0xfbc560);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 6cbcb7a..41dd6a6 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 _0xa6ba=['extname','originalname','post','file','addLogo','diskStorage','logologin','single','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','get','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','%s%s','logo'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6ba,0x1bf));var _0xaa6b=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa6ba[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0xaa6b('0x0'));var util=require('util');var path=require(_0xaa6b('0x1'));var timeout=require('connect-timeout');var express=require(_0xaa6b('0x2'));var router=express['Router']();var fs_extra=require(_0xaa6b('0x3'));var auth=require(_0xaa6b('0x4'));var interaction=require(_0xaa6b('0x5'));var config=require(_0xaa6b('0x6'));var controller=require(_0xaa6b('0x7'));router['get']('/',auth[_0xaa6b('0x8')](),controller['index']);router[_0xaa6b('0x9')]('/now',controller['getDate']);router[_0xaa6b('0x9')](_0xaa6b('0xa'),controller[_0xaa6b('0xb')]);router[_0xaa6b('0x9')](_0xaa6b('0xc'),controller[_0xaa6b('0xd')]);router['get'](_0xaa6b('0xe'),controller[_0xaa6b('0xf')]);router[_0xaa6b('0x9')](_0xaa6b('0x10'),controller['gdpr']);router[_0xaa6b('0x9')]('/:id/preferred',controller[_0xaa6b('0x11')]);router['get'](_0xaa6b('0x12'),controller[_0xaa6b('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2d2a2b,_0x31e7f6,_0x50b0db){_0x50b0db(null,path[_0xaa6b('0x14')](config[_0xaa6b('0x15')],_0xaa6b('0x16')));},'filename':function(_0x2ca555,_0x2d1880,_0x44bfb5){_0x44bfb5(null,util[_0xaa6b('0x17')](_0xaa6b('0x18'),_0xaa6b('0x19'),path[_0xaa6b('0x1a')](_0x2d1880[_0xaa6b('0x1b')])));}})});router[_0xaa6b('0x1c')](_0xaa6b('0xc'),upload['single'](_0xaa6b('0x1d')),controller[_0xaa6b('0x1e')]);var upload=multer({'storage':multer[_0xaa6b('0x1f')]({'destination':function(_0x515490,_0x304b46,_0x4bfe0d){_0x4bfe0d(null,path['join'](config[_0xaa6b('0x15')],_0xaa6b('0x16')));},'filename':function(_0x2c4e4c,_0xfe5bec,_0x31acfb){_0x31acfb(null,util[_0xaa6b('0x17')](_0xaa6b('0x18'),_0xaa6b('0x20'),path[_0xaa6b('0x1a')](_0xfe5bec[_0xaa6b('0x1b')])));}})});router['post'](_0xaa6b('0xe'),upload[_0xaa6b('0x21')](_0xaa6b('0x1d')),controller[_0xaa6b('0x22')]);var upload=multer({'storage':multer[_0xaa6b('0x1f')]({'destination':function(_0x2c98af,_0x30a86d,_0x19693f){_0x19693f(null,path['join'](config['root'],_0xaa6b('0x16')));},'filename':function(_0x274106,_0x26ecdd,_0x3f3cbc){_0x3f3cbc(null,util['format'](_0xaa6b('0x18'),_0xaa6b('0x23'),path[_0xaa6b('0x1a')](_0x26ecdd[_0xaa6b('0x1b')])));}})});router[_0xaa6b('0x1c')](_0xaa6b('0x24'),upload['single'](_0xaa6b('0x1d')),controller[_0xaa6b('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3e9047,_0x5bd3d8,_0x25439b){_0x25439b(null,path[_0xaa6b('0x14')](config[_0xaa6b('0x15')],_0xaa6b('0x16')));},'filename':function(_0x51e73e,_0x2b3e84,_0x2c146b){_0x2c146b(null,util['format'](_0xaa6b('0x18'),_0xaa6b('0x26'),path[_0xaa6b('0x1a')](_0x2b3e84[_0xaa6b('0x1b')])));}})});router[_0xaa6b('0x1c')](_0xaa6b('0x12'),upload['single']('file'),controller[_0xaa6b('0x27')]);router[_0xaa6b('0x28')](_0xaa6b('0xa'),auth[_0xaa6b('0x8')](),controller[_0xaa6b('0x29')]);module[_0xaa6b('0x2a')]=router; \ No newline at end of file +var _0x707f=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','get','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','logo','single','file','addLogo','format','%s%s','extname','originalname','post','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','update','multer'];(function(_0x4009f1,_0x42cbaa){var _0x47c39d=function(_0x5c4d37){while(--_0x5c4d37){_0x4009f1['push'](_0x4009f1['shift']());}};_0x47c39d(++_0x42cbaa);}(_0x707f,0x10d));var _0xf707=function(_0x2d9b5d,_0xe2245){_0x2d9b5d=_0x2d9b5d-0x0;var _0x493f6e=_0x707f[_0x2d9b5d];return _0x493f6e;};'use strict';var multer=require(_0xf707('0x0'));var util=require(_0xf707('0x1'));var path=require(_0xf707('0x2'));var timeout=require(_0xf707('0x3'));var express=require(_0xf707('0x4'));var router=express[_0xf707('0x5')]();var fs_extra=require(_0xf707('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf707('0x7'));var config=require(_0xf707('0x8'));var controller=require(_0xf707('0x9'));router['get']('/',auth[_0xf707('0xa')](),controller['index']);router[_0xf707('0xb')](_0xf707('0xc'),controller[_0xf707('0xd')]);router[_0xf707('0xb')](_0xf707('0xe'),controller[_0xf707('0xf')]);router[_0xf707('0xb')](_0xf707('0x10'),controller['getLogo']);router[_0xf707('0xb')](_0xf707('0x11'),controller[_0xf707('0x12')]);router[_0xf707('0xb')](_0xf707('0x13'),controller[_0xf707('0x14')]);router[_0xf707('0xb')]('/:id/preferred',controller[_0xf707('0x15')]);router[_0xf707('0xb')](_0xf707('0x16'),controller[_0xf707('0x17')]);var upload=multer({'storage':multer[_0xf707('0x18')]({'destination':function(_0x1e4d4e,_0x54b3e3,_0x5aabf7){_0x5aabf7(null,path[_0xf707('0x19')](config[_0xf707('0x1a')],_0xf707('0x1b')));},'filename':function(_0x3c4ae1,_0x5dba54,_0xec1643){_0xec1643(null,util['format']('%s%s',_0xf707('0x1c'),path['extname'](_0x5dba54['originalname'])));}})});router['post'](_0xf707('0x10'),upload[_0xf707('0x1d')](_0xf707('0x1e')),controller[_0xf707('0x1f')]);var upload=multer({'storage':multer[_0xf707('0x18')]({'destination':function(_0x230156,_0x42b10a,_0x9da620){_0x9da620(null,path[_0xf707('0x19')](config[_0xf707('0x1a')],_0xf707('0x1b')));},'filename':function(_0x26f9a0,_0x27ad39,_0x12b101){_0x12b101(null,util[_0xf707('0x20')](_0xf707('0x21'),'logologin',path[_0xf707('0x22')](_0x27ad39[_0xf707('0x23')])));}})});router[_0xf707('0x24')]('/:id/logo_login',upload['single'](_0xf707('0x1e')),controller[_0xf707('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb9033,_0x268e16,_0x3acd5d){_0x3acd5d(null,path[_0xf707('0x19')](config[_0xf707('0x1a')],'server/files/images/logos/'));},'filename':function(_0x2ec8e3,_0x157712,_0x4e4d37){_0x4e4d37(null,util['format']('%s%s',_0xf707('0x26'),path[_0xf707('0x22')](_0x157712[_0xf707('0x23')])));}})});router['post'](_0xf707('0x27'),upload['single'](_0xf707('0x1e')),controller[_0xf707('0x28')]);var upload=multer({'storage':multer[_0xf707('0x18')]({'destination':function(_0x70db99,_0x35d74f,_0x1cdce5){_0x1cdce5(null,path[_0xf707('0x19')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5aea1e,_0x3e930a,_0x26456c){_0x26456c(null,util[_0xf707('0x20')](_0xf707('0x21'),_0xf707('0x29'),path[_0xf707('0x22')](_0x3e930a['originalname'])));}})});router[_0xf707('0x24')](_0xf707('0x16'),upload[_0xf707('0x1d')](_0xf707('0x1e')),controller[_0xf707('0x2a')]);router[_0xf707('0x2b')](_0xf707('0xe'),auth[_0xf707('0xa')](),controller[_0xf707('0x2c')]);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 8b8c4a9..f52f275 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 _0x0e56=['/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','min_internal','INTEGER','STRING'];(function(_0x1c9b46,_0x507d41){var _0x2d199c=function(_0x4740a8){while(--_0x4740a8){_0x1c9b46['push'](_0x1c9b46['shift']());}};_0x2d199c(++_0x507d41);}(_0x0e56,0xf5));var _0x60e5=function(_0x14ec54,_0x2d5098){_0x14ec54=_0x14ec54-0x0;var _0x2f8c0e=_0x0e56[_0x14ec54];return _0x2f8c0e;};'use strict';var Sequelize=require(_0x60e5('0x0'));module[_0x60e5('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x60e5('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x60e5('0x3')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x60e5('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x60e5('0x4')],'defaultValue':_0x60e5('0x5')},'logo':{'type':Sequelize[_0x60e5('0x4')]},'defaultLogo':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x60e5('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x60e5('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x60e5('0x4')]},'turnpassword':{'type':Sequelize[_0x60e5('0x4')]},'pageTitle':{'type':Sequelize[_0x60e5('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x60e5('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x60e5('0x4')],'defaultValue':_0x60e5('0x7')},'enableEmailPreview':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x60e5('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x60e5('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x60e5('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x60e5('0x4')],'defaultValue':_0x60e5('0x8')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x60e5('0x4')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x60e5('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x60e5('0x4')]},'defaultFavicon':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x60e5('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x60e5('0x3')]},'transcribeRegion':{'type':Sequelize[_0x60e5('0x4')]},'sentiment':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x60e5('0x3')]},'sentimentRegion':{'type':Sequelize[_0x60e5('0x4')]},'language':{'type':Sequelize[_0x60e5('0x4')]},'bucket':{'type':Sequelize[_0x60e5('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x60e5('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x60e5('0x3')](0x2)[_0x60e5('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x60e5('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x60e5('0x3')](0x2)[_0x60e5('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x60e5('0x3')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x60e5('0x3')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x60e5('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x60e5('0x3')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x60e5('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x60e5('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14}}; \ No newline at end of file +var _0x2bce=['UNSIGNED','sequelize','exports','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x26e9a7,_0x1bdfff){var _0x398a28=function(_0x221d70){while(--_0x221d70){_0x26e9a7['push'](_0x26e9a7['shift']());}};_0x398a28(++_0x1bdfff);}(_0x2bce,0x6d));var _0xe2bc=function(_0x343cca,_0x54b523){_0x343cca=_0x343cca-0x0;var _0x3f0d42=_0x2bce[_0x343cca];return _0x3f0d42;};'use strict';var Sequelize=require(_0xe2bc('0x0'));module[_0xe2bc('0x1')]={'min_internal':{'type':Sequelize[_0xe2bc('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xe2bc('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xe2bc('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xe2bc('0x3')],'defaultValue':_0xe2bc('0x4')},'logo':{'type':Sequelize[_0xe2bc('0x3')]},'defaultLogo':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xe2bc('0x3')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xe2bc('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xe2bc('0x3')]},'turnaddr':{'type':Sequelize[_0xe2bc('0x3')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0xe2bc('0x3')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xe2bc('0x3')],'defaultValue':_0xe2bc('0x6')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xe2bc('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xe2bc('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xe2bc('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xe2bc('0x3')],'defaultValue':_0xe2bc('0x7')},'chatTimeout':{'type':Sequelize[_0xe2bc('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xe2bc('0x3')]},'defaultPreferred':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0xe2bc('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xe2bc('0x3')]},'defaultFavicon':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xe2bc('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xe2bc('0x2')]},'transcribeRegion':{'type':Sequelize[_0xe2bc('0x3')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xe2bc('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe2bc('0x3')]},'bucket':{'type':Sequelize[_0xe2bc('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xe2bc('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xe2bc('0x2')](0x2)[_0xe2bc('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xe2bc('0x2')](0x2)[_0xe2bc('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xe2bc('0x2')](0x2)[_0xe2bc('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xe2bc('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xe2bc('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xe2bc('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xe2bc('0x2')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0xe2bc('0x5')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xe2bc('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 8cc5921..52379c3 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 _0xedd9=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Setting,\x20%s,\x20%s','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','name','index','map','Setting','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','root','join','default_logo.svg','default','upperFirst','custom','toLower','existsSync','Sequelize','\x20not\x20found','download','getLogoLogin','preferred','default_loginLogo.svg','ValidationError','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xedd9,0xfc));var _0x9edd=function(_0x2f6263,_0x22d5f7){_0x2f6263=_0x2f6263-0x0;var _0x4a7126=_0xedd9[_0x2f6263];return _0x4a7126;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];var jayson=require(_0x9edd('0x18'));var client=jayson[_0x9edd('0x19')][_0x9edd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xfca576,_0xef5498,_0x47eb64,_0x176bfa){return new BPromise(function(_0x44fc7c,_0x891832){var _0x4d9a7=_0x176bfa||client;return _0x4d9a7[_0x9edd('0x1b')](_0xfca576,_0x47eb64)[_0x9edd('0x1c')](function(_0x1042aa){logger[_0x9edd('0x1d')]('Setting,\x20%s,\x20%s',_0xef5498,_0x9edd('0x1e'));logger[_0x9edd('0x1f')](_0x9edd('0x20'),_0xef5498,'request\x20sent',JSON[_0x9edd('0x21')](_0x1042aa));if(_0x1042aa[_0x9edd('0x22')]){if(_0x1042aa[_0x9edd('0x22')]['code']===0x1f4){logger[_0x9edd('0x22')]('Setting,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')][_0x9edd('0x23')]);return _0x891832(_0x1042aa['error']['message']);}logger[_0x9edd('0x22')]('Setting,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')]['message']);return _0x44fc7c(_0x1042aa['error'][_0x9edd('0x23')]);}else{logger[_0x9edd('0x1d')]('Setting,\x20%s,\x20%s',_0xef5498,'request\x20sent');_0x44fc7c(_0x1042aa[_0x9edd('0x24')][_0x9edd('0x23')]);}})[_0x9edd('0x25')](function(_0x542172){logger[_0x9edd('0x22')](_0x9edd('0x26'),_0xef5498,_0x542172);_0x891832(_0x542172);});});}function respondWithStatusCode(_0x44a6c1,_0x2ca65f){_0x2ca65f=_0x2ca65f||0xcc;return function(_0x339a0d){if(_0x339a0d){return _0x44a6c1['sendStatus'](_0x2ca65f);}return _0x44a6c1[_0x9edd('0x27')](_0x2ca65f)[_0x9edd('0x28')]();};}function respondWithResult(_0x3a1ea5,_0x2f9f86){_0x2f9f86=_0x2f9f86||0xc8;return function(_0x310a4d){if(_0x310a4d){return _0x3a1ea5['status'](_0x2f9f86)['json'](_0x310a4d);}};}function respondWithFilteredResult(_0x3276ee,_0xfeca7b){return function(_0x8d67aa){if(_0x8d67aa){var _0x25e135=typeof _0xfeca7b[_0x9edd('0x29')]==='undefined'&&typeof _0xfeca7b['limit']===_0x9edd('0x2a');var _0x257a26=_0x8d67aa[_0x9edd('0x2b')];var _0x52746a=_0x25e135?0x0:_0xfeca7b[_0x9edd('0x29')];var _0x28cfae=_0x25e135?_0x8d67aa[_0x9edd('0x2b')]:_0xfeca7b[_0x9edd('0x29')]+_0xfeca7b['limit'];var _0x2155a1;if(_0x28cfae>=_0x257a26){_0x28cfae=_0x257a26;_0x2155a1=0xc8;}else{_0x2155a1=0xce;}_0x3276ee[_0x9edd('0x27')](_0x2155a1);return _0x3276ee[_0x9edd('0x2c')](_0x9edd('0x2d'),_0x52746a+'-'+_0x28cfae+'/'+_0x257a26)[_0x9edd('0x2e')](_0x8d67aa);}return null;};}function patchUpdates(_0x42e664){return function(_0x209aba){try{jsonpatch[_0x9edd('0x2f')](_0x209aba,_0x42e664,!![]);}catch(_0x19b6c1){return BPromise[_0x9edd('0x30')](_0x19b6c1);}return _0x209aba[_0x9edd('0x31')]();};}function saveUpdates(_0x138002,_0x6907a5){return function(_0xa55906){if(_0xa55906){return _0xa55906[_0x9edd('0x32')](_0x138002)['then'](function(_0x1453d2){return _0x1453d2;});}return null;};}function removeEntity(_0x259259,_0x267c74){return function(_0x5d1707){if(_0x5d1707){return _0x5d1707[_0x9edd('0x33')]()[_0x9edd('0x1c')](function(){_0x259259[_0x9edd('0x27')](0xcc)[_0x9edd('0x28')]();});}};}function handleEntityNotFound(_0x21bc30,_0x2bc4ed){return function(_0x473068){if(!_0x473068){_0x21bc30[_0x9edd('0x34')](0x194);}return _0x473068;};}function handleError(_0xd0fd74,_0x2539c6){_0x2539c6=_0x2539c6||0x1f4;return function(_0x29e789){logger[_0x9edd('0x22')](_0x29e789[_0x9edd('0x35')]);if(_0x29e789[_0x9edd('0x36')]){delete _0x29e789['name'];}_0xd0fd74[_0x9edd('0x27')](_0x2539c6)['send'](_0x29e789);};}exports[_0x9edd('0x37')]=function(_0x148630,_0x10d6fd){var _0x434d26={},_0x16770e={},_0x4fa5ab={'count':0x0,'rows':[]};var _0x6de835=_[_0x9edd('0x38')](db[_0x9edd('0x39')][_0x9edd('0x3a')],function(_0x1be77f){return{'name':_0x1be77f[_0x9edd('0x3b')],'type':_0x1be77f[_0x9edd('0x3c')][_0x9edd('0x3d')]};});_0x16770e[_0x9edd('0x3e')]=_[_0x9edd('0x38')](_0x6de835,'name');_0x16770e[_0x9edd('0x3f')]=_['keys'](_0x148630[_0x9edd('0x3f')]);_0x16770e['filters']=_[_0x9edd('0x40')](_0x16770e[_0x9edd('0x3e')],_0x16770e[_0x9edd('0x3f')]);_0x434d26['attributes']=_[_0x9edd('0x40')](_0x16770e[_0x9edd('0x3e')],qs[_0x9edd('0x41')](_0x148630['query'][_0x9edd('0x41')]));_0x434d26['attributes']=_0x434d26[_0x9edd('0x42')][_0x9edd('0x43')]?_0x434d26['attributes']:_0x16770e[_0x9edd('0x3e')];if(!_0x148630[_0x9edd('0x3f')][_0x9edd('0x44')](_0x9edd('0x45'))){_0x434d26['limit']=qs[_0x9edd('0x46')](_0x148630['query'][_0x9edd('0x46')]);_0x434d26[_0x9edd('0x29')]=qs['offset'](_0x148630[_0x9edd('0x3f')]['offset']);}_0x434d26['order']=qs[_0x9edd('0x47')](_0x148630[_0x9edd('0x3f')][_0x9edd('0x47')]);_0x434d26[_0x9edd('0x48')]=qs[_0x9edd('0x49')](_[_0x9edd('0x4a')](_0x148630[_0x9edd('0x3f')],_0x16770e[_0x9edd('0x49')]),_0x6de835);if(_0x148630[_0x9edd('0x3f')][_0x9edd('0x4b')]){_0x434d26[_0x9edd('0x48')]=_[_0x9edd('0x4c')](_0x434d26[_0x9edd('0x48')],{'$or':_[_0x9edd('0x38')](_0x6de835,function(_0x46e9f4){if(_0x46e9f4['type']!==_0x9edd('0x4d')){var _0x2570e3={};_0x2570e3[_0x46e9f4[_0x9edd('0x36')]]={'$like':'%'+_0x148630[_0x9edd('0x3f')][_0x9edd('0x4b')]+'%'};return _0x2570e3;}})});}_0x434d26=_[_0x9edd('0x4c')]({},_0x434d26,_0x148630[_0x9edd('0x4e')]);var _0x4e9ad1={'where':_0x434d26['where']};return db['Setting'][_0x9edd('0x2b')](_0x4e9ad1)['then'](function(_0x8b1fdb){_0x4fa5ab[_0x9edd('0x2b')]=_0x8b1fdb;if(_0x148630[_0x9edd('0x3f')][_0x9edd('0x4f')]){_0x434d26[_0x9edd('0x50')]=[{'all':!![]}];}return db['Setting'][_0x9edd('0x51')](_0x434d26);})[_0x9edd('0x1c')](function(_0x40e33d){_0x4fa5ab['rows']=_0x40e33d;return _0x4fa5ab;})[_0x9edd('0x1c')](respondWithFilteredResult(_0x10d6fd,_0x434d26))[_0x9edd('0x25')](handleError(_0x10d6fd,null));};exports[_0x9edd('0x52')]=function(_0x293b03,_0x1d78c4){var _0x35bdec={'raw':![],'where':{'id':_0x293b03[_0x9edd('0x53')]['id']}},_0x4d4f33={};_0x4d4f33[_0x9edd('0x3e')]=_['keys'](db[_0x9edd('0x39')][_0x9edd('0x3a')]);_0x4d4f33['query']=_[_0x9edd('0x54')](_0x293b03[_0x9edd('0x3f')]);_0x4d4f33[_0x9edd('0x49')]=_['intersection'](_0x4d4f33[_0x9edd('0x3e')],_0x4d4f33[_0x9edd('0x3f')]);_0x35bdec[_0x9edd('0x42')]=_[_0x9edd('0x40')](_0x4d4f33['model'],qs[_0x9edd('0x41')](_0x293b03[_0x9edd('0x3f')][_0x9edd('0x41')]));_0x35bdec['attributes']=_0x35bdec[_0x9edd('0x42')][_0x9edd('0x43')]?_0x35bdec['attributes']:_0x4d4f33[_0x9edd('0x3e')];if(_0x293b03['query'][_0x9edd('0x4f')]){_0x35bdec[_0x9edd('0x50')]=[{'all':!![]}];}_0x35bdec=_[_0x9edd('0x4c')]({},_0x35bdec,_0x293b03[_0x9edd('0x4e')]);return db[_0x9edd('0x39')][_0x9edd('0x55')](_0x35bdec)[_0x9edd('0x1c')](handleEntityNotFound(_0x1d78c4,null))[_0x9edd('0x1c')](respondWithResult(_0x1d78c4,null))[_0x9edd('0x25')](handleError(_0x1d78c4,null));};exports[_0x9edd('0x32')]=function(_0x31272d,_0x5a3b1d){if(_0x31272d[_0x9edd('0x56')]['id']){delete _0x31272d[_0x9edd('0x56')]['id'];}return db[_0x9edd('0x39')]['find']({'where':{'id':_0x31272d[_0x9edd('0x53')]['id']}})['then'](handleEntityNotFound(_0x5a3b1d,null))['then'](saveUpdates(_0x31272d['body'],null))[_0x9edd('0x1c')](respondWithResult(_0x5a3b1d,null))[_0x9edd('0x25')](handleError(_0x5a3b1d,null));};exports[_0x9edd('0x57')]=function(_0x35ddb3,_0x48a900,_0x56b38b){if(_0x35ddb3['file']&&_0x35ddb3[_0x9edd('0x58')][_0x9edd('0x59')]){_0x35ddb3[_0x9edd('0x56')][_0x9edd('0x5a')]=_0x35ddb3[_0x9edd('0x58')][_0x9edd('0x59')];}return db[_0x9edd('0x39')][_0x9edd('0x55')]({'where':{'id':_0x35ddb3['params']['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x48a900,null))['then'](saveUpdates(_0x35ddb3[_0x9edd('0x56')],null))[_0x9edd('0x1c')](respondWithResult(_0x48a900,null))['catch'](handleError(_0x48a900,null));};exports[_0x9edd('0x5b')]=function(_0x322359,_0x950e53,_0x5ec9af){if(_0x322359[_0x9edd('0x58')]&&_0x322359[_0x9edd('0x58')][_0x9edd('0x59')]){_0x322359[_0x9edd('0x56')][_0x9edd('0x5c')]=_0x322359[_0x9edd('0x58')]['filename'];}return db['Setting'][_0x9edd('0x55')]({'where':{'id':_0x322359['params']['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x950e53,null))[_0x9edd('0x1c')](saveUpdates(_0x322359[_0x9edd('0x56')],null))[_0x9edd('0x1c')](respondWithResult(_0x950e53,null))['catch'](handleError(_0x950e53,null));};var utilLicense=require(_0x9edd('0x16'));exports['getLogo']=function(_0x3e5dca,_0x344692,_0xc6bde6){var _0x5ca123=_0x9edd('0x5d');var _0x57da5b={'custom':![]};return utilLicense[_0x9edd('0x5e')]()[_0x9edd('0x1c')](function(_0x4915a9){if(_0x4915a9){_0x57da5b=_0x4915a9;}return db[_0x9edd('0x39')]['find']({'where':{'id':_0x3e5dca[_0x9edd('0x53')]['id']},'attributes':[_0x9edd('0x5a'),_0x9edd('0x5c'),'preferred',_0x9edd('0x5f'),_0x9edd('0x60'),_0x9edd('0x61'),_0x9edd('0x62'),_0x9edd('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0x344692,null))['then'](function(_0x2e1a96){if(_0x2e1a96){var _0x211526=_0x2e1a96['logo']&&fs['existsSync'](path['join'](config[_0x9edd('0x64')],_0x5ca123,_['toLower'](_0x2e1a96['logo'])))?path[_0x9edd('0x65')](config[_0x9edd('0x64')],_0x5ca123,_['toLower'](_0x2e1a96[_0x9edd('0x5a')])):path[_0x9edd('0x65')](config[_0x9edd('0x64')],_0x5ca123,_['toLower'](_0x9edd('0x66')));var _0x57695c=_0x9edd('0x67')+_[_0x9edd('0x68')]('logo');if(_0x2e1a96[_0x57695c]||!_0x57da5b[_0x9edd('0x69')]){_0x211526=path[_0x9edd('0x65')](config['root'],_0x5ca123,_[_0x9edd('0x6a')](_0x9edd('0x66')));}if(!fs[_0x9edd('0x6b')](_0x211526)){throw new db[(_0x9edd('0x6c'))]['ValidationError'](_[_0x9edd('0x68')]('logo')+_0x9edd('0x6d'));}return _0x344692[_0x9edd('0x6e')](_0x211526);}})[_0x9edd('0x25')](handleError(_0x344692,null));};var utilLicense=require('../../config/license/util');exports[_0x9edd('0x6f')]=function(_0x286593,_0x130dba,_0x383cb9){var _0x25626a=_0x9edd('0x5d');var _0x3fa4a9={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x322165){if(_0x322165){_0x3fa4a9=_0x322165;}return db[_0x9edd('0x39')][_0x9edd('0x55')]({'where':{'id':_0x286593[_0x9edd('0x53')]['id']},'attributes':[_0x9edd('0x5a'),'loginLogo',_0x9edd('0x70'),_0x9edd('0x5f'),_0x9edd('0x60'),'defaultLoginLogo',_0x9edd('0x62'),_0x9edd('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0x130dba,null))[_0x9edd('0x1c')](function(_0x3801c4){if(_0x3801c4){var _0x58c839=_0x3801c4[_0x9edd('0x5c')]&&fs[_0x9edd('0x6b')](path['join'](config[_0x9edd('0x64')],_0x25626a,_['toLower'](_0x3801c4['loginLogo'])))?path[_0x9edd('0x65')](config[_0x9edd('0x64')],_0x25626a,_[_0x9edd('0x6a')](_0x3801c4['loginLogo'])):path[_0x9edd('0x65')](config[_0x9edd('0x64')],_0x25626a,_['toLower'](_0x9edd('0x71')));var _0x1f55ea=_0x9edd('0x67')+_[_0x9edd('0x68')]('loginLogo');if(_0x3801c4[_0x1f55ea]||!_0x3fa4a9['custom']){_0x58c839=path[_0x9edd('0x65')](config['root'],_0x25626a,_[_0x9edd('0x6a')](_0x9edd('0x71')));}if(!fs[_0x9edd('0x6b')](_0x58c839)){throw new db[(_0x9edd('0x6c'))][(_0x9edd('0x72'))](_[_0x9edd('0x68')](_0x9edd('0x5c'))+_0x9edd('0x6d'));}return _0x130dba[_0x9edd('0x6e')](_0x58c839);}})['catch'](handleError(_0x130dba,null));};exports[_0x9edd('0x73')]=function(_0x3c4db7,_0x2c7562){return db[_0x9edd('0x39')][_0x9edd('0x55')]({'where':{'id':_0x3c4db7[_0x9edd('0x53')]['id']},'attributes':[_0x9edd('0x74')]})['then'](respondWithResult(_0x2c7562,null))[_0x9edd('0x25')](handleError(_0x2c7562,null));};exports[_0x9edd('0x75')]=function(_0x4f44e2,_0x26c11a,_0x14b6b9){if(_0x4f44e2['file']&&_0x4f44e2[_0x9edd('0x58')][_0x9edd('0x59')]){_0x4f44e2[_0x9edd('0x56')]['preferred']=_0x4f44e2[_0x9edd('0x58')][_0x9edd('0x59')];}return db[_0x9edd('0x39')]['find']({'where':{'id':_0x4f44e2['params']['id']}})['then'](handleEntityNotFound(_0x26c11a,null))['then'](saveUpdates(_0x4f44e2[_0x9edd('0x56')],null))[_0x9edd('0x1c')](respondWithResult(_0x26c11a,null))[_0x9edd('0x25')](handleError(_0x26c11a,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x49dc1d,_0x56d794,_0x388252){var _0x20762d=_0x9edd('0x5d');var _0x4713ae={'custom':![]};return utilLicense[_0x9edd('0x5e')]()[_0x9edd('0x1c')](function(_0x2f4e61){if(_0x2f4e61){_0x4713ae=_0x2f4e61;}return db[_0x9edd('0x39')][_0x9edd('0x55')]({'where':{'id':_0x49dc1d[_0x9edd('0x53')]['id']},'attributes':[_0x9edd('0x5a'),'loginLogo',_0x9edd('0x70'),_0x9edd('0x5f'),_0x9edd('0x60'),_0x9edd('0x61'),_0x9edd('0x62'),_0x9edd('0x63')],'raw':!![]});})[_0x9edd('0x1c')](handleEntityNotFound(_0x56d794,null))[_0x9edd('0x1c')](function(_0x4a7889){if(_0x4a7889){var _0x5ada4e=_0x4a7889[_0x9edd('0x70')]&&fs['existsSync'](path[_0x9edd('0x65')](config['root'],_0x20762d,_[_0x9edd('0x6a')](_0x4a7889[_0x9edd('0x70')])))?path['join'](config[_0x9edd('0x64')],_0x20762d,_[_0x9edd('0x6a')](_0x4a7889['preferred'])):path[_0x9edd('0x65')](config[_0x9edd('0x64')],_0x20762d,_[_0x9edd('0x6a')](_0x9edd('0x76')));var _0x377108='default'+_[_0x9edd('0x68')](_0x9edd('0x70'));if(_0x4a7889[_0x377108]||!_0x4713ae[_0x9edd('0x69')]||!_0x4713ae[_0x9edd('0x70')]){_0x5ada4e=path[_0x9edd('0x65')](config['root'],_0x20762d,_['toLower']('default_preferred.png'));}if(!fs['existsSync'](_0x5ada4e)){throw new db['Sequelize'][(_0x9edd('0x72'))](_['upperFirst']('preferred')+_0x9edd('0x6d'));}return _0x56d794[_0x9edd('0x6e')](_0x5ada4e);}})[_0x9edd('0x25')](handleError(_0x56d794,null));};exports[_0x9edd('0x77')]=function(_0x27785b,_0x28bd0f,_0x23e213){if(_0x27785b[_0x9edd('0x58')]&&_0x27785b[_0x9edd('0x58')][_0x9edd('0x59')]){_0x27785b['body'][_0x9edd('0x5f')]=_0x27785b[_0x9edd('0x58')][_0x9edd('0x59')];}return db[_0x9edd('0x39')][_0x9edd('0x55')]({'where':{'id':_0x27785b[_0x9edd('0x53')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x28bd0f,null))[_0x9edd('0x1c')](saveUpdates(_0x27785b['body'],null))['then'](respondWithResult(_0x28bd0f,null))[_0x9edd('0x25')](handleError(_0x28bd0f,null));};var utilLicense=require(_0x9edd('0x16'));exports[_0x9edd('0x78')]=function(_0x120d0f,_0x1dc9e0,_0x3d15b5){var _0x3e1d46=_0x9edd('0x5d');var _0x93fef1={'custom':![]};return utilLicense[_0x9edd('0x5e')]()[_0x9edd('0x1c')](function(_0x260cc6){if(_0x260cc6){_0x93fef1=_0x260cc6;}return db[_0x9edd('0x39')][_0x9edd('0x55')]({'where':{'id':_0x120d0f['params']['id']},'attributes':[_0x9edd('0x5a'),_0x9edd('0x5c'),'preferred',_0x9edd('0x5f'),_0x9edd('0x60'),_0x9edd('0x61'),_0x9edd('0x62'),'defaultFavicon'],'raw':!![]});})[_0x9edd('0x1c')](handleEntityNotFound(_0x1dc9e0,null))[_0x9edd('0x1c')](function(_0xbb5202){if(_0xbb5202){var _0x2c96f1=_0xbb5202[_0x9edd('0x5f')]&&fs['existsSync'](path[_0x9edd('0x65')](config[_0x9edd('0x64')],_0x3e1d46,_[_0x9edd('0x6a')](_0xbb5202[_0x9edd('0x5f')])))?path[_0x9edd('0x65')](config['root'],_0x3e1d46,_['toLower'](_0xbb5202[_0x9edd('0x5f')])):path['join'](config[_0x9edd('0x64')],_0x3e1d46,_['toLower'](_0x9edd('0x79')));var _0x82f31a=_0x9edd('0x67')+_[_0x9edd('0x68')](_0x9edd('0x5f'));if(_0xbb5202[_0x82f31a]||!_0x93fef1[_0x9edd('0x69')]){_0x2c96f1=path['join'](config[_0x9edd('0x64')],_0x3e1d46,_[_0x9edd('0x6a')](_0x9edd('0x79')));}if(!fs[_0x9edd('0x6b')](_0x2c96f1)){throw new db[(_0x9edd('0x6c'))][(_0x9edd('0x72'))](_[_0x9edd('0x68')](_0x9edd('0x5f'))+'\x20not\x20found');}return _0x1dc9e0[_0x9edd('0x6e')](_0x2c96f1);}})[_0x9edd('0x25')](handleError(_0x1dc9e0,null));};exports[_0x9edd('0x7a')]=function(_0x150f7a,_0x385814){var _0x2e75c6={'offset':moment()[_0x9edd('0x7b')]()};_0x2e75c6[_0x9edd('0x7c')]=moment()[_0x9edd('0x7b')](_0x2e75c6[_0x9edd('0x29')])[_0x9edd('0x7d')](_0x9edd('0x7e'));return _0x385814[_0x9edd('0x27')](0xc8)[_0x9edd('0x7f')](_0x2e75c6);}; \ No newline at end of file +var _0x43f7=['defaultFavicon','root','toLower','join','default_logo.svg','upperFirst','custom','Sequelize','\x20not\x20found','download','existsSync','default_loginLogo.svg','default','ValidationError','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','status','end','json','offset','undefined','limit','count','apply','update','destroy','sendStatus','stack','name','send','index','map','Setting','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','body','find','params','addLogo','file','filename','addLogoLogin','loginLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred'];(function(_0x5713af,_0x2fb312){var _0x31ef76=function(_0x2c9378){while(--_0x2c9378){_0x5713af['push'](_0x5713af['shift']());}};_0x31ef76(++_0x2fb312);}(_0x43f7,0x8e));var _0x743f=function(_0x3fcedd,_0xc3c004){_0x3fcedd=_0x3fcedd-0x0;var _0x2af2f3=_0x43f7[_0x3fcedd];return _0x2af2f3;};'use strict';var emlformat=require(_0x743f('0x0'));var rimraf=require(_0x743f('0x1'));var zipdir=require(_0x743f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x743f('0x3'));var Mustache=require(_0x743f('0x4'));var util=require(_0x743f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x743f('0x6'));var ejs=require(_0x743f('0x7'));var fs=require('fs');var fs_extra=require(_0x743f('0x8'));var _=require('lodash');var squel=require(_0x743f('0x9'));var crypto=require(_0x743f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x743f('0xb'));var toCsv=require(_0x743f('0x6'));var querystring=require(_0x743f('0xc'));var Papa=require(_0x743f('0xd'));var Redis=require(_0x743f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x743f('0xf'));var as=require(_0x743f('0x10'));var hardwareService=require(_0x743f('0x11'));var logger=require('../../config/logger')(_0x743f('0x12'));var utils=require(_0x743f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x743f('0x14'));var db=require(_0x743f('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x743f('0x16')][_0x743f('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x42fa59,_0xf37fc7,_0x3b9197,_0x9f3e98){return new BPromise(function(_0x2393d1,_0x57016d){var _0x1574f3=_0x9f3e98||client;return _0x1574f3[_0x743f('0x18')](_0x42fa59,_0x3b9197)[_0x743f('0x19')](function(_0x2db8a6){logger[_0x743f('0x1a')](_0x743f('0x1b'),_0xf37fc7,_0x743f('0x1c'));logger[_0x743f('0x1d')](_0x743f('0x1e'),_0xf37fc7,_0x743f('0x1c'),JSON['stringify'](_0x2db8a6));if(_0x2db8a6['error']){if(_0x2db8a6[_0x743f('0x1f')][_0x743f('0x20')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0xf37fc7,_0x2db8a6[_0x743f('0x1f')][_0x743f('0x21')]);return _0x57016d(_0x2db8a6['error']['message']);}logger[_0x743f('0x1f')](_0x743f('0x1b'),_0xf37fc7,_0x2db8a6[_0x743f('0x1f')][_0x743f('0x21')]);return _0x2393d1(_0x2db8a6[_0x743f('0x1f')][_0x743f('0x21')]);}else{logger['info'](_0x743f('0x1b'),_0xf37fc7,_0x743f('0x1c'));_0x2393d1(_0x2db8a6['result'][_0x743f('0x21')]);}})['catch'](function(_0x40332b){logger[_0x743f('0x1f')](_0x743f('0x1b'),_0xf37fc7,_0x40332b);_0x57016d(_0x40332b);});});}function respondWithStatusCode(_0x506a31,_0x1c033c){_0x1c033c=_0x1c033c||0xcc;return function(_0x540f6b){if(_0x540f6b){return _0x506a31['sendStatus'](_0x1c033c);}return _0x506a31[_0x743f('0x22')](_0x1c033c)[_0x743f('0x23')]();};}function respondWithResult(_0x1e5baa,_0x342b65){_0x342b65=_0x342b65||0xc8;return function(_0x4849d7){if(_0x4849d7){return _0x1e5baa[_0x743f('0x22')](_0x342b65)[_0x743f('0x24')](_0x4849d7);}};}function respondWithFilteredResult(_0x187e93,_0x2e9215){return function(_0x5c6313){if(_0x5c6313){var _0xf93c45=typeof _0x2e9215[_0x743f('0x25')]===_0x743f('0x26')&&typeof _0x2e9215[_0x743f('0x27')]===_0x743f('0x26');var _0x305fc2=_0x5c6313['count'];var _0x5dee6d=_0xf93c45?0x0:_0x2e9215['offset'];var _0x16bbb5=_0xf93c45?_0x5c6313[_0x743f('0x28')]:_0x2e9215[_0x743f('0x25')]+_0x2e9215['limit'];var _0x5e39a2;if(_0x16bbb5>=_0x305fc2){_0x16bbb5=_0x305fc2;_0x5e39a2=0xc8;}else{_0x5e39a2=0xce;}_0x187e93[_0x743f('0x22')](_0x5e39a2);return _0x187e93['set']('Content-Range',_0x5dee6d+'-'+_0x16bbb5+'/'+_0x305fc2)[_0x743f('0x24')](_0x5c6313);}return null;};}function patchUpdates(_0x448899){return function(_0x202f9f){try{jsonpatch[_0x743f('0x29')](_0x202f9f,_0x448899,!![]);}catch(_0x17e185){return BPromise['reject'](_0x17e185);}return _0x202f9f['save']();};}function saveUpdates(_0x52cfb1,_0x25160c){return function(_0x2db3f9){if(_0x2db3f9){return _0x2db3f9[_0x743f('0x2a')](_0x52cfb1)['then'](function(_0x463268){return _0x463268;});}return null;};}function removeEntity(_0x59dd3d,_0x328834){return function(_0x48ce5c){if(_0x48ce5c){return _0x48ce5c[_0x743f('0x2b')]()['then'](function(){_0x59dd3d[_0x743f('0x22')](0xcc)[_0x743f('0x23')]();});}};}function handleEntityNotFound(_0x5dfb14,_0x54eb48){return function(_0x33d4ab){if(!_0x33d4ab){_0x5dfb14[_0x743f('0x2c')](0x194);}return _0x33d4ab;};}function handleError(_0x401eea,_0x42eee2){_0x42eee2=_0x42eee2||0x1f4;return function(_0x279318){logger[_0x743f('0x1f')](_0x279318[_0x743f('0x2d')]);if(_0x279318[_0x743f('0x2e')]){delete _0x279318[_0x743f('0x2e')];}_0x401eea[_0x743f('0x22')](_0x42eee2)[_0x743f('0x2f')](_0x279318);};}exports[_0x743f('0x30')]=function(_0xf4cd45,_0x2f59d3){var _0x169074={},_0x54633b={},_0x54c0f1={'count':0x0,'rows':[]};var _0x692233=_[_0x743f('0x31')](db[_0x743f('0x32')][_0x743f('0x33')],function(_0x592738){return{'name':_0x592738[_0x743f('0x34')],'type':_0x592738['type']['key']};});_0x54633b['model']=_[_0x743f('0x31')](_0x692233,_0x743f('0x2e'));_0x54633b[_0x743f('0x35')]=_[_0x743f('0x36')](_0xf4cd45[_0x743f('0x35')]);_0x54633b[_0x743f('0x37')]=_[_0x743f('0x38')](_0x54633b[_0x743f('0x39')],_0x54633b[_0x743f('0x35')]);_0x169074[_0x743f('0x3a')]=_['intersection'](_0x54633b[_0x743f('0x39')],qs[_0x743f('0x3b')](_0xf4cd45['query'][_0x743f('0x3b')]));_0x169074['attributes']=_0x169074['attributes'][_0x743f('0x3c')]?_0x169074['attributes']:_0x54633b[_0x743f('0x39')];if(!_0xf4cd45[_0x743f('0x35')]['hasOwnProperty'](_0x743f('0x3d'))){_0x169074['limit']=qs[_0x743f('0x27')](_0xf4cd45[_0x743f('0x35')][_0x743f('0x27')]);_0x169074['offset']=qs[_0x743f('0x25')](_0xf4cd45[_0x743f('0x35')][_0x743f('0x25')]);}_0x169074['order']=qs[_0x743f('0x3e')](_0xf4cd45['query'][_0x743f('0x3e')]);_0x169074[_0x743f('0x3f')]=qs['filters'](_[_0x743f('0x40')](_0xf4cd45['query'],_0x54633b['filters']),_0x692233);if(_0xf4cd45[_0x743f('0x35')]['filter']){_0x169074[_0x743f('0x3f')]=_[_0x743f('0x41')](_0x169074[_0x743f('0x3f')],{'$or':_[_0x743f('0x31')](_0x692233,function(_0x141b35){if(_0x141b35[_0x743f('0x42')]!==_0x743f('0x43')){var _0x33e453={};_0x33e453[_0x141b35['name']]={'$like':'%'+_0xf4cd45[_0x743f('0x35')][_0x743f('0x44')]+'%'};return _0x33e453;}})});}_0x169074=_['merge']({},_0x169074,_0xf4cd45[_0x743f('0x45')]);var _0x381fe0={'where':_0x169074['where']};return db['Setting'][_0x743f('0x28')](_0x381fe0)[_0x743f('0x19')](function(_0xb09d1a){_0x54c0f1[_0x743f('0x28')]=_0xb09d1a;if(_0xf4cd45[_0x743f('0x35')][_0x743f('0x46')]){_0x169074[_0x743f('0x47')]=[{'all':!![]}];}return db[_0x743f('0x32')][_0x743f('0x48')](_0x169074);})[_0x743f('0x19')](function(_0x3c6678){_0x54c0f1[_0x743f('0x49')]=_0x3c6678;return _0x54c0f1;})['then'](respondWithFilteredResult(_0x2f59d3,_0x169074))[_0x743f('0x4a')](handleError(_0x2f59d3,null));};exports[_0x743f('0x4b')]=function(_0x1916b4,_0x1b5a7f){var _0x944cfc={'raw':![],'where':{'id':_0x1916b4['params']['id']}},_0x59d3bf={};_0x59d3bf[_0x743f('0x39')]=_[_0x743f('0x36')](db['Setting'][_0x743f('0x33')]);_0x59d3bf[_0x743f('0x35')]=_[_0x743f('0x36')](_0x1916b4[_0x743f('0x35')]);_0x59d3bf[_0x743f('0x37')]=_[_0x743f('0x38')](_0x59d3bf[_0x743f('0x39')],_0x59d3bf[_0x743f('0x35')]);_0x944cfc[_0x743f('0x3a')]=_[_0x743f('0x38')](_0x59d3bf['model'],qs[_0x743f('0x3b')](_0x1916b4[_0x743f('0x35')][_0x743f('0x3b')]));_0x944cfc[_0x743f('0x3a')]=_0x944cfc[_0x743f('0x3a')][_0x743f('0x3c')]?_0x944cfc[_0x743f('0x3a')]:_0x59d3bf[_0x743f('0x39')];if(_0x1916b4[_0x743f('0x35')][_0x743f('0x46')]){_0x944cfc[_0x743f('0x47')]=[{'all':!![]}];}_0x944cfc=_[_0x743f('0x41')]({},_0x944cfc,_0x1916b4[_0x743f('0x45')]);return db['Setting']['find'](_0x944cfc)['then'](handleEntityNotFound(_0x1b5a7f,null))[_0x743f('0x19')](respondWithResult(_0x1b5a7f,null))[_0x743f('0x4a')](handleError(_0x1b5a7f,null));};exports[_0x743f('0x2a')]=function(_0x247ef5,_0x303c76){if(_0x247ef5[_0x743f('0x4c')]['id']){delete _0x247ef5[_0x743f('0x4c')]['id'];}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x247ef5[_0x743f('0x4e')]['id']}})[_0x743f('0x19')](handleEntityNotFound(_0x303c76,null))[_0x743f('0x19')](saveUpdates(_0x247ef5[_0x743f('0x4c')],null))['then'](respondWithResult(_0x303c76,null))['catch'](handleError(_0x303c76,null));};exports[_0x743f('0x4f')]=function(_0x37e868,_0x13af22,_0xd3addb){if(_0x37e868[_0x743f('0x50')]&&_0x37e868[_0x743f('0x50')][_0x743f('0x51')]){_0x37e868['body']['logo']=_0x37e868[_0x743f('0x50')][_0x743f('0x51')];}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x37e868[_0x743f('0x4e')]['id']}})[_0x743f('0x19')](handleEntityNotFound(_0x13af22,null))[_0x743f('0x19')](saveUpdates(_0x37e868['body'],null))['then'](respondWithResult(_0x13af22,null))[_0x743f('0x4a')](handleError(_0x13af22,null));};exports[_0x743f('0x52')]=function(_0x4e336e,_0x4e9ffd,_0x175f08){if(_0x4e336e[_0x743f('0x50')]&&_0x4e336e[_0x743f('0x50')][_0x743f('0x51')]){_0x4e336e[_0x743f('0x4c')][_0x743f('0x53')]=_0x4e336e[_0x743f('0x50')][_0x743f('0x51')];}return db['Setting'][_0x743f('0x4d')]({'where':{'id':_0x4e336e[_0x743f('0x4e')]['id']}})[_0x743f('0x19')](handleEntityNotFound(_0x4e9ffd,null))[_0x743f('0x19')](saveUpdates(_0x4e336e[_0x743f('0x4c')],null))[_0x743f('0x19')](respondWithResult(_0x4e9ffd,null))[_0x743f('0x4a')](handleError(_0x4e9ffd,null));};var utilLicense=require(_0x743f('0x14'));exports['getLogo']=function(_0x14f576,_0xb8f178,_0x5a3dfb){var _0x48b3ae=_0x743f('0x54');var _0x31d83a={'custom':![]};return utilLicense[_0x743f('0x55')]()['then'](function(_0x376d52){if(_0x376d52){_0x31d83a=_0x376d52;}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x14f576[_0x743f('0x4e')]['id']},'attributes':[_0x743f('0x56'),_0x743f('0x53'),_0x743f('0x57'),_0x743f('0x58'),_0x743f('0x59'),_0x743f('0x5a'),_0x743f('0x5b'),_0x743f('0x5c')],'raw':!![]});})[_0x743f('0x19')](handleEntityNotFound(_0xb8f178,null))[_0x743f('0x19')](function(_0x3f3f53){if(_0x3f3f53){var _0x4bd9d5=_0x3f3f53['logo']&&fs['existsSync'](path['join'](config[_0x743f('0x5d')],_0x48b3ae,_[_0x743f('0x5e')](_0x3f3f53[_0x743f('0x56')])))?path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x48b3ae,_['toLower'](_0x3f3f53[_0x743f('0x56')])):path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x48b3ae,_[_0x743f('0x5e')](_0x743f('0x60')));var _0x258935='default'+_[_0x743f('0x61')](_0x743f('0x56'));if(_0x3f3f53[_0x258935]||!_0x31d83a[_0x743f('0x62')]){_0x4bd9d5=path['join'](config['root'],_0x48b3ae,_['toLower'](_0x743f('0x60')));}if(!fs['existsSync'](_0x4bd9d5)){throw new db[(_0x743f('0x63'))]['ValidationError'](_[_0x743f('0x61')](_0x743f('0x56'))+_0x743f('0x64'));}return _0xb8f178[_0x743f('0x65')](_0x4bd9d5);}})[_0x743f('0x4a')](handleError(_0xb8f178,null));};var utilLicense=require(_0x743f('0x14'));exports['getLogoLogin']=function(_0x3d19b6,_0x54de45,_0x58effc){var _0x287b62=_0x743f('0x54');var _0xcdd72e={'custom':![]};return utilLicense[_0x743f('0x55')]()[_0x743f('0x19')](function(_0x29f6e3){if(_0x29f6e3){_0xcdd72e=_0x29f6e3;}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x3d19b6['params']['id']},'attributes':['logo',_0x743f('0x53'),'preferred',_0x743f('0x58'),_0x743f('0x59'),_0x743f('0x5a'),'defaultPreferred',_0x743f('0x5c')],'raw':!![]});})['then'](handleEntityNotFound(_0x54de45,null))[_0x743f('0x19')](function(_0xdf82a9){if(_0xdf82a9){var _0x4d08ac=_0xdf82a9['loginLogo']&&fs[_0x743f('0x66')](path['join'](config[_0x743f('0x5d')],_0x287b62,_[_0x743f('0x5e')](_0xdf82a9[_0x743f('0x53')])))?path[_0x743f('0x5f')](config['root'],_0x287b62,_['toLower'](_0xdf82a9['loginLogo'])):path['join'](config[_0x743f('0x5d')],_0x287b62,_[_0x743f('0x5e')](_0x743f('0x67')));var _0x1fe676=_0x743f('0x68')+_['upperFirst'](_0x743f('0x53'));if(_0xdf82a9[_0x1fe676]||!_0xcdd72e[_0x743f('0x62')]){_0x4d08ac=path[_0x743f('0x5f')](config['root'],_0x287b62,_[_0x743f('0x5e')](_0x743f('0x67')));}if(!fs[_0x743f('0x66')](_0x4d08ac)){throw new db['Sequelize'][(_0x743f('0x69'))](_[_0x743f('0x61')](_0x743f('0x53'))+_0x743f('0x64'));}return _0x54de45['download'](_0x4d08ac);}})['catch'](handleError(_0x54de45,null));};exports[_0x743f('0x6a')]=function(_0x416a0f,_0x511392){return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x416a0f[_0x743f('0x4e')]['id']},'attributes':[_0x743f('0x6b')]})[_0x743f('0x19')](respondWithResult(_0x511392,null))['catch'](handleError(_0x511392,null));};exports[_0x743f('0x6c')]=function(_0x157e6f,_0x2e5598,_0x554d80){if(_0x157e6f['file']&&_0x157e6f['file'][_0x743f('0x51')]){_0x157e6f[_0x743f('0x4c')]['preferred']=_0x157e6f['file'][_0x743f('0x51')];}return db[_0x743f('0x32')]['find']({'where':{'id':_0x157e6f[_0x743f('0x4e')]['id']}})[_0x743f('0x19')](handleEntityNotFound(_0x2e5598,null))['then'](saveUpdates(_0x157e6f[_0x743f('0x4c')],null))[_0x743f('0x19')](respondWithResult(_0x2e5598,null))[_0x743f('0x4a')](handleError(_0x2e5598,null));};var utilLicense=require(_0x743f('0x14'));exports[_0x743f('0x6d')]=function(_0x4fa0ce,_0x2545a8,_0x2e702c){var _0x5fb5c2=_0x743f('0x54');var _0x156c04={'custom':![]};return utilLicense[_0x743f('0x55')]()[_0x743f('0x19')](function(_0x488a86){if(_0x488a86){_0x156c04=_0x488a86;}return db[_0x743f('0x32')]['find']({'where':{'id':_0x4fa0ce['params']['id']},'attributes':['logo',_0x743f('0x53'),_0x743f('0x57'),_0x743f('0x58'),'defaultLogo',_0x743f('0x5a'),_0x743f('0x5b'),_0x743f('0x5c')],'raw':!![]});})[_0x743f('0x19')](handleEntityNotFound(_0x2545a8,null))[_0x743f('0x19')](function(_0x2e0cd0){if(_0x2e0cd0){var _0x238eee=_0x2e0cd0['preferred']&&fs['existsSync'](path[_0x743f('0x5f')](config['root'],_0x5fb5c2,_[_0x743f('0x5e')](_0x2e0cd0['preferred'])))?path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x5fb5c2,_[_0x743f('0x5e')](_0x2e0cd0[_0x743f('0x57')])):path[_0x743f('0x5f')](config['root'],_0x5fb5c2,_[_0x743f('0x5e')]('default_preferred.png'));var _0x20c8f7='default'+_[_0x743f('0x61')](_0x743f('0x57'));if(_0x2e0cd0[_0x20c8f7]||!_0x156c04[_0x743f('0x62')]||!_0x156c04['preferred']){_0x238eee=path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x5fb5c2,_[_0x743f('0x5e')](_0x743f('0x6e')));}if(!fs[_0x743f('0x66')](_0x238eee)){throw new db[(_0x743f('0x63'))][(_0x743f('0x69'))](_[_0x743f('0x61')](_0x743f('0x57'))+_0x743f('0x64'));}return _0x2545a8[_0x743f('0x65')](_0x238eee);}})[_0x743f('0x4a')](handleError(_0x2545a8,null));};exports['addFavicon']=function(_0x2d67f7,_0x27166f,_0x5075b0){if(_0x2d67f7[_0x743f('0x50')]&&_0x2d67f7[_0x743f('0x50')]['filename']){_0x2d67f7[_0x743f('0x4c')][_0x743f('0x58')]=_0x2d67f7['file'][_0x743f('0x51')];}return db['Setting']['find']({'where':{'id':_0x2d67f7['params']['id']}})['then'](handleEntityNotFound(_0x27166f,null))[_0x743f('0x19')](saveUpdates(_0x2d67f7[_0x743f('0x4c')],null))[_0x743f('0x19')](respondWithResult(_0x27166f,null))[_0x743f('0x4a')](handleError(_0x27166f,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x50a9f5,_0x22baf5,_0x29e2b4){var _0x4114b6=_0x743f('0x54');var _0x3aa114={'custom':![]};return utilLicense[_0x743f('0x55')]()[_0x743f('0x19')](function(_0x5b1f8c){if(_0x5b1f8c){_0x3aa114=_0x5b1f8c;}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x50a9f5['params']['id']},'attributes':['logo',_0x743f('0x53'),_0x743f('0x57'),_0x743f('0x58'),_0x743f('0x59'),_0x743f('0x5a'),_0x743f('0x5b'),'defaultFavicon'],'raw':!![]});})[_0x743f('0x19')](handleEntityNotFound(_0x22baf5,null))[_0x743f('0x19')](function(_0x1f8dcc){if(_0x1f8dcc){var _0x59675c=_0x1f8dcc[_0x743f('0x58')]&&fs[_0x743f('0x66')](path[_0x743f('0x5f')](config['root'],_0x4114b6,_[_0x743f('0x5e')](_0x1f8dcc[_0x743f('0x58')])))?path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x4114b6,_[_0x743f('0x5e')](_0x1f8dcc[_0x743f('0x58')])):path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x4114b6,_[_0x743f('0x5e')](_0x743f('0x6f')));var _0x5a7832=_0x743f('0x68')+_['upperFirst']('favicon');if(_0x1f8dcc[_0x5a7832]||!_0x3aa114[_0x743f('0x62')]){_0x59675c=path[_0x743f('0x5f')](config['root'],_0x4114b6,_[_0x743f('0x5e')](_0x743f('0x6f')));}if(!fs[_0x743f('0x66')](_0x59675c)){throw new db['Sequelize'][(_0x743f('0x69'))](_[_0x743f('0x61')](_0x743f('0x58'))+_0x743f('0x64'));}return _0x22baf5[_0x743f('0x65')](_0x59675c);}})[_0x743f('0x4a')](handleError(_0x22baf5,null));};exports[_0x743f('0x70')]=function(_0x4ccb93,_0x5bc760){var _0x509aec={'offset':moment()[_0x743f('0x71')]()};_0x509aec[_0x743f('0x72')]=moment()[_0x743f('0x71')](_0x509aec[_0x743f('0x25')])[_0x743f('0x73')](_0x743f('0x74'));return _0x5bc760[_0x743f('0x22')](0xc8)['send'](_0x509aec);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 61de336..d316d29 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 _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x233143,_0x493839){var _0x507a4b=function(_0x7b23ca){while(--_0x7b23ca){_0x233143['push'](_0x233143['shift']());}};_0x507a4b(++_0x493839);}(_0x34e8,0x12c));var _0x834e=function(_0x379fef,_0x2694db){_0x379fef=_0x379fef-0x0;var _0x874d3f=_0x34e8[_0x379fef];return _0x874d3f;};'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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 2db7499..2ab1327 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 _0x1f15=['catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x477228,_0x397c9d){var _0x23aa6e=function(_0x117b07){while(--_0x117b07){_0x477228['push'](_0x477228['shift']());}};_0x23aa6e(++_0x397c9d);}(_0x1f15,0x1e7));var _0x51f1=function(_0xc89101,_0x1163b0){_0xc89101=_0xc89101-0x0;var _0x144720=_0x1f15[_0xc89101];return _0x144720;};'use strict';var _=require(_0x51f1('0x0'));var util=require(_0x51f1('0x1'));var moment=require(_0x51f1('0x2'));var BPromise=require(_0x51f1('0x3'));var rs=require(_0x51f1('0x4'));var fs=require('fs');var Redis=require(_0x51f1('0x5'));var db=require(_0x51f1('0x6'))['db'];var utils=require(_0x51f1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x51f1('0x8'));var jayson=require(_0x51f1('0x9'));var client=jayson[_0x51f1('0xa')][_0x51f1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ea2bd,_0x16a1cd,_0x7c1535){return new BPromise(function(_0x3c8413,_0x5c54d7){return client[_0x51f1('0xc')](_0x4ea2bd,_0x7c1535)[_0x51f1('0xd')](function(_0xdf7a32){logger[_0x51f1('0xe')](_0x51f1('0xf'),_0x16a1cd,_0x51f1('0x10'));logger[_0x51f1('0x11')](_0x51f1('0x12'),_0x16a1cd,'request\x20sent',JSON[_0x51f1('0x13')](_0xdf7a32));if(_0xdf7a32[_0x51f1('0x14')]){if(_0xdf7a32[_0x51f1('0x14')][_0x51f1('0x15')]===0x1f4){logger[_0x51f1('0x14')]('Setting,\x20%s,\x20%s',_0x16a1cd,_0xdf7a32[_0x51f1('0x14')][_0x51f1('0x16')]);return _0x5c54d7(_0xdf7a32[_0x51f1('0x14')][_0x51f1('0x16')]);}logger['error']('Setting,\x20%s,\x20%s',_0x16a1cd,_0xdf7a32[_0x51f1('0x14')]['message']);return _0x3c8413(_0xdf7a32[_0x51f1('0x14')][_0x51f1('0x16')]);}else{logger[_0x51f1('0xe')](_0x51f1('0xf'),_0x16a1cd,_0x51f1('0x10'));_0x3c8413(_0xdf7a32['result'][_0x51f1('0x16')]);}})[_0x51f1('0x17')](function(_0x2c4c1e){logger[_0x51f1('0x14')](_0x51f1('0xf'),_0x16a1cd,_0x2c4c1e);_0x5c54d7(_0x2c4c1e);});});}exports[_0x51f1('0x18')]=function(_0x5442eb){var _0x5975d9=this;return new Promise(function(_0x594806,_0x4907b0){return db[_0x51f1('0x19')][_0x51f1('0x1a')]({'raw':_0x5442eb[_0x51f1('0x1b')]?_0x5442eb[_0x51f1('0x1b')][_0x51f1('0x1c')]===undefined?!![]:![]:!![],'where':_0x5442eb[_0x51f1('0x1b')]?_0x5442eb['options'][_0x51f1('0x1d')]||null:null,'attributes':_0x5442eb['options']?_0x5442eb[_0x51f1('0x1b')][_0x51f1('0x1e')]||null:null,'include':_0x5442eb[_0x51f1('0x1b')]?_0x5442eb[_0x51f1('0x1b')][_0x51f1('0x1f')]?_[_0x51f1('0x20')](_0x5442eb[_0x51f1('0x1b')]['include'],function(_0x477107){return{'model':db[_0x477107['model']],'as':_0x477107['as'],'attributes':_0x477107['attributes'],'include':_0x477107['include']?_[_0x51f1('0x20')](_0x477107[_0x51f1('0x1f')],function(_0x2946f7){return{'model':db[_0x2946f7[_0x51f1('0x21')]],'as':_0x2946f7['as'],'attributes':_0x2946f7[_0x51f1('0x1e')],'include':_0x2946f7[_0x51f1('0x1f')]?_[_0x51f1('0x20')](_0x2946f7[_0x51f1('0x1f')],function(_0x4ba48c){return{'model':db[_0x4ba48c[_0x51f1('0x21')]],'as':_0x4ba48c['as'],'attributes':_0x4ba48c[_0x51f1('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7f8579){logger[_0x51f1('0xe')](_0x51f1('0x18'),_0x5442eb);logger[_0x51f1('0x11')](_0x51f1('0x18'),_0x5442eb,JSON[_0x51f1('0x13')](_0x7f8579));_0x594806(_0x7f8579);})[_0x51f1('0x17')](function(_0x41d37d){logger['error'](_0x51f1('0x18'),_0x41d37d[_0x51f1('0x16')],_0x5442eb);_0x4907b0(_0x5975d9[_0x51f1('0x14')](0x1f4,_0x41d37d[_0x51f1('0x16')]));});});}; \ No newline at end of file +var _0x8780=['jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','ShowSetting','Setting','options','raw','where','attributes','include','map','model','debug','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x8780,0xd8));var _0x0878=function(_0x315812,_0x252a78){_0x315812=_0x315812-0x0;var _0x2c8d37=_0x8780[_0x315812];return _0x2c8d37;};'use strict';var _=require('lodash');var util=require(_0x0878('0x0'));var moment=require(_0x0878('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0878('0x2'));var db=require(_0x0878('0x3'))['db'];var utils=require(_0x0878('0x4'));var logger=require(_0x0878('0x5'))(_0x0878('0x6'));var config=require(_0x0878('0x7'));var jayson=require(_0x0878('0x8'));var client=jayson[_0x0878('0x9')][_0x0878('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3055d7,_0xfcc3e7,_0x1231f1){return new BPromise(function(_0x237092,_0x400a02){return client['request'](_0x3055d7,_0x1231f1)[_0x0878('0xb')](function(_0x4a1c4b){logger[_0x0878('0xc')](_0x0878('0xd'),_0xfcc3e7,_0x0878('0xe'));logger['debug'](_0x0878('0xf'),_0xfcc3e7,'request\x20sent',JSON[_0x0878('0x10')](_0x4a1c4b));if(_0x4a1c4b['error']){if(_0x4a1c4b['error'][_0x0878('0x11')]===0x1f4){logger['error'](_0x0878('0xd'),_0xfcc3e7,_0x4a1c4b[_0x0878('0x12')][_0x0878('0x13')]);return _0x400a02(_0x4a1c4b[_0x0878('0x12')][_0x0878('0x13')]);}logger[_0x0878('0x12')](_0x0878('0xd'),_0xfcc3e7,_0x4a1c4b['error'][_0x0878('0x13')]);return _0x237092(_0x4a1c4b[_0x0878('0x12')]['message']);}else{logger[_0x0878('0xc')]('Setting,\x20%s,\x20%s',_0xfcc3e7,_0x0878('0xe'));_0x237092(_0x4a1c4b[_0x0878('0x14')]['message']);}})[_0x0878('0x15')](function(_0x167f3d){logger['error']('Setting,\x20%s,\x20%s',_0xfcc3e7,_0x167f3d);_0x400a02(_0x167f3d);});});}exports[_0x0878('0x16')]=function(_0x469e40){var _0x4285e2=this;return new Promise(function(_0x4f4fa5,_0x2b4beb){return db[_0x0878('0x17')]['find']({'raw':_0x469e40['options']?_0x469e40[_0x0878('0x18')][_0x0878('0x19')]===undefined?!![]:![]:!![],'where':_0x469e40[_0x0878('0x18')]?_0x469e40[_0x0878('0x18')][_0x0878('0x1a')]||null:null,'attributes':_0x469e40[_0x0878('0x18')]?_0x469e40[_0x0878('0x18')][_0x0878('0x1b')]||null:null,'include':_0x469e40['options']?_0x469e40[_0x0878('0x18')][_0x0878('0x1c')]?_[_0x0878('0x1d')](_0x469e40['options'][_0x0878('0x1c')],function(_0x5f1194){return{'model':db[_0x5f1194['model']],'as':_0x5f1194['as'],'attributes':_0x5f1194[_0x0878('0x1b')],'include':_0x5f1194[_0x0878('0x1c')]?_[_0x0878('0x1d')](_0x5f1194[_0x0878('0x1c')],function(_0x17196d){return{'model':db[_0x17196d[_0x0878('0x1e')]],'as':_0x17196d['as'],'attributes':_0x17196d[_0x0878('0x1b')],'include':_0x17196d[_0x0878('0x1c')]?_[_0x0878('0x1d')](_0x17196d[_0x0878('0x1c')],function(_0x29a9d3){return{'model':db[_0x29a9d3[_0x0878('0x1e')]],'as':_0x29a9d3['as'],'attributes':_0x29a9d3[_0x0878('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0878('0xb')](function(_0x216924){logger[_0x0878('0xc')](_0x0878('0x16'),_0x469e40);logger[_0x0878('0x1f')](_0x0878('0x16'),_0x469e40,JSON['stringify'](_0x216924));_0x4f4fa5(_0x216924);})['catch'](function(_0x22f5c5){logger[_0x0878('0x12')](_0x0878('0x16'),_0x22f5c5[_0x0878('0x13')],_0x469e40);_0x2b4beb(_0x4285e2['error'](0x1f4,_0x22f5c5[_0x0878('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 10f20ca..a278079 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 _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7217,0x19e));var _0x7721=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7217[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x814b=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0x3541e4,_0x4dcf9a){var _0x3ca5d9=function(_0x3eaac2){while(--_0x3eaac2){_0x3541e4['push'](_0x3541e4['shift']());}};_0x3ca5d9(++_0x4dcf9a);}(_0x814b,0x1a2));var _0xb814=function(_0x4d0df6,_0x4634f3){_0x4d0df6=_0x4d0df6-0x0;var _0x4e2615=_0x814b[_0x4d0df6];return _0x4e2615;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0xa')](_0xb814('0x16'),auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0xa')](_0xb814('0x18'),controller[_0xb814('0x19')]);router[_0xb814('0xa')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router[_0xb814('0x1c')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x1e')]);router['post'](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x1f')]);router[_0xb814('0x1c')]('/:id/notify',controller['notify']);router['post'](_0xb814('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb814('0x1c')](_0xb814('0x20'),auth[_0xb814('0xb')](),controller['send']);router[_0xb814('0x1c')]('/:id/status',controller[_0xb814('0x21')]);router[_0xb814('0x1c')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x22')]);router[_0xb814('0x23')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x24')]);router['delete'](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x25')]);router[_0xb814('0x26')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x27')]);router['delete'](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x28')]);router[_0xb814('0x26')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x29')]);module[_0xb814('0x2a')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index b64c688..bdc03dd 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 _0x0f12=['sequelize','randomstring','exports','STRING','ENUM','twilio','skebby','clicksend','plivo','clickatell','infobip','intelepeer','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x0f12,0x72));var _0x20f1=function(_0x3726b8,_0x3593ad){_0x3726b8=_0x3726b8-0x0;var _0x1fcb0f=_0x0f12[_0x3726b8];return _0x1fcb0f;};'use strict';var Sequelize=require(_0x20f1('0x0'));var rs=require(_0x20f1('0x1'));module[_0x20f1('0x2')]={'name':{'type':Sequelize[_0x20f1('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x20f1('0x3')]},'type':{'type':Sequelize[_0x20f1('0x4')](_0x20f1('0x5'),_0x20f1('0x6'),'connectel',_0x20f1('0x7'),_0x20f1('0x8'),_0x20f1('0x9'),'bandwidth','csc',_0x20f1('0xa'),_0x20f1('0xb'))},'accountSid':{'type':Sequelize[_0x20f1('0x3')]},'authId':{'type':Sequelize[_0x20f1('0x3')]},'authToken':{'type':Sequelize[_0x20f1('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x20f1('0x3')]},'password':{'type':Sequelize[_0x20f1('0x3')]},'apiKey':{'type':Sequelize[_0x20f1('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x20f1('0x3')]},'senderString':{'type':Sequelize[_0x20f1('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x20f1('0x3')]},'notificationTemplate':{'type':Sequelize[_0x20f1('0xc')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x20f1('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x20f1('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x20f1('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x20f1('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x20f1('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x20f1('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x20f1('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x20f1('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x20f1('0xe')],'comment':_0x20f1('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x20f1('0x10'),'set':function(_0x418beb){if(!_0x418beb)this[_0x20f1('0x11')]('mandatoryDispositionPauseId',null);this[_0x20f1('0x11')](_0x20f1('0x12'),_0x418beb);}}}; \ No newline at end of file +var _0x3358=['randomstring','STRING','generate','ENUM','twilio','skebby','connectel','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize'];(function(_0x5a7720,_0x2785ec){var _0x3ea5ab=function(_0x52b500){while(--_0x52b500){_0x5a7720['push'](_0x5a7720['shift']());}};_0x3ea5ab(++_0x2785ec);}(_0x3358,0x1db));var _0x8335=function(_0x530c3c,_0x482711){_0x530c3c=_0x530c3c-0x0;var _0xac1986=_0x3358[_0x530c3c];return _0xac1986;};'use strict';var Sequelize=require(_0x8335('0x0'));var rs=require(_0x8335('0x1'));module['exports']={'name':{'type':Sequelize[_0x8335('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x8335('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x8335('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x8335('0x2')],'defaultValue':function(){return rs[_0x8335('0x3')]();}},'phone':{'type':Sequelize[_0x8335('0x2')]},'type':{'type':Sequelize[_0x8335('0x4')](_0x8335('0x5'),_0x8335('0x6'),_0x8335('0x7'),'clicksend','plivo','clickatell','bandwidth',_0x8335('0x8'),_0x8335('0x9'),_0x8335('0xa'))},'accountSid':{'type':Sequelize[_0x8335('0x2')]},'authId':{'type':Sequelize[_0x8335('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x8335('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x8335('0x2')]},'password':{'type':Sequelize[_0x8335('0x2')]},'apiKey':{'type':Sequelize[_0x8335('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x8335('0x2')]},'senderString':{'type':Sequelize[_0x8335('0x2')]},'deliveryReport':{'type':Sequelize[_0x8335('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x8335('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8335('0xc');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8335('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8335('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8335('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8335('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8335('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x8335('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8335('0xd')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8335('0xe'),'set':function(_0x3fda62){if(!_0x3fda62)this[_0x8335('0xf')](_0x8335('0x10'),null);this[_0x8335('0xf')]('mandatoryDisposition',_0x3fda62);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 57c7501..324ee73 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 _0x1c2a=['orderBy','priority','asc','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','Body','messageId','skebby','sender','text','clicksend','message_id','plivo','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','intelepeer','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','contact','SmsInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','stringify','twilio','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','stack','finally','getApplications','getInteractions','Contact','User','Owner','color','tag','to\x20is\x20mandatory','List','out','Messages','SmsMessage','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','statusInt','requestid','status_code','infobip','DELIVERED','groupName','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','state','message-id','ids','omit','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./smsAccount.socket','jayson/promise','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','get','SmsAccounts','UserProfileResource','sendStatus','name','send','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','getDispositions','pick','SmsAccountId','Disposition','rows','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','Applications','account','applications'];(function(_0x4f0bb8,_0x321fab){var _0x22bbb2=function(_0x1c4558){while(--_0x1c4558){_0x4f0bb8['push'](_0x4f0bb8['shift']());}};_0x22bbb2(++_0x321fab);}(_0x1c2a,0x71));var _0xa1c2=function(_0x438eb2,_0x56a325){_0x438eb2=_0x438eb2-0x0;var _0x2ab503=_0x1c2a[_0x438eb2];return _0x2ab503;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1c2('0x0'));var zipdir=require(_0xa1c2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1c2('0x2'));var moment=require(_0xa1c2('0x3'));var BPromise=require(_0xa1c2('0x4'));var Mustache=require(_0xa1c2('0x5'));var util=require('util');var path=require(_0xa1c2('0x6'));var sox=require(_0xa1c2('0x7'));var csv=require('to-csv');var ejs=require(_0xa1c2('0x8'));var fs=require('fs');var fs_extra=require(_0xa1c2('0x9'));var _=require(_0xa1c2('0xa'));var squel=require(_0xa1c2('0xb'));var crypto=require(_0xa1c2('0xc'));var jsforce=require(_0xa1c2('0xd'));var deskjs=require(_0xa1c2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa1c2('0xf'));var Papa=require(_0xa1c2('0x10'));var Redis=require(_0xa1c2('0x11'));var authService=require(_0xa1c2('0x12'));var qs=require(_0xa1c2('0x13'));var as=require(_0xa1c2('0x14'));var hardwareService=require(_0xa1c2('0x15'));var logger=require('../../config/logger')(_0xa1c2('0x16'));var utils=require(_0xa1c2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa1c2('0x18'));var db=require(_0xa1c2('0x19'))['db'];config[_0xa1c2('0x1a')]=_[_0xa1c2('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa1c2('0x1a')]));require(_0xa1c2('0x1c'))['register'](socket);var jayson=require(_0xa1c2('0x1d'));var client=jayson[_0xa1c2('0x1e')][_0xa1c2('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x5144e2,_0x401ace,_0x5aebc4,_0x80ebf9){return new BPromise(function(_0x4ffcb5,_0x38911b){var _0x7b91f7=_0x80ebf9||client;return _0x7b91f7[_0xa1c2('0x20')](_0x5144e2,_0x5aebc4)['then'](function(_0x53d1a4){logger[_0xa1c2('0x21')](_0xa1c2('0x22'),_0x401ace,_0xa1c2('0x23'));logger[_0xa1c2('0x24')](_0xa1c2('0x25'),_0x401ace,_0xa1c2('0x23'),JSON['stringify'](_0x53d1a4));if(_0x53d1a4[_0xa1c2('0x26')]){if(_0x53d1a4[_0xa1c2('0x26')][_0xa1c2('0x27')]===0x1f4){logger[_0xa1c2('0x26')](_0xa1c2('0x22'),_0x401ace,_0x53d1a4[_0xa1c2('0x26')][_0xa1c2('0x28')]);return _0x38911b(_0x53d1a4[_0xa1c2('0x26')]['message']);}logger[_0xa1c2('0x26')](_0xa1c2('0x22'),_0x401ace,_0x53d1a4[_0xa1c2('0x26')][_0xa1c2('0x28')]);return _0x4ffcb5(_0x53d1a4[_0xa1c2('0x26')][_0xa1c2('0x28')]);}else{logger[_0xa1c2('0x21')](_0xa1c2('0x22'),_0x401ace,_0xa1c2('0x23'));_0x4ffcb5(_0x53d1a4[_0xa1c2('0x29')][_0xa1c2('0x28')]);}})[_0xa1c2('0x2a')](function(_0x3e8acf){logger[_0xa1c2('0x26')](_0xa1c2('0x22'),_0x401ace,_0x3e8acf);_0x38911b(_0x3e8acf);});});}function respondWithStatusCode(_0xbd83c3,_0x54bec1){_0x54bec1=_0x54bec1||0xcc;return function(_0x3c642b){if(_0x3c642b){return _0xbd83c3['sendStatus'](_0x54bec1);}return _0xbd83c3[_0xa1c2('0x2b')](_0x54bec1)[_0xa1c2('0x2c')]();};}function respondWithResult(_0x456b3e,_0x4aa8d3){_0x4aa8d3=_0x4aa8d3||0xc8;return function(_0x2d2530){if(_0x2d2530){return _0x456b3e[_0xa1c2('0x2b')](_0x4aa8d3)[_0xa1c2('0x2d')](_0x2d2530);}};}function respondWithFilteredResult(_0x451225,_0x52af0e){return function(_0x7247d2){if(_0x7247d2){var _0x3dd1bf=typeof _0x52af0e['offset']===_0xa1c2('0x2e')&&typeof _0x52af0e[_0xa1c2('0x2f')]===_0xa1c2('0x2e');var _0x3634b7=_0x7247d2['count'];var _0x2399c7=_0x3dd1bf?0x0:_0x52af0e[_0xa1c2('0x30')];var _0x109a26=_0x3dd1bf?_0x7247d2[_0xa1c2('0x31')]:_0x52af0e[_0xa1c2('0x30')]+_0x52af0e['limit'];var _0x495af6;if(_0x109a26>=_0x3634b7){_0x109a26=_0x3634b7;_0x495af6=0xc8;}else{_0x495af6=0xce;}_0x451225[_0xa1c2('0x2b')](_0x495af6);return _0x451225[_0xa1c2('0x32')](_0xa1c2('0x33'),_0x2399c7+'-'+_0x109a26+'/'+_0x3634b7)[_0xa1c2('0x2d')](_0x7247d2);}return null;};}function patchUpdates(_0x4bed58){return function(_0x1ab547){try{jsonpatch['apply'](_0x1ab547,_0x4bed58,!![]);}catch(_0x34b0fd){return BPromise[_0xa1c2('0x34')](_0x34b0fd);}return _0x1ab547[_0xa1c2('0x35')]();};}function saveUpdates(_0x439c5c,_0x17b3c0){return function(_0x5b80ad){if(_0x5b80ad){return _0x5b80ad[_0xa1c2('0x36')](_0x439c5c)[_0xa1c2('0x37')](function(_0x544502){return _0x544502;});}return null;};}function removeEntity(_0x28092e,_0xb18922){return function(_0x2f1237){if(_0x2f1237){return _0x2f1237[_0xa1c2('0x38')]()[_0xa1c2('0x37')](function(){var _0x2284f4=_0x2f1237[_0xa1c2('0x39')]({'plain':!![]});var _0x303181=_0xa1c2('0x3a');return db[_0xa1c2('0x3b')][_0xa1c2('0x38')]({'where':{'type':_0x303181,'resourceId':_0x2284f4['id']}})['then'](function(){return _0x2f1237;});})[_0xa1c2('0x37')](function(){_0x28092e['status'](0xcc)[_0xa1c2('0x2c')]();});}};}function handleEntityNotFound(_0x4951d9,_0x4aa284){return function(_0x319137){if(!_0x319137){_0x4951d9[_0xa1c2('0x3c')](0x194);}return _0x319137;};}function handleError(_0x1bc1f4,_0x1785c1){_0x1785c1=_0x1785c1||0x1f4;return function(_0x57c003){logger[_0xa1c2('0x26')](_0x57c003['stack']);if(_0x57c003[_0xa1c2('0x3d')]){delete _0x57c003[_0xa1c2('0x3d')];}_0x1bc1f4[_0xa1c2('0x2b')](_0x1785c1)[_0xa1c2('0x3e')](_0x57c003);};}exports[_0xa1c2('0x3f')]=function(_0x2a7787,_0x2ffc2d){var _0x16e777={'include':[{'model':db['Pause'],'as':_0xa1c2('0x40')}]},_0x341476={},_0x328d10={'count':0x0,'rows':[]};var _0x9fcde0=_[_0xa1c2('0x41')](db[_0xa1c2('0x42')][_0xa1c2('0x43')],function(_0x8e50a0){return{'name':_0x8e50a0[_0xa1c2('0x44')],'type':_0x8e50a0[_0xa1c2('0x45')][_0xa1c2('0x46')]};});_0x341476[_0xa1c2('0x47')]=_[_0xa1c2('0x41')](_0x9fcde0,_0xa1c2('0x3d'));_0x341476['query']=_[_0xa1c2('0x48')](_0x2a7787[_0xa1c2('0x49')]);_0x341476['filters']=_[_0xa1c2('0x4a')](_0x341476[_0xa1c2('0x47')],_0x341476[_0xa1c2('0x49')]);_0x16e777['attributes']=_['intersection'](_0x341476[_0xa1c2('0x47')],qs[_0xa1c2('0x4b')](_0x2a7787[_0xa1c2('0x49')][_0xa1c2('0x4b')]));_0x16e777[_0xa1c2('0x4c')]=_0x16e777[_0xa1c2('0x4c')][_0xa1c2('0x4d')]?_0x16e777['attributes']:_0x341476[_0xa1c2('0x47')];if(!_0x2a7787[_0xa1c2('0x49')][_0xa1c2('0x4e')](_0xa1c2('0x4f'))){_0x16e777[_0xa1c2('0x2f')]=qs['limit'](_0x2a7787[_0xa1c2('0x49')]['limit']);_0x16e777[_0xa1c2('0x30')]=qs[_0xa1c2('0x30')](_0x2a7787[_0xa1c2('0x49')][_0xa1c2('0x30')]);}_0x16e777[_0xa1c2('0x50')]=qs[_0xa1c2('0x51')](_0x2a7787[_0xa1c2('0x49')][_0xa1c2('0x51')]);_0x16e777[_0xa1c2('0x52')]=qs[_0xa1c2('0x53')](_['pick'](_0x2a7787[_0xa1c2('0x49')],_0x341476[_0xa1c2('0x53')]),_0x9fcde0);if(_0x2a7787[_0xa1c2('0x49')]['filter']){_0x16e777['where']=_['merge'](_0x16e777[_0xa1c2('0x52')],{'$or':_['map'](_0x9fcde0,function(_0x5d8322){if(_0x5d8322['type']!==_0xa1c2('0x54')){var _0x58d72d={};_0x58d72d[_0x5d8322[_0xa1c2('0x3d')]]={'$like':'%'+_0x2a7787[_0xa1c2('0x49')][_0xa1c2('0x55')]+'%'};return _0x58d72d;}})});}_0x16e777=_[_0xa1c2('0x56')]({},_0x16e777,_0x2a7787[_0xa1c2('0x57')]);var _0x5a66fa={'where':_0x16e777[_0xa1c2('0x52')]};return db['SmsAccount']['count'](_0x5a66fa)[_0xa1c2('0x37')](function(_0x3cd5e9){_0x328d10['count']=_0x3cd5e9;if(_0x2a7787['query'][_0xa1c2('0x58')]){_0x16e777[_0xa1c2('0x59')]=[{'all':!![]}];}return db[_0xa1c2('0x42')][_0xa1c2('0x5a')](_0x16e777);})[_0xa1c2('0x37')](function(_0x3e0895){_0x328d10['rows']=_0x3e0895;return _0x328d10;})['then'](respondWithFilteredResult(_0x2ffc2d,_0x16e777))['catch'](handleError(_0x2ffc2d,null));};exports[_0xa1c2('0x5b')]=function(_0x248300,_0x13a33b){var _0x504386={'raw':![],'where':{'id':_0x248300[_0xa1c2('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xa1c2('0x40')}]},_0x1d4db3={};_0x1d4db3[_0xa1c2('0x47')]=_[_0xa1c2('0x48')](db['SmsAccount']['rawAttributes']);_0x1d4db3[_0xa1c2('0x49')]=_['keys'](_0x248300[_0xa1c2('0x49')]);_0x1d4db3[_0xa1c2('0x53')]=_[_0xa1c2('0x4a')](_0x1d4db3[_0xa1c2('0x47')],_0x1d4db3[_0xa1c2('0x49')]);_0x504386[_0xa1c2('0x4c')]=_[_0xa1c2('0x4a')](_0x1d4db3['model'],qs[_0xa1c2('0x4b')](_0x248300[_0xa1c2('0x49')][_0xa1c2('0x4b')]));_0x504386[_0xa1c2('0x4c')]=_0x504386[_0xa1c2('0x4c')][_0xa1c2('0x4d')]?_0x504386[_0xa1c2('0x4c')]:_0x1d4db3[_0xa1c2('0x47')];if(_0x248300[_0xa1c2('0x49')]['includeAll']){_0x504386[_0xa1c2('0x59')]=[{'all':!![]}];}_0x504386=_[_0xa1c2('0x56')]({},_0x504386,_0x248300[_0xa1c2('0x57')]);return db['SmsAccount'][_0xa1c2('0x5d')](_0x504386)[_0xa1c2('0x37')](handleEntityNotFound(_0x13a33b,null))[_0xa1c2('0x37')](respondWithResult(_0x13a33b,null))['catch'](handleError(_0x13a33b,null));};exports[_0xa1c2('0x5e')]=function(_0x518b64,_0x2ecb5c){return db[_0xa1c2('0x42')][_0xa1c2('0x5e')](_0x518b64[_0xa1c2('0x5f')],{})[_0xa1c2('0x37')](function(_0xdc6425){var _0x21962b=_0x518b64[_0xa1c2('0x60')][_0xa1c2('0x39')]({'plain':!![]});if(!_0x21962b)throw new Error(_0xa1c2('0x61'));if(_0x21962b['role']==='user'){var _0x234cec=_0xdc6425[_0xa1c2('0x39')]({'plain':!![]});var _0x543083=_0xa1c2('0x3a');return db[_0xa1c2('0x62')][_0xa1c2('0x5d')]({'where':{'name':_0x543083,'userProfileId':_0x21962b[_0xa1c2('0x63')]},'raw':!![]})[_0xa1c2('0x37')](function(_0x18d5fe){if(_0x18d5fe&&_0x18d5fe[_0xa1c2('0x64')]===0x0){return db[_0xa1c2('0x3b')]['create']({'name':_0x234cec[_0xa1c2('0x3d')],'resourceId':_0x234cec['id'],'type':_0x18d5fe[_0xa1c2('0x3d')],'sectionId':_0x18d5fe['id']},{})[_0xa1c2('0x37')](function(){return _0xdc6425;});}else{return _0xdc6425;}})[_0xa1c2('0x2a')](function(_0x1b2b73){logger[_0xa1c2('0x26')](_0xa1c2('0x65'),_0x1b2b73);throw _0x1b2b73;});}return _0xdc6425;})[_0xa1c2('0x37')](respondWithResult(_0x2ecb5c,0xc9))[_0xa1c2('0x2a')](handleError(_0x2ecb5c,null));};exports[_0xa1c2('0x36')]=function(_0x4033c7,_0xf8ef7){if(_0x4033c7['body']['id']){delete _0x4033c7[_0xa1c2('0x5f')]['id'];}return db[_0xa1c2('0x42')]['find']({'where':{'id':_0x4033c7[_0xa1c2('0x5c')]['id']},'include':[{'model':db[_0xa1c2('0x66')],'as':_0xa1c2('0x40')}]})[_0xa1c2('0x37')](handleEntityNotFound(_0xf8ef7,null))[_0xa1c2('0x37')](saveUpdates(_0x4033c7['body'],null))[_0xa1c2('0x37')](respondWithResult(_0xf8ef7,null))[_0xa1c2('0x2a')](handleError(_0xf8ef7,null));};exports[_0xa1c2('0x38')]=function(_0x4683fc,_0x3f1238){return db[_0xa1c2('0x42')][_0xa1c2('0x5d')]({'where':{'id':_0x4683fc[_0xa1c2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3f1238,null))['then'](removeEntity(_0x3f1238,null))[_0xa1c2('0x2a')](handleError(_0x3f1238,null));};exports[_0xa1c2('0x67')]=function(_0x1bb62b,_0x5c10e3){return db[_0xa1c2('0x42')][_0xa1c2('0x67')]()[_0xa1c2('0x37')](respondWithResult(_0x5c10e3,null))[_0xa1c2('0x2a')](handleError(_0x5c10e3,null));};exports[_0xa1c2('0x68')]=function(_0x3cf6f2,_0x4dccdf,_0x158fa4){if(_0x3cf6f2[_0xa1c2('0x5f')]['id']){delete _0x3cf6f2[_0xa1c2('0x5f')]['id'];}return db[_0xa1c2('0x42')][_0xa1c2('0x5d')]({'where':{'id':_0x3cf6f2[_0xa1c2('0x5c')]['id']}})[_0xa1c2('0x37')](handleEntityNotFound(_0x4dccdf,null))['then'](function(_0x3929bf){if(_0x3929bf){_0x3cf6f2[_0xa1c2('0x5f')]['SmsAccountId']=_0x3929bf['id'];return db['Disposition'][_0xa1c2('0x5e')](_0x3cf6f2['body']);}})[_0xa1c2('0x37')](respondWithResult(_0x4dccdf,null))[_0xa1c2('0x2a')](handleError(_0x4dccdf,null));};exports[_0xa1c2('0x69')]=function(_0x35991c,_0x307e88,_0x1490d6){var _0x4326d9={'raw':![],'where':{}};var _0x151e96={};var _0x2391e5={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x35991c[_0xa1c2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x307e88,null))['then'](function(_0x4668c1){if(_0x4668c1){_0x151e96[_0xa1c2('0x47')]=_[_0xa1c2('0x48')](db['Disposition'][_0xa1c2('0x43')]);_0x151e96['query']=_[_0xa1c2('0x48')](_0x35991c[_0xa1c2('0x49')]);_0x151e96[_0xa1c2('0x53')]=_[_0xa1c2('0x4a')](_0x151e96[_0xa1c2('0x47')],_0x151e96['query']);_0x4326d9[_0xa1c2('0x4c')]=_[_0xa1c2('0x4a')](_0x151e96[_0xa1c2('0x47')],qs['fields'](_0x35991c[_0xa1c2('0x49')][_0xa1c2('0x4b')]));_0x4326d9[_0xa1c2('0x4c')]=_0x4326d9[_0xa1c2('0x4c')][_0xa1c2('0x4d')]?_0x4326d9[_0xa1c2('0x4c')]:_0x151e96[_0xa1c2('0x47')];if(!_0x35991c[_0xa1c2('0x49')][_0xa1c2('0x4e')]('nolimit')){_0x4326d9[_0xa1c2('0x2f')]=qs['limit'](_0x35991c['query']['limit']);_0x4326d9[_0xa1c2('0x30')]=qs[_0xa1c2('0x30')](_0x35991c[_0xa1c2('0x49')][_0xa1c2('0x30')]);}_0x4326d9[_0xa1c2('0x50')]=qs[_0xa1c2('0x51')](_0x35991c[_0xa1c2('0x49')][_0xa1c2('0x51')]);_0x4326d9[_0xa1c2('0x52')]=qs[_0xa1c2('0x53')](_[_0xa1c2('0x6a')](_0x35991c[_0xa1c2('0x49')],_0x151e96['filters']));_0x4326d9['where'][_0xa1c2('0x6b')]=_0x4668c1['id'];if(_0x35991c[_0xa1c2('0x49')][_0xa1c2('0x55')]){_0x4326d9['where']=_[_0xa1c2('0x56')](_0x4326d9['where'],{'$or':_['map'](_0x4326d9['attributes'],function(_0x43133e){var _0x1231a2={};_0x1231a2[_0x43133e]={'$like':'%'+_0x35991c[_0xa1c2('0x49')]['filter']+'%'};return _0x1231a2;})});}_0x4326d9=_[_0xa1c2('0x56')]({},_0x4326d9,_0x35991c[_0xa1c2('0x57')]);return db[_0xa1c2('0x6c')][_0xa1c2('0x31')]({'where':_0x4326d9[_0xa1c2('0x52')]})[_0xa1c2('0x37')](function(_0x5c6e57){_0x2391e5['count']=_0x5c6e57;if(_0x35991c['query'][_0xa1c2('0x58')]){_0x4326d9['include']=[{'all':!![]}];}return db[_0xa1c2('0x6c')]['findAll'](_0x4326d9);})[_0xa1c2('0x37')](function(_0x378402){_0x2391e5[_0xa1c2('0x6d')]=_0x378402;return _0x2391e5;});}})[_0xa1c2('0x37')](respondWithFilteredResult(_0x307e88,_0x4326d9))['catch'](handleError(_0x307e88,null));};exports['removeDispositions']=function(_0x1045e7,_0x3a6628,_0x164329){return db[_0xa1c2('0x42')][_0xa1c2('0x5d')]({'where':{'id':_0x1045e7[_0xa1c2('0x5c')]['id']}})[_0xa1c2('0x37')](handleEntityNotFound(_0x3a6628,null))['then'](function(_0x2b3f37){if(_0x2b3f37){return _0x2b3f37['removeDispositions'](_0x1045e7[_0xa1c2('0x49')]['ids']);}})['then'](respondWithStatusCode(_0x3a6628,null))['catch'](handleError(_0x3a6628,null));};exports[_0xa1c2('0x6e')]=function(_0x2024ee,_0x6033a9,_0x56bf77){if(_0x2024ee[_0xa1c2('0x5f')]['id']){delete _0x2024ee['body']['id'];}return db[_0xa1c2('0x42')][_0xa1c2('0x5d')]({'where':{'id':_0x2024ee[_0xa1c2('0x5c')]['id']}})[_0xa1c2('0x37')](handleEntityNotFound(_0x6033a9,null))['then'](function(_0x3f36b4){if(_0x3f36b4){_0x2024ee[_0xa1c2('0x5f')][_0xa1c2('0x6b')]=_0x3f36b4['id'];return db[_0xa1c2('0x6f')][_0xa1c2('0x5e')](_0x2024ee[_0xa1c2('0x5f')]);}})[_0xa1c2('0x37')](respondWithResult(_0x6033a9,null))['catch'](handleError(_0x6033a9,null));};exports[_0xa1c2('0x70')]=function(_0x1c50d9,_0x3ecbf3,_0x2fe457){var _0x321ae9={'raw':![],'where':{}};var _0xd8f15={};var _0x273f86={'count':0x0,'rows':[]};return db[_0xa1c2('0x42')][_0xa1c2('0x71')]({'where':{'id':_0x1c50d9[_0xa1c2('0x5c')]['id']}})[_0xa1c2('0x37')](handleEntityNotFound(_0x3ecbf3,null))[_0xa1c2('0x37')](function(_0x2f7098){if(_0x2f7098){_0xd8f15['model']=_[_0xa1c2('0x48')](db[_0xa1c2('0x6f')]['rawAttributes']);_0xd8f15[_0xa1c2('0x49')]=_[_0xa1c2('0x48')](_0x1c50d9[_0xa1c2('0x49')]);_0xd8f15[_0xa1c2('0x53')]=_[_0xa1c2('0x4a')](_0xd8f15[_0xa1c2('0x47')],_0xd8f15[_0xa1c2('0x49')]);_0x321ae9[_0xa1c2('0x4c')]=_[_0xa1c2('0x4a')](_0xd8f15['model'],qs[_0xa1c2('0x4b')](_0x1c50d9['query'][_0xa1c2('0x4b')]));_0x321ae9[_0xa1c2('0x4c')]=_0x321ae9[_0xa1c2('0x4c')][_0xa1c2('0x4d')]?_0x321ae9['attributes']:_0xd8f15[_0xa1c2('0x47')];if(!_0x1c50d9[_0xa1c2('0x49')][_0xa1c2('0x4e')](_0xa1c2('0x4f'))){_0x321ae9['limit']=qs[_0xa1c2('0x2f')](_0x1c50d9[_0xa1c2('0x49')][_0xa1c2('0x2f')]);_0x321ae9[_0xa1c2('0x30')]=qs['offset'](_0x1c50d9[_0xa1c2('0x49')]['offset']);}_0x321ae9[_0xa1c2('0x50')]=qs[_0xa1c2('0x51')](_0x1c50d9[_0xa1c2('0x49')][_0xa1c2('0x51')]);_0x321ae9['where']=qs[_0xa1c2('0x53')](_[_0xa1c2('0x6a')](_0x1c50d9[_0xa1c2('0x49')],_0xd8f15[_0xa1c2('0x53')]));_0x321ae9[_0xa1c2('0x52')][_0xa1c2('0x6b')]=_0x2f7098['id'];if(_0x1c50d9[_0xa1c2('0x49')][_0xa1c2('0x55')]){_0x321ae9[_0xa1c2('0x52')]=_['merge'](_0x321ae9[_0xa1c2('0x52')],{'$or':_[_0xa1c2('0x41')](_0x321ae9[_0xa1c2('0x4c')],function(_0x281204){var _0x32fa86={};_0x32fa86[_0x281204]={'$like':'%'+_0x1c50d9[_0xa1c2('0x49')][_0xa1c2('0x55')]+'%'};return _0x32fa86;})});}_0x321ae9=_['merge']({},_0x321ae9,_0x1c50d9['options']);return db[_0xa1c2('0x6f')][_0xa1c2('0x31')]({'where':_0x321ae9[_0xa1c2('0x52')]})[_0xa1c2('0x37')](function(_0xa32d9c){_0x273f86['count']=_0xa32d9c;if(_0x1c50d9['query'][_0xa1c2('0x58')]){_0x321ae9[_0xa1c2('0x59')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x321ae9);})['then'](function(_0x3a5f52){_0x273f86[_0xa1c2('0x6d')]=_0x3a5f52;return _0x273f86;});}})[_0xa1c2('0x37')](respondWithFilteredResult(_0x3ecbf3,_0x321ae9))[_0xa1c2('0x2a')](handleError(_0x3ecbf3,null));};exports[_0xa1c2('0x72')]=function(_0xc74c93,_0x3b000a,_0x1bfa66){return db[_0xa1c2('0x42')][_0xa1c2('0x5d')]({'where':{'id':_0xc74c93['params']['id']}})['then'](handleEntityNotFound(_0x3b000a,null))['then'](function(_0x251e40){if(_0x251e40){return _0x251e40[_0xa1c2('0x72')](_0xc74c93['query']['ids']);}})[_0xa1c2('0x37')](respondWithStatusCode(_0x3b000a,null))[_0xa1c2('0x2a')](handleError(_0x3b000a,null));};exports[_0xa1c2('0x73')]=function(_0x41cf60,_0x1f5f24,_0x30ce7d){var _0x2fca65={'channel':'sms'};var _0x3c8d73=[];var _0x21dc60=[];var _0x5a4206={};return db[_0xa1c2('0x42')][_0xa1c2('0x5d')]({'where':{'id':_0x41cf60[_0xa1c2('0x5c')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xa1c2('0x74')}]})['then'](handleEntityNotFound(_0x1f5f24,null))[_0xa1c2('0x37')](function(_0x3bba65){_0x2fca65[_0xa1c2('0x75')]=_0x3bba65;_0x2fca65[_0xa1c2('0x76')]=_[_0xa1c2('0x77')](_0x3bba65[_0xa1c2('0x74')],[_0xa1c2('0x78')],[_0xa1c2('0x79')]);if(_0x2fca65[_0xa1c2('0x75')]['Applications']){delete _0x2fca65['account']['Applications'];}return db['CmContact']['describe']();})[_0xa1c2('0x37')](function(_0x5c4ed1){if(!_0x5c4ed1){throw new db['Sequelize'][(_0xa1c2('0x7a'))]('no\x20available\x20attributes');}_0x3c8d73=_[_0xa1c2('0x7b')](_['keys'](_0x5c4ed1),[_0xa1c2('0x7c'),_0xa1c2('0x7d')]);_0x21dc60=_[_0xa1c2('0x7b')](_[_0xa1c2('0x48')](_0x5c4ed1),['createdAt',_0xa1c2('0x7d'),_0xa1c2('0x7e'),_0xa1c2('0x7f')]);_0x2fca65[_0xa1c2('0x5f')]={'mapKey':_0xa1c2('0x80')};if(_0x2fca65[_0xa1c2('0x75')][_0xa1c2('0x45')]){switch(_0x2fca65['account'][_0xa1c2('0x45')]){case'twilio':_0x2fca65['body'][_0xa1c2('0x81')]=_0x41cf60[_0xa1c2('0x5f')][_0xa1c2('0x82')];_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x5f')]=_0x41cf60['body'][_0xa1c2('0x83')];_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x84')]=_0x41cf60['body']['MessageSid'];break;case _0xa1c2('0x85'):_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x81')]='+'+_0x41cf60['body'][_0xa1c2('0x86')];_0x2fca65['body'][_0xa1c2('0x5f')]=_0x41cf60[_0xa1c2('0x5f')][_0xa1c2('0x87')];break;case'connectel':_0x2fca65['body'][_0xa1c2('0x81')]=_0x41cf60[_0xa1c2('0x5f')][_0xa1c2('0x81')];_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x5f')]=_0x41cf60[_0xa1c2('0x5f')][_0xa1c2('0x28')];break;case _0xa1c2('0x88'):_0x2fca65['body'][_0xa1c2('0x81')]=_0x41cf60[_0xa1c2('0x5f')]['from'];_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x5f')]=_0x41cf60['body']['body'];_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x84')]=_0x41cf60[_0xa1c2('0x5f')][_0xa1c2('0x89')];break;case _0xa1c2('0x8a'):_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x81')]=_0x41cf60[_0xa1c2('0x5f')][_0xa1c2('0x82')];_0x2fca65[_0xa1c2('0x5f')]['body']=_0x41cf60[_0xa1c2('0x5f')]['Text'];_0x2fca65[_0xa1c2('0x5f')]['messageId']=_0x41cf60['body'][_0xa1c2('0x8b')];break;case'infobip':_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x81')]='+'+_0x41cf60['body']['results'][0x0][_0xa1c2('0x81')];_0x2fca65['body']['body']=_0x41cf60[_0xa1c2('0x5f')][_0xa1c2('0x8c')][0x0][_0xa1c2('0x87')];_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x84')]=_0x41cf60[_0xa1c2('0x5f')][_0xa1c2('0x8c')][0x0][_0xa1c2('0x84')];break;case _0xa1c2('0x8d'):_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x81')]=_0x41cf60[_0xa1c2('0x5f')][_0xa1c2('0x8e')];_0x2fca65['body'][_0xa1c2('0x5f')]=_0x41cf60[_0xa1c2('0x5f')][_0xa1c2('0x8f')][_0xa1c2('0x28')];break;case _0xa1c2('0x90'):_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x81')]=_0x41cf60[_0xa1c2('0x5f')]['fromNumber'];_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x5f')]=_0x41cf60[_0xa1c2('0x5f')][_0xa1c2('0x87')];_0x2fca65[_0xa1c2('0x5f')]['messageId']=_0x41cf60[_0xa1c2('0x5f')][_0xa1c2('0x91')];break;case _0xa1c2('0x92'):_0x2fca65['body'][_0xa1c2('0x84')]=_0x41cf60[_0xa1c2('0x5f')][0x0][_0xa1c2('0x28')]['id'];_0x2fca65['body'][_0xa1c2('0x81')]=_0x41cf60[_0xa1c2('0x5f')][0x0][_0xa1c2('0x28')][_0xa1c2('0x81')];_0x2fca65[_0xa1c2('0x5f')]['body']=_0x41cf60[_0xa1c2('0x5f')][0x0][_0xa1c2('0x28')][_0xa1c2('0x87')];break;case _0xa1c2('0x93'):_0x2fca65[_0xa1c2('0x5f')]['from']=_0x41cf60['body'][_0xa1c2('0x81')];_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x5f')]=_0x41cf60[_0xa1c2('0x5f')]['message'];_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x84')]=_0x41cf60[_0xa1c2('0x5f')]['refid'];break;}}if(_0x2fca65[_0xa1c2('0x5f')]['id']){delete _0x2fca65[_0xa1c2('0x5f')]['id'];}if(_[_0xa1c2('0x94')](_0x2fca65[_0xa1c2('0x5f')]['from'])){throw new db[(_0xa1c2('0x95'))][(_0xa1c2('0x7a'))](_0xa1c2('0x96'));}if(_['isNil'](_0x2fca65[_0xa1c2('0x5f')]['body'])||_0x2fca65[_0xa1c2('0x5f')]['body']===''){throw new db[(_0xa1c2('0x95'))][(_0xa1c2('0x7a'))](_0xa1c2('0x97'));}if(_['isNil'](_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x98')])){throw new db[(_0xa1c2('0x95'))][(_0xa1c2('0x7a'))](_0xa1c2('0x99')+_0x21dc60);}if(!_[_0xa1c2('0x9a')](_0x21dc60,_0x2fca65[_0xa1c2('0x5f')]['mapKey'])){throw new db[(_0xa1c2('0x95'))][(_0xa1c2('0x7a'))](_0xa1c2('0x9b')+_0x21dc60);}_0x5a4206[_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x98')]]=_0x2fca65['body']['from'];return db[_0xa1c2('0x9c')]['find']({'where':{'id':_0x2fca65[_0xa1c2('0x75')][_0xa1c2('0x7f')]},'include':[{'model':db[_0xa1c2('0x9d')],'as':_0xa1c2('0x9e'),'where':_0x5a4206,'limit':0x1,'order':[[_0xa1c2('0x7d'),_0xa1c2('0x9f')]]}]});})[_0xa1c2('0x37')](handleEntityNotFound(_0x1f5f24,null))[_0xa1c2('0x37')](function(_0x56287e){if(_0x56287e){_0x2fca65[_0xa1c2('0xa0')]=_['omit'](_0x56287e,[_0xa1c2('0x9e')]);if(_0x56287e[_0xa1c2('0x9e')]['length']){return _0x56287e['Contacts'][0x0];}var _0x363f51=_[_0xa1c2('0x1b')](_0x2fca65[_0xa1c2('0x5f')],{'firstName':_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x81')],'ListId':_0x56287e['id']});_0x363f51[_0x2fca65['body'][_0xa1c2('0x98')]]=_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x81')];return db[_0xa1c2('0x9d')]['create'](_0x363f51,{'fields':_0x3c8d73,'raw':!![]});}})[_0xa1c2('0x37')](handleEntityNotFound(_0x1f5f24,null))['then'](function(_0x181fd6){if(_0x181fd6){_0x2fca65[_0xa1c2('0xa1')]=_0x181fd6;var _0x55c6d4={'ContactId':_0x181fd6['id'],'phone':_0x2fca65[_0xa1c2('0x5f')]['from'],'SmsAccountId':_0x41cf60[_0xa1c2('0x5c')]['id']};var _0x1cb5e0={'ContactId':_0x181fd6['id'],'SmsAccountId':_0x41cf60[_0xa1c2('0x5c')]['id'],'closed':![]};return db[_0xa1c2('0xa2')][_0xa1c2('0x5d')]({'where':_0x1cb5e0})[_0xa1c2('0x37')](function(_0x59dda2){if(_0x59dda2){return[_0x59dda2,![]];}return db[_0xa1c2('0xa2')][_0xa1c2('0x5e')](_0x55c6d4)[_0xa1c2('0x37')](function(_0x58079e){return[_0x58079e,!![]];});});}})['spread'](function(_0x3a3fb7,_0x3565ec){_0x2fca65['interaction']=_0x3a3fb7[_0xa1c2('0x39')]({'plain':!![]});_0x2fca65[_0xa1c2('0xa3')][_0xa1c2('0xa4')]=![];if(_0x3565ec){if(_0x2fca65[_0xa1c2('0x75')][_0xa1c2('0xa5')]){_0x2fca65['applications']['push']({'id':0x0,'priority':_0x2fca65[_0xa1c2('0x76')][_0xa1c2('0x4d')]+0x1,'app':_0xa1c2('0xa6'),'appdata':_0xa1c2('0xa7'),'interval':_0xa1c2('0xa8')});}_0x2fca65[_0xa1c2('0xa3')][_0xa1c2('0xa4')]=!![];}return db['SmsMessage']['create']({'phone':_0x2fca65[_0xa1c2('0x5f')]['from'],'messageId':_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x84')],'body':_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0x5f')],'SmsAccountId':_0x41cf60[_0xa1c2('0x5c')]['id'],'SmsInteractionId':_0x3a3fb7['id'],'direction':'in','ContactId':_0x3a3fb7[_0xa1c2('0xa9')],'AttachmentId':_0x2fca65[_0xa1c2('0x5f')][_0xa1c2('0xaa')]});})[_0xa1c2('0x37')](function(_0x43bf03){_0x2fca65[_0xa1c2('0x28')]=_0x43bf03;if(_0x2fca65[_0xa1c2('0xa3')][_0xa1c2('0xab')]){return db['User'][_0xa1c2('0x5d')]({'attributes':['id',_0xa1c2('0x3d')],'where':{'id':_0x2fca65[_0xa1c2('0xa3')]['UserId']}})[_0xa1c2('0x37')](function(_0xf07154){if(_0xf07154){_0x2fca65[_0xa1c2('0x76')][_0xa1c2('0xac')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xf07154['name']+','+(_0x2fca65[_0xa1c2('0x75')][_0xa1c2('0xad')]||0xa),'interval':_0xa1c2('0xa8')});}return respondWithRpcPromise('Start',_0xa1c2('0xae'),_0x2fca65);});}return respondWithRpcPromise(_0xa1c2('0xaf'),_0xa1c2('0xae'),_0x2fca65);})[_0xa1c2('0x37')](function(_0x5df485){if(_0x5df485){var _0x51b6e7=0xc8;var _0x3895f4=_0xa1c2('0xb0');logger[_0xa1c2('0x21')](_0xa1c2('0x25'),_0x3895f4,_0x51b6e7,'entity\x20found');logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3895f4,_0x51b6e7,_0xa1c2('0xb1'),JSON[_0xa1c2('0xb2')](_0x5df485));if(_0x2fca65[_0xa1c2('0x75')]['type']===_0xa1c2('0xb3')){return _0x1f5f24[_0xa1c2('0x2b')](_0x51b6e7)[_0xa1c2('0x32')](_0xa1c2('0xb4'),_0xa1c2('0xb5'))['send'](_0xa1c2('0xb6'));}else{return _0x1f5f24['status'](_0x51b6e7)[_0xa1c2('0x2d')](_0x5df485);}}})[_0xa1c2('0x2a')](handleError(_0x1f5f24,null));};exports[_0xa1c2('0xb7')]=function(_0x550925,_0x292441){var _0x328ace=_0x550925[_0xa1c2('0x5c')]['id'];var _0x3bbf9e=_0x550925[_0xa1c2('0x5f')];var _0x2ceac4=0xc8;var _0x43265d=null;return db[_0xa1c2('0xb8')]['transaction']({'isolationLevel':db[_0xa1c2('0xb8')][_0xa1c2('0xb9')][_0xa1c2('0xba')][_0xa1c2('0xbb')]},function(_0x14130a){return db[_0xa1c2('0x42')][_0xa1c2('0x71')]({'where':{'id':_0x328ace},'transaction':_0x14130a})[_0xa1c2('0x37')](function(_0x1bc16b){if(_0x1bc16b){return db[_0xa1c2('0xbc')][_0xa1c2('0x38')]({'where':{'SmsAccountId':_0x328ace},'transaction':_0x14130a})[_0xa1c2('0x37')](function(){var _0x51572e=_['map'](_0x3bbf9e,function(_0x3c2426){_0x3c2426[_0xa1c2('0x6b')]=_0x328ace;return _0x3c2426;});return db[_0xa1c2('0xbc')][_0xa1c2('0xbd')](_0x51572e,{'transaction':_0x14130a});});}else{_0x2ceac4=0x194;_0x43265d=[];}});})[_0xa1c2('0x37')](function(){if(_0x2ceac4!==0x194){return db[_0xa1c2('0xbc')]['findAndCountAll']({'where':{'SmsAccountId':_0x328ace},'order':_0xa1c2('0x78')})[_0xa1c2('0x37')](function(_0x46061d){_0x43265d=_0x46061d;});}})['catch'](function(_0x840a4e){_0x2ceac4=0x1f4;logger[_0xa1c2('0x26')](_0x840a4e[_0xa1c2('0xbe')]);if(_0x840a4e[_0xa1c2('0x3d')]){delete _0x840a4e[_0xa1c2('0x3d')];}_0x43265d=_0x840a4e;})[_0xa1c2('0xbf')](function(){if(_0x43265d===null){_0x292441[_0xa1c2('0x3c')](_0x2ceac4);}else{if(_0x2ceac4===0x1f4){_0x292441[_0xa1c2('0x2b')](_0x2ceac4)[_0xa1c2('0x3e')](_0x43265d);}else{_0x292441['status'](_0x2ceac4)[_0xa1c2('0x2d')](_0x43265d);}}});};exports[_0xa1c2('0xc0')]=function(_0x4d8556,_0x7b8e66,_0x3f76ec){var _0x1e1aa4={};var _0x579881={};var _0x1b83c4;var _0x31bcc9;return db[_0xa1c2('0x42')][_0xa1c2('0x71')]({'where':{'id':_0x4d8556[_0xa1c2('0x5c')]['id']}})[_0xa1c2('0x37')](handleEntityNotFound(_0x7b8e66,null))['then'](function(_0x12ddf5){if(_0x12ddf5){_0x1b83c4=_0x12ddf5;_0x579881['model']=_[_0xa1c2('0x48')](db[_0xa1c2('0xbc')][_0xa1c2('0x43')]);_0x579881[_0xa1c2('0x49')]=_[_0xa1c2('0x48')](_0x4d8556[_0xa1c2('0x49')]);_0x579881[_0xa1c2('0x53')]=_[_0xa1c2('0x4a')](_0x579881['model'],_0x579881[_0xa1c2('0x49')]);_0x1e1aa4[_0xa1c2('0x4c')]=_[_0xa1c2('0x4a')](_0x579881[_0xa1c2('0x47')],qs[_0xa1c2('0x4b')](_0x4d8556[_0xa1c2('0x49')][_0xa1c2('0x4b')]));_0x1e1aa4[_0xa1c2('0x4c')]=_0x1e1aa4[_0xa1c2('0x4c')][_0xa1c2('0x4d')]?_0x1e1aa4[_0xa1c2('0x4c')]:_0x579881[_0xa1c2('0x47')];_0x1e1aa4[_0xa1c2('0x50')]=qs['sort'](_0x4d8556[_0xa1c2('0x49')][_0xa1c2('0x51')]);_0x1e1aa4['where']=qs[_0xa1c2('0x53')](_[_0xa1c2('0x6a')](_0x4d8556[_0xa1c2('0x49')],_0x579881[_0xa1c2('0x53')]));if(_0x4d8556[_0xa1c2('0x49')]['filter']){_0x1e1aa4[_0xa1c2('0x52')]=_[_0xa1c2('0x56')](_0x1e1aa4['where'],{'$or':_['map'](_0x1e1aa4[_0xa1c2('0x4c')],function(_0x34b040){var _0x2f0eba={};_0x2f0eba[_0x34b040]={'$like':'%'+_0x4d8556[_0xa1c2('0x49')]['filter']+'%'};return _0x2f0eba;})});}_0x1e1aa4=_['merge']({},_0x1e1aa4,_0x4d8556['options']);return _0x1b83c4[_0xa1c2('0xc0')](_0x1e1aa4);}})[_0xa1c2('0x37')](function(_0x1091b8){if(_0x1091b8){_0x31bcc9=_0x1091b8[_0xa1c2('0x4d')];if(!_0x4d8556['query'][_0xa1c2('0x4e')](_0xa1c2('0x4f'))){_0x1e1aa4[_0xa1c2('0x2f')]=qs[_0xa1c2('0x2f')](_0x4d8556[_0xa1c2('0x49')][_0xa1c2('0x2f')]);_0x1e1aa4['offset']=qs[_0xa1c2('0x30')](_0x4d8556['query'][_0xa1c2('0x30')]);}return _0x1b83c4[_0xa1c2('0xc0')](_0x1e1aa4);}})['then'](function(_0x483d5f){if(_0x483d5f){return _0x483d5f?{'count':_0x31bcc9,'rows':_0x483d5f}:null;}})[_0xa1c2('0x37')](respondWithResult(_0x7b8e66,null))[_0xa1c2('0x2a')](handleError(_0x7b8e66,null));};exports[_0xa1c2('0xc1')]=function(_0x22c73c,_0xc9110d,_0x38396b){var _0x168138={'raw':![],'where':{}};var _0x582654={};var _0x15e705={'count':0x0,'rows':[]};return db[_0xa1c2('0x42')][_0xa1c2('0x71')]({'where':{'id':_0x22c73c['params']['id']}})[_0xa1c2('0x37')](handleEntityNotFound(_0xc9110d,null))['then'](function(_0x60591c){if(_0x60591c){_0x582654[_0xa1c2('0x47')]=_[_0xa1c2('0x48')](db['SmsInteraction']['rawAttributes']);_0x582654[_0xa1c2('0x49')]=_[_0xa1c2('0x48')](_0x22c73c[_0xa1c2('0x49')]);_0x582654[_0xa1c2('0x53')]=_[_0xa1c2('0x4a')](_0x582654[_0xa1c2('0x47')],_0x582654[_0xa1c2('0x49')]);_0x168138[_0xa1c2('0x4c')]=_[_0xa1c2('0x4a')](_0x582654['model'],qs[_0xa1c2('0x4b')](_0x22c73c[_0xa1c2('0x49')]['fields']));_0x168138['attributes']=_0x168138[_0xa1c2('0x4c')][_0xa1c2('0x4d')]?_0x168138['attributes']:_0x582654['model'];if(!_0x22c73c[_0xa1c2('0x49')]['hasOwnProperty'](_0xa1c2('0x4f'))){_0x168138[_0xa1c2('0x2f')]=qs['limit'](_0x22c73c[_0xa1c2('0x49')][_0xa1c2('0x2f')]);_0x168138[_0xa1c2('0x30')]=qs[_0xa1c2('0x30')](_0x22c73c['query'][_0xa1c2('0x30')]);}_0x168138[_0xa1c2('0x50')]=qs[_0xa1c2('0x51')](_0x22c73c['query'][_0xa1c2('0x51')]);_0x168138[_0xa1c2('0x52')]=qs[_0xa1c2('0x53')](_[_0xa1c2('0x6a')](_0x22c73c[_0xa1c2('0x49')],_0x582654[_0xa1c2('0x53')]));_0x168138[_0xa1c2('0x52')][_0xa1c2('0x6b')]=_0x60591c['id'];if(_0x22c73c['query'][_0xa1c2('0x55')]){_0x168138['where']=_['merge'](_0x168138[_0xa1c2('0x52')],{'$or':_[_0xa1c2('0x41')](_0x168138[_0xa1c2('0x4c')],function(_0x28dfcf){var _0x4e58ee={};_0x4e58ee[_0x28dfcf]={'$like':'%'+_0x22c73c[_0xa1c2('0x49')]['filter']+'%'};return _0x4e58ee;})});}_0x168138=_[_0xa1c2('0x56')]({},_0x168138,_0x22c73c['options']);return db[_0xa1c2('0xa2')][_0xa1c2('0x31')]({'where':_0x168138['where']})[_0xa1c2('0x37')](function(_0x10ecac){_0x15e705[_0xa1c2('0x31')]=_0x10ecac;if(_0x22c73c[_0xa1c2('0x49')][_0xa1c2('0x58')]){_0x168138['include']=[{'model':db[_0xa1c2('0x9d')],'as':_0xa1c2('0xc2'),'required':![]},{'model':db[_0xa1c2('0xc3')],'as':_0xa1c2('0xc4'),'attributes':[_0xa1c2('0x3d'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xa1c2('0x3d'),_0xa1c2('0xc5')],'where':_0x22c73c[_0xa1c2('0x49')][_0xa1c2('0xc6')]?{'id':_0x22c73c[_0xa1c2('0x49')]['tag']}:undefined,'required':_0x22c73c['query'][_0xa1c2('0xc6')]?!![]:![]}];}return db['SmsInteraction'][_0xa1c2('0x5a')](_0x168138);})[_0xa1c2('0x37')](function(_0x27ab2d){_0x15e705[_0xa1c2('0x6d')]=_0x27ab2d;return _0x15e705;});}})['then'](respondWithFilteredResult(_0xc9110d,_0x168138))['catch'](handleError(_0xc9110d,null));};exports[_0xa1c2('0x3e')]=function(_0x47ae92,_0x17e8d3,_0xf7f593){var _0x2813e8,_0x26fbdd,_0x11c3ec;if(_['isNil'](_0x47ae92[_0xa1c2('0x5f')][_0xa1c2('0x5f')])||_0x47ae92[_0xa1c2('0x5f')]['body']===''){throw new db['Sequelize'][(_0xa1c2('0x7a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa1c2('0x94')](_0x47ae92['body']['to'])){throw new db['Sequelize'][(_0xa1c2('0x7a'))](_0xa1c2('0xc7'));}_0x2813e8=_0x47ae92[_0xa1c2('0x5f')]['to'];return db[_0xa1c2('0x42')][_0xa1c2('0x5d')]({'where':{'id':_0x47ae92['params']['id']},'include':[{'model':db[_0xa1c2('0x9c')],'as':_0xa1c2('0xc8'),'include':[{'model':db[_0xa1c2('0x9d')],'as':_0xa1c2('0x9e'),'where':{'mobile':_0x2813e8},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x17e8d3,null))[_0xa1c2('0x37')](function(_0x32b45f){if(_0x32b45f&&_0x32b45f[_0xa1c2('0xc8')]){_0x26fbdd=_0x32b45f[_0xa1c2('0x39')]({'plain':!![]});if(_0x26fbdd[_0xa1c2('0xc8')]&&_0x26fbdd[_0xa1c2('0xc8')]['Contacts'][_0xa1c2('0x4d')]){return _0x26fbdd[_0xa1c2('0xc8')][_0xa1c2('0x9e')][0x0];}return db[_0xa1c2('0x9d')][_0xa1c2('0x5e')](_[_0xa1c2('0x1b')](_0x47ae92[_0xa1c2('0x5f')],{'firstName':_0x2813e8,'mobile':_0x2813e8,'phone':_0x2813e8,'ListId':_0x26fbdd['ListId']}));}})[_0xa1c2('0x37')](handleEntityNotFound(_0x17e8d3,null))[_0xa1c2('0x37')](function(_0x3f7e89){if(_0x3f7e89){_0x11c3ec=_0x3f7e89;return db[_0xa1c2('0xa2')]['find']({'where':{'ContactId':_0x11c3ec['id'],'closed':![],'SmsAccountId':_0x26fbdd['id']}})[_0xa1c2('0x37')](function(_0x467a6e){if(_0x467a6e){return[_0x467a6e,![]];}return db['SmsInteraction']['create']({'UserId':_0x47ae92[_0xa1c2('0x60')]['id'],'ContactId':_0x11c3ec['id'],'SmsAccountId':_0x26fbdd['id'],'phone':_0x2813e8,'firstMsgDirection':_0xa1c2('0xc9'),'Messages':[_[_0xa1c2('0x56')](_0x47ae92['body'],{'read':![],'body':_0x47ae92[_0xa1c2('0x5f')]['body'],'phone':_0x2813e8,'SmsAccountId':_0x26fbdd['id'],'UserId':_0x47ae92[_0xa1c2('0x60')]['id'],'ContactId':_0x11c3ec['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xa1c2('0xca')}]})[_0xa1c2('0x37')](function(_0x4c18fd){return[_0x4c18fd,!![]];});});}})['spread'](function(_0x56a772,_0x526974){if(_0x526974){return _0x56a772;}return db[_0xa1c2('0xcb')]['create'](_[_0xa1c2('0x56')](_0x47ae92['body'],{'read':![],'body':_0x47ae92[_0xa1c2('0x5f')][_0xa1c2('0x5f')],'phone':_0x2813e8,'SmsAccountId':_0x26fbdd['id'],'SmsInteractionId':_0x56a772['id'],'UserId':_0x47ae92[_0xa1c2('0x60')]['id'],'ContactId':_0x11c3ec['id']}))[_0xa1c2('0x37')](function(_0x40bf75){_0x56a772[_0xa1c2('0xcc')][_0xa1c2('0xca')]=[];_0x56a772[_0xa1c2('0xcc')][_0xa1c2('0xca')][_0xa1c2('0xcd')](_0x40bf75[_0xa1c2('0xcc')]);return _0x56a772;});})[_0xa1c2('0x37')](respondWithResult(_0x17e8d3,null))[_0xa1c2('0x2a')](handleError(_0x17e8d3,null));};exports[_0xa1c2('0x2b')]=function(_0x5972e6,_0x202bca,_0x303f9c){if(_0x5972e6[_0xa1c2('0x5f')]['id']){delete _0x5972e6[_0xa1c2('0x5f')]['id'];}var _0x19f53a,_0x38e5d3,_0x2dddc7;return db[_0xa1c2('0x42')]['find']({'where':{'id':_0x5972e6[_0xa1c2('0x5c')]['id']}})[_0xa1c2('0x37')](handleEntityNotFound(_0x202bca,null))[_0xa1c2('0x37')](function(_0x2d5a04){if(_0x2d5a04){_0x2dddc7=_0x2d5a04;logger['debug'](_0xa1c2('0x25'),_0xa1c2('0x2b'),_0xa1c2('0xce'),_0x2d5a04['type'],util[_0xa1c2('0xcf')](_0x5972e6[_0xa1c2('0x5f')],{'showHidden':![],'depth':null}));switch(_0x2d5a04[_0xa1c2('0x45')]){case _0xa1c2('0x85'):if(_0x5972e6['body']['skebby_dispatch_id']&&_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0x2b')]){_0x38e5d3=_0x5972e6[_0xa1c2('0x5f')]['status'];return db[_0xa1c2('0xcb')][_0xa1c2('0x5d')]({'where':{'messageId':_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0xd0')]}});}break;case _0xa1c2('0xd1'):if(_0x5972e6[_0xa1c2('0x5f')]['requestid']&&_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0xd2')]){_0x38e5d3=_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0xd2')];return db[_0xa1c2('0xcb')][_0xa1c2('0x5d')]({'where':{'messageId':_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0xd3')]}});}break;case'clicksend':if(_0x5972e6['body'][_0xa1c2('0x89')]&&_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0xd4')]){_0x38e5d3=_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0xd4')];return db[_0xa1c2('0xcb')][_0xa1c2('0x5d')]({'where':{'messageId':_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0x89')]}});}break;case _0xa1c2('0xd5'):var _0x5cc360=_0x5972e6['body'][_0xa1c2('0x8c')][0x0];if(_0x5cc360['messageId']&&_0x5cc360[_0xa1c2('0x2b')]['groupName']===_0xa1c2('0xd6')){_0x38e5d3=_0x5cc360[_0xa1c2('0x2b')][_0xa1c2('0xd7')];return db[_0xa1c2('0xcb')]['find']({'where':{'messageId':_0x5cc360[_0xa1c2('0x84')]}});}break;case _0xa1c2('0x90'):if(_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0x84')]&&_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0x2b')]){_0x38e5d3=_0x5972e6[_0xa1c2('0x5f')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0x84')]}});}break;case _0xa1c2('0x92'):if(_0x5972e6[_0xa1c2('0x5f')][0x0][_0xa1c2('0x28')]['id']){_0x38e5d3=_0x5972e6['body'][0x0][_0xa1c2('0x45')];return db[_0xa1c2('0xcb')]['find']({'where':{'messageId':_0x5972e6[_0xa1c2('0x5f')][0x0]['message']['id']}});}break;case _0xa1c2('0x93'):if(_0x5972e6['body'][_0xa1c2('0xd8')]&&_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0x2b')]){_0x38e5d3=_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0x2b')];return db[_0xa1c2('0xcb')]['find']({'where':{'messageId':_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0xd8')]}});}break;}}})[_0xa1c2('0x37')](handleEntityNotFound(_0x202bca,null))['then'](function(_0x570322){if(_0x570322){_0x19f53a=_0x570322;switch(_0x2dddc7['type']){case'skebby':if(_0x38e5d3===_0xa1c2('0xd6')){return _0x19f53a[_0xa1c2('0x36')]({'read':!![]});}else{logger[_0xa1c2('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa1c2('0x2b'),'skebby',util[_0xa1c2('0xcf')](_0x5972e6['body'],{'showHidden':![],'depth':null}));}break;case _0xa1c2('0xd1'):if(_0x38e5d3==='1'){return _0x19f53a['update']({'read':!![]});}else{logger[_0xa1c2('0x26')](_0xa1c2('0x25'),'status',_0xa1c2('0x85'),util['inspect'](_0x5972e6[_0xa1c2('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xa1c2('0x88'):if(!_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0xd9')]&&_0x38e5d3>=0xc8&&_0x38e5d3<=0xce){return _0x19f53a[_0xa1c2('0x36')]({'read':!![]});}else{logger[_0xa1c2('0x26')](_0xa1c2('0x25'),_0xa1c2('0x2b'),_0xa1c2('0x88'),util[_0xa1c2('0xcf')](_0x5972e6[_0xa1c2('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xa1c2('0xd5'):var _0x8c0443=_0x5972e6[_0xa1c2('0x5f')][_0xa1c2('0x8c')][0x0];if(_0x8c0443[_0xa1c2('0x2b')][_0xa1c2('0xd7')]===_0xa1c2('0xd6')){return _0x19f53a[_0xa1c2('0x36')]({'read':!![]});}else{logger['error'](_0xa1c2('0x25'),_0xa1c2('0x2b'),_0xa1c2('0xd5'),util[_0xa1c2('0xcf')](_0x5972e6[_0xa1c2('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xa1c2('0x90'):if(_0x38e5d3==_0xa1c2('0xda')||_0x38e5d3==_0xa1c2('0xdb')){return _0x19f53a[_0xa1c2('0x36')]({'read':!![]});}else{logger[_0xa1c2('0x26')](_0xa1c2('0x25'),_0xa1c2('0x2b'),_0xa1c2('0x90'),util[_0xa1c2('0xcf')](_0x5972e6[_0xa1c2('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xa1c2('0x92'):if(_0x38e5d3=='message-delivered'){return _0x19f53a[_0xa1c2('0x36')]({'read':!![]});}else{logger['error'](_0xa1c2('0x25'),'status',_0xa1c2('0x92'),util[_0xa1c2('0xcf')](_0x5972e6[_0xa1c2('0x5f')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x38e5d3===_0xa1c2('0xdc')||_0x38e5d3===_0xa1c2('0xdd')){return _0x19f53a['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa1c2('0x2b'),'intelepeer',util[_0xa1c2('0xcf')](_0x5972e6[_0xa1c2('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x19f53a;}})[_0xa1c2('0x37')](respondWithResult(_0x202bca,null))[_0xa1c2('0x2a')](handleError(_0x202bca,null));};exports[_0xa1c2('0xde')]=function(_0x4a1d92,_0x1d9e93,_0x2460c5){var _0x41a055,_0x12f02e,_0x14c762;return db[_0xa1c2('0x42')]['find']({'where':{'id':_0x4a1d92['params']['id']}})[_0xa1c2('0x37')](handleEntityNotFound(_0x1d9e93,null))[_0xa1c2('0x37')](function(_0x378282){if(_0x378282){_0x14c762=_0x378282;logger[_0xa1c2('0x24')](_0xa1c2('0x25'),'status',_0xa1c2('0xce'),_0x378282[_0xa1c2('0x45')],util[_0xa1c2('0xcf')](_0x4a1d92[_0xa1c2('0x49')],{'showHidden':![],'depth':null}));switch(_0x378282['type']){case _0xa1c2('0x8d'):if(_0x4a1d92[_0xa1c2('0x49')]['message-id']&&_0x4a1d92[_0xa1c2('0x49')]['state']){_0x12f02e=_0x4a1d92[_0xa1c2('0x49')][_0xa1c2('0xdf')];return db['SmsMessage'][_0xa1c2('0x5d')]({'where':{'messageId':_0x4a1d92['query'][_0xa1c2('0xe0')]}});}break;}}})[_0xa1c2('0x37')](handleEntityNotFound(_0x1d9e93,null))[_0xa1c2('0x37')](function(_0x1770fe){if(_0x1770fe){_0x41a055=_0x1770fe;switch(_0x14c762['type']){case _0xa1c2('0x8d'):if(_0x12f02e==='2'||_0x12f02e==='6'){return _0x41a055[_0xa1c2('0x36')]({'read':!![]});}else{logger[_0xa1c2('0x26')](_0xa1c2('0x25'),'status',_0xa1c2('0x8d'),util[_0xa1c2('0xcf')](_0x4a1d92['query'],{'showHidden':![],'depth':null}));};break;}return _0x41a055;}})[_0xa1c2('0x37')](respondWithResult(_0x1d9e93,null))[_0xa1c2('0x2a')](handleError(_0x1d9e93,null));};exports['addAgents']=function(_0x374e3f,_0x57958a,_0x46e96a){return db[_0xa1c2('0x42')]['find']({'where':{'id':_0x374e3f[_0xa1c2('0x5c')]['id']}})[_0xa1c2('0x37')](handleEntityNotFound(_0x57958a,null))[_0xa1c2('0x37')](function(_0x24b463){if(_0x24b463){return _0x24b463['addAgents'](_0x374e3f[_0xa1c2('0x5f')][_0xa1c2('0xe1')],_[_0xa1c2('0xe2')](_0x374e3f[_0xa1c2('0x5f')],['ids','id'])||{})['spread'](function(_0xbe5f3e){for(var _0x4fd1fe=0x0;_0x4fd1fe<_0x374e3f[_0xa1c2('0x5f')][_0xa1c2('0xe1')][_0xa1c2('0x4d')];_0x4fd1fe+=0x1){socket[_0xa1c2('0xe3')](_0xa1c2('0xe4'),{'UserId':Number(_0x374e3f[_0xa1c2('0x5f')][_0xa1c2('0xe1')][_0x4fd1fe]),'SmsAccountId':Number(_0x374e3f['params']['id'])});}return _0xbe5f3e;});}})[_0xa1c2('0x37')](respondWithResult(_0x57958a,null))[_0xa1c2('0x2a')](handleError(_0x57958a,null));};exports[_0xa1c2('0xe5')]=function(_0x411bf4,_0x1ea5d1,_0x529432){return db[_0xa1c2('0x42')]['find']({'where':{'id':_0x411bf4['params']['id']}})[_0xa1c2('0x37')](handleEntityNotFound(_0x1ea5d1,null))[_0xa1c2('0x37')](function(_0x3a3615){if(_0x3a3615){return _0x3a3615['removeAgents'](_0x411bf4['query'][_0xa1c2('0xe1')])[_0xa1c2('0x37')](function(){if(_['isArray'](_0x411bf4['query'][_0xa1c2('0xe1')])){for(var _0x274d90=0x0;_0x274d90<_0x411bf4['query'][_0xa1c2('0xe1')][_0xa1c2('0x4d')];_0x274d90+=0x1){socket[_0xa1c2('0xe3')](_0xa1c2('0xe6'),{'UserId':Number(_0x411bf4['query']['ids'][_0x274d90]),'SmsAccountId':Number(_0x411bf4[_0xa1c2('0x5c')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x411bf4[_0xa1c2('0x49')][_0xa1c2('0xe1')]),'SmsAccountId':Number(_0x411bf4[_0xa1c2('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x1ea5d1,null))['catch'](handleError(_0x1ea5d1,null));};exports[_0xa1c2('0xe7')]=function(_0x2a7183,_0x442c34,_0x2b7739){var _0xef3d64={};var _0x47c671={};var _0xb286b7;var _0x4a0834;return db[_0xa1c2('0x42')][_0xa1c2('0x71')]({'where':{'id':_0x2a7183[_0xa1c2('0x5c')]['id']}})[_0xa1c2('0x37')](handleEntityNotFound(_0x442c34,null))[_0xa1c2('0x37')](function(_0x57dbff){if(_0x57dbff){_0xb286b7=_0x57dbff;_0x47c671['model']=_['keys'](db[_0xa1c2('0xc3')]['rawAttributes']);_0x47c671[_0xa1c2('0x49')]=_[_0xa1c2('0x48')](_0x2a7183[_0xa1c2('0x49')]);_0x47c671[_0xa1c2('0x53')]=_['intersection'](_0x47c671[_0xa1c2('0x47')],_0x47c671[_0xa1c2('0x49')]);_0xef3d64[_0xa1c2('0x4c')]=_[_0xa1c2('0x4a')](_0x47c671['model'],qs[_0xa1c2('0x4b')](_0x2a7183[_0xa1c2('0x49')]['fields']));_0xef3d64[_0xa1c2('0x4c')]=_0xef3d64[_0xa1c2('0x4c')][_0xa1c2('0x4d')]?_0xef3d64['attributes']:_0x47c671[_0xa1c2('0x47')];_0xef3d64[_0xa1c2('0x50')]=qs[_0xa1c2('0x51')](_0x2a7183[_0xa1c2('0x49')][_0xa1c2('0x51')]);_0xef3d64[_0xa1c2('0x52')]=qs['filters'](_[_0xa1c2('0x6a')](_0x2a7183['query'],_0x47c671[_0xa1c2('0x53')]));if(_0x2a7183[_0xa1c2('0x49')][_0xa1c2('0x55')]){_0xef3d64['where']=_[_0xa1c2('0x56')](_0xef3d64['where'],{'$or':_[_0xa1c2('0x41')](_0xef3d64[_0xa1c2('0x4c')],function(_0x5b77af){var _0x2575c6={};_0x2575c6[_0x5b77af]={'$like':'%'+_0x2a7183[_0xa1c2('0x49')][_0xa1c2('0x55')]+'%'};return _0x2575c6;})});}_0xef3d64=_[_0xa1c2('0x56')]({},_0xef3d64,_0x2a7183[_0xa1c2('0x57')]);return _0xb286b7[_0xa1c2('0xe7')](_0xef3d64);}})[_0xa1c2('0x37')](function(_0x4ac369){if(_0x4ac369){_0x4a0834=_0x4ac369[_0xa1c2('0x4d')];if(!_0x2a7183[_0xa1c2('0x49')]['hasOwnProperty']('nolimit')){_0xef3d64[_0xa1c2('0x2f')]=qs[_0xa1c2('0x2f')](_0x2a7183['query'][_0xa1c2('0x2f')]);_0xef3d64[_0xa1c2('0x30')]=qs[_0xa1c2('0x30')](_0x2a7183[_0xa1c2('0x49')]['offset']);}return _0xb286b7[_0xa1c2('0xe7')](_0xef3d64);}})[_0xa1c2('0x37')](function(_0x4edba3){if(_0x4edba3){return _0x4edba3?{'count':_0x4a0834,'rows':_0x4edba3}:null;}})[_0xa1c2('0x37')](respondWithResult(_0x442c34,null))[_0xa1c2('0x2a')](handleError(_0x442c34,null));}; \ No newline at end of file +var _0x2985=['rows','show','params','length','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','removeDispositions','ids','CannedAnswer','create','getAnswers','findOne','hasOwnProperty','removeAnswers','notify','sms','SmsApplication','orderBy','Applications','account','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','messageId','MessageSid','sender','connectel','clicksend','message_id','From','Text','MessageUUID','infobip','results','text','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmContact','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','autoclose','applications','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','Content-Type','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','CmList','List','Messages','dataValues','inspect','skebby','skebby_dispatch_id','statusInt','status_code','DELIVERED','groupName','redif','clickatell','DELIVERED_TO_GATEWAY','DELIVRD','statusGet','received\x20delivery\x20report\x20from','state','message-id','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll'];(function(_0x140461,_0x396889){var _0x133efb=function(_0x11a6ec){while(--_0x11a6ec){_0x140461['push'](_0x140461['shift']());}};_0x133efb(++_0x396889);}(_0x2985,0x17e));var _0x5298=function(_0x76fd1f,_0x2c0b0b){_0x76fd1f=_0x76fd1f-0x0;var _0x1db4f7=_0x2985[_0x76fd1f];return _0x1db4f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5298('0x0'));var zipdir=require(_0x5298('0x1'));var jsonpatch=require(_0x5298('0x2'));var rp=require('request-promise');var moment=require(_0x5298('0x3'));var BPromise=require(_0x5298('0x4'));var Mustache=require(_0x5298('0x5'));var util=require(_0x5298('0x6'));var path=require(_0x5298('0x7'));var sox=require(_0x5298('0x8'));var csv=require('to-csv');var ejs=require(_0x5298('0x9'));var fs=require('fs');var fs_extra=require(_0x5298('0xa'));var _=require(_0x5298('0xb'));var squel=require(_0x5298('0xc'));var crypto=require(_0x5298('0xd'));var jsforce=require(_0x5298('0xe'));var deskjs=require(_0x5298('0xf'));var toCsv=require(_0x5298('0x10'));var querystring=require(_0x5298('0x11'));var Papa=require(_0x5298('0x12'));var Redis=require(_0x5298('0x13'));var authService=require(_0x5298('0x14'));var qs=require(_0x5298('0x15'));var as=require(_0x5298('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5298('0x17'))('api');var utils=require(_0x5298('0x18'));var config=require(_0x5298('0x19'));var licenseUtil=require(_0x5298('0x1a'));var db=require(_0x5298('0x1b'))['db'];config[_0x5298('0x1c')]=_[_0x5298('0x1d')](config[_0x5298('0x1c')],{'host':_0x5298('0x1e'),'port':0x18eb});var socket=require(_0x5298('0x1f'))(new Redis(config[_0x5298('0x1c')]));require(_0x5298('0x20'))[_0x5298('0x21')](socket);var jayson=require(_0x5298('0x22'));var client=jayson[_0x5298('0x23')][_0x5298('0x24')]({'port':0x232c});function respondWithRpcPromise(_0x452946,_0x2b2fd3,_0x1f60ef,_0x342b24){return new BPromise(function(_0x5031f7,_0x24e00d){var _0x52f415=_0x342b24||client;return _0x52f415[_0x5298('0x25')](_0x452946,_0x1f60ef)['then'](function(_0x51f440){logger[_0x5298('0x26')](_0x5298('0x27'),_0x2b2fd3,_0x5298('0x28'));logger[_0x5298('0x29')](_0x5298('0x2a'),_0x2b2fd3,_0x5298('0x28'),JSON[_0x5298('0x2b')](_0x51f440));if(_0x51f440['error']){if(_0x51f440[_0x5298('0x2c')][_0x5298('0x2d')]===0x1f4){logger[_0x5298('0x2c')](_0x5298('0x27'),_0x2b2fd3,_0x51f440[_0x5298('0x2c')][_0x5298('0x2e')]);return _0x24e00d(_0x51f440['error'][_0x5298('0x2e')]);}logger[_0x5298('0x2c')](_0x5298('0x27'),_0x2b2fd3,_0x51f440[_0x5298('0x2c')]['message']);return _0x5031f7(_0x51f440['error']['message']);}else{logger[_0x5298('0x26')](_0x5298('0x27'),_0x2b2fd3,'request\x20sent');_0x5031f7(_0x51f440[_0x5298('0x2f')][_0x5298('0x2e')]);}})[_0x5298('0x30')](function(_0x103edf){logger[_0x5298('0x2c')](_0x5298('0x27'),_0x2b2fd3,_0x103edf);_0x24e00d(_0x103edf);});});}function respondWithStatusCode(_0x17fa89,_0x583194){_0x583194=_0x583194||0xcc;return function(_0x431e63){if(_0x431e63){return _0x17fa89[_0x5298('0x31')](_0x583194);}return _0x17fa89[_0x5298('0x32')](_0x583194)[_0x5298('0x33')]();};}function respondWithResult(_0x91a3c7,_0x2296b6){_0x2296b6=_0x2296b6||0xc8;return function(_0x3209b0){if(_0x3209b0){return _0x91a3c7['status'](_0x2296b6)[_0x5298('0x34')](_0x3209b0);}};}function respondWithFilteredResult(_0x2ad9bd,_0xab8be7){return function(_0x237d3f){if(_0x237d3f){var _0x2d79f5=typeof _0xab8be7[_0x5298('0x35')]===_0x5298('0x36')&&typeof _0xab8be7['limit']===_0x5298('0x36');var _0x2c3df3=_0x237d3f[_0x5298('0x37')];var _0x13a90b=_0x2d79f5?0x0:_0xab8be7[_0x5298('0x35')];var _0x4dc148=_0x2d79f5?_0x237d3f['count']:_0xab8be7[_0x5298('0x35')]+_0xab8be7[_0x5298('0x38')];var _0x916e5a;if(_0x4dc148>=_0x2c3df3){_0x4dc148=_0x2c3df3;_0x916e5a=0xc8;}else{_0x916e5a=0xce;}_0x2ad9bd[_0x5298('0x32')](_0x916e5a);return _0x2ad9bd[_0x5298('0x39')](_0x5298('0x3a'),_0x13a90b+'-'+_0x4dc148+'/'+_0x2c3df3)['json'](_0x237d3f);}return null;};}function patchUpdates(_0x163ecd){return function(_0x3069a6){try{jsonpatch['apply'](_0x3069a6,_0x163ecd,!![]);}catch(_0x401106){return BPromise[_0x5298('0x3b')](_0x401106);}return _0x3069a6[_0x5298('0x3c')]();};}function saveUpdates(_0x22bbbc,_0x484581){return function(_0x27b20b){if(_0x27b20b){return _0x27b20b[_0x5298('0x3d')](_0x22bbbc)[_0x5298('0x3e')](function(_0x47ecfe){return _0x47ecfe;});}return null;};}function removeEntity(_0x1ebff5,_0xf78689){return function(_0x3550e9){if(_0x3550e9){return _0x3550e9[_0x5298('0x3f')]()[_0x5298('0x3e')](function(){var _0x3f7f9c=_0x3550e9[_0x5298('0x40')]({'plain':!![]});var _0x4c08df='SmsAccounts';return db[_0x5298('0x41')][_0x5298('0x3f')]({'where':{'type':_0x4c08df,'resourceId':_0x3f7f9c['id']}})[_0x5298('0x3e')](function(){return _0x3550e9;});})['then'](function(){_0x1ebff5[_0x5298('0x32')](0xcc)[_0x5298('0x33')]();});}};}function handleEntityNotFound(_0x38ee40,_0x1ead70){return function(_0xdc021e){if(!_0xdc021e){_0x38ee40['sendStatus'](0x194);}return _0xdc021e;};}function handleError(_0x467310,_0x444c93){_0x444c93=_0x444c93||0x1f4;return function(_0xf03ae8){logger[_0x5298('0x2c')](_0xf03ae8[_0x5298('0x42')]);if(_0xf03ae8[_0x5298('0x43')]){delete _0xf03ae8[_0x5298('0x43')];}_0x467310['status'](_0x444c93)[_0x5298('0x44')](_0xf03ae8);};}exports[_0x5298('0x45')]=function(_0x112b72,_0x54f5bf){var _0x3fb9b9={'include':[{'model':db[_0x5298('0x46')],'as':_0x5298('0x47')}]},_0x1acbf4={},_0x41fc67={'count':0x0,'rows':[]};var _0x4a9045=_['map'](db[_0x5298('0x48')][_0x5298('0x49')],function(_0x1c861b){return{'name':_0x1c861b[_0x5298('0x4a')],'type':_0x1c861b[_0x5298('0x4b')][_0x5298('0x4c')]};});_0x1acbf4[_0x5298('0x4d')]=_[_0x5298('0x4e')](_0x4a9045,'name');_0x1acbf4[_0x5298('0x4f')]=_[_0x5298('0x50')](_0x112b72[_0x5298('0x4f')]);_0x1acbf4[_0x5298('0x51')]=_[_0x5298('0x52')](_0x1acbf4[_0x5298('0x4d')],_0x1acbf4[_0x5298('0x4f')]);_0x3fb9b9[_0x5298('0x53')]=_[_0x5298('0x52')](_0x1acbf4[_0x5298('0x4d')],qs[_0x5298('0x54')](_0x112b72[_0x5298('0x4f')][_0x5298('0x54')]));_0x3fb9b9[_0x5298('0x53')]=_0x3fb9b9['attributes']['length']?_0x3fb9b9[_0x5298('0x53')]:_0x1acbf4['model'];if(!_0x112b72[_0x5298('0x4f')]['hasOwnProperty'](_0x5298('0x55'))){_0x3fb9b9['limit']=qs[_0x5298('0x38')](_0x112b72[_0x5298('0x4f')][_0x5298('0x38')]);_0x3fb9b9[_0x5298('0x35')]=qs['offset'](_0x112b72[_0x5298('0x4f')][_0x5298('0x35')]);}_0x3fb9b9[_0x5298('0x56')]=qs[_0x5298('0x57')](_0x112b72['query'][_0x5298('0x57')]);_0x3fb9b9[_0x5298('0x58')]=qs[_0x5298('0x51')](_[_0x5298('0x59')](_0x112b72[_0x5298('0x4f')],_0x1acbf4[_0x5298('0x51')]),_0x4a9045);if(_0x112b72['query'][_0x5298('0x5a')]){_0x3fb9b9[_0x5298('0x58')]=_[_0x5298('0x5b')](_0x3fb9b9['where'],{'$or':_[_0x5298('0x4e')](_0x4a9045,function(_0xa1edce){if(_0xa1edce[_0x5298('0x4b')]!==_0x5298('0x5c')){var _0x58ef2b={};_0x58ef2b[_0xa1edce[_0x5298('0x43')]]={'$like':'%'+_0x112b72[_0x5298('0x4f')]['filter']+'%'};return _0x58ef2b;}})});}_0x3fb9b9=_['merge']({},_0x3fb9b9,_0x112b72[_0x5298('0x5d')]);var _0x4e7edd={'where':_0x3fb9b9[_0x5298('0x58')]};return db['SmsAccount'][_0x5298('0x37')](_0x4e7edd)['then'](function(_0x3ccc6c){_0x41fc67[_0x5298('0x37')]=_0x3ccc6c;if(_0x112b72[_0x5298('0x4f')]['includeAll']){_0x3fb9b9[_0x5298('0x5e')]=[{'all':!![]}];}return db['SmsAccount'][_0x5298('0x5f')](_0x3fb9b9);})['then'](function(_0x393f50){_0x41fc67[_0x5298('0x60')]=_0x393f50;return _0x41fc67;})[_0x5298('0x3e')](respondWithFilteredResult(_0x54f5bf,_0x3fb9b9))[_0x5298('0x30')](handleError(_0x54f5bf,null));};exports[_0x5298('0x61')]=function(_0x2499c7,_0xd708db){var _0x3bfe21={'raw':![],'where':{'id':_0x2499c7[_0x5298('0x62')]['id']},'include':[{'model':db[_0x5298('0x46')],'as':_0x5298('0x47')}]},_0x5ab56b={};_0x5ab56b[_0x5298('0x4d')]=_['keys'](db[_0x5298('0x48')][_0x5298('0x49')]);_0x5ab56b[_0x5298('0x4f')]=_[_0x5298('0x50')](_0x2499c7[_0x5298('0x4f')]);_0x5ab56b['filters']=_['intersection'](_0x5ab56b[_0x5298('0x4d')],_0x5ab56b['query']);_0x3bfe21['attributes']=_[_0x5298('0x52')](_0x5ab56b[_0x5298('0x4d')],qs[_0x5298('0x54')](_0x2499c7[_0x5298('0x4f')]['fields']));_0x3bfe21[_0x5298('0x53')]=_0x3bfe21[_0x5298('0x53')][_0x5298('0x63')]?_0x3bfe21[_0x5298('0x53')]:_0x5ab56b[_0x5298('0x4d')];if(_0x2499c7[_0x5298('0x4f')][_0x5298('0x64')]){_0x3bfe21['include']=[{'all':!![]}];}_0x3bfe21=_[_0x5298('0x5b')]({},_0x3bfe21,_0x2499c7[_0x5298('0x5d')]);return db[_0x5298('0x48')][_0x5298('0x65')](_0x3bfe21)[_0x5298('0x3e')](handleEntityNotFound(_0xd708db,null))['then'](respondWithResult(_0xd708db,null))[_0x5298('0x30')](handleError(_0xd708db,null));};exports['create']=function(_0x1721e7,_0x269f4e){return db['SmsAccount']['create'](_0x1721e7[_0x5298('0x66')],{})[_0x5298('0x3e')](function(_0x226dda){var _0x5b91d4=_0x1721e7[_0x5298('0x67')]['get']({'plain':!![]});if(!_0x5b91d4)throw new Error(_0x5298('0x68'));if(_0x5b91d4['role']==='user'){var _0x5567ad=_0x226dda['get']({'plain':!![]});var _0x5baf1a=_0x5298('0x69');return db[_0x5298('0x6a')][_0x5298('0x65')]({'where':{'name':_0x5baf1a,'userProfileId':_0x5b91d4[_0x5298('0x6b')]},'raw':!![]})[_0x5298('0x3e')](function(_0x5f3f2d){if(_0x5f3f2d&&_0x5f3f2d[_0x5298('0x6c')]===0x0){return db[_0x5298('0x41')]['create']({'name':_0x5567ad[_0x5298('0x43')],'resourceId':_0x5567ad['id'],'type':_0x5f3f2d[_0x5298('0x43')],'sectionId':_0x5f3f2d['id']},{})[_0x5298('0x3e')](function(){return _0x226dda;});}else{return _0x226dda;}})[_0x5298('0x30')](function(_0x10b091){logger[_0x5298('0x2c')](_0x5298('0x6d'),_0x10b091);throw _0x10b091;});}return _0x226dda;})[_0x5298('0x3e')](respondWithResult(_0x269f4e,0xc9))[_0x5298('0x30')](handleError(_0x269f4e,null));};exports['update']=function(_0x1f7c8a,_0x54fb4e){if(_0x1f7c8a[_0x5298('0x66')]['id']){delete _0x1f7c8a['body']['id'];}return db['SmsAccount'][_0x5298('0x65')]({'where':{'id':_0x1f7c8a['params']['id']},'include':[{'model':db[_0x5298('0x46')],'as':_0x5298('0x47')}]})[_0x5298('0x3e')](handleEntityNotFound(_0x54fb4e,null))['then'](saveUpdates(_0x1f7c8a[_0x5298('0x66')],null))[_0x5298('0x3e')](respondWithResult(_0x54fb4e,null))[_0x5298('0x30')](handleError(_0x54fb4e,null));};exports[_0x5298('0x3f')]=function(_0x42a2b0,_0x3205bb){return db[_0x5298('0x48')][_0x5298('0x65')]({'where':{'id':_0x42a2b0[_0x5298('0x62')]['id']}})[_0x5298('0x3e')](handleEntityNotFound(_0x3205bb,null))[_0x5298('0x3e')](removeEntity(_0x3205bb,null))[_0x5298('0x30')](handleError(_0x3205bb,null));};exports[_0x5298('0x6e')]=function(_0x347566,_0x508b9f){return db[_0x5298('0x48')]['describe']()[_0x5298('0x3e')](respondWithResult(_0x508b9f,null))[_0x5298('0x30')](handleError(_0x508b9f,null));};exports[_0x5298('0x6f')]=function(_0x4a6815,_0x4f9203,_0xadff57){if(_0x4a6815[_0x5298('0x66')]['id']){delete _0x4a6815[_0x5298('0x66')]['id'];}return db[_0x5298('0x48')][_0x5298('0x65')]({'where':{'id':_0x4a6815['params']['id']}})['then'](handleEntityNotFound(_0x4f9203,null))[_0x5298('0x3e')](function(_0x15a1b1){if(_0x15a1b1){_0x4a6815[_0x5298('0x66')][_0x5298('0x70')]=_0x15a1b1['id'];return db[_0x5298('0x71')]['create'](_0x4a6815[_0x5298('0x66')]);}})[_0x5298('0x3e')](respondWithResult(_0x4f9203,null))['catch'](handleError(_0x4f9203,null));};exports['getDispositions']=function(_0x1081a4,_0x5bc673,_0x48c2ec){var _0x4a25e5={'raw':![],'where':{}};var _0x247928={};var _0x50e198={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x1081a4['params']['id']}})[_0x5298('0x3e')](handleEntityNotFound(_0x5bc673,null))[_0x5298('0x3e')](function(_0x59da0a){if(_0x59da0a){_0x247928[_0x5298('0x4d')]=_[_0x5298('0x50')](db['Disposition'][_0x5298('0x49')]);_0x247928['query']=_[_0x5298('0x50')](_0x1081a4[_0x5298('0x4f')]);_0x247928[_0x5298('0x51')]=_[_0x5298('0x52')](_0x247928[_0x5298('0x4d')],_0x247928['query']);_0x4a25e5[_0x5298('0x53')]=_[_0x5298('0x52')](_0x247928[_0x5298('0x4d')],qs[_0x5298('0x54')](_0x1081a4['query'][_0x5298('0x54')]));_0x4a25e5[_0x5298('0x53')]=_0x4a25e5[_0x5298('0x53')]['length']?_0x4a25e5[_0x5298('0x53')]:_0x247928[_0x5298('0x4d')];if(!_0x1081a4[_0x5298('0x4f')]['hasOwnProperty'](_0x5298('0x55'))){_0x4a25e5[_0x5298('0x38')]=qs[_0x5298('0x38')](_0x1081a4[_0x5298('0x4f')][_0x5298('0x38')]);_0x4a25e5[_0x5298('0x35')]=qs[_0x5298('0x35')](_0x1081a4['query']['offset']);}_0x4a25e5[_0x5298('0x56')]=qs[_0x5298('0x57')](_0x1081a4[_0x5298('0x4f')][_0x5298('0x57')]);_0x4a25e5[_0x5298('0x58')]=qs[_0x5298('0x51')](_[_0x5298('0x59')](_0x1081a4[_0x5298('0x4f')],_0x247928[_0x5298('0x51')]));_0x4a25e5[_0x5298('0x58')][_0x5298('0x70')]=_0x59da0a['id'];if(_0x1081a4[_0x5298('0x4f')][_0x5298('0x5a')]){_0x4a25e5['where']=_[_0x5298('0x5b')](_0x4a25e5[_0x5298('0x58')],{'$or':_['map'](_0x4a25e5['attributes'],function(_0x1b5b47){var _0x50fc21={};_0x50fc21[_0x1b5b47]={'$like':'%'+_0x1081a4['query'][_0x5298('0x5a')]+'%'};return _0x50fc21;})});}_0x4a25e5=_[_0x5298('0x5b')]({},_0x4a25e5,_0x1081a4[_0x5298('0x5d')]);return db['Disposition']['count']({'where':_0x4a25e5[_0x5298('0x58')]})['then'](function(_0x5001b9){_0x50e198[_0x5298('0x37')]=_0x5001b9;if(_0x1081a4[_0x5298('0x4f')][_0x5298('0x64')]){_0x4a25e5[_0x5298('0x5e')]=[{'all':!![]}];}return db[_0x5298('0x71')][_0x5298('0x5f')](_0x4a25e5);})[_0x5298('0x3e')](function(_0x17e952){_0x50e198['rows']=_0x17e952;return _0x50e198;});}})[_0x5298('0x3e')](respondWithFilteredResult(_0x5bc673,_0x4a25e5))[_0x5298('0x30')](handleError(_0x5bc673,null));};exports[_0x5298('0x72')]=function(_0x5a5d2f,_0x40fef3,_0x158c5c){return db[_0x5298('0x48')]['find']({'where':{'id':_0x5a5d2f['params']['id']}})['then'](handleEntityNotFound(_0x40fef3,null))['then'](function(_0x27829b){if(_0x27829b){return _0x27829b[_0x5298('0x72')](_0x5a5d2f[_0x5298('0x4f')][_0x5298('0x73')]);}})['then'](respondWithStatusCode(_0x40fef3,null))['catch'](handleError(_0x40fef3,null));};exports['addAnswer']=function(_0x13437e,_0x2d4d64,_0x3854c2){if(_0x13437e['body']['id']){delete _0x13437e['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x13437e[_0x5298('0x62')]['id']}})[_0x5298('0x3e')](handleEntityNotFound(_0x2d4d64,null))[_0x5298('0x3e')](function(_0x57070e){if(_0x57070e){_0x13437e['body'][_0x5298('0x70')]=_0x57070e['id'];return db[_0x5298('0x74')][_0x5298('0x75')](_0x13437e['body']);}})[_0x5298('0x3e')](respondWithResult(_0x2d4d64,null))[_0x5298('0x30')](handleError(_0x2d4d64,null));};exports[_0x5298('0x76')]=function(_0xfed253,_0x134781,_0x4bbf03){var _0xa513ef={'raw':![],'where':{}};var _0x50751f={};var _0x247a74={'count':0x0,'rows':[]};return db[_0x5298('0x48')][_0x5298('0x77')]({'where':{'id':_0xfed253[_0x5298('0x62')]['id']}})[_0x5298('0x3e')](handleEntityNotFound(_0x134781,null))[_0x5298('0x3e')](function(_0x54530f){if(_0x54530f){_0x50751f[_0x5298('0x4d')]=_[_0x5298('0x50')](db[_0x5298('0x74')][_0x5298('0x49')]);_0x50751f[_0x5298('0x4f')]=_['keys'](_0xfed253['query']);_0x50751f[_0x5298('0x51')]=_[_0x5298('0x52')](_0x50751f[_0x5298('0x4d')],_0x50751f[_0x5298('0x4f')]);_0xa513ef[_0x5298('0x53')]=_[_0x5298('0x52')](_0x50751f[_0x5298('0x4d')],qs[_0x5298('0x54')](_0xfed253[_0x5298('0x4f')]['fields']));_0xa513ef[_0x5298('0x53')]=_0xa513ef[_0x5298('0x53')]['length']?_0xa513ef[_0x5298('0x53')]:_0x50751f[_0x5298('0x4d')];if(!_0xfed253[_0x5298('0x4f')][_0x5298('0x78')](_0x5298('0x55'))){_0xa513ef[_0x5298('0x38')]=qs['limit'](_0xfed253[_0x5298('0x4f')][_0x5298('0x38')]);_0xa513ef[_0x5298('0x35')]=qs[_0x5298('0x35')](_0xfed253['query'][_0x5298('0x35')]);}_0xa513ef[_0x5298('0x56')]=qs[_0x5298('0x57')](_0xfed253['query'][_0x5298('0x57')]);_0xa513ef[_0x5298('0x58')]=qs[_0x5298('0x51')](_['pick'](_0xfed253['query'],_0x50751f[_0x5298('0x51')]));_0xa513ef[_0x5298('0x58')]['SmsAccountId']=_0x54530f['id'];if(_0xfed253[_0x5298('0x4f')][_0x5298('0x5a')]){_0xa513ef[_0x5298('0x58')]=_[_0x5298('0x5b')](_0xa513ef['where'],{'$or':_[_0x5298('0x4e')](_0xa513ef[_0x5298('0x53')],function(_0x51cbe8){var _0x292835={};_0x292835[_0x51cbe8]={'$like':'%'+_0xfed253[_0x5298('0x4f')][_0x5298('0x5a')]+'%'};return _0x292835;})});}_0xa513ef=_[_0x5298('0x5b')]({},_0xa513ef,_0xfed253['options']);return db['CannedAnswer'][_0x5298('0x37')]({'where':_0xa513ef['where']})[_0x5298('0x3e')](function(_0x177bcc){_0x247a74[_0x5298('0x37')]=_0x177bcc;if(_0xfed253[_0x5298('0x4f')][_0x5298('0x64')]){_0xa513ef[_0x5298('0x5e')]=[{'all':!![]}];}return db[_0x5298('0x74')][_0x5298('0x5f')](_0xa513ef);})[_0x5298('0x3e')](function(_0x58cd4c){_0x247a74[_0x5298('0x60')]=_0x58cd4c;return _0x247a74;});}})['then'](respondWithFilteredResult(_0x134781,_0xa513ef))[_0x5298('0x30')](handleError(_0x134781,null));};exports[_0x5298('0x79')]=function(_0x4acd7c,_0x255e18,_0x53dceb){return db[_0x5298('0x48')]['find']({'where':{'id':_0x4acd7c[_0x5298('0x62')]['id']}})['then'](handleEntityNotFound(_0x255e18,null))[_0x5298('0x3e')](function(_0x268ffb){if(_0x268ffb){return _0x268ffb[_0x5298('0x79')](_0x4acd7c['query']['ids']);}})[_0x5298('0x3e')](respondWithStatusCode(_0x255e18,null))[_0x5298('0x30')](handleError(_0x255e18,null));};exports[_0x5298('0x7a')]=function(_0x529803,_0x4ad0e8,_0x40e39a){var _0x270598={'channel':_0x5298('0x7b')};var _0x5ab86f=[];var _0x50db06=[];var _0x2671c7={};return db[_0x5298('0x48')][_0x5298('0x65')]({'where':{'id':_0x529803[_0x5298('0x62')]['id']},'include':[{'model':db[_0x5298('0x7c')],'as':'Applications'}]})[_0x5298('0x3e')](handleEntityNotFound(_0x4ad0e8,null))[_0x5298('0x3e')](function(_0x3a8f42){_0x270598['account']=_0x3a8f42;_0x270598['applications']=_[_0x5298('0x7d')](_0x3a8f42[_0x5298('0x7e')],['priority'],['asc']);if(_0x270598[_0x5298('0x7f')]['Applications']){delete _0x270598[_0x5298('0x7f')][_0x5298('0x7e')];}return db['CmContact'][_0x5298('0x6e')]();})[_0x5298('0x3e')](function(_0x4bbc45){if(!_0x4bbc45){throw new db[(_0x5298('0x80'))][(_0x5298('0x81'))](_0x5298('0x82'));}_0x5ab86f=_[_0x5298('0x83')](_[_0x5298('0x50')](_0x4bbc45),[_0x5298('0x84'),_0x5298('0x85')]);_0x50db06=_[_0x5298('0x83')](_[_0x5298('0x50')](_0x4bbc45),[_0x5298('0x84'),'updatedAt',_0x5298('0x86'),_0x5298('0x87')]);_0x270598[_0x5298('0x66')]={'mapKey':_0x5298('0x88')};if(_0x270598[_0x5298('0x7f')][_0x5298('0x4b')]){switch(_0x270598[_0x5298('0x7f')][_0x5298('0x4b')]){case _0x5298('0x89'):_0x270598[_0x5298('0x66')][_0x5298('0x8a')]=_0x529803['body']['From'];_0x270598[_0x5298('0x66')][_0x5298('0x66')]=_0x529803[_0x5298('0x66')]['Body'];_0x270598[_0x5298('0x66')][_0x5298('0x8b')]=_0x529803[_0x5298('0x66')][_0x5298('0x8c')];break;case'skebby':_0x270598[_0x5298('0x66')]['from']='+'+_0x529803[_0x5298('0x66')][_0x5298('0x8d')];_0x270598[_0x5298('0x66')][_0x5298('0x66')]=_0x529803[_0x5298('0x66')]['text'];break;case _0x5298('0x8e'):_0x270598[_0x5298('0x66')][_0x5298('0x8a')]=_0x529803[_0x5298('0x66')][_0x5298('0x8a')];_0x270598[_0x5298('0x66')][_0x5298('0x66')]=_0x529803[_0x5298('0x66')][_0x5298('0x2e')];break;case _0x5298('0x8f'):_0x270598[_0x5298('0x66')][_0x5298('0x8a')]=_0x529803['body'][_0x5298('0x8a')];_0x270598[_0x5298('0x66')]['body']=_0x529803[_0x5298('0x66')]['body'];_0x270598[_0x5298('0x66')]['messageId']=_0x529803[_0x5298('0x66')][_0x5298('0x90')];break;case'plivo':_0x270598[_0x5298('0x66')][_0x5298('0x8a')]=_0x529803['body'][_0x5298('0x91')];_0x270598[_0x5298('0x66')][_0x5298('0x66')]=_0x529803[_0x5298('0x66')][_0x5298('0x92')];_0x270598[_0x5298('0x66')][_0x5298('0x8b')]=_0x529803['body'][_0x5298('0x93')];break;case _0x5298('0x94'):_0x270598[_0x5298('0x66')][_0x5298('0x8a')]='+'+_0x529803[_0x5298('0x66')][_0x5298('0x95')][0x0][_0x5298('0x8a')];_0x270598[_0x5298('0x66')][_0x5298('0x66')]=_0x529803[_0x5298('0x66')][_0x5298('0x95')][0x0][_0x5298('0x96')];_0x270598[_0x5298('0x66')][_0x5298('0x8b')]=_0x529803[_0x5298('0x66')]['results'][0x0][_0x5298('0x8b')];break;case _0x5298('0x97'):_0x270598[_0x5298('0x66')][_0x5298('0x8a')]=_0x529803[_0x5298('0x66')][_0x5298('0x98')];_0x270598['body'][_0x5298('0x66')]=_0x529803[_0x5298('0x66')][_0x5298('0x99')][_0x5298('0x2e')];break;case'clickatell':_0x270598['body'][_0x5298('0x8a')]=_0x529803['body'][_0x5298('0x9a')];_0x270598[_0x5298('0x66')][_0x5298('0x66')]=_0x529803[_0x5298('0x66')][_0x5298('0x96')];_0x270598[_0x5298('0x66')][_0x5298('0x8b')]=_0x529803[_0x5298('0x66')][_0x5298('0x9b')];break;case _0x5298('0x9c'):_0x270598[_0x5298('0x66')][_0x5298('0x8b')]=_0x529803['body'][0x0]['message']['id'];_0x270598[_0x5298('0x66')][_0x5298('0x8a')]=_0x529803['body'][0x0][_0x5298('0x2e')][_0x5298('0x8a')];_0x270598[_0x5298('0x66')][_0x5298('0x66')]=_0x529803[_0x5298('0x66')][0x0][_0x5298('0x2e')][_0x5298('0x96')];break;case _0x5298('0x9d'):_0x270598[_0x5298('0x66')][_0x5298('0x8a')]=_0x529803[_0x5298('0x66')][_0x5298('0x8a')];_0x270598['body'][_0x5298('0x66')]=_0x529803[_0x5298('0x66')]['message'];_0x270598[_0x5298('0x66')]['messageId']=_0x529803[_0x5298('0x66')][_0x5298('0x9e')];break;}}if(_0x270598[_0x5298('0x66')]['id']){delete _0x270598[_0x5298('0x66')]['id'];}if(_[_0x5298('0x9f')](_0x270598[_0x5298('0x66')]['from'])){throw new db[(_0x5298('0x80'))][(_0x5298('0x81'))](_0x5298('0xa0'));}if(_[_0x5298('0x9f')](_0x270598[_0x5298('0x66')][_0x5298('0x66')])||_0x270598['body'][_0x5298('0x66')]===''){throw new db[(_0x5298('0x80'))][(_0x5298('0x81'))](_0x5298('0xa1'));}if(_['isNil'](_0x270598[_0x5298('0x66')]['mapKey'])){throw new db[(_0x5298('0x80'))][(_0x5298('0x81'))](_0x5298('0xa2')+_0x50db06);}if(!_['includes'](_0x50db06,_0x270598[_0x5298('0x66')]['mapKey'])){throw new db[(_0x5298('0x80'))][(_0x5298('0x81'))](_0x5298('0xa3')+_0x50db06);}_0x2671c7[_0x270598[_0x5298('0x66')][_0x5298('0xa4')]]=_0x270598[_0x5298('0x66')][_0x5298('0x8a')];return db['CmList'][_0x5298('0x65')]({'where':{'id':_0x270598[_0x5298('0x7f')][_0x5298('0x87')]},'include':[{'model':db[_0x5298('0xa5')],'as':'Contacts','where':_0x2671c7,'limit':0x1,'order':[[_0x5298('0x85'),_0x5298('0xa6')]]}]});})[_0x5298('0x3e')](handleEntityNotFound(_0x4ad0e8,null))[_0x5298('0x3e')](function(_0x101172){if(_0x101172){_0x270598[_0x5298('0xa7')]=_[_0x5298('0xa8')](_0x101172,[_0x5298('0xa9')]);if(_0x101172['Contacts'][_0x5298('0x63')]){return _0x101172[_0x5298('0xa9')][0x0];}var _0x3e56a7=_[_0x5298('0x1d')](_0x270598[_0x5298('0x66')],{'firstName':_0x270598[_0x5298('0x66')]['from'],'ListId':_0x101172['id']});_0x3e56a7[_0x270598[_0x5298('0x66')][_0x5298('0xa4')]]=_0x270598[_0x5298('0x66')][_0x5298('0x8a')];return db['CmContact']['create'](_0x3e56a7,{'fields':_0x5ab86f,'raw':!![]});}})[_0x5298('0x3e')](handleEntityNotFound(_0x4ad0e8,null))['then'](function(_0x195a16){if(_0x195a16){_0x270598[_0x5298('0xaa')]=_0x195a16;var _0x3ecf73={'ContactId':_0x195a16['id'],'phone':_0x270598[_0x5298('0x66')]['from'],'SmsAccountId':_0x529803[_0x5298('0x62')]['id']};var _0x1f2b28={'ContactId':_0x195a16['id'],'SmsAccountId':_0x529803[_0x5298('0x62')]['id'],'closed':![]};return db[_0x5298('0xab')][_0x5298('0x65')]({'where':_0x1f2b28})[_0x5298('0x3e')](function(_0x1b5a5b){if(_0x1b5a5b){return[_0x1b5a5b,![]];}return db['SmsInteraction'][_0x5298('0x75')](_0x3ecf73)[_0x5298('0x3e')](function(_0x1ab89d){return[_0x1ab89d,!![]];});});}})[_0x5298('0xac')](function(_0x28e2c7,_0x3f5878){_0x270598['interaction']=_0x28e2c7[_0x5298('0x40')]({'plain':!![]});_0x270598[_0x5298('0xad')]['created']=![];if(_0x3f5878){if(_0x270598['account'][_0x5298('0xae')]){_0x270598[_0x5298('0xaf')][_0x5298('0xb0')]({'id':0x0,'priority':_0x270598[_0x5298('0xaf')]['length']+0x1,'app':_0x5298('0xb1'),'appdata':_0x5298('0xb2'),'interval':_0x5298('0xb3')});}_0x270598[_0x5298('0xad')]['created']=!![];}return db[_0x5298('0xb4')][_0x5298('0x75')]({'phone':_0x270598['body'][_0x5298('0x8a')],'messageId':_0x270598['body']['messageId'],'body':_0x270598['body'][_0x5298('0x66')],'SmsAccountId':_0x529803[_0x5298('0x62')]['id'],'SmsInteractionId':_0x28e2c7['id'],'direction':'in','ContactId':_0x28e2c7[_0x5298('0xb5')],'AttachmentId':_0x270598[_0x5298('0x66')][_0x5298('0xb6')]});})[_0x5298('0x3e')](function(_0x462782){_0x270598['message']=_0x462782;if(_0x270598[_0x5298('0xad')][_0x5298('0xb7')]){return db[_0x5298('0xb8')]['find']({'attributes':['id',_0x5298('0x43')],'where':{'id':_0x270598[_0x5298('0xad')][_0x5298('0xb7')]}})[_0x5298('0x3e')](function(_0x26eef5){if(_0x26eef5){_0x270598[_0x5298('0xaf')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5298('0xb9'),'appdata':_0x26eef5[_0x5298('0x43')]+','+(_0x270598[_0x5298('0x7f')][_0x5298('0xba')]||0xa),'interval':_0x5298('0xb3')});}return respondWithRpcPromise(_0x5298('0xbb'),_0x5298('0xbc'),_0x270598);});}return respondWithRpcPromise(_0x5298('0xbb'),_0x5298('0xbc'),_0x270598);})[_0x5298('0x3e')](function(_0x481977){if(_0x481977){var _0x523fd1=0xc8;var _0x2fcf92=_0x5298('0xbd');logger[_0x5298('0x26')](_0x5298('0x2a'),_0x2fcf92,_0x523fd1,_0x5298('0xbe'));logger[_0x5298('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2fcf92,_0x523fd1,_0x5298('0xbe'),JSON[_0x5298('0x2b')](_0x481977));if(_0x270598[_0x5298('0x7f')]['type']===_0x5298('0x89')){return _0x4ad0e8['status'](_0x523fd1)[_0x5298('0x39')](_0x5298('0xbf'),'text/xml')[_0x5298('0x44')](_0x5298('0xc0'));}else{return _0x4ad0e8['status'](_0x523fd1)[_0x5298('0x34')](_0x481977);}}})['catch'](handleError(_0x4ad0e8,null));};exports[_0x5298('0xc1')]=function(_0x5be2ca,_0x6110bb){var _0x1867d4=_0x5be2ca[_0x5298('0x62')]['id'];var _0x36b764=_0x5be2ca[_0x5298('0x66')];var _0x4a3f83=0xc8;var _0x79437c=null;return db[_0x5298('0xc2')][_0x5298('0xc3')]({'isolationLevel':db[_0x5298('0xc2')][_0x5298('0xc4')][_0x5298('0xc5')][_0x5298('0xc6')]},function(_0x35aa03){return db[_0x5298('0x48')][_0x5298('0x77')]({'where':{'id':_0x1867d4},'transaction':_0x35aa03})['then'](function(_0x21dfcc){if(_0x21dfcc){return db[_0x5298('0x7c')][_0x5298('0x3f')]({'where':{'SmsAccountId':_0x1867d4},'transaction':_0x35aa03})['then'](function(){var _0xafae49=_[_0x5298('0x4e')](_0x36b764,function(_0x5455e7){_0x5455e7['SmsAccountId']=_0x1867d4;return _0x5455e7;});return db[_0x5298('0x7c')][_0x5298('0xc7')](_0xafae49,{'transaction':_0x35aa03});});}else{_0x4a3f83=0x194;_0x79437c=[];}});})[_0x5298('0x3e')](function(){if(_0x4a3f83!==0x194){return db[_0x5298('0x7c')][_0x5298('0xc8')]({'where':{'SmsAccountId':_0x1867d4},'order':_0x5298('0xc9')})[_0x5298('0x3e')](function(_0x15a259){_0x79437c=_0x15a259;});}})[_0x5298('0x30')](function(_0x227cfa){_0x4a3f83=0x1f4;logger[_0x5298('0x2c')](_0x227cfa[_0x5298('0x42')]);if(_0x227cfa[_0x5298('0x43')]){delete _0x227cfa['name'];}_0x79437c=_0x227cfa;})[_0x5298('0xca')](function(){if(_0x79437c===null){_0x6110bb['sendStatus'](_0x4a3f83);}else{if(_0x4a3f83===0x1f4){_0x6110bb[_0x5298('0x32')](_0x4a3f83)['send'](_0x79437c);}else{_0x6110bb['status'](_0x4a3f83)['json'](_0x79437c);}}});};exports[_0x5298('0xcb')]=function(_0x41508e,_0x7a4351,_0x28fee3){var _0x596d72={};var _0x957216={};var _0x382d89;var _0x3e1769;return db['SmsAccount'][_0x5298('0x77')]({'where':{'id':_0x41508e[_0x5298('0x62')]['id']}})[_0x5298('0x3e')](handleEntityNotFound(_0x7a4351,null))['then'](function(_0x510480){if(_0x510480){_0x382d89=_0x510480;_0x957216['model']=_[_0x5298('0x50')](db[_0x5298('0x7c')][_0x5298('0x49')]);_0x957216[_0x5298('0x4f')]=_[_0x5298('0x50')](_0x41508e[_0x5298('0x4f')]);_0x957216[_0x5298('0x51')]=_[_0x5298('0x52')](_0x957216[_0x5298('0x4d')],_0x957216['query']);_0x596d72['attributes']=_[_0x5298('0x52')](_0x957216[_0x5298('0x4d')],qs[_0x5298('0x54')](_0x41508e[_0x5298('0x4f')][_0x5298('0x54')]));_0x596d72[_0x5298('0x53')]=_0x596d72[_0x5298('0x53')][_0x5298('0x63')]?_0x596d72[_0x5298('0x53')]:_0x957216[_0x5298('0x4d')];_0x596d72['order']=qs['sort'](_0x41508e[_0x5298('0x4f')][_0x5298('0x57')]);_0x596d72[_0x5298('0x58')]=qs[_0x5298('0x51')](_[_0x5298('0x59')](_0x41508e[_0x5298('0x4f')],_0x957216['filters']));if(_0x41508e[_0x5298('0x4f')][_0x5298('0x5a')]){_0x596d72['where']=_[_0x5298('0x5b')](_0x596d72[_0x5298('0x58')],{'$or':_[_0x5298('0x4e')](_0x596d72['attributes'],function(_0x4908e6){var _0x381ea3={};_0x381ea3[_0x4908e6]={'$like':'%'+_0x41508e[_0x5298('0x4f')][_0x5298('0x5a')]+'%'};return _0x381ea3;})});}_0x596d72=_[_0x5298('0x5b')]({},_0x596d72,_0x41508e[_0x5298('0x5d')]);return _0x382d89['getApplications'](_0x596d72);}})['then'](function(_0x45f49b){if(_0x45f49b){_0x3e1769=_0x45f49b[_0x5298('0x63')];if(!_0x41508e['query'][_0x5298('0x78')](_0x5298('0x55'))){_0x596d72[_0x5298('0x38')]=qs['limit'](_0x41508e[_0x5298('0x4f')]['limit']);_0x596d72[_0x5298('0x35')]=qs['offset'](_0x41508e[_0x5298('0x4f')][_0x5298('0x35')]);}return _0x382d89['getApplications'](_0x596d72);}})[_0x5298('0x3e')](function(_0x3155fe){if(_0x3155fe){return _0x3155fe?{'count':_0x3e1769,'rows':_0x3155fe}:null;}})['then'](respondWithResult(_0x7a4351,null))[_0x5298('0x30')](handleError(_0x7a4351,null));};exports[_0x5298('0xcc')]=function(_0x2eb96e,_0x365e79,_0x508154){var _0x502209={'raw':![],'where':{}};var _0x29f22d={};var _0x4e247f={'count':0x0,'rows':[]};return db[_0x5298('0x48')][_0x5298('0x77')]({'where':{'id':_0x2eb96e[_0x5298('0x62')]['id']}})[_0x5298('0x3e')](handleEntityNotFound(_0x365e79,null))[_0x5298('0x3e')](function(_0x3296d4){if(_0x3296d4){_0x29f22d[_0x5298('0x4d')]=_['keys'](db[_0x5298('0xab')][_0x5298('0x49')]);_0x29f22d['query']=_[_0x5298('0x50')](_0x2eb96e[_0x5298('0x4f')]);_0x29f22d[_0x5298('0x51')]=_[_0x5298('0x52')](_0x29f22d[_0x5298('0x4d')],_0x29f22d[_0x5298('0x4f')]);_0x502209[_0x5298('0x53')]=_[_0x5298('0x52')](_0x29f22d[_0x5298('0x4d')],qs['fields'](_0x2eb96e[_0x5298('0x4f')][_0x5298('0x54')]));_0x502209['attributes']=_0x502209[_0x5298('0x53')][_0x5298('0x63')]?_0x502209[_0x5298('0x53')]:_0x29f22d[_0x5298('0x4d')];if(!_0x2eb96e[_0x5298('0x4f')]['hasOwnProperty'](_0x5298('0x55'))){_0x502209['limit']=qs[_0x5298('0x38')](_0x2eb96e[_0x5298('0x4f')][_0x5298('0x38')]);_0x502209['offset']=qs['offset'](_0x2eb96e['query'][_0x5298('0x35')]);}_0x502209[_0x5298('0x56')]=qs[_0x5298('0x57')](_0x2eb96e[_0x5298('0x4f')][_0x5298('0x57')]);_0x502209['where']=qs[_0x5298('0x51')](_[_0x5298('0x59')](_0x2eb96e[_0x5298('0x4f')],_0x29f22d[_0x5298('0x51')]));_0x502209[_0x5298('0x58')][_0x5298('0x70')]=_0x3296d4['id'];if(_0x2eb96e['query'][_0x5298('0x5a')]){_0x502209[_0x5298('0x58')]=_['merge'](_0x502209[_0x5298('0x58')],{'$or':_['map'](_0x502209[_0x5298('0x53')],function(_0x51cb71){var _0x4a7be0={};_0x4a7be0[_0x51cb71]={'$like':'%'+_0x2eb96e[_0x5298('0x4f')][_0x5298('0x5a')]+'%'};return _0x4a7be0;})});}_0x502209=_[_0x5298('0x5b')]({},_0x502209,_0x2eb96e[_0x5298('0x5d')]);return db[_0x5298('0xab')][_0x5298('0x37')]({'where':_0x502209[_0x5298('0x58')]})['then'](function(_0x4d17e2){_0x4e247f[_0x5298('0x37')]=_0x4d17e2;if(_0x2eb96e['query'][_0x5298('0x64')]){_0x502209[_0x5298('0x5e')]=[{'model':db['CmContact'],'as':_0x5298('0xcd'),'required':![]},{'model':db[_0x5298('0xb8')],'as':_0x5298('0xce'),'attributes':[_0x5298('0x43'),_0x5298('0xcf'),_0x5298('0xd0')],'required':![]},{'model':db[_0x5298('0xd1')],'as':_0x5298('0xd2'),'attributes':['id',_0x5298('0x43'),'color'],'where':_0x2eb96e[_0x5298('0x4f')][_0x5298('0xd3')]?{'id':_0x2eb96e['query'][_0x5298('0xd3')]}:undefined,'required':_0x2eb96e[_0x5298('0x4f')]['tag']?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x502209);})[_0x5298('0x3e')](function(_0x4cd824){_0x4e247f[_0x5298('0x60')]=_0x4cd824;return _0x4e247f;});}})[_0x5298('0x3e')](respondWithFilteredResult(_0x365e79,_0x502209))[_0x5298('0x30')](handleError(_0x365e79,null));};exports['send']=function(_0x568365,_0x55c4c0,_0x41cab1){var _0x1db01e,_0x3bef82,_0x2ba65b;if(_[_0x5298('0x9f')](_0x568365[_0x5298('0x66')][_0x5298('0x66')])||_0x568365['body'][_0x5298('0x66')]===''){throw new db[(_0x5298('0x80'))][(_0x5298('0x81'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x568365['body']['to'])){throw new db[(_0x5298('0x80'))]['ValidationError'](_0x5298('0xd4'));}_0x1db01e=_0x568365[_0x5298('0x66')]['to'];return db[_0x5298('0x48')]['find']({'where':{'id':_0x568365[_0x5298('0x62')]['id']},'include':[{'model':db[_0x5298('0xd5')],'as':_0x5298('0xd6'),'include':[{'model':db[_0x5298('0xa5')],'as':_0x5298('0xa9'),'where':{'mobile':_0x1db01e},'limit':0x1,'order':[[_0x5298('0x85'),_0x5298('0xa6')]]}]}]})[_0x5298('0x3e')](handleEntityNotFound(_0x55c4c0,null))[_0x5298('0x3e')](function(_0x46b5cd){if(_0x46b5cd&&_0x46b5cd[_0x5298('0xd6')]){_0x3bef82=_0x46b5cd[_0x5298('0x40')]({'plain':!![]});if(_0x3bef82['List']&&_0x3bef82[_0x5298('0xd6')][_0x5298('0xa9')][_0x5298('0x63')]){return _0x3bef82['List'][_0x5298('0xa9')][0x0];}return db[_0x5298('0xa5')][_0x5298('0x75')](_[_0x5298('0x1d')](_0x568365[_0x5298('0x66')],{'firstName':_0x1db01e,'mobile':_0x1db01e,'phone':_0x1db01e,'ListId':_0x3bef82[_0x5298('0x87')]}));}})[_0x5298('0x3e')](handleEntityNotFound(_0x55c4c0,null))[_0x5298('0x3e')](function(_0xd68f2c){if(_0xd68f2c){_0x2ba65b=_0xd68f2c;return db[_0x5298('0xab')]['find']({'where':{'ContactId':_0x2ba65b['id'],'closed':![],'SmsAccountId':_0x3bef82['id']}})[_0x5298('0x3e')](function(_0x30ad1e){if(_0x30ad1e){return[_0x30ad1e,![]];}return db['SmsInteraction'][_0x5298('0x75')]({'UserId':_0x568365[_0x5298('0x67')]['id'],'ContactId':_0x2ba65b['id'],'SmsAccountId':_0x3bef82['id'],'phone':_0x1db01e,'firstMsgDirection':'out','Messages':[_[_0x5298('0x5b')](_0x568365[_0x5298('0x66')],{'read':![],'body':_0x568365[_0x5298('0x66')][_0x5298('0x66')],'phone':_0x1db01e,'SmsAccountId':_0x3bef82['id'],'UserId':_0x568365[_0x5298('0x67')]['id'],'ContactId':_0x2ba65b['id']})]},{'include':[{'model':db[_0x5298('0xb4')],'as':_0x5298('0xd7')}]})[_0x5298('0x3e')](function(_0x382eff){return[_0x382eff,!![]];});});}})[_0x5298('0xac')](function(_0x393b49,_0xcb5bc7){if(_0xcb5bc7){return _0x393b49;}return db[_0x5298('0xb4')][_0x5298('0x75')](_[_0x5298('0x5b')](_0x568365[_0x5298('0x66')],{'read':![],'body':_0x568365[_0x5298('0x66')][_0x5298('0x66')],'phone':_0x1db01e,'SmsAccountId':_0x3bef82['id'],'SmsInteractionId':_0x393b49['id'],'UserId':_0x568365[_0x5298('0x67')]['id'],'ContactId':_0x2ba65b['id']}))[_0x5298('0x3e')](function(_0x1afd0f){_0x393b49[_0x5298('0xd8')]['Messages']=[];_0x393b49['dataValues'][_0x5298('0xd7')][_0x5298('0xb0')](_0x1afd0f['dataValues']);return _0x393b49;});})[_0x5298('0x3e')](respondWithResult(_0x55c4c0,null))[_0x5298('0x30')](handleError(_0x55c4c0,null));};exports['status']=function(_0x14195d,_0x5bc550,_0x582a85){if(_0x14195d[_0x5298('0x66')]['id']){delete _0x14195d[_0x5298('0x66')]['id'];}var _0x346d77,_0xe852a,_0x5406dd;return db['SmsAccount'][_0x5298('0x65')]({'where':{'id':_0x14195d['params']['id']}})[_0x5298('0x3e')](handleEntityNotFound(_0x5bc550,null))[_0x5298('0x3e')](function(_0x46c71b){if(_0x46c71b){_0x5406dd=_0x46c71b;logger[_0x5298('0x29')](_0x5298('0x2a'),_0x5298('0x32'),'received\x20delivery\x20report\x20from',_0x46c71b[_0x5298('0x4b')],util[_0x5298('0xd9')](_0x14195d[_0x5298('0x66')],{'showHidden':![],'depth':null}));switch(_0x46c71b[_0x5298('0x4b')]){case _0x5298('0xda'):if(_0x14195d['body'][_0x5298('0xdb')]&&_0x14195d['body'][_0x5298('0x32')]){_0xe852a=_0x14195d[_0x5298('0x66')][_0x5298('0x32')];return db['SmsMessage'][_0x5298('0x65')]({'where':{'messageId':_0x14195d[_0x5298('0x66')][_0x5298('0xdb')]}});}break;case _0x5298('0x8e'):if(_0x14195d[_0x5298('0x66')]['requestid']&&_0x14195d['body'][_0x5298('0xdc')]){_0xe852a=_0x14195d[_0x5298('0x66')][_0x5298('0xdc')];return db[_0x5298('0xb4')][_0x5298('0x65')]({'where':{'messageId':_0x14195d['body']['requestid']}});}break;case _0x5298('0x8f'):if(_0x14195d[_0x5298('0x66')][_0x5298('0x90')]&&_0x14195d[_0x5298('0x66')][_0x5298('0xdd')]){_0xe852a=_0x14195d[_0x5298('0x66')][_0x5298('0xdd')];return db[_0x5298('0xb4')][_0x5298('0x65')]({'where':{'messageId':_0x14195d[_0x5298('0x66')][_0x5298('0x90')]}});}break;case _0x5298('0x94'):var _0x325e29=_0x14195d[_0x5298('0x66')][_0x5298('0x95')][0x0];if(_0x325e29['messageId']&&_0x325e29[_0x5298('0x32')]['groupName']===_0x5298('0xde')){_0xe852a=_0x325e29[_0x5298('0x32')][_0x5298('0xdf')];return db[_0x5298('0xb4')][_0x5298('0x65')]({'where':{'messageId':_0x325e29[_0x5298('0x8b')]}});}break;case'clickatell':if(_0x14195d['body']['messageId']&&_0x14195d[_0x5298('0x66')][_0x5298('0x32')]){_0xe852a=_0x14195d[_0x5298('0x66')][_0x5298('0x32')];return db[_0x5298('0xb4')][_0x5298('0x65')]({'where':{'messageId':_0x14195d[_0x5298('0x66')]['messageId']}});}break;case _0x5298('0x9c'):if(_0x14195d[_0x5298('0x66')][0x0][_0x5298('0x2e')]['id']){_0xe852a=_0x14195d[_0x5298('0x66')][0x0]['type'];return db[_0x5298('0xb4')]['find']({'where':{'messageId':_0x14195d[_0x5298('0x66')][0x0][_0x5298('0x2e')]['id']}});}break;case _0x5298('0x9d'):if(_0x14195d[_0x5298('0x66')]['redif']&&_0x14195d[_0x5298('0x66')][_0x5298('0x32')]){_0xe852a=_0x14195d[_0x5298('0x66')]['status'];return db[_0x5298('0xb4')][_0x5298('0x65')]({'where':{'messageId':_0x14195d['body'][_0x5298('0xe0')]}});}break;}}})[_0x5298('0x3e')](handleEntityNotFound(_0x5bc550,null))[_0x5298('0x3e')](function(_0x2a0c85){if(_0x2a0c85){_0x346d77=_0x2a0c85;switch(_0x5406dd['type']){case'skebby':if(_0xe852a===_0x5298('0xde')){return _0x346d77['update']({'read':!![]});}else{logger[_0x5298('0x2c')](_0x5298('0x2a'),'status',_0x5298('0xda'),util[_0x5298('0xd9')](_0x14195d['body'],{'showHidden':![],'depth':null}));}break;case _0x5298('0x8e'):if(_0xe852a==='1'){return _0x346d77['update']({'read':!![]});}else{logger[_0x5298('0x2c')](_0x5298('0x2a'),_0x5298('0x32'),_0x5298('0xda'),util[_0x5298('0xd9')](_0x14195d['body'],{'showHidden':![],'depth':null}));}break;case _0x5298('0x8f'):if(!_0x14195d[_0x5298('0x66')]['error_code']&&_0xe852a>=0xc8&&_0xe852a<=0xce){return _0x346d77[_0x5298('0x3d')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5298('0x32'),'clicksend',util['inspect'](_0x14195d[_0x5298('0x66')],{'showHidden':![],'depth':null}));}break;case _0x5298('0x94'):var _0x5e07de=_0x14195d[_0x5298('0x66')][_0x5298('0x95')][0x0];if(_0x5e07de['status'][_0x5298('0xdf')]==='DELIVERED'){return _0x346d77['update']({'read':!![]});}else{logger['error'](_0x5298('0x2a'),'status','infobip',util[_0x5298('0xd9')](_0x14195d[_0x5298('0x66')],{'showHidden':![],'depth':null}));}break;case _0x5298('0xe1'):if(_0xe852a==_0x5298('0xe2')||_0xe852a=='RECEIVED_BY_RECIPIENT'){return _0x346d77[_0x5298('0x3d')]({'read':!![]});}else{logger[_0x5298('0x2c')](_0x5298('0x2a'),'status',_0x5298('0xe1'),util[_0x5298('0xd9')](_0x14195d['body'],{'showHidden':![],'depth':null}));}break;case _0x5298('0x9c'):if(_0xe852a=='message-delivered'){return _0x346d77['update']({'read':!![]});}else{logger[_0x5298('0x2c')](_0x5298('0x2a'),'status',_0x5298('0x9c'),util[_0x5298('0xd9')](_0x14195d[_0x5298('0x66')],{'showHidden':![],'depth':null}));}break;case _0x5298('0x9d'):if(_0xe852a===_0x5298('0xe3')||_0xe852a==='ACCEPTD'){return _0x346d77[_0x5298('0x3d')]({'read':!![]});}else{logger['error'](_0x5298('0x2a'),_0x5298('0x32'),'intelepeer',util['inspect'](_0x14195d[_0x5298('0x66')],{'showHidden':![],'depth':null}));}break;}return _0x346d77;}})[_0x5298('0x3e')](respondWithResult(_0x5bc550,null))[_0x5298('0x30')](handleError(_0x5bc550,null));};exports[_0x5298('0xe4')]=function(_0x3a16f8,_0x5f3cbb,_0x3c7fcd){var _0x4e59a6,_0x1bccae,_0xcde756;return db[_0x5298('0x48')][_0x5298('0x65')]({'where':{'id':_0x3a16f8[_0x5298('0x62')]['id']}})[_0x5298('0x3e')](handleEntityNotFound(_0x5f3cbb,null))[_0x5298('0x3e')](function(_0xa5969e){if(_0xa5969e){_0xcde756=_0xa5969e;logger[_0x5298('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5298('0x32'),_0x5298('0xe5'),_0xa5969e['type'],util[_0x5298('0xd9')](_0x3a16f8[_0x5298('0x4f')],{'showHidden':![],'depth':null}));switch(_0xa5969e['type']){case _0x5298('0x97'):if(_0x3a16f8[_0x5298('0x4f')]['message-id']&&_0x3a16f8[_0x5298('0x4f')][_0x5298('0xe6')]){_0x1bccae=_0x3a16f8[_0x5298('0x4f')][_0x5298('0xe6')];return db['SmsMessage']['find']({'where':{'messageId':_0x3a16f8[_0x5298('0x4f')][_0x5298('0xe7')]}});}break;}}})[_0x5298('0x3e')](handleEntityNotFound(_0x5f3cbb,null))[_0x5298('0x3e')](function(_0x5109e6){if(_0x5109e6){_0x4e59a6=_0x5109e6;switch(_0xcde756['type']){case'csc':if(_0x1bccae==='2'||_0x1bccae==='6'){return _0x4e59a6[_0x5298('0x3d')]({'read':!![]});}else{logger[_0x5298('0x2c')](_0x5298('0x2a'),'status',_0x5298('0x97'),util[_0x5298('0xd9')](_0x3a16f8[_0x5298('0x4f')],{'showHidden':![],'depth':null}));};break;}return _0x4e59a6;}})[_0x5298('0x3e')](respondWithResult(_0x5f3cbb,null))[_0x5298('0x30')](handleError(_0x5f3cbb,null));};exports[_0x5298('0xe8')]=function(_0x15d75f,_0x12c7ce,_0x526aba){return db[_0x5298('0x48')][_0x5298('0x65')]({'where':{'id':_0x15d75f[_0x5298('0x62')]['id']}})['then'](handleEntityNotFound(_0x12c7ce,null))[_0x5298('0x3e')](function(_0x32ea83){if(_0x32ea83){return _0x32ea83[_0x5298('0xe8')](_0x15d75f['body'][_0x5298('0x73')],_[_0x5298('0xa8')](_0x15d75f['body'],['ids','id'])||{})[_0x5298('0xac')](function(_0x3ee183){for(var _0x5d66bf=0x0;_0x5d66bf<_0x15d75f[_0x5298('0x66')][_0x5298('0x73')]['length'];_0x5d66bf+=0x1){socket['emit'](_0x5298('0xe9'),{'UserId':Number(_0x15d75f[_0x5298('0x66')][_0x5298('0x73')][_0x5d66bf]),'SmsAccountId':Number(_0x15d75f['params']['id'])});}return _0x3ee183;});}})[_0x5298('0x3e')](respondWithResult(_0x12c7ce,null))['catch'](handleError(_0x12c7ce,null));};exports[_0x5298('0xea')]=function(_0x11c49b,_0x579dbd,_0x5692cd){return db['SmsAccount'][_0x5298('0x65')]({'where':{'id':_0x11c49b[_0x5298('0x62')]['id']}})[_0x5298('0x3e')](handleEntityNotFound(_0x579dbd,null))[_0x5298('0x3e')](function(_0x4a6ef8){if(_0x4a6ef8){return _0x4a6ef8[_0x5298('0xea')](_0x11c49b[_0x5298('0x4f')][_0x5298('0x73')])[_0x5298('0x3e')](function(){if(_[_0x5298('0xeb')](_0x11c49b['query'][_0x5298('0x73')])){for(var _0x529bd1=0x0;_0x529bd1<_0x11c49b[_0x5298('0x4f')][_0x5298('0x73')]['length'];_0x529bd1+=0x1){socket[_0x5298('0xec')](_0x5298('0xed'),{'UserId':Number(_0x11c49b[_0x5298('0x4f')][_0x5298('0x73')][_0x529bd1]),'SmsAccountId':Number(_0x11c49b[_0x5298('0x62')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x11c49b[_0x5298('0x4f')][_0x5298('0x73')]),'SmsAccountId':Number(_0x11c49b[_0x5298('0x62')]['id'])});}});}})[_0x5298('0x3e')](respondWithStatusCode(_0x579dbd,null))[_0x5298('0x30')](handleError(_0x579dbd,null));};exports[_0x5298('0xee')]=function(_0x5cc6de,_0x166952,_0x16d064){var _0x129f3d={};var _0x59d0be={};var _0x23d4bf;var _0x22ba91;return db['SmsAccount']['findOne']({'where':{'id':_0x5cc6de[_0x5298('0x62')]['id']}})[_0x5298('0x3e')](handleEntityNotFound(_0x166952,null))['then'](function(_0x267b7b){if(_0x267b7b){_0x23d4bf=_0x267b7b;_0x59d0be[_0x5298('0x4d')]=_['keys'](db['User']['rawAttributes']);_0x59d0be[_0x5298('0x4f')]=_['keys'](_0x5cc6de[_0x5298('0x4f')]);_0x59d0be[_0x5298('0x51')]=_[_0x5298('0x52')](_0x59d0be[_0x5298('0x4d')],_0x59d0be[_0x5298('0x4f')]);_0x129f3d[_0x5298('0x53')]=_[_0x5298('0x52')](_0x59d0be[_0x5298('0x4d')],qs['fields'](_0x5cc6de[_0x5298('0x4f')]['fields']));_0x129f3d[_0x5298('0x53')]=_0x129f3d[_0x5298('0x53')][_0x5298('0x63')]?_0x129f3d[_0x5298('0x53')]:_0x59d0be[_0x5298('0x4d')];_0x129f3d[_0x5298('0x56')]=qs[_0x5298('0x57')](_0x5cc6de[_0x5298('0x4f')][_0x5298('0x57')]);_0x129f3d['where']=qs[_0x5298('0x51')](_[_0x5298('0x59')](_0x5cc6de[_0x5298('0x4f')],_0x59d0be[_0x5298('0x51')]));if(_0x5cc6de['query'][_0x5298('0x5a')]){_0x129f3d[_0x5298('0x58')]=_[_0x5298('0x5b')](_0x129f3d[_0x5298('0x58')],{'$or':_[_0x5298('0x4e')](_0x129f3d[_0x5298('0x53')],function(_0x943d9f){var _0x28875e={};_0x28875e[_0x943d9f]={'$like':'%'+_0x5cc6de[_0x5298('0x4f')]['filter']+'%'};return _0x28875e;})});}_0x129f3d=_[_0x5298('0x5b')]({},_0x129f3d,_0x5cc6de[_0x5298('0x5d')]);return _0x23d4bf['getAgents'](_0x129f3d);}})[_0x5298('0x3e')](function(_0x2f25e9){if(_0x2f25e9){_0x22ba91=_0x2f25e9[_0x5298('0x63')];if(!_0x5cc6de[_0x5298('0x4f')][_0x5298('0x78')](_0x5298('0x55'))){_0x129f3d[_0x5298('0x38')]=qs[_0x5298('0x38')](_0x5cc6de[_0x5298('0x4f')][_0x5298('0x38')]);_0x129f3d['offset']=qs[_0x5298('0x35')](_0x5cc6de[_0x5298('0x4f')]['offset']);}return _0x23d4bf[_0x5298('0xee')](_0x129f3d);}})['then'](function(_0x19ad7a){if(_0x19ad7a){return _0x19ad7a?{'count':_0x22ba91,'rows':_0x19ad7a}:null;}})[_0x5298('0x3e')](respondWithResult(_0x166952,null))[_0x5298('0x30')](handleError(_0x166952,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 6cf82ca..e6d7af8 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 _0xe995=['events','../../mysqldb','SmsAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2b6348,_0x29d1be){var _0x3a1985=function(_0x8d2802){while(--_0x8d2802){_0x2b6348['push'](_0x2b6348['shift']());}};_0x3a1985(++_0x29d1be);}(_0xe995,0x1a4));var _0x5e99=function(_0x37978c,_0x1f21c8){_0x37978c=_0x37978c-0x0;var _0xca8879=_0xe995[_0x37978c];return _0xca8879;};'use strict';var EventEmitter=require(_0x5e99('0x0'));var SmsAccount=require(_0x5e99('0x1'))['db'][_0x5e99('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x5e99('0x3')](0x0);var events={'afterCreate':_0x5e99('0x4'),'afterUpdate':'update','afterDestroy':_0x5e99('0x5')};function emitEvent(_0x2651ab){return function(_0x3a4e1d,_0x53ec6e,_0x59c7bb){SmsAccountEvents[_0x5e99('0x6')](_0x2651ab+':'+_0x3a4e1d['id'],_0x3a4e1d);SmsAccountEvents[_0x5e99('0x6')](_0x2651ab,_0x3a4e1d);_0x59c7bb(null);};}for(var e in events){if(events[_0x5e99('0x7')](e)){var event=events[e];SmsAccount[_0x5e99('0x8')](e,emitEvent(event));}}module[_0x5e99('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0xb1a6=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x25abad,_0x19f0a3){var _0x3f8903=function(_0x439e08){while(--_0x439e08){_0x25abad['push'](_0x25abad['shift']());}};_0x3f8903(++_0x19f0a3);}(_0xb1a6,0x133));var _0x6b1a=function(_0x40ee05,_0x144082){_0x40ee05=_0x40ee05-0x0;var _0x2f0409=_0xb1a6[_0x40ee05];return _0x2f0409;};'use strict';var EventEmitter=require(_0x6b1a('0x0'));var SmsAccount=require(_0x6b1a('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6b1a('0x2')](0x0);var events={'afterCreate':_0x6b1a('0x3'),'afterUpdate':_0x6b1a('0x4'),'afterDestroy':_0x6b1a('0x5')};function emitEvent(_0x454c96){return function(_0x148ead,_0x2271b6,_0x56361b){SmsAccountEvents[_0x6b1a('0x6')](_0x454c96+':'+_0x148ead['id'],_0x148ead);SmsAccountEvents[_0x6b1a('0x6')](_0x454c96,_0x148ead);_0x56361b(null);};}for(var e in events){if(events[_0x6b1a('0x7')](e)){var event=events[e];SmsAccount[_0x6b1a('0x8')](e,emitEvent(event));}}module[_0x6b1a('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 4975c45..eb57ee4 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 _0x5052=['rimraf','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x381796,_0x4eb447){var _0xa3964=function(_0x408f86){while(--_0x408f86){_0x381796['push'](_0x381796['shift']());}};_0xa3964(++_0x4eb447);}(_0x5052,0x13e));var _0x2505=function(_0xf7831f,_0x1c6188){_0xf7831f=_0xf7831f-0x0;var _0x3f88e7=_0x5052[_0xf7831f];return _0x3f88e7;};'use strict';var _=require(_0x2505('0x0'));var util=require('util');var logger=require(_0x2505('0x1'))(_0x2505('0x2'));var moment=require(_0x2505('0x3'));var BPromise=require('bluebird');var rp=require(_0x2505('0x4'));var fs=require('fs');var path=require(_0x2505('0x5'));var rimraf=require(_0x2505('0x6'));var config=require('../../config/environment');var attributes=require(_0x2505('0x7'));module[_0x2505('0x8')]=function(_0x2402e6,_0x3db8ad){return _0x2402e6[_0x2505('0x9')](_0x2505('0xa'),attributes,{'tableName':_0x2505('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1c7=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount'];(function(_0x5b9848,_0x2cf437){var _0x5e099d=function(_0xf156da){while(--_0xf156da){_0x5b9848['push'](_0x5b9848['shift']());}};_0x5e099d(++_0x2cf437);}(_0xc1c7,0x1e0));var _0x7c1c=function(_0x563e3d,_0x45df82){_0x563e3d=_0x563e3d-0x0;var _0x181bf3=_0xc1c7[_0x563e3d];return _0x181bf3;};'use strict';var _=require('lodash');var util=require(_0x7c1c('0x0'));var logger=require(_0x7c1c('0x1'))(_0x7c1c('0x2'));var moment=require(_0x7c1c('0x3'));var BPromise=require(_0x7c1c('0x4'));var rp=require(_0x7c1c('0x5'));var fs=require('fs');var path=require(_0x7c1c('0x6'));var rimraf=require(_0x7c1c('0x7'));var config=require(_0x7c1c('0x8'));var attributes=require(_0x7c1c('0x9'));module[_0x7c1c('0xa')]=function(_0x35d54d,_0x46c8a9){return _0x35d54d['define'](_0x7c1c('0xb'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 65202fd..6e6b0f5 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 _0xf190=['redis','localhost','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','SmsAccount','options','raw','attributes','include','map','model','ShowSmsAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x447c82,_0x407de3){var _0x5429aa=function(_0x5b5415){while(--_0x5b5415){_0x447c82['push'](_0x447c82['shift']());}};_0x5429aa(++_0x407de3);}(_0xf190,0x7c));var _0x0f19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf190[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0f19('0x0'));var util=require(_0x0f19('0x1'));var moment=require(_0x0f19('0x2'));var BPromise=require(_0x0f19('0x3'));var rs=require(_0x0f19('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f19('0x5'))['db'];var utils=require(_0x0f19('0x6'));var logger=require(_0x0f19('0x7'))(_0x0f19('0x8'));var config=require(_0x0f19('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0f19('0xa')][_0x0f19('0xb')]({'port':0x232a});config[_0x0f19('0xc')]=_['defaults'](config[_0x0f19('0xc')],{'host':_0x0f19('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f19('0xc')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x6d8103,_0x4ccfeb,_0x275c25){return new BPromise(function(_0xdeb202,_0x45bc3b){return client[_0x0f19('0xe')](_0x6d8103,_0x275c25)[_0x0f19('0xf')](function(_0x233903){logger[_0x0f19('0x10')](_0x0f19('0x11'),_0x4ccfeb,'request\x20sent');logger[_0x0f19('0x12')](_0x0f19('0x13'),_0x4ccfeb,'request\x20sent',JSON[_0x0f19('0x14')](_0x233903));if(_0x233903['error']){if(_0x233903[_0x0f19('0x15')]['code']===0x1f4){logger[_0x0f19('0x15')]('SmsAccount,\x20%s,\x20%s',_0x4ccfeb,_0x233903[_0x0f19('0x15')][_0x0f19('0x16')]);return _0x45bc3b(_0x233903['error']['message']);}logger[_0x0f19('0x15')](_0x0f19('0x11'),_0x4ccfeb,_0x233903['error']['message']);return _0xdeb202(_0x233903[_0x0f19('0x15')]['message']);}else{logger[_0x0f19('0x10')](_0x0f19('0x11'),_0x4ccfeb,_0x0f19('0x17'));_0xdeb202(_0x233903[_0x0f19('0x18')][_0x0f19('0x16')]);}})[_0x0f19('0x19')](function(_0x26a11d){logger[_0x0f19('0x15')]('SmsAccount,\x20%s,\x20%s',_0x4ccfeb,_0x26a11d);_0x45bc3b(_0x26a11d);});});}exports['ShowSmsAccount']=function(_0x469005){var _0x3b101f=this;return new Promise(function(_0x6ef4d,_0x5e3338){return db[_0x0f19('0x1a')]['find']({'raw':_0x469005[_0x0f19('0x1b')]?_0x469005[_0x0f19('0x1b')][_0x0f19('0x1c')]===undefined?!![]:![]:!![],'where':_0x469005[_0x0f19('0x1b')]?_0x469005[_0x0f19('0x1b')]['where']||null:null,'attributes':_0x469005['options']?_0x469005['options'][_0x0f19('0x1d')]||null:null,'include':_0x469005[_0x0f19('0x1b')]?_0x469005[_0x0f19('0x1b')][_0x0f19('0x1e')]?_[_0x0f19('0x1f')](_0x469005[_0x0f19('0x1b')]['include'],function(_0x5b3f2d){return{'model':db[_0x5b3f2d['model']],'as':_0x5b3f2d['as'],'attributes':_0x5b3f2d[_0x0f19('0x1d')],'include':_0x5b3f2d[_0x0f19('0x1e')]?_[_0x0f19('0x1f')](_0x5b3f2d[_0x0f19('0x1e')],function(_0x1cfd48){return{'model':db[_0x1cfd48[_0x0f19('0x20')]],'as':_0x1cfd48['as'],'attributes':_0x1cfd48[_0x0f19('0x1d')],'include':_0x1cfd48[_0x0f19('0x1e')]?_[_0x0f19('0x1f')](_0x1cfd48[_0x0f19('0x1e')],function(_0x4427f2){return{'model':db[_0x4427f2[_0x0f19('0x20')]],'as':_0x4427f2['as'],'attributes':_0x4427f2[_0x0f19('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x6cd3ce){logger['info'](_0x0f19('0x21'),_0x469005);logger[_0x0f19('0x12')](_0x0f19('0x21'),_0x469005,JSON[_0x0f19('0x14')](_0x6cd3ce));_0x6ef4d(_0x6cd3ce);})['catch'](function(_0x1ec392){logger['error']('ShowSmsAccount',_0x1ec392[_0x0f19('0x16')],_0x469005);_0x5e3338(_0x3b101f['error'](0x1f4,_0x1ec392[_0x0f19('0x16')]));});});}; \ No newline at end of file +var _0xcdb6=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','http','localhost','socket.io-emitter','redis','./smsAccount.socket','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','SmsAccount','options','raw','attributes','include','model','map','ShowSmsAccount','stringify','catch','lodash','util'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xcdb6,0x1a2));var _0x6cdb=function(_0x5c73bc,_0x17b99c){_0x5c73bc=_0x5c73bc-0x0;var _0x2460fb=_0xcdb6[_0x5c73bc];return _0x2460fb;};'use strict';var _=require(_0x6cdb('0x0'));var util=require(_0x6cdb('0x1'));var moment=require(_0x6cdb('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cdb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6cdb('0x4'))['db'];var utils=require(_0x6cdb('0x5'));var logger=require(_0x6cdb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6cdb('0x7')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6cdb('0x8'),'port':0x18eb});var socket=require(_0x6cdb('0x9'))(new Redis(config[_0x6cdb('0xa')]));require(_0x6cdb('0xb'))['register'](socket);function respondWithRpcPromise(_0x583667,_0xc463c3,_0x3f922a){return new BPromise(function(_0x1870e0,_0x14aac7){return client['request'](_0x583667,_0x3f922a)[_0x6cdb('0xc')](function(_0x5abaa5){logger[_0x6cdb('0xd')](_0x6cdb('0xe'),_0xc463c3,_0x6cdb('0xf'));logger[_0x6cdb('0x10')](_0x6cdb('0x11'),_0xc463c3,_0x6cdb('0xf'),JSON['stringify'](_0x5abaa5));if(_0x5abaa5[_0x6cdb('0x12')]){if(_0x5abaa5[_0x6cdb('0x12')]['code']===0x1f4){logger[_0x6cdb('0x12')](_0x6cdb('0xe'),_0xc463c3,_0x5abaa5[_0x6cdb('0x12')][_0x6cdb('0x13')]);return _0x14aac7(_0x5abaa5[_0x6cdb('0x12')][_0x6cdb('0x13')]);}logger[_0x6cdb('0x12')](_0x6cdb('0xe'),_0xc463c3,_0x5abaa5[_0x6cdb('0x12')]['message']);return _0x1870e0(_0x5abaa5[_0x6cdb('0x12')]['message']);}else{logger[_0x6cdb('0xd')]('SmsAccount,\x20%s,\x20%s',_0xc463c3,_0x6cdb('0xf'));_0x1870e0(_0x5abaa5['result'][_0x6cdb('0x13')]);}})['catch'](function(_0x52ae5c){logger[_0x6cdb('0x12')](_0x6cdb('0xe'),_0xc463c3,_0x52ae5c);_0x14aac7(_0x52ae5c);});});}exports['ShowSmsAccount']=function(_0x2ddb9b){var _0x13e4ce=this;return new Promise(function(_0x3bccd7,_0x30cd59){return db[_0x6cdb('0x14')]['find']({'raw':_0x2ddb9b['options']?_0x2ddb9b[_0x6cdb('0x15')][_0x6cdb('0x16')]===undefined?!![]:![]:!![],'where':_0x2ddb9b[_0x6cdb('0x15')]?_0x2ddb9b[_0x6cdb('0x15')]['where']||null:null,'attributes':_0x2ddb9b['options']?_0x2ddb9b['options'][_0x6cdb('0x17')]||null:null,'include':_0x2ddb9b[_0x6cdb('0x15')]?_0x2ddb9b['options'][_0x6cdb('0x18')]?_['map'](_0x2ddb9b[_0x6cdb('0x15')][_0x6cdb('0x18')],function(_0x46ac91){return{'model':db[_0x46ac91[_0x6cdb('0x19')]],'as':_0x46ac91['as'],'attributes':_0x46ac91[_0x6cdb('0x17')],'include':_0x46ac91[_0x6cdb('0x18')]?_[_0x6cdb('0x1a')](_0x46ac91[_0x6cdb('0x18')],function(_0x500cde){return{'model':db[_0x500cde[_0x6cdb('0x19')]],'as':_0x500cde['as'],'attributes':_0x500cde[_0x6cdb('0x17')],'include':_0x500cde[_0x6cdb('0x18')]?_[_0x6cdb('0x1a')](_0x500cde['include'],function(_0x102029){return{'model':db[_0x102029[_0x6cdb('0x19')]],'as':_0x102029['as'],'attributes':_0x102029['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xb0a051){logger[_0x6cdb('0xd')](_0x6cdb('0x1b'),_0x2ddb9b);logger['debug'](_0x6cdb('0x1b'),_0x2ddb9b,JSON[_0x6cdb('0x1c')](_0xb0a051));_0x3bccd7(_0xb0a051);})[_0x6cdb('0x1d')](function(_0x426bea){logger[_0x6cdb('0x12')](_0x6cdb('0x1b'),_0x426bea[_0x6cdb('0x13')],_0x2ddb9b);_0x30cd59(_0x13e4ce[_0x6cdb('0x12')](0x1f4,_0x426bea['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index e4cd7a9..53017c3 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 1ffb0dd..5e609a3 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x29b254,_0xe2045b){var _0x3f62af=function(_0x2a2336){while(--_0x2a2336){_0x29b254['push'](_0x29b254['shift']());}};_0x3f62af(++_0xe2045b);}(_0x7217,0x19e));var _0x7721=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x7217[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index e5931af..5373bc7 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 _0xd5fe=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x401af5,_0x35d733){var _0x1d888d=function(_0x3247e5){while(--_0x3247e5){_0x401af5['push'](_0x401af5['shift']());}};_0x1d888d(++_0x35d733);}(_0xd5fe,0xd2));var _0xed5f=function(_0x31abee,_0x11ff0c){_0x31abee=_0x31abee-0x0;var _0x3c1761=_0xd5fe[_0x31abee];return _0x3c1761;};'use strict';var Sequelize=require(_0xed5f('0x0'));module['exports']={'priority':{'type':Sequelize[_0xed5f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xed5f('0x2')],'allowNull':![],'defaultValue':_0xed5f('0x3')},'appdata':{'type':Sequelize[_0xed5f('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xed5f('0x2')],'defaultValue':_0xed5f('0x5')}}; \ No newline at end of file +var _0xe3e2=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3e2,0x7c));var _0x2e3e=function(_0x29c64f,_0xb45117){_0x29c64f=_0x29c64f-0x0;var _0x51a272=_0xe3e2[_0x29c64f];return _0x51a272;};'use strict';var Sequelize=require(_0x2e3e('0x0'));module[_0x2e3e('0x1')]={'priority':{'type':Sequelize[_0x2e3e('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2e3e('0x3')},'appdata':{'type':Sequelize[_0x2e3e('0x4')]()},'description':{'type':Sequelize[_0x2e3e('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2e3e('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 148bf41..1e9ea5a 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 _0x63be=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','map','SmsApplication','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x41565d,_0x5c0278){var _0x4292ae=function(_0x29fdba){while(--_0x29fdba){_0x41565d['push'](_0x41565d['shift']());}};_0x4292ae(++_0x5c0278);}(_0x63be,0x111));var _0xe63b=function(_0x1a8895,_0x4b4a34){_0x1a8895=_0x1a8895-0x0;var _0xd266ea=_0x63be[_0x1a8895];return _0xd266ea;};'use strict';var emlformat=require(_0xe63b('0x0'));var rimraf=require(_0xe63b('0x1'));var zipdir=require(_0xe63b('0x2'));var jsonpatch=require(_0xe63b('0x3'));var rp=require('request-promise');var moment=require(_0xe63b('0x4'));var BPromise=require(_0xe63b('0x5'));var Mustache=require(_0xe63b('0x6'));var util=require(_0xe63b('0x7'));var path=require(_0xe63b('0x8'));var sox=require(_0xe63b('0x9'));var csv=require(_0xe63b('0xa'));var ejs=require(_0xe63b('0xb'));var fs=require('fs');var fs_extra=require(_0xe63b('0xc'));var _=require(_0xe63b('0xd'));var squel=require('squel');var crypto=require(_0xe63b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe63b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe63b('0x10'));var Papa=require(_0xe63b('0x11'));var Redis=require(_0xe63b('0x12'));var authService=require(_0xe63b('0x13'));var qs=require(_0xe63b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe63b('0x15'));var logger=require(_0xe63b('0x16'))(_0xe63b('0x17'));var utils=require(_0xe63b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe63b('0x19'));var db=require(_0xe63b('0x1a'))['db'];function respondWithStatusCode(_0x1119dc,_0x586d9a){_0x586d9a=_0x586d9a||0xcc;return function(_0x524d3a){if(_0x524d3a){return _0x1119dc[_0xe63b('0x1b')](_0x586d9a);}return _0x1119dc[_0xe63b('0x1c')](_0x586d9a)[_0xe63b('0x1d')]();};}function respondWithResult(_0x114230,_0x4c6fd5){_0x4c6fd5=_0x4c6fd5||0xc8;return function(_0x2c0eef){if(_0x2c0eef){return _0x114230['status'](_0x4c6fd5)[_0xe63b('0x1e')](_0x2c0eef);}};}function respondWithFilteredResult(_0x5f3f5a,_0x22d008){return function(_0x515fd7){if(_0x515fd7){var _0x52e2a8=typeof _0x22d008[_0xe63b('0x1f')]==='undefined'&&typeof _0x22d008[_0xe63b('0x20')]==='undefined';var _0xf6cdd2=_0x515fd7[_0xe63b('0x21')];var _0x1693ae=_0x52e2a8?0x0:_0x22d008['offset'];var _0x4123bb=_0x52e2a8?_0x515fd7[_0xe63b('0x21')]:_0x22d008[_0xe63b('0x1f')]+_0x22d008[_0xe63b('0x20')];var _0x4cf82a;if(_0x4123bb>=_0xf6cdd2){_0x4123bb=_0xf6cdd2;_0x4cf82a=0xc8;}else{_0x4cf82a=0xce;}_0x5f3f5a[_0xe63b('0x1c')](_0x4cf82a);return _0x5f3f5a[_0xe63b('0x22')](_0xe63b('0x23'),_0x1693ae+'-'+_0x4123bb+'/'+_0xf6cdd2)[_0xe63b('0x1e')](_0x515fd7);}return null;};}function patchUpdates(_0x55d188){return function(_0x5eac27){try{jsonpatch['apply'](_0x5eac27,_0x55d188,!![]);}catch(_0x2adb94){return BPromise[_0xe63b('0x24')](_0x2adb94);}return _0x5eac27[_0xe63b('0x25')]();};}function saveUpdates(_0x4a02ac,_0x5549bc){return function(_0x55ea00){if(_0x55ea00){return _0x55ea00[_0xe63b('0x26')](_0x4a02ac)[_0xe63b('0x27')](function(_0x6076e9){return _0x6076e9;});}return null;};}function removeEntity(_0x4cc143,_0x16c579){return function(_0x24165a){if(_0x24165a){return _0x24165a[_0xe63b('0x28')]()[_0xe63b('0x27')](function(){_0x4cc143[_0xe63b('0x1c')](0xcc)[_0xe63b('0x1d')]();});}};}function handleEntityNotFound(_0x45108d,_0xe08a66){return function(_0x18d7df){if(!_0x18d7df){_0x45108d['sendStatus'](0x194);}return _0x18d7df;};}function handleError(_0x5dfad1,_0x2fb472){_0x2fb472=_0x2fb472||0x1f4;return function(_0x5e1c3e){logger['error'](_0x5e1c3e[_0xe63b('0x29')]);if(_0x5e1c3e[_0xe63b('0x2a')]){delete _0x5e1c3e['name'];}_0x5dfad1[_0xe63b('0x1c')](_0x2fb472)[_0xe63b('0x2b')](_0x5e1c3e);};}exports['index']=function(_0x465195,_0x3764b8){var _0x28c675={},_0x401311={},_0x5418af={'count':0x0,'rows':[]};var _0x1c07da=_[_0xe63b('0x2c')](db[_0xe63b('0x2d')][_0xe63b('0x2e')],function(_0x462bcd){return{'name':_0x462bcd[_0xe63b('0x2f')],'type':_0x462bcd[_0xe63b('0x30')][_0xe63b('0x31')]};});_0x401311['model']=_['map'](_0x1c07da,_0xe63b('0x2a'));_0x401311['query']=_['keys'](_0x465195[_0xe63b('0x32')]);_0x401311[_0xe63b('0x33')]=_[_0xe63b('0x34')](_0x401311[_0xe63b('0x35')],_0x401311[_0xe63b('0x32')]);_0x28c675['attributes']=_[_0xe63b('0x34')](_0x401311[_0xe63b('0x35')],qs[_0xe63b('0x36')](_0x465195['query']['fields']));_0x28c675[_0xe63b('0x37')]=_0x28c675[_0xe63b('0x37')]['length']?_0x28c675[_0xe63b('0x37')]:_0x401311[_0xe63b('0x35')];if(!_0x465195[_0xe63b('0x32')]['hasOwnProperty']('nolimit')){_0x28c675[_0xe63b('0x20')]=qs[_0xe63b('0x20')](_0x465195['query'][_0xe63b('0x20')]);_0x28c675['offset']=qs[_0xe63b('0x1f')](_0x465195[_0xe63b('0x32')][_0xe63b('0x1f')]);}_0x28c675[_0xe63b('0x38')]=qs[_0xe63b('0x39')](_0x465195[_0xe63b('0x32')]['sort']);_0x28c675[_0xe63b('0x3a')]=qs[_0xe63b('0x33')](_[_0xe63b('0x3b')](_0x465195[_0xe63b('0x32')],_0x401311[_0xe63b('0x33')]),_0x1c07da);if(_0x465195[_0xe63b('0x32')][_0xe63b('0x3c')]){_0x28c675['where']=_[_0xe63b('0x3d')](_0x28c675[_0xe63b('0x3a')],{'$or':_[_0xe63b('0x2c')](_0x1c07da,function(_0x20fbc5){if(_0x20fbc5[_0xe63b('0x30')]!==_0xe63b('0x3e')){var _0x4bca84={};_0x4bca84[_0x20fbc5[_0xe63b('0x2a')]]={'$like':'%'+_0x465195['query'][_0xe63b('0x3c')]+'%'};return _0x4bca84;}})});}_0x28c675=_[_0xe63b('0x3d')]({},_0x28c675,_0x465195[_0xe63b('0x3f')]);var _0x390351={'where':_0x28c675['where']};return db[_0xe63b('0x2d')][_0xe63b('0x21')](_0x390351)[_0xe63b('0x27')](function(_0x1329d9){_0x5418af[_0xe63b('0x21')]=_0x1329d9;if(_0x465195[_0xe63b('0x32')][_0xe63b('0x40')]){_0x28c675[_0xe63b('0x41')]=[{'all':!![]}];}return db['SmsApplication'][_0xe63b('0x42')](_0x28c675);})[_0xe63b('0x27')](function(_0x5c87a0){_0x5418af['rows']=_0x5c87a0;return _0x5418af;})['then'](respondWithFilteredResult(_0x3764b8,_0x28c675))[_0xe63b('0x43')](handleError(_0x3764b8,null));};exports[_0xe63b('0x44')]=function(_0x507e53,_0x2bdf9c){var _0x27398a={'raw':!![],'where':{'id':_0x507e53['params']['id']}},_0x25f446={};_0x25f446[_0xe63b('0x35')]=_['keys'](db['SmsApplication'][_0xe63b('0x2e')]);_0x25f446[_0xe63b('0x32')]=_['keys'](_0x507e53[_0xe63b('0x32')]);_0x25f446[_0xe63b('0x33')]=_[_0xe63b('0x34')](_0x25f446[_0xe63b('0x35')],_0x25f446[_0xe63b('0x32')]);_0x27398a[_0xe63b('0x37')]=_['intersection'](_0x25f446[_0xe63b('0x35')],qs[_0xe63b('0x36')](_0x507e53[_0xe63b('0x32')][_0xe63b('0x36')]));_0x27398a[_0xe63b('0x37')]=_0x27398a['attributes'][_0xe63b('0x45')]?_0x27398a[_0xe63b('0x37')]:_0x25f446[_0xe63b('0x35')];if(_0x507e53[_0xe63b('0x32')][_0xe63b('0x40')]){_0x27398a[_0xe63b('0x41')]=[{'all':!![]}];}_0x27398a=_[_0xe63b('0x3d')]({},_0x27398a,_0x507e53['options']);return db[_0xe63b('0x2d')][_0xe63b('0x46')](_0x27398a)[_0xe63b('0x27')](handleEntityNotFound(_0x2bdf9c,null))[_0xe63b('0x27')](respondWithResult(_0x2bdf9c,null))[_0xe63b('0x43')](handleError(_0x2bdf9c,null));};exports['create']=function(_0x281106,_0x515d21){return db['SmsApplication'][_0xe63b('0x47')](_0x281106[_0xe63b('0x48')],{})['then'](respondWithResult(_0x515d21,0xc9))[_0xe63b('0x43')](handleError(_0x515d21,null));};exports[_0xe63b('0x26')]=function(_0x1ee731,_0x164ac4){if(_0x1ee731[_0xe63b('0x48')]['id']){delete _0x1ee731[_0xe63b('0x48')]['id'];}return db[_0xe63b('0x2d')][_0xe63b('0x46')]({'where':{'id':_0x1ee731['params']['id']}})[_0xe63b('0x27')](handleEntityNotFound(_0x164ac4,null))[_0xe63b('0x27')](saveUpdates(_0x1ee731[_0xe63b('0x48')],null))[_0xe63b('0x27')](respondWithResult(_0x164ac4,null))[_0xe63b('0x43')](handleError(_0x164ac4,null));};exports[_0xe63b('0x28')]=function(_0xd9e57b,_0x3d9661){return db['SmsApplication']['find']({'where':{'id':_0xd9e57b[_0xe63b('0x49')]['id']}})['then'](handleEntityNotFound(_0x3d9661,null))['then'](removeEntity(_0x3d9661,null))[_0xe63b('0x43')](handleError(_0x3d9661,null));}; \ No newline at end of file +var _0xb473=['offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','where','type','VIRTUAL','options','SmsApplication','include','findAll','rows','show','includeAll','find','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x1ae7bf,_0x4eb1b0){var _0x32c596=function(_0x3da760){while(--_0x3da760){_0x1ae7bf['push'](_0x1ae7bf['shift']());}};_0x32c596(++_0x4eb1b0);}(_0xb473,0x108));var _0x3b47=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xb473[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require(_0x3b47('0x0'));var rimraf=require(_0x3b47('0x1'));var zipdir=require(_0x3b47('0x2'));var jsonpatch=require(_0x3b47('0x3'));var rp=require(_0x3b47('0x4'));var moment=require(_0x3b47('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3b47('0x6'));var csv=require(_0x3b47('0x7'));var ejs=require(_0x3b47('0x8'));var fs=require('fs');var fs_extra=require(_0x3b47('0x9'));var _=require(_0x3b47('0xa'));var squel=require(_0x3b47('0xb'));var crypto=require(_0x3b47('0xc'));var jsforce=require(_0x3b47('0xd'));var deskjs=require(_0x3b47('0xe'));var toCsv=require(_0x3b47('0x7'));var querystring=require(_0x3b47('0xf'));var Papa=require(_0x3b47('0x10'));var Redis=require(_0x3b47('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3b47('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b47('0x13'))(_0x3b47('0x14'));var utils=require(_0x3b47('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3b47('0x16'));var db=require(_0x3b47('0x17'))['db'];function respondWithStatusCode(_0x3ee42b,_0x22d3f0){_0x22d3f0=_0x22d3f0||0xcc;return function(_0x2f55e8){if(_0x2f55e8){return _0x3ee42b[_0x3b47('0x18')](_0x22d3f0);}return _0x3ee42b['status'](_0x22d3f0)[_0x3b47('0x19')]();};}function respondWithResult(_0x2bf6f5,_0xc36469){_0xc36469=_0xc36469||0xc8;return function(_0x468d19){if(_0x468d19){return _0x2bf6f5[_0x3b47('0x1a')](_0xc36469)[_0x3b47('0x1b')](_0x468d19);}};}function respondWithFilteredResult(_0x1987c3,_0x1e78c9){return function(_0x4a2b70){if(_0x4a2b70){var _0x190536=typeof _0x1e78c9[_0x3b47('0x1c')]===_0x3b47('0x1d')&&typeof _0x1e78c9[_0x3b47('0x1e')]===_0x3b47('0x1d');var _0x2882df=_0x4a2b70[_0x3b47('0x1f')];var _0x116a06=_0x190536?0x0:_0x1e78c9[_0x3b47('0x1c')];var _0x254450=_0x190536?_0x4a2b70[_0x3b47('0x1f')]:_0x1e78c9[_0x3b47('0x1c')]+_0x1e78c9[_0x3b47('0x1e')];var _0x10d2e7;if(_0x254450>=_0x2882df){_0x254450=_0x2882df;_0x10d2e7=0xc8;}else{_0x10d2e7=0xce;}_0x1987c3[_0x3b47('0x1a')](_0x10d2e7);return _0x1987c3[_0x3b47('0x20')](_0x3b47('0x21'),_0x116a06+'-'+_0x254450+'/'+_0x2882df)[_0x3b47('0x1b')](_0x4a2b70);}return null;};}function patchUpdates(_0x5bc476){return function(_0x5e6976){try{jsonpatch['apply'](_0x5e6976,_0x5bc476,!![]);}catch(_0x4c9673){return BPromise[_0x3b47('0x22')](_0x4c9673);}return _0x5e6976[_0x3b47('0x23')]();};}function saveUpdates(_0x381fb0,_0x1860a9){return function(_0x401185){if(_0x401185){return _0x401185[_0x3b47('0x24')](_0x381fb0)[_0x3b47('0x25')](function(_0x1e2be9){return _0x1e2be9;});}return null;};}function removeEntity(_0x89f6ff,_0x12237e){return function(_0x3514bf){if(_0x3514bf){return _0x3514bf['destroy']()[_0x3b47('0x25')](function(){_0x89f6ff[_0x3b47('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32605f,_0x22ffe1){return function(_0x290081){if(!_0x290081){_0x32605f[_0x3b47('0x18')](0x194);}return _0x290081;};}function handleError(_0x27855b,_0x3fb679){_0x3fb679=_0x3fb679||0x1f4;return function(_0x5a22a9){logger['error'](_0x5a22a9[_0x3b47('0x26')]);if(_0x5a22a9[_0x3b47('0x27')]){delete _0x5a22a9[_0x3b47('0x27')];}_0x27855b[_0x3b47('0x1a')](_0x3fb679)[_0x3b47('0x28')](_0x5a22a9);};}exports[_0x3b47('0x29')]=function(_0x632d8b,_0x1cadff){var _0x2df0b9={},_0x1ece02={},_0x2d396d={'count':0x0,'rows':[]};var _0x31959f=_[_0x3b47('0x2a')](db['SmsApplication'][_0x3b47('0x2b')],function(_0x2e9c51){return{'name':_0x2e9c51[_0x3b47('0x2c')],'type':_0x2e9c51['type'][_0x3b47('0x2d')]};});_0x1ece02[_0x3b47('0x2e')]=_[_0x3b47('0x2a')](_0x31959f,_0x3b47('0x27'));_0x1ece02['query']=_[_0x3b47('0x2f')](_0x632d8b['query']);_0x1ece02[_0x3b47('0x30')]=_[_0x3b47('0x31')](_0x1ece02[_0x3b47('0x2e')],_0x1ece02[_0x3b47('0x32')]);_0x2df0b9[_0x3b47('0x33')]=_[_0x3b47('0x31')](_0x1ece02[_0x3b47('0x2e')],qs[_0x3b47('0x34')](_0x632d8b[_0x3b47('0x32')]['fields']));_0x2df0b9[_0x3b47('0x33')]=_0x2df0b9[_0x3b47('0x33')][_0x3b47('0x35')]?_0x2df0b9[_0x3b47('0x33')]:_0x1ece02[_0x3b47('0x2e')];if(!_0x632d8b['query'][_0x3b47('0x36')]('nolimit')){_0x2df0b9['limit']=qs[_0x3b47('0x1e')](_0x632d8b[_0x3b47('0x32')][_0x3b47('0x1e')]);_0x2df0b9[_0x3b47('0x1c')]=qs['offset'](_0x632d8b[_0x3b47('0x32')]['offset']);}_0x2df0b9[_0x3b47('0x37')]=qs[_0x3b47('0x38')](_0x632d8b[_0x3b47('0x32')]['sort']);_0x2df0b9['where']=qs['filters'](_[_0x3b47('0x39')](_0x632d8b[_0x3b47('0x32')],_0x1ece02[_0x3b47('0x30')]),_0x31959f);if(_0x632d8b['query']['filter']){_0x2df0b9['where']=_[_0x3b47('0x3a')](_0x2df0b9[_0x3b47('0x3b')],{'$or':_['map'](_0x31959f,function(_0x468e1d){if(_0x468e1d[_0x3b47('0x3c')]!==_0x3b47('0x3d')){var _0xf391b={};_0xf391b[_0x468e1d[_0x3b47('0x27')]]={'$like':'%'+_0x632d8b[_0x3b47('0x32')]['filter']+'%'};return _0xf391b;}})});}_0x2df0b9=_[_0x3b47('0x3a')]({},_0x2df0b9,_0x632d8b[_0x3b47('0x3e')]);var _0x546911={'where':_0x2df0b9[_0x3b47('0x3b')]};return db[_0x3b47('0x3f')][_0x3b47('0x1f')](_0x546911)[_0x3b47('0x25')](function(_0x322a99){_0x2d396d[_0x3b47('0x1f')]=_0x322a99;if(_0x632d8b[_0x3b47('0x32')]['includeAll']){_0x2df0b9[_0x3b47('0x40')]=[{'all':!![]}];}return db[_0x3b47('0x3f')][_0x3b47('0x41')](_0x2df0b9);})['then'](function(_0x22f7e9){_0x2d396d[_0x3b47('0x42')]=_0x22f7e9;return _0x2d396d;})['then'](respondWithFilteredResult(_0x1cadff,_0x2df0b9))['catch'](handleError(_0x1cadff,null));};exports[_0x3b47('0x43')]=function(_0x1aa32c,_0x1eb645){var _0x50f212={'raw':!![],'where':{'id':_0x1aa32c['params']['id']}},_0x4a9513={};_0x4a9513['model']=_['keys'](db[_0x3b47('0x3f')][_0x3b47('0x2b')]);_0x4a9513['query']=_['keys'](_0x1aa32c[_0x3b47('0x32')]);_0x4a9513['filters']=_[_0x3b47('0x31')](_0x4a9513[_0x3b47('0x2e')],_0x4a9513[_0x3b47('0x32')]);_0x50f212[_0x3b47('0x33')]=_[_0x3b47('0x31')](_0x4a9513[_0x3b47('0x2e')],qs[_0x3b47('0x34')](_0x1aa32c[_0x3b47('0x32')][_0x3b47('0x34')]));_0x50f212[_0x3b47('0x33')]=_0x50f212[_0x3b47('0x33')]['length']?_0x50f212['attributes']:_0x4a9513[_0x3b47('0x2e')];if(_0x1aa32c[_0x3b47('0x32')][_0x3b47('0x44')]){_0x50f212[_0x3b47('0x40')]=[{'all':!![]}];}_0x50f212=_[_0x3b47('0x3a')]({},_0x50f212,_0x1aa32c[_0x3b47('0x3e')]);return db[_0x3b47('0x3f')][_0x3b47('0x45')](_0x50f212)[_0x3b47('0x25')](handleEntityNotFound(_0x1eb645,null))['then'](respondWithResult(_0x1eb645,null))['catch'](handleError(_0x1eb645,null));};exports['create']=function(_0x2779cf,_0x1b01c4){return db['SmsApplication']['create'](_0x2779cf[_0x3b47('0x46')],{})['then'](respondWithResult(_0x1b01c4,0xc9))[_0x3b47('0x47')](handleError(_0x1b01c4,null));};exports[_0x3b47('0x24')]=function(_0x307230,_0x228442){if(_0x307230[_0x3b47('0x46')]['id']){delete _0x307230['body']['id'];}return db[_0x3b47('0x3f')][_0x3b47('0x45')]({'where':{'id':_0x307230['params']['id']}})[_0x3b47('0x25')](handleEntityNotFound(_0x228442,null))[_0x3b47('0x25')](saveUpdates(_0x307230['body'],null))[_0x3b47('0x25')](respondWithResult(_0x228442,null))[_0x3b47('0x47')](handleError(_0x228442,null));};exports['destroy']=function(_0x2bc294,_0x2708c0){return db[_0x3b47('0x3f')]['find']({'where':{'id':_0x2bc294[_0x3b47('0x48')]['id']}})[_0x3b47('0x25')](handleEntityNotFound(_0x2708c0,null))[_0x3b47('0x25')](removeEntity(_0x2708c0,null))[_0x3b47('0x47')](handleError(_0x2708c0,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 1f58cc0..0b0976a 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 _0x04c8=['exports','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1db347,_0x50526b){var _0x4ec95f=function(_0x311de3){while(--_0x311de3){_0x1db347['push'](_0x1db347['shift']());}};_0x4ec95f(++_0x50526b);}(_0x04c8,0xe0));var _0x804c=function(_0x3891af,_0x7cc061){_0x3891af=_0x3891af-0x0;var _0x36632e=_0x04c8[_0x3891af];return _0x36632e;};'use strict';var _=require(_0x804c('0x0'));var util=require(_0x804c('0x1'));var logger=require(_0x804c('0x2'))(_0x804c('0x3'));var moment=require(_0x804c('0x4'));var BPromise=require(_0x804c('0x5'));var rp=require(_0x804c('0x6'));var fs=require('fs');var path=require(_0x804c('0x7'));var rimraf=require(_0x804c('0x8'));var config=require(_0x804c('0x9'));var attributes=require('./smsApplication.attributes');module[_0x804c('0xa')]=function(_0x1d7a87,_0x593fc2){return _0x1d7a87[_0x804c('0xb')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x804c('0xc')});}; \ No newline at end of file +var _0x58d0=['lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x461499,_0x2844ce){var _0x505767=function(_0x5e321c){while(--_0x5e321c){_0x461499['push'](_0x461499['shift']());}};_0x505767(++_0x2844ce);}(_0x58d0,0x1a4));var _0x058d=function(_0x54f060,_0x1de751){_0x54f060=_0x54f060-0x0;var _0xb2b587=_0x58d0[_0x54f060];return _0xb2b587;};'use strict';var _=require(_0x058d('0x0'));var util=require(_0x058d('0x1'));var logger=require(_0x058d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x058d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x058d('0x4'));var config=require(_0x058d('0x5'));var attributes=require('./smsApplication.attributes');module[_0x058d('0x6')]=function(_0x2fbae8,_0xf63297){return _0x2fbae8[_0x058d('0x7')](_0x058d('0x8'),attributes,{'tableName':_0x058d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x058d('0xa'),'collate':_0x058d('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 0cdf0bc..c833105 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 _0x7804=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','info','SmsApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch'];(function(_0x4432b5,_0x33a54a){var _0x3ce43f=function(_0x2cc71b){while(--_0x2cc71b){_0x4432b5['push'](_0x4432b5['shift']());}};_0x3ce43f(++_0x33a54a);}(_0x7804,0xc3));var _0x4780=function(_0x360e52,_0xfa644){_0x360e52=_0x360e52-0x0;var _0x16f718=_0x7804[_0x360e52];return _0x16f718;};'use strict';var _=require(_0x4780('0x0'));var util=require('util');var moment=require(_0x4780('0x1'));var BPromise=require(_0x4780('0x2'));var rs=require(_0x4780('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4780('0x4'))['db'];var utils=require(_0x4780('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4780('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4780('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x36df6b,_0x9cd1a1,_0x19356d){return new BPromise(function(_0x5dbc26,_0x2ba140){return client['request'](_0x36df6b,_0x19356d)['then'](function(_0x299992){logger[_0x4780('0x8')](_0x4780('0x9'),_0x9cd1a1,_0x4780('0xa'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x9cd1a1,_0x4780('0xa'),JSON[_0x4780('0xb')](_0x299992));if(_0x299992[_0x4780('0xc')]){if(_0x299992['error']['code']===0x1f4){logger[_0x4780('0xc')](_0x4780('0x9'),_0x9cd1a1,_0x299992[_0x4780('0xc')][_0x4780('0xd')]);return _0x2ba140(_0x299992[_0x4780('0xc')]['message']);}logger['error'](_0x4780('0x9'),_0x9cd1a1,_0x299992['error'][_0x4780('0xd')]);return _0x5dbc26(_0x299992[_0x4780('0xc')][_0x4780('0xd')]);}else{logger[_0x4780('0x8')]('SmsApplication,\x20%s,\x20%s',_0x9cd1a1,_0x4780('0xa'));_0x5dbc26(_0x299992['result'][_0x4780('0xd')]);}})[_0x4780('0xe')](function(_0x522b0f){logger[_0x4780('0xc')]('SmsApplication,\x20%s,\x20%s',_0x9cd1a1,_0x522b0f);_0x2ba140(_0x522b0f);});});} \ No newline at end of file +var _0x7d25=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x4c4e45,_0x4ba716){var _0x3e520e=function(_0x158d6b){while(--_0x158d6b){_0x4c4e45['push'](_0x4c4e45['shift']());}};_0x3e520e(++_0x4ba716);}(_0x7d25,0x8a));var _0x57d2=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7d25[_0x5d6456];return _0x4d66c1;};'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')]('SmsApplication,\x20%s,\x20%s',_0x263d35,_0x57d2('0xd'));_0x59ae87(_0x3a1ec5[_0x57d2('0x12')]['message']);}})[_0x57d2('0x13')](function(_0x4986ad){logger[_0x57d2('0xf')]('SmsApplication,\x20%s,\x20%s',_0x263d35,_0x4986ad);_0x49e3e5(_0x4986ad);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 20127ea..e8f0b48 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 _0x0972=['tracked','sms','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x1dbaae,_0x425d84){var _0x2c12af=function(_0x3240b5){while(--_0x3240b5){_0x1dbaae['push'](_0x1dbaae['shift']());}};_0x2c12af(++_0x425d84);}(_0x0972,0x64));var _0x2097=function(_0x4c6633,_0x13fbee){_0x4c6633=_0x4c6633-0x0;var _0x3b91e8=_0x0972[_0x4c6633];return _0x3b91e8;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/describe',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['show']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0x7')](_0x2097('0xe'),auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0x10')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x11')]);router[_0x2097('0x10')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0x12')]);router[_0x2097('0x10')](_0x2097('0x13'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')](_0x2097('0x15'),'smsinteraction:addtags'),controller[_0x2097('0x16')]);router[_0x2097('0x17')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x2097('0x15'),'smsinteraction:update'),controller[_0x2097('0x18')]);router[_0x2097('0x19')](_0x2097('0xb'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')]('sms',_0x2097('0x1a')),controller[_0x2097('0x1b')]);router[_0x2097('0x19')](_0x2097('0x13'),auth[_0x2097('0x8')](),controller[_0x2097('0x1c')]);module[_0x2097('0x1d')]=router; \ No newline at end of file +var _0x2547=['/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3d6602,_0x305521){var _0x1c9f41=function(_0x5ae15a){while(--_0x5ae15a){_0x3d6602['push'](_0x3d6602['shift']());}};_0x1c9f41(++_0x305521);}(_0x2547,0x1cd));var _0x7254=function(_0xfe7e96,_0x56d881){_0xfe7e96=_0xfe7e96-0x0;var _0x4c2dd5=_0x2547[_0xfe7e96];return _0x4c2dd5;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x9')](_0x7254('0x11'),auth[_0x7254('0xa')](),controller['download']);router[_0x7254('0x12')]('/',auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['post'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x12')](_0x7254('0x15'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')](_0x7254('0x17'),_0x7254('0x18')),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction['tracked'](_0x7254('0x17'),_0x7254('0x1b')),controller[_0x7254('0x1c')]);router[_0x7254('0x1d')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')]('sms',_0x7254('0x1e')),controller[_0x7254('0x1f')]);router[_0x7254('0x1d')](_0x7254('0x15'),auth[_0x7254('0xa')](),controller[_0x7254('0x20')]);module[_0x7254('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index a6f3c98..e9a422a 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 _0x5294=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x5294,0x111));var _0x4529=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x5294[_0x42245d];return _0x4b211a;};'use strict';var Sequelize=require(_0x4529('0x0'));var moment=require(_0x4529('0x1'));module[_0x4529('0x2')]={'closed':{'type':Sequelize[_0x4529('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4529('0x4')]},'disposition':{'type':Sequelize[_0x4529('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4529('0x5')]},'note':{'type':Sequelize[_0x4529('0x5')]},'phone':{'type':Sequelize[_0x4529('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x4529('0x6')]('in',_0x4529('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4529('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x4529('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4529('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xdb70=['sequelize','moment','exports','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x310a54,_0x212d9a){var _0x4e4caa=function(_0x6baec9){while(--_0x6baec9){_0x310a54['push'](_0x310a54['shift']());}};_0x4e4caa(++_0x212d9a);}(_0xdb70,0xa0));var _0x0db7=function(_0x2c345e,_0x468c57){_0x2c345e=_0x2c345e-0x0;var _0x5460b6=_0xdb70[_0x2c345e];return _0x5460b6;};'use strict';var Sequelize=require(_0x0db7('0x0'));var moment=require(_0x0db7('0x1'));module[_0x0db7('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0db7('0x3')]},'disposition':{'type':Sequelize[_0x0db7('0x4')]},'secondDisposition':{'type':Sequelize[_0x0db7('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0db7('0x4')]},'note':{'type':Sequelize[_0x0db7('0x4')]},'phone':{'type':Sequelize[_0x0db7('0x4')]},'read1stAt':{'type':Sequelize[_0x0db7('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0db7('0x5')]('in',_0x0db7('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0db7('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0db7('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0db7('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 304c985..5fb8751 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 _0xec22=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','status','end','offset','undefined','limit','count','json','apply','reject','save','then','sendStatus','error','name','send','Users','map','TagIds','forEach','Tags','catch','waiting','answered','unmanaged','total','UserId','closed','talking','index','SmsInteraction','rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','sms_accounts','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','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','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','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','QueryTypes','SELECT','clone','i.id','contactName','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','all','rows','params','keys','includeAll','include','options','create','body','destroy','describe','addMessage','ids','omit','getMessages','findOne','$gte','format','SmsMessage','addTags','setTags','findAll','emit','smsInteractionTags:save','removeTags','download','unix','join','server','files','root','attachments','transcript-%d-%s.zip','fullname','Contact','firstName','lastName','Messages','secret','Account','Sms','Owner','createdAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','direction','out','System','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x17767f,_0x44d9b6){var _0x20bdc4=function(_0x6cb2b){while(--_0x6cb2b){_0x17767f['push'](_0x17767f['shift']());}};_0x20bdc4(++_0x44d9b6);}(_0xec22,0x1b1));var _0x2ec2=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xec22[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0x2ec2('0x0'));var rimraf=require(_0x2ec2('0x1'));var zipdir=require(_0x2ec2('0x2'));var jsonpatch=require(_0x2ec2('0x3'));var rp=require(_0x2ec2('0x4'));var moment=require(_0x2ec2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2ec2('0x6'));var util=require(_0x2ec2('0x7'));var path=require(_0x2ec2('0x8'));var sox=require('sox');var csv=require(_0x2ec2('0x9'));var ejs=require(_0x2ec2('0xa'));var fs=require('fs');var fs_extra=require(_0x2ec2('0xb'));var _=require('lodash');var squel=require(_0x2ec2('0xc'));var crypto=require(_0x2ec2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2ec2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2ec2('0xf'));var Papa=require(_0x2ec2('0x10'));var Redis=require(_0x2ec2('0x11'));var authService=require(_0x2ec2('0x12'));var qs=require(_0x2ec2('0x13'));var as=require(_0x2ec2('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x2ec2('0x15'));var logger=require(_0x2ec2('0x16'))(_0x2ec2('0x17'));var utils=require(_0x2ec2('0x18'));var config=require(_0x2ec2('0x19'));var licenseUtil=require(_0x2ec2('0x1a'));var db=require(_0x2ec2('0x1b'))['db'];config[_0x2ec2('0x1c')]=_[_0x2ec2('0x1d')](config[_0x2ec2('0x1c')],{'host':_0x2ec2('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ec2('0x1c')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4fe1e2,_0x442ca9){_0x442ca9=_0x442ca9||0xcc;return function(_0x10094a){if(_0x10094a){return _0x4fe1e2['sendStatus'](_0x442ca9);}return _0x4fe1e2[_0x2ec2('0x1f')](_0x442ca9)[_0x2ec2('0x20')]();};}function respondWithResult(_0x4563a6,_0x49f55c){_0x49f55c=_0x49f55c||0xc8;return function(_0x167f00){if(_0x167f00){return _0x4563a6[_0x2ec2('0x1f')](_0x49f55c)['json'](_0x167f00);}};}function respondWithFilteredResult(_0x510f7c,_0x39bc43){return function(_0x5cd183){if(_0x5cd183){var _0x1717f0=typeof _0x39bc43[_0x2ec2('0x21')]===_0x2ec2('0x22')&&typeof _0x39bc43[_0x2ec2('0x23')]===_0x2ec2('0x22');var _0x293444=_0x5cd183[_0x2ec2('0x24')];var _0x1eb741=_0x1717f0?0x0:_0x39bc43[_0x2ec2('0x21')];var _0x16c80f=_0x1717f0?_0x5cd183['count']:_0x39bc43[_0x2ec2('0x21')]+_0x39bc43['limit'];var _0x4eaf61;if(_0x16c80f>=_0x293444){_0x16c80f=_0x293444;_0x4eaf61=0xc8;}else{_0x4eaf61=0xce;}_0x510f7c[_0x2ec2('0x1f')](_0x4eaf61);return _0x510f7c['set']('Content-Range',_0x1eb741+'-'+_0x16c80f+'/'+_0x293444)[_0x2ec2('0x25')](_0x5cd183);}return null;};}function patchUpdates(_0x516bd2){return function(_0xce9e59){try{jsonpatch[_0x2ec2('0x26')](_0xce9e59,_0x516bd2,!![]);}catch(_0xf065db){return BPromise[_0x2ec2('0x27')](_0xf065db);}return _0xce9e59[_0x2ec2('0x28')]();};}function saveUpdates(_0x306342,_0x5d5140){return function(_0x295690){if(_0x295690){return _0x295690['update'](_0x306342)[_0x2ec2('0x29')](function(_0xe22ad){return _0xe22ad;});}return null;};}function removeEntity(_0x45ac31,_0x87ecb5){return function(_0x4de51a){if(_0x4de51a){return _0x4de51a['destroy']()['then'](function(){_0x45ac31[_0x2ec2('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x381488,_0x3b38b8){return function(_0x40ac83){if(!_0x40ac83){_0x381488[_0x2ec2('0x2a')](0x194);}return _0x40ac83;};}function handleError(_0x814a37,_0x2cb8f0){_0x2cb8f0=_0x2cb8f0||0x1f4;return function(_0xe82ae0){logger[_0x2ec2('0x2b')](_0xe82ae0['stack']);if(_0xe82ae0[_0x2ec2('0x2c')]){delete _0xe82ae0[_0x2ec2('0x2c')];}_0x814a37[_0x2ec2('0x1f')](_0x2cb8f0)[_0x2ec2('0x2d')](_0xe82ae0);};}function getInteractionUsers(_0x50cfb3,_0x203cd){return new BPromise(function(_0x5f5a8c,_0x19cb24){try{if(_0x203cd[_0x50cfb3['id']]){_0x50cfb3[_0x2ec2('0x2e')]=_[_0x2ec2('0x2f')](_0x203cd[_0x50cfb3['id']],function(_0x8b62bd){return{'id':_0x8b62bd['id'],'fullname':_0x8b62bd['fullname']};});}}catch(_0x145c5f){_0x19cb24(_0x145c5f);}_0x5f5a8c(_0x50cfb3);});}function getInteractionTags(_0x10e05a,_0x3f832d){return new BPromise(function(_0x25d26f,_0x59b7ff){try{if(_0x10e05a[_0x2ec2('0x30')]){_0x10e05a['Tags']=[];_0x10e05a['TagIds']['split'](',')[_0x2ec2('0x31')](function(_0x1b20e1){_0x10e05a[_0x2ec2('0x32')]['push'](_0x3f832d[_0x1b20e1]);});}delete _0x10e05a[_0x2ec2('0x30')];}catch(_0x2efb14){_0x59b7ff(_0x2efb14);}_0x25d26f(_0x10e05a);});}function updateSmsInteraction(_0x290dae,_0x5d908b,_0x457a59){return new BPromise(function(_0x2e0be2,_0x5715f1){return getInteractionUsers(_0x290dae,_0x457a59)[_0x2ec2('0x29')](function(_0x3137ae){return getInteractionTags(_0x3137ae,_0x5d908b);})[_0x2ec2('0x29')](function(_0xc6a857){return getStateInteraction(_0xc6a857);})[_0x2ec2('0x29')](function(_0x515392){_0x2e0be2(_0x515392);})[_0x2ec2('0x33')](function(_0x49d91b){_0x5715f1(_0x49d91b);});});}function getStateInteraction(_0x2dbb20){return new BPromise(function(_0x106868){_0x2dbb20[_0x2ec2('0x34')]=0x0;_0x2dbb20['talking']=0x0;_0x2dbb20[_0x2ec2('0x35')]=0x0;_0x2dbb20[_0x2ec2('0x36')]=0x0;_0x2dbb20[_0x2ec2('0x37')]=0x0;if(!_0x2dbb20['closed']&&!_0x2dbb20[_0x2ec2('0x38')]){_0x2dbb20[_0x2ec2('0x34')]+=0x1;}if(!_0x2dbb20[_0x2ec2('0x39')]&&_0x2dbb20[_0x2ec2('0x38')]){_0x2dbb20['talking']+=0x1;if(_0x2dbb20[_0x2ec2('0x34')]){_0x2dbb20[_0x2ec2('0x34')]-=0x1;}}if(_0x2dbb20['closed']&&_0x2dbb20[_0x2ec2('0x38')]){_0x2dbb20[_0x2ec2('0x35')]+=0x1;if(_0x2dbb20['talking']){_0x2dbb20[_0x2ec2('0x3a')]-=0x1;}}if(_0x2dbb20[_0x2ec2('0x39')]&&!_0x2dbb20[_0x2ec2('0x38')]){_0x2dbb20[_0x2ec2('0x36')]+=0x1;if(_0x2dbb20[_0x2ec2('0x34')]){_0x2dbb20[_0x2ec2('0x34')]-=0x1;}}_0x2dbb20[_0x2ec2('0x37')]+=0x1;_0x106868(_0x2dbb20);});}exports[_0x2ec2('0x3b')]=function(_0x23a296,_0xa8b7cc){var _0x3a70b5={},_0xf09366={},_0x22f7c9={'count':0x0,'rows':[]};var _0x5c3759=_[_0x2ec2('0x2f')](db[_0x2ec2('0x3c')][_0x2ec2('0x3d')],function(_0x959a49){return{'name':_0x959a49['fieldName'],'type':_0x959a49['type'][_0x2ec2('0x3e')]};});_0xf09366[_0x2ec2('0x3f')]=_[_0x2ec2('0x2f')](_0x5c3759,_0x2ec2('0x2c'));_0xf09366[_0x2ec2('0x40')]=_['keys'](_0x23a296[_0x2ec2('0x40')]);_0xf09366[_0x2ec2('0x41')]=_[_0x2ec2('0x42')](_0xf09366['model'],_0xf09366[_0x2ec2('0x40')]);_0x3a70b5[_0x2ec2('0x43')]=_[_0x2ec2('0x42')](_0xf09366[_0x2ec2('0x3f')],qs[_0x2ec2('0x44')](_0x23a296[_0x2ec2('0x40')]['fields']));_0x3a70b5['attributes']=_0x3a70b5[_0x2ec2('0x43')]['length']?_0x3a70b5['attributes']:_0xf09366[_0x2ec2('0x3f')];if(!_0x23a296[_0x2ec2('0x40')][_0x2ec2('0x45')](_0x2ec2('0x46'))){_0x3a70b5[_0x2ec2('0x23')]=qs[_0x2ec2('0x23')](_0x23a296['query'][_0x2ec2('0x23')]);_0x3a70b5[_0x2ec2('0x21')]=qs[_0x2ec2('0x21')](_0x23a296[_0x2ec2('0x40')][_0x2ec2('0x21')]);}_0x3a70b5[_0x2ec2('0x47')]=qs[_0x2ec2('0x48')](_0x23a296[_0x2ec2('0x40')]['sort']);_0x3a70b5[_0x2ec2('0x49')]=qs[_0x2ec2('0x41')](_[_0x2ec2('0x4a')](_0x23a296[_0x2ec2('0x40')],_0xf09366[_0x2ec2('0x41')]),_0x5c3759);var _0xe7e318=[];var _0x2f4835=squel[_0x2ec2('0x4b')]()['field']('id')[_0x2ec2('0x4c')](_0x2ec2('0x2c'))[_0x2ec2('0x4c')](_0x2ec2('0x4d'))[_0x2ec2('0x4e')](_0x2ec2('0x4f'));var _0x408997=squel['select']()[_0x2ec2('0x4c')](_0x2ec2('0x50'))[_0x2ec2('0x4c')](_0x2ec2('0x51'))[_0x2ec2('0x4c')]('ui.SmsInteractionId')[_0x2ec2('0x4e')]('user_has_sms_interactions','ui')['left_join'](_0x2ec2('0x52'),'u',_0x2ec2('0x53'));var _0x1311d6=squel[_0x2ec2('0x4b')]()['from']('sms_interactions','i')['left_join'](_0x2ec2('0x54'),'c',_0x2ec2('0x55'))[_0x2ec2('0x56')](_0x2ec2('0x52'),'o',_0x2ec2('0x57'))[_0x2ec2('0x56')](_0x2ec2('0x58'),'a','a.id\x20=\x20i.SmsAccountId')[_0x2ec2('0x56')]('sms_messages','me',_0x2ec2('0x59'))[_0x2ec2('0x56')]('sms_interaction_has_tags','it',_0x2ec2('0x5a'))[_0x2ec2('0x56')](_0x2ec2('0x4f'),'t',_0x2ec2('0x5b'));var _0x5eb80e=squel[_0x2ec2('0x5c')]();var _0x57daa0=[];var _0xfb5d99=squel[_0x2ec2('0x5c')]();var _0x4e1aa0;if(_0x23a296['query']['search']){_0x4e1aa0=as[_0x2ec2('0x5d')](_0x23a296[_0x2ec2('0x40')][_0x2ec2('0x5e')]);var _0x2cf4ec=_0x4e1aa0[_0x2ec2('0x5f')];for(var _0xd0a536=0x0;_0xd0a536<_0x4e1aa0[_0x2ec2('0x60')][_0x2ec2('0x61')];_0xd0a536++){var _0x51c03a=_0x4e1aa0[_0x2ec2('0x60')][_0xd0a536];var _0x10ea7a='i';var _0x207511=_[_0x2ec2('0x62')](_0x5c3759,[_0x2ec2('0x2c'),_0x51c03a['field']]);if(!_0x207511){switch(_0x51c03a['field']){case _0x2ec2('0x63'):if(_0x51c03a[_0x2ec2('0x64')]==0x1){_0x1311d6[_0x2ec2('0x65')]('`'+_0x51c03a[_0x2ec2('0x4c')]+_0x2ec2('0x66'));}else{_0x1311d6[_0x2ec2('0x65')]('`'+_0x51c03a['field']+'`\x20>\x200');}break;case'Contact':if(_0x51c03a[_0x2ec2('0x67')]===_0x2ec2('0x68')){if(_0x51c03a[_0x2ec2('0x64')][_0x2ec2('0x69')]('\x20')['length']>0x1){_0x5eb80e[_0x2cf4ec](_0x2ec2('0x6a'),qs[_0x2ec2('0x6b')](_0x51c03a[_0x2ec2('0x64')]),null);}else{var _0x23ee5e='%'+_0x51c03a[_0x2ec2('0x64')]+'%';_0x5eb80e[_0x2cf4ec](_0x2ec2('0x6c'),_0x23ee5e,_0x23ee5e,_0x23ee5e);}}else{_0x207511=_['find'](_0x5c3759,[_0x2ec2('0x2c'),_0x2ec2('0x6d')]);_0x51c03a[_0x2ec2('0x4c')]=_0x2ec2('0x6d');_0x47afc5=as[_0x2ec2('0x6e')](_0x10ea7a,_0x207511[_0x2ec2('0x6f')],_0x51c03a);_0x5eb80e[_0x2cf4ec](_0x47afc5[_0x2ec2('0x70')],_0x47afc5[_0x2ec2('0x64')][_0x2ec2('0x71')],_0x47afc5[_0x2ec2('0x64')]['end']);}break;case _0x2ec2('0x72'):var _0x3b386b=_0x51c03a['value']['split'](',')[_0x2ec2('0x2f')](function(_0x2f4069){return Number(_0x2f4069);});_0x3b386b['forEach'](function(_0x2c1762){_0xfb5d99['or'](_0x2ec2('0x73'),'%,'+_0x2c1762+',%');});_0x57daa0=_['union'](_0x57daa0,_0x3b386b);break;case _0x2ec2('0x74'):if(_0x51c03a[_0x2ec2('0x67')]===_0x2ec2('0x68')){_0x5eb80e[_0x2cf4ec](_0x2ec2('0x75'),'%'+_0x51c03a[_0x2ec2('0x64')]+'%',null);}else{_0x207511=_[_0x2ec2('0x62')](_0x5c3759,[_0x2ec2('0x2c'),_0x2ec2('0x38')]);_0x51c03a[_0x2ec2('0x4c')]=_0x2ec2('0x38');_0x47afc5=as[_0x2ec2('0x6e')](_0x10ea7a,_0x207511[_0x2ec2('0x6f')],_0x51c03a);_0x5eb80e[_0x2cf4ec](_0x47afc5[_0x2ec2('0x70')],_0x47afc5[_0x2ec2('0x64')]['start'],_0x47afc5[_0x2ec2('0x64')][_0x2ec2('0x20')]);}break;case'body':_0x47afc5=as[_0x2ec2('0x6e')]('me',null,_0x51c03a);_0x5eb80e[_0x2cf4ec](_0x47afc5[_0x2ec2('0x70')],_0x47afc5['value'][_0x2ec2('0x71')],_0x47afc5[_0x2ec2('0x64')][_0x2ec2('0x20')]);break;}}else{var _0x47afc5=as['buildExpression'](_0x10ea7a,_0x207511[_0x2ec2('0x6f')],_0x51c03a);_0x5eb80e[_0x2cf4ec](_0x47afc5['text'],_0x47afc5[_0x2ec2('0x64')][_0x2ec2('0x71')],_0x47afc5['value'][_0x2ec2('0x20')]);}}}else{var _0x4f9713=_(_0x23a296[_0x2ec2('0x40')])['keys']()[_0x2ec2('0x2f')](function(_0x4c00bf){return _[_0x2ec2('0x76')](_0x5c3759,['name',_0x4c00bf])?_0x4c00bf:undefined;})[_0x2ec2('0x77')]()[_0x2ec2('0x64')]();if(!_[_0x2ec2('0x78')](_0x4f9713)){_0x4f9713[_0x2ec2('0x31')](function(_0xe0e194){if(_0xe0e194===_0x2ec2('0x79')){_0x1311d6[_0x2ec2('0x49')](_0x2ec2('0x7a'),[][_0x2ec2('0x7b')](_0x23a296[_0x2ec2('0x40')][_0xe0e194]));}else if(_0xe0e194==='createdAt'){var _0x3f9e58=JSON['parse'](_0x23a296['query'][_0xe0e194])['$gte'];var _0x42e009=JSON[_0x2ec2('0x7c')](_0x23a296[_0x2ec2('0x40')][_0xe0e194])[_0x2ec2('0x7d')];_0x1311d6[_0x2ec2('0x49')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3f9e58,_0x42e009);}else{if(_0x23a296[_0x2ec2('0x40')][_0xe0e194]===_0x2ec2('0x7e')){_0x1311d6[_0x2ec2('0x49')]('i.'+_0xe0e194+_0x2ec2('0x7f'));}else{_0x1311d6['where']('i.'+_0xe0e194+'\x20=\x20?',_0x23a296['query'][_0xe0e194]);}}});}if(_0x23a296[_0x2ec2('0x40')][_0x2ec2('0x80')]){if(_0x23a296['query'][_0x2ec2('0x80')]==0x1){_0x1311d6['having']('`unreadMessages`\x20=\x200');}else{_0x1311d6['having'](_0x2ec2('0x81'));}}if(_0x23a296[_0x2ec2('0x40')][_0x2ec2('0x82')]){_0x57daa0=_['isArray'](_0x23a296[_0x2ec2('0x40')]['tag'])?_0x23a296[_0x2ec2('0x40')]['tag']:new Array(_0x23a296[_0x2ec2('0x40')]['tag']);_0x57daa0[_0x2ec2('0x31')](function(_0x2a3dd7){_0xfb5d99['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a3dd7+',%');});}if(_0x23a296['query'][_0x2ec2('0x83')]){var _0x18018b=_0x23a296[_0x2ec2('0x40')][_0x2ec2('0x83')][_0x2ec2('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x2ec2('0x85')](_0x18018b)){_0x5eb80e['or'](_0x2ec2('0x86'),_0x18018b+'%')['or']('i.phone\x20LIKE\x20?',_0x18018b+'%');}else{_0x5eb80e['or'](_0x2ec2('0x87'),qs[_0x2ec2('0x6b')](_0x18018b))['or'](_0x2ec2('0x88'),_0x18018b+'%');}}}_0x1311d6[_0x2ec2('0x49')](_0x5eb80e);_0x1311d6[_0x2ec2('0x89')]('i.id');var _0x54676a={'type':db['Sequelize'][_0x2ec2('0x8a')][_0x2ec2('0x8b')],'raw':!![]};var _0x27a184=_0x1311d6[_0x2ec2('0x8c')]();_0x27a184[_0x2ec2('0x4c')](_0x2ec2('0x8d'));_0x27a184[_0x2ec2('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2ec2('0x63'));if(_0x3a70b5['order']){_0x3a70b5[_0x2ec2('0x47')]['forEach'](function(_0xa7b7f3){var _0x3cb75d=_0xa7b7f3[0x0]===_0x2ec2('0x8e')?_0xa7b7f3[0x0]:'i.'+_0xa7b7f3[0x0];_0x1311d6[_0x2ec2('0x47')](_0x3cb75d,_0xa7b7f3[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x57daa0)){_0x1311d6[_0x2ec2('0x65')](_0xfb5d99);_0x27a184[_0x2ec2('0x49')](_0x2ec2('0x8f'),_0x57daa0);}BPromise[_0x2ec2('0x90')]()[_0x2ec2('0x29')](function(){if(!_0x4e1aa0){if(_0x23a296[_0x2ec2('0x40')]['SmsAccountId'])return;_0x27a184[_0x2ec2('0x49')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x1311d6[_0x2ec2('0x49')](_0x2ec2('0x91'));return;}if(_0x23a296[_0x2ec2('0x92')][_0x2ec2('0x93')]!==_0x2ec2('0x94'))return;return _0x23a296[_0x2ec2('0x92')][_0x2ec2('0x95')]({'attributes':['id'],'raw':!![]})[_0x2ec2('0x29')](function(_0x4c20d1){if(_[_0x2ec2('0x78')](_0x4c20d1)){_0x27a184[_0x2ec2('0x49')]('i.SmsAccountId\x20IS\x20NULL');_0x1311d6[_0x2ec2('0x49')](_0x2ec2('0x96'));}else{_0x27a184[_0x2ec2('0x49')](_0x2ec2('0x7a'),_[_0x2ec2('0x2f')](_0x4c20d1,'id'));_0x1311d6[_0x2ec2('0x49')]('i.SmsAccountId\x20IN\x20?',_[_0x2ec2('0x2f')](_0x4c20d1,'id'));}});})[_0x2ec2('0x29')](function(){if(_0x23a296[_0x2ec2('0x92')][_0x2ec2('0x93')]==='agent'&&!_0x4e1aa0&&!_0x23a296[_0x2ec2('0x40')][_0x2ec2('0x79')])return[];return db[_0x2ec2('0x97')][_0x2ec2('0x40')](_0x27a184[_0x2ec2('0x98')](),_0x54676a);})[_0x2ec2('0x29')](function(_0x1b26c7){_0x22f7c9[_0x2ec2('0x24')]=_0x1b26c7['length'];if(_0x22f7c9[_0x2ec2('0x24')]===0x0)return[];return db['sequelize'][_0x2ec2('0x40')](_0x2f4835[_0x2ec2('0x98')](),_0x54676a)['then'](function(_0x1524c7){_0xe7e318=_[_0x2ec2('0x99')](_0x1524c7,'id');_0x54676a=_[_0x2ec2('0x9a')](_0x54676a,{'model':db[_0x2ec2('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x23a296[_0x2ec2('0x40')][_0x2ec2('0x44')]){_0x3a70b5['attributes']['forEach'](function(_0x3e45d8){_0x1311d6[_0x2ec2('0x4c')]('i.'+_0x3e45d8);});}else{_0x1311d6[_0x2ec2('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2ec2('0x63'));_0x1311d6[_0x2ec2('0x4c')](_0x2ec2('0x9b'),'Account.key');_0x1311d6[_0x2ec2('0x4c')](_0x2ec2('0x9c'),'Account.mandatoryDisposition');_0x1311d6[_0x2ec2('0x4c')]('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');_0x1311d6['field'](_0x2ec2('0x9d'));_0x1311d6[_0x2ec2('0x4c')]('c.firstName',_0x2ec2('0x9e'));_0x1311d6[_0x2ec2('0x4c')](_0x2ec2('0x9f'),_0x2ec2('0xa0'));_0x1311d6[_0x2ec2('0x4c')](_0x2ec2('0xa1'),'Contact.email');_0x1311d6['field']('c.phone',_0x2ec2('0xa2'));_0x1311d6[_0x2ec2('0x4c')](_0x2ec2('0xa3'),_0x2ec2('0xa4'));_0x1311d6['field']('c.fax',_0x2ec2('0xa5'));_0x1311d6[_0x2ec2('0x4c')](_0x2ec2('0xa6'),'Owner.fullname');_0x1311d6[_0x2ec2('0x4c')](_0x2ec2('0xa7'),_0x2ec2('0xa8'));_0x1311d6[_0x2ec2('0x4c')](_0x2ec2('0xa9'),_0x2ec2('0x30'));}if(_0x3a70b5[_0x2ec2('0x23')])_0x1311d6[_0x2ec2('0x23')](_0x3a70b5[_0x2ec2('0x23')]);if(_0x3a70b5[_0x2ec2('0x21')])_0x1311d6[_0x2ec2('0x21')](_0x3a70b5['offset']);return db[_0x2ec2('0x97')][_0x2ec2('0x40')](_0x1311d6['toString'](),_0x54676a);})[_0x2ec2('0x29')](function(_0x1ccdda){if(_0x1ccdda[_0x2ec2('0x61')]>0x0)_0x408997[_0x2ec2('0x49')](_0x2ec2('0xaa'),_[_0x2ec2('0x2f')](_0x1ccdda,'id'));return db['sequelize'][_0x2ec2('0x40')](_0x408997[_0x2ec2('0x98')](),_0x54676a)[_0x2ec2('0x29')](function(_0x1f5d90){var _0x4bda35=_[_0x2ec2('0xab')](_0x1f5d90,_0x2ec2('0xac'));var _0x8952ef=[];_0x1ccdda['forEach'](function(_0x1d6fd9){_0x8952ef[_0x2ec2('0xad')](updateSmsInteraction(_0x1d6fd9,_0xe7e318,_0x4bda35));});return BPromise[_0x2ec2('0xae')](_0x8952ef);});});})['then'](function(_0x20121e){_0x22f7c9[_0x2ec2('0xaf')]=_0x20121e;return _0x22f7c9;})[_0x2ec2('0x29')](respondWithFilteredResult(_0xa8b7cc,_0x3a70b5))[_0x2ec2('0x33')](handleError(_0xa8b7cc,null));};exports['show']=function(_0x47540e,_0x36e17e){var _0x59832={'raw':![],'where':{'id':_0x47540e[_0x2ec2('0xb0')]['id']}},_0x5844ec={};_0x5844ec[_0x2ec2('0x3f')]=_[_0x2ec2('0xb1')](db['SmsInteraction']['rawAttributes']);_0x5844ec[_0x2ec2('0x40')]=_[_0x2ec2('0xb1')](_0x47540e[_0x2ec2('0x40')]);_0x5844ec[_0x2ec2('0x41')]=_['intersection'](_0x5844ec[_0x2ec2('0x3f')],_0x5844ec[_0x2ec2('0x40')]);_0x59832['attributes']=_[_0x2ec2('0x42')](_0x5844ec['model'],qs[_0x2ec2('0x44')](_0x47540e[_0x2ec2('0x40')]['fields']));_0x59832[_0x2ec2('0x43')]=_0x59832[_0x2ec2('0x43')]['length']?_0x59832[_0x2ec2('0x43')]:_0x5844ec[_0x2ec2('0x3f')];if(_0x47540e['query'][_0x2ec2('0xb2')]){_0x59832[_0x2ec2('0xb3')]=[{'all':!![]}];}_0x59832=_[_0x2ec2('0x9a')]({},_0x59832,_0x47540e[_0x2ec2('0xb4')]);return db[_0x2ec2('0x3c')][_0x2ec2('0x62')](_0x59832)[_0x2ec2('0x29')](handleEntityNotFound(_0x36e17e,null))[_0x2ec2('0x29')](respondWithResult(_0x36e17e,null))[_0x2ec2('0x33')](handleError(_0x36e17e,null));};exports[_0x2ec2('0xb5')]=function(_0x3a26f0,_0x2f8aa3){return db['SmsInteraction'][_0x2ec2('0xb5')](_0x3a26f0[_0x2ec2('0xb6')],{})['then'](respondWithResult(_0x2f8aa3,0xc9))[_0x2ec2('0x33')](handleError(_0x2f8aa3,null));};exports['update']=function(_0x4afc51,_0x5a7ac9){if(_0x4afc51[_0x2ec2('0xb6')]['id']){delete _0x4afc51[_0x2ec2('0xb6')]['id'];}return db[_0x2ec2('0x3c')][_0x2ec2('0x62')]({'where':{'id':_0x4afc51['params']['id']}})[_0x2ec2('0x29')](handleEntityNotFound(_0x5a7ac9,null))[_0x2ec2('0x29')](saveUpdates(_0x4afc51[_0x2ec2('0xb6')],null))[_0x2ec2('0x29')](respondWithResult(_0x5a7ac9,null))[_0x2ec2('0x33')](handleError(_0x5a7ac9,null));};exports[_0x2ec2('0xb7')]=function(_0x1abd15,_0x2f09be){return db[_0x2ec2('0x3c')][_0x2ec2('0x62')]({'where':{'id':_0x1abd15[_0x2ec2('0xb0')]['id']}})['then'](handleEntityNotFound(_0x2f09be,null))['then'](removeEntity(_0x2f09be,null))['catch'](handleError(_0x2f09be,null));};exports[_0x2ec2('0xb8')]=function(_0x13f9f0,_0x13f387){return db['SmsInteraction'][_0x2ec2('0xb8')]()['then'](respondWithResult(_0x13f387,null))[_0x2ec2('0x33')](handleError(_0x13f387,null));};exports[_0x2ec2('0xb9')]=function(_0x7bc634,_0x4cd230,_0x47c044){return db['SmsMessage'][_0x2ec2('0x62')]({'where':{'id':_0x7bc634[_0x2ec2('0xb0')]['id']}})[_0x2ec2('0x29')](handleEntityNotFound(_0x4cd230,null))[_0x2ec2('0x29')](function(_0x14c094){if(_0x14c094){return _0x14c094[_0x2ec2('0xb9')](_0x7bc634[_0x2ec2('0xb6')][_0x2ec2('0xba')],_[_0x2ec2('0xbb')](_0x7bc634[_0x2ec2('0xb6')],['ids','id'])||{});}})['then'](respondWithResult(_0x4cd230,null))[_0x2ec2('0x33')](handleError(_0x4cd230,null));};exports[_0x2ec2('0xbc')]=function(_0x5e2304,_0x511c9e,_0x1421fb){var _0x1d34b7={'raw':![],'where':{}};var _0x3acdf3={};var _0x2e2726={'count':0x0,'rows':[]};return db[_0x2ec2('0x3c')][_0x2ec2('0xbd')]({'where':{'id':_0x5e2304[_0x2ec2('0xb0')]['id']}})[_0x2ec2('0x29')](handleEntityNotFound(_0x511c9e,null))[_0x2ec2('0x29')](function(_0x2d72dc){if(_0x2d72dc){_0x3acdf3[_0x2ec2('0x3f')]=_[_0x2ec2('0xb1')](db['SmsMessage']['rawAttributes']);_0x3acdf3['query']=_[_0x2ec2('0xb1')](_0x5e2304[_0x2ec2('0x40')]);_0x3acdf3[_0x2ec2('0x41')]=_['intersection'](_0x3acdf3[_0x2ec2('0x3f')],_0x3acdf3[_0x2ec2('0x40')]);_0x1d34b7[_0x2ec2('0x43')]=_['intersection'](_0x3acdf3[_0x2ec2('0x3f')],qs[_0x2ec2('0x44')](_0x5e2304[_0x2ec2('0x40')][_0x2ec2('0x44')]));_0x1d34b7[_0x2ec2('0x43')]=_0x1d34b7[_0x2ec2('0x43')]['length']?_0x1d34b7[_0x2ec2('0x43')]:_0x3acdf3[_0x2ec2('0x3f')];if(!_0x5e2304[_0x2ec2('0x40')][_0x2ec2('0x45')](_0x2ec2('0x46'))){_0x1d34b7[_0x2ec2('0x23')]=qs[_0x2ec2('0x23')](_0x5e2304[_0x2ec2('0x40')][_0x2ec2('0x23')]);_0x1d34b7['offset']=qs[_0x2ec2('0x21')](_0x5e2304['query'][_0x2ec2('0x21')]);}_0x1d34b7[_0x2ec2('0x47')]=qs['sort'](_0x5e2304[_0x2ec2('0x40')][_0x2ec2('0x48')]);_0x1d34b7['where']=qs[_0x2ec2('0x41')](_[_0x2ec2('0x4a')](_0x5e2304[_0x2ec2('0x40')],_0x3acdf3['filters']));_0x1d34b7[_0x2ec2('0x49')]['SmsInteractionId']=_0x2d72dc['id'];if(_0x5e2304['query'][_0x2ec2('0x83')]){_0x1d34b7['where']=_[_0x2ec2('0x9a')](_0x1d34b7[_0x2ec2('0x49')],{'$or':_['map'](_0x1d34b7[_0x2ec2('0x43')],function(_0x3a97c7){var _0x1e30b0={};_0x1e30b0[_0x3a97c7]={'$like':'%'+_0x5e2304['query']['filter']+'%'};return _0x1e30b0;})});}if(_0x5e2304[_0x2ec2('0x40')][_0x2ec2('0xbe')]){var _0x383fbe=_0x5e2304['query'][_0x2ec2('0xbe')][_0x2ec2('0x69')](',');var _0x21a8df={};_0x21a8df[_0x383fbe[0x0]]={'$gte':moment(_0x383fbe[0x1])[_0x2ec2('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1d34b7[_0x2ec2('0x49')]=_[_0x2ec2('0x9a')](_0x1d34b7[_0x2ec2('0x49')],_0x21a8df);}_0x1d34b7=_[_0x2ec2('0x9a')]({},_0x1d34b7,_0x5e2304[_0x2ec2('0xb4')]);return db['SmsMessage'][_0x2ec2('0x24')]({'where':_0x1d34b7[_0x2ec2('0x49')]})[_0x2ec2('0x29')](function(_0x244d35){_0x2e2726[_0x2ec2('0x24')]=_0x244d35;if(_0x5e2304[_0x2ec2('0x40')][_0x2ec2('0xb2')]){_0x1d34b7['include']=[{'all':!![]}];}return db[_0x2ec2('0xc0')]['findAll'](_0x1d34b7);})[_0x2ec2('0x29')](function(_0x3f4e75){_0x2e2726[_0x2ec2('0xaf')]=_0x3f4e75;return _0x2e2726;});}})[_0x2ec2('0x29')](respondWithFilteredResult(_0x511c9e,_0x1d34b7))[_0x2ec2('0x33')](handleError(_0x511c9e,null));};exports[_0x2ec2('0xc1')]=function(_0x3be4fc,_0x26719a,_0x3428c9){return db[_0x2ec2('0x3c')][_0x2ec2('0x62')]({'where':{'id':_0x3be4fc['params']['id']}})[_0x2ec2('0x29')](handleEntityNotFound(_0x26719a,null))[_0x2ec2('0x29')](function(_0x315465){if(_0x315465){return _0x315465[_0x2ec2('0xc2')](_0x3be4fc['body'][_0x2ec2('0xba')],_[_0x2ec2('0xbb')](_0x3be4fc[_0x2ec2('0xb6')],[_0x2ec2('0xba'),'id'])||{})['spread'](function(){return db['Tag'][_0x2ec2('0xc3')]({'attributes':['id',_0x2ec2('0x2c'),_0x2ec2('0x4d')],'where':{'id':_0x3be4fc[_0x2ec2('0xb6')]['ids']}});})[_0x2ec2('0x29')](function(_0xc3d891){socket[_0x2ec2('0xc4')](_0x2ec2('0xc5'),{'id':Number(_0x3be4fc['params']['id']),'tags':_0xc3d891||[]});return{'id':Number(_0x3be4fc[_0x2ec2('0xb0')]['id']),'tags':_0xc3d891||[]};});}})[_0x2ec2('0x29')](respondWithResult(_0x26719a,null))['catch'](handleError(_0x26719a,null));};exports[_0x2ec2('0xc6')]=function(_0xc4097b,_0x18ce11,_0x48cbc4){return db['SmsInteraction'][_0x2ec2('0x62')]({'where':{'id':_0xc4097b['params']['id']}})[_0x2ec2('0x29')](handleEntityNotFound(_0x18ce11,null))['then'](function(_0x4b1ec8){if(_0x4b1ec8){return _0x4b1ec8['removeTags'](_0xc4097b[_0x2ec2('0x40')][_0x2ec2('0xba')]);}})[_0x2ec2('0x29')](respondWithStatusCode(_0x18ce11,null))[_0x2ec2('0x33')](handleError(_0x18ce11,null));};exports[_0x2ec2('0xc7')]=function(_0x6d6a0f,_0x56b5e3){var _0x4131f3=moment()[_0x2ec2('0xc8')]()[_0x2ec2('0x98')]();var _0x591157=path[_0x2ec2('0xc9')](config['root'],_0x2ec2('0xca'),_0x2ec2('0xcb'),'tmp');var _0x133404=path[_0x2ec2('0xc9')](config[_0x2ec2('0xcc')],_0x2ec2('0xca'),_0x2ec2('0xcb'),_0x2ec2('0xcd'));var _0x49e96a=path[_0x2ec2('0xc9')](_0x591157,_0x4131f3);var _0x145636=util[_0x2ec2('0xbf')](_0x2ec2('0xce'),_0x6d6a0f[_0x2ec2('0xb0')]['id'],_0x4131f3);var _0x20dcf1=path['join'](_0x591157,_0x145636);var _0x121de9=[];_0x121de9[_0x2ec2('0xad')]({'model':db['User'],'as':_0x2ec2('0x74'),'attributes':['id',_0x2ec2('0xcf')],'raw':!![]});_0x121de9[_0x2ec2('0xad')]({'model':db['CmContact'],'as':_0x2ec2('0xd0'),'attributes':['id',_0x2ec2('0xd1'),_0x2ec2('0xd2')],'raw':!![]});var _0x5ac2ae=[{'model':db[_0x2ec2('0xc0')],'as':_0x2ec2('0xd3'),'attributes':['id',_0x2ec2('0xb6'),'createdAt','direction',_0x2ec2('0xd4'),_0x2ec2('0x80')],'include':_0x121de9}];_0x5ac2ae['push']({'model':db['SmsAccount'],'as':_0x2ec2('0xd5'),'attributes':['id',_0x2ec2('0x2c')]});_0x5ac2ae['push']({'model':db[_0x2ec2('0x74')],'as':'Owner','attributes':['id',_0x2ec2('0xcf')]});return db[_0x2ec2('0x3c')][_0x2ec2('0x62')]({'where':{'id':_0x6d6a0f[_0x2ec2('0xb0')]['id']},'include':_0x5ac2ae})['then'](handleEntityNotFound(_0x56b5e3,null))[_0x2ec2('0x29')](function(_0xc3f5fa){if(_0xc3f5fa){var _0x2a2bad=_0xc3f5fa['get']({'plain':!![]});fs['mkdirSync'](_0x49e96a);var _0x148c9d={'channel':_0x2ec2('0xd6'),'account':_0x2a2bad[_0x2ec2('0xd5')][_0x2ec2('0x2c')],'agent':_0x2a2bad[_0x2ec2('0xd7')]?_0x2a2bad['Owner'][_0x2ec2('0xcf')]:'N.A.','createdAt':moment(_0x2a2bad[_0x2ec2('0xd8')])[_0x2ec2('0xbf')](_0x2ec2('0xd9'))[_0x2ec2('0x98')](),'closedAt':_0x2a2bad[_0x2ec2('0x39')]?moment(_0x2a2bad[_0x2ec2('0xda')])[_0x2ec2('0xbf')](_0x2ec2('0xd9'))[_0x2ec2('0x98')]():'','disposition':_0x2a2bad['disposition'],'messages':_(_0x2a2bad[_0x2ec2('0xd3')])['filter']({'secret':![]})['map'](function(_0x208edc){return{'date':moment(_0x208edc[_0x2ec2('0xd8')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x2ec2('0x98')](),'sender':_0x208edc[_0x2ec2('0xdb')]===_0x2ec2('0xdc')?_0x208edc['User']?_0x208edc[_0x2ec2('0x74')][_0x2ec2('0xcf')]:_0x2ec2('0xdd'):_0x208edc[_0x2ec2('0xd0')][_0x2ec2('0xd1')]+(_0x208edc[_0x2ec2('0xd0')][_0x2ec2('0xd2')]?'\x20'+_0x208edc[_0x2ec2('0xd0')][_0x2ec2('0xd2')]:''),'body':_0x208edc[_0x2ec2('0xb6')],'direction':_0x208edc[_0x2ec2('0xdb')]===_0x2ec2('0xdc')?'A':'C','secret':_0x208edc[_0x2ec2('0xd4')],'read':_0x208edc[_0x2ec2('0x80')]};})[_0x2ec2('0x64')]()};return ejs[_0x2ec2('0xde')](path['join'](config[_0x2ec2('0xcc')],_0x2ec2('0xca'),_0x2ec2('0xdf'),_0x2ec2('0xe0')),{'interaction':_0x148c9d})[_0x2ec2('0x29')](function(_0x4e00a6){var _0x28b793=path[_0x2ec2('0xc9')](_0x49e96a,_0x2ec2('0xe1')+_0x2a2bad['id']+'-'+_0x4131f3+'.pdf');var _0x3cb77f={'path':_0x28b793,'channel':_0x2ec2('0xd6'),'interactionId':_0x2a2bad['id']};return pdf[_0x2ec2('0xe2')](_0x4e00a6,_0x3cb77f);})[_0x2ec2('0x29')](function(){return new BPromise(function(_0x5f9fdd,_0x9efd05){zipdir(_0x49e96a,{'saveTo':_0x20dcf1},function(_0x24bfd0,_0x33d700){if(_0x24bfd0)return _0x9efd05(_0x24bfd0);return _0x5f9fdd(_0x33d700);});})['then'](function(){return new BPromise(function(_0xdeb631,_0x5c00e){rimraf(_0x49e96a,function(_0x3f2b0a){if(_0x3f2b0a)_0x5c00e(_0x3f2b0a);return _0xdeb631();});});})[_0x2ec2('0x29')](function(){return _0x56b5e3['download'](_0x20dcf1,_0x145636,function(_0x2aab9e){if(_0x2aab9e){console['log'](_0x2ec2('0xe3'),_0x2aab9e);}else{fs[_0x2ec2('0xe4')](_0x20dcf1);}});});});}else{return _0x56b5e3[_0x2ec2('0x2a')](0xc8);}})[_0x2ec2('0x33')](handleError(_0x56b5e3,null));}; \ No newline at end of file +var _0x4c62=['where','pick','select','field','color','from','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','expr','search','conditions','length','find','having','`\x20=\x200','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','value','start','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','buildExpression','text','body','compact','isEmpty','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','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','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','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','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','rows','catch','params','rawAttributes','keys','include','create','destroy','describe','addMessage','SmsMessage','ids','omit','getMessages','SmsInteractionId','format','includeAll','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','root','server','tmp','join','files','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','direction','SmsAccount','Owner','mkdirSync','Sms','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','out','secret','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','Users','map','TagIds','forEach','Tags','waiting','talking','answered','unmanaged','closed','UserId','index','SmsInteraction','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort'];(function(_0x317cc5,_0x3b6179){var _0x44fe81=function(_0x3b43b5){while(--_0x3b43b5){_0x317cc5['push'](_0x317cc5['shift']());}};_0x44fe81(++_0x3b6179);}(_0x4c62,0x18e));var _0x24c6=function(_0x360a88,_0x52f10a){_0x360a88=_0x360a88-0x0;var _0x474fb8=_0x4c62[_0x360a88];return _0x474fb8;};'use strict';var emlformat=require(_0x24c6('0x0'));var rimraf=require(_0x24c6('0x1'));var zipdir=require(_0x24c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24c6('0x3'));var moment=require(_0x24c6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x24c6('0x5'));var util=require(_0x24c6('0x6'));var path=require(_0x24c6('0x7'));var sox=require(_0x24c6('0x8'));var csv=require(_0x24c6('0x9'));var ejs=require(_0x24c6('0xa'));var fs=require('fs');var fs_extra=require(_0x24c6('0xb'));var _=require('lodash');var squel=require(_0x24c6('0xc'));var crypto=require(_0x24c6('0xd'));var jsforce=require(_0x24c6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x24c6('0xf'));var Papa=require(_0x24c6('0x10'));var Redis=require(_0x24c6('0x11'));var authService=require(_0x24c6('0x12'));var qs=require(_0x24c6('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x24c6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24c6('0x15'))(_0x24c6('0x16'));var utils=require(_0x24c6('0x17'));var config=require(_0x24c6('0x18'));var licenseUtil=require(_0x24c6('0x19'));var db=require('../../mysqldb')['db'];config[_0x24c6('0x1a')]=_[_0x24c6('0x1b')](config[_0x24c6('0x1a')],{'host':_0x24c6('0x1c'),'port':0x18eb});var socket=require(_0x24c6('0x1d'))(new Redis(config[_0x24c6('0x1a')]));require(_0x24c6('0x1e'))['register'](socket);function respondWithStatusCode(_0x283230,_0x3b123e){_0x3b123e=_0x3b123e||0xcc;return function(_0x155acf){if(_0x155acf){return _0x283230[_0x24c6('0x1f')](_0x3b123e);}return _0x283230[_0x24c6('0x20')](_0x3b123e)['end']();};}function respondWithResult(_0x410136,_0x350e96){_0x350e96=_0x350e96||0xc8;return function(_0x1c25be){if(_0x1c25be){return _0x410136[_0x24c6('0x20')](_0x350e96)[_0x24c6('0x21')](_0x1c25be);}};}function respondWithFilteredResult(_0x1e5583,_0x3740e8){return function(_0x50cece){if(_0x50cece){var _0x462088=typeof _0x3740e8['offset']===_0x24c6('0x22')&&typeof _0x3740e8['limit']===_0x24c6('0x22');var _0x1fdc11=_0x50cece[_0x24c6('0x23')];var _0x3fb1d1=_0x462088?0x0:_0x3740e8[_0x24c6('0x24')];var _0x325b8=_0x462088?_0x50cece[_0x24c6('0x23')]:_0x3740e8[_0x24c6('0x24')]+_0x3740e8[_0x24c6('0x25')];var _0x4d6815;if(_0x325b8>=_0x1fdc11){_0x325b8=_0x1fdc11;_0x4d6815=0xc8;}else{_0x4d6815=0xce;}_0x1e5583[_0x24c6('0x20')](_0x4d6815);return _0x1e5583[_0x24c6('0x26')](_0x24c6('0x27'),_0x3fb1d1+'-'+_0x325b8+'/'+_0x1fdc11)[_0x24c6('0x21')](_0x50cece);}return null;};}function patchUpdates(_0x3d43c8){return function(_0x482cc9){try{jsonpatch[_0x24c6('0x28')](_0x482cc9,_0x3d43c8,!![]);}catch(_0x43e3f9){return BPromise[_0x24c6('0x29')](_0x43e3f9);}return _0x482cc9[_0x24c6('0x2a')]();};}function saveUpdates(_0x280cc1,_0x4019f7){return function(_0x41863c){if(_0x41863c){return _0x41863c[_0x24c6('0x2b')](_0x280cc1)[_0x24c6('0x2c')](function(_0x51f5e8){return _0x51f5e8;});}return null;};}function removeEntity(_0x27e4e1,_0x52150d){return function(_0x30ccdb){if(_0x30ccdb){return _0x30ccdb['destroy']()['then'](function(){_0x27e4e1[_0x24c6('0x20')](0xcc)[_0x24c6('0x2d')]();});}};}function handleEntityNotFound(_0x4ffd0a,_0x4794c4){return function(_0x2dce9d){if(!_0x2dce9d){_0x4ffd0a['sendStatus'](0x194);}return _0x2dce9d;};}function handleError(_0x154f0a,_0xaf05e5){_0xaf05e5=_0xaf05e5||0x1f4;return function(_0x5476b1){logger[_0x24c6('0x2e')](_0x5476b1[_0x24c6('0x2f')]);if(_0x5476b1[_0x24c6('0x30')]){delete _0x5476b1['name'];}_0x154f0a[_0x24c6('0x20')](_0xaf05e5)[_0x24c6('0x31')](_0x5476b1);};}function getInteractionUsers(_0x21f302,_0x2d8e41){return new BPromise(function(_0x1d0c5b,_0x32497f){try{if(_0x2d8e41[_0x21f302['id']]){_0x21f302[_0x24c6('0x32')]=_[_0x24c6('0x33')](_0x2d8e41[_0x21f302['id']],function(_0x51d819){return{'id':_0x51d819['id'],'fullname':_0x51d819['fullname']};});}}catch(_0x3acd39){_0x32497f(_0x3acd39);}_0x1d0c5b(_0x21f302);});}function getInteractionTags(_0x28b0c8,_0xc1c2dc){return new BPromise(function(_0x2526e3,_0x309c3b){try{if(_0x28b0c8[_0x24c6('0x34')]){_0x28b0c8['Tags']=[];_0x28b0c8[_0x24c6('0x34')]['split'](',')[_0x24c6('0x35')](function(_0x563ab4){_0x28b0c8[_0x24c6('0x36')]['push'](_0xc1c2dc[_0x563ab4]);});}delete _0x28b0c8[_0x24c6('0x34')];}catch(_0x2b5c0b){_0x309c3b(_0x2b5c0b);}_0x2526e3(_0x28b0c8);});}function updateSmsInteraction(_0x24ef9f,_0x5021b3,_0x56cef7){return new BPromise(function(_0x275ac9,_0x10f080){return getInteractionUsers(_0x24ef9f,_0x56cef7)[_0x24c6('0x2c')](function(_0x3f355b){return getInteractionTags(_0x3f355b,_0x5021b3);})[_0x24c6('0x2c')](function(_0x33a99f){return getStateInteraction(_0x33a99f);})[_0x24c6('0x2c')](function(_0x8dbae4){_0x275ac9(_0x8dbae4);})['catch'](function(_0x88b77e){_0x10f080(_0x88b77e);});});}function getStateInteraction(_0xf99d9f){return new BPromise(function(_0x5135aa){_0xf99d9f[_0x24c6('0x37')]=0x0;_0xf99d9f[_0x24c6('0x38')]=0x0;_0xf99d9f[_0x24c6('0x39')]=0x0;_0xf99d9f[_0x24c6('0x3a')]=0x0;_0xf99d9f['total']=0x0;if(!_0xf99d9f[_0x24c6('0x3b')]&&!_0xf99d9f['UserId']){_0xf99d9f[_0x24c6('0x37')]+=0x1;}if(!_0xf99d9f[_0x24c6('0x3b')]&&_0xf99d9f['UserId']){_0xf99d9f[_0x24c6('0x38')]+=0x1;if(_0xf99d9f['waiting']){_0xf99d9f[_0x24c6('0x37')]-=0x1;}}if(_0xf99d9f[_0x24c6('0x3b')]&&_0xf99d9f[_0x24c6('0x3c')]){_0xf99d9f[_0x24c6('0x39')]+=0x1;if(_0xf99d9f[_0x24c6('0x38')]){_0xf99d9f[_0x24c6('0x38')]-=0x1;}}if(_0xf99d9f[_0x24c6('0x3b')]&&!_0xf99d9f[_0x24c6('0x3c')]){_0xf99d9f['unmanaged']+=0x1;if(_0xf99d9f[_0x24c6('0x37')]){_0xf99d9f[_0x24c6('0x37')]-=0x1;}}_0xf99d9f['total']+=0x1;_0x5135aa(_0xf99d9f);});}exports[_0x24c6('0x3d')]=function(_0x398b2c,_0x2eeb5d){var _0x409ded={},_0x1cf016={},_0x28f1d4={'count':0x0,'rows':[]};var _0x3dbd05=_['map'](db[_0x24c6('0x3e')]['rawAttributes'],function(_0x5a1ed9){return{'name':_0x5a1ed9['fieldName'],'type':_0x5a1ed9[_0x24c6('0x3f')][_0x24c6('0x40')]};});_0x1cf016[_0x24c6('0x41')]=_[_0x24c6('0x33')](_0x3dbd05,_0x24c6('0x30'));_0x1cf016[_0x24c6('0x42')]=_['keys'](_0x398b2c[_0x24c6('0x42')]);_0x1cf016[_0x24c6('0x43')]=_[_0x24c6('0x44')](_0x1cf016['model'],_0x1cf016[_0x24c6('0x42')]);_0x409ded['attributes']=_[_0x24c6('0x44')](_0x1cf016['model'],qs[_0x24c6('0x45')](_0x398b2c['query']['fields']));_0x409ded['attributes']=_0x409ded[_0x24c6('0x46')]['length']?_0x409ded['attributes']:_0x1cf016[_0x24c6('0x41')];if(!_0x398b2c[_0x24c6('0x42')][_0x24c6('0x47')](_0x24c6('0x48'))){_0x409ded[_0x24c6('0x25')]=qs['limit'](_0x398b2c['query']['limit']);_0x409ded['offset']=qs[_0x24c6('0x24')](_0x398b2c[_0x24c6('0x42')][_0x24c6('0x24')]);}_0x409ded['order']=qs[_0x24c6('0x49')](_0x398b2c[_0x24c6('0x42')][_0x24c6('0x49')]);_0x409ded[_0x24c6('0x4a')]=qs[_0x24c6('0x43')](_[_0x24c6('0x4b')](_0x398b2c[_0x24c6('0x42')],_0x1cf016[_0x24c6('0x43')]),_0x3dbd05);var _0x58220=[];var _0x443329=squel[_0x24c6('0x4c')]()['field']('id')[_0x24c6('0x4d')](_0x24c6('0x30'))[_0x24c6('0x4d')](_0x24c6('0x4e'))[_0x24c6('0x4f')]('tools_tags');var _0x1acb14=squel[_0x24c6('0x4c')]()['field']('u.id')[_0x24c6('0x4d')](_0x24c6('0x50'))[_0x24c6('0x4d')](_0x24c6('0x51'))[_0x24c6('0x4f')](_0x24c6('0x52'),'ui')[_0x24c6('0x53')]('users','u',_0x24c6('0x54'));var _0x554d21=squel[_0x24c6('0x4c')]()[_0x24c6('0x4f')](_0x24c6('0x55'),'i')[_0x24c6('0x53')](_0x24c6('0x56'),'c',_0x24c6('0x57'))[_0x24c6('0x53')](_0x24c6('0x58'),'o',_0x24c6('0x59'))[_0x24c6('0x53')]('sms_accounts','a',_0x24c6('0x5a'))[_0x24c6('0x53')](_0x24c6('0x5b'),'me',_0x24c6('0x5c'))[_0x24c6('0x53')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')[_0x24c6('0x53')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x43b975=squel[_0x24c6('0x5d')]();var _0xd5a468=[];var _0x20783e=squel[_0x24c6('0x5d')]();var _0x1ced23;if(_0x398b2c[_0x24c6('0x42')][_0x24c6('0x5e')]){_0x1ced23=as['parseSearch'](_0x398b2c['query']['search']);var _0x26018c=_0x1ced23['sqlOperator'];for(var _0x115d87=0x0;_0x115d87<_0x1ced23[_0x24c6('0x5f')][_0x24c6('0x60')];_0x115d87++){var _0xfd9844=_0x1ced23[_0x24c6('0x5f')][_0x115d87];var _0x3b9653='i';var _0x3c9d0b=_[_0x24c6('0x61')](_0x3dbd05,['name',_0xfd9844[_0x24c6('0x4d')]]);if(!_0x3c9d0b){switch(_0xfd9844[_0x24c6('0x4d')]){case'unreadMessages':if(_0xfd9844['value']==0x1){_0x554d21[_0x24c6('0x62')]('`'+_0xfd9844[_0x24c6('0x4d')]+_0x24c6('0x63'));}else{_0x554d21[_0x24c6('0x62')]('`'+_0xfd9844['field']+'`\x20>\x200');}break;case'Contact':if(_0xfd9844[_0x24c6('0x64')]===_0x24c6('0x65')){if(_0xfd9844['value']['split']('\x20')[_0x24c6('0x60')]>0x1){_0x43b975[_0x26018c](_0x24c6('0x66'),qs[_0x24c6('0x67')](_0xfd9844['value']),null);}else{var _0x2cfc5b='%'+_0xfd9844['value']+'%';_0x43b975[_0x26018c](_0x24c6('0x68'),_0x2cfc5b,_0x2cfc5b,_0x2cfc5b);}}else{_0x3c9d0b=_['find'](_0x3dbd05,[_0x24c6('0x30'),'ContactId']);_0xfd9844['field']=_0x24c6('0x69');_0x45f2ee=as['buildExpression'](_0x3b9653,_0x3c9d0b[_0x24c6('0x3f')],_0xfd9844);_0x43b975[_0x26018c](_0x45f2ee['text'],_0x45f2ee[_0x24c6('0x6a')][_0x24c6('0x6b')],_0x45f2ee[_0x24c6('0x6a')][_0x24c6('0x2d')]);}break;case _0x24c6('0x6c'):var _0x477425=_0xfd9844['value'][_0x24c6('0x6d')](',')[_0x24c6('0x33')](function(_0x27c59b){return Number(_0x27c59b);});_0x477425[_0x24c6('0x35')](function(_0x37a244){_0x20783e['or'](_0x24c6('0x6e'),'%,'+_0x37a244+',%');});_0xd5a468=_[_0x24c6('0x6f')](_0xd5a468,_0x477425);break;case'User':if(_0xfd9844[_0x24c6('0x64')]===_0x24c6('0x65')){_0x43b975[_0x26018c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xfd9844[_0x24c6('0x6a')]+'%',null);}else{_0x3c9d0b=_[_0x24c6('0x61')](_0x3dbd05,[_0x24c6('0x30'),_0x24c6('0x3c')]);_0xfd9844[_0x24c6('0x4d')]=_0x24c6('0x3c');_0x45f2ee=as[_0x24c6('0x70')](_0x3b9653,_0x3c9d0b['type'],_0xfd9844);_0x43b975[_0x26018c](_0x45f2ee[_0x24c6('0x71')],_0x45f2ee[_0x24c6('0x6a')][_0x24c6('0x6b')],_0x45f2ee[_0x24c6('0x6a')][_0x24c6('0x2d')]);}break;case _0x24c6('0x72'):_0x45f2ee=as[_0x24c6('0x70')]('me',null,_0xfd9844);_0x43b975[_0x26018c](_0x45f2ee[_0x24c6('0x71')],_0x45f2ee[_0x24c6('0x6a')][_0x24c6('0x6b')],_0x45f2ee[_0x24c6('0x6a')][_0x24c6('0x2d')]);break;}}else{var _0x45f2ee=as[_0x24c6('0x70')](_0x3b9653,_0x3c9d0b[_0x24c6('0x3f')],_0xfd9844);_0x43b975[_0x26018c](_0x45f2ee[_0x24c6('0x71')],_0x45f2ee['value'][_0x24c6('0x6b')],_0x45f2ee[_0x24c6('0x6a')][_0x24c6('0x2d')]);}}}else{var _0x3a7e3f=_(_0x398b2c[_0x24c6('0x42')])['keys']()['map'](function(_0x3d7781){return _['some'](_0x3dbd05,[_0x24c6('0x30'),_0x3d7781])?_0x3d7781:undefined;})[_0x24c6('0x73')]()[_0x24c6('0x6a')]();if(!_[_0x24c6('0x74')](_0x3a7e3f)){_0x3a7e3f['forEach'](function(_0x7aca21){if(_0x7aca21==='SmsAccountId'){_0x554d21[_0x24c6('0x4a')]('i.SmsAccountId\x20IN\x20?',[][_0x24c6('0x75')](_0x398b2c[_0x24c6('0x42')][_0x7aca21]));}else if(_0x7aca21===_0x24c6('0x76')){var _0x5af2ae=JSON[_0x24c6('0x77')](_0x398b2c[_0x24c6('0x42')][_0x7aca21])[_0x24c6('0x78')];var _0x1662e4=JSON['parse'](_0x398b2c[_0x24c6('0x42')][_0x7aca21])['$lte'];_0x554d21[_0x24c6('0x4a')](_0x24c6('0x79'),_0x5af2ae,_0x1662e4);}else{if(_0x398b2c['query'][_0x7aca21]===_0x24c6('0x7a')){_0x554d21['where']('i.'+_0x7aca21+_0x24c6('0x7b'));}else{_0x554d21[_0x24c6('0x4a')]('i.'+_0x7aca21+'\x20=\x20?',_0x398b2c[_0x24c6('0x42')][_0x7aca21]);}}});}if(_0x398b2c[_0x24c6('0x42')][_0x24c6('0x7c')]){if(_0x398b2c['query']['read']==0x1){_0x554d21[_0x24c6('0x62')]('`unreadMessages`\x20=\x200');}else{_0x554d21[_0x24c6('0x62')](_0x24c6('0x7d'));}}if(_0x398b2c[_0x24c6('0x42')][_0x24c6('0x7e')]){_0xd5a468=_['isArray'](_0x398b2c['query'][_0x24c6('0x7e')])?_0x398b2c[_0x24c6('0x42')][_0x24c6('0x7e')]:new Array(_0x398b2c[_0x24c6('0x42')][_0x24c6('0x7e')]);_0xd5a468[_0x24c6('0x35')](function(_0x6de843){_0x20783e['or'](_0x24c6('0x6e'),'%,'+_0x6de843+',%');});}if(_0x398b2c[_0x24c6('0x42')]['filter']){var _0x144515=_0x398b2c['query'][_0x24c6('0x7f')]['replace']('\x5c','\x5c\x5c')[_0x24c6('0x80')](/'/g,'\x27\x27');if(qs[_0x24c6('0x81')](_0x144515)){_0x43b975['or'](_0x24c6('0x82'),_0x144515+'%')['or']('i.phone\x20LIKE\x20?',_0x144515+'%');}else{_0x43b975['or'](_0x24c6('0x83'),qs[_0x24c6('0x67')](_0x144515))['or'](_0x24c6('0x84'),_0x144515+'%');}}}_0x554d21[_0x24c6('0x4a')](_0x43b975);_0x554d21[_0x24c6('0x85')]('i.id');var _0x49805b={'type':db['Sequelize'][_0x24c6('0x86')][_0x24c6('0x87')],'raw':!![]};var _0x22e17b=_0x554d21[_0x24c6('0x88')]();_0x22e17b['field'](_0x24c6('0x89'));_0x22e17b[_0x24c6('0x4d')](_0x24c6('0x8a'),_0x24c6('0x8b'));if(_0x409ded[_0x24c6('0x8c')]){_0x409ded['order'][_0x24c6('0x35')](function(_0x2828f0){var _0x5c40f1=_0x2828f0[0x0]===_0x24c6('0x8d')?_0x2828f0[0x0]:'i.'+_0x2828f0[0x0];_0x554d21[_0x24c6('0x8c')](_0x5c40f1,_0x2828f0[0x1]===_0x24c6('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0xd5a468)){_0x554d21['having'](_0x20783e);_0x22e17b[_0x24c6('0x4a')](_0x24c6('0x8f'),_0xd5a468);}BPromise[_0x24c6('0x90')]()[_0x24c6('0x2c')](function(){if(!_0x1ced23){if(_0x398b2c[_0x24c6('0x42')][_0x24c6('0x91')])return;_0x22e17b[_0x24c6('0x4a')](_0x24c6('0x92'));_0x554d21[_0x24c6('0x4a')](_0x24c6('0x92'));return;}if(_0x398b2c['user'][_0x24c6('0x93')]!==_0x24c6('0x94'))return;return _0x398b2c[_0x24c6('0x95')][_0x24c6('0x96')]({'attributes':['id'],'raw':!![]})[_0x24c6('0x2c')](function(_0x10eea1){if(_['isEmpty'](_0x10eea1)){_0x22e17b[_0x24c6('0x4a')](_0x24c6('0x97'));_0x554d21[_0x24c6('0x4a')](_0x24c6('0x97'));}else{_0x22e17b[_0x24c6('0x4a')](_0x24c6('0x98'),_[_0x24c6('0x33')](_0x10eea1,'id'));_0x554d21[_0x24c6('0x4a')]('i.SmsAccountId\x20IN\x20?',_[_0x24c6('0x33')](_0x10eea1,'id'));}});})[_0x24c6('0x2c')](function(){if(_0x398b2c[_0x24c6('0x95')][_0x24c6('0x93')]===_0x24c6('0x94')&&!_0x1ced23&&!_0x398b2c[_0x24c6('0x42')]['SmsAccountId'])return[];return db[_0x24c6('0x99')][_0x24c6('0x42')](_0x22e17b[_0x24c6('0x9a')](),_0x49805b);})[_0x24c6('0x2c')](function(_0x200d6a){_0x28f1d4[_0x24c6('0x23')]=_0x200d6a['length'];if(_0x28f1d4[_0x24c6('0x23')]===0x0)return[];return db['sequelize'][_0x24c6('0x42')](_0x443329[_0x24c6('0x9a')](),_0x49805b)[_0x24c6('0x2c')](function(_0x34c61e){_0x58220=_[_0x24c6('0x9b')](_0x34c61e,'id');_0x49805b=_[_0x24c6('0x9c')](_0x49805b,{'model':db[_0x24c6('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x398b2c[_0x24c6('0x42')][_0x24c6('0x45')]){_0x409ded[_0x24c6('0x46')]['forEach'](function(_0x149356){_0x554d21[_0x24c6('0x4d')]('i.'+_0x149356);});}else{_0x554d21[_0x24c6('0x4d')](_0x24c6('0x8a'),'unreadMessages');_0x554d21[_0x24c6('0x4d')](_0x24c6('0x9d'),_0x24c6('0x9e'));_0x554d21[_0x24c6('0x4d')](_0x24c6('0x9f'),_0x24c6('0xa0'));_0x554d21[_0x24c6('0x4d')](_0x24c6('0xa1'),_0x24c6('0x8d'));_0x554d21[_0x24c6('0x4d')]('i.*');_0x554d21[_0x24c6('0x4d')]('c.firstName',_0x24c6('0xa2'));_0x554d21[_0x24c6('0x4d')](_0x24c6('0xa3'),_0x24c6('0xa4'));_0x554d21['field'](_0x24c6('0xa5'),'Contact.email');_0x554d21[_0x24c6('0x4d')](_0x24c6('0xa6'),_0x24c6('0xa7'));_0x554d21['field'](_0x24c6('0xa8'),_0x24c6('0xa9'));_0x554d21[_0x24c6('0x4d')](_0x24c6('0xaa'),_0x24c6('0xab'));_0x554d21[_0x24c6('0x4d')](_0x24c6('0xac'),_0x24c6('0xad'));_0x554d21[_0x24c6('0x4d')](_0x24c6('0xae'),_0x24c6('0xaf'));_0x554d21[_0x24c6('0x4d')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x409ded[_0x24c6('0x25')])_0x554d21[_0x24c6('0x25')](_0x409ded[_0x24c6('0x25')]);if(_0x409ded[_0x24c6('0x24')])_0x554d21['offset'](_0x409ded['offset']);return db[_0x24c6('0x99')][_0x24c6('0x42')](_0x554d21[_0x24c6('0x9a')](),_0x49805b);})['then'](function(_0x163f92){if(_0x163f92['length']>0x0)_0x1acb14[_0x24c6('0x4a')](_0x24c6('0xb0'),_[_0x24c6('0x33')](_0x163f92,'id'));return db['sequelize'][_0x24c6('0x42')](_0x1acb14[_0x24c6('0x9a')](),_0x49805b)[_0x24c6('0x2c')](function(_0x5490d8){var _0x2c0e3b=_['groupBy'](_0x5490d8,'SmsInteractionId');var _0x531ea7=[];_0x163f92[_0x24c6('0x35')](function(_0xf60d62){_0x531ea7['push'](updateSmsInteraction(_0xf60d62,_0x58220,_0x2c0e3b));});return BPromise['all'](_0x531ea7);});});})[_0x24c6('0x2c')](function(_0x31a21f){_0x28f1d4[_0x24c6('0xb1')]=_0x31a21f;return _0x28f1d4;})[_0x24c6('0x2c')](respondWithFilteredResult(_0x2eeb5d,_0x409ded))[_0x24c6('0xb2')](handleError(_0x2eeb5d,null));};exports['show']=function(_0x2df427,_0x2eb606){var _0x2eb564={'raw':![],'where':{'id':_0x2df427[_0x24c6('0xb3')]['id']}},_0x2952f6={};_0x2952f6[_0x24c6('0x41')]=_['keys'](db[_0x24c6('0x3e')][_0x24c6('0xb4')]);_0x2952f6[_0x24c6('0x42')]=_[_0x24c6('0xb5')](_0x2df427['query']);_0x2952f6[_0x24c6('0x43')]=_[_0x24c6('0x44')](_0x2952f6[_0x24c6('0x41')],_0x2952f6[_0x24c6('0x42')]);_0x2eb564[_0x24c6('0x46')]=_['intersection'](_0x2952f6[_0x24c6('0x41')],qs[_0x24c6('0x45')](_0x2df427[_0x24c6('0x42')][_0x24c6('0x45')]));_0x2eb564[_0x24c6('0x46')]=_0x2eb564['attributes'][_0x24c6('0x60')]?_0x2eb564[_0x24c6('0x46')]:_0x2952f6[_0x24c6('0x41')];if(_0x2df427['query']['includeAll']){_0x2eb564[_0x24c6('0xb6')]=[{'all':!![]}];}_0x2eb564=_['merge']({},_0x2eb564,_0x2df427['options']);return db['SmsInteraction'][_0x24c6('0x61')](_0x2eb564)[_0x24c6('0x2c')](handleEntityNotFound(_0x2eb606,null))['then'](respondWithResult(_0x2eb606,null))['catch'](handleError(_0x2eb606,null));};exports[_0x24c6('0xb7')]=function(_0x32f44f,_0x26cdb5){return db['SmsInteraction'][_0x24c6('0xb7')](_0x32f44f[_0x24c6('0x72')],{})[_0x24c6('0x2c')](respondWithResult(_0x26cdb5,0xc9))[_0x24c6('0xb2')](handleError(_0x26cdb5,null));};exports[_0x24c6('0x2b')]=function(_0x3f4d43,_0x5aa7d3){if(_0x3f4d43['body']['id']){delete _0x3f4d43[_0x24c6('0x72')]['id'];}return db[_0x24c6('0x3e')]['find']({'where':{'id':_0x3f4d43[_0x24c6('0xb3')]['id']}})[_0x24c6('0x2c')](handleEntityNotFound(_0x5aa7d3,null))[_0x24c6('0x2c')](saveUpdates(_0x3f4d43[_0x24c6('0x72')],null))[_0x24c6('0x2c')](respondWithResult(_0x5aa7d3,null))[_0x24c6('0xb2')](handleError(_0x5aa7d3,null));};exports[_0x24c6('0xb8')]=function(_0x3aacc7,_0x3462df){return db['SmsInteraction']['find']({'where':{'id':_0x3aacc7[_0x24c6('0xb3')]['id']}})[_0x24c6('0x2c')](handleEntityNotFound(_0x3462df,null))[_0x24c6('0x2c')](removeEntity(_0x3462df,null))[_0x24c6('0xb2')](handleError(_0x3462df,null));};exports[_0x24c6('0xb9')]=function(_0x3d5b35,_0x579519){return db[_0x24c6('0x3e')]['describe']()[_0x24c6('0x2c')](respondWithResult(_0x579519,null))['catch'](handleError(_0x579519,null));};exports[_0x24c6('0xba')]=function(_0x3eb1c7,_0x3244a8,_0x41b1ec){return db[_0x24c6('0xbb')][_0x24c6('0x61')]({'where':{'id':_0x3eb1c7['params']['id']}})[_0x24c6('0x2c')](handleEntityNotFound(_0x3244a8,null))[_0x24c6('0x2c')](function(_0x548d7b){if(_0x548d7b){return _0x548d7b[_0x24c6('0xba')](_0x3eb1c7[_0x24c6('0x72')][_0x24c6('0xbc')],_[_0x24c6('0xbd')](_0x3eb1c7[_0x24c6('0x72')],['ids','id'])||{});}})['then'](respondWithResult(_0x3244a8,null))[_0x24c6('0xb2')](handleError(_0x3244a8,null));};exports[_0x24c6('0xbe')]=function(_0x499a13,_0xfa5bd6,_0xa7a7ba){var _0x1c6aa8={'raw':![],'where':{}};var _0x5b607f={};var _0x5afc6d={'count':0x0,'rows':[]};return db[_0x24c6('0x3e')]['findOne']({'where':{'id':_0x499a13[_0x24c6('0xb3')]['id']}})[_0x24c6('0x2c')](handleEntityNotFound(_0xfa5bd6,null))[_0x24c6('0x2c')](function(_0x1b498c){if(_0x1b498c){_0x5b607f[_0x24c6('0x41')]=_[_0x24c6('0xb5')](db[_0x24c6('0xbb')][_0x24c6('0xb4')]);_0x5b607f[_0x24c6('0x42')]=_['keys'](_0x499a13[_0x24c6('0x42')]);_0x5b607f[_0x24c6('0x43')]=_[_0x24c6('0x44')](_0x5b607f[_0x24c6('0x41')],_0x5b607f[_0x24c6('0x42')]);_0x1c6aa8['attributes']=_[_0x24c6('0x44')](_0x5b607f['model'],qs[_0x24c6('0x45')](_0x499a13[_0x24c6('0x42')][_0x24c6('0x45')]));_0x1c6aa8[_0x24c6('0x46')]=_0x1c6aa8[_0x24c6('0x46')][_0x24c6('0x60')]?_0x1c6aa8[_0x24c6('0x46')]:_0x5b607f[_0x24c6('0x41')];if(!_0x499a13[_0x24c6('0x42')][_0x24c6('0x47')](_0x24c6('0x48'))){_0x1c6aa8[_0x24c6('0x25')]=qs[_0x24c6('0x25')](_0x499a13[_0x24c6('0x42')][_0x24c6('0x25')]);_0x1c6aa8[_0x24c6('0x24')]=qs['offset'](_0x499a13[_0x24c6('0x42')]['offset']);}_0x1c6aa8[_0x24c6('0x8c')]=qs[_0x24c6('0x49')](_0x499a13[_0x24c6('0x42')][_0x24c6('0x49')]);_0x1c6aa8['where']=qs[_0x24c6('0x43')](_['pick'](_0x499a13[_0x24c6('0x42')],_0x5b607f['filters']));_0x1c6aa8[_0x24c6('0x4a')][_0x24c6('0xbf')]=_0x1b498c['id'];if(_0x499a13[_0x24c6('0x42')][_0x24c6('0x7f')]){_0x1c6aa8[_0x24c6('0x4a')]=_[_0x24c6('0x9c')](_0x1c6aa8[_0x24c6('0x4a')],{'$or':_[_0x24c6('0x33')](_0x1c6aa8[_0x24c6('0x46')],function(_0x45b648){var _0x2c9801={};_0x2c9801[_0x45b648]={'$like':'%'+_0x499a13[_0x24c6('0x42')]['filter']+'%'};return _0x2c9801;})});}if(_0x499a13['query']['$gte']){var _0x6b50e0=_0x499a13[_0x24c6('0x42')]['$gte'][_0x24c6('0x6d')](',');var _0x233e80={};_0x233e80[_0x6b50e0[0x0]]={'$gte':moment(_0x6b50e0[0x1])[_0x24c6('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1c6aa8['where']=_[_0x24c6('0x9c')](_0x1c6aa8[_0x24c6('0x4a')],_0x233e80);}_0x1c6aa8=_[_0x24c6('0x9c')]({},_0x1c6aa8,_0x499a13['options']);return db['SmsMessage']['count']({'where':_0x1c6aa8[_0x24c6('0x4a')]})[_0x24c6('0x2c')](function(_0x11257e){_0x5afc6d['count']=_0x11257e;if(_0x499a13[_0x24c6('0x42')][_0x24c6('0xc1')]){_0x1c6aa8[_0x24c6('0xb6')]=[{'all':!![]}];}return db[_0x24c6('0xbb')][_0x24c6('0xc2')](_0x1c6aa8);})['then'](function(_0x2564af){_0x5afc6d[_0x24c6('0xb1')]=_0x2564af;return _0x5afc6d;});}})['then'](respondWithFilteredResult(_0xfa5bd6,_0x1c6aa8))[_0x24c6('0xb2')](handleError(_0xfa5bd6,null));};exports[_0x24c6('0xc3')]=function(_0x57fcf2,_0x19fc6d,_0x24c4ac){return db[_0x24c6('0x3e')][_0x24c6('0x61')]({'where':{'id':_0x57fcf2['params']['id']}})['then'](handleEntityNotFound(_0x19fc6d,null))[_0x24c6('0x2c')](function(_0x41f834){if(_0x41f834){return _0x41f834[_0x24c6('0xc4')](_0x57fcf2[_0x24c6('0x72')][_0x24c6('0xbc')],_[_0x24c6('0xbd')](_0x57fcf2[_0x24c6('0x72')],[_0x24c6('0xbc'),'id'])||{})[_0x24c6('0xc5')](function(){return db['Tag'][_0x24c6('0xc2')]({'attributes':['id',_0x24c6('0x30'),_0x24c6('0x4e')],'where':{'id':_0x57fcf2[_0x24c6('0x72')][_0x24c6('0xbc')]}});})[_0x24c6('0x2c')](function(_0x4030c8){socket[_0x24c6('0xc6')](_0x24c6('0xc7'),{'id':Number(_0x57fcf2[_0x24c6('0xb3')]['id']),'tags':_0x4030c8||[]});return{'id':Number(_0x57fcf2[_0x24c6('0xb3')]['id']),'tags':_0x4030c8||[]};});}})[_0x24c6('0x2c')](respondWithResult(_0x19fc6d,null))[_0x24c6('0xb2')](handleError(_0x19fc6d,null));};exports[_0x24c6('0xc8')]=function(_0x2c9d61,_0x573775,_0x5b46bd){return db['SmsInteraction'][_0x24c6('0x61')]({'where':{'id':_0x2c9d61[_0x24c6('0xb3')]['id']}})[_0x24c6('0x2c')](handleEntityNotFound(_0x573775,null))[_0x24c6('0x2c')](function(_0x3e1363){if(_0x3e1363){return _0x3e1363[_0x24c6('0xc8')](_0x2c9d61[_0x24c6('0x42')][_0x24c6('0xbc')]);}})['then'](respondWithStatusCode(_0x573775,null))[_0x24c6('0xb2')](handleError(_0x573775,null));};exports[_0x24c6('0xc9')]=function(_0x33e335,_0x3bf94d){var _0x1bc93c=moment()[_0x24c6('0xca')]()[_0x24c6('0x9a')]();var _0xa1a083=path['join'](config[_0x24c6('0xcb')],_0x24c6('0xcc'),'files',_0x24c6('0xcd'));var _0x352cea=path[_0x24c6('0xce')](config[_0x24c6('0xcb')],_0x24c6('0xcc'),_0x24c6('0xcf'),_0x24c6('0xd0'));var _0x378e42=path[_0x24c6('0xce')](_0xa1a083,_0x1bc93c);var _0x118d52=util[_0x24c6('0xc0')](_0x24c6('0xd1'),_0x33e335[_0x24c6('0xb3')]['id'],_0x1bc93c);var _0x315bbc=path[_0x24c6('0xce')](_0xa1a083,_0x118d52);var _0x95045e=[];_0x95045e[_0x24c6('0xd2')]({'model':db[_0x24c6('0xd3')],'as':'User','attributes':['id',_0x24c6('0xd4')],'raw':!![]});_0x95045e[_0x24c6('0xd2')]({'model':db[_0x24c6('0xd5')],'as':_0x24c6('0xd6'),'attributes':['id',_0x24c6('0xd7'),_0x24c6('0xd8')],'raw':!![]});var _0x5cdacd=[{'model':db[_0x24c6('0xbb')],'as':_0x24c6('0xd9'),'attributes':['id','body',_0x24c6('0x76'),_0x24c6('0xda'),'secret',_0x24c6('0x7c')],'include':_0x95045e}];_0x5cdacd[_0x24c6('0xd2')]({'model':db[_0x24c6('0xdb')],'as':'Account','attributes':['id',_0x24c6('0x30')]});_0x5cdacd[_0x24c6('0xd2')]({'model':db[_0x24c6('0xd3')],'as':_0x24c6('0xdc'),'attributes':['id','fullname']});return db['SmsInteraction'][_0x24c6('0x61')]({'where':{'id':_0x33e335[_0x24c6('0xb3')]['id']},'include':_0x5cdacd})[_0x24c6('0x2c')](handleEntityNotFound(_0x3bf94d,null))['then'](function(_0x59cc12){if(_0x59cc12){var _0x5a7627=_0x59cc12['get']({'plain':!![]});fs[_0x24c6('0xdd')](_0x378e42);var _0x52d6fb={'channel':_0x24c6('0xde'),'account':_0x5a7627[_0x24c6('0xdf')][_0x24c6('0x30')],'agent':_0x5a7627[_0x24c6('0xdc')]?_0x5a7627[_0x24c6('0xdc')][_0x24c6('0xd4')]:_0x24c6('0xe0'),'createdAt':moment(_0x5a7627[_0x24c6('0x76')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x24c6('0x9a')](),'closedAt':_0x5a7627[_0x24c6('0x3b')]?moment(_0x5a7627['closedAt'])['format'](_0x24c6('0xe1'))['toString']():'','disposition':_0x5a7627[_0x24c6('0xe2')],'messages':_(_0x5a7627[_0x24c6('0xd9')])['filter']({'secret':![]})['map'](function(_0x25f6a1){return{'date':moment(_0x25f6a1[_0x24c6('0x76')])['format'](_0x24c6('0xe1'))[_0x24c6('0x9a')](),'sender':_0x25f6a1['direction']==='out'?_0x25f6a1[_0x24c6('0xd3')]?_0x25f6a1[_0x24c6('0xd3')][_0x24c6('0xd4')]:'System':_0x25f6a1[_0x24c6('0xd6')][_0x24c6('0xd7')]+(_0x25f6a1[_0x24c6('0xd6')]['lastName']?'\x20'+_0x25f6a1[_0x24c6('0xd6')][_0x24c6('0xd8')]:''),'body':_0x25f6a1[_0x24c6('0x72')],'direction':_0x25f6a1['direction']===_0x24c6('0xe3')?'A':'C','secret':_0x25f6a1[_0x24c6('0xe4')],'read':_0x25f6a1[_0x24c6('0x7c')]};})[_0x24c6('0x6a')]()};return ejs['renderFile'](path[_0x24c6('0xce')](config[_0x24c6('0xcb')],_0x24c6('0xcc'),_0x24c6('0xe5'),_0x24c6('0xe6')),{'interaction':_0x52d6fb})[_0x24c6('0x2c')](function(_0x106f4f){var _0x4d9d94=path['join'](_0x378e42,_0x24c6('0xe7')+_0x5a7627['id']+'-'+_0x1bc93c+_0x24c6('0xe8'));var _0x90b513={'path':_0x4d9d94,'channel':'Sms','interactionId':_0x5a7627['id']};return pdf[_0x24c6('0xe9')](_0x106f4f,_0x90b513);})[_0x24c6('0x2c')](function(){return new BPromise(function(_0x15c229,_0x27f035){zipdir(_0x378e42,{'saveTo':_0x315bbc},function(_0x2d98c4,_0x1dad66){if(_0x2d98c4)return _0x27f035(_0x2d98c4);return _0x15c229(_0x1dad66);});})[_0x24c6('0x2c')](function(){return new BPromise(function(_0x57ac7e,_0x485ee6){rimraf(_0x378e42,function(_0xd25c5e){if(_0xd25c5e)_0x485ee6(_0xd25c5e);return _0x57ac7e();});});})['then'](function(){return _0x3bf94d['download'](_0x315bbc,_0x118d52,function(_0x525f5c){if(_0x525f5c){console[_0x24c6('0xea')]('err',_0x525f5c);}else{fs[_0x24c6('0xeb')](_0x315bbc);}});});});}else{return _0x3bf94d[_0x24c6('0x1f')](0xc8);}})[_0x24c6('0xb2')](handleError(_0x3bf94d,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 65584c5..98b92a1 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 _0xdb28=['Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','setDataValue'];(function(_0x27fdcc,_0x421cb5){var _0x17c2de=function(_0x2fa372){while(--_0x2fa372){_0x27fdcc['push'](_0x27fdcc['shift']());}};_0x17c2de(++_0x421cb5);}(_0xdb28,0x106));var _0x8db2=function(_0x1f0ebc,_0x586628){_0x1f0ebc=_0x1f0ebc-0x0;var _0x239258=_0xdb28[_0x1f0ebc];return _0x239258;};'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 +var _0x0b0e=['update','remove','getUsers','then','Users','map','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','events','SmsInteraction','SmsMessage','setMaxListeners','save'];(function(_0x6424be,_0x1f321d){var _0x473f01=function(_0x2fa3f3){while(--_0x2fa3f3){_0x6424be['push'](_0x6424be['shift']());}};_0x473f01(++_0x1f321d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x503641,_0x33a3cf){_0x503641=_0x503641-0x0;var _0x17757d=_0x0b0e[_0x503641];return _0x17757d;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xe0b0('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0xe0b0('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xe0b0('0x3')](0x0);var events={'afterCreate':_0xe0b0('0x4'),'afterUpdate':_0xe0b0('0x5'),'afterDestroy':_0xe0b0('0x6')};function emitEvent(_0x38a058){return function(_0x399e67,_0x185efa,_0x30e20d){_0x399e67[_0xe0b0('0x7')]({'attributes':['id'],'raw':!![]})[_0xe0b0('0x8')](function(_0x5cf9cc){_0x399e67['setDataValue'](_0xe0b0('0x9'),_0x5cf9cc[_0xe0b0('0xa')](function(_0xc4a085){return{'id':_0xc4a085['id']};}));return SmsMessage[_0xe0b0('0xb')]({'where':{'SmsInteractionId':_0x399e67['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x338e7c){_0x399e67[_0xe0b0('0xc')]('unreadMessages',_0x338e7c[_0xe0b0('0xd')]);SmsInteractionEvents[_0xe0b0('0xe')](_0x38a058+':'+_0x399e67['id'],_0x399e67);SmsInteractionEvents['emit'](_0x38a058,_0x399e67);_0x30e20d(null);})[_0xe0b0('0xf')](_0x30e20d(null));};}for(var e in events){if(events[_0xe0b0('0x10')](e)){var event=events[e];SmsInteraction[_0xe0b0('0x11')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index ec0d090..2f1f947 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 _0x992c=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','SmsInteraction','sms_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','util'];(function(_0x1f713b,_0x1e789f){var _0x534b7f=function(_0x8b7189){while(--_0x8b7189){_0x1f713b['push'](_0x1f713b['shift']());}};_0x534b7f(++_0x1e789f);}(_0x992c,0x192));var _0xc992=function(_0x183784,_0x2f59f6){_0x183784=_0x183784-0x0;var _0x243c8d=_0x992c[_0x183784];return _0x243c8d;};'use strict';var _=require('lodash');var util=require(_0xc992('0x0'));var logger=require(_0xc992('0x1'))(_0xc992('0x2'));var moment=require(_0xc992('0x3'));var BPromise=require('bluebird');var rp=require(_0xc992('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc992('0x5'));var config=require(_0xc992('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x6a991b,_0x1af249){return _0x6a991b[_0xc992('0x7')](_0xc992('0x8'),attributes,{'tableName':_0xc992('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x40e881,_0x323ac8,_0x4493be){if(_0x40e881[_0xc992('0xa')]('closed')){_0x40e881['closedAt']=moment()[_0xc992('0xb')](_0xc992('0xc'));}_0x4493be(null,_0x40e881);}}});}; \ No newline at end of file +var _0x61b4=['../../config/environment','exports','SmsInteraction','sms_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','bluebird','rimraf'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x61b4,0x104));var _0x461b=function(_0x5a58ee,_0x199e4f){_0x5a58ee=_0x5a58ee-0x0;var _0x3ff64a=_0x61b4[_0x5a58ee];return _0x3ff64a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x461b('0x0'))(_0x461b('0x1'));var moment=require('moment');var BPromise=require(_0x461b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x461b('0x3'));var config=require(_0x461b('0x4'));var attributes=require('./smsInteraction.attributes');module[_0x461b('0x5')]=function(_0x1a7857,_0x4107f3){return _0x1a7857['define'](_0x461b('0x6'),attributes,{'tableName':_0x461b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5e3281,_0x5dcaee,_0x22d099){if(_0x5e3281[_0x461b('0x8')](_0x461b('0x9'))){_0x5e3281['closedAt']=moment()[_0x461b('0xa')](_0x461b('0xb'));}_0x22d099(null,_0x5e3281);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index d5eb0ab..b7f1bd6 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 _0x0284=['SmsInteraction,\x20%s,\x20%s','message','catch','update','body','options','where','attributes','limit','then','UpdateSmsInteraction','debug','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','stringify','error'];(function(_0x5f10be,_0x3d4704){var _0x3344fe=function(_0xcd14ff){while(--_0xcd14ff){_0x5f10be['push'](_0x5f10be['shift']());}};_0x3344fe(++_0x3d4704);}(_0x0284,0x143));var _0x4028=function(_0x52c4e9,_0x5412d0){_0x52c4e9=_0x52c4e9-0x0;var _0x252a03=_0x0284[_0x52c4e9];return _0x252a03;};'use strict';var _=require(_0x4028('0x0'));var util=require(_0x4028('0x1'));var moment=require(_0x4028('0x2'));var BPromise=require(_0x4028('0x3'));var rs=require(_0x4028('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4028('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4028('0x6'));var config=require(_0x4028('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4028('0x8')][_0x4028('0x9')]({'port':0x232a});config[_0x4028('0xa')]=_['defaults'](config[_0x4028('0xa')],{'host':_0x4028('0xb'),'port':0x18eb});var socket=require(_0x4028('0xc'))(new Redis(config[_0x4028('0xa')]));require('./smsInteraction.socket')[_0x4028('0xd')](socket);function respondWithRpcPromise(_0x3d4f69,_0x5ad2aa,_0x29decc){return new BPromise(function(_0x1e0fbd,_0x14ae63){return client[_0x4028('0xe')](_0x3d4f69,_0x29decc)['then'](function(_0xcf27fb){logger[_0x4028('0xf')]('SmsInteraction,\x20%s,\x20%s',_0x5ad2aa,_0x4028('0x10'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x5ad2aa,_0x4028('0x10'),JSON[_0x4028('0x11')](_0xcf27fb));if(_0xcf27fb['error']){if(_0xcf27fb['error']['code']===0x1f4){logger[_0x4028('0x12')](_0x4028('0x13'),_0x5ad2aa,_0xcf27fb['error']['message']);return _0x14ae63(_0xcf27fb[_0x4028('0x12')]['message']);}logger[_0x4028('0x12')](_0x4028('0x13'),_0x5ad2aa,_0xcf27fb['error']['message']);return _0x1e0fbd(_0xcf27fb['error']['message']);}else{logger[_0x4028('0xf')](_0x4028('0x13'),_0x5ad2aa,_0x4028('0x10'));_0x1e0fbd(_0xcf27fb['result'][_0x4028('0x14')]);}})[_0x4028('0x15')](function(_0xca5226){logger[_0x4028('0x12')](_0x4028('0x13'),_0x5ad2aa,_0xca5226);_0x14ae63(_0xca5226);});});}exports['UpdateSmsInteraction']=function(_0xb303ad){var _0x464877=this;return new Promise(function(_0x2eaefd,_0x46013e){return db['SmsInteraction'][_0x4028('0x16')](_0xb303ad[_0x4028('0x17')],{'raw':_0xb303ad[_0x4028('0x18')]?_0xb303ad['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb303ad[_0x4028('0x18')]?_0xb303ad[_0x4028('0x18')][_0x4028('0x19')]||null:null,'attributes':_0xb303ad[_0x4028('0x18')]?_0xb303ad['options'][_0x4028('0x1a')]||null:null,'limit':_0xb303ad[_0x4028('0x18')]?_0xb303ad[_0x4028('0x18')][_0x4028('0x1b')]||null:null})[_0x4028('0x1c')](function(_0x5d1a0e){logger['info'](_0x4028('0x1d'),_0xb303ad);logger[_0x4028('0x1e')](_0x4028('0x1d'),_0xb303ad,JSON['stringify'](_0x5d1a0e));_0x2eaefd(_0x5d1a0e);})[_0x4028('0x15')](function(_0x5713c1){logger['error'](_0x4028('0x1d'),_0x5713c1[_0x4028('0x14')],_0xb303ad);_0x46013e(_0x464877[_0x4028('0x12')](0x1f4,_0x5713c1['message']));});});};exports[_0x4028('0x1f')]=function(_0x46f5e5){return new Promise(function(_0x3b43bd,_0x4dbdec){return db['SmsInteraction'][_0x4028('0x20')]({'where':_0x46f5e5[_0x4028('0x18')]?_0x46f5e5[_0x4028('0x18')]['where']||null:null})[_0x4028('0x1c')](function(_0x21c9bb){if(_0x21c9bb){return _0x21c9bb[_0x4028('0x21')](_0x46f5e5['body'][_0x4028('0x22')],_[_0x4028('0x23')](_0x46f5e5[_0x4028('0x17')],['ids','id'])||{});}})[_0x4028('0x24')](function(_0x31272){logger['info'](_0x4028('0x25'),_0x46f5e5);logger[_0x4028('0x1e')](_0x4028('0x25'),_0x46f5e5,JSON[_0x4028('0x11')](_0x31272));_0x3b43bd(_0x31272);})[_0x4028('0x15')](function(_0x3aa867){logger[_0x4028('0x12')]('AddTags',_0x3aa867[_0x4028('0x14')],_0x46f5e5);_0x4dbdec(_this[_0x4028('0x12')](0x1f4,_0x3aa867[_0x4028('0x14')]));});});}; \ No newline at end of file +var _0x818d=['request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','AddTagsToSmsInteraction','find','ids','omit','AddTags','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register'];(function(_0x1415ef,_0x5c219e){var _0x234acc=function(_0x2dbfca){while(--_0x2dbfca){_0x1415ef['push'](_0x1415ef['shift']());}};_0x234acc(++_0x5c219e);}(_0x818d,0x182));var _0xd818=function(_0x22aa61,_0x45e107){_0x22aa61=_0x22aa61-0x0;var _0x51500a=_0x818d[_0x22aa61];return _0x51500a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd818('0x0'));var BPromise=require('bluebird');var rs=require(_0xd818('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd818('0x2'))['db'];var utils=require(_0xd818('0x3'));var logger=require(_0xd818('0x4'))(_0xd818('0x5'));var config=require(_0xd818('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd818('0x7')][_0xd818('0x8')]({'port':0x232a});config[_0xd818('0x9')]=_['defaults'](config[_0xd818('0x9')],{'host':_0xd818('0xa'),'port':0x18eb});var socket=require(_0xd818('0xb'))(new Redis(config[_0xd818('0x9')]));require(_0xd818('0xc'))[_0xd818('0xd')](socket);function respondWithRpcPromise(_0x35a5af,_0xa41353,_0x2374ac){return new BPromise(function(_0x1613c3,_0x5c340d){return client[_0xd818('0xe')](_0x35a5af,_0x2374ac)[_0xd818('0xf')](function(_0x13d312){logger[_0xd818('0x10')](_0xd818('0x11'),_0xa41353,_0xd818('0x12'));logger[_0xd818('0x13')](_0xd818('0x14'),_0xa41353,_0xd818('0x12'),JSON[_0xd818('0x15')](_0x13d312));if(_0x13d312[_0xd818('0x16')]){if(_0x13d312[_0xd818('0x16')][_0xd818('0x17')]===0x1f4){logger[_0xd818('0x16')](_0xd818('0x11'),_0xa41353,_0x13d312['error'][_0xd818('0x18')]);return _0x5c340d(_0x13d312[_0xd818('0x16')][_0xd818('0x18')]);}logger['error'](_0xd818('0x11'),_0xa41353,_0x13d312['error']['message']);return _0x1613c3(_0x13d312[_0xd818('0x16')][_0xd818('0x18')]);}else{logger['info'](_0xd818('0x11'),_0xa41353,_0xd818('0x12'));_0x1613c3(_0x13d312[_0xd818('0x19')]['message']);}})[_0xd818('0x1a')](function(_0x14129f){logger[_0xd818('0x16')](_0xd818('0x11'),_0xa41353,_0x14129f);_0x5c340d(_0x14129f);});});}exports[_0xd818('0x1b')]=function(_0x105710){var _0x5e8d8a=this;return new Promise(function(_0x38588f,_0x17aee3){return db[_0xd818('0x1c')][_0xd818('0x1d')](_0x105710[_0xd818('0x1e')],{'raw':_0x105710[_0xd818('0x1f')]?_0x105710['options'][_0xd818('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x105710['options']?_0x105710[_0xd818('0x1f')][_0xd818('0x21')]||null:null,'attributes':_0x105710[_0xd818('0x1f')]?_0x105710[_0xd818('0x1f')]['attributes']||null:null,'limit':_0x105710[_0xd818('0x1f')]?_0x105710[_0xd818('0x1f')][_0xd818('0x22')]||null:null})[_0xd818('0xf')](function(_0x3b409d){logger['info'](_0xd818('0x1b'),_0x105710);logger['debug'](_0xd818('0x1b'),_0x105710,JSON[_0xd818('0x15')](_0x3b409d));_0x38588f(_0x3b409d);})[_0xd818('0x1a')](function(_0x182c68){logger[_0xd818('0x16')](_0xd818('0x1b'),_0x182c68[_0xd818('0x18')],_0x105710);_0x17aee3(_0x5e8d8a[_0xd818('0x16')](0x1f4,_0x182c68[_0xd818('0x18')]));});});};exports[_0xd818('0x23')]=function(_0x549cb9){return new Promise(function(_0x4c8658,_0x50a0dc){return db[_0xd818('0x1c')][_0xd818('0x24')]({'where':_0x549cb9['options']?_0x549cb9['options'][_0xd818('0x21')]||null:null})[_0xd818('0xf')](function(_0x17d3fe){if(_0x17d3fe){return _0x17d3fe['addTags'](_0x549cb9[_0xd818('0x1e')][_0xd818('0x25')],_[_0xd818('0x26')](_0x549cb9[_0xd818('0x1e')],[_0xd818('0x25'),'id'])||{});}})['spread'](function(_0x50c1b5){logger['info'](_0xd818('0x27'),_0x549cb9);logger[_0xd818('0x13')](_0xd818('0x27'),_0x549cb9,JSON[_0xd818('0x15')](_0x50c1b5));_0x4c8658(_0x50c1b5);})[_0xd818('0x1a')](function(_0x190d4d){logger[_0xd818('0x16')](_0xd818('0x27'),_0x190d4d['message'],_0x549cb9);_0x50a0dc(_this[_0xd818('0x16')](0x1f4,_0x190d4d[_0xd818('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 8f372f1..d716ece 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 _0x5a62=['remove','update','emit','removeListener','register','length','smsInteraction:','save'];(function(_0x343dab,_0x134185){var _0xa7e52d=function(_0x37a2b8){while(--_0x37a2b8){_0x343dab['push'](_0x343dab['shift']());}};_0xa7e52d(++_0x134185);}(_0x5a62,0xe7));var _0x25a6=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x5a62[_0x44d9ab];return _0x31485e;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x25a6('0x0'),_0x25a6('0x1'),_0x25a6('0x2')];function createListener(_0x1c7580,_0x186f5d){return function(_0x1199a6){_0x186f5d[_0x25a6('0x3')](_0x1c7580,_0x1199a6);};}function removeListener(_0x1e6c4b,_0x193967){return function(){SmsInteractionEvents[_0x25a6('0x4')](_0x1e6c4b,_0x193967);};}exports[_0x25a6('0x5')]=function(_0x28960c){for(var _0x1d4353=0x0,_0x12bc12=events[_0x25a6('0x6')];_0x1d4353<_0x12bc12;_0x1d4353++){var _0x17cae3=events[_0x1d4353];var _0x18d56c=createListener(_0x25a6('0x7')+_0x17cae3,_0x28960c);SmsInteractionEvents['on'](_0x17cae3,_0x18d56c);}}; \ No newline at end of file +var _0x0e4b=['save','update','emit','removeListener','length','smsInteraction:','./smsInteraction.events'];(function(_0x515283,_0x813dea){var _0x38f836=function(_0x40c8f4){while(--_0x40c8f4){_0x515283['push'](_0x515283['shift']());}};_0x38f836(++_0x813dea);}(_0x0e4b,0x16b));var _0xb0e4=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0x0e4b[_0xf34109];return _0x570bfc;};'use strict';var SmsInteractionEvents=require(_0xb0e4('0x0'));var events=[_0xb0e4('0x1'),'remove',_0xb0e4('0x2')];function createListener(_0x4e4d21,_0x42ddaa){return function(_0x519adf){_0x42ddaa[_0xb0e4('0x3')](_0x4e4d21,_0x519adf);};}function removeListener(_0x5d8535,_0x207545){return function(){SmsInteractionEvents[_0xb0e4('0x4')](_0x5d8535,_0x207545);};}exports['register']=function(_0x3c230c){for(var _0x8ef00b=0x0,_0x3729ed=events[_0xb0e4('0x5')];_0x8ef00b<_0x3729ed;_0x8ef00b++){var _0x56b251=events[_0x8ef00b];var _0x17504b=createListener(_0xb0e4('0x6')+_0x56b251,_0x3c230c);SmsInteractionEvents['on'](_0x56b251,_0x17504b);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 94d189f..b9d2dab 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 _0x8aea=['get','index','/describe','isAuthenticated','describe','/:id','show','sms','smsmessage:create','create','post','status','put','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsMessage.controller'];(function(_0x34361b,_0x9642d4){var _0x1de9c5=function(_0x41bc3f){while(--_0x41bc3f){_0x34361b['push'](_0x34361b['shift']());}};_0x1de9c5(++_0x9642d4);}(_0x8aea,0x7a));var _0xa8ae=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8aea[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xa8ae('0x0'));var util=require(_0xa8ae('0x1'));var path=require(_0xa8ae('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8ae('0x3'));var router=express[_0xa8ae('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa8ae('0x5'));var interaction=require(_0xa8ae('0x6'));var config=require('../../config/environment');var controller=require(_0xa8ae('0x7'));router[_0xa8ae('0x8')]('/',auth['isAuthenticated'](),controller[_0xa8ae('0x9')]);router['get'](_0xa8ae('0xa'),auth[_0xa8ae('0xb')](),controller[_0xa8ae('0xc')]);router['get'](_0xa8ae('0xd'),auth['isAuthenticated'](),controller[_0xa8ae('0xe')]);router['post']('/',auth[_0xa8ae('0xb')](),interaction['tracked'](_0xa8ae('0xf'),_0xa8ae('0x10')),controller[_0xa8ae('0x11')]);router[_0xa8ae('0x12')]('/:id/status',controller[_0xa8ae('0x13')]);router[_0xa8ae('0x14')]('/:id',auth[_0xa8ae('0xb')](),controller['update']);router[_0xa8ae('0x14')](_0xa8ae('0x15'),auth[_0xa8ae('0xb')](),controller[_0xa8ae('0x16')]);router[_0xa8ae('0x14')](_0xa8ae('0x17'),auth[_0xa8ae('0xb')](),controller['reject']);router[_0xa8ae('0x18')](_0xa8ae('0xd'),auth[_0xa8ae('0xb')](),controller[_0xa8ae('0x19')]);module['exports']=router; \ No newline at end of file +var _0x5843=['delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsMessage.controller','index','get','/describe','isAuthenticated','describe','show','tracked','sms','create','post','status','put','/:id/accept','accept','/:id/reject','reject'];(function(_0x2fc8b9,_0x2843cb){var _0x599fbe=function(_0x45ba2a){while(--_0x45ba2a){_0x2fc8b9['push'](_0x2fc8b9['shift']());}};_0x599fbe(++_0x2843cb);}(_0x5843,0x74));var _0x3584=function(_0x1ebce3,_0x1c0f76){_0x1ebce3=_0x1ebce3-0x0;var _0x1ece9e=_0x5843[_0x1ebce3];return _0x1ece9e;};'use strict';var multer=require(_0x3584('0x0'));var util=require('util');var path=require(_0x3584('0x1'));var timeout=require(_0x3584('0x2'));var express=require(_0x3584('0x3'));var router=express[_0x3584('0x4')]();var fs_extra=require(_0x3584('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3584('0x6'));var config=require('../../config/environment');var controller=require(_0x3584('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3584('0x8')]);router[_0x3584('0x9')](_0x3584('0xa'),auth[_0x3584('0xb')](),controller[_0x3584('0xc')]);router[_0x3584('0x9')]('/:id',auth[_0x3584('0xb')](),controller[_0x3584('0xd')]);router['post']('/',auth[_0x3584('0xb')](),interaction[_0x3584('0xe')](_0x3584('0xf'),'smsmessage:create'),controller[_0x3584('0x10')]);router[_0x3584('0x11')]('/:id/status',controller[_0x3584('0x12')]);router[_0x3584('0x13')]('/:id',auth[_0x3584('0xb')](),controller['update']);router[_0x3584('0x13')](_0x3584('0x14'),auth[_0x3584('0xb')](),controller[_0x3584('0x15')]);router[_0x3584('0x13')](_0x3584('0x16'),auth[_0x3584('0xb')](),controller[_0x3584('0x17')]);router[_0x3584('0x18')](_0x3584('0x19'),auth[_0x3584('0xb')](),controller[_0x3584('0x1a')]);module[_0x3584('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 464e10b..f2b6137 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 _0x4eb7=['out','STRING','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x34aa31,_0x58b25c){var _0xb3f941=function(_0x39c977){while(--_0x39c977){_0x34aa31['push'](_0x34aa31['shift']());}};_0xb3f941(++_0x58b25c);}(_0x4eb7,0x183));var _0x74eb=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x4eb7[_0x2df507];return _0x1f7167;};'use strict';var Sequelize=require(_0x74eb('0x0'));module[_0x74eb('0x1')]={'body':{'type':Sequelize[_0x74eb('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x74eb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x74eb('0x4')]('in',_0x74eb('0x5')),'defaultValue':_0x74eb('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x74eb('0x6')](0xbe)},'phone':{'type':Sequelize[_0x74eb('0x6')]},'readAt':{'type':Sequelize[_0x74eb('0x7')]},'secret':{'type':Sequelize[_0x74eb('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x74eb('0x6')]},'providerResponse':{'type':Sequelize[_0x74eb('0x2')]}}; \ No newline at end of file +var _0x20c4=['sequelize','exports','TEXT','medium','BOOLEAN','out','STRING'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x20c4,0xbd));var _0x420c=function(_0x5cb2e4,_0x43a8d7){_0x5cb2e4=_0x5cb2e4-0x0;var _0x426ebd=_0x20c4[_0x5cb2e4];return _0x426ebd;};'use strict';var Sequelize=require(_0x420c('0x0'));module[_0x420c('0x1')]={'body':{'type':Sequelize[_0x420c('0x2')](_0x420c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x420c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x420c('0x5')),'defaultValue':_0x420c('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x420c('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x420c('0x6')]},'providerResponse':{'type':Sequelize[_0x420c('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index f4dcd93..99b3676 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 _0x36e0=['VIRTUAL','options','findAll','params','rawAttributes','find','create','body','describe','sms-interactions','sms','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','info','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','sequelize','SELECT','User','rejectmessage','SmsAccountId','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','messageId','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','./smsMessage.socket','client','http','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','end','stack','name','send','index','SmsMessage','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x565373,_0x50f9ee){var _0x291330=function(_0x36ab86){while(--_0x36ab86){_0x565373['push'](_0x565373['shift']());}};_0x291330(++_0x50f9ee);}(_0x36e0,0x15c));var _0x036e=function(_0xe0adde,_0x2faffa){_0xe0adde=_0xe0adde-0x0;var _0x182ed1=_0x36e0[_0xe0adde];return _0x182ed1;};'use strict';var emlformat=require(_0x036e('0x0'));var rimraf=require(_0x036e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x036e('0x2'));var rp=require(_0x036e('0x3'));var moment=require(_0x036e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x036e('0x5'));var util=require(_0x036e('0x6'));var path=require('path');var sox=require(_0x036e('0x7'));var csv=require(_0x036e('0x8'));var ejs=require(_0x036e('0x9'));var fs=require('fs');var fs_extra=require(_0x036e('0xa'));var _=require(_0x036e('0xb'));var squel=require(_0x036e('0xc'));var crypto=require(_0x036e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x036e('0x8'));var querystring=require(_0x036e('0xe'));var Papa=require(_0x036e('0xf'));var Redis=require(_0x036e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x036e('0x11'));var logger=require(_0x036e('0x12'))(_0x036e('0x13'));var utils=require(_0x036e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x036e('0x15'));var db=require(_0x036e('0x16'))['db'];config['redis']=_[_0x036e('0x17')](config[_0x036e('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x036e('0x18')]));require(_0x036e('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x036e('0x1a')][_0x036e('0x1b')]({'port':0x232c});var client9002=jayson[_0x036e('0x1a')][_0x036e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4858b8,_0x473e6a,_0x11df7f,_0x4b1383){return new BPromise(function(_0x724157,_0x126f66){var _0x19cd11=_0x4b1383||client;return _0x19cd11['request'](_0x4858b8,_0x11df7f)[_0x036e('0x1c')](function(_0x9257f7){logger['info'](_0x036e('0x1d'),_0x473e6a,_0x036e('0x1e'));logger[_0x036e('0x1f')](_0x036e('0x20'),_0x473e6a,'request\x20sent',JSON[_0x036e('0x21')](_0x9257f7));if(_0x9257f7[_0x036e('0x22')]){if(_0x9257f7[_0x036e('0x22')][_0x036e('0x23')]===0x1f4){logger[_0x036e('0x22')](_0x036e('0x1d'),_0x473e6a,_0x9257f7[_0x036e('0x22')][_0x036e('0x24')]);return _0x126f66(_0x9257f7[_0x036e('0x22')][_0x036e('0x24')]);}logger[_0x036e('0x22')](_0x036e('0x1d'),_0x473e6a,_0x9257f7[_0x036e('0x22')]['message']);return _0x724157(_0x9257f7[_0x036e('0x22')][_0x036e('0x24')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x473e6a,_0x036e('0x1e'));_0x724157(_0x9257f7[_0x036e('0x25')][_0x036e('0x24')]);}})[_0x036e('0x26')](function(_0x37b9c9){logger[_0x036e('0x22')](_0x036e('0x1d'),_0x473e6a,_0x37b9c9);_0x126f66(_0x37b9c9);});});}function respondWithStatusCode(_0xee4f8f,_0x7bc443){_0x7bc443=_0x7bc443||0xcc;return function(_0xa078b9){if(_0xa078b9){return _0xee4f8f[_0x036e('0x27')](_0x7bc443);}return _0xee4f8f[_0x036e('0x28')](_0x7bc443)['end']();};}function respondWithResult(_0xbc88ba,_0x611982){_0x611982=_0x611982||0xc8;return function(_0x18dc83){if(_0x18dc83){return _0xbc88ba[_0x036e('0x28')](_0x611982)[_0x036e('0x29')](_0x18dc83);}};}function respondWithFilteredResult(_0x40dfe9,_0x361194){return function(_0x42ae70){if(_0x42ae70){var _0x5ed9b5=typeof _0x361194['offset']===_0x036e('0x2a')&&typeof _0x361194[_0x036e('0x2b')]===_0x036e('0x2a');var _0x342df2=_0x42ae70['count'];var _0x1a8d52=_0x5ed9b5?0x0:_0x361194[_0x036e('0x2c')];var _0x320bf9=_0x5ed9b5?_0x42ae70[_0x036e('0x2d')]:_0x361194[_0x036e('0x2c')]+_0x361194[_0x036e('0x2b')];var _0x41ac79;if(_0x320bf9>=_0x342df2){_0x320bf9=_0x342df2;_0x41ac79=0xc8;}else{_0x41ac79=0xce;}_0x40dfe9['status'](_0x41ac79);return _0x40dfe9['set'](_0x036e('0x2e'),_0x1a8d52+'-'+_0x320bf9+'/'+_0x342df2)['json'](_0x42ae70);}return null;};}function patchUpdates(_0x2edaa6){return function(_0x7a220f){try{jsonpatch[_0x036e('0x2f')](_0x7a220f,_0x2edaa6,!![]);}catch(_0x5d0078){return BPromise[_0x036e('0x30')](_0x5d0078);}return _0x7a220f[_0x036e('0x31')]();};}function saveUpdates(_0x1fd673,_0x194121){return function(_0x4eb6fe){if(_0x4eb6fe){return _0x4eb6fe[_0x036e('0x32')](_0x1fd673)[_0x036e('0x1c')](function(_0x186585){return _0x186585;});}return null;};}function removeEntity(_0x51bc0b,_0x12c950){return function(_0x332b45){if(_0x332b45){return _0x332b45['destroy']()['then'](function(){_0x51bc0b[_0x036e('0x28')](0xcc)[_0x036e('0x33')]();});}};}function handleEntityNotFound(_0x1d70dd,_0x11d11b){return function(_0xfce2a3){if(!_0xfce2a3){_0x1d70dd[_0x036e('0x27')](0x194);}return _0xfce2a3;};}function handleError(_0x10c660,_0x15464a){_0x15464a=_0x15464a||0x1f4;return function(_0x294b72){logger[_0x036e('0x22')](_0x294b72[_0x036e('0x34')]);if(_0x294b72[_0x036e('0x35')]){delete _0x294b72[_0x036e('0x35')];}_0x10c660[_0x036e('0x28')](_0x15464a)[_0x036e('0x36')](_0x294b72);};}exports[_0x036e('0x37')]=function(_0xa60a97,_0x175dbe){var _0x285a86={},_0x5b12cd={},_0x4544f1={'count':0x0,'rows':[]};var _0x4a93ee=_['map'](db[_0x036e('0x38')]['rawAttributes'],function(_0x38d579){return{'name':_0x38d579[_0x036e('0x39')],'type':_0x38d579[_0x036e('0x3a')][_0x036e('0x3b')]};});_0x5b12cd[_0x036e('0x3c')]=_[_0x036e('0x3d')](_0x4a93ee,_0x036e('0x35'));_0x5b12cd[_0x036e('0x3e')]=_[_0x036e('0x3f')](_0xa60a97['query']);_0x5b12cd[_0x036e('0x40')]=_[_0x036e('0x41')](_0x5b12cd[_0x036e('0x3c')],_0x5b12cd['query']);_0x285a86[_0x036e('0x42')]=_[_0x036e('0x41')](_0x5b12cd[_0x036e('0x3c')],qs[_0x036e('0x43')](_0xa60a97[_0x036e('0x3e')][_0x036e('0x43')]));_0x285a86['attributes']=_0x285a86[_0x036e('0x42')][_0x036e('0x44')]?_0x285a86['attributes']:_0x5b12cd[_0x036e('0x3c')];if(!_0xa60a97[_0x036e('0x3e')][_0x036e('0x45')](_0x036e('0x46'))){_0x285a86[_0x036e('0x2b')]=qs[_0x036e('0x2b')](_0xa60a97[_0x036e('0x3e')][_0x036e('0x2b')]);_0x285a86[_0x036e('0x2c')]=qs[_0x036e('0x2c')](_0xa60a97['query'][_0x036e('0x2c')]);}_0x285a86['order']=qs[_0x036e('0x47')](_0xa60a97[_0x036e('0x3e')][_0x036e('0x47')]);_0x285a86[_0x036e('0x48')]=qs[_0x036e('0x40')](_['pick'](_0xa60a97[_0x036e('0x3e')],_0x5b12cd[_0x036e('0x40')]),_0x4a93ee);if(_0xa60a97[_0x036e('0x3e')][_0x036e('0x49')]){_0x285a86[_0x036e('0x48')]=_[_0x036e('0x4a')](_0x285a86[_0x036e('0x48')],{'$or':_[_0x036e('0x3d')](_0x4a93ee,function(_0x478ea9){if(_0x478ea9[_0x036e('0x3a')]!==_0x036e('0x4b')){var _0x4b3e57={};_0x4b3e57[_0x478ea9[_0x036e('0x35')]]={'$like':'%'+_0xa60a97[_0x036e('0x3e')][_0x036e('0x49')]+'%'};return _0x4b3e57;}})});}_0x285a86=_[_0x036e('0x4a')]({},_0x285a86,_0xa60a97[_0x036e('0x4c')]);var _0x2a97e3={'where':_0x285a86[_0x036e('0x48')]};return db[_0x036e('0x38')]['count'](_0x2a97e3)[_0x036e('0x1c')](function(_0xae4ef8){_0x4544f1[_0x036e('0x2d')]=_0xae4ef8;if(_0xa60a97[_0x036e('0x3e')]['includeAll']){_0x285a86['include']=[{'all':!![]}];}return db[_0x036e('0x38')][_0x036e('0x4d')](_0x285a86);})[_0x036e('0x1c')](function(_0x59bd7c){_0x4544f1['rows']=_0x59bd7c;return _0x4544f1;})[_0x036e('0x1c')](respondWithFilteredResult(_0x175dbe,_0x285a86))[_0x036e('0x26')](handleError(_0x175dbe,null));};exports['show']=function(_0x24757c,_0x45c586){var _0x1a32d8={'raw':!![],'where':{'id':_0x24757c[_0x036e('0x4e')]['id']}},_0x4a1050={};_0x4a1050[_0x036e('0x3c')]=_['keys'](db[_0x036e('0x38')][_0x036e('0x4f')]);_0x4a1050[_0x036e('0x3e')]=_[_0x036e('0x3f')](_0x24757c[_0x036e('0x3e')]);_0x4a1050[_0x036e('0x40')]=_[_0x036e('0x41')](_0x4a1050[_0x036e('0x3c')],_0x4a1050[_0x036e('0x3e')]);_0x1a32d8[_0x036e('0x42')]=_[_0x036e('0x41')](_0x4a1050[_0x036e('0x3c')],qs[_0x036e('0x43')](_0x24757c[_0x036e('0x3e')][_0x036e('0x43')]));_0x1a32d8[_0x036e('0x42')]=_0x1a32d8[_0x036e('0x42')][_0x036e('0x44')]?_0x1a32d8[_0x036e('0x42')]:_0x4a1050['model'];if(_0x24757c[_0x036e('0x3e')]['includeAll']){_0x1a32d8['include']=[{'all':!![]}];}_0x1a32d8=_[_0x036e('0x4a')]({},_0x1a32d8,_0x24757c[_0x036e('0x4c')]);return db[_0x036e('0x38')][_0x036e('0x50')](_0x1a32d8)[_0x036e('0x1c')](handleEntityNotFound(_0x45c586,null))[_0x036e('0x1c')](respondWithResult(_0x45c586,null))[_0x036e('0x26')](handleError(_0x45c586,null));};exports[_0x036e('0x51')]=function(_0x37a7e8,_0x2a5341){return db['SmsMessage']['create'](_0x37a7e8['body'],{})[_0x036e('0x1c')](respondWithResult(_0x2a5341,0xc9))[_0x036e('0x26')](handleError(_0x2a5341,null));};exports[_0x036e('0x32')]=function(_0x548c3b,_0x1e9c63){if(_0x548c3b[_0x036e('0x52')]['id']){delete _0x548c3b[_0x036e('0x52')]['id'];}return db[_0x036e('0x38')][_0x036e('0x50')]({'where':{'id':_0x548c3b[_0x036e('0x4e')]['id']}})[_0x036e('0x1c')](handleEntityNotFound(_0x1e9c63,null))['then'](saveUpdates(_0x548c3b[_0x036e('0x52')],null))['then'](respondWithResult(_0x1e9c63,null))[_0x036e('0x26')](handleError(_0x1e9c63,null));};exports['destroy']=function(_0x13f526,_0x505018){return db[_0x036e('0x38')][_0x036e('0x50')]({'where':{'id':_0x13f526['params']['id']}})[_0x036e('0x1c')](handleEntityNotFound(_0x505018,null))[_0x036e('0x1c')](removeEntity(_0x505018,null))[_0x036e('0x26')](handleError(_0x505018,null));};exports[_0x036e('0x53')]=function(_0x109b26,_0x58894e){return db['SmsMessage']['describe']()[_0x036e('0x1c')](respondWithResult(_0x58894e,null))[_0x036e('0x26')](handleError(_0x58894e,null));};var interaction_log=require(_0x036e('0x12'))(_0x036e('0x54'));exports['accept']=function(_0x3fd03f,_0x192d37,_0xe3947c){var _0x3b102c={'agent':{},'channel':_0x036e('0x55')};if(_0x3fd03f[_0x036e('0x52')]['id']){delete _0x3fd03f[_0x036e('0x52')]['id'];}_0x3fd03f[_0x036e('0x52')]['read']=!![];_0x3fd03f[_0x036e('0x52')]['readAt']=moment()[_0x036e('0x56')](_0x036e('0x57'));_0x3fd03f['body'][_0x036e('0x58')]=_0x3fd03f[_0x036e('0x52')][_0x036e('0x58')]||_0x3fd03f['user']['id'];_0x3b102c[_0x036e('0x59')]['id']=_0x3fd03f[_0x036e('0x52')][_0x036e('0x58')];return db[_0x036e('0x38')]['find']({'where':{'id':_0x3fd03f[_0x036e('0x4e')]['id'],'UserId':null}})[_0x036e('0x1c')](handleEntityNotFound(_0x192d37,null))[_0x036e('0x1c')](saveUpdates(_0x3fd03f[_0x036e('0x52')],null))[_0x036e('0x1c')](function(_0x6343d3){if(_0x6343d3){_0x3b102c[_0x036e('0x24')]=_0x6343d3[_0x036e('0x5a')]({'plain':!![]});return db[_0x036e('0x5b')][_0x036e('0x50')]({'where':{'id':_0x6343d3[_0x036e('0x5c')]}});}return null;})[_0x036e('0x1c')](handleEntityNotFound(_0x192d37,null))['then'](function(_0x57e307){if(_0x57e307){return _0x57e307['update']({'UserId':_0x3fd03f[_0x036e('0x52')]['UserId'],'read1stAt':_[_0x036e('0x5d')](_0x57e307[_0x036e('0x5e')])?moment()['format'](_0x036e('0x57')):undefined});}return null;})[_0x036e('0x1c')](function(_0x2dedc4){if(_0x2dedc4){_0x3b102c[_0x036e('0x5f')]=_0x2dedc4[_0x036e('0x5a')]({'plain':!![]});interaction_log[_0x036e('0x60')](_0x036e('0x61'),_0x3fd03f[_0x036e('0x62')]['id'],_0x3fd03f[_0x036e('0x62')][_0x036e('0x35')],_0x3fd03f[_0x036e('0x62')][_0x036e('0x63')],_0x3b102c[_0x036e('0x5f')]['id'],_0x3fd03f[_0x036e('0x52')]?JSON[_0x036e('0x21')](_0x3fd03f[_0x036e('0x52')]):_0x036e('0x64'));return respondWithRpcPromise(_0x036e('0x65'),_0x036e('0x66'),_0x3b102c);}return null;})[_0x036e('0x1c')](function(_0x1075e5){var _0x48d56e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1075e5[_0x036e('0x24')][_0x036e('0x67')];return db['sequelize'][_0x036e('0x3e')](_0x48d56e,{'type':db[_0x036e('0x68')][_0x036e('0x69')]['SELECT'],'raw':!![]})[_0x036e('0x1c')](function(_0x10c1b5){return _0x10c1b5;});})[_0x036e('0x1c')](function(_0x5c072f){if(_0x5c072f){_0x3b102c['message'][_0x036e('0x6a')]=_0x5c072f[0x0];if(!_0x3fd03f[_0x036e('0x52')][_0x036e('0x58')])return;return db['User'][_0x036e('0x50')]({'where':{'id':_0x3fd03f[_0x036e('0x52')][_0x036e('0x58')],'role':_0x036e('0x59')},'attributes':['id',_0x036e('0x35'),_0x036e('0x6b'),_0x036e('0x6c'),_0x036e('0x6d')],'raw':!![]});}return null;})[_0x036e('0x1c')](function(_0x55cfe2){if(!_0x55cfe2)return null;_0x3b102c[_0x036e('0x24')]['agent']=_0x55cfe2;return _0x3b102c;})['then'](function(_0x582145){if(_0x582145){if(_0x3fd03f[_0x036e('0x52')][_0x036e('0x6e')]){_0x3b102c['message'][_0x036e('0x6f')]=util[_0x036e('0x56')](_0x036e('0x70'),_0x3fd03f[_0x036e('0x62')][_0x036e('0x35')]);_0x3b102c['message']['channel']=_0x3b102c[_0x036e('0x71')];_0x3b102c[_0x036e('0x24')][_0x036e('0x72')]=_0x3b102c['channel'];_0x3b102c[_0x036e('0x24')][_0x036e('0x73')]='accept';return respondWithRpcPromise(_0x036e('0x74'),_0x036e('0x74'),{'event':_0x036e('0x75'),'message':_0x3b102c[_0x036e('0x24')]},client9002)['then'](function(){return _0x3b102c;});}return _0x3b102c;}return null;})[_0x036e('0x1c')](respondWithResult(_0x192d37,null))[_0x036e('0x26')](handleError(_0x192d37,null));};var interaction_log=require('../../config/logger')(_0x036e('0x54'));exports['reject']=function(_0x6bc5c,_0x48acba,_0x4e9424){var _0x1744d6={'agent':{},'channel':_0x036e('0x55')};if(_0x6bc5c[_0x036e('0x52')]['id']){delete _0x6bc5c[_0x036e('0x52')]['id'];}_0x6bc5c['body'][_0x036e('0x58')]=_0x6bc5c[_0x036e('0x52')][_0x036e('0x58')]||_0x6bc5c[_0x036e('0x62')]['id'];_0x1744d6[_0x036e('0x59')]['id']=_0x6bc5c[_0x036e('0x52')][_0x036e('0x58')];return db['SmsMessage'][_0x036e('0x50')]({'where':{'id':_0x6bc5c[_0x036e('0x4e')]['id'],'UserId':null}})[_0x036e('0x1c')](handleEntityNotFound(_0x48acba,null))[_0x036e('0x1c')](function(_0xcc76c3){if(_0xcc76c3){_0x1744d6[_0x036e('0x24')]=_0xcc76c3[_0x036e('0x5a')]({'plain':!![]});return db['SmsInteraction'][_0x036e('0x50')]({'where':{'id':_0xcc76c3[_0x036e('0x5c')]}});}return null;})[_0x036e('0x1c')](handleEntityNotFound(_0x48acba,null))[_0x036e('0x1c')](function(_0xf6830){if(_0xf6830){_0x1744d6[_0x036e('0x5f')]=_0xf6830['get']({'plain':!![]});interaction_log[_0x036e('0x60')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x6bc5c[_0x036e('0x62')]['id'],_0x6bc5c[_0x036e('0x62')][_0x036e('0x35')],_0x6bc5c[_0x036e('0x62')][_0x036e('0x63')],_0x1744d6[_0x036e('0x5f')]['id'],_0x6bc5c[_0x036e('0x52')]?JSON[_0x036e('0x21')](_0x6bc5c[_0x036e('0x52')]):_0x036e('0x64'));return respondWithRpcPromise(_0x036e('0x76'),_0x036e('0x77'),_0x1744d6);}return null;})[_0x036e('0x1c')](function(_0x436d75){var _0x5a777c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x436d75[_0x036e('0x24')]['ContactId'];return db[_0x036e('0x78')][_0x036e('0x3e')](_0x5a777c,{'type':db['Sequelize'][_0x036e('0x69')][_0x036e('0x79')],'raw':!![]})['then'](function(_0xd43425){return _0xd43425;});})[_0x036e('0x1c')](function(_0x5074dd){if(_0x5074dd){_0x1744d6[_0x036e('0x24')]['contact']=_0x5074dd[0x0];if(!_0x6bc5c[_0x036e('0x52')][_0x036e('0x58')])return;return db[_0x036e('0x7a')][_0x036e('0x50')]({'where':{'id':_0x6bc5c[_0x036e('0x52')][_0x036e('0x58')],'role':'agent'},'attributes':['id',_0x036e('0x35'),_0x036e('0x6b'),_0x036e('0x6c'),_0x036e('0x6d')],'raw':!![]});}return null;})[_0x036e('0x1c')](function(_0x1330c8){if(!_0x1330c8)return null;_0x1744d6['message'][_0x036e('0x59')]=_0x1330c8;return _0x1744d6;})[_0x036e('0x1c')](function(_0x2ac36f){if(_0x2ac36f){_0x2ac36f[_0x036e('0x24')][_0x036e('0x6f')]=util[_0x036e('0x56')]('SIP/%s',_0x6bc5c[_0x036e('0x62')]['name']);_0x2ac36f['message']['channel']=_0x1744d6[_0x036e('0x71')];_0x2ac36f[_0x036e('0x24')][_0x036e('0x72')]=_0x1744d6[_0x036e('0x71')];_0x2ac36f['message'][_0x036e('0x73')]=_0x036e('0x30');respondWithRpcPromise(_0x036e('0x74'),_0x036e('0x74'),{'event':_0x036e('0x7b'),'message':_0x2ac36f[_0x036e('0x24')]},client9002);return _0x1744d6;}return null;})['then'](respondWithResult(_0x48acba,null))[_0x036e('0x26')](handleError(_0x48acba,null));};exports[_0x036e('0x28')]=function(_0xb8c1f7,_0x1a8a4a,_0x18a04f){if(_0xb8c1f7[_0x036e('0x52')]['id']){delete _0xb8c1f7[_0x036e('0x52')]['id'];}var _0x526457;return db[_0x036e('0x38')][_0x036e('0x50')]({'where':{'id':_0xb8c1f7[_0x036e('0x4e')]['id']}})[_0x036e('0x1c')](handleEntityNotFound(_0x1a8a4a,null))[_0x036e('0x1c')](function(_0xbca38c){if(_0xbca38c){_0x526457=_0xbca38c;return db['SmsAccount']['find']({'where':{'id':_0xbca38c[_0x036e('0x7c')]}});}})['then'](handleEntityNotFound(_0x1a8a4a,null))[_0x036e('0x1c')](function(_0x13315e){if(_0x13315e){logger[_0x036e('0x1f')](_0x036e('0x20'),_0x036e('0x28'),'received\x20delivery\x20report\x20from',_0x13315e[_0x036e('0x3a')],util[_0x036e('0x7d')](_0xb8c1f7[_0x036e('0x52')],{'showHidden':![],'depth':null}));switch(_0x13315e[_0x036e('0x3a')]){case'twilio':if(_0xb8c1f7[_0x036e('0x52')][_0x036e('0x7e')]&&_0xb8c1f7[_0x036e('0x52')][_0x036e('0x7e')]===_0x526457['messageId']){return _0x526457[_0x036e('0x32')]({'read':!![]});}else{logger[_0x036e('0x22')](_0x036e('0x7f'),'status',_0x036e('0x80'),util['inspect'](_0xb8c1f7[_0x036e('0x52')],{'showHidden':![],'depth':null}));}break;case _0x036e('0x81'):if(_0xb8c1f7[_0x036e('0x52')][_0x036e('0x82')]&&_0xb8c1f7[_0x036e('0x52')][_0x036e('0x82')]===_0x526457[_0x036e('0x83')]&&_[_0x036e('0x84')]([_0x036e('0x85'),_0x036e('0x86')],_0xb8c1f7[_0x036e('0x52')][_0x036e('0x87')])>=0x0){return _0x526457[_0x036e('0x32')]({'read':!![]});}else{logger[_0x036e('0x22')](_0x036e('0x7f'),_0x036e('0x28'),_0x036e('0x88'),util[_0x036e('0x7d')](_0xb8c1f7['body'],{'showHidden':![],'depth':null}));}break;case _0x036e('0x89'):var _0xb0001a=_0xb8c1f7[_0x036e('0x52')][_0x036e('0x8a')][0x0];if(_0xb0001a[_0x036e('0x28')][_0x036e('0x8b')]===_0x036e('0x8c')){return _0x526457[_0x036e('0x32')]({'read':!![]});}else{logger[_0x036e('0x22')](_0x036e('0x7f'),'status',_0x036e('0x89'),util[_0x036e('0x7d')](_0xb8c1f7[_0x036e('0x52')],{'showHidden':![],'depth':null}));}break;}return _0x526457;}})[_0x036e('0x1c')](respondWithResult(_0x1a8a4a,null))[_0x036e('0x26')](handleError(_0x1a8a4a,null));}; \ No newline at end of file +var _0xaadd=['redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','then','stack','name','send','map','SmsMessage','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','nolimit','order','where','filters','pick','filter','merge','rows','show','params','length','include','find','create','body','destroy','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','role','stringify','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','manual','interface','channel','event','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','motionChannel','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','Status','infobip','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb'];(function(_0x4e85dd,_0x4f32d8){var _0x2ad910=function(_0x3a57b1){while(--_0x3a57b1){_0x4e85dd['push'](_0x4e85dd['shift']());}};_0x2ad910(++_0x4f32d8);}(_0xaadd,0x19b));var _0xdaad=function(_0x3950aa,_0x3b2aad){_0x3950aa=_0x3950aa-0x0;var _0x4ef637=_0xaadd[_0x3950aa];return _0x4ef637;};'use strict';var emlformat=require(_0xdaad('0x0'));var rimraf=require(_0xdaad('0x1'));var zipdir=require(_0xdaad('0x2'));var jsonpatch=require(_0xdaad('0x3'));var rp=require(_0xdaad('0x4'));var moment=require(_0xdaad('0x5'));var BPromise=require(_0xdaad('0x6'));var Mustache=require(_0xdaad('0x7'));var util=require('util');var path=require(_0xdaad('0x8'));var sox=require(_0xdaad('0x9'));var csv=require(_0xdaad('0xa'));var ejs=require(_0xdaad('0xb'));var fs=require('fs');var fs_extra=require(_0xdaad('0xc'));var _=require('lodash');var squel=require(_0xdaad('0xd'));var crypto=require(_0xdaad('0xe'));var jsforce=require(_0xdaad('0xf'));var deskjs=require(_0xdaad('0x10'));var toCsv=require(_0xdaad('0xa'));var querystring=require(_0xdaad('0x11'));var Papa=require(_0xdaad('0x12'));var Redis=require(_0xdaad('0x13'));var authService=require(_0xdaad('0x14'));var qs=require(_0xdaad('0x15'));var as=require(_0xdaad('0x16'));var hardwareService=require(_0xdaad('0x17'));var logger=require('../../config/logger')(_0xdaad('0x18'));var utils=require('../../config/utils');var config=require(_0xdaad('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xdaad('0x1a'))['db'];config[_0xdaad('0x1b')]=_[_0xdaad('0x1c')](config['redis'],{'host':_0xdaad('0x1d'),'port':0x18eb});var socket=require(_0xdaad('0x1e'))(new Redis(config[_0xdaad('0x1b')]));require(_0xdaad('0x1f'))[_0xdaad('0x20')](socket);var jayson=require(_0xdaad('0x21'));var client=jayson[_0xdaad('0x22')][_0xdaad('0x23')]({'port':0x232c});var client9002=jayson[_0xdaad('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b527f,_0x3ea4dc,_0x2019d2,_0x343f15){return new BPromise(function(_0x3a4ce9,_0xeee32e){var _0x2c95bf=_0x343f15||client;return _0x2c95bf[_0xdaad('0x24')](_0x4b527f,_0x2019d2)['then'](function(_0x1a3054){logger[_0xdaad('0x25')](_0xdaad('0x26'),_0x3ea4dc,_0xdaad('0x27'));logger[_0xdaad('0x28')](_0xdaad('0x29'),_0x3ea4dc,_0xdaad('0x27'),JSON['stringify'](_0x1a3054));if(_0x1a3054[_0xdaad('0x2a')]){if(_0x1a3054['error'][_0xdaad('0x2b')]===0x1f4){logger[_0xdaad('0x2a')](_0xdaad('0x26'),_0x3ea4dc,_0x1a3054[_0xdaad('0x2a')]['message']);return _0xeee32e(_0x1a3054[_0xdaad('0x2a')][_0xdaad('0x2c')]);}logger[_0xdaad('0x2a')](_0xdaad('0x26'),_0x3ea4dc,_0x1a3054[_0xdaad('0x2a')][_0xdaad('0x2c')]);return _0x3a4ce9(_0x1a3054[_0xdaad('0x2a')]['message']);}else{logger[_0xdaad('0x25')]('SmsMessage,\x20%s,\x20%s',_0x3ea4dc,'request\x20sent');_0x3a4ce9(_0x1a3054[_0xdaad('0x2d')][_0xdaad('0x2c')]);}})[_0xdaad('0x2e')](function(_0x4e021b){logger[_0xdaad('0x2a')](_0xdaad('0x26'),_0x3ea4dc,_0x4e021b);_0xeee32e(_0x4e021b);});});}function respondWithStatusCode(_0x2a5db4,_0x2eb40c){_0x2eb40c=_0x2eb40c||0xcc;return function(_0x4eb9cd){if(_0x4eb9cd){return _0x2a5db4[_0xdaad('0x2f')](_0x2eb40c);}return _0x2a5db4[_0xdaad('0x30')](_0x2eb40c)[_0xdaad('0x31')]();};}function respondWithResult(_0x3f24b3,_0xc45141){_0xc45141=_0xc45141||0xc8;return function(_0x4d9eab){if(_0x4d9eab){return _0x3f24b3['status'](_0xc45141)[_0xdaad('0x32')](_0x4d9eab);}};}function respondWithFilteredResult(_0x13ae73,_0x3914c9){return function(_0x489870){if(_0x489870){var _0x518fac=typeof _0x3914c9[_0xdaad('0x33')]==='undefined'&&typeof _0x3914c9[_0xdaad('0x34')]==='undefined';var _0x344518=_0x489870[_0xdaad('0x35')];var _0x2919b6=_0x518fac?0x0:_0x3914c9['offset'];var _0x105852=_0x518fac?_0x489870[_0xdaad('0x35')]:_0x3914c9[_0xdaad('0x33')]+_0x3914c9[_0xdaad('0x34')];var _0x16bbe6;if(_0x105852>=_0x344518){_0x105852=_0x344518;_0x16bbe6=0xc8;}else{_0x16bbe6=0xce;}_0x13ae73[_0xdaad('0x30')](_0x16bbe6);return _0x13ae73[_0xdaad('0x36')]('Content-Range',_0x2919b6+'-'+_0x105852+'/'+_0x344518)[_0xdaad('0x32')](_0x489870);}return null;};}function patchUpdates(_0x69f297){return function(_0x11ea62){try{jsonpatch[_0xdaad('0x37')](_0x11ea62,_0x69f297,!![]);}catch(_0x5c2c38){return BPromise[_0xdaad('0x38')](_0x5c2c38);}return _0x11ea62[_0xdaad('0x39')]();};}function saveUpdates(_0x172d09,_0x56495f){return function(_0x768c3){if(_0x768c3){return _0x768c3[_0xdaad('0x3a')](_0x172d09)['then'](function(_0x1bd87e){return _0x1bd87e;});}return null;};}function removeEntity(_0x24a01b,_0x206c4a){return function(_0xd2ed7a){if(_0xd2ed7a){return _0xd2ed7a['destroy']()[_0xdaad('0x3b')](function(){_0x24a01b[_0xdaad('0x30')](0xcc)[_0xdaad('0x31')]();});}};}function handleEntityNotFound(_0x9373af,_0x34d95a){return function(_0x1a0e9e){if(!_0x1a0e9e){_0x9373af[_0xdaad('0x2f')](0x194);}return _0x1a0e9e;};}function handleError(_0xa4b606,_0x118b71){_0x118b71=_0x118b71||0x1f4;return function(_0x5a8c5a){logger['error'](_0x5a8c5a[_0xdaad('0x3c')]);if(_0x5a8c5a[_0xdaad('0x3d')]){delete _0x5a8c5a[_0xdaad('0x3d')];}_0xa4b606[_0xdaad('0x30')](_0x118b71)[_0xdaad('0x3e')](_0x5a8c5a);};}exports['index']=function(_0x7e7f70,_0x149caf){var _0x15c475={},_0x27061d={},_0x254da2={'count':0x0,'rows':[]};var _0x5d9592=_[_0xdaad('0x3f')](db[_0xdaad('0x40')][_0xdaad('0x41')],function(_0x242493){return{'name':_0x242493[_0xdaad('0x42')],'type':_0x242493[_0xdaad('0x43')]['key']};});_0x27061d[_0xdaad('0x44')]=_[_0xdaad('0x3f')](_0x5d9592,_0xdaad('0x3d'));_0x27061d[_0xdaad('0x45')]=_[_0xdaad('0x46')](_0x7e7f70[_0xdaad('0x45')]);_0x27061d['filters']=_['intersection'](_0x27061d[_0xdaad('0x44')],_0x27061d[_0xdaad('0x45')]);_0x15c475[_0xdaad('0x47')]=_[_0xdaad('0x48')](_0x27061d['model'],qs[_0xdaad('0x49')](_0x7e7f70[_0xdaad('0x45')][_0xdaad('0x49')]));_0x15c475[_0xdaad('0x47')]=_0x15c475[_0xdaad('0x47')]['length']?_0x15c475[_0xdaad('0x47')]:_0x27061d[_0xdaad('0x44')];if(!_0x7e7f70[_0xdaad('0x45')]['hasOwnProperty'](_0xdaad('0x4a'))){_0x15c475['limit']=qs[_0xdaad('0x34')](_0x7e7f70[_0xdaad('0x45')]['limit']);_0x15c475['offset']=qs[_0xdaad('0x33')](_0x7e7f70[_0xdaad('0x45')][_0xdaad('0x33')]);}_0x15c475[_0xdaad('0x4b')]=qs['sort'](_0x7e7f70[_0xdaad('0x45')]['sort']);_0x15c475[_0xdaad('0x4c')]=qs[_0xdaad('0x4d')](_[_0xdaad('0x4e')](_0x7e7f70[_0xdaad('0x45')],_0x27061d['filters']),_0x5d9592);if(_0x7e7f70['query'][_0xdaad('0x4f')]){_0x15c475['where']=_[_0xdaad('0x50')](_0x15c475['where'],{'$or':_[_0xdaad('0x3f')](_0x5d9592,function(_0x59acc5){if(_0x59acc5[_0xdaad('0x43')]!=='VIRTUAL'){var _0x598e4e={};_0x598e4e[_0x59acc5[_0xdaad('0x3d')]]={'$like':'%'+_0x7e7f70['query'][_0xdaad('0x4f')]+'%'};return _0x598e4e;}})});}_0x15c475=_['merge']({},_0x15c475,_0x7e7f70['options']);var _0x88589={'where':_0x15c475['where']};return db[_0xdaad('0x40')][_0xdaad('0x35')](_0x88589)[_0xdaad('0x3b')](function(_0x32edb8){_0x254da2['count']=_0x32edb8;if(_0x7e7f70[_0xdaad('0x45')]['includeAll']){_0x15c475['include']=[{'all':!![]}];}return db[_0xdaad('0x40')]['findAll'](_0x15c475);})[_0xdaad('0x3b')](function(_0x377a42){_0x254da2[_0xdaad('0x51')]=_0x377a42;return _0x254da2;})[_0xdaad('0x3b')](respondWithFilteredResult(_0x149caf,_0x15c475))[_0xdaad('0x2e')](handleError(_0x149caf,null));};exports[_0xdaad('0x52')]=function(_0x586013,_0x3a76d9){var _0x4fbd43={'raw':!![],'where':{'id':_0x586013[_0xdaad('0x53')]['id']}},_0x186204={};_0x186204[_0xdaad('0x44')]=_[_0xdaad('0x46')](db[_0xdaad('0x40')][_0xdaad('0x41')]);_0x186204[_0xdaad('0x45')]=_[_0xdaad('0x46')](_0x586013[_0xdaad('0x45')]);_0x186204[_0xdaad('0x4d')]=_[_0xdaad('0x48')](_0x186204[_0xdaad('0x44')],_0x186204[_0xdaad('0x45')]);_0x4fbd43[_0xdaad('0x47')]=_[_0xdaad('0x48')](_0x186204['model'],qs['fields'](_0x586013[_0xdaad('0x45')][_0xdaad('0x49')]));_0x4fbd43[_0xdaad('0x47')]=_0x4fbd43[_0xdaad('0x47')][_0xdaad('0x54')]?_0x4fbd43[_0xdaad('0x47')]:_0x186204[_0xdaad('0x44')];if(_0x586013[_0xdaad('0x45')]['includeAll']){_0x4fbd43[_0xdaad('0x55')]=[{'all':!![]}];}_0x4fbd43=_[_0xdaad('0x50')]({},_0x4fbd43,_0x586013['options']);return db[_0xdaad('0x40')][_0xdaad('0x56')](_0x4fbd43)[_0xdaad('0x3b')](handleEntityNotFound(_0x3a76d9,null))[_0xdaad('0x3b')](respondWithResult(_0x3a76d9,null))['catch'](handleError(_0x3a76d9,null));};exports[_0xdaad('0x57')]=function(_0x25fc14,_0x25ccb5){return db[_0xdaad('0x40')]['create'](_0x25fc14[_0xdaad('0x58')],{})[_0xdaad('0x3b')](respondWithResult(_0x25ccb5,0xc9))['catch'](handleError(_0x25ccb5,null));};exports[_0xdaad('0x3a')]=function(_0x802211,_0x139693){if(_0x802211['body']['id']){delete _0x802211['body']['id'];}return db['SmsMessage']['find']({'where':{'id':_0x802211[_0xdaad('0x53')]['id']}})[_0xdaad('0x3b')](handleEntityNotFound(_0x139693,null))[_0xdaad('0x3b')](saveUpdates(_0x802211['body'],null))[_0xdaad('0x3b')](respondWithResult(_0x139693,null))[_0xdaad('0x2e')](handleError(_0x139693,null));};exports[_0xdaad('0x59')]=function(_0x146686,_0x46d0a2){return db[_0xdaad('0x40')][_0xdaad('0x56')]({'where':{'id':_0x146686[_0xdaad('0x53')]['id']}})[_0xdaad('0x3b')](handleEntityNotFound(_0x46d0a2,null))['then'](removeEntity(_0x46d0a2,null))[_0xdaad('0x2e')](handleError(_0x46d0a2,null));};exports[_0xdaad('0x5a')]=function(_0x42230a,_0x1b2660){return db[_0xdaad('0x40')][_0xdaad('0x5a')]()['then'](respondWithResult(_0x1b2660,null))[_0xdaad('0x2e')](handleError(_0x1b2660,null));};var interaction_log=require(_0xdaad('0x5b'))(_0xdaad('0x5c'));exports[_0xdaad('0x5d')]=function(_0x426de2,_0x435376,_0x2b686c){var _0x493ac8={'agent':{},'channel':_0xdaad('0x5e')};if(_0x426de2[_0xdaad('0x58')]['id']){delete _0x426de2['body']['id'];}_0x426de2['body'][_0xdaad('0x5f')]=!![];_0x426de2['body'][_0xdaad('0x60')]=moment()[_0xdaad('0x61')](_0xdaad('0x62'));_0x426de2[_0xdaad('0x58')]['UserId']=_0x426de2['body']['UserId']||_0x426de2[_0xdaad('0x63')]['id'];_0x493ac8[_0xdaad('0x64')]['id']=_0x426de2[_0xdaad('0x58')][_0xdaad('0x65')];return db['SmsMessage'][_0xdaad('0x56')]({'where':{'id':_0x426de2[_0xdaad('0x53')]['id'],'UserId':null}})[_0xdaad('0x3b')](handleEntityNotFound(_0x435376,null))['then'](saveUpdates(_0x426de2[_0xdaad('0x58')],null))[_0xdaad('0x3b')](function(_0x4fb7f9){if(_0x4fb7f9){_0x493ac8[_0xdaad('0x2c')]=_0x4fb7f9[_0xdaad('0x66')]({'plain':!![]});return db[_0xdaad('0x67')][_0xdaad('0x56')]({'where':{'id':_0x4fb7f9[_0xdaad('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x435376,null))[_0xdaad('0x3b')](function(_0x55c7e0){if(_0x55c7e0){return _0x55c7e0[_0xdaad('0x3a')]({'UserId':_0x426de2[_0xdaad('0x58')]['UserId'],'read1stAt':_[_0xdaad('0x69')](_0x55c7e0[_0xdaad('0x6a')])?moment()[_0xdaad('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdaad('0x3b')](function(_0x1cabe8){if(_0x1cabe8){_0x493ac8[_0xdaad('0x6b')]=_0x1cabe8['get']({'plain':!![]});interaction_log[_0xdaad('0x25')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x426de2[_0xdaad('0x63')]['id'],_0x426de2[_0xdaad('0x63')]['name'],_0x426de2[_0xdaad('0x63')][_0xdaad('0x6c')],_0x493ac8[_0xdaad('0x6b')]['id'],_0x426de2['body']?JSON[_0xdaad('0x6d')](_0x426de2[_0xdaad('0x58')]):'null');return respondWithRpcPromise(_0xdaad('0x6e'),_0xdaad('0x6f'),_0x493ac8);}return null;})[_0xdaad('0x3b')](function(_0x1e9aa1){var _0x5bee8f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1e9aa1[_0xdaad('0x2c')]['ContactId'];return db[_0xdaad('0x70')][_0xdaad('0x45')](_0x5bee8f,{'type':db[_0xdaad('0x71')][_0xdaad('0x72')][_0xdaad('0x73')],'raw':!![]})['then'](function(_0x1c764f){return _0x1c764f;});})[_0xdaad('0x3b')](function(_0x5d2f04){if(_0x5d2f04){_0x493ac8[_0xdaad('0x2c')][_0xdaad('0x74')]=_0x5d2f04[0x0];if(!_0x426de2[_0xdaad('0x58')]['UserId'])return;return db[_0xdaad('0x75')]['find']({'where':{'id':_0x426de2['body'][_0xdaad('0x65')],'role':_0xdaad('0x64')},'attributes':['id','name','fullname',_0xdaad('0x76'),'internal'],'raw':!![]});}return null;})[_0xdaad('0x3b')](function(_0xc8f155){if(!_0xc8f155)return null;_0x493ac8['message'][_0xdaad('0x64')]=_0xc8f155;return _0x493ac8;})[_0xdaad('0x3b')](function(_0x2545fe){if(_0x2545fe){if(_0x426de2[_0xdaad('0x58')][_0xdaad('0x77')]){_0x493ac8[_0xdaad('0x2c')][_0xdaad('0x78')]=util[_0xdaad('0x61')]('SIP/%s',_0x426de2[_0xdaad('0x63')][_0xdaad('0x3d')]);_0x493ac8[_0xdaad('0x2c')][_0xdaad('0x79')]=_0x493ac8[_0xdaad('0x79')];_0x493ac8[_0xdaad('0x2c')]['motionChannel']=_0x493ac8[_0xdaad('0x79')];_0x493ac8[_0xdaad('0x2c')][_0xdaad('0x7a')]=_0xdaad('0x5d');return respondWithRpcPromise('EventManager',_0xdaad('0x7b'),{'event':'acceptmessage','message':_0x493ac8[_0xdaad('0x2c')]},client9002)[_0xdaad('0x3b')](function(){return _0x493ac8;});}return _0x493ac8;}return null;})[_0xdaad('0x3b')](respondWithResult(_0x435376,null))[_0xdaad('0x2e')](handleError(_0x435376,null));};var interaction_log=require(_0xdaad('0x5b'))(_0xdaad('0x5c'));exports[_0xdaad('0x38')]=function(_0x20d469,_0x21a591,_0x201289){var _0x1f134f={'agent':{},'channel':_0xdaad('0x5e')};if(_0x20d469[_0xdaad('0x58')]['id']){delete _0x20d469['body']['id'];}_0x20d469['body']['UserId']=_0x20d469[_0xdaad('0x58')]['UserId']||_0x20d469[_0xdaad('0x63')]['id'];_0x1f134f['agent']['id']=_0x20d469['body'][_0xdaad('0x65')];return db[_0xdaad('0x40')][_0xdaad('0x56')]({'where':{'id':_0x20d469['params']['id'],'UserId':null}})[_0xdaad('0x3b')](handleEntityNotFound(_0x21a591,null))[_0xdaad('0x3b')](function(_0x32c06f){if(_0x32c06f){_0x1f134f[_0xdaad('0x2c')]=_0x32c06f[_0xdaad('0x66')]({'plain':!![]});return db['SmsInteraction'][_0xdaad('0x56')]({'where':{'id':_0x32c06f[_0xdaad('0x68')]}});}return null;})[_0xdaad('0x3b')](handleEntityNotFound(_0x21a591,null))[_0xdaad('0x3b')](function(_0x16fdc1){if(_0x16fdc1){_0x1f134f[_0xdaad('0x6b')]=_0x16fdc1['get']({'plain':!![]});interaction_log[_0xdaad('0x25')](_0xdaad('0x7c'),_0x20d469[_0xdaad('0x63')]['id'],_0x20d469['user']['name'],_0x20d469[_0xdaad('0x63')]['role'],_0x1f134f[_0xdaad('0x6b')]['id'],_0x20d469['body']?JSON[_0xdaad('0x6d')](_0x20d469[_0xdaad('0x58')]):_0xdaad('0x7d'));return respondWithRpcPromise(_0xdaad('0x7e'),_0xdaad('0x7f'),_0x1f134f);}return null;})['then'](function(_0x3b8f0e){var _0x24e621=_0xdaad('0x80')+_0x3b8f0e[_0xdaad('0x2c')][_0xdaad('0x81')];return db[_0xdaad('0x70')][_0xdaad('0x45')](_0x24e621,{'type':db[_0xdaad('0x71')][_0xdaad('0x72')][_0xdaad('0x73')],'raw':!![]})['then'](function(_0x401427){return _0x401427;});})[_0xdaad('0x3b')](function(_0x95db5a){if(_0x95db5a){_0x1f134f[_0xdaad('0x2c')]['contact']=_0x95db5a[0x0];if(!_0x20d469[_0xdaad('0x58')][_0xdaad('0x65')])return;return db[_0xdaad('0x75')][_0xdaad('0x56')]({'where':{'id':_0x20d469[_0xdaad('0x58')][_0xdaad('0x65')],'role':_0xdaad('0x64')},'attributes':['id',_0xdaad('0x3d'),'fullname','email','internal'],'raw':!![]});}return null;})[_0xdaad('0x3b')](function(_0x3aa04d){if(!_0x3aa04d)return null;_0x1f134f[_0xdaad('0x2c')][_0xdaad('0x64')]=_0x3aa04d;return _0x1f134f;})[_0xdaad('0x3b')](function(_0x4d815){if(_0x4d815){_0x4d815['message'][_0xdaad('0x78')]=util[_0xdaad('0x61')]('SIP/%s',_0x20d469[_0xdaad('0x63')][_0xdaad('0x3d')]);_0x4d815['message']['channel']=_0x1f134f[_0xdaad('0x79')];_0x4d815[_0xdaad('0x2c')][_0xdaad('0x82')]=_0x1f134f[_0xdaad('0x79')];_0x4d815['message']['event']=_0xdaad('0x38');respondWithRpcPromise('EventManager',_0xdaad('0x7b'),{'event':'rejectmessage','message':_0x4d815[_0xdaad('0x2c')]},client9002);return _0x1f134f;}return null;})[_0xdaad('0x3b')](respondWithResult(_0x21a591,null))[_0xdaad('0x2e')](handleError(_0x21a591,null));};exports['status']=function(_0x4d8ba3,_0x3f6b3c,_0x487bb5){if(_0x4d8ba3[_0xdaad('0x58')]['id']){delete _0x4d8ba3[_0xdaad('0x58')]['id'];}var _0x558fcc;return db[_0xdaad('0x40')][_0xdaad('0x56')]({'where':{'id':_0x4d8ba3['params']['id']}})['then'](handleEntityNotFound(_0x3f6b3c,null))[_0xdaad('0x3b')](function(_0x1cc8b2){if(_0x1cc8b2){_0x558fcc=_0x1cc8b2;return db[_0xdaad('0x83')][_0xdaad('0x56')]({'where':{'id':_0x1cc8b2[_0xdaad('0x84')]}});}})['then'](handleEntityNotFound(_0x3f6b3c,null))[_0xdaad('0x3b')](function(_0x4958c3){if(_0x4958c3){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdaad('0x30'),_0xdaad('0x85'),_0x4958c3[_0xdaad('0x43')],util[_0xdaad('0x86')](_0x4d8ba3[_0xdaad('0x58')],{'showHidden':![],'depth':null}));switch(_0x4958c3['type']){case _0xdaad('0x87'):if(_0x4d8ba3[_0xdaad('0x58')][_0xdaad('0x88')]&&_0x4d8ba3[_0xdaad('0x58')][_0xdaad('0x88')]===_0x558fcc[_0xdaad('0x89')]){return _0x558fcc[_0xdaad('0x3a')]({'read':!![]});}else{logger[_0xdaad('0x2a')](_0xdaad('0x8a'),'status','twilio',util[_0xdaad('0x86')](_0x4d8ba3[_0xdaad('0x58')],{'showHidden':![],'depth':null}));}break;case _0xdaad('0x8b'):if(_0x4d8ba3['body']['MessageUUID']&&_0x4d8ba3['body'][_0xdaad('0x8c')]===_0x558fcc[_0xdaad('0x89')]&&_[_0xdaad('0x8d')]([_0xdaad('0x8e'),'delivered'],_0x4d8ba3[_0xdaad('0x58')][_0xdaad('0x8f')])>=0x0){return _0x558fcc[_0xdaad('0x3a')]({'read':!![]});}else{logger[_0xdaad('0x2a')](_0xdaad('0x8a'),_0xdaad('0x30'),'plivio',util[_0xdaad('0x86')](_0x4d8ba3['body'],{'showHidden':![],'depth':null}));}break;case _0xdaad('0x90'):var _0x335f88=_0x4d8ba3[_0xdaad('0x58')]['results'][0x0];if(_0x335f88[_0xdaad('0x30')]['groupName']===_0xdaad('0x91')){return _0x558fcc[_0xdaad('0x3a')]({'read':!![]});}else{logger[_0xdaad('0x2a')](_0xdaad('0x8a'),_0xdaad('0x30'),_0xdaad('0x90'),util[_0xdaad('0x86')](_0x4d8ba3[_0xdaad('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x558fcc;}})[_0xdaad('0x3b')](respondWithResult(_0x3f6b3c,null))[_0xdaad('0x2e')](handleError(_0x3f6b3c,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index b473dc2..db47bb4 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 _0xca33=['exports','events','SmsMessage','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x114b90,_0x104079){var _0x4dcf0b=function(_0x11e162){while(--_0x11e162){_0x114b90['push'](_0x114b90['shift']());}};_0x4dcf0b(++_0x104079);}(_0xca33,0x131));var _0x3ca3=function(_0x36ea5e,_0x2b8724){_0x36ea5e=_0x36ea5e-0x0;var _0x188598=_0xca33[_0x36ea5e];return _0x188598;};'use strict';var EventEmitter=require(_0x3ca3('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x3ca3('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x3ca3('0x2')](0x0);var events={'afterCreate':_0x3ca3('0x3'),'afterUpdate':_0x3ca3('0x4'),'afterDestroy':_0x3ca3('0x5')};function emitEvent(_0x346ef6){return function(_0x1ac1f8,_0x4ae0be,_0x1c1e86){SmsMessageEvents['emit'](_0x346ef6+':'+_0x1ac1f8['id'],_0x1ac1f8);SmsMessageEvents['emit'](_0x346ef6,_0x1ac1f8);_0x1c1e86(null);};}for(var e in events){if(events[_0x3ca3('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x3ca3('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x4d96=['hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x34fa32,_0x190ccb){var _0x24303f=function(_0xfc5013){while(--_0xfc5013){_0x34fa32['push'](_0x34fa32['shift']());}};_0x24303f(++_0x190ccb);}(_0x4d96,0xfc));var _0x64d9=function(_0x23f074,_0x5572dc){_0x23f074=_0x23f074-0x0;var _0x388f9b=_0x4d96[_0x23f074];return _0x388f9b;};'use strict';var EventEmitter=require(_0x64d9('0x0'));var SmsMessage=require(_0x64d9('0x1'))['db'][_0x64d9('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x64d9('0x3')](0x0);var events={'afterCreate':_0x64d9('0x4'),'afterUpdate':'update','afterDestroy':_0x64d9('0x5')};function emitEvent(_0x13e496){return function(_0x443a55,_0x52b29d,_0x1496c1){SmsMessageEvents[_0x64d9('0x6')](_0x13e496+':'+_0x443a55['id'],_0x443a55);SmsMessageEvents[_0x64d9('0x6')](_0x13e496,_0x443a55);_0x1496c1(null);};}for(var e in events){if(events[_0x64d9('0x7')](e)){var event=events[e];SmsMessage[_0x64d9('0x8')](e,emitEvent(event));}}module[_0x64d9('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 0876494..e477e5e 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 _0x086e=['models','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','update','createdAt','catch','error','find','SmsAccountId','then','type','twilio','accountSid','authToken','body','phone','remote','/api/sms/messages/','/status?token=','token','afterCreate','inspect','skebby','username','password','smsMethod','sender','login?username=','split','POST','session_key','total_sent','internal_order_id','read','SmsMessage,\x20%s,\x20%s,\x20%s','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','infobip','baseUrl','application/json','IBSSO\x20','csc','crypto','apiKey','login','text','timestamp','length','createHash','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','Basic\x20%s','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT'];(function(_0x1b6a69,_0x5e7785){var _0x2489b6=function(_0x17d6b8){while(--_0x17d6b8){_0x1b6a69['push'](_0x1b6a69['shift']());}};_0x2489b6(++_0x5e7785);}(_0x086e,0x6a));var _0xe086=function(_0x4057ec,_0x425f09){_0x4057ec=_0x4057ec-0x0;var _0xe062c=_0x086e[_0x4057ec];return _0xe062c;};'use strict';var _=require(_0xe086('0x0'));var util=require(_0xe086('0x1'));var logger=require(_0xe086('0x2'))(_0xe086('0x3'));var moment=require(_0xe086('0x4'));var BPromise=require(_0xe086('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe086('0x6'));var rimraf=require(_0xe086('0x7'));var config=require('../../config/environment');var attributes=require(_0xe086('0x8'));module[_0xe086('0x9')]=function(_0x5ae8f0,_0x35d772){return _0x5ae8f0[_0xe086('0xa')](_0xe086('0xb'),attributes,{'tableName':_0xe086('0xc'),'paranoid':![],'indexes':[{'name':_0xe086('0xd'),'fields':[_0xe086('0xd')]},{'name':_0xe086('0xe'),'fields':['body'],'type':_0xe086('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47a61c,_0x3b0458,_0x569778){var _0xf1772e=_0x5ae8f0[_0xe086('0x10')];var _0x31ea5d=_0x47a61c[_0xe086('0x11')]({'plain':!![]});if(_0x31ea5d[_0xe086('0x12')]['toLowerCase']()==='in'||_0x31ea5d['direction'][_0xe086('0x13')]()===_0xe086('0x14')&&!_0x31ea5d[_0xe086('0x15')]&&!_[_0xe086('0x16')](_0x31ea5d['UserId'])&&!_['isNil'](_0x31ea5d[_0xe086('0x17')])){_0xf1772e[_0xe086('0x18')][_0xe086('0x19')]({'where':{'id':_0x31ea5d[_0xe086('0x17')]}})['then'](function(_0x3a7be2){if(_0x3a7be2){_0x3a7be2[_0xe086('0x1a')]({'lastMsgAt':_0x31ea5d[_0xe086('0x1b')],'lastMsgDirection':_0x31ea5d[_0xe086('0x12')]['toLowerCase']()});}})[_0xe086('0x1c')](function(_0x1cbda7){console[_0xe086('0x1d')](_0x1cbda7);});}if(_0x31ea5d[_0xe086('0x12')]==='out'&&!_0x31ea5d[_0xe086('0x15')]){var _0x5893ab;_0xf1772e['SmsAccount'][_0xe086('0x1e')]({'where':{'id':_0x31ea5d[_0xe086('0x1f')]},'raw':!![]})[_0xe086('0x20')](function(_0x24e212){_0x5893ab=_0x24e212;if(_0x5893ab&&_0x5893ab[_0xe086('0x21')]){switch(_0x5893ab[_0xe086('0x21')]){case _0xe086('0x22'):var _0x4a4364=require('twilio');if(_0x5893ab[_0xe086('0x23')]&&_0x5893ab[_0xe086('0x24')]&&_0x5893ab['phone']){var _0x421800=new _0x4a4364(_0x5893ab[_0xe086('0x23')],_0x5893ab[_0xe086('0x24')]);_0x421800['messages']['create']({'body':_0x31ea5d[_0xe086('0x25')],'to':_0x31ea5d[_0xe086('0x26')],'from':_0x5893ab['phone'],'statusCallback':_0x5893ab[_0xe086('0x27')]+_0xe086('0x28')+_0x31ea5d['id']+_0xe086('0x29')+_0x5893ab[_0xe086('0x2a')]})[_0xe086('0x20')](function(_0x2b9062){if(_0x2b9062['sid']){return _0x47a61c[_0xe086('0x1a')]({'messageId':_0x2b9062['sid']});}})[_0xe086('0x1c')](function(_0x537fbf){logger[_0xe086('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe086('0x2b'),_0xe086('0x22'),util[_0xe086('0x2c')](_0x537fbf,{'showHidden':![],'depth':null}));});}else{logger[_0xe086('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe086('0x2b'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xe086('0x2d'):var _0x333f58='https://api.skebby.it/API/v1.0/REST/';if(_0x5893ab[_0xe086('0x2e')]&&_0x5893ab[_0xe086('0x2f')]){var _0x218636={'recipient':[_0x31ea5d[_0xe086('0x26')]],'message':_0x31ea5d[_0xe086('0x25')],'message_type':_0x5893ab[_0xe086('0x30')]};if(_0x5893ab[_0xe086('0x30')]&&_0x5893ab['smsMethod']!=='SI'){_0x218636[_0xe086('0x31')]=_0x5893ab['phone'];}var _0x23df6b={'url':_0x333f58+_0xe086('0x32')+_0x5893ab[_0xe086('0x2e')]+'&password='+_0x5893ab[_0xe086('0x2f')],'method':'GET'};rp(_0x23df6b)['then'](function(_0x5cb82e){var _0x3e2585=_0x5cb82e[_0xe086('0x33')](';');var _0x4415b6={'user_key':_0x3e2585[0x0],'session_key':_0x3e2585[0x1]};_0x23df6b={'url':_0x333f58+'sms','method':_0xe086('0x34'),'headers':{'user_key':_0x4415b6['user_key'],'Session_key':_0x4415b6[_0xe086('0x35')]},'json':!![],'body':_0x218636};return rp(_0x23df6b);})[_0xe086('0x20')](function(_0x48d12c){if(_0x48d12c[_0xe086('0x36')]>=0x1){var _0x5bd5ed={'messageId':_0x48d12c[_0xe086('0x37')]};if(_0x5893ab[_0xe086('0x30')]!=='GP'||!_0x5893ab['deliveryReport']){_0x5bd5ed[_0xe086('0x38')]=!![];}return _0x47a61c['update'](_0x5bd5ed);}else{return logger[_0xe086('0x1d')](_0xe086('0x39'),_0xe086('0x2b'),_0xe086('0x2d'),util[_0xe086('0x2c')](_0x48d12c,{'showHidden':![],'depth':null}));}})[_0xe086('0x1c')](function(_0x3bd0b5){return logger[_0xe086('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe086('0x2b'),_0xe086('0x2d'),util[_0xe086('0x2c')](_0x3bd0b5,{'showHidden':![],'depth':null}));});}else{logger[_0xe086('0x1d')](_0xe086('0x39'),'afterCreate',_0xe086('0x2d'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x5893ab['authToken']){var _0x6dc641={'recipient':_0x31ea5d[_0xe086('0x26')],'message':_0x31ea5d['body'],'sender':_0x5893ab[_0xe086('0x3a')]||_0x5893ab[_0xe086('0x26')],'authorization':_0x5893ab[_0xe086('0x24')]};var _0x3b0458={'method':_0xe086('0x34'),'uri':_0xe086('0x3b'),'body':_0x6dc641,'json':!![]};rp(_0x3b0458)['then'](function(_0x42e5b6){var _0x3d8a73={'messageId':_0x42e5b6[_0xe086('0x3c')]};if(!_0x5893ab[_0xe086('0x3d')]){_0x3d8a73['read']=!![];}return _0x47a61c[_0xe086('0x1a')](_0x3d8a73);})['catch'](function(_0x3d0de9){logger[_0xe086('0x1d')](_0xe086('0x39'),'afterCreate','connectel',util[_0xe086('0x2c')](_0x3d0de9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe086('0x39'),_0xe086('0x2b'),'connectel',_0xe086('0x3e'));}break;case _0xe086('0x3f'):if(_0x5893ab[_0xe086('0x2e')]&&_0x5893ab[_0xe086('0x2f')]){var _0x6dc641={'messages':[{'source':_0xe086('0x40'),'to':_0x31ea5d[_0xe086('0x26')],'body':_0x31ea5d[_0xe086('0x25')],'from':_0x5893ab[_0xe086('0x3a')]||_0x5893ab[_0xe086('0x26')]}]};var _0x545ae5=util[_0xe086('0x41')](_0xe086('0x42'),_0x5893ab[_0xe086('0x2e')],_0x5893ab[_0xe086('0x2f')]);var _0x3b0458={'method':_0xe086('0x34'),'uri':_0xe086('0x43'),'body':_0x6dc641,'headers':{'Authorization':util[_0xe086('0x41')]('Basic\x20%s',new Buffer(_0x545ae5)[_0xe086('0x44')](_0xe086('0x45')))},'json':!![]};rp(_0x3b0458)['then'](function(_0x2f3e9b){if(_0x2f3e9b[_0xe086('0x46')]>=0xc8&&_0x2f3e9b[_0xe086('0x46')]<=0xce){if(_0x2f3e9b[_0xe086('0x47')]&&_0x2f3e9b[_0xe086('0x47')][_0xe086('0x48')]>0x0){var _0xe2136=_[_0xe086('0x49')](_0x2f3e9b[_0xe086('0x47')][_0xe086('0x4a')]);var _0x11ba72={'messageId':_0xe2136[_0xe086('0x4b')]};if(!_0x5893ab['deliveryReport']){_0x11ba72[_0xe086('0x38')]=!![];}return _0x47a61c[_0xe086('0x1a')](_0x11ba72);}else{logger[_0xe086('0x1d')](_0xe086('0x39'),_0xe086('0x2b'),_0xe086('0x4c'),util['inspect'](_0x2f3e9b,{'showHidden':![],'depth':null}));}}else{logger[_0xe086('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe086('0x4c'),util[_0xe086('0x2c')](_0x2f3e9b,{'showHidden':![],'depth':null}));}})[_0xe086('0x1c')](function(_0x5210de){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe086('0x2b'),_0xe086('0x4c'),util['inspect'](_0x5210de,{'showHidden':![],'depth':null}));});}else{logger[_0xe086('0x1d')](_0xe086('0x39'),'afterCreate','clickSend',_0xe086('0x4d'));}break;case _0xe086('0x4e'):if(_0x5893ab[_0xe086('0x4f')]&&_0x5893ab[_0xe086('0x24')]){var _0x6dc641={'dst':_0x31ea5d[_0xe086('0x26')],'text':_0x31ea5d[_0xe086('0x25')],'src':_0x5893ab[_0xe086('0x3a')]||_0x5893ab[_0xe086('0x26')],'url':_0x5893ab['remote']+_0xe086('0x28')+_0x31ea5d['id']+_0xe086('0x29')+_0x5893ab[_0xe086('0x2a')]};var _0x545ae5=util[_0xe086('0x41')](_0xe086('0x42'),_0x5893ab[_0xe086('0x4f')],_0x5893ab['authToken']);var _0x3b0458={'method':_0xe086('0x34'),'uri':util[_0xe086('0x41')](_0xe086('0x50'),_0x5893ab[_0xe086('0x4f')]),'body':_0x6dc641,'headers':{'Authorization':util[_0xe086('0x41')]('Basic\x20%s',new Buffer(_0x545ae5)[_0xe086('0x44')](_0xe086('0x45')))},'json':!![]};rp(_0x3b0458)[_0xe086('0x20')](function(_0x3d7235){var _0x4b9302={'messageId':_0x3d7235['message_uuid'][0x0]};return _0x47a61c['update'](_0x4b9302);})['catch'](function(_0x531a51){logger['error'](_0xe086('0x39'),'afterCreate',_0xe086('0x4e'),util['inspect'](_0x531a51,{'showHidden':![],'depth':null}));});}else{logger[_0xe086('0x1d')](_0xe086('0x39'),_0xe086('0x2b'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xe086('0x51'):if(_0x5893ab[_0xe086('0x2e')]&&_0x5893ab['password']){if(_0x5893ab[_0xe086('0x52')]){var _0x15ad05={'method':_0xe086('0x34'),'uri':_0x5893ab[_0xe086('0x52')]+'/auth/1/session','body':{'username':_0x5893ab['username'],'password':_0x5893ab[_0xe086('0x2f')]},'json':!![]};return rp(_0x15ad05)['then'](function(_0x20ab27){var _0x3b7b47={'method':_0xe086('0x34'),'uri':_0x5893ab['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x5893ab['phone'],'destinations':[{'to':_0x31ea5d[_0xe086('0x26')]}],'text':_0x31ea5d[_0xe086('0x25')],'notifyUrl':_0x5893ab[_0xe086('0x27')]+_0xe086('0x28')+_0x31ea5d['id']+'/status?token='+_0x5893ab[_0xe086('0x2a')],'notifyContentType':_0xe086('0x53'),'callbackData':_0x5893ab['phone']+';'+_0x31ea5d[_0xe086('0x25')]}]},'headers':{'Authorization':_0xe086('0x54')+_0x20ab27['token']},'json':!![]};return rp(_0x3b7b47)[_0xe086('0x20')](function(_0x5ebef8){if(_0x5ebef8[_0xe086('0x4a')]){var _0x4ce05b={'messageId':_0x5ebef8['messages'][0x0]['messageId']};if(!_0x5893ab[_0xe086('0x3d')]){_0x4ce05b[_0xe086('0x38')]=!![];}return _0x47a61c['update'](_0x4ce05b);}else{return logger[_0xe086('0x1d')](_0xe086('0x39'),_0xe086('0x2b'),_0xe086('0x51'),util[_0xe086('0x2c')](_0x5ebef8,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x475a20){return logger[_0xe086('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe086('0x51'),util[_0xe086('0x2c')](_0x475a20,{'showHidden':![],'depth':null}));});}else{logger[_0xe086('0x1d')](_0xe086('0x39'),'afterCreate','infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0xe086('0x1d')](_0xe086('0x39'),_0xe086('0x2b'),_0xe086('0x51'),_0xe086('0x4d'));}break;case _0xe086('0x55'):var _0x3233be=require(_0xe086('0x56'));if(_0x5893ab[_0xe086('0x57')]){var _0x307519={};_0x307519[_0xe086('0x58')]=_0x5893ab[_0xe086('0x2e')];_0x307519[_0xe086('0x26')]=_0x31ea5d[_0xe086('0x26')];_0x307519[_0xe086('0x31')]=_0x5893ab[_0xe086('0x26')];_0x307519[_0xe086('0x59')]=_0x31ea5d[_0xe086('0x25')];_0x307519[_0xe086('0x5a')]=+new Date();var _0x1ba346='';var _0x30bc45='';var _0x3e8327=Object['keys'](_0x307519);_0x3e8327['sort']();for(var _0x18036f=0x0;_0x18036f<_0x3e8327[_0xe086('0x5b')];_0x18036f++){if(_0x1ba346!=''){_0x1ba346+='&';}_0x1ba346+=_0x3e8327[_0x18036f]+'='+encodeURIComponent(_0x307519[_0x3e8327[_0x18036f]]);_0x30bc45+=_0x307519[_0x3e8327[_0x18036f]];}_0x30bc45+=_0x5893ab[_0xe086('0x57')];_0x30bc45=_0x3233be[_0xe086('0x5c')](_0xe086('0x5d'))['update'](_0x30bc45)[_0xe086('0x5e')](_0xe086('0x5f'));if(_0x1ba346!==''){_0x1ba346+='&';}_0x1ba346+=_0xe086('0x60')+_0x30bc45;var _0x23df6b={'method':_0xe086('0x61'),'uri':_0x5893ab[_0xe086('0x52')]+_0xe086('0x62')+_0x1ba346,'json':!![]};return rp(_0x23df6b)[_0xe086('0x20')](function(_0x1d8159){var _0x5201ad=Object['keys'](_0x1d8159);if(_0x1d8159[_0x5201ad[0x0]][_0xe086('0x1d')]&&parseInt(_0x1d8159[_0x5201ad[0x0]]['error'])===0x0){var _0x23418b={'messageId':_0x1d8159[_0x5201ad[0x0]][_0xe086('0x63')]};if(!_0x5893ab[_0xe086('0x3d')]){_0x23418b[_0xe086('0x38')]=!![];}return _0x47a61c[_0xe086('0x1a')](_0x23418b);}else{return logger['error'](_0xe086('0x39'),_0xe086('0x2b'),_0xe086('0x55'),util['inspect'](_0x1d8159['error'],{'showHidden':![],'depth':null}));}})[_0xe086('0x1c')](function(_0x5ce24f){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe086('0x2b'),_0xe086('0x55'),util[_0xe086('0x2c')](_0x5ce24f,{'showHidden':![],'depth':null}));});}else{logger[_0xe086('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe086('0x2b'),_0xe086('0x55'),_0xe086('0x64'));}break;case'clickatell':if(_0x5893ab[_0xe086('0x57')]){var _0x40e145={'method':_0xe086('0x34'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x5893ab[_0xe086('0x57')]},'body':{'content':_0x31ea5d['body'],'to':[_0x31ea5d[_0xe086('0x26')]],'from':_0x5893ab[_0xe086('0x26')],'binary':![],'clientMessageId':_0xe086('0x65'),'charset':_0xe086('0x66')},'json':!![]};rp(_0x40e145)[_0xe086('0x20')](function(_0x17af53){if(!_0x17af53[_0xe086('0x1d')]){var _0x355ab2={'messageId':_0x17af53['messages'][0x0][_0xe086('0x67')]};if(!_0x5893ab[_0xe086('0x3d')]){_0x355ab2[_0xe086('0x38')]=!![];}return _0x47a61c[_0xe086('0x1a')](_0x355ab2);}else{return logger['error'](_0xe086('0x39'),_0xe086('0x2b'),_0xe086('0x68'),util[_0xe086('0x2c')](_0x17af53[_0xe086('0x1d')],{'showHidden':![],'depth':null}));}})[_0xe086('0x1c')](function(_0xb5bbe4){return logger[_0xe086('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',util['inspect'](_0xb5bbe4,{'showHidden':![],'depth':null}));});}else{logger[_0xe086('0x1d')](_0xe086('0x39'),_0xe086('0x2b'),_0xe086('0x68'),_0xe086('0x64'));}break;case _0xe086('0x69'):if(_0x5893ab['username']&&_0x5893ab['password']){var _0x545ae5=util['format'](_0xe086('0x42'),_0x5893ab[_0xe086('0x2e')],_0x5893ab[_0xe086('0x2f')]);var _0x3b0458={'method':_0xe086('0x34'),'uri':_0xe086('0x6a')+_0x5893ab[_0xe086('0x6b')]+_0xe086('0x6c'),'body':{'to':[_0x31ea5d[_0xe086('0x26')]],'text':_0x31ea5d[_0xe086('0x25')],'from':_0x5893ab['phone'],'applicationId':_0x5893ab[_0xe086('0x6d')]},'headers':{'Authorization':util[_0xe086('0x41')](_0xe086('0x6e'),new Buffer(_0x545ae5)[_0xe086('0x44')](_0xe086('0x45')))},'json':!![]};rp(_0x3b0458)[_0xe086('0x20')](function(_0x2a7d81){if(_0x2a7d81['id']){var _0x32a458={'messageId':_0x2a7d81['id']};return _0x47a61c[_0xe086('0x1a')](_0x32a458);}else{logger[_0xe086('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe086('0x2b'),'bandwidth',util['inspect'](_0x2a7d81,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5e57a6){logger[_0xe086('0x1d')](_0xe086('0x39'),_0xe086('0x2b'),_0xe086('0x69'),util[_0xe086('0x2c')](_0x5e57a6,{'showHidden':![],'depth':null}));});}else{logger[_0xe086('0x1d')](_0xe086('0x39'),_0xe086('0x2b'),'bandwidth',_0xe086('0x4d'));}break;case _0xe086('0x6f'):if(_0x5893ab[_0xe086('0x57')]){var _0x14e13d={};var _0x23df6b={'method':_0xe086('0x34'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xe086('0x70')+_0x5893ab['apiKey'],'Content-Type':_0xe086('0x53')},'body':{'from':_0x5893ab[_0xe086('0x26')],'to':_0x31ea5d['phone'],'text':_0x31ea5d[_0xe086('0x25')]},'json':!![]};return rp(_0x23df6b)[_0xe086('0x20')](function(_0x413ee1){if(_0x413ee1[_0xe086('0x71')]==0xca){_0x14e13d[_0xe086('0x72')]=_0x413ee1;var _0x2b8df2={'method':_0xe086('0x34'),'uri':_0xe086('0x73'),'headers':{'Authorization':_0xe086('0x70')+_0x5893ab[_0xe086('0x57')],'Content-Type':'application/json'},'body':{'refid':_0x14e13d[_0xe086('0x72')][_0xe086('0x74')]},'json':!![]};return rp(_0x2b8df2)['then'](function(_0x463076){_0x14e13d[_0xe086('0x75')]=_0x463076;var _0x2dd099={'messageId':_0x14e13d[_0xe086('0x72')][_0xe086('0x74')],'read':!![]};return _0x47a61c[_0xe086('0x1a')](_0x2dd099);});}else{return logger[_0xe086('0x1d')](_0xe086('0x39'),_0xe086('0x2b'),'intelepeer',util['inspect'](_0x413ee1,{'showHidden':![],'depth':null}));}})[_0xe086('0x1c')](function(_0x32acf4){return logger[_0xe086('0x1d')](_0xe086('0x39'),_0xe086('0x2b'),_0xe086('0x6f'),util[_0xe086('0x2c')](_0x32acf4,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xe086('0x39'),_0xe086('0x2b'),_0xe086('0x6f'),_0xe086('0x76'));}break;}}})[_0xe086('0x77')](function(){_0x569778();});}else{_0x569778();}}},'charset':_0xe086('0x78'),'collate':_0xe086('0x79')});}; \ No newline at end of file +var _0x8dd7=['SmsAccount','find','type','twilio','authToken','phone','accountSid','messages','create','body','remote','/api/sms/messages/','/status?token=','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','catch','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','http_code','data','queued_count','message_id','clickSend','authId','token','toString','base64','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','https://messaging.bandwidth.com/api/v2/users/','accountId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','path','rimraf','../../config/environment','define','messageId','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','error','out'];(function(_0x3eaa61,_0x588aaf){var _0x1e5c3e=function(_0x5452bb){while(--_0x5452bb){_0x3eaa61['push'](_0x3eaa61['shift']());}};_0x1e5c3e(++_0x588aaf);}(_0x8dd7,0x157));var _0x78dd=function(_0xed4881,_0x45771c){_0xed4881=_0xed4881-0x0;var _0x7fcbd5=_0x8dd7[_0xed4881];return _0x7fcbd5;};'use strict';var _=require(_0x78dd('0x0'));var util=require(_0x78dd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x78dd('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x78dd('0x3'));var rimraf=require(_0x78dd('0x4'));var config=require(_0x78dd('0x5'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x5c3a26,_0x1f78c1){return _0x5c3a26[_0x78dd('0x6')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x78dd('0x7'),'fields':[_0x78dd('0x7')]},{'name':'fti_sms_messages','fields':['body'],'type':_0x78dd('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2efddc,_0x45a60c,_0x13c151){var _0x188523=_0x5c3a26[_0x78dd('0x9')];var _0x2e4861=_0x2efddc[_0x78dd('0xa')]({'plain':!![]});if(_0x2e4861[_0x78dd('0xb')][_0x78dd('0xc')]()==='in'||_0x2e4861[_0x78dd('0xb')][_0x78dd('0xc')]()==='out'&&!_0x2e4861[_0x78dd('0xd')]&&!_[_0x78dd('0xe')](_0x2e4861[_0x78dd('0xf')])&&!_[_0x78dd('0xe')](_0x2e4861[_0x78dd('0x10')])){_0x188523['SmsInteraction'][_0x78dd('0x11')]({'where':{'id':_0x2e4861[_0x78dd('0x10')]}})[_0x78dd('0x12')](function(_0x265f80){if(_0x265f80){_0x265f80[_0x78dd('0x13')]({'lastMsgAt':_0x2e4861[_0x78dd('0x14')],'lastMsgDirection':_0x2e4861[_0x78dd('0xb')][_0x78dd('0xc')]()});}})['catch'](function(_0x3f64dd){console[_0x78dd('0x15')](_0x3f64dd);});}if(_0x2e4861[_0x78dd('0xb')]===_0x78dd('0x16')&&!_0x2e4861['secret']){var _0x4eaef8;_0x188523[_0x78dd('0x17')][_0x78dd('0x18')]({'where':{'id':_0x2e4861['SmsAccountId']},'raw':!![]})[_0x78dd('0x12')](function(_0xe8f1ac){_0x4eaef8=_0xe8f1ac;if(_0x4eaef8&&_0x4eaef8[_0x78dd('0x19')]){switch(_0x4eaef8[_0x78dd('0x19')]){case _0x78dd('0x1a'):var _0x1ebf85=require(_0x78dd('0x1a'));if(_0x4eaef8['accountSid']&&_0x4eaef8[_0x78dd('0x1b')]&&_0x4eaef8[_0x78dd('0x1c')]){var _0x3b9c9a=new _0x1ebf85(_0x4eaef8[_0x78dd('0x1d')],_0x4eaef8[_0x78dd('0x1b')]);_0x3b9c9a[_0x78dd('0x1e')][_0x78dd('0x1f')]({'body':_0x2e4861[_0x78dd('0x20')],'to':_0x2e4861[_0x78dd('0x1c')],'from':_0x4eaef8['phone'],'statusCallback':_0x4eaef8[_0x78dd('0x21')]+_0x78dd('0x22')+_0x2e4861['id']+_0x78dd('0x23')+_0x4eaef8['token']})[_0x78dd('0x12')](function(_0x4b76e7){if(_0x4b76e7[_0x78dd('0x24')]){return _0x2efddc['update']({'messageId':_0x4b76e7[_0x78dd('0x24')]});}})['catch'](function(_0x324896){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x78dd('0x25'),_0x78dd('0x1a'),util[_0x78dd('0x26')](_0x324896,{'showHidden':![],'depth':null}));});}else{logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x1a'),_0x78dd('0x28'));}break;case _0x78dd('0x29'):var _0x1a0259=_0x78dd('0x2a');if(_0x4eaef8[_0x78dd('0x2b')]&&_0x4eaef8[_0x78dd('0x2c')]){var _0x30f377={'recipient':[_0x2e4861[_0x78dd('0x1c')]],'message':_0x2e4861['body'],'message_type':_0x4eaef8[_0x78dd('0x2d')]};if(_0x4eaef8[_0x78dd('0x2d')]&&_0x4eaef8[_0x78dd('0x2d')]!=='SI'){_0x30f377[_0x78dd('0x2e')]=_0x4eaef8['phone'];}var _0x51cad4={'url':_0x1a0259+'login?username='+_0x4eaef8[_0x78dd('0x2b')]+'&password='+_0x4eaef8[_0x78dd('0x2c')],'method':_0x78dd('0x2f')};rp(_0x51cad4)[_0x78dd('0x12')](function(_0x1b2777){var _0x5259ed=_0x1b2777[_0x78dd('0x30')](';');var _0x4e9226={'user_key':_0x5259ed[0x0],'session_key':_0x5259ed[0x1]};_0x51cad4={'url':_0x1a0259+_0x78dd('0x31'),'method':_0x78dd('0x32'),'headers':{'user_key':_0x4e9226[_0x78dd('0x33')],'Session_key':_0x4e9226[_0x78dd('0x34')]},'json':!![],'body':_0x30f377};return rp(_0x51cad4);})[_0x78dd('0x12')](function(_0x5988d1){if(_0x5988d1[_0x78dd('0x35')]>=0x1){var _0x54067e={'messageId':_0x5988d1[_0x78dd('0x36')]};if(_0x4eaef8['smsMethod']!=='GP'||!_0x4eaef8[_0x78dd('0x37')]){_0x54067e[_0x78dd('0x38')]=!![];}return _0x2efddc['update'](_0x54067e);}else{return logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x29'),util[_0x78dd('0x26')](_0x5988d1,{'showHidden':![],'depth':null}));}})[_0x78dd('0x39')](function(_0x2a90ae){return logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),'skebby',util[_0x78dd('0x26')](_0x2a90ae,{'showHidden':![],'depth':null}));});}else{logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),'skebby',_0x78dd('0x3a'));}break;case _0x78dd('0x3b'):if(_0x4eaef8[_0x78dd('0x1b')]){var _0x548dd6={'recipient':_0x2e4861[_0x78dd('0x1c')],'message':_0x2e4861[_0x78dd('0x20')],'sender':_0x4eaef8['senderString']||_0x4eaef8[_0x78dd('0x1c')],'authorization':_0x4eaef8[_0x78dd('0x1b')]};var _0x45a60c={'method':_0x78dd('0x32'),'uri':_0x78dd('0x3c'),'body':_0x548dd6,'json':!![]};rp(_0x45a60c)[_0x78dd('0x12')](function(_0x5ef305){var _0x182a46={'messageId':_0x5ef305['requestid']};if(!_0x4eaef8[_0x78dd('0x37')]){_0x182a46['read']=!![];}return _0x2efddc['update'](_0x182a46);})['catch'](function(_0xceb648){logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x3b'),util[_0x78dd('0x26')](_0xceb648,{'showHidden':![],'depth':null}));});}else{logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x3b'),_0x78dd('0x3d'));}break;case _0x78dd('0x3e'):if(_0x4eaef8[_0x78dd('0x2b')]&&_0x4eaef8[_0x78dd('0x2c')]){var _0x548dd6={'messages':[{'source':_0x78dd('0x3f'),'to':_0x2e4861[_0x78dd('0x1c')],'body':_0x2e4861['body'],'from':_0x4eaef8[_0x78dd('0x40')]||_0x4eaef8[_0x78dd('0x1c')]}]};var _0xf0298e=util[_0x78dd('0x41')](_0x78dd('0x42'),_0x4eaef8[_0x78dd('0x2b')],_0x4eaef8[_0x78dd('0x2c')]);var _0x45a60c={'method':_0x78dd('0x32'),'uri':_0x78dd('0x43'),'body':_0x548dd6,'headers':{'Authorization':util[_0x78dd('0x41')](_0x78dd('0x44'),new Buffer(_0xf0298e)['toString']('base64'))},'json':!![]};rp(_0x45a60c)[_0x78dd('0x12')](function(_0x2b15c3){if(_0x2b15c3[_0x78dd('0x45')]>=0xc8&&_0x2b15c3[_0x78dd('0x45')]<=0xce){if(_0x2b15c3['data']&&_0x2b15c3[_0x78dd('0x46')][_0x78dd('0x47')]>0x0){var _0x55bedf=_['head'](_0x2b15c3[_0x78dd('0x46')][_0x78dd('0x1e')]);var _0x285bb8={'messageId':_0x55bedf[_0x78dd('0x48')]};if(!_0x4eaef8[_0x78dd('0x37')]){_0x285bb8[_0x78dd('0x38')]=!![];}return _0x2efddc[_0x78dd('0x13')](_0x285bb8);}else{logger['error'](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x49'),util['inspect'](_0x2b15c3,{'showHidden':![],'depth':null}));}}else{logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x49'),util[_0x78dd('0x26')](_0x2b15c3,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3c4054){logger[_0x78dd('0x15')](_0x78dd('0x27'),'afterCreate','clickSend',util[_0x78dd('0x26')](_0x3c4054,{'showHidden':![],'depth':null}));});}else{logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x4eaef8[_0x78dd('0x4a')]&&_0x4eaef8['authToken']){var _0x548dd6={'dst':_0x2e4861[_0x78dd('0x1c')],'text':_0x2e4861['body'],'src':_0x4eaef8['senderString']||_0x4eaef8[_0x78dd('0x1c')],'url':_0x4eaef8[_0x78dd('0x21')]+'/api/sms/messages/'+_0x2e4861['id']+'/status?token='+_0x4eaef8[_0x78dd('0x4b')]};var _0xf0298e=util[_0x78dd('0x41')](_0x78dd('0x42'),_0x4eaef8['authId'],_0x4eaef8[_0x78dd('0x1b')]);var _0x45a60c={'method':_0x78dd('0x32'),'uri':util[_0x78dd('0x41')]('https://api.plivo.com/v1/Account/%s/Message/',_0x4eaef8['authId']),'body':_0x548dd6,'headers':{'Authorization':util['format'](_0x78dd('0x44'),new Buffer(_0xf0298e)[_0x78dd('0x4c')](_0x78dd('0x4d')))},'json':!![]};rp(_0x45a60c)[_0x78dd('0x12')](function(_0x2acb97){var _0x4e4614={'messageId':_0x2acb97[_0x78dd('0x4e')][0x0]};return _0x2efddc[_0x78dd('0x13')](_0x4e4614);})[_0x78dd('0x39')](function(_0x38d288){logger['error'](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x4f'),util[_0x78dd('0x26')](_0x38d288,{'showHidden':![],'depth':null}));});}else{logger[_0x78dd('0x15')](_0x78dd('0x27'),'afterCreate',_0x78dd('0x4f'),_0x78dd('0x50'));}break;case'infobip':if(_0x4eaef8[_0x78dd('0x2b')]&&_0x4eaef8[_0x78dd('0x2c')]){if(_0x4eaef8[_0x78dd('0x51')]){var _0x491907={'method':_0x78dd('0x32'),'uri':_0x4eaef8['baseUrl']+_0x78dd('0x52'),'body':{'username':_0x4eaef8[_0x78dd('0x2b')],'password':_0x4eaef8[_0x78dd('0x2c')]},'json':!![]};return rp(_0x491907)[_0x78dd('0x12')](function(_0x2ff9e3){var _0x10e008={'method':'POST','uri':_0x4eaef8[_0x78dd('0x51')]+_0x78dd('0x53'),'body':{'messages':[{'from':_0x4eaef8[_0x78dd('0x1c')],'destinations':[{'to':_0x2e4861[_0x78dd('0x1c')]}],'text':_0x2e4861['body'],'notifyUrl':_0x4eaef8[_0x78dd('0x21')]+_0x78dd('0x22')+_0x2e4861['id']+_0x78dd('0x23')+_0x4eaef8[_0x78dd('0x4b')],'notifyContentType':_0x78dd('0x54'),'callbackData':_0x4eaef8['phone']+';'+_0x2e4861[_0x78dd('0x20')]}]},'headers':{'Authorization':_0x78dd('0x55')+_0x2ff9e3['token']},'json':!![]};return rp(_0x10e008)[_0x78dd('0x12')](function(_0x3667a3){if(_0x3667a3[_0x78dd('0x1e')]){var _0x4f8efb={'messageId':_0x3667a3[_0x78dd('0x1e')][0x0]['messageId']};if(!_0x4eaef8['deliveryReport']){_0x4f8efb[_0x78dd('0x38')]=!![];}return _0x2efddc[_0x78dd('0x13')](_0x4f8efb);}else{return logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),'infobip',util[_0x78dd('0x26')](_0x3667a3,{'showHidden':![],'depth':null}));}});})[_0x78dd('0x39')](function(_0x344eb7){return logger['error'](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x56'),util[_0x78dd('0x26')](_0x344eb7,{'showHidden':![],'depth':null}));});}else{logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x56'),_0x78dd('0x57'));}}else{logger['error'](_0x78dd('0x27'),_0x78dd('0x25'),'infobip',_0x78dd('0x3a'));}break;case _0x78dd('0x58'):var _0x55422b=require('crypto');if(_0x4eaef8[_0x78dd('0x59')]){var _0x2c2fed={};_0x2c2fed[_0x78dd('0x5a')]=_0x4eaef8[_0x78dd('0x2b')];_0x2c2fed[_0x78dd('0x1c')]=_0x2e4861[_0x78dd('0x1c')];_0x2c2fed[_0x78dd('0x2e')]=_0x4eaef8[_0x78dd('0x1c')];_0x2c2fed[_0x78dd('0x5b')]=_0x2e4861['body'];_0x2c2fed['timestamp']=+new Date();var _0x4b614d='';var _0x5152de='';var _0x2e65a9=Object[_0x78dd('0x5c')](_0x2c2fed);_0x2e65a9[_0x78dd('0x5d')]();for(var _0xb77e67=0x0;_0xb77e67<_0x2e65a9[_0x78dd('0x5e')];_0xb77e67++){if(_0x4b614d!=''){_0x4b614d+='&';}_0x4b614d+=_0x2e65a9[_0xb77e67]+'='+encodeURIComponent(_0x2c2fed[_0x2e65a9[_0xb77e67]]);_0x5152de+=_0x2c2fed[_0x2e65a9[_0xb77e67]];}_0x5152de+=_0x4eaef8[_0x78dd('0x59')];_0x5152de=_0x55422b[_0x78dd('0x5f')](_0x78dd('0x60'))[_0x78dd('0x13')](_0x5152de)[_0x78dd('0x61')](_0x78dd('0x62'));if(_0x4b614d!==''){_0x4b614d+='&';}_0x4b614d+=_0x78dd('0x63')+_0x5152de;var _0x51cad4={'method':_0x78dd('0x2f'),'uri':_0x4eaef8[_0x78dd('0x51')]+_0x78dd('0x64')+_0x4b614d,'json':!![]};return rp(_0x51cad4)[_0x78dd('0x12')](function(_0x2dee50){var _0x30dd47=Object[_0x78dd('0x5c')](_0x2dee50);if(_0x2dee50[_0x30dd47[0x0]][_0x78dd('0x15')]&&parseInt(_0x2dee50[_0x30dd47[0x0]]['error'])===0x0){var _0x198aaf={'messageId':_0x2dee50[_0x30dd47[0x0]][_0x78dd('0x65')]};if(!_0x4eaef8[_0x78dd('0x37')]){_0x198aaf['read']=!![];}return _0x2efddc[_0x78dd('0x13')](_0x198aaf);}else{return logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x58'),util[_0x78dd('0x26')](_0x2dee50['error'],{'showHidden':![],'depth':null}));}})[_0x78dd('0x39')](function(_0x6b5dfc){return logger['error'](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x58'),util[_0x78dd('0x26')](_0x6b5dfc,{'showHidden':![],'depth':null}));});}else{logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x58'),_0x78dd('0x66'));}break;case _0x78dd('0x67'):if(_0x4eaef8['apiKey']){var _0x8ddb59={'method':_0x78dd('0x32'),'uri':_0x78dd('0x68'),'headers':{'Authorization':_0x4eaef8[_0x78dd('0x59')]},'body':{'content':_0x2e4861[_0x78dd('0x20')],'to':[_0x2e4861['phone']],'from':_0x4eaef8[_0x78dd('0x1c')],'binary':![],'clientMessageId':_0x78dd('0x69'),'charset':_0x78dd('0x6a')},'json':!![]};rp(_0x8ddb59)[_0x78dd('0x12')](function(_0x2bba34){if(!_0x2bba34[_0x78dd('0x15')]){var _0x54ba51={'messageId':_0x2bba34[_0x78dd('0x1e')][0x0]['apiMessageId']};if(!_0x4eaef8[_0x78dd('0x37')]){_0x54ba51['read']=!![];}return _0x2efddc[_0x78dd('0x13')](_0x54ba51);}else{return logger[_0x78dd('0x15')](_0x78dd('0x27'),'afterCreate',_0x78dd('0x67'),util[_0x78dd('0x26')](_0x2bba34[_0x78dd('0x15')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x226ece){return logger[_0x78dd('0x15')](_0x78dd('0x27'),'afterCreate',_0x78dd('0x67'),util['inspect'](_0x226ece,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x78dd('0x27'),'afterCreate',_0x78dd('0x67'),_0x78dd('0x66'));}break;case'bandwidth':if(_0x4eaef8['username']&&_0x4eaef8[_0x78dd('0x2c')]){var _0xf0298e=util[_0x78dd('0x41')](_0x78dd('0x42'),_0x4eaef8['username'],_0x4eaef8[_0x78dd('0x2c')]);var _0x45a60c={'method':_0x78dd('0x32'),'uri':_0x78dd('0x6b')+_0x4eaef8[_0x78dd('0x6c')]+'/messages','body':{'to':[_0x2e4861['phone']],'text':_0x2e4861[_0x78dd('0x20')],'from':_0x4eaef8[_0x78dd('0x1c')],'applicationId':_0x4eaef8['applicationId']},'headers':{'Authorization':util[_0x78dd('0x41')](_0x78dd('0x44'),new Buffer(_0xf0298e)['toString'](_0x78dd('0x4d')))},'json':!![]};rp(_0x45a60c)[_0x78dd('0x12')](function(_0xe3ec3c){if(_0xe3ec3c['id']){var _0x57a182={'messageId':_0xe3ec3c['id']};return _0x2efddc[_0x78dd('0x13')](_0x57a182);}else{logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x6d'),util['inspect'](_0xe3ec3c,{'showHidden':![],'depth':null}));}})[_0x78dd('0x39')](function(_0x3c3bc1){logger[_0x78dd('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x78dd('0x25'),_0x78dd('0x6d'),util[_0x78dd('0x26')](_0x3c3bc1,{'showHidden':![],'depth':null}));});}else{logger[_0x78dd('0x15')](_0x78dd('0x27'),'afterCreate',_0x78dd('0x6d'),_0x78dd('0x3a'));}break;case _0x78dd('0x6e'):if(_0x4eaef8[_0x78dd('0x59')]){var _0x1e311d={};var _0x51cad4={'method':_0x78dd('0x32'),'uri':_0x78dd('0x6f'),'headers':{'Authorization':_0x78dd('0x70')+_0x4eaef8[_0x78dd('0x59')],'Content-Type':_0x78dd('0x54')},'body':{'from':_0x4eaef8[_0x78dd('0x1c')],'to':_0x2e4861[_0x78dd('0x1c')],'text':_0x2e4861[_0x78dd('0x20')]},'json':!![]};return rp(_0x51cad4)[_0x78dd('0x12')](function(_0xb5ccb9){if(_0xb5ccb9[_0x78dd('0x71')]==0xca){_0x1e311d[_0x78dd('0x72')]=_0xb5ccb9;var _0x1754bc={'method':'POST','uri':_0x78dd('0x73'),'headers':{'Authorization':_0x78dd('0x70')+_0x4eaef8['apiKey'],'Content-Type':_0x78dd('0x54')},'body':{'refid':_0x1e311d[_0x78dd('0x72')]['refid']},'json':!![]};return rp(_0x1754bc)['then'](function(_0x12bfdb){_0x1e311d[_0x78dd('0x74')]=_0x12bfdb;var _0x5494d3={'messageId':_0x1e311d[_0x78dd('0x72')][_0x78dd('0x75')],'read':!![]};return _0x2efddc[_0x78dd('0x13')](_0x5494d3);});}else{return logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x6e'),util[_0x78dd('0x26')](_0xb5ccb9,{'showHidden':![],'depth':null}));}})[_0x78dd('0x39')](function(_0x2567f0){return logger[_0x78dd('0x15')](_0x78dd('0x27'),'afterCreate',_0x78dd('0x6e'),util[_0x78dd('0x26')](_0x2567f0,{'showHidden':![],'depth':null}));});}else{return logger[_0x78dd('0x15')](_0x78dd('0x27'),_0x78dd('0x25'),_0x78dd('0x6e'),_0x78dd('0x76'));}break;}}})[_0x78dd('0x77')](function(){_0x13c151();});}else{_0x13c151();}}},'charset':_0x78dd('0x78'),'collate':_0x78dd('0x79')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 7c2c5e1..d010a56 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 _0x187b=['body','options','raw','CreateSmsMessage','stringify','lodash','bluebird','randomstring','../../config/utils','../../config/environment','client','http','redis','defaults','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','SmsMessage','create'];(function(_0x275fa1,_0x28af28){var _0x5c04db=function(_0x4cedb4){while(--_0x4cedb4){_0x275fa1['push'](_0x275fa1['shift']());}};_0x5c04db(++_0x28af28);}(_0x187b,0x144));var _0xb187=function(_0x56d9c0,_0xddddd6){_0x56d9c0=_0x56d9c0-0x0;var _0x8a53d6=_0x187b[_0x56d9c0];return _0x8a53d6;};'use strict';var _=require(_0xb187('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb187('0x1'));var rs=require(_0xb187('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb187('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xb187('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xb187('0x5')][_0xb187('0x6')]({'port':0x232a});config[_0xb187('0x7')]=_[_0xb187('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb187('0x7')]));require(_0xb187('0x9'))[_0xb187('0xa')](socket);function respondWithRpcPromise(_0xc11f52,_0x4eb565,_0x3ed0ea){return new BPromise(function(_0x2a70bf,_0x567d98){return client[_0xb187('0xb')](_0xc11f52,_0x3ed0ea)[_0xb187('0xc')](function(_0x30281d){logger[_0xb187('0xd')](_0xb187('0xe'),_0x4eb565,_0xb187('0xf'));logger[_0xb187('0x10')](_0xb187('0x11'),_0x4eb565,_0xb187('0xf'),JSON['stringify'](_0x30281d));if(_0x30281d[_0xb187('0x12')]){if(_0x30281d['error'][_0xb187('0x13')]===0x1f4){logger[_0xb187('0x12')](_0xb187('0xe'),_0x4eb565,_0x30281d['error'][_0xb187('0x14')]);return _0x567d98(_0x30281d['error']['message']);}logger[_0xb187('0x12')](_0xb187('0xe'),_0x4eb565,_0x30281d[_0xb187('0x12')][_0xb187('0x14')]);return _0x2a70bf(_0x30281d['error'][_0xb187('0x14')]);}else{logger[_0xb187('0xd')](_0xb187('0xe'),_0x4eb565,_0xb187('0xf'));_0x2a70bf(_0x30281d['result']['message']);}})[_0xb187('0x15')](function(_0x2aff23){logger[_0xb187('0x12')](_0xb187('0xe'),_0x4eb565,_0x2aff23);_0x567d98(_0x2aff23);});});}exports['CreateSmsMessage']=function(_0xe04b0c){var _0xff16c2=this;return new Promise(function(_0x4133f5,_0x44f128){return db[_0xb187('0x16')][_0xb187('0x17')](_0xe04b0c[_0xb187('0x18')],{'raw':_0xe04b0c[_0xb187('0x19')]?_0xe04b0c['options'][_0xb187('0x1a')]===undefined?!![]:![]:!![]})[_0xb187('0xc')](function(_0x1d1e37){logger[_0xb187('0xd')](_0xb187('0x1b'),_0xe04b0c);logger[_0xb187('0x10')](_0xb187('0x1b'),_0xe04b0c,JSON[_0xb187('0x1c')](_0x1d1e37));_0x4133f5(_0x1d1e37);})[_0xb187('0x15')](function(_0x32bc2f){logger['error'](_0xb187('0x1b'),_0x32bc2f[_0xb187('0x14')],_0xe04b0c);_0x44f128(_0xff16c2[_0xb187('0x12')](0x1f4,_0x32bc2f[_0xb187('0x14')]));});});}; \ No newline at end of file +var _0x8db5=['then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSmsMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request'];(function(_0x40015a,_0x415db5){var _0x42f8a4=function(_0x5685ad){while(--_0x5685ad){_0x40015a['push'](_0x40015a['shift']());}};_0x42f8a4(++_0x415db5);}(_0x8db5,0x70));var _0x58db=function(_0x5bd953,_0x307788){_0x5bd953=_0x5bd953-0x0;var _0x4ac021=_0x8db5[_0x5bd953];return _0x4ac021;};'use strict';var _=require(_0x58db('0x0'));var util=require(_0x58db('0x1'));var moment=require(_0x58db('0x2'));var BPromise=require(_0x58db('0x3'));var rs=require(_0x58db('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x58db('0x5'));var logger=require(_0x58db('0x6'))('rpc');var config=require(_0x58db('0x7'));var jayson=require(_0x58db('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x58db('0x9')]=_[_0x58db('0xa')](config['redis'],{'host':_0x58db('0xb'),'port':0x18eb});var socket=require(_0x58db('0xc'))(new Redis(config[_0x58db('0x9')]));require(_0x58db('0xd'))[_0x58db('0xe')](socket);function respondWithRpcPromise(_0xa50539,_0x14d2c1,_0x3d7b29){return new BPromise(function(_0x2f9862,_0x2aa335){return client[_0x58db('0xf')](_0xa50539,_0x3d7b29)[_0x58db('0x10')](function(_0x1cad8c){logger[_0x58db('0x11')](_0x58db('0x12'),_0x14d2c1,_0x58db('0x13'));logger[_0x58db('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x14d2c1,_0x58db('0x13'),JSON[_0x58db('0x15')](_0x1cad8c));if(_0x1cad8c['error']){if(_0x1cad8c[_0x58db('0x16')][_0x58db('0x17')]===0x1f4){logger[_0x58db('0x16')](_0x58db('0x12'),_0x14d2c1,_0x1cad8c['error'][_0x58db('0x18')]);return _0x2aa335(_0x1cad8c['error'][_0x58db('0x18')]);}logger[_0x58db('0x16')](_0x58db('0x12'),_0x14d2c1,_0x1cad8c[_0x58db('0x16')][_0x58db('0x18')]);return _0x2f9862(_0x1cad8c[_0x58db('0x16')][_0x58db('0x18')]);}else{logger[_0x58db('0x11')](_0x58db('0x12'),_0x14d2c1,_0x58db('0x13'));_0x2f9862(_0x1cad8c[_0x58db('0x19')][_0x58db('0x18')]);}})[_0x58db('0x1a')](function(_0xc96b5a){logger[_0x58db('0x16')]('SmsMessage,\x20%s,\x20%s',_0x14d2c1,_0xc96b5a);_0x2aa335(_0xc96b5a);});});}exports[_0x58db('0x1b')]=function(_0x23c206){var _0x3b0856=this;return new Promise(function(_0x25ad05,_0x573188){return db['SmsMessage'][_0x58db('0x1c')](_0x23c206[_0x58db('0x1d')],{'raw':_0x23c206['options']?_0x23c206[_0x58db('0x1e')][_0x58db('0x1f')]===undefined?!![]:![]:!![]})[_0x58db('0x10')](function(_0x2a9d99){logger[_0x58db('0x11')](_0x58db('0x1b'),_0x23c206);logger[_0x58db('0x14')](_0x58db('0x1b'),_0x23c206,JSON[_0x58db('0x15')](_0x2a9d99));_0x25ad05(_0x2a9d99);})[_0x58db('0x1a')](function(_0x3ee8ca){logger[_0x58db('0x16')](_0x58db('0x1b'),_0x3ee8ca[_0x58db('0x18')],_0x23c206);_0x573188(_0x3b0856[_0x58db('0x16')](0x1f4,_0x3ee8ca[_0x58db('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 086a51a..9387450 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 _0xaed1=['smsMessage:','./smsMessage.events','save','remove','update','emit','register','length'];(function(_0x480ab2,_0x20b3a7){var _0x35c362=function(_0xddf9ac){while(--_0xddf9ac){_0x480ab2['push'](_0x480ab2['shift']());}};_0x35c362(++_0x20b3a7);}(_0xaed1,0x119));var _0x1aed=function(_0x2ae8d6,_0x4d7876){_0x2ae8d6=_0x2ae8d6-0x0;var _0x3d5145=_0xaed1[_0x2ae8d6];return _0x3d5145;};'use strict';var SmsMessageEvents=require(_0x1aed('0x0'));var events=[_0x1aed('0x1'),_0x1aed('0x2'),_0x1aed('0x3')];function createListener(_0x1ec613,_0x14a01e){return function(_0x1a3541){_0x14a01e[_0x1aed('0x4')](_0x1ec613,_0x1a3541);};}function removeListener(_0xd974f9,_0x4ec664){return function(){SmsMessageEvents['removeListener'](_0xd974f9,_0x4ec664);};}exports[_0x1aed('0x5')]=function(_0x4a4f37){for(var _0x563723=0x0,_0x32eed5=events[_0x1aed('0x6')];_0x563723<_0x32eed5;_0x563723++){var _0x1fa4a6=events[_0x563723];var _0x3f7e1d=createListener(_0x1aed('0x7')+_0x1fa4a6,_0x4a4f37);SmsMessageEvents['on'](_0x1fa4a6,_0x3f7e1d);}}; \ No newline at end of file +var _0x0475=['length','./smsMessage.events','save','update','emit','register'];(function(_0x477a82,_0x554721){var _0x22b90e=function(_0x18a742){while(--_0x18a742){_0x477a82['push'](_0x477a82['shift']());}};_0x22b90e(++_0x554721);}(_0x0475,0x1b7));var _0x5047=function(_0xb65f0c,_0xe60c57){_0xb65f0c=_0xb65f0c-0x0;var _0x2ff246=_0x0475[_0xb65f0c];return _0x2ff246;};'use strict';var SmsMessageEvents=require(_0x5047('0x0'));var events=[_0x5047('0x1'),'remove',_0x5047('0x2')];function createListener(_0x3362df,_0x40ac63){return function(_0x942534){_0x40ac63[_0x5047('0x3')](_0x3362df,_0x942534);};}function removeListener(_0x704655,_0x436be7){return function(){SmsMessageEvents['removeListener'](_0x704655,_0x436be7);};}exports[_0x5047('0x4')]=function(_0x4170dd){for(var _0x48fc3f=0x0,_0xd9d012=events[_0x5047('0x5')];_0x48fc3f<_0xd9d012;_0x48fc3f++){var _0x12ab78=events[_0x48fc3f];var _0x4eea79=createListener('smsMessage:'+_0x12ab78,_0x4170dd);SmsMessageEvents['on'](_0x12ab78,_0x4eea79);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 11891d1..68f7557 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 _0x7cad=['fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','update','destroy','delete','/:id/teams','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router'];(function(_0x55d6a2,_0x52fdb6){var _0x5d9b28=function(_0x2f9819){while(--_0x2f9819){_0x55d6a2['push'](_0x55d6a2['shift']());}};_0x5d9b28(++_0x52fdb6);}(_0x7cad,0x13b));var _0xd7ca=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x7cad[_0x39e283];return _0x7de89f;};'use strict';var multer=require(_0xd7ca('0x0'));var util=require(_0xd7ca('0x1'));var path=require(_0xd7ca('0x2'));var timeout=require(_0xd7ca('0x3'));var express=require('express');var router=express[_0xd7ca('0x4')]();var fs_extra=require(_0xd7ca('0x5'));var auth=require(_0xd7ca('0x6'));var interaction=require(_0xd7ca('0x7'));var config=require('../../config/environment');var controller=require(_0xd7ca('0x8'));router[_0xd7ca('0x9')]('/',auth[_0xd7ca('0xa')](),controller[_0xd7ca('0xb')]);router[_0xd7ca('0x9')](_0xd7ca('0xc'),auth[_0xd7ca('0xa')](),controller[_0xd7ca('0xd')]);router[_0xd7ca('0x9')](_0xd7ca('0xe'),auth['isAuthenticated'](),controller[_0xd7ca('0xf')]);router[_0xd7ca('0x9')](_0xd7ca('0x10'),auth[_0xd7ca('0xa')](),controller[_0xd7ca('0x11')]);router['get']('/:id/teams',auth[_0xd7ca('0xa')](),controller[_0xd7ca('0x12')]);router[_0xd7ca('0x9')]('/:id/users',auth[_0xd7ca('0xa')](),controller[_0xd7ca('0x13')]);router['post']('/',auth[_0xd7ca('0xa')](),controller['create']);router[_0xd7ca('0x14')]('/:id/teams',auth[_0xd7ca('0xa')](),controller[_0xd7ca('0x15')]);router[_0xd7ca('0x14')](_0xd7ca('0x16'),auth['isAuthenticated'](),controller[_0xd7ca('0x17')]);router[_0xd7ca('0x18')](_0xd7ca('0xe'),auth['isAuthenticated'](),controller[_0xd7ca('0x19')]);router['delete'](_0xd7ca('0xe'),auth[_0xd7ca('0xa')](),controller[_0xd7ca('0x1a')]);router[_0xd7ca('0x1b')](_0xd7ca('0x1c'),auth[_0xd7ca('0xa')](),controller[_0xd7ca('0x1d')]);router['delete'](_0xd7ca('0x16'),auth[_0xd7ca('0xa')](),controller[_0xd7ca('0x1e')]);module[_0xd7ca('0x1f')]=router; \ No newline at end of file +var _0xc706=['destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete'];(function(_0x1e7215,_0x56839b){var _0x28c480=function(_0x438bfd){while(--_0x438bfd){_0x1e7215['push'](_0x1e7215['shift']());}};_0x28c480(++_0x56839b);}(_0xc706,0x17a));var _0x6c70=function(_0x123783,_0x2d5fbd){_0x123783=_0x123783-0x0;var _0x34a185=_0xc706[_0x123783];return _0x34a185;};'use strict';var multer=require(_0x6c70('0x0'));var util=require(_0x6c70('0x1'));var path=require(_0x6c70('0x2'));var timeout=require(_0x6c70('0x3'));var express=require(_0x6c70('0x4'));var router=express[_0x6c70('0x5')]();var fs_extra=require(_0x6c70('0x6'));var auth=require(_0x6c70('0x7'));var interaction=require(_0x6c70('0x8'));var config=require(_0x6c70('0x9'));var controller=require(_0x6c70('0xa'));router['get']('/',auth[_0x6c70('0xb')](),controller[_0x6c70('0xc')]);router['get'](_0x6c70('0xd'),auth[_0x6c70('0xb')](),controller[_0x6c70('0xe')]);router[_0x6c70('0xf')](_0x6c70('0x10'),auth[_0x6c70('0xb')](),controller[_0x6c70('0x11')]);router['get'](_0x6c70('0x12'),auth[_0x6c70('0xb')](),controller[_0x6c70('0x13')]);router[_0x6c70('0xf')](_0x6c70('0x14'),auth['isAuthenticated'](),controller[_0x6c70('0x15')]);router['get'](_0x6c70('0x16'),auth[_0x6c70('0xb')](),controller[_0x6c70('0x17')]);router[_0x6c70('0x18')]('/',auth[_0x6c70('0xb')](),controller['create']);router[_0x6c70('0x18')](_0x6c70('0x14'),auth[_0x6c70('0xb')](),controller[_0x6c70('0x19')]);router[_0x6c70('0x18')](_0x6c70('0x16'),auth[_0x6c70('0xb')](),controller[_0x6c70('0x1a')]);router[_0x6c70('0x1b')](_0x6c70('0x10'),auth[_0x6c70('0xb')](),controller[_0x6c70('0x1c')]);router[_0x6c70('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x6c70('0x1e')]);router[_0x6c70('0x1d')](_0x6c70('0x14'),auth['isAuthenticated'](),controller[_0x6c70('0x1f')]);router[_0x6c70('0x1d')](_0x6c70('0x16'),auth['isAuthenticated'](),controller[_0x6c70('0x20')]);module[_0x6c70('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index c6fbca8..a327f81 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 _0xb1f0=['name','INTEGER','ENUM','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x4f6d08,_0x1b3dd0){var _0x53a9c6=function(_0x2e0e0f){while(--_0x2e0e0f){_0x4f6d08['push'](_0x4f6d08['shift']());}};_0x53a9c6(++_0x1b3dd0);}(_0xb1f0,0xed));var _0x0b1f=function(_0x2339da,_0x2627ef){_0x2339da=_0x2339da-0x0;var _0x5dd6ac=_0xb1f0[_0x2339da];return _0x5dd6ac;};'use strict';var Sequelize=require(_0x0b1f('0x0'));module[_0x0b1f('0x1')]={'name':{'type':Sequelize[_0x0b1f('0x2')],'unique':_0x0b1f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0b1f('0x2')]},'timeout':{'type':Sequelize[_0x0b1f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b1f('0x5')]('rrmemory',_0x0b1f('0x6'),_0x0b1f('0x7'))}}; \ No newline at end of file +var _0x9377=['roundrobin','sequelize','exports','STRING','beepall'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9377,0x12d));var _0x7937=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9377[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7937('0x0'));module[_0x7937('0x1')]={'name':{'type':Sequelize[_0x7937('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7937('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x7937('0x3'),_0x7937('0x4'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 5aaed97..db03a84 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 _0xbb35=['body','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','UserId','agent','smsPause','createdAt','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','push','toString','QueryTypes','SELECT','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','get','SmsQueues','error','name','send','index','map','SmsQueue','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x2ea183,_0x3cff11){var _0x47c16c=function(_0x3d91e5){while(--_0x3d91e5){_0x2ea183['push'](_0x2ea183['shift']());}};_0x47c16c(++_0x3cff11);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x42ce84,_0x5b67bd){_0x42ce84=_0x42ce84-0x0;var _0x4ad7f4=_0xbb35[_0x42ce84];return _0x4ad7f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5bb3('0x0'));var zipdir=require(_0x5bb3('0x1'));var jsonpatch=require(_0x5bb3('0x2'));var rp=require(_0x5bb3('0x3'));var moment=require(_0x5bb3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5bb3('0x5'));var util=require(_0x5bb3('0x6'));var path=require(_0x5bb3('0x7'));var sox=require(_0x5bb3('0x8'));var csv=require(_0x5bb3('0x9'));var ejs=require(_0x5bb3('0xa'));var fs=require('fs');var fs_extra=require(_0x5bb3('0xb'));var _=require(_0x5bb3('0xc'));var squel=require(_0x5bb3('0xd'));var crypto=require('crypto');var jsforce=require(_0x5bb3('0xe'));var deskjs=require(_0x5bb3('0xf'));var toCsv=require(_0x5bb3('0x9'));var querystring=require(_0x5bb3('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bb3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bb3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bb3('0x13'));var logger=require(_0x5bb3('0x14'))(_0x5bb3('0x15'));var utils=require(_0x5bb3('0x16'));var config=require(_0x5bb3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bb3('0x18'))['db'];config[_0x5bb3('0x19')]=_[_0x5bb3('0x1a')](config['redis'],{'host':_0x5bb3('0x1b'),'port':0x18eb});var socket=require(_0x5bb3('0x1c'))(new Redis(config[_0x5bb3('0x19')]));require(_0x5bb3('0x1d'))[_0x5bb3('0x1e')](socket);function respondWithStatusCode(_0x2835b1,_0x230dbf){_0x230dbf=_0x230dbf||0xcc;return function(_0x171369){if(_0x171369){return _0x2835b1['sendStatus'](_0x230dbf);}return _0x2835b1['status'](_0x230dbf)['end']();};}function respondWithResult(_0x3722f3,_0x1da0b6){_0x1da0b6=_0x1da0b6||0xc8;return function(_0x388802){if(_0x388802){return _0x3722f3[_0x5bb3('0x1f')](_0x1da0b6)[_0x5bb3('0x20')](_0x388802);}};}function respondWithFilteredResult(_0x24bd58,_0x364b86){return function(_0xbbaf0){if(_0xbbaf0){var _0x107dbb=typeof _0x364b86[_0x5bb3('0x21')]==='undefined'&&typeof _0x364b86['limit']===_0x5bb3('0x22');var _0x41c9a5=_0xbbaf0[_0x5bb3('0x23')];var _0x442ee2=_0x107dbb?0x0:_0x364b86[_0x5bb3('0x21')];var _0x3fe551=_0x107dbb?_0xbbaf0[_0x5bb3('0x23')]:_0x364b86['offset']+_0x364b86[_0x5bb3('0x24')];var _0x3b1325;if(_0x3fe551>=_0x41c9a5){_0x3fe551=_0x41c9a5;_0x3b1325=0xc8;}else{_0x3b1325=0xce;}_0x24bd58[_0x5bb3('0x1f')](_0x3b1325);return _0x24bd58['set'](_0x5bb3('0x25'),_0x442ee2+'-'+_0x3fe551+'/'+_0x41c9a5)['json'](_0xbbaf0);}return null;};}function patchUpdates(_0xa16d6e){return function(_0x4be614){try{jsonpatch[_0x5bb3('0x26')](_0x4be614,_0xa16d6e,!![]);}catch(_0x384f57){return BPromise[_0x5bb3('0x27')](_0x384f57);}return _0x4be614[_0x5bb3('0x28')]();};}function saveUpdates(_0x2f9ca3,_0x904ca3){return function(_0x2fa05b){if(_0x2fa05b){return _0x2fa05b['update'](_0x2f9ca3)[_0x5bb3('0x29')](function(_0x41e28f){return _0x41e28f;});}return null;};}function removeEntity(_0x4c4a7a,_0x439ee4){return function(_0x256a5f){if(_0x256a5f){return _0x256a5f[_0x5bb3('0x2a')]()[_0x5bb3('0x29')](function(){var _0x21da73=_0x256a5f[_0x5bb3('0x2b')]({'plain':!![]});var _0x405eea=_0x5bb3('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x405eea,'resourceId':_0x21da73['id']}})[_0x5bb3('0x29')](function(){return _0x256a5f;});})['then'](function(){_0x4c4a7a[_0x5bb3('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x831fd4,_0xbdc0b5){return function(_0x104efe){if(!_0x104efe){_0x831fd4['sendStatus'](0x194);}return _0x104efe;};}function handleError(_0x28c825,_0x29a442){_0x29a442=_0x29a442||0x1f4;return function(_0x461109){logger[_0x5bb3('0x2d')](_0x461109['stack']);if(_0x461109['name']){delete _0x461109[_0x5bb3('0x2e')];}_0x28c825['status'](_0x29a442)[_0x5bb3('0x2f')](_0x461109);};}exports[_0x5bb3('0x30')]=function(_0x5217ca,_0x321834){var _0xd935a7={},_0x3d7115={},_0xe5981a={'count':0x0,'rows':[]};var _0x46ba29=_[_0x5bb3('0x31')](db[_0x5bb3('0x32')]['rawAttributes'],function(_0x554fc0){return{'name':_0x554fc0['fieldName'],'type':_0x554fc0[_0x5bb3('0x33')][_0x5bb3('0x34')]};});_0x3d7115[_0x5bb3('0x35')]=_[_0x5bb3('0x31')](_0x46ba29,'name');_0x3d7115['query']=_[_0x5bb3('0x36')](_0x5217ca[_0x5bb3('0x37')]);_0x3d7115[_0x5bb3('0x38')]=_[_0x5bb3('0x39')](_0x3d7115[_0x5bb3('0x35')],_0x3d7115[_0x5bb3('0x37')]);_0xd935a7['attributes']=_[_0x5bb3('0x39')](_0x3d7115[_0x5bb3('0x35')],qs[_0x5bb3('0x3a')](_0x5217ca[_0x5bb3('0x37')][_0x5bb3('0x3a')]));_0xd935a7['attributes']=_0xd935a7[_0x5bb3('0x3b')][_0x5bb3('0x3c')]?_0xd935a7[_0x5bb3('0x3b')]:_0x3d7115[_0x5bb3('0x35')];if(!_0x5217ca[_0x5bb3('0x37')][_0x5bb3('0x3d')](_0x5bb3('0x3e'))){_0xd935a7[_0x5bb3('0x24')]=qs[_0x5bb3('0x24')](_0x5217ca[_0x5bb3('0x37')]['limit']);_0xd935a7[_0x5bb3('0x21')]=qs[_0x5bb3('0x21')](_0x5217ca[_0x5bb3('0x37')][_0x5bb3('0x21')]);}_0xd935a7[_0x5bb3('0x3f')]=qs[_0x5bb3('0x40')](_0x5217ca[_0x5bb3('0x37')][_0x5bb3('0x40')]);_0xd935a7[_0x5bb3('0x41')]=qs[_0x5bb3('0x38')](_[_0x5bb3('0x42')](_0x5217ca['query'],_0x3d7115[_0x5bb3('0x38')]),_0x46ba29);if(_0x5217ca[_0x5bb3('0x37')]['filter']){_0xd935a7[_0x5bb3('0x41')]=_[_0x5bb3('0x43')](_0xd935a7[_0x5bb3('0x41')],{'$or':_[_0x5bb3('0x31')](_0x46ba29,function(_0x3a9858){if(_0x3a9858['type']!==_0x5bb3('0x44')){var _0x11a482={};_0x11a482[_0x3a9858[_0x5bb3('0x2e')]]={'$like':'%'+_0x5217ca[_0x5bb3('0x37')][_0x5bb3('0x45')]+'%'};return _0x11a482;}})});}_0xd935a7=_[_0x5bb3('0x43')]({},_0xd935a7,_0x5217ca['options']);var _0x6d6c39={'where':_0xd935a7['where']};return db[_0x5bb3('0x32')][_0x5bb3('0x23')](_0x6d6c39)['then'](function(_0x2f20c7){_0xe5981a['count']=_0x2f20c7;if(_0x5217ca[_0x5bb3('0x37')][_0x5bb3('0x46')]){_0xd935a7[_0x5bb3('0x47')]=[{'all':!![]}];}return db[_0x5bb3('0x32')][_0x5bb3('0x48')](_0xd935a7);})[_0x5bb3('0x29')](function(_0x58969c){_0xe5981a[_0x5bb3('0x49')]=_0x58969c;return _0xe5981a;})[_0x5bb3('0x29')](respondWithFilteredResult(_0x321834,_0xd935a7))[_0x5bb3('0x4a')](handleError(_0x321834,null));};exports[_0x5bb3('0x4b')]=function(_0x47cad3,_0x29f54f){var _0x36bdaf={'raw':!![],'where':{'id':_0x47cad3[_0x5bb3('0x4c')]['id']}},_0x3f46c8={};_0x3f46c8[_0x5bb3('0x35')]=_[_0x5bb3('0x36')](db[_0x5bb3('0x32')][_0x5bb3('0x4d')]);_0x3f46c8[_0x5bb3('0x37')]=_['keys'](_0x47cad3[_0x5bb3('0x37')]);_0x3f46c8[_0x5bb3('0x38')]=_[_0x5bb3('0x39')](_0x3f46c8[_0x5bb3('0x35')],_0x3f46c8[_0x5bb3('0x37')]);_0x36bdaf[_0x5bb3('0x3b')]=_[_0x5bb3('0x39')](_0x3f46c8[_0x5bb3('0x35')],qs[_0x5bb3('0x3a')](_0x47cad3[_0x5bb3('0x37')][_0x5bb3('0x3a')]));_0x36bdaf[_0x5bb3('0x3b')]=_0x36bdaf[_0x5bb3('0x3b')][_0x5bb3('0x3c')]?_0x36bdaf[_0x5bb3('0x3b')]:_0x3f46c8[_0x5bb3('0x35')];if(_0x47cad3[_0x5bb3('0x37')][_0x5bb3('0x46')]){_0x36bdaf[_0x5bb3('0x47')]=[{'all':!![]}];}_0x36bdaf=_[_0x5bb3('0x43')]({},_0x36bdaf,_0x47cad3[_0x5bb3('0x4e')]);return db[_0x5bb3('0x32')][_0x5bb3('0x4f')](_0x36bdaf)[_0x5bb3('0x29')](handleEntityNotFound(_0x29f54f,null))[_0x5bb3('0x29')](respondWithResult(_0x29f54f,null))[_0x5bb3('0x4a')](handleError(_0x29f54f,null));};exports[_0x5bb3('0x50')]=function(_0x444733,_0x24756a){return db[_0x5bb3('0x32')][_0x5bb3('0x50')](_0x444733['body'],{})[_0x5bb3('0x29')](function(_0x35be5e){var _0x531652=_0x444733[_0x5bb3('0x51')][_0x5bb3('0x2b')]({'plain':!![]});if(!_0x531652)throw new Error(_0x5bb3('0x52'));if(_0x531652['role']===_0x5bb3('0x51')){var _0xa2e5ca=_0x35be5e[_0x5bb3('0x2b')]({'plain':!![]});var _0x44e6df=_0x5bb3('0x2c');return db[_0x5bb3('0x53')]['find']({'where':{'name':_0x44e6df,'userProfileId':_0x531652[_0x5bb3('0x54')]},'raw':!![]})['then'](function(_0xffa73e){if(_0xffa73e&&_0xffa73e[_0x5bb3('0x55')]===0x0){return db[_0x5bb3('0x56')][_0x5bb3('0x50')]({'name':_0xa2e5ca['name'],'resourceId':_0xa2e5ca['id'],'type':_0xffa73e['name'],'sectionId':_0xffa73e['id']},{})[_0x5bb3('0x29')](function(){return _0x35be5e;});}else{return _0x35be5e;}})[_0x5bb3('0x4a')](function(_0x5747dc){logger['error'](_0x5bb3('0x57'),_0x5747dc);throw _0x5747dc;});}return _0x35be5e;})[_0x5bb3('0x29')](respondWithResult(_0x24756a,0xc9))[_0x5bb3('0x4a')](handleError(_0x24756a,null));};exports[_0x5bb3('0x58')]=function(_0x592b58,_0x2122d1){if(_0x592b58[_0x5bb3('0x59')]['id']){delete _0x592b58[_0x5bb3('0x59')]['id'];}return db[_0x5bb3('0x32')]['find']({'where':{'id':_0x592b58[_0x5bb3('0x4c')]['id']}})[_0x5bb3('0x29')](handleEntityNotFound(_0x2122d1,null))[_0x5bb3('0x29')](saveUpdates(_0x592b58[_0x5bb3('0x59')],null))[_0x5bb3('0x29')](respondWithResult(_0x2122d1,null))[_0x5bb3('0x4a')](handleError(_0x2122d1,null));};exports[_0x5bb3('0x2a')]=function(_0x52c3de,_0x35de29){return db['SmsQueue'][_0x5bb3('0x4f')]({'where':{'id':_0x52c3de[_0x5bb3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x35de29,null))[_0x5bb3('0x29')](removeEntity(_0x35de29,null))[_0x5bb3('0x4a')](handleError(_0x35de29,null));};exports['describe']=function(_0x5be32c,_0x431cb9){return db[_0x5bb3('0x32')][_0x5bb3('0x5a')]()[_0x5bb3('0x29')](respondWithResult(_0x431cb9,null))[_0x5bb3('0x4a')](handleError(_0x431cb9,null));};exports[_0x5bb3('0x5b')]=function(_0x5ae3e0,_0x2f44ad,_0x2959b3){var _0x43b153={'raw':!![],'where':{}},_0x455232={},_0x153341;return db[_0x5bb3('0x32')][_0x5bb3('0x5c')]({'where':{'id':_0x5ae3e0[_0x5bb3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2f44ad,null))[_0x5bb3('0x29')](function(_0x51fb55){if(_0x51fb55){_0x153341=_0x51fb55[_0x5bb3('0x2b')]({'plain':!![]});_0x455232[_0x5bb3('0x35')]=_[_0x5bb3('0x36')](db[_0x5bb3('0x5d')]['rawAttributes']);_0x455232[_0x5bb3('0x37')]=_['keys'](_0x5ae3e0[_0x5bb3('0x37')]);_0x455232[_0x5bb3('0x38')]=_['intersection'](_0x455232[_0x5bb3('0x35')],_0x455232[_0x5bb3('0x37')]);_0x43b153[_0x5bb3('0x3b')]=_[_0x5bb3('0x39')](_0x455232[_0x5bb3('0x35')],qs[_0x5bb3('0x3a')](_0x5ae3e0[_0x5bb3('0x37')][_0x5bb3('0x3a')]));_0x43b153['attributes']=_0x43b153['attributes'][_0x5bb3('0x3c')]?_0x43b153[_0x5bb3('0x3b')]:_0x455232[_0x5bb3('0x35')];if(!_0x5ae3e0['query'][_0x5bb3('0x3d')](_0x5bb3('0x3e'))){_0x43b153[_0x5bb3('0x24')]=qs[_0x5bb3('0x24')](_0x5ae3e0[_0x5bb3('0x37')]['limit']);_0x43b153[_0x5bb3('0x21')]=qs[_0x5bb3('0x21')](_0x5ae3e0['query'][_0x5bb3('0x21')]);}_0x43b153[_0x5bb3('0x3f')]=qs[_0x5bb3('0x40')](_0x5ae3e0[_0x5bb3('0x37')]['sort']);_0x43b153[_0x5bb3('0x41')]=qs[_0x5bb3('0x38')](_[_0x5bb3('0x42')](_0x5ae3e0[_0x5bb3('0x37')],_0x455232[_0x5bb3('0x38')]));_0x43b153[_0x5bb3('0x41')][_0x5bb3('0x5e')]=_0x51fb55['id'];if(_0x5ae3e0['query'][_0x5bb3('0x45')]){_0x43b153[_0x5bb3('0x41')]=_[_0x5bb3('0x43')](_0x43b153[_0x5bb3('0x41')],{'$or':_[_0x5bb3('0x31')](_0x43b153[_0x5bb3('0x3b')],function(_0x657d98){var _0x2194fd={};_0x2194fd[_0x657d98]={'$like':'%'+_0x5ae3e0[_0x5bb3('0x37')][_0x5bb3('0x45')]+'%'};return _0x2194fd;})});}_0x43b153=_[_0x5bb3('0x43')]({},_0x43b153,_0x5ae3e0[_0x5bb3('0x4e')]);return db['UserSmsQueue'][_0x5bb3('0x48')](_0x43b153);}})[_0x5bb3('0x29')](function(_0x2c3616){if(_0x2c3616){return db[_0x5bb3('0x5f')]['findAndCountAll']({'where':{'id':_[_0x5bb3('0x31')](_0x2c3616,_0x5bb3('0x60')),'role':_0x5bb3('0x61')},'attributes':['id',_0x5bb3('0x2e'),_0x5bb3('0x62'),'updatedAt',_0x5bb3('0x63')]});}})[_0x5bb3('0x29')](function(_0xf48593){if(_0xf48593){return{'count':_0xf48593['count'],'rows':_['map'](_0xf48593[_0x5bb3('0x49')],function(_0x197fa9){return{'membername':_0x197fa9[_0x5bb3('0x2e')],'UserId':_0x197fa9['id'],'queue_name':_0x153341[_0x5bb3('0x2e')],'SmsQueueId':_0x153341['id'],'interface':util['format'](_0x5bb3('0x64'),_0x5bb3('0x65'),_0x197fa9[_0x5bb3('0x2e')]),'penalty':0x0,'paused':_0x197fa9['smsPause'],'createdAt':_0x197fa9[_0x5bb3('0x63')],'updatedAt':_0x197fa9['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2f44ad,_0x43b153))[_0x5bb3('0x4a')](handleError(_0x2f44ad,null));};exports['getTeams']=function(_0x3e7fde,_0x39ce15,_0x528f54){var _0x4f66fb={};var _0x5983e5={};var _0x53ff47;var _0x4f21c2;return db[_0x5bb3('0x32')][_0x5bb3('0x5c')]({'where':{'id':_0x3e7fde['params']['id']}})[_0x5bb3('0x29')](handleEntityNotFound(_0x39ce15,null))[_0x5bb3('0x29')](function(_0x4d12c2){if(_0x4d12c2){_0x53ff47=_0x4d12c2;_0x5983e5[_0x5bb3('0x35')]=_[_0x5bb3('0x36')](db['Team'][_0x5bb3('0x4d')]);_0x5983e5['query']=_[_0x5bb3('0x36')](_0x3e7fde[_0x5bb3('0x37')]);_0x5983e5[_0x5bb3('0x38')]=_[_0x5bb3('0x39')](_0x5983e5[_0x5bb3('0x35')],_0x5983e5[_0x5bb3('0x37')]);_0x4f66fb[_0x5bb3('0x3b')]=_[_0x5bb3('0x39')](_0x5983e5[_0x5bb3('0x35')],qs[_0x5bb3('0x3a')](_0x3e7fde[_0x5bb3('0x37')][_0x5bb3('0x3a')]));_0x4f66fb[_0x5bb3('0x3b')]=_0x4f66fb['attributes']['length']?_0x4f66fb[_0x5bb3('0x3b')]:_0x5983e5[_0x5bb3('0x35')];_0x4f66fb[_0x5bb3('0x3f')]=qs[_0x5bb3('0x40')](_0x3e7fde[_0x5bb3('0x37')][_0x5bb3('0x40')]);_0x4f66fb[_0x5bb3('0x41')]=qs[_0x5bb3('0x38')](_[_0x5bb3('0x42')](_0x3e7fde[_0x5bb3('0x37')],_0x5983e5[_0x5bb3('0x38')]));if(_0x3e7fde[_0x5bb3('0x37')][_0x5bb3('0x45')]){_0x4f66fb[_0x5bb3('0x41')]=_[_0x5bb3('0x43')](_0x4f66fb['where'],{'$or':_[_0x5bb3('0x31')](_0x4f66fb['attributes'],function(_0x27a6e2){var _0x1c5642={};_0x1c5642[_0x27a6e2]={'$like':'%'+_0x3e7fde[_0x5bb3('0x37')][_0x5bb3('0x45')]+'%'};return _0x1c5642;})});}_0x4f66fb=_[_0x5bb3('0x43')]({},_0x4f66fb,_0x3e7fde['options']);return _0x53ff47[_0x5bb3('0x66')](_0x4f66fb);}})['then'](function(_0x348766){if(_0x348766){_0x4f21c2=_0x348766[_0x5bb3('0x3c')];if(!_0x3e7fde[_0x5bb3('0x37')][_0x5bb3('0x3d')](_0x5bb3('0x3e'))){_0x4f66fb[_0x5bb3('0x24')]=qs['limit'](_0x3e7fde[_0x5bb3('0x37')][_0x5bb3('0x24')]);_0x4f66fb[_0x5bb3('0x21')]=qs[_0x5bb3('0x21')](_0x3e7fde[_0x5bb3('0x37')]['offset']);}return _0x53ff47[_0x5bb3('0x66')](_0x4f66fb);}})[_0x5bb3('0x29')](function(_0x5d961a){if(_0x5d961a){return _0x5d961a?{'count':_0x4f21c2,'rows':_0x5d961a}:null;}})[_0x5bb3('0x29')](respondWithResult(_0x39ce15,null))[_0x5bb3('0x4a')](handleError(_0x39ce15,null));};exports[_0x5bb3('0x67')]=function(_0x19464d,_0x1acdd5,_0x5bdc5f){var _0x37c28f=_0x19464d[_0x5bb3('0x59')][_0x5bb3('0x68')];return db[_0x5bb3('0x69')]['findAll']({'where':{'id':_0x37c28f},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5bb3('0x6a'),'attributes':['id',_0x5bb3('0x2e'),_0x5bb3('0x6b'),_0x5bb3('0x6c'),_0x5bb3('0x6d')],'raw':!![]}]})['then'](function(_0x152a66){if(_0x152a66){var _0x374e44=_['flatMap'](_0x152a66,function(_0x1c1e7f){var _0x4e5f5a=_0x1c1e7f['get']({'plain':!![]});return _0x4e5f5a[_0x5bb3('0x6a')];});return db[_0x5bb3('0x32')][_0x5bb3('0x4f')]({'where':{'id':_0x19464d[_0x5bb3('0x4c')]['id']}})[_0x5bb3('0x29')](function(_0x42559e){return db[_0x5bb3('0x6e')][_0x5bb3('0x6f')](function(_0x3f3f57){return _0x42559e[_0x5bb3('0x67')](_0x37c28f,{'transaction':_0x3f3f57})[_0x5bb3('0x29')](function(){return BPromise[_0x5bb3('0x70')](_0x374e44,function(_0x30352d){return db['UserSmsQueue'][_0x5bb3('0x71')]({'where':{'UserId':_0x30352d['id'],'SmsQueueId':_0x19464d[_0x5bb3('0x4c')]['id']},'transaction':_0x3f3f57});});})[_0x5bb3('0x29')](function(){_0x374e44['forEach'](function(_0x1389b2){socket[_0x5bb3('0x72')](_0x5bb3('0x73'),{'UserId':_0x1389b2['id'],'SmsQueueId':_0x42559e['id']});});});});});}})['then'](respondWithStatusCode(_0x1acdd5,null))['catch'](handleError(_0x1acdd5,null));};exports[_0x5bb3('0x74')]=function(_0x251432,_0xb50e40,_0x3dd97f){return db[_0x5bb3('0x69')]['findAll']({'where':{'id':_0x251432[_0x5bb3('0x37')][_0x5bb3('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5bb3('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x5bb3('0x29')](handleEntityNotFound(_0xb50e40,null))['then'](function(_0x5f0234){var _0x579f7b=_['map'](_0x5f0234,'id');var _0x2db4b6=[];var _0x4effe3=[];var _0x200b21=squel[_0x5bb3('0x75')]();_0x200b21[_0x5bb3('0x76')]('tq.TeamId')['from'](_0x5bb3('0x77'),'tq')[_0x5bb3('0x78')]('user_has_teams','ut',_0x5bb3('0x79'))[_0x5bb3('0x41')]('SmsQueueId\x20=\x20?',_0x251432[_0x5bb3('0x4c')]['id']);for(var _0x19b3c6=0x0;_0x19b3c6<_0x5f0234[_0x5bb3('0x3c')];_0x19b3c6+=0x1){let _0x302eb9=_0x5f0234[_0x19b3c6];for(var _0x2cb0ec=0x0;_0x2cb0ec<_0x302eb9[_0x5bb3('0x6a')][_0x5bb3('0x3c')];_0x2cb0ec+=0x1){let _0x588b7e=_0x302eb9[_0x5bb3('0x6a')][_0x2cb0ec];var _0x3b20a3=_0x200b21['clone']();_0x3b20a3[_0x5bb3('0x41')]('ut.UserId\x20=\x20?',_0x588b7e['id']);_0x4effe3[_0x5bb3('0x7a')](db[_0x5bb3('0x6e')][_0x5bb3('0x37')](_0x3b20a3[_0x5bb3('0x7b')](),{'type':db['sequelize'][_0x5bb3('0x7c')][_0x5bb3('0x7d')]})['then'](function(_0x50a44b){if(_0x50a44b['length']===0x1){return _0x588b7e['id'];}else{var _0x4d8683=_['every'](_[_0x5bb3('0x31')](_0x50a44b,'TeamId'),function(_0xd83db8){return _[_0x5bb3('0x7e')](_0x579f7b,_0xd83db8);});if(_0x4d8683){return _0x588b7e['id'];}}}));}}return BPromise[_0x5bb3('0x7f')](_0x4effe3)[_0x5bb3('0x29')](function(_0x1ba8fb){_0x2db4b6=_(_0x2db4b6)[_0x5bb3('0x80')](_0x1ba8fb)[_0x5bb3('0x81')]()[_0x5bb3('0x82')]();return db[_0x5bb3('0x32')]['find']({'where':{'id':_0x251432[_0x5bb3('0x4c')]['id']}})[_0x5bb3('0x29')](function(_0xbd0914){return db['sequelize'][_0x5bb3('0x6f')](function(_0x45bd9d){return _0xbd0914[_0x5bb3('0x74')](_0x251432[_0x5bb3('0x37')][_0x5bb3('0x68')],{'transaction':_0x45bd9d})[_0x5bb3('0x29')](function(){if(!_[_0x5bb3('0x83')](_0x2db4b6)){return _0xbd0914[_0x5bb3('0x84')](_0x2db4b6,{'transaction':_0x45bd9d});}})['then'](function(){_0x2db4b6[_0x5bb3('0x85')](function(_0x156351){socket['emit'](_0x5bb3('0x86'),{'UserId':_0x156351,'SmsQueueId':_0xbd0914['id']});});});});});});})[_0x5bb3('0x29')](respondWithStatusCode(_0xb50e40,null))[_0x5bb3('0x4a')](handleError(_0xb50e40,null));};exports[_0x5bb3('0x87')]=function(_0x3ee41c,_0x16bf70,_0x320afc){return db[_0x5bb3('0x32')][_0x5bb3('0x4f')]({'where':{'id':_0x3ee41c['params']['id']}})['then'](handleEntityNotFound(_0x16bf70,null))[_0x5bb3('0x29')](function(_0x1b5a4c){if(_0x1b5a4c){return _0x1b5a4c[_0x5bb3('0x87')](_0x3ee41c[_0x5bb3('0x59')][_0x5bb3('0x68')],_[_0x5bb3('0x88')](_0x3ee41c['body'],[_0x5bb3('0x68'),'id'])||{})[_0x5bb3('0x89')](function(_0x3ce8cd){for(var _0x67ac4c=0x0;_0x67ac4c<_0x3ee41c['body'][_0x5bb3('0x68')][_0x5bb3('0x3c')];_0x67ac4c+=0x1){socket[_0x5bb3('0x72')]('userSmsQueue:save',{'UserId':Number(_0x3ee41c[_0x5bb3('0x59')][_0x5bb3('0x68')][_0x67ac4c]),'SmsQueueId':Number(_0x3ee41c[_0x5bb3('0x4c')]['id'])});}return _0x3ce8cd;});}})[_0x5bb3('0x29')](respondWithResult(_0x16bf70,null))['catch'](handleError(_0x16bf70,null));};exports[_0x5bb3('0x84')]=function(_0x750eab,_0x27f139,_0x116cb4){return db['SmsQueue'][_0x5bb3('0x4f')]({'where':{'id':_0x750eab['params']['id']}})[_0x5bb3('0x29')](handleEntityNotFound(_0x27f139,null))[_0x5bb3('0x29')](function(_0x518b2a){if(_0x518b2a){return _0x518b2a[_0x5bb3('0x84')](_0x750eab[_0x5bb3('0x37')][_0x5bb3('0x68')])['then'](function(){if(_['isArray'](_0x750eab[_0x5bb3('0x37')][_0x5bb3('0x68')])){for(var _0x21f45c=0x0;_0x21f45c<_0x750eab[_0x5bb3('0x37')][_0x5bb3('0x68')][_0x5bb3('0x3c')];_0x21f45c+=0x1){socket['emit'](_0x5bb3('0x86'),{'UserId':Number(_0x750eab[_0x5bb3('0x37')][_0x5bb3('0x68')][_0x21f45c]),'SmsQueueId':Number(_0x750eab[_0x5bb3('0x4c')]['id'])});}}else{socket[_0x5bb3('0x72')](_0x5bb3('0x86'),{'UserId':Number(_0x750eab[_0x5bb3('0x37')][_0x5bb3('0x68')]),'SmsQueueId':Number(_0x750eab[_0x5bb3('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x27f139,null))[_0x5bb3('0x4a')](handleError(_0x27f139,null));};exports[_0x5bb3('0x8a')]=function(_0x3c0c9a,_0x74e7c2,_0x335f9e){var _0x4fb940={};var _0x1cd0eb={};var _0x57de9f;var _0x4696be;return db['SmsQueue']['findOne']({'where':{'id':_0x3c0c9a['params']['id']}})['then'](handleEntityNotFound(_0x74e7c2,null))[_0x5bb3('0x29')](function(_0x35ad11){if(_0x35ad11){_0x57de9f=_0x35ad11;_0x1cd0eb['model']=_[_0x5bb3('0x36')](db['User']['rawAttributes']);_0x1cd0eb['query']=_[_0x5bb3('0x36')](_0x3c0c9a['query']);_0x1cd0eb[_0x5bb3('0x38')]=_[_0x5bb3('0x39')](_0x1cd0eb[_0x5bb3('0x35')],_0x1cd0eb['query']);_0x4fb940[_0x5bb3('0x3b')]=_[_0x5bb3('0x39')](_0x1cd0eb[_0x5bb3('0x35')],qs[_0x5bb3('0x3a')](_0x3c0c9a[_0x5bb3('0x37')][_0x5bb3('0x3a')]));_0x4fb940['attributes']=_0x4fb940[_0x5bb3('0x3b')][_0x5bb3('0x3c')]?_0x4fb940[_0x5bb3('0x3b')]:_0x1cd0eb[_0x5bb3('0x35')];_0x4fb940[_0x5bb3('0x3f')]=qs[_0x5bb3('0x40')](_0x3c0c9a[_0x5bb3('0x37')][_0x5bb3('0x40')]);_0x4fb940[_0x5bb3('0x41')]=qs[_0x5bb3('0x38')](_[_0x5bb3('0x42')](_0x3c0c9a[_0x5bb3('0x37')],_0x1cd0eb[_0x5bb3('0x38')]));if(_0x3c0c9a[_0x5bb3('0x37')][_0x5bb3('0x45')]){_0x4fb940[_0x5bb3('0x41')]=_[_0x5bb3('0x43')](_0x4fb940[_0x5bb3('0x41')],{'$or':_[_0x5bb3('0x31')](_0x4fb940[_0x5bb3('0x3b')],function(_0x43b1cb){var _0x44e537={};_0x44e537[_0x43b1cb]={'$like':'%'+_0x3c0c9a['query'][_0x5bb3('0x45')]+'%'};return _0x44e537;})});}_0x4fb940=_[_0x5bb3('0x43')]({},_0x4fb940,_0x3c0c9a[_0x5bb3('0x4e')]);return _0x57de9f[_0x5bb3('0x8a')](_0x4fb940);}})[_0x5bb3('0x29')](function(_0x51c9b4){if(_0x51c9b4){_0x4696be=_0x51c9b4[_0x5bb3('0x3c')];if(!_0x3c0c9a[_0x5bb3('0x37')][_0x5bb3('0x3d')]('nolimit')){_0x4fb940[_0x5bb3('0x24')]=qs[_0x5bb3('0x24')](_0x3c0c9a[_0x5bb3('0x37')]['limit']);_0x4fb940[_0x5bb3('0x21')]=qs['offset'](_0x3c0c9a[_0x5bb3('0x37')][_0x5bb3('0x21')]);}return _0x57de9f['getAgents'](_0x4fb940);}})[_0x5bb3('0x29')](function(_0x53e8b2){if(_0x53e8b2){return _0x53e8b2?{'count':_0x4696be,'rows':_0x53e8b2}:null;}})['then'](respondWithResult(_0x74e7c2,null))['catch'](handleError(_0x74e7c2,null));}; \ No newline at end of file +var _0xa54e=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','localhost','./smsQueue.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','save','update','destroy','then','get','SmsQueues','UserProfileResource','error','name','send','map','SmsQueue','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','describe','getMembers','findOne','UserSmsQueue','nolimit','pick','SmsQueueId','findAndCountAll','UserId','smsPause','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','forEach','omit','spread','userSmsQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa54e,0x7d));var _0xea54=function(_0x37a0ce,_0x28dc04){_0x37a0ce=_0x37a0ce-0x0;var _0x569f4e=_0xa54e[_0x37a0ce];return _0x569f4e;};'use strict';var emlformat=require(_0xea54('0x0'));var rimraf=require(_0xea54('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea54('0x2'));var rp=require('request-promise');var moment=require(_0xea54('0x3'));var BPromise=require(_0xea54('0x4'));var Mustache=require(_0xea54('0x5'));var util=require('util');var path=require(_0xea54('0x6'));var sox=require(_0xea54('0x7'));var csv=require(_0xea54('0x8'));var ejs=require(_0xea54('0x9'));var fs=require('fs');var fs_extra=require(_0xea54('0xa'));var _=require('lodash');var squel=require(_0xea54('0xb'));var crypto=require(_0xea54('0xc'));var jsforce=require(_0xea54('0xd'));var deskjs=require(_0xea54('0xe'));var toCsv=require(_0xea54('0x8'));var querystring=require('querystring');var Papa=require(_0xea54('0xf'));var Redis=require(_0xea54('0x10'));var authService=require(_0xea54('0x11'));var qs=require(_0xea54('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea54('0x13'));var logger=require(_0xea54('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xea54('0x15'));var licenseUtil=require(_0xea54('0x16'));var db=require('../../mysqldb')['db'];config[_0xea54('0x17')]=_['defaults'](config['redis'],{'host':_0xea54('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea54('0x17')]));require(_0xea54('0x19'))[_0xea54('0x1a')](socket);function respondWithStatusCode(_0xde8a3c,_0x463dbe){_0x463dbe=_0x463dbe||0xcc;return function(_0x1160b3){if(_0x1160b3){return _0xde8a3c[_0xea54('0x1b')](_0x463dbe);}return _0xde8a3c[_0xea54('0x1c')](_0x463dbe)[_0xea54('0x1d')]();};}function respondWithResult(_0x9ac82e,_0x5f5dac){_0x5f5dac=_0x5f5dac||0xc8;return function(_0x101eea){if(_0x101eea){return _0x9ac82e[_0xea54('0x1c')](_0x5f5dac)['json'](_0x101eea);}};}function respondWithFilteredResult(_0x4abc9a,_0xb9cb7f){return function(_0x13e7fe){if(_0x13e7fe){var _0x38daf7=typeof _0xb9cb7f[_0xea54('0x1e')]==='undefined'&&typeof _0xb9cb7f[_0xea54('0x1f')]===_0xea54('0x20');var _0x244cbb=_0x13e7fe[_0xea54('0x21')];var _0x7394e3=_0x38daf7?0x0:_0xb9cb7f[_0xea54('0x1e')];var _0x529912=_0x38daf7?_0x13e7fe['count']:_0xb9cb7f['offset']+_0xb9cb7f[_0xea54('0x1f')];var _0x31446a;if(_0x529912>=_0x244cbb){_0x529912=_0x244cbb;_0x31446a=0xc8;}else{_0x31446a=0xce;}_0x4abc9a[_0xea54('0x1c')](_0x31446a);return _0x4abc9a[_0xea54('0x22')](_0xea54('0x23'),_0x7394e3+'-'+_0x529912+'/'+_0x244cbb)['json'](_0x13e7fe);}return null;};}function patchUpdates(_0x24f6e6){return function(_0x8df446){try{jsonpatch['apply'](_0x8df446,_0x24f6e6,!![]);}catch(_0x210eee){return BPromise['reject'](_0x210eee);}return _0x8df446[_0xea54('0x24')]();};}function saveUpdates(_0x3694f9,_0x319758){return function(_0xd5ad03){if(_0xd5ad03){return _0xd5ad03[_0xea54('0x25')](_0x3694f9)['then'](function(_0x294e81){return _0x294e81;});}return null;};}function removeEntity(_0x58037a,_0x78fe98){return function(_0x4fc330){if(_0x4fc330){return _0x4fc330[_0xea54('0x26')]()[_0xea54('0x27')](function(){var _0x3f45e8=_0x4fc330[_0xea54('0x28')]({'plain':!![]});var _0x4b3707=_0xea54('0x29');return db[_0xea54('0x2a')][_0xea54('0x26')]({'where':{'type':_0x4b3707,'resourceId':_0x3f45e8['id']}})[_0xea54('0x27')](function(){return _0x4fc330;});})[_0xea54('0x27')](function(){_0x58037a[_0xea54('0x1c')](0xcc)[_0xea54('0x1d')]();});}};}function handleEntityNotFound(_0x59cc0a,_0x2ee577){return function(_0x1262f4){if(!_0x1262f4){_0x59cc0a[_0xea54('0x1b')](0x194);}return _0x1262f4;};}function handleError(_0x394c13,_0x470600){_0x470600=_0x470600||0x1f4;return function(_0x495524){logger[_0xea54('0x2b')](_0x495524['stack']);if(_0x495524[_0xea54('0x2c')]){delete _0x495524[_0xea54('0x2c')];}_0x394c13[_0xea54('0x1c')](_0x470600)[_0xea54('0x2d')](_0x495524);};}exports['index']=function(_0x2ed479,_0xd08ed7){var _0xe95a45={},_0x3870ca={},_0x2b3d63={'count':0x0,'rows':[]};var _0x4f78a3=_[_0xea54('0x2e')](db[_0xea54('0x2f')][_0xea54('0x30')],function(_0x250444){return{'name':_0x250444['fieldName'],'type':_0x250444[_0xea54('0x31')][_0xea54('0x32')]};});_0x3870ca[_0xea54('0x33')]=_[_0xea54('0x2e')](_0x4f78a3,_0xea54('0x2c'));_0x3870ca[_0xea54('0x34')]=_['keys'](_0x2ed479['query']);_0x3870ca[_0xea54('0x35')]=_[_0xea54('0x36')](_0x3870ca[_0xea54('0x33')],_0x3870ca[_0xea54('0x34')]);_0xe95a45[_0xea54('0x37')]=_[_0xea54('0x36')](_0x3870ca['model'],qs[_0xea54('0x38')](_0x2ed479[_0xea54('0x34')][_0xea54('0x38')]));_0xe95a45[_0xea54('0x37')]=_0xe95a45['attributes'][_0xea54('0x39')]?_0xe95a45[_0xea54('0x37')]:_0x3870ca[_0xea54('0x33')];if(!_0x2ed479[_0xea54('0x34')][_0xea54('0x3a')]('nolimit')){_0xe95a45[_0xea54('0x1f')]=qs[_0xea54('0x1f')](_0x2ed479[_0xea54('0x34')][_0xea54('0x1f')]);_0xe95a45[_0xea54('0x1e')]=qs[_0xea54('0x1e')](_0x2ed479[_0xea54('0x34')][_0xea54('0x1e')]);}_0xe95a45[_0xea54('0x3b')]=qs[_0xea54('0x3c')](_0x2ed479[_0xea54('0x34')][_0xea54('0x3c')]);_0xe95a45[_0xea54('0x3d')]=qs[_0xea54('0x35')](_['pick'](_0x2ed479[_0xea54('0x34')],_0x3870ca[_0xea54('0x35')]),_0x4f78a3);if(_0x2ed479[_0xea54('0x34')][_0xea54('0x3e')]){_0xe95a45[_0xea54('0x3d')]=_[_0xea54('0x3f')](_0xe95a45[_0xea54('0x3d')],{'$or':_[_0xea54('0x2e')](_0x4f78a3,function(_0x3e3be6){if(_0x3e3be6[_0xea54('0x31')]!==_0xea54('0x40')){var _0x7a2f9e={};_0x7a2f9e[_0x3e3be6[_0xea54('0x2c')]]={'$like':'%'+_0x2ed479['query'][_0xea54('0x3e')]+'%'};return _0x7a2f9e;}})});}_0xe95a45=_[_0xea54('0x3f')]({},_0xe95a45,_0x2ed479[_0xea54('0x41')]);var _0x1f494f={'where':_0xe95a45[_0xea54('0x3d')]};return db['SmsQueue']['count'](_0x1f494f)['then'](function(_0x54c0f1){_0x2b3d63[_0xea54('0x21')]=_0x54c0f1;if(_0x2ed479['query']['includeAll']){_0xe95a45[_0xea54('0x42')]=[{'all':!![]}];}return db[_0xea54('0x2f')][_0xea54('0x43')](_0xe95a45);})[_0xea54('0x27')](function(_0x2531b3){_0x2b3d63[_0xea54('0x44')]=_0x2531b3;return _0x2b3d63;})['then'](respondWithFilteredResult(_0xd08ed7,_0xe95a45))[_0xea54('0x45')](handleError(_0xd08ed7,null));};exports[_0xea54('0x46')]=function(_0x163cbd,_0x37aae0){var _0x4851b4={'raw':!![],'where':{'id':_0x163cbd[_0xea54('0x47')]['id']}},_0x38e4a7={};_0x38e4a7['model']=_[_0xea54('0x48')](db[_0xea54('0x2f')][_0xea54('0x30')]);_0x38e4a7[_0xea54('0x34')]=_['keys'](_0x163cbd[_0xea54('0x34')]);_0x38e4a7[_0xea54('0x35')]=_['intersection'](_0x38e4a7['model'],_0x38e4a7['query']);_0x4851b4[_0xea54('0x37')]=_[_0xea54('0x36')](_0x38e4a7[_0xea54('0x33')],qs[_0xea54('0x38')](_0x163cbd['query'][_0xea54('0x38')]));_0x4851b4[_0xea54('0x37')]=_0x4851b4[_0xea54('0x37')][_0xea54('0x39')]?_0x4851b4[_0xea54('0x37')]:_0x38e4a7[_0xea54('0x33')];if(_0x163cbd['query'][_0xea54('0x49')]){_0x4851b4['include']=[{'all':!![]}];}_0x4851b4=_[_0xea54('0x3f')]({},_0x4851b4,_0x163cbd[_0xea54('0x41')]);return db[_0xea54('0x2f')][_0xea54('0x4a')](_0x4851b4)[_0xea54('0x27')](handleEntityNotFound(_0x37aae0,null))[_0xea54('0x27')](respondWithResult(_0x37aae0,null))[_0xea54('0x45')](handleError(_0x37aae0,null));};exports['create']=function(_0x3ed07d,_0x52f211){return db[_0xea54('0x2f')]['create'](_0x3ed07d[_0xea54('0x4b')],{})[_0xea54('0x27')](function(_0x3fc34d){var _0x3fbac7=_0x3ed07d[_0xea54('0x4c')][_0xea54('0x28')]({'plain':!![]});if(!_0x3fbac7)throw new Error(_0xea54('0x4d'));if(_0x3fbac7[_0xea54('0x4e')]==='user'){var _0x5ebc2c=_0x3fc34d[_0xea54('0x28')]({'plain':!![]});var _0x18438c=_0xea54('0x29');return db[_0xea54('0x4f')][_0xea54('0x4a')]({'where':{'name':_0x18438c,'userProfileId':_0x3fbac7[_0xea54('0x50')]},'raw':!![]})[_0xea54('0x27')](function(_0xab51aa){if(_0xab51aa&&_0xab51aa[_0xea54('0x51')]===0x0){return db[_0xea54('0x2a')][_0xea54('0x52')]({'name':_0x5ebc2c[_0xea54('0x2c')],'resourceId':_0x5ebc2c['id'],'type':_0xab51aa[_0xea54('0x2c')],'sectionId':_0xab51aa['id']},{})[_0xea54('0x27')](function(){return _0x3fc34d;});}else{return _0x3fc34d;}})[_0xea54('0x45')](function(_0x59f49){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59f49);throw _0x59f49;});}return _0x3fc34d;})[_0xea54('0x27')](respondWithResult(_0x52f211,0xc9))['catch'](handleError(_0x52f211,null));};exports['update']=function(_0x17a58e,_0x195aac){if(_0x17a58e[_0xea54('0x4b')]['id']){delete _0x17a58e[_0xea54('0x4b')]['id'];}return db['SmsQueue'][_0xea54('0x4a')]({'where':{'id':_0x17a58e[_0xea54('0x47')]['id']}})[_0xea54('0x27')](handleEntityNotFound(_0x195aac,null))[_0xea54('0x27')](saveUpdates(_0x17a58e[_0xea54('0x4b')],null))[_0xea54('0x27')](respondWithResult(_0x195aac,null))[_0xea54('0x45')](handleError(_0x195aac,null));};exports[_0xea54('0x26')]=function(_0x4f5152,_0x50b7f6){return db[_0xea54('0x2f')][_0xea54('0x4a')]({'where':{'id':_0x4f5152[_0xea54('0x47')]['id']}})[_0xea54('0x27')](handleEntityNotFound(_0x50b7f6,null))[_0xea54('0x27')](removeEntity(_0x50b7f6,null))['catch'](handleError(_0x50b7f6,null));};exports[_0xea54('0x53')]=function(_0x1300eb,_0x5227ea){return db[_0xea54('0x2f')][_0xea54('0x53')]()[_0xea54('0x27')](respondWithResult(_0x5227ea,null))[_0xea54('0x45')](handleError(_0x5227ea,null));};exports[_0xea54('0x54')]=function(_0x3f6f32,_0x4ca0d0,_0x5f1886){var _0x46fc3a={'raw':!![],'where':{}},_0x3b2ebc={},_0x49ff41;return db[_0xea54('0x2f')][_0xea54('0x55')]({'where':{'id':_0x3f6f32[_0xea54('0x47')]['id']}})['then'](handleEntityNotFound(_0x4ca0d0,null))[_0xea54('0x27')](function(_0x383062){if(_0x383062){_0x49ff41=_0x383062[_0xea54('0x28')]({'plain':!![]});_0x3b2ebc[_0xea54('0x33')]=_[_0xea54('0x48')](db[_0xea54('0x56')][_0xea54('0x30')]);_0x3b2ebc[_0xea54('0x34')]=_[_0xea54('0x48')](_0x3f6f32['query']);_0x3b2ebc[_0xea54('0x35')]=_[_0xea54('0x36')](_0x3b2ebc['model'],_0x3b2ebc[_0xea54('0x34')]);_0x46fc3a[_0xea54('0x37')]=_['intersection'](_0x3b2ebc[_0xea54('0x33')],qs[_0xea54('0x38')](_0x3f6f32['query'][_0xea54('0x38')]));_0x46fc3a[_0xea54('0x37')]=_0x46fc3a['attributes']['length']?_0x46fc3a[_0xea54('0x37')]:_0x3b2ebc['model'];if(!_0x3f6f32[_0xea54('0x34')][_0xea54('0x3a')](_0xea54('0x57'))){_0x46fc3a[_0xea54('0x1f')]=qs[_0xea54('0x1f')](_0x3f6f32[_0xea54('0x34')]['limit']);_0x46fc3a[_0xea54('0x1e')]=qs[_0xea54('0x1e')](_0x3f6f32[_0xea54('0x34')][_0xea54('0x1e')]);}_0x46fc3a[_0xea54('0x3b')]=qs[_0xea54('0x3c')](_0x3f6f32[_0xea54('0x34')]['sort']);_0x46fc3a[_0xea54('0x3d')]=qs[_0xea54('0x35')](_[_0xea54('0x58')](_0x3f6f32['query'],_0x3b2ebc[_0xea54('0x35')]));_0x46fc3a[_0xea54('0x3d')][_0xea54('0x59')]=_0x383062['id'];if(_0x3f6f32[_0xea54('0x34')]['filter']){_0x46fc3a['where']=_[_0xea54('0x3f')](_0x46fc3a[_0xea54('0x3d')],{'$or':_[_0xea54('0x2e')](_0x46fc3a[_0xea54('0x37')],function(_0x471d45){var _0x2b60f6={};_0x2b60f6[_0x471d45]={'$like':'%'+_0x3f6f32[_0xea54('0x34')][_0xea54('0x3e')]+'%'};return _0x2b60f6;})});}_0x46fc3a=_[_0xea54('0x3f')]({},_0x46fc3a,_0x3f6f32['options']);return db[_0xea54('0x56')][_0xea54('0x43')](_0x46fc3a);}})[_0xea54('0x27')](function(_0x2f074e){if(_0x2f074e){return db['User'][_0xea54('0x5a')]({'where':{'id':_['map'](_0x2f074e,_0xea54('0x5b')),'role':'agent'},'attributes':['id',_0xea54('0x2c'),_0xea54('0x5c'),'updatedAt',_0xea54('0x5d')]});}})[_0xea54('0x27')](function(_0x42f096){if(_0x42f096){return{'count':_0x42f096[_0xea54('0x21')],'rows':_[_0xea54('0x2e')](_0x42f096[_0xea54('0x44')],function(_0x3fb7bb){return{'membername':_0x3fb7bb[_0xea54('0x2c')],'UserId':_0x3fb7bb['id'],'queue_name':_0x49ff41[_0xea54('0x2c')],'SmsQueueId':_0x49ff41['id'],'interface':util[_0xea54('0x5e')](_0xea54('0x5f'),'SIP',_0x3fb7bb[_0xea54('0x2c')]),'penalty':0x0,'paused':_0x3fb7bb[_0xea54('0x5c')],'createdAt':_0x3fb7bb[_0xea54('0x5d')],'updatedAt':_0x3fb7bb['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xea54('0x27')](respondWithFilteredResult(_0x4ca0d0,_0x46fc3a))[_0xea54('0x45')](handleError(_0x4ca0d0,null));};exports[_0xea54('0x60')]=function(_0x506576,_0x27fac8,_0x30cac0){var _0x2f93d3={};var _0xf2464e={};var _0x3fbfd4;var _0x31ae31;return db[_0xea54('0x2f')][_0xea54('0x55')]({'where':{'id':_0x506576[_0xea54('0x47')]['id']}})['then'](handleEntityNotFound(_0x27fac8,null))[_0xea54('0x27')](function(_0x227be2){if(_0x227be2){_0x3fbfd4=_0x227be2;_0xf2464e['model']=_[_0xea54('0x48')](db[_0xea54('0x61')][_0xea54('0x30')]);_0xf2464e['query']=_[_0xea54('0x48')](_0x506576[_0xea54('0x34')]);_0xf2464e[_0xea54('0x35')]=_[_0xea54('0x36')](_0xf2464e[_0xea54('0x33')],_0xf2464e[_0xea54('0x34')]);_0x2f93d3[_0xea54('0x37')]=_[_0xea54('0x36')](_0xf2464e[_0xea54('0x33')],qs[_0xea54('0x38')](_0x506576[_0xea54('0x34')][_0xea54('0x38')]));_0x2f93d3[_0xea54('0x37')]=_0x2f93d3[_0xea54('0x37')]['length']?_0x2f93d3[_0xea54('0x37')]:_0xf2464e[_0xea54('0x33')];_0x2f93d3[_0xea54('0x3b')]=qs[_0xea54('0x3c')](_0x506576[_0xea54('0x34')]['sort']);_0x2f93d3[_0xea54('0x3d')]=qs['filters'](_[_0xea54('0x58')](_0x506576[_0xea54('0x34')],_0xf2464e[_0xea54('0x35')]));if(_0x506576[_0xea54('0x34')][_0xea54('0x3e')]){_0x2f93d3[_0xea54('0x3d')]=_[_0xea54('0x3f')](_0x2f93d3[_0xea54('0x3d')],{'$or':_[_0xea54('0x2e')](_0x2f93d3[_0xea54('0x37')],function(_0x2f1b1b){var _0x17fa3e={};_0x17fa3e[_0x2f1b1b]={'$like':'%'+_0x506576[_0xea54('0x34')]['filter']+'%'};return _0x17fa3e;})});}_0x2f93d3=_[_0xea54('0x3f')]({},_0x2f93d3,_0x506576['options']);return _0x3fbfd4['getTeams'](_0x2f93d3);}})[_0xea54('0x27')](function(_0xdc45fe){if(_0xdc45fe){_0x31ae31=_0xdc45fe['length'];if(!_0x506576['query'][_0xea54('0x3a')]('nolimit')){_0x2f93d3[_0xea54('0x1f')]=qs[_0xea54('0x1f')](_0x506576['query'][_0xea54('0x1f')]);_0x2f93d3[_0xea54('0x1e')]=qs['offset'](_0x506576[_0xea54('0x34')][_0xea54('0x1e')]);}return _0x3fbfd4['getTeams'](_0x2f93d3);}})[_0xea54('0x27')](function(_0x3c5a97){if(_0x3c5a97){return _0x3c5a97?{'count':_0x31ae31,'rows':_0x3c5a97}:null;}})[_0xea54('0x27')](respondWithResult(_0x27fac8,null))[_0xea54('0x45')](handleError(_0x27fac8,null));};exports[_0xea54('0x62')]=function(_0x2af691,_0x16f6a6,_0x5a6497){var _0x4e1ca5=_0x2af691['body'][_0xea54('0x63')];return db[_0xea54('0x61')][_0xea54('0x43')]({'where':{'id':_0x4e1ca5},'attributes':['id'],'include':[{'model':db[_0xea54('0x64')],'as':_0xea54('0x65'),'attributes':['id',_0xea54('0x2c'),_0xea54('0x66'),_0xea54('0x67'),_0xea54('0x68')],'raw':!![]}]})[_0xea54('0x27')](function(_0x20c469){if(_0x20c469){var _0x4db6ca=_[_0xea54('0x69')](_0x20c469,function(_0x2ac299){var _0x4a29a6=_0x2ac299['get']({'plain':!![]});return _0x4a29a6[_0xea54('0x65')];});return db[_0xea54('0x2f')]['find']({'where':{'id':_0x2af691[_0xea54('0x47')]['id']}})[_0xea54('0x27')](function(_0x592dbf){return db[_0xea54('0x6a')][_0xea54('0x6b')](function(_0x45947b){return _0x592dbf[_0xea54('0x62')](_0x4e1ca5,{'transaction':_0x45947b})['then'](function(){return BPromise[_0xea54('0x6c')](_0x4db6ca,function(_0x564ebc){return db['UserSmsQueue'][_0xea54('0x6d')]({'where':{'UserId':_0x564ebc['id'],'SmsQueueId':_0x2af691[_0xea54('0x47')]['id']},'transaction':_0x45947b});});})[_0xea54('0x27')](function(){_0x4db6ca['forEach'](function(_0x120c44){socket[_0xea54('0x6e')](_0xea54('0x6f'),{'UserId':_0x120c44['id'],'SmsQueueId':_0x592dbf['id']});});});});});}})[_0xea54('0x27')](respondWithStatusCode(_0x16f6a6,null))[_0xea54('0x45')](handleError(_0x16f6a6,null));};exports[_0xea54('0x70')]=function(_0xb73621,_0x1478dd,_0x4dcd27){return db[_0xea54('0x61')][_0xea54('0x43')]({'where':{'id':_0xb73621[_0xea54('0x34')][_0xea54('0x63')]},'attributes':['id'],'include':[{'model':db[_0xea54('0x64')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1478dd,null))['then'](function(_0xd75704){var _0x832566=_[_0xea54('0x2e')](_0xd75704,'id');var _0x57e39c=[];var _0xb36a6e=[];var _0x242ee2=squel[_0xea54('0x71')]();_0x242ee2[_0xea54('0x72')]('tq.TeamId')[_0xea54('0x73')](_0xea54('0x74'),'tq')['join'](_0xea54('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xea54('0x76'),_0xb73621['params']['id']);for(var _0x1adef7=0x0;_0x1adef7<_0xd75704['length'];_0x1adef7+=0x1){let _0x16b4c3=_0xd75704[_0x1adef7];for(var _0x1ad25f=0x0;_0x1ad25f<_0x16b4c3[_0xea54('0x65')][_0xea54('0x39')];_0x1ad25f+=0x1){let _0x620f55=_0x16b4c3[_0xea54('0x65')][_0x1ad25f];var _0x283b0a=_0x242ee2[_0xea54('0x77')]();_0x283b0a['where'](_0xea54('0x78'),_0x620f55['id']);_0xb36a6e[_0xea54('0x79')](db[_0xea54('0x6a')][_0xea54('0x34')](_0x283b0a['toString'](),{'type':db[_0xea54('0x6a')][_0xea54('0x7a')][_0xea54('0x7b')]})[_0xea54('0x27')](function(_0x3e8559){if(_0x3e8559[_0xea54('0x39')]===0x1){return _0x620f55['id'];}else{var _0x44716a=_[_0xea54('0x7c')](_[_0xea54('0x2e')](_0x3e8559,_0xea54('0x7d')),function(_0x1168de){return _[_0xea54('0x7e')](_0x832566,_0x1168de);});if(_0x44716a){return _0x620f55['id'];}}}));}}return BPromise[_0xea54('0x7f')](_0xb36a6e)[_0xea54('0x27')](function(_0x25a3ba){_0x57e39c=_(_0x57e39c)[_0xea54('0x80')](_0x25a3ba)[_0xea54('0x81')]()['value']();return db['SmsQueue'][_0xea54('0x4a')]({'where':{'id':_0xb73621[_0xea54('0x47')]['id']}})['then'](function(_0x3fe6c9){return db['sequelize'][_0xea54('0x6b')](function(_0x8e32ab){return _0x3fe6c9[_0xea54('0x70')](_0xb73621['query'][_0xea54('0x63')],{'transaction':_0x8e32ab})[_0xea54('0x27')](function(){if(!_[_0xea54('0x82')](_0x57e39c)){return _0x3fe6c9[_0xea54('0x83')](_0x57e39c,{'transaction':_0x8e32ab});}})[_0xea54('0x27')](function(){_0x57e39c[_0xea54('0x84')](function(_0x536b4c){socket[_0xea54('0x6e')]('userSmsQueue:remove',{'UserId':_0x536b4c,'SmsQueueId':_0x3fe6c9['id']});});});});});});})[_0xea54('0x27')](respondWithStatusCode(_0x1478dd,null))[_0xea54('0x45')](handleError(_0x1478dd,null));};exports['addAgents']=function(_0xad8222,_0x390add,_0x107ef8){return db['SmsQueue'][_0xea54('0x4a')]({'where':{'id':_0xad8222['params']['id']}})[_0xea54('0x27')](handleEntityNotFound(_0x390add,null))[_0xea54('0x27')](function(_0x2592e1){if(_0x2592e1){return _0x2592e1['addAgents'](_0xad8222[_0xea54('0x4b')][_0xea54('0x63')],_[_0xea54('0x85')](_0xad8222[_0xea54('0x4b')],[_0xea54('0x63'),'id'])||{})[_0xea54('0x86')](function(_0xdbe52c){for(var _0x528744=0x0;_0x528744<_0xad8222[_0xea54('0x4b')]['ids'][_0xea54('0x39')];_0x528744+=0x1){socket[_0xea54('0x6e')](_0xea54('0x6f'),{'UserId':Number(_0xad8222[_0xea54('0x4b')][_0xea54('0x63')][_0x528744]),'SmsQueueId':Number(_0xad8222[_0xea54('0x47')]['id'])});}return _0xdbe52c;});}})[_0xea54('0x27')](respondWithResult(_0x390add,null))['catch'](handleError(_0x390add,null));};exports['removeAgents']=function(_0x4f5f7c,_0x3c8151,_0x1ce413){return db['SmsQueue'][_0xea54('0x4a')]({'where':{'id':_0x4f5f7c[_0xea54('0x47')]['id']}})[_0xea54('0x27')](handleEntityNotFound(_0x3c8151,null))[_0xea54('0x27')](function(_0x15ec9f){if(_0x15ec9f){return _0x15ec9f[_0xea54('0x83')](_0x4f5f7c[_0xea54('0x34')][_0xea54('0x63')])[_0xea54('0x27')](function(){if(_['isArray'](_0x4f5f7c[_0xea54('0x34')][_0xea54('0x63')])){for(var _0x239aff=0x0;_0x239aff<_0x4f5f7c['query'][_0xea54('0x63')]['length'];_0x239aff+=0x1){socket[_0xea54('0x6e')](_0xea54('0x87'),{'UserId':Number(_0x4f5f7c['query'][_0xea54('0x63')][_0x239aff]),'SmsQueueId':Number(_0x4f5f7c[_0xea54('0x47')]['id'])});}}else{socket[_0xea54('0x6e')](_0xea54('0x87'),{'UserId':Number(_0x4f5f7c['query']['ids']),'SmsQueueId':Number(_0x4f5f7c[_0xea54('0x47')]['id'])});}});}})[_0xea54('0x27')](respondWithStatusCode(_0x3c8151,null))[_0xea54('0x45')](handleError(_0x3c8151,null));};exports[_0xea54('0x88')]=function(_0x203d0c,_0xcf1ec4,_0x147157){var _0x3ec156={};var _0x6e4e07={};var _0x1e388d;var _0x2c05de;return db[_0xea54('0x2f')]['findOne']({'where':{'id':_0x203d0c[_0xea54('0x47')]['id']}})['then'](handleEntityNotFound(_0xcf1ec4,null))['then'](function(_0x5b9f64){if(_0x5b9f64){_0x1e388d=_0x5b9f64;_0x6e4e07[_0xea54('0x33')]=_[_0xea54('0x48')](db[_0xea54('0x64')]['rawAttributes']);_0x6e4e07['query']=_['keys'](_0x203d0c['query']);_0x6e4e07[_0xea54('0x35')]=_[_0xea54('0x36')](_0x6e4e07[_0xea54('0x33')],_0x6e4e07[_0xea54('0x34')]);_0x3ec156[_0xea54('0x37')]=_['intersection'](_0x6e4e07[_0xea54('0x33')],qs['fields'](_0x203d0c['query'][_0xea54('0x38')]));_0x3ec156[_0xea54('0x37')]=_0x3ec156[_0xea54('0x37')][_0xea54('0x39')]?_0x3ec156['attributes']:_0x6e4e07['model'];_0x3ec156[_0xea54('0x3b')]=qs[_0xea54('0x3c')](_0x203d0c['query']['sort']);_0x3ec156['where']=qs[_0xea54('0x35')](_['pick'](_0x203d0c[_0xea54('0x34')],_0x6e4e07['filters']));if(_0x203d0c[_0xea54('0x34')][_0xea54('0x3e')]){_0x3ec156[_0xea54('0x3d')]=_[_0xea54('0x3f')](_0x3ec156[_0xea54('0x3d')],{'$or':_[_0xea54('0x2e')](_0x3ec156[_0xea54('0x37')],function(_0x2e4c4f){var _0x1cd3df={};_0x1cd3df[_0x2e4c4f]={'$like':'%'+_0x203d0c[_0xea54('0x34')][_0xea54('0x3e')]+'%'};return _0x1cd3df;})});}_0x3ec156=_[_0xea54('0x3f')]({},_0x3ec156,_0x203d0c[_0xea54('0x41')]);return _0x1e388d[_0xea54('0x88')](_0x3ec156);}})[_0xea54('0x27')](function(_0x394960){if(_0x394960){_0x2c05de=_0x394960[_0xea54('0x39')];if(!_0x203d0c['query'][_0xea54('0x3a')](_0xea54('0x57'))){_0x3ec156['limit']=qs[_0xea54('0x1f')](_0x203d0c['query'][_0xea54('0x1f')]);_0x3ec156[_0xea54('0x1e')]=qs[_0xea54('0x1e')](_0x203d0c[_0xea54('0x34')][_0xea54('0x1e')]);}return _0x1e388d[_0xea54('0x88')](_0x3ec156);}})[_0xea54('0x27')](function(_0x2d46d9){if(_0x2d46d9){return _0x2d46d9?{'count':_0x2c05de,'rows':_0x2d46d9}:null;}})[_0xea54('0x27')](respondWithResult(_0xcf1ec4,null))['catch'](handleError(_0xcf1ec4,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 253edf9..1c72d8a 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 _0xfa2b=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0xfa2b,0x10d));var _0xbfa2=function(_0x4588fb,_0x2e5f2c){_0x4588fb=_0x4588fb-0x0;var _0x53b0ac=_0xfa2b[_0x4588fb];return _0x53b0ac;};'use strict';var EventEmitter=require(_0xbfa2('0x0'));var SmsQueue=require(_0xbfa2('0x1'))['db'][_0xbfa2('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbfa2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2a5d55){return function(_0x21b6d3,_0x51f2ed,_0x35a4e8){SmsQueueEvents[_0xbfa2('0x4')](_0x2a5d55+':'+_0x21b6d3['id'],_0x21b6d3);SmsQueueEvents['emit'](_0x2a5d55,_0x21b6d3);_0x35a4e8(null);};}for(var e in events){if(events[_0xbfa2('0x5')](e)){var event=events[e];SmsQueue[_0xbfa2('0x6')](e,emitEvent(event));}}module[_0xbfa2('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x19ae=['hasOwnProperty','hook','exports','events','SmsQueue','setMaxListeners','save','remove','emit'];(function(_0x32443e,_0x2d7d32){var _0x2aa089=function(_0x5d5924){while(--_0x5d5924){_0x32443e['push'](_0x32443e['shift']());}};_0x2aa089(++_0x2d7d32);}(_0x19ae,0x159));var _0xe19a=function(_0x1b3c32,_0x141fb8){_0x1b3c32=_0x1b3c32-0x0;var _0x48d8b9=_0x19ae[_0x1b3c32];return _0x48d8b9;};'use strict';var EventEmitter=require(_0xe19a('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xe19a('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xe19a('0x2')](0x0);var events={'afterCreate':_0xe19a('0x3'),'afterUpdate':'update','afterDestroy':_0xe19a('0x4')};function emitEvent(_0x2ef050){return function(_0x3ede66,_0xe8d83,_0x2a5ce2){SmsQueueEvents[_0xe19a('0x5')](_0x2ef050+':'+_0x3ede66['id'],_0x3ede66);SmsQueueEvents[_0xe19a('0x5')](_0x2ef050,_0x3ede66);_0x2a5ce2(null);};}for(var e in events){if(events[_0xe19a('0x6')](e)){var event=events[e];SmsQueue[_0xe19a('0x7')](e,emitEvent(event));}}module[_0xe19a('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index a8cbe4f..d29ee10 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 _0x729e=['./smsQueue.attributes','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x414143,_0x2669e9){var _0x541ca5=function(_0x21264a){while(--_0x21264a){_0x414143['push'](_0x414143['shift']());}};_0x541ca5(++_0x2669e9);}(_0x729e,0x188));var _0xe729=function(_0x5aaf21,_0x176623){_0x5aaf21=_0x5aaf21-0x0;var _0x3a5c93=_0x729e[_0x5aaf21];return _0x3a5c93;};'use strict';var _=require(_0xe729('0x0'));var util=require(_0xe729('0x1'));var logger=require(_0xe729('0x2'))(_0xe729('0x3'));var moment=require(_0xe729('0x4'));var BPromise=require(_0xe729('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe729('0x6'));var rimraf=require(_0xe729('0x7'));var config=require('../../config/environment');var attributes=require(_0xe729('0x8'));module['exports']=function(_0x496e13,_0x21e37b){return _0x496e13['define']('SmsQueue',attributes,{'tableName':_0xe729('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5987=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash'];(function(_0x319e55,_0x9befa){var _0x5071ce=function(_0x30907c){while(--_0x30907c){_0x319e55['push'](_0x319e55['shift']());}};_0x5071ce(++_0x9befa);}(_0x5987,0x14f));var _0x7598=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5987[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7598('0x0'));var util=require(_0x7598('0x1'));var logger=require(_0x7598('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7598('0x3'));var rp=require(_0x7598('0x4'));var fs=require('fs');var path=require(_0x7598('0x5'));var rimraf=require(_0x7598('0x6'));var config=require(_0x7598('0x7'));var attributes=require(_0x7598('0x8'));module[_0x7598('0x9')]=function(_0x3c50b5,_0xd5e84b){return _0x3c50b5['define'](_0x7598('0xa'),attributes,{'tableName':_0x7598('0xb'),'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 38d91e2..d066477 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 _0x7531=['include','model','ShowSmsQueue','SmsQueue','find','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetSmsQueue','findAll','options','where','attributes','limit','map'];(function(_0x49c559,_0x48418b){var _0x428f2d=function(_0xdd1d89){while(--_0xdd1d89){_0x49c559['push'](_0x49c559['shift']());}};_0x428f2d(++_0x48418b);}(_0x7531,0xea));var _0x1753=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7531[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x1753('0x0'));var moment=require(_0x1753('0x1'));var BPromise=require(_0x1753('0x2'));var rs=require(_0x1753('0x3'));var fs=require('fs');var Redis=require(_0x1753('0x4'));var db=require(_0x1753('0x5'))['db'];var utils=require(_0x1753('0x6'));var logger=require(_0x1753('0x7'))(_0x1753('0x8'));var config=require(_0x1753('0x9'));var jayson=require(_0x1753('0xa'));var client=jayson[_0x1753('0xb')][_0x1753('0xc')]({'port':0x232a});config[_0x1753('0xd')]=_['defaults'](config[_0x1753('0xd')],{'host':_0x1753('0xe'),'port':0x18eb});var socket=require(_0x1753('0xf'))(new Redis(config[_0x1753('0xd')]));require(_0x1753('0x10'))['register'](socket);function respondWithRpcPromise(_0x2ea4e2,_0x143335,_0x20543f){return new BPromise(function(_0x440d9f,_0x88c558){return client['request'](_0x2ea4e2,_0x20543f)['then'](function(_0x1e022a){logger[_0x1753('0x11')](_0x1753('0x12'),_0x143335,_0x1753('0x13'));logger[_0x1753('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x143335,'request\x20sent',JSON[_0x1753('0x15')](_0x1e022a));if(_0x1e022a[_0x1753('0x16')]){if(_0x1e022a[_0x1753('0x16')]['code']===0x1f4){logger['error'](_0x1753('0x12'),_0x143335,_0x1e022a[_0x1753('0x16')][_0x1753('0x17')]);return _0x88c558(_0x1e022a[_0x1753('0x16')][_0x1753('0x17')]);}logger['error'](_0x1753('0x12'),_0x143335,_0x1e022a['error'][_0x1753('0x17')]);return _0x440d9f(_0x1e022a[_0x1753('0x16')][_0x1753('0x17')]);}else{logger[_0x1753('0x11')]('SmsQueue,\x20%s,\x20%s',_0x143335,_0x1753('0x13'));_0x440d9f(_0x1e022a['result'][_0x1753('0x17')]);}})[_0x1753('0x18')](function(_0x3d0c89){logger[_0x1753('0x16')](_0x1753('0x12'),_0x143335,_0x3d0c89);_0x88c558(_0x3d0c89);});});}exports[_0x1753('0x19')]=function(_0x34c9ed){var _0xd80fdb=this;return new Promise(function(_0xa65f04,_0x49adf4){return db['SmsQueue'][_0x1753('0x1a')]({'raw':_0x34c9ed[_0x1753('0x1b')]?_0x34c9ed[_0x1753('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x34c9ed[_0x1753('0x1b')]?_0x34c9ed['options'][_0x1753('0x1c')]||null:null,'attributes':_0x34c9ed[_0x1753('0x1b')]?_0x34c9ed[_0x1753('0x1b')][_0x1753('0x1d')]||null:null,'limit':_0x34c9ed[_0x1753('0x1b')]?_0x34c9ed[_0x1753('0x1b')][_0x1753('0x1e')]||null:null,'include':_0x34c9ed['options']?_0x34c9ed[_0x1753('0x1b')]['include']?_[_0x1753('0x1f')](_0x34c9ed[_0x1753('0x1b')][_0x1753('0x20')],function(_0x5a84ab){return{'model':db[_0x5a84ab[_0x1753('0x21')]],'as':_0x5a84ab['as'],'attributes':_0x5a84ab[_0x1753('0x1d')],'include':_0x5a84ab[_0x1753('0x20')]?_[_0x1753('0x1f')](_0x5a84ab[_0x1753('0x20')],function(_0x346923){return{'model':db[_0x346923['model']],'as':_0x346923['as'],'attributes':_0x346923[_0x1753('0x1d')],'include':_0x346923[_0x1753('0x20')]?_[_0x1753('0x1f')](_0x346923[_0x1753('0x20')],function(_0x167e0c){return{'model':db[_0x167e0c[_0x1753('0x21')]],'as':_0x167e0c['as'],'attributes':_0x167e0c[_0x1753('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x548c1b){logger[_0x1753('0x11')](_0x1753('0x19'),_0x34c9ed);logger[_0x1753('0x14')]('GetSmsQueue',_0x34c9ed,JSON[_0x1753('0x15')](_0x548c1b));_0xa65f04(_0x548c1b);})['catch'](function(_0x12ac2a){logger[_0x1753('0x16')]('GetSmsQueue',_0x12ac2a['message'],_0x34c9ed);_0x49adf4(_0xd80fdb[_0x1753('0x16')](0x1f4,_0x12ac2a[_0x1753('0x17')]));});});};exports[_0x1753('0x22')]=function(_0x37b849){var _0x25438e=this;return new Promise(function(_0x1c046d,_0x1f772b){return db[_0x1753('0x23')][_0x1753('0x24')]({'raw':_0x37b849[_0x1753('0x1b')]?_0x37b849[_0x1753('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x37b849[_0x1753('0x1b')]?_0x37b849[_0x1753('0x1b')][_0x1753('0x1c')]||null:null,'attributes':_0x37b849[_0x1753('0x1b')]?_0x37b849[_0x1753('0x1b')][_0x1753('0x1d')]||null:null,'include':_0x37b849[_0x1753('0x1b')]?_0x37b849['options']['include']?_[_0x1753('0x1f')](_0x37b849['options'][_0x1753('0x20')],function(_0x5def3e){return{'model':db[_0x5def3e['model']],'as':_0x5def3e['as'],'attributes':_0x5def3e[_0x1753('0x1d')],'include':_0x5def3e[_0x1753('0x20')]?_['map'](_0x5def3e[_0x1753('0x20')],function(_0xf0aec6){return{'model':db[_0xf0aec6[_0x1753('0x21')]],'as':_0xf0aec6['as'],'attributes':_0xf0aec6[_0x1753('0x1d')],'include':_0xf0aec6[_0x1753('0x20')]?_[_0x1753('0x1f')](_0xf0aec6['include'],function(_0x3d5344){return{'model':db[_0x3d5344[_0x1753('0x21')]],'as':_0x3d5344['as'],'attributes':_0x3d5344[_0x1753('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1753('0x25')](function(_0x4dbe65){logger[_0x1753('0x11')](_0x1753('0x22'),_0x37b849);logger[_0x1753('0x14')](_0x1753('0x22'),_0x37b849,JSON[_0x1753('0x15')](_0x4dbe65));_0x1c046d(_0x4dbe65);})[_0x1753('0x18')](function(_0x247896){logger[_0x1753('0x16')](_0x1753('0x22'),_0x247896[_0x1753('0x17')],_0x37b849);_0x1f772b(_0x25438e['error'](0x1f4,_0x247896[_0x1753('0x17')]));});});}; \ No newline at end of file +var _0xe8ab=['register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','options','raw','limit','include','model','attributes','map','then','ShowSmsQueue','find','where','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x43f8cc,_0x592b95){var _0x1c8808=function(_0x352bf9){while(--_0x352bf9){_0x43f8cc['push'](_0x43f8cc['shift']());}};_0x1c8808(++_0x592b95);}(_0xe8ab,0x1e8));var _0xbe8a=function(_0x3e26b5,_0x4802b7){_0x3e26b5=_0x3e26b5-0x0;var _0x2913a0=_0xe8ab[_0x3e26b5];return _0x2913a0;};'use strict';var _=require(_0xbe8a('0x0'));var util=require(_0xbe8a('0x1'));var moment=require(_0xbe8a('0x2'));var BPromise=require(_0xbe8a('0x3'));var rs=require(_0xbe8a('0x4'));var fs=require('fs');var Redis=require(_0xbe8a('0x5'));var db=require(_0xbe8a('0x6'))['db'];var utils=require(_0xbe8a('0x7'));var logger=require(_0xbe8a('0x8'))('rpc');var config=require(_0xbe8a('0x9'));var jayson=require(_0xbe8a('0xa'));var client=jayson['client'][_0xbe8a('0xb')]({'port':0x232a});config[_0xbe8a('0xc')]=_[_0xbe8a('0xd')](config[_0xbe8a('0xc')],{'host':_0xbe8a('0xe'),'port':0x18eb});var socket=require(_0xbe8a('0xf'))(new Redis(config[_0xbe8a('0xc')]));require('./smsQueue.socket')[_0xbe8a('0x10')](socket);function respondWithRpcPromise(_0x46cb40,_0x537781,_0x5b9a31){return new BPromise(function(_0x444909,_0x229a28){return client[_0xbe8a('0x11')](_0x46cb40,_0x5b9a31)['then'](function(_0x35ee16){logger[_0xbe8a('0x12')](_0xbe8a('0x13'),_0x537781,_0xbe8a('0x14'));logger['debug'](_0xbe8a('0x15'),_0x537781,_0xbe8a('0x14'),JSON[_0xbe8a('0x16')](_0x35ee16));if(_0x35ee16['error']){if(_0x35ee16[_0xbe8a('0x17')][_0xbe8a('0x18')]===0x1f4){logger['error'](_0xbe8a('0x13'),_0x537781,_0x35ee16['error'][_0xbe8a('0x19')]);return _0x229a28(_0x35ee16[_0xbe8a('0x17')][_0xbe8a('0x19')]);}logger['error'](_0xbe8a('0x13'),_0x537781,_0x35ee16[_0xbe8a('0x17')][_0xbe8a('0x19')]);return _0x444909(_0x35ee16[_0xbe8a('0x17')][_0xbe8a('0x19')]);}else{logger[_0xbe8a('0x12')](_0xbe8a('0x13'),_0x537781,_0xbe8a('0x14'));_0x444909(_0x35ee16[_0xbe8a('0x1a')]['message']);}})[_0xbe8a('0x1b')](function(_0x2ade71){logger[_0xbe8a('0x17')](_0xbe8a('0x13'),_0x537781,_0x2ade71);_0x229a28(_0x2ade71);});});}exports[_0xbe8a('0x1c')]=function(_0x535cf9){var _0x307092=this;return new Promise(function(_0x33f0d4,_0x3f7740){return db[_0xbe8a('0x1d')]['findAll']({'raw':_0x535cf9[_0xbe8a('0x1e')]?_0x535cf9['options'][_0xbe8a('0x1f')]===undefined?!![]:![]:!![],'where':_0x535cf9[_0xbe8a('0x1e')]?_0x535cf9[_0xbe8a('0x1e')]['where']||null:null,'attributes':_0x535cf9[_0xbe8a('0x1e')]?_0x535cf9['options']['attributes']||null:null,'limit':_0x535cf9[_0xbe8a('0x1e')]?_0x535cf9[_0xbe8a('0x1e')][_0xbe8a('0x20')]||null:null,'include':_0x535cf9[_0xbe8a('0x1e')]?_0x535cf9['options'][_0xbe8a('0x21')]?_['map'](_0x535cf9[_0xbe8a('0x1e')][_0xbe8a('0x21')],function(_0xf05850){return{'model':db[_0xf05850[_0xbe8a('0x22')]],'as':_0xf05850['as'],'attributes':_0xf05850[_0xbe8a('0x23')],'include':_0xf05850[_0xbe8a('0x21')]?_[_0xbe8a('0x24')](_0xf05850[_0xbe8a('0x21')],function(_0x291e55){return{'model':db[_0x291e55[_0xbe8a('0x22')]],'as':_0x291e55['as'],'attributes':_0x291e55['attributes'],'include':_0x291e55['include']?_[_0xbe8a('0x24')](_0x291e55[_0xbe8a('0x21')],function(_0x38e01e){return{'model':db[_0x38e01e[_0xbe8a('0x22')]],'as':_0x38e01e['as'],'attributes':_0x38e01e[_0xbe8a('0x23')]};}):[]};}):[]};}):[]:[]})[_0xbe8a('0x25')](function(_0x2eff3a){logger[_0xbe8a('0x12')](_0xbe8a('0x1c'),_0x535cf9);logger['debug']('GetSmsQueue',_0x535cf9,JSON[_0xbe8a('0x16')](_0x2eff3a));_0x33f0d4(_0x2eff3a);})[_0xbe8a('0x1b')](function(_0x51e45c){logger[_0xbe8a('0x17')](_0xbe8a('0x1c'),_0x51e45c[_0xbe8a('0x19')],_0x535cf9);_0x3f7740(_0x307092[_0xbe8a('0x17')](0x1f4,_0x51e45c[_0xbe8a('0x19')]));});});};exports[_0xbe8a('0x26')]=function(_0x1af9f4){var _0x13f8f1=this;return new Promise(function(_0x25eb5f,_0x28c6ec){return db['SmsQueue'][_0xbe8a('0x27')]({'raw':_0x1af9f4[_0xbe8a('0x1e')]?_0x1af9f4[_0xbe8a('0x1e')][_0xbe8a('0x1f')]===undefined?!![]:![]:!![],'where':_0x1af9f4[_0xbe8a('0x1e')]?_0x1af9f4[_0xbe8a('0x1e')][_0xbe8a('0x28')]||null:null,'attributes':_0x1af9f4[_0xbe8a('0x1e')]?_0x1af9f4['options'][_0xbe8a('0x23')]||null:null,'include':_0x1af9f4[_0xbe8a('0x1e')]?_0x1af9f4[_0xbe8a('0x1e')][_0xbe8a('0x21')]?_['map'](_0x1af9f4['options'][_0xbe8a('0x21')],function(_0x3a2d78){return{'model':db[_0x3a2d78['model']],'as':_0x3a2d78['as'],'attributes':_0x3a2d78['attributes'],'include':_0x3a2d78[_0xbe8a('0x21')]?_['map'](_0x3a2d78[_0xbe8a('0x21')],function(_0x2e5ff9){return{'model':db[_0x2e5ff9[_0xbe8a('0x22')]],'as':_0x2e5ff9['as'],'attributes':_0x2e5ff9[_0xbe8a('0x23')],'include':_0x2e5ff9[_0xbe8a('0x21')]?_[_0xbe8a('0x24')](_0x2e5ff9[_0xbe8a('0x21')],function(_0xdbbbb2){return{'model':db[_0xdbbbb2['model']],'as':_0xdbbbb2['as'],'attributes':_0xdbbbb2['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe8a('0x25')](function(_0x17c93b){logger[_0xbe8a('0x12')](_0xbe8a('0x26'),_0x1af9f4);logger[_0xbe8a('0x29')]('ShowSmsQueue',_0x1af9f4,JSON[_0xbe8a('0x16')](_0x17c93b));_0x25eb5f(_0x17c93b);})[_0xbe8a('0x1b')](function(_0x4aaa92){logger[_0xbe8a('0x17')](_0xbe8a('0x26'),_0x4aaa92[_0xbe8a('0x19')],_0x1af9f4);_0x28c6ec(_0x13f8f1['error'](0x1f4,_0x4aaa92['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index fce7126..59a0f36 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 _0x720f=['./smsQueue.events','save','remove','emit','register','smsQueue:'];(function(_0x593af5,_0x433faf){var _0x793bbc=function(_0xe8e7d3){while(--_0xe8e7d3){_0x593af5['push'](_0x593af5['shift']());}};_0x793bbc(++_0x433faf);}(_0x720f,0x1aa));var _0xf720=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x720f[_0xbb091];return _0x467a04;};'use strict';var SmsQueueEvents=require(_0xf720('0x0'));var events=[_0xf720('0x1'),_0xf720('0x2'),'update'];function createListener(_0x1fdf37,_0x2d3c92){return function(_0x30a10d){_0x2d3c92[_0xf720('0x3')](_0x1fdf37,_0x30a10d);};}function removeListener(_0x3dcdfe,_0x2ec7e5){return function(){SmsQueueEvents['removeListener'](_0x3dcdfe,_0x2ec7e5);};}exports[_0xf720('0x4')]=function(_0x49650e){for(var _0x40cad2=0x0,_0x3e28ba=events['length'];_0x40cad2<_0x3e28ba;_0x40cad2++){var _0x1e4308=events[_0x40cad2];var _0x2a8700=createListener(_0xf720('0x5')+_0x1e4308,_0x49650e);SmsQueueEvents['on'](_0x1e4308,_0x2a8700);}}; \ No newline at end of file +var _0xe972=['register','smsQueue:','./smsQueue.events','save','remove','update','removeListener'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe972,0x198));var _0x2e97=function(_0x4f7a97,_0x14f986){_0x4f7a97=_0x4f7a97-0x0;var _0x2d97cb=_0xe972[_0x4f7a97];return _0x2d97cb;};'use strict';var SmsQueueEvents=require(_0x2e97('0x0'));var events=[_0x2e97('0x1'),_0x2e97('0x2'),_0x2e97('0x3')];function createListener(_0x3b2a80,_0x55ea67){return function(_0x4d022b){_0x55ea67['emit'](_0x3b2a80,_0x4d022b);};}function removeListener(_0x506557,_0x529155){return function(){SmsQueueEvents[_0x2e97('0x4')](_0x506557,_0x529155);};}exports[_0x2e97('0x5')]=function(_0x8cbc38){for(var _0x4cc432=0x0,_0x56a6cf=events['length'];_0x4cc432<_0x56a6cf;_0x4cc432++){var _0x929be8=events[_0x4cc432];var _0x52e671=createListener(_0x2e97('0x6')+_0x929be8,_0x8cbc38);SmsQueueEvents['on'](_0x929be8,_0x52e671);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index f49e55b..3da7cc4 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 _0x38e7=['get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xcad01d,_0xef9abc){var _0x76a4a6=function(_0x15b2a4){while(--_0x15b2a4){_0xcad01d['push'](_0xcad01d['shift']());}};_0x76a4a6(++_0xef9abc);}(_0x38e7,0x124));var _0x738e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x38e7[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0x738e('0x0'));var path=require('path');var timeout=require(_0x738e('0x1'));var express=require(_0x738e('0x2'));var router=express[_0x738e('0x3')]();var fs_extra=require(_0x738e('0x4'));var auth=require(_0x738e('0x5'));var interaction=require(_0x738e('0x6'));var config=require(_0x738e('0x7'));var controller=require('./smsQueueReport.controller');router[_0x738e('0x8')]('/',auth[_0x738e('0x9')](),controller[_0x738e('0xa')]);router[_0x738e('0x8')](_0x738e('0xb'),auth[_0x738e('0x9')](),controller[_0x738e('0xc')]);router[_0x738e('0x8')](_0x738e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x738e('0xe')]('/',auth[_0x738e('0x9')](),controller['create']);router[_0x738e('0xf')](_0x738e('0xd'),auth[_0x738e('0x9')](),controller[_0x738e('0x10')]);router[_0x738e('0x11')](_0x738e('0xd'),auth[_0x738e('0x9')](),controller[_0x738e('0x12')]);module[_0x738e('0x13')]=router; \ No newline at end of file +var _0x33c1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','destroy','exports','util','connect-timeout','express'];(function(_0x364e5c,_0x1fc0e4){var _0x370035=function(_0x220ed6){while(--_0x220ed6){_0x364e5c['push'](_0x364e5c['shift']());}};_0x370035(++_0x1fc0e4);}(_0x33c1,0x82));var _0x133c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x33c1[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x133c('0x0'));var path=require('path');var timeout=require(_0x133c('0x1'));var express=require(_0x133c('0x2'));var router=express['Router']();var fs_extra=require(_0x133c('0x3'));var auth=require(_0x133c('0x4'));var interaction=require(_0x133c('0x5'));var config=require(_0x133c('0x6'));var controller=require(_0x133c('0x7'));router[_0x133c('0x8')]('/',auth[_0x133c('0x9')](),controller[_0x133c('0xa')]);router[_0x133c('0x8')](_0x133c('0xb'),auth[_0x133c('0x9')](),controller[_0x133c('0xc')]);router[_0x133c('0x8')](_0x133c('0xd'),auth[_0x133c('0x9')](),controller[_0x133c('0xe')]);router[_0x133c('0xf')]('/',auth['isAuthenticated'](),controller[_0x133c('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x133c('0x9')](),controller[_0x133c('0x11')]);module[_0x133c('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 41eb9ac..a7448c2 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 _0x89db=['DATE','sequelize','STRING'];(function(_0x139a83,_0x5ad714){var _0x58dd64=function(_0x185e77){while(--_0x185e77){_0x139a83['push'](_0x139a83['shift']());}};_0x58dd64(++_0x5ad714);}(_0x89db,0xdf));var _0xb89d=function(_0x242b2b,_0x1865ce){_0x242b2b=_0x242b2b-0x0;var _0x27edff=_0x89db[_0x242b2b];return _0x27edff;};'use strict';var moment=require('moment');var Sequelize=require(_0xb89d('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb89d('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb89d('0x2')]},'acceptAt':{'type':Sequelize[_0xb89d('0x2')]},'exitAt':{'type':Sequelize[_0xb89d('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9ca2=['sequelize','exports','STRING','DATE'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0x9ca2,0x13c));var _0x29ca=function(_0x5b8732,_0x135598){_0x5b8732=_0x5b8732-0x0;var _0x54b93e=_0x9ca2[_0x5b8732];return _0x54b93e;};'use strict';var moment=require('moment');var Sequelize=require(_0x29ca('0x0'));module[_0x29ca('0x1')]={'uniqueid':{'type':Sequelize[_0x29ca('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x29ca('0x2')]},'joinAt':{'type':Sequelize[_0x29ca('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x29ca('0x3')]},'exitAt':{'type':Sequelize[_0x29ca('0x3')]},'reason':{'type':Sequelize[_0x29ca('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index ad43aee..70968fd 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 _0x349a=['../../components/auth/service','../../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','error','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','then','catch','keys','includeAll','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x23acf0,_0x156bb0){var _0xd1bbe0=function(_0x4031be){while(--_0x4031be){_0x23acf0['push'](_0x23acf0['shift']());}};_0xd1bbe0(++_0x156bb0);}(_0x349a,0x89));var _0xa349=function(_0x4906ca,_0x7cb8c0){_0x4906ca=_0x4906ca-0x0;var _0x493642=_0x349a[_0x4906ca];return _0x493642;};'use strict';var emlformat=require(_0xa349('0x0'));var rimraf=require(_0xa349('0x1'));var zipdir=require(_0xa349('0x2'));var jsonpatch=require(_0xa349('0x3'));var rp=require(_0xa349('0x4'));var moment=require(_0xa349('0x5'));var BPromise=require(_0xa349('0x6'));var Mustache=require(_0xa349('0x7'));var util=require(_0xa349('0x8'));var path=require(_0xa349('0x9'));var sox=require('sox');var csv=require(_0xa349('0xa'));var ejs=require(_0xa349('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa349('0xc'));var squel=require(_0xa349('0xd'));var crypto=require(_0xa349('0xe'));var jsforce=require(_0xa349('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa349('0xa'));var querystring=require(_0xa349('0x10'));var Papa=require(_0xa349('0x11'));var Redis=require(_0xa349('0x12'));var authService=require(_0xa349('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa349('0x14'));var hardwareService=require(_0xa349('0x15'));var logger=require(_0xa349('0x16'))(_0xa349('0x17'));var utils=require('../../config/utils');var config=require(_0xa349('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa349('0x19'))['db'];function respondWithStatusCode(_0x243897,_0x364f4c){_0x364f4c=_0x364f4c||0xcc;return function(_0x415673){if(_0x415673){return _0x243897[_0xa349('0x1a')](_0x364f4c);}return _0x243897[_0xa349('0x1b')](_0x364f4c)[_0xa349('0x1c')]();};}function respondWithResult(_0x455809,_0x187b25){_0x187b25=_0x187b25||0xc8;return function(_0x370e89){if(_0x370e89){return _0x455809[_0xa349('0x1b')](_0x187b25)[_0xa349('0x1d')](_0x370e89);}};}function respondWithFilteredResult(_0x4a650d,_0x1290a0){return function(_0x578849){if(_0x578849){var _0x4cd8d1=typeof _0x1290a0[_0xa349('0x1e')]===_0xa349('0x1f')&&typeof _0x1290a0[_0xa349('0x20')]===_0xa349('0x1f');var _0x4ab201=_0x578849[_0xa349('0x21')];var _0x11866e=_0x4cd8d1?0x0:_0x1290a0['offset'];var _0x4e3113=_0x4cd8d1?_0x578849[_0xa349('0x21')]:_0x1290a0[_0xa349('0x1e')]+_0x1290a0[_0xa349('0x20')];var _0x45ca3a;if(_0x4e3113>=_0x4ab201){_0x4e3113=_0x4ab201;_0x45ca3a=0xc8;}else{_0x45ca3a=0xce;}_0x4a650d['status'](_0x45ca3a);return _0x4a650d[_0xa349('0x22')](_0xa349('0x23'),_0x11866e+'-'+_0x4e3113+'/'+_0x4ab201)[_0xa349('0x1d')](_0x578849);}return null;};}function patchUpdates(_0x42cd22){return function(_0xfbd77a){try{jsonpatch[_0xa349('0x24')](_0xfbd77a,_0x42cd22,!![]);}catch(_0xe4b60){return BPromise[_0xa349('0x25')](_0xe4b60);}return _0xfbd77a[_0xa349('0x26')]();};}function saveUpdates(_0x12ab80,_0x5cd6a3){return function(_0x207c39){if(_0x207c39){return _0x207c39[_0xa349('0x27')](_0x12ab80)['then'](function(_0x4665a0){return _0x4665a0;});}return null;};}function removeEntity(_0x5456f9,_0xce4a9f){return function(_0x191ff8){if(_0x191ff8){return _0x191ff8['destroy']()['then'](function(){_0x5456f9[_0xa349('0x1b')](0xcc)[_0xa349('0x1c')]();});}};}function handleEntityNotFound(_0x18d42a,_0x3b97dc){return function(_0x43dbd8){if(!_0x43dbd8){_0x18d42a[_0xa349('0x1a')](0x194);}return _0x43dbd8;};}function handleError(_0x229ba3,_0x452b32){_0x452b32=_0x452b32||0x1f4;return function(_0x5954dc){logger[_0xa349('0x28')](_0x5954dc['stack']);if(_0x5954dc['name']){delete _0x5954dc[_0xa349('0x29')];}_0x229ba3[_0xa349('0x1b')](_0x452b32)[_0xa349('0x2a')](_0x5954dc);};}exports[_0xa349('0x2b')]=function(_0x4bc635,_0x44fa31){var _0x40d90c={},_0x71e116={},_0x561c09={'count':0x0,'rows':[]};var _0xc81429=_[_0xa349('0x2c')](db[_0xa349('0x2d')][_0xa349('0x2e')],function(_0x31e0af){return{'name':_0x31e0af[_0xa349('0x2f')],'type':_0x31e0af['type'][_0xa349('0x30')]};});_0x71e116[_0xa349('0x31')]=_[_0xa349('0x2c')](_0xc81429,'name');_0x71e116[_0xa349('0x32')]=_['keys'](_0x4bc635['query']);_0x71e116[_0xa349('0x33')]=_['intersection'](_0x71e116['model'],_0x71e116[_0xa349('0x32')]);_0x40d90c['attributes']=_[_0xa349('0x34')](_0x71e116[_0xa349('0x31')],qs['fields'](_0x4bc635['query'][_0xa349('0x35')]));_0x40d90c[_0xa349('0x36')]=_0x40d90c['attributes'][_0xa349('0x37')]?_0x40d90c[_0xa349('0x36')]:_0x71e116[_0xa349('0x31')];if(!_0x4bc635[_0xa349('0x32')]['hasOwnProperty']('nolimit')){_0x40d90c['limit']=qs['limit'](_0x4bc635[_0xa349('0x32')]['limit']);_0x40d90c['offset']=qs[_0xa349('0x1e')](_0x4bc635[_0xa349('0x32')][_0xa349('0x1e')]);}_0x40d90c[_0xa349('0x38')]=qs[_0xa349('0x39')](_0x4bc635[_0xa349('0x32')][_0xa349('0x39')]);_0x40d90c[_0xa349('0x3a')]=qs['filters'](_[_0xa349('0x3b')](_0x4bc635['query'],_0x71e116[_0xa349('0x33')]),_0xc81429);if(_0x4bc635['query'][_0xa349('0x3c')]){_0x40d90c[_0xa349('0x3a')]=_[_0xa349('0x3d')](_0x40d90c[_0xa349('0x3a')],{'$or':_[_0xa349('0x2c')](_0xc81429,function(_0x443b70){if(_0x443b70[_0xa349('0x3e')]!==_0xa349('0x3f')){var _0x536f3a={};_0x536f3a[_0x443b70[_0xa349('0x29')]]={'$like':'%'+_0x4bc635[_0xa349('0x32')][_0xa349('0x3c')]+'%'};return _0x536f3a;}})});}_0x40d90c=_[_0xa349('0x3d')]({},_0x40d90c,_0x4bc635[_0xa349('0x40')]);var _0x72e014={'where':_0x40d90c[_0xa349('0x3a')]};return db[_0xa349('0x2d')][_0xa349('0x21')](_0x72e014)['then'](function(_0xaa5821){_0x561c09[_0xa349('0x21')]=_0xaa5821;if(_0x4bc635[_0xa349('0x32')]['includeAll']){_0x40d90c[_0xa349('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xa349('0x42')](_0x40d90c);})['then'](function(_0x572a82){_0x561c09[_0xa349('0x43')]=_0x572a82;return _0x561c09;})[_0xa349('0x44')](respondWithFilteredResult(_0x44fa31,_0x40d90c))[_0xa349('0x45')](handleError(_0x44fa31,null));};exports['show']=function(_0x52dfbb,_0x251481){var _0x4a6f23={'raw':!![],'where':{'id':_0x52dfbb['params']['id']}},_0xf0829b={};_0xf0829b[_0xa349('0x31')]=_[_0xa349('0x46')](db['SmsQueueReport'][_0xa349('0x2e')]);_0xf0829b[_0xa349('0x32')]=_[_0xa349('0x46')](_0x52dfbb[_0xa349('0x32')]);_0xf0829b[_0xa349('0x33')]=_[_0xa349('0x34')](_0xf0829b[_0xa349('0x31')],_0xf0829b[_0xa349('0x32')]);_0x4a6f23[_0xa349('0x36')]=_['intersection'](_0xf0829b[_0xa349('0x31')],qs['fields'](_0x52dfbb['query'][_0xa349('0x35')]));_0x4a6f23[_0xa349('0x36')]=_0x4a6f23['attributes'][_0xa349('0x37')]?_0x4a6f23['attributes']:_0xf0829b[_0xa349('0x31')];if(_0x52dfbb[_0xa349('0x32')][_0xa349('0x47')]){_0x4a6f23[_0xa349('0x41')]=[{'all':!![]}];}_0x4a6f23=_[_0xa349('0x3d')]({},_0x4a6f23,_0x52dfbb[_0xa349('0x40')]);return db[_0xa349('0x2d')][_0xa349('0x48')](_0x4a6f23)[_0xa349('0x44')](handleEntityNotFound(_0x251481,null))[_0xa349('0x44')](respondWithResult(_0x251481,null))[_0xa349('0x45')](handleError(_0x251481,null));};exports[_0xa349('0x49')]=function(_0x227ccb,_0x96df50){return db[_0xa349('0x2d')][_0xa349('0x49')](_0x227ccb[_0xa349('0x4a')],{})[_0xa349('0x44')](respondWithResult(_0x96df50,0xc9))['catch'](handleError(_0x96df50,null));};exports['update']=function(_0x5b1fc9,_0xaf8fc6){if(_0x5b1fc9[_0xa349('0x4a')]['id']){delete _0x5b1fc9[_0xa349('0x4a')]['id'];}return db[_0xa349('0x2d')]['find']({'where':{'id':_0x5b1fc9['params']['id']}})[_0xa349('0x44')](handleEntityNotFound(_0xaf8fc6,null))['then'](saveUpdates(_0x5b1fc9['body'],null))['then'](respondWithResult(_0xaf8fc6,null))[_0xa349('0x45')](handleError(_0xaf8fc6,null));};exports[_0xa349('0x4b')]=function(_0x3b3065,_0x551da2){return db[_0xa349('0x2d')]['find']({'where':{'id':_0x3b3065[_0xa349('0x4c')]['id']}})[_0xa349('0x44')](handleEntityNotFound(_0x551da2,null))[_0xa349('0x44')](removeEntity(_0x551da2,null))[_0xa349('0x45')](handleError(_0x551da2,null));};exports[_0xa349('0x4d')]=function(_0x42640b,_0x169652){return db[_0xa349('0x2d')][_0xa349('0x4d')]()['then'](respondWithResult(_0x169652,null))[_0xa349('0x45')](handleError(_0x169652,null));}; \ No newline at end of file +var _0x33ef=['stack','name','send','index','map','SmsQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','fs-extra','lodash','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','limit','count','set','Content-Range','apply','reject','save','update','then','error'];(function(_0x5a26db,_0x2c5ccd){var _0x4619dd=function(_0x21e28f){while(--_0x21e28f){_0x5a26db['push'](_0x5a26db['shift']());}};_0x4619dd(++_0x2c5ccd);}(_0x33ef,0x6f));var _0xf33e=function(_0x10d670,_0x178996){_0x10d670=_0x10d670-0x0;var _0x20d6f8=_0x33ef[_0x10d670];return _0x20d6f8;};'use strict';var emlformat=require(_0xf33e('0x0'));var rimraf=require(_0xf33e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf33e('0x2'));var rp=require('request-promise');var moment=require(_0xf33e('0x3'));var BPromise=require(_0xf33e('0x4'));var Mustache=require(_0xf33e('0x5'));var util=require(_0xf33e('0x6'));var path=require('path');var sox=require(_0xf33e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf33e('0x8'));var _=require(_0xf33e('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf33e('0xa'));var deskjs=require(_0xf33e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf33e('0xc'));var Papa=require(_0xf33e('0xd'));var Redis=require(_0xf33e('0xe'));var authService=require(_0xf33e('0xf'));var qs=require(_0xf33e('0x10'));var as=require(_0xf33e('0x11'));var hardwareService=require(_0xf33e('0x12'));var logger=require(_0xf33e('0x13'))('api');var utils=require(_0xf33e('0x14'));var config=require(_0xf33e('0x15'));var licenseUtil=require(_0xf33e('0x16'));var db=require(_0xf33e('0x17'))['db'];function respondWithStatusCode(_0x167c36,_0x156cfe){_0x156cfe=_0x156cfe||0xcc;return function(_0x151ca9){if(_0x151ca9){return _0x167c36[_0xf33e('0x18')](_0x156cfe);}return _0x167c36[_0xf33e('0x19')](_0x156cfe)[_0xf33e('0x1a')]();};}function respondWithResult(_0x202a8b,_0x22b3f0){_0x22b3f0=_0x22b3f0||0xc8;return function(_0x4d072d){if(_0x4d072d){return _0x202a8b[_0xf33e('0x19')](_0x22b3f0)[_0xf33e('0x1b')](_0x4d072d);}};}function respondWithFilteredResult(_0x249d3e,_0x503d75){return function(_0x179df7){if(_0x179df7){var _0x5896f1=typeof _0x503d75[_0xf33e('0x1c')]==='undefined'&&typeof _0x503d75[_0xf33e('0x1d')]==='undefined';var _0xf94388=_0x179df7[_0xf33e('0x1e')];var _0x476398=_0x5896f1?0x0:_0x503d75[_0xf33e('0x1c')];var _0x37b9da=_0x5896f1?_0x179df7[_0xf33e('0x1e')]:_0x503d75[_0xf33e('0x1c')]+_0x503d75[_0xf33e('0x1d')];var _0x31a28d;if(_0x37b9da>=_0xf94388){_0x37b9da=_0xf94388;_0x31a28d=0xc8;}else{_0x31a28d=0xce;}_0x249d3e[_0xf33e('0x19')](_0x31a28d);return _0x249d3e[_0xf33e('0x1f')](_0xf33e('0x20'),_0x476398+'-'+_0x37b9da+'/'+_0xf94388)['json'](_0x179df7);}return null;};}function patchUpdates(_0x2644f4){return function(_0x4e8469){try{jsonpatch[_0xf33e('0x21')](_0x4e8469,_0x2644f4,!![]);}catch(_0x2291f3){return BPromise[_0xf33e('0x22')](_0x2291f3);}return _0x4e8469[_0xf33e('0x23')]();};}function saveUpdates(_0x31e6b1,_0x2a8c6e){return function(_0x3bd815){if(_0x3bd815){return _0x3bd815[_0xf33e('0x24')](_0x31e6b1)['then'](function(_0x33572e){return _0x33572e;});}return null;};}function removeEntity(_0x21ee7f,_0x249725){return function(_0x5f1696){if(_0x5f1696){return _0x5f1696['destroy']()[_0xf33e('0x25')](function(){_0x21ee7f[_0xf33e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e5319,_0x41e753){return function(_0x28c2af){if(!_0x28c2af){_0x1e5319[_0xf33e('0x18')](0x194);}return _0x28c2af;};}function handleError(_0x3ac53a,_0xb5c96c){_0xb5c96c=_0xb5c96c||0x1f4;return function(_0x3f2adb){logger[_0xf33e('0x26')](_0x3f2adb[_0xf33e('0x27')]);if(_0x3f2adb[_0xf33e('0x28')]){delete _0x3f2adb[_0xf33e('0x28')];}_0x3ac53a[_0xf33e('0x19')](_0xb5c96c)[_0xf33e('0x29')](_0x3f2adb);};}exports[_0xf33e('0x2a')]=function(_0x3b821a,_0x2f898d){var _0xc9304a={},_0x32e530={},_0xb7b7b5={'count':0x0,'rows':[]};var _0x2515bb=_[_0xf33e('0x2b')](db[_0xf33e('0x2c')][_0xf33e('0x2d')],function(_0x20175b){return{'name':_0x20175b['fieldName'],'type':_0x20175b[_0xf33e('0x2e')][_0xf33e('0x2f')]};});_0x32e530[_0xf33e('0x30')]=_[_0xf33e('0x2b')](_0x2515bb,_0xf33e('0x28'));_0x32e530[_0xf33e('0x31')]=_[_0xf33e('0x32')](_0x3b821a[_0xf33e('0x31')]);_0x32e530[_0xf33e('0x33')]=_[_0xf33e('0x34')](_0x32e530[_0xf33e('0x30')],_0x32e530[_0xf33e('0x31')]);_0xc9304a['attributes']=_[_0xf33e('0x34')](_0x32e530[_0xf33e('0x30')],qs[_0xf33e('0x35')](_0x3b821a['query'][_0xf33e('0x35')]));_0xc9304a['attributes']=_0xc9304a[_0xf33e('0x36')][_0xf33e('0x37')]?_0xc9304a[_0xf33e('0x36')]:_0x32e530[_0xf33e('0x30')];if(!_0x3b821a[_0xf33e('0x31')]['hasOwnProperty'](_0xf33e('0x38'))){_0xc9304a['limit']=qs[_0xf33e('0x1d')](_0x3b821a[_0xf33e('0x31')][_0xf33e('0x1d')]);_0xc9304a[_0xf33e('0x1c')]=qs[_0xf33e('0x1c')](_0x3b821a[_0xf33e('0x31')][_0xf33e('0x1c')]);}_0xc9304a['order']=qs[_0xf33e('0x39')](_0x3b821a[_0xf33e('0x31')][_0xf33e('0x39')]);_0xc9304a[_0xf33e('0x3a')]=qs['filters'](_['pick'](_0x3b821a['query'],_0x32e530[_0xf33e('0x33')]),_0x2515bb);if(_0x3b821a[_0xf33e('0x31')][_0xf33e('0x3b')]){_0xc9304a[_0xf33e('0x3a')]=_['merge'](_0xc9304a[_0xf33e('0x3a')],{'$or':_[_0xf33e('0x2b')](_0x2515bb,function(_0x4a0817){if(_0x4a0817[_0xf33e('0x2e')]!==_0xf33e('0x3c')){var _0x5215fb={};_0x5215fb[_0x4a0817[_0xf33e('0x28')]]={'$like':'%'+_0x3b821a[_0xf33e('0x31')][_0xf33e('0x3b')]+'%'};return _0x5215fb;}})});}_0xc9304a=_[_0xf33e('0x3d')]({},_0xc9304a,_0x3b821a[_0xf33e('0x3e')]);var _0x5198aa={'where':_0xc9304a[_0xf33e('0x3a')]};return db[_0xf33e('0x2c')][_0xf33e('0x1e')](_0x5198aa)[_0xf33e('0x25')](function(_0xb6aa6a){_0xb7b7b5['count']=_0xb6aa6a;if(_0x3b821a[_0xf33e('0x31')][_0xf33e('0x3f')]){_0xc9304a['include']=[{'all':!![]}];}return db[_0xf33e('0x2c')][_0xf33e('0x40')](_0xc9304a);})[_0xf33e('0x25')](function(_0x1931cd){_0xb7b7b5[_0xf33e('0x41')]=_0x1931cd;return _0xb7b7b5;})['then'](respondWithFilteredResult(_0x2f898d,_0xc9304a))['catch'](handleError(_0x2f898d,null));};exports[_0xf33e('0x42')]=function(_0x483ed2,_0x17d54f){var _0x6839ff={'raw':!![],'where':{'id':_0x483ed2[_0xf33e('0x43')]['id']}},_0x448c8a={};_0x448c8a[_0xf33e('0x30')]=_['keys'](db[_0xf33e('0x2c')][_0xf33e('0x2d')]);_0x448c8a[_0xf33e('0x31')]=_[_0xf33e('0x32')](_0x483ed2[_0xf33e('0x31')]);_0x448c8a[_0xf33e('0x33')]=_[_0xf33e('0x34')](_0x448c8a[_0xf33e('0x30')],_0x448c8a[_0xf33e('0x31')]);_0x6839ff['attributes']=_['intersection'](_0x448c8a[_0xf33e('0x30')],qs[_0xf33e('0x35')](_0x483ed2[_0xf33e('0x31')]['fields']));_0x6839ff[_0xf33e('0x36')]=_0x6839ff['attributes'][_0xf33e('0x37')]?_0x6839ff[_0xf33e('0x36')]:_0x448c8a[_0xf33e('0x30')];if(_0x483ed2[_0xf33e('0x31')][_0xf33e('0x3f')]){_0x6839ff[_0xf33e('0x44')]=[{'all':!![]}];}_0x6839ff=_['merge']({},_0x6839ff,_0x483ed2[_0xf33e('0x3e')]);return db[_0xf33e('0x2c')][_0xf33e('0x45')](_0x6839ff)['then'](handleEntityNotFound(_0x17d54f,null))[_0xf33e('0x25')](respondWithResult(_0x17d54f,null))[_0xf33e('0x46')](handleError(_0x17d54f,null));};exports[_0xf33e('0x47')]=function(_0x4f72ee,_0x4b87d4){return db[_0xf33e('0x2c')][_0xf33e('0x47')](_0x4f72ee[_0xf33e('0x48')],{})[_0xf33e('0x25')](respondWithResult(_0x4b87d4,0xc9))[_0xf33e('0x46')](handleError(_0x4b87d4,null));};exports[_0xf33e('0x24')]=function(_0x4ed8ad,_0x1c7886){if(_0x4ed8ad[_0xf33e('0x48')]['id']){delete _0x4ed8ad[_0xf33e('0x48')]['id'];}return db[_0xf33e('0x2c')][_0xf33e('0x45')]({'where':{'id':_0x4ed8ad[_0xf33e('0x43')]['id']}})[_0xf33e('0x25')](handleEntityNotFound(_0x1c7886,null))['then'](saveUpdates(_0x4ed8ad['body'],null))[_0xf33e('0x25')](respondWithResult(_0x1c7886,null))['catch'](handleError(_0x1c7886,null));};exports[_0xf33e('0x49')]=function(_0x3fe82b,_0x1eee20){return db[_0xf33e('0x2c')][_0xf33e('0x45')]({'where':{'id':_0x3fe82b[_0xf33e('0x43')]['id']}})['then'](handleEntityNotFound(_0x1eee20,null))['then'](removeEntity(_0x1eee20,null))['catch'](handleError(_0x1eee20,null));};exports[_0xf33e('0x4a')]=function(_0x31e97d,_0x277074){return db[_0xf33e('0x2c')][_0xf33e('0x4a')]()[_0xf33e('0x25')](respondWithResult(_0x277074,null))[_0xf33e('0x46')](handleError(_0x277074,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 9af7814..d357404 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(_0x219616,_0xeafce){var _0xb5e9cd=function(_0xd4faf8){while(--_0xd4faf8){_0x219616['push'](_0x219616['shift']());}};_0xb5e9cd(++_0xeafce);}(_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(_0x1f7a00,_0x341591){var _0x4b151c=function(_0x51fceb){while(--_0x51fceb){_0x1f7a00['push'](_0x1f7a00['shift']());}};_0x4b151c(++_0x341591);}(_0xb7e7,0x121));var _0x7b7e=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xb7e7[_0x710815];return _0x5b3b89;};'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 4d5e499..0782191 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 _0x904a=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','UpdateSmsQueueReport','update','raw','attributes','limit'];(function(_0x398e49,_0x212b68){var _0x49c8a1=function(_0x1fa289){while(--_0x1fa289){_0x398e49['push'](_0x398e49['shift']());}};_0x49c8a1(++_0x212b68);}(_0x904a,0xa5));var _0xa904=function(_0x118612,_0xd90a43){_0x118612=_0x118612-0x0;var _0x480036=_0x904a[_0x118612];return _0x480036;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa904('0x0'));var BPromise=require(_0xa904('0x1'));var rs=require(_0xa904('0x2'));var fs=require('fs');var Redis=require(_0xa904('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa904('0x4'))(_0xa904('0x5'));var config=require(_0xa904('0x6'));var jayson=require(_0xa904('0x7'));var client=jayson[_0xa904('0x8')][_0xa904('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50e230,_0x17928f,_0x886921){return new BPromise(function(_0x573674,_0x2562c6){return client[_0xa904('0xa')](_0x50e230,_0x886921)[_0xa904('0xb')](function(_0x5a8e65){logger[_0xa904('0xc')](_0xa904('0xd'),_0x17928f,'request\x20sent');logger[_0xa904('0xe')](_0xa904('0xf'),_0x17928f,_0xa904('0x10'),JSON[_0xa904('0x11')](_0x5a8e65));if(_0x5a8e65[_0xa904('0x12')]){if(_0x5a8e65[_0xa904('0x12')][_0xa904('0x13')]===0x1f4){logger[_0xa904('0x12')](_0xa904('0xd'),_0x17928f,_0x5a8e65[_0xa904('0x12')][_0xa904('0x14')]);return _0x2562c6(_0x5a8e65[_0xa904('0x12')][_0xa904('0x14')]);}logger[_0xa904('0x12')](_0xa904('0xd'),_0x17928f,_0x5a8e65[_0xa904('0x12')]['message']);return _0x573674(_0x5a8e65[_0xa904('0x12')][_0xa904('0x14')]);}else{logger[_0xa904('0xc')](_0xa904('0xd'),_0x17928f,_0xa904('0x10'));_0x573674(_0x5a8e65[_0xa904('0x15')][_0xa904('0x14')]);}})[_0xa904('0x16')](function(_0x37a3fd){logger[_0xa904('0x12')](_0xa904('0xd'),_0x17928f,_0x37a3fd);_0x2562c6(_0x37a3fd);});});}exports[_0xa904('0x17')]=function(_0x2dd5dd){var _0x13d9ee=this;return new Promise(function(_0x2ee3a1,_0x42658e){return db[_0xa904('0x18')][_0xa904('0x19')](_0x2dd5dd[_0xa904('0x1a')],{'raw':_0x2dd5dd[_0xa904('0x1b')]?_0x2dd5dd['options']['raw']===undefined?!![]:![]:!![]})[_0xa904('0xb')](function(_0x230c2c){logger['info'](_0xa904('0x17'),_0x2dd5dd);logger[_0xa904('0xe')]('CreateSmsQueueReport',_0x2dd5dd,JSON[_0xa904('0x11')](_0x230c2c));_0x2ee3a1(_0x230c2c);})[_0xa904('0x16')](function(_0x3f1b45){logger[_0xa904('0x12')](_0xa904('0x17'),_0x3f1b45[_0xa904('0x14')],_0x2dd5dd);_0x42658e(_0x13d9ee[_0xa904('0x12')](0x1f4,_0x3f1b45[_0xa904('0x14')]));});});};exports[_0xa904('0x1c')]=function(_0x45cd12){var _0x4929aa=this;return new Promise(function(_0x519045,_0x4b6f58){return db[_0xa904('0x18')][_0xa904('0x1d')](_0x45cd12[_0xa904('0x1a')],{'raw':_0x45cd12[_0xa904('0x1b')]?_0x45cd12[_0xa904('0x1b')][_0xa904('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45cd12['options']?_0x45cd12[_0xa904('0x1b')]['where']||null:null,'attributes':_0x45cd12['options']?_0x45cd12['options'][_0xa904('0x1f')]||null:null,'limit':_0x45cd12[_0xa904('0x1b')]?_0x45cd12['options'][_0xa904('0x20')]||null:null})['then'](function(_0x1a5556){logger[_0xa904('0xc')](_0xa904('0x1c'),_0x45cd12);logger['debug'](_0xa904('0x1c'),_0x45cd12,JSON[_0xa904('0x11')](_0x1a5556));_0x519045(_0x1a5556);})[_0xa904('0x16')](function(_0x150391){logger[_0xa904('0x12')](_0xa904('0x1c'),_0x150391[_0xa904('0x14')],_0x45cd12);_0x4b6f58(_0x4929aa[_0xa904('0x12')](0x1f4,_0x150391[_0xa904('0x14')]));});});}; \ No newline at end of file +var _0x7d32=['info','result','catch','CreateSmsQueueReport','create','options','raw','UpdateSmsQueueReport','SmsQueueReport','update','body','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x4a209a,_0x575ff9){var _0x4b3c20=function(_0x1a50c1){while(--_0x1a50c1){_0x4a209a['push'](_0x4a209a['shift']());}};_0x4b3c20(++_0x575ff9);}(_0x7d32,0x16b));var _0x27d3=function(_0x3afd56,_0x6c11b7){_0x3afd56=_0x3afd56-0x0;var _0x29975d=_0x7d32[_0x3afd56];return _0x29975d;};'use strict';var _=require(_0x27d3('0x0'));var util=require(_0x27d3('0x1'));var moment=require(_0x27d3('0x2'));var BPromise=require(_0x27d3('0x3'));var rs=require(_0x27d3('0x4'));var fs=require('fs');var Redis=require(_0x27d3('0x5'));var db=require(_0x27d3('0x6'))['db'];var utils=require(_0x27d3('0x7'));var logger=require(_0x27d3('0x8'))(_0x27d3('0x9'));var config=require(_0x27d3('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x27d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c1ff8,_0x19225d,_0x43427b){return new BPromise(function(_0x4b3e46,_0x41144a){return client[_0x27d3('0xc')](_0x2c1ff8,_0x43427b)[_0x27d3('0xd')](function(_0x2369d4){logger['info'](_0x27d3('0xe'),_0x19225d,_0x27d3('0xf'));logger[_0x27d3('0x10')](_0x27d3('0x11'),_0x19225d,'request\x20sent',JSON[_0x27d3('0x12')](_0x2369d4));if(_0x2369d4['error']){if(_0x2369d4['error'][_0x27d3('0x13')]===0x1f4){logger['error'](_0x27d3('0xe'),_0x19225d,_0x2369d4[_0x27d3('0x14')][_0x27d3('0x15')]);return _0x41144a(_0x2369d4['error'][_0x27d3('0x15')]);}logger[_0x27d3('0x14')](_0x27d3('0xe'),_0x19225d,_0x2369d4[_0x27d3('0x14')][_0x27d3('0x15')]);return _0x4b3e46(_0x2369d4[_0x27d3('0x14')]['message']);}else{logger[_0x27d3('0x16')]('SmsQueueReport,\x20%s,\x20%s',_0x19225d,_0x27d3('0xf'));_0x4b3e46(_0x2369d4[_0x27d3('0x17')]['message']);}})[_0x27d3('0x18')](function(_0x114201){logger[_0x27d3('0x14')](_0x27d3('0xe'),_0x19225d,_0x114201);_0x41144a(_0x114201);});});}exports[_0x27d3('0x19')]=function(_0xae082b){var _0x207620=this;return new Promise(function(_0x3356f3,_0x4b6edc){return db['SmsQueueReport'][_0x27d3('0x1a')](_0xae082b['body'],{'raw':_0xae082b[_0x27d3('0x1b')]?_0xae082b[_0x27d3('0x1b')][_0x27d3('0x1c')]===undefined?!![]:![]:!![]})[_0x27d3('0xd')](function(_0x2bbc54){logger[_0x27d3('0x16')]('CreateSmsQueueReport',_0xae082b);logger['debug'](_0x27d3('0x19'),_0xae082b,JSON['stringify'](_0x2bbc54));_0x3356f3(_0x2bbc54);})[_0x27d3('0x18')](function(_0x42f012){logger[_0x27d3('0x14')](_0x27d3('0x19'),_0x42f012[_0x27d3('0x15')],_0xae082b);_0x4b6edc(_0x207620['error'](0x1f4,_0x42f012['message']));});});};exports[_0x27d3('0x1d')]=function(_0x5bcd63){var _0x5d4aee=this;return new Promise(function(_0x77937f,_0x3f26e9){return db[_0x27d3('0x1e')][_0x27d3('0x1f')](_0x5bcd63[_0x27d3('0x20')],{'raw':_0x5bcd63[_0x27d3('0x1b')]?_0x5bcd63['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bcd63[_0x27d3('0x1b')]?_0x5bcd63[_0x27d3('0x1b')][_0x27d3('0x21')]||null:null,'attributes':_0x5bcd63[_0x27d3('0x1b')]?_0x5bcd63[_0x27d3('0x1b')]['attributes']||null:null,'limit':_0x5bcd63[_0x27d3('0x1b')]?_0x5bcd63[_0x27d3('0x1b')][_0x27d3('0x22')]||null:null})[_0x27d3('0xd')](function(_0x35d698){logger['info']('UpdateSmsQueueReport',_0x5bcd63);logger[_0x27d3('0x10')]('UpdateSmsQueueReport',_0x5bcd63,JSON[_0x27d3('0x12')](_0x35d698));_0x77937f(_0x35d698);})[_0x27d3('0x18')](function(_0x316fce){logger['error'](_0x27d3('0x1d'),_0x316fce['message'],_0x5bcd63);_0x3f26e9(_0x5d4aee['error'](0x1f4,_0x316fce[_0x27d3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 3f6c778..5d83075 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 _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x30760e,_0x15f57c){var _0x273cf7=function(_0x3cb1d7){while(--_0x3cb1d7){_0x30760e['push'](_0x30760e['shift']());}};_0x273cf7(++_0x15f57c);}(_0xabce,0x103));var _0xeabc=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xabce[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file +var _0x0309=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','index','get','isAuthenticated','/:id','post','create','update','delete','destroy','multer','path','express'];(function(_0x1c470d,_0x81d66b){var _0x12141b=function(_0x45bfd3){while(--_0x45bfd3){_0x1c470d['push'](_0x1c470d['shift']());}};_0x12141b(++_0x81d66b);}(_0x0309,0x165));var _0x9030=function(_0x2cca84,_0x88eb86){_0x2cca84=_0x2cca84-0x0;var _0x98aadd=_0x0309[_0x2cca84];return _0x98aadd;};'use strict';var multer=require(_0x9030('0x0'));var util=require('util');var path=require(_0x9030('0x1'));var timeout=require('connect-timeout');var express=require(_0x9030('0x2'));var router=express[_0x9030('0x3')]();var fs_extra=require(_0x9030('0x4'));var auth=require(_0x9030('0x5'));var interaction=require(_0x9030('0x6'));var config=require(_0x9030('0x7'));var controller=require(_0x9030('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9030('0x9')]);router[_0x9030('0xa')]('/describe',auth[_0x9030('0xb')](),controller['describe']);router[_0x9030('0xa')](_0x9030('0xc'),auth[_0x9030('0xb')](),controller['show']);router[_0x9030('0xd')]('/',auth[_0x9030('0xb')](),controller[_0x9030('0xe')]);router['put'](_0x9030('0xc'),auth[_0x9030('0xb')](),controller[_0x9030('0xf')]);router[_0x9030('0x10')](_0x9030('0xc'),auth[_0x9030('0xb')](),controller[_0x9030('0x11')]);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 ec2c08a..7183d69 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2a6d45,_0x3c9321){var _0x295253=function(_0x51d622){while(--_0x51d622){_0x2a6d45['push'](_0x2a6d45['shift']());}};_0x295253(++_0x3c9321);}(_0x34e8,0x12c));var _0x834e=function(_0x56c3f3,_0x8e373a){_0x56c3f3=_0x56c3f3-0x0;var _0x4db44e=_0x34e8[_0x56c3f3];return _0x4db44e;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x9bf476,_0x187a7b){var _0x50b208=function(_0x1a50da){while(--_0x1a50da){_0x9bf476['push'](_0x9bf476['shift']());}};_0x50b208(++_0x187a7b);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x00bb[_0x2d7f0e];return _0x110b07;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 0439833..340842a 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 _0xd610=['limit','count','set','Content-Range','apply','reject','update','then','error','stack','send','index','rawAttributes','key','model','map','name','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','SmsTransferReport','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x50fda9,_0x5ee44b){var _0x36b92b=function(_0x121877){while(--_0x121877){_0x50fda9['push'](_0x50fda9['shift']());}};_0x36b92b(++_0x5ee44b);}(_0xd610,0x147));var _0x0d61=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xd610[_0x1f9f37];return _0x21c080;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0d61('0x0'));var zipdir=require(_0x0d61('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0d61('0x2'));var moment=require(_0x0d61('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0d61('0x4'));var util=require(_0x0d61('0x5'));var path=require(_0x0d61('0x6'));var sox=require(_0x0d61('0x7'));var csv=require(_0x0d61('0x8'));var ejs=require(_0x0d61('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0d61('0xa'));var crypto=require(_0x0d61('0xb'));var jsforce=require(_0x0d61('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0d61('0x8'));var querystring=require(_0x0d61('0xd'));var Papa=require(_0x0d61('0xe'));var Redis=require(_0x0d61('0xf'));var authService=require(_0x0d61('0x10'));var qs=require(_0x0d61('0x11'));var as=require(_0x0d61('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d61('0x13'))(_0x0d61('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0d61('0x15'))['db'];function respondWithStatusCode(_0x474ca5,_0x42596e){_0x42596e=_0x42596e||0xcc;return function(_0x5dce8b){if(_0x5dce8b){return _0x474ca5[_0x0d61('0x16')](_0x42596e);}return _0x474ca5[_0x0d61('0x17')](_0x42596e)[_0x0d61('0x18')]();};}function respondWithResult(_0x3a3173,_0x5ad57c){_0x5ad57c=_0x5ad57c||0xc8;return function(_0x3a8ba2){if(_0x3a8ba2){return _0x3a3173['status'](_0x5ad57c)[_0x0d61('0x19')](_0x3a8ba2);}};}function respondWithFilteredResult(_0x212dc0,_0x3995e6){return function(_0x247503){if(_0x247503){var _0x328e36=typeof _0x3995e6[_0x0d61('0x1a')]===_0x0d61('0x1b')&&typeof _0x3995e6[_0x0d61('0x1c')]==='undefined';var _0x2e5216=_0x247503[_0x0d61('0x1d')];var _0xf15d3d=_0x328e36?0x0:_0x3995e6['offset'];var _0x4ae244=_0x328e36?_0x247503[_0x0d61('0x1d')]:_0x3995e6[_0x0d61('0x1a')]+_0x3995e6[_0x0d61('0x1c')];var _0x5cf55d;if(_0x4ae244>=_0x2e5216){_0x4ae244=_0x2e5216;_0x5cf55d=0xc8;}else{_0x5cf55d=0xce;}_0x212dc0[_0x0d61('0x17')](_0x5cf55d);return _0x212dc0[_0x0d61('0x1e')](_0x0d61('0x1f'),_0xf15d3d+'-'+_0x4ae244+'/'+_0x2e5216)[_0x0d61('0x19')](_0x247503);}return null;};}function patchUpdates(_0x3dc742){return function(_0x2acd1e){try{jsonpatch[_0x0d61('0x20')](_0x2acd1e,_0x3dc742,!![]);}catch(_0x1dc268){return BPromise[_0x0d61('0x21')](_0x1dc268);}return _0x2acd1e['save']();};}function saveUpdates(_0x2fea9a,_0x48bffe){return function(_0x22b14a){if(_0x22b14a){return _0x22b14a[_0x0d61('0x22')](_0x2fea9a)[_0x0d61('0x23')](function(_0x471e49){return _0x471e49;});}return null;};}function removeEntity(_0xf0fc21,_0x510ebc){return function(_0x2f74db){if(_0x2f74db){return _0x2f74db['destroy']()[_0x0d61('0x23')](function(){_0xf0fc21[_0x0d61('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19472f,_0x305bf6){return function(_0x231f46){if(!_0x231f46){_0x19472f['sendStatus'](0x194);}return _0x231f46;};}function handleError(_0x4746d6,_0x6a0e35){_0x6a0e35=_0x6a0e35||0x1f4;return function(_0x4e1cc0){logger[_0x0d61('0x24')](_0x4e1cc0[_0x0d61('0x25')]);if(_0x4e1cc0['name']){delete _0x4e1cc0['name'];}_0x4746d6[_0x0d61('0x17')](_0x6a0e35)[_0x0d61('0x26')](_0x4e1cc0);};}exports[_0x0d61('0x27')]=function(_0x880389,_0x2f657f){var _0x499777={},_0x306d20={},_0x114d29={'count':0x0,'rows':[]};var _0x2d1491=_['map'](db['SmsTransferReport'][_0x0d61('0x28')],function(_0x5b2116){return{'name':_0x5b2116['fieldName'],'type':_0x5b2116['type'][_0x0d61('0x29')]};});_0x306d20[_0x0d61('0x2a')]=_[_0x0d61('0x2b')](_0x2d1491,_0x0d61('0x2c'));_0x306d20['query']=_[_0x0d61('0x2d')](_0x880389['query']);_0x306d20[_0x0d61('0x2e')]=_[_0x0d61('0x2f')](_0x306d20[_0x0d61('0x2a')],_0x306d20[_0x0d61('0x30')]);_0x499777[_0x0d61('0x31')]=_[_0x0d61('0x2f')](_0x306d20[_0x0d61('0x2a')],qs[_0x0d61('0x32')](_0x880389['query'][_0x0d61('0x32')]));_0x499777[_0x0d61('0x31')]=_0x499777[_0x0d61('0x31')][_0x0d61('0x33')]?_0x499777[_0x0d61('0x31')]:_0x306d20[_0x0d61('0x2a')];if(!_0x880389[_0x0d61('0x30')][_0x0d61('0x34')]('nolimit')){_0x499777[_0x0d61('0x1c')]=qs['limit'](_0x880389[_0x0d61('0x30')][_0x0d61('0x1c')]);_0x499777[_0x0d61('0x1a')]=qs[_0x0d61('0x1a')](_0x880389['query']['offset']);}_0x499777['order']=qs[_0x0d61('0x35')](_0x880389[_0x0d61('0x30')]['sort']);_0x499777[_0x0d61('0x36')]=qs['filters'](_['pick'](_0x880389['query'],_0x306d20[_0x0d61('0x2e')]),_0x2d1491);if(_0x880389[_0x0d61('0x30')]['filter']){_0x499777[_0x0d61('0x36')]=_[_0x0d61('0x37')](_0x499777['where'],{'$or':_[_0x0d61('0x2b')](_0x2d1491,function(_0x4f82e2){if(_0x4f82e2['type']!==_0x0d61('0x38')){var _0x3c93a1={};_0x3c93a1[_0x4f82e2[_0x0d61('0x2c')]]={'$like':'%'+_0x880389[_0x0d61('0x30')][_0x0d61('0x39')]+'%'};return _0x3c93a1;}})});}_0x499777=_[_0x0d61('0x37')]({},_0x499777,_0x880389['options']);var _0x22ae9a={'where':_0x499777[_0x0d61('0x36')]};return db[_0x0d61('0x3a')]['count'](_0x22ae9a)['then'](function(_0x319d29){_0x114d29[_0x0d61('0x1d')]=_0x319d29;if(_0x880389[_0x0d61('0x30')][_0x0d61('0x3b')]){_0x499777[_0x0d61('0x3c')]=[{'all':!![]}];}return db[_0x0d61('0x3a')][_0x0d61('0x3d')](_0x499777);})[_0x0d61('0x23')](function(_0x4dd407){_0x114d29[_0x0d61('0x3e')]=_0x4dd407;return _0x114d29;})[_0x0d61('0x23')](respondWithFilteredResult(_0x2f657f,_0x499777))[_0x0d61('0x3f')](handleError(_0x2f657f,null));};exports[_0x0d61('0x40')]=function(_0x42c9d0,_0x4fdfb1){var _0x8e593e={'raw':!![],'where':{'id':_0x42c9d0[_0x0d61('0x41')]['id']}},_0x3438f7={};_0x3438f7[_0x0d61('0x2a')]=_[_0x0d61('0x2d')](db[_0x0d61('0x3a')]['rawAttributes']);_0x3438f7['query']=_['keys'](_0x42c9d0['query']);_0x3438f7[_0x0d61('0x2e')]=_[_0x0d61('0x2f')](_0x3438f7[_0x0d61('0x2a')],_0x3438f7[_0x0d61('0x30')]);_0x8e593e['attributes']=_[_0x0d61('0x2f')](_0x3438f7[_0x0d61('0x2a')],qs[_0x0d61('0x32')](_0x42c9d0['query'][_0x0d61('0x32')]));_0x8e593e[_0x0d61('0x31')]=_0x8e593e[_0x0d61('0x31')]['length']?_0x8e593e[_0x0d61('0x31')]:_0x3438f7['model'];if(_0x42c9d0[_0x0d61('0x30')][_0x0d61('0x3b')]){_0x8e593e['include']=[{'all':!![]}];}_0x8e593e=_[_0x0d61('0x37')]({},_0x8e593e,_0x42c9d0[_0x0d61('0x42')]);return db[_0x0d61('0x3a')]['find'](_0x8e593e)[_0x0d61('0x23')](handleEntityNotFound(_0x4fdfb1,null))['then'](respondWithResult(_0x4fdfb1,null))[_0x0d61('0x3f')](handleError(_0x4fdfb1,null));};exports['create']=function(_0x5097a2,_0x52a821){return db[_0x0d61('0x3a')][_0x0d61('0x43')](_0x5097a2[_0x0d61('0x44')],{})['then'](respondWithResult(_0x52a821,0xc9))[_0x0d61('0x3f')](handleError(_0x52a821,null));};exports[_0x0d61('0x22')]=function(_0x84b3c6,_0x1a072f){if(_0x84b3c6[_0x0d61('0x44')]['id']){delete _0x84b3c6[_0x0d61('0x44')]['id'];}return db[_0x0d61('0x3a')]['find']({'where':{'id':_0x84b3c6['params']['id']}})['then'](handleEntityNotFound(_0x1a072f,null))['then'](saveUpdates(_0x84b3c6['body'],null))[_0x0d61('0x23')](respondWithResult(_0x1a072f,null))[_0x0d61('0x3f')](handleError(_0x1a072f,null));};exports['destroy']=function(_0x395678,_0x2db49f){return db[_0x0d61('0x3a')][_0x0d61('0x45')]({'where':{'id':_0x395678[_0x0d61('0x41')]['id']}})[_0x0d61('0x23')](handleEntityNotFound(_0x2db49f,null))[_0x0d61('0x23')](removeEntity(_0x2db49f,null))[_0x0d61('0x3f')](handleError(_0x2db49f,null));};exports['describe']=function(_0x3821ad,_0x1d468b){return db[_0x0d61('0x3a')][_0x0d61('0x46')]()['then'](respondWithResult(_0x1d468b,null))[_0x0d61('0x3f')](handleError(_0x1d468b,null));}; \ No newline at end of file +var _0x4e57=['request-promise','moment','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','set','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x4e57,0x182));var _0x74e5=function(_0x5ca5a7,_0xa4a48f){_0x5ca5a7=_0x5ca5a7-0x0;var _0x4e6b99=_0x4e57[_0x5ca5a7];return _0x4e6b99;};'use strict';var emlformat=require(_0x74e5('0x0'));var rimraf=require(_0x74e5('0x1'));var zipdir=require(_0x74e5('0x2'));var jsonpatch=require(_0x74e5('0x3'));var rp=require(_0x74e5('0x4'));var moment=require(_0x74e5('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x74e5('0x6'));var path=require('path');var sox=require(_0x74e5('0x7'));var csv=require(_0x74e5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x74e5('0x9'));var _=require('lodash');var squel=require(_0x74e5('0xa'));var crypto=require(_0x74e5('0xb'));var jsforce=require(_0x74e5('0xc'));var deskjs=require(_0x74e5('0xd'));var toCsv=require(_0x74e5('0x8'));var querystring=require(_0x74e5('0xe'));var Papa=require(_0x74e5('0xf'));var Redis=require(_0x74e5('0x10'));var authService=require(_0x74e5('0x11'));var qs=require(_0x74e5('0x12'));var as=require(_0x74e5('0x13'));var hardwareService=require(_0x74e5('0x14'));var logger=require('../../config/logger')(_0x74e5('0x15'));var utils=require(_0x74e5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x74e5('0x17'));var db=require(_0x74e5('0x18'))['db'];function respondWithStatusCode(_0x3e4bf6,_0x482922){_0x482922=_0x482922||0xcc;return function(_0x502241){if(_0x502241){return _0x3e4bf6['sendStatus'](_0x482922);}return _0x3e4bf6[_0x74e5('0x19')](_0x482922)[_0x74e5('0x1a')]();};}function respondWithResult(_0x3084e0,_0x190f80){_0x190f80=_0x190f80||0xc8;return function(_0x2370e0){if(_0x2370e0){return _0x3084e0[_0x74e5('0x19')](_0x190f80)[_0x74e5('0x1b')](_0x2370e0);}};}function respondWithFilteredResult(_0x77a152,_0x31ed72){return function(_0x50de3c){if(_0x50de3c){var _0x64d648=typeof _0x31ed72['offset']===_0x74e5('0x1c')&&typeof _0x31ed72['limit']===_0x74e5('0x1c');var _0x20a51b=_0x50de3c['count'];var _0x5a1739=_0x64d648?0x0:_0x31ed72[_0x74e5('0x1d')];var _0x1435c0=_0x64d648?_0x50de3c[_0x74e5('0x1e')]:_0x31ed72['offset']+_0x31ed72['limit'];var _0x976a9b;if(_0x1435c0>=_0x20a51b){_0x1435c0=_0x20a51b;_0x976a9b=0xc8;}else{_0x976a9b=0xce;}_0x77a152[_0x74e5('0x19')](_0x976a9b);return _0x77a152[_0x74e5('0x1f')]('Content-Range',_0x5a1739+'-'+_0x1435c0+'/'+_0x20a51b)[_0x74e5('0x1b')](_0x50de3c);}return null;};}function patchUpdates(_0x4ffb0a){return function(_0x4d1747){try{jsonpatch[_0x74e5('0x20')](_0x4d1747,_0x4ffb0a,!![]);}catch(_0x571d5a){return BPromise[_0x74e5('0x21')](_0x571d5a);}return _0x4d1747['save']();};}function saveUpdates(_0x39fb87,_0x270810){return function(_0x18f070){if(_0x18f070){return _0x18f070['update'](_0x39fb87)[_0x74e5('0x22')](function(_0x53e25d){return _0x53e25d;});}return null;};}function removeEntity(_0x583b9a,_0x3bc634){return function(_0x1937c3){if(_0x1937c3){return _0x1937c3[_0x74e5('0x23')]()['then'](function(){_0x583b9a[_0x74e5('0x19')](0xcc)[_0x74e5('0x1a')]();});}};}function handleEntityNotFound(_0x31636a,_0x1366c2){return function(_0x4a2ad9){if(!_0x4a2ad9){_0x31636a[_0x74e5('0x24')](0x194);}return _0x4a2ad9;};}function handleError(_0x25c6c1,_0x5965cf){_0x5965cf=_0x5965cf||0x1f4;return function(_0xe71c4f){logger[_0x74e5('0x25')](_0xe71c4f[_0x74e5('0x26')]);if(_0xe71c4f[_0x74e5('0x27')]){delete _0xe71c4f[_0x74e5('0x27')];}_0x25c6c1[_0x74e5('0x19')](_0x5965cf)[_0x74e5('0x28')](_0xe71c4f);};}exports[_0x74e5('0x29')]=function(_0x3d32ec,_0x16621e){var _0x6cd953={},_0x545eb1={},_0x2ee497={'count':0x0,'rows':[]};var _0x23562e=_[_0x74e5('0x2a')](db[_0x74e5('0x2b')][_0x74e5('0x2c')],function(_0x4ce487){return{'name':_0x4ce487[_0x74e5('0x2d')],'type':_0x4ce487[_0x74e5('0x2e')][_0x74e5('0x2f')]};});_0x545eb1[_0x74e5('0x30')]=_[_0x74e5('0x2a')](_0x23562e,_0x74e5('0x27'));_0x545eb1[_0x74e5('0x31')]=_[_0x74e5('0x32')](_0x3d32ec['query']);_0x545eb1['filters']=_[_0x74e5('0x33')](_0x545eb1[_0x74e5('0x30')],_0x545eb1['query']);_0x6cd953['attributes']=_[_0x74e5('0x33')](_0x545eb1[_0x74e5('0x30')],qs['fields'](_0x3d32ec[_0x74e5('0x31')][_0x74e5('0x34')]));_0x6cd953[_0x74e5('0x35')]=_0x6cd953['attributes'][_0x74e5('0x36')]?_0x6cd953[_0x74e5('0x35')]:_0x545eb1[_0x74e5('0x30')];if(!_0x3d32ec[_0x74e5('0x31')][_0x74e5('0x37')](_0x74e5('0x38'))){_0x6cd953[_0x74e5('0x39')]=qs[_0x74e5('0x39')](_0x3d32ec[_0x74e5('0x31')]['limit']);_0x6cd953[_0x74e5('0x1d')]=qs[_0x74e5('0x1d')](_0x3d32ec[_0x74e5('0x31')]['offset']);}_0x6cd953[_0x74e5('0x3a')]=qs[_0x74e5('0x3b')](_0x3d32ec['query'][_0x74e5('0x3b')]);_0x6cd953[_0x74e5('0x3c')]=qs['filters'](_[_0x74e5('0x3d')](_0x3d32ec[_0x74e5('0x31')],_0x545eb1[_0x74e5('0x3e')]),_0x23562e);if(_0x3d32ec['query']['filter']){_0x6cd953['where']=_[_0x74e5('0x3f')](_0x6cd953[_0x74e5('0x3c')],{'$or':_['map'](_0x23562e,function(_0x5c3ed9){if(_0x5c3ed9[_0x74e5('0x2e')]!==_0x74e5('0x40')){var _0x540f2a={};_0x540f2a[_0x5c3ed9[_0x74e5('0x27')]]={'$like':'%'+_0x3d32ec[_0x74e5('0x31')][_0x74e5('0x41')]+'%'};return _0x540f2a;}})});}_0x6cd953=_[_0x74e5('0x3f')]({},_0x6cd953,_0x3d32ec[_0x74e5('0x42')]);var _0x2fddb8={'where':_0x6cd953[_0x74e5('0x3c')]};return db[_0x74e5('0x2b')][_0x74e5('0x1e')](_0x2fddb8)[_0x74e5('0x22')](function(_0x13281e){_0x2ee497[_0x74e5('0x1e')]=_0x13281e;if(_0x3d32ec[_0x74e5('0x31')][_0x74e5('0x43')]){_0x6cd953[_0x74e5('0x44')]=[{'all':!![]}];}return db[_0x74e5('0x2b')][_0x74e5('0x45')](_0x6cd953);})[_0x74e5('0x22')](function(_0x46d7c2){_0x2ee497[_0x74e5('0x46')]=_0x46d7c2;return _0x2ee497;})[_0x74e5('0x22')](respondWithFilteredResult(_0x16621e,_0x6cd953))[_0x74e5('0x47')](handleError(_0x16621e,null));};exports[_0x74e5('0x48')]=function(_0x5a27c1,_0x3b8ba4){var _0x3e78f6={'raw':!![],'where':{'id':_0x5a27c1['params']['id']}},_0x5a7987={};_0x5a7987[_0x74e5('0x30')]=_[_0x74e5('0x32')](db[_0x74e5('0x2b')][_0x74e5('0x2c')]);_0x5a7987[_0x74e5('0x31')]=_[_0x74e5('0x32')](_0x5a27c1[_0x74e5('0x31')]);_0x5a7987[_0x74e5('0x3e')]=_[_0x74e5('0x33')](_0x5a7987['model'],_0x5a7987[_0x74e5('0x31')]);_0x3e78f6[_0x74e5('0x35')]=_[_0x74e5('0x33')](_0x5a7987[_0x74e5('0x30')],qs[_0x74e5('0x34')](_0x5a27c1[_0x74e5('0x31')][_0x74e5('0x34')]));_0x3e78f6[_0x74e5('0x35')]=_0x3e78f6[_0x74e5('0x35')]['length']?_0x3e78f6[_0x74e5('0x35')]:_0x5a7987[_0x74e5('0x30')];if(_0x5a27c1['query'][_0x74e5('0x43')]){_0x3e78f6[_0x74e5('0x44')]=[{'all':!![]}];}_0x3e78f6=_['merge']({},_0x3e78f6,_0x5a27c1['options']);return db[_0x74e5('0x2b')][_0x74e5('0x49')](_0x3e78f6)[_0x74e5('0x22')](handleEntityNotFound(_0x3b8ba4,null))[_0x74e5('0x22')](respondWithResult(_0x3b8ba4,null))[_0x74e5('0x47')](handleError(_0x3b8ba4,null));};exports['create']=function(_0x20652e,_0x19bd20){return db['SmsTransferReport'][_0x74e5('0x4a')](_0x20652e[_0x74e5('0x4b')],{})[_0x74e5('0x22')](respondWithResult(_0x19bd20,0xc9))[_0x74e5('0x47')](handleError(_0x19bd20,null));};exports[_0x74e5('0x4c')]=function(_0x13cdda,_0x42f2f0){if(_0x13cdda['body']['id']){delete _0x13cdda[_0x74e5('0x4b')]['id'];}return db[_0x74e5('0x2b')][_0x74e5('0x49')]({'where':{'id':_0x13cdda['params']['id']}})[_0x74e5('0x22')](handleEntityNotFound(_0x42f2f0,null))['then'](saveUpdates(_0x13cdda[_0x74e5('0x4b')],null))[_0x74e5('0x22')](respondWithResult(_0x42f2f0,null))[_0x74e5('0x47')](handleError(_0x42f2f0,null));};exports[_0x74e5('0x23')]=function(_0x13b2c2,_0x133de9){return db[_0x74e5('0x2b')][_0x74e5('0x49')]({'where':{'id':_0x13b2c2['params']['id']}})[_0x74e5('0x22')](handleEntityNotFound(_0x133de9,null))[_0x74e5('0x22')](removeEntity(_0x133de9,null))[_0x74e5('0x47')](handleError(_0x133de9,null));};exports[_0x74e5('0x4d')]=function(_0x555347,_0x2faf3e){return db[_0x74e5('0x2b')][_0x74e5('0x4d')]()[_0x74e5('0x22')](respondWithResult(_0x2faf3e,null))[_0x74e5('0x47')](handleError(_0x2faf3e,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 870d952..df76e9c 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 _0x629d=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid'];(function(_0x555bfb,_0x591927){var _0x1d6e29=function(_0x151257){while(--_0x151257){_0x555bfb['push'](_0x555bfb['shift']());}};_0x1d6e29(++_0x591927);}(_0x629d,0x197));var _0xd629=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0x629d[_0x5400a1];return _0x4006c7;};'use strict';var _=require('lodash');var util=require(_0xd629('0x0'));var logger=require(_0xd629('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd629('0x2'));var rp=require(_0xd629('0x3'));var fs=require('fs');var path=require(_0xd629('0x4'));var rimraf=require(_0xd629('0x5'));var config=require('../../config/environment');var attributes=require(_0xd629('0x6'));module[_0xd629('0x7')]=function(_0x9b7ea8,_0x14f0a7){return _0x9b7ea8[_0xd629('0x8')]('SmsTransferReport',attributes,{'tableName':_0xd629('0x9'),'paranoid':![],'indexes':[{'name':_0xd629('0xa'),'fields':[_0xd629('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe07d=['define','report_sms_transfer','uniqueid','lodash','util','moment','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports'];(function(_0x18e39f,_0x1ce41a){var _0x2b81d1=function(_0x58a0b0){while(--_0x58a0b0){_0x18e39f['push'](_0x18e39f['shift']());}};_0x2b81d1(++_0x1ce41a);}(_0xe07d,0x179));var _0xde07=function(_0x124f88,_0x3ad501){_0x124f88=_0x124f88-0x0;var _0xed0e3b=_0xe07d[_0x124f88];return _0xed0e3b;};'use strict';var _=require(_0xde07('0x0'));var util=require(_0xde07('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xde07('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xde07('0x3'));var rimraf=require(_0xde07('0x4'));var config=require(_0xde07('0x5'));var attributes=require(_0xde07('0x6'));module[_0xde07('0x7')]=function(_0x3a50dc,_0x2f2861){return _0x3a50dc[_0xde07('0x8')]('SmsTransferReport',attributes,{'tableName':_0xde07('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xde07('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index e0c2887..dec66ec 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 _0x5178=['request','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x5178,0x171));var _0x8517=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5178[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x8517('0x0'));var moment=require(_0x8517('0x1'));var BPromise=require(_0x8517('0x2'));var rs=require(_0x8517('0x3'));var fs=require('fs');var Redis=require(_0x8517('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8517('0x5'))(_0x8517('0x6'));var config=require('../../config/environment');var jayson=require(_0x8517('0x7'));var client=jayson['client'][_0x8517('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45498e,_0x3615b2,_0x10f918){return new BPromise(function(_0x25146d,_0x49739b){return client[_0x8517('0x9')](_0x45498e,_0x10f918)['then'](function(_0x485677){logger[_0x8517('0xa')](_0x8517('0xb'),_0x3615b2,'request\x20sent');logger[_0x8517('0xc')](_0x8517('0xd'),_0x3615b2,_0x8517('0xe'),JSON[_0x8517('0xf')](_0x485677));if(_0x485677[_0x8517('0x10')]){if(_0x485677[_0x8517('0x10')][_0x8517('0x11')]===0x1f4){logger[_0x8517('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x3615b2,_0x485677[_0x8517('0x10')][_0x8517('0x12')]);return _0x49739b(_0x485677[_0x8517('0x10')][_0x8517('0x12')]);}logger[_0x8517('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x3615b2,_0x485677[_0x8517('0x10')][_0x8517('0x12')]);return _0x25146d(_0x485677[_0x8517('0x10')][_0x8517('0x12')]);}else{logger[_0x8517('0xa')](_0x8517('0xb'),_0x3615b2,_0x8517('0xe'));_0x25146d(_0x485677[_0x8517('0x13')][_0x8517('0x12')]);}})[_0x8517('0x14')](function(_0x22b687){logger[_0x8517('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x3615b2,_0x22b687);_0x49739b(_0x22b687);});});} \ No newline at end of file +var _0x8ad5=['info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x7096bb,_0x4543fa){var _0x5a1835=function(_0x2aa9c9){while(--_0x2aa9c9){_0x7096bb['push'](_0x7096bb['shift']());}};_0x5a1835(++_0x4543fa);}(_0x8ad5,0xf1));var _0x58ad=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x8ad5[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0x58ad('0x0'));var util=require(_0x58ad('0x1'));var moment=require(_0x58ad('0x2'));var BPromise=require(_0x58ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58ad('0x4'))['db'];var utils=require(_0x58ad('0x5'));var logger=require(_0x58ad('0x6'))(_0x58ad('0x7'));var config=require(_0x58ad('0x8'));var jayson=require(_0x58ad('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x394972,_0x22c63f,_0x220c5f){return new BPromise(function(_0x2033a3,_0xe5d483){return client[_0x58ad('0xa')](_0x394972,_0x220c5f)[_0x58ad('0xb')](function(_0x14fa03){logger[_0x58ad('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x22c63f,_0x58ad('0xd'));logger[_0x58ad('0xe')](_0x58ad('0xf'),_0x22c63f,_0x58ad('0xd'),JSON[_0x58ad('0x10')](_0x14fa03));if(_0x14fa03[_0x58ad('0x11')]){if(_0x14fa03[_0x58ad('0x11')][_0x58ad('0x12')]===0x1f4){logger['error'](_0x58ad('0x13'),_0x22c63f,_0x14fa03[_0x58ad('0x11')][_0x58ad('0x14')]);return _0xe5d483(_0x14fa03[_0x58ad('0x11')][_0x58ad('0x14')]);}logger[_0x58ad('0x11')](_0x58ad('0x13'),_0x22c63f,_0x14fa03[_0x58ad('0x11')]['message']);return _0x2033a3(_0x14fa03['error']['message']);}else{logger['info'](_0x58ad('0x13'),_0x22c63f,'request\x20sent');_0x2033a3(_0x14fa03[_0x58ad('0x15')][_0x58ad('0x14')]);}})[_0x58ad('0x16')](function(_0x280618){logger[_0x58ad('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x22c63f,_0x280618);_0xe5d483(_0x280618);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 23cc098..e1184a1 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 _0x62d5=['../../components/auth/service','../../components/interaction/service','./sound.controller','isAuthenticated','index','get','/:id','/:id/download','diskStorage','join','root','originalname','format','%s-%s%s','basename','now','extname','post','file','put','update','delete','multer','util','connect-timeout','Router','fs-extra'];(function(_0x5b67f0,_0x5dca6e){var _0x116d7d=function(_0xf73479){while(--_0xf73479){_0x5b67f0['push'](_0x5b67f0['shift']());}};_0x116d7d(++_0x5dca6e);}(_0x62d5,0x9d));var _0x562d=function(_0x3fb18b,_0x4b6e5e){_0x3fb18b=_0x3fb18b-0x0;var _0x5f0cf9=_0x62d5[_0x3fb18b];return _0x5f0cf9;};'use strict';var multer=require(_0x562d('0x0'));var util=require(_0x562d('0x1'));var path=require('path');var timeout=require(_0x562d('0x2'));var express=require('express');var router=express[_0x562d('0x3')]();var fs_extra=require(_0x562d('0x4'));var auth=require(_0x562d('0x5'));var interaction=require(_0x562d('0x6'));var config=require('../../config/environment');var controller=require(_0x562d('0x7'));router['get']('/',auth[_0x562d('0x8')](),controller[_0x562d('0x9')]);router[_0x562d('0xa')](_0x562d('0xb'),auth[_0x562d('0x8')](),controller['show']);router['get'](_0x562d('0xc'),auth[_0x562d('0x8')](),controller['download']);var upload=multer({'storage':multer[_0x562d('0xd')]({'destination':function(_0x3ee49d,_0x224bc2,_0x3fc1e0){_0x3fc1e0(null,path[_0x562d('0xe')](config[_0x562d('0xf')],'server/files/sounds/original/'));},'filename':function(_0x16bfc3,_0x592dce,_0x283e06){_0x592dce[_0x562d('0x10')]=_0x592dce[_0x562d('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x283e06(null,util[_0x562d('0x11')](_0x562d('0x12'),path[_0x562d('0x13')](_0x592dce[_0x562d('0x10')],path['extname'](_0x592dce['originalname'])),Date[_0x562d('0x14')](),path[_0x562d('0x15')](_0x592dce['originalname'])));}})});router[_0x562d('0x16')]('/',upload['single'](_0x562d('0x17')),controller['create']);router[_0x562d('0x18')](_0x562d('0xb'),auth[_0x562d('0x8')](),controller[_0x562d('0x19')]);router[_0x562d('0x1a')](_0x562d('0xb'),auth['isAuthenticated'](),controller[_0x562d('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x6d54=['originalname','replace','format','basename','extname','post','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','join','server/files/sounds/original/'];(function(_0x4b14b3,_0x58b59c){var _0x3631d6=function(_0x30b680){while(--_0x30b680){_0x4b14b3['push'](_0x4b14b3['shift']());}};_0x3631d6(++_0x58b59c);}(_0x6d54,0x1b1));var _0x46d5=function(_0x47d99d,_0x5d6ab5){_0x47d99d=_0x47d99d-0x0;var _0x38e10c=_0x6d54[_0x47d99d];return _0x38e10c;};'use strict';var multer=require(_0x46d5('0x0'));var util=require(_0x46d5('0x1'));var path=require(_0x46d5('0x2'));var timeout=require(_0x46d5('0x3'));var express=require(_0x46d5('0x4'));var router=express['Router']();var fs_extra=require(_0x46d5('0x5'));var auth=require(_0x46d5('0x6'));var interaction=require(_0x46d5('0x7'));var config=require('../../config/environment');var controller=require(_0x46d5('0x8'));router[_0x46d5('0x9')]('/',auth[_0x46d5('0xa')](),controller[_0x46d5('0xb')]);router[_0x46d5('0x9')](_0x46d5('0xc'),auth[_0x46d5('0xa')](),controller[_0x46d5('0xd')]);router[_0x46d5('0x9')](_0x46d5('0xe'),auth[_0x46d5('0xa')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x68dfab,_0x568633,_0x578acb){_0x578acb(null,path[_0x46d5('0xf')](config['root'],_0x46d5('0x10')));},'filename':function(_0x5272f9,_0x322dd8,_0x4ad04c){_0x322dd8['originalname']=_0x322dd8[_0x46d5('0x11')][_0x46d5('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4ad04c(null,util[_0x46d5('0x13')]('%s-%s%s',path[_0x46d5('0x14')](_0x322dd8[_0x46d5('0x11')],path[_0x46d5('0x15')](_0x322dd8[_0x46d5('0x11')])),Date['now'](),path[_0x46d5('0x15')](_0x322dd8[_0x46d5('0x11')])));}})});router[_0x46d5('0x16')]('/',upload[_0x46d5('0x17')](_0x46d5('0x18')),controller[_0x46d5('0x19')]);router[_0x46d5('0x1a')](_0x46d5('0xc'),auth[_0x46d5('0xa')](),controller[_0x46d5('0x1b')]);router[_0x46d5('0x1c')](_0x46d5('0xc'),auth['isAuthenticated'](),controller[_0x46d5('0x1c')]);module[_0x46d5('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 9fd565b..e10f4d5 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 _0x4d30=['INTEGER','sequelize','exports','STRING','name','FLOAT','BIGINT'];(function(_0x4df84c,_0x3c36bf){var _0x10b3d8=function(_0x12c670){while(--_0x12c670){_0x4df84c['push'](_0x4df84c['shift']());}};_0x10b3d8(++_0x3c36bf);}(_0x4d30,0x1e4));var _0x04d3=function(_0x14fed4,_0x1ed363){_0x14fed4=_0x14fed4-0x0;var _0x4abc6b=_0x4d30[_0x14fed4];return _0x4abc6b;};'use strict';var Sequelize=require(_0x04d3('0x0'));module[_0x04d3('0x1')]={'name':{'type':Sequelize[_0x04d3('0x2')],'unique':_0x04d3('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x04d3('0x2')]},'display_name':{'type':Sequelize[_0x04d3('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x04d3('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x04d3('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x04d3('0x5')]},'original_sampleRate':{'type':Sequelize[_0x04d3('0x6')]},'converted_format':{'type':Sequelize[_0x04d3('0x2')]},'converted_duration':{'type':Sequelize[_0x04d3('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x04d3('0x5')]},'converted_channelCount':{'type':Sequelize[_0x04d3('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x04d3('0x6')]}}; \ No newline at end of file +var _0xf7f1=['exports','STRING','name','BIGINT','INTEGER','FLOAT','sequelize'];(function(_0x49870c,_0x4d2e2b){var _0x2c98f5=function(_0x32d62b){while(--_0x32d62b){_0x49870c['push'](_0x49870c['shift']());}};_0x2c98f5(++_0x4d2e2b);}(_0xf7f1,0x109));var _0x1f7f=function(_0x45869b,_0x551927){_0x45869b=_0x45869b-0x0;var _0x14d563=_0xf7f1[_0x45869b];return _0x14d563;};'use strict';var Sequelize=require(_0x1f7f('0x0'));module[_0x1f7f('0x1')]={'name':{'type':Sequelize[_0x1f7f('0x2')],'unique':_0x1f7f('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x1f7f('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x1f7f('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x1f7f('0x4')]},'original_channelCount':{'type':Sequelize[_0x1f7f('0x5')]},'original_bitRate':{'type':Sequelize[_0x1f7f('0x4')]},'original_sampleRate':{'type':Sequelize[_0x1f7f('0x5')]},'converted_format':{'type':Sequelize[_0x1f7f('0x2')]},'converted_duration':{'type':Sequelize[_0x1f7f('0x6')]},'converted_sampleCount':{'type':Sequelize[_0x1f7f('0x4')]},'converted_channelCount':{'type':Sequelize[_0x1f7f('0x5')]},'converted_bitRate':{'type':Sequelize[_0x1f7f('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x1f7f('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index b703864..066eb92 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 _0x9427=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','json','apply','update','then','destroy','Sounds','error','name','send','index','map','Sound','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','sort','where','pick','merge','type','filter','options','include','findAll','rows','params','rawAttributes','includeAll','find','download','save_name','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','catch','create','basename','originalname','file','extname','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','body','userProfileId','role','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto'];(function(_0x481df5,_0x216652){var _0x32726e=function(_0x2133f4){while(--_0x2133f4){_0x481df5['push'](_0x481df5['shift']());}};_0x32726e(++_0x216652);}(_0x9427,0x70));var _0x7942=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9427[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x7942('0x0'));var rimraf=require(_0x7942('0x1'));var zipdir=require(_0x7942('0x2'));var jsonpatch=require(_0x7942('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7942('0x4'));var Mustache=require(_0x7942('0x5'));var util=require('util');var path=require(_0x7942('0x6'));var sox=require(_0x7942('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7942('0x8'));var _=require(_0x7942('0x9'));var squel=require(_0x7942('0xa'));var crypto=require(_0x7942('0xb'));var jsforce=require(_0x7942('0xc'));var deskjs=require(_0x7942('0xd'));var toCsv=require(_0x7942('0xe'));var querystring=require(_0x7942('0xf'));var Papa=require(_0x7942('0x10'));var Redis=require(_0x7942('0x11'));var authService=require(_0x7942('0x12'));var qs=require(_0x7942('0x13'));var as=require(_0x7942('0x14'));var hardwareService=require(_0x7942('0x15'));var logger=require('../../config/logger')(_0x7942('0x16'));var utils=require(_0x7942('0x17'));var config=require(_0x7942('0x18'));var licenseUtil=require(_0x7942('0x19'));var db=require(_0x7942('0x1a'))['db'];function respondWithStatusCode(_0x403999,_0x3f4226){_0x3f4226=_0x3f4226||0xcc;return function(_0x291043){if(_0x291043){return _0x403999[_0x7942('0x1b')](_0x3f4226);}return _0x403999['status'](_0x3f4226)[_0x7942('0x1c')]();};}function respondWithResult(_0x676ed,_0xec66c5){_0xec66c5=_0xec66c5||0xc8;return function(_0x4df7dc){if(_0x4df7dc){return _0x676ed[_0x7942('0x1d')](_0xec66c5)['json'](_0x4df7dc);}};}function respondWithFilteredResult(_0x11cf76,_0x8d1cc1){return function(_0x27b9f5){if(_0x27b9f5){var _0x48ea46=typeof _0x8d1cc1[_0x7942('0x1e')]===_0x7942('0x1f')&&typeof _0x8d1cc1['limit']==='undefined';var _0x1a54b1=_0x27b9f5[_0x7942('0x20')];var _0x32c02f=_0x48ea46?0x0:_0x8d1cc1[_0x7942('0x1e')];var _0x53fbcc=_0x48ea46?_0x27b9f5[_0x7942('0x20')]:_0x8d1cc1[_0x7942('0x1e')]+_0x8d1cc1[_0x7942('0x21')];var _0x3b3e97;if(_0x53fbcc>=_0x1a54b1){_0x53fbcc=_0x1a54b1;_0x3b3e97=0xc8;}else{_0x3b3e97=0xce;}_0x11cf76[_0x7942('0x1d')](_0x3b3e97);return _0x11cf76['set']('Content-Range',_0x32c02f+'-'+_0x53fbcc+'/'+_0x1a54b1)[_0x7942('0x22')](_0x27b9f5);}return null;};}function patchUpdates(_0x2c0432){return function(_0x56e621){try{jsonpatch[_0x7942('0x23')](_0x56e621,_0x2c0432,!![]);}catch(_0x29ee76){return BPromise['reject'](_0x29ee76);}return _0x56e621['save']();};}function saveUpdates(_0x568382,_0x5832b6){return function(_0x26f053){if(_0x26f053){return _0x26f053[_0x7942('0x24')](_0x568382)[_0x7942('0x25')](function(_0x579be1){return _0x579be1;});}return null;};}function removeEntity(_0x3d1d05,_0x33fd0f){return function(_0x39cc56){if(_0x39cc56){return _0x39cc56[_0x7942('0x26')]()[_0x7942('0x25')](function(){var _0x24b6f0=_0x39cc56['get']({'plain':!![]});var _0x2fed35=_0x7942('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x2fed35,'resourceId':_0x24b6f0['id']}})['then'](function(){return _0x39cc56;});})[_0x7942('0x25')](function(){_0x3d1d05['status'](0xcc)[_0x7942('0x1c')]();});}};}function handleEntityNotFound(_0x17b56b,_0x1f5146){return function(_0x3b8727){if(!_0x3b8727){_0x17b56b[_0x7942('0x1b')](0x194);}return _0x3b8727;};}function handleError(_0xb45bf5,_0x503d81){_0x503d81=_0x503d81||0x1f4;return function(_0x19e847){logger[_0x7942('0x28')](_0x19e847['stack']);if(_0x19e847['name']){delete _0x19e847[_0x7942('0x29')];}_0xb45bf5['status'](_0x503d81)[_0x7942('0x2a')](_0x19e847);};}exports[_0x7942('0x2b')]=function(_0x2e1c6f,_0xae4bea){var _0x57b713={},_0x323182={},_0x28a252={'count':0x0,'rows':[]};var _0x4fe54b=_[_0x7942('0x2c')](db[_0x7942('0x2d')]['rawAttributes'],function(_0x2106a0){return{'name':_0x2106a0[_0x7942('0x2e')],'type':_0x2106a0['type'][_0x7942('0x2f')]};});_0x323182[_0x7942('0x30')]=_['map'](_0x4fe54b,_0x7942('0x29'));_0x323182[_0x7942('0x31')]=_[_0x7942('0x32')](_0x2e1c6f[_0x7942('0x31')]);_0x323182[_0x7942('0x33')]=_['intersection'](_0x323182['model'],_0x323182[_0x7942('0x31')]);_0x57b713[_0x7942('0x34')]=_[_0x7942('0x35')](_0x323182[_0x7942('0x30')],qs['fields'](_0x2e1c6f['query'][_0x7942('0x36')]));_0x57b713[_0x7942('0x34')]=_0x57b713[_0x7942('0x34')][_0x7942('0x37')]?_0x57b713[_0x7942('0x34')]:_0x323182[_0x7942('0x30')];if(!_0x2e1c6f[_0x7942('0x31')]['hasOwnProperty']('nolimit')){_0x57b713['limit']=qs[_0x7942('0x21')](_0x2e1c6f[_0x7942('0x31')][_0x7942('0x21')]);_0x57b713[_0x7942('0x1e')]=qs['offset'](_0x2e1c6f[_0x7942('0x31')]['offset']);}_0x57b713['order']=qs['sort'](_0x2e1c6f[_0x7942('0x31')][_0x7942('0x38')]);_0x57b713[_0x7942('0x39')]=qs[_0x7942('0x33')](_[_0x7942('0x3a')](_0x2e1c6f[_0x7942('0x31')],_0x323182['filters']),_0x4fe54b);if(_0x2e1c6f[_0x7942('0x31')]['filter']){_0x57b713[_0x7942('0x39')]=_[_0x7942('0x3b')](_0x57b713[_0x7942('0x39')],{'$or':_[_0x7942('0x2c')](_0x4fe54b,function(_0x51d2ca){if(_0x51d2ca[_0x7942('0x3c')]!=='VIRTUAL'){var _0x44a40b={};_0x44a40b[_0x51d2ca[_0x7942('0x29')]]={'$like':'%'+_0x2e1c6f[_0x7942('0x31')][_0x7942('0x3d')]+'%'};return _0x44a40b;}})});}_0x57b713=_[_0x7942('0x3b')]({},_0x57b713,_0x2e1c6f[_0x7942('0x3e')]);var _0x551277={'where':_0x57b713['where']};return db[_0x7942('0x2d')][_0x7942('0x20')](_0x551277)[_0x7942('0x25')](function(_0x452d1a){_0x28a252[_0x7942('0x20')]=_0x452d1a;if(_0x2e1c6f['query']['includeAll']){_0x57b713[_0x7942('0x3f')]=[{'all':!![]}];}return db[_0x7942('0x2d')][_0x7942('0x40')](_0x57b713);})[_0x7942('0x25')](function(_0x3f67c4){_0x28a252[_0x7942('0x41')]=_0x3f67c4;return _0x28a252;})['then'](respondWithFilteredResult(_0xae4bea,_0x57b713))['catch'](handleError(_0xae4bea,null));};exports['show']=function(_0x1e6985,_0x4f9401){var _0x391453={'raw':!![],'where':{'id':_0x1e6985[_0x7942('0x42')]['id']}},_0x325c88={};_0x325c88[_0x7942('0x30')]=_[_0x7942('0x32')](db[_0x7942('0x2d')][_0x7942('0x43')]);_0x325c88[_0x7942('0x31')]=_[_0x7942('0x32')](_0x1e6985[_0x7942('0x31')]);_0x325c88['filters']=_[_0x7942('0x35')](_0x325c88[_0x7942('0x30')],_0x325c88[_0x7942('0x31')]);_0x391453['attributes']=_[_0x7942('0x35')](_0x325c88[_0x7942('0x30')],qs[_0x7942('0x36')](_0x1e6985[_0x7942('0x31')]['fields']));_0x391453[_0x7942('0x34')]=_0x391453['attributes']['length']?_0x391453['attributes']:_0x325c88['model'];if(_0x1e6985[_0x7942('0x31')][_0x7942('0x44')]){_0x391453[_0x7942('0x3f')]=[{'all':!![]}];}_0x391453=_[_0x7942('0x3b')]({},_0x391453,_0x1e6985[_0x7942('0x3e')]);return db[_0x7942('0x2d')][_0x7942('0x45')](_0x391453)[_0x7942('0x25')](handleEntityNotFound(_0x4f9401,null))['then'](respondWithResult(_0x4f9401,null))['catch'](handleError(_0x4f9401,null));};exports[_0x7942('0x46')]=function(_0x45443f,_0x5af822,_0x41573a){return db['Sound']['find']({'where':{'id':_0x45443f[_0x7942('0x42')]['id']},'attributes':[_0x7942('0x29'),_0x7942('0x47'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x5af822,null))[_0x7942('0x25')](function(_0x5d8997){if(_0x5d8997){if(!fs['existsSync'](path[_0x7942('0x48')](config[_0x7942('0x49')],_0x7942('0x4a'),_0x5d8997['save_name']+'.'+_0x5d8997[_0x7942('0x4b')]))){throw new db[(_0x7942('0x4c'))][(_0x7942('0x4d'))](_0x7942('0x4e'));}return _0x5af822[_0x7942('0x46')](path[_0x7942('0x48')](config[_0x7942('0x49')],_0x7942('0x4a'),util[_0x7942('0x4f')]('%s.%s',_0x5d8997[_0x7942('0x47')],_0x5d8997['converted_format'])),util['format'](_0x7942('0x50'),_0x5d8997[_0x7942('0x29')],_0x5d8997[_0x7942('0x4b')]));}return null;})[_0x7942('0x51')](handleError(_0x5af822,null));};exports[_0x7942('0x52')]=function(_0x2d7d1c,_0x462bdc,_0x2612ed){var _0xec9c9={'name':path[_0x7942('0x53')](_0x2d7d1c['file'][_0x7942('0x54')],path['extname'](_0x2d7d1c['file'][_0x7942('0x54')])),'save_name':path[_0x7942('0x53')](_0x2d7d1c[_0x7942('0x55')]['filename'],path[_0x7942('0x56')](_0x2d7d1c[_0x7942('0x55')][_0x7942('0x57')])),'original_format':path[_0x7942('0x56')](_0x2d7d1c[_0x7942('0x55')][_0x7942('0x54')])[_0x7942('0x58')](0x1),'converted_format':_0x7942('0x59')};var _0x5529ff=path[_0x7942('0x48')](config[_0x7942('0x49')],'server/files/sounds/original',_0x2d7d1c['file']['filename']);var _0x477d90=path['join'](config['root'],_0x7942('0x4a'),util['format'](_0x7942('0x50'),path[_0x7942('0x53')](_0x2d7d1c[_0x7942('0x55')]['filename'],path[_0x7942('0x56')](_0x2d7d1c['file']['filename'])),_0xec9c9[_0x7942('0x4b')]));logger[_0x7942('0x5a')](_0x7942('0x5b'),_0x5529ff);logger[_0x7942('0x5a')](_0x7942('0x5c'),_0x477d90);try{fs[_0x7942('0x5d')](_0x5529ff,parseInt(_0x7942('0x5e'),0x8));var _0x585152=sox['transcode'](_0x5529ff,_0x477d90,{'sampleRate':0x1f40,'format':_0x7942('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x585152['on'](_0x7942('0x28'),function(_0x58a674){fs[_0x7942('0x5f')](_0x5529ff);_0x462bdc[_0x7942('0x1d')](0x1f4)[_0x7942('0x2a')](_0x58a674);});_0x585152['on'](_0x7942('0x60'),function(_0x3a9af1){_0xec9c9[_0x7942('0x61')]=isNaN(_0x3a9af1[_0x7942('0x62')])?null:_0x3a9af1['duration']*0x3e8;_0xec9c9[_0x7942('0x63')]=isNaN(_0x3a9af1[_0x7942('0x64')])?null:_0x3a9af1[_0x7942('0x64')];_0xec9c9[_0x7942('0x65')]=isNaN(_0x3a9af1[_0x7942('0x66')])?null:_0x3a9af1['channelCount'];_0xec9c9[_0x7942('0x67')]=isNaN(_0x3a9af1[_0x7942('0x68')])?null:_0x3a9af1[_0x7942('0x68')];_0xec9c9['original_sampleRate']=isNaN(_0x3a9af1[_0x7942('0x69')])?null:_0x3a9af1[_0x7942('0x69')];});_0x585152['on'](_0x7942('0x6a'),function(_0x22fa91){_0xec9c9[_0x7942('0x6b')]=isNaN(_0x22fa91[_0x7942('0x62')])?null:_0x22fa91[_0x7942('0x62')]*0x3e8;_0xec9c9[_0x7942('0x6c')]=isNaN(_0x22fa91[_0x7942('0x64')])?null:_0x22fa91['sampleCount'];_0xec9c9['converted_channelCount']=isNaN(_0x22fa91[_0x7942('0x66')])?null:_0x22fa91[_0x7942('0x66')];_0xec9c9[_0x7942('0x6d')]=isNaN(_0x22fa91['bitRate'])?null:_0x22fa91['bitRate'];_0xec9c9[_0x7942('0x6e')]=isNaN(_0x22fa91['sampleRate'])?null:_0x22fa91['sampleRate'];});_0x585152['on'](_0x7942('0x1c'),function(){fs[_0x7942('0x5d')](_0x477d90,parseInt(_0x7942('0x5e'),0x8));return db['Sound']['create'](_0xec9c9)['then'](function(_0x50403d){var _0x3f17ed={'role':_0x2d7d1c[_0x7942('0x6f')]['role'],'userProfileId':_0x2d7d1c[_0x7942('0x6f')][_0x7942('0x70')]};if(!_0x3f17ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f17ed[_0x7942('0x71')]==='user'){var _0x434f3a=_0x50403d[_0x7942('0x72')]({'plain':!![]});return db[_0x7942('0x73')][_0x7942('0x45')]({'where':{'name':_0x7942('0x27'),'userProfileId':_0x3f17ed['userProfileId']},'raw':!![]})['then'](function(_0x5c8c3d){if(_0x5c8c3d&&_0x5c8c3d[_0x7942('0x74')]===0x0){return db[_0x7942('0x75')][_0x7942('0x52')]({'name':_0x434f3a[_0x7942('0x29')],'resourceId':_0x434f3a['id'],'type':_0x5c8c3d[_0x7942('0x29')],'sectionId':_0x5c8c3d['id']},{})[_0x7942('0x25')](function(){return _0x50403d;});}else{return _0x50403d;}})[_0x7942('0x51')](function(_0x31f643){logger['error'](_0x7942('0x76'),_0x31f643);throw _0x31f643;});}return _0x50403d;})[_0x7942('0x25')](respondWithResult(_0x462bdc,null))[_0x7942('0x51')](handleError(_0x462bdc,null));});_0x585152[_0x7942('0x77')]();}catch(_0xd30b34){_0x462bdc[_0x7942('0x1d')](0x1f4)[_0x7942('0x2a')](_0xd30b34);}};exports[_0x7942('0x24')]=function(_0xba16db,_0x4c0ebc,_0xbbedf2){return db[_0x7942('0x2d')]['find']({'where':{'id':_0xba16db[_0x7942('0x42')]['id']}})[_0x7942('0x25')](handleEntityNotFound(_0x4c0ebc,null))[_0x7942('0x25')](saveUpdates(_[_0x7942('0x3a')](_0xba16db[_0x7942('0x6f')],[_0x7942('0x29'),_0x7942('0x78')]),null))[_0x7942('0x25')](respondWithResult(_0x4c0ebc,null))[_0x7942('0x51')](handleError(_0x4c0ebc,null));};exports[_0x7942('0x79')]=function(_0x1b07b0,_0x5c0b13,_0x7a982a){return db[_0x7942('0x2d')][_0x7942('0x45')]({'where':{'id':_0x1b07b0['params']['id']}})[_0x7942('0x25')](function(_0xa8d32a){if(_0xa8d32a){return _0xa8d32a['destroy']();}})[_0x7942('0x25')](function(_0x3bc5ae){var _0xedfefd=path[_0x7942('0x48')](config['root'],_0x7942('0x7a'),util[_0x7942('0x4f')](_0x7942('0x50'),_0x3bc5ae['save_name'],_0x3bc5ae[_0x7942('0x7b')]));var _0x51cd92=path[_0x7942('0x48')](config[_0x7942('0x49')],'server/files/sounds/converted',util['format'](_0x7942('0x50'),_0x3bc5ae[_0x7942('0x47')],_0x3bc5ae[_0x7942('0x4b')]));fs[_0x7942('0x5f')](_0xedfefd);fs[_0x7942('0x5f')](_0x51cd92);return _0x3bc5ae;})[_0x7942('0x25')](function(_0xaa5866){if(_0xaa5866){return _0x5c0b13[_0x7942('0x1d')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x5c0b13,null))[_0x7942('0x51')](handleError(_0x5c0b13,null));}; \ No newline at end of file +var _0x7fe3=['json','offset','undefined','limit','Content-Range','reject','save','update','then','destroy','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','sort','pick','filter','where','merge','count','includeAll','include','findAll','rows','catch','show','params','length','find','download','save_name','converted_format','join','root','server/files/sounds/converted','Sequelize','format','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','%s.%s','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','end','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','description','delete','original_format','unlinkSync','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','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'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x7fe3,0xd7));var _0x37fe=function(_0x211f76,_0x29b220){_0x211f76=_0x211f76-0x0;var _0x58b1fe=_0x7fe3[_0x211f76];return _0x58b1fe;};'use strict';var emlformat=require(_0x37fe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x37fe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x37fe('0x2'));var moment=require(_0x37fe('0x3'));var BPromise=require(_0x37fe('0x4'));var Mustache=require(_0x37fe('0x5'));var util=require(_0x37fe('0x6'));var path=require(_0x37fe('0x7'));var sox=require(_0x37fe('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x37fe('0x9'));var crypto=require(_0x37fe('0xa'));var jsforce=require(_0x37fe('0xb'));var deskjs=require(_0x37fe('0xc'));var toCsv=require(_0x37fe('0xd'));var querystring=require(_0x37fe('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x37fe('0xf'));var qs=require(_0x37fe('0x10'));var as=require(_0x37fe('0x11'));var hardwareService=require(_0x37fe('0x12'));var logger=require(_0x37fe('0x13'))(_0x37fe('0x14'));var utils=require(_0x37fe('0x15'));var config=require(_0x37fe('0x16'));var licenseUtil=require(_0x37fe('0x17'));var db=require(_0x37fe('0x18'))['db'];function respondWithStatusCode(_0x5be45f,_0x50bfb7){_0x50bfb7=_0x50bfb7||0xcc;return function(_0xa77072){if(_0xa77072){return _0x5be45f[_0x37fe('0x19')](_0x50bfb7);}return _0x5be45f[_0x37fe('0x1a')](_0x50bfb7)['end']();};}function respondWithResult(_0x587b0f,_0x4c2795){_0x4c2795=_0x4c2795||0xc8;return function(_0x33ca49){if(_0x33ca49){return _0x587b0f[_0x37fe('0x1a')](_0x4c2795)[_0x37fe('0x1b')](_0x33ca49);}};}function respondWithFilteredResult(_0x409e8d,_0x460f3f){return function(_0x51fd3e){if(_0x51fd3e){var _0x15e060=typeof _0x460f3f[_0x37fe('0x1c')]===_0x37fe('0x1d')&&typeof _0x460f3f[_0x37fe('0x1e')]===_0x37fe('0x1d');var _0x4a1ff7=_0x51fd3e['count'];var _0x469e2e=_0x15e060?0x0:_0x460f3f[_0x37fe('0x1c')];var _0x3ae26c=_0x15e060?_0x51fd3e['count']:_0x460f3f[_0x37fe('0x1c')]+_0x460f3f['limit'];var _0x575c8d;if(_0x3ae26c>=_0x4a1ff7){_0x3ae26c=_0x4a1ff7;_0x575c8d=0xc8;}else{_0x575c8d=0xce;}_0x409e8d[_0x37fe('0x1a')](_0x575c8d);return _0x409e8d['set'](_0x37fe('0x1f'),_0x469e2e+'-'+_0x3ae26c+'/'+_0x4a1ff7)['json'](_0x51fd3e);}return null;};}function patchUpdates(_0x4f7e70){return function(_0x5a98d0){try{jsonpatch['apply'](_0x5a98d0,_0x4f7e70,!![]);}catch(_0x9cee6f){return BPromise[_0x37fe('0x20')](_0x9cee6f);}return _0x5a98d0[_0x37fe('0x21')]();};}function saveUpdates(_0x435fc6,_0x5e1429){return function(_0x2c4890){if(_0x2c4890){return _0x2c4890[_0x37fe('0x22')](_0x435fc6)[_0x37fe('0x23')](function(_0x2d3561){return _0x2d3561;});}return null;};}function removeEntity(_0x545fe4,_0x29e745){return function(_0x2bc6b6){if(_0x2bc6b6){return _0x2bc6b6[_0x37fe('0x24')]()[_0x37fe('0x23')](function(){var _0x4027fb=_0x2bc6b6['get']({'plain':!![]});var _0x234ef2=_0x37fe('0x25');return db[_0x37fe('0x26')][_0x37fe('0x24')]({'where':{'type':_0x234ef2,'resourceId':_0x4027fb['id']}})['then'](function(){return _0x2bc6b6;});})[_0x37fe('0x23')](function(){_0x545fe4[_0x37fe('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b411f,_0x11509f){return function(_0x2619be){if(!_0x2619be){_0x3b411f[_0x37fe('0x19')](0x194);}return _0x2619be;};}function handleError(_0x9429f,_0xd11dca){_0xd11dca=_0xd11dca||0x1f4;return function(_0x35bb3d){logger[_0x37fe('0x27')](_0x35bb3d[_0x37fe('0x28')]);if(_0x35bb3d[_0x37fe('0x29')]){delete _0x35bb3d[_0x37fe('0x29')];}_0x9429f[_0x37fe('0x1a')](_0xd11dca)[_0x37fe('0x2a')](_0x35bb3d);};}exports[_0x37fe('0x2b')]=function(_0x5a34e8,_0x5d5270){var _0x43574e={},_0x4011a1={},_0x39a3a3={'count':0x0,'rows':[]};var _0x4dc594=_[_0x37fe('0x2c')](db[_0x37fe('0x2d')][_0x37fe('0x2e')],function(_0x26c1a9){return{'name':_0x26c1a9[_0x37fe('0x2f')],'type':_0x26c1a9[_0x37fe('0x30')][_0x37fe('0x31')]};});_0x4011a1['model']=_['map'](_0x4dc594,'name');_0x4011a1['query']=_[_0x37fe('0x32')](_0x5a34e8[_0x37fe('0x33')]);_0x4011a1[_0x37fe('0x34')]=_[_0x37fe('0x35')](_0x4011a1[_0x37fe('0x36')],_0x4011a1[_0x37fe('0x33')]);_0x43574e[_0x37fe('0x37')]=_[_0x37fe('0x35')](_0x4011a1[_0x37fe('0x36')],qs[_0x37fe('0x38')](_0x5a34e8[_0x37fe('0x33')][_0x37fe('0x38')]));_0x43574e['attributes']=_0x43574e[_0x37fe('0x37')]['length']?_0x43574e['attributes']:_0x4011a1['model'];if(!_0x5a34e8[_0x37fe('0x33')]['hasOwnProperty']('nolimit')){_0x43574e[_0x37fe('0x1e')]=qs['limit'](_0x5a34e8[_0x37fe('0x33')][_0x37fe('0x1e')]);_0x43574e['offset']=qs[_0x37fe('0x1c')](_0x5a34e8[_0x37fe('0x33')][_0x37fe('0x1c')]);}_0x43574e['order']=qs[_0x37fe('0x39')](_0x5a34e8[_0x37fe('0x33')][_0x37fe('0x39')]);_0x43574e['where']=qs[_0x37fe('0x34')](_[_0x37fe('0x3a')](_0x5a34e8[_0x37fe('0x33')],_0x4011a1[_0x37fe('0x34')]),_0x4dc594);if(_0x5a34e8[_0x37fe('0x33')][_0x37fe('0x3b')]){_0x43574e[_0x37fe('0x3c')]=_[_0x37fe('0x3d')](_0x43574e[_0x37fe('0x3c')],{'$or':_['map'](_0x4dc594,function(_0x3672aa){if(_0x3672aa[_0x37fe('0x30')]!=='VIRTUAL'){var _0x5f2d88={};_0x5f2d88[_0x3672aa[_0x37fe('0x29')]]={'$like':'%'+_0x5a34e8[_0x37fe('0x33')]['filter']+'%'};return _0x5f2d88;}})});}_0x43574e=_['merge']({},_0x43574e,_0x5a34e8['options']);var _0x289e90={'where':_0x43574e[_0x37fe('0x3c')]};return db[_0x37fe('0x2d')][_0x37fe('0x3e')](_0x289e90)['then'](function(_0x98edf1){_0x39a3a3[_0x37fe('0x3e')]=_0x98edf1;if(_0x5a34e8['query'][_0x37fe('0x3f')]){_0x43574e[_0x37fe('0x40')]=[{'all':!![]}];}return db['Sound'][_0x37fe('0x41')](_0x43574e);})[_0x37fe('0x23')](function(_0x1cb8f7){_0x39a3a3[_0x37fe('0x42')]=_0x1cb8f7;return _0x39a3a3;})['then'](respondWithFilteredResult(_0x5d5270,_0x43574e))[_0x37fe('0x43')](handleError(_0x5d5270,null));};exports[_0x37fe('0x44')]=function(_0x10024f,_0x1479c7){var _0x11967b={'raw':!![],'where':{'id':_0x10024f[_0x37fe('0x45')]['id']}},_0x29e9e2={};_0x29e9e2[_0x37fe('0x36')]=_['keys'](db[_0x37fe('0x2d')]['rawAttributes']);_0x29e9e2[_0x37fe('0x33')]=_[_0x37fe('0x32')](_0x10024f[_0x37fe('0x33')]);_0x29e9e2['filters']=_[_0x37fe('0x35')](_0x29e9e2[_0x37fe('0x36')],_0x29e9e2['query']);_0x11967b['attributes']=_['intersection'](_0x29e9e2[_0x37fe('0x36')],qs[_0x37fe('0x38')](_0x10024f[_0x37fe('0x33')][_0x37fe('0x38')]));_0x11967b[_0x37fe('0x37')]=_0x11967b[_0x37fe('0x37')][_0x37fe('0x46')]?_0x11967b[_0x37fe('0x37')]:_0x29e9e2[_0x37fe('0x36')];if(_0x10024f[_0x37fe('0x33')][_0x37fe('0x3f')]){_0x11967b[_0x37fe('0x40')]=[{'all':!![]}];}_0x11967b=_['merge']({},_0x11967b,_0x10024f['options']);return db[_0x37fe('0x2d')][_0x37fe('0x47')](_0x11967b)[_0x37fe('0x23')](handleEntityNotFound(_0x1479c7,null))['then'](respondWithResult(_0x1479c7,null))[_0x37fe('0x43')](handleError(_0x1479c7,null));};exports[_0x37fe('0x48')]=function(_0x243197,_0x3d7c63,_0x2a0582){return db['Sound'][_0x37fe('0x47')]({'where':{'id':_0x243197[_0x37fe('0x45')]['id']},'attributes':[_0x37fe('0x29'),_0x37fe('0x49'),_0x37fe('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x3d7c63,null))[_0x37fe('0x23')](function(_0x33ac26){if(_0x33ac26){if(!fs['existsSync'](path[_0x37fe('0x4b')](config[_0x37fe('0x4c')],_0x37fe('0x4d'),_0x33ac26[_0x37fe('0x49')]+'.'+_0x33ac26[_0x37fe('0x4a')]))){throw new db[(_0x37fe('0x4e'))]['ValidationError']('Sound\x20not\x20found');}return _0x3d7c63[_0x37fe('0x48')](path[_0x37fe('0x4b')](config['root'],_0x37fe('0x4d'),util['format']('%s.%s',_0x33ac26[_0x37fe('0x49')],_0x33ac26['converted_format'])),util[_0x37fe('0x4f')]('%s.%s',_0x33ac26[_0x37fe('0x29')],_0x33ac26[_0x37fe('0x4a')]));}return null;})[_0x37fe('0x43')](handleError(_0x3d7c63,null));};exports['create']=function(_0x3c8a1b,_0x1ca3f5,_0x286927){var _0x38afe6={'name':path[_0x37fe('0x50')](_0x3c8a1b[_0x37fe('0x51')][_0x37fe('0x52')],path[_0x37fe('0x53')](_0x3c8a1b['file'][_0x37fe('0x52')])),'save_name':path[_0x37fe('0x50')](_0x3c8a1b['file'][_0x37fe('0x54')],path[_0x37fe('0x53')](_0x3c8a1b['file'][_0x37fe('0x54')])),'original_format':path[_0x37fe('0x53')](_0x3c8a1b['file'][_0x37fe('0x52')])[_0x37fe('0x55')](0x1),'converted_format':_0x37fe('0x56')};var _0x140dc8=path['join'](config['root'],_0x37fe('0x57'),_0x3c8a1b[_0x37fe('0x51')][_0x37fe('0x54')]);var _0x2e397a=path[_0x37fe('0x4b')](config[_0x37fe('0x4c')],'server/files/sounds/converted',util[_0x37fe('0x4f')](_0x37fe('0x58'),path[_0x37fe('0x50')](_0x3c8a1b[_0x37fe('0x51')][_0x37fe('0x54')],path[_0x37fe('0x53')](_0x3c8a1b[_0x37fe('0x51')]['filename'])),_0x38afe6[_0x37fe('0x4a')]));logger[_0x37fe('0x59')](_0x37fe('0x5a'),_0x140dc8);logger[_0x37fe('0x59')](_0x37fe('0x5b'),_0x2e397a);try{fs[_0x37fe('0x5c')](_0x140dc8,parseInt(_0x37fe('0x5d'),0x8));var _0x56e18c=sox[_0x37fe('0x5e')](_0x140dc8,_0x2e397a,{'sampleRate':0x1f40,'format':_0x37fe('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x56e18c['on'](_0x37fe('0x27'),function(_0x30d7bb){fs['unlinkSync'](_0x140dc8);_0x1ca3f5[_0x37fe('0x1a')](0x1f4)[_0x37fe('0x2a')](_0x30d7bb);});_0x56e18c['on']('src',function(_0x12c9e1){_0x38afe6[_0x37fe('0x5f')]=isNaN(_0x12c9e1[_0x37fe('0x60')])?null:_0x12c9e1[_0x37fe('0x60')]*0x3e8;_0x38afe6['original_sampleCount']=isNaN(_0x12c9e1[_0x37fe('0x61')])?null:_0x12c9e1[_0x37fe('0x61')];_0x38afe6[_0x37fe('0x62')]=isNaN(_0x12c9e1[_0x37fe('0x63')])?null:_0x12c9e1[_0x37fe('0x63')];_0x38afe6[_0x37fe('0x64')]=isNaN(_0x12c9e1['bitRate'])?null:_0x12c9e1[_0x37fe('0x65')];_0x38afe6[_0x37fe('0x66')]=isNaN(_0x12c9e1[_0x37fe('0x67')])?null:_0x12c9e1[_0x37fe('0x67')];});_0x56e18c['on']('dest',function(_0x43db0c){_0x38afe6[_0x37fe('0x68')]=isNaN(_0x43db0c[_0x37fe('0x60')])?null:_0x43db0c['duration']*0x3e8;_0x38afe6[_0x37fe('0x69')]=isNaN(_0x43db0c['sampleCount'])?null:_0x43db0c['sampleCount'];_0x38afe6['converted_channelCount']=isNaN(_0x43db0c[_0x37fe('0x63')])?null:_0x43db0c['channelCount'];_0x38afe6[_0x37fe('0x6a')]=isNaN(_0x43db0c[_0x37fe('0x65')])?null:_0x43db0c[_0x37fe('0x65')];_0x38afe6[_0x37fe('0x6b')]=isNaN(_0x43db0c['sampleRate'])?null:_0x43db0c[_0x37fe('0x67')];});_0x56e18c['on'](_0x37fe('0x6c'),function(){fs['chmodSync'](_0x2e397a,parseInt(_0x37fe('0x5d'),0x8));return db['Sound'][_0x37fe('0x6d')](_0x38afe6)[_0x37fe('0x23')](function(_0x20481b){var _0x54f6a4={'role':_0x3c8a1b[_0x37fe('0x6e')][_0x37fe('0x6f')],'userProfileId':_0x3c8a1b[_0x37fe('0x6e')][_0x37fe('0x70')]};if(!_0x54f6a4)throw new Error(_0x37fe('0x71'));if(_0x54f6a4[_0x37fe('0x6f')]==='user'){var _0x51ebad=_0x20481b[_0x37fe('0x72')]({'plain':!![]});return db[_0x37fe('0x73')][_0x37fe('0x47')]({'where':{'name':_0x37fe('0x25'),'userProfileId':_0x54f6a4[_0x37fe('0x70')]},'raw':!![]})['then'](function(_0x5e9075){if(_0x5e9075&&_0x5e9075[_0x37fe('0x74')]===0x0){return db[_0x37fe('0x26')][_0x37fe('0x6d')]({'name':_0x51ebad[_0x37fe('0x29')],'resourceId':_0x51ebad['id'],'type':_0x5e9075[_0x37fe('0x29')],'sectionId':_0x5e9075['id']},{})['then'](function(){return _0x20481b;});}else{return _0x20481b;}})[_0x37fe('0x43')](function(_0xb9f7b3){logger[_0x37fe('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb9f7b3);throw _0xb9f7b3;});}return _0x20481b;})[_0x37fe('0x23')](respondWithResult(_0x1ca3f5,null))[_0x37fe('0x43')](handleError(_0x1ca3f5,null));});_0x56e18c['start']();}catch(_0x5ca50f){_0x1ca3f5[_0x37fe('0x1a')](0x1f4)[_0x37fe('0x2a')](_0x5ca50f);}};exports[_0x37fe('0x22')]=function(_0x53c7e1,_0x5bb8da,_0xfdd59a){return db[_0x37fe('0x2d')][_0x37fe('0x47')]({'where':{'id':_0x53c7e1[_0x37fe('0x45')]['id']}})[_0x37fe('0x23')](handleEntityNotFound(_0x5bb8da,null))[_0x37fe('0x23')](saveUpdates(_[_0x37fe('0x3a')](_0x53c7e1[_0x37fe('0x6e')],[_0x37fe('0x29'),_0x37fe('0x75')]),null))[_0x37fe('0x23')](respondWithResult(_0x5bb8da,null))[_0x37fe('0x43')](handleError(_0x5bb8da,null));};exports[_0x37fe('0x76')]=function(_0x5d1123,_0x34f26f,_0x48e77a){return db[_0x37fe('0x2d')][_0x37fe('0x47')]({'where':{'id':_0x5d1123['params']['id']}})['then'](function(_0x2478d0){if(_0x2478d0){return _0x2478d0[_0x37fe('0x24')]();}})[_0x37fe('0x23')](function(_0x51ba4d){var _0x5727e1=path[_0x37fe('0x4b')](config[_0x37fe('0x4c')],_0x37fe('0x57'),util[_0x37fe('0x4f')](_0x37fe('0x58'),_0x51ba4d['save_name'],_0x51ba4d[_0x37fe('0x77')]));var _0x354826=path[_0x37fe('0x4b')](config[_0x37fe('0x4c')],_0x37fe('0x4d'),util[_0x37fe('0x4f')](_0x37fe('0x58'),_0x51ba4d[_0x37fe('0x49')],_0x51ba4d[_0x37fe('0x4a')]));fs[_0x37fe('0x78')](_0x5727e1);fs['unlinkSync'](_0x354826);return _0x51ba4d;})['then'](function(_0x1143ff){if(_0x1143ff){return _0x34f26f[_0x37fe('0x1a')](0xcc)['end']();}})[_0x37fe('0x23')](handleEntityNotFound(_0x34f26f,null))[_0x37fe('0x43')](handleError(_0x34f26f,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 5b07ad4..b0a4495 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 _0x20b3=['./sound.attributes','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x161597,_0x52046f){var _0x58580d=function(_0xeef5ae){while(--_0xeef5ae){_0x161597['push'](_0x161597['shift']());}};_0x58580d(++_0x52046f);}(_0x20b3,0x1a6));var _0x320b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20b3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x320b('0x0'));var util=require(_0x320b('0x1'));var logger=require(_0x320b('0x2'))(_0x320b('0x3'));var moment=require(_0x320b('0x4'));var BPromise=require(_0x320b('0x5'));var rp=require(_0x320b('0x6'));var fs=require('fs');var path=require(_0x320b('0x7'));var rimraf=require(_0x320b('0x8'));var config=require(_0x320b('0x9'));var attributes=require(_0x320b('0xa'));module['exports']=function(_0x5db431,_0x25ee9a){return _0x5db431['define']('Sound',attributes,{'tableName':_0x320b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05e0=['./sound.attributes','exports','Sound','tools_sounds','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x2e75a0,_0x3cc5fe){var _0x1aff6e=function(_0x1a40f7){while(--_0x1a40f7){_0x2e75a0['push'](_0x2e75a0['shift']());}};_0x1aff6e(++_0x3cc5fe);}(_0x05e0,0x117));var _0x005e=function(_0x59ab65,_0x410a52){_0x59ab65=_0x59ab65-0x0;var _0x57db9b=_0x05e0[_0x59ab65];return _0x57db9b;};'use strict';var _=require('lodash');var util=require(_0x005e('0x0'));var logger=require(_0x005e('0x1'))(_0x005e('0x2'));var moment=require(_0x005e('0x3'));var BPromise=require(_0x005e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x005e('0x5'));var rimraf=require('rimraf');var config=require(_0x005e('0x6'));var attributes=require(_0x005e('0x7'));module[_0x005e('0x8')]=function(_0x43ddbf,_0x6cfba4){return _0x43ddbf['define'](_0x005e('0x9'),attributes,{'tableName':_0x005e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index c559681..5a6f4c7 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 _0x0ad0=['rpc','jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','find','options','raw','where','attributes','include','map','model','then','ShowSound','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x533ec0,_0x3fc1c5){var _0x29bc69=function(_0x4d3e32){while(--_0x4d3e32){_0x533ec0['push'](_0x533ec0['shift']());}};_0x29bc69(++_0x3fc1c5);}(_0x0ad0,0x119));var _0x00ad=function(_0x50cf65,_0x2066df){_0x50cf65=_0x50cf65-0x0;var _0x4c22c0=_0x0ad0[_0x50cf65];return _0x4c22c0;};'use strict';var _=require(_0x00ad('0x0'));var util=require('util');var moment=require(_0x00ad('0x1'));var BPromise=require(_0x00ad('0x2'));var rs=require(_0x00ad('0x3'));var fs=require('fs');var Redis=require(_0x00ad('0x4'));var db=require(_0x00ad('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x00ad('0x6'))(_0x00ad('0x7'));var config=require('../../config/environment');var jayson=require(_0x00ad('0x8'));var client=jayson[_0x00ad('0x9')][_0x00ad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfb9d98,_0x530405,_0x5b3e5e){return new BPromise(function(_0x142b76,_0x35ed22){return client[_0x00ad('0xb')](_0xfb9d98,_0x5b3e5e)['then'](function(_0x4bd2e9){logger[_0x00ad('0xc')](_0x00ad('0xd'),_0x530405,_0x00ad('0xe'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x530405,_0x00ad('0xe'),JSON[_0x00ad('0xf')](_0x4bd2e9));if(_0x4bd2e9['error']){if(_0x4bd2e9[_0x00ad('0x10')][_0x00ad('0x11')]===0x1f4){logger[_0x00ad('0x10')](_0x00ad('0xd'),_0x530405,_0x4bd2e9['error'][_0x00ad('0x12')]);return _0x35ed22(_0x4bd2e9[_0x00ad('0x10')][_0x00ad('0x12')]);}logger[_0x00ad('0x10')](_0x00ad('0xd'),_0x530405,_0x4bd2e9['error']['message']);return _0x142b76(_0x4bd2e9['error'][_0x00ad('0x12')]);}else{logger[_0x00ad('0xc')](_0x00ad('0xd'),_0x530405,'request\x20sent');_0x142b76(_0x4bd2e9[_0x00ad('0x13')][_0x00ad('0x12')]);}})[_0x00ad('0x14')](function(_0x1e277c){logger[_0x00ad('0x10')](_0x00ad('0xd'),_0x530405,_0x1e277c);_0x35ed22(_0x1e277c);});});}exports['ShowSound']=function(_0x58a4b3){var _0x291c3c=this;return new Promise(function(_0x4e4826,_0x58ea52){return db['Sound'][_0x00ad('0x15')]({'raw':_0x58a4b3[_0x00ad('0x16')]?_0x58a4b3['options'][_0x00ad('0x17')]===undefined?!![]:![]:!![],'where':_0x58a4b3[_0x00ad('0x16')]?_0x58a4b3[_0x00ad('0x16')][_0x00ad('0x18')]||null:null,'attributes':_0x58a4b3[_0x00ad('0x16')]?_0x58a4b3[_0x00ad('0x16')][_0x00ad('0x19')]||null:null,'include':_0x58a4b3['options']?_0x58a4b3[_0x00ad('0x16')][_0x00ad('0x1a')]?_[_0x00ad('0x1b')](_0x58a4b3['options'][_0x00ad('0x1a')],function(_0x28b32f){return{'model':db[_0x28b32f['model']],'as':_0x28b32f['as'],'attributes':_0x28b32f[_0x00ad('0x19')],'include':_0x28b32f[_0x00ad('0x1a')]?_['map'](_0x28b32f[_0x00ad('0x1a')],function(_0x5dd33e){return{'model':db[_0x5dd33e[_0x00ad('0x1c')]],'as':_0x5dd33e['as'],'attributes':_0x5dd33e['attributes'],'include':_0x5dd33e[_0x00ad('0x1a')]?_[_0x00ad('0x1b')](_0x5dd33e[_0x00ad('0x1a')],function(_0x3a7a8a){return{'model':db[_0x3a7a8a['model']],'as':_0x3a7a8a['as'],'attributes':_0x3a7a8a[_0x00ad('0x19')]};}):[]};}):[]};}):[]:[]})[_0x00ad('0x1d')](function(_0x41d50a){logger[_0x00ad('0xc')](_0x00ad('0x1e'),_0x58a4b3);logger[_0x00ad('0x1f')](_0x00ad('0x1e'),_0x58a4b3,JSON[_0x00ad('0xf')](_0x41d50a));_0x4e4826(_0x41d50a);})['catch'](function(_0x499ce1){logger['error'](_0x00ad('0x1e'),_0x499ce1[_0x00ad('0x12')],_0x58a4b3);_0x58ea52(_0x291c3c[_0x00ad('0x10')](0x1f4,_0x499ce1['message']));});});}; \ No newline at end of file +var _0x7204=['client','http','request','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSound','Sound','find','options','raw','where','map','include','model','attributes','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x7204,0x7f));var _0x4720=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7204[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x4720('0x0'));var util=require('util');var moment=require(_0x4720('0x1'));var BPromise=require(_0x4720('0x2'));var rs=require(_0x4720('0x3'));var fs=require('fs');var Redis=require(_0x4720('0x4'));var db=require(_0x4720('0x5'))['db'];var utils=require(_0x4720('0x6'));var logger=require('../../config/logger')(_0x4720('0x7'));var config=require(_0x4720('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4720('0x9')][_0x4720('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56afed,_0x3a72a8,_0x44cb05){return new BPromise(function(_0xf03ad9,_0x205108){return client[_0x4720('0xb')](_0x56afed,_0x44cb05)[_0x4720('0xc')](function(_0x433dc3){logger[_0x4720('0xd')](_0x4720('0xe'),_0x3a72a8,'request\x20sent');logger[_0x4720('0xf')](_0x4720('0x10'),_0x3a72a8,_0x4720('0x11'),JSON[_0x4720('0x12')](_0x433dc3));if(_0x433dc3[_0x4720('0x13')]){if(_0x433dc3[_0x4720('0x13')][_0x4720('0x14')]===0x1f4){logger[_0x4720('0x13')](_0x4720('0xe'),_0x3a72a8,_0x433dc3[_0x4720('0x13')][_0x4720('0x15')]);return _0x205108(_0x433dc3[_0x4720('0x13')][_0x4720('0x15')]);}logger['error'](_0x4720('0xe'),_0x3a72a8,_0x433dc3['error'][_0x4720('0x15')]);return _0xf03ad9(_0x433dc3[_0x4720('0x13')]['message']);}else{logger[_0x4720('0xd')](_0x4720('0xe'),_0x3a72a8,_0x4720('0x11'));_0xf03ad9(_0x433dc3[_0x4720('0x16')][_0x4720('0x15')]);}})['catch'](function(_0x5f390e){logger[_0x4720('0x13')]('Sound,\x20%s,\x20%s',_0x3a72a8,_0x5f390e);_0x205108(_0x5f390e);});});}exports[_0x4720('0x17')]=function(_0x287b2a){var _0x5070de=this;return new Promise(function(_0x51a79f,_0x1c8ecc){return db[_0x4720('0x18')][_0x4720('0x19')]({'raw':_0x287b2a[_0x4720('0x1a')]?_0x287b2a['options'][_0x4720('0x1b')]===undefined?!![]:![]:!![],'where':_0x287b2a[_0x4720('0x1a')]?_0x287b2a[_0x4720('0x1a')][_0x4720('0x1c')]||null:null,'attributes':_0x287b2a[_0x4720('0x1a')]?_0x287b2a[_0x4720('0x1a')]['attributes']||null:null,'include':_0x287b2a[_0x4720('0x1a')]?_0x287b2a[_0x4720('0x1a')]['include']?_[_0x4720('0x1d')](_0x287b2a[_0x4720('0x1a')][_0x4720('0x1e')],function(_0x205ef2){return{'model':db[_0x205ef2[_0x4720('0x1f')]],'as':_0x205ef2['as'],'attributes':_0x205ef2['attributes'],'include':_0x205ef2['include']?_['map'](_0x205ef2[_0x4720('0x1e')],function(_0x53123b){return{'model':db[_0x53123b['model']],'as':_0x53123b['as'],'attributes':_0x53123b[_0x4720('0x20')],'include':_0x53123b[_0x4720('0x1e')]?_['map'](_0x53123b[_0x4720('0x1e')],function(_0x5d24fd){return{'model':db[_0x5d24fd[_0x4720('0x1f')]],'as':_0x5d24fd['as'],'attributes':_0x5d24fd[_0x4720('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4022e1){logger['info'](_0x4720('0x17'),_0x287b2a);logger['debug'](_0x4720('0x17'),_0x287b2a,JSON[_0x4720('0x12')](_0x4022e1));_0x51a79f(_0x4022e1);})[_0x4720('0x21')](function(_0x14b0a3){logger['error']('ShowSound',_0x14b0a3[_0x4720('0x15')],_0x287b2a);_0x1c8ecc(_0x5070de[_0x4720('0x13')](0x1f4,_0x14b0a3[_0x4720('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index e196987..ab4351a 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 _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x3c63ba,_0x4c7af0){var _0x22a9bc=function(_0x4d614f){while(--_0x4d614f){_0x3c63ba['push'](_0x3c63ba['shift']());}};_0x22a9bc(++_0x4c7af0);}(_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'));var controller=require('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x45fc10,_0x5f3263){var _0x3d5b0b=function(_0x33565b){while(--_0x33565b){_0x45fc10['push'](_0x45fc10['shift']());}};_0x3d5b0b(++_0x5f3263);}(_0xb10b,0x12a));var _0xbb10=function(_0x13b948,_0x2a5a86){_0x13b948=_0x13b948-0x0;var _0x2f0044=_0xb10b[_0x13b948];return _0x2f0044;};'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('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);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 0997772..4aaadec 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 _0x476e=['TEXT','out','sequelize','STRING'];(function(_0x3e954d,_0x4cc3a0){var _0x59649b=function(_0x9c6eac){while(--_0x9c6eac){_0x3e954d['push'](_0x3e954d['shift']());}};_0x59649b(++_0x4cc3a0);}(_0x476e,0x14a));var _0xe476=function(_0x2bc3a9,_0x53be7e){_0x2bc3a9=_0x2bc3a9-0x0;var _0x211eb1=_0x476e[_0x2bc3a9];return _0x211eb1;};'use strict';var Sequelize=require(_0xe476('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe476('0x1')]},'body':{'type':Sequelize[_0xe476('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe476('0x3')),'defaultValue':_0xe476('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0xe476('0x1')]},'providerResponse':{'type':Sequelize[_0xe476('0x2')]}}; \ No newline at end of file +var _0x4f95=['sequelize','STRING','TEXT','medium','out'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x4f95,0xd7));var _0x54f9=function(_0x37368e,_0x3140e1){_0x37368e=_0x37368e-0x0;var _0x530a90=_0x4f95[_0x37368e];return _0x530a90;};'use strict';var Sequelize=require(_0x54f9('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x54f9('0x1')]},'body':{'type':Sequelize[_0x54f9('0x2')](_0x54f9('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x54f9('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index ecf678f..9fa000b 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 _0x648e=['findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','SquareMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x648e,0xa3));var _0xe648=function(_0x4d6a14,_0x2693c7){_0x4d6a14=_0x4d6a14-0x0;var _0x489dcb=_0x648e[_0x4d6a14];return _0x489dcb;};'use strict';var emlformat=require(_0xe648('0x0'));var rimraf=require(_0xe648('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe648('0x2'));var rp=require('request-promise');var moment=require(_0xe648('0x3'));var BPromise=require(_0xe648('0x4'));var Mustache=require(_0xe648('0x5'));var util=require(_0xe648('0x6'));var path=require(_0xe648('0x7'));var sox=require(_0xe648('0x8'));var csv=require(_0xe648('0x9'));var ejs=require(_0xe648('0xa'));var fs=require('fs');var fs_extra=require(_0xe648('0xb'));var _=require(_0xe648('0xc'));var squel=require(_0xe648('0xd'));var crypto=require(_0xe648('0xe'));var jsforce=require(_0xe648('0xf'));var deskjs=require(_0xe648('0x10'));var toCsv=require(_0xe648('0x9'));var querystring=require('querystring');var Papa=require(_0xe648('0x11'));var Redis=require(_0xe648('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe648('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe648('0x14'));var logger=require(_0xe648('0x15'))(_0xe648('0x16'));var utils=require(_0xe648('0x17'));var config=require(_0xe648('0x18'));var licenseUtil=require(_0xe648('0x19'));var db=require(_0xe648('0x1a'))['db'];function respondWithStatusCode(_0x1fe296,_0x2abc2c){_0x2abc2c=_0x2abc2c||0xcc;return function(_0xd25ab4){if(_0xd25ab4){return _0x1fe296[_0xe648('0x1b')](_0x2abc2c);}return _0x1fe296['status'](_0x2abc2c)[_0xe648('0x1c')]();};}function respondWithResult(_0x32f0e7,_0x2f6c75){_0x2f6c75=_0x2f6c75||0xc8;return function(_0x45162b){if(_0x45162b){return _0x32f0e7[_0xe648('0x1d')](_0x2f6c75)[_0xe648('0x1e')](_0x45162b);}};}function respondWithFilteredResult(_0x4464a1,_0x2cf799){return function(_0x355b6c){if(_0x355b6c){var _0x26d4f4=typeof _0x2cf799[_0xe648('0x1f')]===_0xe648('0x20')&&typeof _0x2cf799['limit']===_0xe648('0x20');var _0x2fbff5=_0x355b6c[_0xe648('0x21')];var _0x4c48cb=_0x26d4f4?0x0:_0x2cf799[_0xe648('0x1f')];var _0x1a066b=_0x26d4f4?_0x355b6c['count']:_0x2cf799[_0xe648('0x1f')]+_0x2cf799[_0xe648('0x22')];var _0x5a8bd5;if(_0x1a066b>=_0x2fbff5){_0x1a066b=_0x2fbff5;_0x5a8bd5=0xc8;}else{_0x5a8bd5=0xce;}_0x4464a1[_0xe648('0x1d')](_0x5a8bd5);return _0x4464a1[_0xe648('0x23')](_0xe648('0x24'),_0x4c48cb+'-'+_0x1a066b+'/'+_0x2fbff5)[_0xe648('0x1e')](_0x355b6c);}return null;};}function patchUpdates(_0x15abab){return function(_0x247b40){try{jsonpatch[_0xe648('0x25')](_0x247b40,_0x15abab,!![]);}catch(_0x4845f7){return BPromise[_0xe648('0x26')](_0x4845f7);}return _0x247b40[_0xe648('0x27')]();};}function saveUpdates(_0x1af9c4,_0x48ebf2){return function(_0x78b2db){if(_0x78b2db){return _0x78b2db[_0xe648('0x28')](_0x1af9c4)[_0xe648('0x29')](function(_0x2ea0bd){return _0x2ea0bd;});}return null;};}function removeEntity(_0x3fe09f,_0x583a3b){return function(_0x12469d){if(_0x12469d){return _0x12469d[_0xe648('0x2a')]()['then'](function(){_0x3fe09f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e3e03,_0x2c68df){return function(_0x3cdb52){if(!_0x3cdb52){_0x5e3e03['sendStatus'](0x194);}return _0x3cdb52;};}function handleError(_0x4ff73d,_0x422441){_0x422441=_0x422441||0x1f4;return function(_0x1e265c){logger[_0xe648('0x2b')](_0x1e265c[_0xe648('0x2c')]);if(_0x1e265c[_0xe648('0x2d')]){delete _0x1e265c[_0xe648('0x2d')];}_0x4ff73d[_0xe648('0x1d')](_0x422441)['send'](_0x1e265c);};}exports[_0xe648('0x2e')]=function(_0x4835b9,_0x4715a5){var _0xe83a32={},_0x39c1c2={},_0x4e25b0={'count':0x0,'rows':[]};var _0x496a4c=_['map'](db[_0xe648('0x2f')][_0xe648('0x30')],function(_0xd2591c){return{'name':_0xd2591c['fieldName'],'type':_0xd2591c[_0xe648('0x31')]['key']};});_0x39c1c2[_0xe648('0x32')]=_['map'](_0x496a4c,_0xe648('0x2d'));_0x39c1c2[_0xe648('0x33')]=_[_0xe648('0x34')](_0x4835b9[_0xe648('0x33')]);_0x39c1c2[_0xe648('0x35')]=_['intersection'](_0x39c1c2[_0xe648('0x32')],_0x39c1c2[_0xe648('0x33')]);_0xe83a32['attributes']=_[_0xe648('0x36')](_0x39c1c2[_0xe648('0x32')],qs['fields'](_0x4835b9['query']['fields']));_0xe83a32[_0xe648('0x37')]=_0xe83a32[_0xe648('0x37')][_0xe648('0x38')]?_0xe83a32['attributes']:_0x39c1c2[_0xe648('0x32')];if(!_0x4835b9['query'][_0xe648('0x39')](_0xe648('0x3a'))){_0xe83a32[_0xe648('0x22')]=qs[_0xe648('0x22')](_0x4835b9[_0xe648('0x33')][_0xe648('0x22')]);_0xe83a32[_0xe648('0x1f')]=qs[_0xe648('0x1f')](_0x4835b9['query'][_0xe648('0x1f')]);}_0xe83a32[_0xe648('0x3b')]=qs[_0xe648('0x3c')](_0x4835b9['query'][_0xe648('0x3c')]);_0xe83a32[_0xe648('0x3d')]=qs[_0xe648('0x35')](_[_0xe648('0x3e')](_0x4835b9['query'],_0x39c1c2[_0xe648('0x35')]),_0x496a4c);if(_0x4835b9[_0xe648('0x33')]['filter']){_0xe83a32[_0xe648('0x3d')]=_[_0xe648('0x3f')](_0xe83a32['where'],{'$or':_['map'](_0x496a4c,function(_0x2165dd){if(_0x2165dd['type']!=='VIRTUAL'){var _0x1e79e1={};_0x1e79e1[_0x2165dd['name']]={'$like':'%'+_0x4835b9['query'][_0xe648('0x40')]+'%'};return _0x1e79e1;}})});}_0xe83a32=_[_0xe648('0x3f')]({},_0xe83a32,_0x4835b9[_0xe648('0x41')]);var _0x5a475d={'where':_0xe83a32[_0xe648('0x3d')]};return db[_0xe648('0x2f')][_0xe648('0x21')](_0x5a475d)[_0xe648('0x29')](function(_0x5860a4){_0x4e25b0[_0xe648('0x21')]=_0x5860a4;if(_0x4835b9[_0xe648('0x33')][_0xe648('0x42')]){_0xe83a32[_0xe648('0x43')]=[{'all':!![]}];}return db['SquareMessage'][_0xe648('0x44')](_0xe83a32);})[_0xe648('0x29')](function(_0x56be0a){_0x4e25b0[_0xe648('0x45')]=_0x56be0a;return _0x4e25b0;})[_0xe648('0x29')](respondWithFilteredResult(_0x4715a5,_0xe83a32))[_0xe648('0x46')](handleError(_0x4715a5,null));};exports[_0xe648('0x47')]=function(_0x5ac909,_0xd215b0){var _0x549e2c={'raw':!![],'where':{'id':_0x5ac909[_0xe648('0x48')]['id']}},_0x1bbe7b={};_0x1bbe7b[_0xe648('0x32')]=_[_0xe648('0x34')](db[_0xe648('0x2f')][_0xe648('0x30')]);_0x1bbe7b['query']=_[_0xe648('0x34')](_0x5ac909[_0xe648('0x33')]);_0x1bbe7b[_0xe648('0x35')]=_[_0xe648('0x36')](_0x1bbe7b['model'],_0x1bbe7b[_0xe648('0x33')]);_0x549e2c[_0xe648('0x37')]=_[_0xe648('0x36')](_0x1bbe7b['model'],qs['fields'](_0x5ac909['query'][_0xe648('0x49')]));_0x549e2c['attributes']=_0x549e2c[_0xe648('0x37')][_0xe648('0x38')]?_0x549e2c['attributes']:_0x1bbe7b['model'];if(_0x5ac909[_0xe648('0x33')]['includeAll']){_0x549e2c[_0xe648('0x43')]=[{'all':!![]}];}_0x549e2c=_[_0xe648('0x3f')]({},_0x549e2c,_0x5ac909[_0xe648('0x41')]);return db[_0xe648('0x2f')][_0xe648('0x4a')](_0x549e2c)[_0xe648('0x29')](handleEntityNotFound(_0xd215b0,null))[_0xe648('0x29')](respondWithResult(_0xd215b0,null))['catch'](handleError(_0xd215b0,null));};exports[_0xe648('0x4b')]=function(_0x1aa060,_0x461642){return db[_0xe648('0x2f')][_0xe648('0x4b')](_0x1aa060[_0xe648('0x4c')],{})[_0xe648('0x29')](respondWithResult(_0x461642,0xc9))[_0xe648('0x46')](handleError(_0x461642,null));};exports['update']=function(_0x37885d,_0x2750c7){if(_0x37885d[_0xe648('0x4c')]['id']){delete _0x37885d[_0xe648('0x4c')]['id'];}return db[_0xe648('0x2f')][_0xe648('0x4a')]({'where':{'id':_0x37885d[_0xe648('0x48')]['id']}})[_0xe648('0x29')](handleEntityNotFound(_0x2750c7,null))[_0xe648('0x29')](saveUpdates(_0x37885d[_0xe648('0x4c')],null))[_0xe648('0x29')](respondWithResult(_0x2750c7,null))['catch'](handleError(_0x2750c7,null));};exports['destroy']=function(_0x92bc1f,_0x5dc398){return db[_0xe648('0x2f')][_0xe648('0x4a')]({'where':{'id':_0x92bc1f[_0xe648('0x48')]['id']}})[_0xe648('0x29')](handleEntityNotFound(_0x5dc398,null))['then'](removeEntity(_0x5dc398,null))[_0xe648('0x46')](handleError(_0x5dc398,null));}; \ No newline at end of file +var _0x41fa=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','json','apply','reject','destroy','then','error','name','send','index','SquareMessage','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','VIRTUAL','options','includeAll','include','findAll','catch','keys','merge','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x49cb71,_0x2f0149){var _0x3a50fd=function(_0x48c304){while(--_0x48c304){_0x49cb71['push'](_0x49cb71['shift']());}};_0x3a50fd(++_0x2f0149);}(_0x41fa,0x1f1));var _0xa41f=function(_0x3f4315,_0xd6ec89){_0x3f4315=_0x3f4315-0x0;var _0x5842e3=_0x41fa[_0x3f4315];return _0x5842e3;};'use strict';var emlformat=require(_0xa41f('0x0'));var rimraf=require(_0xa41f('0x1'));var zipdir=require(_0xa41f('0x2'));var jsonpatch=require(_0xa41f('0x3'));var rp=require(_0xa41f('0x4'));var moment=require(_0xa41f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa41f('0x6'));var util=require(_0xa41f('0x7'));var path=require(_0xa41f('0x8'));var sox=require(_0xa41f('0x9'));var csv=require(_0xa41f('0xa'));var ejs=require(_0xa41f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa41f('0xc'));var squel=require(_0xa41f('0xd'));var crypto=require(_0xa41f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa41f('0xf'));var toCsv=require(_0xa41f('0xa'));var querystring=require(_0xa41f('0x10'));var Papa=require(_0xa41f('0x11'));var Redis=require(_0xa41f('0x12'));var authService=require(_0xa41f('0x13'));var qs=require(_0xa41f('0x14'));var as=require(_0xa41f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa41f('0x16'))(_0xa41f('0x17'));var utils=require(_0xa41f('0x18'));var config=require(_0xa41f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa41f('0x1a'))['db'];function respondWithStatusCode(_0x181529,_0x2e76ab){_0x2e76ab=_0x2e76ab||0xcc;return function(_0x32b9d8){if(_0x32b9d8){return _0x181529[_0xa41f('0x1b')](_0x2e76ab);}return _0x181529['status'](_0x2e76ab)[_0xa41f('0x1c')]();};}function respondWithResult(_0x358e36,_0x56731f){_0x56731f=_0x56731f||0xc8;return function(_0x5e050e){if(_0x5e050e){return _0x358e36[_0xa41f('0x1d')](_0x56731f)['json'](_0x5e050e);}};}function respondWithFilteredResult(_0x4850b3,_0x37efef){return function(_0x2de743){if(_0x2de743){var _0x56acbb=typeof _0x37efef[_0xa41f('0x1e')]==='undefined'&&typeof _0x37efef[_0xa41f('0x1f')]===_0xa41f('0x20');var _0x189e0d=_0x2de743[_0xa41f('0x21')];var _0x568d98=_0x56acbb?0x0:_0x37efef[_0xa41f('0x1e')];var _0x1d363b=_0x56acbb?_0x2de743[_0xa41f('0x21')]:_0x37efef['offset']+_0x37efef['limit'];var _0x2ab691;if(_0x1d363b>=_0x189e0d){_0x1d363b=_0x189e0d;_0x2ab691=0xc8;}else{_0x2ab691=0xce;}_0x4850b3[_0xa41f('0x1d')](_0x2ab691);return _0x4850b3[_0xa41f('0x22')]('Content-Range',_0x568d98+'-'+_0x1d363b+'/'+_0x189e0d)[_0xa41f('0x23')](_0x2de743);}return null;};}function patchUpdates(_0x13961d){return function(_0x3b095a){try{jsonpatch[_0xa41f('0x24')](_0x3b095a,_0x13961d,!![]);}catch(_0x44b0a7){return BPromise[_0xa41f('0x25')](_0x44b0a7);}return _0x3b095a['save']();};}function saveUpdates(_0x36a122,_0x500cb0){return function(_0x960cc0){if(_0x960cc0){return _0x960cc0['update'](_0x36a122)['then'](function(_0x381d98){return _0x381d98;});}return null;};}function removeEntity(_0x116dd3,_0xe0302c){return function(_0x84a34f){if(_0x84a34f){return _0x84a34f[_0xa41f('0x26')]()[_0xa41f('0x27')](function(){_0x116dd3[_0xa41f('0x1d')](0xcc)[_0xa41f('0x1c')]();});}};}function handleEntityNotFound(_0xa65f5c,_0x5723bc){return function(_0x386bc6){if(!_0x386bc6){_0xa65f5c['sendStatus'](0x194);}return _0x386bc6;};}function handleError(_0x30e9cd,_0x13eb19){_0x13eb19=_0x13eb19||0x1f4;return function(_0x4637cf){logger[_0xa41f('0x28')](_0x4637cf['stack']);if(_0x4637cf[_0xa41f('0x29')]){delete _0x4637cf[_0xa41f('0x29')];}_0x30e9cd[_0xa41f('0x1d')](_0x13eb19)[_0xa41f('0x2a')](_0x4637cf);};}exports[_0xa41f('0x2b')]=function(_0xf2f543,_0x34f031){var _0x27fe53={},_0x266059={},_0x4dc3bb={'count':0x0,'rows':[]};var _0xb879c6=_['map'](db[_0xa41f('0x2c')][_0xa41f('0x2d')],function(_0x48aadc){return{'name':_0x48aadc[_0xa41f('0x2e')],'type':_0x48aadc[_0xa41f('0x2f')][_0xa41f('0x30')]};});_0x266059[_0xa41f('0x31')]=_[_0xa41f('0x32')](_0xb879c6,'name');_0x266059[_0xa41f('0x33')]=_['keys'](_0xf2f543[_0xa41f('0x33')]);_0x266059['filters']=_[_0xa41f('0x34')](_0x266059[_0xa41f('0x31')],_0x266059['query']);_0x27fe53[_0xa41f('0x35')]=_[_0xa41f('0x34')](_0x266059[_0xa41f('0x31')],qs[_0xa41f('0x36')](_0xf2f543[_0xa41f('0x33')]['fields']));_0x27fe53[_0xa41f('0x35')]=_0x27fe53['attributes'][_0xa41f('0x37')]?_0x27fe53[_0xa41f('0x35')]:_0x266059[_0xa41f('0x31')];if(!_0xf2f543[_0xa41f('0x33')]['hasOwnProperty'](_0xa41f('0x38'))){_0x27fe53['limit']=qs[_0xa41f('0x1f')](_0xf2f543[_0xa41f('0x33')][_0xa41f('0x1f')]);_0x27fe53[_0xa41f('0x1e')]=qs[_0xa41f('0x1e')](_0xf2f543['query'][_0xa41f('0x1e')]);}_0x27fe53[_0xa41f('0x39')]=qs[_0xa41f('0x3a')](_0xf2f543[_0xa41f('0x33')][_0xa41f('0x3a')]);_0x27fe53[_0xa41f('0x3b')]=qs[_0xa41f('0x3c')](_['pick'](_0xf2f543[_0xa41f('0x33')],_0x266059[_0xa41f('0x3c')]),_0xb879c6);if(_0xf2f543['query'][_0xa41f('0x3d')]){_0x27fe53[_0xa41f('0x3b')]=_['merge'](_0x27fe53[_0xa41f('0x3b')],{'$or':_[_0xa41f('0x32')](_0xb879c6,function(_0x25ada7){if(_0x25ada7['type']!==_0xa41f('0x3e')){var _0x52d427={};_0x52d427[_0x25ada7[_0xa41f('0x29')]]={'$like':'%'+_0xf2f543['query']['filter']+'%'};return _0x52d427;}})});}_0x27fe53=_['merge']({},_0x27fe53,_0xf2f543[_0xa41f('0x3f')]);var _0x1f345a={'where':_0x27fe53['where']};return db[_0xa41f('0x2c')][_0xa41f('0x21')](_0x1f345a)[_0xa41f('0x27')](function(_0x155716){_0x4dc3bb[_0xa41f('0x21')]=_0x155716;if(_0xf2f543[_0xa41f('0x33')][_0xa41f('0x40')]){_0x27fe53[_0xa41f('0x41')]=[{'all':!![]}];}return db[_0xa41f('0x2c')][_0xa41f('0x42')](_0x27fe53);})[_0xa41f('0x27')](function(_0x2efc04){_0x4dc3bb['rows']=_0x2efc04;return _0x4dc3bb;})[_0xa41f('0x27')](respondWithFilteredResult(_0x34f031,_0x27fe53))[_0xa41f('0x43')](handleError(_0x34f031,null));};exports['show']=function(_0x291b8c,_0x4e70ee){var _0x29b610={'raw':!![],'where':{'id':_0x291b8c['params']['id']}},_0x44e0ad={};_0x44e0ad[_0xa41f('0x31')]=_[_0xa41f('0x44')](db[_0xa41f('0x2c')][_0xa41f('0x2d')]);_0x44e0ad[_0xa41f('0x33')]=_[_0xa41f('0x44')](_0x291b8c['query']);_0x44e0ad[_0xa41f('0x3c')]=_[_0xa41f('0x34')](_0x44e0ad[_0xa41f('0x31')],_0x44e0ad[_0xa41f('0x33')]);_0x29b610['attributes']=_[_0xa41f('0x34')](_0x44e0ad[_0xa41f('0x31')],qs[_0xa41f('0x36')](_0x291b8c['query'][_0xa41f('0x36')]));_0x29b610[_0xa41f('0x35')]=_0x29b610['attributes'][_0xa41f('0x37')]?_0x29b610[_0xa41f('0x35')]:_0x44e0ad[_0xa41f('0x31')];if(_0x291b8c[_0xa41f('0x33')][_0xa41f('0x40')]){_0x29b610['include']=[{'all':!![]}];}_0x29b610=_[_0xa41f('0x45')]({},_0x29b610,_0x291b8c[_0xa41f('0x3f')]);return db[_0xa41f('0x2c')]['find'](_0x29b610)[_0xa41f('0x27')](handleEntityNotFound(_0x4e70ee,null))[_0xa41f('0x27')](respondWithResult(_0x4e70ee,null))[_0xa41f('0x43')](handleError(_0x4e70ee,null));};exports[_0xa41f('0x46')]=function(_0x20068f,_0x12c2c1){return db[_0xa41f('0x2c')][_0xa41f('0x46')](_0x20068f[_0xa41f('0x47')],{})['then'](respondWithResult(_0x12c2c1,0xc9))['catch'](handleError(_0x12c2c1,null));};exports[_0xa41f('0x48')]=function(_0xc23b50,_0xb754f3){if(_0xc23b50[_0xa41f('0x47')]['id']){delete _0xc23b50['body']['id'];}return db['SquareMessage'][_0xa41f('0x49')]({'where':{'id':_0xc23b50['params']['id']}})[_0xa41f('0x27')](handleEntityNotFound(_0xb754f3,null))[_0xa41f('0x27')](saveUpdates(_0xc23b50[_0xa41f('0x47')],null))[_0xa41f('0x27')](respondWithResult(_0xb754f3,null))[_0xa41f('0x43')](handleError(_0xb754f3,null));};exports[_0xa41f('0x26')]=function(_0x1ae036,_0x44a8d8){return db[_0xa41f('0x2c')][_0xa41f('0x49')]({'where':{'id':_0x1ae036['params']['id']}})['then'](handleEntityNotFound(_0x44a8d8,null))[_0xa41f('0x27')](removeEntity(_0x44a8d8,null))[_0xa41f('0x43')](handleError(_0x44a8d8,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index e09100c..4f8b5c3 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 _0xc407=['rimraf','../../config/environment','exports','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x141da6,_0x27d92d){var _0x12cb67=function(_0x58d070){while(--_0x58d070){_0x141da6['push'](_0x141da6['shift']());}};_0x12cb67(++_0x27d92d);}(_0xc407,0x1e6));var _0x7c40=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0xc407[_0x46428c];return _0x16a677;};'use strict';var _=require(_0x7c40('0x0'));var util=require('util');var logger=require(_0x7c40('0x1'))(_0x7c40('0x2'));var moment=require(_0x7c40('0x3'));var BPromise=require(_0x7c40('0x4'));var rp=require(_0x7c40('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c40('0x6'));var config=require(_0x7c40('0x7'));var attributes=require('./squareMessage.attributes');module[_0x7c40('0x8')]=function(_0x34b2bd,_0x211ba5){return _0x34b2bd[_0x7c40('0x9')](_0x7c40('0xa'),attributes,{'tableName':_0x7c40('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c47=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0x1c47,0x1ce));var _0x71c4=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0x1c47[_0x79b649];return _0x1af9b1;};'use strict';var _=require(_0x71c4('0x0'));var util=require(_0x71c4('0x1'));var logger=require(_0x71c4('0x2'))(_0x71c4('0x3'));var moment=require(_0x71c4('0x4'));var BPromise=require(_0x71c4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x71c4('0x6'));var rimraf=require(_0x71c4('0x7'));var config=require(_0x71c4('0x8'));var attributes=require(_0x71c4('0x9'));module[_0x71c4('0xa')]=function(_0x57ffa2,_0x2b74a4){return _0x57ffa2[_0x71c4('0xb')](_0x71c4('0xc'),attributes,{'tableName':_0x71c4('0xd'),'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 b966035..fcc8d72 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 _0x104d=['info','request\x20sent','debug','stringify','error','code','message','SquareMessage,\x20%s,\x20%s','result','catch','CreateSquareMessage','SquareMessage','create','options','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x597c69,_0x19032a){var _0x7aad9b=function(_0x588f52){while(--_0x588f52){_0x597c69['push'](_0x597c69['shift']());}};_0x7aad9b(++_0x19032a);}(_0x104d,0x114));var _0xd104=function(_0x49d0e3,_0x359aed){_0x49d0e3=_0x49d0e3-0x0;var _0x26d388=_0x104d[_0x49d0e3];return _0x26d388;};'use strict';var _=require(_0xd104('0x0'));var util=require(_0xd104('0x1'));var moment=require(_0xd104('0x2'));var BPromise=require('bluebird');var rs=require(_0xd104('0x3'));var fs=require('fs');var Redis=require(_0xd104('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd104('0x5'));var logger=require(_0xd104('0x6'))(_0xd104('0x7'));var config=require(_0xd104('0x8'));var jayson=require(_0xd104('0x9'));var client=jayson[_0xd104('0xa')][_0xd104('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3afc7f,_0x29bfd7,_0xb62c30){return new BPromise(function(_0x30526e,_0x12d3fb){return client[_0xd104('0xc')](_0x3afc7f,_0xb62c30)[_0xd104('0xd')](function(_0x2caaf6){logger[_0xd104('0xe')]('SquareMessage,\x20%s,\x20%s',_0x29bfd7,_0xd104('0xf'));logger[_0xd104('0x10')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x29bfd7,_0xd104('0xf'),JSON[_0xd104('0x11')](_0x2caaf6));if(_0x2caaf6[_0xd104('0x12')]){if(_0x2caaf6[_0xd104('0x12')][_0xd104('0x13')]===0x1f4){logger[_0xd104('0x12')]('SquareMessage,\x20%s,\x20%s',_0x29bfd7,_0x2caaf6[_0xd104('0x12')][_0xd104('0x14')]);return _0x12d3fb(_0x2caaf6['error'][_0xd104('0x14')]);}logger['error'](_0xd104('0x15'),_0x29bfd7,_0x2caaf6[_0xd104('0x12')]['message']);return _0x30526e(_0x2caaf6['error']['message']);}else{logger[_0xd104('0xe')](_0xd104('0x15'),_0x29bfd7,_0xd104('0xf'));_0x30526e(_0x2caaf6[_0xd104('0x16')]['message']);}})[_0xd104('0x17')](function(_0x5ca11f){logger['error'](_0xd104('0x15'),_0x29bfd7,_0x5ca11f);_0x12d3fb(_0x5ca11f);});});}exports[_0xd104('0x18')]=function(_0x5e7439){var _0x1d0641=this;return new Promise(function(_0x5b28b9,_0x3557a4){return db[_0xd104('0x19')][_0xd104('0x1a')](_0x5e7439['body'],{'raw':_0x5e7439[_0xd104('0x1b')]?_0x5e7439[_0xd104('0x1b')][_0xd104('0x1c')]===undefined?!![]:![]:!![]})[_0xd104('0xd')](function(_0x36417d){logger['info'](_0xd104('0x18'),_0x5e7439);logger['debug'](_0xd104('0x18'),_0x5e7439,JSON[_0xd104('0x11')](_0x36417d));_0x5b28b9(_0x36417d);})[_0xd104('0x17')](function(_0x2bde2d){logger['error'](_0xd104('0x18'),_0x2bde2d[_0xd104('0x14')],_0x5e7439);_0x3557a4(_0x1d0641[_0xd104('0x12')](0x1f4,_0x2bde2d[_0xd104('0x14')]));});});}; \ No newline at end of file +var _0x10ec=['options','raw','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSquareMessage','SquareMessage','body'];(function(_0x5f06ce,_0x1c0269){var _0xc9e9ae=function(_0x3d09c6){while(--_0x3d09c6){_0x5f06ce['push'](_0x5f06ce['shift']());}};_0xc9e9ae(++_0x1c0269);}(_0x10ec,0xaa));var _0xc10e=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x10ec[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xc10e('0x0'));var util=require(_0xc10e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc10e('0x2'));var fs=require('fs');var Redis=require(_0xc10e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc10e('0x4'))(_0xc10e('0x5'));var config=require(_0xc10e('0x6'));var jayson=require(_0xc10e('0x7'));var client=jayson[_0xc10e('0x8')][_0xc10e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3dd467,_0x4eb629,_0x18a6ae){return new BPromise(function(_0x59ad9f,_0x305557){return client[_0xc10e('0xa')](_0x3dd467,_0x18a6ae)['then'](function(_0x4595d2){logger[_0xc10e('0xb')](_0xc10e('0xc'),_0x4eb629,_0xc10e('0xd'));logger['debug'](_0xc10e('0xe'),_0x4eb629,_0xc10e('0xd'),JSON[_0xc10e('0xf')](_0x4595d2));if(_0x4595d2[_0xc10e('0x10')]){if(_0x4595d2[_0xc10e('0x10')][_0xc10e('0x11')]===0x1f4){logger[_0xc10e('0x10')](_0xc10e('0xc'),_0x4eb629,_0x4595d2[_0xc10e('0x10')]['message']);return _0x305557(_0x4595d2[_0xc10e('0x10')][_0xc10e('0x12')]);}logger[_0xc10e('0x10')]('SquareMessage,\x20%s,\x20%s',_0x4eb629,_0x4595d2[_0xc10e('0x10')]['message']);return _0x59ad9f(_0x4595d2[_0xc10e('0x10')]['message']);}else{logger[_0xc10e('0xb')](_0xc10e('0xc'),_0x4eb629,'request\x20sent');_0x59ad9f(_0x4595d2['result'][_0xc10e('0x12')]);}})['catch'](function(_0x21696f){logger[_0xc10e('0x10')](_0xc10e('0xc'),_0x4eb629,_0x21696f);_0x305557(_0x21696f);});});}exports[_0xc10e('0x13')]=function(_0x23e1c4){var _0x2a80e5=this;return new Promise(function(_0x5a4312,_0x2f7625){return db[_0xc10e('0x14')]['create'](_0x23e1c4[_0xc10e('0x15')],{'raw':_0x23e1c4[_0xc10e('0x16')]?_0x23e1c4[_0xc10e('0x16')][_0xc10e('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x36f832){logger['info'](_0xc10e('0x13'),_0x23e1c4);logger['debug']('CreateSquareMessage',_0x23e1c4,JSON[_0xc10e('0xf')](_0x36f832));_0x5a4312(_0x36f832);})['catch'](function(_0x3b54db){logger[_0xc10e('0x10')](_0xc10e('0x13'),_0x3b54db[_0xc10e('0x12')],_0x23e1c4);_0x2f7625(_0x2a80e5[_0xc10e('0x10')](0x1f4,_0x3b54db['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 48dcdd0..857055e 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 _0xe6a3=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','/:id','/:id/test','15s','test','post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x261344,_0x4a47a8){var _0x5146b7=function(_0x5c1b1e){while(--_0x5c1b1e){_0x261344['push'](_0x261344['shift']());}};_0x5146b7(++_0x4a47a8);}(_0xe6a3,0xa3));var _0x3e6a=function(_0x112fe3,_0x16b642){_0x112fe3=_0x112fe3-0x0;var _0x1ec903=_0xe6a3[_0x112fe3];return _0x1ec903;};'use strict';var multer=require(_0x3e6a('0x0'));var util=require('util');var path=require(_0x3e6a('0x1'));var timeout=require(_0x3e6a('0x2'));var express=require(_0x3e6a('0x3'));var router=express[_0x3e6a('0x4')]();var fs_extra=require(_0x3e6a('0x5'));var auth=require(_0x3e6a('0x6'));var interaction=require(_0x3e6a('0x7'));var config=require(_0x3e6a('0x8'));var controller=require(_0x3e6a('0x9'));router[_0x3e6a('0xa')]('/',auth[_0x3e6a('0xb')](),controller['index']);router[_0x3e6a('0xa')](_0x3e6a('0xc'),auth[_0x3e6a('0xb')](),controller['show']);router[_0x3e6a('0xa')](_0x3e6a('0xd'),auth['isAuthenticated'](),timeout(_0x3e6a('0xe')),controller[_0x3e6a('0xf')]);router[_0x3e6a('0x10')]('/',auth[_0x3e6a('0xb')](),controller[_0x3e6a('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3e6a('0x12')](_0x3e6a('0xc'),auth[_0x3e6a('0xb')](),controller[_0x3e6a('0x13')]);module[_0x3e6a('0x14')]=router; \ No newline at end of file +var _0x5fb0=['../../config/environment','./squareOdbc.controller','get','index','show','/:id/test','test','post','isAuthenticated','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x5b6413,_0x534976){var _0x1507ad=function(_0x59154f){while(--_0x59154f){_0x5b6413['push'](_0x5b6413['shift']());}};_0x1507ad(++_0x534976);}(_0x5fb0,0x149));var _0x05fb=function(_0x28afbe,_0x4d655b){_0x28afbe=_0x28afbe-0x0;var _0x16a494=_0x5fb0[_0x28afbe];return _0x16a494;};'use strict';var multer=require(_0x05fb('0x0'));var util=require(_0x05fb('0x1'));var path=require(_0x05fb('0x2'));var timeout=require(_0x05fb('0x3'));var express=require(_0x05fb('0x4'));var router=express[_0x05fb('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x05fb('0x6'));var config=require(_0x05fb('0x7'));var controller=require(_0x05fb('0x8'));router[_0x05fb('0x9')]('/',auth['isAuthenticated'](),controller[_0x05fb('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x05fb('0xb')]);router['get'](_0x05fb('0xc'),auth['isAuthenticated'](),timeout('15s'),controller[_0x05fb('0xd')]);router[_0x05fb('0xe')]('/',auth[_0x05fb('0xf')](),controller[_0x05fb('0x10')]);router[_0x05fb('0x11')]('/:id',auth[_0x05fb('0xf')](),controller[_0x05fb('0x12')]);router[_0x05fb('0x13')]('/:id',auth[_0x05fb('0xf')](),controller[_0x05fb('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 5bcc79d..f8b52c3 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 _0x77d4=['exports'];(function(_0x571f4a,_0x29d73a){var _0x30450c=function(_0x32faa6){while(--_0x32faa6){_0x571f4a['push'](_0x571f4a['shift']());}};_0x30450c(++_0x29d73a);}(_0x77d4,0xe5));var _0x477d=function(_0x14e7cd,_0xdf9c3d){_0x14e7cd=_0x14e7cd-0x0;var _0x15d587=_0x77d4[_0x14e7cd];return _0x15d587;};'use strict';var Sequelize=require('sequelize');module[_0x477d('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd080=['STRING','sequelize','exports','name'];(function(_0x2a6d8c,_0x19c800){var _0x31a401=function(_0x2bd376){while(--_0x2bd376){_0x2a6d8c['push'](_0x2a6d8c['shift']());}};_0x31a401(++_0x19c800);}(_0xd080,0x1b1));var _0x0d08=function(_0x5df6d4,_0x17a38d){_0x5df6d4=_0x5df6d4-0x0;var _0x167f82=_0xd080[_0x5df6d4];return _0x167f82;};'use strict';var Sequelize=require(_0x0d08('0x0'));module[_0x0d08('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0d08('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x0d08('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index dd0c533..029c55b 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 _0x2885=['length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','SquareOdbc','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','ODBC','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields'];(function(_0x3843ea,_0x4fa30a){var _0x53e5c6=function(_0x1678be){while(--_0x1678be){_0x3843ea['push'](_0x3843ea['shift']());}};_0x53e5c6(++_0x4fa30a);}(_0x2885,0x120));var _0x5288=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x2885[_0x1992f1];return _0x413dfe;};'use strict';var emlformat=require(_0x5288('0x0'));var rimraf=require(_0x5288('0x1'));var zipdir=require(_0x5288('0x2'));var jsonpatch=require(_0x5288('0x3'));var rp=require(_0x5288('0x4'));var moment=require(_0x5288('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5288('0x6'));var util=require(_0x5288('0x7'));var path=require(_0x5288('0x8'));var sox=require(_0x5288('0x9'));var csv=require(_0x5288('0xa'));var ejs=require(_0x5288('0xb'));var fs=require('fs');var fs_extra=require(_0x5288('0xc'));var _=require('lodash');var squel=require(_0x5288('0xd'));var crypto=require(_0x5288('0xe'));var jsforce=require(_0x5288('0xf'));var deskjs=require(_0x5288('0x10'));var toCsv=require(_0x5288('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5288('0x11'));var as=require(_0x5288('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5288('0x13'))(_0x5288('0x14'));var utils=require(_0x5288('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5288('0x16'));var db=require(_0x5288('0x17'))['db'];function respondWithStatusCode(_0x4f6881,_0x4bab84){_0x4bab84=_0x4bab84||0xcc;return function(_0x4d6a5b){if(_0x4d6a5b){return _0x4f6881[_0x5288('0x18')](_0x4bab84);}return _0x4f6881['status'](_0x4bab84)[_0x5288('0x19')]();};}function respondWithResult(_0x343ea1,_0x326cb2){_0x326cb2=_0x326cb2||0xc8;return function(_0x2c7692){if(_0x2c7692){return _0x343ea1[_0x5288('0x1a')](_0x326cb2)['json'](_0x2c7692);}};}function respondWithFilteredResult(_0x4b795f,_0x4780ea){return function(_0x306fe6){if(_0x306fe6){var _0xefd886=typeof _0x4780ea[_0x5288('0x1b')]===_0x5288('0x1c')&&typeof _0x4780ea[_0x5288('0x1d')]==='undefined';var _0x46bebd=_0x306fe6[_0x5288('0x1e')];var _0x51f1d5=_0xefd886?0x0:_0x4780ea[_0x5288('0x1b')];var _0x213e9b=_0xefd886?_0x306fe6['count']:_0x4780ea[_0x5288('0x1b')]+_0x4780ea[_0x5288('0x1d')];var _0x43b674;if(_0x213e9b>=_0x46bebd){_0x213e9b=_0x46bebd;_0x43b674=0xc8;}else{_0x43b674=0xce;}_0x4b795f[_0x5288('0x1a')](_0x43b674);return _0x4b795f['set'](_0x5288('0x1f'),_0x51f1d5+'-'+_0x213e9b+'/'+_0x46bebd)['json'](_0x306fe6);}return null;};}function patchUpdates(_0x562cbf){return function(_0xe5a6c){try{jsonpatch[_0x5288('0x20')](_0xe5a6c,_0x562cbf,!![]);}catch(_0x3c20f5){return BPromise[_0x5288('0x21')](_0x3c20f5);}return _0xe5a6c[_0x5288('0x22')]();};}function saveUpdates(_0x5cbadf,_0x530922){return function(_0x1c3ffe){if(_0x1c3ffe){return _0x1c3ffe[_0x5288('0x23')](_0x5cbadf)[_0x5288('0x24')](function(_0x29e5f7){return _0x29e5f7;});}return null;};}function removeEntity(_0x562156,_0x4e71a9){return function(_0x2b801c){if(_0x2b801c){return _0x2b801c[_0x5288('0x25')]()[_0x5288('0x24')](function(){var _0x492afe=_0x2b801c['get']({'plain':!![]});var _0x24bc96=_0x5288('0x26');return db[_0x5288('0x27')]['destroy']({'where':{'type':_0x24bc96,'resourceId':_0x492afe['id']}})[_0x5288('0x24')](function(){return _0x2b801c;});})[_0x5288('0x24')](function(){_0x562156[_0x5288('0x1a')](0xcc)[_0x5288('0x19')]();});}};}function handleEntityNotFound(_0x482daa,_0xe5deda){return function(_0x3a56c7){if(!_0x3a56c7){_0x482daa['sendStatus'](0x194);}return _0x3a56c7;};}function handleError(_0x1efaa2,_0x2b1b28){_0x2b1b28=_0x2b1b28||0x1f4;return function(_0x285651){logger[_0x5288('0x28')](_0x285651['stack']);if(_0x285651['name']){delete _0x285651[_0x5288('0x29')];}_0x1efaa2['status'](_0x2b1b28)[_0x5288('0x2a')](_0x285651);};}exports[_0x5288('0x2b')]=function(_0x1db0d6,_0x49b87f){var _0x1db40d={},_0x11b2a1={},_0x403578={'count':0x0,'rows':[]};var _0x39d509=_[_0x5288('0x2c')](db['SquareOdbc'][_0x5288('0x2d')],function(_0x471871){return{'name':_0x471871[_0x5288('0x2e')],'type':_0x471871[_0x5288('0x2f')][_0x5288('0x30')]};});_0x11b2a1[_0x5288('0x31')]=_[_0x5288('0x2c')](_0x39d509,'name');_0x11b2a1['query']=_[_0x5288('0x32')](_0x1db0d6[_0x5288('0x33')]);_0x11b2a1[_0x5288('0x34')]=_['intersection'](_0x11b2a1[_0x5288('0x31')],_0x11b2a1[_0x5288('0x33')]);_0x1db40d[_0x5288('0x35')]=_[_0x5288('0x36')](_0x11b2a1['model'],qs['fields'](_0x1db0d6[_0x5288('0x33')][_0x5288('0x37')]));_0x1db40d[_0x5288('0x35')]=_0x1db40d[_0x5288('0x35')][_0x5288('0x38')]?_0x1db40d[_0x5288('0x35')]:_0x11b2a1[_0x5288('0x31')];if(!_0x1db0d6[_0x5288('0x33')][_0x5288('0x39')](_0x5288('0x3a'))){_0x1db40d[_0x5288('0x1d')]=qs['limit'](_0x1db0d6['query'][_0x5288('0x1d')]);_0x1db40d[_0x5288('0x1b')]=qs[_0x5288('0x1b')](_0x1db0d6[_0x5288('0x33')]['offset']);}_0x1db40d[_0x5288('0x3b')]=qs['sort'](_0x1db0d6[_0x5288('0x33')][_0x5288('0x3c')]);_0x1db40d[_0x5288('0x3d')]=qs[_0x5288('0x34')](_[_0x5288('0x3e')](_0x1db0d6[_0x5288('0x33')],_0x11b2a1[_0x5288('0x34')]),_0x39d509);if(_0x1db0d6[_0x5288('0x33')]['filter']){_0x1db40d[_0x5288('0x3d')]=_[_0x5288('0x3f')](_0x1db40d[_0x5288('0x3d')],{'$or':_[_0x5288('0x2c')](_0x39d509,function(_0x3866c7){if(_0x3866c7['type']!==_0x5288('0x40')){var _0x43ffbb={};_0x43ffbb[_0x3866c7['name']]={'$like':'%'+_0x1db0d6[_0x5288('0x33')]['filter']+'%'};return _0x43ffbb;}})});}_0x1db40d=_[_0x5288('0x3f')]({},_0x1db40d,_0x1db0d6['options']);var _0x54085f={'where':_0x1db40d[_0x5288('0x3d')]};return db['SquareOdbc']['count'](_0x54085f)[_0x5288('0x24')](function(_0x323c5f){_0x403578[_0x5288('0x1e')]=_0x323c5f;if(_0x1db0d6[_0x5288('0x33')][_0x5288('0x41')]){_0x1db40d[_0x5288('0x42')]=[{'all':!![]}];}return db[_0x5288('0x43')][_0x5288('0x44')](_0x1db40d);})[_0x5288('0x24')](function(_0x5a1d85){_0x403578[_0x5288('0x45')]=_0x5a1d85;return _0x403578;})[_0x5288('0x24')](respondWithFilteredResult(_0x49b87f,_0x1db40d))[_0x5288('0x46')](handleError(_0x49b87f,null));};exports[_0x5288('0x47')]=function(_0x3a3c54,_0x181897){var _0x21f20e={'raw':!![],'where':{'id':_0x3a3c54[_0x5288('0x48')]['id']}},_0x5ce2a0={};_0x5ce2a0[_0x5288('0x31')]=_[_0x5288('0x32')](db[_0x5288('0x43')][_0x5288('0x2d')]);_0x5ce2a0[_0x5288('0x33')]=_[_0x5288('0x32')](_0x3a3c54[_0x5288('0x33')]);_0x5ce2a0[_0x5288('0x34')]=_[_0x5288('0x36')](_0x5ce2a0['model'],_0x5ce2a0[_0x5288('0x33')]);_0x21f20e[_0x5288('0x35')]=_[_0x5288('0x36')](_0x5ce2a0[_0x5288('0x31')],qs[_0x5288('0x37')](_0x3a3c54[_0x5288('0x33')][_0x5288('0x37')]));_0x21f20e['attributes']=_0x21f20e[_0x5288('0x35')][_0x5288('0x38')]?_0x21f20e['attributes']:_0x5ce2a0[_0x5288('0x31')];if(_0x3a3c54['query'][_0x5288('0x41')]){_0x21f20e[_0x5288('0x42')]=[{'all':!![]}];}_0x21f20e=_[_0x5288('0x3f')]({},_0x21f20e,_0x3a3c54['options']);return db[_0x5288('0x43')]['find'](_0x21f20e)[_0x5288('0x24')](handleEntityNotFound(_0x181897,null))['then'](respondWithResult(_0x181897,null))[_0x5288('0x46')](handleError(_0x181897,null));};exports[_0x5288('0x49')]=function(_0x2a4fdb,_0x593be9){return db['SquareOdbc']['create'](_0x2a4fdb['body'],{})[_0x5288('0x24')](function(_0x5d29b0){var _0x14d48e=_0x2a4fdb[_0x5288('0x4a')]['get']({'plain':!![]});if(!_0x14d48e)throw new Error(_0x5288('0x4b'));if(_0x14d48e[_0x5288('0x4c')]===_0x5288('0x4a')){var _0x2c82e7=_0x5d29b0[_0x5288('0x4d')]({'plain':!![]});var _0xe95dd5=_0x5288('0x26');return db['UserProfileSection']['find']({'where':{'name':_0xe95dd5,'userProfileId':_0x14d48e['userProfileId']},'raw':!![]})[_0x5288('0x24')](function(_0x79419b){if(_0x79419b&&_0x79419b['autoAssociation']===0x0){return db[_0x5288('0x27')]['create']({'name':_0x2c82e7[_0x5288('0x29')],'resourceId':_0x2c82e7['id'],'type':_0x79419b[_0x5288('0x29')],'sectionId':_0x79419b['id']},{})[_0x5288('0x24')](function(){return _0x5d29b0;});}else{return _0x5d29b0;}})[_0x5288('0x46')](function(_0x4db433){logger[_0x5288('0x28')](_0x5288('0x4e'),_0x4db433);throw _0x4db433;});}return _0x5d29b0;})[_0x5288('0x24')](respondWithResult(_0x593be9,0xc9))['catch'](handleError(_0x593be9,null));};exports[_0x5288('0x23')]=function(_0x313891,_0x5c72b3){if(_0x313891[_0x5288('0x4f')]['id']){delete _0x313891[_0x5288('0x4f')]['id'];}return db[_0x5288('0x43')][_0x5288('0x50')]({'where':{'id':_0x313891['params']['id']}})[_0x5288('0x24')](handleEntityNotFound(_0x5c72b3,null))['then'](saveUpdates(_0x313891[_0x5288('0x4f')],null))[_0x5288('0x24')](respondWithResult(_0x5c72b3,null))[_0x5288('0x46')](handleError(_0x5c72b3,null));};exports[_0x5288('0x25')]=function(_0x16b2da,_0x3c2bac){return db[_0x5288('0x43')]['find']({'where':{'id':_0x16b2da[_0x5288('0x48')]['id']}})[_0x5288('0x24')](handleEntityNotFound(_0x3c2bac,null))[_0x5288('0x24')](removeEntity(_0x3c2bac,null))[_0x5288('0x46')](handleError(_0x3c2bac,null));};exports[_0x5288('0x51')]=function(_0x468c6a,_0x4ec1ba,_0x4b5736){var _0x437695;return db[_0x5288('0x43')]['find']({'where':{'id':_0x468c6a[_0x5288('0x48')]['id']},'attributes':['id',_0x5288('0x52')]})[_0x5288('0x24')](handleEntityNotFound(_0x4ec1ba,null))[_0x5288('0x24')](function(_0x4cf78b){if(_0x4cf78b){var _0x365d5c=require(_0x5288('0x53'))();_0x365d5c[_0x5288('0x54')](_0x4cf78b['dsn']);_0x365d5c[_0x5288('0x55')]();return _0x4cf78b;}})['then'](respondWithResult(_0x4ec1ba,null))[_0x5288('0x46')](handleError(_0x4ec1ba,null));}; \ No newline at end of file +var _0x7fac=['key','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','count','includeAll','include','rows','show','params','model','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','dsn','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','get','ODBC','UserProfileResource','end','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName'];(function(_0x30fe20,_0x497c46){var _0xba73a7=function(_0x559bc2){while(--_0x559bc2){_0x30fe20['push'](_0x30fe20['shift']());}};_0xba73a7(++_0x497c46);}(_0x7fac,0x137));var _0xc7fa=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x7fac[_0x4ae625];return _0x31accf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc7fa('0x0'));var zipdir=require(_0xc7fa('0x1'));var jsonpatch=require(_0xc7fa('0x2'));var rp=require(_0xc7fa('0x3'));var moment=require(_0xc7fa('0x4'));var BPromise=require(_0xc7fa('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc7fa('0x6'));var sox=require(_0xc7fa('0x7'));var csv=require(_0xc7fa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc7fa('0x9'));var _=require(_0xc7fa('0xa'));var squel=require(_0xc7fa('0xb'));var crypto=require('crypto');var jsforce=require(_0xc7fa('0xc'));var deskjs=require(_0xc7fa('0xd'));var toCsv=require(_0xc7fa('0x8'));var querystring=require(_0xc7fa('0xe'));var Papa=require('papaparse');var Redis=require(_0xc7fa('0xf'));var authService=require(_0xc7fa('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc7fa('0x11'));var logger=require(_0xc7fa('0x12'))(_0xc7fa('0x13'));var utils=require(_0xc7fa('0x14'));var config=require(_0xc7fa('0x15'));var licenseUtil=require(_0xc7fa('0x16'));var db=require(_0xc7fa('0x17'))['db'];function respondWithStatusCode(_0x535398,_0x343dd3){_0x343dd3=_0x343dd3||0xcc;return function(_0x46d97a){if(_0x46d97a){return _0x535398[_0xc7fa('0x18')](_0x343dd3);}return _0x535398[_0xc7fa('0x19')](_0x343dd3)['end']();};}function respondWithResult(_0x1a9e99,_0x4c3208){_0x4c3208=_0x4c3208||0xc8;return function(_0x31b8e4){if(_0x31b8e4){return _0x1a9e99[_0xc7fa('0x19')](_0x4c3208)[_0xc7fa('0x1a')](_0x31b8e4);}};}function respondWithFilteredResult(_0x2caea6,_0x45f008){return function(_0x1c494e){if(_0x1c494e){var _0xe82b99=typeof _0x45f008[_0xc7fa('0x1b')]===_0xc7fa('0x1c')&&typeof _0x45f008[_0xc7fa('0x1d')]==='undefined';var _0x224333=_0x1c494e['count'];var _0x4e74a2=_0xe82b99?0x0:_0x45f008['offset'];var _0x222f98=_0xe82b99?_0x1c494e['count']:_0x45f008['offset']+_0x45f008[_0xc7fa('0x1d')];var _0x21ac05;if(_0x222f98>=_0x224333){_0x222f98=_0x224333;_0x21ac05=0xc8;}else{_0x21ac05=0xce;}_0x2caea6['status'](_0x21ac05);return _0x2caea6[_0xc7fa('0x1e')](_0xc7fa('0x1f'),_0x4e74a2+'-'+_0x222f98+'/'+_0x224333)[_0xc7fa('0x1a')](_0x1c494e);}return null;};}function patchUpdates(_0x268ce5){return function(_0x13e577){try{jsonpatch[_0xc7fa('0x20')](_0x13e577,_0x268ce5,!![]);}catch(_0x4acd44){return BPromise[_0xc7fa('0x21')](_0x4acd44);}return _0x13e577['save']();};}function saveUpdates(_0x25e1a5,_0x3ce301){return function(_0x144da8){if(_0x144da8){return _0x144da8['update'](_0x25e1a5)[_0xc7fa('0x22')](function(_0x58047e){return _0x58047e;});}return null;};}function removeEntity(_0x367778,_0x2835cd){return function(_0x63cc2f){if(_0x63cc2f){return _0x63cc2f[_0xc7fa('0x23')]()[_0xc7fa('0x22')](function(){var _0xce78dd=_0x63cc2f[_0xc7fa('0x24')]({'plain':!![]});var _0x157cb4=_0xc7fa('0x25');return db[_0xc7fa('0x26')][_0xc7fa('0x23')]({'where':{'type':_0x157cb4,'resourceId':_0xce78dd['id']}})[_0xc7fa('0x22')](function(){return _0x63cc2f;});})[_0xc7fa('0x22')](function(){_0x367778[_0xc7fa('0x19')](0xcc)[_0xc7fa('0x27')]();});}};}function handleEntityNotFound(_0x861939,_0x44f46e){return function(_0x4c43aa){if(!_0x4c43aa){_0x861939[_0xc7fa('0x18')](0x194);}return _0x4c43aa;};}function handleError(_0x1bab69,_0x276230){_0x276230=_0x276230||0x1f4;return function(_0x1741a8){logger[_0xc7fa('0x28')](_0x1741a8[_0xc7fa('0x29')]);if(_0x1741a8[_0xc7fa('0x2a')]){delete _0x1741a8[_0xc7fa('0x2a')];}_0x1bab69[_0xc7fa('0x19')](_0x276230)[_0xc7fa('0x2b')](_0x1741a8);};}exports[_0xc7fa('0x2c')]=function(_0x1249a7,_0x55d024){var _0x12dc55={},_0x4ef065={},_0x17b4bf={'count':0x0,'rows':[]};var _0x37a103=_[_0xc7fa('0x2d')](db[_0xc7fa('0x2e')][_0xc7fa('0x2f')],function(_0x2e2c8f){return{'name':_0x2e2c8f[_0xc7fa('0x30')],'type':_0x2e2c8f['type'][_0xc7fa('0x31')]};});_0x4ef065['model']=_[_0xc7fa('0x2d')](_0x37a103,'name');_0x4ef065[_0xc7fa('0x32')]=_[_0xc7fa('0x33')](_0x1249a7[_0xc7fa('0x32')]);_0x4ef065[_0xc7fa('0x34')]=_[_0xc7fa('0x35')](_0x4ef065['model'],_0x4ef065[_0xc7fa('0x32')]);_0x12dc55['attributes']=_[_0xc7fa('0x35')](_0x4ef065['model'],qs['fields'](_0x1249a7[_0xc7fa('0x32')][_0xc7fa('0x36')]));_0x12dc55[_0xc7fa('0x37')]=_0x12dc55[_0xc7fa('0x37')][_0xc7fa('0x38')]?_0x12dc55['attributes']:_0x4ef065['model'];if(!_0x1249a7['query'][_0xc7fa('0x39')](_0xc7fa('0x3a'))){_0x12dc55[_0xc7fa('0x1d')]=qs[_0xc7fa('0x1d')](_0x1249a7[_0xc7fa('0x32')][_0xc7fa('0x1d')]);_0x12dc55[_0xc7fa('0x1b')]=qs[_0xc7fa('0x1b')](_0x1249a7['query'][_0xc7fa('0x1b')]);}_0x12dc55[_0xc7fa('0x3b')]=qs[_0xc7fa('0x3c')](_0x1249a7['query'][_0xc7fa('0x3c')]);_0x12dc55[_0xc7fa('0x3d')]=qs[_0xc7fa('0x34')](_[_0xc7fa('0x3e')](_0x1249a7['query'],_0x4ef065[_0xc7fa('0x34')]),_0x37a103);if(_0x1249a7[_0xc7fa('0x32')]['filter']){_0x12dc55[_0xc7fa('0x3d')]=_[_0xc7fa('0x3f')](_0x12dc55['where'],{'$or':_[_0xc7fa('0x2d')](_0x37a103,function(_0x5fe7eb){if(_0x5fe7eb[_0xc7fa('0x40')]!==_0xc7fa('0x41')){var _0x1a68c1={};_0x1a68c1[_0x5fe7eb['name']]={'$like':'%'+_0x1249a7[_0xc7fa('0x32')][_0xc7fa('0x42')]+'%'};return _0x1a68c1;}})});}_0x12dc55=_['merge']({},_0x12dc55,_0x1249a7[_0xc7fa('0x43')]);var _0x2feca7={'where':_0x12dc55[_0xc7fa('0x3d')]};return db['SquareOdbc'][_0xc7fa('0x44')](_0x2feca7)[_0xc7fa('0x22')](function(_0x383b09){_0x17b4bf[_0xc7fa('0x44')]=_0x383b09;if(_0x1249a7[_0xc7fa('0x32')][_0xc7fa('0x45')]){_0x12dc55[_0xc7fa('0x46')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x12dc55);})[_0xc7fa('0x22')](function(_0x156005){_0x17b4bf[_0xc7fa('0x47')]=_0x156005;return _0x17b4bf;})['then'](respondWithFilteredResult(_0x55d024,_0x12dc55))['catch'](handleError(_0x55d024,null));};exports[_0xc7fa('0x48')]=function(_0x4f92b0,_0x2504b2){var _0x1b0d9d={'raw':!![],'where':{'id':_0x4f92b0[_0xc7fa('0x49')]['id']}},_0x54f626={};_0x54f626['model']=_[_0xc7fa('0x33')](db[_0xc7fa('0x2e')]['rawAttributes']);_0x54f626['query']=_[_0xc7fa('0x33')](_0x4f92b0[_0xc7fa('0x32')]);_0x54f626['filters']=_[_0xc7fa('0x35')](_0x54f626[_0xc7fa('0x4a')],_0x54f626[_0xc7fa('0x32')]);_0x1b0d9d[_0xc7fa('0x37')]=_[_0xc7fa('0x35')](_0x54f626[_0xc7fa('0x4a')],qs[_0xc7fa('0x36')](_0x4f92b0[_0xc7fa('0x32')][_0xc7fa('0x36')]));_0x1b0d9d[_0xc7fa('0x37')]=_0x1b0d9d[_0xc7fa('0x37')][_0xc7fa('0x38')]?_0x1b0d9d[_0xc7fa('0x37')]:_0x54f626[_0xc7fa('0x4a')];if(_0x4f92b0[_0xc7fa('0x32')]['includeAll']){_0x1b0d9d[_0xc7fa('0x46')]=[{'all':!![]}];}_0x1b0d9d=_[_0xc7fa('0x3f')]({},_0x1b0d9d,_0x4f92b0[_0xc7fa('0x43')]);return db[_0xc7fa('0x2e')][_0xc7fa('0x4b')](_0x1b0d9d)[_0xc7fa('0x22')](handleEntityNotFound(_0x2504b2,null))[_0xc7fa('0x22')](respondWithResult(_0x2504b2,null))[_0xc7fa('0x4c')](handleError(_0x2504b2,null));};exports['create']=function(_0x1a7920,_0x134545){return db[_0xc7fa('0x2e')][_0xc7fa('0x4d')](_0x1a7920['body'],{})[_0xc7fa('0x22')](function(_0x37c193){var _0x54180f=_0x1a7920['user']['get']({'plain':!![]});if(!_0x54180f)throw new Error(_0xc7fa('0x4e'));if(_0x54180f[_0xc7fa('0x4f')]===_0xc7fa('0x50')){var _0x1f4d0e=_0x37c193[_0xc7fa('0x24')]({'plain':!![]});var _0x105660=_0xc7fa('0x25');return db['UserProfileSection'][_0xc7fa('0x4b')]({'where':{'name':_0x105660,'userProfileId':_0x54180f[_0xc7fa('0x51')]},'raw':!![]})[_0xc7fa('0x22')](function(_0xbfbc08){if(_0xbfbc08&&_0xbfbc08[_0xc7fa('0x52')]===0x0){return db[_0xc7fa('0x26')][_0xc7fa('0x4d')]({'name':_0x1f4d0e['name'],'resourceId':_0x1f4d0e['id'],'type':_0xbfbc08[_0xc7fa('0x2a')],'sectionId':_0xbfbc08['id']},{})[_0xc7fa('0x22')](function(){return _0x37c193;});}else{return _0x37c193;}})[_0xc7fa('0x4c')](function(_0x26e930){logger['error'](_0xc7fa('0x53'),_0x26e930);throw _0x26e930;});}return _0x37c193;})['then'](respondWithResult(_0x134545,0xc9))[_0xc7fa('0x4c')](handleError(_0x134545,null));};exports[_0xc7fa('0x54')]=function(_0x161a53,_0x36e1c6){if(_0x161a53['body']['id']){delete _0x161a53[_0xc7fa('0x55')]['id'];}return db[_0xc7fa('0x2e')][_0xc7fa('0x4b')]({'where':{'id':_0x161a53[_0xc7fa('0x49')]['id']}})[_0xc7fa('0x22')](handleEntityNotFound(_0x36e1c6,null))[_0xc7fa('0x22')](saveUpdates(_0x161a53[_0xc7fa('0x55')],null))[_0xc7fa('0x22')](respondWithResult(_0x36e1c6,null))[_0xc7fa('0x4c')](handleError(_0x36e1c6,null));};exports[_0xc7fa('0x23')]=function(_0x3d7325,_0x5095fe){return db[_0xc7fa('0x2e')]['find']({'where':{'id':_0x3d7325[_0xc7fa('0x49')]['id']}})[_0xc7fa('0x22')](handleEntityNotFound(_0x5095fe,null))[_0xc7fa('0x22')](removeEntity(_0x5095fe,null))[_0xc7fa('0x4c')](handleError(_0x5095fe,null));};exports[_0xc7fa('0x56')]=function(_0x2afc0b,_0xe1ac19,_0x2b5008){var _0x2c4402;return db['SquareOdbc']['find']({'where':{'id':_0x2afc0b[_0xc7fa('0x49')]['id']},'attributes':['id',_0xc7fa('0x57')]})[_0xc7fa('0x22')](handleEntityNotFound(_0xe1ac19,null))[_0xc7fa('0x22')](function(_0x15c7ac){if(_0x15c7ac){var _0x5b7278=require('odbc')();_0x5b7278[_0xc7fa('0x58')](_0x15c7ac['dsn']);_0x5b7278[_0xc7fa('0x59')]();return _0x15c7ac;}})[_0xc7fa('0x22')](respondWithResult(_0xe1ac19,null))['catch'](handleError(_0xe1ac19,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index d498c4e..31696c9 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 _0x8336=['./squareOdbc.attributes','exports','define','square_odbc','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x78e4b4,_0x2a791e){var _0x81139f=function(_0x5eef79){while(--_0x5eef79){_0x78e4b4['push'](_0x78e4b4['shift']());}};_0x81139f(++_0x2a791e);}(_0x8336,0xa0));var _0x6833=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0x8336[_0x3e25c1];return _0x52e7f2;};'use strict';var _=require(_0x6833('0x0'));var util=require(_0x6833('0x1'));var logger=require(_0x6833('0x2'))(_0x6833('0x3'));var moment=require('moment');var BPromise=require(_0x6833('0x4'));var rp=require(_0x6833('0x5'));var fs=require('fs');var path=require(_0x6833('0x6'));var rimraf=require(_0x6833('0x7'));var config=require(_0x6833('0x8'));var attributes=require(_0x6833('0x9'));module[_0x6833('0xa')]=function(_0x234a85,_0x12256d){return _0x234a85[_0x6833('0xb')]('SquareOdbc',attributes,{'tableName':_0x6833('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda63=['square_odbc','lodash','util','api','path','../../config/environment','./squareOdbc.attributes','define','SquareOdbc'];(function(_0x5b3614,_0x137a0a){var _0x2f0295=function(_0x3d92a8){while(--_0x3d92a8){_0x5b3614['push'](_0x5b3614['shift']());}};_0x2f0295(++_0x137a0a);}(_0xda63,0xd0));var _0x3da6=function(_0x5c16ad,_0x24312a){_0x5c16ad=_0x5c16ad-0x0;var _0xf9d36e=_0xda63[_0x5c16ad];return _0xf9d36e;};'use strict';var _=require(_0x3da6('0x0'));var util=require(_0x3da6('0x1'));var logger=require('../../config/logger')(_0x3da6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3da6('0x3'));var rimraf=require('rimraf');var config=require(_0x3da6('0x4'));var attributes=require(_0x3da6('0x5'));module['exports']=function(_0x21b31a,_0x232818){return _0x21b31a[_0x3da6('0x6')](_0x3da6('0x7'),attributes,{'tableName':_0x3da6('0x8'),'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 201f151..dc80173 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 _0x02de=['SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x184d50,_0x1b1c64){var _0x56e8e5=function(_0xda0ea9){while(--_0xda0ea9){_0x184d50['push'](_0x184d50['shift']());}};_0x56e8e5(++_0x1b1c64);}(_0x02de,0x92));var _0xe02d=function(_0x318331,_0xf58c63){_0x318331=_0x318331-0x0;var _0x1679a5=_0x02de[_0x318331];return _0x1679a5;};'use strict';var _=require(_0xe02d('0x0'));var util=require(_0xe02d('0x1'));var moment=require(_0xe02d('0x2'));var BPromise=require(_0xe02d('0x3'));var rs=require(_0xe02d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe02d('0x5'));var logger=require(_0xe02d('0x6'))(_0xe02d('0x7'));var config=require('../../config/environment');var jayson=require(_0xe02d('0x8'));var client=jayson[_0xe02d('0x9')][_0xe02d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d0493,_0x280523,_0x351e4a){return new BPromise(function(_0x166296,_0x7a6a61){return client[_0xe02d('0xb')](_0x4d0493,_0x351e4a)[_0xe02d('0xc')](function(_0x18f8ed){logger[_0xe02d('0xd')](_0xe02d('0xe'),_0x280523,_0xe02d('0xf'));logger[_0xe02d('0x10')](_0xe02d('0x11'),_0x280523,_0xe02d('0xf'),JSON[_0xe02d('0x12')](_0x18f8ed));if(_0x18f8ed['error']){if(_0x18f8ed[_0xe02d('0x13')][_0xe02d('0x14')]===0x1f4){logger[_0xe02d('0x13')](_0xe02d('0xe'),_0x280523,_0x18f8ed[_0xe02d('0x13')][_0xe02d('0x15')]);return _0x7a6a61(_0x18f8ed['error'][_0xe02d('0x15')]);}logger[_0xe02d('0x13')](_0xe02d('0xe'),_0x280523,_0x18f8ed['error'][_0xe02d('0x15')]);return _0x166296(_0x18f8ed[_0xe02d('0x13')][_0xe02d('0x15')]);}else{logger[_0xe02d('0xd')](_0xe02d('0xe'),_0x280523,_0xe02d('0xf'));_0x166296(_0x18f8ed[_0xe02d('0x16')][_0xe02d('0x15')]);}})[_0xe02d('0x17')](function(_0x5529bc){logger[_0xe02d('0x13')](_0xe02d('0xe'),_0x280523,_0x5529bc);_0x7a6a61(_0x5529bc);});});}exports[_0xe02d('0x18')]=function(_0x11a920){var _0x23ac5a=this;return new Promise(function(_0x262eb0,_0x480076){return db['SquareOdbc']['find']({'raw':_0x11a920[_0xe02d('0x19')]?_0x11a920['options'][_0xe02d('0x1a')]===undefined?!![]:![]:!![],'where':_0x11a920[_0xe02d('0x19')]?_0x11a920[_0xe02d('0x19')][_0xe02d('0x1b')]||null:null,'attributes':_0x11a920[_0xe02d('0x19')]?_0x11a920[_0xe02d('0x19')][_0xe02d('0x1c')]||null:null,'include':_0x11a920[_0xe02d('0x19')]?_0x11a920['options'][_0xe02d('0x1d')]?_[_0xe02d('0x1e')](_0x11a920[_0xe02d('0x19')]['include'],function(_0x31fee2){return{'model':db[_0x31fee2['model']],'as':_0x31fee2['as'],'attributes':_0x31fee2[_0xe02d('0x1c')],'include':_0x31fee2[_0xe02d('0x1d')]?_['map'](_0x31fee2[_0xe02d('0x1d')],function(_0x5774e1){return{'model':db[_0x5774e1[_0xe02d('0x1f')]],'as':_0x5774e1['as'],'attributes':_0x5774e1[_0xe02d('0x1c')],'include':_0x5774e1[_0xe02d('0x1d')]?_[_0xe02d('0x1e')](_0x5774e1['include'],function(_0x2bda3e){return{'model':db[_0x2bda3e['model']],'as':_0x2bda3e['as'],'attributes':_0x2bda3e[_0xe02d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x152a46){logger[_0xe02d('0xd')](_0xe02d('0x18'),_0x11a920);logger[_0xe02d('0x10')](_0xe02d('0x18'),_0x11a920,JSON[_0xe02d('0x12')](_0x152a46));_0x262eb0(_0x152a46);})[_0xe02d('0x17')](function(_0x5e60bf){logger[_0xe02d('0x13')](_0xe02d('0x18'),_0x5e60bf[_0xe02d('0x15')],_0x11a920);_0x480076(_0x23ac5a[_0xe02d('0x13')](0x1f4,_0x5e60bf[_0xe02d('0x15')]));});});}; \ No newline at end of file +var _0x07a5=['SquareOdbc','find','options','raw','attributes','map','include','model','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSquareOdbc'];(function(_0x36b7e7,_0x5724ac){var _0x3e6ca5=function(_0x147dee){while(--_0x147dee){_0x36b7e7['push'](_0x36b7e7['shift']());}};_0x3e6ca5(++_0x5724ac);}(_0x07a5,0x18e));var _0x507a=function(_0x8a654b,_0x4be2f9){_0x8a654b=_0x8a654b-0x0;var _0x94bfbb=_0x07a5[_0x8a654b];return _0x94bfbb;};'use strict';var _=require(_0x507a('0x0'));var util=require(_0x507a('0x1'));var moment=require(_0x507a('0x2'));var BPromise=require('bluebird');var rs=require(_0x507a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x507a('0x4'))['db'];var utils=require(_0x507a('0x5'));var logger=require(_0x507a('0x6'))(_0x507a('0x7'));var config=require(_0x507a('0x8'));var jayson=require(_0x507a('0x9'));var client=jayson['client'][_0x507a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x574e58,_0x4e4b1b,_0x16e04a){return new BPromise(function(_0xc6b536,_0x1ad4bd){return client[_0x507a('0xb')](_0x574e58,_0x16e04a)['then'](function(_0x50c6ab){logger[_0x507a('0xc')](_0x507a('0xd'),_0x4e4b1b,_0x507a('0xe'));logger[_0x507a('0xf')](_0x507a('0x10'),_0x4e4b1b,_0x507a('0xe'),JSON[_0x507a('0x11')](_0x50c6ab));if(_0x50c6ab['error']){if(_0x50c6ab[_0x507a('0x12')]['code']===0x1f4){logger[_0x507a('0x12')](_0x507a('0xd'),_0x4e4b1b,_0x50c6ab[_0x507a('0x12')][_0x507a('0x13')]);return _0x1ad4bd(_0x50c6ab[_0x507a('0x12')][_0x507a('0x13')]);}logger[_0x507a('0x12')](_0x507a('0xd'),_0x4e4b1b,_0x50c6ab[_0x507a('0x12')][_0x507a('0x13')]);return _0xc6b536(_0x50c6ab[_0x507a('0x12')]['message']);}else{logger[_0x507a('0xc')](_0x507a('0xd'),_0x4e4b1b,_0x507a('0xe'));_0xc6b536(_0x50c6ab['result'][_0x507a('0x13')]);}})[_0x507a('0x14')](function(_0x28560a){logger['error'](_0x507a('0xd'),_0x4e4b1b,_0x28560a);_0x1ad4bd(_0x28560a);});});}exports[_0x507a('0x15')]=function(_0x23db91){var _0x4c66e7=this;return new Promise(function(_0x16989c,_0x551a2e){return db[_0x507a('0x16')][_0x507a('0x17')]({'raw':_0x23db91[_0x507a('0x18')]?_0x23db91['options'][_0x507a('0x19')]===undefined?!![]:![]:!![],'where':_0x23db91[_0x507a('0x18')]?_0x23db91['options']['where']||null:null,'attributes':_0x23db91['options']?_0x23db91[_0x507a('0x18')][_0x507a('0x1a')]||null:null,'include':_0x23db91[_0x507a('0x18')]?_0x23db91[_0x507a('0x18')]['include']?_[_0x507a('0x1b')](_0x23db91[_0x507a('0x18')][_0x507a('0x1c')],function(_0x52ef87){return{'model':db[_0x52ef87['model']],'as':_0x52ef87['as'],'attributes':_0x52ef87[_0x507a('0x1a')],'include':_0x52ef87[_0x507a('0x1c')]?_[_0x507a('0x1b')](_0x52ef87[_0x507a('0x1c')],function(_0x5625c4){return{'model':db[_0x5625c4['model']],'as':_0x5625c4['as'],'attributes':_0x5625c4[_0x507a('0x1a')],'include':_0x5625c4[_0x507a('0x1c')]?_[_0x507a('0x1b')](_0x5625c4[_0x507a('0x1c')],function(_0x453348){return{'model':db[_0x453348[_0x507a('0x1d')]],'as':_0x453348['as'],'attributes':_0x453348['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x70843b){logger[_0x507a('0xc')](_0x507a('0x15'),_0x23db91);logger[_0x507a('0xf')](_0x507a('0x15'),_0x23db91,JSON[_0x507a('0x11')](_0x70843b));_0x16989c(_0x70843b);})[_0x507a('0x14')](function(_0x45dc96){logger[_0x507a('0x12')]('ShowSquareOdbc',_0x45dc96['message'],_0x23db91);_0x551a2e(_0x4c66e7[_0x507a('0x12')](0x1f4,_0x45dc96[_0x507a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 5be76d1..1b39311 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 _0x0699=['get','isAuthenticated','index','/:id','/:id/users','getUsers','post','create','addUsers','put','update','delete','removeUsers','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller'];(function(_0x4e5294,_0x21c47d){var _0x358dce=function(_0x1e6d11){while(--_0x1e6d11){_0x4e5294['push'](_0x4e5294['shift']());}};_0x358dce(++_0x21c47d);}(_0x0699,0x1db));var _0x9069=function(_0x239b50,_0x5de63d){_0x239b50=_0x239b50-0x0;var _0x2459a9=_0x0699[_0x239b50];return _0x2459a9;};'use strict';var multer=require(_0x9069('0x0'));var util=require('util');var path=require(_0x9069('0x1'));var timeout=require('connect-timeout');var express=require(_0x9069('0x2'));var router=express[_0x9069('0x3')]();var fs_extra=require(_0x9069('0x4'));var auth=require(_0x9069('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9069('0x6'));var controller=require(_0x9069('0x7'));router[_0x9069('0x8')]('/',auth[_0x9069('0x9')](),controller[_0x9069('0xa')]);router[_0x9069('0x8')](_0x9069('0xb'),auth[_0x9069('0x9')](),controller['show']);router['get'](_0x9069('0xc'),auth[_0x9069('0x9')](),controller[_0x9069('0xd')]);router[_0x9069('0xe')]('/',auth['isAuthenticated'](),controller[_0x9069('0xf')]);router[_0x9069('0xe')](_0x9069('0xc'),auth[_0x9069('0x9')](),controller[_0x9069('0x10')]);router[_0x9069('0x11')](_0x9069('0xb'),auth[_0x9069('0x9')](),controller[_0x9069('0x12')]);router['delete'](_0x9069('0xb'),auth[_0x9069('0x9')](),controller['destroy']);router[_0x9069('0x13')](_0x9069('0xc'),auth[_0x9069('0x9')](),controller[_0x9069('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd448=['getUsers','create','post','/:id/users','addUsers','put','delete','destroy','removeUsers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','/:id','show','get'];(function(_0x13fb10,_0x382867){var _0x31d15d=function(_0x5b91a1){while(--_0x5b91a1){_0x13fb10['push'](_0x13fb10['shift']());}};_0x31d15d(++_0x382867);}(_0xd448,0x172));var _0x8d44=function(_0x35f75a,_0x33b47c){_0x35f75a=_0x35f75a-0x0;var _0x3c9ac0=_0xd448[_0x35f75a];return _0x3c9ac0;};'use strict';var multer=require('multer');var util=require(_0x8d44('0x0'));var path=require(_0x8d44('0x1'));var timeout=require(_0x8d44('0x2'));var express=require(_0x8d44('0x3'));var router=express[_0x8d44('0x4')]();var fs_extra=require(_0x8d44('0x5'));var auth=require(_0x8d44('0x6'));var interaction=require(_0x8d44('0x7'));var config=require(_0x8d44('0x8'));var controller=require(_0x8d44('0x9'));router['get']('/',auth[_0x8d44('0xa')](),controller['index']);router['get'](_0x8d44('0xb'),auth[_0x8d44('0xa')](),controller[_0x8d44('0xc')]);router[_0x8d44('0xd')]('/:id/users',auth[_0x8d44('0xa')](),controller[_0x8d44('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8d44('0xf')]);router[_0x8d44('0x10')](_0x8d44('0x11'),auth['isAuthenticated'](),controller[_0x8d44('0x12')]);router[_0x8d44('0x13')](_0x8d44('0xb'),auth[_0x8d44('0xa')](),controller['update']);router[_0x8d44('0x14')](_0x8d44('0xb'),auth[_0x8d44('0xa')](),controller[_0x8d44('0x15')]);router[_0x8d44('0x14')]('/:id/users',auth[_0x8d44('0xa')](),controller[_0x8d44('0x16')]);module[_0x8d44('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index e4f9181..2df7fea 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 _0xb098=['BLOB','long','preproduction','toString','utf8','getDataValue','production','DATE','sequelize','exports','STRING','TEXT'];(function(_0x60e180,_0x4ec70e){var _0x4ea48d=function(_0x36bd1f){while(--_0x36bd1f){_0x60e180['push'](_0x60e180['shift']());}};_0x4ea48d(++_0x4ec70e);}(_0xb098,0x1c4));var _0x8b09=function(_0x148ff8,_0x2b1a91){_0x148ff8=_0x148ff8-0x0;var _0x5b7095=_0xb098[_0x148ff8];return _0x5b7095;};'use strict';var Sequelize=require(_0x8b09('0x0'));module[_0x8b09('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x8b09('0x2')]},'notes':{'type':Sequelize[_0x8b09('0x3')]},'preproduction':{'type':Sequelize[_0x8b09('0x4')](_0x8b09('0x5')),'get':function(){if(this['getDataValue'](_0x8b09('0x6'))){return this['getDataValue'](_0x8b09('0x6'))[_0x8b09('0x7')](_0x8b09('0x8'));}}},'production':{'type':Sequelize[_0x8b09('0x4')](_0x8b09('0x5')),'get':function(){if(this[_0x8b09('0x9')](_0x8b09('0xa'))){return this[_0x8b09('0x9')](_0x8b09('0xa'))[_0x8b09('0x7')]('utf8');}}},'savedAt':{'type':Sequelize[_0x8b09('0xb')]},'publishedAt':{'type':Sequelize[_0x8b09('0xb')]}}; \ No newline at end of file +var _0xb9e0=['getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long'];(function(_0x26efac,_0x21ab8a){var _0x8482e4=function(_0x14db32){while(--_0x14db32){_0x26efac['push'](_0x26efac['shift']());}};_0x8482e4(++_0x21ab8a);}(_0xb9e0,0x18c));var _0x0b9e=function(_0x246508,_0x4716f7){_0x246508=_0x246508-0x0;var _0x3f6f41=_0xb9e0[_0x246508];return _0x3f6f41;};'use strict';var Sequelize=require(_0x0b9e('0x0'));module[_0x0b9e('0x1')]={'name':{'type':Sequelize[_0x0b9e('0x2')],'unique':_0x0b9e('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0b9e('0x2')]},'notes':{'type':Sequelize[_0x0b9e('0x4')]},'preproduction':{'type':Sequelize[_0x0b9e('0x5')](_0x0b9e('0x6')),'get':function(){if(this[_0x0b9e('0x7')](_0x0b9e('0x8'))){return this[_0x0b9e('0x7')](_0x0b9e('0x8'))[_0x0b9e('0x9')](_0x0b9e('0xa'));}}},'production':{'type':Sequelize[_0x0b9e('0x5')](_0x0b9e('0x6')),'get':function(){if(this['getDataValue'](_0x0b9e('0xb'))){return this[_0x0b9e('0x7')](_0x0b9e('0xb'))[_0x0b9e('0x9')](_0x0b9e('0xa'));}}},'savedAt':{'type':Sequelize[_0x0b9e('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index e4171ec..1a6a852 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 _0x5ba1=['userSquareProject:remove','getUsers','findOne','User','order','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','update','then','destroy','SquareProjects','UserProfileResource','end','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','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','params','addUsers','ids','omit','removeUsers','emit'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x5ba1,0x66));var _0x15ba=function(_0x51842d,_0x231483){_0x51842d=_0x51842d-0x0;var _0x2dca5b=_0x5ba1[_0x51842d];return _0x2dca5b;};'use strict';var emlformat=require(_0x15ba('0x0'));var rimraf=require(_0x15ba('0x1'));var zipdir=require(_0x15ba('0x2'));var jsonpatch=require(_0x15ba('0x3'));var rp=require('request-promise');var moment=require(_0x15ba('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x15ba('0x5'));var sox=require(_0x15ba('0x6'));var csv=require(_0x15ba('0x7'));var ejs=require(_0x15ba('0x8'));var fs=require('fs');var fs_extra=require(_0x15ba('0x9'));var _=require(_0x15ba('0xa'));var squel=require(_0x15ba('0xb'));var crypto=require(_0x15ba('0xc'));var jsforce=require(_0x15ba('0xd'));var deskjs=require(_0x15ba('0xe'));var toCsv=require(_0x15ba('0x7'));var querystring=require(_0x15ba('0xf'));var Papa=require(_0x15ba('0x10'));var Redis=require(_0x15ba('0x11'));var authService=require(_0x15ba('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x15ba('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15ba('0x14'));var utils=require(_0x15ba('0x15'));var config=require(_0x15ba('0x16'));var licenseUtil=require(_0x15ba('0x17'));var db=require(_0x15ba('0x18'))['db'];config[_0x15ba('0x19')]=_[_0x15ba('0x1a')](config[_0x15ba('0x19')],{'host':_0x15ba('0x1b'),'port':0x18eb});var socket=require(_0x15ba('0x1c'))(new Redis(config[_0x15ba('0x19')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x37b1bb,_0x406e7a){_0x406e7a=_0x406e7a||0xcc;return function(_0x47a2d0){if(_0x47a2d0){return _0x37b1bb[_0x15ba('0x1d')](_0x406e7a);}return _0x37b1bb[_0x15ba('0x1e')](_0x406e7a)['end']();};}function respondWithResult(_0x4077ae,_0x557dc9){_0x557dc9=_0x557dc9||0xc8;return function(_0x2875cf){if(_0x2875cf){return _0x4077ae['status'](_0x557dc9)['json'](_0x2875cf);}};}function respondWithFilteredResult(_0x7fc8ec,_0x494c0e){return function(_0x2e485b){if(_0x2e485b){var _0xdf36b7=typeof _0x494c0e[_0x15ba('0x1f')]===_0x15ba('0x20')&&typeof _0x494c0e[_0x15ba('0x21')]==='undefined';var _0x5279f6=_0x2e485b[_0x15ba('0x22')];var _0x1ca539=_0xdf36b7?0x0:_0x494c0e['offset'];var _0x4f0458=_0xdf36b7?_0x2e485b[_0x15ba('0x22')]:_0x494c0e[_0x15ba('0x1f')]+_0x494c0e[_0x15ba('0x21')];var _0x34cfcb;if(_0x4f0458>=_0x5279f6){_0x4f0458=_0x5279f6;_0x34cfcb=0xc8;}else{_0x34cfcb=0xce;}_0x7fc8ec['status'](_0x34cfcb);return _0x7fc8ec['set'](_0x15ba('0x23'),_0x1ca539+'-'+_0x4f0458+'/'+_0x5279f6)[_0x15ba('0x24')](_0x2e485b);}return null;};}function patchUpdates(_0x5bfdeb){return function(_0x4f4687){try{jsonpatch[_0x15ba('0x25')](_0x4f4687,_0x5bfdeb,!![]);}catch(_0x5355ac){return BPromise['reject'](_0x5355ac);}return _0x4f4687['save']();};}function saveUpdates(_0x34954c,_0x908ab6){return function(_0x1e9ca8){if(_0x1e9ca8){return _0x1e9ca8[_0x15ba('0x26')](_0x34954c)[_0x15ba('0x27')](function(_0x453f8b){return _0x453f8b;});}return null;};}function removeEntity(_0x5d7500,_0xd77fd9){return function(_0x5be012){if(_0x5be012){return _0x5be012[_0x15ba('0x28')]()['then'](function(){var _0x4cf75c=_0x5be012['get']({'plain':!![]});var _0x37d16d=_0x15ba('0x29');return db[_0x15ba('0x2a')][_0x15ba('0x28')]({'where':{'type':_0x37d16d,'resourceId':_0x4cf75c['id']}})['then'](function(){return _0x5be012;});})[_0x15ba('0x27')](function(){_0x5d7500[_0x15ba('0x1e')](0xcc)[_0x15ba('0x2b')]();});}};}function handleEntityNotFound(_0xb10ba0,_0x1b6858){return function(_0x158c25){if(!_0x158c25){_0xb10ba0['sendStatus'](0x194);}return _0x158c25;};}function handleError(_0x4719b9,_0xe16221){_0xe16221=_0xe16221||0x1f4;return function(_0x4baaeb){logger['error'](_0x4baaeb[_0x15ba('0x2c')]);if(_0x4baaeb['name']){delete _0x4baaeb[_0x15ba('0x2d')];}_0x4719b9[_0x15ba('0x1e')](_0xe16221)[_0x15ba('0x2e')](_0x4baaeb);};}exports[_0x15ba('0x2f')]=function(_0x16bf27,_0xafb258){var _0x489400={},_0x12b063={},_0x4022d3={'count':0x0,'rows':[]};var _0x1155ec=_[_0x15ba('0x30')](db[_0x15ba('0x31')][_0x15ba('0x32')],function(_0x237f89){return{'name':_0x237f89[_0x15ba('0x33')],'type':_0x237f89[_0x15ba('0x34')]['key']};});_0x12b063[_0x15ba('0x35')]=_[_0x15ba('0x30')](_0x1155ec,_0x15ba('0x2d'));_0x12b063[_0x15ba('0x36')]=_[_0x15ba('0x37')](_0x16bf27['query']);_0x12b063[_0x15ba('0x38')]=_[_0x15ba('0x39')](_0x12b063['model'],_0x12b063[_0x15ba('0x36')]);_0x489400[_0x15ba('0x3a')]=_[_0x15ba('0x39')](_0x12b063['model'],qs[_0x15ba('0x3b')](_0x16bf27['query']['fields']));_0x489400[_0x15ba('0x3a')]=_0x489400[_0x15ba('0x3a')][_0x15ba('0x3c')]?_0x489400[_0x15ba('0x3a')]:_0x12b063[_0x15ba('0x35')];if(!_0x16bf27[_0x15ba('0x36')][_0x15ba('0x3d')](_0x15ba('0x3e'))){_0x489400[_0x15ba('0x21')]=qs['limit'](_0x16bf27[_0x15ba('0x36')][_0x15ba('0x21')]);_0x489400[_0x15ba('0x1f')]=qs['offset'](_0x16bf27[_0x15ba('0x36')][_0x15ba('0x1f')]);}_0x489400['order']=qs[_0x15ba('0x3f')](_0x16bf27[_0x15ba('0x36')][_0x15ba('0x3f')]);_0x489400[_0x15ba('0x40')]=qs[_0x15ba('0x38')](_[_0x15ba('0x41')](_0x16bf27[_0x15ba('0x36')],_0x12b063[_0x15ba('0x38')]),_0x1155ec);if(_0x16bf27['query'][_0x15ba('0x42')]){_0x489400[_0x15ba('0x40')]=_[_0x15ba('0x43')](_0x489400[_0x15ba('0x40')],{'$or':_[_0x15ba('0x30')](_0x1155ec,function(_0x2cf597){if(_0x2cf597[_0x15ba('0x34')]!==_0x15ba('0x44')){var _0x4631ec={};_0x4631ec[_0x2cf597[_0x15ba('0x2d')]]={'$like':'%'+_0x16bf27[_0x15ba('0x36')][_0x15ba('0x42')]+'%'};return _0x4631ec;}})});}_0x489400=_['merge']({},_0x489400,_0x16bf27[_0x15ba('0x45')]);var _0x10047e={'where':_0x489400[_0x15ba('0x40')]};return db[_0x15ba('0x31')][_0x15ba('0x22')](_0x10047e)[_0x15ba('0x27')](function(_0x16ccdc){_0x4022d3[_0x15ba('0x22')]=_0x16ccdc;if(_0x16bf27[_0x15ba('0x36')][_0x15ba('0x46')]){_0x489400['include']=[{'all':!![]}];}return db[_0x15ba('0x31')][_0x15ba('0x47')](_0x489400);})[_0x15ba('0x27')](function(_0x365811){_0x4022d3[_0x15ba('0x48')]=_0x365811;return _0x4022d3;})['then'](respondWithFilteredResult(_0xafb258,_0x489400))[_0x15ba('0x49')](handleError(_0xafb258,null));};exports[_0x15ba('0x4a')]=function(_0x4c9e14,_0x1a4908){var _0x34b0d9={'raw':![],'where':{'id':_0x4c9e14['params']['id']}},_0x43b787={};_0x43b787['model']=_[_0x15ba('0x37')](db[_0x15ba('0x31')][_0x15ba('0x32')]);_0x43b787[_0x15ba('0x36')]=_[_0x15ba('0x37')](_0x4c9e14[_0x15ba('0x36')]);_0x43b787[_0x15ba('0x38')]=_[_0x15ba('0x39')](_0x43b787[_0x15ba('0x35')],_0x43b787[_0x15ba('0x36')]);_0x34b0d9[_0x15ba('0x3a')]=_[_0x15ba('0x39')](_0x43b787['model'],qs['fields'](_0x4c9e14['query'][_0x15ba('0x3b')]));_0x34b0d9[_0x15ba('0x3a')]=_0x34b0d9[_0x15ba('0x3a')][_0x15ba('0x3c')]?_0x34b0d9[_0x15ba('0x3a')]:_0x43b787[_0x15ba('0x35')];if(_0x4c9e14[_0x15ba('0x36')][_0x15ba('0x46')]){_0x34b0d9[_0x15ba('0x4b')]=[{'all':!![]}];}_0x34b0d9=_[_0x15ba('0x43')]({},_0x34b0d9,_0x4c9e14[_0x15ba('0x45')]);return db[_0x15ba('0x31')][_0x15ba('0x4c')](_0x34b0d9)[_0x15ba('0x27')](handleEntityNotFound(_0x1a4908,null))[_0x15ba('0x27')](respondWithResult(_0x1a4908,null))[_0x15ba('0x49')](handleError(_0x1a4908,null));};exports[_0x15ba('0x4d')]=function(_0x336992,_0x1177ae){return db[_0x15ba('0x31')][_0x15ba('0x4d')](_0x336992[_0x15ba('0x4e')],{})[_0x15ba('0x27')](function(_0xba8af4){var _0x29da47=_0x336992[_0x15ba('0x4f')]['get']({'plain':!![]});if(!_0x29da47)throw new Error(_0x15ba('0x50'));if(_0x29da47[_0x15ba('0x51')]==='user'){var _0x4fbf46=_0xba8af4['get']({'plain':!![]});var _0x4c5516='SquareProjects';return db[_0x15ba('0x52')][_0x15ba('0x4c')]({'where':{'name':_0x4c5516,'userProfileId':_0x29da47[_0x15ba('0x53')]},'raw':!![]})['then'](function(_0x3e1298){if(_0x3e1298&&_0x3e1298[_0x15ba('0x54')]===0x0){return db[_0x15ba('0x2a')][_0x15ba('0x4d')]({'name':_0x4fbf46['name'],'resourceId':_0x4fbf46['id'],'type':_0x3e1298[_0x15ba('0x2d')],'sectionId':_0x3e1298['id']},{})[_0x15ba('0x27')](function(){return _0xba8af4;});}else{return _0xba8af4;}})[_0x15ba('0x49')](function(_0x392992){logger['error'](_0x15ba('0x55'),_0x392992);throw _0x392992;});}return _0xba8af4;})['then'](respondWithResult(_0x1177ae,0xc9))[_0x15ba('0x49')](handleError(_0x1177ae,null));};exports[_0x15ba('0x26')]=function(_0x390e78,_0x454005){if(_0x390e78[_0x15ba('0x4e')]['id']){delete _0x390e78[_0x15ba('0x4e')]['id'];}return db['SquareProject'][_0x15ba('0x4c')]({'where':{'id':_0x390e78[_0x15ba('0x56')]['id']}})['then'](handleEntityNotFound(_0x454005,null))[_0x15ba('0x27')](saveUpdates(_0x390e78[_0x15ba('0x4e')],null))['then'](respondWithResult(_0x454005,null))[_0x15ba('0x49')](handleError(_0x454005,null));};exports['destroy']=function(_0x526bc5,_0x64261){return db[_0x15ba('0x31')][_0x15ba('0x4c')]({'where':{'id':_0x526bc5[_0x15ba('0x56')]['id']}})['then'](handleEntityNotFound(_0x64261,null))['then'](removeEntity(_0x64261,null))['catch'](handleError(_0x64261,null));};exports[_0x15ba('0x57')]=function(_0x31d5ff,_0x5c83de,_0x11754f){return db[_0x15ba('0x31')]['find']({'where':{'id':_0x31d5ff[_0x15ba('0x56')]['id']}})[_0x15ba('0x27')](handleEntityNotFound(_0x5c83de,null))[_0x15ba('0x27')](function(_0x3781ab){if(_0x3781ab){return _0x3781ab[_0x15ba('0x57')](_0x31d5ff[_0x15ba('0x4e')][_0x15ba('0x58')],_[_0x15ba('0x59')](_0x31d5ff['body'],['ids','id'])||{});}})[_0x15ba('0x27')](respondWithResult(_0x5c83de,null))['catch'](handleError(_0x5c83de,null));};exports['removeUsers']=function(_0x3cb639,_0x1e743c,_0x3799e2){return db['SquareProject'][_0x15ba('0x4c')]({'where':{'id':_0x3cb639['params']['id']}})['then'](handleEntityNotFound(_0x1e743c,null))[_0x15ba('0x27')](function(_0x476cac){if(_0x476cac){return _0x476cac[_0x15ba('0x5a')](_0x3cb639['query'][_0x15ba('0x58')])[_0x15ba('0x27')](function(){if(_['isArray'](_0x3cb639['query']['ids'])){for(var _0x95acd8=0x0;_0x95acd8<_0x3cb639['query'][_0x15ba('0x58')]['length'];_0x95acd8+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x3cb639['query']['ids'][_0x95acd8]),'SquareProjectId':Number(_0x3cb639[_0x15ba('0x56')]['id'])});}}else{socket[_0x15ba('0x5b')](_0x15ba('0x5c'),{'UserId':Number(_0x3cb639[_0x15ba('0x36')]['ids']),'SquareProjectId':Number(_0x3cb639[_0x15ba('0x56')]['id'])});}});}})[_0x15ba('0x27')](respondWithStatusCode(_0x1e743c,null))[_0x15ba('0x49')](handleError(_0x1e743c,null));};exports[_0x15ba('0x5d')]=function(_0x41bc5b,_0xe5e1ae,_0x235848){var _0x5cfb55={};var _0x1ed92f={};var _0x32c236;var _0x5a286f;return db['SquareProject'][_0x15ba('0x5e')]({'where':{'id':_0x41bc5b['params']['id']}})[_0x15ba('0x27')](handleEntityNotFound(_0xe5e1ae,null))[_0x15ba('0x27')](function(_0x2aa158){if(_0x2aa158){_0x32c236=_0x2aa158;_0x1ed92f[_0x15ba('0x35')]=_[_0x15ba('0x37')](db[_0x15ba('0x5f')][_0x15ba('0x32')]);_0x1ed92f[_0x15ba('0x36')]=_[_0x15ba('0x37')](_0x41bc5b[_0x15ba('0x36')]);_0x1ed92f[_0x15ba('0x38')]=_[_0x15ba('0x39')](_0x1ed92f[_0x15ba('0x35')],_0x1ed92f[_0x15ba('0x36')]);_0x5cfb55[_0x15ba('0x3a')]=_[_0x15ba('0x39')](_0x1ed92f['model'],qs[_0x15ba('0x3b')](_0x41bc5b[_0x15ba('0x36')]['fields']));_0x5cfb55[_0x15ba('0x3a')]=_0x5cfb55[_0x15ba('0x3a')][_0x15ba('0x3c')]?_0x5cfb55[_0x15ba('0x3a')]:_0x1ed92f[_0x15ba('0x35')];_0x5cfb55[_0x15ba('0x60')]=qs['sort'](_0x41bc5b['query'][_0x15ba('0x3f')]);_0x5cfb55[_0x15ba('0x40')]=qs['filters'](_[_0x15ba('0x41')](_0x41bc5b[_0x15ba('0x36')],_0x1ed92f['filters']));if(_0x41bc5b[_0x15ba('0x36')]['filter']){_0x5cfb55[_0x15ba('0x40')]=_[_0x15ba('0x43')](_0x5cfb55[_0x15ba('0x40')],{'$or':_[_0x15ba('0x30')](_0x5cfb55['attributes'],function(_0x2f14e4){var _0x312656={};_0x312656[_0x2f14e4]={'$like':'%'+_0x41bc5b[_0x15ba('0x36')][_0x15ba('0x42')]+'%'};return _0x312656;})});}_0x5cfb55=_[_0x15ba('0x43')]({},_0x5cfb55,_0x41bc5b['options']);return _0x32c236['getUsers'](_0x5cfb55);}})[_0x15ba('0x27')](function(_0x40bcb2){if(_0x40bcb2){_0x5a286f=_0x40bcb2['length'];if(!_0x41bc5b['query'][_0x15ba('0x3d')](_0x15ba('0x3e'))){_0x5cfb55[_0x15ba('0x21')]=qs[_0x15ba('0x21')](_0x41bc5b['query']['limit']);_0x5cfb55['offset']=qs[_0x15ba('0x1f')](_0x41bc5b[_0x15ba('0x36')][_0x15ba('0x1f')]);}return _0x32c236[_0x15ba('0x5d')](_0x5cfb55);}})[_0x15ba('0x27')](function(_0x3a469a){if(_0x3a469a){return _0x3a469a?{'count':_0x5a286f,'rows':_0x3a469a}:null;}})[_0x15ba('0x27')](respondWithResult(_0xe5e1ae,null))[_0x15ba('0x49')](handleError(_0xe5e1ae,null));}; \ No newline at end of file +var _0x3752=['name','send','index','map','SquareProject','rawAttributes','fieldName','key','query','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','params','keys','filters','length','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','hasOwnProperty','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','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','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','SquareProjects','UserProfileResource','error','stack'];(function(_0xce0e61,_0x3b5571){var _0x1e5c06=function(_0x1a66a1){while(--_0x1a66a1){_0xce0e61['push'](_0xce0e61['shift']());}};_0x1e5c06(++_0x3b5571);}(_0x3752,0x1b5));var _0x2375=function(_0x1eccef,_0x1181d4){_0x1eccef=_0x1eccef-0x0;var _0x51c6f2=_0x3752[_0x1eccef];return _0x51c6f2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2375('0x0'));var jsonpatch=require(_0x2375('0x1'));var rp=require(_0x2375('0x2'));var moment=require(_0x2375('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2375('0x4'));var util=require(_0x2375('0x5'));var path=require(_0x2375('0x6'));var sox=require(_0x2375('0x7'));var csv=require('to-csv');var ejs=require(_0x2375('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2375('0x9'));var jsforce=require(_0x2375('0xa'));var deskjs=require(_0x2375('0xb'));var toCsv=require(_0x2375('0xc'));var querystring=require('querystring');var Papa=require(_0x2375('0xd'));var Redis=require(_0x2375('0xe'));var authService=require(_0x2375('0xf'));var qs=require(_0x2375('0x10'));var as=require(_0x2375('0x11'));var hardwareService=require(_0x2375('0x12'));var logger=require(_0x2375('0x13'))(_0x2375('0x14'));var utils=require(_0x2375('0x15'));var config=require(_0x2375('0x16'));var licenseUtil=require(_0x2375('0x17'));var db=require('../../mysqldb')['db'];config[_0x2375('0x18')]=_['defaults'](config[_0x2375('0x18')],{'host':_0x2375('0x19'),'port':0x18eb});var socket=require(_0x2375('0x1a'))(new Redis(config[_0x2375('0x18')]));require(_0x2375('0x1b'))[_0x2375('0x1c')](socket);function respondWithStatusCode(_0xc9e3db,_0x4c2653){_0x4c2653=_0x4c2653||0xcc;return function(_0x2f5023){if(_0x2f5023){return _0xc9e3db[_0x2375('0x1d')](_0x4c2653);}return _0xc9e3db[_0x2375('0x1e')](_0x4c2653)[_0x2375('0x1f')]();};}function respondWithResult(_0x2b9d9a,_0x375341){_0x375341=_0x375341||0xc8;return function(_0x4362f5){if(_0x4362f5){return _0x2b9d9a[_0x2375('0x1e')](_0x375341)['json'](_0x4362f5);}};}function respondWithFilteredResult(_0x3d229e,_0x156901){return function(_0x306003){if(_0x306003){var _0x5980d2=typeof _0x156901[_0x2375('0x20')]===_0x2375('0x21')&&typeof _0x156901[_0x2375('0x22')]===_0x2375('0x21');var _0x30c62b=_0x306003[_0x2375('0x23')];var _0x5f300e=_0x5980d2?0x0:_0x156901['offset'];var _0x4ccbd3=_0x5980d2?_0x306003[_0x2375('0x23')]:_0x156901[_0x2375('0x20')]+_0x156901[_0x2375('0x22')];var _0x205ef7;if(_0x4ccbd3>=_0x30c62b){_0x4ccbd3=_0x30c62b;_0x205ef7=0xc8;}else{_0x205ef7=0xce;}_0x3d229e['status'](_0x205ef7);return _0x3d229e[_0x2375('0x24')]('Content-Range',_0x5f300e+'-'+_0x4ccbd3+'/'+_0x30c62b)[_0x2375('0x25')](_0x306003);}return null;};}function patchUpdates(_0x559665){return function(_0xbf3211){try{jsonpatch[_0x2375('0x26')](_0xbf3211,_0x559665,!![]);}catch(_0x4b425f){return BPromise[_0x2375('0x27')](_0x4b425f);}return _0xbf3211[_0x2375('0x28')]();};}function saveUpdates(_0x567b3d,_0x5ea47a){return function(_0x10692b){if(_0x10692b){return _0x10692b[_0x2375('0x29')](_0x567b3d)[_0x2375('0x2a')](function(_0x5e090b){return _0x5e090b;});}return null;};}function removeEntity(_0x402fc2,_0xffb5ae){return function(_0x22a8a3){if(_0x22a8a3){return _0x22a8a3[_0x2375('0x2b')]()[_0x2375('0x2a')](function(){var _0xa41149=_0x22a8a3['get']({'plain':!![]});var _0x36b506=_0x2375('0x2c');return db[_0x2375('0x2d')][_0x2375('0x2b')]({'where':{'type':_0x36b506,'resourceId':_0xa41149['id']}})[_0x2375('0x2a')](function(){return _0x22a8a3;});})[_0x2375('0x2a')](function(){_0x402fc2['status'](0xcc)[_0x2375('0x1f')]();});}};}function handleEntityNotFound(_0x189b69,_0x5a8b51){return function(_0x1e5e27){if(!_0x1e5e27){_0x189b69[_0x2375('0x1d')](0x194);}return _0x1e5e27;};}function handleError(_0x29c071,_0x36f5a3){_0x36f5a3=_0x36f5a3||0x1f4;return function(_0x3a573d){logger[_0x2375('0x2e')](_0x3a573d[_0x2375('0x2f')]);if(_0x3a573d[_0x2375('0x30')]){delete _0x3a573d[_0x2375('0x30')];}_0x29c071[_0x2375('0x1e')](_0x36f5a3)[_0x2375('0x31')](_0x3a573d);};}exports[_0x2375('0x32')]=function(_0x4b8de6,_0x5a78c9){var _0x190199={},_0x2ae7b9={},_0x4dab9c={'count':0x0,'rows':[]};var _0x36ea8b=_[_0x2375('0x33')](db[_0x2375('0x34')][_0x2375('0x35')],function(_0x546322){return{'name':_0x546322[_0x2375('0x36')],'type':_0x546322['type'][_0x2375('0x37')]};});_0x2ae7b9['model']=_[_0x2375('0x33')](_0x36ea8b,_0x2375('0x30'));_0x2ae7b9[_0x2375('0x38')]=_['keys'](_0x4b8de6[_0x2375('0x38')]);_0x2ae7b9['filters']=_[_0x2375('0x39')](_0x2ae7b9[_0x2375('0x3a')],_0x2ae7b9[_0x2375('0x38')]);_0x190199['attributes']=_[_0x2375('0x39')](_0x2ae7b9['model'],qs[_0x2375('0x3b')](_0x4b8de6[_0x2375('0x38')][_0x2375('0x3b')]));_0x190199[_0x2375('0x3c')]=_0x190199[_0x2375('0x3c')]['length']?_0x190199[_0x2375('0x3c')]:_0x2ae7b9[_0x2375('0x3a')];if(!_0x4b8de6[_0x2375('0x38')]['hasOwnProperty'](_0x2375('0x3d'))){_0x190199['limit']=qs[_0x2375('0x22')](_0x4b8de6[_0x2375('0x38')][_0x2375('0x22')]);_0x190199['offset']=qs[_0x2375('0x20')](_0x4b8de6[_0x2375('0x38')][_0x2375('0x20')]);}_0x190199[_0x2375('0x3e')]=qs[_0x2375('0x3f')](_0x4b8de6['query'][_0x2375('0x3f')]);_0x190199[_0x2375('0x40')]=qs['filters'](_[_0x2375('0x41')](_0x4b8de6[_0x2375('0x38')],_0x2ae7b9['filters']),_0x36ea8b);if(_0x4b8de6[_0x2375('0x38')][_0x2375('0x42')]){_0x190199[_0x2375('0x40')]=_[_0x2375('0x43')](_0x190199[_0x2375('0x40')],{'$or':_[_0x2375('0x33')](_0x36ea8b,function(_0xa7dafb){if(_0xa7dafb[_0x2375('0x44')]!=='VIRTUAL'){var _0x5f3fd4={};_0x5f3fd4[_0xa7dafb[_0x2375('0x30')]]={'$like':'%'+_0x4b8de6[_0x2375('0x38')]['filter']+'%'};return _0x5f3fd4;}})});}_0x190199=_[_0x2375('0x43')]({},_0x190199,_0x4b8de6[_0x2375('0x45')]);var _0x2ec81d={'where':_0x190199[_0x2375('0x40')]};return db[_0x2375('0x34')][_0x2375('0x23')](_0x2ec81d)['then'](function(_0x1aae20){_0x4dab9c[_0x2375('0x23')]=_0x1aae20;if(_0x4b8de6['query'][_0x2375('0x46')]){_0x190199[_0x2375('0x47')]=[{'all':!![]}];}return db[_0x2375('0x34')]['findAll'](_0x190199);})[_0x2375('0x2a')](function(_0x355bbd){_0x4dab9c['rows']=_0x355bbd;return _0x4dab9c;})[_0x2375('0x2a')](respondWithFilteredResult(_0x5a78c9,_0x190199))['catch'](handleError(_0x5a78c9,null));};exports['show']=function(_0x4f6def,_0x3a91b6){var _0x4c7bcf={'raw':![],'where':{'id':_0x4f6def[_0x2375('0x48')]['id']}},_0x343f3b={};_0x343f3b[_0x2375('0x3a')]=_[_0x2375('0x49')](db['SquareProject'][_0x2375('0x35')]);_0x343f3b[_0x2375('0x38')]=_['keys'](_0x4f6def[_0x2375('0x38')]);_0x343f3b[_0x2375('0x4a')]=_['intersection'](_0x343f3b[_0x2375('0x3a')],_0x343f3b[_0x2375('0x38')]);_0x4c7bcf[_0x2375('0x3c')]=_[_0x2375('0x39')](_0x343f3b[_0x2375('0x3a')],qs['fields'](_0x4f6def['query'][_0x2375('0x3b')]));_0x4c7bcf['attributes']=_0x4c7bcf['attributes'][_0x2375('0x4b')]?_0x4c7bcf[_0x2375('0x3c')]:_0x343f3b['model'];if(_0x4f6def['query'][_0x2375('0x46')]){_0x4c7bcf[_0x2375('0x47')]=[{'all':!![]}];}_0x4c7bcf=_[_0x2375('0x43')]({},_0x4c7bcf,_0x4f6def[_0x2375('0x45')]);return db[_0x2375('0x34')][_0x2375('0x4c')](_0x4c7bcf)['then'](handleEntityNotFound(_0x3a91b6,null))[_0x2375('0x2a')](respondWithResult(_0x3a91b6,null))[_0x2375('0x4d')](handleError(_0x3a91b6,null));};exports[_0x2375('0x4e')]=function(_0x2bb389,_0x52e090){return db[_0x2375('0x34')][_0x2375('0x4e')](_0x2bb389[_0x2375('0x4f')],{})[_0x2375('0x2a')](function(_0x34dc62){var _0x15a650=_0x2bb389[_0x2375('0x50')][_0x2375('0x51')]({'plain':!![]});if(!_0x15a650)throw new Error(_0x2375('0x52'));if(_0x15a650[_0x2375('0x53')]===_0x2375('0x50')){var _0x19cf55=_0x34dc62[_0x2375('0x51')]({'plain':!![]});var _0x16985a=_0x2375('0x2c');return db['UserProfileSection'][_0x2375('0x4c')]({'where':{'name':_0x16985a,'userProfileId':_0x15a650[_0x2375('0x54')]},'raw':!![]})[_0x2375('0x2a')](function(_0x6491e6){if(_0x6491e6&&_0x6491e6[_0x2375('0x55')]===0x0){return db['UserProfileResource'][_0x2375('0x4e')]({'name':_0x19cf55['name'],'resourceId':_0x19cf55['id'],'type':_0x6491e6['name'],'sectionId':_0x6491e6['id']},{})['then'](function(){return _0x34dc62;});}else{return _0x34dc62;}})[_0x2375('0x4d')](function(_0x1b897a){logger[_0x2375('0x2e')](_0x2375('0x56'),_0x1b897a);throw _0x1b897a;});}return _0x34dc62;})[_0x2375('0x2a')](respondWithResult(_0x52e090,0xc9))[_0x2375('0x4d')](handleError(_0x52e090,null));};exports[_0x2375('0x29')]=function(_0x1b4ce7,_0x3fae01){if(_0x1b4ce7['body']['id']){delete _0x1b4ce7['body']['id'];}return db[_0x2375('0x34')][_0x2375('0x4c')]({'where':{'id':_0x1b4ce7['params']['id']}})['then'](handleEntityNotFound(_0x3fae01,null))[_0x2375('0x2a')](saveUpdates(_0x1b4ce7[_0x2375('0x4f')],null))[_0x2375('0x2a')](respondWithResult(_0x3fae01,null))['catch'](handleError(_0x3fae01,null));};exports['destroy']=function(_0x620439,_0x48e097){return db['SquareProject'][_0x2375('0x4c')]({'where':{'id':_0x620439[_0x2375('0x48')]['id']}})['then'](handleEntityNotFound(_0x48e097,null))['then'](removeEntity(_0x48e097,null))[_0x2375('0x4d')](handleError(_0x48e097,null));};exports[_0x2375('0x57')]=function(_0x57514e,_0x1ab5a5,_0x5a39ca){return db[_0x2375('0x34')][_0x2375('0x4c')]({'where':{'id':_0x57514e['params']['id']}})[_0x2375('0x2a')](handleEntityNotFound(_0x1ab5a5,null))[_0x2375('0x2a')](function(_0x19dd07){if(_0x19dd07){return _0x19dd07[_0x2375('0x57')](_0x57514e[_0x2375('0x4f')]['ids'],_[_0x2375('0x58')](_0x57514e[_0x2375('0x4f')],[_0x2375('0x59'),'id'])||{});}})[_0x2375('0x2a')](respondWithResult(_0x1ab5a5,null))[_0x2375('0x4d')](handleError(_0x1ab5a5,null));};exports['removeUsers']=function(_0x1a13bd,_0x138490,_0x150054){return db[_0x2375('0x34')][_0x2375('0x4c')]({'where':{'id':_0x1a13bd[_0x2375('0x48')]['id']}})[_0x2375('0x2a')](handleEntityNotFound(_0x138490,null))[_0x2375('0x2a')](function(_0x50a6e2){if(_0x50a6e2){return _0x50a6e2[_0x2375('0x5a')](_0x1a13bd[_0x2375('0x38')]['ids'])[_0x2375('0x2a')](function(){if(_[_0x2375('0x5b')](_0x1a13bd[_0x2375('0x38')][_0x2375('0x59')])){for(var _0x398731=0x0;_0x398731<_0x1a13bd[_0x2375('0x38')][_0x2375('0x59')][_0x2375('0x4b')];_0x398731+=0x1){socket[_0x2375('0x5c')](_0x2375('0x5d'),{'UserId':Number(_0x1a13bd[_0x2375('0x38')]['ids'][_0x398731]),'SquareProjectId':Number(_0x1a13bd[_0x2375('0x48')]['id'])});}}else{socket[_0x2375('0x5c')](_0x2375('0x5d'),{'UserId':Number(_0x1a13bd['query']['ids']),'SquareProjectId':Number(_0x1a13bd[_0x2375('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x138490,null))[_0x2375('0x4d')](handleError(_0x138490,null));};exports[_0x2375('0x5e')]=function(_0x131abd,_0x37b7aa,_0xea41a3){var _0x214a11={};var _0x1ea2db={};var _0x4970e4;var _0x46fdb5;return db['SquareProject']['findOne']({'where':{'id':_0x131abd[_0x2375('0x48')]['id']}})[_0x2375('0x2a')](handleEntityNotFound(_0x37b7aa,null))[_0x2375('0x2a')](function(_0x2efbf8){if(_0x2efbf8){_0x4970e4=_0x2efbf8;_0x1ea2db['model']=_[_0x2375('0x49')](db[_0x2375('0x5f')][_0x2375('0x35')]);_0x1ea2db[_0x2375('0x38')]=_[_0x2375('0x49')](_0x131abd[_0x2375('0x38')]);_0x1ea2db['filters']=_[_0x2375('0x39')](_0x1ea2db[_0x2375('0x3a')],_0x1ea2db[_0x2375('0x38')]);_0x214a11[_0x2375('0x3c')]=_[_0x2375('0x39')](_0x1ea2db[_0x2375('0x3a')],qs[_0x2375('0x3b')](_0x131abd[_0x2375('0x38')][_0x2375('0x3b')]));_0x214a11[_0x2375('0x3c')]=_0x214a11['attributes']['length']?_0x214a11[_0x2375('0x3c')]:_0x1ea2db[_0x2375('0x3a')];_0x214a11[_0x2375('0x3e')]=qs[_0x2375('0x3f')](_0x131abd[_0x2375('0x38')][_0x2375('0x3f')]);_0x214a11[_0x2375('0x40')]=qs[_0x2375('0x4a')](_[_0x2375('0x41')](_0x131abd[_0x2375('0x38')],_0x1ea2db[_0x2375('0x4a')]));if(_0x131abd[_0x2375('0x38')]['filter']){_0x214a11[_0x2375('0x40')]=_[_0x2375('0x43')](_0x214a11['where'],{'$or':_[_0x2375('0x33')](_0x214a11[_0x2375('0x3c')],function(_0x222100){var _0x5643b7={};_0x5643b7[_0x222100]={'$like':'%'+_0x131abd[_0x2375('0x38')][_0x2375('0x42')]+'%'};return _0x5643b7;})});}_0x214a11=_[_0x2375('0x43')]({},_0x214a11,_0x131abd[_0x2375('0x45')]);return _0x4970e4[_0x2375('0x5e')](_0x214a11);}})[_0x2375('0x2a')](function(_0x4be641){if(_0x4be641){_0x46fdb5=_0x4be641['length'];if(!_0x131abd[_0x2375('0x38')][_0x2375('0x60')]('nolimit')){_0x214a11['limit']=qs[_0x2375('0x22')](_0x131abd[_0x2375('0x38')][_0x2375('0x22')]);_0x214a11[_0x2375('0x20')]=qs[_0x2375('0x20')](_0x131abd[_0x2375('0x38')][_0x2375('0x20')]);}return _0x4970e4[_0x2375('0x5e')](_0x214a11);}})['then'](function(_0x16b1e5){if(_0x16b1e5){return _0x16b1e5?{'count':_0x46fdb5,'rows':_0x16b1e5}:null;}})['then'](respondWithResult(_0x37b7aa,null))['catch'](handleError(_0x37b7aa,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 2c35749..ad6dc8d 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 _0xae6c=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3a028c,_0x1f375a){var _0x6533f6=function(_0x2e280b){while(--_0x2e280b){_0x3a028c['push'](_0x3a028c['shift']());}};_0x6533f6(++_0x1f375a);}(_0xae6c,0x8e));var _0xcae6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xae6c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xcae6('0x0'));var SquareProject=require(_0xcae6('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xcae6('0x2')](0x0);var events={'afterCreate':_0xcae6('0x3'),'afterUpdate':_0xcae6('0x4'),'afterDestroy':_0xcae6('0x5')};function emitEvent(_0x46755b){return function(_0x55cd7c,_0x250180,_0x353df1){SquareProjectEvents[_0xcae6('0x6')](_0x46755b+':'+_0x55cd7c['id'],_0x55cd7c);SquareProjectEvents[_0xcae6('0x6')](_0x46755b,_0x55cd7c);_0x353df1(null);};}for(var e in events){if(events[_0xcae6('0x7')](e)){var event=events[e];SquareProject[_0xcae6('0x8')](e,emitEvent(event));}}module[_0xcae6('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0xbd07=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x2a41dd,_0x1bfba8){var _0x262b42=function(_0x4fab2d){while(--_0x4fab2d){_0x2a41dd['push'](_0x2a41dd['shift']());}};_0x262b42(++_0x1bfba8);}(_0xbd07,0xcc));var _0x7bd0=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xbd07[_0x53ccf2];return _0x5a2964;};'use strict';var EventEmitter=require(_0x7bd0('0x0'));var SquareProject=require(_0x7bd0('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x7bd0('0x2')](0x0);var events={'afterCreate':_0x7bd0('0x3'),'afterUpdate':_0x7bd0('0x4'),'afterDestroy':'remove'};function emitEvent(_0xc8a561){return function(_0x4beff4,_0x485482,_0x2824ed){SquareProjectEvents[_0x7bd0('0x5')](_0xc8a561+':'+_0x4beff4['id'],_0x4beff4);SquareProjectEvents['emit'](_0xc8a561,_0x4beff4);_0x2824ed(null);};}for(var e in events){if(events[_0x7bd0('0x6')](e)){var event=events[e];SquareProject[_0x7bd0('0x7')](e,emitEvent(event));}}module[_0x7bd0('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 0287325..8094390 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 _0x2cc3=['request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','bluebird'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x2cc3,0x88));var _0x32cc=function(_0x3af78b,_0x1ce8fd){_0x3af78b=_0x3af78b-0x0;var _0x5dd097=_0x2cc3[_0x3af78b];return _0x5dd097;};'use strict';var _=require(_0x32cc('0x0'));var util=require(_0x32cc('0x1'));var logger=require(_0x32cc('0x2'))('api');var moment=require('moment');var BPromise=require(_0x32cc('0x3'));var rp=require(_0x32cc('0x4'));var fs=require('fs');var path=require(_0x32cc('0x5'));var rimraf=require(_0x32cc('0x6'));var config=require(_0x32cc('0x7'));var attributes=require(_0x32cc('0x8'));module[_0x32cc('0x9')]=function(_0x3656ba,_0x1b588b){return _0x3656ba[_0x32cc('0xa')](_0x32cc('0xb'),attributes,{'tableName':_0x32cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3727f2,_0x4f0c15,_0x5d7083){if(_0x3727f2[_0x32cc('0xd')](_0x32cc('0xe'))){_0x3727f2[_0x32cc('0xf')]=moment()[_0x32cc('0x10')](_0x32cc('0x11'));}if(_0x3727f2[_0x32cc('0xd')](_0x32cc('0x12'))){_0x3727f2[_0x32cc('0x13')]=moment()[_0x32cc('0x10')](_0x32cc('0x11'));}_0x5d7083(null,_0x3727f2);}}});}; \ No newline at end of file +var _0x5204=['./squareProject.attributes','exports','define','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x32d5bd,_0x1fca22){var _0xefe7d4=function(_0x4e0c94){while(--_0x4e0c94){_0x32d5bd['push'](_0x32d5bd['shift']());}};_0xefe7d4(++_0x1fca22);}(_0x5204,0x192));var _0x4520=function(_0x2d486b,_0x5f213c){_0x2d486b=_0x2d486b-0x0;var _0x4291d1=_0x5204[_0x2d486b];return _0x4291d1;};'use strict';var _=require('lodash');var util=require(_0x4520('0x0'));var logger=require('../../config/logger')(_0x4520('0x1'));var moment=require(_0x4520('0x2'));var BPromise=require('bluebird');var rp=require(_0x4520('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4520('0x4'));var config=require(_0x4520('0x5'));var attributes=require(_0x4520('0x6'));module[_0x4520('0x7')]=function(_0x3cc20f,_0x1189c1){return _0x3cc20f[_0x4520('0x8')]('SquareProject',attributes,{'tableName':_0x4520('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1585d4,_0x57019f,_0xee1b8c){if(_0x1585d4[_0x4520('0xa')](_0x4520('0xb'))){_0x1585d4[_0x4520('0xc')]=moment()['format'](_0x4520('0xd'));}if(_0x1585d4[_0x4520('0xa')](_0x4520('0xe'))){_0x1585d4[_0x4520('0xf')]=moment()[_0x4520('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0xee1b8c(null,_0x1585d4);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index f9243e7..2581dc4 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 _0xecd4=['result','ShowSquareProject','SquareProject','find','options','raw','attributes','include','map','model','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./squareProject.socket','request','then','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent'];(function(_0x57aa71,_0x182a6b){var _0xa03199=function(_0x109f02){while(--_0x109f02){_0x57aa71['push'](_0x57aa71['shift']());}};_0xa03199(++_0x182a6b);}(_0xecd4,0xc4));var _0x4ecd=function(_0x3d2a90,_0x2073ae){_0x3d2a90=_0x3d2a90-0x0;var _0x33fb5c=_0xecd4[_0x3d2a90];return _0x33fb5c;};'use strict';var _=require(_0x4ecd('0x0'));var util=require(_0x4ecd('0x1'));var moment=require(_0x4ecd('0x2'));var BPromise=require('bluebird');var rs=require(_0x4ecd('0x3'));var fs=require('fs');var Redis=require(_0x4ecd('0x4'));var db=require(_0x4ecd('0x5'))['db'];var utils=require(_0x4ecd('0x6'));var logger=require(_0x4ecd('0x7'))(_0x4ecd('0x8'));var config=require(_0x4ecd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4ecd('0xa')][_0x4ecd('0xb')]({'port':0x232a});config[_0x4ecd('0xc')]=_['defaults'](config[_0x4ecd('0xc')],{'host':_0x4ecd('0xd'),'port':0x18eb});var socket=require(_0x4ecd('0xe'))(new Redis(config['redis']));require(_0x4ecd('0xf'))['register'](socket);function respondWithRpcPromise(_0x43a3b8,_0x3b474a,_0x3ffb6c){return new BPromise(function(_0x12ef8e,_0x4773c5){return client[_0x4ecd('0x10')](_0x43a3b8,_0x3ffb6c)[_0x4ecd('0x11')](function(_0x5d1454){logger[_0x4ecd('0x12')](_0x4ecd('0x13'),_0x3b474a,'request\x20sent');logger[_0x4ecd('0x14')](_0x4ecd('0x15'),_0x3b474a,'request\x20sent',JSON[_0x4ecd('0x16')](_0x5d1454));if(_0x5d1454[_0x4ecd('0x17')]){if(_0x5d1454[_0x4ecd('0x17')]['code']===0x1f4){logger[_0x4ecd('0x17')]('SquareProject,\x20%s,\x20%s',_0x3b474a,_0x5d1454[_0x4ecd('0x17')][_0x4ecd('0x18')]);return _0x4773c5(_0x5d1454[_0x4ecd('0x17')]['message']);}logger['error'](_0x4ecd('0x13'),_0x3b474a,_0x5d1454[_0x4ecd('0x17')][_0x4ecd('0x18')]);return _0x12ef8e(_0x5d1454[_0x4ecd('0x17')][_0x4ecd('0x18')]);}else{logger[_0x4ecd('0x12')]('SquareProject,\x20%s,\x20%s',_0x3b474a,_0x4ecd('0x19'));_0x12ef8e(_0x5d1454[_0x4ecd('0x1a')][_0x4ecd('0x18')]);}})['catch'](function(_0x21a040){logger[_0x4ecd('0x17')](_0x4ecd('0x13'),_0x3b474a,_0x21a040);_0x4773c5(_0x21a040);});});}exports[_0x4ecd('0x1b')]=function(_0x686797){var _0x96660d=this;return new Promise(function(_0x469de4,_0x4cf51e){return db[_0x4ecd('0x1c')][_0x4ecd('0x1d')]({'raw':_0x686797[_0x4ecd('0x1e')]?_0x686797['options'][_0x4ecd('0x1f')]===undefined?!![]:![]:!![],'where':_0x686797[_0x4ecd('0x1e')]?_0x686797['options']['where']||null:null,'attributes':_0x686797[_0x4ecd('0x1e')]?_0x686797[_0x4ecd('0x1e')][_0x4ecd('0x20')]||null:null,'include':_0x686797[_0x4ecd('0x1e')]?_0x686797[_0x4ecd('0x1e')][_0x4ecd('0x21')]?_[_0x4ecd('0x22')](_0x686797[_0x4ecd('0x1e')][_0x4ecd('0x21')],function(_0x49ca8c){return{'model':db[_0x49ca8c['model']],'as':_0x49ca8c['as'],'attributes':_0x49ca8c[_0x4ecd('0x20')],'include':_0x49ca8c['include']?_['map'](_0x49ca8c[_0x4ecd('0x21')],function(_0x141850){return{'model':db[_0x141850[_0x4ecd('0x23')]],'as':_0x141850['as'],'attributes':_0x141850[_0x4ecd('0x20')],'include':_0x141850[_0x4ecd('0x21')]?_[_0x4ecd('0x22')](_0x141850[_0x4ecd('0x21')],function(_0x4974e4){return{'model':db[_0x4974e4[_0x4ecd('0x23')]],'as':_0x4974e4['as'],'attributes':_0x4974e4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2738c6){logger[_0x4ecd('0x12')](_0x4ecd('0x1b'),_0x686797);logger[_0x4ecd('0x14')]('ShowSquareProject',_0x686797,JSON[_0x4ecd('0x16')](_0x2738c6));_0x469de4(_0x2738c6);})[_0x4ecd('0x24')](function(_0x1d9e41){logger['error'](_0x4ecd('0x1b'),_0x1d9e41[_0x4ecd('0x18')],_0x686797);_0x4cf51e(_0x96660d['error'](0x1f4,_0x1d9e41[_0x4ecd('0x18')]));});});}; \ No newline at end of file +var _0x7058=['request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SquareProject','options','raw','where','include','map','model','attributes','debug','ShowSquareProject','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s'];(function(_0x1b42a8,_0x26e161){var _0x125b77=function(_0x15dcca){while(--_0x15dcca){_0x1b42a8['push'](_0x1b42a8['shift']());}};_0x125b77(++_0x26e161);}(_0x7058,0x16f));var _0x8705=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x7058[_0x38537f];return _0x141e23;};'use strict';var _=require('lodash');var util=require(_0x8705('0x0'));var moment=require('moment');var BPromise=require(_0x8705('0x1'));var rs=require(_0x8705('0x2'));var fs=require('fs');var Redis=require(_0x8705('0x3'));var db=require(_0x8705('0x4'))['db'];var utils=require(_0x8705('0x5'));var logger=require(_0x8705('0x6'))(_0x8705('0x7'));var config=require(_0x8705('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x8705('0x9')]=_[_0x8705('0xa')](config['redis'],{'host':_0x8705('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8705('0xc'))[_0x8705('0xd')](socket);function respondWithRpcPromise(_0x59b0a0,_0x481601,_0x2dd591){return new BPromise(function(_0x1caa6b,_0x435b8b){return client[_0x8705('0xe')](_0x59b0a0,_0x2dd591)[_0x8705('0xf')](function(_0x47019a){logger[_0x8705('0x10')](_0x8705('0x11'),_0x481601,_0x8705('0x12'));logger['debug'](_0x8705('0x13'),_0x481601,_0x8705('0x12'),JSON[_0x8705('0x14')](_0x47019a));if(_0x47019a[_0x8705('0x15')]){if(_0x47019a['error']['code']===0x1f4){logger[_0x8705('0x15')]('SquareProject,\x20%s,\x20%s',_0x481601,_0x47019a[_0x8705('0x15')][_0x8705('0x16')]);return _0x435b8b(_0x47019a[_0x8705('0x15')][_0x8705('0x16')]);}logger['error'](_0x8705('0x11'),_0x481601,_0x47019a[_0x8705('0x15')][_0x8705('0x16')]);return _0x1caa6b(_0x47019a[_0x8705('0x15')][_0x8705('0x16')]);}else{logger[_0x8705('0x10')](_0x8705('0x11'),_0x481601,_0x8705('0x12'));_0x1caa6b(_0x47019a[_0x8705('0x17')]['message']);}})['catch'](function(_0x5a6503){logger[_0x8705('0x15')](_0x8705('0x11'),_0x481601,_0x5a6503);_0x435b8b(_0x5a6503);});});}exports['ShowSquareProject']=function(_0x39ab26){var _0x59ff56=this;return new Promise(function(_0x5ed42b,_0x4f22bd){return db[_0x8705('0x18')]['find']({'raw':_0x39ab26[_0x8705('0x19')]?_0x39ab26[_0x8705('0x19')][_0x8705('0x1a')]===undefined?!![]:![]:!![],'where':_0x39ab26[_0x8705('0x19')]?_0x39ab26[_0x8705('0x19')][_0x8705('0x1b')]||null:null,'attributes':_0x39ab26[_0x8705('0x19')]?_0x39ab26[_0x8705('0x19')]['attributes']||null:null,'include':_0x39ab26[_0x8705('0x19')]?_0x39ab26['options'][_0x8705('0x1c')]?_[_0x8705('0x1d')](_0x39ab26[_0x8705('0x19')][_0x8705('0x1c')],function(_0x5ad766){return{'model':db[_0x5ad766[_0x8705('0x1e')]],'as':_0x5ad766['as'],'attributes':_0x5ad766[_0x8705('0x1f')],'include':_0x5ad766['include']?_[_0x8705('0x1d')](_0x5ad766[_0x8705('0x1c')],function(_0x3b3e20){return{'model':db[_0x3b3e20[_0x8705('0x1e')]],'as':_0x3b3e20['as'],'attributes':_0x3b3e20[_0x8705('0x1f')],'include':_0x3b3e20['include']?_['map'](_0x3b3e20[_0x8705('0x1c')],function(_0xecbd91){return{'model':db[_0xecbd91[_0x8705('0x1e')]],'as':_0xecbd91['as'],'attributes':_0xecbd91[_0x8705('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd871d3){logger['info']('ShowSquareProject',_0x39ab26);logger[_0x8705('0x20')](_0x8705('0x21'),_0x39ab26,JSON['stringify'](_0xd871d3));_0x5ed42b(_0xd871d3);})[_0x8705('0x22')](function(_0x4880fa){logger[_0x8705('0x15')](_0x8705('0x21'),_0x4880fa[_0x8705('0x16')],_0x39ab26);_0x4f22bd(_0x59ff56['error'](0x1f4,_0x4880fa['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index d9a583b..9a11f56 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 _0x1cf9=['register','squareProject:','./squareProject.events','remove','update','emit','removeListener'];(function(_0x46cf17,_0x3926f9){var _0x4edb7c=function(_0x320889){while(--_0x320889){_0x46cf17['push'](_0x46cf17['shift']());}};_0x4edb7c(++_0x3926f9);}(_0x1cf9,0x1c2));var _0x91cf=function(_0x2eb1af,_0x2cfe61){_0x2eb1af=_0x2eb1af-0x0;var _0x439ec5=_0x1cf9[_0x2eb1af];return _0x439ec5;};'use strict';var SquareProjectEvents=require(_0x91cf('0x0'));var events=['save',_0x91cf('0x1'),_0x91cf('0x2')];function createListener(_0x72fe55,_0x5ed7db){return function(_0x8a7dca){_0x5ed7db[_0x91cf('0x3')](_0x72fe55,_0x8a7dca);};}function removeListener(_0x3ad510,_0x51a269){return function(){SquareProjectEvents[_0x91cf('0x4')](_0x3ad510,_0x51a269);};}exports[_0x91cf('0x5')]=function(_0x54107e){for(var _0x3a4e87=0x0,_0x8d18c2=events['length'];_0x3a4e87<_0x8d18c2;_0x3a4e87++){var _0x5d78c0=events[_0x3a4e87];var _0xd8456c=createListener(_0x91cf('0x6')+_0x5d78c0,_0x54107e);SquareProjectEvents['on'](_0x5d78c0,_0xd8456c);}}; \ No newline at end of file +var _0x0fc2=['update','removeListener','register'];(function(_0x419ad5,_0x1a8470){var _0x31fbd1=function(_0x15b7d8){while(--_0x15b7d8){_0x419ad5['push'](_0x419ad5['shift']());}};_0x31fbd1(++_0x1a8470);}(_0x0fc2,0x156));var _0x20fc=function(_0x13468d,_0x4bc728){_0x13468d=_0x13468d-0x0;var _0x44c2e9=_0x0fc2[_0x13468d];return _0x44c2e9;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0x20fc('0x0')];function createListener(_0x232432,_0x17e783){return function(_0x4699e3){_0x17e783['emit'](_0x232432,_0x4699e3);};}function removeListener(_0x2108a4,_0x229d94){return function(){SquareProjectEvents[_0x20fc('0x1')](_0x2108a4,_0x229d94);};}exports[_0x20fc('0x2')]=function(_0x48d39f){for(var _0x5260dd=0x0,_0x5347fa=events['length'];_0x5260dd<_0x5347fa;_0x5260dd++){var _0x2697f8=events[_0x5260dd];var _0x44aed0=createListener('squareProject:'+_0x2697f8,_0x48d39f);SquareProjectEvents['on'](_0x2697f8,_0x44aed0);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b47ad22..13a674d 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x2eeddf,_0x5ea2d8){var _0x1b39ba=function(_0x1bb591){while(--_0x1bb591){_0x2eeddf['push'](_0x2eeddf['shift']());}};_0x1b39ba(++_0x5ea2d8);}(_0xabce,0x103));var _0xeabc=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xabce[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file +var _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(_0x2c79ee,_0x234b80){var _0x11c933=function(_0x422c30){while(--_0x422c30){_0x2c79ee['push'](_0x2c79ee['shift']());}};_0x11c933(++_0x234b80);}(_0xf494,0x1c6));var _0x4f49=function(_0xb91bb0,_0xf0151e){_0xb91bb0=_0xb91bb0-0x0;var _0x149b67=_0xf494[_0xb91bb0];return _0x149b67;};'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 diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index fb01798..5176e29 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x301a76,_0x2e8a8b){var _0x435ad5=function(_0x1d7653){while(--_0x1d7653){_0x301a76['push'](_0x301a76['shift']());}};_0x435ad5(++_0x2e8a8b);}(_0x814b,0x1a2));var _0xb814=function(_0x1fa760,_0x1bf063){_0x1fa760=_0x1fa760-0x0;var _0xd8eda1=_0x814b[_0x1fa760];return _0xd8eda1;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'uniqueid':{'type':Sequelize[_0xb814('0x2')]},'callerid':{'type':Sequelize[_0xb814('0x2')]},'calleridname':{'type':Sequelize[_0xb814('0x2')]},'context':{'type':Sequelize[_0xb814('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb814('0x2')]},'accountcode':{'type':Sequelize[_0xb814('0x2')]},'dnid':{'type':Sequelize[_0xb814('0x2')]},'projectName':{'type':Sequelize[_0xb814('0x2')]},'saveName':{'type':Sequelize[_0xb814('0x2')]},'filename':{'type':Sequelize[_0xb814('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xb814('0x3')],'get':function(){var _0x2e6272='';var _0x5c8539=this[_0xb814('0x4')](_0xb814('0x5'));if(_0x5c8539){_0x2e6272=_0x5c8539[_0xb814('0x6')](_0x5c8539[_0xb814('0x7')]('.'));}return _0x2e6272;}}}; \ No newline at end of file +var _0x8ef6=['VIRTUAL','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x3f2146,_0x4e86a4){var _0xc33e7d=function(_0x3f0dd3){while(--_0x3f0dd3){_0x3f2146['push'](_0x3f2146['shift']());}};_0xc33e7d(++_0x4e86a4);}(_0x8ef6,0xf2));var _0x68ef=function(_0x491899,_0x4ae398){_0x491899=_0x491899-0x0;var _0x533675=_0x8ef6[_0x491899];return _0x533675;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'callerid':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize[_0x68ef('0x2')]},'extension':{'type':Sequelize[_0x68ef('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'dnid':{'type':Sequelize[_0x68ef('0x2')]},'projectName':{'type':Sequelize[_0x68ef('0x2')]},'saveName':{'type':Sequelize[_0x68ef('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x68ef('0x3')],'get':function(){var _0x4740e8='';var _0x2de776=this['getDataValue'](_0x68ef('0x4'));if(_0x2de776){_0x4740e8=_0x2de776[_0x68ef('0x5')](_0x2de776[_0x68ef('0x6')]('.'));}return _0x4740e8;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 9b3e2f4..a23a4d5 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 _0xccdb=['filter','merge','include','findAll','catch','show','params','intersection','includeAll','options','create','body','download','../../components/encryptor','uniqueid','find','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','.cypher','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0xccdb,0x149));var _0xbccd=function(_0x299bdb,_0x2b5758){_0x299bdb=_0x299bdb-0x0;var _0x593569=_0xccdb[_0x299bdb];return _0x593569;};'use strict';var emlformat=require(_0xbccd('0x0'));var rimraf=require(_0xbccd('0x1'));var zipdir=require(_0xbccd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbccd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbccd('0x4'));var util=require(_0xbccd('0x5'));var path=require(_0xbccd('0x6'));var sox=require(_0xbccd('0x7'));var csv=require(_0xbccd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbccd('0x9'));var _=require(_0xbccd('0xa'));var squel=require(_0xbccd('0xb'));var crypto=require(_0xbccd('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbccd('0x8'));var querystring=require(_0xbccd('0xd'));var Papa=require(_0xbccd('0xe'));var Redis=require(_0xbccd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbccd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbccd('0x11'));var logger=require(_0xbccd('0x12'))(_0xbccd('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbccd('0x14'));var db=require(_0xbccd('0x15'))['db'];function respondWithStatusCode(_0x1d56a7,_0x44d415){_0x44d415=_0x44d415||0xcc;return function(_0xb7c21c){if(_0xb7c21c){return _0x1d56a7[_0xbccd('0x16')](_0x44d415);}return _0x1d56a7[_0xbccd('0x17')](_0x44d415)['end']();};}function respondWithResult(_0x1d53cd,_0x88b557){_0x88b557=_0x88b557||0xc8;return function(_0x205940){if(_0x205940){return _0x1d53cd[_0xbccd('0x17')](_0x88b557)['json'](_0x205940);}};}function respondWithFilteredResult(_0x302506,_0x3a870a){return function(_0x463236){if(_0x463236){var _0x45c798=typeof _0x3a870a[_0xbccd('0x18')]==='undefined'&&typeof _0x3a870a[_0xbccd('0x19')]===_0xbccd('0x1a');var _0x4f7cc9=_0x463236[_0xbccd('0x1b')];var _0x153960=_0x45c798?0x0:_0x3a870a['offset'];var _0x18b1fa=_0x45c798?_0x463236[_0xbccd('0x1b')]:_0x3a870a[_0xbccd('0x18')]+_0x3a870a['limit'];var _0x51b65f;if(_0x18b1fa>=_0x4f7cc9){_0x18b1fa=_0x4f7cc9;_0x51b65f=0xc8;}else{_0x51b65f=0xce;}_0x302506[_0xbccd('0x17')](_0x51b65f);return _0x302506[_0xbccd('0x1c')](_0xbccd('0x1d'),_0x153960+'-'+_0x18b1fa+'/'+_0x4f7cc9)[_0xbccd('0x1e')](_0x463236);}return null;};}function patchUpdates(_0x2fea92){return function(_0xd59f0c){try{jsonpatch[_0xbccd('0x1f')](_0xd59f0c,_0x2fea92,!![]);}catch(_0x31bc31){return BPromise[_0xbccd('0x20')](_0x31bc31);}return _0xd59f0c[_0xbccd('0x21')]();};}function saveUpdates(_0x6997d9,_0x510401){return function(_0x401146){if(_0x401146){return _0x401146[_0xbccd('0x22')](_0x6997d9)[_0xbccd('0x23')](function(_0x1acccc){return _0x1acccc;});}return null;};}function removeEntity(_0x148b8b,_0x454786){return function(_0x30b226){if(_0x30b226){return _0x30b226[_0xbccd('0x24')]()[_0xbccd('0x23')](function(){_0x148b8b['status'](0xcc)[_0xbccd('0x25')]();});}};}function handleEntityNotFound(_0x1942a3,_0x2ccb08){return function(_0x44d1ca){if(!_0x44d1ca){_0x1942a3[_0xbccd('0x16')](0x194);}return _0x44d1ca;};}function handleError(_0x32f64e,_0x24e873){_0x24e873=_0x24e873||0x1f4;return function(_0x2cbe08){logger[_0xbccd('0x26')](_0x2cbe08[_0xbccd('0x27')]);if(_0x2cbe08[_0xbccd('0x28')]){delete _0x2cbe08[_0xbccd('0x28')];}_0x32f64e[_0xbccd('0x17')](_0x24e873)[_0xbccd('0x29')](_0x2cbe08);};}exports[_0xbccd('0x2a')]=function(_0x5693f0,_0x24d7b4){var _0x278877={},_0x21b921={},_0x527025={'count':0x0,'rows':[]};var _0x257fb9=_[_0xbccd('0x2b')](db[_0xbccd('0x2c')][_0xbccd('0x2d')],function(_0x68dac5){return{'name':_0x68dac5[_0xbccd('0x2e')],'type':_0x68dac5[_0xbccd('0x2f')]['key']};});_0x21b921[_0xbccd('0x30')]=_[_0xbccd('0x2b')](_0x257fb9,'name');_0x21b921[_0xbccd('0x31')]=_[_0xbccd('0x32')](_0x5693f0[_0xbccd('0x31')]);_0x21b921[_0xbccd('0x33')]=_['intersection'](_0x21b921['model'],_0x21b921[_0xbccd('0x31')]);_0x278877[_0xbccd('0x34')]=_['intersection'](_0x21b921['model'],qs[_0xbccd('0x35')](_0x5693f0[_0xbccd('0x31')][_0xbccd('0x35')]));_0x278877['attributes']=_0x278877[_0xbccd('0x34')][_0xbccd('0x36')]?_0x278877[_0xbccd('0x34')]:_0x21b921[_0xbccd('0x30')];if(!_0x5693f0[_0xbccd('0x31')]['hasOwnProperty'](_0xbccd('0x37'))){_0x278877['limit']=qs['limit'](_0x5693f0[_0xbccd('0x31')][_0xbccd('0x19')]);_0x278877[_0xbccd('0x18')]=qs[_0xbccd('0x18')](_0x5693f0['query'][_0xbccd('0x18')]);}_0x278877['order']=qs[_0xbccd('0x38')](_0x5693f0[_0xbccd('0x31')]['sort']);_0x278877[_0xbccd('0x39')]=qs[_0xbccd('0x33')](_[_0xbccd('0x3a')](_0x5693f0['query'],_0x21b921['filters']),_0x257fb9);if(_0x5693f0[_0xbccd('0x31')][_0xbccd('0x3b')]){_0x278877[_0xbccd('0x39')]=_[_0xbccd('0x3c')](_0x278877[_0xbccd('0x39')],{'$or':_[_0xbccd('0x2b')](_0x257fb9,function(_0x552eea){if(_0x552eea[_0xbccd('0x2f')]!=='VIRTUAL'){var _0x4624b8={};_0x4624b8[_0x552eea[_0xbccd('0x28')]]={'$like':'%'+_0x5693f0[_0xbccd('0x31')][_0xbccd('0x3b')]+'%'};return _0x4624b8;}})});}_0x278877=_[_0xbccd('0x3c')]({},_0x278877,_0x5693f0['options']);var _0x5ad4c8={'where':_0x278877[_0xbccd('0x39')]};return db[_0xbccd('0x2c')][_0xbccd('0x1b')](_0x5ad4c8)[_0xbccd('0x23')](function(_0x2a788e){_0x527025['count']=_0x2a788e;if(_0x5693f0[_0xbccd('0x31')]['includeAll']){_0x278877[_0xbccd('0x3d')]=[{'all':!![]}];}return db['SquareRecording'][_0xbccd('0x3e')](_0x278877);})[_0xbccd('0x23')](function(_0x544d4e){_0x527025['rows']=_0x544d4e;return _0x527025;})[_0xbccd('0x23')](respondWithFilteredResult(_0x24d7b4,_0x278877))[_0xbccd('0x3f')](handleError(_0x24d7b4,null));};exports[_0xbccd('0x40')]=function(_0xc26f8c,_0x40ccb7){var _0x54762c={'raw':!![],'where':{'id':_0xc26f8c[_0xbccd('0x41')]['id']}},_0x4af575={};_0x4af575[_0xbccd('0x30')]=_[_0xbccd('0x32')](db[_0xbccd('0x2c')][_0xbccd('0x2d')]);_0x4af575['query']=_[_0xbccd('0x32')](_0xc26f8c['query']);_0x4af575['filters']=_[_0xbccd('0x42')](_0x4af575[_0xbccd('0x30')],_0x4af575[_0xbccd('0x31')]);_0x54762c[_0xbccd('0x34')]=_[_0xbccd('0x42')](_0x4af575['model'],qs[_0xbccd('0x35')](_0xc26f8c[_0xbccd('0x31')][_0xbccd('0x35')]));_0x54762c[_0xbccd('0x34')]=_0x54762c[_0xbccd('0x34')][_0xbccd('0x36')]?_0x54762c[_0xbccd('0x34')]:_0x4af575[_0xbccd('0x30')];if(_0xc26f8c[_0xbccd('0x31')][_0xbccd('0x43')]){_0x54762c[_0xbccd('0x3d')]=[{'all':!![]}];}_0x54762c=_[_0xbccd('0x3c')]({},_0x54762c,_0xc26f8c[_0xbccd('0x44')]);return db[_0xbccd('0x2c')]['find'](_0x54762c)[_0xbccd('0x23')](handleEntityNotFound(_0x40ccb7,null))[_0xbccd('0x23')](respondWithResult(_0x40ccb7,null))[_0xbccd('0x3f')](handleError(_0x40ccb7,null));};exports[_0xbccd('0x45')]=function(_0x829cdf,_0x4d407a){return db['SquareRecording']['create'](_0x829cdf['body'],{})[_0xbccd('0x23')](respondWithResult(_0x4d407a,0xc9))[_0xbccd('0x3f')](handleError(_0x4d407a,null));};exports[_0xbccd('0x22')]=function(_0xd4fbff,_0x3f890a){if(_0xd4fbff[_0xbccd('0x46')]['id']){delete _0xd4fbff[_0xbccd('0x46')]['id'];}return db[_0xbccd('0x2c')]['find']({'where':{'id':_0xd4fbff[_0xbccd('0x41')]['id']}})['then'](handleEntityNotFound(_0x3f890a,null))[_0xbccd('0x23')](saveUpdates(_0xd4fbff['body'],null))['then'](respondWithResult(_0x3f890a,null))[_0xbccd('0x3f')](handleError(_0x3f890a,null));};exports[_0xbccd('0x47')]=function(_0x25401a,_0x3ede21,_0x385f83){var _0x3198b8=require(_0xbccd('0x48'));var _0x3a708b=![];var _0x20d160={};if(_0x25401a[_0xbccd('0x31')][_0xbccd('0x2f')]&&_0x25401a[_0xbccd('0x31')]['type']==='uniqueid'){_0x20d160[_0xbccd('0x49')]=_0x25401a[_0xbccd('0x41')]['id'];}else{_0x20d160['id']=_0x25401a['params']['id'];}return db['SquareRecording'][_0xbccd('0x4a')]({'where':_0x20d160,'attributes':['id',_0xbccd('0x4b'),_0xbccd('0x4c')],'raw':!![]})[_0xbccd('0x23')](handleEntityNotFound(_0x3ede21,null))['then'](function(_0x30cbdb){if(_0x30cbdb){var _0x271c20=_0x30cbdb[_0xbccd('0x4b')];var _0x1ee271=util[_0xbccd('0x4d')](_0xbccd('0x4e'),_0x271c20);if(fs['existsSync'](_0x1ee271)){_0x3a708b=!![];return _0x3198b8[_0xbccd('0x4f')](_0x1ee271,_0x271c20,config[_0xbccd('0x50')][_0xbccd('0x51')])[_0xbccd('0x23')](function(){return _0x30cbdb;});}return _0x30cbdb;}})[_0xbccd('0x23')](function(_0x48350e){if(_0x48350e){var _0x11683c=_0x48350e[_0xbccd('0x4b')];if(!fs[_0xbccd('0x52')](_0x11683c)){throw new db[(_0xbccd('0x53'))][(_0xbccd('0x54'))](_0xbccd('0x55'));}if(_0x48350e[_0xbccd('0x4c')]){return _0x3ede21['download'](_0x11683c,_0x48350e[_0xbccd('0x4c')]+path[_0xbccd('0x56')](_0x11683c),function(){if(_0x3a708b){fs[_0xbccd('0x57')](_0x11683c);}});}else{return _0x3ede21[_0xbccd('0x47')](_0x11683c,function(_0x49263a){if(_0x3a708b){fs[_0xbccd('0x57')](_0x11683c);}});}}})[_0xbccd('0x3f')](function(_0x2a6455){if(_0x2a6455[_0xbccd('0x58')]===_0xbccd('0x55')){_0x3ede21[_0xbccd('0x17')](0x194)[_0xbccd('0x29')]('Not\x20found');}else{return handleError(_0x3ede21,null);}});};exports['destroy']=function(_0x44e9ce,_0x2964e1){return db[_0xbccd('0x2c')][_0xbccd('0x4a')]({'where':{'id':_0x44e9ce['params']['id']}})[_0xbccd('0x23')](function(_0x4de354){if(_[_0xbccd('0x59')](_0x4de354)){throw new ReferenceError(_0xbccd('0x5a'));}return _0x4de354;})[_0xbccd('0x23')](function(_0x54eebb){var _0x207a00=_0x54eebb[_0xbccd('0x4b')];logger['info'](_0xbccd('0x5b'),_0x207a00);if(!_['isNil'](_0x54eebb[_0xbccd('0x4b')])&&fs[_0xbccd('0x52')](_0x207a00)){logger['info']('File:\x20\x22'+_0x207a00+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x207a00);}_0x207a00=_0x207a00+_0xbccd('0x5c');if(!_[_0xbccd('0x59')](_0x54eebb[_0xbccd('0x4b')])&&fs['existsSync'](_0x207a00)){logger[_0xbccd('0x5d')](_0xbccd('0x5e')+_0x207a00+_0xbccd('0x5f'));fs[_0xbccd('0x60')](_0x207a00);}return _0x54eebb;})[_0xbccd('0x23')](function(_0x3d2c18){if(!_0x3d2c18)throw new InternalError();return _0x3d2c18[_0xbccd('0x24')]();})['then'](function(){_0x2964e1[_0xbccd('0x17')](0xcc)[_0xbccd('0x25')]();})['catch'](handleError(_0x2964e1,null));}; \ No newline at end of file +var _0xca4c=['bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','SquareRecording','rawAttributes','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','update','body','download','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','Entity\x20not\x20found','info','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x17d090,_0x4fc0c7){var _0x1c89b8=function(_0x22b90a){while(--_0x22b90a){_0x17d090['push'](_0x17d090['shift']());}};_0x1c89b8(++_0x4fc0c7);}(_0xca4c,0x1ea));var _0xcca4=function(_0x3f5f1a,_0x47bf16){_0x3f5f1a=_0x3f5f1a-0x0;var _0x3d28bd=_0xca4c[_0x3f5f1a];return _0x3d28bd;};'use strict';var emlformat=require(_0xcca4('0x0'));var rimraf=require(_0xcca4('0x1'));var zipdir=require(_0xcca4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcca4('0x3'));var moment=require(_0xcca4('0x4'));var BPromise=require(_0xcca4('0x5'));var Mustache=require('mustache');var util=require(_0xcca4('0x6'));var path=require('path');var sox=require(_0xcca4('0x7'));var csv=require(_0xcca4('0x8'));var ejs=require(_0xcca4('0x9'));var fs=require('fs');var fs_extra=require(_0xcca4('0xa'));var _=require(_0xcca4('0xb'));var squel=require(_0xcca4('0xc'));var crypto=require(_0xcca4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xcca4('0xe'));var toCsv=require(_0xcca4('0x8'));var querystring=require(_0xcca4('0xf'));var Papa=require(_0xcca4('0x10'));var Redis=require(_0xcca4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcca4('0x12'));var as=require(_0xcca4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcca4('0x14'))(_0xcca4('0x15'));var utils=require(_0xcca4('0x16'));var config=require(_0xcca4('0x17'));var licenseUtil=require(_0xcca4('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27f9e2,_0x52ea06){_0x52ea06=_0x52ea06||0xcc;return function(_0x3f6c62){if(_0x3f6c62){return _0x27f9e2['sendStatus'](_0x52ea06);}return _0x27f9e2[_0xcca4('0x19')](_0x52ea06)[_0xcca4('0x1a')]();};}function respondWithResult(_0x89b4bd,_0xfdfe46){_0xfdfe46=_0xfdfe46||0xc8;return function(_0x591eb8){if(_0x591eb8){return _0x89b4bd[_0xcca4('0x19')](_0xfdfe46)[_0xcca4('0x1b')](_0x591eb8);}};}function respondWithFilteredResult(_0x3ff84d,_0x15c34f){return function(_0x2749b4){if(_0x2749b4){var _0x1bed14=typeof _0x15c34f[_0xcca4('0x1c')]===_0xcca4('0x1d')&&typeof _0x15c34f[_0xcca4('0x1e')]===_0xcca4('0x1d');var _0x12dde0=_0x2749b4[_0xcca4('0x1f')];var _0x39c410=_0x1bed14?0x0:_0x15c34f[_0xcca4('0x1c')];var _0x230be6=_0x1bed14?_0x2749b4[_0xcca4('0x1f')]:_0x15c34f[_0xcca4('0x1c')]+_0x15c34f[_0xcca4('0x1e')];var _0x16cb6a;if(_0x230be6>=_0x12dde0){_0x230be6=_0x12dde0;_0x16cb6a=0xc8;}else{_0x16cb6a=0xce;}_0x3ff84d[_0xcca4('0x19')](_0x16cb6a);return _0x3ff84d[_0xcca4('0x20')](_0xcca4('0x21'),_0x39c410+'-'+_0x230be6+'/'+_0x12dde0)['json'](_0x2749b4);}return null;};}function patchUpdates(_0x141c6b){return function(_0x2136cc){try{jsonpatch[_0xcca4('0x22')](_0x2136cc,_0x141c6b,!![]);}catch(_0x52c291){return BPromise[_0xcca4('0x23')](_0x52c291);}return _0x2136cc[_0xcca4('0x24')]();};}function saveUpdates(_0x1651ec,_0x360c27){return function(_0x73b96d){if(_0x73b96d){return _0x73b96d['update'](_0x1651ec)[_0xcca4('0x25')](function(_0x3f2191){return _0x3f2191;});}return null;};}function removeEntity(_0xed9fc6,_0xd4c750){return function(_0x411bd8){if(_0x411bd8){return _0x411bd8[_0xcca4('0x26')]()[_0xcca4('0x25')](function(){_0xed9fc6['status'](0xcc)[_0xcca4('0x1a')]();});}};}function handleEntityNotFound(_0x51a65b,_0x296286){return function(_0x16bbcd){if(!_0x16bbcd){_0x51a65b[_0xcca4('0x27')](0x194);}return _0x16bbcd;};}function handleError(_0x22ec53,_0x592247){_0x592247=_0x592247||0x1f4;return function(_0xa70006){logger['error'](_0xa70006[_0xcca4('0x28')]);if(_0xa70006[_0xcca4('0x29')]){delete _0xa70006[_0xcca4('0x29')];}_0x22ec53['status'](_0x592247)[_0xcca4('0x2a')](_0xa70006);};}exports[_0xcca4('0x2b')]=function(_0x1169ac,_0x1aa46b){var _0x1e7b18={},_0x3e69e5={},_0x3c6e78={'count':0x0,'rows':[]};var _0x1236bd=_['map'](db[_0xcca4('0x2c')][_0xcca4('0x2d')],function(_0x3a3937){return{'name':_0x3a3937['fieldName'],'type':_0x3a3937[_0xcca4('0x2e')][_0xcca4('0x2f')]};});_0x3e69e5[_0xcca4('0x30')]=_[_0xcca4('0x31')](_0x1236bd,_0xcca4('0x29'));_0x3e69e5[_0xcca4('0x32')]=_['keys'](_0x1169ac[_0xcca4('0x32')]);_0x3e69e5['filters']=_[_0xcca4('0x33')](_0x3e69e5[_0xcca4('0x30')],_0x3e69e5[_0xcca4('0x32')]);_0x1e7b18['attributes']=_[_0xcca4('0x33')](_0x3e69e5[_0xcca4('0x30')],qs['fields'](_0x1169ac[_0xcca4('0x32')][_0xcca4('0x34')]));_0x1e7b18['attributes']=_0x1e7b18[_0xcca4('0x35')][_0xcca4('0x36')]?_0x1e7b18['attributes']:_0x3e69e5[_0xcca4('0x30')];if(!_0x1169ac['query'][_0xcca4('0x37')](_0xcca4('0x38'))){_0x1e7b18[_0xcca4('0x1e')]=qs['limit'](_0x1169ac[_0xcca4('0x32')]['limit']);_0x1e7b18[_0xcca4('0x1c')]=qs['offset'](_0x1169ac[_0xcca4('0x32')]['offset']);}_0x1e7b18[_0xcca4('0x39')]=qs[_0xcca4('0x3a')](_0x1169ac[_0xcca4('0x32')][_0xcca4('0x3a')]);_0x1e7b18[_0xcca4('0x3b')]=qs[_0xcca4('0x3c')](_[_0xcca4('0x3d')](_0x1169ac['query'],_0x3e69e5[_0xcca4('0x3c')]),_0x1236bd);if(_0x1169ac[_0xcca4('0x32')][_0xcca4('0x3e')]){_0x1e7b18[_0xcca4('0x3b')]=_[_0xcca4('0x3f')](_0x1e7b18[_0xcca4('0x3b')],{'$or':_[_0xcca4('0x31')](_0x1236bd,function(_0x1844cd){if(_0x1844cd[_0xcca4('0x2e')]!=='VIRTUAL'){var _0x4c83f2={};_0x4c83f2[_0x1844cd['name']]={'$like':'%'+_0x1169ac[_0xcca4('0x32')][_0xcca4('0x3e')]+'%'};return _0x4c83f2;}})});}_0x1e7b18=_['merge']({},_0x1e7b18,_0x1169ac[_0xcca4('0x40')]);var _0x1f3f23={'where':_0x1e7b18['where']};return db[_0xcca4('0x2c')][_0xcca4('0x1f')](_0x1f3f23)[_0xcca4('0x25')](function(_0x508884){_0x3c6e78[_0xcca4('0x1f')]=_0x508884;if(_0x1169ac[_0xcca4('0x32')][_0xcca4('0x41')]){_0x1e7b18[_0xcca4('0x42')]=[{'all':!![]}];}return db['SquareRecording'][_0xcca4('0x43')](_0x1e7b18);})[_0xcca4('0x25')](function(_0xcebd34){_0x3c6e78[_0xcca4('0x44')]=_0xcebd34;return _0x3c6e78;})['then'](respondWithFilteredResult(_0x1aa46b,_0x1e7b18))[_0xcca4('0x45')](handleError(_0x1aa46b,null));};exports['show']=function(_0x52b504,_0x22e45e){var _0x176b8a={'raw':!![],'where':{'id':_0x52b504[_0xcca4('0x46')]['id']}},_0x144005={};_0x144005[_0xcca4('0x30')]=_['keys'](db['SquareRecording'][_0xcca4('0x2d')]);_0x144005[_0xcca4('0x32')]=_[_0xcca4('0x47')](_0x52b504[_0xcca4('0x32')]);_0x144005[_0xcca4('0x3c')]=_[_0xcca4('0x33')](_0x144005[_0xcca4('0x30')],_0x144005[_0xcca4('0x32')]);_0x176b8a[_0xcca4('0x35')]=_[_0xcca4('0x33')](_0x144005[_0xcca4('0x30')],qs['fields'](_0x52b504[_0xcca4('0x32')][_0xcca4('0x34')]));_0x176b8a[_0xcca4('0x35')]=_0x176b8a['attributes'][_0xcca4('0x36')]?_0x176b8a['attributes']:_0x144005[_0xcca4('0x30')];if(_0x52b504['query']['includeAll']){_0x176b8a[_0xcca4('0x42')]=[{'all':!![]}];}_0x176b8a=_[_0xcca4('0x3f')]({},_0x176b8a,_0x52b504['options']);return db[_0xcca4('0x2c')][_0xcca4('0x48')](_0x176b8a)['then'](handleEntityNotFound(_0x22e45e,null))[_0xcca4('0x25')](respondWithResult(_0x22e45e,null))[_0xcca4('0x45')](handleError(_0x22e45e,null));};exports['create']=function(_0x5e4808,_0x42f85e){return db[_0xcca4('0x2c')][_0xcca4('0x49')](_0x5e4808['body'],{})[_0xcca4('0x25')](respondWithResult(_0x42f85e,0xc9))['catch'](handleError(_0x42f85e,null));};exports[_0xcca4('0x4a')]=function(_0x3221c5,_0x139472){if(_0x3221c5[_0xcca4('0x4b')]['id']){delete _0x3221c5[_0xcca4('0x4b')]['id'];}return db[_0xcca4('0x2c')][_0xcca4('0x48')]({'where':{'id':_0x3221c5[_0xcca4('0x46')]['id']}})[_0xcca4('0x25')](handleEntityNotFound(_0x139472,null))[_0xcca4('0x25')](saveUpdates(_0x3221c5['body'],null))[_0xcca4('0x25')](respondWithResult(_0x139472,null))['catch'](handleError(_0x139472,null));};exports[_0xcca4('0x4c')]=function(_0x22d4f6,_0x3167c3,_0x141cb5){var _0x27513a=require(_0xcca4('0x4d'));var _0x506325=![];var _0x2d7f8c={};if(_0x22d4f6[_0xcca4('0x32')][_0xcca4('0x2e')]&&_0x22d4f6[_0xcca4('0x32')][_0xcca4('0x2e')]==='uniqueid'){_0x2d7f8c[_0xcca4('0x4e')]=_0x22d4f6['params']['id'];}else{_0x2d7f8c['id']=_0x22d4f6[_0xcca4('0x46')]['id'];}return db[_0xcca4('0x2c')][_0xcca4('0x48')]({'where':_0x2d7f8c,'attributes':['id','savePath',_0xcca4('0x4f')],'raw':!![]})[_0xcca4('0x25')](handleEntityNotFound(_0x3167c3,null))[_0xcca4('0x25')](function(_0xc95cb){if(_0xc95cb){var _0x5bcabc=_0xc95cb[_0xcca4('0x50')];var _0x562398=util[_0xcca4('0x51')](_0xcca4('0x52'),_0x5bcabc);if(fs['existsSync'](_0x562398)){_0x506325=!![];return _0x27513a[_0xcca4('0x53')](_0x562398,_0x5bcabc,config[_0xcca4('0x54')][_0xcca4('0x55')])[_0xcca4('0x25')](function(){return _0xc95cb;});}return _0xc95cb;}})[_0xcca4('0x25')](function(_0x1d84d8){if(_0x1d84d8){var _0x13b907=_0x1d84d8['savePath'];if(!fs[_0xcca4('0x56')](_0x13b907)){throw new db[(_0xcca4('0x57'))][(_0xcca4('0x58'))](_0xcca4('0x59'));}if(_0x1d84d8['filename']){return _0x3167c3[_0xcca4('0x4c')](_0x13b907,_0x1d84d8[_0xcca4('0x4f')]+path[_0xcca4('0x5a')](_0x13b907),function(){if(_0x506325){fs[_0xcca4('0x5b')](_0x13b907);}});}else{return _0x3167c3[_0xcca4('0x4c')](_0x13b907,function(_0x5239b0){if(_0x506325){fs['unlink'](_0x13b907);}});}}})[_0xcca4('0x45')](function(_0x1cec14){if(_0x1cec14['message']===_0xcca4('0x59')){_0x3167c3[_0xcca4('0x19')](0x194)[_0xcca4('0x2a')]('Not\x20found');}else{return handleError(_0x3167c3,null);}});};exports['destroy']=function(_0x280174,_0x5b97e2){return db[_0xcca4('0x2c')][_0xcca4('0x48')]({'where':{'id':_0x280174[_0xcca4('0x46')]['id']}})[_0xcca4('0x25')](function(_0x55bbb3){if(_['isNil'](_0x55bbb3)){throw new ReferenceError(_0xcca4('0x5c'));}return _0x55bbb3;})[_0xcca4('0x25')](function(_0x28183e){var _0x2d4dee=_0x28183e['savePath'];logger[_0xcca4('0x5d')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d4dee);if(!_[_0xcca4('0x5e')](_0x28183e[_0xcca4('0x50')])&&fs[_0xcca4('0x56')](_0x2d4dee)){logger[_0xcca4('0x5d')]('File:\x20\x22'+_0x2d4dee+_0xcca4('0x5f'));fs[_0xcca4('0x60')](_0x2d4dee);}_0x2d4dee=_0x2d4dee+_0xcca4('0x61');if(!_[_0xcca4('0x5e')](_0x28183e[_0xcca4('0x50')])&&fs[_0xcca4('0x56')](_0x2d4dee)){logger['info'](_0xcca4('0x62')+_0x2d4dee+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x2d4dee);}return _0x28183e;})[_0xcca4('0x25')](function(_0x111001){if(!_0x111001)throw new InternalError();return _0x111001[_0xcca4('0x26')]();})[_0xcca4('0x25')](function(){_0x5b97e2['status'](0xcc)[_0xcca4('0x1a')]();})[_0xcca4('0x45')](handleError(_0x5b97e2,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 6ad58fa..88712e0 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 _0x5655=['../../config/logger','api','moment','bluebird','rimraf','./squareRecording.attributes','exports','define','square_recordings','lodash','util'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x5655,0x15e));var _0x5565=function(_0x98f05c,_0x5e478e){_0x98f05c=_0x98f05c-0x0;var _0x568e07=_0x5655[_0x98f05c];return _0x568e07;};'use strict';var _=require(_0x5565('0x0'));var util=require(_0x5565('0x1'));var logger=require(_0x5565('0x2'))(_0x5565('0x3'));var moment=require(_0x5565('0x4'));var BPromise=require(_0x5565('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5565('0x6'));var config=require('../../config/environment');var attributes=require(_0x5565('0x7'));module[_0x5565('0x8')]=function(_0x37954f,_0x93a8e5){return _0x37954f[_0x5565('0x9')]('SquareRecording',attributes,{'tableName':_0x5565('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5502=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports'];(function(_0x58547b,_0x4b89c2){var _0x1d3fd2=function(_0x4ac500){while(--_0x4ac500){_0x58547b['push'](_0x58547b['shift']());}};_0x1d3fd2(++_0x4b89c2);}(_0x5502,0x69));var _0x2550=function(_0x25e040,_0x5834dc){_0x25e040=_0x25e040-0x0;var _0xe60a0d=_0x5502[_0x25e040];return _0xe60a0d;};'use strict';var _=require(_0x2550('0x0'));var util=require(_0x2550('0x1'));var logger=require(_0x2550('0x2'))(_0x2550('0x3'));var moment=require(_0x2550('0x4'));var BPromise=require(_0x2550('0x5'));var rp=require(_0x2550('0x6'));var fs=require('fs');var path=require(_0x2550('0x7'));var rimraf=require(_0x2550('0x8'));var config=require(_0x2550('0x9'));var attributes=require(_0x2550('0xa'));module[_0x2550('0xb')]=function(_0x5f76a9,_0x507b52){return _0x5f76a9[_0x2550('0xc')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index f04f8a1..332117d 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 _0x3233=['lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','result','CreateSquareRecording','create','options','raw','debug','catch','message'];(function(_0x2de4c3,_0x646aad){var _0xc324fd=function(_0x578822){while(--_0x578822){_0x2de4c3['push'](_0x2de4c3['shift']());}};_0xc324fd(++_0x646aad);}(_0x3233,0x198));var _0x3323=function(_0xc7a6e8,_0x7c3b71){_0xc7a6e8=_0xc7a6e8-0x0;var _0x4d3abd=_0x3233[_0xc7a6e8];return _0x4d3abd;};'use strict';var _=require(_0x3323('0x0'));var util=require(_0x3323('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3323('0x2'));var fs=require('fs');var Redis=require(_0x3323('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3323('0x4'));var logger=require(_0x3323('0x5'))(_0x3323('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3323('0x7')][_0x3323('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c85f8,_0xd60e41,_0x45b9b5){return new BPromise(function(_0x1f6d4c,_0x50042a){return client['request'](_0x3c85f8,_0x45b9b5)[_0x3323('0x9')](function(_0x2631fc){logger[_0x3323('0xa')](_0x3323('0xb'),_0xd60e41,_0x3323('0xc'));logger['debug'](_0x3323('0xd'),_0xd60e41,'request\x20sent',JSON['stringify'](_0x2631fc));if(_0x2631fc[_0x3323('0xe')]){if(_0x2631fc[_0x3323('0xe')][_0x3323('0xf')]===0x1f4){logger[_0x3323('0xe')](_0x3323('0xb'),_0xd60e41,_0x2631fc[_0x3323('0xe')]['message']);return _0x50042a(_0x2631fc['error']['message']);}logger[_0x3323('0xe')](_0x3323('0xb'),_0xd60e41,_0x2631fc['error']['message']);return _0x1f6d4c(_0x2631fc[_0x3323('0xe')]['message']);}else{logger[_0x3323('0xa')](_0x3323('0xb'),_0xd60e41,_0x3323('0xc'));_0x1f6d4c(_0x2631fc[_0x3323('0x10')]['message']);}})['catch'](function(_0xdead45){logger[_0x3323('0xe')](_0x3323('0xb'),_0xd60e41,_0xdead45);_0x50042a(_0xdead45);});});}exports[_0x3323('0x11')]=function(_0xdc5d9a){var _0xd44c77=this;return new Promise(function(_0x204fc5,_0x170a40){return db['SquareRecording'][_0x3323('0x12')](_0xdc5d9a['body'],{'raw':_0xdc5d9a[_0x3323('0x13')]?_0xdc5d9a[_0x3323('0x13')][_0x3323('0x14')]===undefined?!![]:![]:!![]})[_0x3323('0x9')](function(_0x593103){logger[_0x3323('0xa')](_0x3323('0x11'),_0xdc5d9a);logger[_0x3323('0x15')](_0x3323('0x11'),_0xdc5d9a,JSON['stringify'](_0x593103));_0x204fc5(_0x593103);})[_0x3323('0x16')](function(_0x43389b){logger['error'](_0x3323('0x11'),_0x43389b[_0x3323('0x17')],_0xdc5d9a);_0x170a40(_0xd44c77[_0x3323('0xe')](0x1f4,_0x43389b[_0x3323('0x17')]));});});}; \ No newline at end of file +var _0x156b=['then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSquareRecording','SquareRecording','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1f9bdb,_0x4d8aaf){var _0x508972=function(_0x3b21be){while(--_0x3b21be){_0x1f9bdb['push'](_0x1f9bdb['shift']());}};_0x508972(++_0x4d8aaf);}(_0x156b,0x1c2));var _0xb156=function(_0x506aef,_0xb1161c){_0x506aef=_0x506aef-0x0;var _0x579eea=_0x156b[_0x506aef];return _0x579eea;};'use strict';var _=require(_0xb156('0x0'));var util=require(_0xb156('0x1'));var moment=require(_0xb156('0x2'));var BPromise=require(_0xb156('0x3'));var rs=require(_0xb156('0x4'));var fs=require('fs');var Redis=require(_0xb156('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb156('0x6'));var logger=require(_0xb156('0x7'))(_0xb156('0x8'));var config=require(_0xb156('0x9'));var jayson=require(_0xb156('0xa'));var client=jayson[_0xb156('0xb')][_0xb156('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b9b4e,_0xd4903e,_0xfbd368){return new BPromise(function(_0x5325cf,_0x2e6dac){return client[_0xb156('0xd')](_0x1b9b4e,_0xfbd368)[_0xb156('0xe')](function(_0x917f34){logger[_0xb156('0xf')](_0xb156('0x10'),_0xd4903e,_0xb156('0x11'));logger['debug'](_0xb156('0x12'),_0xd4903e,_0xb156('0x11'),JSON[_0xb156('0x13')](_0x917f34));if(_0x917f34[_0xb156('0x14')]){if(_0x917f34[_0xb156('0x14')]['code']===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0xd4903e,_0x917f34['error'][_0xb156('0x15')]);return _0x2e6dac(_0x917f34[_0xb156('0x14')][_0xb156('0x15')]);}logger['error'](_0xb156('0x10'),_0xd4903e,_0x917f34[_0xb156('0x14')]['message']);return _0x5325cf(_0x917f34[_0xb156('0x14')][_0xb156('0x15')]);}else{logger[_0xb156('0xf')](_0xb156('0x10'),_0xd4903e,_0xb156('0x11'));_0x5325cf(_0x917f34[_0xb156('0x16')][_0xb156('0x15')]);}})['catch'](function(_0x58e86a){logger['error'](_0xb156('0x10'),_0xd4903e,_0x58e86a);_0x2e6dac(_0x58e86a);});});}exports[_0xb156('0x17')]=function(_0x36f2e0){var _0x37f29d=this;return new Promise(function(_0x4fc22c,_0x17e41a){return db[_0xb156('0x18')]['create'](_0x36f2e0[_0xb156('0x19')],{'raw':_0x36f2e0[_0xb156('0x1a')]?_0x36f2e0[_0xb156('0x1a')][_0xb156('0x1b')]===undefined?!![]:![]:!![]})[_0xb156('0xe')](function(_0x28dbd4){logger[_0xb156('0xf')](_0xb156('0x17'),_0x36f2e0);logger[_0xb156('0x1c')](_0xb156('0x17'),_0x36f2e0,JSON[_0xb156('0x13')](_0x28dbd4));_0x4fc22c(_0x28dbd4);})['catch'](function(_0x243123){logger[_0xb156('0x14')](_0xb156('0x17'),_0x243123['message'],_0x36f2e0);_0x17e41a(_0x37f29d[_0xb156('0x14')](0x1f4,_0x243123[_0xb156('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index d908cb0..f6738ab 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(_0x156d1b,_0x756c49){var _0x4b20ad=function(_0x41543d){while(--_0x41543d){_0x156d1b['push'](_0x156d1b['shift']());}};_0x4b20ad(++_0x756c49);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./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 _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0xea410,_0x2622e6){var _0x2a680c=function(_0x4dae3a){while(--_0x4dae3a){_0xea410['push'](_0xea410['shift']());}};_0x2a680c(++_0x2622e6);}(_0xe706,0xa3));var _0x6e70=function(_0x7f70ec,_0x82eb8b){_0x7f70ec=_0x7f70ec-0x0;var _0x397ff9=_0xe706[_0x7f70ec];return _0x397ff9;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 9150c08..b4a347c 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 _0x5e3d=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x5e3d,0x153));var _0xd5e3=function(_0x3a8875,_0xa002ae){_0x3a8875=_0x3a8875-0x0;var _0x3b9c55=_0x5e3d[_0x3a8875];return _0x3b9c55;};'use strict';var Sequelize=require(_0xd5e3('0x0'));module['exports']={'network':{'type':Sequelize[_0xd5e3('0x1')]},'network_script':{'type':Sequelize[_0xd5e3('0x1')]},'request':{'type':Sequelize[_0xd5e3('0x1')]},'channel':{'type':Sequelize[_0xd5e3('0x1')]},'language':{'type':Sequelize[_0xd5e3('0x1')]},'type':{'type':Sequelize[_0xd5e3('0x1')]},'uniqueid':{'type':Sequelize[_0xd5e3('0x1')]},'version':{'type':Sequelize[_0xd5e3('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xd5e3('0x1')]},'callingtns':{'type':Sequelize[_0xd5e3('0x1')]},'dnid':{'type':Sequelize[_0xd5e3('0x1')]},'rdnis':{'type':Sequelize[_0xd5e3('0x1')]},'context':{'type':Sequelize[_0xd5e3('0x1')]},'extension':{'type':Sequelize[_0xd5e3('0x1')]},'priority':{'type':Sequelize[_0xd5e3('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd5e3('0x1')]},'threadid':{'type':Sequelize[_0xd5e3('0x1')]},'project_name':{'type':Sequelize[_0xd5e3('0x1')]},'joinAt':{'type':Sequelize[_0xd5e3('0x2')]},'leaveAt':{'type':Sequelize[_0xd5e3('0x2')]},'bot':{'type':Sequelize[_0xd5e3('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xbef1=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x43fbcc,_0x47c229){var _0x3e4287=function(_0x345c4b){while(--_0x345c4b){_0x43fbcc['push'](_0x43fbcc['shift']());}};_0x3e4287(++_0x47c229);}(_0xbef1,0x1a3));var _0x1bef=function(_0x124c1d,_0x3ed673){_0x124c1d=_0x124c1d-0x0;var _0xa9f06f=_0xbef1[_0x124c1d];return _0xa9f06f;};'use strict';var Sequelize=require(_0x1bef('0x0'));module[_0x1bef('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1bef('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1bef('0x2')]},'uniqueid':{'type':Sequelize[_0x1bef('0x2')]},'version':{'type':Sequelize[_0x1bef('0x2')]},'callerid':{'type':Sequelize[_0x1bef('0x2')]},'calleridname':{'type':Sequelize[_0x1bef('0x2')]},'callingpres':{'type':Sequelize[_0x1bef('0x2')]},'callingani2':{'type':Sequelize[_0x1bef('0x2')]},'callington':{'type':Sequelize[_0x1bef('0x2')]},'callingtns':{'type':Sequelize[_0x1bef('0x2')]},'dnid':{'type':Sequelize[_0x1bef('0x2')]},'rdnis':{'type':Sequelize[_0x1bef('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1bef('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1bef('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x1bef('0x2')]},'joinAt':{'type':Sequelize[_0x1bef('0x3')]},'leaveAt':{'type':Sequelize[_0x1bef('0x3')]},'bot':{'type':Sequelize[_0x1bef('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 aedbdae..427ce7e 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 _0x5e79=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','update','then','error','stack','name','map','SquareReport','rawAttributes','fieldName','model','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5e79,0x7b));var _0x95e7=function(_0x3c7b9b,_0x3dedfd){_0x3c7b9b=_0x3c7b9b-0x0;var _0xb3c0c9=_0x5e79[_0x3c7b9b];return _0xb3c0c9;};'use strict';var emlformat=require(_0x95e7('0x0'));var rimraf=require(_0x95e7('0x1'));var zipdir=require(_0x95e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95e7('0x3'));var moment=require('moment');var BPromise=require(_0x95e7('0x4'));var Mustache=require(_0x95e7('0x5'));var util=require('util');var path=require(_0x95e7('0x6'));var sox=require(_0x95e7('0x7'));var csv=require(_0x95e7('0x8'));var ejs=require(_0x95e7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95e7('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x95e7('0xb'));var deskjs=require(_0x95e7('0xc'));var toCsv=require(_0x95e7('0x8'));var querystring=require(_0x95e7('0xd'));var Papa=require(_0x95e7('0xe'));var Redis=require(_0x95e7('0xf'));var authService=require(_0x95e7('0x10'));var qs=require(_0x95e7('0x11'));var as=require(_0x95e7('0x12'));var hardwareService=require(_0x95e7('0x13'));var logger=require(_0x95e7('0x14'))('api');var utils=require(_0x95e7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x95e7('0x16'));var db=require(_0x95e7('0x17'))['db'];function respondWithStatusCode(_0x2f15fa,_0x18a3bf){_0x18a3bf=_0x18a3bf||0xcc;return function(_0x2762f7){if(_0x2762f7){return _0x2f15fa[_0x95e7('0x18')](_0x18a3bf);}return _0x2f15fa['status'](_0x18a3bf)[_0x95e7('0x19')]();};}function respondWithResult(_0x40957e,_0x4da847){_0x4da847=_0x4da847||0xc8;return function(_0x17e2ae){if(_0x17e2ae){return _0x40957e[_0x95e7('0x1a')](_0x4da847)[_0x95e7('0x1b')](_0x17e2ae);}};}function respondWithFilteredResult(_0x256882,_0x1dca29){return function(_0x504400){if(_0x504400){var _0x200ca5=typeof _0x1dca29[_0x95e7('0x1c')]===_0x95e7('0x1d')&&typeof _0x1dca29[_0x95e7('0x1e')]===_0x95e7('0x1d');var _0xd17e1f=_0x504400['count'];var _0x2b4034=_0x200ca5?0x0:_0x1dca29[_0x95e7('0x1c')];var _0x5e9682=_0x200ca5?_0x504400['count']:_0x1dca29[_0x95e7('0x1c')]+_0x1dca29[_0x95e7('0x1e')];var _0x5509e7;if(_0x5e9682>=_0xd17e1f){_0x5e9682=_0xd17e1f;_0x5509e7=0xc8;}else{_0x5509e7=0xce;}_0x256882['status'](_0x5509e7);return _0x256882[_0x95e7('0x1f')](_0x95e7('0x20'),_0x2b4034+'-'+_0x5e9682+'/'+_0xd17e1f)[_0x95e7('0x1b')](_0x504400);}return null;};}function patchUpdates(_0x466ae4){return function(_0x5e4d08){try{jsonpatch[_0x95e7('0x21')](_0x5e4d08,_0x466ae4,!![]);}catch(_0x35d525){return BPromise['reject'](_0x35d525);}return _0x5e4d08['save']();};}function saveUpdates(_0x17f222,_0x294d51){return function(_0x59f30c){if(_0x59f30c){return _0x59f30c[_0x95e7('0x22')](_0x17f222)[_0x95e7('0x23')](function(_0x45365e){return _0x45365e;});}return null;};}function removeEntity(_0x1c6a70,_0x6b2be3){return function(_0x3ae9a1){if(_0x3ae9a1){return _0x3ae9a1['destroy']()[_0x95e7('0x23')](function(){_0x1c6a70[_0x95e7('0x1a')](0xcc)[_0x95e7('0x19')]();});}};}function handleEntityNotFound(_0x2d5429,_0x1bd270){return function(_0x307611){if(!_0x307611){_0x2d5429[_0x95e7('0x18')](0x194);}return _0x307611;};}function handleError(_0x52335e,_0x9de9cf){_0x9de9cf=_0x9de9cf||0x1f4;return function(_0x23202a){logger[_0x95e7('0x24')](_0x23202a[_0x95e7('0x25')]);if(_0x23202a[_0x95e7('0x26')]){delete _0x23202a[_0x95e7('0x26')];}_0x52335e[_0x95e7('0x1a')](_0x9de9cf)['send'](_0x23202a);};}exports['index']=function(_0x1347a7,_0x20c0a8){var _0x73da6d={},_0x40d0f4={},_0xb646c8={'count':0x0,'rows':[]};var _0xcecfa2=_[_0x95e7('0x27')](db[_0x95e7('0x28')][_0x95e7('0x29')],function(_0xc6fdc0){return{'name':_0xc6fdc0[_0x95e7('0x2a')],'type':_0xc6fdc0['type']['key']};});_0x40d0f4[_0x95e7('0x2b')]=_[_0x95e7('0x27')](_0xcecfa2,_0x95e7('0x26'));_0x40d0f4['query']=_[_0x95e7('0x2c')](_0x1347a7['query']);_0x40d0f4[_0x95e7('0x2d')]=_['intersection'](_0x40d0f4[_0x95e7('0x2b')],_0x40d0f4[_0x95e7('0x2e')]);_0x73da6d['attributes']=_[_0x95e7('0x2f')](_0x40d0f4['model'],qs['fields'](_0x1347a7[_0x95e7('0x2e')][_0x95e7('0x30')]));_0x73da6d['attributes']=_0x73da6d[_0x95e7('0x31')][_0x95e7('0x32')]?_0x73da6d[_0x95e7('0x31')]:_0x40d0f4['model'];if(!_0x1347a7[_0x95e7('0x2e')][_0x95e7('0x33')](_0x95e7('0x34'))){_0x73da6d[_0x95e7('0x1e')]=qs[_0x95e7('0x1e')](_0x1347a7[_0x95e7('0x2e')]['limit']);_0x73da6d[_0x95e7('0x1c')]=qs[_0x95e7('0x1c')](_0x1347a7[_0x95e7('0x2e')][_0x95e7('0x1c')]);}_0x73da6d[_0x95e7('0x35')]=qs[_0x95e7('0x36')](_0x1347a7[_0x95e7('0x2e')][_0x95e7('0x36')]);_0x73da6d['where']=qs['filters'](_[_0x95e7('0x37')](_0x1347a7[_0x95e7('0x2e')],_0x40d0f4[_0x95e7('0x2d')]),_0xcecfa2);if(_0x1347a7[_0x95e7('0x2e')]['filter']){_0x73da6d[_0x95e7('0x38')]=_['merge'](_0x73da6d[_0x95e7('0x38')],{'$or':_['map'](_0xcecfa2,function(_0x15ec11){if(_0x15ec11[_0x95e7('0x39')]!==_0x95e7('0x3a')){var _0x24b0c9={};_0x24b0c9[_0x15ec11['name']]={'$like':'%'+_0x1347a7[_0x95e7('0x2e')]['filter']+'%'};return _0x24b0c9;}})});}_0x73da6d=_['merge']({},_0x73da6d,_0x1347a7[_0x95e7('0x3b')]);var _0x3d1e29={'where':_0x73da6d[_0x95e7('0x38')]};return db[_0x95e7('0x28')][_0x95e7('0x3c')](_0x3d1e29)['then'](function(_0x2c0ac8){_0xb646c8[_0x95e7('0x3c')]=_0x2c0ac8;if(_0x1347a7['query'][_0x95e7('0x3d')]){_0x73da6d[_0x95e7('0x3e')]=[{'all':!![]}];}return db[_0x95e7('0x28')]['findAll'](_0x73da6d);})[_0x95e7('0x23')](function(_0x5b16ec){_0xb646c8[_0x95e7('0x3f')]=_0x5b16ec;return _0xb646c8;})[_0x95e7('0x23')](respondWithFilteredResult(_0x20c0a8,_0x73da6d))[_0x95e7('0x40')](handleError(_0x20c0a8,null));};exports[_0x95e7('0x41')]=function(_0x3bdba7,_0x6b9514){var _0x523c9f={'raw':!![],'where':{'id':_0x3bdba7[_0x95e7('0x42')]['id']}},_0x3cb62a={};_0x3cb62a[_0x95e7('0x2b')]=_[_0x95e7('0x2c')](db['SquareReport'][_0x95e7('0x29')]);_0x3cb62a[_0x95e7('0x2e')]=_[_0x95e7('0x2c')](_0x3bdba7[_0x95e7('0x2e')]);_0x3cb62a['filters']=_['intersection'](_0x3cb62a[_0x95e7('0x2b')],_0x3cb62a['query']);_0x523c9f[_0x95e7('0x31')]=_[_0x95e7('0x2f')](_0x3cb62a[_0x95e7('0x2b')],qs[_0x95e7('0x30')](_0x3bdba7[_0x95e7('0x2e')][_0x95e7('0x30')]));_0x523c9f[_0x95e7('0x31')]=_0x523c9f[_0x95e7('0x31')][_0x95e7('0x32')]?_0x523c9f[_0x95e7('0x31')]:_0x3cb62a[_0x95e7('0x2b')];if(_0x3bdba7[_0x95e7('0x2e')][_0x95e7('0x3d')]){_0x523c9f[_0x95e7('0x3e')]=[{'all':!![]}];}_0x523c9f=_[_0x95e7('0x43')]({},_0x523c9f,_0x3bdba7[_0x95e7('0x3b')]);return db[_0x95e7('0x28')][_0x95e7('0x44')](_0x523c9f)[_0x95e7('0x23')](handleEntityNotFound(_0x6b9514,null))[_0x95e7('0x23')](respondWithResult(_0x6b9514,null))[_0x95e7('0x40')](handleError(_0x6b9514,null));};exports['create']=function(_0x4863bc,_0x493d6c){return db['SquareReport'][_0x95e7('0x45')](_0x4863bc[_0x95e7('0x46')],{})['then'](respondWithResult(_0x493d6c,0xc9))[_0x95e7('0x40')](handleError(_0x493d6c,null));};exports[_0x95e7('0x22')]=function(_0x139b23,_0x29ece5){if(_0x139b23[_0x95e7('0x46')]['id']){delete _0x139b23[_0x95e7('0x46')]['id'];}return db[_0x95e7('0x28')][_0x95e7('0x44')]({'where':{'id':_0x139b23[_0x95e7('0x42')]['id']}})['then'](handleEntityNotFound(_0x29ece5,null))[_0x95e7('0x23')](saveUpdates(_0x139b23[_0x95e7('0x46')],null))[_0x95e7('0x23')](respondWithResult(_0x29ece5,null))[_0x95e7('0x40')](handleError(_0x29ece5,null));};exports['destroy']=function(_0x5789f8,_0x10ade1){return db[_0x95e7('0x28')][_0x95e7('0x44')]({'where':{'id':_0x5789f8[_0x95e7('0x42')]['id']}})[_0x95e7('0x23')](handleEntityNotFound(_0x10ade1,null))[_0x95e7('0x23')](removeEntity(_0x10ade1,null))[_0x95e7('0x40')](handleError(_0x10ade1,null));};exports[_0x95e7('0x47')]=function(_0x31e070,_0x3a2393){return db[_0x95e7('0x28')]['describe']()[_0x95e7('0x23')](respondWithResult(_0x3a2393,null))['catch'](handleError(_0x3a2393,null));}; \ No newline at end of file +var _0x60a8=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','Content-Range','apply','reject','save','then','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','eml-format','rimraf','fast-json-patch','bluebird'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x60a8,0x96));var _0x860a=function(_0x49703c,_0x319deb){_0x49703c=_0x49703c-0x0;var _0x319adc=_0x60a8[_0x49703c];return _0x319adc;};'use strict';var emlformat=require(_0x860a('0x0'));var rimraf=require(_0x860a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x860a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x860a('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x860a('0x4'));var sox=require(_0x860a('0x5'));var csv=require(_0x860a('0x6'));var ejs=require(_0x860a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x860a('0x8'));var squel=require(_0x860a('0x9'));var crypto=require(_0x860a('0xa'));var jsforce=require(_0x860a('0xb'));var deskjs=require(_0x860a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x860a('0xd'));var Papa=require(_0x860a('0xe'));var Redis=require(_0x860a('0xf'));var authService=require(_0x860a('0x10'));var qs=require(_0x860a('0x11'));var as=require(_0x860a('0x12'));var hardwareService=require(_0x860a('0x13'));var logger=require(_0x860a('0x14'))(_0x860a('0x15'));var utils=require(_0x860a('0x16'));var config=require(_0x860a('0x17'));var licenseUtil=require(_0x860a('0x18'));var db=require(_0x860a('0x19'))['db'];function respondWithStatusCode(_0x86a493,_0x13d616){_0x13d616=_0x13d616||0xcc;return function(_0x178ddf){if(_0x178ddf){return _0x86a493[_0x860a('0x1a')](_0x13d616);}return _0x86a493[_0x860a('0x1b')](_0x13d616)[_0x860a('0x1c')]();};}function respondWithResult(_0x56e6c4,_0x3aaa3d){_0x3aaa3d=_0x3aaa3d||0xc8;return function(_0x526a48){if(_0x526a48){return _0x56e6c4['status'](_0x3aaa3d)[_0x860a('0x1d')](_0x526a48);}};}function respondWithFilteredResult(_0x58dea3,_0x211f92){return function(_0x21e765){if(_0x21e765){var _0x247f6e=typeof _0x211f92[_0x860a('0x1e')]==='undefined'&&typeof _0x211f92['limit']==='undefined';var _0x1d3a14=_0x21e765[_0x860a('0x1f')];var _0x9387e3=_0x247f6e?0x0:_0x211f92[_0x860a('0x1e')];var _0x4a6974=_0x247f6e?_0x21e765[_0x860a('0x1f')]:_0x211f92[_0x860a('0x1e')]+_0x211f92[_0x860a('0x20')];var _0x1bdfa0;if(_0x4a6974>=_0x1d3a14){_0x4a6974=_0x1d3a14;_0x1bdfa0=0xc8;}else{_0x1bdfa0=0xce;}_0x58dea3['status'](_0x1bdfa0);return _0x58dea3['set'](_0x860a('0x21'),_0x9387e3+'-'+_0x4a6974+'/'+_0x1d3a14)[_0x860a('0x1d')](_0x21e765);}return null;};}function patchUpdates(_0x1c5575){return function(_0x315096){try{jsonpatch[_0x860a('0x22')](_0x315096,_0x1c5575,!![]);}catch(_0x5282c8){return BPromise[_0x860a('0x23')](_0x5282c8);}return _0x315096[_0x860a('0x24')]();};}function saveUpdates(_0x150566,_0x314500){return function(_0x2c1b57){if(_0x2c1b57){return _0x2c1b57['update'](_0x150566)[_0x860a('0x25')](function(_0x320115){return _0x320115;});}return null;};}function removeEntity(_0x160fa0,_0x16046c){return function(_0x3cc527){if(_0x3cc527){return _0x3cc527['destroy']()['then'](function(){_0x160fa0[_0x860a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa8014d,_0x26bc29){return function(_0x3aa84f){if(!_0x3aa84f){_0xa8014d[_0x860a('0x1a')](0x194);}return _0x3aa84f;};}function handleError(_0xa8b940,_0x5a364c){_0x5a364c=_0x5a364c||0x1f4;return function(_0x4fdade){logger['error'](_0x4fdade[_0x860a('0x26')]);if(_0x4fdade[_0x860a('0x27')]){delete _0x4fdade[_0x860a('0x27')];}_0xa8b940[_0x860a('0x1b')](_0x5a364c)[_0x860a('0x28')](_0x4fdade);};}exports[_0x860a('0x29')]=function(_0x3225ed,_0xc45980){var _0x17eb91={},_0x50d231={},_0x4647bd={'count':0x0,'rows':[]};var _0x1470f3=_[_0x860a('0x2a')](db[_0x860a('0x2b')][_0x860a('0x2c')],function(_0x19ac31){return{'name':_0x19ac31[_0x860a('0x2d')],'type':_0x19ac31[_0x860a('0x2e')]['key']};});_0x50d231[_0x860a('0x2f')]=_[_0x860a('0x2a')](_0x1470f3,_0x860a('0x27'));_0x50d231[_0x860a('0x30')]=_[_0x860a('0x31')](_0x3225ed[_0x860a('0x30')]);_0x50d231[_0x860a('0x32')]=_[_0x860a('0x33')](_0x50d231['model'],_0x50d231[_0x860a('0x30')]);_0x17eb91[_0x860a('0x34')]=_[_0x860a('0x33')](_0x50d231[_0x860a('0x2f')],qs['fields'](_0x3225ed[_0x860a('0x30')][_0x860a('0x35')]));_0x17eb91[_0x860a('0x34')]=_0x17eb91[_0x860a('0x34')][_0x860a('0x36')]?_0x17eb91[_0x860a('0x34')]:_0x50d231[_0x860a('0x2f')];if(!_0x3225ed[_0x860a('0x30')][_0x860a('0x37')]('nolimit')){_0x17eb91[_0x860a('0x20')]=qs[_0x860a('0x20')](_0x3225ed[_0x860a('0x30')][_0x860a('0x20')]);_0x17eb91[_0x860a('0x1e')]=qs[_0x860a('0x1e')](_0x3225ed[_0x860a('0x30')]['offset']);}_0x17eb91[_0x860a('0x38')]=qs[_0x860a('0x39')](_0x3225ed['query'][_0x860a('0x39')]);_0x17eb91[_0x860a('0x3a')]=qs[_0x860a('0x32')](_[_0x860a('0x3b')](_0x3225ed[_0x860a('0x30')],_0x50d231[_0x860a('0x32')]),_0x1470f3);if(_0x3225ed[_0x860a('0x30')][_0x860a('0x3c')]){_0x17eb91[_0x860a('0x3a')]=_['merge'](_0x17eb91[_0x860a('0x3a')],{'$or':_[_0x860a('0x2a')](_0x1470f3,function(_0xbf5989){if(_0xbf5989[_0x860a('0x2e')]!==_0x860a('0x3d')){var _0x194d41={};_0x194d41[_0xbf5989[_0x860a('0x27')]]={'$like':'%'+_0x3225ed[_0x860a('0x30')][_0x860a('0x3c')]+'%'};return _0x194d41;}})});}_0x17eb91=_[_0x860a('0x3e')]({},_0x17eb91,_0x3225ed[_0x860a('0x3f')]);var _0x171ce2={'where':_0x17eb91['where']};return db[_0x860a('0x2b')]['count'](_0x171ce2)[_0x860a('0x25')](function(_0x46ad98){_0x4647bd[_0x860a('0x1f')]=_0x46ad98;if(_0x3225ed[_0x860a('0x30')][_0x860a('0x40')]){_0x17eb91[_0x860a('0x41')]=[{'all':!![]}];}return db[_0x860a('0x2b')][_0x860a('0x42')](_0x17eb91);})[_0x860a('0x25')](function(_0xddf900){_0x4647bd[_0x860a('0x43')]=_0xddf900;return _0x4647bd;})[_0x860a('0x25')](respondWithFilteredResult(_0xc45980,_0x17eb91))[_0x860a('0x44')](handleError(_0xc45980,null));};exports[_0x860a('0x45')]=function(_0x43aa19,_0x2f3971){var _0x22b50f={'raw':!![],'where':{'id':_0x43aa19[_0x860a('0x46')]['id']}},_0x1976c3={};_0x1976c3[_0x860a('0x2f')]=_['keys'](db['SquareReport']['rawAttributes']);_0x1976c3[_0x860a('0x30')]=_[_0x860a('0x31')](_0x43aa19['query']);_0x1976c3['filters']=_['intersection'](_0x1976c3[_0x860a('0x2f')],_0x1976c3[_0x860a('0x30')]);_0x22b50f[_0x860a('0x34')]=_[_0x860a('0x33')](_0x1976c3[_0x860a('0x2f')],qs['fields'](_0x43aa19[_0x860a('0x30')][_0x860a('0x35')]));_0x22b50f['attributes']=_0x22b50f[_0x860a('0x34')][_0x860a('0x36')]?_0x22b50f['attributes']:_0x1976c3['model'];if(_0x43aa19[_0x860a('0x30')]['includeAll']){_0x22b50f['include']=[{'all':!![]}];}_0x22b50f=_['merge']({},_0x22b50f,_0x43aa19[_0x860a('0x3f')]);return db['SquareReport'][_0x860a('0x47')](_0x22b50f)['then'](handleEntityNotFound(_0x2f3971,null))[_0x860a('0x25')](respondWithResult(_0x2f3971,null))[_0x860a('0x44')](handleError(_0x2f3971,null));};exports['create']=function(_0x38db88,_0x1b9d9d){return db[_0x860a('0x2b')][_0x860a('0x48')](_0x38db88[_0x860a('0x49')],{})['then'](respondWithResult(_0x1b9d9d,0xc9))['catch'](handleError(_0x1b9d9d,null));};exports[_0x860a('0x4a')]=function(_0x24af76,_0x332a8b){if(_0x24af76['body']['id']){delete _0x24af76[_0x860a('0x49')]['id'];}return db['SquareReport'][_0x860a('0x47')]({'where':{'id':_0x24af76['params']['id']}})['then'](handleEntityNotFound(_0x332a8b,null))[_0x860a('0x25')](saveUpdates(_0x24af76['body'],null))[_0x860a('0x25')](respondWithResult(_0x332a8b,null))[_0x860a('0x44')](handleError(_0x332a8b,null));};exports[_0x860a('0x4b')]=function(_0xd91920,_0x1da8b4){return db[_0x860a('0x2b')][_0x860a('0x47')]({'where':{'id':_0xd91920[_0x860a('0x46')]['id']}})['then'](handleEntityNotFound(_0x1da8b4,null))[_0x860a('0x25')](removeEntity(_0x1da8b4,null))['catch'](handleError(_0x1da8b4,null));};exports[_0x860a('0x4c')]=function(_0x4fe016,_0x3ac06f){return db['SquareReport'][_0x860a('0x4c')]()[_0x860a('0x25')](respondWithResult(_0x3ac06f,null))[_0x860a('0x44')](handleError(_0x3ac06f,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 70e5baa..d495e60 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 _0x8217=['../../config/logger','api','request-promise','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x8217,0x117));var _0x7821=function(_0x55fb83,_0x1d3856){_0x55fb83=_0x55fb83-0x0;var _0x59a87a=_0x8217[_0x55fb83];return _0x59a87a;};'use strict';var _=require(_0x7821('0x0'));var util=require('util');var logger=require(_0x7821('0x1'))(_0x7821('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7821('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7821('0x4'));var config=require(_0x7821('0x5'));var attributes=require(_0x7821('0x6'));module[_0x7821('0x7')]=function(_0x5d8c76,_0x5ecdbb){return _0x5d8c76[_0x7821('0x8')](_0x7821('0x9'),attributes,{'tableName':_0x7821('0xa'),'paranoid':![],'indexes':[{'name':_0x7821('0xb'),'fields':['uniqueid',_0x7821('0xc')]},{'name':_0x7821('0xd'),'fields':[_0x7821('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcda5=['./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x491681,_0x43a51f){var _0x5213bc=function(_0x4fa7eb){while(--_0x4fa7eb){_0x491681['push'](_0x491681['shift']());}};_0x5213bc(++_0x43a51f);}(_0xcda5,0x6a));var _0x5cda=function(_0x2c7d07,_0x56602d){_0x2c7d07=_0x2c7d07-0x0;var _0x5da1a3=_0xcda5[_0x2c7d07];return _0x5da1a3;};'use strict';var _=require(_0x5cda('0x0'));var util=require(_0x5cda('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5cda('0x2'));var rp=require(_0x5cda('0x3'));var fs=require('fs');var path=require(_0x5cda('0x4'));var rimraf=require(_0x5cda('0x5'));var config=require('../../config/environment');var attributes=require(_0x5cda('0x6'));module[_0x5cda('0x7')]=function(_0x30086b,_0x310edd){return _0x30086b[_0x5cda('0x8')](_0x5cda('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x5cda('0xa'),'fields':[_0x5cda('0xb'),_0x5cda('0xc')]},{'name':'leaveAt','fields':[_0x5cda('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 3f05e47..1867527 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 _0x386c=['http','then','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','SquareReport','create','body','options','raw','info','CreateSquareReport','update','where','limit','UpdateSquareReport','util','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x5317d6,_0x409d71){var _0x2af712=function(_0x107f7b){while(--_0x107f7b){_0x5317d6['push'](_0x5317d6['shift']());}};_0x2af712(++_0x409d71);}(_0x386c,0x1b9));var _0xc386=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x386c[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0xc386('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc386('0x1'));var fs=require('fs');var Redis=require(_0xc386('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc386('0x3'))(_0xc386('0x4'));var config=require('../../config/environment');var jayson=require(_0xc386('0x5'));var client=jayson[_0xc386('0x6')][_0xc386('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32ae2c,_0xcda6e7,_0x58cd9c){return new BPromise(function(_0x2f5e35,_0x5ec820){return client['request'](_0x32ae2c,_0x58cd9c)[_0xc386('0x8')](function(_0x7fdeed){logger['info'](_0xc386('0x9'),_0xcda6e7,'request\x20sent');logger[_0xc386('0xa')](_0xc386('0xb'),_0xcda6e7,_0xc386('0xc'),JSON['stringify'](_0x7fdeed));if(_0x7fdeed[_0xc386('0xd')]){if(_0x7fdeed[_0xc386('0xd')][_0xc386('0xe')]===0x1f4){logger[_0xc386('0xd')](_0xc386('0x9'),_0xcda6e7,_0x7fdeed[_0xc386('0xd')][_0xc386('0xf')]);return _0x5ec820(_0x7fdeed[_0xc386('0xd')]['message']);}logger[_0xc386('0xd')](_0xc386('0x9'),_0xcda6e7,_0x7fdeed['error'][_0xc386('0xf')]);return _0x2f5e35(_0x7fdeed[_0xc386('0xd')][_0xc386('0xf')]);}else{logger['info'](_0xc386('0x9'),_0xcda6e7,_0xc386('0xc'));_0x2f5e35(_0x7fdeed['result'][_0xc386('0xf')]);}})[_0xc386('0x10')](function(_0x52501){logger[_0xc386('0xd')](_0xc386('0x9'),_0xcda6e7,_0x52501);_0x5ec820(_0x52501);});});}exports['CreateSquareReport']=function(_0x23ad4f){var _0x1bdcbe=this;return new Promise(function(_0x55229f,_0x46bbf8){return db[_0xc386('0x11')][_0xc386('0x12')](_0x23ad4f[_0xc386('0x13')],{'raw':_0x23ad4f[_0xc386('0x14')]?_0x23ad4f[_0xc386('0x14')][_0xc386('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x3298fc){logger[_0xc386('0x16')](_0xc386('0x17'),_0x23ad4f);logger[_0xc386('0xa')](_0xc386('0x17'),_0x23ad4f,JSON['stringify'](_0x3298fc));_0x55229f(_0x3298fc);})[_0xc386('0x10')](function(_0x408af0){logger[_0xc386('0xd')](_0xc386('0x17'),_0x408af0[_0xc386('0xf')],_0x23ad4f);_0x46bbf8(_0x1bdcbe[_0xc386('0xd')](0x1f4,_0x408af0['message']));});});};exports['UpdateSquareReport']=function(_0x1f9063){var _0x6fd965=this;return new Promise(function(_0x43207f,_0x1a1840){return db['SquareReport'][_0xc386('0x18')](_0x1f9063[_0xc386('0x13')],{'raw':_0x1f9063['options']?_0x1f9063[_0xc386('0x14')][_0xc386('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f9063[_0xc386('0x14')]?_0x1f9063[_0xc386('0x14')][_0xc386('0x19')]||null:null,'attributes':_0x1f9063[_0xc386('0x14')]?_0x1f9063[_0xc386('0x14')]['attributes']||null:null,'limit':_0x1f9063['options']?_0x1f9063[_0xc386('0x14')][_0xc386('0x1a')]||null:null})[_0xc386('0x8')](function(_0x5a10a4){logger[_0xc386('0x16')](_0xc386('0x1b'),_0x1f9063);logger[_0xc386('0xa')](_0xc386('0x1b'),_0x1f9063,JSON['stringify'](_0x5a10a4));_0x43207f(_0x5a10a4);})['catch'](function(_0x551def){logger[_0xc386('0xd')](_0xc386('0x1b'),_0x551def[_0xc386('0xf')],_0x1f9063);_0x1a1840(_0x6fd965[_0xc386('0xd')](0x1f4,_0x551def[_0xc386('0xf')]));});});}; \ No newline at end of file +var _0x373d=['SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','SquareReport,\x20%s,\x20%s','info','SquareReport','body','options','raw','CreateSquareReport','catch','UpdateSquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','debug'];(function(_0x347a01,_0x47fabd){var _0xcdde3e=function(_0x287270){while(--_0x287270){_0x347a01['push'](_0x347a01['shift']());}};_0xcdde3e(++_0x47fabd);}(_0x373d,0x148));var _0xd373=function(_0x2c6017,_0x58c62e){_0x2c6017=_0x2c6017-0x0;var _0x830c8c=_0x373d[_0x2c6017];return _0x830c8c;};'use strict';var _=require(_0xd373('0x0'));var util=require(_0xd373('0x1'));var moment=require(_0xd373('0x2'));var BPromise=require(_0xd373('0x3'));var rs=require(_0xd373('0x4'));var fs=require('fs');var Redis=require(_0xd373('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd373('0x6'));var logger=require(_0xd373('0x7'))(_0xd373('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd373('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1362b1,_0x252410,_0x3852a8){return new BPromise(function(_0x4e96aa,_0x97d4c5){return client[_0xd373('0xa')](_0x1362b1,_0x3852a8)[_0xd373('0xb')](function(_0x10b5fa){logger['info']('SquareReport,\x20%s,\x20%s',_0x252410,'request\x20sent');logger[_0xd373('0xc')](_0xd373('0xd'),_0x252410,_0xd373('0xe'),JSON[_0xd373('0xf')](_0x10b5fa));if(_0x10b5fa['error']){if(_0x10b5fa['error']['code']===0x1f4){logger[_0xd373('0x10')]('SquareReport,\x20%s,\x20%s',_0x252410,_0x10b5fa[_0xd373('0x10')]['message']);return _0x97d4c5(_0x10b5fa[_0xd373('0x10')][_0xd373('0x11')]);}logger[_0xd373('0x10')](_0xd373('0x12'),_0x252410,_0x10b5fa[_0xd373('0x10')]['message']);return _0x4e96aa(_0x10b5fa[_0xd373('0x10')][_0xd373('0x11')]);}else{logger[_0xd373('0x13')](_0xd373('0x12'),_0x252410,_0xd373('0xe'));_0x4e96aa(_0x10b5fa['result']['message']);}})['catch'](function(_0xf6855){logger[_0xd373('0x10')]('SquareReport,\x20%s,\x20%s',_0x252410,_0xf6855);_0x97d4c5(_0xf6855);});});}exports['CreateSquareReport']=function(_0xaa09f){var _0x512fc7=this;return new Promise(function(_0x300cc6,_0x1d6abe){return db[_0xd373('0x14')]['create'](_0xaa09f[_0xd373('0x15')],{'raw':_0xaa09f[_0xd373('0x16')]?_0xaa09f[_0xd373('0x16')][_0xd373('0x17')]===undefined?!![]:![]:!![]})[_0xd373('0xb')](function(_0x5b9f98){logger[_0xd373('0x13')](_0xd373('0x18'),_0xaa09f);logger['debug'](_0xd373('0x18'),_0xaa09f,JSON['stringify'](_0x5b9f98));_0x300cc6(_0x5b9f98);})[_0xd373('0x19')](function(_0x2064eb){logger[_0xd373('0x10')](_0xd373('0x18'),_0x2064eb[_0xd373('0x11')],_0xaa09f);_0x1d6abe(_0x512fc7['error'](0x1f4,_0x2064eb[_0xd373('0x11')]));});});};exports[_0xd373('0x1a')]=function(_0x544268){var _0x5484be=this;return new Promise(function(_0x306128,_0x5f2a2a){return db[_0xd373('0x14')][_0xd373('0x1b')](_0x544268[_0xd373('0x15')],{'raw':_0x544268['options']?_0x544268['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x544268[_0xd373('0x16')]?_0x544268[_0xd373('0x16')][_0xd373('0x1c')]||null:null,'attributes':_0x544268['options']?_0x544268['options'][_0xd373('0x1d')]||null:null,'limit':_0x544268[_0xd373('0x16')]?_0x544268['options'][_0xd373('0x1e')]||null:null})[_0xd373('0xb')](function(_0x572b6e){logger['info'](_0xd373('0x1a'),_0x544268);logger[_0xd373('0xc')](_0xd373('0x1a'),_0x544268,JSON[_0xd373('0xf')](_0x572b6e));_0x306128(_0x572b6e);})[_0xd373('0x19')](function(_0x260a10){logger[_0xd373('0x10')]('UpdateSquareReport',_0x260a10[_0xd373('0x11')],_0x544268);_0x5f2a2a(_0x5484be[_0xd373('0x10')](0x1f4,_0x260a10[_0xd373('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 0e94c76..c0d411e 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 _0xd9b9=['../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xc7348b,_0x145880){var _0x307cec=function(_0x4f1554){while(--_0x4f1554){_0xc7348b['push'](_0xc7348b['shift']());}};_0x307cec(++_0x145880);}(_0xd9b9,0xf5));var _0x9d9b=function(_0x1c5117,_0x4f4ecd){_0x1c5117=_0x1c5117-0x0;var _0x1e1fe1=_0xd9b9[_0x1c5117];return _0x1e1fe1;};'use strict';var multer=require(_0x9d9b('0x0'));var util=require(_0x9d9b('0x1'));var path=require(_0x9d9b('0x2'));var timeout=require(_0x9d9b('0x3'));var express=require(_0x9d9b('0x4'));var router=express['Router']();var fs_extra=require(_0x9d9b('0x5'));var auth=require(_0x9d9b('0x6'));var interaction=require(_0x9d9b('0x7'));var config=require(_0x9d9b('0x8'));var controller=require(_0x9d9b('0x9'));router[_0x9d9b('0xa')]('/',auth[_0x9d9b('0xb')](),controller[_0x9d9b('0xc')]);router[_0x9d9b('0xa')](_0x9d9b('0xd'),auth[_0x9d9b('0xb')](),controller[_0x9d9b('0xe')]);router[_0x9d9b('0xa')](_0x9d9b('0xf'),auth[_0x9d9b('0xb')](),controller[_0x9d9b('0x10')]);router[_0x9d9b('0x11')]('/',auth[_0x9d9b('0xb')](),controller[_0x9d9b('0x12')]);router[_0x9d9b('0x13')](_0x9d9b('0xf'),auth['isAuthenticated'](),controller[_0x9d9b('0x14')]);router['delete']('/:id',auth[_0x9d9b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4d0c=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','describe','/:id','post','create'];(function(_0x127011,_0x46a223){var _0x5dfefb=function(_0x14cb7c){while(--_0x14cb7c){_0x127011['push'](_0x127011['shift']());}};_0x5dfefb(++_0x46a223);}(_0x4d0c,0x159));var _0xc4d0=function(_0x3dcdc9,_0x3e1e37){_0x3dcdc9=_0x3dcdc9-0x0;var _0x1774da=_0x4d0c[_0x3dcdc9];return _0x1774da;};'use strict';var multer=require(_0xc4d0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc4d0('0x1'));var express=require(_0xc4d0('0x2'));var router=express[_0xc4d0('0x3')]();var fs_extra=require(_0xc4d0('0x4'));var auth=require(_0xc4d0('0x5'));var interaction=require(_0xc4d0('0x6'));var config=require(_0xc4d0('0x7'));var controller=require(_0xc4d0('0x8'));router[_0xc4d0('0x9')]('/',auth[_0xc4d0('0xa')](),controller['index']);router[_0xc4d0('0x9')]('/describe',auth[_0xc4d0('0xa')](),controller[_0xc4d0('0xb')]);router[_0xc4d0('0x9')](_0xc4d0('0xc'),auth[_0xc4d0('0xa')](),controller['show']);router[_0xc4d0('0xd')]('/',auth[_0xc4d0('0xa')](),controller[_0xc4d0('0xe')]);router[_0xc4d0('0xf')](_0xc4d0('0xc'),auth[_0xc4d0('0xa')](),controller[_0xc4d0('0x10')]);router[_0xc4d0('0x11')](_0xc4d0('0xc'),auth[_0xc4d0('0xa')](),controller[_0xc4d0('0x12')]);module[_0xc4d0('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 cd81a97..b36203c 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 _0x3629=['STRING','exports'];(function(_0x3fbb91,_0x5ec106){var _0x3eb213=function(_0x118b9f){while(--_0x118b9f){_0x3fbb91['push'](_0x3fbb91['shift']());}};_0x3eb213(++_0x5ec106);}(_0x3629,0x1ad));var _0x9362=function(_0x570aef,_0x4cea0c){_0x570aef=_0x570aef-0x0;var _0x1034aa=_0x3629[_0x570aef];return _0x1034aa;};'use strict';var Sequelize=require('sequelize');module[_0x9362('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x9362('0x1')]},'application':{'type':Sequelize[_0x9362('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x9362('0x1')]},'callerid':{'type':Sequelize[_0x9362('0x1')]}}; \ No newline at end of file +var _0xbce1=['exports','STRING'];(function(_0x3b2a25,_0x101aae){var _0x410c63=function(_0x166e43){while(--_0x166e43){_0x3b2a25['push'](_0x3b2a25['shift']());}};_0x410c63(++_0x101aae);}(_0xbce1,0xd6));var _0x1bce=function(_0x200520,_0x10a657){_0x200520=_0x200520-0x0;var _0x37c803=_0xbce1[_0x200520];return _0x37c803;};'use strict';var Sequelize=require('sequelize');module[_0x1bce('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x1bce('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x1bce('0x1')]},'callerid':{'type':Sequelize[_0x1bce('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index f3f2e8d..590c08f 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 _0x7ebf=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','name','send','index','map','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','options','SquareDetailsReport','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x24f029,_0x1eb4f0){var _0x5255a0=function(_0x138c0c){while(--_0x138c0c){_0x24f029['push'](_0x24f029['shift']());}};_0x5255a0(++_0x1eb4f0);}(_0x7ebf,0x84));var _0xf7eb=function(_0x1e0f3b,_0x2d5332){_0x1e0f3b=_0x1e0f3b-0x0;var _0x4cdd17=_0x7ebf[_0x1e0f3b];return _0x4cdd17;};'use strict';var emlformat=require(_0xf7eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf7eb('0x1'));var jsonpatch=require(_0xf7eb('0x2'));var rp=require('request-promise');var moment=require(_0xf7eb('0x3'));var BPromise=require(_0xf7eb('0x4'));var Mustache=require('mustache');var util=require(_0xf7eb('0x5'));var path=require(_0xf7eb('0x6'));var sox=require(_0xf7eb('0x7'));var csv=require(_0xf7eb('0x8'));var ejs=require(_0xf7eb('0x9'));var fs=require('fs');var fs_extra=require(_0xf7eb('0xa'));var _=require(_0xf7eb('0xb'));var squel=require(_0xf7eb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf7eb('0xd'));var toCsv=require(_0xf7eb('0x8'));var querystring=require(_0xf7eb('0xe'));var Papa=require(_0xf7eb('0xf'));var Redis=require('ioredis');var authService=require(_0xf7eb('0x10'));var qs=require(_0xf7eb('0x11'));var as=require(_0xf7eb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7eb('0x13'))(_0xf7eb('0x14'));var utils=require(_0xf7eb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf7eb('0x16'));var db=require(_0xf7eb('0x17'))['db'];function respondWithStatusCode(_0x611fd8,_0x17b7f5){_0x17b7f5=_0x17b7f5||0xcc;return function(_0x3cc538){if(_0x3cc538){return _0x611fd8['sendStatus'](_0x17b7f5);}return _0x611fd8[_0xf7eb('0x18')](_0x17b7f5)[_0xf7eb('0x19')]();};}function respondWithResult(_0xe7d609,_0x21e634){_0x21e634=_0x21e634||0xc8;return function(_0x550435){if(_0x550435){return _0xe7d609['status'](_0x21e634)[_0xf7eb('0x1a')](_0x550435);}};}function respondWithFilteredResult(_0x580de0,_0x4aa0e3){return function(_0x118ce0){if(_0x118ce0){var _0x11a3da=typeof _0x4aa0e3[_0xf7eb('0x1b')]===_0xf7eb('0x1c')&&typeof _0x4aa0e3['limit']===_0xf7eb('0x1c');var _0x20cfba=_0x118ce0[_0xf7eb('0x1d')];var _0x5c4e24=_0x11a3da?0x0:_0x4aa0e3[_0xf7eb('0x1b')];var _0x48b9b8=_0x11a3da?_0x118ce0[_0xf7eb('0x1d')]:_0x4aa0e3[_0xf7eb('0x1b')]+_0x4aa0e3[_0xf7eb('0x1e')];var _0x344cdd;if(_0x48b9b8>=_0x20cfba){_0x48b9b8=_0x20cfba;_0x344cdd=0xc8;}else{_0x344cdd=0xce;}_0x580de0['status'](_0x344cdd);return _0x580de0[_0xf7eb('0x1f')](_0xf7eb('0x20'),_0x5c4e24+'-'+_0x48b9b8+'/'+_0x20cfba)['json'](_0x118ce0);}return null;};}function patchUpdates(_0x137f66){return function(_0x235e16){try{jsonpatch[_0xf7eb('0x21')](_0x235e16,_0x137f66,!![]);}catch(_0x285c30){return BPromise[_0xf7eb('0x22')](_0x285c30);}return _0x235e16[_0xf7eb('0x23')]();};}function saveUpdates(_0x569d70,_0xfb85fc){return function(_0x56216e){if(_0x56216e){return _0x56216e[_0xf7eb('0x24')](_0x569d70)[_0xf7eb('0x25')](function(_0x3398f7){return _0x3398f7;});}return null;};}function removeEntity(_0x25708c,_0x577e6a){return function(_0x3f2a80){if(_0x3f2a80){return _0x3f2a80['destroy']()[_0xf7eb('0x25')](function(){_0x25708c['status'](0xcc)[_0xf7eb('0x19')]();});}};}function handleEntityNotFound(_0x44db58,_0x466028){return function(_0x583899){if(!_0x583899){_0x44db58[_0xf7eb('0x26')](0x194);}return _0x583899;};}function handleError(_0x6bd404,_0x1ba1ad){_0x1ba1ad=_0x1ba1ad||0x1f4;return function(_0x2b0e8e){logger['error'](_0x2b0e8e['stack']);if(_0x2b0e8e[_0xf7eb('0x27')]){delete _0x2b0e8e[_0xf7eb('0x27')];}_0x6bd404[_0xf7eb('0x18')](_0x1ba1ad)[_0xf7eb('0x28')](_0x2b0e8e);};}exports[_0xf7eb('0x29')]=function(_0x2b6810,_0x127591){var _0x4f19d0={},_0x18c8fa={},_0x1d009e={'count':0x0,'rows':[]};var _0x2ecb1f=_[_0xf7eb('0x2a')](db['SquareDetailsReport'][_0xf7eb('0x2b')],function(_0x4093ad){return{'name':_0x4093ad[_0xf7eb('0x2c')],'type':_0x4093ad[_0xf7eb('0x2d')]['key']};});_0x18c8fa['model']=_[_0xf7eb('0x2a')](_0x2ecb1f,'name');_0x18c8fa[_0xf7eb('0x2e')]=_[_0xf7eb('0x2f')](_0x2b6810[_0xf7eb('0x2e')]);_0x18c8fa['filters']=_['intersection'](_0x18c8fa['model'],_0x18c8fa[_0xf7eb('0x2e')]);_0x4f19d0['attributes']=_[_0xf7eb('0x30')](_0x18c8fa[_0xf7eb('0x31')],qs[_0xf7eb('0x32')](_0x2b6810[_0xf7eb('0x2e')][_0xf7eb('0x32')]));_0x4f19d0[_0xf7eb('0x33')]=_0x4f19d0['attributes']['length']?_0x4f19d0[_0xf7eb('0x33')]:_0x18c8fa[_0xf7eb('0x31')];if(!_0x2b6810['query'][_0xf7eb('0x34')]('nolimit')){_0x4f19d0['limit']=qs[_0xf7eb('0x1e')](_0x2b6810[_0xf7eb('0x2e')][_0xf7eb('0x1e')]);_0x4f19d0[_0xf7eb('0x1b')]=qs[_0xf7eb('0x1b')](_0x2b6810[_0xf7eb('0x2e')][_0xf7eb('0x1b')]);}_0x4f19d0[_0xf7eb('0x35')]=qs['sort'](_0x2b6810['query'][_0xf7eb('0x36')]);_0x4f19d0[_0xf7eb('0x37')]=qs[_0xf7eb('0x38')](_[_0xf7eb('0x39')](_0x2b6810['query'],_0x18c8fa[_0xf7eb('0x38')]),_0x2ecb1f);if(_0x2b6810['query']['filter']){_0x4f19d0[_0xf7eb('0x37')]=_[_0xf7eb('0x3a')](_0x4f19d0[_0xf7eb('0x37')],{'$or':_[_0xf7eb('0x2a')](_0x2ecb1f,function(_0x428c82){if(_0x428c82[_0xf7eb('0x2d')]!==_0xf7eb('0x3b')){var _0xaed7bf={};_0xaed7bf[_0x428c82[_0xf7eb('0x27')]]={'$like':'%'+_0x2b6810['query']['filter']+'%'};return _0xaed7bf;}})});}_0x4f19d0=_[_0xf7eb('0x3a')]({},_0x4f19d0,_0x2b6810[_0xf7eb('0x3c')]);var _0x545781={'where':_0x4f19d0[_0xf7eb('0x37')]};return db[_0xf7eb('0x3d')][_0xf7eb('0x1d')](_0x545781)[_0xf7eb('0x25')](function(_0x1ba487){_0x1d009e[_0xf7eb('0x1d')]=_0x1ba487;if(_0x2b6810[_0xf7eb('0x2e')]['includeAll']){_0x4f19d0[_0xf7eb('0x3e')]=[{'all':!![]}];}return db[_0xf7eb('0x3d')][_0xf7eb('0x3f')](_0x4f19d0);})[_0xf7eb('0x25')](function(_0xc7681d){_0x1d009e[_0xf7eb('0x40')]=_0xc7681d;return _0x1d009e;})[_0xf7eb('0x25')](respondWithFilteredResult(_0x127591,_0x4f19d0))[_0xf7eb('0x41')](handleError(_0x127591,null));};exports[_0xf7eb('0x42')]=function(_0x219c91,_0x2d1f99){var _0xdd4482={'raw':!![],'where':{'id':_0x219c91[_0xf7eb('0x43')]['id']}},_0xce34e8={};_0xce34e8[_0xf7eb('0x31')]=_[_0xf7eb('0x2f')](db[_0xf7eb('0x3d')]['rawAttributes']);_0xce34e8[_0xf7eb('0x2e')]=_[_0xf7eb('0x2f')](_0x219c91[_0xf7eb('0x2e')]);_0xce34e8['filters']=_['intersection'](_0xce34e8[_0xf7eb('0x31')],_0xce34e8[_0xf7eb('0x2e')]);_0xdd4482['attributes']=_[_0xf7eb('0x30')](_0xce34e8[_0xf7eb('0x31')],qs[_0xf7eb('0x32')](_0x219c91[_0xf7eb('0x2e')]['fields']));_0xdd4482[_0xf7eb('0x33')]=_0xdd4482[_0xf7eb('0x33')][_0xf7eb('0x44')]?_0xdd4482['attributes']:_0xce34e8[_0xf7eb('0x31')];if(_0x219c91['query'][_0xf7eb('0x45')]){_0xdd4482['include']=[{'all':!![]}];}_0xdd4482=_[_0xf7eb('0x3a')]({},_0xdd4482,_0x219c91[_0xf7eb('0x3c')]);return db[_0xf7eb('0x3d')][_0xf7eb('0x46')](_0xdd4482)['then'](handleEntityNotFound(_0x2d1f99,null))['then'](respondWithResult(_0x2d1f99,null))[_0xf7eb('0x41')](handleError(_0x2d1f99,null));};exports[_0xf7eb('0x47')]=function(_0x2fac49,_0x2bce9b){return db[_0xf7eb('0x3d')][_0xf7eb('0x47')](_0x2fac49[_0xf7eb('0x48')],{})[_0xf7eb('0x25')](respondWithResult(_0x2bce9b,0xc9))[_0xf7eb('0x41')](handleError(_0x2bce9b,null));};exports[_0xf7eb('0x24')]=function(_0x3ebe27,_0x1a9e1b){if(_0x3ebe27[_0xf7eb('0x48')]['id']){delete _0x3ebe27[_0xf7eb('0x48')]['id'];}return db['SquareDetailsReport'][_0xf7eb('0x46')]({'where':{'id':_0x3ebe27[_0xf7eb('0x43')]['id']}})[_0xf7eb('0x25')](handleEntityNotFound(_0x1a9e1b,null))[_0xf7eb('0x25')](saveUpdates(_0x3ebe27[_0xf7eb('0x48')],null))[_0xf7eb('0x25')](respondWithResult(_0x1a9e1b,null))[_0xf7eb('0x41')](handleError(_0x1a9e1b,null));};exports[_0xf7eb('0x49')]=function(_0x45c20a,_0x49dbf7){return db[_0xf7eb('0x3d')]['find']({'where':{'id':_0x45c20a[_0xf7eb('0x43')]['id']}})['then'](handleEntityNotFound(_0x49dbf7,null))[_0xf7eb('0x25')](removeEntity(_0x49dbf7,null))[_0xf7eb('0x41')](handleError(_0x49dbf7,null));};exports[_0xf7eb('0x4a')]=function(_0x4505dc,_0x5876cd){return db['SquareDetailsReport'][_0xf7eb('0x4a')]()[_0xf7eb('0x25')](respondWithResult(_0x5876cd,null))['catch'](handleError(_0x5876cd,null));}; \ No newline at end of file +var _0x4f6d=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','status','sendStatus','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','describe','eml-format'];(function(_0x8ee4e8,_0x192cf2){var _0x4b1ec4=function(_0xc3cfa5){while(--_0xc3cfa5){_0x8ee4e8['push'](_0x8ee4e8['shift']());}};_0x4b1ec4(++_0x192cf2);}(_0x4f6d,0x1eb));var _0xd4f6=function(_0x1cd62a,_0x3f1947){_0x1cd62a=_0x1cd62a-0x0;var _0x48d513=_0x4f6d[_0x1cd62a];return _0x48d513;};'use strict';var emlformat=require(_0xd4f6('0x0'));var rimraf=require(_0xd4f6('0x1'));var zipdir=require(_0xd4f6('0x2'));var jsonpatch=require(_0xd4f6('0x3'));var rp=require(_0xd4f6('0x4'));var moment=require(_0xd4f6('0x5'));var BPromise=require(_0xd4f6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd4f6('0x7'));var sox=require(_0xd4f6('0x8'));var csv=require(_0xd4f6('0x9'));var ejs=require(_0xd4f6('0xa'));var fs=require('fs');var fs_extra=require(_0xd4f6('0xb'));var _=require(_0xd4f6('0xc'));var squel=require(_0xd4f6('0xd'));var crypto=require(_0xd4f6('0xe'));var jsforce=require(_0xd4f6('0xf'));var deskjs=require(_0xd4f6('0x10'));var toCsv=require('to-csv');var querystring=require(_0xd4f6('0x11'));var Papa=require(_0xd4f6('0x12'));var Redis=require(_0xd4f6('0x13'));var authService=require(_0xd4f6('0x14'));var qs=require(_0xd4f6('0x15'));var as=require(_0xd4f6('0x16'));var hardwareService=require(_0xd4f6('0x17'));var logger=require(_0xd4f6('0x18'))(_0xd4f6('0x19'));var utils=require(_0xd4f6('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd4f6('0x1b'))['db'];function respondWithStatusCode(_0x3a6c09,_0x9f6705){_0x9f6705=_0x9f6705||0xcc;return function(_0x3d211e){if(_0x3d211e){return _0x3a6c09['sendStatus'](_0x9f6705);}return _0x3a6c09['status'](_0x9f6705)[_0xd4f6('0x1c')]();};}function respondWithResult(_0x519f2d,_0x32bf4c){_0x32bf4c=_0x32bf4c||0xc8;return function(_0x6bdc51){if(_0x6bdc51){return _0x519f2d['status'](_0x32bf4c)[_0xd4f6('0x1d')](_0x6bdc51);}};}function respondWithFilteredResult(_0xab0064,_0x2a7b1c){return function(_0x569397){if(_0x569397){var _0x5dce20=typeof _0x2a7b1c['offset']===_0xd4f6('0x1e')&&typeof _0x2a7b1c[_0xd4f6('0x1f')]===_0xd4f6('0x1e');var _0x22d584=_0x569397[_0xd4f6('0x20')];var _0x44b01c=_0x5dce20?0x0:_0x2a7b1c[_0xd4f6('0x21')];var _0x2a49cf=_0x5dce20?_0x569397[_0xd4f6('0x20')]:_0x2a7b1c['offset']+_0x2a7b1c[_0xd4f6('0x1f')];var _0x222b7c;if(_0x2a49cf>=_0x22d584){_0x2a49cf=_0x22d584;_0x222b7c=0xc8;}else{_0x222b7c=0xce;}_0xab0064['status'](_0x222b7c);return _0xab0064[_0xd4f6('0x22')](_0xd4f6('0x23'),_0x44b01c+'-'+_0x2a49cf+'/'+_0x22d584)['json'](_0x569397);}return null;};}function patchUpdates(_0x419166){return function(_0x331a67){try{jsonpatch[_0xd4f6('0x24')](_0x331a67,_0x419166,!![]);}catch(_0x49f449){return BPromise[_0xd4f6('0x25')](_0x49f449);}return _0x331a67[_0xd4f6('0x26')]();};}function saveUpdates(_0x2cad8d,_0x1539e0){return function(_0x40d9c5){if(_0x40d9c5){return _0x40d9c5['update'](_0x2cad8d)[_0xd4f6('0x27')](function(_0x169541){return _0x169541;});}return null;};}function removeEntity(_0x417146,_0x4f99fa){return function(_0x1372d3){if(_0x1372d3){return _0x1372d3[_0xd4f6('0x28')]()[_0xd4f6('0x27')](function(){_0x417146[_0xd4f6('0x29')](0xcc)[_0xd4f6('0x1c')]();});}};}function handleEntityNotFound(_0x37c967,_0x7fdb0b){return function(_0x3bfef2){if(!_0x3bfef2){_0x37c967[_0xd4f6('0x2a')](0x194);}return _0x3bfef2;};}function handleError(_0x3ecee0,_0x2fa666){_0x2fa666=_0x2fa666||0x1f4;return function(_0x5886f7){logger[_0xd4f6('0x2b')](_0x5886f7[_0xd4f6('0x2c')]);if(_0x5886f7['name']){delete _0x5886f7[_0xd4f6('0x2d')];}_0x3ecee0['status'](_0x2fa666)[_0xd4f6('0x2e')](_0x5886f7);};}exports[_0xd4f6('0x2f')]=function(_0x3e554f,_0x16c32e){var _0x57072e={},_0x4d9a88={},_0x3c61fc={'count':0x0,'rows':[]};var _0x475438=_[_0xd4f6('0x30')](db[_0xd4f6('0x31')][_0xd4f6('0x32')],function(_0x210d6b){return{'name':_0x210d6b[_0xd4f6('0x33')],'type':_0x210d6b[_0xd4f6('0x34')][_0xd4f6('0x35')]};});_0x4d9a88['model']=_[_0xd4f6('0x30')](_0x475438,_0xd4f6('0x2d'));_0x4d9a88[_0xd4f6('0x36')]=_[_0xd4f6('0x37')](_0x3e554f[_0xd4f6('0x36')]);_0x4d9a88['filters']=_[_0xd4f6('0x38')](_0x4d9a88['model'],_0x4d9a88['query']);_0x57072e[_0xd4f6('0x39')]=_[_0xd4f6('0x38')](_0x4d9a88[_0xd4f6('0x3a')],qs[_0xd4f6('0x3b')](_0x3e554f[_0xd4f6('0x36')][_0xd4f6('0x3b')]));_0x57072e['attributes']=_0x57072e[_0xd4f6('0x39')][_0xd4f6('0x3c')]?_0x57072e[_0xd4f6('0x39')]:_0x4d9a88[_0xd4f6('0x3a')];if(!_0x3e554f[_0xd4f6('0x36')][_0xd4f6('0x3d')](_0xd4f6('0x3e'))){_0x57072e[_0xd4f6('0x1f')]=qs[_0xd4f6('0x1f')](_0x3e554f[_0xd4f6('0x36')][_0xd4f6('0x1f')]);_0x57072e[_0xd4f6('0x21')]=qs['offset'](_0x3e554f[_0xd4f6('0x36')][_0xd4f6('0x21')]);}_0x57072e['order']=qs['sort'](_0x3e554f[_0xd4f6('0x36')][_0xd4f6('0x3f')]);_0x57072e[_0xd4f6('0x40')]=qs[_0xd4f6('0x41')](_[_0xd4f6('0x42')](_0x3e554f['query'],_0x4d9a88[_0xd4f6('0x41')]),_0x475438);if(_0x3e554f[_0xd4f6('0x36')][_0xd4f6('0x43')]){_0x57072e[_0xd4f6('0x40')]=_['merge'](_0x57072e[_0xd4f6('0x40')],{'$or':_[_0xd4f6('0x30')](_0x475438,function(_0x239a3a){if(_0x239a3a[_0xd4f6('0x34')]!==_0xd4f6('0x44')){var _0x1187a9={};_0x1187a9[_0x239a3a[_0xd4f6('0x2d')]]={'$like':'%'+_0x3e554f[_0xd4f6('0x36')][_0xd4f6('0x43')]+'%'};return _0x1187a9;}})});}_0x57072e=_[_0xd4f6('0x45')]({},_0x57072e,_0x3e554f['options']);var _0x2632d4={'where':_0x57072e[_0xd4f6('0x40')]};return db[_0xd4f6('0x31')][_0xd4f6('0x20')](_0x2632d4)[_0xd4f6('0x27')](function(_0x1e5517){_0x3c61fc[_0xd4f6('0x20')]=_0x1e5517;if(_0x3e554f['query'][_0xd4f6('0x46')]){_0x57072e[_0xd4f6('0x47')]=[{'all':!![]}];}return db[_0xd4f6('0x31')][_0xd4f6('0x48')](_0x57072e);})[_0xd4f6('0x27')](function(_0xa3c195){_0x3c61fc[_0xd4f6('0x49')]=_0xa3c195;return _0x3c61fc;})[_0xd4f6('0x27')](respondWithFilteredResult(_0x16c32e,_0x57072e))['catch'](handleError(_0x16c32e,null));};exports[_0xd4f6('0x4a')]=function(_0x355f95,_0x7562da){var _0x24394f={'raw':!![],'where':{'id':_0x355f95[_0xd4f6('0x4b')]['id']}},_0x497d15={};_0x497d15[_0xd4f6('0x3a')]=_[_0xd4f6('0x37')](db[_0xd4f6('0x31')][_0xd4f6('0x32')]);_0x497d15['query']=_[_0xd4f6('0x37')](_0x355f95[_0xd4f6('0x36')]);_0x497d15[_0xd4f6('0x41')]=_[_0xd4f6('0x38')](_0x497d15['model'],_0x497d15[_0xd4f6('0x36')]);_0x24394f['attributes']=_[_0xd4f6('0x38')](_0x497d15[_0xd4f6('0x3a')],qs['fields'](_0x355f95[_0xd4f6('0x36')][_0xd4f6('0x3b')]));_0x24394f[_0xd4f6('0x39')]=_0x24394f[_0xd4f6('0x39')]['length']?_0x24394f[_0xd4f6('0x39')]:_0x497d15[_0xd4f6('0x3a')];if(_0x355f95[_0xd4f6('0x36')][_0xd4f6('0x46')]){_0x24394f[_0xd4f6('0x47')]=[{'all':!![]}];}_0x24394f=_['merge']({},_0x24394f,_0x355f95['options']);return db[_0xd4f6('0x31')][_0xd4f6('0x4c')](_0x24394f)[_0xd4f6('0x27')](handleEntityNotFound(_0x7562da,null))[_0xd4f6('0x27')](respondWithResult(_0x7562da,null))[_0xd4f6('0x4d')](handleError(_0x7562da,null));};exports['create']=function(_0x58d1fc,_0x3e7adf){return db[_0xd4f6('0x31')][_0xd4f6('0x4e')](_0x58d1fc[_0xd4f6('0x4f')],{})[_0xd4f6('0x27')](respondWithResult(_0x3e7adf,0xc9))[_0xd4f6('0x4d')](handleError(_0x3e7adf,null));};exports[_0xd4f6('0x50')]=function(_0x988d36,_0x16c648){if(_0x988d36[_0xd4f6('0x4f')]['id']){delete _0x988d36[_0xd4f6('0x4f')]['id'];}return db[_0xd4f6('0x31')]['find']({'where':{'id':_0x988d36[_0xd4f6('0x4b')]['id']}})[_0xd4f6('0x27')](handleEntityNotFound(_0x16c648,null))[_0xd4f6('0x27')](saveUpdates(_0x988d36[_0xd4f6('0x4f')],null))[_0xd4f6('0x27')](respondWithResult(_0x16c648,null))[_0xd4f6('0x4d')](handleError(_0x16c648,null));};exports['destroy']=function(_0x1e4c4c,_0x98668b){return db[_0xd4f6('0x31')]['find']({'where':{'id':_0x1e4c4c['params']['id']}})[_0xd4f6('0x27')](handleEntityNotFound(_0x98668b,null))[_0xd4f6('0x27')](removeEntity(_0x98668b,null))[_0xd4f6('0x4d')](handleError(_0x98668b,null));};exports[_0xd4f6('0x51')]=function(_0x179562,_0x45d4a0){return db[_0xd4f6('0x31')][_0xd4f6('0x51')]()['then'](respondWithResult(_0x45d4a0,null))[_0xd4f6('0x4d')](handleError(_0x45d4a0,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index cae1320..cafacb6 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 _0xc4f0=['moment','bluebird','request-promise','path','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api'];(function(_0x7e30c2,_0x5e0233){var _0x1fb209=function(_0x574800){while(--_0x574800){_0x7e30c2['push'](_0x7e30c2['shift']());}};_0x1fb209(++_0x5e0233);}(_0xc4f0,0x159));var _0x0c4f=function(_0x1a35c7,_0x4de07b){_0x1a35c7=_0x1a35c7-0x0;var _0x39ef7c=_0xc4f0[_0x1a35c7];return _0x39ef7c;};'use strict';var _=require(_0x0c4f('0x0'));var util=require('util');var logger=require(_0x0c4f('0x1'))(_0x0c4f('0x2'));var moment=require(_0x0c4f('0x3'));var BPromise=require(_0x0c4f('0x4'));var rp=require(_0x0c4f('0x5'));var fs=require('fs');var path=require(_0x0c4f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0c4f('0x7'));module[_0x0c4f('0x8')]=function(_0x4ae3fe,_0xeba970){return _0x4ae3fe[_0x0c4f('0x9')](_0x0c4f('0xa'),attributes,{'tableName':_0x0c4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebe5=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','report_square_details'];(function(_0x591838,_0x4006de){var _0x447260=function(_0x254423){while(--_0x254423){_0x591838['push'](_0x591838['shift']());}};_0x447260(++_0x4006de);}(_0xebe5,0xfd));var _0x5ebe=function(_0x436e37,_0x42bd9c){_0x436e37=_0x436e37-0x0;var _0x4b6838=_0xebe5[_0x436e37];return _0x4b6838;};'use strict';var _=require(_0x5ebe('0x0'));var util=require(_0x5ebe('0x1'));var logger=require(_0x5ebe('0x2'))('api');var moment=require(_0x5ebe('0x3'));var BPromise=require(_0x5ebe('0x4'));var rp=require(_0x5ebe('0x5'));var fs=require('fs');var path=require(_0x5ebe('0x6'));var rimraf=require('rimraf');var config=require(_0x5ebe('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x5ebe('0x8')]=function(_0x239d05,_0x19db29){return _0x239d05[_0x5ebe('0x9')]('SquareDetailsReport',attributes,{'tableName':_0x5ebe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index bab1030..f69e259 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 _0x1a85=['then','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw'];(function(_0x2a2e72,_0x1de962){var _0x3cfb4a=function(_0x3d435c){while(--_0x3d435c){_0x2a2e72['push'](_0x2a2e72['shift']());}};_0x3cfb4a(++_0x1de962);}(_0x1a85,0x178));var _0x51a8=function(_0x2657f7,_0x15c229){_0x2657f7=_0x2657f7-0x0;var _0x6d956=_0x1a85[_0x2657f7];return _0x6d956;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}exports[_0x51a8('0x13')]=function(_0x45a433){var _0xd52230=this;return new Promise(function(_0x23539e,_0x3bc1a2){return db[_0x51a8('0x14')]['create'](_0x45a433[_0x51a8('0x15')],{'raw':_0x45a433[_0x51a8('0x16')]?_0x45a433[_0x51a8('0x16')][_0x51a8('0x17')]===undefined?!![]:![]:!![]})[_0x51a8('0x18')](function(_0x3bc044){logger[_0x51a8('0x8')](_0x51a8('0x13'),_0x45a433);logger['debug'](_0x51a8('0x13'),_0x45a433,JSON['stringify'](_0x3bc044));_0x23539e(_0x3bc044);})[_0x51a8('0x12')](function(_0x12c029){logger[_0x51a8('0xe')](_0x51a8('0x13'),_0x12c029['message'],_0x45a433);_0x3bc1a2(_0xd52230[_0x51a8('0xe')](0x1f4,_0x12c029['message']));});});}; \ No newline at end of file +var _0x80ed=['body','options','raw','CreateSquareDetailsReport','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create'];(function(_0x4917e2,_0x379af2){var _0x5ed542=function(_0xeb73a6){while(--_0xeb73a6){_0x4917e2['push'](_0x4917e2['shift']());}};_0x5ed542(++_0x379af2);}(_0x80ed,0x11c));var _0xd80e=function(_0x361f6e,_0x5160ea){_0x361f6e=_0x361f6e-0x0;var _0x21fc7a=_0x80ed[_0x361f6e];return _0x21fc7a;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var moment=require(_0xd80e('0x1'));var BPromise=require(_0xd80e('0x2'));var rs=require(_0xd80e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd80e('0x4'))['db'];var utils=require(_0xd80e('0x5'));var logger=require(_0xd80e('0x6'))(_0xd80e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd80e('0x8'));var client=jayson[_0xd80e('0x9')][_0xd80e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51c361,_0x411b3a,_0x438f7d){return new BPromise(function(_0x3b4f35,_0x1bacd3){return client[_0xd80e('0xb')](_0x51c361,_0x438f7d)[_0xd80e('0xc')](function(_0x3063ff){logger[_0xd80e('0xd')](_0xd80e('0xe'),_0x411b3a,_0xd80e('0xf'));logger['debug'](_0xd80e('0x10'),_0x411b3a,_0xd80e('0xf'),JSON[_0xd80e('0x11')](_0x3063ff));if(_0x3063ff[_0xd80e('0x12')]){if(_0x3063ff[_0xd80e('0x12')][_0xd80e('0x13')]===0x1f4){logger[_0xd80e('0x12')](_0xd80e('0xe'),_0x411b3a,_0x3063ff[_0xd80e('0x12')]['message']);return _0x1bacd3(_0x3063ff['error']['message']);}logger['error'](_0xd80e('0xe'),_0x411b3a,_0x3063ff[_0xd80e('0x12')][_0xd80e('0x14')]);return _0x3b4f35(_0x3063ff[_0xd80e('0x12')][_0xd80e('0x14')]);}else{logger['info'](_0xd80e('0xe'),_0x411b3a,_0xd80e('0xf'));_0x3b4f35(_0x3063ff[_0xd80e('0x15')][_0xd80e('0x14')]);}})[_0xd80e('0x16')](function(_0xc25d82){logger[_0xd80e('0x12')](_0xd80e('0xe'),_0x411b3a,_0xc25d82);_0x1bacd3(_0xc25d82);});});}exports['CreateSquareDetailsReport']=function(_0x21ceec){var _0x1cc576=this;return new Promise(function(_0x3b543d,_0x34e239){return db['SquareDetailsReport'][_0xd80e('0x17')](_0x21ceec[_0xd80e('0x18')],{'raw':_0x21ceec[_0xd80e('0x19')]?_0x21ceec['options'][_0xd80e('0x1a')]===undefined?!![]:![]:!![]})[_0xd80e('0xc')](function(_0x2765ea){logger[_0xd80e('0xd')](_0xd80e('0x1b'),_0x21ceec);logger['debug']('CreateSquareDetailsReport',_0x21ceec,JSON[_0xd80e('0x11')](_0x2765ea));_0x3b543d(_0x2765ea);})[_0xd80e('0x16')](function(_0x3b39bf){logger[_0xd80e('0x12')](_0xd80e('0x1b'),_0x3b39bf[_0xd80e('0x14')],_0x21ceec);_0x34e239(_0x1cc576[_0xd80e('0x12')](0x1f4,_0x3b39bf['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 225977f..6143276 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 _0x0d6c=['express','../../components/auth/service','get','isAuthenticated','/process/:pid/kill','exports'];(function(_0x305350,_0x2bf49c){var _0x252eb0=function(_0x439b8a){while(--_0x439b8a){_0x305350['push'](_0x305350['shift']());}};_0x252eb0(++_0x2bf49c);}(_0x0d6c,0x72));var _0xc0d6=function(_0xe8c648,_0x3d30cb){_0xe8c648=_0xe8c648-0x0;var _0x4bbc0f=_0x0d6c[_0xe8c648];return _0x4bbc0f;};'use strict';var express=require(_0xc0d6('0x0'));var router=express['Router']();var auth=require(_0xc0d6('0x1'));var controller=require('./system.controller');router[_0xc0d6('0x2')]('/',auth[_0xc0d6('0x3')](),controller['index']);router['get'](_0xc0d6('0x4'),auth['isAuthenticated'](),controller['killProcess']);module[_0xc0d6('0x5')]=router; \ No newline at end of file +var _0xbe40=['exports','express','Router','../../components/auth/service','get','isAuthenticated','killProcess'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xbe40,0x119));var _0x0be4=function(_0x578fcb,_0x14b111){_0x578fcb=_0x578fcb-0x0;var _0x236536=_0xbe40[_0x578fcb];return _0x236536;};'use strict';var express=require(_0x0be4('0x0'));var router=express[_0x0be4('0x1')]();var auth=require(_0x0be4('0x2'));var controller=require('./system.controller');router[_0x0be4('0x3')]('/',auth[_0x0be4('0x4')](),controller['index']);router[_0x0be4('0x3')]('/process/:pid/kill',auth[_0x0be4('0x4')](),controller[_0x0be4('0x5')]);module[_0x0be4('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 817b088..f332726 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 _0x5108=['api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','index','getAllData','then','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec'];(function(_0x12e264,_0x4a5b5d){var _0x1a7ad4=function(_0x5d5d9a){while(--_0x5d5d9a){_0x12e264['push'](_0x12e264['shift']());}};_0x1a7ad4(++_0x4a5b5d);}(_0x5108,0x9f));var _0x8510=function(_0x18b3a9,_0x32db9e){_0x18b3a9=_0x18b3a9-0x0;var _0x480105=_0x5108[_0x18b3a9];return _0x480105;};'use strict';var info=require(_0x8510('0x0'));var exec=require(_0x8510('0x1'))[_0x8510('0x2')];var logger=require('../../config/logger')(_0x8510('0x3'));var util=require('util');var BPromise=require(_0x8510('0x4'));var _=require(_0x8510('0x5'));function handleError(_0x268f12,_0x466d56,_0x58ae48){_0x466d56=_0x466d56||0x1f4;return function(_0x396dc6){logger[_0x8510('0x6')](_0x8510('0x7'),_0x58ae48,_0x466d56,util[_0x8510('0x8')](_0x396dc6,{'showHidden':![],'depth':null}));delete _0x396dc6['name'];_0x268f12[_0x8510('0x9')](_0x466d56)['send'](_0x396dc6);};}exports[_0x8510('0xa')]=function(_0x4c81ec,_0x5c812a){return info[_0x8510('0xb')]()[_0x8510('0xc')](function(_0x318851){return _0x5c812a[_0x8510('0x9')](0xc8)[_0x8510('0xd')](_0x318851);})['catch'](function(_0x2726e7){return _0x5c812a['status'](0x1f4)['json'](_0x2726e7);});};exports[_0x8510('0xe')]=function(_0x19959f,_0x4f94c5){var _0x16e882=[_0x8510('0xf')];return new BPromise(function(_0x4770c6,_0x163113){return exec(util[_0x8510('0x10')](_0x8510('0x11'),_0x19959f[_0x8510('0x12')]['pid']),function(_0x19aaa6,_0x364d31,_0x1c2281){if(_0x19aaa6){return _0x163113(_0x19aaa6);}return _0x4770c6(_0x364d31);});})[_0x8510('0xc')](function(_0x24849a){var _0x584803=![];var _0x4abe43=_0x24849a[_0x8510('0x13')](/\n/);for(var _0x64a6c4=0x0,_0x3d26a9=_0x16e882[_0x8510('0x14')];_0x64a6c4<_0x3d26a9,_0x584803===![];_0x64a6c4+=0x1){if(_0x24849a[_0x8510('0x15')](_0x16e882[_0x64a6c4])>=0x0){_0x584803=!![];}}if(!_0x584803){throw new Error(util[_0x8510('0x10')](_0x8510('0x16'),_0x19959f['params'][_0x8510('0x17')]));}process['kill'](_0x19959f['params'][_0x8510('0x17')],_0x8510('0x18'));return _0x4f94c5[_0x8510('0x9')](0xc8)[_0x8510('0xd')]({'message':util[_0x8510('0x10')](_0x8510('0x19'),_0x19959f['params'][_0x8510('0x17')])});})[_0x8510('0x1a')](handleError(_0x4f94c5,null,_0x8510('0xe')));}; \ No newline at end of file +var _0x2959=['error','inspect','name','status','index','getAllData','then','json','catch','killProcess','components/import/cm','params','pid','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','api','util','lodash'];(function(_0x564068,_0xc1efeb){var _0x420d5f=function(_0x21d469){while(--_0x21d469){_0x564068['push'](_0x564068['shift']());}};_0x420d5f(++_0xc1efeb);}(_0x2959,0x166));var _0x9295=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2959[_0x2641f9];return _0x585741;};'use strict';var info=require(_0x9295('0x0'));var exec=require(_0x9295('0x1'))['exec'];var logger=require(_0x9295('0x2'))(_0x9295('0x3'));var util=require(_0x9295('0x4'));var BPromise=require('bluebird');var _=require(_0x9295('0x5'));function handleError(_0x562396,_0x12df73,_0x53e9f4){_0x12df73=_0x12df73||0x1f4;return function(_0x4a6d40){logger[_0x9295('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x53e9f4,_0x12df73,util[_0x9295('0x7')](_0x4a6d40,{'showHidden':![],'depth':null}));delete _0x4a6d40[_0x9295('0x8')];_0x562396[_0x9295('0x9')](_0x12df73)['send'](_0x4a6d40);};}exports[_0x9295('0xa')]=function(_0xd7c85b,_0x3d1aae){return info[_0x9295('0xb')]()[_0x9295('0xc')](function(_0x427a6c){return _0x3d1aae['status'](0xc8)[_0x9295('0xd')](_0x427a6c);})[_0x9295('0xe')](function(_0x4147e5){return _0x3d1aae[_0x9295('0x9')](0x1f4)[_0x9295('0xd')](_0x4147e5);});};exports[_0x9295('0xf')]=function(_0x53c14a,_0x1604c0){var _0x11b30a=[_0x9295('0x10')];return new BPromise(function(_0x552771,_0x39a9bd){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x53c14a[_0x9295('0x11')][_0x9295('0x12')]),function(_0x3163b1,_0x25c78d,_0x319192){if(_0x3163b1){return _0x39a9bd(_0x3163b1);}return _0x552771(_0x25c78d);});})[_0x9295('0xc')](function(_0x44a056){var _0x361b3f=![];var _0x1411d5=_0x44a056['split'](/\n/);for(var _0x17b3e1=0x0,_0x5af767=_0x11b30a[_0x9295('0x13')];_0x17b3e1<_0x5af767,_0x361b3f===![];_0x17b3e1+=0x1){if(_0x44a056[_0x9295('0x14')](_0x11b30a[_0x17b3e1])>=0x0){_0x361b3f=!![];}}if(!_0x361b3f){throw new Error(util[_0x9295('0x15')](_0x9295('0x16'),_0x53c14a[_0x9295('0x11')][_0x9295('0x12')]));}process[_0x9295('0x17')](_0x53c14a[_0x9295('0x11')]['pid'],_0x9295('0x18'));return _0x1604c0[_0x9295('0x9')](0xc8)[_0x9295('0xd')]({'message':util[_0x9295('0x15')](_0x9295('0x19'),_0x53c14a[_0x9295('0x11')][_0x9295('0x12')])});})[_0x9295('0xe')](handleError(_0x1604c0,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 30dbdca..6bc0497 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 _0xd959=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x56b643,_0x398e28){var _0x91af6f=function(_0x1e92cf){while(--_0x1e92cf){_0x56b643['push'](_0x56b643['shift']());}};_0x91af6f(++_0x398e28);}(_0xd959,0x1f3));var _0x9d95=function(_0x3285e8,_0x5336f2){_0x3285e8=_0x3285e8-0x0;var _0x23bbb0=_0xd959[_0x3285e8];return _0x23bbb0;};'use strict';var multer=require(_0x9d95('0x0'));var util=require(_0x9d95('0x1'));var path=require(_0x9d95('0x2'));var timeout=require(_0x9d95('0x3'));var express=require(_0x9d95('0x4'));var router=express[_0x9d95('0x5')]();var fs_extra=require(_0x9d95('0x6'));var auth=require(_0x9d95('0x7'));var interaction=require(_0x9d95('0x8'));var config=require('../../config/environment');var controller=require(_0x9d95('0x9'));router['get']('/',auth[_0x9d95('0xa')](),controller[_0x9d95('0xb')]);router[_0x9d95('0xc')](_0x9d95('0xd'),auth['isAuthenticated'](),controller[_0x9d95('0xe')]);router[_0x9d95('0xf')]('/',auth[_0x9d95('0xa')](),controller[_0x9d95('0x10')]);router[_0x9d95('0x11')](_0x9d95('0xd'),auth[_0x9d95('0xa')](),controller['update']);router[_0x9d95('0x12')]('/:id',auth[_0x9d95('0xa')](),controller[_0x9d95('0x13')]);module[_0x9d95('0x14')]=router; \ No newline at end of file +var _0x0fc9=['get','isAuthenticated','/:id','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0x2a4b5f,_0x1be6e3){var _0xde3780=function(_0x4eee5a){while(--_0x4eee5a){_0x2a4b5f['push'](_0x2a4b5f['shift']());}};_0xde3780(++_0x1be6e3);}(_0x0fc9,0x15f));var _0x90fc=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x0fc9[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x90fc('0x0'));var util=require(_0x90fc('0x1'));var path=require(_0x90fc('0x2'));var timeout=require('connect-timeout');var express=require(_0x90fc('0x3'));var router=express[_0x90fc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x90fc('0x5'));var interaction=require(_0x90fc('0x6'));var config=require(_0x90fc('0x7'));var controller=require(_0x90fc('0x8'));router[_0x90fc('0x9')]('/',auth[_0x90fc('0xa')](),controller['index']);router[_0x90fc('0x9')](_0x90fc('0xb'),auth[_0x90fc('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x90fc('0xc')]);router[_0x90fc('0xd')](_0x90fc('0xb'),auth[_0x90fc('0xa')](),controller[_0x90fc('0xe')]);router[_0x90fc('0xf')](_0x90fc('0xb'),auth[_0x90fc('0xa')](),controller[_0x90fc('0x10')]);module[_0x90fc('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 3f84e3f..2217672 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 _0x585e=['STRING','name','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x585e,0x1c2));var _0xe585=function(_0x19d796,_0x5311aa){_0x19d796=_0x19d796-0x0;var _0x5a5092=_0x585e[_0x19d796];return _0x5a5092;};'use strict';var Sequelize=require(_0xe585('0x0'));module[_0xe585('0x1')]={'name':{'type':Sequelize[_0xe585('0x2')],'unique':_0xe585('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xe585('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x85de=['sequelize','exports','STRING','name'];(function(_0x34669a,_0x108f7b){var _0x591889=function(_0x5043b6){while(--_0x5043b6){_0x34669a['push'](_0x34669a['shift']());}};_0x591889(++_0x108f7b);}(_0x85de,0x1f0));var _0xe85d=function(_0x57d582,_0x488254){_0x57d582=_0x57d582-0x0;var _0x56f493=_0x85de[_0x57d582];return _0x56f493;};'use strict';var Sequelize=require(_0xe85d('0x0'));module[_0xe85d('0x1')]={'name':{'type':Sequelize[_0xe85d('0x2')],'unique':_0xe85d('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xe85d('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xe85d('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index c11988d..9efb05a 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 _0x6737=['error','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','update','then','destroy','get','Tags','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','options','Tag','include','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6737,0xe2));var _0x7673=function(_0x1c1cd5,_0x30e441){_0x1c1cd5=_0x1c1cd5-0x0;var _0x50b912=_0x6737[_0x1c1cd5];return _0x50b912;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7673('0x0'));var zipdir=require(_0x7673('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7673('0x2'));var moment=require(_0x7673('0x3'));var BPromise=require(_0x7673('0x4'));var Mustache=require(_0x7673('0x5'));var util=require('util');var path=require(_0x7673('0x6'));var sox=require(_0x7673('0x7'));var csv=require('to-csv');var ejs=require(_0x7673('0x8'));var fs=require('fs');var fs_extra=require(_0x7673('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7673('0xa'));var toCsv=require('to-csv');var querystring=require(_0x7673('0xb'));var Papa=require(_0x7673('0xc'));var Redis=require('ioredis');var authService=require(_0x7673('0xd'));var qs=require(_0x7673('0xe'));var as=require(_0x7673('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7673('0x10'));var utils=require('../../config/utils');var config=require(_0x7673('0x11'));var licenseUtil=require(_0x7673('0x12'));var db=require(_0x7673('0x13'))['db'];function respondWithStatusCode(_0x451c87,_0x41d6bd){_0x41d6bd=_0x41d6bd||0xcc;return function(_0x119e42){if(_0x119e42){return _0x451c87[_0x7673('0x14')](_0x41d6bd);}return _0x451c87[_0x7673('0x15')](_0x41d6bd)[_0x7673('0x16')]();};}function respondWithResult(_0x20a649,_0x5c8626){_0x5c8626=_0x5c8626||0xc8;return function(_0x26f0c4){if(_0x26f0c4){return _0x20a649[_0x7673('0x15')](_0x5c8626)[_0x7673('0x17')](_0x26f0c4);}};}function respondWithFilteredResult(_0x2c83d,_0x224cea){return function(_0x2e83c4){if(_0x2e83c4){var _0x2a2840=typeof _0x224cea['offset']==='undefined'&&typeof _0x224cea[_0x7673('0x18')]===_0x7673('0x19');var _0x50f8d9=_0x2e83c4[_0x7673('0x1a')];var _0x17699a=_0x2a2840?0x0:_0x224cea['offset'];var _0x33ff7d=_0x2a2840?_0x2e83c4[_0x7673('0x1a')]:_0x224cea[_0x7673('0x1b')]+_0x224cea['limit'];var _0x50f22d;if(_0x33ff7d>=_0x50f8d9){_0x33ff7d=_0x50f8d9;_0x50f22d=0xc8;}else{_0x50f22d=0xce;}_0x2c83d[_0x7673('0x15')](_0x50f22d);return _0x2c83d[_0x7673('0x1c')]('Content-Range',_0x17699a+'-'+_0x33ff7d+'/'+_0x50f8d9)[_0x7673('0x17')](_0x2e83c4);}return null;};}function patchUpdates(_0x29bbd9){return function(_0x2e1260){try{jsonpatch[_0x7673('0x1d')](_0x2e1260,_0x29bbd9,!![]);}catch(_0x4245bf){return BPromise[_0x7673('0x1e')](_0x4245bf);}return _0x2e1260['save']();};}function saveUpdates(_0x557161,_0xea9b37){return function(_0x21774f){if(_0x21774f){return _0x21774f[_0x7673('0x1f')](_0x557161)[_0x7673('0x20')](function(_0x16bb16){return _0x16bb16;});}return null;};}function removeEntity(_0x54f38d,_0x2009e1){return function(_0x3b2a75){if(_0x3b2a75){return _0x3b2a75[_0x7673('0x21')]()[_0x7673('0x20')](function(){var _0x132dc6=_0x3b2a75[_0x7673('0x22')]({'plain':!![]});var _0x538280=_0x7673('0x23');return db[_0x7673('0x24')][_0x7673('0x21')]({'where':{'type':_0x538280,'resourceId':_0x132dc6['id']}})[_0x7673('0x20')](function(){return _0x3b2a75;});})['then'](function(){_0x54f38d['status'](0xcc)[_0x7673('0x16')]();});}};}function handleEntityNotFound(_0x11b42b,_0x291d10){return function(_0x9d9eab){if(!_0x9d9eab){_0x11b42b[_0x7673('0x14')](0x194);}return _0x9d9eab;};}function handleError(_0x45a045,_0x442f42){_0x442f42=_0x442f42||0x1f4;return function(_0x5a59f9){logger['error'](_0x5a59f9[_0x7673('0x25')]);if(_0x5a59f9[_0x7673('0x26')]){delete _0x5a59f9[_0x7673('0x26')];}_0x45a045[_0x7673('0x15')](_0x442f42)[_0x7673('0x27')](_0x5a59f9);};}exports[_0x7673('0x28')]=function(_0x224122,_0x4f12b9){var _0x4fcacc={},_0xe7e528={},_0x36c841={'count':0x0,'rows':[]};var _0x268863=_[_0x7673('0x29')](db['Tag'][_0x7673('0x2a')],function(_0x497760){return{'name':_0x497760[_0x7673('0x2b')],'type':_0x497760[_0x7673('0x2c')][_0x7673('0x2d')]};});_0xe7e528[_0x7673('0x2e')]=_[_0x7673('0x29')](_0x268863,_0x7673('0x26'));_0xe7e528[_0x7673('0x2f')]=_[_0x7673('0x30')](_0x224122[_0x7673('0x2f')]);_0xe7e528[_0x7673('0x31')]=_[_0x7673('0x32')](_0xe7e528[_0x7673('0x2e')],_0xe7e528[_0x7673('0x2f')]);_0x4fcacc['attributes']=_[_0x7673('0x32')](_0xe7e528[_0x7673('0x2e')],qs[_0x7673('0x33')](_0x224122[_0x7673('0x2f')][_0x7673('0x33')]));_0x4fcacc[_0x7673('0x34')]=_0x4fcacc[_0x7673('0x34')]['length']?_0x4fcacc['attributes']:_0xe7e528[_0x7673('0x2e')];if(!_0x224122[_0x7673('0x2f')][_0x7673('0x35')](_0x7673('0x36'))){_0x4fcacc[_0x7673('0x18')]=qs[_0x7673('0x18')](_0x224122[_0x7673('0x2f')]['limit']);_0x4fcacc[_0x7673('0x1b')]=qs[_0x7673('0x1b')](_0x224122['query'][_0x7673('0x1b')]);}_0x4fcacc[_0x7673('0x37')]=qs[_0x7673('0x38')](_0x224122[_0x7673('0x2f')]['sort']);_0x4fcacc[_0x7673('0x39')]=qs[_0x7673('0x31')](_['pick'](_0x224122[_0x7673('0x2f')],_0xe7e528[_0x7673('0x31')]),_0x268863);if(_0x224122[_0x7673('0x2f')]['filter']){_0x4fcacc[_0x7673('0x39')]=_[_0x7673('0x3a')](_0x4fcacc[_0x7673('0x39')],{'$or':_['map'](_0x268863,function(_0x4c6106){if(_0x4c6106[_0x7673('0x2c')]!=='VIRTUAL'){var _0x4ba2b4={};_0x4ba2b4[_0x4c6106[_0x7673('0x26')]]={'$like':'%'+_0x224122[_0x7673('0x2f')]['filter']+'%'};return _0x4ba2b4;}})});}_0x4fcacc=_[_0x7673('0x3a')]({},_0x4fcacc,_0x224122[_0x7673('0x3b')]);var _0x2645a2={'where':_0x4fcacc[_0x7673('0x39')]};return db[_0x7673('0x3c')][_0x7673('0x1a')](_0x2645a2)['then'](function(_0x1edb82){_0x36c841['count']=_0x1edb82;if(_0x224122[_0x7673('0x2f')]['includeAll']){_0x4fcacc[_0x7673('0x3d')]=[{'all':!![]}];}return db[_0x7673('0x3c')]['findAll'](_0x4fcacc);})['then'](function(_0x1cac93){_0x36c841['rows']=_0x1cac93;return _0x36c841;})[_0x7673('0x20')](respondWithFilteredResult(_0x4f12b9,_0x4fcacc))[_0x7673('0x3e')](handleError(_0x4f12b9,null));};exports[_0x7673('0x3f')]=function(_0x3b6223,_0x1895df){var _0x545357={'raw':!![],'where':{'id':_0x3b6223[_0x7673('0x40')]['id']}},_0x4ea8b3={};_0x4ea8b3[_0x7673('0x2e')]=_['keys'](db[_0x7673('0x3c')][_0x7673('0x2a')]);_0x4ea8b3[_0x7673('0x2f')]=_['keys'](_0x3b6223[_0x7673('0x2f')]);_0x4ea8b3[_0x7673('0x31')]=_[_0x7673('0x32')](_0x4ea8b3[_0x7673('0x2e')],_0x4ea8b3[_0x7673('0x2f')]);_0x545357[_0x7673('0x34')]=_[_0x7673('0x32')](_0x4ea8b3[_0x7673('0x2e')],qs[_0x7673('0x33')](_0x3b6223['query'][_0x7673('0x33')]));_0x545357[_0x7673('0x34')]=_0x545357[_0x7673('0x34')][_0x7673('0x41')]?_0x545357[_0x7673('0x34')]:_0x4ea8b3[_0x7673('0x2e')];if(_0x3b6223[_0x7673('0x2f')]['includeAll']){_0x545357[_0x7673('0x3d')]=[{'all':!![]}];}_0x545357=_[_0x7673('0x3a')]({},_0x545357,_0x3b6223[_0x7673('0x3b')]);return db[_0x7673('0x3c')][_0x7673('0x42')](_0x545357)['then'](handleEntityNotFound(_0x1895df,null))[_0x7673('0x20')](respondWithResult(_0x1895df,null))[_0x7673('0x3e')](handleError(_0x1895df,null));};exports[_0x7673('0x43')]=function(_0x2397fb,_0x3f76a3){return db['Tag']['create'](_0x2397fb[_0x7673('0x44')],{})[_0x7673('0x20')](function(_0x510960){var _0x2314e7=_0x2397fb[_0x7673('0x45')][_0x7673('0x22')]({'plain':!![]});if(!_0x2314e7)throw new Error(_0x7673('0x46'));if(_0x2314e7[_0x7673('0x47')]==='user'){var _0x23789d=_0x510960[_0x7673('0x22')]({'plain':!![]});var _0x2a275b=_0x7673('0x23');return db['UserProfileSection'][_0x7673('0x42')]({'where':{'name':_0x2a275b,'userProfileId':_0x2314e7[_0x7673('0x48')]},'raw':!![]})[_0x7673('0x20')](function(_0xa93124){if(_0xa93124&&_0xa93124[_0x7673('0x49')]===0x0){return db[_0x7673('0x24')][_0x7673('0x43')]({'name':_0x23789d[_0x7673('0x26')],'resourceId':_0x23789d['id'],'type':_0xa93124[_0x7673('0x26')],'sectionId':_0xa93124['id']},{})[_0x7673('0x20')](function(){return _0x510960;});}else{return _0x510960;}})[_0x7673('0x3e')](function(_0x572119){logger[_0x7673('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572119);throw _0x572119;});}return _0x510960;})[_0x7673('0x20')](respondWithResult(_0x3f76a3,0xc9))[_0x7673('0x3e')](handleError(_0x3f76a3,null));};exports[_0x7673('0x1f')]=function(_0x523698,_0x185ec5){if(_0x523698[_0x7673('0x44')]['id']){delete _0x523698[_0x7673('0x44')]['id'];}return db[_0x7673('0x3c')][_0x7673('0x42')]({'where':{'id':_0x523698[_0x7673('0x40')]['id']}})[_0x7673('0x20')](handleEntityNotFound(_0x185ec5,null))[_0x7673('0x20')](saveUpdates(_0x523698[_0x7673('0x44')],null))[_0x7673('0x20')](respondWithResult(_0x185ec5,null))[_0x7673('0x3e')](handleError(_0x185ec5,null));};exports[_0x7673('0x21')]=function(_0x9be9a4,_0xb3c9e9){return db['Tag'][_0x7673('0x42')]({'where':{'id':_0x9be9a4['params']['id']}})[_0x7673('0x20')](handleEntityNotFound(_0xb3c9e9,null))[_0x7673('0x20')](removeEntity(_0xb3c9e9,null))[_0x7673('0x3e')](handleError(_0xb3c9e9,null));}; \ No newline at end of file +var _0x22fb=['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','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','merge','options','Tag','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','request-promise','moment'];(function(_0x4df69e,_0x5131d5){var _0x1f9041=function(_0x1e6288){while(--_0x1e6288){_0x4df69e['push'](_0x4df69e['shift']());}};_0x1f9041(++_0x5131d5);}(_0x22fb,0x192));var _0xb22f=function(_0x47fd5d,_0x27ce2f){_0x47fd5d=_0x47fd5d-0x0;var _0x4780f9=_0x22fb[_0x47fd5d];return _0x4780f9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb22f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb22f('0x1'));var moment=require(_0xb22f('0x2'));var BPromise=require(_0xb22f('0x3'));var Mustache=require(_0xb22f('0x4'));var util=require(_0xb22f('0x5'));var path=require('path');var sox=require(_0xb22f('0x6'));var csv=require(_0xb22f('0x7'));var ejs=require(_0xb22f('0x8'));var fs=require('fs');var fs_extra=require(_0xb22f('0x9'));var _=require(_0xb22f('0xa'));var squel=require(_0xb22f('0xb'));var crypto=require('crypto');var jsforce=require(_0xb22f('0xc'));var deskjs=require(_0xb22f('0xd'));var toCsv=require(_0xb22f('0x7'));var querystring=require(_0xb22f('0xe'));var Papa=require(_0xb22f('0xf'));var Redis=require(_0xb22f('0x10'));var authService=require(_0xb22f('0x11'));var qs=require(_0xb22f('0x12'));var as=require(_0xb22f('0x13'));var hardwareService=require(_0xb22f('0x14'));var logger=require(_0xb22f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb22f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bb02a,_0x5bf0b9){_0x5bf0b9=_0x5bf0b9||0xcc;return function(_0x45e426){if(_0x45e426){return _0x4bb02a[_0xb22f('0x17')](_0x5bf0b9);}return _0x4bb02a[_0xb22f('0x18')](_0x5bf0b9)[_0xb22f('0x19')]();};}function respondWithResult(_0x390c53,_0x32d796){_0x32d796=_0x32d796||0xc8;return function(_0x5c6ccf){if(_0x5c6ccf){return _0x390c53[_0xb22f('0x18')](_0x32d796)['json'](_0x5c6ccf);}};}function respondWithFilteredResult(_0x36e2a8,_0x4f9108){return function(_0x2187fc){if(_0x2187fc){var _0x514a8f=typeof _0x4f9108[_0xb22f('0x1a')]===_0xb22f('0x1b')&&typeof _0x4f9108[_0xb22f('0x1c')]==='undefined';var _0x1530f7=_0x2187fc['count'];var _0x252742=_0x514a8f?0x0:_0x4f9108[_0xb22f('0x1a')];var _0x2aaec4=_0x514a8f?_0x2187fc[_0xb22f('0x1d')]:_0x4f9108[_0xb22f('0x1a')]+_0x4f9108[_0xb22f('0x1c')];var _0x5c843b;if(_0x2aaec4>=_0x1530f7){_0x2aaec4=_0x1530f7;_0x5c843b=0xc8;}else{_0x5c843b=0xce;}_0x36e2a8[_0xb22f('0x18')](_0x5c843b);return _0x36e2a8['set'](_0xb22f('0x1e'),_0x252742+'-'+_0x2aaec4+'/'+_0x1530f7)[_0xb22f('0x1f')](_0x2187fc);}return null;};}function patchUpdates(_0x316f11){return function(_0x2239b8){try{jsonpatch[_0xb22f('0x20')](_0x2239b8,_0x316f11,!![]);}catch(_0x4bbb12){return BPromise['reject'](_0x4bbb12);}return _0x2239b8[_0xb22f('0x21')]();};}function saveUpdates(_0x19e480,_0xf34e0d){return function(_0x16e465){if(_0x16e465){return _0x16e465[_0xb22f('0x22')](_0x19e480)[_0xb22f('0x23')](function(_0x201764){return _0x201764;});}return null;};}function removeEntity(_0x286465,_0x583fbe){return function(_0x482b3a){if(_0x482b3a){return _0x482b3a[_0xb22f('0x24')]()[_0xb22f('0x23')](function(){var _0x5e1b8c=_0x482b3a[_0xb22f('0x25')]({'plain':!![]});var _0x4364f5='Tags';return db[_0xb22f('0x26')][_0xb22f('0x24')]({'where':{'type':_0x4364f5,'resourceId':_0x5e1b8c['id']}})['then'](function(){return _0x482b3a;});})[_0xb22f('0x23')](function(){_0x286465[_0xb22f('0x18')](0xcc)[_0xb22f('0x19')]();});}};}function handleEntityNotFound(_0xec047c,_0x3bf205){return function(_0x246a0c){if(!_0x246a0c){_0xec047c[_0xb22f('0x17')](0x194);}return _0x246a0c;};}function handleError(_0x2ae6d4,_0x4ce9af){_0x4ce9af=_0x4ce9af||0x1f4;return function(_0x483cc3){logger['error'](_0x483cc3[_0xb22f('0x27')]);if(_0x483cc3['name']){delete _0x483cc3[_0xb22f('0x28')];}_0x2ae6d4[_0xb22f('0x18')](_0x4ce9af)[_0xb22f('0x29')](_0x483cc3);};}exports[_0xb22f('0x2a')]=function(_0x3bf636,_0x5b2a42){var _0x519034={},_0x435690={},_0x12c042={'count':0x0,'rows':[]};var _0x319e56=_[_0xb22f('0x2b')](db['Tag'][_0xb22f('0x2c')],function(_0x29ad43){return{'name':_0x29ad43['fieldName'],'type':_0x29ad43[_0xb22f('0x2d')][_0xb22f('0x2e')]};});_0x435690[_0xb22f('0x2f')]=_[_0xb22f('0x2b')](_0x319e56,_0xb22f('0x28'));_0x435690['query']=_['keys'](_0x3bf636[_0xb22f('0x30')]);_0x435690[_0xb22f('0x31')]=_[_0xb22f('0x32')](_0x435690[_0xb22f('0x2f')],_0x435690[_0xb22f('0x30')]);_0x519034[_0xb22f('0x33')]=_[_0xb22f('0x32')](_0x435690[_0xb22f('0x2f')],qs[_0xb22f('0x34')](_0x3bf636['query'][_0xb22f('0x34')]));_0x519034['attributes']=_0x519034['attributes'][_0xb22f('0x35')]?_0x519034[_0xb22f('0x33')]:_0x435690[_0xb22f('0x2f')];if(!_0x3bf636[_0xb22f('0x30')][_0xb22f('0x36')](_0xb22f('0x37'))){_0x519034[_0xb22f('0x1c')]=qs[_0xb22f('0x1c')](_0x3bf636[_0xb22f('0x30')][_0xb22f('0x1c')]);_0x519034[_0xb22f('0x1a')]=qs[_0xb22f('0x1a')](_0x3bf636[_0xb22f('0x30')]['offset']);}_0x519034['order']=qs[_0xb22f('0x38')](_0x3bf636[_0xb22f('0x30')][_0xb22f('0x38')]);_0x519034['where']=qs[_0xb22f('0x31')](_[_0xb22f('0x39')](_0x3bf636['query'],_0x435690['filters']),_0x319e56);if(_0x3bf636[_0xb22f('0x30')]['filter']){_0x519034[_0xb22f('0x3a')]=_['merge'](_0x519034[_0xb22f('0x3a')],{'$or':_[_0xb22f('0x2b')](_0x319e56,function(_0x27e081){if(_0x27e081['type']!==_0xb22f('0x3b')){var _0x2d265c={};_0x2d265c[_0x27e081[_0xb22f('0x28')]]={'$like':'%'+_0x3bf636['query'][_0xb22f('0x3c')]+'%'};return _0x2d265c;}})});}_0x519034=_[_0xb22f('0x3d')]({},_0x519034,_0x3bf636[_0xb22f('0x3e')]);var _0x476ff6={'where':_0x519034[_0xb22f('0x3a')]};return db[_0xb22f('0x3f')][_0xb22f('0x1d')](_0x476ff6)[_0xb22f('0x23')](function(_0xcb55d3){_0x12c042[_0xb22f('0x1d')]=_0xcb55d3;if(_0x3bf636['query'][_0xb22f('0x40')]){_0x519034[_0xb22f('0x41')]=[{'all':!![]}];}return db['Tag'][_0xb22f('0x42')](_0x519034);})['then'](function(_0x58ba40){_0x12c042[_0xb22f('0x43')]=_0x58ba40;return _0x12c042;})[_0xb22f('0x23')](respondWithFilteredResult(_0x5b2a42,_0x519034))[_0xb22f('0x44')](handleError(_0x5b2a42,null));};exports[_0xb22f('0x45')]=function(_0x563740,_0x1475d1){var _0x572a0c={'raw':!![],'where':{'id':_0x563740[_0xb22f('0x46')]['id']}},_0xddfda6={};_0xddfda6[_0xb22f('0x2f')]=_[_0xb22f('0x47')](db[_0xb22f('0x3f')][_0xb22f('0x2c')]);_0xddfda6['query']=_[_0xb22f('0x47')](_0x563740['query']);_0xddfda6[_0xb22f('0x31')]=_[_0xb22f('0x32')](_0xddfda6['model'],_0xddfda6[_0xb22f('0x30')]);_0x572a0c[_0xb22f('0x33')]=_['intersection'](_0xddfda6['model'],qs[_0xb22f('0x34')](_0x563740['query'][_0xb22f('0x34')]));_0x572a0c[_0xb22f('0x33')]=_0x572a0c[_0xb22f('0x33')][_0xb22f('0x35')]?_0x572a0c['attributes']:_0xddfda6[_0xb22f('0x2f')];if(_0x563740[_0xb22f('0x30')]['includeAll']){_0x572a0c[_0xb22f('0x41')]=[{'all':!![]}];}_0x572a0c=_[_0xb22f('0x3d')]({},_0x572a0c,_0x563740[_0xb22f('0x3e')]);return db[_0xb22f('0x3f')][_0xb22f('0x48')](_0x572a0c)['then'](handleEntityNotFound(_0x1475d1,null))[_0xb22f('0x23')](respondWithResult(_0x1475d1,null))['catch'](handleError(_0x1475d1,null));};exports['create']=function(_0x3fb0ac,_0x90eef9){return db[_0xb22f('0x3f')][_0xb22f('0x49')](_0x3fb0ac[_0xb22f('0x4a')],{})['then'](function(_0x275ca5){var _0x504511=_0x3fb0ac[_0xb22f('0x4b')]['get']({'plain':!![]});if(!_0x504511)throw new Error(_0xb22f('0x4c'));if(_0x504511[_0xb22f('0x4d')]===_0xb22f('0x4b')){var _0x58cd19=_0x275ca5[_0xb22f('0x25')]({'plain':!![]});var _0x436425='Tags';return db[_0xb22f('0x4e')][_0xb22f('0x48')]({'where':{'name':_0x436425,'userProfileId':_0x504511['userProfileId']},'raw':!![]})['then'](function(_0x261bc0){if(_0x261bc0&&_0x261bc0[_0xb22f('0x4f')]===0x0){return db['UserProfileResource'][_0xb22f('0x49')]({'name':_0x58cd19[_0xb22f('0x28')],'resourceId':_0x58cd19['id'],'type':_0x261bc0['name'],'sectionId':_0x261bc0['id']},{})['then'](function(){return _0x275ca5;});}else{return _0x275ca5;}})[_0xb22f('0x44')](function(_0x3759ef){logger['error'](_0xb22f('0x50'),_0x3759ef);throw _0x3759ef;});}return _0x275ca5;})[_0xb22f('0x23')](respondWithResult(_0x90eef9,0xc9))[_0xb22f('0x44')](handleError(_0x90eef9,null));};exports[_0xb22f('0x22')]=function(_0x518e28,_0x30039a){if(_0x518e28[_0xb22f('0x4a')]['id']){delete _0x518e28['body']['id'];}return db['Tag'][_0xb22f('0x48')]({'where':{'id':_0x518e28[_0xb22f('0x46')]['id']}})[_0xb22f('0x23')](handleEntityNotFound(_0x30039a,null))[_0xb22f('0x23')](saveUpdates(_0x518e28['body'],null))[_0xb22f('0x23')](respondWithResult(_0x30039a,null))[_0xb22f('0x44')](handleError(_0x30039a,null));};exports['destroy']=function(_0x1e1390,_0x34e0f0){return db[_0xb22f('0x3f')][_0xb22f('0x48')]({'where':{'id':_0x1e1390[_0xb22f('0x46')]['id']}})[_0xb22f('0x23')](handleEntityNotFound(_0x34e0f0,null))[_0xb22f('0x23')](removeEntity(_0x34e0f0,null))['catch'](handleError(_0x34e0f0,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index a7001cf..0c49ee0 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 _0x69af=['bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','define','Tag','tools_tags','lodash','../../config/logger','api','moment'];(function(_0x57961a,_0x5c91dd){var _0x52fccf=function(_0x2ac517){while(--_0x2ac517){_0x57961a['push'](_0x57961a['shift']());}};_0x52fccf(++_0x5c91dd);}(_0x69af,0x182));var _0xf69a=function(_0x46b7ba,_0x153b9a){_0x46b7ba=_0x46b7ba-0x0;var _0x513833=_0x69af[_0x46b7ba];return _0x513833;};'use strict';var _=require(_0xf69a('0x0'));var util=require('util');var logger=require(_0xf69a('0x1'))(_0xf69a('0x2'));var moment=require(_0xf69a('0x3'));var BPromise=require(_0xf69a('0x4'));var rp=require(_0xf69a('0x5'));var fs=require('fs');var path=require(_0xf69a('0x6'));var rimraf=require(_0xf69a('0x7'));var config=require(_0xf69a('0x8'));var attributes=require(_0xf69a('0x9'));module['exports']=function(_0x10e62e,_0x1908e3){return _0x10e62e[_0xf69a('0xa')](_0xf69a('0xb'),attributes,{'tableName':_0xf69a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcca0=['../../config/environment','./tag.attributes','exports','Tag','tools_tags','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x14d250,_0x4b2e12){var _0xb991d8=function(_0x4ea76d){while(--_0x4ea76d){_0x14d250['push'](_0x14d250['shift']());}};_0xb991d8(++_0x4b2e12);}(_0xcca0,0x1d3));var _0x0cca=function(_0x541817,_0x42ce68){_0x541817=_0x541817-0x0;var _0x46a287=_0xcca0[_0x541817];return _0x46a287;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0cca('0x0'))('api');var moment=require(_0x0cca('0x1'));var BPromise=require(_0x0cca('0x2'));var rp=require(_0x0cca('0x3'));var fs=require('fs');var path=require(_0x0cca('0x4'));var rimraf=require(_0x0cca('0x5'));var config=require(_0x0cca('0x6'));var attributes=require(_0x0cca('0x7'));module[_0x0cca('0x8')]=function(_0x229ecc,_0x5a4a6b){return _0x229ecc['define'](_0x0cca('0x9'),attributes,{'tableName':_0x0cca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 87d776c..7b041cc 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 _0x3685=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x5ab5bd,_0x12c446){var _0x3dddd8=function(_0x5ea7d0){while(--_0x5ea7d0){_0x5ab5bd['push'](_0x5ab5bd['shift']());}};_0x3dddd8(++_0x12c446);}(_0x3685,0xf8));var _0x5368=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3685[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5368('0x0'));var util=require('util');var moment=require(_0x5368('0x1'));var BPromise=require(_0x5368('0x2'));var rs=require(_0x5368('0x3'));var fs=require('fs');var Redis=require(_0x5368('0x4'));var db=require(_0x5368('0x5'))['db'];var utils=require(_0x5368('0x6'));var logger=require(_0x5368('0x7'))(_0x5368('0x8'));var config=require(_0x5368('0x9'));var jayson=require(_0x5368('0xa'));var client=jayson['client'][_0x5368('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2529a2,_0x39223d,_0xaf4549){return new BPromise(function(_0x55fb7d,_0x14e621){return client[_0x5368('0xc')](_0x2529a2,_0xaf4549)[_0x5368('0xd')](function(_0x2a6ce8){logger[_0x5368('0xe')](_0x5368('0xf'),_0x39223d,_0x5368('0x10'));logger[_0x5368('0x11')]('Tag,\x20%s,\x20%s,\x20%s',_0x39223d,_0x5368('0x10'),JSON[_0x5368('0x12')](_0x2a6ce8));if(_0x2a6ce8[_0x5368('0x13')]){if(_0x2a6ce8['error'][_0x5368('0x14')]===0x1f4){logger[_0x5368('0x13')]('Tag,\x20%s,\x20%s',_0x39223d,_0x2a6ce8['error']['message']);return _0x14e621(_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);}logger[_0x5368('0x13')](_0x5368('0xf'),_0x39223d,_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);return _0x55fb7d(_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);}else{logger[_0x5368('0xe')](_0x5368('0xf'),_0x39223d,'request\x20sent');_0x55fb7d(_0x2a6ce8[_0x5368('0x16')][_0x5368('0x15')]);}})['catch'](function(_0x19790d){logger[_0x5368('0x13')](_0x5368('0xf'),_0x39223d,_0x19790d);_0x14e621(_0x19790d);});});} \ No newline at end of file +var _0x579c=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2fcb47,_0x516173){var _0x2744ef=function(_0x10cb5b){while(--_0x10cb5b){_0x2fcb47['push'](_0x2fcb47['shift']());}};_0x2744ef(++_0x516173);}(_0x579c,0xda));var _0xc579=function(_0x2d5e13,_0x2f25ef){_0x2d5e13=_0x2d5e13-0x0;var _0x2fab3d=_0x579c[_0x2d5e13];return _0x2fab3d;};'use strict';var _=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var moment=require(_0xc579('0x2'));var BPromise=require(_0xc579('0x3'));var rs=require(_0xc579('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc579('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc579('0x6'))(_0xc579('0x7'));var config=require(_0xc579('0x8'));var jayson=require(_0xc579('0x9'));var client=jayson[_0xc579('0xa')][_0xc579('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e451b,_0x585167,_0x1c6d9c){return new BPromise(function(_0x293c4a,_0x2ce949){return client[_0xc579('0xc')](_0x2e451b,_0x1c6d9c)[_0xc579('0xd')](function(_0x44b151){logger[_0xc579('0xe')](_0xc579('0xf'),_0x585167,'request\x20sent');logger[_0xc579('0x10')](_0xc579('0x11'),_0x585167,_0xc579('0x12'),JSON[_0xc579('0x13')](_0x44b151));if(_0x44b151[_0xc579('0x14')]){if(_0x44b151[_0xc579('0x14')][_0xc579('0x15')]===0x1f4){logger[_0xc579('0x14')](_0xc579('0xf'),_0x585167,_0x44b151[_0xc579('0x14')][_0xc579('0x16')]);return _0x2ce949(_0x44b151['error'][_0xc579('0x16')]);}logger['error'](_0xc579('0xf'),_0x585167,_0x44b151['error'][_0xc579('0x16')]);return _0x293c4a(_0x44b151['error'][_0xc579('0x16')]);}else{logger['info'](_0xc579('0xf'),_0x585167,_0xc579('0x12'));_0x293c4a(_0x44b151['result']['message']);}})[_0xc579('0x17')](function(_0x2abc55){logger[_0xc579('0x14')](_0xc579('0xf'),_0x585167,_0x2abc55);_0x2ce949(_0x2abc55);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 1f8e107..6ace0c0 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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_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('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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 e7a2489..6c8f574 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 _0xe706=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe706,0xa3));var _0x6e70=function(_0xadc7d9,_0x203608){_0xadc7d9=_0xadc7d9-0x0;var _0x915ca1=_0xe706[_0xadc7d9];return _0x915ca1;};'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 _0xb10b=['name','sequelize','STRING'];(function(_0x3d7401,_0x22b179){var _0x3be06e=function(_0x4bb4a4){while(--_0x4bb4a4){_0x3d7401['push'](_0x3d7401['shift']());}};_0x3be06e(++_0x22b179);}(_0xb10b,0x12a));var _0xbb10=function(_0x38edc7,_0x5d0576){_0x38edc7=_0x38edc7-0x0;var _0x3eb41e=_0xb10b[_0x38edc7];return _0x3eb41e;};'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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 48ebf45..66d9228 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 _0x81be=['isArray','Voice','Chat','Mail','Sms','Whatsapp','penalty','defaults','TeamVoiceQueue','User','findOrCreate','emit','QueueId','online','UserVoiceQueueRt','upsert','isNil','interface','SIP/%s','all','UserVoicePrefix','spread','removeAgents','Fax','Openchannel','Queue:remove','TeamVoicePrefix','getAgents','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserProfileResource','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','addAgents'];(function(_0x17b1c0,_0x5f48f5){var _0x5b0ff5=function(_0x404a6c){while(--_0x404a6c){_0x17b1c0['push'](_0x17b1c0['shift']());}};_0x5b0ff5(++_0x5f48f5);}(_0x81be,0x15d));var _0xe81b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x81be[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xe81b('0x0'));var rimraf=require(_0xe81b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe81b('0x2'));var rp=require(_0xe81b('0x3'));var moment=require(_0xe81b('0x4'));var BPromise=require(_0xe81b('0x5'));var Mustache=require(_0xe81b('0x6'));var util=require('util');var path=require(_0xe81b('0x7'));var sox=require(_0xe81b('0x8'));var csv=require(_0xe81b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe81b('0xa'));var _=require(_0xe81b('0xb'));var squel=require(_0xe81b('0xc'));var crypto=require(_0xe81b('0xd'));var jsforce=require(_0xe81b('0xe'));var deskjs=require(_0xe81b('0xf'));var toCsv=require(_0xe81b('0x9'));var querystring=require(_0xe81b('0x10'));var Papa=require(_0xe81b('0x11'));var Redis=require('ioredis');var authService=require(_0xe81b('0x12'));var qs=require(_0xe81b('0x13'));var as=require(_0xe81b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe81b('0x15'))(_0xe81b('0x16'));var utils=require(_0xe81b('0x17'));var config=require(_0xe81b('0x18'));var licenseUtil=require(_0xe81b('0x19'));var db=require(_0xe81b('0x1a'))['db'];config[_0xe81b('0x1b')]=_['defaults'](config[_0xe81b('0x1b')],{'host':_0xe81b('0x1c'),'port':0x18eb});var socket=require(_0xe81b('0x1d'))(new Redis(config[_0xe81b('0x1b')]));require(_0xe81b('0x1e'))[_0xe81b('0x1f')](socket);function respondWithStatusCode(_0x21d9c1,_0x5afdf6){_0x5afdf6=_0x5afdf6||0xcc;return function(_0x1055c9){if(_0x1055c9){return _0x21d9c1[_0xe81b('0x20')](_0x5afdf6);}return _0x21d9c1['status'](_0x5afdf6)[_0xe81b('0x21')]();};}function respondWithResult(_0x8e4863,_0x3a5233){_0x3a5233=_0x3a5233||0xc8;return function(_0x11c024){if(_0x11c024){return _0x8e4863[_0xe81b('0x22')](_0x3a5233)[_0xe81b('0x23')](_0x11c024);}};}function respondWithFilteredResult(_0x9586c7,_0x176ec3){return function(_0x1fa233){if(_0x1fa233){var _0x497fc5=typeof _0x176ec3[_0xe81b('0x24')]===_0xe81b('0x25')&&typeof _0x176ec3[_0xe81b('0x26')]==='undefined';var _0x44e244=_0x1fa233[_0xe81b('0x27')];var _0x30a377=_0x497fc5?0x0:_0x176ec3[_0xe81b('0x24')];var _0x13350b=_0x497fc5?_0x1fa233[_0xe81b('0x27')]:_0x176ec3[_0xe81b('0x24')]+_0x176ec3[_0xe81b('0x26')];var _0x32175d;if(_0x13350b>=_0x44e244){_0x13350b=_0x44e244;_0x32175d=0xc8;}else{_0x32175d=0xce;}_0x9586c7[_0xe81b('0x22')](_0x32175d);return _0x9586c7[_0xe81b('0x28')]('Content-Range',_0x30a377+'-'+_0x13350b+'/'+_0x44e244)[_0xe81b('0x23')](_0x1fa233);}return null;};}function patchUpdates(_0x582e1a){return function(_0x12d139){try{jsonpatch[_0xe81b('0x29')](_0x12d139,_0x582e1a,!![]);}catch(_0x35138c){return BPromise[_0xe81b('0x2a')](_0x35138c);}return _0x12d139[_0xe81b('0x2b')]();};}function saveUpdates(_0x34d83e,_0x4484f2){return function(_0x5c5170){if(_0x5c5170){return _0x5c5170[_0xe81b('0x2c')](_0x34d83e)[_0xe81b('0x2d')](function(_0x3f9e39){return _0x3f9e39;});}return null;};}function handleEntityNotFound(_0x59268a,_0x361cc0){return function(_0x362a68){if(!_0x362a68){_0x59268a[_0xe81b('0x20')](0x194);}return _0x362a68;};}function handleError(_0x30de45,_0x529431){_0x529431=_0x529431||0x1f4;return function(_0x1244de){logger[_0xe81b('0x2e')](_0x1244de[_0xe81b('0x2f')]);if(_0x1244de[_0xe81b('0x30')]){delete _0x1244de[_0xe81b('0x30')];}_0x30de45[_0xe81b('0x22')](_0x529431)[_0xe81b('0x31')](_0x1244de);};}exports[_0xe81b('0x32')]=function(_0xa0c8ec,_0x5cbe88){var _0x2e6efd={},_0x5349a1={},_0x1cf1c2={'count':0x0,'rows':[]};var _0x298f3f=_[_0xe81b('0x33')](db[_0xe81b('0x34')][_0xe81b('0x35')],function(_0xa2667b){return{'name':_0xa2667b[_0xe81b('0x36')],'type':_0xa2667b['type'][_0xe81b('0x37')]};});_0x5349a1[_0xe81b('0x38')]=_[_0xe81b('0x33')](_0x298f3f,_0xe81b('0x30'));_0x5349a1['query']=_[_0xe81b('0x39')](_0xa0c8ec['query']);_0x5349a1[_0xe81b('0x3a')]=_[_0xe81b('0x3b')](_0x5349a1[_0xe81b('0x38')],_0x5349a1[_0xe81b('0x3c')]);_0x2e6efd[_0xe81b('0x3d')]=_[_0xe81b('0x3b')](_0x5349a1[_0xe81b('0x38')],qs[_0xe81b('0x3e')](_0xa0c8ec[_0xe81b('0x3c')][_0xe81b('0x3e')]));_0x2e6efd[_0xe81b('0x3d')]=_0x2e6efd['attributes'][_0xe81b('0x3f')]?_0x2e6efd[_0xe81b('0x3d')]:_0x5349a1[_0xe81b('0x38')];if(!_0xa0c8ec['query']['hasOwnProperty'](_0xe81b('0x40'))){_0x2e6efd[_0xe81b('0x26')]=qs[_0xe81b('0x26')](_0xa0c8ec['query'][_0xe81b('0x26')]);_0x2e6efd[_0xe81b('0x24')]=qs[_0xe81b('0x24')](_0xa0c8ec[_0xe81b('0x3c')][_0xe81b('0x24')]);}_0x2e6efd[_0xe81b('0x41')]=qs[_0xe81b('0x42')](_0xa0c8ec[_0xe81b('0x3c')]['sort']);_0x2e6efd[_0xe81b('0x43')]=qs['filters'](_[_0xe81b('0x44')](_0xa0c8ec[_0xe81b('0x3c')],_0x5349a1[_0xe81b('0x3a')]),_0x298f3f);if(_0xa0c8ec[_0xe81b('0x3c')][_0xe81b('0x45')]){_0x2e6efd[_0xe81b('0x43')]=_[_0xe81b('0x46')](_0x2e6efd[_0xe81b('0x43')],{'$or':_[_0xe81b('0x33')](_0x298f3f,function(_0x4eb5c1){if(_0x4eb5c1[_0xe81b('0x47')]!==_0xe81b('0x48')){var _0x242d2d={};_0x242d2d[_0x4eb5c1['name']]={'$like':'%'+_0xa0c8ec[_0xe81b('0x3c')][_0xe81b('0x45')]+'%'};return _0x242d2d;}})});}_0x2e6efd=_[_0xe81b('0x46')]({},_0x2e6efd,_0xa0c8ec[_0xe81b('0x49')]);var _0x1c856f={'where':_0x2e6efd['where']};return db[_0xe81b('0x34')][_0xe81b('0x27')](_0x1c856f)[_0xe81b('0x2d')](function(_0x4ac6b4){_0x1cf1c2[_0xe81b('0x27')]=_0x4ac6b4;if(_0xa0c8ec['query'][_0xe81b('0x4a')]){_0x2e6efd['include']=[{'all':!![]}];}return db[_0xe81b('0x34')][_0xe81b('0x4b')](_0x2e6efd);})['then'](function(_0xb1366){_0x1cf1c2[_0xe81b('0x4c')]=_0xb1366;return _0x1cf1c2;})['then'](respondWithFilteredResult(_0x5cbe88,_0x2e6efd))['catch'](handleError(_0x5cbe88,null));};exports['show']=function(_0x3ea9ba,_0xce3efa){var _0xf08b09={'raw':![],'where':{'id':_0x3ea9ba[_0xe81b('0x4d')]['id']}},_0x1a86ca={};_0x1a86ca[_0xe81b('0x38')]=_[_0xe81b('0x39')](db[_0xe81b('0x34')]['rawAttributes']);_0x1a86ca['query']=_[_0xe81b('0x39')](_0x3ea9ba[_0xe81b('0x3c')]);_0x1a86ca[_0xe81b('0x3a')]=_['intersection'](_0x1a86ca[_0xe81b('0x38')],_0x1a86ca['query']);_0xf08b09[_0xe81b('0x3d')]=_[_0xe81b('0x3b')](_0x1a86ca[_0xe81b('0x38')],qs[_0xe81b('0x3e')](_0x3ea9ba['query'][_0xe81b('0x3e')]));_0xf08b09['attributes']=_0xf08b09[_0xe81b('0x3d')][_0xe81b('0x3f')]?_0xf08b09[_0xe81b('0x3d')]:_0x1a86ca['model'];if(_0x3ea9ba[_0xe81b('0x3c')][_0xe81b('0x4a')]){_0xf08b09[_0xe81b('0x4e')]=[{'all':!![]}];}_0xf08b09=_[_0xe81b('0x46')]({},_0xf08b09,_0x3ea9ba[_0xe81b('0x49')]);return db['Team'][_0xe81b('0x4f')](_0xf08b09)['then'](handleEntityNotFound(_0xce3efa,null))[_0xe81b('0x2d')](respondWithResult(_0xce3efa,null))[_0xe81b('0x50')](handleError(_0xce3efa,null));};exports[_0xe81b('0x51')]=function(_0x64fd91,_0x48b713){return db[_0xe81b('0x34')]['create'](_0x64fd91[_0xe81b('0x52')],{})[_0xe81b('0x2d')](function(_0x1e2ff9){var _0x64080c=_0x64fd91[_0xe81b('0x53')][_0xe81b('0x54')]({'plain':!![]});if(!_0x64080c)throw new Error(_0xe81b('0x55'));if(_0x64080c[_0xe81b('0x56')]===_0xe81b('0x53')){var _0x2e7f6e=_0x1e2ff9[_0xe81b('0x54')]({'plain':!![]});var _0x44b21d=_0xe81b('0x57');return db[_0xe81b('0x58')]['find']({'where':{'name':_0x44b21d,'userProfileId':_0x64080c[_0xe81b('0x59')]},'raw':!![]})['then'](function(_0x50e46d){if(_0x50e46d&&_0x50e46d['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2e7f6e[_0xe81b('0x30')],'resourceId':_0x2e7f6e['id'],'type':_0x50e46d[_0xe81b('0x30')],'sectionId':_0x50e46d['id']},{})[_0xe81b('0x2d')](function(){return _0x1e2ff9;});}else{return _0x1e2ff9;}})['catch'](function(_0x530dac){logger[_0xe81b('0x2e')](_0xe81b('0x5a'),_0x530dac);throw _0x530dac;});}return _0x1e2ff9;})[_0xe81b('0x2d')](respondWithResult(_0x48b713,0xc9))['catch'](handleError(_0x48b713,null));};exports[_0xe81b('0x2c')]=function(_0x5b1e9d,_0x5c38b0){if(_0x5b1e9d[_0xe81b('0x52')]['id']){delete _0x5b1e9d[_0xe81b('0x52')]['id'];}return db[_0xe81b('0x34')][_0xe81b('0x4f')]({'where':{'id':_0x5b1e9d[_0xe81b('0x4d')]['id']}})[_0xe81b('0x2d')](handleEntityNotFound(_0x5c38b0,null))[_0xe81b('0x2d')](saveUpdates(_0x5b1e9d[_0xe81b('0x52')],null))[_0xe81b('0x2d')](respondWithResult(_0x5c38b0,null))['catch'](handleError(_0x5c38b0,null));};exports['destroy']=function(_0xa2b410,_0x50ce0b){var _0x3354d4=_0xa2b410[_0xe81b('0x4d')]['id'];var _0x57a663=[];return db[_0xe81b('0x5b')][_0xe81b('0x5c')](function(_0x5d1a6a){var _0x3421a3='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x3354d4;return db[_0xe81b('0x5b')]['query'](_0x3421a3,{'type':db['Sequelize'][_0xe81b('0x5d')][_0xe81b('0x5e')],'raw':!![],'transaction':_0x5d1a6a})[_0xe81b('0x2d')](function(_0x1618e0){_0x57a663=_['map'](_0x1618e0,function(_0x12c46d){return Number(_0x12c46d['UserId']);});})['then'](function(){var _0xef338=_0xe81b('0x5f')+_0x3354d4;return db['sequelize']['query'](_0xef338,{'type':db[_0xe81b('0x60')]['QueryTypes'][_0xe81b('0x5e')],'raw':!![],'transaction':_0x5d1a6a});})[_0xe81b('0x2d')](function(_0x5169cc){var _0x567d2a=_[_0xe81b('0x33')](_0x5169cc,function(_0x5ca875){return Number(_0x5ca875[_0xe81b('0x61')]);});return db[_0xe81b('0x62')][_0xe81b('0x63')]({'where':{'UserId':{'$in':_0x57a663},'VoiceQueueId':{'$in':_0x567d2a}},'transaction':_0x5d1a6a});})[_0xe81b('0x2d')](function(){var _0x132992=_0xe81b('0x64')+_0x3354d4;return db[_0xe81b('0x5b')][_0xe81b('0x3c')](_0x132992,{'type':db[_0xe81b('0x60')][_0xe81b('0x5d')]['SELECT'],'raw':!![],'transaction':_0x5d1a6a});})[_0xe81b('0x2d')](function(_0x4b1693){var _0x95a927=_[_0xe81b('0x33')](_0x4b1693,function(_0x16b8ab){return Number(_0x16b8ab[_0xe81b('0x65')]);});return db[_0xe81b('0x66')][_0xe81b('0x63')]({'where':{'UserId':{'$in':_0x57a663},'MailQueueId':{'$in':_0x95a927}},'transaction':_0x5d1a6a});})['then'](function(){var _0x10b05b=_0xe81b('0x67')+_0x3354d4;return db[_0xe81b('0x5b')][_0xe81b('0x3c')](_0x10b05b,{'type':db[_0xe81b('0x60')][_0xe81b('0x5d')][_0xe81b('0x5e')],'raw':!![],'transaction':_0x5d1a6a});})['then'](function(_0x533ab6){var _0xd15898=_[_0xe81b('0x33')](_0x533ab6,function(_0x147313){return Number(_0x147313['SmsQueueId']);});return db[_0xe81b('0x68')][_0xe81b('0x63')]({'where':{'UserId':{'$in':_0x57a663},'SmsQueueId':{'$in':_0xd15898}},'transaction':_0x5d1a6a});})[_0xe81b('0x2d')](function(){var _0x49e513=_0xe81b('0x69')+_0x3354d4;return db[_0xe81b('0x5b')][_0xe81b('0x3c')](_0x49e513,{'type':db['Sequelize'][_0xe81b('0x5d')][_0xe81b('0x5e')],'raw':!![],'transaction':_0x5d1a6a});})[_0xe81b('0x2d')](function(_0x515408){var _0x3ffc1b=_[_0xe81b('0x33')](_0x515408,function(_0x2a8086){return Number(_0x2a8086[_0xe81b('0x6a')]);});return db[_0xe81b('0x6b')][_0xe81b('0x63')]({'where':{'UserId':{'$in':_0x57a663},'ChatQueueId':{'$in':_0x3ffc1b}},'transaction':_0x5d1a6a});})['then'](function(){var _0x44e97f=_0xe81b('0x6c')+_0x3354d4;return db['sequelize'][_0xe81b('0x3c')](_0x44e97f,{'type':db[_0xe81b('0x60')]['QueryTypes'][_0xe81b('0x5e')],'raw':!![],'transaction':_0x5d1a6a});})[_0xe81b('0x2d')](function(_0x35c7db){var _0x1a0c48=_['map'](_0x35c7db,function(_0x4fb2f3){return Number(_0x4fb2f3['FaxQueueId']);});return db[_0xe81b('0x6d')][_0xe81b('0x63')]({'where':{'UserId':{'$in':_0x57a663},'FaxQueueId':{'$in':_0x1a0c48}},'transaction':_0x5d1a6a});})[_0xe81b('0x2d')](function(){var _0x15a0ad=_0xe81b('0x6e')+_0x3354d4;return db[_0xe81b('0x5b')][_0xe81b('0x3c')](_0x15a0ad,{'type':db[_0xe81b('0x60')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x5d1a6a});})[_0xe81b('0x2d')](function(_0x6ea6c8){var _0x5582c6=_[_0xe81b('0x33')](_0x6ea6c8,function(_0x5c45fe){return Number(_0x5c45fe[_0xe81b('0x6f')]);});return db[_0xe81b('0x70')][_0xe81b('0x63')]({'where':{'UserId':{'$in':_0x57a663},'OpenchannelQueueId':{'$in':_0x5582c6}},'transaction':_0x5d1a6a});})[_0xe81b('0x2d')](function(){var _0x324dc9=_0xe81b('0x71')+_0x3354d4;return db['sequelize'][_0xe81b('0x3c')](_0x324dc9,{'type':db['Sequelize'][_0xe81b('0x5d')][_0xe81b('0x5e')],'raw':!![],'transaction':_0x5d1a6a});})[_0xe81b('0x2d')](function(_0x431178){var _0x485073=_[_0xe81b('0x33')](_0x431178,function(_0x26ecb3){return Number(_0x26ecb3[_0xe81b('0x72')]);});return db[_0xe81b('0x73')][_0xe81b('0x63')]({'where':{'UserId':{'$in':_0x57a663},'WhatsappQueueId':{'$in':_0x485073}},'transaction':_0x5d1a6a});})[_0xe81b('0x2d')](function(){return db['TeamVoicePrefix'][_0xe81b('0x4f')]({'where':{'TeamId':_0x3354d4}});})[_0xe81b('0x2d')](function(_0x268c51){if(_0x268c51===null){return;}return db['UserVoicePrefix'][_0xe81b('0x63')]({'where':{'UserId':{'$in':_0x57a663},'VoicePrefixId':_0x268c51['VoicePrefixId']},'transaction':_0x5d1a6a});})[_0xe81b('0x2d')](function(){return db[_0xe81b('0x34')]['destroy']({'where':{'id':_0x3354d4},'cascade':!![],'transaction':_0x5d1a6a});})[_0xe81b('0x2d')](function(_0x31460c){if(_0x31460c===0x0){_0x50ce0b[_0xe81b('0x20')](0x194);}else{return db[_0xe81b('0x74')]['destroy']({'where':{'type':_0xe81b('0x57'),'resourceId':_0x3354d4},'cascade':!![],'transaction':_0x5d1a6a})[_0xe81b('0x2d')](function(){_0x50ce0b['status'](0xcc)[_0xe81b('0x21')]();});}})['catch'](function(_0x59e2a4){_0x50ce0b[_0xe81b('0x22')](0x1f4)[_0xe81b('0x31')](_0x59e2a4);});});};exports[_0xe81b('0x75')]=function(_0x521f60,_0x3d379b,_0x231cb3){return db[_0xe81b('0x34')][_0xe81b('0x76')]({'where':{'id':_0x521f60[_0xe81b('0x4d')]['id']}})[_0xe81b('0x2d')](handleEntityNotFound(_0x3d379b,null))[_0xe81b('0x2d')](function(_0x887899){if(!_0x521f60[_0xe81b('0x3c')][_0xe81b('0x77')]||!utils[_0xe81b('0x78')](_0x521f60['query']['channel'])){throw new db[(_0xe81b('0x60'))][(_0xe81b('0x79'))](_0xe81b('0x7a'));}var _0x4d7901={};var _0x1abeb6={};_0x1abeb6['model']=_[_0xe81b('0x39')](db[_[_0xe81b('0x7b')](_0x521f60[_0xe81b('0x3c')][_0xe81b('0x77')][_0xe81b('0x7c')]())+_0xe81b('0x7d')][_0xe81b('0x35')]);_0x1abeb6[_0xe81b('0x3c')]=_[_0xe81b('0x39')](_0x521f60[_0xe81b('0x3c')]);_0x1abeb6[_0xe81b('0x3a')]=_[_0xe81b('0x3b')](_0x1abeb6['model'],_0x1abeb6['query']);_0x4d7901['attributes']=_[_0xe81b('0x3b')](_0x1abeb6[_0xe81b('0x38')],qs[_0xe81b('0x3e')](_0x521f60[_0xe81b('0x3c')][_0xe81b('0x3e')]));_0x4d7901[_0xe81b('0x3d')]=_0x4d7901['attributes'][_0xe81b('0x3f')]?_0x4d7901[_0xe81b('0x3d')]:_0x1abeb6[_0xe81b('0x38')];_0x4d7901[_0xe81b('0x26')]=qs[_0xe81b('0x26')](_0x521f60[_0xe81b('0x3c')][_0xe81b('0x26')]);_0x4d7901[_0xe81b('0x24')]=qs['offset'](_0x521f60[_0xe81b('0x3c')][_0xe81b('0x24')]);_0x4d7901[_0xe81b('0x41')]=qs['sort'](_0x521f60['query']['sort']);_0x4d7901['where']=qs['filters'](_[_0xe81b('0x44')](_0x521f60[_0xe81b('0x3c')],_0x1abeb6[_0xe81b('0x3a')]));_0x4d7901=_[_0xe81b('0x46')]({},_0x4d7901,_0x521f60[_0xe81b('0x49')]);return _0x887899[_0xe81b('0x54')+_[_0xe81b('0x7b')](_0x521f60[_0xe81b('0x3c')][_0xe81b('0x77')]['toLowerCase']())+_0xe81b('0x7e')](_0x4d7901);})[_0xe81b('0x2d')](respondWithResult(_0x3d379b,null))[_0xe81b('0x50')](handleError(_0x3d379b,null));};exports[_0xe81b('0x7f')]=function(_0x589d30,_0x4982aa,_0x3b52ec){return db[_0xe81b('0x34')]['findOne']({'where':{'id':_0x589d30[_0xe81b('0x4d')]['id']}})[_0xe81b('0x2d')](function(_0x53288f){if(_0x53288f){if(!_0x589d30[_0xe81b('0x52')]['channel']||!utils[_0xe81b('0x78')](_0x589d30[_0xe81b('0x52')][_0xe81b('0x77')])){throw new db[(_0xe81b('0x60'))][(_0xe81b('0x79'))](_0xe81b('0x7a'));}return _0x53288f[_0xe81b('0x80')+_[_0xe81b('0x7b')](_0x589d30[_0xe81b('0x52')]['channel']['toLowerCase']())+_0xe81b('0x7e')](_0x589d30[_0xe81b('0x52')]['ids']);}return null;})[_0xe81b('0x2d')](handleEntityNotFound(_0x4982aa,null))[_0xe81b('0x2d')](respondWithStatusCode(_0x4982aa,null))[_0xe81b('0x50')](handleError(_0x4982aa,null));};exports['removeQueues']=function(_0x59be2e,_0x345a3d,_0x500bdc){return db['Team']['findOne']({'where':{'id':_0x59be2e[_0xe81b('0x4d')]['id']}})['then'](function(_0x59444a){if(_0x59444a){if(!_0x59be2e[_0xe81b('0x3c')][_0xe81b('0x77')]||!utils[_0xe81b('0x78')](_0x59be2e[_0xe81b('0x3c')][_0xe81b('0x77')])){throw new db[(_0xe81b('0x60'))][(_0xe81b('0x79'))](_0xe81b('0x7a'));}return _0x59444a['remove'+_[_0xe81b('0x7b')](_0x59be2e[_0xe81b('0x3c')][_0xe81b('0x77')][_0xe81b('0x7c')]())+_0xe81b('0x7e')](_0x59be2e['query'][_0xe81b('0x81')]);}return null;})[_0xe81b('0x2d')](handleEntityNotFound(_0x345a3d,null))['then'](respondWithStatusCode(_0x345a3d,null))['catch'](handleError(_0x345a3d,null));};exports[_0xe81b('0x82')]=function(_0x43138c,_0x1e0abb){var _0x318c98=_[_0xe81b('0x83')](_0x43138c[_0xe81b('0x52')][_0xe81b('0x81')])?_0x43138c[_0xe81b('0x52')]['ids']:[_0x43138c[_0xe81b('0x52')][_0xe81b('0x81')]];var _0x2a0859=_0x43138c[_0xe81b('0x4d')]['id'];return db[_0xe81b('0x34')][_0xe81b('0x4f')]({'where':{'id':_0x2a0859}})[_0xe81b('0x2d')](handleEntityNotFound(_0x1e0abb,null))[_0xe81b('0x2d')](function(_0x293b04){if(_0x293b04){var _0x1040f5=[_0xe81b('0x84'),_0xe81b('0x85'),_0xe81b('0x86'),_0xe81b('0x87'),'Fax','Openchannel',_0xe81b('0x88')];return db[_0xe81b('0x5b')][_0xe81b('0x5c')](function(_0x41638f){var _0x2595ca=_[_0xe81b('0x33')](_0x1040f5,function(_0xb16d16){var _0xc97cbd={'attributes':['id',_0xe81b('0x30')]};if(_0xb16d16===_0xe81b('0x84')){_0xc97cbd['through']={'attributes':[_0xe81b('0x89')]};}return _0x293b04['get'+_0xb16d16+_0xe81b('0x7e')](_0xc97cbd)[_0xe81b('0x2d')](function(_0x5fb3d5){var _0x168128=_[_0xe81b('0x33')](_0x5fb3d5,function(_0x4b7419){var _0x1f7266=_[_0xe81b('0x33')](_0x318c98,function(_0x4f6d99){var _0x3cd818={'where':{'UserId':_0x4f6d99,[_0xb16d16+'QueueId']:_0x4b7419['id']},'transaction':_0x41638f};if(_0xb16d16===_0xe81b('0x84')){_0x3cd818[_0xe81b('0x8a')]={'penalty':_0x4b7419[_0xe81b('0x8b')][_0xe81b('0x89')]};}return db[_0xe81b('0x8c')+_0xb16d16+_0xe81b('0x7d')][_0xe81b('0x8d')](_0x3cd818)[_0xe81b('0x2d')](function(){socket[_0xe81b('0x8e')]('user'+_0xb16d16+'Queue:save',{'UserId':_0x4f6d99,[_0xb16d16+_0xe81b('0x8f')]:_0x4b7419['id']});if(_0xb16d16!==_0xe81b('0x84')){return;}return db[_0xe81b('0x8c')][_0xe81b('0x4b')]({'where':{'id':_0x318c98,'online':0x1},'attributes':['id','name',_0xe81b('0x90'),'voicePause','interface'],'raw':!![]})['then'](function(_0x3b4cac){var _0x1c7f0c=_[_0xe81b('0x33')](_0x3b4cac,function(_0x5c5784){return db[_0xe81b('0x91')][_0xe81b('0x92')]({'membername':_0x5c5784[_0xe81b('0x30')],'UserId':_0x5c5784['id'],'queue_name':_0x4b7419[_0xe81b('0x30')],'VoiceQueueId':_0x4b7419['id'],'interface':_[_0xe81b('0x93')](_0x5c5784[_0xe81b('0x94')])?util['format'](_0xe81b('0x95'),_0x5c5784[_0xe81b('0x30')]):_0x5c5784[_0xe81b('0x94')],'paused':_0x5c5784['voicePause']||![],'penalty':_0x4b7419[_0xe81b('0x8b')][_0xe81b('0x89')]},{'transaction':_0x41638f});});return Promise[_0xe81b('0x96')](_0x1c7f0c);});});});return Promise[_0xe81b('0x96')](_0x1f7266);});return Promise[_0xe81b('0x96')](_0x168128);})[_0xe81b('0x2d')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x2a0859}})[_0xe81b('0x2d')](function(_0xaf87d6){if(_0xaf87d6){var _0x4b36d4=_[_0xe81b('0x33')](_0x318c98,function(_0x11ba19){db[_0xe81b('0x97')][_0xe81b('0x92')]({'UserId':_0x11ba19,'VoicePrefixId':_0xaf87d6['VoicePrefixId']});});return Promise[_0xe81b('0x96')](_0x4b36d4);}});});});return Promise['all'](_0x2595ca)[_0xe81b('0x2d')](function(){return _0x293b04['addAgents'](_0x318c98,{'transaction':_0x41638f})[_0xe81b('0x98')](function(_0x25ff53){return _0x25ff53;});});});}})[_0xe81b('0x2d')](respondWithResult(_0x1e0abb,null))[_0xe81b('0x50')](handleError(_0x1e0abb,null));};exports[_0xe81b('0x99')]=function(_0x160d7c,_0x16173a){var _0x439d86=_['isArray'](_0x160d7c[_0xe81b('0x3c')][_0xe81b('0x81')])?_0x160d7c[_0xe81b('0x3c')]['ids']:[_0x160d7c[_0xe81b('0x3c')][_0xe81b('0x81')]];var _0x16a259=_0x160d7c[_0xe81b('0x4d')]['id'];return db[_0xe81b('0x34')][_0xe81b('0x4f')]({'where':{'id':_0x16a259}})[_0xe81b('0x2d')](handleEntityNotFound(_0x16173a,null))[_0xe81b('0x2d')](function(_0x47a608){if(_0x47a608){var _0x12fcb1=[_0xe81b('0x84'),_0xe81b('0x85'),_0xe81b('0x86'),'Sms',_0xe81b('0x9a'),_0xe81b('0x9b'),_0xe81b('0x88')];return db['sequelize'][_0xe81b('0x5c')](function(_0x374687){var _0x582b7d=_[_0xe81b('0x33')](_0x12fcb1,function(_0x11d11d){var _0x21a7bd={'attributes':['id',_0xe81b('0x30')]};return _0x47a608[_0xe81b('0x54')+_0x11d11d+_0xe81b('0x7e')](_0x21a7bd)[_0xe81b('0x2d')](function(_0x1d23af){var _0x38718d=_[_0xe81b('0x33')](_0x1d23af,function(_0x5c644a){return _0x5c644a[_0xe81b('0x99')](_0x439d86,{'transaction':_0x374687})[_0xe81b('0x2d')](function(){var _0x19130d=_[_0xe81b('0x33')](_0x439d86,function(_0xe13057){socket[_0xe81b('0x8e')](_0xe81b('0x53')+_0x11d11d+_0xe81b('0x9c'),{'UserId':Number(_0xe13057),[_0x11d11d+'QueueId']:_0x5c644a['id']});if(_0x11d11d!==_0xe81b('0x84')){return;}return db[_0xe81b('0x91')][_0xe81b('0x63')]({'where':{'VoiceQueueId':_0x5c644a['id'],'UserId':_0xe13057},'transaction':_0x374687});});return Promise[_0xe81b('0x96')](_0x19130d);});});return Promise[_0xe81b('0x96')](_0x38718d);});});return Promise[_0xe81b('0x96')](_0x582b7d)[_0xe81b('0x2d')](function(){return _0x47a608[_0xe81b('0x99')](_0x439d86,{'transaction':_0x374687});})[_0xe81b('0x2d')](function(){return db[_0xe81b('0x9d')]['findOne']({'where':{'teamId':_0x16a259}})[_0xe81b('0x2d')](function(_0x26dcaa){if(_0x26dcaa){var _0x4d598b=_[_0xe81b('0x33')](_0x439d86,function(_0x145418){db[_0xe81b('0x97')]['destroy']({'where':{'UserId':_0x145418,'VoicePrefixId':_0x26dcaa['VoicePrefixId']}});});return Promise[_0xe81b('0x96')](_0x4d598b);}});});});}})[_0xe81b('0x2d')](respondWithStatusCode(_0x16173a,null))[_0xe81b('0x50')](handleError(_0x16173a,null));};exports[_0xe81b('0x9e')]=function(_0x5b5d7f,_0x2cf00f,_0x286406){var _0x5dac6e={};var _0x22fc89={};var _0x1d44bd;var _0x29caaa;return db[_0xe81b('0x34')][_0xe81b('0x76')]({'where':{'id':_0x5b5d7f['params']['id']}})[_0xe81b('0x2d')](handleEntityNotFound(_0x2cf00f,null))[_0xe81b('0x2d')](function(_0x4b505a){if(_0x4b505a){_0x1d44bd=_0x4b505a;_0x22fc89[_0xe81b('0x38')]=_['keys'](db['User'][_0xe81b('0x35')]);_0x22fc89[_0xe81b('0x3c')]=_[_0xe81b('0x39')](_0x5b5d7f['query']);_0x22fc89[_0xe81b('0x3a')]=_[_0xe81b('0x3b')](_0x22fc89[_0xe81b('0x38')],_0x22fc89[_0xe81b('0x3c')]);_0x5dac6e[_0xe81b('0x3d')]=_['intersection'](_0x22fc89[_0xe81b('0x38')],qs[_0xe81b('0x3e')](_0x5b5d7f['query'][_0xe81b('0x3e')]));_0x5dac6e[_0xe81b('0x3d')]=_0x5dac6e[_0xe81b('0x3d')]['length']?_0x5dac6e[_0xe81b('0x3d')]:_0x22fc89[_0xe81b('0x38')];_0x5dac6e[_0xe81b('0x41')]=qs[_0xe81b('0x42')](_0x5b5d7f[_0xe81b('0x3c')]['sort']);_0x5dac6e[_0xe81b('0x43')]=qs[_0xe81b('0x3a')](_[_0xe81b('0x44')](_0x5b5d7f[_0xe81b('0x3c')],_0x22fc89[_0xe81b('0x3a')]));if(_0x5b5d7f[_0xe81b('0x3c')]['filter']){_0x5dac6e[_0xe81b('0x43')]=_[_0xe81b('0x46')](_0x5dac6e['where'],{'$or':_[_0xe81b('0x33')](_0x5dac6e['attributes'],function(_0x226b6a){var _0x3bacb7={};_0x3bacb7[_0x226b6a]={'$like':'%'+_0x5b5d7f[_0xe81b('0x3c')][_0xe81b('0x45')]+'%'};return _0x3bacb7;})});}_0x5dac6e=_[_0xe81b('0x46')]({},_0x5dac6e,_0x5b5d7f[_0xe81b('0x49')]);return _0x1d44bd[_0xe81b('0x9e')](_0x5dac6e);}})[_0xe81b('0x2d')](function(_0x501d52){if(_0x501d52){_0x29caaa=_0x501d52[_0xe81b('0x3f')];if(!_0x5b5d7f[_0xe81b('0x3c')][_0xe81b('0x9f')](_0xe81b('0x40'))){_0x5dac6e['limit']=qs[_0xe81b('0x26')](_0x5b5d7f[_0xe81b('0x3c')][_0xe81b('0x26')]);_0x5dac6e[_0xe81b('0x24')]=qs[_0xe81b('0x24')](_0x5b5d7f[_0xe81b('0x3c')][_0xe81b('0x24')]);}return _0x1d44bd[_0xe81b('0x9e')](_0x5dac6e);}})[_0xe81b('0x2d')](function(_0x33e280){if(_0x33e280){return _0x33e280?{'count':_0x29caaa,'rows':_0x33e280}:null;}})[_0xe81b('0x2d')](respondWithResult(_0x2cf00f,null))[_0xe81b('0x50')](handleError(_0x2cf00f,null));}; \ No newline at end of file +var _0xf53c=['removeAgents','Chat','Fax','Queue:remove','pick','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','Team','rows','show','rawAttributes','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','sequelize','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','destroy','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queues','addQueues','findOne','add','ids','removeQueues','remove','addAgents','isArray','Voice','Mail','Sms','Openchannel','Whatsapp','transaction','penalty','TeamVoiceQueue','Queue','findOrCreate','emit','QueueId','User','findAll','voicePause','interface','UserVoiceQueueRt','upsert','format','all','spread'];(function(_0x246dc4,_0x39c9a0){var _0x414e9f=function(_0x1919dc){while(--_0x1919dc){_0x246dc4['push'](_0x246dc4['shift']());}};_0x414e9f(++_0x39c9a0);}(_0xf53c,0x140));var _0xcf53=function(_0x6e0a4f,_0x17d3e1){_0x6e0a4f=_0x6e0a4f-0x0;var _0x3f2ddd=_0xf53c[_0x6e0a4f];return _0x3f2ddd;};'use strict';var emlformat=require(_0xcf53('0x0'));var rimraf=require(_0xcf53('0x1'));var zipdir=require(_0xcf53('0x2'));var jsonpatch=require(_0xcf53('0x3'));var rp=require(_0xcf53('0x4'));var moment=require(_0xcf53('0x5'));var BPromise=require(_0xcf53('0x6'));var Mustache=require('mustache');var util=require(_0xcf53('0x7'));var path=require(_0xcf53('0x8'));var sox=require('sox');var csv=require(_0xcf53('0x9'));var ejs=require(_0xcf53('0xa'));var fs=require('fs');var fs_extra=require(_0xcf53('0xb'));var _=require(_0xcf53('0xc'));var squel=require(_0xcf53('0xd'));var crypto=require(_0xcf53('0xe'));var jsforce=require(_0xcf53('0xf'));var deskjs=require(_0xcf53('0x10'));var toCsv=require(_0xcf53('0x9'));var querystring=require('querystring');var Papa=require(_0xcf53('0x11'));var Redis=require('ioredis');var authService=require(_0xcf53('0x12'));var qs=require(_0xcf53('0x13'));var as=require(_0xcf53('0x14'));var hardwareService=require(_0xcf53('0x15'));var logger=require(_0xcf53('0x16'))(_0xcf53('0x17'));var utils=require(_0xcf53('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xcf53('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xcf53('0x1a')](config[_0xcf53('0x1b')],{'host':_0xcf53('0x1c'),'port':0x18eb});var socket=require(_0xcf53('0x1d'))(new Redis(config[_0xcf53('0x1b')]));require(_0xcf53('0x1e'))[_0xcf53('0x1f')](socket);function respondWithStatusCode(_0x542432,_0x5ed2b5){_0x5ed2b5=_0x5ed2b5||0xcc;return function(_0x360295){if(_0x360295){return _0x542432[_0xcf53('0x20')](_0x5ed2b5);}return _0x542432[_0xcf53('0x21')](_0x5ed2b5)[_0xcf53('0x22')]();};}function respondWithResult(_0x2158b6,_0x4d02ff){_0x4d02ff=_0x4d02ff||0xc8;return function(_0x4d76a5){if(_0x4d76a5){return _0x2158b6[_0xcf53('0x21')](_0x4d02ff)[_0xcf53('0x23')](_0x4d76a5);}};}function respondWithFilteredResult(_0x17cbb8,_0x296e9d){return function(_0x74c890){if(_0x74c890){var _0x3effec=typeof _0x296e9d[_0xcf53('0x24')]===_0xcf53('0x25')&&typeof _0x296e9d[_0xcf53('0x26')]===_0xcf53('0x25');var _0x149485=_0x74c890['count'];var _0x1a4f75=_0x3effec?0x0:_0x296e9d[_0xcf53('0x24')];var _0x521935=_0x3effec?_0x74c890[_0xcf53('0x27')]:_0x296e9d[_0xcf53('0x24')]+_0x296e9d[_0xcf53('0x26')];var _0x37b15f;if(_0x521935>=_0x149485){_0x521935=_0x149485;_0x37b15f=0xc8;}else{_0x37b15f=0xce;}_0x17cbb8[_0xcf53('0x21')](_0x37b15f);return _0x17cbb8[_0xcf53('0x28')](_0xcf53('0x29'),_0x1a4f75+'-'+_0x521935+'/'+_0x149485)[_0xcf53('0x23')](_0x74c890);}return null;};}function patchUpdates(_0x3d16f1){return function(_0x51501e){try{jsonpatch['apply'](_0x51501e,_0x3d16f1,!![]);}catch(_0x56c203){return BPromise[_0xcf53('0x2a')](_0x56c203);}return _0x51501e[_0xcf53('0x2b')]();};}function saveUpdates(_0x1a7b1b,_0x4419db){return function(_0x1e4c3d){if(_0x1e4c3d){return _0x1e4c3d[_0xcf53('0x2c')](_0x1a7b1b)[_0xcf53('0x2d')](function(_0x58bbf1){return _0x58bbf1;});}return null;};}function handleEntityNotFound(_0x3b6094,_0x1c3ca8){return function(_0x2d0603){if(!_0x2d0603){_0x3b6094[_0xcf53('0x20')](0x194);}return _0x2d0603;};}function handleError(_0x2b7938,_0x278ed9){_0x278ed9=_0x278ed9||0x1f4;return function(_0xd1495a){logger['error'](_0xd1495a[_0xcf53('0x2e')]);if(_0xd1495a['name']){delete _0xd1495a[_0xcf53('0x2f')];}_0x2b7938[_0xcf53('0x21')](_0x278ed9)[_0xcf53('0x30')](_0xd1495a);};}exports['index']=function(_0x18065d,_0x5c8995){var _0x4a8e98={},_0x23d106={},_0x18573f={'count':0x0,'rows':[]};var _0x2e9fc1=_[_0xcf53('0x31')](db['Team']['rawAttributes'],function(_0x54db02){return{'name':_0x54db02[_0xcf53('0x32')],'type':_0x54db02[_0xcf53('0x33')][_0xcf53('0x34')]};});_0x23d106[_0xcf53('0x35')]=_[_0xcf53('0x31')](_0x2e9fc1,_0xcf53('0x2f'));_0x23d106[_0xcf53('0x36')]=_[_0xcf53('0x37')](_0x18065d[_0xcf53('0x36')]);_0x23d106[_0xcf53('0x38')]=_[_0xcf53('0x39')](_0x23d106[_0xcf53('0x35')],_0x23d106[_0xcf53('0x36')]);_0x4a8e98[_0xcf53('0x3a')]=_[_0xcf53('0x39')](_0x23d106['model'],qs['fields'](_0x18065d[_0xcf53('0x36')][_0xcf53('0x3b')]));_0x4a8e98['attributes']=_0x4a8e98[_0xcf53('0x3a')][_0xcf53('0x3c')]?_0x4a8e98[_0xcf53('0x3a')]:_0x23d106['model'];if(!_0x18065d[_0xcf53('0x36')][_0xcf53('0x3d')](_0xcf53('0x3e'))){_0x4a8e98[_0xcf53('0x26')]=qs[_0xcf53('0x26')](_0x18065d[_0xcf53('0x36')][_0xcf53('0x26')]);_0x4a8e98['offset']=qs['offset'](_0x18065d[_0xcf53('0x36')][_0xcf53('0x24')]);}_0x4a8e98[_0xcf53('0x3f')]=qs[_0xcf53('0x40')](_0x18065d[_0xcf53('0x36')]['sort']);_0x4a8e98['where']=qs['filters'](_['pick'](_0x18065d[_0xcf53('0x36')],_0x23d106['filters']),_0x2e9fc1);if(_0x18065d[_0xcf53('0x36')][_0xcf53('0x41')]){_0x4a8e98[_0xcf53('0x42')]=_[_0xcf53('0x43')](_0x4a8e98[_0xcf53('0x42')],{'$or':_[_0xcf53('0x31')](_0x2e9fc1,function(_0x4f1d03){if(_0x4f1d03[_0xcf53('0x33')]!=='VIRTUAL'){var _0x20b396={};_0x20b396[_0x4f1d03[_0xcf53('0x2f')]]={'$like':'%'+_0x18065d[_0xcf53('0x36')][_0xcf53('0x41')]+'%'};return _0x20b396;}})});}_0x4a8e98=_[_0xcf53('0x43')]({},_0x4a8e98,_0x18065d[_0xcf53('0x44')]);var _0x5e0bc4={'where':_0x4a8e98['where']};return db['Team']['count'](_0x5e0bc4)[_0xcf53('0x2d')](function(_0x32901b){_0x18573f[_0xcf53('0x27')]=_0x32901b;if(_0x18065d[_0xcf53('0x36')][_0xcf53('0x45')]){_0x4a8e98[_0xcf53('0x46')]=[{'all':!![]}];}return db[_0xcf53('0x47')]['findAll'](_0x4a8e98);})[_0xcf53('0x2d')](function(_0x49d36f){_0x18573f[_0xcf53('0x48')]=_0x49d36f;return _0x18573f;})['then'](respondWithFilteredResult(_0x5c8995,_0x4a8e98))['catch'](handleError(_0x5c8995,null));};exports[_0xcf53('0x49')]=function(_0x357c4a,_0x121828){var _0x1394cf={'raw':![],'where':{'id':_0x357c4a['params']['id']}},_0x3e5fbd={};_0x3e5fbd[_0xcf53('0x35')]=_['keys'](db[_0xcf53('0x47')][_0xcf53('0x4a')]);_0x3e5fbd['query']=_[_0xcf53('0x37')](_0x357c4a['query']);_0x3e5fbd[_0xcf53('0x38')]=_[_0xcf53('0x39')](_0x3e5fbd[_0xcf53('0x35')],_0x3e5fbd['query']);_0x1394cf[_0xcf53('0x3a')]=_[_0xcf53('0x39')](_0x3e5fbd['model'],qs['fields'](_0x357c4a[_0xcf53('0x36')][_0xcf53('0x3b')]));_0x1394cf[_0xcf53('0x3a')]=_0x1394cf[_0xcf53('0x3a')][_0xcf53('0x3c')]?_0x1394cf[_0xcf53('0x3a')]:_0x3e5fbd['model'];if(_0x357c4a[_0xcf53('0x36')][_0xcf53('0x45')]){_0x1394cf[_0xcf53('0x46')]=[{'all':!![]}];}_0x1394cf=_[_0xcf53('0x43')]({},_0x1394cf,_0x357c4a[_0xcf53('0x44')]);return db['Team']['find'](_0x1394cf)[_0xcf53('0x2d')](handleEntityNotFound(_0x121828,null))[_0xcf53('0x2d')](respondWithResult(_0x121828,null))[_0xcf53('0x4b')](handleError(_0x121828,null));};exports[_0xcf53('0x4c')]=function(_0x19b7c8,_0x15920d){return db[_0xcf53('0x47')][_0xcf53('0x4c')](_0x19b7c8['body'],{})[_0xcf53('0x2d')](function(_0x495a50){var _0x1a79ed=_0x19b7c8[_0xcf53('0x4d')][_0xcf53('0x4e')]({'plain':!![]});if(!_0x1a79ed)throw new Error(_0xcf53('0x4f'));if(_0x1a79ed[_0xcf53('0x50')]===_0xcf53('0x4d')){var _0x2b0406=_0x495a50[_0xcf53('0x4e')]({'plain':!![]});var _0x2c249c=_0xcf53('0x51');return db['UserProfileSection'][_0xcf53('0x52')]({'where':{'name':_0x2c249c,'userProfileId':_0x1a79ed[_0xcf53('0x53')]},'raw':!![]})[_0xcf53('0x2d')](function(_0x53cc8c){if(_0x53cc8c&&_0x53cc8c[_0xcf53('0x54')]===0x0){return db['UserProfileResource'][_0xcf53('0x4c')]({'name':_0x2b0406[_0xcf53('0x2f')],'resourceId':_0x2b0406['id'],'type':_0x53cc8c['name'],'sectionId':_0x53cc8c['id']},{})[_0xcf53('0x2d')](function(){return _0x495a50;});}else{return _0x495a50;}})['catch'](function(_0x3502bd){logger[_0xcf53('0x55')](_0xcf53('0x56'),_0x3502bd);throw _0x3502bd;});}return _0x495a50;})['then'](respondWithResult(_0x15920d,0xc9))[_0xcf53('0x4b')](handleError(_0x15920d,null));};exports[_0xcf53('0x2c')]=function(_0x4fc3f5,_0x3b41af){if(_0x4fc3f5['body']['id']){delete _0x4fc3f5['body']['id'];}return db[_0xcf53('0x47')][_0xcf53('0x52')]({'where':{'id':_0x4fc3f5[_0xcf53('0x57')]['id']}})[_0xcf53('0x2d')](handleEntityNotFound(_0x3b41af,null))[_0xcf53('0x2d')](saveUpdates(_0x4fc3f5[_0xcf53('0x58')],null))[_0xcf53('0x2d')](respondWithResult(_0x3b41af,null))[_0xcf53('0x4b')](handleError(_0x3b41af,null));};exports['destroy']=function(_0x4ac0ea,_0x23b0c7){var _0x51b059=_0x4ac0ea[_0xcf53('0x57')]['id'];var _0x2ff9b2=[];return db['sequelize']['transaction'](function(_0x500dff){var _0x1cbf4d='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x51b059;return db[_0xcf53('0x59')][_0xcf53('0x36')](_0x1cbf4d,{'type':db[_0xcf53('0x5a')]['QueryTypes'][_0xcf53('0x5b')],'raw':!![],'transaction':_0x500dff})[_0xcf53('0x2d')](function(_0x220651){_0x2ff9b2=_['map'](_0x220651,function(_0x1cc919){return Number(_0x1cc919[_0xcf53('0x5c')]);});})[_0xcf53('0x2d')](function(){var _0x1704df=_0xcf53('0x5d')+_0x51b059;return db[_0xcf53('0x59')]['query'](_0x1704df,{'type':db[_0xcf53('0x5a')][_0xcf53('0x5e')]['SELECT'],'raw':!![],'transaction':_0x500dff});})[_0xcf53('0x2d')](function(_0x32bd66){var _0x34d4ee=_[_0xcf53('0x31')](_0x32bd66,function(_0x16978b){return Number(_0x16978b[_0xcf53('0x5f')]);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x2ff9b2},'VoiceQueueId':{'$in':_0x34d4ee}},'transaction':_0x500dff});})[_0xcf53('0x2d')](function(){var _0x24defa=_0xcf53('0x60')+_0x51b059;return db[_0xcf53('0x59')][_0xcf53('0x36')](_0x24defa,{'type':db[_0xcf53('0x5a')][_0xcf53('0x5e')][_0xcf53('0x5b')],'raw':!![],'transaction':_0x500dff});})[_0xcf53('0x2d')](function(_0x579f04){var _0x166d24=_[_0xcf53('0x31')](_0x579f04,function(_0x25bd98){return Number(_0x25bd98[_0xcf53('0x61')]);});return db['UserMailQueue'][_0xcf53('0x62')]({'where':{'UserId':{'$in':_0x2ff9b2},'MailQueueId':{'$in':_0x166d24}},'transaction':_0x500dff});})[_0xcf53('0x2d')](function(){var _0x5feb93=_0xcf53('0x63')+_0x51b059;return db[_0xcf53('0x59')][_0xcf53('0x36')](_0x5feb93,{'type':db['Sequelize'][_0xcf53('0x5e')]['SELECT'],'raw':!![],'transaction':_0x500dff});})[_0xcf53('0x2d')](function(_0x49e9d4){var _0x2af91a=_['map'](_0x49e9d4,function(_0x228c3f){return Number(_0x228c3f[_0xcf53('0x64')]);});return db[_0xcf53('0x65')][_0xcf53('0x62')]({'where':{'UserId':{'$in':_0x2ff9b2},'SmsQueueId':{'$in':_0x2af91a}},'transaction':_0x500dff});})[_0xcf53('0x2d')](function(){var _0xe12108=_0xcf53('0x66')+_0x51b059;return db['sequelize']['query'](_0xe12108,{'type':db[_0xcf53('0x5a')][_0xcf53('0x5e')][_0xcf53('0x5b')],'raw':!![],'transaction':_0x500dff});})[_0xcf53('0x2d')](function(_0x363d9c){var _0x44adc4=_[_0xcf53('0x31')](_0x363d9c,function(_0xb74190){return Number(_0xb74190[_0xcf53('0x67')]);});return db['UserChatQueue'][_0xcf53('0x62')]({'where':{'UserId':{'$in':_0x2ff9b2},'ChatQueueId':{'$in':_0x44adc4}},'transaction':_0x500dff});})[_0xcf53('0x2d')](function(){var _0x19712a=_0xcf53('0x68')+_0x51b059;return db[_0xcf53('0x59')][_0xcf53('0x36')](_0x19712a,{'type':db[_0xcf53('0x5a')][_0xcf53('0x5e')][_0xcf53('0x5b')],'raw':!![],'transaction':_0x500dff});})[_0xcf53('0x2d')](function(_0x2b4e6e){var _0x2f79ba=_[_0xcf53('0x31')](_0x2b4e6e,function(_0x37fa16){return Number(_0x37fa16['FaxQueueId']);});return db[_0xcf53('0x69')]['destroy']({'where':{'UserId':{'$in':_0x2ff9b2},'FaxQueueId':{'$in':_0x2f79ba}},'transaction':_0x500dff});})[_0xcf53('0x2d')](function(){var _0x26834f=_0xcf53('0x6a')+_0x51b059;return db['sequelize'][_0xcf53('0x36')](_0x26834f,{'type':db[_0xcf53('0x5a')][_0xcf53('0x5e')][_0xcf53('0x5b')],'raw':!![],'transaction':_0x500dff});})[_0xcf53('0x2d')](function(_0x2c3945){var _0x491e58=_[_0xcf53('0x31')](_0x2c3945,function(_0x4ec65d){return Number(_0x4ec65d[_0xcf53('0x6b')]);});return db[_0xcf53('0x6c')]['destroy']({'where':{'UserId':{'$in':_0x2ff9b2},'OpenchannelQueueId':{'$in':_0x491e58}},'transaction':_0x500dff});})['then'](function(){var _0x3e74fd=_0xcf53('0x6d')+_0x51b059;return db[_0xcf53('0x59')][_0xcf53('0x36')](_0x3e74fd,{'type':db[_0xcf53('0x5a')]['QueryTypes'][_0xcf53('0x5b')],'raw':!![],'transaction':_0x500dff});})[_0xcf53('0x2d')](function(_0x5043ed){var _0x57cea9=_['map'](_0x5043ed,function(_0x45f69b){return Number(_0x45f69b[_0xcf53('0x6e')]);});return db['UserWhatsappQueue'][_0xcf53('0x62')]({'where':{'UserId':{'$in':_0x2ff9b2},'WhatsappQueueId':{'$in':_0x57cea9}},'transaction':_0x500dff});})[_0xcf53('0x2d')](function(){return db[_0xcf53('0x6f')]['find']({'where':{'TeamId':_0x51b059}});})['then'](function(_0x44f63b){if(_0x44f63b===null){return;}return db[_0xcf53('0x70')]['destroy']({'where':{'UserId':{'$in':_0x2ff9b2},'VoicePrefixId':_0x44f63b[_0xcf53('0x71')]},'transaction':_0x500dff});})['then'](function(){return db[_0xcf53('0x47')][_0xcf53('0x62')]({'where':{'id':_0x51b059},'cascade':!![],'transaction':_0x500dff});})[_0xcf53('0x2d')](function(_0x124374){if(_0x124374===0x0){_0x23b0c7[_0xcf53('0x20')](0x194);}else{return db['UserProfileResource'][_0xcf53('0x62')]({'where':{'type':'Teams','resourceId':_0x51b059},'cascade':!![],'transaction':_0x500dff})['then'](function(){_0x23b0c7[_0xcf53('0x21')](0xcc)['end']();});}})[_0xcf53('0x4b')](function(_0x3349c9){_0x23b0c7[_0xcf53('0x21')](0x1f4)[_0xcf53('0x30')](_0x3349c9);});});};exports[_0xcf53('0x72')]=function(_0x114bed,_0x8fb59a,_0x2bf002){return db[_0xcf53('0x47')]['findOne']({'where':{'id':_0x114bed[_0xcf53('0x57')]['id']}})[_0xcf53('0x2d')](handleEntityNotFound(_0x8fb59a,null))[_0xcf53('0x2d')](function(_0x3547d2){if(!_0x114bed[_0xcf53('0x36')][_0xcf53('0x73')]||!utils[_0xcf53('0x74')](_0x114bed[_0xcf53('0x36')][_0xcf53('0x73')])){throw new db[(_0xcf53('0x5a'))][(_0xcf53('0x75'))](_0xcf53('0x76'));}var _0x1879f0={};var _0x560d53={};_0x560d53[_0xcf53('0x35')]=_[_0xcf53('0x37')](db[_[_0xcf53('0x77')](_0x114bed[_0xcf53('0x36')]['channel'][_0xcf53('0x78')]())+'Queue'][_0xcf53('0x4a')]);_0x560d53[_0xcf53('0x36')]=_['keys'](_0x114bed[_0xcf53('0x36')]);_0x560d53[_0xcf53('0x38')]=_[_0xcf53('0x39')](_0x560d53[_0xcf53('0x35')],_0x560d53[_0xcf53('0x36')]);_0x1879f0[_0xcf53('0x3a')]=_[_0xcf53('0x39')](_0x560d53[_0xcf53('0x35')],qs[_0xcf53('0x3b')](_0x114bed[_0xcf53('0x36')][_0xcf53('0x3b')]));_0x1879f0[_0xcf53('0x3a')]=_0x1879f0[_0xcf53('0x3a')][_0xcf53('0x3c')]?_0x1879f0['attributes']:_0x560d53[_0xcf53('0x35')];_0x1879f0[_0xcf53('0x26')]=qs[_0xcf53('0x26')](_0x114bed[_0xcf53('0x36')]['limit']);_0x1879f0[_0xcf53('0x24')]=qs[_0xcf53('0x24')](_0x114bed['query'][_0xcf53('0x24')]);_0x1879f0[_0xcf53('0x3f')]=qs[_0xcf53('0x40')](_0x114bed[_0xcf53('0x36')][_0xcf53('0x40')]);_0x1879f0['where']=qs[_0xcf53('0x38')](_['pick'](_0x114bed[_0xcf53('0x36')],_0x560d53['filters']));_0x1879f0=_[_0xcf53('0x43')]({},_0x1879f0,_0x114bed[_0xcf53('0x44')]);return _0x3547d2[_0xcf53('0x4e')+_[_0xcf53('0x77')](_0x114bed['query'][_0xcf53('0x73')][_0xcf53('0x78')]())+_0xcf53('0x79')](_0x1879f0);})[_0xcf53('0x2d')](respondWithResult(_0x8fb59a,null))[_0xcf53('0x4b')](handleError(_0x8fb59a,null));};exports[_0xcf53('0x7a')]=function(_0x58308f,_0x7ceac0,_0x4bc967){return db[_0xcf53('0x47')][_0xcf53('0x7b')]({'where':{'id':_0x58308f['params']['id']}})['then'](function(_0x317987){if(_0x317987){if(!_0x58308f[_0xcf53('0x58')][_0xcf53('0x73')]||!utils[_0xcf53('0x74')](_0x58308f[_0xcf53('0x58')][_0xcf53('0x73')])){throw new db[(_0xcf53('0x5a'))][(_0xcf53('0x75'))](_0xcf53('0x76'));}return _0x317987[_0xcf53('0x7c')+_[_0xcf53('0x77')](_0x58308f[_0xcf53('0x58')][_0xcf53('0x73')][_0xcf53('0x78')]())+_0xcf53('0x79')](_0x58308f['body'][_0xcf53('0x7d')]);}return null;})[_0xcf53('0x2d')](handleEntityNotFound(_0x7ceac0,null))[_0xcf53('0x2d')](respondWithStatusCode(_0x7ceac0,null))[_0xcf53('0x4b')](handleError(_0x7ceac0,null));};exports[_0xcf53('0x7e')]=function(_0x72fc8c,_0x1033e1,_0x1cc5a5){return db[_0xcf53('0x47')][_0xcf53('0x7b')]({'where':{'id':_0x72fc8c[_0xcf53('0x57')]['id']}})[_0xcf53('0x2d')](function(_0x1696c0){if(_0x1696c0){if(!_0x72fc8c[_0xcf53('0x36')][_0xcf53('0x73')]||!utils[_0xcf53('0x74')](_0x72fc8c[_0xcf53('0x36')]['channel'])){throw new db[(_0xcf53('0x5a'))]['ValidationError'](_0xcf53('0x76'));}return _0x1696c0[_0xcf53('0x7f')+_['capitalize'](_0x72fc8c[_0xcf53('0x36')][_0xcf53('0x73')][_0xcf53('0x78')]())+'Queues'](_0x72fc8c[_0xcf53('0x36')]['ids']);}return null;})['then'](handleEntityNotFound(_0x1033e1,null))['then'](respondWithStatusCode(_0x1033e1,null))[_0xcf53('0x4b')](handleError(_0x1033e1,null));};exports[_0xcf53('0x80')]=function(_0x43f749,_0x52f243){var _0x28cd7b=_[_0xcf53('0x81')](_0x43f749['body'][_0xcf53('0x7d')])?_0x43f749['body']['ids']:[_0x43f749['body']['ids']];var _0x51ae88=_0x43f749['params']['id'];return db[_0xcf53('0x47')][_0xcf53('0x52')]({'where':{'id':_0x51ae88}})[_0xcf53('0x2d')](handleEntityNotFound(_0x52f243,null))[_0xcf53('0x2d')](function(_0x42ccbe){if(_0x42ccbe){var _0x21065d=[_0xcf53('0x82'),'Chat',_0xcf53('0x83'),_0xcf53('0x84'),'Fax',_0xcf53('0x85'),_0xcf53('0x86')];return db['sequelize'][_0xcf53('0x87')](function(_0x2eb206){var _0x4bcba5=_[_0xcf53('0x31')](_0x21065d,function(_0x143a73){var _0x3aed0e={'attributes':['id',_0xcf53('0x2f')]};if(_0x143a73===_0xcf53('0x82')){_0x3aed0e['through']={'attributes':[_0xcf53('0x88')]};}return _0x42ccbe[_0xcf53('0x4e')+_0x143a73+'Queues'](_0x3aed0e)['then'](function(_0x49089b){var _0x15b0ab=_[_0xcf53('0x31')](_0x49089b,function(_0x58c65e){var _0x1f6259=_['map'](_0x28cd7b,function(_0x467ff9){var _0xf26981={'where':{'UserId':_0x467ff9,[_0x143a73+'QueueId']:_0x58c65e['id']},'transaction':_0x2eb206};if(_0x143a73===_0xcf53('0x82')){_0xf26981['defaults']={'penalty':_0x58c65e[_0xcf53('0x89')][_0xcf53('0x88')]};}return db['User'+_0x143a73+_0xcf53('0x8a')][_0xcf53('0x8b')](_0xf26981)['then'](function(){socket[_0xcf53('0x8c')](_0xcf53('0x4d')+_0x143a73+'Queue:save',{'UserId':_0x467ff9,[_0x143a73+_0xcf53('0x8d')]:_0x58c65e['id']});if(_0x143a73!==_0xcf53('0x82')){return;}return db[_0xcf53('0x8e')][_0xcf53('0x8f')]({'where':{'id':_0x28cd7b,'online':0x1},'attributes':['id','name','online',_0xcf53('0x90'),_0xcf53('0x91')],'raw':!![]})[_0xcf53('0x2d')](function(_0x1f2376){var _0x4ea22c=_['map'](_0x1f2376,function(_0x478200){return db[_0xcf53('0x92')][_0xcf53('0x93')]({'membername':_0x478200['name'],'UserId':_0x478200['id'],'queue_name':_0x58c65e['name'],'VoiceQueueId':_0x58c65e['id'],'interface':_['isNil'](_0x478200[_0xcf53('0x91')])?util[_0xcf53('0x94')]('SIP/%s',_0x478200[_0xcf53('0x2f')]):_0x478200[_0xcf53('0x91')],'paused':_0x478200[_0xcf53('0x90')]||![],'penalty':_0x58c65e[_0xcf53('0x89')][_0xcf53('0x88')]},{'transaction':_0x2eb206});});return Promise[_0xcf53('0x95')](_0x4ea22c);});});});return Promise[_0xcf53('0x95')](_0x1f6259);});return Promise[_0xcf53('0x95')](_0x15b0ab);})[_0xcf53('0x2d')](function(){return db[_0xcf53('0x6f')][_0xcf53('0x7b')]({'where':{'teamId':_0x51ae88}})[_0xcf53('0x2d')](function(_0x502968){if(_0x502968){var _0xdbf54e=_[_0xcf53('0x31')](_0x28cd7b,function(_0x263bd9){db[_0xcf53('0x70')]['upsert']({'UserId':_0x263bd9,'VoicePrefixId':_0x502968[_0xcf53('0x71')]});});return Promise[_0xcf53('0x95')](_0xdbf54e);}});});});return Promise[_0xcf53('0x95')](_0x4bcba5)['then'](function(){return _0x42ccbe[_0xcf53('0x80')](_0x28cd7b,{'transaction':_0x2eb206})[_0xcf53('0x96')](function(_0x2543dc){return _0x2543dc;});});});}})[_0xcf53('0x2d')](respondWithResult(_0x52f243,null))[_0xcf53('0x4b')](handleError(_0x52f243,null));};exports[_0xcf53('0x97')]=function(_0x322912,_0x2290fc){var _0x53cb64=_[_0xcf53('0x81')](_0x322912[_0xcf53('0x36')][_0xcf53('0x7d')])?_0x322912['query'][_0xcf53('0x7d')]:[_0x322912[_0xcf53('0x36')]['ids']];var _0x4cfa29=_0x322912['params']['id'];return db[_0xcf53('0x47')]['find']({'where':{'id':_0x4cfa29}})[_0xcf53('0x2d')](handleEntityNotFound(_0x2290fc,null))[_0xcf53('0x2d')](function(_0x1f4b50){if(_0x1f4b50){var _0x155c04=['Voice',_0xcf53('0x98'),'Mail','Sms',_0xcf53('0x99'),_0xcf53('0x85'),_0xcf53('0x86')];return db[_0xcf53('0x59')]['transaction'](function(_0x566885){var _0x5abe93=_[_0xcf53('0x31')](_0x155c04,function(_0x426852){var _0x345884={'attributes':['id','name']};return _0x1f4b50['get'+_0x426852+'Queues'](_0x345884)['then'](function(_0x40afb1){var _0x349de2=_['map'](_0x40afb1,function(_0x296933){return _0x296933[_0xcf53('0x97')](_0x53cb64,{'transaction':_0x566885})['then'](function(){var _0x22f1d1=_[_0xcf53('0x31')](_0x53cb64,function(_0x1c81aa){socket[_0xcf53('0x8c')]('user'+_0x426852+_0xcf53('0x9a'),{'UserId':Number(_0x1c81aa),[_0x426852+_0xcf53('0x8d')]:_0x296933['id']});if(_0x426852!==_0xcf53('0x82')){return;}return db[_0xcf53('0x92')][_0xcf53('0x62')]({'where':{'VoiceQueueId':_0x296933['id'],'UserId':_0x1c81aa},'transaction':_0x566885});});return Promise['all'](_0x22f1d1);});});return Promise['all'](_0x349de2);});});return Promise['all'](_0x5abe93)[_0xcf53('0x2d')](function(){return _0x1f4b50['removeAgents'](_0x53cb64,{'transaction':_0x566885});})['then'](function(){return db[_0xcf53('0x6f')]['findOne']({'where':{'teamId':_0x4cfa29}})[_0xcf53('0x2d')](function(_0x421f8c){if(_0x421f8c){var _0x161964=_['map'](_0x53cb64,function(_0x46ac91){db[_0xcf53('0x70')][_0xcf53('0x62')]({'where':{'UserId':_0x46ac91,'VoicePrefixId':_0x421f8c[_0xcf53('0x71')]}});});return Promise['all'](_0x161964);}});});});}})[_0xcf53('0x2d')](respondWithStatusCode(_0x2290fc,null))[_0xcf53('0x4b')](handleError(_0x2290fc,null));};exports['getAgents']=function(_0x452cbf,_0x16fc5e,_0xbb8da9){var _0x309840={};var _0x55ac86={};var _0x443a77;var _0x47b9c9;return db[_0xcf53('0x47')][_0xcf53('0x7b')]({'where':{'id':_0x452cbf['params']['id']}})[_0xcf53('0x2d')](handleEntityNotFound(_0x16fc5e,null))[_0xcf53('0x2d')](function(_0x473175){if(_0x473175){_0x443a77=_0x473175;_0x55ac86[_0xcf53('0x35')]=_['keys'](db['User'][_0xcf53('0x4a')]);_0x55ac86[_0xcf53('0x36')]=_['keys'](_0x452cbf[_0xcf53('0x36')]);_0x55ac86[_0xcf53('0x38')]=_[_0xcf53('0x39')](_0x55ac86[_0xcf53('0x35')],_0x55ac86['query']);_0x309840[_0xcf53('0x3a')]=_[_0xcf53('0x39')](_0x55ac86[_0xcf53('0x35')],qs[_0xcf53('0x3b')](_0x452cbf['query'][_0xcf53('0x3b')]));_0x309840[_0xcf53('0x3a')]=_0x309840[_0xcf53('0x3a')][_0xcf53('0x3c')]?_0x309840[_0xcf53('0x3a')]:_0x55ac86['model'];_0x309840[_0xcf53('0x3f')]=qs[_0xcf53('0x40')](_0x452cbf[_0xcf53('0x36')][_0xcf53('0x40')]);_0x309840[_0xcf53('0x42')]=qs['filters'](_[_0xcf53('0x9b')](_0x452cbf[_0xcf53('0x36')],_0x55ac86[_0xcf53('0x38')]));if(_0x452cbf['query']['filter']){_0x309840['where']=_[_0xcf53('0x43')](_0x309840['where'],{'$or':_['map'](_0x309840[_0xcf53('0x3a')],function(_0x17b719){var _0x223a9e={};_0x223a9e[_0x17b719]={'$like':'%'+_0x452cbf['query']['filter']+'%'};return _0x223a9e;})});}_0x309840=_[_0xcf53('0x43')]({},_0x309840,_0x452cbf[_0xcf53('0x44')]);return _0x443a77[_0xcf53('0x9c')](_0x309840);}})['then'](function(_0x17c222){if(_0x17c222){_0x47b9c9=_0x17c222[_0xcf53('0x3c')];if(!_0x452cbf[_0xcf53('0x36')][_0xcf53('0x3d')](_0xcf53('0x3e'))){_0x309840['limit']=qs[_0xcf53('0x26')](_0x452cbf[_0xcf53('0x36')][_0xcf53('0x26')]);_0x309840[_0xcf53('0x24')]=qs[_0xcf53('0x24')](_0x452cbf[_0xcf53('0x36')][_0xcf53('0x24')]);}return _0x443a77[_0xcf53('0x9c')](_0x309840);}})[_0xcf53('0x2d')](function(_0x2411f6){if(_0x2411f6){return _0x2411f6?{'count':_0x47b9c9,'rows':_0x2411f6}:null;}})['then'](respondWithResult(_0x16fc5e,null))[_0xcf53('0x4b')](handleError(_0x16fc5e,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index a2e4dce..3d3985b 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 _0x6456=['events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x7be39e,_0x500c8a){var _0x10046b=function(_0x3fa5aa){while(--_0x3fa5aa){_0x7be39e['push'](_0x7be39e['shift']());}};_0x10046b(++_0x500c8a);}(_0x6456,0x104));var _0x6645=function(_0x51be5a,_0x4493d2){_0x51be5a=_0x51be5a-0x0;var _0x7e5382=_0x6456[_0x51be5a];return _0x7e5382;};'use strict';var EventEmitter=require(_0x6645('0x0'));var Team=require(_0x6645('0x1'))['db'][_0x6645('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x6645('0x3')](0x0);var events={'afterCreate':_0x6645('0x4'),'afterUpdate':_0x6645('0x5'),'afterDestroy':_0x6645('0x6')};function emitEvent(_0x23e58e){return function(_0x3a4709,_0x2c7a4e,_0x2edf92){TeamEvents[_0x6645('0x7')](_0x23e58e+':'+_0x3a4709['id'],_0x3a4709);TeamEvents[_0x6645('0x7')](_0x23e58e,_0x3a4709);_0x2edf92(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x6645('0x8')](e,emitEvent(event));}}module[_0x6645('0x9')]=TeamEvents; \ No newline at end of file +var _0x62a4=['events','../../mysqldb','Team','setMaxListeners','save','update','remove','hasOwnProperty','exports'];(function(_0x7fa3ff,_0x139d6a){var _0x27103d=function(_0x3f369c){while(--_0x3f369c){_0x7fa3ff['push'](_0x7fa3ff['shift']());}};_0x27103d(++_0x139d6a);}(_0x62a4,0xea));var _0x462a=function(_0x483f0,_0x329df8){_0x483f0=_0x483f0-0x0;var _0x59a8eb=_0x62a4[_0x483f0];return _0x59a8eb;};'use strict';var EventEmitter=require(_0x462a('0x0'));var Team=require(_0x462a('0x1'))['db'][_0x462a('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x462a('0x3')](0x0);var events={'afterCreate':_0x462a('0x4'),'afterUpdate':_0x462a('0x5'),'afterDestroy':_0x462a('0x6')};function emitEvent(_0x1a8bf4){return function(_0x4aadc3,_0x1cc19f,_0x2754ce){TeamEvents['emit'](_0x1a8bf4+':'+_0x4aadc3['id'],_0x4aadc3);TeamEvents['emit'](_0x1a8bf4,_0x4aadc3);_0x2754ce(null);};}for(var e in events){if(events[_0x462a('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x462a('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 6df1ea8..85c356d 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 _0x7667=['path','rimraf','../../config/environment','./team.attributes','exports','Team','teams','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x57250b,_0x973efc){var _0x332782=function(_0x3d4da4){while(--_0x3d4da4){_0x57250b['push'](_0x57250b['shift']());}};_0x332782(++_0x973efc);}(_0x7667,0xbd));var _0x7766=function(_0x3eae70,_0x3eb193){_0x3eae70=_0x3eae70-0x0;var _0x3d71ba=_0x7667[_0x3eae70];return _0x3d71ba;};'use strict';var _=require(_0x7766('0x0'));var util=require('util');var logger=require(_0x7766('0x1'))(_0x7766('0x2'));var moment=require(_0x7766('0x3'));var BPromise=require(_0x7766('0x4'));var rp=require(_0x7766('0x5'));var fs=require('fs');var path=require(_0x7766('0x6'));var rimraf=require(_0x7766('0x7'));var config=require(_0x7766('0x8'));var attributes=require(_0x7766('0x9'));module[_0x7766('0xa')]=function(_0x224b2e,_0x5e4d16){return _0x224b2e['define'](_0x7766('0xb'),attributes,{'tableName':_0x7766('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed5f=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','Team','teams','lodash'];(function(_0x10d338,_0x10309e){var _0x2f6513=function(_0x3cb647){while(--_0x3cb647){_0x10d338['push'](_0x10d338['shift']());}};_0x2f6513(++_0x10309e);}(_0xed5f,0xa7));var _0xfed5=function(_0x37f64,_0x2150b0){_0x37f64=_0x37f64-0x0;var _0xddd094=_0xed5f[_0x37f64];return _0xddd094;};'use strict';var _=require(_0xfed5('0x0'));var util=require(_0xfed5('0x1'));var logger=require('../../config/logger')(_0xfed5('0x2'));var moment=require(_0xfed5('0x3'));var BPromise=require(_0xfed5('0x4'));var rp=require(_0xfed5('0x5'));var fs=require('fs');var path=require(_0xfed5('0x6'));var rimraf=require(_0xfed5('0x7'));var config=require(_0xfed5('0x8'));var attributes=require(_0xfed5('0x9'));module['exports']=function(_0x2a176c,_0x17c363){return _0x2a176c['define'](_0xfed5('0xa'),attributes,{'tableName':_0xfed5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index f434957..c8057a9 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 _0x8da5=['info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter'];(function(_0xc66bf2,_0x1248b9){var _0x549c4b=function(_0x5ae380){while(--_0x5ae380){_0xc66bf2['push'](_0xc66bf2['shift']());}};_0x549c4b(++_0x1248b9);}(_0x8da5,0x71));var _0x58da=function(_0x30691a,_0x4153e0){_0x30691a=_0x30691a-0x0;var _0x4ce481=_0x8da5[_0x30691a];return _0x4ce481;};'use strict';var _=require(_0x58da('0x0'));var util=require('util');var moment=require(_0x58da('0x1'));var BPromise=require('bluebird');var rs=require(_0x58da('0x2'));var fs=require('fs');var Redis=require(_0x58da('0x3'));var db=require(_0x58da('0x4'))['db'];var utils=require(_0x58da('0x5'));var logger=require(_0x58da('0x6'))(_0x58da('0x7'));var config=require('../../config/environment');var jayson=require(_0x58da('0x8'));var client=jayson[_0x58da('0x9')][_0x58da('0xa')]({'port':0x232a});config[_0x58da('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x58da('0xc'))(new Redis(config['redis']));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x4565b8,_0x3addc6,_0x3fa05c){return new BPromise(function(_0x34c7b6,_0x2b0419){return client['request'](_0x4565b8,_0x3fa05c)['then'](function(_0xcc4bf6){logger[_0x58da('0xd')](_0x58da('0xe'),_0x3addc6,_0x58da('0xf'));logger[_0x58da('0x10')](_0x58da('0x11'),_0x3addc6,_0x58da('0xf'),JSON['stringify'](_0xcc4bf6));if(_0xcc4bf6[_0x58da('0x12')]){if(_0xcc4bf6['error']['code']===0x1f4){logger[_0x58da('0x12')](_0x58da('0xe'),_0x3addc6,_0xcc4bf6[_0x58da('0x12')]['message']);return _0x2b0419(_0xcc4bf6[_0x58da('0x12')]['message']);}logger['error'](_0x58da('0xe'),_0x3addc6,_0xcc4bf6[_0x58da('0x12')][_0x58da('0x13')]);return _0x34c7b6(_0xcc4bf6[_0x58da('0x12')][_0x58da('0x13')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x3addc6,_0x58da('0xf'));_0x34c7b6(_0xcc4bf6[_0x58da('0x14')][_0x58da('0x13')]);}})['catch'](function(_0x2113da){logger[_0x58da('0x12')](_0x58da('0xe'),_0x3addc6,_0x2113da);_0x2b0419(_0x2113da);});});} \ No newline at end of file +var _0x35d5=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','info','request\x20sent','error','code','Team,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x512973,_0x564e8b){var _0x32f2e1=function(_0x5d5d3b){while(--_0x5d5d3b){_0x512973['push'](_0x512973['shift']());}};_0x32f2e1(++_0x564e8b);}(_0x35d5,0x1cb));var _0x535d=function(_0x351e3a,_0xbc0b52){_0x351e3a=_0x351e3a-0x0;var _0x385527=_0x35d5[_0x351e3a];return _0x385527;};'use strict';var _=require(_0x535d('0x0'));var util=require(_0x535d('0x1'));var moment=require('moment');var BPromise=require(_0x535d('0x2'));var rs=require(_0x535d('0x3'));var fs=require('fs');var Redis=require(_0x535d('0x4'));var db=require(_0x535d('0x5'))['db'];var utils=require(_0x535d('0x6'));var logger=require(_0x535d('0x7'))('rpc');var config=require(_0x535d('0x8'));var jayson=require(_0x535d('0x9'));var client=jayson[_0x535d('0xa')][_0x535d('0xb')]({'port':0x232a});config[_0x535d('0xc')]=_[_0x535d('0xd')](config[_0x535d('0xc')],{'host':_0x535d('0xe'),'port':0x18eb});var socket=require(_0x535d('0xf'))(new Redis(config[_0x535d('0xc')]));require(_0x535d('0x10'))[_0x535d('0x11')](socket);function respondWithRpcPromise(_0x56cd20,_0x3b1de3,_0x483296){return new BPromise(function(_0x1f47fe,_0x25c15f){return client[_0x535d('0x12')](_0x56cd20,_0x483296)['then'](function(_0x2d24ce){logger[_0x535d('0x13')]('Team,\x20%s,\x20%s',_0x3b1de3,_0x535d('0x14'));logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x3b1de3,'request\x20sent',JSON['stringify'](_0x2d24ce));if(_0x2d24ce[_0x535d('0x15')]){if(_0x2d24ce[_0x535d('0x15')][_0x535d('0x16')]===0x1f4){logger[_0x535d('0x15')](_0x535d('0x17'),_0x3b1de3,_0x2d24ce[_0x535d('0x15')][_0x535d('0x18')]);return _0x25c15f(_0x2d24ce[_0x535d('0x15')]['message']);}logger[_0x535d('0x15')](_0x535d('0x17'),_0x3b1de3,_0x2d24ce[_0x535d('0x15')]['message']);return _0x1f47fe(_0x2d24ce[_0x535d('0x15')]['message']);}else{logger[_0x535d('0x13')](_0x535d('0x17'),_0x3b1de3,'request\x20sent');_0x1f47fe(_0x2d24ce['result'][_0x535d('0x18')]);}})[_0x535d('0x19')](function(_0x20bcf1){logger[_0x535d('0x15')]('Team,\x20%s,\x20%s',_0x3b1de3,_0x20bcf1);_0x25c15f(_0x20bcf1);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 033b5be..c3262aa 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 _0x66e2=['removeListener','register','length','team:','save','remove','emit'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x66e2,0x74));var _0x266e=function(_0xb2eebb,_0x570e3d){_0xb2eebb=_0xb2eebb-0x0;var _0x457547=_0x66e2[_0xb2eebb];return _0x457547;};'use strict';var TeamEvents=require('./team.events');var events=[_0x266e('0x0'),_0x266e('0x1'),'update'];function createListener(_0xe0b383,_0x5a4101){return function(_0x45a9aa){_0x5a4101[_0x266e('0x2')](_0xe0b383,_0x45a9aa);};}function removeListener(_0x51a2fb,_0x381e95){return function(){TeamEvents[_0x266e('0x3')](_0x51a2fb,_0x381e95);};}exports[_0x266e('0x4')]=function(_0x457d38){for(var _0x4ac1fa=0x0,_0xc07efd=events[_0x266e('0x5')];_0x4ac1fa<_0xc07efd;_0x4ac1fa++){var _0x191a31=events[_0x4ac1fa];var _0x226c26=createListener(_0x266e('0x6')+_0x191a31,_0x457d38);TeamEvents['on'](_0x191a31,_0x226c26);}}; \ No newline at end of file +var _0x1a5c=['emit','register','length','team:','./team.events','save','remove','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1a5c,0x12c));var _0xc1a5=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1a5c[_0x3e5086];return _0xfeb102;};'use strict';var TeamEvents=require(_0xc1a5('0x0'));var events=[_0xc1a5('0x1'),_0xc1a5('0x2'),_0xc1a5('0x3')];function createListener(_0x38b8dd,_0x1da808){return function(_0x36a64){_0x1da808[_0xc1a5('0x4')](_0x38b8dd,_0x36a64);};}function removeListener(_0x2b324b,_0x22243f){return function(){TeamEvents['removeListener'](_0x2b324b,_0x22243f);};}exports[_0xc1a5('0x5')]=function(_0x1c9b90){for(var _0x411612=0x0,_0x510cf3=events[_0xc1a5('0x6')];_0x411612<_0x510cf3;_0x411612++){var _0x1cf3d7=events[_0x411612];var _0x369ea7=createListener(_0xc1a5('0x7')+_0x1cf3d7,_0x1c9b90);TeamEvents['on'](_0x1cf3d7,_0x369ea7);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index b354408..ee9d775 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 _0x4517=['exports','INTEGER'];(function(_0x21a2b3,_0x5d6564){var _0x4651a7=function(_0x285f59){while(--_0x285f59){_0x21a2b3['push'](_0x21a2b3['shift']());}};_0x4651a7(++_0x5d6564);}(_0x4517,0x112));var _0x7451=function(_0x1cf69d,_0xac7c17){_0x1cf69d=_0x1cf69d-0x0;var _0x42ec9e=_0x4517[_0x1cf69d];return _0x42ec9e;};'use strict';var Sequelize=require('sequelize');module[_0x7451('0x0')]={'TeamId':{'type':Sequelize[_0x7451('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xc3b0=['INTEGER','sequelize','exports'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xc3b0,0x166));var _0x0c3b=function(_0x4c3340,_0x30ba1a){_0x4c3340=_0x4c3340-0x0;var _0x168b3b=_0xc3b0[_0x4c3340];return _0x168b3b;};'use strict';var Sequelize=require(_0x0c3b('0x0'));module[_0x0c3b('0x1')]={'TeamId':{'type':Sequelize[_0x0c3b('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x0c3b('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index e709ab3..cbcd0bc 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 _0x705f=['request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','../../config/logger','moment','bluebird'];(function(_0x44d720,_0x5e82de){var _0x46d103=function(_0x4db6f4){while(--_0x4db6f4){_0x44d720['push'](_0x44d720['shift']());}};_0x46d103(++_0x5e82de);}(_0x705f,0x75));var _0xf705=function(_0x2afccc,_0x443a1a){_0x2afccc=_0x2afccc-0x0;var _0x485666=_0x705f[_0x2afccc];return _0x485666;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf705('0x0'))('api');var moment=require(_0xf705('0x1'));var BPromise=require(_0xf705('0x2'));var rp=require(_0xf705('0x3'));var fs=require('fs');var path=require(_0xf705('0x4'));var rimraf=require(_0xf705('0x5'));var config=require(_0xf705('0x6'));var attributes=require(_0xf705('0x7'));module[_0xf705('0x8')]=function(_0x10214c,_0x991602){return _0x10214c[_0xf705('0x9')]('TeamVoicePrefix',attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbca8=['request-promise','path','rimraf','exports','define','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment'];(function(_0x4a870a,_0x324e65){var _0x4c3009=function(_0x838c4c){while(--_0x838c4c){_0x4a870a['push'](_0x4a870a['shift']());}};_0x4c3009(++_0x324e65);}(_0xbca8,0xcc));var _0x8bca=function(_0x2a1f5a,_0x6bb500){_0x2a1f5a=_0x2a1f5a-0x0;var _0x5908f1=_0xbca8[_0x2a1f5a];return _0x5908f1;};'use strict';var _=require(_0x8bca('0x0'));var util=require(_0x8bca('0x1'));var logger=require(_0x8bca('0x2'))(_0x8bca('0x3'));var moment=require(_0x8bca('0x4'));var BPromise=require('bluebird');var rp=require(_0x8bca('0x5'));var fs=require('fs');var path=require(_0x8bca('0x6'));var rimraf=require(_0x8bca('0x7'));var config=require('../../config/environment');var attributes=require('./teamVoicePrefix.attributes');module[_0x8bca('0x8')]=function(_0x2ecf60,_0x318474){return _0x2ecf60[_0x8bca('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0x8bca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 3b5d817..6b8b7de 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2b0ed3,_0x5eea49){var _0x4afc21=function(_0x17c5d2){while(--_0x17c5d2){_0x2b0ed3['push'](_0x2b0ed3['shift']());}};_0x4afc21(++_0x5eea49);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0xcb91[_0x4bb145];return _0x4db596;};'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(_0x43709e,_0x2c3b45){var _0x452820=function(_0x42777c){while(--_0x42777c){_0x43709e['push'](_0x43709e['shift']());}};_0x452820(++_0x2c3b45);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index f3e553e..9006424 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 _0x57fa=['exports','INTEGER'];(function(_0x2208a3,_0x3d830b){var _0x561340=function(_0x5a8588){while(--_0x5a8588){_0x2208a3['push'](_0x2208a3['shift']());}};_0x561340(++_0x3d830b);}(_0x57fa,0x1b8));var _0xa57f=function(_0x37f04e,_0x4a4d79){_0x37f04e=_0x37f04e-0x0;var _0x54eace=_0x57fa[_0x37f04e];return _0x54eace;};'use strict';var Sequelize=require('sequelize');module[_0xa57f('0x0')]={'penalty':{'type':Sequelize[_0xa57f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 5f0a2c6..2b70075 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 _0x9879=['request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','util','../../config/logger','moment'];(function(_0x12309b,_0x59dd8c){var _0x482e4d=function(_0x308407){while(--_0x308407){_0x12309b['push'](_0x12309b['shift']());}};_0x482e4d(++_0x59dd8c);}(_0x9879,0x98));var _0x9987=function(_0x16fdc6,_0x13fa2e){_0x16fdc6=_0x16fdc6-0x0;var _0x354770=_0x9879[_0x16fdc6];return _0x354770;};'use strict';var _=require(_0x9987('0x0'));var util=require(_0x9987('0x1'));var logger=require(_0x9987('0x2'))('api');var moment=require(_0x9987('0x3'));var BPromise=require('bluebird');var rp=require(_0x9987('0x4'));var fs=require('fs');var path=require(_0x9987('0x5'));var rimraf=require(_0x9987('0x6'));var config=require(_0x9987('0x7'));var attributes=require(_0x9987('0x8'));module[_0x9987('0x9')]=function(_0x4258df,_0x4d479d){return _0x4258df[_0x9987('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0x9987('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbed7=['rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x418703,_0x5a5b7b){var _0x17c94f=function(_0x4c632d){while(--_0x4c632d){_0x418703['push'](_0x418703['shift']());}};_0x17c94f(++_0x5a5b7b);}(_0xbed7,0x14b));var _0x7bed=function(_0x4a18e5,_0x231131){_0x4a18e5=_0x4a18e5-0x0;var _0x56032d=_0xbed7[_0x4a18e5];return _0x56032d;};'use strict';var _=require(_0x7bed('0x0'));var util=require(_0x7bed('0x1'));var logger=require(_0x7bed('0x2'))(_0x7bed('0x3'));var moment=require(_0x7bed('0x4'));var BPromise=require('bluebird');var rp=require(_0x7bed('0x5'));var fs=require('fs');var path=require(_0x7bed('0x6'));var rimraf=require(_0x7bed('0x7'));var config=require(_0x7bed('0x8'));var attributes=require(_0x7bed('0x9'));module[_0x7bed('0xa')]=function(_0x41c148,_0x3aa0e9){return _0x41c148[_0x7bed('0xb')]('TeamVoiceQueue',attributes,{'tableName':_0x7bed('0xc'),'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 78fe216..809bd09 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 _0x8828=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','TeamVoiceQueue,\x20%s,\x20%s','message','request\x20sent','catch','lodash','util','randomstring'];(function(_0x3c6dd2,_0x21a4a4){var _0x58e26c=function(_0x138d12){while(--_0x138d12){_0x3c6dd2['push'](_0x3c6dd2['shift']());}};_0x58e26c(++_0x21a4a4);}(_0x8828,0x1d1));var _0x8882=function(_0x1521f0,_0x36e6db){_0x1521f0=_0x1521f0-0x0;var _0x33d310=_0x8828[_0x1521f0];return _0x33d310;};'use strict';var _=require(_0x8882('0x0'));var util=require(_0x8882('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8882('0x2'));var fs=require('fs');var Redis=require(_0x8882('0x3'));var db=require(_0x8882('0x4'))['db'];var utils=require(_0x8882('0x5'));var logger=require(_0x8882('0x6'))('rpc');var config=require(_0x8882('0x7'));var jayson=require(_0x8882('0x8'));var client=jayson['client'][_0x8882('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a7528,_0x103723,_0x486e30){return new BPromise(function(_0x28004f,_0x57404a){return client['request'](_0x5a7528,_0x486e30)[_0x8882('0xa')](function(_0x472d85){logger[_0x8882('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x103723,'request\x20sent');logger['debug'](_0x8882('0xc'),_0x103723,'request\x20sent',JSON['stringify'](_0x472d85));if(_0x472d85['error']){if(_0x472d85[_0x8882('0xd')]['code']===0x1f4){logger[_0x8882('0xd')](_0x8882('0xe'),_0x103723,_0x472d85[_0x8882('0xd')][_0x8882('0xf')]);return _0x57404a(_0x472d85[_0x8882('0xd')][_0x8882('0xf')]);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x103723,_0x472d85[_0x8882('0xd')][_0x8882('0xf')]);return _0x28004f(_0x472d85['error'][_0x8882('0xf')]);}else{logger[_0x8882('0xb')](_0x8882('0xe'),_0x103723,_0x8882('0x10'));_0x28004f(_0x472d85['result']['message']);}})[_0x8882('0x11')](function(_0x490de5){logger[_0x8882('0xd')](_0x8882('0xe'),_0x103723,_0x490de5);_0x57404a(_0x490de5);});});} \ No newline at end of file +var _0xe802=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x30e96f,_0x12dd96){var _0x356214=function(_0x368072){while(--_0x368072){_0x30e96f['push'](_0x30e96f['shift']());}};_0x356214(++_0x12dd96);}(_0xe802,0xc2));var _0x2e80=function(_0x308abe,_0x5e67ef){_0x308abe=_0x308abe-0x0;var _0x1c3264=_0xe802[_0x308abe];return _0x1c3264;};'use strict';var _=require('lodash');var util=require(_0x2e80('0x0'));var moment=require('moment');var BPromise=require(_0x2e80('0x1'));var rs=require(_0x2e80('0x2'));var fs=require('fs');var Redis=require(_0x2e80('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e80('0x4'));var logger=require('../../config/logger')(_0x2e80('0x5'));var config=require(_0x2e80('0x6'));var jayson=require(_0x2e80('0x7'));var client=jayson[_0x2e80('0x8')][_0x2e80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44e745,_0x44a9c7,_0x3edeed){return new BPromise(function(_0x566f9b,_0x5d967a){return client['request'](_0x44e745,_0x3edeed)[_0x2e80('0xa')](function(_0x359a7d){logger[_0x2e80('0xb')](_0x2e80('0xc'),_0x44a9c7,_0x2e80('0xd'));logger[_0x2e80('0xe')](_0x2e80('0xf'),_0x44a9c7,_0x2e80('0xd'),JSON['stringify'](_0x359a7d));if(_0x359a7d[_0x2e80('0x10')]){if(_0x359a7d[_0x2e80('0x10')][_0x2e80('0x11')]===0x1f4){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x44a9c7,_0x359a7d[_0x2e80('0x10')][_0x2e80('0x12')]);return _0x5d967a(_0x359a7d[_0x2e80('0x10')][_0x2e80('0x12')]);}logger['error'](_0x2e80('0xc'),_0x44a9c7,_0x359a7d[_0x2e80('0x10')][_0x2e80('0x12')]);return _0x566f9b(_0x359a7d[_0x2e80('0x10')][_0x2e80('0x12')]);}else{logger[_0x2e80('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x44a9c7,'request\x20sent');_0x566f9b(_0x359a7d[_0x2e80('0x13')][_0x2e80('0x12')]);}})[_0x2e80('0x14')](function(_0x139742){logger[_0x2e80('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x44a9c7,_0x139742);_0x5d967a(_0x139742);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index b4d059e..bea19ed 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 _0x5a13=['destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','create','put','update'];(function(_0x278f9b,_0x214384){var _0x13ea35=function(_0x4ccdd6){while(--_0x4ccdd6){_0x278f9b['push'](_0x278f9b['shift']());}};_0x13ea35(++_0x214384);}(_0x5a13,0x145));var _0x35a1=function(_0x271ba5,_0xe19327){_0x271ba5=_0x271ba5-0x0;var _0x57935b=_0x5a13[_0x271ba5];return _0x57935b;};'use strict';var multer=require(_0x35a1('0x0'));var util=require(_0x35a1('0x1'));var path=require('path');var timeout=require(_0x35a1('0x2'));var express=require(_0x35a1('0x3'));var router=express[_0x35a1('0x4')]();var fs_extra=require(_0x35a1('0x5'));var auth=require(_0x35a1('0x6'));var interaction=require(_0x35a1('0x7'));var config=require(_0x35a1('0x8'));var controller=require(_0x35a1('0x9'));router[_0x35a1('0xa')]('/',auth[_0x35a1('0xb')](),controller[_0x35a1('0xc')]);router[_0x35a1('0xa')](_0x35a1('0xd'),auth[_0x35a1('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x35a1('0xe')]);router[_0x35a1('0xf')]('/:id',auth[_0x35a1('0xb')](),controller[_0x35a1('0x10')]);router['delete']('/:id',auth[_0x35a1('0xb')](),controller[_0x35a1('0x11')]);module['exports']=router; \ No newline at end of file +var _0xeaab=['exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xeaab,0xd9));var _0xbeaa=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xeaab[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xbeaa('0x0'));var util=require('util');var path=require(_0xbeaa('0x1'));var timeout=require(_0xbeaa('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbeaa('0x3'));var auth=require(_0xbeaa('0x4'));var interaction=require(_0xbeaa('0x5'));var config=require(_0xbeaa('0x6'));var controller=require(_0xbeaa('0x7'));router[_0xbeaa('0x8')]('/',auth[_0xbeaa('0x9')](),controller[_0xbeaa('0xa')]);router[_0xbeaa('0x8')](_0xbeaa('0xb'),auth[_0xbeaa('0x9')](),controller[_0xbeaa('0xc')]);router[_0xbeaa('0xd')]('/',auth[_0xbeaa('0x9')](),controller['create']);router[_0xbeaa('0xe')](_0xbeaa('0xb'),auth[_0xbeaa('0x9')](),controller[_0xbeaa('0xf')]);router[_0xbeaa('0x10')](_0xbeaa('0xb'),auth[_0xbeaa('0x9')](),controller['destroy']);module[_0xbeaa('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 4077bc8..d77461b 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 _0x2603=['exports','STRING','sequelize'];(function(_0x5676f0,_0x1dddfd){var _0x92e03=function(_0x5ae96f){while(--_0x5ae96f){_0x5676f0['push'](_0x5676f0['shift']());}};_0x92e03(++_0x1dddfd);}(_0x2603,0x15b));var _0x3260=function(_0x3cc563,_0x1598d3){_0x3cc563=_0x3cc563-0x0;var _0x11c044=_0x2603[_0x3cc563];return _0x11c044;};'use strict';var Sequelize=require(_0x3260('0x0'));module[_0x3260('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3260('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xdf02=['exports','STRING','sequelize'];(function(_0x38622b,_0x3cfdf7){var _0x2c1a7a=function(_0x5de9cc){while(--_0x5de9cc){_0x38622b['push'](_0x38622b['shift']());}};_0x2c1a7a(++_0x3cfdf7);}(_0xdf02,0x12b));var _0x2df0=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xdf02[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x2df0('0x0'));module[_0x2df0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2df0('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index fbb4d62..3ad9665 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 _0xee00=['destroy','then','get','UserProfileResource','end','error','stack','name','send','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','rows','catch','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','save'];(function(_0x3a97ad,_0x526d36){var _0x2e6313=function(_0x54aa67){while(--_0x54aa67){_0x3a97ad['push'](_0x3a97ad['shift']());}};_0x2e6313(++_0x526d36);}(_0xee00,0x1e0));var _0x0ee0=function(_0x2b2a0d,_0x1b2fb1){_0x2b2a0d=_0x2b2a0d-0x0;var _0xe20ecb=_0xee00[_0x2b2a0d];return _0xe20ecb;};'use strict';var emlformat=require(_0x0ee0('0x0'));var rimraf=require(_0x0ee0('0x1'));var zipdir=require(_0x0ee0('0x2'));var jsonpatch=require(_0x0ee0('0x3'));var rp=require('request-promise');var moment=require(_0x0ee0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0ee0('0x5'));var util=require(_0x0ee0('0x6'));var path=require(_0x0ee0('0x7'));var sox=require(_0x0ee0('0x8'));var csv=require(_0x0ee0('0x9'));var ejs=require(_0x0ee0('0xa'));var fs=require('fs');var fs_extra=require(_0x0ee0('0xb'));var _=require('lodash');var squel=require(_0x0ee0('0xc'));var crypto=require(_0x0ee0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0ee0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0ee0('0xf'));var Papa=require(_0x0ee0('0x10'));var Redis=require(_0x0ee0('0x11'));var authService=require(_0x0ee0('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ee0('0x13'))(_0x0ee0('0x14'));var utils=require(_0x0ee0('0x15'));var config=require(_0x0ee0('0x16'));var licenseUtil=require(_0x0ee0('0x17'));var db=require(_0x0ee0('0x18'))['db'];function respondWithStatusCode(_0x5d8d18,_0x297f05){_0x297f05=_0x297f05||0xcc;return function(_0x27a3b3){if(_0x27a3b3){return _0x5d8d18[_0x0ee0('0x19')](_0x297f05);}return _0x5d8d18[_0x0ee0('0x1a')](_0x297f05)['end']();};}function respondWithResult(_0x205c42,_0x80c27d){_0x80c27d=_0x80c27d||0xc8;return function(_0x2d708a){if(_0x2d708a){return _0x205c42[_0x0ee0('0x1a')](_0x80c27d)[_0x0ee0('0x1b')](_0x2d708a);}};}function respondWithFilteredResult(_0xe12469,_0x4b14da){return function(_0x2411bf){if(_0x2411bf){var _0x7fc66a=typeof _0x4b14da['offset']===_0x0ee0('0x1c')&&typeof _0x4b14da[_0x0ee0('0x1d')]==='undefined';var _0x4c4d9c=_0x2411bf['count'];var _0x48f560=_0x7fc66a?0x0:_0x4b14da[_0x0ee0('0x1e')];var _0x34a331=_0x7fc66a?_0x2411bf[_0x0ee0('0x1f')]:_0x4b14da[_0x0ee0('0x1e')]+_0x4b14da['limit'];var _0x5b4a38;if(_0x34a331>=_0x4c4d9c){_0x34a331=_0x4c4d9c;_0x5b4a38=0xc8;}else{_0x5b4a38=0xce;}_0xe12469[_0x0ee0('0x1a')](_0x5b4a38);return _0xe12469[_0x0ee0('0x20')](_0x0ee0('0x21'),_0x48f560+'-'+_0x34a331+'/'+_0x4c4d9c)['json'](_0x2411bf);}return null;};}function patchUpdates(_0x38cf68){return function(_0x109383){try{jsonpatch[_0x0ee0('0x22')](_0x109383,_0x38cf68,!![]);}catch(_0x159cb6){return BPromise['reject'](_0x159cb6);}return _0x109383[_0x0ee0('0x23')]();};}function saveUpdates(_0x46211a,_0x150a21){return function(_0x3dfc9c){if(_0x3dfc9c){return _0x3dfc9c['update'](_0x46211a)['then'](function(_0x3279ad){return _0x3279ad;});}return null;};}function removeEntity(_0x44290b,_0x5813a9){return function(_0x26db04){if(_0x26db04){return _0x26db04[_0x0ee0('0x24')]()[_0x0ee0('0x25')](function(){var _0x11b1ba=_0x26db04[_0x0ee0('0x26')]({'plain':!![]});var _0x52a171='Templates';return db[_0x0ee0('0x27')][_0x0ee0('0x24')]({'where':{'type':_0x52a171,'resourceId':_0x11b1ba['id']}})['then'](function(){return _0x26db04;});})[_0x0ee0('0x25')](function(){_0x44290b[_0x0ee0('0x1a')](0xcc)[_0x0ee0('0x28')]();});}};}function handleEntityNotFound(_0x1ec983,_0x5cf83b){return function(_0x577695){if(!_0x577695){_0x1ec983['sendStatus'](0x194);}return _0x577695;};}function handleError(_0x11adb2,_0x21c445){_0x21c445=_0x21c445||0x1f4;return function(_0x3a8545){logger[_0x0ee0('0x29')](_0x3a8545[_0x0ee0('0x2a')]);if(_0x3a8545[_0x0ee0('0x2b')]){delete _0x3a8545[_0x0ee0('0x2b')];}_0x11adb2[_0x0ee0('0x1a')](_0x21c445)[_0x0ee0('0x2c')](_0x3a8545);};}exports['index']=function(_0x3f0507,_0x72c595){var _0x28c89b={},_0x2425b4={},_0x20ed10={'count':0x0,'rows':[]};var _0x31c533=_[_0x0ee0('0x2d')](db[_0x0ee0('0x2e')][_0x0ee0('0x2f')],function(_0x2f0c57){return{'name':_0x2f0c57[_0x0ee0('0x30')],'type':_0x2f0c57[_0x0ee0('0x31')][_0x0ee0('0x32')]};});_0x2425b4[_0x0ee0('0x33')]=_[_0x0ee0('0x2d')](_0x31c533,_0x0ee0('0x2b'));_0x2425b4[_0x0ee0('0x34')]=_[_0x0ee0('0x35')](_0x3f0507['query']);_0x2425b4[_0x0ee0('0x36')]=_[_0x0ee0('0x37')](_0x2425b4['model'],_0x2425b4[_0x0ee0('0x34')]);_0x28c89b['attributes']=_[_0x0ee0('0x37')](_0x2425b4[_0x0ee0('0x33')],qs['fields'](_0x3f0507[_0x0ee0('0x34')][_0x0ee0('0x38')]));_0x28c89b['attributes']=_0x28c89b[_0x0ee0('0x39')][_0x0ee0('0x3a')]?_0x28c89b[_0x0ee0('0x39')]:_0x2425b4[_0x0ee0('0x33')];if(!_0x3f0507[_0x0ee0('0x34')][_0x0ee0('0x3b')](_0x0ee0('0x3c'))){_0x28c89b[_0x0ee0('0x1d')]=qs[_0x0ee0('0x1d')](_0x3f0507[_0x0ee0('0x34')][_0x0ee0('0x1d')]);_0x28c89b[_0x0ee0('0x1e')]=qs[_0x0ee0('0x1e')](_0x3f0507[_0x0ee0('0x34')][_0x0ee0('0x1e')]);}_0x28c89b[_0x0ee0('0x3d')]=qs[_0x0ee0('0x3e')](_0x3f0507['query'][_0x0ee0('0x3e')]);_0x28c89b['where']=qs[_0x0ee0('0x36')](_[_0x0ee0('0x3f')](_0x3f0507[_0x0ee0('0x34')],_0x2425b4[_0x0ee0('0x36')]),_0x31c533);if(_0x3f0507[_0x0ee0('0x34')][_0x0ee0('0x40')]){_0x28c89b[_0x0ee0('0x41')]=_[_0x0ee0('0x42')](_0x28c89b[_0x0ee0('0x41')],{'$or':_[_0x0ee0('0x2d')](_0x31c533,function(_0x2311ee){if(_0x2311ee[_0x0ee0('0x31')]!==_0x0ee0('0x43')){var _0x1958d4={};_0x1958d4[_0x2311ee[_0x0ee0('0x2b')]]={'$like':'%'+_0x3f0507[_0x0ee0('0x34')][_0x0ee0('0x40')]+'%'};return _0x1958d4;}})});}_0x28c89b=_[_0x0ee0('0x42')]({},_0x28c89b,_0x3f0507[_0x0ee0('0x44')]);var _0x2c99cf={'where':_0x28c89b['where']};return db['Template'][_0x0ee0('0x1f')](_0x2c99cf)['then'](function(_0x6baaa5){_0x20ed10[_0x0ee0('0x1f')]=_0x6baaa5;if(_0x3f0507[_0x0ee0('0x34')]['includeAll']){_0x28c89b['include']=[{'all':!![]}];}return db[_0x0ee0('0x2e')]['findAll'](_0x28c89b);})[_0x0ee0('0x25')](function(_0x1f3539){_0x20ed10[_0x0ee0('0x45')]=_0x1f3539;return _0x20ed10;})[_0x0ee0('0x25')](respondWithFilteredResult(_0x72c595,_0x28c89b))[_0x0ee0('0x46')](handleError(_0x72c595,null));};exports[_0x0ee0('0x47')]=function(_0x14c867,_0x1ad225){var _0xfcde83={'raw':!![],'where':{'id':_0x14c867[_0x0ee0('0x48')]['id']}},_0x470cec={};_0x470cec[_0x0ee0('0x33')]=_['keys'](db[_0x0ee0('0x2e')][_0x0ee0('0x2f')]);_0x470cec['query']=_[_0x0ee0('0x35')](_0x14c867['query']);_0x470cec[_0x0ee0('0x36')]=_['intersection'](_0x470cec[_0x0ee0('0x33')],_0x470cec[_0x0ee0('0x34')]);_0xfcde83['attributes']=_[_0x0ee0('0x37')](_0x470cec[_0x0ee0('0x33')],qs[_0x0ee0('0x38')](_0x14c867[_0x0ee0('0x34')]['fields']));_0xfcde83[_0x0ee0('0x39')]=_0xfcde83['attributes'][_0x0ee0('0x3a')]?_0xfcde83['attributes']:_0x470cec[_0x0ee0('0x33')];if(_0x14c867['query'][_0x0ee0('0x49')]){_0xfcde83[_0x0ee0('0x4a')]=[{'all':!![]}];}_0xfcde83=_['merge']({},_0xfcde83,_0x14c867[_0x0ee0('0x44')]);return db[_0x0ee0('0x2e')][_0x0ee0('0x4b')](_0xfcde83)[_0x0ee0('0x25')](handleEntityNotFound(_0x1ad225,null))[_0x0ee0('0x25')](respondWithResult(_0x1ad225,null))['catch'](handleError(_0x1ad225,null));};exports[_0x0ee0('0x4c')]=function(_0x10df15,_0x3e4d29){return db[_0x0ee0('0x2e')][_0x0ee0('0x4c')](_0x10df15[_0x0ee0('0x4d')],{})['then'](function(_0x547063){var _0x5623cf=_0x10df15[_0x0ee0('0x4e')][_0x0ee0('0x26')]({'plain':!![]});if(!_0x5623cf)throw new Error(_0x0ee0('0x4f'));if(_0x5623cf[_0x0ee0('0x50')]===_0x0ee0('0x4e')){var _0x390594=_0x547063[_0x0ee0('0x26')]({'plain':!![]});var _0x9c0ea4='Templates';return db[_0x0ee0('0x51')][_0x0ee0('0x4b')]({'where':{'name':_0x9c0ea4,'userProfileId':_0x5623cf[_0x0ee0('0x52')]},'raw':!![]})[_0x0ee0('0x25')](function(_0x3f2d6f){if(_0x3f2d6f&&_0x3f2d6f[_0x0ee0('0x53')]===0x0){return db[_0x0ee0('0x27')]['create']({'name':_0x390594['name'],'resourceId':_0x390594['id'],'type':_0x3f2d6f[_0x0ee0('0x2b')],'sectionId':_0x3f2d6f['id']},{})[_0x0ee0('0x25')](function(){return _0x547063;});}else{return _0x547063;}})[_0x0ee0('0x46')](function(_0xc14f9b){logger[_0x0ee0('0x29')](_0x0ee0('0x54'),_0xc14f9b);throw _0xc14f9b;});}return _0x547063;})[_0x0ee0('0x25')](respondWithResult(_0x3e4d29,0xc9))[_0x0ee0('0x46')](handleError(_0x3e4d29,null));};exports[_0x0ee0('0x55')]=function(_0x297b7a,_0x1fa371){if(_0x297b7a['body']['id']){delete _0x297b7a[_0x0ee0('0x4d')]['id'];}return db[_0x0ee0('0x2e')][_0x0ee0('0x4b')]({'where':{'id':_0x297b7a[_0x0ee0('0x48')]['id']}})[_0x0ee0('0x25')](handleEntityNotFound(_0x1fa371,null))[_0x0ee0('0x25')](saveUpdates(_0x297b7a['body'],null))[_0x0ee0('0x25')](respondWithResult(_0x1fa371,null))['catch'](handleError(_0x1fa371,null));};exports[_0x0ee0('0x24')]=function(_0x847f00,_0x4bd22){return db[_0x0ee0('0x2e')][_0x0ee0('0x4b')]({'where':{'id':_0x847f00['params']['id']}})['then'](handleEntityNotFound(_0x4bd22,null))[_0x0ee0('0x25')](removeEntity(_0x4bd22,null))[_0x0ee0('0x46')](handleError(_0x4bd22,null));}; \ No newline at end of file +var _0xce82=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','Templates','UserProfileResource','destroy','error','stack','name','send','index','rawAttributes','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','Template','include','rows','show','params','includeAll','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x599c94,_0x464f0e){var _0x34e215=function(_0x36295a){while(--_0x36295a){_0x599c94['push'](_0x599c94['shift']());}};_0x34e215(++_0x464f0e);}(_0xce82,0x186));var _0x2ce8=function(_0xf244e5,_0x15751e){_0xf244e5=_0xf244e5-0x0;var _0x1d424f=_0xce82[_0xf244e5];return _0x1d424f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ce8('0x0'));var zipdir=require(_0x2ce8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2ce8('0x2'));var moment=require(_0x2ce8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2ce8('0x4'));var util=require('util');var path=require(_0x2ce8('0x5'));var sox=require(_0x2ce8('0x6'));var csv=require(_0x2ce8('0x7'));var ejs=require(_0x2ce8('0x8'));var fs=require('fs');var fs_extra=require(_0x2ce8('0x9'));var _=require(_0x2ce8('0xa'));var squel=require(_0x2ce8('0xb'));var crypto=require(_0x2ce8('0xc'));var jsforce=require(_0x2ce8('0xd'));var deskjs=require(_0x2ce8('0xe'));var toCsv=require(_0x2ce8('0x7'));var querystring=require(_0x2ce8('0xf'));var Papa=require(_0x2ce8('0x10'));var Redis=require(_0x2ce8('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2ce8('0x12'));var hardwareService=require(_0x2ce8('0x13'));var logger=require('../../config/logger')(_0x2ce8('0x14'));var utils=require(_0x2ce8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2ce8('0x16'))['db'];function respondWithStatusCode(_0x2a3c57,_0x2b0071){_0x2b0071=_0x2b0071||0xcc;return function(_0x2e636a){if(_0x2e636a){return _0x2a3c57[_0x2ce8('0x17')](_0x2b0071);}return _0x2a3c57[_0x2ce8('0x18')](_0x2b0071)[_0x2ce8('0x19')]();};}function respondWithResult(_0x955181,_0x1bc61a){_0x1bc61a=_0x1bc61a||0xc8;return function(_0xdde7e6){if(_0xdde7e6){return _0x955181[_0x2ce8('0x18')](_0x1bc61a)['json'](_0xdde7e6);}};}function respondWithFilteredResult(_0x382193,_0x5ca06e){return function(_0x1144fc){if(_0x1144fc){var _0x61808a=typeof _0x5ca06e[_0x2ce8('0x1a')]==='undefined'&&typeof _0x5ca06e[_0x2ce8('0x1b')]===_0x2ce8('0x1c');var _0x33b11e=_0x1144fc[_0x2ce8('0x1d')];var _0x2b3e33=_0x61808a?0x0:_0x5ca06e['offset'];var _0x302409=_0x61808a?_0x1144fc[_0x2ce8('0x1d')]:_0x5ca06e[_0x2ce8('0x1a')]+_0x5ca06e['limit'];var _0x48013e;if(_0x302409>=_0x33b11e){_0x302409=_0x33b11e;_0x48013e=0xc8;}else{_0x48013e=0xce;}_0x382193[_0x2ce8('0x18')](_0x48013e);return _0x382193[_0x2ce8('0x1e')](_0x2ce8('0x1f'),_0x2b3e33+'-'+_0x302409+'/'+_0x33b11e)['json'](_0x1144fc);}return null;};}function patchUpdates(_0x5f4b45){return function(_0x4a0476){try{jsonpatch[_0x2ce8('0x20')](_0x4a0476,_0x5f4b45,!![]);}catch(_0x2a92d1){return BPromise['reject'](_0x2a92d1);}return _0x4a0476[_0x2ce8('0x21')]();};}function saveUpdates(_0x1feb29,_0x5bf1fd){return function(_0xc6e74){if(_0xc6e74){return _0xc6e74[_0x2ce8('0x22')](_0x1feb29)[_0x2ce8('0x23')](function(_0x41a616){return _0x41a616;});}return null;};}function removeEntity(_0x420ca9,_0x58d3d7){return function(_0x1b1796){if(_0x1b1796){return _0x1b1796['destroy']()[_0x2ce8('0x23')](function(){var _0x4f75f7=_0x1b1796['get']({'plain':!![]});var _0x24aa8b=_0x2ce8('0x24');return db[_0x2ce8('0x25')][_0x2ce8('0x26')]({'where':{'type':_0x24aa8b,'resourceId':_0x4f75f7['id']}})[_0x2ce8('0x23')](function(){return _0x1b1796;});})[_0x2ce8('0x23')](function(){_0x420ca9[_0x2ce8('0x18')](0xcc)[_0x2ce8('0x19')]();});}};}function handleEntityNotFound(_0x19b73c,_0x381c7b){return function(_0x11964b){if(!_0x11964b){_0x19b73c['sendStatus'](0x194);}return _0x11964b;};}function handleError(_0x2eeebe,_0x557cb4){_0x557cb4=_0x557cb4||0x1f4;return function(_0x3204b4){logger[_0x2ce8('0x27')](_0x3204b4[_0x2ce8('0x28')]);if(_0x3204b4[_0x2ce8('0x29')]){delete _0x3204b4[_0x2ce8('0x29')];}_0x2eeebe['status'](_0x557cb4)[_0x2ce8('0x2a')](_0x3204b4);};}exports[_0x2ce8('0x2b')]=function(_0x26b5e5,_0x4998a5){var _0x88eca3={},_0x4b377a={},_0x269dc6={'count':0x0,'rows':[]};var _0x89c04b=_['map'](db['Template'][_0x2ce8('0x2c')],function(_0x48f220){return{'name':_0x48f220['fieldName'],'type':_0x48f220[_0x2ce8('0x2d')]['key']};});_0x4b377a[_0x2ce8('0x2e')]=_[_0x2ce8('0x2f')](_0x89c04b,_0x2ce8('0x29'));_0x4b377a[_0x2ce8('0x30')]=_[_0x2ce8('0x31')](_0x26b5e5[_0x2ce8('0x30')]);_0x4b377a['filters']=_[_0x2ce8('0x32')](_0x4b377a['model'],_0x4b377a['query']);_0x88eca3[_0x2ce8('0x33')]=_['intersection'](_0x4b377a['model'],qs[_0x2ce8('0x34')](_0x26b5e5[_0x2ce8('0x30')][_0x2ce8('0x34')]));_0x88eca3['attributes']=_0x88eca3[_0x2ce8('0x33')][_0x2ce8('0x35')]?_0x88eca3[_0x2ce8('0x33')]:_0x4b377a[_0x2ce8('0x2e')];if(!_0x26b5e5['query'][_0x2ce8('0x36')](_0x2ce8('0x37'))){_0x88eca3['limit']=qs['limit'](_0x26b5e5[_0x2ce8('0x30')][_0x2ce8('0x1b')]);_0x88eca3[_0x2ce8('0x1a')]=qs[_0x2ce8('0x1a')](_0x26b5e5[_0x2ce8('0x30')]['offset']);}_0x88eca3[_0x2ce8('0x38')]=qs[_0x2ce8('0x39')](_0x26b5e5[_0x2ce8('0x30')][_0x2ce8('0x39')]);_0x88eca3[_0x2ce8('0x3a')]=qs[_0x2ce8('0x3b')](_[_0x2ce8('0x3c')](_0x26b5e5[_0x2ce8('0x30')],_0x4b377a[_0x2ce8('0x3b')]),_0x89c04b);if(_0x26b5e5[_0x2ce8('0x30')]['filter']){_0x88eca3['where']=_['merge'](_0x88eca3[_0x2ce8('0x3a')],{'$or':_[_0x2ce8('0x2f')](_0x89c04b,function(_0x518674){if(_0x518674['type']!=='VIRTUAL'){var _0x5bc08b={};_0x5bc08b[_0x518674[_0x2ce8('0x29')]]={'$like':'%'+_0x26b5e5['query'][_0x2ce8('0x3d')]+'%'};return _0x5bc08b;}})});}_0x88eca3=_[_0x2ce8('0x3e')]({},_0x88eca3,_0x26b5e5['options']);var _0x1b3e49={'where':_0x88eca3['where']};return db[_0x2ce8('0x3f')][_0x2ce8('0x1d')](_0x1b3e49)[_0x2ce8('0x23')](function(_0x1cdbf2){_0x269dc6['count']=_0x1cdbf2;if(_0x26b5e5[_0x2ce8('0x30')]['includeAll']){_0x88eca3[_0x2ce8('0x40')]=[{'all':!![]}];}return db[_0x2ce8('0x3f')]['findAll'](_0x88eca3);})[_0x2ce8('0x23')](function(_0x44c3e0){_0x269dc6[_0x2ce8('0x41')]=_0x44c3e0;return _0x269dc6;})[_0x2ce8('0x23')](respondWithFilteredResult(_0x4998a5,_0x88eca3))['catch'](handleError(_0x4998a5,null));};exports[_0x2ce8('0x42')]=function(_0xdb17b6,_0x2fbbec){var _0x3130ec={'raw':!![],'where':{'id':_0xdb17b6[_0x2ce8('0x43')]['id']}},_0x568bfd={};_0x568bfd[_0x2ce8('0x2e')]=_[_0x2ce8('0x31')](db[_0x2ce8('0x3f')]['rawAttributes']);_0x568bfd[_0x2ce8('0x30')]=_[_0x2ce8('0x31')](_0xdb17b6[_0x2ce8('0x30')]);_0x568bfd[_0x2ce8('0x3b')]=_['intersection'](_0x568bfd[_0x2ce8('0x2e')],_0x568bfd[_0x2ce8('0x30')]);_0x3130ec[_0x2ce8('0x33')]=_[_0x2ce8('0x32')](_0x568bfd[_0x2ce8('0x2e')],qs[_0x2ce8('0x34')](_0xdb17b6[_0x2ce8('0x30')][_0x2ce8('0x34')]));_0x3130ec[_0x2ce8('0x33')]=_0x3130ec[_0x2ce8('0x33')][_0x2ce8('0x35')]?_0x3130ec[_0x2ce8('0x33')]:_0x568bfd[_0x2ce8('0x2e')];if(_0xdb17b6[_0x2ce8('0x30')][_0x2ce8('0x44')]){_0x3130ec['include']=[{'all':!![]}];}_0x3130ec=_['merge']({},_0x3130ec,_0xdb17b6[_0x2ce8('0x45')]);return db[_0x2ce8('0x3f')][_0x2ce8('0x46')](_0x3130ec)[_0x2ce8('0x23')](handleEntityNotFound(_0x2fbbec,null))[_0x2ce8('0x23')](respondWithResult(_0x2fbbec,null))['catch'](handleError(_0x2fbbec,null));};exports[_0x2ce8('0x47')]=function(_0x557add,_0x266e0c){return db[_0x2ce8('0x3f')][_0x2ce8('0x47')](_0x557add['body'],{})[_0x2ce8('0x23')](function(_0x34ef4e){var _0x235eff=_0x557add[_0x2ce8('0x48')][_0x2ce8('0x49')]({'plain':!![]});if(!_0x235eff)throw new Error(_0x2ce8('0x4a'));if(_0x235eff[_0x2ce8('0x4b')]===_0x2ce8('0x48')){var _0x161457=_0x34ef4e[_0x2ce8('0x49')]({'plain':!![]});var _0x21bb74=_0x2ce8('0x24');return db[_0x2ce8('0x4c')][_0x2ce8('0x46')]({'where':{'name':_0x21bb74,'userProfileId':_0x235eff['userProfileId']},'raw':!![]})[_0x2ce8('0x23')](function(_0x351172){if(_0x351172&&_0x351172['autoAssociation']===0x0){return db['UserProfileResource'][_0x2ce8('0x47')]({'name':_0x161457[_0x2ce8('0x29')],'resourceId':_0x161457['id'],'type':_0x351172[_0x2ce8('0x29')],'sectionId':_0x351172['id']},{})['then'](function(){return _0x34ef4e;});}else{return _0x34ef4e;}})[_0x2ce8('0x4d')](function(_0x4f6454){logger[_0x2ce8('0x27')](_0x2ce8('0x4e'),_0x4f6454);throw _0x4f6454;});}return _0x34ef4e;})[_0x2ce8('0x23')](respondWithResult(_0x266e0c,0xc9))[_0x2ce8('0x4d')](handleError(_0x266e0c,null));};exports['update']=function(_0x201b73,_0x318a99){if(_0x201b73[_0x2ce8('0x4f')]['id']){delete _0x201b73[_0x2ce8('0x4f')]['id'];}return db[_0x2ce8('0x3f')][_0x2ce8('0x46')]({'where':{'id':_0x201b73[_0x2ce8('0x43')]['id']}})['then'](handleEntityNotFound(_0x318a99,null))[_0x2ce8('0x23')](saveUpdates(_0x201b73[_0x2ce8('0x4f')],null))[_0x2ce8('0x23')](respondWithResult(_0x318a99,null))[_0x2ce8('0x4d')](handleError(_0x318a99,null));};exports[_0x2ce8('0x26')]=function(_0xa82131,_0x1d3707){return db['Template'][_0x2ce8('0x46')]({'where':{'id':_0xa82131[_0x2ce8('0x43')]['id']}})[_0x2ce8('0x23')](handleEntityNotFound(_0x1d3707,null))['then'](removeEntity(_0x1d3707,null))[_0x2ce8('0x4d')](handleError(_0x1d3707,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index c68a225..5bc1e46 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 _0x0a36=['rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','util','../../config/logger','api','request-promise','path'];(function(_0x2fdf82,_0x322e7c){var _0x2382f5=function(_0x4d6951){while(--_0x4d6951){_0x2fdf82['push'](_0x2fdf82['shift']());}};_0x2382f5(++_0x322e7c);}(_0x0a36,0x1f3));var _0x60a3=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0x0a36[_0x4d8666];return _0x37175b;};'use strict';var _=require('lodash');var util=require(_0x60a3('0x0'));var logger=require(_0x60a3('0x1'))(_0x60a3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x60a3('0x3'));var fs=require('fs');var path=require(_0x60a3('0x4'));var rimraf=require(_0x60a3('0x5'));var config=require(_0x60a3('0x6'));var attributes=require(_0x60a3('0x7'));module[_0x60a3('0x8')]=function(_0xb9f5ba,_0x370c0c){return _0xb9f5ba[_0x60a3('0x9')](_0x60a3('0xa'),attributes,{'tableName':_0x60a3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2df3=['api','moment','request-promise','path','rimraf','../../config/environment','./template.attributes','define','Template','tools_templates','../../config/logger'];(function(_0x40b2f0,_0xb777fa){var _0x5ac6ad=function(_0x3d4053){while(--_0x3d4053){_0x40b2f0['push'](_0x40b2f0['shift']());}};_0x5ac6ad(++_0xb777fa);}(_0x2df3,0xf1));var _0x32df=function(_0xc0dfa4,_0x3548f2){_0xc0dfa4=_0xc0dfa4-0x0;var _0x13698f=_0x2df3[_0xc0dfa4];return _0x13698f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x32df('0x0'))(_0x32df('0x1'));var moment=require(_0x32df('0x2'));var BPromise=require('bluebird');var rp=require(_0x32df('0x3'));var fs=require('fs');var path=require(_0x32df('0x4'));var rimraf=require(_0x32df('0x5'));var config=require(_0x32df('0x6'));var attributes=require(_0x32df('0x7'));module['exports']=function(_0x237fea,_0x9564e){return _0x237fea[_0x32df('0x8')](_0x32df('0x9'),attributes,{'tableName':_0x32df('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 5b779a5..583f9d1 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 _0xb418=['model','then','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','info','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Template,\x20%s,\x20%s','result','GetTemplate','Template','findAll','options','raw','where','attributes','include','map'];(function(_0x293679,_0x37a3ca){var _0x574d49=function(_0xe08623){while(--_0xe08623){_0x293679['push'](_0x293679['shift']());}};_0x574d49(++_0x37a3ca);}(_0xb418,0x1b6));var _0x8b41=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xb418[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0x8b41('0x0'));var util=require(_0x8b41('0x1'));var moment=require(_0x8b41('0x2'));var BPromise=require(_0x8b41('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b41('0x4'));var db=require(_0x8b41('0x5'))['db'];var utils=require(_0x8b41('0x6'));var logger=require('../../config/logger')(_0x8b41('0x7'));var config=require('../../config/environment');var jayson=require(_0x8b41('0x8'));var client=jayson['client'][_0x8b41('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x394d2d,_0x592c42,_0x154bd8){return new BPromise(function(_0x38a039,_0x518063){return client['request'](_0x394d2d,_0x154bd8)['then'](function(_0x4c22c0){logger[_0x8b41('0xa')]('Template,\x20%s,\x20%s',_0x592c42,'request\x20sent');logger['debug'](_0x8b41('0xb'),_0x592c42,'request\x20sent',JSON[_0x8b41('0xc')](_0x4c22c0));if(_0x4c22c0[_0x8b41('0xd')]){if(_0x4c22c0[_0x8b41('0xd')][_0x8b41('0xe')]===0x1f4){logger[_0x8b41('0xd')]('Template,\x20%s,\x20%s',_0x592c42,_0x4c22c0[_0x8b41('0xd')]['message']);return _0x518063(_0x4c22c0[_0x8b41('0xd')][_0x8b41('0xf')]);}logger[_0x8b41('0xd')](_0x8b41('0x10'),_0x592c42,_0x4c22c0[_0x8b41('0xd')]['message']);return _0x38a039(_0x4c22c0[_0x8b41('0xd')][_0x8b41('0xf')]);}else{logger['info'](_0x8b41('0x10'),_0x592c42,'request\x20sent');_0x38a039(_0x4c22c0[_0x8b41('0x11')]['message']);}})['catch'](function(_0x384ca0){logger[_0x8b41('0xd')](_0x8b41('0x10'),_0x592c42,_0x384ca0);_0x518063(_0x384ca0);});});}exports[_0x8b41('0x12')]=function(_0x3fa054){var _0x49047c=this;return new Promise(function(_0x4d0580,_0x5eb8ac){return db[_0x8b41('0x13')][_0x8b41('0x14')]({'raw':_0x3fa054[_0x8b41('0x15')]?_0x3fa054[_0x8b41('0x15')][_0x8b41('0x16')]===undefined?!![]:![]:!![],'where':_0x3fa054['options']?_0x3fa054[_0x8b41('0x15')][_0x8b41('0x17')]||null:null,'attributes':_0x3fa054['options']?_0x3fa054[_0x8b41('0x15')][_0x8b41('0x18')]||null:null,'limit':_0x3fa054[_0x8b41('0x15')]?_0x3fa054[_0x8b41('0x15')]['limit']||null:null,'include':_0x3fa054[_0x8b41('0x15')]?_0x3fa054[_0x8b41('0x15')][_0x8b41('0x19')]?_[_0x8b41('0x1a')](_0x3fa054['options'][_0x8b41('0x19')],function(_0x42f16d){return{'model':db[_0x42f16d['model']],'as':_0x42f16d['as'],'attributes':_0x42f16d['attributes'],'include':_0x42f16d[_0x8b41('0x19')]?_[_0x8b41('0x1a')](_0x42f16d[_0x8b41('0x19')],function(_0x32d35e){return{'model':db[_0x32d35e[_0x8b41('0x1b')]],'as':_0x32d35e['as'],'attributes':_0x32d35e[_0x8b41('0x18')],'include':_0x32d35e[_0x8b41('0x19')]?_[_0x8b41('0x1a')](_0x32d35e[_0x8b41('0x19')],function(_0x21ff61){return{'model':db[_0x21ff61[_0x8b41('0x1b')]],'as':_0x21ff61['as'],'attributes':_0x21ff61[_0x8b41('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8b41('0x1c')](function(_0x18a254){logger['info'](_0x8b41('0x12'),_0x3fa054);logger[_0x8b41('0x1d')](_0x8b41('0x12'),_0x3fa054,JSON['stringify'](_0x18a254));_0x4d0580(_0x18a254);})[_0x8b41('0x1e')](function(_0x24c13f){logger[_0x8b41('0xd')](_0x8b41('0x12'),_0x24c13f[_0x8b41('0xf')],_0x3fa054);_0x5eb8ac(_0x49047c[_0x8b41('0xd')](0x1f4,_0x24c13f['message']));});});}; \ No newline at end of file +var _0xbf13=['request\x20sent','stringify','error','code','message','result','GetTemplate','Template','options','raw','where','limit','include','map','model','attributes','debug','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','client','request','then','info','Template,\x20%s,\x20%s'];(function(_0x2e63c3,_0x28fcb0){var _0x3d259b=function(_0x537542){while(--_0x537542){_0x2e63c3['push'](_0x2e63c3['shift']());}};_0x3d259b(++_0x28fcb0);}(_0xbf13,0x1e1));var _0x3bf1=function(_0x527058,_0x297d58){_0x527058=_0x527058-0x0;var _0x3d7ef5=_0xbf13[_0x527058];return _0x3d7ef5;};'use strict';var _=require(_0x3bf1('0x0'));var util=require(_0x3bf1('0x1'));var moment=require(_0x3bf1('0x2'));var BPromise=require(_0x3bf1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3bf1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3bf1('0x5'));var logger=require('../../config/logger')(_0x3bf1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3bf1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x281163,_0xf6291e,_0xc61f1a){return new BPromise(function(_0x5f0116,_0x38c623){return client[_0x3bf1('0x8')](_0x281163,_0xc61f1a)[_0x3bf1('0x9')](function(_0x31d2c9){logger[_0x3bf1('0xa')](_0x3bf1('0xb'),_0xf6291e,_0x3bf1('0xc'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0xf6291e,_0x3bf1('0xc'),JSON[_0x3bf1('0xd')](_0x31d2c9));if(_0x31d2c9['error']){if(_0x31d2c9[_0x3bf1('0xe')][_0x3bf1('0xf')]===0x1f4){logger[_0x3bf1('0xe')]('Template,\x20%s,\x20%s',_0xf6291e,_0x31d2c9['error'][_0x3bf1('0x10')]);return _0x38c623(_0x31d2c9[_0x3bf1('0xe')][_0x3bf1('0x10')]);}logger[_0x3bf1('0xe')](_0x3bf1('0xb'),_0xf6291e,_0x31d2c9[_0x3bf1('0xe')][_0x3bf1('0x10')]);return _0x5f0116(_0x31d2c9[_0x3bf1('0xe')]['message']);}else{logger['info'](_0x3bf1('0xb'),_0xf6291e,_0x3bf1('0xc'));_0x5f0116(_0x31d2c9[_0x3bf1('0x11')]['message']);}})['catch'](function(_0x403be0){logger['error']('Template,\x20%s,\x20%s',_0xf6291e,_0x403be0);_0x38c623(_0x403be0);});});}exports[_0x3bf1('0x12')]=function(_0x5ecd87){var _0x43388a=this;return new Promise(function(_0x4ba0df,_0x584986){return db[_0x3bf1('0x13')]['findAll']({'raw':_0x5ecd87[_0x3bf1('0x14')]?_0x5ecd87[_0x3bf1('0x14')][_0x3bf1('0x15')]===undefined?!![]:![]:!![],'where':_0x5ecd87[_0x3bf1('0x14')]?_0x5ecd87[_0x3bf1('0x14')][_0x3bf1('0x16')]||null:null,'attributes':_0x5ecd87[_0x3bf1('0x14')]?_0x5ecd87[_0x3bf1('0x14')]['attributes']||null:null,'limit':_0x5ecd87[_0x3bf1('0x14')]?_0x5ecd87['options'][_0x3bf1('0x17')]||null:null,'include':_0x5ecd87[_0x3bf1('0x14')]?_0x5ecd87[_0x3bf1('0x14')][_0x3bf1('0x18')]?_[_0x3bf1('0x19')](_0x5ecd87[_0x3bf1('0x14')][_0x3bf1('0x18')],function(_0x194d06){return{'model':db[_0x194d06[_0x3bf1('0x1a')]],'as':_0x194d06['as'],'attributes':_0x194d06[_0x3bf1('0x1b')],'include':_0x194d06[_0x3bf1('0x18')]?_[_0x3bf1('0x19')](_0x194d06[_0x3bf1('0x18')],function(_0x46bae6){return{'model':db[_0x46bae6['model']],'as':_0x46bae6['as'],'attributes':_0x46bae6[_0x3bf1('0x1b')],'include':_0x46bae6[_0x3bf1('0x18')]?_[_0x3bf1('0x19')](_0x46bae6[_0x3bf1('0x18')],function(_0x1aa639){return{'model':db[_0x1aa639[_0x3bf1('0x1a')]],'as':_0x1aa639['as'],'attributes':_0x1aa639[_0x3bf1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3bf1('0x9')](function(_0x789e73){logger[_0x3bf1('0xa')](_0x3bf1('0x12'),_0x5ecd87);logger[_0x3bf1('0x1c')](_0x3bf1('0x12'),_0x5ecd87,JSON[_0x3bf1('0xd')](_0x789e73));_0x4ba0df(_0x789e73);})['catch'](function(_0x4fecec){logger['error'](_0x3bf1('0x12'),_0x4fecec['message'],_0x5ecd87);_0x584986(_0x43388a[_0x3bf1('0xe')](0x1f4,_0x4fecec['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index d7f06b1..526f8a9 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 _0xbb7c=['index','show','/:id/all_conditions','isAuthenticated','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAction','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get'];(function(_0xf6e99f,_0x58daf8){var _0x34f260=function(_0x297d26){while(--_0x297d26){_0xf6e99f['push'](_0xf6e99f['shift']());}};_0x34f260(++_0x58daf8);}(_0xbb7c,0xe0));var _0xcbb7=function(_0x31ece1,_0x55b50c){_0x31ece1=_0x31ece1-0x0;var _0x35c2b1=_0xbb7c[_0x31ece1];return _0x35c2b1;};'use strict';var multer=require(_0xcbb7('0x0'));var util=require(_0xcbb7('0x1'));var path=require(_0xcbb7('0x2'));var timeout=require('connect-timeout');var express=require(_0xcbb7('0x3'));var router=express[_0xcbb7('0x4')]();var fs_extra=require(_0xcbb7('0x5'));var auth=require(_0xcbb7('0x6'));var interaction=require(_0xcbb7('0x7'));var config=require('../../config/environment');var controller=require(_0xcbb7('0x8'));router[_0xcbb7('0x9')]('/',auth['isAuthenticated'](),controller[_0xcbb7('0xa')]);router[_0xcbb7('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xcbb7('0xb')]);router[_0xcbb7('0x9')](_0xcbb7('0xc'),auth[_0xcbb7('0xd')](),controller[_0xcbb7('0xe')]);router[_0xcbb7('0x9')](_0xcbb7('0xf'),auth[_0xcbb7('0xd')](),controller[_0xcbb7('0x10')]);router[_0xcbb7('0x9')](_0xcbb7('0x11'),auth['isAuthenticated'](),controller[_0xcbb7('0x12')]);router[_0xcbb7('0x13')]('/',auth[_0xcbb7('0xd')](),controller[_0xcbb7('0x14')]);router[_0xcbb7('0x13')](_0xcbb7('0xc'),auth[_0xcbb7('0xd')](),controller['addAllCondition']);router[_0xcbb7('0x13')](_0xcbb7('0xf'),auth[_0xcbb7('0xd')](),controller['addAnyCondition']);router[_0xcbb7('0x13')](_0xcbb7('0x11'),auth[_0xcbb7('0xd')](),controller[_0xcbb7('0x15')]);router['put'](_0xcbb7('0x16'),auth[_0xcbb7('0xd')](),controller[_0xcbb7('0x17')]);router[_0xcbb7('0x18')](_0xcbb7('0x16'),auth['isAuthenticated'](),controller['destroy']);module[_0xcbb7('0x19')]=router; \ No newline at end of file +var _0x83eb=['addAllCondition','addAnyCondition','put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','post'];(function(_0x1eb541,_0x1de45d){var _0x4c22e2=function(_0x25e804){while(--_0x25e804){_0x1eb541['push'](_0x1eb541['shift']());}};_0x4c22e2(++_0x1de45d);}(_0x83eb,0x1e5));var _0xb83e=function(_0x4892e9,_0x40a705){_0x4892e9=_0x4892e9-0x0;var _0x48f4c0=_0x83eb[_0x4892e9];return _0x48f4c0;};'use strict';var multer=require(_0xb83e('0x0'));var util=require('util');var path=require(_0xb83e('0x1'));var timeout=require(_0xb83e('0x2'));var express=require(_0xb83e('0x3'));var router=express[_0xb83e('0x4')]();var fs_extra=require(_0xb83e('0x5'));var auth=require(_0xb83e('0x6'));var interaction=require(_0xb83e('0x7'));var config=require(_0xb83e('0x8'));var controller=require('./trigger.controller');router[_0xb83e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb83e('0x9')](_0xb83e('0xa'),auth[_0xb83e('0xb')](),controller[_0xb83e('0xc')]);router[_0xb83e('0x9')](_0xb83e('0xd'),auth['isAuthenticated'](),controller[_0xb83e('0xe')]);router['get'](_0xb83e('0xf'),auth['isAuthenticated'](),controller[_0xb83e('0x10')]);router[_0xb83e('0x9')](_0xb83e('0x11'),auth[_0xb83e('0xb')](),controller['getActions']);router['post']('/',auth[_0xb83e('0xb')](),controller['create']);router[_0xb83e('0x12')](_0xb83e('0xd'),auth[_0xb83e('0xb')](),controller[_0xb83e('0x13')]);router[_0xb83e('0x12')](_0xb83e('0xf'),auth[_0xb83e('0xb')](),controller[_0xb83e('0x14')]);router['post'](_0xb83e('0x11'),auth[_0xb83e('0xb')](),controller['addAction']);router[_0xb83e('0x15')](_0xb83e('0xa'),auth[_0xb83e('0xb')](),controller[_0xb83e('0x16')]);router['delete'](_0xb83e('0xa'),auth['isAuthenticated'](),controller[_0xb83e('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index b52ca09..6cc9c54 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 _0xe1a2=['STRING','BOOLEAN','sequelize'];(function(_0x3b6fca,_0x38a543){var _0x54667e=function(_0x3a54ea){while(--_0x3a54ea){_0x3b6fca['push'](_0x3b6fca['shift']());}};_0x54667e(++_0x38a543);}(_0xe1a2,0x191));var _0x2e1a=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xe1a2[_0x344a3f];return _0x264712;};'use strict';var Sequelize=require(_0x2e1a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2e1a('0x1')]},'description':{'type':Sequelize[_0x2e1a('0x1')]},'status':{'type':Sequelize[_0x2e1a('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xb011=['BOOLEAN','exports','STRING'];(function(_0x286e0c,_0x7d342b){var _0x4148f5=function(_0x1d1018){while(--_0x1d1018){_0x286e0c['push'](_0x286e0c['shift']());}};_0x4148f5(++_0x7d342b);}(_0xb011,0x12a));var _0x1b01=function(_0x25d327,_0x44be76){_0x25d327=_0x25d327-0x0;var _0x4a483d=_0xb011[_0x25d327];return _0x4a483d;};'use strict';var Sequelize=require('sequelize');module[_0x1b01('0x0')]={'name':{'type':Sequelize[_0x1b01('0x1')]},'channel':{'type':Sequelize[_0x1b01('0x1')]},'description':{'type':Sequelize[_0x1b01('0x1')]},'status':{'type':Sequelize[_0x1b01('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 9b558f6..f83f5b6 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 _0xed9b=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','then','get','Triggers','destroy','error','stack','name','send','index','map','Trigger','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring'];(function(_0x1894b1,_0x44a9ad){var _0xc7023c=function(_0x2481fc){while(--_0x2481fc){_0x1894b1['push'](_0x1894b1['shift']());}};_0xc7023c(++_0x44a9ad);}(_0xed9b,0x167));var _0xbed9=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0xed9b[_0x4cce65];return _0x4d1b45;};'use strict';var emlformat=require(_0xbed9('0x0'));var rimraf=require(_0xbed9('0x1'));var zipdir=require(_0xbed9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbed9('0x3'));var moment=require(_0xbed9('0x4'));var BPromise=require(_0xbed9('0x5'));var Mustache=require(_0xbed9('0x6'));var util=require(_0xbed9('0x7'));var path=require(_0xbed9('0x8'));var sox=require(_0xbed9('0x9'));var csv=require(_0xbed9('0xa'));var ejs=require(_0xbed9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbed9('0xc'));var squel=require(_0xbed9('0xd'));var crypto=require('crypto');var jsforce=require(_0xbed9('0xe'));var deskjs=require(_0xbed9('0xf'));var toCsv=require(_0xbed9('0xa'));var querystring=require(_0xbed9('0x10'));var Papa=require(_0xbed9('0x11'));var Redis=require('ioredis');var authService=require(_0xbed9('0x12'));var qs=require(_0xbed9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbed9('0x14'));var logger=require(_0xbed9('0x15'))(_0xbed9('0x16'));var utils=require('../../config/utils');var config=require(_0xbed9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbed9('0x18'))['db'];function respondWithStatusCode(_0x287c1d,_0x3d5980){_0x3d5980=_0x3d5980||0xcc;return function(_0x333f64){if(_0x333f64){return _0x287c1d[_0xbed9('0x19')](_0x3d5980);}return _0x287c1d['status'](_0x3d5980)[_0xbed9('0x1a')]();};}function respondWithResult(_0x2f76d8,_0x1dfd9f){_0x1dfd9f=_0x1dfd9f||0xc8;return function(_0x1f22ca){if(_0x1f22ca){return _0x2f76d8['status'](_0x1dfd9f)['json'](_0x1f22ca);}};}function respondWithFilteredResult(_0x29d2ff,_0x1ff798){return function(_0x334071){if(_0x334071){var _0x4a426f=typeof _0x1ff798[_0xbed9('0x1b')]===_0xbed9('0x1c')&&typeof _0x1ff798[_0xbed9('0x1d')]===_0xbed9('0x1c');var _0x23675e=_0x334071[_0xbed9('0x1e')];var _0x2b3a43=_0x4a426f?0x0:_0x1ff798['offset'];var _0x1cd957=_0x4a426f?_0x334071[_0xbed9('0x1e')]:_0x1ff798[_0xbed9('0x1b')]+_0x1ff798[_0xbed9('0x1d')];var _0x398a9e;if(_0x1cd957>=_0x23675e){_0x1cd957=_0x23675e;_0x398a9e=0xc8;}else{_0x398a9e=0xce;}_0x29d2ff[_0xbed9('0x1f')](_0x398a9e);return _0x29d2ff[_0xbed9('0x20')](_0xbed9('0x21'),_0x2b3a43+'-'+_0x1cd957+'/'+_0x23675e)[_0xbed9('0x22')](_0x334071);}return null;};}function patchUpdates(_0x4f1113){return function(_0x23efb5){try{jsonpatch[_0xbed9('0x23')](_0x23efb5,_0x4f1113,!![]);}catch(_0x21135d){return BPromise[_0xbed9('0x24')](_0x21135d);}return _0x23efb5[_0xbed9('0x25')]();};}function saveUpdates(_0x36dd85,_0xb348f0){return function(_0x5de161){if(_0x5de161){return _0x5de161['update'](_0x36dd85)['then'](function(_0x21c10d){return _0x21c10d;});}return null;};}function removeEntity(_0x25782d,_0x19fa10){return function(_0x19ea91){if(_0x19ea91){return _0x19ea91['destroy']()[_0xbed9('0x26')](function(){var _0x171c90=_0x19ea91[_0xbed9('0x27')]({'plain':!![]});var _0x17772=_0xbed9('0x28');return db['UserProfileResource'][_0xbed9('0x29')]({'where':{'type':_0x17772,'resourceId':_0x171c90['id']}})['then'](function(){return _0x19ea91;});})[_0xbed9('0x26')](function(){_0x25782d[_0xbed9('0x1f')](0xcc)[_0xbed9('0x1a')]();});}};}function handleEntityNotFound(_0x3b4caa,_0x23c209){return function(_0xadb15f){if(!_0xadb15f){_0x3b4caa[_0xbed9('0x19')](0x194);}return _0xadb15f;};}function handleError(_0x5407aa,_0x353e67){_0x353e67=_0x353e67||0x1f4;return function(_0x4cc585){logger[_0xbed9('0x2a')](_0x4cc585[_0xbed9('0x2b')]);if(_0x4cc585[_0xbed9('0x2c')]){delete _0x4cc585[_0xbed9('0x2c')];}_0x5407aa[_0xbed9('0x1f')](_0x353e67)[_0xbed9('0x2d')](_0x4cc585);};}exports[_0xbed9('0x2e')]=function(_0x326f11,_0x1f1150){var _0x5d4595={},_0x12884e={},_0x31e203={'count':0x0,'rows':[]};var _0x1c7b38=_[_0xbed9('0x2f')](db[_0xbed9('0x30')][_0xbed9('0x31')],function(_0x35ac58){return{'name':_0x35ac58['fieldName'],'type':_0x35ac58[_0xbed9('0x32')]['key']};});_0x12884e[_0xbed9('0x33')]=_[_0xbed9('0x2f')](_0x1c7b38,_0xbed9('0x2c'));_0x12884e[_0xbed9('0x34')]=_[_0xbed9('0x35')](_0x326f11['query']);_0x12884e['filters']=_[_0xbed9('0x36')](_0x12884e[_0xbed9('0x33')],_0x12884e[_0xbed9('0x34')]);_0x5d4595[_0xbed9('0x37')]=_[_0xbed9('0x36')](_0x12884e[_0xbed9('0x33')],qs[_0xbed9('0x38')](_0x326f11[_0xbed9('0x34')][_0xbed9('0x38')]));_0x5d4595[_0xbed9('0x37')]=_0x5d4595[_0xbed9('0x37')][_0xbed9('0x39')]?_0x5d4595[_0xbed9('0x37')]:_0x12884e['model'];if(!_0x326f11[_0xbed9('0x34')][_0xbed9('0x3a')](_0xbed9('0x3b'))){_0x5d4595['limit']=qs[_0xbed9('0x1d')](_0x326f11[_0xbed9('0x34')][_0xbed9('0x1d')]);_0x5d4595[_0xbed9('0x1b')]=qs[_0xbed9('0x1b')](_0x326f11[_0xbed9('0x34')]['offset']);}_0x5d4595[_0xbed9('0x3c')]=qs[_0xbed9('0x3d')](_0x326f11[_0xbed9('0x34')][_0xbed9('0x3d')]);_0x5d4595[_0xbed9('0x3e')]=qs[_0xbed9('0x3f')](_[_0xbed9('0x40')](_0x326f11[_0xbed9('0x34')],_0x12884e[_0xbed9('0x3f')]),_0x1c7b38);if(_0x326f11[_0xbed9('0x34')][_0xbed9('0x41')]){_0x5d4595[_0xbed9('0x3e')]=_[_0xbed9('0x42')](_0x5d4595['where'],{'$or':_['map'](_0x1c7b38,function(_0xa53e3f){if(_0xa53e3f[_0xbed9('0x32')]!==_0xbed9('0x43')){var _0x2f23ab={};_0x2f23ab[_0xa53e3f[_0xbed9('0x2c')]]={'$like':'%'+_0x326f11[_0xbed9('0x34')][_0xbed9('0x41')]+'%'};return _0x2f23ab;}})});}_0x5d4595=_['merge']({},_0x5d4595,_0x326f11[_0xbed9('0x44')]);var _0x1b3630={'where':_0x5d4595[_0xbed9('0x3e')]};return db[_0xbed9('0x30')][_0xbed9('0x1e')](_0x1b3630)[_0xbed9('0x26')](function(_0x55b806){_0x31e203[_0xbed9('0x1e')]=_0x55b806;if(_0x326f11[_0xbed9('0x34')][_0xbed9('0x45')]){_0x5d4595[_0xbed9('0x46')]=[{'all':!![]}];}return db[_0xbed9('0x30')]['findAll'](_0x5d4595);})[_0xbed9('0x26')](function(_0x1b9f93){_0x31e203[_0xbed9('0x47')]=_0x1b9f93;return _0x31e203;})[_0xbed9('0x26')](respondWithFilteredResult(_0x1f1150,_0x5d4595))[_0xbed9('0x48')](handleError(_0x1f1150,null));};exports['show']=function(_0x224f71,_0x3d6f43){var _0x507987={'raw':![],'where':{'id':_0x224f71[_0xbed9('0x49')]['id']}},_0x5210f8={};_0x5210f8[_0xbed9('0x33')]=_[_0xbed9('0x35')](db[_0xbed9('0x30')]['rawAttributes']);_0x5210f8[_0xbed9('0x34')]=_[_0xbed9('0x35')](_0x224f71[_0xbed9('0x34')]);_0x5210f8[_0xbed9('0x3f')]=_[_0xbed9('0x36')](_0x5210f8[_0xbed9('0x33')],_0x5210f8[_0xbed9('0x34')]);_0x507987[_0xbed9('0x37')]=_['intersection'](_0x5210f8[_0xbed9('0x33')],qs[_0xbed9('0x38')](_0x224f71['query'][_0xbed9('0x38')]));_0x507987[_0xbed9('0x37')]=_0x507987[_0xbed9('0x37')][_0xbed9('0x39')]?_0x507987[_0xbed9('0x37')]:_0x5210f8[_0xbed9('0x33')];if(_0x224f71[_0xbed9('0x34')][_0xbed9('0x45')]){_0x507987[_0xbed9('0x46')]=[{'all':!![]}];}_0x507987=_['merge']({},_0x507987,_0x224f71[_0xbed9('0x44')]);return db[_0xbed9('0x30')][_0xbed9('0x4a')](_0x507987)[_0xbed9('0x26')](handleEntityNotFound(_0x3d6f43,null))[_0xbed9('0x26')](respondWithResult(_0x3d6f43,null))[_0xbed9('0x48')](handleError(_0x3d6f43,null));};exports[_0xbed9('0x4b')]=function(_0x36455a,_0x55fa36){return db[_0xbed9('0x30')][_0xbed9('0x4b')](_0x36455a['body'],{})[_0xbed9('0x26')](function(_0x42cef3){var _0x148aaa=_0x36455a[_0xbed9('0x4c')]['get']({'plain':!![]});if(!_0x148aaa)throw new Error(_0xbed9('0x4d'));if(_0x148aaa['role']===_0xbed9('0x4c')){var _0x2a2c01=_0x42cef3[_0xbed9('0x27')]({'plain':!![]});var _0x5bfbe2=_0xbed9('0x28');return db[_0xbed9('0x4e')][_0xbed9('0x4a')]({'where':{'name':_0x5bfbe2,'userProfileId':_0x148aaa[_0xbed9('0x4f')]},'raw':!![]})[_0xbed9('0x26')](function(_0xa82f7){if(_0xa82f7&&_0xa82f7['autoAssociation']===0x0){return db[_0xbed9('0x50')][_0xbed9('0x4b')]({'name':_0x2a2c01['name'],'resourceId':_0x2a2c01['id'],'type':_0xa82f7[_0xbed9('0x2c')],'sectionId':_0xa82f7['id']},{})[_0xbed9('0x26')](function(){return _0x42cef3;});}else{return _0x42cef3;}})[_0xbed9('0x48')](function(_0x25fbf5){logger[_0xbed9('0x2a')](_0xbed9('0x51'),_0x25fbf5);throw _0x25fbf5;});}return _0x42cef3;})['then'](respondWithResult(_0x55fa36,0xc9))[_0xbed9('0x48')](handleError(_0x55fa36,null));};exports[_0xbed9('0x52')]=function(_0x29db7c,_0x1c59c8){if(_0x29db7c[_0xbed9('0x53')]['id']){delete _0x29db7c[_0xbed9('0x53')]['id'];}return db[_0xbed9('0x30')][_0xbed9('0x4a')]({'where':{'id':_0x29db7c[_0xbed9('0x49')]['id']}})[_0xbed9('0x26')](handleEntityNotFound(_0x1c59c8,null))[_0xbed9('0x26')](saveUpdates(_0x29db7c[_0xbed9('0x53')],null))[_0xbed9('0x26')](respondWithResult(_0x1c59c8,null))['catch'](handleError(_0x1c59c8,null));};exports['destroy']=function(_0x25d05e,_0x16c5b5){return db[_0xbed9('0x30')][_0xbed9('0x4a')]({'where':{'id':_0x25d05e[_0xbed9('0x49')]['id']}})[_0xbed9('0x26')](handleEntityNotFound(_0x16c5b5,null))[_0xbed9('0x26')](removeEntity(_0x16c5b5,null))[_0xbed9('0x48')](handleError(_0x16c5b5,null));};exports['addAllCondition']=function(_0x21f9b1,_0x4a24d3,_0x5e3b0e){if(_0x21f9b1[_0xbed9('0x53')]['id']){delete _0x21f9b1[_0xbed9('0x53')]['id'];}return db[_0xbed9('0x30')][_0xbed9('0x4a')]({'where':{'id':_0x21f9b1['params']['id']}})[_0xbed9('0x26')](handleEntityNotFound(_0x4a24d3,null))[_0xbed9('0x26')](function(_0x5600e9){if(_0x5600e9){_0x21f9b1['body']['TriggerAllId']=_0x5600e9['id'];return db[_0xbed9('0x54')][_0xbed9('0x4b')](_0x21f9b1[_0xbed9('0x53')]);}})[_0xbed9('0x26')](respondWithResult(_0x4a24d3,null))[_0xbed9('0x48')](handleError(_0x4a24d3,null));};exports[_0xbed9('0x55')]=function(_0x2952b7,_0x162727,_0x10b774){if(_0x2952b7[_0xbed9('0x53')]['id']){delete _0x2952b7[_0xbed9('0x53')]['id'];}return db[_0xbed9('0x30')]['find']({'where':{'id':_0x2952b7[_0xbed9('0x49')]['id']}})['then'](handleEntityNotFound(_0x162727,null))['then'](function(_0x35e563){if(_0x35e563){_0x2952b7[_0xbed9('0x53')][_0xbed9('0x56')]=_0x35e563['id'];return db['Condition'][_0xbed9('0x4b')](_0x2952b7[_0xbed9('0x53')]);}})['then'](respondWithResult(_0x162727,null))[_0xbed9('0x48')](handleError(_0x162727,null));};exports[_0xbed9('0x57')]=function(_0x2e9b5c,_0x23dcdb,_0x5bec15){var _0x4ffeb3={};var _0x3ea6fb={};var _0x624b77;var _0x56c364;return db[_0xbed9('0x30')][_0xbed9('0x58')]({'where':{'id':_0x2e9b5c['params']['id']}})['then'](handleEntityNotFound(_0x23dcdb,null))['then'](function(_0x595361){if(_0x595361){_0x624b77=_0x595361;_0x3ea6fb[_0xbed9('0x33')]=_[_0xbed9('0x35')](db['Condition'][_0xbed9('0x31')]);_0x3ea6fb[_0xbed9('0x34')]=_['keys'](_0x2e9b5c['query']);_0x3ea6fb[_0xbed9('0x3f')]=_[_0xbed9('0x36')](_0x3ea6fb['model'],_0x3ea6fb[_0xbed9('0x34')]);_0x4ffeb3[_0xbed9('0x37')]=_[_0xbed9('0x36')](_0x3ea6fb[_0xbed9('0x33')],qs[_0xbed9('0x38')](_0x2e9b5c[_0xbed9('0x34')]['fields']));_0x4ffeb3[_0xbed9('0x37')]=_0x4ffeb3[_0xbed9('0x37')][_0xbed9('0x39')]?_0x4ffeb3[_0xbed9('0x37')]:_0x3ea6fb['model'];_0x4ffeb3[_0xbed9('0x3c')]=qs['sort'](_0x2e9b5c['query'][_0xbed9('0x3d')]);_0x4ffeb3[_0xbed9('0x3e')]=qs[_0xbed9('0x3f')](_[_0xbed9('0x40')](_0x2e9b5c[_0xbed9('0x34')],_0x3ea6fb[_0xbed9('0x3f')]));if(_0x2e9b5c[_0xbed9('0x34')]['filter']){_0x4ffeb3[_0xbed9('0x3e')]=_[_0xbed9('0x42')](_0x4ffeb3[_0xbed9('0x3e')],{'$or':_[_0xbed9('0x2f')](_0x4ffeb3['attributes'],function(_0x2c9be2){var _0xc4206a={};_0xc4206a[_0x2c9be2]={'$like':'%'+_0x2e9b5c[_0xbed9('0x34')][_0xbed9('0x41')]+'%'};return _0xc4206a;})});}_0x4ffeb3=_[_0xbed9('0x42')]({},_0x4ffeb3,_0x2e9b5c[_0xbed9('0x44')]);return _0x624b77[_0xbed9('0x57')](_0x4ffeb3);}})['then'](function(_0x2de283){if(_0x2de283){_0x56c364=_0x2de283[_0xbed9('0x39')];if(!_0x2e9b5c['query'][_0xbed9('0x3a')](_0xbed9('0x3b'))){_0x4ffeb3['limit']=qs[_0xbed9('0x1d')](_0x2e9b5c[_0xbed9('0x34')][_0xbed9('0x1d')]);_0x4ffeb3['offset']=qs[_0xbed9('0x1b')](_0x2e9b5c[_0xbed9('0x34')][_0xbed9('0x1b')]);}return _0x624b77['getAllConditions'](_0x4ffeb3);}})[_0xbed9('0x26')](function(_0x37aeea){if(_0x37aeea){return _0x37aeea?{'count':_0x56c364,'rows':_0x37aeea}:null;}})[_0xbed9('0x26')](respondWithResult(_0x23dcdb,null))[_0xbed9('0x48')](handleError(_0x23dcdb,null));};exports['getAnyConditions']=function(_0x4e21de,_0x65bdfc,_0x176bdb){var _0x2823a8={};var _0x1a701e={};var _0x5ad709;var _0x2d196c;return db[_0xbed9('0x30')][_0xbed9('0x58')]({'where':{'id':_0x4e21de[_0xbed9('0x49')]['id']}})['then'](handleEntityNotFound(_0x65bdfc,null))['then'](function(_0x5ec186){if(_0x5ec186){_0x5ad709=_0x5ec186;_0x1a701e[_0xbed9('0x33')]=_['keys'](db[_0xbed9('0x54')][_0xbed9('0x31')]);_0x1a701e[_0xbed9('0x34')]=_[_0xbed9('0x35')](_0x4e21de[_0xbed9('0x34')]);_0x1a701e[_0xbed9('0x3f')]=_['intersection'](_0x1a701e[_0xbed9('0x33')],_0x1a701e[_0xbed9('0x34')]);_0x2823a8[_0xbed9('0x37')]=_[_0xbed9('0x36')](_0x1a701e[_0xbed9('0x33')],qs[_0xbed9('0x38')](_0x4e21de[_0xbed9('0x34')][_0xbed9('0x38')]));_0x2823a8[_0xbed9('0x37')]=_0x2823a8[_0xbed9('0x37')][_0xbed9('0x39')]?_0x2823a8['attributes']:_0x1a701e[_0xbed9('0x33')];_0x2823a8['order']=qs[_0xbed9('0x3d')](_0x4e21de[_0xbed9('0x34')][_0xbed9('0x3d')]);_0x2823a8[_0xbed9('0x3e')]=qs[_0xbed9('0x3f')](_['pick'](_0x4e21de['query'],_0x1a701e['filters']));if(_0x4e21de[_0xbed9('0x34')][_0xbed9('0x41')]){_0x2823a8[_0xbed9('0x3e')]=_['merge'](_0x2823a8[_0xbed9('0x3e')],{'$or':_[_0xbed9('0x2f')](_0x2823a8[_0xbed9('0x37')],function(_0x4312dc){var _0x2017a9={};_0x2017a9[_0x4312dc]={'$like':'%'+_0x4e21de[_0xbed9('0x34')][_0xbed9('0x41')]+'%'};return _0x2017a9;})});}_0x2823a8=_[_0xbed9('0x42')]({},_0x2823a8,_0x4e21de['options']);return _0x5ad709[_0xbed9('0x59')](_0x2823a8);}})[_0xbed9('0x26')](function(_0x3490cd){if(_0x3490cd){_0x2d196c=_0x3490cd[_0xbed9('0x39')];if(!_0x4e21de[_0xbed9('0x34')][_0xbed9('0x3a')](_0xbed9('0x3b'))){_0x2823a8[_0xbed9('0x1d')]=qs[_0xbed9('0x1d')](_0x4e21de[_0xbed9('0x34')]['limit']);_0x2823a8['offset']=qs[_0xbed9('0x1b')](_0x4e21de['query'][_0xbed9('0x1b')]);}return _0x5ad709[_0xbed9('0x59')](_0x2823a8);}})['then'](function(_0x3262fd){if(_0x3262fd){return _0x3262fd?{'count':_0x2d196c,'rows':_0x3262fd}:null;}})['then'](respondWithResult(_0x65bdfc,null))[_0xbed9('0x48')](handleError(_0x65bdfc,null));};exports[_0xbed9('0x5a')]=function(_0x47a510,_0x1615cd,_0x237b49){if(_0x47a510[_0xbed9('0x53')]['id']){delete _0x47a510['body']['id'];}return db[_0xbed9('0x30')][_0xbed9('0x4a')]({'where':{'id':_0x47a510[_0xbed9('0x49')]['id']}})[_0xbed9('0x26')](handleEntityNotFound(_0x1615cd,null))['then'](function(_0x3dcbb0){if(_0x3dcbb0){_0x47a510[_0xbed9('0x53')][_0xbed9('0x5b')]=_0x3dcbb0['id'];return db[_0xbed9('0x5c')][_0xbed9('0x4b')](_0x47a510[_0xbed9('0x53')]);}})[_0xbed9('0x26')](respondWithResult(_0x1615cd,null))['catch'](handleError(_0x1615cd,null));};exports[_0xbed9('0x5d')]=function(_0x2df950,_0x422edb,_0x4b0356){var _0x5032d1={};var _0x2e1e70={};var _0x330a36;var _0x2a5553;return db['Trigger'][_0xbed9('0x58')]({'where':{'id':_0x2df950[_0xbed9('0x49')]['id']}})[_0xbed9('0x26')](handleEntityNotFound(_0x422edb,null))['then'](function(_0xaa8afb){if(_0xaa8afb){_0x330a36=_0xaa8afb;_0x2e1e70[_0xbed9('0x33')]=_[_0xbed9('0x35')](db['Action']['rawAttributes']);_0x2e1e70[_0xbed9('0x34')]=_[_0xbed9('0x35')](_0x2df950['query']);_0x2e1e70[_0xbed9('0x3f')]=_[_0xbed9('0x36')](_0x2e1e70[_0xbed9('0x33')],_0x2e1e70[_0xbed9('0x34')]);_0x5032d1[_0xbed9('0x37')]=_[_0xbed9('0x36')](_0x2e1e70[_0xbed9('0x33')],qs[_0xbed9('0x38')](_0x2df950[_0xbed9('0x34')][_0xbed9('0x38')]));_0x5032d1[_0xbed9('0x37')]=_0x5032d1['attributes'][_0xbed9('0x39')]?_0x5032d1[_0xbed9('0x37')]:_0x2e1e70[_0xbed9('0x33')];_0x5032d1[_0xbed9('0x3c')]=qs[_0xbed9('0x3d')](_0x2df950[_0xbed9('0x34')][_0xbed9('0x3d')]);_0x5032d1['where']=qs[_0xbed9('0x3f')](_[_0xbed9('0x40')](_0x2df950[_0xbed9('0x34')],_0x2e1e70[_0xbed9('0x3f')]));if(_0x2df950[_0xbed9('0x34')]['filter']){_0x5032d1['where']=_['merge'](_0x5032d1[_0xbed9('0x3e')],{'$or':_[_0xbed9('0x2f')](_0x5032d1[_0xbed9('0x37')],function(_0x419484){var _0x99ff37={};_0x99ff37[_0x419484]={'$like':'%'+_0x2df950['query'][_0xbed9('0x41')]+'%'};return _0x99ff37;})});}_0x5032d1=_['merge']({},_0x5032d1,_0x2df950[_0xbed9('0x44')]);return _0x330a36[_0xbed9('0x5d')](_0x5032d1);}})[_0xbed9('0x26')](function(_0x437ae5){if(_0x437ae5){_0x2a5553=_0x437ae5[_0xbed9('0x39')];if(!_0x2df950[_0xbed9('0x34')][_0xbed9('0x3a')](_0xbed9('0x3b'))){_0x5032d1['limit']=qs[_0xbed9('0x1d')](_0x2df950[_0xbed9('0x34')][_0xbed9('0x1d')]);_0x5032d1[_0xbed9('0x1b')]=qs[_0xbed9('0x1b')](_0x2df950['query'][_0xbed9('0x1b')]);}return _0x330a36['getActions'](_0x5032d1);}})[_0xbed9('0x26')](function(_0x3bf148){if(_0x3bf148){return _0x3bf148?{'count':_0x2a5553,'rows':_0x3bf148}:null;}})[_0xbed9('0x26')](respondWithResult(_0x422edb,null))[_0xbed9('0x48')](handleError(_0x422edb,null));}; \ No newline at end of file +var _0x3d27=['papaparse','ioredis','../../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','reject','update','then','destroy','get','Triggers','end','error','stack','name','map','Trigger','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','includeAll','include','findAll','rows','params','length','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','UserProfileResource','create','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','options','getAllConditions','pick','getAnyConditions','addAction','Action','getActions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x5a3db3,_0x392faf){var _0x505e95=function(_0x2095f7){while(--_0x2095f7){_0x5a3db3['push'](_0x5a3db3['shift']());}};_0x505e95(++_0x392faf);}(_0x3d27,0x104));var _0x73d2=function(_0x308374,_0x550e85){_0x308374=_0x308374-0x0;var _0x1f71e0=_0x3d27[_0x308374];return _0x1f71e0;};'use strict';var emlformat=require(_0x73d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x73d2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x73d2('0x2'));var moment=require(_0x73d2('0x3'));var BPromise=require(_0x73d2('0x4'));var Mustache=require(_0x73d2('0x5'));var util=require(_0x73d2('0x6'));var path=require('path');var sox=require(_0x73d2('0x7'));var csv=require(_0x73d2('0x8'));var ejs=require(_0x73d2('0x9'));var fs=require('fs');var fs_extra=require(_0x73d2('0xa'));var _=require(_0x73d2('0xb'));var squel=require(_0x73d2('0xc'));var crypto=require('crypto');var jsforce=require(_0x73d2('0xd'));var deskjs=require(_0x73d2('0xe'));var toCsv=require(_0x73d2('0x8'));var querystring=require(_0x73d2('0xf'));var Papa=require(_0x73d2('0x10'));var Redis=require(_0x73d2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x73d2('0x12'));var as=require(_0x73d2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x73d2('0x14'))(_0x73d2('0x15'));var utils=require(_0x73d2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x73d2('0x17'));var db=require(_0x73d2('0x18'))['db'];function respondWithStatusCode(_0x172001,_0x1ce32f){_0x1ce32f=_0x1ce32f||0xcc;return function(_0x579ff3){if(_0x579ff3){return _0x172001[_0x73d2('0x19')](_0x1ce32f);}return _0x172001[_0x73d2('0x1a')](_0x1ce32f)['end']();};}function respondWithResult(_0x5da8f5,_0x3a34c4){_0x3a34c4=_0x3a34c4||0xc8;return function(_0x49f4c3){if(_0x49f4c3){return _0x5da8f5[_0x73d2('0x1a')](_0x3a34c4)[_0x73d2('0x1b')](_0x49f4c3);}};}function respondWithFilteredResult(_0xe2ba90,_0xec4645){return function(_0x509baf){if(_0x509baf){var _0xa74c31=typeof _0xec4645[_0x73d2('0x1c')]===_0x73d2('0x1d')&&typeof _0xec4645[_0x73d2('0x1e')]===_0x73d2('0x1d');var _0x4b0cd7=_0x509baf[_0x73d2('0x1f')];var _0x5df76a=_0xa74c31?0x0:_0xec4645[_0x73d2('0x1c')];var _0x584e07=_0xa74c31?_0x509baf['count']:_0xec4645[_0x73d2('0x1c')]+_0xec4645['limit'];var _0x451597;if(_0x584e07>=_0x4b0cd7){_0x584e07=_0x4b0cd7;_0x451597=0xc8;}else{_0x451597=0xce;}_0xe2ba90[_0x73d2('0x1a')](_0x451597);return _0xe2ba90[_0x73d2('0x20')](_0x73d2('0x21'),_0x5df76a+'-'+_0x584e07+'/'+_0x4b0cd7)[_0x73d2('0x1b')](_0x509baf);}return null;};}function patchUpdates(_0x5b87d2){return function(_0x5b43a5){try{jsonpatch[_0x73d2('0x22')](_0x5b43a5,_0x5b87d2,!![]);}catch(_0x48f9c0){return BPromise[_0x73d2('0x23')](_0x48f9c0);}return _0x5b43a5['save']();};}function saveUpdates(_0x4b6824,_0x3ee9ac){return function(_0x44936f){if(_0x44936f){return _0x44936f[_0x73d2('0x24')](_0x4b6824)[_0x73d2('0x25')](function(_0x35ddac){return _0x35ddac;});}return null;};}function removeEntity(_0x5e4b33,_0x3b6c74){return function(_0x4fa0b3){if(_0x4fa0b3){return _0x4fa0b3[_0x73d2('0x26')]()[_0x73d2('0x25')](function(){var _0x28beef=_0x4fa0b3[_0x73d2('0x27')]({'plain':!![]});var _0x16e6ef=_0x73d2('0x28');return db['UserProfileResource'][_0x73d2('0x26')]({'where':{'type':_0x16e6ef,'resourceId':_0x28beef['id']}})[_0x73d2('0x25')](function(){return _0x4fa0b3;});})[_0x73d2('0x25')](function(){_0x5e4b33['status'](0xcc)[_0x73d2('0x29')]();});}};}function handleEntityNotFound(_0x4cfb2c,_0x3df102){return function(_0x2141b1){if(!_0x2141b1){_0x4cfb2c[_0x73d2('0x19')](0x194);}return _0x2141b1;};}function handleError(_0x264c33,_0x133d5b){_0x133d5b=_0x133d5b||0x1f4;return function(_0x253ca7){logger[_0x73d2('0x2a')](_0x253ca7[_0x73d2('0x2b')]);if(_0x253ca7[_0x73d2('0x2c')]){delete _0x253ca7[_0x73d2('0x2c')];}_0x264c33[_0x73d2('0x1a')](_0x133d5b)['send'](_0x253ca7);};}exports['index']=function(_0x802475,_0x264d64){var _0x5cf8b={},_0x1a5669={},_0x3c2618={'count':0x0,'rows':[]};var _0x3f75d9=_[_0x73d2('0x2d')](db[_0x73d2('0x2e')][_0x73d2('0x2f')],function(_0x40b5eb){return{'name':_0x40b5eb['fieldName'],'type':_0x40b5eb[_0x73d2('0x30')][_0x73d2('0x31')]};});_0x1a5669[_0x73d2('0x32')]=_[_0x73d2('0x2d')](_0x3f75d9,_0x73d2('0x2c'));_0x1a5669[_0x73d2('0x33')]=_[_0x73d2('0x34')](_0x802475[_0x73d2('0x33')]);_0x1a5669['filters']=_[_0x73d2('0x35')](_0x1a5669[_0x73d2('0x32')],_0x1a5669['query']);_0x5cf8b[_0x73d2('0x36')]=_[_0x73d2('0x35')](_0x1a5669[_0x73d2('0x32')],qs[_0x73d2('0x37')](_0x802475['query'][_0x73d2('0x37')]));_0x5cf8b['attributes']=_0x5cf8b['attributes']['length']?_0x5cf8b[_0x73d2('0x36')]:_0x1a5669[_0x73d2('0x32')];if(!_0x802475['query'][_0x73d2('0x38')](_0x73d2('0x39'))){_0x5cf8b[_0x73d2('0x1e')]=qs['limit'](_0x802475[_0x73d2('0x33')][_0x73d2('0x1e')]);_0x5cf8b[_0x73d2('0x1c')]=qs[_0x73d2('0x1c')](_0x802475[_0x73d2('0x33')][_0x73d2('0x1c')]);}_0x5cf8b[_0x73d2('0x3a')]=qs['sort'](_0x802475[_0x73d2('0x33')][_0x73d2('0x3b')]);_0x5cf8b['where']=qs[_0x73d2('0x3c')](_['pick'](_0x802475[_0x73d2('0x33')],_0x1a5669['filters']),_0x3f75d9);if(_0x802475[_0x73d2('0x33')][_0x73d2('0x3d')]){_0x5cf8b[_0x73d2('0x3e')]=_[_0x73d2('0x3f')](_0x5cf8b[_0x73d2('0x3e')],{'$or':_[_0x73d2('0x2d')](_0x3f75d9,function(_0x4c2967){if(_0x4c2967[_0x73d2('0x30')]!=='VIRTUAL'){var _0x566c3c={};_0x566c3c[_0x4c2967['name']]={'$like':'%'+_0x802475['query']['filter']+'%'};return _0x566c3c;}})});}_0x5cf8b=_[_0x73d2('0x3f')]({},_0x5cf8b,_0x802475['options']);var _0x52dfaf={'where':_0x5cf8b[_0x73d2('0x3e')]};return db[_0x73d2('0x2e')][_0x73d2('0x1f')](_0x52dfaf)[_0x73d2('0x25')](function(_0x3c9246){_0x3c2618[_0x73d2('0x1f')]=_0x3c9246;if(_0x802475[_0x73d2('0x33')][_0x73d2('0x40')]){_0x5cf8b[_0x73d2('0x41')]=[{'all':!![]}];}return db[_0x73d2('0x2e')][_0x73d2('0x42')](_0x5cf8b);})[_0x73d2('0x25')](function(_0x891ac3){_0x3c2618[_0x73d2('0x43')]=_0x891ac3;return _0x3c2618;})[_0x73d2('0x25')](respondWithFilteredResult(_0x264d64,_0x5cf8b))['catch'](handleError(_0x264d64,null));};exports['show']=function(_0x658ca3,_0x506117){var _0x5bb4d6={'raw':![],'where':{'id':_0x658ca3[_0x73d2('0x44')]['id']}},_0x13b9bb={};_0x13b9bb['model']=_[_0x73d2('0x34')](db[_0x73d2('0x2e')][_0x73d2('0x2f')]);_0x13b9bb['query']=_[_0x73d2('0x34')](_0x658ca3[_0x73d2('0x33')]);_0x13b9bb['filters']=_['intersection'](_0x13b9bb[_0x73d2('0x32')],_0x13b9bb['query']);_0x5bb4d6[_0x73d2('0x36')]=_[_0x73d2('0x35')](_0x13b9bb['model'],qs[_0x73d2('0x37')](_0x658ca3['query'][_0x73d2('0x37')]));_0x5bb4d6['attributes']=_0x5bb4d6['attributes'][_0x73d2('0x45')]?_0x5bb4d6[_0x73d2('0x36')]:_0x13b9bb['model'];if(_0x658ca3[_0x73d2('0x33')]['includeAll']){_0x5bb4d6['include']=[{'all':!![]}];}_0x5bb4d6=_[_0x73d2('0x3f')]({},_0x5bb4d6,_0x658ca3['options']);return db['Trigger']['find'](_0x5bb4d6)[_0x73d2('0x25')](handleEntityNotFound(_0x506117,null))[_0x73d2('0x25')](respondWithResult(_0x506117,null))[_0x73d2('0x46')](handleError(_0x506117,null));};exports['create']=function(_0x2378e2,_0x551bda){return db[_0x73d2('0x2e')]['create'](_0x2378e2[_0x73d2('0x47')],{})[_0x73d2('0x25')](function(_0x498084){var _0x3d1765=_0x2378e2[_0x73d2('0x48')][_0x73d2('0x27')]({'plain':!![]});if(!_0x3d1765)throw new Error(_0x73d2('0x49'));if(_0x3d1765[_0x73d2('0x4a')]===_0x73d2('0x48')){var _0x1f29fe=_0x498084['get']({'plain':!![]});var _0x14d215='Triggers';return db['UserProfileSection'][_0x73d2('0x4b')]({'where':{'name':_0x14d215,'userProfileId':_0x3d1765[_0x73d2('0x4c')]},'raw':!![]})[_0x73d2('0x25')](function(_0x3fbe06){if(_0x3fbe06&&_0x3fbe06['autoAssociation']===0x0){return db[_0x73d2('0x4d')][_0x73d2('0x4e')]({'name':_0x1f29fe[_0x73d2('0x2c')],'resourceId':_0x1f29fe['id'],'type':_0x3fbe06[_0x73d2('0x2c')],'sectionId':_0x3fbe06['id']},{})[_0x73d2('0x25')](function(){return _0x498084;});}else{return _0x498084;}})['catch'](function(_0x45d07c){logger[_0x73d2('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45d07c);throw _0x45d07c;});}return _0x498084;})[_0x73d2('0x25')](respondWithResult(_0x551bda,0xc9))['catch'](handleError(_0x551bda,null));};exports[_0x73d2('0x24')]=function(_0xbbff24,_0x4a3cfa){if(_0xbbff24[_0x73d2('0x47')]['id']){delete _0xbbff24[_0x73d2('0x47')]['id'];}return db[_0x73d2('0x2e')]['find']({'where':{'id':_0xbbff24[_0x73d2('0x44')]['id']}})[_0x73d2('0x25')](handleEntityNotFound(_0x4a3cfa,null))[_0x73d2('0x25')](saveUpdates(_0xbbff24[_0x73d2('0x47')],null))[_0x73d2('0x25')](respondWithResult(_0x4a3cfa,null))[_0x73d2('0x46')](handleError(_0x4a3cfa,null));};exports[_0x73d2('0x26')]=function(_0x639cc4,_0x282e0c){return db[_0x73d2('0x2e')][_0x73d2('0x4b')]({'where':{'id':_0x639cc4[_0x73d2('0x44')]['id']}})[_0x73d2('0x25')](handleEntityNotFound(_0x282e0c,null))[_0x73d2('0x25')](removeEntity(_0x282e0c,null))[_0x73d2('0x46')](handleError(_0x282e0c,null));};exports[_0x73d2('0x4f')]=function(_0x5a402c,_0x56366e,_0x8e8bb8){if(_0x5a402c[_0x73d2('0x47')]['id']){delete _0x5a402c['body']['id'];}return db[_0x73d2('0x2e')]['find']({'where':{'id':_0x5a402c[_0x73d2('0x44')]['id']}})[_0x73d2('0x25')](handleEntityNotFound(_0x56366e,null))[_0x73d2('0x25')](function(_0x3533cf){if(_0x3533cf){_0x5a402c[_0x73d2('0x47')][_0x73d2('0x50')]=_0x3533cf['id'];return db[_0x73d2('0x51')][_0x73d2('0x4e')](_0x5a402c[_0x73d2('0x47')]);}})[_0x73d2('0x25')](respondWithResult(_0x56366e,null))[_0x73d2('0x46')](handleError(_0x56366e,null));};exports[_0x73d2('0x52')]=function(_0x214373,_0x18e7d7,_0x60813e){if(_0x214373[_0x73d2('0x47')]['id']){delete _0x214373[_0x73d2('0x47')]['id'];}return db['Trigger'][_0x73d2('0x4b')]({'where':{'id':_0x214373[_0x73d2('0x44')]['id']}})[_0x73d2('0x25')](handleEntityNotFound(_0x18e7d7,null))[_0x73d2('0x25')](function(_0xef51e1){if(_0xef51e1){_0x214373[_0x73d2('0x47')][_0x73d2('0x53')]=_0xef51e1['id'];return db[_0x73d2('0x51')][_0x73d2('0x4e')](_0x214373[_0x73d2('0x47')]);}})['then'](respondWithResult(_0x18e7d7,null))['catch'](handleError(_0x18e7d7,null));};exports['getAllConditions']=function(_0x29516e,_0x5a758f,_0x3aa37f){var _0x665c2a={};var _0x16f313={};var _0x3b291d;var _0x2b3e8a;return db[_0x73d2('0x2e')][_0x73d2('0x54')]({'where':{'id':_0x29516e['params']['id']}})['then'](handleEntityNotFound(_0x5a758f,null))[_0x73d2('0x25')](function(_0x1fee8b){if(_0x1fee8b){_0x3b291d=_0x1fee8b;_0x16f313[_0x73d2('0x32')]=_[_0x73d2('0x34')](db[_0x73d2('0x51')][_0x73d2('0x2f')]);_0x16f313['query']=_[_0x73d2('0x34')](_0x29516e[_0x73d2('0x33')]);_0x16f313['filters']=_[_0x73d2('0x35')](_0x16f313[_0x73d2('0x32')],_0x16f313['query']);_0x665c2a[_0x73d2('0x36')]=_[_0x73d2('0x35')](_0x16f313[_0x73d2('0x32')],qs[_0x73d2('0x37')](_0x29516e[_0x73d2('0x33')][_0x73d2('0x37')]));_0x665c2a[_0x73d2('0x36')]=_0x665c2a[_0x73d2('0x36')][_0x73d2('0x45')]?_0x665c2a[_0x73d2('0x36')]:_0x16f313[_0x73d2('0x32')];_0x665c2a[_0x73d2('0x3a')]=qs[_0x73d2('0x3b')](_0x29516e[_0x73d2('0x33')][_0x73d2('0x3b')]);_0x665c2a[_0x73d2('0x3e')]=qs[_0x73d2('0x3c')](_['pick'](_0x29516e[_0x73d2('0x33')],_0x16f313['filters']));if(_0x29516e[_0x73d2('0x33')][_0x73d2('0x3d')]){_0x665c2a[_0x73d2('0x3e')]=_[_0x73d2('0x3f')](_0x665c2a[_0x73d2('0x3e')],{'$or':_[_0x73d2('0x2d')](_0x665c2a[_0x73d2('0x36')],function(_0x55afdb){var _0x5736e3={};_0x5736e3[_0x55afdb]={'$like':'%'+_0x29516e[_0x73d2('0x33')][_0x73d2('0x3d')]+'%'};return _0x5736e3;})});}_0x665c2a=_['merge']({},_0x665c2a,_0x29516e[_0x73d2('0x55')]);return _0x3b291d['getAllConditions'](_0x665c2a);}})[_0x73d2('0x25')](function(_0x5a617a){if(_0x5a617a){_0x2b3e8a=_0x5a617a[_0x73d2('0x45')];if(!_0x29516e[_0x73d2('0x33')][_0x73d2('0x38')]('nolimit')){_0x665c2a[_0x73d2('0x1e')]=qs['limit'](_0x29516e[_0x73d2('0x33')]['limit']);_0x665c2a[_0x73d2('0x1c')]=qs[_0x73d2('0x1c')](_0x29516e[_0x73d2('0x33')][_0x73d2('0x1c')]);}return _0x3b291d[_0x73d2('0x56')](_0x665c2a);}})[_0x73d2('0x25')](function(_0x4fbc2d){if(_0x4fbc2d){return _0x4fbc2d?{'count':_0x2b3e8a,'rows':_0x4fbc2d}:null;}})['then'](respondWithResult(_0x5a758f,null))[_0x73d2('0x46')](handleError(_0x5a758f,null));};exports['getAnyConditions']=function(_0x52d653,_0x3acbb2,_0x58efec){var _0x3a94a6={};var _0x4e2a04={};var _0x19561b;var _0xe3af9e;return db['Trigger']['findOne']({'where':{'id':_0x52d653[_0x73d2('0x44')]['id']}})[_0x73d2('0x25')](handleEntityNotFound(_0x3acbb2,null))['then'](function(_0x475a33){if(_0x475a33){_0x19561b=_0x475a33;_0x4e2a04[_0x73d2('0x32')]=_[_0x73d2('0x34')](db[_0x73d2('0x51')]['rawAttributes']);_0x4e2a04[_0x73d2('0x33')]=_[_0x73d2('0x34')](_0x52d653[_0x73d2('0x33')]);_0x4e2a04[_0x73d2('0x3c')]=_[_0x73d2('0x35')](_0x4e2a04[_0x73d2('0x32')],_0x4e2a04[_0x73d2('0x33')]);_0x3a94a6[_0x73d2('0x36')]=_[_0x73d2('0x35')](_0x4e2a04[_0x73d2('0x32')],qs[_0x73d2('0x37')](_0x52d653[_0x73d2('0x33')][_0x73d2('0x37')]));_0x3a94a6[_0x73d2('0x36')]=_0x3a94a6[_0x73d2('0x36')]['length']?_0x3a94a6['attributes']:_0x4e2a04[_0x73d2('0x32')];_0x3a94a6[_0x73d2('0x3a')]=qs[_0x73d2('0x3b')](_0x52d653[_0x73d2('0x33')][_0x73d2('0x3b')]);_0x3a94a6[_0x73d2('0x3e')]=qs[_0x73d2('0x3c')](_[_0x73d2('0x57')](_0x52d653['query'],_0x4e2a04[_0x73d2('0x3c')]));if(_0x52d653['query'][_0x73d2('0x3d')]){_0x3a94a6['where']=_['merge'](_0x3a94a6['where'],{'$or':_[_0x73d2('0x2d')](_0x3a94a6['attributes'],function(_0x2eb34c){var _0x4e9dc7={};_0x4e9dc7[_0x2eb34c]={'$like':'%'+_0x52d653[_0x73d2('0x33')]['filter']+'%'};return _0x4e9dc7;})});}_0x3a94a6=_[_0x73d2('0x3f')]({},_0x3a94a6,_0x52d653[_0x73d2('0x55')]);return _0x19561b[_0x73d2('0x58')](_0x3a94a6);}})['then'](function(_0x49d296){if(_0x49d296){_0xe3af9e=_0x49d296[_0x73d2('0x45')];if(!_0x52d653[_0x73d2('0x33')][_0x73d2('0x38')]('nolimit')){_0x3a94a6[_0x73d2('0x1e')]=qs[_0x73d2('0x1e')](_0x52d653[_0x73d2('0x33')][_0x73d2('0x1e')]);_0x3a94a6[_0x73d2('0x1c')]=qs['offset'](_0x52d653[_0x73d2('0x33')]['offset']);}return _0x19561b['getAnyConditions'](_0x3a94a6);}})[_0x73d2('0x25')](function(_0x104aed){if(_0x104aed){return _0x104aed?{'count':_0xe3af9e,'rows':_0x104aed}:null;}})['then'](respondWithResult(_0x3acbb2,null))['catch'](handleError(_0x3acbb2,null));};exports[_0x73d2('0x59')]=function(_0x9fa24,_0x1b2a72,_0x2d0f22){if(_0x9fa24[_0x73d2('0x47')]['id']){delete _0x9fa24['body']['id'];}return db['Trigger'][_0x73d2('0x4b')]({'where':{'id':_0x9fa24['params']['id']}})['then'](handleEntityNotFound(_0x1b2a72,null))[_0x73d2('0x25')](function(_0x1a6b33){if(_0x1a6b33){_0x9fa24[_0x73d2('0x47')]['TriggerId']=_0x1a6b33['id'];return db[_0x73d2('0x5a')][_0x73d2('0x4e')](_0x9fa24[_0x73d2('0x47')]);}})[_0x73d2('0x25')](respondWithResult(_0x1b2a72,null))[_0x73d2('0x46')](handleError(_0x1b2a72,null));};exports[_0x73d2('0x5b')]=function(_0x4f4948,_0x3570af,_0x211963){var _0x3774be={};var _0x362c33={};var _0x1f07a1;var _0x234185;return db[_0x73d2('0x2e')][_0x73d2('0x54')]({'where':{'id':_0x4f4948['params']['id']}})[_0x73d2('0x25')](handleEntityNotFound(_0x3570af,null))[_0x73d2('0x25')](function(_0x29c046){if(_0x29c046){_0x1f07a1=_0x29c046;_0x362c33['model']=_[_0x73d2('0x34')](db[_0x73d2('0x5a')][_0x73d2('0x2f')]);_0x362c33['query']=_[_0x73d2('0x34')](_0x4f4948['query']);_0x362c33[_0x73d2('0x3c')]=_[_0x73d2('0x35')](_0x362c33['model'],_0x362c33[_0x73d2('0x33')]);_0x3774be[_0x73d2('0x36')]=_[_0x73d2('0x35')](_0x362c33[_0x73d2('0x32')],qs[_0x73d2('0x37')](_0x4f4948['query']['fields']));_0x3774be[_0x73d2('0x36')]=_0x3774be[_0x73d2('0x36')][_0x73d2('0x45')]?_0x3774be[_0x73d2('0x36')]:_0x362c33['model'];_0x3774be[_0x73d2('0x3a')]=qs[_0x73d2('0x3b')](_0x4f4948[_0x73d2('0x33')][_0x73d2('0x3b')]);_0x3774be[_0x73d2('0x3e')]=qs[_0x73d2('0x3c')](_[_0x73d2('0x57')](_0x4f4948[_0x73d2('0x33')],_0x362c33[_0x73d2('0x3c')]));if(_0x4f4948[_0x73d2('0x33')]['filter']){_0x3774be[_0x73d2('0x3e')]=_[_0x73d2('0x3f')](_0x3774be[_0x73d2('0x3e')],{'$or':_[_0x73d2('0x2d')](_0x3774be[_0x73d2('0x36')],function(_0x58abdf){var _0x4b7022={};_0x4b7022[_0x58abdf]={'$like':'%'+_0x4f4948['query']['filter']+'%'};return _0x4b7022;})});}_0x3774be=_[_0x73d2('0x3f')]({},_0x3774be,_0x4f4948[_0x73d2('0x55')]);return _0x1f07a1[_0x73d2('0x5b')](_0x3774be);}})[_0x73d2('0x25')](function(_0x4a3c04){if(_0x4a3c04){_0x234185=_0x4a3c04[_0x73d2('0x45')];if(!_0x4f4948[_0x73d2('0x33')]['hasOwnProperty'](_0x73d2('0x39'))){_0x3774be[_0x73d2('0x1e')]=qs[_0x73d2('0x1e')](_0x4f4948[_0x73d2('0x33')][_0x73d2('0x1e')]);_0x3774be[_0x73d2('0x1c')]=qs[_0x73d2('0x1c')](_0x4f4948[_0x73d2('0x33')][_0x73d2('0x1c')]);}return _0x1f07a1[_0x73d2('0x5b')](_0x3774be);}})[_0x73d2('0x25')](function(_0x5aab0e){if(_0x5aab0e){return _0x5aab0e?{'count':_0x234185,'rows':_0x5aab0e}:null;}})[_0x73d2('0x25')](respondWithResult(_0x3570af,null))[_0x73d2('0x46')](handleError(_0x3570af,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 78c5e9e..e006cfd 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 _0x6bdc=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Trigger','tools_triggers','lodash','util'];(function(_0x63bb45,_0x4c6534){var _0x264c4f=function(_0xdf4df1){while(--_0xdf4df1){_0x63bb45['push'](_0x63bb45['shift']());}};_0x264c4f(++_0x4c6534);}(_0x6bdc,0x14e));var _0xc6bd=function(_0x3c3935,_0x3436cc){_0x3c3935=_0x3c3935-0x0;var _0x1e7457=_0x6bdc[_0x3c3935];return _0x1e7457;};'use strict';var _=require(_0xc6bd('0x0'));var util=require(_0xc6bd('0x1'));var logger=require(_0xc6bd('0x2'))(_0xc6bd('0x3'));var moment=require(_0xc6bd('0x4'));var BPromise=require(_0xc6bd('0x5'));var rp=require(_0xc6bd('0x6'));var fs=require('fs');var path=require(_0xc6bd('0x7'));var rimraf=require(_0xc6bd('0x8'));var config=require(_0xc6bd('0x9'));var attributes=require('./trigger.attributes');module[_0xc6bd('0xa')]=function(_0x26218a,_0x158271){return _0x26218a[_0xc6bd('0xb')](_0xc6bd('0xc'),attributes,{'tableName':_0xc6bd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1928=['exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0x1928,0x138));var _0x8192=function(_0x5bd613,_0x13ce65){_0x5bd613=_0x5bd613-0x0;var _0x2975a5=_0x1928[_0x5bd613];return _0x2975a5;};'use strict';var _=require(_0x8192('0x0'));var util=require(_0x8192('0x1'));var logger=require(_0x8192('0x2'))('api');var moment=require(_0x8192('0x3'));var BPromise=require(_0x8192('0x4'));var rp=require(_0x8192('0x5'));var fs=require('fs');var path=require(_0x8192('0x6'));var rimraf=require(_0x8192('0x7'));var config=require(_0x8192('0x8'));var attributes=require(_0x8192('0x9'));module[_0x8192('0xa')]=function(_0x426163,_0x25f90e){return _0x426163[_0x8192('0xb')](_0x8192('0xc'),attributes,{'tableName':_0x8192('0xd'),'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 d1a10e2..3d718c0 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 _0x85db=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','Trigger','findAll','options','raw','where','limit','include','map','model','attributes','then','GetTrigger','debug','find','ShowTrigger','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x3858f4,_0x522d7e){var _0x1300ec=function(_0x5049e6){while(--_0x5049e6){_0x3858f4['push'](_0x3858f4['shift']());}};_0x1300ec(++_0x522d7e);}(_0x85db,0x1c6));var _0xb85d=function(_0x2125f0,_0x2f23b9){_0x2125f0=_0x2125f0-0x0;var _0x12d6eb=_0x85db[_0x2125f0];return _0x12d6eb;};'use strict';var _=require('lodash');var util=require(_0xb85d('0x0'));var moment=require(_0xb85d('0x1'));var BPromise=require(_0xb85d('0x2'));var rs=require(_0xb85d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb85d('0x4'));var logger=require(_0xb85d('0x5'))(_0xb85d('0x6'));var config=require(_0xb85d('0x7'));var jayson=require(_0xb85d('0x8'));var client=jayson[_0xb85d('0x9')][_0xb85d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9787f7,_0x3b975a,_0x2016c1){return new BPromise(function(_0x18ff80,_0x3e08ff){return client[_0xb85d('0xb')](_0x9787f7,_0x2016c1)['then'](function(_0x2b576d){logger['info'](_0xb85d('0xc'),_0x3b975a,_0xb85d('0xd'));logger['debug'](_0xb85d('0xe'),_0x3b975a,'request\x20sent',JSON[_0xb85d('0xf')](_0x2b576d));if(_0x2b576d[_0xb85d('0x10')]){if(_0x2b576d[_0xb85d('0x10')]['code']===0x1f4){logger[_0xb85d('0x10')](_0xb85d('0xc'),_0x3b975a,_0x2b576d[_0xb85d('0x10')][_0xb85d('0x11')]);return _0x3e08ff(_0x2b576d[_0xb85d('0x10')][_0xb85d('0x11')]);}logger[_0xb85d('0x10')](_0xb85d('0xc'),_0x3b975a,_0x2b576d[_0xb85d('0x10')][_0xb85d('0x11')]);return _0x18ff80(_0x2b576d['error'][_0xb85d('0x11')]);}else{logger[_0xb85d('0x12')](_0xb85d('0xc'),_0x3b975a,_0xb85d('0xd'));_0x18ff80(_0x2b576d[_0xb85d('0x13')]['message']);}})[_0xb85d('0x14')](function(_0x333c9a){logger[_0xb85d('0x10')]('Trigger,\x20%s,\x20%s',_0x3b975a,_0x333c9a);_0x3e08ff(_0x333c9a);});});}exports['GetTrigger']=function(_0x125543){var _0x245ff2=this;return new Promise(function(_0x580549,_0x1babc1){return db[_0xb85d('0x15')][_0xb85d('0x16')]({'raw':_0x125543['options']?_0x125543[_0xb85d('0x17')][_0xb85d('0x18')]===undefined?!![]:![]:!![],'where':_0x125543[_0xb85d('0x17')]?_0x125543['options'][_0xb85d('0x19')]||null:null,'attributes':_0x125543[_0xb85d('0x17')]?_0x125543['options']['attributes']||null:null,'limit':_0x125543['options']?_0x125543[_0xb85d('0x17')][_0xb85d('0x1a')]||null:null,'include':_0x125543[_0xb85d('0x17')]?_0x125543[_0xb85d('0x17')][_0xb85d('0x1b')]?_[_0xb85d('0x1c')](_0x125543['options'][_0xb85d('0x1b')],function(_0x1f6640){return{'model':db[_0x1f6640[_0xb85d('0x1d')]],'as':_0x1f6640['as'],'attributes':_0x1f6640[_0xb85d('0x1e')],'include':_0x1f6640[_0xb85d('0x1b')]?_[_0xb85d('0x1c')](_0x1f6640[_0xb85d('0x1b')],function(_0x34aa02){return{'model':db[_0x34aa02[_0xb85d('0x1d')]],'as':_0x34aa02['as'],'attributes':_0x34aa02[_0xb85d('0x1e')],'include':_0x34aa02[_0xb85d('0x1b')]?_[_0xb85d('0x1c')](_0x34aa02[_0xb85d('0x1b')],function(_0x501928){return{'model':db[_0x501928[_0xb85d('0x1d')]],'as':_0x501928['as'],'attributes':_0x501928[_0xb85d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb85d('0x1f')](function(_0x20a88f){logger['info'](_0xb85d('0x20'),_0x125543);logger[_0xb85d('0x21')]('GetTrigger',_0x125543,JSON['stringify'](_0x20a88f));_0x580549(_0x20a88f);})[_0xb85d('0x14')](function(_0x2f98da){logger['error'](_0xb85d('0x20'),_0x2f98da[_0xb85d('0x11')],_0x125543);_0x1babc1(_0x245ff2[_0xb85d('0x10')](0x1f4,_0x2f98da[_0xb85d('0x11')]));});});};exports['ShowTrigger']=function(_0x2f8874){var _0xd29fb0=this;return new Promise(function(_0x265a0d,_0x14adbe){return db['Trigger'][_0xb85d('0x22')]({'raw':_0x2f8874[_0xb85d('0x17')]?_0x2f8874['options']['raw']===undefined?!![]:![]:!![],'where':_0x2f8874[_0xb85d('0x17')]?_0x2f8874['options']['where']||null:null,'attributes':_0x2f8874[_0xb85d('0x17')]?_0x2f8874[_0xb85d('0x17')][_0xb85d('0x1e')]||null:null,'include':_0x2f8874[_0xb85d('0x17')]?_0x2f8874[_0xb85d('0x17')][_0xb85d('0x1b')]?_['map'](_0x2f8874[_0xb85d('0x17')][_0xb85d('0x1b')],function(_0x3faf4e){return{'model':db[_0x3faf4e[_0xb85d('0x1d')]],'as':_0x3faf4e['as'],'attributes':_0x3faf4e['attributes'],'include':_0x3faf4e['include']?_[_0xb85d('0x1c')](_0x3faf4e['include'],function(_0x69b9f1){return{'model':db[_0x69b9f1['model']],'as':_0x69b9f1['as'],'attributes':_0x69b9f1['attributes'],'include':_0x69b9f1[_0xb85d('0x1b')]?_[_0xb85d('0x1c')](_0x69b9f1[_0xb85d('0x1b')],function(_0x79dfde){return{'model':db[_0x79dfde[_0xb85d('0x1d')]],'as':_0x79dfde['as'],'attributes':_0x79dfde[_0xb85d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb85d('0x1f')](function(_0x254441){logger[_0xb85d('0x12')](_0xb85d('0x23'),_0x2f8874);logger['debug'](_0xb85d('0x23'),_0x2f8874,JSON['stringify'](_0x254441));_0x265a0d(_0x254441);})[_0xb85d('0x14')](function(_0x21e3e7){logger['error'](_0xb85d('0x23'),_0x21e3e7[_0xb85d('0x11')],_0x2f8874);_0x14adbe(_0xd29fb0[_0xb85d('0x10')](0x1f4,_0x21e3e7[_0xb85d('0x11')]));});});}; \ No newline at end of file +var _0x5c3c=['jayson/promise','client','request','then','info','request\x20sent','debug','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','options','where','attributes','include','map','model','stringify','find','ShowTrigger','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5c3c,0x1ae));var _0xc5c3=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5c3c[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc5c3('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5c3('0x1'))['db'];var utils=require(_0xc5c3('0x2'));var logger=require(_0xc5c3('0x3'))('rpc');var config=require(_0xc5c3('0x4'));var jayson=require(_0xc5c3('0x5'));var client=jayson[_0xc5c3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x141ce6,_0x20e653,_0x3ca607){return new BPromise(function(_0x442f61,_0x5c70e7){return client[_0xc5c3('0x7')](_0x141ce6,_0x3ca607)[_0xc5c3('0x8')](function(_0x1e445d){logger[_0xc5c3('0x9')]('Trigger,\x20%s,\x20%s',_0x20e653,_0xc5c3('0xa'));logger[_0xc5c3('0xb')]('Trigger,\x20%s,\x20%s,\x20%s',_0x20e653,_0xc5c3('0xa'),JSON['stringify'](_0x1e445d));if(_0x1e445d[_0xc5c3('0xc')]){if(_0x1e445d[_0xc5c3('0xc')][_0xc5c3('0xd')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x20e653,_0x1e445d[_0xc5c3('0xc')]['message']);return _0x5c70e7(_0x1e445d[_0xc5c3('0xc')][_0xc5c3('0xf')]);}logger[_0xc5c3('0xc')](_0xc5c3('0xe'),_0x20e653,_0x1e445d['error']['message']);return _0x442f61(_0x1e445d[_0xc5c3('0xc')][_0xc5c3('0xf')]);}else{logger[_0xc5c3('0x9')](_0xc5c3('0xe'),_0x20e653,_0xc5c3('0xa'));_0x442f61(_0x1e445d[_0xc5c3('0x10')][_0xc5c3('0xf')]);}})[_0xc5c3('0x11')](function(_0x1175af){logger['error'](_0xc5c3('0xe'),_0x20e653,_0x1175af);_0x5c70e7(_0x1175af);});});}exports[_0xc5c3('0x12')]=function(_0x41ecd9){var _0x42ec68=this;return new Promise(function(_0x29e7ab,_0x481144){return db[_0xc5c3('0x13')]['findAll']({'raw':_0x41ecd9[_0xc5c3('0x14')]?_0x41ecd9['options']['raw']===undefined?!![]:![]:!![],'where':_0x41ecd9[_0xc5c3('0x14')]?_0x41ecd9[_0xc5c3('0x14')][_0xc5c3('0x15')]||null:null,'attributes':_0x41ecd9[_0xc5c3('0x14')]?_0x41ecd9[_0xc5c3('0x14')][_0xc5c3('0x16')]||null:null,'limit':_0x41ecd9[_0xc5c3('0x14')]?_0x41ecd9[_0xc5c3('0x14')]['limit']||null:null,'include':_0x41ecd9['options']?_0x41ecd9['options'][_0xc5c3('0x17')]?_[_0xc5c3('0x18')](_0x41ecd9[_0xc5c3('0x14')][_0xc5c3('0x17')],function(_0x209531){return{'model':db[_0x209531['model']],'as':_0x209531['as'],'attributes':_0x209531[_0xc5c3('0x16')],'include':_0x209531[_0xc5c3('0x17')]?_[_0xc5c3('0x18')](_0x209531[_0xc5c3('0x17')],function(_0x118ac0){return{'model':db[_0x118ac0[_0xc5c3('0x19')]],'as':_0x118ac0['as'],'attributes':_0x118ac0[_0xc5c3('0x16')],'include':_0x118ac0['include']?_['map'](_0x118ac0['include'],function(_0x9359b1){return{'model':db[_0x9359b1[_0xc5c3('0x19')]],'as':_0x9359b1['as'],'attributes':_0x9359b1[_0xc5c3('0x16')]};}):[]};}):[]};}):[]:[]})[_0xc5c3('0x8')](function(_0xa3399d){logger[_0xc5c3('0x9')]('GetTrigger',_0x41ecd9);logger[_0xc5c3('0xb')]('GetTrigger',_0x41ecd9,JSON[_0xc5c3('0x1a')](_0xa3399d));_0x29e7ab(_0xa3399d);})['catch'](function(_0x13862f){logger[_0xc5c3('0xc')](_0xc5c3('0x12'),_0x13862f[_0xc5c3('0xf')],_0x41ecd9);_0x481144(_0x42ec68[_0xc5c3('0xc')](0x1f4,_0x13862f[_0xc5c3('0xf')]));});});};exports['ShowTrigger']=function(_0x403105){var _0x5f2583=this;return new Promise(function(_0x4030b5,_0x5ae31e){return db[_0xc5c3('0x13')][_0xc5c3('0x1b')]({'raw':_0x403105[_0xc5c3('0x14')]?_0x403105[_0xc5c3('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x403105[_0xc5c3('0x14')]?_0x403105['options'][_0xc5c3('0x15')]||null:null,'attributes':_0x403105[_0xc5c3('0x14')]?_0x403105[_0xc5c3('0x14')]['attributes']||null:null,'include':_0x403105[_0xc5c3('0x14')]?_0x403105[_0xc5c3('0x14')][_0xc5c3('0x17')]?_[_0xc5c3('0x18')](_0x403105[_0xc5c3('0x14')][_0xc5c3('0x17')],function(_0x4affe9){return{'model':db[_0x4affe9[_0xc5c3('0x19')]],'as':_0x4affe9['as'],'attributes':_0x4affe9['attributes'],'include':_0x4affe9['include']?_[_0xc5c3('0x18')](_0x4affe9[_0xc5c3('0x17')],function(_0xb40ecc){return{'model':db[_0xb40ecc[_0xc5c3('0x19')]],'as':_0xb40ecc['as'],'attributes':_0xb40ecc[_0xc5c3('0x16')],'include':_0xb40ecc[_0xc5c3('0x17')]?_[_0xc5c3('0x18')](_0xb40ecc[_0xc5c3('0x17')],function(_0x2e0c1d){return{'model':db[_0x2e0c1d[_0xc5c3('0x19')]],'as':_0x2e0c1d['as'],'attributes':_0x2e0c1d[_0xc5c3('0x16')]};}):[]};}):[]};}):[]:[]})[_0xc5c3('0x8')](function(_0x52b0ea){logger[_0xc5c3('0x9')]('ShowTrigger',_0x403105);logger[_0xc5c3('0xb')](_0xc5c3('0x1c'),_0x403105,JSON['stringify'](_0x52b0ea));_0x4030b5(_0x52b0ea);})[_0xc5c3('0x11')](function(_0x2326c7){logger[_0xc5c3('0xc')](_0xc5c3('0x1c'),_0x2326c7[_0xc5c3('0xf')],_0x403105);_0x5ae31e(_0x5f2583[_0xc5c3('0xc')](0x1f4,_0x2326c7[_0xc5c3('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 3811da1..16dbdaf 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 _0x3f1f=['../../config/environment','./trunk.controller','get','/:id','isAuthenticated','show','/:id/clone','clone','create','put','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4d4376,_0x4396b2){var _0x2ccf85=function(_0x49561b){while(--_0x49561b){_0x4d4376['push'](_0x4d4376['shift']());}};_0x2ccf85(++_0x4396b2);}(_0x3f1f,0x1f1));var _0xf3f1=function(_0x33ecc6,_0x4bf8a6){_0x33ecc6=_0x33ecc6-0x0;var _0x5dd2c2=_0x3f1f[_0x33ecc6];return _0x5dd2c2;};'use strict';var multer=require('multer');var util=require(_0xf3f1('0x0'));var path=require(_0xf3f1('0x1'));var timeout=require(_0xf3f1('0x2'));var express=require(_0xf3f1('0x3'));var router=express[_0xf3f1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf3f1('0x5'));var interaction=require(_0xf3f1('0x6'));var config=require(_0xf3f1('0x7'));var controller=require(_0xf3f1('0x8'));router[_0xf3f1('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf3f1('0x9')](_0xf3f1('0xa'),auth[_0xf3f1('0xb')](),controller[_0xf3f1('0xc')]);router['post'](_0xf3f1('0xd'),auth['isAuthenticated'](),controller[_0xf3f1('0xe')]);router['post']('/',auth[_0xf3f1('0xb')](),controller[_0xf3f1('0xf')]);router[_0xf3f1('0x10')]('/:id',auth[_0xf3f1('0xb')](),controller['update']);router['delete'](_0xf3f1('0xa'),auth[_0xf3f1('0xb')](),controller[_0xf3f1('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5067=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x1eb22c,_0x2cd10d){var _0x12dddc=function(_0x187dc4){while(--_0x187dc4){_0x1eb22c['push'](_0x1eb22c['shift']());}};_0x12dddc(++_0x2cd10d);}(_0x5067,0x10b));var _0x7506=function(_0x1d8ed4,_0x442966){_0x1d8ed4=_0x1d8ed4-0x0;var _0xb2e66f=_0x5067[_0x1d8ed4];return _0xb2e66f;};'use strict';var multer=require(_0x7506('0x0'));var util=require(_0x7506('0x1'));var path=require(_0x7506('0x2'));var timeout=require(_0x7506('0x3'));var express=require('express');var router=express[_0x7506('0x4')]();var fs_extra=require(_0x7506('0x5'));var auth=require(_0x7506('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7506('0x7'));var controller=require('./trunk.controller');router[_0x7506('0x8')]('/',auth[_0x7506('0x9')](),controller['index']);router[_0x7506('0x8')](_0x7506('0xa'),auth['isAuthenticated'](),controller[_0x7506('0xb')]);router['post']('/:id/clone',auth[_0x7506('0x9')](),controller['clone']);router[_0x7506('0xc')]('/',auth[_0x7506('0x9')](),controller[_0x7506('0xd')]);router['put']('/:id',auth[_0x7506('0x9')](),controller[_0x7506('0xe')]);router['delete'](_0x7506('0xa'),auth[_0x7506('0x9')](),controller[_0x7506('0xf')]);module[_0x7506('0x10')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 6698bb2..69aeaeb 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 _0xc020=['INTEGER','always','refuse','uas','pai','fingerprint','certificate','passive','actpass','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>'];(function(_0x1e6f9a,_0x37c6d8){var _0x2b65b0=function(_0xfc8c6){while(--_0xfc8c6){_0x1e6f9a['push'](_0x1e6f9a['shift']());}};_0x2b65b0(++_0x37c6d8);}(_0xc020,0x170));var _0x0c02=function(_0x4864ea,_0x7764ed){_0x4864ea=_0x4864ea-0x0;var _0x12e74f=_0xc020[_0x4864ea];return _0x12e74f;};'use strict';var Sequelize=require(_0x0c02('0x0'));module['exports']={'name':{'type':Sequelize[_0x0c02('0x1')],'allowNull':![],'unique':_0x0c02('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0c02('0x3')]('friend',_0x0c02('0x4'),_0x0c02('0x5')),'allowNull':![],'defaultValue':_0x0c02('0x6')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0c02('0x7')},'callingpres':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x8'),_0x0c02('0x9'),_0x0c02('0xa'),_0x0c02('0xb'),_0x0c02('0xc'),'PROHIB_PASSED_SCREEN',_0x0c02('0xd'),_0x0c02('0xe'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x0c02('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x0c02('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x0c02('0x1')],'defaultValue':_0x0c02('0xf'),'set':function(_0x1b81e0){this[_0x0c02('0x10')](_0x0c02('0x11'),_0x1b81e0?_0x1b81e0[_0x0c02('0x12')](','):null);},'get':function(){return this[_0x0c02('0x13')](_0x0c02('0x11'))?this[_0x0c02('0x13')](_0x0c02('0x11'))[_0x0c02('0x14')](','):null;},'comment':_0x0c02('0x15')},'dtmfmode':{'type':Sequelize[_0x0c02('0x3')]('rfc2833',_0x0c02('0x16'),_0x0c02('0x17'),_0x0c02('0x18'),_0x0c02('0x19')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no',_0x0c02('0x1b'),_0x0c02('0x1c'),_0x0c02('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0c02('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x0c02('0x1')],'defaultValue':_0x0c02('0x1e'),'set':function(_0x4a75bb){this[_0x0c02('0x10')](_0x0c02('0x1f'),_0x4a75bb?_0x4a75bb[_0x0c02('0x12')](','):null);},'get':function(){return this[_0x0c02('0x13')]('nat')?this[_0x0c02('0x13')](_0x0c02('0x1f'))[_0x0c02('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0c02('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0c02('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0c02('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0c02('0x1')],'defaultValue':_0x0c02('0x20')},'allow':{'type':Sequelize[_0x0c02('0x1')],'allowNull':![],'defaultValue':_0x0c02('0x21'),'set':function(_0x3cd902){this[_0x0c02('0x10')](_0x0c02('0x22'),_0x3cd902?_0x3cd902['join'](';'):_0x0c02('0x21'));},'get':function(){return this[_0x0c02('0x13')](_0x0c02('0x22'))?this['getDataValue'](_0x0c02('0x22'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no')},'insecure':{'type':Sequelize[_0x0c02('0x1')],'defaultValue':_0x0c02('0x23'),'set':function(_0x376871){this[_0x0c02('0x10')](_0x0c02('0x24'),_0x376871?_0x376871['join'](','):null);},'get':function(){return this[_0x0c02('0x13')](_0x0c02('0x24'))?this[_0x0c02('0x13')]('insecure')[_0x0c02('0x14')](','):null;},'comment':_0x0c02('0x25')},'trustrpid':{'type':Sequelize['ENUM'](_0x0c02('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no',_0x0c02('0x26'))},'promiscredir':{'type':Sequelize['ENUM'](_0x0c02('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0x0c02('0x3')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x0c02('0x1')]},'callerid':{'type':Sequelize[_0x0c02('0x1')],'defaultValue':_0x0c02('0x27')},'amaflags':{'type':Sequelize[_0x0c02('0x1')]},'callcounter':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no'),'defaultValue':_0x0c02('0x1a')},'busylevel':{'type':Sequelize[_0x0c02('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0c02('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x0c02('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x0c02('0x1a'),'no',_0x0c02('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0c02('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no')},'mailbox':{'type':Sequelize[_0x0c02('0x1')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x0c02('0x2a'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x0c02('0x3')]('uac','uas'),'defaultValue':_0x0c02('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x0c02('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x0c02('0x1')]},'fromuser':{'type':Sequelize[_0x0c02('0x1')]},'port':{'type':Sequelize[_0x0c02('0x28')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x0c02('0x1a'),'no'),'defaultValue':_0x0c02('0x1a')},'keepalive':{'type':Sequelize[_0x0c02('0x28')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x0c02('0x1')]},'rtptimeout':{'type':Sequelize[_0x0c02('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0c02('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0c02('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no',_0x0c02('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0c02('0x1')]},'callbackextension':{'type':Sequelize[_0x0c02('0x1')]},'timert1':{'type':Sequelize[_0x0c02('0x28')](0xb)},'timerb':{'type':Sequelize[_0x0c02('0x28')](0xb)},'qualifyfreq':{'type':Sequelize[_0x0c02('0x28')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x0c02('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x0c02('0x1')]},'use_q850_reason':{'type':Sequelize[_0x0c02('0x1')]},'maxforwards':{'type':Sequelize[_0x0c02('0x28')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x0c02('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no')},'force_avp':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x0c02('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x0c02('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no',_0x0c02('0x2d'),_0x0c02('0x2e'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x0c02('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x0c02('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x0c02('0x1')]},'dtlscapath':{'type':Sequelize[_0x0c02('0x1')]},'dtlssetup':{'type':Sequelize[_0x0c02('0x3')]('active',_0x0c02('0x2f'),_0x0c02('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0c02('0x1')]},'usereqphone':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0c02('0x1')]},'recordofffeature':{'type':Sequelize[_0x0c02('0x1')]},'call_limit':{'type':Sequelize[_0x0c02('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0c02('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no')},'vmexten':{'type':Sequelize[_0x0c02('0x1')]},'mohinterpret':{'type':Sequelize[_0x0c02('0x1')]},'mohsuggest':{'type':Sequelize[_0x0c02('0x1')]},'parkinglot':{'type':Sequelize[_0x0c02('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0c02('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x0c02('0x3')](_0x0c02('0x1a'),'no',_0x0c02('0x1b'),_0x0c02('0x1c'),_0x0c02('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0c02('0x1')]},'otherFields':{'type':Sequelize[_0x0c02('0x1')]},'active':{'type':Sequelize[_0x0c02('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0c02('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0xd13f=['\x22\x22\x20<>','always','refuse','originate','uac','uas','pai','certificate','active','passive','actpass','dynamic','update','sequelize','exports','STRING','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','inband','auto','rfc2833','yes','nonat','outgoing','force_rport,comedia','nat','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0xd13f,0x133));var _0xfd13=function(_0x15a316,_0x411f05){_0x15a316=_0x15a316-0x0;var _0x277ea3=_0xd13f[_0x15a316];return _0x277ea3;};'use strict';var Sequelize=require(_0xfd13('0x0'));module[_0xfd13('0x1')]={'name':{'type':Sequelize[_0xfd13('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x4'),'user',_0xfd13('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xfd13('0x2')],'allowNull':![],'defaultValue':_0xfd13('0x6')},'callingpres':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x7'),_0xfd13('0x8'),_0xfd13('0x9'),'ALLOWED',_0xfd13('0xa'),_0xfd13('0xb'),_0xfd13('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0xfd13('0x2')]},'permit':{'type':Sequelize[_0xfd13('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xfd13('0x2')]},'transport':{'type':Sequelize[_0xfd13('0x2')],'defaultValue':'udp','set':function(_0x402fa1){this[_0xfd13('0xd')](_0xfd13('0xe'),_0x402fa1?_0x402fa1[_0xfd13('0xf')](','):null);},'get':function(){return this[_0xfd13('0x10')](_0xfd13('0xe'))?this['getDataValue'](_0xfd13('0xe'))['split'](','):null;},'comment':_0xfd13('0x11')},'dtmfmode':{'type':Sequelize[_0xfd13('0x3')]('rfc2833','info','shortinfo',_0xfd13('0x12'),_0xfd13('0x13')),'defaultValue':_0xfd13('0x14')},'directmedia':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x15'),'no',_0xfd13('0x16'),'update',_0xfd13('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xfd13('0x15'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xfd13('0x2')]},'nat':{'type':Sequelize[_0xfd13('0x2')],'defaultValue':_0xfd13('0x18'),'set':function(_0x4f2312){this[_0xfd13('0xd')]('nat',_0x4f2312?_0x4f2312[_0xfd13('0xf')](','):null);},'get':function(){return this[_0xfd13('0x10')](_0xfd13('0x19'))?this['getDataValue']('nat')[_0xfd13('0x1a')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xfd13('0x2')]},'pickupgroup':{'type':Sequelize[_0xfd13('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xfd13('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xfd13('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xfd13('0x2')],'defaultValue':_0xfd13('0x1b')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfd13('0x1c'),'set':function(_0x41a3e5){this[_0xfd13('0xd')]('allow',_0x41a3e5?_0x41a3e5['join'](';'):_0xfd13('0x1c'));},'get':function(){return this['getDataValue']('allow')?this[_0xfd13('0x10')](_0xfd13('0x1d'))[_0xfd13('0x1a')](';'):null;},'comment':_0xfd13('0x1e')},'autoframing':{'type':Sequelize[_0xfd13('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0xfd13('0x2')],'defaultValue':_0xfd13('0x1f'),'set':function(_0x59b253){this[_0xfd13('0xd')](_0xfd13('0x20'),_0x59b253?_0x59b253['join'](','):null);},'get':function(){return this[_0xfd13('0x10')](_0xfd13('0x20'))?this['getDataValue'](_0xfd13('0x20'))[_0xfd13('0x1a')](','):null;},'comment':_0xfd13('0x21')},'trustrpid':{'type':Sequelize['ENUM'](_0xfd13('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xfd13('0x15'),'no',_0xfd13('0x22'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0xfd13('0x23')](0xb)},'setvar':{'type':Sequelize[_0xfd13('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xfd13('0x24')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x15'),'no'),'defaultValue':_0xfd13('0x15')},'busylevel':{'type':Sequelize[_0xfd13('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x15'),'no')},'allowsubscribe':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x15'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xfd13('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x15'),'no')},'subscribecontext':{'type':Sequelize[_0xfd13('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x15'),'no',_0xfd13('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xfd13('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x15'),'no')},'mailbox':{'type':Sequelize[_0xfd13('0x2')]},'session_timers':{'type':Sequelize[_0xfd13('0x3')]('accept',_0xfd13('0x26'),_0xfd13('0x27'))},'session_expires':{'type':Sequelize[_0xfd13('0x23')](0xb)},'session_minse':{'type':Sequelize[_0xfd13('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xfd13('0x28'),'uas'),'defaultValue':_0xfd13('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0xfd13('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xfd13('0x23')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xfd13('0x15'),'no'),'defaultValue':_0xfd13('0x15')},'keepalive':{'type':Sequelize[_0xfd13('0x23')](0xb)},'defaultip':{'type':Sequelize[_0xfd13('0x2')]},'defaultuser':{'type':Sequelize[_0xfd13('0x2')]},'rtptimeout':{'type':Sequelize[_0xfd13('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xfd13('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0xfd13('0x3')]('yes','no',_0xfd13('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xfd13('0x2')]},'callbackextension':{'type':Sequelize[_0xfd13('0x2')]},'timert1':{'type':Sequelize[_0xfd13('0x23')](0xb)},'timerb':{'type':Sequelize[_0xfd13('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0xfd13('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0xfd13('0x2')]},'contactdeny':{'type':Sequelize[_0xfd13('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xfd13('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x15'),'no')},'force_avp':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x15'),'no')},'icesupport':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x15'),'no')},'dtlsenable':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0xfd13('0x3')]('yes','no','fingerprint',_0xfd13('0x2b'))},'dtlsrekey':{'type':Sequelize[_0xfd13('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xfd13('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xfd13('0x2')]},'dtlscipher':{'type':Sequelize[_0xfd13('0x2')]},'dtlscafile':{'type':Sequelize[_0xfd13('0x2')]},'dtlscapath':{'type':Sequelize[_0xfd13('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xfd13('0x2c'),_0xfd13('0x2d'),_0xfd13('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xfd13('0x2')]},'usereqphone':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xfd13('0x2')]},'recordofffeature':{'type':Sequelize[_0xfd13('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xfd13('0x3')](_0xfd13('0x15'),'no')},'subscribemwi':{'type':Sequelize[_0xfd13('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0xfd13('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xfd13('0x2')]},'parkinglot':{'type':Sequelize[_0xfd13('0x2')]},'description':{'type':Sequelize[_0xfd13('0x2')]},'host':{'type':Sequelize[_0xfd13('0x2')],'defaultValue':_0xfd13('0x2f')},'canreinvite':{'type':Sequelize['ENUM']('yes','no','nonat',_0xfd13('0x30'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index a307c82..b528f5b 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 _0x9f62=['updatedAt','body','create','user','role','UserProfileSection','autoAssociation','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','render','/etc/asterisk/sip_xcally_trunks.conf','Reload','server/files/templates/registry.ejs','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','get','Trunks','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','map','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','Trunk','findAll','rows','show','params','clone','find','omit','createdAt'];(function(_0x27d0ad,_0x3f8bef){var _0x4eec43=function(_0x336bb6){while(--_0x336bb6){_0x27d0ad['push'](_0x27d0ad['shift']());}};_0x4eec43(++_0x3f8bef);}(_0x9f62,0x154));var _0x29f6=function(_0x2a1c69,_0x3f7a5a){_0x2a1c69=_0x2a1c69-0x0;var _0x478cc0=_0x9f62[_0x2a1c69];return _0x478cc0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29f6('0x1'));var rp=require(_0x29f6('0x2'));var moment=require(_0x29f6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29f6('0x4'));var path=require(_0x29f6('0x5'));var sox=require(_0x29f6('0x6'));var csv=require(_0x29f6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29f6('0x8'));var _=require(_0x29f6('0x9'));var squel=require(_0x29f6('0xa'));var crypto=require(_0x29f6('0xb'));var jsforce=require(_0x29f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29f6('0xd'));var authService=require(_0x29f6('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29f6('0xf'));var logger=require(_0x29f6('0x10'))('api');var utils=require(_0x29f6('0x11'));var config=require(_0x29f6('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x29f6('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x55cf4,_0x189344,_0x11a1fd,_0x17de6e){return new BPromise(function(_0x156c96,_0x35d2e2){var _0x2418ee=_0x17de6e||client;return _0x2418ee[_0x29f6('0x14')](_0x55cf4,_0x11a1fd)[_0x29f6('0x15')](function(_0x28d314){logger[_0x29f6('0x16')](_0x29f6('0x17'),_0x189344,_0x29f6('0x18'));logger[_0x29f6('0x19')](_0x29f6('0x1a'),_0x189344,_0x29f6('0x18'),JSON['stringify'](_0x28d314));if(_0x28d314['error']){if(_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){logger[_0x29f6('0x1b')]('Trunk,\x20%s,\x20%s',_0x189344,_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x35d2e2(_0x28d314['error'][_0x29f6('0x1d')]);}logger[_0x29f6('0x1b')](_0x29f6('0x17'),_0x189344,_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x156c96(_0x28d314[_0x29f6('0x1b')]['message']);}else{logger[_0x29f6('0x16')]('Trunk,\x20%s,\x20%s',_0x189344,'request\x20sent');_0x156c96(_0x28d314[_0x29f6('0x1e')][_0x29f6('0x1d')]);}})[_0x29f6('0x1f')](function(_0xafb5dd){logger['error'](_0x29f6('0x17'),_0x189344,_0xafb5dd);_0x35d2e2(_0xafb5dd);});});}function respondWithStatusCode(_0x49f67d,_0xd4179c){_0xd4179c=_0xd4179c||0xcc;return function(_0xcce041){if(_0xcce041){return _0x49f67d[_0x29f6('0x20')](_0xd4179c);}return _0x49f67d[_0x29f6('0x21')](_0xd4179c)['end']();};}function respondWithResult(_0x4290a2,_0x4d494f){_0x4d494f=_0x4d494f||0xc8;return function(_0x47c385){if(_0x47c385){return _0x4290a2[_0x29f6('0x21')](_0x4d494f)[_0x29f6('0x22')](_0x47c385);}};}function respondWithFilteredResult(_0x2519ac,_0x342038){return function(_0x84ccb7){if(_0x84ccb7){var _0x4333bc=typeof _0x342038[_0x29f6('0x23')]==='undefined'&&typeof _0x342038[_0x29f6('0x24')]===_0x29f6('0x25');var _0x1ab8d8=_0x84ccb7[_0x29f6('0x26')];var _0xda0a63=_0x4333bc?0x0:_0x342038[_0x29f6('0x23')];var _0x3790f5=_0x4333bc?_0x84ccb7[_0x29f6('0x26')]:_0x342038[_0x29f6('0x23')]+_0x342038[_0x29f6('0x24')];var _0x2915bc;if(_0x3790f5>=_0x1ab8d8){_0x3790f5=_0x1ab8d8;_0x2915bc=0xc8;}else{_0x2915bc=0xce;}_0x2519ac[_0x29f6('0x21')](_0x2915bc);return _0x2519ac[_0x29f6('0x27')](_0x29f6('0x28'),_0xda0a63+'-'+_0x3790f5+'/'+_0x1ab8d8)[_0x29f6('0x22')](_0x84ccb7);}return null;};}function patchUpdates(_0x218931){return function(_0x3a7249){try{jsonpatch['apply'](_0x3a7249,_0x218931,!![]);}catch(_0x5582d3){return BPromise[_0x29f6('0x29')](_0x5582d3);}return _0x3a7249['save']();};}function saveUpdates(_0x341071,_0xc8d2c5){return function(_0x1e1bb6){if(_0x1e1bb6){return _0x1e1bb6[_0x29f6('0x2a')](_0x341071)['then'](function(_0x53e11f){return _0x53e11f;});}return null;};}function removeEntity(_0x1bde69,_0xa6377c){return function(_0x2edc2e){if(_0x2edc2e){return _0x2edc2e[_0x29f6('0x2b')]()[_0x29f6('0x15')](function(){var _0x20bc5e=_0x2edc2e[_0x29f6('0x2c')]({'plain':!![]});var _0x1c3f0f=_0x29f6('0x2d');return db[_0x29f6('0x2e')][_0x29f6('0x2b')]({'where':{'type':_0x1c3f0f,'resourceId':_0x20bc5e['id']}})[_0x29f6('0x15')](function(){return _0x2edc2e;});})[_0x29f6('0x15')](function(){_0x1bde69[_0x29f6('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e31dd,_0x206beb){return function(_0x44cf19){if(!_0x44cf19){_0x5e31dd[_0x29f6('0x20')](0x194);}return _0x44cf19;};}function handleError(_0x5416dc,_0x3e1e25){_0x3e1e25=_0x3e1e25||0x1f4;return function(_0x749b9d){logger[_0x29f6('0x1b')](_0x749b9d[_0x29f6('0x2f')]);if(_0x749b9d[_0x29f6('0x30')]){delete _0x749b9d['name'];}_0x5416dc[_0x29f6('0x21')](_0x3e1e25)[_0x29f6('0x31')](_0x749b9d);};}exports[_0x29f6('0x32')]=function(_0x1b51cc,_0x4f5fe1){var _0x30d747={},_0x2a09e8={},_0x14b392={'count':0x0,'rows':[]};var _0x105557=_['map'](db['Trunk'][_0x29f6('0x33')],function(_0x4bfc80){return{'name':_0x4bfc80[_0x29f6('0x34')],'type':_0x4bfc80['type'][_0x29f6('0x35')]};});_0x2a09e8['model']=_[_0x29f6('0x36')](_0x105557,_0x29f6('0x30'));_0x2a09e8['query']=_[_0x29f6('0x37')](_0x1b51cc['query']);_0x2a09e8[_0x29f6('0x38')]=_[_0x29f6('0x39')](_0x2a09e8['model'],_0x2a09e8[_0x29f6('0x3a')]);_0x30d747[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x2a09e8[_0x29f6('0x3c')],qs['fields'](_0x1b51cc[_0x29f6('0x3a')][_0x29f6('0x3d')]));_0x30d747[_0x29f6('0x3b')]=_0x30d747[_0x29f6('0x3b')][_0x29f6('0x3e')]?_0x30d747['attributes']:_0x2a09e8[_0x29f6('0x3c')];if(!_0x1b51cc['query'][_0x29f6('0x3f')]('nolimit')){_0x30d747[_0x29f6('0x24')]=qs[_0x29f6('0x24')](_0x1b51cc['query'][_0x29f6('0x24')]);_0x30d747[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x1b51cc[_0x29f6('0x3a')]['offset']);}_0x30d747[_0x29f6('0x40')]=qs[_0x29f6('0x41')](_0x1b51cc[_0x29f6('0x3a')]['sort']);_0x30d747[_0x29f6('0x42')]=qs['filters'](_[_0x29f6('0x43')](_0x1b51cc['query'],_0x2a09e8['filters']),_0x105557);if(_0x1b51cc['query'][_0x29f6('0x44')]){_0x30d747[_0x29f6('0x42')]=_[_0x29f6('0x45')](_0x30d747[_0x29f6('0x42')],{'$or':_[_0x29f6('0x36')](_0x105557,function(_0x270842){if(_0x270842[_0x29f6('0x46')]!==_0x29f6('0x47')){var _0x352119={};_0x352119[_0x270842[_0x29f6('0x30')]]={'$like':'%'+_0x1b51cc['query']['filter']+'%'};return _0x352119;}})});}_0x30d747=_[_0x29f6('0x45')]({},_0x30d747,_0x1b51cc[_0x29f6('0x48')]);var _0x7a65c0={'where':_0x30d747[_0x29f6('0x42')]};return db['Trunk'][_0x29f6('0x26')](_0x7a65c0)[_0x29f6('0x15')](function(_0x532df5){_0x14b392[_0x29f6('0x26')]=_0x532df5;if(_0x1b51cc[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x30d747[_0x29f6('0x4a')]=[{'all':!![]}];}return db[_0x29f6('0x4b')][_0x29f6('0x4c')](_0x30d747);})[_0x29f6('0x15')](function(_0x1f03b6){_0x14b392[_0x29f6('0x4d')]=_0x1f03b6;return _0x14b392;})[_0x29f6('0x15')](respondWithFilteredResult(_0x4f5fe1,_0x30d747))[_0x29f6('0x1f')](handleError(_0x4f5fe1,null));};exports[_0x29f6('0x4e')]=function(_0x58ea69,_0x416c24){var _0x463551={'raw':![],'where':{'id':_0x58ea69[_0x29f6('0x4f')]['id']}},_0x335ec1={};_0x335ec1[_0x29f6('0x3c')]=_['keys'](db[_0x29f6('0x4b')]['rawAttributes']);_0x335ec1['query']=_[_0x29f6('0x37')](_0x58ea69[_0x29f6('0x3a')]);_0x335ec1[_0x29f6('0x38')]=_[_0x29f6('0x39')](_0x335ec1[_0x29f6('0x3c')],_0x335ec1['query']);_0x463551[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x335ec1['model'],qs[_0x29f6('0x3d')](_0x58ea69['query'][_0x29f6('0x3d')]));_0x463551[_0x29f6('0x3b')]=_0x463551[_0x29f6('0x3b')][_0x29f6('0x3e')]?_0x463551['attributes']:_0x335ec1[_0x29f6('0x3c')];if(_0x58ea69[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x463551[_0x29f6('0x4a')]=[{'all':!![]}];}_0x463551=_[_0x29f6('0x45')]({},_0x463551,_0x58ea69[_0x29f6('0x48')]);return db[_0x29f6('0x4b')]['find'](_0x463551)[_0x29f6('0x15')](handleEntityNotFound(_0x416c24,null))[_0x29f6('0x15')](respondWithResult(_0x416c24,null))[_0x29f6('0x1f')](handleError(_0x416c24,null));};exports[_0x29f6('0x50')]=function(_0x36e52c,_0x1ac20d){var _0x37c3c1={'where':{'id':_0x36e52c[_0x29f6('0x4f')]['id']}},_0x2f356d={};_0x2f356d[_0x29f6('0x3c')]=_['keys'](db['Trunk'][_0x29f6('0x33')]);_0x37c3c1[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x2f356d['model'],qs[_0x29f6('0x3d')](_0x36e52c['query']['fields']));_0x37c3c1[_0x29f6('0x3b')]=_0x37c3c1[_0x29f6('0x3b')]['length']?_0x37c3c1['attributes']:_0x2f356d[_0x29f6('0x3c')];if(_0x36e52c[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x37c3c1['include']=[{'all':!![]}];}_0x37c3c1=_[_0x29f6('0x45')]({},_0x37c3c1,_0x36e52c[_0x29f6('0x48')]);return db[_0x29f6('0x4b')][_0x29f6('0x51')](_0x37c3c1)[_0x29f6('0x15')](handleEntityNotFound(_0x1ac20d,null))[_0x29f6('0x15')](function(_0x7700da){if(_0x7700da){var _0x33b1d7=_0x7700da[_0x29f6('0x2c')]({'plain':!![]});_0x33b1d7=qs[_0x29f6('0x52')](_0x33b1d7,['id',_0x29f6('0x53'),_0x29f6('0x54')]);_0x36e52c[_0x29f6('0x55')]=_['omit'](_0x36e52c['body'],['id',_0x29f6('0x53'),'updatedAt']);return db[_0x29f6('0x4b')][_0x29f6('0x56')](_[_0x29f6('0x45')](_0x33b1d7,_0x36e52c[_0x29f6('0x55')]),{'include':_0x36e52c[_0x29f6('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x29f6('0x15')](function(_0x38d684){var _0x2f694e=_0x36e52c[_0x29f6('0x57')][_0x29f6('0x2c')]({'plain':!![]});if(!_0x2f694e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f694e[_0x29f6('0x58')]==='user'){var _0x51b9dc=_0x38d684[_0x29f6('0x2c')]({'plain':!![]});var _0x336b8e='Trunks';return db[_0x29f6('0x59')][_0x29f6('0x51')]({'where':{'name':_0x336b8e,'userProfileId':_0x2f694e['userProfileId']},'raw':!![]})[_0x29f6('0x15')](function(_0x2ba44c){if(_0x2ba44c&&_0x2ba44c[_0x29f6('0x5a')]===0x0){return db[_0x29f6('0x2e')][_0x29f6('0x56')]({'name':_0x51b9dc[_0x29f6('0x30')],'resourceId':_0x51b9dc['id'],'type':_0x2ba44c[_0x29f6('0x30')],'sectionId':_0x2ba44c['id']},{})['then'](function(){return _0x38d684;});}else{return _0x38d684;}})[_0x29f6('0x1f')](function(_0x50ddd6){logger[_0x29f6('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50ddd6);throw _0x50ddd6;});}return _0x38d684;});}})['then'](respondWithResult(_0x1ac20d,0xc9))[_0x29f6('0x1f')](handleError(_0x1ac20d,null));};exports[_0x29f6('0x56')]=function(_0x195887,_0x536b0c,_0x6ae738){var _0x373cf6;return db[_0x29f6('0x4b')]['create'](_0x195887[_0x29f6('0x55')],{'raw':!![]})[_0x29f6('0x15')](function(_0x66a7bb){_0x373cf6=_0x66a7bb;return db[_0x29f6('0x4b')][_0x29f6('0x4c')]({'raw':!![]});})[_0x29f6('0x15')](function(_0x6587f3){var _0x41c1b9=fs['readFileSync'](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0x1636f1=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],'server/files/templates/registry.ejs'),_0x29f6('0x5e'));var _0x1ca187=ejs['render'](_0x41c1b9,{'trunks':_0x6587f3||[]});fs[_0x29f6('0x60')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ca187);if(_0x373cf6[_0x29f6('0x61')]){var _0x5a383f=ejs['render'](_0x1636f1,{'trunks':_0x6587f3||[]});fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x5a383f);}})['then'](function(){return respondWithRpcPromise('Reload','create',{'module':_0x29f6('0x63')});})[_0x29f6('0x15')](function(){var _0x144c76=_0x195887[_0x29f6('0x57')][_0x29f6('0x2c')]({'plain':!![]});if(!_0x144c76)throw new Error(_0x29f6('0x64'));if(_0x144c76[_0x29f6('0x58')]==='user'){var _0x11ef85=_0x373cf6[_0x29f6('0x2c')]({'plain':!![]});return db[_0x29f6('0x59')][_0x29f6('0x51')]({'where':{'name':'Trunks','userProfileId':_0x144c76[_0x29f6('0x65')]},'raw':!![]})[_0x29f6('0x15')](function(_0x32a862){if(_0x32a862&&_0x32a862[_0x29f6('0x5a')]===0x0){return db[_0x29f6('0x2e')]['create']({'name':_0x11ef85[_0x29f6('0x30')],'resourceId':_0x11ef85['id'],'type':_0x32a862[_0x29f6('0x30')],'sectionId':_0x32a862['id']},{})[_0x29f6('0x15')](function(){return _0x373cf6;});}else{return _0x373cf6;}})[_0x29f6('0x1f')](function(_0x4273a3){logger[_0x29f6('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4273a3);throw _0x4273a3;});}return _0x373cf6;})[_0x29f6('0x15')](respondWithResult(_0x536b0c,0xc9))['catch'](handleError(_0x536b0c,null));};exports['update']=function(_0x4f9907,_0x842ae3,_0x5bcf90){var _0x425da2;return db[_0x29f6('0x4b')][_0x29f6('0x51')]({'where':{'id':_0x4f9907[_0x29f6('0x4f')]['id']}})[_0x29f6('0x15')](handleEntityNotFound(_0x842ae3,null))[_0x29f6('0x15')](saveUpdates(_0x4f9907[_0x29f6('0x55')],null))['then'](function(_0x3a23f3){if(_0x3a23f3){_0x425da2=_0x3a23f3;return db['Trunk'][_0x29f6('0x4c')]({'raw':!![]});}})[_0x29f6('0x15')](function(_0x32fa77){if(_0x32fa77){var _0x1d6e32=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0xe14459=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0xa31c7d=ejs[_0x29f6('0x66')](_0x1d6e32,{'trunks':_0x32fa77||[]});fs['writeFileSync'](_0x29f6('0x67'),_0xa31c7d);var _0x57b9fb=ejs[_0x29f6('0x66')](_0xe14459,{'trunks':_0x32fa77||[]});fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x57b9fb);return respondWithRpcPromise(_0x29f6('0x68'),_0x29f6('0x2a'),{'module':_0x29f6('0x63')});}return null;})[_0x29f6('0x15')](function(_0x4203f1){if(_0x4203f1){return _0x425da2;}})[_0x29f6('0x15')](respondWithResult(_0x842ae3,null))[_0x29f6('0x1f')](handleError(_0x842ae3,null));};exports['destroy']=function(_0x1d61ff,_0x4c0acc,_0x16bb3c){var _0x144d8c;return db[_0x29f6('0x4b')][_0x29f6('0x51')]({'where':{'id':_0x1d61ff[_0x29f6('0x4f')]['id']}})[_0x29f6('0x15')](handleEntityNotFound(_0x4c0acc,null))[_0x29f6('0x15')](removeEntity(_0x4c0acc,null))[_0x29f6('0x15')](function(){return db['Trunk'][_0x29f6('0x4c')]({'raw':!![]});})[_0x29f6('0x15')](function(_0x4e185f){var _0x4bb53f=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0x906098=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x69')),_0x29f6('0x5e'));var _0x3f51fa=ejs['render'](_0x4bb53f,{'trunks':_0x4e185f});var _0x4b9631=ejs[_0x29f6('0x66')](_0x906098,{'trunks':_0x4e185f});fs[_0x29f6('0x60')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3f51fa);fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x4b9631);return respondWithRpcPromise(_0x29f6('0x68'),_0x29f6('0x2b'),{'module':_0x29f6('0x63')});})[_0x29f6('0x1f')](handleError(_0x4c0acc,null));}; \ No newline at end of file +var _0x425d=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','/etc/asterisk/sip_xcally_trunks.conf','destroy','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','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','find','omit','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8'];(function(_0x9267b2,_0x31e13a){var _0xdfb1ea=function(_0x51f47e){while(--_0x51f47e){_0x9267b2['push'](_0x9267b2['shift']());}};_0xdfb1ea(++_0x31e13a);}(_0x425d,0x1e0));var _0xd425=function(_0x15fa77,_0x93eaff){_0x15fa77=_0x15fa77-0x0;var _0x1385ff=_0x425d[_0x15fa77];return _0x1385ff;};'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 jayson=require(_0xd425('0x1d'));var client=jayson[_0xd425('0x1e')][_0xd425('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x18eafb,_0x51263f,_0x27318c,_0x17a498){return new BPromise(function(_0x336dc3,_0x5d3d60){var _0x309263=_0x17a498||client;return _0x309263[_0xd425('0x20')](_0x18eafb,_0x27318c)[_0xd425('0x21')](function(_0x41f34d){logger[_0xd425('0x22')]('Trunk,\x20%s,\x20%s',_0x51263f,_0xd425('0x23'));logger[_0xd425('0x24')](_0xd425('0x25'),_0x51263f,_0xd425('0x23'),JSON['stringify'](_0x41f34d));if(_0x41f34d[_0xd425('0x26')]){if(_0x41f34d[_0xd425('0x26')][_0xd425('0x27')]===0x1f4){logger[_0xd425('0x26')]('Trunk,\x20%s,\x20%s',_0x51263f,_0x41f34d['error']['message']);return _0x5d3d60(_0x41f34d['error'][_0xd425('0x28')]);}logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x41f34d['error'][_0xd425('0x28')]);return _0x336dc3(_0x41f34d[_0xd425('0x26')]['message']);}else{logger[_0xd425('0x22')](_0xd425('0x29'),_0x51263f,_0xd425('0x23'));_0x336dc3(_0x41f34d[_0xd425('0x2a')][_0xd425('0x28')]);}})[_0xd425('0x2b')](function(_0x2480a0){logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x2480a0);_0x5d3d60(_0x2480a0);});});}function respondWithStatusCode(_0x2b030b,_0x151ad9){_0x151ad9=_0x151ad9||0xcc;return function(_0x40e84b){if(_0x40e84b){return _0x2b030b['sendStatus'](_0x151ad9);}return _0x2b030b[_0xd425('0x2c')](_0x151ad9)[_0xd425('0x2d')]();};}function respondWithResult(_0x398985,_0x1908a5){_0x1908a5=_0x1908a5||0xc8;return function(_0x2afcdb){if(_0x2afcdb){return _0x398985[_0xd425('0x2c')](_0x1908a5)[_0xd425('0x2e')](_0x2afcdb);}};}function respondWithFilteredResult(_0x577e4b,_0x12f951){return function(_0x177de2){if(_0x177de2){var _0x1d8861=typeof _0x12f951['offset']===_0xd425('0x2f')&&typeof _0x12f951[_0xd425('0x30')]===_0xd425('0x2f');var _0x999fb9=_0x177de2[_0xd425('0x31')];var _0x185d7e=_0x1d8861?0x0:_0x12f951[_0xd425('0x32')];var _0x37b63c=_0x1d8861?_0x177de2[_0xd425('0x31')]:_0x12f951[_0xd425('0x32')]+_0x12f951['limit'];var _0x471e3e;if(_0x37b63c>=_0x999fb9){_0x37b63c=_0x999fb9;_0x471e3e=0xc8;}else{_0x471e3e=0xce;}_0x577e4b[_0xd425('0x2c')](_0x471e3e);return _0x577e4b[_0xd425('0x33')](_0xd425('0x34'),_0x185d7e+'-'+_0x37b63c+'/'+_0x999fb9)[_0xd425('0x2e')](_0x177de2);}return null;};}function patchUpdates(_0x1abf33){return function(_0x47405f){try{jsonpatch[_0xd425('0x35')](_0x47405f,_0x1abf33,!![]);}catch(_0x3ec51b){return BPromise[_0xd425('0x36')](_0x3ec51b);}return _0x47405f[_0xd425('0x37')]();};}function saveUpdates(_0x5f3dab,_0x316493){return function(_0x2a2a9b){if(_0x2a2a9b){return _0x2a2a9b[_0xd425('0x38')](_0x5f3dab)[_0xd425('0x21')](function(_0x28870f){return _0x28870f;});}return null;};}function removeEntity(_0x4eddbc,_0x4aa168){return function(_0x3badcc){if(_0x3badcc){return _0x3badcc['destroy']()['then'](function(){var _0x51669d=_0x3badcc[_0xd425('0x39')]({'plain':!![]});var _0xfb0c8=_0xd425('0x3a');return db[_0xd425('0x3b')]['destroy']({'where':{'type':_0xfb0c8,'resourceId':_0x51669d['id']}})[_0xd425('0x21')](function(){return _0x3badcc;});})[_0xd425('0x21')](function(){_0x4eddbc[_0xd425('0x2c')](0xcc)[_0xd425('0x2d')]();});}};}function handleEntityNotFound(_0x27b9e2,_0x1e12f2){return function(_0x35bbec){if(!_0x35bbec){_0x27b9e2['sendStatus'](0x194);}return _0x35bbec;};}function handleError(_0x363fb0,_0x59b3d3){_0x59b3d3=_0x59b3d3||0x1f4;return function(_0x22df81){logger[_0xd425('0x26')](_0x22df81[_0xd425('0x3c')]);if(_0x22df81['name']){delete _0x22df81[_0xd425('0x3d')];}_0x363fb0[_0xd425('0x2c')](_0x59b3d3)[_0xd425('0x3e')](_0x22df81);};}exports[_0xd425('0x3f')]=function(_0x58f36d,_0x1d38fa){var _0x3cf540={},_0x59e326={},_0x5d310e={'count':0x0,'rows':[]};var _0x48fc85=_[_0xd425('0x40')](db[_0xd425('0x41')][_0xd425('0x42')],function(_0x588688){return{'name':_0x588688['fieldName'],'type':_0x588688['type'][_0xd425('0x43')]};});_0x59e326[_0xd425('0x44')]=_[_0xd425('0x40')](_0x48fc85,_0xd425('0x3d'));_0x59e326[_0xd425('0x45')]=_[_0xd425('0x46')](_0x58f36d[_0xd425('0x45')]);_0x59e326['filters']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],_0x59e326[_0xd425('0x45')]);_0x3cf540['attributes']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],qs[_0xd425('0x48')](_0x58f36d['query'][_0xd425('0x48')]));_0x3cf540[_0xd425('0x49')]=_0x3cf540[_0xd425('0x49')][_0xd425('0x4a')]?_0x3cf540['attributes']:_0x59e326[_0xd425('0x44')];if(!_0x58f36d[_0xd425('0x45')][_0xd425('0x4b')](_0xd425('0x4c'))){_0x3cf540[_0xd425('0x30')]=qs[_0xd425('0x30')](_0x58f36d[_0xd425('0x45')]['limit']);_0x3cf540[_0xd425('0x32')]=qs[_0xd425('0x32')](_0x58f36d['query'][_0xd425('0x32')]);}_0x3cf540['order']=qs['sort'](_0x58f36d[_0xd425('0x45')]['sort']);_0x3cf540[_0xd425('0x4d')]=qs['filters'](_[_0xd425('0x4e')](_0x58f36d[_0xd425('0x45')],_0x59e326[_0xd425('0x4f')]),_0x48fc85);if(_0x58f36d[_0xd425('0x45')][_0xd425('0x50')]){_0x3cf540['where']=_[_0xd425('0x51')](_0x3cf540['where'],{'$or':_[_0xd425('0x40')](_0x48fc85,function(_0x55a15d){if(_0x55a15d[_0xd425('0x52')]!==_0xd425('0x53')){var _0x3fd2ce={};_0x3fd2ce[_0x55a15d[_0xd425('0x3d')]]={'$like':'%'+_0x58f36d[_0xd425('0x45')]['filter']+'%'};return _0x3fd2ce;}})});}_0x3cf540=_[_0xd425('0x51')]({},_0x3cf540,_0x58f36d[_0xd425('0x54')]);var _0x35e77b={'where':_0x3cf540[_0xd425('0x4d')]};return db[_0xd425('0x41')]['count'](_0x35e77b)[_0xd425('0x21')](function(_0x177704){_0x5d310e[_0xd425('0x31')]=_0x177704;if(_0x58f36d[_0xd425('0x45')][_0xd425('0x55')]){_0x3cf540[_0xd425('0x56')]=[{'all':!![]}];}return db['Trunk'][_0xd425('0x57')](_0x3cf540);})[_0xd425('0x21')](function(_0x5bfac6){_0x5d310e[_0xd425('0x58')]=_0x5bfac6;return _0x5d310e;})[_0xd425('0x21')](respondWithFilteredResult(_0x1d38fa,_0x3cf540))[_0xd425('0x2b')](handleError(_0x1d38fa,null));};exports[_0xd425('0x59')]=function(_0x5c0219,_0x54f1d){var _0x2b8882={'raw':![],'where':{'id':_0x5c0219[_0xd425('0x5a')]['id']}},_0x4552cd={};_0x4552cd[_0xd425('0x44')]=_['keys'](db['Trunk'][_0xd425('0x42')]);_0x4552cd['query']=_[_0xd425('0x46')](_0x5c0219[_0xd425('0x45')]);_0x4552cd['filters']=_[_0xd425('0x47')](_0x4552cd['model'],_0x4552cd['query']);_0x2b8882[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4552cd[_0xd425('0x44')],qs[_0xd425('0x48')](_0x5c0219[_0xd425('0x45')][_0xd425('0x48')]));_0x2b8882[_0xd425('0x49')]=_0x2b8882[_0xd425('0x49')]['length']?_0x2b8882[_0xd425('0x49')]:_0x4552cd[_0xd425('0x44')];if(_0x5c0219[_0xd425('0x45')][_0xd425('0x55')]){_0x2b8882[_0xd425('0x56')]=[{'all':!![]}];}_0x2b8882=_[_0xd425('0x51')]({},_0x2b8882,_0x5c0219[_0xd425('0x54')]);return db[_0xd425('0x41')]['find'](_0x2b8882)['then'](handleEntityNotFound(_0x54f1d,null))['then'](respondWithResult(_0x54f1d,null))[_0xd425('0x2b')](handleError(_0x54f1d,null));};exports[_0xd425('0x5b')]=function(_0x3dec61,_0x3c6b49){var _0x59c286={'where':{'id':_0x3dec61['params']['id']}},_0x4fedc0={};_0x4fedc0['model']=_[_0xd425('0x46')](db[_0xd425('0x41')]['rawAttributes']);_0x59c286[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4fedc0[_0xd425('0x44')],qs['fields'](_0x3dec61['query'][_0xd425('0x48')]));_0x59c286['attributes']=_0x59c286['attributes']['length']?_0x59c286[_0xd425('0x49')]:_0x4fedc0[_0xd425('0x44')];if(_0x3dec61[_0xd425('0x45')]['includeAll']){_0x59c286[_0xd425('0x56')]=[{'all':!![]}];}_0x59c286=_['merge']({},_0x59c286,_0x3dec61[_0xd425('0x54')]);return db[_0xd425('0x41')][_0xd425('0x5c')](_0x59c286)[_0xd425('0x21')](handleEntityNotFound(_0x3c6b49,null))[_0xd425('0x21')](function(_0xd261a){if(_0xd261a){var _0xa21f7c=_0xd261a[_0xd425('0x39')]({'plain':!![]});_0xa21f7c=qs[_0xd425('0x5d')](_0xa21f7c,['id','createdAt',_0xd425('0x5e')]);_0x3dec61[_0xd425('0x5f')]=_[_0xd425('0x5d')](_0x3dec61[_0xd425('0x5f')],['id','createdAt','updatedAt']);return db[_0xd425('0x41')][_0xd425('0x60')](_[_0xd425('0x51')](_0xa21f7c,_0x3dec61[_0xd425('0x5f')]),{'include':_0x3dec61[_0xd425('0x45')][_0xd425('0x55')]?[{'all':!![]}]:undefined})[_0xd425('0x21')](function(_0x44782a){var _0x1fcde4=_0x3dec61[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x1fcde4)throw new Error(_0xd425('0x62'));if(_0x1fcde4[_0xd425('0x63')]===_0xd425('0x61')){var _0x5e72db=_0x44782a[_0xd425('0x39')]({'plain':!![]});var _0x343cc1=_0xd425('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x343cc1,'userProfileId':_0x1fcde4['userProfileId']},'raw':!![]})[_0xd425('0x21')](function(_0x34d065){if(_0x34d065&&_0x34d065[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x5e72db['name'],'resourceId':_0x5e72db['id'],'type':_0x34d065[_0xd425('0x3d')],'sectionId':_0x34d065['id']},{})[_0xd425('0x21')](function(){return _0x44782a;});}else{return _0x44782a;}})[_0xd425('0x2b')](function(_0x5113fc){logger[_0xd425('0x26')](_0xd425('0x65'),_0x5113fc);throw _0x5113fc;});}return _0x44782a;});}})[_0xd425('0x21')](respondWithResult(_0x3c6b49,0xc9))[_0xd425('0x2b')](handleError(_0x3c6b49,null));};exports[_0xd425('0x60')]=function(_0x43b1a9,_0x38a762,_0x44db7f){var _0xcb1a64;return db[_0xd425('0x41')][_0xd425('0x60')](_0x43b1a9[_0xd425('0x5f')],{'raw':!![]})[_0xd425('0x21')](function(_0x285d54){_0xcb1a64=_0x285d54;return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})[_0xd425('0x21')](function(_0x25cae6){var _0x541218=fs['readFileSync'](path[_0xd425('0x66')](config['root'],_0xd425('0x67')),_0xd425('0x68'));var _0xb407bb=fs[_0xd425('0x69')](path['join'](config[_0xd425('0x6a')],_0xd425('0x6b')),_0xd425('0x68'));var _0x689332=ejs[_0xd425('0x6c')](_0x541218,{'trunks':_0x25cae6||[]});fs[_0xd425('0x6d')]('/etc/asterisk/sip_xcally_trunks.conf',_0x689332);if(_0xcb1a64['registry']){var _0x3ccffe=ejs[_0xd425('0x6c')](_0xb407bb,{'trunks':_0x25cae6||[]});fs['writeFileSync'](_0xd425('0x6e'),_0x3ccffe);}})['then'](function(){return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x60'),{'module':_0xd425('0x70')});})[_0xd425('0x21')](function(){var _0x376134=_0x43b1a9[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x376134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x376134[_0xd425('0x63')]===_0xd425('0x61')){var _0x24af3=_0xcb1a64[_0xd425('0x39')]({'plain':!![]});return db[_0xd425('0x71')]['find']({'where':{'name':_0xd425('0x3a'),'userProfileId':_0x376134[_0xd425('0x72')]},'raw':!![]})['then'](function(_0x2bb36f){if(_0x2bb36f&&_0x2bb36f[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x24af3[_0xd425('0x3d')],'resourceId':_0x24af3['id'],'type':_0x2bb36f[_0xd425('0x3d')],'sectionId':_0x2bb36f['id']},{})[_0xd425('0x21')](function(){return _0xcb1a64;});}else{return _0xcb1a64;}})[_0xd425('0x2b')](function(_0x572f23){logger[_0xd425('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572f23);throw _0x572f23;});}return _0xcb1a64;})[_0xd425('0x21')](respondWithResult(_0x38a762,0xc9))[_0xd425('0x2b')](handleError(_0x38a762,null));};exports['update']=function(_0x2bf8e6,_0xcf7b51,_0x66d87b){var _0x1fc64d;return db['Trunk']['find']({'where':{'id':_0x2bf8e6[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0xcf7b51,null))[_0xd425('0x21')](saveUpdates(_0x2bf8e6['body'],null))[_0xd425('0x21')](function(_0xb1479e){if(_0xb1479e){_0x1fc64d=_0xb1479e;return db['Trunk'][_0xd425('0x57')]({'raw':!![]});}})['then'](function(_0x998ad1){if(_0x998ad1){var _0x46346c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config['root'],'server/files/templates/trunk.ejs'),_0xd425('0x68'));var _0x413a65=fs['readFileSync'](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x369f8b=ejs[_0xd425('0x6c')](_0x46346c,{'trunks':_0x998ad1||[]});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x369f8b);var _0xf251e6=ejs[_0xd425('0x6c')](_0x413a65,{'trunks':_0x998ad1||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf251e6);return respondWithRpcPromise(_0xd425('0x6f'),'update',{'module':_0xd425('0x70')});}return null;})[_0xd425('0x21')](function(_0x58cad5){if(_0x58cad5){return _0x1fc64d;}})[_0xd425('0x21')](respondWithResult(_0xcf7b51,null))[_0xd425('0x2b')](handleError(_0xcf7b51,null));};exports['destroy']=function(_0x592c40,_0x750685,_0x242ed8){var _0x16eac6;return db[_0xd425('0x41')][_0xd425('0x5c')]({'where':{'id':_0x592c40[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0x750685,null))[_0xd425('0x21')](removeEntity(_0x750685,null))['then'](function(){return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})['then'](function(_0x2bbcf3){var _0x1d386c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],_0xd425('0x67')),_0xd425('0x68'));var _0x2c3995=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x498e81=ejs['render'](_0x1d386c,{'trunks':_0x2bbcf3});var _0x2c8d63=ejs['render'](_0x2c3995,{'trunks':_0x2bbcf3});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x498e81);fs[_0xd425('0x6d')](_0xd425('0x6e'),_0x2c8d63);return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x74'),{'module':_0xd425('0x70')});})['catch'](handleError(_0x750685,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 65fcb16..b4a66aa 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 _0xc113=['request-promise','path','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','../../config/logger','moment','bluebird'];(function(_0x42f3ee,_0x309074){var _0xc9e8e9=function(_0x244b65){while(--_0x244b65){_0x42f3ee['push'](_0x42f3ee['shift']());}};_0xc9e8e9(++_0x309074);}(_0xc113,0x110));var _0x3c11=function(_0x31045a,_0x3fe1bf){_0x31045a=_0x31045a-0x0;var _0x48ec81=_0xc113[_0x31045a];return _0x48ec81;};'use strict';var _=require(_0x3c11('0x0'));var util=require('util');var logger=require(_0x3c11('0x1'))('api');var moment=require(_0x3c11('0x2'));var BPromise=require(_0x3c11('0x3'));var rp=require(_0x3c11('0x4'));var fs=require('fs');var path=require(_0x3c11('0x5'));var rimraf=require('rimraf');var config=require(_0x3c11('0x6'));var attributes=require(_0x3c11('0x7'));module[_0x3c11('0x8')]=function(_0x134cd5,_0x524740){return _0x134cd5[_0x3c11('0x9')](_0x3c11('0xa'),attributes,{'tableName':_0x3c11('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b2d=['api','moment','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','lodash','util','../../config/logger'];(function(_0x458363,_0x1675db){var _0x4d0290=function(_0x22960f){while(--_0x22960f){_0x458363['push'](_0x458363['shift']());}};_0x4d0290(++_0x1675db);}(_0x3b2d,0x11b));var _0xd3b2=function(_0x392df7,_0x56cb70){_0x392df7=_0x392df7-0x0;var _0x242e29=_0x3b2d[_0x392df7];return _0x242e29;};'use strict';var _=require(_0xd3b2('0x0'));var util=require(_0xd3b2('0x1'));var logger=require(_0xd3b2('0x2'))(_0xd3b2('0x3'));var moment=require(_0xd3b2('0x4'));var BPromise=require('bluebird');var rp=require(_0xd3b2('0x5'));var fs=require('fs');var path=require(_0xd3b2('0x6'));var rimraf=require(_0xd3b2('0x7'));var config=require(_0xd3b2('0x8'));var attributes=require(_0xd3b2('0x9'));module[_0xd3b2('0xa')]=function(_0x3a4c76,_0x21807b){return _0x3a4c76['define'](_0xd3b2('0xb'),attributes,{'tableName':_0xd3b2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index cfe171f..1e690ae 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 _0x17bc=['request\x20sent','debug','stringify','error','message','GetTrunk','Trunk','options','raw','limit','include','map','model','attributes','catch','ShowTrunk','find','where','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Trunk,\x20%s,\x20%s'];(function(_0xde3301,_0xa62b74){var _0x184182=function(_0xdf5535){while(--_0xdf5535){_0xde3301['push'](_0xde3301['shift']());}};_0x184182(++_0xa62b74);}(_0x17bc,0xd2));var _0xc17b=function(_0x2a0b13,_0x440ecc){_0x2a0b13=_0x2a0b13-0x0;var _0x43af0e=_0x17bc[_0x2a0b13];return _0x43af0e;};'use strict';var _=require(_0xc17b('0x0'));var util=require(_0xc17b('0x1'));var moment=require('moment');var BPromise=require(_0xc17b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc17b('0x3'));var db=require(_0xc17b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc17b('0x5'))(_0xc17b('0x6'));var config=require(_0xc17b('0x7'));var jayson=require(_0xc17b('0x8'));var client=jayson[_0xc17b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc16e87,_0x43b833,_0x18c0f4){return new BPromise(function(_0xed7ebd,_0x549a91){return client[_0xc17b('0xa')](_0xc16e87,_0x18c0f4)[_0xc17b('0xb')](function(_0x2b5195){logger[_0xc17b('0xc')](_0xc17b('0xd'),_0x43b833,_0xc17b('0xe'));logger[_0xc17b('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x43b833,_0xc17b('0xe'),JSON[_0xc17b('0x10')](_0x2b5195));if(_0x2b5195[_0xc17b('0x11')]){if(_0x2b5195[_0xc17b('0x11')]['code']===0x1f4){logger[_0xc17b('0x11')](_0xc17b('0xd'),_0x43b833,_0x2b5195[_0xc17b('0x11')][_0xc17b('0x12')]);return _0x549a91(_0x2b5195[_0xc17b('0x11')][_0xc17b('0x12')]);}logger['error'](_0xc17b('0xd'),_0x43b833,_0x2b5195[_0xc17b('0x11')][_0xc17b('0x12')]);return _0xed7ebd(_0x2b5195[_0xc17b('0x11')][_0xc17b('0x12')]);}else{logger[_0xc17b('0xc')]('Trunk,\x20%s,\x20%s',_0x43b833,_0xc17b('0xe'));_0xed7ebd(_0x2b5195['result'][_0xc17b('0x12')]);}})['catch'](function(_0x14f7e2){logger[_0xc17b('0x11')](_0xc17b('0xd'),_0x43b833,_0x14f7e2);_0x549a91(_0x14f7e2);});});}exports[_0xc17b('0x13')]=function(_0x4d2c31){var _0x134a18=this;return new Promise(function(_0x5e4470,_0x156e8b){return db[_0xc17b('0x14')]['findAll']({'raw':_0x4d2c31[_0xc17b('0x15')]?_0x4d2c31[_0xc17b('0x15')][_0xc17b('0x16')]===undefined?!![]:![]:!![],'where':_0x4d2c31[_0xc17b('0x15')]?_0x4d2c31['options']['where']||null:null,'attributes':_0x4d2c31[_0xc17b('0x15')]?_0x4d2c31['options']['attributes']||null:null,'limit':_0x4d2c31['options']?_0x4d2c31[_0xc17b('0x15')][_0xc17b('0x17')]||null:null,'include':_0x4d2c31[_0xc17b('0x15')]?_0x4d2c31[_0xc17b('0x15')][_0xc17b('0x18')]?_[_0xc17b('0x19')](_0x4d2c31['options'][_0xc17b('0x18')],function(_0x5192a9){return{'model':db[_0x5192a9[_0xc17b('0x1a')]],'as':_0x5192a9['as'],'attributes':_0x5192a9[_0xc17b('0x1b')],'include':_0x5192a9['include']?_[_0xc17b('0x19')](_0x5192a9[_0xc17b('0x18')],function(_0x8a3e51){return{'model':db[_0x8a3e51[_0xc17b('0x1a')]],'as':_0x8a3e51['as'],'attributes':_0x8a3e51[_0xc17b('0x1b')],'include':_0x8a3e51[_0xc17b('0x18')]?_['map'](_0x8a3e51['include'],function(_0x356b7c){return{'model':db[_0x356b7c['model']],'as':_0x356b7c['as'],'attributes':_0x356b7c[_0xc17b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc17b('0xb')](function(_0x3b8262){logger[_0xc17b('0xc')](_0xc17b('0x13'),_0x4d2c31);logger['debug'](_0xc17b('0x13'),_0x4d2c31,JSON[_0xc17b('0x10')](_0x3b8262));_0x5e4470(_0x3b8262);})[_0xc17b('0x1c')](function(_0xb2bc07){logger[_0xc17b('0x11')](_0xc17b('0x13'),_0xb2bc07[_0xc17b('0x12')],_0x4d2c31);_0x156e8b(_0x134a18[_0xc17b('0x11')](0x1f4,_0xb2bc07['message']));});});};exports[_0xc17b('0x1d')]=function(_0x54f5e6){var _0x546525=this;return new Promise(function(_0xb42180,_0x250561){return db[_0xc17b('0x14')][_0xc17b('0x1e')]({'raw':_0x54f5e6[_0xc17b('0x15')]?_0x54f5e6[_0xc17b('0x15')][_0xc17b('0x16')]===undefined?!![]:![]:!![],'where':_0x54f5e6[_0xc17b('0x15')]?_0x54f5e6[_0xc17b('0x15')][_0xc17b('0x1f')]||null:null,'attributes':_0x54f5e6[_0xc17b('0x15')]?_0x54f5e6[_0xc17b('0x15')][_0xc17b('0x1b')]||null:null,'include':_0x54f5e6[_0xc17b('0x15')]?_0x54f5e6['options']['include']?_[_0xc17b('0x19')](_0x54f5e6[_0xc17b('0x15')][_0xc17b('0x18')],function(_0x16a950){return{'model':db[_0x16a950[_0xc17b('0x1a')]],'as':_0x16a950['as'],'attributes':_0x16a950[_0xc17b('0x1b')],'include':_0x16a950[_0xc17b('0x18')]?_[_0xc17b('0x19')](_0x16a950[_0xc17b('0x18')],function(_0x2076bb){return{'model':db[_0x2076bb['model']],'as':_0x2076bb['as'],'attributes':_0x2076bb[_0xc17b('0x1b')],'include':_0x2076bb['include']?_[_0xc17b('0x19')](_0x2076bb['include'],function(_0x5dc6b6){return{'model':db[_0x5dc6b6[_0xc17b('0x1a')]],'as':_0x5dc6b6['as'],'attributes':_0x5dc6b6[_0xc17b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f59a7){logger['info'](_0xc17b('0x1d'),_0x54f5e6);logger['debug']('ShowTrunk',_0x54f5e6,JSON[_0xc17b('0x10')](_0x2f59a7));_0xb42180(_0x2f59a7);})[_0xc17b('0x1c')](function(_0x27c82c){logger['error'](_0xc17b('0x1d'),_0x27c82c[_0xc17b('0x12')],_0x54f5e6);_0x250561(_0x546525[_0xc17b('0x11')](0x1f4,_0x27c82c[_0xc17b('0x12')]));});});}; \ No newline at end of file +var _0x7455=['message','result','catch','GetTrunk','Trunk','options','raw','where','attributes','limit','map','include','model','find','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Trunk,\x20%s,\x20%s'];(function(_0x35fceb,_0x518ca8){var _0xcb7f0e=function(_0xb57258){while(--_0xb57258){_0x35fceb['push'](_0x35fceb['shift']());}};_0xcb7f0e(++_0x518ca8);}(_0x7455,0x1d6));var _0x5745=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7455[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5745('0x0'));var util=require(_0x5745('0x1'));var moment=require(_0x5745('0x2'));var BPromise=require(_0x5745('0x3'));var rs=require(_0x5745('0x4'));var fs=require('fs');var Redis=require(_0x5745('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5745('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5745('0x7'));var jayson=require(_0x5745('0x8'));var client=jayson[_0x5745('0x9')][_0x5745('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa41d04,_0x82c510,_0xe2eba6){return new BPromise(function(_0x3bc401,_0x25183e){return client[_0x5745('0xb')](_0xa41d04,_0xe2eba6)[_0x5745('0xc')](function(_0x3a5773){logger[_0x5745('0xd')]('Trunk,\x20%s,\x20%s',_0x82c510,_0x5745('0xe'));logger[_0x5745('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x82c510,_0x5745('0xe'),JSON[_0x5745('0x10')](_0x3a5773));if(_0x3a5773[_0x5745('0x11')]){if(_0x3a5773[_0x5745('0x11')][_0x5745('0x12')]===0x1f4){logger[_0x5745('0x11')](_0x5745('0x13'),_0x82c510,_0x3a5773[_0x5745('0x11')][_0x5745('0x14')]);return _0x25183e(_0x3a5773[_0x5745('0x11')]['message']);}logger[_0x5745('0x11')]('Trunk,\x20%s,\x20%s',_0x82c510,_0x3a5773[_0x5745('0x11')][_0x5745('0x14')]);return _0x3bc401(_0x3a5773['error']['message']);}else{logger[_0x5745('0xd')]('Trunk,\x20%s,\x20%s',_0x82c510,_0x5745('0xe'));_0x3bc401(_0x3a5773[_0x5745('0x15')][_0x5745('0x14')]);}})[_0x5745('0x16')](function(_0x91f332){logger[_0x5745('0x11')]('Trunk,\x20%s,\x20%s',_0x82c510,_0x91f332);_0x25183e(_0x91f332);});});}exports[_0x5745('0x17')]=function(_0x2ca5b5){var _0x3ff8e8=this;return new Promise(function(_0x5c0368,_0x519239){return db[_0x5745('0x18')]['findAll']({'raw':_0x2ca5b5['options']?_0x2ca5b5[_0x5745('0x19')][_0x5745('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ca5b5['options']?_0x2ca5b5[_0x5745('0x19')][_0x5745('0x1b')]||null:null,'attributes':_0x2ca5b5['options']?_0x2ca5b5[_0x5745('0x19')][_0x5745('0x1c')]||null:null,'limit':_0x2ca5b5[_0x5745('0x19')]?_0x2ca5b5['options'][_0x5745('0x1d')]||null:null,'include':_0x2ca5b5[_0x5745('0x19')]?_0x2ca5b5['options']['include']?_[_0x5745('0x1e')](_0x2ca5b5[_0x5745('0x19')][_0x5745('0x1f')],function(_0x3e6b43){return{'model':db[_0x3e6b43[_0x5745('0x20')]],'as':_0x3e6b43['as'],'attributes':_0x3e6b43['attributes'],'include':_0x3e6b43[_0x5745('0x1f')]?_[_0x5745('0x1e')](_0x3e6b43[_0x5745('0x1f')],function(_0x136349){return{'model':db[_0x136349[_0x5745('0x20')]],'as':_0x136349['as'],'attributes':_0x136349['attributes'],'include':_0x136349[_0x5745('0x1f')]?_[_0x5745('0x1e')](_0x136349[_0x5745('0x1f')],function(_0x328ad4){return{'model':db[_0x328ad4[_0x5745('0x20')]],'as':_0x328ad4['as'],'attributes':_0x328ad4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x339824){logger['info']('GetTrunk',_0x2ca5b5);logger[_0x5745('0xf')](_0x5745('0x17'),_0x2ca5b5,JSON[_0x5745('0x10')](_0x339824));_0x5c0368(_0x339824);})['catch'](function(_0x34d6e2){logger[_0x5745('0x11')](_0x5745('0x17'),_0x34d6e2[_0x5745('0x14')],_0x2ca5b5);_0x519239(_0x3ff8e8[_0x5745('0x11')](0x1f4,_0x34d6e2['message']));});});};exports['ShowTrunk']=function(_0x38c2c6){var _0x2b96f9=this;return new Promise(function(_0x1db0a1,_0x25b962){return db[_0x5745('0x18')][_0x5745('0x21')]({'raw':_0x38c2c6[_0x5745('0x19')]?_0x38c2c6[_0x5745('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x38c2c6[_0x5745('0x19')]?_0x38c2c6['options'][_0x5745('0x1b')]||null:null,'attributes':_0x38c2c6[_0x5745('0x19')]?_0x38c2c6[_0x5745('0x19')][_0x5745('0x1c')]||null:null,'include':_0x38c2c6['options']?_0x38c2c6['options'][_0x5745('0x1f')]?_['map'](_0x38c2c6[_0x5745('0x19')][_0x5745('0x1f')],function(_0x435ff2){return{'model':db[_0x435ff2['model']],'as':_0x435ff2['as'],'attributes':_0x435ff2[_0x5745('0x1c')],'include':_0x435ff2[_0x5745('0x1f')]?_[_0x5745('0x1e')](_0x435ff2[_0x5745('0x1f')],function(_0x399fc4){return{'model':db[_0x399fc4[_0x5745('0x20')]],'as':_0x399fc4['as'],'attributes':_0x399fc4[_0x5745('0x1c')],'include':_0x399fc4[_0x5745('0x1f')]?_[_0x5745('0x1e')](_0x399fc4[_0x5745('0x1f')],function(_0x4df502){return{'model':db[_0x4df502['model']],'as':_0x4df502['as'],'attributes':_0x4df502[_0x5745('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5745('0xc')](function(_0xb4d58f){logger[_0x5745('0xd')](_0x5745('0x22'),_0x38c2c6);logger[_0x5745('0xf')]('ShowTrunk',_0x38c2c6,JSON[_0x5745('0x10')](_0xb4d58f));_0x1db0a1(_0xb4d58f);})[_0x5745('0x16')](function(_0x435c35){logger[_0x5745('0x11')]('ShowTrunk',_0x435c35['message'],_0x38c2c6);_0x25b962(_0x2b96f9[_0x5745('0x11')](0x1f4,_0x435c35[_0x5745('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 4484fa6..afea05d 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 _0xfebe=['removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','/create_many','bulkCreate','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/whatsapp_accounts','addSquareProjects','createApiKey','/:id','update','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','/:id/fax_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts'];(function(_0x1b2cf5,_0x45c9a7){var _0x2d9134=function(_0x301e68){while(--_0x301e68){_0x1b2cf5['push'](_0x1b2cf5['shift']());}};_0x2d9134(++_0x45c9a7);}(_0xfebe,0x7e));var _0xefeb=function(_0x346caa,_0x46888d){_0x346caa=_0x346caa-0x0;var _0x1f4548=_0xfebe[_0x346caa];return _0x1f4548;};'use strict';var multer=require(_0xefeb('0x0'));var util=require('util');var path=require(_0xefeb('0x1'));var timeout=require('connect-timeout');var express=require(_0xefeb('0x2'));var router=express[_0xefeb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xefeb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xefeb('0x5'));var controller=require('./user.controller');router[_0xefeb('0x6')]('/',auth[_0xefeb('0x7')](),controller[_0xefeb('0x8')]);router[_0xefeb('0x6')](_0xefeb('0x9'),auth['isAuthenticated'](),controller[_0xefeb('0xa')]);router[_0xefeb('0x6')]('/whoami',auth['isAuthenticated'](),controller[_0xefeb('0xb')]);router['get'](_0xefeb('0xc'),auth[_0xefeb('0x7')](),controller[_0xefeb('0xd')]);router[_0xefeb('0x6')]('/:id',auth[_0xefeb('0x7')](),controller[_0xefeb('0xe')]);router[_0xefeb('0x6')](_0xefeb('0xf'),controller[_0xefeb('0x10')]);router['get'](_0xefeb('0x11'),auth['isAuthenticated'](),controller['getOpenTabs']);router['get'](_0xefeb('0x12'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x13')]);router[_0xefeb('0x6')](_0xefeb('0x14'),auth[_0xefeb('0x7')](),controller['getQueues']);router[_0xefeb('0x6')](_0xefeb('0x15'),auth['isAuthenticated'](),controller[_0xefeb('0x16')]);router[_0xefeb('0x6')](_0xefeb('0x17'),auth[_0xefeb('0x7')](),controller['getGroups']);router['get'](_0xefeb('0x18'),auth['isAuthenticated'](),controller[_0xefeb('0x19')]);router[_0xefeb('0x6')](_0xefeb('0x1a'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x1b')]);router[_0xefeb('0x6')](_0xefeb('0x1c'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x1d')]);router[_0xefeb('0x6')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0xefeb('0x1e')]);router[_0xefeb('0x6')](_0xefeb('0x1f'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x20')]);router[_0xefeb('0x6')]('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0xefeb('0x21')]);router[_0xefeb('0x6')](_0xefeb('0x22'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x23')]);router[_0xefeb('0x6')](_0xefeb('0x24'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x25')]);router[_0xefeb('0x6')]('/:id/teams',auth[_0xefeb('0x7')](),controller[_0xefeb('0x26')]);router[_0xefeb('0x6')]('/:id/lists',auth['isAuthenticated'](),controller[_0xefeb('0x27')]);router[_0xefeb('0x6')](_0xefeb('0x28'),auth['isAuthenticated'](),controller[_0xefeb('0x29')]);router[_0xefeb('0x6')](_0xefeb('0x2a'),auth[_0xefeb('0x7')](),controller['getVoicePrefixes']);router[_0xefeb('0x6')](_0xefeb('0x2b'),auth[_0xefeb('0x7')](),controller['getFaxAccounts']);router[_0xefeb('0x6')](_0xefeb('0x2c'),auth['isAuthenticated'](),controller[_0xefeb('0x2d')]);router['get'](_0xefeb('0x2e'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x2f')]);router[_0xefeb('0x6')](_0xefeb('0x30'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x31')]);router['get'](_0xefeb('0x32'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x33')]);router['get']('/:id/whatsapp_accounts',auth[_0xefeb('0x7')](),controller[_0xefeb('0x34')]);router[_0xefeb('0x6')](_0xefeb('0x35'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x36')]);router[_0xefeb('0x6')](_0xefeb('0x37'),auth['isAuthenticated'](),controller[_0xefeb('0x38')]);router[_0xefeb('0x6')](_0xefeb('0x39'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x3a')]);router[_0xefeb('0x3b')](_0xefeb('0x12'),auth[_0xefeb('0x7')](),controller['addContacts']);router[_0xefeb('0x3b')]('/',auth[_0xefeb('0x7')](),controller[_0xefeb('0x3c')]);router[_0xefeb('0x3b')](_0xefeb('0x3d'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x3e')]);router[_0xefeb('0x3b')](_0xefeb('0x14'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x3f')]);var upload=multer({'storage':multer[_0xefeb('0x40')]({'destination':function(_0x209709,_0xd3e23e,_0x2cf369){_0x2cf369(null,path['join'](config[_0xefeb('0x41')],_0xefeb('0x42')));},'filename':function(_0x14dbc0,_0x45a26c,_0x1e62d7){_0x1e62d7(null,util[_0xefeb('0x43')](_0xefeb('0x44'),Date[_0xefeb('0x45')](),_0x45a26c[_0xefeb('0x46')]));}})});router[_0xefeb('0x3b')](_0xefeb('0xf'),upload[_0xefeb('0x47')](_0xefeb('0x48')),controller[_0xefeb('0x49')]);router[_0xefeb('0x3b')](_0xefeb('0x4a'),auth['isAuthenticated'](),controller['login']);router['post'](_0xefeb('0x4b'),auth[_0xefeb('0x7')](),controller['logout']);router[_0xefeb('0x3b')](_0xefeb('0x4c'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x4d')]);router['post'](_0xefeb('0x4e'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x4f')]);router[_0xefeb('0x3b')]('/:id/teams',auth[_0xefeb('0x7')](),controller[_0xefeb('0x50')]);router[_0xefeb('0x3b')](_0xefeb('0x51'),auth['isAuthenticated'](),controller[_0xefeb('0x52')]);router['post']('/:id/mail_interactions',auth[_0xefeb('0x7')](),controller[_0xefeb('0x53')]);router[_0xefeb('0x3b')]('/:id/fax_interactions',auth[_0xefeb('0x7')](),controller['addFaxInteractions']);router['post'](_0xefeb('0x54'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x55')]);router['post'](_0xefeb('0x56'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x57')]);router['post']('/:id/whatsapp_interactions',auth[_0xefeb('0x7')](),controller[_0xefeb('0x58')]);router[_0xefeb('0x3b')]('/:id/fax_accounts',auth[_0xefeb('0x7')](),controller[_0xefeb('0x59')]);router[_0xefeb('0x3b')](_0xefeb('0x2c'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x5a')]);router[_0xefeb('0x3b')]('/:id/openchannel_accounts',auth[_0xefeb('0x7')](),controller[_0xefeb('0x5b')]);router[_0xefeb('0x3b')](_0xefeb('0x30'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x5c')]);router[_0xefeb('0x3b')]('/:id/chat_websites',auth[_0xefeb('0x7')](),controller['addChatWebsites']);router[_0xefeb('0x3b')](_0xefeb('0x5d'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router['post']('/:id/square_projects',auth[_0xefeb('0x7')](),controller[_0xefeb('0x5e')]);router[_0xefeb('0x3b')]('/:id/api_key',auth[_0xefeb('0x7')](),controller[_0xefeb('0x5f')]);router['put'](_0xefeb('0x60'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x61')]);router['put']('/:id/password',auth[_0xefeb('0x7')](),controller[_0xefeb('0x62')]);router[_0xefeb('0x63')](_0xefeb('0x14'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x64')]);router[_0xefeb('0x63')]('/:id/teams',auth[_0xefeb('0x7')](),controller[_0xefeb('0x65')]);router[_0xefeb('0x63')]('/:id',auth[_0xefeb('0x7')](),controller[_0xefeb('0x66')]);router[_0xefeb('0x63')]('/:id/chat_interactions',auth[_0xefeb('0x7')](),controller[_0xefeb('0x67')]);router[_0xefeb('0x63')](_0xefeb('0x68'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x69')]);router[_0xefeb('0x63')](_0xefeb('0x6a'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0xefeb('0x63')](_0xefeb('0x54'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x6b')]);router[_0xefeb('0x63')](_0xefeb('0x56'),auth['isAuthenticated'](),controller[_0xefeb('0x6c')]);router[_0xefeb('0x63')]('/:id/whatsapp_interactions',auth[_0xefeb('0x7')](),controller[_0xefeb('0x6d')]);router[_0xefeb('0x63')](_0xefeb('0x2b'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x6e')]);router[_0xefeb('0x63')](_0xefeb('0x2c'),auth['isAuthenticated'](),controller[_0xefeb('0x6f')]);router[_0xefeb('0x63')](_0xefeb('0x2e'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x70')]);router[_0xefeb('0x63')]('/:id/sms_accounts',auth[_0xefeb('0x7')](),controller[_0xefeb('0x71')]);router[_0xefeb('0x63')]('/:id/chat_websites',auth[_0xefeb('0x7')](),controller[_0xefeb('0x72')]);router[_0xefeb('0x63')](_0xefeb('0x5d'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x73')]);router[_0xefeb('0x63')](_0xefeb('0x35'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x74')]);router['delete'](_0xefeb('0x39'),auth[_0xefeb('0x7')](),controller[_0xefeb('0x75')]);module[_0xefeb('0x76')]=router; \ No newline at end of file +var _0x5381=['/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','bulkCreate','/:id/queues','addQueues','root','server/files/images/','format','now','single','file','addAvatar','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addOpenchannelAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','/:id/square_projects','createApiKey','update','put','/:id/password','delete','removeQueues','destroy','/:id/chat_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/whoami','whoami','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts'];(function(_0x203553,_0x274c9a){var _0x2590ac=function(_0x490456){while(--_0x490456){_0x203553['push'](_0x203553['shift']());}};_0x2590ac(++_0x274c9a);}(_0x5381,0xab));var _0x1538=function(_0x476c80,_0x53bdbf){_0x476c80=_0x476c80-0x0;var _0x4ff0f0=_0x5381[_0x476c80];return _0x4ff0f0;};'use strict';var multer=require(_0x1538('0x0'));var util=require('util');var path=require(_0x1538('0x1'));var timeout=require(_0x1538('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1538('0x3'));var interaction=require(_0x1538('0x4'));var config=require(_0x1538('0x5'));var controller=require(_0x1538('0x6'));router[_0x1538('0x7')]('/',auth[_0x1538('0x8')](),controller['index']);router[_0x1538('0x7')]('/describe',auth[_0x1538('0x8')](),controller['describe']);router[_0x1538('0x7')](_0x1538('0x9'),auth[_0x1538('0x8')](),controller[_0x1538('0xa')]);router[_0x1538('0x7')](_0x1538('0xb'),auth[_0x1538('0x8')](),controller[_0x1538('0xc')]);router[_0x1538('0x7')](_0x1538('0xd'),auth[_0x1538('0x8')](),controller[_0x1538('0xe')]);router[_0x1538('0x7')]('/:id/avatar',controller[_0x1538('0xf')]);router[_0x1538('0x7')](_0x1538('0x10'),auth[_0x1538('0x8')](),controller['getOpenTabs']);router['get'](_0x1538('0x11'),auth['isAuthenticated'](),controller[_0x1538('0x12')]);router[_0x1538('0x7')]('/:id/queues',auth['isAuthenticated'](),controller[_0x1538('0x13')]);router[_0x1538('0x7')]('/:id/queues_rt',auth[_0x1538('0x8')](),controller[_0x1538('0x14')]);router[_0x1538('0x7')](_0x1538('0x15'),auth[_0x1538('0x8')](),controller[_0x1538('0x16')]);router[_0x1538('0x7')](_0x1538('0x17'),auth[_0x1538('0x8')](),controller[_0x1538('0x18')]);router[_0x1538('0x7')](_0x1538('0x19'),auth[_0x1538('0x8')](),controller[_0x1538('0x1a')]);router[_0x1538('0x7')]('/:id/chat/interactions',auth[_0x1538('0x8')](),controller[_0x1538('0x1b')]);router[_0x1538('0x7')]('/:id/openchannel/interactions',auth[_0x1538('0x8')](),controller[_0x1538('0x1c')]);router[_0x1538('0x7')]('/:id/mail/interactions',auth[_0x1538('0x8')](),controller[_0x1538('0x1d')]);router['get'](_0x1538('0x1e'),auth[_0x1538('0x8')](),controller[_0x1538('0x1f')]);router['get']('/:id/fax/interactions',auth[_0x1538('0x8')](),controller[_0x1538('0x20')]);router[_0x1538('0x7')](_0x1538('0x21'),auth[_0x1538('0x8')](),controller[_0x1538('0x22')]);router[_0x1538('0x7')](_0x1538('0x23'),auth[_0x1538('0x8')](),controller[_0x1538('0x24')]);router[_0x1538('0x7')](_0x1538('0x25'),auth[_0x1538('0x8')](),controller[_0x1538('0x26')]);router[_0x1538('0x7')](_0x1538('0x27'),auth['isAuthenticated'](),controller[_0x1538('0x28')]);router['get'](_0x1538('0x29'),auth['isAuthenticated'](),controller[_0x1538('0x2a')]);router['get']('/:id/fax_accounts',auth[_0x1538('0x8')](),controller[_0x1538('0x2b')]);router[_0x1538('0x7')](_0x1538('0x2c'),auth[_0x1538('0x8')](),controller[_0x1538('0x2d')]);router[_0x1538('0x7')](_0x1538('0x2e'),auth[_0x1538('0x8')](),controller['getOpenchannelAccounts']);router[_0x1538('0x7')](_0x1538('0x2f'),auth['isAuthenticated'](),controller[_0x1538('0x30')]);router[_0x1538('0x7')](_0x1538('0x31'),auth[_0x1538('0x8')](),controller[_0x1538('0x32')]);router[_0x1538('0x7')]('/:id/whatsapp_accounts',auth[_0x1538('0x8')](),controller[_0x1538('0x33')]);router[_0x1538('0x7')]('/:id/square_projects',auth[_0x1538('0x8')](),controller[_0x1538('0x34')]);router[_0x1538('0x7')](_0x1538('0x35'),auth[_0x1538('0x8')](),controller[_0x1538('0x36')]);router[_0x1538('0x7')](_0x1538('0x37'),auth[_0x1538('0x8')](),controller[_0x1538('0x38')]);router[_0x1538('0x39')]('/:id/contacts',auth[_0x1538('0x8')](),controller['addContacts']);router['post']('/',auth[_0x1538('0x8')](),controller['create']);router[_0x1538('0x39')]('/create_many',auth[_0x1538('0x8')](),controller[_0x1538('0x3a')]);router[_0x1538('0x39')](_0x1538('0x3b'),auth[_0x1538('0x8')](),controller[_0x1538('0x3c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x8d4a56,_0x5337e2,_0x49621b){_0x49621b(null,path['join'](config[_0x1538('0x3d')],_0x1538('0x3e')));},'filename':function(_0x28ebe9,_0x282ff1,_0x57bed6){_0x57bed6(null,util[_0x1538('0x3f')]('%s-%s',Date[_0x1538('0x40')](),_0x282ff1['originalname']));}})});router[_0x1538('0x39')]('/:id/avatar',upload[_0x1538('0x41')](_0x1538('0x42')),controller[_0x1538('0x43')]);router[_0x1538('0x39')]('/:id/login',auth[_0x1538('0x8')](),controller['login']);router['post']('/:id/logout',auth[_0x1538('0x8')](),controller[_0x1538('0x44')]);router[_0x1538('0x39')](_0x1538('0x45'),auth[_0x1538('0x8')](),controller[_0x1538('0x46')]);router[_0x1538('0x39')](_0x1538('0x47'),auth[_0x1538('0x8')](),controller[_0x1538('0x48')]);router[_0x1538('0x39')](_0x1538('0x23'),auth[_0x1538('0x8')](),controller[_0x1538('0x49')]);router[_0x1538('0x39')]('/:id/chat_interactions',auth[_0x1538('0x8')](),controller['addChatInteractions']);router[_0x1538('0x39')](_0x1538('0x4a'),auth[_0x1538('0x8')](),controller[_0x1538('0x4b')]);router[_0x1538('0x39')](_0x1538('0x4c'),auth['isAuthenticated'](),controller[_0x1538('0x4d')]);router[_0x1538('0x39')](_0x1538('0x4e'),auth[_0x1538('0x8')](),controller[_0x1538('0x4f')]);router[_0x1538('0x39')](_0x1538('0x50'),auth[_0x1538('0x8')](),controller[_0x1538('0x51')]);router[_0x1538('0x39')]('/:id/whatsapp_interactions',auth[_0x1538('0x8')](),controller[_0x1538('0x52')]);router['post'](_0x1538('0x53'),auth[_0x1538('0x8')](),controller[_0x1538('0x54')]);router[_0x1538('0x39')]('/:id/mail_accounts',auth['isAuthenticated'](),controller['addMailAccounts']);router[_0x1538('0x39')](_0x1538('0x2e'),auth[_0x1538('0x8')](),controller[_0x1538('0x55')]);router[_0x1538('0x39')]('/:id/sms_accounts',auth[_0x1538('0x8')](),controller['addSmsAccounts']);router[_0x1538('0x39')]('/:id/chat_websites',auth[_0x1538('0x8')](),controller[_0x1538('0x56')]);router[_0x1538('0x39')](_0x1538('0x57'),auth[_0x1538('0x8')](),controller[_0x1538('0x58')]);router[_0x1538('0x39')](_0x1538('0x59'),auth[_0x1538('0x8')](),controller['addSquareProjects']);router['post']('/:id/api_key',auth['isAuthenticated'](),controller[_0x1538('0x5a')]);router['put'](_0x1538('0xd'),auth[_0x1538('0x8')](),controller[_0x1538('0x5b')]);router[_0x1538('0x5c')](_0x1538('0x5d'),auth[_0x1538('0x8')](),controller['changePassword']);router[_0x1538('0x5e')]('/:id/queues',auth[_0x1538('0x8')](),controller[_0x1538('0x5f')]);router['delete'](_0x1538('0x23'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x1538('0x5e')](_0x1538('0xd'),auth['isAuthenticated'](),controller[_0x1538('0x60')]);router[_0x1538('0x5e')](_0x1538('0x61'),auth['isAuthenticated'](),controller['removeChatInteractions']);router['delete'](_0x1538('0x4a'),auth[_0x1538('0x8')](),controller[_0x1538('0x62')]);router[_0x1538('0x5e')]('/:id/fax_interactions',auth[_0x1538('0x8')](),controller[_0x1538('0x63')]);router[_0x1538('0x5e')](_0x1538('0x4e'),auth[_0x1538('0x8')](),controller[_0x1538('0x64')]);router['delete'](_0x1538('0x50'),auth[_0x1538('0x8')](),controller[_0x1538('0x65')]);router['delete'](_0x1538('0x66'),auth[_0x1538('0x8')](),controller['removeWhatsappInteractions']);router[_0x1538('0x5e')](_0x1538('0x53'),auth[_0x1538('0x8')](),controller[_0x1538('0x67')]);router[_0x1538('0x5e')](_0x1538('0x2c'),auth['isAuthenticated'](),controller[_0x1538('0x68')]);router[_0x1538('0x5e')]('/:id/openchannel_accounts',auth[_0x1538('0x8')](),controller['removeOpenchannelAccounts']);router['delete'](_0x1538('0x2f'),auth[_0x1538('0x8')](),controller[_0x1538('0x69')]);router[_0x1538('0x5e')]('/:id/chat_websites',auth[_0x1538('0x8')](),controller['removeChatWebsites']);router['delete'](_0x1538('0x57'),auth[_0x1538('0x8')](),controller[_0x1538('0x6a')]);router[_0x1538('0x5e')]('/:id/square_projects',auth[_0x1538('0x8')](),controller[_0x1538('0x6b')]);router[_0x1538('0x5e')](_0x1538('0x37'),auth[_0x1538('0x8')](),controller[_0x1538('0x6c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 604023c..10130bc 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 _0xe2a6=['exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','admin','user','agent','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','from-sip','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','info','shortinfo','inband','auto','rfc2833','nonat','update','outgoing','force_rport,comedia','nat','split','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]','yes','never','always','accept','refuse','originate','uac','uas','certificate','active','passive','update,nonat','TEXT','showWebBar','get','isArray','udp','wss','encryption','avpf','icesupport','dtlsenable','dtlscertfile','dtlsprivatekey','rtcp_mux','force_avp','dtlsverify','actpass','permissions','map','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','sequelize','util','lodash'];(function(_0x385eb1,_0x497a94){var _0x5d40eb=function(_0x159029){while(--_0x159029){_0x385eb1['push'](_0x385eb1['shift']());}};_0x5d40eb(++_0x497a94);}(_0xe2a6,0x1bf));var _0x6e2a=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0xe2a6[_0xbc2974];return _0x3a5b4f;};'use strict';var Sequelize=require(_0x6e2a('0x0'));var moment=require('moment');var util=require(_0x6e2a('0x1'));var _=require(_0x6e2a('0x2'));module[_0x6e2a('0x3')]={'name':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':![],'unique':_0x6e2a('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x441d2c){this['setDataValue'](_0x6e2a('0x5'),_0x441d2c);this[_0x6e2a('0x6')](_0x6e2a('0x7'),_0x441d2c);},'comment':_0x6e2a('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x151182){this[_0x6e2a('0x6')](_0x6e2a('0x9'),_0x151182);this[_0x6e2a('0x6')](_0x6e2a('0xa'),util[_0x6e2a('0xb')](_0x6e2a('0xc'),_0x151182,this[_0x6e2a('0xd')](_0x6e2a('0xe'))));}},'alias':{'type':Sequelize[_0x6e2a('0x4')]},'email':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':![],'unique':_0x6e2a('0xf'),'validate':{'isEmail':!![]},'set':function(_0x1dcb45){if(_0x1dcb45){this[_0x6e2a('0x6')](_0x6e2a('0xf'),_0x1dcb45[_0x6e2a('0x10')]());}}},'role':{'type':Sequelize['ENUM'](_0x6e2a('0x11'),_0x6e2a('0x12'),_0x6e2a('0x13'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x6e2a('0x14')](0xb),'allowNull':![],'unique':_0x6e2a('0xe'),'set':function(_0x31524e){this['setDataValue'](_0x6e2a('0xe'),_0x31524e);this[_0x6e2a('0x6')](_0x6e2a('0x15'),_0x31524e);this['setDataValue'](_0x6e2a('0xa'),util[_0x6e2a('0xb')]('\x22%s\x22\x20<%s>',this[_0x6e2a('0xd')](_0x6e2a('0x9')),_0x31524e));}},'salt':{'type':Sequelize[_0x6e2a('0x4')]},'phone':{'type':Sequelize[_0x6e2a('0x4')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x6e2a('0x4')]},'zipcode':{'type':Sequelize[_0x6e2a('0x4')]},'userpic':{'type':Sequelize[_0x6e2a('0x4')]},'city':{'type':Sequelize[_0x6e2a('0x4')]},'country':{'type':Sequelize[_0x6e2a('0x4')]},'online':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6e2a('0x17')]},'voicePause':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6e2a('0x4')],'defaultValue':_0x6e2a('0x18')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x6e2a('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x6e2a('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6e2a('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6e2a('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6e2a('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x6e2a('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x6e2a('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6e2a('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![],'defaultValue':_0x6e2a('0x19')},'ipaddr':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x6e2a('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6e2a('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x6e2a('0x1a'),_0x6e2a('0x12'),'peer'),'allowNull':!![],'defaultValue':_0x6e2a('0x1a')},'context':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![],'defaultValue':_0x6e2a('0x1b')},'callingpres':{'type':Sequelize[_0x6e2a('0x1c')]('ALLOWED_NOT_SCREENED',_0x6e2a('0x1d'),_0x6e2a('0x1e'),_0x6e2a('0x1f'),'PROHIB_NOT_SCREENED',_0x6e2a('0x20'),'PROHIB_FAILED_SCREEN',_0x6e2a('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0x363d15){this[_0x6e2a('0x6')](_0x6e2a('0x22'),_0x363d15?_0x363d15[_0x6e2a('0x23')](','):null);},'get':function(){return this[_0x6e2a('0xd')](_0x6e2a('0x22'))?this[_0x6e2a('0xd')](_0x6e2a('0x22'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x6e2a('0x1c')]('rfc2833',_0x6e2a('0x24'),_0x6e2a('0x25'),_0x6e2a('0x26'),_0x6e2a('0x27')),'allowNull':!![],'defaultValue':_0x6e2a('0x28')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x6e2a('0x29'),_0x6e2a('0x2a'),_0x6e2a('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6e2a('0x1c')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![],'defaultValue':_0x6e2a('0x2c'),'set':function(_0x18d4a7){this['setDataValue'](_0x6e2a('0x2d'),_0x18d4a7?_0x18d4a7['join'](','):null);},'get':function(){return this[_0x6e2a('0xd')](_0x6e2a('0x2d'))?this[_0x6e2a('0xd')](_0x6e2a('0x2d'))[_0x6e2a('0x2e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x6e2a('0x4')]},'namedcallgroup':{'type':Sequelize[_0x6e2a('0x4')]},'pickupgroup':{'type':Sequelize[_0x6e2a('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x6e2a('0x4')]},'language':{'type':Sequelize[_0x6e2a('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':![],'defaultValue':_0x6e2a('0x2f')},'allow':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':![],'defaultValue':_0x6e2a('0x30'),'set':function(_0x24b04b){this[_0x6e2a('0x6')](_0x6e2a('0x31'),_0x24b04b?_0x24b04b[_0x6e2a('0x23')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x6e2a('0x31'))?this['getDataValue'](_0x6e2a('0x31'))[_0x6e2a('0x2e')](';'):null;},'comment':_0x6e2a('0x32')},'autoframing':{'type':Sequelize[_0x6e2a('0x1c')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![],'set':function(_0x2e83e0){this[_0x6e2a('0x6')](_0x6e2a('0x33'),_0x2e83e0?_0x2e83e0['join'](','):null);},'get':function(){return this[_0x6e2a('0xd')]('insecure')?this[_0x6e2a('0xd')]('insecure')[_0x6e2a('0x2e')](','):null;},'comment':_0x6e2a('0x34')},'trustrpid':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x35'),'no',_0x6e2a('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x35'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6e2a('0x1c')]('yes','no'),'allowNull':!![],'defaultValue':_0x6e2a('0x35')},'busylevel':{'type':Sequelize[_0x6e2a('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x35'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x6e2a('0x35'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x35'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x35'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x6e2a('0x35'),'no',_0x6e2a('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6e2a('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x35'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x38'),_0x6e2a('0x39'),_0x6e2a('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6e2a('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6e2a('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x3b'),_0x6e2a('0x3c')),'allowNull':!![],'defaultValue':_0x6e2a('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x6e2a('0x35'),'no'),'allowNull':!![],'defaultValue':_0x6e2a('0x35')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6e2a('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6e2a('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6e2a('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6e2a('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x6e2a('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x35'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x6e2a('0x35'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x6e2a('0x35'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6e2a('0x1c')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x6e2a('0x35'),'no','fingerprint',_0x6e2a('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6e2a('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x3e'),_0x6e2a('0x3f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6e2a('0x1c')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6e2a('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x35'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x35'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6e2a('0x1c')](_0x6e2a('0x35'),'no','nonat',_0x6e2a('0x2a'),_0x6e2a('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x6e2a('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x6e2a('0x17')]},'passwordResetAt':{'type':Sequelize[_0x6e2a('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x6e2a('0x41')]},'showWebBar':{'type':Sequelize[_0x6e2a('0x14')],'defaultValue':0x0,'set':function(_0x46170f){this[_0x6e2a('0x6')](_0x6e2a('0x42'),_0x46170f);var _0xccde40=this[_0x6e2a('0x43')]({'plain':!![]});switch(_0x46170f){case 0x0:case 0x1:var _0x5492fa=_0xccde40['transport']?_[_0x6e2a('0x44')](_0xccde40[_0x6e2a('0x22')])?_0xccde40[_0x6e2a('0x22')]['join']():_0xccde40[_0x6e2a('0x22')]:_0x6e2a('0x45');if(_0x5492fa===_0x6e2a('0x46')){_0x5492fa=_0x6e2a('0x45');}this['setDataValue'](_0x6e2a('0x22'),_0x5492fa);this[_0x6e2a('0x6')](_0x6e2a('0x47'),'no');this[_0x6e2a('0x6')](_0x6e2a('0x48'),null);this[_0x6e2a('0x6')]('force_avp',null);this[_0x6e2a('0x6')](_0x6e2a('0x49'),null);this['setDataValue'](_0x6e2a('0x4a'),null);this[_0x6e2a('0x6')]('dtlsverify',null);this[_0x6e2a('0x6')]('dtlssetup',null);this[_0x6e2a('0x6')](_0x6e2a('0x4b'),null);this['setDataValue'](_0x6e2a('0x4c'),null);this[_0x6e2a('0x6')](_0x6e2a('0x4d'),'no');break;case 0x2:this['setDataValue'](_0x6e2a('0x22'),'wss');this['setDataValue'](_0x6e2a('0x47'),_0x6e2a('0x35'));this[_0x6e2a('0x6')](_0x6e2a('0x48'),_0x6e2a('0x35'));this[_0x6e2a('0x6')](_0x6e2a('0x4e'),'yes');this[_0x6e2a('0x6')](_0x6e2a('0x49'),_0x6e2a('0x35'));this[_0x6e2a('0x6')](_0x6e2a('0x4a'),_0x6e2a('0x35'));this[_0x6e2a('0x6')](_0x6e2a('0x4f'),'no');this[_0x6e2a('0x6')]('dtlssetup',_0x6e2a('0x50'));this[_0x6e2a('0x6')]('dtlscertfile',_0xccde40[_0x6e2a('0x4b')]||'/etc/pki/tls/certs/motion.crt');this[_0x6e2a('0x6')]('dtlsprivatekey',_0xccde40[_0x6e2a('0x4c')]||'/etc/pki/tls/private/motion.key');this[_0x6e2a('0x6')](_0x6e2a('0x4d'),_0x6e2a('0x35'));break;default:}}},'permissions':{'type':Sequelize[_0x6e2a('0x41')],'set':function(_0x3b1577){this[_0x6e2a('0x6')](_0x6e2a('0x51'),_0x3b1577?_0x3b1577[_0x6e2a('0x23')](','):[]);},'get':function(){return this['getDataValue'](_0x6e2a('0x51'))?_[_0x6e2a('0x52')](this[_0x6e2a('0xd')]('permissions')['split'](','),function(_0x1839ec){return parseInt(_0x1839ec,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6e2a('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x6e2a('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x6e2a('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6e2a('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6e2a('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6e2a('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x6e2a('0x35'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6e2a('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x6e2a('0xd')](_0x6e2a('0x53'))?this[_0x6e2a('0xd')](_0x6e2a('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x6e2a('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6e2a('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x45dc85){if(typeof _0x45dc85==='string'){var _0x310853=_0x45dc85==='1'?!![]:_0x45dc85==='0'?![]:_0x45dc85===_0x6e2a('0x54')?!![]:_0x45dc85===_0x6e2a('0x55')?![]:![];this['setDataValue'](_0x6e2a('0x56'),_0x310853);}else{this[_0x6e2a('0x6')]('screenrecording',_0x45dc85);}}},'blocked':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![],'set':function(_0x2abc5a){this['setDataValue']('blocked',_0x2abc5a);if(_0x2abc5a===!![]){this[_0x6e2a('0x6')](_0x6e2a('0x57'),moment());this[_0x6e2a('0x6')](_0x6e2a('0x58'),0x0);}else{this[_0x6e2a('0x6')](_0x6e2a('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0x6e2a('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x6e2a('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6e2a('0x14')](0x5)[_0x6e2a('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x6e2a('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2f1e=['isArray','wss','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','encryption','force_avp','actpass','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','loginAttempts','blockedAt','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','admin','user','agent','telephone','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','ENUM','friend','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','auto','yes','nonat','update','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','accept','uac','uas','certificate','active','update,nonat','TEXT','showWebBar'];(function(_0x4916e9,_0x440938){var _0x1790b2=function(_0x4a1868){while(--_0x4a1868){_0x4916e9['push'](_0x4916e9['shift']());}};_0x1790b2(++_0x440938);}(_0x2f1e,0xce));var _0xe2f1=function(_0x1c72b8,_0x104b7e){_0x1c72b8=_0x1c72b8-0x0;var _0x191114=_0x2f1e[_0x1c72b8];return _0x191114;};'use strict';var Sequelize=require(_0xe2f1('0x0'));var moment=require(_0xe2f1('0x1'));var util=require(_0xe2f1('0x2'));var _=require('lodash');module[_0xe2f1('0x3')]={'name':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':![],'unique':_0xe2f1('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x129c98){this[_0xe2f1('0x6')](_0xe2f1('0x5'),_0x129c98);this[_0xe2f1('0x6')](_0xe2f1('0x7'),_0x129c98);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':![],'set':function(_0x3d9ecf){this['setDataValue'](_0xe2f1('0x8'),_0x3d9ecf);this[_0xe2f1('0x6')](_0xe2f1('0x9'),util[_0xe2f1('0xa')](_0xe2f1('0xb'),_0x3d9ecf,this[_0xe2f1('0xc')](_0xe2f1('0xd'))));}},'alias':{'type':Sequelize[_0xe2f1('0x4')]},'email':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x1eec32){if(_0x1eec32){this[_0xe2f1('0x6')](_0xe2f1('0xe'),_0x1eec32[_0xe2f1('0xf')]());}}},'role':{'type':Sequelize['ENUM'](_0xe2f1('0x10'),_0xe2f1('0x11'),_0xe2f1('0x12'),_0xe2f1('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xe2f1('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xe2f1('0xd'),'set':function(_0xd00ab6){this[_0xe2f1('0x6')](_0xe2f1('0xd'),_0xd00ab6);this[_0xe2f1('0x6')](_0xe2f1('0x14'),_0xd00ab6);this[_0xe2f1('0x6')]('callerid',util['format'](_0xe2f1('0xb'),this[_0xe2f1('0xc')](_0xe2f1('0x8')),_0xd00ab6));}},'salt':{'type':Sequelize[_0xe2f1('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xe2f1('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xe2f1('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xe2f1('0x4')]},'online':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xe2f1('0x16')]},'voicePause':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xe2f1('0x4')],'defaultValue':_0xe2f1('0x17')},'lastPauseAt':{'type':Sequelize[_0xe2f1('0x16')]},'chatCapacity':{'type':Sequelize[_0xe2f1('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xe2f1('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xe2f1('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xe2f1('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xe2f1('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xe2f1('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xe2f1('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xe2f1('0x19')},'ipaddr':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xe2f1('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xe2f1('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x1b'),'user','peer'),'allowNull':!![],'defaultValue':_0xe2f1('0x1b')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xe2f1('0x1c')},'callingpres':{'type':Sequelize[_0xe2f1('0x1a')]('ALLOWED_NOT_SCREENED',_0xe2f1('0x1d'),_0xe2f1('0x1e'),_0xe2f1('0x1f'),_0xe2f1('0x20'),_0xe2f1('0x21'),_0xe2f1('0x22'),_0xe2f1('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![],'defaultValue':_0xe2f1('0x24'),'set':function(_0x51bbe0){this[_0xe2f1('0x6')](_0xe2f1('0x25'),_0x51bbe0?_0x51bbe0[_0xe2f1('0x26')](','):null);},'get':function(){return this[_0xe2f1('0xc')](_0xe2f1('0x25'))?this['getDataValue'](_0xe2f1('0x25'))[_0xe2f1('0x27')](','):null;},'comment':_0xe2f1('0x28')},'dtmfmode':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x29'),'info','shortinfo',_0xe2f1('0x2a'),_0xe2f1('0x2b')),'allowNull':!![],'defaultValue':_0xe2f1('0x29')},'directmedia':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x2c'),'no',_0xe2f1('0x2d'),_0xe2f1('0x2e'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xe2f1('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xe2f1('0x2f'),'set':function(_0x34f3f5){this[_0xe2f1('0x6')](_0xe2f1('0x30'),_0x34f3f5?_0x34f3f5[_0xe2f1('0x26')](','):null);},'get':function(){return this[_0xe2f1('0xc')](_0xe2f1('0x30'))?this['getDataValue']('nat')[_0xe2f1('0x27')](','):null;},'comment':_0xe2f1('0x31')},'callgroup':{'type':Sequelize[_0xe2f1('0x4')]},'namedcallgroup':{'type':Sequelize[_0xe2f1('0x4')]},'pickupgroup':{'type':Sequelize[_0xe2f1('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xe2f1('0x4')]},'language':{'type':Sequelize[_0xe2f1('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':![],'defaultValue':_0xe2f1('0x32')},'allow':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':![],'defaultValue':_0xe2f1('0x33'),'set':function(_0x57ab24){this['setDataValue'](_0xe2f1('0x34'),_0x57ab24?_0x57ab24[_0xe2f1('0x26')](';'):_0xe2f1('0x33'));},'get':function(){return this[_0xe2f1('0xc')](_0xe2f1('0x34'))?this[_0xe2f1('0xc')](_0xe2f1('0x34'))['split'](';'):null;},'comment':_0xe2f1('0x35')},'autoframing':{'type':Sequelize['ENUM'](_0xe2f1('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![],'set':function(_0x1c2451){this[_0xe2f1('0x6')](_0xe2f1('0x36'),_0x1c2451?_0x1c2451[_0xe2f1('0x26')](','):null);},'get':function(){return this['getDataValue'](_0xe2f1('0x36'))?this['getDataValue'](_0xe2f1('0x36'))['split'](','):null;},'comment':_0xe2f1('0x37')},'trustrpid':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xe2f1('0x2c'),'no',_0xe2f1('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xe2f1('0x1a')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xe2f1('0x1a')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xe2f1('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![],'defaultValue':_0xe2f1('0x39')},'amaflags':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xe2f1('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xe2f1('0x2c')},'busylevel':{'type':Sequelize[_0xe2f1('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xe2f1('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x2c'),'no',_0xe2f1('0x3a')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xe2f1('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x3b'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xe2f1('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x3c'),'uas'),'allowNull':!![],'defaultValue':_0xe2f1('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x2c'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xe2f1('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xe2f1('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xe2f1('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xe2f1('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xe2f1('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xe2f1('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xe2f1('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x2c'),'no','fingerprint',_0xe2f1('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x3f'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xe2f1('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xe2f1('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xe2f1('0x1a')](_0xe2f1('0x2c'),'no','nonat',_0xe2f1('0x2e'),_0xe2f1('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xe2f1('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xe2f1('0x16')]},'passwordResetAt':{'type':Sequelize[_0xe2f1('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xe2f1('0x41')]},'showWebBar':{'type':Sequelize[_0xe2f1('0x18')],'defaultValue':0x0,'set':function(_0x3ce83d){this[_0xe2f1('0x6')](_0xe2f1('0x42'),_0x3ce83d);var _0x27ac6a=this['get']({'plain':!![]});switch(_0x3ce83d){case 0x0:case 0x1:var _0x31fd59=_0x27ac6a[_0xe2f1('0x25')]?_[_0xe2f1('0x43')](_0x27ac6a['transport'])?_0x27ac6a[_0xe2f1('0x25')][_0xe2f1('0x26')]():_0x27ac6a['transport']:'udp';if(_0x31fd59===_0xe2f1('0x44')){_0x31fd59=_0xe2f1('0x24');}this['setDataValue'](_0xe2f1('0x25'),_0x31fd59);this[_0xe2f1('0x6')]('encryption','no');this['setDataValue'](_0xe2f1('0x45'),null);this[_0xe2f1('0x6')]('force_avp',null);this['setDataValue'](_0xe2f1('0x46'),null);this[_0xe2f1('0x6')](_0xe2f1('0x47'),null);this[_0xe2f1('0x6')](_0xe2f1('0x48'),null);this[_0xe2f1('0x6')](_0xe2f1('0x49'),null);this[_0xe2f1('0x6')](_0xe2f1('0x4a'),null);this[_0xe2f1('0x6')](_0xe2f1('0x4b'),null);this[_0xe2f1('0x6')]('rtcp_mux','no');break;case 0x2:this[_0xe2f1('0x6')](_0xe2f1('0x25'),_0xe2f1('0x44'));this['setDataValue'](_0xe2f1('0x4c'),_0xe2f1('0x2c'));this[_0xe2f1('0x6')](_0xe2f1('0x45'),_0xe2f1('0x2c'));this[_0xe2f1('0x6')](_0xe2f1('0x4d'),'yes');this[_0xe2f1('0x6')](_0xe2f1('0x46'),'yes');this[_0xe2f1('0x6')](_0xe2f1('0x47'),_0xe2f1('0x2c'));this['setDataValue']('dtlsverify','no');this[_0xe2f1('0x6')](_0xe2f1('0x49'),_0xe2f1('0x4e'));this[_0xe2f1('0x6')]('dtlscertfile',_0x27ac6a[_0xe2f1('0x4a')]||'/etc/pki/tls/certs/motion.crt');this[_0xe2f1('0x6')](_0xe2f1('0x4b'),_0x27ac6a[_0xe2f1('0x4b')]||_0xe2f1('0x4f'));this[_0xe2f1('0x6')](_0xe2f1('0x50'),_0xe2f1('0x2c'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf8df6a){this[_0xe2f1('0x6')](_0xe2f1('0x51'),_0xf8df6a?_0xf8df6a[_0xe2f1('0x26')](','):[]);},'get':function(){return this[_0xe2f1('0xc')]('permissions')?_['map'](this[_0xe2f1('0xc')]('permissions')[_0xe2f1('0x27')](','),function(_0x5b4125){return parseInt(_0x5b4125,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xe2f1('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xe2f1('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xe2f1('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xe2f1('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xe2f1('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xe2f1('0x52')],'get':function(){return this[_0xe2f1('0xc')](_0xe2f1('0x53'))?this['getDataValue'](_0xe2f1('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xe2f1('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xe2f1('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![],'set':function(_0x515867){if(typeof _0x515867===_0xe2f1('0x54')){var _0x285276=_0x515867==='1'?!![]:_0x515867==='0'?![]:_0x515867===_0xe2f1('0x55')?!![]:_0x515867===_0xe2f1('0x56')?![]:![];this[_0xe2f1('0x6')]('screenrecording',_0x285276);}else{this[_0xe2f1('0x6')](_0xe2f1('0x57'),_0x515867);}}},'blocked':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![],'set':function(_0x139758){this[_0xe2f1('0x6')](_0xe2f1('0x58'),_0x139758);if(_0x139758===!![]){this[_0xe2f1('0x6')]('blockedAt',moment());this['setDataValue'](_0xe2f1('0x59'),0x0);}else{this[_0xe2f1('0x6')](_0xe2f1('0x5a'),null);}}},'blockedAt':{'type':Sequelize[_0xe2f1('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xe2f1('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xe2f1('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 02ee4b5..6a97da6 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 _0xc4aa=['dialActive','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','resolve','queues','isEmpty','teams','col','toString','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','offline','pause','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','field','ui.','InteractionId','OpenTabs','moment','bluebird','util','path','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','register','redis','defaults','localhost','client','http','request','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','get','role','admin','user','agent','telephone','filter','ignore','map','value','includes','find','name','destroy','then','sendStatus','stack','send','index','User','rawAttributes','fieldName','password','salt','getOptions','where','include','attributes','push','findAll','rows','openTabs','true','chat','dataValues','sms','fax','mail','show','params','differenceBy','keys','query','filters','intersection','model','fields','length','includeAll','merge','openchannel','whatsapp','all','update','body','describe','addContacts','ids','omit','internal','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','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)','QueryTypes','SELECT','from','mailbox','VoiceMail','fullname','permissions','102','110','105','108','109','100','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','create','UserProfileSection','Telephones','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','checkUserLimits','Agents','autoAssociation','compact','UserProfileResource','changePassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','oldPassword','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','emit','VoiceQueue','format','each','upsert','remove','isArray','QueueId','Queue:remove','voice','UserVoiceQueueRt','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','getContacts','CmContact','order','sort','pick','options','hasOwnProperty','List','Tag','Tags','tag','nolimit','getQueues','Queue','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','ScreenRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','SIP/%s','intrf','user:%s','x-forwarded-for','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','logout','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','smsPause','whatsapppause','lastPauseAt','manual','%s%s','Pause','Team','getTeams','addTeams','setDataValue','Voice','Chat','getMailQueues','Mail','getSmsQueues','Sms','Whatsapp','getOpenchannelQueues','flatten','addAgent','getDataValue','Queue:save','TeamVoicePrefix','UserVoicePrefix','getWhatsappQueues','getFaxQueues','Fax','Openchannel','transaction','VoicePrefixId','getLists','CmList','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','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','removeOpenchannelInteractions','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$overlap','$any','lastName'];(function(_0x2254ca,_0x514540){var _0x3d7249=function(_0x2a2a2b){while(--_0x2a2a2b){_0x2254ca['push'](_0x2254ca['shift']());}};_0x3d7249(++_0x514540);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc4aa[_0x1b2ff7];return _0x31656a;};'use strict';var moment=require(_0xac4a('0x0'));var BPromise=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var path=require(_0xac4a('0x3'));var fs=require('fs');var _=require(_0xac4a('0x4'));var squel=require(_0xac4a('0x5'));var jayson=require('jayson/promise');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xac4a('0x6'));var logger=require(_0xac4a('0x7'))(_0xac4a('0x8'));var utils=require(_0xac4a('0x9'));var config=require(_0xac4a('0xa'));var licenseUtil=require(_0xac4a('0xb'));var db=require(_0xac4a('0xc'))['db'];var socket=require(_0xac4a('0xd'))(new Redis(config['redis']));require('./user.socket')[_0xac4a('0xe')](socket);config[_0xac4a('0xf')]=_[_0xac4a('0x10')](config['redis'],{'host':_0xac4a('0x11'),'port':0x18eb});var client=jayson[_0xac4a('0x12')][_0xac4a('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x4d4acc,_0x30135d,_0x488e3c,_0x2f062c){return new BPromise(function(_0x4855b6,_0x333ca5){var _0x2a0776=_0x2f062c||client;return _0x2a0776[_0xac4a('0x14')](_0x4d4acc,_0x488e3c)['then'](function(_0x21a79){logger[_0xac4a('0x15')](_0xac4a('0x16'),_0x30135d,_0xac4a('0x17'));logger[_0xac4a('0x18')](_0xac4a('0x19'),_0x30135d,_0xac4a('0x17'),JSON[_0xac4a('0x1a')](_0x21a79));if(_0x21a79[_0xac4a('0x1b')]){if(_0x21a79[_0xac4a('0x1b')][_0xac4a('0x1c')]===0x1f4){logger[_0xac4a('0x1b')]('User,\x20%s,\x20%s',_0x30135d,_0x21a79[_0xac4a('0x1b')][_0xac4a('0x1d')]);return _0x333ca5(_0x21a79[_0xac4a('0x1b')][_0xac4a('0x1d')]);}logger[_0xac4a('0x1b')](_0xac4a('0x16'),_0x30135d,_0x21a79[_0xac4a('0x1b')][_0xac4a('0x1d')]);return _0x4855b6(_0x21a79['error']['message']);}else{logger[_0xac4a('0x15')](_0xac4a('0x16'),_0x30135d,_0xac4a('0x17'));_0x4855b6(_0x21a79['result'][_0xac4a('0x1d')]);}})[_0xac4a('0x1e')](function(_0x3752e4){logger[_0xac4a('0x1b')](_0xac4a('0x16'),_0x30135d,_0x3752e4);_0x333ca5(_0x3752e4);});});}function respondWithStatusCode(_0x3e829c,_0xe38996){_0xe38996=_0xe38996||0xcc;return function(_0x3ca790){if(_0x3ca790){return _0x3e829c['sendStatus'](_0xe38996);}return _0x3e829c[_0xac4a('0x1f')](_0xe38996)[_0xac4a('0x20')]();};}function respondWithResult(_0x599787,_0x3d7ce0){_0x3d7ce0=_0x3d7ce0||0xc8;return function(_0x4169c0){if(_0x4169c0){return _0x599787[_0xac4a('0x1f')](_0x3d7ce0)[_0xac4a('0x21')](_0x4169c0);}};}function respondWithFilteredResult(_0x4d2d6c,_0x1b7998){return function(_0x2503d8){if(_0x2503d8){var _0x15435c=typeof _0x1b7998[_0xac4a('0x22')]===_0xac4a('0x23')&&typeof _0x1b7998[_0xac4a('0x24')]===_0xac4a('0x23');var _0x36054a=_0x2503d8[_0xac4a('0x25')];var _0x3bc318=_0x15435c?0x0:_0x1b7998[_0xac4a('0x22')];var _0x215a31=_0x15435c?_0x2503d8[_0xac4a('0x25')]:_0x1b7998[_0xac4a('0x22')]+_0x1b7998[_0xac4a('0x24')];var _0x20202c;if(_0x215a31>=_0x36054a){_0x215a31=_0x36054a;_0x20202c=0xc8;}else{_0x20202c=0xce;}_0x4d2d6c['status'](_0x20202c);return _0x4d2d6c[_0xac4a('0x26')](_0xac4a('0x27'),_0x3bc318+'-'+_0x215a31+'/'+_0x36054a)[_0xac4a('0x21')](_0x2503d8);}return null;};}function saveUpdates(_0x2772fe){return function(_0x116700){if(_0x116700){return _0x116700['update'](_0x2772fe)['then'](function(_0xdb7e){return _0xdb7e;});}return null;};}function removeEntity(_0x7a948b){return function(_0x1f12d5){if(_0x1f12d5){return _0x1f12d5['destroy']()['then'](function(){var _0x355755=_0x1f12d5[_0xac4a('0x28')]({'plain':!![]});if(_0x355755[_0xac4a('0x29')]===_0xac4a('0x2a'))return;var _0x17118e=[{'name':'Users','value':_0xac4a('0x2b'),'ignore':!![]},{'name':'Agents','value':_0xac4a('0x2c'),'ignore':![]},{'name':'Telephones','value':_0xac4a('0x2d'),'ignore':![]}];var _0xfbe355=_(_0x17118e)[_0xac4a('0x2e')](_0xac4a('0x2f'))[_0xac4a('0x30')](_0xac4a('0x31'))[_0xac4a('0x31')]();if(_[_0xac4a('0x32')](_0xfbe355,_0x355755[_0xac4a('0x29')])){return;}var _0xfd7c16=_[_0xac4a('0x33')](_0x17118e,[_0xac4a('0x31'),_0x355755[_0xac4a('0x29')]])[_0xac4a('0x34')];return db['UserProfileResource'][_0xac4a('0x35')]({'where':{'type':_0xfd7c16,'resourceId':_0x355755['id']}})[_0xac4a('0x36')](function(){return _0x1f12d5;});})['then'](function(){_0x7a948b[_0xac4a('0x1f')](0xcc)[_0xac4a('0x20')]();});}};}function handleEntityNotFound(_0x565164){return function(_0x58804b){if(!_0x58804b){_0x565164[_0xac4a('0x37')](0x194);}return _0x58804b;};}function handleError(_0x1ba096,_0x1b42b6){_0x1b42b6=_0x1b42b6||0x1f4;return function(_0x3de9e2){logger['error'](_0x3de9e2[_0xac4a('0x38')]);if(_0x3de9e2[_0xac4a('0x34')]){delete _0x3de9e2['name'];}_0x1ba096[_0xac4a('0x1f')](_0x1b42b6)[_0xac4a('0x39')](_0x3de9e2);};}exports[_0xac4a('0x3a')]=function(_0x5f0eb8,_0x121328){var _0x357f06={},_0x1b5427={'count':0x0,'rows':[]};var _0x4e0445=_(db[_0xac4a('0x3b')][_0xac4a('0x3c')])['map'](function(_0x59bebf){return{'name':_0x59bebf[_0xac4a('0x3d')],'type':_0x59bebf['type']['key']};})['filter'](function(_0x4fee3a){return!_[_0xac4a('0x32')]([_0xac4a('0x3e'),_0xac4a('0x3f')],_0x4fee3a[_0xac4a('0x34')]);})[_0xac4a('0x31')]();_0x357f06=qs[_0xac4a('0x40')](_0x4e0445,_0x5f0eb8);var _0x4220e2={'where':_0x357f06[_0xac4a('0x41')]};return db[_0xac4a('0x3b')][_0xac4a('0x25')](_0x4220e2)[_0xac4a('0x36')](function(_0x1c2a87){_0x1b5427['count']=_0x1c2a87;if(_0x5f0eb8['query']['includeAll']){_0x357f06[_0xac4a('0x42')]=[{'all':!![]}];}if(!_[_0xac4a('0x32')](_0x357f06[_0xac4a('0x43')],'id')){_0x357f06[_0xac4a('0x43')][_0xac4a('0x44')]('id');}return db[_0xac4a('0x3b')][_0xac4a('0x45')](_0x357f06);})[_0xac4a('0x36')](function(_0x3e9973){_0x1b5427[_0xac4a('0x46')]=_0x3e9973;if(_0x5f0eb8['query'][_0xac4a('0x47')]===_0xac4a('0x48')){var _0x3d9595=[];for(var _0x3f24a1=0x0;_0x3f24a1<_0x1b5427[_0xac4a('0x46')]['length'];_0x3f24a1++){_0x3d9595[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x49'),_0x1b5427['rows'][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595['push'](get_open_tabs(_0xac4a('0x4b'),_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4c'),_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4d'),_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595[_0xac4a('0x44')](get_open_tabs('openchannel',_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595[_0xac4a('0x44')](get_open_tabs('whatsapp',_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));}return BPromise['all'](_0x3d9595)[_0xac4a('0x36')](function(_0x5a7f6e){return _0x1b5427;});}else{return _0x1b5427;}})[_0xac4a('0x36')](respondWithFilteredResult(_0x121328,_0x357f06))[_0xac4a('0x1e')](handleError(_0x121328,null));};exports[_0xac4a('0x4e')]=function(_0x5e3581,_0x588374){var _0x42fd9d={'raw':![],'where':{'id':_0x5e3581[_0xac4a('0x4f')]['id']}},_0x4aaeff={};_0x4aaeff['model']=_[_0xac4a('0x50')](_['keys'](db[_0xac4a('0x3b')][_0xac4a('0x3c')]),[_0xac4a('0x3e'),_0xac4a('0x3f')]);_0x4aaeff['query']=_[_0xac4a('0x51')](_0x5e3581[_0xac4a('0x52')]);_0x4aaeff[_0xac4a('0x53')]=_[_0xac4a('0x54')](_0x4aaeff[_0xac4a('0x55')],_0x4aaeff[_0xac4a('0x52')]);_0x42fd9d[_0xac4a('0x43')]=_['intersection'](_0x4aaeff[_0xac4a('0x55')],qs[_0xac4a('0x56')](_0x5e3581['query'][_0xac4a('0x56')]));_0x42fd9d[_0xac4a('0x43')]=_0x42fd9d[_0xac4a('0x43')][_0xac4a('0x57')]?_0x42fd9d['attributes']:_0x4aaeff[_0xac4a('0x55')];if(_0x5e3581[_0xac4a('0x52')][_0xac4a('0x58')]){_0x42fd9d[_0xac4a('0x42')]=[{'all':!![]}];}_0x42fd9d=_[_0xac4a('0x59')]({},_0x42fd9d,_0x5e3581['options']);if(!_[_0xac4a('0x32')](_0x42fd9d['attributes'],'id')){_0x42fd9d[_0xac4a('0x43')][_0xac4a('0x44')]('id');}return db['User']['find'](_0x42fd9d)[_0xac4a('0x36')](handleEntityNotFound(_0x588374,null))[_0xac4a('0x36')](function(_0x4d448f){var _0x18d29c=[];values=_0x4d448f;if(_0x5e3581[_0xac4a('0x52')][_0xac4a('0x47')]===_0xac4a('0x48')){_0x18d29c['push'](get_open_tabs(_0xac4a('0x49'),_0x4d448f[_0xac4a('0x4a')]));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4b'),_0x4d448f[_0xac4a('0x4a')]));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x5a'),_0x4d448f['dataValues']));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x5b'),_0x4d448f[_0xac4a('0x4a')]));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4c'),_0x4d448f[_0xac4a('0x4a')]));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4d'),_0x4d448f[_0xac4a('0x4a')]));return BPromise[_0xac4a('0x5c')](_0x18d29c);}else{return values;}})[_0xac4a('0x36')](function(_0x38dd4f){return values;})[_0xac4a('0x36')](respondWithResult(_0x588374,null))[_0xac4a('0x1e')](handleError(_0x588374,null));};exports[_0xac4a('0x5d')]=function(_0x11c753,_0x492aae){if(_0x11c753[_0xac4a('0x5e')]['id']){delete _0x11c753['body']['id'];}delete _0x11c753[_0xac4a('0x5e')]['role'];return db[_0xac4a('0x3b')]['find']({'where':{'id':_0x11c753[_0xac4a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x492aae,null))['then'](saveUpdates(_0x11c753[_0xac4a('0x5e')],null))[_0xac4a('0x36')](respondWithResult(_0x492aae,null))[_0xac4a('0x1e')](handleError(_0x492aae,null));};exports[_0xac4a('0x5f')]=function(_0x2f9940,_0xb7b884){return db['User'][_0xac4a('0x5f')]()['then'](respondWithResult(_0xb7b884,null))[_0xac4a('0x1e')](handleError(_0xb7b884,null));};exports['addContacts']=function(_0x347880,_0x19ce2c){return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x347880[_0xac4a('0x4f')]['id']}})[_0xac4a('0x36')](handleEntityNotFound(_0x19ce2c,null))[_0xac4a('0x36')](function(_0xe3e375){if(_0xe3e375){return _0xe3e375[_0xac4a('0x60')](_0x347880[_0xac4a('0x5e')][_0xac4a('0x61')],_[_0xac4a('0x62')](_0x347880[_0xac4a('0x5e')],[_0xac4a('0x61'),'id'])||{});}})[_0xac4a('0x36')](respondWithResult(_0x19ce2c,null))[_0xac4a('0x1e')](handleError(_0x19ce2c,null));};function validateUser(_0x38cb4f){return new BPromise(function(_0x4a0156,_0xa90d71){if(_0x38cb4f[_0xac4a('0x63')])return _0x4a0156(_0x38cb4f);return db['Setting'][_0xac4a('0x64')](0x1)[_0xac4a('0x36')](function(_0x2d24c7){if(_0x2d24c7[_0xac4a('0x65')])authService[_0xac4a('0x66')](_0x38cb4f['password']);db['User'][_0xac4a('0x67')](_0xac4a('0x63'))[_0xac4a('0x36')](function(_0x148288){if(_[_0xac4a('0x68')](_0x148288)){_0x38cb4f[_0xac4a('0x63')]=_0x2d24c7[_0xac4a('0x69')]||0x1;return;}if(_[_0xac4a('0x68')](_0x2d24c7[_0xac4a('0x69')])||_0x2d24c7[_0xac4a('0x69')]===_0x148288){_0x38cb4f[_0xac4a('0x63')]=_0x148288+0x1;return;}if(_0x2d24c7['min_internal']>_0x148288){_0x38cb4f['internal']=_0x2d24c7[_0xac4a('0x69')];return;}return db[_0xac4a('0x6a')][_0xac4a('0x52')](_0xac4a('0x6b'),{'type':db[_0xac4a('0x6a')][_0xac4a('0x6c')][_0xac4a('0x6d')]})[_0xac4a('0x36')](function(_0x453d62){if(_0x453d62&&_0x453d62[_0xac4a('0x57')]){for(var _0xb09b89=0x0,_0xb12cc5=_0x453d62['length'];_0xb09b89<_0xb12cc5&&_[_0xac4a('0x68')](_0x38cb4f[_0xac4a('0x63')]);_0xb09b89++){if(_0x2d24c7[_0xac4a('0x69')]<=_0x453d62[_0xb09b89][_0xac4a('0x6e')]){_0x38cb4f['internal']=_0x453d62[_0xb09b89][_0xac4a('0x6e')];}else if(_0x2d24c7['min_internal']>_0x453d62[_0xb09b89][_0xac4a('0x6e')]&&_0x2d24c7[_0xac4a('0x69')]<=_0x453d62[_0xb09b89]['to']){_0x38cb4f['internal']=_0x2d24c7['min_internal'];}}}if(_[_0xac4a('0x68')](_0x38cb4f[_0xac4a('0x63')])){_0x38cb4f[_0xac4a('0x63')]=_0x148288+0x1;}return _0x4a0156(_0x38cb4f);});});})['catch'](function(_0x3a0cf8){_0xa90d71(_0x3a0cf8);});});}function updateUser(_0x4d067d){return new BPromise(function(_0x114b11,_0x4a88c7){try{if(_0x4d067d['voicemail']){_0x4d067d[_0xac4a('0x6f')]=_0x4d067d['internal'];_0x4d067d[_0xac4a('0x70')]={'mailbox':_0x4d067d['internal'],'password':_0x4d067d[_0xac4a('0x3e')],'fullname':_0x4d067d[_0xac4a('0x71')],'email':_0x4d067d['email']};}if(_0x4d067d[_0xac4a('0x29')]==='agent'){if(!_0x4d067d[_0xac4a('0x72')])_0x4d067d[_0xac4a('0x72')]=['101',_0xac4a('0x73'),'103','113',_0xac4a('0x74'),'104',_0xac4a('0x75'),'106','107',_0xac4a('0x76'),_0xac4a('0x77'),_0xac4a('0x78'),'111','114',_0xac4a('0x79')];}_0x114b11(_0x4d067d);}catch(_0x9c0fa1){_0x4a88c7(_0x9c0fa1);}});}exports['create']=function(_0x4e93f5,_0x3824a2){if(_0x4e93f5[_0xac4a('0x2b')][_0xac4a('0x29')]===_0xac4a('0x2c'))throw new Error(_0xac4a('0x7a'));if(_0x4e93f5[_0xac4a('0x5e')][_0xac4a('0x29')]===_0xac4a('0x2b')&&_0x4e93f5[_0xac4a('0x2b')]['role']!==_0xac4a('0x2a')){throw new Error(_0xac4a('0x7b'));}if(_0x4e93f5[_0xac4a('0x5e')]['role']===_0xac4a('0x2a')&&_0x4e93f5[_0xac4a('0x2b')][_0xac4a('0x29')]!==_0xac4a('0x2a')){throw new Error(_0xac4a('0x7c'));}return licenseUtil['checkUserLimits']([_0x4e93f5[_0xac4a('0x5e')]])[_0xac4a('0x36')](function(){return validateUser(_0x4e93f5[_0xac4a('0x5e')]);})[_0xac4a('0x36')](function(_0x72c90c){return updateUser(_0x72c90c)[_0xac4a('0x36')](function(_0xd7bdd6){if(_0xd7bdd6['role']===_0xac4a('0x2a')){_0xd7bdd6[_0xac4a('0x7d')]=_0x4e93f5[_0xac4a('0x2b')][_0xac4a('0x7d')];delete _0xd7bdd6[_0xac4a('0x7e')];}return _0xd7bdd6;});})[_0xac4a('0x36')](function(_0x547eec){return db[_0xac4a('0x3b')][_0xac4a('0x7f')](_0x547eec,{'include':[{'model':db[_0xac4a('0x70')],'as':_0xac4a('0x70')}]});})['then'](function(_0x21a384){if(_0x4e93f5['body'][_0xac4a('0x29')]===_0xac4a('0x2b'))return _0x21a384;if(_0x4e93f5['user']['role']!==_0xac4a('0x2b'))return _0x21a384;return db[_0xac4a('0x80')][_0xac4a('0x33')]({'where':{'name':_0x21a384['role']===_0xac4a('0x2c')?'Agents':_0xac4a('0x81'),'userProfileId':_0x4e93f5[_0xac4a('0x2b')][_0xac4a('0x7e')]},'raw':!![]})[_0xac4a('0x36')](function(_0x2e2c92){if(!_0x2e2c92||_0x2e2c92['autoAssociation']!=0x0)return _0x21a384;return db['UserProfileResource'][_0xac4a('0x7f')]({'name':_0x21a384[_0xac4a('0x34')],'resourceId':_0x21a384['id'],'type':_0x2e2c92[_0xac4a('0x34')],'sectionId':_0x2e2c92['id']},{})[_0xac4a('0x36')](function(){return _0x21a384;});})[_0xac4a('0x1e')](function(_0x3c5bbc){logger[_0xac4a('0x1b')](_0xac4a('0x82'),_0x3c5bbc);throw _0x3c5bbc;});})['then'](respondWithResult(_0x3824a2,0xc9))['catch'](handleError(_0x3824a2,null));};exports[_0xac4a('0x83')]=function(_0x31cc9a,_0x247eee){var _0x950e60=_0x31cc9a[_0xac4a('0x5e')];var _0x2ea4a4=[];if(_0x31cc9a[_0xac4a('0x2b')][_0xac4a('0x29')]==='agent')throw new Error('Unauthorized');if(_[_0xac4a('0x84')](_0x950e60,[_0xac4a('0x29'),_0xac4a('0x2b')])&&_0x31cc9a[_0xac4a('0x2b')][_0xac4a('0x29')]!==_0xac4a('0x2a')){throw new Error(_0xac4a('0x7b'));}if(_['some'](_0x950e60,[_0xac4a('0x29'),_0xac4a('0x2a')])&&_0x31cc9a[_0xac4a('0x2b')]['role']!==_0xac4a('0x2a')){throw new Error(_0xac4a('0x85'));}return licenseUtil[_0xac4a('0x86')](_0x950e60)[_0xac4a('0x36')](function(){return validateUser(_0x950e60[0x0]);})[_0xac4a('0x36')](function(){for(var _0x27d023=0x1;_0x27d023<_0x950e60[_0xac4a('0x57')];_0x27d023++){var _0x2ef42a=_0x950e60[_0x27d023-0x1][_0xac4a('0x63')];if(!_0x950e60[_0x27d023]['internal'])_0x950e60[_0x27d023][_0xac4a('0x63')]=_0x2ef42a+0x1;_0x2ea4a4['push'](validateUser(_0x950e60[_0x27d023]));}return BPromise[_0xac4a('0x5c')](_0x2ea4a4);})[_0xac4a('0x36')](function(){_0x2ea4a4=[];for(var _0x3184b3=0x0;_0x3184b3<_0x950e60[_0xac4a('0x57')];_0x3184b3++){_0x2ea4a4[_0xac4a('0x44')](updateUser(_0x950e60[_0x3184b3]));}return BPromise[_0xac4a('0x5c')](_0x2ea4a4);})[_0xac4a('0x36')](function(){return BPromise['each'](_0x950e60,function(_0x2b883a){return db[_0xac4a('0x3b')][_0xac4a('0x7f')](_0x2b883a,{'include':[{'model':db[_0xac4a('0x70')],'as':_0xac4a('0x70')}]})['then'](function(_0x1b37d9){_0x2b883a['id']=_0x1b37d9['id'];return _0x2b883a;});});})[_0xac4a('0x36')](function(_0x4f2b19){if(_0x31cc9a['body'][_0xac4a('0x29')]===_0xac4a('0x2b'))return _0x4f2b19;if(_0x31cc9a['user'][_0xac4a('0x29')]!==_0xac4a('0x2b'))return _0x4f2b19;var _0x6afaba=_[_0xac4a('0x84')](_0x4f2b19,function(_0x31df2d){return _0x31df2d[_0xac4a('0x29')]==='agent'||_0x31df2d[_0xac4a('0x29')]===_0xac4a('0x2d');});if(!_0x6afaba)return _0x4f2b19;return db[_0xac4a('0x80')]['findAll']({'where':{'name':{'$or':[_0xac4a('0x87'),_0xac4a('0x81')]},'userProfileId':_0x31cc9a[_0xac4a('0x2b')][_0xac4a('0x7e')]},'raw':!![]})[_0xac4a('0x36')](function(_0x23d635){if(_['isEmpty'](_0x23d635)||!_[_0xac4a('0x84')](_0x23d635,[_0xac4a('0x88'),0x0]))return _0x4f2b19;_0x2ea4a4=[];var _0x5ab83b=_(_0x23d635)[_0xac4a('0x30')](function(_0x55054a){if(_0x55054a[_0xac4a('0x88')]===0x1)return;return _0x55054a[_0xac4a('0x34')]==='Agents'?_0xac4a('0x2c'):'telephone';})[_0xac4a('0x89')]()['value']();for(var _0x3c601e=0x0;_0x3c601e<_0x4f2b19[_0xac4a('0x57')];_0x3c601e++){if(!_[_0xac4a('0x32')](_0x5ab83b,_0x4f2b19[_0x3c601e][_0xac4a('0x29')]))return;var _0xc38492=_0x4f2b19[_0x3c601e][_0xac4a('0x29')]===_0xac4a('0x2c')?_0xac4a('0x87'):_0xac4a('0x81');_0x2ea4a4[_0xac4a('0x44')](db[_0xac4a('0x8a')][_0xac4a('0x7f')]({'name':_0x4f2b19[_0x3c601e][_0xac4a('0x34')],'resourceId':_0x4f2b19[_0x3c601e]['id'],'type':_0xc38492,'sectionId':_[_0xac4a('0x33')](_0x23d635,['name',_0xc38492])['id']},{}));}return BPromise[_0xac4a('0x5c')](_0x2ea4a4);});})[_0xac4a('0x36')](respondWithResult(_0x247eee,0xc9))['catch'](handleError(_0x247eee,null));};exports[_0xac4a('0x8b')]=function(_0x31d190,_0x1b10ad){if(_0x31d190[_0xac4a('0x5e')]['id']){delete _0x31d190[_0xac4a('0x5e')]['id'];}return db['User'][_0xac4a('0x33')]({'where':{'id':_0x31d190['params']['id']}})[_0xac4a('0x36')](function(_0x28ae76){if(!_0x28ae76)return null;if(_0x28ae76['id']===_0x31d190[_0xac4a('0x2b')]['id']){if(!_0x31d190[_0xac4a('0x5e')]['oldPassword']||!_0x31d190[_0xac4a('0x5e')]['newPassword']){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0x8e'));}if(!_0x28ae76['authenticate'](_0x31d190[_0xac4a('0x5e')][_0xac4a('0x8f')])){throw new db[(_0xac4a('0x8c'))]['ValidationError'](_0xac4a('0x90'));}if(_0x31d190[_0xac4a('0x5e')][_0xac4a('0x8f')]===_0x31d190[_0xac4a('0x5e')][_0xac4a('0x91')]){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0x92'));}}else if(_0x31d190['user'][_0xac4a('0x29')]==='admin'){if(!_0x31d190['body']['newPassword']){throw new db['Sequelize']['ValidationError'](_0xac4a('0x93'));}}else if(_0x31d190[_0xac4a('0x2b')][_0xac4a('0x29')]===_0xac4a('0x2b')){if(!_0x31d190[_0xac4a('0x5e')]['newPassword']){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0x93'));}if(_0x28ae76[_0xac4a('0x29')]!==_0xac4a('0x2c')){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0x7a'));}}else{throw new db['Sequelize'][(_0xac4a('0x8d'))](_0xac4a('0x7a'));}return _0x28ae76;})[_0xac4a('0x36')](handleEntityNotFound(_0x1b10ad,null))[_0xac4a('0x36')](function(_0x303d5d){return db[_0xac4a('0x94')][_0xac4a('0x95')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xac4a('0x96')]})[_0xac4a('0x36')](function(_0x51993a){if(_0x51993a[_0xac4a('0x65')])authService[_0xac4a('0x66')](_0x31d190['body']['newPassword']);if(!_0x51993a[_0xac4a('0x97')]||!_0x303d5d[_0xac4a('0x98')])return _0x303d5d;authService[_0xac4a('0x99')](_0x31d190[_0xac4a('0x5e')][_0xac4a('0x91')],_0x303d5d['previousPasswords'],_0x51993a[_0xac4a('0x96')]);return _0x303d5d;})['then'](saveUpdates({'password':_0x31d190['body']['newPassword'],'passwordResetAt':_0x31d190[_0xac4a('0x2b')]['id']==_0x31d190[_0xac4a('0x4f')]['id']?moment():null,'previousPasswords':authService[_0xac4a('0x9a')](_0x31d190[_0xac4a('0x5e')][_0xac4a('0x91')],_0x303d5d[_0xac4a('0x98')])},null));})[_0xac4a('0x36')](respondWithResult(_0x1b10ad,null))[_0xac4a('0x1e')](handleError(_0x1b10ad,null));};exports['addQueues']=function(_0x5e1662,_0x53bcbc){var _0x3305a5=_0x5e1662[_0xac4a('0x5e')][_0xac4a('0x9b')];return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x5e1662[_0xac4a('0x4f')]['id']},'attributes':['id',_0xac4a('0x34'),_0xac4a('0x29'),_0xac4a('0x9c'),_0xac4a('0x9d'),_0xac4a('0x9e'),_0xac4a('0x9f')]})[_0xac4a('0x36')](handleEntityNotFound(_0x53bcbc,null))[_0xac4a('0x36')](function(_0x356a6b){if(_0x356a6b){if(!utils[_0xac4a('0xa0')](_0x3305a5)){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0xa1'));}return _0x356a6b[_0xac4a('0xa2')+_[_0xac4a('0xa3')](_0x3305a5[_0xac4a('0xa4')]())+_0xac4a('0xa5')](_0x5e1662['body'][_0xac4a('0x61')],{'penalty':_0x5e1662[_0xac4a('0x5e')][_0xac4a('0xa6')]||0x0})[_0xac4a('0xa7')](function(_0x237312){for(var _0x31afd2=0x0;_0x31afd2<_0x5e1662[_0xac4a('0x5e')][_0xac4a('0x61')]['length'];_0x31afd2+=0x1){var _0x5127ea={'UserId':Number(_0x5e1662[_0xac4a('0x4f')]['id'])};_0x5127ea[_[_0xac4a('0xa3')](_0x3305a5[_0xac4a('0xa4')]())+'QueueId']=Number(_0x5e1662['body']['ids'][_0x31afd2]);socket[_0xac4a('0xa8')]('user'+_[_0xac4a('0xa3')](_0x3305a5[_0xac4a('0xa4')]())+'Queue:save',_0x5127ea);}return _0x237312;})[_0xac4a('0x36')](function(){if(_0x3305a5==='voice'){return db[_0xac4a('0xa9')][_0xac4a('0x45')]({'where':{'id':_0x5e1662[_0xac4a('0x5e')][_0xac4a('0x61')]||[]},'raw':!![],'attributes':['id',_0xac4a('0x34')]});}})[_0xac4a('0x36')](function(_0x5e0602){var _0x25bf23=_0x356a6b[_0xac4a('0x28')]({'plain':!![]});var _0x2c03a1=[];if(_0x3305a5==='voice'&&_0x25bf23[_0xac4a('0x29')]===_0xac4a('0x2c')&&_0x25bf23[_0xac4a('0x9c')]){for(var _0x247856=0x0;_0x247856<_0x5e0602['length'];_0x247856+=0x1){_0x2c03a1[_0xac4a('0x44')]({'membername':_0x25bf23[_0xac4a('0x34')],'UserId':_0x25bf23['id'],'queue_name':_0x5e0602[_0x247856][_0xac4a('0x34')],'VoiceQueueId':_0x5e0602[_0x247856]['id'],'interface':_[_0xac4a('0x68')](_0x25bf23[_0xac4a('0x9f')])?util[_0xac4a('0xaa')]('SIP/%s',_0x25bf23['name']):_0x25bf23[_0xac4a('0x9f')],'paused':_0x25bf23[_0xac4a('0x9e')]||![],'penalty':_0x5e1662[_0xac4a('0x5e')][_0xac4a('0xa6')]||0x0});}return BPromise[_0xac4a('0xab')](_0x2c03a1,function(_0x1a12a2){return db['UserVoiceQueueRt'][_0xac4a('0xac')](_0x1a12a2);});}return _0x356a6b;});}})['then'](respondWithStatusCode(_0x53bcbc,null))[_0xac4a('0x1e')](handleError(_0x53bcbc,null));};exports['removeQueues']=function(_0xa1df14,_0x13b938){var _0x15f35a;return db[_0xac4a('0x3b')]['find']({'where':{'id':_0xa1df14[_0xac4a('0x4f')]['id']},'attributes':['id',_0xac4a('0x34'),_0xac4a('0x29')]})[_0xac4a('0x36')](handleEntityNotFound(_0x13b938,null))[_0xac4a('0x36')](function(_0x520001){if(_0x520001){_0x15f35a=_0x520001;if(!_0xa1df14[_0xac4a('0x52')][_0xac4a('0x9b')]||!utils[_0xac4a('0xa0')](_0xa1df14[_0xac4a('0x52')][_0xac4a('0x9b')])){throw new db['Sequelize'][(_0xac4a('0x8d'))](_0xac4a('0xa1'));}return _0x520001[_0xac4a('0xad')+_[_0xac4a('0xa3')](_0xa1df14[_0xac4a('0x52')]['channel']['toLowerCase']())+'Queues'](_0xa1df14['query'][_0xac4a('0x61')]);}})[_0xac4a('0x36')](function(_0x17f815){if(_[_0xac4a('0xae')](_0xa1df14[_0xac4a('0x52')]['ids'])){for(var _0x293d49=0x0;_0x293d49<_0xa1df14[_0xac4a('0x52')]['ids'][_0xac4a('0x57')];_0x293d49+=0x1){var _0x11faad={'UserId':Number(_0xa1df14[_0xac4a('0x4f')]['id'])};_0x11faad[_['capitalize'](_0xa1df14[_0xac4a('0x52')][_0xac4a('0x9b')][_0xac4a('0xa4')]())+_0xac4a('0xaf')]=Number(_0xa1df14[_0xac4a('0x52')][_0xac4a('0x61')][_0x293d49]);socket[_0xac4a('0xa8')](_0xac4a('0x2b')+_[_0xac4a('0xa3')](_0xa1df14['query'][_0xac4a('0x9b')][_0xac4a('0xa4')]())+'Queue:remove',_0x11faad);}}else{var _0x11faad={'UserId':Number(_0xa1df14['params']['id'])};_0x11faad[_[_0xac4a('0xa3')](_0xa1df14[_0xac4a('0x52')]['channel'][_0xac4a('0xa4')]())+_0xac4a('0xaf')]=Number(_0xa1df14[_0xac4a('0x52')][_0xac4a('0x61')]);socket[_0xac4a('0xa8')](_0xac4a('0x2b')+_[_0xac4a('0xa3')](_0xa1df14[_0xac4a('0x52')]['channel']['toLowerCase']())+_0xac4a('0xb0'),_0x11faad);}return _0x17f815;})['then'](function(){if(_0xa1df14['query'][_0xac4a('0x9b')]===_0xac4a('0xb1')){return db[_0xac4a('0xb2')]['destroy']({'where':{'UserId':_0xa1df14[_0xac4a('0x4f')]['id'],'VoiceQueueId':_0xa1df14[_0xac4a('0x52')]['ids']},'individualHooks':!![]})['then'](function(){return _0x15f35a;});}return _0x15f35a;})[_0xac4a('0x36')](respondWithStatusCode(_0x13b938,null))[_0xac4a('0x1e')](handleError(_0x13b938,null));};exports[_0xac4a('0xb3')]=function(_0x368546,_0x4fadd1){_0x368546[_0xac4a('0x5e')][_0xac4a('0xb4')]=_0x368546[_0xac4a('0xb5')]['filename'];return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x368546[_0xac4a('0x4f')]['id']}})[_0xac4a('0x36')](handleEntityNotFound(_0x4fadd1,null))[_0xac4a('0x36')](saveUpdates(_0x368546['body'],null))['then'](respondWithResult(_0x4fadd1,null))[_0xac4a('0x1e')](handleError(_0x4fadd1,null));};exports[_0xac4a('0xb6')]=function(_0x1774e5,_0x110e16){var _0x14ca03=path[_0xac4a('0xb7')](config[_0xac4a('0xb8')],_0xac4a('0xb9'));return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x1774e5[_0xac4a('0x4f')]['id']},'attributes':['id',_0xac4a('0xb4')],'raw':!![]})[_0xac4a('0x36')](handleEntityNotFound(_0x110e16,null))['then'](function(_0x3ef9b2){if(_0x3ef9b2){if(_['isNil'](_0x3ef9b2['userpic'])){return _0x110e16[_0xac4a('0xba')](_0x14ca03);}else{if(!fs[_0xac4a('0xbb')](path[_0xac4a('0xb7')](config[_0xac4a('0xb8')],_0xac4a('0xbc'),_0x3ef9b2[_0xac4a('0xb4')]))){return _0x110e16[_0xac4a('0xba')](_0x14ca03);}return _0x110e16[_0xac4a('0xba')](path[_0xac4a('0xb7')](config['root'],_0xac4a('0xbc'),_0x3ef9b2[_0xac4a('0xb4')]));}}})[_0xac4a('0x1e')](handleError(_0x110e16,null));};exports[_0xac4a('0xbd')]=function(_0x5c0bb8,_0x5b1934){return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x5c0bb8[_0xac4a('0x4f')]['id']},'attributes':['id']})[_0xac4a('0x36')](handleEntityNotFound(_0x5b1934,null))[_0xac4a('0x36')](function(_0x254de8){var _0x1c7ea7=[];values=_0x254de8[_0xac4a('0x4a')];_0x1c7ea7[_0xac4a('0x44')](get_open_tabs('chat',_0x254de8[_0xac4a('0x4a')]));_0x1c7ea7[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4b'),_0x254de8[_0xac4a('0x4a')]));_0x1c7ea7[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x5a'),_0x254de8['dataValues']));_0x1c7ea7['push'](get_open_tabs('whatsapp',_0x254de8[_0xac4a('0x4a')]));_0x1c7ea7[_0xac4a('0x44')](get_open_tabs('fax',_0x254de8['dataValues']));_0x1c7ea7[_0xac4a('0x44')](get_open_tabs('mail',_0x254de8[_0xac4a('0x4a')]));return BPromise['all'](_0x1c7ea7);})[_0xac4a('0x36')](function(_0x2abd82){var _0x1888c3=[];if(_0x2abd82){for(var _0x27e640=0x0;_0x27e640=_0x2a6832){_0x2155f1=_0x2a6832;_0x297df7=0xc8;}else{_0x297df7=0xce;}_0x53181b[_0xef61('0x20')](_0x297df7);return _0x53181b[_0xef61('0x24')](_0xef61('0x25'),_0x2419a9+'-'+_0x2155f1+'/'+_0x2a6832)[_0xef61('0x26')](_0x3782c6);}return null;};}function saveUpdates(_0x63edd4){return function(_0x1f3572){if(_0x1f3572){return _0x1f3572[_0xef61('0x27')](_0x63edd4)[_0xef61('0x16')](function(_0x393ea9){return _0x393ea9;});}return null;};}function removeEntity(_0x587e26){return function(_0x2fe908){if(_0x2fe908){return _0x2fe908[_0xef61('0x28')]()[_0xef61('0x16')](function(){var _0x4f35ad=_0x2fe908['get']({'plain':!![]});if(_0x4f35ad[_0xef61('0x29')]===_0xef61('0x2a'))return;var _0x122176=[{'name':'Users','value':_0xef61('0x2b'),'ignore':!![]},{'name':_0xef61('0x2c'),'value':'agent','ignore':![]},{'name':_0xef61('0x2d'),'value':'telephone','ignore':![]}];var _0x4c7fd3=_(_0x122176)[_0xef61('0x2e')]('ignore')[_0xef61('0x2f')]('value')[_0xef61('0x30')]();if(_[_0xef61('0x31')](_0x4c7fd3,_0x4f35ad[_0xef61('0x29')])){return;}var _0x14c05c=_[_0xef61('0x32')](_0x122176,[_0xef61('0x30'),_0x4f35ad[_0xef61('0x29')]])[_0xef61('0x33')];return db[_0xef61('0x34')][_0xef61('0x28')]({'where':{'type':_0x14c05c,'resourceId':_0x4f35ad['id']}})['then'](function(){return _0x2fe908;});})[_0xef61('0x16')](function(){_0x587e26[_0xef61('0x20')](0xcc)[_0xef61('0x35')]();});}};}function handleEntityNotFound(_0x1c1760){return function(_0x310954){if(!_0x310954){_0x1c1760['sendStatus'](0x194);}return _0x310954;};}function handleError(_0x1c38dc,_0x3b7373){_0x3b7373=_0x3b7373||0x1f4;return function(_0x291944){logger['error'](_0x291944['stack']);if(_0x291944['name']){delete _0x291944[_0xef61('0x33')];}_0x1c38dc['status'](_0x3b7373)['send'](_0x291944);};}exports['index']=function(_0x3ee764,_0x294063){var _0x54e37a={},_0x508dc7={'count':0x0,'rows':[]};var _0x53c9ef=_(db['User'][_0xef61('0x36')])[_0xef61('0x2f')](function(_0x5e1128){return{'name':_0x5e1128[_0xef61('0x37')],'type':_0x5e1128[_0xef61('0x38')][_0xef61('0x39')]};})[_0xef61('0x2e')](function(_0x49e7c4){return!_[_0xef61('0x31')]([_0xef61('0x3a'),_0xef61('0x3b')],_0x49e7c4[_0xef61('0x33')]);})['value']();_0x54e37a=qs['getOptions'](_0x53c9ef,_0x3ee764);var _0x32109d={'where':_0x54e37a[_0xef61('0x3c')]};return db[_0xef61('0x3d')]['count'](_0x32109d)[_0xef61('0x16')](function(_0x361705){_0x508dc7[_0xef61('0x23')]=_0x361705;if(_0x3ee764[_0xef61('0x3e')]['includeAll']){_0x54e37a['include']=[{'all':!![]}];}if(!_['includes'](_0x54e37a[_0xef61('0x3f')],'id')){_0x54e37a[_0xef61('0x3f')][_0xef61('0x40')]('id');}return db[_0xef61('0x3d')][_0xef61('0x41')](_0x54e37a);})[_0xef61('0x16')](function(_0xc9b467){_0x508dc7['rows']=_0xc9b467;if(_0x3ee764[_0xef61('0x3e')][_0xef61('0x42')]===_0xef61('0x43')){var _0x898c74=[];for(var _0x51fac1=0x0;_0x51fac1<_0x508dc7[_0xef61('0x44')][_0xef61('0x45')];_0x51fac1++){_0x898c74[_0xef61('0x40')](get_open_tabs(_0xef61('0x46'),_0x508dc7[_0xef61('0x44')][_0x51fac1][_0xef61('0x47')]));_0x898c74['push'](get_open_tabs(_0xef61('0x48'),_0x508dc7[_0xef61('0x44')][_0x51fac1][_0xef61('0x47')]));_0x898c74['push'](get_open_tabs(_0xef61('0x49'),_0x508dc7[_0xef61('0x44')][_0x51fac1][_0xef61('0x47')]));_0x898c74[_0xef61('0x40')](get_open_tabs(_0xef61('0x4a'),_0x508dc7[_0xef61('0x44')][_0x51fac1]['dataValues']));_0x898c74[_0xef61('0x40')](get_open_tabs(_0xef61('0x4b'),_0x508dc7['rows'][_0x51fac1][_0xef61('0x47')]));_0x898c74[_0xef61('0x40')](get_open_tabs(_0xef61('0x4c'),_0x508dc7[_0xef61('0x44')][_0x51fac1]['dataValues']));}return BPromise[_0xef61('0x4d')](_0x898c74)[_0xef61('0x16')](function(_0x5e614b){return _0x508dc7;});}else{return _0x508dc7;}})['then'](respondWithFilteredResult(_0x294063,_0x54e37a))[_0xef61('0x1f')](handleError(_0x294063,null));};exports[_0xef61('0x4e')]=function(_0x53bd30,_0xe9d203){var _0x132c77={'raw':![],'where':{'id':_0x53bd30[_0xef61('0x4f')]['id']}},_0x13d0f8={};_0x13d0f8[_0xef61('0x50')]=_[_0xef61('0x51')](_[_0xef61('0x52')](db['User'][_0xef61('0x36')]),['password',_0xef61('0x3b')]);_0x13d0f8[_0xef61('0x3e')]=_[_0xef61('0x52')](_0x53bd30[_0xef61('0x3e')]);_0x13d0f8[_0xef61('0x53')]=_[_0xef61('0x54')](_0x13d0f8[_0xef61('0x50')],_0x13d0f8[_0xef61('0x3e')]);_0x132c77[_0xef61('0x3f')]=_['intersection'](_0x13d0f8[_0xef61('0x50')],qs[_0xef61('0x55')](_0x53bd30['query']['fields']));_0x132c77[_0xef61('0x3f')]=_0x132c77[_0xef61('0x3f')]['length']?_0x132c77[_0xef61('0x3f')]:_0x13d0f8['model'];if(_0x53bd30[_0xef61('0x3e')][_0xef61('0x56')]){_0x132c77[_0xef61('0x57')]=[{'all':!![]}];}_0x132c77=_[_0xef61('0x58')]({},_0x132c77,_0x53bd30[_0xef61('0x59')]);if(!_[_0xef61('0x31')](_0x132c77['attributes'],'id')){_0x132c77[_0xef61('0x3f')][_0xef61('0x40')]('id');}return db['User'][_0xef61('0x32')](_0x132c77)[_0xef61('0x16')](handleEntityNotFound(_0xe9d203,null))['then'](function(_0x54a936){var _0x93441a=[];values=_0x54a936;if(_0x53bd30['query']['openTabs']==='true'){_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x46'),_0x54a936['dataValues']));_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x48'),_0x54a936[_0xef61('0x47')]));_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x4b'),_0x54a936[_0xef61('0x47')]));_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x4c'),_0x54a936['dataValues']));_0x93441a['push'](get_open_tabs(_0xef61('0x49'),_0x54a936[_0xef61('0x47')]));_0x93441a[_0xef61('0x40')](get_open_tabs(_0xef61('0x4a'),_0x54a936[_0xef61('0x47')]));return BPromise['all'](_0x93441a);}else{return values;}})[_0xef61('0x16')](function(_0x572d5f){return values;})['then'](respondWithResult(_0xe9d203,null))[_0xef61('0x1f')](handleError(_0xe9d203,null));};exports[_0xef61('0x27')]=function(_0x224f3a,_0x525a5e){if(_0x224f3a[_0xef61('0x5a')]['id']){delete _0x224f3a[_0xef61('0x5a')]['id'];}delete _0x224f3a[_0xef61('0x5a')][_0xef61('0x29')];return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x224f3a[_0xef61('0x4f')]['id']}})[_0xef61('0x16')](handleEntityNotFound(_0x525a5e,null))[_0xef61('0x16')](saveUpdates(_0x224f3a[_0xef61('0x5a')],null))['then'](respondWithResult(_0x525a5e,null))[_0xef61('0x1f')](handleError(_0x525a5e,null));};exports['describe']=function(_0x503e8c,_0x4386a7){return db[_0xef61('0x3d')][_0xef61('0x5b')]()[_0xef61('0x16')](respondWithResult(_0x4386a7,null))[_0xef61('0x1f')](handleError(_0x4386a7,null));};exports[_0xef61('0x5c')]=function(_0x5e98a9,_0x4c7a9a){return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x5e98a9[_0xef61('0x4f')]['id']}})[_0xef61('0x16')](handleEntityNotFound(_0x4c7a9a,null))[_0xef61('0x16')](function(_0x3ae98c){if(_0x3ae98c){return _0x3ae98c[_0xef61('0x5c')](_0x5e98a9[_0xef61('0x5a')][_0xef61('0x5d')],_[_0xef61('0x5e')](_0x5e98a9[_0xef61('0x5a')],['ids','id'])||{});}})[_0xef61('0x16')](respondWithResult(_0x4c7a9a,null))[_0xef61('0x1f')](handleError(_0x4c7a9a,null));};function validateUser(_0x485945){return new BPromise(function(_0x4559a6,_0x1856ee){if(_0x485945[_0xef61('0x5f')])return _0x4559a6(_0x485945);return db[_0xef61('0x60')][_0xef61('0x61')](0x1)[_0xef61('0x16')](function(_0x3e4678){if(_0x3e4678[_0xef61('0x62')])authService['validatePasswordPattern'](_0x485945[_0xef61('0x3a')]);db['User']['max']('internal')[_0xef61('0x16')](function(_0x205f80){if(_[_0xef61('0x63')](_0x205f80)){_0x485945['internal']=_0x3e4678[_0xef61('0x64')]||0x1;return;}if(_[_0xef61('0x63')](_0x3e4678[_0xef61('0x64')])||_0x3e4678[_0xef61('0x64')]===_0x205f80){_0x485945[_0xef61('0x5f')]=_0x205f80+0x1;return;}if(_0x3e4678[_0xef61('0x64')]>_0x205f80){_0x485945[_0xef61('0x5f')]=_0x3e4678[_0xef61('0x64')];return;}return db[_0xef61('0x65')][_0xef61('0x3e')](_0xef61('0x66'),{'type':db[_0xef61('0x65')][_0xef61('0x67')][_0xef61('0x68')]})[_0xef61('0x16')](function(_0x5931a4){if(_0x5931a4&&_0x5931a4[_0xef61('0x45')]){for(var _0x117d37=0x0,_0x529a78=_0x5931a4[_0xef61('0x45')];_0x117d37<_0x529a78&&_[_0xef61('0x63')](_0x485945[_0xef61('0x5f')]);_0x117d37++){if(_0x3e4678[_0xef61('0x64')]<=_0x5931a4[_0x117d37][_0xef61('0x69')]){_0x485945[_0xef61('0x5f')]=_0x5931a4[_0x117d37]['from'];}else if(_0x3e4678[_0xef61('0x64')]>_0x5931a4[_0x117d37][_0xef61('0x69')]&&_0x3e4678['min_internal']<=_0x5931a4[_0x117d37]['to']){_0x485945[_0xef61('0x5f')]=_0x3e4678['min_internal'];}}}if(_[_0xef61('0x63')](_0x485945[_0xef61('0x5f')])){_0x485945['internal']=_0x205f80+0x1;}return _0x4559a6(_0x485945);});});})[_0xef61('0x1f')](function(_0x512415){_0x1856ee(_0x512415);});});}function updateUser(_0x3cba7f){return new BPromise(function(_0x3f9882,_0x4c880e){try{if(_0x3cba7f['voicemail']){_0x3cba7f[_0xef61('0x6a')]=_0x3cba7f[_0xef61('0x5f')];_0x3cba7f[_0xef61('0x6b')]={'mailbox':_0x3cba7f[_0xef61('0x5f')],'password':_0x3cba7f[_0xef61('0x3a')],'fullname':_0x3cba7f['fullname'],'email':_0x3cba7f[_0xef61('0x6c')]};}if(_0x3cba7f[_0xef61('0x29')]===_0xef61('0x6d')){if(!_0x3cba7f[_0xef61('0x6e')])_0x3cba7f[_0xef61('0x6e')]=[_0xef61('0x6f'),'102',_0xef61('0x70'),'113',_0xef61('0x71'),_0xef61('0x72'),_0xef61('0x73'),_0xef61('0x74'),_0xef61('0x75'),_0xef61('0x76'),_0xef61('0x77'),_0xef61('0x78'),_0xef61('0x79'),_0xef61('0x7a'),_0xef61('0x7b')];}_0x3f9882(_0x3cba7f);}catch(_0x253b51){_0x4c880e(_0x253b51);}});}exports[_0xef61('0x7c')]=function(_0x5c2166,_0x3f4ff8){if(_0x5c2166[_0xef61('0x2b')][_0xef61('0x29')]===_0xef61('0x6d'))throw new Error('Unauthorized');if(_0x5c2166[_0xef61('0x5a')]['role']==='user'&&_0x5c2166[_0xef61('0x2b')]['role']!==_0xef61('0x2a')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x5c2166['body'][_0xef61('0x29')]===_0xef61('0x2a')&&_0x5c2166['user'][_0xef61('0x29')]!=='admin'){throw new Error(_0xef61('0x7d'));}return licenseUtil[_0xef61('0x7e')]([_0x5c2166[_0xef61('0x5a')]])[_0xef61('0x16')](function(){return validateUser(_0x5c2166['body']);})[_0xef61('0x16')](function(_0x59813e){return updateUser(_0x59813e)[_0xef61('0x16')](function(_0x2ddf83){if(_0x2ddf83[_0xef61('0x29')]===_0xef61('0x2a')){_0x2ddf83[_0xef61('0x7f')]=_0x5c2166[_0xef61('0x2b')][_0xef61('0x7f')];delete _0x2ddf83[_0xef61('0x80')];}return _0x2ddf83;});})[_0xef61('0x16')](function(_0x540b68){return db[_0xef61('0x3d')]['create'](_0x540b68,{'include':[{'model':db[_0xef61('0x6b')],'as':_0xef61('0x6b')}]});})['then'](function(_0x43eb12){if(_0x5c2166['body']['role']===_0xef61('0x2b'))return _0x43eb12;if(_0x5c2166[_0xef61('0x2b')]['role']!==_0xef61('0x2b'))return _0x43eb12;return db[_0xef61('0x81')]['find']({'where':{'name':_0x43eb12[_0xef61('0x29')]===_0xef61('0x6d')?'Agents':_0xef61('0x2d'),'userProfileId':_0x5c2166['user'][_0xef61('0x80')]},'raw':!![]})[_0xef61('0x16')](function(_0x1d0dd8){if(!_0x1d0dd8||_0x1d0dd8[_0xef61('0x82')]!=0x0)return _0x43eb12;return db['UserProfileResource'][_0xef61('0x7c')]({'name':_0x43eb12[_0xef61('0x33')],'resourceId':_0x43eb12['id'],'type':_0x1d0dd8[_0xef61('0x33')],'sectionId':_0x1d0dd8['id']},{})['then'](function(){return _0x43eb12;});})[_0xef61('0x1f')](function(_0x2a0edb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a0edb);throw _0x2a0edb;});})[_0xef61('0x16')](respondWithResult(_0x3f4ff8,0xc9))[_0xef61('0x1f')](handleError(_0x3f4ff8,null));};exports[_0xef61('0x83')]=function(_0x3d829e,_0x15ddb0){var _0x1b3b78=_0x3d829e[_0xef61('0x5a')];var _0x113f9c=[];if(_0x3d829e[_0xef61('0x2b')][_0xef61('0x29')]===_0xef61('0x6d'))throw new Error(_0xef61('0x84'));if(_[_0xef61('0x85')](_0x1b3b78,[_0xef61('0x29'),_0xef61('0x2b')])&&_0x3d829e[_0xef61('0x2b')]['role']!==_0xef61('0x2a')){throw new Error(_0xef61('0x86'));}if(_[_0xef61('0x85')](_0x1b3b78,[_0xef61('0x29'),_0xef61('0x2a')])&&_0x3d829e[_0xef61('0x2b')][_0xef61('0x29')]!==_0xef61('0x2a')){throw new Error(_0xef61('0x87'));}return licenseUtil[_0xef61('0x7e')](_0x1b3b78)[_0xef61('0x16')](function(){return validateUser(_0x1b3b78[0x0]);})[_0xef61('0x16')](function(){for(var _0x4e8a39=0x1;_0x4e8a39<_0x1b3b78[_0xef61('0x45')];_0x4e8a39++){var _0xe465b9=_0x1b3b78[_0x4e8a39-0x1]['internal'];if(!_0x1b3b78[_0x4e8a39][_0xef61('0x5f')])_0x1b3b78[_0x4e8a39][_0xef61('0x5f')]=_0xe465b9+0x1;_0x113f9c[_0xef61('0x40')](validateUser(_0x1b3b78[_0x4e8a39]));}return BPromise[_0xef61('0x4d')](_0x113f9c);})[_0xef61('0x16')](function(){_0x113f9c=[];for(var _0x51a988=0x0;_0x51a988<_0x1b3b78[_0xef61('0x45')];_0x51a988++){_0x113f9c['push'](updateUser(_0x1b3b78[_0x51a988]));}return BPromise[_0xef61('0x4d')](_0x113f9c);})[_0xef61('0x16')](function(){return BPromise[_0xef61('0x88')](_0x1b3b78,function(_0x19b1a0){return db[_0xef61('0x3d')][_0xef61('0x7c')](_0x19b1a0,{'include':[{'model':db[_0xef61('0x6b')],'as':_0xef61('0x6b')}]})['then'](function(_0x3f68db){_0x19b1a0['id']=_0x3f68db['id'];return _0x19b1a0;});});})[_0xef61('0x16')](function(_0x28f142){if(_0x3d829e[_0xef61('0x5a')][_0xef61('0x29')]===_0xef61('0x2b'))return _0x28f142;if(_0x3d829e[_0xef61('0x2b')][_0xef61('0x29')]!==_0xef61('0x2b'))return _0x28f142;var _0x53678e=_[_0xef61('0x85')](_0x28f142,function(_0xe57b4d){return _0xe57b4d[_0xef61('0x29')]===_0xef61('0x6d')||_0xe57b4d['role']==='telephone';});if(!_0x53678e)return _0x28f142;return db[_0xef61('0x81')][_0xef61('0x41')]({'where':{'name':{'$or':[_0xef61('0x2c'),_0xef61('0x2d')]},'userProfileId':_0x3d829e[_0xef61('0x2b')][_0xef61('0x80')]},'raw':!![]})[_0xef61('0x16')](function(_0x4c2d94){if(_[_0xef61('0x89')](_0x4c2d94)||!_[_0xef61('0x85')](_0x4c2d94,[_0xef61('0x82'),0x0]))return _0x28f142;_0x113f9c=[];var _0x22e342=_(_0x4c2d94)[_0xef61('0x2f')](function(_0x4fa56b){if(_0x4fa56b[_0xef61('0x82')]===0x1)return;return _0x4fa56b['name']===_0xef61('0x2c')?_0xef61('0x6d'):_0xef61('0x8a');})[_0xef61('0x8b')]()[_0xef61('0x30')]();for(var _0xa23aa9=0x0;_0xa23aa9<_0x28f142['length'];_0xa23aa9++){if(!_[_0xef61('0x31')](_0x22e342,_0x28f142[_0xa23aa9][_0xef61('0x29')]))return;var _0xc67b1b=_0x28f142[_0xa23aa9][_0xef61('0x29')]===_0xef61('0x6d')?_0xef61('0x2c'):_0xef61('0x2d');_0x113f9c['push'](db[_0xef61('0x34')][_0xef61('0x7c')]({'name':_0x28f142[_0xa23aa9][_0xef61('0x33')],'resourceId':_0x28f142[_0xa23aa9]['id'],'type':_0xc67b1b,'sectionId':_['find'](_0x4c2d94,['name',_0xc67b1b])['id']},{}));}return BPromise[_0xef61('0x4d')](_0x113f9c);});})[_0xef61('0x16')](respondWithResult(_0x15ddb0,0xc9))['catch'](handleError(_0x15ddb0,null));};exports[_0xef61('0x8c')]=function(_0x1a9418,_0x30e931){if(_0x1a9418[_0xef61('0x5a')]['id']){delete _0x1a9418[_0xef61('0x5a')]['id'];}return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x1a9418[_0xef61('0x4f')]['id']}})['then'](function(_0x321b02){if(!_0x321b02)return null;if(_0x321b02['id']===_0x1a9418[_0xef61('0x2b')]['id']){if(!_0x1a9418[_0xef61('0x5a')][_0xef61('0x8d')]||!_0x1a9418[_0xef61('0x5a')]['newPassword']){throw new db[(_0xef61('0x8e'))]['ValidationError'](_0xef61('0x8f'));}if(!_0x321b02[_0xef61('0x90')](_0x1a9418[_0xef61('0x5a')]['oldPassword'])){throw new db['Sequelize'][(_0xef61('0x91'))](_0xef61('0x92'));}if(_0x1a9418['body']['oldPassword']===_0x1a9418[_0xef61('0x5a')][_0xef61('0x93')]){throw new db[(_0xef61('0x8e'))][(_0xef61('0x91'))](_0xef61('0x94'));}}else if(_0x1a9418[_0xef61('0x2b')][_0xef61('0x29')]===_0xef61('0x2a')){if(!_0x1a9418[_0xef61('0x5a')][_0xef61('0x93')]){throw new db[(_0xef61('0x8e'))]['ValidationError'](_0xef61('0x95'));}}else if(_0x1a9418[_0xef61('0x2b')]['role']===_0xef61('0x2b')){if(!_0x1a9418[_0xef61('0x5a')][_0xef61('0x93')]){throw new db[(_0xef61('0x8e'))][(_0xef61('0x91'))](_0xef61('0x95'));}if(_0x321b02['role']!==_0xef61('0x6d')){throw new db[(_0xef61('0x8e'))][(_0xef61('0x91'))](_0xef61('0x84'));}}else{throw new db[(_0xef61('0x8e'))][(_0xef61('0x91'))]('Unauthorized');}return _0x321b02;})['then'](handleEntityNotFound(_0x30e931,null))[_0xef61('0x16')](function(_0x13d2f4){return db[_0xef61('0x60')][_0xef61('0x96')]({'attributes':['id',_0xef61('0x62'),_0xef61('0x97'),_0xef61('0x98')]})['then'](function(_0x569dc7){if(_0x569dc7[_0xef61('0x62')])authService[_0xef61('0x99')](_0x1a9418[_0xef61('0x5a')][_0xef61('0x93')]);if(!_0x569dc7[_0xef61('0x97')]||!_0x13d2f4['previousPasswords'])return _0x13d2f4;authService[_0xef61('0x9a')](_0x1a9418['body'][_0xef61('0x93')],_0x13d2f4['previousPasswords'],_0x569dc7[_0xef61('0x98')]);return _0x13d2f4;})['then'](saveUpdates({'password':_0x1a9418['body'][_0xef61('0x93')],'passwordResetAt':_0x1a9418[_0xef61('0x2b')]['id']==_0x1a9418[_0xef61('0x4f')]['id']?moment():null,'previousPasswords':authService[_0xef61('0x9b')](_0x1a9418[_0xef61('0x5a')]['newPassword'],_0x13d2f4['previousPasswords'])},null));})['then'](respondWithResult(_0x30e931,null))[_0xef61('0x1f')](handleError(_0x30e931,null));};exports['addQueues']=function(_0x35155e,_0x132875){var _0x2ba1e7=_0x35155e[_0xef61('0x5a')][_0xef61('0x9c')];return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x35155e['params']['id']},'attributes':['id',_0xef61('0x33'),'role',_0xef61('0x9d'),_0xef61('0x9e'),_0xef61('0x9f'),_0xef61('0xa0')]})['then'](handleEntityNotFound(_0x132875,null))[_0xef61('0x16')](function(_0x45c0f4){if(_0x45c0f4){if(!utils[_0xef61('0xa1')](_0x2ba1e7)){throw new db['Sequelize']['ValidationError'](_0xef61('0xa2'));}return _0x45c0f4[_0xef61('0xa3')+_['capitalize'](_0x2ba1e7[_0xef61('0xa4')]())+_0xef61('0xa5')](_0x35155e['body']['ids'],{'penalty':_0x35155e[_0xef61('0x5a')][_0xef61('0xa6')]||0x0})['spread'](function(_0x1090ba){for(var _0x5d2765=0x0;_0x5d2765<_0x35155e[_0xef61('0x5a')]['ids'][_0xef61('0x45')];_0x5d2765+=0x1){var _0x4be6f2={'UserId':Number(_0x35155e[_0xef61('0x4f')]['id'])};_0x4be6f2[_['capitalize'](_0x2ba1e7[_0xef61('0xa4')]())+_0xef61('0xa7')]=Number(_0x35155e['body'][_0xef61('0x5d')][_0x5d2765]);socket[_0xef61('0xa8')](_0xef61('0x2b')+_['capitalize'](_0x2ba1e7['toLowerCase']())+_0xef61('0xa9'),_0x4be6f2);}return _0x1090ba;})[_0xef61('0x16')](function(){if(_0x2ba1e7==='voice'){return db['VoiceQueue'][_0xef61('0x41')]({'where':{'id':_0x35155e[_0xef61('0x5a')]['ids']||[]},'raw':!![],'attributes':['id',_0xef61('0x33')]});}})['then'](function(_0x3dc1f2){var _0x87fe0e=_0x45c0f4[_0xef61('0xaa')]({'plain':!![]});var _0x128ddc=[];if(_0x2ba1e7===_0xef61('0xab')&&_0x87fe0e[_0xef61('0x29')]==='agent'&&_0x87fe0e['online']){for(var _0x780325=0x0;_0x780325<_0x3dc1f2[_0xef61('0x45')];_0x780325+=0x1){_0x128ddc[_0xef61('0x40')]({'membername':_0x87fe0e[_0xef61('0x33')],'UserId':_0x87fe0e['id'],'queue_name':_0x3dc1f2[_0x780325][_0xef61('0x33')],'VoiceQueueId':_0x3dc1f2[_0x780325]['id'],'interface':_[_0xef61('0x63')](_0x87fe0e[_0xef61('0xa0')])?util[_0xef61('0xac')]('SIP/%s',_0x87fe0e[_0xef61('0x33')]):_0x87fe0e[_0xef61('0xa0')],'paused':_0x87fe0e[_0xef61('0x9f')]||![],'penalty':_0x35155e[_0xef61('0x5a')][_0xef61('0xa6')]||0x0});}return BPromise[_0xef61('0x88')](_0x128ddc,function(_0x6b01f9){return db['UserVoiceQueueRt'][_0xef61('0xad')](_0x6b01f9);});}return _0x45c0f4;});}})[_0xef61('0x16')](respondWithStatusCode(_0x132875,null))[_0xef61('0x1f')](handleError(_0x132875,null));};exports[_0xef61('0xae')]=function(_0x318887,_0x3f77d1){var _0x4216f8;return db['User'][_0xef61('0x32')]({'where':{'id':_0x318887[_0xef61('0x4f')]['id']},'attributes':['id',_0xef61('0x33'),_0xef61('0x29')]})[_0xef61('0x16')](handleEntityNotFound(_0x3f77d1,null))[_0xef61('0x16')](function(_0x3ef5fd){if(_0x3ef5fd){_0x4216f8=_0x3ef5fd;if(!_0x318887['query'][_0xef61('0x9c')]||!utils[_0xef61('0xa1')](_0x318887['query']['channel'])){throw new db['Sequelize'][(_0xef61('0x91'))](_0xef61('0xa2'));}return _0x3ef5fd[_0xef61('0xaf')+_['capitalize'](_0x318887[_0xef61('0x3e')][_0xef61('0x9c')][_0xef61('0xa4')]())+_0xef61('0xa5')](_0x318887['query'][_0xef61('0x5d')]);}})[_0xef61('0x16')](function(_0x23a826){if(_[_0xef61('0xb0')](_0x318887[_0xef61('0x3e')]['ids'])){for(var _0x471206=0x0;_0x471206<_0x318887[_0xef61('0x3e')][_0xef61('0x5d')][_0xef61('0x45')];_0x471206+=0x1){var _0x223514={'UserId':Number(_0x318887[_0xef61('0x4f')]['id'])};_0x223514[_[_0xef61('0xb1')](_0x318887[_0xef61('0x3e')][_0xef61('0x9c')][_0xef61('0xa4')]())+_0xef61('0xa7')]=Number(_0x318887['query'][_0xef61('0x5d')][_0x471206]);socket['emit']('user'+_['capitalize'](_0x318887['query'][_0xef61('0x9c')][_0xef61('0xa4')]())+_0xef61('0xb2'),_0x223514);}}else{var _0x223514={'UserId':Number(_0x318887[_0xef61('0x4f')]['id'])};_0x223514[_['capitalize'](_0x318887['query'][_0xef61('0x9c')]['toLowerCase']())+_0xef61('0xa7')]=Number(_0x318887[_0xef61('0x3e')][_0xef61('0x5d')]);socket['emit'](_0xef61('0x2b')+_[_0xef61('0xb1')](_0x318887[_0xef61('0x3e')][_0xef61('0x9c')][_0xef61('0xa4')]())+_0xef61('0xb2'),_0x223514);}return _0x23a826;})['then'](function(){if(_0x318887[_0xef61('0x3e')][_0xef61('0x9c')]===_0xef61('0xab')){return db[_0xef61('0xb3')]['destroy']({'where':{'UserId':_0x318887['params']['id'],'VoiceQueueId':_0x318887[_0xef61('0x3e')][_0xef61('0x5d')]},'individualHooks':!![]})[_0xef61('0x16')](function(){return _0x4216f8;});}return _0x4216f8;})['then'](respondWithStatusCode(_0x3f77d1,null))[_0xef61('0x1f')](handleError(_0x3f77d1,null));};exports[_0xef61('0xb4')]=function(_0x527c04,_0x3a40e9){_0x527c04[_0xef61('0x5a')]['userpic']=_0x527c04[_0xef61('0xb5')][_0xef61('0xb6')];return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x527c04[_0xef61('0x4f')]['id']}})[_0xef61('0x16')](handleEntityNotFound(_0x3a40e9,null))[_0xef61('0x16')](saveUpdates(_0x527c04['body'],null))[_0xef61('0x16')](respondWithResult(_0x3a40e9,null))[_0xef61('0x1f')](handleError(_0x3a40e9,null));};exports['getAvatar']=function(_0xf43ed,_0x50ca36){var _0x38e790=path[_0xef61('0xb7')](config[_0xef61('0xb8')],_0xef61('0xb9'));return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0xf43ed[_0xef61('0x4f')]['id']},'attributes':['id',_0xef61('0xba')],'raw':!![]})['then'](handleEntityNotFound(_0x50ca36,null))[_0xef61('0x16')](function(_0x392cb9){if(_0x392cb9){if(_['isNil'](_0x392cb9[_0xef61('0xba')])){return _0x50ca36[_0xef61('0xbb')](_0x38e790);}else{if(!fs[_0xef61('0xbc')](path['join'](config[_0xef61('0xb8')],_0xef61('0xbd'),_0x392cb9['userpic']))){return _0x50ca36[_0xef61('0xbb')](_0x38e790);}return _0x50ca36['download'](path['join'](config[_0xef61('0xb8')],'server/files/images/',_0x392cb9[_0xef61('0xba')]));}}})[_0xef61('0x1f')](handleError(_0x50ca36,null));};exports[_0xef61('0xbe')]=function(_0x3bf8a9,_0x227940){return db[_0xef61('0x3d')][_0xef61('0x32')]({'where':{'id':_0x3bf8a9[_0xef61('0x4f')]['id']},'attributes':['id']})[_0xef61('0x16')](handleEntityNotFound(_0x227940,null))[_0xef61('0x16')](function(_0x2998f1){var _0x57fa3e=[];values=_0x2998f1[_0xef61('0x47')];_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x46'),_0x2998f1[_0xef61('0x47')]));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x48'),_0x2998f1[_0xef61('0x47')]));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x4b'),_0x2998f1['dataValues']));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x4c'),_0x2998f1[_0xef61('0x47')]));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x49'),_0x2998f1[_0xef61('0x47')]));_0x57fa3e[_0xef61('0x40')](get_open_tabs(_0xef61('0x4a'),_0x2998f1[_0xef61('0x47')]));return BPromise[_0xef61('0x4d')](_0x57fa3e);})['then'](function(_0x54bad6){var _0x4fb086=[];if(_0x54bad6){for(var _0x432f67=0x0;_0x432f67=_0x7d1f25[_0xa385('0x50')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xa385('0xf')](function(){if(_0x245168){return db[_0xa385('0x28')][_0xa385('0x47')]({'where':{'membername':_0x245168[_0xa385('0x26')]},'individualHooks':!![]});}})[_0xa385('0xf')](function(){if(_0x245168){return _0x245168[_0xa385('0x51')]({'raw':!![]});}})[_0xa385('0xf')](function(_0x4f51c8){if(_0x245168){if(_0x4f51c8){var _0x10b915=[];_0x5b13aa=_0x4f51c8;if(_0x5b13aa[_0xa385('0x2d')]){for(var _0x282832=0x0;_0x282832<_0x5b13aa[_0xa385('0x2d')];_0x282832++){_0x10b915['push'](db['UserVoiceQueueRt'][_0xa385('0x52')]({'membername':_0x245168[_0xa385('0x26')],'UserId':_0x245168['id'],'queue_name':_0x5b13aa[_0x282832][_0xa385('0x26')],'VoiceQueueId':_0x5b13aa[_0x282832]['id'],'interface':_0x17c5b2,'paused':_0x245168[_0xa385('0x4c')]||![],'penalty':_0x5b13aa[_0x282832][_0xa385('0x53')]||0x0}));}return BPromise['all'](_0x10b915);}}}})[_0xa385('0xf')](function(){if(_0x245168){return db[_0xa385('0x2a')][_0xa385('0x48')]({'where':{'membername':_0x245168['name'],'exitAt':null}});}})[_0xa385('0xf')](function(_0x2129a0){if(_0x245168){if(_0x2129a0&&_0x2129a0[_0xa385('0x2d')]){var _0x30c553=[];_0x2129a0[_0xa385('0x54')](function(_0x4b38f0){_0x30c553[_0xa385('0x30')](_0x4b38f0[_0xa385('0x29')]({'exitAt':moment()['format'](_0xa385('0x2c'))}));});return BPromise[_0xa385('0x45')](_0x30c553);}}})[_0xa385('0xf')](function(_0x4e91b9){if(_0x245168){var _0x3b0f1f=[];var _0x1dfa5c=[];var _0x86351f=utils[_0xa385('0x2f')]();var _0x1ce061={'membername':_0x245168['name'],'interface':_0x17c5b2,'enterAt':moment()[_0xa385('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x245168[_0xa385('0x35')],'internal':_0x245168[_0xa385('0x4b')]};_0x86351f[_0xa385('0x54')](function(_0x4553c1){_0x3b0f1f['push'](_[_0xa385('0x55')]({'channel':_0x4553c1,'type':_0xa385('0x56'),'data1':'callysquare','data2':_0x17c5b2},_0x1ce061));if(_0x245168[_0xa385('0x4c')]){_0x1dfa5c[_0xa385('0x30')](_['merge']({'channel':_0x4553c1,'type':_0xa385('0x2b'),'data1':'LOGININPAUSE'},_0x1ce061));}});return db['MemberReport'][_0xa385('0x37')](_0x3b0f1f[_0xa385('0x57')](_0x1dfa5c),{'individualHooks':!![]});}})[_0xa385('0xf')](function(){if(_0x245168){return _0x245168[_0xa385('0x29')]({'online':!![],'lastLoginAt':moment()[_0xa385('0x31')](_0xa385('0x2c')),'voicePause':_0x245168[_0xa385('0x4c')]||![],'mailPause':_0x245168[_0xa385('0x4c')]||![],'chatPause':_0x245168[_0xa385('0x4c')]||![],'faxPause':_0x245168['loginInPause']||![],'smsPause':_0x245168[_0xa385('0x4c')]||![],'openchannelPause':_0x245168[_0xa385('0x4c')]||![],'pauseType':_0x245168['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0xa385('0x2c')),'interface':_0x17c5b2});}})[_0xa385('0xf')](function(_0x2c9d8a){_0x2f1248(_0x2c9d8a);})['catch'](function(_0x1f696c){_0x302ef3(_0x39e5fb['error'](0x1f4,_0x1f696c[_0xa385('0x16')]));});});}; \ No newline at end of file +var _0x8afc=['chat','fax','sms','openchannel','set','%s%s','all','LogoutUser','destroy','length','forEach','mobile','loginInPause','agent','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./user.socket','register','then','info','User,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','User','findAll','options','where','attributes','limit','include','map','model','GetUser','stringify','ShowUser','raw','PauseUser','name','role','internal','interface','update','MemberReport','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','push','SIP/%s','type','DEFAULT\x20PAUSE','body','uniqueid','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','find','system','mail'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x8afc,0x72));var _0xc8af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8afc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8af('0x0'));var util=require(_0xc8af('0x1'));var moment=require(_0xc8af('0x2'));var BPromise=require(_0xc8af('0x3'));var rs=require(_0xc8af('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc8af('0x5'))['db'];var utils=require(_0xc8af('0x6'));var logger=require(_0xc8af('0x7'))(_0xc8af('0x8'));var config=require(_0xc8af('0x9'));var jayson=require(_0xc8af('0xa'));var client=jayson[_0xc8af('0xb')][_0xc8af('0xc')]({'port':0x232a});config[_0xc8af('0xd')]=_['defaults'](config['redis'],{'host':_0xc8af('0xe'),'port':0x18eb});var socket=require(_0xc8af('0xf'))(new Redis(config[_0xc8af('0xd')]));require(_0xc8af('0x10'))[_0xc8af('0x11')](socket);function respondWithRpcPromise(_0x4388dc,_0x2549ab,_0x317f1a){return new BPromise(function(_0x4d7c03,_0x18f145){return client['request'](_0x4388dc,_0x317f1a)[_0xc8af('0x12')](function(_0x208d78){logger[_0xc8af('0x13')](_0xc8af('0x14'),_0x2549ab,'request\x20sent');logger[_0xc8af('0x15')]('User,\x20%s,\x20%s,\x20%s',_0x2549ab,_0xc8af('0x16'),JSON['stringify'](_0x208d78));if(_0x208d78['error']){if(_0x208d78[_0xc8af('0x17')][_0xc8af('0x18')]===0x1f4){logger[_0xc8af('0x17')](_0xc8af('0x14'),_0x2549ab,_0x208d78[_0xc8af('0x17')][_0xc8af('0x19')]);return _0x18f145(_0x208d78['error']['message']);}logger['error'](_0xc8af('0x14'),_0x2549ab,_0x208d78[_0xc8af('0x17')][_0xc8af('0x19')]);return _0x4d7c03(_0x208d78[_0xc8af('0x17')]['message']);}else{logger[_0xc8af('0x13')](_0xc8af('0x14'),_0x2549ab,_0xc8af('0x16'));_0x4d7c03(_0x208d78[_0xc8af('0x1a')][_0xc8af('0x19')]);}})[_0xc8af('0x1b')](function(_0x4c7db9){logger[_0xc8af('0x17')](_0xc8af('0x14'),_0x2549ab,_0x4c7db9);_0x18f145(_0x4c7db9);});});}exports['GetUser']=function(_0x134a2c){var _0x33f61b=this;return new Promise(function(_0x25be29,_0x3a2934){return db[_0xc8af('0x1c')][_0xc8af('0x1d')]({'raw':_0x134a2c[_0xc8af('0x1e')]?_0x134a2c['options']['raw']===undefined?!![]:![]:!![],'where':_0x134a2c[_0xc8af('0x1e')]?_0x134a2c['options'][_0xc8af('0x1f')]||null:null,'attributes':_0x134a2c[_0xc8af('0x1e')]?_0x134a2c[_0xc8af('0x1e')][_0xc8af('0x20')]||null:null,'limit':_0x134a2c[_0xc8af('0x1e')]?_0x134a2c[_0xc8af('0x1e')][_0xc8af('0x21')]||null:null,'include':_0x134a2c[_0xc8af('0x1e')]?_0x134a2c[_0xc8af('0x1e')][_0xc8af('0x22')]?_[_0xc8af('0x23')](_0x134a2c[_0xc8af('0x1e')][_0xc8af('0x22')],function(_0x33439a){return{'model':db[_0x33439a['model']],'as':_0x33439a['as'],'attributes':_0x33439a['attributes'],'include':_0x33439a['include']?_[_0xc8af('0x23')](_0x33439a[_0xc8af('0x22')],function(_0x5596cd){return{'model':db[_0x5596cd[_0xc8af('0x24')]],'as':_0x5596cd['as'],'attributes':_0x5596cd[_0xc8af('0x20')],'include':_0x5596cd[_0xc8af('0x22')]?_['map'](_0x5596cd['include'],function(_0x295e82){return{'model':db[_0x295e82['model']],'as':_0x295e82['as'],'attributes':_0x295e82['attributes']};}):[]};}):[]};}):[]:[]})[_0xc8af('0x12')](function(_0x2b747e){logger[_0xc8af('0x13')](_0xc8af('0x25'),_0x134a2c);logger[_0xc8af('0x15')](_0xc8af('0x25'),_0x134a2c,JSON[_0xc8af('0x26')](_0x2b747e));_0x25be29(_0x2b747e);})['catch'](function(_0x532128){logger[_0xc8af('0x17')]('GetUser',_0x532128[_0xc8af('0x19')],_0x134a2c);_0x3a2934(_0x33f61b[_0xc8af('0x17')](0x1f4,_0x532128[_0xc8af('0x19')]));});});};exports[_0xc8af('0x27')]=function(_0xb27364){var _0x26ab12=this;return new Promise(function(_0x4521ca,_0x557905){return db['User']['find']({'raw':_0xb27364[_0xc8af('0x1e')]?_0xb27364['options'][_0xc8af('0x28')]===undefined?!![]:![]:!![],'where':_0xb27364[_0xc8af('0x1e')]?_0xb27364['options'][_0xc8af('0x1f')]||null:null,'attributes':_0xb27364[_0xc8af('0x1e')]?_0xb27364['options']['attributes']||null:null,'include':_0xb27364[_0xc8af('0x1e')]?_0xb27364[_0xc8af('0x1e')]['include']?_[_0xc8af('0x23')](_0xb27364[_0xc8af('0x1e')]['include'],function(_0x4ba0dc){return{'model':db[_0x4ba0dc['model']],'as':_0x4ba0dc['as'],'attributes':_0x4ba0dc['attributes'],'include':_0x4ba0dc[_0xc8af('0x22')]?_[_0xc8af('0x23')](_0x4ba0dc[_0xc8af('0x22')],function(_0x4f4ce0){return{'model':db[_0x4f4ce0['model']],'as':_0x4f4ce0['as'],'attributes':_0x4f4ce0[_0xc8af('0x20')],'include':_0x4f4ce0['include']?_[_0xc8af('0x23')](_0x4f4ce0[_0xc8af('0x22')],function(_0x4410a5){return{'model':db[_0x4410a5[_0xc8af('0x24')]],'as':_0x4410a5['as'],'attributes':_0x4410a5[_0xc8af('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc8af('0x12')](function(_0x5c0a16){logger[_0xc8af('0x13')](_0xc8af('0x27'),_0xb27364);logger['debug'](_0xc8af('0x27'),_0xb27364,JSON[_0xc8af('0x26')](_0x5c0a16));_0x4521ca(_0x5c0a16);})[_0xc8af('0x1b')](function(_0x28c346){logger[_0xc8af('0x17')](_0xc8af('0x27'),_0x28c346[_0xc8af('0x19')],_0xb27364);_0x557905(_0x26ab12[_0xc8af('0x17')](0x1f4,_0x28c346['message']));});});};exports[_0xc8af('0x29')]=function(_0x3e2e07){var _0x17f03d=this;return new Promise(function(_0x418d86,_0x575868){var _0x23cc34;return db['User']['find']({'where':_0x3e2e07['options'][_0xc8af('0x1f')]||{},'attributes':['id',_0xc8af('0x2a'),_0xc8af('0x2b'),_0xc8af('0x2c'),_0xc8af('0x2d')]})[_0xc8af('0x12')](function(_0x127717){if(_0x127717){_0x23cc34=_0x127717;return db['UserVoiceQueueRt'][_0xc8af('0x2e')]({'paused':0x1},{'where':{'UserId':_0x23cc34['id']},'individualHooks':!![]});}})['then'](function(){if(_0x23cc34){return db[_0xc8af('0x2f')][_0xc8af('0x1d')]({'where':{'membername':_0x23cc34[_0xc8af('0x2a')],'type':_0xc8af('0x30'),'exitAt':null}});}})[_0xc8af('0x12')](function(_0x448909){if(_0x23cc34){if(_0x448909&&_0x448909['length']){var _0x45aeba=moment()[_0xc8af('0x31')](_0xc8af('0x32'));for(var _0x57d8e1=0x0,_0x41bb1f=_0x448909['length'];_0x57d8e1<_0x41bb1f;_0x57d8e1++){_0x448909[_0x57d8e1][_0xc8af('0x33')]({'exitAt':_0x45aeba});}}}})[_0xc8af('0x12')](function(){if(_0x23cc34){var _0xad7129=[];var _0x2bae8d=utils[_0xc8af('0x34')]();_0x2bae8d['forEach'](function(_0x197551){_0xad7129[_0xc8af('0x35')]({'channel':_0x197551,'membername':_0x23cc34[_0xc8af('0x2a')],'interface':_['isNil'](_0x23cc34[_0xc8af('0x2d')])?util[_0xc8af('0x31')](_0xc8af('0x36'),_0x23cc34[_0xc8af('0x2a')]):_0x23cc34['interface'],'type':'PAUSE','enterAt':moment()[_0xc8af('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x3e2e07['body'][_0xc8af('0x37')]||_0xc8af('0x38'),'role':_0x23cc34[_0xc8af('0x2b')],'internal':_0x23cc34[_0xc8af('0x2c')],'uniqueid':_0x3e2e07[_0xc8af('0x39')][_0xc8af('0x3a')]||null});});return db[_0xc8af('0x2f')][_0xc8af('0x3b')](_0xad7129,{'individualHooks':!![]});}})[_0xc8af('0x12')](function(){if(_0x23cc34){return _0x23cc34['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3e2e07[_0xc8af('0x39')]['type']||_0xc8af('0x38'),'lastPauseAt':moment()[_0xc8af('0x31')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xc8af('0x12')](function(_0x5ec234){_0x418d86(_0x5ec234);})[_0xc8af('0x1b')](function(_0x2b926f){_0x575868(_0x17f03d['error'](0x1f4,_0x2b926f[_0xc8af('0x19')]));});});};exports[_0xc8af('0x3c')]=function(_0x24b9f0){var _0x473e50=this;return new Promise(function(_0x48856d,_0x265ee1){var _0x3c8871;return db['User'][_0xc8af('0x3d')]({'where':_0x24b9f0['options'][_0xc8af('0x1f')]||{},'attributes':['id','name']})[_0xc8af('0x12')](function(_0x4dcaea){if(_0x4dcaea){_0x3c8871=_0x4dcaea;if(_0x24b9f0[_0xc8af('0x39')][_0xc8af('0x3e')]&&!utils[_0xc8af('0x3f')](_0x24b9f0[_0xc8af('0x39')]['channel'])){throw new Error(_0xc8af('0x40'));}switch(_0x24b9f0[_0xc8af('0x39')][_0xc8af('0x3e')]){case _0xc8af('0x41'):return db[_0xc8af('0x42')]['update']({'paused':0x0},{'where':{'UserId':_0x3c8871['id']}})[_0xc8af('0x12')](function(){return db[_0xc8af('0x2f')][_0xc8af('0x43')]({'where':{'channel':_0x24b9f0[_0xc8af('0x39')][_0xc8af('0x3e')],'membername':_0x3c8871[_0xc8af('0x2a')],'type':_0xc8af('0x30'),'exitAt':null}});})[_0xc8af('0x12')](function(_0x417d85){if(_0x417d85){return _0x417d85[_0xc8af('0x2e')]({'exitAt':moment()[_0xc8af('0x31')](_0xc8af('0x32')),'data2':_0xc8af('0x44')},{'individualHooks':!![]});}return null;})[_0xc8af('0x12')](function(){return _0x3c8871[_0xc8af('0x2e')]({'voicePause':![]});});case _0xc8af('0x45'):case _0xc8af('0x46'):case _0xc8af('0x47'):case _0xc8af('0x48'):case _0xc8af('0x49'):case'whatsapp':return db[_0xc8af('0x2f')]['find']({'where':{'channel':_0x24b9f0['body'][_0xc8af('0x3e')],'membername':_0x3c8871[_0xc8af('0x2a')],'type':'PAUSE','exitAt':null}})['then'](function(_0x532869){return _0x532869[_0xc8af('0x2e')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});})[_0xc8af('0x12')](function(){var _0x142ef4={};_[_0xc8af('0x4a')](_0x142ef4,util[_0xc8af('0x31')](_0xc8af('0x4b'),_0x24b9f0[_0xc8af('0x39')]['channel'],'Pause'),![]);return _0x3c8871[_0xc8af('0x2e')](_0x142ef4);});default:return db['UserVoiceQueueRt'][_0xc8af('0x2e')]({'paused':0x0},{'where':{'UserId':_0x3c8871['id']}})['then'](function(){return db[_0xc8af('0x2f')][_0xc8af('0x1d')]({'where':{'membername':_0x3c8871[_0xc8af('0x2a')],'type':_0xc8af('0x30'),'exitAt':null}});})[_0xc8af('0x12')](function(_0x2e57d2){var _0x2509e1=[];_0x2e57d2['forEach'](function(_0x2334d4){_0x2509e1['push'](_0x2334d4[_0xc8af('0x2e')]({'exitAt':moment()['format'](_0xc8af('0x32')),'data2':_0xc8af('0x44')}));});return BPromise[_0xc8af('0x4c')](_0x2509e1);})[_0xc8af('0x12')](function(){return _0x3c8871[_0xc8af('0x2e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xc8af('0x12')](function(_0x1ce0f1){_0x48856d(_0x1ce0f1);})[_0xc8af('0x1b')](function(_0x1459a3){_0x265ee1(_0x473e50['error'](0x1f4,_0x1459a3[_0xc8af('0x19')]));});});};exports[_0xc8af('0x4d')]=function(_0x504fbb){var _0x1f675b=this;return new Promise(function(_0x1bb2b4,_0x114511){var _0x4a2367;return db[_0xc8af('0x1c')][_0xc8af('0x3d')]({'where':_0x504fbb[_0xc8af('0x1e')][_0xc8af('0x1f')]||{},'attributes':['id',_0xc8af('0x2a')]})[_0xc8af('0x12')](function(_0x4bae9a){if(_0x4bae9a){_0x4a2367=_0x4bae9a;return db[_0xc8af('0x42')][_0xc8af('0x4e')]({'where':{'membername':_0x4a2367['name']},'individualHooks':!![]});}})[_0xc8af('0x12')](function(){if(_0x4a2367){return db[_0xc8af('0x2f')]['findAll']({'where':{'membername':_0x4a2367['name'],'exitAt':null}});}})[_0xc8af('0x12')](function(_0x544091){if(_0x4a2367){if(_0x544091&&_0x544091[_0xc8af('0x4f')]){var _0x47dff6=[];_0x544091[_0xc8af('0x50')](function(_0x218b75){_0x47dff6['push'](_0x218b75[_0xc8af('0x2e')]({'exitAt':moment()['format'](_0xc8af('0x32'))}));});return BPromise['all'](_0x47dff6);}}})[_0xc8af('0x12')](function(){if(_0x4a2367){return _0x4a2367[_0xc8af('0x2e')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xc8af('0x12')](function(_0x23d007){_0x1bb2b4(_0x23d007);})['catch'](function(_0xc2566d){_0x114511(_0x1f675b[_0xc8af('0x17')](0x1f4,_0xc2566d[_0xc8af('0x19')]));});});};exports['LoginUser']=function(_0x50feb4){var _0x57f814=this;return new Promise(function(_0x4e0505,_0xb86d04){var _0x216ab2;var _0x2d4341;var _0x5d8e59;var _0x45793f;return db[_0xc8af('0x1c')][_0xc8af('0x3d')]({'where':_0x50feb4[_0xc8af('0x1e')]['where']||{},'attributes':['id',_0xc8af('0x2a'),'role',_0xc8af('0x51'),'phone',_0xc8af('0x2c'),_0xc8af('0x52'),_0xc8af('0x2d')]})['then'](function(_0x282f06){if(_0x282f06){_0x216ab2=_0x282f06;_0x45793f=_0x50feb4[_0xc8af('0x39')][_0xc8af('0x2d')]?_0x50feb4[_0xc8af('0x39')][_0xc8af('0x2d')]:util[_0xc8af('0x31')](_0xc8af('0x36'),_0x216ab2[_0xc8af('0x2a')]);return db['User']['count']({'where':{'role':_0xc8af('0x53'),'online':!![],'id':{'$ne':_0x216ab2['id']}}});}})[_0xc8af('0x12')](function(_0x1da8b9){if(_0x1da8b9){_0x5d8e59=_0x1da8b9;return require('../../config/license/util')['getLicense']();}})[_0xc8af('0x12')](function(_0x4971b7){if(_0x4971b7&&_0x4971b7[_0xc8af('0x54')]&&_0x5d8e59>=_0x4971b7[_0xc8af('0x54')]){throw new Error(_0xc8af('0x55'));}})[_0xc8af('0x12')](function(){if(_0x216ab2){return db[_0xc8af('0x42')][_0xc8af('0x4e')]({'where':{'membername':_0x216ab2[_0xc8af('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x216ab2){return _0x216ab2['getVoiceQueues']({'raw':!![]});}})[_0xc8af('0x12')](function(_0x16fed5){if(_0x216ab2){if(_0x16fed5){var _0x15ee79=[];_0x2d4341=_0x16fed5;if(_0x2d4341[_0xc8af('0x4f')]){for(var _0x40282a=0x0;_0x40282a<_0x2d4341[_0xc8af('0x4f')];_0x40282a++){_0x15ee79[_0xc8af('0x35')](db[_0xc8af('0x42')][_0xc8af('0x56')]({'membername':_0x216ab2[_0xc8af('0x2a')],'UserId':_0x216ab2['id'],'queue_name':_0x2d4341[_0x40282a][_0xc8af('0x2a')],'VoiceQueueId':_0x2d4341[_0x40282a]['id'],'interface':_0x45793f,'paused':_0x216ab2['loginInPause']||![],'penalty':_0x2d4341[_0x40282a][_0xc8af('0x57')]||0x0}));}return BPromise['all'](_0x15ee79);}}}})[_0xc8af('0x12')](function(){if(_0x216ab2){return db[_0xc8af('0x2f')][_0xc8af('0x1d')]({'where':{'membername':_0x216ab2['name'],'exitAt':null}});}})['then'](function(_0x17e0e1){if(_0x216ab2){if(_0x17e0e1&&_0x17e0e1[_0xc8af('0x4f')]){var _0x2f5a70=[];_0x17e0e1[_0xc8af('0x50')](function(_0x4c07a4){_0x2f5a70[_0xc8af('0x35')](_0x4c07a4[_0xc8af('0x2e')]({'exitAt':moment()['format'](_0xc8af('0x32'))}));});return BPromise[_0xc8af('0x4c')](_0x2f5a70);}}})[_0xc8af('0x12')](function(_0x57bd11){if(_0x216ab2){var _0x4fcd56=[];var _0x431f2f=[];var _0x5492d9=utils[_0xc8af('0x34')]();var _0x423e92={'membername':_0x216ab2[_0xc8af('0x2a')],'interface':_0x45793f,'enterAt':moment()[_0xc8af('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x216ab2[_0xc8af('0x2b')],'internal':_0x216ab2[_0xc8af('0x2c')]};_0x5492d9['forEach'](function(_0x9b6b48){_0x4fcd56[_0xc8af('0x35')](_[_0xc8af('0x58')]({'channel':_0x9b6b48,'type':_0xc8af('0x59'),'data1':_0xc8af('0x5a'),'data2':_0x45793f},_0x423e92));if(_0x216ab2[_0xc8af('0x52')]){_0x431f2f[_0xc8af('0x35')](_['merge']({'channel':_0x9b6b48,'type':_0xc8af('0x30'),'data1':_0xc8af('0x5b')},_0x423e92));}});return db[_0xc8af('0x2f')]['bulkCreate'](_0x4fcd56['concat'](_0x431f2f),{'individualHooks':!![]});}})[_0xc8af('0x12')](function(){if(_0x216ab2){return _0x216ab2[_0xc8af('0x2e')]({'online':!![],'lastLoginAt':moment()[_0xc8af('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x216ab2[_0xc8af('0x52')]||![],'mailPause':_0x216ab2[_0xc8af('0x52')]||![],'chatPause':_0x216ab2[_0xc8af('0x52')]||![],'faxPause':_0x216ab2['loginInPause']||![],'smsPause':_0x216ab2[_0xc8af('0x52')]||![],'openchannelPause':_0x216ab2['loginInPause']||![],'pauseType':_0x216ab2[_0xc8af('0x52')]?_0xc8af('0x5b'):null,'lastPauseAt':moment()[_0xc8af('0x31')](_0xc8af('0x32')),'interface':_0x45793f});}})[_0xc8af('0x12')](function(_0x471622){_0x4e0505(_0x471622);})[_0xc8af('0x1b')](function(_0x525142){_0xb86d04(_0x57f814['error'](0x1f4,_0x525142[_0xc8af('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index b1fabe2..1505522 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 _0x2460=['./user.events','save','remove','emit','removeListener','register','user:'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x2460,0x70));var _0x0246=function(_0x3b8fce,_0x25cec2){_0x3b8fce=_0x3b8fce-0x0;var _0x117581=_0x2460[_0x3b8fce];return _0x117581;};'use strict';var UserEvents=require(_0x0246('0x0'));var events=[_0x0246('0x1'),_0x0246('0x2'),'update'];function createListener(_0x5d3db8,_0x53640b){return function(_0x5d4458){_0x53640b[_0x0246('0x3')](_0x5d3db8,_0x5d4458);};}function removeListener(_0x1eb207,_0x436693){return function(){UserEvents[_0x0246('0x4')](_0x1eb207,_0x436693);};}exports[_0x0246('0x5')]=function(_0x2f95e0){for(var _0x34ed18=0x0,_0x2dfba9=events['length'];_0x34ed18<_0x2dfba9;_0x34ed18++){var _0x4a923c=events[_0x34ed18];var _0x226260=createListener(_0x0246('0x6')+_0x4a923c,_0x2f95e0);UserEvents['on'](_0x4a923c,_0x226260);}}; \ No newline at end of file +var _0xddee=['save','update','emit','removeListener','register','length','user:'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xddee,0x1ce));var _0xedde=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0xddee[_0x6e1239];return _0x418150;};'use strict';var UserEvents=require('./user.events');var events=[_0xedde('0x0'),'remove',_0xedde('0x1')];function createListener(_0x1967f2,_0x2abd67){return function(_0x4849aa){_0x2abd67[_0xedde('0x2')](_0x1967f2,_0x4849aa);};}function removeListener(_0x4d6337,_0x519aa4){return function(){UserEvents[_0xedde('0x3')](_0x4d6337,_0x519aa4);};}exports[_0xedde('0x4')]=function(_0x3c7bd4){for(var _0x25a7f3=0x0,_0x10af38=events[_0xedde('0x5')];_0x25a7f3<_0x10af38;_0x25a7f3++){var _0x3b4842=events[_0x25a7f3];var _0x59ad55=createListener(_0xedde('0x6')+_0x3b4842,_0x3c7bd4);UserEvents['on'](_0x3b4842,_0x59ad55);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 6f45e49..eec807c 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(_0x1b764c,_0x5807d1){var _0xc2addd=function(_0x48a531){while(--_0x48a531){_0x1b764c['push'](_0x1b764c['shift']());}};_0xc2addd(++_0x5807d1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xcb91[_0x4c440b];return _0x2d48cf;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x240972,_0x24fc0d){var _0x168add=function(_0x399cbb){while(--_0x399cbb){_0x240972['push'](_0x240972['shift']());}};_0x168add(++_0x24fc0d);}(_0xedd9,0xfc));var _0x9edd=function(_0x3c1d5b,_0xecd477){_0x3c1d5b=_0x3c1d5b-0x0;var _0x249fff=_0xedd9[_0x3c1d5b];return _0x249fff;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 46313e9..df56c91 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 _0xf55e=['exports','INTEGER','sequelize'];(function(_0x40f6ea,_0x4576a2){var _0x5a2af5=function(_0x317cd9){while(--_0x317cd9){_0x40f6ea['push'](_0x40f6ea['shift']());}};_0x5a2af5(++_0x4576a2);}(_0xf55e,0x13d));var _0xef55=function(_0x18df7c,_0x2eaf1d){_0x18df7c=_0x18df7c-0x0;var _0x5c9da2=_0xf55e[_0x18df7c];return _0x5c9da2;};'use strict';var Sequelize=require(_0xef55('0x0'));module[_0xef55('0x1')]={'penalty':{'type':Sequelize[_0xef55('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x05e4=['exports','sequelize'];(function(_0x380575,_0xc72d46){var _0x15080a=function(_0x5f1ac5){while(--_0x5f1ac5){_0x380575['push'](_0x380575['shift']());}};_0x15080a(++_0xc72d46);}(_0x05e4,0x173));var _0x405e=function(_0x4caed6,_0x2cfe99){_0x4caed6=_0x4caed6-0x0;var _0x13f9f8=_0x05e4[_0x4caed6];return _0x13f9f8;};'use strict';var Sequelize=require(_0x405e('0x0'));module[_0x405e('0x1')]={'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 1c01969..39122e3 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 _0xdcb6=['bluebird','path','rimraf','./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','lodash','util','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdcb6,0x188));var _0x6dcb=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xdcb6[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x6dcb('0x0'));var util=require(_0x6dcb('0x1'));var logger=require('../../config/logger')(_0x6dcb('0x2'));var moment=require(_0x6dcb('0x3'));var BPromise=require(_0x6dcb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6dcb('0x5'));var rimraf=require(_0x6dcb('0x6'));var config=require('../../config/environment');var attributes=require(_0x6dcb('0x7'));module[_0x6dcb('0x8')]=function(_0x3761e9,_0x13133b){return _0x3761e9['define'](_0x6dcb('0x9'),attributes,{'tableName':_0x6dcb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61b2=['define','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userChatQueue.attributes','exports'];(function(_0x4c5ed3,_0x5e5b5c){var _0x368903=function(_0x3602aa){while(--_0x3602aa){_0x4c5ed3['push'](_0x4c5ed3['shift']());}};_0x368903(++_0x5e5b5c);}(_0x61b2,0x86));var _0x261b=function(_0x5a27fd,_0x210341){_0x5a27fd=_0x5a27fd-0x0;var _0x1e2fff=_0x61b2[_0x5a27fd];return _0x1e2fff;};'use strict';var _=require('lodash');var util=require(_0x261b('0x0'));var logger=require(_0x261b('0x1'))(_0x261b('0x2'));var moment=require(_0x261b('0x3'));var BPromise=require(_0x261b('0x4'));var rp=require(_0x261b('0x5'));var fs=require('fs');var path=require(_0x261b('0x6'));var rimraf=require(_0x261b('0x7'));var config=require('../../config/environment');var attributes=require(_0x261b('0x8'));module[_0x261b('0x9')]=function(_0xedd744,_0x2084fd){return _0xedd744[_0x261b('0xa')]('UserChatQueue',attributes,{'tableName':_0x261b('0xb'),'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 d4e584e..6c736b9 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 _0x4d4d=['error','code','UserChatQueue,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x55c52c,_0x3c00b9){var _0x379008=function(_0x55484b){while(--_0x55484b){_0x55c52c['push'](_0x55c52c['shift']());}};_0x379008(++_0x3c00b9);}(_0x4d4d,0x17f));var _0xd4d4=function(_0x66ab89,_0x49d105){_0x66ab89=_0x66ab89-0x0;var _0x5cf7d4=_0x4d4d[_0x66ab89];return _0x5cf7d4;};'use strict';var _=require(_0xd4d4('0x0'));var util=require('util');var moment=require(_0xd4d4('0x1'));var BPromise=require(_0xd4d4('0x2'));var rs=require(_0xd4d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4d4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd4d4('0x5'))(_0xd4d4('0x6'));var config=require('../../config/environment');var jayson=require(_0xd4d4('0x7'));var client=jayson[_0xd4d4('0x8')][_0xd4d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb493b4,_0x205bce,_0x3cda8e){return new BPromise(function(_0x2c57b8,_0x1574df){return client[_0xd4d4('0xa')](_0xb493b4,_0x3cda8e)[_0xd4d4('0xb')](function(_0x336a50){logger[_0xd4d4('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x205bce,_0xd4d4('0xd'));logger[_0xd4d4('0xe')](_0xd4d4('0xf'),_0x205bce,'request\x20sent',JSON['stringify'](_0x336a50));if(_0x336a50[_0xd4d4('0x10')]){if(_0x336a50[_0xd4d4('0x10')][_0xd4d4('0x11')]===0x1f4){logger[_0xd4d4('0x10')](_0xd4d4('0x12'),_0x205bce,_0x336a50[_0xd4d4('0x10')][_0xd4d4('0x13')]);return _0x1574df(_0x336a50[_0xd4d4('0x10')][_0xd4d4('0x13')]);}logger[_0xd4d4('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x205bce,_0x336a50[_0xd4d4('0x10')][_0xd4d4('0x13')]);return _0x2c57b8(_0x336a50[_0xd4d4('0x10')]['message']);}else{logger[_0xd4d4('0xc')](_0xd4d4('0x12'),_0x205bce,_0xd4d4('0xd'));_0x2c57b8(_0x336a50['result']['message']);}})[_0xd4d4('0x14')](function(_0x557512){logger[_0xd4d4('0x10')](_0xd4d4('0x12'),_0x205bce,_0x557512);_0x1574df(_0x557512);});});} \ No newline at end of file +var _0x8a97=['info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0x8a97,0x1c3));var _0x78a9=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x8a97[_0x2ec461];return _0x28603d;};'use strict';var _=require('lodash');var util=require(_0x78a9('0x0'));var moment=require(_0x78a9('0x1'));var BPromise=require(_0x78a9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78a9('0x3'));var db=require(_0x78a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x78a9('0x5'))(_0x78a9('0x6'));var config=require(_0x78a9('0x7'));var jayson=require(_0x78a9('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a0534,_0x1da317,_0x30b089){return new BPromise(function(_0x54cdef,_0x68fd3e){return client[_0x78a9('0x9')](_0x4a0534,_0x30b089)[_0x78a9('0xa')](function(_0x36f88f){logger[_0x78a9('0xb')](_0x78a9('0xc'),_0x1da317,'request\x20sent');logger[_0x78a9('0xd')](_0x78a9('0xe'),_0x1da317,_0x78a9('0xf'),JSON[_0x78a9('0x10')](_0x36f88f));if(_0x36f88f[_0x78a9('0x11')]){if(_0x36f88f['error'][_0x78a9('0x12')]===0x1f4){logger[_0x78a9('0x11')](_0x78a9('0xc'),_0x1da317,_0x36f88f[_0x78a9('0x11')][_0x78a9('0x13')]);return _0x68fd3e(_0x36f88f[_0x78a9('0x11')][_0x78a9('0x13')]);}logger['error'](_0x78a9('0xc'),_0x1da317,_0x36f88f['error'][_0x78a9('0x13')]);return _0x54cdef(_0x36f88f['error'][_0x78a9('0x13')]);}else{logger['info'](_0x78a9('0xc'),_0x1da317,_0x78a9('0xf'));_0x54cdef(_0x36f88f['result'][_0x78a9('0x13')]);}})[_0x78a9('0x14')](function(_0x1bfd0f){logger[_0x78a9('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x1da317,_0x1bfd0f);_0x68fd3e(_0x1bfd0f);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 10d13ed..868f61c 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x16f807,_0x47f2fe){var _0x34afa0=function(_0x11a261){while(--_0x11a261){_0x16f807['push'](_0x16f807['shift']());}};_0x34afa0(++_0x47f2fe);}(_0xe706,0xa3));var _0x6e70=function(_0x28e0c5,_0xae901c){_0x28e0c5=_0x28e0c5-0x0;var _0x154afc=_0xe706[_0x28e0c5];return _0x154afc;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x17521d,_0x118385){var _0x4f13f9=function(_0x5de91b){while(--_0x5de91b){_0x17521d['push'](_0x17521d['shift']());}};_0x4f13f9(++_0x118385);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0xcb91[_0x4f431d];return _0x4f31e1;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 1369665..57e4016 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 _0xa331=['exports','INTEGER','STRING','sequelize'];(function(_0x10d5b0,_0x5b2b6f){var _0x5ae234=function(_0x5aa156){while(--_0x5aa156){_0x10d5b0['push'](_0x10d5b0['shift']());}};_0x5ae234(++_0x5b2b6f);}(_0xa331,0x14f));var _0x1a33=function(_0x246462,_0x305c0d){_0x246462=_0x246462-0x0;var _0x161a58=_0xa331[_0x246462];return _0x161a58;};'use strict';var Sequelize=require(_0x1a33('0x0'));module[_0x1a33('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1a33('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x1a33('0x3')]}}; \ No newline at end of file +var _0xafcc=['exports','INTEGER','STRING','sequelize'];(function(_0x1c19dc,_0x19474b){var _0x3ac3f8=function(_0xd1c344){while(--_0xd1c344){_0x1c19dc['push'](_0x1c19dc['shift']());}};_0x3ac3f8(++_0x19474b);}(_0xafcc,0xd7));var _0xcafc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xafcc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcafc('0x0'));module[_0xcafc('0x1')]={'penalty':{'type':Sequelize[_0xcafc('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xcafc('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xcafc('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 9b97e3f..37738f0 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 _0xd3f3=['api','moment','bluebird','request-promise','path','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x17af22,_0x22668a){var _0x24239e=function(_0x174e27){while(--_0x174e27){_0x17af22['push'](_0x17af22['shift']());}};_0x24239e(++_0x22668a);}(_0xd3f3,0xc9));var _0x3d3f=function(_0x448ae2,_0x1676f5){_0x448ae2=_0x448ae2-0x0;var _0x4fdd34=_0xd3f3[_0x448ae2];return _0x4fdd34;};'use strict';var _=require(_0x3d3f('0x0'));var util=require(_0x3d3f('0x1'));var logger=require(_0x3d3f('0x2'))(_0x3d3f('0x3'));var moment=require(_0x3d3f('0x4'));var BPromise=require(_0x3d3f('0x5'));var rp=require(_0x3d3f('0x6'));var fs=require('fs');var path=require(_0x3d3f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3d3f('0x8'));module[_0x3d3f('0x9')]=function(_0x8350d5,_0x23da9d){return _0x8350d5[_0x3d3f('0xa')]('UserFaxQueue',attributes,{'tableName':_0x3d3f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f0d=['define','user_has_fax_queues','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x9f0d,0xd4));var _0xd9f0=function(_0x38ca12,_0x2cbbec){_0x38ca12=_0x38ca12-0x0;var _0x2f6936=_0x9f0d[_0x38ca12];return _0x2f6936;};'use strict';var _=require('lodash');var util=require(_0xd9f0('0x0'));var logger=require(_0xd9f0('0x1'))(_0xd9f0('0x2'));var moment=require(_0xd9f0('0x3'));var BPromise=require(_0xd9f0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd9f0('0x5'));var config=require(_0xd9f0('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0xd9f0('0x7')]=function(_0xf4c5af,_0x9ab7c4){return _0xf4c5af[_0xd9f0('0x8')]('UserFaxQueue',attributes,{'tableName':_0xd9f0('0x9'),'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 3263f3e..39aa0b8 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 _0xb140=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x26811f,_0x363a38){var _0x431890=function(_0x40fc51){while(--_0x40fc51){_0x26811f['push'](_0x26811f['shift']());}};_0x431890(++_0x363a38);}(_0xb140,0x65));var _0x0b14=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0xb140[_0x592e40];return _0x5d4288;};'use strict';var _=require('lodash');var util=require(_0x0b14('0x0'));var moment=require(_0x0b14('0x1'));var BPromise=require(_0x0b14('0x2'));var rs=require(_0x0b14('0x3'));var fs=require('fs');var Redis=require(_0x0b14('0x4'));var db=require(_0x0b14('0x5'))['db'];var utils=require(_0x0b14('0x6'));var logger=require(_0x0b14('0x7'))('rpc');var config=require(_0x0b14('0x8'));var jayson=require(_0x0b14('0x9'));var client=jayson[_0x0b14('0xa')][_0x0b14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54cf5a,_0xd4c70f,_0x3961ab){return new BPromise(function(_0x419b27,_0x2ec18b){return client[_0x0b14('0xc')](_0x54cf5a,_0x3961ab)[_0x0b14('0xd')](function(_0x1a76f8){logger[_0x0b14('0xe')](_0x0b14('0xf'),_0xd4c70f,_0x0b14('0x10'));logger[_0x0b14('0x11')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0xd4c70f,_0x0b14('0x10'),JSON[_0x0b14('0x12')](_0x1a76f8));if(_0x1a76f8[_0x0b14('0x13')]){if(_0x1a76f8[_0x0b14('0x13')][_0x0b14('0x14')]===0x1f4){logger['error'](_0x0b14('0xf'),_0xd4c70f,_0x1a76f8[_0x0b14('0x13')][_0x0b14('0x15')]);return _0x2ec18b(_0x1a76f8[_0x0b14('0x13')]['message']);}logger[_0x0b14('0x13')](_0x0b14('0xf'),_0xd4c70f,_0x1a76f8[_0x0b14('0x13')][_0x0b14('0x15')]);return _0x419b27(_0x1a76f8[_0x0b14('0x13')][_0x0b14('0x15')]);}else{logger['info'](_0x0b14('0xf'),_0xd4c70f,'request\x20sent');_0x419b27(_0x1a76f8[_0x0b14('0x16')][_0x0b14('0x15')]);}})[_0x0b14('0x17')](function(_0x1edc5d){logger[_0x0b14('0x13')](_0x0b14('0xf'),_0xd4c70f,_0x1edc5d);_0x2ec18b(_0x1edc5d);});});} \ No newline at end of file +var _0xc73a=['randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird'];(function(_0x20d536,_0x467185){var _0x37c3a6=function(_0x367657){while(--_0x367657){_0x20d536['push'](_0x20d536['shift']());}};_0x37c3a6(++_0x467185);}(_0xc73a,0x1cb));var _0xac73=function(_0x29306f,_0x369ed1){_0x29306f=_0x29306f-0x0;var _0x3935e3=_0xc73a[_0x29306f];return _0x3935e3;};'use strict';var _=require(_0xac73('0x0'));var util=require('util');var moment=require(_0xac73('0x1'));var BPromise=require(_0xac73('0x2'));var rs=require(_0xac73('0x3'));var fs=require('fs');var Redis=require(_0xac73('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xac73('0x5'))('rpc');var config=require(_0xac73('0x6'));var jayson=require(_0xac73('0x7'));var client=jayson[_0xac73('0x8')][_0xac73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27e51a,_0x2109e6,_0x2b7fdb){return new BPromise(function(_0x3d3b55,_0x88cfe1){return client[_0xac73('0xa')](_0x27e51a,_0x2b7fdb)[_0xac73('0xb')](function(_0x4a09b9){logger[_0xac73('0xc')](_0xac73('0xd'),_0x2109e6,_0xac73('0xe'));logger[_0xac73('0xf')](_0xac73('0x10'),_0x2109e6,_0xac73('0xe'),JSON[_0xac73('0x11')](_0x4a09b9));if(_0x4a09b9[_0xac73('0x12')]){if(_0x4a09b9[_0xac73('0x12')]['code']===0x1f4){logger[_0xac73('0x12')](_0xac73('0xd'),_0x2109e6,_0x4a09b9[_0xac73('0x12')][_0xac73('0x13')]);return _0x88cfe1(_0x4a09b9['error'][_0xac73('0x13')]);}logger['error'](_0xac73('0xd'),_0x2109e6,_0x4a09b9[_0xac73('0x12')][_0xac73('0x13')]);return _0x3d3b55(_0x4a09b9[_0xac73('0x12')][_0xac73('0x13')]);}else{logger[_0xac73('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x2109e6,_0xac73('0xe'));_0x3d3b55(_0x4a09b9[_0xac73('0x14')]['message']);}})['catch'](function(_0x1e0d41){logger[_0xac73('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x2109e6,_0x1e0d41);_0x88cfe1(_0x1e0d41);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 43aa833..3dafd20 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2cf0a2,_0x518101){var _0x3981ea=function(_0x2f7c04){while(--_0x2f7c04){_0x2cf0a2['push'](_0x2cf0a2['shift']());}};_0x3981ea(++_0x518101);}(_0xedd9,0xfc));var _0x9edd=function(_0x56e7f0,_0x49a851){_0x56e7f0=_0x56e7f0-0x0;var _0x23dbd5=_0xedd9[_0x56e7f0];return _0x23dbd5;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xf7b88a,_0x12c26c){var _0x286494=function(_0x22c311){while(--_0x22c311){_0xf7b88a['push'](_0xf7b88a['shift']());}};_0x286494(++_0x12c26c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index d0d168e..64579f6 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 _0x30eb=['INTEGER','sequelize','exports'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x30eb,0x7f));var _0xb30e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x30eb[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xb30e('0x0'));module[_0xb30e('0x1')]={'penalty':{'type':Sequelize[_0xb30e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5692=['sequelize','exports','INTEGER'];(function(_0x2e07dc,_0x5ac59b){var _0x3adcf8=function(_0x4a1acd){while(--_0x4a1acd){_0x2e07dc['push'](_0x2e07dc['shift']());}};_0x3adcf8(++_0x5ac59b);}(_0x5692,0x14a));var _0x2569=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5692[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x2569('0x0'));module[_0x2569('0x1')]={'penalty':{'type':Sequelize[_0x2569('0x2')],'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 ebd4421..0449189 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 _0x6b49=['UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x15177e,_0x375e5b){var _0x27bf7b=function(_0x5966d7){while(--_0x5966d7){_0x15177e['push'](_0x15177e['shift']());}};_0x27bf7b(++_0x375e5b);}(_0x6b49,0x1af));var _0x96b4=function(_0x5a7f64,_0x347d57){_0x5a7f64=_0x5a7f64-0x0;var _0x3d30f1=_0x6b49[_0x5a7f64];return _0x3d30f1;};'use strict';var _=require(_0x96b4('0x0'));var util=require(_0x96b4('0x1'));var logger=require(_0x96b4('0x2'))(_0x96b4('0x3'));var moment=require(_0x96b4('0x4'));var BPromise=require(_0x96b4('0x5'));var rp=require(_0x96b4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x96b4('0x7'));var config=require(_0x96b4('0x8'));var attributes=require('./userMailQueue.attributes');module[_0x96b4('0x9')]=function(_0x2746e5,_0x58c220){return _0x2746e5[_0x96b4('0xa')](_0x96b4('0xb'),attributes,{'tableName':_0x96b4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7cf0=['../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7cf0,0x141));var _0x07cf=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x7cf0[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x07cf('0x0'));var util=require(_0x07cf('0x1'));var logger=require(_0x07cf('0x2'))(_0x07cf('0x3'));var moment=require(_0x07cf('0x4'));var BPromise=require(_0x07cf('0x5'));var rp=require(_0x07cf('0x6'));var fs=require('fs');var path=require(_0x07cf('0x7'));var rimraf=require(_0x07cf('0x8'));var config=require(_0x07cf('0x9'));var attributes=require(_0x07cf('0xa'));module[_0x07cf('0xb')]=function(_0x234461,_0x200afe){return _0x234461[_0x07cf('0xc')](_0x07cf('0xd'),attributes,{'tableName':_0x07cf('0xe'),'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 5f86d61..ebb82b8 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 _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserMailQueue,\x20%s,\x20%s','message','result'];(function(_0x4f36ca,_0x3b40dc){var _0x5383fb=function(_0x43687d){while(--_0x43687d){_0x4f36ca['push'](_0x4f36ca['shift']());}};_0x5383fb(++_0x3b40dc);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x551b0a,_0x41348c){_0x551b0a=_0x551b0a-0x0;var _0x5dacb8=_0xf3cd[_0x551b0a];return _0x5dacb8;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x008c,0x188));var _0xc008=function(_0x2f133c,_0x2d0ee7){_0x2f133c=_0x2f133c-0x0;var _0x17fe82=_0x008c[_0x2f133c];return _0x17fe82;};'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 1376073..5bb66f1 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 _0xb4ed=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x37cf14,_0x4bca95){var _0x276b7e=function(_0x28b5b0){while(--_0x28b5b0){_0x37cf14['push'](_0x37cf14['shift']());}};_0x276b7e(++_0x4bca95);}(_0xb4ed,0x1a3));var _0xdb4e=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xb4ed[_0x26462c];return _0x509a42;};'use strict';var multer=require(_0xdb4e('0x0'));var util=require('util');var path=require(_0xdb4e('0x1'));var timeout=require(_0xdb4e('0x2'));var express=require(_0xdb4e('0x3'));var router=express['Router']();var fs_extra=require(_0xdb4e('0x4'));var auth=require(_0xdb4e('0x5'));var interaction=require(_0xdb4e('0x6'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router['post']('/',auth[_0xdb4e('0x7')](),controller[_0xdb4e('0x8')]);module[_0xdb4e('0x9')]=router; \ No newline at end of file +var _0xb3cb=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','isAuthenticated','sendUserNotification'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xb3cb,0x1d4));var _0xbb3c=function(_0x45f2e7,_0x11203d){_0x45f2e7=_0x45f2e7-0x0;var _0x21243a=_0xb3cb[_0x45f2e7];return _0x21243a;};'use strict';var multer=require(_0xbb3c('0x0'));var util=require(_0xbb3c('0x1'));var path=require(_0xbb3c('0x2'));var timeout=require(_0xbb3c('0x3'));var express=require(_0xbb3c('0x4'));var router=express[_0xbb3c('0x5')]();var fs_extra=require(_0xbb3c('0x6'));var auth=require(_0xbb3c('0x7'));var interaction=require(_0xbb3c('0x8'));var config=require('../../config/environment');var controller=require(_0xbb3c('0x9'));router['post']('/',auth[_0xbb3c('0xa')](),controller[_0xbb3c('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index e443d2d..8a4bea0 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 _0xd58b=['sequelize','exports','STRING'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xd58b,0xde));var _0xbd58=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xd58b[_0x599f41];return _0x2e4d58;};'use strict';var Sequelize=require(_0xbd58('0x0'));module[_0xbd58('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xbd58('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xbd58('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x5b26=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x2cf5f1,_0x3e8efc){var _0xee0c68=function(_0x10ef87){while(--_0x10ef87){_0x2cf5f1['push'](_0x2cf5f1['shift']());}};_0xee0c68(++_0x3e8efc);}(_0x5b26,0x1ed));var _0x65b2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5b26[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x65b2('0x0'));module[_0x65b2('0x1')]={'body':{'type':Sequelize[_0x65b2('0x2')]},'senderName':{'type':Sequelize[_0x65b2('0x3')]},'recipientsId':{'type':Sequelize[_0x65b2('0x2')]},'recipientsDescription':{'type':Sequelize[_0x65b2('0x3')]},'beep':{'type':Sequelize[_0x65b2('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 31545d9..331b83a 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 _0x61c2=['end','json','undefined','count','offset','set','Content-Range','save','update','destroy','error','name','send','sendUserNotification','body','text','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','whatsappqueue','team','user','some','includes','model','toLowerCase','senderName','isEmpty','recipientsDescription','beep','SenderId','then','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','User','union','ids','queue','push','all','flatten','catch','getAgents','map','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x61c2,0x164));var _0x261c=function(_0xc6ce7d,_0xf5e431){_0xc6ce7d=_0xc6ce7d-0x0;var _0x13ba14=_0x61c2[_0xc6ce7d];return _0x13ba14;};'use strict';var emlformat=require(_0x261c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x261c('0x1'));var jsonpatch=require(_0x261c('0x2'));var rp=require(_0x261c('0x3'));var moment=require(_0x261c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x261c('0x5'));var util=require(_0x261c('0x6'));var path=require(_0x261c('0x7'));var sox=require('sox');var csv=require(_0x261c('0x8'));var ejs=require(_0x261c('0x9'));var fs=require('fs');var fs_extra=require(_0x261c('0xa'));var _=require('lodash');var squel=require(_0x261c('0xb'));var crypto=require(_0x261c('0xc'));var jsforce=require(_0x261c('0xd'));var deskjs=require(_0x261c('0xe'));var toCsv=require(_0x261c('0x8'));var querystring=require(_0x261c('0xf'));var Papa=require(_0x261c('0x10'));var Redis=require('ioredis');var authService=require(_0x261c('0x11'));var qs=require(_0x261c('0x12'));var as=require(_0x261c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x261c('0x14'));var utils=require(_0x261c('0x15'));var config=require(_0x261c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x261c('0x17'))['db'];config[_0x261c('0x18')]=_[_0x261c('0x19')](config[_0x261c('0x18')],{'host':_0x261c('0x1a'),'port':0x18eb});var socket=require(_0x261c('0x1b'))(new Redis(config['redis']));require(_0x261c('0x1c'))[_0x261c('0x1d')](socket);function respondWithStatusCode(_0x1d8a18,_0x483e29){_0x483e29=_0x483e29||0xcc;return function(_0x41fbb8){if(_0x41fbb8){return _0x1d8a18[_0x261c('0x1e')](_0x483e29);}return _0x1d8a18[_0x261c('0x1f')](_0x483e29)[_0x261c('0x20')]();};}function respondWithResult(_0x16992e,_0x7aa34f){_0x7aa34f=_0x7aa34f||0xc8;return function(_0x4bd191){if(_0x4bd191){return _0x16992e['status'](_0x7aa34f)[_0x261c('0x21')](_0x4bd191);}};}function respondWithFilteredResult(_0xf5fbfd,_0x58aeb1){return function(_0x126cf0){if(_0x126cf0){var _0x335651=typeof _0x58aeb1['offset']===_0x261c('0x22')&&typeof _0x58aeb1['limit']===_0x261c('0x22');var _0x259ab2=_0x126cf0[_0x261c('0x23')];var _0x110b32=_0x335651?0x0:_0x58aeb1[_0x261c('0x24')];var _0x1aa724=_0x335651?_0x126cf0[_0x261c('0x23')]:_0x58aeb1['offset']+_0x58aeb1['limit'];var _0x781b51;if(_0x1aa724>=_0x259ab2){_0x1aa724=_0x259ab2;_0x781b51=0xc8;}else{_0x781b51=0xce;}_0xf5fbfd[_0x261c('0x1f')](_0x781b51);return _0xf5fbfd[_0x261c('0x25')](_0x261c('0x26'),_0x110b32+'-'+_0x1aa724+'/'+_0x259ab2)['json'](_0x126cf0);}return null;};}function patchUpdates(_0x235910){return function(_0x2199ef){try{jsonpatch['apply'](_0x2199ef,_0x235910,!![]);}catch(_0x556c17){return BPromise['reject'](_0x556c17);}return _0x2199ef[_0x261c('0x27')]();};}function saveUpdates(_0x534888,_0x29c092){return function(_0x236f0b){if(_0x236f0b){return _0x236f0b[_0x261c('0x28')](_0x534888)['then'](function(_0x5e1e23){return _0x5e1e23;});}return null;};}function removeEntity(_0x586ef3,_0x2ae3c8){return function(_0x7b9e8e){if(_0x7b9e8e){return _0x7b9e8e[_0x261c('0x29')]()['then'](function(){_0x586ef3[_0x261c('0x1f')](0xcc)[_0x261c('0x20')]();});}};}function handleEntityNotFound(_0x1067b1,_0x421713){return function(_0x5a4264){if(!_0x5a4264){_0x1067b1['sendStatus'](0x194);}return _0x5a4264;};}function handleError(_0x325c4b,_0x1175c0){_0x1175c0=_0x1175c0||0x1f4;return function(_0x3b6efa){logger[_0x261c('0x2a')](_0x3b6efa['stack']);if(_0x3b6efa['name']){delete _0x3b6efa[_0x261c('0x2b')];}_0x325c4b[_0x261c('0x1f')](_0x1175c0)[_0x261c('0x2c')](_0x3b6efa);};}exports[_0x261c('0x2d')]=function(_0x327d45,_0x1fe132,_0x5f0f55){if(!_0x327d45[_0x261c('0x2e')]['hasOwnProperty'](_0x261c('0x2f'))&&!_0x327d45[_0x261c('0x2e')][_0x261c('0x30')](_0x261c('0x31'))){throw new db[(_0x261c('0x32'))][(_0x261c('0x33'))](_0x261c('0x34'));}else{if(_0x327d45[_0x261c('0x2e')][_0x261c('0x30')](_0x261c('0x31'))&&!_0x327d45[_0x261c('0x2e')][_0x261c('0x30')](_0x261c('0x35'))){throw new db[(_0x261c('0x32'))]['ValidationError'](_0x261c('0x36'));}if(!_0x327d45[_0x261c('0x2e')][_0x261c('0x30')](_0x261c('0x37'))){throw new db[(_0x261c('0x32'))][(_0x261c('0x33'))](_0x261c('0x38'));}else{try{var _0x3c6423=JSON['parse'](_0x327d45[_0x261c('0x2e')][_0x261c('0x37')]);}catch(_0x383ce2){logger[_0x261c('0x2a')](_0x383ce2);throw new db[(_0x261c('0x32'))][(_0x261c('0x33'))](_0x261c('0x39'));}var _0x298927=['chatqueue',_0x261c('0x3a'),_0x261c('0x3b'),'openchannelqueue','smsqueue','voicequeue',_0x261c('0x3c'),_0x261c('0x3d'),_0x261c('0x3e')];if(_[_0x261c('0x3f')](_0x3c6423,function(_0x23b9fb){return!_[_0x261c('0x40')](_0x298927,_0x23b9fb[_0x261c('0x41')][_0x261c('0x42')]());})){throw new db[(_0x261c('0x32'))][(_0x261c('0x33'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x536a3c={};_0x536a3c[_0x261c('0x43')]=_0x327d45['body'][_0x261c('0x30')]('senderName')?_0x327d45[_0x261c('0x2e')][_0x261c('0x43')]:_0x327d45[_0x261c('0x3e')]['fullname'];_0x536a3c['recipientsDescription']=_[_0x261c('0x44')](_0x327d45[_0x261c('0x2e')][_0x261c('0x45')])?null:_0x327d45['body'][_0x261c('0x45')];_0x536a3c[_0x261c('0x46')]=_0x327d45[_0x261c('0x2e')][_0x261c('0x46')]||![];_0x536a3c[_0x261c('0x47')]=_0x327d45[_0x261c('0x3e')]['id'];return getContent(_0x327d45['body'])[_0x261c('0x48')](function(_0x96f4a6){_0x536a3c[_0x261c('0x2e')]=_0x96f4a6;return getRecipients(_0x3c6423);})[_0x261c('0x48')](function(_0x1568c1){_0x536a3c['recipientsId']=_[_0x261c('0x49')](_0x1568c1)[_0x261c('0x4a')](',');return db[_0x261c('0x4b')][_0x261c('0x4c')](function(_0xdfbfdb){return db[_0x261c('0x4d')][_0x261c('0x4e')](_0x536a3c,{'raw':!![],'transaction':_0xdfbfdb})[_0x261c('0x48')](function(_0x5bb309){var _0x31d18c={'sender':_0x536a3c[_0x261c('0x43')],'description':_0x536a3c[_0x261c('0x45')],'content':_0x536a3c[_0x261c('0x2e')],'beep':_0x536a3c['beep']};_0x1568c1[_0x261c('0x4f')](function(_0x476404){_0x31d18c[_0x261c('0x50')]=_0x476404;socket['emit'](_0x261c('0x51'),_0x31d18c);});return _0x5bb309;});});})[_0x261c('0x48')](respondWithResult(_0x1fe132,0xc9))['catch'](handleError(_0x1fe132,null));};function getContent(_0x5641e6){return new BPromise(function(_0x25ba67,_0x8e0264){if(_0x5641e6['text']){_0x25ba67(_0x5641e6['text']);return;}return db[_0x261c('0x52')][_0x261c('0x53')]({'attributes':[_0x261c('0x54')],'where':{'id':_0x5641e6['TemplateId']},'raw':!![]})[_0x261c('0x48')](function(_0x41bed8){if(!_0x41bed8)throw new db[(_0x261c('0x32'))][(_0x261c('0x33'))](_0x261c('0x55'));var _0x5b7169=Mustache[_0x261c('0x56')](_0x41bed8[_0x261c('0x54')],_0x5641e6[_0x261c('0x35')]);_0x25ba67(_0x5b7169);})['catch'](function(_0x1101b2){_0x8e0264(_0x1101b2);});});}function getRecipients(_0x170f76){return new BPromise(function(_0x15f07e,_0x27d232){var _0x1f46a1=[];var _0x2e73b0=[];_0x170f76[_0x261c('0x4f')](function(_0x421bc6){var _0x363099=_['startCase'](_0x421bc6[_0x261c('0x41')][_0x261c('0x42')]());if(_0x363099===_0x261c('0x57')){_0x1f46a1=_[_0x261c('0x58')](_0x1f46a1,_0x421bc6[_0x261c('0x59')]);}else{if(_[_0x261c('0x40')](_0x363099,'queue'))_0x363099=_0x363099['replace'](_0x261c('0x5a'),'Queue');_0x421bc6['ids'][_0x261c('0x4f')](function(_0x3c00a9){_0x2e73b0[_0x261c('0x5b')](getAgents(_0x363099,_0x3c00a9));});}});return BPromise[_0x261c('0x5c')](_0x2e73b0)[_0x261c('0x48')](function(_0x330abf){_0x1f46a1=_['union'](_0x1f46a1,_[_0x261c('0x5d')](_0x330abf));_0x15f07e(_0x1f46a1);})[_0x261c('0x5e')](function(_0x878703){_0x27d232(_0x878703);});});}function getAgents(_0x130102,_0x557db8){return new BPromise(function(_0x51a1e1,_0x4b33d4){return db[_0x130102][_0x261c('0x53')]({'where':{'id':_0x557db8}})['then'](function(_0x5664bd){return _0x5664bd[_0x261c('0x5f')]({'attributes':['id'],'raw':!![]})[_0x261c('0x48')](function(_0x5d3d32){var _0x2732a9=_[_0x261c('0x60')](_0x5d3d32,'id');_0x51a1e1(_0x2732a9);});})[_0x261c('0x5e')](function(_0x477dd3){_0x4b33d4(_0x477dd3);});});} \ No newline at end of file +var _0xe7e6=['save','update','then','destroy','error','stack','name','sendUserNotification','text','body','TemplateId','Sequelize','ValidationError','hasOwnProperty','view','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','user','some','includes','toLowerCase','senderName','recipientsDescription','beep','recipientsId','join','sequelize','UserNotification','create','forEach','recipient','userNotification:send','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','union','queue','replace','Queue','ids','push','flatten','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','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','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xe7e6,0x1be));var _0x6e7e=function(_0x155c6b,_0x2cdc9f){_0x155c6b=_0x155c6b-0x0;var _0x3d948b=_0xe7e6[_0x155c6b];return _0x3d948b;};'use strict';var emlformat=require(_0x6e7e('0x0'));var rimraf=require(_0x6e7e('0x1'));var zipdir=require(_0x6e7e('0x2'));var jsonpatch=require(_0x6e7e('0x3'));var rp=require(_0x6e7e('0x4'));var moment=require(_0x6e7e('0x5'));var BPromise=require(_0x6e7e('0x6'));var Mustache=require('mustache');var util=require(_0x6e7e('0x7'));var path=require(_0x6e7e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6e7e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6e7e('0xa'));var crypto=require(_0x6e7e('0xb'));var jsforce=require(_0x6e7e('0xc'));var deskjs=require(_0x6e7e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6e7e('0xe'));var Papa=require(_0x6e7e('0xf'));var Redis=require(_0x6e7e('0x10'));var authService=require(_0x6e7e('0x11'));var qs=require(_0x6e7e('0x12'));var as=require(_0x6e7e('0x13'));var hardwareService=require(_0x6e7e('0x14'));var logger=require(_0x6e7e('0x15'))(_0x6e7e('0x16'));var utils=require(_0x6e7e('0x17'));var config=require(_0x6e7e('0x18'));var licenseUtil=require(_0x6e7e('0x19'));var db=require(_0x6e7e('0x1a'))['db'];config[_0x6e7e('0x1b')]=_['defaults'](config['redis'],{'host':_0x6e7e('0x1c'),'port':0x18eb});var socket=require(_0x6e7e('0x1d'))(new Redis(config[_0x6e7e('0x1b')]));require(_0x6e7e('0x1e'))[_0x6e7e('0x1f')](socket);function respondWithStatusCode(_0x5136d0,_0x5b42d6){_0x5b42d6=_0x5b42d6||0xcc;return function(_0x1744d8){if(_0x1744d8){return _0x5136d0[_0x6e7e('0x20')](_0x5b42d6);}return _0x5136d0[_0x6e7e('0x21')](_0x5b42d6)[_0x6e7e('0x22')]();};}function respondWithResult(_0xdaa5f2,_0x426703){_0x426703=_0x426703||0xc8;return function(_0x1be150){if(_0x1be150){return _0xdaa5f2[_0x6e7e('0x21')](_0x426703)[_0x6e7e('0x23')](_0x1be150);}};}function respondWithFilteredResult(_0x52d0c0,_0x96bc58){return function(_0x5adbda){if(_0x5adbda){var _0xd60a21=typeof _0x96bc58[_0x6e7e('0x24')]===_0x6e7e('0x25')&&typeof _0x96bc58['limit']===_0x6e7e('0x25');var _0x5744b9=_0x5adbda['count'];var _0x24862f=_0xd60a21?0x0:_0x96bc58[_0x6e7e('0x24')];var _0x35ed9d=_0xd60a21?_0x5adbda[_0x6e7e('0x26')]:_0x96bc58['offset']+_0x96bc58[_0x6e7e('0x27')];var _0x13f7f9;if(_0x35ed9d>=_0x5744b9){_0x35ed9d=_0x5744b9;_0x13f7f9=0xc8;}else{_0x13f7f9=0xce;}_0x52d0c0[_0x6e7e('0x21')](_0x13f7f9);return _0x52d0c0[_0x6e7e('0x28')](_0x6e7e('0x29'),_0x24862f+'-'+_0x35ed9d+'/'+_0x5744b9)[_0x6e7e('0x23')](_0x5adbda);}return null;};}function patchUpdates(_0x51fcf2){return function(_0xbc08f8){try{jsonpatch[_0x6e7e('0x2a')](_0xbc08f8,_0x51fcf2,!![]);}catch(_0x2c081f){return BPromise[_0x6e7e('0x2b')](_0x2c081f);}return _0xbc08f8[_0x6e7e('0x2c')]();};}function saveUpdates(_0x5fc563,_0x14f942){return function(_0x3fd838){if(_0x3fd838){return _0x3fd838[_0x6e7e('0x2d')](_0x5fc563)[_0x6e7e('0x2e')](function(_0x4cce67){return _0x4cce67;});}return null;};}function removeEntity(_0x377033,_0x129947){return function(_0x1303e2){if(_0x1303e2){return _0x1303e2[_0x6e7e('0x2f')]()[_0x6e7e('0x2e')](function(){_0x377033[_0x6e7e('0x21')](0xcc)[_0x6e7e('0x22')]();});}};}function handleEntityNotFound(_0xedf174,_0x190a4a){return function(_0x56212a){if(!_0x56212a){_0xedf174['sendStatus'](0x194);}return _0x56212a;};}function handleError(_0x4c9e87,_0x42b612){_0x42b612=_0x42b612||0x1f4;return function(_0x75271e){logger[_0x6e7e('0x30')](_0x75271e[_0x6e7e('0x31')]);if(_0x75271e[_0x6e7e('0x32')]){delete _0x75271e[_0x6e7e('0x32')];}_0x4c9e87[_0x6e7e('0x21')](_0x42b612)['send'](_0x75271e);};}exports[_0x6e7e('0x33')]=function(_0x1673fc,_0x11160a,_0x31d629){if(!_0x1673fc['body']['hasOwnProperty'](_0x6e7e('0x34'))&&!_0x1673fc[_0x6e7e('0x35')]['hasOwnProperty'](_0x6e7e('0x36'))){throw new db[(_0x6e7e('0x37'))][(_0x6e7e('0x38'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x1673fc[_0x6e7e('0x35')][_0x6e7e('0x39')]('TemplateId')&&!_0x1673fc[_0x6e7e('0x35')][_0x6e7e('0x39')](_0x6e7e('0x3a'))){throw new db[(_0x6e7e('0x37'))][(_0x6e7e('0x38'))](_0x6e7e('0x3b'));}if(!_0x1673fc[_0x6e7e('0x35')][_0x6e7e('0x39')]('recipients')){throw new db['Sequelize'][(_0x6e7e('0x38'))](_0x6e7e('0x3c'));}else{try{var _0xea6ae2=JSON['parse'](_0x1673fc['body'][_0x6e7e('0x3d')]);}catch(_0x1bc5b2){logger[_0x6e7e('0x30')](_0x1bc5b2);throw new db['Sequelize'][(_0x6e7e('0x38'))](_0x6e7e('0x3e'));}var _0x300874=[_0x6e7e('0x3f'),_0x6e7e('0x40'),_0x6e7e('0x41'),_0x6e7e('0x42'),_0x6e7e('0x43'),'voicequeue',_0x6e7e('0x44'),'team',_0x6e7e('0x45')];if(_[_0x6e7e('0x46')](_0xea6ae2,function(_0x956c24){return!_[_0x6e7e('0x47')](_0x300874,_0x956c24['model'][_0x6e7e('0x48')]());})){throw new db[(_0x6e7e('0x37'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x5c4d08={};_0x5c4d08[_0x6e7e('0x49')]=_0x1673fc[_0x6e7e('0x35')]['hasOwnProperty']('senderName')?_0x1673fc[_0x6e7e('0x35')][_0x6e7e('0x49')]:_0x1673fc['user']['fullname'];_0x5c4d08[_0x6e7e('0x4a')]=_['isEmpty'](_0x1673fc[_0x6e7e('0x35')]['recipientsDescription'])?null:_0x1673fc[_0x6e7e('0x35')]['recipientsDescription'];_0x5c4d08[_0x6e7e('0x4b')]=_0x1673fc['body'][_0x6e7e('0x4b')]||![];_0x5c4d08['SenderId']=_0x1673fc['user']['id'];return getContent(_0x1673fc['body'])[_0x6e7e('0x2e')](function(_0x3aade1){_0x5c4d08[_0x6e7e('0x35')]=_0x3aade1;return getRecipients(_0xea6ae2);})[_0x6e7e('0x2e')](function(_0x4a5f71){_0x5c4d08[_0x6e7e('0x4c')]=_['sortBy'](_0x4a5f71)[_0x6e7e('0x4d')](',');return db[_0x6e7e('0x4e')]['transaction'](function(_0x58965a){return db[_0x6e7e('0x4f')][_0x6e7e('0x50')](_0x5c4d08,{'raw':!![],'transaction':_0x58965a})[_0x6e7e('0x2e')](function(_0x539995){var _0xfd5efa={'sender':_0x5c4d08[_0x6e7e('0x49')],'description':_0x5c4d08[_0x6e7e('0x4a')],'content':_0x5c4d08[_0x6e7e('0x35')],'beep':_0x5c4d08[_0x6e7e('0x4b')]};_0x4a5f71[_0x6e7e('0x51')](function(_0x13b0ed){_0xfd5efa[_0x6e7e('0x52')]=_0x13b0ed;socket['emit'](_0x6e7e('0x53'),_0xfd5efa);});return _0x539995;});});})[_0x6e7e('0x2e')](respondWithResult(_0x11160a,0xc9))[_0x6e7e('0x54')](handleError(_0x11160a,null));};function getContent(_0x51db28){return new BPromise(function(_0x47d978,_0x551e2){if(_0x51db28[_0x6e7e('0x34')]){_0x47d978(_0x51db28[_0x6e7e('0x34')]);return;}return db[_0x6e7e('0x55')]['findOne']({'attributes':[_0x6e7e('0x56')],'where':{'id':_0x51db28[_0x6e7e('0x36')]},'raw':!![]})[_0x6e7e('0x2e')](function(_0x49fcee){if(!_0x49fcee)throw new db[(_0x6e7e('0x37'))][(_0x6e7e('0x38'))](_0x6e7e('0x57'));var _0x59d96d=Mustache[_0x6e7e('0x58')](_0x49fcee[_0x6e7e('0x56')],_0x51db28[_0x6e7e('0x3a')]);_0x47d978(_0x59d96d);})[_0x6e7e('0x54')](function(_0x1e6d5b){_0x551e2(_0x1e6d5b);});});}function getRecipients(_0x59e492){return new BPromise(function(_0x5019e8,_0x32bbb8){var _0x3a6178=[];var _0x5771d5=[];_0x59e492[_0x6e7e('0x51')](function(_0x52578f){var _0x366674=_[_0x6e7e('0x59')](_0x52578f['model'][_0x6e7e('0x48')]());if(_0x366674==='User'){_0x3a6178=_[_0x6e7e('0x5a')](_0x3a6178,_0x52578f['ids']);}else{if(_[_0x6e7e('0x47')](_0x366674,_0x6e7e('0x5b')))_0x366674=_0x366674[_0x6e7e('0x5c')](_0x6e7e('0x5b'),_0x6e7e('0x5d'));_0x52578f[_0x6e7e('0x5e')]['forEach'](function(_0x2994af){_0x5771d5[_0x6e7e('0x5f')](getAgents(_0x366674,_0x2994af));});}});return BPromise['all'](_0x5771d5)[_0x6e7e('0x2e')](function(_0x2796c5){_0x3a6178=_[_0x6e7e('0x5a')](_0x3a6178,_[_0x6e7e('0x60')](_0x2796c5));_0x5019e8(_0x3a6178);})[_0x6e7e('0x54')](function(_0x45863d){_0x32bbb8(_0x45863d);});});}function getAgents(_0x265eb9,_0x4f37e7){return new BPromise(function(_0xdeb453,_0x3d7659){return db[_0x265eb9][_0x6e7e('0x61')]({'where':{'id':_0x4f37e7}})[_0x6e7e('0x2e')](function(_0x4dce9a){return _0x4dce9a['getAgents']({'attributes':['id'],'raw':!![]})[_0x6e7e('0x2e')](function(_0x12a5b7){var _0x24efba=_['map'](_0x12a5b7,'id');_0xdeb453(_0x24efba);});})[_0x6e7e('0x54')](function(_0x2eef40){_0x3d7659(_0x2eef40);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 1d3063e..2d8b6b1 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 _0x9e37=['remove','emit','hasOwnProperty','exports','UserNotification','setMaxListeners','save','update'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x9e37,0x18c));var _0x79e3=function(_0x40fcda,_0x2e8598){_0x40fcda=_0x40fcda-0x0;var _0x38e739=_0x9e37[_0x40fcda];return _0x38e739;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0x79e3('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x79e3('0x1')](0x0);var events={'afterCreate':_0x79e3('0x2'),'afterUpdate':_0x79e3('0x3'),'afterDestroy':_0x79e3('0x4')};function emitEvent(_0x1b21be){return function(_0x5d0700,_0x99003c,_0x28bd63){UserNotificationEvents[_0x79e3('0x5')](_0x1b21be+':'+_0x5d0700['id'],_0x5d0700);UserNotificationEvents[_0x79e3('0x5')](_0x1b21be,_0x5d0700);_0x28bd63(null);};}for(var e in events){if(events[_0x79e3('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x79e3('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xf99a=['hook','exports','events','../../mysqldb','UserNotification','save','remove','emit','hasOwnProperty'];(function(_0x227616,_0x3c3ab2){var _0x4cf73b=function(_0x4e16a6){while(--_0x4e16a6){_0x227616['push'](_0x227616['shift']());}};_0x4cf73b(++_0x3c3ab2);}(_0xf99a,0xd1));var _0xaf99=function(_0xe71372,_0x2a41ff){_0xe71372=_0xe71372-0x0;var _0x4d50fe=_0xf99a[_0xe71372];return _0x4d50fe;};'use strict';var EventEmitter=require(_0xaf99('0x0'));var UserNotification=require(_0xaf99('0x1'))['db'][_0xaf99('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaf99('0x3'),'afterUpdate':'update','afterDestroy':_0xaf99('0x4')};function emitEvent(_0x10827e){return function(_0xb080df,_0x3c0398,_0x44ab52){UserNotificationEvents[_0xaf99('0x5')](_0x10827e+':'+_0xb080df['id'],_0xb080df);UserNotificationEvents['emit'](_0x10827e,_0xb080df);_0x44ab52(null);};}for(var e in events){if(events[_0xaf99('0x6')](e)){var event=events[e];UserNotification[_0xaf99('0x7')](e,emitEvent(event));}}module[_0xaf99('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index e82ee4f..f0b0540 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 _0xf186=['bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x2c5315,_0x2ce9bc){var _0x4e10f2=function(_0x169dd8){while(--_0x169dd8){_0x2c5315['push'](_0x2c5315['shift']());}};_0x4e10f2(++_0x2ce9bc);}(_0xf186,0xb2));var _0x6f18=function(_0x3fdb80,_0x4ddbb4){_0x3fdb80=_0x3fdb80-0x0;var _0x164a38=_0xf186[_0x3fdb80];return _0x164a38;};'use strict';var _=require(_0x6f18('0x0'));var util=require(_0x6f18('0x1'));var logger=require('../../config/logger')(_0x6f18('0x2'));var moment=require(_0x6f18('0x3'));var BPromise=require(_0x6f18('0x4'));var rp=require(_0x6f18('0x5'));var fs=require('fs');var path=require(_0x6f18('0x6'));var rimraf=require(_0x6f18('0x7'));var config=require(_0x6f18('0x8'));var attributes=require(_0x6f18('0x9'));module[_0x6f18('0xa')]=function(_0x5030d9,_0x599705){return _0x5030d9['define'](_0x6f18('0xb'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6f18('0xc'),'collate':_0x6f18('0xd')});}; \ No newline at end of file +var _0xbd11=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4'];(function(_0x56cdd3,_0x440006){var _0x29e7e1=function(_0x583365){while(--_0x583365){_0x56cdd3['push'](_0x56cdd3['shift']());}};_0x29e7e1(++_0x440006);}(_0xbd11,0xc5));var _0x1bd1=function(_0x2aebb2,_0x21f452){_0x2aebb2=_0x2aebb2-0x0;var _0x17406c=_0xbd11[_0x2aebb2];return _0x17406c;};'use strict';var _=require(_0x1bd1('0x0'));var util=require(_0x1bd1('0x1'));var logger=require('../../config/logger')(_0x1bd1('0x2'));var moment=require(_0x1bd1('0x3'));var BPromise=require(_0x1bd1('0x4'));var rp=require(_0x1bd1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1bd1('0x6'));var attributes=require(_0x1bd1('0x7'));module[_0x1bd1('0x8')]=function(_0x1dfcb2,_0x1db907){return _0x1dfcb2[_0x1bd1('0x9')](_0x1bd1('0xa'),attributes,{'tableName':_0x1bd1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1bd1('0xc'),'collate':_0x1bd1('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 20e4266..c7c0ebc 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 _0xaf1c=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','util','moment'];(function(_0x2e7841,_0x45c538){var _0x5d3a42=function(_0x31261b){while(--_0x31261b){_0x2e7841['push'](_0x2e7841['shift']());}};_0x5d3a42(++_0x45c538);}(_0xaf1c,0xf0));var _0xcaf1=function(_0x3d7450,_0x263fbc){_0x3d7450=_0x3d7450-0x0;var _0x2abf69=_0xaf1c[_0x3d7450];return _0x2abf69;};'use strict';var _=require('lodash');var util=require(_0xcaf1('0x0'));var moment=require(_0xcaf1('0x1'));var BPromise=require(_0xcaf1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcaf1('0x3'));var db=require(_0xcaf1('0x4'))['db'];var utils=require(_0xcaf1('0x5'));var logger=require('../../config/logger')(_0xcaf1('0x6'));var config=require(_0xcaf1('0x7'));var jayson=require(_0xcaf1('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xcaf1('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xcaf1('0xa'))(new Redis(config[_0xcaf1('0x9')]));require('./userNotification.socket')[_0xcaf1('0xb')](socket);function respondWithRpcPromise(_0x47f049,_0xf56225,_0x4c7ab4){return new BPromise(function(_0x8cdbca,_0x5b69f5){return client[_0xcaf1('0xc')](_0x47f049,_0x4c7ab4)[_0xcaf1('0xd')](function(_0xd099a4){logger['info'](_0xcaf1('0xe'),_0xf56225,_0xcaf1('0xf'));logger[_0xcaf1('0x10')]('UserNotification,\x20%s,\x20%s,\x20%s',_0xf56225,_0xcaf1('0xf'),JSON['stringify'](_0xd099a4));if(_0xd099a4[_0xcaf1('0x11')]){if(_0xd099a4['error'][_0xcaf1('0x12')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0xf56225,_0xd099a4[_0xcaf1('0x11')][_0xcaf1('0x13')]);return _0x5b69f5(_0xd099a4[_0xcaf1('0x11')]['message']);}logger[_0xcaf1('0x11')](_0xcaf1('0xe'),_0xf56225,_0xd099a4[_0xcaf1('0x11')][_0xcaf1('0x13')]);return _0x8cdbca(_0xd099a4[_0xcaf1('0x11')][_0xcaf1('0x13')]);}else{logger[_0xcaf1('0x14')](_0xcaf1('0xe'),_0xf56225,_0xcaf1('0xf'));_0x8cdbca(_0xd099a4['result'][_0xcaf1('0x13')]);}})[_0xcaf1('0x15')](function(_0x4f1118){logger[_0xcaf1('0x11')](_0xcaf1('0xe'),_0xf56225,_0x4f1118);_0x5b69f5(_0x4f1118);});});} \ No newline at end of file +var _0x47b3=['../../mysqldb','../../config/utils','../../config/environment','http','redis','localhost','./userNotification.socket','request','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','moment','randomstring'];(function(_0x49e42f,_0x23beed){var _0xc89a5c=function(_0x44f924){while(--_0x44f924){_0x49e42f['push'](_0x49e42f['shift']());}};_0xc89a5c(++_0x23beed);}(_0x47b3,0x15d));var _0x347b=function(_0x5672a4,_0x4ccebd){_0x5672a4=_0x5672a4-0x0;var _0x539577=_0x47b3[_0x5672a4];return _0x539577;};'use strict';var _=require('lodash');var util=require(_0x347b('0x0'));var moment=require(_0x347b('0x1'));var BPromise=require('bluebird');var rs=require(_0x347b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x347b('0x3'))['db'];var utils=require(_0x347b('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x347b('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x347b('0x6')]({'port':0x232a});config['redis']=_['defaults'](config[_0x347b('0x7')],{'host':_0x347b('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x347b('0x7')]));require(_0x347b('0x9'))['register'](socket);function respondWithRpcPromise(_0x14a2e2,_0x54d705,_0x5ed432){return new BPromise(function(_0x32bc32,_0x627e0e){return client[_0x347b('0xa')](_0x14a2e2,_0x5ed432)['then'](function(_0x4a12cb){logger[_0x347b('0xb')](_0x347b('0xc'),_0x54d705,'request\x20sent');logger[_0x347b('0xd')](_0x347b('0xe'),_0x54d705,'request\x20sent',JSON[_0x347b('0xf')](_0x4a12cb));if(_0x4a12cb[_0x347b('0x10')]){if(_0x4a12cb[_0x347b('0x10')][_0x347b('0x11')]===0x1f4){logger[_0x347b('0x10')](_0x347b('0xc'),_0x54d705,_0x4a12cb[_0x347b('0x10')][_0x347b('0x12')]);return _0x627e0e(_0x4a12cb[_0x347b('0x10')][_0x347b('0x12')]);}logger['error']('UserNotification,\x20%s,\x20%s',_0x54d705,_0x4a12cb[_0x347b('0x10')]['message']);return _0x32bc32(_0x4a12cb[_0x347b('0x10')][_0x347b('0x12')]);}else{logger[_0x347b('0xb')](_0x347b('0xc'),_0x54d705,_0x347b('0x13'));_0x32bc32(_0x4a12cb[_0x347b('0x14')]['message']);}})[_0x347b('0x15')](function(_0x4dc38c){logger['error']('UserNotification,\x20%s,\x20%s',_0x54d705,_0x4dc38c);_0x627e0e(_0x4dc38c);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 701f5c0..7ea24df 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 _0xb47e=['update','removeListener','register','length','userNotification:','./userNotification.events','save','remove'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xb47e,0x75));var _0xeb47=function(_0x2c06e8,_0x1347ce){_0x2c06e8=_0x2c06e8-0x0;var _0x5c6d82=_0xb47e[_0x2c06e8];return _0x5c6d82;};'use strict';var UserNotificationEvents=require(_0xeb47('0x0'));var events=[_0xeb47('0x1'),_0xeb47('0x2'),_0xeb47('0x3')];function createListener(_0x4793bd,_0x33591a){return function(_0x408cc8){_0x33591a['emit'](_0x4793bd,_0x408cc8);};}function removeListener(_0x4848da,_0x100001){return function(){UserNotificationEvents[_0xeb47('0x4')](_0x4848da,_0x100001);};}exports[_0xeb47('0x5')]=function(_0x465afb){for(var _0x46e674=0x0,_0x425e3c=events[_0xeb47('0x6')];_0x46e674<_0x425e3c;_0x46e674++){var _0x1d0e16=events[_0x46e674];var _0x504db6=createListener(_0xeb47('0x7')+_0x1d0e16,_0x465afb);UserNotificationEvents['on'](_0x1d0e16,_0x504db6);}}; \ No newline at end of file +var _0xce01=['userNotification:','./userNotification.events','remove','update','emit','removeListener','length'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xce01,0x1c8));var _0x1ce0=function(_0x31bf91,_0x3e79ef){_0x31bf91=_0x31bf91-0x0;var _0x4799a8=_0xce01[_0x31bf91];return _0x4799a8;};'use strict';var UserNotificationEvents=require(_0x1ce0('0x0'));var events=['save',_0x1ce0('0x1'),_0x1ce0('0x2')];function createListener(_0x2e304b,_0x23ecb7){return function(_0x52b5e0){_0x23ecb7[_0x1ce0('0x3')](_0x2e304b,_0x52b5e0);};}function removeListener(_0x5e44c3,_0x3a1c54){return function(){UserNotificationEvents[_0x1ce0('0x4')](_0x5e44c3,_0x3a1c54);};}exports['register']=function(_0x1631aa){for(var _0x1688d6=0x0,_0xe98a87=events[_0x1ce0('0x5')];_0x1688d6<_0xe98a87;_0x1688d6++){var _0x56c39c=events[_0x1688d6];var _0xb30177=createListener(_0x1ce0('0x6')+_0x56c39c,_0x1631aa);UserNotificationEvents['on'](_0x56c39c,_0xb30177);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 4e02475..6993d5e 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x475c37,_0x386f90){var _0x711fdc=function(_0x3a976e){while(--_0x3a976e){_0x475c37['push'](_0x475c37['shift']());}};_0x711fdc(++_0x386f90);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4b432a,_0x578c42){var _0x505158=function(_0x336497){while(--_0x336497){_0x4b432a['push'](_0x4b432a['shift']());}};_0x505158(++_0x578c42);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 926b24a..1647c6c 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 _0xd10b=['sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd10b,0x189));var _0xbd10=function(_0x41ee28,_0x347bc8){_0x41ee28=_0x41ee28-0x0;var _0x5bd895=_0xd10b[_0x41ee28];return _0x5bd895;};'use strict';var Sequelize=require(_0xbd10('0x0'));module[_0xbd10('0x1')]={'penalty':{'type':Sequelize[_0xbd10('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9378=['INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9378,0xa9));var _0x8937=function(_0x815f41,_0x4b82c9){_0x815f41=_0x815f41-0x0;var _0x1daa08=_0x9378[_0x815f41];return _0x1daa08;};'use strict';var Sequelize=require(_0x8937('0x0'));module[_0x8937('0x1')]={'penalty':{'type':Sequelize[_0x8937('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index f1366b0..8de5999 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 _0x8561=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger'];(function(_0x2f9495,_0x43251a){var _0x3fbe56=function(_0x29a2e0){while(--_0x29a2e0){_0x2f9495['push'](_0x2f9495['shift']());}};_0x3fbe56(++_0x43251a);}(_0x8561,0x8c));var _0x1856=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x8561[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x1856('0x0'));var util=require(_0x1856('0x1'));var logger=require(_0x1856('0x2'))(_0x1856('0x3'));var moment=require('moment');var BPromise=require(_0x1856('0x4'));var rp=require(_0x1856('0x5'));var fs=require('fs');var path=require(_0x1856('0x6'));var rimraf=require(_0x1856('0x7'));var config=require(_0x1856('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x1856('0x9')]=function(_0x23a994,_0x1e561){return _0x23a994[_0x1856('0xa')](_0x1856('0xb'),attributes,{'tableName':_0x1856('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e71=['api','bluebird','request-promise','../../config/environment','exports','define','UserOpenchannelQueue','lodash','util'];(function(_0x75ad68,_0xc75b2a){var _0x469c7d=function(_0x2feecf){while(--_0x2feecf){_0x75ad68['push'](_0x75ad68['shift']());}};_0x469c7d(++_0xc75b2a);}(_0x2e71,0x18a));var _0x12e7=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0x2e71[_0xd511d];return _0x3f148e;};'use strict';var _=require(_0x12e7('0x0'));var util=require(_0x12e7('0x1'));var logger=require('../../config/logger')(_0x12e7('0x2'));var moment=require('moment');var BPromise=require(_0x12e7('0x3'));var rp=require(_0x12e7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x12e7('0x5'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x12e7('0x6')]=function(_0x2c1f3a,_0x1b0ddc){return _0x2c1f3a[_0x12e7('0x7')](_0x12e7('0x8'),attributes,{'tableName':'user_has_openchannel_queues','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 0b19c96..316da59 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 _0xe940=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message'];(function(_0x905d0f,_0x17fc90){var _0x143c18=function(_0x4cbd5b){while(--_0x4cbd5b){_0x905d0f['push'](_0x905d0f['shift']());}};_0x143c18(++_0x17fc90);}(_0xe940,0x7a));var _0x0e94=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe940[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x0e94('0x0'));var util=require(_0x0e94('0x1'));var moment=require(_0x0e94('0x2'));var BPromise=require('bluebird');var rs=require(_0x0e94('0x3'));var fs=require('fs');var Redis=require(_0x0e94('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0e94('0x5'))(_0x0e94('0x6'));var config=require('../../config/environment');var jayson=require(_0x0e94('0x7'));var client=jayson[_0x0e94('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b947b,_0xeffee7,_0x218b1b){return new BPromise(function(_0x49b4dc,_0x5bf80c){return client[_0x0e94('0x9')](_0x5b947b,_0x218b1b)[_0x0e94('0xa')](function(_0x5b2882){logger[_0x0e94('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xeffee7,_0x0e94('0xc'));logger['debug'](_0x0e94('0xd'),_0xeffee7,_0x0e94('0xc'),JSON[_0x0e94('0xe')](_0x5b2882));if(_0x5b2882[_0x0e94('0xf')]){if(_0x5b2882[_0x0e94('0xf')]['code']===0x1f4){logger['error'](_0x0e94('0x10'),_0xeffee7,_0x5b2882['error'][_0x0e94('0x11')]);return _0x5bf80c(_0x5b2882['error']['message']);}logger['error'](_0x0e94('0x10'),_0xeffee7,_0x5b2882[_0x0e94('0xf')]['message']);return _0x49b4dc(_0x5b2882[_0x0e94('0xf')]['message']);}else{logger[_0x0e94('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xeffee7,_0x0e94('0xc'));_0x49b4dc(_0x5b2882[_0x0e94('0x12')][_0x0e94('0x11')]);}})[_0x0e94('0x13')](function(_0x2f9725){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0xeffee7,_0x2f9725);_0x5bf80c(_0x2f9725);});});} \ No newline at end of file +var _0x200f=['UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x254966,_0x161c54){var _0x41b23f=function(_0x2ce48b){while(--_0x2ce48b){_0x254966['push'](_0x254966['shift']());}};_0x41b23f(++_0x161c54);}(_0x200f,0xd9));var _0xf200=function(_0x2c8de4,_0x48ecd7){_0x2c8de4=_0x2c8de4-0x0;var _0xa5f1d5=_0x200f[_0x2c8de4];return _0xa5f1d5;};'use strict';var _=require(_0xf200('0x0'));var util=require(_0xf200('0x1'));var moment=require('moment');var BPromise=require(_0xf200('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf200('0x3'));var db=require(_0xf200('0x4'))['db'];var utils=require(_0xf200('0x5'));var logger=require('../../config/logger')(_0xf200('0x6'));var config=require(_0xf200('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf200('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1af002,_0x37d302,_0x35da10){return new BPromise(function(_0x5f3dbc,_0x41f6c6){return client['request'](_0x1af002,_0x35da10)[_0xf200('0x9')](function(_0x5b6325){logger[_0xf200('0xa')](_0xf200('0xb'),_0x37d302,_0xf200('0xc'));logger[_0xf200('0xd')](_0xf200('0xe'),_0x37d302,_0xf200('0xc'),JSON[_0xf200('0xf')](_0x5b6325));if(_0x5b6325[_0xf200('0x10')]){if(_0x5b6325[_0xf200('0x10')][_0xf200('0x11')]===0x1f4){logger['error'](_0xf200('0xb'),_0x37d302,_0x5b6325[_0xf200('0x10')][_0xf200('0x12')]);return _0x41f6c6(_0x5b6325['error'][_0xf200('0x12')]);}logger[_0xf200('0x10')](_0xf200('0xb'),_0x37d302,_0x5b6325[_0xf200('0x10')][_0xf200('0x12')]);return _0x5f3dbc(_0x5b6325['error'][_0xf200('0x12')]);}else{logger[_0xf200('0xa')](_0xf200('0xb'),_0x37d302,_0xf200('0xc'));_0x5f3dbc(_0x5b6325[_0xf200('0x13')][_0xf200('0x12')]);}})[_0xf200('0x14')](function(_0x1e3c0c){logger['error'](_0xf200('0xb'),_0x37d302,_0x1e3c0c);_0x41f6c6(_0x1e3c0c);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index f370e20..4541005 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 _0x1d63=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','/:id/clone','clone','addSections','addResources','put','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x5a9017,_0x4312fc){var _0x596e52=function(_0x35843d){while(--_0x35843d){_0x5a9017['push'](_0x5a9017['shift']());}};_0x596e52(++_0x4312fc);}(_0x1d63,0xba));var _0x31d6=function(_0x3380be,_0x4d04f7){_0x3380be=_0x3380be-0x0;var _0x296cd4=_0x1d63[_0x3380be];return _0x296cd4;};'use strict';var multer=require(_0x31d6('0x0'));var util=require(_0x31d6('0x1'));var path=require(_0x31d6('0x2'));var timeout=require(_0x31d6('0x3'));var express=require(_0x31d6('0x4'));var router=express['Router']();var fs_extra=require(_0x31d6('0x5'));var auth=require(_0x31d6('0x6'));var interaction=require(_0x31d6('0x7'));var config=require(_0x31d6('0x8'));var controller=require(_0x31d6('0x9'));router[_0x31d6('0xa')]('/',auth[_0x31d6('0xb')](),controller[_0x31d6('0xc')]);router[_0x31d6('0xa')](_0x31d6('0xd'),auth[_0x31d6('0xb')](),controller[_0x31d6('0xe')]);router['get'](_0x31d6('0xf'),auth['isAuthenticated'](),controller[_0x31d6('0x10')]);router[_0x31d6('0xa')](_0x31d6('0x11'),auth[_0x31d6('0xb')](),controller[_0x31d6('0x12')]);router[_0x31d6('0xa')](_0x31d6('0x13'),auth[_0x31d6('0xb')](),controller[_0x31d6('0x14')]);router[_0x31d6('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x31d6('0x15')](_0x31d6('0x16'),auth[_0x31d6('0xb')](),controller[_0x31d6('0x17')]);router[_0x31d6('0x15')](_0x31d6('0x11'),auth[_0x31d6('0xb')](),controller[_0x31d6('0x18')]);router['post']('/:id/resources',auth['isAuthenticated'](),controller[_0x31d6('0x19')]);router[_0x31d6('0x1a')]('/:id',auth[_0x31d6('0xb')](),controller['update']);router[_0x31d6('0x1b')](_0x31d6('0xf'),auth[_0x31d6('0xb')](),controller[_0x31d6('0x1c')]);router[_0x31d6('0x1b')]('/:id/sections',auth['isAuthenticated'](),controller[_0x31d6('0x1d')]);router[_0x31d6('0x1b')]('/:id/resources',auth['isAuthenticated'](),controller[_0x31d6('0x1e')]);module[_0x31d6('0x1f')]=router; \ No newline at end of file +var _0x4f22=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getSections','/:id/resources','post','create','/:id/clone','clone','/:id/sections','addResources','update','delete','destroy','removeSections','removeResources','exports'];(function(_0x7f8cf,_0x154885){var _0x2a9fb7=function(_0x203b36){while(--_0x203b36){_0x7f8cf['push'](_0x7f8cf['shift']());}};_0x2a9fb7(++_0x154885);}(_0x4f22,0xcb));var _0x24f2=function(_0x3fbf7e,_0x2f6235){_0x3fbf7e=_0x3fbf7e-0x0;var _0x23cd1d=_0x4f22[_0x3fbf7e];return _0x23cd1d;};'use strict';var multer=require(_0x24f2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x24f2('0x1'));var express=require(_0x24f2('0x2'));var router=express[_0x24f2('0x3')]();var fs_extra=require(_0x24f2('0x4'));var auth=require(_0x24f2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x24f2('0x6'));var controller=require(_0x24f2('0x7'));router[_0x24f2('0x8')]('/',auth['isAuthenticated'](),controller[_0x24f2('0x9')]);router[_0x24f2('0x8')](_0x24f2('0xa'),auth[_0x24f2('0xb')](),controller[_0x24f2('0xc')]);router[_0x24f2('0x8')](_0x24f2('0xd'),auth[_0x24f2('0xb')](),controller[_0x24f2('0xe')]);router[_0x24f2('0x8')]('/:id/sections',auth[_0x24f2('0xb')](),controller[_0x24f2('0xf')]);router[_0x24f2('0x8')](_0x24f2('0x10'),auth[_0x24f2('0xb')](),controller['getResources']);router[_0x24f2('0x11')]('/',auth[_0x24f2('0xb')](),controller[_0x24f2('0x12')]);router[_0x24f2('0x11')](_0x24f2('0x13'),auth[_0x24f2('0xb')](),controller[_0x24f2('0x14')]);router[_0x24f2('0x11')](_0x24f2('0x15'),auth[_0x24f2('0xb')](),controller['addSections']);router[_0x24f2('0x11')](_0x24f2('0x10'),auth[_0x24f2('0xb')](),controller[_0x24f2('0x16')]);router['put'](_0x24f2('0xd'),auth['isAuthenticated'](),controller[_0x24f2('0x17')]);router[_0x24f2('0x18')]('/:id',auth[_0x24f2('0xb')](),controller[_0x24f2('0x19')]);router[_0x24f2('0x18')](_0x24f2('0x15'),auth['isAuthenticated'](),controller[_0x24f2('0x1a')]);router[_0x24f2('0x18')](_0x24f2('0x10'),auth[_0x24f2('0xb')](),controller[_0x24f2('0x1b')]);module[_0x24f2('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index bc095cb..58e6c3f 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 _0x4a39=['split','BOOLEAN','sequelize','exports','STRING','setDataValue','join','getDataValue','crudPermissions'];(function(_0x2d747c,_0x851c49){var _0x2ac042=function(_0x2ffeb7){while(--_0x2ffeb7){_0x2d747c['push'](_0x2d747c['shift']());}};_0x2ac042(++_0x851c49);}(_0x4a39,0x197));var _0x94a3=function(_0x1fce14,_0x405c0a){_0x1fce14=_0x1fce14-0x0;var _0x1b9956=_0x4a39[_0x1fce14];return _0x1b9956;};'use strict';var Sequelize=require(_0x94a3('0x0'));module[_0x94a3('0x1')]={'name':{'type':Sequelize[_0x94a3('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x94a3('0x2')],'set':function(_0x3ba308){this[_0x94a3('0x3')]('crudPermissions',_0x3ba308?_0x3ba308[_0x94a3('0x4')](''):[]);},'get':function(){return this[_0x94a3('0x5')](_0x94a3('0x6'))?this[_0x94a3('0x5')]('crudPermissions')[_0x94a3('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x94a3('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x94a3('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x94a3('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x94a3('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x94a3('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x94a3('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xbb28=['setDataValue','crudPermissions','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xbb28,0x71));var _0x8bb2=function(_0xd766c,_0x46aaa5){_0xd766c=_0xd766c-0x0;var _0x3d7c0f=_0xbb28[_0xd766c];return _0x3d7c0f;};'use strict';var Sequelize=require(_0x8bb2('0x0'));module[_0x8bb2('0x1')]={'name':{'type':Sequelize[_0x8bb2('0x2')],'allowNull':![],'unique':_0x8bb2('0x3')},'crudPermissions':{'type':Sequelize[_0x8bb2('0x2')],'set':function(_0x2fba02){this[_0x8bb2('0x4')](_0x8bb2('0x5'),_0x2fba02?_0x2fba02['join'](''):[]);},'get':function(){return this[_0x8bb2('0x6')](_0x8bb2('0x5'))?this[_0x8bb2('0x6')](_0x8bb2('0x5'))[_0x8bb2('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x8bb2('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x8bb2('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8bb2('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x8bb2('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8bb2('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 8df59ce..027959f 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 _0x2250=['catch','params','length','find','create','body','clone','get','omit','updatedAt','crudPermissions','createdAt','sequelize','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','transaction','removeSections','ids','getSections','filter','enabled','isEmpty','includes','subsections','findOne','Dashboard','forEach','push','resourceId','Plugin','addResources','removeResources','getResources','section','Missing\x20section\x20parameter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','then','destroy','name','index','UserProfile','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','merge','map','type','VIRTUAL','options','includeAll','include','rows'];(function(_0x4e8620,_0x4c0f49){var _0x3e12af=function(_0x3c6826){while(--_0x3c6826){_0x4e8620['push'](_0x4e8620['shift']());}};_0x3e12af(++_0x4c0f49);}(_0x2250,0x178));var _0x0225=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x2250[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require(_0x0225('0x0'));var rimraf=require(_0x0225('0x1'));var zipdir=require(_0x0225('0x2'));var jsonpatch=require(_0x0225('0x3'));var rp=require(_0x0225('0x4'));var moment=require(_0x0225('0x5'));var BPromise=require(_0x0225('0x6'));var Mustache=require('mustache');var util=require(_0x0225('0x7'));var path=require(_0x0225('0x8'));var sox=require(_0x0225('0x9'));var csv=require(_0x0225('0xa'));var ejs=require(_0x0225('0xb'));var fs=require('fs');var fs_extra=require(_0x0225('0xc'));var _=require(_0x0225('0xd'));var squel=require(_0x0225('0xe'));var crypto=require('crypto');var jsforce=require(_0x0225('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0225('0x10'));var Papa=require(_0x0225('0x11'));var Redis=require(_0x0225('0x12'));var authService=require(_0x0225('0x13'));var qs=require(_0x0225('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0225('0x15'));var logger=require(_0x0225('0x16'))(_0x0225('0x17'));var utils=require(_0x0225('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0225('0x19'));var db=require('../../mysqldb')['db'];config[_0x0225('0x1a')]=_[_0x0225('0x1b')](config['redis'],{'host':_0x0225('0x1c'),'port':0x18eb});var socket=require(_0x0225('0x1d'))(new Redis(config[_0x0225('0x1a')]));require(_0x0225('0x1e'))[_0x0225('0x1f')](socket);function respondWithStatusCode(_0x1ec1a6,_0x21b398){_0x21b398=_0x21b398||0xcc;return function(_0x40e1e3){if(_0x40e1e3){return _0x1ec1a6[_0x0225('0x20')](_0x21b398);}return _0x1ec1a6[_0x0225('0x21')](_0x21b398)[_0x0225('0x22')]();};}function respondWithResult(_0x494722,_0x2d41d3){_0x2d41d3=_0x2d41d3||0xc8;return function(_0x8f179c){if(_0x8f179c){return _0x494722['status'](_0x2d41d3)[_0x0225('0x23')](_0x8f179c);}};}function respondWithFilteredResult(_0x4e3697,_0x431294){return function(_0x424b5b){if(_0x424b5b){var _0x27ab34=typeof _0x431294[_0x0225('0x24')]===_0x0225('0x25')&&typeof _0x431294['limit']===_0x0225('0x25');var _0x5538a0=_0x424b5b['count'];var _0x4bcccf=_0x27ab34?0x0:_0x431294[_0x0225('0x24')];var _0x46a72c=_0x27ab34?_0x424b5b[_0x0225('0x26')]:_0x431294[_0x0225('0x24')]+_0x431294[_0x0225('0x27')];var _0x4145ef;if(_0x46a72c>=_0x5538a0){_0x46a72c=_0x5538a0;_0x4145ef=0xc8;}else{_0x4145ef=0xce;}_0x4e3697[_0x0225('0x21')](_0x4145ef);return _0x4e3697['set'](_0x0225('0x28'),_0x4bcccf+'-'+_0x46a72c+'/'+_0x5538a0)[_0x0225('0x23')](_0x424b5b);}return null;};}function patchUpdates(_0x2e534b){return function(_0x4fd1bd){try{jsonpatch['apply'](_0x4fd1bd,_0x2e534b,!![]);}catch(_0xc825ef){return BPromise['reject'](_0xc825ef);}return _0x4fd1bd['save']();};}function saveUpdates(_0x4b59c0,_0x4b0fc3){return function(_0x9f5035){if(_0x9f5035){return _0x9f5035['update'](_0x4b59c0)[_0x0225('0x29')](function(_0xcb5384){return _0xcb5384;});}return null;};}function removeEntity(_0x29d209,_0x2a4b31){return function(_0x340552){if(_0x340552){return _0x340552[_0x0225('0x2a')]()[_0x0225('0x29')](function(){_0x29d209['status'](0xcc)[_0x0225('0x22')]();});}};}function handleEntityNotFound(_0xb193c5,_0xf52abb){return function(_0x32d45d){if(!_0x32d45d){_0xb193c5['sendStatus'](0x194);}return _0x32d45d;};}function handleError(_0x516374,_0x5ac249){_0x5ac249=_0x5ac249||0x1f4;return function(_0x1c44d5){logger['error'](_0x1c44d5['stack']);if(_0x1c44d5[_0x0225('0x2b')]){delete _0x1c44d5['name'];}_0x516374[_0x0225('0x21')](_0x5ac249)['send'](_0x1c44d5);};}exports[_0x0225('0x2c')]=function(_0x5f3ae2,_0x9b1a71){var _0x45ae3={},_0x3b793a={},_0x391aed={'count':0x0,'rows':[]};var _0x1353ff=_['map'](db[_0x0225('0x2d')][_0x0225('0x2e')],function(_0x437cd2){return{'name':_0x437cd2[_0x0225('0x2f')],'type':_0x437cd2['type'][_0x0225('0x30')]};});_0x3b793a[_0x0225('0x31')]=_['map'](_0x1353ff,_0x0225('0x2b'));_0x3b793a[_0x0225('0x32')]=_[_0x0225('0x33')](_0x5f3ae2[_0x0225('0x32')]);_0x3b793a[_0x0225('0x34')]=_[_0x0225('0x35')](_0x3b793a['model'],_0x3b793a[_0x0225('0x32')]);_0x45ae3['attributes']=_['intersection'](_0x3b793a[_0x0225('0x31')],qs['fields'](_0x5f3ae2['query'][_0x0225('0x36')]));_0x45ae3['attributes']=_0x45ae3[_0x0225('0x37')]['length']?_0x45ae3[_0x0225('0x37')]:_0x3b793a[_0x0225('0x31')];if(!_0x5f3ae2[_0x0225('0x32')]['hasOwnProperty'](_0x0225('0x38'))){_0x45ae3[_0x0225('0x27')]=qs[_0x0225('0x27')](_0x5f3ae2[_0x0225('0x32')][_0x0225('0x27')]);_0x45ae3[_0x0225('0x24')]=qs[_0x0225('0x24')](_0x5f3ae2[_0x0225('0x32')]['offset']);}_0x45ae3['order']=qs[_0x0225('0x39')](_0x5f3ae2[_0x0225('0x32')][_0x0225('0x39')]);_0x45ae3[_0x0225('0x3a')]=qs[_0x0225('0x34')](_[_0x0225('0x3b')](_0x5f3ae2[_0x0225('0x32')],_0x3b793a['filters']),_0x1353ff);if(_0x5f3ae2[_0x0225('0x32')]['filter']){_0x45ae3[_0x0225('0x3a')]=_[_0x0225('0x3c')](_0x45ae3[_0x0225('0x3a')],{'$or':_[_0x0225('0x3d')](_0x1353ff,function(_0x243a47){if(_0x243a47[_0x0225('0x3e')]!==_0x0225('0x3f')){var _0x48eb0a={};_0x48eb0a[_0x243a47[_0x0225('0x2b')]]={'$like':'%'+_0x5f3ae2['query']['filter']+'%'};return _0x48eb0a;}})});}_0x45ae3=_[_0x0225('0x3c')]({},_0x45ae3,_0x5f3ae2[_0x0225('0x40')]);var _0x3ff176={'where':_0x45ae3[_0x0225('0x3a')]};return db[_0x0225('0x2d')][_0x0225('0x26')](_0x3ff176)[_0x0225('0x29')](function(_0x3d1b18){_0x391aed[_0x0225('0x26')]=_0x3d1b18;if(_0x5f3ae2[_0x0225('0x32')][_0x0225('0x41')]){_0x45ae3[_0x0225('0x42')]=[{'all':!![]}];}return db[_0x0225('0x2d')]['findAll'](_0x45ae3);})[_0x0225('0x29')](function(_0x28cd94){_0x391aed[_0x0225('0x43')]=_0x28cd94;return _0x391aed;})[_0x0225('0x29')](respondWithFilteredResult(_0x9b1a71,_0x45ae3))[_0x0225('0x44')](handleError(_0x9b1a71,null));};exports['show']=function(_0x2908c0,_0x57f4f6){var _0x48280e={'raw':![],'where':{'id':_0x2908c0[_0x0225('0x45')]['id']}},_0x3f6a43={};_0x3f6a43[_0x0225('0x31')]=_[_0x0225('0x33')](db[_0x0225('0x2d')][_0x0225('0x2e')]);_0x3f6a43[_0x0225('0x32')]=_[_0x0225('0x33')](_0x2908c0[_0x0225('0x32')]);_0x3f6a43[_0x0225('0x34')]=_['intersection'](_0x3f6a43['model'],_0x3f6a43['query']);_0x48280e[_0x0225('0x37')]=_[_0x0225('0x35')](_0x3f6a43[_0x0225('0x31')],qs[_0x0225('0x36')](_0x2908c0[_0x0225('0x32')][_0x0225('0x36')]));_0x48280e[_0x0225('0x37')]=_0x48280e[_0x0225('0x37')][_0x0225('0x46')]?_0x48280e[_0x0225('0x37')]:_0x3f6a43['model'];if(_0x2908c0['query'][_0x0225('0x41')]){_0x48280e[_0x0225('0x42')]=[{'all':!![]}];}_0x48280e=_[_0x0225('0x3c')]({},_0x48280e,_0x2908c0['options']);return db[_0x0225('0x2d')][_0x0225('0x47')](_0x48280e)[_0x0225('0x29')](handleEntityNotFound(_0x57f4f6,null))['then'](respondWithResult(_0x57f4f6,null))[_0x0225('0x44')](handleError(_0x57f4f6,null));};exports[_0x0225('0x48')]=function(_0x1a2bec,_0x5dbaaf){return db[_0x0225('0x2d')][_0x0225('0x48')](_0x1a2bec[_0x0225('0x49')],{})[_0x0225('0x29')](respondWithResult(_0x5dbaaf,0xc9))[_0x0225('0x44')](handleError(_0x5dbaaf,null));};exports[_0x0225('0x4a')]=function(_0x4a90d5,_0x1b8d97){var _0x50afa1={'where':{'id':_0x4a90d5[_0x0225('0x45')]['id']}},_0x522100={};_0x522100[_0x0225('0x31')]=_['keys'](db['UserProfile'][_0x0225('0x2e')]);_0x50afa1[_0x0225('0x37')]=_[_0x0225('0x35')](_0x522100[_0x0225('0x31')],qs['fields'](_0x4a90d5[_0x0225('0x32')][_0x0225('0x36')]));_0x50afa1[_0x0225('0x37')]=_0x50afa1[_0x0225('0x37')][_0x0225('0x46')]?_0x50afa1[_0x0225('0x37')]:_0x522100['model'];if(_0x4a90d5[_0x0225('0x32')][_0x0225('0x41')]){_0x50afa1['include']=[{'all':!![]}];}_0x50afa1=_['merge']({},_0x50afa1,_0x4a90d5[_0x0225('0x40')]);return db[_0x0225('0x2d')][_0x0225('0x47')](_0x50afa1)[_0x0225('0x29')](handleEntityNotFound(_0x1b8d97,null))[_0x0225('0x29')](function(_0x3a435c){if(_0x3a435c){var _0x224ca0=_0x3a435c[_0x0225('0x4b')]({'plain':!![]});_0x224ca0=qs[_0x0225('0x4c')](_0x224ca0,['id','createdAt',_0x0225('0x4d'),_0x0225('0x4e')]);_0x4a90d5[_0x0225('0x49')]=_[_0x0225('0x4c')](_0x4a90d5[_0x0225('0x49')],['id',_0x0225('0x4f'),'updatedAt']);return db[_0x0225('0x50')]['transaction'](function(_0x1909eb){return db['UserProfile'][_0x0225('0x48')](_[_0x0225('0x3c')](_0x224ca0,_0x4a90d5[_0x0225('0x49')]),{'include':_0x4a90d5['query'][_0x0225('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x1909eb})[_0x0225('0x29')](function(_0xa82441){var _0x55174c=_0xa82441[_0x0225('0x4b')]({'plain':!![]});return db[_0x0225('0x51')][_0x0225('0x52')]({'where':{'userProfileId':_0x4a90d5[_0x0225('0x45')]['id']},'raw':!![]})[_0x0225('0x29')](function(_0x34ac17){if(_0x34ac17){return BPromise[_0x0225('0x53')](_0x34ac17,function(_0x2a7c7f){return new BPromise(function(_0x228459,_0x46dd77){if(_0x2a7c7f[_0x0225('0x54')]===null||_0x2a7c7f[_0x0225('0x54')]===0x1)_0x228459(null);return db[_0x0225('0x55')]['findAll']({'where':{'sectionId':_0x2a7c7f['id']},'raw':!![]})['then'](function(_0x6a743d){var _0x9470ce=_[_0x0225('0x3d')](_0x6a743d,function(_0x4d2e1c){return qs[_0x0225('0x4c')](_0x4d2e1c,['id',_0x0225('0x4f'),_0x0225('0x4d'),_0x0225('0x56')]);});_0x228459(_0x9470ce);})[_0x0225('0x44')](function(_0x46bbd8){_0x46dd77(_0x46bbd8);});})['then'](function(_0x49a25b){var _0x210d42=qs[_0x0225('0x4c')](_0x2a7c7f,['id','createdAt','updatedAt']);_0x210d42[_0x0225('0x57')]=_0x55174c['id'];if(_0x49a25b)_0x210d42[_0x0225('0x58')]=_0x49a25b;return _0x210d42;})['then'](function(_0x1077cf){return db['UserProfileSection'][_0x0225('0x48')](_0x1077cf,{'include':[{'model':db[_0x0225('0x55')],'as':_0x0225('0x58')}],'raw':!![],'transaction':_0x1909eb});});})[_0x0225('0x29')](function(){return _0x55174c;});}});});});}})[_0x0225('0x29')](respondWithResult(_0x1b8d97,0xc9))['catch'](handleError(_0x1b8d97,null));};exports['update']=function(_0x4b1b2f,_0x23c521){if(_0x4b1b2f[_0x0225('0x49')]['id']){delete _0x4b1b2f['body']['id'];}return db[_0x0225('0x2d')][_0x0225('0x47')]({'where':{'id':_0x4b1b2f['params']['id']}})[_0x0225('0x29')](handleEntityNotFound(_0x23c521,null))[_0x0225('0x29')](saveUpdates(_0x4b1b2f[_0x0225('0x49')],null))['then'](respondWithResult(_0x23c521,null))['catch'](handleError(_0x23c521,null));};exports[_0x0225('0x2a')]=function(_0x361df1,_0x493228){return db[_0x0225('0x2d')][_0x0225('0x47')]({'where':{'id':_0x361df1[_0x0225('0x45')]['id']}})[_0x0225('0x29')](handleEntityNotFound(_0x493228,null))[_0x0225('0x29')](removeEntity(_0x493228,null))[_0x0225('0x44')](handleError(_0x493228,null));};exports[_0x0225('0x59')]=function(_0x16918f,_0x1bd7df){return db[_0x0225('0x2d')][_0x0225('0x59')]()[_0x0225('0x29')](respondWithResult(_0x1bd7df,null))[_0x0225('0x44')](handleError(_0x1bd7df,null));};exports[_0x0225('0x5a')]=function(_0x36812d,_0xa3159b){var _0x46851e=_0x36812d[_0x0225('0x49')];return db['UserProfile']['find']({'where':{'id':_0x36812d[_0x0225('0x45')]['id']}})[_0x0225('0x29')](handleEntityNotFound(_0xa3159b,null))[_0x0225('0x29')](function(_0x569673){if(_0x569673){return db[_0x0225('0x50')][_0x0225('0x5b')](function(_0x5054b6){return db[_0x0225('0x51')][_0x0225('0x2a')]({'where':{'userProfileId':_0x36812d[_0x0225('0x45')]['id'],'sectionId':_[_0x0225('0x3d')](_0x46851e,function(_0x3be16f){return _0x3be16f[_0x0225('0x56')];})},'transaction':_0x5054b6})['then'](function(){var _0x2ab2c9=_[_0x0225('0x3d')](_0x46851e,function(_0x6070fb){_0x6070fb['userProfileId']=_0x36812d[_0x0225('0x45')]['id'];return _0x6070fb;});var _0x1109cd=[];return BPromise[_0x0225('0x53')](_0x2ab2c9,function(_0x2cfb61){return db[_0x0225('0x51')]['create'](_0x2cfb61,{'include':[{'model':db[_0x0225('0x55')],'as':'Resources'}],'raw':!![],'transaction':_0x5054b6})['then'](function(_0x54a4df){_0x1109cd['push'](_0x54a4df[_0x0225('0x4b')]({'plain':!![]}));});})[_0x0225('0x29')](function(){return _0x1109cd;});});});}})[_0x0225('0x29')](function(_0x5c3215){return _0x5c3215;})[_0x0225('0x29')](respondWithResult(_0xa3159b,null))[_0x0225('0x44')](handleError(_0xa3159b,null));};exports[_0x0225('0x5c')]=function(_0xa9935a,_0x52d029){var _0x422fd8;return db[_0x0225('0x2d')][_0x0225('0x47')]({'where':{'id':_0xa9935a[_0x0225('0x45')]['id']},'attributes':['id',_0x0225('0x2b')]})[_0x0225('0x29')](handleEntityNotFound(_0x52d029,null))[_0x0225('0x29')](function(_0x4cfcc7){if(_0x4cfcc7){_0x422fd8=_0x4cfcc7;return db[_0x0225('0x51')][_0x0225('0x2a')]({'where':{'userProfileId':_0xa9935a[_0x0225('0x45')]['id'],'sectionId':_0xa9935a[_0x0225('0x32')][_0x0225('0x5d')]}});}})[_0x0225('0x29')](function(){return _0x422fd8;})['then'](respondWithStatusCode(_0x52d029,null))['catch'](handleError(_0x52d029,null));};exports[_0x0225('0x5e')]=function(_0x30437d,_0x2c4b2b){var _0x452356=[];var _0x580cd6=[];return db[_0x0225('0x51')][_0x0225('0x52')]({'where':{'userProfileId':_0x30437d[_0x0225('0x45')]['id']},'raw':!![]})[_0x0225('0x29')](function(_0x11181d){_0x452356=_[_0x0225('0x5f')](_0x11181d,function(_0x56c48f){return _0x56c48f[_0x0225('0x60')]===0x1||_['includes']([0x3eb,0x709],_0x56c48f['sectionId']);});if(!_[_0x0225('0x61')](_0x452356)){return _[_0x0225('0x3d')](_0x452356,function(_0x4b1198){return _0x4b1198[_0x0225('0x56')];});}else{return;}})[_0x0225('0x29')](function(_0x48e216){if(_0x48e216)_0x580cd6=_0x48e216;if(_[_0x0225('0x62')](_0x580cd6,0x64)){var _0x1f09d1=_[_0x0225('0x47')](_0x452356,{'sectionId':0x64});return hasDefaultDashboard(_0x1f09d1)[_0x0225('0x29')](function(_0x2680de){return _[_0x0225('0x3d')](_0x452356,function(_0x9048ed){if(_0x9048ed[_0x0225('0x56')]===0x64){_0x9048ed[_0x0225('0x63')]=_0x2680de;}return _0x9048ed;});});}else{return;}})[_0x0225('0x29')](function(_0x37e067){if(_0x37e067)_0x452356=_0x37e067;if(_[_0x0225('0x62')](_0x580cd6,0x3eb)){var _0x37a1de=_[_0x0225('0x47')](_0x452356,{'sectionId':0x3eb});return getCustomDashboards(_0x37a1de)[_0x0225('0x29')](function(_0x28d9f1){return _['map'](_0x452356,function(_0x2f76ce){if(_0x37a1de[_0x0225('0x60')]){if(_0x2f76ce[_0x0225('0x56')]===0x3eb){_0x2f76ce['subsections']=_0x28d9f1;}}else{if(_0x2f76ce[_0x0225('0x56')]===0x64){_0x2f76ce[_0x0225('0x63')]=_0x28d9f1;}}return _0x2f76ce;});});}else{return;}})[_0x0225('0x29')](function(_0x4095f9){if(_0x4095f9)_0x452356=_0x4095f9;if(_[_0x0225('0x62')](_0x580cd6,0x709)){var _0x5f22e5=_[_0x0225('0x47')](_0x452356,{'sectionId':0x709});return getPlugins(_0x5f22e5)[_0x0225('0x29')](function(_0x58eaa8){if(_0x5f22e5[_0x0225('0x60')]){return _[_0x0225('0x3d')](_0x452356,function(_0x18e4b4){if(_0x18e4b4[_0x0225('0x56')]===0x709){_0x18e4b4[_0x0225('0x63')]=_0x58eaa8;}return _0x18e4b4;});}else{var _0x4dcca9={'sectionId':0x76c,'enabled':0x1,'subsections':_0x58eaa8};var _0x3a65ae=_[_0x0225('0x3d')](_0x452356);_0x3a65ae['push'](_0x4dcca9);return _0x3a65ae;}});}else{return;}})['then'](function(_0x408ec8){if(_0x408ec8)_0x452356=_0x408ec8;return _[_0x0225('0x5f')](_0x452356,['enabled',0x1]);})[_0x0225('0x29')](respondWithResult(_0x2c4b2b,null))[_0x0225('0x44')](handleError(_0x2c4b2b,null));};function hasDefaultDashboard(_0x28b588){var _0xc1ebf6=[0x65];return new BPromise(function(_0x11f54f,_0x56b936){try{if(_0x28b588['autoAssociation']){_0x11f54f(_0xc1ebf6);}else{return db['UserProfileResource'][_0x0225('0x64')]({'where':{'sectionId':_0x28b588['id']},'raw':!![]})[_0x0225('0x29')](function(_0x37f0ba){_0x37f0ba?_0x11f54f(_0xc1ebf6):_0x11f54f();});}}catch(_0x188df6){_0x56b936(_0x188df6);}});}function getCustomDashboards(_0x40c61f){var _0x1e75f0=[];return new BPromise(function(_0x46d280,_0x40cd4a){try{if(_0x40c61f[_0x0225('0x54')]){return db[_0x0225('0x65')][_0x0225('0x52')]({'raw':!![]})[_0x0225('0x29')](function(_0x38f8a8){_0x38f8a8[_0x0225('0x66')](function(_0x28c8bb){_0x1e75f0[_0x0225('0x67')](_0x28c8bb['id']+0x1869f);});_0x46d280(_0x1e75f0);});}else{return db['UserProfileResource'][_0x0225('0x52')]({'where':{'sectionId':_0x40c61f['id']},'raw':!![]})['then'](function(_0x2635de){_0x2635de[_0x0225('0x66')](function(_0x4313ed){_0x1e75f0['push'](_0x4313ed[_0x0225('0x68')]+0x1869f);});_0x46d280(_0x1e75f0);});}}catch(_0x14f3de){_0x40cd4a(_0x14f3de);}});}function getPlugins(_0x4526eb){var _0x2f929b=[];return new BPromise(function(_0x599fd1,_0x557fe9){try{if(_0x4526eb[_0x0225('0x54')]){return db[_0x0225('0x69')]['findAll']({'raw':!![]})[_0x0225('0x29')](function(_0x327183){_0x327183[_0x0225('0x66')](function(_0x41d3a9){_0x2f929b['push'](_0x41d3a9['id']+0x15b38);});_0x599fd1(_0x2f929b);});}else{return db[_0x0225('0x55')][_0x0225('0x52')]({'where':{'sectionId':_0x4526eb['id']},'raw':!![]})['then'](function(_0x27296f){_0x27296f['forEach'](function(_0x179cc4){_0x2f929b[_0x0225('0x67')](_0x179cc4[_0x0225('0x68')]+0x15b38);});_0x599fd1(_0x2f929b);});}}catch(_0x2eabd4){_0x557fe9(_0x2eabd4);}});}exports[_0x0225('0x6a')]=function(_0x44545d,_0x1edbc2){return db[_0x0225('0x2d')][_0x0225('0x47')]({'where':{'id':_0x44545d[_0x0225('0x45')]['id']}})[_0x0225('0x29')](handleEntityNotFound(_0x1edbc2,null))[_0x0225('0x29')](function(_0x313031){if(_0x313031){return db[_0x0225('0x50')][_0x0225('0x5b')](function(_0xf8b6fe){return db[_0x0225('0x51')][_0x0225('0x52')]({'where':{'userProfileId':_0x44545d[_0x0225('0x45')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x28c5c){if(_0x28c5c){return db[_0x0225('0x51')]['destroy']({'where':{'userProfileId':_0x44545d[_0x0225('0x45')]['id'],'id':_['map'](_0x28c5c,function(_0x22caf9){return _0x22caf9['id'];})},'transaction':_0xf8b6fe});}})[_0x0225('0x29')](function(_0x10e6c2){var _0x393dbc=_[_0x0225('0x3d')](_0x44545d[_0x0225('0x49')],function(_0x247606){_0x247606[_0x0225('0x57')]=_0x44545d['params']['id'];return _0x247606;});return db[_0x0225('0x51')]['bulkCreate'](_0x393dbc,{'raw':!![],'transaction':_0xf8b6fe});})[_0x0225('0x29')](function(_0x55448e){var _0x33cfa1=_['filter'](_[_0x0225('0x3d')](_0x55448e,function(_0x54f2de){return _0x54f2de['get']({'plain':!![]});}),{'includeAll':![]});if(_0x33cfa1){return db[_0x0225('0x51')]['findAll']({'where':{'userProfileId':_0x44545d[_0x0225('0x45')]['id'],'sectionId':_[_0x0225('0x3d')](_0x33cfa1,function(_0x410775){return _0x410775[_0x0225('0x56')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x0225('0x29')](function(_0x41ca2f){var _0x9f1621=_['map'](_0x44545d[_0x0225('0x49')],function(_0x57bf69){_0x57bf69[_0x0225('0x57')]=_0x44545d[_0x0225('0x45')]['id'];return _0x57bf69;});return db[_0x0225('0x55')]['bulkCreate'](_0x9f1621,{'raw':!![],'transaction':_0xf8b6fe});});}})['catch'](handleError(_0x1edbc2,null));});}})[_0x0225('0x29')](function(_0x582a77){var _0x34c4b9=_[_0x0225('0x3d')](_0x582a77,function(_0x2c272a){return _0x2c272a[_0x0225('0x4b')]({'plain':!![]});});})[_0x0225('0x29')](respondWithResult(_0x1edbc2,null))[_0x0225('0x44')](handleError(_0x1edbc2,null));};exports[_0x0225('0x6b')]=function(_0x50f4b0,_0x180987,_0x3da9c8){return db[_0x0225('0x2d')][_0x0225('0x47')]({'where':{'id':_0x50f4b0[_0x0225('0x45')]['id']}})[_0x0225('0x29')](handleEntityNotFound(_0x180987,null))['then'](function(_0x59b531){if(_0x59b531){return _0x59b531[_0x0225('0x6b')](_0x50f4b0['query'][_0x0225('0x5d')]);}})[_0x0225('0x29')](respondWithStatusCode(_0x180987,null))['catch'](handleError(_0x180987,null));};exports[_0x0225('0x6c')]=function(_0x22d17d,_0x174baf){var _0x338cfe={};if(!_0x22d17d[_0x0225('0x32')][_0x0225('0x6d')])throw new Error(_0x0225('0x6e'));if(!_0x22d17d['query']['hasOwnProperty'](_0x0225('0x38'))){_0x338cfe['limit']=qs['limit'](_0x22d17d[_0x0225('0x32')][_0x0225('0x27')]);_0x338cfe[_0x0225('0x24')]=qs[_0x0225('0x24')](_0x22d17d[_0x0225('0x32')]['offset']);}return db[_0x0225('0x2d')][_0x0225('0x47')]({'where':{'id':_0x22d17d[_0x0225('0x45')]['id']}})[_0x0225('0x29')](function(_0x37ea1a){if(!_0x37ea1a)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x22d17d['params']['id']);return db[_0x0225('0x2d')][_0x0225('0x6c')](_0x22d17d);})[_0x0225('0x29')](respondWithFilteredResult(_0x174baf,_0x338cfe))['catch'](handleError(_0x174baf,null));}; \ No newline at end of file +var _0x96d8=['removeResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','localhost','redis','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','error','stack','name','send','index','UserProfile','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','where','VIRTUAL','merge','options','then','includeAll','findAll','rows','catch','params','include','find','create','body','clone','rawAttributes','get','omit','updatedAt','createdAt','sequelize','UserProfileResource','sectionId','userProfileId','Resources','update','describe','addSections','UserProfileSection','destroy','each','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','autoAssociation','Plugin','addResources','bulkCreate'];(function(_0x5d0609,_0x127562){var _0xaa3fd1=function(_0x47f457){while(--_0x47f457){_0x5d0609['push'](_0x5d0609['shift']());}};_0xaa3fd1(++_0x127562);}(_0x96d8,0x1e2));var _0x896d=function(_0x2effc4,_0x47be55){_0x2effc4=_0x2effc4-0x0;var _0x5c206b=_0x96d8[_0x2effc4];return _0x5c206b;};'use strict';var emlformat=require(_0x896d('0x0'));var rimraf=require(_0x896d('0x1'));var zipdir=require(_0x896d('0x2'));var jsonpatch=require(_0x896d('0x3'));var rp=require(_0x896d('0x4'));var moment=require(_0x896d('0x5'));var BPromise=require(_0x896d('0x6'));var Mustache=require(_0x896d('0x7'));var util=require(_0x896d('0x8'));var path=require(_0x896d('0x9'));var sox=require(_0x896d('0xa'));var csv=require(_0x896d('0xb'));var ejs=require(_0x896d('0xc'));var fs=require('fs');var fs_extra=require(_0x896d('0xd'));var _=require('lodash');var squel=require(_0x896d('0xe'));var crypto=require(_0x896d('0xf'));var jsforce=require(_0x896d('0x10'));var deskjs=require(_0x896d('0x11'));var toCsv=require(_0x896d('0xb'));var querystring=require(_0x896d('0x12'));var Papa=require(_0x896d('0x13'));var Redis=require(_0x896d('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x896d('0x15'));var as=require(_0x896d('0x16'));var hardwareService=require(_0x896d('0x17'));var logger=require(_0x896d('0x18'))(_0x896d('0x19'));var utils=require('../../config/utils');var config=require(_0x896d('0x1a'));var licenseUtil=require(_0x896d('0x1b'));var db=require(_0x896d('0x1c'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x896d('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x896d('0x1e')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x10cf46,_0x10d472){_0x10d472=_0x10d472||0xcc;return function(_0x5a3674){if(_0x5a3674){return _0x10cf46[_0x896d('0x1f')](_0x10d472);}return _0x10cf46[_0x896d('0x20')](_0x10d472)[_0x896d('0x21')]();};}function respondWithResult(_0x332eba,_0x1cd959){_0x1cd959=_0x1cd959||0xc8;return function(_0x28514a){if(_0x28514a){return _0x332eba[_0x896d('0x20')](_0x1cd959)[_0x896d('0x22')](_0x28514a);}};}function respondWithFilteredResult(_0x28be1e,_0x50c5ff){return function(_0x34732b){if(_0x34732b){var _0x26d64e=typeof _0x50c5ff['offset']===_0x896d('0x23')&&typeof _0x50c5ff[_0x896d('0x24')]===_0x896d('0x23');var _0x598cd9=_0x34732b[_0x896d('0x25')];var _0x446838=_0x26d64e?0x0:_0x50c5ff[_0x896d('0x26')];var _0xa41442=_0x26d64e?_0x34732b['count']:_0x50c5ff[_0x896d('0x26')]+_0x50c5ff[_0x896d('0x24')];var _0x3e626a;if(_0xa41442>=_0x598cd9){_0xa41442=_0x598cd9;_0x3e626a=0xc8;}else{_0x3e626a=0xce;}_0x28be1e[_0x896d('0x20')](_0x3e626a);return _0x28be1e[_0x896d('0x27')](_0x896d('0x28'),_0x446838+'-'+_0xa41442+'/'+_0x598cd9)[_0x896d('0x22')](_0x34732b);}return null;};}function patchUpdates(_0x235bbc){return function(_0xdf2542){try{jsonpatch[_0x896d('0x29')](_0xdf2542,_0x235bbc,!![]);}catch(_0x4c8264){return BPromise[_0x896d('0x2a')](_0x4c8264);}return _0xdf2542[_0x896d('0x2b')]();};}function saveUpdates(_0x2d550c,_0xcd926){return function(_0x262e6a){if(_0x262e6a){return _0x262e6a['update'](_0x2d550c)['then'](function(_0x1ed355){return _0x1ed355;});}return null;};}function removeEntity(_0x5acbea,_0x49985f){return function(_0x46e762){if(_0x46e762){return _0x46e762['destroy']()['then'](function(){_0x5acbea[_0x896d('0x20')](0xcc)[_0x896d('0x21')]();});}};}function handleEntityNotFound(_0x36a04e,_0x2a58a4){return function(_0x2b3d4){if(!_0x2b3d4){_0x36a04e[_0x896d('0x1f')](0x194);}return _0x2b3d4;};}function handleError(_0x1428a3,_0x5ecab6){_0x5ecab6=_0x5ecab6||0x1f4;return function(_0x390b16){logger[_0x896d('0x2c')](_0x390b16[_0x896d('0x2d')]);if(_0x390b16[_0x896d('0x2e')]){delete _0x390b16['name'];}_0x1428a3[_0x896d('0x20')](_0x5ecab6)[_0x896d('0x2f')](_0x390b16);};}exports[_0x896d('0x30')]=function(_0xc97104,_0x221545){var _0xfb9d38={},_0x469f1f={},_0x4aa97b={'count':0x0,'rows':[]};var _0x5bf090=_['map'](db[_0x896d('0x31')]['rawAttributes'],function(_0xde98cb){return{'name':_0xde98cb[_0x896d('0x32')],'type':_0xde98cb[_0x896d('0x33')][_0x896d('0x34')]};});_0x469f1f['model']=_[_0x896d('0x35')](_0x5bf090,_0x896d('0x2e'));_0x469f1f[_0x896d('0x36')]=_[_0x896d('0x37')](_0xc97104[_0x896d('0x36')]);_0x469f1f[_0x896d('0x38')]=_[_0x896d('0x39')](_0x469f1f[_0x896d('0x3a')],_0x469f1f[_0x896d('0x36')]);_0xfb9d38[_0x896d('0x3b')]=_[_0x896d('0x39')](_0x469f1f[_0x896d('0x3a')],qs[_0x896d('0x3c')](_0xc97104['query'][_0x896d('0x3c')]));_0xfb9d38[_0x896d('0x3b')]=_0xfb9d38['attributes'][_0x896d('0x3d')]?_0xfb9d38[_0x896d('0x3b')]:_0x469f1f[_0x896d('0x3a')];if(!_0xc97104['query']['hasOwnProperty'](_0x896d('0x3e'))){_0xfb9d38[_0x896d('0x24')]=qs[_0x896d('0x24')](_0xc97104['query'][_0x896d('0x24')]);_0xfb9d38[_0x896d('0x26')]=qs[_0x896d('0x26')](_0xc97104[_0x896d('0x36')][_0x896d('0x26')]);}_0xfb9d38[_0x896d('0x3f')]=qs[_0x896d('0x40')](_0xc97104[_0x896d('0x36')][_0x896d('0x40')]);_0xfb9d38['where']=qs['filters'](_['pick'](_0xc97104[_0x896d('0x36')],_0x469f1f[_0x896d('0x38')]),_0x5bf090);if(_0xc97104[_0x896d('0x36')][_0x896d('0x41')]){_0xfb9d38['where']=_['merge'](_0xfb9d38[_0x896d('0x42')],{'$or':_[_0x896d('0x35')](_0x5bf090,function(_0x4f32d7){if(_0x4f32d7['type']!==_0x896d('0x43')){var _0x416180={};_0x416180[_0x4f32d7['name']]={'$like':'%'+_0xc97104[_0x896d('0x36')][_0x896d('0x41')]+'%'};return _0x416180;}})});}_0xfb9d38=_[_0x896d('0x44')]({},_0xfb9d38,_0xc97104[_0x896d('0x45')]);var _0x4419cf={'where':_0xfb9d38[_0x896d('0x42')]};return db['UserProfile']['count'](_0x4419cf)[_0x896d('0x46')](function(_0x698a1d){_0x4aa97b[_0x896d('0x25')]=_0x698a1d;if(_0xc97104['query'][_0x896d('0x47')]){_0xfb9d38['include']=[{'all':!![]}];}return db[_0x896d('0x31')][_0x896d('0x48')](_0xfb9d38);})[_0x896d('0x46')](function(_0x4a4c90){_0x4aa97b[_0x896d('0x49')]=_0x4a4c90;return _0x4aa97b;})[_0x896d('0x46')](respondWithFilteredResult(_0x221545,_0xfb9d38))[_0x896d('0x4a')](handleError(_0x221545,null));};exports['show']=function(_0x209f35,_0x519151){var _0x13bdee={'raw':![],'where':{'id':_0x209f35[_0x896d('0x4b')]['id']}},_0x241685={};_0x241685[_0x896d('0x3a')]=_[_0x896d('0x37')](db[_0x896d('0x31')]['rawAttributes']);_0x241685[_0x896d('0x36')]=_[_0x896d('0x37')](_0x209f35[_0x896d('0x36')]);_0x241685['filters']=_[_0x896d('0x39')](_0x241685['model'],_0x241685[_0x896d('0x36')]);_0x13bdee['attributes']=_[_0x896d('0x39')](_0x241685[_0x896d('0x3a')],qs[_0x896d('0x3c')](_0x209f35[_0x896d('0x36')][_0x896d('0x3c')]));_0x13bdee[_0x896d('0x3b')]=_0x13bdee[_0x896d('0x3b')][_0x896d('0x3d')]?_0x13bdee[_0x896d('0x3b')]:_0x241685[_0x896d('0x3a')];if(_0x209f35[_0x896d('0x36')][_0x896d('0x47')]){_0x13bdee[_0x896d('0x4c')]=[{'all':!![]}];}_0x13bdee=_[_0x896d('0x44')]({},_0x13bdee,_0x209f35[_0x896d('0x45')]);return db['UserProfile'][_0x896d('0x4d')](_0x13bdee)[_0x896d('0x46')](handleEntityNotFound(_0x519151,null))[_0x896d('0x46')](respondWithResult(_0x519151,null))[_0x896d('0x4a')](handleError(_0x519151,null));};exports[_0x896d('0x4e')]=function(_0x46d25c,_0x1a14aa){return db[_0x896d('0x31')][_0x896d('0x4e')](_0x46d25c[_0x896d('0x4f')],{})[_0x896d('0x46')](respondWithResult(_0x1a14aa,0xc9))[_0x896d('0x4a')](handleError(_0x1a14aa,null));};exports[_0x896d('0x50')]=function(_0x16372c,_0x58e5a4){var _0x4c3651={'where':{'id':_0x16372c[_0x896d('0x4b')]['id']}},_0x42a187={};_0x42a187['model']=_[_0x896d('0x37')](db[_0x896d('0x31')][_0x896d('0x51')]);_0x4c3651['attributes']=_[_0x896d('0x39')](_0x42a187[_0x896d('0x3a')],qs['fields'](_0x16372c[_0x896d('0x36')][_0x896d('0x3c')]));_0x4c3651[_0x896d('0x3b')]=_0x4c3651[_0x896d('0x3b')][_0x896d('0x3d')]?_0x4c3651['attributes']:_0x42a187[_0x896d('0x3a')];if(_0x16372c[_0x896d('0x36')][_0x896d('0x47')]){_0x4c3651['include']=[{'all':!![]}];}_0x4c3651=_[_0x896d('0x44')]({},_0x4c3651,_0x16372c[_0x896d('0x45')]);return db[_0x896d('0x31')][_0x896d('0x4d')](_0x4c3651)[_0x896d('0x46')](handleEntityNotFound(_0x58e5a4,null))[_0x896d('0x46')](function(_0x50d040){if(_0x50d040){var _0x7a4d5f=_0x50d040[_0x896d('0x52')]({'plain':!![]});_0x7a4d5f=qs[_0x896d('0x53')](_0x7a4d5f,['id','createdAt',_0x896d('0x54'),'crudPermissions']);_0x16372c[_0x896d('0x4f')]=_[_0x896d('0x53')](_0x16372c[_0x896d('0x4f')],['id',_0x896d('0x55'),_0x896d('0x54')]);return db[_0x896d('0x56')]['transaction'](function(_0x5c47ea){return db[_0x896d('0x31')][_0x896d('0x4e')](_['merge'](_0x7a4d5f,_0x16372c['body']),{'include':_0x16372c['query'][_0x896d('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x5c47ea})['then'](function(_0x2c32ee){var _0x4fce76=_0x2c32ee[_0x896d('0x52')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x16372c[_0x896d('0x4b')]['id']},'raw':!![]})[_0x896d('0x46')](function(_0x2d8f18){if(_0x2d8f18){return BPromise['each'](_0x2d8f18,function(_0x1fae73){return new BPromise(function(_0x23503b,_0x3de1a3){if(_0x1fae73['autoAssociation']===null||_0x1fae73['autoAssociation']===0x1)_0x23503b(null);return db[_0x896d('0x57')][_0x896d('0x48')]({'where':{'sectionId':_0x1fae73['id']},'raw':!![]})[_0x896d('0x46')](function(_0x4fea65){var _0x32f46f=_[_0x896d('0x35')](_0x4fea65,function(_0x3c6f8c){return qs['omit'](_0x3c6f8c,['id',_0x896d('0x55'),_0x896d('0x54'),_0x896d('0x58')]);});_0x23503b(_0x32f46f);})['catch'](function(_0x97d82a){_0x3de1a3(_0x97d82a);});})[_0x896d('0x46')](function(_0xf3bf59){var _0x137acc=qs[_0x896d('0x53')](_0x1fae73,['id',_0x896d('0x55'),_0x896d('0x54')]);_0x137acc[_0x896d('0x59')]=_0x4fce76['id'];if(_0xf3bf59)_0x137acc['Resources']=_0xf3bf59;return _0x137acc;})[_0x896d('0x46')](function(_0x45c153){return db['UserProfileSection'][_0x896d('0x4e')](_0x45c153,{'include':[{'model':db[_0x896d('0x57')],'as':_0x896d('0x5a')}],'raw':!![],'transaction':_0x5c47ea});});})['then'](function(){return _0x4fce76;});}});});});}})['then'](respondWithResult(_0x58e5a4,0xc9))[_0x896d('0x4a')](handleError(_0x58e5a4,null));};exports[_0x896d('0x5b')]=function(_0x3dfff2,_0x5ca1c8){if(_0x3dfff2['body']['id']){delete _0x3dfff2[_0x896d('0x4f')]['id'];}return db[_0x896d('0x31')][_0x896d('0x4d')]({'where':{'id':_0x3dfff2[_0x896d('0x4b')]['id']}})[_0x896d('0x46')](handleEntityNotFound(_0x5ca1c8,null))[_0x896d('0x46')](saveUpdates(_0x3dfff2['body'],null))[_0x896d('0x46')](respondWithResult(_0x5ca1c8,null))[_0x896d('0x4a')](handleError(_0x5ca1c8,null));};exports['destroy']=function(_0x1a37f7,_0x1dee4d){return db[_0x896d('0x31')]['find']({'where':{'id':_0x1a37f7[_0x896d('0x4b')]['id']}})[_0x896d('0x46')](handleEntityNotFound(_0x1dee4d,null))[_0x896d('0x46')](removeEntity(_0x1dee4d,null))[_0x896d('0x4a')](handleError(_0x1dee4d,null));};exports[_0x896d('0x5c')]=function(_0x126c83,_0x5869d2){return db[_0x896d('0x31')][_0x896d('0x5c')]()[_0x896d('0x46')](respondWithResult(_0x5869d2,null))['catch'](handleError(_0x5869d2,null));};exports[_0x896d('0x5d')]=function(_0x3bf464,_0x33facf){var _0x3da584=_0x3bf464[_0x896d('0x4f')];return db[_0x896d('0x31')][_0x896d('0x4d')]({'where':{'id':_0x3bf464[_0x896d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x33facf,null))[_0x896d('0x46')](function(_0x35eac9){if(_0x35eac9){return db[_0x896d('0x56')]['transaction'](function(_0x417cfe){return db[_0x896d('0x5e')][_0x896d('0x5f')]({'where':{'userProfileId':_0x3bf464['params']['id'],'sectionId':_[_0x896d('0x35')](_0x3da584,function(_0x3029e7){return _0x3029e7[_0x896d('0x58')];})},'transaction':_0x417cfe})[_0x896d('0x46')](function(){var _0x2cf00e=_['map'](_0x3da584,function(_0x21d48d){_0x21d48d['userProfileId']=_0x3bf464[_0x896d('0x4b')]['id'];return _0x21d48d;});var _0x30eaa6=[];return BPromise[_0x896d('0x60')](_0x2cf00e,function(_0x580562){return db[_0x896d('0x5e')][_0x896d('0x4e')](_0x580562,{'include':[{'model':db['UserProfileResource'],'as':_0x896d('0x5a')}],'raw':!![],'transaction':_0x417cfe})[_0x896d('0x46')](function(_0x5cc826){_0x30eaa6[_0x896d('0x61')](_0x5cc826[_0x896d('0x52')]({'plain':!![]}));});})[_0x896d('0x46')](function(){return _0x30eaa6;});});});}})['then'](function(_0x2a668f){return _0x2a668f;})['then'](respondWithResult(_0x33facf,null))[_0x896d('0x4a')](handleError(_0x33facf,null));};exports[_0x896d('0x62')]=function(_0x98243d,_0x5d356a){var _0x523d97;return db[_0x896d('0x31')][_0x896d('0x4d')]({'where':{'id':_0x98243d[_0x896d('0x4b')]['id']},'attributes':['id',_0x896d('0x2e')]})[_0x896d('0x46')](handleEntityNotFound(_0x5d356a,null))[_0x896d('0x46')](function(_0x4fba9a){if(_0x4fba9a){_0x523d97=_0x4fba9a;return db[_0x896d('0x5e')][_0x896d('0x5f')]({'where':{'userProfileId':_0x98243d[_0x896d('0x4b')]['id'],'sectionId':_0x98243d['query'][_0x896d('0x63')]}});}})[_0x896d('0x46')](function(){return _0x523d97;})[_0x896d('0x46')](respondWithStatusCode(_0x5d356a,null))['catch'](handleError(_0x5d356a,null));};exports[_0x896d('0x64')]=function(_0x12cbb5,_0x2296d4){var _0x3185c1=[];var _0x399962=[];return db[_0x896d('0x5e')][_0x896d('0x48')]({'where':{'userProfileId':_0x12cbb5['params']['id']},'raw':!![]})[_0x896d('0x46')](function(_0x2e448a){_0x3185c1=_[_0x896d('0x41')](_0x2e448a,function(_0x37b0d7){return _0x37b0d7[_0x896d('0x65')]===0x1||_[_0x896d('0x66')]([0x3eb,0x709],_0x37b0d7[_0x896d('0x58')]);});if(!_[_0x896d('0x67')](_0x3185c1)){return _[_0x896d('0x35')](_0x3185c1,function(_0x252eca){return _0x252eca['sectionId'];});}else{return;}})[_0x896d('0x46')](function(_0x539407){if(_0x539407)_0x399962=_0x539407;if(_[_0x896d('0x66')](_0x399962,0x64)){var _0x59bca2=_[_0x896d('0x4d')](_0x3185c1,{'sectionId':0x64});return hasDefaultDashboard(_0x59bca2)[_0x896d('0x46')](function(_0x915ea7){return _['map'](_0x3185c1,function(_0x2c9792){if(_0x2c9792[_0x896d('0x58')]===0x64){_0x2c9792['subsections']=_0x915ea7;}return _0x2c9792;});});}else{return;}})['then'](function(_0x167b16){if(_0x167b16)_0x3185c1=_0x167b16;if(_[_0x896d('0x66')](_0x399962,0x3eb)){var _0x2aa49c=_[_0x896d('0x4d')](_0x3185c1,{'sectionId':0x3eb});return getCustomDashboards(_0x2aa49c)[_0x896d('0x46')](function(_0x276c79){return _[_0x896d('0x35')](_0x3185c1,function(_0x224827){if(_0x2aa49c[_0x896d('0x65')]){if(_0x224827[_0x896d('0x58')]===0x3eb){_0x224827[_0x896d('0x68')]=_0x276c79;}}else{if(_0x224827['sectionId']===0x64){_0x224827['subsections']=_0x276c79;}}return _0x224827;});});}else{return;}})[_0x896d('0x46')](function(_0x134c94){if(_0x134c94)_0x3185c1=_0x134c94;if(_['includes'](_0x399962,0x709)){var _0x484499=_['find'](_0x3185c1,{'sectionId':0x709});return getPlugins(_0x484499)['then'](function(_0x927b11){if(_0x484499['enabled']){return _[_0x896d('0x35')](_0x3185c1,function(_0x412dc8){if(_0x412dc8[_0x896d('0x58')]===0x709){_0x412dc8['subsections']=_0x927b11;}return _0x412dc8;});}else{var _0xe15c3={'sectionId':0x76c,'enabled':0x1,'subsections':_0x927b11};var _0x2e0912=_[_0x896d('0x35')](_0x3185c1);_0x2e0912[_0x896d('0x61')](_0xe15c3);return _0x2e0912;}});}else{return;}})[_0x896d('0x46')](function(_0x7f003a){if(_0x7f003a)_0x3185c1=_0x7f003a;return _[_0x896d('0x41')](_0x3185c1,[_0x896d('0x65'),0x1]);})[_0x896d('0x46')](respondWithResult(_0x2296d4,null))[_0x896d('0x4a')](handleError(_0x2296d4,null));};function hasDefaultDashboard(_0x984fa7){var _0x555714=[0x65];return new BPromise(function(_0x59d980,_0x35b9df){try{if(_0x984fa7['autoAssociation']){_0x59d980(_0x555714);}else{return db['UserProfileResource'][_0x896d('0x69')]({'where':{'sectionId':_0x984fa7['id']},'raw':!![]})['then'](function(_0x112981){_0x112981?_0x59d980(_0x555714):_0x59d980();});}}catch(_0x50524e){_0x35b9df(_0x50524e);}});}function getCustomDashboards(_0x3188e4){var _0x291b16=[];return new BPromise(function(_0xc5d2d1,_0x32933e){try{if(_0x3188e4['autoAssociation']){return db[_0x896d('0x6a')]['findAll']({'raw':!![]})[_0x896d('0x46')](function(_0x576240){_0x576240[_0x896d('0x6b')](function(_0x9e8272){_0x291b16[_0x896d('0x61')](_0x9e8272['id']+0x1869f);});_0xc5d2d1(_0x291b16);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3188e4['id']},'raw':!![]})[_0x896d('0x46')](function(_0x3fd8b7){_0x3fd8b7[_0x896d('0x6b')](function(_0x11c658){_0x291b16[_0x896d('0x61')](_0x11c658[_0x896d('0x6c')]+0x1869f);});_0xc5d2d1(_0x291b16);});}}catch(_0x218c64){_0x32933e(_0x218c64);}});}function getPlugins(_0x2b80cc){var _0x5220ce=[];return new BPromise(function(_0xeebbb6,_0x47679e){try{if(_0x2b80cc[_0x896d('0x6d')]){return db[_0x896d('0x6e')]['findAll']({'raw':!![]})['then'](function(_0x56659e){_0x56659e[_0x896d('0x6b')](function(_0x17cfd5){_0x5220ce[_0x896d('0x61')](_0x17cfd5['id']+0x15b38);});_0xeebbb6(_0x5220ce);});}else{return db['UserProfileResource'][_0x896d('0x48')]({'where':{'sectionId':_0x2b80cc['id']},'raw':!![]})[_0x896d('0x46')](function(_0x3c2265){_0x3c2265[_0x896d('0x6b')](function(_0x50ff46){_0x5220ce[_0x896d('0x61')](_0x50ff46[_0x896d('0x6c')]+0x15b38);});_0xeebbb6(_0x5220ce);});}}catch(_0x3e4d7c){_0x47679e(_0x3e4d7c);}});}exports[_0x896d('0x6f')]=function(_0x3e9c43,_0x357b00){return db['UserProfile']['find']({'where':{'id':_0x3e9c43[_0x896d('0x4b')]['id']}})[_0x896d('0x46')](handleEntityNotFound(_0x357b00,null))[_0x896d('0x46')](function(_0x34ac88){if(_0x34ac88){return db[_0x896d('0x56')]['transaction'](function(_0x1753bd){return db['UserProfileSection'][_0x896d('0x48')]({'where':{'userProfileId':_0x3e9c43['params']['id']},'attributes':['id'],'raw':!![]})[_0x896d('0x46')](function(_0x4c8f24){if(_0x4c8f24){return db[_0x896d('0x5e')][_0x896d('0x5f')]({'where':{'userProfileId':_0x3e9c43[_0x896d('0x4b')]['id'],'id':_[_0x896d('0x35')](_0x4c8f24,function(_0x482aef){return _0x482aef['id'];})},'transaction':_0x1753bd});}})[_0x896d('0x46')](function(_0x3e0e93){var _0x361c53=_[_0x896d('0x35')](_0x3e9c43[_0x896d('0x4f')],function(_0x421f85){_0x421f85['userProfileId']=_0x3e9c43[_0x896d('0x4b')]['id'];return _0x421f85;});return db[_0x896d('0x5e')]['bulkCreate'](_0x361c53,{'raw':!![],'transaction':_0x1753bd});})['then'](function(_0x1f810b){var _0x107562=_['filter'](_['map'](_0x1f810b,function(_0x390a67){return _0x390a67['get']({'plain':!![]});}),{'includeAll':![]});if(_0x107562){return db[_0x896d('0x5e')]['findAll']({'where':{'userProfileId':_0x3e9c43[_0x896d('0x4b')]['id'],'sectionId':_[_0x896d('0x35')](_0x107562,function(_0x2499bf){return _0x2499bf[_0x896d('0x58')];})},'attributes':['id',_0x896d('0x58')],'raw':!![]})[_0x896d('0x46')](function(_0x2ef50a){var _0x1db74c=_['map'](_0x3e9c43[_0x896d('0x4f')],function(_0x1bbf89){_0x1bbf89[_0x896d('0x59')]=_0x3e9c43[_0x896d('0x4b')]['id'];return _0x1bbf89;});return db[_0x896d('0x57')][_0x896d('0x70')](_0x1db74c,{'raw':!![],'transaction':_0x1753bd});});}})[_0x896d('0x4a')](handleError(_0x357b00,null));});}})['then'](function(_0x4f0636){var _0x20e882=_['map'](_0x4f0636,function(_0x17c39b){return _0x17c39b['get']({'plain':!![]});});})[_0x896d('0x46')](respondWithResult(_0x357b00,null))[_0x896d('0x4a')](handleError(_0x357b00,null));};exports[_0x896d('0x71')]=function(_0x36cbd8,_0xa22e50,_0x255926){return db[_0x896d('0x31')]['find']({'where':{'id':_0x36cbd8[_0x896d('0x4b')]['id']}})[_0x896d('0x46')](handleEntityNotFound(_0xa22e50,null))[_0x896d('0x46')](function(_0x589ba2){if(_0x589ba2){return _0x589ba2[_0x896d('0x71')](_0x36cbd8[_0x896d('0x36')][_0x896d('0x63')]);}})[_0x896d('0x46')](respondWithStatusCode(_0xa22e50,null))[_0x896d('0x4a')](handleError(_0xa22e50,null));};exports['getResources']=function(_0x12d0e7,_0x1849ab){var _0x4231e9={};if(!_0x12d0e7['query'][_0x896d('0x72')])throw new Error(_0x896d('0x73'));if(!_0x12d0e7['query'][_0x896d('0x74')](_0x896d('0x3e'))){_0x4231e9['limit']=qs[_0x896d('0x24')](_0x12d0e7['query'][_0x896d('0x24')]);_0x4231e9[_0x896d('0x26')]=qs[_0x896d('0x26')](_0x12d0e7[_0x896d('0x36')][_0x896d('0x26')]);}return db['UserProfile'][_0x896d('0x4d')]({'where':{'id':_0x12d0e7[_0x896d('0x4b')]['id']}})['then'](function(_0xf75441){if(!_0xf75441)throw new Error(_0x896d('0x75')+_0x12d0e7[_0x896d('0x4b')]['id']);return db[_0x896d('0x31')][_0x896d('0x76')](_0x12d0e7);})[_0x896d('0x46')](respondWithFilteredResult(_0x1849ab,_0x4231e9))[_0x896d('0x4a')](handleError(_0x1849ab,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index fe64f49..abb65cc 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 _0xc1c6=['../../mysqldb','UserProfile','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x46a688,_0x3ee9f8){var _0x4bcb44=function(_0x294b66){while(--_0x294b66){_0x46a688['push'](_0x46a688['shift']());}};_0x4bcb44(++_0x3ee9f8);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2934aa,_0x321a70){_0x2934aa=_0x2934aa-0x0;var _0x55ac8e=_0xc1c6[_0x2934aa];return _0x55ac8e;};'use strict';var EventEmitter=require(_0x6c1c('0x0'));var UserProfile=require(_0x6c1c('0x1'))['db'][_0x6c1c('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6c1c('0x3'),'afterUpdate':'update','afterDestroy':_0x6c1c('0x4')};function emitEvent(_0x40ff59){return function(_0x265d2c,_0x59f799,_0x56ed6f){UserProfileEvents[_0x6c1c('0x5')](_0x40ff59+':'+_0x265d2c['id'],_0x265d2c);UserProfileEvents['emit'](_0x40ff59,_0x265d2c);_0x56ed6f(null);};}for(var e in events){if(events[_0x6c1c('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x6c1c('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x16ce=['exports','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3aff33,_0x16cb91){var _0x9e3356=function(_0x3ad616){while(--_0x3ad616){_0x3aff33['push'](_0x3aff33['shift']());}};_0x9e3356(++_0x16cb91);}(_0x16ce,0xfb));var _0xe16c=function(_0x50dd6e,_0x193585){_0x50dd6e=_0x50dd6e-0x0;var _0x5611c2=_0x16ce[_0x50dd6e];return _0x5611c2;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xe16c('0x0'))['db'][_0xe16c('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xe16c('0x2')](0x0);var events={'afterCreate':_0xe16c('0x3'),'afterUpdate':_0xe16c('0x4'),'afterDestroy':_0xe16c('0x5')};function emitEvent(_0x546ed6){return function(_0x55c37e,_0x4a5fc8,_0x884769){UserProfileEvents['emit'](_0x546ed6+':'+_0x55c37e['id'],_0x55c37e);UserProfileEvents[_0xe16c('0x6')](_0x546ed6,_0x55c37e);_0x884769(null);};}for(var e in events){if(events[_0xe16c('0x7')](e)){var event=events[e];UserProfile[_0xe16c('0x8')](e,emitEvent(event));}}module[_0xe16c('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 212abed..763b15a 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 _0xb9ac=['VoiceMail','voicerecordings','Agents','membername','User','role','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','telephones','Users','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','sugarcrmaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Dashboard','intervals','pauses','tags','Tag','templates','Template','triggers','Trigger','variables','Variable','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','section','mergeResources','Invalid\x20section\x20\x27','length','UserProfileSection','params','all','ignore','isEmpty','union','find','push','model','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','where','key','VIRTUAL','foreignKey','forEach','merge','options','autoAssociation','includeAll','include','reportType','default','DefaultReports','CustomReports','rows','count','color','ThroughTags','tag','openTabs','dataValues','sms','fax','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','models','field','filter','value','findAll','then','map','name','catch','associatedResources','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','JscriptyProject','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','ChatQueue','ChatWebsite','faxqueues','FaxQueue','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails'];(function(_0xdad237,_0x361a1d){var _0x15c575=function(_0x8db2f6){while(--_0x8db2f6){_0xdad237['push'](_0xdad237['shift']());}};_0x15c575(++_0x361a1d);}(_0xb9ac,0x84));var _0xcb9a=function(_0x184fcf,_0x19cac4){_0x184fcf=_0x184fcf-0x0;var _0x25a000=_0xb9ac[_0x184fcf];return _0x25a000;};'use strict';var _=require('lodash');var attributes=require(_0xcb9a('0x0'));var qs=require(_0xcb9a('0x1'));var squel=require('squel');module['exports']=function(_0x495ae9){var _0x1199d5=_0x495ae9[_0xcb9a('0x2')];function _0x2977c2(_0xddec74,_0x1e4a1b){return new Promise(function(_0x3c44ae,_0x51160d){if(!_0x1e4a1b)return _0x3c44ae(null);var _0x1a4c7a=_0x1e4a1b['filter']?{[_0x1e4a1b['filter'][_0xcb9a('0x3')]]:_0x1e4a1b[_0xcb9a('0x4')][_0xcb9a('0x5')]}:undefined;return _0x1199d5[_0xddec74][_0xcb9a('0x6')]({'where':_0x1a4c7a,'raw':!![]})[_0xcb9a('0x7')](function(_0xadcc6e){_0x1e4a1b['associatedResources']=_[_0xcb9a('0x8')](_0xadcc6e,'id');_0x3c44ae(_0x1e4a1b);})['catch'](function(_0x28d17f){_0x51160d(_0x28d17f);});});}function _0x2b5809(_0x50527b,_0x5c84f6){return new Promise(function(_0x54b1b5,_0x5821ec){var _0x2545c2=_0x50527b[_0xcb9a('0x4')]?{[_0x50527b[_0xcb9a('0x4')][_0xcb9a('0x3')]]:_0x50527b[_0xcb9a('0x4')][_0xcb9a('0x5')]}:undefined;return _0x1199d5[_0x50527b['model']]['findAll']({'where':_0x2545c2,'raw':!![]})[_0xcb9a('0x7')](function(_0x288c74){_0x5c84f6['associatedResources']=_[_0xcb9a('0x8')](_0x288c74,function(_0x5800b2){return _0x5800b2[_0xcb9a('0x9')];});_0x54b1b5(_0x5c84f6);})[_0xcb9a('0xa')](function(_0x53c432){_0x5821ec(_0x53c432);});});}function _0x4e168b(_0x18ca5f,_0x98ca59,_0x4a2602){if(!_0x98ca59)return Promise['resolve'](null);return new Promise(function(_0x2848fb,_0x409461){return _0x1199d5['UserProfileResource'][_0xcb9a('0x6')]({'where':{'sectionId':_0x98ca59['id']},'raw':!![]})[_0xcb9a('0x7')](function(_0x52239f){if(_0x18ca5f[_0xcb9a('0x3')]&&_0x18ca5f[_0xcb9a('0x3')]!=='id'){_0x98ca59[_0xcb9a('0xb')]=_[_0xcb9a('0x8')](_0x52239f,function(_0x3dc8d7){return _0x3dc8d7[_0x18ca5f[_0xcb9a('0x3')]];});}else{if(_0x4a2602===_0xcb9a('0xc')){_0x98ca59['associatedResources']=_[_0xcb9a('0x8')](_0x52239f,function(_0x4c05b6){return{'id':_0x4c05b6[_0xcb9a('0xd')],'type':_0x4c05b6[_0xcb9a('0xe')]};});}else{_0x98ca59['associatedResources']=_[_0xcb9a('0x8')](_0x52239f,function(_0x499f16){return _0x499f16[_0xcb9a('0xd')];});}}_0x2848fb(_0x98ca59);})[_0xcb9a('0xa')](function(_0x16afcd){_0x409461(_0x16afcd);});});}function _0x262a37(_0xdc6258,_0x45cf7b){var _0x5a2a6e={'parentSections':[]};switch(_0xdc6258[_0xcb9a('0xf')]()){case _0xcb9a('0x10'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x12');break;case'odbc':_0x5a2a6e['childModel']=_0xcb9a('0x13');break;case _0xcb9a('0x14'):_0x5a2a6e['childModel']='SquareRecording';_0x5a2a6e[_0xcb9a('0x15')]=[{'name':_0xcb9a('0x16'),'field':_0xcb9a('0x9'),'foreignKey':_0xcb9a('0x17')}];break;case'projects':_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x18');break;case'contacts':_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x19');_0x5a2a6e['parentSections']=[{'name':_0xcb9a('0x1a'),'field':'id','foreignKey':_0xcb9a('0x1b')}];break;case _0xcb9a('0x1c'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x1d');break;case _0xcb9a('0x1e'):_0x5a2a6e['childModel']=_0xcb9a('0x1f');break;case _0xcb9a('0x20'):_0x5a2a6e['childModel']='CmCustomField';break;case'chatqueues':_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x21');break;case'chatwebsites':_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x22');break;case _0xcb9a('0x23'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x24');break;case'faxaccounts':_0x5a2a6e[_0xcb9a('0x11')]='FaxAccount';break;case _0xcb9a('0x25'):case _0xcb9a('0x26'):case'outboundroutes':_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x27');break;case _0xcb9a('0x28'):_0x5a2a6e['childModel']=_0xcb9a('0x29');break;case _0xcb9a('0x2a'):_0x5a2a6e['childModel']=_0xcb9a('0x2b');break;case _0xcb9a('0x2c'):_0x5a2a6e['childModel']='VoiceRecording';_0x5a2a6e[_0xcb9a('0x15')]=[{'name':_0xcb9a('0x2d'),'field':'name','foreignKey':_0xcb9a('0x2e'),'model':_0xcb9a('0x2f'),'filter':{'field':_0xcb9a('0x30'),'value':['agent']}},{'name':_0xcb9a('0x31'),'field':'name','foreignKey':_0xcb9a('0x2e'),'model':_0xcb9a('0x2f'),'filter':{'field':_0xcb9a('0x30'),'value':[_0xcb9a('0x32')]}},{'name':_0xcb9a('0x33'),'field':_0xcb9a('0x9'),'foreignKey':_0xcb9a('0x34'),'model':_0xcb9a('0x35'),'filter':{'field':'type','value':[_0xcb9a('0x36')]}},{'name':'QueueCampaigns','field':'name','foreignKey':_0xcb9a('0x34'),'model':'VoiceQueue','filter':{'field':_0xcb9a('0xe'),'value':['outbound']}}];break;case _0xcb9a('0x37'):_0x5a2a6e['childModel']='VoiceMusicOnHold';break;case _0xcb9a('0x38'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x39');break;case _0xcb9a('0x3a'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x3b');break;case'ivrcampaigns':_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x3c');break;case'mailqueues':_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x3d');break;case _0xcb9a('0x3e'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x3f');break;case _0xcb9a('0x40'):_0x5a2a6e['childModel']=_0xcb9a('0x41');break;case _0xcb9a('0x42'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x43');break;case'openchannelaccounts':_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x44');break;case _0xcb9a('0x45'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x46');break;case _0xcb9a('0x47'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x48');break;case'whatsappqueues':_0x5a2a6e['childModel']='WhatsappQueue';break;case _0xcb9a('0x49'):_0x5a2a6e['childModel']=_0xcb9a('0x4a');break;case _0xcb9a('0x4b'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x4c');break;case'voicequeues':case _0xcb9a('0x4d'):_0x5a2a6e['childModel']=_0xcb9a('0x35');if(_0x45cf7b){_0x5a2a6e[_0xcb9a('0x15')]=[{'name':_0xcb9a('0x33')},{'name':'QueueCampaigns'}];}break;case'users':case'agents':case _0xcb9a('0x4e'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x2f');if(_0x45cf7b){_0x5a2a6e['parentSections']=[{'name':_0xcb9a('0x4f'),'filter':{'field':_0xcb9a('0x30'),'value':['admin',_0xcb9a('0x50')]},'ignore':!![]},{'name':'Agents'},{'name':_0xcb9a('0x31')}];}break;case _0xcb9a('0x51'):_0x5a2a6e['childModel']=_0xcb9a('0x52');break;case _0xcb9a('0x53'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x54');break;case'freshdeskaccounts':_0x5a2a6e[_0xcb9a('0x11')]='FreshdeskAccount';break;case _0xcb9a('0x55'):_0x5a2a6e[_0xcb9a('0x11')]='SugarcrmAccount';break;case'deskaccounts':_0x5a2a6e['childModel']=_0xcb9a('0x56');break;case _0xcb9a('0x57'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x58');break;case _0xcb9a('0x59'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x2f');break;case'cannedanswers':_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x5a');break;case _0xcb9a('0x5b'):_0x5a2a6e['childModel']='Disposition';break;case'customdashboards':_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x5c');break;case _0xcb9a('0x5d'):_0x5a2a6e['childModel']='Interval';break;case _0xcb9a('0x5e'):_0x5a2a6e['childModel']='Pause';break;case'scheduler':_0x5a2a6e[_0xcb9a('0x11')]='Schedule';break;case'sounds':_0x5a2a6e['childModel']='Sound';break;case _0xcb9a('0x5f'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x60');break;case _0xcb9a('0x61'):_0x5a2a6e['childModel']=_0xcb9a('0x62');break;case _0xcb9a('0x63'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x64');break;case'trunks':_0x5a2a6e[_0xcb9a('0x11')]='Trunk';break;case _0xcb9a('0x65'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x66');break;case'plugins':_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x67');break;case _0xcb9a('0x68'):_0x5a2a6e['childModel']=_0xcb9a('0xc');_0x5a2a6e[_0xcb9a('0x15')]=[{'name':_0xcb9a('0x69'),'field':'id','foreignKey':_0xcb9a('0x6a')}];break;case _0xcb9a('0x6b'):_0x5a2a6e[_0xcb9a('0x11')]=_0xcb9a('0x6c');break;}return _0x5a2a6e;}function _0xa90579(_0x3f4587,_0x46b21a){var _0x500c53=_0x3f4587[_0xcb9a('0x6d')](0x0)[_0xcb9a('0x6e')]()+_0x3f4587['slice'](0x1);var _0x50b8f7={'type':_0x1199d5[_0xcb9a('0x6f')][_0xcb9a('0x70')][_0xcb9a('0x71')],'raw':!![]};return new Promise(function(_0x55a5b9,_0x4d7d87){var _0x2cae33=squel[_0xcb9a('0x72')]()[_0xcb9a('0x3')](_0xcb9a('0x73')+_0x500c53+_0xcb9a('0x74'),'id')[_0xcb9a('0x3')](_0xcb9a('0x75'))[_0xcb9a('0x76')](_0xcb9a('0x77')+_0x3f4587+_0xcb9a('0x78'),'ui')['where'](_0xcb9a('0x79'),_0x46b21a['id']);return _0x1199d5[_0xcb9a('0x7a')][_0xcb9a('0x7b')](_0x2cae33[_0xcb9a('0x7c')](),_0x50b8f7)[_0xcb9a('0x7')](function(_0x163a58){_0x46b21a[_0x500c53+_0xcb9a('0x7d')]=_0x163a58;_0x55a5b9(_0x163a58);})[_0xcb9a('0xa')](function(_0x4cf566){_0x4d7d87(_0x4cf566);});});}return _0x495ae9[_0xcb9a('0x7e')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4ac1ab){var _0x20e274={'raw':_0x4ac1ab[_0xcb9a('0x7b')]['raw'],'where':{}};var _0x37fec6={};var _0x446ef7={'count':0x0,'rows':[]};var _0x6bc04=_0x4ac1ab['query'][_0xcb9a('0x7f')];var _0x3ee7c7=_0x4ac1ab[_0xcb9a('0x7b')][_0xcb9a('0x80')]||![];var _0x1dfbdb=_0x262a37(_0x6bc04,_0x3ee7c7);if(!_0x1dfbdb[_0xcb9a('0x11')])throw new Error(_0xcb9a('0x81')+_0x6bc04+'\x27');var _0x3dbf8e=[{'name':_0x6bc04}];if(!_['isEmpty'](_0x1dfbdb[_0xcb9a('0x15')]))_0x3dbf8e=_0x1dfbdb[_0xcb9a('0x15')];var _0x24d63f=[];for(var _0x56a2a9=0x0;_0x56a2a9<_0x3dbf8e[_0xcb9a('0x82')];_0x56a2a9++){_0x24d63f['push'](_0x1199d5[_0xcb9a('0x83')]['find']({'where':{'userProfileId':_0x4ac1ab[_0xcb9a('0x84')]['id'],'name':_0x3dbf8e[_0x56a2a9]['name']},'raw':!![]}));}return Promise[_0xcb9a('0x85')](_0x24d63f)['then'](function(_0x156a1f){var _0x5f4e9c=_['filter'](_0x156a1f,function(_0x432551){return _0x432551?_0x432551:undefined;});var _0x5b553e=_['filter'](_0x3dbf8e,[_0xcb9a('0x86'),!![]]);var _0x4c8d16=_[_0xcb9a('0x87')](_0x5f4e9c)&&_[_0xcb9a('0x87')](_0x5b553e)?null:_[_0xcb9a('0x88')](_0x5b553e,_0x5f4e9c);if(!_0x4c8d16)return null;var _0x4607f3=[];for(var _0x56d84e=0x0;_0x56d84e<_0x4c8d16[_0xcb9a('0x82')];_0x56d84e++){var _0x3a2bc1=_[_0xcb9a('0x89')](_0x3dbf8e,function(_0x44e0d7){return _0x4c8d16[_0x56d84e]?_0x44e0d7[_0xcb9a('0x9')]===_0x4c8d16[_0x56d84e]['name']:null;});if(_0x3a2bc1){if(_0x4c8d16[_0x56d84e][_0xcb9a('0x86')]){_0x4607f3[_0xcb9a('0x8a')](_0x2977c2(_0x1dfbdb[_0xcb9a('0x11')],_0x4c8d16[_0x56d84e]));}else{if(!_0x4c8d16[_0x56d84e]['autoAssociation']){_0x4607f3[_0xcb9a('0x8a')](_0x4e168b(_0x3a2bc1,_0x4c8d16[_0x56d84e],_0x1dfbdb[_0xcb9a('0x11')]));}else{if(_0x3a2bc1[_0xcb9a('0x8b')]){_0x4607f3[_0xcb9a('0x8a')](_0x2b5809(_0x3a2bc1,_0x4c8d16[_0x56d84e]));}}}}}return Promise[_0xcb9a('0x85')](_0x4607f3);})[_0xcb9a('0x7')](function(_0x2ecbf6){var _0x5f5a47=_0x2ecbf6;var _0x46db0b=null;if(_0x5f5a47){_0x46db0b=_0x5f5a47[_0xcb9a('0x82')]===0x1?_0x5f5a47[0x0]:null;}if(!_0x46db0b&&!_0x5f5a47)return _0x446ef7;var _0x3b392d=_0x1199d5[_0x1dfbdb[_0xcb9a('0x11')]][_0xcb9a('0x8c')];_0x37fec6[_0xcb9a('0x8b')]=_[_0xcb9a('0x8d')](_0x3b392d);_0x37fec6[_0xcb9a('0x7b')]=_['keys'](_0x4ac1ab[_0xcb9a('0x7b')]);_0x37fec6['filters']=_[_0xcb9a('0x8e')](_0x37fec6[_0xcb9a('0x8b')],_0x37fec6['query']);_0x20e274[_0xcb9a('0x8f')]=_['intersection'](_0x37fec6['model'],qs[_0xcb9a('0x90')](_0x4ac1ab[_0xcb9a('0x7b')]['fields']));_0x20e274[_0xcb9a('0x8f')]=_0x20e274[_0xcb9a('0x8f')][_0xcb9a('0x82')]?_0x20e274[_0xcb9a('0x8f')]:_0x37fec6[_0xcb9a('0x8b')];if(!_0x4ac1ab[_0xcb9a('0x7b')][_0xcb9a('0x91')]('nolimit')){_0x20e274['limit']=qs[_0xcb9a('0x92')](_0x4ac1ab[_0xcb9a('0x7b')][_0xcb9a('0x92')]);_0x20e274[_0xcb9a('0x93')]=qs[_0xcb9a('0x93')](_0x4ac1ab[_0xcb9a('0x7b')][_0xcb9a('0x93')]);}_0x20e274[_0xcb9a('0x94')]=qs[_0xcb9a('0x95')](_0x4ac1ab['query'][_0xcb9a('0x95')]);_0x20e274[_0xcb9a('0x96')]=qs['filters'](_['pick'](_0x4ac1ab[_0xcb9a('0x7b')],_0x37fec6['filters']));if(_0x4ac1ab['query']['filter']){_0x20e274[_0xcb9a('0x96')]=_['merge'](_0x20e274[_0xcb9a('0x96')],{'$or':_[_0xcb9a('0x8')](_0x3b392d,function(_0x10c557){if(_0x10c557[_0xcb9a('0xe')][_0xcb9a('0x97')]!==_0xcb9a('0x98')){var _0x2cdbf5={};_0x2cdbf5[_0x10c557[_0xcb9a('0x3')]]={'$like':'%'+_0x4ac1ab[_0xcb9a('0x7b')]['filter']+'%'};return _0x2cdbf5;}})});}var _0x3193dc=[];var _0x1399ca=null;var _0x2347b0={};if(_0x46db0b){_0x1399ca=_['find'](_0x3dbf8e,[_0xcb9a('0x9'),_0x46db0b[_0xcb9a('0x9')]]);if(_0x1399ca[_0xcb9a('0x3')]){_0x2347b0={};if(_0x1dfbdb[_0xcb9a('0x11')]===_0xcb9a('0xc')){_0x2347b0[_0x1399ca[_0xcb9a('0x99')]]=_[_0xcb9a('0x8')](_0x46db0b[_0xcb9a('0xb')],'id');}else{_0x2347b0[_0x1399ca[_0xcb9a('0x99')]]=_0x46db0b[_0xcb9a('0xb')];}_0x3193dc[_0xcb9a('0x8a')](_0x2347b0);}else{_0x20e274[_0xcb9a('0x96')]['id']=_0x46db0b[_0xcb9a('0xb')];}}else{for(var _0x1b1f62=0x0;_0x1b1f62<_0x5f5a47['length'];_0x1b1f62++){_0x1399ca=_[_0xcb9a('0x89')](_0x3dbf8e,[_0xcb9a('0x9'),_0x5f5a47[_0x1b1f62]['name']]);if(_0x1399ca['field']){_0x2347b0={};_0x2347b0[_0x1399ca[_0xcb9a('0x99')]]=_0x5f5a47[_0x1b1f62]['associatedResources'];_0x3193dc[_0xcb9a('0x8a')](_0x2347b0);}else{if(!_0x20e274[_0xcb9a('0x96')]['id'])_0x20e274[_0xcb9a('0x96')]['id']=[];_0x5f5a47[_0x1b1f62][_0xcb9a('0xb')][_0xcb9a('0x9a')](function(_0xc43473){_0x20e274[_0xcb9a('0x96')]['id'][_0xcb9a('0x8a')](_0xc43473);});}}}if(!_[_0xcb9a('0x87')](_0x3193dc)){_0x20e274[_0xcb9a('0x96')]=_[_0xcb9a('0x9b')](_0x20e274['where'],{'$and':{'$or':_0x3193dc}});}_0x20e274=_[_0xcb9a('0x9b')]({},_0x20e274,_0x4ac1ab[_0xcb9a('0x9c')]);if(_0x46db0b&&!_0x46db0b[_0xcb9a('0x9d')]&&_0x1dfbdb[_0xcb9a('0x11')]==='AnalyticExtractedReport'){if(_0x4ac1ab[_0xcb9a('0x7b')][_0xcb9a('0x9e')]){_0x20e274[_0xcb9a('0x9f')]=[{'all':!![]}];}return _0x1199d5[_0x1dfbdb[_0xcb9a('0x11')]][_0xcb9a('0x6')](_0x20e274)[_0xcb9a('0x7')](function(_0x366411){var _0x330db1=[];_0x366411['forEach'](function(_0x49f6c9){var _0x3ab5ef;switch(_0x49f6c9[_0xcb9a('0xa0')]){case _0xcb9a('0xa1'):_0x3ab5ef=_[_0xcb9a('0x89')](_0x46db0b[_0xcb9a('0xb')],function(_0x347678){return _0x347678['id']===_0x49f6c9[_0xcb9a('0x6a')]&&_0x347678[_0xcb9a('0xe')]===_0xcb9a('0xa2');});break;case'custom':_0x3ab5ef=_['find'](_0x46db0b['associatedResources'],function(_0x5dea25){return _0x5dea25['id']===_0x49f6c9[_0xcb9a('0x6a')]&&_0x5dea25[_0xcb9a('0xe')]===_0xcb9a('0xa3');});break;}if(_0x3ab5ef)_0x330db1['push'](_0x49f6c9);});_0x446ef7['count']=_0x330db1['length'];_0x446ef7[_0xcb9a('0xa4')]=_0x330db1;return _0x446ef7;});}else{return _0x1199d5[_0x1dfbdb['childModel']][_0xcb9a('0xa5')]({'where':_0x20e274[_0xcb9a('0x96')]})[_0xcb9a('0x7')](function(_0x56e907){_0x446ef7[_0xcb9a('0xa5')]=_0x56e907;if(_0x4ac1ab[_0xcb9a('0x7b')][_0xcb9a('0x9e')]){if(_0x1dfbdb[_0xcb9a('0x11')]==='CmContact'){_0x20e274[_0xcb9a('0x9f')]=[{'model':_0x1199d5[_0xcb9a('0x60')],'as':'Tags','attributes':['id','name',_0xcb9a('0xa6')],'required':_0x4ac1ab['query']['tag']?!![]:![]},{'model':_0x1199d5[_0xcb9a('0x60')],'as':_0xcb9a('0xa7'),'attributes':['id',_0xcb9a('0x9'),_0xcb9a('0xa6')],'through':_0x4ac1ab[_0xcb9a('0x7b')]['tag']?{'attributes':[],'where':{'TagId':_0x4ac1ab[_0xcb9a('0x7b')][_0xcb9a('0xa8')]||undefined}}:{},'required':_0x4ac1ab['query'][_0xcb9a('0xa8')]?!![]:![]}];}else{_0x20e274['include']=[{'all':!![]}];}}return _0x1199d5[_0x1dfbdb['childModel']][_0xcb9a('0x6')](_0x20e274);})[_0xcb9a('0x7')](function(_0x11cf88){_0x446ef7['rows']=_0x11cf88;if(_0x6bc04===_0xcb9a('0x2d')&&_0x4ac1ab[_0xcb9a('0x7b')][_0xcb9a('0xa9')]==='true'){var _0x8d9e27=[];for(var _0xf557f2=0x0;_0xf557f2<_0x446ef7[_0xcb9a('0xa4')][_0xcb9a('0x82')];_0xf557f2++){_0x8d9e27[_0xcb9a('0x8a')](_0xa90579('chat',_0x446ef7[_0xcb9a('0xa4')][_0xf557f2][_0xcb9a('0xaa')]));_0x8d9e27[_0xcb9a('0x8a')](_0xa90579(_0xcb9a('0xab'),_0x446ef7['rows'][_0xf557f2][_0xcb9a('0xaa')]));_0x8d9e27[_0xcb9a('0x8a')](_0xa90579(_0xcb9a('0xac'),_0x446ef7[_0xcb9a('0xa4')][_0xf557f2][_0xcb9a('0xaa')]));_0x8d9e27[_0xcb9a('0x8a')](_0xa90579('mail',_0x446ef7[_0xcb9a('0xa4')][_0xf557f2][_0xcb9a('0xaa')]));_0x8d9e27['push'](_0xa90579(_0xcb9a('0xad'),_0x446ef7[_0xcb9a('0xa4')][_0xf557f2]['dataValues']));_0x8d9e27[_0xcb9a('0x8a')](_0xa90579(_0xcb9a('0xae'),_0x446ef7['rows'][_0xf557f2]['dataValues']));}return Promise[_0xcb9a('0x85')](_0x8d9e27)[_0xcb9a('0x7')](function(){return _0x446ef7;});}return _0x446ef7;});}});}}});}; \ No newline at end of file +var _0x2f07=['Sound','tags','templates','triggers','Trigger','Trunk','Variable','plugins','Plugin','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','InteractionId','from','_interactions','where','sequelize','toString','UserProfile','user_profiles','query','raw','section','isEmpty','length','push','UserProfileSection','find','params','all','union','ignore','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','pick','merge','foreignKey','forEach','options','includeAll','include','reportType','custom','rows','count','Tag','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','findAll','then','associatedResources','map','catch','field','model','name','resolve','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','CmContact','Lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','Agents','membername','role','Telephones','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','User','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','dispositions','customdashboards','Interval','scheduler','Schedule'];(function(_0x10fba7,_0x454650){var _0x35a8bc=function(_0x164f74){while(--_0x164f74){_0x10fba7['push'](_0x10fba7['shift']());}};_0x35a8bc(++_0x454650);}(_0x2f07,0x1b1));var _0x72f0=function(_0x44be08,_0x515689){_0x44be08=_0x44be08-0x0;var _0x4bc192=_0x2f07[_0x44be08];return _0x4bc192;};'use strict';var _=require(_0x72f0('0x0'));var attributes=require(_0x72f0('0x1'));var qs=require(_0x72f0('0x2'));var squel=require(_0x72f0('0x3'));module[_0x72f0('0x4')]=function(_0x35904d){var _0x4f7dbe=_0x35904d[_0x72f0('0x5')];function _0x52ee3f(_0x659562,_0x3a2170){return new Promise(function(_0x17fa57,_0x380fe3){if(!_0x3a2170)return _0x17fa57(null);var _0x35f87f=_0x3a2170[_0x72f0('0x6')]?{[_0x3a2170[_0x72f0('0x6')]['field']]:_0x3a2170[_0x72f0('0x6')]['value']}:undefined;return _0x4f7dbe[_0x659562][_0x72f0('0x7')]({'where':_0x35f87f,'raw':!![]})[_0x72f0('0x8')](function(_0x49e3a7){_0x3a2170[_0x72f0('0x9')]=_[_0x72f0('0xa')](_0x49e3a7,'id');_0x17fa57(_0x3a2170);})[_0x72f0('0xb')](function(_0x332ddd){_0x380fe3(_0x332ddd);});});}function _0x3988ff(_0x26e528,_0x1e213e){return new Promise(function(_0xb113fd,_0x2c9da4){var _0x472f4f=_0x26e528[_0x72f0('0x6')]?{[_0x26e528[_0x72f0('0x6')][_0x72f0('0xc')]]:_0x26e528['filter']['value']}:undefined;return _0x4f7dbe[_0x26e528[_0x72f0('0xd')]]['findAll']({'where':_0x472f4f,'raw':!![]})[_0x72f0('0x8')](function(_0x207d8f){_0x1e213e['associatedResources']=_[_0x72f0('0xa')](_0x207d8f,function(_0x3d1aa2){return _0x3d1aa2[_0x72f0('0xe')];});_0xb113fd(_0x1e213e);})[_0x72f0('0xb')](function(_0x27ccd4){_0x2c9da4(_0x27ccd4);});});}function _0x173cdf(_0x1e5ef7,_0xb536be,_0x54b9d9){if(!_0xb536be)return Promise[_0x72f0('0xf')](null);return new Promise(function(_0x559e99,_0x28592b){return _0x4f7dbe['UserProfileResource']['findAll']({'where':{'sectionId':_0xb536be['id']},'raw':!![]})[_0x72f0('0x8')](function(_0x148a75){if(_0x1e5ef7['field']&&_0x1e5ef7[_0x72f0('0xc')]!=='id'){_0xb536be[_0x72f0('0x9')]=_[_0x72f0('0xa')](_0x148a75,function(_0x183e88){return _0x183e88[_0x1e5ef7['field']];});}else{if(_0x54b9d9===_0x72f0('0x10')){_0xb536be[_0x72f0('0x9')]=_[_0x72f0('0xa')](_0x148a75,function(_0x2af7a5){return{'id':_0x2af7a5[_0x72f0('0x11')],'type':_0x2af7a5[_0x72f0('0x12')]};});}else{_0xb536be['associatedResources']=_[_0x72f0('0xa')](_0x148a75,function(_0x48abf6){return _0x48abf6[_0x72f0('0x11')];});}}_0x559e99(_0xb536be);})[_0x72f0('0xb')](function(_0x4bf1ef){_0x28592b(_0x4bf1ef);});});}function _0x19dd5e(_0xdad05c,_0x2ebcbd){var _0x1c442e={'parentSections':[]};switch(_0xdad05c[_0x72f0('0x13')]()){case _0x72f0('0x14'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x16');break;case _0x72f0('0x17'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x18');break;case _0x72f0('0x19'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x1a');_0x1c442e[_0x72f0('0x1b')]=[{'name':_0x72f0('0x1c'),'field':_0x72f0('0xe'),'foreignKey':_0x72f0('0x1d')}];break;case'projects':_0x1c442e[_0x72f0('0x15')]='JscriptyProject';break;case'contacts':_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x1e');_0x1c442e['parentSections']=[{'name':_0x72f0('0x1f'),'field':'id','foreignKey':'ListId'}];break;case'lists':_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x20');break;case _0x72f0('0x21'):_0x1c442e['childModel']=_0x72f0('0x22');break;case _0x72f0('0x23'):_0x1c442e['childModel']=_0x72f0('0x24');break;case _0x72f0('0x25'):_0x1c442e['childModel']=_0x72f0('0x26');break;case _0x72f0('0x27'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x28');break;case _0x72f0('0x29'):_0x1c442e['childModel']='FaxQueue';break;case _0x72f0('0x2a'):_0x1c442e['childModel']=_0x72f0('0x2b');break;case'inboundroutes':case'internalroutes':case'outboundroutes':_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x2c');break;case _0x72f0('0x2d'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x2e');break;case _0x72f0('0x2f'):_0x1c442e['childModel']='VoiceMail';break;case _0x72f0('0x30'):_0x1c442e['childModel']='VoiceRecording';_0x1c442e[_0x72f0('0x1b')]=[{'name':_0x72f0('0x31'),'field':_0x72f0('0xe'),'foreignKey':_0x72f0('0x32'),'model':'User','filter':{'field':_0x72f0('0x33'),'value':['agent']}},{'name':_0x72f0('0x34'),'field':_0x72f0('0xe'),'foreignKey':_0x72f0('0x32'),'model':'User','filter':{'field':'role','value':[_0x72f0('0x35')]}},{'name':_0x72f0('0x36'),'field':_0x72f0('0xe'),'foreignKey':_0x72f0('0x37'),'model':_0x72f0('0x38'),'filter':{'field':_0x72f0('0x12'),'value':['inbound']}},{'name':_0x72f0('0x39'),'field':_0x72f0('0xe'),'foreignKey':_0x72f0('0x37'),'model':_0x72f0('0x38'),'filter':{'field':'type','value':['outbound']}}];break;case'musiconholds':_0x1c442e['childModel']=_0x72f0('0x3a');break;case'chanspies':_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x3b');break;case _0x72f0('0x3c'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x3d');break;case _0x72f0('0x3e'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x3f');break;case _0x72f0('0x40'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x41');break;case _0x72f0('0x42'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x43');break;case _0x72f0('0x44'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x45');break;case _0x72f0('0x46'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x47');break;case _0x72f0('0x48'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x49');break;case'smsqueues':_0x1c442e['childModel']=_0x72f0('0x4a');break;case'smsaccounts':_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x4b');break;case _0x72f0('0x4c'):_0x1c442e[_0x72f0('0x15')]='WhatsappQueue';break;case _0x72f0('0x4d'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x4e');break;case _0x72f0('0x4f'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x50');break;case _0x72f0('0x51'):case _0x72f0('0x52'):_0x1c442e['childModel']=_0x72f0('0x38');if(_0x2ebcbd){_0x1c442e[_0x72f0('0x1b')]=[{'name':_0x72f0('0x36')},{'name':_0x72f0('0x39')}];}break;case _0x72f0('0x53'):case _0x72f0('0x54'):case _0x72f0('0x55'):_0x1c442e['childModel']=_0x72f0('0x56');if(_0x2ebcbd){_0x1c442e['parentSections']=[{'name':_0x72f0('0x57'),'filter':{'field':_0x72f0('0x33'),'value':[_0x72f0('0x58'),_0x72f0('0x59')]},'ignore':!![]},{'name':_0x72f0('0x31')},{'name':'Telephones'}];}break;case _0x72f0('0x5a'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x5b');break;case _0x72f0('0x5c'):_0x1c442e[_0x72f0('0x15')]='SalesforceAccount';break;case'freshdeskaccounts':_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x5d');break;case _0x72f0('0x5e'):_0x1c442e[_0x72f0('0x15')]='SugarcrmAccount';break;case _0x72f0('0x5f'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x60');break;case _0x72f0('0x61'):_0x1c442e[_0x72f0('0x15')]='ZohoAccount';break;case _0x72f0('0x62'):_0x1c442e['childModel']=_0x72f0('0x56');break;case'cannedanswers':_0x1c442e[_0x72f0('0x15')]='CannedAnswer';break;case _0x72f0('0x63'):_0x1c442e[_0x72f0('0x15')]='Disposition';break;case _0x72f0('0x64'):_0x1c442e[_0x72f0('0x15')]='Dashboard';break;case'intervals':_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x65');break;case'pauses':_0x1c442e[_0x72f0('0x15')]='Pause';break;case _0x72f0('0x66'):_0x1c442e['childModel']=_0x72f0('0x67');break;case'sounds':_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x68');break;case _0x72f0('0x69'):_0x1c442e[_0x72f0('0x15')]='Tag';break;case _0x72f0('0x6a'):_0x1c442e[_0x72f0('0x15')]='Template';break;case _0x72f0('0x6b'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x6c');break;case'trunks':_0x1c442e['childModel']=_0x72f0('0x6d');break;case'variables':_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x6e');break;case _0x72f0('0x6f'):_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x70');break;case'extractedreports':_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x10');_0x1c442e[_0x72f0('0x1b')]=[{'name':_0x72f0('0x71'),'field':'id','foreignKey':_0x72f0('0x72')}];break;case'metrics':_0x1c442e[_0x72f0('0x15')]=_0x72f0('0x73');break;}return _0x1c442e;}function _0x5eaa1d(_0x2a598e,_0x5f2eb2){var _0x8490ce=_0x2a598e[_0x72f0('0x74')](0x0)[_0x72f0('0x75')]()+_0x2a598e[_0x72f0('0x76')](0x1);var _0x112309={'type':_0x4f7dbe[_0x72f0('0x77')][_0x72f0('0x78')][_0x72f0('0x79')],'raw':!![]};return new Promise(function(_0x5f3dad,_0x18d25d){var _0x3c505e=squel[_0x72f0('0x7a')]()[_0x72f0('0xc')]('ui.'+_0x8490ce+_0x72f0('0x7b'),'id')[_0x72f0('0xc')]('ui.createdAt')[_0x72f0('0x7c')]('user_has_'+_0x2a598e+_0x72f0('0x7d'),'ui')[_0x72f0('0x7e')]('ui.UserId\x20=\x20?',_0x5f2eb2['id']);return _0x4f7dbe[_0x72f0('0x7f')]['query'](_0x3c505e[_0x72f0('0x80')](),_0x112309)['then'](function(_0x5b96bd){_0x5f2eb2[_0x8490ce+'OpenTabs']=_0x5b96bd;_0x5f3dad(_0x5b96bd);})[_0x72f0('0xb')](function(_0xf436f5){_0x18d25d(_0xf436f5);});});}return _0x35904d['define'](_0x72f0('0x81'),attributes,{'tableName':_0x72f0('0x82'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x22cb43){var _0x146c72={'raw':_0x22cb43[_0x72f0('0x83')][_0x72f0('0x84')],'where':{}};var _0x2af187={};var _0x33c819={'count':0x0,'rows':[]};var _0x540deb=_0x22cb43[_0x72f0('0x83')][_0x72f0('0x85')];var _0x7ffa4a=_0x22cb43[_0x72f0('0x83')]['mergeResources']||![];var _0x31ca11=_0x19dd5e(_0x540deb,_0x7ffa4a);if(!_0x31ca11[_0x72f0('0x15')])throw new Error('Invalid\x20section\x20\x27'+_0x540deb+'\x27');var _0x44836a=[{'name':_0x540deb}];if(!_[_0x72f0('0x86')](_0x31ca11[_0x72f0('0x1b')]))_0x44836a=_0x31ca11[_0x72f0('0x1b')];var _0x1c551f=[];for(var _0x5d1dca=0x0;_0x5d1dca<_0x44836a[_0x72f0('0x87')];_0x5d1dca++){_0x1c551f[_0x72f0('0x88')](_0x4f7dbe[_0x72f0('0x89')][_0x72f0('0x8a')]({'where':{'userProfileId':_0x22cb43[_0x72f0('0x8b')]['id'],'name':_0x44836a[_0x5d1dca][_0x72f0('0xe')]},'raw':!![]}));}return Promise[_0x72f0('0x8c')](_0x1c551f)[_0x72f0('0x8')](function(_0x40b7bd){var _0x31d7d5=_[_0x72f0('0x6')](_0x40b7bd,function(_0x364934){return _0x364934?_0x364934:undefined;});var _0x41acbb=_[_0x72f0('0x6')](_0x44836a,['ignore',!![]]);var _0x4dcbaf=_[_0x72f0('0x86')](_0x31d7d5)&&_[_0x72f0('0x86')](_0x41acbb)?null:_[_0x72f0('0x8d')](_0x41acbb,_0x31d7d5);if(!_0x4dcbaf)return null;var _0x56defe=[];for(var _0x5b9999=0x0;_0x5b9999<_0x4dcbaf['length'];_0x5b9999++){var _0x47d5a7=_[_0x72f0('0x8a')](_0x44836a,function(_0x55debd){return _0x4dcbaf[_0x5b9999]?_0x55debd['name']===_0x4dcbaf[_0x5b9999][_0x72f0('0xe')]:null;});if(_0x47d5a7){if(_0x4dcbaf[_0x5b9999][_0x72f0('0x8e')]){_0x56defe['push'](_0x52ee3f(_0x31ca11['childModel'],_0x4dcbaf[_0x5b9999]));}else{if(!_0x4dcbaf[_0x5b9999][_0x72f0('0x8f')]){_0x56defe[_0x72f0('0x88')](_0x173cdf(_0x47d5a7,_0x4dcbaf[_0x5b9999],_0x31ca11[_0x72f0('0x15')]));}else{if(_0x47d5a7[_0x72f0('0xd')]){_0x56defe[_0x72f0('0x88')](_0x3988ff(_0x47d5a7,_0x4dcbaf[_0x5b9999]));}}}}}return Promise[_0x72f0('0x8c')](_0x56defe);})[_0x72f0('0x8')](function(_0x3fbfb7){var _0x1132ea=_0x3fbfb7;var _0x3df240=null;if(_0x1132ea){_0x3df240=_0x1132ea['length']===0x1?_0x1132ea[0x0]:null;}if(!_0x3df240&&!_0x1132ea)return _0x33c819;var _0x211589=_0x4f7dbe[_0x31ca11['childModel']][_0x72f0('0x90')];_0x2af187[_0x72f0('0xd')]=_[_0x72f0('0x91')](_0x211589);_0x2af187[_0x72f0('0x83')]=_[_0x72f0('0x91')](_0x22cb43[_0x72f0('0x83')]);_0x2af187[_0x72f0('0x92')]=_[_0x72f0('0x93')](_0x2af187[_0x72f0('0xd')],_0x2af187['query']);_0x146c72[_0x72f0('0x94')]=_[_0x72f0('0x93')](_0x2af187[_0x72f0('0xd')],qs[_0x72f0('0x95')](_0x22cb43['query'][_0x72f0('0x95')]));_0x146c72[_0x72f0('0x94')]=_0x146c72[_0x72f0('0x94')]['length']?_0x146c72[_0x72f0('0x94')]:_0x2af187[_0x72f0('0xd')];if(!_0x22cb43['query'][_0x72f0('0x96')]('nolimit')){_0x146c72[_0x72f0('0x97')]=qs[_0x72f0('0x97')](_0x22cb43[_0x72f0('0x83')]['limit']);_0x146c72[_0x72f0('0x98')]=qs[_0x72f0('0x98')](_0x22cb43[_0x72f0('0x83')][_0x72f0('0x98')]);}_0x146c72[_0x72f0('0x99')]=qs[_0x72f0('0x9a')](_0x22cb43[_0x72f0('0x83')][_0x72f0('0x9a')]);_0x146c72[_0x72f0('0x7e')]=qs[_0x72f0('0x92')](_[_0x72f0('0x9b')](_0x22cb43[_0x72f0('0x83')],_0x2af187['filters']));if(_0x22cb43[_0x72f0('0x83')][_0x72f0('0x6')]){_0x146c72[_0x72f0('0x7e')]=_[_0x72f0('0x9c')](_0x146c72['where'],{'$or':_[_0x72f0('0xa')](_0x211589,function(_0x220078){if(_0x220078[_0x72f0('0x12')]['key']!=='VIRTUAL'){var _0x1d2196={};_0x1d2196[_0x220078[_0x72f0('0xc')]]={'$like':'%'+_0x22cb43[_0x72f0('0x83')]['filter']+'%'};return _0x1d2196;}})});}var _0x2ceb00=[];var _0x57c0f3=null;var _0x11b5b9={};if(_0x3df240){_0x57c0f3=_['find'](_0x44836a,['name',_0x3df240[_0x72f0('0xe')]]);if(_0x57c0f3[_0x72f0('0xc')]){_0x11b5b9={};if(_0x31ca11[_0x72f0('0x15')]==='AnalyticExtractedReport'){_0x11b5b9[_0x57c0f3['foreignKey']]=_[_0x72f0('0xa')](_0x3df240[_0x72f0('0x9')],'id');}else{_0x11b5b9[_0x57c0f3[_0x72f0('0x9d')]]=_0x3df240[_0x72f0('0x9')];}_0x2ceb00[_0x72f0('0x88')](_0x11b5b9);}else{_0x146c72[_0x72f0('0x7e')]['id']=_0x3df240[_0x72f0('0x9')];}}else{for(var _0x1a902a=0x0;_0x1a902a<_0x1132ea[_0x72f0('0x87')];_0x1a902a++){_0x57c0f3=_[_0x72f0('0x8a')](_0x44836a,[_0x72f0('0xe'),_0x1132ea[_0x1a902a][_0x72f0('0xe')]]);if(_0x57c0f3[_0x72f0('0xc')]){_0x11b5b9={};_0x11b5b9[_0x57c0f3[_0x72f0('0x9d')]]=_0x1132ea[_0x1a902a][_0x72f0('0x9')];_0x2ceb00['push'](_0x11b5b9);}else{if(!_0x146c72[_0x72f0('0x7e')]['id'])_0x146c72[_0x72f0('0x7e')]['id']=[];_0x1132ea[_0x1a902a]['associatedResources'][_0x72f0('0x9e')](function(_0x48d6ea){_0x146c72[_0x72f0('0x7e')]['id']['push'](_0x48d6ea);});}}}if(!_['isEmpty'](_0x2ceb00)){_0x146c72['where']=_[_0x72f0('0x9c')](_0x146c72[_0x72f0('0x7e')],{'$and':{'$or':_0x2ceb00}});}_0x146c72=_[_0x72f0('0x9c')]({},_0x146c72,_0x22cb43[_0x72f0('0x9f')]);if(_0x3df240&&!_0x3df240[_0x72f0('0x8f')]&&_0x31ca11[_0x72f0('0x15')]===_0x72f0('0x10')){if(_0x22cb43[_0x72f0('0x83')][_0x72f0('0xa0')]){_0x146c72[_0x72f0('0xa1')]=[{'all':!![]}];}return _0x4f7dbe[_0x31ca11[_0x72f0('0x15')]]['findAll'](_0x146c72)[_0x72f0('0x8')](function(_0x1074de){var _0x128ac1=[];_0x1074de[_0x72f0('0x9e')](function(_0x4d5164){var _0x24f33c;switch(_0x4d5164[_0x72f0('0xa2')]){case'default':_0x24f33c=_[_0x72f0('0x8a')](_0x3df240[_0x72f0('0x9')],function(_0x1aae67){return _0x1aae67['id']===_0x4d5164[_0x72f0('0x72')]&&_0x1aae67[_0x72f0('0x12')]==='DefaultReports';});break;case _0x72f0('0xa3'):_0x24f33c=_['find'](_0x3df240['associatedResources'],function(_0x492238){return _0x492238['id']===_0x4d5164['reportId']&&_0x492238[_0x72f0('0x12')]==='CustomReports';});break;}if(_0x24f33c)_0x128ac1[_0x72f0('0x88')](_0x4d5164);});_0x33c819['count']=_0x128ac1[_0x72f0('0x87')];_0x33c819[_0x72f0('0xa4')]=_0x128ac1;return _0x33c819;});}else{return _0x4f7dbe[_0x31ca11['childModel']]['count']({'where':_0x146c72['where']})['then'](function(_0xff01fb){_0x33c819[_0x72f0('0xa5')]=_0xff01fb;if(_0x22cb43['query']['includeAll']){if(_0x31ca11[_0x72f0('0x15')]===_0x72f0('0x1e')){_0x146c72[_0x72f0('0xa1')]=[{'model':_0x4f7dbe[_0x72f0('0xa6')],'as':_0x72f0('0xa7'),'attributes':['id',_0x72f0('0xe'),_0x72f0('0xa8')],'required':_0x22cb43['query'][_0x72f0('0xa9')]?!![]:![]},{'model':_0x4f7dbe['Tag'],'as':_0x72f0('0xaa'),'attributes':['id',_0x72f0('0xe'),_0x72f0('0xa8')],'through':_0x22cb43[_0x72f0('0x83')][_0x72f0('0xa9')]?{'attributes':[],'where':{'TagId':_0x22cb43['query'][_0x72f0('0xa9')]||undefined}}:{},'required':_0x22cb43[_0x72f0('0x83')][_0x72f0('0xa9')]?!![]:![]}];}else{_0x146c72[_0x72f0('0xa1')]=[{'all':!![]}];}}return _0x4f7dbe[_0x31ca11[_0x72f0('0x15')]][_0x72f0('0x7')](_0x146c72);})[_0x72f0('0x8')](function(_0x18deb8){_0x33c819[_0x72f0('0xa4')]=_0x18deb8;if(_0x540deb==='Agents'&&_0x22cb43[_0x72f0('0x83')][_0x72f0('0xab')]===_0x72f0('0xac')){var _0x5bcd09=[];for(var _0x103cbe=0x0;_0x103cbe<_0x33c819[_0x72f0('0xa4')]['length'];_0x103cbe++){_0x5bcd09[_0x72f0('0x88')](_0x5eaa1d(_0x72f0('0xad'),_0x33c819[_0x72f0('0xa4')][_0x103cbe][_0x72f0('0xae')]));_0x5bcd09['push'](_0x5eaa1d(_0x72f0('0xaf'),_0x33c819[_0x72f0('0xa4')][_0x103cbe][_0x72f0('0xae')]));_0x5bcd09['push'](_0x5eaa1d(_0x72f0('0xb0'),_0x33c819[_0x72f0('0xa4')][_0x103cbe]['dataValues']));_0x5bcd09[_0x72f0('0x88')](_0x5eaa1d(_0x72f0('0xb1'),_0x33c819['rows'][_0x103cbe][_0x72f0('0xae')]));_0x5bcd09['push'](_0x5eaa1d(_0x72f0('0xb2'),_0x33c819['rows'][_0x103cbe][_0x72f0('0xae')]));_0x5bcd09[_0x72f0('0x88')](_0x5eaa1d('whatsapp',_0x33c819[_0x72f0('0xa4')][_0x103cbe]['dataValues']));}return Promise[_0x72f0('0x8c')](_0x5bcd09)[_0x72f0('0x8')](function(){return _0x33c819;});}return _0x33c819;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 35d33d5..fe73812 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 _0xfaf2=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','request','info','UserProfile,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x44b9a,_0x587332){var _0x56b5ac=function(_0x550a92){while(--_0x550a92){_0x44b9a['push'](_0x44b9a['shift']());}};_0x56b5ac(++_0x587332);}(_0xfaf2,0x169));var _0x2faf=function(_0x3cd3f8,_0x2c791c){_0x3cd3f8=_0x3cd3f8-0x0;var _0x409320=_0xfaf2[_0x3cd3f8];return _0x409320;};'use strict';var _=require(_0x2faf('0x0'));var util=require(_0x2faf('0x1'));var moment=require(_0x2faf('0x2'));var BPromise=require(_0x2faf('0x3'));var rs=require(_0x2faf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2faf('0x5'))['db'];var utils=require(_0x2faf('0x6'));var logger=require(_0x2faf('0x7'))(_0x2faf('0x8'));var config=require(_0x2faf('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x2faf('0xa')]=_[_0x2faf('0xb')](config[_0x2faf('0xa')],{'host':_0x2faf('0xc'),'port':0x18eb});var socket=require(_0x2faf('0xd'))(new Redis(config['redis']));require('./userProfile.socket')[_0x2faf('0xe')](socket);function respondWithRpcPromise(_0x262959,_0x4ca336,_0x4f041a){return new BPromise(function(_0x3ec8cc,_0x3fa4b0){return client[_0x2faf('0xf')](_0x262959,_0x4f041a)['then'](function(_0x515eb6){logger[_0x2faf('0x10')](_0x2faf('0x11'),_0x4ca336,'request\x20sent');logger[_0x2faf('0x12')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x4ca336,_0x2faf('0x13'),JSON[_0x2faf('0x14')](_0x515eb6));if(_0x515eb6[_0x2faf('0x15')]){if(_0x515eb6[_0x2faf('0x15')][_0x2faf('0x16')]===0x1f4){logger[_0x2faf('0x15')]('UserProfile,\x20%s,\x20%s',_0x4ca336,_0x515eb6[_0x2faf('0x15')][_0x2faf('0x17')]);return _0x3fa4b0(_0x515eb6['error'][_0x2faf('0x17')]);}logger[_0x2faf('0x15')](_0x2faf('0x11'),_0x4ca336,_0x515eb6[_0x2faf('0x15')]['message']);return _0x3ec8cc(_0x515eb6[_0x2faf('0x15')][_0x2faf('0x17')]);}else{logger[_0x2faf('0x10')](_0x2faf('0x11'),_0x4ca336,'request\x20sent');_0x3ec8cc(_0x515eb6[_0x2faf('0x18')][_0x2faf('0x17')]);}})[_0x2faf('0x19')](function(_0x2b226b){logger[_0x2faf('0x15')](_0x2faf('0x11'),_0x4ca336,_0x2b226b);_0x3fa4b0(_0x2b226b);});});} \ No newline at end of file +var _0xcde7=['stringify','error','code','message','result','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s'];(function(_0x33da8e,_0x45d494){var _0x4f0e03=function(_0x4f9d73){while(--_0x4f9d73){_0x33da8e['push'](_0x33da8e['shift']());}};_0x4f0e03(++_0x45d494);}(_0xcde7,0x65));var _0x7cde=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcde7[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7cde('0x0'));var BPromise=require(_0x7cde('0x1'));var rs=require(_0x7cde('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7cde('0x3'));var logger=require('../../config/logger')(_0x7cde('0x4'));var config=require(_0x7cde('0x5'));var jayson=require(_0x7cde('0x6'));var client=jayson[_0x7cde('0x7')][_0x7cde('0x8')]({'port':0x232a});config[_0x7cde('0x9')]=_['defaults'](config[_0x7cde('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7cde('0xa'))(new Redis(config[_0x7cde('0x9')]));require(_0x7cde('0xb'))[_0x7cde('0xc')](socket);function respondWithRpcPromise(_0x4e7b87,_0x1cc16f,_0x5e590a){return new BPromise(function(_0x15ed09,_0x13d4f6){return client[_0x7cde('0xd')](_0x4e7b87,_0x5e590a)[_0x7cde('0xe')](function(_0x174446){logger[_0x7cde('0xf')](_0x7cde('0x10'),_0x1cc16f,_0x7cde('0x11'));logger['debug'](_0x7cde('0x12'),_0x1cc16f,_0x7cde('0x11'),JSON[_0x7cde('0x13')](_0x174446));if(_0x174446[_0x7cde('0x14')]){if(_0x174446[_0x7cde('0x14')][_0x7cde('0x15')]===0x1f4){logger[_0x7cde('0x14')](_0x7cde('0x10'),_0x1cc16f,_0x174446[_0x7cde('0x14')]['message']);return _0x13d4f6(_0x174446[_0x7cde('0x14')][_0x7cde('0x16')]);}logger[_0x7cde('0x14')](_0x7cde('0x10'),_0x1cc16f,_0x174446[_0x7cde('0x14')][_0x7cde('0x16')]);return _0x15ed09(_0x174446[_0x7cde('0x14')][_0x7cde('0x16')]);}else{logger[_0x7cde('0xf')](_0x7cde('0x10'),_0x1cc16f,_0x7cde('0x11'));_0x15ed09(_0x174446[_0x7cde('0x17')][_0x7cde('0x16')]);}})['catch'](function(_0x1199f5){logger[_0x7cde('0x14')](_0x7cde('0x10'),_0x1cc16f,_0x1199f5);_0x13d4f6(_0x1199f5);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 49dfb47..a6cbf70 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 _0x6d73=['emit','removeListener','register','length','userProfile:','./userProfile.events','save','remove','update'];(function(_0x28fc08,_0x18b054){var _0xa6a26b=function(_0x3933b2){while(--_0x3933b2){_0x28fc08['push'](_0x28fc08['shift']());}};_0xa6a26b(++_0x18b054);}(_0x6d73,0x1b5));var _0x36d7=function(_0x378d18,_0x17362b){_0x378d18=_0x378d18-0x0;var _0x52d233=_0x6d73[_0x378d18];return _0x52d233;};'use strict';var UserProfileEvents=require(_0x36d7('0x0'));var events=[_0x36d7('0x1'),_0x36d7('0x2'),_0x36d7('0x3')];function createListener(_0x22ff7b,_0x773446){return function(_0x1f8131){_0x773446[_0x36d7('0x4')](_0x22ff7b,_0x1f8131);};}function removeListener(_0x3814a5,_0x1810f8){return function(){UserProfileEvents[_0x36d7('0x5')](_0x3814a5,_0x1810f8);};}exports[_0x36d7('0x6')]=function(_0x364ff3){for(var _0x13780b=0x0,_0x1a5adf=events[_0x36d7('0x7')];_0x13780b<_0x1a5adf;_0x13780b++){var _0x121187=events[_0x13780b];var _0x2e7cea=createListener(_0x36d7('0x8')+_0x121187,_0x364ff3);UserProfileEvents['on'](_0x121187,_0x2e7cea);}}; \ No newline at end of file +var _0x56a1=['length','userProfile:','./userProfile.events','emit','register'];(function(_0x1f3506,_0x5ed124){var _0x59678c=function(_0x5d6164){while(--_0x5d6164){_0x1f3506['push'](_0x1f3506['shift']());}};_0x59678c(++_0x5ed124);}(_0x56a1,0x115));var _0x156a=function(_0x2bfc60,_0xa254ab){_0x2bfc60=_0x2bfc60-0x0;var _0x44ea2c=_0x56a1[_0x2bfc60];return _0x44ea2c;};'use strict';var UserProfileEvents=require(_0x156a('0x0'));var events=['save','remove','update'];function createListener(_0x416117,_0x3cea74){return function(_0x3436a5){_0x3cea74[_0x156a('0x1')](_0x416117,_0x3436a5);};}function removeListener(_0x2e0b4c,_0x3b2b29){return function(){UserProfileEvents['removeListener'](_0x2e0b4c,_0x3b2b29);};}exports[_0x156a('0x2')]=function(_0x3a074f){for(var _0xa416b3=0x0,_0x1cf575=events[_0x156a('0x3')];_0xa416b3<_0x1cf575;_0xa416b3++){var _0x122dcf=events[_0xa416b3];var _0x1b04de=createListener(_0x156a('0x4')+_0x122dcf,_0x3a074f);UserProfileEvents['on'](_0x122dcf,_0x1b04de);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 39f23de..7eb9588 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 _0xc6d8=['destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','delete'];(function(_0x241b5a,_0x5ac06c){var _0x49fff8=function(_0x31f8ec){while(--_0x31f8ec){_0x241b5a['push'](_0x241b5a['shift']());}};_0x49fff8(++_0x5ac06c);}(_0xc6d8,0x105));var _0x8c6d=function(_0x8935ce,_0x3621c3){_0x8935ce=_0x8935ce-0x0;var _0x1a422f=_0xc6d8[_0x8935ce];return _0x1a422f;};'use strict';var multer=require(_0x8c6d('0x0'));var util=require('util');var path=require(_0x8c6d('0x1'));var timeout=require(_0x8c6d('0x2'));var express=require(_0x8c6d('0x3'));var router=express[_0x8c6d('0x4')]();var fs_extra=require(_0x8c6d('0x5'));var auth=require(_0x8c6d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8c6d('0x7'));var controller=require(_0x8c6d('0x8'));router['get']('/',auth[_0x8c6d('0x9')](),controller[_0x8c6d('0xa')]);router[_0x8c6d('0xb')](_0x8c6d('0xc'),auth[_0x8c6d('0x9')](),controller[_0x8c6d('0xd')]);router[_0x8c6d('0xb')](_0x8c6d('0xe'),auth[_0x8c6d('0x9')](),controller['show']);router[_0x8c6d('0xf')]('/',auth['isAuthenticated'](),controller[_0x8c6d('0x10')]);router[_0x8c6d('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8c6d('0x12')](_0x8c6d('0xe'),auth[_0x8c6d('0x9')](),controller[_0x8c6d('0x13')]);module['exports']=router; \ No newline at end of file +var _0xed25=['delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x16ea87,_0x378d8b){var _0x6e7b1c=function(_0x26306e){while(--_0x26306e){_0x16ea87['push'](_0x16ea87['shift']());}};_0x6e7b1c(++_0x378d8b);}(_0xed25,0x14c));var _0x5ed2=function(_0x3f32e4,_0x4681c7){_0x3f32e4=_0x3f32e4-0x0;var _0x18fbef=_0xed25[_0x3f32e4];return _0x18fbef;};'use strict';var multer=require('multer');var util=require(_0x5ed2('0x0'));var path=require(_0x5ed2('0x1'));var timeout=require(_0x5ed2('0x2'));var express=require(_0x5ed2('0x3'));var router=express['Router']();var fs_extra=require(_0x5ed2('0x4'));var auth=require(_0x5ed2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0x5ed2('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5ed2('0x6')]('/describe',auth[_0x5ed2('0x7')](),controller['describe']);router['get'](_0x5ed2('0x8'),auth[_0x5ed2('0x7')](),controller[_0x5ed2('0x9')]);router[_0x5ed2('0xa')]('/',auth['isAuthenticated'](),controller[_0x5ed2('0xb')]);router[_0x5ed2('0xc')](_0x5ed2('0x8'),auth[_0x5ed2('0x7')](),controller['update']);router[_0x5ed2('0xd')]('/:id',auth[_0x5ed2('0x7')](),controller[_0x5ed2('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index da214c8..7c99c29 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 _0xc3bb=['exports','STRING','INTEGER','sequelize'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xc3bb,0x10b));var _0xbc3b=function(_0x991599,_0x475d1a){_0x991599=_0x991599-0x0;var _0x5b73fb=_0xc3bb[_0x991599];return _0x5b73fb;};'use strict';var Sequelize=require(_0xbc3b('0x0'));module[_0xbc3b('0x1')]={'name':{'type':Sequelize[_0xbc3b('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xbc3b('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xbc3b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf48d=['STRING','INTEGER','sequelize','exports'];(function(_0x5687cf,_0x3fa680){var _0x7bcb9b=function(_0x260b07){while(--_0x260b07){_0x5687cf['push'](_0x5687cf['shift']());}};_0x7bcb9b(++_0x3fa680);}(_0xf48d,0x1e2));var _0xdf48=function(_0x30ebbc,_0x481b0f){_0x30ebbc=_0x30ebbc-0x0;var _0x2fd850=_0xf48d[_0x30ebbc];return _0x2fd850;};'use strict';var Sequelize=require(_0xdf48('0x0'));module[_0xdf48('0x1')]={'name':{'type':Sequelize[_0xdf48('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xdf48('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf48('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index eb4b643..b0489ff 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 _0x430c=['status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','describe','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x59c86e,_0x38ce57){var _0x48a50e=function(_0x1eeda5){while(--_0x1eeda5){_0x59c86e['push'](_0x59c86e['shift']());}};_0x48a50e(++_0x38ce57);}(_0x430c,0x1a1));var _0xc430=function(_0x173113,_0x316a7c){_0x173113=_0x173113-0x0;var _0x3bea89=_0x430c[_0x173113];return _0x3bea89;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['create']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')](_0x10db27[_0xc430('0x45')],{})['then'](respondWithResult(_0x4eafae,0xc9))[_0xc430('0x40')](handleError(_0x4eafae,null));};exports[_0xc430('0x46')]=function(_0x19e563,_0x549400){if(_0x19e563[_0xc430('0x45')]['id']){delete _0x19e563[_0xc430('0x45')]['id'];}return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x19e563[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x549400,null))[_0xc430('0x1e')](saveUpdates(_0x19e563['body'],null))[_0xc430('0x1e')](respondWithResult(_0x549400,null))[_0xc430('0x40')](handleError(_0x549400,null));};exports[_0xc430('0x1f')]=function(_0x4e9aff,_0x23cb41){return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x4e9aff[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x23cb41,null))[_0xc430('0x1e')](removeEntity(_0x23cb41,null))['catch'](handleError(_0x23cb41,null));};exports[_0xc430('0x48')]=function(_0x214954,_0x2a5143){return db[_0xc430('0x25')][_0xc430('0x48')]()[_0xc430('0x1e')](respondWithResult(_0x2a5143,null))['catch'](handleError(_0x2a5143,null));}; \ No newline at end of file +var _0x1883=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileResource','includeAll','include','findAll','params','catch','create','body','find','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','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x269488,_0x31e484){var _0x3a4ca4=function(_0x19a38d){while(--_0x19a38d){_0x269488['push'](_0x269488['shift']());}};_0x3a4ca4(++_0x31e484);}(_0x1883,0xab));var _0x3188=function(_0x44cdd9,_0x48ca46){_0x44cdd9=_0x44cdd9-0x0;var _0xeab1ad=_0x1883[_0x44cdd9];return _0xeab1ad;};'use strict';var emlformat=require(_0x3188('0x0'));var rimraf=require(_0x3188('0x1'));var zipdir=require(_0x3188('0x2'));var jsonpatch=require(_0x3188('0x3'));var rp=require(_0x3188('0x4'));var moment=require(_0x3188('0x5'));var BPromise=require(_0x3188('0x6'));var Mustache=require(_0x3188('0x7'));var util=require(_0x3188('0x8'));var path=require(_0x3188('0x9'));var sox=require(_0x3188('0xa'));var csv=require(_0x3188('0xb'));var ejs=require(_0x3188('0xc'));var fs=require('fs');var fs_extra=require(_0x3188('0xd'));var _=require(_0x3188('0xe'));var squel=require(_0x3188('0xf'));var crypto=require(_0x3188('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x3188('0x11'));var toCsv=require(_0x3188('0xb'));var querystring=require('querystring');var Papa=require(_0x3188('0x12'));var Redis=require('ioredis');var authService=require(_0x3188('0x13'));var qs=require(_0x3188('0x14'));var as=require(_0x3188('0x15'));var hardwareService=require(_0x3188('0x16'));var logger=require('../../config/logger')(_0x3188('0x17'));var utils=require(_0x3188('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3188('0x19'))['db'];function respondWithStatusCode(_0x45e94e,_0x20fef6){_0x20fef6=_0x20fef6||0xcc;return function(_0x3ae228){if(_0x3ae228){return _0x45e94e[_0x3188('0x1a')](_0x20fef6);}return _0x45e94e[_0x3188('0x1b')](_0x20fef6)['end']();};}function respondWithResult(_0x276d69,_0x5e0044){_0x5e0044=_0x5e0044||0xc8;return function(_0x4a2f36){if(_0x4a2f36){return _0x276d69[_0x3188('0x1b')](_0x5e0044)['json'](_0x4a2f36);}};}function respondWithFilteredResult(_0x54a87f,_0x32c239){return function(_0x1beead){if(_0x1beead){var _0xa2269=typeof _0x32c239[_0x3188('0x1c')]===_0x3188('0x1d')&&typeof _0x32c239[_0x3188('0x1e')]==='undefined';var _0x19cc72=_0x1beead[_0x3188('0x1f')];var _0x3f5b35=_0xa2269?0x0:_0x32c239[_0x3188('0x1c')];var _0x18a71a=_0xa2269?_0x1beead[_0x3188('0x1f')]:_0x32c239[_0x3188('0x1c')]+_0x32c239[_0x3188('0x1e')];var _0x5bcbba;if(_0x18a71a>=_0x19cc72){_0x18a71a=_0x19cc72;_0x5bcbba=0xc8;}else{_0x5bcbba=0xce;}_0x54a87f[_0x3188('0x1b')](_0x5bcbba);return _0x54a87f[_0x3188('0x20')]('Content-Range',_0x3f5b35+'-'+_0x18a71a+'/'+_0x19cc72)['json'](_0x1beead);}return null;};}function patchUpdates(_0x5d8d62){return function(_0x46a318){try{jsonpatch[_0x3188('0x21')](_0x46a318,_0x5d8d62,!![]);}catch(_0xd292b5){return BPromise['reject'](_0xd292b5);}return _0x46a318['save']();};}function saveUpdates(_0x266260,_0x461286){return function(_0x375077){if(_0x375077){return _0x375077[_0x3188('0x22')](_0x266260)[_0x3188('0x23')](function(_0x4bd5ee){return _0x4bd5ee;});}return null;};}function removeEntity(_0x30cf2c,_0x33f882){return function(_0x5a2e67){if(_0x5a2e67){return _0x5a2e67[_0x3188('0x24')]()['then'](function(){_0x30cf2c['status'](0xcc)[_0x3188('0x25')]();});}};}function handleEntityNotFound(_0x129bd7,_0x87d5a3){return function(_0x1aeaba){if(!_0x1aeaba){_0x129bd7[_0x3188('0x1a')](0x194);}return _0x1aeaba;};}function handleError(_0x2cd060,_0xe57f73){_0xe57f73=_0xe57f73||0x1f4;return function(_0x11021c){logger['error'](_0x11021c[_0x3188('0x26')]);if(_0x11021c[_0x3188('0x27')]){delete _0x11021c['name'];}_0x2cd060[_0x3188('0x1b')](_0xe57f73)[_0x3188('0x28')](_0x11021c);};}exports[_0x3188('0x29')]=function(_0x44db9a,_0x20e6aa){var _0x1f1c6f={},_0x8f810f={},_0x472926={'count':0x0,'rows':[]};var _0x57c21c=_[_0x3188('0x2a')](db['UserProfileResource'][_0x3188('0x2b')],function(_0x5623f1){return{'name':_0x5623f1[_0x3188('0x2c')],'type':_0x5623f1[_0x3188('0x2d')][_0x3188('0x2e')]};});_0x8f810f[_0x3188('0x2f')]=_[_0x3188('0x2a')](_0x57c21c,_0x3188('0x27'));_0x8f810f[_0x3188('0x30')]=_[_0x3188('0x31')](_0x44db9a[_0x3188('0x30')]);_0x8f810f[_0x3188('0x32')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],_0x8f810f[_0x3188('0x30')]);_0x1f1c6f[_0x3188('0x34')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],qs[_0x3188('0x35')](_0x44db9a[_0x3188('0x30')]['fields']));_0x1f1c6f[_0x3188('0x34')]=_0x1f1c6f['attributes'][_0x3188('0x36')]?_0x1f1c6f[_0x3188('0x34')]:_0x8f810f['model'];if(!_0x44db9a[_0x3188('0x30')][_0x3188('0x37')](_0x3188('0x38'))){_0x1f1c6f[_0x3188('0x1e')]=qs[_0x3188('0x1e')](_0x44db9a[_0x3188('0x30')][_0x3188('0x1e')]);_0x1f1c6f['offset']=qs['offset'](_0x44db9a[_0x3188('0x30')][_0x3188('0x1c')]);}_0x1f1c6f[_0x3188('0x39')]=qs[_0x3188('0x3a')](_0x44db9a['query'][_0x3188('0x3a')]);_0x1f1c6f[_0x3188('0x3b')]=qs[_0x3188('0x32')](_[_0x3188('0x3c')](_0x44db9a['query'],_0x8f810f[_0x3188('0x32')]),_0x57c21c);if(_0x44db9a['query'][_0x3188('0x3d')]){_0x1f1c6f['where']=_[_0x3188('0x3e')](_0x1f1c6f[_0x3188('0x3b')],{'$or':_[_0x3188('0x2a')](_0x57c21c,function(_0x2990c4){if(_0x2990c4[_0x3188('0x2d')]!==_0x3188('0x3f')){var _0x4666b2={};_0x4666b2[_0x2990c4[_0x3188('0x27')]]={'$like':'%'+_0x44db9a[_0x3188('0x30')][_0x3188('0x3d')]+'%'};return _0x4666b2;}})});}_0x1f1c6f=_['merge']({},_0x1f1c6f,_0x44db9a[_0x3188('0x40')]);var _0x2bad0f={'where':_0x1f1c6f[_0x3188('0x3b')]};return db[_0x3188('0x41')][_0x3188('0x1f')](_0x2bad0f)[_0x3188('0x23')](function(_0x5a815d){_0x472926[_0x3188('0x1f')]=_0x5a815d;if(_0x44db9a['query'][_0x3188('0x42')]){_0x1f1c6f[_0x3188('0x43')]=[{'all':!![]}];}return db[_0x3188('0x41')][_0x3188('0x44')](_0x1f1c6f);})[_0x3188('0x23')](function(_0x549ab2){_0x472926['rows']=_0x549ab2;return _0x472926;})['then'](respondWithFilteredResult(_0x20e6aa,_0x1f1c6f))['catch'](handleError(_0x20e6aa,null));};exports['show']=function(_0x763943,_0x28c224){var _0x3e5f90={'raw':![],'where':{'id':_0x763943[_0x3188('0x45')]['id']}},_0x1b40b1={};_0x1b40b1['model']=_[_0x3188('0x31')](db['UserProfileResource'][_0x3188('0x2b')]);_0x1b40b1[_0x3188('0x30')]=_[_0x3188('0x31')](_0x763943[_0x3188('0x30')]);_0x1b40b1['filters']=_[_0x3188('0x33')](_0x1b40b1[_0x3188('0x2f')],_0x1b40b1[_0x3188('0x30')]);_0x3e5f90[_0x3188('0x34')]=_[_0x3188('0x33')](_0x1b40b1['model'],qs['fields'](_0x763943[_0x3188('0x30')][_0x3188('0x35')]));_0x3e5f90['attributes']=_0x3e5f90[_0x3188('0x34')][_0x3188('0x36')]?_0x3e5f90['attributes']:_0x1b40b1[_0x3188('0x2f')];if(_0x763943[_0x3188('0x30')][_0x3188('0x42')]){_0x3e5f90[_0x3188('0x43')]=[{'all':!![]}];}_0x3e5f90=_[_0x3188('0x3e')]({},_0x3e5f90,_0x763943['options']);return db[_0x3188('0x41')]['find'](_0x3e5f90)[_0x3188('0x23')](handleEntityNotFound(_0x28c224,null))[_0x3188('0x23')](respondWithResult(_0x28c224,null))[_0x3188('0x46')](handleError(_0x28c224,null));};exports[_0x3188('0x47')]=function(_0xe4cbb0,_0x315524){return db[_0x3188('0x41')][_0x3188('0x47')](_0xe4cbb0[_0x3188('0x48')],{})[_0x3188('0x23')](respondWithResult(_0x315524,0xc9))[_0x3188('0x46')](handleError(_0x315524,null));};exports['update']=function(_0x50fd56,_0x1b012d){if(_0x50fd56['body']['id']){delete _0x50fd56[_0x3188('0x48')]['id'];}return db[_0x3188('0x41')]['find']({'where':{'id':_0x50fd56[_0x3188('0x45')]['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x1b012d,null))[_0x3188('0x23')](saveUpdates(_0x50fd56[_0x3188('0x48')],null))[_0x3188('0x23')](respondWithResult(_0x1b012d,null))[_0x3188('0x46')](handleError(_0x1b012d,null));};exports[_0x3188('0x24')]=function(_0x1e3592,_0x59a177){return db[_0x3188('0x41')][_0x3188('0x49')]({'where':{'id':_0x1e3592['params']['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x59a177,null))['then'](removeEntity(_0x59a177,null))[_0x3188('0x46')](handleError(_0x59a177,null));};exports[_0x3188('0x4a')]=function(_0x4f8852,_0x559264){return db['UserProfileResource']['describe']()['then'](respondWithResult(_0x559264,null))['catch'](handleError(_0x559264,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 2f9da4f..2e94040 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 _0x3897=['./userProfileResource.attributes','exports','define','UserProfileResource','compositeIndex','api','request-promise','path'];(function(_0x53eac0,_0x13510a){var _0x468e04=function(_0xae9587){while(--_0xae9587){_0x53eac0['push'](_0x53eac0['shift']());}};_0x468e04(++_0x13510a);}(_0x3897,0xa5));var _0x7389=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0x3897[_0x32b993];return _0x482780;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7389('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7389('0x1'));var fs=require('fs');var path=require(_0x7389('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7389('0x3'));module[_0x7389('0x4')]=function(_0xc271ca,_0x181605){return _0xc271ca[_0x7389('0x5')](_0x7389('0x6'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x7389('0x7'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdd2e=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','./userProfileResource.attributes','exports','lodash'];(function(_0x185063,_0x3f0bb7){var _0x16d9d3=function(_0x1b3fe3){while(--_0x1b3fe3){_0x185063['push'](_0x185063['shift']());}};_0x16d9d3(++_0x3f0bb7);}(_0xdd2e,0x13a));var _0xedd2=function(_0x314817,_0x163814){_0x314817=_0x314817-0x0;var _0x3872e9=_0xdd2e[_0x314817];return _0x3872e9;};'use strict';var _=require(_0xedd2('0x0'));var util=require(_0xedd2('0x1'));var logger=require(_0xedd2('0x2'))(_0xedd2('0x3'));var moment=require('moment');var BPromise=require(_0xedd2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xedd2('0x5'));var config=require(_0xedd2('0x6'));var attributes=require(_0xedd2('0x7'));module[_0xedd2('0x8')]=function(_0x34cf6d,_0x4c9135){return _0x34cf6d['define']('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 7d781bb..b392394 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 _0xf0a3=['bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','info','result','catch','util','moment'];(function(_0x57a491,_0x4d1428){var _0x14f6fc=function(_0x57d4e0){while(--_0x57d4e0){_0x57a491['push'](_0x57a491['shift']());}};_0x14f6fc(++_0x4d1428);}(_0xf0a3,0x18d));var _0x3f0a=function(_0x414540,_0x500b13){_0x414540=_0x414540-0x0;var _0x5039cc=_0xf0a3[_0x414540];return _0x5039cc;};'use strict';var _=require('lodash');var util=require(_0x3f0a('0x0'));var moment=require(_0x3f0a('0x1'));var BPromise=require(_0x3f0a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f0a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f0a('0x4'));var logger=require('../../config/logger')(_0x3f0a('0x5'));var config=require(_0x3f0a('0x6'));var jayson=require(_0x3f0a('0x7'));var client=jayson[_0x3f0a('0x8')][_0x3f0a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x443907,_0x16fbbe,_0xddc037){return new BPromise(function(_0x789ae5,_0xca2e46){return client['request'](_0x443907,_0xddc037)['then'](function(_0x272d44){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x16fbbe,_0x3f0a('0xa'));logger[_0x3f0a('0xb')](_0x3f0a('0xc'),_0x16fbbe,_0x3f0a('0xa'),JSON[_0x3f0a('0xd')](_0x272d44));if(_0x272d44[_0x3f0a('0xe')]){if(_0x272d44[_0x3f0a('0xe')][_0x3f0a('0xf')]===0x1f4){logger[_0x3f0a('0xe')](_0x3f0a('0x10'),_0x16fbbe,_0x272d44['error'][_0x3f0a('0x11')]);return _0xca2e46(_0x272d44[_0x3f0a('0xe')][_0x3f0a('0x11')]);}logger[_0x3f0a('0xe')](_0x3f0a('0x10'),_0x16fbbe,_0x272d44['error']['message']);return _0x789ae5(_0x272d44['error'][_0x3f0a('0x11')]);}else{logger[_0x3f0a('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x16fbbe,_0x3f0a('0xa'));_0x789ae5(_0x272d44[_0x3f0a('0x13')]['message']);}})[_0x3f0a('0x14')](function(_0x3f1ca9){logger[_0x3f0a('0xe')](_0x3f0a('0x10'),_0x16fbbe,_0x3f1ca9);_0xca2e46(_0x3f1ca9);});});} \ No newline at end of file +var _0x1ffa=['message','info','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c6868,_0x5c2960){var _0x4b77d2=function(_0x4192bf){while(--_0x4192bf){_0x4c6868['push'](_0x4c6868['shift']());}};_0x4b77d2(++_0x5c2960);}(_0x1ffa,0x16a));var _0xa1ff=function(_0x9c6c1c,_0x21ead9){_0x9c6c1c=_0x9c6c1c-0x0;var _0x594c42=_0x1ffa[_0x9c6c1c];return _0x594c42;};'use strict';var _=require('lodash');var util=require(_0xa1ff('0x0'));var moment=require(_0xa1ff('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1ff('0x2'));var db=require(_0xa1ff('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1ff('0x4'))(_0xa1ff('0x5'));var config=require(_0xa1ff('0x6'));var jayson=require(_0xa1ff('0x7'));var client=jayson[_0xa1ff('0x8')][_0xa1ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42f72b,_0x4af077,_0x3dd3cc){return new BPromise(function(_0x5f3cea,_0x1ba2e3){return client['request'](_0x42f72b,_0x3dd3cc)[_0xa1ff('0xa')](function(_0x1d41f3){logger['info'](_0xa1ff('0xb'),_0x4af077,_0xa1ff('0xc'));logger['debug'](_0xa1ff('0xd'),_0x4af077,_0xa1ff('0xc'),JSON[_0xa1ff('0xe')](_0x1d41f3));if(_0x1d41f3[_0xa1ff('0xf')]){if(_0x1d41f3['error']['code']===0x1f4){logger[_0xa1ff('0xf')](_0xa1ff('0xb'),_0x4af077,_0x1d41f3[_0xa1ff('0xf')][_0xa1ff('0x10')]);return _0x1ba2e3(_0x1d41f3[_0xa1ff('0xf')][_0xa1ff('0x10')]);}logger[_0xa1ff('0xf')](_0xa1ff('0xb'),_0x4af077,_0x1d41f3['error'][_0xa1ff('0x10')]);return _0x5f3cea(_0x1d41f3[_0xa1ff('0xf')]['message']);}else{logger[_0xa1ff('0x11')](_0xa1ff('0xb'),_0x4af077,_0xa1ff('0xc'));_0x5f3cea(_0x1d41f3['result']['message']);}})['catch'](function(_0x1981c5){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x4af077,_0x1981c5);_0x1ba2e3(_0x1981c5);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index b63b837..85d4d2e 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 _0x3027=['/:id','post','create','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x3667c4,_0x4b64bd){var _0x12a5a2=function(_0x1fb407){while(--_0x1fb407){_0x3667c4['push'](_0x3667c4['shift']());}};_0x12a5a2(++_0x4b64bd);}(_0x3027,0x19e));var _0x7302=function(_0x432d65,_0x1cb101){_0x432d65=_0x432d65-0x0;var _0x4669dc=_0x3027[_0x432d65];return _0x4669dc;};'use strict';var multer=require(_0x7302('0x0'));var util=require(_0x7302('0x1'));var path=require('path');var timeout=require(_0x7302('0x2'));var express=require(_0x7302('0x3'));var router=express['Router']();var fs_extra=require(_0x7302('0x4'));var auth=require(_0x7302('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7302('0x6'));var controller=require('./userProfileSection.controller');router[_0x7302('0x7')]('/',auth[_0x7302('0x8')](),controller[_0x7302('0x9')]);router[_0x7302('0x7')]('/describe',auth[_0x7302('0x8')](),controller[_0x7302('0xa')]);router[_0x7302('0x7')](_0x7302('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7302('0xc')]('/',auth['isAuthenticated'](),controller[_0x7302('0xd')]);router['put'](_0x7302('0xb'),auth['isAuthenticated'](),controller[_0x7302('0xe')]);router[_0x7302('0xf')](_0x7302('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7302('0x10')]=router; \ No newline at end of file +var _0xc147=['./userProfileSection.controller','get','isAuthenticated','/describe','describe','show','post','put','update','delete','/:id','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x229856,_0x55346b){var _0x36be00=function(_0x484ae3){while(--_0x484ae3){_0x229856['push'](_0x229856['shift']());}};_0x36be00(++_0x55346b);}(_0xc147,0xdf));var _0x7c14=function(_0x162246,_0x4e5038){_0x162246=_0x162246-0x0;var _0x32ac95=_0xc147[_0x162246];return _0x32ac95;};'use strict';var multer=require(_0x7c14('0x0'));var util=require(_0x7c14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7c14('0x2'));var router=express[_0x7c14('0x3')]();var fs_extra=require(_0x7c14('0x4'));var auth=require(_0x7c14('0x5'));var interaction=require(_0x7c14('0x6'));var config=require(_0x7c14('0x7'));var controller=require(_0x7c14('0x8'));router[_0x7c14('0x9')]('/',auth[_0x7c14('0xa')](),controller['index']);router[_0x7c14('0x9')](_0x7c14('0xb'),auth[_0x7c14('0xa')](),controller[_0x7c14('0xc')]);router['get']('/:id',auth[_0x7c14('0xa')](),controller[_0x7c14('0xd')]);router[_0x7c14('0xe')]('/',auth[_0x7c14('0xa')](),controller['create']);router[_0x7c14('0xf')]('/:id',auth[_0x7c14('0xa')](),controller[_0x7c14('0x10')]);router[_0x7c14('0x11')](_0x7c14('0x12'),auth['isAuthenticated'](),controller[_0x7c14('0x13')]);module[_0x7c14('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 65c62cf..6cb2f6d 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 _0xf4f4=['INTEGER','BOOLEAN','setDataValue','join','getDataValue','crudPermissions','split','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x137767,_0x43242f){_0x137767=_0x137767-0x0;var _0x4e5ecb=_0xf4f4[_0x137767];return _0x4e5ecb;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4f4f('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4f4f('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4f4f('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4f4f('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4f4f('0x2')],'set':function(_0x510b24){this[_0x4f4f('0x5')]('crudPermissions',_0x510b24?_0x510b24[_0x4f4f('0x6')](''):[]);},'get':function(){return this[_0x4f4f('0x7')](_0x4f4f('0x8'))?this[_0x4f4f('0x7')](_0x4f4f('0x8'))[_0x4f4f('0x9')](''):[];}}}; \ No newline at end of file +var _0x5b12=['split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','getDataValue','crudPermissions'];(function(_0x2ce7e6,_0x99757f){var _0x3261ac=function(_0x3ba4ee){while(--_0x3ba4ee){_0x2ce7e6['push'](_0x2ce7e6['shift']());}};_0x3261ac(++_0x99757f);}(_0x5b12,0xa3));var _0x25b1=function(_0x204d92,_0x284fdf){_0x204d92=_0x204d92-0x0;var _0x4d7a97=_0x5b12[_0x204d92];return _0x4d7a97;};'use strict';var Sequelize=require(_0x25b1('0x0'));module[_0x25b1('0x1')]={'name':{'type':Sequelize[_0x25b1('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x25b1('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x25b1('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x25b1('0x2')],'set':function(_0x47995b){this[_0x25b1('0x5')]('crudPermissions',_0x47995b?_0x47995b['join'](''):[]);},'get':function(){return this[_0x25b1('0x6')]('crudPermissions')?this['getDataValue'](_0x25b1('0x7'))[_0x25b1('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index ec89fa0..b02ccdb 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 _0xf579=['moment','bluebird','mustache','util','path','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','map','UserProfileSection','rawAttributes','key','query','filters','intersection','model','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','fields','length','create','update','body','find','describe','rimraf','zip-dir','request-promise'];(function(_0x25b78d,_0x347586){var _0x3d04f5=function(_0x1c0c81){while(--_0x1c0c81){_0x25b78d['push'](_0x25b78d['shift']());}};_0x3d04f5(++_0x347586);}(_0xf579,0x87));var _0x9f57=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf579[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f57('0x0'));var zipdir=require(_0x9f57('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f57('0x2'));var moment=require(_0x9f57('0x3'));var BPromise=require(_0x9f57('0x4'));var Mustache=require(_0x9f57('0x5'));var util=require(_0x9f57('0x6'));var path=require(_0x9f57('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9f57('0x8'));var _=require(_0x9f57('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9f57('0xa'));var toCsv=require(_0x9f57('0xb'));var querystring=require(_0x9f57('0xc'));var Papa=require(_0x9f57('0xd'));var Redis=require(_0x9f57('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9f57('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f57('0x10'));var logger=require(_0x9f57('0x11'))(_0x9f57('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9f57('0x13'));var db=require(_0x9f57('0x14'))['db'];function respondWithStatusCode(_0x1b1845,_0x13873b){_0x13873b=_0x13873b||0xcc;return function(_0x12cba0){if(_0x12cba0){return _0x1b1845[_0x9f57('0x15')](_0x13873b);}return _0x1b1845[_0x9f57('0x16')](_0x13873b)[_0x9f57('0x17')]();};}function respondWithResult(_0xc8d0f,_0x31d600){_0x31d600=_0x31d600||0xc8;return function(_0x4343a5){if(_0x4343a5){return _0xc8d0f[_0x9f57('0x16')](_0x31d600)['json'](_0x4343a5);}};}function respondWithFilteredResult(_0x132b68,_0x89fb4e){return function(_0xaf2ea7){if(_0xaf2ea7){var _0x51499d=typeof _0x89fb4e[_0x9f57('0x18')]===_0x9f57('0x19')&&typeof _0x89fb4e[_0x9f57('0x1a')]==='undefined';var _0x338f38=_0xaf2ea7['count'];var _0x5e330e=_0x51499d?0x0:_0x89fb4e[_0x9f57('0x18')];var _0x2f0b4c=_0x51499d?_0xaf2ea7[_0x9f57('0x1b')]:_0x89fb4e[_0x9f57('0x18')]+_0x89fb4e['limit'];var _0x539c11;if(_0x2f0b4c>=_0x338f38){_0x2f0b4c=_0x338f38;_0x539c11=0xc8;}else{_0x539c11=0xce;}_0x132b68[_0x9f57('0x16')](_0x539c11);return _0x132b68[_0x9f57('0x1c')](_0x9f57('0x1d'),_0x5e330e+'-'+_0x2f0b4c+'/'+_0x338f38)[_0x9f57('0x1e')](_0xaf2ea7);}return null;};}function patchUpdates(_0x47cd32){return function(_0x497559){try{jsonpatch[_0x9f57('0x1f')](_0x497559,_0x47cd32,!![]);}catch(_0x1f12c0){return BPromise[_0x9f57('0x20')](_0x1f12c0);}return _0x497559['save']();};}function saveUpdates(_0x1a95ce,_0xea764f){return function(_0x26d940){if(_0x26d940){return _0x26d940['update'](_0x1a95ce)[_0x9f57('0x21')](function(_0x38fac5){return _0x38fac5;});}return null;};}function removeEntity(_0x82727b,_0x424f4d){return function(_0x911b19){if(_0x911b19){return _0x911b19[_0x9f57('0x22')]()['then'](function(){_0x82727b[_0x9f57('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ce83e,_0x3c68d1){return function(_0x523806){if(!_0x523806){_0x1ce83e['sendStatus'](0x194);}return _0x523806;};}function handleError(_0x5cbfe1,_0x33367b){_0x33367b=_0x33367b||0x1f4;return function(_0x540b96){logger[_0x9f57('0x23')](_0x540b96[_0x9f57('0x24')]);if(_0x540b96[_0x9f57('0x25')]){delete _0x540b96[_0x9f57('0x25')];}_0x5cbfe1[_0x9f57('0x16')](_0x33367b)['send'](_0x540b96);};}exports['index']=function(_0x27e90c,_0x450e1d){var _0x2f68f2={},_0x35e3c9={},_0x398dca={'count':0x0,'rows':[]};var _0x3571c7=_[_0x9f57('0x26')](db[_0x9f57('0x27')][_0x9f57('0x28')],function(_0x34737a){return{'name':_0x34737a['fieldName'],'type':_0x34737a['type'][_0x9f57('0x29')]};});_0x35e3c9['model']=_[_0x9f57('0x26')](_0x3571c7,_0x9f57('0x25'));_0x35e3c9[_0x9f57('0x2a')]=_['keys'](_0x27e90c[_0x9f57('0x2a')]);_0x35e3c9[_0x9f57('0x2b')]=_[_0x9f57('0x2c')](_0x35e3c9[_0x9f57('0x2d')],_0x35e3c9[_0x9f57('0x2a')]);_0x2f68f2[_0x9f57('0x2e')]=_['intersection'](_0x35e3c9['model'],qs['fields'](_0x27e90c[_0x9f57('0x2a')]['fields']));_0x2f68f2[_0x9f57('0x2e')]=_0x2f68f2[_0x9f57('0x2e')]['length']?_0x2f68f2['attributes']:_0x35e3c9[_0x9f57('0x2d')];if(!_0x27e90c['query'][_0x9f57('0x2f')]('nolimit')){_0x2f68f2[_0x9f57('0x1a')]=qs[_0x9f57('0x1a')](_0x27e90c[_0x9f57('0x2a')][_0x9f57('0x1a')]);_0x2f68f2[_0x9f57('0x18')]=qs['offset'](_0x27e90c['query'][_0x9f57('0x18')]);}_0x2f68f2[_0x9f57('0x30')]=qs['sort'](_0x27e90c['query'][_0x9f57('0x31')]);_0x2f68f2[_0x9f57('0x32')]=qs[_0x9f57('0x2b')](_[_0x9f57('0x33')](_0x27e90c[_0x9f57('0x2a')],_0x35e3c9[_0x9f57('0x2b')]),_0x3571c7);if(_0x27e90c[_0x9f57('0x2a')][_0x9f57('0x34')]){_0x2f68f2[_0x9f57('0x32')]=_[_0x9f57('0x35')](_0x2f68f2[_0x9f57('0x32')],{'$or':_['map'](_0x3571c7,function(_0x4de921){if(_0x4de921['type']!=='VIRTUAL'){var _0x598ec2={};_0x598ec2[_0x4de921[_0x9f57('0x25')]]={'$like':'%'+_0x27e90c['query'][_0x9f57('0x34')]+'%'};return _0x598ec2;}})});}_0x2f68f2=_[_0x9f57('0x35')]({},_0x2f68f2,_0x27e90c[_0x9f57('0x36')]);var _0x476ffd={'where':_0x2f68f2[_0x9f57('0x32')]};return db[_0x9f57('0x27')][_0x9f57('0x1b')](_0x476ffd)['then'](function(_0x29d9fa){_0x398dca['count']=_0x29d9fa;if(_0x27e90c[_0x9f57('0x2a')][_0x9f57('0x37')]){_0x2f68f2[_0x9f57('0x38')]=[{'all':!![]}];}return db[_0x9f57('0x27')][_0x9f57('0x39')](_0x2f68f2);})['then'](function(_0x36dcdf){_0x398dca['rows']=_0x36dcdf;return _0x398dca;})[_0x9f57('0x21')](respondWithFilteredResult(_0x450e1d,_0x2f68f2))[_0x9f57('0x3a')](handleError(_0x450e1d,null));};exports[_0x9f57('0x3b')]=function(_0x30d840,_0x469f06){var _0x5110b2={'raw':![],'where':{'id':_0x30d840[_0x9f57('0x3c')]['id']}},_0x12b850={};_0x12b850[_0x9f57('0x2d')]=_['keys'](db[_0x9f57('0x27')]['rawAttributes']);_0x12b850[_0x9f57('0x2a')]=_[_0x9f57('0x3d')](_0x30d840[_0x9f57('0x2a')]);_0x12b850[_0x9f57('0x2b')]=_[_0x9f57('0x2c')](_0x12b850[_0x9f57('0x2d')],_0x12b850[_0x9f57('0x2a')]);_0x5110b2[_0x9f57('0x2e')]=_[_0x9f57('0x2c')](_0x12b850[_0x9f57('0x2d')],qs[_0x9f57('0x3e')](_0x30d840[_0x9f57('0x2a')][_0x9f57('0x3e')]));_0x5110b2[_0x9f57('0x2e')]=_0x5110b2[_0x9f57('0x2e')][_0x9f57('0x3f')]?_0x5110b2[_0x9f57('0x2e')]:_0x12b850[_0x9f57('0x2d')];if(_0x30d840[_0x9f57('0x2a')][_0x9f57('0x37')]){_0x5110b2[_0x9f57('0x38')]=[{'all':!![]}];}_0x5110b2=_[_0x9f57('0x35')]({},_0x5110b2,_0x30d840['options']);return db[_0x9f57('0x27')]['find'](_0x5110b2)['then'](handleEntityNotFound(_0x469f06,null))[_0x9f57('0x21')](respondWithResult(_0x469f06,null))['catch'](handleError(_0x469f06,null));};exports[_0x9f57('0x40')]=function(_0x46e945,_0x115c5){return db[_0x9f57('0x27')]['create'](_0x46e945['body'],{})[_0x9f57('0x21')](respondWithResult(_0x115c5,0xc9))[_0x9f57('0x3a')](handleError(_0x115c5,null));};exports[_0x9f57('0x41')]=function(_0x3e18f5,_0x4c5be3){if(_0x3e18f5[_0x9f57('0x42')]['id']){delete _0x3e18f5[_0x9f57('0x42')]['id'];}return db['UserProfileSection'][_0x9f57('0x43')]({'where':{'id':_0x3e18f5[_0x9f57('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4c5be3,null))[_0x9f57('0x21')](saveUpdates(_0x3e18f5[_0x9f57('0x42')],null))[_0x9f57('0x21')](respondWithResult(_0x4c5be3,null))[_0x9f57('0x3a')](handleError(_0x4c5be3,null));};exports[_0x9f57('0x22')]=function(_0x3fcd7e,_0x19f784){return db[_0x9f57('0x27')][_0x9f57('0x43')]({'where':{'id':_0x3fcd7e[_0x9f57('0x3c')]['id']}})['then'](handleEntityNotFound(_0x19f784,null))[_0x9f57('0x21')](removeEntity(_0x19f784,null))[_0x9f57('0x3a')](handleError(_0x19f784,null));};exports[_0x9f57('0x44')]=function(_0x4299ed,_0x4b531e){return db[_0x9f57('0x27')][_0x9f57('0x44')]()['then'](respondWithResult(_0x4b531e,null))[_0x9f57('0x3a')](handleError(_0x4b531e,null));}; \ No newline at end of file +var _0xb58c=['stack','name','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','then','show','params','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','error'];(function(_0x1c4ce8,_0x32930f){var _0x1150c1=function(_0x230b95){while(--_0x230b95){_0x1c4ce8['push'](_0x1c4ce8['shift']());}};_0x1150c1(++_0x32930f);}(_0xb58c,0x153));var _0xcb58=function(_0x1797f7,_0xc54dc3){_0x1797f7=_0x1797f7-0x0;var _0x3dc2ec=_0xb58c[_0x1797f7];return _0x3dc2ec;};'use strict';var emlformat=require(_0xcb58('0x0'));var rimraf=require(_0xcb58('0x1'));var zipdir=require(_0xcb58('0x2'));var jsonpatch=require(_0xcb58('0x3'));var rp=require('request-promise');var moment=require(_0xcb58('0x4'));var BPromise=require(_0xcb58('0x5'));var Mustache=require(_0xcb58('0x6'));var util=require(_0xcb58('0x7'));var path=require(_0xcb58('0x8'));var sox=require(_0xcb58('0x9'));var csv=require(_0xcb58('0xa'));var ejs=require(_0xcb58('0xb'));var fs=require('fs');var fs_extra=require(_0xcb58('0xc'));var _=require(_0xcb58('0xd'));var squel=require(_0xcb58('0xe'));var crypto=require(_0xcb58('0xf'));var jsforce=require(_0xcb58('0x10'));var deskjs=require(_0xcb58('0x11'));var toCsv=require(_0xcb58('0xa'));var querystring=require(_0xcb58('0x12'));var Papa=require(_0xcb58('0x13'));var Redis=require(_0xcb58('0x14'));var authService=require(_0xcb58('0x15'));var qs=require(_0xcb58('0x16'));var as=require(_0xcb58('0x17'));var hardwareService=require(_0xcb58('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0xcb58('0x19'));var config=require(_0xcb58('0x1a'));var licenseUtil=require(_0xcb58('0x1b'));var db=require(_0xcb58('0x1c'))['db'];function respondWithStatusCode(_0x14b346,_0x1c0cd1){_0x1c0cd1=_0x1c0cd1||0xcc;return function(_0x274ca6){if(_0x274ca6){return _0x14b346[_0xcb58('0x1d')](_0x1c0cd1);}return _0x14b346[_0xcb58('0x1e')](_0x1c0cd1)[_0xcb58('0x1f')]();};}function respondWithResult(_0x176267,_0x4329a8){_0x4329a8=_0x4329a8||0xc8;return function(_0x5161c1){if(_0x5161c1){return _0x176267[_0xcb58('0x1e')](_0x4329a8)[_0xcb58('0x20')](_0x5161c1);}};}function respondWithFilteredResult(_0x20d783,_0x286507){return function(_0x32af9a){if(_0x32af9a){var _0x4e0ad3=typeof _0x286507[_0xcb58('0x21')]==='undefined'&&typeof _0x286507[_0xcb58('0x22')]===_0xcb58('0x23');var _0x53fdd9=_0x32af9a[_0xcb58('0x24')];var _0xb0e8f7=_0x4e0ad3?0x0:_0x286507[_0xcb58('0x21')];var _0x20574c=_0x4e0ad3?_0x32af9a[_0xcb58('0x24')]:_0x286507[_0xcb58('0x21')]+_0x286507[_0xcb58('0x22')];var _0x402311;if(_0x20574c>=_0x53fdd9){_0x20574c=_0x53fdd9;_0x402311=0xc8;}else{_0x402311=0xce;}_0x20d783['status'](_0x402311);return _0x20d783['set'](_0xcb58('0x25'),_0xb0e8f7+'-'+_0x20574c+'/'+_0x53fdd9)[_0xcb58('0x20')](_0x32af9a);}return null;};}function patchUpdates(_0x1b8773){return function(_0x1b0570){try{jsonpatch[_0xcb58('0x26')](_0x1b0570,_0x1b8773,!![]);}catch(_0x222ff3){return BPromise['reject'](_0x222ff3);}return _0x1b0570[_0xcb58('0x27')]();};}function saveUpdates(_0x4ef503,_0x34ed37){return function(_0x37c99e){if(_0x37c99e){return _0x37c99e['update'](_0x4ef503)['then'](function(_0x25ff9e){return _0x25ff9e;});}return null;};}function removeEntity(_0x2cbe93,_0x448446){return function(_0x3ec736){if(_0x3ec736){return _0x3ec736['destroy']()['then'](function(){_0x2cbe93[_0xcb58('0x1e')](0xcc)[_0xcb58('0x1f')]();});}};}function handleEntityNotFound(_0x35ec34,_0x26e28b){return function(_0x21e093){if(!_0x21e093){_0x35ec34[_0xcb58('0x1d')](0x194);}return _0x21e093;};}function handleError(_0x415884,_0x56c851){_0x56c851=_0x56c851||0x1f4;return function(_0x347990){logger[_0xcb58('0x28')](_0x347990[_0xcb58('0x29')]);if(_0x347990['name']){delete _0x347990[_0xcb58('0x2a')];}_0x415884[_0xcb58('0x1e')](_0x56c851)['send'](_0x347990);};}exports[_0xcb58('0x2b')]=function(_0x24f4bb,_0x3e42bd){var _0x4749e1={},_0x1b75f1={},_0x53fc20={'count':0x0,'rows':[]};var _0x368588=_[_0xcb58('0x2c')](db[_0xcb58('0x2d')][_0xcb58('0x2e')],function(_0x24db95){return{'name':_0x24db95[_0xcb58('0x2f')],'type':_0x24db95[_0xcb58('0x30')][_0xcb58('0x31')]};});_0x1b75f1[_0xcb58('0x32')]=_[_0xcb58('0x2c')](_0x368588,'name');_0x1b75f1[_0xcb58('0x33')]=_[_0xcb58('0x34')](_0x24f4bb[_0xcb58('0x33')]);_0x1b75f1['filters']=_[_0xcb58('0x35')](_0x1b75f1[_0xcb58('0x32')],_0x1b75f1['query']);_0x4749e1[_0xcb58('0x36')]=_[_0xcb58('0x35')](_0x1b75f1[_0xcb58('0x32')],qs[_0xcb58('0x37')](_0x24f4bb[_0xcb58('0x33')]['fields']));_0x4749e1[_0xcb58('0x36')]=_0x4749e1['attributes'][_0xcb58('0x38')]?_0x4749e1[_0xcb58('0x36')]:_0x1b75f1[_0xcb58('0x32')];if(!_0x24f4bb['query']['hasOwnProperty'](_0xcb58('0x39'))){_0x4749e1[_0xcb58('0x22')]=qs['limit'](_0x24f4bb[_0xcb58('0x33')][_0xcb58('0x22')]);_0x4749e1[_0xcb58('0x21')]=qs['offset'](_0x24f4bb[_0xcb58('0x33')][_0xcb58('0x21')]);}_0x4749e1['order']=qs[_0xcb58('0x3a')](_0x24f4bb[_0xcb58('0x33')][_0xcb58('0x3a')]);_0x4749e1[_0xcb58('0x3b')]=qs[_0xcb58('0x3c')](_[_0xcb58('0x3d')](_0x24f4bb[_0xcb58('0x33')],_0x1b75f1['filters']),_0x368588);if(_0x24f4bb[_0xcb58('0x33')][_0xcb58('0x3e')]){_0x4749e1['where']=_['merge'](_0x4749e1[_0xcb58('0x3b')],{'$or':_[_0xcb58('0x2c')](_0x368588,function(_0x291a21){if(_0x291a21['type']!==_0xcb58('0x3f')){var _0x4bef31={};_0x4bef31[_0x291a21[_0xcb58('0x2a')]]={'$like':'%'+_0x24f4bb[_0xcb58('0x33')][_0xcb58('0x3e')]+'%'};return _0x4bef31;}})});}_0x4749e1=_[_0xcb58('0x40')]({},_0x4749e1,_0x24f4bb[_0xcb58('0x41')]);var _0x54ed9a={'where':_0x4749e1[_0xcb58('0x3b')]};return db['UserProfileSection'][_0xcb58('0x24')](_0x54ed9a)['then'](function(_0x27a756){_0x53fc20[_0xcb58('0x24')]=_0x27a756;if(_0x24f4bb['query'][_0xcb58('0x42')]){_0x4749e1['include']=[{'all':!![]}];}return db[_0xcb58('0x2d')][_0xcb58('0x43')](_0x4749e1);})['then'](function(_0x132e97){_0x53fc20['rows']=_0x132e97;return _0x53fc20;})[_0xcb58('0x44')](respondWithFilteredResult(_0x3e42bd,_0x4749e1))['catch'](handleError(_0x3e42bd,null));};exports[_0xcb58('0x45')]=function(_0x367261,_0x4eda00){var _0x404f84={'raw':![],'where':{'id':_0x367261[_0xcb58('0x46')]['id']}},_0x8ab730={};_0x8ab730[_0xcb58('0x32')]=_[_0xcb58('0x34')](db['UserProfileSection'][_0xcb58('0x2e')]);_0x8ab730[_0xcb58('0x33')]=_['keys'](_0x367261['query']);_0x8ab730[_0xcb58('0x3c')]=_[_0xcb58('0x35')](_0x8ab730[_0xcb58('0x32')],_0x8ab730[_0xcb58('0x33')]);_0x404f84[_0xcb58('0x36')]=_[_0xcb58('0x35')](_0x8ab730[_0xcb58('0x32')],qs[_0xcb58('0x37')](_0x367261[_0xcb58('0x33')][_0xcb58('0x37')]));_0x404f84[_0xcb58('0x36')]=_0x404f84[_0xcb58('0x36')][_0xcb58('0x38')]?_0x404f84[_0xcb58('0x36')]:_0x8ab730[_0xcb58('0x32')];if(_0x367261[_0xcb58('0x33')]['includeAll']){_0x404f84['include']=[{'all':!![]}];}_0x404f84=_[_0xcb58('0x40')]({},_0x404f84,_0x367261[_0xcb58('0x41')]);return db[_0xcb58('0x2d')][_0xcb58('0x47')](_0x404f84)[_0xcb58('0x44')](handleEntityNotFound(_0x4eda00,null))[_0xcb58('0x44')](respondWithResult(_0x4eda00,null))[_0xcb58('0x48')](handleError(_0x4eda00,null));};exports['create']=function(_0x3b23fb,_0x4d87e9){return db[_0xcb58('0x2d')][_0xcb58('0x49')](_0x3b23fb[_0xcb58('0x4a')],{})[_0xcb58('0x44')](respondWithResult(_0x4d87e9,0xc9))[_0xcb58('0x48')](handleError(_0x4d87e9,null));};exports[_0xcb58('0x4b')]=function(_0x5b3abf,_0x3df5c4){if(_0x5b3abf[_0xcb58('0x4a')]['id']){delete _0x5b3abf[_0xcb58('0x4a')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x5b3abf[_0xcb58('0x46')]['id']}})['then'](handleEntityNotFound(_0x3df5c4,null))[_0xcb58('0x44')](saveUpdates(_0x5b3abf[_0xcb58('0x4a')],null))[_0xcb58('0x44')](respondWithResult(_0x3df5c4,null))['catch'](handleError(_0x3df5c4,null));};exports['destroy']=function(_0x2353a9,_0x13363f){return db[_0xcb58('0x2d')][_0xcb58('0x47')]({'where':{'id':_0x2353a9[_0xcb58('0x46')]['id']}})[_0xcb58('0x44')](handleEntityNotFound(_0x13363f,null))[_0xcb58('0x44')](removeEntity(_0x13363f,null))[_0xcb58('0x48')](handleError(_0x13363f,null));};exports['describe']=function(_0xf09037,_0x72122){return db[_0xcb58('0x2d')]['describe']()['then'](respondWithResult(_0x72122,null))[_0xcb58('0x48')](handleError(_0x72122,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 9ea34ab..0d4c05c 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 _0x1d0e=['path','rimraf','./userProfileSection.attributes','exports','UserProfileSection','sectionId','userProfileId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d0e,0x1b4));var _0xe1d0=function(_0x4dc4a6,_0x1ad114){_0x4dc4a6=_0x4dc4a6-0x0;var _0x3b82c8=_0x1d0e[_0x4dc4a6];return _0x3b82c8;};'use strict';var _=require('lodash');var util=require(_0xe1d0('0x0'));var logger=require(_0xe1d0('0x1'))(_0xe1d0('0x2'));var moment=require(_0xe1d0('0x3'));var BPromise=require(_0xe1d0('0x4'));var rp=require(_0xe1d0('0x5'));var fs=require('fs');var path=require(_0xe1d0('0x6'));var rimraf=require(_0xe1d0('0x7'));var config=require('../../config/environment');var attributes=require(_0xe1d0('0x8'));module[_0xe1d0('0x9')]=function(_0x209ca7,_0x79eb77){return _0x209ca7['define'](_0xe1d0('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xe1d0('0xb'),_0xe1d0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf2d8=['compositeIndex','sectionId','userProfileId','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections'];(function(_0x2d42b7,_0x391076){var _0x3ac15a=function(_0x38ec34){while(--_0x38ec34){_0x2d42b7['push'](_0x2d42b7['shift']());}};_0x3ac15a(++_0x391076);}(_0xf2d8,0x103));var _0x8f2d=function(_0x474d72,_0x29a688){_0x474d72=_0x474d72-0x0;var _0x2b7b59=_0xf2d8[_0x474d72];return _0x2b7b59;};'use strict';var _=require(_0x8f2d('0x0'));var util=require(_0x8f2d('0x1'));var logger=require('../../config/logger')(_0x8f2d('0x2'));var moment=require('moment');var BPromise=require(_0x8f2d('0x3'));var rp=require(_0x8f2d('0x4'));var fs=require('fs');var path=require(_0x8f2d('0x5'));var rimraf=require(_0x8f2d('0x6'));var config=require(_0x8f2d('0x7'));var attributes=require(_0x8f2d('0x8'));module[_0x8f2d('0x9')]=function(_0x508854,_0x2c397f){return _0x508854[_0x8f2d('0xa')](_0x8f2d('0xb'),attributes,{'tableName':_0x8f2d('0xc'),'paranoid':![],'indexes':[{'name':_0x8f2d('0xd'),'fields':[_0x8f2d('0xe'),_0x8f2d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 2834145..19f5c12 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 _0xa027=['rpc','../../config/environment','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1c6c57,_0x18e7e5){var _0x3a91c6=function(_0x177bf1){while(--_0x177bf1){_0x1c6c57['push'](_0x1c6c57['shift']());}};_0x3a91c6(++_0x18e7e5);}(_0xa027,0x1dd));var _0x7a02=function(_0x4c062a,_0x38fe55){_0x4c062a=_0x4c062a-0x0;var _0x4cdd4b=_0xa027[_0x4c062a];return _0x4cdd4b;};'use strict';var _=require(_0x7a02('0x0'));var util=require('util');var moment=require(_0x7a02('0x1'));var BPromise=require(_0x7a02('0x2'));var rs=require(_0x7a02('0x3'));var fs=require('fs');var Redis=require(_0x7a02('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a02('0x5'));var logger=require(_0x7a02('0x6'))(_0x7a02('0x7'));var config=require(_0x7a02('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7a02('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c0654,_0x5d8589,_0xca4179){return new BPromise(function(_0x47fac1,_0x420418){return client[_0x7a02('0xa')](_0x5c0654,_0xca4179)[_0x7a02('0xb')](function(_0x3faf07){logger[_0x7a02('0xc')](_0x7a02('0xd'),_0x5d8589,_0x7a02('0xe'));logger[_0x7a02('0xf')](_0x7a02('0x10'),_0x5d8589,_0x7a02('0xe'),JSON[_0x7a02('0x11')](_0x3faf07));if(_0x3faf07[_0x7a02('0x12')]){if(_0x3faf07['error'][_0x7a02('0x13')]===0x1f4){logger[_0x7a02('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x5d8589,_0x3faf07['error']['message']);return _0x420418(_0x3faf07[_0x7a02('0x12')]['message']);}logger['error'](_0x7a02('0xd'),_0x5d8589,_0x3faf07[_0x7a02('0x12')][_0x7a02('0x14')]);return _0x47fac1(_0x3faf07[_0x7a02('0x12')]['message']);}else{logger[_0x7a02('0xc')](_0x7a02('0xd'),_0x5d8589,_0x7a02('0xe'));_0x47fac1(_0x3faf07[_0x7a02('0x15')]['message']);}})['catch'](function(_0x5403dd){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x5d8589,_0x5403dd);_0x420418(_0x5403dd);});});} \ No newline at end of file +var _0xb7a6=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x34c3ac,_0x40a7f4){var _0x6661a1=function(_0x14f2ec){while(--_0x14f2ec){_0x34c3ac['push'](_0x34c3ac['shift']());}};_0x6661a1(++_0x40a7f4);}(_0xb7a6,0x189));var _0x6b7a=function(_0x5d6042,_0x58087d){_0x5d6042=_0x5d6042-0x0;var _0x2bb80c=_0xb7a6[_0x5d6042];return _0x2bb80c;};'use strict';var _=require('lodash');var util=require(_0x6b7a('0x0'));var moment=require(_0x6b7a('0x1'));var BPromise=require(_0x6b7a('0x2'));var rs=require(_0x6b7a('0x3'));var fs=require('fs');var Redis=require(_0x6b7a('0x4'));var db=require(_0x6b7a('0x5'))['db'];var utils=require(_0x6b7a('0x6'));var logger=require(_0x6b7a('0x7'))(_0x6b7a('0x8'));var config=require('../../config/environment');var jayson=require(_0x6b7a('0x9'));var client=jayson[_0x6b7a('0xa')][_0x6b7a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58e08d,_0x210abe,_0x56dee7){return new BPromise(function(_0x2f24b6,_0x30bbcb){return client[_0x6b7a('0xc')](_0x58e08d,_0x56dee7)[_0x6b7a('0xd')](function(_0x5a2c02){logger[_0x6b7a('0xe')](_0x6b7a('0xf'),_0x210abe,_0x6b7a('0x10'));logger[_0x6b7a('0x11')](_0x6b7a('0x12'),_0x210abe,_0x6b7a('0x10'),JSON[_0x6b7a('0x13')](_0x5a2c02));if(_0x5a2c02[_0x6b7a('0x14')]){if(_0x5a2c02['error'][_0x6b7a('0x15')]===0x1f4){logger[_0x6b7a('0x14')](_0x6b7a('0xf'),_0x210abe,_0x5a2c02[_0x6b7a('0x14')][_0x6b7a('0x16')]);return _0x30bbcb(_0x5a2c02[_0x6b7a('0x14')][_0x6b7a('0x16')]);}logger['error'](_0x6b7a('0xf'),_0x210abe,_0x5a2c02['error']['message']);return _0x2f24b6(_0x5a2c02[_0x6b7a('0x14')][_0x6b7a('0x16')]);}else{logger[_0x6b7a('0xe')](_0x6b7a('0xf'),_0x210abe,'request\x20sent');_0x2f24b6(_0x5a2c02[_0x6b7a('0x17')][_0x6b7a('0x16')]);}})[_0x6b7a('0x18')](function(_0x41a1f6){logger[_0x6b7a('0x14')](_0x6b7a('0xf'),_0x210abe,_0x41a1f6);_0x30bbcb(_0x41a1f6);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 1d483a9..0ef1ad3 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xd95a4f,_0x5b2faf){var _0x913026=function(_0x4e9711){while(--_0x4e9711){_0xd95a4f['push'](_0xd95a4f['shift']());}};_0x913026(++_0x5b2faf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5842b9,_0xab40c3){var _0x6cdd4c=function(_0x229e97){while(--_0x229e97){_0x5842b9['push'](_0x5842b9['shift']());}};_0x6cdd4c(++_0xab40c3);}(_0xedd9,0xfc));var _0x9edd=function(_0x105858,_0x160924){_0x105858=_0x105858-0x0;var _0x578ddf=_0xedd9[_0x105858];return _0x578ddf;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index adf3eb0..a3d4c20 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 _0xbda9=['exports','INTEGER','sequelize'];(function(_0x57c526,_0x9c18ae){var _0x50a8e4=function(_0x1f3e0b){while(--_0x1f3e0b){_0x57c526['push'](_0x57c526['shift']());}};_0x50a8e4(++_0x9c18ae);}(_0xbda9,0x101));var _0x9bda=function(_0x158965,_0x117f97){_0x158965=_0x158965-0x0;var _0x3a3e9d=_0xbda9[_0x158965];return _0x3a3e9d;};'use strict';var Sequelize=require(_0x9bda('0x0'));module[_0x9bda('0x1')]={'penalty':{'type':Sequelize[_0x9bda('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0a2f=['INTEGER','sequelize'];(function(_0x35c591,_0x4096e7){var _0x5430ef=function(_0x49d27b){while(--_0x49d27b){_0x35c591['push'](_0x35c591['shift']());}};_0x5430ef(++_0x4096e7);}(_0x0a2f,0x6b));var _0xf0a2=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x0a2f[_0x179e11];return _0x549f04;};'use strict';var Sequelize=require(_0xf0a2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xf0a2('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 6f9fcf2..763c7c3 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 _0x2a07=['exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes'];(function(_0x2b687a,_0x4e2a34){var _0x1fe02a=function(_0x151715){while(--_0x151715){_0x2b687a['push'](_0x2b687a['shift']());}};_0x1fe02a(++_0x4e2a34);}(_0x2a07,0x74));var _0x72a0=function(_0x482b74,_0x4ff641){_0x482b74=_0x482b74-0x0;var _0x3c478f=_0x2a07[_0x482b74];return _0x3c478f;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x794b=['lodash','util','api','moment','path','rimraf','exports','define','UserSmsQueue','user_has_sms_queues'];(function(_0x322296,_0x57eb19){var _0x432ea7=function(_0x4bd2b3){while(--_0x4bd2b3){_0x322296['push'](_0x322296['shift']());}};_0x432ea7(++_0x57eb19);}(_0x794b,0x1c2));var _0xb794=function(_0x11b293,_0x4dcbfb){_0x11b293=_0x11b293-0x0;var _0x347f4e=_0x794b[_0x11b293];return _0x347f4e;};'use strict';var _=require(_0xb794('0x0'));var util=require(_0xb794('0x1'));var logger=require('../../config/logger')(_0xb794('0x2'));var moment=require(_0xb794('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb794('0x4'));var rimraf=require(_0xb794('0x5'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0xb794('0x6')]=function(_0x338e39,_0xde33a5){return _0x338e39[_0xb794('0x7')](_0xb794('0x8'),attributes,{'tableName':_0xb794('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 9c76723..ff4731a 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 _0x6279=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment'];(function(_0x5ed32c,_0x956025){var _0x271ea3=function(_0x206a21){while(--_0x206a21){_0x5ed32c['push'](_0x5ed32c['shift']());}};_0x271ea3(++_0x956025);}(_0x6279,0x12f));var _0x9627=function(_0x4c5e74,_0x319d00){_0x4c5e74=_0x4c5e74-0x0;var _0x48b7f6=_0x6279[_0x4c5e74];return _0x48b7f6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9627('0x0'));var BPromise=require(_0x9627('0x1'));var rs=require(_0x9627('0x2'));var fs=require('fs');var Redis=require(_0x9627('0x3'));var db=require(_0x9627('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9627('0x5'))('rpc');var config=require(_0x9627('0x6'));var jayson=require(_0x9627('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1551d7,_0x129aef,_0x4b3141){return new BPromise(function(_0x59903b,_0x44cfa9){return client['request'](_0x1551d7,_0x4b3141)[_0x9627('0x8')](function(_0x1f3ff8){logger[_0x9627('0x9')](_0x9627('0xa'),_0x129aef,'request\x20sent');logger[_0x9627('0xb')](_0x9627('0xc'),_0x129aef,'request\x20sent',JSON[_0x9627('0xd')](_0x1f3ff8));if(_0x1f3ff8['error']){if(_0x1f3ff8[_0x9627('0xe')][_0x9627('0xf')]===0x1f4){logger[_0x9627('0xe')](_0x9627('0xa'),_0x129aef,_0x1f3ff8[_0x9627('0xe')]['message']);return _0x44cfa9(_0x1f3ff8[_0x9627('0xe')]['message']);}logger['error'](_0x9627('0xa'),_0x129aef,_0x1f3ff8[_0x9627('0xe')]['message']);return _0x59903b(_0x1f3ff8[_0x9627('0xe')][_0x9627('0x10')]);}else{logger[_0x9627('0x9')]('UserSmsQueue,\x20%s,\x20%s',_0x129aef,'request\x20sent');_0x59903b(_0x1f3ff8[_0x9627('0x11')][_0x9627('0x10')]);}})[_0x9627('0x12')](function(_0x2419e5){logger[_0x9627('0xe')](_0x9627('0xa'),_0x129aef,_0x2419e5);_0x44cfa9(_0x2419e5);});});} \ No newline at end of file +var _0x5e19=['request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x591053,_0x523072){var _0x31ab80=function(_0x4a543f){while(--_0x4a543f){_0x591053['push'](_0x591053['shift']());}};_0x31ab80(++_0x523072);}(_0x5e19,0x96));var _0x95e1=function(_0x31b28d,_0x2bbbac){_0x31b28d=_0x31b28d-0x0;var _0x5651f3=_0x5e19[_0x31b28d];return _0x5651f3;};'use strict';var _=require(_0x95e1('0x0'));var util=require('util');var moment=require(_0x95e1('0x1'));var BPromise=require(_0x95e1('0x2'));var rs=require(_0x95e1('0x3'));var fs=require('fs');var Redis=require(_0x95e1('0x4'));var db=require(_0x95e1('0x5'))['db'];var utils=require(_0x95e1('0x6'));var logger=require(_0x95e1('0x7'))(_0x95e1('0x8'));var config=require(_0x95e1('0x9'));var jayson=require(_0x95e1('0xa'));var client=jayson[_0x95e1('0xb')][_0x95e1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2751a7,_0x5b56a2,_0x4f7221){return new BPromise(function(_0x1ce168,_0x5e05fd){return client[_0x95e1('0xd')](_0x2751a7,_0x4f7221)['then'](function(_0x3b42f1){logger[_0x95e1('0xe')](_0x95e1('0xf'),_0x5b56a2,'request\x20sent');logger[_0x95e1('0x10')](_0x95e1('0x11'),_0x5b56a2,_0x95e1('0x12'),JSON[_0x95e1('0x13')](_0x3b42f1));if(_0x3b42f1['error']){if(_0x3b42f1[_0x95e1('0x14')]['code']===0x1f4){logger[_0x95e1('0x14')](_0x95e1('0xf'),_0x5b56a2,_0x3b42f1[_0x95e1('0x14')][_0x95e1('0x15')]);return _0x5e05fd(_0x3b42f1[_0x95e1('0x14')]['message']);}logger[_0x95e1('0x14')](_0x95e1('0xf'),_0x5b56a2,_0x3b42f1['error']['message']);return _0x1ce168(_0x3b42f1[_0x95e1('0x14')]['message']);}else{logger[_0x95e1('0xe')](_0x95e1('0xf'),_0x5b56a2,_0x95e1('0x12'));_0x1ce168(_0x3b42f1[_0x95e1('0x16')][_0x95e1('0x15')]);}})[_0x95e1('0x17')](function(_0x163e7b){logger[_0x95e1('0x14')](_0x95e1('0xf'),_0x5b56a2,_0x163e7b);_0x5e05fd(_0x163e7b);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 61a185a..d60f3b1 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 _0xcd6a=['INTEGER','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcd6a,0x1b3));var _0xacd6=function(_0x35eae1,_0x15026e){_0x35eae1=_0x35eae1-0x0;var _0x22963d=_0xcd6a[_0x35eae1];return _0x22963d;};'use strict';var Sequelize=require('sequelize');module[_0xacd6('0x0')]={'UserId':{'type':Sequelize[_0xacd6('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xacd6('0x1')]}}; \ No newline at end of file +var _0x5ead=['INTEGER'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x5ead,0x1e0));var _0xd5ea=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5ead[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize[_0xd5ea('0x0')]},'VoicePrefixId':{'type':Sequelize[_0xd5ea('0x0')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 5d3ab27..856c265 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(_0x4f44cc,_0x33deb1){var _0x19c508=function(_0xa5892a){while(--_0xa5892a){_0x4f44cc['push'](_0x4f44cc['shift']());}};_0x19c508(++_0x33deb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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(_0x48af2f,_0x4f8f71){var _0x1cd9e4=function(_0xe41140){while(--_0xe41140){_0x48af2f['push'](_0x48af2f['shift']());}};_0x1cd9e4(++_0x4f8f71);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 9601546..f4363b9 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(_0xc2a5,_0x2d6844){var _0x5b8316=function(_0x3ab8d7){while(--_0x3ab8d7){_0xc2a5['push'](_0xc2a5['shift']());}};_0x5b8316(++_0x2d6844);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xcb91[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x226aef,_0x5f067a){var _0x435450=function(_0x3c8b47){while(--_0x3c8b47){_0x226aef['push'](_0x226aef['shift']());}};_0x435450(++_0x5f067a);}(_0xe706,0xa3));var _0x6e70=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0xe706[_0x3a78a0];return _0x48e917;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 841c1b0..286f121 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 _0x6149=['INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6149,0x165));var _0x9614=function(_0x46833f,_0x285654){_0x46833f=_0x46833f-0x0;var _0xb80091=_0x6149[_0x46833f];return _0xb80091;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x9614('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x09e3=['exports','INTEGER','sequelize'];(function(_0x3a60b8,_0x47caab){var _0x4eb583=function(_0x2251b5){while(--_0x2251b5){_0x3a60b8['push'](_0x3a60b8['shift']());}};_0x4eb583(++_0x47caab);}(_0x09e3,0x134));var _0x309e=function(_0x4c8d75,_0x3682b){_0x4c8d75=_0x4c8d75-0x0;var _0x50cc5a=_0x09e3[_0x4c8d75];return _0x50cc5a;};'use strict';var Sequelize=require(_0x309e('0x0'));module[_0x309e('0x1')]={'penalty':{'type':Sequelize[_0x309e('0x2')],'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 2938721..97372e8 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 _0xe1a9=['./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xe1a9,0x1a8));var _0x9e1a=function(_0x4d8ca8,_0x469ef4){_0x4d8ca8=_0x4d8ca8-0x0;var _0x59db22=_0xe1a9[_0x4d8ca8];return _0x59db22;};'use strict';var _=require(_0x9e1a('0x0'));var util=require(_0x9e1a('0x1'));var logger=require(_0x9e1a('0x2'))(_0x9e1a('0x3'));var moment=require(_0x9e1a('0x4'));var BPromise=require(_0x9e1a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e1a('0x6'));var rimraf=require(_0x9e1a('0x7'));var config=require('../../config/environment');var attributes=require(_0x9e1a('0x8'));module['exports']=function(_0xa879e6,_0x525610){return _0xa879e6[_0x9e1a('0x9')](_0x9e1a('0xa'),attributes,{'tableName':_0x9e1a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcedd=['./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x31ebb5,_0x127830){var _0x419af3=function(_0x4c7d6e){while(--_0x4c7d6e){_0x31ebb5['push'](_0x31ebb5['shift']());}};_0x419af3(++_0x127830);}(_0xcedd,0x68));var _0xdced=function(_0x5c9f77,_0x29172c){_0x5c9f77=_0x5c9f77-0x0;var _0x3a47b9=_0xcedd[_0x5c9f77];return _0x3a47b9;};'use strict';var _=require(_0xdced('0x0'));var util=require(_0xdced('0x1'));var logger=require(_0xdced('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdced('0x3'));var rp=require(_0xdced('0x4'));var fs=require('fs');var path=require(_0xdced('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdced('0x6'));module[_0xdced('0x7')]=function(_0x183a26,_0xe78e99){return _0x183a26[_0xdced('0x8')](_0xdced('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 81cedf0..5864c76 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 _0xc6e6=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x236eb7,_0x41aa3b){var _0xe43173=function(_0x284546){while(--_0x284546){_0x236eb7['push'](_0x236eb7['shift']());}};_0xe43173(++_0x41aa3b);}(_0xc6e6,0x12c));var _0x6c6e=function(_0x139731,_0x4df842){_0x139731=_0x139731-0x0;var _0x4bf109=_0xc6e6[_0x139731];return _0x4bf109;};'use strict';var _=require(_0x6c6e('0x0'));var util=require(_0x6c6e('0x1'));var moment=require('moment');var BPromise=require(_0x6c6e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c6e('0x3'));var db=require(_0x6c6e('0x4'))['db'];var utils=require(_0x6c6e('0x5'));var logger=require(_0x6c6e('0x6'))(_0x6c6e('0x7'));var config=require(_0x6c6e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6c6e('0x9')][_0x6c6e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45013a,_0x3920cb,_0x31ef81){return new BPromise(function(_0x1fddac,_0x3eacf7){return client[_0x6c6e('0xb')](_0x45013a,_0x31ef81)['then'](function(_0x51c170){logger[_0x6c6e('0xc')](_0x6c6e('0xd'),_0x3920cb,_0x6c6e('0xe'));logger[_0x6c6e('0xf')](_0x6c6e('0x10'),_0x3920cb,_0x6c6e('0xe'),JSON[_0x6c6e('0x11')](_0x51c170));if(_0x51c170[_0x6c6e('0x12')]){if(_0x51c170[_0x6c6e('0x12')][_0x6c6e('0x13')]===0x1f4){logger[_0x6c6e('0x12')](_0x6c6e('0xd'),_0x3920cb,_0x51c170[_0x6c6e('0x12')][_0x6c6e('0x14')]);return _0x3eacf7(_0x51c170[_0x6c6e('0x12')][_0x6c6e('0x14')]);}logger[_0x6c6e('0x12')](_0x6c6e('0xd'),_0x3920cb,_0x51c170['error'][_0x6c6e('0x14')]);return _0x1fddac(_0x51c170[_0x6c6e('0x12')][_0x6c6e('0x14')]);}else{logger[_0x6c6e('0xc')](_0x6c6e('0xd'),_0x3920cb,_0x6c6e('0xe'));_0x1fddac(_0x51c170[_0x6c6e('0x15')][_0x6c6e('0x14')]);}})[_0x6c6e('0x16')](function(_0x31c18b){logger[_0x6c6e('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x3920cb,_0x31c18b);_0x3eacf7(_0x31c18b);});});} \ No newline at end of file +var _0x53fc=['randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','bluebird'];(function(_0x39acf8,_0x158e5a){var _0x378ac3=function(_0x2f00e0){while(--_0x2f00e0){_0x39acf8['push'](_0x39acf8['shift']());}};_0x378ac3(++_0x158e5a);}(_0x53fc,0xda));var _0xc53f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x53fc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc53f('0x0'));var util=require('util');var moment=require(_0xc53f('0x1'));var BPromise=require(_0xc53f('0x2'));var rs=require(_0xc53f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc53f('0x4'))['db'];var utils=require(_0xc53f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc53f('0x6'));var jayson=require(_0xc53f('0x7'));var client=jayson[_0xc53f('0x8')][_0xc53f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x426376,_0x795b57,_0x71c1e8){return new BPromise(function(_0x36096e,_0xfad1a5){return client['request'](_0x426376,_0x71c1e8)['then'](function(_0x3087ae){logger[_0xc53f('0xa')](_0xc53f('0xb'),_0x795b57,_0xc53f('0xc'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x795b57,_0xc53f('0xc'),JSON['stringify'](_0x3087ae));if(_0x3087ae[_0xc53f('0xd')]){if(_0x3087ae[_0xc53f('0xd')][_0xc53f('0xe')]===0x1f4){logger[_0xc53f('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x795b57,_0x3087ae[_0xc53f('0xd')]['message']);return _0xfad1a5(_0x3087ae[_0xc53f('0xd')][_0xc53f('0xf')]);}logger[_0xc53f('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x795b57,_0x3087ae[_0xc53f('0xd')][_0xc53f('0xf')]);return _0x36096e(_0x3087ae[_0xc53f('0xd')][_0xc53f('0xf')]);}else{logger[_0xc53f('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x795b57,_0xc53f('0xc'));_0x36096e(_0x3087ae['result'][_0xc53f('0xf')]);}})[_0xc53f('0x10')](function(_0x376776){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x795b57,_0x376776);_0xfad1a5(_0x376776);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index afb806e..2a8d808 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x534643,_0x540498){var _0x240ae7=function(_0x4e8a71){while(--_0x4e8a71){_0x534643['push'](_0x534643['shift']());}};_0x240ae7(++_0x540498);}(_0x70e0,0x17b));var _0x070e=function(_0x2590f9,_0x57deb0){_0x2590f9=_0x2590f9-0x0;var _0x2b2779=_0x70e0[_0x2590f9];return _0x2b2779;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x33ceb2,_0x14a983){var _0x146d97=function(_0x508a8d){while(--_0x508a8d){_0x33ceb2['push'](_0x33ceb2['shift']());}};_0x146d97(++_0x14a983);}(_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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 5a5018b..2e15005 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 _0xf1e9=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x5d184e,_0x36df53){var _0x7610a2=function(_0x497d0e){while(--_0x497d0e){_0x5d184e['push'](_0x5d184e['shift']());}};_0x7610a2(++_0x36df53);}(_0xf1e9,0xc3));var _0x9f1e=function(_0x283364,_0x2f9a02){_0x283364=_0x283364-0x0;var _0x2235a5=_0xf1e9[_0x283364];return _0x2235a5;};'use strict';var Sequelize=require(_0x9f1e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9f1e('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x9f1e('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x9f1e('0x2')},'UserId':{'type':Sequelize[_0x9f1e('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x9f1e('0x3')],'allowNull':![],'unique':_0x9f1e('0x4'),'comment':_0x9f1e('0x2')},'VoiceQueueId':{'type':Sequelize[_0x9f1e('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x9f1e('0x3')],'allowNull':![],'unique':_0x9f1e('0x4'),'comment':_0x9f1e('0x2')},'penalty':{'type':Sequelize[_0x9f1e('0x1')](0xb),'defaultValue':0x0,'comment':_0x9f1e('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x9f1e('0x2')}}; \ No newline at end of file +var _0xa8f1=['Required\x20by\x20Asterisk','queue_interface','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8f1,0x19e));var _0x1a8f=function(_0x20afad,_0x14f967){_0x20afad=_0x20afad-0x0;var _0x58badd=_0xa8f1[_0x20afad];return _0x58badd;};'use strict';var Sequelize=require('sequelize');module[_0x1a8f('0x0')]={'uniqueid':{'type':Sequelize[_0x1a8f('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x1a8f('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x1a8f('0x2')},'UserId':{'type':Sequelize[_0x1a8f('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1a8f('0x3'),'comment':_0x1a8f('0x2')},'VoiceQueueId':{'type':Sequelize[_0x1a8f('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1a8f('0x3'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x1a8f('0x1')](0xb),'defaultValue':0x0,'comment':_0x1a8f('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x1a8f('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 8d95a94..a02cb84 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 _0x5224=['exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hook'];(function(_0x2c6f62,_0x37dec8){var _0x1c98b3=function(_0xe6d853){while(--_0xe6d853){_0x2c6f62['push'](_0x2c6f62['shift']());}};_0x1c98b3(++_0x37dec8);}(_0x5224,0x181));var _0x4522=function(_0x3ecf65,_0x3bac13){_0x3ecf65=_0x3ecf65-0x0;var _0x1907df=_0x5224[_0x3ecf65];return _0x1907df;};'use strict';var EventEmitter=require(_0x4522('0x0'));var UserVoiceQueueRt=require(_0x4522('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4522('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4522('0x3'),'afterDestroy':_0x4522('0x4')};function emitEvent(_0x52c468){return function(_0x488fa6,_0x487ba7,_0x5862b3){UserVoiceQueueRtEvents[_0x4522('0x5')](_0x52c468+':'+_0x488fa6['id'],_0x488fa6);UserVoiceQueueRtEvents[_0x4522('0x5')](_0x52c468,_0x488fa6);_0x5862b3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x4522('0x6')](e,emitEvent(event));}}module[_0x4522('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x4b0c=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x33c1f3,_0x13b859){var _0x222082=function(_0x378f4e){while(--_0x378f4e){_0x33c1f3['push'](_0x33c1f3['shift']());}};_0x222082(++_0x13b859);}(_0x4b0c,0xd7));var _0xc4b0=function(_0x3eec2a,_0x2a89ee){_0x3eec2a=_0x3eec2a-0x0;var _0x370047=_0x4b0c[_0x3eec2a];return _0x370047;};'use strict';var EventEmitter=require(_0xc4b0('0x0'));var UserVoiceQueueRt=require(_0xc4b0('0x1'))['db'][_0xc4b0('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xc4b0('0x3')](0x0);var events={'afterCreate':_0xc4b0('0x4'),'afterUpdate':_0xc4b0('0x5'),'afterDestroy':_0xc4b0('0x6')};function emitEvent(_0x56f3d6){return function(_0x4e876b,_0x47881e,_0x489870){UserVoiceQueueRtEvents['emit'](_0x56f3d6+':'+_0x4e876b['id'],_0x4e876b);UserVoiceQueueRtEvents[_0xc4b0('0x7')](_0x56f3d6,_0x4e876b);_0x489870(null);};}for(var e in events){if(events[_0xc4b0('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0xc4b0('0x9')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 2f60529..cd54e1d 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 _0x42b2=['bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x42b2,0x1c9));var _0x242b=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x42b2[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x242b('0x0'));var util=require(_0x242b('0x1'));var logger=require(_0x242b('0x2'))(_0x242b('0x3'));var moment=require(_0x242b('0x4'));var BPromise=require(_0x242b('0x5'));var rp=require(_0x242b('0x6'));var fs=require('fs');var path=require(_0x242b('0x7'));var rimraf=require(_0x242b('0x8'));var config=require(_0x242b('0x9'));var attributes=require(_0x242b('0xa'));module['exports']=function(_0x322e06,_0xe2a0a4){return _0x322e06[_0x242b('0xb')](_0x242b('0xc'),attributes,{'tableName':_0x242b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81e3=['bluebird','request-promise','path','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x81e3,0x18e));var _0x381e=function(_0x430524,_0x23b611){_0x430524=_0x430524-0x0;var _0x3a726d=_0x81e3[_0x430524];return _0x3a726d;};'use strict';var _=require(_0x381e('0x0'));var util=require(_0x381e('0x1'));var logger=require(_0x381e('0x2'))(_0x381e('0x3'));var moment=require(_0x381e('0x4'));var BPromise=require(_0x381e('0x5'));var rp=require(_0x381e('0x6'));var fs=require('fs');var path=require(_0x381e('0x7'));var rimraf=require('rimraf');var config=require(_0x381e('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x381e('0x9')]=function(_0x5ba744,_0x47045f){return _0x5ba744[_0x381e('0xa')](_0x381e('0xb'),attributes,{'tableName':_0x381e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index a86f74f..d977566 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 _0x3bd3=['redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x104cc5,_0xe367a9){var _0x259111=function(_0x1088fc){while(--_0x1088fc){_0x104cc5['push'](_0x104cc5['shift']());}};_0x259111(++_0xe367a9);}(_0x3bd3,0x172));var _0x33bd=function(_0x35ad07,_0x4b6cc4){_0x35ad07=_0x35ad07-0x0;var _0x5346ee=_0x3bd3[_0x35ad07];return _0x5346ee;};'use strict';var _=require(_0x33bd('0x0'));var util=require(_0x33bd('0x1'));var moment=require('moment');var BPromise=require(_0x33bd('0x2'));var rs=require(_0x33bd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x33bd('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x33bd('0x5'));var config=require(_0x33bd('0x6'));var jayson=require(_0x33bd('0x7'));var client=jayson[_0x33bd('0x8')][_0x33bd('0x9')]({'port':0x232a});config[_0x33bd('0xa')]=_['defaults'](config[_0x33bd('0xa')],{'host':_0x33bd('0xb'),'port':0x18eb});var socket=require(_0x33bd('0xc'))(new Redis(config[_0x33bd('0xa')]));require(_0x33bd('0xd'))[_0x33bd('0xe')](socket);function respondWithRpcPromise(_0x1f61f7,_0x1b8e75,_0x4261cf){return new BPromise(function(_0x2bcde4,_0xf0b64){return client[_0x33bd('0xf')](_0x1f61f7,_0x4261cf)[_0x33bd('0x10')](function(_0x3fdc5e){logger[_0x33bd('0x11')](_0x33bd('0x12'),_0x1b8e75,_0x33bd('0x13'));logger['debug'](_0x33bd('0x14'),_0x1b8e75,_0x33bd('0x13'),JSON[_0x33bd('0x15')](_0x3fdc5e));if(_0x3fdc5e['error']){if(_0x3fdc5e[_0x33bd('0x16')][_0x33bd('0x17')]===0x1f4){logger[_0x33bd('0x16')](_0x33bd('0x12'),_0x1b8e75,_0x3fdc5e['error'][_0x33bd('0x18')]);return _0xf0b64(_0x3fdc5e['error'][_0x33bd('0x18')]);}logger[_0x33bd('0x16')](_0x33bd('0x12'),_0x1b8e75,_0x3fdc5e[_0x33bd('0x16')]['message']);return _0x2bcde4(_0x3fdc5e['error'][_0x33bd('0x18')]);}else{logger[_0x33bd('0x11')](_0x33bd('0x12'),_0x1b8e75,'request\x20sent');_0x2bcde4(_0x3fdc5e[_0x33bd('0x19')][_0x33bd('0x18')]);}})[_0x33bd('0x1a')](function(_0x1c0fe5){logger[_0x33bd('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1b8e75,_0x1c0fe5);_0xf0b64(_0x1c0fe5);});});}exports[_0x33bd('0x1b')]=function(_0x99c0b6){var _0x5be106=this;return new Promise(function(_0x53287d,_0x478086){return db[_0x33bd('0x1c')][_0x33bd('0x1d')]({'raw':_0x99c0b6['options']?_0x99c0b6[_0x33bd('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x99c0b6[_0x33bd('0x1e')]?_0x99c0b6[_0x33bd('0x1e')][_0x33bd('0x1f')]||null:null,'attributes':[[db[_0x33bd('0x20')]['fn'](_0x33bd('0x21'),db[_0x33bd('0x20')]['fn']('IF',db[_0x33bd('0x20')][_0x33bd('0x22')](_0x33bd('0x23')))),_0x33bd('0x24')]]})['then'](function(_0x27828d){logger['info']('GetVoiceQueueRtPauses',_0x99c0b6);logger[_0x33bd('0x25')](_0x33bd('0x1b'),_0x99c0b6,JSON[_0x33bd('0x15')](_0x27828d));_0x53287d(_0x27828d);})[_0x33bd('0x1a')](function(_0x5d4c7e){logger[_0x33bd('0x16')](_0x33bd('0x1b'),_0x5d4c7e[_0x33bd('0x18')],_0x99c0b6);_0x478086(_0x5be106['error'](0x1f4,_0x5d4c7e[_0x33bd('0x18')]));});});}; \ No newline at end of file +var _0x212c=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0x212c,0x15d));var _0xc212=function(_0x1cafd3,_0x725da7){_0x1cafd3=_0x1cafd3-0x0;var _0x210811=_0x212c[_0x1cafd3];return _0x210811;};'use strict';var _=require(_0xc212('0x0'));var util=require(_0xc212('0x1'));var moment=require(_0xc212('0x2'));var BPromise=require(_0xc212('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc212('0x4'))['db'];var utils=require(_0xc212('0x5'));var logger=require(_0xc212('0x6'))(_0xc212('0x7'));var config=require(_0xc212('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc212('0x9')][_0xc212('0xa')]({'port':0x232a});config[_0xc212('0xb')]=_[_0xc212('0xc')](config[_0xc212('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc212('0xd'))(new Redis(config[_0xc212('0xb')]));require(_0xc212('0xe'))[_0xc212('0xf')](socket);function respondWithRpcPromise(_0x346888,_0x9124cb,_0x3e8ee9){return new BPromise(function(_0xa6143e,_0x16cb47){return client[_0xc212('0x10')](_0x346888,_0x3e8ee9)[_0xc212('0x11')](function(_0x4fdacf){logger[_0xc212('0x12')](_0xc212('0x13'),_0x9124cb,'request\x20sent');logger[_0xc212('0x14')](_0xc212('0x15'),_0x9124cb,_0xc212('0x16'),JSON['stringify'](_0x4fdacf));if(_0x4fdacf[_0xc212('0x17')]){if(_0x4fdacf[_0xc212('0x17')][_0xc212('0x18')]===0x1f4){logger[_0xc212('0x17')](_0xc212('0x13'),_0x9124cb,_0x4fdacf[_0xc212('0x17')][_0xc212('0x19')]);return _0x16cb47(_0x4fdacf[_0xc212('0x17')][_0xc212('0x19')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x9124cb,_0x4fdacf[_0xc212('0x17')][_0xc212('0x19')]);return _0xa6143e(_0x4fdacf[_0xc212('0x17')][_0xc212('0x19')]);}else{logger[_0xc212('0x12')](_0xc212('0x13'),_0x9124cb,_0xc212('0x16'));_0xa6143e(_0x4fdacf[_0xc212('0x1a')][_0xc212('0x19')]);}})[_0xc212('0x1b')](function(_0x57fef2){logger['error'](_0xc212('0x13'),_0x9124cb,_0x57fef2);_0x16cb47(_0x57fef2);});});}exports[_0xc212('0x1c')]=function(_0x2296e4){var _0x49cd85=this;return new Promise(function(_0x34a6cc,_0x558a80){return db[_0xc212('0x1d')][_0xc212('0x1e')]({'raw':_0x2296e4['options']?_0x2296e4[_0xc212('0x1f')][_0xc212('0x20')]===undefined?!![]:![]:!![],'where':_0x2296e4[_0xc212('0x1f')]?_0x2296e4[_0xc212('0x1f')][_0xc212('0x21')]||null:null,'attributes':[[db[_0xc212('0x22')]['fn'](_0xc212('0x23'),db['sequelize']['fn']('IF',db[_0xc212('0x22')][_0xc212('0x24')](_0xc212('0x25')))),_0xc212('0x26')]]})['then'](function(_0x1a2502){logger['info'](_0xc212('0x1c'),_0x2296e4);logger[_0xc212('0x14')]('GetVoiceQueueRtPauses',_0x2296e4,JSON['stringify'](_0x1a2502));_0x34a6cc(_0x1a2502);})[_0xc212('0x1b')](function(_0x4aa5f9){logger[_0xc212('0x17')]('GetVoiceQueueRtPauses',_0x4aa5f9[_0xc212('0x19')],_0x2296e4);_0x558a80(_0x49cd85[_0xc212('0x17')](0x1f4,_0x4aa5f9[_0xc212('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 6bc37c5..9c15d07 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 _0x2b83=['remove','removeListener','length','save'];(function(_0x28dd1a,_0x48ecb3){var _0x18d911=function(_0x22c789){while(--_0x22c789){_0x28dd1a['push'](_0x28dd1a['shift']());}};_0x18d911(++_0x48ecb3);}(_0x2b83,0x1d3));var _0x32b8=function(_0x49f506,_0x229d41){_0x49f506=_0x49f506-0x0;var _0x73d711=_0x2b83[_0x49f506];return _0x73d711;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x32b8('0x0'),_0x32b8('0x1'),'update'];function createListener(_0x3fcbdc,_0x287f16){return function(_0x304105){_0x287f16['emit'](_0x3fcbdc,_0x304105);};}function removeListener(_0x51d3b4,_0xdd712a){return function(){UserVoiceQueueRtEvents[_0x32b8('0x2')](_0x51d3b4,_0xdd712a);};}exports['register']=function(_0x6bbc3d){for(var _0x55abd0=0x0,_0x18150c=events[_0x32b8('0x3')];_0x55abd0<_0x18150c;_0x55abd0++){var _0x36bde3=events[_0x55abd0];var _0x10a967=createListener('userVoiceQueueRt:'+_0x36bde3,_0x6bbc3d);UserVoiceQueueRtEvents['on'](_0x36bde3,_0x10a967);}}; \ No newline at end of file +var _0xfc76=['userVoiceQueueRt:','save','remove','update','emit','removeListener'];(function(_0x442281,_0x3fd29a){var _0x6e841c=function(_0x581f28){while(--_0x581f28){_0x442281['push'](_0x442281['shift']());}};_0x6e841c(++_0x3fd29a);}(_0xfc76,0xb5));var _0x6fc7=function(_0x13cb1c,_0x373aee){_0x13cb1c=_0x13cb1c-0x0;var _0x1d5191=_0xfc76[_0x13cb1c];return _0x1d5191;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x6fc7('0x0'),_0x6fc7('0x1'),_0x6fc7('0x2')];function createListener(_0xdc26f7,_0x5c0232){return function(_0x5c6b36){_0x5c0232[_0x6fc7('0x3')](_0xdc26f7,_0x5c6b36);};}function removeListener(_0x40d212,_0x51280c){return function(){UserVoiceQueueRtEvents[_0x6fc7('0x4')](_0x40d212,_0x51280c);};}exports['register']=function(_0xe8177b){for(var _0x82a35a=0x0,_0x385a5a=events['length'];_0x82a35a<_0x385a5a;_0x82a35a++){var _0x21a64d=events[_0x82a35a];var _0x407b0a=createListener(_0x6fc7('0x5')+_0x21a64d,_0xe8177b);UserVoiceQueueRtEvents['on'](_0x21a64d,_0x407b0a);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 9a12ad8..e324a16 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x373721,_0x55fc62){var _0x36c2ae=function(_0x297b93){while(--_0x297b93){_0x373721['push'](_0x373721['shift']());}};_0x36c2ae(++_0x55fc62);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x767b78,_0x16270b){var _0x5daeed=function(_0x4b0739){while(--_0x4b0739){_0x767b78['push'](_0x767b78['shift']());}};_0x5daeed(++_0x16270b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index bc92cdb..09b036e 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 _0xf350=['sequelize'];(function(_0x55a89e,_0x1a05ab){var _0x3aa2bd=function(_0x4b9d09){while(--_0x4b9d09){_0x55a89e['push'](_0x55a89e['shift']());}};_0x3aa2bd(++_0x1a05ab);}(_0xf350,0x105));var _0x0f35=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf350[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x0f35('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc961=['exports','INTEGER','sequelize'];(function(_0xb6b91d,_0x2d5e03){var _0x3b084e=function(_0x3e023a){while(--_0x3e023a){_0xb6b91d['push'](_0xb6b91d['shift']());}};_0x3b084e(++_0x2d5e03);}(_0xc961,0xb3));var _0x1c96=function(_0x18d5d7,_0x19074b){_0x18d5d7=_0x18d5d7-0x0;var _0x30a9ea=_0xc961[_0x18d5d7];return _0x30a9ea;};'use strict';var Sequelize=require(_0x1c96('0x0'));module[_0x1c96('0x1')]={'penalty':{'type':Sequelize[_0x1c96('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 872836d..8687c94 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 _0x012f=['bluebird','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment'];(function(_0x503790,_0x525c78){var _0x388092=function(_0x2ab2b8){while(--_0x2ab2b8){_0x503790['push'](_0x503790['shift']());}};_0x388092(++_0x525c78);}(_0x012f,0x113));var _0xf012=function(_0x28d1dc,_0x5a3d14){_0x28d1dc=_0x28d1dc-0x0;var _0x4ebcae=_0x012f[_0x28d1dc];return _0x4ebcae;};'use strict';var _=require(_0xf012('0x0'));var util=require(_0xf012('0x1'));var logger=require(_0xf012('0x2'))(_0xf012('0x3'));var moment=require(_0xf012('0x4'));var BPromise=require(_0xf012('0x5'));var rp=require(_0xf012('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf012('0x7'));var config=require(_0xf012('0x8'));var attributes=require(_0xf012('0x9'));module[_0xf012('0xa')]=function(_0x37914b,_0x3c9265){return _0x37914b[_0xf012('0xb')](_0xf012('0xc'),attributes,{'tableName':_0xf012('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b8f=['moment','bluebird','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','../../config/logger','api'];(function(_0x2e2720,_0x1ae995){var _0x3f9d2d=function(_0x5067a2){while(--_0x5067a2){_0x2e2720['push'](_0x2e2720['shift']());}};_0x3f9d2d(++_0x1ae995);}(_0x6b8f,0xcd));var _0xf6b8=function(_0x2899bb,_0x5858d9){_0x2899bb=_0x2899bb-0x0;var _0x3dd854=_0x6b8f[_0x2899bb];return _0x3dd854;};'use strict';var _=require(_0xf6b8('0x0'));var util=require('util');var logger=require(_0xf6b8('0x1'))(_0xf6b8('0x2'));var moment=require(_0xf6b8('0x3'));var BPromise=require(_0xf6b8('0x4'));var rp=require(_0xf6b8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf6b8('0x6'));var config=require(_0xf6b8('0x7'));var attributes=require(_0xf6b8('0x8'));module[_0xf6b8('0x9')]=function(_0x2a7cb6,_0x95d503){return _0x2a7cb6[_0xf6b8('0xa')](_0xf6b8('0xb'),attributes,{'tableName':_0xf6b8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index da7d8a8..5d223ac 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 _0xe705=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message'];(function(_0x4958a7,_0x51ea7d){var _0x4ea8a4=function(_0x28b547){while(--_0x28b547){_0x4958a7['push'](_0x4958a7['shift']());}};_0x4ea8a4(++_0x51ea7d);}(_0xe705,0x13b));var _0x5e70=function(_0xb4cc12,_0x41436e){_0xb4cc12=_0xb4cc12-0x0;var _0x8593b5=_0xe705[_0xb4cc12];return _0x8593b5;};'use strict';var _=require(_0x5e70('0x0'));var util=require(_0x5e70('0x1'));var moment=require(_0x5e70('0x2'));var BPromise=require(_0x5e70('0x3'));var rs=require(_0x5e70('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e70('0x5'))['db'];var utils=require(_0x5e70('0x6'));var logger=require(_0x5e70('0x7'))(_0x5e70('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5e70('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f118e,_0xbd71af,_0x533e91){return new BPromise(function(_0x53ccfe,_0x56212e){return client[_0x5e70('0xa')](_0x3f118e,_0x533e91)[_0x5e70('0xb')](function(_0x47dfc9){logger[_0x5e70('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0xbd71af,_0x5e70('0xd'));logger[_0x5e70('0xe')](_0x5e70('0xf'),_0xbd71af,_0x5e70('0xd'),JSON[_0x5e70('0x10')](_0x47dfc9));if(_0x47dfc9[_0x5e70('0x11')]){if(_0x47dfc9[_0x5e70('0x11')][_0x5e70('0x12')]===0x1f4){logger[_0x5e70('0x11')](_0x5e70('0x13'),_0xbd71af,_0x47dfc9[_0x5e70('0x11')][_0x5e70('0x14')]);return _0x56212e(_0x47dfc9[_0x5e70('0x11')][_0x5e70('0x14')]);}logger[_0x5e70('0x11')](_0x5e70('0x13'),_0xbd71af,_0x47dfc9[_0x5e70('0x11')][_0x5e70('0x14')]);return _0x53ccfe(_0x47dfc9['error'][_0x5e70('0x14')]);}else{logger['info'](_0x5e70('0x13'),_0xbd71af,_0x5e70('0xd'));_0x53ccfe(_0x47dfc9['result']['message']);}})['catch'](function(_0x2a1706){logger[_0x5e70('0x11')](_0x5e70('0x13'),_0xbd71af,_0x2a1706);_0x56212e(_0x2a1706);});});} \ No newline at end of file +var _0xb76e=['stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x574c60,_0x653c40){var _0x57bb5e=function(_0x20ad7e){while(--_0x20ad7e){_0x574c60['push'](_0x574c60['shift']());}};_0x57bb5e(++_0x653c40);}(_0xb76e,0x154));var _0xeb76=function(_0x3a658b,_0x49a728){_0x3a658b=_0x3a658b-0x0;var _0x528ad0=_0xb76e[_0x3a658b];return _0x528ad0;};'use strict';var _=require('lodash');var util=require(_0xeb76('0x0'));var moment=require(_0xeb76('0x1'));var BPromise=require(_0xeb76('0x2'));var rs=require(_0xeb76('0x3'));var fs=require('fs');var Redis=require(_0xeb76('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xeb76('0x5'));var logger=require(_0xeb76('0x6'))(_0xeb76('0x7'));var config=require('../../config/environment');var jayson=require(_0xeb76('0x8'));var client=jayson['client'][_0xeb76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x298d45,_0x4b4b0e,_0x160864){return new BPromise(function(_0x133d1d,_0x3af2cf){return client[_0xeb76('0xa')](_0x298d45,_0x160864)[_0xeb76('0xb')](function(_0x806ece){logger[_0xeb76('0xc')](_0xeb76('0xd'),_0x4b4b0e,_0xeb76('0xe'));logger[_0xeb76('0xf')](_0xeb76('0x10'),_0x4b4b0e,'request\x20sent',JSON[_0xeb76('0x11')](_0x806ece));if(_0x806ece['error']){if(_0x806ece['error']['code']===0x1f4){logger[_0xeb76('0x12')](_0xeb76('0xd'),_0x4b4b0e,_0x806ece[_0xeb76('0x12')][_0xeb76('0x13')]);return _0x3af2cf(_0x806ece[_0xeb76('0x12')][_0xeb76('0x13')]);}logger[_0xeb76('0x12')](_0xeb76('0xd'),_0x4b4b0e,_0x806ece[_0xeb76('0x12')][_0xeb76('0x13')]);return _0x133d1d(_0x806ece['error'][_0xeb76('0x13')]);}else{logger[_0xeb76('0xc')](_0xeb76('0xd'),_0x4b4b0e,_0xeb76('0xe'));_0x133d1d(_0x806ece['result'][_0xeb76('0x13')]);}})[_0xeb76('0x14')](function(_0x3512a8){logger[_0xeb76('0x12')](_0xeb76('0xd'),_0x4b4b0e,_0x3512a8);_0x3af2cf(_0x3512a8);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 5600be7..34c7b00 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 _0xb377=['update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','show','post','isAuthenticated','create','put','/:id'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0xb377,0x1b6));var _0x7b37=function(_0x319310,_0xbfd742){_0x319310=_0x319310-0x0;var _0x345b0b=_0xb377[_0x319310];return _0x345b0b;};'use strict';var multer=require(_0x7b37('0x0'));var util=require(_0x7b37('0x1'));var path=require(_0x7b37('0x2'));var timeout=require(_0x7b37('0x3'));var express=require(_0x7b37('0x4'));var router=express[_0x7b37('0x5')]();var fs_extra=require(_0x7b37('0x6'));var auth=require(_0x7b37('0x7'));var interaction=require(_0x7b37('0x8'));var config=require(_0x7b37('0x9'));var controller=require(_0x7b37('0xa'));router[_0x7b37('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b37('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7b37('0xc')]);router[_0x7b37('0xd')]('/',auth[_0x7b37('0xe')](),controller[_0x7b37('0xf')]);router[_0x7b37('0x10')](_0x7b37('0x11'),auth[_0x7b37('0xe')](),controller[_0x7b37('0x12')]);router['delete'](_0x7b37('0x11'),auth[_0x7b37('0xe')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9589=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x9589,0xbc));var _0x9958=function(_0xecb4e5,_0x5d99b4){_0xecb4e5=_0xecb4e5-0x0;var _0x14b1f5=_0x9589[_0xecb4e5];return _0x14b1f5;};'use strict';var multer=require(_0x9958('0x0'));var util=require(_0x9958('0x1'));var path=require(_0x9958('0x2'));var timeout=require(_0x9958('0x3'));var express=require(_0x9958('0x4'));var router=express['Router']();var fs_extra=require(_0x9958('0x5'));var auth=require(_0x9958('0x6'));var interaction=require(_0x9958('0x7'));var config=require('../../config/environment');var controller=require(_0x9958('0x8'));router[_0x9958('0x9')]('/',auth[_0x9958('0xa')](),controller[_0x9958('0xb')]);router[_0x9958('0x9')](_0x9958('0xc'),auth['isAuthenticated'](),controller[_0x9958('0xd')]);router[_0x9958('0xe')]('/',auth[_0x9958('0xa')](),controller[_0x9958('0xf')]);router[_0x9958('0x10')](_0x9958('0xc'),auth[_0x9958('0xa')](),controller[_0x9958('0x11')]);router[_0x9958('0x12')](_0x9958('0xc'),auth[_0x9958('0xa')](),controller[_0x9958('0x13')]);module[_0x9958('0x14')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 6e22668..7a5e8af 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 _0xcb68=['STRING','name','exports'];(function(_0xf5cc1,_0x3f26d4){var _0x2dfa2d=function(_0x1d88a3){while(--_0x1d88a3){_0xf5cc1['push'](_0xf5cc1['shift']());}};_0x2dfa2d(++_0x3f26d4);}(_0xcb68,0x104));var _0x8cb6=function(_0x10cecc,_0x3ff441){_0x10cecc=_0x10cecc-0x0;var _0x47d9e6=_0xcb68[_0x10cecc];return _0x47d9e6;};'use strict';var Sequelize=require('sequelize');module[_0x8cb6('0x0')]={'name':{'type':Sequelize[_0x8cb6('0x1')],'unique':_0x8cb6('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8cb6('0x1')]}}; \ No newline at end of file +var _0xc6fc=['sequelize','exports','STRING','name'];(function(_0x5371d2,_0x36301a){var _0x2024ab=function(_0x484ddf){while(--_0x484ddf){_0x5371d2['push'](_0x5371d2['shift']());}};_0x2024ab(++_0x36301a);}(_0xc6fc,0xec));var _0xcc6f=function(_0x1c156e,_0x3263a6){_0x1c156e=_0x1c156e-0x0;var _0x58fc22=_0xc6fc[_0x1c156e];return _0x58fc22;};'use strict';var Sequelize=require(_0xcc6f('0x0'));module[_0xcc6f('0x1')]={'name':{'type':Sequelize[_0xcc6f('0x2')],'unique':_0xcc6f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xcc6f('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 8fc37af..045c836 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 _0x5124=['jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','save','update','then','get','Variables','UserProfileResource','stack','name','map','Variable','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','lodash','squel'];(function(_0xa7a57b,_0x2de25b){var _0x3067a0=function(_0x384015){while(--_0x384015){_0xa7a57b['push'](_0xa7a57b['shift']());}};_0x3067a0(++_0x2de25b);}(_0x5124,0x1e1));var _0x4512=function(_0x30fc8f,_0x5809d5){_0x30fc8f=_0x30fc8f-0x0;var _0x27330a=_0x5124[_0x30fc8f];return _0x27330a;};'use strict';var emlformat=require(_0x4512('0x0'));var rimraf=require(_0x4512('0x1'));var zipdir=require(_0x4512('0x2'));var jsonpatch=require(_0x4512('0x3'));var rp=require(_0x4512('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4512('0x5'));var util=require(_0x4512('0x6'));var path=require(_0x4512('0x7'));var sox=require(_0x4512('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4512('0x9'));var squel=require(_0x4512('0xa'));var crypto=require('crypto');var jsforce=require(_0x4512('0xb'));var deskjs=require(_0x4512('0xc'));var toCsv=require(_0x4512('0xd'));var querystring=require(_0x4512('0xe'));var Papa=require(_0x4512('0xf'));var Redis=require('ioredis');var authService=require(_0x4512('0x10'));var qs=require(_0x4512('0x11'));var as=require(_0x4512('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4512('0x13'));var config=require(_0x4512('0x14'));var licenseUtil=require(_0x4512('0x15'));var db=require(_0x4512('0x16'))['db'];function respondWithStatusCode(_0x22dac3,_0x23ace8){_0x23ace8=_0x23ace8||0xcc;return function(_0x56280f){if(_0x56280f){return _0x22dac3[_0x4512('0x17')](_0x23ace8);}return _0x22dac3['status'](_0x23ace8)[_0x4512('0x18')]();};}function respondWithResult(_0x2b69e2,_0x55d0c6){_0x55d0c6=_0x55d0c6||0xc8;return function(_0x458415){if(_0x458415){return _0x2b69e2['status'](_0x55d0c6)[_0x4512('0x19')](_0x458415);}};}function respondWithFilteredResult(_0xd04b65,_0x5c3cd7){return function(_0x2e3c5b){if(_0x2e3c5b){var _0x12b17a=typeof _0x5c3cd7['offset']===_0x4512('0x1a')&&typeof _0x5c3cd7['limit']===_0x4512('0x1a');var _0xd469af=_0x2e3c5b[_0x4512('0x1b')];var _0x143be0=_0x12b17a?0x0:_0x5c3cd7['offset'];var _0x3471fc=_0x12b17a?_0x2e3c5b[_0x4512('0x1b')]:_0x5c3cd7[_0x4512('0x1c')]+_0x5c3cd7[_0x4512('0x1d')];var _0x1250ec;if(_0x3471fc>=_0xd469af){_0x3471fc=_0xd469af;_0x1250ec=0xc8;}else{_0x1250ec=0xce;}_0xd04b65[_0x4512('0x1e')](_0x1250ec);return _0xd04b65[_0x4512('0x1f')](_0x4512('0x20'),_0x143be0+'-'+_0x3471fc+'/'+_0xd469af)[_0x4512('0x19')](_0x2e3c5b);}return null;};}function patchUpdates(_0x3f57e0){return function(_0x349fc0){try{jsonpatch[_0x4512('0x21')](_0x349fc0,_0x3f57e0,!![]);}catch(_0x4953b6){return BPromise['reject'](_0x4953b6);}return _0x349fc0[_0x4512('0x22')]();};}function saveUpdates(_0x276e95,_0x53285e){return function(_0x55cb22){if(_0x55cb22){return _0x55cb22[_0x4512('0x23')](_0x276e95)[_0x4512('0x24')](function(_0xc3cc73){return _0xc3cc73;});}return null;};}function removeEntity(_0x3b6d67,_0x4502bc){return function(_0x4be492){if(_0x4be492){return _0x4be492['destroy']()['then'](function(){var _0x3cceae=_0x4be492[_0x4512('0x25')]({'plain':!![]});var _0xd38346=_0x4512('0x26');return db[_0x4512('0x27')]['destroy']({'where':{'type':_0xd38346,'resourceId':_0x3cceae['id']}})[_0x4512('0x24')](function(){return _0x4be492;});})[_0x4512('0x24')](function(){_0x3b6d67[_0x4512('0x1e')](0xcc)[_0x4512('0x18')]();});}};}function handleEntityNotFound(_0x39985d,_0x2a41a1){return function(_0xd0213f){if(!_0xd0213f){_0x39985d[_0x4512('0x17')](0x194);}return _0xd0213f;};}function handleError(_0x5cbfed,_0x2fb308){_0x2fb308=_0x2fb308||0x1f4;return function(_0x4786fd){logger['error'](_0x4786fd[_0x4512('0x28')]);if(_0x4786fd[_0x4512('0x29')]){delete _0x4786fd[_0x4512('0x29')];}_0x5cbfed[_0x4512('0x1e')](_0x2fb308)['send'](_0x4786fd);};}exports['index']=function(_0x5b93d8,_0xb0d26b){var _0x2ff29a={},_0x1f4938={},_0x353880={'count':0x0,'rows':[]};var _0xad8f8c=_[_0x4512('0x2a')](db[_0x4512('0x2b')]['rawAttributes'],function(_0xe4f0ed){return{'name':_0xe4f0ed[_0x4512('0x2c')],'type':_0xe4f0ed[_0x4512('0x2d')][_0x4512('0x2e')]};});_0x1f4938[_0x4512('0x2f')]=_[_0x4512('0x2a')](_0xad8f8c,_0x4512('0x29'));_0x1f4938[_0x4512('0x30')]=_[_0x4512('0x31')](_0x5b93d8['query']);_0x1f4938[_0x4512('0x32')]=_[_0x4512('0x33')](_0x1f4938[_0x4512('0x2f')],_0x1f4938[_0x4512('0x30')]);_0x2ff29a[_0x4512('0x34')]=_['intersection'](_0x1f4938['model'],qs[_0x4512('0x35')](_0x5b93d8[_0x4512('0x30')][_0x4512('0x35')]));_0x2ff29a['attributes']=_0x2ff29a[_0x4512('0x34')]['length']?_0x2ff29a[_0x4512('0x34')]:_0x1f4938[_0x4512('0x2f')];if(!_0x5b93d8[_0x4512('0x30')]['hasOwnProperty'](_0x4512('0x36'))){_0x2ff29a['limit']=qs[_0x4512('0x1d')](_0x5b93d8[_0x4512('0x30')][_0x4512('0x1d')]);_0x2ff29a[_0x4512('0x1c')]=qs[_0x4512('0x1c')](_0x5b93d8[_0x4512('0x30')]['offset']);}_0x2ff29a[_0x4512('0x37')]=qs[_0x4512('0x38')](_0x5b93d8[_0x4512('0x30')][_0x4512('0x38')]);_0x2ff29a[_0x4512('0x39')]=qs[_0x4512('0x32')](_[_0x4512('0x3a')](_0x5b93d8[_0x4512('0x30')],_0x1f4938[_0x4512('0x32')]),_0xad8f8c);if(_0x5b93d8[_0x4512('0x30')][_0x4512('0x3b')]){_0x2ff29a[_0x4512('0x39')]=_[_0x4512('0x3c')](_0x2ff29a[_0x4512('0x39')],{'$or':_[_0x4512('0x2a')](_0xad8f8c,function(_0x16e82d){if(_0x16e82d[_0x4512('0x2d')]!==_0x4512('0x3d')){var _0x1e17cb={};_0x1e17cb[_0x16e82d[_0x4512('0x29')]]={'$like':'%'+_0x5b93d8[_0x4512('0x30')][_0x4512('0x3b')]+'%'};return _0x1e17cb;}})});}_0x2ff29a=_[_0x4512('0x3c')]({},_0x2ff29a,_0x5b93d8['options']);var _0x4985b7={'where':_0x2ff29a[_0x4512('0x39')]};return db[_0x4512('0x2b')][_0x4512('0x1b')](_0x4985b7)[_0x4512('0x24')](function(_0x189011){_0x353880[_0x4512('0x1b')]=_0x189011;if(_0x5b93d8[_0x4512('0x30')]['includeAll']){_0x2ff29a[_0x4512('0x3e')]=[{'all':!![]}];}return db['Variable'][_0x4512('0x3f')](_0x2ff29a);})[_0x4512('0x24')](function(_0x33bf8e){_0x353880[_0x4512('0x40')]=_0x33bf8e;return _0x353880;})['then'](respondWithFilteredResult(_0xb0d26b,_0x2ff29a))[_0x4512('0x41')](handleError(_0xb0d26b,null));};exports[_0x4512('0x42')]=function(_0x312b4d,_0x1450b1){var _0x315883={'raw':!![],'where':{'id':_0x312b4d[_0x4512('0x43')]['id']}},_0xa3542d={};_0xa3542d[_0x4512('0x2f')]=_[_0x4512('0x31')](db[_0x4512('0x2b')][_0x4512('0x44')]);_0xa3542d[_0x4512('0x30')]=_['keys'](_0x312b4d[_0x4512('0x30')]);_0xa3542d['filters']=_[_0x4512('0x33')](_0xa3542d[_0x4512('0x2f')],_0xa3542d['query']);_0x315883['attributes']=_[_0x4512('0x33')](_0xa3542d['model'],qs[_0x4512('0x35')](_0x312b4d[_0x4512('0x30')][_0x4512('0x35')]));_0x315883[_0x4512('0x34')]=_0x315883['attributes'][_0x4512('0x45')]?_0x315883['attributes']:_0xa3542d[_0x4512('0x2f')];if(_0x312b4d[_0x4512('0x30')][_0x4512('0x46')]){_0x315883[_0x4512('0x3e')]=[{'all':!![]}];}_0x315883=_[_0x4512('0x3c')]({},_0x315883,_0x312b4d[_0x4512('0x47')]);return db[_0x4512('0x2b')][_0x4512('0x48')](_0x315883)[_0x4512('0x24')](handleEntityNotFound(_0x1450b1,null))[_0x4512('0x24')](respondWithResult(_0x1450b1,null))[_0x4512('0x41')](handleError(_0x1450b1,null));};exports[_0x4512('0x49')]=function(_0x316771,_0x3d4709){return db['Variable'][_0x4512('0x49')](_0x316771['body'],{})[_0x4512('0x24')](function(_0x56050c){var _0x213a04=_0x316771[_0x4512('0x4a')][_0x4512('0x25')]({'plain':!![]});if(!_0x213a04)throw new Error(_0x4512('0x4b'));if(_0x213a04[_0x4512('0x4c')]===_0x4512('0x4a')){var _0x35adab=_0x56050c['get']({'plain':!![]});var _0xa6857c=_0x4512('0x26');return db['UserProfileSection'][_0x4512('0x48')]({'where':{'name':_0xa6857c,'userProfileId':_0x213a04[_0x4512('0x4d')]},'raw':!![]})['then'](function(_0x32c2ff){if(_0x32c2ff&&_0x32c2ff[_0x4512('0x4e')]===0x0){return db[_0x4512('0x27')]['create']({'name':_0x35adab[_0x4512('0x29')],'resourceId':_0x35adab['id'],'type':_0x32c2ff[_0x4512('0x29')],'sectionId':_0x32c2ff['id']},{})[_0x4512('0x24')](function(){return _0x56050c;});}else{return _0x56050c;}})['catch'](function(_0x31b212){logger[_0x4512('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31b212);throw _0x31b212;});}return _0x56050c;})[_0x4512('0x24')](respondWithResult(_0x3d4709,0xc9))[_0x4512('0x41')](handleError(_0x3d4709,null));};exports[_0x4512('0x23')]=function(_0x35a08,_0x577a80){if(_0x35a08['body']['id']){delete _0x35a08[_0x4512('0x50')]['id'];}return db[_0x4512('0x2b')]['find']({'where':{'id':_0x35a08['params']['id']}})[_0x4512('0x24')](handleEntityNotFound(_0x577a80,null))['then'](saveUpdates(_0x35a08[_0x4512('0x50')],null))[_0x4512('0x24')](respondWithResult(_0x577a80,null))[_0x4512('0x41')](handleError(_0x577a80,null));};exports[_0x4512('0x51')]=function(_0x5e18a9,_0x3f4e7c){return db['Variable'][_0x4512('0x48')]({'where':{'id':_0x5e18a9[_0x4512('0x43')]['id']}})[_0x4512('0x24')](handleEntityNotFound(_0x3f4e7c,null))[_0x4512('0x24')](removeEntity(_0x3f4e7c,null))[_0x4512('0x41')](handleError(_0x3f4e7c,null));}; \ No newline at end of file +var _0xbb9c=['path','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../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','update','then','destroy','UserProfileResource','stack','name','send','map','Variable','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','get','role','Variables','userProfileId','autoAssociation','rimraf','zip-dir','request-promise','bluebird','mustache','util'];(function(_0x827aa0,_0x26f731){var _0x5a8a43=function(_0x6dff55){while(--_0x6dff55){_0x827aa0['push'](_0x827aa0['shift']());}};_0x5a8a43(++_0x26f731);}(_0xbb9c,0x1d4));var _0xcbb9=function(_0x3a902a,_0xca8442){_0x3a902a=_0x3a902a-0x0;var _0x24f2d5=_0xbb9c[_0x3a902a];return _0x24f2d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcbb9('0x0'));var zipdir=require(_0xcbb9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbb9('0x2'));var moment=require('moment');var BPromise=require(_0xcbb9('0x3'));var Mustache=require(_0xcbb9('0x4'));var util=require(_0xcbb9('0x5'));var path=require(_0xcbb9('0x6'));var sox=require('sox');var csv=require(_0xcbb9('0x7'));var ejs=require(_0xcbb9('0x8'));var fs=require('fs');var fs_extra=require(_0xcbb9('0x9'));var _=require('lodash');var squel=require(_0xcbb9('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcbb9('0x7'));var querystring=require(_0xcbb9('0xb'));var Papa=require(_0xcbb9('0xc'));var Redis=require(_0xcbb9('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbb9('0xe'));var hardwareService=require(_0xcbb9('0xf'));var logger=require(_0xcbb9('0x10'))(_0xcbb9('0x11'));var utils=require(_0xcbb9('0x12'));var config=require(_0xcbb9('0x13'));var licenseUtil=require(_0xcbb9('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d6e5c,_0xd7da87){_0xd7da87=_0xd7da87||0xcc;return function(_0x580431){if(_0x580431){return _0x3d6e5c[_0xcbb9('0x15')](_0xd7da87);}return _0x3d6e5c[_0xcbb9('0x16')](_0xd7da87)[_0xcbb9('0x17')]();};}function respondWithResult(_0x1d6c57,_0x5e5005){_0x5e5005=_0x5e5005||0xc8;return function(_0x21333f){if(_0x21333f){return _0x1d6c57['status'](_0x5e5005)['json'](_0x21333f);}};}function respondWithFilteredResult(_0x16b695,_0x43ce95){return function(_0x3ad523){if(_0x3ad523){var _0x1783b4=typeof _0x43ce95['offset']===_0xcbb9('0x18')&&typeof _0x43ce95[_0xcbb9('0x19')]==='undefined';var _0x390869=_0x3ad523[_0xcbb9('0x1a')];var _0x2e8d84=_0x1783b4?0x0:_0x43ce95[_0xcbb9('0x1b')];var _0x33b5e3=_0x1783b4?_0x3ad523[_0xcbb9('0x1a')]:_0x43ce95['offset']+_0x43ce95[_0xcbb9('0x19')];var _0x324648;if(_0x33b5e3>=_0x390869){_0x33b5e3=_0x390869;_0x324648=0xc8;}else{_0x324648=0xce;}_0x16b695[_0xcbb9('0x16')](_0x324648);return _0x16b695[_0xcbb9('0x1c')](_0xcbb9('0x1d'),_0x2e8d84+'-'+_0x33b5e3+'/'+_0x390869)[_0xcbb9('0x1e')](_0x3ad523);}return null;};}function patchUpdates(_0x103007){return function(_0x49f2c0){try{jsonpatch[_0xcbb9('0x1f')](_0x49f2c0,_0x103007,!![]);}catch(_0x421302){return BPromise[_0xcbb9('0x20')](_0x421302);}return _0x49f2c0['save']();};}function saveUpdates(_0x49361f,_0x3196c0){return function(_0x24415a){if(_0x24415a){return _0x24415a[_0xcbb9('0x21')](_0x49361f)[_0xcbb9('0x22')](function(_0x1b4ec2){return _0x1b4ec2;});}return null;};}function removeEntity(_0x40f53d,_0x3e1a90){return function(_0x2eaafb){if(_0x2eaafb){return _0x2eaafb[_0xcbb9('0x23')]()[_0xcbb9('0x22')](function(){var _0x4a70b4=_0x2eaafb['get']({'plain':!![]});var _0x395eac='Variables';return db[_0xcbb9('0x24')][_0xcbb9('0x23')]({'where':{'type':_0x395eac,'resourceId':_0x4a70b4['id']}})[_0xcbb9('0x22')](function(){return _0x2eaafb;});})[_0xcbb9('0x22')](function(){_0x40f53d[_0xcbb9('0x16')](0xcc)[_0xcbb9('0x17')]();});}};}function handleEntityNotFound(_0x3672d2,_0x477e7a){return function(_0x1aa6fc){if(!_0x1aa6fc){_0x3672d2[_0xcbb9('0x15')](0x194);}return _0x1aa6fc;};}function handleError(_0x28bc76,_0x3c5f30){_0x3c5f30=_0x3c5f30||0x1f4;return function(_0x139ca1){logger['error'](_0x139ca1[_0xcbb9('0x25')]);if(_0x139ca1['name']){delete _0x139ca1[_0xcbb9('0x26')];}_0x28bc76[_0xcbb9('0x16')](_0x3c5f30)[_0xcbb9('0x27')](_0x139ca1);};}exports['index']=function(_0x23a017,_0x127d41){var _0x1da148={},_0x1abb8d={},_0x3a7d6f={'count':0x0,'rows':[]};var _0x2b611b=_[_0xcbb9('0x28')](db[_0xcbb9('0x29')][_0xcbb9('0x2a')],function(_0x1f94ec){return{'name':_0x1f94ec[_0xcbb9('0x2b')],'type':_0x1f94ec['type']['key']};});_0x1abb8d[_0xcbb9('0x2c')]=_[_0xcbb9('0x28')](_0x2b611b,_0xcbb9('0x26'));_0x1abb8d[_0xcbb9('0x2d')]=_[_0xcbb9('0x2e')](_0x23a017[_0xcbb9('0x2d')]);_0x1abb8d[_0xcbb9('0x2f')]=_[_0xcbb9('0x30')](_0x1abb8d['model'],_0x1abb8d[_0xcbb9('0x2d')]);_0x1da148[_0xcbb9('0x31')]=_[_0xcbb9('0x30')](_0x1abb8d['model'],qs[_0xcbb9('0x32')](_0x23a017[_0xcbb9('0x2d')][_0xcbb9('0x32')]));_0x1da148[_0xcbb9('0x31')]=_0x1da148[_0xcbb9('0x31')][_0xcbb9('0x33')]?_0x1da148[_0xcbb9('0x31')]:_0x1abb8d[_0xcbb9('0x2c')];if(!_0x23a017[_0xcbb9('0x2d')][_0xcbb9('0x34')](_0xcbb9('0x35'))){_0x1da148[_0xcbb9('0x19')]=qs['limit'](_0x23a017[_0xcbb9('0x2d')][_0xcbb9('0x19')]);_0x1da148[_0xcbb9('0x1b')]=qs[_0xcbb9('0x1b')](_0x23a017['query'][_0xcbb9('0x1b')]);}_0x1da148[_0xcbb9('0x36')]=qs[_0xcbb9('0x37')](_0x23a017[_0xcbb9('0x2d')][_0xcbb9('0x37')]);_0x1da148[_0xcbb9('0x38')]=qs['filters'](_[_0xcbb9('0x39')](_0x23a017['query'],_0x1abb8d[_0xcbb9('0x2f')]),_0x2b611b);if(_0x23a017[_0xcbb9('0x2d')][_0xcbb9('0x3a')]){_0x1da148[_0xcbb9('0x38')]=_[_0xcbb9('0x3b')](_0x1da148[_0xcbb9('0x38')],{'$or':_[_0xcbb9('0x28')](_0x2b611b,function(_0x257178){if(_0x257178[_0xcbb9('0x3c')]!==_0xcbb9('0x3d')){var _0x18d606={};_0x18d606[_0x257178['name']]={'$like':'%'+_0x23a017[_0xcbb9('0x2d')]['filter']+'%'};return _0x18d606;}})});}_0x1da148=_[_0xcbb9('0x3b')]({},_0x1da148,_0x23a017[_0xcbb9('0x3e')]);var _0x1ec241={'where':_0x1da148[_0xcbb9('0x38')]};return db[_0xcbb9('0x29')][_0xcbb9('0x1a')](_0x1ec241)['then'](function(_0x6b53df){_0x3a7d6f[_0xcbb9('0x1a')]=_0x6b53df;if(_0x23a017[_0xcbb9('0x2d')]['includeAll']){_0x1da148[_0xcbb9('0x3f')]=[{'all':!![]}];}return db[_0xcbb9('0x29')][_0xcbb9('0x40')](_0x1da148);})['then'](function(_0x16c429){_0x3a7d6f[_0xcbb9('0x41')]=_0x16c429;return _0x3a7d6f;})[_0xcbb9('0x22')](respondWithFilteredResult(_0x127d41,_0x1da148))[_0xcbb9('0x42')](handleError(_0x127d41,null));};exports[_0xcbb9('0x43')]=function(_0x22414a,_0x44ac30){var _0x4be299={'raw':!![],'where':{'id':_0x22414a[_0xcbb9('0x44')]['id']}},_0x29ea2c={};_0x29ea2c[_0xcbb9('0x2c')]=_[_0xcbb9('0x2e')](db[_0xcbb9('0x29')][_0xcbb9('0x2a')]);_0x29ea2c[_0xcbb9('0x2d')]=_[_0xcbb9('0x2e')](_0x22414a[_0xcbb9('0x2d')]);_0x29ea2c[_0xcbb9('0x2f')]=_[_0xcbb9('0x30')](_0x29ea2c[_0xcbb9('0x2c')],_0x29ea2c[_0xcbb9('0x2d')]);_0x4be299['attributes']=_[_0xcbb9('0x30')](_0x29ea2c['model'],qs[_0xcbb9('0x32')](_0x22414a['query']['fields']));_0x4be299[_0xcbb9('0x31')]=_0x4be299[_0xcbb9('0x31')][_0xcbb9('0x33')]?_0x4be299[_0xcbb9('0x31')]:_0x29ea2c['model'];if(_0x22414a['query'][_0xcbb9('0x45')]){_0x4be299[_0xcbb9('0x3f')]=[{'all':!![]}];}_0x4be299=_[_0xcbb9('0x3b')]({},_0x4be299,_0x22414a[_0xcbb9('0x3e')]);return db['Variable'][_0xcbb9('0x46')](_0x4be299)[_0xcbb9('0x22')](handleEntityNotFound(_0x44ac30,null))[_0xcbb9('0x22')](respondWithResult(_0x44ac30,null))[_0xcbb9('0x42')](handleError(_0x44ac30,null));};exports[_0xcbb9('0x47')]=function(_0x3a078e,_0x230ff7){return db[_0xcbb9('0x29')]['create'](_0x3a078e[_0xcbb9('0x48')],{})[_0xcbb9('0x22')](function(_0x213dfa){var _0x242059=_0x3a078e[_0xcbb9('0x49')][_0xcbb9('0x4a')]({'plain':!![]});if(!_0x242059)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x242059[_0xcbb9('0x4b')]===_0xcbb9('0x49')){var _0x3db57d=_0x213dfa['get']({'plain':!![]});var _0x1a43e8=_0xcbb9('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0x1a43e8,'userProfileId':_0x242059[_0xcbb9('0x4d')]},'raw':!![]})[_0xcbb9('0x22')](function(_0xaccf8f){if(_0xaccf8f&&_0xaccf8f[_0xcbb9('0x4e')]===0x0){return db[_0xcbb9('0x24')][_0xcbb9('0x47')]({'name':_0x3db57d[_0xcbb9('0x26')],'resourceId':_0x3db57d['id'],'type':_0xaccf8f[_0xcbb9('0x26')],'sectionId':_0xaccf8f['id']},{})[_0xcbb9('0x22')](function(){return _0x213dfa;});}else{return _0x213dfa;}})[_0xcbb9('0x42')](function(_0x2f2ef){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f2ef);throw _0x2f2ef;});}return _0x213dfa;})[_0xcbb9('0x22')](respondWithResult(_0x230ff7,0xc9))['catch'](handleError(_0x230ff7,null));};exports[_0xcbb9('0x21')]=function(_0x383c58,_0xb0a56a){if(_0x383c58[_0xcbb9('0x48')]['id']){delete _0x383c58[_0xcbb9('0x48')]['id'];}return db[_0xcbb9('0x29')]['find']({'where':{'id':_0x383c58['params']['id']}})['then'](handleEntityNotFound(_0xb0a56a,null))[_0xcbb9('0x22')](saveUpdates(_0x383c58['body'],null))[_0xcbb9('0x22')](respondWithResult(_0xb0a56a,null))[_0xcbb9('0x42')](handleError(_0xb0a56a,null));};exports[_0xcbb9('0x23')]=function(_0x287666,_0x4132ca){return db[_0xcbb9('0x29')]['find']({'where':{'id':_0x287666[_0xcbb9('0x44')]['id']}})['then'](handleEntityNotFound(_0x4132ca,null))[_0xcbb9('0x22')](removeEntity(_0x4132ca,null))[_0xcbb9('0x42')](handleError(_0x4132ca,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index b8065b2..e8811e0 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 _0x85e8=['moment','bluebird','../../config/environment','./variable.attributes','exports','define','Variable','lodash','util','../../config/logger','api'];(function(_0x458450,_0x437b72){var _0x2f2a4d=function(_0x55bedd){while(--_0x55bedd){_0x458450['push'](_0x458450['shift']());}};_0x2f2a4d(++_0x437b72);}(_0x85e8,0x80));var _0x885e=function(_0x77d341,_0x35743f){_0x77d341=_0x77d341-0x0;var _0x2b5057=_0x85e8[_0x77d341];return _0x2b5057;};'use strict';var _=require(_0x885e('0x0'));var util=require(_0x885e('0x1'));var logger=require(_0x885e('0x2'))(_0x885e('0x3'));var moment=require(_0x885e('0x4'));var BPromise=require(_0x885e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x885e('0x6'));var attributes=require(_0x885e('0x7'));module[_0x885e('0x8')]=function(_0x374dae,_0x2193c7){return _0x374dae[_0x885e('0x9')](_0x885e('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ab8=['./variable.attributes','define','tools_variables','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3124f8,_0x1a8b23){var _0x5bab5f=function(_0x18b09b){while(--_0x18b09b){_0x3124f8['push'](_0x3124f8['shift']());}};_0x5bab5f(++_0x1a8b23);}(_0x7ab8,0x14d));var _0x87ab=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7ab8[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x87ab('0x0'));var util=require(_0x87ab('0x1'));var logger=require(_0x87ab('0x2'))(_0x87ab('0x3'));var moment=require(_0x87ab('0x4'));var BPromise=require(_0x87ab('0x5'));var rp=require(_0x87ab('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x87ab('0x7'));module['exports']=function(_0x45eca7,_0x254636){return _0x45eca7[_0x87ab('0x8')]('Variable',attributes,{'tableName':_0x87ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 066ef0a..a2da0ad 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 _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(_0x345695,_0x2ba140){var _0x5002d3=function(_0x1f6cbb){while(--_0x1f6cbb){_0x345695['push'](_0x345695['shift']());}};_0x5002d3(++_0x2ba140);}(_0x5fc3,0xa8));var _0x35fc=function(_0x485abd,_0x32c7c1){_0x485abd=_0x485abd-0x0;var _0x3379f1=_0x5fc3[_0x485abd];return _0x3379f1;};'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 +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(_0x204a8f,_0x520868){var _0x214f67=function(_0x11da81){while(--_0x11da81){_0x204a8f['push'](_0x204a8f['shift']());}};_0x214f67(++_0x520868);}(_0x6aa7,0x178));var _0x76aa=function(_0x3e6491,_0x1d0da6){_0x3e6491=_0x3e6491-0x0;var _0x38d478=_0x6aa7[_0x3e6491];return _0x38d478;};'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 diff --git a/server/api/version/index.js b/server/api/version/index.js index a3a5cef..b049df1 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 _0x97d4=['fetch','get','/reset','isAuthenticated','/restart','restart','/migrations','migrations','express','Router','../../components/auth/service','index','/fetch','canUpdate'];(function(_0x544fcd,_0x342d1d){var _0x8dc320=function(_0x24868a){while(--_0x24868a){_0x544fcd['push'](_0x544fcd['shift']());}};_0x8dc320(++_0x342d1d);}(_0x97d4,0x1f2));var _0x497d=function(_0x33ba78,_0xbcaa2d){_0x33ba78=_0x33ba78-0x0;var _0x24a8a8=_0x97d4[_0x33ba78];return _0x24a8a8;};'use strict';var express=require(_0x497d('0x0'));var router=express[_0x497d('0x1')]();var auth=require(_0x497d('0x2'));var controller=require('./version.controller');router['get']('/',controller[_0x497d('0x3')]);router['get'](_0x497d('0x4'),auth['isAuthenticated'](),auth[_0x497d('0x5')](),controller[_0x497d('0x6')]);router[_0x497d('0x7')](_0x497d('0x8'),auth['isAuthenticated'](),auth[_0x497d('0x5')](),controller['reset']);router[_0x497d('0x7')]('/pull',auth[_0x497d('0x9')](),auth[_0x497d('0x5')](),controller['pull']);router[_0x497d('0x7')](_0x497d('0xa'),auth['isAuthenticated'](),controller[_0x497d('0xb')]);router[_0x497d('0x7')](_0x497d('0xc'),controller[_0x497d('0xd')]);module['exports']=router; \ No newline at end of file +var _0x0800=['Router','../../components/auth/service','index','get','/fetch','isAuthenticated','canUpdate','fetch','reset','pull','/restart','restart','/migrations','migrations','exports','express'];(function(_0x4f9a54,_0x231f5e){var _0x3cc680=function(_0x3d249c){while(--_0x3d249c){_0x4f9a54['push'](_0x4f9a54['shift']());}};_0x3cc680(++_0x231f5e);}(_0x0800,0x1af));var _0x0080=function(_0x348896,_0x1f7e6e){_0x348896=_0x348896-0x0;var _0x16453f=_0x0800[_0x348896];return _0x16453f;};'use strict';var express=require(_0x0080('0x0'));var router=express[_0x0080('0x1')]();var auth=require(_0x0080('0x2'));var controller=require('./version.controller');router['get']('/',controller[_0x0080('0x3')]);router[_0x0080('0x4')](_0x0080('0x5'),auth[_0x0080('0x6')](),auth[_0x0080('0x7')](),controller[_0x0080('0x8')]);router[_0x0080('0x4')]('/reset',auth[_0x0080('0x6')](),auth[_0x0080('0x7')](),controller[_0x0080('0x9')]);router[_0x0080('0x4')]('/pull',auth['isAuthenticated'](),auth[_0x0080('0x7')](),controller[_0x0080('0xa')]);router[_0x0080('0x4')](_0x0080('0xb'),auth[_0x0080('0x6')](),controller[_0x0080('0xc')]);router[_0x0080('0x4')](_0x0080('0xd'),controller[_0x0080('0xe')]);module[_0x0080('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 1176a8f..6238ba7 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 _0x3e56=['update','simple-git','root','index','exports','query','latest','fetch','version','2.0.0','json','status','origin','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','motion2','then','pm2\x20restart\x20motion\x20%s','migrations','join','server','length','replace','.js','push','sort','Migration','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','\x20to\x20','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','exec','../../mysqldb','../../config/pm2','../../config/logger'];(function(_0x3af641,_0x9f4f41){var _0xd1539b=function(_0x330212){while(--_0x330212){_0x3af641['push'](_0x3af641['shift']());}};_0xd1539b(++_0x9f4f41);}(_0x3e56,0x17b));var _0x63e5=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0x3e56[_0x4f5108];return _0x2d56ca;};'use strict';var Umzug=require(_0x63e5('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,'version');var compareVersions=require('compare-versions');var exec=require('child_process')[_0x63e5('0x1')];var db=require(_0x63e5('0x2'))['db'];var config=require('../../config/environment');var pm2=require(_0x63e5('0x3'));var logger=require(_0x63e5('0x4'))(_0x63e5('0x5'));var git=require(_0x63e5('0x6'))(config[_0x63e5('0x7')]);exports[_0x63e5('0x8')]=function(_0x1618f5,_0x27fe79){var _0x5e5e4c={'current':module[_0x63e5('0x9')]['version'],'phonebar':0x2};if(_0x1618f5['query']&&_0x1618f5[_0x63e5('0xa')][_0x63e5('0xb')]){return git[_0x63e5('0xc')]()['tags'](function(_0x16ed9e,_0x232fa2){_0x5e5e4c[_0x63e5('0xb')]=(_0x16ed9e?module[_0x63e5('0x9')][_0x63e5('0xd')]:_0x232fa2[_0x63e5('0xb')])||_0x63e5('0xe');return _0x27fe79['status'](0xc8)[_0x63e5('0xf')](_0x5e5e4c);});}else{return _0x27fe79[_0x63e5('0x10')](0xc8)['json'](_0x5e5e4c);}};exports[_0x63e5('0xc')]=function(_0x2a7ef3,_0x21d2e9){return git[_0x63e5('0xc')]([_0x63e5('0x11'),'master'],function(_0x52b2b6){if(_0x52b2b6){logger[_0x63e5('0x12')](_0x52b2b6);return _0x21d2e9[_0x63e5('0x10')](0x1f4)[_0x63e5('0xf')](_0x52b2b6);}logger['info'](_0x63e5('0x13'));return _0x21d2e9[_0x63e5('0x10')](0xc8)[_0x63e5('0xf')]({'output':_0x63e5('0x14')});});};exports[_0x63e5('0x15')]=function(_0x229b84,_0x859c99){return git['reset']([_0x63e5('0x16'),_0x63e5('0x17')],function(_0x5ab00b){if(_0x5ab00b){logger[_0x63e5('0x12')](_0x5ab00b);return _0x859c99[_0x63e5('0x10')](0x1f4)[_0x63e5('0xf')](_0x5ab00b);}logger[_0x63e5('0x18')](_0x63e5('0x19'));return _0x859c99['status'](0xc8)[_0x63e5('0xf')]({'output':_0x63e5('0x1a')});});};exports[_0x63e5('0x1b')]=function(_0x4faa28,_0x5a2961){exec(_0x63e5('0x1c'),function(_0x164717,_0x3a47c1,_0x58a294){logger[_0x63e5('0x18')](_0x3a47c1);logger[_0x63e5('0x18')](_0x58a294);if(_0x164717){logger['error'](_0x164717);return _0x5a2961[_0x63e5('0x10')](0x1f4)[_0x63e5('0xf')](_0x164717);}return _0x5a2961[_0x63e5('0x10')](0xc8)[_0x63e5('0xf')]({'output':_0x3a47c1});});};exports['restart']=function(_0x24006d,_0x336006){return pm2['restart'](_0x63e5('0x1d'))[_0x63e5('0x1e')](function(_0x2e50a0){logger[_0x63e5('0x18')](_0x63e5('0x1f'),_0x2e50a0);return _0x336006[_0x63e5('0x10')](0xc8)[_0x63e5('0xf')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x37755c){logger[_0x63e5('0x12')](_0x37755c);return _0x336006[_0x63e5('0x10')](0x1f4)[_0x63e5('0xf')](_0x37755c);});};exports[_0x63e5('0x20')]=function(_0x5efa4d,_0x111c46){var _0x4e9052=fs['readdirSync'](path[_0x63e5('0x21')](config['root'],_0x63e5('0x22'),_0x63e5('0x20')));var _0x19b398=[];for(var _0x114d63=0x0;_0x114d63<_0x4e9052[_0x63e5('0x23')];_0x114d63++){var _0x5829c9=_0x4e9052[_0x114d63][_0x63e5('0x24')](_0x63e5('0x25'),'');if(compareVersions(module['exports']['version'],_0x5829c9)===-0x1){_0x19b398[_0x63e5('0x26')](_0x5829c9);}}if(_0x19b398['length']){var _0x31f955=_0x19b398[_0x63e5('0x27')](compareVersions);var _0x2bb6ad=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x63e5('0x28'),'columnName':_0x63e5('0xd')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0x63e5('0x29')][_0x63e5('0x2a')],function(){throw new Error(_0x63e5('0x2b'));}],'path':path[_0x63e5('0x21')](config[_0x63e5('0x7')],_0x63e5('0x22'),_0x63e5('0x20')),'pattern':/\.js$/}});_0x2bb6ad['up']({'migrations':_['map'](_0x31f955,function(_0x1a3d13){return _0x1a3d13+_0x63e5('0x25');})})['then'](function(){return _0x111c46['status'](0xc8)[_0x63e5('0xf')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x63e5('0x9')]['version']+_0x63e5('0x2c')+_['last'](_0x31f955),'migrations':_[_0x63e5('0x21')](_0x31f955)});})[_0x63e5('0x2d')](function(_0x52f51c){if(_0x52f51c instanceof db[_0x63e5('0x29')][_0x63e5('0x2e')]){return _0x111c46[_0x63e5('0x10')](0xc8)[_0x63e5('0xf')]({'output':_0x63e5('0x2f')});}else{return _0x111c46[_0x63e5('0x10')](0x1f4)[_0x63e5('0xf')](_0x52f51c);}});}else{return _0x111c46[_0x63e5('0x10')](0xc8)[_0x63e5('0xf')]({'output':_0x63e5('0x2f')});}}; \ No newline at end of file +var _0xb5fc=['--hard','FETCH_HEAD','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','catch','migrations','readdirSync','join','root','server','length','replace','push','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','.js','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','exports','query','latest','fetch','tags','json','origin','master','error','status','info','git\x20fetch\x20origin\x20master','reset'];(function(_0x2fb0de,_0x1da740){var _0x4e01d2=function(_0x1d5726){while(--_0x1d5726){_0x2fb0de['push'](_0x2fb0de['shift']());}};_0x4e01d2(++_0x1da740);}(_0xb5fc,0x1ef));var _0xcb5f=function(_0x48bbcb,_0x207f65){_0x48bbcb=_0x48bbcb-0x0;var _0x3fc9f9=_0xb5fc[_0x48bbcb];return _0x3fc9f9;};'use strict';var Umzug=require(_0xcb5f('0x0'));var path=require(_0xcb5f('0x1'));var fs=require('fs');var _=require(_0xcb5f('0x2'));var pkginfo=require(_0xcb5f('0x3'))(module,_0xcb5f('0x4'));var compareVersions=require(_0xcb5f('0x5'));var exec=require('child_process')[_0xcb5f('0x6')];var db=require(_0xcb5f('0x7'))['db'];var config=require(_0xcb5f('0x8'));var pm2=require(_0xcb5f('0x9'));var logger=require(_0xcb5f('0xa'))(_0xcb5f('0xb'));var git=require(_0xcb5f('0xc'))(config['root']);exports[_0xcb5f('0xd')]=function(_0x55eabf,_0x49c465){var _0x32609c={'current':module[_0xcb5f('0xe')][_0xcb5f('0x4')],'phonebar':0x2};if(_0x55eabf[_0xcb5f('0xf')]&&_0x55eabf[_0xcb5f('0xf')][_0xcb5f('0x10')]){return git[_0xcb5f('0x11')]()[_0xcb5f('0x12')](function(_0x4d0276,_0x53ddaa){_0x32609c['latest']=(_0x4d0276?module[_0xcb5f('0xe')][_0xcb5f('0x4')]:_0x53ddaa[_0xcb5f('0x10')])||'2.0.0';return _0x49c465['status'](0xc8)[_0xcb5f('0x13')](_0x32609c);});}else{return _0x49c465['status'](0xc8)[_0xcb5f('0x13')](_0x32609c);}};exports[_0xcb5f('0x11')]=function(_0x2d942,_0x37d033){return git[_0xcb5f('0x11')]([_0xcb5f('0x14'),_0xcb5f('0x15')],function(_0x8a8534){if(_0x8a8534){logger[_0xcb5f('0x16')](_0x8a8534);return _0x37d033[_0xcb5f('0x17')](0x1f4)[_0xcb5f('0x13')](_0x8a8534);}logger[_0xcb5f('0x18')]('git\x20fetch');return _0x37d033['status'](0xc8)[_0xcb5f('0x13')]({'output':_0xcb5f('0x19')});});};exports[_0xcb5f('0x1a')]=function(_0x6d08bc,_0x4922f2){return git[_0xcb5f('0x1a')]([_0xcb5f('0x1b'),_0xcb5f('0x1c')],function(_0x467507){if(_0x467507){logger[_0xcb5f('0x16')](_0x467507);return _0x4922f2[_0xcb5f('0x17')](0x1f4)[_0xcb5f('0x13')](_0x467507);}logger[_0xcb5f('0x18')](_0xcb5f('0x1d'));return _0x4922f2[_0xcb5f('0x17')](0xc8)[_0xcb5f('0x13')]({'output':_0xcb5f('0x1e')});});};exports[_0xcb5f('0x1f')]=function(_0x156b2a,_0x468682){exec(_0xcb5f('0x20'),function(_0x3e486d,_0x205b02,_0xd08874){logger[_0xcb5f('0x18')](_0x205b02);logger[_0xcb5f('0x18')](_0xd08874);if(_0x3e486d){logger[_0xcb5f('0x16')](_0x3e486d);return _0x468682[_0xcb5f('0x17')](0x1f4)['json'](_0x3e486d);}return _0x468682[_0xcb5f('0x17')](0xc8)[_0xcb5f('0x13')]({'output':_0x205b02});});};exports['restart']=function(_0x150947,_0x3369e7){return pm2[_0xcb5f('0x21')](_0xcb5f('0x22'))[_0xcb5f('0x23')](function(_0x402e67){logger['info'](_0xcb5f('0x24'),_0x402e67);return _0x3369e7[_0xcb5f('0x17')](0xc8)[_0xcb5f('0x13')]({'output':_0xcb5f('0x25')});})[_0xcb5f('0x26')](function(_0x189a23){logger[_0xcb5f('0x16')](_0x189a23);return _0x3369e7[_0xcb5f('0x17')](0x1f4)[_0xcb5f('0x13')](_0x189a23);});};exports[_0xcb5f('0x27')]=function(_0x78e548,_0x548bb9){var _0xa9076b=fs[_0xcb5f('0x28')](path[_0xcb5f('0x29')](config[_0xcb5f('0x2a')],_0xcb5f('0x2b'),'migrations'));var _0x4fae05=[];for(var _0x4a296b=0x0;_0x4a296b<_0xa9076b[_0xcb5f('0x2c')];_0x4a296b++){var _0x286b90=_0xa9076b[_0x4a296b][_0xcb5f('0x2d')]('.js','');if(compareVersions(module['exports'][_0xcb5f('0x4')],_0x286b90)===-0x1){_0x4fae05[_0xcb5f('0x2e')](_0x286b90);}}if(_0x4fae05[_0xcb5f('0x2c')]){var _0x1582ea=_0x4fae05[_0xcb5f('0x2f')](compareVersions);var _0x3a4966=new Umzug({'storage':_0xcb5f('0x30'),'storageOptions':{'model':db[_0xcb5f('0x31')],'modelName':'Migration','columnName':_0xcb5f('0x4')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db['sequelize'][_0xcb5f('0x32')],function(){throw new Error(_0xcb5f('0x33'));}],'path':path[_0xcb5f('0x29')](config[_0xcb5f('0x2a')],_0xcb5f('0x2b'),'migrations'),'pattern':/\.js$/}});_0x3a4966['up']({'migrations':_[_0xcb5f('0x34')](_0x1582ea,function(_0xcf7f42){return _0xcf7f42+_0xcb5f('0x35');})})[_0xcb5f('0x23')](function(){return _0x548bb9[_0xcb5f('0x17')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xcb5f('0xe')]['version']+_0xcb5f('0x36')+_[_0xcb5f('0x37')](_0x1582ea),'migrations':_['join'](_0x1582ea)});})[_0xcb5f('0x26')](function(_0x2e4899){if(_0x2e4899 instanceof db[_0xcb5f('0x30')][_0xcb5f('0x38')]){return _0x548bb9[_0xcb5f('0x17')](0xc8)[_0xcb5f('0x13')]({'output':_0xcb5f('0x39')});}else{return _0x548bb9[_0xcb5f('0x17')](0x1f4)['json'](_0x2e4899);}});}else{return _0x548bb9[_0xcb5f('0x17')](0xc8)[_0xcb5f('0x13')]({'output':_0xcb5f('0x39')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 5d09258..bbe4d4a 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 _0x44e6=['../../config/environment','get','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x527df7,_0x266ce2){var _0x1bcc70=function(_0x343ce8){while(--_0x343ce8){_0x527df7['push'](_0x527df7['shift']());}};_0x1bcc70(++_0x266ce2);}(_0x44e6,0x90));var _0x644e=function(_0x198439,_0x1b5708){_0x198439=_0x198439-0x0;var _0x4c4339=_0x44e6[_0x198439];return _0x4c4339;};'use strict';var multer=require(_0x644e('0x0'));var util=require('util');var path=require(_0x644e('0x1'));var timeout=require(_0x644e('0x2'));var express=require(_0x644e('0x3'));var router=express[_0x644e('0x4')]();var fs_extra=require(_0x644e('0x5'));var auth=require(_0x644e('0x6'));var interaction=require(_0x644e('0x7'));var config=require(_0x644e('0x8'));var controller=require('./voiceAgentReport.controller');router[_0x644e('0x9')]('/',auth[_0x644e('0xa')](),controller['index']);router[_0x644e('0x9')]('/describe',auth[_0x644e('0xa')](),controller[_0x644e('0xb')]);router[_0x644e('0x9')](_0x644e('0xc'),auth[_0x644e('0xa')](),controller['show']);router[_0x644e('0xd')]('/',auth[_0x644e('0xa')](),controller[_0x644e('0xe')]);router[_0x644e('0xf')](_0x644e('0xc'),auth[_0x644e('0xa')](),controller[_0x644e('0x10')]);router['delete'](_0x644e('0xc'),auth[_0x644e('0xa')](),controller[_0x644e('0x11')]);module[_0x644e('0x12')]=router; \ No newline at end of file +var _0x29d1=['/describe','describe','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index'];(function(_0x826bbc,_0x396589){var _0x2edd14=function(_0x4bcc5c){while(--_0x4bcc5c){_0x826bbc['push'](_0x826bbc['shift']());}};_0x2edd14(++_0x396589);}(_0x29d1,0x147));var _0x129d=function(_0x2f20f8,_0x54a3f2){_0x2f20f8=_0x2f20f8-0x0;var _0xfcb1b7=_0x29d1[_0x2f20f8];return _0xfcb1b7;};'use strict';var multer=require(_0x129d('0x0'));var util=require(_0x129d('0x1'));var path=require(_0x129d('0x2'));var timeout=require(_0x129d('0x3'));var express=require(_0x129d('0x4'));var router=express[_0x129d('0x5')]();var fs_extra=require(_0x129d('0x6'));var auth=require(_0x129d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x129d('0x8'));var controller=require(_0x129d('0x9'));router[_0x129d('0xa')]('/',auth[_0x129d('0xb')](),controller[_0x129d('0xc')]);router[_0x129d('0xa')](_0x129d('0xd'),auth[_0x129d('0xb')](),controller[_0x129d('0xe')]);router[_0x129d('0xa')]('/:id',auth[_0x129d('0xb')](),controller['show']);router[_0x129d('0xf')]('/',auth['isAuthenticated'](),controller[_0x129d('0x10')]);router['put']('/:id',auth[_0x129d('0xb')](),controller[_0x129d('0x11')]);router[_0x129d('0x12')]('/:id',auth[_0x129d('0xb')](),controller[_0x129d('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 2c9d65a..296c812 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 _0xfcbb=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x344ce0,_0x33a08a){var _0x218657=function(_0x273193){while(--_0x273193){_0x344ce0['push'](_0x344ce0['shift']());}};_0x218657(++_0x33a08a);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x3c9fed,_0x122e9e){_0x3c9fed=_0x3c9fed-0x0;var _0x27bc79=_0xfcbb[_0x3c9fed];return _0x27bc79;};'use strict';var Sequelize=require(_0xbfcb('0x0'));module[_0xbfcb('0x1')]={'type':{'type':Sequelize[_0xbfcb('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xbfcb('0x2')]},'queue':{'type':Sequelize[_0xbfcb('0x2')]},'interface':{'type':Sequelize[_0xbfcb('0x2')]},'membername':{'type':Sequelize[_0xbfcb('0x2')]},'agentcalledAt':{'type':Sequelize[_0xbfcb('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xbfcb('0x3')]},'agentdumpAt':{'type':Sequelize[_0xbfcb('0x3')]},'holdtime':{'type':Sequelize[_0xbfcb('0x4')]},'agentcomplete':{'type':Sequelize[_0xbfcb('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xbfcb('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xbfcb('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xbfcb('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbfcb('0x4')]},'reason':{'type':Sequelize[_0xbfcb('0x2')]},'lastevent':{'type':Sequelize[_0xbfcb('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xbfcb('0x4')]},'channelstatedesc':{'type':Sequelize[_0xbfcb('0x2')]},'connectedlinenum':{'type':Sequelize[_0xbfcb('0x2')]},'connectedlinename':{'type':Sequelize[_0xbfcb('0x2')]},'language':{'type':Sequelize[_0xbfcb('0x2')]},'accountcode':{'type':Sequelize[_0xbfcb('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xbfcb('0x2')]},'priority':{'type':Sequelize[_0xbfcb('0x2')]},'destchannel':{'type':Sequelize[_0xbfcb('0x2')]},'destchannelstate':{'type':Sequelize[_0xbfcb('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xbfcb('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xbfcb('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xbfcb('0x2')]},'destlanguage':{'type':Sequelize[_0xbfcb('0x2')]},'destaccountcode':{'type':Sequelize[_0xbfcb('0x2')]},'destcontext':{'type':Sequelize[_0xbfcb('0x2')]},'destexten':{'type':Sequelize[_0xbfcb('0x2')]},'destpriority':{'type':Sequelize[_0xbfcb('0x2')]},'destuniqueid':{'type':Sequelize[_0xbfcb('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xbfcb('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xbfcb('0x2')]},'transfer':{'type':Sequelize[_0xbfcb('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xbfcb('0x2')],'comment':_0xbfcb('0x6')},'transferexten':{'type':Sequelize[_0xbfcb('0x2')]},'transferuniqueid':{'type':Sequelize[_0xbfcb('0x2')]},'agententerreason':{'type':Sequelize[_0xbfcb('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2d0b=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x5165e3,_0x1bc582){var _0x1836d6=function(_0x1828a4){while(--_0x1828a4){_0x5165e3['push'](_0x5165e3['shift']());}};_0x1836d6(++_0x1bc582);}(_0x2d0b,0x102));var _0xb2d0=function(_0x21dd17,_0x32e27f){_0x21dd17=_0x21dd17-0x0;var _0x266e08=_0x2d0b[_0x21dd17];return _0x266e08;};'use strict';var Sequelize=require('sequelize');module[_0xb2d0('0x0')]={'type':{'type':Sequelize[_0xb2d0('0x1')]},'uniqueid':{'type':Sequelize[_0xb2d0('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb2d0('0x1')]},'queue':{'type':Sequelize[_0xb2d0('0x1')]},'interface':{'type':Sequelize[_0xb2d0('0x1')]},'membername':{'type':Sequelize[_0xb2d0('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xb2d0('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xb2d0('0x2')]},'agentdumpAt':{'type':Sequelize[_0xb2d0('0x2')]},'holdtime':{'type':Sequelize[_0xb2d0('0x3')]},'agentcomplete':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb2d0('0x3')]},'agentacw':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb2d0('0x3')]},'reason':{'type':Sequelize[_0xb2d0('0x1')]},'lastevent':{'type':Sequelize[_0xb2d0('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb2d0('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb2d0('0x1')]},'exten':{'type':Sequelize[_0xb2d0('0x1')]},'priority':{'type':Sequelize[_0xb2d0('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xb2d0('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xb2d0('0x1')]},'destcalleridname':{'type':Sequelize[_0xb2d0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xb2d0('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xb2d0('0x1')]},'destlanguage':{'type':Sequelize[_0xb2d0('0x1')]},'destaccountcode':{'type':Sequelize[_0xb2d0('0x1')]},'destcontext':{'type':Sequelize[_0xb2d0('0x1')]},'destexten':{'type':Sequelize[_0xb2d0('0x1')]},'destpriority':{'type':Sequelize[_0xb2d0('0x1')]},'destuniqueid':{'type':Sequelize[_0xb2d0('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb2d0('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xb2d0('0x1')]},'transfer':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb2d0('0x1')],'comment':_0xb2d0('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xb2d0('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'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 68b3ba1..994eaff 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 670a4bb..3d78db2 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 _0xe9e8=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash'];(function(_0x4c1d59,_0x12762b){var _0x5959f3=function(_0x228742){while(--_0x228742){_0x4c1d59['push'](_0x4c1d59['shift']());}};_0x5959f3(++_0x12762b);}(_0xe9e8,0x179));var _0x8e9e=function(_0x363dea,_0x140391){_0x363dea=_0x363dea-0x0;var _0x392f0c=_0xe9e8[_0x363dea];return _0x392f0c;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var logger=require(_0x8e9e('0x2'))(_0x8e9e('0x3'));var moment=require(_0x8e9e('0x4'));var BPromise=require(_0x8e9e('0x5'));var rp=require(_0x8e9e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e9e('0x7'));var config=require('../../config/environment');var attributes=require(_0x8e9e('0x8'));module[_0x8e9e('0x9')]=function(_0x3b5e8d,_0x5de00e){return _0x3b5e8d['define'](_0x8e9e('0xa'),attributes,{'tableName':_0x8e9e('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8e9e('0xc'),_0x8e9e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6bdc=['define','VoiceAgentReport','report_agent','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3f0c92,_0x59ac03){var _0x30d65a=function(_0x59d3e6){while(--_0x59d3e6){_0x3f0c92['push'](_0x3f0c92['shift']());}};_0x30d65a(++_0x59ac03);}(_0x6bdc,0x14e));var _0xc6bd=function(_0x571d8b,_0x1b5394){_0x571d8b=_0x571d8b-0x0;var _0x1f093d=_0x6bdc[_0x571d8b];return _0x1f093d;};'use strict';var _=require(_0xc6bd('0x0'));var util=require(_0xc6bd('0x1'));var logger=require(_0xc6bd('0x2'))(_0xc6bd('0x3'));var moment=require(_0xc6bd('0x4'));var BPromise=require(_0xc6bd('0x5'));var rp=require(_0xc6bd('0x6'));var fs=require('fs');var path=require(_0xc6bd('0x7'));var rimraf=require(_0xc6bd('0x8'));var config=require(_0xc6bd('0x9'));var attributes=require('./voiceAgentReport.attributes');module[_0xc6bd('0xa')]=function(_0x26218a,_0x158271){return _0x26218a[_0xc6bd('0xb')](_0xc6bd('0xc'),attributes,{'tableName':_0xc6bd('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xc6bd('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 18459f9..d4354bf 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 _0x505d=['VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','update','where','attributes','UpdateVoiceAgentReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4b2cc6,_0x29ef43){var _0x3e0b08=function(_0x3b4131){while(--_0x3b4131){_0x4b2cc6['push'](_0x4b2cc6['shift']());}};_0x3e0b08(++_0x29ef43);}(_0x505d,0x8e));var _0xd505=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x505d[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xd505('0x0'));var util=require('util');var moment=require(_0xd505('0x1'));var BPromise=require(_0xd505('0x2'));var rs=require(_0xd505('0x3'));var fs=require('fs');var Redis=require(_0xd505('0x4'));var db=require(_0xd505('0x5'))['db'];var utils=require(_0xd505('0x6'));var logger=require(_0xd505('0x7'))(_0xd505('0x8'));var config=require(_0xd505('0x9'));var jayson=require(_0xd505('0xa'));var client=jayson['client'][_0xd505('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b2690,_0x2e3eda,_0x4d8a7f){return new BPromise(function(_0x42104c,_0xb2c667){return client['request'](_0x3b2690,_0x4d8a7f)[_0xd505('0xc')](function(_0x2670c1){logger[_0xd505('0xd')](_0xd505('0xe'),_0x2e3eda,'request\x20sent');logger[_0xd505('0xf')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x2e3eda,_0xd505('0x10'),JSON[_0xd505('0x11')](_0x2670c1));if(_0x2670c1[_0xd505('0x12')]){if(_0x2670c1['error'][_0xd505('0x13')]===0x1f4){logger['error'](_0xd505('0xe'),_0x2e3eda,_0x2670c1[_0xd505('0x12')]['message']);return _0xb2c667(_0x2670c1[_0xd505('0x12')]['message']);}logger[_0xd505('0x12')](_0xd505('0xe'),_0x2e3eda,_0x2670c1['error'][_0xd505('0x14')]);return _0x42104c(_0x2670c1['error'][_0xd505('0x14')]);}else{logger[_0xd505('0xd')](_0xd505('0xe'),_0x2e3eda,_0xd505('0x10'));_0x42104c(_0x2670c1[_0xd505('0x15')][_0xd505('0x14')]);}})[_0xd505('0x16')](function(_0x1cd952){logger[_0xd505('0x12')](_0xd505('0xe'),_0x2e3eda,_0x1cd952);_0xb2c667(_0x1cd952);});});}exports['CreateVoiceAgentReport']=function(_0x305e9f){var _0x323aaf=this;return new Promise(function(_0x5ed648,_0x43f23a){return db[_0xd505('0x17')][_0xd505('0x18')](_0x305e9f[_0xd505('0x19')],{'raw':_0x305e9f[_0xd505('0x1a')]?_0x305e9f[_0xd505('0x1a')][_0xd505('0x1b')]===undefined?!![]:![]:!![]})[_0xd505('0xc')](function(_0x28c871){logger['info']('CreateVoiceAgentReport',_0x305e9f);logger[_0xd505('0xf')](_0xd505('0x1c'),_0x305e9f,JSON['stringify'](_0x28c871));_0x5ed648(_0x28c871);})['catch'](function(_0x4162bc){logger[_0xd505('0x12')](_0xd505('0x1c'),_0x4162bc[_0xd505('0x14')],_0x305e9f);_0x43f23a(_0x323aaf[_0xd505('0x12')](0x1f4,_0x4162bc[_0xd505('0x14')]));});});};exports['UpdateVoiceAgentReport']=function(_0x52ee9c){var _0x2ef49e=this;return new Promise(function(_0x1321b7,_0x39f981){return db[_0xd505('0x17')][_0xd505('0x1d')](_0x52ee9c[_0xd505('0x19')],{'raw':_0x52ee9c[_0xd505('0x1a')]?_0x52ee9c[_0xd505('0x1a')][_0xd505('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52ee9c[_0xd505('0x1a')]?_0x52ee9c['options'][_0xd505('0x1e')]||null:null,'attributes':_0x52ee9c[_0xd505('0x1a')]?_0x52ee9c[_0xd505('0x1a')][_0xd505('0x1f')]||null:null,'limit':_0x52ee9c[_0xd505('0x1a')]?_0x52ee9c[_0xd505('0x1a')]['limit']||null:null})[_0xd505('0xc')](function(_0x345aed){logger[_0xd505('0xd')]('UpdateVoiceAgentReport',_0x52ee9c);logger['debug']('UpdateVoiceAgentReport',_0x52ee9c,JSON[_0xd505('0x11')](_0x345aed));_0x1321b7(_0x345aed);})[_0xd505('0x16')](function(_0x5db36d){logger[_0xd505('0x12')](_0xd505('0x20'),_0x5db36d['message'],_0x52ee9c);_0x39f981(_0x2ef49e['error'](0x1f4,_0x5db36d[_0xd505('0x14')]));});});}; \ No newline at end of file +var _0xe5ad=['request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','body','options','raw','UpdateVoiceAgentReport','VoiceAgentReport','update','where','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','http'];(function(_0x499792,_0x20bf22){var _0x1ba806=function(_0x2bc368){while(--_0x2bc368){_0x499792['push'](_0x499792['shift']());}};_0x1ba806(++_0x20bf22);}(_0xe5ad,0x142));var _0xde5a=function(_0x24f195,_0x488507){_0x24f195=_0x24f195-0x0;var _0x32fb97=_0xe5ad[_0x24f195];return _0x32fb97;};'use strict';var _=require(_0xde5a('0x0'));var util=require(_0xde5a('0x1'));var moment=require('moment');var BPromise=require(_0xde5a('0x2'));var rs=require(_0xde5a('0x3'));var fs=require('fs');var Redis=require(_0xde5a('0x4'));var db=require(_0xde5a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xde5a('0x6'));var client=jayson['client'][_0xde5a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x12161e,_0x10dd6d,_0x3f9828){return new BPromise(function(_0x453c6b,_0x1eb833){return client[_0xde5a('0x8')](_0x12161e,_0x3f9828)[_0xde5a('0x9')](function(_0x35370b){logger[_0xde5a('0xa')](_0xde5a('0xb'),_0x10dd6d,_0xde5a('0xc'));logger[_0xde5a('0xd')](_0xde5a('0xe'),_0x10dd6d,_0xde5a('0xc'),JSON[_0xde5a('0xf')](_0x35370b));if(_0x35370b[_0xde5a('0x10')]){if(_0x35370b[_0xde5a('0x10')][_0xde5a('0x11')]===0x1f4){logger[_0xde5a('0x10')](_0xde5a('0xb'),_0x10dd6d,_0x35370b[_0xde5a('0x10')][_0xde5a('0x12')]);return _0x1eb833(_0x35370b[_0xde5a('0x10')][_0xde5a('0x12')]);}logger[_0xde5a('0x10')](_0xde5a('0xb'),_0x10dd6d,_0x35370b[_0xde5a('0x10')][_0xde5a('0x12')]);return _0x453c6b(_0x35370b[_0xde5a('0x10')]['message']);}else{logger[_0xde5a('0xa')](_0xde5a('0xb'),_0x10dd6d,_0xde5a('0xc'));_0x453c6b(_0x35370b[_0xde5a('0x13')][_0xde5a('0x12')]);}})[_0xde5a('0x14')](function(_0x4dd2b5){logger[_0xde5a('0x10')](_0xde5a('0xb'),_0x10dd6d,_0x4dd2b5);_0x1eb833(_0x4dd2b5);});});}exports[_0xde5a('0x15')]=function(_0x3fdb6e){var _0x4a6999=this;return new Promise(function(_0x947bb7,_0xa73ccf){return db['VoiceAgentReport']['create'](_0x3fdb6e[_0xde5a('0x16')],{'raw':_0x3fdb6e['options']?_0x3fdb6e[_0xde5a('0x17')][_0xde5a('0x18')]===undefined?!![]:![]:!![]})[_0xde5a('0x9')](function(_0x47bb4c){logger[_0xde5a('0xa')](_0xde5a('0x15'),_0x3fdb6e);logger[_0xde5a('0xd')]('CreateVoiceAgentReport',_0x3fdb6e,JSON[_0xde5a('0xf')](_0x47bb4c));_0x947bb7(_0x47bb4c);})[_0xde5a('0x14')](function(_0xeb9e6f){logger[_0xde5a('0x10')](_0xde5a('0x15'),_0xeb9e6f['message'],_0x3fdb6e);_0xa73ccf(_0x4a6999[_0xde5a('0x10')](0x1f4,_0xeb9e6f[_0xde5a('0x12')]));});});};exports[_0xde5a('0x19')]=function(_0x2e9a5b){var _0x3825ab=this;return new Promise(function(_0x348027,_0x545c93){return db[_0xde5a('0x1a')][_0xde5a('0x1b')](_0x2e9a5b[_0xde5a('0x16')],{'raw':_0x2e9a5b[_0xde5a('0x17')]?_0x2e9a5b[_0xde5a('0x17')][_0xde5a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e9a5b[_0xde5a('0x17')]?_0x2e9a5b['options'][_0xde5a('0x1c')]||null:null,'attributes':_0x2e9a5b[_0xde5a('0x17')]?_0x2e9a5b[_0xde5a('0x17')]['attributes']||null:null,'limit':_0x2e9a5b[_0xde5a('0x17')]?_0x2e9a5b['options'][_0xde5a('0x1d')]||null:null})[_0xde5a('0x9')](function(_0x1c94c7){logger['info'](_0xde5a('0x19'),_0x2e9a5b);logger[_0xde5a('0xd')]('UpdateVoiceAgentReport',_0x2e9a5b,JSON['stringify'](_0x1c94c7));_0x348027(_0x1c94c7);})[_0xde5a('0x14')](function(_0xff0067){logger[_0xde5a('0x10')](_0xde5a('0x19'),_0xff0067[_0xde5a('0x12')],_0x2e9a5b);_0x545c93(_0x3825ab[_0xde5a('0x10')](0x1f4,_0xff0067[_0xde5a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 56e5932..ad7f821 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 _0x6334=['../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x30bc42,_0x337e6f){var _0x4e45ba=function(_0x1b2833){while(--_0x1b2833){_0x30bc42['push'](_0x30bc42['shift']());}};_0x4e45ba(++_0x337e6f);}(_0x6334,0x119));var _0x4633=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0x6334[_0x303c30];return _0x43161b;};'use strict';var multer=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var path=require(_0x4633('0x2'));var timeout=require(_0x4633('0x3'));var express=require(_0x4633('0x4'));var router=express[_0x4633('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4633('0x6'));var interaction=require(_0x4633('0x7'));var config=require(_0x4633('0x8'));var controller=require(_0x4633('0x9'));router[_0x4633('0xa')]('/',auth[_0x4633('0xb')](),controller[_0x4633('0xc')]);router['get'](_0x4633('0xd'),auth['isAuthenticated'](),controller[_0x4633('0xe')]);router[_0x4633('0xa')]('/:id',auth[_0x4633('0xb')](),controller[_0x4633('0xf')]);router[_0x4633('0x10')]('/',auth['isAuthenticated'](),controller[_0x4633('0x11')]);router[_0x4633('0x12')]('/:id',auth[_0x4633('0xb')](),controller[_0x4633('0x13')]);router[_0x4633('0x14')](_0x4633('0x15'),auth['isAuthenticated'](),controller[_0x4633('0x16')]);module[_0x4633('0x17')]=router; \ No newline at end of file +var _0x57d4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x57d4,0x78));var _0x457d=function(_0xbde079,_0x2ee07c){_0xbde079=_0xbde079-0x0;var _0x3cc1cc=_0x57d4[_0xbde079];return _0x3cc1cc;};'use strict';var multer=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var path=require('path');var timeout=require(_0x457d('0x2'));var express=require(_0x457d('0x3'));var router=express[_0x457d('0x4')]();var fs_extra=require(_0x457d('0x5'));var auth=require(_0x457d('0x6'));var interaction=require(_0x457d('0x7'));var config=require(_0x457d('0x8'));var controller=require(_0x457d('0x9'));router[_0x457d('0xa')]('/',auth[_0x457d('0xb')](),controller[_0x457d('0xc')]);router['get'](_0x457d('0xd'),auth[_0x457d('0xb')](),controller['describe']);router['get'](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x457d('0x10')](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0x11')]);router[_0x457d('0x12')](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0x13')]);module[_0x457d('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 969ea08..2b14ed1 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 _0x1691=['exports','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize'];(function(_0x2f023d,_0x29dfe5){var _0x4ef240=function(_0x49f1ec){while(--_0x49f1ec){_0x2f023d['push'](_0x2f023d['shift']());}};_0x4ef240(++_0x29dfe5);}(_0x1691,0x1ed));var _0x1169=function(_0x34a52b,_0x99e88b){_0x34a52b=_0x34a52b-0x0;var _0x1842e0=_0x1691[_0x34a52b];return _0x1842e0;};'use strict';var Sequelize=require(_0x1169('0x0'));module[_0x1169('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1169('0x2')](_0x1169('0x3'),_0x1169('0x4'),_0x1169('0x5'),_0x1169('0x6'),_0x1169('0x7'),_0x1169('0x8'))},'tag':{'type':Sequelize[_0x1169('0x9')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x1169('0x9')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x1169('0x9')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1169('0x9')]},'destinationchannel':{'type':Sequelize[_0x1169('0x9')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x1169('0xa')]},'starttime':{'type':Sequelize[_0x1169('0xb')]},'systemanswertime':{'type':Sequelize[_0x1169('0xb')]},'answertime':{'type':Sequelize[_0x1169('0xb')]},'endtime':{'type':Sequelize[_0x1169('0xb')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x1169('0xc')]},'mohtime':{'type':Sequelize[_0x1169('0xc')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x1169('0x9')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x1169('0x9')]},'userSecondDisposition':{'type':Sequelize[_0x1169('0x9')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x1169('0xc')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6e9b=['TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','outbound','inbound-fax','outbound-fax'];(function(_0x18952c,_0x553602){var _0x9e0ecd=function(_0x4a9e01){while(--_0x4a9e01){_0x18952c['push'](_0x18952c['shift']());}};_0x9e0ecd(++_0x553602);}(_0x6e9b,0xea));var _0xb6e9=function(_0x16c204,_0x5af1d6){_0x16c204=_0x16c204-0x0;var _0x18ad55=_0x6e9b[_0x16c204];return _0x18ad55;};'use strict';var Sequelize=require(_0xb6e9('0x0'));module[_0xb6e9('0x1')]={'uniqueid':{'type':Sequelize[_0xb6e9('0x2')]},'type':{'type':Sequelize[_0xb6e9('0x3')](_0xb6e9('0x4'),'internal',_0xb6e9('0x5'),_0xb6e9('0x6'),_0xb6e9('0x7'),'dialer')},'tag':{'type':Sequelize[_0xb6e9('0x2')]},'accountcode':{'type':Sequelize[_0xb6e9('0x2')]},'source':{'type':Sequelize[_0xb6e9('0x2')]},'destination':{'type':Sequelize[_0xb6e9('0x2')]},'destinationcontext':{'type':Sequelize[_0xb6e9('0x2')]},'callerid':{'type':Sequelize[_0xb6e9('0x2')]},'channel':{'type':Sequelize[_0xb6e9('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xb6e9('0x2')]},'lastdata':{'type':Sequelize[_0xb6e9('0x8')]},'starttime':{'type':Sequelize[_0xb6e9('0x9')]},'systemanswertime':{'type':Sequelize[_0xb6e9('0x9')]},'answertime':{'type':Sequelize[_0xb6e9('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xb6e9('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xb6e9('0x2')]},'userfield':{'type':Sequelize[_0xb6e9('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xb6e9('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb6e9('0x2')]},'prefix':{'type':Sequelize[_0xb6e9('0x2')]},'routeid':{'type':Sequelize[_0xb6e9('0xa')]},'sipcallid':{'type':Sequelize[_0xb6e9('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 49af8e2..a105706 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 _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x28b762,_0x298f96){var _0x1c9a39=function(_0xdc8dc5){while(--_0xdc8dc5){_0x28b762['push'](_0x28b762['shift']());}};_0x1c9a39(++_0x298f96);}(_0xdb28,0x106));var _0x8db2=function(_0x2e5bf1,_0x3561ac){_0x2e5bf1=_0x2e5bf1-0x0;var _0xa27172=_0xdb28[_0x2e5bf1];return _0xa27172;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x1fa759,_0x4ecdce){var _0x2da9f4=function(_0x463e2a){while(--_0x463e2a){_0x1fa759['push'](_0x1fa759['shift']());}};_0x2da9f4(++_0x4ecdce);}(_0x2ef3,0xba));var _0x32ef=function(_0x1cf997,_0x22507c){_0x1cf997=_0x1cf997-0x0;var _0x4f0f34=_0x2ef3[_0x1cf997];return _0x4f0f34;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 606121a..2496e16 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 _0x226f=['../../config/environment','exports','VoiceCallReport','report_call','uniqueid','../../config/logger','api','bluebird'];(function(_0x23cc2d,_0xd02450){var _0x3dd47d=function(_0x26c771){while(--_0x26c771){_0x23cc2d['push'](_0x23cc2d['shift']());}};_0x3dd47d(++_0xd02450);}(_0x226f,0x12d));var _0xf226=function(_0x58a242,_0x803cc6){_0x58a242=_0x58a242-0x0;var _0x375e32=_0x226f[_0x58a242];return _0x375e32;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf226('0x0'))(_0xf226('0x1'));var moment=require('moment');var BPromise=require(_0xf226('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf226('0x3'));var attributes=require('./voiceCallReport.attributes');module[_0xf226('0x4')]=function(_0x2b70c0,_0x4d407d){return _0x2b70c0['define'](_0xf226('0x5'),attributes,{'tableName':_0xf226('0x6'),'paranoid':![],'indexes':[{'fields':[_0xf226('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x85d2=['request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0xa1b0d4,_0xbeba0){var _0x19f06c=function(_0x172a9a){while(--_0x172a9a){_0xa1b0d4['push'](_0xa1b0d4['shift']());}};_0x19f06c(++_0xbeba0);}(_0x85d2,0x176));var _0x285d=function(_0x4a143c,_0x2d8167){_0x4a143c=_0x4a143c-0x0;var _0x11b2f8=_0x85d2[_0x4a143c];return _0x11b2f8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x285d('0x0'))(_0x285d('0x1'));var moment=require(_0x285d('0x2'));var BPromise=require(_0x285d('0x3'));var rp=require(_0x285d('0x4'));var fs=require('fs');var path=require(_0x285d('0x5'));var rimraf=require(_0x285d('0x6'));var config=require(_0x285d('0x7'));var attributes=require(_0x285d('0x8'));module[_0x285d('0x9')]=function(_0x5e66f8,_0x29310a){return _0x5e66f8[_0x285d('0xa')](_0x285d('0xb'),attributes,{'tableName':_0x285d('0xc'),'paranoid':![],'indexes':[{'fields':[_0x285d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index d666dad..8167de2 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 _0xf55d=['attributes','include','map','model','GetVoiceCallReport','debug','catch','CreateVoiceCallReport','create','body','update','limit','UpdateVoiceCallReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','VoiceCallReport','findAll','options','raw','where'];(function(_0x383627,_0x5be16e){var _0x2c16a0=function(_0x569b72){while(--_0x569b72){_0x383627['push'](_0x383627['shift']());}};_0x2c16a0(++_0x5be16e);}(_0xf55d,0x19d));var _0xdf55=function(_0x74405d,_0x16d631){_0x74405d=_0x74405d-0x0;var _0x8c958f=_0xf55d[_0x74405d];return _0x8c958f;};'use strict';var _=require(_0xdf55('0x0'));var util=require(_0xdf55('0x1'));var moment=require('moment');var BPromise=require(_0xdf55('0x2'));var rs=require(_0xdf55('0x3'));var fs=require('fs');var Redis=require(_0xdf55('0x4'));var db=require(_0xdf55('0x5'))['db'];var utils=require(_0xdf55('0x6'));var logger=require('../../config/logger')(_0xdf55('0x7'));var config=require(_0xdf55('0x8'));var jayson=require(_0xdf55('0x9'));var client=jayson[_0xdf55('0xa')][_0xdf55('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f1561,_0x3bb673,_0x260cd3){return new BPromise(function(_0x7358a1,_0x5dadf0){return client[_0xdf55('0xc')](_0x1f1561,_0x260cd3)[_0xdf55('0xd')](function(_0x3fcdb2){logger[_0xdf55('0xe')](_0xdf55('0xf'),_0x3bb673,_0xdf55('0x10'));logger['debug'](_0xdf55('0x11'),_0x3bb673,_0xdf55('0x10'),JSON[_0xdf55('0x12')](_0x3fcdb2));if(_0x3fcdb2[_0xdf55('0x13')]){if(_0x3fcdb2[_0xdf55('0x13')]['code']===0x1f4){logger[_0xdf55('0x13')](_0xdf55('0xf'),_0x3bb673,_0x3fcdb2['error'][_0xdf55('0x14')]);return _0x5dadf0(_0x3fcdb2[_0xdf55('0x13')][_0xdf55('0x14')]);}logger['error'](_0xdf55('0xf'),_0x3bb673,_0x3fcdb2[_0xdf55('0x13')][_0xdf55('0x14')]);return _0x7358a1(_0x3fcdb2[_0xdf55('0x13')][_0xdf55('0x14')]);}else{logger[_0xdf55('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x3bb673,_0xdf55('0x10'));_0x7358a1(_0x3fcdb2[_0xdf55('0x15')][_0xdf55('0x14')]);}})['catch'](function(_0x23f376){logger['error'](_0xdf55('0xf'),_0x3bb673,_0x23f376);_0x5dadf0(_0x23f376);});});}exports['GetVoiceCallReport']=function(_0x4e1f33){var _0x568f00=this;return new Promise(function(_0x7b1016,_0x1ab513){return db[_0xdf55('0x16')][_0xdf55('0x17')]({'raw':_0x4e1f33[_0xdf55('0x18')]?_0x4e1f33['options'][_0xdf55('0x19')]===undefined?!![]:![]:!![],'where':_0x4e1f33[_0xdf55('0x18')]?_0x4e1f33[_0xdf55('0x18')][_0xdf55('0x1a')]||null:null,'attributes':_0x4e1f33['options']?_0x4e1f33[_0xdf55('0x18')][_0xdf55('0x1b')]||null:null,'limit':_0x4e1f33[_0xdf55('0x18')]?_0x4e1f33[_0xdf55('0x18')]['limit']||null:null,'include':_0x4e1f33['options']?_0x4e1f33[_0xdf55('0x18')][_0xdf55('0x1c')]?_[_0xdf55('0x1d')](_0x4e1f33[_0xdf55('0x18')][_0xdf55('0x1c')],function(_0x4bcc43){return{'model':db[_0x4bcc43[_0xdf55('0x1e')]],'as':_0x4bcc43['as'],'attributes':_0x4bcc43[_0xdf55('0x1b')],'include':_0x4bcc43[_0xdf55('0x1c')]?_[_0xdf55('0x1d')](_0x4bcc43[_0xdf55('0x1c')],function(_0x4cb5d9){return{'model':db[_0x4cb5d9[_0xdf55('0x1e')]],'as':_0x4cb5d9['as'],'attributes':_0x4cb5d9['attributes'],'include':_0x4cb5d9[_0xdf55('0x1c')]?_[_0xdf55('0x1d')](_0x4cb5d9[_0xdf55('0x1c')],function(_0x7a2b49){return{'model':db[_0x7a2b49['model']],'as':_0x7a2b49['as'],'attributes':_0x7a2b49['attributes']};}):[]};}):[]};}):[]:[]})[_0xdf55('0xd')](function(_0x14cc1c){logger[_0xdf55('0xe')](_0xdf55('0x1f'),_0x4e1f33);logger[_0xdf55('0x20')](_0xdf55('0x1f'),_0x4e1f33,JSON[_0xdf55('0x12')](_0x14cc1c));_0x7b1016(_0x14cc1c);})[_0xdf55('0x21')](function(_0x1f7400){logger[_0xdf55('0x13')]('GetVoiceCallReport',_0x1f7400[_0xdf55('0x14')],_0x4e1f33);_0x1ab513(_0x568f00[_0xdf55('0x13')](0x1f4,_0x1f7400[_0xdf55('0x14')]));});});};exports[_0xdf55('0x22')]=function(_0x570857){var _0x364e99=this;return new Promise(function(_0x17b7b1,_0x4976e6){return db['VoiceCallReport'][_0xdf55('0x23')](_0x570857[_0xdf55('0x24')],{'raw':_0x570857[_0xdf55('0x18')]?_0x570857[_0xdf55('0x18')][_0xdf55('0x19')]===undefined?!![]:![]:!![]})[_0xdf55('0xd')](function(_0x4468da){logger[_0xdf55('0xe')](_0xdf55('0x22'),_0x570857);logger['debug'](_0xdf55('0x22'),_0x570857,JSON['stringify'](_0x4468da));_0x17b7b1(_0x4468da);})[_0xdf55('0x21')](function(_0x2b01c5){logger[_0xdf55('0x13')](_0xdf55('0x22'),_0x2b01c5['message'],_0x570857);_0x4976e6(_0x364e99['error'](0x1f4,_0x2b01c5[_0xdf55('0x14')]));});});};exports['UpdateVoiceCallReport']=function(_0x5b4f13){var _0x205e69=this;return new Promise(function(_0x1baf98,_0x30c275){return db['VoiceCallReport'][_0xdf55('0x25')](_0x5b4f13[_0xdf55('0x24')],{'raw':_0x5b4f13['options']?_0x5b4f13[_0xdf55('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b4f13[_0xdf55('0x18')]?_0x5b4f13['options'][_0xdf55('0x1a')]||null:null,'attributes':_0x5b4f13['options']?_0x5b4f13[_0xdf55('0x18')]['attributes']||null:null,'limit':_0x5b4f13[_0xdf55('0x18')]?_0x5b4f13[_0xdf55('0x18')][_0xdf55('0x26')]||null:null})[_0xdf55('0xd')](function(_0x10f56c){logger[_0xdf55('0xe')]('UpdateVoiceCallReport',_0x5b4f13);logger['debug'](_0xdf55('0x27'),_0x5b4f13,JSON[_0xdf55('0x12')](_0x10f56c));_0x1baf98(_0x10f56c);})[_0xdf55('0x21')](function(_0x276ba6){logger[_0xdf55('0x13')]('UpdateVoiceCallReport',_0x276ba6['message'],_0x5b4f13);_0x30c275(_0x205e69[_0xdf55('0x13')](0x1f4,_0x276ba6[_0xdf55('0x14')]));});});}; \ No newline at end of file +var _0x1239=['raw','update','UpdateVoiceCallReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','include','map','model','CreateVoiceCallReport','create','body'];(function(_0x4983ac,_0x36b1d2){var _0x445cb9=function(_0x44b7b4){while(--_0x44b7b4){_0x4983ac['push'](_0x4983ac['shift']());}};_0x445cb9(++_0x36b1d2);}(_0x1239,0x162));var _0x9123=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1239[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9123('0x0'));var util=require(_0x9123('0x1'));var moment=require(_0x9123('0x2'));var BPromise=require('bluebird');var rs=require(_0x9123('0x3'));var fs=require('fs');var Redis=require(_0x9123('0x4'));var db=require(_0x9123('0x5'))['db'];var utils=require(_0x9123('0x6'));var logger=require(_0x9123('0x7'))(_0x9123('0x8'));var config=require(_0x9123('0x9'));var jayson=require(_0x9123('0xa'));var client=jayson[_0x9123('0xb')][_0x9123('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x115ea4,_0x160e96,_0x2b5984){return new BPromise(function(_0x4d4997,_0x162ede){return client[_0x9123('0xd')](_0x115ea4,_0x2b5984)[_0x9123('0xe')](function(_0x5966f2){logger[_0x9123('0xf')](_0x9123('0x10'),_0x160e96,'request\x20sent');logger[_0x9123('0x11')](_0x9123('0x12'),_0x160e96,_0x9123('0x13'),JSON[_0x9123('0x14')](_0x5966f2));if(_0x5966f2[_0x9123('0x15')]){if(_0x5966f2[_0x9123('0x15')]['code']===0x1f4){logger[_0x9123('0x15')](_0x9123('0x10'),_0x160e96,_0x5966f2[_0x9123('0x15')][_0x9123('0x16')]);return _0x162ede(_0x5966f2[_0x9123('0x15')]['message']);}logger[_0x9123('0x15')]('VoiceCallReport,\x20%s,\x20%s',_0x160e96,_0x5966f2[_0x9123('0x15')][_0x9123('0x16')]);return _0x4d4997(_0x5966f2['error'][_0x9123('0x16')]);}else{logger[_0x9123('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x160e96,_0x9123('0x13'));_0x4d4997(_0x5966f2['result'][_0x9123('0x16')]);}})[_0x9123('0x17')](function(_0x52494b){logger[_0x9123('0x15')](_0x9123('0x10'),_0x160e96,_0x52494b);_0x162ede(_0x52494b);});});}exports[_0x9123('0x18')]=function(_0x19cdc9){var _0x295a65=this;return new Promise(function(_0x18e45a,_0x33e06f){return db[_0x9123('0x19')][_0x9123('0x1a')]({'raw':_0x19cdc9[_0x9123('0x1b')]?_0x19cdc9[_0x9123('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x19cdc9[_0x9123('0x1b')]?_0x19cdc9['options'][_0x9123('0x1c')]||null:null,'attributes':_0x19cdc9['options']?_0x19cdc9[_0x9123('0x1b')][_0x9123('0x1d')]||null:null,'limit':_0x19cdc9[_0x9123('0x1b')]?_0x19cdc9[_0x9123('0x1b')]['limit']||null:null,'include':_0x19cdc9[_0x9123('0x1b')]?_0x19cdc9[_0x9123('0x1b')][_0x9123('0x1e')]?_[_0x9123('0x1f')](_0x19cdc9[_0x9123('0x1b')][_0x9123('0x1e')],function(_0x46ba88){return{'model':db[_0x46ba88[_0x9123('0x20')]],'as':_0x46ba88['as'],'attributes':_0x46ba88[_0x9123('0x1d')],'include':_0x46ba88[_0x9123('0x1e')]?_[_0x9123('0x1f')](_0x46ba88['include'],function(_0xf54a2a){return{'model':db[_0xf54a2a[_0x9123('0x20')]],'as':_0xf54a2a['as'],'attributes':_0xf54a2a[_0x9123('0x1d')],'include':_0xf54a2a[_0x9123('0x1e')]?_[_0x9123('0x1f')](_0xf54a2a[_0x9123('0x1e')],function(_0x451c34){return{'model':db[_0x451c34[_0x9123('0x20')]],'as':_0x451c34['as'],'attributes':_0x451c34[_0x9123('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9123('0xe')](function(_0x121e9f){logger[_0x9123('0xf')]('GetVoiceCallReport',_0x19cdc9);logger[_0x9123('0x11')](_0x9123('0x18'),_0x19cdc9,JSON[_0x9123('0x14')](_0x121e9f));_0x18e45a(_0x121e9f);})[_0x9123('0x17')](function(_0xa46e35){logger[_0x9123('0x15')](_0x9123('0x18'),_0xa46e35[_0x9123('0x16')],_0x19cdc9);_0x33e06f(_0x295a65[_0x9123('0x15')](0x1f4,_0xa46e35['message']));});});};exports[_0x9123('0x21')]=function(_0x5ab474){var _0x107192=this;return new Promise(function(_0x237e8c,_0xf4c7ca){return db[_0x9123('0x19')][_0x9123('0x22')](_0x5ab474[_0x9123('0x23')],{'raw':_0x5ab474['options']?_0x5ab474[_0x9123('0x1b')][_0x9123('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x17c72c){logger[_0x9123('0xf')](_0x9123('0x21'),_0x5ab474);logger['debug'](_0x9123('0x21'),_0x5ab474,JSON[_0x9123('0x14')](_0x17c72c));_0x237e8c(_0x17c72c);})[_0x9123('0x17')](function(_0x31f5a7){logger[_0x9123('0x15')](_0x9123('0x21'),_0x31f5a7[_0x9123('0x16')],_0x5ab474);_0xf4c7ca(_0x107192['error'](0x1f4,_0x31f5a7['message']));});});};exports['UpdateVoiceCallReport']=function(_0x120517){var _0xd68e5=this;return new Promise(function(_0x2db430,_0x5519c1){return db[_0x9123('0x19')][_0x9123('0x25')](_0x120517[_0x9123('0x23')],{'raw':_0x120517['options']?_0x120517[_0x9123('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x120517[_0x9123('0x1b')]?_0x120517[_0x9123('0x1b')][_0x9123('0x1c')]||null:null,'attributes':_0x120517[_0x9123('0x1b')]?_0x120517[_0x9123('0x1b')]['attributes']||null:null,'limit':_0x120517[_0x9123('0x1b')]?_0x120517['options']['limit']||null:null})[_0x9123('0xe')](function(_0xe24a31){logger[_0x9123('0xf')](_0x9123('0x26'),_0x120517);logger[_0x9123('0x11')]('UpdateVoiceCallReport',_0x120517,JSON['stringify'](_0xe24a31));_0x2db430(_0xe24a31);})[_0x9123('0x17')](function(_0xe8d470){logger[_0x9123('0x15')]('UpdateVoiceCallReport',_0xe8d470['message'],_0x120517);_0x5519c1(_0xd68e5[_0x9123('0x15')](0x1f4,_0xe8d470[_0x9123('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index f388a62..029d3f1 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 _0xe7b1=['/:id','isAuthenticated','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','./voiceChanSpy.controller','index'];(function(_0x3cda5a,_0x12a608){var _0x1a8fcb=function(_0x876290){while(--_0x876290){_0x3cda5a['push'](_0x3cda5a['shift']());}};_0x1a8fcb(++_0x12a608);}(_0xe7b1,0x138));var _0x1e7b=function(_0x197fb1,_0x5a697b){_0x197fb1=_0x197fb1-0x0;var _0x50a34e=_0xe7b1[_0x197fb1];return _0x50a34e;};'use strict';var multer=require(_0x1e7b('0x0'));var util=require(_0x1e7b('0x1'));var path=require(_0x1e7b('0x2'));var timeout=require(_0x1e7b('0x3'));var express=require(_0x1e7b('0x4'));var router=express[_0x1e7b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1e7b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x1e7b('0x7')]);router['get'](_0x1e7b('0x8'),auth[_0x1e7b('0x9')](),controller[_0x1e7b('0xa')]);router[_0x1e7b('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1e7b('0xc')](_0x1e7b('0x8'),auth[_0x1e7b('0x9')](),controller[_0x1e7b('0xd')]);router[_0x1e7b('0xe')](_0x1e7b('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x1e7b('0xf')]=router; \ No newline at end of file +var _0x4437=['create','put','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4437,0xea));var _0x7443=function(_0x4ef42e,_0x5e28ff){_0x4ef42e=_0x4ef42e-0x0;var _0x449e90=_0x4437[_0x4ef42e];return _0x449e90;};'use strict';var multer=require(_0x7443('0x0'));var util=require(_0x7443('0x1'));var path=require(_0x7443('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7443('0x3'));var auth=require(_0x7443('0x4'));var interaction=require(_0x7443('0x5'));var config=require(_0x7443('0x6'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x7443('0x7')](),controller[_0x7443('0x8')]);router[_0x7443('0x9')](_0x7443('0xa'),auth[_0x7443('0x7')](),controller[_0x7443('0xb')]);router[_0x7443('0xc')]('/',auth['isAuthenticated'](),controller[_0x7443('0xd')]);router[_0x7443('0xe')](_0x7443('0xa'),auth['isAuthenticated'](),controller[_0x7443('0xf')]);router[_0x7443('0x10')](_0x7443('0xa'),auth[_0x7443('0x7')](),controller[_0x7443('0x11')]);module[_0x7443('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index c80d0ce..e7af056 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 _0xdc47=['setDataValue','options','getDataValue','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc47,0x1ec));var _0x7dc4=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0xdc47[_0x18abd2];return _0x1dcad6;};'use strict';var Sequelize=require(_0x7dc4('0x0'));module[_0x7dc4('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x7dc4('0x2')],'unique':_0x7dc4('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x7dc4('0x2')],'set':function(_0x5d5a3e){this[_0x7dc4('0x4')](_0x7dc4('0x5'),_0x5d5a3e?_0x5d5a3e['join'](''):[]);},'get':function(){return this[_0x7dc4('0x6')](_0x7dc4('0x5'))?this[_0x7dc4('0x6')](_0x7dc4('0x5'))['split'](''):[];}},'auth':{'type':Sequelize[_0x7dc4('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x7dc4('0x2')]},'record':{'type':Sequelize[_0x7dc4('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x7dc4('0x2')]},'description':{'type':Sequelize[_0x7dc4('0x2')]}}; \ No newline at end of file +var _0x927c=['STRING','setDataValue','options','join','getDataValue','BOOLEAN','exports'];(function(_0x58f89a,_0x3372ac){var _0x46873e=function(_0x59db8a){while(--_0x59db8a){_0x58f89a['push'](_0x58f89a['shift']());}};_0x46873e(++_0x3372ac);}(_0x927c,0x1a3));var _0xc927=function(_0x476b1d,_0x4e54f8){_0x476b1d=_0x476b1d-0x0;var _0xcd34d2=_0x927c[_0x476b1d];return _0xcd34d2;};'use strict';var Sequelize=require('sequelize');module[_0xc927('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xc927('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xc927('0x1')],'set':function(_0x43231e){this[_0xc927('0x2')](_0xc927('0x3'),_0x43231e?_0x43231e[_0xc927('0x4')](''):[]);},'get':function(){return this[_0xc927('0x5')](_0xc927('0x3'))?this['getDataValue']('options')['split'](''):[];}},'auth':{'type':Sequelize[_0xc927('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0xc927('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xc927('0x1')]},'description':{'type':Sequelize[_0xc927('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 24f2d57..2ab8693 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 _0x5620=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','findAll','rows','catch','show','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','name','params','eml-format','zip-dir','fast-json-patch','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','update','then','destroy','get','ChanSpies','UserProfileResource','end','error','stack','index','map','VoiceChanSpy','rawAttributes','fieldName','key'];(function(_0x4a6708,_0x4f5b6b){var _0x3da5db=function(_0x1e3aac){while(--_0x1e3aac){_0x4a6708['push'](_0x4a6708['shift']());}};_0x3da5db(++_0x4f5b6b);}(_0x5620,0xbf));var _0x0562=function(_0x23c3f4,_0x24f0b3){_0x23c3f4=_0x23c3f4-0x0;var _0x82f0f1=_0x5620[_0x23c3f4];return _0x82f0f1;};'use strict';var emlformat=require(_0x0562('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0562('0x1'));var jsonpatch=require(_0x0562('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0562('0x3'));var util=require('util');var path=require(_0x0562('0x4'));var sox=require('sox');var csv=require(_0x0562('0x5'));var ejs=require(_0x0562('0x6'));var fs=require('fs');var fs_extra=require(_0x0562('0x7'));var _=require(_0x0562('0x8'));var squel=require(_0x0562('0x9'));var crypto=require(_0x0562('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0562('0x5'));var querystring=require('querystring');var Papa=require(_0x0562('0xb'));var Redis=require(_0x0562('0xc'));var authService=require(_0x0562('0xd'));var qs=require(_0x0562('0xe'));var as=require(_0x0562('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0562('0x10'))(_0x0562('0x11'));var utils=require(_0x0562('0x12'));var config=require(_0x0562('0x13'));var licenseUtil=require(_0x0562('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57555a,_0x24989c){_0x24989c=_0x24989c||0xcc;return function(_0x30b337){if(_0x30b337){return _0x57555a[_0x0562('0x15')](_0x24989c);}return _0x57555a[_0x0562('0x16')](_0x24989c)['end']();};}function respondWithResult(_0x160656,_0xe654c7){_0xe654c7=_0xe654c7||0xc8;return function(_0x3ed2c8){if(_0x3ed2c8){return _0x160656[_0x0562('0x16')](_0xe654c7)['json'](_0x3ed2c8);}};}function respondWithFilteredResult(_0x37e9c6,_0x4ed54d){return function(_0x4711c1){if(_0x4711c1){var _0x31579e=typeof _0x4ed54d['offset']===_0x0562('0x17')&&typeof _0x4ed54d['limit']===_0x0562('0x17');var _0x16d18e=_0x4711c1[_0x0562('0x18')];var _0x554527=_0x31579e?0x0:_0x4ed54d[_0x0562('0x19')];var _0x5d6341=_0x31579e?_0x4711c1[_0x0562('0x18')]:_0x4ed54d['offset']+_0x4ed54d[_0x0562('0x1a')];var _0x1a13e5;if(_0x5d6341>=_0x16d18e){_0x5d6341=_0x16d18e;_0x1a13e5=0xc8;}else{_0x1a13e5=0xce;}_0x37e9c6['status'](_0x1a13e5);return _0x37e9c6[_0x0562('0x1b')](_0x0562('0x1c'),_0x554527+'-'+_0x5d6341+'/'+_0x16d18e)[_0x0562('0x1d')](_0x4711c1);}return null;};}function patchUpdates(_0x90626d){return function(_0x5dbc61){try{jsonpatch[_0x0562('0x1e')](_0x5dbc61,_0x90626d,!![]);}catch(_0x5819b8){return BPromise['reject'](_0x5819b8);}return _0x5dbc61['save']();};}function saveUpdates(_0x4bbcf7,_0x35f245){return function(_0x37f493){if(_0x37f493){return _0x37f493[_0x0562('0x1f')](_0x4bbcf7)[_0x0562('0x20')](function(_0x14024b){return _0x14024b;});}return null;};}function removeEntity(_0x541e82,_0x5121ee){return function(_0x3e06ab){if(_0x3e06ab){return _0x3e06ab[_0x0562('0x21')]()[_0x0562('0x20')](function(){var _0x3eb41c=_0x3e06ab[_0x0562('0x22')]({'plain':!![]});var _0x57c34f=_0x0562('0x23');return db[_0x0562('0x24')][_0x0562('0x21')]({'where':{'type':_0x57c34f,'resourceId':_0x3eb41c['id']}})[_0x0562('0x20')](function(){return _0x3e06ab;});})[_0x0562('0x20')](function(){_0x541e82[_0x0562('0x16')](0xcc)[_0x0562('0x25')]();});}};}function handleEntityNotFound(_0x15f1e7,_0x39132f){return function(_0x44b4b8){if(!_0x44b4b8){_0x15f1e7[_0x0562('0x15')](0x194);}return _0x44b4b8;};}function handleError(_0x4fdac1,_0x229669){_0x229669=_0x229669||0x1f4;return function(_0x4ea641){logger[_0x0562('0x26')](_0x4ea641[_0x0562('0x27')]);if(_0x4ea641['name']){delete _0x4ea641['name'];}_0x4fdac1['status'](_0x229669)['send'](_0x4ea641);};}exports[_0x0562('0x28')]=function(_0x4b1ad1,_0x16b3bb){var _0x2e67d4={},_0x2d3772={},_0xc2a12f={'count':0x0,'rows':[]};var _0x28051f=_[_0x0562('0x29')](db[_0x0562('0x2a')][_0x0562('0x2b')],function(_0x263185){return{'name':_0x263185[_0x0562('0x2c')],'type':_0x263185['type'][_0x0562('0x2d')]};});_0x2d3772[_0x0562('0x2e')]=_['map'](_0x28051f,'name');_0x2d3772[_0x0562('0x2f')]=_['keys'](_0x4b1ad1['query']);_0x2d3772[_0x0562('0x30')]=_[_0x0562('0x31')](_0x2d3772['model'],_0x2d3772[_0x0562('0x2f')]);_0x2e67d4[_0x0562('0x32')]=_[_0x0562('0x31')](_0x2d3772['model'],qs[_0x0562('0x33')](_0x4b1ad1[_0x0562('0x2f')][_0x0562('0x33')]));_0x2e67d4[_0x0562('0x32')]=_0x2e67d4[_0x0562('0x32')][_0x0562('0x34')]?_0x2e67d4['attributes']:_0x2d3772[_0x0562('0x2e')];if(!_0x4b1ad1[_0x0562('0x2f')][_0x0562('0x35')](_0x0562('0x36'))){_0x2e67d4['limit']=qs[_0x0562('0x1a')](_0x4b1ad1['query'][_0x0562('0x1a')]);_0x2e67d4[_0x0562('0x19')]=qs[_0x0562('0x19')](_0x4b1ad1[_0x0562('0x2f')][_0x0562('0x19')]);}_0x2e67d4[_0x0562('0x37')]=qs[_0x0562('0x38')](_0x4b1ad1['query']['sort']);_0x2e67d4[_0x0562('0x39')]=qs[_0x0562('0x30')](_[_0x0562('0x3a')](_0x4b1ad1['query'],_0x2d3772[_0x0562('0x30')]),_0x28051f);if(_0x4b1ad1['query'][_0x0562('0x3b')]){_0x2e67d4['where']=_['merge'](_0x2e67d4['where'],{'$or':_[_0x0562('0x29')](_0x28051f,function(_0xd3b10e){if(_0xd3b10e[_0x0562('0x3c')]!==_0x0562('0x3d')){var _0x12437c={};_0x12437c[_0xd3b10e['name']]={'$like':'%'+_0x4b1ad1[_0x0562('0x2f')][_0x0562('0x3b')]+'%'};return _0x12437c;}})});}_0x2e67d4=_[_0x0562('0x3e')]({},_0x2e67d4,_0x4b1ad1[_0x0562('0x3f')]);var _0x1beb6e={'where':_0x2e67d4[_0x0562('0x39')]};return db['VoiceChanSpy'][_0x0562('0x18')](_0x1beb6e)['then'](function(_0x1646a7){_0xc2a12f[_0x0562('0x18')]=_0x1646a7;if(_0x4b1ad1[_0x0562('0x2f')]['includeAll']){_0x2e67d4['include']=[{'all':!![]}];}return db[_0x0562('0x2a')][_0x0562('0x40')](_0x2e67d4);})[_0x0562('0x20')](function(_0x4d3ec0){_0xc2a12f[_0x0562('0x41')]=_0x4d3ec0;return _0xc2a12f;})[_0x0562('0x20')](respondWithFilteredResult(_0x16b3bb,_0x2e67d4))[_0x0562('0x42')](handleError(_0x16b3bb,null));};exports[_0x0562('0x43')]=function(_0x173490,_0x15cdc5){var _0x173fe7={'raw':![],'where':{'id':_0x173490['params']['id']}},_0x563863={};_0x563863['model']=_[_0x0562('0x44')](db[_0x0562('0x2a')][_0x0562('0x2b')]);_0x563863[_0x0562('0x2f')]=_['keys'](_0x173490['query']);_0x563863[_0x0562('0x30')]=_[_0x0562('0x31')](_0x563863[_0x0562('0x2e')],_0x563863['query']);_0x173fe7[_0x0562('0x32')]=_['intersection'](_0x563863[_0x0562('0x2e')],qs['fields'](_0x173490[_0x0562('0x2f')][_0x0562('0x33')]));_0x173fe7[_0x0562('0x32')]=_0x173fe7[_0x0562('0x32')][_0x0562('0x34')]?_0x173fe7[_0x0562('0x32')]:_0x563863[_0x0562('0x2e')];if(_0x173490['query'][_0x0562('0x45')]){_0x173fe7['include']=[{'all':!![]}];}_0x173fe7=_['merge']({},_0x173fe7,_0x173490['options']);return db['VoiceChanSpy'][_0x0562('0x46')](_0x173fe7)[_0x0562('0x20')](handleEntityNotFound(_0x15cdc5,null))[_0x0562('0x20')](respondWithResult(_0x15cdc5,null))[_0x0562('0x42')](handleError(_0x15cdc5,null));};exports[_0x0562('0x47')]=function(_0x4fbab8,_0x58f228){return db['VoiceChanSpy'][_0x0562('0x47')](_0x4fbab8[_0x0562('0x48')],{})[_0x0562('0x20')](function(_0x9af18b){var _0x4cec5e=_0x4fbab8[_0x0562('0x49')][_0x0562('0x22')]({'plain':!![]});if(!_0x4cec5e)throw new Error(_0x0562('0x4a'));if(_0x4cec5e[_0x0562('0x4b')]==='user'){var _0x40759d=_0x9af18b[_0x0562('0x22')]({'plain':!![]});var _0x114896=_0x0562('0x23');return db['UserProfileSection'][_0x0562('0x46')]({'where':{'name':_0x114896,'userProfileId':_0x4cec5e['userProfileId']},'raw':!![]})['then'](function(_0x1b9470){if(_0x1b9470&&_0x1b9470[_0x0562('0x4c')]===0x0){return db[_0x0562('0x24')]['create']({'name':_0x40759d[_0x0562('0x4d')],'resourceId':_0x40759d['id'],'type':_0x1b9470['name'],'sectionId':_0x1b9470['id']},{})[_0x0562('0x20')](function(){return _0x9af18b;});}else{return _0x9af18b;}})[_0x0562('0x42')](function(_0x120544){logger[_0x0562('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x120544);throw _0x120544;});}return _0x9af18b;})[_0x0562('0x20')](respondWithResult(_0x58f228,0xc9))[_0x0562('0x42')](handleError(_0x58f228,null));};exports[_0x0562('0x1f')]=function(_0x5ea3c6,_0x3f6941){if(_0x5ea3c6[_0x0562('0x48')]['id']){delete _0x5ea3c6[_0x0562('0x48')]['id'];}return db[_0x0562('0x2a')][_0x0562('0x46')]({'where':{'id':_0x5ea3c6[_0x0562('0x4e')]['id']}})[_0x0562('0x20')](handleEntityNotFound(_0x3f6941,null))[_0x0562('0x20')](saveUpdates(_0x5ea3c6['body'],null))[_0x0562('0x20')](respondWithResult(_0x3f6941,null))[_0x0562('0x42')](handleError(_0x3f6941,null));};exports[_0x0562('0x21')]=function(_0x5551d5,_0x2c2951){return db[_0x0562('0x2a')][_0x0562('0x46')]({'where':{'id':_0x5551d5[_0x0562('0x4e')]['id']}})[_0x0562('0x20')](handleEntityNotFound(_0x2c2951,null))[_0x0562('0x20')](removeEntity(_0x2c2951,null))[_0x0562('0x42')](handleError(_0x2c2951,null));}; \ No newline at end of file +var _0x9090=['then','destroy','get','ChanSpies','UserProfileResource','error','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../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','Content-Range','apply','reject','save','update'];(function(_0x303198,_0xd106a1){var _0x8c117a=function(_0x2dfb86){while(--_0x2dfb86){_0x303198['push'](_0x303198['shift']());}};_0x8c117a(++_0xd106a1);}(_0x9090,0x17f));var _0x0909=function(_0x81c695,_0x28223e){_0x81c695=_0x81c695-0x0;var _0x5dfe4a=_0x9090[_0x81c695];return _0x5dfe4a;};'use strict';var emlformat=require(_0x0909('0x0'));var rimraf=require(_0x0909('0x1'));var zipdir=require(_0x0909('0x2'));var jsonpatch=require(_0x0909('0x3'));var rp=require(_0x0909('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0909('0x5'));var util=require(_0x0909('0x6'));var path=require(_0x0909('0x7'));var sox=require('sox');var csv=require(_0x0909('0x8'));var ejs=require(_0x0909('0x9'));var fs=require('fs');var fs_extra=require(_0x0909('0xa'));var _=require(_0x0909('0xb'));var squel=require(_0x0909('0xc'));var crypto=require(_0x0909('0xd'));var jsforce=require(_0x0909('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0909('0x8'));var querystring=require(_0x0909('0xf'));var Papa=require('papaparse');var Redis=require(_0x0909('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0909('0x11'));var as=require(_0x0909('0x12'));var hardwareService=require(_0x0909('0x13'));var logger=require(_0x0909('0x14'))('api');var utils=require(_0x0909('0x15'));var config=require(_0x0909('0x16'));var licenseUtil=require(_0x0909('0x17'));var db=require(_0x0909('0x18'))['db'];function respondWithStatusCode(_0x4e900a,_0x32f71a){_0x32f71a=_0x32f71a||0xcc;return function(_0x18c223){if(_0x18c223){return _0x4e900a[_0x0909('0x19')](_0x32f71a);}return _0x4e900a[_0x0909('0x1a')](_0x32f71a)[_0x0909('0x1b')]();};}function respondWithResult(_0xad78e9,_0x3bdd30){_0x3bdd30=_0x3bdd30||0xc8;return function(_0x1811da){if(_0x1811da){return _0xad78e9[_0x0909('0x1a')](_0x3bdd30)[_0x0909('0x1c')](_0x1811da);}};}function respondWithFilteredResult(_0x48ee40,_0x2c5892){return function(_0x1eb8be){if(_0x1eb8be){var _0x96edb6=typeof _0x2c5892[_0x0909('0x1d')]===_0x0909('0x1e')&&typeof _0x2c5892[_0x0909('0x1f')]===_0x0909('0x1e');var _0x14e44c=_0x1eb8be['count'];var _0x3a7089=_0x96edb6?0x0:_0x2c5892[_0x0909('0x1d')];var _0x14976d=_0x96edb6?_0x1eb8be['count']:_0x2c5892[_0x0909('0x1d')]+_0x2c5892[_0x0909('0x1f')];var _0x11455d;if(_0x14976d>=_0x14e44c){_0x14976d=_0x14e44c;_0x11455d=0xc8;}else{_0x11455d=0xce;}_0x48ee40['status'](_0x11455d);return _0x48ee40['set'](_0x0909('0x20'),_0x3a7089+'-'+_0x14976d+'/'+_0x14e44c)['json'](_0x1eb8be);}return null;};}function patchUpdates(_0xf0efcb){return function(_0x2ccf21){try{jsonpatch[_0x0909('0x21')](_0x2ccf21,_0xf0efcb,!![]);}catch(_0x3037c1){return BPromise[_0x0909('0x22')](_0x3037c1);}return _0x2ccf21[_0x0909('0x23')]();};}function saveUpdates(_0x4eec68,_0x46b384){return function(_0x519c9f){if(_0x519c9f){return _0x519c9f[_0x0909('0x24')](_0x4eec68)[_0x0909('0x25')](function(_0x2ea745){return _0x2ea745;});}return null;};}function removeEntity(_0x3e71b9,_0x332b07){return function(_0x510ba6){if(_0x510ba6){return _0x510ba6[_0x0909('0x26')]()[_0x0909('0x25')](function(){var _0x4503db=_0x510ba6[_0x0909('0x27')]({'plain':!![]});var _0xc879d8=_0x0909('0x28');return db[_0x0909('0x29')][_0x0909('0x26')]({'where':{'type':_0xc879d8,'resourceId':_0x4503db['id']}})[_0x0909('0x25')](function(){return _0x510ba6;});})[_0x0909('0x25')](function(){_0x3e71b9['status'](0xcc)[_0x0909('0x1b')]();});}};}function handleEntityNotFound(_0x4c57c6,_0x48f73f){return function(_0x387f4d){if(!_0x387f4d){_0x4c57c6[_0x0909('0x19')](0x194);}return _0x387f4d;};}function handleError(_0x482587,_0x34f7b9){_0x34f7b9=_0x34f7b9||0x1f4;return function(_0x33ce47){logger[_0x0909('0x2a')](_0x33ce47['stack']);if(_0x33ce47[_0x0909('0x2b')]){delete _0x33ce47[_0x0909('0x2b')];}_0x482587[_0x0909('0x1a')](_0x34f7b9)[_0x0909('0x2c')](_0x33ce47);};}exports[_0x0909('0x2d')]=function(_0x5470e4,_0x1bd9ae){var _0x569ef9={},_0x250fd0={},_0x2fd839={'count':0x0,'rows':[]};var _0x4b6805=_[_0x0909('0x2e')](db[_0x0909('0x2f')]['rawAttributes'],function(_0x3c53ce){return{'name':_0x3c53ce[_0x0909('0x30')],'type':_0x3c53ce[_0x0909('0x31')][_0x0909('0x32')]};});_0x250fd0[_0x0909('0x33')]=_['map'](_0x4b6805,_0x0909('0x2b'));_0x250fd0[_0x0909('0x34')]=_[_0x0909('0x35')](_0x5470e4[_0x0909('0x34')]);_0x250fd0['filters']=_[_0x0909('0x36')](_0x250fd0[_0x0909('0x33')],_0x250fd0[_0x0909('0x34')]);_0x569ef9[_0x0909('0x37')]=_[_0x0909('0x36')](_0x250fd0[_0x0909('0x33')],qs[_0x0909('0x38')](_0x5470e4['query']['fields']));_0x569ef9[_0x0909('0x37')]=_0x569ef9[_0x0909('0x37')][_0x0909('0x39')]?_0x569ef9[_0x0909('0x37')]:_0x250fd0[_0x0909('0x33')];if(!_0x5470e4['query'][_0x0909('0x3a')]('nolimit')){_0x569ef9[_0x0909('0x1f')]=qs[_0x0909('0x1f')](_0x5470e4[_0x0909('0x34')][_0x0909('0x1f')]);_0x569ef9[_0x0909('0x1d')]=qs['offset'](_0x5470e4[_0x0909('0x34')]['offset']);}_0x569ef9[_0x0909('0x3b')]=qs[_0x0909('0x3c')](_0x5470e4[_0x0909('0x34')][_0x0909('0x3c')]);_0x569ef9[_0x0909('0x3d')]=qs[_0x0909('0x3e')](_[_0x0909('0x3f')](_0x5470e4[_0x0909('0x34')],_0x250fd0[_0x0909('0x3e')]),_0x4b6805);if(_0x5470e4[_0x0909('0x34')]['filter']){_0x569ef9[_0x0909('0x3d')]=_['merge'](_0x569ef9[_0x0909('0x3d')],{'$or':_['map'](_0x4b6805,function(_0x1b78fa){if(_0x1b78fa[_0x0909('0x31')]!==_0x0909('0x40')){var _0xeda5de={};_0xeda5de[_0x1b78fa[_0x0909('0x2b')]]={'$like':'%'+_0x5470e4[_0x0909('0x34')][_0x0909('0x41')]+'%'};return _0xeda5de;}})});}_0x569ef9=_[_0x0909('0x42')]({},_0x569ef9,_0x5470e4[_0x0909('0x43')]);var _0x57f18b={'where':_0x569ef9[_0x0909('0x3d')]};return db['VoiceChanSpy'][_0x0909('0x44')](_0x57f18b)['then'](function(_0x347bde){_0x2fd839[_0x0909('0x44')]=_0x347bde;if(_0x5470e4[_0x0909('0x34')][_0x0909('0x45')]){_0x569ef9['include']=[{'all':!![]}];}return db[_0x0909('0x2f')][_0x0909('0x46')](_0x569ef9);})[_0x0909('0x25')](function(_0x3e808e){_0x2fd839[_0x0909('0x47')]=_0x3e808e;return _0x2fd839;})['then'](respondWithFilteredResult(_0x1bd9ae,_0x569ef9))[_0x0909('0x48')](handleError(_0x1bd9ae,null));};exports[_0x0909('0x49')]=function(_0x4a55f7,_0x339857){var _0x587477={'raw':![],'where':{'id':_0x4a55f7['params']['id']}},_0x2dc419={};_0x2dc419['model']=_[_0x0909('0x35')](db[_0x0909('0x2f')]['rawAttributes']);_0x2dc419['query']=_[_0x0909('0x35')](_0x4a55f7['query']);_0x2dc419[_0x0909('0x3e')]=_[_0x0909('0x36')](_0x2dc419['model'],_0x2dc419['query']);_0x587477['attributes']=_[_0x0909('0x36')](_0x2dc419[_0x0909('0x33')],qs[_0x0909('0x38')](_0x4a55f7[_0x0909('0x34')]['fields']));_0x587477[_0x0909('0x37')]=_0x587477[_0x0909('0x37')][_0x0909('0x39')]?_0x587477[_0x0909('0x37')]:_0x2dc419['model'];if(_0x4a55f7['query'][_0x0909('0x45')]){_0x587477[_0x0909('0x4a')]=[{'all':!![]}];}_0x587477=_[_0x0909('0x42')]({},_0x587477,_0x4a55f7[_0x0909('0x43')]);return db[_0x0909('0x2f')][_0x0909('0x4b')](_0x587477)[_0x0909('0x25')](handleEntityNotFound(_0x339857,null))[_0x0909('0x25')](respondWithResult(_0x339857,null))['catch'](handleError(_0x339857,null));};exports[_0x0909('0x4c')]=function(_0x2eaf27,_0x5e8f34){return db[_0x0909('0x2f')]['create'](_0x2eaf27[_0x0909('0x4d')],{})[_0x0909('0x25')](function(_0x1de467){var _0x1b3f7c=_0x2eaf27[_0x0909('0x4e')][_0x0909('0x27')]({'plain':!![]});if(!_0x1b3f7c)throw new Error(_0x0909('0x4f'));if(_0x1b3f7c['role']===_0x0909('0x4e')){var _0x253884=_0x1de467[_0x0909('0x27')]({'plain':!![]});var _0x3ca8cf=_0x0909('0x28');return db[_0x0909('0x50')]['find']({'where':{'name':_0x3ca8cf,'userProfileId':_0x1b3f7c[_0x0909('0x51')]},'raw':!![]})['then'](function(_0x47adaf){if(_0x47adaf&&_0x47adaf['autoAssociation']===0x0){return db['UserProfileResource'][_0x0909('0x4c')]({'name':_0x253884[_0x0909('0x2b')],'resourceId':_0x253884['id'],'type':_0x47adaf['name'],'sectionId':_0x47adaf['id']},{})['then'](function(){return _0x1de467;});}else{return _0x1de467;}})[_0x0909('0x48')](function(_0x14b649){logger[_0x0909('0x2a')](_0x0909('0x52'),_0x14b649);throw _0x14b649;});}return _0x1de467;})[_0x0909('0x25')](respondWithResult(_0x5e8f34,0xc9))[_0x0909('0x48')](handleError(_0x5e8f34,null));};exports[_0x0909('0x24')]=function(_0x3502b6,_0x5c1122){if(_0x3502b6['body']['id']){delete _0x3502b6[_0x0909('0x4d')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x3502b6[_0x0909('0x53')]['id']}})[_0x0909('0x25')](handleEntityNotFound(_0x5c1122,null))[_0x0909('0x25')](saveUpdates(_0x3502b6[_0x0909('0x4d')],null))[_0x0909('0x25')](respondWithResult(_0x5c1122,null))[_0x0909('0x48')](handleError(_0x5c1122,null));};exports[_0x0909('0x26')]=function(_0xe430a2,_0x1f7c1b){return db[_0x0909('0x2f')]['find']({'where':{'id':_0xe430a2[_0x0909('0x53')]['id']}})[_0x0909('0x25')](handleEntityNotFound(_0x1f7c1b,null))[_0x0909('0x25')](removeEntity(_0x1f7c1b,null))[_0x0909('0x48')](handleError(_0x1f7c1b,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index ca074f4..a06ae37 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 _0xc728=['./voiceChanSpy.attributes','from-sip','%s%s','system','push','merge','Set','format','CDR(type)=%s','record','MixMonitor','recordingFormat','Authenticate','SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','User','findAll','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','length','bulkCreate','destroy','VoiceExtension','catch','lodash','util','bluebird'];(function(_0x33bc4f,_0x52d3c4){var _0x4bccfb=function(_0x23853c){while(--_0x23853c){_0x33bc4f['push'](_0x33bc4f['shift']());}};_0x4bccfb(++_0x52d3c4);}(_0xc728,0x6c));var _0x8c72=function(_0x2a7077,_0x102f5f){_0x2a7077=_0x2a7077-0x0;var _0x4e38e7=_0xc728[_0x2a7077];return _0x4e38e7;};'use strict';var _=require(_0x8c72('0x0'));var util=require(_0x8c72('0x1'));var BPromise=require(_0x8c72('0x2'));var attributes=require(_0x8c72('0x3'));var getUserApplications=function(_0x57484b,_0x8f3f79,_0xfb9ea1){var _0x596de9=0x1;var _0x13352f=[];var _0x3e810b={'context':_0x8f3f79['context']||_0x8c72('0x4'),'exten':util['format'](_0x8c72('0x5'),_0x57484b['prefix'],_0xfb9ea1),'type':_0x8c72('0x6'),'isApp':![],'ChanSpyId':_0x57484b['id'],'UserId':_0x8f3f79['id']};_0x13352f[_0x8c72('0x7')](_[_0x8c72('0x8')]({'app':_0x8c72('0x9'),'appdata':util[_0x8c72('0xa')](_0x8c72('0xb'),'chanspy'),'priority':_0x596de9++},_0x3e810b));if(_0x57484b[_0x8c72('0xc')]){_0x13352f[_0x8c72('0x7')](_[_0x8c72('0x8')]({'app':_0x8c72('0xd'),'appdata':util[_0x8c72('0xa')]('${UNIQUEID}.%s,a',_0x57484b[_0x8c72('0xe')]),'priority':_0x596de9++},_0x3e810b));}if(_0x57484b['auth']){_0x13352f['push'](_['merge']({'app':_0x8c72('0xf'),'appdata':_0x57484b['password'],'priority':_0x596de9++},_0x3e810b));}_0x13352f[_0x8c72('0x7')](_['merge']({'app':'ChanSpy','appdata':util[_0x8c72('0xa')](_0x8c72('0x10'),_0x8f3f79[_0x8c72('0x11')],_0x57484b[_0x8c72('0x12')]?_0x57484b[_0x8c72('0x12')][_0x8c72('0x13')](''):''),'priority':_0x596de9++},_0x3e810b));if(_0x57484b[_0x8c72('0xc')]){_0x13352f['push'](_['merge']({'app':_0x8c72('0x14'),'priority':_0x596de9++},_0x3e810b));}return _0x13352f;};var getChanSpyApplications=function(_0x50ef00,_0x1c0df2){var _0x2c45bf=[];for(var _0x1ccfb6=0x0,_0x512904=0x1;_0x1ccfb6<_0x1c0df2['length'];_0x1ccfb6++,_0x512904=0x1){_0x2c45bf=_0x2c45bf[_0x8c72('0x15')](getUserApplications(_0x50ef00,_0x1c0df2[_0x1ccfb6],_0x1c0df2[_0x1ccfb6][_0x8c72('0x16')]));if(_0x1c0df2[_0x1ccfb6][_0x8c72('0x16')]!=_0x1c0df2[_0x1ccfb6][_0x8c72('0x11')]){_0x2c45bf=_0x2c45bf[_0x8c72('0x15')](getUserApplications(_0x50ef00,_0x1c0df2[_0x1ccfb6],_0x1c0df2[_0x1ccfb6][_0x8c72('0x11')]));}}return _0x2c45bf;};var getChanSpyPromise=function(_0x3891b0,_0xd3dc81){return new BPromise(function(_0x3c9d1b,_0x34e700){return _0x3891b0[_0x8c72('0x17')][_0x8c72('0x18')]({'attributes':['id','name','internal'],'where':{'role':_0x8c72('0x19'),'chanspy':!![]},'raw':!![]})[_0x8c72('0x1a')](function(_0x2b632d){if(_0x2b632d){return _0x3c9d1b(getChanSpyApplications(_0xd3dc81,_0x2b632d));}return _0x3c9d1b([]);})['catch'](function(_0x1bfa89){_0x34e700(_0x1bfa89);});});};module[_0x8c72('0x1b')]=function(_0x114fcf,_0x151975){var _0x4f85a6=_0x114fcf[_0x8c72('0x1c')];return _0x114fcf[_0x8c72('0x1d')](_0x8c72('0x1e'),attributes,{'tableName':_0x8c72('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x32b8b0,_0x1f93d6,_0x439dd7){return getChanSpyPromise(_0x4f85a6,_0x32b8b0)[_0x8c72('0x1a')](function(_0x2d5c1d){if(_0x2d5c1d&&_0x2d5c1d[_0x8c72('0x20')]){return _0x4f85a6['VoiceExtension'][_0x8c72('0x21')](_0x2d5c1d);}})[_0x8c72('0x1a')](function(){_0x439dd7();})['catch'](function(_0xa26488){_0x439dd7(_0xa26488);});},'afterUpdate':function(_0x5465a8,_0x732c78,_0x1ef08e){return _0x4f85a6['VoiceExtension'][_0x8c72('0x22')]({'where':{'ChanSpyId':_0x5465a8['id']}})[_0x8c72('0x1a')](function(){return getChanSpyPromise(_0x4f85a6,_0x5465a8);})[_0x8c72('0x1a')](function(_0x4f109f){if(_0x4f109f&&_0x4f109f[_0x8c72('0x20')]){return _0x4f85a6['VoiceExtension'][_0x8c72('0x21')](_0x4f109f);}})[_0x8c72('0x1a')](function(){_0x1ef08e();})['catch'](function(_0x3f918b){_0x1ef08e(_0x3f918b);});},'afterDestroy':function(_0x3427e3,_0x14b8b1,_0x43f25f){return _0x4f85a6[_0x8c72('0x23')][_0x8c72('0x22')]({'where':{'ChanSpyId':_0x3427e3['id']}})[_0x8c72('0x1a')](function(){_0x43f25f();})[_0x8c72('0x24')](function(_0x25de08){_0x43f25f(_0x25de08);});}}});}; \ No newline at end of file +var _0x087f=['context','%s%s','prefix','system','push','merge','Set','format','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','password','ChanSpy','name','options','StopMixMonitor','length','concat','internal','User','findAll','agent','then','exports','models','voice_chanspy','VoiceExtension','bulkCreate','destroy','catch','lodash','util'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x087f,0x130));var _0xf087=function(_0x1374e9,_0x26ed43){_0x1374e9=_0x1374e9-0x0;var _0x53e230=_0x087f[_0x1374e9];return _0x53e230;};'use strict';var _=require(_0xf087('0x0'));var util=require(_0xf087('0x1'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x521d3a,_0x5cb81c,_0x2c3492){var _0x3d1885=0x1;var _0x4b232d=[];var _0x12ce01={'context':_0x5cb81c[_0xf087('0x2')]||'from-sip','exten':util['format'](_0xf087('0x3'),_0x521d3a[_0xf087('0x4')],_0x2c3492),'type':_0xf087('0x5'),'isApp':![],'ChanSpyId':_0x521d3a['id'],'UserId':_0x5cb81c['id']};_0x4b232d[_0xf087('0x6')](_[_0xf087('0x7')]({'app':_0xf087('0x8'),'appdata':util[_0xf087('0x9')](_0xf087('0xa'),_0xf087('0xb')),'priority':_0x3d1885++},_0x12ce01));if(_0x521d3a[_0xf087('0xc')]){_0x4b232d[_0xf087('0x6')](_[_0xf087('0x7')]({'app':_0xf087('0xd'),'appdata':util[_0xf087('0x9')]('${UNIQUEID}.%s,a',_0x521d3a[_0xf087('0xe')]),'priority':_0x3d1885++},_0x12ce01));}if(_0x521d3a['auth']){_0x4b232d[_0xf087('0x6')](_[_0xf087('0x7')]({'app':'Authenticate','appdata':_0x521d3a[_0xf087('0xf')],'priority':_0x3d1885++},_0x12ce01));}_0x4b232d['push'](_['merge']({'app':_0xf087('0x10'),'appdata':util[_0xf087('0x9')]('SIP/%s,%s',_0x5cb81c[_0xf087('0x11')],_0x521d3a[_0xf087('0x12')]?_0x521d3a[_0xf087('0x12')]['join'](''):''),'priority':_0x3d1885++},_0x12ce01));if(_0x521d3a[_0xf087('0xc')]){_0x4b232d[_0xf087('0x6')](_['merge']({'app':_0xf087('0x13'),'priority':_0x3d1885++},_0x12ce01));}return _0x4b232d;};var getChanSpyApplications=function(_0x49fd24,_0x3214b7){var _0x1f6fc7=[];for(var _0x39c287=0x0,_0x5b6b4e=0x1;_0x39c287<_0x3214b7[_0xf087('0x14')];_0x39c287++,_0x5b6b4e=0x1){_0x1f6fc7=_0x1f6fc7[_0xf087('0x15')](getUserApplications(_0x49fd24,_0x3214b7[_0x39c287],_0x3214b7[_0x39c287][_0xf087('0x16')]));if(_0x3214b7[_0x39c287][_0xf087('0x16')]!=_0x3214b7[_0x39c287]['name']){_0x1f6fc7=_0x1f6fc7[_0xf087('0x15')](getUserApplications(_0x49fd24,_0x3214b7[_0x39c287],_0x3214b7[_0x39c287][_0xf087('0x11')]));}}return _0x1f6fc7;};var getChanSpyPromise=function(_0x528c38,_0x23bb29){return new BPromise(function(_0x593c3c,_0x1da52b){return _0x528c38[_0xf087('0x17')][_0xf087('0x18')]({'attributes':['id',_0xf087('0x11'),_0xf087('0x16')],'where':{'role':_0xf087('0x19'),'chanspy':!![]},'raw':!![]})[_0xf087('0x1a')](function(_0x426402){if(_0x426402){return _0x593c3c(getChanSpyApplications(_0x23bb29,_0x426402));}return _0x593c3c([]);})['catch'](function(_0x4b1a57){_0x1da52b(_0x4b1a57);});});};module[_0xf087('0x1b')]=function(_0x2b019d,_0x512693){var _0x24ed91=_0x2b019d[_0xf087('0x1c')];return _0x2b019d['define']('VoiceChanSpy',attributes,{'tableName':_0xf087('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x514995,_0x356ef5,_0x152c25){return getChanSpyPromise(_0x24ed91,_0x514995)[_0xf087('0x1a')](function(_0x32a1d9){if(_0x32a1d9&&_0x32a1d9['length']){return _0x24ed91[_0xf087('0x1e')][_0xf087('0x1f')](_0x32a1d9);}})[_0xf087('0x1a')](function(){_0x152c25();})['catch'](function(_0x453a7d){_0x152c25(_0x453a7d);});},'afterUpdate':function(_0x35bb79,_0x2b6b6e,_0x1c1714){return _0x24ed91['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x35bb79['id']}})[_0xf087('0x1a')](function(){return getChanSpyPromise(_0x24ed91,_0x35bb79);})[_0xf087('0x1a')](function(_0x38f17b){if(_0x38f17b&&_0x38f17b[_0xf087('0x14')]){return _0x24ed91[_0xf087('0x1e')]['bulkCreate'](_0x38f17b);}})[_0xf087('0x1a')](function(){_0x1c1714();})['catch'](function(_0x5247e8){_0x1c1714(_0x5247e8);});},'afterDestroy':function(_0x22a745,_0x35a110,_0x4fe170){return _0x24ed91['VoiceExtension'][_0xf087('0x20')]({'where':{'ChanSpyId':_0x22a745['id']}})[_0xf087('0x1a')](function(){_0x4fe170();})[_0xf087('0x21')](function(_0x4a409f){_0x4fe170(_0x4a409f);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 038e666..8a936b1 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 _0xeb74=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x1098a9,_0x2748f9){var _0x166c83=function(_0x55a645){while(--_0x55a645){_0x1098a9['push'](_0x1098a9['shift']());}};_0x166c83(++_0x2748f9);}(_0xeb74,0xe3));var _0x4eb7=function(_0xed99d9,_0x2d8122){_0xed99d9=_0xed99d9-0x0;var _0x46ec6b=_0xeb74[_0xed99d9];return _0x46ec6b;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rs=require(_0x4eb7('0x4'));var fs=require('fs');var Redis=require(_0x4eb7('0x5'));var db=require(_0x4eb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eb7('0x7'))(_0x4eb7('0x8'));var config=require(_0x4eb7('0x9'));var jayson=require(_0x4eb7('0xa'));var client=jayson[_0x4eb7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3986cd,_0x54859c,_0xcac7c5){return new BPromise(function(_0x2cffe7,_0x588a1c){return client['request'](_0x3986cd,_0xcac7c5)[_0x4eb7('0xc')](function(_0x2f8296){logger['info'](_0x4eb7('0xd'),_0x54859c,'request\x20sent');logger[_0x4eb7('0xe')](_0x4eb7('0xf'),_0x54859c,_0x4eb7('0x10'),JSON['stringify'](_0x2f8296));if(_0x2f8296[_0x4eb7('0x11')]){if(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x12')]===0x1f4){logger[_0x4eb7('0x11')](_0x4eb7('0xd'),_0x54859c,_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);return _0x588a1c(_0x2f8296['error']['message']);}logger['error'](_0x4eb7('0xd'),_0x54859c,_0x2f8296['error'][_0x4eb7('0x13')]);return _0x2cffe7(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);}else{logger[_0x4eb7('0x14')](_0x4eb7('0xd'),_0x54859c,_0x4eb7('0x10'));_0x2cffe7(_0x2f8296[_0x4eb7('0x15')][_0x4eb7('0x13')]);}})[_0x4eb7('0x16')](function(_0x17377f){logger['error'](_0x4eb7('0xd'),_0x54859c,_0x17377f);_0x588a1c(_0x17377f);});});} \ No newline at end of file +var _0x9bde=['code','message','VoiceChanSpy,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x45a549,_0x587a7b){var _0x45a893=function(_0x54afbf){while(--_0x54afbf){_0x45a549['push'](_0x45a549['shift']());}};_0x45a893(++_0x587a7b);}(_0x9bde,0xe1));var _0xe9bd=function(_0x11179b,_0x135dbf){_0x11179b=_0x11179b-0x0;var _0x3d67b5=_0x9bde[_0x11179b];return _0x3d67b5;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 2bc9110..5fd8c73 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 _0xf27c=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xf27c,0xb5));var _0xcf27=function(_0x30553a,_0x1284d6){_0x30553a=_0x30553a-0x0;var _0x2b2dd6=_0xf27c[_0x30553a];return _0x2b2dd6;};'use strict';var multer=require('multer');var util=require(_0xcf27('0x0'));var path=require(_0xcf27('0x1'));var timeout=require(_0xcf27('0x2'));var express=require(_0xcf27('0x3'));var router=express[_0xcf27('0x4')]();var fs_extra=require(_0xcf27('0x5'));var auth=require(_0xcf27('0x6'));var interaction=require(_0xcf27('0x7'));var config=require(_0xcf27('0x8'));var controller=require(_0xcf27('0x9'));router[_0xcf27('0xa')]('/',auth[_0xcf27('0xb')](),controller['index']);router[_0xcf27('0xa')](_0xcf27('0xc'),auth['isAuthenticated'](),controller[_0xcf27('0xd')]);router[_0xcf27('0xe')]('/',auth[_0xcf27('0xb')](),controller[_0xcf27('0xf')]);router[_0xcf27('0x10')]('/:id',auth[_0xcf27('0xb')](),controller['update']);router[_0xcf27('0x11')](_0xcf27('0xc'),auth[_0xcf27('0xb')](),controller[_0xcf27('0x12')]);module[_0xcf27('0x13')]=router; \ No newline at end of file +var _0x185b=['put','update','delete','destroy','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x185b,0x84));var _0xb185=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x185b[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require('multer');var util=require(_0xb185('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb185('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xb185('0x2'));var interaction=require(_0xb185('0x3'));var config=require(_0xb185('0x4'));var controller=require(_0xb185('0x5'));router[_0xb185('0x6')]('/',auth[_0xb185('0x7')](),controller['index']);router[_0xb185('0x6')](_0xb185('0x8'),auth[_0xb185('0x7')](),controller[_0xb185('0x9')]);router[_0xb185('0xa')]('/',auth['isAuthenticated'](),controller[_0xb185('0xb')]);router[_0xb185('0xc')](_0xb185('0x8'),auth['isAuthenticated'](),controller[_0xb185('0xd')]);router[_0xb185('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xb185('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 e18149a..c5fc713 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 _0x1888=['exports','STRING','name','BOOLEAN'];(function(_0x356cb9,_0x3a34c6){var _0x301c66=function(_0x984d4b){while(--_0x984d4b){_0x356cb9['push'](_0x356cb9['shift']());}};_0x301c66(++_0x3a34c6);}(_0x1888,0x1f0));var _0x8188=function(_0x2f5fcb,_0x4df21e){_0x2f5fcb=_0x2f5fcb-0x0;var _0x2fc15e=_0x1888[_0x2f5fcb];return _0x2fc15e;};'use strict';var Sequelize=require('sequelize');module[_0x8188('0x0')]={'name':{'type':Sequelize[_0x8188('0x1')],'unique':_0x8188('0x2')},'description':{'type':Sequelize[_0x8188('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8188('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdad7=['STRING','name','BOOLEAN','sequelize','exports'];(function(_0x226724,_0x5862c9){var _0x57f330=function(_0x14e354){while(--_0x14e354){_0x226724['push'](_0x226724['shift']());}};_0x57f330(++_0x5862c9);}(_0xdad7,0x1b6));var _0x7dad=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xdad7[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x7dad('0x0'));module[_0x7dad('0x1')]={'name':{'type':Sequelize[_0x7dad('0x2')],'unique':_0x7dad('0x3')},'description':{'type':Sequelize[_0x7dad('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7dad('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 22cc657..9f6873d 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 _0x09a0=['include','findAll','catch','params','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','render','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','Contexts','UserProfileResource','sendStatus','name','send','VoiceContext','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x3ff59d,_0x209599){var _0x221f59=function(_0x121af2){while(--_0x121af2){_0x3ff59d['push'](_0x3ff59d['shift']());}};_0x221f59(++_0x209599);}(_0x09a0,0x7a));var _0x009a=function(_0x260764,_0x2f3fc8){_0x260764=_0x260764-0x0;var _0x383e35=_0x09a0[_0x260764];return _0x383e35;};'use strict';var emlformat=require(_0x009a('0x0'));var rimraf=require(_0x009a('0x1'));var zipdir=require(_0x009a('0x2'));var jsonpatch=require(_0x009a('0x3'));var rp=require(_0x009a('0x4'));var moment=require(_0x009a('0x5'));var BPromise=require(_0x009a('0x6'));var Mustache=require(_0x009a('0x7'));var util=require(_0x009a('0x8'));var path=require(_0x009a('0x9'));var sox=require(_0x009a('0xa'));var csv=require('to-csv');var ejs=require(_0x009a('0xb'));var fs=require('fs');var fs_extra=require(_0x009a('0xc'));var _=require(_0x009a('0xd'));var squel=require(_0x009a('0xe'));var crypto=require(_0x009a('0xf'));var jsforce=require(_0x009a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x009a('0x11'));var querystring=require(_0x009a('0x12'));var Papa=require(_0x009a('0x13'));var Redis=require(_0x009a('0x14'));var authService=require(_0x009a('0x15'));var qs=require(_0x009a('0x16'));var as=require(_0x009a('0x17'));var hardwareService=require(_0x009a('0x18'));var logger=require(_0x009a('0x19'))(_0x009a('0x1a'));var utils=require(_0x009a('0x1b'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x009a('0x1c'))['db'];var jayson=require(_0x009a('0x1d'));var client=jayson[_0x009a('0x1e')][_0x009a('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x44fd20,_0x474061,_0x3bbe01,_0x36bddc){return new BPromise(function(_0x30980a,_0x5e5c35){var _0x275586=_0x36bddc||client;return _0x275586['request'](_0x44fd20,_0x3bbe01)['then'](function(_0x5c6900){logger[_0x009a('0x20')](_0x009a('0x21'),_0x474061,_0x009a('0x22'));logger[_0x009a('0x23')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x474061,'request\x20sent',JSON[_0x009a('0x24')](_0x5c6900));if(_0x5c6900[_0x009a('0x25')]){if(_0x5c6900[_0x009a('0x25')][_0x009a('0x26')]===0x1f4){logger['error'](_0x009a('0x21'),_0x474061,_0x5c6900['error'][_0x009a('0x27')]);return _0x5e5c35(_0x5c6900['error']['message']);}logger[_0x009a('0x25')](_0x009a('0x21'),_0x474061,_0x5c6900[_0x009a('0x25')][_0x009a('0x27')]);return _0x30980a(_0x5c6900[_0x009a('0x25')][_0x009a('0x27')]);}else{logger[_0x009a('0x20')](_0x009a('0x21'),_0x474061,_0x009a('0x22'));_0x30980a(_0x5c6900[_0x009a('0x28')]['message']);}})['catch'](function(_0x2ec76e){logger[_0x009a('0x25')](_0x009a('0x21'),_0x474061,_0x2ec76e);_0x5e5c35(_0x2ec76e);});});}function respondWithStatusCode(_0x4a569e,_0x494d7e){_0x494d7e=_0x494d7e||0xcc;return function(_0x4c14c6){if(_0x4c14c6){return _0x4a569e['sendStatus'](_0x494d7e);}return _0x4a569e[_0x009a('0x29')](_0x494d7e)[_0x009a('0x2a')]();};}function respondWithResult(_0x360dd6,_0x560cc5){_0x560cc5=_0x560cc5||0xc8;return function(_0x4446fe){if(_0x4446fe){return _0x360dd6['status'](_0x560cc5)[_0x009a('0x2b')](_0x4446fe);}};}function respondWithFilteredResult(_0x45ad4d,_0x5d58eb){return function(_0x395e14){if(_0x395e14){var _0x1b6750=typeof _0x5d58eb[_0x009a('0x2c')]===_0x009a('0x2d')&&typeof _0x5d58eb['limit']==='undefined';var _0x5b67aa=_0x395e14[_0x009a('0x2e')];var _0x320f8e=_0x1b6750?0x0:_0x5d58eb[_0x009a('0x2c')];var _0x463323=_0x1b6750?_0x395e14[_0x009a('0x2e')]:_0x5d58eb[_0x009a('0x2c')]+_0x5d58eb[_0x009a('0x2f')];var _0x3e3c34;if(_0x463323>=_0x5b67aa){_0x463323=_0x5b67aa;_0x3e3c34=0xc8;}else{_0x3e3c34=0xce;}_0x45ad4d['status'](_0x3e3c34);return _0x45ad4d['set'](_0x009a('0x30'),_0x320f8e+'-'+_0x463323+'/'+_0x5b67aa)[_0x009a('0x2b')](_0x395e14);}return null;};}function patchUpdates(_0x1fb938){return function(_0x3ab5bf){try{jsonpatch[_0x009a('0x31')](_0x3ab5bf,_0x1fb938,!![]);}catch(_0x1a697d){return BPromise['reject'](_0x1a697d);}return _0x3ab5bf[_0x009a('0x32')]();};}function saveUpdates(_0xe79c32,_0x307e88){return function(_0x5185cf){if(_0x5185cf){return _0x5185cf[_0x009a('0x33')](_0xe79c32)[_0x009a('0x34')](function(_0x54dc0b){return _0x54dc0b;});}return null;};}function removeEntity(_0x3cc551,_0x23d385){return function(_0x4710c5){if(_0x4710c5){return _0x4710c5[_0x009a('0x35')]()[_0x009a('0x34')](function(){var _0x1037ef=_0x4710c5['get']({'plain':!![]});var _0x51163b=_0x009a('0x36');return db[_0x009a('0x37')]['destroy']({'where':{'type':_0x51163b,'resourceId':_0x1037ef['id']}})[_0x009a('0x34')](function(){return _0x4710c5;});})[_0x009a('0x34')](function(){_0x3cc551[_0x009a('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x422b1a,_0x2a0185){return function(_0x33d7b0){if(!_0x33d7b0){_0x422b1a[_0x009a('0x38')](0x194);}return _0x33d7b0;};}function handleError(_0x34e030,_0x134e74){_0x134e74=_0x134e74||0x1f4;return function(_0x20f860){logger['error'](_0x20f860['stack']);if(_0x20f860[_0x009a('0x39')]){delete _0x20f860[_0x009a('0x39')];}_0x34e030[_0x009a('0x29')](_0x134e74)[_0x009a('0x3a')](_0x20f860);};}exports['index']=function(_0x165e68,_0x4baa01){var _0x34bea6={},_0x51aae6={},_0x18bd67={'count':0x0,'rows':[]};var _0x573a4d=_['map'](db[_0x009a('0x3b')][_0x009a('0x3c')],function(_0x5d05a1){return{'name':_0x5d05a1[_0x009a('0x3d')],'type':_0x5d05a1[_0x009a('0x3e')]['key']};});_0x51aae6[_0x009a('0x3f')]=_[_0x009a('0x40')](_0x573a4d,_0x009a('0x39'));_0x51aae6['query']=_[_0x009a('0x41')](_0x165e68[_0x009a('0x42')]);_0x51aae6[_0x009a('0x43')]=_['intersection'](_0x51aae6[_0x009a('0x3f')],_0x51aae6[_0x009a('0x42')]);_0x34bea6[_0x009a('0x44')]=_[_0x009a('0x45')](_0x51aae6['model'],qs['fields'](_0x165e68[_0x009a('0x42')][_0x009a('0x46')]));_0x34bea6[_0x009a('0x44')]=_0x34bea6[_0x009a('0x44')][_0x009a('0x47')]?_0x34bea6[_0x009a('0x44')]:_0x51aae6[_0x009a('0x3f')];if(!_0x165e68[_0x009a('0x42')]['hasOwnProperty']('nolimit')){_0x34bea6['limit']=qs[_0x009a('0x2f')](_0x165e68[_0x009a('0x42')]['limit']);_0x34bea6[_0x009a('0x2c')]=qs[_0x009a('0x2c')](_0x165e68[_0x009a('0x42')][_0x009a('0x2c')]);}_0x34bea6['order']=qs[_0x009a('0x48')](_0x165e68[_0x009a('0x42')][_0x009a('0x48')]);_0x34bea6[_0x009a('0x49')]=qs[_0x009a('0x43')](_[_0x009a('0x4a')](_0x165e68[_0x009a('0x42')],_0x51aae6[_0x009a('0x43')]),_0x573a4d);if(_0x165e68[_0x009a('0x42')][_0x009a('0x4b')]){_0x34bea6[_0x009a('0x49')]=_[_0x009a('0x4c')](_0x34bea6[_0x009a('0x49')],{'$or':_[_0x009a('0x40')](_0x573a4d,function(_0x1d6386){if(_0x1d6386[_0x009a('0x3e')]!==_0x009a('0x4d')){var _0x223bbc={};_0x223bbc[_0x1d6386[_0x009a('0x39')]]={'$like':'%'+_0x165e68[_0x009a('0x42')][_0x009a('0x4b')]+'%'};return _0x223bbc;}})});}_0x34bea6=_[_0x009a('0x4c')]({},_0x34bea6,_0x165e68[_0x009a('0x4e')]);var _0x260b7d={'where':_0x34bea6[_0x009a('0x49')]};return db['VoiceContext'][_0x009a('0x2e')](_0x260b7d)[_0x009a('0x34')](function(_0x1c9044){_0x18bd67['count']=_0x1c9044;if(_0x165e68[_0x009a('0x42')][_0x009a('0x4f')]){_0x34bea6[_0x009a('0x50')]=[{'all':!![]}];}return db['VoiceContext'][_0x009a('0x51')](_0x34bea6);})[_0x009a('0x34')](function(_0x44a953){_0x18bd67['rows']=_0x44a953;return _0x18bd67;})[_0x009a('0x34')](respondWithFilteredResult(_0x4baa01,_0x34bea6))[_0x009a('0x52')](handleError(_0x4baa01,null));};exports['show']=function(_0x544496,_0x18acc4){var _0x5189b2={'raw':![],'where':{'id':_0x544496[_0x009a('0x53')]['id']}},_0x43bfec={};_0x43bfec[_0x009a('0x3f')]=_[_0x009a('0x41')](db[_0x009a('0x3b')][_0x009a('0x3c')]);_0x43bfec[_0x009a('0x42')]=_[_0x009a('0x41')](_0x544496[_0x009a('0x42')]);_0x43bfec[_0x009a('0x43')]=_[_0x009a('0x45')](_0x43bfec[_0x009a('0x3f')],_0x43bfec[_0x009a('0x42')]);_0x5189b2[_0x009a('0x44')]=_[_0x009a('0x45')](_0x43bfec['model'],qs[_0x009a('0x46')](_0x544496[_0x009a('0x42')]['fields']));_0x5189b2['attributes']=_0x5189b2[_0x009a('0x44')][_0x009a('0x47')]?_0x5189b2['attributes']:_0x43bfec[_0x009a('0x3f')];if(_0x544496[_0x009a('0x42')]['includeAll']){_0x5189b2['include']=[{'all':!![]}];}_0x5189b2=_[_0x009a('0x4c')]({},_0x5189b2,_0x544496[_0x009a('0x4e')]);return db[_0x009a('0x3b')][_0x009a('0x54')](_0x5189b2)['then'](handleEntityNotFound(_0x18acc4,null))[_0x009a('0x34')](respondWithResult(_0x18acc4,null))[_0x009a('0x52')](handleError(_0x18acc4,null));};exports[_0x009a('0x55')]=function(_0x5caabf,_0x1c9b8f,_0x4f2766){var _0x7e5a66;return db[_0x009a('0x3b')][_0x009a('0x55')](_0x5caabf[_0x009a('0x56')],{'raw':!![]})['then'](function(_0x342643){_0x7e5a66=_0x342643;return db[_0x009a('0x3b')][_0x009a('0x51')]({'raw':!![]});})[_0x009a('0x34')](function(_0x374dcd){var _0x4fbe18=fs[_0x009a('0x57')](path[_0x009a('0x58')](config[_0x009a('0x59')],_0x009a('0x5a')),_0x009a('0x5b'));var _0x5c08cf=ejs['render'](_0x4fbe18,{'contexts':_0x374dcd||[]});fs[_0x009a('0x5c')](_0x009a('0x5d'),_0x5c08cf);})[_0x009a('0x34')](function(){return respondWithRpcPromise('Reload',_0x009a('0x55'),{'module':_0x009a('0x5e')});})['then'](function(){var _0x2409aa=_0x5caabf['user'][_0x009a('0x5f')]({'plain':!![]});if(!_0x2409aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2409aa['role']==='user'){var _0x56fbdb=_0x7e5a66[_0x009a('0x5f')]({'plain':!![]});return db[_0x009a('0x60')][_0x009a('0x54')]({'where':{'name':_0x009a('0x36'),'userProfileId':_0x2409aa[_0x009a('0x61')]},'raw':!![]})[_0x009a('0x34')](function(_0x329ba8){if(_0x329ba8&&_0x329ba8[_0x009a('0x62')]===0x0){return db['UserProfileResource'][_0x009a('0x55')]({'name':_0x56fbdb['name'],'resourceId':_0x56fbdb['id'],'type':_0x329ba8[_0x009a('0x39')],'sectionId':_0x329ba8['id']},{})[_0x009a('0x34')](function(){return _0x7e5a66;});}else{return _0x7e5a66;}})[_0x009a('0x52')](function(_0x36bf83){logger[_0x009a('0x25')](_0x009a('0x63'),_0x36bf83);throw _0x36bf83;});}return _0x7e5a66;})[_0x009a('0x34')](respondWithResult(_0x1c9b8f,0xc9))[_0x009a('0x52')](handleError(_0x1c9b8f,null));};exports[_0x009a('0x33')]=function(_0x18f49f,_0x1867c3,_0x4dbdd2){var _0x3634ce;return db[_0x009a('0x3b')][_0x009a('0x54')]({'where':{'id':_0x18f49f[_0x009a('0x53')]['id']}})[_0x009a('0x34')](handleEntityNotFound(_0x1867c3,null))['then'](saveUpdates(_0x18f49f['body'],null))[_0x009a('0x34')](function(_0x301ae5){if(_0x301ae5){_0x3634ce=_0x301ae5;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x009a('0x34')](function(_0x1b910d){var _0xefc5d1=fs[_0x009a('0x57')](path['join'](config['root'],_0x009a('0x5a')),_0x009a('0x5b'));var _0x18ee38=ejs[_0x009a('0x64')](_0xefc5d1,{'contexts':_0x1b910d||[]});fs[_0x009a('0x5c')](_0x009a('0x5d'),_0x18ee38);})[_0x009a('0x34')](function(){return respondWithRpcPromise('Reload',_0x009a('0x33'),{'module':_0x009a('0x5e')});})[_0x009a('0x34')](function(){return _0x3634ce;})[_0x009a('0x34')](respondWithResult(_0x1867c3,null))[_0x009a('0x52')](handleError(_0x1867c3,null));};exports[_0x009a('0x35')]=function(_0x511d61,_0x35470e,_0x142dcf){var _0x26d7c0;return db[_0x009a('0x3b')]['find']({'where':{'id':_0x511d61[_0x009a('0x53')]['id']}})[_0x009a('0x34')](handleEntityNotFound(_0x35470e,null))[_0x009a('0x34')](removeEntity(_0x35470e,null))[_0x009a('0x34')](function(){return db[_0x009a('0x3b')][_0x009a('0x51')]({'raw':!![]});})[_0x009a('0x34')](function(_0x1b68b5){var _0x2fd4af=fs[_0x009a('0x57')](path[_0x009a('0x58')](config[_0x009a('0x59')],_0x009a('0x5a')),_0x009a('0x5b'));var _0x5f27cd=ejs['render'](_0x2fd4af,{'contexts':_0x1b68b5});fs[_0x009a('0x5c')](_0x009a('0x5d'),_0x5f27cd);return respondWithRpcPromise('Reload',_0x009a('0x35'),{'module':_0x009a('0x5e')});})[_0x009a('0x52')](handleError(_0x35470e,null));}; \ No newline at end of file +var _0x9b09=['eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','get','Contexts','UserProfileResource','stack','send','index','map','rawAttributes','type','key','name','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','VoiceContext','includeAll','catch','show','fields','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','writeFileSync','params'];(function(_0x2550b1,_0x2fd659){var _0x44f63f=function(_0x11252c){while(--_0x11252c){_0x2550b1['push'](_0x2550b1['shift']());}};_0x44f63f(++_0x2fd659);}(_0x9b09,0x12f));var _0x99b0=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0x9b09[_0x4aa4e6];return _0x322588;};'use strict';var emlformat=require(_0x99b0('0x0'));var rimraf=require(_0x99b0('0x1'));var zipdir=require(_0x99b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x99b0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x99b0('0x4'));var util=require(_0x99b0('0x5'));var path=require(_0x99b0('0x6'));var sox=require(_0x99b0('0x7'));var csv=require(_0x99b0('0x8'));var ejs=require(_0x99b0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x99b0('0xa'));var squel=require(_0x99b0('0xb'));var crypto=require(_0x99b0('0xc'));var jsforce=require(_0x99b0('0xd'));var deskjs=require(_0x99b0('0xe'));var toCsv=require(_0x99b0('0x8'));var querystring=require('querystring');var Papa=require(_0x99b0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x99b0('0x10'));var as=require(_0x99b0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99b0('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x99b0('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x99b0('0x14'))['db'];var jayson=require(_0x99b0('0x15'));var client=jayson['client'][_0x99b0('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x243147,_0x1c66cf,_0x59e6b2,_0x5105f6){return new BPromise(function(_0x4fef1c,_0x423553){var _0x35c90f=_0x5105f6||client;return _0x35c90f['request'](_0x243147,_0x59e6b2)[_0x99b0('0x17')](function(_0x427dc0){logger[_0x99b0('0x18')](_0x99b0('0x19'),_0x1c66cf,_0x99b0('0x1a'));logger[_0x99b0('0x1b')](_0x99b0('0x1c'),_0x1c66cf,_0x99b0('0x1a'),JSON[_0x99b0('0x1d')](_0x427dc0));if(_0x427dc0[_0x99b0('0x1e')]){if(_0x427dc0[_0x99b0('0x1e')][_0x99b0('0x1f')]===0x1f4){logger[_0x99b0('0x1e')](_0x99b0('0x19'),_0x1c66cf,_0x427dc0[_0x99b0('0x1e')][_0x99b0('0x20')]);return _0x423553(_0x427dc0[_0x99b0('0x1e')][_0x99b0('0x20')]);}logger[_0x99b0('0x1e')](_0x99b0('0x19'),_0x1c66cf,_0x427dc0[_0x99b0('0x1e')][_0x99b0('0x20')]);return _0x4fef1c(_0x427dc0['error'][_0x99b0('0x20')]);}else{logger[_0x99b0('0x18')](_0x99b0('0x19'),_0x1c66cf,_0x99b0('0x1a'));_0x4fef1c(_0x427dc0[_0x99b0('0x21')][_0x99b0('0x20')]);}})['catch'](function(_0x18df8a){logger['error'](_0x99b0('0x19'),_0x1c66cf,_0x18df8a);_0x423553(_0x18df8a);});});}function respondWithStatusCode(_0x162e80,_0x3e098c){_0x3e098c=_0x3e098c||0xcc;return function(_0x27a148){if(_0x27a148){return _0x162e80[_0x99b0('0x22')](_0x3e098c);}return _0x162e80[_0x99b0('0x23')](_0x3e098c)[_0x99b0('0x24')]();};}function respondWithResult(_0x38a382,_0x4ca9bd){_0x4ca9bd=_0x4ca9bd||0xc8;return function(_0x1539a5){if(_0x1539a5){return _0x38a382[_0x99b0('0x23')](_0x4ca9bd)[_0x99b0('0x25')](_0x1539a5);}};}function respondWithFilteredResult(_0x17d19b,_0x4577fd){return function(_0x33d11d){if(_0x33d11d){var _0x149680=typeof _0x4577fd[_0x99b0('0x26')]===_0x99b0('0x27')&&typeof _0x4577fd['limit']==='undefined';var _0x158c12=_0x33d11d['count'];var _0x40dead=_0x149680?0x0:_0x4577fd[_0x99b0('0x26')];var _0x1e2732=_0x149680?_0x33d11d[_0x99b0('0x28')]:_0x4577fd[_0x99b0('0x26')]+_0x4577fd['limit'];var _0x28b707;if(_0x1e2732>=_0x158c12){_0x1e2732=_0x158c12;_0x28b707=0xc8;}else{_0x28b707=0xce;}_0x17d19b[_0x99b0('0x23')](_0x28b707);return _0x17d19b[_0x99b0('0x29')](_0x99b0('0x2a'),_0x40dead+'-'+_0x1e2732+'/'+_0x158c12)[_0x99b0('0x25')](_0x33d11d);}return null;};}function patchUpdates(_0x5ceb8e){return function(_0xdc5fb7){try{jsonpatch[_0x99b0('0x2b')](_0xdc5fb7,_0x5ceb8e,!![]);}catch(_0x37aedf){return BPromise['reject'](_0x37aedf);}return _0xdc5fb7[_0x99b0('0x2c')]();};}function saveUpdates(_0x107ecd,_0x595c8c){return function(_0x5927cc){if(_0x5927cc){return _0x5927cc[_0x99b0('0x2d')](_0x107ecd)['then'](function(_0x4d8f5f){return _0x4d8f5f;});}return null;};}function removeEntity(_0x35b62e,_0x2508da){return function(_0x6e89de){if(_0x6e89de){return _0x6e89de[_0x99b0('0x2e')]()[_0x99b0('0x17')](function(){var _0xc23714=_0x6e89de[_0x99b0('0x2f')]({'plain':!![]});var _0x2f2372=_0x99b0('0x30');return db[_0x99b0('0x31')]['destroy']({'where':{'type':_0x2f2372,'resourceId':_0xc23714['id']}})[_0x99b0('0x17')](function(){return _0x6e89de;});})['then'](function(){_0x35b62e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x509a39,_0x3f140f){return function(_0x12d474){if(!_0x12d474){_0x509a39[_0x99b0('0x22')](0x194);}return _0x12d474;};}function handleError(_0x2db74d,_0x13e0d0){_0x13e0d0=_0x13e0d0||0x1f4;return function(_0x26ecd9){logger['error'](_0x26ecd9[_0x99b0('0x32')]);if(_0x26ecd9['name']){delete _0x26ecd9['name'];}_0x2db74d[_0x99b0('0x23')](_0x13e0d0)[_0x99b0('0x33')](_0x26ecd9);};}exports[_0x99b0('0x34')]=function(_0x24df06,_0x1f0409){var _0x45487c={},_0x19d83f={},_0x3ba898={'count':0x0,'rows':[]};var _0x56374b=_[_0x99b0('0x35')](db['VoiceContext'][_0x99b0('0x36')],function(_0x576f08){return{'name':_0x576f08['fieldName'],'type':_0x576f08[_0x99b0('0x37')][_0x99b0('0x38')]};});_0x19d83f['model']=_['map'](_0x56374b,_0x99b0('0x39'));_0x19d83f[_0x99b0('0x3a')]=_[_0x99b0('0x3b')](_0x24df06[_0x99b0('0x3a')]);_0x19d83f[_0x99b0('0x3c')]=_['intersection'](_0x19d83f[_0x99b0('0x3d')],_0x19d83f['query']);_0x45487c[_0x99b0('0x3e')]=_[_0x99b0('0x3f')](_0x19d83f[_0x99b0('0x3d')],qs['fields'](_0x24df06[_0x99b0('0x3a')]['fields']));_0x45487c[_0x99b0('0x3e')]=_0x45487c[_0x99b0('0x3e')][_0x99b0('0x40')]?_0x45487c[_0x99b0('0x3e')]:_0x19d83f[_0x99b0('0x3d')];if(!_0x24df06[_0x99b0('0x3a')][_0x99b0('0x41')](_0x99b0('0x42'))){_0x45487c['limit']=qs[_0x99b0('0x43')](_0x24df06['query'][_0x99b0('0x43')]);_0x45487c[_0x99b0('0x26')]=qs[_0x99b0('0x26')](_0x24df06['query'][_0x99b0('0x26')]);}_0x45487c[_0x99b0('0x44')]=qs[_0x99b0('0x45')](_0x24df06[_0x99b0('0x3a')][_0x99b0('0x45')]);_0x45487c[_0x99b0('0x46')]=qs[_0x99b0('0x3c')](_[_0x99b0('0x47')](_0x24df06[_0x99b0('0x3a')],_0x19d83f[_0x99b0('0x3c')]),_0x56374b);if(_0x24df06[_0x99b0('0x3a')]['filter']){_0x45487c[_0x99b0('0x46')]=_[_0x99b0('0x48')](_0x45487c[_0x99b0('0x46')],{'$or':_['map'](_0x56374b,function(_0x2ffec5){if(_0x2ffec5['type']!==_0x99b0('0x49')){var _0x139f27={};_0x139f27[_0x2ffec5[_0x99b0('0x39')]]={'$like':'%'+_0x24df06['query']['filter']+'%'};return _0x139f27;}})});}_0x45487c=_[_0x99b0('0x48')]({},_0x45487c,_0x24df06[_0x99b0('0x4a')]);var _0x49e129={'where':_0x45487c[_0x99b0('0x46')]};return db[_0x99b0('0x4b')][_0x99b0('0x28')](_0x49e129)[_0x99b0('0x17')](function(_0x581486){_0x3ba898[_0x99b0('0x28')]=_0x581486;if(_0x24df06[_0x99b0('0x3a')][_0x99b0('0x4c')]){_0x45487c['include']=[{'all':!![]}];}return db[_0x99b0('0x4b')]['findAll'](_0x45487c);})[_0x99b0('0x17')](function(_0x20ab12){_0x3ba898['rows']=_0x20ab12;return _0x3ba898;})[_0x99b0('0x17')](respondWithFilteredResult(_0x1f0409,_0x45487c))[_0x99b0('0x4d')](handleError(_0x1f0409,null));};exports[_0x99b0('0x4e')]=function(_0x19f788,_0x1edfd8){var _0x137434={'raw':![],'where':{'id':_0x19f788['params']['id']}},_0x291258={};_0x291258['model']=_[_0x99b0('0x3b')](db[_0x99b0('0x4b')]['rawAttributes']);_0x291258[_0x99b0('0x3a')]=_[_0x99b0('0x3b')](_0x19f788[_0x99b0('0x3a')]);_0x291258['filters']=_[_0x99b0('0x3f')](_0x291258['model'],_0x291258[_0x99b0('0x3a')]);_0x137434[_0x99b0('0x3e')]=_[_0x99b0('0x3f')](_0x291258[_0x99b0('0x3d')],qs[_0x99b0('0x4f')](_0x19f788[_0x99b0('0x3a')][_0x99b0('0x4f')]));_0x137434[_0x99b0('0x3e')]=_0x137434[_0x99b0('0x3e')][_0x99b0('0x40')]?_0x137434[_0x99b0('0x3e')]:_0x291258[_0x99b0('0x3d')];if(_0x19f788[_0x99b0('0x3a')][_0x99b0('0x4c')]){_0x137434['include']=[{'all':!![]}];}_0x137434=_[_0x99b0('0x48')]({},_0x137434,_0x19f788[_0x99b0('0x4a')]);return db[_0x99b0('0x4b')][_0x99b0('0x50')](_0x137434)['then'](handleEntityNotFound(_0x1edfd8,null))[_0x99b0('0x17')](respondWithResult(_0x1edfd8,null))[_0x99b0('0x4d')](handleError(_0x1edfd8,null));};exports[_0x99b0('0x51')]=function(_0x69f7a0,_0x2773e8,_0x2e270f){var _0xd94fa7;return db[_0x99b0('0x4b')]['create'](_0x69f7a0[_0x99b0('0x52')],{'raw':!![]})['then'](function(_0x5d9471){_0xd94fa7=_0x5d9471;return db[_0x99b0('0x4b')][_0x99b0('0x53')]({'raw':!![]});})['then'](function(_0x4ea88a){var _0x55e080=fs[_0x99b0('0x54')](path[_0x99b0('0x55')](config[_0x99b0('0x56')],_0x99b0('0x57')),_0x99b0('0x58'));var _0xb236fd=ejs[_0x99b0('0x59')](_0x55e080,{'contexts':_0x4ea88a||[]});fs['writeFileSync'](_0x99b0('0x5a'),_0xb236fd);})[_0x99b0('0x17')](function(){return respondWithRpcPromise(_0x99b0('0x5b'),'create',{'module':_0x99b0('0x5c')});})['then'](function(){var _0x365dbf=_0x69f7a0[_0x99b0('0x5d')][_0x99b0('0x2f')]({'plain':!![]});if(!_0x365dbf)throw new Error(_0x99b0('0x5e'));if(_0x365dbf[_0x99b0('0x5f')]===_0x99b0('0x5d')){var _0x163087=_0xd94fa7['get']({'plain':!![]});return db[_0x99b0('0x60')][_0x99b0('0x50')]({'where':{'name':_0x99b0('0x30'),'userProfileId':_0x365dbf[_0x99b0('0x61')]},'raw':!![]})[_0x99b0('0x17')](function(_0x172fd0){if(_0x172fd0&&_0x172fd0['autoAssociation']===0x0){return db[_0x99b0('0x31')]['create']({'name':_0x163087[_0x99b0('0x39')],'resourceId':_0x163087['id'],'type':_0x172fd0[_0x99b0('0x39')],'sectionId':_0x172fd0['id']},{})[_0x99b0('0x17')](function(){return _0xd94fa7;});}else{return _0xd94fa7;}})[_0x99b0('0x4d')](function(_0x3b32ed){logger[_0x99b0('0x1e')](_0x99b0('0x62'),_0x3b32ed);throw _0x3b32ed;});}return _0xd94fa7;})[_0x99b0('0x17')](respondWithResult(_0x2773e8,0xc9))[_0x99b0('0x4d')](handleError(_0x2773e8,null));};exports[_0x99b0('0x2d')]=function(_0x497b37,_0x597679,_0x4d7f79){var _0x113870;return db['VoiceContext'][_0x99b0('0x50')]({'where':{'id':_0x497b37['params']['id']}})['then'](handleEntityNotFound(_0x597679,null))[_0x99b0('0x17')](saveUpdates(_0x497b37['body'],null))[_0x99b0('0x17')](function(_0x255466){if(_0x255466){_0x113870=_0x255466;return db[_0x99b0('0x4b')][_0x99b0('0x53')]({'raw':!![]});}})[_0x99b0('0x17')](function(_0x2ada8f){var _0x353c51=fs['readFileSync'](path[_0x99b0('0x55')](config[_0x99b0('0x56')],'server/files/templates/context.ejs'),_0x99b0('0x58'));var _0x1cc90d=ejs['render'](_0x353c51,{'contexts':_0x2ada8f||[]});fs[_0x99b0('0x63')](_0x99b0('0x5a'),_0x1cc90d);})[_0x99b0('0x17')](function(){return respondWithRpcPromise('Reload',_0x99b0('0x2d'),{'module':_0x99b0('0x5c')});})['then'](function(){return _0x113870;})[_0x99b0('0x17')](respondWithResult(_0x597679,null))[_0x99b0('0x4d')](handleError(_0x597679,null));};exports[_0x99b0('0x2e')]=function(_0x4a7196,_0x37748a,_0x7d861){var _0x22155f;return db[_0x99b0('0x4b')][_0x99b0('0x50')]({'where':{'id':_0x4a7196[_0x99b0('0x64')]['id']}})['then'](handleEntityNotFound(_0x37748a,null))['then'](removeEntity(_0x37748a,null))['then'](function(){return db[_0x99b0('0x4b')][_0x99b0('0x53')]({'raw':!![]});})[_0x99b0('0x17')](function(_0x3c7128){var _0x124611=fs['readFileSync'](path['join'](config[_0x99b0('0x56')],_0x99b0('0x57')),'utf8');var _0x3df62b=ejs[_0x99b0('0x59')](_0x124611,{'contexts':_0x3c7128});fs[_0x99b0('0x63')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3df62b);return respondWithRpcPromise(_0x99b0('0x5b'),_0x99b0('0x2e'),{'module':_0x99b0('0x5c')});})[_0x99b0('0x4d')](handleError(_0x37748a,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 64cf5ca..949c8f8 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 _0x1047=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment'];(function(_0x8f7501,_0x1a5413){var _0x3f774d=function(_0x11815a){while(--_0x11815a){_0x8f7501['push'](_0x8f7501['shift']());}};_0x3f774d(++_0x1a5413);}(_0x1047,0x79));var _0x7104=function(_0x545ab7,_0x158f40){_0x545ab7=_0x545ab7-0x0;var _0x1421f5=_0x1047[_0x545ab7];return _0x1421f5;};'use strict';var _=require(_0x7104('0x0'));var util=require(_0x7104('0x1'));var logger=require(_0x7104('0x2'))(_0x7104('0x3'));var moment=require(_0x7104('0x4'));var BPromise=require(_0x7104('0x5'));var rp=require(_0x7104('0x6'));var fs=require('fs');var path=require(_0x7104('0x7'));var rimraf=require(_0x7104('0x8'));var config=require(_0x7104('0x9'));var attributes=require(_0x7104('0xa'));module[_0x7104('0xb')]=function(_0x313390,_0x549845){return _0x313390['define'](_0x7104('0xc'),attributes,{'tableName':_0x7104('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b5e=['voice_contexts','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceContext'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x5b5e,0x151));var _0xe5b5=function(_0x1a3d29,_0x22fc58){_0x1a3d29=_0x1a3d29-0x0;var _0x10fe99=_0x5b5e[_0x1a3d29];return _0x10fe99;};'use strict';var _=require(_0xe5b5('0x0'));var util=require('util');var logger=require(_0xe5b5('0x1'))(_0xe5b5('0x2'));var moment=require(_0xe5b5('0x3'));var BPromise=require('bluebird');var rp=require(_0xe5b5('0x4'));var fs=require('fs');var path=require(_0xe5b5('0x5'));var rimraf=require(_0xe5b5('0x6'));var config=require(_0xe5b5('0x7'));var attributes=require('./voiceContext.attributes');module[_0xe5b5('0x8')]=function(_0x3d5a8b,_0x53b05e){return _0x3d5a8b[_0xe5b5('0x9')](_0xe5b5('0xa'),attributes,{'tableName':_0xe5b5('0xb'),'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 8b47242..870278c 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 _0x7916=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x384568,_0x97c2f1){var _0xf0a2ec=function(_0x2dd615){while(--_0x2dd615){_0x384568['push'](_0x384568['shift']());}};_0xf0a2ec(++_0x97c2f1);}(_0x7916,0x128));var _0x6791=function(_0x245f3c,_0x4cca75){_0x245f3c=_0x245f3c-0x0;var _0x110dbd=_0x7916[_0x245f3c];return _0x110dbd;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var moment=require(_0x6791('0x1'));var BPromise=require(_0x6791('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6791('0x3'));var db=require(_0x6791('0x4'))['db'];var utils=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('rpc');var config=require(_0x6791('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6791('0x8')][_0x6791('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad8c0,_0x8b85ff,_0x5d2118){return new BPromise(function(_0x2b240c,_0x50c563){return client['request'](_0x5ad8c0,_0x5d2118)[_0x6791('0xa')](function(_0x198a64){logger['info'](_0x6791('0xb'),_0x8b85ff,_0x6791('0xc'));logger[_0x6791('0xd')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x8b85ff,_0x6791('0xc'),JSON[_0x6791('0xe')](_0x198a64));if(_0x198a64[_0x6791('0xf')]){if(_0x198a64[_0x6791('0xf')][_0x6791('0x10')]===0x1f4){logger[_0x6791('0xf')](_0x6791('0xb'),_0x8b85ff,_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);return _0x50c563(_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x8b85ff,_0x198a64[_0x6791('0xf')]['message']);return _0x2b240c(_0x198a64[_0x6791('0xf')]['message']);}else{logger[_0x6791('0x12')](_0x6791('0xb'),_0x8b85ff,'request\x20sent');_0x2b240c(_0x198a64[_0x6791('0x13')]['message']);}})[_0x6791('0x14')](function(_0x150d1f){logger['error'](_0x6791('0xb'),_0x8b85ff,_0x150d1f);_0x50c563(_0x150d1f);});});} \ No newline at end of file +var _0x3a41=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4c6f09,_0x133168){var _0x3d73d6=function(_0x56250b){while(--_0x56250b){_0x4c6f09['push'](_0x4c6f09['shift']());}};_0x3d73d6(++_0x133168);}(_0x3a41,0x86));var _0x13a4=function(_0x250f95,_0x5a5728){_0x250f95=_0x250f95-0x0;var _0x4ada97=_0x3a41[_0x250f95];return _0x4ada97;};'use strict';var _=require(_0x13a4('0x0'));var util=require(_0x13a4('0x1'));var moment=require(_0x13a4('0x2'));var BPromise=require(_0x13a4('0x3'));var rs=require(_0x13a4('0x4'));var fs=require('fs');var Redis=require(_0x13a4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x13a4('0x6'));var logger=require(_0x13a4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x13a4('0x8'));var client=jayson[_0x13a4('0x9')][_0x13a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ead8c,_0x57876e,_0x5a2c69){return new BPromise(function(_0x184038,_0x1a262e){return client[_0x13a4('0xb')](_0x3ead8c,_0x5a2c69)[_0x13a4('0xc')](function(_0x3f3409){logger[_0x13a4('0xd')](_0x13a4('0xe'),_0x57876e,_0x13a4('0xf'));logger[_0x13a4('0x10')](_0x13a4('0x11'),_0x57876e,_0x13a4('0xf'),JSON[_0x13a4('0x12')](_0x3f3409));if(_0x3f3409[_0x13a4('0x13')]){if(_0x3f3409['error']['code']===0x1f4){logger['error'](_0x13a4('0xe'),_0x57876e,_0x3f3409['error'][_0x13a4('0x14')]);return _0x1a262e(_0x3f3409[_0x13a4('0x13')][_0x13a4('0x14')]);}logger['error'](_0x13a4('0xe'),_0x57876e,_0x3f3409['error'][_0x13a4('0x14')]);return _0x184038(_0x3f3409['error']['message']);}else{logger[_0x13a4('0xd')]('VoiceContext,\x20%s,\x20%s',_0x57876e,_0x13a4('0xf'));_0x184038(_0x3f3409[_0x13a4('0x15')][_0x13a4('0x14')]);}})[_0x13a4('0x16')](function(_0x5f107b){logger['error'](_0x13a4('0xe'),_0x57876e,_0x5f107b);_0x1a262e(_0x5f107b);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 2a29666..ab77206 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 _0x2cc9=['get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xd336fa,_0x39d1b2){var _0x3370b1=function(_0x41c5cc){while(--_0x41c5cc){_0xd336fa['push'](_0xd336fa['shift']());}};_0x3370b1(++_0x39d1b2);}(_0x2cc9,0x1f2));var _0x92cc=function(_0x5cba68,_0x368a2f){_0x5cba68=_0x5cba68-0x0;var _0x392431=_0x2cc9[_0x5cba68];return _0x392431;};'use strict';var multer=require('multer');var util=require(_0x92cc('0x0'));var path=require(_0x92cc('0x1'));var timeout=require(_0x92cc('0x2'));var express=require(_0x92cc('0x3'));var router=express[_0x92cc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x92cc('0x5'));var interaction=require(_0x92cc('0x6'));var config=require(_0x92cc('0x7'));var controller=require('./voiceDialReport.controller');router[_0x92cc('0x8')]('/',auth['isAuthenticated'](),controller[_0x92cc('0x9')]);router[_0x92cc('0x8')](_0x92cc('0xa'),auth['isAuthenticated'](),controller[_0x92cc('0xb')]);router[_0x92cc('0x8')](_0x92cc('0xc'),auth[_0x92cc('0xd')](),controller[_0x92cc('0xe')]);router[_0x92cc('0xf')]('/',auth[_0x92cc('0xd')](),controller[_0x92cc('0x10')]);router[_0x92cc('0x11')](_0x92cc('0xc'),auth[_0x92cc('0xd')](),controller[_0x92cc('0x12')]);router[_0x92cc('0x13')](_0x92cc('0xc'),auth[_0x92cc('0xd')](),controller[_0x92cc('0x14')]);module[_0x92cc('0x15')]=router; \ No newline at end of file +var _0x675e=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','post','put','/:id','update'];(function(_0x5eaf10,_0x43a574){var _0x268036=function(_0x2db04d){while(--_0x2db04d){_0x5eaf10['push'](_0x5eaf10['shift']());}};_0x268036(++_0x43a574);}(_0x675e,0xc1));var _0xe675=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x675e[_0x243b59];return _0x3e1676;};'use strict';var multer=require(_0xe675('0x0'));var util=require(_0xe675('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe675('0x2'));var router=express[_0xe675('0x3')]();var fs_extra=require(_0xe675('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe675('0x5'));var config=require(_0xe675('0x6'));var controller=require('./voiceDialReport.controller');router[_0xe675('0x7')]('/',auth[_0xe675('0x8')](),controller[_0xe675('0x9')]);router[_0xe675('0x7')]('/describe',auth[_0xe675('0x8')](),controller[_0xe675('0xa')]);router[_0xe675('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xe675('0xb')]);router[_0xe675('0xc')]('/',auth[_0xe675('0x8')](),controller['create']);router[_0xe675('0xd')](_0xe675('0xe'),auth[_0xe675('0x8')](),controller[_0xe675('0xf')]);router[_0xe675('0x10')]('/:id',auth[_0xe675('0x8')](),controller[_0xe675('0x11')]);module[_0xe675('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index d65be58..c598e83 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 _0x34e8=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x5e1243,_0x512d21){var _0x1aaba0=function(_0x6de680){while(--_0x6de680){_0x5e1243['push'](_0x5e1243['shift']());}};_0x1aaba0(++_0x512d21);}(_0x34e8,0x12c));var _0x834e=function(_0x21e062,_0x5b2435){_0x21e062=_0x21e062-0x0;var _0x4318e7=_0x34e8[_0x21e062];return _0x4318e7;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'privilege':{'type':Sequelize[_0x834e('0x2')]},'channel':{'type':Sequelize[_0x834e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'calleridnum':{'type':Sequelize[_0x834e('0x2')]},'calleridname':{'type':Sequelize[_0x834e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'connectedlinename':{'type':Sequelize[_0x834e('0x2')]},'language':{'type':Sequelize[_0x834e('0x2')]},'accountcode':{'type':Sequelize[_0x834e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x834e('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x834e('0x2')]},'linkedid':{'type':Sequelize[_0x834e('0x2')]},'destchannel':{'type':Sequelize[_0x834e('0x2')]},'destchannelstate':{'type':Sequelize[_0x834e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x834e('0x2')]},'destcalleridname':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x834e('0x2')]},'destlanguage':{'type':Sequelize[_0x834e('0x2')]},'destaccountcode':{'type':Sequelize[_0x834e('0x2')]},'destcontext':{'type':Sequelize[_0x834e('0x2')]},'destexten':{'type':Sequelize[_0x834e('0x2')]},'destpriority':{'type':Sequelize[_0x834e('0x3')]},'destuniqueid':{'type':Sequelize[_0x834e('0x2')]},'destlinkedid':{'type':Sequelize[_0x834e('0x2')]},'dialstring':{'type':Sequelize[_0x834e('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x834e('0x4')]},'answertime':{'type':Sequelize[_0x834e('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x834e('0x2')],'comment':_0x834e('0x5')},'routeId':{'type':Sequelize[_0x834e('0x3')]},'duration':{'type':Sequelize[_0x834e('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x834e('0x3')]}}; \ No newline at end of file +var _0xb821=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0xb821,0xa7));var _0x1b82=function(_0x2bc75f,_0x5ab72e){_0x2bc75f=_0x2bc75f-0x0;var _0x57ce4a=_0xb821[_0x2bc75f];return _0x57ce4a;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'privilege':{'type':Sequelize[_0x1b82('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1b82('0x1')]},'connectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'language':{'type':Sequelize[_0x1b82('0x1')]},'accountcode':{'type':Sequelize[_0x1b82('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1b82('0x1')]},'priority':{'type':Sequelize[_0x1b82('0x2')]},'uniqueid':{'type':Sequelize[_0x1b82('0x1')]},'linkedid':{'type':Sequelize[_0x1b82('0x1')]},'destchannel':{'type':Sequelize[_0x1b82('0x1')]},'destchannelstate':{'type':Sequelize[_0x1b82('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridname':{'type':Sequelize[_0x1b82('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'destlanguage':{'type':Sequelize[_0x1b82('0x1')]},'destaccountcode':{'type':Sequelize[_0x1b82('0x1')]},'destcontext':{'type':Sequelize[_0x1b82('0x1')]},'destexten':{'type':Sequelize[_0x1b82('0x1')]},'destpriority':{'type':Sequelize[_0x1b82('0x2')]},'destuniqueid':{'type':Sequelize[_0x1b82('0x1')]},'destlinkedid':{'type':Sequelize[_0x1b82('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x1b82('0x1')]},'starttime':{'type':Sequelize[_0x1b82('0x3')]},'answertime':{'type':Sequelize[_0x1b82('0x3')]},'endtime':{'type':Sequelize[_0x1b82('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x1b82('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x1b82('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 5ed8be3..bf7afa1 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 _0xf6bb=['to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','undefined','count','limit','set','Content-Range','reject','save','then','destroy','sendStatus','name','send','VoiceDialReport','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','create','update','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x130705,_0x2d266b){var _0x1fa991=function(_0x395639){while(--_0x395639){_0x130705['push'](_0x130705['shift']());}};_0x1fa991(++_0x2d266b);}(_0xf6bb,0x88));var _0xbf6b=function(_0x28c939,_0x110e29){_0x28c939=_0x28c939-0x0;var _0x527fe9=_0xf6bb[_0x28c939];return _0x527fe9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf6b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf6b('0x1'));var rp=require(_0xbf6b('0x2'));var moment=require(_0xbf6b('0x3'));var BPromise=require(_0xbf6b('0x4'));var Mustache=require(_0xbf6b('0x5'));var util=require(_0xbf6b('0x6'));var path=require('path');var sox=require(_0xbf6b('0x7'));var csv=require(_0xbf6b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbf6b('0x9'));var crypto=require(_0xbf6b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xbf6b('0xb'));var toCsv=require(_0xbf6b('0x8'));var querystring=require(_0xbf6b('0xc'));var Papa=require(_0xbf6b('0xd'));var Redis=require(_0xbf6b('0xe'));var authService=require(_0xbf6b('0xf'));var qs=require(_0xbf6b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf6b('0x11'));var logger=require(_0xbf6b('0x12'))(_0xbf6b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbf6b('0x14'));var db=require(_0xbf6b('0x15'))['db'];function respondWithStatusCode(_0xacd730,_0x5a5b9c){_0x5a5b9c=_0x5a5b9c||0xcc;return function(_0x47eb7d){if(_0x47eb7d){return _0xacd730['sendStatus'](_0x5a5b9c);}return _0xacd730[_0xbf6b('0x16')](_0x5a5b9c)[_0xbf6b('0x17')]();};}function respondWithResult(_0x1d5383,_0x2d5843){_0x2d5843=_0x2d5843||0xc8;return function(_0x209c6e){if(_0x209c6e){return _0x1d5383[_0xbf6b('0x16')](_0x2d5843)[_0xbf6b('0x18')](_0x209c6e);}};}function respondWithFilteredResult(_0x1e95a1,_0x40b9fe){return function(_0x305f9c){if(_0x305f9c){var _0xb088e=typeof _0x40b9fe['offset']===_0xbf6b('0x19')&&typeof _0x40b9fe['limit']===_0xbf6b('0x19');var _0x3995c7=_0x305f9c[_0xbf6b('0x1a')];var _0x21ac94=_0xb088e?0x0:_0x40b9fe['offset'];var _0x6031d8=_0xb088e?_0x305f9c[_0xbf6b('0x1a')]:_0x40b9fe['offset']+_0x40b9fe[_0xbf6b('0x1b')];var _0x47d812;if(_0x6031d8>=_0x3995c7){_0x6031d8=_0x3995c7;_0x47d812=0xc8;}else{_0x47d812=0xce;}_0x1e95a1['status'](_0x47d812);return _0x1e95a1[_0xbf6b('0x1c')](_0xbf6b('0x1d'),_0x21ac94+'-'+_0x6031d8+'/'+_0x3995c7)[_0xbf6b('0x18')](_0x305f9c);}return null;};}function patchUpdates(_0x287721){return function(_0x5935c3){try{jsonpatch['apply'](_0x5935c3,_0x287721,!![]);}catch(_0x432ed1){return BPromise[_0xbf6b('0x1e')](_0x432ed1);}return _0x5935c3[_0xbf6b('0x1f')]();};}function saveUpdates(_0x5c94a3,_0x2e3941){return function(_0x57bb76){if(_0x57bb76){return _0x57bb76['update'](_0x5c94a3)[_0xbf6b('0x20')](function(_0x320e7a){return _0x320e7a;});}return null;};}function removeEntity(_0x37d65d,_0xb317a0){return function(_0x34b9ac){if(_0x34b9ac){return _0x34b9ac[_0xbf6b('0x21')]()[_0xbf6b('0x20')](function(){_0x37d65d['status'](0xcc)[_0xbf6b('0x17')]();});}};}function handleEntityNotFound(_0x162cc7,_0x44f502){return function(_0x20a68b){if(!_0x20a68b){_0x162cc7[_0xbf6b('0x22')](0x194);}return _0x20a68b;};}function handleError(_0xe04694,_0x41949a){_0x41949a=_0x41949a||0x1f4;return function(_0x2a7f1e){logger['error'](_0x2a7f1e['stack']);if(_0x2a7f1e[_0xbf6b('0x23')]){delete _0x2a7f1e[_0xbf6b('0x23')];}_0xe04694[_0xbf6b('0x16')](_0x41949a)[_0xbf6b('0x24')](_0x2a7f1e);};}exports['index']=function(_0x42778e,_0x433d45){var _0x5a2b67={},_0x767975={},_0x12bab9={'count':0x0,'rows':[]};var _0x50a0c0=_['map'](db[_0xbf6b('0x25')]['rawAttributes'],function(_0x501acf){return{'name':_0x501acf[_0xbf6b('0x26')],'type':_0x501acf[_0xbf6b('0x27')][_0xbf6b('0x28')]};});_0x767975['model']=_['map'](_0x50a0c0,'name');_0x767975[_0xbf6b('0x29')]=_['keys'](_0x42778e[_0xbf6b('0x29')]);_0x767975[_0xbf6b('0x2a')]=_[_0xbf6b('0x2b')](_0x767975['model'],_0x767975['query']);_0x5a2b67[_0xbf6b('0x2c')]=_[_0xbf6b('0x2b')](_0x767975[_0xbf6b('0x2d')],qs[_0xbf6b('0x2e')](_0x42778e[_0xbf6b('0x29')]['fields']));_0x5a2b67[_0xbf6b('0x2c')]=_0x5a2b67[_0xbf6b('0x2c')][_0xbf6b('0x2f')]?_0x5a2b67[_0xbf6b('0x2c')]:_0x767975[_0xbf6b('0x2d')];if(!_0x42778e[_0xbf6b('0x29')][_0xbf6b('0x30')](_0xbf6b('0x31'))){_0x5a2b67[_0xbf6b('0x1b')]=qs[_0xbf6b('0x1b')](_0x42778e[_0xbf6b('0x29')][_0xbf6b('0x1b')]);_0x5a2b67[_0xbf6b('0x32')]=qs[_0xbf6b('0x32')](_0x42778e[_0xbf6b('0x29')][_0xbf6b('0x32')]);}_0x5a2b67[_0xbf6b('0x33')]=qs[_0xbf6b('0x34')](_0x42778e[_0xbf6b('0x29')][_0xbf6b('0x34')]);_0x5a2b67[_0xbf6b('0x35')]=qs[_0xbf6b('0x2a')](_[_0xbf6b('0x36')](_0x42778e[_0xbf6b('0x29')],_0x767975['filters']),_0x50a0c0);if(_0x42778e[_0xbf6b('0x29')][_0xbf6b('0x37')]){_0x5a2b67[_0xbf6b('0x35')]=_[_0xbf6b('0x38')](_0x5a2b67['where'],{'$or':_[_0xbf6b('0x39')](_0x50a0c0,function(_0x2cd755){if(_0x2cd755[_0xbf6b('0x27')]!=='VIRTUAL'){var _0x3fb465={};_0x3fb465[_0x2cd755['name']]={'$like':'%'+_0x42778e['query'][_0xbf6b('0x37')]+'%'};return _0x3fb465;}})});}_0x5a2b67=_['merge']({},_0x5a2b67,_0x42778e[_0xbf6b('0x3a')]);var _0x38126a={'where':_0x5a2b67[_0xbf6b('0x35')]};return db['VoiceDialReport'][_0xbf6b('0x1a')](_0x38126a)[_0xbf6b('0x20')](function(_0x4bfed4){_0x12bab9[_0xbf6b('0x1a')]=_0x4bfed4;if(_0x42778e[_0xbf6b('0x29')][_0xbf6b('0x3b')]){_0x5a2b67[_0xbf6b('0x3c')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xbf6b('0x3d')](_0x5a2b67);})[_0xbf6b('0x20')](function(_0x4c83e5){_0x12bab9[_0xbf6b('0x3e')]=_0x4c83e5;return _0x12bab9;})[_0xbf6b('0x20')](respondWithFilteredResult(_0x433d45,_0x5a2b67))[_0xbf6b('0x3f')](handleError(_0x433d45,null));};exports['show']=function(_0x14829c,_0x29cd11){var _0x2b4d72={'raw':!![],'where':{'id':_0x14829c[_0xbf6b('0x40')]['id']}},_0x361385={};_0x361385[_0xbf6b('0x2d')]=_['keys'](db['VoiceDialReport'][_0xbf6b('0x41')]);_0x361385['query']=_[_0xbf6b('0x42')](_0x14829c['query']);_0x361385[_0xbf6b('0x2a')]=_[_0xbf6b('0x2b')](_0x361385[_0xbf6b('0x2d')],_0x361385[_0xbf6b('0x29')]);_0x2b4d72[_0xbf6b('0x2c')]=_[_0xbf6b('0x2b')](_0x361385[_0xbf6b('0x2d')],qs['fields'](_0x14829c[_0xbf6b('0x29')][_0xbf6b('0x2e')]));_0x2b4d72['attributes']=_0x2b4d72['attributes'][_0xbf6b('0x2f')]?_0x2b4d72[_0xbf6b('0x2c')]:_0x361385[_0xbf6b('0x2d')];if(_0x14829c[_0xbf6b('0x29')][_0xbf6b('0x3b')]){_0x2b4d72[_0xbf6b('0x3c')]=[{'all':!![]}];}_0x2b4d72=_[_0xbf6b('0x38')]({},_0x2b4d72,_0x14829c['options']);return db[_0xbf6b('0x25')]['find'](_0x2b4d72)[_0xbf6b('0x20')](handleEntityNotFound(_0x29cd11,null))['then'](respondWithResult(_0x29cd11,null))[_0xbf6b('0x3f')](handleError(_0x29cd11,null));};exports[_0xbf6b('0x43')]=function(_0x3ee535,_0x24a900){return db[_0xbf6b('0x25')][_0xbf6b('0x43')](_0x3ee535['body'],{})[_0xbf6b('0x20')](respondWithResult(_0x24a900,0xc9))[_0xbf6b('0x3f')](handleError(_0x24a900,null));};exports[_0xbf6b('0x44')]=function(_0x4b504f,_0x3df421){if(_0x4b504f['body']['id']){delete _0x4b504f[_0xbf6b('0x45')]['id'];}return db[_0xbf6b('0x25')][_0xbf6b('0x46')]({'where':{'id':_0x4b504f[_0xbf6b('0x40')]['id']}})[_0xbf6b('0x20')](handleEntityNotFound(_0x3df421,null))[_0xbf6b('0x20')](saveUpdates(_0x4b504f['body'],null))[_0xbf6b('0x20')](respondWithResult(_0x3df421,null))['catch'](handleError(_0x3df421,null));};exports[_0xbf6b('0x21')]=function(_0x41fe85,_0x502b71){return db[_0xbf6b('0x25')][_0xbf6b('0x46')]({'where':{'id':_0x41fe85[_0xbf6b('0x40')]['id']}})[_0xbf6b('0x20')](handleEntityNotFound(_0x502b71,null))['then'](removeEntity(_0x502b71,null))[_0xbf6b('0x3f')](handleError(_0x502b71,null));};exports[_0xbf6b('0x47')]=function(_0xc6ff54,_0x592934){return db[_0xbf6b('0x25')][_0xbf6b('0x47')]()[_0xbf6b('0x20')](respondWithResult(_0x592934,null))[_0xbf6b('0x3f')](handleError(_0x592934,null));}; \ No newline at end of file +var _0xc3b3=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','offset','undefined','count','json','apply','reject','save','update','then','error','stack','name','index','VoiceDialReport','fieldName','type','key','model','map'];(function(_0x1e6994,_0x1fb486){var _0x2a1037=function(_0x4b45a2){while(--_0x4b45a2){_0x1e6994['push'](_0x1e6994['shift']());}};_0x2a1037(++_0x1fb486);}(_0xc3b3,0xac));var _0x3c3b=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc3b3[_0x51020b];return _0x371e47;};'use strict';var emlformat=require(_0x3c3b('0x0'));var rimraf=require(_0x3c3b('0x1'));var zipdir=require(_0x3c3b('0x2'));var jsonpatch=require(_0x3c3b('0x3'));var rp=require('request-promise');var moment=require(_0x3c3b('0x4'));var BPromise=require(_0x3c3b('0x5'));var Mustache=require(_0x3c3b('0x6'));var util=require('util');var path=require(_0x3c3b('0x7'));var sox=require(_0x3c3b('0x8'));var csv=require(_0x3c3b('0x9'));var ejs=require(_0x3c3b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c3b('0xb'));var squel=require(_0x3c3b('0xc'));var crypto=require(_0x3c3b('0xd'));var jsforce=require(_0x3c3b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3c3b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3c3b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3c3b('0x10'));var as=require(_0x3c3b('0x11'));var hardwareService=require(_0x3c3b('0x12'));var logger=require(_0x3c3b('0x13'))(_0x3c3b('0x14'));var utils=require('../../config/utils');var config=require(_0x3c3b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3c3b('0x16'))['db'];function respondWithStatusCode(_0x578fa3,_0x48df72){_0x48df72=_0x48df72||0xcc;return function(_0x1b2c24){if(_0x1b2c24){return _0x578fa3['sendStatus'](_0x48df72);}return _0x578fa3['status'](_0x48df72)[_0x3c3b('0x17')]();};}function respondWithResult(_0x56b1aa,_0x18694b){_0x18694b=_0x18694b||0xc8;return function(_0x28aded){if(_0x28aded){return _0x56b1aa[_0x3c3b('0x18')](_0x18694b)['json'](_0x28aded);}};}function respondWithFilteredResult(_0x1163c6,_0x310caa){return function(_0x5278f7){if(_0x5278f7){var _0x1d23e8=typeof _0x310caa[_0x3c3b('0x19')]===_0x3c3b('0x1a')&&typeof _0x310caa['limit']===_0x3c3b('0x1a');var _0x84a8d5=_0x5278f7[_0x3c3b('0x1b')];var _0x39d71c=_0x1d23e8?0x0:_0x310caa['offset'];var _0x17462d=_0x1d23e8?_0x5278f7[_0x3c3b('0x1b')]:_0x310caa[_0x3c3b('0x19')]+_0x310caa['limit'];var _0x1e75f1;if(_0x17462d>=_0x84a8d5){_0x17462d=_0x84a8d5;_0x1e75f1=0xc8;}else{_0x1e75f1=0xce;}_0x1163c6['status'](_0x1e75f1);return _0x1163c6['set']('Content-Range',_0x39d71c+'-'+_0x17462d+'/'+_0x84a8d5)[_0x3c3b('0x1c')](_0x5278f7);}return null;};}function patchUpdates(_0x395a45){return function(_0x558a56){try{jsonpatch[_0x3c3b('0x1d')](_0x558a56,_0x395a45,!![]);}catch(_0x348730){return BPromise[_0x3c3b('0x1e')](_0x348730);}return _0x558a56[_0x3c3b('0x1f')]();};}function saveUpdates(_0x904363,_0x67eef1){return function(_0x41507c){if(_0x41507c){return _0x41507c[_0x3c3b('0x20')](_0x904363)[_0x3c3b('0x21')](function(_0xb2566){return _0xb2566;});}return null;};}function removeEntity(_0x1e40cc,_0x21fa95){return function(_0x465e05){if(_0x465e05){return _0x465e05['destroy']()[_0x3c3b('0x21')](function(){_0x1e40cc[_0x3c3b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1efc93,_0x3bcf88){return function(_0x45c98e){if(!_0x45c98e){_0x1efc93['sendStatus'](0x194);}return _0x45c98e;};}function handleError(_0x36d39f,_0x5b334e){_0x5b334e=_0x5b334e||0x1f4;return function(_0x3d0f2d){logger[_0x3c3b('0x22')](_0x3d0f2d[_0x3c3b('0x23')]);if(_0x3d0f2d[_0x3c3b('0x24')]){delete _0x3d0f2d['name'];}_0x36d39f[_0x3c3b('0x18')](_0x5b334e)['send'](_0x3d0f2d);};}exports[_0x3c3b('0x25')]=function(_0x267916,_0x1bd128){var _0x5bd87e={},_0x271e6f={},_0x1e763c={'count':0x0,'rows':[]};var _0x755a4b=_['map'](db[_0x3c3b('0x26')]['rawAttributes'],function(_0x2f123f){return{'name':_0x2f123f[_0x3c3b('0x27')],'type':_0x2f123f[_0x3c3b('0x28')][_0x3c3b('0x29')]};});_0x271e6f[_0x3c3b('0x2a')]=_[_0x3c3b('0x2b')](_0x755a4b,_0x3c3b('0x24'));_0x271e6f[_0x3c3b('0x2c')]=_[_0x3c3b('0x2d')](_0x267916['query']);_0x271e6f[_0x3c3b('0x2e')]=_[_0x3c3b('0x2f')](_0x271e6f[_0x3c3b('0x2a')],_0x271e6f[_0x3c3b('0x2c')]);_0x5bd87e[_0x3c3b('0x30')]=_[_0x3c3b('0x2f')](_0x271e6f[_0x3c3b('0x2a')],qs[_0x3c3b('0x31')](_0x267916[_0x3c3b('0x2c')][_0x3c3b('0x31')]));_0x5bd87e[_0x3c3b('0x30')]=_0x5bd87e['attributes']['length']?_0x5bd87e[_0x3c3b('0x30')]:_0x271e6f[_0x3c3b('0x2a')];if(!_0x267916[_0x3c3b('0x2c')][_0x3c3b('0x32')]('nolimit')){_0x5bd87e[_0x3c3b('0x33')]=qs[_0x3c3b('0x33')](_0x267916[_0x3c3b('0x2c')][_0x3c3b('0x33')]);_0x5bd87e['offset']=qs['offset'](_0x267916['query'][_0x3c3b('0x19')]);}_0x5bd87e[_0x3c3b('0x34')]=qs['sort'](_0x267916['query'][_0x3c3b('0x35')]);_0x5bd87e[_0x3c3b('0x36')]=qs[_0x3c3b('0x2e')](_[_0x3c3b('0x37')](_0x267916[_0x3c3b('0x2c')],_0x271e6f['filters']),_0x755a4b);if(_0x267916['query'][_0x3c3b('0x38')]){_0x5bd87e[_0x3c3b('0x36')]=_[_0x3c3b('0x39')](_0x5bd87e[_0x3c3b('0x36')],{'$or':_[_0x3c3b('0x2b')](_0x755a4b,function(_0x286c00){if(_0x286c00['type']!==_0x3c3b('0x3a')){var _0x4c360a={};_0x4c360a[_0x286c00[_0x3c3b('0x24')]]={'$like':'%'+_0x267916[_0x3c3b('0x2c')][_0x3c3b('0x38')]+'%'};return _0x4c360a;}})});}_0x5bd87e=_[_0x3c3b('0x39')]({},_0x5bd87e,_0x267916[_0x3c3b('0x3b')]);var _0x1f1f7b={'where':_0x5bd87e['where']};return db['VoiceDialReport'][_0x3c3b('0x1b')](_0x1f1f7b)[_0x3c3b('0x21')](function(_0x39d7bd){_0x1e763c['count']=_0x39d7bd;if(_0x267916['query'][_0x3c3b('0x3c')]){_0x5bd87e[_0x3c3b('0x3d')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x5bd87e);})[_0x3c3b('0x21')](function(_0x1774c7){_0x1e763c[_0x3c3b('0x3e')]=_0x1774c7;return _0x1e763c;})[_0x3c3b('0x21')](respondWithFilteredResult(_0x1bd128,_0x5bd87e))['catch'](handleError(_0x1bd128,null));};exports[_0x3c3b('0x3f')]=function(_0x37aa71,_0x371146){var _0x28e332={'raw':!![],'where':{'id':_0x37aa71[_0x3c3b('0x40')]['id']}},_0x4fc337={};_0x4fc337[_0x3c3b('0x2a')]=_[_0x3c3b('0x2d')](db[_0x3c3b('0x26')][_0x3c3b('0x41')]);_0x4fc337['query']=_[_0x3c3b('0x2d')](_0x37aa71[_0x3c3b('0x2c')]);_0x4fc337[_0x3c3b('0x2e')]=_['intersection'](_0x4fc337[_0x3c3b('0x2a')],_0x4fc337['query']);_0x28e332['attributes']=_[_0x3c3b('0x2f')](_0x4fc337['model'],qs['fields'](_0x37aa71[_0x3c3b('0x2c')][_0x3c3b('0x31')]));_0x28e332[_0x3c3b('0x30')]=_0x28e332[_0x3c3b('0x30')]['length']?_0x28e332['attributes']:_0x4fc337['model'];if(_0x37aa71[_0x3c3b('0x2c')][_0x3c3b('0x3c')]){_0x28e332['include']=[{'all':!![]}];}_0x28e332=_['merge']({},_0x28e332,_0x37aa71[_0x3c3b('0x3b')]);return db[_0x3c3b('0x26')][_0x3c3b('0x42')](_0x28e332)['then'](handleEntityNotFound(_0x371146,null))['then'](respondWithResult(_0x371146,null))[_0x3c3b('0x43')](handleError(_0x371146,null));};exports['create']=function(_0x313109,_0x63823d){return db[_0x3c3b('0x26')][_0x3c3b('0x44')](_0x313109[_0x3c3b('0x45')],{})[_0x3c3b('0x21')](respondWithResult(_0x63823d,0xc9))[_0x3c3b('0x43')](handleError(_0x63823d,null));};exports['update']=function(_0x3226d8,_0x122bab){if(_0x3226d8[_0x3c3b('0x45')]['id']){delete _0x3226d8[_0x3c3b('0x45')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x3226d8[_0x3c3b('0x40')]['id']}})['then'](handleEntityNotFound(_0x122bab,null))[_0x3c3b('0x21')](saveUpdates(_0x3226d8['body'],null))[_0x3c3b('0x21')](respondWithResult(_0x122bab,null))['catch'](handleError(_0x122bab,null));};exports[_0x3c3b('0x46')]=function(_0x1f0d07,_0x38ddbe){return db[_0x3c3b('0x26')][_0x3c3b('0x42')]({'where':{'id':_0x1f0d07[_0x3c3b('0x40')]['id']}})[_0x3c3b('0x21')](handleEntityNotFound(_0x38ddbe,null))[_0x3c3b('0x21')](removeEntity(_0x38ddbe,null))['catch'](handleError(_0x38ddbe,null));};exports[_0x3c3b('0x47')]=function(_0xc9f6ae,_0x97aac){return db[_0x3c3b('0x26')][_0x3c3b('0x47')]()['then'](respondWithResult(_0x97aac,null))['catch'](handleError(_0x97aac,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 52cd26c..d9814ff 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 _0xa4b2=['report_dial','uniqueid','api','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport'];(function(_0x952a38,_0x37ac7a){var _0x541818=function(_0x3df929){while(--_0x3df929){_0x952a38['push'](_0x952a38['shift']());}};_0x541818(++_0x37ac7a);}(_0xa4b2,0x1e2));var _0x2a4b=function(_0xc71075,_0xb06be0){_0xc71075=_0xc71075-0x0;var _0x1bd6ac=_0xa4b2[_0xc71075];return _0x1bd6ac;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2a4b('0x0'));var moment=require('moment');var BPromise=require(_0x2a4b('0x1'));var rp=require(_0x2a4b('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a4b('0x3'));var config=require(_0x2a4b('0x4'));var attributes=require(_0x2a4b('0x5'));module['exports']=function(_0x13d691,_0x2bce18){return _0x13d691[_0x2a4b('0x6')](_0x2a4b('0x7'),attributes,{'tableName':_0x2a4b('0x8'),'paranoid':![],'indexes':[{'fields':[_0x2a4b('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b89=['report_dial','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport'];(function(_0x5602d4,_0x5a74f9){var _0x55e5ae=function(_0x184a4b){while(--_0x184a4b){_0x5602d4['push'](_0x5602d4['shift']());}};_0x55e5ae(++_0x5a74f9);}(_0x1b89,0xd4));var _0x91b8=function(_0x1214cb,_0x1a6264){_0x1214cb=_0x1214cb-0x0;var _0x5959d8=_0x1b89[_0x1214cb];return _0x5959d8;};'use strict';var _=require(_0x91b8('0x0'));var util=require(_0x91b8('0x1'));var logger=require(_0x91b8('0x2'))(_0x91b8('0x3'));var moment=require('moment');var BPromise=require(_0x91b8('0x4'));var rp=require(_0x91b8('0x5'));var fs=require('fs');var path=require(_0x91b8('0x6'));var rimraf=require(_0x91b8('0x7'));var config=require(_0x91b8('0x8'));var attributes=require(_0x91b8('0x9'));module[_0x91b8('0xa')]=function(_0x1380c2,_0x4790f7){return _0x1380c2['define'](_0x91b8('0xb'),attributes,{'tableName':_0x91b8('0xc'),'paranoid':![],'indexes':[{'fields':[_0x91b8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index d683d77..e518f5b 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 _0x5c73=['raw','debug','UpdateVoiceDialReport','update','body','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','options'];(function(_0x15cf5c,_0xedf729){var _0x1655cf=function(_0x47af64){while(--_0x47af64){_0x15cf5c['push'](_0x15cf5c['shift']());}};_0x1655cf(++_0xedf729);}(_0x5c73,0x1e6));var _0x35c7=function(_0x52521a,_0x4d8695){_0x52521a=_0x52521a-0x0;var _0x209908=_0x5c73[_0x52521a];return _0x209908;};'use strict';var _=require(_0x35c7('0x0'));var util=require(_0x35c7('0x1'));var moment=require(_0x35c7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35c7('0x3'));var db=require(_0x35c7('0x4'))['db'];var utils=require(_0x35c7('0x5'));var logger=require(_0x35c7('0x6'))(_0x35c7('0x7'));var config=require(_0x35c7('0x8'));var jayson=require(_0x35c7('0x9'));var client=jayson['client'][_0x35c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa7e0f5,_0x425325,_0x46c4ab){return new BPromise(function(_0x1ad16f,_0x455fc4){return client[_0x35c7('0xb')](_0xa7e0f5,_0x46c4ab)[_0x35c7('0xc')](function(_0xb54abe){logger[_0x35c7('0xd')](_0x35c7('0xe'),_0x425325,_0x35c7('0xf'));logger['debug'](_0x35c7('0x10'),_0x425325,'request\x20sent',JSON[_0x35c7('0x11')](_0xb54abe));if(_0xb54abe[_0x35c7('0x12')]){if(_0xb54abe[_0x35c7('0x12')][_0x35c7('0x13')]===0x1f4){logger['error'](_0x35c7('0xe'),_0x425325,_0xb54abe[_0x35c7('0x12')][_0x35c7('0x14')]);return _0x455fc4(_0xb54abe[_0x35c7('0x12')][_0x35c7('0x14')]);}logger[_0x35c7('0x12')](_0x35c7('0xe'),_0x425325,_0xb54abe['error'][_0x35c7('0x14')]);return _0x1ad16f(_0xb54abe[_0x35c7('0x12')][_0x35c7('0x14')]);}else{logger[_0x35c7('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x425325,_0x35c7('0xf'));_0x1ad16f(_0xb54abe[_0x35c7('0x15')]['message']);}})[_0x35c7('0x16')](function(_0x1f314c){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x425325,_0x1f314c);_0x455fc4(_0x1f314c);});});}exports[_0x35c7('0x17')]=function(_0x402ca7){var _0x2a4094=this;return new Promise(function(_0x4edb6e,_0x531846){return db[_0x35c7('0x18')]['create'](_0x402ca7['body'],{'raw':_0x402ca7[_0x35c7('0x19')]?_0x402ca7['options'][_0x35c7('0x1a')]===undefined?!![]:![]:!![]})[_0x35c7('0xc')](function(_0x1f3174){logger['info']('CreateVoiceDialReport',_0x402ca7);logger[_0x35c7('0x1b')]('CreateVoiceDialReport',_0x402ca7,JSON[_0x35c7('0x11')](_0x1f3174));_0x4edb6e(_0x1f3174);})[_0x35c7('0x16')](function(_0x165917){logger[_0x35c7('0x12')]('CreateVoiceDialReport',_0x165917[_0x35c7('0x14')],_0x402ca7);_0x531846(_0x2a4094[_0x35c7('0x12')](0x1f4,_0x165917[_0x35c7('0x14')]));});});};exports[_0x35c7('0x1c')]=function(_0x2e8062){var _0x451978=this;return new Promise(function(_0x3c59c9,_0x5de92a){return db[_0x35c7('0x18')][_0x35c7('0x1d')](_0x2e8062[_0x35c7('0x1e')],{'raw':_0x2e8062[_0x35c7('0x19')]?_0x2e8062[_0x35c7('0x19')][_0x35c7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e8062[_0x35c7('0x19')]?_0x2e8062[_0x35c7('0x19')]['where']||null:null,'attributes':_0x2e8062[_0x35c7('0x19')]?_0x2e8062[_0x35c7('0x19')]['attributes']||null:null,'limit':_0x2e8062[_0x35c7('0x19')]?_0x2e8062[_0x35c7('0x19')][_0x35c7('0x1f')]||null:null})[_0x35c7('0xc')](function(_0x194e59){logger[_0x35c7('0xd')](_0x35c7('0x1c'),_0x2e8062);logger[_0x35c7('0x1b')](_0x35c7('0x1c'),_0x2e8062,JSON[_0x35c7('0x11')](_0x194e59));_0x3c59c9(_0x194e59);})[_0x35c7('0x16')](function(_0x1c0bcb){logger[_0x35c7('0x12')](_0x35c7('0x1c'),_0x1c0bcb[_0x35c7('0x14')],_0x2e8062);_0x5de92a(_0x451978[_0x35c7('0x12')](0x1f4,_0x1c0bcb['message']));});});}; \ No newline at end of file +var _0x24eb=['body','options','raw','UpdateVoiceDialReport','VoiceDialReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateVoiceDialReport','create'];(function(_0x103259,_0x5abd2b){var _0x52c9d1=function(_0xe1e0cd){while(--_0xe1e0cd){_0x103259['push'](_0x103259['shift']());}};_0x52c9d1(++_0x5abd2b);}(_0x24eb,0x108));var _0xb24e=function(_0x526aaf,_0x3284ca){_0x526aaf=_0x526aaf-0x0;var _0x184067=_0x24eb[_0x526aaf];return _0x184067;};'use strict';var _=require(_0xb24e('0x0'));var util=require(_0xb24e('0x1'));var moment=require(_0xb24e('0x2'));var BPromise=require(_0xb24e('0x3'));var rs=require(_0xb24e('0x4'));var fs=require('fs');var Redis=require(_0xb24e('0x5'));var db=require(_0xb24e('0x6'))['db'];var utils=require(_0xb24e('0x7'));var logger=require(_0xb24e('0x8'))(_0xb24e('0x9'));var config=require(_0xb24e('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb24e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e0a5a,_0x18a334,_0x5928c2){return new BPromise(function(_0x235627,_0x590fd3){return client['request'](_0x4e0a5a,_0x5928c2)[_0xb24e('0xc')](function(_0x4a275b){logger[_0xb24e('0xd')](_0xb24e('0xe'),_0x18a334,_0xb24e('0xf'));logger[_0xb24e('0x10')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x18a334,_0xb24e('0xf'),JSON[_0xb24e('0x11')](_0x4a275b));if(_0x4a275b[_0xb24e('0x12')]){if(_0x4a275b[_0xb24e('0x12')][_0xb24e('0x13')]===0x1f4){logger[_0xb24e('0x12')](_0xb24e('0xe'),_0x18a334,_0x4a275b[_0xb24e('0x12')][_0xb24e('0x14')]);return _0x590fd3(_0x4a275b[_0xb24e('0x12')]['message']);}logger[_0xb24e('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x18a334,_0x4a275b['error'][_0xb24e('0x14')]);return _0x235627(_0x4a275b['error'][_0xb24e('0x14')]);}else{logger[_0xb24e('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x18a334,_0xb24e('0xf'));_0x235627(_0x4a275b['result']['message']);}})[_0xb24e('0x15')](function(_0x4c78de){logger[_0xb24e('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x18a334,_0x4c78de);_0x590fd3(_0x4c78de);});});}exports[_0xb24e('0x16')]=function(_0x496d96){var _0x1c7f96=this;return new Promise(function(_0x4c5f39,_0x47bce3){return db['VoiceDialReport'][_0xb24e('0x17')](_0x496d96[_0xb24e('0x18')],{'raw':_0x496d96[_0xb24e('0x19')]?_0x496d96[_0xb24e('0x19')][_0xb24e('0x1a')]===undefined?!![]:![]:!![]})[_0xb24e('0xc')](function(_0x3aea3f){logger[_0xb24e('0xd')](_0xb24e('0x16'),_0x496d96);logger['debug'](_0xb24e('0x16'),_0x496d96,JSON[_0xb24e('0x11')](_0x3aea3f));_0x4c5f39(_0x3aea3f);})[_0xb24e('0x15')](function(_0x112d2e){logger[_0xb24e('0x12')](_0xb24e('0x16'),_0x112d2e[_0xb24e('0x14')],_0x496d96);_0x47bce3(_0x1c7f96[_0xb24e('0x12')](0x1f4,_0x112d2e[_0xb24e('0x14')]));});});};exports[_0xb24e('0x1b')]=function(_0x30492d){var _0x532648=this;return new Promise(function(_0x4df1fa,_0x5e972b){return db[_0xb24e('0x1c')]['update'](_0x30492d[_0xb24e('0x18')],{'raw':_0x30492d[_0xb24e('0x19')]?_0x30492d[_0xb24e('0x19')][_0xb24e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30492d[_0xb24e('0x19')]?_0x30492d[_0xb24e('0x19')][_0xb24e('0x1d')]||null:null,'attributes':_0x30492d['options']?_0x30492d[_0xb24e('0x19')][_0xb24e('0x1e')]||null:null,'limit':_0x30492d[_0xb24e('0x19')]?_0x30492d['options'][_0xb24e('0x1f')]||null:null})[_0xb24e('0xc')](function(_0x2d6d8d){logger[_0xb24e('0xd')](_0xb24e('0x1b'),_0x30492d);logger[_0xb24e('0x10')](_0xb24e('0x1b'),_0x30492d,JSON[_0xb24e('0x11')](_0x2d6d8d));_0x4df1fa(_0x2d6d8d);})[_0xb24e('0x15')](function(_0x36d4d9){logger[_0xb24e('0x12')](_0xb24e('0x1b'),_0x36d4d9['message'],_0x30492d);_0x5e972b(_0x532648[_0xb24e('0x12')](0x1f4,_0x36d4d9[_0xb24e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a94803f..4f9b8d2 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 _0x4df0=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get','/:id','show','post','create','/:id/applications','addApplications','put','update','delete','exports','util'];(function(_0x448b4d,_0x95f90d){var _0x1f7948=function(_0x49b192){while(--_0x49b192){_0x448b4d['push'](_0x448b4d['shift']());}};_0x1f7948(++_0x95f90d);}(_0x4df0,0xa0));var _0x04df=function(_0x2d1eff,_0x1fd1d2){_0x2d1eff=_0x2d1eff-0x0;var _0x40435f=_0x4df0[_0x2d1eff];return _0x40435f;};'use strict';var multer=require('multer');var util=require(_0x04df('0x0'));var path=require(_0x04df('0x1'));var timeout=require(_0x04df('0x2'));var express=require(_0x04df('0x3'));var router=express[_0x04df('0x4')]();var fs_extra=require(_0x04df('0x5'));var auth=require(_0x04df('0x6'));var interaction=require(_0x04df('0x7'));var config=require(_0x04df('0x8'));var controller=require(_0x04df('0x9'));router['get']('/',auth[_0x04df('0xa')](),controller[_0x04df('0xb')]);router[_0x04df('0xc')](_0x04df('0xd'),auth[_0x04df('0xa')](),controller[_0x04df('0xe')]);router[_0x04df('0xf')]('/',auth[_0x04df('0xa')](),controller[_0x04df('0x10')]);router[_0x04df('0xf')](_0x04df('0x11'),auth[_0x04df('0xa')](),controller[_0x04df('0x12')]);router[_0x04df('0x13')](_0x04df('0xd'),auth[_0x04df('0xa')](),controller[_0x04df('0x14')]);router[_0x04df('0x15')](_0x04df('0xd'),auth[_0x04df('0xa')](),controller['destroy']);module[_0x04df('0x16')]=router; \ No newline at end of file +var _0x1002=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','create','/:id/applications','addApplications','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1002,0x128));var _0x2100=function(_0x3bbe82,_0x11c886){_0x3bbe82=_0x3bbe82-0x0;var _0x5d1da9=_0x1002[_0x3bbe82];return _0x5d1da9;};'use strict';var multer=require('multer');var util=require(_0x2100('0x0'));var path=require('path');var timeout=require(_0x2100('0x1'));var express=require(_0x2100('0x2'));var router=express[_0x2100('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2100('0x4'));var interaction=require(_0x2100('0x5'));var config=require(_0x2100('0x6'));var controller=require(_0x2100('0x7'));router[_0x2100('0x8')]('/',auth[_0x2100('0x9')](),controller[_0x2100('0xa')]);router[_0x2100('0x8')](_0x2100('0xb'),auth[_0x2100('0x9')](),controller['show']);router[_0x2100('0xc')]('/',auth[_0x2100('0x9')](),controller[_0x2100('0xd')]);router['post'](_0x2100('0xe'),auth[_0x2100('0x9')](),controller[_0x2100('0xf')]);router['put'](_0x2100('0xb'),auth[_0x2100('0x9')](),controller[_0x2100('0x10')]);router[_0x2100('0x11')](_0x2100('0xb'),auth[_0x2100('0x9')](),controller[_0x2100('0x12')]);module[_0x2100('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 3907866..9b44a87 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 _0xcf42=['sequelize','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','outbound-fax','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten'];(function(_0x373f3c,_0x44e12b){var _0x555326=function(_0x5dd8d9){while(--_0x5dd8d9){_0x373f3c['push'](_0x373f3c['shift']());}};_0x555326(++_0x44e12b);}(_0xcf42,0x110));var _0x2cf4=function(_0x2d0a19,_0x56979d){_0x2d0a19=_0x2d0a19-0x0;var _0x547957=_0xcf42[_0x2d0a19];return _0x547957;};'use strict';var Sequelize=require(_0x2cf4('0x0'));module[_0x2cf4('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2cf4('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x2cf4('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x2cf4('0x3')],'allowNull':![],'defaultValue':_0x2cf4('0x4')},'appdata':{'type':Sequelize[_0x2cf4('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x2cf4('0x5')](_0x2cf4('0x6'),_0x2cf4('0x7'),_0x2cf4('0x8'),'inbound-fax',_0x2cf4('0x9'),'system','any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2cf4('0x3')],'allowNull':![],'defaultValue':_0x2cf4('0xa')},'IntervalId':{'type':Sequelize[_0x2cf4('0xb')]},'isApp':{'type':Sequelize[_0x2cf4('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x2cf4('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x2cf4('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x2cf4('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x2cf4('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x2cf4('0xd')},'answer':{'type':Sequelize[_0x2cf4('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x2cf4('0xe')],'get':function(_0x4c1bcf){return this[_0x2cf4('0xf')](_0x2cf4('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x98f0=['inbound','inbound-fax','outbound-fax','system','any','BOOLEAN','INTEGER','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM'];(function(_0x2b9f34,_0x2775b3){var _0x5597e1=function(_0x263e4e){while(--_0x263e4e){_0x2b9f34['push'](_0x2b9f34['shift']());}};_0x5597e1(++_0x2775b3);}(_0x98f0,0x14e));var _0x098f=function(_0x5c24c7,_0xcb8cdd){_0x5c24c7=_0x5c24c7-0x0;var _0x14b827=_0x98f0[_0x5c24c7];return _0x14b827;};'use strict';var Sequelize=require(_0x098f('0x0'));module[_0x098f('0x1')]={'context':{'type':Sequelize[_0x098f('0x2')],'allowNull':![],'unique':_0x098f('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x098f('0x2')],'allowNull':![],'unique':_0x098f('0x3')},'priority':{'type':Sequelize[_0x098f('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x098f('0x3')},'tag':{'type':Sequelize[_0x098f('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x098f('0x2')],'allowNull':![],'defaultValue':_0x098f('0x4')},'appdata':{'type':Sequelize[_0x098f('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x098f('0x5')](_0x098f('0x6'),'outbound','internal',_0x098f('0x7'),_0x098f('0x8'),_0x098f('0x9'),_0x098f('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x098f('0x2')]},'interval':{'type':Sequelize[_0x098f('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x098f('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x098f('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x098f('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x098f('0xd')},'answer':{'type':Sequelize[_0x098f('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x098f('0xe')],'get':function(_0x5e2a){return this[_0x098f('0xf')](_0x098f('0x10'));}},'alias':{'type':Sequelize[_0x098f('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 8eae701..3ed713e 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 _0x10ce=['UserProfileResource','update','context','recordingFormat','cutdigits','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','finally','lodash','../../components/parsers/qs','../../config/logger','api','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','type','find','then','error','name','send','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','options','VoiceExtension','includeAll','include','findAll','rows','show','params','catch','create','body','startsWith','exten','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','UserProfileSection','autoAssociation'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x10ce,0x1da));var _0xe10c=function(_0x4bd748,_0x2f731d){_0x4bd748=_0x4bd748-0x0;var _0x3c9e26=_0x10ce[_0x4bd748];return _0x3c9e26;};'use strict';var _=require(_0xe10c('0x0'));var Redis=require('ioredis');var qs=require(_0xe10c('0x1'));var logger=require(_0xe10c('0x2'))(_0xe10c('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xe10c('0x4')](config[_0xe10c('0x5')],{'host':_0xe10c('0x6'),'port':0x18eb});var socket=require(_0xe10c('0x7'))(new Redis(config[_0xe10c('0x5')]));require(_0xe10c('0x8'))[_0xe10c('0x9')](socket);function respondWithStatusCode(_0x3354dc,_0x13a764){_0x13a764=_0x13a764||0xcc;return function(_0x107d72){if(_0x107d72){return _0x3354dc[_0xe10c('0xa')](_0x13a764);}return _0x3354dc[_0xe10c('0xb')](_0x13a764)[_0xe10c('0xc')]();};}function respondWithResult(_0x589e02,_0x15b938){_0x15b938=_0x15b938||0xc8;return function(_0x336b35){if(_0x336b35){return _0x589e02[_0xe10c('0xb')](_0x15b938)[_0xe10c('0xd')](_0x336b35);}};}function respondWithFilteredResult(_0x3cabac,_0x33da75){return function(_0x5126fa){if(_0x5126fa){var _0x419d55=typeof _0x33da75[_0xe10c('0xe')]===_0xe10c('0xf')&&typeof _0x33da75[_0xe10c('0x10')]===_0xe10c('0xf');var _0x2b5d87=_0x5126fa['count'];var _0x158ef1=_0x419d55?0x0:_0x33da75['offset'];var _0x5d5b62=_0x419d55?_0x5126fa[_0xe10c('0x11')]:_0x33da75[_0xe10c('0xe')]+_0x33da75[_0xe10c('0x10')];var _0x87d967;if(_0x5d5b62>=_0x2b5d87){_0x5d5b62=_0x2b5d87;_0x87d967=0xc8;}else{_0x87d967=0xce;}_0x3cabac[_0xe10c('0xb')](_0x87d967);return _0x3cabac[_0xe10c('0x12')](_0xe10c('0x13'),_0x158ef1+'-'+_0x5d5b62+'/'+_0x2b5d87)[_0xe10c('0xd')](_0x5126fa);}return null;};}function removeEntity(_0x32cf19){return function(_0x57f7b1){if(_0x57f7b1){return _0x57f7b1[_0xe10c('0x14')]()['then'](function(){var _0x2b26ba=_0x57f7b1['get']({'plain':!![]});var _0x2c030b=[{'name':'InboundRoutes','value':_0xe10c('0x15'),'ignore':![]},{'name':_0xe10c('0x16'),'value':_0xe10c('0x17'),'ignore':![]},{'name':_0xe10c('0x18'),'value':_0xe10c('0x19'),'ignore':![]}];var _0x28793c=_(_0x2c030b)[_0xe10c('0x1a')](_0xe10c('0x1b'))[_0xe10c('0x1c')](_0xe10c('0x1d'))[_0xe10c('0x1d')]();if(_['includes'](_0x28793c,_0x2b26ba[_0xe10c('0x1e')])){return;}var _0x4cc3b0=_[_0xe10c('0x1f')](_0x2c030b,[_0xe10c('0x1d'),_0x2b26ba[_0xe10c('0x1e')]])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x4cc3b0,'resourceId':_0x2b26ba['id']}})[_0xe10c('0x20')](function(){return _0x57f7b1;});})['then'](function(){_0x32cf19[_0xe10c('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x376311){return function(_0x28a7b4){if(!_0x28a7b4){_0x376311['sendStatus'](0x194);}return _0x28a7b4;};}function handleError(_0x56f50a,_0x75824b){_0x75824b=_0x75824b||0x1f4;return function(_0x57fba0){logger[_0xe10c('0x21')](_0x57fba0['stack']);if(_0x57fba0[_0xe10c('0x22')]){delete _0x57fba0['name'];}_0x56f50a[_0xe10c('0xb')](_0x75824b)[_0xe10c('0x23')](_0x57fba0);};}exports['index']=function(_0x1e7119,_0x1f47a9){var _0x4737ba={},_0x256312={},_0xcbfae2={'count':0x0,'rows':[]};var _0x3fa8aa=_['map'](db['VoiceExtension'][_0xe10c('0x24')],function(_0x57d5c6){return{'name':_0x57d5c6[_0xe10c('0x25')],'type':_0x57d5c6[_0xe10c('0x1e')][_0xe10c('0x26')]};});_0x256312[_0xe10c('0x27')]=_[_0xe10c('0x1c')](_0x3fa8aa,_0xe10c('0x22'));_0x256312['query']=_[_0xe10c('0x28')](_0x1e7119['query']);_0x256312[_0xe10c('0x29')]=_[_0xe10c('0x2a')](_0x256312[_0xe10c('0x27')],_0x256312[_0xe10c('0x2b')]);_0x4737ba[_0xe10c('0x2c')]=_['intersection'](_0x256312['model'],qs[_0xe10c('0x2d')](_0x1e7119[_0xe10c('0x2b')]['fields']));_0x4737ba[_0xe10c('0x2c')]=_0x4737ba['attributes'][_0xe10c('0x2e')]?_0x4737ba['attributes']:_0x256312[_0xe10c('0x27')];if(!_0x1e7119[_0xe10c('0x2b')][_0xe10c('0x2f')]('nolimit')){_0x4737ba['limit']=qs['limit'](_0x1e7119[_0xe10c('0x2b')]['limit']);_0x4737ba['offset']=qs[_0xe10c('0xe')](_0x1e7119[_0xe10c('0x2b')][_0xe10c('0xe')]);}_0x4737ba[_0xe10c('0x30')]=qs['sort'](_0x1e7119[_0xe10c('0x2b')][_0xe10c('0x31')]);_0x4737ba[_0xe10c('0x32')]=qs['filters'](_[_0xe10c('0x33')](_0x1e7119[_0xe10c('0x2b')],_0x256312[_0xe10c('0x29')]),_0x3fa8aa);if(_0x1e7119[_0xe10c('0x2b')]['filter']){_0x4737ba[_0xe10c('0x32')]=_[_0xe10c('0x34')](_0x4737ba[_0xe10c('0x32')],{'$or':_['map'](_0x3fa8aa,function(_0x30811b){if(_0x30811b[_0xe10c('0x1e')]!=='VIRTUAL'){var _0x1aa04d={};_0x1aa04d[_0x30811b['name']]={'$like':'%'+_0x1e7119[_0xe10c('0x2b')]['filter']+'%'};return _0x1aa04d;}})});}_0x4737ba=_['merge']({},_0x4737ba,_0x1e7119[_0xe10c('0x35')]);var _0x26ace8={'where':_0x4737ba[_0xe10c('0x32')]};return db[_0xe10c('0x36')]['count'](_0x26ace8)['then'](function(_0x59434f){_0xcbfae2[_0xe10c('0x11')]=_0x59434f;if(_0x1e7119[_0xe10c('0x2b')][_0xe10c('0x37')]){_0x4737ba[_0xe10c('0x38')]=[{'all':!![]}];}return db[_0xe10c('0x36')][_0xe10c('0x39')](_0x4737ba);})[_0xe10c('0x20')](function(_0x58311b){_0xcbfae2[_0xe10c('0x3a')]=_0x58311b;return _0xcbfae2;})[_0xe10c('0x20')](respondWithFilteredResult(_0x1f47a9,_0x4737ba))['catch'](handleError(_0x1f47a9,null));};exports[_0xe10c('0x3b')]=function(_0x7e9c3b,_0x2809c7){var _0x31fe00={'raw':![],'where':{'id':_0x7e9c3b[_0xe10c('0x3c')]['id']}},_0xa31a08={};_0xa31a08['model']=_[_0xe10c('0x28')](db['VoiceExtension'][_0xe10c('0x24')]);_0xa31a08[_0xe10c('0x2b')]=_[_0xe10c('0x28')](_0x7e9c3b[_0xe10c('0x2b')]);_0xa31a08[_0xe10c('0x29')]=_['intersection'](_0xa31a08[_0xe10c('0x27')],_0xa31a08[_0xe10c('0x2b')]);_0x31fe00[_0xe10c('0x2c')]=_[_0xe10c('0x2a')](_0xa31a08[_0xe10c('0x27')],qs[_0xe10c('0x2d')](_0x7e9c3b[_0xe10c('0x2b')][_0xe10c('0x2d')]));_0x31fe00['attributes']=_0x31fe00[_0xe10c('0x2c')][_0xe10c('0x2e')]?_0x31fe00[_0xe10c('0x2c')]:_0xa31a08[_0xe10c('0x27')];if(_0x7e9c3b[_0xe10c('0x2b')][_0xe10c('0x37')]){_0x31fe00[_0xe10c('0x38')]=[{'all':!![]}];}_0x31fe00=_['merge']({},_0x31fe00,_0x7e9c3b[_0xe10c('0x35')]);return db['VoiceExtension'][_0xe10c('0x1f')](_0x31fe00)[_0xe10c('0x20')](handleEntityNotFound(_0x2809c7,null))[_0xe10c('0x20')](respondWithResult(_0x2809c7,null))['catch'](handleError(_0x2809c7,null));};exports[_0xe10c('0x14')]=function(_0x2585fb,_0xdca8ac){return db[_0xe10c('0x36')][_0xe10c('0x1f')]({'where':{'id':_0x2585fb[_0xe10c('0x3c')]['id']}})[_0xe10c('0x20')](handleEntityNotFound(_0xdca8ac,null))['then'](removeEntity(_0xdca8ac,null))[_0xe10c('0x3d')](handleError(_0xdca8ac,null));};exports[_0xe10c('0x3e')]=function(_0x4c587c,_0x29c0fb){if(_0x4c587c[_0xe10c('0x3f')]['type']===_0xe10c('0x17')&&!_[_0xe10c('0x40')](_0x4c587c['body'][_0xe10c('0x41')],'_')){_0x4c587c[_0xe10c('0x3f')][_0xe10c('0x41')]='_'['concat'](_0x4c587c[_0xe10c('0x3f')]['exten']);}return db[_0xe10c('0x36')][_0xe10c('0x3e')](_0x4c587c[_0xe10c('0x3f')],{'raw':![]})[_0xe10c('0x20')](function(_0x22c20f){var _0xd67aa5=_0x4c587c['user'][_0xe10c('0x42')]({'plain':!![]});if(!_0xd67aa5)throw new Error(_0xe10c('0x43'));if(_0xd67aa5[_0xe10c('0x44')]==='user'){var _0x2cea5b=_0x22c20f[_0xe10c('0x42')]({'plain':!![]});var _0x2f16a3=[{'name':_0xe10c('0x45'),'value':_0xe10c('0x15')},{'name':_0xe10c('0x16'),'value':_0xe10c('0x17')},{'name':_0xe10c('0x18'),'value':_0xe10c('0x19')}];var _0x26563f=_[_0xe10c('0x1f')](_0x2f16a3,['value',_0x2cea5b[_0xe10c('0x1e')]])[_0xe10c('0x22')];return db[_0xe10c('0x46')]['find']({'where':{'name':_0x26563f,'userProfileId':_0xd67aa5['userProfileId']},'raw':!![]})['then'](function(_0x5e0ba5){if(_0x5e0ba5&&_0x5e0ba5[_0xe10c('0x47')]===0x0){return db[_0xe10c('0x48')]['create']({'name':_0x2cea5b[_0xe10c('0x22')],'resourceId':_0x2cea5b['id'],'type':_0x5e0ba5[_0xe10c('0x22')],'sectionId':_0x5e0ba5['id']},{})[_0xe10c('0x20')](function(){return _0x22c20f;});}else{return _0x22c20f;}})[_0xe10c('0x3d')](function(_0xcedcb1){logger[_0xe10c('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcedcb1);throw _0xcedcb1;});}return _0x22c20f;})['then'](respondWithResult(_0x29c0fb,0xc9))[_0xe10c('0x3d')](handleError(_0x29c0fb,null));};exports['update']=function(_0x3e4cc2,_0x47b4f4){if(_0x3e4cc2[_0xe10c('0x3f')]['id']){delete _0x3e4cc2[_0xe10c('0x3f')]['id'];}return db['VoiceExtension'][_0xe10c('0x1f')]({'where':{'id':_0x3e4cc2[_0xe10c('0x3c')]['id']}})[_0xe10c('0x20')](handleEntityNotFound(_0x47b4f4,null))[_0xe10c('0x20')](function(_0x356037){if(_0x356037){return db[_0xe10c('0x36')][_0xe10c('0x49')](_[_0xe10c('0x33')](_0x3e4cc2[_0xe10c('0x3f')],[_0xe10c('0x41'),_0xe10c('0x4a'),'description',_0xe10c('0x4b'),_0xe10c('0x4c'),'mandatoryDisposition',_0xe10c('0x4d')]),{'where':{'context':_0x356037[_0xe10c('0x4a')],'exten':_0x356037[_0xe10c('0x41')]},'individualHooks':!![]})[_0xe10c('0x20')](function(_0x45659c){return _0x45659c;});}return null;})['then'](respondWithStatusCode(_0x47b4f4,null))[_0xe10c('0x3d')](handleError(_0x47b4f4,null));};exports[_0xe10c('0x4e')]=function(_0x1bfc7f,_0x11bd35){var _0x235e10=_0x1bfc7f[_0xe10c('0x3c')]['id'];var _0x1d4415=_0x1bfc7f['body'];var _0x3f0230=0xc8;var _0x153f7a=null;return db[_0xe10c('0x4f')]['transaction']({'isolationLevel':db['sequelize'][_0xe10c('0x50')][_0xe10c('0x51')][_0xe10c('0x52')]},function(_0x257606){return db[_0xe10c('0x36')][_0xe10c('0x53')]({'where':{'id':_0x235e10},'transaction':_0x257606})[_0xe10c('0x20')](function(_0x35f190){if(_0x35f190){return db[_0xe10c('0x36')][_0xe10c('0x14')]({'where':{'VoiceExtensionId':_0x235e10},'transaction':_0x257606})['then'](function(){var _0x16a17b=_[_0xe10c('0x1c')](_0x1d4415,function(_0x1f18e6){_0x1f18e6[_0xe10c('0x54')]=_0x235e10;_0x1f18e6['isApp']=!![];return _0x1f18e6;});return _0x35f190[_0xe10c('0x55')](_0x16a17b);})[_0xe10c('0x20')](function(_0x492759){return db['VoiceExtension'][_0xe10c('0x56')](_0x492759,{'transaction':_0x257606});});}else{_0x3f0230=0x194;_0x153f7a=[];}});})[_0xe10c('0x20')](function(){if(_0x3f0230!==0x194){return db['VoiceExtension'][_0xe10c('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x235e10},'order':_0xe10c('0x58')})[_0xe10c('0x20')](function(_0x258111){_0x153f7a=_0x258111;});}})[_0xe10c('0x3d')](function(_0x3c2bd8){_0x3f0230=0x1f4;logger['error'](_0x3c2bd8[_0xe10c('0x59')]);if(_0x3c2bd8[_0xe10c('0x22')]){delete _0x3c2bd8['name'];}_0x153f7a=_0x3c2bd8;})[_0xe10c('0x5a')](function(){if(_0x153f7a===null){_0x11bd35['sendStatus'](_0x3f0230);}else{if(_0x3f0230===0x1f4){_0x11bd35[_0xe10c('0xb')](_0x3f0230)[_0xe10c('0x23')](_0x153f7a);}else{_0x11bd35[_0xe10c('0xb')](_0x3f0230)[_0xe10c('0xd')](_0x153f7a);}}});}; \ No newline at end of file +var _0x38c6=['transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','type','name','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','include','findAll','show','params','includeAll','catch','find','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','sequelize'];(function(_0x54696a,_0x571132){var _0x1693bb=function(_0x10b9ce){while(--_0x10b9ce){_0x54696a['push'](_0x54696a['shift']());}};_0x1693bb(++_0x571132);}(_0x38c6,0x1e7));var _0x638c=function(_0x545b71,_0x4f44eb){_0x545b71=_0x545b71-0x0;var _0x26e587=_0x38c6[_0x545b71];return _0x26e587;};'use strict';var _=require(_0x638c('0x0'));var Redis=require('ioredis');var qs=require(_0x638c('0x1'));var logger=require(_0x638c('0x2'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x638c('0x3')]=_[_0x638c('0x4')](config[_0x638c('0x3')],{'host':_0x638c('0x5'),'port':0x18eb});var socket=require(_0x638c('0x6'))(new Redis(config['redis']));require(_0x638c('0x7'))[_0x638c('0x8')](socket);function respondWithStatusCode(_0x58db15,_0xf75adf){_0xf75adf=_0xf75adf||0xcc;return function(_0x5af13c){if(_0x5af13c){return _0x58db15[_0x638c('0x9')](_0xf75adf);}return _0x58db15[_0x638c('0xa')](_0xf75adf)[_0x638c('0xb')]();};}function respondWithResult(_0x3f1476,_0x55f0d5){_0x55f0d5=_0x55f0d5||0xc8;return function(_0x19261e){if(_0x19261e){return _0x3f1476[_0x638c('0xa')](_0x55f0d5)[_0x638c('0xc')](_0x19261e);}};}function respondWithFilteredResult(_0x124fb1,_0x3f4eff){return function(_0x296f9b){if(_0x296f9b){var _0x4245bf=typeof _0x3f4eff['offset']===_0x638c('0xd')&&typeof _0x3f4eff[_0x638c('0xe')]===_0x638c('0xd');var _0x31ee47=_0x296f9b[_0x638c('0xf')];var _0x3a2fc6=_0x4245bf?0x0:_0x3f4eff[_0x638c('0x10')];var _0x2aa921=_0x4245bf?_0x296f9b['count']:_0x3f4eff[_0x638c('0x10')]+_0x3f4eff['limit'];var _0x4822a3;if(_0x2aa921>=_0x31ee47){_0x2aa921=_0x31ee47;_0x4822a3=0xc8;}else{_0x4822a3=0xce;}_0x124fb1['status'](_0x4822a3);return _0x124fb1[_0x638c('0x11')](_0x638c('0x12'),_0x3a2fc6+'-'+_0x2aa921+'/'+_0x31ee47)[_0x638c('0xc')](_0x296f9b);}return null;};}function removeEntity(_0x205ed5){return function(_0x3b157b){if(_0x3b157b){return _0x3b157b[_0x638c('0x13')]()[_0x638c('0x14')](function(){var _0xb73713=_0x3b157b[_0x638c('0x15')]({'plain':!![]});var _0x491d88=[{'name':_0x638c('0x16'),'value':_0x638c('0x17'),'ignore':![]},{'name':_0x638c('0x18'),'value':_0x638c('0x19'),'ignore':![]},{'name':_0x638c('0x1a'),'value':_0x638c('0x1b'),'ignore':![]}];var _0x4a0851=_(_0x491d88)[_0x638c('0x1c')](_0x638c('0x1d'))[_0x638c('0x1e')](_0x638c('0x1f'))['value']();if(_['includes'](_0x4a0851,_0xb73713['type'])){return;}var _0x2211c7=_['find'](_0x491d88,[_0x638c('0x1f'),_0xb73713[_0x638c('0x20')]])[_0x638c('0x21')];return db['UserProfileResource'][_0x638c('0x13')]({'where':{'type':_0x2211c7,'resourceId':_0xb73713['id']}})[_0x638c('0x14')](function(){return _0x3b157b;});})['then'](function(){_0x205ed5[_0x638c('0xa')](0xcc)[_0x638c('0xb')]();});}};}function handleEntityNotFound(_0x3b22f2){return function(_0x46c141){if(!_0x46c141){_0x3b22f2[_0x638c('0x9')](0x194);}return _0x46c141;};}function handleError(_0x1b466a,_0x214e14){_0x214e14=_0x214e14||0x1f4;return function(_0x3d77e6){logger['error'](_0x3d77e6[_0x638c('0x22')]);if(_0x3d77e6[_0x638c('0x21')]){delete _0x3d77e6['name'];}_0x1b466a['status'](_0x214e14)[_0x638c('0x23')](_0x3d77e6);};}exports[_0x638c('0x24')]=function(_0x4e6470,_0x45f56e){var _0x13471a={},_0x120d6f={},_0x46e98f={'count':0x0,'rows':[]};var _0x438035=_[_0x638c('0x1e')](db[_0x638c('0x25')][_0x638c('0x26')],function(_0x263f24){return{'name':_0x263f24[_0x638c('0x27')],'type':_0x263f24[_0x638c('0x20')][_0x638c('0x28')]};});_0x120d6f[_0x638c('0x29')]=_[_0x638c('0x1e')](_0x438035,_0x638c('0x21'));_0x120d6f[_0x638c('0x2a')]=_[_0x638c('0x2b')](_0x4e6470['query']);_0x120d6f[_0x638c('0x2c')]=_[_0x638c('0x2d')](_0x120d6f[_0x638c('0x29')],_0x120d6f[_0x638c('0x2a')]);_0x13471a[_0x638c('0x2e')]=_['intersection'](_0x120d6f[_0x638c('0x29')],qs[_0x638c('0x2f')](_0x4e6470[_0x638c('0x2a')][_0x638c('0x2f')]));_0x13471a[_0x638c('0x2e')]=_0x13471a['attributes'][_0x638c('0x30')]?_0x13471a[_0x638c('0x2e')]:_0x120d6f[_0x638c('0x29')];if(!_0x4e6470[_0x638c('0x2a')][_0x638c('0x31')]('nolimit')){_0x13471a[_0x638c('0xe')]=qs['limit'](_0x4e6470[_0x638c('0x2a')][_0x638c('0xe')]);_0x13471a[_0x638c('0x10')]=qs[_0x638c('0x10')](_0x4e6470[_0x638c('0x2a')][_0x638c('0x10')]);}_0x13471a['order']=qs[_0x638c('0x32')](_0x4e6470[_0x638c('0x2a')][_0x638c('0x32')]);_0x13471a[_0x638c('0x33')]=qs[_0x638c('0x2c')](_[_0x638c('0x34')](_0x4e6470['query'],_0x120d6f['filters']),_0x438035);if(_0x4e6470[_0x638c('0x2a')]['filter']){_0x13471a[_0x638c('0x33')]=_[_0x638c('0x35')](_0x13471a[_0x638c('0x33')],{'$or':_[_0x638c('0x1e')](_0x438035,function(_0x43a478){if(_0x43a478['type']!==_0x638c('0x36')){var _0x557fce={};_0x557fce[_0x43a478['name']]={'$like':'%'+_0x4e6470[_0x638c('0x2a')][_0x638c('0x1c')]+'%'};return _0x557fce;}})});}_0x13471a=_[_0x638c('0x35')]({},_0x13471a,_0x4e6470[_0x638c('0x37')]);var _0x632f97={'where':_0x13471a[_0x638c('0x33')]};return db[_0x638c('0x25')][_0x638c('0xf')](_0x632f97)['then'](function(_0x1652cb){_0x46e98f[_0x638c('0xf')]=_0x1652cb;if(_0x4e6470[_0x638c('0x2a')]['includeAll']){_0x13471a[_0x638c('0x38')]=[{'all':!![]}];}return db['VoiceExtension'][_0x638c('0x39')](_0x13471a);})[_0x638c('0x14')](function(_0x216a32){_0x46e98f['rows']=_0x216a32;return _0x46e98f;})[_0x638c('0x14')](respondWithFilteredResult(_0x45f56e,_0x13471a))['catch'](handleError(_0x45f56e,null));};exports[_0x638c('0x3a')]=function(_0x23d74e,_0x2e9ce7){var _0x16e0a5={'raw':![],'where':{'id':_0x23d74e[_0x638c('0x3b')]['id']}},_0x189269={};_0x189269[_0x638c('0x29')]=_['keys'](db[_0x638c('0x25')][_0x638c('0x26')]);_0x189269[_0x638c('0x2a')]=_[_0x638c('0x2b')](_0x23d74e['query']);_0x189269[_0x638c('0x2c')]=_[_0x638c('0x2d')](_0x189269[_0x638c('0x29')],_0x189269[_0x638c('0x2a')]);_0x16e0a5[_0x638c('0x2e')]=_[_0x638c('0x2d')](_0x189269[_0x638c('0x29')],qs['fields'](_0x23d74e['query']['fields']));_0x16e0a5['attributes']=_0x16e0a5[_0x638c('0x2e')][_0x638c('0x30')]?_0x16e0a5[_0x638c('0x2e')]:_0x189269[_0x638c('0x29')];if(_0x23d74e['query'][_0x638c('0x3c')]){_0x16e0a5[_0x638c('0x38')]=[{'all':!![]}];}_0x16e0a5=_['merge']({},_0x16e0a5,_0x23d74e['options']);return db[_0x638c('0x25')]['find'](_0x16e0a5)['then'](handleEntityNotFound(_0x2e9ce7,null))[_0x638c('0x14')](respondWithResult(_0x2e9ce7,null))[_0x638c('0x3d')](handleError(_0x2e9ce7,null));};exports[_0x638c('0x13')]=function(_0x225c16,_0x562c03){return db[_0x638c('0x25')][_0x638c('0x3e')]({'where':{'id':_0x225c16['params']['id']}})[_0x638c('0x14')](handleEntityNotFound(_0x562c03,null))['then'](removeEntity(_0x562c03,null))[_0x638c('0x3d')](handleError(_0x562c03,null));};exports[_0x638c('0x3f')]=function(_0x4119b5,_0x490eef){if(_0x4119b5[_0x638c('0x40')]['type']==='outbound'&&!_[_0x638c('0x41')](_0x4119b5['body'][_0x638c('0x42')],'_')){_0x4119b5[_0x638c('0x40')][_0x638c('0x42')]='_'[_0x638c('0x43')](_0x4119b5['body']['exten']);}return db['VoiceExtension'][_0x638c('0x3f')](_0x4119b5[_0x638c('0x40')],{'raw':![]})[_0x638c('0x14')](function(_0x67e541){var _0x5d3d2a=_0x4119b5[_0x638c('0x44')][_0x638c('0x15')]({'plain':!![]});if(!_0x5d3d2a)throw new Error(_0x638c('0x45'));if(_0x5d3d2a[_0x638c('0x46')]===_0x638c('0x44')){var _0x524761=_0x67e541[_0x638c('0x15')]({'plain':!![]});var _0x52ea32=[{'name':_0x638c('0x16'),'value':_0x638c('0x17')},{'name':'OutboundRoutes','value':_0x638c('0x19')},{'name':_0x638c('0x1a'),'value':'internal'}];var _0x1d3d09=_[_0x638c('0x3e')](_0x52ea32,[_0x638c('0x1f'),_0x524761[_0x638c('0x20')]])[_0x638c('0x21')];return db['UserProfileSection'][_0x638c('0x3e')]({'where':{'name':_0x1d3d09,'userProfileId':_0x5d3d2a[_0x638c('0x47')]},'raw':!![]})[_0x638c('0x14')](function(_0x215d98){if(_0x215d98&&_0x215d98[_0x638c('0x48')]===0x0){return db['UserProfileResource'][_0x638c('0x3f')]({'name':_0x524761['name'],'resourceId':_0x524761['id'],'type':_0x215d98['name'],'sectionId':_0x215d98['id']},{})[_0x638c('0x14')](function(){return _0x67e541;});}else{return _0x67e541;}})[_0x638c('0x3d')](function(_0x20a27c){logger[_0x638c('0x49')](_0x638c('0x4a'),_0x20a27c);throw _0x20a27c;});}return _0x67e541;})[_0x638c('0x14')](respondWithResult(_0x490eef,0xc9))[_0x638c('0x3d')](handleError(_0x490eef,null));};exports[_0x638c('0x4b')]=function(_0x3407db,_0x2ba836){if(_0x3407db[_0x638c('0x40')]['id']){delete _0x3407db[_0x638c('0x40')]['id'];}return db[_0x638c('0x25')]['find']({'where':{'id':_0x3407db[_0x638c('0x3b')]['id']}})[_0x638c('0x14')](handleEntityNotFound(_0x2ba836,null))['then'](function(_0x2709d7){if(_0x2709d7){return db[_0x638c('0x25')][_0x638c('0x4b')](_['pick'](_0x3407db['body'],[_0x638c('0x42'),_0x638c('0x4c'),_0x638c('0x4d'),_0x638c('0x4e'),_0x638c('0x4f'),_0x638c('0x50'),_0x638c('0x51')]),{'where':{'context':_0x2709d7[_0x638c('0x4c')],'exten':_0x2709d7['exten']},'individualHooks':!![]})['then'](function(_0x452f6b){return _0x452f6b;});}return null;})[_0x638c('0x14')](respondWithStatusCode(_0x2ba836,null))[_0x638c('0x3d')](handleError(_0x2ba836,null));};exports['addApplications']=function(_0x5d6272,_0x992fa){var _0x2c4cac=_0x5d6272[_0x638c('0x3b')]['id'];var _0x1ccd12=_0x5d6272[_0x638c('0x40')];var _0x363642=0xc8;var _0x416c15=null;return db[_0x638c('0x52')][_0x638c('0x53')]({'isolationLevel':db['sequelize'][_0x638c('0x54')][_0x638c('0x55')][_0x638c('0x56')]},function(_0x1124fc){return db[_0x638c('0x25')][_0x638c('0x57')]({'where':{'id':_0x2c4cac},'transaction':_0x1124fc})[_0x638c('0x14')](function(_0x3539ef){if(_0x3539ef){return db[_0x638c('0x25')][_0x638c('0x13')]({'where':{'VoiceExtensionId':_0x2c4cac},'transaction':_0x1124fc})[_0x638c('0x14')](function(){var _0x126896=_['map'](_0x1ccd12,function(_0xecd786){_0xecd786[_0x638c('0x58')]=_0x2c4cac;_0xecd786[_0x638c('0x59')]=!![];return _0xecd786;});return _0x3539ef[_0x638c('0x5a')](_0x126896);})[_0x638c('0x14')](function(_0x2bd53a){return db[_0x638c('0x25')][_0x638c('0x5b')](_0x2bd53a,{'transaction':_0x1124fc});});}else{_0x363642=0x194;_0x416c15=[];}});})[_0x638c('0x14')](function(){if(_0x363642!==0x194){return db[_0x638c('0x25')][_0x638c('0x5c')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2c4cac},'order':_0x638c('0x5d')})[_0x638c('0x14')](function(_0x17301b){_0x416c15=_0x17301b;});}})[_0x638c('0x3d')](function(_0x2b0f14){_0x363642=0x1f4;logger[_0x638c('0x49')](_0x2b0f14[_0x638c('0x22')]);if(_0x2b0f14[_0x638c('0x21')]){delete _0x2b0f14['name'];}_0x416c15=_0x2b0f14;})[_0x638c('0x5e')](function(){if(_0x416c15===null){_0x992fa[_0x638c('0x9')](_0x363642);}else{if(_0x363642===0x1f4){_0x992fa[_0x638c('0xa')](_0x363642)[_0x638c('0x23')](_0x416c15);}else{_0x992fa['status'](_0x363642)['json'](_0x416c15);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 45e090c..4470dad 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 _0xdb63=['setMaxListeners','save','remove','hook','exports','../../mysqldb','VoiceExtension'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xdb63,0x91));var _0x3db6=function(_0x3cea2d,_0x4fa55f){_0x3cea2d=_0x3cea2d-0x0;var _0xe2dd15=_0xdb63[_0x3cea2d];return _0xe2dd15;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x3db6('0x0'))['db'][_0x3db6('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x3db6('0x2')](0x0);var events={'afterCreate':_0x3db6('0x3'),'afterUpdate':'update','afterDestroy':_0x3db6('0x4')};function emitEvent(_0x4ab28d){return function(_0x438311,_0x3b927c,_0x104f33){VoiceExtensionEvents['emit'](_0x4ab28d+':'+_0x438311['id'],_0x438311);VoiceExtensionEvents['emit'](_0x4ab28d,_0x438311);_0x104f33(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x3db6('0x5')](e,emitEvent(event));}}module[_0x3db6('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0x2973=['../../mysqldb','setMaxListeners','save','remove','emit','exports','events'];(function(_0x2b804f,_0x4427eb){var _0x176d38=function(_0x32c3c0){while(--_0x32c3c0){_0x2b804f['push'](_0x2b804f['shift']());}};_0x176d38(++_0x4427eb);}(_0x2973,0x1b1));var _0x3297=function(_0x273fd1,_0x388bbe){_0x273fd1=_0x273fd1-0x0;var _0x5d3dbf=_0x2973[_0x273fd1];return _0x5d3dbf;};'use strict';var EventEmitter=require(_0x3297('0x0'));var VoiceExtension=require(_0x3297('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x3297('0x2')](0x0);var events={'afterCreate':_0x3297('0x3'),'afterUpdate':'update','afterDestroy':_0x3297('0x4')};function emitEvent(_0xeda45e){return function(_0x46161c,_0xb63348,_0x81d0b9){VoiceExtensionEvents[_0x3297('0x5')](_0xeda45e+':'+_0x46161c['id'],_0x46161c);VoiceExtensionEvents[_0x3297('0x5')](_0xeda45e,_0x46161c);_0x81d0b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x3297('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 09c0886..c08f700 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 _0x2297=['replace','isEmpty','Interval','findAll','interval','then','*,*,*,*','intervals','IntervalId','filter','hasOwnProperty','tag','toLowerCase','CDR(tag)=','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','playback','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','priority','concat','last','catch','get','Hangup','lodash','./voiceExtension.attributes','type','Set','CDR(type)=','context','exten','alias','NoOp','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','url','split','name','prefix','phone','param','trunk','join','options','indexOf','U(xcally-mixmonitor-context)'];(function(_0x4b9a8d,_0x12b15b){var _0x19c1d1=function(_0x218fde){while(--_0x218fde){_0x4b9a8d['push'](_0x4b9a8d['shift']());}};_0x19c1d1(++_0x12b15b);}(_0x2297,0x100));var _0x7229=function(_0xcf912,_0x17c335){_0xcf912=_0xcf912-0x0;var _0x483a88=_0x2297[_0xcf912];return _0x483a88;};'use strict';var _=require(_0x7229('0x0'));var attributes=require(_0x7229('0x1'));module['exports']=function(_0x236599){var _0x2a9636=_0x236599['models'];function _0x13b011(_0xeea970){var _0x18c8b5=0x2;var _0xfd6912=[{'type':_0xeea970[_0x7229('0x2')],'app':_0x7229('0x3'),'appdata':_0x7229('0x4')+_0xeea970[_0x7229('0x2')],'context':_0xeea970[_0x7229('0x5')],'exten':_0xeea970[_0x7229('0x6')],'priority':_0x18c8b5++,'VoiceExtensionId':_0xeea970['id']},{'type':_0xeea970[_0x7229('0x2')],'app':_0xeea970[_0x7229('0x7')]?_0x7229('0x3'):_0x7229('0x8'),'appdata':_0xeea970[_0x7229('0x7')]?'CDR(routeAlias)='+_0xeea970[_0x7229('0x7')]:'No\x20alias\x20set','context':_0xeea970[_0x7229('0x5')],'exten':_0xeea970[_0x7229('0x6')],'priority':_0x18c8b5++,'VoiceExtensionId':_0xeea970['id']}];if(_0xeea970['type']===_0x7229('0x9')){_0xfd6912[_0x7229('0xa')]({'type':_0x7229('0x9'),'app':_0x7229('0x3'),'appdata':'CDR(routeid)='+_0xeea970['id'],'context':_0xeea970['context'],'exten':_0xeea970[_0x7229('0x6')],'priority':_0x18c8b5++,'VoiceExtensionId':_0xeea970['id']});}_0xfd6912[_0x7229('0xa')]({'type':_0xeea970[_0x7229('0x2')],'app':_0x7229('0x3'),'appdata':_0x7229('0xb'),'context':_0xeea970[_0x7229('0x5')],'exten':_0xeea970['exten'],'priority':_0x18c8b5++,'VoiceExtensionId':_0xeea970['id']},{'type':_0xeea970[_0x7229('0x2')],'app':_0x7229('0x3'),'appdata':_0x7229('0xc'),'context':_0xeea970['context'],'exten':_0xeea970[_0x7229('0x6')],'priority':_0x18c8b5++,'VoiceExtensionId':_0xeea970['id']},{'type':_0xeea970[_0x7229('0x2')],'app':_0x7229('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0xeea970[_0x7229('0x5')],'exten':_0xeea970[_0x7229('0x6')],'priority':_0x18c8b5++,'VoiceExtensionId':_0xeea970['id']});return _0xfd6912;}function _0x561d6e(_0x3590b2){var _0x503a2b=0x2;var _0x4c61f6=[{'type':_0x7229('0xd'),'app':_0x7229('0x3'),'appdata':_0x7229('0xe'),'context':_0x3590b2[_0x7229('0x5')],'exten':_0x3590b2[_0x7229('0x6')],'priority':_0x503a2b++,'VoiceExtensionId':_0x3590b2['id']},{'type':'outbound','app':_0x3590b2[_0x7229('0x7')]?_0x7229('0x3'):_0x7229('0x8'),'appdata':_0x3590b2[_0x7229('0x7')]?'CDR(routeAlias)='+_0x3590b2[_0x7229('0x7')]:'No\x20alias\x20set','context':_0x3590b2[_0x7229('0x5')],'exten':_0x3590b2[_0x7229('0x6')],'priority':_0x503a2b++,'VoiceExtensionId':_0x3590b2['id']},{'type':_0x7229('0xd'),'app':'Set','appdata':_0x7229('0xf')+(_0x3590b2[_0x7229('0x10')]?_0x7229('0x11')+_0x3590b2[_0x7229('0x10')]+'}':_0x7229('0x12')),'context':_0x3590b2[_0x7229('0x5')],'exten':_0x3590b2[_0x7229('0x6')],'priority':_0x503a2b++,'VoiceExtensionId':_0x3590b2['id']},{'type':_0x7229('0xd'),'app':_0x7229('0x3'),'appdata':'CDR(routeid)='+_0x3590b2['id'],'context':_0x3590b2[_0x7229('0x5')],'exten':_0x3590b2[_0x7229('0x6')],'priority':_0x503a2b++,'VoiceExtensionId':_0x3590b2['id']},{'type':_0x7229('0xd'),'app':_0x7229('0x13'),'appdata':_0x7229('0x14')+(_0x503a2b+0x2)+_0x7229('0x15')+(_0x503a2b+0x1)+')','context':_0x3590b2[_0x7229('0x5')],'exten':_0x3590b2['exten'],'priority':_0x503a2b++,'VoiceExtensionId':_0x3590b2['id']},{'type':_0x7229('0xd'),'app':'Set','appdata':_0x3590b2['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x3590b2[_0x7229('0x10')]+'}':'CDR(prefix)=noprefix','context':_0x3590b2[_0x7229('0x5')],'exten':_0x3590b2[_0x7229('0x6')],'priority':_0x503a2b++,'VoiceExtensionId':_0x3590b2['id']},{'type':'outbound','app':'Set','appdata':_0x7229('0xb'),'context':_0x3590b2['context'],'exten':_0x3590b2['exten'],'priority':_0x503a2b++,'VoiceExtensionId':_0x3590b2['id']},{'type':_0x7229('0xd'),'app':_0x7229('0x3'),'appdata':_0x7229('0xc'),'context':_0x3590b2['context'],'exten':_0x3590b2[_0x7229('0x6')],'priority':_0x503a2b++,'VoiceExtensionId':_0x3590b2['id']},{'type':_0x7229('0xd'),'app':_0x7229('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3590b2[_0x7229('0x5')],'exten':_0x3590b2[_0x7229('0x6')],'priority':_0x503a2b++,'VoiceExtensionId':_0x3590b2['id']},{'type':_0x7229('0xd'),'app':'Set','appdata':_0x7229('0x16')+_0x3590b2['id'],'context':_0x3590b2['context'],'exten':_0x3590b2[_0x7229('0x6')],'priority':_0x503a2b++,'VoiceExtensionId':_0x3590b2['id']}];if(_0x3590b2['hasOwnProperty']('recordingFormat')&&_0x3590b2[_0x7229('0x17')]!==_0x7229('0x18')){_0x4c61f6[_0x7229('0xa')]({'type':_0x7229('0xd'),'app':_0x7229('0x3'),'appdata':_0x7229('0x19'),'context':_0x3590b2[_0x7229('0x5')],'exten':_0x3590b2['exten'],'priority':_0x503a2b++,'VoiceExtensionId':_0x3590b2['id']},{'type':_0x7229('0xd'),'app':_0x7229('0x3'),'appdata':_0x7229('0x1a')+_0x3590b2[_0x7229('0x17')]||_0x7229('0x1b'),'context':_0x3590b2[_0x7229('0x5')],'exten':_0x3590b2[_0x7229('0x6')],'priority':_0x503a2b++,'VoiceExtensionId':_0x3590b2['id']});}return _0x4c61f6;}function _0x1617a3(_0x3bc89b,_0x565f6c){var _0x1e675a=[{'name':'trunk','param':0x0},{'name':_0x7229('0x1c'),'param':0x1},{'name':'options','param':0x2},{'name':_0x7229('0x1d'),'param':0x3}];var _0x248563={};var _0x1b4f61=_0x565f6c[_0x7229('0x1e')](',');var _0x495e61=[];for(var _0x3feab2=0x0;_0x3feab2<_0x1e675a['length'];_0x3feab2++){switch(_0x1e675a[_0x3feab2][_0x7229('0x1f')]){case'trunk':_0x248563['trunk']=_0x1b4f61[_0x1e675a[_0x3feab2]['param']][_0x7229('0x1e')]('/')[0x1];_0x248563['phone']=_0x1b4f61[_0x1e675a[_0x3feab2]['param']][_0x7229('0x1e')]('/')[0x2];_0x248563[_0x7229('0x20')]=_0x248563[_0x7229('0x21')]?_0x248563[_0x7229('0x21')][_0x7229('0x1e')]('$')[0x0]:undefined;_0x248563[_0x7229('0x21')]=_0x3bc89b[_0x7229('0x10')]?(_0x248563[_0x7229('0x20')]||'')+_0x7229('0x11')+_0x3bc89b[_0x7229('0x10')]+'}':(_0x248563[_0x7229('0x20')]||'')+'${EXTEN}';_0x495e61[_0x1e675a[_0x3feab2][_0x7229('0x22')]]=['SIP',_0x248563[_0x7229('0x23')],_0x248563[_0x7229('0x21')]][_0x7229('0x24')]('/');break;case _0x7229('0x25'):_0x248563[_0x7229('0x25')]=_0x1b4f61[_0x1e675a[_0x3feab2][_0x7229('0x22')]];if(_0x3bc89b['recordingFormat']!=='none'){if(_0x248563[_0x7229('0x25')][_0x7229('0x26')](_0x7229('0x27'))<0x0){_0x248563['options']+=_0x7229('0x27');}}else{_0x248563[_0x7229('0x25')]=_0x248563[_0x7229('0x25')][_0x7229('0x28')](_0x7229('0x27'),'');}_0x495e61[_0x1e675a[_0x3feab2]['param']]=_0x248563[_0x7229('0x25')];break;default:_0x495e61[_0x1e675a[_0x3feab2][_0x7229('0x22')]]=_0x1b4f61[_0x1e675a[_0x3feab2][_0x7229('0x22')]];}}return _0x495e61[_0x7229('0x24')](',');}function _0x32fa17(_0x2ed927,_0x5654c5,_0x32923a){return new Promise(function(_0x15587c,_0x180831){var _0x21f29f=[];if(_[_0x7229('0x29')](_0x5654c5))return _0x15587c(_0x21f29f);_0x2a9636[_0x7229('0x2a')][_0x7229('0x2b')]({'attributes':['id',_0x7229('0x2c'),'IntervalId'],'raw':!![]})[_0x7229('0x2d')](function(_0x387b73){for(var _0x281896=0x0,_0x4eb717=0x0;_0x281896<_0x5654c5['length'];_0x281896++,_0x4eb717=0x0){var _0xddfe0e=_0x5654c5[_0x281896];var _0x45930e=[];var _0x31a015=[];delete _0xddfe0e['id'];if(_0xddfe0e['interval']!==_0x7229('0x2e')){_0xddfe0e[_0x7229('0x2f')]=[_0xddfe0e[_0x7229('0x2c')]];}else{_0xddfe0e[_0x7229('0x2f')]=_0xddfe0e[_0x7229('0x30')]?_['map'](_[_0x7229('0x31')](_0x387b73,{'IntervalId':_0xddfe0e['IntervalId']}),_0x7229('0x2c')):[];}_0xddfe0e[_0x7229('0x5')]=_0x2ed927[_0x7229('0x5')];_0xddfe0e[_0x7229('0x6')]=_0x2ed927[_0x7229('0x6')];if(_0xddfe0e[_0x7229('0x2')])_0xddfe0e['type']=_0xddfe0e[_0x7229('0x2')]['toLowerCase']();if(_0x2ed927[_0x7229('0x2')]===_0x7229('0xd')){if(_0xddfe0e[_0x7229('0x32')](_0x7229('0x33'))&&_0xddfe0e['tag']&&_0xddfe0e[_0x7229('0x33')]!=='--'){_0x45930e[_0x7229('0xa')]({'type':_0xddfe0e[_0x7229('0x2')][_0x7229('0x34')](),'app':_0x7229('0x3'),'appdata':_0x7229('0x35')+_0xddfe0e[_0x7229('0x33')],'context':_0x2ed927[_0x7229('0x5')],'exten':_0x2ed927[_0x7229('0x6')],'priority':_0xddfe0e[_0x7229('0x2f')][_0x7229('0x36')]+_0x32923a+_0x4eb717++,'VoiceExtensionId':_0x2ed927['id']});}_0x45930e[_0x7229('0xa')]({'type':_0xddfe0e[_0x7229('0x2')]['toLowerCase'](),'app':_0x7229('0x13'),'appdata':_0x7229('0x37')+(_0xddfe0e[_0x7229('0x38')]?_0x7229('0x39')+_0xddfe0e['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x2ed927[_0x7229('0x5')],'exten':_0x2ed927[_0x7229('0x6')],'priority':_0xddfe0e[_0x7229('0x2f')]['length']+_0x32923a+_0x4eb717++,'VoiceExtensionId':_0x2ed927['id']});}else{if(_0xddfe0e[_0x7229('0x32')]('answer')){if(['queue',_0x7229('0x3a')]['includes'](_0xddfe0e['app']['toLowerCase']())&&_0xddfe0e[_0x7229('0x3b')]!=='custom'){if(_0xddfe0e[_0x7229('0x3c')]){_0x45930e[_0x7229('0xa')]({'type':_0xddfe0e[_0x7229('0x2')]['toLowerCase'](),'app':_0x7229('0x13'),'appdata':_0x7229('0x3d'),'context':_0x2ed927['context'],'exten':_0x2ed927[_0x7229('0x6')],'priority':_0xddfe0e[_0x7229('0x2f')][_0x7229('0x36')]+_0x32923a+_0x4eb717++,'VoiceExtensionId':_0x2ed927['id']});_0x45930e[_0x7229('0xa')]({'type':_0xddfe0e['type'][_0x7229('0x34')](),'app':_0x7229('0x3'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2ed927[_0x7229('0x5')],'exten':_0x2ed927[_0x7229('0x6')],'priority':_0xddfe0e['intervals'][_0x7229('0x36')]+_0x32923a+_0x4eb717++,'VoiceExtensionId':_0x2ed927['id']});}else{_0x45930e[_0x7229('0xa')]({'type':_0xddfe0e[_0x7229('0x2')][_0x7229('0x34')](),'app':'ExecIf','appdata':_0x7229('0x3e'),'context':_0x2ed927[_0x7229('0x5')],'exten':_0x2ed927[_0x7229('0x6')],'priority':_0xddfe0e['intervals']['length']+_0x32923a+_0x4eb717++,'VoiceExtensionId':_0x2ed927['id']});_0x45930e[_0x7229('0xa')]({'type':_0xddfe0e['type']['toLowerCase'](),'app':'Set','appdata':_0x7229('0x3f'),'context':_0x2ed927['context'],'exten':_0x2ed927[_0x7229('0x6')],'priority':_0xddfe0e[_0x7229('0x2f')][_0x7229('0x36')]+_0x32923a+_0x4eb717++,'VoiceExtensionId':_0x2ed927['id']});}}}}for(var _0x509493=0x0;_0x509493<_0xddfe0e[_0x7229('0x2f')]['length'];_0x509493++){var _0x2b0756=_0x32923a+_0xddfe0e[_0x7229('0x2f')][_0x7229('0x36')];var _0x22728e=_0x509493===_0xddfe0e[_0x7229('0x2f')][_0x7229('0x36')]-0x1?_0x32923a+_0x45930e[_0x7229('0x36')]+_0x31a015[_0x7229('0x36')]+0x2:_0x32923a+_0x509493+0x1;_0x45930e[_0x7229('0x40')](_0x509493,0x0,{'type':_0x2ed927[_0x7229('0x2')],'app':_0x7229('0x41'),'appdata':_0xddfe0e[_0x7229('0x2f')][_0x509493]+'?'+_0x2ed927[_0x7229('0x5')]+',${EXTEN},'+_0x2b0756+':'+_0x2ed927[_0x7229('0x5')]+',${EXTEN},'+_0x22728e,'exten':_0x2ed927[_0x7229('0x6')],'context':_0x2ed927['context'],'priority':_0x32923a+_0x509493,'VoiceExtensionId':_0x2ed927['id']});}if(_0xddfe0e[_0x7229('0x3b')]===_0x7229('0x42'))_0xddfe0e[_0x7229('0x43')]=_0x1617a3(_0x2ed927,_0xddfe0e[_0x7229('0x43')]);_0xddfe0e[_0x7229('0x44')]=_0x45930e['length']?_['last'](_0x45930e)[_0x7229('0x44')]+0x1:_0x32923a;_0x21f29f=_[_0x7229('0x45')](_0x21f29f,_0x45930e,[_0xddfe0e],_0x31a015);_0x32923a=_[_0x7229('0x46')](_0x21f29f)[_0x7229('0x44')]+0x1;}return _0x15587c(_0x21f29f);})[_0x7229('0x47')](function(_0x178e0d){_0x180831(_0x178e0d);});});}return _0x236599['define']('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1d0c1b){var _0x245ea4=this[_0x7229('0x48')]({'plain':!![]});var _0xc1b75f=_0x245ea4[_0x7229('0x2')]==='outbound'?_0x561d6e(_0x245ea4):_0x13b011(_0x245ea4);return _0x32fa17(_0x245ea4,_0x1d0c1b,_[_0x7229('0x46')](_0xc1b75f)['priority']+0x1)[_0x7229('0x2d')](function(_0x8e69f2){var _0xac2726=_['concat'](_0xc1b75f,_0x8e69f2);_0xac2726[_0x7229('0xa')]({'type':_0x245ea4[_0x7229('0x2')],'app':_0x7229('0x49'),'exten':_0x245ea4[_0x7229('0x6')],'context':_0x245ea4[_0x7229('0x5')],'priority':_['last'](_0xac2726)[_0x7229('0x44')]+0x1,'VoiceExtensionId':_0x245ea4['id']});return _0xac2726;});}}});}; \ No newline at end of file +var _0xecd9=['inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','wav','trunk','timeout','options','url','name','param','split','prefix','phone','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','length','*,*,*,*','filter','toLowerCase','tag','intervals','callerID','Set(CALLERID(all)=','answer','queue','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','priority','define','VoiceExtension','get','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xecd9,0x13f));var _0x9ecd=function(_0x52c336,_0x120cec){_0x52c336=_0x52c336-0x0;var _0x491e73=_0xecd9[_0x52c336];return _0x491e73;};'use strict';var _=require(_0x9ecd('0x0'));var attributes=require(_0x9ecd('0x1'));module[_0x9ecd('0x2')]=function(_0xb2c5a3){var _0x8cd66=_0xb2c5a3[_0x9ecd('0x3')];function _0x20c114(_0x290270){var _0x4abf6e=0x2;var _0x5e6bf1=[{'type':_0x290270[_0x9ecd('0x4')],'app':_0x9ecd('0x5'),'appdata':_0x9ecd('0x6')+_0x290270[_0x9ecd('0x4')],'context':_0x290270['context'],'exten':_0x290270[_0x9ecd('0x7')],'priority':_0x4abf6e++,'VoiceExtensionId':_0x290270['id']},{'type':_0x290270[_0x9ecd('0x4')],'app':_0x290270[_0x9ecd('0x8')]?_0x9ecd('0x5'):_0x9ecd('0x9'),'appdata':_0x290270[_0x9ecd('0x8')]?_0x9ecd('0xa')+_0x290270[_0x9ecd('0x8')]:_0x9ecd('0xb'),'context':_0x290270[_0x9ecd('0xc')],'exten':_0x290270[_0x9ecd('0x7')],'priority':_0x4abf6e++,'VoiceExtensionId':_0x290270['id']}];if(_0x290270[_0x9ecd('0x4')]==='inbound'){_0x5e6bf1['push']({'type':_0x9ecd('0xd'),'app':'Set','appdata':_0x9ecd('0xe')+_0x290270['id'],'context':_0x290270[_0x9ecd('0xc')],'exten':_0x290270[_0x9ecd('0x7')],'priority':_0x4abf6e++,'VoiceExtensionId':_0x290270['id']});}_0x5e6bf1[_0x9ecd('0xf')]({'type':_0x290270['type'],'app':_0x9ecd('0x5'),'appdata':_0x9ecd('0x10'),'context':_0x290270[_0x9ecd('0xc')],'exten':_0x290270[_0x9ecd('0x7')],'priority':_0x4abf6e++,'VoiceExtensionId':_0x290270['id']},{'type':_0x290270['type'],'app':_0x9ecd('0x5'),'appdata':_0x9ecd('0x11'),'context':_0x290270[_0x9ecd('0xc')],'exten':_0x290270['exten'],'priority':_0x4abf6e++,'VoiceExtensionId':_0x290270['id']},{'type':_0x290270[_0x9ecd('0x4')],'app':_0x9ecd('0x5'),'appdata':_0x9ecd('0x12'),'context':_0x290270[_0x9ecd('0xc')],'exten':_0x290270[_0x9ecd('0x7')],'priority':_0x4abf6e++,'VoiceExtensionId':_0x290270['id']});return _0x5e6bf1;}function _0x483fd3(_0x215726){var _0x13c029=0x2;var _0xff44f5=[{'type':_0x9ecd('0x13'),'app':_0x9ecd('0x5'),'appdata':_0x9ecd('0x14'),'context':_0x215726[_0x9ecd('0xc')],'exten':_0x215726[_0x9ecd('0x7')],'priority':_0x13c029++,'VoiceExtensionId':_0x215726['id']},{'type':_0x9ecd('0x13'),'app':_0x215726[_0x9ecd('0x8')]?_0x9ecd('0x5'):_0x9ecd('0x9'),'appdata':_0x215726['alias']?_0x9ecd('0xa')+_0x215726[_0x9ecd('0x8')]:'No\x20alias\x20set','context':_0x215726[_0x9ecd('0xc')],'exten':_0x215726[_0x9ecd('0x7')],'priority':_0x13c029++,'VoiceExtensionId':_0x215726['id']},{'type':_0x9ecd('0x13'),'app':'Set','appdata':_0x9ecd('0x15')+(_0x215726[_0x9ecd('0x16')]?_0x9ecd('0x17')+_0x215726[_0x9ecd('0x16')]+'}':_0x9ecd('0x18')),'context':_0x215726[_0x9ecd('0xc')],'exten':_0x215726[_0x9ecd('0x7')],'priority':_0x13c029++,'VoiceExtensionId':_0x215726['id']},{'type':_0x9ecd('0x13'),'app':'Set','appdata':_0x9ecd('0xe')+_0x215726['id'],'context':_0x215726[_0x9ecd('0xc')],'exten':_0x215726['exten'],'priority':_0x13c029++,'VoiceExtensionId':_0x215726['id']},{'type':_0x9ecd('0x13'),'app':_0x9ecd('0x19'),'appdata':_0x9ecd('0x1a')+(_0x13c029+0x2)+_0x9ecd('0x1b')+(_0x13c029+0x1)+')','context':_0x215726['context'],'exten':_0x215726[_0x9ecd('0x7')],'priority':_0x13c029++,'VoiceExtensionId':_0x215726['id']},{'type':'outbound','app':'Set','appdata':_0x215726[_0x9ecd('0x16')]?_0x9ecd('0x1c')+_0x215726[_0x9ecd('0x16')]+'}':_0x9ecd('0x1d'),'context':_0x215726[_0x9ecd('0xc')],'exten':_0x215726[_0x9ecd('0x7')],'priority':_0x13c029++,'VoiceExtensionId':_0x215726['id']},{'type':_0x9ecd('0x13'),'app':_0x9ecd('0x5'),'appdata':_0x9ecd('0x10'),'context':_0x215726['context'],'exten':_0x215726[_0x9ecd('0x7')],'priority':_0x13c029++,'VoiceExtensionId':_0x215726['id']},{'type':_0x9ecd('0x13'),'app':_0x9ecd('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x215726[_0x9ecd('0xc')],'exten':_0x215726[_0x9ecd('0x7')],'priority':_0x13c029++,'VoiceExtensionId':_0x215726['id']},{'type':_0x9ecd('0x13'),'app':_0x9ecd('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x215726['context'],'exten':_0x215726[_0x9ecd('0x7')],'priority':_0x13c029++,'VoiceExtensionId':_0x215726['id']},{'type':_0x9ecd('0x13'),'app':_0x9ecd('0x5'),'appdata':'outboundrouteid='+_0x215726['id'],'context':_0x215726[_0x9ecd('0xc')],'exten':_0x215726['exten'],'priority':_0x13c029++,'VoiceExtensionId':_0x215726['id']}];if(_0x215726[_0x9ecd('0x1e')]('recordingFormat')&&_0x215726[_0x9ecd('0x1f')]!==_0x9ecd('0x20')){_0xff44f5['push']({'type':'outbound','app':_0x9ecd('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x215726[_0x9ecd('0xc')],'exten':_0x215726[_0x9ecd('0x7')],'priority':_0x13c029++,'VoiceExtensionId':_0x215726['id']},{'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x215726['recordingFormat']||_0x9ecd('0x21'),'context':_0x215726[_0x9ecd('0xc')],'exten':_0x215726[_0x9ecd('0x7')],'priority':_0x13c029++,'VoiceExtensionId':_0x215726['id']});}return _0xff44f5;}function _0x5bcdae(_0xcdb832,_0x5231b0){var _0x31cad1=[{'name':_0x9ecd('0x22'),'param':0x0},{'name':_0x9ecd('0x23'),'param':0x1},{'name':_0x9ecd('0x24'),'param':0x2},{'name':_0x9ecd('0x25'),'param':0x3}];var _0x376a70={};var _0x42cede=_0x5231b0['split'](',');var _0x5a2e19=[];for(var _0x1ffb23=0x0;_0x1ffb23<_0x31cad1['length'];_0x1ffb23++){switch(_0x31cad1[_0x1ffb23][_0x9ecd('0x26')]){case _0x9ecd('0x22'):_0x376a70[_0x9ecd('0x22')]=_0x42cede[_0x31cad1[_0x1ffb23][_0x9ecd('0x27')]][_0x9ecd('0x28')]('/')[0x1];_0x376a70['phone']=_0x42cede[_0x31cad1[_0x1ffb23][_0x9ecd('0x27')]][_0x9ecd('0x28')]('/')[0x2];_0x376a70[_0x9ecd('0x29')]=_0x376a70[_0x9ecd('0x2a')]?_0x376a70[_0x9ecd('0x2a')][_0x9ecd('0x28')]('$')[0x0]:undefined;_0x376a70[_0x9ecd('0x2a')]=_0xcdb832[_0x9ecd('0x16')]?(_0x376a70[_0x9ecd('0x29')]||'')+'${EXTEN:'+_0xcdb832[_0x9ecd('0x16')]+'}':(_0x376a70[_0x9ecd('0x29')]||'')+_0x9ecd('0x18');_0x5a2e19[_0x31cad1[_0x1ffb23]['param']]=[_0x9ecd('0x2b'),_0x376a70[_0x9ecd('0x22')],_0x376a70[_0x9ecd('0x2a')]][_0x9ecd('0x2c')]('/');break;case'options':_0x376a70[_0x9ecd('0x24')]=_0x42cede[_0x31cad1[_0x1ffb23][_0x9ecd('0x27')]];if(_0xcdb832[_0x9ecd('0x1f')]!==_0x9ecd('0x20')){if(_0x376a70['options'][_0x9ecd('0x2d')]('U(xcally-mixmonitor-context)')<0x0){_0x376a70[_0x9ecd('0x24')]+='U(xcally-mixmonitor-context)';}}else{_0x376a70[_0x9ecd('0x24')]=_0x376a70['options']['replace'](_0x9ecd('0x2e'),'');}_0x5a2e19[_0x31cad1[_0x1ffb23][_0x9ecd('0x27')]]=_0x376a70[_0x9ecd('0x24')];break;default:_0x5a2e19[_0x31cad1[_0x1ffb23]['param']]=_0x42cede[_0x31cad1[_0x1ffb23][_0x9ecd('0x27')]];}}return _0x5a2e19[_0x9ecd('0x2c')](',');}function _0x119422(_0x10c17a,_0x42f32b,_0x28a6b0){return new Promise(function(_0x18bc09,_0x5c8c59){var _0xd27490=[];if(_[_0x9ecd('0x2f')](_0x42f32b))return _0x18bc09(_0xd27490);_0x8cd66[_0x9ecd('0x30')][_0x9ecd('0x31')]({'attributes':['id',_0x9ecd('0x32'),_0x9ecd('0x33')],'raw':!![]})[_0x9ecd('0x34')](function(_0xcb9830){for(var _0x1089bc=0x0,_0x4e6390=0x0;_0x1089bc<_0x42f32b[_0x9ecd('0x35')];_0x1089bc++,_0x4e6390=0x0){var _0x4b680a=_0x42f32b[_0x1089bc];var _0x1730be=[];var _0x266d9d=[];delete _0x4b680a['id'];if(_0x4b680a[_0x9ecd('0x32')]!==_0x9ecd('0x36')){_0x4b680a['intervals']=[_0x4b680a[_0x9ecd('0x32')]];}else{_0x4b680a['intervals']=_0x4b680a['IntervalId']?_['map'](_[_0x9ecd('0x37')](_0xcb9830,{'IntervalId':_0x4b680a[_0x9ecd('0x33')]}),'interval'):[];}_0x4b680a[_0x9ecd('0xc')]=_0x10c17a[_0x9ecd('0xc')];_0x4b680a['exten']=_0x10c17a[_0x9ecd('0x7')];if(_0x4b680a[_0x9ecd('0x4')])_0x4b680a['type']=_0x4b680a['type'][_0x9ecd('0x38')]();if(_0x10c17a['type']===_0x9ecd('0x13')){if(_0x4b680a['hasOwnProperty'](_0x9ecd('0x39'))&&_0x4b680a[_0x9ecd('0x39')]&&_0x4b680a['tag']!=='--'){_0x1730be[_0x9ecd('0xf')]({'type':_0x4b680a['type'][_0x9ecd('0x38')](),'app':_0x9ecd('0x5'),'appdata':'CDR(tag)='+_0x4b680a[_0x9ecd('0x39')],'context':_0x10c17a[_0x9ecd('0xc')],'exten':_0x10c17a[_0x9ecd('0x7')],'priority':_0x4b680a[_0x9ecd('0x3a')]['length']+_0x28a6b0+_0x4e6390++,'VoiceExtensionId':_0x10c17a['id']});}_0x1730be[_0x9ecd('0xf')]({'type':_0x4b680a['type'][_0x9ecd('0x38')](),'app':_0x9ecd('0x19'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x4b680a[_0x9ecd('0x3b')]?_0x9ecd('0x3c')+_0x4b680a[_0x9ecd('0x3b')]+')':'NoOp(No\x20number\x20available)'),'context':_0x10c17a[_0x9ecd('0xc')],'exten':_0x10c17a[_0x9ecd('0x7')],'priority':_0x4b680a[_0x9ecd('0x3a')][_0x9ecd('0x35')]+_0x28a6b0+_0x4e6390++,'VoiceExtensionId':_0x10c17a['id']});}else{if(_0x4b680a['hasOwnProperty'](_0x9ecd('0x3d'))){if([_0x9ecd('0x3e'),_0x9ecd('0x3f')][_0x9ecd('0x40')](_0x4b680a[_0x9ecd('0x41')][_0x9ecd('0x38')]())&&_0x4b680a[_0x9ecd('0x42')]!==_0x9ecd('0x43')){if(_0x4b680a[_0x9ecd('0x3d')]){_0x1730be[_0x9ecd('0xf')]({'type':_0x4b680a[_0x9ecd('0x4')][_0x9ecd('0x38')](),'app':_0x9ecd('0x19'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x10c17a[_0x9ecd('0xc')],'exten':_0x10c17a[_0x9ecd('0x7')],'priority':_0x4b680a[_0x9ecd('0x3a')]['length']+_0x28a6b0+_0x4e6390++,'VoiceExtensionId':_0x10c17a['id']});_0x1730be[_0x9ecd('0xf')]({'type':_0x4b680a[_0x9ecd('0x4')][_0x9ecd('0x38')](),'app':_0x9ecd('0x5'),'appdata':_0x9ecd('0x44'),'context':_0x10c17a[_0x9ecd('0xc')],'exten':_0x10c17a[_0x9ecd('0x7')],'priority':_0x4b680a[_0x9ecd('0x3a')]['length']+_0x28a6b0+_0x4e6390++,'VoiceExtensionId':_0x10c17a['id']});}else{_0x1730be[_0x9ecd('0xf')]({'type':_0x4b680a[_0x9ecd('0x4')]['toLowerCase'](),'app':_0x9ecd('0x19'),'appdata':_0x9ecd('0x45'),'context':_0x10c17a[_0x9ecd('0xc')],'exten':_0x10c17a['exten'],'priority':_0x4b680a[_0x9ecd('0x3a')]['length']+_0x28a6b0+_0x4e6390++,'VoiceExtensionId':_0x10c17a['id']});_0x1730be[_0x9ecd('0xf')]({'type':_0x4b680a[_0x9ecd('0x4')][_0x9ecd('0x38')](),'app':'Set','appdata':_0x9ecd('0x46'),'context':_0x10c17a[_0x9ecd('0xc')],'exten':_0x10c17a[_0x9ecd('0x7')],'priority':_0x4b680a['intervals']['length']+_0x28a6b0+_0x4e6390++,'VoiceExtensionId':_0x10c17a['id']});}}}}for(var _0x20bb91=0x0;_0x20bb91<_0x4b680a['intervals'][_0x9ecd('0x35')];_0x20bb91++){var _0x394aaa=_0x28a6b0+_0x4b680a[_0x9ecd('0x3a')][_0x9ecd('0x35')];var _0x5e703d=_0x20bb91===_0x4b680a['intervals'][_0x9ecd('0x35')]-0x1?_0x28a6b0+_0x1730be[_0x9ecd('0x35')]+_0x266d9d[_0x9ecd('0x35')]+0x2:_0x28a6b0+_0x20bb91+0x1;_0x1730be[_0x9ecd('0x47')](_0x20bb91,0x0,{'type':_0x10c17a[_0x9ecd('0x4')],'app':_0x9ecd('0x48'),'appdata':_0x4b680a[_0x9ecd('0x3a')][_0x20bb91]+'?'+_0x10c17a[_0x9ecd('0xc')]+_0x9ecd('0x49')+_0x394aaa+':'+_0x10c17a[_0x9ecd('0xc')]+_0x9ecd('0x49')+_0x5e703d,'exten':_0x10c17a[_0x9ecd('0x7')],'context':_0x10c17a[_0x9ecd('0xc')],'priority':_0x28a6b0+_0x20bb91,'VoiceExtensionId':_0x10c17a['id']});}if(_0x4b680a[_0x9ecd('0x42')]===_0x9ecd('0x4a'))_0x4b680a[_0x9ecd('0x4b')]=_0x5bcdae(_0x10c17a,_0x4b680a[_0x9ecd('0x4b')]);_0x4b680a['priority']=_0x1730be[_0x9ecd('0x35')]?_[_0x9ecd('0x4c')](_0x1730be)[_0x9ecd('0x4d')]+0x1:_0x28a6b0;_0xd27490=_['concat'](_0xd27490,_0x1730be,[_0x4b680a],_0x266d9d);_0x28a6b0=_[_0x9ecd('0x4c')](_0xd27490)[_0x9ecd('0x4d')]+0x1;}return _0x18bc09(_0xd27490);})['catch'](function(_0x576d4f){_0x5c8c59(_0x576d4f);});});}return _0xb2c5a3[_0x9ecd('0x4e')](_0x9ecd('0x4f'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x14fda6){var _0x29c962=this[_0x9ecd('0x50')]({'plain':!![]});var _0xb06c43=_0x29c962[_0x9ecd('0x4')]===_0x9ecd('0x13')?_0x483fd3(_0x29c962):_0x20c114(_0x29c962);return _0x119422(_0x29c962,_0x14fda6,_[_0x9ecd('0x4c')](_0xb06c43)[_0x9ecd('0x4d')]+0x1)[_0x9ecd('0x34')](function(_0x437b30){var _0x3b69e9=_[_0x9ecd('0x51')](_0xb06c43,_0x437b30);_0x3b69e9[_0x9ecd('0xf')]({'type':_0x29c962[_0x9ecd('0x4')],'app':_0x9ecd('0x52'),'exten':_0x29c962[_0x9ecd('0x7')],'context':_0x29c962['context'],'priority':_['last'](_0x3b69e9)[_0x9ecd('0x4d')]+0x1,'VoiceExtensionId':_0x29c962['id']});return _0x3b69e9;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index a6e96a9..17e26b7 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 _0x2484=['options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','then','info','debug','request\x20sent','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll'];(function(_0xbbc5b,_0x1cb617){var _0x4fba37=function(_0x5ceb31){while(--_0x5ceb31){_0xbbc5b['push'](_0xbbc5b['shift']());}};_0x4fba37(++_0x1cb617);}(_0x2484,0x178));var _0x4248=function(_0x2a7f29,_0x2c89dc){_0x2a7f29=_0x2a7f29-0x0;var _0x38924b=_0x2484[_0x2a7f29];return _0x38924b;};'use strict';var _=require(_0x4248('0x0'));var util=require(_0x4248('0x1'));var moment=require('moment');var BPromise=require(_0x4248('0x2'));var rs=require(_0x4248('0x3'));var fs=require('fs');var Redis=require(_0x4248('0x4'));var db=require(_0x4248('0x5'))['db'];var utils=require(_0x4248('0x6'));var logger=require(_0x4248('0x7'))(_0x4248('0x8'));var config=require('../../config/environment');var jayson=require(_0x4248('0x9'));var client=jayson[_0x4248('0xa')][_0x4248('0xb')]({'port':0x232a});config[_0x4248('0xc')]=_[_0x4248('0xd')](config[_0x4248('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4248('0xe'))(new Redis(config[_0x4248('0xc')]));require(_0x4248('0xf'))[_0x4248('0x10')](socket);function respondWithRpcPromise(_0x19b893,_0x2efb7c,_0x13cb06){return new BPromise(function(_0x4a88f4,_0x188337){return client['request'](_0x19b893,_0x13cb06)[_0x4248('0x11')](function(_0x2471b9){logger[_0x4248('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x2efb7c,'request\x20sent');logger[_0x4248('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x2efb7c,_0x4248('0x14'),JSON[_0x4248('0x15')](_0x2471b9));if(_0x2471b9[_0x4248('0x16')]){if(_0x2471b9[_0x4248('0x16')][_0x4248('0x17')]===0x1f4){logger['error'](_0x4248('0x18'),_0x2efb7c,_0x2471b9[_0x4248('0x16')][_0x4248('0x19')]);return _0x188337(_0x2471b9[_0x4248('0x16')][_0x4248('0x19')]);}logger['error'](_0x4248('0x18'),_0x2efb7c,_0x2471b9[_0x4248('0x16')][_0x4248('0x19')]);return _0x4a88f4(_0x2471b9[_0x4248('0x16')][_0x4248('0x19')]);}else{logger[_0x4248('0x12')](_0x4248('0x18'),_0x2efb7c,_0x4248('0x14'));_0x4a88f4(_0x2471b9[_0x4248('0x1a')][_0x4248('0x19')]);}})[_0x4248('0x1b')](function(_0x2f7547){logger[_0x4248('0x16')](_0x4248('0x18'),_0x2efb7c,_0x2f7547);_0x188337(_0x2f7547);});});}exports[_0x4248('0x1c')]=function(_0x33df7b){var _0x200542=this;return new Promise(function(_0x396fc8,_0x5ab53e){return db[_0x4248('0x1d')][_0x4248('0x1e')]({'raw':_0x33df7b[_0x4248('0x1f')]?_0x33df7b[_0x4248('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x33df7b[_0x4248('0x1f')]?_0x33df7b[_0x4248('0x1f')][_0x4248('0x20')]||null:null,'attributes':_0x33df7b['options']?_0x33df7b[_0x4248('0x1f')][_0x4248('0x21')]||null:null,'limit':_0x33df7b['options']?_0x33df7b[_0x4248('0x1f')]['limit']||null:null,'include':_0x33df7b[_0x4248('0x1f')]?_0x33df7b[_0x4248('0x1f')][_0x4248('0x22')]?_[_0x4248('0x23')](_0x33df7b['options'][_0x4248('0x22')],function(_0x205382){return{'model':db[_0x205382[_0x4248('0x24')]],'as':_0x205382['as'],'attributes':_0x205382[_0x4248('0x21')],'include':_0x205382[_0x4248('0x22')]?_[_0x4248('0x23')](_0x205382[_0x4248('0x22')],function(_0x302308){return{'model':db[_0x302308[_0x4248('0x24')]],'as':_0x302308['as'],'attributes':_0x302308[_0x4248('0x21')],'include':_0x302308[_0x4248('0x22')]?_[_0x4248('0x23')](_0x302308[_0x4248('0x22')],function(_0xf72ecc){return{'model':db[_0xf72ecc[_0x4248('0x24')]],'as':_0xf72ecc['as'],'attributes':_0xf72ecc[_0x4248('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x346d91){logger[_0x4248('0x12')](_0x4248('0x1c'),_0x33df7b);logger['debug'](_0x4248('0x1c'),_0x33df7b,JSON[_0x4248('0x15')](_0x346d91));_0x396fc8(_0x346d91);})[_0x4248('0x1b')](function(_0x45dd44){logger[_0x4248('0x16')](_0x4248('0x1c'),_0x45dd44[_0x4248('0x19')],_0x33df7b);_0x5ab53e(_0x200542['error'](0x1f4,_0x45dd44['message']));});});}; \ No newline at end of file +var _0xc01b=['util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceExtension','options','raw','where','attributes','include','model','map','stringify','lodash'];(function(_0x462c8f,_0x5817e3){var _0x45f8c1=function(_0x1b0abb){while(--_0x1b0abb){_0x462c8f['push'](_0x462c8f['shift']());}};_0x45f8c1(++_0x5817e3);}(_0xc01b,0x65));var _0xbc01=function(_0x4089c5,_0x2bf8b1){_0x4089c5=_0x4089c5-0x0;var _0x9ae197=_0xc01b[_0x4089c5];return _0x9ae197;};'use strict';var _=require(_0xbc01('0x0'));var util=require(_0xbc01('0x1'));var moment=require(_0xbc01('0x2'));var BPromise=require(_0xbc01('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc01('0x4'));var db=require(_0xbc01('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbc01('0x6'));var jayson=require(_0xbc01('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xbc01('0x8')]=_[_0xbc01('0x9')](config[_0xbc01('0x8')],{'host':_0xbc01('0xa'),'port':0x18eb});var socket=require(_0xbc01('0xb'))(new Redis(config[_0xbc01('0x8')]));require(_0xbc01('0xc'))['register'](socket);function respondWithRpcPromise(_0x46f01c,_0x3cc11e,_0x3b7f4d){return new BPromise(function(_0x1d84e8,_0xa0d0b1){return client[_0xbc01('0xd')](_0x46f01c,_0x3b7f4d)[_0xbc01('0xe')](function(_0x28067a){logger[_0xbc01('0xf')](_0xbc01('0x10'),_0x3cc11e,_0xbc01('0x11'));logger[_0xbc01('0x12')](_0xbc01('0x13'),_0x3cc11e,_0xbc01('0x11'),JSON['stringify'](_0x28067a));if(_0x28067a[_0xbc01('0x14')]){if(_0x28067a[_0xbc01('0x14')][_0xbc01('0x15')]===0x1f4){logger['error'](_0xbc01('0x10'),_0x3cc11e,_0x28067a[_0xbc01('0x14')]['message']);return _0xa0d0b1(_0x28067a[_0xbc01('0x14')][_0xbc01('0x16')]);}logger[_0xbc01('0x14')](_0xbc01('0x10'),_0x3cc11e,_0x28067a['error']['message']);return _0x1d84e8(_0x28067a[_0xbc01('0x14')][_0xbc01('0x16')]);}else{logger['info'](_0xbc01('0x10'),_0x3cc11e,'request\x20sent');_0x1d84e8(_0x28067a[_0xbc01('0x17')][_0xbc01('0x16')]);}})[_0xbc01('0x18')](function(_0x1e79d0){logger['error'](_0xbc01('0x10'),_0x3cc11e,_0x1e79d0);_0xa0d0b1(_0x1e79d0);});});}exports[_0xbc01('0x19')]=function(_0x40162b){var _0x4a579c=this;return new Promise(function(_0x364c87,_0x121670){return db['VoiceExtension']['findAll']({'raw':_0x40162b['options']?_0x40162b[_0xbc01('0x1a')][_0xbc01('0x1b')]===undefined?!![]:![]:!![],'where':_0x40162b[_0xbc01('0x1a')]?_0x40162b[_0xbc01('0x1a')][_0xbc01('0x1c')]||null:null,'attributes':_0x40162b[_0xbc01('0x1a')]?_0x40162b['options'][_0xbc01('0x1d')]||null:null,'limit':_0x40162b['options']?_0x40162b[_0xbc01('0x1a')]['limit']||null:null,'include':_0x40162b[_0xbc01('0x1a')]?_0x40162b[_0xbc01('0x1a')][_0xbc01('0x1e')]?_['map'](_0x40162b[_0xbc01('0x1a')][_0xbc01('0x1e')],function(_0x56383f){return{'model':db[_0x56383f[_0xbc01('0x1f')]],'as':_0x56383f['as'],'attributes':_0x56383f[_0xbc01('0x1d')],'include':_0x56383f[_0xbc01('0x1e')]?_[_0xbc01('0x20')](_0x56383f[_0xbc01('0x1e')],function(_0x2ca748){return{'model':db[_0x2ca748[_0xbc01('0x1f')]],'as':_0x2ca748['as'],'attributes':_0x2ca748[_0xbc01('0x1d')],'include':_0x2ca748[_0xbc01('0x1e')]?_[_0xbc01('0x20')](_0x2ca748[_0xbc01('0x1e')],function(_0x5778d7){return{'model':db[_0x5778d7[_0xbc01('0x1f')]],'as':_0x5778d7['as'],'attributes':_0x5778d7[_0xbc01('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbc01('0xe')](function(_0xc51dea){logger[_0xbc01('0xf')](_0xbc01('0x19'),_0x40162b);logger[_0xbc01('0x12')]('GetVoiceExtension',_0x40162b,JSON[_0xbc01('0x21')](_0xc51dea));_0x364c87(_0xc51dea);})['catch'](function(_0x11e8b9){logger[_0xbc01('0x14')]('GetVoiceExtension',_0x11e8b9[_0xbc01('0x16')],_0x40162b);_0x121670(_0x4a579c[_0xbc01('0x14')](0x1f4,_0x11e8b9['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index ee50583..62a8b99 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 _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x814b,0x1a2));var _0xb814=function(_0x434804,_0x415f68){_0x434804=_0x434804-0x0;var _0x573fc8=_0x814b[_0x434804];return _0x573fc8;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file +var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x3abbab,_0xc4a44){var _0x292cbd=function(_0x294db3){while(--_0x294db3){_0x3abbab['push'](_0x3abbab['shift']());}};_0x292cbd(++_0xc4a44);}(_0xf494,0x1c6));var _0x4f49=function(_0x3f709d,_0x2e1a4d){_0x3f709d=_0x3f709d-0x0;var _0x2fe73f=_0xf494[_0x3f709d];return _0x2fe73f;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index f7aaa5b..4d2562d 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 _0xb145=['show','/:id/messages','getMessages','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id'];(function(_0x6d62a9,_0x267d78){var _0x1a3557=function(_0x55a7bf){while(--_0x55a7bf){_0x6d62a9['push'](_0x6d62a9['shift']());}};_0x1a3557(++_0x267d78);}(_0xb145,0xa3));var _0x5b14=function(_0x4b9327,_0x55e370){_0x4b9327=_0x4b9327-0x0;var _0x47e17d=_0xb145[_0x4b9327];return _0x47e17d;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var fs_extra=require(_0x5b14('0x5'));var auth=require(_0x5b14('0x6'));var interaction=require(_0x5b14('0x7'));var config=require('../../config/environment');var controller=require(_0x5b14('0x8'));router[_0x5b14('0x9')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0xb')]);router['get'](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0xd')]);router[_0x5b14('0x9')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0xf')]);router[_0x5b14('0x10')]('/',auth['isAuthenticated'](),controller[_0x5b14('0x11')]);router[_0x5b14('0x12')](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x13')]);router['delete'](_0x5b14('0xc'),auth['isAuthenticated'](),controller[_0x5b14('0x14')]);module[_0x5b14('0x15')]=router; \ No newline at end of file +var _0x2272=['express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/messages','post','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x9c8c83,_0x16ebdd){var _0x4636ac=function(_0x5bacfc){while(--_0x5bacfc){_0x9c8c83['push'](_0x9c8c83['shift']());}};_0x4636ac(++_0x16ebdd);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var path=require(_0x2227('0x2'));var timeout=require(_0x2227('0x3'));var express=require(_0x2227('0x4'));var router=express['Router']();var fs_extra=require(_0x2227('0x5'));var auth=require(_0x2227('0x6'));var interaction=require(_0x2227('0x7'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x2227('0x8')]('/',auth[_0x2227('0x9')](),controller[_0x2227('0xa')]);router[_0x2227('0x8')](_0x2227('0xb'),auth[_0x2227('0x9')](),controller[_0x2227('0xc')]);router[_0x2227('0x8')](_0x2227('0xd'),auth[_0x2227('0x9')](),controller['getMessages']);router[_0x2227('0xe')]('/',auth['isAuthenticated'](),controller[_0x2227('0xf')]);router[_0x2227('0x10')](_0x2227('0xb'),auth[_0x2227('0x9')](),controller[_0x2227('0x11')]);router['delete'](_0x2227('0xb'),auth[_0x2227('0x9')](),controller[_0x2227('0x12')]);module[_0x2227('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index e2696a1..74a902b 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 _0x6866=['email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue'];(function(_0x20c9f3,_0x1c3564){var _0x4682e6=function(_0x181549){while(--_0x181549){_0x20c9f3['push'](_0x20c9f3['shift']());}};_0x4682e6(++_0x1c3564);}(_0x6866,0x176));var _0x6686=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x6866[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x6686('0x0'));module[_0x6686('0x1')]={'customer_id':{'type':Sequelize[_0x6686('0x2')]},'context':{'type':Sequelize[_0x6686('0x2')],'defaultValue':_0x6686('0x3'),'unique':_0x6686('0x4')},'mailbox':{'type':Sequelize[_0x6686('0x2')],'defaultValue':'','allowNull':![],'unique':_0x6686('0x4')},'password':{'type':Sequelize[_0x6686('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x6686('0x2')],'validate':{'isEmail':!![]},'set':function(_0x1b0381){this[_0x6686('0x5')](_0x6686('0x6'),typeof _0x1b0381===_0x6686('0x7')&&_0x1b0381[_0x6686('0x8')]()?_0x1b0381[_0x6686('0x8')]():null);}},'pager':{'type':Sequelize[_0x6686('0x2')]},'tz':{'type':Sequelize[_0x6686('0x2')],'defaultValue':_0x6686('0x9')},'attach':{'type':Sequelize[_0x6686('0xa')](_0x6686('0xb'),'no'),'defaultValue':_0x6686('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x6686('0xa')](_0x6686('0xb'),'no'),'defaultValue':_0x6686('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0x6686('0x2')]},'callback':{'type':Sequelize[_0x6686('0x2')]},'review':{'type':Sequelize['ENUM'](_0x6686('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x6686('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x6686('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x6686('0xa')](_0x6686('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x6686('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x6686('0xa')](_0x6686('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x6686('0xa')](_0x6686('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x6686('0xa')](_0x6686('0xb'),'no'),'defaultValue':_0x6686('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x6686('0xa')](_0x6686('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x6686('0xa')](_0x6686('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x6686('0xb'),'allowNull':![]},'stamp':{'type':_0x6686('0xd')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x6686('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x6686('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x6686('0xf')],'get':function(){return this['getDataValue'](_0x6686('0x10'))+_0x6686('0x11')+this[_0x6686('0x12')](_0x6686('0x13'));}}}; \ No newline at end of file +var _0x8060=['yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','email','string','trim','central','ENUM'];(function(_0x41e526,_0x4420a7){var _0x3fc3a7=function(_0x4d154b){while(--_0x4d154b){_0x41e526['push'](_0x41e526['shift']());}};_0x3fc3a7(++_0x4420a7);}(_0x8060,0xd6));var _0x0806=function(_0x584b9d,_0x1cb5c5){_0x584b9d=_0x584b9d-0x0;var _0x172053=_0x8060[_0x584b9d];return _0x172053;};'use strict';var Sequelize=require(_0x0806('0x0'));module[_0x0806('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0806('0x2')],'defaultValue':_0x0806('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x0806('0x2')],'defaultValue':'','allowNull':![],'unique':_0x0806('0x4')},'password':{'type':Sequelize[_0x0806('0x2')]},'fullname':{'type':Sequelize[_0x0806('0x2')]},'email':{'type':Sequelize[_0x0806('0x2')],'validate':{'isEmail':!![]},'set':function(_0x516c10){this['setDataValue'](_0x0806('0x5'),typeof _0x516c10===_0x0806('0x6')&&_0x516c10['trim']()?_0x516c10[_0x0806('0x7')]():null);}},'pager':{'type':Sequelize[_0x0806('0x2')]},'tz':{'type':Sequelize[_0x0806('0x2')],'defaultValue':_0x0806('0x8')},'attach':{'type':Sequelize[_0x0806('0x9')](_0x0806('0xa'),'no'),'defaultValue':_0x0806('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x0806('0x9')](_0x0806('0xa'),'no'),'defaultValue':_0x0806('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0806('0x2')]},'callback':{'type':Sequelize[_0x0806('0x2')]},'review':{'type':Sequelize[_0x0806('0x9')](_0x0806('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0806('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0806('0x9')](_0x0806('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0806('0x9')](_0x0806('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0806('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0806('0x9')](_0x0806('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x0806('0x9')](_0x0806('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x0806('0xa'),'no'),'defaultValue':_0x0806('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x0806('0x9')](_0x0806('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x0806('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0806('0x9')](_0x0806('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x0806('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x0806('0x2')]},'maxsecs':{'type':Sequelize[_0x0806('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0806('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0806('0xe')]('fullname')+'\x20-\x20'+this[_0x0806('0xe')](_0x0806('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 7b3cd74..592495c 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 _0x4ded=['findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','order','sort','findAndCountAll','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','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','index','map','VoiceMail','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','VIRTUAL','filter','merge','options','includeAll','include'];(function(_0x102420,_0x138588){var _0x52a65d=function(_0x294e33){while(--_0x294e33){_0x102420['push'](_0x102420['shift']());}};_0x52a65d(++_0x138588);}(_0x4ded,0x116));var _0xd4de=function(_0x5d5d51,_0x51bccc){_0x5d5d51=_0x5d5d51-0x0;var _0x5b3b62=_0x4ded[_0x5d5d51];return _0x5b3b62;};'use strict';var emlformat=require(_0xd4de('0x0'));var rimraf=require(_0xd4de('0x1'));var zipdir=require(_0xd4de('0x2'));var jsonpatch=require(_0xd4de('0x3'));var rp=require(_0xd4de('0x4'));var moment=require(_0xd4de('0x5'));var BPromise=require(_0xd4de('0x6'));var Mustache=require(_0xd4de('0x7'));var util=require(_0xd4de('0x8'));var path=require(_0xd4de('0x9'));var sox=require(_0xd4de('0xa'));var csv=require(_0xd4de('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4de('0xc'));var _=require(_0xd4de('0xd'));var squel=require(_0xd4de('0xe'));var crypto=require(_0xd4de('0xf'));var jsforce=require(_0xd4de('0x10'));var deskjs=require(_0xd4de('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd4de('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd4de('0x13'));var as=require(_0xd4de('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4de('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd4de('0x16'));var db=require(_0xd4de('0x17'))['db'];function respondWithStatusCode(_0x104dad,_0x2aa09d){_0x2aa09d=_0x2aa09d||0xcc;return function(_0x3ffc72){if(_0x3ffc72){return _0x104dad[_0xd4de('0x18')](_0x2aa09d);}return _0x104dad[_0xd4de('0x19')](_0x2aa09d)[_0xd4de('0x1a')]();};}function respondWithResult(_0x3e3735,_0x37cb9f){_0x37cb9f=_0x37cb9f||0xc8;return function(_0x691ba9){if(_0x691ba9){return _0x3e3735[_0xd4de('0x19')](_0x37cb9f)[_0xd4de('0x1b')](_0x691ba9);}};}function respondWithFilteredResult(_0xbb4f7e,_0x102e5b){return function(_0xa7c18b){if(_0xa7c18b){var _0x325fba=typeof _0x102e5b['offset']==='undefined'&&typeof _0x102e5b[_0xd4de('0x1c')]===_0xd4de('0x1d');var _0x17b377=_0xa7c18b[_0xd4de('0x1e')];var _0x5b1d1c=_0x325fba?0x0:_0x102e5b['offset'];var _0x1e91d5=_0x325fba?_0xa7c18b['count']:_0x102e5b[_0xd4de('0x1f')]+_0x102e5b[_0xd4de('0x1c')];var _0x50b9e3;if(_0x1e91d5>=_0x17b377){_0x1e91d5=_0x17b377;_0x50b9e3=0xc8;}else{_0x50b9e3=0xce;}_0xbb4f7e[_0xd4de('0x19')](_0x50b9e3);return _0xbb4f7e['set'](_0xd4de('0x20'),_0x5b1d1c+'-'+_0x1e91d5+'/'+_0x17b377)[_0xd4de('0x1b')](_0xa7c18b);}return null;};}function patchUpdates(_0x2bad14){return function(_0x8e8712){try{jsonpatch['apply'](_0x8e8712,_0x2bad14,!![]);}catch(_0x318658){return BPromise[_0xd4de('0x21')](_0x318658);}return _0x8e8712[_0xd4de('0x22')]();};}function saveUpdates(_0xdb3fc,_0x1c631a){return function(_0x2d092a){if(_0x2d092a){return _0x2d092a[_0xd4de('0x23')](_0xdb3fc)[_0xd4de('0x24')](function(_0x2f9de6){return _0x2f9de6;});}return null;};}function removeEntity(_0x413f68,_0x534b37){return function(_0xad333f){if(_0xad333f){return _0xad333f[_0xd4de('0x25')]()[_0xd4de('0x24')](function(){var _0x22970c=_0xad333f[_0xd4de('0x26')]({'plain':!![]});var _0x984904=_0xd4de('0x27');return db[_0xd4de('0x28')][_0xd4de('0x25')]({'where':{'type':_0x984904,'resourceId':_0x22970c['id']}})[_0xd4de('0x24')](function(){return _0xad333f;});})[_0xd4de('0x24')](function(){_0x413f68[_0xd4de('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe64e4e,_0x35e2fc){return function(_0x5005b0){if(!_0x5005b0){_0xe64e4e[_0xd4de('0x18')](0x194);}return _0x5005b0;};}function handleError(_0x59b3c5,_0x44b710){_0x44b710=_0x44b710||0x1f4;return function(_0x32e407){logger[_0xd4de('0x29')](_0x32e407['stack']);if(_0x32e407[_0xd4de('0x2a')]){delete _0x32e407[_0xd4de('0x2a')];}_0x59b3c5[_0xd4de('0x19')](_0x44b710)['send'](_0x32e407);};}exports[_0xd4de('0x2b')]=function(_0x1804c7,_0x55f9f9){var _0x5103b5={},_0x5706fe={},_0x3f6491={'count':0x0,'rows':[]};var _0x496795=_[_0xd4de('0x2c')](db[_0xd4de('0x2d')][_0xd4de('0x2e')],function(_0x2e08eb){return{'name':_0x2e08eb['fieldName'],'type':_0x2e08eb[_0xd4de('0x2f')][_0xd4de('0x30')]};});_0x5706fe['model']=_[_0xd4de('0x2c')](_0x496795,_0xd4de('0x2a'));_0x5706fe['query']=_['keys'](_0x1804c7[_0xd4de('0x31')]);_0x5706fe[_0xd4de('0x32')]=_[_0xd4de('0x33')](_0x5706fe[_0xd4de('0x34')],_0x5706fe['query']);_0x5103b5[_0xd4de('0x35')]=_[_0xd4de('0x33')](_0x5706fe['model'],qs[_0xd4de('0x36')](_0x1804c7[_0xd4de('0x31')][_0xd4de('0x36')]));_0x5103b5[_0xd4de('0x35')]=_0x5103b5[_0xd4de('0x35')][_0xd4de('0x37')]?_0x5103b5['attributes']:_0x5706fe['model'];if(!_0x1804c7[_0xd4de('0x31')][_0xd4de('0x38')](_0xd4de('0x39'))){_0x5103b5['limit']=qs[_0xd4de('0x1c')](_0x1804c7[_0xd4de('0x31')]['limit']);_0x5103b5[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x1804c7[_0xd4de('0x31')][_0xd4de('0x1f')]);}_0x5103b5['order']=qs['sort'](_0x1804c7[_0xd4de('0x31')]['sort']);_0x5103b5[_0xd4de('0x3a')]=qs['filters'](_[_0xd4de('0x3b')](_0x1804c7[_0xd4de('0x31')],_0x5706fe[_0xd4de('0x32')]),_0x496795);if(_0x1804c7[_0xd4de('0x31')]['filter']){_0x5103b5[_0xd4de('0x3a')]=_['merge'](_0x5103b5[_0xd4de('0x3a')],{'$or':_[_0xd4de('0x2c')](_0x496795,function(_0x7f17b9){if(_0x7f17b9[_0xd4de('0x2f')]!==_0xd4de('0x3c')){var _0x13c256={};_0x13c256[_0x7f17b9[_0xd4de('0x2a')]]={'$like':'%'+_0x1804c7['query'][_0xd4de('0x3d')]+'%'};return _0x13c256;}})});}_0x5103b5=_[_0xd4de('0x3e')]({},_0x5103b5,_0x1804c7[_0xd4de('0x3f')]);var _0x2ec1fa={'where':_0x5103b5[_0xd4de('0x3a')]};return db['VoiceMail'][_0xd4de('0x1e')](_0x2ec1fa)[_0xd4de('0x24')](function(_0x2294e2){_0x3f6491['count']=_0x2294e2;if(_0x1804c7[_0xd4de('0x31')][_0xd4de('0x40')]){_0x5103b5[_0xd4de('0x41')]=[{'all':!![]}];}return db['VoiceMail'][_0xd4de('0x42')](_0x5103b5);})[_0xd4de('0x24')](function(_0x419c49){_0x3f6491[_0xd4de('0x43')]=_0x419c49;return _0x3f6491;})[_0xd4de('0x24')](respondWithFilteredResult(_0x55f9f9,_0x5103b5))[_0xd4de('0x44')](handleError(_0x55f9f9,null));};exports[_0xd4de('0x45')]=function(_0x5ecbbd,_0x43b542){var _0x164bde={'raw':!![],'where':{'id':_0x5ecbbd['params']['id']}},_0x58082a={};_0x58082a[_0xd4de('0x34')]=_[_0xd4de('0x46')](db[_0xd4de('0x2d')]['rawAttributes']);_0x58082a['query']=_[_0xd4de('0x46')](_0x5ecbbd[_0xd4de('0x31')]);_0x58082a['filters']=_[_0xd4de('0x33')](_0x58082a[_0xd4de('0x34')],_0x58082a[_0xd4de('0x31')]);_0x164bde[_0xd4de('0x35')]=_['intersection'](_0x58082a[_0xd4de('0x34')],qs[_0xd4de('0x36')](_0x5ecbbd[_0xd4de('0x31')][_0xd4de('0x36')]));_0x164bde[_0xd4de('0x35')]=_0x164bde[_0xd4de('0x35')]['length']?_0x164bde[_0xd4de('0x35')]:_0x58082a[_0xd4de('0x34')];if(_0x5ecbbd[_0xd4de('0x31')][_0xd4de('0x40')]){_0x164bde[_0xd4de('0x41')]=[{'all':!![]}];}_0x164bde=_[_0xd4de('0x3e')]({},_0x164bde,_0x5ecbbd[_0xd4de('0x3f')]);return db[_0xd4de('0x2d')][_0xd4de('0x47')](_0x164bde)[_0xd4de('0x24')](handleEntityNotFound(_0x43b542,null))['then'](respondWithResult(_0x43b542,null))[_0xd4de('0x44')](handleError(_0x43b542,null));};exports[_0xd4de('0x48')]=function(_0x178daf,_0x518bfe){return db[_0xd4de('0x2d')][_0xd4de('0x48')](_0x178daf[_0xd4de('0x49')],{})[_0xd4de('0x24')](function(_0x42e58e){var _0xa24bb7=_0x178daf[_0xd4de('0x4a')][_0xd4de('0x26')]({'plain':!![]});if(!_0xa24bb7)throw new Error(_0xd4de('0x4b'));if(_0xa24bb7[_0xd4de('0x4c')]==='user'){var _0x3e4c7f=_0x42e58e[_0xd4de('0x26')]({'plain':!![]});var _0x215f85=_0xd4de('0x27');return db[_0xd4de('0x4d')]['find']({'where':{'name':_0x215f85,'userProfileId':_0xa24bb7['userProfileId']},'raw':!![]})[_0xd4de('0x24')](function(_0x2deedb){if(_0x2deedb&&_0x2deedb['autoAssociation']===0x0){return db['UserProfileResource'][_0xd4de('0x48')]({'name':_0x3e4c7f[_0xd4de('0x2a')],'resourceId':_0x3e4c7f['id'],'type':_0x2deedb[_0xd4de('0x2a')],'sectionId':_0x2deedb['id']},{})[_0xd4de('0x24')](function(){return _0x42e58e;});}else{return _0x42e58e;}})[_0xd4de('0x44')](function(_0x15c8cd){logger[_0xd4de('0x29')](_0xd4de('0x4e'),_0x15c8cd);throw _0x15c8cd;});}return _0x42e58e;})[_0xd4de('0x24')](respondWithResult(_0x518bfe,0xc9))[_0xd4de('0x44')](handleError(_0x518bfe,null));};exports[_0xd4de('0x23')]=function(_0x2e1780,_0x56c13e){if(_0x2e1780[_0xd4de('0x49')]['id']){delete _0x2e1780[_0xd4de('0x49')]['id'];}return db[_0xd4de('0x2d')][_0xd4de('0x47')]({'where':{'id':_0x2e1780[_0xd4de('0x4f')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x56c13e,null))['then'](saveUpdates(_0x2e1780[_0xd4de('0x49')],null))['then'](respondWithResult(_0x56c13e,null))['catch'](handleError(_0x56c13e,null));};exports[_0xd4de('0x25')]=function(_0xd79781,_0x2d1e45){return db[_0xd4de('0x2d')]['find']({'where':{'id':_0xd79781[_0xd4de('0x4f')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x2d1e45,null))[_0xd4de('0x24')](removeEntity(_0x2d1e45,null))[_0xd4de('0x44')](handleError(_0x2d1e45,null));};exports[_0xd4de('0x50')]=function(_0x4bb7df,_0x5496f7,_0x4b55cc){return db[_0xd4de('0x2d')][_0xd4de('0x51')]({'where':{'id':_0x4bb7df[_0xd4de('0x4f')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x5496f7,null))['then'](function(_0x35ba6f){var _0x146eaa;var _0x2e0d76={},_0x17047a={};_0x17047a['model']=_[_0xd4de('0x46')](db[_0xd4de('0x52')][_0xd4de('0x2e')]);_0x17047a[_0xd4de('0x31')]=_['keys'](_0x4bb7df['query']);_0x17047a['filters']=_[_0xd4de('0x33')](_0x17047a[_0xd4de('0x34')],_0x17047a[_0xd4de('0x31')]);_0x2e0d76['attributes']=_[_0xd4de('0x33')](_0x17047a[_0xd4de('0x34')],qs[_0xd4de('0x36')](_0x4bb7df['query'][_0xd4de('0x36')]));_0x2e0d76['attributes']=_0x2e0d76[_0xd4de('0x35')][_0xd4de('0x37')]?_0x2e0d76[_0xd4de('0x35')]:_0x17047a[_0xd4de('0x34')];if(!_0x4bb7df[_0xd4de('0x31')][_0xd4de('0x38')](_0xd4de('0x39'))){_0x2e0d76[_0xd4de('0x1c')]=qs['limit'](_0x4bb7df[_0xd4de('0x31')]['limit']);_0x2e0d76[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x4bb7df['query'][_0xd4de('0x1f')]);}_0x2e0d76[_0xd4de('0x53')]=qs[_0xd4de('0x54')](_0x4bb7df[_0xd4de('0x31')][_0xd4de('0x54')]);_0x2e0d76[_0xd4de('0x3a')]=qs[_0xd4de('0x32')](_[_0xd4de('0x3b')](_0x4bb7df[_0xd4de('0x31')],_0x17047a[_0xd4de('0x32')]));if(_0x4bb7df[_0xd4de('0x31')][_0xd4de('0x3d')]){_0x2e0d76[_0xd4de('0x3a')]=_['merge'](_0x2e0d76[_0xd4de('0x3a')],{'$or':_[_0xd4de('0x2c')](_0x2e0d76[_0xd4de('0x35')],function(_0x331f08){var _0x25628e={};_0x25628e[_0x331f08]={'$like':'%'+_0x4bb7df[_0xd4de('0x31')][_0xd4de('0x3d')]+'%'};return _0x25628e;})});}_0x2e0d76[_0xd4de('0x3a')]=_['merge'](_0x2e0d76[_0xd4de('0x3a')],{'mailboxuser':_0x35ba6f['mailbox']});_0x2e0d76=_['merge']({},_0x2e0d76,_0x4bb7df['options']);return db[_0xd4de('0x52')][_0xd4de('0x55')](_0x2e0d76)['then'](respondWithFilteredResult(_0x5496f7,_0x2e0d76));})['catch'](handleError(_0x5496f7,null));}; \ No newline at end of file +var _0xb9a7=['model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','filter','options','VoiceMail','includeAll','include','findAll','rows','params','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','body','findOne','VoiceMailMessage','rawAttributes','nolimit','findAndCountAll','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','fieldName','type'];(function(_0x45480d,_0x2d33bd){var _0x192638=function(_0x1043ba){while(--_0x1043ba){_0x45480d['push'](_0x45480d['shift']());}};_0x192638(++_0x2d33bd);}(_0xb9a7,0x112));var _0x7b9a=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xb9a7[_0x29d94e];return _0x106237;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b9a('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7b9a('0x2'));var util=require(_0x7b9a('0x3'));var path=require(_0x7b9a('0x4'));var sox=require(_0x7b9a('0x5'));var csv=require(_0x7b9a('0x6'));var ejs=require(_0x7b9a('0x7'));var fs=require('fs');var fs_extra=require(_0x7b9a('0x8'));var _=require(_0x7b9a('0x9'));var squel=require(_0x7b9a('0xa'));var crypto=require(_0x7b9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b9a('0xc'));var toCsv=require(_0x7b9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b9a('0xd'));var qs=require(_0x7b9a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9a('0xf'));var logger=require('../../config/logger')(_0x7b9a('0x10'));var utils=require('../../config/utils');var config=require(_0x7b9a('0x11'));var licenseUtil=require(_0x7b9a('0x12'));var db=require(_0x7b9a('0x13'))['db'];function respondWithStatusCode(_0x5948ca,_0x32f616){_0x32f616=_0x32f616||0xcc;return function(_0xec5949){if(_0xec5949){return _0x5948ca['sendStatus'](_0x32f616);}return _0x5948ca[_0x7b9a('0x14')](_0x32f616)[_0x7b9a('0x15')]();};}function respondWithResult(_0x4b7ec0,_0xb157e5){_0xb157e5=_0xb157e5||0xc8;return function(_0xde180d){if(_0xde180d){return _0x4b7ec0[_0x7b9a('0x14')](_0xb157e5)[_0x7b9a('0x16')](_0xde180d);}};}function respondWithFilteredResult(_0x344fa7,_0x346daa){return function(_0x22a7e4){if(_0x22a7e4){var _0x35e602=typeof _0x346daa[_0x7b9a('0x17')]==='undefined'&&typeof _0x346daa[_0x7b9a('0x18')]==='undefined';var _0x123921=_0x22a7e4[_0x7b9a('0x19')];var _0x271263=_0x35e602?0x0:_0x346daa[_0x7b9a('0x17')];var _0x44a232=_0x35e602?_0x22a7e4[_0x7b9a('0x19')]:_0x346daa[_0x7b9a('0x17')]+_0x346daa[_0x7b9a('0x18')];var _0x2064a0;if(_0x44a232>=_0x123921){_0x44a232=_0x123921;_0x2064a0=0xc8;}else{_0x2064a0=0xce;}_0x344fa7[_0x7b9a('0x14')](_0x2064a0);return _0x344fa7[_0x7b9a('0x1a')](_0x7b9a('0x1b'),_0x271263+'-'+_0x44a232+'/'+_0x123921)[_0x7b9a('0x16')](_0x22a7e4);}return null;};}function patchUpdates(_0x58aed7){return function(_0x993048){try{jsonpatch['apply'](_0x993048,_0x58aed7,!![]);}catch(_0x1eacbc){return BPromise['reject'](_0x1eacbc);}return _0x993048[_0x7b9a('0x1c')]();};}function saveUpdates(_0x331ae6,_0x23d812){return function(_0x54fda7){if(_0x54fda7){return _0x54fda7[_0x7b9a('0x1d')](_0x331ae6)[_0x7b9a('0x1e')](function(_0x5705b2){return _0x5705b2;});}return null;};}function removeEntity(_0x35aca7,_0x374dca){return function(_0x269c07){if(_0x269c07){return _0x269c07[_0x7b9a('0x1f')]()[_0x7b9a('0x1e')](function(){var _0x5b2f52=_0x269c07[_0x7b9a('0x20')]({'plain':!![]});var _0x23219e='Voicemails';return db[_0x7b9a('0x21')]['destroy']({'where':{'type':_0x23219e,'resourceId':_0x5b2f52['id']}})[_0x7b9a('0x1e')](function(){return _0x269c07;});})[_0x7b9a('0x1e')](function(){_0x35aca7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24d886,_0x55301c){return function(_0x54df8a){if(!_0x54df8a){_0x24d886[_0x7b9a('0x22')](0x194);}return _0x54df8a;};}function handleError(_0x58fec8,_0x5be740){_0x5be740=_0x5be740||0x1f4;return function(_0x3847b4){logger['error'](_0x3847b4[_0x7b9a('0x23')]);if(_0x3847b4[_0x7b9a('0x24')]){delete _0x3847b4['name'];}_0x58fec8[_0x7b9a('0x14')](_0x5be740)[_0x7b9a('0x25')](_0x3847b4);};}exports[_0x7b9a('0x26')]=function(_0x5b64d7,_0x45ccf5){var _0x2ce78b={},_0x181e9c={},_0x6c8b1f={'count':0x0,'rows':[]};var _0x5028e7=_[_0x7b9a('0x27')](db['VoiceMail']['rawAttributes'],function(_0x2d278e){return{'name':_0x2d278e[_0x7b9a('0x28')],'type':_0x2d278e[_0x7b9a('0x29')]['key']};});_0x181e9c[_0x7b9a('0x2a')]=_[_0x7b9a('0x27')](_0x5028e7,'name');_0x181e9c['query']=_[_0x7b9a('0x2b')](_0x5b64d7[_0x7b9a('0x2c')]);_0x181e9c['filters']=_[_0x7b9a('0x2d')](_0x181e9c[_0x7b9a('0x2a')],_0x181e9c[_0x7b9a('0x2c')]);_0x2ce78b[_0x7b9a('0x2e')]=_[_0x7b9a('0x2d')](_0x181e9c['model'],qs[_0x7b9a('0x2f')](_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x2ce78b[_0x7b9a('0x2e')]=_0x2ce78b[_0x7b9a('0x2e')][_0x7b9a('0x30')]?_0x2ce78b['attributes']:_0x181e9c['model'];if(!_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x31')]('nolimit')){_0x2ce78b[_0x7b9a('0x18')]=qs[_0x7b9a('0x18')](_0x5b64d7[_0x7b9a('0x2c')]['limit']);_0x2ce78b[_0x7b9a('0x17')]=qs[_0x7b9a('0x17')](_0x5b64d7['query']['offset']);}_0x2ce78b[_0x7b9a('0x32')]=qs[_0x7b9a('0x33')](_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x33')]);_0x2ce78b[_0x7b9a('0x34')]=qs[_0x7b9a('0x35')](_[_0x7b9a('0x36')](_0x5b64d7[_0x7b9a('0x2c')],_0x181e9c['filters']),_0x5028e7);if(_0x5b64d7[_0x7b9a('0x2c')]['filter']){_0x2ce78b[_0x7b9a('0x34')]=_[_0x7b9a('0x37')](_0x2ce78b[_0x7b9a('0x34')],{'$or':_[_0x7b9a('0x27')](_0x5028e7,function(_0x3fa4cd){if(_0x3fa4cd[_0x7b9a('0x29')]!=='VIRTUAL'){var _0x34eebe={};_0x34eebe[_0x3fa4cd[_0x7b9a('0x24')]]={'$like':'%'+_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x38')]+'%'};return _0x34eebe;}})});}_0x2ce78b=_['merge']({},_0x2ce78b,_0x5b64d7[_0x7b9a('0x39')]);var _0xf86939={'where':_0x2ce78b[_0x7b9a('0x34')]};return db[_0x7b9a('0x3a')]['count'](_0xf86939)[_0x7b9a('0x1e')](function(_0x53d89a){_0x6c8b1f[_0x7b9a('0x19')]=_0x53d89a;if(_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x3b')]){_0x2ce78b[_0x7b9a('0x3c')]=[{'all':!![]}];}return db[_0x7b9a('0x3a')][_0x7b9a('0x3d')](_0x2ce78b);})['then'](function(_0x33edc6){_0x6c8b1f[_0x7b9a('0x3e')]=_0x33edc6;return _0x6c8b1f;})[_0x7b9a('0x1e')](respondWithFilteredResult(_0x45ccf5,_0x2ce78b))['catch'](handleError(_0x45ccf5,null));};exports['show']=function(_0x3724fe,_0x454b35){var _0x995d59={'raw':!![],'where':{'id':_0x3724fe[_0x7b9a('0x3f')]['id']}},_0x5cd3dd={};_0x5cd3dd[_0x7b9a('0x2a')]=_['keys'](db['VoiceMail']['rawAttributes']);_0x5cd3dd[_0x7b9a('0x2c')]=_[_0x7b9a('0x2b')](_0x3724fe['query']);_0x5cd3dd[_0x7b9a('0x35')]=_[_0x7b9a('0x2d')](_0x5cd3dd[_0x7b9a('0x2a')],_0x5cd3dd['query']);_0x995d59[_0x7b9a('0x2e')]=_['intersection'](_0x5cd3dd[_0x7b9a('0x2a')],qs[_0x7b9a('0x2f')](_0x3724fe[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x995d59[_0x7b9a('0x2e')]=_0x995d59['attributes'][_0x7b9a('0x30')]?_0x995d59['attributes']:_0x5cd3dd[_0x7b9a('0x2a')];if(_0x3724fe['query']['includeAll']){_0x995d59[_0x7b9a('0x3c')]=[{'all':!![]}];}_0x995d59=_[_0x7b9a('0x37')]({},_0x995d59,_0x3724fe[_0x7b9a('0x39')]);return db[_0x7b9a('0x3a')][_0x7b9a('0x40')](_0x995d59)[_0x7b9a('0x1e')](handleEntityNotFound(_0x454b35,null))[_0x7b9a('0x1e')](respondWithResult(_0x454b35,null))[_0x7b9a('0x41')](handleError(_0x454b35,null));};exports[_0x7b9a('0x42')]=function(_0x5088c7,_0x1d7957){return db[_0x7b9a('0x3a')]['create'](_0x5088c7['body'],{})['then'](function(_0x1b3e65){var _0x30296e=_0x5088c7[_0x7b9a('0x43')][_0x7b9a('0x20')]({'plain':!![]});if(!_0x30296e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30296e[_0x7b9a('0x44')]===_0x7b9a('0x43')){var _0x287dea=_0x1b3e65[_0x7b9a('0x20')]({'plain':!![]});var _0x2d083b='Voicemails';return db[_0x7b9a('0x45')]['find']({'where':{'name':_0x2d083b,'userProfileId':_0x30296e[_0x7b9a('0x46')]},'raw':!![]})[_0x7b9a('0x1e')](function(_0x239146){if(_0x239146&&_0x239146[_0x7b9a('0x47')]===0x0){return db['UserProfileResource'][_0x7b9a('0x42')]({'name':_0x287dea[_0x7b9a('0x24')],'resourceId':_0x287dea['id'],'type':_0x239146[_0x7b9a('0x24')],'sectionId':_0x239146['id']},{})[_0x7b9a('0x1e')](function(){return _0x1b3e65;});}else{return _0x1b3e65;}})[_0x7b9a('0x41')](function(_0x3e2f1b){logger[_0x7b9a('0x48')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e2f1b);throw _0x3e2f1b;});}return _0x1b3e65;})['then'](respondWithResult(_0x1d7957,0xc9))['catch'](handleError(_0x1d7957,null));};exports[_0x7b9a('0x1d')]=function(_0x2f8929,_0x5a1b7d){if(_0x2f8929['body']['id']){delete _0x2f8929['body']['id'];}return db['VoiceMail'][_0x7b9a('0x40')]({'where':{'id':_0x2f8929[_0x7b9a('0x3f')]['id']}})[_0x7b9a('0x1e')](handleEntityNotFound(_0x5a1b7d,null))[_0x7b9a('0x1e')](saveUpdates(_0x2f8929[_0x7b9a('0x49')],null))[_0x7b9a('0x1e')](respondWithResult(_0x5a1b7d,null))[_0x7b9a('0x41')](handleError(_0x5a1b7d,null));};exports[_0x7b9a('0x1f')]=function(_0x5dc17e,_0x1f99f5){return db['VoiceMail'][_0x7b9a('0x40')]({'where':{'id':_0x5dc17e[_0x7b9a('0x3f')]['id']}})[_0x7b9a('0x1e')](handleEntityNotFound(_0x1f99f5,null))[_0x7b9a('0x1e')](removeEntity(_0x1f99f5,null))[_0x7b9a('0x41')](handleError(_0x1f99f5,null));};exports['getMessages']=function(_0x25ec82,_0x491804,_0x3d2df4){return db[_0x7b9a('0x3a')][_0x7b9a('0x4a')]({'where':{'id':_0x25ec82['params']['id']}})['then'](handleEntityNotFound(_0x491804,null))['then'](function(_0x4f6843){var _0x33375c;var _0x8a777f={},_0xb91099={};_0xb91099['model']=_[_0x7b9a('0x2b')](db[_0x7b9a('0x4b')][_0x7b9a('0x4c')]);_0xb91099[_0x7b9a('0x2c')]=_[_0x7b9a('0x2b')](_0x25ec82['query']);_0xb91099[_0x7b9a('0x35')]=_[_0x7b9a('0x2d')](_0xb91099[_0x7b9a('0x2a')],_0xb91099['query']);_0x8a777f['attributes']=_['intersection'](_0xb91099[_0x7b9a('0x2a')],qs[_0x7b9a('0x2f')](_0x25ec82[_0x7b9a('0x2c')]['fields']));_0x8a777f[_0x7b9a('0x2e')]=_0x8a777f[_0x7b9a('0x2e')]['length']?_0x8a777f[_0x7b9a('0x2e')]:_0xb91099['model'];if(!_0x25ec82[_0x7b9a('0x2c')]['hasOwnProperty'](_0x7b9a('0x4d'))){_0x8a777f[_0x7b9a('0x18')]=qs[_0x7b9a('0x18')](_0x25ec82[_0x7b9a('0x2c')]['limit']);_0x8a777f[_0x7b9a('0x17')]=qs[_0x7b9a('0x17')](_0x25ec82[_0x7b9a('0x2c')][_0x7b9a('0x17')]);}_0x8a777f['order']=qs[_0x7b9a('0x33')](_0x25ec82['query'][_0x7b9a('0x33')]);_0x8a777f['where']=qs[_0x7b9a('0x35')](_['pick'](_0x25ec82['query'],_0xb91099['filters']));if(_0x25ec82['query'][_0x7b9a('0x38')]){_0x8a777f[_0x7b9a('0x34')]=_[_0x7b9a('0x37')](_0x8a777f[_0x7b9a('0x34')],{'$or':_['map'](_0x8a777f[_0x7b9a('0x2e')],function(_0x4b9462){var _0x50b6f1={};_0x50b6f1[_0x4b9462]={'$like':'%'+_0x25ec82[_0x7b9a('0x2c')]['filter']+'%'};return _0x50b6f1;})});}_0x8a777f['where']=_[_0x7b9a('0x37')](_0x8a777f[_0x7b9a('0x34')],{'mailboxuser':_0x4f6843['mailbox']});_0x8a777f=_[_0x7b9a('0x37')]({},_0x8a777f,_0x25ec82['options']);return db[_0x7b9a('0x4b')][_0x7b9a('0x4e')](_0x8a777f)[_0x7b9a('0x1e')](respondWithFilteredResult(_0x491804,_0x8a777f));})['catch'](handleError(_0x491804,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index a1efe1e..336520b 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 _0x67ad=['../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4801a0,_0x252c24){var _0x338e26=function(_0x1599c2){while(--_0x1599c2){_0x4801a0['push'](_0x4801a0['shift']());}};_0x338e26(++_0x252c24);}(_0x67ad,0xb3));var _0xd67a=function(_0x46ad3a,_0x4ba424){_0x46ad3a=_0x46ad3a-0x0;var _0x1a3844=_0x67ad[_0x46ad3a];return _0x1a3844;};'use strict';var _=require(_0xd67a('0x0'));var util=require(_0xd67a('0x1'));var logger=require('../../config/logger')(_0xd67a('0x2'));var moment=require(_0xd67a('0x3'));var BPromise=require(_0xd67a('0x4'));var rp=require(_0xd67a('0x5'));var fs=require('fs');var path=require(_0xd67a('0x6'));var rimraf=require(_0xd67a('0x7'));var config=require(_0xd67a('0x8'));var attributes=require(_0xd67a('0x9'));module[_0xd67a('0xa')]=function(_0x381724,_0x406274){return _0x381724[_0xd67a('0xb')](_0xd67a('0xc'),attributes,{'tableName':_0xd67a('0xd'),'paranoid':![],'indexes':[{'name':_0xd67a('0xe'),'fields':[_0xd67a('0xf'),_0xd67a('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x88d6=['rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x24d499,_0xfc7fd0){var _0x569806=function(_0x182b8f){while(--_0x182b8f){_0x24d499['push'](_0x24d499['shift']());}};_0x569806(++_0xfc7fd0);}(_0x88d6,0xb9));var _0x688d=function(_0x20c87b,_0x3cea13){_0x20c87b=_0x20c87b-0x0;var _0xe4bc01=_0x88d6[_0x20c87b];return _0xe4bc01;};'use strict';var _=require(_0x688d('0x0'));var util=require(_0x688d('0x1'));var logger=require(_0x688d('0x2'))(_0x688d('0x3'));var moment=require(_0x688d('0x4'));var BPromise=require(_0x688d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x688d('0x6'));var rimraf=require(_0x688d('0x7'));var config=require(_0x688d('0x8'));var attributes=require(_0x688d('0x9'));module[_0x688d('0xa')]=function(_0x1a32f,_0x3ba2c6){return _0x1a32f[_0x688d('0xb')](_0x688d('0xc'),attributes,{'tableName':_0x688d('0xd'),'paranoid':![],'indexes':[{'name':_0x688d('0xe'),'fields':[_0x688d('0xf'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 3d088ac..c74b27c 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 _0xa3b8=['request\x20sent','result','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','error','message'];(function(_0x2e339e,_0x3e4e47){var _0x5ef69e=function(_0x4bd000){while(--_0x4bd000){_0x2e339e['push'](_0x2e339e['shift']());}};_0x5ef69e(++_0x3e4e47);}(_0xa3b8,0xdf));var _0x8a3b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa3b8[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x8a3b('0x0'));var moment=require(_0x8a3b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8a3b('0x2'));var logger=require(_0x8a3b('0x3'))(_0x8a3b('0x4'));var config=require(_0x8a3b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8a3b('0x6')][_0x8a3b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x887ef0,_0x3592b2,_0x22a527){return new BPromise(function(_0x413f5d,_0xbcc5b4){return client[_0x8a3b('0x8')](_0x887ef0,_0x22a527)[_0x8a3b('0x9')](function(_0x1bcc3f){logger[_0x8a3b('0xa')](_0x8a3b('0xb'),_0x3592b2,'request\x20sent');logger[_0x8a3b('0xc')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x3592b2,'request\x20sent',JSON['stringify'](_0x1bcc3f));if(_0x1bcc3f[_0x8a3b('0xd')]){if(_0x1bcc3f[_0x8a3b('0xd')]['code']===0x1f4){logger[_0x8a3b('0xd')](_0x8a3b('0xb'),_0x3592b2,_0x1bcc3f['error'][_0x8a3b('0xe')]);return _0xbcc5b4(_0x1bcc3f[_0x8a3b('0xd')][_0x8a3b('0xe')]);}logger[_0x8a3b('0xd')](_0x8a3b('0xb'),_0x3592b2,_0x1bcc3f[_0x8a3b('0xd')][_0x8a3b('0xe')]);return _0x413f5d(_0x1bcc3f[_0x8a3b('0xd')]['message']);}else{logger['info'](_0x8a3b('0xb'),_0x3592b2,_0x8a3b('0xf'));_0x413f5d(_0x1bcc3f[_0x8a3b('0x10')][_0x8a3b('0xe')]);}})['catch'](function(_0x1006a8){logger[_0x8a3b('0xd')](_0x8a3b('0xb'),_0x3592b2,_0x1006a8);_0xbcc5b4(_0x1006a8);});});} \ No newline at end of file +var _0xb50c=['VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x53aec6,_0x18507c){var _0x447b15=function(_0x8cbed3){while(--_0x8cbed3){_0x53aec6['push'](_0x53aec6['shift']());}};_0x447b15(++_0x18507c);}(_0xb50c,0x1ec));var _0xcb50=function(_0x961333,_0x4c183a){_0x961333=_0x961333-0x0;var _0x48d01d=_0xb50c[_0x961333];return _0x48d01d;};'use strict';var _=require('lodash');var util=require(_0xcb50('0x0'));var moment=require(_0xcb50('0x1'));var BPromise=require(_0xcb50('0x2'));var rs=require(_0xcb50('0x3'));var fs=require('fs');var Redis=require(_0xcb50('0x4'));var db=require(_0xcb50('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb50('0x6'))(_0xcb50('0x7'));var config=require(_0xcb50('0x8'));var jayson=require(_0xcb50('0x9'));var client=jayson[_0xcb50('0xa')][_0xcb50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53e701,_0x5bab34,_0x16d9a7){return new BPromise(function(_0x57ff39,_0x4a2ba2){return client[_0xcb50('0xc')](_0x53e701,_0x16d9a7)['then'](function(_0xa8c62a){logger[_0xcb50('0xd')](_0xcb50('0xe'),_0x5bab34,_0xcb50('0xf'));logger['debug'](_0xcb50('0x10'),_0x5bab34,_0xcb50('0xf'),JSON[_0xcb50('0x11')](_0xa8c62a));if(_0xa8c62a['error']){if(_0xa8c62a[_0xcb50('0x12')][_0xcb50('0x13')]===0x1f4){logger[_0xcb50('0x12')](_0xcb50('0xe'),_0x5bab34,_0xa8c62a[_0xcb50('0x12')][_0xcb50('0x14')]);return _0x4a2ba2(_0xa8c62a[_0xcb50('0x12')][_0xcb50('0x14')]);}logger[_0xcb50('0x12')]('VoiceMail,\x20%s,\x20%s',_0x5bab34,_0xa8c62a[_0xcb50('0x12')][_0xcb50('0x14')]);return _0x57ff39(_0xa8c62a['error'][_0xcb50('0x14')]);}else{logger[_0xcb50('0xd')]('VoiceMail,\x20%s,\x20%s',_0x5bab34,_0xcb50('0xf'));_0x57ff39(_0xa8c62a[_0xcb50('0x15')][_0xcb50('0x14')]);}})[_0xcb50('0x16')](function(_0x3f026f){logger[_0xcb50('0x12')](_0xcb50('0xe'),_0x5bab34,_0x3f026f);_0x4a2ba2(_0x3f026f);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 03a876d..fce0c1e 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 _0xc37b=['update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','download','post','create'];(function(_0x4126e6,_0x5185d3){var _0x4a7152=function(_0x2357ff){while(--_0x2357ff){_0x4126e6['push'](_0x4126e6['shift']());}};_0x4a7152(++_0x5185d3);}(_0xc37b,0x12a));var _0xbc37=function(_0x54ac7a,_0x313ae3){_0x54ac7a=_0x54ac7a-0x0;var _0x5a438e=_0xc37b[_0x54ac7a];return _0x5a438e;};'use strict';var multer=require('multer');var util=require(_0xbc37('0x0'));var path=require('path');var timeout=require(_0xbc37('0x1'));var express=require(_0xbc37('0x2'));var router=express[_0xbc37('0x3')]();var fs_extra=require(_0xbc37('0x4'));var auth=require(_0xbc37('0x5'));var interaction=require(_0xbc37('0x6'));var config=require(_0xbc37('0x7'));var controller=require(_0xbc37('0x8'));router[_0xbc37('0x9')]('/',auth[_0xbc37('0xa')](),controller[_0xbc37('0xb')]);router[_0xbc37('0x9')](_0xbc37('0xc'),auth[_0xbc37('0xa')](),controller[_0xbc37('0xd')]);router[_0xbc37('0x9')]('/:id/download',auth[_0xbc37('0xa')](),controller[_0xbc37('0xe')]);router[_0xbc37('0xf')]('/',auth['isAuthenticated'](),controller[_0xbc37('0x10')]);router['put'](_0xbc37('0xc'),auth[_0xbc37('0xa')](),controller[_0xbc37('0x11')]);router[_0xbc37('0x12')](_0xbc37('0xc'),auth[_0xbc37('0xa')](),controller[_0xbc37('0x13')]);module[_0xbc37('0x14')]=router; \ No newline at end of file +var _0x2725=['show','/:id/download','download','post','create','put','delete','destroy','exports','util','path','express','Router','fs-extra','./voiceMailMessage.controller','get','/:id','isAuthenticated'];(function(_0x28c48b,_0x48a737){var _0x592e82=function(_0x5ba452){while(--_0x5ba452){_0x28c48b['push'](_0x28c48b['shift']());}};_0x592e82(++_0x48a737);}(_0x2725,0x117));var _0x5272=function(_0x43de22,_0x1eced6){_0x43de22=_0x43de22-0x0;var _0x4b15ee=_0x2725[_0x43de22];return _0x4b15ee;};'use strict';var multer=require('multer');var util=require(_0x5272('0x0'));var path=require(_0x5272('0x1'));var timeout=require('connect-timeout');var express=require(_0x5272('0x2'));var router=express[_0x5272('0x3')]();var fs_extra=require(_0x5272('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5272('0x5'));router[_0x5272('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5272('0x6')](_0x5272('0x7'),auth[_0x5272('0x8')](),controller[_0x5272('0x9')]);router[_0x5272('0x6')](_0x5272('0xa'),auth[_0x5272('0x8')](),controller[_0x5272('0xb')]);router[_0x5272('0xc')]('/',auth[_0x5272('0x8')](),controller[_0x5272('0xd')]);router[_0x5272('0xe')](_0x5272('0x7'),auth[_0x5272('0x8')](),controller['update']);router[_0x5272('0xf')](_0x5272('0x7'),auth[_0x5272('0x8')](),controller[_0x5272('0x10')]);module[_0x5272('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index ab3c176..c278d3f 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 _0xcbe2=['TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','STRING','BLOB','long'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xcbe2,0xd9));var _0x2cbe=function(_0x39ba9d,_0x491034){_0x39ba9d=_0x39ba9d-0x0;var _0x5e80ea=_0xcbe2[_0x39ba9d];return _0x5e80ea;};'use strict';var Sequelize=require(_0x2cbe('0x0'));module[_0x2cbe('0x1')]={'name':{'type':Sequelize[_0x2cbe('0x2')],'get':function(_0x2dba65){return this[_0x2cbe('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x2cbe('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x2cbe('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x2cbe('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x2cbe('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x2cbe('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2cbe('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x2cbe('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x2cbe('0x5')](_0x2cbe('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x2cbe('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x2cbe('0x4')],'defaultValue':''},'stamp':{'type':_0x2cbe('0x7'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x0fb9=['literal','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP'];(function(_0x105a8a,_0x15a3a2){var _0x105a0e=function(_0x3beeb1){while(--_0x3beeb1){_0x105a8a['push'](_0x105a8a['shift']());}};_0x105a0e(++_0x15a3a2);}(_0x0fb9,0x133));var _0x90fb=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0fb9[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x90fb('0x0'));module[_0x90fb('0x1')]={'name':{'type':Sequelize[_0x90fb('0x2')],'get':function(_0x3bba86){return this[_0x90fb('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x90fb('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x90fb('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x90fb('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x90fb('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x90fb('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x90fb('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x90fb('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x90fb('0x7'),'defaultValue':Sequelize[_0x90fb('0x8')]('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 ee47cae..e5866ec 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 _0x1299=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','send','VoiceMailMessage','fieldName','type','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','include','then','rows','catch','show','params','keys','rawAttributes','includeAll','options','find','create','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus'];(function(_0x524142,_0x2cb174){var _0x44fc17=function(_0x1ee1b9){while(--_0x1ee1b9){_0x524142['push'](_0x524142['shift']());}};_0x44fc17(++_0x2cb174);}(_0x1299,0x8d));var _0x9129=function(_0x473775,_0x106cdf){_0x473775=_0x473775-0x0;var _0x1b36a3=_0x1299[_0x473775];return _0x1b36a3;};'use strict';var emlformat=require(_0x9129('0x0'));var rimraf=require(_0x9129('0x1'));var zipdir=require(_0x9129('0x2'));var jsonpatch=require(_0x9129('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9129('0x4'));var Mustache=require(_0x9129('0x5'));var util=require(_0x9129('0x6'));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(_0x9129('0x7'));var _=require(_0x9129('0x8'));var squel=require(_0x9129('0x9'));var crypto=require(_0x9129('0xa'));var jsforce=require(_0x9129('0xb'));var deskjs=require(_0x9129('0xc'));var toCsv=require(_0x9129('0xd'));var querystring=require(_0x9129('0xe'));var Papa=require('papaparse');var Redis=require(_0x9129('0xf'));var authService=require(_0x9129('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9129('0x11'));var hardwareService=require(_0x9129('0x12'));var logger=require(_0x9129('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9129('0x14'));var licenseUtil=require(_0x9129('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x219eb4,_0x3697d0){_0x3697d0=_0x3697d0||0xcc;return function(_0x306f1b){if(_0x306f1b){return _0x219eb4[_0x9129('0x16')](_0x3697d0);}return _0x219eb4[_0x9129('0x17')](_0x3697d0)[_0x9129('0x18')]();};}function respondWithResult(_0x11e90a,_0xe2f665){_0xe2f665=_0xe2f665||0xc8;return function(_0x4de33b){if(_0x4de33b){return _0x11e90a[_0x9129('0x17')](_0xe2f665)[_0x9129('0x19')](_0x4de33b);}};}function respondWithFilteredResult(_0x554b05,_0x2d7c25){return function(_0x106c74){if(_0x106c74){var _0x3b8cf9=typeof _0x2d7c25[_0x9129('0x1a')]===_0x9129('0x1b')&&typeof _0x2d7c25[_0x9129('0x1c')]===_0x9129('0x1b');var _0x2727eb=_0x106c74[_0x9129('0x1d')];var _0x208860=_0x3b8cf9?0x0:_0x2d7c25[_0x9129('0x1a')];var _0x1832c0=_0x3b8cf9?_0x106c74[_0x9129('0x1d')]:_0x2d7c25[_0x9129('0x1a')]+_0x2d7c25[_0x9129('0x1c')];var _0x22db51;if(_0x1832c0>=_0x2727eb){_0x1832c0=_0x2727eb;_0x22db51=0xc8;}else{_0x22db51=0xce;}_0x554b05[_0x9129('0x17')](_0x22db51);return _0x554b05[_0x9129('0x1e')](_0x9129('0x1f'),_0x208860+'-'+_0x1832c0+'/'+_0x2727eb)[_0x9129('0x19')](_0x106c74);}return null;};}function patchUpdates(_0xc69b4a){return function(_0x304abc){try{jsonpatch[_0x9129('0x20')](_0x304abc,_0xc69b4a,!![]);}catch(_0x59e31c){return BPromise[_0x9129('0x21')](_0x59e31c);}return _0x304abc[_0x9129('0x22')]();};}function saveUpdates(_0x403160,_0x5d5a52){return function(_0x4dfe35){if(_0x4dfe35){return _0x4dfe35[_0x9129('0x23')](_0x403160)['then'](function(_0x1dd55b){return _0x1dd55b;});}return null;};}function removeEntity(_0x59ea00,_0x368b65){return function(_0x9eb5a5){if(_0x9eb5a5){return _0x9eb5a5[_0x9129('0x24')]()['then'](function(){_0x59ea00[_0x9129('0x17')](0xcc)[_0x9129('0x18')]();});}};}function handleEntityNotFound(_0x3eac8d,_0x358ec0){return function(_0x53b73f){if(!_0x53b73f){_0x3eac8d[_0x9129('0x16')](0x194);}return _0x53b73f;};}function handleError(_0x1df8df,_0xab02a4){_0xab02a4=_0xab02a4||0x1f4;return function(_0x56cf6a){logger['error'](_0x56cf6a['stack']);if(_0x56cf6a[_0x9129('0x25')]){delete _0x56cf6a[_0x9129('0x25')];}_0x1df8df[_0x9129('0x17')](_0xab02a4)[_0x9129('0x26')](_0x56cf6a);};}exports['index']=function(_0x3ac74a,_0x15c7ac){var _0x20eb0b={},_0x204665={},_0x472d51={'count':0x0,'rows':[]};var _0x117a20=_['map'](db[_0x9129('0x27')]['rawAttributes'],function(_0x481052){return{'name':_0x481052[_0x9129('0x28')],'type':_0x481052[_0x9129('0x29')]['key']};});_0x204665[_0x9129('0x2a')]=_[_0x9129('0x2b')](_['map'](_0x117a20,'name'),[_0x9129('0x25')]);_0x204665['query']=_['keys'](_0x3ac74a[_0x9129('0x2c')]);_0x204665[_0x9129('0x2d')]=_[_0x9129('0x2e')](_0x204665[_0x9129('0x2a')],_0x204665[_0x9129('0x2c')]);_0x20eb0b[_0x9129('0x2f')]=_[_0x9129('0x2e')](_0x204665['model'],qs[_0x9129('0x30')](_0x3ac74a[_0x9129('0x2c')][_0x9129('0x30')]));_0x20eb0b[_0x9129('0x2f')]=_0x20eb0b[_0x9129('0x2f')][_0x9129('0x31')]?_0x20eb0b[_0x9129('0x2f')]:_0x204665['model'];if(!_0x3ac74a[_0x9129('0x2c')][_0x9129('0x32')](_0x9129('0x33'))){_0x20eb0b[_0x9129('0x1c')]=qs[_0x9129('0x1c')](_0x3ac74a['query'][_0x9129('0x1c')]);_0x20eb0b[_0x9129('0x1a')]=qs['offset'](_0x3ac74a[_0x9129('0x2c')][_0x9129('0x1a')]);}_0x20eb0b[_0x9129('0x34')]=qs[_0x9129('0x35')](_0x3ac74a[_0x9129('0x2c')][_0x9129('0x35')]);_0x20eb0b[_0x9129('0x36')]=qs[_0x9129('0x2d')](_['pick'](_0x3ac74a[_0x9129('0x2c')],_0x204665['filters']),_0x117a20);if(_0x3ac74a[_0x9129('0x2c')][_0x9129('0x37')]){_0x20eb0b[_0x9129('0x36')]=_['merge'](_0x20eb0b[_0x9129('0x36')],{'$or':_['map'](_0x117a20,function(_0x4249a2){if(_0x4249a2[_0x9129('0x29')]!==_0x9129('0x38')){var _0x436847={};_0x436847[_0x4249a2[_0x9129('0x25')]]={'$like':'%'+_0x3ac74a['query'][_0x9129('0x37')]+'%'};return _0x436847;}})});}_0x20eb0b=_[_0x9129('0x39')]({},_0x20eb0b,_0x3ac74a['options']);var _0x3b2544={'where':_0x20eb0b[_0x9129('0x36')]};return db['VoiceMailMessage'][_0x9129('0x1d')](_0x3b2544)['then'](function(_0x866aaf){_0x472d51[_0x9129('0x1d')]=_0x866aaf;if(_0x3ac74a[_0x9129('0x2c')]['includeAll']){_0x20eb0b[_0x9129('0x3a')]=[{'all':!![]}];}return db[_0x9129('0x27')]['findAll'](_0x20eb0b);})[_0x9129('0x3b')](function(_0x136c37){_0x472d51[_0x9129('0x3c')]=_0x136c37;return _0x472d51;})[_0x9129('0x3b')](respondWithFilteredResult(_0x15c7ac,_0x20eb0b))[_0x9129('0x3d')](handleError(_0x15c7ac,null));};exports[_0x9129('0x3e')]=function(_0x1b8ec7,_0x3ff893){var _0x26454e={'raw':!![],'where':{'id':_0x1b8ec7[_0x9129('0x3f')]['id']}},_0x52cf3f={};_0x52cf3f[_0x9129('0x2a')]=_[_0x9129('0x40')](db[_0x9129('0x27')][_0x9129('0x41')]);_0x52cf3f[_0x9129('0x2c')]=_[_0x9129('0x40')](_0x1b8ec7[_0x9129('0x2c')]);_0x52cf3f[_0x9129('0x2d')]=_['intersection'](_0x52cf3f[_0x9129('0x2a')],_0x52cf3f[_0x9129('0x2c')]);_0x26454e[_0x9129('0x2f')]=_['intersection'](_0x52cf3f[_0x9129('0x2a')],qs[_0x9129('0x30')](_0x1b8ec7[_0x9129('0x2c')]['fields']));_0x26454e['attributes']=_0x26454e[_0x9129('0x2f')][_0x9129('0x31')]?_0x26454e[_0x9129('0x2f')]:_0x52cf3f['model'];if(_0x1b8ec7['query'][_0x9129('0x42')]){_0x26454e[_0x9129('0x3a')]=[{'all':!![]}];}_0x26454e=_[_0x9129('0x39')]({},_0x26454e,_0x1b8ec7[_0x9129('0x43')]);return db[_0x9129('0x27')][_0x9129('0x44')](_0x26454e)['then'](handleEntityNotFound(_0x3ff893,null))[_0x9129('0x3b')](respondWithResult(_0x3ff893,null))['catch'](handleError(_0x3ff893,null));};exports[_0x9129('0x45')]=function(_0x2fa515,_0xec5118){return db[_0x9129('0x27')]['create'](_0x2fa515['body'],{})[_0x9129('0x3b')](respondWithResult(_0xec5118,0xc9))[_0x9129('0x3d')](handleError(_0xec5118,null));};exports['update']=function(_0x597b6d,_0x441f0e){if(_0x597b6d[_0x9129('0x46')]['id']){delete _0x597b6d[_0x9129('0x46')]['id'];}return db[_0x9129('0x27')][_0x9129('0x44')]({'where':{'id':_0x597b6d[_0x9129('0x3f')]['id']}})['then'](handleEntityNotFound(_0x441f0e,null))[_0x9129('0x3b')](saveUpdates(_0x597b6d[_0x9129('0x46')],null))[_0x9129('0x3b')](respondWithResult(_0x441f0e,null))[_0x9129('0x3d')](handleError(_0x441f0e,null));};exports[_0x9129('0x24')]=function(_0x1658e9,_0x27f0d4){return db['VoiceMailMessage'][_0x9129('0x44')]({'where':{'id':_0x1658e9[_0x9129('0x3f')]['id']}})[_0x9129('0x3b')](handleEntityNotFound(_0x27f0d4,null))['then'](removeEntity(_0x27f0d4,null))[_0x9129('0x3d')](handleError(_0x27f0d4,null));};exports[_0x9129('0x47')]=function(_0x177a00,_0x18daa5,_0x2fc4d1){return db[_0x9129('0x27')][_0x9129('0x44')]({'where':{'id':_0x177a00[_0x9129('0x3f')]['id']},'attributes':['id',_0x9129('0x48'),_0x9129('0x49')]})['then'](handleEntityNotFound(_0x18daa5,null))[_0x9129('0x3b')](function(_0x194328){if(_0x194328){if(!_0x194328['recording']){throw new db[(_0x9129('0x4a'))][(_0x9129('0x4b'))](_0x9129('0x4c'));}var _0x3089e6={'Content-Type':_0x9129('0x4d'),'Content-Disposition':_0x9129('0x4e')};if(_0x194328['msg_id']){_0x3089e6[_0x9129('0x4f')]=_0x9129('0x50')+_0x194328[_0x9129('0x49')]+_0x9129('0x51');}_0x18daa5[_0x9129('0x1e')](_0x3089e6);return _0x18daa5[_0x9129('0x26')](new Buffer(_0x194328[_0x9129('0x48')]));}})['catch'](handleError(_0x18daa5,null));}; \ No newline at end of file +var _0xfddc=['VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','map','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','rows','catch','show','params','keys','options','find','create','body','download','recording','msg_id','Sequelize','ValidationError'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0xfddc,0xaf));var _0xcfdd=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xfddc[_0x12f688];return _0x59c3de;};'use strict';var emlformat=require(_0xcfdd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcfdd('0x1'));var rp=require(_0xcfdd('0x2'));var moment=require(_0xcfdd('0x3'));var BPromise=require(_0xcfdd('0x4'));var Mustache=require(_0xcfdd('0x5'));var util=require(_0xcfdd('0x6'));var path=require(_0xcfdd('0x7'));var sox=require('sox');var csv=require(_0xcfdd('0x8'));var ejs=require(_0xcfdd('0x9'));var fs=require('fs');var fs_extra=require(_0xcfdd('0xa'));var _=require(_0xcfdd('0xb'));var squel=require('squel');var crypto=require(_0xcfdd('0xc'));var jsforce=require(_0xcfdd('0xd'));var deskjs=require(_0xcfdd('0xe'));var toCsv=require(_0xcfdd('0x8'));var querystring=require(_0xcfdd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcfdd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcfdd('0x11'));var hardwareService=require(_0xcfdd('0x12'));var logger=require(_0xcfdd('0x13'))(_0xcfdd('0x14'));var utils=require('../../config/utils');var config=require(_0xcfdd('0x15'));var licenseUtil=require(_0xcfdd('0x16'));var db=require(_0xcfdd('0x17'))['db'];function respondWithStatusCode(_0x50301d,_0x7c0c13){_0x7c0c13=_0x7c0c13||0xcc;return function(_0x1f8954){if(_0x1f8954){return _0x50301d[_0xcfdd('0x18')](_0x7c0c13);}return _0x50301d[_0xcfdd('0x19')](_0x7c0c13)[_0xcfdd('0x1a')]();};}function respondWithResult(_0x1d3fee,_0x385e59){_0x385e59=_0x385e59||0xc8;return function(_0x2117c5){if(_0x2117c5){return _0x1d3fee[_0xcfdd('0x19')](_0x385e59)[_0xcfdd('0x1b')](_0x2117c5);}};}function respondWithFilteredResult(_0x1faca0,_0x3aa30a){return function(_0x578ec8){if(_0x578ec8){var _0x324372=typeof _0x3aa30a[_0xcfdd('0x1c')]===_0xcfdd('0x1d')&&typeof _0x3aa30a[_0xcfdd('0x1e')]==='undefined';var _0x481853=_0x578ec8[_0xcfdd('0x1f')];var _0x4d43b7=_0x324372?0x0:_0x3aa30a[_0xcfdd('0x1c')];var _0x14e6de=_0x324372?_0x578ec8['count']:_0x3aa30a[_0xcfdd('0x1c')]+_0x3aa30a[_0xcfdd('0x1e')];var _0xb0dbad;if(_0x14e6de>=_0x481853){_0x14e6de=_0x481853;_0xb0dbad=0xc8;}else{_0xb0dbad=0xce;}_0x1faca0['status'](_0xb0dbad);return _0x1faca0[_0xcfdd('0x20')]('Content-Range',_0x4d43b7+'-'+_0x14e6de+'/'+_0x481853)[_0xcfdd('0x1b')](_0x578ec8);}return null;};}function patchUpdates(_0x1af080){return function(_0x2cdeab){try{jsonpatch[_0xcfdd('0x21')](_0x2cdeab,_0x1af080,!![]);}catch(_0x192a56){return BPromise[_0xcfdd('0x22')](_0x192a56);}return _0x2cdeab['save']();};}function saveUpdates(_0x2e866c,_0x401e5b){return function(_0x5d2436){if(_0x5d2436){return _0x5d2436[_0xcfdd('0x23')](_0x2e866c)[_0xcfdd('0x24')](function(_0x4ab0b1){return _0x4ab0b1;});}return null;};}function removeEntity(_0x4dd9cf,_0x397af4){return function(_0x87444){if(_0x87444){return _0x87444[_0xcfdd('0x25')]()[_0xcfdd('0x24')](function(){_0x4dd9cf[_0xcfdd('0x19')](0xcc)[_0xcfdd('0x1a')]();});}};}function handleEntityNotFound(_0x543aa5,_0x462ae8){return function(_0xbe8bda){if(!_0xbe8bda){_0x543aa5['sendStatus'](0x194);}return _0xbe8bda;};}function handleError(_0x1edc1d,_0x1260a3){_0x1260a3=_0x1260a3||0x1f4;return function(_0x3e67aa){logger[_0xcfdd('0x26')](_0x3e67aa[_0xcfdd('0x27')]);if(_0x3e67aa[_0xcfdd('0x28')]){delete _0x3e67aa[_0xcfdd('0x28')];}_0x1edc1d[_0xcfdd('0x19')](_0x1260a3)[_0xcfdd('0x29')](_0x3e67aa);};}exports['index']=function(_0x18ea76,_0x39eaea){var _0xbdf70d={},_0x386751={},_0x5db3ec={'count':0x0,'rows':[]};var _0x23fa99=_[_0xcfdd('0x2a')](db[_0xcfdd('0x2b')][_0xcfdd('0x2c')],function(_0x3d9dd5){return{'name':_0x3d9dd5['fieldName'],'type':_0x3d9dd5[_0xcfdd('0x2d')][_0xcfdd('0x2e')]};});_0x386751[_0xcfdd('0x2f')]=_[_0xcfdd('0x30')](_[_0xcfdd('0x2a')](_0x23fa99,_0xcfdd('0x28')),[_0xcfdd('0x28')]);_0x386751[_0xcfdd('0x31')]=_['keys'](_0x18ea76['query']);_0x386751[_0xcfdd('0x32')]=_[_0xcfdd('0x33')](_0x386751[_0xcfdd('0x2f')],_0x386751[_0xcfdd('0x31')]);_0xbdf70d[_0xcfdd('0x34')]=_[_0xcfdd('0x33')](_0x386751[_0xcfdd('0x2f')],qs[_0xcfdd('0x35')](_0x18ea76[_0xcfdd('0x31')][_0xcfdd('0x35')]));_0xbdf70d[_0xcfdd('0x34')]=_0xbdf70d[_0xcfdd('0x34')][_0xcfdd('0x36')]?_0xbdf70d['attributes']:_0x386751['model'];if(!_0x18ea76[_0xcfdd('0x31')][_0xcfdd('0x37')](_0xcfdd('0x38'))){_0xbdf70d[_0xcfdd('0x1e')]=qs['limit'](_0x18ea76[_0xcfdd('0x31')]['limit']);_0xbdf70d[_0xcfdd('0x1c')]=qs['offset'](_0x18ea76[_0xcfdd('0x31')][_0xcfdd('0x1c')]);}_0xbdf70d[_0xcfdd('0x39')]=qs[_0xcfdd('0x3a')](_0x18ea76[_0xcfdd('0x31')][_0xcfdd('0x3a')]);_0xbdf70d['where']=qs['filters'](_[_0xcfdd('0x3b')](_0x18ea76[_0xcfdd('0x31')],_0x386751[_0xcfdd('0x32')]),_0x23fa99);if(_0x18ea76[_0xcfdd('0x31')][_0xcfdd('0x3c')]){_0xbdf70d['where']=_['merge'](_0xbdf70d[_0xcfdd('0x3d')],{'$or':_[_0xcfdd('0x2a')](_0x23fa99,function(_0x2b457d){if(_0x2b457d[_0xcfdd('0x2d')]!==_0xcfdd('0x3e')){var _0x1b2cd2={};_0x1b2cd2[_0x2b457d['name']]={'$like':'%'+_0x18ea76['query'][_0xcfdd('0x3c')]+'%'};return _0x1b2cd2;}})});}_0xbdf70d=_[_0xcfdd('0x3f')]({},_0xbdf70d,_0x18ea76['options']);var _0x39ab81={'where':_0xbdf70d[_0xcfdd('0x3d')]};return db[_0xcfdd('0x2b')][_0xcfdd('0x1f')](_0x39ab81)['then'](function(_0x316aef){_0x5db3ec[_0xcfdd('0x1f')]=_0x316aef;if(_0x18ea76[_0xcfdd('0x31')][_0xcfdd('0x40')]){_0xbdf70d[_0xcfdd('0x41')]=[{'all':!![]}];}return db[_0xcfdd('0x2b')]['findAll'](_0xbdf70d);})[_0xcfdd('0x24')](function(_0x4a6820){_0x5db3ec[_0xcfdd('0x42')]=_0x4a6820;return _0x5db3ec;})[_0xcfdd('0x24')](respondWithFilteredResult(_0x39eaea,_0xbdf70d))[_0xcfdd('0x43')](handleError(_0x39eaea,null));};exports[_0xcfdd('0x44')]=function(_0x7f3150,_0x13e869){var _0x52b355={'raw':!![],'where':{'id':_0x7f3150[_0xcfdd('0x45')]['id']}},_0x457b8d={};_0x457b8d['model']=_[_0xcfdd('0x46')](db['VoiceMailMessage']['rawAttributes']);_0x457b8d['query']=_[_0xcfdd('0x46')](_0x7f3150[_0xcfdd('0x31')]);_0x457b8d[_0xcfdd('0x32')]=_['intersection'](_0x457b8d[_0xcfdd('0x2f')],_0x457b8d['query']);_0x52b355[_0xcfdd('0x34')]=_[_0xcfdd('0x33')](_0x457b8d[_0xcfdd('0x2f')],qs['fields'](_0x7f3150[_0xcfdd('0x31')][_0xcfdd('0x35')]));_0x52b355['attributes']=_0x52b355['attributes'][_0xcfdd('0x36')]?_0x52b355[_0xcfdd('0x34')]:_0x457b8d[_0xcfdd('0x2f')];if(_0x7f3150[_0xcfdd('0x31')][_0xcfdd('0x40')]){_0x52b355[_0xcfdd('0x41')]=[{'all':!![]}];}_0x52b355=_['merge']({},_0x52b355,_0x7f3150[_0xcfdd('0x47')]);return db[_0xcfdd('0x2b')][_0xcfdd('0x48')](_0x52b355)[_0xcfdd('0x24')](handleEntityNotFound(_0x13e869,null))['then'](respondWithResult(_0x13e869,null))[_0xcfdd('0x43')](handleError(_0x13e869,null));};exports['create']=function(_0xbe5b6,_0x2af1f2){return db[_0xcfdd('0x2b')][_0xcfdd('0x49')](_0xbe5b6[_0xcfdd('0x4a')],{})[_0xcfdd('0x24')](respondWithResult(_0x2af1f2,0xc9))[_0xcfdd('0x43')](handleError(_0x2af1f2,null));};exports[_0xcfdd('0x23')]=function(_0x2ac803,_0x54a63b){if(_0x2ac803[_0xcfdd('0x4a')]['id']){delete _0x2ac803['body']['id'];}return db[_0xcfdd('0x2b')][_0xcfdd('0x48')]({'where':{'id':_0x2ac803[_0xcfdd('0x45')]['id']}})[_0xcfdd('0x24')](handleEntityNotFound(_0x54a63b,null))[_0xcfdd('0x24')](saveUpdates(_0x2ac803['body'],null))[_0xcfdd('0x24')](respondWithResult(_0x54a63b,null))[_0xcfdd('0x43')](handleError(_0x54a63b,null));};exports[_0xcfdd('0x25')]=function(_0x26806c,_0xa808c2){return db['VoiceMailMessage'][_0xcfdd('0x48')]({'where':{'id':_0x26806c['params']['id']}})['then'](handleEntityNotFound(_0xa808c2,null))[_0xcfdd('0x24')](removeEntity(_0xa808c2,null))[_0xcfdd('0x43')](handleError(_0xa808c2,null));};exports[_0xcfdd('0x4b')]=function(_0xbaee8c,_0x1114b0,_0x39ff75){return db[_0xcfdd('0x2b')]['find']({'where':{'id':_0xbaee8c[_0xcfdd('0x45')]['id']},'attributes':['id',_0xcfdd('0x4c'),_0xcfdd('0x4d')]})[_0xcfdd('0x24')](handleEntityNotFound(_0x1114b0,null))[_0xcfdd('0x24')](function(_0x493959){if(_0x493959){if(!_0x493959['recording']){throw new db[(_0xcfdd('0x4e'))][(_0xcfdd('0x4f'))](_0xcfdd('0x50'));}var _0x359865={'Content-Type':_0xcfdd('0x51'),'Content-Disposition':_0xcfdd('0x52')};if(_0x493959[_0xcfdd('0x4d')]){_0x359865[_0xcfdd('0x53')]='attachment;\x20filename=\x22'+_0x493959[_0xcfdd('0x4d')]+_0xcfdd('0x54');}_0x1114b0[_0xcfdd('0x20')](_0x359865);return _0x1114b0[_0xcfdd('0x29')](new Buffer(_0x493959[_0xcfdd('0x4c')]));}})[_0xcfdd('0x43')](handleError(_0x1114b0,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 5759f2c..8ac9614 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 _0x9218=['define','voice_voicemail_messages','dir','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports'];(function(_0x2e345e,_0x177e34){var _0x5b6d03=function(_0x204db0){while(--_0x204db0){_0x2e345e['push'](_0x2e345e['shift']());}};_0x5b6d03(++_0x177e34);}(_0x9218,0x13b));var _0x8921=function(_0x475564,_0x41345b){_0x475564=_0x475564-0x0;var _0x145208=_0x9218[_0x475564];return _0x145208;};'use strict';var _=require(_0x8921('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8921('0x1'));var moment=require(_0x8921('0x2'));var BPromise=require(_0x8921('0x3'));var rp=require(_0x8921('0x4'));var fs=require('fs');var path=require(_0x8921('0x5'));var rimraf=require('rimraf');var config=require(_0x8921('0x6'));var attributes=require(_0x8921('0x7'));module[_0x8921('0x8')]=function(_0x12c256,_0x51861e){return _0x12c256[_0x8921('0x9')]('VoiceMailMessage',attributes,{'tableName':_0x8921('0xa'),'paranoid':![],'indexes':[{'name':_0x8921('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0xa166=['../../config/logger','api','moment','request-promise','path','../../config/environment','exports','VoiceMailMessage','dir','lodash'];(function(_0x4efd3d,_0x2b9694){var _0x1293f2=function(_0x14b90f){while(--_0x14b90f){_0x4efd3d['push'](_0x4efd3d['shift']());}};_0x1293f2(++_0x2b9694);}(_0xa166,0xe5));var _0x6a16=function(_0x439a6f,_0x4c43e0){_0x439a6f=_0x439a6f-0x0;var _0x62756=_0xa166[_0x439a6f];return _0x62756;};'use strict';var _=require(_0x6a16('0x0'));var util=require('util');var logger=require(_0x6a16('0x1'))(_0x6a16('0x2'));var moment=require(_0x6a16('0x3'));var BPromise=require('bluebird');var rp=require(_0x6a16('0x4'));var fs=require('fs');var path=require(_0x6a16('0x5'));var rimraf=require('rimraf');var config=require(_0x6a16('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0x6a16('0x7')]=function(_0xd06685,_0x58c2ff){return _0xd06685['define'](_0x6a16('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x6a16('0x9'),'fields':[_0x6a16('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 5baa0eb..69e517a 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 _0x931a=['jayson/promise','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1fed90,_0x3263eb){var _0x4133ad=function(_0x469da1){while(--_0x469da1){_0x1fed90['push'](_0x1fed90['shift']());}};_0x4133ad(++_0x3263eb);}(_0x931a,0xad));var _0xa931=function(_0x48180b,_0x4ace07){_0x48180b=_0x48180b-0x0;var _0x5b44a4=_0x931a[_0x48180b];return _0x5b44a4;};'use strict';var _=require('lodash');var util=require(_0xa931('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa931('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa931('0x2'))['db'];var utils=require(_0xa931('0x3'));var logger=require(_0xa931('0x4'))(_0xa931('0x5'));var config=require(_0xa931('0x6'));var jayson=require(_0xa931('0x7'));var client=jayson[_0xa931('0x8')][_0xa931('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f697c,_0x402746,_0x5813b1){return new BPromise(function(_0x58c16a,_0x57e3ce){return client['request'](_0x2f697c,_0x5813b1)[_0xa931('0xa')](function(_0xf61bcd){logger[_0xa931('0xb')](_0xa931('0xc'),_0x402746,_0xa931('0xd'));logger[_0xa931('0xe')](_0xa931('0xf'),_0x402746,_0xa931('0xd'),JSON['stringify'](_0xf61bcd));if(_0xf61bcd[_0xa931('0x10')]){if(_0xf61bcd[_0xa931('0x10')][_0xa931('0x11')]===0x1f4){logger[_0xa931('0x10')](_0xa931('0xc'),_0x402746,_0xf61bcd[_0xa931('0x10')][_0xa931('0x12')]);return _0x57e3ce(_0xf61bcd[_0xa931('0x10')][_0xa931('0x12')]);}logger[_0xa931('0x10')](_0xa931('0xc'),_0x402746,_0xf61bcd[_0xa931('0x10')][_0xa931('0x12')]);return _0x58c16a(_0xf61bcd[_0xa931('0x10')][_0xa931('0x12')]);}else{logger[_0xa931('0xb')](_0xa931('0xc'),_0x402746,_0xa931('0xd'));_0x58c16a(_0xf61bcd['result'][_0xa931('0x12')]);}})[_0xa931('0x13')](function(_0x10b1d1){logger[_0xa931('0x10')](_0xa931('0xc'),_0x402746,_0x10b1d1);_0x57e3ce(_0x10b1d1);});});} \ No newline at end of file +var _0x69f9=['../../config/environment','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x1fb72f,_0x32aef7){var _0x3a01d0=function(_0x12d4a2){while(--_0x12d4a2){_0x1fb72f['push'](_0x1fb72f['shift']());}};_0x3a01d0(++_0x32aef7);}(_0x69f9,0xf9));var _0x969f=function(_0x2f3420,_0x4ce6dd){_0x2f3420=_0x2f3420-0x0;var _0x5bc661=_0x69f9[_0x2f3420];return _0x5bc661;};'use strict';var _=require(_0x969f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x969f('0x1'));var rs=require(_0x969f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x969f('0x3'))['db'];var utils=require(_0x969f('0x4'));var logger=require('../../config/logger')(_0x969f('0x5'));var config=require(_0x969f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x969f('0x7')][_0x969f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a1b9d,_0x43fdbd,_0x151f03){return new BPromise(function(_0x5d081b,_0x2cd0dd){return client['request'](_0x2a1b9d,_0x151f03)[_0x969f('0x9')](function(_0x1c0427){logger[_0x969f('0xa')](_0x969f('0xb'),_0x43fdbd,'request\x20sent');logger[_0x969f('0xc')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x43fdbd,_0x969f('0xd'),JSON['stringify'](_0x1c0427));if(_0x1c0427['error']){if(_0x1c0427[_0x969f('0xe')]['code']===0x1f4){logger[_0x969f('0xe')](_0x969f('0xb'),_0x43fdbd,_0x1c0427[_0x969f('0xe')][_0x969f('0xf')]);return _0x2cd0dd(_0x1c0427[_0x969f('0xe')]['message']);}logger[_0x969f('0xe')](_0x969f('0xb'),_0x43fdbd,_0x1c0427[_0x969f('0xe')][_0x969f('0xf')]);return _0x5d081b(_0x1c0427[_0x969f('0xe')][_0x969f('0xf')]);}else{logger[_0x969f('0xa')](_0x969f('0xb'),_0x43fdbd,'request\x20sent');_0x5d081b(_0x1c0427[_0x969f('0x10')][_0x969f('0xf')]);}})['catch'](function(_0x1b9077){logger['error'](_0x969f('0xb'),_0x43fdbd,_0x1b9077);_0x2cd0dd(_0x1b9077);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index b7316b4..d190dba 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 _0x627f=['index','/:id','isAuthenticated','show','/:id/sounds','getSounds','post','create','addSound','delete','destroy','/:id/sounds/:id2','removeSound','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get'];(function(_0x54f6ea,_0x2d9304){var _0x1b2696=function(_0x7fd223){while(--_0x7fd223){_0x54f6ea['push'](_0x54f6ea['shift']());}};_0x1b2696(++_0x2d9304);}(_0x627f,0x109));var _0xf627=function(_0x320c65,_0x3a9a52){_0x320c65=_0x320c65-0x0;var _0x252f87=_0x627f[_0x320c65];return _0x252f87;};'use strict';var multer=require(_0xf627('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf627('0x1'));var express=require(_0xf627('0x2'));var router=express[_0xf627('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf627('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf627('0x5'));var controller=require(_0xf627('0x6'));router[_0xf627('0x7')]('/',auth['isAuthenticated'](),controller[_0xf627('0x8')]);router[_0xf627('0x7')](_0xf627('0x9'),auth[_0xf627('0xa')](),controller[_0xf627('0xb')]);router['get'](_0xf627('0xc'),auth[_0xf627('0xa')](),controller[_0xf627('0xd')]);router[_0xf627('0xe')]('/',auth[_0xf627('0xa')](),controller[_0xf627('0xf')]);router[_0xf627('0xe')]('/:id/sounds',auth['isAuthenticated'](),controller[_0xf627('0x10')]);router['put'](_0xf627('0x9'),auth[_0xf627('0xa')](),controller['update']);router[_0xf627('0x11')](_0xf627('0x9'),auth['isAuthenticated'](),controller[_0xf627('0x12')]);router[_0xf627('0x11')](_0xf627('0x13'),auth[_0xf627('0xa')](),controller[_0xf627('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc71c=['delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','/:id/sounds','addSound','put'];(function(_0x269938,_0x8fdba6){var _0x42fc30=function(_0x39917d){while(--_0x39917d){_0x269938['push'](_0x269938['shift']());}};_0x42fc30(++_0x8fdba6);}(_0xc71c,0x169));var _0xcc71=function(_0x577290,_0x4b3223){_0x577290=_0x577290-0x0;var _0x29f9d5=_0xc71c[_0x577290];return _0x29f9d5;};'use strict';var multer=require(_0xcc71('0x0'));var util=require(_0xcc71('0x1'));var path=require(_0xcc71('0x2'));var timeout=require(_0xcc71('0x3'));var express=require(_0xcc71('0x4'));var router=express[_0xcc71('0x5')]();var fs_extra=require(_0xcc71('0x6'));var auth=require(_0xcc71('0x7'));var interaction=require(_0xcc71('0x8'));var config=require(_0xcc71('0x9'));var controller=require(_0xcc71('0xa'));router[_0xcc71('0xb')]('/',auth[_0xcc71('0xc')](),controller['index']);router['get'](_0xcc71('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xcc71('0xb')]('/:id/sounds',auth[_0xcc71('0xc')](),controller['getSounds']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xcc71('0xe'),auth[_0xcc71('0xc')](),controller[_0xcc71('0xf')]);router[_0xcc71('0x10')](_0xcc71('0xd'),auth[_0xcc71('0xc')](),controller['update']);router[_0xcc71('0x11')](_0xcc71('0xd'),auth[_0xcc71('0xc')](),controller['destroy']);router['delete'](_0xcc71('0x12'),auth['isAuthenticated'](),controller[_0xcc71('0x13')]);module[_0xcc71('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 1961d07..7131785 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 _0xbc73=['TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','custom','files','quietmp3nb','quietmp3','mp3','alpha'];(function(_0x27031e,_0x1eb8cd){var _0xfd46b3=function(_0x9fdcf8){while(--_0x9fdcf8){_0x27031e['push'](_0x27031e['shift']());}};_0xfd46b3(++_0x1eb8cd);}(_0xbc73,0x7a));var _0x3bc7=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xbc73[_0x22f8ab];return _0x2a70e5;};'use strict';var Sequelize=require(_0x3bc7('0x0'));module[_0x3bc7('0x1')]={'name':{'type':Sequelize[_0x3bc7('0x2')],'allowNull':![],'unique':_0x3bc7('0x3')},'mode':{'type':Sequelize['ENUM'](_0x3bc7('0x4'),_0x3bc7('0x5'),'mp3nb',_0x3bc7('0x6'),_0x3bc7('0x7'),_0x3bc7('0x8')),'allowNull':!![],'defaultValue':_0x3bc7('0x5')},'directory':{'type':Sequelize[_0x3bc7('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x3bc7('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x3bc7('0x2')],'allowNull':!![],'defaultValue':_0x3bc7('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x3bc7('0xa')},'defaultEntry':{'type':Sequelize[_0x3bc7('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8a50=['alpha','BOOLEAN','sequelize','exports','name','ENUM','custom','quietmp3nb','quietmp3','mp3','files','STRING'];(function(_0x33f153,_0x39d65d){var _0x12ac15=function(_0x1603c1){while(--_0x1603c1){_0x33f153['push'](_0x33f153['shift']());}};_0x12ac15(++_0x39d65d);}(_0x8a50,0xc2));var _0x08a5=function(_0x311524,_0xd43484){_0x311524=_0x311524-0x0;var _0x2f23a7=_0x8a50[_0x311524];return _0x2f23a7;};'use strict';var Sequelize=require(_0x08a5('0x0'));module[_0x08a5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x08a5('0x2')},'mode':{'type':Sequelize[_0x08a5('0x3')](_0x08a5('0x4'),'files','mp3nb',_0x08a5('0x5'),_0x08a5('0x6'),_0x08a5('0x7')),'allowNull':!![],'defaultValue':_0x08a5('0x8')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x08a5('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0x08a5('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0x08a5('0x9')],'allowNull':!![],'defaultValue':_0x08a5('0xa')},'format':{'type':Sequelize[_0x08a5('0x9')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x08a5('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 9cc921d..59847d7 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 _0x0354=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','count','Content-Range','reject','update','then','destroy','get','end','sendStatus','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','length','find','catch','body','create','transaction','mode','files','directory','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','UserProfileResource','error','sequelize','readdirSync','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','createdAt','server/files/sounds/converted','format','%s.%s','basename','converted_format','symlinkSync','removeSound','findOne','id2','getSounds','fast-json-patch','request-promise','bluebird','util','sox','to-csv'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x0354,0xd2));var _0x4035=function(_0x2158d4,_0x3adcf6){_0x2158d4=_0x2158d4-0x0;var _0x1b174a=_0x0354[_0x2158d4];return _0x1b174a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4035('0x0'));var rp=require(_0x4035('0x1'));var moment=require('moment');var BPromise=require(_0x4035('0x2'));var Mustache=require('mustache');var util=require(_0x4035('0x3'));var path=require('path');var sox=require(_0x4035('0x4'));var csv=require(_0x4035('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4035('0x6'));var _=require(_0x4035('0x7'));var squel=require(_0x4035('0x8'));var crypto=require('crypto');var jsforce=require(_0x4035('0x9'));var deskjs=require(_0x4035('0xa'));var toCsv=require(_0x4035('0x5'));var querystring=require(_0x4035('0xb'));var Papa=require(_0x4035('0xc'));var Redis=require(_0x4035('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4035('0xe'));var as=require(_0x4035('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4035('0x10'))('api');var utils=require(_0x4035('0x11'));var config=require(_0x4035('0x12'));var licenseUtil=require(_0x4035('0x13'));var db=require(_0x4035('0x14'))['db'];function respondWithStatusCode(_0x2544c7,_0x510d19){_0x510d19=_0x510d19||0xcc;return function(_0x5afb81){if(_0x5afb81){return _0x2544c7['sendStatus'](_0x510d19);}return _0x2544c7[_0x4035('0x15')](_0x510d19)['end']();};}function respondWithResult(_0x1adaaf,_0xdbb1b){_0xdbb1b=_0xdbb1b||0xc8;return function(_0x3123c7){if(_0x3123c7){return _0x1adaaf[_0x4035('0x15')](_0xdbb1b)['json'](_0x3123c7);}};}function respondWithFilteredResult(_0x31efb3,_0x4b1234){return function(_0xab060d){if(_0xab060d){var _0x2831f4=typeof _0x4b1234[_0x4035('0x16')]==='undefined'&&typeof _0x4b1234[_0x4035('0x17')]==='undefined';var _0x19c667=_0xab060d[_0x4035('0x18')];var _0x3213da=_0x2831f4?0x0:_0x4b1234['offset'];var _0x36fed8=_0x2831f4?_0xab060d[_0x4035('0x18')]:_0x4b1234[_0x4035('0x16')]+_0x4b1234[_0x4035('0x17')];var _0x2ddce6;if(_0x36fed8>=_0x19c667){_0x36fed8=_0x19c667;_0x2ddce6=0xc8;}else{_0x2ddce6=0xce;}_0x31efb3[_0x4035('0x15')](_0x2ddce6);return _0x31efb3['set'](_0x4035('0x19'),_0x3213da+'-'+_0x36fed8+'/'+_0x19c667)['json'](_0xab060d);}return null;};}function patchUpdates(_0x43eacb){return function(_0x20ced6){try{jsonpatch['apply'](_0x20ced6,_0x43eacb,!![]);}catch(_0x1bcebd){return BPromise[_0x4035('0x1a')](_0x1bcebd);}return _0x20ced6['save']();};}function saveUpdates(_0x5651db,_0x2a12d0){return function(_0x5aa8f3){if(_0x5aa8f3){return _0x5aa8f3[_0x4035('0x1b')](_0x5651db)[_0x4035('0x1c')](function(_0x2aef77){return _0x2aef77;});}return null;};}function removeEntity(_0x2a51b3,_0x33fb12){return function(_0xd70de4){if(_0xd70de4){return _0xd70de4[_0x4035('0x1d')]()[_0x4035('0x1c')](function(){var _0x274840=_0xd70de4[_0x4035('0x1e')]({'plain':!![]});var _0x2ec3b9='MusicOnHolds';return db['UserProfileResource']['destroy']({'where':{'type':_0x2ec3b9,'resourceId':_0x274840['id']}})['then'](function(){return _0xd70de4;});})[_0x4035('0x1c')](function(){_0x2a51b3[_0x4035('0x15')](0xcc)[_0x4035('0x1f')]();});}};}function handleEntityNotFound(_0x61aa97,_0x5dee2e){return function(_0x5e429f){if(!_0x5e429f){_0x61aa97[_0x4035('0x20')](0x194);}return _0x5e429f;};}function handleError(_0x46cb84,_0x1b61e){_0x1b61e=_0x1b61e||0x1f4;return function(_0x39a6fc){logger['error'](_0x39a6fc['stack']);if(_0x39a6fc['name']){delete _0x39a6fc[_0x4035('0x21')];}_0x46cb84[_0x4035('0x15')](_0x1b61e)[_0x4035('0x22')](_0x39a6fc);};}exports[_0x4035('0x23')]=function(_0x36c668,_0x189492){var _0x5a9081={},_0x175fd5={},_0x3ca130={'count':0x0,'rows':[]};var _0x1315ba=_[_0x4035('0x24')](db[_0x4035('0x25')][_0x4035('0x26')],function(_0x2e858b){return{'name':_0x2e858b[_0x4035('0x27')],'type':_0x2e858b[_0x4035('0x28')][_0x4035('0x29')]};});_0x175fd5[_0x4035('0x2a')]=_[_0x4035('0x24')](_0x1315ba,'name');_0x175fd5['query']=_[_0x4035('0x2b')](_0x36c668[_0x4035('0x2c')]);_0x175fd5[_0x4035('0x2d')]=_['intersection'](_0x175fd5[_0x4035('0x2a')],_0x175fd5[_0x4035('0x2c')]);_0x5a9081[_0x4035('0x2e')]=_['intersection'](_0x175fd5[_0x4035('0x2a')],qs['fields'](_0x36c668['query'][_0x4035('0x2f')]));_0x5a9081[_0x4035('0x2e')]=_0x5a9081[_0x4035('0x2e')]['length']?_0x5a9081[_0x4035('0x2e')]:_0x175fd5[_0x4035('0x2a')];if(!_0x36c668[_0x4035('0x2c')][_0x4035('0x30')](_0x4035('0x31'))){_0x5a9081['limit']=qs['limit'](_0x36c668[_0x4035('0x2c')][_0x4035('0x17')]);_0x5a9081[_0x4035('0x16')]=qs[_0x4035('0x16')](_0x36c668['query'][_0x4035('0x16')]);}_0x5a9081[_0x4035('0x32')]=qs[_0x4035('0x33')](_0x36c668[_0x4035('0x2c')][_0x4035('0x33')]);delete _0x36c668['query'][_0x4035('0x33')];_0x5a9081[_0x4035('0x34')]=qs[_0x4035('0x2d')](_[_0x4035('0x35')](_0x36c668[_0x4035('0x2c')],_0x175fd5['filters']),_0x1315ba);if(_0x36c668['query'][_0x4035('0x36')]){_0x5a9081[_0x4035('0x34')]=_[_0x4035('0x37')](_0x5a9081[_0x4035('0x34')],{'$or':_[_0x4035('0x24')](_0x1315ba,function(_0x367db8){if(_0x367db8[_0x4035('0x28')]!==_0x4035('0x38')){var _0x3def93={};_0x3def93[_0x367db8[_0x4035('0x21')]]={'$like':'%'+_0x36c668[_0x4035('0x2c')][_0x4035('0x36')]+'%'};return _0x3def93;}})});}_0x5a9081=_[_0x4035('0x37')]({},_0x5a9081,_0x36c668[_0x4035('0x39')]);var _0x57a65b={'where':_0x5a9081[_0x4035('0x34')]};return db[_0x4035('0x25')]['count'](_0x57a65b)[_0x4035('0x1c')](function(_0x155992){_0x3ca130[_0x4035('0x18')]=_0x155992;if(_0x36c668['query'][_0x4035('0x3a')]){_0x5a9081[_0x4035('0x3b')]=[{'all':!![]}];}return db[_0x4035('0x25')][_0x4035('0x3c')](_0x5a9081);})[_0x4035('0x1c')](function(_0xd7a48d){_0x3ca130[_0x4035('0x3d')]=_0xd7a48d;return _0x3ca130;})[_0x4035('0x1c')](respondWithFilteredResult(_0x189492,_0x5a9081))['catch'](handleError(_0x189492,null));};exports[_0x4035('0x3e')]=function(_0x388cea,_0x378a46){var _0xc2ebe6={'raw':![],'where':{'id':_0x388cea[_0x4035('0x3f')]['id']}},_0x101fcc={};_0x101fcc[_0x4035('0x2a')]=_[_0x4035('0x2b')](db[_0x4035('0x25')]['rawAttributes']);_0x101fcc['query']=_[_0x4035('0x2b')](_0x388cea['query']);_0x101fcc[_0x4035('0x2d')]=_[_0x4035('0x40')](_0x101fcc[_0x4035('0x2a')],_0x101fcc[_0x4035('0x2c')]);_0xc2ebe6[_0x4035('0x2e')]=_[_0x4035('0x40')](_0x101fcc[_0x4035('0x2a')],qs[_0x4035('0x2f')](_0x388cea['query']['fields']));_0xc2ebe6['attributes']=_0xc2ebe6[_0x4035('0x2e')][_0x4035('0x41')]?_0xc2ebe6['attributes']:_0x101fcc[_0x4035('0x2a')];if(_0x388cea['query'][_0x4035('0x3a')]){_0xc2ebe6[_0x4035('0x3b')]=[{'all':!![]}];}_0xc2ebe6=_[_0x4035('0x37')]({},_0xc2ebe6,_0x388cea[_0x4035('0x39')]);return db[_0x4035('0x25')][_0x4035('0x42')](_0xc2ebe6)[_0x4035('0x1c')](handleEntityNotFound(_0x378a46,null))[_0x4035('0x1c')](respondWithResult(_0x378a46,null))[_0x4035('0x43')](handleError(_0x378a46,null));};exports[_0x4035('0x1b')]=function(_0x3a62f3,_0x4b3b0c){if(_0x3a62f3[_0x4035('0x44')]['id']){delete _0x3a62f3[_0x4035('0x44')]['id'];}return db['VoiceMusicOnHold'][_0x4035('0x42')]({'where':{'id':_0x3a62f3[_0x4035('0x3f')]['id']}})[_0x4035('0x1c')](handleEntityNotFound(_0x4b3b0c,null))['then'](saveUpdates(_0x3a62f3[_0x4035('0x44')],null))[_0x4035('0x1c')](respondWithResult(_0x4b3b0c,null))[_0x4035('0x43')](handleError(_0x4b3b0c,null));};exports[_0x4035('0x45')]=function(_0x142298,_0x14842a,_0x3c4b1f){return db['sequelize'][_0x4035('0x46')](function(_0x5e27c0){if(_0x142298[_0x4035('0x44')][_0x4035('0x47')]===_0x4035('0x48')){_0x142298[_0x4035('0x44')][_0x4035('0x49')]=path['join'](config[_0x4035('0x4a')],_0x4035('0x4b'),_0x142298[_0x4035('0x44')][_0x4035('0x21')]);}return db[_0x4035('0x25')][_0x4035('0x45')](_0x142298[_0x4035('0x44')],{'transaction':_0x5e27c0})[_0x4035('0x1c')](function(_0x52eb68){if(_0x142298[_0x4035('0x44')][_0x4035('0x47')]==='files'){fs[_0x4035('0x4c')](_0x52eb68[_0x4035('0x49')],parseInt(_0x4035('0x4d'),0x8));}var _0x5dfc34=_0x142298[_0x4035('0x4e')][_0x4035('0x1e')]({'plain':!![]});if(!_0x5dfc34)throw new Error(_0x4035('0x4f'));if(_0x5dfc34[_0x4035('0x50')]===_0x4035('0x4e')){var _0x36454b=_0x52eb68[_0x4035('0x1e')]({'plain':!![]});return db[_0x4035('0x51')][_0x4035('0x42')]({'where':{'name':_0x4035('0x52'),'userProfileId':_0x5dfc34[_0x4035('0x53')]},'raw':!![]})[_0x4035('0x1c')](function(_0x1d9388){if(_0x1d9388&&_0x1d9388['autoAssociation']===0x0){return db[_0x4035('0x54')][_0x4035('0x45')]({'name':_0x36454b[_0x4035('0x21')],'resourceId':_0x36454b['id'],'type':_0x1d9388[_0x4035('0x21')],'sectionId':_0x1d9388['id']},{})[_0x4035('0x1c')](function(){return _0x52eb68;});}else{return _0x52eb68;}})['catch'](function(_0x3d221e){logger[_0x4035('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d221e);});}return _0x52eb68;});})[_0x4035('0x1c')](respondWithResult(_0x14842a,0xc9))[_0x4035('0x43')](handleError(_0x14842a,null));};exports[_0x4035('0x1d')]=function(_0x1bd555,_0x23e14a,_0x3511da){var _0x3a95d3;return db['VoiceMusicOnHold'][_0x4035('0x42')]({'where':{'id':_0x1bd555[_0x4035('0x3f')]['id']}})[_0x4035('0x1c')](function(_0x15df97){if(_0x15df97){return db[_0x4035('0x56')]['transaction'](function(_0x31aeb3){return _0x15df97['destroy']({'transaction':_0x31aeb3,'raw':!![]})['then'](function(_0x568f48){if(_0x568f48[_0x4035('0x49')]){fs[_0x4035('0x57')](_0x568f48['directory'])['forEach'](function(_0x15f541){fs[_0x4035('0x58')](path[_0x4035('0x59')](_0x568f48['directory'],_0x15f541));});fs[_0x4035('0x5a')](_0x568f48[_0x4035('0x49')]);}return _0x568f48;});})['catch'](function(_0x32c9bc){throw new db[(_0x4035('0x5b'))][(_0x4035('0x5c'))](_0x32c9bc[_0x4035('0x5d')]);});}})[_0x4035('0x1c')](handleEntityNotFound(_0x23e14a,null))[_0x4035('0x1c')](removeEntity(_0x23e14a,null))[_0x4035('0x43')](handleError(_0x23e14a,null));};exports[_0x4035('0x5e')]=function(_0x465a6b,_0x111d0a,_0x233976){return db[_0x4035('0x56')][_0x4035('0x46')](function(_0x423332){var _0x3a73c3;return db['VoiceMusicOnHold'][_0x4035('0x42')]({'where':{'id':_0x465a6b[_0x4035('0x3f')]['id']}})['then'](function(_0xebd02a){if(_0xebd02a){_0x3a73c3=_0xebd02a;return _0xebd02a[_0x4035('0x5e')](_0x465a6b[_0x4035('0x44')]['id'],{'transaction':_0x423332});}})[_0x4035('0x1c')](function(_0x16df3a){if(_0x16df3a){return db[_0x4035('0x5f')]['findOne']({'where':{'id':_0x465a6b[_0x4035('0x44')]['id']},'attributes':['id',_0x4035('0x21'),_0x4035('0x60'),'converted_format',_0x4035('0x61')],'raw':!![]});}})[_0x4035('0x1c')](function(_0x3d051a){if(_0x3d051a){var _0xa3c9e4=path[_0x4035('0x59')](config[_0x4035('0x4a')],_0x4035('0x62'),util[_0x4035('0x63')](_0x4035('0x64'),path[_0x4035('0x65')](_0x3d051a[_0x4035('0x60')],path['extname'](_0x3d051a[_0x4035('0x60')])),_0x3d051a['converted_format']));var _0xa48ace=path[_0x4035('0x59')](config['root'],'server/files/moh',_0x3a73c3[_0x4035('0x21')],util['format'](_0x4035('0x64'),_0x3d051a[_0x4035('0x21')],_0x3d051a[_0x4035('0x66')]));fs[_0x4035('0x67')](_0xa3c9e4,_0xa48ace);return _0x3d051a;}})[_0x4035('0x43')](function(_0x4f996e){throw new db[(_0x4035('0x5b'))][(_0x4035('0x5c'))](_0x4f996e[_0x4035('0x5d')]);});})[_0x4035('0x1c')](handleEntityNotFound(_0x111d0a,null))['then'](respondWithResult(_0x111d0a,0xc9))['catch'](handleError(_0x111d0a,null));};exports[_0x4035('0x68')]=function(_0x39bed2,_0x48c283,_0x51a23d){return db[_0x4035('0x56')][_0x4035('0x46')](function(_0x5bbe34){var _0x3534a5;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x39bed2['params']['id']}})['then'](handleEntityNotFound(_0x48c283,null))[_0x4035('0x1c')](function(_0x3f09e9){if(_0x3f09e9){_0x3534a5=_0x3f09e9;return _0x3f09e9[_0x4035('0x68')](_0x39bed2[_0x4035('0x3f')]['id2']);}})['then'](function(_0x481aae){if(_0x481aae){return db[_0x4035('0x5f')][_0x4035('0x69')]({'where':{'id':_0x39bed2[_0x4035('0x3f')][_0x4035('0x6a')]},'attributes':['id',_0x4035('0x21'),_0x4035('0x60'),_0x4035('0x66'),'createdAt'],'raw':!![]});}})[_0x4035('0x1c')](function(_0x54de64){if(_0x54de64){fs['unlinkSync'](path['join'](_0x3534a5[_0x4035('0x49')],util['format']('%s.%s',_0x54de64['name'],_0x54de64[_0x4035('0x66')])));return _0x54de64;}})['catch'](function(_0x22f3f8){throw new db[(_0x4035('0x5b'))]['ValidationError'](_0x22f3f8[_0x4035('0x5d')]);});})['then'](handleEntityNotFound(_0x48c283,null))[_0x4035('0x1c')](respondWithStatusCode(_0x48c283,0xcc))[_0x4035('0x43')](handleError(_0x48c283,null));};exports[_0x4035('0x6b')]=function(_0x1425b5,_0x3d06c4,_0x427cdc){var _0x4950d8={};var _0x9bb154={};var _0x3b3b52;var _0x2d478e;return db[_0x4035('0x25')][_0x4035('0x69')]({'where':{'id':_0x1425b5['params']['id']}})[_0x4035('0x1c')](handleEntityNotFound(_0x3d06c4,null))[_0x4035('0x1c')](function(_0x4e29ef){if(_0x4e29ef){_0x3b3b52=_0x4e29ef;_0x9bb154['model']=_[_0x4035('0x2b')](db[_0x4035('0x5f')]['rawAttributes']);_0x9bb154[_0x4035('0x2c')]=_[_0x4035('0x2b')](_0x1425b5[_0x4035('0x2c')]);_0x9bb154[_0x4035('0x2d')]=_[_0x4035('0x40')](_0x9bb154[_0x4035('0x2a')],_0x9bb154['query']);_0x4950d8['attributes']=_[_0x4035('0x40')](_0x9bb154[_0x4035('0x2a')],qs[_0x4035('0x2f')](_0x1425b5[_0x4035('0x2c')][_0x4035('0x2f')]));_0x4950d8[_0x4035('0x2e')]=_0x4950d8[_0x4035('0x2e')][_0x4035('0x41')]?_0x4950d8['attributes']:_0x9bb154[_0x4035('0x2a')];_0x4950d8[_0x4035('0x32')]=qs[_0x4035('0x33')](_0x1425b5[_0x4035('0x2c')][_0x4035('0x33')]);_0x4950d8[_0x4035('0x34')]=qs[_0x4035('0x2d')](_['pick'](_0x1425b5[_0x4035('0x2c')],_0x9bb154[_0x4035('0x2d')]));if(_0x1425b5['query'][_0x4035('0x36')]){_0x4950d8[_0x4035('0x34')]=_['merge'](_0x4950d8[_0x4035('0x34')],{'$or':_[_0x4035('0x24')](_0x4950d8[_0x4035('0x2e')],function(_0x46d5f6){var _0x227ba3={};_0x227ba3[_0x46d5f6]={'$like':'%'+_0x1425b5['query'][_0x4035('0x36')]+'%'};return _0x227ba3;})});}_0x4950d8=_[_0x4035('0x37')]({},_0x4950d8,_0x1425b5[_0x4035('0x39')]);return _0x3b3b52[_0x4035('0x6b')](_0x4950d8);}})[_0x4035('0x1c')](function(_0x3d3b48){if(_0x3d3b48){_0x2d478e=_0x3d3b48[_0x4035('0x41')];if(!_0x1425b5[_0x4035('0x2c')]['hasOwnProperty'](_0x4035('0x31'))){_0x4950d8['limit']=qs[_0x4035('0x17')](_0x1425b5['query'][_0x4035('0x17')]);_0x4950d8[_0x4035('0x16')]=qs[_0x4035('0x16')](_0x1425b5[_0x4035('0x2c')][_0x4035('0x16')]);}return _0x3b3b52[_0x4035('0x6b')](_0x4950d8);}})[_0x4035('0x1c')](function(_0x18b411){if(_0x18b411){return _0x18b411?{'count':_0x2d478e,'rows':_0x18b411}:null;}})[_0x4035('0x1c')](respondWithResult(_0x3d06c4,null))[_0x4035('0x43')](handleError(_0x3d06c4,null));}; \ No newline at end of file +var _0xd1f5=['sort','where','pick','filters','type','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','body','create','sequelize','transaction','mode','directory','join','root','files','mkdirSync','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','server/files/sounds/converted','format','%s.%s','basename','extname','server/files/moh','symlinkSync','id2','createdAt','getSounds','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','set','Content-Range','json','apply','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','fieldName','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0x575214,_0xd28897){var _0x2d9bf8=function(_0x551802){while(--_0x551802){_0x575214['push'](_0x575214['shift']());}};_0x2d9bf8(++_0xd28897);}(_0xd1f5,0x120));var _0x5d1f=function(_0x5bedaf,_0x47a202){_0x5bedaf=_0x5bedaf-0x0;var _0x12b69a=_0xd1f5[_0x5bedaf];return _0x12b69a;};'use strict';var emlformat=require(_0x5d1f('0x0'));var rimraf=require(_0x5d1f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5d1f('0x2'));var moment=require(_0x5d1f('0x3'));var BPromise=require(_0x5d1f('0x4'));var Mustache=require(_0x5d1f('0x5'));var util=require(_0x5d1f('0x6'));var path=require(_0x5d1f('0x7'));var sox=require(_0x5d1f('0x8'));var csv=require(_0x5d1f('0x9'));var ejs=require(_0x5d1f('0xa'));var fs=require('fs');var fs_extra=require(_0x5d1f('0xb'));var _=require(_0x5d1f('0xc'));var squel=require(_0x5d1f('0xd'));var crypto=require(_0x5d1f('0xe'));var jsforce=require(_0x5d1f('0xf'));var deskjs=require(_0x5d1f('0x10'));var toCsv=require(_0x5d1f('0x9'));var querystring=require(_0x5d1f('0x11'));var Papa=require(_0x5d1f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5d1f('0x13'));var as=require(_0x5d1f('0x14'));var hardwareService=require(_0x5d1f('0x15'));var logger=require(_0x5d1f('0x16'))(_0x5d1f('0x17'));var utils=require('../../config/utils');var config=require(_0x5d1f('0x18'));var licenseUtil=require(_0x5d1f('0x19'));var db=require(_0x5d1f('0x1a'))['db'];function respondWithStatusCode(_0x2de870,_0x57d595){_0x57d595=_0x57d595||0xcc;return function(_0x35bb1c){if(_0x35bb1c){return _0x2de870[_0x5d1f('0x1b')](_0x57d595);}return _0x2de870[_0x5d1f('0x1c')](_0x57d595)[_0x5d1f('0x1d')]();};}function respondWithResult(_0xb6863,_0x522ec3){_0x522ec3=_0x522ec3||0xc8;return function(_0x23f82d){if(_0x23f82d){return _0xb6863[_0x5d1f('0x1c')](_0x522ec3)['json'](_0x23f82d);}};}function respondWithFilteredResult(_0x4eee54,_0x32e144){return function(_0x1a2f28){if(_0x1a2f28){var _0x372bc1=typeof _0x32e144[_0x5d1f('0x1e')]==='undefined'&&typeof _0x32e144[_0x5d1f('0x1f')]===_0x5d1f('0x20');var _0x50b8f2=_0x1a2f28['count'];var _0x3d6f5c=_0x372bc1?0x0:_0x32e144['offset'];var _0x4629aa=_0x372bc1?_0x1a2f28['count']:_0x32e144[_0x5d1f('0x1e')]+_0x32e144['limit'];var _0x1f3c59;if(_0x4629aa>=_0x50b8f2){_0x4629aa=_0x50b8f2;_0x1f3c59=0xc8;}else{_0x1f3c59=0xce;}_0x4eee54[_0x5d1f('0x1c')](_0x1f3c59);return _0x4eee54[_0x5d1f('0x21')](_0x5d1f('0x22'),_0x3d6f5c+'-'+_0x4629aa+'/'+_0x50b8f2)[_0x5d1f('0x23')](_0x1a2f28);}return null;};}function patchUpdates(_0x373952){return function(_0x4fa564){try{jsonpatch[_0x5d1f('0x24')](_0x4fa564,_0x373952,!![]);}catch(_0x46d7be){return BPromise['reject'](_0x46d7be);}return _0x4fa564[_0x5d1f('0x25')]();};}function saveUpdates(_0x6df9ca,_0x222853){return function(_0x1a5e26){if(_0x1a5e26){return _0x1a5e26[_0x5d1f('0x26')](_0x6df9ca)[_0x5d1f('0x27')](function(_0xf39d31){return _0xf39d31;});}return null;};}function removeEntity(_0x26ea86,_0x49e5f7){return function(_0x3c5476){if(_0x3c5476){return _0x3c5476[_0x5d1f('0x28')]()[_0x5d1f('0x27')](function(){var _0x44f187=_0x3c5476[_0x5d1f('0x29')]({'plain':!![]});var _0x44c6f2=_0x5d1f('0x2a');return db[_0x5d1f('0x2b')]['destroy']({'where':{'type':_0x44c6f2,'resourceId':_0x44f187['id']}})[_0x5d1f('0x27')](function(){return _0x3c5476;});})[_0x5d1f('0x27')](function(){_0x26ea86[_0x5d1f('0x1c')](0xcc)[_0x5d1f('0x1d')]();});}};}function handleEntityNotFound(_0x2b1eae,_0x4c0c06){return function(_0x412d7a){if(!_0x412d7a){_0x2b1eae[_0x5d1f('0x1b')](0x194);}return _0x412d7a;};}function handleError(_0x1d672c,_0x5593e4){_0x5593e4=_0x5593e4||0x1f4;return function(_0x5aac1a){logger[_0x5d1f('0x2c')](_0x5aac1a[_0x5d1f('0x2d')]);if(_0x5aac1a[_0x5d1f('0x2e')]){delete _0x5aac1a['name'];}_0x1d672c[_0x5d1f('0x1c')](_0x5593e4)[_0x5d1f('0x2f')](_0x5aac1a);};}exports[_0x5d1f('0x30')]=function(_0x4b3571,_0x44e945){var _0x7facbf={},_0x210bc2={},_0x29bdb6={'count':0x0,'rows':[]};var _0x48c46b=_[_0x5d1f('0x31')](db[_0x5d1f('0x32')]['rawAttributes'],function(_0x40343f){return{'name':_0x40343f[_0x5d1f('0x33')],'type':_0x40343f['type'][_0x5d1f('0x34')]};});_0x210bc2[_0x5d1f('0x35')]=_[_0x5d1f('0x31')](_0x48c46b,_0x5d1f('0x2e'));_0x210bc2['query']=_[_0x5d1f('0x36')](_0x4b3571['query']);_0x210bc2['filters']=_['intersection'](_0x210bc2[_0x5d1f('0x35')],_0x210bc2[_0x5d1f('0x37')]);_0x7facbf[_0x5d1f('0x38')]=_[_0x5d1f('0x39')](_0x210bc2[_0x5d1f('0x35')],qs[_0x5d1f('0x3a')](_0x4b3571['query']['fields']));_0x7facbf[_0x5d1f('0x38')]=_0x7facbf[_0x5d1f('0x38')][_0x5d1f('0x3b')]?_0x7facbf[_0x5d1f('0x38')]:_0x210bc2['model'];if(!_0x4b3571[_0x5d1f('0x37')][_0x5d1f('0x3c')](_0x5d1f('0x3d'))){_0x7facbf[_0x5d1f('0x1f')]=qs[_0x5d1f('0x1f')](_0x4b3571[_0x5d1f('0x37')][_0x5d1f('0x1f')]);_0x7facbf['offset']=qs['offset'](_0x4b3571[_0x5d1f('0x37')][_0x5d1f('0x1e')]);}_0x7facbf[_0x5d1f('0x3e')]=qs[_0x5d1f('0x3f')](_0x4b3571[_0x5d1f('0x37')][_0x5d1f('0x3f')]);delete _0x4b3571['query'][_0x5d1f('0x3f')];_0x7facbf[_0x5d1f('0x40')]=qs['filters'](_[_0x5d1f('0x41')](_0x4b3571[_0x5d1f('0x37')],_0x210bc2[_0x5d1f('0x42')]),_0x48c46b);if(_0x4b3571[_0x5d1f('0x37')]['filter']){_0x7facbf['where']=_['merge'](_0x7facbf[_0x5d1f('0x40')],{'$or':_['map'](_0x48c46b,function(_0x24f1dc){if(_0x24f1dc[_0x5d1f('0x43')]!==_0x5d1f('0x44')){var _0x58fd2e={};_0x58fd2e[_0x24f1dc['name']]={'$like':'%'+_0x4b3571[_0x5d1f('0x37')][_0x5d1f('0x45')]+'%'};return _0x58fd2e;}})});}_0x7facbf=_[_0x5d1f('0x46')]({},_0x7facbf,_0x4b3571[_0x5d1f('0x47')]);var _0x1bb47b={'where':_0x7facbf[_0x5d1f('0x40')]};return db[_0x5d1f('0x32')][_0x5d1f('0x48')](_0x1bb47b)[_0x5d1f('0x27')](function(_0xc54111){_0x29bdb6[_0x5d1f('0x48')]=_0xc54111;if(_0x4b3571['query'][_0x5d1f('0x49')]){_0x7facbf[_0x5d1f('0x4a')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x5d1f('0x4b')](_0x7facbf);})[_0x5d1f('0x27')](function(_0x2cfd21){_0x29bdb6[_0x5d1f('0x4c')]=_0x2cfd21;return _0x29bdb6;})[_0x5d1f('0x27')](respondWithFilteredResult(_0x44e945,_0x7facbf))[_0x5d1f('0x4d')](handleError(_0x44e945,null));};exports[_0x5d1f('0x4e')]=function(_0x44b5ae,_0x3c03f1){var _0x425762={'raw':![],'where':{'id':_0x44b5ae[_0x5d1f('0x4f')]['id']}},_0x22e034={};_0x22e034['model']=_['keys'](db['VoiceMusicOnHold'][_0x5d1f('0x50')]);_0x22e034[_0x5d1f('0x37')]=_[_0x5d1f('0x36')](_0x44b5ae['query']);_0x22e034[_0x5d1f('0x42')]=_[_0x5d1f('0x39')](_0x22e034[_0x5d1f('0x35')],_0x22e034[_0x5d1f('0x37')]);_0x425762[_0x5d1f('0x38')]=_['intersection'](_0x22e034['model'],qs['fields'](_0x44b5ae['query']['fields']));_0x425762[_0x5d1f('0x38')]=_0x425762[_0x5d1f('0x38')][_0x5d1f('0x3b')]?_0x425762[_0x5d1f('0x38')]:_0x22e034[_0x5d1f('0x35')];if(_0x44b5ae[_0x5d1f('0x37')]['includeAll']){_0x425762[_0x5d1f('0x4a')]=[{'all':!![]}];}_0x425762=_[_0x5d1f('0x46')]({},_0x425762,_0x44b5ae[_0x5d1f('0x47')]);return db[_0x5d1f('0x32')]['find'](_0x425762)['then'](handleEntityNotFound(_0x3c03f1,null))[_0x5d1f('0x27')](respondWithResult(_0x3c03f1,null))[_0x5d1f('0x4d')](handleError(_0x3c03f1,null));};exports[_0x5d1f('0x26')]=function(_0x44201d,_0x18f512){if(_0x44201d[_0x5d1f('0x51')]['id']){delete _0x44201d[_0x5d1f('0x51')]['id'];}return db[_0x5d1f('0x32')]['find']({'where':{'id':_0x44201d[_0x5d1f('0x4f')]['id']}})[_0x5d1f('0x27')](handleEntityNotFound(_0x18f512,null))['then'](saveUpdates(_0x44201d['body'],null))[_0x5d1f('0x27')](respondWithResult(_0x18f512,null))[_0x5d1f('0x4d')](handleError(_0x18f512,null));};exports[_0x5d1f('0x52')]=function(_0x52fd8d,_0x27ca6a,_0x49653f){return db[_0x5d1f('0x53')][_0x5d1f('0x54')](function(_0x1566fb){if(_0x52fd8d['body'][_0x5d1f('0x55')]==='files'){_0x52fd8d[_0x5d1f('0x51')][_0x5d1f('0x56')]=path[_0x5d1f('0x57')](config[_0x5d1f('0x58')],'server/files/moh',_0x52fd8d[_0x5d1f('0x51')][_0x5d1f('0x2e')]);}return db[_0x5d1f('0x32')][_0x5d1f('0x52')](_0x52fd8d[_0x5d1f('0x51')],{'transaction':_0x1566fb})[_0x5d1f('0x27')](function(_0x41b3c4){if(_0x52fd8d[_0x5d1f('0x51')][_0x5d1f('0x55')]===_0x5d1f('0x59')){fs[_0x5d1f('0x5a')](_0x41b3c4[_0x5d1f('0x56')],parseInt('0777',0x8));}var _0x47d7e5=_0x52fd8d[_0x5d1f('0x5b')][_0x5d1f('0x29')]({'plain':!![]});if(!_0x47d7e5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47d7e5['role']==='user'){var _0x9e1b3b=_0x41b3c4['get']({'plain':!![]});return db[_0x5d1f('0x5c')][_0x5d1f('0x5d')]({'where':{'name':_0x5d1f('0x2a'),'userProfileId':_0x47d7e5[_0x5d1f('0x5e')]},'raw':!![]})[_0x5d1f('0x27')](function(_0x3bee63){if(_0x3bee63&&_0x3bee63['autoAssociation']===0x0){return db['UserProfileResource'][_0x5d1f('0x52')]({'name':_0x9e1b3b[_0x5d1f('0x2e')],'resourceId':_0x9e1b3b['id'],'type':_0x3bee63[_0x5d1f('0x2e')],'sectionId':_0x3bee63['id']},{})[_0x5d1f('0x27')](function(){return _0x41b3c4;});}else{return _0x41b3c4;}})[_0x5d1f('0x4d')](function(_0x543681){logger[_0x5d1f('0x2c')](_0x5d1f('0x5f'),_0x543681);});}return _0x41b3c4;});})[_0x5d1f('0x27')](respondWithResult(_0x27ca6a,0xc9))[_0x5d1f('0x4d')](handleError(_0x27ca6a,null));};exports[_0x5d1f('0x28')]=function(_0x15cd29,_0x5999b7,_0x1572ec){var _0x5da8eb;return db[_0x5d1f('0x32')][_0x5d1f('0x5d')]({'where':{'id':_0x15cd29[_0x5d1f('0x4f')]['id']}})[_0x5d1f('0x27')](function(_0xdd4a04){if(_0xdd4a04){return db[_0x5d1f('0x53')][_0x5d1f('0x54')](function(_0xd1dcf7){return _0xdd4a04[_0x5d1f('0x28')]({'transaction':_0xd1dcf7,'raw':!![]})[_0x5d1f('0x27')](function(_0x3e62e0){if(_0x3e62e0[_0x5d1f('0x56')]){fs[_0x5d1f('0x60')](_0x3e62e0['directory'])[_0x5d1f('0x61')](function(_0x32ea2a){fs[_0x5d1f('0x62')](path[_0x5d1f('0x57')](_0x3e62e0[_0x5d1f('0x56')],_0x32ea2a));});fs['rmdirSync'](_0x3e62e0[_0x5d1f('0x56')]);}return _0x3e62e0;});})[_0x5d1f('0x4d')](function(_0x4eed58){throw new db[(_0x5d1f('0x63'))][(_0x5d1f('0x64'))](_0x4eed58[_0x5d1f('0x65')]);});}})[_0x5d1f('0x27')](handleEntityNotFound(_0x5999b7,null))[_0x5d1f('0x27')](removeEntity(_0x5999b7,null))[_0x5d1f('0x4d')](handleError(_0x5999b7,null));};exports['addSound']=function(_0xb86036,_0x18ae89,_0x531680){return db[_0x5d1f('0x53')]['transaction'](function(_0x1f1041){var _0x434a97;return db['VoiceMusicOnHold'][_0x5d1f('0x5d')]({'where':{'id':_0xb86036[_0x5d1f('0x4f')]['id']}})[_0x5d1f('0x27')](function(_0x3f34e6){if(_0x3f34e6){_0x434a97=_0x3f34e6;return _0x3f34e6[_0x5d1f('0x66')](_0xb86036[_0x5d1f('0x51')]['id'],{'transaction':_0x1f1041});}})[_0x5d1f('0x27')](function(_0x580182){if(_0x580182){return db[_0x5d1f('0x67')][_0x5d1f('0x68')]({'where':{'id':_0xb86036[_0x5d1f('0x51')]['id']},'attributes':['id','name',_0x5d1f('0x69'),_0x5d1f('0x6a'),'createdAt'],'raw':!![]});}})[_0x5d1f('0x27')](function(_0xf2a0a2){if(_0xf2a0a2){var _0x45a73b=path[_0x5d1f('0x57')](config[_0x5d1f('0x58')],_0x5d1f('0x6b'),util[_0x5d1f('0x6c')](_0x5d1f('0x6d'),path[_0x5d1f('0x6e')](_0xf2a0a2[_0x5d1f('0x69')],path[_0x5d1f('0x6f')](_0xf2a0a2[_0x5d1f('0x69')])),_0xf2a0a2['converted_format']));var _0x4e34fe=path[_0x5d1f('0x57')](config['root'],_0x5d1f('0x70'),_0x434a97[_0x5d1f('0x2e')],util['format'](_0x5d1f('0x6d'),_0xf2a0a2[_0x5d1f('0x2e')],_0xf2a0a2[_0x5d1f('0x6a')]));fs[_0x5d1f('0x71')](_0x45a73b,_0x4e34fe);return _0xf2a0a2;}})[_0x5d1f('0x4d')](function(_0x2352c3){throw new db[(_0x5d1f('0x63'))][(_0x5d1f('0x64'))](_0x2352c3[_0x5d1f('0x65')]);});})[_0x5d1f('0x27')](handleEntityNotFound(_0x18ae89,null))['then'](respondWithResult(_0x18ae89,0xc9))['catch'](handleError(_0x18ae89,null));};exports['removeSound']=function(_0x4f9010,_0x54c696,_0x5592b4){return db[_0x5d1f('0x53')][_0x5d1f('0x54')](function(_0x4e4b14){var _0x5aab55;return db[_0x5d1f('0x32')][_0x5d1f('0x68')]({'where':{'id':_0x4f9010[_0x5d1f('0x4f')]['id']}})[_0x5d1f('0x27')](handleEntityNotFound(_0x54c696,null))['then'](function(_0x2db9b3){if(_0x2db9b3){_0x5aab55=_0x2db9b3;return _0x2db9b3['removeSound'](_0x4f9010['params'][_0x5d1f('0x72')]);}})[_0x5d1f('0x27')](function(_0x24fa31){if(_0x24fa31){return db['Sound']['findOne']({'where':{'id':_0x4f9010['params'][_0x5d1f('0x72')]},'attributes':['id',_0x5d1f('0x2e'),'save_name',_0x5d1f('0x6a'),_0x5d1f('0x73')],'raw':!![]});}})[_0x5d1f('0x27')](function(_0x45f2b6){if(_0x45f2b6){fs[_0x5d1f('0x62')](path[_0x5d1f('0x57')](_0x5aab55[_0x5d1f('0x56')],util['format']('%s.%s',_0x45f2b6['name'],_0x45f2b6['converted_format'])));return _0x45f2b6;}})[_0x5d1f('0x4d')](function(_0x114d8e){throw new db[(_0x5d1f('0x63'))][(_0x5d1f('0x64'))](_0x114d8e['message']);});})[_0x5d1f('0x27')](handleEntityNotFound(_0x54c696,null))[_0x5d1f('0x27')](respondWithStatusCode(_0x54c696,0xcc))[_0x5d1f('0x4d')](handleError(_0x54c696,null));};exports[_0x5d1f('0x74')]=function(_0x5ef53c,_0x316c19,_0x26c5d6){var _0x4a5baf={};var _0x5b8ca4={};var _0x5288cd;var _0x15b3ce;return db[_0x5d1f('0x32')][_0x5d1f('0x68')]({'where':{'id':_0x5ef53c[_0x5d1f('0x4f')]['id']}})[_0x5d1f('0x27')](handleEntityNotFound(_0x316c19,null))[_0x5d1f('0x27')](function(_0x3ce0f2){if(_0x3ce0f2){_0x5288cd=_0x3ce0f2;_0x5b8ca4[_0x5d1f('0x35')]=_[_0x5d1f('0x36')](db[_0x5d1f('0x67')][_0x5d1f('0x50')]);_0x5b8ca4[_0x5d1f('0x37')]=_[_0x5d1f('0x36')](_0x5ef53c[_0x5d1f('0x37')]);_0x5b8ca4[_0x5d1f('0x42')]=_['intersection'](_0x5b8ca4[_0x5d1f('0x35')],_0x5b8ca4[_0x5d1f('0x37')]);_0x4a5baf['attributes']=_[_0x5d1f('0x39')](_0x5b8ca4[_0x5d1f('0x35')],qs[_0x5d1f('0x3a')](_0x5ef53c[_0x5d1f('0x37')]['fields']));_0x4a5baf[_0x5d1f('0x38')]=_0x4a5baf[_0x5d1f('0x38')][_0x5d1f('0x3b')]?_0x4a5baf[_0x5d1f('0x38')]:_0x5b8ca4[_0x5d1f('0x35')];_0x4a5baf['order']=qs[_0x5d1f('0x3f')](_0x5ef53c[_0x5d1f('0x37')][_0x5d1f('0x3f')]);_0x4a5baf[_0x5d1f('0x40')]=qs[_0x5d1f('0x42')](_['pick'](_0x5ef53c[_0x5d1f('0x37')],_0x5b8ca4[_0x5d1f('0x42')]));if(_0x5ef53c[_0x5d1f('0x37')]['filter']){_0x4a5baf[_0x5d1f('0x40')]=_['merge'](_0x4a5baf['where'],{'$or':_[_0x5d1f('0x31')](_0x4a5baf[_0x5d1f('0x38')],function(_0x42790a){var _0x24410b={};_0x24410b[_0x42790a]={'$like':'%'+_0x5ef53c['query'][_0x5d1f('0x45')]+'%'};return _0x24410b;})});}_0x4a5baf=_[_0x5d1f('0x46')]({},_0x4a5baf,_0x5ef53c[_0x5d1f('0x47')]);return _0x5288cd['getSounds'](_0x4a5baf);}})[_0x5d1f('0x27')](function(_0x2d6e23){if(_0x2d6e23){_0x15b3ce=_0x2d6e23['length'];if(!_0x5ef53c[_0x5d1f('0x37')][_0x5d1f('0x3c')](_0x5d1f('0x3d'))){_0x4a5baf[_0x5d1f('0x1f')]=qs['limit'](_0x5ef53c[_0x5d1f('0x37')][_0x5d1f('0x1f')]);_0x4a5baf[_0x5d1f('0x1e')]=qs[_0x5d1f('0x1e')](_0x5ef53c['query'][_0x5d1f('0x1e')]);}return _0x5288cd[_0x5d1f('0x74')](_0x4a5baf);}})['then'](function(_0x527151){if(_0x527151){return _0x527151?{'count':_0x15b3ce,'rows':_0x527151}:null;}})[_0x5d1f('0x27')](respondWithResult(_0x316c19,null))[_0x5d1f('0x4d')](handleError(_0x316c19,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 637df48..63d5a32 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 _0x4d6d=['define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','request-promise','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x43eadd,_0x36ca50){var _0x125bde=function(_0x5d74cf){while(--_0x5d74cf){_0x43eadd['push'](_0x43eadd['shift']());}};_0x125bde(++_0x36ca50);}(_0x4d6d,0x116));var _0xd4d6=function(_0x2a527c,_0x4310ee){_0x2a527c=_0x2a527c-0x0;var _0x558f61=_0x4d6d[_0x2a527c];return _0x558f61;};'use strict';var _=require(_0xd4d6('0x0'));var util=require(_0xd4d6('0x1'));var logger=require(_0xd4d6('0x2'))(_0xd4d6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd4d6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd4d6('0x5'));var attributes=require(_0xd4d6('0x6'));module[_0xd4d6('0x7')]=function(_0xa9ef8d,_0x1f4715){return _0xa9ef8d[_0xd4d6('0x8')](_0xd4d6('0x9'),attributes,{'tableName':_0xd4d6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c97=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','VoiceMusicOnHold'];(function(_0x4a384a,_0xdc4041){var _0x4c3a75=function(_0x4a006a){while(--_0x4a006a){_0x4a384a['push'](_0x4a384a['shift']());}};_0x4c3a75(++_0xdc4041);}(_0x7c97,0x1e0));var _0x77c9=function(_0x10d688,_0x512531){_0x10d688=_0x10d688-0x0;var _0x44feb0=_0x7c97[_0x10d688];return _0x44feb0;};'use strict';var _=require(_0x77c9('0x0'));var util=require(_0x77c9('0x1'));var logger=require(_0x77c9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77c9('0x3'));var rp=require(_0x77c9('0x4'));var fs=require('fs');var path=require(_0x77c9('0x5'));var rimraf=require(_0x77c9('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x12b1e9,_0xa681f4){return _0x12b1e9['define'](_0x77c9('0x7'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 8f5b060..7f08720 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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x5745f2,_0xe1ef8a){var _0x258e64=function(_0x55ae7e){while(--_0x55ae7e){_0x5745f2['push'](_0x5745f2['shift']());}};_0x258e64(++_0xe1ef8a);}(_0xedd9,0xfc));var _0x9edd=function(_0x54eefb,_0x48715e){_0x54eefb=_0x54eefb-0x0;var _0x3c3d9e=_0xedd9[_0x54eefb];return _0x3c3d9e;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ 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(_0x14eb4e,_0x13883c){var _0x3cdf55=function(_0x447bd7){while(--_0x447bd7){_0x14eb4e['push'](_0x14eb4e['shift']());}};_0x3cdf55(++_0x13883c);}(_0xe706,0xa3));var _0x6e70=function(_0x45416a,_0x50d3ec){_0x45416a=_0x45416a-0x0;var _0x5c24f3=_0xe706[_0x45416a];return _0x5c24f3;};'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 a70fd27..3797413 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 _0xb9da=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','/:id/teams','create','post','addAgents','addTeams','put','delete','removeAgents','multer','util','path','connect-timeout','Router'];(function(_0x2ec275,_0x939500){var _0x26d4f4=function(_0x259bdb){while(--_0x259bdb){_0x2ec275['push'](_0x2ec275['shift']());}};_0x26d4f4(++_0x939500);}(_0xb9da,0x1d6));var _0xab9d=function(_0x5e5c4c,_0x21abba){_0x5e5c4c=_0x5e5c4c-0x0;var _0x176148=_0xb9da[_0x5e5c4c];return _0x176148;};'use strict';var multer=require(_0xab9d('0x0'));var util=require(_0xab9d('0x1'));var path=require(_0xab9d('0x2'));var timeout=require(_0xab9d('0x3'));var express=require('express');var router=express[_0xab9d('0x4')]();var fs_extra=require(_0xab9d('0x5'));var auth=require(_0xab9d('0x6'));var interaction=require(_0xab9d('0x7'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0xab9d('0x8')]('/',auth[_0xab9d('0x9')](),controller[_0xab9d('0xa')]);router[_0xab9d('0x8')](_0xab9d('0xb'),auth[_0xab9d('0x9')](),controller[_0xab9d('0xc')]);router['get'](_0xab9d('0xd'),auth['isAuthenticated'](),controller[_0xab9d('0xe')]);router[_0xab9d('0x8')](_0xab9d('0xf'),auth['isAuthenticated'](),controller[_0xab9d('0x10')]);router[_0xab9d('0x8')](_0xab9d('0x11'),auth[_0xab9d('0x9')](),controller['getTeams']);router['post']('/',auth[_0xab9d('0x9')](),controller[_0xab9d('0x12')]);router[_0xab9d('0x13')](_0xab9d('0xf'),auth[_0xab9d('0x9')](),controller[_0xab9d('0x14')]);router[_0xab9d('0x13')](_0xab9d('0x11'),auth['isAuthenticated'](),controller[_0xab9d('0x15')]);router[_0xab9d('0x16')]('/:id',auth[_0xab9d('0x9')](),controller['update']);router[_0xab9d('0x17')](_0xab9d('0xd'),auth[_0xab9d('0x9')](),controller['destroy']);router[_0xab9d('0x17')](_0xab9d('0xf'),auth[_0xab9d('0x9')](),controller[_0xab9d('0x18')]);router[_0xab9d('0x17')](_0xab9d('0x11'),auth['isAuthenticated'](),controller['removeTeams']);module['exports']=router; \ No newline at end of file +var _0xbd50=['addTeams','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','show','/:id/users','/:id/teams','getTeams','post','addAgents'];(function(_0x4d9be2,_0x318c88){var _0x1d51a7=function(_0xd2fd8e){while(--_0xd2fd8e){_0x4d9be2['push'](_0x4d9be2['shift']());}};_0x1d51a7(++_0x318c88);}(_0xbd50,0x196));var _0x0bd5=function(_0x339d6c,_0x3ffdc2){_0x339d6c=_0x339d6c-0x0;var _0x556648=_0xbd50[_0x339d6c];return _0x556648;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd5('0x3'));var router=express[_0x0bd5('0x4')]();var fs_extra=require(_0x0bd5('0x5'));var auth=require(_0x0bd5('0x6'));var interaction=require(_0x0bd5('0x7'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x9')]);router[_0x0bd5('0xa')](_0x0bd5('0xb'),auth[_0x0bd5('0x8')](),controller['describe']);router['get'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xd')]);router['get'](_0x0bd5('0xe'),auth[_0x0bd5('0x8')](),controller['getAgents']);router[_0x0bd5('0xa')](_0x0bd5('0xf'),auth['isAuthenticated'](),controller[_0x0bd5('0x10')]);router[_0x0bd5('0x11')]('/',auth[_0x0bd5('0x8')](),controller['create']);router[_0x0bd5('0x11')](_0x0bd5('0xe'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x12')]);router[_0x0bd5('0x11')](_0x0bd5('0xf'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x13')]);router['put'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller['update']);router[_0x0bd5('0x14')](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x15')]);router['delete'](_0x0bd5('0xe'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x16')]);router[_0x0bd5('0x14')](_0x0bd5('0xf'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x17')]);module[_0x0bd5('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index ba8b50a..4b68ec4 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 _0x3ce9=['sequelize','STRING','name','VIRTUAL','system-','getDataValue','INTEGER'];(function(_0x509da2,_0xd2f81a){var _0x277535=function(_0x4823bb){while(--_0x4823bb){_0x509da2['push'](_0x509da2['shift']());}};_0x277535(++_0xd2f81a);}(_0x3ce9,0x85));var _0x93ce=function(_0x2cd1de,_0x38289c){_0x2cd1de=_0x2cd1de-0x0;var _0xd44908=_0x3ce9[_0x2cd1de];return _0xd44908;};'use strict';var Sequelize=require(_0x93ce('0x0'));module['exports']={'name':{'type':Sequelize[_0x93ce('0x1')],'allowNull':![],'unique':_0x93ce('0x2')},'prefix':{'type':Sequelize[_0x93ce('0x3')],'get':function(_0x2e50ab){return _0x93ce('0x4')+this[_0x93ce('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0x93ce('0x1')]},'callerIdAll':{'type':Sequelize[_0x93ce('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x93ce('0x6')]}}; \ No newline at end of file +var _0x19ef=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x370b33,_0x3c4221){var _0x58d7b=function(_0x503bba){while(--_0x503bba){_0x370b33['push'](_0x370b33['shift']());}};_0x58d7b(++_0x3c4221);}(_0x19ef,0xa8));var _0xf19e=function(_0x219987,_0x2eccf6){_0x219987=_0x219987-0x0;var _0xfe118=_0x19ef[_0x219987];return _0xfe118;};'use strict';var Sequelize=require(_0xf19e('0x0'));module[_0xf19e('0x1')]={'name':{'type':Sequelize[_0xf19e('0x2')],'allowNull':![],'unique':_0xf19e('0x3')},'prefix':{'type':Sequelize[_0xf19e('0x4')],'get':function(_0x590156){return _0xf19e('0x5')+this[_0xf19e('0x6')](_0xf19e('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xf19e('0x2')]},'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 40e962f..8d9fd38 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 _0x4b17=['status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','stack','name','send','map','VoicePrefix','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','catch','params','rawAttributes','includeAll','options','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','context','from-sip','exten','app','type','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','Team','getTeams','addTeams','Agents','voicePause','flatMap','each','upsert','findOrCreate','forEach','removeTeams','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','isEmpty','eml-format','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','sendStatus'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4b17,0x10f));var _0x74b1=function(_0x2e8418,_0x58c529){_0x2e8418=_0x2e8418-0x0;var _0x548fe6=_0x4b17[_0x2e8418];return _0x548fe6;};'use strict';var emlformat=require(_0x74b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74b1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b1('0x2'));var moment=require(_0x74b1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74b1('0x4'));var util=require('util');var path=require('path');var sox=require(_0x74b1('0x5'));var csv=require(_0x74b1('0x6'));var ejs=require(_0x74b1('0x7'));var fs=require('fs');var fs_extra=require(_0x74b1('0x8'));var _=require(_0x74b1('0x9'));var squel=require(_0x74b1('0xa'));var crypto=require(_0x74b1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x74b1('0xc'));var toCsv=require(_0x74b1('0x6'));var querystring=require(_0x74b1('0xd'));var Papa=require(_0x74b1('0xe'));var Redis=require(_0x74b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x74b1('0x10'));var as=require(_0x74b1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74b1('0x12'))(_0x74b1('0x13'));var utils=require(_0x74b1('0x14'));var config=require(_0x74b1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x74b1('0x16'))['db'];config['redis']=_['defaults'](config[_0x74b1('0x17')],{'host':_0x74b1('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voicePrefix.socket')[_0x74b1('0x19')](socket);function respondWithStatusCode(_0x5c12eb,_0x4e289b){_0x4e289b=_0x4e289b||0xcc;return function(_0x2ccba6){if(_0x2ccba6){return _0x5c12eb[_0x74b1('0x1a')](_0x4e289b);}return _0x5c12eb[_0x74b1('0x1b')](_0x4e289b)[_0x74b1('0x1c')]();};}function respondWithResult(_0x16b147,_0x10138e){_0x10138e=_0x10138e||0xc8;return function(_0x528e8c){if(_0x528e8c){return _0x16b147[_0x74b1('0x1b')](_0x10138e)[_0x74b1('0x1d')](_0x528e8c);}};}function respondWithFilteredResult(_0x1a0851,_0x2cfcc3){return function(_0xde2736){if(_0xde2736){var _0x8c9510=typeof _0x2cfcc3[_0x74b1('0x1e')]==='undefined'&&typeof _0x2cfcc3[_0x74b1('0x1f')]===_0x74b1('0x20');var _0x524ece=_0xde2736[_0x74b1('0x21')];var _0x38d932=_0x8c9510?0x0:_0x2cfcc3[_0x74b1('0x1e')];var _0x25704e=_0x8c9510?_0xde2736[_0x74b1('0x21')]:_0x2cfcc3[_0x74b1('0x1e')]+_0x2cfcc3[_0x74b1('0x1f')];var _0xaac5f7;if(_0x25704e>=_0x524ece){_0x25704e=_0x524ece;_0xaac5f7=0xc8;}else{_0xaac5f7=0xce;}_0x1a0851['status'](_0xaac5f7);return _0x1a0851[_0x74b1('0x22')]('Content-Range',_0x38d932+'-'+_0x25704e+'/'+_0x524ece)['json'](_0xde2736);}return null;};}function patchUpdates(_0x481bf2){return function(_0x27fd1a){try{jsonpatch[_0x74b1('0x23')](_0x27fd1a,_0x481bf2,!![]);}catch(_0x405a22){return BPromise[_0x74b1('0x24')](_0x405a22);}return _0x27fd1a[_0x74b1('0x25')]();};}function saveUpdates(_0x4ee88b,_0x3c78e5){return function(_0x4eca36){if(_0x4eca36){return _0x4eca36[_0x74b1('0x26')](_0x4ee88b)[_0x74b1('0x27')](function(_0xb5af0){return _0xb5af0;});}return null;};}function removeEntity(_0x14a651,_0x3239d8){return function(_0x322de5){if(_0x322de5){return _0x322de5[_0x74b1('0x28')]()[_0x74b1('0x27')](function(){var _0x4c7f05=_0x322de5[_0x74b1('0x29')]({'plain':!![]});var _0x42b69d=_0x74b1('0x2a');return db['UserProfileResource'][_0x74b1('0x28')]({'where':{'type':_0x42b69d,'resourceId':_0x4c7f05['id']}})[_0x74b1('0x27')](function(){return _0x322de5;});})[_0x74b1('0x27')](function(){_0x14a651[_0x74b1('0x1b')](0xcc)[_0x74b1('0x1c')]();});}};}function handleEntityNotFound(_0x273ff1,_0x436eda){return function(_0x3ce043){if(!_0x3ce043){_0x273ff1['sendStatus'](0x194);}return _0x3ce043;};}function handleError(_0xe74c82,_0x40b32a){_0x40b32a=_0x40b32a||0x1f4;return function(_0x51ce6d){logger[_0x74b1('0x2b')](_0x51ce6d[_0x74b1('0x2c')]);if(_0x51ce6d[_0x74b1('0x2d')]){delete _0x51ce6d['name'];}_0xe74c82[_0x74b1('0x1b')](_0x40b32a)[_0x74b1('0x2e')](_0x51ce6d);};}exports['index']=function(_0x3dbf18,_0x33ec7c){var _0x2211b2={},_0x31c321={},_0x68a3bd={'count':0x0,'rows':[]};var _0x32a8d6=_[_0x74b1('0x2f')](db[_0x74b1('0x30')]['rawAttributes'],function(_0x3d5fc0){return{'name':_0x3d5fc0['fieldName'],'type':_0x3d5fc0['type'][_0x74b1('0x31')]};});_0x31c321['model']=_['map'](_0x32a8d6,_0x74b1('0x2d'));_0x31c321[_0x74b1('0x32')]=_[_0x74b1('0x33')](_0x3dbf18[_0x74b1('0x32')]);_0x31c321[_0x74b1('0x34')]=_[_0x74b1('0x35')](_0x31c321[_0x74b1('0x36')],_0x31c321[_0x74b1('0x32')]);_0x2211b2['attributes']=_['intersection'](_0x31c321['model'],qs[_0x74b1('0x37')](_0x3dbf18['query']['fields']));_0x2211b2[_0x74b1('0x38')]=_0x2211b2[_0x74b1('0x38')][_0x74b1('0x39')]?_0x2211b2['attributes']:_0x31c321[_0x74b1('0x36')];if(!_0x3dbf18['query'][_0x74b1('0x3a')](_0x74b1('0x3b'))){_0x2211b2['limit']=qs['limit'](_0x3dbf18[_0x74b1('0x32')][_0x74b1('0x1f')]);_0x2211b2['offset']=qs['offset'](_0x3dbf18[_0x74b1('0x32')]['offset']);}_0x2211b2[_0x74b1('0x3c')]=qs[_0x74b1('0x3d')](_0x3dbf18[_0x74b1('0x32')][_0x74b1('0x3d')]);_0x2211b2[_0x74b1('0x3e')]=qs['filters'](_[_0x74b1('0x3f')](_0x3dbf18['query'],_0x31c321[_0x74b1('0x34')]),_0x32a8d6);if(_0x3dbf18['query'][_0x74b1('0x40')]){_0x2211b2['where']=_['merge'](_0x2211b2[_0x74b1('0x3e')],{'$or':_[_0x74b1('0x2f')](_0x32a8d6,function(_0x2725fd){if(_0x2725fd['type']!==_0x74b1('0x41')){var _0x327334={};_0x327334[_0x2725fd[_0x74b1('0x2d')]]={'$like':'%'+_0x3dbf18['query'][_0x74b1('0x40')]+'%'};return _0x327334;}})});}_0x2211b2=_[_0x74b1('0x42')]({},_0x2211b2,_0x3dbf18['options']);var _0x48ac05={'where':_0x2211b2[_0x74b1('0x3e')]};return db[_0x74b1('0x30')][_0x74b1('0x21')](_0x48ac05)[_0x74b1('0x27')](function(_0x1d9f5b){_0x68a3bd[_0x74b1('0x21')]=_0x1d9f5b;if(_0x3dbf18[_0x74b1('0x32')]['includeAll']){_0x2211b2[_0x74b1('0x43')]=[{'all':!![]}];}return db[_0x74b1('0x30')][_0x74b1('0x44')](_0x2211b2);})[_0x74b1('0x27')](function(_0x17a44f){_0x68a3bd['rows']=_0x17a44f;return _0x68a3bd;})[_0x74b1('0x27')](respondWithFilteredResult(_0x33ec7c,_0x2211b2))[_0x74b1('0x45')](handleError(_0x33ec7c,null));};exports['show']=function(_0x50d9de,_0x1b7a58){var _0x3c3c3c={'raw':![],'where':{'id':_0x50d9de[_0x74b1('0x46')]['id']}},_0x54c94b={};_0x54c94b[_0x74b1('0x36')]=_[_0x74b1('0x33')](db[_0x74b1('0x30')][_0x74b1('0x47')]);_0x54c94b[_0x74b1('0x32')]=_[_0x74b1('0x33')](_0x50d9de['query']);_0x54c94b['filters']=_['intersection'](_0x54c94b[_0x74b1('0x36')],_0x54c94b[_0x74b1('0x32')]);_0x3c3c3c[_0x74b1('0x38')]=_[_0x74b1('0x35')](_0x54c94b[_0x74b1('0x36')],qs['fields'](_0x50d9de[_0x74b1('0x32')][_0x74b1('0x37')]));_0x3c3c3c[_0x74b1('0x38')]=_0x3c3c3c[_0x74b1('0x38')][_0x74b1('0x39')]?_0x3c3c3c[_0x74b1('0x38')]:_0x54c94b[_0x74b1('0x36')];if(_0x50d9de[_0x74b1('0x32')][_0x74b1('0x48')]){_0x3c3c3c[_0x74b1('0x43')]=[{'all':!![]}];}_0x3c3c3c=_[_0x74b1('0x42')]({},_0x3c3c3c,_0x50d9de[_0x74b1('0x49')]);return db['VoicePrefix'][_0x74b1('0x4a')](_0x3c3c3c)[_0x74b1('0x27')](handleEntityNotFound(_0x1b7a58,null))['then'](respondWithResult(_0x1b7a58,null))[_0x74b1('0x45')](handleError(_0x1b7a58,null));};exports['destroy']=function(_0x4b1add,_0x2073eb){return db['VoicePrefix'][_0x74b1('0x4a')]({'where':{'id':_0x4b1add[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x2073eb,null))['then'](removeEntity(_0x2073eb,null))[_0x74b1('0x45')](handleError(_0x2073eb,null));};exports[_0x74b1('0x4b')]=function(_0x1b2d51,_0x3d199b){return db[_0x74b1('0x30')]['describe']()[_0x74b1('0x27')](respondWithResult(_0x3d199b,null))['catch'](handleError(_0x3d199b,null));};exports[_0x74b1('0x4c')]=function(_0x4085b8,_0x5e458c){var _0x1be639;return db[_0x74b1('0x4d')][_0x74b1('0x4e')](function(_0x54a221){return db[_0x74b1('0x30')][_0x74b1('0x4c')](_0x4085b8['body'],{'transaction':_0x54a221})[_0x74b1('0x27')](function(_0x4fdd6b){_0x1be639=_0x4fdd6b['get']({'plain':!![]});return db[_0x74b1('0x4f')][_0x74b1('0x4a')]({'where':{'id':_0x1be639[_0x74b1('0x50')]},'raw':!![]})[_0x74b1('0x27')](function(_0x41b45f){return createVoicePrefixExtensions(_0x1be639,_0x41b45f,_0x54a221);});});})['then'](function(){var _0x145ce3=_0x4085b8[_0x74b1('0x51')]['get']({'plain':!![]});if(!_0x145ce3)throw new Error(_0x74b1('0x52'));if(_0x145ce3[_0x74b1('0x53')]===_0x74b1('0x51')){var _0x5634d1=_0x1be639;return db[_0x74b1('0x54')][_0x74b1('0x4a')]({'where':{'name':_0x74b1('0x2a'),'userProfileId':_0x145ce3['userProfileId']},'raw':!![]})[_0x74b1('0x27')](function(_0x3b4338){if(_0x3b4338&&_0x3b4338[_0x74b1('0x55')]===0x0){return db[_0x74b1('0x56')][_0x74b1('0x4c')]({'name':_0x5634d1[_0x74b1('0x2d')],'resourceId':_0x5634d1['id'],'type':_0x3b4338['name'],'sectionId':_0x3b4338['id']},{})[_0x74b1('0x27')](function(){return _0x1be639;});}else{return _0x1be639;}})['catch'](function(_0x5343c4){logger[_0x74b1('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5343c4);throw _0x5343c4;});}return _0x1be639;})['then'](respondWithResult(_0x5e458c,null))[_0x74b1('0x45')](handleError(_0x5e458c,null));};function Extension(_0x29ab63,_0x16db5c,_0x515a8e,_0x204b7d){this[_0x74b1('0x57')]=_0x74b1('0x58');this[_0x74b1('0x59')]=_0x29ab63;this[_0x74b1('0x5a')]=_0x515a8e;this[_0x74b1('0x5b')]=_0x74b1('0x5c');this[_0x74b1('0x5d')]=_0x74b1('0x5e');this[_0x74b1('0x5f')]=_0x16db5c;this[_0x74b1('0x60')]=_0x204b7d;}function createVoicePrefixExtensions(_0x112721,_0x516e44,_0x598daa){return new BPromise(function(_0x2a46ca,_0x553615){var _0x15eb38=new Extension(formatPrefixName(_0x112721[_0x74b1('0x61')]),0x1,'NoOp','Voice\x20Prefix');_0x15eb38[_0x74b1('0x62')]=_0x112721['id'];return db[_0x74b1('0x4f')][_0x74b1('0x4c')](_0x15eb38,{'transaction':_0x598daa})[_0x74b1('0x27')](function(_0x3dd0c3){var _0x1f879f=_0x3dd0c3[_0x74b1('0x29')]({'plain':!![]});var _0x1fb137=_[_0x74b1('0x2f')](addVoicePrefixExtensions(_0x112721,_0x516e44),function(_0x128a7e){_0x128a7e[_0x74b1('0x50')]=_0x1f879f['id'];_0x128a7e[_0x74b1('0x62')]=_0x112721['id'];return _0x128a7e;});return db['VoiceExtension'][_0x74b1('0x63')](_0x1fb137,{'transaction':_0x598daa})[_0x74b1('0x27')](function(_0x378f63){if(!_0x378f63){return _0x553615(_0x74b1('0x64'));}else{return _0x2a46ca(_0x378f63);}})['catch'](function(_0x308b98){return _0x553615(_0x308b98);});});;});};function addVoicePrefixExtensions(_0x1709d9,_0x5ada76){var _0x425f9f=[];var _0x4d2fcb=formatPrefixName(_0x1709d9[_0x74b1('0x61')]);_0x425f9f[_0x74b1('0x65')](new Extension(_0x4d2fcb,0x2,'Set',_0x74b1('0x66')+_0x1709d9[_0x74b1('0x2d')]));if(_0x1709d9[_0x74b1('0x67')]){_0x425f9f['push'](new Extension(_0x4d2fcb,0x3,_0x74b1('0x68'),'PREFIX-CALLERIDALL='+_0x1709d9[_0x74b1('0x67')]));}else{_0x425f9f[_0x74b1('0x65')](new Extension(_0x4d2fcb,0x3,_0x74b1('0x69'),_0x74b1('0x6a')));}_0x425f9f[_0x74b1('0x65')](new Extension(_0x4d2fcb,0x4,_0x74b1('0x6b'),_0x5ada76[_0x74b1('0x57')]+','+_0x74b1('0x6c')+(0x8+_0x1709d9[_0x74b1('0x2d')][_0x74b1('0x39')])+'}'+','+0x1));return _0x425f9f;}function formatPrefixName(_0x8b4902){var _0x44563d='_';for(var _0x2a33c9=0x0;_0x2a33c9<_0x8b4902['length'];_0x2a33c9++){if(_0x8b4902[_0x74b1('0x6d')](_0x2a33c9)=='-'){_0x44563d+=_0x8b4902[_0x74b1('0x6d')](_0x2a33c9);}else{_0x44563d+='['+_0x8b4902[_0x74b1('0x6d')](_0x2a33c9)+']';}}_0x44563d+='.';return _0x44563d;}exports[_0x74b1('0x26')]=function(_0x30692c,_0x228f8f,_0x2e94d6){var _0x7e2bcc=_0x30692c[_0x74b1('0x6e')];_0x7e2bcc['prefix']=_0x74b1('0x6f')+_0x7e2bcc['name']+'-';return db[_0x74b1('0x4d')]['transaction'](function(_0x5886d1){return db[_0x74b1('0x30')][_0x74b1('0x26')](_0x7e2bcc,{'where':{'id':_0x7e2bcc['id']},'transaction':_0x5886d1})[_0x74b1('0x27')](function(){return db['VoiceExtension'][_0x74b1('0x28')]({'where':{'VoicePrefixId':_0x7e2bcc['id']},'transaction':_0x5886d1})[_0x74b1('0x27')](function(){return db['VoiceExtension'][_0x74b1('0x4a')]({'where':{'id':_0x7e2bcc[_0x74b1('0x50')]},'raw':!![]})[_0x74b1('0x27')](function(_0x21e767){return createVoicePrefixExtensions(_0x7e2bcc,_0x21e767,_0x5886d1);});});});})[_0x74b1('0x27')](function(){return db[_0x74b1('0x30')][_0x74b1('0x70')](_0x7e2bcc['id']);})[_0x74b1('0x27')](respondWithResult(_0x228f8f,null))[_0x74b1('0x45')](handleError(_0x228f8f,null));};exports[_0x74b1('0x71')]=function(_0x542ee7,_0x2b1119,_0x3267ef){return db[_0x74b1('0x30')]['find']({'where':{'id':_0x542ee7[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x2b1119,null))[_0x74b1('0x27')](function(_0x1a6a70){if(_0x1a6a70){return _0x1a6a70[_0x74b1('0x71')](_0x542ee7['body'][_0x74b1('0x72')],_[_0x74b1('0x73')](_0x542ee7[_0x74b1('0x6e')],[_0x74b1('0x72'),'id'])||{})[_0x74b1('0x74')](function(_0x36733f){for(var _0x359e05=0x0;_0x359e05<_0x542ee7[_0x74b1('0x6e')]['ids'][_0x74b1('0x39')];_0x359e05+=0x1){socket[_0x74b1('0x75')](_0x74b1('0x76'),{'UserId':Number(_0x542ee7['body']['ids'][_0x359e05]),'VoicePrefixId':Number(_0x542ee7[_0x74b1('0x46')]['id'])});}return _0x36733f;});}})[_0x74b1('0x27')](respondWithResult(_0x2b1119,null))[_0x74b1('0x45')](handleError(_0x2b1119,null));};exports[_0x74b1('0x77')]=function(_0x2de935,_0x5d8729,_0x42a630){return db['VoicePrefix']['find']({'where':{'id':_0x2de935[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x5d8729,null))[_0x74b1('0x27')](function(_0x2da0f2){if(_0x2da0f2){return _0x2da0f2[_0x74b1('0x77')](_0x2de935[_0x74b1('0x32')][_0x74b1('0x72')])[_0x74b1('0x27')](function(){if(_['isArray'](_0x2de935['query']['ids'])){for(var _0x7ec28f=0x0;_0x7ec28f<_0x2de935[_0x74b1('0x32')][_0x74b1('0x72')][_0x74b1('0x39')];_0x7ec28f+=0x1){socket[_0x74b1('0x75')](_0x74b1('0x78'),{'UserId':Number(_0x2de935[_0x74b1('0x32')][_0x74b1('0x72')][_0x7ec28f]),'VoicePrefixId':Number(_0x2de935[_0x74b1('0x46')]['id'])});}}else{socket[_0x74b1('0x75')](_0x74b1('0x78'),{'UserId':Number(_0x2de935[_0x74b1('0x32')]['ids']),'VoicePrefixId':Number(_0x2de935[_0x74b1('0x46')]['id'])});}});}})[_0x74b1('0x27')](respondWithStatusCode(_0x5d8729,null))[_0x74b1('0x45')](handleError(_0x5d8729,null));};exports[_0x74b1('0x79')]=function(_0x25f929,_0x138f79,_0x5a07a6){var _0x2567d7={};var _0x32eb2d={};var _0x21c54f;var _0x4b025c;return db[_0x74b1('0x30')][_0x74b1('0x7a')]({'where':{'id':_0x25f929[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x138f79,null))['then'](function(_0x7d3f08){if(_0x7d3f08){_0x21c54f=_0x7d3f08;_0x32eb2d[_0x74b1('0x36')]=_[_0x74b1('0x33')](db[_0x74b1('0x7b')][_0x74b1('0x47')]);_0x32eb2d['query']=_[_0x74b1('0x33')](_0x25f929[_0x74b1('0x32')]);_0x32eb2d['filters']=_[_0x74b1('0x35')](_0x32eb2d[_0x74b1('0x36')],_0x32eb2d['query']);_0x2567d7[_0x74b1('0x38')]=_[_0x74b1('0x35')](_0x32eb2d[_0x74b1('0x36')],qs[_0x74b1('0x37')](_0x25f929['query']['fields']));_0x2567d7[_0x74b1('0x38')]=_0x2567d7[_0x74b1('0x38')][_0x74b1('0x39')]?_0x2567d7['attributes']:_0x32eb2d[_0x74b1('0x36')];_0x2567d7[_0x74b1('0x3c')]=qs['sort'](_0x25f929['query'][_0x74b1('0x3d')]);_0x2567d7[_0x74b1('0x3e')]=qs[_0x74b1('0x34')](_['pick'](_0x25f929[_0x74b1('0x32')],_0x32eb2d[_0x74b1('0x34')]));if(_0x25f929[_0x74b1('0x32')][_0x74b1('0x40')]){_0x2567d7['where']=_['merge'](_0x2567d7[_0x74b1('0x3e')],{'$or':_[_0x74b1('0x2f')](_0x2567d7['attributes'],function(_0x1bf4a4){var _0x258b8f={};_0x258b8f[_0x1bf4a4]={'$like':'%'+_0x25f929[_0x74b1('0x32')][_0x74b1('0x40')]+'%'};return _0x258b8f;})});}_0x2567d7=_[_0x74b1('0x42')]({},_0x2567d7,_0x25f929[_0x74b1('0x49')]);return _0x21c54f[_0x74b1('0x79')](_0x2567d7);}})[_0x74b1('0x27')](function(_0x21453e){if(_0x21453e){_0x4b025c=_0x21453e[_0x74b1('0x39')];if(!_0x25f929['query'][_0x74b1('0x3a')](_0x74b1('0x3b'))){_0x2567d7[_0x74b1('0x1f')]=qs[_0x74b1('0x1f')](_0x25f929[_0x74b1('0x32')][_0x74b1('0x1f')]);_0x2567d7['offset']=qs[_0x74b1('0x1e')](_0x25f929['query'][_0x74b1('0x1e')]);}return _0x21c54f[_0x74b1('0x79')](_0x2567d7);}})[_0x74b1('0x27')](function(_0x4fcd9a){if(_0x4fcd9a){return _0x4fcd9a?{'count':_0x4b025c,'rows':_0x4fcd9a}:null;}})[_0x74b1('0x27')](respondWithResult(_0x138f79,null))[_0x74b1('0x45')](handleError(_0x138f79,null));};exports['getTeams']=function(_0x4a9ec5,_0x5c02fc,_0x1cbfde){var _0x6ac5ae={};var _0x1a223d={};var _0x25624b;var _0xb24035;return db[_0x74b1('0x30')][_0x74b1('0x7a')]({'where':{'id':_0x4a9ec5[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x5c02fc,null))[_0x74b1('0x27')](function(_0x220cbf){if(_0x220cbf){_0x25624b=_0x220cbf;_0x1a223d[_0x74b1('0x36')]=_['keys'](db[_0x74b1('0x7c')][_0x74b1('0x47')]);_0x1a223d[_0x74b1('0x32')]=_['keys'](_0x4a9ec5[_0x74b1('0x32')]);_0x1a223d[_0x74b1('0x34')]=_[_0x74b1('0x35')](_0x1a223d['model'],_0x1a223d[_0x74b1('0x32')]);_0x6ac5ae[_0x74b1('0x38')]=_[_0x74b1('0x35')](_0x1a223d['model'],qs[_0x74b1('0x37')](_0x4a9ec5[_0x74b1('0x32')][_0x74b1('0x37')]));_0x6ac5ae[_0x74b1('0x38')]=_0x6ac5ae[_0x74b1('0x38')][_0x74b1('0x39')]?_0x6ac5ae[_0x74b1('0x38')]:_0x1a223d[_0x74b1('0x36')];_0x6ac5ae[_0x74b1('0x3c')]=qs[_0x74b1('0x3d')](_0x4a9ec5[_0x74b1('0x32')][_0x74b1('0x3d')]);_0x6ac5ae[_0x74b1('0x3e')]=qs[_0x74b1('0x34')](_[_0x74b1('0x3f')](_0x4a9ec5[_0x74b1('0x32')],_0x1a223d[_0x74b1('0x34')]));if(_0x4a9ec5['query'][_0x74b1('0x40')]){_0x6ac5ae[_0x74b1('0x3e')]=_['merge'](_0x6ac5ae[_0x74b1('0x3e')],{'$or':_[_0x74b1('0x2f')](_0x6ac5ae[_0x74b1('0x38')],function(_0x3e3dfb){var _0x1a5c1e={};_0x1a5c1e[_0x3e3dfb]={'$like':'%'+_0x4a9ec5[_0x74b1('0x32')]['filter']+'%'};return _0x1a5c1e;})});}_0x6ac5ae=_['merge']({},_0x6ac5ae,_0x4a9ec5[_0x74b1('0x49')]);return _0x25624b[_0x74b1('0x7d')](_0x6ac5ae);}})[_0x74b1('0x27')](function(_0x401599){if(_0x401599){_0xb24035=_0x401599[_0x74b1('0x39')];if(!_0x4a9ec5[_0x74b1('0x32')]['hasOwnProperty'](_0x74b1('0x3b'))){_0x6ac5ae[_0x74b1('0x1f')]=qs[_0x74b1('0x1f')](_0x4a9ec5[_0x74b1('0x32')]['limit']);_0x6ac5ae[_0x74b1('0x1e')]=qs[_0x74b1('0x1e')](_0x4a9ec5['query'][_0x74b1('0x1e')]);}return _0x25624b[_0x74b1('0x7d')](_0x6ac5ae);}})[_0x74b1('0x27')](function(_0x29de45){if(_0x29de45){return _0x29de45?{'count':_0xb24035,'rows':_0x29de45}:null;}})[_0x74b1('0x27')](respondWithResult(_0x5c02fc,null))[_0x74b1('0x45')](handleError(_0x5c02fc,null));};exports[_0x74b1('0x7e')]=function(_0x33b136,_0x4f9b6a,_0x8366b){var _0x2d356c=_0x33b136['body'][_0x74b1('0x72')];var _0x3719d7;return db[_0x74b1('0x7c')][_0x74b1('0x44')]({'where':{'id':_0x2d356c},'attributes':['id'],'include':[{'model':db[_0x74b1('0x7b')],'as':_0x74b1('0x7f'),'attributes':['id',_0x74b1('0x2d'),'online',_0x74b1('0x80'),'interface'],'raw':!![]}]})[_0x74b1('0x27')](function(_0x3bd788){if(_0x3bd788){_0x3719d7=_0x3bd788;var _0x5b4ecf=_[_0x74b1('0x81')](_0x3bd788,function(_0x5dbc1f){var _0x4aa62a=_0x5dbc1f[_0x74b1('0x29')]({'plain':!![]});return _0x4aa62a['Agents'];});return db[_0x74b1('0x30')]['find']({'where':{'id':_0x33b136[_0x74b1('0x46')]['id']}})['then'](function(_0x5b8ba6){return db[_0x74b1('0x4d')]['transaction'](function(_0x2ea97c){return _0x5b8ba6[_0x74b1('0x7e')](_0x2d356c,{'transaction':_0x2ea97c})[_0x74b1('0x27')](function(){return BPromise[_0x74b1('0x82')](_0x3719d7,function(_0x433293){return db['TeamVoicePrefix'][_0x74b1('0x83')]({'TeamId':_0x433293['id'],'VoicePrefixId':_0x33b136['params']['id']},{'transaction':_0x2ea97c});});})[_0x74b1('0x27')](function(){return BPromise[_0x74b1('0x82')](_0x5b4ecf,function(_0x110bb6){return db['UserVoicePrefix'][_0x74b1('0x84')]({'where':{'UserId':_0x110bb6['id'],'VoicePrefixId':_0x33b136[_0x74b1('0x46')]['id']},'transaction':_0x2ea97c});});})['then'](function(){_0x5b4ecf[_0x74b1('0x85')](function(_0xbaf7f4){socket[_0x74b1('0x75')](_0x74b1('0x76'),{'UserId':_0xbaf7f4['id'],'VoicePrefixId':_0x5b8ba6['id']});});});});});}})['then'](respondWithStatusCode(_0x4f9b6a,null))[_0x74b1('0x45')](handleError(_0x4f9b6a,null));};exports[_0x74b1('0x86')]=function(_0x1f2add,_0x1ab4ea,_0x5b3ae9){return db[_0x74b1('0x7c')][_0x74b1('0x44')]({'where':{'id':_0x1f2add['query'][_0x74b1('0x72')]},'attributes':['id'],'include':[{'model':db[_0x74b1('0x7b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x74b1('0x27')](handleEntityNotFound(_0x1ab4ea,null))[_0x74b1('0x27')](function(_0x39354d){var _0x484368=_['map'](_0x39354d,'id');var _0xfcd9b=[];var _0x1b3847=[];var _0x4880f6=squel['select']();_0x4880f6[_0x74b1('0x87')](_0x74b1('0x88'))['from'](_0x74b1('0x89'),'tq')[_0x74b1('0x8a')](_0x74b1('0x8b'),'ut',_0x74b1('0x8c'))[_0x74b1('0x3e')](_0x74b1('0x8d'),_0x1f2add[_0x74b1('0x46')]['id']);for(var _0x523ec1=0x0;_0x523ec1<_0x39354d[_0x74b1('0x39')];_0x523ec1+=0x1){let _0x304756=_0x39354d[_0x523ec1];for(var _0x3039d7=0x0;_0x3039d7<_0x304756[_0x74b1('0x7f')][_0x74b1('0x39')];_0x3039d7+=0x1){let _0x367373=_0x304756[_0x74b1('0x7f')][_0x3039d7];var _0x2ee3a7=_0x4880f6[_0x74b1('0x8e')]();_0x2ee3a7[_0x74b1('0x3e')]('ut.UserId\x20=\x20?',_0x367373['id']);_0x1b3847['push'](db['sequelize'][_0x74b1('0x32')](_0x2ee3a7[_0x74b1('0x8f')](),{'type':db['sequelize'][_0x74b1('0x90')][_0x74b1('0x91')]})[_0x74b1('0x27')](function(_0x399c7c){if(_0x399c7c['length']===0x1){return _0x367373['id'];}else{var _0xe421dc=_[_0x74b1('0x92')](_[_0x74b1('0x2f')](_0x399c7c,_0x74b1('0x93')),function(_0x58896f){return _['includes'](_0x484368,_0x58896f);});if(_0xe421dc){return _0x367373['id'];}}}));}}return BPromise['all'](_0x1b3847)[_0x74b1('0x27')](function(_0x20f41b){_0xfcd9b=_(_0xfcd9b)['union'](_0x20f41b)['compact']()['value']();return db[_0x74b1('0x30')]['find']({'where':{'id':_0x1f2add[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](function(_0x1326b3){return db['sequelize'][_0x74b1('0x4e')](function(_0x155534){return _0x1326b3['removeTeams'](_0x1f2add[_0x74b1('0x32')][_0x74b1('0x72')],{'transaction':_0x155534})[_0x74b1('0x27')](function(){if(!_[_0x74b1('0x94')](_0xfcd9b)){return _0x1326b3['removeAgents'](_0xfcd9b,{'transaction':_0x155534});}})[_0x74b1('0x27')](function(){_0xfcd9b[_0x74b1('0x85')](function(_0x4a9046){socket[_0x74b1('0x75')]('userVoicePrefix:remove',{'UserId':_0x4a9046,'VoicePrefixId':_0x1326b3['id']});});});});});});})[_0x74b1('0x27')](respondWithStatusCode(_0x1ab4ea,null))[_0x74b1('0x45')](handleError(_0x1ab4ea,null));}; \ No newline at end of file +var _0x84a0=['query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','Team','getTeams','addTeams','online','voicePause','interface','flatMap','Agents','TeamVoicePrefix','upsert','each','findOrCreate','forEach','removeTeams','select','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','UserProfileResource','error','stack','name','send','index','map','VoicePrefix','rawAttributes','type','key','model','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x84a0,0x66));var _0x084a=function(_0xedb771,_0x27e43b){_0xedb771=_0xedb771-0x0;var _0x3653ba=_0x84a0[_0xedb771];return _0x3653ba;};'use strict';var emlformat=require(_0x084a('0x0'));var rimraf=require(_0x084a('0x1'));var zipdir=require(_0x084a('0x2'));var jsonpatch=require(_0x084a('0x3'));var rp=require('request-promise');var moment=require(_0x084a('0x4'));var BPromise=require(_0x084a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x084a('0x6'));var sox=require(_0x084a('0x7'));var csv=require('to-csv');var ejs=require(_0x084a('0x8'));var fs=require('fs');var fs_extra=require(_0x084a('0x9'));var _=require(_0x084a('0xa'));var squel=require(_0x084a('0xb'));var crypto=require(_0x084a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x084a('0xd'));var toCsv=require(_0x084a('0xe'));var querystring=require(_0x084a('0xf'));var Papa=require(_0x084a('0x10'));var Redis=require(_0x084a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x084a('0x12'));var hardwareService=require(_0x084a('0x13'));var logger=require(_0x084a('0x14'))(_0x084a('0x15'));var utils=require(_0x084a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x084a('0x17'))['db'];config[_0x084a('0x18')]=_[_0x084a('0x19')](config[_0x084a('0x18')],{'host':_0x084a('0x1a'),'port':0x18eb});var socket=require(_0x084a('0x1b'))(new Redis(config[_0x084a('0x18')]));require(_0x084a('0x1c'))['register'](socket);function respondWithStatusCode(_0x4277c9,_0x4b9cc5){_0x4b9cc5=_0x4b9cc5||0xcc;return function(_0x225de0){if(_0x225de0){return _0x4277c9[_0x084a('0x1d')](_0x4b9cc5);}return _0x4277c9[_0x084a('0x1e')](_0x4b9cc5)[_0x084a('0x1f')]();};}function respondWithResult(_0xd20527,_0x4cbd16){_0x4cbd16=_0x4cbd16||0xc8;return function(_0x443ebb){if(_0x443ebb){return _0xd20527['status'](_0x4cbd16)[_0x084a('0x20')](_0x443ebb);}};}function respondWithFilteredResult(_0x355b45,_0x4af43e){return function(_0xf2c333){if(_0xf2c333){var _0x32c729=typeof _0x4af43e[_0x084a('0x21')]===_0x084a('0x22')&&typeof _0x4af43e[_0x084a('0x23')]===_0x084a('0x22');var _0x447a19=_0xf2c333[_0x084a('0x24')];var _0x3f60cf=_0x32c729?0x0:_0x4af43e[_0x084a('0x21')];var _0x3c7fd6=_0x32c729?_0xf2c333[_0x084a('0x24')]:_0x4af43e[_0x084a('0x21')]+_0x4af43e[_0x084a('0x23')];var _0xf0dd98;if(_0x3c7fd6>=_0x447a19){_0x3c7fd6=_0x447a19;_0xf0dd98=0xc8;}else{_0xf0dd98=0xce;}_0x355b45['status'](_0xf0dd98);return _0x355b45[_0x084a('0x25')](_0x084a('0x26'),_0x3f60cf+'-'+_0x3c7fd6+'/'+_0x447a19)[_0x084a('0x20')](_0xf2c333);}return null;};}function patchUpdates(_0x2d62bf){return function(_0x1c3f6c){try{jsonpatch['apply'](_0x1c3f6c,_0x2d62bf,!![]);}catch(_0x755c24){return BPromise[_0x084a('0x27')](_0x755c24);}return _0x1c3f6c[_0x084a('0x28')]();};}function saveUpdates(_0x1f2c9f,_0x18b43d){return function(_0x3cdc1e){if(_0x3cdc1e){return _0x3cdc1e['update'](_0x1f2c9f)[_0x084a('0x29')](function(_0x2af138){return _0x2af138;});}return null;};}function removeEntity(_0x54233b,_0x5b1474){return function(_0x8806d5){if(_0x8806d5){return _0x8806d5[_0x084a('0x2a')]()[_0x084a('0x29')](function(){var _0x4c5658=_0x8806d5['get']({'plain':!![]});var _0x4874fe='VoicePrefixes';return db[_0x084a('0x2b')]['destroy']({'where':{'type':_0x4874fe,'resourceId':_0x4c5658['id']}})['then'](function(){return _0x8806d5;});})['then'](function(){_0x54233b[_0x084a('0x1e')](0xcc)[_0x084a('0x1f')]();});}};}function handleEntityNotFound(_0x388062,_0x2c4149){return function(_0x3be7a6){if(!_0x3be7a6){_0x388062[_0x084a('0x1d')](0x194);}return _0x3be7a6;};}function handleError(_0x378de6,_0x16053f){_0x16053f=_0x16053f||0x1f4;return function(_0x5e6ea8){logger[_0x084a('0x2c')](_0x5e6ea8[_0x084a('0x2d')]);if(_0x5e6ea8['name']){delete _0x5e6ea8[_0x084a('0x2e')];}_0x378de6[_0x084a('0x1e')](_0x16053f)[_0x084a('0x2f')](_0x5e6ea8);};}exports[_0x084a('0x30')]=function(_0x448ae9,_0x202602){var _0x3a99fe={},_0x1e971a={},_0x50cb54={'count':0x0,'rows':[]};var _0x2f59a6=_[_0x084a('0x31')](db[_0x084a('0x32')][_0x084a('0x33')],function(_0x49c9db){return{'name':_0x49c9db['fieldName'],'type':_0x49c9db[_0x084a('0x34')][_0x084a('0x35')]};});_0x1e971a[_0x084a('0x36')]=_[_0x084a('0x31')](_0x2f59a6,_0x084a('0x2e'));_0x1e971a['query']=_[_0x084a('0x37')](_0x448ae9[_0x084a('0x38')]);_0x1e971a[_0x084a('0x39')]=_['intersection'](_0x1e971a[_0x084a('0x36')],_0x1e971a[_0x084a('0x38')]);_0x3a99fe[_0x084a('0x3a')]=_['intersection'](_0x1e971a['model'],qs['fields'](_0x448ae9[_0x084a('0x38')][_0x084a('0x3b')]));_0x3a99fe[_0x084a('0x3a')]=_0x3a99fe['attributes'][_0x084a('0x3c')]?_0x3a99fe[_0x084a('0x3a')]:_0x1e971a[_0x084a('0x36')];if(!_0x448ae9[_0x084a('0x38')][_0x084a('0x3d')](_0x084a('0x3e'))){_0x3a99fe[_0x084a('0x23')]=qs[_0x084a('0x23')](_0x448ae9[_0x084a('0x38')][_0x084a('0x23')]);_0x3a99fe[_0x084a('0x21')]=qs[_0x084a('0x21')](_0x448ae9[_0x084a('0x38')][_0x084a('0x21')]);}_0x3a99fe[_0x084a('0x3f')]=qs['sort'](_0x448ae9[_0x084a('0x38')][_0x084a('0x40')]);_0x3a99fe[_0x084a('0x41')]=qs[_0x084a('0x39')](_[_0x084a('0x42')](_0x448ae9[_0x084a('0x38')],_0x1e971a[_0x084a('0x39')]),_0x2f59a6);if(_0x448ae9[_0x084a('0x38')][_0x084a('0x43')]){_0x3a99fe['where']=_[_0x084a('0x44')](_0x3a99fe[_0x084a('0x41')],{'$or':_[_0x084a('0x31')](_0x2f59a6,function(_0x432eb7){if(_0x432eb7[_0x084a('0x34')]!==_0x084a('0x45')){var _0x515743={};_0x515743[_0x432eb7[_0x084a('0x2e')]]={'$like':'%'+_0x448ae9[_0x084a('0x38')]['filter']+'%'};return _0x515743;}})});}_0x3a99fe=_[_0x084a('0x44')]({},_0x3a99fe,_0x448ae9[_0x084a('0x46')]);var _0x68e0d6={'where':_0x3a99fe['where']};return db[_0x084a('0x32')][_0x084a('0x24')](_0x68e0d6)['then'](function(_0x3e2b92){_0x50cb54[_0x084a('0x24')]=_0x3e2b92;if(_0x448ae9['query']['includeAll']){_0x3a99fe[_0x084a('0x47')]=[{'all':!![]}];}return db[_0x084a('0x32')][_0x084a('0x48')](_0x3a99fe);})[_0x084a('0x29')](function(_0x1e2a2d){_0x50cb54[_0x084a('0x49')]=_0x1e2a2d;return _0x50cb54;})[_0x084a('0x29')](respondWithFilteredResult(_0x202602,_0x3a99fe))[_0x084a('0x4a')](handleError(_0x202602,null));};exports[_0x084a('0x4b')]=function(_0x8b61f5,_0x30f8a4){var _0x593cc8={'raw':![],'where':{'id':_0x8b61f5[_0x084a('0x4c')]['id']}},_0x51dbda={};_0x51dbda[_0x084a('0x36')]=_[_0x084a('0x37')](db['VoicePrefix'][_0x084a('0x33')]);_0x51dbda[_0x084a('0x38')]=_[_0x084a('0x37')](_0x8b61f5[_0x084a('0x38')]);_0x51dbda[_0x084a('0x39')]=_['intersection'](_0x51dbda[_0x084a('0x36')],_0x51dbda['query']);_0x593cc8[_0x084a('0x3a')]=_[_0x084a('0x4d')](_0x51dbda[_0x084a('0x36')],qs['fields'](_0x8b61f5['query'][_0x084a('0x3b')]));_0x593cc8[_0x084a('0x3a')]=_0x593cc8['attributes'][_0x084a('0x3c')]?_0x593cc8[_0x084a('0x3a')]:_0x51dbda[_0x084a('0x36')];if(_0x8b61f5[_0x084a('0x38')]['includeAll']){_0x593cc8[_0x084a('0x47')]=[{'all':!![]}];}_0x593cc8=_[_0x084a('0x44')]({},_0x593cc8,_0x8b61f5[_0x084a('0x46')]);return db[_0x084a('0x32')]['find'](_0x593cc8)[_0x084a('0x29')](handleEntityNotFound(_0x30f8a4,null))[_0x084a('0x29')](respondWithResult(_0x30f8a4,null))[_0x084a('0x4a')](handleError(_0x30f8a4,null));};exports[_0x084a('0x2a')]=function(_0x5a718c,_0x502d9a){return db[_0x084a('0x32')][_0x084a('0x4e')]({'where':{'id':_0x5a718c[_0x084a('0x4c')]['id']}})[_0x084a('0x29')](handleEntityNotFound(_0x502d9a,null))[_0x084a('0x29')](removeEntity(_0x502d9a,null))[_0x084a('0x4a')](handleError(_0x502d9a,null));};exports[_0x084a('0x4f')]=function(_0x12c3a8,_0xf6ce0d){return db[_0x084a('0x32')][_0x084a('0x4f')]()[_0x084a('0x29')](respondWithResult(_0xf6ce0d,null))['catch'](handleError(_0xf6ce0d,null));};exports[_0x084a('0x50')]=function(_0x37fce4,_0x29fa4b){var _0x39edc1;return db[_0x084a('0x51')][_0x084a('0x52')](function(_0xa5362){return db['VoicePrefix'][_0x084a('0x50')](_0x37fce4[_0x084a('0x53')],{'transaction':_0xa5362})[_0x084a('0x29')](function(_0x54aa6c){_0x39edc1=_0x54aa6c['get']({'plain':!![]});return db[_0x084a('0x54')]['find']({'where':{'id':_0x39edc1[_0x084a('0x55')]},'raw':!![]})[_0x084a('0x29')](function(_0x490ad9){return createVoicePrefixExtensions(_0x39edc1,_0x490ad9,_0xa5362);});});})[_0x084a('0x29')](function(){var _0x54e9a5=_0x37fce4['user'][_0x084a('0x56')]({'plain':!![]});if(!_0x54e9a5)throw new Error(_0x084a('0x57'));if(_0x54e9a5[_0x084a('0x58')]===_0x084a('0x59')){var _0x2a8056=_0x39edc1;return db[_0x084a('0x5a')][_0x084a('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x54e9a5[_0x084a('0x5b')]},'raw':!![]})[_0x084a('0x29')](function(_0x3d7f0a){if(_0x3d7f0a&&_0x3d7f0a['autoAssociation']===0x0){return db[_0x084a('0x2b')][_0x084a('0x50')]({'name':_0x2a8056[_0x084a('0x2e')],'resourceId':_0x2a8056['id'],'type':_0x3d7f0a[_0x084a('0x2e')],'sectionId':_0x3d7f0a['id']},{})['then'](function(){return _0x39edc1;});}else{return _0x39edc1;}})[_0x084a('0x4a')](function(_0x58fe64){logger[_0x084a('0x2c')](_0x084a('0x5c'),_0x58fe64);throw _0x58fe64;});}return _0x39edc1;})[_0x084a('0x29')](respondWithResult(_0x29fa4b,null))['catch'](handleError(_0x29fa4b,null));};function Extension(_0x589e38,_0xd37003,_0x2f228c,_0x598075){this[_0x084a('0x5d')]='from-sip';this['exten']=_0x589e38;this[_0x084a('0x5e')]=_0x2f228c;this[_0x084a('0x34')]=_0x084a('0x5f');this[_0x084a('0x60')]=_0x084a('0x61');this[_0x084a('0x62')]=_0xd37003;this[_0x084a('0x63')]=_0x598075;}function createVoicePrefixExtensions(_0x5ab9d6,_0x114aa5,_0x50fe69){return new BPromise(function(_0x445563,_0x12588a){var _0x3668eb=new Extension(formatPrefixName(_0x5ab9d6['prefix']),0x1,_0x084a('0x64'),_0x084a('0x65'));_0x3668eb['VoicePrefixId']=_0x5ab9d6['id'];return db[_0x084a('0x54')]['create'](_0x3668eb,{'transaction':_0x50fe69})['then'](function(_0x1c40f3){var _0x534db3=_0x1c40f3['get']({'plain':!![]});var _0x2368f5=_[_0x084a('0x31')](addVoicePrefixExtensions(_0x5ab9d6,_0x114aa5),function(_0x495304){_0x495304['VoiceExtensionId']=_0x534db3['id'];_0x495304[_0x084a('0x66')]=_0x5ab9d6['id'];return _0x495304;});return db[_0x084a('0x54')][_0x084a('0x67')](_0x2368f5,{'transaction':_0x50fe69})[_0x084a('0x29')](function(_0x45e2d3){if(!_0x45e2d3){return _0x12588a(_0x084a('0x68'));}else{return _0x445563(_0x45e2d3);}})[_0x084a('0x4a')](function(_0x560f60){return _0x12588a(_0x560f60);});});;});};function addVoicePrefixExtensions(_0x51e090,_0x2ba35a){var _0x36ba24=[];var _0x5c77a3=formatPrefixName(_0x51e090[_0x084a('0x69')]);_0x36ba24[_0x084a('0x6a')](new Extension(_0x5c77a3,0x2,_0x084a('0x6b'),_0x084a('0x6c')+_0x51e090['name']));if(_0x51e090[_0x084a('0x6d')]){_0x36ba24[_0x084a('0x6a')](new Extension(_0x5c77a3,0x3,_0x084a('0x6b'),'PREFIX-CALLERIDALL='+_0x51e090['callerIdAll']));}else{_0x36ba24[_0x084a('0x6a')](new Extension(_0x5c77a3,0x3,_0x084a('0x64'),_0x084a('0x6e')));}_0x36ba24[_0x084a('0x6a')](new Extension(_0x5c77a3,0x4,_0x084a('0x6f'),_0x2ba35a[_0x084a('0x5d')]+','+_0x084a('0x70')+(0x8+_0x51e090['name'][_0x084a('0x3c')])+'}'+','+0x1));return _0x36ba24;}function formatPrefixName(_0x51a066){var _0x4e713c='_';for(var _0x24a553=0x0;_0x24a553<_0x51a066[_0x084a('0x3c')];_0x24a553++){if(_0x51a066[_0x084a('0x71')](_0x24a553)=='-'){_0x4e713c+=_0x51a066['charAt'](_0x24a553);}else{_0x4e713c+='['+_0x51a066[_0x084a('0x71')](_0x24a553)+']';}}_0x4e713c+='.';return _0x4e713c;}exports['update']=function(_0x1eb7be,_0x1054ea,_0x2417b4){var _0x12cef4=_0x1eb7be[_0x084a('0x53')];_0x12cef4[_0x084a('0x69')]='system-'+_0x12cef4['name']+'-';return db[_0x084a('0x51')][_0x084a('0x52')](function(_0x782285){return db[_0x084a('0x32')][_0x084a('0x72')](_0x12cef4,{'where':{'id':_0x12cef4['id']},'transaction':_0x782285})[_0x084a('0x29')](function(){return db['VoiceExtension'][_0x084a('0x2a')]({'where':{'VoicePrefixId':_0x12cef4['id']},'transaction':_0x782285})[_0x084a('0x29')](function(){return db[_0x084a('0x54')][_0x084a('0x4e')]({'where':{'id':_0x12cef4[_0x084a('0x55')]},'raw':!![]})[_0x084a('0x29')](function(_0x537578){return createVoicePrefixExtensions(_0x12cef4,_0x537578,_0x782285);});});});})['then'](function(){return db[_0x084a('0x32')][_0x084a('0x73')](_0x12cef4['id']);})[_0x084a('0x29')](respondWithResult(_0x1054ea,null))[_0x084a('0x4a')](handleError(_0x1054ea,null));};exports[_0x084a('0x74')]=function(_0xb287e7,_0x3824db,_0x26cd70){return db[_0x084a('0x32')][_0x084a('0x4e')]({'where':{'id':_0xb287e7['params']['id']}})['then'](handleEntityNotFound(_0x3824db,null))['then'](function(_0x2216d4){if(_0x2216d4){return _0x2216d4[_0x084a('0x74')](_0xb287e7['body'][_0x084a('0x75')],_[_0x084a('0x76')](_0xb287e7[_0x084a('0x53')],[_0x084a('0x75'),'id'])||{})['spread'](function(_0x50cb3a){for(var _0x30ea2a=0x0;_0x30ea2a<_0xb287e7[_0x084a('0x53')][_0x084a('0x75')][_0x084a('0x3c')];_0x30ea2a+=0x1){socket[_0x084a('0x77')](_0x084a('0x78'),{'UserId':Number(_0xb287e7[_0x084a('0x53')]['ids'][_0x30ea2a]),'VoicePrefixId':Number(_0xb287e7[_0x084a('0x4c')]['id'])});}return _0x50cb3a;});}})[_0x084a('0x29')](respondWithResult(_0x3824db,null))[_0x084a('0x4a')](handleError(_0x3824db,null));};exports[_0x084a('0x79')]=function(_0x3dcafb,_0x31b89a,_0x14617e){return db['VoicePrefix'][_0x084a('0x4e')]({'where':{'id':_0x3dcafb[_0x084a('0x4c')]['id']}})[_0x084a('0x29')](handleEntityNotFound(_0x31b89a,null))[_0x084a('0x29')](function(_0x417048){if(_0x417048){return _0x417048[_0x084a('0x79')](_0x3dcafb[_0x084a('0x38')][_0x084a('0x75')])[_0x084a('0x29')](function(){if(_[_0x084a('0x7a')](_0x3dcafb[_0x084a('0x38')]['ids'])){for(var _0x2932b6=0x0;_0x2932b6<_0x3dcafb[_0x084a('0x38')]['ids'][_0x084a('0x3c')];_0x2932b6+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x3dcafb[_0x084a('0x38')][_0x084a('0x75')][_0x2932b6]),'VoicePrefixId':Number(_0x3dcafb['params']['id'])});}}else{socket[_0x084a('0x77')](_0x084a('0x7b'),{'UserId':Number(_0x3dcafb[_0x084a('0x38')][_0x084a('0x75')]),'VoicePrefixId':Number(_0x3dcafb[_0x084a('0x4c')]['id'])});}});}})[_0x084a('0x29')](respondWithStatusCode(_0x31b89a,null))[_0x084a('0x4a')](handleError(_0x31b89a,null));};exports[_0x084a('0x7c')]=function(_0x1916b1,_0x8074aa,_0xe03abd){var _0x7c85e3={};var _0x19ea24={};var _0x18cf1e;var _0x3b8dda;return db['VoicePrefix'][_0x084a('0x7d')]({'where':{'id':_0x1916b1[_0x084a('0x4c')]['id']}})[_0x084a('0x29')](handleEntityNotFound(_0x8074aa,null))[_0x084a('0x29')](function(_0x1a99b2){if(_0x1a99b2){_0x18cf1e=_0x1a99b2;_0x19ea24[_0x084a('0x36')]=_[_0x084a('0x37')](db[_0x084a('0x7e')]['rawAttributes']);_0x19ea24['query']=_[_0x084a('0x37')](_0x1916b1[_0x084a('0x38')]);_0x19ea24['filters']=_['intersection'](_0x19ea24[_0x084a('0x36')],_0x19ea24['query']);_0x7c85e3[_0x084a('0x3a')]=_['intersection'](_0x19ea24[_0x084a('0x36')],qs[_0x084a('0x3b')](_0x1916b1[_0x084a('0x38')][_0x084a('0x3b')]));_0x7c85e3['attributes']=_0x7c85e3['attributes']['length']?_0x7c85e3[_0x084a('0x3a')]:_0x19ea24[_0x084a('0x36')];_0x7c85e3[_0x084a('0x3f')]=qs['sort'](_0x1916b1[_0x084a('0x38')][_0x084a('0x40')]);_0x7c85e3['where']=qs[_0x084a('0x39')](_[_0x084a('0x42')](_0x1916b1['query'],_0x19ea24[_0x084a('0x39')]));if(_0x1916b1[_0x084a('0x38')][_0x084a('0x43')]){_0x7c85e3['where']=_['merge'](_0x7c85e3[_0x084a('0x41')],{'$or':_['map'](_0x7c85e3[_0x084a('0x3a')],function(_0x67d92b){var _0x11894e={};_0x11894e[_0x67d92b]={'$like':'%'+_0x1916b1[_0x084a('0x38')][_0x084a('0x43')]+'%'};return _0x11894e;})});}_0x7c85e3=_[_0x084a('0x44')]({},_0x7c85e3,_0x1916b1['options']);return _0x18cf1e[_0x084a('0x7c')](_0x7c85e3);}})['then'](function(_0x5ce185){if(_0x5ce185){_0x3b8dda=_0x5ce185[_0x084a('0x3c')];if(!_0x1916b1[_0x084a('0x38')][_0x084a('0x3d')](_0x084a('0x3e'))){_0x7c85e3[_0x084a('0x23')]=qs[_0x084a('0x23')](_0x1916b1['query']['limit']);_0x7c85e3[_0x084a('0x21')]=qs[_0x084a('0x21')](_0x1916b1[_0x084a('0x38')]['offset']);}return _0x18cf1e[_0x084a('0x7c')](_0x7c85e3);}})[_0x084a('0x29')](function(_0x4eb3da){if(_0x4eb3da){return _0x4eb3da?{'count':_0x3b8dda,'rows':_0x4eb3da}:null;}})['then'](respondWithResult(_0x8074aa,null))[_0x084a('0x4a')](handleError(_0x8074aa,null));};exports['getTeams']=function(_0x5c93b2,_0x135e46,_0x2d9c66){var _0x57d90c={};var _0x42d267={};var _0x2ee08a;var _0x4f40c4;return db[_0x084a('0x32')][_0x084a('0x7d')]({'where':{'id':_0x5c93b2[_0x084a('0x4c')]['id']}})[_0x084a('0x29')](handleEntityNotFound(_0x135e46,null))[_0x084a('0x29')](function(_0x29cdb8){if(_0x29cdb8){_0x2ee08a=_0x29cdb8;_0x42d267['model']=_['keys'](db[_0x084a('0x7f')][_0x084a('0x33')]);_0x42d267['query']=_[_0x084a('0x37')](_0x5c93b2['query']);_0x42d267[_0x084a('0x39')]=_[_0x084a('0x4d')](_0x42d267[_0x084a('0x36')],_0x42d267[_0x084a('0x38')]);_0x57d90c[_0x084a('0x3a')]=_[_0x084a('0x4d')](_0x42d267['model'],qs['fields'](_0x5c93b2[_0x084a('0x38')][_0x084a('0x3b')]));_0x57d90c[_0x084a('0x3a')]=_0x57d90c[_0x084a('0x3a')][_0x084a('0x3c')]?_0x57d90c['attributes']:_0x42d267[_0x084a('0x36')];_0x57d90c[_0x084a('0x3f')]=qs[_0x084a('0x40')](_0x5c93b2[_0x084a('0x38')]['sort']);_0x57d90c[_0x084a('0x41')]=qs[_0x084a('0x39')](_[_0x084a('0x42')](_0x5c93b2[_0x084a('0x38')],_0x42d267[_0x084a('0x39')]));if(_0x5c93b2[_0x084a('0x38')][_0x084a('0x43')]){_0x57d90c[_0x084a('0x41')]=_[_0x084a('0x44')](_0x57d90c[_0x084a('0x41')],{'$or':_[_0x084a('0x31')](_0x57d90c['attributes'],function(_0x5ed84e){var _0x35df86={};_0x35df86[_0x5ed84e]={'$like':'%'+_0x5c93b2['query'][_0x084a('0x43')]+'%'};return _0x35df86;})});}_0x57d90c=_[_0x084a('0x44')]({},_0x57d90c,_0x5c93b2[_0x084a('0x46')]);return _0x2ee08a[_0x084a('0x80')](_0x57d90c);}})[_0x084a('0x29')](function(_0x5412d1){if(_0x5412d1){_0x4f40c4=_0x5412d1[_0x084a('0x3c')];if(!_0x5c93b2[_0x084a('0x38')]['hasOwnProperty'](_0x084a('0x3e'))){_0x57d90c[_0x084a('0x23')]=qs[_0x084a('0x23')](_0x5c93b2['query'][_0x084a('0x23')]);_0x57d90c[_0x084a('0x21')]=qs[_0x084a('0x21')](_0x5c93b2[_0x084a('0x38')][_0x084a('0x21')]);}return _0x2ee08a[_0x084a('0x80')](_0x57d90c);}})[_0x084a('0x29')](function(_0x37d422){if(_0x37d422){return _0x37d422?{'count':_0x4f40c4,'rows':_0x37d422}:null;}})['then'](respondWithResult(_0x135e46,null))[_0x084a('0x4a')](handleError(_0x135e46,null));};exports[_0x084a('0x81')]=function(_0x355c04,_0x8b89d0,_0x5db744){var _0x45a53a=_0x355c04[_0x084a('0x53')][_0x084a('0x75')];var _0xab0f66;return db[_0x084a('0x7f')][_0x084a('0x48')]({'where':{'id':_0x45a53a},'attributes':['id'],'include':[{'model':db[_0x084a('0x7e')],'as':'Agents','attributes':['id',_0x084a('0x2e'),_0x084a('0x82'),_0x084a('0x83'),_0x084a('0x84')],'raw':!![]}]})[_0x084a('0x29')](function(_0x4087bf){if(_0x4087bf){_0xab0f66=_0x4087bf;var _0x88598d=_[_0x084a('0x85')](_0x4087bf,function(_0x1106ff){var _0x3339d4=_0x1106ff[_0x084a('0x56')]({'plain':!![]});return _0x3339d4[_0x084a('0x86')];});return db[_0x084a('0x32')][_0x084a('0x4e')]({'where':{'id':_0x355c04[_0x084a('0x4c')]['id']}})[_0x084a('0x29')](function(_0x378b74){return db['sequelize'][_0x084a('0x52')](function(_0x383bb8){return _0x378b74[_0x084a('0x81')](_0x45a53a,{'transaction':_0x383bb8})[_0x084a('0x29')](function(){return BPromise['each'](_0xab0f66,function(_0x133f4c){return db[_0x084a('0x87')][_0x084a('0x88')]({'TeamId':_0x133f4c['id'],'VoicePrefixId':_0x355c04[_0x084a('0x4c')]['id']},{'transaction':_0x383bb8});});})[_0x084a('0x29')](function(){return BPromise[_0x084a('0x89')](_0x88598d,function(_0x5b5c6c){return db['UserVoicePrefix'][_0x084a('0x8a')]({'where':{'UserId':_0x5b5c6c['id'],'VoicePrefixId':_0x355c04[_0x084a('0x4c')]['id']},'transaction':_0x383bb8});});})[_0x084a('0x29')](function(){_0x88598d[_0x084a('0x8b')](function(_0x3dd10e){socket[_0x084a('0x77')](_0x084a('0x78'),{'UserId':_0x3dd10e['id'],'VoicePrefixId':_0x378b74['id']});});});});});}})[_0x084a('0x29')](respondWithStatusCode(_0x8b89d0,null))['catch'](handleError(_0x8b89d0,null));};exports[_0x084a('0x8c')]=function(_0x294cca,_0x3be1f3,_0x1c6dec){return db['Team']['findAll']({'where':{'id':_0x294cca[_0x084a('0x38')][_0x084a('0x75')]},'attributes':['id'],'include':[{'model':db[_0x084a('0x7e')],'as':_0x084a('0x86'),'attributes':['id'],'raw':!![]}]})[_0x084a('0x29')](handleEntityNotFound(_0x3be1f3,null))['then'](function(_0x57ed50){var _0x5288ea=_[_0x084a('0x31')](_0x57ed50,'id');var _0x19aff1=[];var _0x5dab17=[];var _0x3983b1=squel[_0x084a('0x8d')]();_0x3983b1['field'](_0x084a('0x8e'))[_0x084a('0x8f')](_0x084a('0x90'),'tq')['join'](_0x084a('0x91'),'ut',_0x084a('0x92'))[_0x084a('0x41')](_0x084a('0x93'),_0x294cca[_0x084a('0x4c')]['id']);for(var _0x1d6333=0x0;_0x1d6333<_0x57ed50['length'];_0x1d6333+=0x1){let _0x277932=_0x57ed50[_0x1d6333];for(var _0x5f16a1=0x0;_0x5f16a1<_0x277932[_0x084a('0x86')]['length'];_0x5f16a1+=0x1){let _0x4156fa=_0x277932[_0x084a('0x86')][_0x5f16a1];var _0x43f940=_0x3983b1[_0x084a('0x94')]();_0x43f940[_0x084a('0x41')](_0x084a('0x95'),_0x4156fa['id']);_0x5dab17[_0x084a('0x6a')](db[_0x084a('0x51')][_0x084a('0x38')](_0x43f940[_0x084a('0x96')](),{'type':db[_0x084a('0x51')][_0x084a('0x97')]['SELECT']})[_0x084a('0x29')](function(_0x44f94e){if(_0x44f94e[_0x084a('0x3c')]===0x1){return _0x4156fa['id'];}else{var _0x4725a0=_[_0x084a('0x98')](_[_0x084a('0x31')](_0x44f94e,_0x084a('0x99')),function(_0x13b3f0){return _['includes'](_0x5288ea,_0x13b3f0);});if(_0x4725a0){return _0x4156fa['id'];}}}));}}return BPromise['all'](_0x5dab17)['then'](function(_0x1bcb9d){_0x19aff1=_(_0x19aff1)[_0x084a('0x9a')](_0x1bcb9d)[_0x084a('0x9b')]()[_0x084a('0x9c')]();return db[_0x084a('0x32')][_0x084a('0x4e')]({'where':{'id':_0x294cca[_0x084a('0x4c')]['id']}})[_0x084a('0x29')](function(_0x1997ee){return db[_0x084a('0x51')][_0x084a('0x52')](function(_0x1f5843){return _0x1997ee[_0x084a('0x8c')](_0x294cca[_0x084a('0x38')][_0x084a('0x75')],{'transaction':_0x1f5843})[_0x084a('0x29')](function(){if(!_[_0x084a('0x9d')](_0x19aff1)){return _0x1997ee[_0x084a('0x79')](_0x19aff1,{'transaction':_0x1f5843});}})[_0x084a('0x29')](function(){_0x19aff1[_0x084a('0x8b')](function(_0x2ee2a7){socket['emit'](_0x084a('0x7b'),{'UserId':_0x2ee2a7,'VoicePrefixId':_0x1997ee['id']});});});});});});})[_0x084a('0x29')](respondWithStatusCode(_0x3be1f3,null))[_0x084a('0x4a')](handleError(_0x3be1f3,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index cd00e34..7992f9a 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 _0x2128=['hasOwnProperty','setMaxListeners','update','emit'];(function(_0x4e4ea5,_0x10b94d){var _0x47fdfd=function(_0x4246c6){while(--_0x4246c6){_0x4e4ea5['push'](_0x4e4ea5['shift']());}};_0x47fdfd(++_0x10b94d);}(_0x2128,0x189));var _0x8212=function(_0x221052,_0xd3d8b6){_0x221052=_0x221052-0x0;var _0x6c990f=_0x2128[_0x221052];return _0x6c990f;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8212('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8212('0x1'),'afterDestroy':'remove'};function emitEvent(_0x342a23){return function(_0x2bd810,_0x30b2b0,_0x274a7d){VoicePrefixEvents['emit'](_0x342a23+':'+_0x2bd810['id'],_0x2bd810);VoicePrefixEvents[_0x8212('0x2')](_0x342a23,_0x2bd810);_0x274a7d(null);};}for(var e in events){if(events[_0x8212('0x3')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x40b7=['VoicePrefix','setMaxListeners','update','remove','emit','hook','exports'];(function(_0xb5af47,_0x1c6ce6){var _0x1542ad=function(_0x5f15bc){while(--_0x5f15bc){_0xb5af47['push'](_0xb5af47['shift']());}};_0x1542ad(++_0x1c6ce6);}(_0x40b7,0x93));var _0x740b=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x40b7[_0x1b7368];return _0x25d54c;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x740b('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x740b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x740b('0x2'),'afterDestroy':_0x740b('0x3')};function emitEvent(_0x120a92){return function(_0x500d0b,_0x4319d7,_0x280215){VoicePrefixEvents[_0x740b('0x4')](_0x120a92+':'+_0x500d0b['id'],_0x500d0b);VoicePrefixEvents[_0x740b('0x4')](_0x120a92,_0x500d0b);_0x280215(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x740b('0x5')](e,emitEvent(event));}}module[_0x740b('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index e570fe2..d57d4f6 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 _0x2071=['api','moment','bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','voice_prefixes','lodash','util'];(function(_0x2064c8,_0x168039){var _0x23af73=function(_0x2a2d10){while(--_0x2a2d10){_0x2064c8['push'](_0x2064c8['shift']());}};_0x23af73(++_0x168039);}(_0x2071,0x1c6));var _0x1207=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x2071[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x1207('0x0'));var util=require(_0x1207('0x1'));var logger=require('../../config/logger')(_0x1207('0x2'));var moment=require(_0x1207('0x3'));var BPromise=require(_0x1207('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1207('0x5'));var rimraf=require(_0x1207('0x6'));var config=require(_0x1207('0x7'));var attributes=require(_0x1207('0x8'));module[_0x1207('0x9')]=function(_0x646958,_0x1c78f0){return _0x646958[_0x1207('0xa')]('VoicePrefix',attributes,{'tableName':_0x1207('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3012=['rimraf','../../config/environment','exports','define','VoicePrefix','voice_prefixes','lodash','api','moment','bluebird','path'];(function(_0x3172c0,_0x4c6afa){var _0xd2bf58=function(_0x1db952){while(--_0x1db952){_0x3172c0['push'](_0x3172c0['shift']());}};_0xd2bf58(++_0x4c6afa);}(_0x3012,0x103));var _0x2301=function(_0x19b36d,_0x67a8af){_0x19b36d=_0x19b36d-0x0;var _0x33bbe6=_0x3012[_0x19b36d];return _0x33bbe6;};'use strict';var _=require(_0x2301('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2301('0x1'));var moment=require(_0x2301('0x2'));var BPromise=require(_0x2301('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2301('0x4'));var rimraf=require(_0x2301('0x5'));var config=require(_0x2301('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x2301('0x7')]=function(_0x208e8c,_0x18edb4){return _0x208e8c[_0x2301('0x8')](_0x2301('0x9'),attributes,{'tableName':_0x2301('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 f4c7a6c..80b859d 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 _0x28b1=['../../mysqldb','../../config/utils','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x28b1,0x1d6));var _0x128b=function(_0x3a7ffc,_0x12ab2a){_0x3a7ffc=_0x3a7ffc-0x0;var _0x34593a=_0x28b1[_0x3a7ffc];return _0x34593a;};'use strict';var _=require(_0x128b('0x0'));var util=require(_0x128b('0x1'));var moment=require(_0x128b('0x2'));var BPromise=require('bluebird');var rs=require(_0x128b('0x3'));var fs=require('fs');var Redis=require(_0x128b('0x4'));var db=require(_0x128b('0x5'))['db'];var utils=require(_0x128b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x128b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x128b('0x8')]({'port':0x232a});config['redis']=_[_0x128b('0x9')](config[_0x128b('0xa')],{'host':_0x128b('0xb'),'port':0x18eb});var socket=require(_0x128b('0xc'))(new Redis(config[_0x128b('0xa')]));require(_0x128b('0xd'))['register'](socket);function respondWithRpcPromise(_0x5252ca,_0xcc2756,_0x568534){return new BPromise(function(_0x5c73a3,_0x2d807b){return client[_0x128b('0xe')](_0x5252ca,_0x568534)[_0x128b('0xf')](function(_0x2f8056){logger[_0x128b('0x10')]('VoicePrefix,\x20%s,\x20%s',_0xcc2756,_0x128b('0x11'));logger['debug'](_0x128b('0x12'),_0xcc2756,_0x128b('0x11'),JSON[_0x128b('0x13')](_0x2f8056));if(_0x2f8056[_0x128b('0x14')]){if(_0x2f8056[_0x128b('0x14')][_0x128b('0x15')]===0x1f4){logger[_0x128b('0x14')](_0x128b('0x16'),_0xcc2756,_0x2f8056[_0x128b('0x14')][_0x128b('0x17')]);return _0x2d807b(_0x2f8056[_0x128b('0x14')][_0x128b('0x17')]);}logger[_0x128b('0x14')]('VoicePrefix,\x20%s,\x20%s',_0xcc2756,_0x2f8056['error']['message']);return _0x5c73a3(_0x2f8056['error']['message']);}else{logger[_0x128b('0x10')](_0x128b('0x16'),_0xcc2756,_0x128b('0x11'));_0x5c73a3(_0x2f8056[_0x128b('0x18')][_0x128b('0x17')]);}})['catch'](function(_0x7b16bf){logger[_0x128b('0x14')](_0x128b('0x16'),_0xcc2756,_0x7b16bf);_0x2d807b(_0x7b16bf);});});} \ No newline at end of file +var _0x39d2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x39d2,0xf5));var _0x239d=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0x39d2[_0xccf869];return _0x21a9db;};'use strict';var _=require(_0x239d('0x0'));var util=require('util');var moment=require(_0x239d('0x1'));var BPromise=require(_0x239d('0x2'));var rs=require(_0x239d('0x3'));var fs=require('fs');var Redis=require(_0x239d('0x4'));var db=require(_0x239d('0x5'))['db'];var utils=require(_0x239d('0x6'));var logger=require(_0x239d('0x7'))(_0x239d('0x8'));var config=require(_0x239d('0x9'));var jayson=require(_0x239d('0xa'));var client=jayson[_0x239d('0xb')][_0x239d('0xc')]({'port':0x232a});config[_0x239d('0xd')]=_['defaults'](config[_0x239d('0xd')],{'host':_0x239d('0xe'),'port':0x18eb});var socket=require(_0x239d('0xf'))(new Redis(config[_0x239d('0xd')]));require(_0x239d('0x10'))[_0x239d('0x11')](socket);function respondWithRpcPromise(_0x23a47c,_0x2cf18b,_0x542157){return new BPromise(function(_0x6273ef,_0x4d5406){return client[_0x239d('0x12')](_0x23a47c,_0x542157)[_0x239d('0x13')](function(_0x2af4eb){logger[_0x239d('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x2cf18b,'request\x20sent');logger[_0x239d('0x15')](_0x239d('0x16'),_0x2cf18b,_0x239d('0x17'),JSON[_0x239d('0x18')](_0x2af4eb));if(_0x2af4eb[_0x239d('0x19')]){if(_0x2af4eb[_0x239d('0x19')][_0x239d('0x1a')]===0x1f4){logger[_0x239d('0x19')](_0x239d('0x1b'),_0x2cf18b,_0x2af4eb['error'][_0x239d('0x1c')]);return _0x4d5406(_0x2af4eb[_0x239d('0x19')][_0x239d('0x1c')]);}logger[_0x239d('0x19')](_0x239d('0x1b'),_0x2cf18b,_0x2af4eb['error']['message']);return _0x6273ef(_0x2af4eb[_0x239d('0x19')]['message']);}else{logger[_0x239d('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x2cf18b,_0x239d('0x17'));_0x6273ef(_0x2af4eb[_0x239d('0x1d')][_0x239d('0x1c')]);}})[_0x239d('0x1e')](function(_0x3b1f15){logger[_0x239d('0x19')](_0x239d('0x1b'),_0x2cf18b,_0x3b1f15);_0x4d5406(_0x3b1f15);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index a06bd78..b457fbc 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 _0xd139=['save','emit','removeListener','length','./voicePrefix.events'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd139,0x14e));var _0x9d13=function(_0x521865,_0x38e4b0){_0x521865=_0x521865-0x0;var _0x263ee5=_0xd139[_0x521865];return _0x263ee5;};'use strict';var VoicePrefixEvents=require(_0x9d13('0x0'));var events=[_0x9d13('0x1'),'remove','update'];function createListener(_0x21fb63,_0x477215){return function(_0x3d392a){_0x477215[_0x9d13('0x2')](_0x21fb63,_0x3d392a);};}function removeListener(_0x1d39f0,_0xdeacf6){return function(){VoicePrefixEvents[_0x9d13('0x3')](_0x1d39f0,_0xdeacf6);};}exports['register']=function(_0x4c8e60){for(var _0x2918eb=0x0,_0x50294b=events[_0x9d13('0x4')];_0x2918eb<_0x50294b;_0x2918eb++){var _0x4b3db0=events[_0x2918eb];var _0x434ef6=createListener('voicePrefix:'+_0x4b3db0,_0x4c8e60);VoicePrefixEvents['on'](_0x4b3db0,_0x434ef6);}}; \ No newline at end of file +var _0x7dc2=['remove','update','emit','removeListener','register','length','voicePrefix:'];(function(_0x4097b7,_0xa1e60c){var _0x17bb87=function(_0x22dc48){while(--_0x22dc48){_0x4097b7['push'](_0x4097b7['shift']());}};_0x17bb87(++_0xa1e60c);}(_0x7dc2,0x19d));var _0x27dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dc2[_0x321bb2];return _0x9c12ed;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x27dc('0x0'),_0x27dc('0x1')];function createListener(_0x49a9e7,_0x426f56){return function(_0x57d4b4){_0x426f56[_0x27dc('0x2')](_0x49a9e7,_0x57d4b4);};}function removeListener(_0x29ba23,_0x52337b){return function(){VoicePrefixEvents[_0x27dc('0x3')](_0x29ba23,_0x52337b);};}exports[_0x27dc('0x4')]=function(_0x5a442a){for(var _0x29eaac=0x0,_0x4d2e10=events[_0x27dc('0x5')];_0x29eaac<_0x4d2e10;_0x29eaac++){var _0x3b3eee=events[_0x29eaac];var _0x5181ab=createListener(_0x27dc('0x6')+_0x3b3eee,_0x5a442a);VoicePrefixEvents['on'](_0x3b3eee,_0x5181ab);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index a6ea049..426f42a 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x401676,_0x3f1436){var _0x4f13fe=function(_0xd2f197){while(--_0xd2f197){_0x401676['push'](_0x401676['shift']());}};_0x4f13fe(++_0x3f1436);}(_0xb10b,0x12a));var _0xbb10=function(_0x1fb4e1,_0x3d4ce6){_0x1fb4e1=_0x1fb4e1-0x0;var _0x22d1b0=_0xb10b[_0x1fb4e1];return _0x22d1b0;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x868c7b,_0x2e2d15){var _0x29ea86=function(_0x4b1dab){while(--_0x4b1dab){_0x868c7b['push'](_0x868c7b['shift']());}};_0x29ea86(++_0x2e2d15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index c4151ab..51a8ad9 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 _0x9803=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','rrmemory','wrandom','rrordered','setDataValue','strategy','dialMethod','getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','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','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x3ecc89,_0x342ed6){var _0x446083=function(_0x3dbf93){while(--_0x3dbf93){_0x3ecc89['push'](_0x3ecc89['shift']());}};_0x446083(++_0x342ed6);}(_0x9803,0x13d));var _0x3980=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9803[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x3980('0x0')]={'name':{'type':Sequelize[_0x3980('0x1')],'allowNull':![],'unique':_0x3980('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x4'),_0x3980('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x3980('0x6')},'announce':{'type':Sequelize[_0x3980('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x3980('0x3')]('rr',_0x3980('0x7'),_0x3980('0x8'),_0x3980('0x9'),'random',_0x3980('0xa'),'linear',_0x3980('0xb'),_0x3980('0xc')),'allowNull':![],'defaultValue':_0x3980('0x7'),'set':function(_0x33f6c8){this[_0x3980('0xd')](_0x3980('0xe'),_0x33f6c8?_0x33f6c8:_0x3980('0xa'));},'get':function(){var _0x1be33d=this['getDataValue']('type');var _0x5acac9=this['getDataValue'](_0x3980('0xf'));var _0x3b8470=this[_0x3980('0x10')](_0x3980('0xe'));if(_0x1be33d==='inbound'){return _0x3b8470;}if(_0x5acac9===_0x3980('0x11')&&_0x3b8470===_0x3980('0xa')||_0x5acac9==='booked'&&_0x3b8470===_0x3980('0x12')){return _0x3b8470;}if(_0x5acac9===_0x3980('0x13')||_0x5acac9===_0x3980('0x14')||_0x5acac9===_0x3980('0x15')){return _0x3b8470;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3980('0x1')]},'weight':{'type':Sequelize[_0x3980('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x3980('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x3980('0x17'),'no'),'defaultValue':_0x3980('0x17')},'autopause':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x17'),'no',_0x3980('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x3980('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x3980('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3980('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x3980('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x3980('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x3980('0x17'),'no'),'defaultValue':_0x3980('0x17')},'announce_holdtime':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x17'),'no',_0x3980('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x3980('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x3980('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x3980('0x1')]},'queue_youarenext':{'type':Sequelize[_0x3980('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3980('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x3980('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3980('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x3980('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3980('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3980('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3980('0x1')]},'queue_quantity1':{'type':Sequelize[_0x3980('0x1')]},'queue_quantity2':{'type':Sequelize[_0x3980('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x3980('0x1')]},'queue_less_than':{'type':Sequelize[_0x3980('0x1')]},'periodic_announce':{'type':Sequelize[_0x3980('0x1a')],'set':function(_0x3a3e57){this[_0x3980('0xd')](_0x3980('0x1b'),_0x3a3e57?_0x3a3e57[_0x3980('0x1c')](','):[]);},'get':function(){return this[_0x3980('0x10')](_0x3980('0x1b'))?this[_0x3980('0x10')](_0x3980('0x1b'))[_0x3980('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x3980('0x1')],'defaultValue':_0x3980('0x17'),'set':function(_0x4e2e10){this['setDataValue'](_0x3980('0x1e'),_0x4e2e10?_0x4e2e10[_0x3980('0x1c')](','):undefined);},'get':function(){return this[_0x3980('0x10')](_0x3980('0x1e'))?this[_0x3980('0x10')](_0x3980('0x1e'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x3980('0x1')],'defaultValue':'no','set':function(_0x3825af){this[_0x3980('0xd')]('leavewhenempty',_0x3825af?_0x3825af[_0x3980('0x1c')](','):undefined);},'get':function(){return this[_0x3980('0x10')]('leavewhenempty')?this[_0x3980('0x10')]('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x3980('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3980('0x1')]},'description':{'type':Sequelize[_0x3980('0x1')]},'acw':{'type':Sequelize[_0x3980('0x1f')],'defaultValue':0x0,'set':function(_0x19cf5c){this[_0x3980('0xd')](_0x3980('0x20'),_0x19cf5c);if(_0x19cf5c){if(this[_0x3980('0x10')](_0x3980('0x21'))<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3980('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x3980('0x1f')],'defaultValue':0x0,'comment':_0x3980('0x22')},'dialMethod':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x23'),_0x3980('0x13'),_0x3980('0x15'),'predictive',_0x3980('0x11')),'defaultValue':'progressive','comment':_0x3980('0x24')},'dialLimitChannel':{'type':Sequelize[_0x3980('0x16')](0x4)[_0x3980('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3980('0x26')},'dialLimitQueue':{'type':Sequelize[_0x3980('0x16')](0x4)[_0x3980('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x3980('0x27')](0x2)[_0x3980('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x28'),'dropRate'),'defaultValue':_0x3980('0x29'),'comment':_0x3980('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x3980('0x16')](0x3)[_0x3980('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x3980('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3980('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3980('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x3980('0x16')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3980('0x2c')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x3980('0x16')](0x3)[_0x3980('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x3980('0x1')],'comment':_0x3980('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3980('0x16')](0x3)[_0x3980('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3980('0x16')](0x5)[_0x3980('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3980('0x2e')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3980('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3980('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3980('0x16')](0x5)[_0x3980('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3980('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3980('0x16')](0x5)[_0x3980('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x3980('0x16')](0x3)[_0x3980('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3980('0x30')},'dialTimezone':{'type':Sequelize[_0x3980('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x3980('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x31'),_0x3980('0x32'),'onlyIfOpen'),'defaultValue':_0x3980('0x31')},'dialAMDActive':{'type':Sequelize[_0x3980('0x1f')],'defaultValue':0x0,'comment':_0x3980('0x33')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3980('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3980('0x34')},'dialAMDGreeting':{'type':Sequelize[_0x3980('0x16')](0x9)[_0x3980('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3980('0x35')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3980('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3980('0x36')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3980('0x16')](0x9)[_0x3980('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3980('0x37')},'dialAMDMinWordLength':{'type':Sequelize[_0x3980('0x16')](0x9)[_0x3980('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3980('0x38')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3980('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3980('0x39')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3980('0x16')](0x9)[_0x3980('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3980('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3980('0x16')](0x5)[_0x3980('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3980('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3980('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3980('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0x3980('0x16')](0x5)[_0x3980('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x3980('0x3d')},'dialRecallInQueue':{'type':Sequelize[_0x3980('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x3980('0x3')](_0x3980('0x3e'),_0x3980('0x3f')),'defaultValue':_0x3980('0x3e')},'dialQueueProject2':{'type':Sequelize[_0x3980('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x3980('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x3980('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3980('0x16')](0x3)[_0x3980('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3980('0x40')},'dialCutDigit':{'type':Sequelize[_0x3980('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3980('0x16')](0x3)[_0x3980('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3980('0x41')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3980('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3980('0x42')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3980('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x3980('0x16')](0x5)[_0x3980('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3980('0x43')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3980('0x44')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3980('0x16')](0x5)[_0x3980('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3980('0x45')},'dialMachineMaxRetry':{'type':Sequelize[_0x3980('0x16')](0x3)[_0x3980('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3980('0x46')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3980('0x16')](0x5)[_0x3980('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3980('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3980('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3980('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3980('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3980('0x49')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3980('0x16')],'allowNull':!![],'comment':_0x3980('0x4a')},'mandatoryDisposition':{'type':Sequelize[_0x3980('0x1f')],'defaultValue':![],'comment':_0x3980('0x4b'),'set':function(_0x2bad80){if(!_0x2bad80)this[_0x3980('0xd')](_0x3980('0x4c'),null);this[_0x3980('0xd')](_0x3980('0x4d'),_0x2bad80);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x3980('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x3980('0x16')](0x3)[_0x3980('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x3980('0x1f')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x3980('0x1f')],'defaultValue':![]}}; \ No newline at end of file +var _0xfcf1=['linear','wrandom','rrordered','ringall','setDataValue','getDataValue','type','booked','roundrobin','predictive','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','ENUM','inbound','default','leastrecent','fewestcalls','random','rrmemory'];(function(_0x385cfb,_0x588fb0){var _0x6dc431=function(_0x4b52dc){while(--_0x4b52dc){_0x385cfb['push'](_0x385cfb['shift']());}};_0x6dc431(++_0x588fb0);}(_0xfcf1,0x195));var _0x1fcf=function(_0x1ed9de,_0x17bf22){_0x1ed9de=_0x1ed9de-0x0;var _0x547858=_0xfcf1[_0x1ed9de];return _0x547858;};'use strict';var Sequelize=require(_0x1fcf('0x0'));module['exports']={'name':{'type':Sequelize[_0x1fcf('0x1')],'allowNull':![],'unique':_0x1fcf('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1fcf('0x3')](_0x1fcf('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x1fcf('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x1fcf('0x5')},'announce':{'type':Sequelize[_0x1fcf('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x1fcf('0x3')]('rr','ringall',_0x1fcf('0x6'),_0x1fcf('0x7'),_0x1fcf('0x8'),_0x1fcf('0x9'),_0x1fcf('0xa'),_0x1fcf('0xb'),_0x1fcf('0xc')),'allowNull':![],'defaultValue':_0x1fcf('0xd'),'set':function(_0x544b3a){this[_0x1fcf('0xe')]('strategy',_0x544b3a?_0x544b3a:'rrmemory');},'get':function(){var _0x47dd17=this[_0x1fcf('0xf')](_0x1fcf('0x10'));var _0x15ecc6=this[_0x1fcf('0xf')]('dialMethod');var _0x516f73=this[_0x1fcf('0xf')]('strategy');if(_0x47dd17===_0x1fcf('0x4')){return _0x516f73;}if(_0x15ecc6===_0x1fcf('0x11')&&_0x516f73===_0x1fcf('0x9')||_0x15ecc6===_0x1fcf('0x11')&&_0x516f73===_0x1fcf('0x12')){return _0x516f73;}if(_0x15ecc6==='progressive'||_0x15ecc6===_0x1fcf('0x13')||_0x15ecc6==='power'){return _0x516f73;}return null;}},'servicelevel':{'type':Sequelize[_0x1fcf('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1fcf('0x14')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x1fcf('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1fcf('0x1')]},'weight':{'type':Sequelize[_0x1fcf('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1fcf('0x3')]('yes','no'),'defaultValue':_0x1fcf('0x15')},'autopause':{'type':Sequelize[_0x1fcf('0x3')](_0x1fcf('0x15'),'no',_0x1fcf('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x1fcf('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x1fcf('0x3')](_0x1fcf('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x1fcf('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x1fcf('0x3')](_0x1fcf('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x1fcf('0x3')](_0x1fcf('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x1fcf('0x3')](_0x1fcf('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x1fcf('0x3')](_0x1fcf('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x1fcf('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x1fcf('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x1fcf('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x1fcf('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x1fcf('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x1fcf('0x3')](_0x1fcf('0x15'),'no'),'defaultValue':_0x1fcf('0x15')},'announce_holdtime':{'type':Sequelize[_0x1fcf('0x3')]('yes','no',_0x1fcf('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x1fcf('0x3')](_0x1fcf('0x15'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x1fcf('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x1fcf('0x1')]},'queue_youarenext':{'type':Sequelize[_0x1fcf('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1fcf('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x1fcf('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x1fcf('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x1fcf('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x1fcf('0x1')]},'queue_quantity1':{'type':Sequelize[_0x1fcf('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x1fcf('0x1')]},'queue_less_than':{'type':Sequelize[_0x1fcf('0x1')]},'periodic_announce':{'type':Sequelize[_0x1fcf('0x18')],'set':function(_0x5246ee){this['setDataValue'](_0x1fcf('0x19'),_0x5246ee?_0x5246ee[_0x1fcf('0x1a')](','):[]);},'get':function(){return this[_0x1fcf('0xf')](_0x1fcf('0x19'))?this['getDataValue'](_0x1fcf('0x19'))[_0x1fcf('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x1fcf('0x15'),'set':function(_0x22eb35){this[_0x1fcf('0xe')](_0x1fcf('0x1c'),_0x22eb35?_0x22eb35['join'](','):undefined);},'get':function(){return this[_0x1fcf('0xf')]('joinempty')?this['getDataValue'](_0x1fcf('0x1c'))[_0x1fcf('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x1fcf('0x1')],'defaultValue':'no','set':function(_0x38f03b){this[_0x1fcf('0xe')]('leavewhenempty',_0x38f03b?_0x38f03b['join'](','):undefined);},'get':function(){return this[_0x1fcf('0xf')](_0x1fcf('0x1d'))?this[_0x1fcf('0xf')](_0x1fcf('0x1d'))[_0x1fcf('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x1fcf('0x3')](_0x1fcf('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x1fcf('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x1fcf('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x1fcf('0x3')](_0x1fcf('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x1fcf('0x1')]},'description':{'type':Sequelize[_0x1fcf('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x15bacb){this['setDataValue'](_0x1fcf('0x1e'),_0x15bacb);if(_0x15bacb){if(this[_0x1fcf('0xf')]('wrapuptime')<0x2){this[_0x1fcf('0xe')](_0x1fcf('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1fcf('0x20')},'dialMethod':{'type':Sequelize[_0x1fcf('0x3')](_0x1fcf('0x21'),'progressive',_0x1fcf('0x22'),_0x1fcf('0x13'),_0x1fcf('0x11')),'defaultValue':_0x1fcf('0x23'),'comment':_0x1fcf('0x24')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x1fcf('0x14')](0x4)[_0x1fcf('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1fcf('0x26')},'dialPowerLevel':{'type':Sequelize[_0x1fcf('0x27')](0x2)[_0x1fcf('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x1fcf('0x28'),_0x1fcf('0x29')),'defaultValue':_0x1fcf('0x29'),'comment':_0x1fcf('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x1fcf('0x27')](0x2)[_0x1fcf('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x1fcf('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1fcf('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1fcf('0x14')](0x3)[_0x1fcf('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1fcf('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x1fcf('0x1')],'defaultValue':_0x1fcf('0x2d'),'comment':_0x1fcf('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x1fcf('0x14')](0x3)[_0x1fcf('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1fcf('0x2f')},'dialQueueProject':{'type':Sequelize[_0x1fcf('0x1')],'comment':_0x1fcf('0x30')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1fcf('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1fcf('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1fcf('0x32')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1fcf('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1fcf('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1fcf('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1fcf('0x14')](0x3)[_0x1fcf('0x25')],'defaultValue':0x3,'comment':_0x1fcf('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1fcf('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1fcf('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1fcf('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1fcf('0x36')},'dialTimezone':{'type':Sequelize[_0x1fcf('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x1fcf('0x37')},'dialPrefix':{'type':Sequelize[_0x1fcf('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x1fcf('0x3')]('always','never',_0x1fcf('0x38')),'defaultValue':_0x1fcf('0x39')},'dialAMDActive':{'type':Sequelize[_0x1fcf('0x3a')],'defaultValue':0x0,'comment':_0x1fcf('0x3b')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1fcf('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1fcf('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1fcf('0x14')](0x9)[_0x1fcf('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1fcf('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1fcf('0x14')](0x9)[_0x1fcf('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1fcf('0x3d')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1fcf('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1fcf('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1fcf('0x14')](0x9)[_0x1fcf('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1fcf('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1fcf('0x14')](0x9)[_0x1fcf('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1fcf('0x14')](0x5)[_0x1fcf('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1fcf('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1fcf('0x14')](0x9)[_0x1fcf('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x1fcf('0x14')](0x5)[_0x1fcf('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x1fcf('0x3a')],'defaultValue':0x0,'comment':_0x1fcf('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1fcf('0x3')](_0x1fcf('0x42'),_0x1fcf('0x43')),'defaultValue':_0x1fcf('0x42')},'dialQueueProject2':{'type':Sequelize[_0x1fcf('0x1')],'comment':_0x1fcf('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x1fcf('0x3a')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x1fcf('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1fcf('0x44')},'dialCutDigit':{'type':Sequelize[_0x1fcf('0x14')](0x3)[_0x1fcf('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1fcf('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1fcf('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1fcf('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1fcf('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x1fcf('0x14')](0x3)[_0x1fcf('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1fcf('0x47')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1fcf('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1fcf('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1fcf('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1fcf('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1fcf('0x14')](0x5)[_0x1fcf('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1fcf('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x1fcf('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1fcf('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1fcf('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1fcf('0x14')](0x3)[_0x1fcf('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1fcf('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1fcf('0x14')](0x5)[_0x1fcf('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1fcf('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1fcf('0x14')],'allowNull':!![],'comment':_0x1fcf('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0x1fcf('0x3a')],'defaultValue':![],'comment':_0x1fcf('0x50'),'set':function(_0x5622a1){if(!_0x5622a1)this[_0x1fcf('0xe')](_0x1fcf('0x51'),null);this[_0x1fcf('0xe')](_0x1fcf('0x52'),_0x5622a1);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x1fcf('0x14')](0x3)[_0x1fcf('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x1fcf('0x14')](0x3)[_0x1fcf('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x1fcf('0x3a')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x1fcf('0x3a')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 57a5108..01f3fa4 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 _0x2ebf=['to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','map','value','includes','type','name','error','stack','send','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','includeAll','include','VoiceQueue','params','keys','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','omit','createdAt','updatedAt','getHoppers','findOne','sort','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','order','findAll','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','addTeams','each','findOrCreate','UserVoiceQueueRt','upsert','format','SIP/%s','emit','userVoiceQueue:save','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','union','compact','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isNil','all','isArray','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','NOW()','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','select','ListId\x20=\x20?','into','removeLists','getBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0x2ebf,0x153));var _0xf2eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2ebf[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2eb('0x0'));var zipdir=require(_0xf2eb('0x1'));var jsonpatch=require(_0xf2eb('0x2'));var rp=require(_0xf2eb('0x3'));var moment=require('moment');var BPromise=require(_0xf2eb('0x4'));var Mustache=require(_0xf2eb('0x5'));var util=require('util');var path=require(_0xf2eb('0x6'));var sox=require(_0xf2eb('0x7'));var csv=require('to-csv');var ejs=require(_0xf2eb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf2eb('0x9'));var crypto=require(_0xf2eb('0xa'));var jsforce=require(_0xf2eb('0xb'));var deskjs=require(_0xf2eb('0xc'));var toCsv=require(_0xf2eb('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf2eb('0xe'));var authService=require(_0xf2eb('0xf'));var qs=require(_0xf2eb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf2eb('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xf2eb('0x12'));var licenseUtil=require(_0xf2eb('0x13'));var db=require('../../mysqldb')['db'];config[_0xf2eb('0x14')]=_['defaults'](config['redis'],{'host':_0xf2eb('0x15'),'port':0x18eb});var socket=require(_0xf2eb('0x16'))(new Redis(config[_0xf2eb('0x14')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x5a9923,_0x2a7e79){_0x2a7e79=_0x2a7e79||0xcc;return function(_0x4f76cb){if(_0x4f76cb){return _0x5a9923[_0xf2eb('0x17')](_0x2a7e79);}return _0x5a9923[_0xf2eb('0x18')](_0x2a7e79)[_0xf2eb('0x19')]();};}function respondWithResult(_0x44f718,_0x47e24e){_0x47e24e=_0x47e24e||0xc8;return function(_0x2252b5){if(_0x2252b5){return _0x44f718[_0xf2eb('0x18')](_0x47e24e)['json'](_0x2252b5);}};}function respondWithFilteredResult(_0x3c5857,_0x581857){return function(_0x29dc76){if(_0x29dc76){var _0x56fd8d=typeof _0x581857[_0xf2eb('0x1a')]==='undefined'&&typeof _0x581857['limit']===_0xf2eb('0x1b');var _0x5e073f=_0x29dc76['count'];var _0x1609ee=_0x56fd8d?0x0:_0x581857[_0xf2eb('0x1a')];var _0x500f58=_0x56fd8d?_0x29dc76[_0xf2eb('0x1c')]:_0x581857[_0xf2eb('0x1a')]+_0x581857[_0xf2eb('0x1d')];var _0x4f83ec;if(_0x500f58>=_0x5e073f){_0x500f58=_0x5e073f;_0x4f83ec=0xc8;}else{_0x4f83ec=0xce;}_0x3c5857[_0xf2eb('0x18')](_0x4f83ec);return _0x3c5857[_0xf2eb('0x1e')]('Content-Range',_0x1609ee+'-'+_0x500f58+'/'+_0x5e073f)[_0xf2eb('0x1f')](_0x29dc76);}return null;};}function patchUpdates(_0x253e1a){return function(_0x472517){try{jsonpatch[_0xf2eb('0x20')](_0x472517,_0x253e1a,!![]);}catch(_0x33e785){return BPromise[_0xf2eb('0x21')](_0x33e785);}return _0x472517[_0xf2eb('0x22')]();};}function saveUpdates(_0x33e595,_0x4919b8){return function(_0x4ead05){if(_0x4ead05){return _0x4ead05[_0xf2eb('0x23')](_0x33e595)[_0xf2eb('0x24')](function(_0x4efc95){return _0x4efc95;});}return null;};}function removeEntity(_0x771623,_0x57f120){return function(_0x54b076){if(_0x54b076){return _0x54b076[_0xf2eb('0x25')]()[_0xf2eb('0x24')](function(){var _0x4d8359=_0x54b076[_0xf2eb('0x26')]({'plain':!![]});var _0x5dc675=[{'name':_0xf2eb('0x27'),'value':_0xf2eb('0x28'),'ignore':![]},{'name':_0xf2eb('0x29'),'value':_0xf2eb('0x2a'),'ignore':![]}];var _0x281d06=_(_0x5dc675)['filter']('ignore')[_0xf2eb('0x2b')](_0xf2eb('0x2c'))[_0xf2eb('0x2c')]();if(_[_0xf2eb('0x2d')](_0x281d06,_0x4d8359['type'])){return;}var _0x11a2e5=_['find'](_0x5dc675,[_0xf2eb('0x2c'),_0x4d8359[_0xf2eb('0x2e')]])[_0xf2eb('0x2f')];return db['UserProfileResource']['destroy']({'where':{'type':_0x11a2e5,'resourceId':_0x4d8359['id']}})['then'](function(){return _0x54b076;});})[_0xf2eb('0x24')](function(){_0x771623[_0xf2eb('0x18')](0xcc)[_0xf2eb('0x19')]();});}};}function handleEntityNotFound(_0x5de148,_0x12e26c){return function(_0x14cc25){if(!_0x14cc25){_0x5de148[_0xf2eb('0x17')](0x194);}return _0x14cc25;};}function handleError(_0x5694ba,_0x32c84b){_0x32c84b=_0x32c84b||0x1f4;return function(_0x598cc1){logger[_0xf2eb('0x30')](_0x598cc1[_0xf2eb('0x31')]);if(_0x598cc1[_0xf2eb('0x2f')]){delete _0x598cc1['name'];}_0x5694ba[_0xf2eb('0x18')](_0x32c84b)[_0xf2eb('0x32')](_0x598cc1);};}exports['index']=function(_0x20fdfc,_0x5d60c4){var _0x6bf346={},_0x2d1cf4={},_0x44a3ac={'count':0x0,'rows':[]};var _0x40156c=_[_0xf2eb('0x2b')](db['VoiceQueue'][_0xf2eb('0x33')],function(_0x5690b5){return{'name':_0x5690b5[_0xf2eb('0x34')],'type':_0x5690b5[_0xf2eb('0x2e')]['key']};});_0x2d1cf4[_0xf2eb('0x35')]=_[_0xf2eb('0x2b')](_0x40156c,_0xf2eb('0x2f'));_0x2d1cf4[_0xf2eb('0x36')]=_['keys'](_0x20fdfc[_0xf2eb('0x36')]);_0x2d1cf4[_0xf2eb('0x37')]=_[_0xf2eb('0x38')](_0x2d1cf4[_0xf2eb('0x35')],_0x2d1cf4[_0xf2eb('0x36')]);_0x6bf346[_0xf2eb('0x39')]=_[_0xf2eb('0x38')](_0x2d1cf4[_0xf2eb('0x35')],qs['fields'](_0x20fdfc[_0xf2eb('0x36')][_0xf2eb('0x3a')]));_0x6bf346[_0xf2eb('0x39')]=_0x6bf346[_0xf2eb('0x39')][_0xf2eb('0x3b')]?_0x6bf346['attributes']:_0x2d1cf4[_0xf2eb('0x35')];if(!_0x20fdfc[_0xf2eb('0x36')][_0xf2eb('0x3c')](_0xf2eb('0x3d'))){_0x6bf346[_0xf2eb('0x1d')]=qs[_0xf2eb('0x1d')](_0x20fdfc[_0xf2eb('0x36')][_0xf2eb('0x1d')]);_0x6bf346['offset']=qs['offset'](_0x20fdfc[_0xf2eb('0x36')]['offset']);}_0x6bf346['order']=qs['sort'](_0x20fdfc[_0xf2eb('0x36')]['sort']);_0x6bf346['where']=qs[_0xf2eb('0x37')](_[_0xf2eb('0x3e')](_0x20fdfc[_0xf2eb('0x36')],_0x2d1cf4[_0xf2eb('0x37')]),_0x40156c);if(_0x20fdfc[_0xf2eb('0x36')][_0xf2eb('0x3f')]){_0x6bf346[_0xf2eb('0x40')]=_[_0xf2eb('0x41')](_0x6bf346['where'],{'$or':_[_0xf2eb('0x2b')](_0x40156c,function(_0x1c7171){if(_0x1c7171[_0xf2eb('0x2e')]!==_0xf2eb('0x42')){var _0x351aa5={};_0x351aa5[_0x1c7171[_0xf2eb('0x2f')]]={'$like':'%'+_0x20fdfc['query'][_0xf2eb('0x3f')]+'%'};return _0x351aa5;}})});}_0x6bf346=_[_0xf2eb('0x41')]({},_0x6bf346,_0x20fdfc['options']);var _0xd713ac={'where':_0x6bf346[_0xf2eb('0x40')]};return db['VoiceQueue'][_0xf2eb('0x1c')](_0xd713ac)[_0xf2eb('0x24')](function(_0x578b3b){_0x44a3ac[_0xf2eb('0x1c')]=_0x578b3b;if(_0x20fdfc['query'][_0xf2eb('0x43')]){_0x6bf346[_0xf2eb('0x44')]=[{'all':!![]}];}return db[_0xf2eb('0x45')]['findAll'](_0x6bf346);})[_0xf2eb('0x24')](function(_0x55c10b){_0x44a3ac['rows']=_0x55c10b;return _0x44a3ac;})[_0xf2eb('0x24')](respondWithFilteredResult(_0x5d60c4,_0x6bf346))['catch'](handleError(_0x5d60c4,null));};exports['show']=function(_0x5448b1,_0x15e271){var _0x5a4312={'raw':![],'where':{'id':_0x5448b1[_0xf2eb('0x46')]['id']}},_0x3c5627={};_0x3c5627['model']=_[_0xf2eb('0x47')](db[_0xf2eb('0x45')][_0xf2eb('0x33')]);_0x3c5627[_0xf2eb('0x36')]=_[_0xf2eb('0x47')](_0x5448b1[_0xf2eb('0x36')]);_0x3c5627['filters']=_[_0xf2eb('0x38')](_0x3c5627['model'],_0x3c5627['query']);_0x5a4312[_0xf2eb('0x39')]=_[_0xf2eb('0x38')](_0x3c5627['model'],qs[_0xf2eb('0x3a')](_0x5448b1['query']['fields']));_0x5a4312['attributes']=_0x5a4312[_0xf2eb('0x39')]['length']?_0x5a4312[_0xf2eb('0x39')]:_0x3c5627[_0xf2eb('0x35')];if(_0x5448b1[_0xf2eb('0x36')][_0xf2eb('0x43')]){_0x5a4312[_0xf2eb('0x44')]=[{'all':!![]}];}_0x5a4312=_[_0xf2eb('0x41')]({},_0x5a4312,_0x5448b1[_0xf2eb('0x48')]);return db[_0xf2eb('0x45')]['find'](_0x5a4312)[_0xf2eb('0x24')](handleEntityNotFound(_0x15e271,null))[_0xf2eb('0x24')](respondWithResult(_0x15e271,null))['catch'](handleError(_0x15e271,null));};exports[_0xf2eb('0x49')]=function(_0x4c799d,_0x447c02){return db['VoiceQueue'][_0xf2eb('0x49')](_0x4c799d[_0xf2eb('0x4a')],{})[_0xf2eb('0x24')](function(_0x1684c0){var _0x584770=_0x4c799d[_0xf2eb('0x4b')][_0xf2eb('0x26')]({'plain':!![]});if(!_0x584770)throw new Error(_0xf2eb('0x4c'));if(_0x584770['role']===_0xf2eb('0x4b')){var _0x5d832e=_0x1684c0[_0xf2eb('0x26')]({'plain':!![]});var _0x36e4df=[{'name':'VoiceQueues','value':_0xf2eb('0x28')},{'name':_0xf2eb('0x29'),'value':_0xf2eb('0x2a')}];var _0x423685=_[_0xf2eb('0x4d')](_0x36e4df,[_0xf2eb('0x2c'),_0x5d832e[_0xf2eb('0x2e')]])[_0xf2eb('0x2f')];return db[_0xf2eb('0x4e')][_0xf2eb('0x4d')]({'where':{'name':_0x423685,'userProfileId':_0x584770['userProfileId']},'raw':!![]})['then'](function(_0x5f0ef5){if(_0x5f0ef5&&_0x5f0ef5[_0xf2eb('0x4f')]===0x0){return db['UserProfileResource'][_0xf2eb('0x49')]({'name':_0x5d832e[_0xf2eb('0x2f')],'resourceId':_0x5d832e['id'],'type':_0x5f0ef5[_0xf2eb('0x2f')],'sectionId':_0x5f0ef5['id']},{})[_0xf2eb('0x24')](function(){return _0x1684c0;});}else{return _0x1684c0;}})['catch'](function(_0x92a70c){logger[_0xf2eb('0x30')](_0xf2eb('0x50'),_0x92a70c);throw _0x92a70c;});}return _0x1684c0;})[_0xf2eb('0x24')](respondWithResult(_0x447c02,0xc9))[_0xf2eb('0x51')](handleError(_0x447c02,null));};exports['clone']=function(_0x1f5556,_0x2874cf){var _0x425ec0={'where':{'id':_0x1f5556['params']['id']}},_0x5032c6={};_0x5032c6[_0xf2eb('0x35')]=_[_0xf2eb('0x47')](db[_0xf2eb('0x45')][_0xf2eb('0x33')]);_0x425ec0['attributes']=_[_0xf2eb('0x38')](_0x5032c6[_0xf2eb('0x35')],qs[_0xf2eb('0x3a')](_0x1f5556['query'][_0xf2eb('0x3a')]));_0x425ec0[_0xf2eb('0x39')]=_0x425ec0[_0xf2eb('0x39')][_0xf2eb('0x3b')]?_0x425ec0[_0xf2eb('0x39')]:_0x5032c6[_0xf2eb('0x35')];if(_0x1f5556[_0xf2eb('0x36')]['includeAll']){_0x425ec0[_0xf2eb('0x44')]=[{'all':!![]}];}_0x425ec0=_[_0xf2eb('0x41')]({},_0x425ec0,_0x1f5556[_0xf2eb('0x48')]);return db['VoiceQueue'][_0xf2eb('0x4d')](_0x425ec0)[_0xf2eb('0x24')](handleEntityNotFound(_0x2874cf,null))[_0xf2eb('0x24')](function(_0x2ead71){if(_0x2ead71){var _0x500147=_0x2ead71[_0xf2eb('0x26')]({'plain':!![]});_0x500147=qs[_0xf2eb('0x52')](_0x500147,['id',_0xf2eb('0x53'),_0xf2eb('0x54')]);_0x1f5556[_0xf2eb('0x4a')]=_[_0xf2eb('0x52')](_0x1f5556[_0xf2eb('0x4a')],['id',_0xf2eb('0x53'),_0xf2eb('0x54')]);return db[_0xf2eb('0x45')][_0xf2eb('0x49')](_['merge'](_0x500147,_0x1f5556['body']),{'include':_0x1f5556[_0xf2eb('0x36')][_0xf2eb('0x43')]?[{'all':!![]}]:undefined})[_0xf2eb('0x24')](function(_0x200981){var _0x326a5d=_0x1f5556['user']['get']({'plain':!![]});if(!_0x326a5d)throw new Error(_0xf2eb('0x4c'));if(_0x326a5d['role']===_0xf2eb('0x4b')){var _0x4242a2=_0x200981[_0xf2eb('0x26')]({'plain':!![]});var _0x1551e4=[{'name':_0xf2eb('0x27'),'value':_0xf2eb('0x28')},{'name':_0xf2eb('0x29'),'value':_0xf2eb('0x2a')}];var _0x3273f2=_[_0xf2eb('0x4d')](_0x1551e4,['value',_0x4242a2[_0xf2eb('0x2e')]])[_0xf2eb('0x2f')];return db[_0xf2eb('0x4e')]['find']({'where':{'name':_0x3273f2,'userProfileId':_0x326a5d['userProfileId']},'raw':!![]})[_0xf2eb('0x24')](function(_0x328202){if(_0x328202&&_0x328202[_0xf2eb('0x4f')]===0x0){return db['UserProfileResource'][_0xf2eb('0x49')]({'name':_0x4242a2[_0xf2eb('0x2f')],'resourceId':_0x4242a2['id'],'type':_0x328202[_0xf2eb('0x2f')],'sectionId':_0x328202['id']},{})[_0xf2eb('0x24')](function(){return _0x200981;});}else{return _0x200981;}})[_0xf2eb('0x51')](function(_0x3a5afe){logger['error'](_0xf2eb('0x50'),_0x3a5afe);throw _0x3a5afe;});}return _0x200981;});}})[_0xf2eb('0x24')](respondWithResult(_0x2874cf,0xc9))[_0xf2eb('0x51')](handleError(_0x2874cf,null));};exports[_0xf2eb('0x23')]=function(_0x3361fc,_0x38273a){if(_0x3361fc['body']['id']){delete _0x3361fc['body']['id'];}return db[_0xf2eb('0x45')][_0xf2eb('0x4d')]({'where':{'id':_0x3361fc[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x38273a,null))[_0xf2eb('0x24')](saveUpdates(_0x3361fc['body'],null))[_0xf2eb('0x24')](respondWithResult(_0x38273a,null))[_0xf2eb('0x51')](handleError(_0x38273a,null));};exports[_0xf2eb('0x25')]=function(_0x2b2afc,_0x15e9e4){return db['VoiceQueue'][_0xf2eb('0x4d')]({'where':{'id':_0x2b2afc[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x15e9e4,null))[_0xf2eb('0x24')](removeEntity(_0x15e9e4,null))[_0xf2eb('0x51')](handleError(_0x15e9e4,null));};exports[_0xf2eb('0x55')]=function(_0x50c029,_0x421cd1,_0x42818f){var _0x1dfb71={'raw':![],'where':{}};var _0x9c43ad={};var _0x3c501e={'count':0x0,'rows':[]};return db[_0xf2eb('0x45')][_0xf2eb('0x56')]({'where':{'id':_0x50c029[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x421cd1,null))[_0xf2eb('0x24')](function(_0x2f5e66){if(_0x2f5e66){_0x9c43ad[_0xf2eb('0x35')]=_[_0xf2eb('0x47')](db['CmHopper'][_0xf2eb('0x33')]);_0x9c43ad[_0xf2eb('0x36')]=_[_0xf2eb('0x47')](_0x50c029[_0xf2eb('0x36')]);_0x9c43ad['filters']=_[_0xf2eb('0x38')](_0x9c43ad[_0xf2eb('0x35')],_0x9c43ad['query']);_0x1dfb71[_0xf2eb('0x39')]=_[_0xf2eb('0x38')](_0x9c43ad[_0xf2eb('0x35')],qs['fields'](_0x50c029[_0xf2eb('0x36')][_0xf2eb('0x3a')]));_0x1dfb71[_0xf2eb('0x39')]=_0x1dfb71[_0xf2eb('0x39')]['length']?_0x1dfb71[_0xf2eb('0x39')]:_0x9c43ad[_0xf2eb('0x35')];if(!_0x50c029[_0xf2eb('0x36')]['hasOwnProperty']('nolimit')){_0x1dfb71[_0xf2eb('0x1d')]=qs[_0xf2eb('0x1d')](_0x50c029['query']['limit']);_0x1dfb71[_0xf2eb('0x1a')]=qs[_0xf2eb('0x1a')](_0x50c029[_0xf2eb('0x36')]['offset']);}_0x1dfb71['order']=qs[_0xf2eb('0x57')](_0x50c029[_0xf2eb('0x36')]['sort']);_0x1dfb71['where']=qs[_0xf2eb('0x37')](_[_0xf2eb('0x3e')](_0x50c029[_0xf2eb('0x36')],_0x9c43ad[_0xf2eb('0x37')]));_0x1dfb71['where'][_0xf2eb('0x58')]=_0x2f5e66['id'];if(_0x50c029[_0xf2eb('0x36')][_0xf2eb('0x3f')]){_0x1dfb71[_0xf2eb('0x40')]=_[_0xf2eb('0x41')](_0x1dfb71['where'],{'$or':_[_0xf2eb('0x2b')](_0x1dfb71['attributes'],function(_0x1e5a7c){var _0x95414a={};_0x95414a[_0x1e5a7c]={'$like':'%'+_0x50c029[_0xf2eb('0x36')][_0xf2eb('0x3f')]+'%'};return _0x95414a;})});}_0x1dfb71=_['merge']({},_0x1dfb71,_0x50c029[_0xf2eb('0x48')]);return db[_0xf2eb('0x59')][_0xf2eb('0x1c')]({'where':_0x1dfb71[_0xf2eb('0x40')]})['then'](function(_0x1f2a23){_0x3c501e[_0xf2eb('0x1c')]=_0x1f2a23;if(_0x50c029['query'][_0xf2eb('0x43')]){_0x1dfb71[_0xf2eb('0x44')]=[{'all':!![]}];}return db[_0xf2eb('0x59')]['findAll'](_0x1dfb71);})[_0xf2eb('0x24')](function(_0xdd027d){_0x3c501e['rows']=_0xdd027d;return _0x3c501e;});}})[_0xf2eb('0x24')](respondWithFilteredResult(_0x421cd1,_0x1dfb71))['catch'](handleError(_0x421cd1,null));};exports[_0xf2eb('0x5a')]=function(_0x270131,_0x368397,_0xd06ca1){var _0x1a19eb={'raw':!![],'where':{}};var _0x442731={};var _0x144b8f={'count':0x0,'rows':[]};return db[_0xf2eb('0x45')][_0xf2eb('0x56')]({'where':{'id':_0x270131[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x368397,null))[_0xf2eb('0x24')](function(_0x560142){if(_0x560142){_0x442731[_0xf2eb('0x35')]=_[_0xf2eb('0x47')](db[_0xf2eb('0x5b')][_0xf2eb('0x33')]);_0x442731[_0xf2eb('0x36')]=_[_0xf2eb('0x47')](_0x270131[_0xf2eb('0x36')]);_0x442731[_0xf2eb('0x37')]=_[_0xf2eb('0x38')](_0x442731[_0xf2eb('0x35')],_0x442731[_0xf2eb('0x36')]);_0x1a19eb[_0xf2eb('0x39')]=_[_0xf2eb('0x38')](_0x442731[_0xf2eb('0x35')],qs[_0xf2eb('0x3a')](_0x270131[_0xf2eb('0x36')][_0xf2eb('0x3a')]));_0x1a19eb[_0xf2eb('0x39')]=_0x1a19eb['attributes'][_0xf2eb('0x3b')]?_0x1a19eb[_0xf2eb('0x39')]:_0x442731['model'];if(!_0x270131[_0xf2eb('0x36')][_0xf2eb('0x3c')](_0xf2eb('0x3d'))){_0x1a19eb[_0xf2eb('0x1d')]=qs[_0xf2eb('0x1d')](_0x270131[_0xf2eb('0x36')][_0xf2eb('0x1d')]);_0x1a19eb[_0xf2eb('0x1a')]=qs[_0xf2eb('0x1a')](_0x270131[_0xf2eb('0x36')][_0xf2eb('0x1a')]);}_0x1a19eb[_0xf2eb('0x5c')]=qs[_0xf2eb('0x57')](_0x270131[_0xf2eb('0x36')][_0xf2eb('0x57')]);_0x1a19eb[_0xf2eb('0x40')]=qs['filters'](_['pick'](_0x270131['query'],_0x442731[_0xf2eb('0x37')]));_0x1a19eb[_0xf2eb('0x40')]['VoiceQueueId']=_0x560142['id'];if(_0x270131[_0xf2eb('0x36')]['filter']){_0x1a19eb[_0xf2eb('0x40')]=_['merge'](_0x1a19eb[_0xf2eb('0x40')],{'$or':_[_0xf2eb('0x2b')](_0x1a19eb[_0xf2eb('0x39')],function(_0x4e90dd){var _0x26e15b={};_0x26e15b[_0x4e90dd]={'$like':'%'+_0x270131[_0xf2eb('0x36')]['filter']+'%'};return _0x26e15b;})});}_0x1a19eb=_['merge']({},_0x1a19eb,_0x270131[_0xf2eb('0x48')]);return db[_0xf2eb('0x5b')][_0xf2eb('0x1c')]({'where':_0x1a19eb[_0xf2eb('0x40')]})[_0xf2eb('0x24')](function(_0x155f7a){_0x144b8f[_0xf2eb('0x1c')]=_0x155f7a;if(_0x270131[_0xf2eb('0x36')][_0xf2eb('0x43')]){_0x1a19eb[_0xf2eb('0x44')]=[{'all':!![]}];}return db[_0xf2eb('0x5b')][_0xf2eb('0x5d')](_0x1a19eb);})[_0xf2eb('0x24')](function(_0x49c312){_0x144b8f[_0xf2eb('0x5e')]=_0x49c312;return _0x144b8f;});}})[_0xf2eb('0x24')](respondWithFilteredResult(_0x368397,_0x1a19eb))[_0xf2eb('0x51')](handleError(_0x368397,null));};exports[_0xf2eb('0x5f')]=function(_0x3e8be1,_0x41936e,_0x194491){var _0x5045a3={'raw':!![],'where':{}};var _0x525cd4={};var _0x2bfb5e={'count':0x0,'rows':[]};return db[_0xf2eb('0x45')][_0xf2eb('0x56')]({'where':{'id':_0x3e8be1[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x41936e,null))[_0xf2eb('0x24')](function(_0x4cb6b9){if(_0x4cb6b9){_0x525cd4[_0xf2eb('0x35')]=_[_0xf2eb('0x47')](db[_0xf2eb('0x60')][_0xf2eb('0x33')]);_0x525cd4[_0xf2eb('0x36')]=_['keys'](_0x3e8be1['query']);_0x525cd4[_0xf2eb('0x37')]=_[_0xf2eb('0x38')](_0x525cd4[_0xf2eb('0x35')],_0x525cd4[_0xf2eb('0x36')]);_0x5045a3[_0xf2eb('0x39')]=_[_0xf2eb('0x38')](_0x525cd4[_0xf2eb('0x35')],qs[_0xf2eb('0x3a')](_0x3e8be1[_0xf2eb('0x36')]['fields']));_0x5045a3['attributes']=_0x5045a3[_0xf2eb('0x39')]['length']?_0x5045a3['attributes']:_0x525cd4['model'];if(!_0x3e8be1['query'][_0xf2eb('0x3c')](_0xf2eb('0x3d'))){_0x5045a3[_0xf2eb('0x1d')]=qs[_0xf2eb('0x1d')](_0x3e8be1['query']['limit']);_0x5045a3['offset']=qs[_0xf2eb('0x1a')](_0x3e8be1[_0xf2eb('0x36')][_0xf2eb('0x1a')]);}_0x5045a3['order']=qs['sort'](_0x3e8be1['query'][_0xf2eb('0x57')]);_0x5045a3[_0xf2eb('0x40')]=qs[_0xf2eb('0x37')](_[_0xf2eb('0x3e')](_0x3e8be1[_0xf2eb('0x36')],_0x525cd4['filters']));_0x5045a3[_0xf2eb('0x40')][_0xf2eb('0x58')]=_0x4cb6b9['id'];if(_0x3e8be1['query'][_0xf2eb('0x3f')]){_0x5045a3[_0xf2eb('0x40')]=_[_0xf2eb('0x41')](_0x5045a3['where'],{'$or':_['map'](_0x5045a3[_0xf2eb('0x39')],function(_0x6a365f){var _0x2e86db={};_0x2e86db[_0x6a365f]={'$like':'%'+_0x3e8be1[_0xf2eb('0x36')][_0xf2eb('0x3f')]+'%'};return _0x2e86db;})});}_0x5045a3=_[_0xf2eb('0x41')]({},_0x5045a3,_0x3e8be1[_0xf2eb('0x48')]);return db[_0xf2eb('0x60')][_0xf2eb('0x1c')]({'where':_0x5045a3[_0xf2eb('0x40')]})['then'](function(_0x341be8){_0x2bfb5e[_0xf2eb('0x1c')]=_0x341be8;if(_0x3e8be1['query'][_0xf2eb('0x43')]){_0x5045a3['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xf2eb('0x5d')](_0x5045a3);})[_0xf2eb('0x24')](function(_0x2e1562){_0x2bfb5e[_0xf2eb('0x5e')]=_0x2e1562;return _0x2bfb5e;});}})[_0xf2eb('0x24')](respondWithFilteredResult(_0x41936e,_0x5045a3))[_0xf2eb('0x51')](handleError(_0x41936e,null));};exports[_0xf2eb('0x61')]=function(_0x57cf21,_0x58a951,_0x1af5fe){var _0xc84952={'raw':!![],'where':{}};var _0x3e4517={};var _0x4dc378={'count':0x0,'rows':[]};return db[_0xf2eb('0x45')][_0xf2eb('0x56')]({'where':{'id':_0x57cf21[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x58a951,null))[_0xf2eb('0x24')](function(_0x120eef){if(_0x120eef){_0x3e4517['model']=_['keys'](db[_0xf2eb('0x62')][_0xf2eb('0x33')]);_0x3e4517['query']=_[_0xf2eb('0x47')](_0x57cf21[_0xf2eb('0x36')]);_0x3e4517[_0xf2eb('0x37')]=_['intersection'](_0x3e4517['model'],_0x3e4517[_0xf2eb('0x36')]);_0xc84952[_0xf2eb('0x39')]=_[_0xf2eb('0x38')](_0x3e4517[_0xf2eb('0x35')],qs['fields'](_0x57cf21['query'][_0xf2eb('0x3a')]));_0xc84952['attributes']=_0xc84952['attributes']['length']?_0xc84952[_0xf2eb('0x39')]:_0x3e4517[_0xf2eb('0x35')];if(!_0x57cf21[_0xf2eb('0x36')]['hasOwnProperty'](_0xf2eb('0x3d'))){_0xc84952[_0xf2eb('0x1d')]=qs[_0xf2eb('0x1d')](_0x57cf21[_0xf2eb('0x36')][_0xf2eb('0x1d')]);_0xc84952[_0xf2eb('0x1a')]=qs[_0xf2eb('0x1a')](_0x57cf21[_0xf2eb('0x36')][_0xf2eb('0x1a')]);}_0xc84952[_0xf2eb('0x5c')]=qs[_0xf2eb('0x57')](_0x57cf21[_0xf2eb('0x36')]['sort']);_0xc84952[_0xf2eb('0x40')]=qs[_0xf2eb('0x37')](_[_0xf2eb('0x3e')](_0x57cf21[_0xf2eb('0x36')],_0x3e4517[_0xf2eb('0x37')]));_0xc84952[_0xf2eb('0x40')][_0xf2eb('0x58')]=_0x120eef['id'];if(_0x57cf21['query'][_0xf2eb('0x3f')]){_0xc84952[_0xf2eb('0x40')]=_[_0xf2eb('0x41')](_0xc84952['where'],{'$or':_[_0xf2eb('0x2b')](_0xc84952[_0xf2eb('0x39')],function(_0x40a420){var _0x3228d3={};_0x3228d3[_0x40a420]={'$like':'%'+_0x57cf21[_0xf2eb('0x36')][_0xf2eb('0x3f')]+'%'};return _0x3228d3;})});}_0xc84952=_[_0xf2eb('0x41')]({},_0xc84952,_0x57cf21[_0xf2eb('0x48')]);return db[_0xf2eb('0x62')]['count']({'where':_0xc84952[_0xf2eb('0x40')]})[_0xf2eb('0x24')](function(_0x87a350){_0x4dc378['count']=_0x87a350;if(_0x57cf21[_0xf2eb('0x36')]['includeAll']){_0xc84952[_0xf2eb('0x44')]=[{'all':!![]}];}return db[_0xf2eb('0x62')][_0xf2eb('0x5d')](_0xc84952);})[_0xf2eb('0x24')](function(_0x553054){_0x4dc378[_0xf2eb('0x5e')]=_0x553054;return _0x4dc378;});}})['then'](respondWithFilteredResult(_0x58a951,_0xc84952))[_0xf2eb('0x51')](handleError(_0x58a951,null));};exports[_0xf2eb('0x63')]=function(_0x49fc40,_0x252872,_0x18ebcc){var _0x57345a={};var _0x1d535b={};var _0x447435;var _0x353037;return db[_0xf2eb('0x45')]['findOne']({'where':{'id':_0x49fc40[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x252872,null))[_0xf2eb('0x24')](function(_0x3c2aba){if(_0x3c2aba){_0x447435=_0x3c2aba;_0x1d535b['model']=_['keys'](db['Team'][_0xf2eb('0x33')]);_0x1d535b[_0xf2eb('0x36')]=_[_0xf2eb('0x47')](_0x49fc40[_0xf2eb('0x36')]);_0x1d535b[_0xf2eb('0x37')]=_[_0xf2eb('0x38')](_0x1d535b[_0xf2eb('0x35')],_0x1d535b[_0xf2eb('0x36')]);_0x57345a[_0xf2eb('0x39')]=_[_0xf2eb('0x38')](_0x1d535b['model'],qs[_0xf2eb('0x3a')](_0x49fc40[_0xf2eb('0x36')]['fields']));_0x57345a[_0xf2eb('0x39')]=_0x57345a['attributes']['length']?_0x57345a[_0xf2eb('0x39')]:_0x1d535b[_0xf2eb('0x35')];_0x57345a['order']=qs[_0xf2eb('0x57')](_0x49fc40[_0xf2eb('0x36')][_0xf2eb('0x57')]);_0x57345a['where']=qs[_0xf2eb('0x37')](_['pick'](_0x49fc40[_0xf2eb('0x36')],_0x1d535b['filters']));if(_0x49fc40['query'][_0xf2eb('0x3f')]){_0x57345a[_0xf2eb('0x40')]=_[_0xf2eb('0x41')](_0x57345a[_0xf2eb('0x40')],{'$or':_['map'](_0x57345a[_0xf2eb('0x39')],function(_0xb1b96d){var _0x141af7={};_0x141af7[_0xb1b96d]={'$like':'%'+_0x49fc40['query'][_0xf2eb('0x3f')]+'%'};return _0x141af7;})});}_0x57345a=_['merge']({},_0x57345a,_0x49fc40[_0xf2eb('0x48')]);return _0x447435['getTeams'](_0x57345a);}})[_0xf2eb('0x24')](function(_0x1a2b94){if(_0x1a2b94){_0x353037=_0x1a2b94[_0xf2eb('0x3b')];if(!_0x49fc40[_0xf2eb('0x36')]['hasOwnProperty'](_0xf2eb('0x3d'))){_0x57345a['limit']=qs[_0xf2eb('0x1d')](_0x49fc40[_0xf2eb('0x36')]['limit']);_0x57345a[_0xf2eb('0x1a')]=qs[_0xf2eb('0x1a')](_0x49fc40[_0xf2eb('0x36')]['offset']);}return _0x447435['getTeams'](_0x57345a);}})[_0xf2eb('0x24')](function(_0x5f243a){if(_0x5f243a){return _0x5f243a?{'count':_0x353037,'rows':_0x5f243a}:null;}})[_0xf2eb('0x24')](respondWithResult(_0x252872,null))[_0xf2eb('0x51')](handleError(_0x252872,null));};exports['addTeams']=function(_0x31fba4,_0x2a983b,_0xfc446b){var _0x2c5dbe=_0x31fba4[_0xf2eb('0x4a')]['teams'];var _0x485db0=_[_0xf2eb('0x2b')](_0x2c5dbe,'id');return db[_0xf2eb('0x64')][_0xf2eb('0x5d')]({'where':{'id':_0x485db0},'attributes':['id'],'include':[{'model':db[_0xf2eb('0x65')],'as':_0xf2eb('0x66'),'attributes':['id','name',_0xf2eb('0x67'),_0xf2eb('0x68'),_0xf2eb('0x69')],'raw':!![]}]})[_0xf2eb('0x24')](function(_0x4a0846){if(_0x4a0846){var _0x34e749=_[_0xf2eb('0x6a')](_0x4a0846,function(_0x559f84){var _0xd2abe3=_0x559f84['get']({'plain':!![]});_0xd2abe3['Agents'][_0xf2eb('0x6b')](function(_0x5b6d35){_0x5b6d35[_0xf2eb('0x6c')]=_[_0xf2eb('0x4d')](_0x2c5dbe,{'id':_0xd2abe3['id']})[_0xf2eb('0x6c')];});return _0xd2abe3[_0xf2eb('0x66')];});return db[_0xf2eb('0x45')][_0xf2eb('0x4d')]({'where':{'id':_0x31fba4[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](function(_0x39f5c6){return db[_0xf2eb('0x6d')][_0xf2eb('0x6e')](function(_0x3626db){return _0x39f5c6[_0xf2eb('0x6f')](_0x485db0,{'transaction':_0x3626db})['then'](function(){return BPromise[_0xf2eb('0x70')](_0x2c5dbe,function(_0x123c4c){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x123c4c['id'],'VoiceQueueId':_0x31fba4[_0xf2eb('0x46')]['id'],'penalty':_0x123c4c[_0xf2eb('0x6c')]},{'transaction':_0x3626db});});})['then'](function(){return BPromise['each'](_0x34e749,function(_0x25e2c8){return db['UserVoiceQueue'][_0xf2eb('0x71')]({'where':{'UserId':_0x25e2c8['id'],'VoiceQueueId':_0x31fba4[_0xf2eb('0x46')]['id']},'defaults':{'penalty':_0x25e2c8[_0xf2eb('0x6c')]},'transaction':_0x3626db});});})[_0xf2eb('0x24')](function(){return BPromise[_0xf2eb('0x70')](_['filter'](_0x34e749,{'online':!![]}),function(_0x3968c1){return db[_0xf2eb('0x72')][_0xf2eb('0x73')]({'membername':_0x3968c1[_0xf2eb('0x2f')],'UserId':_0x3968c1['id'],'queue_name':_0x39f5c6[_0xf2eb('0x2f')],'VoiceQueueId':_0x39f5c6['id'],'interface':_['isNil'](_0x3968c1[_0xf2eb('0x69')])?util[_0xf2eb('0x74')](_0xf2eb('0x75'),_0x3968c1[_0xf2eb('0x2f')]):_0x3968c1[_0xf2eb('0x69')],'paused':_0x3968c1[_0xf2eb('0x68')]||![],'penalty':_0x3968c1['penalty']},{'transaction':_0x3626db});});})[_0xf2eb('0x24')](function(){_0x34e749[_0xf2eb('0x6b')](function(_0x4b752c){socket[_0xf2eb('0x76')](_0xf2eb('0x77'),{'UserId':_0x4b752c['id'],'VoiceQueueId':_0x39f5c6['id']});});});});});}})['then'](respondWithStatusCode(_0x2a983b,null))[_0xf2eb('0x51')](handleError(_0x2a983b,null));};exports['removeTeams']=function(_0x225835,_0x1c786f,_0x540756){return db[_0xf2eb('0x64')][_0xf2eb('0x5d')]({'where':{'id':_0x225835[_0xf2eb('0x36')][_0xf2eb('0x78')]},'attributes':['id'],'include':[{'model':db[_0xf2eb('0x65')],'as':_0xf2eb('0x66'),'attributes':['id'],'raw':!![]}]})[_0xf2eb('0x24')](handleEntityNotFound(_0x1c786f,null))[_0xf2eb('0x24')](function(_0x1e8f5a){var _0x2e371f=_[_0xf2eb('0x2b')](_0x1e8f5a,'id');var _0x30e814=[];var _0x255511=[];var _0x57ba72=squel['select']();_0x57ba72[_0xf2eb('0x79')](_0xf2eb('0x7a'))[_0xf2eb('0x7b')](_0xf2eb('0x7c'),'tq')[_0xf2eb('0x7d')](_0xf2eb('0x7e'),'ut',_0xf2eb('0x7f'))[_0xf2eb('0x40')](_0xf2eb('0x80'),_0x225835[_0xf2eb('0x46')]['id']);for(var _0x56b674=0x0;_0x56b674<_0x1e8f5a[_0xf2eb('0x3b')];_0x56b674+=0x1){let _0x42a08f=_0x1e8f5a[_0x56b674];for(var _0xa40cd3=0x0;_0xa40cd3<_0x42a08f[_0xf2eb('0x66')][_0xf2eb('0x3b')];_0xa40cd3+=0x1){let _0x533f64=_0x42a08f[_0xf2eb('0x66')][_0xa40cd3];var _0x28c4d6=_0x57ba72[_0xf2eb('0x81')]();_0x28c4d6[_0xf2eb('0x40')](_0xf2eb('0x82'),_0x533f64['id']);_0x255511[_0xf2eb('0x83')](db[_0xf2eb('0x6d')][_0xf2eb('0x36')](_0x28c4d6[_0xf2eb('0x84')](),{'type':db[_0xf2eb('0x6d')][_0xf2eb('0x85')][_0xf2eb('0x86')]})[_0xf2eb('0x24')](function(_0x536cf1){if(_0x536cf1[_0xf2eb('0x3b')]===0x1){return _0x533f64['id'];}else{var _0x5aa63e=_['every'](_[_0xf2eb('0x2b')](_0x536cf1,_0xf2eb('0x87')),function(_0x22b908){return _[_0xf2eb('0x2d')](_0x2e371f,_0x22b908);});if(_0x5aa63e){return _0x533f64['id'];}}}));}}return BPromise['all'](_0x255511)[_0xf2eb('0x24')](function(_0x4360b3){_0x30e814=_(_0x30e814)[_0xf2eb('0x88')](_0x4360b3)[_0xf2eb('0x89')]()[_0xf2eb('0x2c')]();return db[_0xf2eb('0x45')][_0xf2eb('0x4d')]({'where':{'id':_0x225835[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](function(_0xd7efd6){return db['sequelize'][_0xf2eb('0x6e')](function(_0x4c4c62){return _0xd7efd6[_0xf2eb('0x8a')](_0x225835[_0xf2eb('0x36')][_0xf2eb('0x78')],{'transaction':_0x4c4c62})[_0xf2eb('0x24')](function(){if(!_[_0xf2eb('0x8b')](_0x30e814)){return _0xd7efd6[_0xf2eb('0x8c')](_0x30e814,{'transaction':_0x4c4c62})['then'](function(){return db[_0xf2eb('0x72')][_0xf2eb('0x25')]({'where':{'VoiceQueueId':_0x225835[_0xf2eb('0x46')]['id'],'UserId':_0x30e814},'transaction':_0x4c4c62});});}})[_0xf2eb('0x24')](function(){_0x30e814[_0xf2eb('0x6b')](function(_0xd5aa94){socket[_0xf2eb('0x76')](_0xf2eb('0x8d'),{'UserId':_0xd5aa94,'VoiceQueueId':_0xd7efd6['id']});});});});});});})[_0xf2eb('0x24')](respondWithStatusCode(_0x1c786f,null))[_0xf2eb('0x51')](handleError(_0x1c786f,null));};exports[_0xf2eb('0x8e')]=function(_0x1f47ca,_0x3eb5e1,_0x340899){var _0xad16fe,_0x508ed9;return db['VoiceQueue'][_0xf2eb('0x4d')]({'where':{'id':_0x1f47ca[_0xf2eb('0x46')]['id']}})['then'](handleEntityNotFound(_0x3eb5e1,null))[_0xf2eb('0x24')](function(_0x2645c0){if(_0x2645c0){_0x508ed9=_0x2645c0;return _0x2645c0[_0xf2eb('0x8e')](_0x1f47ca[_0xf2eb('0x4a')][_0xf2eb('0x78')],_[_0xf2eb('0x52')](_0x1f47ca[_0xf2eb('0x4a')],[_0xf2eb('0x78'),'id'])||{})[_0xf2eb('0x8f')](function(_0x5456ce){for(var _0x3598ea=0x0;_0x3598ea<_0x1f47ca['body'][_0xf2eb('0x78')]['length'];_0x3598ea+=0x1){socket[_0xf2eb('0x76')](_0xf2eb('0x77'),{'UserId':Number(_0x1f47ca[_0xf2eb('0x4a')][_0xf2eb('0x78')][_0x3598ea]),'VoiceQueueId':Number(_0x1f47ca[_0xf2eb('0x46')]['id'])});}return _0x5456ce;});}})['then'](function(_0x2a16aa){_0xad16fe=_0x2a16aa||[];if(_0x508ed9){return db['User'][_0xf2eb('0x5d')]({'where':{'id':_0x1f47ca[_0xf2eb('0x4a')][_0xf2eb('0x78')]},'attributes':['id',_0xf2eb('0x2f'),_0xf2eb('0x67'),_0xf2eb('0x68'),'interface'],'raw':!![]});}})['then'](function(_0x360f48){if(!_[_0xf2eb('0x8b')](_0x360f48)){var _0x443e6c=[];for(var _0x27b811=0x0;_0x27b811<_0x360f48[_0xf2eb('0x3b')];_0x27b811++){if(_0x360f48[_0x27b811][_0xf2eb('0x67')]){_0x443e6c[_0xf2eb('0x83')](db[_0xf2eb('0x72')][_0xf2eb('0x73')]({'membername':_0x360f48[_0x27b811]['name'],'UserId':_0x360f48[_0x27b811]['id'],'queue_name':_0x508ed9[_0xf2eb('0x2f')],'VoiceQueueId':_0x508ed9['id'],'interface':_[_0xf2eb('0x90')](_0x360f48[_0x27b811][_0xf2eb('0x69')])?util[_0xf2eb('0x74')]('SIP/%s',_0x360f48[_0x27b811][_0xf2eb('0x2f')]):_0x360f48[_0x27b811]['interface'],'paused':_0x360f48[_0x27b811][_0xf2eb('0x68')]||![],'penalty':_0x1f47ca[_0xf2eb('0x4a')]['penalty']||0x0}));}}return BPromise[_0xf2eb('0x91')](_0x443e6c);}})[_0xf2eb('0x24')](function(){return _0xad16fe;})[_0xf2eb('0x24')](respondWithResult(_0x3eb5e1,null))['catch'](handleError(_0x3eb5e1,null));};exports[_0xf2eb('0x8c')]=function(_0x444e18,_0x46c17b,_0x2e039d){return db[_0xf2eb('0x45')][_0xf2eb('0x4d')]({'where':{'id':_0x444e18[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x46c17b,null))[_0xf2eb('0x24')](function(_0x3dd661){if(_0x3dd661){return _0x3dd661[_0xf2eb('0x8c')](_0x444e18['query'][_0xf2eb('0x78')])[_0xf2eb('0x24')](function(){if(_[_0xf2eb('0x92')](_0x444e18['query'][_0xf2eb('0x78')])){for(var _0x936e16=0x0;_0x936e16<_0x444e18[_0xf2eb('0x36')][_0xf2eb('0x78')]['length'];_0x936e16+=0x1){socket[_0xf2eb('0x76')](_0xf2eb('0x8d'),{'UserId':Number(_0x444e18[_0xf2eb('0x36')][_0xf2eb('0x78')][_0x936e16]),'VoiceQueueId':Number(_0x444e18[_0xf2eb('0x46')]['id'])});}}else{socket[_0xf2eb('0x76')](_0xf2eb('0x8d'),{'UserId':Number(_0x444e18[_0xf2eb('0x36')][_0xf2eb('0x78')]),'VoiceQueueId':Number(_0x444e18[_0xf2eb('0x46')]['id'])});}});}})[_0xf2eb('0x24')](function(_0x3350d1){return db[_0xf2eb('0x72')][_0xf2eb('0x25')]({'where':{'VoiceQueueId':_0x444e18[_0xf2eb('0x46')]['id'],'UserId':_0x444e18[_0xf2eb('0x36')][_0xf2eb('0x78')]}})[_0xf2eb('0x24')](function(){return _0x3350d1;});})[_0xf2eb('0x24')](respondWithStatusCode(_0x46c17b,null))['catch'](handleError(_0x46c17b,null));};exports['getAgents']=function(_0x416b0a,_0x23ecb2,_0x4cdc8e){var _0x33fa67={};var _0x727a1d={};var _0x2a458a;var _0x709a33;return db[_0xf2eb('0x45')][_0xf2eb('0x56')]({'where':{'id':_0x416b0a['params']['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x23ecb2,null))[_0xf2eb('0x24')](function(_0x199420){if(_0x199420){_0x2a458a=_0x199420;_0x727a1d['model']=_['keys'](db[_0xf2eb('0x65')][_0xf2eb('0x33')]);_0x727a1d['query']=_['keys'](_0x416b0a[_0xf2eb('0x36')]);_0x727a1d[_0xf2eb('0x37')]=_['intersection'](_0x727a1d['model'],_0x727a1d[_0xf2eb('0x36')]);_0x33fa67['attributes']=_[_0xf2eb('0x38')](_0x727a1d[_0xf2eb('0x35')],qs['fields'](_0x416b0a['query'][_0xf2eb('0x3a')]));_0x33fa67['attributes']=_0x33fa67[_0xf2eb('0x39')]['length']?_0x33fa67[_0xf2eb('0x39')]:_0x727a1d['model'];_0x33fa67[_0xf2eb('0x5c')]=qs[_0xf2eb('0x57')](_0x416b0a[_0xf2eb('0x36')][_0xf2eb('0x57')]);_0x33fa67[_0xf2eb('0x40')]=qs[_0xf2eb('0x37')](_[_0xf2eb('0x3e')](_0x416b0a[_0xf2eb('0x36')],_0x727a1d['filters']));if(_0x416b0a[_0xf2eb('0x36')][_0xf2eb('0x3f')]){_0x33fa67[_0xf2eb('0x40')]=_['merge'](_0x33fa67['where'],{'$or':_[_0xf2eb('0x2b')](_0x33fa67[_0xf2eb('0x39')],function(_0x55fd41){var _0x44cb74={};_0x44cb74[_0x55fd41]={'$like':'%'+_0x416b0a[_0xf2eb('0x36')][_0xf2eb('0x3f')]+'%'};return _0x44cb74;})});}_0x33fa67=_[_0xf2eb('0x41')]({},_0x33fa67,_0x416b0a[_0xf2eb('0x48')]);return _0x2a458a['getAgents'](_0x33fa67);}})[_0xf2eb('0x24')](function(_0x193ae9){if(_0x193ae9){_0x709a33=_0x193ae9[_0xf2eb('0x3b')];if(!_0x416b0a[_0xf2eb('0x36')][_0xf2eb('0x3c')](_0xf2eb('0x3d'))){_0x33fa67[_0xf2eb('0x1d')]=qs[_0xf2eb('0x1d')](_0x416b0a['query']['limit']);_0x33fa67['offset']=qs['offset'](_0x416b0a[_0xf2eb('0x36')][_0xf2eb('0x1a')]);}return _0x2a458a['getAgents'](_0x33fa67);}})[_0xf2eb('0x24')](function(_0x3e5933){if(_0x3e5933){return _0x3e5933?{'count':_0x709a33,'rows':_0x3e5933}:null;}})[_0xf2eb('0x24')](respondWithResult(_0x23ecb2,null))[_0xf2eb('0x51')](handleError(_0x23ecb2,null));};exports[_0xf2eb('0x93')]=function(_0x45c0d7,_0x3bd59b,_0x2a6acc){var _0x2fe0d7={};var _0x17769e={};var _0x502c27;var _0x54c22f;return db[_0xf2eb('0x45')][_0xf2eb('0x56')]({'where':{'id':_0x45c0d7[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x3bd59b,null))[_0xf2eb('0x24')](function(_0x3719b6){if(_0x3719b6){_0x502c27=_0x3719b6;_0x17769e[_0xf2eb('0x35')]=_[_0xf2eb('0x47')](db[_0xf2eb('0x72')][_0xf2eb('0x33')]);_0x17769e['query']=_[_0xf2eb('0x47')](_0x45c0d7['query']);_0x17769e[_0xf2eb('0x37')]=_[_0xf2eb('0x38')](_0x17769e[_0xf2eb('0x35')],_0x17769e[_0xf2eb('0x36')]);_0x2fe0d7[_0xf2eb('0x39')]=_[_0xf2eb('0x38')](_0x17769e[_0xf2eb('0x35')],qs[_0xf2eb('0x3a')](_0x45c0d7[_0xf2eb('0x36')][_0xf2eb('0x3a')]));_0x2fe0d7[_0xf2eb('0x39')]=_0x2fe0d7['attributes']['length']?_0x2fe0d7['attributes']:_0x17769e[_0xf2eb('0x35')];_0x2fe0d7[_0xf2eb('0x5c')]=qs[_0xf2eb('0x57')](_0x45c0d7[_0xf2eb('0x36')]['sort']);_0x2fe0d7[_0xf2eb('0x40')]=qs[_0xf2eb('0x37')](_[_0xf2eb('0x3e')](_0x45c0d7['query'],_0x17769e[_0xf2eb('0x37')]));if(_0x45c0d7['query'][_0xf2eb('0x3f')]){_0x2fe0d7[_0xf2eb('0x40')]=_[_0xf2eb('0x41')](_0x2fe0d7[_0xf2eb('0x40')],{'$or':_[_0xf2eb('0x2b')](_0x2fe0d7['attributes'],function(_0xadb126){var _0xa05917={};_0xa05917[_0xadb126]={'$like':'%'+_0x45c0d7['query']['filter']+'%'};return _0xa05917;})});}_0x2fe0d7=_[_0xf2eb('0x41')]({},_0x2fe0d7,_0x45c0d7[_0xf2eb('0x48')]);return _0x502c27['getMembers'](_0x2fe0d7);}})['then'](function(_0xf9d8ce){if(_0xf9d8ce){_0x54c22f=_0xf9d8ce[_0xf2eb('0x3b')];if(!_0x45c0d7[_0xf2eb('0x36')]['hasOwnProperty'](_0xf2eb('0x3d'))){_0x2fe0d7[_0xf2eb('0x1d')]=qs[_0xf2eb('0x1d')](_0x45c0d7['query'][_0xf2eb('0x1d')]);_0x2fe0d7[_0xf2eb('0x1a')]=qs[_0xf2eb('0x1a')](_0x45c0d7[_0xf2eb('0x36')][_0xf2eb('0x1a')]);}return _0x502c27['getMembers'](_0x2fe0d7);}})[_0xf2eb('0x24')](function(_0x420ac2){return _0x420ac2?{'count':_0x54c22f,'rows':_0x420ac2}:null;})['then'](respondWithResult(_0x3bd59b,null))[_0xf2eb('0x51')](handleError(_0x3bd59b,null));};exports[_0xf2eb('0x94')]=function(_0x2201f1,_0x4e9512,_0x3b98d6){var _0x2b9ee3={};var _0x19b8c7={};var _0x424086;var _0x2f340f;return db['VoiceQueue'][_0xf2eb('0x56')]({'where':{'id':_0x2201f1[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x4e9512,null))['then'](function(_0x208142){if(_0x208142){_0x424086=_0x208142;_0x19b8c7[_0xf2eb('0x35')]=_[_0xf2eb('0x47')](db[_0xf2eb('0x95')][_0xf2eb('0x33')]);_0x19b8c7['query']=_[_0xf2eb('0x47')](_0x2201f1[_0xf2eb('0x36')]);_0x19b8c7['filters']=_[_0xf2eb('0x38')](_0x19b8c7[_0xf2eb('0x35')],_0x19b8c7[_0xf2eb('0x36')]);_0x2b9ee3[_0xf2eb('0x39')]=_[_0xf2eb('0x38')](_0x19b8c7['model'],qs[_0xf2eb('0x3a')](_0x2201f1['query'][_0xf2eb('0x3a')]));_0x2b9ee3[_0xf2eb('0x39')]=_0x2b9ee3['attributes'][_0xf2eb('0x3b')]?_0x2b9ee3[_0xf2eb('0x39')]:_0x19b8c7[_0xf2eb('0x35')];_0x2b9ee3[_0xf2eb('0x5c')]=qs[_0xf2eb('0x57')](_0x2201f1[_0xf2eb('0x36')][_0xf2eb('0x57')]);_0x2b9ee3[_0xf2eb('0x40')]=qs[_0xf2eb('0x37')](_['pick'](_0x2201f1[_0xf2eb('0x36')],_0x19b8c7[_0xf2eb('0x37')]));if(_0x2201f1[_0xf2eb('0x36')]['filter']){_0x2b9ee3[_0xf2eb('0x40')]=_['merge'](_0x2b9ee3[_0xf2eb('0x40')],{'$or':_['map'](_0x2b9ee3['attributes'],function(_0x50cf22){var _0x581cb7={};_0x581cb7[_0x50cf22]={'$like':'%'+_0x2201f1[_0xf2eb('0x36')][_0xf2eb('0x3f')]+'%'};return _0x581cb7;})});}_0x2b9ee3=_[_0xf2eb('0x41')]({},_0x2b9ee3,_0x2201f1[_0xf2eb('0x48')]);return _0x424086[_0xf2eb('0x94')](_0x2b9ee3);}})[_0xf2eb('0x24')](function(_0x15100c){if(_0x15100c){_0x2f340f=_0x15100c[_0xf2eb('0x3b')];if(!_0x2201f1[_0xf2eb('0x36')]['hasOwnProperty']('nolimit')){_0x2b9ee3[_0xf2eb('0x1d')]=qs['limit'](_0x2201f1[_0xf2eb('0x36')][_0xf2eb('0x1d')]);_0x2b9ee3[_0xf2eb('0x1a')]=qs['offset'](_0x2201f1[_0xf2eb('0x36')]['offset']);}return _0x424086[_0xf2eb('0x94')](_0x2b9ee3);}})[_0xf2eb('0x24')](function(_0x304dea){if(_0x304dea){return _0x304dea?{'count':_0x2f340f,'rows':_0x304dea}:null;}})[_0xf2eb('0x24')](respondWithResult(_0x4e9512,null))[_0xf2eb('0x51')](handleError(_0x4e9512,null));};exports[_0xf2eb('0x96')]=function(_0x4d4b2d,_0x10a5f2,_0x1e1994){var _0x14fc47,_0x48ab6a;return db[_0xf2eb('0x45')][_0xf2eb('0x4d')]({'where':{'id':_0x4d4b2d[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x10a5f2,null))[_0xf2eb('0x24')](function(_0x47a5f8){if(_0x47a5f8){_0x48ab6a=_0x47a5f8;return _0x47a5f8[_0xf2eb('0x96')](_0x4d4b2d[_0xf2eb('0x4a')][_0xf2eb('0x78')],_[_0xf2eb('0x52')](_0x4d4b2d[_0xf2eb('0x4a')],['ids','id'])||{});}return null;})[_0xf2eb('0x8f')](function(_0x5df0b7){var _0x1a8c15;_0x14fc47=_0x5df0b7||[];var _0x6a7509=[];if(_0x5df0b7){for(var _0x16fd79=0x0;_0x16fd79<_0x5df0b7['length'];_0x16fd79+=0x1){var _0xc5dd6d=_0x5df0b7[_0x16fd79][_0xf2eb('0x26')]({'plain':!![]});_0x48ab6a['dialCheckDuplicateType']=_0x4d4b2d[_0xf2eb('0x4a')]['dialCheckDuplicateType']?_0x4d4b2d[_0xf2eb('0x4a')]['dialCheckDuplicateType']:_0x48ab6a[_0xf2eb('0x97')];switch(_0x48ab6a[_0xf2eb('0x97')]){case'always':_0x1a8c15=squel[_0xf2eb('0x98')]()['into'](_0xf2eb('0x99'))[_0xf2eb('0x9a')]([_0xf2eb('0x9b'),_0xf2eb('0x9c'),_0xf2eb('0x9d'),'ListId',_0xf2eb('0x58'),'createdAt',_0xf2eb('0x54')],squel['select']()['field'](_0xf2eb('0x9b'),_0xf2eb('0x9b'))[_0xf2eb('0x79')](_0xf2eb('0x9e'),_0xf2eb('0x9c'))[_0xf2eb('0x79')]('id',_0xf2eb('0x9d'))[_0xf2eb('0x79')](_0xc5dd6d[_0xf2eb('0x9f')][_0xf2eb('0x84')](),_0xf2eb('0xa0'))[_0xf2eb('0x79')](_0x4d4b2d[_0xf2eb('0x46')]['id'][_0xf2eb('0x84')](),_0xf2eb('0x58'))[_0xf2eb('0x79')](_0xf2eb('0x9e'),_0xf2eb('0x53'))[_0xf2eb('0x79')]('NOW()',_0xf2eb('0x54'))['from'](_0xf2eb('0xa1'))[_0xf2eb('0x40')](_0xf2eb('0xa2'))[_0xf2eb('0x40')]('ListId\x20=\x20?',_0xc5dd6d[_0xf2eb('0x9f')]['toString']())['where'](_0xf2eb('0xa3'))['where'](_0xf2eb('0xa4'),squel['select']()[_0xf2eb('0x79')](_0xf2eb('0xa5'))[_0xf2eb('0x7b')](_0xf2eb('0xa6'))['where'](_0xf2eb('0x80'),_0x4d4b2d[_0xf2eb('0x46')]['id']['toString']()))[_0xf2eb('0x40')](_0xf2eb('0xa4'),squel['select']()[_0xf2eb('0x79')](_0xf2eb('0xa7'))[_0xf2eb('0x7b')](_0xf2eb('0x99'))[_0xf2eb('0x40')](_0xf2eb('0x80'),_0x4d4b2d[_0xf2eb('0x46')]['id'][_0xf2eb('0x84')]())))[_0xf2eb('0x84')]();break;case _0xf2eb('0xa8'):_0x1a8c15=squel[_0xf2eb('0x98')]()['into']('cm_hopper')[_0xf2eb('0x9a')]([_0xf2eb('0x9b'),'scheduledAt',_0xf2eb('0x9d'),_0xf2eb('0xa0'),_0xf2eb('0x58'),_0xf2eb('0x53'),_0xf2eb('0x54')],squel[_0xf2eb('0xa9')]()['field']('phone',_0xf2eb('0x9b'))['field'](_0xf2eb('0x9e'),_0xf2eb('0x9c'))[_0xf2eb('0x79')]('id',_0xf2eb('0x9d'))['field'](_0xc5dd6d['CmListId'][_0xf2eb('0x84')](),'ListId')[_0xf2eb('0x79')](_0x4d4b2d[_0xf2eb('0x46')]['id'][_0xf2eb('0x84')](),'VoiceQueueId')[_0xf2eb('0x79')](_0xf2eb('0x9e'),_0xf2eb('0x53'))[_0xf2eb('0x79')](_0xf2eb('0x9e'),'updatedAt')[_0xf2eb('0x7b')](_0xf2eb('0xa1'))[_0xf2eb('0x40')](_0xf2eb('0xa2'))[_0xf2eb('0x40')](_0xf2eb('0xaa'),_0xc5dd6d[_0xf2eb('0x9f')][_0xf2eb('0x84')]())[_0xf2eb('0x40')](_0xf2eb('0xa3'))[_0xf2eb('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf2eb('0xa9')]()[_0xf2eb('0x79')]('COALESCE(phone,\x27\x27)')[_0xf2eb('0x7b')](_0xf2eb('0x99'))[_0xf2eb('0x40')](_0xf2eb('0x80'),_0x4d4b2d[_0xf2eb('0x46')]['id'][_0xf2eb('0x84')]())))[_0xf2eb('0x84')]();break;default:_0x1a8c15=squel[_0xf2eb('0x98')]()[_0xf2eb('0xab')]('cm_hopper')[_0xf2eb('0x9a')]([_0xf2eb('0x9b'),'scheduledAt',_0xf2eb('0x9d'),'ListId',_0xf2eb('0x58'),_0xf2eb('0x53'),'updatedAt'],squel[_0xf2eb('0xa9')]()[_0xf2eb('0x79')]('phone',_0xf2eb('0x9b'))[_0xf2eb('0x79')](_0xf2eb('0x9e'),'scheduledAt')[_0xf2eb('0x79')]('id',_0xf2eb('0x9d'))['field'](_0xc5dd6d[_0xf2eb('0x9f')][_0xf2eb('0x84')](),_0xf2eb('0xa0'))[_0xf2eb('0x79')](_0x4d4b2d[_0xf2eb('0x46')]['id'][_0xf2eb('0x84')](),'VoiceQueueId')[_0xf2eb('0x79')](_0xf2eb('0x9e'),_0xf2eb('0x53'))[_0xf2eb('0x79')](_0xf2eb('0x9e'),_0xf2eb('0x54'))[_0xf2eb('0x7b')](_0xf2eb('0xa1'))[_0xf2eb('0x40')](_0xf2eb('0xa2'))[_0xf2eb('0x40')]('ListId\x20=\x20?',_0xc5dd6d[_0xf2eb('0x9f')][_0xf2eb('0x84')]())[_0xf2eb('0x40')](_0xf2eb('0xa3')))[_0xf2eb('0x84')]();}_0x6a7509[_0xf2eb('0x83')](db[_0xf2eb('0x6d')][_0xf2eb('0x36')](_0x1a8c15));}return BPromise[_0xf2eb('0x91')](_0x6a7509);}})[_0xf2eb('0x24')](function(){return _0x14fc47;})[_0xf2eb('0x24')](respondWithResult(_0x10a5f2,null))[_0xf2eb('0x51')](handleError(_0x10a5f2,null));};exports[_0xf2eb('0xac')]=function(_0xa900ab,_0x551b14,_0xad834){return db[_0xf2eb('0x45')][_0xf2eb('0x4d')]({'where':{'id':_0xa900ab['params']['id']}})['then'](handleEntityNotFound(_0x551b14,null))['then'](function(_0x45e492){if(_0x45e492){return _0x45e492[_0xf2eb('0xac')](_0xa900ab[_0xf2eb('0x36')][_0xf2eb('0x78')]);}})[_0xf2eb('0x24')](function(_0x48b7d8){if(_0x48b7d8){return db['CmHopper']['destroy']({'where':{'ListId':_0xa900ab[_0xf2eb('0x36')][_0xf2eb('0x78')],'VoiceQueueId':_0xa900ab[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](function(){return _0x48b7d8;});}})['then'](respondWithStatusCode(_0x551b14,null))['catch'](handleError(_0x551b14,null));};exports[_0xf2eb('0xad')]=function(_0x1e489b,_0x164c46,_0x48c2ee){var _0x19b38f={};var _0x490bb1={};var _0x324411;var _0x1fa147;return db[_0xf2eb('0x45')]['findOne']({'where':{'id':_0x1e489b[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x164c46,null))[_0xf2eb('0x24')](function(_0xe010ae){if(_0xe010ae){_0x324411=_0xe010ae;_0x490bb1[_0xf2eb('0x35')]=_[_0xf2eb('0x47')](db[_0xf2eb('0x95')][_0xf2eb('0x33')]);_0x490bb1[_0xf2eb('0x36')]=_[_0xf2eb('0x47')](_0x1e489b[_0xf2eb('0x36')]);_0x490bb1[_0xf2eb('0x37')]=_[_0xf2eb('0x38')](_0x490bb1[_0xf2eb('0x35')],_0x490bb1[_0xf2eb('0x36')]);_0x19b38f[_0xf2eb('0x39')]=_[_0xf2eb('0x38')](_0x490bb1[_0xf2eb('0x35')],qs[_0xf2eb('0x3a')](_0x1e489b['query'][_0xf2eb('0x3a')]));_0x19b38f[_0xf2eb('0x39')]=_0x19b38f[_0xf2eb('0x39')][_0xf2eb('0x3b')]?_0x19b38f['attributes']:_0x490bb1['model'];_0x19b38f['order']=qs[_0xf2eb('0x57')](_0x1e489b[_0xf2eb('0x36')]['sort']);_0x19b38f[_0xf2eb('0x40')]=qs[_0xf2eb('0x37')](_['pick'](_0x1e489b[_0xf2eb('0x36')],_0x490bb1[_0xf2eb('0x37')]));if(_0x1e489b[_0xf2eb('0x36')][_0xf2eb('0x3f')]){_0x19b38f['where']=_[_0xf2eb('0x41')](_0x19b38f[_0xf2eb('0x40')],{'$or':_[_0xf2eb('0x2b')](_0x19b38f[_0xf2eb('0x39')],function(_0x37d3ac){var _0x5dffe3={};_0x5dffe3[_0x37d3ac]={'$like':'%'+_0x1e489b[_0xf2eb('0x36')][_0xf2eb('0x3f')]+'%'};return _0x5dffe3;})});}_0x19b38f=_[_0xf2eb('0x41')]({},_0x19b38f,_0x1e489b[_0xf2eb('0x48')]);return _0x324411[_0xf2eb('0xad')](_0x19b38f);}})[_0xf2eb('0x24')](function(_0x525da2){if(_0x525da2){_0x1fa147=_0x525da2[_0xf2eb('0x3b')];if(!_0x1e489b[_0xf2eb('0x36')][_0xf2eb('0x3c')]('nolimit')){_0x19b38f[_0xf2eb('0x1d')]=qs['limit'](_0x1e489b[_0xf2eb('0x36')][_0xf2eb('0x1d')]);_0x19b38f[_0xf2eb('0x1a')]=qs['offset'](_0x1e489b['query'][_0xf2eb('0x1a')]);}return _0x324411[_0xf2eb('0xad')](_0x19b38f);}})[_0xf2eb('0x24')](function(_0x4d2d0d){if(_0x4d2d0d){return _0x4d2d0d?{'count':_0x1fa147,'rows':_0x4d2d0d}:null;}})[_0xf2eb('0x24')](respondWithResult(_0x164c46,null))[_0xf2eb('0x51')](handleError(_0x164c46,null));};exports['addBlackLists']=function(_0x5c0f2c,_0x590172,_0x357b46){var _0xd63e45,_0x200cbc;return db[_0xf2eb('0x45')][_0xf2eb('0x4d')]({'where':{'id':_0x5c0f2c[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x590172,null))[_0xf2eb('0x24')](function(_0x1f0618){if(_0x1f0618){_0x200cbc=_0x1f0618;return _0x1f0618['addBlackLists'](_0x5c0f2c[_0xf2eb('0x4a')][_0xf2eb('0x78')],_[_0xf2eb('0x52')](_0x5c0f2c[_0xf2eb('0x4a')],['ids','id'])||{});}return null;})[_0xf2eb('0x8f')](function(_0x2831c3){var _0x26a322;_0xd63e45=_0x2831c3||[];var _0x1d8d9e=[];if(_0x2831c3){for(var _0x2deda8=0x0;_0x2deda8<_0x2831c3[_0xf2eb('0x3b')];_0x2deda8+=0x1){var _0x28f300=_0x2831c3[_0x2deda8][_0xf2eb('0x26')]({'plain':!![]});_0x26a322=squel['insert']()['into'](_0xf2eb('0xae'))[_0xf2eb('0x9a')]([_0xf2eb('0x9b'),'ContactId',_0xf2eb('0xa0'),_0xf2eb('0x58'),'createdAt',_0xf2eb('0x54')],squel['select']()[_0xf2eb('0x79')](_0xf2eb('0x9b'),_0xf2eb('0x9b'))['field']('id',_0xf2eb('0x9d'))['field'](_0x28f300['CmListId'][_0xf2eb('0x84')](),_0xf2eb('0xa0'))[_0xf2eb('0x79')](_0x5c0f2c[_0xf2eb('0x46')]['id'][_0xf2eb('0x84')](),_0xf2eb('0x58'))[_0xf2eb('0x79')](_0xf2eb('0x9e'),_0xf2eb('0x53'))[_0xf2eb('0x79')](_0xf2eb('0x9e'),_0xf2eb('0x54'))[_0xf2eb('0x7b')]('cm_contacts')[_0xf2eb('0x40')]('deletedAt\x20IS\x20NULL')[_0xf2eb('0x40')](_0xf2eb('0xaa'),_0x28f300['CmListId'][_0xf2eb('0x84')]())[_0xf2eb('0x40')](_0xf2eb('0xa3')))['toString']();_0x1d8d9e[_0xf2eb('0x83')](db[_0xf2eb('0x6d')][_0xf2eb('0x36')](_0x26a322));}return BPromise[_0xf2eb('0x91')](_0x1d8d9e);}})['then'](function(){return _0xd63e45;})[_0xf2eb('0x24')](respondWithResult(_0x590172,null))['catch'](handleError(_0x590172,null));};exports[_0xf2eb('0xaf')]=function(_0x1ba838,_0x2c04a5,_0xfe73ac){return db['VoiceQueue'][_0xf2eb('0x4d')]({'where':{'id':_0x1ba838[_0xf2eb('0x46')]['id']}})[_0xf2eb('0x24')](handleEntityNotFound(_0x2c04a5,null))['then'](function(_0x4057de){if(_0x4057de){return _0x4057de[_0xf2eb('0xaf')](_0x1ba838['query']['ids']);}})[_0xf2eb('0x24')](function(_0x214c3b){if(_0x214c3b){return db[_0xf2eb('0x62')]['destroy']({'where':{'ListId':_0x1ba838[_0xf2eb('0x36')][_0xf2eb('0x78')],'VoiceQueueId':_0x1ba838['params']['id']}})[_0xf2eb('0x24')](function(){return _0x214c3b;});}})[_0xf2eb('0x24')](respondWithStatusCode(_0x2c04a5,null))[_0xf2eb('0x51')](handleError(_0x2c04a5,null));}; \ No newline at end of file +var _0x9bfa=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','VoiceQueues','inbound','outbound','filter','ignore','value','includes','type','find','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','includeAll','include','VoiceQueue','findAll','rows','catch','show','params','keys','length','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','QueueCampaigns','findOne','CmHopper','VoiceQueueId','CmHopperHistory','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','Agents','online','voicePause','penalty','transaction','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','interface','emit','removeTeams','User','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','toString','sequelize','every','TeamId','compact','ids','isEmpty','removeAgents','forEach','userVoiceQueue:remove','addAgents','omit','spread','userVoiceQueue:save','push','all','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','NOW()','CmListId','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','onlyIfOpen','ListId','cm_contacts','removeLists','getBlackLists','addBlackLists','cm_hopper_black','deletedAt\x20IS\x20NULL','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','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','defaults','redis','localhost','./voiceQueue.socket','register','sendStatus','end','status','json','offset'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x9bfa,0x93));var _0xa9bf=function(_0x47ef62,_0x2f36a3){_0x47ef62=_0x47ef62-0x0;var _0x229ab6=_0x9bfa[_0x47ef62];return _0x229ab6;};'use strict';var emlformat=require(_0xa9bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa9bf('0x1'));var jsonpatch=require(_0xa9bf('0x2'));var rp=require(_0xa9bf('0x3'));var moment=require(_0xa9bf('0x4'));var BPromise=require(_0xa9bf('0x5'));var Mustache=require(_0xa9bf('0x6'));var util=require(_0xa9bf('0x7'));var path=require(_0xa9bf('0x8'));var sox=require('sox');var csv=require(_0xa9bf('0x9'));var ejs=require(_0xa9bf('0xa'));var fs=require('fs');var fs_extra=require(_0xa9bf('0xb'));var _=require(_0xa9bf('0xc'));var squel=require(_0xa9bf('0xd'));var crypto=require('crypto');var jsforce=require(_0xa9bf('0xe'));var deskjs=require(_0xa9bf('0xf'));var toCsv=require(_0xa9bf('0x9'));var querystring=require(_0xa9bf('0x10'));var Papa=require(_0xa9bf('0x11'));var Redis=require(_0xa9bf('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa9bf('0x13'));var as=require(_0xa9bf('0x14'));var hardwareService=require(_0xa9bf('0x15'));var logger=require(_0xa9bf('0x16'))(_0xa9bf('0x17'));var utils=require(_0xa9bf('0x18'));var config=require(_0xa9bf('0x19'));var licenseUtil=require(_0xa9bf('0x1a'));var db=require(_0xa9bf('0x1b'))['db'];config['redis']=_[_0xa9bf('0x1c')](config[_0xa9bf('0x1d')],{'host':_0xa9bf('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa9bf('0x1f'))[_0xa9bf('0x20')](socket);function respondWithStatusCode(_0x2d0510,_0x492c8b){_0x492c8b=_0x492c8b||0xcc;return function(_0x33b9f7){if(_0x33b9f7){return _0x2d0510[_0xa9bf('0x21')](_0x492c8b);}return _0x2d0510['status'](_0x492c8b)[_0xa9bf('0x22')]();};}function respondWithResult(_0x2cd06b,_0x25c23c){_0x25c23c=_0x25c23c||0xc8;return function(_0x445b75){if(_0x445b75){return _0x2cd06b[_0xa9bf('0x23')](_0x25c23c)[_0xa9bf('0x24')](_0x445b75);}};}function respondWithFilteredResult(_0x277751,_0x4b6616){return function(_0x32c7bc){if(_0x32c7bc){var _0x1791df=typeof _0x4b6616[_0xa9bf('0x25')]===_0xa9bf('0x26')&&typeof _0x4b6616[_0xa9bf('0x27')]==='undefined';var _0x1e5ab4=_0x32c7bc[_0xa9bf('0x28')];var _0x1e3d71=_0x1791df?0x0:_0x4b6616[_0xa9bf('0x25')];var _0x490b03=_0x1791df?_0x32c7bc[_0xa9bf('0x28')]:_0x4b6616[_0xa9bf('0x25')]+_0x4b6616['limit'];var _0x2866d6;if(_0x490b03>=_0x1e5ab4){_0x490b03=_0x1e5ab4;_0x2866d6=0xc8;}else{_0x2866d6=0xce;}_0x277751[_0xa9bf('0x23')](_0x2866d6);return _0x277751[_0xa9bf('0x29')](_0xa9bf('0x2a'),_0x1e3d71+'-'+_0x490b03+'/'+_0x1e5ab4)[_0xa9bf('0x24')](_0x32c7bc);}return null;};}function patchUpdates(_0x5e36d2){return function(_0x235404){try{jsonpatch[_0xa9bf('0x2b')](_0x235404,_0x5e36d2,!![]);}catch(_0x4b4ecb){return BPromise[_0xa9bf('0x2c')](_0x4b4ecb);}return _0x235404[_0xa9bf('0x2d')]();};}function saveUpdates(_0x50f433,_0x3e0c79){return function(_0x32730d){if(_0x32730d){return _0x32730d[_0xa9bf('0x2e')](_0x50f433)[_0xa9bf('0x2f')](function(_0x308919){return _0x308919;});}return null;};}function removeEntity(_0x29e77f,_0x301438){return function(_0x507f9e){if(_0x507f9e){return _0x507f9e['destroy']()[_0xa9bf('0x2f')](function(){var _0x2dcd8d=_0x507f9e[_0xa9bf('0x30')]({'plain':!![]});var _0x2a04a2=[{'name':_0xa9bf('0x31'),'value':_0xa9bf('0x32'),'ignore':![]},{'name':'QueueCampaigns','value':_0xa9bf('0x33'),'ignore':![]}];var _0x4b0ab5=_(_0x2a04a2)[_0xa9bf('0x34')](_0xa9bf('0x35'))['map'](_0xa9bf('0x36'))[_0xa9bf('0x36')]();if(_[_0xa9bf('0x37')](_0x4b0ab5,_0x2dcd8d[_0xa9bf('0x38')])){return;}var _0x1626a4=_[_0xa9bf('0x39')](_0x2a04a2,[_0xa9bf('0x36'),_0x2dcd8d[_0xa9bf('0x38')]])['name'];return db[_0xa9bf('0x3a')][_0xa9bf('0x3b')]({'where':{'type':_0x1626a4,'resourceId':_0x2dcd8d['id']}})['then'](function(){return _0x507f9e;});})['then'](function(){_0x29e77f['status'](0xcc)[_0xa9bf('0x22')]();});}};}function handleEntityNotFound(_0x2deb73,_0x4f42e8){return function(_0x487d92){if(!_0x487d92){_0x2deb73[_0xa9bf('0x21')](0x194);}return _0x487d92;};}function handleError(_0x1be952,_0xab7f8d){_0xab7f8d=_0xab7f8d||0x1f4;return function(_0x5e89f5){logger[_0xa9bf('0x3c')](_0x5e89f5[_0xa9bf('0x3d')]);if(_0x5e89f5[_0xa9bf('0x3e')]){delete _0x5e89f5[_0xa9bf('0x3e')];}_0x1be952[_0xa9bf('0x23')](_0xab7f8d)[_0xa9bf('0x3f')](_0x5e89f5);};}exports['index']=function(_0x25670d,_0x3ec33d){var _0x19f4b={},_0x597f4f={},_0x325b95={'count':0x0,'rows':[]};var _0x42a6d0=_['map'](db['VoiceQueue'][_0xa9bf('0x40')],function(_0x41c7b6){return{'name':_0x41c7b6[_0xa9bf('0x41')],'type':_0x41c7b6[_0xa9bf('0x38')]['key']};});_0x597f4f[_0xa9bf('0x42')]=_[_0xa9bf('0x43')](_0x42a6d0,_0xa9bf('0x3e'));_0x597f4f['query']=_['keys'](_0x25670d[_0xa9bf('0x44')]);_0x597f4f[_0xa9bf('0x45')]=_[_0xa9bf('0x46')](_0x597f4f[_0xa9bf('0x42')],_0x597f4f[_0xa9bf('0x44')]);_0x19f4b[_0xa9bf('0x47')]=_[_0xa9bf('0x46')](_0x597f4f[_0xa9bf('0x42')],qs[_0xa9bf('0x48')](_0x25670d[_0xa9bf('0x44')]['fields']));_0x19f4b[_0xa9bf('0x47')]=_0x19f4b[_0xa9bf('0x47')]['length']?_0x19f4b['attributes']:_0x597f4f[_0xa9bf('0x42')];if(!_0x25670d[_0xa9bf('0x44')][_0xa9bf('0x49')](_0xa9bf('0x4a'))){_0x19f4b[_0xa9bf('0x27')]=qs[_0xa9bf('0x27')](_0x25670d[_0xa9bf('0x44')][_0xa9bf('0x27')]);_0x19f4b['offset']=qs[_0xa9bf('0x25')](_0x25670d['query'][_0xa9bf('0x25')]);}_0x19f4b[_0xa9bf('0x4b')]=qs[_0xa9bf('0x4c')](_0x25670d[_0xa9bf('0x44')]['sort']);_0x19f4b[_0xa9bf('0x4d')]=qs[_0xa9bf('0x45')](_['pick'](_0x25670d[_0xa9bf('0x44')],_0x597f4f[_0xa9bf('0x45')]),_0x42a6d0);if(_0x25670d[_0xa9bf('0x44')][_0xa9bf('0x34')]){_0x19f4b[_0xa9bf('0x4d')]=_['merge'](_0x19f4b[_0xa9bf('0x4d')],{'$or':_[_0xa9bf('0x43')](_0x42a6d0,function(_0x112277){if(_0x112277['type']!=='VIRTUAL'){var _0x54dbc2={};_0x54dbc2[_0x112277['name']]={'$like':'%'+_0x25670d[_0xa9bf('0x44')]['filter']+'%'};return _0x54dbc2;}})});}_0x19f4b=_[_0xa9bf('0x4e')]({},_0x19f4b,_0x25670d['options']);var _0x3902d6={'where':_0x19f4b['where']};return db['VoiceQueue'][_0xa9bf('0x28')](_0x3902d6)['then'](function(_0x531787){_0x325b95['count']=_0x531787;if(_0x25670d[_0xa9bf('0x44')][_0xa9bf('0x4f')]){_0x19f4b[_0xa9bf('0x50')]=[{'all':!![]}];}return db[_0xa9bf('0x51')][_0xa9bf('0x52')](_0x19f4b);})[_0xa9bf('0x2f')](function(_0x489a1c){_0x325b95[_0xa9bf('0x53')]=_0x489a1c;return _0x325b95;})['then'](respondWithFilteredResult(_0x3ec33d,_0x19f4b))[_0xa9bf('0x54')](handleError(_0x3ec33d,null));};exports[_0xa9bf('0x55')]=function(_0x3f5980,_0x2e9371){var _0x2789f1={'raw':![],'where':{'id':_0x3f5980[_0xa9bf('0x56')]['id']}},_0x595b38={};_0x595b38[_0xa9bf('0x42')]=_['keys'](db['VoiceQueue'][_0xa9bf('0x40')]);_0x595b38[_0xa9bf('0x44')]=_[_0xa9bf('0x57')](_0x3f5980[_0xa9bf('0x44')]);_0x595b38[_0xa9bf('0x45')]=_[_0xa9bf('0x46')](_0x595b38['model'],_0x595b38[_0xa9bf('0x44')]);_0x2789f1['attributes']=_[_0xa9bf('0x46')](_0x595b38[_0xa9bf('0x42')],qs[_0xa9bf('0x48')](_0x3f5980[_0xa9bf('0x44')][_0xa9bf('0x48')]));_0x2789f1[_0xa9bf('0x47')]=_0x2789f1[_0xa9bf('0x47')][_0xa9bf('0x58')]?_0x2789f1['attributes']:_0x595b38[_0xa9bf('0x42')];if(_0x3f5980['query']['includeAll']){_0x2789f1[_0xa9bf('0x50')]=[{'all':!![]}];}_0x2789f1=_[_0xa9bf('0x4e')]({},_0x2789f1,_0x3f5980[_0xa9bf('0x59')]);return db[_0xa9bf('0x51')]['find'](_0x2789f1)[_0xa9bf('0x2f')](handleEntityNotFound(_0x2e9371,null))['then'](respondWithResult(_0x2e9371,null))['catch'](handleError(_0x2e9371,null));};exports[_0xa9bf('0x5a')]=function(_0x2eadf4,_0xb0b37){return db[_0xa9bf('0x51')][_0xa9bf('0x5a')](_0x2eadf4[_0xa9bf('0x5b')],{})[_0xa9bf('0x2f')](function(_0x38636f){var _0x2364a5=_0x2eadf4['user'][_0xa9bf('0x30')]({'plain':!![]});if(!_0x2364a5)throw new Error(_0xa9bf('0x5c'));if(_0x2364a5[_0xa9bf('0x5d')]===_0xa9bf('0x5e')){var _0x12ba63=_0x38636f[_0xa9bf('0x30')]({'plain':!![]});var _0x466850=[{'name':_0xa9bf('0x31'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xa9bf('0x33')}];var _0x5277ee=_[_0xa9bf('0x39')](_0x466850,['value',_0x12ba63[_0xa9bf('0x38')]])[_0xa9bf('0x3e')];return db[_0xa9bf('0x5f')][_0xa9bf('0x39')]({'where':{'name':_0x5277ee,'userProfileId':_0x2364a5[_0xa9bf('0x60')]},'raw':!![]})['then'](function(_0x3e2557){if(_0x3e2557&&_0x3e2557[_0xa9bf('0x61')]===0x0){return db['UserProfileResource'][_0xa9bf('0x5a')]({'name':_0x12ba63[_0xa9bf('0x3e')],'resourceId':_0x12ba63['id'],'type':_0x3e2557[_0xa9bf('0x3e')],'sectionId':_0x3e2557['id']},{})[_0xa9bf('0x2f')](function(){return _0x38636f;});}else{return _0x38636f;}})['catch'](function(_0x82176f){logger[_0xa9bf('0x3c')](_0xa9bf('0x62'),_0x82176f);throw _0x82176f;});}return _0x38636f;})['then'](respondWithResult(_0xb0b37,0xc9))[_0xa9bf('0x54')](handleError(_0xb0b37,null));};exports[_0xa9bf('0x63')]=function(_0x21b02d,_0x537c48){var _0x539df6={'where':{'id':_0x21b02d['params']['id']}},_0x5604ac={};_0x5604ac[_0xa9bf('0x42')]=_[_0xa9bf('0x57')](db[_0xa9bf('0x51')][_0xa9bf('0x40')]);_0x539df6[_0xa9bf('0x47')]=_[_0xa9bf('0x46')](_0x5604ac['model'],qs['fields'](_0x21b02d[_0xa9bf('0x44')]['fields']));_0x539df6[_0xa9bf('0x47')]=_0x539df6[_0xa9bf('0x47')][_0xa9bf('0x58')]?_0x539df6['attributes']:_0x5604ac['model'];if(_0x21b02d['query'][_0xa9bf('0x4f')]){_0x539df6['include']=[{'all':!![]}];}_0x539df6=_[_0xa9bf('0x4e')]({},_0x539df6,_0x21b02d[_0xa9bf('0x59')]);return db['VoiceQueue'][_0xa9bf('0x39')](_0x539df6)['then'](handleEntityNotFound(_0x537c48,null))[_0xa9bf('0x2f')](function(_0x585a28){if(_0x585a28){var _0x52189e=_0x585a28[_0xa9bf('0x30')]({'plain':!![]});_0x52189e=qs['omit'](_0x52189e,['id',_0xa9bf('0x64'),_0xa9bf('0x65')]);_0x21b02d[_0xa9bf('0x5b')]=_['omit'](_0x21b02d[_0xa9bf('0x5b')],['id','createdAt',_0xa9bf('0x65')]);return db['VoiceQueue'][_0xa9bf('0x5a')](_['merge'](_0x52189e,_0x21b02d[_0xa9bf('0x5b')]),{'include':_0x21b02d[_0xa9bf('0x44')][_0xa9bf('0x4f')]?[{'all':!![]}]:undefined})[_0xa9bf('0x2f')](function(_0x560eb7){var _0x3b1ab5=_0x21b02d[_0xa9bf('0x5e')][_0xa9bf('0x30')]({'plain':!![]});if(!_0x3b1ab5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b1ab5[_0xa9bf('0x5d')]===_0xa9bf('0x5e')){var _0x343e79=_0x560eb7[_0xa9bf('0x30')]({'plain':!![]});var _0x4a1e61=[{'name':'VoiceQueues','value':_0xa9bf('0x32')},{'name':_0xa9bf('0x66'),'value':_0xa9bf('0x33')}];var _0x5e42c9=_[_0xa9bf('0x39')](_0x4a1e61,[_0xa9bf('0x36'),_0x343e79['type']])['name'];return db[_0xa9bf('0x5f')][_0xa9bf('0x39')]({'where':{'name':_0x5e42c9,'userProfileId':_0x3b1ab5[_0xa9bf('0x60')]},'raw':!![]})[_0xa9bf('0x2f')](function(_0x32b41e){if(_0x32b41e&&_0x32b41e[_0xa9bf('0x61')]===0x0){return db[_0xa9bf('0x3a')]['create']({'name':_0x343e79[_0xa9bf('0x3e')],'resourceId':_0x343e79['id'],'type':_0x32b41e['name'],'sectionId':_0x32b41e['id']},{})['then'](function(){return _0x560eb7;});}else{return _0x560eb7;}})['catch'](function(_0x2167c9){logger['error'](_0xa9bf('0x62'),_0x2167c9);throw _0x2167c9;});}return _0x560eb7;});}})[_0xa9bf('0x2f')](respondWithResult(_0x537c48,0xc9))[_0xa9bf('0x54')](handleError(_0x537c48,null));};exports[_0xa9bf('0x2e')]=function(_0x352439,_0x2739c6){if(_0x352439['body']['id']){delete _0x352439[_0xa9bf('0x5b')]['id'];}return db[_0xa9bf('0x51')]['find']({'where':{'id':_0x352439[_0xa9bf('0x56')]['id']}})['then'](handleEntityNotFound(_0x2739c6,null))[_0xa9bf('0x2f')](saveUpdates(_0x352439[_0xa9bf('0x5b')],null))[_0xa9bf('0x2f')](respondWithResult(_0x2739c6,null))[_0xa9bf('0x54')](handleError(_0x2739c6,null));};exports[_0xa9bf('0x3b')]=function(_0x3c20f4,_0x387f0d){return db[_0xa9bf('0x51')]['find']({'where':{'id':_0x3c20f4[_0xa9bf('0x56')]['id']}})[_0xa9bf('0x2f')](handleEntityNotFound(_0x387f0d,null))['then'](removeEntity(_0x387f0d,null))[_0xa9bf('0x54')](handleError(_0x387f0d,null));};exports['getHoppers']=function(_0x4279fe,_0x3b4ae3,_0x15f635){var _0x74cfd={'raw':![],'where':{}};var _0x1f79e9={};var _0x39d22e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa9bf('0x67')]({'where':{'id':_0x4279fe[_0xa9bf('0x56')]['id']}})[_0xa9bf('0x2f')](handleEntityNotFound(_0x3b4ae3,null))['then'](function(_0x5152c6){if(_0x5152c6){_0x1f79e9[_0xa9bf('0x42')]=_[_0xa9bf('0x57')](db[_0xa9bf('0x68')][_0xa9bf('0x40')]);_0x1f79e9[_0xa9bf('0x44')]=_[_0xa9bf('0x57')](_0x4279fe['query']);_0x1f79e9[_0xa9bf('0x45')]=_['intersection'](_0x1f79e9[_0xa9bf('0x42')],_0x1f79e9[_0xa9bf('0x44')]);_0x74cfd['attributes']=_[_0xa9bf('0x46')](_0x1f79e9['model'],qs['fields'](_0x4279fe['query']['fields']));_0x74cfd['attributes']=_0x74cfd[_0xa9bf('0x47')]['length']?_0x74cfd[_0xa9bf('0x47')]:_0x1f79e9['model'];if(!_0x4279fe[_0xa9bf('0x44')]['hasOwnProperty'](_0xa9bf('0x4a'))){_0x74cfd[_0xa9bf('0x27')]=qs[_0xa9bf('0x27')](_0x4279fe[_0xa9bf('0x44')]['limit']);_0x74cfd[_0xa9bf('0x25')]=qs[_0xa9bf('0x25')](_0x4279fe[_0xa9bf('0x44')][_0xa9bf('0x25')]);}_0x74cfd['order']=qs[_0xa9bf('0x4c')](_0x4279fe[_0xa9bf('0x44')][_0xa9bf('0x4c')]);_0x74cfd[_0xa9bf('0x4d')]=qs[_0xa9bf('0x45')](_['pick'](_0x4279fe[_0xa9bf('0x44')],_0x1f79e9[_0xa9bf('0x45')]));_0x74cfd[_0xa9bf('0x4d')][_0xa9bf('0x69')]=_0x5152c6['id'];if(_0x4279fe[_0xa9bf('0x44')][_0xa9bf('0x34')]){_0x74cfd[_0xa9bf('0x4d')]=_['merge'](_0x74cfd[_0xa9bf('0x4d')],{'$or':_[_0xa9bf('0x43')](_0x74cfd['attributes'],function(_0x4fb793){var _0x3d6c69={};_0x3d6c69[_0x4fb793]={'$like':'%'+_0x4279fe[_0xa9bf('0x44')][_0xa9bf('0x34')]+'%'};return _0x3d6c69;})});}_0x74cfd=_[_0xa9bf('0x4e')]({},_0x74cfd,_0x4279fe[_0xa9bf('0x59')]);return db[_0xa9bf('0x68')][_0xa9bf('0x28')]({'where':_0x74cfd['where']})[_0xa9bf('0x2f')](function(_0x5dcc4c){_0x39d22e[_0xa9bf('0x28')]=_0x5dcc4c;if(_0x4279fe[_0xa9bf('0x44')][_0xa9bf('0x4f')]){_0x74cfd[_0xa9bf('0x50')]=[{'all':!![]}];}return db['CmHopper'][_0xa9bf('0x52')](_0x74cfd);})[_0xa9bf('0x2f')](function(_0x3f8fa8){_0x39d22e[_0xa9bf('0x53')]=_0x3f8fa8;return _0x39d22e;});}})['then'](respondWithFilteredResult(_0x3b4ae3,_0x74cfd))[_0xa9bf('0x54')](handleError(_0x3b4ae3,null));};exports['getHopperHistories']=function(_0x8a8ac8,_0x303468,_0x50414a){var _0x3a11e1={'raw':!![],'where':{}};var _0x2823d3={};var _0x2ce2dc={'count':0x0,'rows':[]};return db[_0xa9bf('0x51')][_0xa9bf('0x67')]({'where':{'id':_0x8a8ac8['params']['id']}})[_0xa9bf('0x2f')](handleEntityNotFound(_0x303468,null))['then'](function(_0x3fdb8a){if(_0x3fdb8a){_0x2823d3[_0xa9bf('0x42')]=_[_0xa9bf('0x57')](db[_0xa9bf('0x6a')][_0xa9bf('0x40')]);_0x2823d3[_0xa9bf('0x44')]=_[_0xa9bf('0x57')](_0x8a8ac8[_0xa9bf('0x44')]);_0x2823d3[_0xa9bf('0x45')]=_[_0xa9bf('0x46')](_0x2823d3[_0xa9bf('0x42')],_0x2823d3[_0xa9bf('0x44')]);_0x3a11e1[_0xa9bf('0x47')]=_['intersection'](_0x2823d3[_0xa9bf('0x42')],qs[_0xa9bf('0x48')](_0x8a8ac8[_0xa9bf('0x44')][_0xa9bf('0x48')]));_0x3a11e1[_0xa9bf('0x47')]=_0x3a11e1[_0xa9bf('0x47')][_0xa9bf('0x58')]?_0x3a11e1[_0xa9bf('0x47')]:_0x2823d3[_0xa9bf('0x42')];if(!_0x8a8ac8[_0xa9bf('0x44')][_0xa9bf('0x49')](_0xa9bf('0x4a'))){_0x3a11e1['limit']=qs[_0xa9bf('0x27')](_0x8a8ac8[_0xa9bf('0x44')][_0xa9bf('0x27')]);_0x3a11e1[_0xa9bf('0x25')]=qs['offset'](_0x8a8ac8[_0xa9bf('0x44')][_0xa9bf('0x25')]);}_0x3a11e1[_0xa9bf('0x4b')]=qs['sort'](_0x8a8ac8[_0xa9bf('0x44')][_0xa9bf('0x4c')]);_0x3a11e1[_0xa9bf('0x4d')]=qs[_0xa9bf('0x45')](_[_0xa9bf('0x6b')](_0x8a8ac8['query'],_0x2823d3['filters']));_0x3a11e1[_0xa9bf('0x4d')][_0xa9bf('0x69')]=_0x3fdb8a['id'];if(_0x8a8ac8[_0xa9bf('0x44')][_0xa9bf('0x34')]){_0x3a11e1[_0xa9bf('0x4d')]=_[_0xa9bf('0x4e')](_0x3a11e1['where'],{'$or':_[_0xa9bf('0x43')](_0x3a11e1[_0xa9bf('0x47')],function(_0x7c90d6){var _0x984dd8={};_0x984dd8[_0x7c90d6]={'$like':'%'+_0x8a8ac8[_0xa9bf('0x44')][_0xa9bf('0x34')]+'%'};return _0x984dd8;})});}_0x3a11e1=_[_0xa9bf('0x4e')]({},_0x3a11e1,_0x8a8ac8[_0xa9bf('0x59')]);return db[_0xa9bf('0x6a')][_0xa9bf('0x28')]({'where':_0x3a11e1[_0xa9bf('0x4d')]})[_0xa9bf('0x2f')](function(_0x508a30){_0x2ce2dc[_0xa9bf('0x28')]=_0x508a30;if(_0x8a8ac8[_0xa9bf('0x44')][_0xa9bf('0x4f')]){_0x3a11e1[_0xa9bf('0x50')]=[{'all':!![]}];}return db[_0xa9bf('0x6a')][_0xa9bf('0x52')](_0x3a11e1);})[_0xa9bf('0x2f')](function(_0x11b6f3){_0x2ce2dc[_0xa9bf('0x53')]=_0x11b6f3;return _0x2ce2dc;});}})[_0xa9bf('0x2f')](respondWithFilteredResult(_0x303468,_0x3a11e1))[_0xa9bf('0x54')](handleError(_0x303468,null));};exports[_0xa9bf('0x6c')]=function(_0x54ae13,_0x3ccf20,_0xc6b3d7){var _0x342112={'raw':!![],'where':{}};var _0x28494a={};var _0x45f839={'count':0x0,'rows':[]};return db[_0xa9bf('0x51')][_0xa9bf('0x67')]({'where':{'id':_0x54ae13[_0xa9bf('0x56')]['id']}})[_0xa9bf('0x2f')](handleEntityNotFound(_0x3ccf20,null))[_0xa9bf('0x2f')](function(_0x10ec47){if(_0x10ec47){_0x28494a[_0xa9bf('0x42')]=_[_0xa9bf('0x57')](db[_0xa9bf('0x6d')][_0xa9bf('0x40')]);_0x28494a['query']=_[_0xa9bf('0x57')](_0x54ae13[_0xa9bf('0x44')]);_0x28494a[_0xa9bf('0x45')]=_[_0xa9bf('0x46')](_0x28494a[_0xa9bf('0x42')],_0x28494a[_0xa9bf('0x44')]);_0x342112[_0xa9bf('0x47')]=_[_0xa9bf('0x46')](_0x28494a[_0xa9bf('0x42')],qs[_0xa9bf('0x48')](_0x54ae13[_0xa9bf('0x44')][_0xa9bf('0x48')]));_0x342112['attributes']=_0x342112[_0xa9bf('0x47')][_0xa9bf('0x58')]?_0x342112[_0xa9bf('0x47')]:_0x28494a[_0xa9bf('0x42')];if(!_0x54ae13[_0xa9bf('0x44')][_0xa9bf('0x49')](_0xa9bf('0x4a'))){_0x342112[_0xa9bf('0x27')]=qs['limit'](_0x54ae13[_0xa9bf('0x44')][_0xa9bf('0x27')]);_0x342112[_0xa9bf('0x25')]=qs['offset'](_0x54ae13[_0xa9bf('0x44')][_0xa9bf('0x25')]);}_0x342112[_0xa9bf('0x4b')]=qs[_0xa9bf('0x4c')](_0x54ae13['query'][_0xa9bf('0x4c')]);_0x342112[_0xa9bf('0x4d')]=qs[_0xa9bf('0x45')](_[_0xa9bf('0x6b')](_0x54ae13[_0xa9bf('0x44')],_0x28494a[_0xa9bf('0x45')]));_0x342112[_0xa9bf('0x4d')][_0xa9bf('0x69')]=_0x10ec47['id'];if(_0x54ae13[_0xa9bf('0x44')]['filter']){_0x342112[_0xa9bf('0x4d')]=_[_0xa9bf('0x4e')](_0x342112[_0xa9bf('0x4d')],{'$or':_['map'](_0x342112['attributes'],function(_0xe252fc){var _0x3f9847={};_0x3f9847[_0xe252fc]={'$like':'%'+_0x54ae13[_0xa9bf('0x44')][_0xa9bf('0x34')]+'%'};return _0x3f9847;})});}_0x342112=_[_0xa9bf('0x4e')]({},_0x342112,_0x54ae13[_0xa9bf('0x59')]);return db[_0xa9bf('0x6d')][_0xa9bf('0x28')]({'where':_0x342112[_0xa9bf('0x4d')]})['then'](function(_0x20443f){_0x45f839[_0xa9bf('0x28')]=_0x20443f;if(_0x54ae13['query'][_0xa9bf('0x4f')]){_0x342112['include']=[{'all':!![]}];}return db[_0xa9bf('0x6d')][_0xa9bf('0x52')](_0x342112);})[_0xa9bf('0x2f')](function(_0x49516d){_0x45f839[_0xa9bf('0x53')]=_0x49516d;return _0x45f839;});}})[_0xa9bf('0x2f')](respondWithFilteredResult(_0x3ccf20,_0x342112))[_0xa9bf('0x54')](handleError(_0x3ccf20,null));};exports[_0xa9bf('0x6e')]=function(_0x89648d,_0x43df3b,_0x2fee9e){var _0x58ef53={'raw':!![],'where':{}};var _0x545a94={};var _0x49965b={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa9bf('0x67')]({'where':{'id':_0x89648d['params']['id']}})[_0xa9bf('0x2f')](handleEntityNotFound(_0x43df3b,null))[_0xa9bf('0x2f')](function(_0x5c524b){if(_0x5c524b){_0x545a94[_0xa9bf('0x42')]=_[_0xa9bf('0x57')](db[_0xa9bf('0x6f')]['rawAttributes']);_0x545a94[_0xa9bf('0x44')]=_['keys'](_0x89648d[_0xa9bf('0x44')]);_0x545a94['filters']=_[_0xa9bf('0x46')](_0x545a94[_0xa9bf('0x42')],_0x545a94[_0xa9bf('0x44')]);_0x58ef53[_0xa9bf('0x47')]=_[_0xa9bf('0x46')](_0x545a94[_0xa9bf('0x42')],qs[_0xa9bf('0x48')](_0x89648d[_0xa9bf('0x44')][_0xa9bf('0x48')]));_0x58ef53['attributes']=_0x58ef53['attributes'][_0xa9bf('0x58')]?_0x58ef53[_0xa9bf('0x47')]:_0x545a94[_0xa9bf('0x42')];if(!_0x89648d[_0xa9bf('0x44')][_0xa9bf('0x49')](_0xa9bf('0x4a'))){_0x58ef53[_0xa9bf('0x27')]=qs[_0xa9bf('0x27')](_0x89648d['query'][_0xa9bf('0x27')]);_0x58ef53[_0xa9bf('0x25')]=qs['offset'](_0x89648d['query'][_0xa9bf('0x25')]);}_0x58ef53[_0xa9bf('0x4b')]=qs[_0xa9bf('0x4c')](_0x89648d['query'][_0xa9bf('0x4c')]);_0x58ef53[_0xa9bf('0x4d')]=qs[_0xa9bf('0x45')](_['pick'](_0x89648d['query'],_0x545a94['filters']));_0x58ef53['where'][_0xa9bf('0x69')]=_0x5c524b['id'];if(_0x89648d[_0xa9bf('0x44')][_0xa9bf('0x34')]){_0x58ef53[_0xa9bf('0x4d')]=_[_0xa9bf('0x4e')](_0x58ef53[_0xa9bf('0x4d')],{'$or':_[_0xa9bf('0x43')](_0x58ef53[_0xa9bf('0x47')],function(_0x1e56a8){var _0x1d5819={};_0x1d5819[_0x1e56a8]={'$like':'%'+_0x89648d[_0xa9bf('0x44')]['filter']+'%'};return _0x1d5819;})});}_0x58ef53=_['merge']({},_0x58ef53,_0x89648d[_0xa9bf('0x59')]);return db[_0xa9bf('0x6f')][_0xa9bf('0x28')]({'where':_0x58ef53[_0xa9bf('0x4d')]})[_0xa9bf('0x2f')](function(_0x4e5030){_0x49965b['count']=_0x4e5030;if(_0x89648d[_0xa9bf('0x44')]['includeAll']){_0x58ef53[_0xa9bf('0x50')]=[{'all':!![]}];}return db[_0xa9bf('0x6f')][_0xa9bf('0x52')](_0x58ef53);})[_0xa9bf('0x2f')](function(_0x12b106){_0x49965b['rows']=_0x12b106;return _0x49965b;});}})[_0xa9bf('0x2f')](respondWithFilteredResult(_0x43df3b,_0x58ef53))[_0xa9bf('0x54')](handleError(_0x43df3b,null));};exports['getTeams']=function(_0x237988,_0x32b410,_0x3c88bc){var _0x533500={};var _0x52996a={};var _0x5f17ac;var _0x15df01;return db[_0xa9bf('0x51')][_0xa9bf('0x67')]({'where':{'id':_0x237988[_0xa9bf('0x56')]['id']}})[_0xa9bf('0x2f')](handleEntityNotFound(_0x32b410,null))['then'](function(_0xd54fb6){if(_0xd54fb6){_0x5f17ac=_0xd54fb6;_0x52996a[_0xa9bf('0x42')]=_[_0xa9bf('0x57')](db['Team']['rawAttributes']);_0x52996a[_0xa9bf('0x44')]=_[_0xa9bf('0x57')](_0x237988[_0xa9bf('0x44')]);_0x52996a[_0xa9bf('0x45')]=_[_0xa9bf('0x46')](_0x52996a[_0xa9bf('0x42')],_0x52996a[_0xa9bf('0x44')]);_0x533500['attributes']=_[_0xa9bf('0x46')](_0x52996a['model'],qs[_0xa9bf('0x48')](_0x237988[_0xa9bf('0x44')][_0xa9bf('0x48')]));_0x533500['attributes']=_0x533500['attributes'][_0xa9bf('0x58')]?_0x533500[_0xa9bf('0x47')]:_0x52996a[_0xa9bf('0x42')];_0x533500[_0xa9bf('0x4b')]=qs['sort'](_0x237988['query'][_0xa9bf('0x4c')]);_0x533500[_0xa9bf('0x4d')]=qs[_0xa9bf('0x45')](_[_0xa9bf('0x6b')](_0x237988[_0xa9bf('0x44')],_0x52996a['filters']));if(_0x237988['query'][_0xa9bf('0x34')]){_0x533500[_0xa9bf('0x4d')]=_[_0xa9bf('0x4e')](_0x533500['where'],{'$or':_[_0xa9bf('0x43')](_0x533500['attributes'],function(_0x4f292a){var _0x2e7287={};_0x2e7287[_0x4f292a]={'$like':'%'+_0x237988[_0xa9bf('0x44')][_0xa9bf('0x34')]+'%'};return _0x2e7287;})});}_0x533500=_[_0xa9bf('0x4e')]({},_0x533500,_0x237988[_0xa9bf('0x59')]);return _0x5f17ac[_0xa9bf('0x70')](_0x533500);}})['then'](function(_0x3b1716){if(_0x3b1716){_0x15df01=_0x3b1716['length'];if(!_0x237988['query'][_0xa9bf('0x49')](_0xa9bf('0x4a'))){_0x533500[_0xa9bf('0x27')]=qs[_0xa9bf('0x27')](_0x237988[_0xa9bf('0x44')]['limit']);_0x533500[_0xa9bf('0x25')]=qs[_0xa9bf('0x25')](_0x237988[_0xa9bf('0x44')][_0xa9bf('0x25')]);}return _0x5f17ac[_0xa9bf('0x70')](_0x533500);}})['then'](function(_0x38d687){if(_0x38d687){return _0x38d687?{'count':_0x15df01,'rows':_0x38d687}:null;}})[_0xa9bf('0x2f')](respondWithResult(_0x32b410,null))[_0xa9bf('0x54')](handleError(_0x32b410,null));};exports['addTeams']=function(_0x59adcf,_0x465b2d,_0x38f11b){var _0x5fd560=_0x59adcf[_0xa9bf('0x5b')]['teams'];var _0x2f2b69=_[_0xa9bf('0x43')](_0x5fd560,'id');return db[_0xa9bf('0x71')]['findAll']({'where':{'id':_0x2f2b69},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa9bf('0x72'),'attributes':['id',_0xa9bf('0x3e'),_0xa9bf('0x73'),_0xa9bf('0x74'),'interface'],'raw':!![]}]})['then'](function(_0x4efdaf){if(_0x4efdaf){var _0x22d1d8=_['flatMap'](_0x4efdaf,function(_0x31475b){var _0x2ca05c=_0x31475b[_0xa9bf('0x30')]({'plain':!![]});_0x2ca05c['Agents']['forEach'](function(_0x292671){_0x292671[_0xa9bf('0x75')]=_['find'](_0x5fd560,{'id':_0x2ca05c['id']})[_0xa9bf('0x75')];});return _0x2ca05c[_0xa9bf('0x72')];});return db[_0xa9bf('0x51')][_0xa9bf('0x39')]({'where':{'id':_0x59adcf['params']['id']}})[_0xa9bf('0x2f')](function(_0x19e499){return db['sequelize'][_0xa9bf('0x76')](function(_0x181a98){return _0x19e499['addTeams'](_0x2f2b69,{'transaction':_0x181a98})['then'](function(){return BPromise[_0xa9bf('0x77')](_0x5fd560,function(_0x496220){return db['TeamVoiceQueue'][_0xa9bf('0x78')]({'TeamId':_0x496220['id'],'VoiceQueueId':_0x59adcf[_0xa9bf('0x56')]['id'],'penalty':_0x496220[_0xa9bf('0x75')]},{'transaction':_0x181a98});});})[_0xa9bf('0x2f')](function(){return BPromise[_0xa9bf('0x77')](_0x22d1d8,function(_0x417b98){return db[_0xa9bf('0x79')][_0xa9bf('0x7a')]({'where':{'UserId':_0x417b98['id'],'VoiceQueueId':_0x59adcf['params']['id']},'defaults':{'penalty':_0x417b98[_0xa9bf('0x75')]},'transaction':_0x181a98});});})[_0xa9bf('0x2f')](function(){return BPromise[_0xa9bf('0x77')](_[_0xa9bf('0x34')](_0x22d1d8,{'online':!![]}),function(_0x2db787){return db[_0xa9bf('0x7b')][_0xa9bf('0x78')]({'membername':_0x2db787[_0xa9bf('0x3e')],'UserId':_0x2db787['id'],'queue_name':_0x19e499[_0xa9bf('0x3e')],'VoiceQueueId':_0x19e499['id'],'interface':_[_0xa9bf('0x7c')](_0x2db787['interface'])?util[_0xa9bf('0x7d')](_0xa9bf('0x7e'),_0x2db787['name']):_0x2db787[_0xa9bf('0x7f')],'paused':_0x2db787[_0xa9bf('0x74')]||![],'penalty':_0x2db787['penalty']},{'transaction':_0x181a98});});})[_0xa9bf('0x2f')](function(){_0x22d1d8['forEach'](function(_0x33cee8){socket[_0xa9bf('0x80')]('userVoiceQueue:save',{'UserId':_0x33cee8['id'],'VoiceQueueId':_0x19e499['id']});});});});});}})['then'](respondWithStatusCode(_0x465b2d,null))[_0xa9bf('0x54')](handleError(_0x465b2d,null));};exports[_0xa9bf('0x81')]=function(_0x12ab03,_0x3f2697,_0x18a414){return db['Team'][_0xa9bf('0x52')]({'where':{'id':_0x12ab03[_0xa9bf('0x44')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa9bf('0x82')],'as':_0xa9bf('0x72'),'attributes':['id'],'raw':!![]}]})[_0xa9bf('0x2f')](handleEntityNotFound(_0x3f2697,null))[_0xa9bf('0x2f')](function(_0xd28589){var _0x43fbca=_['map'](_0xd28589,'id');var _0x25b2dc=[];var _0x2343aa=[];var _0x132457=squel[_0xa9bf('0x83')]();_0x132457[_0xa9bf('0x84')](_0xa9bf('0x85'))[_0xa9bf('0x86')](_0xa9bf('0x87'),'tq')[_0xa9bf('0x88')](_0xa9bf('0x89'),'ut',_0xa9bf('0x8a'))[_0xa9bf('0x4d')]('VoiceQueueId\x20=\x20?',_0x12ab03[_0xa9bf('0x56')]['id']);for(var _0x14ad30=0x0;_0x14ad30<_0xd28589['length'];_0x14ad30+=0x1){let _0x5b0429=_0xd28589[_0x14ad30];for(var _0x244cc0=0x0;_0x244cc0<_0x5b0429[_0xa9bf('0x72')][_0xa9bf('0x58')];_0x244cc0+=0x1){let _0x2510b7=_0x5b0429['Agents'][_0x244cc0];var _0x4672f9=_0x132457[_0xa9bf('0x63')]();_0x4672f9[_0xa9bf('0x4d')]('ut.UserId\x20=\x20?',_0x2510b7['id']);_0x2343aa['push'](db['sequelize'][_0xa9bf('0x44')](_0x4672f9[_0xa9bf('0x8b')](),{'type':db[_0xa9bf('0x8c')]['QueryTypes']['SELECT']})['then'](function(_0x131363){if(_0x131363[_0xa9bf('0x58')]===0x1){return _0x2510b7['id'];}else{var _0x3bda45=_[_0xa9bf('0x8d')](_[_0xa9bf('0x43')](_0x131363,_0xa9bf('0x8e')),function(_0x5f4c9c){return _[_0xa9bf('0x37')](_0x43fbca,_0x5f4c9c);});if(_0x3bda45){return _0x2510b7['id'];}}}));}}return BPromise['all'](_0x2343aa)[_0xa9bf('0x2f')](function(_0x5b4f7b){_0x25b2dc=_(_0x25b2dc)['union'](_0x5b4f7b)[_0xa9bf('0x8f')]()['value']();return db[_0xa9bf('0x51')][_0xa9bf('0x39')]({'where':{'id':_0x12ab03['params']['id']}})['then'](function(_0x500329){return db[_0xa9bf('0x8c')]['transaction'](function(_0x471b91){return _0x500329[_0xa9bf('0x81')](_0x12ab03[_0xa9bf('0x44')][_0xa9bf('0x90')],{'transaction':_0x471b91})['then'](function(){if(!_[_0xa9bf('0x91')](_0x25b2dc)){return _0x500329[_0xa9bf('0x92')](_0x25b2dc,{'transaction':_0x471b91})[_0xa9bf('0x2f')](function(){return db[_0xa9bf('0x7b')]['destroy']({'where':{'VoiceQueueId':_0x12ab03[_0xa9bf('0x56')]['id'],'UserId':_0x25b2dc},'transaction':_0x471b91});});}})[_0xa9bf('0x2f')](function(){_0x25b2dc[_0xa9bf('0x93')](function(_0x2a54db){socket[_0xa9bf('0x80')](_0xa9bf('0x94'),{'UserId':_0x2a54db,'VoiceQueueId':_0x500329['id']});});});});});});})['then'](respondWithStatusCode(_0x3f2697,null))['catch'](handleError(_0x3f2697,null));};exports[_0xa9bf('0x95')]=function(_0x1083f7,_0x35ae6d,_0x2a9558){var _0x3f1163,_0x33203b;return db[_0xa9bf('0x51')][_0xa9bf('0x39')]({'where':{'id':_0x1083f7[_0xa9bf('0x56')]['id']}})['then'](handleEntityNotFound(_0x35ae6d,null))['then'](function(_0x22ec48){if(_0x22ec48){_0x33203b=_0x22ec48;return _0x22ec48['addAgents'](_0x1083f7[_0xa9bf('0x5b')][_0xa9bf('0x90')],_[_0xa9bf('0x96')](_0x1083f7[_0xa9bf('0x5b')],[_0xa9bf('0x90'),'id'])||{})[_0xa9bf('0x97')](function(_0x42998d){for(var _0x59224f=0x0;_0x59224f<_0x1083f7[_0xa9bf('0x5b')][_0xa9bf('0x90')][_0xa9bf('0x58')];_0x59224f+=0x1){socket[_0xa9bf('0x80')](_0xa9bf('0x98'),{'UserId':Number(_0x1083f7[_0xa9bf('0x5b')]['ids'][_0x59224f]),'VoiceQueueId':Number(_0x1083f7[_0xa9bf('0x56')]['id'])});}return _0x42998d;});}})[_0xa9bf('0x2f')](function(_0x4736fb){_0x3f1163=_0x4736fb||[];if(_0x33203b){return db['User'][_0xa9bf('0x52')]({'where':{'id':_0x1083f7[_0xa9bf('0x5b')][_0xa9bf('0x90')]},'attributes':['id','name','online',_0xa9bf('0x74'),_0xa9bf('0x7f')],'raw':!![]});}})[_0xa9bf('0x2f')](function(_0x5a09dc){if(!_[_0xa9bf('0x91')](_0x5a09dc)){var _0x56a1c9=[];for(var _0x4a3b59=0x0;_0x4a3b59<_0x5a09dc[_0xa9bf('0x58')];_0x4a3b59++){if(_0x5a09dc[_0x4a3b59][_0xa9bf('0x73')]){_0x56a1c9[_0xa9bf('0x99')](db[_0xa9bf('0x7b')][_0xa9bf('0x78')]({'membername':_0x5a09dc[_0x4a3b59][_0xa9bf('0x3e')],'UserId':_0x5a09dc[_0x4a3b59]['id'],'queue_name':_0x33203b[_0xa9bf('0x3e')],'VoiceQueueId':_0x33203b['id'],'interface':_['isNil'](_0x5a09dc[_0x4a3b59][_0xa9bf('0x7f')])?util['format']('SIP/%s',_0x5a09dc[_0x4a3b59]['name']):_0x5a09dc[_0x4a3b59][_0xa9bf('0x7f')],'paused':_0x5a09dc[_0x4a3b59][_0xa9bf('0x74')]||![],'penalty':_0x1083f7['body']['penalty']||0x0}));}}return BPromise[_0xa9bf('0x9a')](_0x56a1c9);}})['then'](function(){return _0x3f1163;})[_0xa9bf('0x2f')](respondWithResult(_0x35ae6d,null))['catch'](handleError(_0x35ae6d,null));};exports[_0xa9bf('0x92')]=function(_0x37001e,_0x4f772e,_0x40d6c3){return db['VoiceQueue']['find']({'where':{'id':_0x37001e[_0xa9bf('0x56')]['id']}})[_0xa9bf('0x2f')](handleEntityNotFound(_0x4f772e,null))[_0xa9bf('0x2f')](function(_0x3c1474){if(_0x3c1474){return _0x3c1474[_0xa9bf('0x92')](_0x37001e[_0xa9bf('0x44')]['ids'])[_0xa9bf('0x2f')](function(){if(_[_0xa9bf('0x9b')](_0x37001e[_0xa9bf('0x44')][_0xa9bf('0x90')])){for(var _0x26cb8b=0x0;_0x26cb8b<_0x37001e[_0xa9bf('0x44')][_0xa9bf('0x90')]['length'];_0x26cb8b+=0x1){socket['emit'](_0xa9bf('0x94'),{'UserId':Number(_0x37001e['query']['ids'][_0x26cb8b]),'VoiceQueueId':Number(_0x37001e[_0xa9bf('0x56')]['id'])});}}else{socket[_0xa9bf('0x80')]('userVoiceQueue:remove',{'UserId':Number(_0x37001e['query'][_0xa9bf('0x90')]),'VoiceQueueId':Number(_0x37001e['params']['id'])});}});}})['then'](function(_0x57bf14){return db['UserVoiceQueueRt'][_0xa9bf('0x3b')]({'where':{'VoiceQueueId':_0x37001e[_0xa9bf('0x56')]['id'],'UserId':_0x37001e[_0xa9bf('0x44')][_0xa9bf('0x90')]}})['then'](function(){return _0x57bf14;});})[_0xa9bf('0x2f')](respondWithStatusCode(_0x4f772e,null))[_0xa9bf('0x54')](handleError(_0x4f772e,null));};exports[_0xa9bf('0x9c')]=function(_0x2e32ed,_0x46ab8d,_0x127aab){var _0x114a4c={};var _0xa3492c={};var _0x129a1e;var _0xc81547;return db[_0xa9bf('0x51')][_0xa9bf('0x67')]({'where':{'id':_0x2e32ed['params']['id']}})[_0xa9bf('0x2f')](handleEntityNotFound(_0x46ab8d,null))[_0xa9bf('0x2f')](function(_0x41dafa){if(_0x41dafa){_0x129a1e=_0x41dafa;_0xa3492c[_0xa9bf('0x42')]=_[_0xa9bf('0x57')](db[_0xa9bf('0x82')][_0xa9bf('0x40')]);_0xa3492c[_0xa9bf('0x44')]=_[_0xa9bf('0x57')](_0x2e32ed[_0xa9bf('0x44')]);_0xa3492c[_0xa9bf('0x45')]=_[_0xa9bf('0x46')](_0xa3492c[_0xa9bf('0x42')],_0xa3492c[_0xa9bf('0x44')]);_0x114a4c[_0xa9bf('0x47')]=_[_0xa9bf('0x46')](_0xa3492c[_0xa9bf('0x42')],qs[_0xa9bf('0x48')](_0x2e32ed[_0xa9bf('0x44')]['fields']));_0x114a4c[_0xa9bf('0x47')]=_0x114a4c[_0xa9bf('0x47')][_0xa9bf('0x58')]?_0x114a4c[_0xa9bf('0x47')]:_0xa3492c[_0xa9bf('0x42')];_0x114a4c[_0xa9bf('0x4b')]=qs[_0xa9bf('0x4c')](_0x2e32ed[_0xa9bf('0x44')][_0xa9bf('0x4c')]);_0x114a4c['where']=qs[_0xa9bf('0x45')](_[_0xa9bf('0x6b')](_0x2e32ed[_0xa9bf('0x44')],_0xa3492c['filters']));if(_0x2e32ed[_0xa9bf('0x44')][_0xa9bf('0x34')]){_0x114a4c['where']=_[_0xa9bf('0x4e')](_0x114a4c[_0xa9bf('0x4d')],{'$or':_[_0xa9bf('0x43')](_0x114a4c[_0xa9bf('0x47')],function(_0x2a27b1){var _0x23ac10={};_0x23ac10[_0x2a27b1]={'$like':'%'+_0x2e32ed[_0xa9bf('0x44')][_0xa9bf('0x34')]+'%'};return _0x23ac10;})});}_0x114a4c=_[_0xa9bf('0x4e')]({},_0x114a4c,_0x2e32ed[_0xa9bf('0x59')]);return _0x129a1e['getAgents'](_0x114a4c);}})[_0xa9bf('0x2f')](function(_0x5f4f67){if(_0x5f4f67){_0xc81547=_0x5f4f67[_0xa9bf('0x58')];if(!_0x2e32ed[_0xa9bf('0x44')][_0xa9bf('0x49')](_0xa9bf('0x4a'))){_0x114a4c[_0xa9bf('0x27')]=qs['limit'](_0x2e32ed['query'][_0xa9bf('0x27')]);_0x114a4c['offset']=qs[_0xa9bf('0x25')](_0x2e32ed[_0xa9bf('0x44')][_0xa9bf('0x25')]);}return _0x129a1e[_0xa9bf('0x9c')](_0x114a4c);}})[_0xa9bf('0x2f')](function(_0x28c6c6){if(_0x28c6c6){return _0x28c6c6?{'count':_0xc81547,'rows':_0x28c6c6}:null;}})[_0xa9bf('0x2f')](respondWithResult(_0x46ab8d,null))[_0xa9bf('0x54')](handleError(_0x46ab8d,null));};exports[_0xa9bf('0x9d')]=function(_0x489728,_0x4df23c,_0x298d43){var _0x4581c7={};var _0xf811b5={};var _0x1166c4;var _0x18c702;return db[_0xa9bf('0x51')][_0xa9bf('0x67')]({'where':{'id':_0x489728['params']['id']}})[_0xa9bf('0x2f')](handleEntityNotFound(_0x4df23c,null))['then'](function(_0x2a17db){if(_0x2a17db){_0x1166c4=_0x2a17db;_0xf811b5[_0xa9bf('0x42')]=_[_0xa9bf('0x57')](db[_0xa9bf('0x7b')][_0xa9bf('0x40')]);_0xf811b5[_0xa9bf('0x44')]=_[_0xa9bf('0x57')](_0x489728['query']);_0xf811b5[_0xa9bf('0x45')]=_[_0xa9bf('0x46')](_0xf811b5[_0xa9bf('0x42')],_0xf811b5[_0xa9bf('0x44')]);_0x4581c7[_0xa9bf('0x47')]=_[_0xa9bf('0x46')](_0xf811b5[_0xa9bf('0x42')],qs[_0xa9bf('0x48')](_0x489728[_0xa9bf('0x44')][_0xa9bf('0x48')]));_0x4581c7[_0xa9bf('0x47')]=_0x4581c7['attributes'][_0xa9bf('0x58')]?_0x4581c7[_0xa9bf('0x47')]:_0xf811b5[_0xa9bf('0x42')];_0x4581c7[_0xa9bf('0x4b')]=qs['sort'](_0x489728['query'][_0xa9bf('0x4c')]);_0x4581c7['where']=qs[_0xa9bf('0x45')](_[_0xa9bf('0x6b')](_0x489728[_0xa9bf('0x44')],_0xf811b5['filters']));if(_0x489728[_0xa9bf('0x44')][_0xa9bf('0x34')]){_0x4581c7[_0xa9bf('0x4d')]=_[_0xa9bf('0x4e')](_0x4581c7[_0xa9bf('0x4d')],{'$or':_[_0xa9bf('0x43')](_0x4581c7[_0xa9bf('0x47')],function(_0x473deb){var _0x39d3e7={};_0x39d3e7[_0x473deb]={'$like':'%'+_0x489728[_0xa9bf('0x44')][_0xa9bf('0x34')]+'%'};return _0x39d3e7;})});}_0x4581c7=_[_0xa9bf('0x4e')]({},_0x4581c7,_0x489728[_0xa9bf('0x59')]);return _0x1166c4[_0xa9bf('0x9d')](_0x4581c7);}})[_0xa9bf('0x2f')](function(_0x124789){if(_0x124789){_0x18c702=_0x124789[_0xa9bf('0x58')];if(!_0x489728[_0xa9bf('0x44')]['hasOwnProperty'](_0xa9bf('0x4a'))){_0x4581c7['limit']=qs['limit'](_0x489728[_0xa9bf('0x44')][_0xa9bf('0x27')]);_0x4581c7[_0xa9bf('0x25')]=qs['offset'](_0x489728[_0xa9bf('0x44')][_0xa9bf('0x25')]);}return _0x1166c4[_0xa9bf('0x9d')](_0x4581c7);}})[_0xa9bf('0x2f')](function(_0x791640){return _0x791640?{'count':_0x18c702,'rows':_0x791640}:null;})['then'](respondWithResult(_0x4df23c,null))[_0xa9bf('0x54')](handleError(_0x4df23c,null));};exports['getLists']=function(_0x51632d,_0x2074ca,_0x399316){var _0x3e8854={};var _0x514ce8={};var _0x251134;var _0x3a4554;return db[_0xa9bf('0x51')]['findOne']({'where':{'id':_0x51632d[_0xa9bf('0x56')]['id']}})['then'](handleEntityNotFound(_0x2074ca,null))[_0xa9bf('0x2f')](function(_0x1dfe4a){if(_0x1dfe4a){_0x251134=_0x1dfe4a;_0x514ce8[_0xa9bf('0x42')]=_[_0xa9bf('0x57')](db[_0xa9bf('0x9e')][_0xa9bf('0x40')]);_0x514ce8[_0xa9bf('0x44')]=_[_0xa9bf('0x57')](_0x51632d[_0xa9bf('0x44')]);_0x514ce8['filters']=_[_0xa9bf('0x46')](_0x514ce8[_0xa9bf('0x42')],_0x514ce8[_0xa9bf('0x44')]);_0x3e8854[_0xa9bf('0x47')]=_[_0xa9bf('0x46')](_0x514ce8[_0xa9bf('0x42')],qs[_0xa9bf('0x48')](_0x51632d[_0xa9bf('0x44')][_0xa9bf('0x48')]));_0x3e8854[_0xa9bf('0x47')]=_0x3e8854[_0xa9bf('0x47')]['length']?_0x3e8854[_0xa9bf('0x47')]:_0x514ce8[_0xa9bf('0x42')];_0x3e8854[_0xa9bf('0x4b')]=qs[_0xa9bf('0x4c')](_0x51632d['query'][_0xa9bf('0x4c')]);_0x3e8854[_0xa9bf('0x4d')]=qs[_0xa9bf('0x45')](_['pick'](_0x51632d['query'],_0x514ce8['filters']));if(_0x51632d[_0xa9bf('0x44')][_0xa9bf('0x34')]){_0x3e8854[_0xa9bf('0x4d')]=_[_0xa9bf('0x4e')](_0x3e8854[_0xa9bf('0x4d')],{'$or':_[_0xa9bf('0x43')](_0x3e8854[_0xa9bf('0x47')],function(_0x403e2e){var _0x292e5b={};_0x292e5b[_0x403e2e]={'$like':'%'+_0x51632d[_0xa9bf('0x44')][_0xa9bf('0x34')]+'%'};return _0x292e5b;})});}_0x3e8854=_['merge']({},_0x3e8854,_0x51632d[_0xa9bf('0x59')]);return _0x251134[_0xa9bf('0x9f')](_0x3e8854);}})[_0xa9bf('0x2f')](function(_0x49c904){if(_0x49c904){_0x3a4554=_0x49c904[_0xa9bf('0x58')];if(!_0x51632d[_0xa9bf('0x44')]['hasOwnProperty'](_0xa9bf('0x4a'))){_0x3e8854[_0xa9bf('0x27')]=qs[_0xa9bf('0x27')](_0x51632d[_0xa9bf('0x44')][_0xa9bf('0x27')]);_0x3e8854[_0xa9bf('0x25')]=qs[_0xa9bf('0x25')](_0x51632d[_0xa9bf('0x44')][_0xa9bf('0x25')]);}return _0x251134[_0xa9bf('0x9f')](_0x3e8854);}})['then'](function(_0x213432){if(_0x213432){return _0x213432?{'count':_0x3a4554,'rows':_0x213432}:null;}})[_0xa9bf('0x2f')](respondWithResult(_0x2074ca,null))[_0xa9bf('0x54')](handleError(_0x2074ca,null));};exports[_0xa9bf('0xa0')]=function(_0x245323,_0x37603e,_0x24285d){var _0x1e8060,_0x26d1f1;return db['VoiceQueue']['find']({'where':{'id':_0x245323['params']['id']}})[_0xa9bf('0x2f')](handleEntityNotFound(_0x37603e,null))[_0xa9bf('0x2f')](function(_0x1d1a9f){if(_0x1d1a9f){_0x26d1f1=_0x1d1a9f;return _0x1d1a9f[_0xa9bf('0xa0')](_0x245323[_0xa9bf('0x5b')][_0xa9bf('0x90')],_[_0xa9bf('0x96')](_0x245323['body'],['ids','id'])||{});}return null;})[_0xa9bf('0x97')](function(_0x31f7ea){var _0x271c33;_0x1e8060=_0x31f7ea||[];var _0x3472c7=[];if(_0x31f7ea){for(var _0x4abd4b=0x0;_0x4abd4b<_0x31f7ea[_0xa9bf('0x58')];_0x4abd4b+=0x1){var _0x1fd307=_0x31f7ea[_0x4abd4b][_0xa9bf('0x30')]({'plain':!![]});_0x26d1f1[_0xa9bf('0xa1')]=_0x245323[_0xa9bf('0x5b')][_0xa9bf('0xa1')]?_0x245323[_0xa9bf('0x5b')]['dialCheckDuplicateType']:_0x26d1f1[_0xa9bf('0xa1')];switch(_0x26d1f1[_0xa9bf('0xa1')]){case'always':_0x271c33=squel[_0xa9bf('0xa2')]()[_0xa9bf('0xa3')](_0xa9bf('0xa4'))[_0xa9bf('0xa5')]([_0xa9bf('0xa6'),_0xa9bf('0xa7'),_0xa9bf('0xa8'),'ListId',_0xa9bf('0x69'),_0xa9bf('0x64'),_0xa9bf('0x65')],squel['select']()['field'](_0xa9bf('0xa6'),_0xa9bf('0xa6'))['field'](_0xa9bf('0xa9'),_0xa9bf('0xa7'))[_0xa9bf('0x84')]('id','ContactId')['field'](_0x1fd307[_0xa9bf('0xaa')][_0xa9bf('0x8b')](),'ListId')['field'](_0x245323['params']['id'][_0xa9bf('0x8b')](),'VoiceQueueId')['field'](_0xa9bf('0xa9'),_0xa9bf('0x64'))[_0xa9bf('0x84')](_0xa9bf('0xa9'),'updatedAt')[_0xa9bf('0x86')]('cm_contacts')[_0xa9bf('0x4d')]('deletedAt\x20IS\x20NULL')['where'](_0xa9bf('0xab'),_0x1fd307[_0xa9bf('0xaa')]['toString']())[_0xa9bf('0x4d')](_0xa9bf('0xac'))[_0xa9bf('0x4d')](_0xa9bf('0xad'),squel[_0xa9bf('0x83')]()[_0xa9bf('0x84')](_0xa9bf('0xae'))[_0xa9bf('0x86')]('cm_hopper_final')[_0xa9bf('0x4d')](_0xa9bf('0xaf'),_0x245323[_0xa9bf('0x56')]['id'][_0xa9bf('0x8b')]()))[_0xa9bf('0x4d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa9bf('0x83')]()[_0xa9bf('0x84')]('COALESCE(phone,\x27\x27)')[_0xa9bf('0x86')](_0xa9bf('0xa4'))[_0xa9bf('0x4d')](_0xa9bf('0xaf'),_0x245323['params']['id'][_0xa9bf('0x8b')]())))[_0xa9bf('0x8b')]();break;case _0xa9bf('0xb0'):_0x271c33=squel['insert']()[_0xa9bf('0xa3')](_0xa9bf('0xa4'))[_0xa9bf('0xa5')](['phone','scheduledAt',_0xa9bf('0xa8'),_0xa9bf('0xb1'),_0xa9bf('0x69'),'createdAt',_0xa9bf('0x65')],squel[_0xa9bf('0x83')]()[_0xa9bf('0x84')](_0xa9bf('0xa6'),_0xa9bf('0xa6'))['field'](_0xa9bf('0xa9'),_0xa9bf('0xa7'))['field']('id',_0xa9bf('0xa8'))[_0xa9bf('0x84')](_0x1fd307['CmListId'][_0xa9bf('0x8b')](),'ListId')[_0xa9bf('0x84')](_0x245323[_0xa9bf('0x56')]['id'][_0xa9bf('0x8b')](),_0xa9bf('0x69'))[_0xa9bf('0x84')]('NOW()',_0xa9bf('0x64'))[_0xa9bf('0x84')]('NOW()',_0xa9bf('0x65'))[_0xa9bf('0x86')](_0xa9bf('0xb2'))[_0xa9bf('0x4d')]('deletedAt\x20IS\x20NULL')[_0xa9bf('0x4d')](_0xa9bf('0xab'),_0x1fd307[_0xa9bf('0xaa')][_0xa9bf('0x8b')]())[_0xa9bf('0x4d')](_0xa9bf('0xac'))[_0xa9bf('0x4d')](_0xa9bf('0xad'),squel[_0xa9bf('0x83')]()[_0xa9bf('0x84')]('COALESCE(phone,\x27\x27)')[_0xa9bf('0x86')](_0xa9bf('0xa4'))[_0xa9bf('0x4d')](_0xa9bf('0xaf'),_0x245323[_0xa9bf('0x56')]['id'][_0xa9bf('0x8b')]())))[_0xa9bf('0x8b')]();break;default:_0x271c33=squel[_0xa9bf('0xa2')]()[_0xa9bf('0xa3')](_0xa9bf('0xa4'))[_0xa9bf('0xa5')]([_0xa9bf('0xa6'),'scheduledAt',_0xa9bf('0xa8'),'ListId',_0xa9bf('0x69'),'createdAt',_0xa9bf('0x65')],squel[_0xa9bf('0x83')]()['field'](_0xa9bf('0xa6'),_0xa9bf('0xa6'))['field'](_0xa9bf('0xa9'),_0xa9bf('0xa7'))[_0xa9bf('0x84')]('id',_0xa9bf('0xa8'))[_0xa9bf('0x84')](_0x1fd307[_0xa9bf('0xaa')][_0xa9bf('0x8b')](),_0xa9bf('0xb1'))[_0xa9bf('0x84')](_0x245323['params']['id']['toString'](),_0xa9bf('0x69'))[_0xa9bf('0x84')](_0xa9bf('0xa9'),_0xa9bf('0x64'))[_0xa9bf('0x84')](_0xa9bf('0xa9'),'updatedAt')[_0xa9bf('0x86')](_0xa9bf('0xb2'))[_0xa9bf('0x4d')]('deletedAt\x20IS\x20NULL')[_0xa9bf('0x4d')](_0xa9bf('0xab'),_0x1fd307['CmListId'][_0xa9bf('0x8b')]())[_0xa9bf('0x4d')](_0xa9bf('0xac')))['toString']();}_0x3472c7[_0xa9bf('0x99')](db[_0xa9bf('0x8c')][_0xa9bf('0x44')](_0x271c33));}return BPromise[_0xa9bf('0x9a')](_0x3472c7);}})[_0xa9bf('0x2f')](function(){return _0x1e8060;})[_0xa9bf('0x2f')](respondWithResult(_0x37603e,null))[_0xa9bf('0x54')](handleError(_0x37603e,null));};exports['removeLists']=function(_0xa2ae6d,_0xa6fa5b,_0x6c2570){return db['VoiceQueue'][_0xa9bf('0x39')]({'where':{'id':_0xa2ae6d[_0xa9bf('0x56')]['id']}})['then'](handleEntityNotFound(_0xa6fa5b,null))[_0xa9bf('0x2f')](function(_0x29197e){if(_0x29197e){return _0x29197e[_0xa9bf('0xb3')](_0xa2ae6d[_0xa9bf('0x44')][_0xa9bf('0x90')]);}})[_0xa9bf('0x2f')](function(_0x44af66){if(_0x44af66){return db[_0xa9bf('0x68')][_0xa9bf('0x3b')]({'where':{'ListId':_0xa2ae6d[_0xa9bf('0x44')][_0xa9bf('0x90')],'VoiceQueueId':_0xa2ae6d[_0xa9bf('0x56')]['id']}})['then'](function(){return _0x44af66;});}})[_0xa9bf('0x2f')](respondWithStatusCode(_0xa6fa5b,null))[_0xa9bf('0x54')](handleError(_0xa6fa5b,null));};exports[_0xa9bf('0xb4')]=function(_0x188c97,_0x20edc1,_0x4285b7){var _0x1d49e8={};var _0x5cd42f={};var _0x1a42d0;var _0x552ddc;return db[_0xa9bf('0x51')][_0xa9bf('0x67')]({'where':{'id':_0x188c97['params']['id']}})[_0xa9bf('0x2f')](handleEntityNotFound(_0x20edc1,null))[_0xa9bf('0x2f')](function(_0x13de8a){if(_0x13de8a){_0x1a42d0=_0x13de8a;_0x5cd42f[_0xa9bf('0x42')]=_[_0xa9bf('0x57')](db[_0xa9bf('0x9e')][_0xa9bf('0x40')]);_0x5cd42f['query']=_[_0xa9bf('0x57')](_0x188c97[_0xa9bf('0x44')]);_0x5cd42f[_0xa9bf('0x45')]=_[_0xa9bf('0x46')](_0x5cd42f['model'],_0x5cd42f['query']);_0x1d49e8[_0xa9bf('0x47')]=_[_0xa9bf('0x46')](_0x5cd42f[_0xa9bf('0x42')],qs[_0xa9bf('0x48')](_0x188c97[_0xa9bf('0x44')][_0xa9bf('0x48')]));_0x1d49e8[_0xa9bf('0x47')]=_0x1d49e8[_0xa9bf('0x47')][_0xa9bf('0x58')]?_0x1d49e8[_0xa9bf('0x47')]:_0x5cd42f[_0xa9bf('0x42')];_0x1d49e8[_0xa9bf('0x4b')]=qs[_0xa9bf('0x4c')](_0x188c97[_0xa9bf('0x44')][_0xa9bf('0x4c')]);_0x1d49e8[_0xa9bf('0x4d')]=qs[_0xa9bf('0x45')](_[_0xa9bf('0x6b')](_0x188c97['query'],_0x5cd42f['filters']));if(_0x188c97['query'][_0xa9bf('0x34')]){_0x1d49e8[_0xa9bf('0x4d')]=_['merge'](_0x1d49e8[_0xa9bf('0x4d')],{'$or':_['map'](_0x1d49e8[_0xa9bf('0x47')],function(_0x19a9cb){var _0x1aa495={};_0x1aa495[_0x19a9cb]={'$like':'%'+_0x188c97[_0xa9bf('0x44')][_0xa9bf('0x34')]+'%'};return _0x1aa495;})});}_0x1d49e8=_[_0xa9bf('0x4e')]({},_0x1d49e8,_0x188c97[_0xa9bf('0x59')]);return _0x1a42d0[_0xa9bf('0xb4')](_0x1d49e8);}})[_0xa9bf('0x2f')](function(_0x29c0cc){if(_0x29c0cc){_0x552ddc=_0x29c0cc[_0xa9bf('0x58')];if(!_0x188c97[_0xa9bf('0x44')][_0xa9bf('0x49')]('nolimit')){_0x1d49e8[_0xa9bf('0x27')]=qs['limit'](_0x188c97[_0xa9bf('0x44')][_0xa9bf('0x27')]);_0x1d49e8[_0xa9bf('0x25')]=qs['offset'](_0x188c97[_0xa9bf('0x44')][_0xa9bf('0x25')]);}return _0x1a42d0[_0xa9bf('0xb4')](_0x1d49e8);}})['then'](function(_0xe77604){if(_0xe77604){return _0xe77604?{'count':_0x552ddc,'rows':_0xe77604}:null;}})[_0xa9bf('0x2f')](respondWithResult(_0x20edc1,null))[_0xa9bf('0x54')](handleError(_0x20edc1,null));};exports[_0xa9bf('0xb5')]=function(_0x1d9bef,_0x37f0fd,_0xc63bb4){var _0x3cf115,_0x40eb74;return db[_0xa9bf('0x51')]['find']({'where':{'id':_0x1d9bef[_0xa9bf('0x56')]['id']}})['then'](handleEntityNotFound(_0x37f0fd,null))[_0xa9bf('0x2f')](function(_0x246809){if(_0x246809){_0x40eb74=_0x246809;return _0x246809[_0xa9bf('0xb5')](_0x1d9bef['body'][_0xa9bf('0x90')],_['omit'](_0x1d9bef[_0xa9bf('0x5b')],['ids','id'])||{});}return null;})[_0xa9bf('0x97')](function(_0x8699bc){var _0x485b6a;_0x3cf115=_0x8699bc||[];var _0x3c0306=[];if(_0x8699bc){for(var _0x51d490=0x0;_0x51d490<_0x8699bc['length'];_0x51d490+=0x1){var _0x425df2=_0x8699bc[_0x51d490][_0xa9bf('0x30')]({'plain':!![]});_0x485b6a=squel['insert']()[_0xa9bf('0xa3')](_0xa9bf('0xb6'))[_0xa9bf('0xa5')](['phone',_0xa9bf('0xa8'),_0xa9bf('0xb1'),'VoiceQueueId',_0xa9bf('0x64'),'updatedAt'],squel[_0xa9bf('0x83')]()[_0xa9bf('0x84')]('phone','phone')[_0xa9bf('0x84')]('id',_0xa9bf('0xa8'))[_0xa9bf('0x84')](_0x425df2[_0xa9bf('0xaa')][_0xa9bf('0x8b')](),_0xa9bf('0xb1'))[_0xa9bf('0x84')](_0x1d9bef[_0xa9bf('0x56')]['id'][_0xa9bf('0x8b')](),_0xa9bf('0x69'))[_0xa9bf('0x84')](_0xa9bf('0xa9'),_0xa9bf('0x64'))[_0xa9bf('0x84')](_0xa9bf('0xa9'),_0xa9bf('0x65'))['from'](_0xa9bf('0xb2'))[_0xa9bf('0x4d')](_0xa9bf('0xb7'))[_0xa9bf('0x4d')](_0xa9bf('0xab'),_0x425df2[_0xa9bf('0xaa')][_0xa9bf('0x8b')]())['where'](_0xa9bf('0xac')))[_0xa9bf('0x8b')]();_0x3c0306[_0xa9bf('0x99')](db['sequelize'][_0xa9bf('0x44')](_0x485b6a));}return BPromise['all'](_0x3c0306);}})[_0xa9bf('0x2f')](function(){return _0x3cf115;})[_0xa9bf('0x2f')](respondWithResult(_0x37f0fd,null))[_0xa9bf('0x54')](handleError(_0x37f0fd,null));};exports['removeBlackLists']=function(_0x4f812a,_0x1e0107,_0x4559c3){return db['VoiceQueue'][_0xa9bf('0x39')]({'where':{'id':_0x4f812a[_0xa9bf('0x56')]['id']}})[_0xa9bf('0x2f')](handleEntityNotFound(_0x1e0107,null))[_0xa9bf('0x2f')](function(_0xc0ce49){if(_0xc0ce49){return _0xc0ce49[_0xa9bf('0xb8')](_0x4f812a['query']['ids']);}})[_0xa9bf('0x2f')](function(_0x9de40){if(_0x9de40){return db[_0xa9bf('0x6f')][_0xa9bf('0x3b')]({'where':{'ListId':_0x4f812a[_0xa9bf('0x44')][_0xa9bf('0x90')],'VoiceQueueId':_0x4f812a[_0xa9bf('0x56')]['id']}})[_0xa9bf('0x2f')](function(){return _0x9de40;});}})[_0xa9bf('0x2f')](respondWithStatusCode(_0x1e0107,null))[_0xa9bf('0x54')](handleError(_0x1e0107,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index d864888..118ee97 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 _0x5883=['emit','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x58eeff,_0x16ad09){var _0x2828cc=function(_0x1c4f8e){while(--_0x1c4f8e){_0x58eeff['push'](_0x58eeff['shift']());}};_0x2828cc(++_0x16ad09);}(_0x5883,0x19e));var _0x3588=function(_0x597ade,_0x430820){_0x597ade=_0x597ade-0x0;var _0x1aeac6=_0x5883[_0x597ade];return _0x1aeac6;};'use strict';var EventEmitter=require(_0x3588('0x0'));var VoiceQueue=require(_0x3588('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3588('0x2')](0x0);var events={'afterCreate':_0x3588('0x3'),'afterUpdate':_0x3588('0x4'),'afterDestroy':_0x3588('0x5')};function emitEvent(_0x4c490b){return function(_0x33670c,_0x38bb62,_0x4e65ac){VoiceQueueEvents['emit'](_0x4c490b+':'+_0x33670c['id'],_0x33670c);VoiceQueueEvents[_0x3588('0x6')](_0x4c490b,_0x33670c);_0x4e65ac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x97e6=['hook','exports','../../mysqldb','setMaxListeners','save','remove'];(function(_0x376dd3,_0x10edb9){var _0x2c449b=function(_0x8660ba){while(--_0x8660ba){_0x376dd3['push'](_0x376dd3['shift']());}};_0x2c449b(++_0x10edb9);}(_0x97e6,0xce));var _0x697e=function(_0x11afd1,_0x4d62ff){_0x11afd1=_0x11afd1-0x0;var _0x5e8b34=_0x97e6[_0x11afd1];return _0x5e8b34;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x697e('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x697e('0x1')](0x0);var events={'afterCreate':_0x697e('0x2'),'afterUpdate':'update','afterDestroy':_0x697e('0x3')};function emitEvent(_0x4ff73c){return function(_0x15bf8b,_0x59bba3,_0x261412){VoiceQueueEvents['emit'](_0x4ff73c+':'+_0x15bf8b['id'],_0x15bf8b);VoiceQueueEvents['emit'](_0x4ff73c,_0x15bf8b);_0x261412(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x697e('0x4')](e,emitEvent(event));}}module[_0x697e('0x5')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 1acf4f2..a89bf51 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 _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x5b8155,_0x51c636){var _0x1d6f07=function(_0x206950){while(--_0x206950){_0x5b8155['push'](_0x5b8155['shift']());}};_0x1d6f07(++_0x51c636);}(_0x3e74,0x175));var _0x43e7=function(_0x3a3f15,_0x1dc4f6){_0x3a3f15=_0x3a3f15-0x0;var _0x35d8c9=_0x3e74[_0x3a3f15];return _0x35d8c9;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1196b0,_0x36c47a){var _0x111c52=function(_0x5604c7){while(--_0x5604c7){_0x1196b0['push'](_0x1196b0['shift']());}};_0x111c52(++_0x36c47a);}(_0x55ca,0x126));var _0xa55c=function(_0x4abc8f,_0xef597d){_0x4abc8f=_0x4abc8f-0x0;var _0x5d7939=_0x55ca[_0x4abc8f];return _0x5d7939;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 4f6146c..360347a 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 _0x1267=['../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','include','map','model','then','ShowVoiceQueue','moment','bluebird','randomstring','../../mysqldb'];(function(_0x22b47d,_0x361535){var _0x1762ae=function(_0x128d4c){while(--_0x128d4c){_0x22b47d['push'](_0x22b47d['shift']());}};_0x1762ae(++_0x361535);}(_0x1267,0x1f4));var _0x7126=function(_0x4d0b6b,_0x4c577e){_0x4d0b6b=_0x4d0b6b-0x0;var _0x2e64a9=_0x1267[_0x4d0b6b];return _0x2e64a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7126('0x0'));var BPromise=require(_0x7126('0x1'));var rs=require(_0x7126('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7126('0x3'))['db'];var utils=require(_0x7126('0x4'));var logger=require(_0x7126('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7126('0x6'));var client=jayson[_0x7126('0x7')]['http']({'port':0x232a});config[_0x7126('0x8')]=_[_0x7126('0x9')](config[_0x7126('0x8')],{'host':_0x7126('0xa'),'port':0x18eb});var socket=require(_0x7126('0xb'))(new Redis(config['redis']));require(_0x7126('0xc'))[_0x7126('0xd')](socket);function respondWithRpcPromise(_0x148976,_0xa3099d,_0x38804c){return new BPromise(function(_0x187968,_0x50bd34){return client['request'](_0x148976,_0x38804c)['then'](function(_0x17920b){logger[_0x7126('0xe')](_0x7126('0xf'),_0xa3099d,_0x7126('0x10'));logger[_0x7126('0x11')](_0x7126('0x12'),_0xa3099d,'request\x20sent',JSON[_0x7126('0x13')](_0x17920b));if(_0x17920b[_0x7126('0x14')]){if(_0x17920b[_0x7126('0x14')]['code']===0x1f4){logger[_0x7126('0x14')](_0x7126('0xf'),_0xa3099d,_0x17920b[_0x7126('0x14')][_0x7126('0x15')]);return _0x50bd34(_0x17920b[_0x7126('0x14')][_0x7126('0x15')]);}logger[_0x7126('0x14')](_0x7126('0xf'),_0xa3099d,_0x17920b['error']['message']);return _0x187968(_0x17920b[_0x7126('0x14')][_0x7126('0x15')]);}else{logger[_0x7126('0xe')](_0x7126('0xf'),_0xa3099d,_0x7126('0x10'));_0x187968(_0x17920b[_0x7126('0x16')][_0x7126('0x15')]);}})[_0x7126('0x17')](function(_0x97a016){logger[_0x7126('0x14')]('VoiceQueue,\x20%s,\x20%s',_0xa3099d,_0x97a016);_0x50bd34(_0x97a016);});});}exports[_0x7126('0x18')]=function(_0x361c34){var _0x57e02c=this;return new Promise(function(_0x44ef48,_0x58bc80){return db[_0x7126('0x19')][_0x7126('0x1a')]({'raw':_0x361c34['options']?_0x361c34[_0x7126('0x1b')][_0x7126('0x1c')]===undefined?!![]:![]:!![],'where':_0x361c34[_0x7126('0x1b')]?_0x361c34[_0x7126('0x1b')][_0x7126('0x1d')]||null:null,'attributes':_0x361c34['options']?_0x361c34[_0x7126('0x1b')][_0x7126('0x1e')]||null:null,'limit':_0x361c34[_0x7126('0x1b')]?_0x361c34[_0x7126('0x1b')]['limit']||null:null,'include':_0x361c34[_0x7126('0x1b')]?_0x361c34[_0x7126('0x1b')][_0x7126('0x1f')]?_[_0x7126('0x20')](_0x361c34[_0x7126('0x1b')][_0x7126('0x1f')],function(_0x2f5eb0){return{'model':db[_0x2f5eb0['model']],'as':_0x2f5eb0['as'],'attributes':_0x2f5eb0['attributes'],'include':_0x2f5eb0[_0x7126('0x1f')]?_['map'](_0x2f5eb0[_0x7126('0x1f')],function(_0x1d2333){return{'model':db[_0x1d2333[_0x7126('0x21')]],'as':_0x1d2333['as'],'attributes':_0x1d2333['attributes'],'include':_0x1d2333[_0x7126('0x1f')]?_[_0x7126('0x20')](_0x1d2333[_0x7126('0x1f')],function(_0x2e62d5){return{'model':db[_0x2e62d5[_0x7126('0x21')]],'as':_0x2e62d5['as'],'attributes':_0x2e62d5[_0x7126('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7126('0x22')](function(_0x199b53){logger[_0x7126('0xe')](_0x7126('0x18'),_0x361c34);logger[_0x7126('0x11')](_0x7126('0x18'),_0x361c34,JSON[_0x7126('0x13')](_0x199b53));_0x44ef48(_0x199b53);})['catch'](function(_0x59509a){logger[_0x7126('0x14')](_0x7126('0x18'),_0x59509a[_0x7126('0x15')],_0x361c34);_0x58bc80(_0x57e02c[_0x7126('0x14')](0x1f4,_0x59509a['message']));});});};exports[_0x7126('0x23')]=function(_0x382bf1){var _0x4d23cc=this;return new Promise(function(_0xae8070,_0x3edd31){return db['VoiceQueue']['find']({'raw':_0x382bf1[_0x7126('0x1b')]?_0x382bf1['options']['raw']===undefined?!![]:![]:!![],'where':_0x382bf1[_0x7126('0x1b')]?_0x382bf1['options'][_0x7126('0x1d')]||null:null,'attributes':_0x382bf1[_0x7126('0x1b')]?_0x382bf1[_0x7126('0x1b')][_0x7126('0x1e')]||null:null,'include':_0x382bf1['options']?_0x382bf1['options'][_0x7126('0x1f')]?_[_0x7126('0x20')](_0x382bf1[_0x7126('0x1b')][_0x7126('0x1f')],function(_0x5c0672){return{'model':db[_0x5c0672[_0x7126('0x21')]],'as':_0x5c0672['as'],'attributes':_0x5c0672[_0x7126('0x1e')],'include':_0x5c0672[_0x7126('0x1f')]?_[_0x7126('0x20')](_0x5c0672[_0x7126('0x1f')],function(_0x470648){return{'model':db[_0x470648['model']],'as':_0x470648['as'],'attributes':_0x470648['attributes'],'include':_0x470648[_0x7126('0x1f')]?_[_0x7126('0x20')](_0x470648[_0x7126('0x1f')],function(_0x127768){return{'model':db[_0x127768[_0x7126('0x21')]],'as':_0x127768['as'],'attributes':_0x127768[_0x7126('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7126('0x22')](function(_0x44a0a1){logger[_0x7126('0xe')]('ShowVoiceQueue',_0x382bf1);logger[_0x7126('0x11')](_0x7126('0x23'),_0x382bf1,JSON[_0x7126('0x13')](_0x44a0a1));_0xae8070(_0x44a0a1);})[_0x7126('0x17')](function(_0x2512d2){logger[_0x7126('0x14')](_0x7126('0x23'),_0x2512d2[_0x7126('0x15')],_0x382bf1);_0x3edd31(_0x4d23cc[_0x7126('0x14')](0x1f4,_0x2512d2[_0x7126('0x15')]));});});}; \ No newline at end of file +var _0x449d=['VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','info','result','findAll','options','raw','where','limit','map','include','model','attributes','GetVoiceQueue','catch','ShowVoiceQueue','VoiceQueue','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','debug'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x449d,0x1d0));var _0xd449=function(_0x594ff5,_0x47aa57){_0x594ff5=_0x594ff5-0x0;var _0x5042d6=_0x449d[_0x594ff5];return _0x5042d6;};'use strict';var _=require(_0xd449('0x0'));var util=require(_0xd449('0x1'));var moment=require(_0xd449('0x2'));var BPromise=require(_0xd449('0x3'));var rs=require(_0xd449('0x4'));var fs=require('fs');var Redis=require(_0xd449('0x5'));var db=require(_0xd449('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd449('0x7'))(_0xd449('0x8'));var config=require(_0xd449('0x9'));var jayson=require(_0xd449('0xa'));var client=jayson[_0xd449('0xb')][_0xd449('0xc')]({'port':0x232a});config[_0xd449('0xd')]=_[_0xd449('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd449('0xf'))(new Redis(config[_0xd449('0xd')]));require(_0xd449('0x10'))[_0xd449('0x11')](socket);function respondWithRpcPromise(_0x120a07,_0x473358,_0xc790a){return new BPromise(function(_0x4b2d19,_0x2b2df0){return client[_0xd449('0x12')](_0x120a07,_0xc790a)['then'](function(_0x3b9ce7){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x473358,'request\x20sent');logger[_0xd449('0x13')](_0xd449('0x14'),_0x473358,_0xd449('0x15'),JSON[_0xd449('0x16')](_0x3b9ce7));if(_0x3b9ce7[_0xd449('0x17')]){if(_0x3b9ce7[_0xd449('0x17')][_0xd449('0x18')]===0x1f4){logger[_0xd449('0x17')](_0xd449('0x19'),_0x473358,_0x3b9ce7[_0xd449('0x17')][_0xd449('0x1a')]);return _0x2b2df0(_0x3b9ce7[_0xd449('0x17')][_0xd449('0x1a')]);}logger[_0xd449('0x17')](_0xd449('0x19'),_0x473358,_0x3b9ce7[_0xd449('0x17')]['message']);return _0x4b2d19(_0x3b9ce7['error'][_0xd449('0x1a')]);}else{logger[_0xd449('0x1b')]('VoiceQueue,\x20%s,\x20%s',_0x473358,_0xd449('0x15'));_0x4b2d19(_0x3b9ce7[_0xd449('0x1c')]['message']);}})['catch'](function(_0x29975c){logger[_0xd449('0x17')](_0xd449('0x19'),_0x473358,_0x29975c);_0x2b2df0(_0x29975c);});});}exports['GetVoiceQueue']=function(_0xc9259e){var _0x73c9f5=this;return new Promise(function(_0x227c3c,_0x29ba80){return db['VoiceQueue'][_0xd449('0x1d')]({'raw':_0xc9259e['options']?_0xc9259e[_0xd449('0x1e')][_0xd449('0x1f')]===undefined?!![]:![]:!![],'where':_0xc9259e[_0xd449('0x1e')]?_0xc9259e[_0xd449('0x1e')][_0xd449('0x20')]||null:null,'attributes':_0xc9259e[_0xd449('0x1e')]?_0xc9259e['options']['attributes']||null:null,'limit':_0xc9259e[_0xd449('0x1e')]?_0xc9259e[_0xd449('0x1e')][_0xd449('0x21')]||null:null,'include':_0xc9259e['options']?_0xc9259e[_0xd449('0x1e')]['include']?_[_0xd449('0x22')](_0xc9259e['options'][_0xd449('0x23')],function(_0x423484){return{'model':db[_0x423484[_0xd449('0x24')]],'as':_0x423484['as'],'attributes':_0x423484[_0xd449('0x25')],'include':_0x423484[_0xd449('0x23')]?_[_0xd449('0x22')](_0x423484[_0xd449('0x23')],function(_0x51dec0){return{'model':db[_0x51dec0['model']],'as':_0x51dec0['as'],'attributes':_0x51dec0[_0xd449('0x25')],'include':_0x51dec0[_0xd449('0x23')]?_[_0xd449('0x22')](_0x51dec0[_0xd449('0x23')],function(_0x123991){return{'model':db[_0x123991['model']],'as':_0x123991['as'],'attributes':_0x123991['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f43d9){logger[_0xd449('0x1b')]('GetVoiceQueue',_0xc9259e);logger[_0xd449('0x13')](_0xd449('0x26'),_0xc9259e,JSON['stringify'](_0x1f43d9));_0x227c3c(_0x1f43d9);})[_0xd449('0x27')](function(_0x3d5122){logger[_0xd449('0x17')](_0xd449('0x26'),_0x3d5122['message'],_0xc9259e);_0x29ba80(_0x73c9f5['error'](0x1f4,_0x3d5122[_0xd449('0x1a')]));});});};exports[_0xd449('0x28')]=function(_0x51541c){var _0x546757=this;return new Promise(function(_0x4dde7f,_0x1519f7){return db[_0xd449('0x29')][_0xd449('0x2a')]({'raw':_0x51541c['options']?_0x51541c['options'][_0xd449('0x1f')]===undefined?!![]:![]:!![],'where':_0x51541c[_0xd449('0x1e')]?_0x51541c[_0xd449('0x1e')][_0xd449('0x20')]||null:null,'attributes':_0x51541c[_0xd449('0x1e')]?_0x51541c[_0xd449('0x1e')][_0xd449('0x25')]||null:null,'include':_0x51541c[_0xd449('0x1e')]?_0x51541c[_0xd449('0x1e')][_0xd449('0x23')]?_['map'](_0x51541c[_0xd449('0x1e')][_0xd449('0x23')],function(_0x5437a8){return{'model':db[_0x5437a8[_0xd449('0x24')]],'as':_0x5437a8['as'],'attributes':_0x5437a8['attributes'],'include':_0x5437a8[_0xd449('0x23')]?_[_0xd449('0x22')](_0x5437a8[_0xd449('0x23')],function(_0xdcea89){return{'model':db[_0xdcea89['model']],'as':_0xdcea89['as'],'attributes':_0xdcea89[_0xd449('0x25')],'include':_0xdcea89[_0xd449('0x23')]?_[_0xd449('0x22')](_0xdcea89[_0xd449('0x23')],function(_0x4cea94){return{'model':db[_0x4cea94['model']],'as':_0x4cea94['as'],'attributes':_0x4cea94[_0xd449('0x25')]};}):[]};}):[]};}):[]:[]})[_0xd449('0x2b')](function(_0xe8cae){logger[_0xd449('0x1b')](_0xd449('0x28'),_0x51541c);logger['debug'](_0xd449('0x28'),_0x51541c,JSON[_0xd449('0x16')](_0xe8cae));_0x4dde7f(_0xe8cae);})[_0xd449('0x27')](function(_0xcf81eb){logger['error']('ShowVoiceQueue',_0xcf81eb[_0xd449('0x1a')],_0x51541c);_0x1519f7(_0x546757['error'](0x1f4,_0xcf81eb[_0xd449('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 327a5de..9ba716b 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 _0x0d4e=['emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x3cbe1c,_0x4bcabd){var _0x5ee08b=function(_0x5c53e6){while(--_0x5c53e6){_0x3cbe1c['push'](_0x3cbe1c['shift']());}};_0x5ee08b(++_0x4bcabd);}(_0x0d4e,0x1cd));var _0xe0d4=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x0d4e[_0x138adb];return _0x1b27f2;};'use strict';var VoiceQueueEvents=require(_0xe0d4('0x0'));var events=[_0xe0d4('0x1'),_0xe0d4('0x2'),'update'];function createListener(_0x443c02,_0x25fdf3){return function(_0x93e820){_0x25fdf3[_0xe0d4('0x3')](_0x443c02,_0x93e820);};}function removeListener(_0x3d445f,_0x3fba24){return function(){VoiceQueueEvents[_0xe0d4('0x4')](_0x3d445f,_0x3fba24);};}exports[_0xe0d4('0x5')]=function(_0x57a7df){for(var _0x5e8c07=0x0,_0x5cbb9f=events[_0xe0d4('0x6')];_0x5e8c07<_0x5cbb9f;_0x5e8c07++){var _0x42c524=events[_0x5e8c07];var _0x597ba0=createListener(_0xe0d4('0x7')+_0x42c524,_0x57a7df);VoiceQueueEvents['on'](_0x42c524,_0x597ba0);}}; \ No newline at end of file +var _0x7911=['length','voiceQueue:','./voiceQueue.events','save','update','emit','removeListener'];(function(_0x41bcf5,_0x2a0131){var _0x3e93de=function(_0x2a666c){while(--_0x2a666c){_0x41bcf5['push'](_0x41bcf5['shift']());}};_0x3e93de(++_0x2a0131);}(_0x7911,0xf0));var _0x1791=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x7911[_0x5e36d1];return _0x950b9e;};'use strict';var VoiceQueueEvents=require(_0x1791('0x0'));var events=[_0x1791('0x1'),'remove',_0x1791('0x2')];function createListener(_0x1f6a75,_0x163f5a){return function(_0x3cdcdb){_0x163f5a[_0x1791('0x3')](_0x1f6a75,_0x3cdcdb);};}function removeListener(_0x14aa19,_0x2f16b9){return function(){VoiceQueueEvents[_0x1791('0x4')](_0x14aa19,_0x2f16b9);};}exports['register']=function(_0x30217c){for(var _0x57a8fe=0x0,_0x7e8bf=events[_0x1791('0x5')];_0x57a8fe<_0x7e8bf;_0x57a8fe++){var _0x144b8d=events[_0x57a8fe];var _0x343c78=createListener(_0x1791('0x6')+_0x144b8d,_0x30217c);VoiceQueueEvents['on'](_0x144b8d,_0x343c78);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 703f866..0e7402c 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 _0x48e3=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','show','post','create','put','/:id','update','delete','destroy'];(function(_0x1194ac,_0x1c1a80){var _0x384066=function(_0x593095){while(--_0x593095){_0x1194ac['push'](_0x1194ac['shift']());}};_0x384066(++_0x1c1a80);}(_0x48e3,0x114));var _0x348e=function(_0x400497,_0xea7271){_0x400497=_0x400497-0x0;var _0x344def=_0x48e3[_0x400497];return _0x344def;};'use strict';var multer=require(_0x348e('0x0'));var util=require(_0x348e('0x1'));var path=require(_0x348e('0x2'));var timeout=require(_0x348e('0x3'));var express=require(_0x348e('0x4'));var router=express[_0x348e('0x5')]();var fs_extra=require(_0x348e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x348e('0x7'));var controller=require('./voiceQueueReport.controller');router[_0x348e('0x8')]('/',auth[_0x348e('0x9')](),controller[_0x348e('0xa')]);router['get'](_0x348e('0xb'),auth['isAuthenticated'](),controller[_0x348e('0xc')]);router['get'](_0x348e('0xd'),auth[_0x348e('0x9')](),controller[_0x348e('0xe')]);router[_0x348e('0x8')]('/:id',auth[_0x348e('0x9')](),controller[_0x348e('0xf')]);router[_0x348e('0x10')]('/',auth[_0x348e('0x9')](),controller[_0x348e('0x11')]);router[_0x348e('0x12')](_0x348e('0x13'),auth[_0x348e('0x9')](),controller[_0x348e('0x14')]);router[_0x348e('0x15')](_0x348e('0x13'),auth[_0x348e('0x9')](),controller[_0x348e('0x16')]);module['exports']=router; \ No newline at end of file +var _0x712d=['delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','/index','getVoiceQueuesReport','/:id','post','put','update'];(function(_0x1e7701,_0x13fd0f){var _0x3ab707=function(_0x3c5242){while(--_0x3c5242){_0x1e7701['push'](_0x1e7701['shift']());}};_0x3ab707(++_0x13fd0f);}(_0x712d,0xbe));var _0xd712=function(_0x40df2c,_0x5c00fa){_0x40df2c=_0x40df2c-0x0;var _0x5a5658=_0x712d[_0x40df2c];return _0x5a5658;};'use strict';var multer=require(_0xd712('0x0'));var util=require(_0xd712('0x1'));var path=require(_0xd712('0x2'));var timeout=require(_0xd712('0x3'));var express=require(_0xd712('0x4'));var router=express[_0xd712('0x5')]();var fs_extra=require(_0xd712('0x6'));var auth=require(_0xd712('0x7'));var interaction=require(_0xd712('0x8'));var config=require(_0xd712('0x9'));var controller=require(_0xd712('0xa'));router['get']('/',auth[_0xd712('0xb')](),controller[_0xd712('0xc')]);router[_0xd712('0xd')]('/describe',auth[_0xd712('0xb')](),controller['describe']);router[_0xd712('0xd')](_0xd712('0xe'),auth[_0xd712('0xb')](),controller[_0xd712('0xf')]);router['get'](_0xd712('0x10'),auth['isAuthenticated'](),controller['show']);router[_0xd712('0x11')]('/',auth[_0xd712('0xb')](),controller['create']);router[_0xd712('0x12')](_0xd712('0x10'),auth[_0xd712('0xb')](),controller[_0xd712('0x13')]);router[_0xd712('0x14')](_0xd712('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 8b7ba32..b5ddeba 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 _0x9de5=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','holdtime','INTEGER','BOOLEAN'];(function(_0x51a0eb,_0x3d2c36){var _0x32f2fc=function(_0x38c691){while(--_0x38c691){_0x51a0eb['push'](_0x51a0eb['shift']());}};_0x32f2fc(++_0x3d2c36);}(_0x9de5,0x154));var _0x59de=function(_0x579a07,_0x1ae404){_0x579a07=_0x579a07-0x0;var _0x2ed047=_0x9de5[_0x579a07];return _0x2ed047;};'use strict';var Sequelize=require(_0x59de('0x0'));var moment=require(_0x59de('0x1'));module['exports']={'type':{'type':Sequelize[_0x59de('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x59de('0x2')]},'calleridname':{'type':Sequelize[_0x59de('0x2')]},'queue':{'type':Sequelize[_0x59de('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x59de('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x59de('0x3')],'set':function(_0x3c5c1a){var _0xd0dc3=moment(_0x3c5c1a);var _0x2be65a=moment(this[_0x59de('0x4')]('queuecallerjoinAt'))['format'](_0x59de('0x5'));var _0x4b3137=_0xd0dc3['diff'](_0x2be65a,_0x59de('0x6'));this[_0x59de('0x7')]('queuecallerleaveAt',_0x3c5c1a);this['setDataValue'](_0x59de('0x8'),_0x4b3137||null);}},'position':{'type':Sequelize[_0x59de('0x9')]},'count':{'type':Sequelize[_0x59de('0x9')]},'queuecallerabandon':{'type':Sequelize[_0x59de('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x59de('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x59de('0x3')]},'queuecallerexit':{'type':Sequelize[_0x59de('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x59de('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x59de('0x2')],'comment':_0x59de('0xb')},'originalposition':{'type':Sequelize[_0x59de('0x9')]},'channel':{'type':Sequelize[_0x59de('0x2')]},'connectedlinenum':{'type':Sequelize[_0x59de('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x59de('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x59de('0x2')]},'priority':{'type':Sequelize[_0x59de('0x2')]},'holdtime':{'type':Sequelize[_0x59de('0x9')]},'mohtime':{'type':Sequelize[_0x59de('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x59de('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x59de('0x2')]},'transfer':{'type':Sequelize[_0x59de('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x59de('0x2')],'comment':_0x59de('0xc')},'transferexten':{'type':Sequelize[_0x59de('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x59de('0x2')]},'secondDisposition':{'type':Sequelize[_0x59de('0x2')]},'thirdDisposition':{'type':Sequelize[_0x59de('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x59de('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8cb3=['sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x1acd23,_0x5c93e8){var _0x4cfcf7=function(_0x4a0345){while(--_0x4a0345){_0x1acd23['push'](_0x1acd23['shift']());}};_0x4cfcf7(++_0x5c93e8);}(_0x8cb3,0x1a0));var _0x38cb=function(_0xe878d2,_0x2a1b56){_0xe878d2=_0xe878d2-0x0;var _0x30cc01=_0x8cb3[_0xe878d2];return _0x30cc01;};'use strict';var Sequelize=require(_0x38cb('0x0'));var moment=require(_0x38cb('0x1'));module[_0x38cb('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x38cb('0x3')]},'queue':{'type':Sequelize[_0x38cb('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x38cb('0x4')],'set':function(_0x257df6){var _0x525976=moment(_0x257df6);var _0x4b94a8=moment(this[_0x38cb('0x5')](_0x38cb('0x6')))[_0x38cb('0x7')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1742bd=_0x525976[_0x38cb('0x8')](_0x4b94a8,'seconds');this[_0x38cb('0x9')](_0x38cb('0xa'),_0x257df6);this[_0x38cb('0x9')](_0x38cb('0xb'),_0x1742bd||null);}},'position':{'type':Sequelize[_0x38cb('0xc')]},'count':{'type':Sequelize[_0x38cb('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x38cb('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x38cb('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x38cb('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x38cb('0x3')],'comment':_0x38cb('0xd')},'originalposition':{'type':Sequelize[_0x38cb('0xc')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x38cb('0x3')]},'connectedlinename':{'type':Sequelize[_0x38cb('0x3')]},'accountcode':{'type':Sequelize[_0x38cb('0x3')]},'context':{'type':Sequelize[_0x38cb('0x3')]},'exten':{'type':Sequelize[_0x38cb('0x3')]},'priority':{'type':Sequelize[_0x38cb('0x3')]},'holdtime':{'type':Sequelize[_0x38cb('0xc')]},'mohtime':{'type':Sequelize[_0x38cb('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x38cb('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x38cb('0x3')]},'transfer':{'type':Sequelize[_0x38cb('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x38cb('0x3')],'comment':_0x38cb('0xf')},'transferexten':{'type':Sequelize[_0x38cb('0x3')]},'transferuniqueid':{'type':Sequelize[_0x38cb('0x3')]},'disposition':{'type':Sequelize[_0x38cb('0x3')]},'secondDisposition':{'type':Sequelize[_0x38cb('0x3')]},'thirdDisposition':{'type':Sequelize[_0x38cb('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x38cb('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index d074cee..61273e7 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 _0xe1e6=['order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','index','VoiceQueueReport','rawAttributes','type','key','model','map','name','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','getVoiceQueuesReport','length','hasOwnProperty'];(function(_0x26e2e8,_0x105b22){var _0x238da5=function(_0x55835f){while(--_0x55835f){_0x26e2e8['push'](_0x26e2e8['shift']());}};_0x238da5(++_0x105b22);}(_0xe1e6,0xa9));var _0x6e1e=function(_0x3a7c3b,_0x5def2d){_0x3a7c3b=_0x3a7c3b-0x0;var _0x44abc2=_0xe1e6[_0x3a7c3b];return _0x44abc2;};'use strict';var emlformat=require(_0x6e1e('0x0'));var rimraf=require(_0x6e1e('0x1'));var zipdir=require(_0x6e1e('0x2'));var jsonpatch=require(_0x6e1e('0x3'));var rp=require(_0x6e1e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6e1e('0x5'));var util=require(_0x6e1e('0x6'));var path=require(_0x6e1e('0x7'));var sox=require(_0x6e1e('0x8'));var csv=require(_0x6e1e('0x9'));var ejs=require(_0x6e1e('0xa'));var fs=require('fs');var fs_extra=require(_0x6e1e('0xb'));var _=require(_0x6e1e('0xc'));var squel=require('squel');var crypto=require(_0x6e1e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6e1e('0x9'));var querystring=require(_0x6e1e('0xe'));var Papa=require(_0x6e1e('0xf'));var Redis=require('ioredis');var authService=require(_0x6e1e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6e1e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e1e('0x12'))(_0x6e1e('0x13'));var utils=require(_0x6e1e('0x14'));var config=require(_0x6e1e('0x15'));var licenseUtil=require(_0x6e1e('0x16'));var db=require(_0x6e1e('0x17'))['db'];config[_0x6e1e('0x18')]=_[_0x6e1e('0x19')](config[_0x6e1e('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6e1e('0x1a'))(new Redis(config[_0x6e1e('0x18')]));require(_0x6e1e('0x1b'))['register'](socket);function respondWithStatusCode(_0x129e8e,_0x341a57){_0x341a57=_0x341a57||0xcc;return function(_0x127065){if(_0x127065){return _0x129e8e[_0x6e1e('0x1c')](_0x341a57);}return _0x129e8e[_0x6e1e('0x1d')](_0x341a57)['end']();};}function respondWithResult(_0x37e3b6,_0xaa8273){_0xaa8273=_0xaa8273||0xc8;return function(_0x422b5f){if(_0x422b5f){return _0x37e3b6['status'](_0xaa8273)[_0x6e1e('0x1e')](_0x422b5f);}};}function respondWithFilteredResult(_0x343ba0,_0x1df55e){return function(_0x4834d2){if(_0x4834d2){var _0x3ad821=typeof _0x1df55e[_0x6e1e('0x1f')]==='undefined'&&typeof _0x1df55e[_0x6e1e('0x20')]===_0x6e1e('0x21');var _0x33c3ae=_0x4834d2[_0x6e1e('0x22')];var _0x44dab5=_0x3ad821?0x0:_0x1df55e[_0x6e1e('0x1f')];var _0x71da87=_0x3ad821?_0x4834d2['count']:_0x1df55e[_0x6e1e('0x1f')]+_0x1df55e[_0x6e1e('0x20')];var _0xbc5ee8;if(_0x71da87>=_0x33c3ae){_0x71da87=_0x33c3ae;_0xbc5ee8=0xc8;}else{_0xbc5ee8=0xce;}_0x343ba0[_0x6e1e('0x1d')](_0xbc5ee8);return _0x343ba0[_0x6e1e('0x23')](_0x6e1e('0x24'),_0x44dab5+'-'+_0x71da87+'/'+_0x33c3ae)['json'](_0x4834d2);}return null;};}function patchUpdates(_0x272e52){return function(_0x13dd4d){try{jsonpatch[_0x6e1e('0x25')](_0x13dd4d,_0x272e52,!![]);}catch(_0x3684df){return BPromise[_0x6e1e('0x26')](_0x3684df);}return _0x13dd4d[_0x6e1e('0x27')]();};}function saveUpdates(_0x464f35,_0x2ef3ca){return function(_0x243fc2){if(_0x243fc2){return _0x243fc2[_0x6e1e('0x28')](_0x464f35)[_0x6e1e('0x29')](function(_0x2dcf3d){return _0x2dcf3d;});}return null;};}function removeEntity(_0x2f88e9,_0x3acabd){return function(_0x15471f){if(_0x15471f){return _0x15471f[_0x6e1e('0x2a')]()['then'](function(){_0x2f88e9[_0x6e1e('0x1d')](0xcc)[_0x6e1e('0x2b')]();});}};}function handleEntityNotFound(_0x1dc7fa,_0x1dfb63){return function(_0x2b7dd5){if(!_0x2b7dd5){_0x1dc7fa[_0x6e1e('0x1c')](0x194);}return _0x2b7dd5;};}function handleError(_0x36338a,_0x30e8cb){_0x30e8cb=_0x30e8cb||0x1f4;return function(_0x20cd87){logger[_0x6e1e('0x2c')](_0x20cd87[_0x6e1e('0x2d')]);if(_0x20cd87['name']){delete _0x20cd87['name'];}_0x36338a[_0x6e1e('0x1d')](_0x30e8cb)[_0x6e1e('0x2e')](_0x20cd87);};}exports[_0x6e1e('0x2f')]=function(_0x3fec9c,_0xd2778f){var _0x5f0ef6={},_0x5d1680={},_0x25edad={'count':0x0,'rows':[]};var _0x45f455=_['map'](db[_0x6e1e('0x30')][_0x6e1e('0x31')],function(_0x54ff17){return{'name':_0x54ff17['fieldName'],'type':_0x54ff17[_0x6e1e('0x32')][_0x6e1e('0x33')]};});_0x5d1680[_0x6e1e('0x34')]=_[_0x6e1e('0x35')](_0x45f455,_0x6e1e('0x36'));_0x5d1680[_0x6e1e('0x37')]=_['keys'](_0x3fec9c[_0x6e1e('0x37')]);_0x5d1680[_0x6e1e('0x38')]=_[_0x6e1e('0x39')](_0x5d1680['model'],_0x5d1680[_0x6e1e('0x37')]);_0x5f0ef6[_0x6e1e('0x3a')]=_['intersection'](_0x5d1680[_0x6e1e('0x34')],qs[_0x6e1e('0x3b')](_0x3fec9c['query'][_0x6e1e('0x3b')]));_0x5f0ef6['attributes']=_0x5f0ef6['attributes']['length']?_0x5f0ef6[_0x6e1e('0x3a')]:_0x5d1680[_0x6e1e('0x34')];if(!_0x3fec9c['query']['hasOwnProperty'](_0x6e1e('0x3c'))){_0x5f0ef6[_0x6e1e('0x20')]=qs['limit'](_0x3fec9c['query'][_0x6e1e('0x20')]);_0x5f0ef6[_0x6e1e('0x1f')]=qs[_0x6e1e('0x1f')](_0x3fec9c['query'][_0x6e1e('0x1f')]);}_0x5f0ef6['order']=qs[_0x6e1e('0x3d')](_0x3fec9c['query'][_0x6e1e('0x3d')]);_0x5f0ef6[_0x6e1e('0x3e')]=qs[_0x6e1e('0x38')](_[_0x6e1e('0x3f')](_0x3fec9c[_0x6e1e('0x37')],_0x5d1680[_0x6e1e('0x38')]),_0x45f455);if(_0x3fec9c[_0x6e1e('0x37')][_0x6e1e('0x40')]){_0x5f0ef6[_0x6e1e('0x3e')]=_['merge'](_0x5f0ef6[_0x6e1e('0x3e')],{'$or':_['map'](_0x45f455,function(_0x15ab02){if(_0x15ab02[_0x6e1e('0x32')]!==_0x6e1e('0x41')){var _0x815d71={};_0x815d71[_0x15ab02[_0x6e1e('0x36')]]={'$like':'%'+_0x3fec9c[_0x6e1e('0x37')][_0x6e1e('0x40')]+'%'};return _0x815d71;}})});}_0x5f0ef6=_[_0x6e1e('0x42')]({},_0x5f0ef6,_0x3fec9c[_0x6e1e('0x43')]);var _0x1e8bf3={'where':_0x5f0ef6['where']};return db['VoiceQueueReport'][_0x6e1e('0x22')](_0x1e8bf3)[_0x6e1e('0x29')](function(_0x398d31){_0x25edad[_0x6e1e('0x22')]=_0x398d31;if(_0x3fec9c[_0x6e1e('0x37')][_0x6e1e('0x44')]){_0x5f0ef6[_0x6e1e('0x45')]=[{'all':!![]}];}return db[_0x6e1e('0x30')][_0x6e1e('0x46')](_0x5f0ef6);})[_0x6e1e('0x29')](function(_0x87dfdc){_0x25edad[_0x6e1e('0x47')]=_0x87dfdc;return _0x25edad;})['then'](respondWithFilteredResult(_0xd2778f,_0x5f0ef6))[_0x6e1e('0x48')](handleError(_0xd2778f,null));};exports[_0x6e1e('0x49')]=function(_0x456c84,_0x319558){var _0x4ee98a={'raw':![],'where':{'id':_0x456c84[_0x6e1e('0x4a')]['id']}},_0x156835={};_0x156835['model']=_[_0x6e1e('0x4b')](db[_0x6e1e('0x30')][_0x6e1e('0x31')]);_0x156835[_0x6e1e('0x37')]=_[_0x6e1e('0x4b')](_0x456c84[_0x6e1e('0x37')]);_0x156835[_0x6e1e('0x38')]=_[_0x6e1e('0x39')](_0x156835[_0x6e1e('0x34')],_0x156835['query']);_0x4ee98a['attributes']=_[_0x6e1e('0x39')](_0x156835[_0x6e1e('0x34')],qs[_0x6e1e('0x3b')](_0x456c84[_0x6e1e('0x37')]['fields']));_0x4ee98a[_0x6e1e('0x3a')]=_0x4ee98a[_0x6e1e('0x3a')]['length']?_0x4ee98a['attributes']:_0x156835[_0x6e1e('0x34')];if(_0x456c84[_0x6e1e('0x37')][_0x6e1e('0x44')]){_0x4ee98a[_0x6e1e('0x45')]=[{'all':!![]}];}_0x4ee98a=_[_0x6e1e('0x42')]({},_0x4ee98a,_0x456c84[_0x6e1e('0x43')]);return db['VoiceQueueReport']['find'](_0x4ee98a)[_0x6e1e('0x29')](handleEntityNotFound(_0x319558,null))[_0x6e1e('0x29')](respondWithResult(_0x319558,null))[_0x6e1e('0x48')](handleError(_0x319558,null));};exports[_0x6e1e('0x4c')]=function(_0x57624c,_0x5e5f6f){return db['VoiceQueueReport'][_0x6e1e('0x4c')](_0x57624c[_0x6e1e('0x4d')],{})['then'](respondWithResult(_0x5e5f6f,0xc9))[_0x6e1e('0x48')](handleError(_0x5e5f6f,null));};exports[_0x6e1e('0x28')]=function(_0x35dd94,_0x242227){if(_0x35dd94[_0x6e1e('0x4d')]['id']){delete _0x35dd94[_0x6e1e('0x4d')]['id'];}return db[_0x6e1e('0x30')][_0x6e1e('0x4e')]({'where':{'id':_0x35dd94[_0x6e1e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x242227,null))[_0x6e1e('0x29')](saveUpdates(_0x35dd94[_0x6e1e('0x4d')],null))['then'](respondWithResult(_0x242227,null))[_0x6e1e('0x48')](handleError(_0x242227,null));};exports[_0x6e1e('0x2a')]=function(_0x5ede12,_0xc2129e){return db[_0x6e1e('0x30')][_0x6e1e('0x4e')]({'where':{'id':_0x5ede12[_0x6e1e('0x4a')]['id']}})[_0x6e1e('0x29')](handleEntityNotFound(_0xc2129e,null))[_0x6e1e('0x29')](removeEntity(_0xc2129e,null))['catch'](handleError(_0xc2129e,null));};exports[_0x6e1e('0x4f')]=function(_0x269d85,_0x27aa54){return db[_0x6e1e('0x30')][_0x6e1e('0x4f')]()[_0x6e1e('0x29')](respondWithResult(_0x27aa54,null))['catch'](handleError(_0x27aa54,null));};exports[_0x6e1e('0x50')]=function(_0x51bab8,_0x43eba8){var _0x981e15={},_0x4ec191={},_0x3a237f={'count':0x0,'rows':[]};_0x4ec191[_0x6e1e('0x34')]=_[_0x6e1e('0x4b')](db[_0x6e1e('0x30')][_0x6e1e('0x31')]);_0x4ec191['query']=_[_0x6e1e('0x4b')](_0x51bab8['query']);_0x4ec191['filters']=_['intersection'](_0x4ec191[_0x6e1e('0x34')],_0x4ec191[_0x6e1e('0x37')]);_0x981e15['attributes']=_['intersection'](_0x4ec191[_0x6e1e('0x34')],qs[_0x6e1e('0x3b')](_0x51bab8[_0x6e1e('0x37')][_0x6e1e('0x3b')]));_0x981e15['attributes']=_0x981e15[_0x6e1e('0x3a')][_0x6e1e('0x51')]?_0x981e15[_0x6e1e('0x3a')]:_0x4ec191[_0x6e1e('0x34')];if(!_0x51bab8[_0x6e1e('0x37')][_0x6e1e('0x52')]('nolimit')){_0x981e15[_0x6e1e('0x20')]=qs['limit'](_0x51bab8['query'][_0x6e1e('0x20')]);_0x981e15[_0x6e1e('0x1f')]=qs['offset'](_0x51bab8['query'][_0x6e1e('0x1f')]);}_0x981e15[_0x6e1e('0x53')]=qs[_0x6e1e('0x3d')](_0x51bab8['query'][_0x6e1e('0x3d')]);_0x981e15[_0x6e1e('0x3e')]=qs[_0x6e1e('0x38')](_[_0x6e1e('0x3f')](_0x51bab8[_0x6e1e('0x37')],_0x4ec191[_0x6e1e('0x38')]));if(_0x51bab8[_0x6e1e('0x37')][_0x6e1e('0x40')]){_0x981e15['where']=_['merge'](_0x981e15['where'],{'$or':_[_0x6e1e('0x35')](_0x981e15[_0x6e1e('0x3a')],function(_0x3536fe){var _0xf6fa35={};_0xf6fa35[_0x3536fe]={'$like':'%'+_0x51bab8[_0x6e1e('0x37')][_0x6e1e('0x40')]+'%'};return _0xf6fa35;})});}_0x981e15=_[_0x6e1e('0x42')]({},_0x981e15,_0x51bab8['options']);var _0x44056a={'where':_0x981e15[_0x6e1e('0x3e')]};return db[_0x6e1e('0x30')][_0x6e1e('0x22')](_0x44056a)[_0x6e1e('0x29')](function(_0x5832fa){_0x3a237f[_0x6e1e('0x22')]=_0x5832fa;if(_0x51bab8[_0x6e1e('0x37')][_0x6e1e('0x44')]){_0x981e15['include']=[{'all':!![]}];}return db[_0x6e1e('0x30')]['findAll'](_0x981e15);})[_0x6e1e('0x29')](function(_0x3428aa){_0x3a237f[_0x6e1e('0x47')]=_0x3428aa;return _0x3a237f;})[_0x6e1e('0x29')](respondWithFilteredResult(_0x43eba8,_0x981e15,_0x6e1e('0x50')))[_0x6e1e('0x48')](handleError(_0x43eba8,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0xfe6c=['where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','VoiceQueueReport','keys','includeAll','find','create','body','describe','getVoiceQueuesReport','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x15e58c,_0x116060){var _0x2ea890=function(_0xd0f0c4){while(--_0xd0f0c4){_0x15e58c['push'](_0x15e58c['shift']());}};_0x2ea890(++_0x116060);}(_0xfe6c,0x113));var _0xcfe6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe6c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xcfe6('0x0'));var rimraf=require(_0xcfe6('0x1'));var zipdir=require(_0xcfe6('0x2'));var jsonpatch=require(_0xcfe6('0x3'));var rp=require(_0xcfe6('0x4'));var moment=require(_0xcfe6('0x5'));var BPromise=require(_0xcfe6('0x6'));var Mustache=require(_0xcfe6('0x7'));var util=require(_0xcfe6('0x8'));var path=require(_0xcfe6('0x9'));var sox=require(_0xcfe6('0xa'));var csv=require(_0xcfe6('0xb'));var ejs=require(_0xcfe6('0xc'));var fs=require('fs');var fs_extra=require(_0xcfe6('0xd'));var _=require(_0xcfe6('0xe'));var squel=require(_0xcfe6('0xf'));var crypto=require(_0xcfe6('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xcfe6('0x11'));var toCsv=require(_0xcfe6('0xb'));var querystring=require(_0xcfe6('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcfe6('0x13'));var as=require(_0xcfe6('0x14'));var hardwareService=require(_0xcfe6('0x15'));var logger=require(_0xcfe6('0x16'))(_0xcfe6('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcfe6('0x18'))['db'];config['redis']=_[_0xcfe6('0x19')](config[_0xcfe6('0x1a')],{'host':_0xcfe6('0x1b'),'port':0x18eb});var socket=require(_0xcfe6('0x1c'))(new Redis(config[_0xcfe6('0x1a')]));require(_0xcfe6('0x1d'))['register'](socket);function respondWithStatusCode(_0x4be46c,_0x4a90fd){_0x4a90fd=_0x4a90fd||0xcc;return function(_0x294408){if(_0x294408){return _0x4be46c[_0xcfe6('0x1e')](_0x4a90fd);}return _0x4be46c[_0xcfe6('0x1f')](_0x4a90fd)[_0xcfe6('0x20')]();};}function respondWithResult(_0x52e0c6,_0x1e4388){_0x1e4388=_0x1e4388||0xc8;return function(_0x5db30d){if(_0x5db30d){return _0x52e0c6[_0xcfe6('0x1f')](_0x1e4388)[_0xcfe6('0x21')](_0x5db30d);}};}function respondWithFilteredResult(_0x4b12e9,_0x11e93a){return function(_0xa9411d){if(_0xa9411d){var _0x384467=typeof _0x11e93a['offset']===_0xcfe6('0x22')&&typeof _0x11e93a[_0xcfe6('0x23')]===_0xcfe6('0x22');var _0x25fb3d=_0xa9411d[_0xcfe6('0x24')];var _0x5ac063=_0x384467?0x0:_0x11e93a[_0xcfe6('0x25')];var _0x305809=_0x384467?_0xa9411d[_0xcfe6('0x24')]:_0x11e93a[_0xcfe6('0x25')]+_0x11e93a[_0xcfe6('0x23')];var _0x37a8d3;if(_0x305809>=_0x25fb3d){_0x305809=_0x25fb3d;_0x37a8d3=0xc8;}else{_0x37a8d3=0xce;}_0x4b12e9[_0xcfe6('0x1f')](_0x37a8d3);return _0x4b12e9[_0xcfe6('0x26')](_0xcfe6('0x27'),_0x5ac063+'-'+_0x305809+'/'+_0x25fb3d)['json'](_0xa9411d);}return null;};}function patchUpdates(_0x5ce5fb){return function(_0x5472dd){try{jsonpatch[_0xcfe6('0x28')](_0x5472dd,_0x5ce5fb,!![]);}catch(_0x73381e){return BPromise[_0xcfe6('0x29')](_0x73381e);}return _0x5472dd[_0xcfe6('0x2a')]();};}function saveUpdates(_0x4f7590,_0x4da8a3){return function(_0x425864){if(_0x425864){return _0x425864[_0xcfe6('0x2b')](_0x4f7590)[_0xcfe6('0x2c')](function(_0x54e2e5){return _0x54e2e5;});}return null;};}function removeEntity(_0x236569,_0x58e1f6){return function(_0x34fd09){if(_0x34fd09){return _0x34fd09[_0xcfe6('0x2d')]()[_0xcfe6('0x2c')](function(){_0x236569[_0xcfe6('0x1f')](0xcc)[_0xcfe6('0x20')]();});}};}function handleEntityNotFound(_0x5214a9,_0x342a6c){return function(_0x481f99){if(!_0x481f99){_0x5214a9[_0xcfe6('0x1e')](0x194);}return _0x481f99;};}function handleError(_0x49d4ba,_0x3eaf92){_0x3eaf92=_0x3eaf92||0x1f4;return function(_0x45c174){logger[_0xcfe6('0x2e')](_0x45c174[_0xcfe6('0x2f')]);if(_0x45c174[_0xcfe6('0x30')]){delete _0x45c174['name'];}_0x49d4ba[_0xcfe6('0x1f')](_0x3eaf92)[_0xcfe6('0x31')](_0x45c174);};}exports[_0xcfe6('0x32')]=function(_0x3c7998,_0x5798e2){var _0x433654={},_0x3d5127={},_0x48061e={'count':0x0,'rows':[]};var _0x3c9691=_[_0xcfe6('0x33')](db['VoiceQueueReport'][_0xcfe6('0x34')],function(_0x59fae7){return{'name':_0x59fae7['fieldName'],'type':_0x59fae7[_0xcfe6('0x35')][_0xcfe6('0x36')]};});_0x3d5127[_0xcfe6('0x37')]=_['map'](_0x3c9691,_0xcfe6('0x30'));_0x3d5127[_0xcfe6('0x38')]=_['keys'](_0x3c7998['query']);_0x3d5127[_0xcfe6('0x39')]=_[_0xcfe6('0x3a')](_0x3d5127[_0xcfe6('0x37')],_0x3d5127[_0xcfe6('0x38')]);_0x433654[_0xcfe6('0x3b')]=_['intersection'](_0x3d5127['model'],qs['fields'](_0x3c7998[_0xcfe6('0x38')][_0xcfe6('0x3c')]));_0x433654[_0xcfe6('0x3b')]=_0x433654[_0xcfe6('0x3b')][_0xcfe6('0x3d')]?_0x433654[_0xcfe6('0x3b')]:_0x3d5127[_0xcfe6('0x37')];if(!_0x3c7998[_0xcfe6('0x38')][_0xcfe6('0x3e')]('nolimit')){_0x433654[_0xcfe6('0x23')]=qs[_0xcfe6('0x23')](_0x3c7998[_0xcfe6('0x38')][_0xcfe6('0x23')]);_0x433654['offset']=qs[_0xcfe6('0x25')](_0x3c7998[_0xcfe6('0x38')]['offset']);}_0x433654[_0xcfe6('0x3f')]=qs[_0xcfe6('0x40')](_0x3c7998['query']['sort']);_0x433654[_0xcfe6('0x41')]=qs['filters'](_[_0xcfe6('0x42')](_0x3c7998['query'],_0x3d5127[_0xcfe6('0x39')]),_0x3c9691);if(_0x3c7998['query'][_0xcfe6('0x43')]){_0x433654[_0xcfe6('0x41')]=_[_0xcfe6('0x44')](_0x433654[_0xcfe6('0x41')],{'$or':_[_0xcfe6('0x33')](_0x3c9691,function(_0x30b954){if(_0x30b954[_0xcfe6('0x35')]!==_0xcfe6('0x45')){var _0x3f7072={};_0x3f7072[_0x30b954[_0xcfe6('0x30')]]={'$like':'%'+_0x3c7998[_0xcfe6('0x38')]['filter']+'%'};return _0x3f7072;}})});}_0x433654=_['merge']({},_0x433654,_0x3c7998[_0xcfe6('0x46')]);var _0x42fe0e={'where':_0x433654[_0xcfe6('0x41')]};return db['VoiceQueueReport']['count'](_0x42fe0e)['then'](function(_0x2a4b7a){_0x48061e['count']=_0x2a4b7a;if(_0x3c7998['query']['includeAll']){_0x433654[_0xcfe6('0x47')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xcfe6('0x48')](_0x433654);})[_0xcfe6('0x2c')](function(_0xf6ae8){_0x48061e[_0xcfe6('0x49')]=_0xf6ae8;return _0x48061e;})[_0xcfe6('0x2c')](respondWithFilteredResult(_0x5798e2,_0x433654))[_0xcfe6('0x4a')](handleError(_0x5798e2,null));};exports['show']=function(_0x2dfa32,_0x54db55){var _0x5ae84c={'raw':![],'where':{'id':_0x2dfa32[_0xcfe6('0x4b')]['id']}},_0x73b22={};_0x73b22[_0xcfe6('0x37')]=_['keys'](db[_0xcfe6('0x4c')]['rawAttributes']);_0x73b22[_0xcfe6('0x38')]=_[_0xcfe6('0x4d')](_0x2dfa32[_0xcfe6('0x38')]);_0x73b22[_0xcfe6('0x39')]=_[_0xcfe6('0x3a')](_0x73b22[_0xcfe6('0x37')],_0x73b22['query']);_0x5ae84c['attributes']=_[_0xcfe6('0x3a')](_0x73b22[_0xcfe6('0x37')],qs['fields'](_0x2dfa32[_0xcfe6('0x38')][_0xcfe6('0x3c')]));_0x5ae84c['attributes']=_0x5ae84c[_0xcfe6('0x3b')]['length']?_0x5ae84c['attributes']:_0x73b22[_0xcfe6('0x37')];if(_0x2dfa32[_0xcfe6('0x38')][_0xcfe6('0x4e')]){_0x5ae84c[_0xcfe6('0x47')]=[{'all':!![]}];}_0x5ae84c=_[_0xcfe6('0x44')]({},_0x5ae84c,_0x2dfa32[_0xcfe6('0x46')]);return db[_0xcfe6('0x4c')][_0xcfe6('0x4f')](_0x5ae84c)[_0xcfe6('0x2c')](handleEntityNotFound(_0x54db55,null))[_0xcfe6('0x2c')](respondWithResult(_0x54db55,null))[_0xcfe6('0x4a')](handleError(_0x54db55,null));};exports['create']=function(_0x925adc,_0x284925){return db[_0xcfe6('0x4c')][_0xcfe6('0x50')](_0x925adc[_0xcfe6('0x51')],{})[_0xcfe6('0x2c')](respondWithResult(_0x284925,0xc9))[_0xcfe6('0x4a')](handleError(_0x284925,null));};exports[_0xcfe6('0x2b')]=function(_0x11653e,_0x46f1fa){if(_0x11653e['body']['id']){delete _0x11653e[_0xcfe6('0x51')]['id'];}return db[_0xcfe6('0x4c')][_0xcfe6('0x4f')]({'where':{'id':_0x11653e['params']['id']}})[_0xcfe6('0x2c')](handleEntityNotFound(_0x46f1fa,null))[_0xcfe6('0x2c')](saveUpdates(_0x11653e['body'],null))['then'](respondWithResult(_0x46f1fa,null))[_0xcfe6('0x4a')](handleError(_0x46f1fa,null));};exports[_0xcfe6('0x2d')]=function(_0x378f64,_0x564127){return db[_0xcfe6('0x4c')][_0xcfe6('0x4f')]({'where':{'id':_0x378f64[_0xcfe6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x564127,null))[_0xcfe6('0x2c')](removeEntity(_0x564127,null))[_0xcfe6('0x4a')](handleError(_0x564127,null));};exports[_0xcfe6('0x52')]=function(_0x2fe646,_0x4171bd){return db['VoiceQueueReport']['describe']()[_0xcfe6('0x2c')](respondWithResult(_0x4171bd,null))['catch'](handleError(_0x4171bd,null));};exports[_0xcfe6('0x53')]=function(_0x8b6a7,_0x67c435){var _0x15e676={},_0x3384cd={},_0x4f48c0={'count':0x0,'rows':[]};_0x3384cd['model']=_[_0xcfe6('0x4d')](db['VoiceQueueReport'][_0xcfe6('0x34')]);_0x3384cd['query']=_[_0xcfe6('0x4d')](_0x8b6a7[_0xcfe6('0x38')]);_0x3384cd['filters']=_[_0xcfe6('0x3a')](_0x3384cd[_0xcfe6('0x37')],_0x3384cd[_0xcfe6('0x38')]);_0x15e676[_0xcfe6('0x3b')]=_[_0xcfe6('0x3a')](_0x3384cd[_0xcfe6('0x37')],qs[_0xcfe6('0x3c')](_0x8b6a7[_0xcfe6('0x38')][_0xcfe6('0x3c')]));_0x15e676[_0xcfe6('0x3b')]=_0x15e676['attributes'][_0xcfe6('0x3d')]?_0x15e676['attributes']:_0x3384cd[_0xcfe6('0x37')];if(!_0x8b6a7[_0xcfe6('0x38')]['hasOwnProperty'](_0xcfe6('0x54'))){_0x15e676['limit']=qs[_0xcfe6('0x23')](_0x8b6a7['query'][_0xcfe6('0x23')]);_0x15e676[_0xcfe6('0x25')]=qs[_0xcfe6('0x25')](_0x8b6a7[_0xcfe6('0x38')]['offset']);}_0x15e676[_0xcfe6('0x3f')]=qs['sort'](_0x8b6a7[_0xcfe6('0x38')]['sort']);_0x15e676[_0xcfe6('0x41')]=qs[_0xcfe6('0x39')](_['pick'](_0x8b6a7['query'],_0x3384cd[_0xcfe6('0x39')]));if(_0x8b6a7[_0xcfe6('0x38')]['filter']){_0x15e676[_0xcfe6('0x41')]=_[_0xcfe6('0x44')](_0x15e676['where'],{'$or':_['map'](_0x15e676[_0xcfe6('0x3b')],function(_0x450c31){var _0x5c1bd4={};_0x5c1bd4[_0x450c31]={'$like':'%'+_0x8b6a7['query'][_0xcfe6('0x43')]+'%'};return _0x5c1bd4;})});}_0x15e676=_['merge']({},_0x15e676,_0x8b6a7['options']);var _0x5419eb={'where':_0x15e676[_0xcfe6('0x41')]};return db[_0xcfe6('0x4c')][_0xcfe6('0x24')](_0x5419eb)['then'](function(_0xdea7fb){_0x4f48c0[_0xcfe6('0x24')]=_0xdea7fb;if(_0x8b6a7[_0xcfe6('0x38')][_0xcfe6('0x4e')]){_0x15e676[_0xcfe6('0x47')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x15e676);})[_0xcfe6('0x2c')](function(_0x242bee){_0x4f48c0[_0xcfe6('0x49')]=_0x242bee;return _0x4f48c0;})[_0xcfe6('0x2c')](respondWithFilteredResult(_0x67c435,_0x15e676,_0xcfe6('0x53')))[_0xcfe6('0x4a')](handleError(_0x67c435,null,_0xcfe6('0x53')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 026f434..0408387 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 _0x0bd4=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','save'];(function(_0x47e463,_0x2034d6){var _0x39fd6d=function(_0x5618ab){while(--_0x5618ab){_0x47e463['push'](_0x47e463['shift']());}};_0x39fd6d(++_0x2034d6);}(_0x0bd4,0x1d2));var _0x40bd=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x0bd4[_0x5d6e30];return _0x3d3f3b;};'use strict';var EventEmitter=require(_0x40bd('0x0'));var VoiceQueueReport=require(_0x40bd('0x1'))['db'][_0x40bd('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x40bd('0x3'),'afterUpdate':_0x40bd('0x4'),'afterDestroy':_0x40bd('0x5')};function emitEvent(_0x3e03b1){return function(_0x4db3f0,_0x4bb933,_0x558d55){VoiceQueueReportEvents['emit'](_0x3e03b1+':'+_0x4db3f0['id'],_0x4db3f0);VoiceQueueReportEvents[_0x40bd('0x6')](_0x3e03b1,_0x4db3f0);_0x558d55(null);};}for(var e in events){if(events[_0x40bd('0x7')](e)){var event=events[e];VoiceQueueReport[_0x40bd('0x8')](e,emitEvent(event));}}module[_0x40bd('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x6c19=['save','update','remove','emit','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x1e37bc,_0x1069b0){var _0x530519=function(_0x32af5d){while(--_0x32af5d){_0x1e37bc['push'](_0x1e37bc['shift']());}};_0x530519(++_0x1069b0);}(_0x6c19,0x1be));var _0x96c1=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0x6c19[_0x3c2b2e];return _0x27a338;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x96c1('0x0'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x96c1('0x1')](0x0);var events={'afterCreate':_0x96c1('0x2'),'afterUpdate':_0x96c1('0x3'),'afterDestroy':_0x96c1('0x4')};function emitEvent(_0x167d98){return function(_0x5db383,_0x1ca5df,_0x3696d6){VoiceQueueReportEvents[_0x96c1('0x5')](_0x167d98+':'+_0x5db383['id'],_0x5db383);VoiceQueueReportEvents[_0x96c1('0x5')](_0x167d98,_0x5db383);_0x3696d6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x96c1('0x6')](e,emitEvent(event));}}module[_0x96c1('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index ccb954d..ea28783 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 _0x1da7=['uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','VoiceQueueReport'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1da7,0x13a));var _0x71da=function(_0x1be832,_0xb8c74){_0x1be832=_0x1be832-0x0;var _0x430e80=_0x1da7[_0x1be832];return _0x430e80;};'use strict';var _=require(_0x71da('0x0'));var util=require(_0x71da('0x1'));var logger=require(_0x71da('0x2'))(_0x71da('0x3'));var moment=require(_0x71da('0x4'));var BPromise=require(_0x71da('0x5'));var rp=require(_0x71da('0x6'));var fs=require('fs');var path=require(_0x71da('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0x71da('0x8')]=function(_0x132274,_0x1f5096){return _0x132274[_0x71da('0x9')](_0x71da('0xa'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x71da('0xb')]},{'fields':[_0x71da('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f3c=['VoiceQueueReport','calleridnum','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x4d232b,_0x432859){var _0xad6297=function(_0x11bac0){while(--_0x11bac0){_0x4d232b['push'](_0x4d232b['shift']());}};_0xad6297(++_0x432859);}(_0x1f3c,0x92));var _0xc1f3=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x1f3c[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xc1f3('0x0'));var util=require('util');var logger=require(_0xc1f3('0x1'))(_0xc1f3('0x2'));var moment=require('moment');var BPromise=require(_0xc1f3('0x3'));var rp=require(_0xc1f3('0x4'));var fs=require('fs');var path=require(_0xc1f3('0x5'));var rimraf=require(_0xc1f3('0x6'));var config=require(_0xc1f3('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0xc1f3('0x8')]=function(_0x11138a,_0x29dc3b){return _0x11138a[_0xc1f3('0x9')](_0xc1f3('0xa'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xc1f3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 72db4f7..e090712 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 _0x02af=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','localhost','socket.io-emitter','redis','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','VoiceQueueReport','findAll','options','raw','where','limit','include','map','model','attributes','GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','update','body','UpdateVoiceQueueReport','lodash','util'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0x02af,0xc6));var _0xf02a=function(_0x4c9fd9,_0x369f41){_0x4c9fd9=_0x4c9fd9-0x0;var _0xa17450=_0x02af[_0x4c9fd9];return _0xa17450;};'use strict';var _=require(_0xf02a('0x0'));var util=require(_0xf02a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf02a('0x2'));var fs=require('fs');var Redis=require(_0xf02a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf02a('0x4'));var logger=require(_0xf02a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf02a('0x6'));var client=jayson['client'][_0xf02a('0x7')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xf02a('0x8'),'port':0x18eb});var socket=require(_0xf02a('0x9'))(new Redis(config[_0xf02a('0xa')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x9c64e1,_0x10dc45,_0x4f1096){return new BPromise(function(_0x541f6f,_0x386edc){return client[_0xf02a('0xb')](_0x9c64e1,_0x4f1096)[_0xf02a('0xc')](function(_0x3c3cc0){logger[_0xf02a('0xd')](_0xf02a('0xe'),_0x10dc45,'request\x20sent');logger[_0xf02a('0xf')](_0xf02a('0x10'),_0x10dc45,_0xf02a('0x11'),JSON[_0xf02a('0x12')](_0x3c3cc0));if(_0x3c3cc0[_0xf02a('0x13')]){if(_0x3c3cc0[_0xf02a('0x13')][_0xf02a('0x14')]===0x1f4){logger['error'](_0xf02a('0xe'),_0x10dc45,_0x3c3cc0[_0xf02a('0x13')][_0xf02a('0x15')]);return _0x386edc(_0x3c3cc0['error']['message']);}logger[_0xf02a('0x13')](_0xf02a('0xe'),_0x10dc45,_0x3c3cc0['error'][_0xf02a('0x15')]);return _0x541f6f(_0x3c3cc0[_0xf02a('0x13')][_0xf02a('0x15')]);}else{logger[_0xf02a('0xd')](_0xf02a('0xe'),_0x10dc45,'request\x20sent');_0x541f6f(_0x3c3cc0[_0xf02a('0x16')][_0xf02a('0x15')]);}})['catch'](function(_0x4f5569){logger[_0xf02a('0x13')](_0xf02a('0xe'),_0x10dc45,_0x4f5569);_0x386edc(_0x4f5569);});});}exports['GetVoiceQueueReport']=function(_0x256f34){var _0x17ff03=this;return new Promise(function(_0x43acd8,_0x3f7bfc){return db[_0xf02a('0x17')][_0xf02a('0x18')]({'raw':_0x256f34[_0xf02a('0x19')]?_0x256f34['options'][_0xf02a('0x1a')]===undefined?!![]:![]:!![],'where':_0x256f34[_0xf02a('0x19')]?_0x256f34['options'][_0xf02a('0x1b')]||null:null,'attributes':_0x256f34[_0xf02a('0x19')]?_0x256f34['options']['attributes']||null:null,'limit':_0x256f34[_0xf02a('0x19')]?_0x256f34[_0xf02a('0x19')][_0xf02a('0x1c')]||null:null,'include':_0x256f34['options']?_0x256f34[_0xf02a('0x19')][_0xf02a('0x1d')]?_[_0xf02a('0x1e')](_0x256f34[_0xf02a('0x19')][_0xf02a('0x1d')],function(_0x19dfee){return{'model':db[_0x19dfee[_0xf02a('0x1f')]],'as':_0x19dfee['as'],'attributes':_0x19dfee[_0xf02a('0x20')],'include':_0x19dfee['include']?_[_0xf02a('0x1e')](_0x19dfee[_0xf02a('0x1d')],function(_0x413e78){return{'model':db[_0x413e78[_0xf02a('0x1f')]],'as':_0x413e78['as'],'attributes':_0x413e78[_0xf02a('0x20')],'include':_0x413e78[_0xf02a('0x1d')]?_[_0xf02a('0x1e')](_0x413e78[_0xf02a('0x1d')],function(_0x34350d){return{'model':db[_0x34350d[_0xf02a('0x1f')]],'as':_0x34350d['as'],'attributes':_0x34350d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x69084a){logger[_0xf02a('0xd')](_0xf02a('0x21'),_0x256f34);logger[_0xf02a('0xf')](_0xf02a('0x21'),_0x256f34,JSON[_0xf02a('0x12')](_0x69084a));_0x43acd8(_0x69084a);})[_0xf02a('0x22')](function(_0x4ade1a){logger['error'](_0xf02a('0x21'),_0x4ade1a['message'],_0x256f34);_0x3f7bfc(_0x17ff03[_0xf02a('0x13')](0x1f4,_0x4ade1a[_0xf02a('0x15')]));});});};exports[_0xf02a('0x23')]=function(_0x3d5cb2){var _0x1ec008=this;return new Promise(function(_0x8896f0,_0x1b41c4){return db[_0xf02a('0x17')][_0xf02a('0x24')](_0x3d5cb2['body'],{'raw':_0x3d5cb2[_0xf02a('0x19')]?_0x3d5cb2['options'][_0xf02a('0x1a')]===undefined?!![]:![]:!![]})[_0xf02a('0xc')](function(_0x585950){logger['info']('CreateVoiceQueueReport',_0x3d5cb2);logger[_0xf02a('0xf')](_0xf02a('0x23'),_0x3d5cb2,JSON[_0xf02a('0x12')](_0x585950));_0x8896f0(_0x585950);})[_0xf02a('0x22')](function(_0xe2be1){logger[_0xf02a('0x13')]('CreateVoiceQueueReport',_0xe2be1[_0xf02a('0x15')],_0x3d5cb2);_0x1b41c4(_0x1ec008['error'](0x1f4,_0xe2be1[_0xf02a('0x15')]));});});};exports['UpdateVoiceQueueReport']=function(_0x31e532){var _0x35a803=this;return new Promise(function(_0x5d2094,_0x57ee98){return db['VoiceQueueReport'][_0xf02a('0x25')](_0x31e532[_0xf02a('0x26')],{'raw':_0x31e532[_0xf02a('0x19')]?_0x31e532[_0xf02a('0x19')][_0xf02a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31e532[_0xf02a('0x19')]?_0x31e532['options'][_0xf02a('0x1b')]||null:null,'attributes':_0x31e532[_0xf02a('0x19')]?_0x31e532[_0xf02a('0x19')][_0xf02a('0x20')]||null:null,'limit':_0x31e532['options']?_0x31e532[_0xf02a('0x19')][_0xf02a('0x1c')]||null:null})[_0xf02a('0xc')](function(_0x906922){logger['info'](_0xf02a('0x27'),_0x31e532);logger[_0xf02a('0xf')](_0xf02a('0x27'),_0x31e532,JSON[_0xf02a('0x12')](_0x906922));_0x5d2094(_0x906922);})[_0xf02a('0x22')](function(_0xa85fd){logger['error'](_0xf02a('0x27'),_0xa85fd[_0xf02a('0x15')],_0x31e532);_0x57ee98(_0x35a803['error'](0x1f4,_0xa85fd[_0xf02a('0x15')]));});});}; \ No newline at end of file +var _0x76bb=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','map','include','model','CreateVoiceQueueReport','body','raw','UpdateVoiceQueueReport','update','limit'];(function(_0x46dd31,_0x21f2c2){var _0x220191=function(_0x1d5b71){while(--_0x1d5b71){_0x46dd31['push'](_0x46dd31['shift']());}};_0x220191(++_0x21f2c2);}(_0x76bb,0x108));var _0xb76b=function(_0x1b02bb,_0x3d9fde){_0x1b02bb=_0x1b02bb-0x0;var _0x131245=_0x76bb[_0x1b02bb];return _0x131245;};'use strict';var _=require(_0xb76b('0x0'));var util=require('util');var moment=require(_0xb76b('0x1'));var BPromise=require(_0xb76b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb76b('0x3'));var db=require(_0xb76b('0x4'))['db'];var utils=require(_0xb76b('0x5'));var logger=require(_0xb76b('0x6'))(_0xb76b('0x7'));var config=require(_0xb76b('0x8'));var jayson=require(_0xb76b('0x9'));var client=jayson[_0xb76b('0xa')][_0xb76b('0xb')]({'port':0x232a});config[_0xb76b('0xc')]=_[_0xb76b('0xd')](config[_0xb76b('0xc')],{'host':_0xb76b('0xe'),'port':0x18eb});var socket=require(_0xb76b('0xf'))(new Redis(config[_0xb76b('0xc')]));require(_0xb76b('0x10'))['register'](socket);function respondWithRpcPromise(_0x301e46,_0x95c0da,_0x1094c4){return new BPromise(function(_0x3010ca,_0x450c28){return client[_0xb76b('0x11')](_0x301e46,_0x1094c4)[_0xb76b('0x12')](function(_0x406825){logger[_0xb76b('0x13')](_0xb76b('0x14'),_0x95c0da,_0xb76b('0x15'));logger[_0xb76b('0x16')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x95c0da,'request\x20sent',JSON[_0xb76b('0x17')](_0x406825));if(_0x406825[_0xb76b('0x18')]){if(_0x406825[_0xb76b('0x18')][_0xb76b('0x19')]===0x1f4){logger['error'](_0xb76b('0x14'),_0x95c0da,_0x406825[_0xb76b('0x18')][_0xb76b('0x1a')]);return _0x450c28(_0x406825[_0xb76b('0x18')][_0xb76b('0x1a')]);}logger[_0xb76b('0x18')](_0xb76b('0x14'),_0x95c0da,_0x406825[_0xb76b('0x18')][_0xb76b('0x1a')]);return _0x3010ca(_0x406825['error'][_0xb76b('0x1a')]);}else{logger[_0xb76b('0x13')](_0xb76b('0x14'),_0x95c0da,_0xb76b('0x15'));_0x3010ca(_0x406825[_0xb76b('0x1b')][_0xb76b('0x1a')]);}})[_0xb76b('0x1c')](function(_0x3b5ba2){logger[_0xb76b('0x18')](_0xb76b('0x14'),_0x95c0da,_0x3b5ba2);_0x450c28(_0x3b5ba2);});});}exports[_0xb76b('0x1d')]=function(_0x22f70c){var _0x1e5eca=this;return new Promise(function(_0x39eb06,_0x1674de){return db[_0xb76b('0x1e')][_0xb76b('0x1f')]({'raw':_0x22f70c[_0xb76b('0x20')]?_0x22f70c['options']['raw']===undefined?!![]:![]:!![],'where':_0x22f70c[_0xb76b('0x20')]?_0x22f70c[_0xb76b('0x20')][_0xb76b('0x21')]||null:null,'attributes':_0x22f70c[_0xb76b('0x20')]?_0x22f70c[_0xb76b('0x20')][_0xb76b('0x22')]||null:null,'limit':_0x22f70c[_0xb76b('0x20')]?_0x22f70c[_0xb76b('0x20')]['limit']||null:null,'include':_0x22f70c[_0xb76b('0x20')]?_0x22f70c[_0xb76b('0x20')]['include']?_[_0xb76b('0x23')](_0x22f70c[_0xb76b('0x20')][_0xb76b('0x24')],function(_0x5cf9a8){return{'model':db[_0x5cf9a8['model']],'as':_0x5cf9a8['as'],'attributes':_0x5cf9a8['attributes'],'include':_0x5cf9a8[_0xb76b('0x24')]?_[_0xb76b('0x23')](_0x5cf9a8[_0xb76b('0x24')],function(_0x313db6){return{'model':db[_0x313db6[_0xb76b('0x25')]],'as':_0x313db6['as'],'attributes':_0x313db6[_0xb76b('0x22')],'include':_0x313db6[_0xb76b('0x24')]?_['map'](_0x313db6[_0xb76b('0x24')],function(_0xb77aac){return{'model':db[_0xb77aac['model']],'as':_0xb77aac['as'],'attributes':_0xb77aac[_0xb76b('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x555fe7){logger[_0xb76b('0x13')](_0xb76b('0x1d'),_0x22f70c);logger[_0xb76b('0x16')](_0xb76b('0x1d'),_0x22f70c,JSON[_0xb76b('0x17')](_0x555fe7));_0x39eb06(_0x555fe7);})[_0xb76b('0x1c')](function(_0xb5c6d9){logger[_0xb76b('0x18')](_0xb76b('0x1d'),_0xb5c6d9[_0xb76b('0x1a')],_0x22f70c);_0x1674de(_0x1e5eca[_0xb76b('0x18')](0x1f4,_0xb5c6d9[_0xb76b('0x1a')]));});});};exports[_0xb76b('0x26')]=function(_0x43f452){var _0x5409dc=this;return new Promise(function(_0x25f984,_0x1373ec){return db['VoiceQueueReport']['create'](_0x43f452[_0xb76b('0x27')],{'raw':_0x43f452['options']?_0x43f452[_0xb76b('0x20')][_0xb76b('0x28')]===undefined?!![]:![]:!![]})[_0xb76b('0x12')](function(_0x116502){logger['info'](_0xb76b('0x26'),_0x43f452);logger[_0xb76b('0x16')](_0xb76b('0x26'),_0x43f452,JSON['stringify'](_0x116502));_0x25f984(_0x116502);})[_0xb76b('0x1c')](function(_0x2548f9){logger[_0xb76b('0x18')]('CreateVoiceQueueReport',_0x2548f9['message'],_0x43f452);_0x1373ec(_0x5409dc[_0xb76b('0x18')](0x1f4,_0x2548f9['message']));});});};exports[_0xb76b('0x29')]=function(_0x5c0b79){var _0x4bf53a=this;return new Promise(function(_0x5a4e43,_0x15c4ab){return db[_0xb76b('0x1e')][_0xb76b('0x2a')](_0x5c0b79['body'],{'raw':_0x5c0b79[_0xb76b('0x20')]?_0x5c0b79[_0xb76b('0x20')][_0xb76b('0x28')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c0b79[_0xb76b('0x20')]?_0x5c0b79[_0xb76b('0x20')]['where']||null:null,'attributes':_0x5c0b79['options']?_0x5c0b79[_0xb76b('0x20')][_0xb76b('0x22')]||null:null,'limit':_0x5c0b79['options']?_0x5c0b79[_0xb76b('0x20')][_0xb76b('0x2b')]||null:null})[_0xb76b('0x12')](function(_0x28cf47){logger[_0xb76b('0x13')](_0xb76b('0x29'),_0x5c0b79);logger['debug']('UpdateVoiceQueueReport',_0x5c0b79,JSON[_0xb76b('0x17')](_0x28cf47));_0x5a4e43(_0x28cf47);})[_0xb76b('0x1c')](function(_0x12a6db){logger[_0xb76b('0x18')](_0xb76b('0x29'),_0x12a6db['message'],_0x5c0b79);_0x15c4ab(_0x4bf53a[_0xb76b('0x18')](0x1f4,_0x12a6db['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 7a59242..db59c89 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 _0x5a01=['save','remove','removeListener','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x4c0b00,_0x387522){var _0x1e50c5=function(_0x3b3959){while(--_0x3b3959){_0x4c0b00['push'](_0x4c0b00['shift']());}};_0x1e50c5(++_0x387522);}(_0x5a01,0x1af));var _0x15a0=function(_0x425d5e,_0x3b9040){_0x425d5e=_0x425d5e-0x0;var _0x3cc67b=_0x5a01[_0x425d5e];return _0x3cc67b;};'use strict';var VoiceQueueReportEvents=require(_0x15a0('0x0'));var events=[_0x15a0('0x1'),_0x15a0('0x2'),'update'];function createListener(_0x58ef33,_0x2e5096){return function(_0x2c65fb){_0x2e5096['emit'](_0x58ef33,_0x2c65fb);};}function removeListener(_0x1c83a1,_0x12ae6b){return function(){VoiceQueueReportEvents[_0x15a0('0x3')](_0x1c83a1,_0x12ae6b);};}exports['register']=function(_0x5cc5bd){for(var _0x2e15f2=0x0,_0x52ab0=events[_0x15a0('0x4')];_0x2e15f2<_0x52ab0;_0x2e15f2++){var _0x502248=events[_0x2e15f2];var _0x44f39a=createListener(_0x15a0('0x5')+_0x502248,_0x5cc5bd);VoiceQueueReportEvents['on'](_0x502248,_0x44f39a);}}; \ No newline at end of file +var _0x13fe=['update','emit','removeListener','register','./voiceQueueReport.events','save','remove'];(function(_0x5dbf15,_0x584143){var _0x83a363=function(_0x249f3e){while(--_0x249f3e){_0x5dbf15['push'](_0x5dbf15['shift']());}};_0x83a363(++_0x584143);}(_0x13fe,0x138));var _0xe13f=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x13fe[_0x13ea00];return _0x1f7347;};'use strict';var VoiceQueueReportEvents=require(_0xe13f('0x0'));var events=[_0xe13f('0x1'),_0xe13f('0x2'),_0xe13f('0x3')];function createListener(_0x329355,_0x2efd00){return function(_0x5f0bd1){_0x2efd00[_0xe13f('0x4')](_0x329355,_0x5f0bd1);};}function removeListener(_0x466eee,_0x19c559){return function(){VoiceQueueReportEvents[_0xe13f('0x5')](_0x466eee,_0x19c559);};}exports[_0xe13f('0x6')]=function(_0x1ddbff){for(var _0x2832ce=0x0,_0x594e3b=events['length'];_0x2832ce<_0x594e3b;_0x2832ce++){var _0x1b237d=events[_0x2832ce];var _0x39a413=createListener('voiceQueueReport:'+_0x1b237d,_0x1ddbff);VoiceQueueReportEvents['on'](_0x1b237d,_0x39a413);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 5367e46..e4ce220 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 _0xe539=['path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','update','delete','exports','multer'];(function(_0x30305f,_0x1a371c){var _0xe932ff=function(_0x299873){while(--_0x299873){_0x30305f['push'](_0x30305f['shift']());}};_0xe932ff(++_0x1a371c);}(_0xe539,0x164));var _0x9e53=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0xe539[_0x259d17];return _0x407535;};'use strict';var multer=require(_0x9e53('0x0'));var util=require('util');var path=require(_0x9e53('0x1'));var timeout=require(_0x9e53('0x2'));var express=require(_0x9e53('0x3'));var router=express[_0x9e53('0x4')]();var fs_extra=require(_0x9e53('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9e53('0x6'));var controller=require(_0x9e53('0x7'));router[_0x9e53('0x8')]('/',auth[_0x9e53('0x9')](),controller[_0x9e53('0xa')]);router[_0x9e53('0x8')](_0x9e53('0xb'),auth[_0x9e53('0x9')](),controller[_0x9e53('0xc')]);router[_0x9e53('0xd')]('/',auth[_0x9e53('0x9')](),controller['create']);router['put'](_0x9e53('0xb'),auth['isAuthenticated'](),controller[_0x9e53('0xe')]);router[_0x9e53('0xf')](_0x9e53('0xb'),auth[_0x9e53('0x9')](),controller['destroy']);module[_0x9e53('0x10')]=router; \ No newline at end of file +var _0x3bf4=['/:id','post','update','delete','destroy','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0x3bf4,0x1e1));var _0x43bf=function(_0x52be4b,_0x75a7cb){_0x52be4b=_0x52be4b-0x0;var _0x141b32=_0x3bf4[_0x52be4b];return _0x141b32;};'use strict';var multer=require('multer');var util=require(_0x43bf('0x0'));var path=require('path');var timeout=require(_0x43bf('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x43bf('0x2'));var auth=require(_0x43bf('0x3'));var interaction=require(_0x43bf('0x4'));var config=require('../../config/environment');var controller=require(_0x43bf('0x5'));router[_0x43bf('0x6')]('/',auth[_0x43bf('0x7')](),controller[_0x43bf('0x8')]);router[_0x43bf('0x6')](_0x43bf('0x9'),auth[_0x43bf('0x7')](),controller['show']);router[_0x43bf('0xa')]('/',auth[_0x43bf('0x7')](),controller['create']);router['put'](_0x43bf('0x9'),auth[_0x43bf('0x7')](),controller[_0x43bf('0xb')]);router[_0x43bf('0xc')]('/:id',auth[_0x43bf('0x7')](),controller[_0x43bf('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 5e6dbb2..55c18dc 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 _0x938d=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING','DATE'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0x938d,0x188));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd938('0x0'));var moment=require('moment');module[_0xd938('0x1')]={'time':{'type':Sequelize[_0xd938('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd938('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xd938('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xd938('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xd938('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd938('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xd938('0x3')],'allowNull':![],'defaultValue':moment()[_0xd938('0x4')](_0xd938('0x5'))}}; \ No newline at end of file +var _0x9b86=['STRING','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x6ae00a,_0x36f38c){var _0x1c85e4=function(_0x5eec9e){while(--_0x5eec9e){_0x6ae00a['push'](_0x6ae00a['shift']());}};_0x1c85e4(++_0x36f38c);}(_0x9b86,0x171));var _0x69b8=function(_0x13c15b,_0x791084){_0x13c15b=_0x13c15b-0x0;var _0x3e8569=_0x9b86[_0x13c15b];return _0x3e8569;};'use strict';var Sequelize=require(_0x69b8('0x0'));var moment=require(_0x69b8('0x1'));module[_0x69b8('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x69b8('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x69b8('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x69b8('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x69b8('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x69b8('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x69b8('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x69b8('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x69b8('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x69b8('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x69b8('0x4')](_0x69b8('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 587fdc8..7d6ed81 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 _0x1581=['stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1581,0x71));var _0x1158=function(_0x2d3c81,_0x8cafe4){_0x2d3c81=_0x2d3c81-0x0;var _0x13fd1f=_0x1581[_0x2d3c81];return _0x13fd1f;};'use strict';var emlformat=require(_0x1158('0x0'));var rimraf=require(_0x1158('0x1'));var zipdir=require(_0x1158('0x2'));var jsonpatch=require(_0x1158('0x3'));var rp=require(_0x1158('0x4'));var moment=require(_0x1158('0x5'));var BPromise=require(_0x1158('0x6'));var Mustache=require(_0x1158('0x7'));var util=require(_0x1158('0x8'));var path=require(_0x1158('0x9'));var sox=require(_0x1158('0xa'));var csv=require(_0x1158('0xb'));var ejs=require(_0x1158('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1158('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1158('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1158('0xf'));var Papa=require(_0x1158('0x10'));var Redis=require(_0x1158('0x11'));var authService=require(_0x1158('0x12'));var qs=require(_0x1158('0x13'));var as=require(_0x1158('0x14'));var hardwareService=require(_0x1158('0x15'));var logger=require(_0x1158('0x16'))(_0x1158('0x17'));var utils=require(_0x1158('0x18'));var config=require(_0x1158('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1158('0x1a'))['db'];function respondWithStatusCode(_0x309d4b,_0x57c2b5){_0x57c2b5=_0x57c2b5||0xcc;return function(_0x293bfa){if(_0x293bfa){return _0x309d4b['sendStatus'](_0x57c2b5);}return _0x309d4b['status'](_0x57c2b5)[_0x1158('0x1b')]();};}function respondWithResult(_0x252d2d,_0x51265d){_0x51265d=_0x51265d||0xc8;return function(_0x16444a){if(_0x16444a){return _0x252d2d[_0x1158('0x1c')](_0x51265d)[_0x1158('0x1d')](_0x16444a);}};}function respondWithFilteredResult(_0x496769,_0x20d600){return function(_0x4de9b8){if(_0x4de9b8){var _0x4404c7=typeof _0x20d600[_0x1158('0x1e')]===_0x1158('0x1f')&&typeof _0x20d600[_0x1158('0x20')]===_0x1158('0x1f');var _0x2e6359=_0x4de9b8[_0x1158('0x21')];var _0x52a328=_0x4404c7?0x0:_0x20d600[_0x1158('0x1e')];var _0x557c03=_0x4404c7?_0x4de9b8[_0x1158('0x21')]:_0x20d600[_0x1158('0x1e')]+_0x20d600[_0x1158('0x20')];var _0x46e537;if(_0x557c03>=_0x2e6359){_0x557c03=_0x2e6359;_0x46e537=0xc8;}else{_0x46e537=0xce;}_0x496769[_0x1158('0x1c')](_0x46e537);return _0x496769['set'](_0x1158('0x22'),_0x52a328+'-'+_0x557c03+'/'+_0x2e6359)[_0x1158('0x1d')](_0x4de9b8);}return null;};}function patchUpdates(_0x4219bf){return function(_0x3e945d){try{jsonpatch[_0x1158('0x23')](_0x3e945d,_0x4219bf,!![]);}catch(_0x21fec7){return BPromise[_0x1158('0x24')](_0x21fec7);}return _0x3e945d[_0x1158('0x25')]();};}function saveUpdates(_0x35258a,_0x576c89){return function(_0x5617fc){if(_0x5617fc){return _0x5617fc[_0x1158('0x26')](_0x35258a)['then'](function(_0x165332){return _0x165332;});}return null;};}function removeEntity(_0x3cb376,_0xf7c42b){return function(_0x5ac97b){if(_0x5ac97b){return _0x5ac97b[_0x1158('0x27')]()[_0x1158('0x28')](function(){_0x3cb376[_0x1158('0x1c')](0xcc)[_0x1158('0x1b')]();});}};}function handleEntityNotFound(_0x3fa6ed,_0x33ccbb){return function(_0x13ea0e){if(!_0x13ea0e){_0x3fa6ed['sendStatus'](0x194);}return _0x13ea0e;};}function handleError(_0x5e1812,_0x216a4d){_0x216a4d=_0x216a4d||0x1f4;return function(_0x2d17d0){logger['error'](_0x2d17d0[_0x1158('0x29')]);if(_0x2d17d0[_0x1158('0x2a')]){delete _0x2d17d0['name'];}_0x5e1812[_0x1158('0x1c')](_0x216a4d)[_0x1158('0x2b')](_0x2d17d0);};}exports[_0x1158('0x2c')]=function(_0x4cf431,_0x352896){var _0x4e99b3={},_0x39cfaa={},_0x23681f={'count':0x0,'rows':[]};var _0x542cdf=_[_0x1158('0x2d')](db[_0x1158('0x2e')][_0x1158('0x2f')],function(_0x537cf4){return{'name':_0x537cf4[_0x1158('0x30')],'type':_0x537cf4['type']['key']};});_0x39cfaa['model']=_[_0x1158('0x2d')](_0x542cdf,_0x1158('0x2a'));_0x39cfaa[_0x1158('0x31')]=_['keys'](_0x4cf431[_0x1158('0x31')]);_0x39cfaa[_0x1158('0x32')]=_[_0x1158('0x33')](_0x39cfaa[_0x1158('0x34')],_0x39cfaa[_0x1158('0x31')]);_0x4e99b3[_0x1158('0x35')]=_[_0x1158('0x33')](_0x39cfaa[_0x1158('0x34')],qs[_0x1158('0x36')](_0x4cf431[_0x1158('0x31')][_0x1158('0x36')]));_0x4e99b3[_0x1158('0x35')]=_0x4e99b3[_0x1158('0x35')][_0x1158('0x37')]?_0x4e99b3['attributes']:_0x39cfaa['model'];if(!_0x4cf431[_0x1158('0x31')]['hasOwnProperty'](_0x1158('0x38'))){_0x4e99b3[_0x1158('0x20')]=qs[_0x1158('0x20')](_0x4cf431[_0x1158('0x31')]['limit']);_0x4e99b3[_0x1158('0x1e')]=qs['offset'](_0x4cf431['query'][_0x1158('0x1e')]);}_0x4e99b3[_0x1158('0x39')]=qs[_0x1158('0x3a')](_0x4cf431['query'][_0x1158('0x3a')]);_0x4e99b3[_0x1158('0x3b')]=qs[_0x1158('0x32')](_[_0x1158('0x3c')](_0x4cf431[_0x1158('0x31')],_0x39cfaa[_0x1158('0x32')]),_0x542cdf);if(_0x4cf431[_0x1158('0x31')][_0x1158('0x3d')]){_0x4e99b3[_0x1158('0x3b')]=_[_0x1158('0x3e')](_0x4e99b3[_0x1158('0x3b')],{'$or':_[_0x1158('0x2d')](_0x542cdf,function(_0x56018f){if(_0x56018f[_0x1158('0x3f')]!==_0x1158('0x40')){var _0x68699b={};_0x68699b[_0x56018f[_0x1158('0x2a')]]={'$like':'%'+_0x4cf431[_0x1158('0x31')][_0x1158('0x3d')]+'%'};return _0x68699b;}})});}_0x4e99b3=_['merge']({},_0x4e99b3,_0x4cf431[_0x1158('0x41')]);var _0x20b978={'where':_0x4e99b3['where']};return db[_0x1158('0x2e')]['count'](_0x20b978)['then'](function(_0x1d12ce){_0x23681f['count']=_0x1d12ce;if(_0x4cf431[_0x1158('0x31')][_0x1158('0x42')]){_0x4e99b3[_0x1158('0x43')]=[{'all':!![]}];}return db[_0x1158('0x2e')][_0x1158('0x44')](_0x4e99b3);})[_0x1158('0x28')](function(_0x49c0dc){_0x23681f[_0x1158('0x45')]=_0x49c0dc;return _0x23681f;})[_0x1158('0x28')](respondWithFilteredResult(_0x352896,_0x4e99b3))[_0x1158('0x46')](handleError(_0x352896,null));};exports[_0x1158('0x47')]=function(_0xfa3b0b,_0x3a1a19){var _0x30f503={'raw':!![],'where':{'id':_0xfa3b0b[_0x1158('0x48')]['id']}},_0x10c78e={};_0x10c78e[_0x1158('0x34')]=_['keys'](db['VoiceQueuesLog'][_0x1158('0x2f')]);_0x10c78e[_0x1158('0x31')]=_[_0x1158('0x49')](_0xfa3b0b['query']);_0x10c78e[_0x1158('0x32')]=_[_0x1158('0x33')](_0x10c78e[_0x1158('0x34')],_0x10c78e[_0x1158('0x31')]);_0x30f503['attributes']=_[_0x1158('0x33')](_0x10c78e[_0x1158('0x34')],qs[_0x1158('0x36')](_0xfa3b0b[_0x1158('0x31')][_0x1158('0x36')]));_0x30f503[_0x1158('0x35')]=_0x30f503[_0x1158('0x35')][_0x1158('0x37')]?_0x30f503[_0x1158('0x35')]:_0x10c78e[_0x1158('0x34')];if(_0xfa3b0b[_0x1158('0x31')][_0x1158('0x42')]){_0x30f503['include']=[{'all':!![]}];}_0x30f503=_[_0x1158('0x3e')]({},_0x30f503,_0xfa3b0b[_0x1158('0x41')]);return db[_0x1158('0x2e')]['find'](_0x30f503)[_0x1158('0x28')](handleEntityNotFound(_0x3a1a19,null))[_0x1158('0x28')](respondWithResult(_0x3a1a19,null))[_0x1158('0x46')](handleError(_0x3a1a19,null));};exports[_0x1158('0x4a')]=function(_0x551b3c,_0x3aca8d){return db[_0x1158('0x2e')][_0x1158('0x4a')](_0x551b3c[_0x1158('0x4b')],{})[_0x1158('0x28')](respondWithResult(_0x3aca8d,0xc9))[_0x1158('0x46')](handleError(_0x3aca8d,null));};exports[_0x1158('0x26')]=function(_0x3c994e,_0x431e64){if(_0x3c994e[_0x1158('0x4b')]['id']){delete _0x3c994e['body']['id'];}return db[_0x1158('0x2e')]['find']({'where':{'id':_0x3c994e[_0x1158('0x48')]['id']}})[_0x1158('0x28')](handleEntityNotFound(_0x431e64,null))[_0x1158('0x28')](saveUpdates(_0x3c994e[_0x1158('0x4b')],null))[_0x1158('0x28')](respondWithResult(_0x431e64,null))[_0x1158('0x46')](handleError(_0x431e64,null));};exports[_0x1158('0x27')]=function(_0x8d39ad,_0x5c6355){return db['VoiceQueuesLog'][_0x1158('0x4c')]({'where':{'id':_0x8d39ad[_0x1158('0x48')]['id']}})['then'](handleEntityNotFound(_0x5c6355,null))[_0x1158('0x28')](removeEntity(_0x5c6355,null))[_0x1158('0x46')](handleError(_0x5c6355,null));}; \ No newline at end of file +var _0xa7a0=['status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','length','create','body','find','params','eml-format','zip-dir','request-promise','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x68b90b,_0xb8b06a){var _0x5220ec=function(_0x226484){while(--_0x226484){_0x68b90b['push'](_0x68b90b['shift']());}};_0x5220ec(++_0xb8b06a);}(_0xa7a0,0x112));var _0x0a7a=function(_0x216792,_0x10fbcb){_0x216792=_0x216792-0x0;var _0x14085b=_0xa7a0[_0x216792];return _0x14085b;};'use strict';var emlformat=require(_0x0a7a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a7a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0a7a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0a7a('0x3'));var util=require(_0x0a7a('0x4'));var path=require(_0x0a7a('0x5'));var sox=require('sox');var csv=require(_0x0a7a('0x6'));var ejs=require(_0x0a7a('0x7'));var fs=require('fs');var fs_extra=require(_0x0a7a('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0a7a('0x9'));var jsforce=require(_0x0a7a('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0a7a('0x6'));var querystring=require(_0x0a7a('0xb'));var Papa=require(_0x0a7a('0xc'));var Redis=require(_0x0a7a('0xd'));var authService=require(_0x0a7a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0a7a('0xf'));var hardwareService=require(_0x0a7a('0x10'));var logger=require(_0x0a7a('0x11'))(_0x0a7a('0x12'));var utils=require('../../config/utils');var config=require(_0x0a7a('0x13'));var licenseUtil=require(_0x0a7a('0x14'));var db=require(_0x0a7a('0x15'))['db'];function respondWithStatusCode(_0x3093d4,_0x4c15ba){_0x4c15ba=_0x4c15ba||0xcc;return function(_0x272073){if(_0x272073){return _0x3093d4['sendStatus'](_0x4c15ba);}return _0x3093d4[_0x0a7a('0x16')](_0x4c15ba)[_0x0a7a('0x17')]();};}function respondWithResult(_0x3416de,_0x51303d){_0x51303d=_0x51303d||0xc8;return function(_0xa19247){if(_0xa19247){return _0x3416de[_0x0a7a('0x16')](_0x51303d)[_0x0a7a('0x18')](_0xa19247);}};}function respondWithFilteredResult(_0x5d793d,_0x52f080){return function(_0x56a706){if(_0x56a706){var _0x3add23=typeof _0x52f080[_0x0a7a('0x19')]===_0x0a7a('0x1a')&&typeof _0x52f080[_0x0a7a('0x1b')]==='undefined';var _0x2ebe64=_0x56a706['count'];var _0x53b772=_0x3add23?0x0:_0x52f080[_0x0a7a('0x19')];var _0x58a2e2=_0x3add23?_0x56a706[_0x0a7a('0x1c')]:_0x52f080[_0x0a7a('0x19')]+_0x52f080[_0x0a7a('0x1b')];var _0x51a187;if(_0x58a2e2>=_0x2ebe64){_0x58a2e2=_0x2ebe64;_0x51a187=0xc8;}else{_0x51a187=0xce;}_0x5d793d[_0x0a7a('0x16')](_0x51a187);return _0x5d793d[_0x0a7a('0x1d')]('Content-Range',_0x53b772+'-'+_0x58a2e2+'/'+_0x2ebe64)[_0x0a7a('0x18')](_0x56a706);}return null;};}function patchUpdates(_0x105a28){return function(_0x2b6657){try{jsonpatch[_0x0a7a('0x1e')](_0x2b6657,_0x105a28,!![]);}catch(_0x22309b){return BPromise[_0x0a7a('0x1f')](_0x22309b);}return _0x2b6657[_0x0a7a('0x20')]();};}function saveUpdates(_0x31f3ce,_0x45fdad){return function(_0x57ef9e){if(_0x57ef9e){return _0x57ef9e[_0x0a7a('0x21')](_0x31f3ce)[_0x0a7a('0x22')](function(_0x54def5){return _0x54def5;});}return null;};}function removeEntity(_0x16910e,_0xe49710){return function(_0x4aa821){if(_0x4aa821){return _0x4aa821[_0x0a7a('0x23')]()[_0x0a7a('0x22')](function(){_0x16910e[_0x0a7a('0x16')](0xcc)[_0x0a7a('0x17')]();});}};}function handleEntityNotFound(_0x5930e6,_0x3f7359){return function(_0x27af9f){if(!_0x27af9f){_0x5930e6[_0x0a7a('0x24')](0x194);}return _0x27af9f;};}function handleError(_0x128cab,_0x226846){_0x226846=_0x226846||0x1f4;return function(_0x2ca14f){logger[_0x0a7a('0x25')](_0x2ca14f[_0x0a7a('0x26')]);if(_0x2ca14f[_0x0a7a('0x27')]){delete _0x2ca14f['name'];}_0x128cab[_0x0a7a('0x16')](_0x226846)[_0x0a7a('0x28')](_0x2ca14f);};}exports[_0x0a7a('0x29')]=function(_0x43c638,_0x489a62){var _0x56a561={},_0x1534d6={},_0x13e281={'count':0x0,'rows':[]};var _0x4fb437=_[_0x0a7a('0x2a')](db[_0x0a7a('0x2b')][_0x0a7a('0x2c')],function(_0x15de93){return{'name':_0x15de93[_0x0a7a('0x2d')],'type':_0x15de93[_0x0a7a('0x2e')][_0x0a7a('0x2f')]};});_0x1534d6[_0x0a7a('0x30')]=_['map'](_0x4fb437,'name');_0x1534d6[_0x0a7a('0x31')]=_[_0x0a7a('0x32')](_0x43c638[_0x0a7a('0x31')]);_0x1534d6[_0x0a7a('0x33')]=_[_0x0a7a('0x34')](_0x1534d6[_0x0a7a('0x30')],_0x1534d6['query']);_0x56a561[_0x0a7a('0x35')]=_[_0x0a7a('0x34')](_0x1534d6[_0x0a7a('0x30')],qs[_0x0a7a('0x36')](_0x43c638[_0x0a7a('0x31')][_0x0a7a('0x36')]));_0x56a561['attributes']=_0x56a561[_0x0a7a('0x35')]['length']?_0x56a561['attributes']:_0x1534d6[_0x0a7a('0x30')];if(!_0x43c638['query'][_0x0a7a('0x37')](_0x0a7a('0x38'))){_0x56a561[_0x0a7a('0x1b')]=qs[_0x0a7a('0x1b')](_0x43c638[_0x0a7a('0x31')][_0x0a7a('0x1b')]);_0x56a561['offset']=qs['offset'](_0x43c638[_0x0a7a('0x31')]['offset']);}_0x56a561[_0x0a7a('0x39')]=qs[_0x0a7a('0x3a')](_0x43c638[_0x0a7a('0x31')]['sort']);_0x56a561[_0x0a7a('0x3b')]=qs[_0x0a7a('0x33')](_[_0x0a7a('0x3c')](_0x43c638[_0x0a7a('0x31')],_0x1534d6[_0x0a7a('0x33')]),_0x4fb437);if(_0x43c638['query'][_0x0a7a('0x3d')]){_0x56a561[_0x0a7a('0x3b')]=_[_0x0a7a('0x3e')](_0x56a561[_0x0a7a('0x3b')],{'$or':_['map'](_0x4fb437,function(_0x249ea1){if(_0x249ea1['type']!==_0x0a7a('0x3f')){var _0x5a8f94={};_0x5a8f94[_0x249ea1[_0x0a7a('0x27')]]={'$like':'%'+_0x43c638[_0x0a7a('0x31')]['filter']+'%'};return _0x5a8f94;}})});}_0x56a561=_[_0x0a7a('0x3e')]({},_0x56a561,_0x43c638[_0x0a7a('0x40')]);var _0x1ce993={'where':_0x56a561[_0x0a7a('0x3b')]};return db[_0x0a7a('0x2b')][_0x0a7a('0x1c')](_0x1ce993)[_0x0a7a('0x22')](function(_0x91d36){_0x13e281['count']=_0x91d36;if(_0x43c638['query'][_0x0a7a('0x41')]){_0x56a561[_0x0a7a('0x42')]=[{'all':!![]}];}return db[_0x0a7a('0x2b')]['findAll'](_0x56a561);})['then'](function(_0x55bf9a){_0x13e281['rows']=_0x55bf9a;return _0x13e281;})[_0x0a7a('0x22')](respondWithFilteredResult(_0x489a62,_0x56a561))[_0x0a7a('0x43')](handleError(_0x489a62,null));};exports[_0x0a7a('0x44')]=function(_0x58d369,_0x1abd41){var _0x83455e={'raw':!![],'where':{'id':_0x58d369['params']['id']}},_0x74e0ca={};_0x74e0ca[_0x0a7a('0x30')]=_[_0x0a7a('0x32')](db[_0x0a7a('0x2b')][_0x0a7a('0x2c')]);_0x74e0ca[_0x0a7a('0x31')]=_[_0x0a7a('0x32')](_0x58d369['query']);_0x74e0ca['filters']=_['intersection'](_0x74e0ca['model'],_0x74e0ca['query']);_0x83455e['attributes']=_[_0x0a7a('0x34')](_0x74e0ca[_0x0a7a('0x30')],qs['fields'](_0x58d369['query'][_0x0a7a('0x36')]));_0x83455e[_0x0a7a('0x35')]=_0x83455e[_0x0a7a('0x35')][_0x0a7a('0x45')]?_0x83455e['attributes']:_0x74e0ca[_0x0a7a('0x30')];if(_0x58d369[_0x0a7a('0x31')][_0x0a7a('0x41')]){_0x83455e[_0x0a7a('0x42')]=[{'all':!![]}];}_0x83455e=_[_0x0a7a('0x3e')]({},_0x83455e,_0x58d369['options']);return db[_0x0a7a('0x2b')]['find'](_0x83455e)['then'](handleEntityNotFound(_0x1abd41,null))['then'](respondWithResult(_0x1abd41,null))['catch'](handleError(_0x1abd41,null));};exports[_0x0a7a('0x46')]=function(_0x614f31,_0x543e3d){return db[_0x0a7a('0x2b')]['create'](_0x614f31['body'],{})['then'](respondWithResult(_0x543e3d,0xc9))[_0x0a7a('0x43')](handleError(_0x543e3d,null));};exports['update']=function(_0x2e165f,_0x3fdd8a){if(_0x2e165f[_0x0a7a('0x47')]['id']){delete _0x2e165f[_0x0a7a('0x47')]['id'];}return db[_0x0a7a('0x2b')][_0x0a7a('0x48')]({'where':{'id':_0x2e165f[_0x0a7a('0x49')]['id']}})[_0x0a7a('0x22')](handleEntityNotFound(_0x3fdd8a,null))[_0x0a7a('0x22')](saveUpdates(_0x2e165f['body'],null))[_0x0a7a('0x22')](respondWithResult(_0x3fdd8a,null))[_0x0a7a('0x43')](handleError(_0x3fdd8a,null));};exports['destroy']=function(_0xf2845b,_0x1f0d27){return db[_0x0a7a('0x2b')][_0x0a7a('0x48')]({'where':{'id':_0xf2845b[_0x0a7a('0x49')]['id']}})[_0x0a7a('0x22')](handleEntityNotFound(_0x1f0d27,null))[_0x0a7a('0x22')](removeEntity(_0x1f0d27,null))['catch'](handleError(_0x1f0d27,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index eb1a6d7..ac21a4c 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 _0xa44c=['VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define'];(function(_0x1d2406,_0x5d8abc){var _0x4a203a=function(_0x4c3f38){while(--_0x4c3f38){_0x1d2406['push'](_0x1d2406['shift']());}};_0x4a203a(++_0x5d8abc);}(_0xa44c,0x1a9));var _0xca44=function(_0x3af5e2,_0x44e9a){_0x3af5e2=_0x3af5e2-0x0;var _0x31c297=_0xa44c[_0x3af5e2];return _0x31c297;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xca44('0x0'));var moment=require(_0xca44('0x1'));var BPromise=require(_0xca44('0x2'));var rp=require(_0xca44('0x3'));var fs=require('fs');var path=require(_0xca44('0x4'));var rimraf=require(_0xca44('0x5'));var config=require(_0xca44('0x6'));var attributes=require(_0xca44('0x7'));module[_0xca44('0x8')]=function(_0x46737f,_0x32d987){return _0x46737f[_0xca44('0x9')](_0xca44('0xa'),attributes,{'tableName':_0xca44('0xb'),'paranoid':![],'indexes':[{'name':_0xca44('0xc'),'fields':[_0xca44('0xd'),_0xca44('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x95ef=['util','../../config/logger','api','moment','../../config/environment','./voiceQueuesLog.attributes','exports','define','voice_queues_log','event_dtm','event','dtm'];(function(_0x2b9847,_0x5b5294){var _0x4e393f=function(_0x5f0d4c){while(--_0x5f0d4c){_0x2b9847['push'](_0x2b9847['shift']());}};_0x4e393f(++_0x5b5294);}(_0x95ef,0xb4));var _0xf95e=function(_0x2f53c2,_0x21e4df){_0x2f53c2=_0x2f53c2-0x0;var _0x1a3867=_0x95ef[_0x2f53c2];return _0x1a3867;};'use strict';var _=require('lodash');var util=require(_0xf95e('0x0'));var logger=require(_0xf95e('0x1'))(_0xf95e('0x2'));var moment=require(_0xf95e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf95e('0x4'));var attributes=require(_0xf95e('0x5'));module[_0xf95e('0x6')]=function(_0x56081f,_0x133d18){return _0x56081f[_0xf95e('0x7')]('VoiceQueuesLog',attributes,{'tableName':_0xf95e('0x8'),'paranoid':![],'indexes':[{'name':_0xf95e('0x9'),'fields':[_0xf95e('0xa'),_0xf95e('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index abd1994..9ec938b 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 _0x34e1=['client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x39efbf,_0x118364){var _0xcbd510=function(_0x4e152f){while(--_0x4e152f){_0x39efbf['push'](_0x39efbf['shift']());}};_0xcbd510(++_0x118364);}(_0x34e1,0xdc));var _0x134e=function(_0x1301b4,_0x2fb602){_0x1301b4=_0x1301b4-0x0;var _0x4252dc=_0x34e1[_0x1301b4];return _0x4252dc;};'use strict';var _=require(_0x134e('0x0'));var util=require(_0x134e('0x1'));var moment=require(_0x134e('0x2'));var BPromise=require(_0x134e('0x3'));var rs=require(_0x134e('0x4'));var fs=require('fs');var Redis=require(_0x134e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x134e('0x6'));var logger=require(_0x134e('0x7'))(_0x134e('0x8'));var config=require(_0x134e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x134e('0xa')][_0x134e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26bef8,_0x8cc6b6,_0xec5fd1){return new BPromise(function(_0x1dd89b,_0x5e1bec){return client[_0x134e('0xc')](_0x26bef8,_0xec5fd1)[_0x134e('0xd')](function(_0x3c481a){logger['info'](_0x134e('0xe'),_0x8cc6b6,_0x134e('0xf'));logger[_0x134e('0x10')](_0x134e('0x11'),_0x8cc6b6,'request\x20sent',JSON['stringify'](_0x3c481a));if(_0x3c481a[_0x134e('0x12')]){if(_0x3c481a[_0x134e('0x12')][_0x134e('0x13')]===0x1f4){logger[_0x134e('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x8cc6b6,_0x3c481a['error']['message']);return _0x5e1bec(_0x3c481a[_0x134e('0x12')][_0x134e('0x14')]);}logger[_0x134e('0x12')](_0x134e('0xe'),_0x8cc6b6,_0x3c481a[_0x134e('0x12')][_0x134e('0x14')]);return _0x1dd89b(_0x3c481a[_0x134e('0x12')][_0x134e('0x14')]);}else{logger[_0x134e('0x15')](_0x134e('0xe'),_0x8cc6b6,'request\x20sent');_0x1dd89b(_0x3c481a[_0x134e('0x16')][_0x134e('0x14')]);}})['catch'](function(_0x281297){logger[_0x134e('0x12')](_0x134e('0xe'),_0x8cc6b6,_0x281297);_0x5e1bec(_0x281297);});});} \ No newline at end of file +var _0x5b96=['VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5b96,0xbc));var _0x65b9=function(_0x292e87,_0x9b2eb5){_0x292e87=_0x292e87-0x0;var _0x5186f6=_0x5b96[_0x292e87];return _0x5186f6;};'use strict';var _=require(_0x65b9('0x0'));var util=require('util');var moment=require(_0x65b9('0x1'));var BPromise=require(_0x65b9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65b9('0x3'));var db=require(_0x65b9('0x4'))['db'];var utils=require(_0x65b9('0x5'));var logger=require(_0x65b9('0x6'))(_0x65b9('0x7'));var config=require(_0x65b9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x65b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc38556,_0x44dc69,_0x22f166){return new BPromise(function(_0x557a20,_0x146349){return client[_0x65b9('0xa')](_0xc38556,_0x22f166)[_0x65b9('0xb')](function(_0x42c06e){logger[_0x65b9('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x44dc69,'request\x20sent');logger[_0x65b9('0xd')](_0x65b9('0xe'),_0x44dc69,_0x65b9('0xf'),JSON[_0x65b9('0x10')](_0x42c06e));if(_0x42c06e[_0x65b9('0x11')]){if(_0x42c06e['error'][_0x65b9('0x12')]===0x1f4){logger[_0x65b9('0x11')](_0x65b9('0x13'),_0x44dc69,_0x42c06e['error'][_0x65b9('0x14')]);return _0x146349(_0x42c06e[_0x65b9('0x11')]['message']);}logger['error'](_0x65b9('0x13'),_0x44dc69,_0x42c06e[_0x65b9('0x11')]['message']);return _0x557a20(_0x42c06e['error'][_0x65b9('0x14')]);}else{logger['info'](_0x65b9('0x13'),_0x44dc69,'request\x20sent');_0x557a20(_0x42c06e[_0x65b9('0x15')][_0x65b9('0x14')]);}})[_0x65b9('0x16')](function(_0x34e3e2){logger['error'](_0x65b9('0x13'),_0x44dc69,_0x34e3e2);_0x146349(_0x34e3e2);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index ab7a68f..70cee93 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 _0xf353=['download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/download'];(function(_0x269698,_0x5c3424){var _0x13be8a=function(_0x343862){while(--_0x343862){_0x269698['push'](_0x269698['shift']());}};_0x13be8a(++_0x5c3424);}(_0xf353,0x11a));var _0x3f35=function(_0x338762,_0xb7cad2){_0x338762=_0x338762-0x0;var _0x529283=_0xf353[_0x338762];return _0x529283;};'use strict';var multer=require(_0x3f35('0x0'));var util=require(_0x3f35('0x1'));var path=require(_0x3f35('0x2'));var timeout=require(_0x3f35('0x3'));var express=require(_0x3f35('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3f35('0x5'));var interaction=require(_0x3f35('0x6'));var config=require(_0x3f35('0x7'));var controller=require('./voiceRecording.controller');router[_0x3f35('0x8')]('/',auth[_0x3f35('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x3f35('0x8')]('/:id',auth[_0x3f35('0x9')](),controller[_0x3f35('0xa')]);router[_0x3f35('0x8')](_0x3f35('0xb'),auth[_0x3f35('0x9')](),controller[_0x3f35('0xc')]);router[_0x3f35('0x8')](_0x3f35('0xd'),controller['downloads']);router[_0x3f35('0x8')](_0x3f35('0xe'),auth['isAuthenticated'](),controller[_0x3f35('0xf')]);router[_0x3f35('0x10')]('/',auth[_0x3f35('0x9')](),controller['create']);router[_0x3f35('0x10')](_0x3f35('0xe'),auth[_0x3f35('0x9')](),controller[_0x3f35('0x11')]);router['put']('/:id',auth[_0x3f35('0x9')](),controller['update']);router[_0x3f35('0x12')]('/:id',auth[_0x3f35('0x9')](),controller[_0x3f35('0x13')]);module[_0x3f35('0x14')]=router; \ No newline at end of file +var _0x6d4f=['show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x415e8d,_0x344495){var _0x1d89e1=function(_0x3bb663){while(--_0x3bb663){_0x415e8d['push'](_0x415e8d['shift']());}};_0x1d89e1(++_0x344495);}(_0x6d4f,0x1e7));var _0xf6d4=function(_0x30e25c,_0x355276){_0x30e25c=_0x30e25c-0x0;var _0x47959b=_0x6d4f[_0x30e25c];return _0x47959b;};'use strict';var multer=require(_0xf6d4('0x0'));var util=require(_0xf6d4('0x1'));var path=require(_0xf6d4('0x2'));var timeout=require(_0xf6d4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf6d4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf6d4('0x5'));var config=require(_0xf6d4('0x6'));var controller=require(_0xf6d4('0x7'));router[_0xf6d4('0x8')]('/',auth[_0xf6d4('0x9')](),controller[_0xf6d4('0xa')]);router[_0xf6d4('0x8')](_0xf6d4('0xb'),auth[_0xf6d4('0x9')](),controller['describe']);router[_0xf6d4('0x8')](_0xf6d4('0xc'),auth[_0xf6d4('0x9')](),controller[_0xf6d4('0xd')]);router[_0xf6d4('0x8')](_0xf6d4('0xe'),auth[_0xf6d4('0x9')](),controller[_0xf6d4('0xf')]);router['get'](_0xf6d4('0x10'),controller[_0xf6d4('0x11')]);router[_0xf6d4('0x8')](_0xf6d4('0x12'),auth[_0xf6d4('0x9')](),controller[_0xf6d4('0x13')]);router[_0xf6d4('0x14')]('/',auth[_0xf6d4('0x9')](),controller[_0xf6d4('0x15')]);router[_0xf6d4('0x14')]('/:id/transcribe',auth[_0xf6d4('0x9')](),controller[_0xf6d4('0x16')]);router['put'](_0xf6d4('0xc'),auth[_0xf6d4('0x9')](),controller['update']);router[_0xf6d4('0x17')](_0xf6d4('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xf6d4('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index a3c6b51..ef47ad3 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(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 cc8914d..34786ae 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 _0xb419=['util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','status','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','format','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','merge','create','body','update','describe','download','../../components/encryptor','uniqueid','find','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','token','$and','push','ValidationError','isNil','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','transcribeRegion','bucket','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','runSentiment','updateAttributes','writeFile','downloadTranscribe','root','/server/files/transcribes/transcribe_','.txt','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x3156aa,_0x407b77){var _0x2333b3=function(_0x30e1e8){while(--_0x30e1e8){_0x3156aa['push'](_0x3156aa['shift']());}};_0x2333b3(++_0x407b77);}(_0xb419,0x93));var _0x9b41=function(_0x8efe57,_0x272d80){_0x8efe57=_0x8efe57-0x0;var _0x3c8735=_0xb419[_0x8efe57];return _0x3c8735;};'use strict';var emlformat=require(_0x9b41('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b41('0x1'));var jsonpatch=require(_0x9b41('0x2'));var rp=require(_0x9b41('0x3'));var moment=require('moment');var BPromise=require(_0x9b41('0x4'));var Mustache=require(_0x9b41('0x5'));var util=require(_0x9b41('0x6'));var path=require(_0x9b41('0x7'));var sox=require(_0x9b41('0x8'));var csv=require(_0x9b41('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b41('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9b41('0xb'));var jsforce=require(_0x9b41('0xc'));var deskjs=require(_0x9b41('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9b41('0xe'));var AWS=require(_0x9b41('0xf'));var uuidv4=require(_0x9b41('0x10'));var Redis=require(_0x9b41('0x11'));var authService=require(_0x9b41('0x12'));var qs=require(_0x9b41('0x13'));var as=require(_0x9b41('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b41('0x15'))(_0x9b41('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9b41('0x17'));var db=require(_0x9b41('0x18'))['db'];function respondWithStatusCode(_0x428cc5,_0x1cf5cb){_0x1cf5cb=_0x1cf5cb||0xcc;return function(_0x8230e8){if(_0x8230e8){return _0x428cc5[_0x9b41('0x19')](_0x1cf5cb);}return _0x428cc5['status'](_0x1cf5cb)[_0x9b41('0x1a')]();};}function respondWithResult(_0xc0e611,_0x115ef0){_0x115ef0=_0x115ef0||0xc8;return function(_0x210edd){if(_0x210edd){return _0xc0e611['status'](_0x115ef0)[_0x9b41('0x1b')](_0x210edd);}};}function respondWithFilteredResult(_0x184556,_0x2f857b){return function(_0x2cca07){if(_0x2cca07){var _0x48626e=typeof _0x2f857b[_0x9b41('0x1c')]===_0x9b41('0x1d')&&typeof _0x2f857b['limit']===_0x9b41('0x1d');var _0x3a94f0=_0x2cca07['count'];var _0x287a41=_0x48626e?0x0:_0x2f857b[_0x9b41('0x1c')];var _0x6a798e=_0x48626e?_0x2cca07[_0x9b41('0x1e')]:_0x2f857b[_0x9b41('0x1c')]+_0x2f857b[_0x9b41('0x1f')];var _0x1ab436;if(_0x6a798e>=_0x3a94f0){_0x6a798e=_0x3a94f0;_0x1ab436=0xc8;}else{_0x1ab436=0xce;}_0x184556['status'](_0x1ab436);return _0x184556['set'](_0x9b41('0x20'),_0x287a41+'-'+_0x6a798e+'/'+_0x3a94f0)[_0x9b41('0x1b')](_0x2cca07);}return null;};}function patchUpdates(_0x2ccd45){return function(_0x36130b){try{jsonpatch[_0x9b41('0x21')](_0x36130b,_0x2ccd45,!![]);}catch(_0x100675){return BPromise[_0x9b41('0x22')](_0x100675);}return _0x36130b[_0x9b41('0x23')]();};}function saveUpdates(_0x5a3dfe,_0x3b831d){return function(_0x294372){if(_0x294372){return _0x294372['update'](_0x5a3dfe)[_0x9b41('0x24')](function(_0x26735a){return _0x26735a;});}return null;};}function removeEntity(_0xa8262,_0x3b15b4){return function(_0x317825){if(_0x317825){return _0x317825[_0x9b41('0x25')]()[_0x9b41('0x24')](function(){_0xa8262[_0x9b41('0x26')](0xcc)[_0x9b41('0x1a')]();});}};}function handleEntityNotFound(_0x235af7,_0x4d4a83){return function(_0x5060d6){if(!_0x5060d6){_0x235af7['sendStatus'](0x194);}return _0x5060d6;};}function handleError(_0x10086b,_0x278ed5){_0x278ed5=_0x278ed5||0x1f4;return function(_0x584669){logger['error'](_0x584669[_0x9b41('0x27')]);if(_0x584669[_0x9b41('0x28')]){delete _0x584669['name'];}_0x10086b[_0x9b41('0x26')](_0x278ed5)[_0x9b41('0x29')](_0x584669);};}exports[_0x9b41('0x2a')]=function(_0xd5a163,_0x124466){var _0x16f0cd={},_0x2b814f={},_0x1d0ac9={'count':0x0,'rows':[]};var _0x59acd7=_[_0x9b41('0x2b')](db[_0x9b41('0x2c')][_0x9b41('0x2d')],function(_0x9c536){return{'name':_0x9c536[_0x9b41('0x2e')],'type':_0x9c536[_0x9b41('0x2f')][_0x9b41('0x30')]};});_0x2b814f[_0x9b41('0x31')]=_['differenceBy'](_[_0x9b41('0x2b')](_0x59acd7,_0x9b41('0x28')),[_0x9b41('0x32')]);_0x2b814f['query']=_[_0x9b41('0x33')](_0xd5a163[_0x9b41('0x34')]);_0x2b814f[_0x9b41('0x35')]=_[_0x9b41('0x36')](_0x2b814f['model'],_0x2b814f[_0x9b41('0x34')]);_0x16f0cd[_0x9b41('0x37')]=_['intersection'](_0x2b814f[_0x9b41('0x31')],qs[_0x9b41('0x38')](_0xd5a163[_0x9b41('0x34')]['fields']));_0x16f0cd[_0x9b41('0x37')]=_0x16f0cd[_0x9b41('0x37')]['length']?_0x16f0cd[_0x9b41('0x37')]:_0x2b814f[_0x9b41('0x31')];if(!_0xd5a163[_0x9b41('0x34')]['hasOwnProperty'](_0x9b41('0x39'))){_0x16f0cd[_0x9b41('0x1f')]=qs[_0x9b41('0x1f')](_0xd5a163[_0x9b41('0x34')][_0x9b41('0x1f')]);_0x16f0cd[_0x9b41('0x1c')]=qs[_0x9b41('0x1c')](_0xd5a163[_0x9b41('0x34')][_0x9b41('0x1c')]);}_0x16f0cd[_0x9b41('0x3a')]=qs[_0x9b41('0x3b')](_0xd5a163[_0x9b41('0x34')][_0x9b41('0x3b')]);_0x16f0cd[_0x9b41('0x3c')]=qs[_0x9b41('0x35')](_['pick'](_0xd5a163[_0x9b41('0x34')],_0x2b814f['filters']),_0x59acd7);if(_0xd5a163[_0x9b41('0x34')]['filter']){_0x16f0cd[_0x9b41('0x3c')]=_['merge'](_0x16f0cd[_0x9b41('0x3c')],{'$or':_[_0x9b41('0x2b')](_0x59acd7,function(_0xd22696){if(_0xd22696[_0x9b41('0x2f')]!==_0x9b41('0x3d')){var _0x17562a={};_0x17562a[_0xd22696[_0x9b41('0x28')]]={'$like':'%'+_0xd5a163[_0x9b41('0x34')][_0x9b41('0x3e')]+'%'};return _0x17562a;}})});}_0x16f0cd=_['merge']({},_0x16f0cd,_0xd5a163[_0x9b41('0x3f')]);var _0x285375={'where':_0x16f0cd[_0x9b41('0x3c')]};return db['VoiceRecording'][_0x9b41('0x1e')](_0x285375)['then'](function(_0x190030){_0x1d0ac9['count']=_0x190030;if(_0xd5a163[_0x9b41('0x34')][_0x9b41('0x40')]){_0x16f0cd[_0x9b41('0x41')]=[{'all':!![]}];}return db[_0x9b41('0x2c')][_0x9b41('0x42')](_0x16f0cd);})[_0x9b41('0x24')](function(_0x4d8e2c){_0x1d0ac9[_0x9b41('0x43')]=_0x4d8e2c;return _0x1d0ac9;})[_0x9b41('0x24')](respondWithFilteredResult(_0x124466,_0x16f0cd))[_0x9b41('0x44')](handleError(_0x124466,null));};exports[_0x9b41('0x45')]=function(_0x34fb54,_0x41bbde){var _0xfac657={'raw':![],'where':{'id':_0x34fb54[_0x9b41('0x46')]['id']}},_0x262705={};_0x262705[_0x9b41('0x31')]=_[_0x9b41('0x33')](db[_0x9b41('0x2c')][_0x9b41('0x2d')]);_0x262705['query']=_[_0x9b41('0x33')](_0x34fb54[_0x9b41('0x34')]);_0x262705['filters']=_[_0x9b41('0x36')](_0x262705[_0x9b41('0x31')],_0x262705[_0x9b41('0x34')]);_0xfac657['attributes']=_['intersection'](_0x262705[_0x9b41('0x31')],qs[_0x9b41('0x38')](_0x34fb54[_0x9b41('0x34')][_0x9b41('0x38')]));_0xfac657[_0x9b41('0x37')]=_0xfac657[_0x9b41('0x37')][_0x9b41('0x47')]?_0xfac657[_0x9b41('0x37')]:_0x262705['model'];if(_0x34fb54[_0x9b41('0x34')][_0x9b41('0x40')]){_0xfac657[_0x9b41('0x41')]=[{'all':!![]}];}_0xfac657=_[_0x9b41('0x48')]({},_0xfac657,_0x34fb54[_0x9b41('0x3f')]);return db[_0x9b41('0x2c')]['find'](_0xfac657)[_0x9b41('0x24')](handleEntityNotFound(_0x41bbde,null))[_0x9b41('0x24')](respondWithResult(_0x41bbde,null))[_0x9b41('0x44')](handleError(_0x41bbde,null));};exports[_0x9b41('0x49')]=function(_0x50887d,_0x4494db){return db[_0x9b41('0x2c')][_0x9b41('0x49')](_0x50887d[_0x9b41('0x4a')],{})['then'](respondWithResult(_0x4494db,0xc9))[_0x9b41('0x44')](handleError(_0x4494db,null));};exports[_0x9b41('0x4b')]=function(_0x371157,_0x589aef){if(_0x371157['body']['id']){delete _0x371157[_0x9b41('0x4a')]['id'];}return db[_0x9b41('0x2c')]['find']({'where':{'id':_0x371157[_0x9b41('0x46')]['id']}})[_0x9b41('0x24')](handleEntityNotFound(_0x589aef,null))[_0x9b41('0x24')](saveUpdates(_0x371157[_0x9b41('0x4a')],null))[_0x9b41('0x24')](respondWithResult(_0x589aef,null))['catch'](handleError(_0x589aef,null));};exports['describe']=function(_0x1ba25c,_0x1022a){return db['VoiceRecording'][_0x9b41('0x4c')]()[_0x9b41('0x24')](respondWithResult(_0x1022a,null))[_0x9b41('0x44')](handleError(_0x1022a,null));};exports[_0x9b41('0x4d')]=function(_0x1ace47,_0x1a388e,_0x57b839){var _0x3c076f=require(_0x9b41('0x4e'));var _0x33ad6d=![];var _0x5a0841={};if(_0x1ace47[_0x9b41('0x34')][_0x9b41('0x2f')]&&_0x1ace47[_0x9b41('0x34')][_0x9b41('0x2f')]===_0x9b41('0x4f')){_0x5a0841['uniqueid']=_0x1ace47[_0x9b41('0x46')]['id'];}else{_0x5a0841['id']=_0x1ace47['params']['id'];}return db[_0x9b41('0x2c')][_0x9b41('0x50')]({'where':_0x5a0841,'attributes':['id',_0x9b41('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x1a388e,null))[_0x9b41('0x24')](function(_0x4e3118){if(_0x4e3118){var _0x321809=_0x4e3118['value'];var _0x25cac6=util[_0x9b41('0x32')](_0x9b41('0x52'),_0x321809);if(fs[_0x9b41('0x53')](_0x25cac6)){_0x33ad6d=!![];return _0x3c076f[_0x9b41('0x54')](_0x25cac6,_0x321809,config[_0x9b41('0x55')][_0x9b41('0x56')])[_0x9b41('0x24')](function(){return _0x4e3118;});}return _0x4e3118;}})[_0x9b41('0x24')](function(_0x372a8d){if(_0x372a8d){var _0x528b9e=_0x372a8d[_0x9b41('0x51')];if(!fs[_0x9b41('0x53')](_0x528b9e)){throw new db[(_0x9b41('0x57'))]['ValidationError'](_0x9b41('0x58'));}if(_0x372a8d[_0x9b41('0x59')]){return _0x1a388e[_0x9b41('0x4d')](_0x528b9e,_0x372a8d[_0x9b41('0x59')]+path[_0x9b41('0x5a')](_0x528b9e),function(){if(_0x33ad6d){fs[_0x9b41('0x5b')](_0x528b9e);}});}else{return _0x1a388e[_0x9b41('0x4d')](_0x528b9e,function(_0xad124d){if(_0x33ad6d){fs['unlink'](_0x528b9e);}});}}})[_0x9b41('0x44')](function(_0x2f453f){if(_0x2f453f[_0x9b41('0x5c')]===_0x9b41('0x58')){_0x1a388e[_0x9b41('0x26')](0x194)[_0x9b41('0x29')](_0x9b41('0x5d'));}else{return handleError(_0x1a388e,null);}});};exports[_0x9b41('0x5e')]=function(_0x36c2b1,_0x3320a5,_0x1d1ce5){var _0x10fbb2=require('../../components/encryptor');var _0x332a2e=![];var _0x5eb5dd={'$and':[db[_0x9b41('0x5f')]['where'](db[_0x9b41('0x5f')]['fn']('MD5',db[_0x9b41('0x5f')]['col'](_0x9b41('0x4f'))),_0x36c2b1[_0x9b41('0x34')][_0x9b41('0x60')])]};if(_0x36c2b1['query'][_0x9b41('0x2f')]&&_0x36c2b1[_0x9b41('0x34')][_0x9b41('0x2f')]==='uniqueid'){_0x5eb5dd[_0x9b41('0x61')][_0x9b41('0x62')]({'uniqueid':_0x36c2b1[_0x9b41('0x46')]['id']});}else{_0x5eb5dd[_0x9b41('0x61')][_0x9b41('0x62')]({'id':_0x36c2b1[_0x9b41('0x46')]['id']});}return db[_0x9b41('0x2c')][_0x9b41('0x50')]({'where':_0x5eb5dd,'attributes':['id',_0x9b41('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x3320a5,null))['then'](function(_0x2dcddc){if(_0x2dcddc){var _0x392a4a=util[_0x9b41('0x32')]('%s.cypher',_0x2dcddc['value']);if(fs['existsSync'](_0x392a4a)){_0x332a2e=!![];return _0x10fbb2[_0x9b41('0x54')](_0x392a4a,_0x2dcddc['value'],config[_0x9b41('0x55')][_0x9b41('0x56')])[_0x9b41('0x24')](function(){return _0x2dcddc;});}return _0x2dcddc;}})[_0x9b41('0x24')](function(_0x1de2cd){if(_0x1de2cd){if(!fs['existsSync'](_0x1de2cd[_0x9b41('0x51')])){throw new db[(_0x9b41('0x57'))][(_0x9b41('0x63'))](_0x9b41('0x58'));}if(_0x1de2cd[_0x9b41('0x59')]){return _0x3320a5[_0x9b41('0x4d')](_0x1de2cd[_0x9b41('0x51')],_0x1de2cd['filename']+path[_0x9b41('0x5a')](_0x1de2cd['value']),function(){if(_0x332a2e){fs['unlink'](_0x1de2cd['value']);}});}else{return _0x3320a5[_0x9b41('0x4d')](_0x1de2cd[_0x9b41('0x51')],function(_0x25e254){if(_0x332a2e){fs[_0x9b41('0x5b')](_0x1de2cd[_0x9b41('0x51')]);}});}}})[_0x9b41('0x44')](handleError(_0x3320a5,null));};exports[_0x9b41('0x25')]=function(_0x3a75e7,_0x54a8f8){return db[_0x9b41('0x2c')][_0x9b41('0x50')]({'where':{'id':_0x3a75e7[_0x9b41('0x46')]['id']}})[_0x9b41('0x24')](function(_0x4b8472){if(_[_0x9b41('0x64')](_0x4b8472)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4b8472;})['then'](function(_0x15da20){var _0x3b1b97=_0x15da20[_0x9b41('0x51')];logger[_0x9b41('0x65')](_0x9b41('0x66'),_0x3b1b97);if(!_[_0x9b41('0x64')](_0x15da20[_0x9b41('0x51')])&&fs[_0x9b41('0x53')](_0x3b1b97)){logger['info']('File:\x20\x22'+_0x3b1b97+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x9b41('0x67')](_0x3b1b97);}_0x3b1b97=_0x3b1b97+_0x9b41('0x68');if(!_[_0x9b41('0x64')](_0x15da20[_0x9b41('0x51')])&&fs[_0x9b41('0x53')](_0x3b1b97)){logger[_0x9b41('0x65')](_0x9b41('0x69')+_0x3b1b97+_0x9b41('0x6a'));fs['unlinkSync'](_0x3b1b97);}return _0x15da20;})[_0x9b41('0x24')](function(_0x330fd3){if(!_0x330fd3)throw new InternalError();return _0x330fd3['destroy']();})['then'](function(){_0x54a8f8[_0x9b41('0x26')](0xcc)[_0x9b41('0x1a')]();})[_0x9b41('0x44')](handleError(_0x54a8f8,null));};function getBucketslist(_0x127ab3,_0x206c53,_0x35e11){return new Promise(function(_0x7335ae,_0x33a9d3){var _0x1f76b3=new AWS['S3']({'accessKeyId':_0x206c53,'secretAccessKey':_0x127ab3,'region':_0x35e11});_0x1f76b3[_0x9b41('0x6b')]({},function(_0xd00add,_0x142444){if(_0xd00add){return _0x33a9d3(_0xd00add);}else{return _0x7335ae(_0x142444);}});});}function createBucket(_0x14294f,_0x3a6c26,_0x3f8ded,_0x19c336){return new Promise(function(_0x61fb62,_0x25e002){var _0x34b234=new AWS['S3']({'accessKeyId':_0x3a6c26,'secretAccessKey':_0x14294f,'region':_0x3f8ded});_0x34b234[_0x9b41('0x6c')]({'Bucket':_0x19c336},function(_0x53e675,_0x234b21){if(_0x53e675){return _0x25e002(_0x53e675);}else{return _0x61fb62(_0x234b21);}});});}function uploadFile(_0x204cad,_0x3cf9b2,_0x2f3160,_0x2c2757,_0x5a3702,_0x337863){return new Promise(function(_0x4aaca9,_0x22d3eb){var _0x154d6c=new AWS['S3']({'accessKeyId':_0x3cf9b2,'secretAccessKey':_0x204cad,'region':_0x2f3160});_0x154d6c[_0x9b41('0x6d')]({'Bucket':_0x2c2757,'Key':_0x5a3702,'Body':_0x337863},function(_0x2c7258,_0x41a53d){if(_0x2c7258){return _0x22d3eb(_0x2c7258);}else{return _0x4aaca9(_0x41a53d);}});});}function startTranscribe(_0xefaea7,_0x2c5d21,_0xab388c,_0x4b4ac1,_0xb3377a,_0xe53b4f){return new Promise(function(_0x448410,_0x3a1343){var _0x2dffda=new AWS['TranscribeService']({'accessKeyId':_0x2c5d21,'secretAccessKey':_0xefaea7,'region':_0xab388c});_0x2dffda[_0x9b41('0x6e')]({'TranscriptionJobName':_0x4b4ac1,'LanguageCode':_0xb3377a,'Media':{'MediaFileUri':_0xe53b4f}},function(_0x2bf85a,_0x2c97e3){if(_0x2bf85a){return _0x3a1343(_0x2bf85a);}else{return _0x448410(_0x2c97e3);}});});}function transcribe(_0x51c62c,_0x3fc641,_0x48c1e8,_0x59f172,_0x3e1d2e,_0x20c663,_0x2e41c7){return new Promise(function(_0x31ce2e,_0x2b835c){var _0x51ad9b={};logger['info'](util[_0x9b41('0x32')](_0x9b41('0x6f'),_0x51c62c,_0x3e1d2e));return uploadFile(_0x3fc641,_0x48c1e8,_0x59f172,_0x3e1d2e,path[_0x9b41('0x70')](_0x20c663),fs[_0x9b41('0x71')](_0x20c663))[_0x9b41('0x24')](function(_0x7e209c){logger[_0x9b41('0x65')](util[_0x9b41('0x32')](_0x9b41('0x72'),_0x51c62c,_0x3e1d2e,_0x7e209c[_0x9b41('0x73')]));_0x51ad9b['bucket']=_0x7e209c[_0x9b41('0x74')];_0x51ad9b[_0x9b41('0x75')]=_0x7e209c[_0x9b41('0x73')];logger[_0x9b41('0x65')](util[_0x9b41('0x32')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x51c62c));return startTranscribe(_0x3fc641,_0x48c1e8,_0x59f172,uuidv4(),_0x2e41c7,_0x7e209c[_0x9b41('0x73')]);})[_0x9b41('0x24')](function(_0x5c2583){logger['info'](util['format'](_0x9b41('0x76'),_0x51c62c,_0x5c2583['TranscriptionJob'][_0x9b41('0x77')]));_0x51ad9b[_0x9b41('0x78')]=_0x5c2583[_0x9b41('0x79')][_0x9b41('0x77')];_0x51ad9b[_0x9b41('0x7a')]=_0x5c2583['TranscriptionJob']['TranscriptionJobStatus'];return _0x31ce2e(_0x51ad9b);})[_0x9b41('0x44')](function(_0x3b23b5){return _0x2b835c(_0x3b23b5);});});}exports[_0x9b41('0x7b')]=function(_0x8d5bcd,_0x50d774,_0xff954d){var _0x124578;var _0x1f9910;var _0x500da8;var _0x4403ff=require(_0x9b41('0x4e'));return db['VoiceRecording']['findOne']({'where':{'id':_0x8d5bcd[_0x9b41('0x46')]['id']}})['then'](function(_0x4c888b){if(_0x4c888b){var _0x14a274=util[_0x9b41('0x32')](_0x9b41('0x52'),_0x4c888b[_0x9b41('0x51')]);if(fs[_0x9b41('0x53')](_0x14a274)){cypher=!![];return _0x4403ff[_0x9b41('0x54')](_0x14a274,_0x4c888b[_0x9b41('0x51')],config[_0x9b41('0x55')][_0x9b41('0x56')])['then'](function(){return _0x4c888b;});}return _0x4c888b;}})[_0x9b41('0x24')](function(_0x58fb8e){if(!_0x58fb8e){throw new db[(_0x9b41('0x57'))][(_0x9b41('0x63'))](_0x9b41('0x7c'));}_0x1f9910=_0x58fb8e;return db[_0x9b41('0x7d')][_0x9b41('0x7e')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x50d774,null))['then'](function(_0x25ca6c){if(_0x25ca6c){_0x124578=_0x25ca6c;if(!_0x124578[_0x9b41('0x7f')]||!_0x124578[_0x9b41('0x80')]||!_0x124578[_0x9b41('0x81')]||!_0x124578['language']||!_0x124578[_0x9b41('0x82')]){throw new db['Sequelize'][(_0x9b41('0x63'))](_0x9b41('0x83'));}if(_0x8d5bcd[_0x9b41('0x4a')]['runSentiment']&&(!_0x124578[_0x9b41('0x84')]||!_0x124578[_0x9b41('0x85')]||!_0x124578[_0x9b41('0x86')]||!_0x124578[_0x9b41('0x87')]||!_0x124578[_0x9b41('0x82')])){throw new db[(_0x9b41('0x57'))][(_0x9b41('0x63'))](_0x9b41('0x88'));}return db[_0x9b41('0x89')][_0x9b41('0x7e')]({'where':{'id':_0x124578['transcribeAccountId']}});}})['then'](function(_0xb80f7e){if(!_0xb80f7e){throw new db[(_0x9b41('0x57'))][(_0x9b41('0x63'))](_0x9b41('0x8a'));}if(!_0xb80f7e[_0x9b41('0x8b')]||!_0xb80f7e[_0x9b41('0x8c')]){throw new db[(_0x9b41('0x57'))][(_0x9b41('0x63'))]('Cloud\x20Provider\x20not\x20configured');}_0x500da8=_0xb80f7e;return getBucketslist(_0x500da8['data1'],_0x500da8[_0x9b41('0x8c')],_0x124578['transcribeRegion']);})[_0x9b41('0x24')](function(_0x1b6281){if(_0x1b6281&&_0x1b6281[_0x9b41('0x8d')]){var _0x545699=_[_0x9b41('0x50')](_0x1b6281[_0x9b41('0x8d')],function(_0x2dbe36){return _0x2dbe36['Name']===_0x124578['bucket'];});if(!_0x545699){logger['info'](util['format'](_0x9b41('0x8e'),_0x8d5bcd[_0x9b41('0x46')]['id'],_0x124578['bucket']));return createBucket(_0x500da8['data1'],_0x500da8[_0x9b41('0x8c')],_0x124578[_0x9b41('0x81')],_0x124578[_0x9b41('0x82')]);}logger[_0x9b41('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x8d5bcd[_0x9b41('0x46')]['id'],_0x124578[_0x9b41('0x82')]));return;}})[_0x9b41('0x24')](function(_0x383223){if(_0x1f9910[_0x9b41('0x7a')]===_0x9b41('0x8f')){return transcribe(_0x8d5bcd['params']['id'],_0x500da8[_0x9b41('0x8b')],_0x500da8[_0x9b41('0x8c')],_0x124578['transcribeRegion'],_0x124578[_0x9b41('0x82')],_0x1f9910[_0x9b41('0x51')],_0x124578[_0x9b41('0x87')]);}else{logger['info'](util[_0x9b41('0x32')](_0x9b41('0x90'),_0x8d5bcd[_0x9b41('0x46')]['id']));return{'transcribeStatus':_0x9b41('0x91')};}})[_0x9b41('0x24')](function(_0xa18222){if(_0xa18222){_0xa18222['tempSentiment']=_0x8d5bcd[_0x9b41('0x4a')][_0x9b41('0x92')];return _0x1f9910[_0x9b41('0x93')](_0xa18222);}})[_0x9b41('0x24')](respondWithResult(_0x50d774,null))['catch'](handleError(_0x50d774,null));};function writeFile(_0x878667,_0x10a4da){return new Promise(function(_0x2ceac6,_0xda080d){fs[_0x9b41('0x94')](_0x10a4da,_0x878667,function(_0x54c6de,_0x7354ac){if(_0x54c6de){return _0xda080d(_0x54c6de);}else{return _0x2ceac6(_0x7354ac);}});});}exports[_0x9b41('0x95')]=function(_0x3cf013,_0x169897,_0x4bafe0){return db['VoiceRecording'][_0x9b41('0x7e')]({'where':{'id':_0x3cf013[_0x9b41('0x46')]['id']}})['then'](handleEntityNotFound(_0x169897))['then'](function(_0x5d600c){if(_0x5d600c&&_0x5d600c['fileText']){var _0x35412b=_0x5d600c['fileText'];var _0x302feb=config[_0x9b41('0x96')]+_0x9b41('0x97')+_0x5d600c['id']+_0x9b41('0x98');if(fs['existsSync'](_0x302feb)){return _0x302feb;}return writeFile(_0x35412b,_0x302feb)[_0x9b41('0x24')](function(){return _0x302feb;});}else{throw new db[(_0x9b41('0x57'))][(_0x9b41('0x63'))]('Transcript\x20not\x20available');}})[_0x9b41('0x24')](function(_0x4a66bf){return _0x169897[_0x9b41('0x4d')](_0x4a66bf);})[_0x9b41('0x44')](handleError(_0x169897));}; \ No newline at end of file +var _0x7f6e=['limit','count','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','rawAttributes','fieldName','type','key','model','differenceBy','map','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceRecording','includeAll','include','rows','show','params','keys','find','catch','create','body','describe','../../components/encryptor','uniqueid','value','decryptFile','secrets','recording','existsSync','Sequelize','filename','download','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','sequelize','MD5','token','$and','push','%s.cypher','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','runTranscribe','findOne','ValidationError','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeStatus','NEW','IN_PROGRESS','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','json','offset','undefined'];(function(_0x59ad20,_0x58d2ba){var _0x6c7a5c=function(_0x2bae9f){while(--_0x2bae9f){_0x59ad20['push'](_0x59ad20['shift']());}};_0x6c7a5c(++_0x58d2ba);}(_0x7f6e,0x114));var _0xe7f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x7f6e[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7f6('0x0'));var jsonpatch=require(_0xe7f6('0x1'));var rp=require(_0xe7f6('0x2'));var moment=require(_0xe7f6('0x3'));var BPromise=require(_0xe7f6('0x4'));var Mustache=require('mustache');var util=require(_0xe7f6('0x5'));var path=require(_0xe7f6('0x6'));var sox=require(_0xe7f6('0x7'));var csv=require(_0xe7f6('0x8'));var ejs=require(_0xe7f6('0x9'));var fs=require('fs');var fs_extra=require(_0xe7f6('0xa'));var _=require(_0xe7f6('0xb'));var squel=require(_0xe7f6('0xc'));var crypto=require(_0xe7f6('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe7f6('0x8'));var querystring=require(_0xe7f6('0xe'));var Papa=require(_0xe7f6('0xf'));var AWS=require(_0xe7f6('0x10'));var uuidv4=require(_0xe7f6('0x11'));var Redis=require(_0xe7f6('0x12'));var authService=require(_0xe7f6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe7f6('0x14'));var hardwareService=require(_0xe7f6('0x15'));var logger=require(_0xe7f6('0x16'))(_0xe7f6('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe7f6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b65f3,_0x580c50){_0x580c50=_0x580c50||0xcc;return function(_0x49501b){if(_0x49501b){return _0x1b65f3[_0xe7f6('0x19')](_0x580c50);}return _0x1b65f3[_0xe7f6('0x1a')](_0x580c50)['end']();};}function respondWithResult(_0x4f4f1b,_0x4745ef){_0x4745ef=_0x4745ef||0xc8;return function(_0x213080){if(_0x213080){return _0x4f4f1b[_0xe7f6('0x1a')](_0x4745ef)[_0xe7f6('0x1b')](_0x213080);}};}function respondWithFilteredResult(_0x3ea896,_0x17b982){return function(_0x4ddb51){if(_0x4ddb51){var _0x177817=typeof _0x17b982[_0xe7f6('0x1c')]===_0xe7f6('0x1d')&&typeof _0x17b982[_0xe7f6('0x1e')]===_0xe7f6('0x1d');var _0x33db17=_0x4ddb51['count'];var _0x202f27=_0x177817?0x0:_0x17b982[_0xe7f6('0x1c')];var _0x14d8fe=_0x177817?_0x4ddb51[_0xe7f6('0x1f')]:_0x17b982[_0xe7f6('0x1c')]+_0x17b982[_0xe7f6('0x1e')];var _0x10ac38;if(_0x14d8fe>=_0x33db17){_0x14d8fe=_0x33db17;_0x10ac38=0xc8;}else{_0x10ac38=0xce;}_0x3ea896[_0xe7f6('0x1a')](_0x10ac38);return _0x3ea896['set'](_0xe7f6('0x20'),_0x202f27+'-'+_0x14d8fe+'/'+_0x33db17)['json'](_0x4ddb51);}return null;};}function patchUpdates(_0x3e44fe){return function(_0x1e517e){try{jsonpatch[_0xe7f6('0x21')](_0x1e517e,_0x3e44fe,!![]);}catch(_0x4a3dba){return BPromise[_0xe7f6('0x22')](_0x4a3dba);}return _0x1e517e['save']();};}function saveUpdates(_0x4d2a72,_0x5c4873){return function(_0x56c341){if(_0x56c341){return _0x56c341[_0xe7f6('0x23')](_0x4d2a72)[_0xe7f6('0x24')](function(_0x36739c){return _0x36739c;});}return null;};}function removeEntity(_0x5d458e,_0x2966aa){return function(_0x2f97ec){if(_0x2f97ec){return _0x2f97ec[_0xe7f6('0x25')]()['then'](function(){_0x5d458e[_0xe7f6('0x1a')](0xcc)[_0xe7f6('0x26')]();});}};}function handleEntityNotFound(_0x4f9955,_0x547722){return function(_0x261a81){if(!_0x261a81){_0x4f9955[_0xe7f6('0x19')](0x194);}return _0x261a81;};}function handleError(_0x5755a7,_0x579915){_0x579915=_0x579915||0x1f4;return function(_0x44ecfd){logger['error'](_0x44ecfd[_0xe7f6('0x27')]);if(_0x44ecfd[_0xe7f6('0x28')]){delete _0x44ecfd[_0xe7f6('0x28')];}_0x5755a7['status'](_0x579915)[_0xe7f6('0x29')](_0x44ecfd);};}exports['index']=function(_0x59b50c,_0x1b08ea){var _0x221872={},_0x9f04a3={},_0x5c0828={'count':0x0,'rows':[]};var _0x11a613=_['map'](db['VoiceRecording'][_0xe7f6('0x2a')],function(_0x4bfea3){return{'name':_0x4bfea3[_0xe7f6('0x2b')],'type':_0x4bfea3[_0xe7f6('0x2c')][_0xe7f6('0x2d')]};});_0x9f04a3[_0xe7f6('0x2e')]=_[_0xe7f6('0x2f')](_[_0xe7f6('0x30')](_0x11a613,_0xe7f6('0x28')),[_0xe7f6('0x31')]);_0x9f04a3[_0xe7f6('0x32')]=_['keys'](_0x59b50c['query']);_0x9f04a3[_0xe7f6('0x33')]=_[_0xe7f6('0x34')](_0x9f04a3[_0xe7f6('0x2e')],_0x9f04a3[_0xe7f6('0x32')]);_0x221872[_0xe7f6('0x35')]=_[_0xe7f6('0x34')](_0x9f04a3[_0xe7f6('0x2e')],qs[_0xe7f6('0x36')](_0x59b50c[_0xe7f6('0x32')][_0xe7f6('0x36')]));_0x221872[_0xe7f6('0x35')]=_0x221872[_0xe7f6('0x35')][_0xe7f6('0x37')]?_0x221872['attributes']:_0x9f04a3[_0xe7f6('0x2e')];if(!_0x59b50c['query'][_0xe7f6('0x38')](_0xe7f6('0x39'))){_0x221872[_0xe7f6('0x1e')]=qs[_0xe7f6('0x1e')](_0x59b50c[_0xe7f6('0x32')][_0xe7f6('0x1e')]);_0x221872[_0xe7f6('0x1c')]=qs[_0xe7f6('0x1c')](_0x59b50c['query'][_0xe7f6('0x1c')]);}_0x221872[_0xe7f6('0x3a')]=qs['sort'](_0x59b50c[_0xe7f6('0x32')][_0xe7f6('0x3b')]);_0x221872[_0xe7f6('0x3c')]=qs['filters'](_[_0xe7f6('0x3d')](_0x59b50c[_0xe7f6('0x32')],_0x9f04a3[_0xe7f6('0x33')]),_0x11a613);if(_0x59b50c[_0xe7f6('0x32')][_0xe7f6('0x3e')]){_0x221872[_0xe7f6('0x3c')]=_[_0xe7f6('0x3f')](_0x221872[_0xe7f6('0x3c')],{'$or':_[_0xe7f6('0x30')](_0x11a613,function(_0x2cfe96){if(_0x2cfe96[_0xe7f6('0x2c')]!==_0xe7f6('0x40')){var _0x473ac4={};_0x473ac4[_0x2cfe96[_0xe7f6('0x28')]]={'$like':'%'+_0x59b50c[_0xe7f6('0x32')][_0xe7f6('0x3e')]+'%'};return _0x473ac4;}})});}_0x221872=_['merge']({},_0x221872,_0x59b50c[_0xe7f6('0x41')]);var _0x1741f9={'where':_0x221872[_0xe7f6('0x3c')]};return db[_0xe7f6('0x42')][_0xe7f6('0x1f')](_0x1741f9)['then'](function(_0x4252db){_0x5c0828['count']=_0x4252db;if(_0x59b50c['query'][_0xe7f6('0x43')]){_0x221872[_0xe7f6('0x44')]=[{'all':!![]}];}return db[_0xe7f6('0x42')]['findAll'](_0x221872);})[_0xe7f6('0x24')](function(_0x2366b5){_0x5c0828[_0xe7f6('0x45')]=_0x2366b5;return _0x5c0828;})[_0xe7f6('0x24')](respondWithFilteredResult(_0x1b08ea,_0x221872))['catch'](handleError(_0x1b08ea,null));};exports[_0xe7f6('0x46')]=function(_0x56d098,_0x10c642){var _0x5c8b72={'raw':![],'where':{'id':_0x56d098[_0xe7f6('0x47')]['id']}},_0x211cd8={};_0x211cd8[_0xe7f6('0x2e')]=_[_0xe7f6('0x48')](db[_0xe7f6('0x42')]['rawAttributes']);_0x211cd8[_0xe7f6('0x32')]=_['keys'](_0x56d098[_0xe7f6('0x32')]);_0x211cd8[_0xe7f6('0x33')]=_[_0xe7f6('0x34')](_0x211cd8[_0xe7f6('0x2e')],_0x211cd8[_0xe7f6('0x32')]);_0x5c8b72[_0xe7f6('0x35')]=_['intersection'](_0x211cd8[_0xe7f6('0x2e')],qs['fields'](_0x56d098['query']['fields']));_0x5c8b72[_0xe7f6('0x35')]=_0x5c8b72['attributes'][_0xe7f6('0x37')]?_0x5c8b72[_0xe7f6('0x35')]:_0x211cd8[_0xe7f6('0x2e')];if(_0x56d098[_0xe7f6('0x32')]['includeAll']){_0x5c8b72['include']=[{'all':!![]}];}_0x5c8b72=_['merge']({},_0x5c8b72,_0x56d098['options']);return db[_0xe7f6('0x42')][_0xe7f6('0x49')](_0x5c8b72)[_0xe7f6('0x24')](handleEntityNotFound(_0x10c642,null))[_0xe7f6('0x24')](respondWithResult(_0x10c642,null))[_0xe7f6('0x4a')](handleError(_0x10c642,null));};exports[_0xe7f6('0x4b')]=function(_0x6a7e9e,_0x508519){return db[_0xe7f6('0x42')][_0xe7f6('0x4b')](_0x6a7e9e[_0xe7f6('0x4c')],{})[_0xe7f6('0x24')](respondWithResult(_0x508519,0xc9))[_0xe7f6('0x4a')](handleError(_0x508519,null));};exports[_0xe7f6('0x23')]=function(_0x31dc84,_0x2043d6){if(_0x31dc84[_0xe7f6('0x4c')]['id']){delete _0x31dc84[_0xe7f6('0x4c')]['id'];}return db[_0xe7f6('0x42')][_0xe7f6('0x49')]({'where':{'id':_0x31dc84['params']['id']}})[_0xe7f6('0x24')](handleEntityNotFound(_0x2043d6,null))[_0xe7f6('0x24')](saveUpdates(_0x31dc84['body'],null))[_0xe7f6('0x24')](respondWithResult(_0x2043d6,null))[_0xe7f6('0x4a')](handleError(_0x2043d6,null));};exports[_0xe7f6('0x4d')]=function(_0x17a6c1,_0x37db59){return db[_0xe7f6('0x42')]['describe']()[_0xe7f6('0x24')](respondWithResult(_0x37db59,null))[_0xe7f6('0x4a')](handleError(_0x37db59,null));};exports['download']=function(_0x4350cc,_0x346a1d,_0x25d501){var _0x18dcda=require(_0xe7f6('0x4e'));var _0x540c9d=![];var _0x56261b={};if(_0x4350cc[_0xe7f6('0x32')]['type']&&_0x4350cc['query'][_0xe7f6('0x2c')]===_0xe7f6('0x4f')){_0x56261b[_0xe7f6('0x4f')]=_0x4350cc[_0xe7f6('0x47')]['id'];}else{_0x56261b['id']=_0x4350cc[_0xe7f6('0x47')]['id'];}return db[_0xe7f6('0x42')][_0xe7f6('0x49')]({'where':_0x56261b,'attributes':['id',_0xe7f6('0x50')],'raw':!![]})[_0xe7f6('0x24')](handleEntityNotFound(_0x346a1d,null))[_0xe7f6('0x24')](function(_0x7d7835){if(_0x7d7835){var _0x51b755=_0x7d7835[_0xe7f6('0x50')];var _0x596274=util['format']('%s.cypher',_0x51b755);if(fs['existsSync'](_0x596274)){_0x540c9d=!![];return _0x18dcda[_0xe7f6('0x51')](_0x596274,_0x51b755,config[_0xe7f6('0x52')][_0xe7f6('0x53')])[_0xe7f6('0x24')](function(){return _0x7d7835;});}return _0x7d7835;}})[_0xe7f6('0x24')](function(_0x221eb0){if(_0x221eb0){var _0x2e2f49=_0x221eb0['value'];if(!fs[_0xe7f6('0x54')](_0x2e2f49)){throw new db[(_0xe7f6('0x55'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x221eb0[_0xe7f6('0x56')]){return _0x346a1d[_0xe7f6('0x57')](_0x2e2f49,_0x221eb0[_0xe7f6('0x56')]+path['extname'](_0x2e2f49),function(){if(_0x540c9d){fs['unlink'](_0x2e2f49);}});}else{return _0x346a1d[_0xe7f6('0x57')](_0x2e2f49,function(_0x3684e9){if(_0x540c9d){fs[_0xe7f6('0x58')](_0x2e2f49);}});}}})['catch'](function(_0xcbb647){if(_0xcbb647[_0xe7f6('0x59')]===_0xe7f6('0x5a')){_0x346a1d[_0xe7f6('0x1a')](0x194)[_0xe7f6('0x29')](_0xe7f6('0x5b'));}else{return handleError(_0x346a1d,null);}});};exports['downloads']=function(_0x589925,_0x336e85,_0x2d1028){var _0x26ed22=require(_0xe7f6('0x4e'));var _0x335c3c=![];var _0x58b8d4={'$and':[db[_0xe7f6('0x5c')][_0xe7f6('0x3c')](db[_0xe7f6('0x5c')]['fn'](_0xe7f6('0x5d'),db[_0xe7f6('0x5c')]['col'](_0xe7f6('0x4f'))),_0x589925[_0xe7f6('0x32')][_0xe7f6('0x5e')])]};if(_0x589925[_0xe7f6('0x32')][_0xe7f6('0x2c')]&&_0x589925['query'][_0xe7f6('0x2c')]==='uniqueid'){_0x58b8d4[_0xe7f6('0x5f')]['push']({'uniqueid':_0x589925[_0xe7f6('0x47')]['id']});}else{_0x58b8d4['$and'][_0xe7f6('0x60')]({'id':_0x589925[_0xe7f6('0x47')]['id']});}return db[_0xe7f6('0x42')][_0xe7f6('0x49')]({'where':_0x58b8d4,'attributes':['id',_0xe7f6('0x50')],'raw':!![]})[_0xe7f6('0x24')](handleEntityNotFound(_0x336e85,null))[_0xe7f6('0x24')](function(_0x3a6f93){if(_0x3a6f93){var _0x2853c8=util[_0xe7f6('0x31')](_0xe7f6('0x61'),_0x3a6f93[_0xe7f6('0x50')]);if(fs[_0xe7f6('0x54')](_0x2853c8)){_0x335c3c=!![];return _0x26ed22[_0xe7f6('0x51')](_0x2853c8,_0x3a6f93['value'],config['secrets'][_0xe7f6('0x53')])[_0xe7f6('0x24')](function(){return _0x3a6f93;});}return _0x3a6f93;}})[_0xe7f6('0x24')](function(_0x4235f6){if(_0x4235f6){if(!fs[_0xe7f6('0x54')](_0x4235f6[_0xe7f6('0x50')])){throw new db[(_0xe7f6('0x55'))]['ValidationError'](_0xe7f6('0x5a'));}if(_0x4235f6[_0xe7f6('0x56')]){return _0x336e85[_0xe7f6('0x57')](_0x4235f6[_0xe7f6('0x50')],_0x4235f6[_0xe7f6('0x56')]+path[_0xe7f6('0x62')](_0x4235f6[_0xe7f6('0x50')]),function(){if(_0x335c3c){fs['unlink'](_0x4235f6[_0xe7f6('0x50')]);}});}else{return _0x336e85[_0xe7f6('0x57')](_0x4235f6[_0xe7f6('0x50')],function(_0xfc446e){if(_0x335c3c){fs['unlink'](_0x4235f6[_0xe7f6('0x50')]);}});}}})[_0xe7f6('0x4a')](handleError(_0x336e85,null));};exports['destroy']=function(_0x5ea19a,_0x46fdd5){return db[_0xe7f6('0x42')]['find']({'where':{'id':_0x5ea19a[_0xe7f6('0x47')]['id']}})['then'](function(_0x3c8548){if(_[_0xe7f6('0x63')](_0x3c8548)){throw new ReferenceError(_0xe7f6('0x64'));}return _0x3c8548;})[_0xe7f6('0x24')](function(_0x138269){var _0x3f5509=_0x138269[_0xe7f6('0x50')];logger[_0xe7f6('0x65')](_0xe7f6('0x66'),_0x3f5509);if(!_['isNil'](_0x138269['value'])&&fs[_0xe7f6('0x54')](_0x3f5509)){logger[_0xe7f6('0x65')](_0xe7f6('0x67')+_0x3f5509+_0xe7f6('0x68'));fs[_0xe7f6('0x69')](_0x3f5509);}_0x3f5509=_0x3f5509+'.cypher';if(!_['isNil'](_0x138269[_0xe7f6('0x50')])&&fs[_0xe7f6('0x54')](_0x3f5509)){logger[_0xe7f6('0x65')]('File:\x20\x22'+_0x3f5509+_0xe7f6('0x68'));fs[_0xe7f6('0x69')](_0x3f5509);}return _0x138269;})[_0xe7f6('0x24')](function(_0xcc233a){if(!_0xcc233a)throw new InternalError();return _0xcc233a[_0xe7f6('0x25')]();})['then'](function(){_0x46fdd5[_0xe7f6('0x1a')](0xcc)[_0xe7f6('0x26')]();})['catch'](handleError(_0x46fdd5,null));};function getBucketslist(_0x29f0d5,_0x35ea32,_0x35daf1){return new Promise(function(_0x3e1508,_0x5e4a97){var _0x4b62c0=new AWS['S3']({'accessKeyId':_0x35ea32,'secretAccessKey':_0x29f0d5,'region':_0x35daf1});_0x4b62c0['listBuckets']({},function(_0xcce3c7,_0x2052d0){if(_0xcce3c7){return _0x5e4a97(_0xcce3c7);}else{return _0x3e1508(_0x2052d0);}});});}function createBucket(_0x32a31d,_0x29e9a1,_0x992dcf,_0x428637){return new Promise(function(_0x10fa39,_0x10bcc0){var _0x2979b3=new AWS['S3']({'accessKeyId':_0x29e9a1,'secretAccessKey':_0x32a31d,'region':_0x992dcf});_0x2979b3[_0xe7f6('0x6a')]({'Bucket':_0x428637},function(_0x192bff,_0xa5078a){if(_0x192bff){return _0x10bcc0(_0x192bff);}else{return _0x10fa39(_0xa5078a);}});});}function uploadFile(_0x55a718,_0x3213db,_0x55b393,_0x24e203,_0x2096bc,_0x1abf0f){return new Promise(function(_0x56f1bc,_0x3816d9){var _0x489ac8=new AWS['S3']({'accessKeyId':_0x3213db,'secretAccessKey':_0x55a718,'region':_0x55b393});_0x489ac8[_0xe7f6('0x6b')]({'Bucket':_0x24e203,'Key':_0x2096bc,'Body':_0x1abf0f},function(_0x5e6040,_0x3b4741){if(_0x5e6040){return _0x3816d9(_0x5e6040);}else{return _0x56f1bc(_0x3b4741);}});});}function startTranscribe(_0x54781f,_0x29e019,_0x5561a2,_0x277ef4,_0x5946e4,_0x31097c){return new Promise(function(_0x46814e,_0x8033a2){var _0x501751=new AWS[(_0xe7f6('0x6c'))]({'accessKeyId':_0x29e019,'secretAccessKey':_0x54781f,'region':_0x5561a2});_0x501751[_0xe7f6('0x6d')]({'TranscriptionJobName':_0x277ef4,'LanguageCode':_0x5946e4,'Media':{'MediaFileUri':_0x31097c}},function(_0xd51b48,_0x171129){if(_0xd51b48){return _0x8033a2(_0xd51b48);}else{return _0x46814e(_0x171129);}});});}function transcribe(_0x519a8f,_0x297991,_0x1b17e2,_0x1feac0,_0x4599ad,_0x21915c,_0xccdeee){return new Promise(function(_0x2b8c87,_0x1f2cf1){var _0x112f3a={};logger[_0xe7f6('0x65')](util[_0xe7f6('0x31')](_0xe7f6('0x6e'),_0x519a8f,_0x4599ad));return uploadFile(_0x297991,_0x1b17e2,_0x1feac0,_0x4599ad,path[_0xe7f6('0x6f')](_0x21915c),fs[_0xe7f6('0x70')](_0x21915c))[_0xe7f6('0x24')](function(_0x37c654){logger[_0xe7f6('0x65')](util[_0xe7f6('0x31')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x519a8f,_0x4599ad,_0x37c654[_0xe7f6('0x71')]));_0x112f3a[_0xe7f6('0x72')]=_0x37c654[_0xe7f6('0x73')];_0x112f3a[_0xe7f6('0x74')]=_0x37c654[_0xe7f6('0x71')];logger[_0xe7f6('0x65')](util[_0xe7f6('0x31')](_0xe7f6('0x75'),_0x519a8f));return startTranscribe(_0x297991,_0x1b17e2,_0x1feac0,uuidv4(),_0xccdeee,_0x37c654['Location']);})['then'](function(_0x1dbe04){logger['info'](util[_0xe7f6('0x31')](_0xe7f6('0x76'),_0x519a8f,_0x1dbe04[_0xe7f6('0x77')][_0xe7f6('0x78')]));_0x112f3a[_0xe7f6('0x79')]=_0x1dbe04[_0xe7f6('0x77')][_0xe7f6('0x78')];_0x112f3a['transcribeStatus']=_0x1dbe04['TranscriptionJob']['TranscriptionJobStatus'];return _0x2b8c87(_0x112f3a);})[_0xe7f6('0x4a')](function(_0x14dd3c){return _0x1f2cf1(_0x14dd3c);});});}exports[_0xe7f6('0x7a')]=function(_0x185b9e,_0x2d6aeb,_0x3028aa){var _0x222eb0;var _0x592434;var _0x500e29;var _0x49f9d9=require(_0xe7f6('0x4e'));return db[_0xe7f6('0x42')][_0xe7f6('0x7b')]({'where':{'id':_0x185b9e['params']['id']}})['then'](function(_0x1c56a3){if(_0x1c56a3){var _0x53fc83=util[_0xe7f6('0x31')]('%s.cypher',_0x1c56a3['value']);if(fs[_0xe7f6('0x54')](_0x53fc83)){cypher=!![];return _0x49f9d9[_0xe7f6('0x51')](_0x53fc83,_0x1c56a3[_0xe7f6('0x50')],config[_0xe7f6('0x52')]['recording'])[_0xe7f6('0x24')](function(){return _0x1c56a3;});}return _0x1c56a3;}})[_0xe7f6('0x24')](function(_0x1a1546){if(!_0x1a1546){throw new db['Sequelize'][(_0xe7f6('0x7c'))](_0xe7f6('0x7d'));}_0x592434=_0x1a1546;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0xe7f6('0x24')](handleEntityNotFound(_0x2d6aeb,null))['then'](function(_0x26da48){if(_0x26da48){_0x222eb0=_0x26da48;if(!_0x222eb0[_0xe7f6('0x7e')]||!_0x222eb0[_0xe7f6('0x7f')]||!_0x222eb0[_0xe7f6('0x80')]||!_0x222eb0[_0xe7f6('0x81')]||!_0x222eb0[_0xe7f6('0x72')]){throw new db[(_0xe7f6('0x55'))]['ValidationError'](_0xe7f6('0x82'));}if(_0x185b9e[_0xe7f6('0x4c')]['runSentiment']&&(!_0x222eb0[_0xe7f6('0x83')]||!_0x222eb0[_0xe7f6('0x84')]||!_0x222eb0[_0xe7f6('0x85')]||!_0x222eb0[_0xe7f6('0x81')]||!_0x222eb0['bucket'])){throw new db['Sequelize'][(_0xe7f6('0x7c'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xe7f6('0x86')][_0xe7f6('0x7b')]({'where':{'id':_0x222eb0[_0xe7f6('0x7f')]}});}})['then'](function(_0x1e0628){if(!_0x1e0628){throw new db[(_0xe7f6('0x55'))][(_0xe7f6('0x7c'))](_0xe7f6('0x87'));}if(!_0x1e0628[_0xe7f6('0x88')]||!_0x1e0628[_0xe7f6('0x89')]){throw new db[(_0xe7f6('0x55'))]['ValidationError'](_0xe7f6('0x8a'));}_0x500e29=_0x1e0628;return getBucketslist(_0x500e29[_0xe7f6('0x88')],_0x500e29['data2'],_0x222eb0[_0xe7f6('0x80')]);})['then'](function(_0x3f4cf1){if(_0x3f4cf1&&_0x3f4cf1['Buckets']){var _0xd78384=_[_0xe7f6('0x49')](_0x3f4cf1[_0xe7f6('0x8b')],function(_0x3e673a){return _0x3e673a[_0xe7f6('0x8c')]===_0x222eb0[_0xe7f6('0x72')];});if(!_0xd78384){logger[_0xe7f6('0x65')](util[_0xe7f6('0x31')](_0xe7f6('0x8d'),_0x185b9e['params']['id'],_0x222eb0['bucket']));return createBucket(_0x500e29[_0xe7f6('0x88')],_0x500e29[_0xe7f6('0x89')],_0x222eb0[_0xe7f6('0x80')],_0x222eb0[_0xe7f6('0x72')]);}logger[_0xe7f6('0x65')](util[_0xe7f6('0x31')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x185b9e[_0xe7f6('0x47')]['id'],_0x222eb0[_0xe7f6('0x72')]));return;}})[_0xe7f6('0x24')](function(_0x4c5ab9){if(_0x592434[_0xe7f6('0x8e')]===_0xe7f6('0x8f')){return transcribe(_0x185b9e['params']['id'],_0x500e29['data1'],_0x500e29[_0xe7f6('0x89')],_0x222eb0[_0xe7f6('0x80')],_0x222eb0[_0xe7f6('0x72')],_0x592434[_0xe7f6('0x50')],_0x222eb0[_0xe7f6('0x81')]);}else{logger[_0xe7f6('0x65')](util[_0xe7f6('0x31')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x185b9e['params']['id']));return{'transcribeStatus':_0xe7f6('0x90')};}})[_0xe7f6('0x24')](function(_0x34b3af){if(_0x34b3af){_0x34b3af['tempSentiment']=_0x185b9e[_0xe7f6('0x4c')][_0xe7f6('0x91')];return _0x592434[_0xe7f6('0x92')](_0x34b3af);}})['then'](respondWithResult(_0x2d6aeb,null))['catch'](handleError(_0x2d6aeb,null));};function writeFile(_0x35e870,_0x52deb2){return new Promise(function(_0x61754,_0x557e3b){fs[_0xe7f6('0x93')](_0x52deb2,_0x35e870,function(_0x3326c7,_0x15f318){if(_0x3326c7){return _0x557e3b(_0x3326c7);}else{return _0x61754(_0x15f318);}});});}exports[_0xe7f6('0x94')]=function(_0x1d68d7,_0x468ff1,_0x166b95){return db['VoiceRecording'][_0xe7f6('0x7b')]({'where':{'id':_0x1d68d7[_0xe7f6('0x47')]['id']}})['then'](handleEntityNotFound(_0x468ff1))[_0xe7f6('0x24')](function(_0x34badc){if(_0x34badc&&_0x34badc[_0xe7f6('0x95')]){var _0x43f0dc=_0x34badc['fileText'];var _0x52533e=config[_0xe7f6('0x96')]+_0xe7f6('0x97')+_0x34badc['id']+'.txt';if(fs[_0xe7f6('0x54')](_0x52533e)){return _0x52533e;}return writeFile(_0x43f0dc,_0x52533e)[_0xe7f6('0x24')](function(){return _0x52533e;});}else{throw new db['Sequelize'][(_0xe7f6('0x7c'))](_0xe7f6('0x98'));}})[_0xe7f6('0x24')](function(_0x37f462){return _0x468ff1['download'](_0x37f462);})['catch'](handleError(_0x468ff1));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index aa45c33..d3e4227 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 _0xaaa6=['../../config/environment','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4259e9,_0x3be572){var _0x348e6d=function(_0x3c3370){while(--_0x3c3370){_0x4259e9['push'](_0x4259e9['shift']());}};_0x348e6d(++_0x3be572);}(_0xaaa6,0xfd));var _0x6aaa=function(_0x2606e7,_0x1fbaff){_0x2606e7=_0x2606e7-0x0;var _0x154740=_0xaaa6[_0x2606e7];return _0x154740;};'use strict';var _=require(_0x6aaa('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6aaa('0x1'));var moment=require(_0x6aaa('0x2'));var BPromise=require(_0x6aaa('0x3'));var rp=require(_0x6aaa('0x4'));var fs=require('fs');var path=require(_0x6aaa('0x5'));var rimraf=require(_0x6aaa('0x6'));var config=require(_0x6aaa('0x7'));var attributes=require(_0x6aaa('0x8'));module[_0x6aaa('0x9')]=function(_0xa57124,_0x35b6f0){return _0xa57124['define'](_0x6aaa('0xa'),attributes,{'tableName':_0x6aaa('0xb'),'paranoid':![],'indexes':[{'name':_0x6aaa('0xc'),'fields':[_0x6aaa('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x15a5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util'];(function(_0x1b7aa2,_0x570bf6){var _0x5ad2c8=function(_0x386354){while(--_0x386354){_0x1b7aa2['push'](_0x1b7aa2['shift']());}};_0x5ad2c8(++_0x570bf6);}(_0x15a5,0x148));var _0x515a=function(_0x41fcd3,_0x468007){_0x41fcd3=_0x41fcd3-0x0;var _0x144047=_0x15a5[_0x41fcd3];return _0x144047;};'use strict';var _=require(_0x515a('0x0'));var util=require(_0x515a('0x1'));var logger=require('../../config/logger')(_0x515a('0x2'));var moment=require(_0x515a('0x3'));var BPromise=require(_0x515a('0x4'));var rp=require(_0x515a('0x5'));var fs=require('fs');var path=require(_0x515a('0x6'));var rimraf=require(_0x515a('0x7'));var config=require(_0x515a('0x8'));var attributes=require(_0x515a('0x9'));module[_0x515a('0xa')]=function(_0x58da7d,_0xeec4a4){return _0x58da7d[_0x515a('0xb')](_0x515a('0xc'),attributes,{'tableName':_0x515a('0xd'),'paranoid':![],'indexes':[{'name':_0x515a('0xe'),'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 4729cd7..3fee7fc 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 _0x68b3=['../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','format','%s.cypher','value','encryptFile','secrets','recording','unlink','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording'];(function(_0x153c6c,_0x5aa22f){var _0x3c85d3=function(_0x5a5d85){while(--_0x5a5d85){_0x153c6c['push'](_0x153c6c['shift']());}};_0x3c85d3(++_0x5aa22f);}(_0x68b3,0x1d8));var _0x368b=function(_0x28ee0e,_0x21d8b4){_0x28ee0e=_0x28ee0e-0x0;var _0x2c16f5=_0x68b3[_0x28ee0e];return _0x2c16f5;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var moment=require(_0x368b('0x2'));var BPromise=require(_0x368b('0x3'));var rs=require(_0x368b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x368b('0x5'))['db'];var utils=require(_0x368b('0x6'));var logger=require(_0x368b('0x7'))(_0x368b('0x8'));var config=require('../../config/environment');var jayson=require(_0x368b('0x9'));var client=jayson[_0x368b('0xa')][_0x368b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23584a,_0x4406c8,_0x127c1e){return new BPromise(function(_0x2dec1c,_0x142d05){return client[_0x368b('0xc')](_0x23584a,_0x127c1e)[_0x368b('0xd')](function(_0x2a7b9f){logger['info'](_0x368b('0xe'),_0x4406c8,_0x368b('0xf'));logger[_0x368b('0x10')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x4406c8,_0x368b('0xf'),JSON[_0x368b('0x11')](_0x2a7b9f));if(_0x2a7b9f[_0x368b('0x12')]){if(_0x2a7b9f['error'][_0x368b('0x13')]===0x1f4){logger[_0x368b('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x4406c8,_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);return _0x142d05(_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);}logger[_0x368b('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x4406c8,_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);return _0x2dec1c(_0x2a7b9f['error'][_0x368b('0x14')]);}else{logger[_0x368b('0x15')](_0x368b('0xe'),_0x4406c8,'request\x20sent');_0x2dec1c(_0x2a7b9f[_0x368b('0x16')][_0x368b('0x14')]);}})[_0x368b('0x17')](function(_0x4d6d9d){logger[_0x368b('0x12')](_0x368b('0xe'),_0x4406c8,_0x4d6d9d);_0x142d05(_0x4d6d9d);});});}exports[_0x368b('0x18')]=function(_0x540f57){var _0x5d543e=this;return new Promise(function(_0x3e2e9f,_0x27d2a0){return db[_0x368b('0x19')][_0x368b('0x1a')](_0x540f57[_0x368b('0x1b')],{'raw':_0x540f57['options']?_0x540f57[_0x368b('0x1c')][_0x368b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540f57[_0x368b('0x1c')]?_0x540f57[_0x368b('0x1c')][_0x368b('0x1e')]||null:null,'attributes':_0x540f57[_0x368b('0x1c')]?_0x540f57[_0x368b('0x1c')][_0x368b('0x1f')]||null:null,'limit':_0x540f57['options']?_0x540f57[_0x368b('0x1c')][_0x368b('0x20')]||null:null})[_0x368b('0xd')](function(_0xc0f7af){logger[_0x368b('0x15')]('UpdateVoiceRecording',_0x540f57);logger[_0x368b('0x10')](_0x368b('0x18'),_0x540f57,JSON[_0x368b('0x11')](_0xc0f7af));_0x3e2e9f(_0xc0f7af);})[_0x368b('0x17')](function(_0x77a269){logger[_0x368b('0x12')](_0x368b('0x18'),_0x77a269[_0x368b('0x14')],_0x540f57);_0x27d2a0(_0x5d543e[_0x368b('0x12')](0x1f4,_0x77a269[_0x368b('0x14')]));});});};exports[_0x368b('0x21')]=function(_0x344d8a){var _0xceec4b=this;return new Promise(function(_0x376e61,_0x4636f4){var _0x23a83a=require(_0x368b('0x22'));var _0x9f192e;return db[_0x368b('0x23')][_0x368b('0x24')]({'attributes':['id',_0x368b('0x25')],'where':{'id':0x1},'raw':!![]})[_0x368b('0xd')](function(_0x107d2f){_0x9f192e=_0x107d2f;return db[_0x368b('0x19')]['create'](_0x344d8a['body']);})[_0x368b('0xd')](function(_0x2f1d52){if(_0x9f192e[_0x368b('0x25')]&&fs[_0x368b('0x26')](_0x2f1d52['value'])){var _0x12ae59=util[_0x368b('0x27')](_0x368b('0x28'),_0x2f1d52[_0x368b('0x29')]);return _0x23a83a[_0x368b('0x2a')](_0x2f1d52['value'],_0x12ae59,config[_0x368b('0x2b')][_0x368b('0x2c')])[_0x368b('0xd')](function(){fs[_0x368b('0x2d')](_0x2f1d52['value']);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x2f1d52;});}return _0x2f1d52;})[_0x368b('0xd')](function(_0x2bc363){logger[_0x368b('0x15')](_0x368b('0x21'),_0x344d8a);logger[_0x368b('0x10')]('CreateVoiceRecording',_0x344d8a,JSON[_0x368b('0x11')](_0x2bc363));_0x376e61(_0x2bc363);})[_0x368b('0x17')](function(_0x54e7e5){logger[_0x368b('0x12')](_0x368b('0x21'),_0x54e7e5['message'],_0x344d8a);_0x4636f4(_0xceec4b[_0x368b('0x12')](0x1f4,_0x54e7e5[_0x368b('0x14')]));});});}; \ No newline at end of file +var _0x7bd0=['callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','VoiceRecording','update','body','options','raw','attributes','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x7bd0,0x111));var _0x07bd=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x7bd0[_0x588011];return _0x3b3773;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var moment=require(_0x07bd('0x2'));var BPromise=require(_0x07bd('0x3'));var rs=require(_0x07bd('0x4'));var fs=require('fs');var Redis=require(_0x07bd('0x5'));var db=require(_0x07bd('0x6'))['db'];var utils=require(_0x07bd('0x7'));var logger=require('../../config/logger')(_0x07bd('0x8'));var config=require(_0x07bd('0x9'));var jayson=require(_0x07bd('0xa'));var client=jayson[_0x07bd('0xb')][_0x07bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x422a22,_0x2e4cd1,_0x5a939d){return new BPromise(function(_0x3968d9,_0x5cd446){return client[_0x07bd('0xd')](_0x422a22,_0x5a939d)[_0x07bd('0xe')](function(_0x323724){logger['info'](_0x07bd('0xf'),_0x2e4cd1,_0x07bd('0x10'));logger[_0x07bd('0x11')](_0x07bd('0x12'),_0x2e4cd1,'request\x20sent',JSON[_0x07bd('0x13')](_0x323724));if(_0x323724[_0x07bd('0x14')]){if(_0x323724[_0x07bd('0x14')][_0x07bd('0x15')]===0x1f4){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x5cd446(_0x323724['error']['message']);}logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x3968d9(_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);}else{logger[_0x07bd('0x17')]('VoiceRecording,\x20%s,\x20%s',_0x2e4cd1,_0x07bd('0x10'));_0x3968d9(_0x323724['result'][_0x07bd('0x16')]);}})[_0x07bd('0x18')](function(_0x31655a){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x31655a);_0x5cd446(_0x31655a);});});}exports['UpdateVoiceRecording']=function(_0x3f9f0b){var _0xc4cf4c=this;return new Promise(function(_0x4948f4,_0x3e8ec4){return db[_0x07bd('0x19')][_0x07bd('0x1a')](_0x3f9f0b[_0x07bd('0x1b')],{'raw':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')][_0x07bd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')]['where']||null:null,'attributes':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')][_0x07bd('0x1e')]||null:null,'limit':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')]['limit']||null:null})['then'](function(_0xbb7117){logger['info'](_0x07bd('0x1f'),_0x3f9f0b);logger['debug']('UpdateVoiceRecording',_0x3f9f0b,JSON[_0x07bd('0x13')](_0xbb7117));_0x4948f4(_0xbb7117);})[_0x07bd('0x18')](function(_0xf3b23c){logger[_0x07bd('0x14')](_0x07bd('0x1f'),_0xf3b23c[_0x07bd('0x16')],_0x3f9f0b);_0x3e8ec4(_0xc4cf4c['error'](0x1f4,_0xf3b23c[_0x07bd('0x16')]));});});};exports[_0x07bd('0x20')]=function(_0x3db9d0){var _0x2a7202=this;return new Promise(function(_0x12ce26,_0x1c1fda){var _0x571dab=require('../../components/encryptor');var _0x5184dc;return db[_0x07bd('0x21')][_0x07bd('0x22')]({'attributes':['id',_0x07bd('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x1a3aa9){_0x5184dc=_0x1a3aa9;return db[_0x07bd('0x19')][_0x07bd('0x24')](_0x3db9d0[_0x07bd('0x1b')]);})[_0x07bd('0xe')](function(_0x13bf6b){if(_0x5184dc['callRecordingEncryption']&&fs[_0x07bd('0x25')](_0x13bf6b[_0x07bd('0x26')])){var _0x4182b9=util[_0x07bd('0x27')](_0x07bd('0x28'),_0x13bf6b[_0x07bd('0x26')]);return _0x571dab[_0x07bd('0x29')](_0x13bf6b[_0x07bd('0x26')],_0x4182b9,config['secrets']['recording'])[_0x07bd('0xe')](function(){fs[_0x07bd('0x2a')](_0x13bf6b[_0x07bd('0x26')]);logger['info'](_0x07bd('0x2b'));return _0x13bf6b;});}return _0x13bf6b;})[_0x07bd('0xe')](function(_0x208aca){logger['info']('CreateVoiceRecording',_0x3db9d0);logger[_0x07bd('0x11')](_0x07bd('0x20'),_0x3db9d0,JSON[_0x07bd('0x13')](_0x208aca));_0x12ce26(_0x208aca);})[_0x07bd('0x18')](function(_0x5f29c5){logger[_0x07bd('0x14')](_0x07bd('0x20'),_0x5f29c5[_0x07bd('0x16')],_0x3db9d0);_0x1c1fda(_0x2a7202['error'](0x1f4,_0x5f29c5[_0x07bd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index b02fca8..370f759 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 _0xaa3b=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x3f0e92,_0x240ad7){var _0x9686f3=function(_0x1a0133){while(--_0x1a0133){_0x3f0e92['push'](_0x3f0e92['shift']());}};_0x9686f3(++_0x240ad7);}(_0xaa3b,0xcc));var _0xbaa3=function(_0xe1b12b,_0x241bd1){_0xe1b12b=_0xe1b12b-0x0;var _0x1b697a=_0xaa3b[_0xe1b12b];return _0x1b697a;};'use strict';var multer=require(_0xbaa3('0x0'));var util=require(_0xbaa3('0x1'));var path=require(_0xbaa3('0x2'));var timeout=require(_0xbaa3('0x3'));var express=require(_0xbaa3('0x4'));var router=express['Router']();var fs_extra=require(_0xbaa3('0x5'));var auth=require(_0xbaa3('0x6'));var interaction=require(_0xbaa3('0x7'));var config=require('../../config/environment');var controller=require(_0xbaa3('0x8'));router[_0xbaa3('0x9')]('/',auth[_0xbaa3('0xa')](),controller[_0xbaa3('0xb')]);router[_0xbaa3('0x9')](_0xbaa3('0xc'),auth['isAuthenticated'](),controller[_0xbaa3('0xd')]);router[_0xbaa3('0x9')](_0xbaa3('0xe'),auth[_0xbaa3('0xa')](),controller[_0xbaa3('0xf')]);router[_0xbaa3('0x10')]('/',auth[_0xbaa3('0xa')](),controller[_0xbaa3('0x11')]);router[_0xbaa3('0x12')](_0xbaa3('0xe'),auth['isAuthenticated'](),controller[_0xbaa3('0x13')]);router[_0xbaa3('0x14')](_0xbaa3('0xe'),auth['isAuthenticated'](),controller[_0xbaa3('0x15')]);module['exports']=router; \ No newline at end of file +var _0xa687=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','/:id','update','delete','destroy','exports'];(function(_0xa92c5f,_0x295709){var _0x32b44e=function(_0x13c5c8){while(--_0x13c5c8){_0xa92c5f['push'](_0xa92c5f['shift']());}};_0x32b44e(++_0x295709);}(_0xa687,0x1b9));var _0x7a68=function(_0x4bad6c,_0x29ec89){_0x4bad6c=_0x4bad6c-0x0;var _0x46ac3b=_0xa687[_0x4bad6c];return _0x46ac3b;};'use strict';var multer=require(_0x7a68('0x0'));var util=require(_0x7a68('0x1'));var path=require('path');var timeout=require(_0x7a68('0x2'));var express=require(_0x7a68('0x3'));var router=express[_0x7a68('0x4')]();var fs_extra=require(_0x7a68('0x5'));var auth=require(_0x7a68('0x6'));var interaction=require(_0x7a68('0x7'));var config=require('../../config/environment');var controller=require(_0x7a68('0x8'));router['get']('/',auth[_0x7a68('0x9')](),controller[_0x7a68('0xa')]);router[_0x7a68('0xb')](_0x7a68('0xc'),auth[_0x7a68('0x9')](),controller[_0x7a68('0xd')]);router[_0x7a68('0xb')]('/:id',auth[_0x7a68('0x9')](),controller[_0x7a68('0xe')]);router[_0x7a68('0xf')]('/',auth[_0x7a68('0x9')](),controller['create']);router['put'](_0x7a68('0x10'),auth[_0x7a68('0x9')](),controller[_0x7a68('0x11')]);router[_0x7a68('0x12')](_0x7a68('0x10'),auth[_0x7a68('0x9')](),controller[_0x7a68('0x13')]);module[_0x7a68('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 c1e2c2d..8d5576b 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 _0xe3c8=['blind','STRING','Yes','sequelize','moment','exports','ENUM'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xe3c8,0x145));var _0x8e3c=function(_0xf8c121,_0x543868){_0xf8c121=_0xf8c121-0x0;var _0x1bfdc9=_0xe3c8[_0xf8c121];return _0x1bfdc9;};'use strict';var Sequelize=require(_0x8e3c('0x0'));var moment=require(_0x8e3c('0x1'));module[_0x8e3c('0x2')]={'type':{'type':Sequelize[_0x8e3c('0x3')](_0x8e3c('0x4'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x8e3c('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x8e3c('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x8e3c('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x8e3c('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x8e3c('0x5')]},'transferercontext':{'type':Sequelize[_0x8e3c('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x8e3c('0x5')]},'transfereechannel':{'type':Sequelize[_0x8e3c('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x8e3c('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x8e3c('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x8e3c('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x8e3c('0x5')]},'transfereeexten':{'type':Sequelize[_0x8e3c('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x8e3c('0x5')]},'isexternal':{'type':Sequelize[_0x8e3c('0x3')](_0x8e3c('0x6'),'No')},'context':{'type':Sequelize[_0x8e3c('0x5')]},'extension':{'type':Sequelize[_0x8e3c('0x5')]}}; \ No newline at end of file +var _0x9282=['STRING','Yes','sequelize','exports','ENUM','blind','attended'];(function(_0x2f2cb8,_0x417d38){var _0x5a7add=function(_0xc1da1d){while(--_0xc1da1d){_0x2f2cb8['push'](_0x2f2cb8['shift']());}};_0x5a7add(++_0x417d38);}(_0x9282,0xc6));var _0x2928=function(_0xb64e9e,_0x519fb2){_0xb64e9e=_0xb64e9e-0x0;var _0x1c63f4=_0x9282[_0xb64e9e];return _0x1c63f4;};'use strict';var Sequelize=require(_0x2928('0x0'));var moment=require('moment');module[_0x2928('0x1')]={'type':{'type':Sequelize[_0x2928('0x2')](_0x2928('0x3'),_0x2928('0x4'))},'result':{'type':Sequelize[_0x2928('0x5')]},'transfererchannel':{'type':Sequelize[_0x2928('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x2928('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x2928('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x2928('0x5')]},'transferercontext':{'type':Sequelize[_0x2928('0x5')]},'transfererexten':{'type':Sequelize[_0x2928('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x2928('0x5')]},'transfereechannel':{'type':Sequelize[_0x2928('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x2928('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x2928('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x2928('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x2928('0x5')]},'transfereecontext':{'type':Sequelize[_0x2928('0x5')]},'transfereeexten':{'type':Sequelize[_0x2928('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x2928('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0x2928('0x6'),'No')},'context':{'type':Sequelize[_0x2928('0x5')]},'extension':{'type':Sequelize[_0x2928('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 4b31a2c..18ad87c 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 _0x06dd=['nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0xed5729,_0x4979b1){var _0x4607e4=function(_0x2d77e2){while(--_0x2d77e2){_0xed5729['push'](_0xed5729['shift']());}};_0x4607e4(++_0x4979b1);}(_0x06dd,0x1cf));var _0xd06d=function(_0x5c1c49,_0xd7027){_0x5c1c49=_0x5c1c49-0x0;var _0x399334=_0x06dd[_0x5c1c49];return _0x399334;};'use strict';var emlformat=require(_0xd06d('0x0'));var rimraf=require(_0xd06d('0x1'));var zipdir=require(_0xd06d('0x2'));var jsonpatch=require(_0xd06d('0x3'));var rp=require('request-promise');var moment=require(_0xd06d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd06d('0x5'));var util=require(_0xd06d('0x6'));var path=require(_0xd06d('0x7'));var sox=require('sox');var csv=require(_0xd06d('0x8'));var ejs=require(_0xd06d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd06d('0xa'));var crypto=require(_0xd06d('0xb'));var jsforce=require(_0xd06d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd06d('0xd'));var Papa=require(_0xd06d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd06d('0xf'));var as=require(_0xd06d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd06d('0x11'));var utils=require('../../config/utils');var config=require(_0xd06d('0x12'));var licenseUtil=require(_0xd06d('0x13'));var db=require(_0xd06d('0x14'))['db'];function respondWithStatusCode(_0x860b71,_0x597fdc){_0x597fdc=_0x597fdc||0xcc;return function(_0x4a429e){if(_0x4a429e){return _0x860b71['sendStatus'](_0x597fdc);}return _0x860b71[_0xd06d('0x15')](_0x597fdc)[_0xd06d('0x16')]();};}function respondWithResult(_0x4ddfbd,_0x5e21f7){_0x5e21f7=_0x5e21f7||0xc8;return function(_0x11920f){if(_0x11920f){return _0x4ddfbd[_0xd06d('0x15')](_0x5e21f7)[_0xd06d('0x17')](_0x11920f);}};}function respondWithFilteredResult(_0x2452ac,_0x4bd7c6){return function(_0x49a9cb){if(_0x49a9cb){var _0x490d13=typeof _0x4bd7c6[_0xd06d('0x18')]===_0xd06d('0x19')&&typeof _0x4bd7c6[_0xd06d('0x1a')]===_0xd06d('0x19');var _0x273cdd=_0x49a9cb[_0xd06d('0x1b')];var _0x2b4787=_0x490d13?0x0:_0x4bd7c6['offset'];var _0x3a1a5b=_0x490d13?_0x49a9cb[_0xd06d('0x1b')]:_0x4bd7c6['offset']+_0x4bd7c6['limit'];var _0x1be6ca;if(_0x3a1a5b>=_0x273cdd){_0x3a1a5b=_0x273cdd;_0x1be6ca=0xc8;}else{_0x1be6ca=0xce;}_0x2452ac[_0xd06d('0x15')](_0x1be6ca);return _0x2452ac['set'](_0xd06d('0x1c'),_0x2b4787+'-'+_0x3a1a5b+'/'+_0x273cdd)[_0xd06d('0x17')](_0x49a9cb);}return null;};}function patchUpdates(_0x50090d){return function(_0x579123){try{jsonpatch[_0xd06d('0x1d')](_0x579123,_0x50090d,!![]);}catch(_0x40f2cd){return BPromise[_0xd06d('0x1e')](_0x40f2cd);}return _0x579123['save']();};}function saveUpdates(_0x53148b,_0x176e25){return function(_0x393a5d){if(_0x393a5d){return _0x393a5d[_0xd06d('0x1f')](_0x53148b)[_0xd06d('0x20')](function(_0x435594){return _0x435594;});}return null;};}function removeEntity(_0x4788ee,_0x343d5e){return function(_0x4a2e9f){if(_0x4a2e9f){return _0x4a2e9f[_0xd06d('0x21')]()[_0xd06d('0x20')](function(){_0x4788ee[_0xd06d('0x15')](0xcc)[_0xd06d('0x16')]();});}};}function handleEntityNotFound(_0x5f27cb,_0xb91793){return function(_0x575c5d){if(!_0x575c5d){_0x5f27cb[_0xd06d('0x22')](0x194);}return _0x575c5d;};}function handleError(_0x287868,_0xaea3c5){_0xaea3c5=_0xaea3c5||0x1f4;return function(_0x502bca){logger[_0xd06d('0x23')](_0x502bca[_0xd06d('0x24')]);if(_0x502bca[_0xd06d('0x25')]){delete _0x502bca[_0xd06d('0x25')];}_0x287868[_0xd06d('0x15')](_0xaea3c5)[_0xd06d('0x26')](_0x502bca);};}exports[_0xd06d('0x27')]=function(_0x1abcd0,_0x131b92){var _0x18aaca={},_0x2e4f2a={},_0x57821e={'count':0x0,'rows':[]};var _0x1959d8=_[_0xd06d('0x28')](db[_0xd06d('0x29')][_0xd06d('0x2a')],function(_0xb42fac){return{'name':_0xb42fac[_0xd06d('0x2b')],'type':_0xb42fac[_0xd06d('0x2c')][_0xd06d('0x2d')]};});_0x2e4f2a[_0xd06d('0x2e')]=_[_0xd06d('0x28')](_0x1959d8,_0xd06d('0x25'));_0x2e4f2a[_0xd06d('0x2f')]=_[_0xd06d('0x30')](_0x1abcd0['query']);_0x2e4f2a[_0xd06d('0x31')]=_['intersection'](_0x2e4f2a['model'],_0x2e4f2a[_0xd06d('0x2f')]);_0x18aaca[_0xd06d('0x32')]=_[_0xd06d('0x33')](_0x2e4f2a['model'],qs['fields'](_0x1abcd0[_0xd06d('0x2f')][_0xd06d('0x34')]));_0x18aaca[_0xd06d('0x32')]=_0x18aaca[_0xd06d('0x32')][_0xd06d('0x35')]?_0x18aaca[_0xd06d('0x32')]:_0x2e4f2a[_0xd06d('0x2e')];if(!_0x1abcd0[_0xd06d('0x2f')][_0xd06d('0x36')](_0xd06d('0x37'))){_0x18aaca[_0xd06d('0x1a')]=qs[_0xd06d('0x1a')](_0x1abcd0[_0xd06d('0x2f')]['limit']);_0x18aaca['offset']=qs[_0xd06d('0x18')](_0x1abcd0[_0xd06d('0x2f')][_0xd06d('0x18')]);}_0x18aaca['order']=qs[_0xd06d('0x38')](_0x1abcd0[_0xd06d('0x2f')][_0xd06d('0x38')]);_0x18aaca['where']=qs[_0xd06d('0x31')](_[_0xd06d('0x39')](_0x1abcd0[_0xd06d('0x2f')],_0x2e4f2a[_0xd06d('0x31')]),_0x1959d8);if(_0x1abcd0[_0xd06d('0x2f')][_0xd06d('0x3a')]){_0x18aaca[_0xd06d('0x3b')]=_[_0xd06d('0x3c')](_0x18aaca[_0xd06d('0x3b')],{'$or':_[_0xd06d('0x28')](_0x1959d8,function(_0x4ff2dd){if(_0x4ff2dd[_0xd06d('0x2c')]!==_0xd06d('0x3d')){var _0xabda08={};_0xabda08[_0x4ff2dd[_0xd06d('0x25')]]={'$like':'%'+_0x1abcd0[_0xd06d('0x2f')][_0xd06d('0x3a')]+'%'};return _0xabda08;}})});}_0x18aaca=_[_0xd06d('0x3c')]({},_0x18aaca,_0x1abcd0[_0xd06d('0x3e')]);var _0x2f1fa7={'where':_0x18aaca[_0xd06d('0x3b')]};return db[_0xd06d('0x29')][_0xd06d('0x1b')](_0x2f1fa7)['then'](function(_0xa4b6c2){_0x57821e[_0xd06d('0x1b')]=_0xa4b6c2;if(_0x1abcd0[_0xd06d('0x2f')][_0xd06d('0x3f')]){_0x18aaca[_0xd06d('0x40')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xd06d('0x41')](_0x18aaca);})[_0xd06d('0x20')](function(_0xc1cac6){_0x57821e[_0xd06d('0x42')]=_0xc1cac6;return _0x57821e;})[_0xd06d('0x20')](respondWithFilteredResult(_0x131b92,_0x18aaca))[_0xd06d('0x43')](handleError(_0x131b92,null));};exports[_0xd06d('0x44')]=function(_0x59beaa,_0x1c9aa6){var _0x1da661={'raw':!![],'where':{'id':_0x59beaa['params']['id']}},_0x4f1b2a={};_0x4f1b2a['model']=_[_0xd06d('0x30')](db[_0xd06d('0x29')][_0xd06d('0x2a')]);_0x4f1b2a['query']=_[_0xd06d('0x30')](_0x59beaa[_0xd06d('0x2f')]);_0x4f1b2a['filters']=_['intersection'](_0x4f1b2a[_0xd06d('0x2e')],_0x4f1b2a[_0xd06d('0x2f')]);_0x1da661['attributes']=_[_0xd06d('0x33')](_0x4f1b2a[_0xd06d('0x2e')],qs['fields'](_0x59beaa[_0xd06d('0x2f')][_0xd06d('0x34')]));_0x1da661[_0xd06d('0x32')]=_0x1da661['attributes'][_0xd06d('0x35')]?_0x1da661[_0xd06d('0x32')]:_0x4f1b2a[_0xd06d('0x2e')];if(_0x59beaa[_0xd06d('0x2f')][_0xd06d('0x3f')]){_0x1da661[_0xd06d('0x40')]=[{'all':!![]}];}_0x1da661=_[_0xd06d('0x3c')]({},_0x1da661,_0x59beaa[_0xd06d('0x3e')]);return db[_0xd06d('0x29')][_0xd06d('0x45')](_0x1da661)[_0xd06d('0x20')](handleEntityNotFound(_0x1c9aa6,null))[_0xd06d('0x20')](respondWithResult(_0x1c9aa6,null))[_0xd06d('0x43')](handleError(_0x1c9aa6,null));};exports[_0xd06d('0x46')]=function(_0x56f125,_0x2fadf9){return db[_0xd06d('0x29')][_0xd06d('0x46')](_0x56f125[_0xd06d('0x47')],{})['then'](respondWithResult(_0x2fadf9,0xc9))[_0xd06d('0x43')](handleError(_0x2fadf9,null));};exports['update']=function(_0x2a87d6,_0x14b256){if(_0x2a87d6[_0xd06d('0x47')]['id']){delete _0x2a87d6[_0xd06d('0x47')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x2a87d6[_0xd06d('0x48')]['id']}})[_0xd06d('0x20')](handleEntityNotFound(_0x14b256,null))['then'](saveUpdates(_0x2a87d6['body'],null))['then'](respondWithResult(_0x14b256,null))[_0xd06d('0x43')](handleError(_0x14b256,null));};exports[_0xd06d('0x21')]=function(_0x3d5644,_0x4fc7ba){return db[_0xd06d('0x29')][_0xd06d('0x45')]({'where':{'id':_0x3d5644[_0xd06d('0x48')]['id']}})[_0xd06d('0x20')](handleEntityNotFound(_0x4fc7ba,null))[_0xd06d('0x20')](removeEntity(_0x4fc7ba,null))[_0xd06d('0x43')](handleError(_0x4fc7ba,null));};exports[_0xd06d('0x49')]=function(_0x324633,_0x5b496c){return db[_0xd06d('0x29')]['describe']()[_0xd06d('0x20')](respondWithResult(_0x5b496c,null))[_0xd06d('0x43')](handleError(_0x5b496c,null));}; \ No newline at end of file +var _0xf666=['update','then','destroy','end','sendStatus','error','stack','name','send','index','map','VoiceTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','include','findAll','rows','catch','params','rawAttributes','includeAll','merge','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','status','json','offset','undefined','count','limit','Content-Range','apply','reject'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0xf666,0x153));var _0x6f66=function(_0x46a3ff,_0x470b9a){_0x46a3ff=_0x46a3ff-0x0;var _0x404bc2=_0xf666[_0x46a3ff];return _0x404bc2;};'use strict';var emlformat=require(_0x6f66('0x0'));var rimraf=require(_0x6f66('0x1'));var zipdir=require(_0x6f66('0x2'));var jsonpatch=require(_0x6f66('0x3'));var rp=require(_0x6f66('0x4'));var moment=require(_0x6f66('0x5'));var BPromise=require(_0x6f66('0x6'));var Mustache=require(_0x6f66('0x7'));var util=require(_0x6f66('0x8'));var path=require(_0x6f66('0x9'));var sox=require(_0x6f66('0xa'));var csv=require(_0x6f66('0xb'));var ejs=require(_0x6f66('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f66('0xd'));var squel=require(_0x6f66('0xe'));var crypto=require(_0x6f66('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6f66('0x10'));var toCsv=require(_0x6f66('0xb'));var querystring=require(_0x6f66('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6f66('0x12'));var qs=require(_0x6f66('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f66('0x14'))(_0x6f66('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36d0a7,_0x30f1c8){_0x30f1c8=_0x30f1c8||0xcc;return function(_0x53a25d){if(_0x53a25d){return _0x36d0a7['sendStatus'](_0x30f1c8);}return _0x36d0a7[_0x6f66('0x16')](_0x30f1c8)['end']();};}function respondWithResult(_0x3afb5e,_0x9da00){_0x9da00=_0x9da00||0xc8;return function(_0x2f6fa1){if(_0x2f6fa1){return _0x3afb5e[_0x6f66('0x16')](_0x9da00)[_0x6f66('0x17')](_0x2f6fa1);}};}function respondWithFilteredResult(_0x3b15ed,_0x23fdec){return function(_0xdfd5c8){if(_0xdfd5c8){var _0x37d271=typeof _0x23fdec[_0x6f66('0x18')]==='undefined'&&typeof _0x23fdec['limit']===_0x6f66('0x19');var _0x4b3381=_0xdfd5c8[_0x6f66('0x1a')];var _0x12b21f=_0x37d271?0x0:_0x23fdec['offset'];var _0x1a9fa0=_0x37d271?_0xdfd5c8['count']:_0x23fdec[_0x6f66('0x18')]+_0x23fdec[_0x6f66('0x1b')];var _0x4c54cf;if(_0x1a9fa0>=_0x4b3381){_0x1a9fa0=_0x4b3381;_0x4c54cf=0xc8;}else{_0x4c54cf=0xce;}_0x3b15ed[_0x6f66('0x16')](_0x4c54cf);return _0x3b15ed['set'](_0x6f66('0x1c'),_0x12b21f+'-'+_0x1a9fa0+'/'+_0x4b3381)[_0x6f66('0x17')](_0xdfd5c8);}return null;};}function patchUpdates(_0x4bbabf){return function(_0x6bc65f){try{jsonpatch[_0x6f66('0x1d')](_0x6bc65f,_0x4bbabf,!![]);}catch(_0x490edc){return BPromise[_0x6f66('0x1e')](_0x490edc);}return _0x6bc65f['save']();};}function saveUpdates(_0x45ccce,_0x53a790){return function(_0x5238bb){if(_0x5238bb){return _0x5238bb[_0x6f66('0x1f')](_0x45ccce)[_0x6f66('0x20')](function(_0x40123c){return _0x40123c;});}return null;};}function removeEntity(_0x403606,_0x4becde){return function(_0x4e8cda){if(_0x4e8cda){return _0x4e8cda[_0x6f66('0x21')]()[_0x6f66('0x20')](function(){_0x403606[_0x6f66('0x16')](0xcc)[_0x6f66('0x22')]();});}};}function handleEntityNotFound(_0x1353d4,_0x2028ac){return function(_0x261efa){if(!_0x261efa){_0x1353d4[_0x6f66('0x23')](0x194);}return _0x261efa;};}function handleError(_0x1166ab,_0x52e804){_0x52e804=_0x52e804||0x1f4;return function(_0x4c9f62){logger[_0x6f66('0x24')](_0x4c9f62[_0x6f66('0x25')]);if(_0x4c9f62['name']){delete _0x4c9f62[_0x6f66('0x26')];}_0x1166ab[_0x6f66('0x16')](_0x52e804)[_0x6f66('0x27')](_0x4c9f62);};}exports[_0x6f66('0x28')]=function(_0x15a3de,_0x218576){var _0x382af0={},_0x512864={},_0x32ce2d={'count':0x0,'rows':[]};var _0x4c70a3=_[_0x6f66('0x29')](db[_0x6f66('0x2a')]['rawAttributes'],function(_0x292c80){return{'name':_0x292c80[_0x6f66('0x2b')],'type':_0x292c80[_0x6f66('0x2c')][_0x6f66('0x2d')]};});_0x512864[_0x6f66('0x2e')]=_[_0x6f66('0x29')](_0x4c70a3,_0x6f66('0x26'));_0x512864[_0x6f66('0x2f')]=_[_0x6f66('0x30')](_0x15a3de[_0x6f66('0x2f')]);_0x512864[_0x6f66('0x31')]=_[_0x6f66('0x32')](_0x512864[_0x6f66('0x2e')],_0x512864['query']);_0x382af0[_0x6f66('0x33')]=_[_0x6f66('0x32')](_0x512864[_0x6f66('0x2e')],qs[_0x6f66('0x34')](_0x15a3de['query'][_0x6f66('0x34')]));_0x382af0['attributes']=_0x382af0[_0x6f66('0x33')][_0x6f66('0x35')]?_0x382af0[_0x6f66('0x33')]:_0x512864['model'];if(!_0x15a3de['query']['hasOwnProperty'](_0x6f66('0x36'))){_0x382af0['limit']=qs[_0x6f66('0x1b')](_0x15a3de[_0x6f66('0x2f')][_0x6f66('0x1b')]);_0x382af0[_0x6f66('0x18')]=qs[_0x6f66('0x18')](_0x15a3de[_0x6f66('0x2f')][_0x6f66('0x18')]);}_0x382af0[_0x6f66('0x37')]=qs[_0x6f66('0x38')](_0x15a3de['query'][_0x6f66('0x38')]);_0x382af0[_0x6f66('0x39')]=qs[_0x6f66('0x31')](_[_0x6f66('0x3a')](_0x15a3de[_0x6f66('0x2f')],_0x512864[_0x6f66('0x31')]),_0x4c70a3);if(_0x15a3de[_0x6f66('0x2f')][_0x6f66('0x3b')]){_0x382af0['where']=_['merge'](_0x382af0[_0x6f66('0x39')],{'$or':_[_0x6f66('0x29')](_0x4c70a3,function(_0x50d114){if(_0x50d114[_0x6f66('0x2c')]!==_0x6f66('0x3c')){var _0x42b9d5={};_0x42b9d5[_0x50d114[_0x6f66('0x26')]]={'$like':'%'+_0x15a3de[_0x6f66('0x2f')]['filter']+'%'};return _0x42b9d5;}})});}_0x382af0=_['merge']({},_0x382af0,_0x15a3de['options']);var _0x30a817={'where':_0x382af0[_0x6f66('0x39')]};return db[_0x6f66('0x2a')]['count'](_0x30a817)[_0x6f66('0x20')](function(_0x2ad960){_0x32ce2d[_0x6f66('0x1a')]=_0x2ad960;if(_0x15a3de[_0x6f66('0x2f')]['includeAll']){_0x382af0[_0x6f66('0x3d')]=[{'all':!![]}];}return db[_0x6f66('0x2a')][_0x6f66('0x3e')](_0x382af0);})[_0x6f66('0x20')](function(_0x2df443){_0x32ce2d[_0x6f66('0x3f')]=_0x2df443;return _0x32ce2d;})['then'](respondWithFilteredResult(_0x218576,_0x382af0))[_0x6f66('0x40')](handleError(_0x218576,null));};exports['show']=function(_0xb64edf,_0xe22b33){var _0x35c31c={'raw':!![],'where':{'id':_0xb64edf[_0x6f66('0x41')]['id']}},_0x50b317={};_0x50b317[_0x6f66('0x2e')]=_[_0x6f66('0x30')](db['VoiceTransferReport'][_0x6f66('0x42')]);_0x50b317['query']=_['keys'](_0xb64edf[_0x6f66('0x2f')]);_0x50b317['filters']=_[_0x6f66('0x32')](_0x50b317[_0x6f66('0x2e')],_0x50b317[_0x6f66('0x2f')]);_0x35c31c[_0x6f66('0x33')]=_[_0x6f66('0x32')](_0x50b317[_0x6f66('0x2e')],qs[_0x6f66('0x34')](_0xb64edf['query'][_0x6f66('0x34')]));_0x35c31c[_0x6f66('0x33')]=_0x35c31c[_0x6f66('0x33')][_0x6f66('0x35')]?_0x35c31c[_0x6f66('0x33')]:_0x50b317[_0x6f66('0x2e')];if(_0xb64edf[_0x6f66('0x2f')][_0x6f66('0x43')]){_0x35c31c[_0x6f66('0x3d')]=[{'all':!![]}];}_0x35c31c=_[_0x6f66('0x44')]({},_0x35c31c,_0xb64edf[_0x6f66('0x45')]);return db[_0x6f66('0x2a')][_0x6f66('0x46')](_0x35c31c)[_0x6f66('0x20')](handleEntityNotFound(_0xe22b33,null))[_0x6f66('0x20')](respondWithResult(_0xe22b33,null))[_0x6f66('0x40')](handleError(_0xe22b33,null));};exports[_0x6f66('0x47')]=function(_0x22c122,_0x4db92c){return db[_0x6f66('0x2a')][_0x6f66('0x47')](_0x22c122['body'],{})['then'](respondWithResult(_0x4db92c,0xc9))[_0x6f66('0x40')](handleError(_0x4db92c,null));};exports[_0x6f66('0x1f')]=function(_0x35eba7,_0x525106){if(_0x35eba7[_0x6f66('0x48')]['id']){delete _0x35eba7[_0x6f66('0x48')]['id'];}return db[_0x6f66('0x2a')][_0x6f66('0x46')]({'where':{'id':_0x35eba7[_0x6f66('0x41')]['id']}})[_0x6f66('0x20')](handleEntityNotFound(_0x525106,null))['then'](saveUpdates(_0x35eba7[_0x6f66('0x48')],null))[_0x6f66('0x20')](respondWithResult(_0x525106,null))[_0x6f66('0x40')](handleError(_0x525106,null));};exports[_0x6f66('0x21')]=function(_0x2b8e5d,_0x47cb2c){return db[_0x6f66('0x2a')][_0x6f66('0x46')]({'where':{'id':_0x2b8e5d['params']['id']}})['then'](handleEntityNotFound(_0x47cb2c,null))[_0x6f66('0x20')](removeEntity(_0x47cb2c,null))[_0x6f66('0x40')](handleError(_0x47cb2c,null));};exports[_0x6f66('0x49')]=function(_0x1359fc,_0x4eb1f7){return db[_0x6f66('0x2a')][_0x6f66('0x49')]()[_0x6f66('0x20')](respondWithResult(_0x4eb1f7,null))[_0x6f66('0x40')](handleError(_0x4eb1f7,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 207f44a..0094132 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 _0x5d76=['lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5d76,0x129));var _0x65d7=function(_0x329931,_0x4bf3be){_0x329931=_0x329931-0x0;var _0x46fe9a=_0x5d76[_0x329931];return _0x46fe9a;};'use strict';var _=require(_0x65d7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x65d7('0x1'));var BPromise=require(_0x65d7('0x2'));var rp=require(_0x65d7('0x3'));var fs=require('fs');var path=require(_0x65d7('0x4'));var rimraf=require(_0x65d7('0x5'));var config=require(_0x65d7('0x6'));var attributes=require(_0x65d7('0x7'));module[_0x65d7('0x8')]=function(_0x45ff66,_0x1d1108){return _0x45ff66['define'](_0x65d7('0x9'),attributes,{'tableName':_0x65d7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5bf0=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceTransferReport','report_call_transfer'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5bf0,0x120));var _0x05bf=function(_0x38a839,_0x127626){_0x38a839=_0x38a839-0x0;var _0x26ed37=_0x5bf0[_0x38a839];return _0x26ed37;};'use strict';var _=require(_0x05bf('0x0'));var util=require(_0x05bf('0x1'));var logger=require('../../config/logger')(_0x05bf('0x2'));var moment=require(_0x05bf('0x3'));var BPromise=require(_0x05bf('0x4'));var rp=require(_0x05bf('0x5'));var fs=require('fs');var path=require(_0x05bf('0x6'));var rimraf=require(_0x05bf('0x7'));var config=require(_0x05bf('0x8'));var attributes=require('./voiceTransferReport.attributes');module[_0x05bf('0x9')]=function(_0x1ce8f4,_0x54b51d){return _0x1ce8f4['define'](_0x05bf('0xa'),attributes,{'tableName':_0x05bf('0xb'),'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 6adafea..db2eccd 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 _0x4f04=['../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','stringify','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x4f04,0x9d));var _0x44f0=function(_0x1346a4,_0x183cf8){_0x1346a4=_0x1346a4-0x0;var _0x3dc8f7=_0x4f04[_0x1346a4];return _0x3dc8f7;};'use strict';var _=require(_0x44f0('0x0'));var util=require(_0x44f0('0x1'));var moment=require('moment');var BPromise=require(_0x44f0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x44f0('0x3'))['db'];var utils=require(_0x44f0('0x4'));var logger=require(_0x44f0('0x5'))('rpc');var config=require(_0x44f0('0x6'));var jayson=require(_0x44f0('0x7'));var client=jayson['client'][_0x44f0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c76ff,_0x1e52dd,_0x388573){return new BPromise(function(_0x1fc69b,_0x2a63ec){return client['request'](_0x3c76ff,_0x388573)[_0x44f0('0x9')](function(_0x25341d){logger[_0x44f0('0xa')](_0x44f0('0xb'),_0x1e52dd,_0x44f0('0xc'));logger[_0x44f0('0xd')](_0x44f0('0xe'),_0x1e52dd,_0x44f0('0xc'),JSON['stringify'](_0x25341d));if(_0x25341d['error']){if(_0x25341d[_0x44f0('0xf')][_0x44f0('0x10')]===0x1f4){logger['error'](_0x44f0('0xb'),_0x1e52dd,_0x25341d[_0x44f0('0xf')][_0x44f0('0x11')]);return _0x2a63ec(_0x25341d[_0x44f0('0xf')][_0x44f0('0x11')]);}logger['error'](_0x44f0('0xb'),_0x1e52dd,_0x25341d[_0x44f0('0xf')][_0x44f0('0x11')]);return _0x1fc69b(_0x25341d['error'][_0x44f0('0x11')]);}else{logger[_0x44f0('0xa')](_0x44f0('0xb'),_0x1e52dd,_0x44f0('0xc'));_0x1fc69b(_0x25341d[_0x44f0('0x12')]['message']);}})[_0x44f0('0x13')](function(_0x241a40){logger['error'](_0x44f0('0xb'),_0x1e52dd,_0x241a40);_0x2a63ec(_0x241a40);});});}exports[_0x44f0('0x14')]=function(_0x112ba1){var _0x11a9fc=this;return new Promise(function(_0x313032,_0x3f07c9){return db[_0x44f0('0x15')][_0x44f0('0x16')](_0x112ba1[_0x44f0('0x17')],{'raw':_0x112ba1[_0x44f0('0x18')]?_0x112ba1[_0x44f0('0x18')][_0x44f0('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x48ac59){logger[_0x44f0('0xa')](_0x44f0('0x14'),_0x112ba1);logger[_0x44f0('0xd')](_0x44f0('0x14'),_0x112ba1,JSON[_0x44f0('0x1a')](_0x48ac59));_0x313032(_0x48ac59);})['catch'](function(_0x404f7d){logger[_0x44f0('0xf')](_0x44f0('0x14'),_0x404f7d['message'],_0x112ba1);_0x3f07c9(_0x11a9fc[_0x44f0('0xf')](0x1f4,_0x404f7d[_0x44f0('0x11')]));});});}; \ No newline at end of file +var _0xe75f=['then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1d90b5,_0x4ea140){var _0x1982d6=function(_0xa3409c){while(--_0xa3409c){_0x1d90b5['push'](_0x1d90b5['shift']());}};_0x1982d6(++_0x4ea140);}(_0xe75f,0x10d));var _0xfe75=function(_0x1dffae,_0x6e2b5){_0x1dffae=_0x1dffae-0x0;var _0x468c1c=_0xe75f[_0x1dffae];return _0x468c1c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfe75('0x0'));var BPromise=require(_0xfe75('0x1'));var rs=require(_0xfe75('0x2'));var fs=require('fs');var Redis=require(_0xfe75('0x3'));var db=require(_0xfe75('0x4'))['db'];var utils=require(_0xfe75('0x5'));var logger=require(_0xfe75('0x6'))(_0xfe75('0x7'));var config=require(_0xfe75('0x8'));var jayson=require(_0xfe75('0x9'));var client=jayson[_0xfe75('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37d201,_0x2a8fd3,_0x209fc7){return new BPromise(function(_0x379ae7,_0x6b3618){return client['request'](_0x37d201,_0x209fc7)[_0xfe75('0xb')](function(_0x4f2468){logger[_0xfe75('0xc')](_0xfe75('0xd'),_0x2a8fd3,'request\x20sent');logger[_0xfe75('0xe')](_0xfe75('0xf'),_0x2a8fd3,_0xfe75('0x10'),JSON[_0xfe75('0x11')](_0x4f2468));if(_0x4f2468['error']){if(_0x4f2468[_0xfe75('0x12')][_0xfe75('0x13')]===0x1f4){logger[_0xfe75('0x12')](_0xfe75('0xd'),_0x2a8fd3,_0x4f2468[_0xfe75('0x12')][_0xfe75('0x14')]);return _0x6b3618(_0x4f2468[_0xfe75('0x12')][_0xfe75('0x14')]);}logger[_0xfe75('0x12')](_0xfe75('0xd'),_0x2a8fd3,_0x4f2468['error'][_0xfe75('0x14')]);return _0x379ae7(_0x4f2468[_0xfe75('0x12')][_0xfe75('0x14')]);}else{logger[_0xfe75('0xc')](_0xfe75('0xd'),_0x2a8fd3,'request\x20sent');_0x379ae7(_0x4f2468[_0xfe75('0x15')][_0xfe75('0x14')]);}})['catch'](function(_0x5d80a9){logger['error'](_0xfe75('0xd'),_0x2a8fd3,_0x5d80a9);_0x6b3618(_0x5d80a9);});});}exports[_0xfe75('0x16')]=function(_0x36bab1){var _0x3aa94f=this;return new Promise(function(_0x6e606a,_0x5afaf3){return db[_0xfe75('0x17')][_0xfe75('0x18')](_0x36bab1[_0xfe75('0x19')],{'raw':_0x36bab1[_0xfe75('0x1a')]?_0x36bab1['options']['raw']===undefined?!![]:![]:!![]})[_0xfe75('0xb')](function(_0x501e7f){logger['info'](_0xfe75('0x16'),_0x36bab1);logger[_0xfe75('0xe')](_0xfe75('0x16'),_0x36bab1,JSON[_0xfe75('0x11')](_0x501e7f));_0x6e606a(_0x501e7f);})[_0xfe75('0x1b')](function(_0x23ce98){logger[_0xfe75('0x12')]('CreateVoiceTransferReport',_0x23ce98['message'],_0x36bab1);_0x5afaf3(_0x3aa94f[_0xfe75('0x12')](0x1f4,_0x23ce98[_0xfe75('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 4b1f4eb..e741d31 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['answer','hold','/unhold','unhold','calls','/transfer','exports','express','Router','../../components/auth/service','post','isAuthenticated','isWebrtcLicence','/hangup','/answer'];(function(_0x3523cb,_0x511b5c){var _0x54efd9=function(_0x48ee79){while(--_0x48ee79){_0x3523cb['push'](_0x3523cb['shift']());}};_0x54efd9(++_0x511b5c);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x00bb[_0x4cf98e];return _0x1623ac;};'use strict';var express=require(_0xb00b('0x0'));var router=express[_0xb00b('0x1')]();var auth=require(_0xb00b('0x2'));var controller=require('./webbar.controller');router[_0xb00b('0x3')]('/originate',auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['originate']);router[_0xb00b('0x3')](_0xb00b('0x6'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller['hangup']);router[_0xb00b('0x3')](_0xb00b('0x7'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x8')]);router[_0xb00b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x9')]);router[_0xb00b('0x3')](_0xb00b('0xa'),auth[_0xb00b('0x4')](),auth['isWebrtcLicence'](),controller[_0xb00b('0xb')]);router['post']('/calls',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0xc')]);router[_0xb00b('0x3')](_0xb00b('0xd'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['transfer']);module[_0xb00b('0xe')]=router; \ No newline at end of file +var _0x153f=['hold','/unhold','unhold','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','originate','/hangup','isWebrtcLicence','hangup','answer','/hold'];(function(_0x365845,_0x2db85c){var _0x4fc4ff=function(_0x4d9b3a){while(--_0x4d9b3a){_0x365845['push'](_0x365845['shift']());}};_0x4fc4ff(++_0x2db85c);}(_0x153f,0x15b));var _0xf153=function(_0x5ea236,_0x1bab3e){_0x5ea236=_0x5ea236-0x0;var _0x3f9f03=_0x153f[_0x5ea236];return _0x3f9f03;};'use strict';var express=require(_0xf153('0x0'));var router=express[_0xf153('0x1')]();var auth=require(_0xf153('0x2'));var controller=require(_0xf153('0x3'));router[_0xf153('0x4')](_0xf153('0x5'),auth[_0xf153('0x6')](),auth['isWebrtcLicence'](),controller[_0xf153('0x7')]);router['post'](_0xf153('0x8'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xa')]);router[_0xf153('0x4')]('/answer',auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xb')]);router[_0xf153('0x4')](_0xf153('0xc'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xd')]);router[_0xf153('0x4')](_0xf153('0xe'),auth['isAuthenticated'](),auth[_0xf153('0x9')](),controller[_0xf153('0xf')]);router[_0xf153('0x4')]('/calls',auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0x10')]);router[_0xf153('0x4')](_0xf153('0x11'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0x12')]);module[_0xf153('0x13')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index a133b74..aeb5ba5 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 _0x131e=['error','stack','name','status','send','NotFound','request','then','code','message','User','findOne','VoiceChannels','all','rows','UserId','length','\x20not\x20found!','originate','originate\x20fired:','body','validate','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','catch','user:%s','hangup\x20executed!','answer','answer\x20fired:','sessionId','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','filter','conference','conference\x20fired:','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','../../config/environment','util','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','number','userId\x20is\x20required','callNumber\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','log','handleError:'];(function(_0x111b24,_0x902573){var _0x38aeb5=function(_0x56e88b){while(--_0x56e88b){_0x111b24['push'](_0x111b24['shift']());}};_0x38aeb5(++_0x902573);}(_0x131e,0x1ec));var _0xe131=function(_0xcc0470,_0x5589d4){_0xcc0470=_0xcc0470-0x0;var _0x5166f0=_0x131e[_0xcc0470];return _0x5166f0;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0xe131('0x0'));var util=require(_0xe131('0x1'));var BPromise=require(_0xe131('0x2'));var jayson=require(_0xe131('0x3'));var amiClient=jayson[_0xe131('0x4')][_0xe131('0x5')]({'port':0x232a});var logger=require('../../config/logger')(_0xe131('0x6'));var Redis=require(_0xe131('0x7'));config[_0xe131('0x8')]=_[_0xe131('0x9')](config[_0xe131('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xe131('0xa'),'required':[!![],_0xe131('0xb')]},'callNumber':{'type':'string','required':[!![],_0xe131('0xc')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xe131('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xe131('0xa'),'required':[!![],_0xe131('0xb')]},'sessionId':{'type':_0xe131('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xe131('0xa'),'required':[!![],_0xe131('0xb')]},'sessionId':{'type':_0xe131('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xe131('0xd'),'required':[!![],_0xe131('0xe')]}});var holdValidation=new Schema({'userId':{'type':_0xe131('0xa'),'required':[!![],_0xe131('0xb')]},'sessionId':{'type':_0xe131('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe131('0xa'),'required':[!![],_0xe131('0xb')]},'sessionId':{'type':_0xe131('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xe131('0xa'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});function emit(_0x5a6ca9,_0x4987dc,_0x2628e7){logger[_0xe131('0xf')](_0x5a6ca9,_0x4987dc,JSON[_0xe131('0x10')](_0x2628e7));io['to'](_0x5a6ca9)['emit'](_0x4987dc,_0x2628e7);}function handleError(_0x503e86){return function(_0x400f6b){console[_0xe131('0x11')](_0xe131('0x12'),_0x400f6b,_0x400f6b instanceof RangeError);logger[_0xe131('0x13')](_0x400f6b[_0xe131('0x14')]);if(_0x400f6b instanceof RangeError){if(_0x400f6b[_0xe131('0x15')]){delete _0x400f6b['name'];}_0x503e86[_0xe131('0x16')](0x194)[_0xe131('0x17')](_0x400f6b);}else{if(_0x400f6b[_0xe131('0x15')]){delete _0x400f6b[_0xe131('0x15')];}_0x503e86[_0xe131('0x16')](0x1f4)['send'](_0x400f6b);}};}function checkError(){return function(_0x4c24e5){if(!_0x4c24e5){throw new RangeError(_0xe131('0x18'));}return _0x4c24e5;};}function respondWithRpcPromise(_0x41c4e1,_0x5207c6){return new BPromise(function(_0x42df0a,_0x55b0c5){var _0x49f304=amiClient;return _0x49f304[_0xe131('0x19')](_0x41c4e1,_0x5207c6)[_0xe131('0x1a')](function(_0x473bb4){if(_0x473bb4[_0xe131('0x13')]){if(_0x473bb4[_0xe131('0x13')][_0xe131('0x1b')]===0x1f4){return _0x55b0c5(_0x473bb4[_0xe131('0x13')]['message']);}return _0x42df0a(_0x473bb4[_0xe131('0x13')][_0xe131('0x1c')]);}else{_0x42df0a(_0x473bb4['result']);}})['catch'](function(_0x330638){_0x55b0c5(_0x330638);});});}function getAgent(_0x5b2f47){return db[_0xe131('0x1d')][_0xe131('0x1e')]({'where':{'id':_0x5b2f47,'role':'agent'}})[_0xe131('0x1a')](checkError());}function getAgentCheckSession(_0x3959ac,_0x41a3e9){return new BPromise(function(_0x499ca8,_0x29243d){var _0x442279=respondWithRpcPromise(_0xe131('0x1f'));var _0x10d504=getAgent(_0x3959ac);Promise[_0xe131('0x20')]([_0x442279,_0x10d504])[_0xe131('0x1a')](function(_0x1ff557){var _0x3414f1=_0x1ff557[0x0];var _0x9f8c66=_0x1ff557[0x1];var _0x341294=_['filter'](_0x3414f1[_0xe131('0x21')],function(_0x554b62){return _0x554b62[_0xe131('0x22')]==_0x9f8c66['id']&&_0x554b62['sessionId']==_0x41a3e9;});if(_0x341294[_0xe131('0x23')]==0x1){_0x499ca8(_0x9f8c66);}else{_0x29243d(new RangeError('sessionId\x20'+_0x41a3e9+_0xe131('0x24')));}});});}exports[_0xe131('0x25')]=function(_0x306082,_0x481e50){logger['info'](_0xe131('0x26'),_0x306082[_0xe131('0x27')]);var _0x11f163=originateValidation[_0xe131('0x28')](_0x306082[_0xe131('0x27')]);if(_0x11f163[_0xe131('0x23')]>0x0){return _0x481e50[_0xe131('0x16')](0x190)[_0xe131('0x29')](_0x11f163);}var _0x5347ee=_0x306082['body'][_0xe131('0x2a')];var _0x6c7586=_0x306082[_0xe131('0x27')][_0xe131('0x2b')];var _0x2c17f6=_0x306082[_0xe131('0x27')][_0xe131('0x2c')];var _0x4d2327=_0x306082['body'][_0xe131('0x2d')];return getAgent(_0x5347ee)['then'](function(_0x26bf39){logger['info'](_0xe131('0x2e'),_0x26bf39['name']);emit(util[_0xe131('0x2f')]('user:%s',_0x26bf39[_0xe131('0x15')]),_0xe131('0x30'),{'callNumber':_0x6c7586,'callerId':_0x2c17f6,'callbackUrl':_0x4d2327});return _0x481e50[_0xe131('0x16')](0xc8)[_0xe131('0x29')]({'error':![],'message':_0xe131('0x31')});})[_0xe131('0x32')](handleError(_0x481e50));};exports['hangup']=function(_0x2ecc0c,_0x4dafaf){logger[_0xe131('0xf')]('hangup\x20fired:',_0x2ecc0c[_0xe131('0x27')]);var _0x26a679=hangupValidation[_0xe131('0x28')](_0x2ecc0c[_0xe131('0x27')]);if(_0x26a679[_0xe131('0x23')]>0x0){return _0x4dafaf[_0xe131('0x16')](0x190)[_0xe131('0x29')](_0x26a679);}var _0x5a5498=_0x2ecc0c[_0xe131('0x27')]['userId'];var _0x1103fc=_0x2ecc0c[_0xe131('0x27')]['sessionId'];return getAgent(_0x5a5498)['then'](function(_0x205fa2){logger['info']('entityFound:',_0x205fa2[_0xe131('0x15')]);emit(util['format'](_0xe131('0x33'),_0x205fa2[_0xe131('0x15')]),'webbar:hangup',{'sessionId':_0x1103fc});return _0x4dafaf[_0xe131('0x16')](0xc8)[_0xe131('0x29')]({'error':![],'message':_0xe131('0x34')});})[_0xe131('0x32')](handleError(_0x4dafaf));};exports[_0xe131('0x35')]=function(_0x4985d9,_0x512409){logger[_0xe131('0xf')](_0xe131('0x36'),_0x4985d9[_0xe131('0x27')]);var _0x58fe5c=answerValidation[_0xe131('0x28')](_0x4985d9[_0xe131('0x27')]);if(_0x58fe5c[_0xe131('0x23')]>0x0){return _0x512409['status'](0x190)[_0xe131('0x29')](_0x58fe5c);}var _0x1c9c6d=_0x4985d9[_0xe131('0x27')]['userId'];var _0x1da932=_0x4985d9[_0xe131('0x27')][_0xe131('0x37')];return getAgent(_0x1c9c6d)['then'](function(_0x1663a9){logger[_0xe131('0xf')](_0xe131('0x2e'),_0x1663a9[_0xe131('0x15')]);emit(util[_0xe131('0x2f')](_0xe131('0x33'),_0x1663a9[_0xe131('0x15')]),'webbar:answer',{'sessionId':_0x1da932});return _0x512409['status'](0xc8)[_0xe131('0x29')]({'error':![],'message':_0xe131('0x38')});})[_0xe131('0x32')](handleError(_0x512409));};exports[_0xe131('0x39')]=function(_0xb1c607,_0x402767){logger['info'](_0xe131('0x3a'),_0xb1c607[_0xe131('0x27')]);var _0x268cc6=holdValidation[_0xe131('0x28')](_0xb1c607[_0xe131('0x27')]);if(_0x268cc6[_0xe131('0x23')]>0x0){return _0x402767['status'](0x190)[_0xe131('0x29')](_0x268cc6);}var _0x1ce9b7=_0xb1c607[_0xe131('0x27')][_0xe131('0x2a')];var _0x1a9e5c=_0xb1c607[_0xe131('0x27')][_0xe131('0x37')];return getAgent(_0x1ce9b7)[_0xe131('0x1a')](function(_0x3d7ae8){logger[_0xe131('0xf')](_0xe131('0x2e'),_0x3d7ae8['name']);emit(util[_0xe131('0x2f')]('user:%s',_0x3d7ae8['name']),_0xe131('0x3b'),{'sessionId':_0x1a9e5c});return _0x402767[_0xe131('0x16')](0xc8)[_0xe131('0x29')]({'error':![],'message':_0xe131('0x3c')});})[_0xe131('0x32')](handleError(_0x402767));};exports[_0xe131('0x3d')]=function(_0xf4dbe4,_0x398c39){logger[_0xe131('0xf')](_0xe131('0x3e'),_0xf4dbe4[_0xe131('0x27')]);var _0x509992=unholdValidation['validate'](_0xf4dbe4[_0xe131('0x27')]);if(_0x509992[_0xe131('0x23')]>0x0){return _0x398c39['status'](0x190)['json'](_0x509992);}var _0x2b934b=_0xf4dbe4['body']['userId'];var _0xe0d786=_0xf4dbe4[_0xe131('0x27')][_0xe131('0x37')];return getAgent(_0x2b934b)[_0xe131('0x1a')](function(_0x3d6f45){logger[_0xe131('0xf')]('entityFound:',_0x3d6f45['name']);emit(util[_0xe131('0x2f')](_0xe131('0x33'),_0x3d6f45['name']),_0xe131('0x3f'),{'sessionId':_0xe0d786});return _0x398c39[_0xe131('0x16')](0xc8)[_0xe131('0x29')]({'error':![],'message':_0xe131('0x40')});})[_0xe131('0x32')](handleError(_0x398c39));};exports[_0xe131('0x41')]=function(_0x4a9ad6,_0x23d880){logger['info']('calls\x20fired:',_0x23d880[_0xe131('0x27')]);var _0x3ff68b=callsValidation['validate'](_0x4a9ad6['body']);if(_0x3ff68b[_0xe131('0x23')]>0x0){return _0x23d880[_0xe131('0x16')](0x190)[_0xe131('0x29')](_0x3ff68b);}var _0x51628f=_0x4a9ad6[_0xe131('0x27')][_0xe131('0x2a')];var _0x45d00d=respondWithRpcPromise(_0xe131('0x1f'));var _0x2a65fd=getAgent(_0x51628f);return Promise['all']([_0x45d00d,_0x2a65fd])[_0xe131('0x1a')](function(_0x5185dd){var _0x4347f0=_0x5185dd[0x0];var _0x45ac9c=_0x5185dd[0x1];var _0xc398e5=_[_0xe131('0x42')](_0x4347f0['rows'],function(_0x498fe0){return _0x498fe0['UserId']==_0x45ac9c['id'];});return _0x23d880[_0xe131('0x16')](0xc8)['json']({'count':_0xc398e5[_0xe131('0x23')],'rows':_0xc398e5});})[_0xe131('0x32')](handleError(_0x23d880));};exports[_0xe131('0x43')]=function(_0x160f60,_0x61ea25){logger[_0xe131('0xf')](_0xe131('0x44'),_0x160f60[_0xe131('0x27')]);var _0x1e388e=conferenceValidation[_0xe131('0x28')](_0x160f60['body']);if(_0x1e388e['length']>0x0){return _0x61ea25['status'](0x190)[_0xe131('0x29')](_0x1e388e);}var _0x41932a=_0x160f60[_0xe131('0x27')][_0xe131('0x2a')];return getAgent(_0x41932a)['then'](function(_0x11e2c9){logger[_0xe131('0xf')](_0xe131('0x2e'),_0x11e2c9[_0xe131('0x15')]);emit(util[_0xe131('0x2f')](_0xe131('0x33'),_0x11e2c9['name']),'webbar:conference');return _0x61ea25[_0xe131('0x16')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x61ea25));};exports[_0xe131('0x45')]=function(_0x4edb0f,_0x2e6f99){logger['info'](_0xe131('0x46'),_0x4edb0f[_0xe131('0x27')]);var _0x2b6cdc=transferValidation[_0xe131('0x28')](_0x4edb0f['body']);if(_0x2b6cdc[_0xe131('0x23')]>0x0){return _0x2e6f99[_0xe131('0x16')](0x190)[_0xe131('0x29')](_0x2b6cdc);}var _0x3c1fe4=_0x4edb0f[_0xe131('0x27')][_0xe131('0x2a')];var _0x497b76=_0x4edb0f[_0xe131('0x27')][_0xe131('0x37')];var _0x4f3b0d=_0x4edb0f[_0xe131('0x27')]['transferNumber'];return getAgent(_0x3c1fe4)['then'](function(_0x6794a){logger['info'](_0xe131('0x2e'),_0x6794a[_0xe131('0x15')]);emit(util[_0xe131('0x2f')]('user:%s',_0x6794a[_0xe131('0x15')]),_0xe131('0x47'),{'sessionId':_0x497b76,'transferNumber':_0x4f3b0d});return _0x2e6f99[_0xe131('0x16')](0xc8)[_0xe131('0x29')]({'error':![],'message':_0xe131('0x48')});})[_0xe131('0x32')](handleError(_0x2e6f99));}; \ No newline at end of file +var _0xad8a=['answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','user:%s','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','all','conference','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','error','name','status','send','request','then','code','message','result','catch','User','agent','VoiceChannels','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','length','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','hangup\x20executed!','answer'];(function(_0x35083a,_0x50630c){var _0x1c705b=function(_0x1996f8){while(--_0x1996f8){_0x35083a['push'](_0x35083a['shift']());}};_0x1c705b(++_0x50630c);}(_0xad8a,0xb0));var _0xaad8=function(_0x2a22c8,_0xf6054c){_0x2a22c8=_0x2a22c8-0x0;var _0x4d6a77=_0xad8a[_0x2a22c8];return _0x4d6a77;};'use strict';var path=require(_0xaad8('0x0'));var fs=require('fs');var _=require(_0xaad8('0x1'));var db=require(_0xaad8('0x2'))['db'];var config=require(_0xaad8('0x3'));var util=require(_0xaad8('0x4'));var BPromise=require('bluebird');var jayson=require(_0xaad8('0x5'));var amiClient=jayson[_0xaad8('0x6')][_0xaad8('0x7')]({'port':0x232a});var logger=require('../../config/logger')(_0xaad8('0x8'));var Redis=require(_0xaad8('0x9'));config[_0xaad8('0xa')]=_[_0xaad8('0xb')](config[_0xaad8('0xa')],{'host':_0xaad8('0xc'),'port':0x18eb});var io=require(_0xaad8('0xd'))(new Redis(config[_0xaad8('0xa')]));var Schema=require(_0xaad8('0xe'));var originateValidation=new Schema({'userId':{'type':_0xaad8('0xf'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0xaad8('0x10')]},'callerId':{'type':_0xaad8('0x11')},'callbackUrl':{'type':_0xaad8('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0xaad8('0xf'),'required':[!![],_0xaad8('0x12')]},'sessionId':{'type':_0xaad8('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xaad8('0xf'),'required':[!![],_0xaad8('0x12')]},'sessionId':{'type':_0xaad8('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xaad8('0x12')]},'sessionId':{'type':_0xaad8('0x11'),'required':[!![],_0xaad8('0x13')]},'transferNumber':{'type':_0xaad8('0x11'),'required':[!![],_0xaad8('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0xaad8('0xf'),'required':[!![],_0xaad8('0x12')]},'sessionId':{'type':_0xaad8('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xaad8('0xf'),'required':[!![],_0xaad8('0x12')]},'sessionId':{'type':_0xaad8('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xaad8('0xf'),'required':[!![],_0xaad8('0x12')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xaad8('0x12')]}});function emit(_0xb63cb3,_0x511344,_0x1749d5){logger[_0xaad8('0x15')](_0xb63cb3,_0x511344,JSON[_0xaad8('0x16')](_0x1749d5));io['to'](_0xb63cb3)[_0xaad8('0x17')](_0x511344,_0x1749d5);}function handleError(_0x19ae08){return function(_0x3895e2){console['log'](_0xaad8('0x18'),_0x3895e2,_0x3895e2 instanceof RangeError);logger[_0xaad8('0x19')](_0x3895e2['stack']);if(_0x3895e2 instanceof RangeError){if(_0x3895e2[_0xaad8('0x1a')]){delete _0x3895e2['name'];}_0x19ae08[_0xaad8('0x1b')](0x194)[_0xaad8('0x1c')](_0x3895e2);}else{if(_0x3895e2[_0xaad8('0x1a')]){delete _0x3895e2[_0xaad8('0x1a')];}_0x19ae08['status'](0x1f4)[_0xaad8('0x1c')](_0x3895e2);}};}function checkError(){return function(_0x2c8fd8){if(!_0x2c8fd8){throw new RangeError('NotFound');}return _0x2c8fd8;};}function respondWithRpcPromise(_0x8bc75,_0x61542a){return new BPromise(function(_0x262e57,_0x5b4b61){var _0x5ba0fb=amiClient;return _0x5ba0fb[_0xaad8('0x1d')](_0x8bc75,_0x61542a)[_0xaad8('0x1e')](function(_0x3930f0){if(_0x3930f0[_0xaad8('0x19')]){if(_0x3930f0[_0xaad8('0x19')][_0xaad8('0x1f')]===0x1f4){return _0x5b4b61(_0x3930f0[_0xaad8('0x19')][_0xaad8('0x20')]);}return _0x262e57(_0x3930f0[_0xaad8('0x19')][_0xaad8('0x20')]);}else{_0x262e57(_0x3930f0[_0xaad8('0x21')]);}})[_0xaad8('0x22')](function(_0x4193cb){_0x5b4b61(_0x4193cb);});});}function getAgent(_0x37c3f6){return db[_0xaad8('0x23')]['findOne']({'where':{'id':_0x37c3f6,'role':_0xaad8('0x24')}})[_0xaad8('0x1e')](checkError());}function getAgentCheckSession(_0x3f066f,_0x47b7a2){return new BPromise(function(_0x237c67,_0x37ca5c){var _0x36b180=respondWithRpcPromise(_0xaad8('0x25'));var _0x24c01d=getAgent(_0x3f066f);Promise['all']([_0x36b180,_0x24c01d])[_0xaad8('0x1e')](function(_0x43c489){var _0x1e253f=_0x43c489[0x0];var _0x31ad19=_0x43c489[0x1];var _0x151c26=_['filter'](_0x1e253f[_0xaad8('0x26')],function(_0x4030ea){return _0x4030ea[_0xaad8('0x27')]==_0x31ad19['id']&&_0x4030ea[_0xaad8('0x28')]==_0x47b7a2;});if(_0x151c26['length']==0x1){_0x237c67(_0x31ad19);}else{_0x37ca5c(new RangeError(_0xaad8('0x29')+_0x47b7a2+_0xaad8('0x2a')));}});});}exports[_0xaad8('0x2b')]=function(_0x1eaf8e,_0x254ee5){logger['info'](_0xaad8('0x2c'),_0x1eaf8e[_0xaad8('0x2d')]);var _0x4845a4=originateValidation['validate'](_0x1eaf8e[_0xaad8('0x2d')]);if(_0x4845a4[_0xaad8('0x2e')]>0x0){return _0x254ee5[_0xaad8('0x1b')](0x190)[_0xaad8('0x2f')](_0x4845a4);}var _0x501ce8=_0x1eaf8e[_0xaad8('0x2d')][_0xaad8('0x30')];var _0x4b6c1a=_0x1eaf8e['body'][_0xaad8('0x31')];var _0x3689cb=_0x1eaf8e['body'][_0xaad8('0x32')];var _0x4fb0ae=_0x1eaf8e['body'][_0xaad8('0x33')];return getAgent(_0x501ce8)[_0xaad8('0x1e')](function(_0x54ab34){logger[_0xaad8('0x15')](_0xaad8('0x34'),_0x54ab34[_0xaad8('0x1a')]);emit(util[_0xaad8('0x35')]('user:%s',_0x54ab34[_0xaad8('0x1a')]),_0xaad8('0x36'),{'callNumber':_0x4b6c1a,'callerId':_0x3689cb,'callbackUrl':_0x4fb0ae});return _0x254ee5[_0xaad8('0x1b')](0xc8)[_0xaad8('0x2f')]({'error':![],'message':_0xaad8('0x37')});})[_0xaad8('0x22')](handleError(_0x254ee5));};exports['hangup']=function(_0x2aea32,_0x3d0244){logger[_0xaad8('0x15')]('hangup\x20fired:',_0x2aea32[_0xaad8('0x2d')]);var _0x39374b=hangupValidation[_0xaad8('0xe')](_0x2aea32[_0xaad8('0x2d')]);if(_0x39374b[_0xaad8('0x2e')]>0x0){return _0x3d0244[_0xaad8('0x1b')](0x190)[_0xaad8('0x2f')](_0x39374b);}var _0x4d3a4f=_0x2aea32[_0xaad8('0x2d')][_0xaad8('0x30')];var _0x3e9af2=_0x2aea32[_0xaad8('0x2d')][_0xaad8('0x28')];return getAgent(_0x4d3a4f)[_0xaad8('0x1e')](function(_0x4e4081){logger[_0xaad8('0x15')](_0xaad8('0x34'),_0x4e4081[_0xaad8('0x1a')]);emit(util[_0xaad8('0x35')]('user:%s',_0x4e4081['name']),'webbar:hangup',{'sessionId':_0x3e9af2});return _0x3d0244[_0xaad8('0x1b')](0xc8)[_0xaad8('0x2f')]({'error':![],'message':_0xaad8('0x38')});})['catch'](handleError(_0x3d0244));};exports[_0xaad8('0x39')]=function(_0x355fc2,_0x4af930){logger[_0xaad8('0x15')](_0xaad8('0x3a'),_0x355fc2[_0xaad8('0x2d')]);var _0x292d4e=answerValidation[_0xaad8('0xe')](_0x355fc2[_0xaad8('0x2d')]);if(_0x292d4e[_0xaad8('0x2e')]>0x0){return _0x4af930[_0xaad8('0x1b')](0x190)[_0xaad8('0x2f')](_0x292d4e);}var _0xbd5191=_0x355fc2[_0xaad8('0x2d')][_0xaad8('0x30')];var _0x4b5b76=_0x355fc2['body']['sessionId'];return getAgent(_0xbd5191)[_0xaad8('0x1e')](function(_0x5b0ad2){logger[_0xaad8('0x15')]('entityFound:',_0x5b0ad2['name']);emit(util[_0xaad8('0x35')]('user:%s',_0x5b0ad2[_0xaad8('0x1a')]),_0xaad8('0x3b'),{'sessionId':_0x4b5b76});return _0x4af930[_0xaad8('0x1b')](0xc8)[_0xaad8('0x2f')]({'error':![],'message':_0xaad8('0x3c')});})[_0xaad8('0x22')](handleError(_0x4af930));};exports[_0xaad8('0x3d')]=function(_0x1f920b,_0x233fd2){logger[_0xaad8('0x15')](_0xaad8('0x3e'),_0x1f920b[_0xaad8('0x2d')]);var _0x14a837=holdValidation[_0xaad8('0xe')](_0x1f920b[_0xaad8('0x2d')]);if(_0x14a837['length']>0x0){return _0x233fd2['status'](0x190)[_0xaad8('0x2f')](_0x14a837);}var _0x42cfa4=_0x1f920b[_0xaad8('0x2d')]['userId'];var _0x5e2117=_0x1f920b[_0xaad8('0x2d')]['sessionId'];return getAgent(_0x42cfa4)[_0xaad8('0x1e')](function(_0x1560ef){logger[_0xaad8('0x15')](_0xaad8('0x34'),_0x1560ef[_0xaad8('0x1a')]);emit(util[_0xaad8('0x35')](_0xaad8('0x3f'),_0x1560ef[_0xaad8('0x1a')]),_0xaad8('0x40'),{'sessionId':_0x5e2117});return _0x233fd2['status'](0xc8)[_0xaad8('0x2f')]({'error':![],'message':_0xaad8('0x41')});})['catch'](handleError(_0x233fd2));};exports[_0xaad8('0x42')]=function(_0x5e5ef1,_0x2a2542){logger[_0xaad8('0x15')](_0xaad8('0x43'),_0x5e5ef1[_0xaad8('0x2d')]);var _0x4068ec=unholdValidation[_0xaad8('0xe')](_0x5e5ef1[_0xaad8('0x2d')]);if(_0x4068ec[_0xaad8('0x2e')]>0x0){return _0x2a2542[_0xaad8('0x1b')](0x190)['json'](_0x4068ec);}var _0x2461f7=_0x5e5ef1[_0xaad8('0x2d')][_0xaad8('0x30')];var _0x13f11d=_0x5e5ef1[_0xaad8('0x2d')][_0xaad8('0x28')];return getAgent(_0x2461f7)['then'](function(_0x1e5127){logger[_0xaad8('0x15')]('entityFound:',_0x1e5127['name']);emit(util[_0xaad8('0x35')](_0xaad8('0x3f'),_0x1e5127[_0xaad8('0x1a')]),_0xaad8('0x44'),{'sessionId':_0x13f11d});return _0x2a2542[_0xaad8('0x1b')](0xc8)[_0xaad8('0x2f')]({'error':![],'message':'unhold\x20executed!'});})[_0xaad8('0x22')](handleError(_0x2a2542));};exports[_0xaad8('0x45')]=function(_0x3e6f4a,_0x1db8c2){logger[_0xaad8('0x15')]('calls\x20fired:',_0x1db8c2['body']);var _0x48edf6=callsValidation[_0xaad8('0xe')](_0x3e6f4a[_0xaad8('0x2d')]);if(_0x48edf6['length']>0x0){return _0x1db8c2[_0xaad8('0x1b')](0x190)[_0xaad8('0x2f')](_0x48edf6);}var _0x78a183=_0x3e6f4a['body'][_0xaad8('0x30')];var _0x49865e=respondWithRpcPromise(_0xaad8('0x25'));var _0x437266=getAgent(_0x78a183);return Promise[_0xaad8('0x46')]([_0x49865e,_0x437266])[_0xaad8('0x1e')](function(_0x5bd83e){var _0x9bb038=_0x5bd83e[0x0];var _0x1fe921=_0x5bd83e[0x1];var _0x5cf106=_['filter'](_0x9bb038[_0xaad8('0x26')],function(_0x4e64f5){return _0x4e64f5[_0xaad8('0x27')]==_0x1fe921['id'];});return _0x1db8c2[_0xaad8('0x1b')](0xc8)[_0xaad8('0x2f')]({'count':_0x5cf106[_0xaad8('0x2e')],'rows':_0x5cf106});})[_0xaad8('0x22')](handleError(_0x1db8c2));};exports[_0xaad8('0x47')]=function(_0x1d55fa,_0x2aaa54){logger[_0xaad8('0x15')]('conference\x20fired:',_0x1d55fa[_0xaad8('0x2d')]);var _0x34044d=conferenceValidation[_0xaad8('0xe')](_0x1d55fa[_0xaad8('0x2d')]);if(_0x34044d[_0xaad8('0x2e')]>0x0){return _0x2aaa54[_0xaad8('0x1b')](0x190)['json'](_0x34044d);}var _0x2abbe7=_0x1d55fa[_0xaad8('0x2d')][_0xaad8('0x30')];return getAgent(_0x2abbe7)['then'](function(_0x585380){logger[_0xaad8('0x15')](_0xaad8('0x34'),_0x585380[_0xaad8('0x1a')]);emit(util[_0xaad8('0x35')]('user:%s',_0x585380[_0xaad8('0x1a')]),_0xaad8('0x48'));return _0x2aaa54[_0xaad8('0x1b')](0xc8)[_0xaad8('0x2f')]({'error':![],'message':_0xaad8('0x49')});})['catch'](handleError(_0x2aaa54));};exports['transfer']=function(_0x2bcb8d,_0xb71d6f){logger[_0xaad8('0x15')](_0xaad8('0x4a'),_0x2bcb8d[_0xaad8('0x2d')]);var _0x739b8=transferValidation['validate'](_0x2bcb8d[_0xaad8('0x2d')]);if(_0x739b8[_0xaad8('0x2e')]>0x0){return _0xb71d6f[_0xaad8('0x1b')](0x190)[_0xaad8('0x2f')](_0x739b8);}var _0x30514f=_0x2bcb8d['body']['userId'];var _0x586a15=_0x2bcb8d[_0xaad8('0x2d')][_0xaad8('0x28')];var _0x500df3=_0x2bcb8d[_0xaad8('0x2d')][_0xaad8('0x4b')];return getAgent(_0x30514f)[_0xaad8('0x1e')](function(_0xe96206){logger[_0xaad8('0x15')]('entityFound:',_0xe96206[_0xaad8('0x1a')]);emit(util[_0xaad8('0x35')](_0xaad8('0x3f'),_0xe96206['name']),_0xaad8('0x4c'),{'sessionId':_0x586a15,'transferNumber':_0x500df3});return _0xb71d6f['status'](0xc8)[_0xaad8('0x2f')]({'error':![],'message':_0xaad8('0x4d')});})['catch'](handleError(_0xb71d6f));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 2bd5c33..0adb705 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 _0x8952=['getAgents','/:id/applications','create','/:id/dispositions','addDisposition','post','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','send','put','update','delete','destroy','removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','getAnswers'];(function(_0xb2dcdd,_0x4d3f6a){var _0x136e55=function(_0x5df351){while(--_0x5df351){_0xb2dcdd['push'](_0xb2dcdd['shift']());}};_0x136e55(++_0x4d3f6a);}(_0x8952,0x17e));var _0x2895=function(_0x4df99f,_0x36bfb0){_0x4df99f=_0x4df99f-0x0;var _0x1ad8e6=_0x8952[_0x4df99f];return _0x1ad8e6;};'use strict';var multer=require('multer');var util=require(_0x2895('0x0'));var path=require(_0x2895('0x1'));var timeout=require(_0x2895('0x2'));var express=require(_0x2895('0x3'));var router=express[_0x2895('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2895('0x5'));var interaction=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var controller=require('./whatsappAccount.controller');router[_0x2895('0x8')]('/',auth[_0x2895('0x9')](),controller[_0x2895('0xa')]);router['get']('/describe',auth[_0x2895('0x9')](),controller[_0x2895('0xb')]);router[_0x2895('0x8')](_0x2895('0xc'),auth[_0x2895('0x9')](),controller['show']);router[_0x2895('0x8')]('/:id/dispositions',auth[_0x2895('0x9')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x2895('0x9')](),controller[_0x2895('0xd')]);router[_0x2895('0x8')]('/:id/users',auth[_0x2895('0x9')](),controller[_0x2895('0xe')]);router['get'](_0x2895('0xf'),auth[_0x2895('0x9')](),controller['getApplications']);router['post']('/',auth[_0x2895('0x9')](),controller[_0x2895('0x10')]);router['post'](_0x2895('0x11'),auth[_0x2895('0x9')](),controller[_0x2895('0x12')]);router[_0x2895('0x13')](_0x2895('0x14'),auth[_0x2895('0x9')](),controller[_0x2895('0x15')]);router[_0x2895('0x13')](_0x2895('0x16'),auth[_0x2895('0x9')](),controller[_0x2895('0x17')]);router[_0x2895('0x13')](_0x2895('0xf'),auth[_0x2895('0x9')](),controller[_0x2895('0x18')]);router[_0x2895('0x13')](_0x2895('0x19'),controller[_0x2895('0x1a')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x2895('0x1b')]);router[_0x2895('0x1c')](_0x2895('0xc'),auth['isAuthenticated'](),controller[_0x2895('0x1d')]);router[_0x2895('0x1e')](_0x2895('0xc'),auth[_0x2895('0x9')](),controller[_0x2895('0x1f')]);router['delete'](_0x2895('0x11'),auth[_0x2895('0x9')](),controller['removeDispositions']);router[_0x2895('0x1e')](_0x2895('0x14'),auth[_0x2895('0x9')](),controller['removeAnswers']);router['delete'](_0x2895('0x16'),auth[_0x2895('0x9')](),controller[_0x2895('0x20')]);module['exports']=router; \ No newline at end of file +var _0x6343=['/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/notify','notify','/:id/send','put','update','destroy','delete','removeAnswers','removeAgents','exports','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers'];(function(_0xa10a3f,_0x24ad3c){var _0x2a5321=function(_0x5b91b2){while(--_0x5b91b2){_0xa10a3f['push'](_0xa10a3f['shift']());}};_0x2a5321(++_0x24ad3c);}(_0x6343,0x168));var _0x3634=function(_0x49c665,_0x514c67){_0x49c665=_0x49c665-0x0;var _0x53e23b=_0x6343[_0x49c665];return _0x53e23b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3634('0x0'));var timeout=require(_0x3634('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3634('0x2'));var config=require(_0x3634('0x3'));var controller=require('./whatsappAccount.controller');router[_0x3634('0x4')]('/',auth[_0x3634('0x5')](),controller['index']);router[_0x3634('0x4')](_0x3634('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0x3634('0x4')](_0x3634('0x7'),auth[_0x3634('0x5')](),controller[_0x3634('0x8')]);router[_0x3634('0x4')](_0x3634('0x9'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x3634('0x4')](_0x3634('0xa'),auth['isAuthenticated'](),controller[_0x3634('0xb')]);router[_0x3634('0x4')](_0x3634('0xc'),auth[_0x3634('0x5')](),controller[_0x3634('0xd')]);router[_0x3634('0x4')](_0x3634('0xe'),auth[_0x3634('0x5')](),controller[_0x3634('0xf')]);router[_0x3634('0x10')]('/',auth[_0x3634('0x5')](),controller[_0x3634('0x11')]);router[_0x3634('0x10')](_0x3634('0x9'),auth['isAuthenticated'](),controller[_0x3634('0x12')]);router['post'](_0x3634('0xa'),auth[_0x3634('0x5')](),controller[_0x3634('0x13')]);router[_0x3634('0x10')](_0x3634('0xc'),auth['isAuthenticated'](),controller[_0x3634('0x14')]);router['post']('/:id/applications',auth[_0x3634('0x5')](),controller['addApplications']);router[_0x3634('0x10')](_0x3634('0x15'),controller[_0x3634('0x16')]);router['post'](_0x3634('0x17'),auth[_0x3634('0x5')](),controller['send']);router[_0x3634('0x18')]('/:id',auth[_0x3634('0x5')](),controller[_0x3634('0x19')]);router['delete'](_0x3634('0x7'),auth[_0x3634('0x5')](),controller[_0x3634('0x1a')]);router['delete'](_0x3634('0x9'),auth[_0x3634('0x5')](),controller['removeDispositions']);router[_0x3634('0x1b')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3634('0x1c')]);router[_0x3634('0x1b')]('/:id/users',auth[_0x3634('0x5')](),controller[_0x3634('0x1d')]);module[_0x3634('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 5df609b..ec8c394 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 _0x1f0f=['STRING','name','generate','ENUM','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports'];(function(_0x57a209,_0x5b4bfa){var _0x585a02=function(_0x1032f7){while(--_0x1032f7){_0x57a209['push'](_0x57a209['shift']());}};_0x585a02(++_0x5b4bfa);}(_0x1f0f,0x124));var _0xf1f0=function(_0x4b923a,_0x4bb0e5){_0x4b923a=_0x4b923a-0x0;var _0x4235de=_0x1f0f[_0x4b923a];return _0x4235de;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xf1f0('0x0'));module[_0xf1f0('0x1')]={'name':{'type':Sequelize[_0xf1f0('0x2')],'unique':_0xf1f0('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xf1f0('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xf1f0('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf1f0('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf1f0('0x5')]('twilio',_0xf1f0('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0xf1f0('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf1f0('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf1f0('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xf1f0('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf1f0('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf1f0('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf1f0('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf1f0('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf1f0('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf1f0('0x9')],'comment':_0xf1f0('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xf1f0('0x8')],'defaultValue':![],'comment':_0xf1f0('0xb'),'set':function(_0x28881a){if(!_0x28881a){this['setDataValue'](_0xf1f0('0xc'),null);}this['setDataValue'](_0xf1f0('0xd'),_0x28881a);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa4b2=['randomstring','STRING','name','generate','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xa4b2,0x19f));var _0x2a4b=function(_0x569856,_0x467413){_0x569856=_0x569856-0x0;var _0x2d82ee=_0xa4b2[_0x569856];return _0x2d82ee;};'use strict';var Sequelize=require(_0x2a4b('0x0'));var rs=require(_0x2a4b('0x1'));module['exports']={'name':{'type':Sequelize[_0x2a4b('0x2')],'unique':_0x2a4b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x2a4b('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x2a4b('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x2a4b('0x2')],'defaultValue':function(){return rs[_0x2a4b('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x2a4b('0x5'),_0x2a4b('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x2a4b('0x2')]},'authToken':{'type':Sequelize[_0x2a4b('0x2')]},'notificationTemplate':{'type':Sequelize[_0x2a4b('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x2a4b('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x2a4b('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2a4b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2a4b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x2a4b('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x2a4b('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x371cff){if(!_0x371cff){this[_0x2a4b('0xb')]('mandatoryDispositionPauseId',null);}this[_0x2a4b('0xb')](_0x2a4b('0xc'),_0x371cff);}},'description':{'type':Sequelize[_0x2a4b('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index a128762..9690e70 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 _0xad69=['text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','List','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','WhatsappAccount,\x20%s,\x20%s','result','catch','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','destroy','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','map','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','type','VIRTUAL','options','WhatsappAccount','includeAll','include','findAll','params','mandatoryDispositionPause','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','sort','where','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','sendStatus','notify','whatsapp','Applications','account','sinch','statuses','state','read','timestamp','message_id','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','replace','whatsapp:','Body','messageId','MessageSid','from','notifications','isNil','Sequelize','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','list','Contacts','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','applications','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type'];(function(_0x1f1aa1,_0x4e9abd){var _0x3c3a29=function(_0xae7208){while(--_0xae7208){_0x1f1aa1['push'](_0x1f1aa1['shift']());}};_0x3c3a29(++_0x4e9abd);}(_0xad69,0x191));var _0x9ad6=function(_0x2881b9,_0x31fd14){_0x2881b9=_0x2881b9-0x0;var _0x388bff=_0xad69[_0x2881b9];return _0x388bff;};'use strict';var emlformat=require(_0x9ad6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9ad6('0x1'));var jsonpatch=require(_0x9ad6('0x2'));var rp=require('request-promise');var moment=require(_0x9ad6('0x3'));var BPromise=require(_0x9ad6('0x4'));var Mustache=require(_0x9ad6('0x5'));var util=require(_0x9ad6('0x6'));var path=require(_0x9ad6('0x7'));var sox=require(_0x9ad6('0x8'));var csv=require(_0x9ad6('0x9'));var ejs=require(_0x9ad6('0xa'));var fs=require('fs');var fs_extra=require(_0x9ad6('0xb'));var _=require(_0x9ad6('0xc'));var squel=require(_0x9ad6('0xd'));var crypto=require(_0x9ad6('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9ad6('0x9'));var querystring=require(_0x9ad6('0xf'));var Papa=require(_0x9ad6('0x10'));var Redis=require(_0x9ad6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9ad6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ad6('0x13'));var logger=require('../../config/logger')(_0x9ad6('0x14'));var utils=require(_0x9ad6('0x15'));var config=require(_0x9ad6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9ad6('0x17'))['db'];config['redis']=_[_0x9ad6('0x18')](config[_0x9ad6('0x19')],{'host':_0x9ad6('0x1a'),'port':0x18eb});var socket=require(_0x9ad6('0x1b'))(new Redis(config[_0x9ad6('0x19')]));require(_0x9ad6('0x1c'))[_0x9ad6('0x1d')](socket);var jayson=require(_0x9ad6('0x1e'));var client=jayson[_0x9ad6('0x1f')][_0x9ad6('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x3bffd4,_0x3271e9,_0xf443e,_0xc8ede0){return new BPromise(function(_0x1cb7eb,_0x2d9ca8){var _0xb6bf0e=_0xc8ede0||client;return _0xb6bf0e['request'](_0x3bffd4,_0xf443e)[_0x9ad6('0x21')](function(_0x340460){logger[_0x9ad6('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x3271e9,'request\x20sent');logger[_0x9ad6('0x23')](_0x9ad6('0x24'),_0x3271e9,_0x9ad6('0x25'),JSON['stringify'](_0x340460));if(_0x340460['error']){if(_0x340460[_0x9ad6('0x26')]['code']===0x1f4){logger[_0x9ad6('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x3271e9,_0x340460['error'][_0x9ad6('0x27')]);return _0x2d9ca8(_0x340460['error']['message']);}logger[_0x9ad6('0x26')](_0x9ad6('0x28'),_0x3271e9,_0x340460[_0x9ad6('0x26')][_0x9ad6('0x27')]);return _0x1cb7eb(_0x340460[_0x9ad6('0x26')]['message']);}else{logger[_0x9ad6('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x3271e9,_0x9ad6('0x25'));_0x1cb7eb(_0x340460[_0x9ad6('0x29')][_0x9ad6('0x27')]);}})[_0x9ad6('0x2a')](function(_0x1fbfe0){logger[_0x9ad6('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x3271e9,_0x1fbfe0);_0x2d9ca8(_0x1fbfe0);});});}function respondWithStatusCode(_0x5d6ca7,_0x164e53){_0x164e53=_0x164e53||0xcc;return function(_0xe1aa06){if(_0xe1aa06){return _0x5d6ca7['sendStatus'](_0x164e53);}return _0x5d6ca7['status'](_0x164e53)[_0x9ad6('0x2b')]();};}function respondWithResult(_0x43a89f,_0x517dd7){_0x517dd7=_0x517dd7||0xc8;return function(_0x4ed612){if(_0x4ed612){return _0x43a89f[_0x9ad6('0x2c')](_0x517dd7)[_0x9ad6('0x2d')](_0x4ed612);}};}function respondWithFilteredResult(_0x4f580c,_0x5bfdc8){return function(_0x173e48){if(_0x173e48){var _0x3c3f39=typeof _0x5bfdc8[_0x9ad6('0x2e')]==='undefined'&&typeof _0x5bfdc8[_0x9ad6('0x2f')]==='undefined';var _0x1ece14=_0x173e48['count'];var _0x7583aa=_0x3c3f39?0x0:_0x5bfdc8['offset'];var _0x151cf6=_0x3c3f39?_0x173e48[_0x9ad6('0x30')]:_0x5bfdc8[_0x9ad6('0x2e')]+_0x5bfdc8[_0x9ad6('0x2f')];var _0x27c2c2;if(_0x151cf6>=_0x1ece14){_0x151cf6=_0x1ece14;_0x27c2c2=0xc8;}else{_0x27c2c2=0xce;}_0x4f580c[_0x9ad6('0x2c')](_0x27c2c2);return _0x4f580c[_0x9ad6('0x31')](_0x9ad6('0x32'),_0x7583aa+'-'+_0x151cf6+'/'+_0x1ece14)[_0x9ad6('0x2d')](_0x173e48);}return null;};}function patchUpdates(_0x4b691b){return function(_0x230f9a){try{jsonpatch[_0x9ad6('0x33')](_0x230f9a,_0x4b691b,!![]);}catch(_0x1e0af6){return BPromise[_0x9ad6('0x34')](_0x1e0af6);}return _0x230f9a[_0x9ad6('0x35')]();};}function saveUpdates(_0x29a6e5,_0x2ad073){return function(_0x4ed5d4){if(_0x4ed5d4){return _0x4ed5d4['update'](_0x29a6e5)[_0x9ad6('0x21')](function(_0x3d1acf){return _0x3d1acf;});}return null;};}function removeEntity(_0x387e69,_0x38e2f2){return function(_0x59bcfe){if(_0x59bcfe){return _0x59bcfe[_0x9ad6('0x36')]()[_0x9ad6('0x21')](function(){var _0x2780fc=_0x59bcfe['get']({'plain':!![]});var _0x36c1ed=_0x9ad6('0x37');return db[_0x9ad6('0x38')][_0x9ad6('0x36')]({'where':{'type':_0x36c1ed,'resourceId':_0x2780fc['id']}})['then'](function(){return _0x59bcfe;});})[_0x9ad6('0x21')](function(){_0x387e69[_0x9ad6('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d74e8,_0x33e75a){return function(_0xcd7644){if(!_0xcd7644){_0x4d74e8['sendStatus'](0x194);}return _0xcd7644;};}function handleError(_0x245a5a,_0x1b3b13){_0x1b3b13=_0x1b3b13||0x1f4;return function(_0x24b03a){logger[_0x9ad6('0x26')](_0x24b03a[_0x9ad6('0x39')]);if(_0x24b03a[_0x9ad6('0x3a')]){delete _0x24b03a[_0x9ad6('0x3a')];}_0x245a5a[_0x9ad6('0x2c')](_0x1b3b13)[_0x9ad6('0x3b')](_0x24b03a);};}exports[_0x9ad6('0x3c')]=function(_0x2cdadd,_0x1da59a){var _0x2a1ff7={'include':[{'model':db[_0x9ad6('0x3d')],'as':'mandatoryDispositionPause'}]},_0x51c7f0={},_0x3b7799={'count':0x0,'rows':[]};var _0x30cf68=_[_0x9ad6('0x3e')](db['WhatsappAccount'][_0x9ad6('0x3f')],function(_0x1b489f){return{'name':_0x1b489f['fieldName'],'type':_0x1b489f['type'][_0x9ad6('0x40')]};});_0x51c7f0['model']=_[_0x9ad6('0x3e')](_0x30cf68,_0x9ad6('0x3a'));_0x51c7f0[_0x9ad6('0x41')]=_[_0x9ad6('0x42')](_0x2cdadd[_0x9ad6('0x41')]);_0x51c7f0[_0x9ad6('0x43')]=_[_0x9ad6('0x44')](_0x51c7f0[_0x9ad6('0x45')],_0x51c7f0[_0x9ad6('0x41')]);_0x2a1ff7[_0x9ad6('0x46')]=_['intersection'](_0x51c7f0[_0x9ad6('0x45')],qs['fields'](_0x2cdadd[_0x9ad6('0x41')][_0x9ad6('0x47')]));_0x2a1ff7[_0x9ad6('0x46')]=_0x2a1ff7[_0x9ad6('0x46')][_0x9ad6('0x48')]?_0x2a1ff7[_0x9ad6('0x46')]:_0x51c7f0[_0x9ad6('0x45')];if(!_0x2cdadd['query'][_0x9ad6('0x49')](_0x9ad6('0x4a'))){_0x2a1ff7[_0x9ad6('0x2f')]=qs['limit'](_0x2cdadd[_0x9ad6('0x41')][_0x9ad6('0x2f')]);_0x2a1ff7[_0x9ad6('0x2e')]=qs[_0x9ad6('0x2e')](_0x2cdadd[_0x9ad6('0x41')]['offset']);}_0x2a1ff7[_0x9ad6('0x4b')]=qs['sort'](_0x2cdadd[_0x9ad6('0x41')]['sort']);_0x2a1ff7['where']=qs[_0x9ad6('0x43')](_[_0x9ad6('0x4c')](_0x2cdadd[_0x9ad6('0x41')],_0x51c7f0['filters']),_0x30cf68);if(_0x2cdadd[_0x9ad6('0x41')][_0x9ad6('0x4d')]){_0x2a1ff7['where']=_[_0x9ad6('0x4e')](_0x2a1ff7['where'],{'$or':_[_0x9ad6('0x3e')](_0x30cf68,function(_0x4cfb39){if(_0x4cfb39[_0x9ad6('0x4f')]!==_0x9ad6('0x50')){var _0x5e441a={};_0x5e441a[_0x4cfb39[_0x9ad6('0x3a')]]={'$like':'%'+_0x2cdadd[_0x9ad6('0x41')][_0x9ad6('0x4d')]+'%'};return _0x5e441a;}})});}_0x2a1ff7=_['merge']({},_0x2a1ff7,_0x2cdadd[_0x9ad6('0x51')]);var _0x66b2e={'where':_0x2a1ff7['where']};return db[_0x9ad6('0x52')]['count'](_0x66b2e)[_0x9ad6('0x21')](function(_0x7d88){_0x3b7799['count']=_0x7d88;if(_0x2cdadd['query'][_0x9ad6('0x53')]){_0x2a1ff7[_0x9ad6('0x54')]=[{'all':!![]}];}return db[_0x9ad6('0x52')][_0x9ad6('0x55')](_0x2a1ff7);})[_0x9ad6('0x21')](function(_0x278adb){_0x3b7799['rows']=_0x278adb;return _0x3b7799;})[_0x9ad6('0x21')](respondWithFilteredResult(_0x1da59a,_0x2a1ff7))[_0x9ad6('0x2a')](handleError(_0x1da59a,null));};exports['show']=function(_0x4084f9,_0x1d682a){var _0x56b4c4={'raw':![],'where':{'id':_0x4084f9[_0x9ad6('0x56')]['id']},'include':[{'model':db[_0x9ad6('0x3d')],'as':_0x9ad6('0x57')}]},_0xbd5c8a={};_0xbd5c8a[_0x9ad6('0x45')]=_[_0x9ad6('0x42')](db[_0x9ad6('0x52')][_0x9ad6('0x3f')]);_0xbd5c8a[_0x9ad6('0x41')]=_[_0x9ad6('0x42')](_0x4084f9['query']);_0xbd5c8a[_0x9ad6('0x43')]=_[_0x9ad6('0x44')](_0xbd5c8a[_0x9ad6('0x45')],_0xbd5c8a[_0x9ad6('0x41')]);_0x56b4c4['attributes']=_[_0x9ad6('0x44')](_0xbd5c8a[_0x9ad6('0x45')],qs[_0x9ad6('0x47')](_0x4084f9[_0x9ad6('0x41')][_0x9ad6('0x47')]));_0x56b4c4[_0x9ad6('0x46')]=_0x56b4c4['attributes'][_0x9ad6('0x48')]?_0x56b4c4[_0x9ad6('0x46')]:_0xbd5c8a[_0x9ad6('0x45')];if(_0x4084f9[_0x9ad6('0x41')][_0x9ad6('0x53')]){_0x56b4c4[_0x9ad6('0x54')]=[{'all':!![]}];}_0x56b4c4=_[_0x9ad6('0x4e')]({},_0x56b4c4,_0x4084f9[_0x9ad6('0x51')]);return db[_0x9ad6('0x52')]['find'](_0x56b4c4)['then'](handleEntityNotFound(_0x1d682a,null))[_0x9ad6('0x21')](respondWithResult(_0x1d682a,null))[_0x9ad6('0x2a')](handleError(_0x1d682a,null));};exports[_0x9ad6('0x58')]=function(_0x2e8beb,_0x58500e){return db[_0x9ad6('0x52')]['create'](_0x2e8beb[_0x9ad6('0x59')],{})[_0x9ad6('0x21')](function(_0xf323ef){var _0x46a9c7=_0x2e8beb['user']['get']({'plain':!![]});if(!_0x46a9c7)throw new Error(_0x9ad6('0x5a'));if(_0x46a9c7[_0x9ad6('0x5b')]===_0x9ad6('0x5c')){var _0x3c88cd=_0xf323ef[_0x9ad6('0x5d')]({'plain':!![]});var _0x4992c2=_0x9ad6('0x37');return db[_0x9ad6('0x5e')]['find']({'where':{'name':_0x4992c2,'userProfileId':_0x46a9c7[_0x9ad6('0x5f')]},'raw':!![]})['then'](function(_0x328ad2){if(_0x328ad2&&_0x328ad2[_0x9ad6('0x60')]===0x0){return db['UserProfileResource'][_0x9ad6('0x58')]({'name':_0x3c88cd['name'],'resourceId':_0x3c88cd['id'],'type':_0x328ad2[_0x9ad6('0x3a')],'sectionId':_0x328ad2['id']},{})[_0x9ad6('0x21')](function(){return _0xf323ef;});}else{return _0xf323ef;}})[_0x9ad6('0x2a')](function(_0x29fe86){logger[_0x9ad6('0x26')](_0x9ad6('0x61'),_0x29fe86);throw _0x29fe86;});}return _0xf323ef;})[_0x9ad6('0x21')](respondWithResult(_0x58500e,0xc9))['catch'](handleError(_0x58500e,null));};exports[_0x9ad6('0x62')]=function(_0x59c5e0,_0x1b039f){if(_0x59c5e0['body']['id']){delete _0x59c5e0['body']['id'];}return db[_0x9ad6('0x52')][_0x9ad6('0x63')]({'where':{'id':_0x59c5e0['params']['id']},'include':[{'model':db[_0x9ad6('0x3d')],'as':_0x9ad6('0x57')}]})['then'](handleEntityNotFound(_0x1b039f,null))['then'](saveUpdates(_0x59c5e0[_0x9ad6('0x59')],null))['then'](respondWithResult(_0x1b039f,null))[_0x9ad6('0x2a')](handleError(_0x1b039f,null));};exports['destroy']=function(_0x1c754a,_0x3efb83){return db['WhatsappAccount']['find']({'where':{'id':_0x1c754a['params']['id']}})[_0x9ad6('0x21')](handleEntityNotFound(_0x3efb83,null))[_0x9ad6('0x21')](removeEntity(_0x3efb83,null))[_0x9ad6('0x2a')](handleError(_0x3efb83,null));};exports['describe']=function(_0x22e621,_0x4022bc){return db[_0x9ad6('0x52')]['describe']()[_0x9ad6('0x21')](respondWithResult(_0x4022bc,null))[_0x9ad6('0x2a')](handleError(_0x4022bc,null));};exports[_0x9ad6('0x64')]=function(_0x53ceb1,_0x4c0616,_0x128a0){if(_0x53ceb1[_0x9ad6('0x59')]['id']){delete _0x53ceb1[_0x9ad6('0x59')]['id'];}return db['WhatsappAccount'][_0x9ad6('0x63')]({'where':{'id':_0x53ceb1[_0x9ad6('0x56')]['id']}})[_0x9ad6('0x21')](handleEntityNotFound(_0x4c0616,null))[_0x9ad6('0x21')](function(_0x58d8b0){if(_0x58d8b0){_0x53ceb1[_0x9ad6('0x59')][_0x9ad6('0x65')]=_0x58d8b0['id'];return db[_0x9ad6('0x66')][_0x9ad6('0x58')](_0x53ceb1[_0x9ad6('0x59')]);}})[_0x9ad6('0x21')](respondWithResult(_0x4c0616,null))['catch'](handleError(_0x4c0616,null));};exports[_0x9ad6('0x67')]=function(_0xd58328,_0x2afa88,_0x19d09c){var _0x9681f1={'raw':![],'where':{}};var _0x3955bb={};var _0x30d5af={'count':0x0,'rows':[]};return db[_0x9ad6('0x52')][_0x9ad6('0x68')]({'where':{'id':_0xd58328[_0x9ad6('0x56')]['id']}})[_0x9ad6('0x21')](handleEntityNotFound(_0x2afa88,null))[_0x9ad6('0x21')](function(_0x1d4ba4){if(_0x1d4ba4){_0x3955bb[_0x9ad6('0x45')]=_[_0x9ad6('0x42')](db['Disposition'][_0x9ad6('0x3f')]);_0x3955bb[_0x9ad6('0x41')]=_[_0x9ad6('0x42')](_0xd58328[_0x9ad6('0x41')]);_0x3955bb['filters']=_['intersection'](_0x3955bb['model'],_0x3955bb[_0x9ad6('0x41')]);_0x9681f1[_0x9ad6('0x46')]=_[_0x9ad6('0x44')](_0x3955bb[_0x9ad6('0x45')],qs['fields'](_0xd58328[_0x9ad6('0x41')][_0x9ad6('0x47')]));_0x9681f1[_0x9ad6('0x46')]=_0x9681f1[_0x9ad6('0x46')]['length']?_0x9681f1['attributes']:_0x3955bb[_0x9ad6('0x45')];if(!_0xd58328[_0x9ad6('0x41')][_0x9ad6('0x49')](_0x9ad6('0x4a'))){_0x9681f1[_0x9ad6('0x2f')]=qs[_0x9ad6('0x2f')](_0xd58328[_0x9ad6('0x41')]['limit']);_0x9681f1[_0x9ad6('0x2e')]=qs['offset'](_0xd58328[_0x9ad6('0x41')][_0x9ad6('0x2e')]);}_0x9681f1[_0x9ad6('0x4b')]=qs[_0x9ad6('0x69')](_0xd58328[_0x9ad6('0x41')]['sort']);_0x9681f1['where']=qs[_0x9ad6('0x43')](_[_0x9ad6('0x4c')](_0xd58328[_0x9ad6('0x41')],_0x3955bb[_0x9ad6('0x43')]));_0x9681f1[_0x9ad6('0x6a')][_0x9ad6('0x65')]=_0x1d4ba4['id'];if(_0xd58328[_0x9ad6('0x41')]['filter']){_0x9681f1[_0x9ad6('0x6a')]=_['merge'](_0x9681f1[_0x9ad6('0x6a')],{'$or':_[_0x9ad6('0x3e')](_0x9681f1[_0x9ad6('0x46')],function(_0x57b671){var _0x493615={};_0x493615[_0x57b671]={'$like':'%'+_0xd58328['query'][_0x9ad6('0x4d')]+'%'};return _0x493615;})});}_0x9681f1=_[_0x9ad6('0x4e')]({},_0x9681f1,_0xd58328[_0x9ad6('0x51')]);return db[_0x9ad6('0x66')][_0x9ad6('0x30')]({'where':_0x9681f1['where']})[_0x9ad6('0x21')](function(_0xb9fd6e){_0x30d5af[_0x9ad6('0x30')]=_0xb9fd6e;if(_0xd58328[_0x9ad6('0x41')]['includeAll']){_0x9681f1['include']=[{'all':!![]}];}return db[_0x9ad6('0x66')][_0x9ad6('0x55')](_0x9681f1);})[_0x9ad6('0x21')](function(_0x1e033e){_0x30d5af[_0x9ad6('0x6b')]=_0x1e033e;return _0x30d5af;});}})['then'](respondWithFilteredResult(_0x2afa88,_0x9681f1))[_0x9ad6('0x2a')](handleError(_0x2afa88,null));};exports[_0x9ad6('0x6c')]=function(_0x383258,_0x707392,_0x10ab05){return db[_0x9ad6('0x52')][_0x9ad6('0x63')]({'where':{'id':_0x383258[_0x9ad6('0x56')]['id']}})[_0x9ad6('0x21')](handleEntityNotFound(_0x707392,null))[_0x9ad6('0x21')](function(_0x11940b){if(_0x11940b){return _0x11940b['removeDispositions'](_0x383258[_0x9ad6('0x41')][_0x9ad6('0x6d')]);}})['then'](respondWithStatusCode(_0x707392,null))[_0x9ad6('0x2a')](handleError(_0x707392,null));};exports[_0x9ad6('0x6e')]=function(_0x54c95b,_0x4b79d9,_0x30b0e5){if(_0x54c95b['body']['id']){delete _0x54c95b[_0x9ad6('0x59')]['id'];}return db[_0x9ad6('0x52')][_0x9ad6('0x63')]({'where':{'id':_0x54c95b[_0x9ad6('0x56')]['id']}})[_0x9ad6('0x21')](handleEntityNotFound(_0x4b79d9,null))[_0x9ad6('0x21')](function(_0x31f516){if(_0x31f516){_0x54c95b[_0x9ad6('0x59')][_0x9ad6('0x65')]=_0x31f516['id'];return db['CannedAnswer'][_0x9ad6('0x58')](_0x54c95b[_0x9ad6('0x59')]);}})[_0x9ad6('0x21')](respondWithResult(_0x4b79d9,null))[_0x9ad6('0x2a')](handleError(_0x4b79d9,null));};exports[_0x9ad6('0x6f')]=function(_0x42d846,_0xc1be81,_0x39e3ff){var _0xc24c67={'raw':![],'where':{}};var _0x1a1f53={};var _0x569154={'count':0x0,'rows':[]};return db[_0x9ad6('0x52')][_0x9ad6('0x68')]({'where':{'id':_0x42d846[_0x9ad6('0x56')]['id']}})['then'](handleEntityNotFound(_0xc1be81,null))[_0x9ad6('0x21')](function(_0x6b4cb3){if(_0x6b4cb3){_0x1a1f53[_0x9ad6('0x45')]=_['keys'](db[_0x9ad6('0x70')]['rawAttributes']);_0x1a1f53[_0x9ad6('0x41')]=_['keys'](_0x42d846['query']);_0x1a1f53[_0x9ad6('0x43')]=_[_0x9ad6('0x44')](_0x1a1f53['model'],_0x1a1f53[_0x9ad6('0x41')]);_0xc24c67[_0x9ad6('0x46')]=_[_0x9ad6('0x44')](_0x1a1f53[_0x9ad6('0x45')],qs[_0x9ad6('0x47')](_0x42d846['query']['fields']));_0xc24c67[_0x9ad6('0x46')]=_0xc24c67[_0x9ad6('0x46')][_0x9ad6('0x48')]?_0xc24c67[_0x9ad6('0x46')]:_0x1a1f53[_0x9ad6('0x45')];if(!_0x42d846[_0x9ad6('0x41')]['hasOwnProperty'](_0x9ad6('0x4a'))){_0xc24c67[_0x9ad6('0x2f')]=qs[_0x9ad6('0x2f')](_0x42d846[_0x9ad6('0x41')][_0x9ad6('0x2f')]);_0xc24c67[_0x9ad6('0x2e')]=qs[_0x9ad6('0x2e')](_0x42d846[_0x9ad6('0x41')][_0x9ad6('0x2e')]);}_0xc24c67['order']=qs[_0x9ad6('0x69')](_0x42d846[_0x9ad6('0x41')][_0x9ad6('0x69')]);_0xc24c67[_0x9ad6('0x6a')]=qs[_0x9ad6('0x43')](_[_0x9ad6('0x4c')](_0x42d846[_0x9ad6('0x41')],_0x1a1f53[_0x9ad6('0x43')]));_0xc24c67[_0x9ad6('0x6a')][_0x9ad6('0x65')]=_0x6b4cb3['id'];if(_0x42d846[_0x9ad6('0x41')][_0x9ad6('0x4d')]){_0xc24c67[_0x9ad6('0x6a')]=_[_0x9ad6('0x4e')](_0xc24c67[_0x9ad6('0x6a')],{'$or':_[_0x9ad6('0x3e')](_0xc24c67['attributes'],function(_0x35c6b5){var _0x5996dd={};_0x5996dd[_0x35c6b5]={'$like':'%'+_0x42d846[_0x9ad6('0x41')][_0x9ad6('0x4d')]+'%'};return _0x5996dd;})});}_0xc24c67=_[_0x9ad6('0x4e')]({},_0xc24c67,_0x42d846[_0x9ad6('0x51')]);return db[_0x9ad6('0x70')]['count']({'where':_0xc24c67[_0x9ad6('0x6a')]})['then'](function(_0x6f73ae){_0x569154[_0x9ad6('0x30')]=_0x6f73ae;if(_0x42d846[_0x9ad6('0x41')][_0x9ad6('0x53')]){_0xc24c67[_0x9ad6('0x54')]=[{'all':!![]}];}return db[_0x9ad6('0x70')][_0x9ad6('0x55')](_0xc24c67);})['then'](function(_0x14ae4c){_0x569154[_0x9ad6('0x6b')]=_0x14ae4c;return _0x569154;});}})[_0x9ad6('0x21')](respondWithFilteredResult(_0xc1be81,_0xc24c67))[_0x9ad6('0x2a')](handleError(_0xc1be81,null));};exports['removeAnswers']=function(_0x5a19b7,_0x87bb0f,_0x44ea68){return db[_0x9ad6('0x52')][_0x9ad6('0x63')]({'where':{'id':_0x5a19b7[_0x9ad6('0x56')]['id']}})[_0x9ad6('0x21')](handleEntityNotFound(_0x87bb0f,null))['then'](function(_0x12dcff){if(_0x12dcff){return _0x12dcff[_0x9ad6('0x71')](_0x5a19b7[_0x9ad6('0x41')]['ids']);}})[_0x9ad6('0x21')](respondWithStatusCode(_0x87bb0f,null))['catch'](handleError(_0x87bb0f,null));};exports['addAgents']=function(_0x33c773,_0x6e4604,_0x4f83c5){return db[_0x9ad6('0x52')][_0x9ad6('0x63')]({'where':{'id':_0x33c773[_0x9ad6('0x56')]['id']}})[_0x9ad6('0x21')](handleEntityNotFound(_0x6e4604,null))[_0x9ad6('0x21')](function(_0x30ff47){if(_0x30ff47){return _0x30ff47['addAgents'](_0x33c773['body'][_0x9ad6('0x6d')],_[_0x9ad6('0x72')](_0x33c773[_0x9ad6('0x59')],[_0x9ad6('0x6d'),'id'])||{})['spread'](function(_0x4fdc3e){for(var _0x4d8a32=0x0;_0x4d8a32<_0x33c773[_0x9ad6('0x59')][_0x9ad6('0x6d')][_0x9ad6('0x48')];_0x4d8a32+=0x1){socket[_0x9ad6('0x73')](_0x9ad6('0x74'),{'UserId':Number(_0x33c773[_0x9ad6('0x59')][_0x9ad6('0x6d')][_0x4d8a32]),'WhatsappAccountId':Number(_0x33c773['params']['id'])});}return _0x4fdc3e;});}})[_0x9ad6('0x21')](respondWithResult(_0x6e4604,null))[_0x9ad6('0x2a')](handleError(_0x6e4604,null));};exports[_0x9ad6('0x75')]=function(_0x666de8,_0x4a7b77,_0x83b280){return db[_0x9ad6('0x52')][_0x9ad6('0x63')]({'where':{'id':_0x666de8[_0x9ad6('0x56')]['id']}})[_0x9ad6('0x21')](handleEntityNotFound(_0x4a7b77,null))['then'](function(_0x571799){if(_0x571799){return _0x571799[_0x9ad6('0x75')](_0x666de8[_0x9ad6('0x41')][_0x9ad6('0x6d')])[_0x9ad6('0x21')](function(){if(_[_0x9ad6('0x76')](_0x666de8[_0x9ad6('0x41')][_0x9ad6('0x6d')])){for(var _0x4e9fc1=0x0;_0x4e9fc1<_0x666de8['query'][_0x9ad6('0x6d')][_0x9ad6('0x48')];_0x4e9fc1+=0x1){socket['emit'](_0x9ad6('0x77'),{'UserId':Number(_0x666de8[_0x9ad6('0x41')][_0x9ad6('0x6d')][_0x4e9fc1]),'WhatsappAccountId':Number(_0x666de8[_0x9ad6('0x56')]['id'])});}}else{socket[_0x9ad6('0x73')](_0x9ad6('0x77'),{'UserId':Number(_0x666de8[_0x9ad6('0x41')][_0x9ad6('0x6d')]),'WhatsappAccountId':Number(_0x666de8[_0x9ad6('0x56')]['id'])});}});}})[_0x9ad6('0x21')](respondWithStatusCode(_0x4a7b77,null))[_0x9ad6('0x2a')](handleError(_0x4a7b77,null));};exports[_0x9ad6('0x78')]=function(_0x54a215,_0x3196f6,_0x2e1462){var _0x36ce43={};var _0x5ef663={};var _0x3cca10;var _0x75d0cc;return db[_0x9ad6('0x52')][_0x9ad6('0x68')]({'where':{'id':_0x54a215[_0x9ad6('0x56')]['id']}})[_0x9ad6('0x21')](handleEntityNotFound(_0x3196f6,null))[_0x9ad6('0x21')](function(_0x134b81){if(_0x134b81){_0x3cca10=_0x134b81;_0x5ef663[_0x9ad6('0x45')]=_[_0x9ad6('0x42')](db[_0x9ad6('0x79')][_0x9ad6('0x3f')]);_0x5ef663[_0x9ad6('0x41')]=_[_0x9ad6('0x42')](_0x54a215[_0x9ad6('0x41')]);_0x5ef663[_0x9ad6('0x43')]=_[_0x9ad6('0x44')](_0x5ef663[_0x9ad6('0x45')],_0x5ef663[_0x9ad6('0x41')]);_0x36ce43['attributes']=_[_0x9ad6('0x44')](_0x5ef663[_0x9ad6('0x45')],qs[_0x9ad6('0x47')](_0x54a215[_0x9ad6('0x41')][_0x9ad6('0x47')]));_0x36ce43['attributes']=_0x36ce43[_0x9ad6('0x46')][_0x9ad6('0x48')]?_0x36ce43[_0x9ad6('0x46')]:_0x5ef663[_0x9ad6('0x45')];_0x36ce43[_0x9ad6('0x4b')]=qs[_0x9ad6('0x69')](_0x54a215['query']['sort']);_0x36ce43[_0x9ad6('0x6a')]=qs['filters'](_[_0x9ad6('0x4c')](_0x54a215[_0x9ad6('0x41')],_0x5ef663[_0x9ad6('0x43')]));if(_0x54a215[_0x9ad6('0x41')][_0x9ad6('0x4d')]){_0x36ce43[_0x9ad6('0x6a')]=_[_0x9ad6('0x4e')](_0x36ce43[_0x9ad6('0x6a')],{'$or':_[_0x9ad6('0x3e')](_0x36ce43[_0x9ad6('0x46')],function(_0x21d818){var _0x7d0df1={};_0x7d0df1[_0x21d818]={'$like':'%'+_0x54a215['query'][_0x9ad6('0x4d')]+'%'};return _0x7d0df1;})});}_0x36ce43=_[_0x9ad6('0x4e')]({},_0x36ce43,_0x54a215['options']);return _0x3cca10['getAgents'](_0x36ce43);}})[_0x9ad6('0x21')](function(_0x16f8b5){if(_0x16f8b5){_0x75d0cc=_0x16f8b5[_0x9ad6('0x48')];if(!_0x54a215[_0x9ad6('0x41')][_0x9ad6('0x49')]('nolimit')){_0x36ce43[_0x9ad6('0x2f')]=qs[_0x9ad6('0x2f')](_0x54a215[_0x9ad6('0x41')][_0x9ad6('0x2f')]);_0x36ce43[_0x9ad6('0x2e')]=qs[_0x9ad6('0x2e')](_0x54a215[_0x9ad6('0x41')][_0x9ad6('0x2e')]);}return _0x3cca10[_0x9ad6('0x78')](_0x36ce43);}})[_0x9ad6('0x21')](function(_0x463d26){if(_0x463d26){return _0x463d26?{'count':_0x75d0cc,'rows':_0x463d26}:null;}})[_0x9ad6('0x21')](respondWithResult(_0x3196f6,null))[_0x9ad6('0x2a')](handleError(_0x3196f6,null));};exports['addApplications']=function(_0x1a36e7,_0xe0ac02){var _0x3600c3=_0x1a36e7[_0x9ad6('0x56')]['id'];var _0xebac12=_0x1a36e7['body'];var _0x4defe5=0xc8;var _0x364d0c=null;return db[_0x9ad6('0x7a')]['transaction']({'isolationLevel':db['sequelize']['Transaction'][_0x9ad6('0x7b')][_0x9ad6('0x7c')]},function(_0x5b6083){return db[_0x9ad6('0x52')][_0x9ad6('0x68')]({'where':{'id':_0x3600c3},'transaction':_0x5b6083})[_0x9ad6('0x21')](function(_0x261901){if(_0x261901){return db['WhatsappApplication'][_0x9ad6('0x36')]({'where':{'WhatsappAccountId':_0x3600c3},'transaction':_0x5b6083})[_0x9ad6('0x21')](function(){var _0x3ba15f=_['map'](_0xebac12,function(_0x301fae){_0x301fae[_0x9ad6('0x65')]=_0x3600c3;return _0x301fae;});return db[_0x9ad6('0x7d')][_0x9ad6('0x7e')](_0x3ba15f,{'transaction':_0x5b6083});});}else{_0x4defe5=0x194;_0x364d0c=[];}});})['then'](function(){if(_0x4defe5!==0x194){return db[_0x9ad6('0x7d')][_0x9ad6('0x7f')]({'where':{'WhatsappAccountId':_0x3600c3},'order':_0x9ad6('0x80')})[_0x9ad6('0x21')](function(_0x1be8c2){_0x364d0c=_0x1be8c2;});}})['catch'](function(_0xb0e0a1){_0x4defe5=0x1f4;logger['error'](_0xb0e0a1['stack']);if(_0xb0e0a1['name']){delete _0xb0e0a1[_0x9ad6('0x3a')];}_0x364d0c=_0xb0e0a1;})[_0x9ad6('0x81')](function(){if(_0x364d0c===null){_0xe0ac02[_0x9ad6('0x82')](_0x4defe5);}else{if(_0x4defe5===0x1f4){_0xe0ac02[_0x9ad6('0x2c')](_0x4defe5)['send'](_0x364d0c);}else{_0xe0ac02[_0x9ad6('0x2c')](_0x4defe5)[_0x9ad6('0x2d')](_0x364d0c);}}});};exports['getApplications']=function(_0x138f9e,_0x33ee81,_0x171e6c){var _0x67a518={};var _0x15d59c={};var _0x33b57e;var _0x238dea;return db[_0x9ad6('0x52')][_0x9ad6('0x68')]({'where':{'id':_0x138f9e[_0x9ad6('0x56')]['id']}})['then'](handleEntityNotFound(_0x33ee81,null))[_0x9ad6('0x21')](function(_0x38277c){if(_0x38277c){_0x33b57e=_0x38277c;_0x15d59c[_0x9ad6('0x45')]=_[_0x9ad6('0x42')](db[_0x9ad6('0x7d')][_0x9ad6('0x3f')]);_0x15d59c['query']=_[_0x9ad6('0x42')](_0x138f9e['query']);_0x15d59c['filters']=_[_0x9ad6('0x44')](_0x15d59c['model'],_0x15d59c[_0x9ad6('0x41')]);_0x67a518[_0x9ad6('0x46')]=_[_0x9ad6('0x44')](_0x15d59c['model'],qs['fields'](_0x138f9e['query'][_0x9ad6('0x47')]));_0x67a518[_0x9ad6('0x46')]=_0x67a518[_0x9ad6('0x46')][_0x9ad6('0x48')]?_0x67a518[_0x9ad6('0x46')]:_0x15d59c['model'];_0x67a518[_0x9ad6('0x4b')]=qs[_0x9ad6('0x69')](_0x138f9e[_0x9ad6('0x41')]['sort']);_0x67a518[_0x9ad6('0x6a')]=qs['filters'](_[_0x9ad6('0x4c')](_0x138f9e['query'],_0x15d59c[_0x9ad6('0x43')]));if(_0x138f9e['query'][_0x9ad6('0x4d')]){_0x67a518[_0x9ad6('0x6a')]=_['merge'](_0x67a518['where'],{'$or':_['map'](_0x67a518[_0x9ad6('0x46')],function(_0x7478e5){var _0x580b6c={};_0x580b6c[_0x7478e5]={'$like':'%'+_0x138f9e[_0x9ad6('0x41')]['filter']+'%'};return _0x580b6c;})});}_0x67a518=_[_0x9ad6('0x4e')]({},_0x67a518,_0x138f9e[_0x9ad6('0x51')]);return _0x33b57e['getApplications'](_0x67a518);}})[_0x9ad6('0x21')](function(_0x416cd9){if(_0x416cd9){_0x238dea=_0x416cd9[_0x9ad6('0x48')];if(!_0x138f9e[_0x9ad6('0x41')]['hasOwnProperty']('nolimit')){_0x67a518[_0x9ad6('0x2f')]=qs[_0x9ad6('0x2f')](_0x138f9e['query'][_0x9ad6('0x2f')]);_0x67a518[_0x9ad6('0x2e')]=qs[_0x9ad6('0x2e')](_0x138f9e[_0x9ad6('0x41')][_0x9ad6('0x2e')]);}return _0x33b57e['getApplications'](_0x67a518);}})[_0x9ad6('0x21')](function(_0x146ca2){if(_0x146ca2){return _0x146ca2?{'count':_0x238dea,'rows':_0x146ca2}:null;}})[_0x9ad6('0x21')](respondWithResult(_0x33ee81,null))[_0x9ad6('0x2a')](handleError(_0x33ee81,null));};exports[_0x9ad6('0x83')]=function(_0x40b622,_0x1bce3e,_0x10a94e){var _0x324455={'channel':_0x9ad6('0x84')};var _0x46c4e8=[];var _0x59c745=[];var _0x4527df={};return db[_0x9ad6('0x52')][_0x9ad6('0x63')]({'where':{'id':_0x40b622[_0x9ad6('0x56')]['id']},'include':[{'model':db[_0x9ad6('0x7d')],'as':_0x9ad6('0x85')}]})[_0x9ad6('0x21')](handleEntityNotFound(_0x1bce3e,null))[_0x9ad6('0x21')](function(_0x571185){_0x324455[_0x9ad6('0x86')]=_0x571185;if(_0x324455[_0x9ad6('0x86')]&&_0x324455['account'][_0x9ad6('0x4f')]===_0x9ad6('0x87')&&_0x40b622[_0x9ad6('0x59')][_0x9ad6('0x88')]){if(_0x40b622[_0x9ad6('0x59')]['statuses']['length']===0x0)return;if(_0x40b622['body'][_0x9ad6('0x88')][0x0][_0x9ad6('0x89')]!==_0x9ad6('0x8a'))return;return db['WhatsappMessage'][_0x9ad6('0x62')]({'read':!![],'readAt':_0x40b622['body'][_0x9ad6('0x88')][0x0][_0x9ad6('0x8b')]},{'where':{'messageId':_0x40b622['body'][_0x9ad6('0x88')][0x0][_0x9ad6('0x8c')]},'individualHooks':!![]})['then'](function(_0x36122b){return _0x1bce3e[_0x9ad6('0x2c')](0xc8)[_0x9ad6('0x2d')](_0x36122b);});}_0x324455['applications']=_[_0x9ad6('0x8d')](_0x571185[_0x9ad6('0x85')],['priority'],[_0x9ad6('0x8e')]);if(_0x324455['account'][_0x9ad6('0x85')]){delete _0x324455[_0x9ad6('0x86')][_0x9ad6('0x85')];}return db[_0x9ad6('0x8f')]['describe']()[_0x9ad6('0x21')](function(_0x3812dc){if(!_0x3812dc){throw new db['Sequelize'][(_0x9ad6('0x90'))](_0x9ad6('0x91'));}_0x46c4e8=_[_0x9ad6('0x92')](_[_0x9ad6('0x42')](_0x3812dc),[_0x9ad6('0x93'),'updatedAt']);_0x59c745=_[_0x9ad6('0x92')](_['keys'](_0x3812dc),[_0x9ad6('0x93'),_0x9ad6('0x94'),_0x9ad6('0x95'),_0x9ad6('0x96')]);_0x324455[_0x9ad6('0x59')]={'mapKey':_0x9ad6('0x97')};if(_0x324455[_0x9ad6('0x86')]&&_0x324455[_0x9ad6('0x86')][_0x9ad6('0x4f')]===_0x9ad6('0x98')){_0x324455[_0x9ad6('0x59')]['from']=_0x40b622[_0x9ad6('0x59')]['From'][_0x9ad6('0x99')](_0x9ad6('0x9a'),'');_0x324455[_0x9ad6('0x59')][_0x9ad6('0x59')]=_0x40b622[_0x9ad6('0x59')][_0x9ad6('0x9b')];_0x324455[_0x9ad6('0x59')][_0x9ad6('0x9c')]=_0x40b622[_0x9ad6('0x59')][_0x9ad6('0x9d')];}if(_0x324455[_0x9ad6('0x86')]&&_0x324455['account'][_0x9ad6('0x4f')]==='sinch'){_0x324455[_0x9ad6('0x59')][_0x9ad6('0x9e')]=_0x40b622[_0x9ad6('0x59')][_0x9ad6('0x9f')][0x0]['from'];_0x324455[_0x9ad6('0x59')][_0x9ad6('0x59')]=_0x40b622[_0x9ad6('0x59')]['notifications'][0x0][_0x9ad6('0x27')]['body'];_0x324455[_0x9ad6('0x59')][_0x9ad6('0x9c')]=_0x40b622[_0x9ad6('0x59')][_0x9ad6('0x9f')][0x0][_0x9ad6('0x8c')];}if(_0x324455[_0x9ad6('0x59')]['id']){delete _0x324455['body']['id'];}if(_[_0x9ad6('0xa0')](_0x324455['body'][_0x9ad6('0x9e')])){throw new db[(_0x9ad6('0xa1'))][(_0x9ad6('0x90'))](_0x9ad6('0xa2'));}if(_['isNil'](_0x324455[_0x9ad6('0x59')][_0x9ad6('0x59')])||_0x324455[_0x9ad6('0x59')]['body']===''){throw new db[(_0x9ad6('0xa1'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x324455['body'][_0x9ad6('0xa3')])){throw new db[(_0x9ad6('0xa1'))][(_0x9ad6('0x90'))](_0x9ad6('0xa4')+_0x59c745);}if(!_['includes'](_0x59c745,_0x324455[_0x9ad6('0x59')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x9ad6('0xa5')+_0x59c745);}_0x4527df[_0x324455[_0x9ad6('0x59')][_0x9ad6('0xa3')]]=_0x324455[_0x9ad6('0x59')][_0x9ad6('0x9e')];return db['CmList']['find']({'where':{'id':_0x324455[_0x9ad6('0x86')]['ListId']},'include':[{'model':db[_0x9ad6('0x8f')],'as':'Contacts','where':_0x4527df,'limit':0x1,'order':[[_0x9ad6('0x94'),_0x9ad6('0xa6')]]}]});})[_0x9ad6('0x21')](handleEntityNotFound(_0x1bce3e,null))[_0x9ad6('0x21')](function(_0x50af46){if(_0x50af46){_0x324455[_0x9ad6('0xa7')]=_[_0x9ad6('0x72')](_0x50af46,['Contacts']);if(_0x50af46[_0x9ad6('0xa8')][_0x9ad6('0x48')]){return _0x50af46[_0x9ad6('0xa8')][0x0];}var _0x61f88c=_[_0x9ad6('0x18')](_0x324455[_0x9ad6('0x59')],{'firstName':_0x324455[_0x9ad6('0x59')][_0x9ad6('0x9e')],'ListId':_0x50af46['id']});_0x61f88c[_0x324455['body'][_0x9ad6('0xa3')]]=_0x324455[_0x9ad6('0x59')]['from'];return db[_0x9ad6('0x8f')][_0x9ad6('0x58')](_0x61f88c,{'fields':_0x46c4e8,'raw':!![]});}})[_0x9ad6('0x21')](handleEntityNotFound(_0x1bce3e,null))['then'](function(_0x4b4cfa){if(_0x4b4cfa){_0x324455[_0x9ad6('0xa9')]=_0x4b4cfa;var _0x20f34c={'ContactId':_0x4b4cfa['id'],'phone':_0x324455[_0x9ad6('0x59')]['from'],'WhatsappAccountId':_0x40b622['params']['id']};var _0x136b0c={'ContactId':_0x4b4cfa['id'],'WhatsappAccountId':_0x40b622[_0x9ad6('0x56')]['id'],'closed':![]};return db[_0x9ad6('0xaa')][_0x9ad6('0x63')]({'where':_0x136b0c})[_0x9ad6('0x21')](function(_0x343acd){if(_0x343acd){return[_0x343acd,![]];}return db['WhatsappInteraction'][_0x9ad6('0x58')](_0x20f34c)['then'](function(_0x199db3){return[_0x199db3,!![]];});});}})[_0x9ad6('0xab')](function(_0x279226,_0x3931d5){_0x324455[_0x9ad6('0xac')]=_0x279226[_0x9ad6('0x5d')]({'plain':!![]});_0x324455[_0x9ad6('0xac')][_0x9ad6('0xad')]=![];if(_0x3931d5){if(_0x324455[_0x9ad6('0x86')][_0x9ad6('0xae')]){_0x324455['applications'][_0x9ad6('0xaf')]({'id':0x0,'priority':_0x324455['applications']['length']+0x1,'app':'close','appdata':_0x9ad6('0xb0'),'interval':_0x9ad6('0xb1')});}_0x324455[_0x9ad6('0xac')]['created']=!![];}return db[_0x9ad6('0xb2')]['create']({'phone':_0x324455['body'][_0x9ad6('0x9e')],'messageId':_0x324455[_0x9ad6('0x59')][_0x9ad6('0x9c')],'body':_0x324455['body'][_0x9ad6('0x59')],'WhatsappAccountId':_0x40b622[_0x9ad6('0x56')]['id'],'WhatsappInteractionId':_0x279226['id'],'direction':'in','ContactId':_0x279226[_0x9ad6('0xb3')],'AttachmentId':_0x324455[_0x9ad6('0x59')][_0x9ad6('0xb4')]});})[_0x9ad6('0x21')](function(_0x1eb087){_0x324455[_0x9ad6('0x27')]=_0x1eb087;if(_0x324455[_0x9ad6('0xac')][_0x9ad6('0xb5')]){return db['User'][_0x9ad6('0x63')]({'attributes':['id',_0x9ad6('0x3a')],'where':{'id':_0x324455[_0x9ad6('0xac')]['UserId']}})[_0x9ad6('0x21')](function(_0x161f67){if(_0x161f67){_0x324455[_0x9ad6('0xb6')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x161f67['name']+','+(_0x324455[_0x9ad6('0x86')][_0x9ad6('0xb7')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x9ad6('0xb8'),_0x9ad6('0xb9'),_0x324455);});}return respondWithRpcPromise(_0x9ad6('0xb8'),_0x9ad6('0xb9'),_0x324455);})['then'](function(_0x1a9497){if(_0x1a9497){var _0x346792=0xc8;var _0x151ea4=_0x9ad6('0xba');logger[_0x9ad6('0x22')](_0x9ad6('0x24'),_0x151ea4,_0x346792,'entity\x20found');logger[_0x9ad6('0x23')](_0x9ad6('0xbb'),_0x151ea4,_0x346792,_0x9ad6('0xbc'),JSON['stringify'](_0x1a9497));if(_0x324455['account'][_0x9ad6('0x4f')]==='twilio'){return _0x1bce3e['status'](_0x346792)['set'](_0x9ad6('0xbd'),_0x9ad6('0xbe'))[_0x9ad6('0x3b')](_0x9ad6('0xbf'));}else{return _0x1bce3e[_0x9ad6('0x2c')](_0x346792)[_0x9ad6('0x2d')](_0x1a9497);}}});})[_0x9ad6('0x2a')](handleError(_0x1bce3e,null));};exports[_0x9ad6('0x3b')]=function(_0x333682,_0x29b8a2,_0xd867d4){var _0x25f5ba,_0x277a12,_0x2f336d;if(_[_0x9ad6('0xa0')](_0x333682['body'][_0x9ad6('0x59')])||_0x333682[_0x9ad6('0x59')][_0x9ad6('0x59')]===''){throw new db[(_0x9ad6('0xa1'))]['ValidationError'](_0x9ad6('0xc0'));}if(_['isNil'](_0x333682[_0x9ad6('0x59')]['to'])){throw new db[(_0x9ad6('0xa1'))][(_0x9ad6('0x90'))]('to\x20is\x20mandatory');}_0x25f5ba=_0x333682[_0x9ad6('0x59')]['to'];return db['WhatsappAccount'][_0x9ad6('0x63')]({'where':{'id':_0x333682[_0x9ad6('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0x9ad6('0xc1'),'include':[{'model':db['CmContact'],'as':_0x9ad6('0xa8'),'where':{'mobile':_0x25f5ba},'limit':0x1,'order':[[_0x9ad6('0x94'),_0x9ad6('0xa6')]]}]}]})[_0x9ad6('0x21')](handleEntityNotFound(_0x29b8a2,null))[_0x9ad6('0x21')](function(_0x573592){if(_0x573592&&_0x573592[_0x9ad6('0xc1')]){_0x277a12=_0x573592['get']({'plain':!![]});if(_0x277a12[_0x9ad6('0xc1')]&&_0x277a12[_0x9ad6('0xc1')]['Contacts']['length']){return _0x277a12['List'][_0x9ad6('0xa8')][0x0];}return db[_0x9ad6('0x8f')]['create'](_[_0x9ad6('0x18')](_0x333682['body'],{'firstName':_0x25f5ba,'mobile':_0x25f5ba,'phone':_0x25f5ba,'ListId':_0x277a12['ListId']}));}})[_0x9ad6('0x21')](handleEntityNotFound(_0x29b8a2,null))[_0x9ad6('0x21')](function(_0x1150af){if(_0x1150af){_0x2f336d=_0x1150af;return db['WhatsappInteraction'][_0x9ad6('0x63')]({'where':{'ContactId':_0x2f336d['id'],'closed':![],'WhatsappAccountId':_0x277a12['id']}})[_0x9ad6('0x21')](function(_0x3f2136){if(_0x3f2136){return[_0x3f2136,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x333682['user']['id'],'ContactId':_0x2f336d['id'],'WhatsappAccountId':_0x277a12['id'],'phone':_0x25f5ba,'firstMsgDirection':_0x9ad6('0xc2'),'Messages':[_[_0x9ad6('0x4e')](_0x333682[_0x9ad6('0x59')],{'read':![],'body':_0x333682[_0x9ad6('0x59')]['body'],'phone':_0x25f5ba,'WhatsappAccountId':_0x277a12['id'],'UserId':_0x333682[_0x9ad6('0x5c')]['id'],'ContactId':_0x2f336d['id']})]},{'include':[{'model':db[_0x9ad6('0xb2')],'as':_0x9ad6('0xc3')}]})[_0x9ad6('0x21')](function(_0x35fdf8){return[_0x35fdf8,!![]];});});}})[_0x9ad6('0xab')](function(_0x148eae,_0x14ab2f){if(_0x14ab2f){return _0x148eae;}return db[_0x9ad6('0xb2')][_0x9ad6('0x58')](_[_0x9ad6('0x4e')](_0x333682[_0x9ad6('0x59')],{'read':![],'body':_0x333682[_0x9ad6('0x59')][_0x9ad6('0x59')],'phone':_0x25f5ba,'WhatsappAccountId':_0x277a12['id'],'WhatsappInteractionId':_0x148eae['id'],'UserId':_0x333682['user']['id'],'ContactId':_0x2f336d['id']}))[_0x9ad6('0x21')](function(_0x44b4cf){_0x148eae[_0x9ad6('0xc4')][_0x9ad6('0xc3')]=[];_0x148eae[_0x9ad6('0xc4')][_0x9ad6('0xc3')][_0x9ad6('0xaf')](_0x44b4cf[_0x9ad6('0xc4')]);return _0x148eae;});})[_0x9ad6('0x21')](respondWithResult(_0x29b8a2,null))[_0x9ad6('0x2a')](handleError(_0x29b8a2,null));}; \ No newline at end of file +var _0x68af=['body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','AttachmentId','User','unshift','agent','startRouting','Start','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','List','out','Messages','dataValues','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','update','destroy','get','WhatsappAccounts','stack','name','Pause','mandatoryDispositionPause','map','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','options','WhatsappAccount','includeAll','include','findAll','rows','params','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','body','describe','getDispositions','findOne','Disposition','order','addAnswer','WhatsappAccountId','CannedAnswer','getAnswers','nolimit','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','priority','finally','send','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','applications','orderBy','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','from','From','replace','whatsapp:','messageId','MessageSid','notifications','message_id','isNil','ValidationError','from\x20is\x20mandatory'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x68af,0x18e));var _0xf68a=function(_0x2606d9,_0x9cef68){_0x2606d9=_0x2606d9-0x0;var _0x4ad6c6=_0x68af[_0x2606d9];return _0x4ad6c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf68a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf68a('0x1'));var rp=require(_0xf68a('0x2'));var moment=require(_0xf68a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf68a('0x4'));var path=require('path');var sox=require(_0xf68a('0x5'));var csv=require(_0xf68a('0x6'));var ejs=require(_0xf68a('0x7'));var fs=require('fs');var fs_extra=require(_0xf68a('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf68a('0x9'));var deskjs=require(_0xf68a('0xa'));var toCsv=require('to-csv');var querystring=require(_0xf68a('0xb'));var Papa=require(_0xf68a('0xc'));var Redis=require(_0xf68a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xf68a('0xe'));var as=require(_0xf68a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf68a('0x10'))['db'];config['redis']=_[_0xf68a('0x11')](config['redis'],{'host':_0xf68a('0x12'),'port':0x18eb});var socket=require(_0xf68a('0x13'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0xf68a('0x14')](socket);var jayson=require(_0xf68a('0x15'));var client=jayson[_0xf68a('0x16')][_0xf68a('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x3c8e19,_0x164ba7,_0x331291,_0x22f5fc){return new BPromise(function(_0x41130d,_0x42fa80){var _0x29c5b1=_0x22f5fc||client;return _0x29c5b1['request'](_0x3c8e19,_0x331291)[_0xf68a('0x18')](function(_0x14ce79){logger[_0xf68a('0x19')](_0xf68a('0x1a'),_0x164ba7,_0xf68a('0x1b'));logger[_0xf68a('0x1c')](_0xf68a('0x1d'),_0x164ba7,_0xf68a('0x1b'),JSON[_0xf68a('0x1e')](_0x14ce79));if(_0x14ce79[_0xf68a('0x1f')]){if(_0x14ce79[_0xf68a('0x1f')][_0xf68a('0x20')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x164ba7,_0x14ce79[_0xf68a('0x1f')]['message']);return _0x42fa80(_0x14ce79['error'][_0xf68a('0x21')]);}logger[_0xf68a('0x1f')](_0xf68a('0x1a'),_0x164ba7,_0x14ce79['error']['message']);return _0x41130d(_0x14ce79['error'][_0xf68a('0x21')]);}else{logger[_0xf68a('0x19')](_0xf68a('0x1a'),_0x164ba7,_0xf68a('0x1b'));_0x41130d(_0x14ce79[_0xf68a('0x22')][_0xf68a('0x21')]);}})[_0xf68a('0x23')](function(_0x1c0350){logger[_0xf68a('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x164ba7,_0x1c0350);_0x42fa80(_0x1c0350);});});}function respondWithStatusCode(_0x11a4cd,_0x3f9601){_0x3f9601=_0x3f9601||0xcc;return function(_0x50605b){if(_0x50605b){return _0x11a4cd[_0xf68a('0x24')](_0x3f9601);}return _0x11a4cd[_0xf68a('0x25')](_0x3f9601)[_0xf68a('0x26')]();};}function respondWithResult(_0xfea3ec,_0x25020c){_0x25020c=_0x25020c||0xc8;return function(_0x1dccb8){if(_0x1dccb8){return _0xfea3ec['status'](_0x25020c)[_0xf68a('0x27')](_0x1dccb8);}};}function respondWithFilteredResult(_0x1c6121,_0x3e672e){return function(_0x362fc9){if(_0x362fc9){var _0x4dfeb6=typeof _0x3e672e['offset']==='undefined'&&typeof _0x3e672e[_0xf68a('0x28')]===_0xf68a('0x29');var _0x150474=_0x362fc9[_0xf68a('0x2a')];var _0x578d26=_0x4dfeb6?0x0:_0x3e672e[_0xf68a('0x2b')];var _0x378bbe=_0x4dfeb6?_0x362fc9[_0xf68a('0x2a')]:_0x3e672e[_0xf68a('0x2b')]+_0x3e672e[_0xf68a('0x28')];var _0x2d2351;if(_0x378bbe>=_0x150474){_0x378bbe=_0x150474;_0x2d2351=0xc8;}else{_0x2d2351=0xce;}_0x1c6121[_0xf68a('0x25')](_0x2d2351);return _0x1c6121['set'](_0xf68a('0x2c'),_0x578d26+'-'+_0x378bbe+'/'+_0x150474)['json'](_0x362fc9);}return null;};}function patchUpdates(_0x586648){return function(_0x2a1ea6){try{jsonpatch[_0xf68a('0x2d')](_0x2a1ea6,_0x586648,!![]);}catch(_0x39b263){return BPromise['reject'](_0x39b263);}return _0x2a1ea6['save']();};}function saveUpdates(_0x33dcdd,_0xcf3c31){return function(_0x4f16b1){if(_0x4f16b1){return _0x4f16b1[_0xf68a('0x2e')](_0x33dcdd)[_0xf68a('0x18')](function(_0x2bbeb0){return _0x2bbeb0;});}return null;};}function removeEntity(_0x564772,_0x2110ca){return function(_0x418e05){if(_0x418e05){return _0x418e05[_0xf68a('0x2f')]()[_0xf68a('0x18')](function(){var _0x2b9173=_0x418e05[_0xf68a('0x30')]({'plain':!![]});var _0x3158a2=_0xf68a('0x31');return db['UserProfileResource'][_0xf68a('0x2f')]({'where':{'type':_0x3158a2,'resourceId':_0x2b9173['id']}})[_0xf68a('0x18')](function(){return _0x418e05;});})[_0xf68a('0x18')](function(){_0x564772[_0xf68a('0x25')](0xcc)[_0xf68a('0x26')]();});}};}function handleEntityNotFound(_0x50b8d9,_0x1c68c3){return function(_0x4f3c27){if(!_0x4f3c27){_0x50b8d9['sendStatus'](0x194);}return _0x4f3c27;};}function handleError(_0x529523,_0xb1208){_0xb1208=_0xb1208||0x1f4;return function(_0x48bbf2){logger[_0xf68a('0x1f')](_0x48bbf2[_0xf68a('0x32')]);if(_0x48bbf2[_0xf68a('0x33')]){delete _0x48bbf2[_0xf68a('0x33')];}_0x529523[_0xf68a('0x25')](_0xb1208)['send'](_0x48bbf2);};}exports['index']=function(_0x37119a,_0x1ee50){var _0x3f7340={'include':[{'model':db[_0xf68a('0x34')],'as':_0xf68a('0x35')}]},_0x3e7400={},_0x4e25c8={'count':0x0,'rows':[]};var _0x22b927=_[_0xf68a('0x36')](db['WhatsappAccount'][_0xf68a('0x37')],function(_0x2da21e){return{'name':_0x2da21e['fieldName'],'type':_0x2da21e[_0xf68a('0x38')]['key']};});_0x3e7400[_0xf68a('0x39')]=_[_0xf68a('0x36')](_0x22b927,'name');_0x3e7400[_0xf68a('0x3a')]=_[_0xf68a('0x3b')](_0x37119a[_0xf68a('0x3a')]);_0x3e7400[_0xf68a('0x3c')]=_[_0xf68a('0x3d')](_0x3e7400[_0xf68a('0x39')],_0x3e7400[_0xf68a('0x3a')]);_0x3f7340['attributes']=_[_0xf68a('0x3d')](_0x3e7400[_0xf68a('0x39')],qs[_0xf68a('0x3e')](_0x37119a[_0xf68a('0x3a')]['fields']));_0x3f7340[_0xf68a('0x3f')]=_0x3f7340[_0xf68a('0x3f')][_0xf68a('0x40')]?_0x3f7340[_0xf68a('0x3f')]:_0x3e7400['model'];if(!_0x37119a[_0xf68a('0x3a')][_0xf68a('0x41')]('nolimit')){_0x3f7340[_0xf68a('0x28')]=qs['limit'](_0x37119a[_0xf68a('0x3a')][_0xf68a('0x28')]);_0x3f7340[_0xf68a('0x2b')]=qs[_0xf68a('0x2b')](_0x37119a[_0xf68a('0x3a')][_0xf68a('0x2b')]);}_0x3f7340['order']=qs[_0xf68a('0x42')](_0x37119a[_0xf68a('0x3a')][_0xf68a('0x42')]);_0x3f7340[_0xf68a('0x43')]=qs['filters'](_[_0xf68a('0x44')](_0x37119a['query'],_0x3e7400[_0xf68a('0x3c')]),_0x22b927);if(_0x37119a['query']['filter']){_0x3f7340['where']=_['merge'](_0x3f7340['where'],{'$or':_[_0xf68a('0x36')](_0x22b927,function(_0x461ef5){if(_0x461ef5[_0xf68a('0x38')]!==_0xf68a('0x45')){var _0x595fec={};_0x595fec[_0x461ef5[_0xf68a('0x33')]]={'$like':'%'+_0x37119a[_0xf68a('0x3a')][_0xf68a('0x46')]+'%'};return _0x595fec;}})});}_0x3f7340=_['merge']({},_0x3f7340,_0x37119a[_0xf68a('0x47')]);var _0x2d2efe={'where':_0x3f7340['where']};return db[_0xf68a('0x48')][_0xf68a('0x2a')](_0x2d2efe)[_0xf68a('0x18')](function(_0x41470f){_0x4e25c8[_0xf68a('0x2a')]=_0x41470f;if(_0x37119a['query'][_0xf68a('0x49')]){_0x3f7340[_0xf68a('0x4a')]=[{'all':!![]}];}return db[_0xf68a('0x48')][_0xf68a('0x4b')](_0x3f7340);})[_0xf68a('0x18')](function(_0xe03e29){_0x4e25c8[_0xf68a('0x4c')]=_0xe03e29;return _0x4e25c8;})[_0xf68a('0x18')](respondWithFilteredResult(_0x1ee50,_0x3f7340))[_0xf68a('0x23')](handleError(_0x1ee50,null));};exports['show']=function(_0x148c23,_0x2784f7){var _0x368a26={'raw':![],'where':{'id':_0x148c23[_0xf68a('0x4d')]['id']},'include':[{'model':db[_0xf68a('0x34')],'as':_0xf68a('0x35')}]},_0x49611c={};_0x49611c['model']=_['keys'](db[_0xf68a('0x48')]['rawAttributes']);_0x49611c['query']=_[_0xf68a('0x3b')](_0x148c23['query']);_0x49611c[_0xf68a('0x3c')]=_[_0xf68a('0x3d')](_0x49611c['model'],_0x49611c[_0xf68a('0x3a')]);_0x368a26['attributes']=_[_0xf68a('0x3d')](_0x49611c[_0xf68a('0x39')],qs[_0xf68a('0x3e')](_0x148c23[_0xf68a('0x3a')][_0xf68a('0x3e')]));_0x368a26[_0xf68a('0x3f')]=_0x368a26[_0xf68a('0x3f')][_0xf68a('0x40')]?_0x368a26[_0xf68a('0x3f')]:_0x49611c[_0xf68a('0x39')];if(_0x148c23[_0xf68a('0x3a')]['includeAll']){_0x368a26[_0xf68a('0x4a')]=[{'all':!![]}];}_0x368a26=_[_0xf68a('0x4e')]({},_0x368a26,_0x148c23[_0xf68a('0x47')]);return db[_0xf68a('0x48')][_0xf68a('0x4f')](_0x368a26)[_0xf68a('0x18')](handleEntityNotFound(_0x2784f7,null))['then'](respondWithResult(_0x2784f7,null))[_0xf68a('0x23')](handleError(_0x2784f7,null));};exports[_0xf68a('0x50')]=function(_0xd8af37,_0x13d6df){return db[_0xf68a('0x48')]['create'](_0xd8af37['body'],{})[_0xf68a('0x18')](function(_0xfc5336){var _0x44ee67=_0xd8af37['user'][_0xf68a('0x30')]({'plain':!![]});if(!_0x44ee67)throw new Error(_0xf68a('0x51'));if(_0x44ee67[_0xf68a('0x52')]===_0xf68a('0x53')){var _0xe32e28=_0xfc5336['get']({'plain':!![]});var _0x35bc79='WhatsappAccounts';return db[_0xf68a('0x54')][_0xf68a('0x4f')]({'where':{'name':_0x35bc79,'userProfileId':_0x44ee67['userProfileId']},'raw':!![]})[_0xf68a('0x18')](function(_0x520b9b){if(_0x520b9b&&_0x520b9b[_0xf68a('0x55')]===0x0){return db[_0xf68a('0x56')]['create']({'name':_0xe32e28['name'],'resourceId':_0xe32e28['id'],'type':_0x520b9b['name'],'sectionId':_0x520b9b['id']},{})['then'](function(){return _0xfc5336;});}else{return _0xfc5336;}})['catch'](function(_0x446da8){logger[_0xf68a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x446da8);throw _0x446da8;});}return _0xfc5336;})[_0xf68a('0x18')](respondWithResult(_0x13d6df,0xc9))[_0xf68a('0x23')](handleError(_0x13d6df,null));};exports[_0xf68a('0x2e')]=function(_0x5aa01b,_0x5b35b1){if(_0x5aa01b[_0xf68a('0x57')]['id']){delete _0x5aa01b[_0xf68a('0x57')]['id'];}return db[_0xf68a('0x48')][_0xf68a('0x4f')]({'where':{'id':_0x5aa01b[_0xf68a('0x4d')]['id']},'include':[{'model':db[_0xf68a('0x34')],'as':'mandatoryDispositionPause'}]})[_0xf68a('0x18')](handleEntityNotFound(_0x5b35b1,null))[_0xf68a('0x18')](saveUpdates(_0x5aa01b[_0xf68a('0x57')],null))[_0xf68a('0x18')](respondWithResult(_0x5b35b1,null))[_0xf68a('0x23')](handleError(_0x5b35b1,null));};exports[_0xf68a('0x2f')]=function(_0x49fd43,_0x1c47a5){return db[_0xf68a('0x48')][_0xf68a('0x4f')]({'where':{'id':_0x49fd43[_0xf68a('0x4d')]['id']}})[_0xf68a('0x18')](handleEntityNotFound(_0x1c47a5,null))['then'](removeEntity(_0x1c47a5,null))[_0xf68a('0x23')](handleError(_0x1c47a5,null));};exports[_0xf68a('0x58')]=function(_0x159930,_0x536977){return db[_0xf68a('0x48')][_0xf68a('0x58')]()[_0xf68a('0x18')](respondWithResult(_0x536977,null))[_0xf68a('0x23')](handleError(_0x536977,null));};exports['addDisposition']=function(_0xea48e1,_0x5793ea,_0x15cc9e){if(_0xea48e1[_0xf68a('0x57')]['id']){delete _0xea48e1[_0xf68a('0x57')]['id'];}return db[_0xf68a('0x48')][_0xf68a('0x4f')]({'where':{'id':_0xea48e1[_0xf68a('0x4d')]['id']}})[_0xf68a('0x18')](handleEntityNotFound(_0x5793ea,null))[_0xf68a('0x18')](function(_0x2d4389){if(_0x2d4389){_0xea48e1[_0xf68a('0x57')]['WhatsappAccountId']=_0x2d4389['id'];return db['Disposition'][_0xf68a('0x50')](_0xea48e1[_0xf68a('0x57')]);}})['then'](respondWithResult(_0x5793ea,null))[_0xf68a('0x23')](handleError(_0x5793ea,null));};exports[_0xf68a('0x59')]=function(_0x5185d9,_0x1122bf,_0x538f50){var _0xc8420={'raw':![],'where':{}};var _0xb3d9a1={};var _0x48f089={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xf68a('0x5a')]({'where':{'id':_0x5185d9[_0xf68a('0x4d')]['id']}})[_0xf68a('0x18')](handleEntityNotFound(_0x1122bf,null))[_0xf68a('0x18')](function(_0x3873e7){if(_0x3873e7){_0xb3d9a1[_0xf68a('0x39')]=_[_0xf68a('0x3b')](db[_0xf68a('0x5b')][_0xf68a('0x37')]);_0xb3d9a1[_0xf68a('0x3a')]=_[_0xf68a('0x3b')](_0x5185d9[_0xf68a('0x3a')]);_0xb3d9a1['filters']=_[_0xf68a('0x3d')](_0xb3d9a1[_0xf68a('0x39')],_0xb3d9a1['query']);_0xc8420[_0xf68a('0x3f')]=_['intersection'](_0xb3d9a1[_0xf68a('0x39')],qs['fields'](_0x5185d9[_0xf68a('0x3a')][_0xf68a('0x3e')]));_0xc8420[_0xf68a('0x3f')]=_0xc8420[_0xf68a('0x3f')][_0xf68a('0x40')]?_0xc8420[_0xf68a('0x3f')]:_0xb3d9a1['model'];if(!_0x5185d9['query'][_0xf68a('0x41')]('nolimit')){_0xc8420[_0xf68a('0x28')]=qs[_0xf68a('0x28')](_0x5185d9['query'][_0xf68a('0x28')]);_0xc8420[_0xf68a('0x2b')]=qs[_0xf68a('0x2b')](_0x5185d9[_0xf68a('0x3a')][_0xf68a('0x2b')]);}_0xc8420[_0xf68a('0x5c')]=qs[_0xf68a('0x42')](_0x5185d9[_0xf68a('0x3a')][_0xf68a('0x42')]);_0xc8420[_0xf68a('0x43')]=qs[_0xf68a('0x3c')](_['pick'](_0x5185d9[_0xf68a('0x3a')],_0xb3d9a1[_0xf68a('0x3c')]));_0xc8420['where']['WhatsappAccountId']=_0x3873e7['id'];if(_0x5185d9[_0xf68a('0x3a')]['filter']){_0xc8420[_0xf68a('0x43')]=_['merge'](_0xc8420[_0xf68a('0x43')],{'$or':_['map'](_0xc8420[_0xf68a('0x3f')],function(_0x4a23a1){var _0x1c9ecf={};_0x1c9ecf[_0x4a23a1]={'$like':'%'+_0x5185d9['query']['filter']+'%'};return _0x1c9ecf;})});}_0xc8420=_[_0xf68a('0x4e')]({},_0xc8420,_0x5185d9[_0xf68a('0x47')]);return db[_0xf68a('0x5b')][_0xf68a('0x2a')]({'where':_0xc8420[_0xf68a('0x43')]})[_0xf68a('0x18')](function(_0x28fbcb){_0x48f089['count']=_0x28fbcb;if(_0x5185d9['query']['includeAll']){_0xc8420[_0xf68a('0x4a')]=[{'all':!![]}];}return db[_0xf68a('0x5b')][_0xf68a('0x4b')](_0xc8420);})[_0xf68a('0x18')](function(_0x4bcfd8){_0x48f089[_0xf68a('0x4c')]=_0x4bcfd8;return _0x48f089;});}})['then'](respondWithFilteredResult(_0x1122bf,_0xc8420))[_0xf68a('0x23')](handleError(_0x1122bf,null));};exports['removeDispositions']=function(_0x5af8e4,_0x3fd750,_0x5eab72){return db['WhatsappAccount']['find']({'where':{'id':_0x5af8e4[_0xf68a('0x4d')]['id']}})[_0xf68a('0x18')](handleEntityNotFound(_0x3fd750,null))['then'](function(_0x41c072){if(_0x41c072){return _0x41c072['removeDispositions'](_0x5af8e4[_0xf68a('0x3a')]['ids']);}})[_0xf68a('0x18')](respondWithStatusCode(_0x3fd750,null))[_0xf68a('0x23')](handleError(_0x3fd750,null));};exports[_0xf68a('0x5d')]=function(_0x1d01b8,_0x42360b,_0x5a742a){if(_0x1d01b8[_0xf68a('0x57')]['id']){delete _0x1d01b8['body']['id'];}return db[_0xf68a('0x48')]['find']({'where':{'id':_0x1d01b8[_0xf68a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x42360b,null))[_0xf68a('0x18')](function(_0x498415){if(_0x498415){_0x1d01b8['body'][_0xf68a('0x5e')]=_0x498415['id'];return db[_0xf68a('0x5f')]['create'](_0x1d01b8[_0xf68a('0x57')]);}})['then'](respondWithResult(_0x42360b,null))[_0xf68a('0x23')](handleError(_0x42360b,null));};exports[_0xf68a('0x60')]=function(_0x2656c1,_0x159647,_0x231351){var _0x29f227={'raw':![],'where':{}};var _0x3e82ce={};var _0x401998={'count':0x0,'rows':[]};return db[_0xf68a('0x48')][_0xf68a('0x5a')]({'where':{'id':_0x2656c1[_0xf68a('0x4d')]['id']}})[_0xf68a('0x18')](handleEntityNotFound(_0x159647,null))[_0xf68a('0x18')](function(_0x2fea38){if(_0x2fea38){_0x3e82ce[_0xf68a('0x39')]=_[_0xf68a('0x3b')](db[_0xf68a('0x5f')][_0xf68a('0x37')]);_0x3e82ce['query']=_[_0xf68a('0x3b')](_0x2656c1[_0xf68a('0x3a')]);_0x3e82ce[_0xf68a('0x3c')]=_[_0xf68a('0x3d')](_0x3e82ce[_0xf68a('0x39')],_0x3e82ce[_0xf68a('0x3a')]);_0x29f227[_0xf68a('0x3f')]=_[_0xf68a('0x3d')](_0x3e82ce['model'],qs[_0xf68a('0x3e')](_0x2656c1[_0xf68a('0x3a')]['fields']));_0x29f227['attributes']=_0x29f227['attributes']['length']?_0x29f227[_0xf68a('0x3f')]:_0x3e82ce['model'];if(!_0x2656c1[_0xf68a('0x3a')][_0xf68a('0x41')](_0xf68a('0x61'))){_0x29f227[_0xf68a('0x28')]=qs[_0xf68a('0x28')](_0x2656c1[_0xf68a('0x3a')][_0xf68a('0x28')]);_0x29f227['offset']=qs[_0xf68a('0x2b')](_0x2656c1['query'][_0xf68a('0x2b')]);}_0x29f227[_0xf68a('0x5c')]=qs[_0xf68a('0x42')](_0x2656c1[_0xf68a('0x3a')][_0xf68a('0x42')]);_0x29f227[_0xf68a('0x43')]=qs[_0xf68a('0x3c')](_[_0xf68a('0x44')](_0x2656c1[_0xf68a('0x3a')],_0x3e82ce[_0xf68a('0x3c')]));_0x29f227['where']['WhatsappAccountId']=_0x2fea38['id'];if(_0x2656c1['query']['filter']){_0x29f227[_0xf68a('0x43')]=_[_0xf68a('0x4e')](_0x29f227[_0xf68a('0x43')],{'$or':_['map'](_0x29f227['attributes'],function(_0x1413c8){var _0x461390={};_0x461390[_0x1413c8]={'$like':'%'+_0x2656c1[_0xf68a('0x3a')][_0xf68a('0x46')]+'%'};return _0x461390;})});}_0x29f227=_[_0xf68a('0x4e')]({},_0x29f227,_0x2656c1[_0xf68a('0x47')]);return db[_0xf68a('0x5f')]['count']({'where':_0x29f227[_0xf68a('0x43')]})[_0xf68a('0x18')](function(_0x21ea3f){_0x401998[_0xf68a('0x2a')]=_0x21ea3f;if(_0x2656c1[_0xf68a('0x3a')][_0xf68a('0x49')]){_0x29f227[_0xf68a('0x4a')]=[{'all':!![]}];}return db[_0xf68a('0x5f')][_0xf68a('0x4b')](_0x29f227);})['then'](function(_0x13e764){_0x401998[_0xf68a('0x4c')]=_0x13e764;return _0x401998;});}})[_0xf68a('0x18')](respondWithFilteredResult(_0x159647,_0x29f227))[_0xf68a('0x23')](handleError(_0x159647,null));};exports[_0xf68a('0x62')]=function(_0x208f97,_0x32fcdd,_0xa68235){return db[_0xf68a('0x48')][_0xf68a('0x4f')]({'where':{'id':_0x208f97[_0xf68a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x32fcdd,null))[_0xf68a('0x18')](function(_0x573e11){if(_0x573e11){return _0x573e11['removeAnswers'](_0x208f97['query'][_0xf68a('0x63')]);}})['then'](respondWithStatusCode(_0x32fcdd,null))['catch'](handleError(_0x32fcdd,null));};exports['addAgents']=function(_0x49bdcf,_0xcbd2b2,_0x16aee6){return db[_0xf68a('0x48')][_0xf68a('0x4f')]({'where':{'id':_0x49bdcf['params']['id']}})[_0xf68a('0x18')](handleEntityNotFound(_0xcbd2b2,null))[_0xf68a('0x18')](function(_0x2579ac){if(_0x2579ac){return _0x2579ac[_0xf68a('0x64')](_0x49bdcf[_0xf68a('0x57')]['ids'],_[_0xf68a('0x65')](_0x49bdcf[_0xf68a('0x57')],['ids','id'])||{})[_0xf68a('0x66')](function(_0x928ba5){for(var _0x44767e=0x0;_0x44767e<_0x49bdcf[_0xf68a('0x57')][_0xf68a('0x63')]['length'];_0x44767e+=0x1){socket[_0xf68a('0x67')](_0xf68a('0x68'),{'UserId':Number(_0x49bdcf[_0xf68a('0x57')][_0xf68a('0x63')][_0x44767e]),'WhatsappAccountId':Number(_0x49bdcf['params']['id'])});}return _0x928ba5;});}})['then'](respondWithResult(_0xcbd2b2,null))[_0xf68a('0x23')](handleError(_0xcbd2b2,null));};exports[_0xf68a('0x69')]=function(_0x51bc2f,_0x39a726,_0x10c116){return db['WhatsappAccount'][_0xf68a('0x4f')]({'where':{'id':_0x51bc2f[_0xf68a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x39a726,null))[_0xf68a('0x18')](function(_0x470b47){if(_0x470b47){return _0x470b47[_0xf68a('0x69')](_0x51bc2f[_0xf68a('0x3a')][_0xf68a('0x63')])[_0xf68a('0x18')](function(){if(_[_0xf68a('0x6a')](_0x51bc2f['query'][_0xf68a('0x63')])){for(var _0x1b57f4=0x0;_0x1b57f4<_0x51bc2f[_0xf68a('0x3a')][_0xf68a('0x63')][_0xf68a('0x40')];_0x1b57f4+=0x1){socket[_0xf68a('0x67')](_0xf68a('0x6b'),{'UserId':Number(_0x51bc2f[_0xf68a('0x3a')]['ids'][_0x1b57f4]),'WhatsappAccountId':Number(_0x51bc2f['params']['id'])});}}else{socket[_0xf68a('0x67')](_0xf68a('0x6b'),{'UserId':Number(_0x51bc2f[_0xf68a('0x3a')][_0xf68a('0x63')]),'WhatsappAccountId':Number(_0x51bc2f[_0xf68a('0x4d')]['id'])});}});}})[_0xf68a('0x18')](respondWithStatusCode(_0x39a726,null))[_0xf68a('0x23')](handleError(_0x39a726,null));};exports[_0xf68a('0x6c')]=function(_0x4a0ebb,_0x1e3d26,_0x129803){var _0x30207f={};var _0x26b283={};var _0x3f77c7;var _0x2ad37f;return db[_0xf68a('0x48')][_0xf68a('0x5a')]({'where':{'id':_0x4a0ebb['params']['id']}})[_0xf68a('0x18')](handleEntityNotFound(_0x1e3d26,null))['then'](function(_0x637671){if(_0x637671){_0x3f77c7=_0x637671;_0x26b283[_0xf68a('0x39')]=_[_0xf68a('0x3b')](db['User'][_0xf68a('0x37')]);_0x26b283['query']=_[_0xf68a('0x3b')](_0x4a0ebb[_0xf68a('0x3a')]);_0x26b283[_0xf68a('0x3c')]=_[_0xf68a('0x3d')](_0x26b283['model'],_0x26b283[_0xf68a('0x3a')]);_0x30207f['attributes']=_[_0xf68a('0x3d')](_0x26b283[_0xf68a('0x39')],qs[_0xf68a('0x3e')](_0x4a0ebb['query'][_0xf68a('0x3e')]));_0x30207f['attributes']=_0x30207f[_0xf68a('0x3f')][_0xf68a('0x40')]?_0x30207f[_0xf68a('0x3f')]:_0x26b283[_0xf68a('0x39')];_0x30207f[_0xf68a('0x5c')]=qs[_0xf68a('0x42')](_0x4a0ebb[_0xf68a('0x3a')][_0xf68a('0x42')]);_0x30207f[_0xf68a('0x43')]=qs[_0xf68a('0x3c')](_[_0xf68a('0x44')](_0x4a0ebb[_0xf68a('0x3a')],_0x26b283[_0xf68a('0x3c')]));if(_0x4a0ebb[_0xf68a('0x3a')][_0xf68a('0x46')]){_0x30207f['where']=_[_0xf68a('0x4e')](_0x30207f['where'],{'$or':_[_0xf68a('0x36')](_0x30207f[_0xf68a('0x3f')],function(_0x50f66b){var _0x13a626={};_0x13a626[_0x50f66b]={'$like':'%'+_0x4a0ebb[_0xf68a('0x3a')][_0xf68a('0x46')]+'%'};return _0x13a626;})});}_0x30207f=_[_0xf68a('0x4e')]({},_0x30207f,_0x4a0ebb[_0xf68a('0x47')]);return _0x3f77c7[_0xf68a('0x6c')](_0x30207f);}})[_0xf68a('0x18')](function(_0x2de2fc){if(_0x2de2fc){_0x2ad37f=_0x2de2fc[_0xf68a('0x40')];if(!_0x4a0ebb[_0xf68a('0x3a')][_0xf68a('0x41')](_0xf68a('0x61'))){_0x30207f[_0xf68a('0x28')]=qs['limit'](_0x4a0ebb[_0xf68a('0x3a')][_0xf68a('0x28')]);_0x30207f[_0xf68a('0x2b')]=qs[_0xf68a('0x2b')](_0x4a0ebb[_0xf68a('0x3a')][_0xf68a('0x2b')]);}return _0x3f77c7['getAgents'](_0x30207f);}})[_0xf68a('0x18')](function(_0x19725b){if(_0x19725b){return _0x19725b?{'count':_0x2ad37f,'rows':_0x19725b}:null;}})[_0xf68a('0x18')](respondWithResult(_0x1e3d26,null))[_0xf68a('0x23')](handleError(_0x1e3d26,null));};exports[_0xf68a('0x6d')]=function(_0x12a79f,_0x5c5cc7){var _0x6ae636=_0x12a79f[_0xf68a('0x4d')]['id'];var _0x190a21=_0x12a79f[_0xf68a('0x57')];var _0x2d429e=0xc8;var _0x349302=null;return db[_0xf68a('0x6e')][_0xf68a('0x6f')]({'isolationLevel':db['sequelize'][_0xf68a('0x70')][_0xf68a('0x71')][_0xf68a('0x72')]},function(_0x2126f8){return db[_0xf68a('0x48')][_0xf68a('0x5a')]({'where':{'id':_0x6ae636},'transaction':_0x2126f8})[_0xf68a('0x18')](function(_0x300525){if(_0x300525){return db[_0xf68a('0x73')]['destroy']({'where':{'WhatsappAccountId':_0x6ae636},'transaction':_0x2126f8})[_0xf68a('0x18')](function(){var _0x4aa60e=_['map'](_0x190a21,function(_0x54518e){_0x54518e[_0xf68a('0x5e')]=_0x6ae636;return _0x54518e;});return db[_0xf68a('0x73')]['bulkCreate'](_0x4aa60e,{'transaction':_0x2126f8});});}else{_0x2d429e=0x194;_0x349302=[];}});})[_0xf68a('0x18')](function(){if(_0x2d429e!==0x194){return db[_0xf68a('0x73')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x6ae636},'order':_0xf68a('0x74')})[_0xf68a('0x18')](function(_0x544665){_0x349302=_0x544665;});}})[_0xf68a('0x23')](function(_0x2182eb){_0x2d429e=0x1f4;logger[_0xf68a('0x1f')](_0x2182eb[_0xf68a('0x32')]);if(_0x2182eb[_0xf68a('0x33')]){delete _0x2182eb[_0xf68a('0x33')];}_0x349302=_0x2182eb;})[_0xf68a('0x75')](function(){if(_0x349302===null){_0x5c5cc7[_0xf68a('0x24')](_0x2d429e);}else{if(_0x2d429e===0x1f4){_0x5c5cc7['status'](_0x2d429e)[_0xf68a('0x76')](_0x349302);}else{_0x5c5cc7[_0xf68a('0x25')](_0x2d429e)[_0xf68a('0x27')](_0x349302);}}});};exports['getApplications']=function(_0x334bb8,_0x5a6823,_0x3ae52f){var _0x5de538={};var _0x37788b={};var _0x5328cc;var _0x497932;return db[_0xf68a('0x48')][_0xf68a('0x5a')]({'where':{'id':_0x334bb8['params']['id']}})[_0xf68a('0x18')](handleEntityNotFound(_0x5a6823,null))['then'](function(_0x41a74c){if(_0x41a74c){_0x5328cc=_0x41a74c;_0x37788b[_0xf68a('0x39')]=_[_0xf68a('0x3b')](db[_0xf68a('0x73')]['rawAttributes']);_0x37788b['query']=_['keys'](_0x334bb8[_0xf68a('0x3a')]);_0x37788b[_0xf68a('0x3c')]=_[_0xf68a('0x3d')](_0x37788b[_0xf68a('0x39')],_0x37788b['query']);_0x5de538[_0xf68a('0x3f')]=_['intersection'](_0x37788b[_0xf68a('0x39')],qs['fields'](_0x334bb8[_0xf68a('0x3a')][_0xf68a('0x3e')]));_0x5de538['attributes']=_0x5de538['attributes'][_0xf68a('0x40')]?_0x5de538[_0xf68a('0x3f')]:_0x37788b[_0xf68a('0x39')];_0x5de538[_0xf68a('0x5c')]=qs[_0xf68a('0x42')](_0x334bb8['query']['sort']);_0x5de538[_0xf68a('0x43')]=qs[_0xf68a('0x3c')](_[_0xf68a('0x44')](_0x334bb8['query'],_0x37788b[_0xf68a('0x3c')]));if(_0x334bb8[_0xf68a('0x3a')][_0xf68a('0x46')]){_0x5de538[_0xf68a('0x43')]=_[_0xf68a('0x4e')](_0x5de538[_0xf68a('0x43')],{'$or':_[_0xf68a('0x36')](_0x5de538['attributes'],function(_0x27ca1d){var _0x3c23d6={};_0x3c23d6[_0x27ca1d]={'$like':'%'+_0x334bb8[_0xf68a('0x3a')][_0xf68a('0x46')]+'%'};return _0x3c23d6;})});}_0x5de538=_[_0xf68a('0x4e')]({},_0x5de538,_0x334bb8[_0xf68a('0x47')]);return _0x5328cc[_0xf68a('0x77')](_0x5de538);}})[_0xf68a('0x18')](function(_0x20c64a){if(_0x20c64a){_0x497932=_0x20c64a[_0xf68a('0x40')];if(!_0x334bb8[_0xf68a('0x3a')][_0xf68a('0x41')](_0xf68a('0x61'))){_0x5de538[_0xf68a('0x28')]=qs['limit'](_0x334bb8[_0xf68a('0x3a')][_0xf68a('0x28')]);_0x5de538['offset']=qs[_0xf68a('0x2b')](_0x334bb8[_0xf68a('0x3a')][_0xf68a('0x2b')]);}return _0x5328cc[_0xf68a('0x77')](_0x5de538);}})[_0xf68a('0x18')](function(_0x4b223f){if(_0x4b223f){return _0x4b223f?{'count':_0x497932,'rows':_0x4b223f}:null;}})[_0xf68a('0x18')](respondWithResult(_0x5a6823,null))['catch'](handleError(_0x5a6823,null));};exports[_0xf68a('0x78')]=function(_0x166ff8,_0x4f3cab,_0x5b240f){var _0x6f6ed7={'channel':_0xf68a('0x79')};var _0x231347=[];var _0x353817=[];var _0x22bad0={};return db[_0xf68a('0x48')]['find']({'where':{'id':_0x166ff8[_0xf68a('0x4d')]['id']},'include':[{'model':db[_0xf68a('0x73')],'as':_0xf68a('0x7a')}]})[_0xf68a('0x18')](handleEntityNotFound(_0x4f3cab,null))[_0xf68a('0x18')](function(_0x54c753){_0x6f6ed7['account']=_0x54c753;if(_0x6f6ed7[_0xf68a('0x7b')]&&_0x6f6ed7['account'][_0xf68a('0x38')]===_0xf68a('0x7c')&&_0x166ff8['body'][_0xf68a('0x7d')]){if(_0x166ff8['body'][_0xf68a('0x7d')][_0xf68a('0x40')]===0x0)return;if(_0x166ff8[_0xf68a('0x57')][_0xf68a('0x7d')][0x0][_0xf68a('0x7e')]!=='read')return;return db[_0xf68a('0x7f')]['update']({'read':!![],'readAt':_0x166ff8[_0xf68a('0x57')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x166ff8[_0xf68a('0x57')][_0xf68a('0x7d')][0x0]['message_id']},'individualHooks':!![]})[_0xf68a('0x18')](function(_0x5f2bd7){return _0x4f3cab['status'](0xc8)['json'](_0x5f2bd7);});}_0x6f6ed7[_0xf68a('0x80')]=_[_0xf68a('0x81')](_0x54c753['Applications'],['priority'],['asc']);if(_0x6f6ed7[_0xf68a('0x7b')]['Applications']){delete _0x6f6ed7['account'][_0xf68a('0x7a')];}return db['CmContact']['describe']()[_0xf68a('0x18')](function(_0x38935e){if(!_0x38935e){throw new db[(_0xf68a('0x82'))]['ValidationError'](_0xf68a('0x83'));}_0x231347=_[_0xf68a('0x84')](_[_0xf68a('0x3b')](_0x38935e),[_0xf68a('0x85'),'updatedAt']);_0x353817=_['difference'](_[_0xf68a('0x3b')](_0x38935e),[_0xf68a('0x85'),_0xf68a('0x86'),'CompanyId',_0xf68a('0x87')]);_0x6f6ed7['body']={'mapKey':_0xf68a('0x88')};if(_0x6f6ed7[_0xf68a('0x7b')]&&_0x6f6ed7[_0xf68a('0x7b')][_0xf68a('0x38')]==='twilio'){_0x6f6ed7[_0xf68a('0x57')][_0xf68a('0x89')]=_0x166ff8[_0xf68a('0x57')][_0xf68a('0x8a')][_0xf68a('0x8b')](_0xf68a('0x8c'),'');_0x6f6ed7[_0xf68a('0x57')][_0xf68a('0x57')]=_0x166ff8[_0xf68a('0x57')]['Body'];_0x6f6ed7['body'][_0xf68a('0x8d')]=_0x166ff8['body'][_0xf68a('0x8e')];}if(_0x6f6ed7[_0xf68a('0x7b')]&&_0x6f6ed7[_0xf68a('0x7b')][_0xf68a('0x38')]===_0xf68a('0x7c')){_0x6f6ed7[_0xf68a('0x57')]['from']=_0x166ff8[_0xf68a('0x57')][_0xf68a('0x8f')][0x0]['from'];_0x6f6ed7[_0xf68a('0x57')][_0xf68a('0x57')]=_0x166ff8[_0xf68a('0x57')][_0xf68a('0x8f')][0x0][_0xf68a('0x21')][_0xf68a('0x57')];_0x6f6ed7[_0xf68a('0x57')][_0xf68a('0x8d')]=_0x166ff8[_0xf68a('0x57')][_0xf68a('0x8f')][0x0][_0xf68a('0x90')];}if(_0x6f6ed7[_0xf68a('0x57')]['id']){delete _0x6f6ed7[_0xf68a('0x57')]['id'];}if(_[_0xf68a('0x91')](_0x6f6ed7[_0xf68a('0x57')]['from'])){throw new db[(_0xf68a('0x82'))][(_0xf68a('0x92'))](_0xf68a('0x93'));}if(_[_0xf68a('0x91')](_0x6f6ed7[_0xf68a('0x57')][_0xf68a('0x57')])||_0x6f6ed7[_0xf68a('0x57')][_0xf68a('0x57')]===''){throw new db[(_0xf68a('0x82'))][(_0xf68a('0x92'))](_0xf68a('0x94'));}if(_[_0xf68a('0x91')](_0x6f6ed7['body'][_0xf68a('0x95')])){throw new db[(_0xf68a('0x82'))][(_0xf68a('0x92'))](_0xf68a('0x96')+_0x353817);}if(!_[_0xf68a('0x97')](_0x353817,_0x6f6ed7['body'][_0xf68a('0x95')])){throw new db[(_0xf68a('0x82'))]['ValidationError'](_0xf68a('0x98')+_0x353817);}_0x22bad0[_0x6f6ed7['body'][_0xf68a('0x95')]]=_0x6f6ed7[_0xf68a('0x57')]['from'];return db[_0xf68a('0x99')][_0xf68a('0x4f')]({'where':{'id':_0x6f6ed7[_0xf68a('0x7b')][_0xf68a('0x87')]},'include':[{'model':db[_0xf68a('0x9a')],'as':_0xf68a('0x9b'),'where':_0x22bad0,'limit':0x1,'order':[[_0xf68a('0x86'),_0xf68a('0x9c')]]}]});})[_0xf68a('0x18')](handleEntityNotFound(_0x4f3cab,null))[_0xf68a('0x18')](function(_0x4c9dea){if(_0x4c9dea){_0x6f6ed7[_0xf68a('0x9d')]=_['omit'](_0x4c9dea,['Contacts']);if(_0x4c9dea[_0xf68a('0x9b')][_0xf68a('0x40')]){return _0x4c9dea[_0xf68a('0x9b')][0x0];}var _0x1f4340=_[_0xf68a('0x11')](_0x6f6ed7[_0xf68a('0x57')],{'firstName':_0x6f6ed7[_0xf68a('0x57')][_0xf68a('0x89')],'ListId':_0x4c9dea['id']});_0x1f4340[_0x6f6ed7[_0xf68a('0x57')][_0xf68a('0x95')]]=_0x6f6ed7[_0xf68a('0x57')]['from'];return db['CmContact'][_0xf68a('0x50')](_0x1f4340,{'fields':_0x231347,'raw':!![]});}})[_0xf68a('0x18')](handleEntityNotFound(_0x4f3cab,null))[_0xf68a('0x18')](function(_0x38af86){if(_0x38af86){_0x6f6ed7[_0xf68a('0x9e')]=_0x38af86;var _0x57491b={'ContactId':_0x38af86['id'],'phone':_0x6f6ed7[_0xf68a('0x57')][_0xf68a('0x89')],'WhatsappAccountId':_0x166ff8[_0xf68a('0x4d')]['id']};var _0x3a5ac7={'ContactId':_0x38af86['id'],'WhatsappAccountId':_0x166ff8['params']['id'],'closed':![]};return db[_0xf68a('0x9f')][_0xf68a('0x4f')]({'where':_0x3a5ac7})[_0xf68a('0x18')](function(_0x2478d8){if(_0x2478d8){return[_0x2478d8,![]];}return db[_0xf68a('0x9f')][_0xf68a('0x50')](_0x57491b)[_0xf68a('0x18')](function(_0x652987){return[_0x652987,!![]];});});}})[_0xf68a('0x66')](function(_0xe6a8d8,_0x5c84ea){_0x6f6ed7[_0xf68a('0xa0')]=_0xe6a8d8['get']({'plain':!![]});_0x6f6ed7['interaction']['created']=![];if(_0x5c84ea){if(_0x6f6ed7['account'][_0xf68a('0xa1')]){_0x6f6ed7[_0xf68a('0x80')][_0xf68a('0xa2')]({'id':0x0,'priority':_0x6f6ed7[_0xf68a('0x80')]['length']+0x1,'app':_0xf68a('0xa3'),'appdata':_0xf68a('0xa4'),'interval':_0xf68a('0xa5')});}_0x6f6ed7['interaction'][_0xf68a('0xa6')]=!![];}return db['WhatsappMessage'][_0xf68a('0x50')]({'phone':_0x6f6ed7[_0xf68a('0x57')][_0xf68a('0x89')],'messageId':_0x6f6ed7[_0xf68a('0x57')][_0xf68a('0x8d')],'body':_0x6f6ed7['body'][_0xf68a('0x57')],'WhatsappAccountId':_0x166ff8['params']['id'],'WhatsappInteractionId':_0xe6a8d8['id'],'direction':'in','ContactId':_0xe6a8d8['ContactId'],'AttachmentId':_0x6f6ed7['body'][_0xf68a('0xa7')]});})[_0xf68a('0x18')](function(_0x187fdb){_0x6f6ed7[_0xf68a('0x21')]=_0x187fdb;if(_0x6f6ed7[_0xf68a('0xa0')]['UserId']){return db[_0xf68a('0xa8')][_0xf68a('0x4f')]({'attributes':['id',_0xf68a('0x33')],'where':{'id':_0x6f6ed7[_0xf68a('0xa0')]['UserId']}})['then'](function(_0x1d2807){if(_0x1d2807){_0x6f6ed7['applications'][_0xf68a('0xa9')]({'id':0x0,'priority':0x0,'app':_0xf68a('0xaa'),'appdata':_0x1d2807[_0xf68a('0x33')]+','+(_0x6f6ed7[_0xf68a('0x7b')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xf68a('0xab'),_0x6f6ed7);});}return respondWithRpcPromise(_0xf68a('0xac'),'startRouting',_0x6f6ed7);})[_0xf68a('0x18')](function(_0x10b4e8){if(_0x10b4e8){var _0x19f7b9=0xc8;var _0x3c0035=_0xf68a('0xad');logger[_0xf68a('0x19')](_0xf68a('0x1d'),_0x3c0035,_0x19f7b9,'entity\x20found');logger[_0xf68a('0x1c')](_0xf68a('0xae'),_0x3c0035,_0x19f7b9,_0xf68a('0xaf'),JSON[_0xf68a('0x1e')](_0x10b4e8));if(_0x6f6ed7[_0xf68a('0x7b')]['type']==='twilio'){return _0x4f3cab['status'](_0x19f7b9)['set'](_0xf68a('0xb0'),_0xf68a('0xb1'))['send']('\x0a');}else{return _0x4f3cab[_0xf68a('0x25')](_0x19f7b9)[_0xf68a('0x27')](_0x10b4e8);}}});})[_0xf68a('0x23')](handleError(_0x4f3cab,null));};exports[_0xf68a('0x76')]=function(_0x15d7c8,_0x35fd6a,_0x4bc9d3){var _0x4cd502,_0x22e7b5,_0x292f0d;if(_[_0xf68a('0x91')](_0x15d7c8['body']['body'])||_0x15d7c8[_0xf68a('0x57')][_0xf68a('0x57')]===''){throw new db[(_0xf68a('0x82'))][(_0xf68a('0x92'))](_0xf68a('0x94'));}if(_[_0xf68a('0x91')](_0x15d7c8[_0xf68a('0x57')]['to'])){throw new db[(_0xf68a('0x82'))][(_0xf68a('0x92'))]('to\x20is\x20mandatory');}_0x4cd502=_0x15d7c8['body']['to'];return db[_0xf68a('0x48')]['find']({'where':{'id':_0x15d7c8[_0xf68a('0x4d')]['id']},'include':[{'model':db[_0xf68a('0x99')],'as':'List','include':[{'model':db[_0xf68a('0x9a')],'as':_0xf68a('0x9b'),'where':{'mobile':_0x4cd502},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x35fd6a,null))[_0xf68a('0x18')](function(_0x4b697a){if(_0x4b697a&&_0x4b697a[_0xf68a('0xb2')]){_0x22e7b5=_0x4b697a[_0xf68a('0x30')]({'plain':!![]});if(_0x22e7b5[_0xf68a('0xb2')]&&_0x22e7b5[_0xf68a('0xb2')][_0xf68a('0x9b')][_0xf68a('0x40')]){return _0x22e7b5[_0xf68a('0xb2')][_0xf68a('0x9b')][0x0];}return db[_0xf68a('0x9a')][_0xf68a('0x50')](_[_0xf68a('0x11')](_0x15d7c8['body'],{'firstName':_0x4cd502,'mobile':_0x4cd502,'phone':_0x4cd502,'ListId':_0x22e7b5[_0xf68a('0x87')]}));}})[_0xf68a('0x18')](handleEntityNotFound(_0x35fd6a,null))[_0xf68a('0x18')](function(_0x3a8227){if(_0x3a8227){_0x292f0d=_0x3a8227;return db[_0xf68a('0x9f')][_0xf68a('0x4f')]({'where':{'ContactId':_0x292f0d['id'],'closed':![],'WhatsappAccountId':_0x22e7b5['id']}})['then'](function(_0x5d9d8f){if(_0x5d9d8f){return[_0x5d9d8f,![]];}return db[_0xf68a('0x9f')][_0xf68a('0x50')]({'UserId':_0x15d7c8[_0xf68a('0x53')]['id'],'ContactId':_0x292f0d['id'],'WhatsappAccountId':_0x22e7b5['id'],'phone':_0x4cd502,'firstMsgDirection':_0xf68a('0xb3'),'Messages':[_[_0xf68a('0x4e')](_0x15d7c8[_0xf68a('0x57')],{'read':![],'body':_0x15d7c8['body'][_0xf68a('0x57')],'phone':_0x4cd502,'WhatsappAccountId':_0x22e7b5['id'],'UserId':_0x15d7c8[_0xf68a('0x53')]['id'],'ContactId':_0x292f0d['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xf68a('0xb4')}]})['then'](function(_0x1c3dd4){return[_0x1c3dd4,!![]];});});}})[_0xf68a('0x66')](function(_0x44b801,_0x1be11e){if(_0x1be11e){return _0x44b801;}return db[_0xf68a('0x7f')][_0xf68a('0x50')](_[_0xf68a('0x4e')](_0x15d7c8['body'],{'read':![],'body':_0x15d7c8[_0xf68a('0x57')][_0xf68a('0x57')],'phone':_0x4cd502,'WhatsappAccountId':_0x22e7b5['id'],'WhatsappInteractionId':_0x44b801['id'],'UserId':_0x15d7c8[_0xf68a('0x53')]['id'],'ContactId':_0x292f0d['id']}))[_0xf68a('0x18')](function(_0x264152){_0x44b801[_0xf68a('0xb5')][_0xf68a('0xb4')]=[];_0x44b801[_0xf68a('0xb5')][_0xf68a('0xb4')][_0xf68a('0xa2')](_0x264152[_0xf68a('0xb5')]);return _0x44b801;});})[_0xf68a('0x18')](respondWithResult(_0x35fd6a,null))[_0xf68a('0x23')](handleError(_0x35fd6a,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 40865ff..3f75b0f 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 _0x9f78=['emit','hasOwnProperty','exports','WhatsappAccount','save','update','remove'];(function(_0x46389e,_0x5de50e){var _0xaa94b6=function(_0x187a9e){while(--_0x187a9e){_0x46389e['push'](_0x46389e['shift']());}};_0xaa94b6(++_0x5de50e);}(_0x9f78,0x17d));var _0x89f7=function(_0x224f30,_0x4483c7){_0x224f30=_0x224f30-0x0;var _0x2a67ad=_0x9f78[_0x224f30];return _0x2a67ad;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0x89f7('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x89f7('0x1'),'afterUpdate':_0x89f7('0x2'),'afterDestroy':_0x89f7('0x3')};function emitEvent(_0x22a717){return function(_0x1f141c,_0x152bbd,_0x3f39b9){WhatsappAccountEvents[_0x89f7('0x4')](_0x22a717+':'+_0x1f141c['id'],_0x1f141c);WhatsappAccountEvents[_0x89f7('0x4')](_0x22a717,_0x1f141c);_0x3f39b9(null);};}for(var e in events){if(events[_0x89f7('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x89f7('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0x0de9=['events','../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5d7df8,_0x5b4d06){var _0x413678=function(_0x1f6e3d){while(--_0x1f6e3d){_0x5d7df8['push'](_0x5d7df8['shift']());}};_0x413678(++_0x5b4d06);}(_0x0de9,0x140));var _0x90de=function(_0x1bd30f,_0x23ce43){_0x1bd30f=_0x1bd30f-0x0;var _0x3c9675=_0x0de9[_0x1bd30f];return _0x3c9675;};'use strict';var EventEmitter=require(_0x90de('0x0'));var WhatsappAccount=require(_0x90de('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x90de('0x2'),'afterUpdate':'update','afterDestroy':_0x90de('0x3')};function emitEvent(_0x10d52d){return function(_0x209ed6,_0x3ecfbb,_0x2bee63){WhatsappAccountEvents[_0x90de('0x4')](_0x10d52d+':'+_0x209ed6['id'],_0x209ed6);WhatsappAccountEvents[_0x90de('0x4')](_0x10d52d,_0x209ed6);_0x2bee63(null);};}for(var e in events){if(events[_0x90de('0x5')](e)){var event=events[e];WhatsappAccount[_0x90de('0x6')](e,emitEvent(event));}}module[_0x90de('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 22d0c9c..6a56edc 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 _0x00ce=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','WhatsappAccount','whatsapp_accounts'];(function(_0x3508b6,_0xb0cff3){var _0x2bc9de=function(_0x21a1ee){while(--_0x21a1ee){_0x3508b6['push'](_0x3508b6['shift']());}};_0x2bc9de(++_0xb0cff3);}(_0x00ce,0x1b0));var _0xe00c=function(_0x2371b2,_0x7df633){_0x2371b2=_0x2371b2-0x0;var _0x532321=_0x00ce[_0x2371b2];return _0x532321;};'use strict';var _=require('lodash');var util=require(_0xe00c('0x0'));var logger=require('../../config/logger')(_0xe00c('0x1'));var moment=require(_0xe00c('0x2'));var BPromise=require(_0xe00c('0x3'));var rp=require(_0xe00c('0x4'));var fs=require('fs');var path=require(_0xe00c('0x5'));var rimraf=require(_0xe00c('0x6'));var config=require(_0xe00c('0x7'));var attributes=require(_0xe00c('0x8'));module[_0xe00c('0x9')]=function(_0x1e85fc,_0x5a85ca){return _0x1e85fc['define'](_0xe00c('0xa'),attributes,{'tableName':_0xe00c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc85=['path','rimraf','../../config/environment','exports','define','whatsapp_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xfc85,0x156));var _0x5fc8=function(_0x5d18ea,_0x30eba0){_0x5d18ea=_0x5d18ea-0x0;var _0x58ade4=_0xfc85[_0x5d18ea];return _0x58ade4;};'use strict';var _=require('lodash');var util=require(_0x5fc8('0x0'));var logger=require(_0x5fc8('0x1'))(_0x5fc8('0x2'));var moment=require(_0x5fc8('0x3'));var BPromise=require(_0x5fc8('0x4'));var rp=require(_0x5fc8('0x5'));var fs=require('fs');var path=require(_0x5fc8('0x6'));var rimraf=require(_0x5fc8('0x7'));var config=require(_0x5fc8('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0x5fc8('0x9')]=function(_0x45f502,_0xc3a11e){return _0x45f502[_0x5fc8('0xa')]('WhatsappAccount',attributes,{'tableName':_0x5fc8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 741189e..4c1d8fa 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 _0x3ecb=['debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','attributes','include','model','map','info','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s'];(function(_0x119cd8,_0x556b73){var _0x7072a3=function(_0x5908d1){while(--_0x5908d1){_0x119cd8['push'](_0x119cd8['shift']());}};_0x7072a3(++_0x556b73);}(_0x3ecb,0x15e));var _0xb3ec=function(_0x2db896,_0x165786){_0x2db896=_0x2db896-0x0;var _0x3a281f=_0x3ecb[_0x2db896];return _0x3a281f;};'use strict';var _=require(_0xb3ec('0x0'));var util=require(_0xb3ec('0x1'));var moment=require(_0xb3ec('0x2'));var BPromise=require(_0xb3ec('0x3'));var rs=require(_0xb3ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3ec('0x5'))['db'];var utils=require(_0xb3ec('0x6'));var logger=require(_0xb3ec('0x7'))('rpc');var config=require(_0xb3ec('0x8'));var jayson=require(_0xb3ec('0x9'));var client=jayson[_0xb3ec('0xa')]['http']({'port':0x232a});config[_0xb3ec('0xb')]=_[_0xb3ec('0xc')](config[_0xb3ec('0xb')],{'host':_0xb3ec('0xd'),'port':0x18eb});var socket=require(_0xb3ec('0xe'))(new Redis(config[_0xb3ec('0xb')]));require(_0xb3ec('0xf'))[_0xb3ec('0x10')](socket);function respondWithRpcPromise(_0x4583c1,_0x2df5be,_0x4c1bb4){return new BPromise(function(_0x12c8db,_0x4b232a){return client[_0xb3ec('0x11')](_0x4583c1,_0x4c1bb4)[_0xb3ec('0x12')](function(_0x38825e){logger['info'](_0xb3ec('0x13'),_0x2df5be,'request\x20sent');logger[_0xb3ec('0x14')](_0xb3ec('0x15'),_0x2df5be,_0xb3ec('0x16'),JSON['stringify'](_0x38825e));if(_0x38825e[_0xb3ec('0x17')]){if(_0x38825e[_0xb3ec('0x17')]['code']===0x1f4){logger[_0xb3ec('0x17')](_0xb3ec('0x13'),_0x2df5be,_0x38825e[_0xb3ec('0x17')][_0xb3ec('0x18')]);return _0x4b232a(_0x38825e[_0xb3ec('0x17')][_0xb3ec('0x18')]);}logger[_0xb3ec('0x17')](_0xb3ec('0x13'),_0x2df5be,_0x38825e[_0xb3ec('0x17')]['message']);return _0x12c8db(_0x38825e[_0xb3ec('0x17')][_0xb3ec('0x18')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x2df5be,_0xb3ec('0x16'));_0x12c8db(_0x38825e[_0xb3ec('0x19')]['message']);}})[_0xb3ec('0x1a')](function(_0x5108eb){logger[_0xb3ec('0x17')](_0xb3ec('0x13'),_0x2df5be,_0x5108eb);_0x4b232a(_0x5108eb);});});}exports[_0xb3ec('0x1b')]=function(_0x33279f){var _0x413cb8=this;return new Promise(function(_0x12589f,_0x5b84e6){return db[_0xb3ec('0x1c')]['find']({'raw':_0x33279f[_0xb3ec('0x1d')]?_0x33279f[_0xb3ec('0x1d')][_0xb3ec('0x1e')]===undefined?!![]:![]:!![],'where':_0x33279f[_0xb3ec('0x1d')]?_0x33279f[_0xb3ec('0x1d')]['where']||null:null,'attributes':_0x33279f[_0xb3ec('0x1d')]?_0x33279f[_0xb3ec('0x1d')][_0xb3ec('0x1f')]||null:null,'include':_0x33279f[_0xb3ec('0x1d')]?_0x33279f[_0xb3ec('0x1d')][_0xb3ec('0x20')]?_['map'](_0x33279f['options'][_0xb3ec('0x20')],function(_0x13fe45){return{'model':db[_0x13fe45[_0xb3ec('0x21')]],'as':_0x13fe45['as'],'attributes':_0x13fe45['attributes'],'include':_0x13fe45[_0xb3ec('0x20')]?_[_0xb3ec('0x22')](_0x13fe45[_0xb3ec('0x20')],function(_0x3964af){return{'model':db[_0x3964af[_0xb3ec('0x21')]],'as':_0x3964af['as'],'attributes':_0x3964af[_0xb3ec('0x1f')],'include':_0x3964af[_0xb3ec('0x20')]?_[_0xb3ec('0x22')](_0x3964af[_0xb3ec('0x20')],function(_0x1f8805){return{'model':db[_0x1f8805[_0xb3ec('0x21')]],'as':_0x1f8805['as'],'attributes':_0x1f8805[_0xb3ec('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb3ec('0x12')](function(_0xf97eb5){logger[_0xb3ec('0x23')](_0xb3ec('0x1b'),_0x33279f);logger['debug'](_0xb3ec('0x1b'),_0x33279f,JSON[_0xb3ec('0x24')](_0xf97eb5));_0x12589f(_0xf97eb5);})[_0xb3ec('0x1a')](function(_0x2ea7ba){logger[_0xb3ec('0x17')](_0xb3ec('0x1b'),_0x2ea7ba[_0xb3ec('0x18')],_0x33279f);_0x5b84e6(_0x413cb8[_0xb3ec('0x17')](0x1f4,_0x2ea7ba[_0xb3ec('0x18')]));});});}; \ No newline at end of file +var _0x68b1=['client','http','defaults','redis','localhost','socket.io-emitter','register','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x68b1,0x13a));var _0x168b=function(_0x1587d1,_0x4ac855){_0x1587d1=_0x1587d1-0x0;var _0x376394=_0x68b1[_0x1587d1];return _0x376394;};'use strict';var _=require(_0x168b('0x0'));var util=require(_0x168b('0x1'));var moment=require(_0x168b('0x2'));var BPromise=require(_0x168b('0x3'));var rs=require(_0x168b('0x4'));var fs=require('fs');var Redis=require(_0x168b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x168b('0x6'))(_0x168b('0x7'));var config=require(_0x168b('0x8'));var jayson=require(_0x168b('0x9'));var client=jayson[_0x168b('0xa')][_0x168b('0xb')]({'port':0x232a});config['redis']=_[_0x168b('0xc')](config[_0x168b('0xd')],{'host':_0x168b('0xe'),'port':0x18eb});var socket=require(_0x168b('0xf'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x168b('0x10')](socket);function respondWithRpcPromise(_0x3f986f,_0x588d90,_0x48d97f){return new BPromise(function(_0x100569,_0x51f109){return client['request'](_0x3f986f,_0x48d97f)['then'](function(_0xc18252){logger[_0x168b('0x11')](_0x168b('0x12'),_0x588d90,'request\x20sent');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x588d90,_0x168b('0x13'),JSON[_0x168b('0x14')](_0xc18252));if(_0xc18252[_0x168b('0x15')]){if(_0xc18252[_0x168b('0x15')]['code']===0x1f4){logger[_0x168b('0x15')](_0x168b('0x12'),_0x588d90,_0xc18252[_0x168b('0x15')]['message']);return _0x51f109(_0xc18252[_0x168b('0x15')]['message']);}logger[_0x168b('0x15')](_0x168b('0x12'),_0x588d90,_0xc18252['error'][_0x168b('0x16')]);return _0x100569(_0xc18252[_0x168b('0x15')][_0x168b('0x16')]);}else{logger[_0x168b('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x588d90,_0x168b('0x13'));_0x100569(_0xc18252[_0x168b('0x17')][_0x168b('0x16')]);}})[_0x168b('0x18')](function(_0x477f84){logger[_0x168b('0x15')](_0x168b('0x12'),_0x588d90,_0x477f84);_0x51f109(_0x477f84);});});}exports[_0x168b('0x19')]=function(_0x27cf5c){var _0x3a48a3=this;return new Promise(function(_0x455677,_0x5a5fce){return db[_0x168b('0x1a')][_0x168b('0x1b')]({'raw':_0x27cf5c['options']?_0x27cf5c[_0x168b('0x1c')][_0x168b('0x1d')]===undefined?!![]:![]:!![],'where':_0x27cf5c[_0x168b('0x1c')]?_0x27cf5c[_0x168b('0x1c')][_0x168b('0x1e')]||null:null,'attributes':_0x27cf5c[_0x168b('0x1c')]?_0x27cf5c[_0x168b('0x1c')][_0x168b('0x1f')]||null:null,'include':_0x27cf5c['options']?_0x27cf5c[_0x168b('0x1c')][_0x168b('0x20')]?_[_0x168b('0x21')](_0x27cf5c['options'][_0x168b('0x20')],function(_0x5e5edf){return{'model':db[_0x5e5edf['model']],'as':_0x5e5edf['as'],'attributes':_0x5e5edf[_0x168b('0x1f')],'include':_0x5e5edf[_0x168b('0x20')]?_[_0x168b('0x21')](_0x5e5edf[_0x168b('0x20')],function(_0x1c6f52){return{'model':db[_0x1c6f52[_0x168b('0x22')]],'as':_0x1c6f52['as'],'attributes':_0x1c6f52[_0x168b('0x1f')],'include':_0x1c6f52[_0x168b('0x20')]?_['map'](_0x1c6f52[_0x168b('0x20')],function(_0x5cab27){return{'model':db[_0x5cab27['model']],'as':_0x5cab27['as'],'attributes':_0x5cab27[_0x168b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x168b('0x23')](function(_0x5c39ab){logger[_0x168b('0x11')](_0x168b('0x19'),_0x27cf5c);logger['debug'](_0x168b('0x19'),_0x27cf5c,JSON[_0x168b('0x14')](_0x5c39ab));_0x455677(_0x5c39ab);})[_0x168b('0x18')](function(_0x439959){logger[_0x168b('0x15')](_0x168b('0x19'),_0x439959[_0x168b('0x16')],_0x27cf5c);_0x5a5fce(_0x3a48a3[_0x168b('0x15')](0x1f4,_0x439959[_0x168b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 283cd31..b2b125a 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 _0x1881=['save','remove','update','removeListener','register','whatsappAccount:','./whatsappAccount.events'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x1881,0x110));var _0x1188=function(_0x55c485,_0x3fe77e){_0x55c485=_0x55c485-0x0;var _0x6bb521=_0x1881[_0x55c485];return _0x6bb521;};'use strict';var WhatsappAccountEvents=require(_0x1188('0x0'));var events=[_0x1188('0x1'),_0x1188('0x2'),_0x1188('0x3')];function createListener(_0x5c508c,_0x22f80f){return function(_0x338922){_0x22f80f['emit'](_0x5c508c,_0x338922);};}function removeListener(_0xe0a136,_0x15c45b){return function(){WhatsappAccountEvents[_0x1188('0x4')](_0xe0a136,_0x15c45b);};}exports[_0x1188('0x5')]=function(_0x34eb09){for(var _0x3f0591=0x0,_0x5beeab=events['length'];_0x3f0591<_0x5beeab;_0x3f0591++){var _0x337a4c=events[_0x3f0591];var _0x1597b7=createListener(_0x1188('0x6')+_0x337a4c,_0x34eb09);WhatsappAccountEvents['on'](_0x337a4c,_0x1597b7);}}; \ No newline at end of file +var _0x2689=['remove','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x1f4d41,_0x33ae17){var _0x10183e=function(_0x2898de){while(--_0x2898de){_0x1f4d41['push'](_0x1f4d41['shift']());}};_0x10183e(++_0x33ae17);}(_0x2689,0x127));var _0x9268=function(_0x39034,_0x125434){_0x39034=_0x39034-0x0;var _0x1c10f1=_0x2689[_0x39034];return _0x1c10f1;};'use strict';var WhatsappAccountEvents=require(_0x9268('0x0'));var events=[_0x9268('0x1'),_0x9268('0x2'),_0x9268('0x3')];function createListener(_0x35d2bf,_0x1ce1f1){return function(_0x5d1351){_0x1ce1f1[_0x9268('0x4')](_0x35d2bf,_0x5d1351);};}function removeListener(_0x4db686,_0x19aee6){return function(){WhatsappAccountEvents[_0x9268('0x5')](_0x4db686,_0x19aee6);};}exports[_0x9268('0x6')]=function(_0x555036){for(var _0x2d20e0=0x0,_0x1ae2dc=events[_0x9268('0x7')];_0x2d20e0<_0x1ae2dc;_0x2d20e0++){var _0x5a2536=events[_0x2d20e0];var _0x3feacf=createListener(_0x9268('0x8')+_0x5a2536,_0x555036);WhatsappAccountEvents['on'](_0x5a2536,_0x3feacf);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 3109279..5a65355 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 _0xce3c=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','post','create','put','delete','destroy','exports','multer','path'];(function(_0x58aad3,_0x2a1647){var _0x2618d9=function(_0x3b760a){while(--_0x3b760a){_0x58aad3['push'](_0x58aad3['shift']());}};_0x2618d9(++_0x2a1647);}(_0xce3c,0x10e));var _0xcce3=function(_0x2ab1c1,_0x39b0b6){_0x2ab1c1=_0x2ab1c1-0x0;var _0x527164=_0xce3c[_0x2ab1c1];return _0x527164;};'use strict';var multer=require(_0xcce3('0x0'));var util=require('util');var path=require(_0xcce3('0x1'));var timeout=require(_0xcce3('0x2'));var express=require(_0xcce3('0x3'));var router=express['Router']();var fs_extra=require(_0xcce3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcce3('0x5'));var config=require(_0xcce3('0x6'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0xcce3('0x7')](),controller[_0xcce3('0x8')]);router[_0xcce3('0x9')](_0xcce3('0xa'),auth[_0xcce3('0x7')](),controller['show']);router[_0xcce3('0xb')]('/',auth[_0xcce3('0x7')](),controller[_0xcce3('0xc')]);router[_0xcce3('0xd')](_0xcce3('0xa'),auth[_0xcce3('0x7')](),controller['update']);router[_0xcce3('0xe')](_0xcce3('0xa'),auth[_0xcce3('0x7')](),controller[_0xcce3('0xf')]);module[_0xcce3('0x10')]=router; \ No newline at end of file +var _0x9540=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','index','isAuthenticated','show','put','/:id','update','delete'];(function(_0xb60b24,_0xff44ab){var _0x3604f3=function(_0x92a716){while(--_0x92a716){_0xb60b24['push'](_0xb60b24['shift']());}};_0x3604f3(++_0xff44ab);}(_0x9540,0xa4));var _0x0954=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9540[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x0954('0x0'));var path=require('path');var timeout=require(_0x0954('0x1'));var express=require(_0x0954('0x2'));var router=express[_0x0954('0x3')]();var fs_extra=require(_0x0954('0x4'));var auth=require(_0x0954('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0954('0x6'));var controller=require(_0x0954('0x7'));router[_0x0954('0x8')]('/',auth['isAuthenticated'](),controller[_0x0954('0x9')]);router[_0x0954('0x8')]('/:id',auth[_0x0954('0xa')](),controller[_0x0954('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0954('0xc')](_0x0954('0xd'),auth[_0x0954('0xa')](),controller[_0x0954('0xe')]);router[_0x0954('0xf')]('/:id',auth[_0x0954('0xa')](),controller[_0x0954('0x10')]);module[_0x0954('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 32707b0..fc2062a 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 _0xb955=['*,*,*,*','sequelize','STRING','noop'];(function(_0x2830fc,_0x1bbb32){var _0x3cc76b=function(_0x10f976){while(--_0x10f976){_0x2830fc['push'](_0x2830fc['shift']());}};_0x3cc76b(++_0x1bbb32);}(_0xb955,0x81));var _0x5b95=function(_0x5849d0,_0x5e4867){_0x5849d0=_0x5849d0-0x0;var _0x46e9c2=_0xb955[_0x5849d0];return _0x46e9c2;};'use strict';var Sequelize=require(_0x5b95('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5b95('0x1')],'allowNull':![],'defaultValue':_0x5b95('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5b95('0x1')]},'interval':{'type':Sequelize[_0x5b95('0x1')],'defaultValue':_0x5b95('0x3')}}; \ No newline at end of file +var _0x67a2=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x9b6188,_0x28cb0b){var _0x37d16d=function(_0x25b681){while(--_0x25b681){_0x9b6188['push'](_0x9b6188['shift']());}};_0x37d16d(++_0x28cb0b);}(_0x67a2,0x163));var _0x267a=function(_0x1bf6b0,_0x3115e3){_0x1bf6b0=_0x1bf6b0-0x0;var _0x53f1c0=_0x67a2[_0x1bf6b0];return _0x53f1c0;};'use strict';var Sequelize=require(_0x267a('0x0'));module[_0x267a('0x1')]={'priority':{'type':Sequelize[_0x267a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x267a('0x3')],'allowNull':![],'defaultValue':_0x267a('0x4')},'appdata':{'type':Sequelize[_0x267a('0x5')]()},'description':{'type':Sequelize[_0x267a('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x267a('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 29cac00..590e7f5 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 _0x13c5=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','update','then','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','where','VIRTUAL','options','WhatsappApplication','count','includeAll','include','findAll','rows','show','params','length','merge','find','catch','create','body','destroy','eml-format','mustache','sox','to-csv','ejs','fs-extra'];(function(_0x244256,_0x2fc305){var _0x18de00=function(_0x3f8555){while(--_0x3f8555){_0x244256['push'](_0x244256['shift']());}};_0x18de00(++_0x2fc305);}(_0x13c5,0x7a));var _0x513c=function(_0x1af276,_0x38078f){_0x1af276=_0x1af276-0x0;var _0x5df8c9=_0x13c5[_0x1af276];return _0x5df8c9;};'use strict';var emlformat=require(_0x513c('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(_0x513c('0x1'));var util=require('util');var path=require('path');var sox=require(_0x513c('0x2'));var csv=require(_0x513c('0x3'));var ejs=require(_0x513c('0x4'));var fs=require('fs');var fs_extra=require(_0x513c('0x5'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x513c('0x6'));var jsforce=require(_0x513c('0x7'));var deskjs=require(_0x513c('0x8'));var toCsv=require(_0x513c('0x3'));var querystring=require(_0x513c('0x9'));var Papa=require(_0x513c('0xa'));var Redis=require(_0x513c('0xb'));var authService=require(_0x513c('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x513c('0xd'));var hardwareService=require(_0x513c('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x513c('0xf'));var config=require(_0x513c('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d8274,_0xae7c0d){_0xae7c0d=_0xae7c0d||0xcc;return function(_0x4b4661){if(_0x4b4661){return _0x4d8274[_0x513c('0x11')](_0xae7c0d);}return _0x4d8274[_0x513c('0x12')](_0xae7c0d)['end']();};}function respondWithResult(_0x1f7f70,_0xe3bae8){_0xe3bae8=_0xe3bae8||0xc8;return function(_0x29fa69){if(_0x29fa69){return _0x1f7f70[_0x513c('0x12')](_0xe3bae8)[_0x513c('0x13')](_0x29fa69);}};}function respondWithFilteredResult(_0x57f359,_0x31cad0){return function(_0x592bbb){if(_0x592bbb){var _0x242311=typeof _0x31cad0[_0x513c('0x14')]===_0x513c('0x15')&&typeof _0x31cad0[_0x513c('0x16')]==='undefined';var _0x48abf0=_0x592bbb['count'];var _0x100bc7=_0x242311?0x0:_0x31cad0[_0x513c('0x14')];var _0x51196d=_0x242311?_0x592bbb['count']:_0x31cad0[_0x513c('0x14')]+_0x31cad0[_0x513c('0x16')];var _0x3c4ab;if(_0x51196d>=_0x48abf0){_0x51196d=_0x48abf0;_0x3c4ab=0xc8;}else{_0x3c4ab=0xce;}_0x57f359[_0x513c('0x12')](_0x3c4ab);return _0x57f359['set'](_0x513c('0x17'),_0x100bc7+'-'+_0x51196d+'/'+_0x48abf0)[_0x513c('0x13')](_0x592bbb);}return null;};}function patchUpdates(_0x24a9c7){return function(_0x1d547a){try{jsonpatch[_0x513c('0x18')](_0x1d547a,_0x24a9c7,!![]);}catch(_0x52287b){return BPromise[_0x513c('0x19')](_0x52287b);}return _0x1d547a['save']();};}function saveUpdates(_0xea28b3,_0x13cfe1){return function(_0x9dc7ba){if(_0x9dc7ba){return _0x9dc7ba[_0x513c('0x1a')](_0xea28b3)[_0x513c('0x1b')](function(_0x5ac3be){return _0x5ac3be;});}return null;};}function removeEntity(_0x56fd80,_0x23ef79){return function(_0x390f1e){if(_0x390f1e){return _0x390f1e['destroy']()[_0x513c('0x1b')](function(){_0x56fd80[_0x513c('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x206e5b,_0x465522){return function(_0x437ed8){if(!_0x437ed8){_0x206e5b[_0x513c('0x11')](0x194);}return _0x437ed8;};}function handleError(_0xdcc31b,_0x168854){_0x168854=_0x168854||0x1f4;return function(_0x4574e2){logger['error'](_0x4574e2[_0x513c('0x1c')]);if(_0x4574e2[_0x513c('0x1d')]){delete _0x4574e2[_0x513c('0x1d')];}_0xdcc31b[_0x513c('0x12')](_0x168854)[_0x513c('0x1e')](_0x4574e2);};}exports['index']=function(_0xe8acaa,_0x28de12){var _0x3cbe93={},_0x308466={},_0xd2e1db={'count':0x0,'rows':[]};var _0x19a47e=_['map'](db['WhatsappApplication'][_0x513c('0x1f')],function(_0x5d74ea){return{'name':_0x5d74ea[_0x513c('0x20')],'type':_0x5d74ea[_0x513c('0x21')][_0x513c('0x22')]};});_0x308466['model']=_[_0x513c('0x23')](_0x19a47e,_0x513c('0x1d'));_0x308466[_0x513c('0x24')]=_[_0x513c('0x25')](_0xe8acaa['query']);_0x308466[_0x513c('0x26')]=_[_0x513c('0x27')](_0x308466['model'],_0x308466[_0x513c('0x24')]);_0x3cbe93[_0x513c('0x28')]=_['intersection'](_0x308466[_0x513c('0x29')],qs[_0x513c('0x2a')](_0xe8acaa[_0x513c('0x24')][_0x513c('0x2a')]));_0x3cbe93[_0x513c('0x28')]=_0x3cbe93['attributes']['length']?_0x3cbe93[_0x513c('0x28')]:_0x308466['model'];if(!_0xe8acaa[_0x513c('0x24')][_0x513c('0x2b')](_0x513c('0x2c'))){_0x3cbe93[_0x513c('0x16')]=qs[_0x513c('0x16')](_0xe8acaa[_0x513c('0x24')][_0x513c('0x16')]);_0x3cbe93['offset']=qs[_0x513c('0x14')](_0xe8acaa[_0x513c('0x24')][_0x513c('0x14')]);}_0x3cbe93[_0x513c('0x2d')]=qs['sort'](_0xe8acaa[_0x513c('0x24')]['sort']);_0x3cbe93[_0x513c('0x2e')]=qs[_0x513c('0x26')](_['pick'](_0xe8acaa['query'],_0x308466[_0x513c('0x26')]),_0x19a47e);if(_0xe8acaa['query']['filter']){_0x3cbe93[_0x513c('0x2e')]=_['merge'](_0x3cbe93[_0x513c('0x2e')],{'$or':_['map'](_0x19a47e,function(_0x5cfc3b){if(_0x5cfc3b[_0x513c('0x21')]!==_0x513c('0x2f')){var _0x3aee99={};_0x3aee99[_0x5cfc3b['name']]={'$like':'%'+_0xe8acaa[_0x513c('0x24')]['filter']+'%'};return _0x3aee99;}})});}_0x3cbe93=_['merge']({},_0x3cbe93,_0xe8acaa[_0x513c('0x30')]);var _0x2832de={'where':_0x3cbe93['where']};return db[_0x513c('0x31')][_0x513c('0x32')](_0x2832de)[_0x513c('0x1b')](function(_0x57d07f){_0xd2e1db[_0x513c('0x32')]=_0x57d07f;if(_0xe8acaa[_0x513c('0x24')][_0x513c('0x33')]){_0x3cbe93[_0x513c('0x34')]=[{'all':!![]}];}return db[_0x513c('0x31')][_0x513c('0x35')](_0x3cbe93);})['then'](function(_0x2abae5){_0xd2e1db[_0x513c('0x36')]=_0x2abae5;return _0xd2e1db;})[_0x513c('0x1b')](respondWithFilteredResult(_0x28de12,_0x3cbe93))['catch'](handleError(_0x28de12,null));};exports[_0x513c('0x37')]=function(_0x2616b2,_0x32826f){var _0x34f1d8={'raw':!![],'where':{'id':_0x2616b2[_0x513c('0x38')]['id']}},_0x3a7c40={};_0x3a7c40['model']=_[_0x513c('0x25')](db[_0x513c('0x31')][_0x513c('0x1f')]);_0x3a7c40['query']=_[_0x513c('0x25')](_0x2616b2[_0x513c('0x24')]);_0x3a7c40[_0x513c('0x26')]=_[_0x513c('0x27')](_0x3a7c40[_0x513c('0x29')],_0x3a7c40[_0x513c('0x24')]);_0x34f1d8['attributes']=_[_0x513c('0x27')](_0x3a7c40[_0x513c('0x29')],qs[_0x513c('0x2a')](_0x2616b2[_0x513c('0x24')][_0x513c('0x2a')]));_0x34f1d8[_0x513c('0x28')]=_0x34f1d8[_0x513c('0x28')][_0x513c('0x39')]?_0x34f1d8[_0x513c('0x28')]:_0x3a7c40['model'];if(_0x2616b2['query']['includeAll']){_0x34f1d8[_0x513c('0x34')]=[{'all':!![]}];}_0x34f1d8=_[_0x513c('0x3a')]({},_0x34f1d8,_0x2616b2[_0x513c('0x30')]);return db['WhatsappApplication'][_0x513c('0x3b')](_0x34f1d8)[_0x513c('0x1b')](handleEntityNotFound(_0x32826f,null))[_0x513c('0x1b')](respondWithResult(_0x32826f,null))[_0x513c('0x3c')](handleError(_0x32826f,null));};exports[_0x513c('0x3d')]=function(_0x163baf,_0x2314e5){return db[_0x513c('0x31')]['create'](_0x163baf[_0x513c('0x3e')],{})[_0x513c('0x1b')](respondWithResult(_0x2314e5,0xc9))[_0x513c('0x3c')](handleError(_0x2314e5,null));};exports[_0x513c('0x1a')]=function(_0x3c5f1f,_0x303e27){if(_0x3c5f1f[_0x513c('0x3e')]['id']){delete _0x3c5f1f['body']['id'];}return db[_0x513c('0x31')][_0x513c('0x3b')]({'where':{'id':_0x3c5f1f['params']['id']}})['then'](handleEntityNotFound(_0x303e27,null))[_0x513c('0x1b')](saveUpdates(_0x3c5f1f[_0x513c('0x3e')],null))[_0x513c('0x1b')](respondWithResult(_0x303e27,null))[_0x513c('0x3c')](handleError(_0x303e27,null));};exports[_0x513c('0x3f')]=function(_0x42cf66,_0x2d129c){return db[_0x513c('0x31')][_0x513c('0x3b')]({'where':{'id':_0x42cf66[_0x513c('0x38')]['id']}})['then'](handleEntityNotFound(_0x2d129c,null))[_0x513c('0x1b')](removeEntity(_0x2d129c,null))[_0x513c('0x3c')](handleError(_0x2d129c,null));}; \ No newline at end of file +var _0x9bd9=['apply','reject','then','error','name','index','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range'];(function(_0x417fff,_0x5be94e){var _0x383fdf=function(_0x24fa46){while(--_0x24fa46){_0x417fff['push'](_0x417fff['shift']());}};_0x383fdf(++_0x5be94e);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x430095,_0x122722){_0x430095=_0x430095-0x0;var _0x115f8a=_0x9bd9[_0x430095];return _0x115f8a;};'use strict';var emlformat=require(_0x99bd('0x0'));var rimraf=require(_0x99bd('0x1'));var zipdir=require(_0x99bd('0x2'));var jsonpatch=require(_0x99bd('0x3'));var rp=require(_0x99bd('0x4'));var moment=require(_0x99bd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x99bd('0x6'));var util=require('util');var path=require(_0x99bd('0x7'));var sox=require(_0x99bd('0x8'));var csv=require('to-csv');var ejs=require(_0x99bd('0x9'));var fs=require('fs');var fs_extra=require(_0x99bd('0xa'));var _=require(_0x99bd('0xb'));var squel=require(_0x99bd('0xc'));var crypto=require(_0x99bd('0xd'));var jsforce=require(_0x99bd('0xe'));var deskjs=require(_0x99bd('0xf'));var toCsv=require(_0x99bd('0x10'));var querystring=require(_0x99bd('0x11'));var Papa=require(_0x99bd('0x12'));var Redis=require(_0x99bd('0x13'));var authService=require(_0x99bd('0x14'));var qs=require(_0x99bd('0x15'));var as=require(_0x99bd('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99bd('0x17'))('api');var utils=require(_0x99bd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x99bd('0x19'));var db=require(_0x99bd('0x1a'))['db'];function respondWithStatusCode(_0x4a8bd9,_0x22237c){_0x22237c=_0x22237c||0xcc;return function(_0x500cd2){if(_0x500cd2){return _0x4a8bd9[_0x99bd('0x1b')](_0x22237c);}return _0x4a8bd9['status'](_0x22237c)[_0x99bd('0x1c')]();};}function respondWithResult(_0x401299,_0x141159){_0x141159=_0x141159||0xc8;return function(_0x4a9770){if(_0x4a9770){return _0x401299[_0x99bd('0x1d')](_0x141159)[_0x99bd('0x1e')](_0x4a9770);}};}function respondWithFilteredResult(_0x2d918a,_0x42b619){return function(_0x65a2e5){if(_0x65a2e5){var _0x491d9=typeof _0x42b619[_0x99bd('0x1f')]===_0x99bd('0x20')&&typeof _0x42b619[_0x99bd('0x21')]==='undefined';var _0x378079=_0x65a2e5[_0x99bd('0x22')];var _0x2fe078=_0x491d9?0x0:_0x42b619['offset'];var _0x4b98fc=_0x491d9?_0x65a2e5[_0x99bd('0x22')]:_0x42b619[_0x99bd('0x1f')]+_0x42b619[_0x99bd('0x21')];var _0xfa6227;if(_0x4b98fc>=_0x378079){_0x4b98fc=_0x378079;_0xfa6227=0xc8;}else{_0xfa6227=0xce;}_0x2d918a[_0x99bd('0x1d')](_0xfa6227);return _0x2d918a['set'](_0x99bd('0x23'),_0x2fe078+'-'+_0x4b98fc+'/'+_0x378079)['json'](_0x65a2e5);}return null;};}function patchUpdates(_0x10f2fb){return function(_0x3085df){try{jsonpatch[_0x99bd('0x24')](_0x3085df,_0x10f2fb,!![]);}catch(_0x1d937b){return BPromise[_0x99bd('0x25')](_0x1d937b);}return _0x3085df['save']();};}function saveUpdates(_0x27c551,_0x229322){return function(_0x3e339c){if(_0x3e339c){return _0x3e339c['update'](_0x27c551)[_0x99bd('0x26')](function(_0x5e6081){return _0x5e6081;});}return null;};}function removeEntity(_0x4d3ebb,_0x1c5b82){return function(_0xfdc455){if(_0xfdc455){return _0xfdc455['destroy']()[_0x99bd('0x26')](function(){_0x4d3ebb[_0x99bd('0x1d')](0xcc)[_0x99bd('0x1c')]();});}};}function handleEntityNotFound(_0x3f7bf4,_0x51ff34){return function(_0x12daac){if(!_0x12daac){_0x3f7bf4['sendStatus'](0x194);}return _0x12daac;};}function handleError(_0x550b7f,_0x10d5cd){_0x10d5cd=_0x10d5cd||0x1f4;return function(_0x5ebeeb){logger[_0x99bd('0x27')](_0x5ebeeb['stack']);if(_0x5ebeeb[_0x99bd('0x28')]){delete _0x5ebeeb[_0x99bd('0x28')];}_0x550b7f['status'](_0x10d5cd)['send'](_0x5ebeeb);};}exports[_0x99bd('0x29')]=function(_0x1af1e6,_0x1eabb9){var _0x5903aa={},_0x957d48={},_0x1d0642={'count':0x0,'rows':[]};var _0x2250d8=_['map'](db[_0x99bd('0x2a')][_0x99bd('0x2b')],function(_0x4c5493){return{'name':_0x4c5493[_0x99bd('0x2c')],'type':_0x4c5493[_0x99bd('0x2d')][_0x99bd('0x2e')]};});_0x957d48[_0x99bd('0x2f')]=_['map'](_0x2250d8,_0x99bd('0x28'));_0x957d48[_0x99bd('0x30')]=_['keys'](_0x1af1e6[_0x99bd('0x30')]);_0x957d48['filters']=_['intersection'](_0x957d48['model'],_0x957d48[_0x99bd('0x30')]);_0x5903aa[_0x99bd('0x31')]=_[_0x99bd('0x32')](_0x957d48[_0x99bd('0x2f')],qs[_0x99bd('0x33')](_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x33')]));_0x5903aa[_0x99bd('0x31')]=_0x5903aa[_0x99bd('0x31')][_0x99bd('0x34')]?_0x5903aa['attributes']:_0x957d48[_0x99bd('0x2f')];if(!_0x1af1e6['query'][_0x99bd('0x35')]('nolimit')){_0x5903aa['limit']=qs['limit'](_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x21')]);_0x5903aa[_0x99bd('0x1f')]=qs[_0x99bd('0x1f')](_0x1af1e6['query'][_0x99bd('0x1f')]);}_0x5903aa[_0x99bd('0x36')]=qs[_0x99bd('0x37')](_0x1af1e6[_0x99bd('0x30')]['sort']);_0x5903aa[_0x99bd('0x38')]=qs[_0x99bd('0x39')](_[_0x99bd('0x3a')](_0x1af1e6[_0x99bd('0x30')],_0x957d48['filters']),_0x2250d8);if(_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x3b')]){_0x5903aa[_0x99bd('0x38')]=_[_0x99bd('0x3c')](_0x5903aa['where'],{'$or':_[_0x99bd('0x3d')](_0x2250d8,function(_0x3d2b0f){if(_0x3d2b0f[_0x99bd('0x2d')]!==_0x99bd('0x3e')){var _0x7e29ec={};_0x7e29ec[_0x3d2b0f[_0x99bd('0x28')]]={'$like':'%'+_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x3b')]+'%'};return _0x7e29ec;}})});}_0x5903aa=_[_0x99bd('0x3c')]({},_0x5903aa,_0x1af1e6[_0x99bd('0x3f')]);var _0x2fcf71={'where':_0x5903aa[_0x99bd('0x38')]};return db[_0x99bd('0x2a')]['count'](_0x2fcf71)[_0x99bd('0x26')](function(_0x1ecdd6){_0x1d0642[_0x99bd('0x22')]=_0x1ecdd6;if(_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x40')]){_0x5903aa[_0x99bd('0x41')]=[{'all':!![]}];}return db[_0x99bd('0x2a')][_0x99bd('0x42')](_0x5903aa);})[_0x99bd('0x26')](function(_0x7e84b1){_0x1d0642[_0x99bd('0x43')]=_0x7e84b1;return _0x1d0642;})[_0x99bd('0x26')](respondWithFilteredResult(_0x1eabb9,_0x5903aa))[_0x99bd('0x44')](handleError(_0x1eabb9,null));};exports[_0x99bd('0x45')]=function(_0xb0ffe5,_0x2d91be){var _0x369fb5={'raw':!![],'where':{'id':_0xb0ffe5[_0x99bd('0x46')]['id']}},_0x5a4a96={};_0x5a4a96[_0x99bd('0x2f')]=_[_0x99bd('0x47')](db[_0x99bd('0x2a')][_0x99bd('0x2b')]);_0x5a4a96[_0x99bd('0x30')]=_[_0x99bd('0x47')](_0xb0ffe5[_0x99bd('0x30')]);_0x5a4a96['filters']=_[_0x99bd('0x32')](_0x5a4a96[_0x99bd('0x2f')],_0x5a4a96[_0x99bd('0x30')]);_0x369fb5['attributes']=_[_0x99bd('0x32')](_0x5a4a96[_0x99bd('0x2f')],qs[_0x99bd('0x33')](_0xb0ffe5['query'][_0x99bd('0x33')]));_0x369fb5['attributes']=_0x369fb5['attributes']['length']?_0x369fb5[_0x99bd('0x31')]:_0x5a4a96[_0x99bd('0x2f')];if(_0xb0ffe5[_0x99bd('0x30')]['includeAll']){_0x369fb5[_0x99bd('0x41')]=[{'all':!![]}];}_0x369fb5=_[_0x99bd('0x3c')]({},_0x369fb5,_0xb0ffe5[_0x99bd('0x3f')]);return db['WhatsappApplication'][_0x99bd('0x48')](_0x369fb5)[_0x99bd('0x26')](handleEntityNotFound(_0x2d91be,null))['then'](respondWithResult(_0x2d91be,null))['catch'](handleError(_0x2d91be,null));};exports[_0x99bd('0x49')]=function(_0x1d7ec0,_0x3487c6){return db['WhatsappApplication']['create'](_0x1d7ec0[_0x99bd('0x4a')],{})[_0x99bd('0x26')](respondWithResult(_0x3487c6,0xc9))[_0x99bd('0x44')](handleError(_0x3487c6,null));};exports['update']=function(_0x3fa8e1,_0x4e71b3){if(_0x3fa8e1[_0x99bd('0x4a')]['id']){delete _0x3fa8e1[_0x99bd('0x4a')]['id'];}return db[_0x99bd('0x2a')][_0x99bd('0x48')]({'where':{'id':_0x3fa8e1[_0x99bd('0x46')]['id']}})['then'](handleEntityNotFound(_0x4e71b3,null))[_0x99bd('0x26')](saveUpdates(_0x3fa8e1['body'],null))[_0x99bd('0x26')](respondWithResult(_0x4e71b3,null))[_0x99bd('0x44')](handleError(_0x4e71b3,null));};exports[_0x99bd('0x4b')]=function(_0x1912ac,_0x2100c7){return db[_0x99bd('0x2a')][_0x99bd('0x48')]({'where':{'id':_0x1912ac['params']['id']}})['then'](handleEntityNotFound(_0x2100c7,null))[_0x99bd('0x26')](removeEntity(_0x2100c7,null))[_0x99bd('0x44')](handleError(_0x2100c7,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index e755c3a..fe1f1ed 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 _0xcabc=['api','moment','bluebird','path','rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x1653bf,_0x43083b){var _0xe57166=function(_0x2cc1f0){while(--_0x2cc1f0){_0x1653bf['push'](_0x1653bf['shift']());}};_0xe57166(++_0x43083b);}(_0xcabc,0x16a));var _0xccab=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xcabc[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xccab('0x0'));var logger=require(_0xccab('0x1'))(_0xccab('0x2'));var moment=require(_0xccab('0x3'));var BPromise=require(_0xccab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xccab('0x5'));var rimraf=require(_0xccab('0x6'));var config=require('../../config/environment');var attributes=require(_0xccab('0x7'));module[_0xccab('0x8')]=function(_0x271a61,_0x492d75){return _0x271a61[_0xccab('0x9')](_0xccab('0xa'),attributes,{'tableName':_0xccab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xccab('0xc')});}; \ No newline at end of file +var _0x294b=['exports','define','whatsapp_applications','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./whatsappApplication.attributes'];(function(_0x90b204,_0x5d37b5){var _0x372802=function(_0x2b02db){while(--_0x2b02db){_0x90b204['push'](_0x90b204['shift']());}};_0x372802(++_0x5d37b5);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb294('0x0'));var util=require('util');var logger=require(_0xb294('0x1'))(_0xb294('0x2'));var moment=require(_0xb294('0x3'));var BPromise=require(_0xb294('0x4'));var rp=require(_0xb294('0x5'));var fs=require('fs');var path=require(_0xb294('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb294('0x7'));module[_0xb294('0x8')]=function(_0xaa6a67,_0x181f5e){return _0xaa6a67[_0xb294('0x9')]('WhatsappApplication',attributes,{'tableName':_0xb294('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 8af1dc8..4780a88 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 _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x6bbc50,_0x26b8e9){var _0x5e8e93=function(_0x2dda79){while(--_0x2dda79){_0x6bbc50['push'](_0x6bbc50['shift']());}};_0x5e8e93(++_0x26b8e9);}(_0xe14d,0x1ee));var _0xde14=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xe14d[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file +var _0x8d0e=['info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then'];(function(_0x3dc273,_0x4c0714){var _0x45344c=function(_0x5cf8df){while(--_0x5cf8df){_0x3dc273['push'](_0x3dc273['shift']());}};_0x45344c(++_0x4c0714);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x177ad4,_0x3dab21){_0x177ad4=_0x177ad4-0x0;var _0x5cbe15=_0x8d0e[_0x177ad4];return _0x5cbe15;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){return client[_0xe8d0('0xb')](_0x92483d,_0xcc03d0)[_0xe8d0('0xc')](function(_0x5605a0){logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,_0xe8d0('0xf'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x469d37,_0xe8d0('0xf'),JSON[_0xe8d0('0x10')](_0x5605a0));if(_0x5605a0[_0xe8d0('0x11')]){if(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x12')]===0x1f4){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x13aa63(_0x5605a0['error'][_0xe8d0('0x13')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x2b6dce(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);}else{logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,'request\x20sent');_0x2b6dce(_0x5605a0[_0xe8d0('0x14')]['message']);}})[_0xe8d0('0x15')](function(_0x3c526c){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x3c526c);_0x13aa63(_0x3c526c);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index a699b28..fafef1a 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 _0xe626=['whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/:id','show','post','create','/:id/messages','addMessage','tracked','whatsappinteraction:addtags','addTags','put'];(function(_0x4629ee,_0x5802d8){var _0x47fb5b=function(_0xf899cd){while(--_0xf899cd){_0x4629ee['push'](_0x4629ee['shift']());}};_0x47fb5b(++_0x5802d8);}(_0xe626,0x9d));var _0x6e62=function(_0x32e96c,_0x39e363){_0x32e96c=_0x32e96c-0x0;var _0x228446=_0xe626[_0x32e96c];return _0x228446;};'use strict';var multer=require(_0x6e62('0x0'));var util=require(_0x6e62('0x1'));var path=require(_0x6e62('0x2'));var timeout=require(_0x6e62('0x3'));var express=require('express');var router=express[_0x6e62('0x4')]();var fs_extra=require(_0x6e62('0x5'));var auth=require(_0x6e62('0x6'));var interaction=require(_0x6e62('0x7'));var config=require(_0x6e62('0x8'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6e62('0x9')]);router[_0x6e62('0xa')]('/describe',auth[_0x6e62('0xb')](),controller[_0x6e62('0xc')]);router[_0x6e62('0xa')](_0x6e62('0xd'),auth['isAuthenticated'](),controller[_0x6e62('0xe')]);router[_0x6e62('0xa')]('/:id/messages',auth[_0x6e62('0xb')](),controller['getMessages']);router[_0x6e62('0xa')]('/:id/download',auth[_0x6e62('0xb')](),controller['download']);router[_0x6e62('0xf')]('/',auth[_0x6e62('0xb')](),controller[_0x6e62('0x10')]);router[_0x6e62('0xf')](_0x6e62('0x11'),auth[_0x6e62('0xb')](),controller[_0x6e62('0x12')]);router['post']('/:id/tags',auth[_0x6e62('0xb')](),interaction[_0x6e62('0x13')]('whatsapp',_0x6e62('0x14')),controller[_0x6e62('0x15')]);router[_0x6e62('0x16')](_0x6e62('0xd'),auth['isAuthenticated'](),interaction[_0x6e62('0x13')](_0x6e62('0x17'),_0x6e62('0x18')),controller[_0x6e62('0x19')]);router[_0x6e62('0x1a')](_0x6e62('0xd'),auth[_0x6e62('0xb')](),interaction[_0x6e62('0x13')](_0x6e62('0x17'),_0x6e62('0x1b')),controller['destroy']);router[_0x6e62('0x1a')](_0x6e62('0x1c'),auth['isAuthenticated'](),controller[_0x6e62('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xbfe8=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','/:id/tags','tracked','whatsapp','addTags','put','delete','whatsappinteraction:destroy','destroy','exports','util'];(function(_0x3bb121,_0x3528fb){var _0xfb54ab=function(_0x2b7079){while(--_0x2b7079){_0x3bb121['push'](_0x3bb121['shift']());}};_0xfb54ab(++_0x3528fb);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x31dac1,_0x2b5bce){_0x31dac1=_0x31dac1-0x0;var _0x5c14c5=_0xbfe8[_0x31dac1];return _0x5c14c5;};'use strict';var multer=require('multer');var util=require(_0x8bfe('0x0'));var path=require('path');var timeout=require(_0x8bfe('0x1'));var express=require(_0x8bfe('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8bfe('0x3'));var interaction=require(_0x8bfe('0x4'));var config=require('../../config/environment');var controller=require(_0x8bfe('0x5'));router[_0x8bfe('0x6')]('/',auth[_0x8bfe('0x7')](),controller['index']);router[_0x8bfe('0x6')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0x9')]);router[_0x8bfe('0x6')](_0x8bfe('0xa'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xb')]);router[_0x8bfe('0x6')](_0x8bfe('0xc'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xd')]);router[_0x8bfe('0x6')](_0x8bfe('0xe'),auth[_0x8bfe('0x7')](),controller['download']);router[_0x8bfe('0xf')]('/',auth['isAuthenticated'](),controller[_0x8bfe('0x10')]);router[_0x8bfe('0xf')](_0x8bfe('0xc'),auth['isAuthenticated'](),controller['addMessage']);router[_0x8bfe('0xf')](_0x8bfe('0x11'),auth[_0x8bfe('0x7')](),interaction[_0x8bfe('0x12')](_0x8bfe('0x13'),'whatsappinteraction:addtags'),controller[_0x8bfe('0x14')]);router[_0x8bfe('0x15')]('/:id',auth[_0x8bfe('0x7')](),interaction[_0x8bfe('0x12')](_0x8bfe('0x13'),'whatsappinteraction:update'),controller['update']);router[_0x8bfe('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0x8bfe('0x12')](_0x8bfe('0x13'),_0x8bfe('0x17')),controller[_0x8bfe('0x18')]);router[_0x8bfe('0x16')](_0x8bfe('0x11'),auth[_0x8bfe('0x7')](),controller['removeTags']);module[_0x8bfe('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 2e93c6f..a18170c 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 _0x510e=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x510e,0x1ed));var _0xe510=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x510e[_0x5f1391];return _0x50ebe3;};'use strict';var Sequelize=require(_0xe510('0x0'));var moment=require(_0xe510('0x1'));module[_0xe510('0x2')]={'closed':{'type':Sequelize[_0xe510('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe510('0x4')]},'disposition':{'type':Sequelize[_0xe510('0x5')]},'secondDisposition':{'type':Sequelize[_0xe510('0x5')]},'thirdDisposition':{'type':Sequelize[_0xe510('0x5')]},'note':{'type':Sequelize[_0xe510('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xe510('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xe510('0x6')]('in',_0xe510('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe510('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xe510('0x6')]('in',_0xe510('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xe510('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x4f5d=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x234327,_0x4db47f){var _0x229512=function(_0x1989c9){while(--_0x1989c9){_0x234327['push'](_0x234327['shift']());}};_0x229512(++_0x4db47f);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x4f5d[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0xd4f5('0x0'));var moment=require(_0xd4f5('0x1'));module[_0xd4f5('0x2')]={'closed':{'type':Sequelize[_0xd4f5('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd4f5('0x4')]},'disposition':{'type':Sequelize[_0xd4f5('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd4f5('0x5')]},'note':{'type':Sequelize[_0xd4f5('0x5')]},'phone':{'type':Sequelize[_0xd4f5('0x5')]},'read1stAt':{'type':Sequelize[_0xd4f5('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xd4f5('0x6')]('in',_0xd4f5('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd4f5('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xd4f5('0x6')]('in',_0xd4f5('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd4f5('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index b943e99..a4a0b0d 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 _0x2ffe=['i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','push','all','rows','catch','show','params','options','create','body','update','destroy','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','fullname','mkdirSync','Owner','N.A.','closedAt','disposition','basename','existsSync','pipe','createWriteStream','System','renderFile','root','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','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','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','then','error','name','send','Users','map','TagIds','Tags','forEach','waiting','answered','unmanaged','total','closed','UserId','talking','index','WhatsappInteraction','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','search','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?'];(function(_0x249a81,_0x18fae3){var _0x2b0fb2=function(_0x19bcd5){while(--_0x19bcd5){_0x249a81['push'](_0x249a81['shift']());}};_0x2b0fb2(++_0x18fae3);}(_0x2ffe,0x6a));var _0xe2ff=function(_0x5d665d,_0x428a9a){_0x5d665d=_0x5d665d-0x0;var _0x3c32ca=_0x2ffe[_0x5d665d];return _0x3c32ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe2ff('0x0'));var zipdir=require(_0xe2ff('0x1'));var jsonpatch=require(_0xe2ff('0x2'));var rp=require(_0xe2ff('0x3'));var moment=require(_0xe2ff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe2ff('0x5'));var util=require(_0xe2ff('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe2ff('0x7'));var ejs=require(_0xe2ff('0x8'));var fs=require('fs');var fs_extra=require(_0xe2ff('0x9'));var _=require('lodash');var squel=require(_0xe2ff('0xa'));var crypto=require(_0xe2ff('0xb'));var jsforce=require(_0xe2ff('0xc'));var deskjs=require(_0xe2ff('0xd'));var toCsv=require(_0xe2ff('0x7'));var querystring=require(_0xe2ff('0xe'));var Papa=require(_0xe2ff('0xf'));var Redis=require(_0xe2ff('0x10'));var authService=require(_0xe2ff('0x11'));var qs=require(_0xe2ff('0x12'));var as=require(_0xe2ff('0x13'));var pdf=require(_0xe2ff('0x14'));var hardwareService=require(_0xe2ff('0x15'));var logger=require(_0xe2ff('0x16'))(_0xe2ff('0x17'));var utils=require(_0xe2ff('0x18'));var config=require(_0xe2ff('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2ff('0x1a'))['db'];config[_0xe2ff('0x1b')]=_['defaults'](config[_0xe2ff('0x1b')],{'host':_0xe2ff('0x1c'),'port':0x18eb});var socket=require(_0xe2ff('0x1d'))(new Redis(config[_0xe2ff('0x1b')]));require(_0xe2ff('0x1e'))[_0xe2ff('0x1f')](socket);function respondWithStatusCode(_0x201128,_0x96907c){_0x96907c=_0x96907c||0xcc;return function(_0x2a82df){if(_0x2a82df){return _0x201128[_0xe2ff('0x20')](_0x96907c);}return _0x201128[_0xe2ff('0x21')](_0x96907c)[_0xe2ff('0x22')]();};}function respondWithResult(_0x336368,_0x31a8a0){_0x31a8a0=_0x31a8a0||0xc8;return function(_0x3fb0f4){if(_0x3fb0f4){return _0x336368[_0xe2ff('0x21')](_0x31a8a0)['json'](_0x3fb0f4);}};}function respondWithFilteredResult(_0xbb9cce,_0x10c7d6){return function(_0x3f1962){if(_0x3f1962){var _0x42c589=typeof _0x10c7d6['offset']===_0xe2ff('0x23')&&typeof _0x10c7d6[_0xe2ff('0x24')]===_0xe2ff('0x23');var _0x6af167=_0x3f1962[_0xe2ff('0x25')];var _0x1baf77=_0x42c589?0x0:_0x10c7d6[_0xe2ff('0x26')];var _0x4ca791=_0x42c589?_0x3f1962['count']:_0x10c7d6['offset']+_0x10c7d6['limit'];var _0x418362;if(_0x4ca791>=_0x6af167){_0x4ca791=_0x6af167;_0x418362=0xc8;}else{_0x418362=0xce;}_0xbb9cce[_0xe2ff('0x21')](_0x418362);return _0xbb9cce[_0xe2ff('0x27')](_0xe2ff('0x28'),_0x1baf77+'-'+_0x4ca791+'/'+_0x6af167)[_0xe2ff('0x29')](_0x3f1962);}return null;};}function patchUpdates(_0x3d9d66){return function(_0x335d9c){try{jsonpatch[_0xe2ff('0x2a')](_0x335d9c,_0x3d9d66,!![]);}catch(_0x12dc09){return BPromise['reject'](_0x12dc09);}return _0x335d9c[_0xe2ff('0x2b')]();};}function saveUpdates(_0x4a2222,_0xa6ad9){return function(_0xf16952){if(_0xf16952){return _0xf16952['update'](_0x4a2222)[_0xe2ff('0x2c')](function(_0x4b2617){return _0x4b2617;});}return null;};}function removeEntity(_0x5265b5,_0x497890){return function(_0x373529){if(_0x373529){return _0x373529['destroy']()['then'](function(){_0x5265b5[_0xe2ff('0x21')](0xcc)[_0xe2ff('0x22')]();});}};}function handleEntityNotFound(_0x50290b,_0x5b2489){return function(_0x3eeba0){if(!_0x3eeba0){_0x50290b[_0xe2ff('0x20')](0x194);}return _0x3eeba0;};}function handleError(_0x2b8839,_0x2733c3){_0x2733c3=_0x2733c3||0x1f4;return function(_0x270296){logger[_0xe2ff('0x2d')](_0x270296['stack']);if(_0x270296[_0xe2ff('0x2e')]){delete _0x270296[_0xe2ff('0x2e')];}_0x2b8839[_0xe2ff('0x21')](_0x2733c3)[_0xe2ff('0x2f')](_0x270296);};}function getInteractionUsers(_0x4dcd89,_0xb4ca2a){return new BPromise(function(_0x1da1c8,_0x5e14d9){try{if(_0xb4ca2a[_0x4dcd89['id']]){_0x4dcd89[_0xe2ff('0x30')]=_[_0xe2ff('0x31')](_0xb4ca2a[_0x4dcd89['id']],function(_0x32a533){return{'id':_0x32a533['id'],'fullname':_0x32a533['fullname']};});}}catch(_0x21a601){_0x5e14d9(_0x21a601);}_0x1da1c8(_0x4dcd89);});}function getInteractionTags(_0x1034f8,_0x45ad04){return new BPromise(function(_0x95df6b,_0x1fd147){try{if(_0x1034f8[_0xe2ff('0x32')]){_0x1034f8[_0xe2ff('0x33')]=[];_0x1034f8[_0xe2ff('0x32')]['split'](',')[_0xe2ff('0x34')](function(_0xa8139b){_0x1034f8[_0xe2ff('0x33')]['push'](_0x45ad04[_0xa8139b]);});}delete _0x1034f8['TagIds'];}catch(_0x48d9a3){_0x1fd147(_0x48d9a3);}_0x95df6b(_0x1034f8);});}function updateWhatsappInteraction(_0x4bd0ba,_0x1b8116,_0xa19a4a){return new BPromise(function(_0x2ccbf9,_0x203f3c){return getInteractionUsers(_0x4bd0ba,_0xa19a4a)[_0xe2ff('0x2c')](function(_0x41aed6){return getInteractionTags(_0x41aed6,_0x1b8116);})[_0xe2ff('0x2c')](function(_0x519bc2){return getStateInteraction(_0x519bc2);})[_0xe2ff('0x2c')](function(_0x2fbb29){_0x2ccbf9(_0x2fbb29);})['catch'](function(_0x16a3d4){_0x203f3c(_0x16a3d4);});});}function getStateInteraction(_0x479bb7){return new BPromise(function(_0x193c2f){_0x479bb7[_0xe2ff('0x35')]=0x0;_0x479bb7['talking']=0x0;_0x479bb7[_0xe2ff('0x36')]=0x0;_0x479bb7[_0xe2ff('0x37')]=0x0;_0x479bb7[_0xe2ff('0x38')]=0x0;if(!_0x479bb7[_0xe2ff('0x39')]&&!_0x479bb7['UserId']){_0x479bb7['waiting']+=0x1;}if(!_0x479bb7[_0xe2ff('0x39')]&&_0x479bb7[_0xe2ff('0x3a')]){_0x479bb7[_0xe2ff('0x3b')]+=0x1;if(_0x479bb7['waiting']){_0x479bb7[_0xe2ff('0x35')]-=0x1;}}if(_0x479bb7[_0xe2ff('0x39')]&&_0x479bb7[_0xe2ff('0x3a')]){_0x479bb7[_0xe2ff('0x36')]+=0x1;if(_0x479bb7[_0xe2ff('0x3b')]){_0x479bb7[_0xe2ff('0x3b')]-=0x1;}}if(_0x479bb7['closed']&&!_0x479bb7[_0xe2ff('0x3a')]){_0x479bb7[_0xe2ff('0x37')]+=0x1;if(_0x479bb7[_0xe2ff('0x35')]){_0x479bb7[_0xe2ff('0x35')]-=0x1;}}_0x479bb7[_0xe2ff('0x38')]+=0x1;_0x193c2f(_0x479bb7);});}exports[_0xe2ff('0x3c')]=function(_0x15c722,_0x331905){var _0x4cb057={},_0x2152b1={},_0x20b12e={'count':0x0,'rows':[]};var _0x3be03f=_[_0xe2ff('0x31')](db[_0xe2ff('0x3d')][_0xe2ff('0x3e')],function(_0x127b24){return{'name':_0x127b24['fieldName'],'type':_0x127b24[_0xe2ff('0x3f')]['key']};});_0x2152b1['model']=_['map'](_0x3be03f,_0xe2ff('0x2e'));_0x2152b1[_0xe2ff('0x40')]=_[_0xe2ff('0x41')](_0x15c722['query']);_0x2152b1[_0xe2ff('0x42')]=_[_0xe2ff('0x43')](_0x2152b1[_0xe2ff('0x44')],_0x2152b1[_0xe2ff('0x40')]);_0x4cb057[_0xe2ff('0x45')]=_[_0xe2ff('0x43')](_0x2152b1[_0xe2ff('0x44')],qs[_0xe2ff('0x46')](_0x15c722[_0xe2ff('0x40')][_0xe2ff('0x46')]));_0x4cb057[_0xe2ff('0x45')]=_0x4cb057[_0xe2ff('0x45')][_0xe2ff('0x47')]?_0x4cb057[_0xe2ff('0x45')]:_0x2152b1[_0xe2ff('0x44')];if(!_0x15c722[_0xe2ff('0x40')][_0xe2ff('0x48')](_0xe2ff('0x49'))){_0x4cb057[_0xe2ff('0x24')]=qs[_0xe2ff('0x24')](_0x15c722[_0xe2ff('0x40')][_0xe2ff('0x24')]);_0x4cb057[_0xe2ff('0x26')]=qs[_0xe2ff('0x26')](_0x15c722['query'][_0xe2ff('0x26')]);}_0x4cb057['order']=qs[_0xe2ff('0x4a')](_0x15c722[_0xe2ff('0x40')][_0xe2ff('0x4a')]);_0x4cb057[_0xe2ff('0x4b')]=qs['filters'](_[_0xe2ff('0x4c')](_0x15c722[_0xe2ff('0x40')],_0x2152b1['filters']),_0x3be03f);var _0x459f4d=[];var _0x4a25bc=squel[_0xe2ff('0x4d')]()[_0xe2ff('0x4e')]('id')['field'](_0xe2ff('0x2e'))[_0xe2ff('0x4e')]('color')['from'](_0xe2ff('0x4f'));var _0x588507=squel[_0xe2ff('0x4d')]()[_0xe2ff('0x4e')](_0xe2ff('0x50'))[_0xe2ff('0x4e')](_0xe2ff('0x51'))[_0xe2ff('0x4e')](_0xe2ff('0x52'))['from'](_0xe2ff('0x53'),'ui')[_0xe2ff('0x54')](_0xe2ff('0x55'),'u',_0xe2ff('0x56'));var _0x53ab67=squel[_0xe2ff('0x4d')]()[_0xe2ff('0x57')](_0xe2ff('0x58'),'i')['left_join']('cm_contacts','c',_0xe2ff('0x59'))[_0xe2ff('0x54')]('users','o',_0xe2ff('0x5a'))[_0xe2ff('0x54')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')['left_join']('whatsapp_messages','me',_0xe2ff('0x5b'))[_0xe2ff('0x54')](_0xe2ff('0x5c'),'it',_0xe2ff('0x5d'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x58e032=squel['expr']();var _0x5bf1cb=[];var _0x15b1a0=squel['expr']();var _0x163336;if(_0x15c722[_0xe2ff('0x40')][_0xe2ff('0x5e')]){_0x163336=as['parseSearch'](_0x15c722[_0xe2ff('0x40')]['search']);var _0x5aca8d=_0x163336['sqlOperator'];for(var _0x57a8e1=0x0;_0x57a8e1<_0x163336[_0xe2ff('0x5f')]['length'];_0x57a8e1++){var _0x5b641f=_0x163336['conditions'][_0x57a8e1];var _0x5a2ae2='i';var _0x21b874=_[_0xe2ff('0x60')](_0x3be03f,[_0xe2ff('0x2e'),_0x5b641f[_0xe2ff('0x4e')]]);if(!_0x21b874){switch(_0x5b641f[_0xe2ff('0x4e')]){case _0xe2ff('0x61'):if(_0x5b641f[_0xe2ff('0x62')]==0x1){_0x53ab67['having']('`'+_0x5b641f[_0xe2ff('0x4e')]+_0xe2ff('0x63'));}else{_0x53ab67[_0xe2ff('0x64')]('`'+_0x5b641f[_0xe2ff('0x4e')]+_0xe2ff('0x65'));}break;case'Contact':if(_0x5b641f[_0xe2ff('0x66')]===_0xe2ff('0x67')){if(_0x5b641f[_0xe2ff('0x62')][_0xe2ff('0x68')]('\x20')[_0xe2ff('0x47')]>0x1){_0x58e032[_0x5aca8d](_0xe2ff('0x69'),qs[_0xe2ff('0x6a')](_0x5b641f[_0xe2ff('0x62')]),null);}else{var _0x41d6a4='%'+_0x5b641f[_0xe2ff('0x62')]+'%';_0x58e032[_0x5aca8d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x41d6a4,_0x41d6a4,_0x41d6a4);}}else{_0x21b874=_[_0xe2ff('0x60')](_0x3be03f,[_0xe2ff('0x2e'),_0xe2ff('0x6b')]);_0x5b641f[_0xe2ff('0x4e')]=_0xe2ff('0x6b');_0x2fb229=as[_0xe2ff('0x6c')](_0x5a2ae2,_0x21b874[_0xe2ff('0x3f')],_0x5b641f);_0x58e032[_0x5aca8d](_0x2fb229['text'],_0x2fb229[_0xe2ff('0x62')]['start'],_0x2fb229['value'][_0xe2ff('0x22')]);}break;case _0xe2ff('0x6d'):var _0x4e2aef=_0x5b641f[_0xe2ff('0x62')][_0xe2ff('0x68')](',')[_0xe2ff('0x31')](function(_0x1486d8){return Number(_0x1486d8);});_0x4e2aef[_0xe2ff('0x34')](function(_0x4cd439){_0x15b1a0['or'](_0xe2ff('0x6e'),'%,'+_0x4cd439+',%');});_0x5bf1cb=_[_0xe2ff('0x6f')](_0x5bf1cb,_0x4e2aef);break;case _0xe2ff('0x70'):if(_0x5b641f['operator']===_0xe2ff('0x67')){_0x58e032[_0x5aca8d](_0xe2ff('0x71'),'%'+_0x5b641f[_0xe2ff('0x62')]+'%',null);}else{_0x21b874=_[_0xe2ff('0x60')](_0x3be03f,[_0xe2ff('0x2e'),_0xe2ff('0x3a')]);_0x5b641f[_0xe2ff('0x4e')]=_0xe2ff('0x3a');_0x2fb229=as['buildExpression'](_0x5a2ae2,_0x21b874[_0xe2ff('0x3f')],_0x5b641f);_0x58e032[_0x5aca8d](_0x2fb229['text'],_0x2fb229['value'][_0xe2ff('0x72')],_0x2fb229[_0xe2ff('0x62')][_0xe2ff('0x22')]);}break;case'body':_0x2fb229=as[_0xe2ff('0x6c')]('me',null,_0x5b641f);_0x58e032[_0x5aca8d](_0x2fb229['text'],_0x2fb229[_0xe2ff('0x62')][_0xe2ff('0x72')],_0x2fb229[_0xe2ff('0x62')][_0xe2ff('0x22')]);break;}}else{var _0x2fb229=as[_0xe2ff('0x6c')](_0x5a2ae2,_0x21b874[_0xe2ff('0x3f')],_0x5b641f);_0x58e032[_0x5aca8d](_0x2fb229['text'],_0x2fb229[_0xe2ff('0x62')][_0xe2ff('0x72')],_0x2fb229[_0xe2ff('0x62')][_0xe2ff('0x22')]);}}}else{var _0x55071b=_(_0x15c722['query'])[_0xe2ff('0x41')]()[_0xe2ff('0x31')](function(_0x1cd9cd){return _[_0xe2ff('0x73')](_0x3be03f,[_0xe2ff('0x2e'),_0x1cd9cd])?_0x1cd9cd:undefined;})['compact']()[_0xe2ff('0x62')]();if(!_['isEmpty'](_0x55071b)){_0x55071b[_0xe2ff('0x34')](function(_0xf058d8){if(_0xf058d8==='WhatsappAccountId'){_0x53ab67[_0xe2ff('0x4b')](_0xe2ff('0x74'),[][_0xe2ff('0x75')](_0x15c722['query'][_0xf058d8]));}else if(_0xf058d8===_0xe2ff('0x76')){var _0x1f7220=JSON['parse'](_0x15c722[_0xe2ff('0x40')][_0xf058d8])[_0xe2ff('0x77')];var _0x577a07=JSON[_0xe2ff('0x78')](_0x15c722[_0xe2ff('0x40')][_0xf058d8])[_0xe2ff('0x79')];_0x53ab67['where'](_0xe2ff('0x7a'),_0x1f7220,_0x577a07);}else{if(_0x15c722[_0xe2ff('0x40')][_0xf058d8]===_0xe2ff('0x7b')){_0x53ab67[_0xe2ff('0x4b')]('i.'+_0xf058d8+_0xe2ff('0x7c'));}else{_0x53ab67['where']('i.'+_0xf058d8+'\x20=\x20?',_0x15c722[_0xe2ff('0x40')][_0xf058d8]);}}});}if(_0x15c722['query']['read']){if(_0x15c722[_0xe2ff('0x40')]['read']==0x1){_0x53ab67[_0xe2ff('0x64')](_0xe2ff('0x7d'));}else{_0x53ab67[_0xe2ff('0x64')](_0xe2ff('0x7e'));}}if(_0x15c722['query'][_0xe2ff('0x7f')]){_0x5bf1cb=_[_0xe2ff('0x80')](_0x15c722[_0xe2ff('0x40')]['tag'])?_0x15c722[_0xe2ff('0x40')][_0xe2ff('0x7f')]:new Array(_0x15c722[_0xe2ff('0x40')][_0xe2ff('0x7f')]);_0x5bf1cb[_0xe2ff('0x34')](function(_0x47ef5f){_0x15b1a0['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x47ef5f+',%');});}if(_0x15c722[_0xe2ff('0x40')][_0xe2ff('0x81')]){var _0xf65428=_0x15c722['query'][_0xe2ff('0x81')][_0xe2ff('0x82')]('\x5c','\x5c\x5c')[_0xe2ff('0x82')](/'/g,'\x27\x27');if(qs[_0xe2ff('0x83')](_0xf65428)){_0x58e032['or'](_0xe2ff('0x84'),_0xf65428+'%')['or'](_0xe2ff('0x85'),_0xf65428+'%');}else{_0x58e032['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe2ff('0x6a')](_0xf65428))['or'](_0xe2ff('0x86'),_0xf65428+'%');}}}_0x53ab67[_0xe2ff('0x4b')](_0x58e032);_0x53ab67['group'](_0xe2ff('0x87'));var _0x22fed4={'type':db[_0xe2ff('0x88')][_0xe2ff('0x89')][_0xe2ff('0x8a')],'raw':!![]};var _0x2d5a79=_0x53ab67['clone']();_0x2d5a79[_0xe2ff('0x4e')](_0xe2ff('0x87'));_0x2d5a79['field'](_0xe2ff('0x8b'),_0xe2ff('0x61'));if(_0x4cb057[_0xe2ff('0x8c')]){_0x4cb057[_0xe2ff('0x8c')][_0xe2ff('0x34')](function(_0x2e62c9){var _0x4364fe=_0x2e62c9[0x0]===_0xe2ff('0x8d')?_0x2e62c9[0x0]:'i.'+_0x2e62c9[0x0];_0x53ab67[_0xe2ff('0x8c')](_0x4364fe,_0x2e62c9[0x1]===_0xe2ff('0x8e')?![]:!![]);});}if(!_[_0xe2ff('0x8f')](_0x5bf1cb)){_0x53ab67[_0xe2ff('0x64')](_0x15b1a0);_0x2d5a79['where']('t.id\x20IN\x20?',_0x5bf1cb);}BPromise[_0xe2ff('0x90')]()[_0xe2ff('0x2c')](function(){if(!_0x163336){if(_0x15c722[_0xe2ff('0x40')][_0xe2ff('0x91')])return;_0x2d5a79[_0xe2ff('0x4b')](_0xe2ff('0x92'));_0x53ab67['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x15c722['user'][_0xe2ff('0x93')]!=='agent')return;return _0x15c722[_0xe2ff('0x94')][_0xe2ff('0x95')]({'attributes':['id'],'raw':!![]})[_0xe2ff('0x2c')](function(_0x8fcee7){if(_[_0xe2ff('0x8f')](_0x8fcee7)){_0x2d5a79['where'](_0xe2ff('0x96'));_0x53ab67[_0xe2ff('0x4b')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x2d5a79[_0xe2ff('0x4b')](_0xe2ff('0x74'),_[_0xe2ff('0x31')](_0x8fcee7,'id'));_0x53ab67[_0xe2ff('0x4b')](_0xe2ff('0x74'),_[_0xe2ff('0x31')](_0x8fcee7,'id'));}});})['then'](function(){if(_0x15c722[_0xe2ff('0x94')][_0xe2ff('0x93')]==='agent'&&!_0x163336&&!_0x15c722[_0xe2ff('0x40')]['WhatsappAccountId'])return[];return db[_0xe2ff('0x97')][_0xe2ff('0x40')](_0x2d5a79[_0xe2ff('0x98')](),_0x22fed4);})[_0xe2ff('0x2c')](function(_0x68a153){_0x20b12e['count']=_0x68a153['length'];if(_0x20b12e[_0xe2ff('0x25')]===0x0)return[];return db[_0xe2ff('0x97')][_0xe2ff('0x40')](_0x4a25bc['toString'](),_0x22fed4)['then'](function(_0x437b5b){_0x459f4d=_['keyBy'](_0x437b5b,'id');_0x22fed4=_[_0xe2ff('0x99')](_0x22fed4,{'model':db[_0xe2ff('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15c722[_0xe2ff('0x40')][_0xe2ff('0x46')]){_0x4cb057['attributes']['forEach'](function(_0x533d18){_0x53ab67['field']('i.'+_0x533d18);});}else{_0x53ab67[_0xe2ff('0x4e')](_0xe2ff('0x8b'),_0xe2ff('0x61'));_0x53ab67['field']('a.key',_0xe2ff('0x9a'));_0x53ab67[_0xe2ff('0x4e')](_0xe2ff('0x9b'),_0xe2ff('0x9c'));_0x53ab67['field']('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');_0x53ab67[_0xe2ff('0x4e')]('i.*');_0x53ab67[_0xe2ff('0x4e')](_0xe2ff('0x9d'),_0xe2ff('0x9e'));_0x53ab67[_0xe2ff('0x4e')]('c.lastName',_0xe2ff('0x9f'));_0x53ab67[_0xe2ff('0x4e')](_0xe2ff('0xa0'),_0xe2ff('0xa1'));_0x53ab67['field'](_0xe2ff('0xa2'),'Contact.phone');_0x53ab67[_0xe2ff('0x4e')](_0xe2ff('0xa3'),_0xe2ff('0xa4'));_0x53ab67[_0xe2ff('0x4e')](_0xe2ff('0xa5'),'Contact.fax');_0x53ab67[_0xe2ff('0x4e')]('o.fullname',_0xe2ff('0xa6'));_0x53ab67[_0xe2ff('0x4e')](_0xe2ff('0xa7'),_0xe2ff('0xa8'));_0x53ab67[_0xe2ff('0x4e')](_0xe2ff('0xa9'),_0xe2ff('0x32'));}if(_0x4cb057[_0xe2ff('0x24')])_0x53ab67['limit'](_0x4cb057['limit']);if(_0x4cb057[_0xe2ff('0x26')])_0x53ab67[_0xe2ff('0x26')](_0x4cb057['offset']);return db[_0xe2ff('0x97')][_0xe2ff('0x40')](_0x53ab67[_0xe2ff('0x98')](),_0x22fed4);})[_0xe2ff('0x2c')](function(_0x5bcba7){if(_0x5bcba7[_0xe2ff('0x47')]>0x0)_0x588507[_0xe2ff('0x4b')](_0xe2ff('0xaa'),_[_0xe2ff('0x31')](_0x5bcba7,'id'));return db[_0xe2ff('0x97')]['query'](_0x588507[_0xe2ff('0x98')](),_0x22fed4)[_0xe2ff('0x2c')](function(_0x3e6ed7){var _0x451ce1=_['groupBy'](_0x3e6ed7,_0xe2ff('0xab'));var _0x378b9c=[];_0x5bcba7[_0xe2ff('0x34')](function(_0x274451){_0x378b9c[_0xe2ff('0xac')](updateWhatsappInteraction(_0x274451,_0x459f4d,_0x451ce1));});return BPromise[_0xe2ff('0xad')](_0x378b9c);});});})[_0xe2ff('0x2c')](function(_0x319bdd){_0x20b12e[_0xe2ff('0xae')]=_0x319bdd;return _0x20b12e;})[_0xe2ff('0x2c')](respondWithFilteredResult(_0x331905,_0x4cb057))[_0xe2ff('0xaf')](handleError(_0x331905,null));};exports[_0xe2ff('0xb0')]=function(_0x10b2db,_0x1e0657){var _0x35b885={'raw':![],'where':{'id':_0x10b2db[_0xe2ff('0xb1')]['id']}},_0x5386dc={};_0x5386dc[_0xe2ff('0x44')]=_[_0xe2ff('0x41')](db[_0xe2ff('0x3d')][_0xe2ff('0x3e')]);_0x5386dc['query']=_[_0xe2ff('0x41')](_0x10b2db['query']);_0x5386dc[_0xe2ff('0x42')]=_[_0xe2ff('0x43')](_0x5386dc[_0xe2ff('0x44')],_0x5386dc['query']);_0x35b885[_0xe2ff('0x45')]=_['intersection'](_0x5386dc['model'],qs[_0xe2ff('0x46')](_0x10b2db[_0xe2ff('0x40')][_0xe2ff('0x46')]));_0x35b885[_0xe2ff('0x45')]=_0x35b885[_0xe2ff('0x45')][_0xe2ff('0x47')]?_0x35b885['attributes']:_0x5386dc[_0xe2ff('0x44')];if(_0x10b2db[_0xe2ff('0x40')]['includeAll']){_0x35b885['include']=[{'all':!![]}];}_0x35b885=_[_0xe2ff('0x99')]({},_0x35b885,_0x10b2db[_0xe2ff('0xb2')]);return db[_0xe2ff('0x3d')][_0xe2ff('0x60')](_0x35b885)['then'](handleEntityNotFound(_0x1e0657,null))[_0xe2ff('0x2c')](respondWithResult(_0x1e0657,null))[_0xe2ff('0xaf')](handleError(_0x1e0657,null));};exports[_0xe2ff('0xb3')]=function(_0x5e20de,_0x87e41){return db[_0xe2ff('0x3d')][_0xe2ff('0xb3')](_0x5e20de[_0xe2ff('0xb4')],{})['then'](respondWithResult(_0x87e41,0xc9))[_0xe2ff('0xaf')](handleError(_0x87e41,null));};exports[_0xe2ff('0xb5')]=function(_0xf7b342,_0x1f96c7){if(_0xf7b342[_0xe2ff('0xb4')]['id']){delete _0xf7b342[_0xe2ff('0xb4')]['id'];}return db[_0xe2ff('0x3d')]['find']({'where':{'id':_0xf7b342[_0xe2ff('0xb1')]['id']}})[_0xe2ff('0x2c')](handleEntityNotFound(_0x1f96c7,null))[_0xe2ff('0x2c')](saveUpdates(_0xf7b342[_0xe2ff('0xb4')],null))[_0xe2ff('0x2c')](respondWithResult(_0x1f96c7,null))[_0xe2ff('0xaf')](handleError(_0x1f96c7,null));};exports[_0xe2ff('0xb6')]=function(_0x1215ad,_0xe47844){return db['WhatsappInteraction'][_0xe2ff('0x60')]({'where':{'id':_0x1215ad['params']['id']}})['then'](handleEntityNotFound(_0xe47844,null))[_0xe2ff('0x2c')](removeEntity(_0xe47844,null))[_0xe2ff('0xaf')](handleError(_0xe47844,null));};exports['describe']=function(_0x2789c0,_0x70b4a1){return db[_0xe2ff('0x3d')][_0xe2ff('0xb7')]()[_0xe2ff('0x2c')](respondWithResult(_0x70b4a1,null))[_0xe2ff('0xaf')](handleError(_0x70b4a1,null));};exports[_0xe2ff('0xb8')]=function(_0x44d668,_0x140fb6,_0x1b5580){return db[_0xe2ff('0xb9')][_0xe2ff('0x60')]({'where':{'id':_0x44d668[_0xe2ff('0xb1')]['id']}})[_0xe2ff('0x2c')](handleEntityNotFound(_0x140fb6,null))['then'](function(_0x1a4ee7){if(_0x1a4ee7){return _0x1a4ee7['addMessage'](_0x44d668['body'][_0xe2ff('0xba')],_[_0xe2ff('0xbb')](_0x44d668['body'],[_0xe2ff('0xba'),'id'])||{});}})[_0xe2ff('0x2c')](respondWithResult(_0x140fb6,null))[_0xe2ff('0xaf')](handleError(_0x140fb6,null));};exports[_0xe2ff('0xbc')]=function(_0x373123,_0x3c7d1d,_0x109b7c){var _0x4b8a92={'raw':![],'where':{}};var _0x50e654={};var _0x5b8e09={'count':0x0,'rows':[]};return db[_0xe2ff('0x3d')][_0xe2ff('0xbd')]({'where':{'id':_0x373123['params']['id']}})['then'](handleEntityNotFound(_0x3c7d1d,null))['then'](function(_0x4b1077){if(_0x4b1077){_0x50e654[_0xe2ff('0x44')]=_[_0xe2ff('0x41')](db[_0xe2ff('0xb9')]['rawAttributes']);_0x50e654[_0xe2ff('0x40')]=_[_0xe2ff('0x41')](_0x373123[_0xe2ff('0x40')]);_0x50e654[_0xe2ff('0x42')]=_[_0xe2ff('0x43')](_0x50e654['model'],_0x50e654[_0xe2ff('0x40')]);_0x4b8a92[_0xe2ff('0x45')]=_[_0xe2ff('0x43')](_0x50e654[_0xe2ff('0x44')],qs[_0xe2ff('0x46')](_0x373123[_0xe2ff('0x40')][_0xe2ff('0x46')]));_0x4b8a92['attributes']=_0x4b8a92['attributes'][_0xe2ff('0x47')]?_0x4b8a92['attributes']:_0x50e654[_0xe2ff('0x44')];if(!_0x373123[_0xe2ff('0x40')]['hasOwnProperty'](_0xe2ff('0x49'))){_0x4b8a92[_0xe2ff('0x24')]=qs[_0xe2ff('0x24')](_0x373123[_0xe2ff('0x40')][_0xe2ff('0x24')]);_0x4b8a92['offset']=qs['offset'](_0x373123['query'][_0xe2ff('0x26')]);}_0x4b8a92[_0xe2ff('0x8c')]=qs[_0xe2ff('0x4a')](_0x373123['query']['sort']);_0x4b8a92[_0xe2ff('0x4b')]=qs['filters'](_[_0xe2ff('0x4c')](_0x373123['query'],_0x50e654['filters']));_0x4b8a92[_0xe2ff('0x4b')][_0xe2ff('0xab')]=_0x4b1077['id'];if(_0x373123['query']['filter']){_0x4b8a92[_0xe2ff('0x4b')]=_[_0xe2ff('0x99')](_0x4b8a92['where'],{'$or':_[_0xe2ff('0x31')](_0x4b8a92[_0xe2ff('0x45')],function(_0x65d3ba){var _0x21c90b={};_0x21c90b[_0x65d3ba]={'$like':'%'+_0x373123[_0xe2ff('0x40')][_0xe2ff('0x81')]+'%'};return _0x21c90b;})});}if(_0x373123[_0xe2ff('0x40')][_0xe2ff('0x77')]){var _0x4ee49c=_0x373123[_0xe2ff('0x40')][_0xe2ff('0x77')]['split'](',');var _0x54fc86={};_0x54fc86[_0x4ee49c[0x0]]={'$gte':moment(_0x4ee49c[0x1])[_0xe2ff('0xbe')](_0xe2ff('0xbf'))};_0x4b8a92[_0xe2ff('0x4b')]=_[_0xe2ff('0x99')](_0x4b8a92[_0xe2ff('0x4b')],_0x54fc86);}_0x4b8a92=_[_0xe2ff('0x99')]({},_0x4b8a92,_0x373123[_0xe2ff('0xb2')]);return db[_0xe2ff('0xb9')][_0xe2ff('0x25')]({'where':_0x4b8a92[_0xe2ff('0x4b')]})[_0xe2ff('0x2c')](function(_0x13d3be){_0x5b8e09[_0xe2ff('0x25')]=_0x13d3be;if(_0x373123['query'][_0xe2ff('0xc0')]){_0x4b8a92[_0xe2ff('0xc1')]=[{'all':!![]}];}return db[_0xe2ff('0xb9')][_0xe2ff('0xc2')](_0x4b8a92);})['then'](function(_0x354dd5){_0x5b8e09[_0xe2ff('0xae')]=_0x354dd5;return _0x5b8e09;});}})[_0xe2ff('0x2c')](respondWithFilteredResult(_0x3c7d1d,_0x4b8a92))['catch'](handleError(_0x3c7d1d,null));};exports[_0xe2ff('0xc3')]=function(_0x5766d5,_0x309c5d,_0x2049aa){return db[_0xe2ff('0x3d')][_0xe2ff('0x60')]({'where':{'id':_0x5766d5[_0xe2ff('0xb1')]['id']}})[_0xe2ff('0x2c')](handleEntityNotFound(_0x309c5d,null))[_0xe2ff('0x2c')](function(_0x14c5c7){if(_0x14c5c7){return _0x14c5c7[_0xe2ff('0xc4')](_0x5766d5[_0xe2ff('0xb4')][_0xe2ff('0xba')],_[_0xe2ff('0xbb')](_0x5766d5[_0xe2ff('0xb4')],[_0xe2ff('0xba'),'id'])||{})[_0xe2ff('0xc5')](function(){return db[_0xe2ff('0x6d')][_0xe2ff('0xc2')]({'attributes':['id','name','color'],'where':{'id':_0x5766d5[_0xe2ff('0xb4')]['ids']}});})[_0xe2ff('0x2c')](function(_0x4a713a){socket[_0xe2ff('0xc6')](_0xe2ff('0xc7'),{'id':Number(_0x5766d5[_0xe2ff('0xb1')]['id']),'tags':_0x4a713a||[]});return{'id':Number(_0x5766d5['params']['id']),'tags':_0x4a713a||[]};});}})[_0xe2ff('0x2c')](respondWithResult(_0x309c5d,null))[_0xe2ff('0xaf')](handleError(_0x309c5d,null));};exports[_0xe2ff('0xc8')]=function(_0x463e47,_0x17b314,_0x1e67d3){return db[_0xe2ff('0x3d')][_0xe2ff('0x60')]({'where':{'id':_0x463e47['params']['id']}})[_0xe2ff('0x2c')](handleEntityNotFound(_0x17b314,null))['then'](function(_0x4570aa){if(_0x4570aa){return _0x4570aa[_0xe2ff('0xc8')](_0x463e47['query'][_0xe2ff('0xba')]);}})[_0xe2ff('0x2c')](respondWithStatusCode(_0x17b314,null))[_0xe2ff('0xaf')](handleError(_0x17b314,null));};exports[_0xe2ff('0xc9')]=function(_0x3794eb,_0x1bba99){var _0x28692d=moment()[_0xe2ff('0xca')]()[_0xe2ff('0x98')]();var _0x5b4a68=path[_0xe2ff('0xcb')](config['root'],_0xe2ff('0xcc'),_0xe2ff('0xcd'),_0xe2ff('0xce'));var _0x3e4ac4=path[_0xe2ff('0xcb')](config['root'],_0xe2ff('0xcc'),_0xe2ff('0xcd'),_0xe2ff('0xcf'));var _0x146423=path[_0xe2ff('0xcb')](_0x5b4a68,_0x28692d);var _0x2bdf1d=util['format'](_0xe2ff('0xd0'),_0x3794eb['params']['id'],_0x28692d);var _0xbbe269=path['join'](_0x5b4a68,_0x2bdf1d);var _0x4c16a9=[];_0x4c16a9['push']({'model':db[_0xe2ff('0x70')],'as':_0xe2ff('0x70'),'attributes':['id','fullname'],'raw':!![]});_0x4c16a9['push']({'model':db[_0xe2ff('0xd1')],'as':_0xe2ff('0xd2'),'attributes':['id',_0xe2ff('0xd3'),_0xe2ff('0xd4')],'raw':!![]});if(_0x3794eb['query']['attachments']){_0x4c16a9[_0xe2ff('0xac')]({'model':db['Attachment'],'as':_0xe2ff('0xd5'),'raw':!![]});}var _0x2ea56d=[{'model':db[_0xe2ff('0xb9')],'as':_0xe2ff('0xd6'),'attributes':['id',_0xe2ff('0xb4'),_0xe2ff('0x76'),_0xe2ff('0xd7'),_0xe2ff('0xd8'),_0xe2ff('0xd9')],'include':_0x4c16a9}];_0x2ea56d[_0xe2ff('0xac')]({'model':db[_0xe2ff('0xda')],'as':_0xe2ff('0xdb'),'attributes':['id',_0xe2ff('0x2e')]});_0x2ea56d[_0xe2ff('0xac')]({'model':db[_0xe2ff('0x70')],'as':'Owner','attributes':['id',_0xe2ff('0xdc')]});return db[_0xe2ff('0x3d')][_0xe2ff('0x60')]({'where':{'id':_0x3794eb[_0xe2ff('0xb1')]['id']},'include':_0x2ea56d})[_0xe2ff('0x2c')](handleEntityNotFound(_0x1bba99,null))[_0xe2ff('0x2c')](function(_0x778c31){if(_0x778c31){var _0x16d68c=_0x778c31['get']({'plain':!![]});fs[_0xe2ff('0xdd')](_0x146423);var _0x171d0a={'channel':'Whatsapp','account':_0x16d68c[_0xe2ff('0xdb')][_0xe2ff('0x2e')],'agent':_0x16d68c[_0xe2ff('0xde')]?_0x16d68c[_0xe2ff('0xde')][_0xe2ff('0xdc')]:_0xe2ff('0xdf'),'createdAt':moment(_0x16d68c[_0xe2ff('0x76')])[_0xe2ff('0xbe')](_0xe2ff('0xbf'))[_0xe2ff('0x98')](),'closedAt':_0x16d68c['closed']?moment(_0x16d68c[_0xe2ff('0xe0')])[_0xe2ff('0xbe')](_0xe2ff('0xbf'))[_0xe2ff('0x98')]():'','disposition':_0x16d68c[_0xe2ff('0xe1')],'messages':_(_0x16d68c['Messages'])[_0xe2ff('0x81')]({'secret':![]})['map'](function(_0x482b33){if(_0x482b33[_0xe2ff('0xd5')]){var _0xca97df=path['join'](_0x3e4ac4,_0x482b33['Attachment'][_0xe2ff('0xe2')]);if(fs[_0xe2ff('0xe3')](_0xca97df)){fs['createReadStream'](_0xca97df)[_0xe2ff('0xe4')](fs[_0xe2ff('0xe5')](path[_0xe2ff('0xcb')](_0x146423,_0x482b33[_0xe2ff('0xd5')][_0xe2ff('0xe2')])));}}return{'date':moment(_0x482b33[_0xe2ff('0x76')])[_0xe2ff('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe2ff('0x98')](),'sender':_0x482b33[_0xe2ff('0xd7')]==='out'?_0x482b33['User']?_0x482b33[_0xe2ff('0x70')][_0xe2ff('0xdc')]:_0xe2ff('0xe6'):_0x482b33[_0xe2ff('0xd2')][_0xe2ff('0xd3')]+(_0x482b33[_0xe2ff('0xd2')][_0xe2ff('0xd4')]?'\x20'+_0x482b33['Contact'][_0xe2ff('0xd4')]:''),'body':_0x482b33[_0xe2ff('0xd5')]?_0x482b33['Attachment']['basename']:_0x482b33[_0xe2ff('0xb4')],'direction':_0x482b33[_0xe2ff('0xd7')]==='out'?'A':'C','secret':_0x482b33[_0xe2ff('0xd8')],'read':_0x482b33[_0xe2ff('0xd9')],'attachment':_0x482b33['Attachment']};})['value']()};return ejs[_0xe2ff('0xe7')](path[_0xe2ff('0xcb')](config[_0xe2ff('0xe8')],_0xe2ff('0xcc'),_0xe2ff('0xe9'),_0xe2ff('0xea')),{'interaction':_0x171d0a})[_0xe2ff('0x2c')](function(_0x4bd3c4){var _0x51dc40=path[_0xe2ff('0xcb')](_0x146423,_0xe2ff('0xeb')+_0x16d68c['id']+'-'+_0x28692d+_0xe2ff('0xec'));var _0x404f33={'path':_0x51dc40,'channel':_0xe2ff('0xed'),'interactionId':_0x16d68c['id']};return pdf[_0xe2ff('0xee')](_0x4bd3c4,_0x404f33);})[_0xe2ff('0x2c')](function(){return new BPromise(function(_0x4ca39c,_0x533734){zipdir(_0x146423,{'saveTo':_0xbbe269},function(_0x404dad,_0x507a25){if(_0x404dad)return _0x533734(_0x404dad);return _0x4ca39c(_0x507a25);});})[_0xe2ff('0x2c')](function(){return new BPromise(function(_0x586fa2,_0xb825a0){rimraf(_0x146423,function(_0x1694a0){if(_0x1694a0)_0xb825a0(_0x1694a0);return _0x586fa2();});});})[_0xe2ff('0x2c')](function(){return _0x1bba99['download'](_0xbbe269,_0x2bdf1d,function(_0x380919){if(_0x380919){console[_0xe2ff('0xef')](_0xe2ff('0xf0'),_0x380919);}else{fs['unlinkSync'](_0xbbe269);}});});});}else{return _0x1bba99['sendStatus'](0xc8);}})[_0xe2ff('0xaf')](handleError(_0x1bba99,null));}; \ No newline at end of file +var _0x2ff5=['path','to-csv','ejs','fs-extra','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','api','redis','localhost','./whatsappInteraction.socket','register','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','name','send','Users','fullname','Tags','TagIds','forEach','push','catch','talking','answered','unmanaged','total','closed','UserId','waiting','index','map','WhatsappInteraction','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','select','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','length','conditions','find','unreadMessages','value','having','`\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','type','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?','body','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','all','rows','params','rawAttributes','include','options','create','describe','addMessage','omit','ids','getMessages','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','WhatsappMessage','addTags','setTags','spread','findAll','whatsappInteractionTags:save','removeTags','download','unix','join','server','files','tmp','CmContact','firstName','lastName','Attachment','Messages','secret','Account','Owner','get','Whatsapp','disposition','basename','createReadStream','createWriteStream','direction','out','System','renderFile','root','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x30c05b,_0x44cfcc){var _0x9b8cd3=function(_0x224a0c){while(--_0x224a0c){_0x30c05b['push'](_0x30c05b['shift']());}};_0x9b8cd3(++_0x44cfcc);}(_0x2ff5,0x1d5));var _0x52ff=function(_0x461380,_0x3c51d1){_0x461380=_0x461380-0x0;var _0x3b9036=_0x2ff5[_0x461380];return _0x3b9036;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x52ff('0x0'));var zipdir=require(_0x52ff('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x52ff('0x2'));var moment=require(_0x52ff('0x3'));var BPromise=require(_0x52ff('0x4'));var Mustache=require(_0x52ff('0x5'));var util=require(_0x52ff('0x6'));var path=require(_0x52ff('0x7'));var sox=require('sox');var csv=require(_0x52ff('0x8'));var ejs=require(_0x52ff('0x9'));var fs=require('fs');var fs_extra=require(_0x52ff('0xa'));var _=require('lodash');var squel=require(_0x52ff('0xb'));var crypto=require(_0x52ff('0xc'));var jsforce=require(_0x52ff('0xd'));var deskjs=require(_0x52ff('0xe'));var toCsv=require(_0x52ff('0x8'));var querystring=require(_0x52ff('0xf'));var Papa=require(_0x52ff('0x10'));var Redis=require(_0x52ff('0x11'));var authService=require(_0x52ff('0x12'));var qs=require(_0x52ff('0x13'));var as=require(_0x52ff('0x14'));var pdf=require(_0x52ff('0x15'));var hardwareService=require(_0x52ff('0x16'));var logger=require(_0x52ff('0x17'))(_0x52ff('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x52ff('0x19')]=_['defaults'](config[_0x52ff('0x19')],{'host':_0x52ff('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x52ff('0x19')]));require(_0x52ff('0x1b'))[_0x52ff('0x1c')](socket);function respondWithStatusCode(_0x2023d3,_0x418202){_0x418202=_0x418202||0xcc;return function(_0x27c987){if(_0x27c987){return _0x2023d3['sendStatus'](_0x418202);}return _0x2023d3[_0x52ff('0x1d')](_0x418202)[_0x52ff('0x1e')]();};}function respondWithResult(_0x3154b7,_0x4c83f){_0x4c83f=_0x4c83f||0xc8;return function(_0xa7ce6c){if(_0xa7ce6c){return _0x3154b7[_0x52ff('0x1d')](_0x4c83f)['json'](_0xa7ce6c);}};}function respondWithFilteredResult(_0x426858,_0x154419){return function(_0x3cbe60){if(_0x3cbe60){var _0x36d544=typeof _0x154419['offset']===_0x52ff('0x1f')&&typeof _0x154419[_0x52ff('0x20')]===_0x52ff('0x1f');var _0x58efb4=_0x3cbe60[_0x52ff('0x21')];var _0x10ad04=_0x36d544?0x0:_0x154419[_0x52ff('0x22')];var _0x1d36c0=_0x36d544?_0x3cbe60[_0x52ff('0x21')]:_0x154419[_0x52ff('0x22')]+_0x154419[_0x52ff('0x20')];var _0x1f4bf3;if(_0x1d36c0>=_0x58efb4){_0x1d36c0=_0x58efb4;_0x1f4bf3=0xc8;}else{_0x1f4bf3=0xce;}_0x426858[_0x52ff('0x1d')](_0x1f4bf3);return _0x426858[_0x52ff('0x23')](_0x52ff('0x24'),_0x10ad04+'-'+_0x1d36c0+'/'+_0x58efb4)[_0x52ff('0x25')](_0x3cbe60);}return null;};}function patchUpdates(_0x1414c3){return function(_0x3e441b){try{jsonpatch['apply'](_0x3e441b,_0x1414c3,!![]);}catch(_0x376edf){return BPromise[_0x52ff('0x26')](_0x376edf);}return _0x3e441b[_0x52ff('0x27')]();};}function saveUpdates(_0x3accd4,_0x55f32d){return function(_0x4172ec){if(_0x4172ec){return _0x4172ec[_0x52ff('0x28')](_0x3accd4)[_0x52ff('0x29')](function(_0x5a6ebc){return _0x5a6ebc;});}return null;};}function removeEntity(_0x5b8905,_0x1ac770){return function(_0x3f5e22){if(_0x3f5e22){return _0x3f5e22[_0x52ff('0x2a')]()[_0x52ff('0x29')](function(){_0x5b8905[_0x52ff('0x1d')](0xcc)[_0x52ff('0x1e')]();});}};}function handleEntityNotFound(_0x25450b,_0x322260){return function(_0x1a706c){if(!_0x1a706c){_0x25450b[_0x52ff('0x2b')](0x194);}return _0x1a706c;};}function handleError(_0xd95637,_0x24094b){_0x24094b=_0x24094b||0x1f4;return function(_0x406343){logger[_0x52ff('0x2c')](_0x406343['stack']);if(_0x406343[_0x52ff('0x2d')]){delete _0x406343['name'];}_0xd95637[_0x52ff('0x1d')](_0x24094b)[_0x52ff('0x2e')](_0x406343);};}function getInteractionUsers(_0x530abb,_0x2d1cba){return new BPromise(function(_0x326d23,_0x264c7c){try{if(_0x2d1cba[_0x530abb['id']]){_0x530abb[_0x52ff('0x2f')]=_['map'](_0x2d1cba[_0x530abb['id']],function(_0x320c07){return{'id':_0x320c07['id'],'fullname':_0x320c07[_0x52ff('0x30')]};});}}catch(_0x526c35){_0x264c7c(_0x526c35);}_0x326d23(_0x530abb);});}function getInteractionTags(_0x603c97,_0x2f437d){return new BPromise(function(_0xef339d,_0x35f605){try{if(_0x603c97['TagIds']){_0x603c97[_0x52ff('0x31')]=[];_0x603c97[_0x52ff('0x32')]['split'](',')[_0x52ff('0x33')](function(_0x4757f6){_0x603c97[_0x52ff('0x31')][_0x52ff('0x34')](_0x2f437d[_0x4757f6]);});}delete _0x603c97['TagIds'];}catch(_0x14eded){_0x35f605(_0x14eded);}_0xef339d(_0x603c97);});}function updateWhatsappInteraction(_0x529415,_0x30f096,_0x23decc){return new BPromise(function(_0x56988b,_0x18fb46){return getInteractionUsers(_0x529415,_0x23decc)[_0x52ff('0x29')](function(_0x3c2617){return getInteractionTags(_0x3c2617,_0x30f096);})['then'](function(_0x4f3d97){return getStateInteraction(_0x4f3d97);})[_0x52ff('0x29')](function(_0x4b72cd){_0x56988b(_0x4b72cd);})[_0x52ff('0x35')](function(_0x4f5997){_0x18fb46(_0x4f5997);});});}function getStateInteraction(_0x14f909){return new BPromise(function(_0x2a5653){_0x14f909['waiting']=0x0;_0x14f909[_0x52ff('0x36')]=0x0;_0x14f909[_0x52ff('0x37')]=0x0;_0x14f909[_0x52ff('0x38')]=0x0;_0x14f909[_0x52ff('0x39')]=0x0;if(!_0x14f909[_0x52ff('0x3a')]&&!_0x14f909[_0x52ff('0x3b')]){_0x14f909[_0x52ff('0x3c')]+=0x1;}if(!_0x14f909['closed']&&_0x14f909[_0x52ff('0x3b')]){_0x14f909[_0x52ff('0x36')]+=0x1;if(_0x14f909[_0x52ff('0x3c')]){_0x14f909[_0x52ff('0x3c')]-=0x1;}}if(_0x14f909[_0x52ff('0x3a')]&&_0x14f909[_0x52ff('0x3b')]){_0x14f909[_0x52ff('0x37')]+=0x1;if(_0x14f909['talking']){_0x14f909[_0x52ff('0x36')]-=0x1;}}if(_0x14f909[_0x52ff('0x3a')]&&!_0x14f909[_0x52ff('0x3b')]){_0x14f909['unmanaged']+=0x1;if(_0x14f909['waiting']){_0x14f909[_0x52ff('0x3c')]-=0x1;}}_0x14f909['total']+=0x1;_0x2a5653(_0x14f909);});}exports[_0x52ff('0x3d')]=function(_0xbbfef8,_0x245d42){var _0x28c330={},_0x27d3f1={},_0x1eb769={'count':0x0,'rows':[]};var _0x4482d4=_[_0x52ff('0x3e')](db[_0x52ff('0x3f')]['rawAttributes'],function(_0x34b0dc){return{'name':_0x34b0dc[_0x52ff('0x40')],'type':_0x34b0dc['type'][_0x52ff('0x41')]};});_0x27d3f1[_0x52ff('0x42')]=_[_0x52ff('0x3e')](_0x4482d4,_0x52ff('0x2d'));_0x27d3f1[_0x52ff('0x43')]=_[_0x52ff('0x44')](_0xbbfef8[_0x52ff('0x43')]);_0x27d3f1['filters']=_[_0x52ff('0x45')](_0x27d3f1[_0x52ff('0x42')],_0x27d3f1[_0x52ff('0x43')]);_0x28c330[_0x52ff('0x46')]=_['intersection'](_0x27d3f1['model'],qs[_0x52ff('0x47')](_0xbbfef8[_0x52ff('0x43')][_0x52ff('0x47')]));_0x28c330[_0x52ff('0x46')]=_0x28c330[_0x52ff('0x46')]['length']?_0x28c330[_0x52ff('0x46')]:_0x27d3f1[_0x52ff('0x42')];if(!_0xbbfef8[_0x52ff('0x43')][_0x52ff('0x48')](_0x52ff('0x49'))){_0x28c330[_0x52ff('0x20')]=qs[_0x52ff('0x20')](_0xbbfef8[_0x52ff('0x43')][_0x52ff('0x20')]);_0x28c330[_0x52ff('0x22')]=qs['offset'](_0xbbfef8[_0x52ff('0x43')][_0x52ff('0x22')]);}_0x28c330[_0x52ff('0x4a')]=qs[_0x52ff('0x4b')](_0xbbfef8[_0x52ff('0x43')]['sort']);_0x28c330[_0x52ff('0x4c')]=qs[_0x52ff('0x4d')](_['pick'](_0xbbfef8[_0x52ff('0x43')],_0x27d3f1[_0x52ff('0x4d')]),_0x4482d4);var _0x6fa6a3=[];var _0x3e5e8d=squel['select']()['field']('id')[_0x52ff('0x4e')](_0x52ff('0x2d'))[_0x52ff('0x4e')](_0x52ff('0x4f'))[_0x52ff('0x50')](_0x52ff('0x51'));var _0x38283f=squel['select']()['field'](_0x52ff('0x52'))[_0x52ff('0x4e')](_0x52ff('0x53'))[_0x52ff('0x4e')](_0x52ff('0x54'))[_0x52ff('0x50')](_0x52ff('0x55'),'ui')[_0x52ff('0x56')](_0x52ff('0x57'),'u','u.id\x20=\x20ui.UserId');var _0x32d3d0=squel[_0x52ff('0x58')]()[_0x52ff('0x50')](_0x52ff('0x59'),'i')[_0x52ff('0x56')]('cm_contacts','c',_0x52ff('0x5a'))[_0x52ff('0x56')](_0x52ff('0x57'),'o',_0x52ff('0x5b'))['left_join'](_0x52ff('0x5c'),'a',_0x52ff('0x5d'))[_0x52ff('0x56')](_0x52ff('0x5e'),'me',_0x52ff('0x5f'))[_0x52ff('0x56')]('whatsapp_interaction_has_tags','it',_0x52ff('0x60'))['left_join'](_0x52ff('0x51'),'t',_0x52ff('0x61'));var _0x445cb2=squel[_0x52ff('0x62')]();var _0x4a1e3c=[];var _0x21c71a=squel['expr']();var _0x2207a0;if(_0xbbfef8['query']['search']){_0x2207a0=as[_0x52ff('0x63')](_0xbbfef8[_0x52ff('0x43')]['search']);var _0x474514=_0x2207a0['sqlOperator'];for(var _0x4141d5=0x0;_0x4141d5<_0x2207a0['conditions'][_0x52ff('0x64')];_0x4141d5++){var _0x319fc7=_0x2207a0[_0x52ff('0x65')][_0x4141d5];var _0xd3f42d='i';var _0x5aff4a=_[_0x52ff('0x66')](_0x4482d4,[_0x52ff('0x2d'),_0x319fc7[_0x52ff('0x4e')]]);if(!_0x5aff4a){switch(_0x319fc7[_0x52ff('0x4e')]){case _0x52ff('0x67'):if(_0x319fc7[_0x52ff('0x68')]==0x1){_0x32d3d0[_0x52ff('0x69')]('`'+_0x319fc7['field']+'`\x20=\x200');}else{_0x32d3d0['having']('`'+_0x319fc7['field']+_0x52ff('0x6a'));}break;case _0x52ff('0x6b'):if(_0x319fc7[_0x52ff('0x6c')]===_0x52ff('0x6d')){if(_0x319fc7[_0x52ff('0x68')][_0x52ff('0x6e')]('\x20')['length']>0x1){_0x445cb2[_0x474514](_0x52ff('0x6f'),qs[_0x52ff('0x70')](_0x319fc7[_0x52ff('0x68')]),null);}else{var _0x2c4ee6='%'+_0x319fc7[_0x52ff('0x68')]+'%';_0x445cb2[_0x474514](_0x52ff('0x71'),_0x2c4ee6,_0x2c4ee6,_0x2c4ee6);}}else{_0x5aff4a=_['find'](_0x4482d4,[_0x52ff('0x2d'),_0x52ff('0x72')]);_0x319fc7[_0x52ff('0x4e')]=_0x52ff('0x72');_0x565a82=as[_0x52ff('0x73')](_0xd3f42d,_0x5aff4a[_0x52ff('0x74')],_0x319fc7);_0x445cb2[_0x474514](_0x565a82[_0x52ff('0x75')],_0x565a82[_0x52ff('0x68')][_0x52ff('0x76')],_0x565a82[_0x52ff('0x68')][_0x52ff('0x1e')]);}break;case _0x52ff('0x77'):var _0x466c10=_0x319fc7[_0x52ff('0x68')]['split'](',')[_0x52ff('0x3e')](function(_0x33990d){return Number(_0x33990d);});_0x466c10[_0x52ff('0x33')](function(_0x31aa09){_0x21c71a['or'](_0x52ff('0x78'),'%,'+_0x31aa09+',%');});_0x4a1e3c=_[_0x52ff('0x79')](_0x4a1e3c,_0x466c10);break;case _0x52ff('0x7a'):if(_0x319fc7['operator']===_0x52ff('0x6d')){_0x445cb2[_0x474514](_0x52ff('0x7b'),'%'+_0x319fc7[_0x52ff('0x68')]+'%',null);}else{_0x5aff4a=_[_0x52ff('0x66')](_0x4482d4,['name',_0x52ff('0x3b')]);_0x319fc7[_0x52ff('0x4e')]=_0x52ff('0x3b');_0x565a82=as[_0x52ff('0x73')](_0xd3f42d,_0x5aff4a[_0x52ff('0x74')],_0x319fc7);_0x445cb2[_0x474514](_0x565a82[_0x52ff('0x75')],_0x565a82[_0x52ff('0x68')]['start'],_0x565a82[_0x52ff('0x68')][_0x52ff('0x1e')]);}break;case _0x52ff('0x7c'):_0x565a82=as[_0x52ff('0x73')]('me',null,_0x319fc7);_0x445cb2[_0x474514](_0x565a82[_0x52ff('0x75')],_0x565a82[_0x52ff('0x68')][_0x52ff('0x76')],_0x565a82[_0x52ff('0x68')][_0x52ff('0x1e')]);break;}}else{var _0x565a82=as['buildExpression'](_0xd3f42d,_0x5aff4a[_0x52ff('0x74')],_0x319fc7);_0x445cb2[_0x474514](_0x565a82[_0x52ff('0x75')],_0x565a82[_0x52ff('0x68')][_0x52ff('0x76')],_0x565a82[_0x52ff('0x68')][_0x52ff('0x1e')]);}}}else{var _0xdc235b=_(_0xbbfef8[_0x52ff('0x43')])[_0x52ff('0x44')]()[_0x52ff('0x3e')](function(_0x5b3fe0){return _['some'](_0x4482d4,[_0x52ff('0x2d'),_0x5b3fe0])?_0x5b3fe0:undefined;})[_0x52ff('0x7d')]()[_0x52ff('0x68')]();if(!_[_0x52ff('0x7e')](_0xdc235b)){_0xdc235b[_0x52ff('0x33')](function(_0x361025){if(_0x361025===_0x52ff('0x7f')){_0x32d3d0[_0x52ff('0x4c')](_0x52ff('0x80'),[][_0x52ff('0x81')](_0xbbfef8['query'][_0x361025]));}else if(_0x361025===_0x52ff('0x82')){var _0x18c357=JSON[_0x52ff('0x83')](_0xbbfef8[_0x52ff('0x43')][_0x361025])[_0x52ff('0x84')];var _0x1fa59c=JSON['parse'](_0xbbfef8[_0x52ff('0x43')][_0x361025])['$lte'];_0x32d3d0[_0x52ff('0x4c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x18c357,_0x1fa59c);}else{if(_0xbbfef8['query'][_0x361025]===_0x52ff('0x85')){_0x32d3d0[_0x52ff('0x4c')]('i.'+_0x361025+'\x20IS\x20NULL');}else{_0x32d3d0[_0x52ff('0x4c')]('i.'+_0x361025+_0x52ff('0x86'),_0xbbfef8[_0x52ff('0x43')][_0x361025]);}}});}if(_0xbbfef8[_0x52ff('0x43')][_0x52ff('0x87')]){if(_0xbbfef8['query'][_0x52ff('0x87')]==0x1){_0x32d3d0[_0x52ff('0x69')](_0x52ff('0x88'));}else{_0x32d3d0[_0x52ff('0x69')]('`unreadMessages`\x20>\x200');}}if(_0xbbfef8[_0x52ff('0x43')][_0x52ff('0x89')]){_0x4a1e3c=_[_0x52ff('0x8a')](_0xbbfef8[_0x52ff('0x43')]['tag'])?_0xbbfef8['query'][_0x52ff('0x89')]:new Array(_0xbbfef8[_0x52ff('0x43')][_0x52ff('0x89')]);_0x4a1e3c[_0x52ff('0x33')](function(_0xb1839){_0x21c71a['or'](_0x52ff('0x78'),'%,'+_0xb1839+',%');});}if(_0xbbfef8['query'][_0x52ff('0x8b')]){var _0x8a4f23=_0xbbfef8[_0x52ff('0x43')][_0x52ff('0x8b')][_0x52ff('0x8c')]('\x5c','\x5c\x5c')[_0x52ff('0x8c')](/'/g,'\x27\x27');if(qs[_0x52ff('0x8d')](_0x8a4f23)){_0x445cb2['or']('i.id\x20LIKE\x20?',_0x8a4f23+'%')['or'](_0x52ff('0x8e'),_0x8a4f23+'%');}else{_0x445cb2['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x52ff('0x70')](_0x8a4f23))['or'](_0x52ff('0x8f'),_0x8a4f23+'%');}}}_0x32d3d0[_0x52ff('0x4c')](_0x445cb2);_0x32d3d0[_0x52ff('0x90')](_0x52ff('0x91'));var _0x435c34={'type':db[_0x52ff('0x92')]['QueryTypes'][_0x52ff('0x93')],'raw':!![]};var _0x132537=_0x32d3d0[_0x52ff('0x94')]();_0x132537[_0x52ff('0x4e')]('i.id');_0x132537[_0x52ff('0x4e')](_0x52ff('0x95'),'unreadMessages');if(_0x28c330[_0x52ff('0x4a')]){_0x28c330[_0x52ff('0x4a')][_0x52ff('0x33')](function(_0x312165){var _0x41710e=_0x312165[0x0]==='contactName'?_0x312165[0x0]:'i.'+_0x312165[0x0];_0x32d3d0[_0x52ff('0x4a')](_0x41710e,_0x312165[0x1]===_0x52ff('0x96')?![]:!![]);});}if(!_[_0x52ff('0x7e')](_0x4a1e3c)){_0x32d3d0[_0x52ff('0x69')](_0x21c71a);_0x132537[_0x52ff('0x4c')](_0x52ff('0x97'),_0x4a1e3c);}BPromise[_0x52ff('0x98')]()[_0x52ff('0x29')](function(){if(!_0x2207a0){if(_0xbbfef8['query'][_0x52ff('0x7f')])return;_0x132537[_0x52ff('0x4c')](_0x52ff('0x99'));_0x32d3d0[_0x52ff('0x4c')](_0x52ff('0x99'));return;}if(_0xbbfef8['user'][_0x52ff('0x9a')]!==_0x52ff('0x9b'))return;return _0xbbfef8['user'][_0x52ff('0x9c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1ef0aa){if(_[_0x52ff('0x7e')](_0x1ef0aa)){_0x132537['where']('i.WhatsappAccountId\x20IS\x20NULL');_0x32d3d0[_0x52ff('0x4c')](_0x52ff('0x9d'));}else{_0x132537[_0x52ff('0x4c')](_0x52ff('0x80'),_[_0x52ff('0x3e')](_0x1ef0aa,'id'));_0x32d3d0[_0x52ff('0x4c')](_0x52ff('0x80'),_[_0x52ff('0x3e')](_0x1ef0aa,'id'));}});})[_0x52ff('0x29')](function(){if(_0xbbfef8['user'][_0x52ff('0x9a')]===_0x52ff('0x9b')&&!_0x2207a0&&!_0xbbfef8[_0x52ff('0x43')][_0x52ff('0x7f')])return[];return db[_0x52ff('0x9e')][_0x52ff('0x43')](_0x132537[_0x52ff('0x9f')](),_0x435c34);})[_0x52ff('0x29')](function(_0x58e9fa){_0x1eb769[_0x52ff('0x21')]=_0x58e9fa[_0x52ff('0x64')];if(_0x1eb769[_0x52ff('0x21')]===0x0)return[];return db[_0x52ff('0x9e')]['query'](_0x3e5e8d[_0x52ff('0x9f')](),_0x435c34)[_0x52ff('0x29')](function(_0x5a141c){_0x6fa6a3=_['keyBy'](_0x5a141c,'id');_0x435c34=_[_0x52ff('0xa0')](_0x435c34,{'model':db[_0x52ff('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xbbfef8[_0x52ff('0x43')][_0x52ff('0x47')]){_0x28c330['attributes'][_0x52ff('0x33')](function(_0xdd3215){_0x32d3d0[_0x52ff('0x4e')]('i.'+_0xdd3215);});}else{_0x32d3d0[_0x52ff('0x4e')](_0x52ff('0x95'),_0x52ff('0x67'));_0x32d3d0[_0x52ff('0x4e')](_0x52ff('0xa1'),_0x52ff('0xa2'));_0x32d3d0[_0x52ff('0x4e')]('a.mandatoryDisposition',_0x52ff('0xa3'));_0x32d3d0[_0x52ff('0x4e')](_0x52ff('0xa4'),_0x52ff('0xa5'));_0x32d3d0[_0x52ff('0x4e')](_0x52ff('0xa6'));_0x32d3d0[_0x52ff('0x4e')](_0x52ff('0xa7'),_0x52ff('0xa8'));_0x32d3d0[_0x52ff('0x4e')](_0x52ff('0xa9'),'Contact.lastName');_0x32d3d0[_0x52ff('0x4e')](_0x52ff('0xaa'),_0x52ff('0xab'));_0x32d3d0['field']('c.phone',_0x52ff('0xac'));_0x32d3d0[_0x52ff('0x4e')](_0x52ff('0xad'),_0x52ff('0xae'));_0x32d3d0[_0x52ff('0x4e')]('c.fax',_0x52ff('0xaf'));_0x32d3d0[_0x52ff('0x4e')](_0x52ff('0xb0'),_0x52ff('0xb1'));_0x32d3d0[_0x52ff('0x4e')](_0x52ff('0xb2'),_0x52ff('0xb3'));_0x32d3d0[_0x52ff('0x4e')](_0x52ff('0xb4'),_0x52ff('0x32'));}if(_0x28c330[_0x52ff('0x20')])_0x32d3d0[_0x52ff('0x20')](_0x28c330[_0x52ff('0x20')]);if(_0x28c330[_0x52ff('0x22')])_0x32d3d0[_0x52ff('0x22')](_0x28c330[_0x52ff('0x22')]);return db[_0x52ff('0x9e')][_0x52ff('0x43')](_0x32d3d0['toString'](),_0x435c34);})[_0x52ff('0x29')](function(_0x3abbf9){if(_0x3abbf9[_0x52ff('0x64')]>0x0)_0x38283f[_0x52ff('0x4c')](_0x52ff('0xb5'),_[_0x52ff('0x3e')](_0x3abbf9,'id'));return db['sequelize']['query'](_0x38283f[_0x52ff('0x9f')](),_0x435c34)[_0x52ff('0x29')](function(_0x2de329){var _0x3e10b2=_['groupBy'](_0x2de329,_0x52ff('0xb6'));var _0x241171=[];_0x3abbf9[_0x52ff('0x33')](function(_0x43b279){_0x241171[_0x52ff('0x34')](updateWhatsappInteraction(_0x43b279,_0x6fa6a3,_0x3e10b2));});return BPromise[_0x52ff('0xb7')](_0x241171);});});})[_0x52ff('0x29')](function(_0x1e468f){_0x1eb769[_0x52ff('0xb8')]=_0x1e468f;return _0x1eb769;})[_0x52ff('0x29')](respondWithFilteredResult(_0x245d42,_0x28c330))[_0x52ff('0x35')](handleError(_0x245d42,null));};exports['show']=function(_0x1bfcd4,_0xdc2520){var _0x5a4ee2={'raw':![],'where':{'id':_0x1bfcd4[_0x52ff('0xb9')]['id']}},_0x5c9940={};_0x5c9940[_0x52ff('0x42')]=_[_0x52ff('0x44')](db[_0x52ff('0x3f')][_0x52ff('0xba')]);_0x5c9940['query']=_[_0x52ff('0x44')](_0x1bfcd4['query']);_0x5c9940[_0x52ff('0x4d')]=_[_0x52ff('0x45')](_0x5c9940[_0x52ff('0x42')],_0x5c9940[_0x52ff('0x43')]);_0x5a4ee2[_0x52ff('0x46')]=_[_0x52ff('0x45')](_0x5c9940['model'],qs[_0x52ff('0x47')](_0x1bfcd4[_0x52ff('0x43')][_0x52ff('0x47')]));_0x5a4ee2[_0x52ff('0x46')]=_0x5a4ee2['attributes'][_0x52ff('0x64')]?_0x5a4ee2[_0x52ff('0x46')]:_0x5c9940[_0x52ff('0x42')];if(_0x1bfcd4[_0x52ff('0x43')]['includeAll']){_0x5a4ee2[_0x52ff('0xbb')]=[{'all':!![]}];}_0x5a4ee2=_[_0x52ff('0xa0')]({},_0x5a4ee2,_0x1bfcd4[_0x52ff('0xbc')]);return db[_0x52ff('0x3f')][_0x52ff('0x66')](_0x5a4ee2)[_0x52ff('0x29')](handleEntityNotFound(_0xdc2520,null))[_0x52ff('0x29')](respondWithResult(_0xdc2520,null))[_0x52ff('0x35')](handleError(_0xdc2520,null));};exports[_0x52ff('0xbd')]=function(_0x1ef4b5,_0xb607){return db['WhatsappInteraction'][_0x52ff('0xbd')](_0x1ef4b5[_0x52ff('0x7c')],{})['then'](respondWithResult(_0xb607,0xc9))[_0x52ff('0x35')](handleError(_0xb607,null));};exports[_0x52ff('0x28')]=function(_0x402b47,_0x11e530){if(_0x402b47[_0x52ff('0x7c')]['id']){delete _0x402b47[_0x52ff('0x7c')]['id'];}return db[_0x52ff('0x3f')][_0x52ff('0x66')]({'where':{'id':_0x402b47[_0x52ff('0xb9')]['id']}})[_0x52ff('0x29')](handleEntityNotFound(_0x11e530,null))['then'](saveUpdates(_0x402b47[_0x52ff('0x7c')],null))['then'](respondWithResult(_0x11e530,null))[_0x52ff('0x35')](handleError(_0x11e530,null));};exports[_0x52ff('0x2a')]=function(_0x1a5054,_0x18b714){return db[_0x52ff('0x3f')][_0x52ff('0x66')]({'where':{'id':_0x1a5054[_0x52ff('0xb9')]['id']}})[_0x52ff('0x29')](handleEntityNotFound(_0x18b714,null))[_0x52ff('0x29')](removeEntity(_0x18b714,null))['catch'](handleError(_0x18b714,null));};exports[_0x52ff('0xbe')]=function(_0x58f451,_0x981528){return db['WhatsappInteraction'][_0x52ff('0xbe')]()[_0x52ff('0x29')](respondWithResult(_0x981528,null))['catch'](handleError(_0x981528,null));};exports[_0x52ff('0xbf')]=function(_0x5b05bd,_0xd5bd41,_0x2d95da){return db['WhatsappMessage'][_0x52ff('0x66')]({'where':{'id':_0x5b05bd[_0x52ff('0xb9')]['id']}})[_0x52ff('0x29')](handleEntityNotFound(_0xd5bd41,null))[_0x52ff('0x29')](function(_0xa66646){if(_0xa66646){return _0xa66646[_0x52ff('0xbf')](_0x5b05bd[_0x52ff('0x7c')]['ids'],_[_0x52ff('0xc0')](_0x5b05bd[_0x52ff('0x7c')],[_0x52ff('0xc1'),'id'])||{});}})['then'](respondWithResult(_0xd5bd41,null))['catch'](handleError(_0xd5bd41,null));};exports[_0x52ff('0xc2')]=function(_0xe3913a,_0x3be917,_0x1d54eb){var _0x1567ab={'raw':![],'where':{}};var _0x5eb838={};var _0xf45ca5={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x52ff('0xc3')]({'where':{'id':_0xe3913a[_0x52ff('0xb9')]['id']}})[_0x52ff('0x29')](handleEntityNotFound(_0x3be917,null))[_0x52ff('0x29')](function(_0x2ad891){if(_0x2ad891){_0x5eb838[_0x52ff('0x42')]=_[_0x52ff('0x44')](db['WhatsappMessage'][_0x52ff('0xba')]);_0x5eb838[_0x52ff('0x43')]=_[_0x52ff('0x44')](_0xe3913a[_0x52ff('0x43')]);_0x5eb838[_0x52ff('0x4d')]=_['intersection'](_0x5eb838[_0x52ff('0x42')],_0x5eb838[_0x52ff('0x43')]);_0x1567ab[_0x52ff('0x46')]=_[_0x52ff('0x45')](_0x5eb838[_0x52ff('0x42')],qs['fields'](_0xe3913a[_0x52ff('0x43')][_0x52ff('0x47')]));_0x1567ab[_0x52ff('0x46')]=_0x1567ab['attributes'][_0x52ff('0x64')]?_0x1567ab[_0x52ff('0x46')]:_0x5eb838[_0x52ff('0x42')];if(!_0xe3913a[_0x52ff('0x43')][_0x52ff('0x48')](_0x52ff('0x49'))){_0x1567ab[_0x52ff('0x20')]=qs[_0x52ff('0x20')](_0xe3913a[_0x52ff('0x43')]['limit']);_0x1567ab[_0x52ff('0x22')]=qs['offset'](_0xe3913a[_0x52ff('0x43')]['offset']);}_0x1567ab[_0x52ff('0x4a')]=qs[_0x52ff('0x4b')](_0xe3913a[_0x52ff('0x43')][_0x52ff('0x4b')]);_0x1567ab[_0x52ff('0x4c')]=qs[_0x52ff('0x4d')](_[_0x52ff('0xc4')](_0xe3913a['query'],_0x5eb838[_0x52ff('0x4d')]));_0x1567ab[_0x52ff('0x4c')]['WhatsappInteractionId']=_0x2ad891['id'];if(_0xe3913a[_0x52ff('0x43')][_0x52ff('0x8b')]){_0x1567ab[_0x52ff('0x4c')]=_[_0x52ff('0xa0')](_0x1567ab[_0x52ff('0x4c')],{'$or':_[_0x52ff('0x3e')](_0x1567ab[_0x52ff('0x46')],function(_0x1c5870){var _0x248f68={};_0x248f68[_0x1c5870]={'$like':'%'+_0xe3913a['query'][_0x52ff('0x8b')]+'%'};return _0x248f68;})});}if(_0xe3913a['query'][_0x52ff('0x84')]){var _0x5f29fd=_0xe3913a['query'][_0x52ff('0x84')][_0x52ff('0x6e')](',');var _0x19cfe3={};_0x19cfe3[_0x5f29fd[0x0]]={'$gte':moment(_0x5f29fd[0x1])[_0x52ff('0xc5')](_0x52ff('0xc6'))};_0x1567ab['where']=_[_0x52ff('0xa0')](_0x1567ab[_0x52ff('0x4c')],_0x19cfe3);}_0x1567ab=_[_0x52ff('0xa0')]({},_0x1567ab,_0xe3913a['options']);return db['WhatsappMessage'][_0x52ff('0x21')]({'where':_0x1567ab['where']})[_0x52ff('0x29')](function(_0x35ad42){_0xf45ca5[_0x52ff('0x21')]=_0x35ad42;if(_0xe3913a[_0x52ff('0x43')][_0x52ff('0xc7')]){_0x1567ab[_0x52ff('0xbb')]=[{'all':!![]}];}return db[_0x52ff('0xc8')]['findAll'](_0x1567ab);})[_0x52ff('0x29')](function(_0x4053c1){_0xf45ca5[_0x52ff('0xb8')]=_0x4053c1;return _0xf45ca5;});}})['then'](respondWithFilteredResult(_0x3be917,_0x1567ab))[_0x52ff('0x35')](handleError(_0x3be917,null));};exports[_0x52ff('0xc9')]=function(_0xebca29,_0x50654a,_0x530a2d){return db[_0x52ff('0x3f')][_0x52ff('0x66')]({'where':{'id':_0xebca29[_0x52ff('0xb9')]['id']}})[_0x52ff('0x29')](handleEntityNotFound(_0x50654a,null))[_0x52ff('0x29')](function(_0x42f1ce){if(_0x42f1ce){return _0x42f1ce[_0x52ff('0xca')](_0xebca29[_0x52ff('0x7c')][_0x52ff('0xc1')],_[_0x52ff('0xc0')](_0xebca29['body'],['ids','id'])||{})[_0x52ff('0xcb')](function(){return db[_0x52ff('0x77')][_0x52ff('0xcc')]({'attributes':['id',_0x52ff('0x2d'),_0x52ff('0x4f')],'where':{'id':_0xebca29[_0x52ff('0x7c')][_0x52ff('0xc1')]}});})[_0x52ff('0x29')](function(_0x345943){socket['emit'](_0x52ff('0xcd'),{'id':Number(_0xebca29[_0x52ff('0xb9')]['id']),'tags':_0x345943||[]});return{'id':Number(_0xebca29[_0x52ff('0xb9')]['id']),'tags':_0x345943||[]};});}})[_0x52ff('0x29')](respondWithResult(_0x50654a,null))[_0x52ff('0x35')](handleError(_0x50654a,null));};exports[_0x52ff('0xce')]=function(_0x3c6146,_0x26ce46,_0x4d0a47){return db[_0x52ff('0x3f')][_0x52ff('0x66')]({'where':{'id':_0x3c6146['params']['id']}})['then'](handleEntityNotFound(_0x26ce46,null))['then'](function(_0x4c5218){if(_0x4c5218){return _0x4c5218[_0x52ff('0xce')](_0x3c6146['query'][_0x52ff('0xc1')]);}})[_0x52ff('0x29')](respondWithStatusCode(_0x26ce46,null))['catch'](handleError(_0x26ce46,null));};exports[_0x52ff('0xcf')]=function(_0x47817e,_0xea4c45){var _0x1c2118=moment()[_0x52ff('0xd0')]()[_0x52ff('0x9f')]();var _0x47f78b=path[_0x52ff('0xd1')](config['root'],_0x52ff('0xd2'),_0x52ff('0xd3'),_0x52ff('0xd4'));var _0x3a93b3=path[_0x52ff('0xd1')](config['root'],_0x52ff('0xd2'),'files','attachments');var _0x400927=path[_0x52ff('0xd1')](_0x47f78b,_0x1c2118);var _0x2c10c9=util['format']('transcript-%d-%s.zip',_0x47817e[_0x52ff('0xb9')]['id'],_0x1c2118);var _0x5a9a88=path['join'](_0x47f78b,_0x2c10c9);var _0x5789a2=[];_0x5789a2[_0x52ff('0x34')]({'model':db[_0x52ff('0x7a')],'as':_0x52ff('0x7a'),'attributes':['id',_0x52ff('0x30')],'raw':!![]});_0x5789a2[_0x52ff('0x34')]({'model':db[_0x52ff('0xd5')],'as':_0x52ff('0x6b'),'attributes':['id',_0x52ff('0xd6'),_0x52ff('0xd7')],'raw':!![]});if(_0x47817e['query']['attachments']){_0x5789a2['push']({'model':db[_0x52ff('0xd8')],'as':_0x52ff('0xd8'),'raw':!![]});}var _0x1ed981=[{'model':db[_0x52ff('0xc8')],'as':_0x52ff('0xd9'),'attributes':['id',_0x52ff('0x7c'),_0x52ff('0x82'),'direction',_0x52ff('0xda'),_0x52ff('0x87')],'include':_0x5789a2}];_0x1ed981[_0x52ff('0x34')]({'model':db['WhatsappAccount'],'as':_0x52ff('0xdb'),'attributes':['id',_0x52ff('0x2d')]});_0x1ed981[_0x52ff('0x34')]({'model':db[_0x52ff('0x7a')],'as':_0x52ff('0xdc'),'attributes':['id',_0x52ff('0x30')]});return db[_0x52ff('0x3f')][_0x52ff('0x66')]({'where':{'id':_0x47817e[_0x52ff('0xb9')]['id']},'include':_0x1ed981})[_0x52ff('0x29')](handleEntityNotFound(_0xea4c45,null))['then'](function(_0x3de29f){if(_0x3de29f){var _0x44daad=_0x3de29f[_0x52ff('0xdd')]({'plain':!![]});fs['mkdirSync'](_0x400927);var _0x306225={'channel':_0x52ff('0xde'),'account':_0x44daad[_0x52ff('0xdb')][_0x52ff('0x2d')],'agent':_0x44daad['Owner']?_0x44daad[_0x52ff('0xdc')]['fullname']:'N.A.','createdAt':moment(_0x44daad[_0x52ff('0x82')])['format'](_0x52ff('0xc6'))['toString'](),'closedAt':_0x44daad['closed']?moment(_0x44daad['closedAt'])['format'](_0x52ff('0xc6'))[_0x52ff('0x9f')]():'','disposition':_0x44daad[_0x52ff('0xdf')],'messages':_(_0x44daad[_0x52ff('0xd9')])['filter']({'secret':![]})[_0x52ff('0x3e')](function(_0x303de5){if(_0x303de5['Attachment']){var _0x462f68=path[_0x52ff('0xd1')](_0x3a93b3,_0x303de5[_0x52ff('0xd8')][_0x52ff('0xe0')]);if(fs['existsSync'](_0x462f68)){fs[_0x52ff('0xe1')](_0x462f68)['pipe'](fs[_0x52ff('0xe2')](path[_0x52ff('0xd1')](_0x400927,_0x303de5[_0x52ff('0xd8')]['basename'])));}}return{'date':moment(_0x303de5[_0x52ff('0x82')])[_0x52ff('0xc5')](_0x52ff('0xc6'))[_0x52ff('0x9f')](),'sender':_0x303de5[_0x52ff('0xe3')]===_0x52ff('0xe4')?_0x303de5[_0x52ff('0x7a')]?_0x303de5[_0x52ff('0x7a')][_0x52ff('0x30')]:_0x52ff('0xe5'):_0x303de5[_0x52ff('0x6b')]['firstName']+(_0x303de5[_0x52ff('0x6b')][_0x52ff('0xd7')]?'\x20'+_0x303de5[_0x52ff('0x6b')][_0x52ff('0xd7')]:''),'body':_0x303de5[_0x52ff('0xd8')]?_0x303de5['Attachment']['basename']:_0x303de5[_0x52ff('0x7c')],'direction':_0x303de5[_0x52ff('0xe3')]==='out'?'A':'C','secret':_0x303de5['secret'],'read':_0x303de5[_0x52ff('0x87')],'attachment':_0x303de5['Attachment']};})[_0x52ff('0x68')]()};return ejs[_0x52ff('0xe6')](path[_0x52ff('0xd1')](config[_0x52ff('0xe7')],_0x52ff('0xd2'),'views',_0x52ff('0xe8')),{'interaction':_0x306225})[_0x52ff('0x29')](function(_0x500f23){var _0x4e887d=path[_0x52ff('0xd1')](_0x400927,_0x52ff('0xe9')+_0x44daad['id']+'-'+_0x1c2118+_0x52ff('0xea'));var _0x4c9afa={'path':_0x4e887d,'channel':_0x52ff('0xde'),'interactionId':_0x44daad['id']};return pdf[_0x52ff('0xeb')](_0x500f23,_0x4c9afa);})[_0x52ff('0x29')](function(){return new BPromise(function(_0x1d051e,_0xc1911a){zipdir(_0x400927,{'saveTo':_0x5a9a88},function(_0x19c7fd,_0x1acfdf){if(_0x19c7fd)return _0xc1911a(_0x19c7fd);return _0x1d051e(_0x1acfdf);});})[_0x52ff('0x29')](function(){return new BPromise(function(_0x56c3aa,_0x5a85aa){rimraf(_0x400927,function(_0x2ce8a5){if(_0x2ce8a5)_0x5a85aa(_0x2ce8a5);return _0x56c3aa();});});})[_0x52ff('0x29')](function(){return _0xea4c45[_0x52ff('0xcf')](_0x5a9a88,_0x2c10c9,function(_0x35d33d){if(_0x35d33d){console[_0x52ff('0xec')]('err',_0x35d33d);}else{fs[_0x52ff('0xed')](_0x5a9a88);}});});});}else{return _0xea4c45[_0x52ff('0x2b')](0xc8);}})[_0x52ff('0x35')](handleError(_0xea4c45,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 3fada8f..03c1ffb 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 _0xc125=['getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc125,0x150));var _0x5c12=function(_0x5a6e78,_0x313048){_0x5a6e78=_0x5a6e78-0x0;var _0x189fce=_0xc125[_0x5a6e78];return _0x189fce;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x5c12('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x5c12('0x0'))['db'][_0x5c12('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x5c12('0x2')](0x0);var events={'afterCreate':_0x5c12('0x3'),'afterUpdate':_0x5c12('0x4'),'afterDestroy':_0x5c12('0x5')};function emitEvent(_0x31bd53){return function(_0x275ea3,_0x3aa4b7,_0x3f1c8b){_0x275ea3[_0x5c12('0x6')]({'attributes':['id'],'raw':!![]})[_0x5c12('0x7')](function(_0x4cab65){_0x275ea3[_0x5c12('0x8')](_0x5c12('0x9'),_0x4cab65['map'](function(_0x29342a){return{'id':_0x29342a['id']};}));return WhatsappMessage[_0x5c12('0xa')]({'where':{'WhatsappInteractionId':_0x275ea3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5c12('0x7')](function(_0x33f493){_0x275ea3[_0x5c12('0x8')](_0x5c12('0xb'),_0x33f493[_0x5c12('0xc')]);WhatsappInteractionEvents[_0x5c12('0xd')](_0x31bd53+':'+_0x275ea3['id'],_0x275ea3);WhatsappInteractionEvents['emit'](_0x31bd53,_0x275ea3);_0x3f1c8b(null);})[_0x5c12('0xe')](_0x3f1c8b(null));};}for(var e in events){if(events[_0x5c12('0xf')](e)){var event=events[e];WhatsappInteraction[_0x5c12('0x10')](e,emitEvent(event));}}module[_0x5c12('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x6f54=['WhatsappInteraction','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x6f54,0xcf));var _0x46f5=function(_0x318373,_0x52fe0b){_0x318373=_0x318373-0x0;var _0x1cae11=_0x6f54[_0x318373];return _0x1cae11;};'use strict';var EventEmitter=require(_0x46f5('0x0'));var WhatsappInteraction=require(_0x46f5('0x1'))['db'][_0x46f5('0x2')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x46f5('0x3')](0x0);var events={'afterCreate':_0x46f5('0x4'),'afterUpdate':_0x46f5('0x5'),'afterDestroy':_0x46f5('0x6')};function emitEvent(_0x4d97ff){return function(_0x441c49,_0x5730ae,_0x479d56){_0x441c49[_0x46f5('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x30d52f){_0x441c49[_0x46f5('0x8')](_0x46f5('0x9'),_0x30d52f[_0x46f5('0xa')](function(_0x2664f7){return{'id':_0x2664f7['id']};}));return WhatsappMessage[_0x46f5('0xb')]({'where':{'WhatsappInteractionId':_0x441c49['id'],'direction':'in','read':![]},'raw':!![]});})[_0x46f5('0xc')](function(_0x22fe4e){_0x441c49[_0x46f5('0x8')](_0x46f5('0xd'),_0x22fe4e[_0x46f5('0xe')]);WhatsappInteractionEvents[_0x46f5('0xf')](_0x4d97ff+':'+_0x441c49['id'],_0x441c49);WhatsappInteractionEvents[_0x46f5('0xf')](_0x4d97ff,_0x441c49);_0x479d56(null);})[_0x46f5('0x10')](_0x479d56(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x46f5('0x11')](e,emitEvent(event));}}module[_0x46f5('0x12')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index b9fdd1f..5676233 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 _0x3e80=['rimraf','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e80,0x1b9));var _0x03e8=function(_0x151381,_0x97b314){_0x151381=_0x151381-0x0;var _0x2afab6=_0x3e80[_0x151381];return _0x2afab6;};'use strict';var _=require(_0x03e8('0x0'));var util=require(_0x03e8('0x1'));var logger=require(_0x03e8('0x2'))('api');var moment=require(_0x03e8('0x3'));var BPromise=require(_0x03e8('0x4'));var rp=require(_0x03e8('0x5'));var fs=require('fs');var path=require(_0x03e8('0x6'));var rimraf=require(_0x03e8('0x7'));var config=require('../../config/environment');var attributes=require(_0x03e8('0x8'));module[_0x03e8('0x9')]=function(_0x305ef0,_0x50054d){return _0x305ef0[_0x03e8('0xa')](_0x03e8('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x32402b,_0x17f632,_0x290d14){if(_0x32402b[_0x03e8('0xc')](_0x03e8('0xd'))){_0x32402b['closedAt']=moment()[_0x03e8('0xe')](_0x03e8('0xf'));}_0x290d14(null,_0x32402b);}}});}; \ No newline at end of file +var _0x2701=['define','whatsapp_interactions','closed','closedAt','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x3352b4,_0x48fb7e){var _0x3cd6bf=function(_0x36848e){while(--_0x36848e){_0x3352b4['push'](_0x3352b4['shift']());}};_0x3cd6bf(++_0x48fb7e);}(_0x2701,0x18a));var _0x1270=function(_0x35c571,_0x218a72){_0x35c571=_0x35c571-0x0;var _0x17f302=_0x2701[_0x35c571];return _0x17f302;};'use strict';var _=require(_0x1270('0x0'));var util=require(_0x1270('0x1'));var logger=require('../../config/logger')(_0x1270('0x2'));var moment=require(_0x1270('0x3'));var BPromise=require(_0x1270('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1270('0x5'));var rimraf=require(_0x1270('0x6'));var config=require(_0x1270('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0x1270('0x8')]=function(_0xbf2c6d,_0xc7226e){return _0xbf2c6d[_0x1270('0x9')]('WhatsappInteraction',attributes,{'tableName':_0x1270('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4eaf34,_0xaff806,_0x2b4c27){if(_0x4eaf34['changed'](_0x1270('0xb'))){_0x4eaf34[_0x1270('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2b4c27(null,_0x4eaf34);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 7bd2693..4fca0b6 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 _0x8e89=['defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','catch','WhatsappInteraction','body','options','raw','where','limit','then','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','addTags','ids','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','redis'];(function(_0x1cbb47,_0xd3a7b1){var _0x52a8f9=function(_0x3ad275){while(--_0x3ad275){_0x1cbb47['push'](_0x1cbb47['shift']());}};_0x52a8f9(++_0xd3a7b1);}(_0x8e89,0x8b));var _0x98e8=function(_0xcfeff4,_0x3f2e19){_0xcfeff4=_0xcfeff4-0x0;var _0xb2fadc=_0x8e89[_0xcfeff4];return _0xb2fadc;};'use strict';var _=require('lodash');var util=require(_0x98e8('0x0'));var moment=require(_0x98e8('0x1'));var BPromise=require('bluebird');var rs=require(_0x98e8('0x2'));var fs=require('fs');var Redis=require(_0x98e8('0x3'));var db=require(_0x98e8('0x4'))['db'];var utils=require(_0x98e8('0x5'));var logger=require('../../config/logger')(_0x98e8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x98e8('0x7')]({'port':0x232a});config[_0x98e8('0x8')]=_[_0x98e8('0x9')](config[_0x98e8('0x8')],{'host':_0x98e8('0xa'),'port':0x18eb});var socket=require(_0x98e8('0xb'))(new Redis(config[_0x98e8('0x8')]));require(_0x98e8('0xc'))[_0x98e8('0xd')](socket);function respondWithRpcPromise(_0x1435a9,_0x1b345d,_0xf0f4ae){return new BPromise(function(_0x50b878,_0x40548d){return client['request'](_0x1435a9,_0xf0f4ae)['then'](function(_0xa02736){logger[_0x98e8('0xe')]('WhatsappInteraction,\x20%s,\x20%s',_0x1b345d,_0x98e8('0xf'));logger[_0x98e8('0x10')](_0x98e8('0x11'),_0x1b345d,'request\x20sent',JSON[_0x98e8('0x12')](_0xa02736));if(_0xa02736['error']){if(_0xa02736[_0x98e8('0x13')][_0x98e8('0x14')]===0x1f4){logger['error'](_0x98e8('0x15'),_0x1b345d,_0xa02736[_0x98e8('0x13')][_0x98e8('0x16')]);return _0x40548d(_0xa02736[_0x98e8('0x13')][_0x98e8('0x16')]);}logger[_0x98e8('0x13')](_0x98e8('0x15'),_0x1b345d,_0xa02736['error'][_0x98e8('0x16')]);return _0x50b878(_0xa02736[_0x98e8('0x13')][_0x98e8('0x16')]);}else{logger[_0x98e8('0xe')](_0x98e8('0x15'),_0x1b345d,_0x98e8('0xf'));_0x50b878(_0xa02736['result'][_0x98e8('0x16')]);}})[_0x98e8('0x17')](function(_0x254372){logger[_0x98e8('0x13')](_0x98e8('0x15'),_0x1b345d,_0x254372);_0x40548d(_0x254372);});});}exports['UpdateWhatsappInteraction']=function(_0x407673){var _0x48234c=this;return new Promise(function(_0x571858,_0x5b6d67){return db[_0x98e8('0x18')]['update'](_0x407673[_0x98e8('0x19')],{'raw':_0x407673[_0x98e8('0x1a')]?_0x407673['options'][_0x98e8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x407673['options']?_0x407673[_0x98e8('0x1a')][_0x98e8('0x1c')]||null:null,'attributes':_0x407673[_0x98e8('0x1a')]?_0x407673[_0x98e8('0x1a')]['attributes']||null:null,'limit':_0x407673['options']?_0x407673['options'][_0x98e8('0x1d')]||null:null})[_0x98e8('0x1e')](function(_0x24f2ec){logger[_0x98e8('0xe')](_0x98e8('0x1f'),_0x407673);logger[_0x98e8('0x10')](_0x98e8('0x1f'),_0x407673,JSON[_0x98e8('0x12')](_0x24f2ec));_0x571858(_0x24f2ec);})['catch'](function(_0x46fdd8){logger['error']('UpdateWhatsappInteraction',_0x46fdd8[_0x98e8('0x16')],_0x407673);_0x5b6d67(_0x48234c[_0x98e8('0x13')](0x1f4,_0x46fdd8[_0x98e8('0x16')]));});});};exports[_0x98e8('0x20')]=function(_0x1da390){return new Promise(function(_0x2c45d7,_0x41c952){return db['WhatsappInteraction']['find']({'where':_0x1da390[_0x98e8('0x1a')]?_0x1da390[_0x98e8('0x1a')][_0x98e8('0x1c')]||null:null})[_0x98e8('0x1e')](function(_0x2d0172){if(_0x2d0172){return _0x2d0172[_0x98e8('0x21')](_0x1da390['body'][_0x98e8('0x22')],_['omit'](_0x1da390[_0x98e8('0x19')],['ids','id'])||{});}})[_0x98e8('0x23')](function(_0x46fcfc){logger[_0x98e8('0xe')](_0x98e8('0x24'),_0x1da390);logger[_0x98e8('0x10')](_0x98e8('0x24'),_0x1da390,JSON[_0x98e8('0x12')](_0x46fcfc));_0x2c45d7(_0x46fcfc);})[_0x98e8('0x17')](function(_0x281a90){logger[_0x98e8('0x13')](_0x98e8('0x24'),_0x281a90[_0x98e8('0x16')],_0x1da390);_0x41c952(_this[_0x98e8('0x13')](0x1f4,_0x281a90[_0x98e8('0x16')]));});});}; \ No newline at end of file +var _0xc64f=['then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','attributes','limit','AddTagsToWhatsappInteraction','find','where','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0xc64f,0x14e));var _0xfc64=function(_0x5e97a5,_0x54cbb9){_0x5e97a5=_0x5e97a5-0x0;var _0xa6676f=_0xc64f[_0x5e97a5];return _0xa6676f;};'use strict';var _=require(_0xfc64('0x0'));var util=require(_0xfc64('0x1'));var moment=require(_0xfc64('0x2'));var BPromise=require(_0xfc64('0x3'));var rs=require(_0xfc64('0x4'));var fs=require('fs');var Redis=require(_0xfc64('0x5'));var db=require(_0xfc64('0x6'))['db'];var utils=require(_0xfc64('0x7'));var logger=require('../../config/logger')(_0xfc64('0x8'));var config=require('../../config/environment');var jayson=require(_0xfc64('0x9'));var client=jayson[_0xfc64('0xa')]['http']({'port':0x232a});config[_0xfc64('0xb')]=_[_0xfc64('0xc')](config['redis'],{'host':_0xfc64('0xd'),'port':0x18eb});var socket=require(_0xfc64('0xe'))(new Redis(config[_0xfc64('0xb')]));require(_0xfc64('0xf'))[_0xfc64('0x10')](socket);function respondWithRpcPromise(_0x470d38,_0x275414,_0xcf8b72){return new BPromise(function(_0x5c2bbd,_0x1c057e){return client[_0xfc64('0x11')](_0x470d38,_0xcf8b72)[_0xfc64('0x12')](function(_0x2791bb){logger[_0xfc64('0x13')](_0xfc64('0x14'),_0x275414,_0xfc64('0x15'));logger[_0xfc64('0x16')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x275414,_0xfc64('0x15'),JSON[_0xfc64('0x17')](_0x2791bb));if(_0x2791bb[_0xfc64('0x18')]){if(_0x2791bb[_0xfc64('0x18')][_0xfc64('0x19')]===0x1f4){logger[_0xfc64('0x18')](_0xfc64('0x14'),_0x275414,_0x2791bb[_0xfc64('0x18')][_0xfc64('0x1a')]);return _0x1c057e(_0x2791bb['error'][_0xfc64('0x1a')]);}logger[_0xfc64('0x18')](_0xfc64('0x14'),_0x275414,_0x2791bb[_0xfc64('0x18')][_0xfc64('0x1a')]);return _0x5c2bbd(_0x2791bb[_0xfc64('0x18')][_0xfc64('0x1a')]);}else{logger[_0xfc64('0x13')](_0xfc64('0x14'),_0x275414,_0xfc64('0x15'));_0x5c2bbd(_0x2791bb[_0xfc64('0x1b')][_0xfc64('0x1a')]);}})[_0xfc64('0x1c')](function(_0x1c1467){logger[_0xfc64('0x18')](_0xfc64('0x14'),_0x275414,_0x1c1467);_0x1c057e(_0x1c1467);});});}exports[_0xfc64('0x1d')]=function(_0x55d4e7){var _0x11c879=this;return new Promise(function(_0x130630,_0x1ab7bf){return db[_0xfc64('0x1e')][_0xfc64('0x1f')](_0x55d4e7[_0xfc64('0x20')],{'raw':_0x55d4e7[_0xfc64('0x21')]?_0x55d4e7['options'][_0xfc64('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55d4e7[_0xfc64('0x21')]?_0x55d4e7[_0xfc64('0x21')]['where']||null:null,'attributes':_0x55d4e7[_0xfc64('0x21')]?_0x55d4e7[_0xfc64('0x21')][_0xfc64('0x23')]||null:null,'limit':_0x55d4e7[_0xfc64('0x21')]?_0x55d4e7[_0xfc64('0x21')][_0xfc64('0x24')]||null:null})['then'](function(_0xbf0ac2){logger[_0xfc64('0x13')]('UpdateWhatsappInteraction',_0x55d4e7);logger[_0xfc64('0x16')](_0xfc64('0x1d'),_0x55d4e7,JSON[_0xfc64('0x17')](_0xbf0ac2));_0x130630(_0xbf0ac2);})[_0xfc64('0x1c')](function(_0x2b9b17){logger[_0xfc64('0x18')](_0xfc64('0x1d'),_0x2b9b17[_0xfc64('0x1a')],_0x55d4e7);_0x1ab7bf(_0x11c879[_0xfc64('0x18')](0x1f4,_0x2b9b17[_0xfc64('0x1a')]));});});};exports[_0xfc64('0x25')]=function(_0x54fc17){return new Promise(function(_0x403451,_0x2ff795){return db[_0xfc64('0x1e')][_0xfc64('0x26')]({'where':_0x54fc17[_0xfc64('0x21')]?_0x54fc17[_0xfc64('0x21')][_0xfc64('0x27')]||null:null})['then'](function(_0x566ce9){if(_0x566ce9){return _0x566ce9['addTags'](_0x54fc17['body'][_0xfc64('0x28')],_[_0xfc64('0x29')](_0x54fc17[_0xfc64('0x20')],['ids','id'])||{});}})[_0xfc64('0x2a')](function(_0x41b2be){logger[_0xfc64('0x13')](_0xfc64('0x2b'),_0x54fc17);logger[_0xfc64('0x16')](_0xfc64('0x2b'),_0x54fc17,JSON[_0xfc64('0x17')](_0x41b2be));_0x403451(_0x41b2be);})[_0xfc64('0x1c')](function(_0x3db1cf){logger[_0xfc64('0x18')](_0xfc64('0x2b'),_0x3db1cf[_0xfc64('0x1a')],_0x54fc17);_0x2ff795(_this['error'](0x1f4,_0x3db1cf[_0xfc64('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 499e941..a54fe32 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 _0x4b41=['update','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x4d40dd,_0x39592b){var _0x1c51f2=function(_0x53e502){while(--_0x53e502){_0x4d40dd['push'](_0x4d40dd['shift']());}};_0x1c51f2(++_0x39592b);}(_0x4b41,0xae));var _0x14b4=function(_0x1f597c,_0x20bbf4){_0x1f597c=_0x1f597c-0x0;var _0x5c2ad0=_0x4b41[_0x1f597c];return _0x5c2ad0;};'use strict';var WhatsappInteractionEvents=require(_0x14b4('0x0'));var events=['save','remove',_0x14b4('0x1')];function createListener(_0xcba4b9,_0x3bdc4a){return function(_0xc922f6){_0x3bdc4a[_0x14b4('0x2')](_0xcba4b9,_0xc922f6);};}function removeListener(_0x54ab77,_0x301fd8){return function(){WhatsappInteractionEvents[_0x14b4('0x3')](_0x54ab77,_0x301fd8);};}exports[_0x14b4('0x4')]=function(_0xb25bfe){for(var _0x3c2b70=0x0,_0x59816e=events[_0x14b4('0x5')];_0x3c2b70<_0x59816e;_0x3c2b70++){var _0x616fc4=events[_0x3c2b70];var _0x2a007a=createListener(_0x14b4('0x6')+_0x616fc4,_0xb25bfe);WhatsappInteractionEvents['on'](_0x616fc4,_0x2a007a);}}; \ No newline at end of file +var _0xeaa1=['register','./whatsappInteraction.events','update','removeListener'];(function(_0x3024fd,_0x316d52){var _0x31b214=function(_0x28229e){while(--_0x28229e){_0x3024fd['push'](_0x3024fd['shift']());}};_0x31b214(++_0x316d52);}(_0xeaa1,0x159));var _0x1eaa=function(_0x56952c,_0x2942e9){_0x56952c=_0x56952c-0x0;var _0x3df3ad=_0xeaa1[_0x56952c];return _0x3df3ad;};'use strict';var WhatsappInteractionEvents=require(_0x1eaa('0x0'));var events=['save','remove',_0x1eaa('0x1')];function createListener(_0x552804,_0x48f529){return function(_0x42899a){_0x48f529['emit'](_0x552804,_0x42899a);};}function removeListener(_0x1cea72,_0x5ba00){return function(){WhatsappInteractionEvents[_0x1eaa('0x2')](_0x1cea72,_0x5ba00);};}exports[_0x1eaa('0x3')]=function(_0x2cbc2){for(var _0x31229f=0x0,_0x3a6fdb=events['length'];_0x31229f<_0x3a6fdb;_0x31229f++){var _0x3b2e99=events[_0x31229f];var _0x300aac=createListener('whatsappInteraction:'+_0x3b2e99,_0x2cbc2);WhatsappInteractionEvents['on'](_0x3b2e99,_0x300aac);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 2448642..6f36588 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 _0x1f8f=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','/describe','describe','/:id','isAuthenticated','show','tracked','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer'];(function(_0x3ecf30,_0x5354ca){var _0x5e166c=function(_0x2e99b8){while(--_0x2e99b8){_0x3ecf30['push'](_0x3ecf30['shift']());}};_0x5e166c(++_0x5354ca);}(_0x1f8f,0x104));var _0xf1f8=function(_0x185f3e,_0x4d9e95){_0x185f3e=_0x185f3e-0x0;var _0x24ee30=_0x1f8f[_0x185f3e];return _0x24ee30;};'use strict';var multer=require(_0xf1f8('0x0'));var util=require(_0xf1f8('0x1'));var path=require(_0xf1f8('0x2'));var timeout=require(_0xf1f8('0x3'));var express=require(_0xf1f8('0x4'));var router=express[_0xf1f8('0x5')]();var fs_extra=require(_0xf1f8('0x6'));var auth=require(_0xf1f8('0x7'));var interaction=require(_0xf1f8('0x8'));var config=require(_0xf1f8('0x9'));var controller=require(_0xf1f8('0xa'));router[_0xf1f8('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf1f8('0xc'),auth['isAuthenticated'](),controller[_0xf1f8('0xd')]);router[_0xf1f8('0xb')](_0xf1f8('0xe'),auth[_0xf1f8('0xf')](),controller[_0xf1f8('0x10')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xf1f8('0x11')]('whatsapp','whatsappmessage:create'),controller[_0xf1f8('0x12')]);router['post'](_0xf1f8('0x13'),controller[_0xf1f8('0x14')]);router[_0xf1f8('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xf1f8('0x16')]);router['put'](_0xf1f8('0x17'),auth['isAuthenticated'](),controller[_0xf1f8('0x18')]);router['put'](_0xf1f8('0x19'),auth[_0xf1f8('0xf')](),controller[_0xf1f8('0x1a')]);router[_0xf1f8('0x1b')](_0xf1f8('0xe'),auth['isAuthenticated'](),controller[_0xf1f8('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xc148=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','path','fs-extra','../../components/auth/service','./whatsappMessage.controller'];(function(_0x3538fc,_0x276546){var _0x126aef=function(_0x743273){while(--_0x743273){_0x3538fc['push'](_0x3538fc['shift']());}};_0x126aef(++_0x276546);}(_0xc148,0x1bd));var _0x8c14=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xc148[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x8c14('0x0'));var util=require('util');var path=require(_0x8c14('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8c14('0x2'));var auth=require(_0x8c14('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8c14('0x4'));router[_0x8c14('0x5')]('/',auth[_0x8c14('0x6')](),controller[_0x8c14('0x7')]);router[_0x8c14('0x5')](_0x8c14('0x8'),auth[_0x8c14('0x6')](),controller[_0x8c14('0x9')]);router['get'](_0x8c14('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x8c14('0xb')]('/',auth['isAuthenticated'](),interaction[_0x8c14('0xc')](_0x8c14('0xd'),_0x8c14('0xe')),controller['create']);router[_0x8c14('0xb')](_0x8c14('0xf'),controller[_0x8c14('0x10')]);router[_0x8c14('0x11')](_0x8c14('0xa'),auth[_0x8c14('0x6')](),controller[_0x8c14('0x12')]);router['put'](_0x8c14('0x13'),auth[_0x8c14('0x6')](),controller['accept']);router[_0x8c14('0x11')](_0x8c14('0x14'),auth['isAuthenticated'](),controller[_0x8c14('0x15')]);router[_0x8c14('0x16')](_0x8c14('0xa'),auth['isAuthenticated'](),controller[_0x8c14('0x17')]);module[_0x8c14('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 3faa9e0..0e3b193 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 _0x4397=['ENUM','out','STRING','BOOLEAN','TEXT','medium'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x4397,0x196));var _0x7439=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0x4397[_0x27e811];return _0x1627fa;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x7439('0x0')](_0x7439('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7439('0x2')]('in','out'),'defaultValue':_0x7439('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x7439('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x7439('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x7439('0x4')]},'providerResponse':{'type':Sequelize[_0x7439('0x0')]}}; \ No newline at end of file +var _0x16cc=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0xa056f1,_0xecb10b){var _0x323b3b=function(_0x4b4ad4){while(--_0x4b4ad4){_0xa056f1['push'](_0xa056f1['shift']());}};_0x323b3b(++_0xecb10b);}(_0x16cc,0x120));var _0xc16c=function(_0x5e5f47,_0x368755){_0x5e5f47=_0x5e5f47-0x0;var _0x21807c=_0x16cc[_0x5e5f47];return _0x21807c;};'use strict';var Sequelize=require('sequelize');module[_0xc16c('0x0')]={'body':{'type':Sequelize[_0xc16c('0x1')](_0xc16c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc16c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc16c('0x4')]('in',_0xc16c('0x5')),'defaultValue':_0xc16c('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xc16c('0x6')]},'readAt':{'type':Sequelize[_0xc16c('0x7')]},'secret':{'type':Sequelize[_0xc16c('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc16c('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index d4bed56..f809b8c 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 _0x791d=['./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','count','set','apply','reject','destroy','name','index','map','WhatsappMessage','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','show','length','find','create','body','update','params','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','SELECT','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter'];(function(_0x1ddea1,_0x4d4d1c){var _0x23f12f=function(_0x4f7296){while(--_0x4f7296){_0x1ddea1['push'](_0x1ddea1['shift']());}};_0x23f12f(++_0x4d4d1c);}(_0x791d,0x181));var _0xd791=function(_0x41f9c4,_0x100f97){_0x41f9c4=_0x41f9c4-0x0;var _0x4435c5=_0x791d[_0x41f9c4];return _0x4435c5;};'use strict';var emlformat=require(_0xd791('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd791('0x1'));var jsonpatch=require(_0xd791('0x2'));var rp=require(_0xd791('0x3'));var moment=require(_0xd791('0x4'));var BPromise=require(_0xd791('0x5'));var Mustache=require(_0xd791('0x6'));var util=require(_0xd791('0x7'));var path=require(_0xd791('0x8'));var sox=require(_0xd791('0x9'));var csv=require('to-csv');var ejs=require(_0xd791('0xa'));var fs=require('fs');var fs_extra=require(_0xd791('0xb'));var _=require(_0xd791('0xc'));var squel=require('squel');var crypto=require(_0xd791('0xd'));var jsforce=require(_0xd791('0xe'));var deskjs=require(_0xd791('0xf'));var toCsv=require(_0xd791('0x10'));var querystring=require(_0xd791('0x11'));var Papa=require('papaparse');var Redis=require(_0xd791('0x12'));var authService=require(_0xd791('0x13'));var qs=require(_0xd791('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd791('0x15'));var logger=require('../../config/logger')(_0xd791('0x16'));var utils=require(_0xd791('0x17'));var config=require(_0xd791('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd791('0x19'))['db'];config[_0xd791('0x1a')]=_['defaults'](config[_0xd791('0x1a')],{'host':_0xd791('0x1b'),'port':0x18eb});var socket=require(_0xd791('0x1c'))(new Redis(config[_0xd791('0x1a')]));require(_0xd791('0x1d'))[_0xd791('0x1e')](socket);var jayson=require(_0xd791('0x1f'));var client=jayson[_0xd791('0x20')][_0xd791('0x21')]({'port':0x232c});var client9002=jayson[_0xd791('0x20')][_0xd791('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x582df2,_0x529c78,_0x4c1c15,_0x3db948){return new BPromise(function(_0x1947bc,_0x11f080){var _0x4c4034=_0x3db948||client;return _0x4c4034[_0xd791('0x22')](_0x582df2,_0x4c1c15)[_0xd791('0x23')](function(_0x122144){logger[_0xd791('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x529c78,_0xd791('0x25'));logger[_0xd791('0x26')](_0xd791('0x27'),_0x529c78,_0xd791('0x25'),JSON['stringify'](_0x122144));if(_0x122144['error']){if(_0x122144[_0xd791('0x28')][_0xd791('0x29')]===0x1f4){logger['error'](_0xd791('0x2a'),_0x529c78,_0x122144[_0xd791('0x28')][_0xd791('0x2b')]);return _0x11f080(_0x122144[_0xd791('0x28')][_0xd791('0x2b')]);}logger['error'](_0xd791('0x2a'),_0x529c78,_0x122144['error'][_0xd791('0x2b')]);return _0x1947bc(_0x122144['error'][_0xd791('0x2b')]);}else{logger[_0xd791('0x24')](_0xd791('0x2a'),_0x529c78,_0xd791('0x25'));_0x1947bc(_0x122144[_0xd791('0x2c')][_0xd791('0x2b')]);}})[_0xd791('0x2d')](function(_0x38d0b7){logger['error'](_0xd791('0x2a'),_0x529c78,_0x38d0b7);_0x11f080(_0x38d0b7);});});}function respondWithStatusCode(_0x217c45,_0x2fa758){_0x2fa758=_0x2fa758||0xcc;return function(_0x208b85){if(_0x208b85){return _0x217c45[_0xd791('0x2e')](_0x2fa758);}return _0x217c45['status'](_0x2fa758)[_0xd791('0x2f')]();};}function respondWithResult(_0x175b05,_0x51189e){_0x51189e=_0x51189e||0xc8;return function(_0x270a58){if(_0x270a58){return _0x175b05[_0xd791('0x30')](_0x51189e)[_0xd791('0x31')](_0x270a58);}};}function respondWithFilteredResult(_0x2c0a96,_0x2523bf){return function(_0x10edc3){if(_0x10edc3){var _0x544848=typeof _0x2523bf[_0xd791('0x32')]==='undefined'&&typeof _0x2523bf[_0xd791('0x33')]==='undefined';var _0x1e8a79=_0x10edc3['count'];var _0x88b955=_0x544848?0x0:_0x2523bf[_0xd791('0x32')];var _0x3818fa=_0x544848?_0x10edc3[_0xd791('0x34')]:_0x2523bf['offset']+_0x2523bf[_0xd791('0x33')];var _0x29d114;if(_0x3818fa>=_0x1e8a79){_0x3818fa=_0x1e8a79;_0x29d114=0xc8;}else{_0x29d114=0xce;}_0x2c0a96['status'](_0x29d114);return _0x2c0a96[_0xd791('0x35')]('Content-Range',_0x88b955+'-'+_0x3818fa+'/'+_0x1e8a79)[_0xd791('0x31')](_0x10edc3);}return null;};}function patchUpdates(_0x5118b3){return function(_0x30d5d6){try{jsonpatch[_0xd791('0x36')](_0x30d5d6,_0x5118b3,!![]);}catch(_0x5b3410){return BPromise[_0xd791('0x37')](_0x5b3410);}return _0x30d5d6['save']();};}function saveUpdates(_0x12d7a6,_0x4f324a){return function(_0xf6ae78){if(_0xf6ae78){return _0xf6ae78['update'](_0x12d7a6)[_0xd791('0x23')](function(_0x369ed4){return _0x369ed4;});}return null;};}function removeEntity(_0x37a576,_0x420281){return function(_0x50d406){if(_0x50d406){return _0x50d406[_0xd791('0x38')]()[_0xd791('0x23')](function(){_0x37a576['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b65c0,_0x5d9b4b){return function(_0x1584d){if(!_0x1584d){_0x3b65c0['sendStatus'](0x194);}return _0x1584d;};}function handleError(_0x4cc3e4,_0xcbdbe8){_0xcbdbe8=_0xcbdbe8||0x1f4;return function(_0x57c488){logger[_0xd791('0x28')](_0x57c488['stack']);if(_0x57c488[_0xd791('0x39')]){delete _0x57c488[_0xd791('0x39')];}_0x4cc3e4[_0xd791('0x30')](_0xcbdbe8)['send'](_0x57c488);};}exports[_0xd791('0x3a')]=function(_0x180bdc,_0x13c297){var _0x583cfd={},_0x4db963={},_0x424270={'count':0x0,'rows':[]};var _0x31aee5=_[_0xd791('0x3b')](db[_0xd791('0x3c')][_0xd791('0x3d')],function(_0x2d4d5d){return{'name':_0x2d4d5d[_0xd791('0x3e')],'type':_0x2d4d5d[_0xd791('0x3f')]['key']};});_0x4db963['model']=_[_0xd791('0x3b')](_0x31aee5,_0xd791('0x39'));_0x4db963[_0xd791('0x40')]=_[_0xd791('0x41')](_0x180bdc['query']);_0x4db963['filters']=_[_0xd791('0x42')](_0x4db963[_0xd791('0x43')],_0x4db963['query']);_0x583cfd[_0xd791('0x44')]=_[_0xd791('0x42')](_0x4db963['model'],qs[_0xd791('0x45')](_0x180bdc['query'][_0xd791('0x45')]));_0x583cfd[_0xd791('0x44')]=_0x583cfd['attributes']['length']?_0x583cfd['attributes']:_0x4db963[_0xd791('0x43')];if(!_0x180bdc['query']['hasOwnProperty']('nolimit')){_0x583cfd[_0xd791('0x33')]=qs[_0xd791('0x33')](_0x180bdc[_0xd791('0x40')][_0xd791('0x33')]);_0x583cfd[_0xd791('0x32')]=qs[_0xd791('0x32')](_0x180bdc['query'][_0xd791('0x32')]);}_0x583cfd[_0xd791('0x46')]=qs[_0xd791('0x47')](_0x180bdc['query']['sort']);_0x583cfd[_0xd791('0x48')]=qs[_0xd791('0x49')](_['pick'](_0x180bdc[_0xd791('0x40')],_0x4db963['filters']),_0x31aee5);if(_0x180bdc[_0xd791('0x40')][_0xd791('0x4a')]){_0x583cfd[_0xd791('0x48')]=_[_0xd791('0x4b')](_0x583cfd[_0xd791('0x48')],{'$or':_['map'](_0x31aee5,function(_0x4e5fd5){if(_0x4e5fd5[_0xd791('0x3f')]!=='VIRTUAL'){var _0x4af3ed={};_0x4af3ed[_0x4e5fd5['name']]={'$like':'%'+_0x180bdc[_0xd791('0x40')][_0xd791('0x4a')]+'%'};return _0x4af3ed;}})});}_0x583cfd=_[_0xd791('0x4b')]({},_0x583cfd,_0x180bdc[_0xd791('0x4c')]);var _0x5dfc5c={'where':_0x583cfd[_0xd791('0x48')]};return db['WhatsappMessage'][_0xd791('0x34')](_0x5dfc5c)[_0xd791('0x23')](function(_0x2d58de){_0x424270['count']=_0x2d58de;if(_0x180bdc[_0xd791('0x40')][_0xd791('0x4d')]){_0x583cfd[_0xd791('0x4e')]=[{'all':!![]}];}return db[_0xd791('0x3c')][_0xd791('0x4f')](_0x583cfd);})[_0xd791('0x23')](function(_0xda1cdd){_0x424270[_0xd791('0x50')]=_0xda1cdd;return _0x424270;})[_0xd791('0x23')](respondWithFilteredResult(_0x13c297,_0x583cfd))[_0xd791('0x2d')](handleError(_0x13c297,null));};exports[_0xd791('0x51')]=function(_0x2d066a,_0x5e72d0){var _0x3826d6={'raw':!![],'where':{'id':_0x2d066a['params']['id']}},_0x2df5b5={};_0x2df5b5['model']=_[_0xd791('0x41')](db['WhatsappMessage'][_0xd791('0x3d')]);_0x2df5b5[_0xd791('0x40')]=_[_0xd791('0x41')](_0x2d066a['query']);_0x2df5b5['filters']=_[_0xd791('0x42')](_0x2df5b5[_0xd791('0x43')],_0x2df5b5[_0xd791('0x40')]);_0x3826d6['attributes']=_['intersection'](_0x2df5b5['model'],qs[_0xd791('0x45')](_0x2d066a[_0xd791('0x40')][_0xd791('0x45')]));_0x3826d6[_0xd791('0x44')]=_0x3826d6[_0xd791('0x44')][_0xd791('0x52')]?_0x3826d6[_0xd791('0x44')]:_0x2df5b5['model'];if(_0x2d066a[_0xd791('0x40')][_0xd791('0x4d')]){_0x3826d6[_0xd791('0x4e')]=[{'all':!![]}];}_0x3826d6=_[_0xd791('0x4b')]({},_0x3826d6,_0x2d066a[_0xd791('0x4c')]);return db[_0xd791('0x3c')][_0xd791('0x53')](_0x3826d6)[_0xd791('0x23')](handleEntityNotFound(_0x5e72d0,null))['then'](respondWithResult(_0x5e72d0,null))[_0xd791('0x2d')](handleError(_0x5e72d0,null));};exports[_0xd791('0x54')]=function(_0x22d6d9,_0x5e89e7){return db[_0xd791('0x3c')]['create'](_0x22d6d9[_0xd791('0x55')],{})[_0xd791('0x23')](respondWithResult(_0x5e89e7,0xc9))[_0xd791('0x2d')](handleError(_0x5e89e7,null));};exports[_0xd791('0x56')]=function(_0x240a83,_0x2b13a8){if(_0x240a83[_0xd791('0x55')]['id']){delete _0x240a83[_0xd791('0x55')]['id'];}return db[_0xd791('0x3c')][_0xd791('0x53')]({'where':{'id':_0x240a83['params']['id']}})[_0xd791('0x23')](handleEntityNotFound(_0x2b13a8,null))['then'](saveUpdates(_0x240a83['body'],null))[_0xd791('0x23')](respondWithResult(_0x2b13a8,null))[_0xd791('0x2d')](handleError(_0x2b13a8,null));};exports[_0xd791('0x38')]=function(_0x5dc930,_0x56a682){return db[_0xd791('0x3c')]['find']({'where':{'id':_0x5dc930[_0xd791('0x57')]['id']}})[_0xd791('0x23')](handleEntityNotFound(_0x56a682,null))['then'](removeEntity(_0x56a682,null))[_0xd791('0x2d')](handleError(_0x56a682,null));};exports[_0xd791('0x58')]=function(_0x4859c6,_0x319b5c){return db[_0xd791('0x3c')]['describe']()[_0xd791('0x23')](respondWithResult(_0x319b5c,null))['catch'](handleError(_0x319b5c,null));};var interaction_log=require('../../config/logger')(_0xd791('0x59'));exports[_0xd791('0x5a')]=function(_0x316eec,_0x36e503,_0x437ff3){var _0x142061={'agent':{},'channel':_0xd791('0x5b')};if(_0x316eec[_0xd791('0x55')]['id']){delete _0x316eec[_0xd791('0x55')]['id'];}_0x316eec[_0xd791('0x55')][_0xd791('0x5c')]=!![];_0x316eec[_0xd791('0x55')][_0xd791('0x5d')]=moment()[_0xd791('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x316eec[_0xd791('0x55')][_0xd791('0x5f')]=_0x316eec[_0xd791('0x55')]['UserId']||_0x316eec[_0xd791('0x60')]['id'];_0x142061['agent']['id']=_0x316eec[_0xd791('0x55')]['UserId'];return db['WhatsappMessage']['find']({'where':{'id':_0x316eec[_0xd791('0x57')]['id'],'UserId':null}})[_0xd791('0x23')](handleEntityNotFound(_0x36e503,null))[_0xd791('0x23')](saveUpdates(_0x316eec['body'],null))['then'](function(_0x577284){if(_0x577284){_0x142061[_0xd791('0x2b')]=_0x577284[_0xd791('0x61')]({'plain':!![]});return db[_0xd791('0x62')]['find']({'where':{'id':_0x577284[_0xd791('0x63')]}});}return null;})[_0xd791('0x23')](handleEntityNotFound(_0x36e503,null))[_0xd791('0x23')](function(_0x2ccafa){if(_0x2ccafa){return _0x2ccafa[_0xd791('0x56')]({'UserId':_0x316eec[_0xd791('0x55')]['UserId'],'read1stAt':_['isNil'](_0x2ccafa[_0xd791('0x64')])?moment()[_0xd791('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x366c81){if(_0x366c81){_0x142061['interaction']=_0x366c81[_0xd791('0x61')]({'plain':!![]});interaction_log[_0xd791('0x24')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x316eec[_0xd791('0x60')]['id'],_0x316eec[_0xd791('0x60')][_0xd791('0x39')],_0x316eec[_0xd791('0x60')][_0xd791('0x65')],_0x142061[_0xd791('0x66')]['id'],_0x316eec[_0xd791('0x55')]?JSON[_0xd791('0x67')](_0x316eec[_0xd791('0x55')]):_0xd791('0x68'));return respondWithRpcPromise(_0xd791('0x69'),_0xd791('0x6a'),_0x142061);}return null;})[_0xd791('0x23')](function(_0x9a4f83){var _0x3d575f=_0xd791('0x6b')+_0x9a4f83[_0xd791('0x2b')]['ContactId'];return db[_0xd791('0x6c')]['query'](_0x3d575f,{'type':db[_0xd791('0x6d')][_0xd791('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x4ecf86){return _0x4ecf86;});})[_0xd791('0x23')](function(_0x6832f2){if(_0x6832f2){_0x142061[_0xd791('0x2b')][_0xd791('0x6f')]=_0x6832f2[0x0];if(!_0x316eec['body'][_0xd791('0x5f')])return;return db[_0xd791('0x70')][_0xd791('0x53')]({'where':{'id':_0x316eec['body']['UserId'],'role':_0xd791('0x71')},'attributes':['id',_0xd791('0x39'),_0xd791('0x72'),_0xd791('0x73'),_0xd791('0x74')],'raw':!![]});}return null;})[_0xd791('0x23')](function(_0x480b40){if(!_0x480b40)return null;_0x142061['message'][_0xd791('0x71')]=_0x480b40;return _0x142061;})[_0xd791('0x23')](function(_0x218580){if(_0x218580){if(_0x316eec['body'][_0xd791('0x75')]){_0x142061['message'][_0xd791('0x76')]=util['format'](_0xd791('0x77'),_0x316eec[_0xd791('0x60')][_0xd791('0x39')]);_0x142061[_0xd791('0x2b')][_0xd791('0x78')]=_0x142061['channel'];_0x142061[_0xd791('0x2b')][_0xd791('0x79')]=_0x142061[_0xd791('0x78')];_0x142061['message'][_0xd791('0x7a')]=_0xd791('0x5a');return respondWithRpcPromise('EventManager',_0xd791('0x7b'),{'event':'acceptmessage','message':_0x142061[_0xd791('0x2b')]},client9002)[_0xd791('0x23')](function(){return _0x142061;});}return _0x142061;}return null;})[_0xd791('0x23')](respondWithResult(_0x36e503,null))[_0xd791('0x2d')](handleError(_0x36e503,null));};var interaction_log=require('../../config/logger')(_0xd791('0x59'));exports['reject']=function(_0x3b4dbc,_0x3306a3,_0x50c149){var _0x119f5b={'agent':{},'channel':_0xd791('0x5b')};if(_0x3b4dbc[_0xd791('0x55')]['id']){delete _0x3b4dbc[_0xd791('0x55')]['id'];}_0x3b4dbc[_0xd791('0x55')]['UserId']=_0x3b4dbc[_0xd791('0x55')]['UserId']||_0x3b4dbc[_0xd791('0x60')]['id'];_0x119f5b[_0xd791('0x71')]['id']=_0x3b4dbc[_0xd791('0x55')][_0xd791('0x5f')];return db[_0xd791('0x3c')]['find']({'where':{'id':_0x3b4dbc['params']['id'],'UserId':null}})[_0xd791('0x23')](handleEntityNotFound(_0x3306a3,null))['then'](function(_0x26f87f){if(_0x26f87f){_0x119f5b[_0xd791('0x2b')]=_0x26f87f[_0xd791('0x61')]({'plain':!![]});return db['WhatsappInteraction'][_0xd791('0x53')]({'where':{'id':_0x26f87f[_0xd791('0x63')]}});}return null;})[_0xd791('0x23')](handleEntityNotFound(_0x3306a3,null))[_0xd791('0x23')](function(_0x294aab){if(_0x294aab){_0x119f5b[_0xd791('0x66')]=_0x294aab[_0xd791('0x61')]({'plain':!![]});interaction_log[_0xd791('0x24')](_0xd791('0x7c'),_0x3b4dbc[_0xd791('0x60')]['id'],_0x3b4dbc['user'][_0xd791('0x39')],_0x3b4dbc['user'][_0xd791('0x65')],_0x119f5b['interaction']['id'],_0x3b4dbc['body']?JSON[_0xd791('0x67')](_0x3b4dbc[_0xd791('0x55')]):_0xd791('0x68'));return respondWithRpcPromise(_0xd791('0x7d'),_0xd791('0x7e'),_0x119f5b);}return null;})[_0xd791('0x23')](function(_0xf1d0f4){var _0xb6b868=_0xd791('0x6b')+_0xf1d0f4['message'][_0xd791('0x7f')];return db[_0xd791('0x6c')][_0xd791('0x40')](_0xb6b868,{'type':db['Sequelize'][_0xd791('0x6e')][_0xd791('0x80')],'raw':!![]})['then'](function(_0x420a11){return _0x420a11;});})[_0xd791('0x23')](function(_0x4b0822){if(_0x4b0822){_0x119f5b[_0xd791('0x2b')]['contact']=_0x4b0822[0x0];if(!_0x3b4dbc[_0xd791('0x55')][_0xd791('0x5f')])return;return db[_0xd791('0x70')][_0xd791('0x53')]({'where':{'id':_0x3b4dbc['body'][_0xd791('0x5f')],'role':_0xd791('0x71')},'attributes':['id',_0xd791('0x39'),_0xd791('0x72'),_0xd791('0x73'),_0xd791('0x74')],'raw':!![]});}return null;})[_0xd791('0x23')](function(_0x8f0334){if(!_0x8f0334)return null;_0x119f5b[_0xd791('0x2b')]['agent']=_0x8f0334;return _0x119f5b;})[_0xd791('0x23')](function(_0x566c06){if(_0x566c06){_0x566c06[_0xd791('0x2b')][_0xd791('0x76')]=util[_0xd791('0x5e')]('SIP/%s',_0x3b4dbc['user']['name']);_0x566c06[_0xd791('0x2b')][_0xd791('0x78')]=_0x119f5b[_0xd791('0x78')];_0x566c06[_0xd791('0x2b')]['motionChannel']=_0x119f5b['channel'];_0x566c06[_0xd791('0x2b')][_0xd791('0x7a')]=_0xd791('0x37');respondWithRpcPromise(_0xd791('0x7b'),_0xd791('0x7b'),{'event':_0xd791('0x81'),'message':_0x566c06[_0xd791('0x2b')]},client9002);return _0x119f5b;}return null;})[_0xd791('0x23')](respondWithResult(_0x3306a3,null))[_0xd791('0x2d')](handleError(_0x3306a3,null));};exports[_0xd791('0x30')]=function(_0x2b6b18,_0x582f47,_0x5b5118){if(_0x2b6b18[_0xd791('0x55')]['id']){delete _0x2b6b18['body']['id'];}var _0x5eb62e;return db[_0xd791('0x3c')][_0xd791('0x53')]({'where':{'id':_0x2b6b18[_0xd791('0x57')]['id']}})[_0xd791('0x23')](handleEntityNotFound(_0x582f47,null))[_0xd791('0x23')](function(_0x305255){if(_0x305255){_0x5eb62e=_0x305255;return db[_0xd791('0x82')][_0xd791('0x53')]({'where':{'id':_0x305255['WhatsappAccountId']}});}})[_0xd791('0x23')](handleEntityNotFound(_0x582f47,null))[_0xd791('0x23')](function(_0x273a12){if(_0x273a12){logger[_0xd791('0x26')](_0xd791('0x83'),'status',_0xd791('0x84'),_0x273a12[_0xd791('0x3f')],util['inspect'](_0x2b6b18[_0xd791('0x55')],{'showHidden':![],'depth':null}));switch(_0x273a12[_0xd791('0x3f')]){case _0xd791('0x85'):if(_0x2b6b18[_0xd791('0x55')][_0xd791('0x86')]&&_0x2b6b18['body'][_0xd791('0x86')]===_0x5eb62e[_0xd791('0x87')]&&_0x2b6b18[_0xd791('0x55')]['MessageStatus']&&_0x2b6b18[_0xd791('0x55')]['MessageStatus']===_0xd791('0x5c')){return _0x5eb62e[_0xd791('0x56')]({'read':!![]});}else{logger[_0xd791('0x28')](_0xd791('0x88'),_0xd791('0x30'),_0xd791('0x85'),util[_0xd791('0x89')](_0x2b6b18[_0xd791('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x5eb62e;}})[_0xd791('0x23')](respondWithResult(_0x582f47,null))['catch'](handleError(_0x582f47,null));}; \ No newline at end of file +var _0x497d=['nolimit','sort','filters','pick','filter','where','merge','options','includeAll','include','show','params','length','find','create','body','describe','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','email','internal','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','register','jayson/promise','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','map','WhatsappMessage','rawAttributes','fieldName','type','key','keys','query','intersection','attributes','fields','model'];(function(_0x870b62,_0x2143f9){var _0x2dcb39=function(_0x2fb63d){while(--_0x2fb63d){_0x870b62['push'](_0x870b62['shift']());}};_0x2dcb39(++_0x2143f9);}(_0x497d,0x155));var _0xd497=function(_0x16a52b,_0x460b0d){_0x16a52b=_0x16a52b-0x0;var _0x1cccff=_0x497d[_0x16a52b];return _0x1cccff;};'use strict';var emlformat=require(_0xd497('0x0'));var rimraf=require(_0xd497('0x1'));var zipdir=require(_0xd497('0x2'));var jsonpatch=require(_0xd497('0x3'));var rp=require('request-promise');var moment=require(_0xd497('0x4'));var BPromise=require(_0xd497('0x5'));var Mustache=require(_0xd497('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd497('0x7'));var csv=require(_0xd497('0x8'));var ejs=require(_0xd497('0x9'));var fs=require('fs');var fs_extra=require(_0xd497('0xa'));var _=require('lodash');var squel=require(_0xd497('0xb'));var crypto=require('crypto');var jsforce=require(_0xd497('0xc'));var deskjs=require(_0xd497('0xd'));var toCsv=require(_0xd497('0x8'));var querystring=require(_0xd497('0xe'));var Papa=require(_0xd497('0xf'));var Redis=require(_0xd497('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd497('0x11'));var as=require(_0xd497('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd497('0x13'))(_0xd497('0x14'));var utils=require(_0xd497('0x15'));var config=require(_0xd497('0x16'));var licenseUtil=require(_0xd497('0x17'));var db=require(_0xd497('0x18'))['db'];config['redis']=_[_0xd497('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd497('0x1a'))(new Redis(config[_0xd497('0x1b')]));require('./whatsappMessage.socket')[_0xd497('0x1c')](socket);var jayson=require(_0xd497('0x1d'));var client=jayson['client'][_0xd497('0x1e')]({'port':0x232c});var client9002=jayson[_0xd497('0x1f')][_0xd497('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x53bed3,_0x212108,_0x2258b1,_0x30cdc8){return new BPromise(function(_0x3853a6,_0x5aa644){var _0x4a18eb=_0x30cdc8||client;return _0x4a18eb[_0xd497('0x20')](_0x53bed3,_0x2258b1)[_0xd497('0x21')](function(_0x2c673b){logger[_0xd497('0x22')](_0xd497('0x23'),_0x212108,_0xd497('0x24'));logger[_0xd497('0x25')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x212108,_0xd497('0x24'),JSON[_0xd497('0x26')](_0x2c673b));if(_0x2c673b[_0xd497('0x27')]){if(_0x2c673b[_0xd497('0x27')][_0xd497('0x28')]===0x1f4){logger[_0xd497('0x27')](_0xd497('0x23'),_0x212108,_0x2c673b[_0xd497('0x27')][_0xd497('0x29')]);return _0x5aa644(_0x2c673b[_0xd497('0x27')][_0xd497('0x29')]);}logger[_0xd497('0x27')](_0xd497('0x23'),_0x212108,_0x2c673b['error'][_0xd497('0x29')]);return _0x3853a6(_0x2c673b[_0xd497('0x27')][_0xd497('0x29')]);}else{logger[_0xd497('0x22')](_0xd497('0x23'),_0x212108,'request\x20sent');_0x3853a6(_0x2c673b[_0xd497('0x2a')]['message']);}})[_0xd497('0x2b')](function(_0x3acf8e){logger[_0xd497('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x212108,_0x3acf8e);_0x5aa644(_0x3acf8e);});});}function respondWithStatusCode(_0x1a8e32,_0x359a2e){_0x359a2e=_0x359a2e||0xcc;return function(_0xd96c26){if(_0xd96c26){return _0x1a8e32[_0xd497('0x2c')](_0x359a2e);}return _0x1a8e32[_0xd497('0x2d')](_0x359a2e)[_0xd497('0x2e')]();};}function respondWithResult(_0x3bb79c,_0x4c548f){_0x4c548f=_0x4c548f||0xc8;return function(_0x32a3be){if(_0x32a3be){return _0x3bb79c['status'](_0x4c548f)[_0xd497('0x2f')](_0x32a3be);}};}function respondWithFilteredResult(_0x30c6ee,_0x1b0e5e){return function(_0x1961f3){if(_0x1961f3){var _0x4e4803=typeof _0x1b0e5e[_0xd497('0x30')]==='undefined'&&typeof _0x1b0e5e['limit']===_0xd497('0x31');var _0x3374b9=_0x1961f3[_0xd497('0x32')];var _0x2f04b4=_0x4e4803?0x0:_0x1b0e5e[_0xd497('0x30')];var _0xca7d82=_0x4e4803?_0x1961f3[_0xd497('0x32')]:_0x1b0e5e[_0xd497('0x30')]+_0x1b0e5e[_0xd497('0x33')];var _0x5db2f2;if(_0xca7d82>=_0x3374b9){_0xca7d82=_0x3374b9;_0x5db2f2=0xc8;}else{_0x5db2f2=0xce;}_0x30c6ee[_0xd497('0x2d')](_0x5db2f2);return _0x30c6ee[_0xd497('0x34')](_0xd497('0x35'),_0x2f04b4+'-'+_0xca7d82+'/'+_0x3374b9)[_0xd497('0x2f')](_0x1961f3);}return null;};}function patchUpdates(_0x4b359f){return function(_0x2eee80){try{jsonpatch[_0xd497('0x36')](_0x2eee80,_0x4b359f,!![]);}catch(_0x157a62){return BPromise[_0xd497('0x37')](_0x157a62);}return _0x2eee80[_0xd497('0x38')]();};}function saveUpdates(_0x6df312,_0x2d2113){return function(_0x4ca3be){if(_0x4ca3be){return _0x4ca3be[_0xd497('0x39')](_0x6df312)[_0xd497('0x21')](function(_0x422f9d){return _0x422f9d;});}return null;};}function removeEntity(_0x326383,_0x1a3511){return function(_0x403c2c){if(_0x403c2c){return _0x403c2c[_0xd497('0x3a')]()[_0xd497('0x21')](function(){_0x326383[_0xd497('0x2d')](0xcc)[_0xd497('0x2e')]();});}};}function handleEntityNotFound(_0x3cd54c,_0x2ae02){return function(_0x282bf7){if(!_0x282bf7){_0x3cd54c[_0xd497('0x2c')](0x194);}return _0x282bf7;};}function handleError(_0x31c7f6,_0x3ffbca){_0x3ffbca=_0x3ffbca||0x1f4;return function(_0x565a41){logger[_0xd497('0x27')](_0x565a41[_0xd497('0x3b')]);if(_0x565a41['name']){delete _0x565a41[_0xd497('0x3c')];}_0x31c7f6['status'](_0x3ffbca)['send'](_0x565a41);};}exports['index']=function(_0x2ee075,_0x2aaa29){var _0x2226cf={},_0x19eeae={},_0x5340bb={'count':0x0,'rows':[]};var _0x5adc36=_[_0xd497('0x3d')](db[_0xd497('0x3e')][_0xd497('0x3f')],function(_0xecfe0f){return{'name':_0xecfe0f[_0xd497('0x40')],'type':_0xecfe0f[_0xd497('0x41')][_0xd497('0x42')]};});_0x19eeae['model']=_[_0xd497('0x3d')](_0x5adc36,_0xd497('0x3c'));_0x19eeae['query']=_[_0xd497('0x43')](_0x2ee075[_0xd497('0x44')]);_0x19eeae['filters']=_[_0xd497('0x45')](_0x19eeae['model'],_0x19eeae[_0xd497('0x44')]);_0x2226cf[_0xd497('0x46')]=_[_0xd497('0x45')](_0x19eeae['model'],qs['fields'](_0x2ee075[_0xd497('0x44')][_0xd497('0x47')]));_0x2226cf[_0xd497('0x46')]=_0x2226cf[_0xd497('0x46')]['length']?_0x2226cf[_0xd497('0x46')]:_0x19eeae[_0xd497('0x48')];if(!_0x2ee075[_0xd497('0x44')]['hasOwnProperty'](_0xd497('0x49'))){_0x2226cf['limit']=qs[_0xd497('0x33')](_0x2ee075[_0xd497('0x44')][_0xd497('0x33')]);_0x2226cf[_0xd497('0x30')]=qs[_0xd497('0x30')](_0x2ee075[_0xd497('0x44')]['offset']);}_0x2226cf['order']=qs[_0xd497('0x4a')](_0x2ee075['query'][_0xd497('0x4a')]);_0x2226cf['where']=qs[_0xd497('0x4b')](_[_0xd497('0x4c')](_0x2ee075[_0xd497('0x44')],_0x19eeae[_0xd497('0x4b')]),_0x5adc36);if(_0x2ee075[_0xd497('0x44')][_0xd497('0x4d')]){_0x2226cf[_0xd497('0x4e')]=_[_0xd497('0x4f')](_0x2226cf[_0xd497('0x4e')],{'$or':_[_0xd497('0x3d')](_0x5adc36,function(_0x1126ae){if(_0x1126ae[_0xd497('0x41')]!=='VIRTUAL'){var _0x350bdc={};_0x350bdc[_0x1126ae[_0xd497('0x3c')]]={'$like':'%'+_0x2ee075[_0xd497('0x44')][_0xd497('0x4d')]+'%'};return _0x350bdc;}})});}_0x2226cf=_[_0xd497('0x4f')]({},_0x2226cf,_0x2ee075[_0xd497('0x50')]);var _0x44edc3={'where':_0x2226cf[_0xd497('0x4e')]};return db[_0xd497('0x3e')][_0xd497('0x32')](_0x44edc3)['then'](function(_0x51a77d){_0x5340bb[_0xd497('0x32')]=_0x51a77d;if(_0x2ee075['query'][_0xd497('0x51')]){_0x2226cf[_0xd497('0x52')]=[{'all':!![]}];}return db[_0xd497('0x3e')]['findAll'](_0x2226cf);})[_0xd497('0x21')](function(_0x345fe5){_0x5340bb['rows']=_0x345fe5;return _0x5340bb;})['then'](respondWithFilteredResult(_0x2aaa29,_0x2226cf))['catch'](handleError(_0x2aaa29,null));};exports[_0xd497('0x53')]=function(_0x3037fb,_0x222035){var _0x26d760={'raw':!![],'where':{'id':_0x3037fb[_0xd497('0x54')]['id']}},_0x4fd799={};_0x4fd799[_0xd497('0x48')]=_[_0xd497('0x43')](db[_0xd497('0x3e')][_0xd497('0x3f')]);_0x4fd799[_0xd497('0x44')]=_[_0xd497('0x43')](_0x3037fb[_0xd497('0x44')]);_0x4fd799[_0xd497('0x4b')]=_[_0xd497('0x45')](_0x4fd799['model'],_0x4fd799[_0xd497('0x44')]);_0x26d760['attributes']=_[_0xd497('0x45')](_0x4fd799['model'],qs[_0xd497('0x47')](_0x3037fb['query'][_0xd497('0x47')]));_0x26d760[_0xd497('0x46')]=_0x26d760[_0xd497('0x46')][_0xd497('0x55')]?_0x26d760[_0xd497('0x46')]:_0x4fd799[_0xd497('0x48')];if(_0x3037fb['query']['includeAll']){_0x26d760[_0xd497('0x52')]=[{'all':!![]}];}_0x26d760=_[_0xd497('0x4f')]({},_0x26d760,_0x3037fb[_0xd497('0x50')]);return db['WhatsappMessage'][_0xd497('0x56')](_0x26d760)[_0xd497('0x21')](handleEntityNotFound(_0x222035,null))['then'](respondWithResult(_0x222035,null))[_0xd497('0x2b')](handleError(_0x222035,null));};exports[_0xd497('0x57')]=function(_0x109a37,_0x46e328){return db['WhatsappMessage']['create'](_0x109a37[_0xd497('0x58')],{})['then'](respondWithResult(_0x46e328,0xc9))['catch'](handleError(_0x46e328,null));};exports[_0xd497('0x39')]=function(_0x1e7205,_0x5f4fcd){if(_0x1e7205[_0xd497('0x58')]['id']){delete _0x1e7205[_0xd497('0x58')]['id'];}return db['WhatsappMessage'][_0xd497('0x56')]({'where':{'id':_0x1e7205[_0xd497('0x54')]['id']}})[_0xd497('0x21')](handleEntityNotFound(_0x5f4fcd,null))['then'](saveUpdates(_0x1e7205[_0xd497('0x58')],null))['then'](respondWithResult(_0x5f4fcd,null))[_0xd497('0x2b')](handleError(_0x5f4fcd,null));};exports['destroy']=function(_0x5d135a,_0x5c702e){return db[_0xd497('0x3e')][_0xd497('0x56')]({'where':{'id':_0x5d135a[_0xd497('0x54')]['id']}})[_0xd497('0x21')](handleEntityNotFound(_0x5c702e,null))['then'](removeEntity(_0x5c702e,null))[_0xd497('0x2b')](handleError(_0x5c702e,null));};exports[_0xd497('0x59')]=function(_0x11d450,_0xce7e){return db[_0xd497('0x3e')][_0xd497('0x59')]()[_0xd497('0x21')](respondWithResult(_0xce7e,null))['catch'](handleError(_0xce7e,null));};var interaction_log=require(_0xd497('0x13'))('whatsapp-interactions');exports[_0xd497('0x5a')]=function(_0x15a40a,_0x4b1872,_0x1818be){var _0x2de1c5={'agent':{},'channel':_0xd497('0x5b')};if(_0x15a40a[_0xd497('0x58')]['id']){delete _0x15a40a[_0xd497('0x58')]['id'];}_0x15a40a[_0xd497('0x58')][_0xd497('0x5c')]=!![];_0x15a40a['body']['readAt']=moment()[_0xd497('0x5d')](_0xd497('0x5e'));_0x15a40a[_0xd497('0x58')][_0xd497('0x5f')]=_0x15a40a[_0xd497('0x58')][_0xd497('0x5f')]||_0x15a40a['user']['id'];_0x2de1c5['agent']['id']=_0x15a40a[_0xd497('0x58')][_0xd497('0x5f')];return db['WhatsappMessage'][_0xd497('0x56')]({'where':{'id':_0x15a40a['params']['id'],'UserId':null}})[_0xd497('0x21')](handleEntityNotFound(_0x4b1872,null))[_0xd497('0x21')](saveUpdates(_0x15a40a[_0xd497('0x58')],null))[_0xd497('0x21')](function(_0xe7df42){if(_0xe7df42){_0x2de1c5[_0xd497('0x29')]=_0xe7df42[_0xd497('0x60')]({'plain':!![]});return db[_0xd497('0x61')][_0xd497('0x56')]({'where':{'id':_0xe7df42[_0xd497('0x62')]}});}return null;})[_0xd497('0x21')](handleEntityNotFound(_0x4b1872,null))['then'](function(_0x485a8a){if(_0x485a8a){return _0x485a8a[_0xd497('0x39')]({'UserId':_0x15a40a[_0xd497('0x58')][_0xd497('0x5f')],'read1stAt':_[_0xd497('0x63')](_0x485a8a['read1stAt'])?moment()[_0xd497('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x187b36){if(_0x187b36){_0x2de1c5[_0xd497('0x64')]=_0x187b36[_0xd497('0x60')]({'plain':!![]});interaction_log['info'](_0xd497('0x65'),_0x15a40a[_0xd497('0x66')]['id'],_0x15a40a[_0xd497('0x66')]['name'],_0x15a40a[_0xd497('0x66')][_0xd497('0x67')],_0x2de1c5['interaction']['id'],_0x15a40a[_0xd497('0x58')]?JSON[_0xd497('0x26')](_0x15a40a[_0xd497('0x58')]):_0xd497('0x68'));return respondWithRpcPromise(_0xd497('0x69'),_0xd497('0x6a'),_0x2de1c5);}return null;})['then'](function(_0x10a5d5){var _0x260ec1=_0xd497('0x6b')+_0x10a5d5['message'][_0xd497('0x6c')];return db['sequelize'][_0xd497('0x44')](_0x260ec1,{'type':db[_0xd497('0x6d')][_0xd497('0x6e')][_0xd497('0x6f')],'raw':!![]})[_0xd497('0x21')](function(_0x328ba1){return _0x328ba1;});})[_0xd497('0x21')](function(_0x57e783){if(_0x57e783){_0x2de1c5[_0xd497('0x29')][_0xd497('0x70')]=_0x57e783[0x0];if(!_0x15a40a[_0xd497('0x58')][_0xd497('0x5f')])return;return db[_0xd497('0x71')][_0xd497('0x56')]({'where':{'id':_0x15a40a[_0xd497('0x58')]['UserId'],'role':_0xd497('0x72')},'attributes':['id',_0xd497('0x3c'),_0xd497('0x73'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x430e0d){if(!_0x430e0d)return null;_0x2de1c5[_0xd497('0x29')][_0xd497('0x72')]=_0x430e0d;return _0x2de1c5;})[_0xd497('0x21')](function(_0x540fe7){if(_0x540fe7){if(_0x15a40a[_0xd497('0x58')][_0xd497('0x74')]){_0x2de1c5[_0xd497('0x29')]['interface']=util[_0xd497('0x5d')](_0xd497('0x75'),_0x15a40a[_0xd497('0x66')][_0xd497('0x3c')]);_0x2de1c5[_0xd497('0x29')][_0xd497('0x76')]=_0x2de1c5[_0xd497('0x76')];_0x2de1c5[_0xd497('0x29')][_0xd497('0x77')]=_0x2de1c5[_0xd497('0x76')];_0x2de1c5[_0xd497('0x29')][_0xd497('0x78')]=_0xd497('0x5a');return respondWithRpcPromise(_0xd497('0x79'),_0xd497('0x79'),{'event':_0xd497('0x7a'),'message':_0x2de1c5[_0xd497('0x29')]},client9002)['then'](function(){return _0x2de1c5;});}return _0x2de1c5;}return null;})['then'](respondWithResult(_0x4b1872,null))[_0xd497('0x2b')](handleError(_0x4b1872,null));};var interaction_log=require(_0xd497('0x13'))(_0xd497('0x7b'));exports[_0xd497('0x37')]=function(_0x3d3bd8,_0x301c74,_0x144b16){var _0xae6e36={'agent':{},'channel':_0xd497('0x5b')};if(_0x3d3bd8[_0xd497('0x58')]['id']){delete _0x3d3bd8[_0xd497('0x58')]['id'];}_0x3d3bd8[_0xd497('0x58')][_0xd497('0x5f')]=_0x3d3bd8[_0xd497('0x58')][_0xd497('0x5f')]||_0x3d3bd8[_0xd497('0x66')]['id'];_0xae6e36[_0xd497('0x72')]['id']=_0x3d3bd8[_0xd497('0x58')][_0xd497('0x5f')];return db[_0xd497('0x3e')]['find']({'where':{'id':_0x3d3bd8[_0xd497('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x301c74,null))[_0xd497('0x21')](function(_0x57c777){if(_0x57c777){_0xae6e36[_0xd497('0x29')]=_0x57c777[_0xd497('0x60')]({'plain':!![]});return db[_0xd497('0x61')][_0xd497('0x56')]({'where':{'id':_0x57c777[_0xd497('0x62')]}});}return null;})[_0xd497('0x21')](handleEntityNotFound(_0x301c74,null))['then'](function(_0x4d6e44){if(_0x4d6e44){_0xae6e36['interaction']=_0x4d6e44[_0xd497('0x60')]({'plain':!![]});interaction_log['info'](_0xd497('0x7c'),_0x3d3bd8['user']['id'],_0x3d3bd8['user']['name'],_0x3d3bd8[_0xd497('0x66')][_0xd497('0x67')],_0xae6e36[_0xd497('0x64')]['id'],_0x3d3bd8[_0xd497('0x58')]?JSON[_0xd497('0x26')](_0x3d3bd8[_0xd497('0x58')]):_0xd497('0x68'));return respondWithRpcPromise(_0xd497('0x7d'),_0xd497('0x7e'),_0xae6e36);}return null;})['then'](function(_0xb732af){var _0x15f67b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xb732af[_0xd497('0x29')]['ContactId'];return db['sequelize'][_0xd497('0x44')](_0x15f67b,{'type':db[_0xd497('0x6d')][_0xd497('0x6e')][_0xd497('0x6f')],'raw':!![]})['then'](function(_0x3746e4){return _0x3746e4;});})[_0xd497('0x21')](function(_0x501ae6){if(_0x501ae6){_0xae6e36[_0xd497('0x29')][_0xd497('0x70')]=_0x501ae6[0x0];if(!_0x3d3bd8[_0xd497('0x58')][_0xd497('0x5f')])return;return db[_0xd497('0x71')][_0xd497('0x56')]({'where':{'id':_0x3d3bd8[_0xd497('0x58')][_0xd497('0x5f')],'role':_0xd497('0x72')},'attributes':['id',_0xd497('0x3c'),'fullname',_0xd497('0x7f'),_0xd497('0x80')],'raw':!![]});}return null;})['then'](function(_0x5b008f){if(!_0x5b008f)return null;_0xae6e36['message'][_0xd497('0x72')]=_0x5b008f;return _0xae6e36;})[_0xd497('0x21')](function(_0x20a882){if(_0x20a882){_0x20a882[_0xd497('0x29')]['interface']=util[_0xd497('0x5d')]('SIP/%s',_0x3d3bd8['user'][_0xd497('0x3c')]);_0x20a882['message'][_0xd497('0x76')]=_0xae6e36[_0xd497('0x76')];_0x20a882['message']['motionChannel']=_0xae6e36[_0xd497('0x76')];_0x20a882['message'][_0xd497('0x78')]='reject';respondWithRpcPromise('EventManager',_0xd497('0x79'),{'event':'rejectmessage','message':_0x20a882[_0xd497('0x29')]},client9002);return _0xae6e36;}return null;})[_0xd497('0x21')](respondWithResult(_0x301c74,null))[_0xd497('0x2b')](handleError(_0x301c74,null));};exports[_0xd497('0x2d')]=function(_0x28e636,_0x2fcb3e,_0x555dc0){if(_0x28e636[_0xd497('0x58')]['id']){delete _0x28e636[_0xd497('0x58')]['id'];}var _0x47252a;return db[_0xd497('0x3e')]['find']({'where':{'id':_0x28e636['params']['id']}})['then'](handleEntityNotFound(_0x2fcb3e,null))[_0xd497('0x21')](function(_0x3ebb48){if(_0x3ebb48){_0x47252a=_0x3ebb48;return db[_0xd497('0x81')][_0xd497('0x56')]({'where':{'id':_0x3ebb48[_0xd497('0x82')]}});}})[_0xd497('0x21')](handleEntityNotFound(_0x2fcb3e,null))[_0xd497('0x21')](function(_0x14910f){if(_0x14910f){logger[_0xd497('0x25')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xd497('0x2d'),_0xd497('0x83'),_0x14910f[_0xd497('0x41')],util[_0xd497('0x84')](_0x28e636[_0xd497('0x58')],{'showHidden':![],'depth':null}));switch(_0x14910f[_0xd497('0x41')]){case _0xd497('0x85'):if(_0x28e636[_0xd497('0x58')]['MessageSid']&&_0x28e636[_0xd497('0x58')][_0xd497('0x86')]===_0x47252a[_0xd497('0x87')]&&_0x28e636[_0xd497('0x58')][_0xd497('0x88')]&&_0x28e636[_0xd497('0x58')]['MessageStatus']===_0xd497('0x5c')){return _0x47252a[_0xd497('0x39')]({'read':!![]});}else{logger[_0xd497('0x27')](_0xd497('0x89'),_0xd497('0x2d'),'twilio',util['inspect'](_0x28e636['body'],{'showHidden':![],'depth':null}));}break;}return _0x47252a;}})['then'](respondWithResult(_0x2fcb3e,null))[_0xd497('0x2b')](handleError(_0x2fcb3e,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 48b5868..fd453dc 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 _0x9861=['remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update'];(function(_0x93f5fe,_0x27e9e7){var _0x7e5e73=function(_0x57293d){while(--_0x57293d){_0x93f5fe['push'](_0x93f5fe['shift']());}};_0x7e5e73(++_0x27e9e7);}(_0x9861,0x176));var _0x1986=function(_0x4eeb30,_0x28c764){_0x4eeb30=_0x4eeb30-0x0;var _0x2b003e=_0x9861[_0x4eeb30];return _0x2b003e;};'use strict';var EventEmitter=require(_0x1986('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x1986('0x1')](0x0);var events={'afterCreate':_0x1986('0x2'),'afterUpdate':_0x1986('0x3'),'afterDestroy':_0x1986('0x4')};function emitEvent(_0x2c59a4){return function(_0x44e5c9,_0x5462a7,_0xe033ef){WhatsappMessageEvents[_0x1986('0x5')](_0x2c59a4+':'+_0x44e5c9['id'],_0x44e5c9);WhatsappMessageEvents[_0x1986('0x5')](_0x2c59a4,_0x44e5c9);_0xe033ef(null);};}for(var e in events){if(events[_0x1986('0x6')](e)){var event=events[e];WhatsappMessage[_0x1986('0x7')](e,emitEvent(event));}}module[_0x1986('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0x3f8c=['emit','hasOwnProperty','hook','exports','WhatsappMessage','setMaxListeners','save','update'];(function(_0x33bb07,_0x5b1849){var _0x481c81=function(_0x1709f0){while(--_0x1709f0){_0x33bb07['push'](_0x33bb07['shift']());}};_0x481c81(++_0x5b1849);}(_0x3f8c,0x104));var _0xc3f8=function(_0x207a3d,_0x4c0c5f){_0x207a3d=_0x207a3d-0x0;var _0x2f4c50=_0x3f8c[_0x207a3d];return _0x2f4c50;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0xc3f8('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xc3f8('0x1')](0x0);var events={'afterCreate':_0xc3f8('0x2'),'afterUpdate':_0xc3f8('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5bd5e7){return function(_0x54035a,_0x4e5dbd,_0x51b8b5){WhatsappMessageEvents[_0xc3f8('0x4')](_0x5bd5e7+':'+_0x54035a['id'],_0x54035a);WhatsappMessageEvents[_0xc3f8('0x4')](_0x5bd5e7,_0x54035a);_0x51b8b5(null);};}for(var e in events){if(events[_0xc3f8('0x5')](e)){var event=events[e];WhatsappMessage[_0xc3f8('0x6')](e,emitEvent(event));}}module[_0xc3f8('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index fb5fd1f..64944eb 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 _0x577e=['WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','messageId','fti_whatsapp_messages','models','get','direction','toLowerCase','out','secret','UserId','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','text','POST','application/json','statuses','message_id'];(function(_0x417e91,_0x414a75){var _0x9888d9=function(_0x4bfcad){while(--_0x4bfcad){_0x417e91['push'](_0x417e91['shift']());}};_0x9888d9(++_0x414a75);}(_0x577e,0x1f2));var _0xe577=function(_0x438685,_0x4ec0c0){_0x438685=_0x438685-0x0;var _0x41cca2=_0x577e[_0x438685];return _0x41cca2;};'use strict';var _=require('lodash');var util=require(_0xe577('0x0'));var logger=require(_0xe577('0x1'))('api');var moment=require(_0xe577('0x2'));var BPromise=require(_0xe577('0x3'));var rp=require(_0xe577('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0xe577('0x5'));var rimraf=require(_0xe577('0x6'));var config=require(_0xe577('0x7'));var attributes=require(_0xe577('0x8'));module[_0xe577('0x9')]=function(_0x38856b,_0x1a50d2){return _0x38856b['define'](_0xe577('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xe577('0xb'),'fields':['messageId']},{'name':_0xe577('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a8f6c,_0x57aa51,_0x8228bb){var _0x465fea=_0x38856b[_0xe577('0xd')];var _0x1b5da1=_0x2a8f6c[_0xe577('0xe')]({'plain':!![]});if(_0x1b5da1[_0xe577('0xf')]['toLowerCase']()==='in'||_0x1b5da1[_0xe577('0xf')][_0xe577('0x10')]()===_0xe577('0x11')&&!_0x1b5da1[_0xe577('0x12')]&&!_['isNil'](_0x1b5da1[_0xe577('0x13')])){_0x465fea['WhatsappInteraction'][_0xe577('0x14')]({'where':{'id':_0x1b5da1[_0xe577('0x15')]}})[_0xe577('0x16')](function(_0xdd811a){if(_0xdd811a){_0xdd811a[_0xe577('0x17')]({'lastMsgAt':_0x1b5da1[_0xe577('0x18')],'lastMsgDirection':_0x1b5da1[_0xe577('0xf')][_0xe577('0x10')]()});}})[_0xe577('0x19')](function(_0x141fdc){console[_0xe577('0x1a')](_0x141fdc);});}if(_0x1b5da1['direction']==='out'&&!_0x1b5da1[_0xe577('0x12')]){var _0x53d732;_0x465fea['WhatsappAccount']['find']({'where':{'id':_0x1b5da1[_0xe577('0x1b')]},'raw':!![]})['then'](function(_0x6d68fa){_0x53d732=_0x6d68fa;if(_0x53d732&&_0x53d732[_0xe577('0x1c')]){switch(_0x53d732[_0xe577('0x1c')]){case _0xe577('0x1d'):var _0x5c5e40=require(_0xe577('0x1d'));if(_0x53d732[_0xe577('0x1e')]&&_0x53d732[_0xe577('0x1f')]&&_0x53d732[_0xe577('0x20')]){var _0x1554bb=new _0x5c5e40(_0x53d732[_0xe577('0x1e')],_0x53d732['authToken']);_0x1554bb[_0xe577('0x21')][_0xe577('0x22')]({'body':_0x1b5da1[_0xe577('0x23')],'to':_0xe577('0x24')+_0x1b5da1[_0xe577('0x20')],'from':'whatsapp:'+_0x53d732[_0xe577('0x20')],'statusCallback':_0x53d732[_0xe577('0x25')]+_0xe577('0x26')+_0x1b5da1['id']+'/status?token='+_0x53d732[_0xe577('0x27')]})[_0xe577('0x16')](function(_0x5c6b12){if(_0x5c6b12[_0xe577('0x28')]){return _0x2a8f6c[_0xe577('0x17')]({'messageId':_0x5c6b12['sid']});}})[_0xe577('0x19')](function(_0x4ac0db){logger[_0xe577('0x1a')](_0xe577('0x29'),'afterCreate','twilio',util[_0xe577('0x2a')](_0x4ac0db,{'showHidden':![],'depth':null}));});}else{logger[_0xe577('0x1a')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe577('0x1d'),_0xe577('0x2b'));}break;case _0xe577('0x2c'):var _0x514973=_0x53d732[_0xe577('0x1e')];var _0x5a3722=_0x53d732[_0xe577('0x1f')];var _0x2f6e51=_0x53d732['baseUrl']+_0xe577('0x2d')+_0x514973+_0xe577('0x2e');var _0x22ca92={'to':[_0x1b5da1['phone']],'message':{'type':_0xe577('0x2f'),'text':_0x1b5da1[_0xe577('0x23')]}};var _0x1c41d0={'method':_0xe577('0x30'),'uri':_0x2f6e51,'headers':{'Authorization':'Bearer\x20'+_0x5a3722,'Content-Type':_0xe577('0x31')},'body':_0x22ca92,'json':!![]};rp(_0x1c41d0)[_0xe577('0x16')](function(_0x2ad68b){if(_0x2ad68b[_0xe577('0x32')][0x0][_0xe577('0x33')]){return _0x2a8f6c['update']({'messageId':_0x2ad68b[_0xe577('0x32')][0x0][_0xe577('0x33')]});}})[_0xe577('0x19')](function(_0x1fff3c){logger['err'](_0xe577('0x34'),_0x1fff3c);});break;}}})[_0xe577('0x35')](function(){_0x8228bb();});}else{_0x8228bb();}}},'charset':'utf8mb4','collate':_0xe577('0x36')});}; \ No newline at end of file +var _0x7cc1=['catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','update','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','node-fetch','rimraf','./whatsappMessage.attributes','exports','define','whatsapp_messages','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','createdAt'];(function(_0x5b28e1,_0x4dcd04){var _0x3cb3d2=function(_0x19f783){while(--_0x19f783){_0x5b28e1['push'](_0x5b28e1['shift']());}};_0x3cb3d2(++_0x4dcd04);}(_0x7cc1,0x118));var _0x17cc=function(_0x5bc52d,_0x3b8f4c){_0x5bc52d=_0x5bc52d-0x0;var _0x2c4578=_0x7cc1[_0x5bc52d];return _0x2c4578;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x17cc('0x0'))(_0x17cc('0x1'));var moment=require(_0x17cc('0x2'));var BPromise=require('bluebird');var rp=require(_0x17cc('0x3'));var fetch=require(_0x17cc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17cc('0x5'));var config=require('../../config/environment');var attributes=require(_0x17cc('0x6'));module[_0x17cc('0x7')]=function(_0x3afbae,_0x3416e0){return _0x3afbae[_0x17cc('0x8')]('WhatsappMessage',attributes,{'tableName':_0x17cc('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x17cc('0xa'),'fields':[_0x17cc('0xb')],'type':_0x17cc('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b6de2,_0x45d86f,_0x3d2a11){var _0x116cdd=_0x3afbae[_0x17cc('0xd')];var _0x2d8e5f=_0x2b6de2[_0x17cc('0xe')]({'plain':!![]});if(_0x2d8e5f[_0x17cc('0xf')][_0x17cc('0x10')]()==='in'||_0x2d8e5f[_0x17cc('0xf')]['toLowerCase']()===_0x17cc('0x11')&&!_0x2d8e5f[_0x17cc('0x12')]&&!_[_0x17cc('0x13')](_0x2d8e5f['UserId'])){_0x116cdd[_0x17cc('0x14')][_0x17cc('0x15')]({'where':{'id':_0x2d8e5f[_0x17cc('0x16')]}})[_0x17cc('0x17')](function(_0x1f1c75){if(_0x1f1c75){_0x1f1c75['update']({'lastMsgAt':_0x2d8e5f[_0x17cc('0x18')],'lastMsgDirection':_0x2d8e5f[_0x17cc('0xf')][_0x17cc('0x10')]()});}})[_0x17cc('0x19')](function(_0x1c82ad){console[_0x17cc('0x1a')](_0x1c82ad);});}if(_0x2d8e5f['direction']==='out'&&!_0x2d8e5f[_0x17cc('0x12')]){var _0x4b1e5f;_0x116cdd[_0x17cc('0x1b')][_0x17cc('0x1c')]({'where':{'id':_0x2d8e5f[_0x17cc('0x1d')]},'raw':!![]})[_0x17cc('0x17')](function(_0x2cff2e){_0x4b1e5f=_0x2cff2e;if(_0x4b1e5f&&_0x4b1e5f[_0x17cc('0x1e')]){switch(_0x4b1e5f[_0x17cc('0x1e')]){case _0x17cc('0x1f'):var _0x4f6105=require(_0x17cc('0x1f'));if(_0x4b1e5f[_0x17cc('0x20')]&&_0x4b1e5f[_0x17cc('0x21')]&&_0x4b1e5f['phone']){var _0x125a57=new _0x4f6105(_0x4b1e5f[_0x17cc('0x20')],_0x4b1e5f[_0x17cc('0x21')]);_0x125a57['messages'][_0x17cc('0x22')]({'body':_0x2d8e5f[_0x17cc('0xb')],'to':_0x17cc('0x23')+_0x2d8e5f[_0x17cc('0x24')],'from':'whatsapp:'+_0x4b1e5f['phone'],'statusCallback':_0x4b1e5f[_0x17cc('0x25')]+_0x17cc('0x26')+_0x2d8e5f['id']+_0x17cc('0x27')+_0x4b1e5f[_0x17cc('0x28')]})[_0x17cc('0x17')](function(_0x42e2ff){if(_0x42e2ff['sid']){return _0x2b6de2['update']({'messageId':_0x42e2ff[_0x17cc('0x29')]});}})['catch'](function(_0x483d92){logger[_0x17cc('0x1a')](_0x17cc('0x2a'),'afterCreate',_0x17cc('0x1f'),util[_0x17cc('0x2b')](_0x483d92,{'showHidden':![],'depth':null}));});}else{logger[_0x17cc('0x1a')](_0x17cc('0x2a'),_0x17cc('0x2c'),_0x17cc('0x1f'),_0x17cc('0x2d'));}break;case _0x17cc('0x2e'):var _0x7a1616=_0x4b1e5f['accountSid'];var _0x469708=_0x4b1e5f[_0x17cc('0x21')];var _0x539b9a=_0x4b1e5f[_0x17cc('0x2f')]+_0x17cc('0x30')+_0x7a1616+_0x17cc('0x31');var _0x3bba78={'to':[_0x2d8e5f[_0x17cc('0x24')]],'message':{'type':_0x17cc('0x32'),'text':_0x2d8e5f[_0x17cc('0xb')]}};var _0x4934b0={'method':_0x17cc('0x33'),'uri':_0x539b9a,'headers':{'Authorization':_0x17cc('0x34')+_0x469708,'Content-Type':_0x17cc('0x35')},'body':_0x3bba78,'json':!![]};rp(_0x4934b0)['then'](function(_0x3cf453){if(_0x3cf453[_0x17cc('0x36')][0x0][_0x17cc('0x37')]){return _0x2b6de2[_0x17cc('0x38')]({'messageId':_0x3cf453[_0x17cc('0x36')][0x0][_0x17cc('0x37')]});}})[_0x17cc('0x19')](function(_0x3cd087){logger['err'](_0x17cc('0x39'),_0x3cd087);});break;}}})[_0x17cc('0x3a')](function(){_0x3d2a11();});}else{_0x3d2a11();}}},'charset':_0x17cc('0x3b'),'collate':_0x17cc('0x3c')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 32f88eb..ea71ceb 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 _0x8e6f=['result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./whatsappMessage.socket','request','then','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message'];(function(_0x43af80,_0x1a300e){var _0x26c0ea=function(_0x3fb0b6){while(--_0x3fb0b6){_0x43af80['push'](_0x43af80['shift']());}};_0x26c0ea(++_0x1a300e);}(_0x8e6f,0x172));var _0xf8e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e6f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf8e6('0x0'));var moment=require('moment');var BPromise=require(_0xf8e6('0x1'));var rs=require(_0xf8e6('0x2'));var fs=require('fs');var Redis=require(_0xf8e6('0x3'));var db=require(_0xf8e6('0x4'))['db'];var utils=require(_0xf8e6('0x5'));var logger=require(_0xf8e6('0x6'))(_0xf8e6('0x7'));var config=require(_0xf8e6('0x8'));var jayson=require(_0xf8e6('0x9'));var client=jayson[_0xf8e6('0xa')][_0xf8e6('0xb')]({'port':0x232a});config['redis']=_[_0xf8e6('0xc')](config[_0xf8e6('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8e6('0xd')]));require(_0xf8e6('0xe'))['register'](socket);function respondWithRpcPromise(_0x4a3a3f,_0xe138cb,_0x2b8335){return new BPromise(function(_0xcf9d0a,_0x29a0ec){return client[_0xf8e6('0xf')](_0x4a3a3f,_0x2b8335)[_0xf8e6('0x10')](function(_0x36d5d5){logger[_0xf8e6('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0xe138cb,'request\x20sent');logger[_0xf8e6('0x12')](_0xf8e6('0x13'),_0xe138cb,_0xf8e6('0x14'),JSON[_0xf8e6('0x15')](_0x36d5d5));if(_0x36d5d5[_0xf8e6('0x16')]){if(_0x36d5d5[_0xf8e6('0x16')][_0xf8e6('0x17')]===0x1f4){logger[_0xf8e6('0x16')](_0xf8e6('0x18'),_0xe138cb,_0x36d5d5[_0xf8e6('0x16')]['message']);return _0x29a0ec(_0x36d5d5[_0xf8e6('0x16')][_0xf8e6('0x19')]);}logger['error'](_0xf8e6('0x18'),_0xe138cb,_0x36d5d5[_0xf8e6('0x16')][_0xf8e6('0x19')]);return _0xcf9d0a(_0x36d5d5[_0xf8e6('0x16')][_0xf8e6('0x19')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0xe138cb,_0xf8e6('0x14'));_0xcf9d0a(_0x36d5d5[_0xf8e6('0x1a')]['message']);}})[_0xf8e6('0x1b')](function(_0x4c60f0){logger[_0xf8e6('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0xe138cb,_0x4c60f0);_0x29a0ec(_0x4c60f0);});});}exports[_0xf8e6('0x1c')]=function(_0x52d8f6){var _0x45facc=this;return new Promise(function(_0x2f487b,_0x6bb9cd){return db[_0xf8e6('0x1d')][_0xf8e6('0x1e')](_0x52d8f6['body'],{'raw':_0x52d8f6[_0xf8e6('0x1f')]?_0x52d8f6[_0xf8e6('0x1f')][_0xf8e6('0x20')]===undefined?!![]:![]:!![]})[_0xf8e6('0x10')](function(_0x4ded3b){logger['info'](_0xf8e6('0x1c'),_0x52d8f6);logger[_0xf8e6('0x12')]('CreateWhatsappMessage',_0x52d8f6,JSON[_0xf8e6('0x15')](_0x4ded3b));_0x2f487b(_0x4ded3b);})[_0xf8e6('0x1b')](function(_0x26799b){logger['error']('CreateWhatsappMessage',_0x26799b[_0xf8e6('0x19')],_0x52d8f6);_0x6bb9cd(_0x45facc[_0xf8e6('0x16')](0x1f4,_0x26799b[_0xf8e6('0x19')]));});});}; \ No newline at end of file +var _0x3685=['result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./whatsappMessage.socket','register','request','then','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info'];(function(_0x26c5ea,_0x13d5d8){var _0x2a9aa6=function(_0x389d83){while(--_0x389d83){_0x26c5ea['push'](_0x26c5ea['shift']());}};_0x2a9aa6(++_0x13d5d8);}(_0x3685,0xdb));var _0x5368=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3685[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5368('0x0'));var util=require(_0x5368('0x1'));var moment=require('moment');var BPromise=require(_0x5368('0x2'));var rs=require(_0x5368('0x3'));var fs=require('fs');var Redis=require(_0x5368('0x4'));var db=require(_0x5368('0x5'))['db'];var utils=require(_0x5368('0x6'));var logger=require(_0x5368('0x7'))(_0x5368('0x8'));var config=require(_0x5368('0x9'));var jayson=require(_0x5368('0xa'));var client=jayson[_0x5368('0xb')]['http']({'port':0x232a});config[_0x5368('0xc')]=_['defaults'](config[_0x5368('0xc')],{'host':_0x5368('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5368('0xc')]));require(_0x5368('0xe'))[_0x5368('0xf')](socket);function respondWithRpcPromise(_0x3af57c,_0x4e73cd,_0x3a4bd5){return new BPromise(function(_0x1dacfb,_0x34d2b2){return client[_0x5368('0x10')](_0x3af57c,_0x3a4bd5)[_0x5368('0x11')](function(_0x2d12ca){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x4e73cd,_0x5368('0x12'));logger['debug'](_0x5368('0x13'),_0x4e73cd,_0x5368('0x12'),JSON[_0x5368('0x14')](_0x2d12ca));if(_0x2d12ca[_0x5368('0x15')]){if(_0x2d12ca[_0x5368('0x15')][_0x5368('0x16')]===0x1f4){logger[_0x5368('0x15')](_0x5368('0x17'),_0x4e73cd,_0x2d12ca[_0x5368('0x15')][_0x5368('0x18')]);return _0x34d2b2(_0x2d12ca['error'][_0x5368('0x18')]);}logger['error'](_0x5368('0x17'),_0x4e73cd,_0x2d12ca[_0x5368('0x15')][_0x5368('0x18')]);return _0x1dacfb(_0x2d12ca['error']['message']);}else{logger[_0x5368('0x19')](_0x5368('0x17'),_0x4e73cd,_0x5368('0x12'));_0x1dacfb(_0x2d12ca[_0x5368('0x1a')][_0x5368('0x18')]);}})[_0x5368('0x1b')](function(_0xfd9b0){logger[_0x5368('0x15')](_0x5368('0x17'),_0x4e73cd,_0xfd9b0);_0x34d2b2(_0xfd9b0);});});}exports[_0x5368('0x1c')]=function(_0x45e726){var _0x111cc7=this;return new Promise(function(_0x1fd3df,_0x317365){return db[_0x5368('0x1d')][_0x5368('0x1e')](_0x45e726[_0x5368('0x1f')],{'raw':_0x45e726[_0x5368('0x20')]?_0x45e726[_0x5368('0x20')][_0x5368('0x21')]===undefined?!![]:![]:!![]})[_0x5368('0x11')](function(_0x47ffb4){logger[_0x5368('0x19')]('CreateWhatsappMessage',_0x45e726);logger[_0x5368('0x22')](_0x5368('0x1c'),_0x45e726,JSON[_0x5368('0x14')](_0x47ffb4));_0x1fd3df(_0x47ffb4);})[_0x5368('0x1b')](function(_0x937843){logger[_0x5368('0x15')](_0x5368('0x1c'),_0x937843[_0x5368('0x18')],_0x45e726);_0x317365(_0x111cc7[_0x5368('0x15')](0x1f4,_0x937843['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index ea71f5c..01ae42a 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 _0x639f=['emit','removeListener','whatsappMessage:','./whatsappMessage.events','save','update'];(function(_0x4ec42,_0x36177b){var _0x385e11=function(_0x44e535){while(--_0x44e535){_0x4ec42['push'](_0x4ec42['shift']());}};_0x385e11(++_0x36177b);}(_0x639f,0x1e9));var _0xf639=function(_0xf8c56f,_0x58435e){_0xf8c56f=_0xf8c56f-0x0;var _0x29c05c=_0x639f[_0xf8c56f];return _0x29c05c;};'use strict';var WhatsappMessageEvents=require(_0xf639('0x0'));var events=[_0xf639('0x1'),'remove',_0xf639('0x2')];function createListener(_0x113329,_0x3e0081){return function(_0x44c604){_0x3e0081[_0xf639('0x3')](_0x113329,_0x44c604);};}function removeListener(_0x3ffba8,_0x1d1cdc){return function(){WhatsappMessageEvents[_0xf639('0x4')](_0x3ffba8,_0x1d1cdc);};}exports['register']=function(_0x3e7466){for(var _0x11e7d9=0x0,_0x2b5a4b=events['length'];_0x11e7d9<_0x2b5a4b;_0x11e7d9++){var _0x2e8f57=events[_0x11e7d9];var _0x4ed51c=createListener(_0xf639('0x5')+_0x2e8f57,_0x3e7466);WhatsappMessageEvents['on'](_0x2e8f57,_0x4ed51c);}}; \ No newline at end of file +var _0x0d5b=['./whatsappMessage.events','save','update','register','whatsappMessage:'];(function(_0x312133,_0x240c92){var _0x3f890c=function(_0x39d24d){while(--_0x39d24d){_0x312133['push'](_0x312133['shift']());}};_0x3f890c(++_0x240c92);}(_0x0d5b,0x8c));var _0xb0d5=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x0d5b[_0x1f9f37];return _0x21c080;};'use strict';var WhatsappMessageEvents=require(_0xb0d5('0x0'));var events=[_0xb0d5('0x1'),'remove',_0xb0d5('0x2')];function createListener(_0x3271f9,_0x9c836d){return function(_0x384566){_0x9c836d['emit'](_0x3271f9,_0x384566);};}function removeListener(_0x4e1dc3,_0x43aaf4){return function(){WhatsappMessageEvents['removeListener'](_0x4e1dc3,_0x43aaf4);};}exports[_0xb0d5('0x3')]=function(_0x2f5511){for(var _0x3d74b7=0x0,_0x4e31ec=events['length'];_0x3d74b7<_0x4e31ec;_0x3d74b7++){var _0x3f2789=events[_0x3d74b7];var _0x59ceca=createListener(_0xb0d5('0x4')+_0x3f2789,_0x2f5511);WhatsappMessageEvents['on'](_0x3f2789,_0x59ceca);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 30caa11..d6bfee7 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 _0x9cf2=['/describe','isAuthenticated','get','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','post','create','put','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9cf2,0xac));var _0x29cf=function(_0x2af90a,_0x4b34b8){_0x2af90a=_0x2af90a-0x0;var _0xd668ee=_0x9cf2[_0x2af90a];return _0xd668ee;};'use strict';var multer=require(_0x29cf('0x0'));var util=require(_0x29cf('0x1'));var path=require(_0x29cf('0x2'));var timeout=require(_0x29cf('0x3'));var express=require(_0x29cf('0x4'));var router=express[_0x29cf('0x5')]();var fs_extra=require(_0x29cf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x29cf('0x7'));var config=require(_0x29cf('0x8'));var controller=require('./whatsappQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x29cf('0x9')]);router['get'](_0x29cf('0xa'),auth[_0x29cf('0xb')](),controller['describe']);router[_0x29cf('0xc')](_0x29cf('0xd'),auth['isAuthenticated'](),controller[_0x29cf('0xe')]);router[_0x29cf('0xc')](_0x29cf('0xf'),auth[_0x29cf('0xb')](),controller[_0x29cf('0x10')]);router[_0x29cf('0xc')](_0x29cf('0x11'),auth[_0x29cf('0xb')](),controller['getTeams']);router[_0x29cf('0xc')](_0x29cf('0x12'),auth[_0x29cf('0xb')](),controller['getAgents']);router[_0x29cf('0x13')]('/',auth[_0x29cf('0xb')](),controller[_0x29cf('0x14')]);router[_0x29cf('0x13')](_0x29cf('0x11'),auth[_0x29cf('0xb')](),controller['addTeams']);router[_0x29cf('0x13')]('/:id/users',auth[_0x29cf('0xb')](),controller['addAgents']);router[_0x29cf('0x15')](_0x29cf('0xd'),auth['isAuthenticated'](),controller[_0x29cf('0x16')]);router[_0x29cf('0x17')](_0x29cf('0xd'),auth[_0x29cf('0xb')](),controller['destroy']);router[_0x29cf('0x17')](_0x29cf('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x29cf('0x17')](_0x29cf('0x12'),auth[_0x29cf('0xb')](),controller[_0x29cf('0x18')]);module[_0x29cf('0x19')]=router; \ No newline at end of file +var _0x3de6=['get','isAuthenticated','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','util','path','../../components/auth/service','../../components/interaction/service'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0x3de6,0x141));var _0x63de=function(_0x2ba73e,_0x4c3e08){_0x2ba73e=_0x2ba73e-0x0;var _0x544a5a=_0x3de6[_0x2ba73e];return _0x544a5a;};'use strict';var multer=require('multer');var util=require(_0x63de('0x0'));var path=require(_0x63de('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x63de('0x2'));var interaction=require(_0x63de('0x3'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0x63de('0x4')]('/',auth[_0x63de('0x5')](),controller['index']);router[_0x63de('0x4')](_0x63de('0x6'),auth[_0x63de('0x5')](),controller['describe']);router['get'](_0x63de('0x7'),auth['isAuthenticated'](),controller[_0x63de('0x8')]);router['get'](_0x63de('0x9'),auth['isAuthenticated'](),controller[_0x63de('0xa')]);router[_0x63de('0x4')](_0x63de('0xb'),auth[_0x63de('0x5')](),controller['getTeams']);router['get']('/:id/users',auth[_0x63de('0x5')](),controller[_0x63de('0xc')]);router[_0x63de('0xd')]('/',auth[_0x63de('0x5')](),controller[_0x63de('0xe')]);router['post'](_0x63de('0xb'),auth[_0x63de('0x5')](),controller[_0x63de('0xf')]);router[_0x63de('0xd')]('/:id/users',auth[_0x63de('0x5')](),controller[_0x63de('0x10')]);router[_0x63de('0x11')](_0x63de('0x7'),auth[_0x63de('0x5')](),controller[_0x63de('0x12')]);router[_0x63de('0x13')]('/:id',auth[_0x63de('0x5')](),controller[_0x63de('0x14')]);router[_0x63de('0x13')](_0x63de('0xb'),auth[_0x63de('0x5')](),controller[_0x63de('0x15')]);router[_0x63de('0x13')](_0x63de('0x16'),auth[_0x63de('0x5')](),controller[_0x63de('0x17')]);module[_0x63de('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 2d682bc..d9c92bf 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 _0x2621=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x2621,0x1d2));var _0x1262=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2621[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1262('0x0'));module[_0x1262('0x1')]={'name':{'type':Sequelize[_0x1262('0x2')],'unique':_0x1262('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x1262('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1262('0x5')](_0x1262('0x6'),_0x1262('0x7'),_0x1262('0x8'))},'description':{'type':Sequelize[_0x1262('0x2')]}}; \ No newline at end of file +var _0x5d31=['INTEGER','ENUM','beepall','sequelize','exports','STRING'];(function(_0x22ca15,_0x1baa74){var _0x4df8f0=function(_0x5f0d67){while(--_0x5f0d67){_0x22ca15['push'](_0x22ca15['shift']());}};_0x4df8f0(++_0x1baa74);}(_0x5d31,0xb7));var _0x15d3=function(_0x11ea14,_0x5bddf5){_0x11ea14=_0x11ea14-0x0;var _0x5286f8=_0x5d31[_0x11ea14];return _0x5286f8;};'use strict';var Sequelize=require(_0x15d3('0x0'));module[_0x15d3('0x1')]={'name':{'type':Sequelize[_0x15d3('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x15d3('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x15d3('0x4')]('rrmemory',_0x15d3('0x5'),'roundrobin')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 9de864e..6d824f6 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 _0x8e0d=['filter','options','includeAll','include','findAll','rows','catch','params','keys','merge','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserWhatsappQueue','nolimit','User','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','ids','online','interface','flatMap','sequelize','each','forEach','userWhatsappQueue:save','removeTeams','Agents','field','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','emit','spread','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','UserProfileResource','name','send','map','WhatsappQueue','rawAttributes','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x8e0d,0x1d0));var _0xd8e0=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x8e0d[_0x191154];return _0x3dcd73;};'use strict';var emlformat=require(_0xd8e0('0x0'));var rimraf=require(_0xd8e0('0x1'));var zipdir=require(_0xd8e0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd8e0('0x3'));var moment=require(_0xd8e0('0x4'));var BPromise=require(_0xd8e0('0x5'));var Mustache=require(_0xd8e0('0x6'));var util=require('util');var path=require(_0xd8e0('0x7'));var sox=require(_0xd8e0('0x8'));var csv=require('to-csv');var ejs=require(_0xd8e0('0x9'));var fs=require('fs');var fs_extra=require(_0xd8e0('0xa'));var _=require(_0xd8e0('0xb'));var squel=require('squel');var crypto=require(_0xd8e0('0xc'));var jsforce=require(_0xd8e0('0xd'));var deskjs=require(_0xd8e0('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd8e0('0xf'));var Papa=require('papaparse');var Redis=require(_0xd8e0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd8e0('0x11'));var as=require(_0xd8e0('0x12'));var hardwareService=require(_0xd8e0('0x13'));var logger=require(_0xd8e0('0x14'))(_0xd8e0('0x15'));var utils=require('../../config/utils');var config=require(_0xd8e0('0x16'));var licenseUtil=require(_0xd8e0('0x17'));var db=require(_0xd8e0('0x18'))['db'];config[_0xd8e0('0x19')]=_[_0xd8e0('0x1a')](config[_0xd8e0('0x19')],{'host':_0xd8e0('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd8e0('0x19')]));require(_0xd8e0('0x1c'))[_0xd8e0('0x1d')](socket);function respondWithStatusCode(_0x1ff4e4,_0x484724){_0x484724=_0x484724||0xcc;return function(_0x473fe3){if(_0x473fe3){return _0x1ff4e4[_0xd8e0('0x1e')](_0x484724);}return _0x1ff4e4[_0xd8e0('0x1f')](_0x484724)[_0xd8e0('0x20')]();};}function respondWithResult(_0x30cb4d,_0x301d26){_0x301d26=_0x301d26||0xc8;return function(_0x161c32){if(_0x161c32){return _0x30cb4d[_0xd8e0('0x1f')](_0x301d26)[_0xd8e0('0x21')](_0x161c32);}};}function respondWithFilteredResult(_0xc5f189,_0x18b50f){return function(_0x56db8c){if(_0x56db8c){var _0x3a2d2b=typeof _0x18b50f[_0xd8e0('0x22')]===_0xd8e0('0x23')&&typeof _0x18b50f[_0xd8e0('0x24')]===_0xd8e0('0x23');var _0x39a7b7=_0x56db8c[_0xd8e0('0x25')];var _0x173878=_0x3a2d2b?0x0:_0x18b50f[_0xd8e0('0x22')];var _0x425a60=_0x3a2d2b?_0x56db8c[_0xd8e0('0x25')]:_0x18b50f[_0xd8e0('0x22')]+_0x18b50f[_0xd8e0('0x24')];var _0x3ea31c;if(_0x425a60>=_0x39a7b7){_0x425a60=_0x39a7b7;_0x3ea31c=0xc8;}else{_0x3ea31c=0xce;}_0xc5f189[_0xd8e0('0x1f')](_0x3ea31c);return _0xc5f189[_0xd8e0('0x26')](_0xd8e0('0x27'),_0x173878+'-'+_0x425a60+'/'+_0x39a7b7)[_0xd8e0('0x21')](_0x56db8c);}return null;};}function patchUpdates(_0x571ca8){return function(_0x17e5e9){try{jsonpatch['apply'](_0x17e5e9,_0x571ca8,!![]);}catch(_0x536708){return BPromise[_0xd8e0('0x28')](_0x536708);}return _0x17e5e9['save']();};}function saveUpdates(_0x17e954,_0x4df27c){return function(_0x50dee9){if(_0x50dee9){return _0x50dee9[_0xd8e0('0x29')](_0x17e954)[_0xd8e0('0x2a')](function(_0x34d136){return _0x34d136;});}return null;};}function removeEntity(_0x55fa66,_0x5e4189){return function(_0x2e4f8b){if(_0x2e4f8b){return _0x2e4f8b[_0xd8e0('0x2b')]()[_0xd8e0('0x2a')](function(){var _0x1d9690=_0x2e4f8b['get']({'plain':!![]});var _0xab212f='WhatsappQueues';return db[_0xd8e0('0x2c')][_0xd8e0('0x2b')]({'where':{'type':_0xab212f,'resourceId':_0x1d9690['id']}})[_0xd8e0('0x2a')](function(){return _0x2e4f8b;});})[_0xd8e0('0x2a')](function(){_0x55fa66[_0xd8e0('0x1f')](0xcc)[_0xd8e0('0x20')]();});}};}function handleEntityNotFound(_0x32bc6d,_0x58cb34){return function(_0x3e0076){if(!_0x3e0076){_0x32bc6d[_0xd8e0('0x1e')](0x194);}return _0x3e0076;};}function handleError(_0x1f5983,_0x5cc318){_0x5cc318=_0x5cc318||0x1f4;return function(_0x1014d9){logger['error'](_0x1014d9['stack']);if(_0x1014d9[_0xd8e0('0x2d')]){delete _0x1014d9[_0xd8e0('0x2d')];}_0x1f5983[_0xd8e0('0x1f')](_0x5cc318)[_0xd8e0('0x2e')](_0x1014d9);};}exports['index']=function(_0x4a3945,_0x504625){var _0x43870b={},_0x4a4632={},_0x585180={'count':0x0,'rows':[]};var _0x363a8e=_[_0xd8e0('0x2f')](db[_0xd8e0('0x30')][_0xd8e0('0x31')],function(_0x3a4295){return{'name':_0x3a4295['fieldName'],'type':_0x3a4295[_0xd8e0('0x32')][_0xd8e0('0x33')]};});_0x4a4632['model']=_[_0xd8e0('0x2f')](_0x363a8e,_0xd8e0('0x2d'));_0x4a4632[_0xd8e0('0x34')]=_['keys'](_0x4a3945[_0xd8e0('0x34')]);_0x4a4632[_0xd8e0('0x35')]=_[_0xd8e0('0x36')](_0x4a4632['model'],_0x4a4632[_0xd8e0('0x34')]);_0x43870b[_0xd8e0('0x37')]=_[_0xd8e0('0x36')](_0x4a4632['model'],qs['fields'](_0x4a3945[_0xd8e0('0x34')][_0xd8e0('0x38')]));_0x43870b['attributes']=_0x43870b[_0xd8e0('0x37')][_0xd8e0('0x39')]?_0x43870b['attributes']:_0x4a4632[_0xd8e0('0x3a')];if(!_0x4a3945[_0xd8e0('0x34')][_0xd8e0('0x3b')]('nolimit')){_0x43870b[_0xd8e0('0x24')]=qs[_0xd8e0('0x24')](_0x4a3945['query']['limit']);_0x43870b[_0xd8e0('0x22')]=qs['offset'](_0x4a3945[_0xd8e0('0x34')][_0xd8e0('0x22')]);}_0x43870b[_0xd8e0('0x3c')]=qs[_0xd8e0('0x3d')](_0x4a3945[_0xd8e0('0x34')]['sort']);_0x43870b[_0xd8e0('0x3e')]=qs[_0xd8e0('0x35')](_[_0xd8e0('0x3f')](_0x4a3945[_0xd8e0('0x34')],_0x4a4632[_0xd8e0('0x35')]),_0x363a8e);if(_0x4a3945[_0xd8e0('0x34')][_0xd8e0('0x40')]){_0x43870b[_0xd8e0('0x3e')]=_['merge'](_0x43870b[_0xd8e0('0x3e')],{'$or':_[_0xd8e0('0x2f')](_0x363a8e,function(_0x109749){if(_0x109749[_0xd8e0('0x32')]!=='VIRTUAL'){var _0x449668={};_0x449668[_0x109749['name']]={'$like':'%'+_0x4a3945[_0xd8e0('0x34')]['filter']+'%'};return _0x449668;}})});}_0x43870b=_['merge']({},_0x43870b,_0x4a3945[_0xd8e0('0x41')]);var _0x3a25c3={'where':_0x43870b['where']};return db[_0xd8e0('0x30')]['count'](_0x3a25c3)[_0xd8e0('0x2a')](function(_0x33082d){_0x585180['count']=_0x33082d;if(_0x4a3945[_0xd8e0('0x34')][_0xd8e0('0x42')]){_0x43870b[_0xd8e0('0x43')]=[{'all':!![]}];}return db[_0xd8e0('0x30')][_0xd8e0('0x44')](_0x43870b);})['then'](function(_0x53b01a){_0x585180[_0xd8e0('0x45')]=_0x53b01a;return _0x585180;})[_0xd8e0('0x2a')](respondWithFilteredResult(_0x504625,_0x43870b))[_0xd8e0('0x46')](handleError(_0x504625,null));};exports['show']=function(_0x11fcf2,_0x1420c5){var _0x45d772={'raw':!![],'where':{'id':_0x11fcf2[_0xd8e0('0x47')]['id']}},_0x1c788b={};_0x1c788b[_0xd8e0('0x3a')]=_[_0xd8e0('0x48')](db[_0xd8e0('0x30')][_0xd8e0('0x31')]);_0x1c788b[_0xd8e0('0x34')]=_[_0xd8e0('0x48')](_0x11fcf2[_0xd8e0('0x34')]);_0x1c788b['filters']=_[_0xd8e0('0x36')](_0x1c788b['model'],_0x1c788b['query']);_0x45d772['attributes']=_[_0xd8e0('0x36')](_0x1c788b['model'],qs['fields'](_0x11fcf2['query']['fields']));_0x45d772['attributes']=_0x45d772[_0xd8e0('0x37')]['length']?_0x45d772[_0xd8e0('0x37')]:_0x1c788b[_0xd8e0('0x3a')];if(_0x11fcf2[_0xd8e0('0x34')][_0xd8e0('0x42')]){_0x45d772[_0xd8e0('0x43')]=[{'all':!![]}];}_0x45d772=_[_0xd8e0('0x49')]({},_0x45d772,_0x11fcf2['options']);return db[_0xd8e0('0x30')][_0xd8e0('0x4a')](_0x45d772)[_0xd8e0('0x2a')](handleEntityNotFound(_0x1420c5,null))[_0xd8e0('0x2a')](respondWithResult(_0x1420c5,null))['catch'](handleError(_0x1420c5,null));};exports[_0xd8e0('0x4b')]=function(_0x496730,_0xac9f9b){return db[_0xd8e0('0x30')][_0xd8e0('0x4b')](_0x496730['body'],{})[_0xd8e0('0x2a')](function(_0x33eb4c){var _0x4c49c1=_0x496730['user'][_0xd8e0('0x4c')]({'plain':!![]});if(!_0x4c49c1)throw new Error(_0xd8e0('0x4d'));if(_0x4c49c1[_0xd8e0('0x4e')]===_0xd8e0('0x4f')){var _0x157f16=_0x33eb4c[_0xd8e0('0x4c')]({'plain':!![]});var _0x46268b='WhatsappQueues';return db['UserProfileSection'][_0xd8e0('0x4a')]({'where':{'name':_0x46268b,'userProfileId':_0x4c49c1[_0xd8e0('0x50')]},'raw':!![]})[_0xd8e0('0x2a')](function(_0x3216d9){if(_0x3216d9&&_0x3216d9[_0xd8e0('0x51')]===0x0){return db[_0xd8e0('0x2c')][_0xd8e0('0x4b')]({'name':_0x157f16[_0xd8e0('0x2d')],'resourceId':_0x157f16['id'],'type':_0x3216d9[_0xd8e0('0x2d')],'sectionId':_0x3216d9['id']},{})[_0xd8e0('0x2a')](function(){return _0x33eb4c;});}else{return _0x33eb4c;}})['catch'](function(_0x39f6a8){logger[_0xd8e0('0x52')](_0xd8e0('0x53'),_0x39f6a8);throw _0x39f6a8;});}return _0x33eb4c;})[_0xd8e0('0x2a')](respondWithResult(_0xac9f9b,0xc9))['catch'](handleError(_0xac9f9b,null));};exports[_0xd8e0('0x29')]=function(_0x5efe57,_0x43cb1a){if(_0x5efe57[_0xd8e0('0x54')]['id']){delete _0x5efe57[_0xd8e0('0x54')]['id'];}return db[_0xd8e0('0x30')][_0xd8e0('0x4a')]({'where':{'id':_0x5efe57[_0xd8e0('0x47')]['id']}})[_0xd8e0('0x2a')](handleEntityNotFound(_0x43cb1a,null))[_0xd8e0('0x2a')](saveUpdates(_0x5efe57[_0xd8e0('0x54')],null))['then'](respondWithResult(_0x43cb1a,null))['catch'](handleError(_0x43cb1a,null));};exports['destroy']=function(_0x4bc5e7,_0x1bc121){return db['WhatsappQueue'][_0xd8e0('0x4a')]({'where':{'id':_0x4bc5e7['params']['id']}})[_0xd8e0('0x2a')](handleEntityNotFound(_0x1bc121,null))[_0xd8e0('0x2a')](removeEntity(_0x1bc121,null))[_0xd8e0('0x46')](handleError(_0x1bc121,null));};exports['describe']=function(_0x2c772e,_0x379e94){return db['WhatsappQueue'][_0xd8e0('0x55')]()[_0xd8e0('0x2a')](respondWithResult(_0x379e94,null))['catch'](handleError(_0x379e94,null));};exports[_0xd8e0('0x56')]=function(_0x4cbd1d,_0x1f9beb,_0x3ab1a9){var _0x16ea76={'raw':!![],'where':{}},_0x5f2add={},_0x5d52c6;return db['WhatsappQueue']['findOne']({'where':{'id':_0x4cbd1d[_0xd8e0('0x47')]['id']}})[_0xd8e0('0x2a')](handleEntityNotFound(_0x1f9beb,null))[_0xd8e0('0x2a')](function(_0x14ebc9){if(_0x14ebc9){_0x5d52c6=_0x14ebc9['get']({'plain':!![]});_0x5f2add['model']=_[_0xd8e0('0x48')](db[_0xd8e0('0x57')]['rawAttributes']);_0x5f2add[_0xd8e0('0x34')]=_[_0xd8e0('0x48')](_0x4cbd1d[_0xd8e0('0x34')]);_0x5f2add[_0xd8e0('0x35')]=_[_0xd8e0('0x36')](_0x5f2add[_0xd8e0('0x3a')],_0x5f2add[_0xd8e0('0x34')]);_0x16ea76['attributes']=_[_0xd8e0('0x36')](_0x5f2add[_0xd8e0('0x3a')],qs[_0xd8e0('0x38')](_0x4cbd1d['query'][_0xd8e0('0x38')]));_0x16ea76[_0xd8e0('0x37')]=_0x16ea76[_0xd8e0('0x37')]['length']?_0x16ea76[_0xd8e0('0x37')]:_0x5f2add[_0xd8e0('0x3a')];if(!_0x4cbd1d[_0xd8e0('0x34')][_0xd8e0('0x3b')](_0xd8e0('0x58'))){_0x16ea76[_0xd8e0('0x24')]=qs[_0xd8e0('0x24')](_0x4cbd1d['query'][_0xd8e0('0x24')]);_0x16ea76['offset']=qs[_0xd8e0('0x22')](_0x4cbd1d[_0xd8e0('0x34')][_0xd8e0('0x22')]);}_0x16ea76['order']=qs[_0xd8e0('0x3d')](_0x4cbd1d[_0xd8e0('0x34')]['sort']);_0x16ea76[_0xd8e0('0x3e')]=qs['filters'](_[_0xd8e0('0x3f')](_0x4cbd1d[_0xd8e0('0x34')],_0x5f2add[_0xd8e0('0x35')]));_0x16ea76[_0xd8e0('0x3e')]['WhatsappQueueId']=_0x14ebc9['id'];if(_0x4cbd1d[_0xd8e0('0x34')]['filter']){_0x16ea76[_0xd8e0('0x3e')]=_[_0xd8e0('0x49')](_0x16ea76[_0xd8e0('0x3e')],{'$or':_[_0xd8e0('0x2f')](_0x16ea76['attributes'],function(_0x326fcb){var _0x1b3c3b={};_0x1b3c3b[_0x326fcb]={'$like':'%'+_0x4cbd1d[_0xd8e0('0x34')]['filter']+'%'};return _0x1b3c3b;})});}_0x16ea76=_[_0xd8e0('0x49')]({},_0x16ea76,_0x4cbd1d[_0xd8e0('0x41')]);return db[_0xd8e0('0x57')][_0xd8e0('0x44')](_0x16ea76);}})['then'](function(_0x2739ac){if(_0x2739ac){return db[_0xd8e0('0x59')][_0xd8e0('0x5a')]({'where':{'id':_[_0xd8e0('0x2f')](_0x2739ac,'UserId'),'role':_0xd8e0('0x5b')},'attributes':['id',_0xd8e0('0x2d'),_0xd8e0('0x5c'),_0xd8e0('0x5d'),_0xd8e0('0x5e')]});}})[_0xd8e0('0x2a')](function(_0x6288bc){if(_0x6288bc){return{'count':_0x6288bc['count'],'rows':_['map'](_0x6288bc['rows'],function(_0x2e9963){return{'membername':_0x2e9963[_0xd8e0('0x2d')],'UserId':_0x2e9963['id'],'queue_name':_0x5d52c6['name'],'WhatsappQueueId':_0x5d52c6['id'],'interface':util[_0xd8e0('0x5f')](_0xd8e0('0x60'),'SIP',_0x2e9963['name']),'penalty':0x0,'paused':_0x2e9963[_0xd8e0('0x5c')],'createdAt':_0x2e9963[_0xd8e0('0x5e')],'updatedAt':_0x2e9963[_0xd8e0('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd8e0('0x2a')](respondWithFilteredResult(_0x1f9beb,_0x16ea76))['catch'](handleError(_0x1f9beb,null));};exports[_0xd8e0('0x61')]=function(_0x7a6c89,_0x508f44,_0x461f14){var _0x52e6e7={};var _0x4170a9={};var _0x170856;var _0x2634c9;return db[_0xd8e0('0x30')][_0xd8e0('0x62')]({'where':{'id':_0x7a6c89['params']['id']}})['then'](handleEntityNotFound(_0x508f44,null))[_0xd8e0('0x2a')](function(_0x2bf4a3){if(_0x2bf4a3){_0x170856=_0x2bf4a3;_0x4170a9['model']=_[_0xd8e0('0x48')](db[_0xd8e0('0x63')][_0xd8e0('0x31')]);_0x4170a9['query']=_[_0xd8e0('0x48')](_0x7a6c89[_0xd8e0('0x34')]);_0x4170a9['filters']=_[_0xd8e0('0x36')](_0x4170a9[_0xd8e0('0x3a')],_0x4170a9[_0xd8e0('0x34')]);_0x52e6e7[_0xd8e0('0x37')]=_[_0xd8e0('0x36')](_0x4170a9[_0xd8e0('0x3a')],qs[_0xd8e0('0x38')](_0x7a6c89[_0xd8e0('0x34')][_0xd8e0('0x38')]));_0x52e6e7[_0xd8e0('0x37')]=_0x52e6e7[_0xd8e0('0x37')][_0xd8e0('0x39')]?_0x52e6e7[_0xd8e0('0x37')]:_0x4170a9[_0xd8e0('0x3a')];_0x52e6e7['order']=qs[_0xd8e0('0x3d')](_0x7a6c89['query'][_0xd8e0('0x3d')]);_0x52e6e7[_0xd8e0('0x3e')]=qs['filters'](_[_0xd8e0('0x3f')](_0x7a6c89[_0xd8e0('0x34')],_0x4170a9[_0xd8e0('0x35')]));if(_0x7a6c89['query'][_0xd8e0('0x40')]){_0x52e6e7[_0xd8e0('0x3e')]=_[_0xd8e0('0x49')](_0x52e6e7[_0xd8e0('0x3e')],{'$or':_['map'](_0x52e6e7['attributes'],function(_0x3c0044){var _0x334f66={};_0x334f66[_0x3c0044]={'$like':'%'+_0x7a6c89[_0xd8e0('0x34')][_0xd8e0('0x40')]+'%'};return _0x334f66;})});}_0x52e6e7=_[_0xd8e0('0x49')]({},_0x52e6e7,_0x7a6c89['options']);return _0x170856['getTeams'](_0x52e6e7);}})[_0xd8e0('0x2a')](function(_0x4231ec){if(_0x4231ec){_0x2634c9=_0x4231ec[_0xd8e0('0x39')];if(!_0x7a6c89['query'][_0xd8e0('0x3b')]('nolimit')){_0x52e6e7['limit']=qs[_0xd8e0('0x24')](_0x7a6c89[_0xd8e0('0x34')][_0xd8e0('0x24')]);_0x52e6e7[_0xd8e0('0x22')]=qs[_0xd8e0('0x22')](_0x7a6c89['query'][_0xd8e0('0x22')]);}return _0x170856[_0xd8e0('0x61')](_0x52e6e7);}})['then'](function(_0x2c7df0){if(_0x2c7df0){return _0x2c7df0?{'count':_0x2634c9,'rows':_0x2c7df0}:null;}})[_0xd8e0('0x2a')](respondWithResult(_0x508f44,null))['catch'](handleError(_0x508f44,null));};exports[_0xd8e0('0x64')]=function(_0x2880e2,_0xa060fd,_0xae47f1){var _0x4443eb=_0x2880e2['body'][_0xd8e0('0x65')];return db[_0xd8e0('0x63')][_0xd8e0('0x44')]({'where':{'id':_0x4443eb},'attributes':['id'],'include':[{'model':db[_0xd8e0('0x59')],'as':'Agents','attributes':['id',_0xd8e0('0x2d'),_0xd8e0('0x66'),'voicePause',_0xd8e0('0x67')],'raw':!![]}]})['then'](function(_0x26584a){if(_0x26584a){var _0x4c6eda=_[_0xd8e0('0x68')](_0x26584a,function(_0x46f6cf){var _0x35dd63=_0x46f6cf['get']({'plain':!![]});return _0x35dd63['Agents'];});return db[_0xd8e0('0x30')][_0xd8e0('0x4a')]({'where':{'id':_0x2880e2[_0xd8e0('0x47')]['id']}})[_0xd8e0('0x2a')](function(_0x4a3eaf){return db[_0xd8e0('0x69')]['transaction'](function(_0x45a0c5){return _0x4a3eaf[_0xd8e0('0x64')](_0x4443eb,{'transaction':_0x45a0c5})['then'](function(){return BPromise[_0xd8e0('0x6a')](_0x4c6eda,function(_0x29fb71){return db[_0xd8e0('0x57')]['findOrCreate']({'where':{'UserId':_0x29fb71['id'],'WhatsappQueueId':_0x2880e2[_0xd8e0('0x47')]['id']},'transaction':_0x45a0c5});});})[_0xd8e0('0x2a')](function(){_0x4c6eda[_0xd8e0('0x6b')](function(_0x203dde){socket['emit'](_0xd8e0('0x6c'),{'UserId':_0x203dde['id'],'WhatsappQueueId':_0x4a3eaf['id']});});});});});}})[_0xd8e0('0x2a')](respondWithStatusCode(_0xa060fd,null))[_0xd8e0('0x46')](handleError(_0xa060fd,null));};exports[_0xd8e0('0x6d')]=function(_0x118a76,_0x56d7cd,_0xe29be1){return db[_0xd8e0('0x63')][_0xd8e0('0x44')]({'where':{'id':_0x118a76['query'][_0xd8e0('0x65')]},'attributes':['id'],'include':[{'model':db[_0xd8e0('0x59')],'as':_0xd8e0('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xd8e0('0x2a')](handleEntityNotFound(_0x56d7cd,null))[_0xd8e0('0x2a')](function(_0x11f27b){var _0x48175c=_[_0xd8e0('0x2f')](_0x11f27b,'id');var _0x3446d3=[];var _0x14f608=[];var _0x4f319=squel['select']();_0x4f319[_0xd8e0('0x6f')]('tq.TeamId')['from'](_0xd8e0('0x70'),'tq')[_0xd8e0('0x71')]('user_has_teams','ut',_0xd8e0('0x72'))['where']('WhatsappQueueId\x20=\x20?',_0x118a76[_0xd8e0('0x47')]['id']);for(var _0x5ce408=0x0;_0x5ce408<_0x11f27b[_0xd8e0('0x39')];_0x5ce408+=0x1){let _0x4291dd=_0x11f27b[_0x5ce408];for(var _0x5c63c5=0x0;_0x5c63c5<_0x4291dd['Agents'][_0xd8e0('0x39')];_0x5c63c5+=0x1){let _0x4b9b24=_0x4291dd[_0xd8e0('0x6e')][_0x5c63c5];var _0x507cf3=_0x4f319[_0xd8e0('0x73')]();_0x507cf3['where']('ut.UserId\x20=\x20?',_0x4b9b24['id']);_0x14f608[_0xd8e0('0x74')](db[_0xd8e0('0x69')][_0xd8e0('0x34')](_0x507cf3[_0xd8e0('0x75')](),{'type':db[_0xd8e0('0x69')][_0xd8e0('0x76')][_0xd8e0('0x77')]})[_0xd8e0('0x2a')](function(_0x4c1b28){if(_0x4c1b28[_0xd8e0('0x39')]===0x1){return _0x4b9b24['id'];}else{var _0x1b818a=_[_0xd8e0('0x78')](_['map'](_0x4c1b28,_0xd8e0('0x79')),function(_0x434ed0){return _[_0xd8e0('0x7a')](_0x48175c,_0x434ed0);});if(_0x1b818a){return _0x4b9b24['id'];}}}));}}return BPromise['all'](_0x14f608)[_0xd8e0('0x2a')](function(_0x35ea30){_0x3446d3=_(_0x3446d3)[_0xd8e0('0x7b')](_0x35ea30)[_0xd8e0('0x7c')]()[_0xd8e0('0x7d')]();return db[_0xd8e0('0x30')]['find']({'where':{'id':_0x118a76[_0xd8e0('0x47')]['id']}})[_0xd8e0('0x2a')](function(_0x4bcfc8){return db[_0xd8e0('0x69')]['transaction'](function(_0x375c20){return _0x4bcfc8['removeTeams'](_0x118a76[_0xd8e0('0x34')][_0xd8e0('0x65')],{'transaction':_0x375c20})['then'](function(){if(!_[_0xd8e0('0x7e')](_0x3446d3)){return _0x4bcfc8[_0xd8e0('0x7f')](_0x3446d3,{'transaction':_0x375c20});}})['then'](function(){_0x3446d3[_0xd8e0('0x6b')](function(_0x3aea3e){socket[_0xd8e0('0x80')]('userWhatsappQueue:remove',{'UserId':_0x3aea3e,'WhatsappQueueId':_0x4bcfc8['id']});});});});});});})[_0xd8e0('0x2a')](respondWithStatusCode(_0x56d7cd,null))[_0xd8e0('0x46')](handleError(_0x56d7cd,null));};exports['addAgents']=function(_0x44f39b,_0xd7373a,_0x354c55){return db['WhatsappQueue'][_0xd8e0('0x4a')]({'where':{'id':_0x44f39b['params']['id']}})[_0xd8e0('0x2a')](handleEntityNotFound(_0xd7373a,null))['then'](function(_0x5279c7){if(_0x5279c7){return _0x5279c7['addAgents'](_0x44f39b['body']['ids'],_['omit'](_0x44f39b[_0xd8e0('0x54')],[_0xd8e0('0x65'),'id'])||{})[_0xd8e0('0x81')](function(_0x4a680b){for(var _0x5beb06=0x0;_0x5beb06<_0x44f39b[_0xd8e0('0x54')][_0xd8e0('0x65')]['length'];_0x5beb06+=0x1){socket[_0xd8e0('0x80')](_0xd8e0('0x6c'),{'UserId':Number(_0x44f39b[_0xd8e0('0x54')][_0xd8e0('0x65')][_0x5beb06]),'WhatsappQueueId':Number(_0x44f39b[_0xd8e0('0x47')]['id'])});}return _0x4a680b;});}})[_0xd8e0('0x2a')](respondWithResult(_0xd7373a,null))[_0xd8e0('0x46')](handleError(_0xd7373a,null));};exports[_0xd8e0('0x7f')]=function(_0x46ef9b,_0x31077d,_0x968aec){return db[_0xd8e0('0x30')]['find']({'where':{'id':_0x46ef9b[_0xd8e0('0x47')]['id']}})[_0xd8e0('0x2a')](handleEntityNotFound(_0x31077d,null))[_0xd8e0('0x2a')](function(_0x1b1c77){if(_0x1b1c77){return _0x1b1c77[_0xd8e0('0x7f')](_0x46ef9b['query'][_0xd8e0('0x65')])[_0xd8e0('0x2a')](function(){if(_['isArray'](_0x46ef9b[_0xd8e0('0x34')][_0xd8e0('0x65')])){for(var _0x5d6d7a=0x0;_0x5d6d7a<_0x46ef9b[_0xd8e0('0x34')][_0xd8e0('0x65')]['length'];_0x5d6d7a+=0x1){socket[_0xd8e0('0x80')](_0xd8e0('0x82'),{'UserId':Number(_0x46ef9b['query'][_0xd8e0('0x65')][_0x5d6d7a]),'WhatsappQueueId':Number(_0x46ef9b[_0xd8e0('0x47')]['id'])});}}else{socket[_0xd8e0('0x80')](_0xd8e0('0x82'),{'UserId':Number(_0x46ef9b['query'][_0xd8e0('0x65')]),'WhatsappQueueId':Number(_0x46ef9b[_0xd8e0('0x47')]['id'])});}});}})[_0xd8e0('0x2a')](respondWithStatusCode(_0x31077d,null))[_0xd8e0('0x46')](handleError(_0x31077d,null));};exports[_0xd8e0('0x83')]=function(_0x14eca0,_0x29037f,_0x4f3f38){var _0x20eec9={};var _0x47acaa={};var _0x5979bf;var _0x23b805;return db['WhatsappQueue'][_0xd8e0('0x62')]({'where':{'id':_0x14eca0[_0xd8e0('0x47')]['id']}})[_0xd8e0('0x2a')](handleEntityNotFound(_0x29037f,null))[_0xd8e0('0x2a')](function(_0x51d179){if(_0x51d179){_0x5979bf=_0x51d179;_0x47acaa['model']=_['keys'](db[_0xd8e0('0x59')][_0xd8e0('0x31')]);_0x47acaa[_0xd8e0('0x34')]=_[_0xd8e0('0x48')](_0x14eca0[_0xd8e0('0x34')]);_0x47acaa['filters']=_[_0xd8e0('0x36')](_0x47acaa[_0xd8e0('0x3a')],_0x47acaa[_0xd8e0('0x34')]);_0x20eec9[_0xd8e0('0x37')]=_[_0xd8e0('0x36')](_0x47acaa['model'],qs[_0xd8e0('0x38')](_0x14eca0[_0xd8e0('0x34')][_0xd8e0('0x38')]));_0x20eec9['attributes']=_0x20eec9[_0xd8e0('0x37')][_0xd8e0('0x39')]?_0x20eec9[_0xd8e0('0x37')]:_0x47acaa[_0xd8e0('0x3a')];_0x20eec9[_0xd8e0('0x3c')]=qs[_0xd8e0('0x3d')](_0x14eca0['query']['sort']);_0x20eec9['where']=qs[_0xd8e0('0x35')](_[_0xd8e0('0x3f')](_0x14eca0[_0xd8e0('0x34')],_0x47acaa['filters']));if(_0x14eca0[_0xd8e0('0x34')][_0xd8e0('0x40')]){_0x20eec9['where']=_['merge'](_0x20eec9[_0xd8e0('0x3e')],{'$or':_[_0xd8e0('0x2f')](_0x20eec9[_0xd8e0('0x37')],function(_0x3a0e31){var _0x3a93d0={};_0x3a93d0[_0x3a0e31]={'$like':'%'+_0x14eca0['query'][_0xd8e0('0x40')]+'%'};return _0x3a93d0;})});}_0x20eec9=_[_0xd8e0('0x49')]({},_0x20eec9,_0x14eca0[_0xd8e0('0x41')]);return _0x5979bf['getAgents'](_0x20eec9);}})[_0xd8e0('0x2a')](function(_0x169442){if(_0x169442){_0x23b805=_0x169442[_0xd8e0('0x39')];if(!_0x14eca0['query'][_0xd8e0('0x3b')]('nolimit')){_0x20eec9[_0xd8e0('0x24')]=qs['limit'](_0x14eca0[_0xd8e0('0x34')][_0xd8e0('0x24')]);_0x20eec9[_0xd8e0('0x22')]=qs['offset'](_0x14eca0[_0xd8e0('0x34')]['offset']);}return _0x5979bf[_0xd8e0('0x83')](_0x20eec9);}})[_0xd8e0('0x2a')](function(_0x408fa1){if(_0x408fa1){return _0x408fa1?{'count':_0x23b805,'rows':_0x408fa1}:null;}})[_0xd8e0('0x2a')](respondWithResult(_0x29037f,null))[_0xd8e0('0x46')](handleError(_0x29037f,null));}; \ No newline at end of file +var _0xba0e=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','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','WhatsappQueueId','map','findAll','User','findAndCountAll','updatedAt','createdAt','%s/%s','SIP','whatsappPause','getTeams','Team','ids','voicePause','interface','flatMap','Agents','transaction','emit','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','push','toString','SELECT','includes','all','union','compact','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./whatsappQueue.socket','register','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xba0e,0xd1));var _0xeba0=function(_0x4c45d9,_0x4be8de){_0x4c45d9=_0x4c45d9-0x0;var _0x40436b=_0xba0e[_0x4c45d9];return _0x40436b;};'use strict';var emlformat=require(_0xeba0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeba0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeba0('0x2'));var moment=require(_0xeba0('0x3'));var BPromise=require(_0xeba0('0x4'));var Mustache=require(_0xeba0('0x5'));var util=require(_0xeba0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xeba0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeba0('0x8'));var squel=require('squel');var crypto=require(_0xeba0('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xeba0('0xa'));var toCsv=require(_0xeba0('0x7'));var querystring=require(_0xeba0('0xb'));var Papa=require(_0xeba0('0xc'));var Redis=require('ioredis');var authService=require(_0xeba0('0xd'));var qs=require(_0xeba0('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeba0('0xf'));var logger=require(_0xeba0('0x10'))(_0xeba0('0x11'));var utils=require(_0xeba0('0x12'));var config=require(_0xeba0('0x13'));var licenseUtil=require(_0xeba0('0x14'));var db=require(_0xeba0('0x15'))['db'];config[_0xeba0('0x16')]=_[_0xeba0('0x17')](config[_0xeba0('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeba0('0x16')]));require(_0xeba0('0x18'))[_0xeba0('0x19')](socket);function respondWithStatusCode(_0x1322c5,_0x346e8f){_0x346e8f=_0x346e8f||0xcc;return function(_0x23efd0){if(_0x23efd0){return _0x1322c5[_0xeba0('0x1a')](_0x346e8f);}return _0x1322c5[_0xeba0('0x1b')](_0x346e8f)[_0xeba0('0x1c')]();};}function respondWithResult(_0x3cebc3,_0x107714){_0x107714=_0x107714||0xc8;return function(_0x1eb685){if(_0x1eb685){return _0x3cebc3[_0xeba0('0x1b')](_0x107714)['json'](_0x1eb685);}};}function respondWithFilteredResult(_0x45ed71,_0x2af16c){return function(_0x3a5a5c){if(_0x3a5a5c){var _0x5b81f5=typeof _0x2af16c['offset']===_0xeba0('0x1d')&&typeof _0x2af16c['limit']==='undefined';var _0x3e6169=_0x3a5a5c[_0xeba0('0x1e')];var _0x19217c=_0x5b81f5?0x0:_0x2af16c[_0xeba0('0x1f')];var _0x2b3e94=_0x5b81f5?_0x3a5a5c[_0xeba0('0x1e')]:_0x2af16c[_0xeba0('0x1f')]+_0x2af16c[_0xeba0('0x20')];var _0x9fdfeb;if(_0x2b3e94>=_0x3e6169){_0x2b3e94=_0x3e6169;_0x9fdfeb=0xc8;}else{_0x9fdfeb=0xce;}_0x45ed71['status'](_0x9fdfeb);return _0x45ed71[_0xeba0('0x21')](_0xeba0('0x22'),_0x19217c+'-'+_0x2b3e94+'/'+_0x3e6169)[_0xeba0('0x23')](_0x3a5a5c);}return null;};}function patchUpdates(_0x1f25e7){return function(_0x50dda0){try{jsonpatch['apply'](_0x50dda0,_0x1f25e7,!![]);}catch(_0x2a209d){return BPromise[_0xeba0('0x24')](_0x2a209d);}return _0x50dda0[_0xeba0('0x25')]();};}function saveUpdates(_0x3efb81,_0x4950d5){return function(_0x26aec4){if(_0x26aec4){return _0x26aec4[_0xeba0('0x26')](_0x3efb81)[_0xeba0('0x27')](function(_0x4a3d77){return _0x4a3d77;});}return null;};}function removeEntity(_0x84ff51,_0x59af79){return function(_0x15e4c7){if(_0x15e4c7){return _0x15e4c7[_0xeba0('0x28')]()[_0xeba0('0x27')](function(){var _0x27b8b5=_0x15e4c7[_0xeba0('0x29')]({'plain':!![]});var _0x1303b4=_0xeba0('0x2a');return db[_0xeba0('0x2b')]['destroy']({'where':{'type':_0x1303b4,'resourceId':_0x27b8b5['id']}})['then'](function(){return _0x15e4c7;});})['then'](function(){_0x84ff51['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4422ad,_0x52325b){return function(_0x24e08d){if(!_0x24e08d){_0x4422ad['sendStatus'](0x194);}return _0x24e08d;};}function handleError(_0x515c54,_0x1ab874){_0x1ab874=_0x1ab874||0x1f4;return function(_0x2842c8){logger[_0xeba0('0x2c')](_0x2842c8[_0xeba0('0x2d')]);if(_0x2842c8[_0xeba0('0x2e')]){delete _0x2842c8['name'];}_0x515c54[_0xeba0('0x1b')](_0x1ab874)[_0xeba0('0x2f')](_0x2842c8);};}exports['index']=function(_0x27758b,_0x559291){var _0x57fa1f={},_0x4b6d76={},_0x14e189={'count':0x0,'rows':[]};var _0x3a724a=_['map'](db[_0xeba0('0x30')][_0xeba0('0x31')],function(_0x172154){return{'name':_0x172154[_0xeba0('0x32')],'type':_0x172154[_0xeba0('0x33')][_0xeba0('0x34')]};});_0x4b6d76[_0xeba0('0x35')]=_['map'](_0x3a724a,_0xeba0('0x2e'));_0x4b6d76['query']=_['keys'](_0x27758b[_0xeba0('0x36')]);_0x4b6d76[_0xeba0('0x37')]=_[_0xeba0('0x38')](_0x4b6d76[_0xeba0('0x35')],_0x4b6d76[_0xeba0('0x36')]);_0x57fa1f[_0xeba0('0x39')]=_['intersection'](_0x4b6d76[_0xeba0('0x35')],qs['fields'](_0x27758b[_0xeba0('0x36')][_0xeba0('0x3a')]));_0x57fa1f[_0xeba0('0x39')]=_0x57fa1f[_0xeba0('0x39')][_0xeba0('0x3b')]?_0x57fa1f[_0xeba0('0x39')]:_0x4b6d76[_0xeba0('0x35')];if(!_0x27758b[_0xeba0('0x36')][_0xeba0('0x3c')](_0xeba0('0x3d'))){_0x57fa1f[_0xeba0('0x20')]=qs['limit'](_0x27758b['query']['limit']);_0x57fa1f[_0xeba0('0x1f')]=qs[_0xeba0('0x1f')](_0x27758b[_0xeba0('0x36')][_0xeba0('0x1f')]);}_0x57fa1f[_0xeba0('0x3e')]=qs[_0xeba0('0x3f')](_0x27758b['query']['sort']);_0x57fa1f[_0xeba0('0x40')]=qs[_0xeba0('0x37')](_[_0xeba0('0x41')](_0x27758b[_0xeba0('0x36')],_0x4b6d76[_0xeba0('0x37')]),_0x3a724a);if(_0x27758b[_0xeba0('0x36')][_0xeba0('0x42')]){_0x57fa1f['where']=_[_0xeba0('0x43')](_0x57fa1f[_0xeba0('0x40')],{'$or':_['map'](_0x3a724a,function(_0x43fca5){if(_0x43fca5['type']!==_0xeba0('0x44')){var _0x546e38={};_0x546e38[_0x43fca5[_0xeba0('0x2e')]]={'$like':'%'+_0x27758b['query'][_0xeba0('0x42')]+'%'};return _0x546e38;}})});}_0x57fa1f=_[_0xeba0('0x43')]({},_0x57fa1f,_0x27758b[_0xeba0('0x45')]);var _0x49c3cd={'where':_0x57fa1f[_0xeba0('0x40')]};return db[_0xeba0('0x30')][_0xeba0('0x1e')](_0x49c3cd)[_0xeba0('0x27')](function(_0x3c4172){_0x14e189['count']=_0x3c4172;if(_0x27758b[_0xeba0('0x36')][_0xeba0('0x46')]){_0x57fa1f[_0xeba0('0x47')]=[{'all':!![]}];}return db[_0xeba0('0x30')]['findAll'](_0x57fa1f);})['then'](function(_0x58d2cd){_0x14e189[_0xeba0('0x48')]=_0x58d2cd;return _0x14e189;})['then'](respondWithFilteredResult(_0x559291,_0x57fa1f))[_0xeba0('0x49')](handleError(_0x559291,null));};exports[_0xeba0('0x4a')]=function(_0x1fcba4,_0x3da83e){var _0x544504={'raw':!![],'where':{'id':_0x1fcba4[_0xeba0('0x4b')]['id']}},_0x1afde9={};_0x1afde9[_0xeba0('0x35')]=_[_0xeba0('0x4c')](db[_0xeba0('0x30')][_0xeba0('0x31')]);_0x1afde9[_0xeba0('0x36')]=_[_0xeba0('0x4c')](_0x1fcba4[_0xeba0('0x36')]);_0x1afde9[_0xeba0('0x37')]=_[_0xeba0('0x38')](_0x1afde9[_0xeba0('0x35')],_0x1afde9[_0xeba0('0x36')]);_0x544504['attributes']=_[_0xeba0('0x38')](_0x1afde9[_0xeba0('0x35')],qs[_0xeba0('0x3a')](_0x1fcba4['query'][_0xeba0('0x3a')]));_0x544504[_0xeba0('0x39')]=_0x544504[_0xeba0('0x39')][_0xeba0('0x3b')]?_0x544504[_0xeba0('0x39')]:_0x1afde9[_0xeba0('0x35')];if(_0x1fcba4['query'][_0xeba0('0x46')]){_0x544504[_0xeba0('0x47')]=[{'all':!![]}];}_0x544504=_[_0xeba0('0x43')]({},_0x544504,_0x1fcba4[_0xeba0('0x45')]);return db[_0xeba0('0x30')][_0xeba0('0x4d')](_0x544504)[_0xeba0('0x27')](handleEntityNotFound(_0x3da83e,null))[_0xeba0('0x27')](respondWithResult(_0x3da83e,null))[_0xeba0('0x49')](handleError(_0x3da83e,null));};exports[_0xeba0('0x4e')]=function(_0x128937,_0x6a1253){return db[_0xeba0('0x30')][_0xeba0('0x4e')](_0x128937[_0xeba0('0x4f')],{})[_0xeba0('0x27')](function(_0xf42a8f){var _0x5dbca7=_0x128937[_0xeba0('0x50')][_0xeba0('0x29')]({'plain':!![]});if(!_0x5dbca7)throw new Error(_0xeba0('0x51'));if(_0x5dbca7[_0xeba0('0x52')]===_0xeba0('0x50')){var _0x1f981d=_0xf42a8f[_0xeba0('0x29')]({'plain':!![]});var _0x4d8d64=_0xeba0('0x2a');return db[_0xeba0('0x53')][_0xeba0('0x4d')]({'where':{'name':_0x4d8d64,'userProfileId':_0x5dbca7[_0xeba0('0x54')]},'raw':!![]})[_0xeba0('0x27')](function(_0x41f0ad){if(_0x41f0ad&&_0x41f0ad[_0xeba0('0x55')]===0x0){return db[_0xeba0('0x2b')]['create']({'name':_0x1f981d[_0xeba0('0x2e')],'resourceId':_0x1f981d['id'],'type':_0x41f0ad[_0xeba0('0x2e')],'sectionId':_0x41f0ad['id']},{})[_0xeba0('0x27')](function(){return _0xf42a8f;});}else{return _0xf42a8f;}})['catch'](function(_0x53062e){logger[_0xeba0('0x2c')](_0xeba0('0x56'),_0x53062e);throw _0x53062e;});}return _0xf42a8f;})[_0xeba0('0x27')](respondWithResult(_0x6a1253,0xc9))['catch'](handleError(_0x6a1253,null));};exports[_0xeba0('0x26')]=function(_0x311ba1,_0x5a7b1a){if(_0x311ba1[_0xeba0('0x4f')]['id']){delete _0x311ba1[_0xeba0('0x4f')]['id'];}return db[_0xeba0('0x30')]['find']({'where':{'id':_0x311ba1['params']['id']}})[_0xeba0('0x27')](handleEntityNotFound(_0x5a7b1a,null))[_0xeba0('0x27')](saveUpdates(_0x311ba1[_0xeba0('0x4f')],null))[_0xeba0('0x27')](respondWithResult(_0x5a7b1a,null))['catch'](handleError(_0x5a7b1a,null));};exports[_0xeba0('0x28')]=function(_0xb9acdb,_0x14cd44){return db[_0xeba0('0x30')][_0xeba0('0x4d')]({'where':{'id':_0xb9acdb['params']['id']}})[_0xeba0('0x27')](handleEntityNotFound(_0x14cd44,null))[_0xeba0('0x27')](removeEntity(_0x14cd44,null))[_0xeba0('0x49')](handleError(_0x14cd44,null));};exports[_0xeba0('0x57')]=function(_0x34e1ff,_0x3bff86){return db['WhatsappQueue'][_0xeba0('0x57')]()[_0xeba0('0x27')](respondWithResult(_0x3bff86,null))[_0xeba0('0x49')](handleError(_0x3bff86,null));};exports[_0xeba0('0x58')]=function(_0x50b87e,_0x2f55b0,_0x1245c1){var _0x26cce7={'raw':!![],'where':{}},_0x223e90={},_0x29ab80;return db[_0xeba0('0x30')][_0xeba0('0x59')]({'where':{'id':_0x50b87e['params']['id']}})[_0xeba0('0x27')](handleEntityNotFound(_0x2f55b0,null))[_0xeba0('0x27')](function(_0x48962e){if(_0x48962e){_0x29ab80=_0x48962e[_0xeba0('0x29')]({'plain':!![]});_0x223e90[_0xeba0('0x35')]=_[_0xeba0('0x4c')](db[_0xeba0('0x5a')][_0xeba0('0x31')]);_0x223e90[_0xeba0('0x36')]=_[_0xeba0('0x4c')](_0x50b87e[_0xeba0('0x36')]);_0x223e90[_0xeba0('0x37')]=_[_0xeba0('0x38')](_0x223e90[_0xeba0('0x35')],_0x223e90['query']);_0x26cce7[_0xeba0('0x39')]=_[_0xeba0('0x38')](_0x223e90[_0xeba0('0x35')],qs[_0xeba0('0x3a')](_0x50b87e[_0xeba0('0x36')][_0xeba0('0x3a')]));_0x26cce7['attributes']=_0x26cce7[_0xeba0('0x39')]['length']?_0x26cce7['attributes']:_0x223e90[_0xeba0('0x35')];if(!_0x50b87e[_0xeba0('0x36')]['hasOwnProperty'](_0xeba0('0x3d'))){_0x26cce7['limit']=qs[_0xeba0('0x20')](_0x50b87e[_0xeba0('0x36')][_0xeba0('0x20')]);_0x26cce7[_0xeba0('0x1f')]=qs[_0xeba0('0x1f')](_0x50b87e['query'][_0xeba0('0x1f')]);}_0x26cce7['order']=qs[_0xeba0('0x3f')](_0x50b87e[_0xeba0('0x36')]['sort']);_0x26cce7['where']=qs[_0xeba0('0x37')](_[_0xeba0('0x41')](_0x50b87e[_0xeba0('0x36')],_0x223e90['filters']));_0x26cce7[_0xeba0('0x40')][_0xeba0('0x5b')]=_0x48962e['id'];if(_0x50b87e['query'][_0xeba0('0x42')]){_0x26cce7[_0xeba0('0x40')]=_[_0xeba0('0x43')](_0x26cce7[_0xeba0('0x40')],{'$or':_[_0xeba0('0x5c')](_0x26cce7[_0xeba0('0x39')],function(_0x40aa18){var _0x46ddcb={};_0x46ddcb[_0x40aa18]={'$like':'%'+_0x50b87e[_0xeba0('0x36')][_0xeba0('0x42')]+'%'};return _0x46ddcb;})});}_0x26cce7=_['merge']({},_0x26cce7,_0x50b87e[_0xeba0('0x45')]);return db[_0xeba0('0x5a')][_0xeba0('0x5d')](_0x26cce7);}})[_0xeba0('0x27')](function(_0x1e224c){if(_0x1e224c){return db[_0xeba0('0x5e')][_0xeba0('0x5f')]({'where':{'id':_[_0xeba0('0x5c')](_0x1e224c,'UserId'),'role':'agent'},'attributes':['id',_0xeba0('0x2e'),'whatsappPause',_0xeba0('0x60'),_0xeba0('0x61')]});}})[_0xeba0('0x27')](function(_0x28010d){if(_0x28010d){return{'count':_0x28010d[_0xeba0('0x1e')],'rows':_[_0xeba0('0x5c')](_0x28010d[_0xeba0('0x48')],function(_0x570803){return{'membername':_0x570803[_0xeba0('0x2e')],'UserId':_0x570803['id'],'queue_name':_0x29ab80[_0xeba0('0x2e')],'WhatsappQueueId':_0x29ab80['id'],'interface':util['format'](_0xeba0('0x62'),_0xeba0('0x63'),_0x570803[_0xeba0('0x2e')]),'penalty':0x0,'paused':_0x570803[_0xeba0('0x64')],'createdAt':_0x570803[_0xeba0('0x61')],'updatedAt':_0x570803['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xeba0('0x27')](respondWithFilteredResult(_0x2f55b0,_0x26cce7))['catch'](handleError(_0x2f55b0,null));};exports[_0xeba0('0x65')]=function(_0x4f817b,_0x366360,_0x260156){var _0x3d7fec={};var _0x297a6c={};var _0x17893f;var _0x5e78c3;return db[_0xeba0('0x30')][_0xeba0('0x59')]({'where':{'id':_0x4f817b['params']['id']}})[_0xeba0('0x27')](handleEntityNotFound(_0x366360,null))[_0xeba0('0x27')](function(_0x4dd16f){if(_0x4dd16f){_0x17893f=_0x4dd16f;_0x297a6c[_0xeba0('0x35')]=_[_0xeba0('0x4c')](db[_0xeba0('0x66')][_0xeba0('0x31')]);_0x297a6c['query']=_[_0xeba0('0x4c')](_0x4f817b[_0xeba0('0x36')]);_0x297a6c[_0xeba0('0x37')]=_[_0xeba0('0x38')](_0x297a6c[_0xeba0('0x35')],_0x297a6c[_0xeba0('0x36')]);_0x3d7fec['attributes']=_[_0xeba0('0x38')](_0x297a6c[_0xeba0('0x35')],qs[_0xeba0('0x3a')](_0x4f817b[_0xeba0('0x36')]['fields']));_0x3d7fec[_0xeba0('0x39')]=_0x3d7fec[_0xeba0('0x39')]['length']?_0x3d7fec[_0xeba0('0x39')]:_0x297a6c[_0xeba0('0x35')];_0x3d7fec[_0xeba0('0x3e')]=qs['sort'](_0x4f817b[_0xeba0('0x36')][_0xeba0('0x3f')]);_0x3d7fec[_0xeba0('0x40')]=qs['filters'](_['pick'](_0x4f817b['query'],_0x297a6c[_0xeba0('0x37')]));if(_0x4f817b[_0xeba0('0x36')][_0xeba0('0x42')]){_0x3d7fec[_0xeba0('0x40')]=_[_0xeba0('0x43')](_0x3d7fec['where'],{'$or':_[_0xeba0('0x5c')](_0x3d7fec[_0xeba0('0x39')],function(_0x353682){var _0xf4975d={};_0xf4975d[_0x353682]={'$like':'%'+_0x4f817b[_0xeba0('0x36')]['filter']+'%'};return _0xf4975d;})});}_0x3d7fec=_[_0xeba0('0x43')]({},_0x3d7fec,_0x4f817b[_0xeba0('0x45')]);return _0x17893f['getTeams'](_0x3d7fec);}})[_0xeba0('0x27')](function(_0x3e58ad){if(_0x3e58ad){_0x5e78c3=_0x3e58ad[_0xeba0('0x3b')];if(!_0x4f817b[_0xeba0('0x36')]['hasOwnProperty'](_0xeba0('0x3d'))){_0x3d7fec[_0xeba0('0x20')]=qs[_0xeba0('0x20')](_0x4f817b[_0xeba0('0x36')][_0xeba0('0x20')]);_0x3d7fec['offset']=qs[_0xeba0('0x1f')](_0x4f817b[_0xeba0('0x36')]['offset']);}return _0x17893f[_0xeba0('0x65')](_0x3d7fec);}})[_0xeba0('0x27')](function(_0x310450){if(_0x310450){return _0x310450?{'count':_0x5e78c3,'rows':_0x310450}:null;}})['then'](respondWithResult(_0x366360,null))[_0xeba0('0x49')](handleError(_0x366360,null));};exports['addTeams']=function(_0x33d8ea,_0x1dd61e,_0x3b7338){var _0x750a63=_0x33d8ea[_0xeba0('0x4f')][_0xeba0('0x67')];return db['Team'][_0xeba0('0x5d')]({'where':{'id':_0x750a63},'attributes':['id'],'include':[{'model':db[_0xeba0('0x5e')],'as':'Agents','attributes':['id',_0xeba0('0x2e'),'online',_0xeba0('0x68'),_0xeba0('0x69')],'raw':!![]}]})[_0xeba0('0x27')](function(_0x63c892){if(_0x63c892){var _0x2e8ef2=_[_0xeba0('0x6a')](_0x63c892,function(_0xca04b3){var _0x35b7d8=_0xca04b3[_0xeba0('0x29')]({'plain':!![]});return _0x35b7d8[_0xeba0('0x6b')];});return db['WhatsappQueue'][_0xeba0('0x4d')]({'where':{'id':_0x33d8ea['params']['id']}})['then'](function(_0x908f43){return db['sequelize'][_0xeba0('0x6c')](function(_0x393a00){return _0x908f43['addTeams'](_0x750a63,{'transaction':_0x393a00})[_0xeba0('0x27')](function(){return BPromise['each'](_0x2e8ef2,function(_0x100baf){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x100baf['id'],'WhatsappQueueId':_0x33d8ea[_0xeba0('0x4b')]['id']},'transaction':_0x393a00});});})[_0xeba0('0x27')](function(){_0x2e8ef2['forEach'](function(_0x2ee0c3){socket[_0xeba0('0x6d')]('userWhatsappQueue:save',{'UserId':_0x2ee0c3['id'],'WhatsappQueueId':_0x908f43['id']});});});});});}})['then'](respondWithStatusCode(_0x1dd61e,null))[_0xeba0('0x49')](handleError(_0x1dd61e,null));};exports[_0xeba0('0x6e')]=function(_0x3636b9,_0x2a1b87,_0x3665cf){return db['Team'][_0xeba0('0x5d')]({'where':{'id':_0x3636b9['query'][_0xeba0('0x67')]},'attributes':['id'],'include':[{'model':db[_0xeba0('0x5e')],'as':_0xeba0('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xeba0('0x27')](handleEntityNotFound(_0x2a1b87,null))[_0xeba0('0x27')](function(_0x56b8ea){var _0x2acf12=_[_0xeba0('0x5c')](_0x56b8ea,'id');var _0xb1129a=[];var _0x25175e=[];var _0x4e9fed=squel[_0xeba0('0x6f')]();_0x4e9fed[_0xeba0('0x70')](_0xeba0('0x71'))[_0xeba0('0x72')](_0xeba0('0x73'),'tq')['join']('user_has_teams','ut',_0xeba0('0x74'))[_0xeba0('0x40')](_0xeba0('0x75'),_0x3636b9[_0xeba0('0x4b')]['id']);for(var _0x56ecf2=0x0;_0x56ecf2<_0x56b8ea[_0xeba0('0x3b')];_0x56ecf2+=0x1){let _0x1c74b1=_0x56b8ea[_0x56ecf2];for(var _0x2a8e2e=0x0;_0x2a8e2e<_0x1c74b1[_0xeba0('0x6b')][_0xeba0('0x3b')];_0x2a8e2e+=0x1){let _0x159fce=_0x1c74b1[_0xeba0('0x6b')][_0x2a8e2e];var _0x163a95=_0x4e9fed['clone']();_0x163a95[_0xeba0('0x40')]('ut.UserId\x20=\x20?',_0x159fce['id']);_0x25175e[_0xeba0('0x76')](db['sequelize'][_0xeba0('0x36')](_0x163a95[_0xeba0('0x77')](),{'type':db['sequelize']['QueryTypes'][_0xeba0('0x78')]})['then'](function(_0x49efd6){if(_0x49efd6['length']===0x1){return _0x159fce['id'];}else{var _0xf01df0=_['every'](_['map'](_0x49efd6,'TeamId'),function(_0x235f67){return _[_0xeba0('0x79')](_0x2acf12,_0x235f67);});if(_0xf01df0){return _0x159fce['id'];}}}));}}return BPromise[_0xeba0('0x7a')](_0x25175e)[_0xeba0('0x27')](function(_0x3efbb2){_0xb1129a=_(_0xb1129a)[_0xeba0('0x7b')](_0x3efbb2)[_0xeba0('0x7c')]()['value']();return db[_0xeba0('0x30')][_0xeba0('0x4d')]({'where':{'id':_0x3636b9[_0xeba0('0x4b')]['id']}})[_0xeba0('0x27')](function(_0x53ce02){return db['sequelize']['transaction'](function(_0x4e6be7){return _0x53ce02['removeTeams'](_0x3636b9[_0xeba0('0x36')]['ids'],{'transaction':_0x4e6be7})[_0xeba0('0x27')](function(){if(!_[_0xeba0('0x7d')](_0xb1129a)){return _0x53ce02[_0xeba0('0x7e')](_0xb1129a,{'transaction':_0x4e6be7});}})[_0xeba0('0x27')](function(){_0xb1129a[_0xeba0('0x7f')](function(_0x476674){socket[_0xeba0('0x6d')](_0xeba0('0x80'),{'UserId':_0x476674,'WhatsappQueueId':_0x53ce02['id']});});});});});});})['then'](respondWithStatusCode(_0x2a1b87,null))[_0xeba0('0x49')](handleError(_0x2a1b87,null));};exports['addAgents']=function(_0x152e0e,_0x5eb8b4,_0x4fe5e0){return db['WhatsappQueue'][_0xeba0('0x4d')]({'where':{'id':_0x152e0e[_0xeba0('0x4b')]['id']}})[_0xeba0('0x27')](handleEntityNotFound(_0x5eb8b4,null))[_0xeba0('0x27')](function(_0x10e2e3){if(_0x10e2e3){return _0x10e2e3[_0xeba0('0x81')](_0x152e0e[_0xeba0('0x4f')]['ids'],_['omit'](_0x152e0e[_0xeba0('0x4f')],['ids','id'])||{})[_0xeba0('0x82')](function(_0x358b65){for(var _0x1ce689=0x0;_0x1ce689<_0x152e0e[_0xeba0('0x4f')][_0xeba0('0x67')][_0xeba0('0x3b')];_0x1ce689+=0x1){socket[_0xeba0('0x6d')]('userWhatsappQueue:save',{'UserId':Number(_0x152e0e['body']['ids'][_0x1ce689]),'WhatsappQueueId':Number(_0x152e0e['params']['id'])});}return _0x358b65;});}})[_0xeba0('0x27')](respondWithResult(_0x5eb8b4,null))[_0xeba0('0x49')](handleError(_0x5eb8b4,null));};exports[_0xeba0('0x7e')]=function(_0x372577,_0x320918,_0x3dc4e6){return db['WhatsappQueue'][_0xeba0('0x4d')]({'where':{'id':_0x372577[_0xeba0('0x4b')]['id']}})[_0xeba0('0x27')](handleEntityNotFound(_0x320918,null))['then'](function(_0x43ad65){if(_0x43ad65){return _0x43ad65['removeAgents'](_0x372577[_0xeba0('0x36')]['ids'])['then'](function(){if(_[_0xeba0('0x83')](_0x372577[_0xeba0('0x36')][_0xeba0('0x67')])){for(var _0x4f16a1=0x0;_0x4f16a1<_0x372577[_0xeba0('0x36')]['ids'][_0xeba0('0x3b')];_0x4f16a1+=0x1){socket[_0xeba0('0x6d')](_0xeba0('0x80'),{'UserId':Number(_0x372577['query'][_0xeba0('0x67')][_0x4f16a1]),'WhatsappQueueId':Number(_0x372577[_0xeba0('0x4b')]['id'])});}}else{socket['emit'](_0xeba0('0x80'),{'UserId':Number(_0x372577[_0xeba0('0x36')][_0xeba0('0x67')]),'WhatsappQueueId':Number(_0x372577[_0xeba0('0x4b')]['id'])});}});}})[_0xeba0('0x27')](respondWithStatusCode(_0x320918,null))[_0xeba0('0x49')](handleError(_0x320918,null));};exports[_0xeba0('0x84')]=function(_0x4dcec7,_0x15652e,_0x4a6c7f){var _0x449246={};var _0x2e8625={};var _0x32f32b;var _0x68f7b3;return db[_0xeba0('0x30')][_0xeba0('0x59')]({'where':{'id':_0x4dcec7['params']['id']}})[_0xeba0('0x27')](handleEntityNotFound(_0x15652e,null))[_0xeba0('0x27')](function(_0x34aa0d){if(_0x34aa0d){_0x32f32b=_0x34aa0d;_0x2e8625[_0xeba0('0x35')]=_['keys'](db[_0xeba0('0x5e')][_0xeba0('0x31')]);_0x2e8625['query']=_['keys'](_0x4dcec7[_0xeba0('0x36')]);_0x2e8625[_0xeba0('0x37')]=_[_0xeba0('0x38')](_0x2e8625[_0xeba0('0x35')],_0x2e8625[_0xeba0('0x36')]);_0x449246['attributes']=_['intersection'](_0x2e8625['model'],qs[_0xeba0('0x3a')](_0x4dcec7[_0xeba0('0x36')]['fields']));_0x449246[_0xeba0('0x39')]=_0x449246[_0xeba0('0x39')][_0xeba0('0x3b')]?_0x449246[_0xeba0('0x39')]:_0x2e8625[_0xeba0('0x35')];_0x449246[_0xeba0('0x3e')]=qs[_0xeba0('0x3f')](_0x4dcec7[_0xeba0('0x36')][_0xeba0('0x3f')]);_0x449246[_0xeba0('0x40')]=qs[_0xeba0('0x37')](_[_0xeba0('0x41')](_0x4dcec7['query'],_0x2e8625['filters']));if(_0x4dcec7[_0xeba0('0x36')][_0xeba0('0x42')]){_0x449246[_0xeba0('0x40')]=_['merge'](_0x449246['where'],{'$or':_[_0xeba0('0x5c')](_0x449246['attributes'],function(_0x1583bb){var _0x141b36={};_0x141b36[_0x1583bb]={'$like':'%'+_0x4dcec7[_0xeba0('0x36')][_0xeba0('0x42')]+'%'};return _0x141b36;})});}_0x449246=_[_0xeba0('0x43')]({},_0x449246,_0x4dcec7[_0xeba0('0x45')]);return _0x32f32b['getAgents'](_0x449246);}})[_0xeba0('0x27')](function(_0x226257){if(_0x226257){_0x68f7b3=_0x226257['length'];if(!_0x4dcec7[_0xeba0('0x36')][_0xeba0('0x3c')](_0xeba0('0x3d'))){_0x449246[_0xeba0('0x20')]=qs['limit'](_0x4dcec7[_0xeba0('0x36')][_0xeba0('0x20')]);_0x449246[_0xeba0('0x1f')]=qs['offset'](_0x4dcec7[_0xeba0('0x36')][_0xeba0('0x1f')]);}return _0x32f32b[_0xeba0('0x84')](_0x449246);}})[_0xeba0('0x27')](function(_0xb11ee7){if(_0xb11ee7){return _0xb11ee7?{'count':_0x68f7b3,'rows':_0xb11ee7}:null;}})['then'](respondWithResult(_0x15652e,null))['catch'](handleError(_0x15652e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 0083002..2365469 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 _0x1f31=['events','WhatsappQueue','save','emit','hasOwnProperty','hook','exports'];(function(_0x4c080b,_0x103c6f){var _0x5331be=function(_0x3a2b42){while(--_0x3a2b42){_0x4c080b['push'](_0x4c080b['shift']());}};_0x5331be(++_0x103c6f);}(_0x1f31,0x93));var _0x11f3=function(_0x275caa,_0x166d5e){_0x275caa=_0x275caa-0x0;var _0x28d670=_0x1f31[_0x275caa];return _0x28d670;};'use strict';var EventEmitter=require(_0x11f3('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x11f3('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x11f3('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x15d57d){return function(_0x3f4670,_0x5547d4,_0x10c66a){WhatsappQueueEvents[_0x11f3('0x3')](_0x15d57d+':'+_0x3f4670['id'],_0x3f4670);WhatsappQueueEvents['emit'](_0x15d57d,_0x3f4670);_0x10c66a(null);};}for(var e in events){if(events[_0x11f3('0x4')](e)){var event=events[e];WhatsappQueue[_0x11f3('0x5')](e,emitEvent(event));}}module[_0x11f3('0x6')]=WhatsappQueueEvents; \ No newline at end of file +var _0x5501=['WhatsappQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0xe68104,_0xe57d82){var _0x217a0f=function(_0x1e04b0){while(--_0x1e04b0){_0xe68104['push'](_0xe68104['shift']());}};_0x217a0f(++_0xe57d82);}(_0x5501,0x10d));var _0x1550=function(_0x3ccd2d,_0x53ef04){_0x3ccd2d=_0x3ccd2d-0x0;var _0x3f70a9=_0x5501[_0x3ccd2d];return _0x3f70a9;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x1550('0x0'))['db'][_0x1550('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1550('0x2')](0x0);var events={'afterCreate':_0x1550('0x3'),'afterUpdate':'update','afterDestroy':_0x1550('0x4')};function emitEvent(_0x555815){return function(_0xf37997,_0x585a56,_0x46b618){WhatsappQueueEvents[_0x1550('0x5')](_0x555815+':'+_0xf37997['id'],_0xf37997);WhatsappQueueEvents['emit'](_0x555815,_0xf37997);_0x46b618(null);};}for(var e in events){if(events[_0x1550('0x6')](e)){var event=events[e];WhatsappQueue[_0x1550('0x7')](e,emitEvent(event));}}module[_0x1550('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index b126b47..447e5c0 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 _0xb719=['whatsapp_queues','lodash','../../config/logger','moment','request-promise','path','rimraf','./whatsappQueue.attributes','exports','define'];(function(_0x65b5e0,_0x1445ff){var _0x47d459=function(_0x4218eb){while(--_0x4218eb){_0x65b5e0['push'](_0x65b5e0['shift']());}};_0x47d459(++_0x1445ff);}(_0xb719,0x1af));var _0x9b71=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xb719[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x9b71('0x0'));var util=require('util');var logger=require(_0x9b71('0x1'))('api');var moment=require(_0x9b71('0x2'));var BPromise=require('bluebird');var rp=require(_0x9b71('0x3'));var fs=require('fs');var path=require(_0x9b71('0x4'));var rimraf=require(_0x9b71('0x5'));var config=require('../../config/environment');var attributes=require(_0x9b71('0x6'));module[_0x9b71('0x7')]=function(_0x327fb7,_0x54f9f4){return _0x327fb7[_0x9b71('0x8')]('WhatsappQueue',attributes,{'tableName':_0x9b71('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x791d=['lodash','util','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues'];(function(_0x3ba537,_0x56b969){var _0x585c1a=function(_0x1dd30b){while(--_0x1dd30b){_0x3ba537['push'](_0x3ba537['shift']());}};_0x585c1a(++_0x56b969);}(_0x791d,0x6e));var _0xd791=function(_0x421ec4,_0x3cae81){_0x421ec4=_0x421ec4-0x0;var _0x3cab77=_0x791d[_0x421ec4];return _0x3cab77;};'use strict';var _=require(_0xd791('0x0'));var util=require(_0xd791('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd791('0x2'));var BPromise=require(_0xd791('0x3'));var rp=require(_0xd791('0x4'));var fs=require('fs');var path=require(_0xd791('0x5'));var rimraf=require('rimraf');var config=require(_0xd791('0x6'));var attributes=require(_0xd791('0x7'));module['exports']=function(_0x506ef2,_0x77b85c){return _0x506ef2[_0xd791('0x8')](_0xd791('0x9'),attributes,{'tableName':_0xd791('0xa'),'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 1e245fc..5123653 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 _0x1649=['error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','include','model','map','then','ShowWhatsappQueue','find','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0x1649,0x6b));var _0x9164=function(_0x2eef23,_0x111fc1){_0x2eef23=_0x2eef23-0x0;var _0x20e6db=_0x1649[_0x2eef23];return _0x20e6db;};'use strict';var _=require(_0x9164('0x0'));var util=require(_0x9164('0x1'));var moment=require(_0x9164('0x2'));var BPromise=require(_0x9164('0x3'));var rs=require(_0x9164('0x4'));var fs=require('fs');var Redis=require(_0x9164('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9164('0x6'));var logger=require(_0x9164('0x7'))(_0x9164('0x8'));var config=require(_0x9164('0x9'));var jayson=require(_0x9164('0xa'));var client=jayson[_0x9164('0xb')][_0x9164('0xc')]({'port':0x232a});config[_0x9164('0xd')]=_[_0x9164('0xe')](config[_0x9164('0xd')],{'host':_0x9164('0xf'),'port':0x18eb});var socket=require(_0x9164('0x10'))(new Redis(config[_0x9164('0xd')]));require(_0x9164('0x11'))[_0x9164('0x12')](socket);function respondWithRpcPromise(_0x481414,_0x44202d,_0x53817e){return new BPromise(function(_0x15c3e6,_0x216aaa){return client[_0x9164('0x13')](_0x481414,_0x53817e)['then'](function(_0x1fa704){logger['info'](_0x9164('0x14'),_0x44202d,'request\x20sent');logger[_0x9164('0x15')](_0x9164('0x16'),_0x44202d,_0x9164('0x17'),JSON[_0x9164('0x18')](_0x1fa704));if(_0x1fa704['error']){if(_0x1fa704[_0x9164('0x19')][_0x9164('0x1a')]===0x1f4){logger['error'](_0x9164('0x14'),_0x44202d,_0x1fa704[_0x9164('0x19')][_0x9164('0x1b')]);return _0x216aaa(_0x1fa704[_0x9164('0x19')][_0x9164('0x1b')]);}logger['error'](_0x9164('0x14'),_0x44202d,_0x1fa704[_0x9164('0x19')]['message']);return _0x15c3e6(_0x1fa704[_0x9164('0x19')]['message']);}else{logger['info'](_0x9164('0x14'),_0x44202d,_0x9164('0x17'));_0x15c3e6(_0x1fa704[_0x9164('0x1c')][_0x9164('0x1b')]);}})[_0x9164('0x1d')](function(_0x4f55bd){logger[_0x9164('0x19')](_0x9164('0x14'),_0x44202d,_0x4f55bd);_0x216aaa(_0x4f55bd);});});}exports[_0x9164('0x1e')]=function(_0x50dd6e){var _0x26430d=this;return new Promise(function(_0x4a2de7,_0x5804ef){return db[_0x9164('0x1f')]['findAll']({'raw':_0x50dd6e[_0x9164('0x20')]?_0x50dd6e[_0x9164('0x20')][_0x9164('0x21')]===undefined?!![]:![]:!![],'where':_0x50dd6e[_0x9164('0x20')]?_0x50dd6e[_0x9164('0x20')][_0x9164('0x22')]||null:null,'attributes':_0x50dd6e[_0x9164('0x20')]?_0x50dd6e[_0x9164('0x20')][_0x9164('0x23')]||null:null,'limit':_0x50dd6e[_0x9164('0x20')]?_0x50dd6e[_0x9164('0x20')][_0x9164('0x24')]||null:null,'include':_0x50dd6e[_0x9164('0x20')]?_0x50dd6e[_0x9164('0x20')]['include']?_['map'](_0x50dd6e['options'][_0x9164('0x25')],function(_0x5d340e){return{'model':db[_0x5d340e[_0x9164('0x26')]],'as':_0x5d340e['as'],'attributes':_0x5d340e[_0x9164('0x23')],'include':_0x5d340e[_0x9164('0x25')]?_[_0x9164('0x27')](_0x5d340e[_0x9164('0x25')],function(_0x5ea723){return{'model':db[_0x5ea723[_0x9164('0x26')]],'as':_0x5ea723['as'],'attributes':_0x5ea723['attributes'],'include':_0x5ea723[_0x9164('0x25')]?_[_0x9164('0x27')](_0x5ea723['include'],function(_0x3afa9a){return{'model':db[_0x3afa9a[_0x9164('0x26')]],'as':_0x3afa9a['as'],'attributes':_0x3afa9a['attributes']};}):[]};}):[]};}):[]:[]})[_0x9164('0x28')](function(_0x9fe0d7){logger['info'](_0x9164('0x1e'),_0x50dd6e);logger[_0x9164('0x15')](_0x9164('0x1e'),_0x50dd6e,JSON[_0x9164('0x18')](_0x9fe0d7));_0x4a2de7(_0x9fe0d7);})['catch'](function(_0x15a86c){logger[_0x9164('0x19')](_0x9164('0x1e'),_0x15a86c[_0x9164('0x1b')],_0x50dd6e);_0x5804ef(_0x26430d[_0x9164('0x19')](0x1f4,_0x15a86c[_0x9164('0x1b')]));});});};exports[_0x9164('0x29')]=function(_0x359fe4){var _0x4ba39a=this;return new Promise(function(_0x3edfd0,_0x142b16){return db['WhatsappQueue'][_0x9164('0x2a')]({'raw':_0x359fe4[_0x9164('0x20')]?_0x359fe4['options'][_0x9164('0x21')]===undefined?!![]:![]:!![],'where':_0x359fe4[_0x9164('0x20')]?_0x359fe4[_0x9164('0x20')][_0x9164('0x22')]||null:null,'attributes':_0x359fe4['options']?_0x359fe4[_0x9164('0x20')][_0x9164('0x23')]||null:null,'include':_0x359fe4[_0x9164('0x20')]?_0x359fe4[_0x9164('0x20')][_0x9164('0x25')]?_[_0x9164('0x27')](_0x359fe4[_0x9164('0x20')][_0x9164('0x25')],function(_0x5ae5c4){return{'model':db[_0x5ae5c4['model']],'as':_0x5ae5c4['as'],'attributes':_0x5ae5c4['attributes'],'include':_0x5ae5c4[_0x9164('0x25')]?_['map'](_0x5ae5c4['include'],function(_0x3d7785){return{'model':db[_0x3d7785['model']],'as':_0x3d7785['as'],'attributes':_0x3d7785[_0x9164('0x23')],'include':_0x3d7785[_0x9164('0x25')]?_['map'](_0x3d7785[_0x9164('0x25')],function(_0x57e91b){return{'model':db[_0x57e91b[_0x9164('0x26')]],'as':_0x57e91b['as'],'attributes':_0x57e91b['attributes']};}):[]};}):[]};}):[]:[]})[_0x9164('0x28')](function(_0x53a346){logger[_0x9164('0x2b')](_0x9164('0x29'),_0x359fe4);logger[_0x9164('0x15')]('ShowWhatsappQueue',_0x359fe4,JSON[_0x9164('0x18')](_0x53a346));_0x3edfd0(_0x53a346);})['catch'](function(_0x376196){logger[_0x9164('0x19')](_0x9164('0x29'),_0x376196['message'],_0x359fe4);_0x142b16(_0x4ba39a[_0x9164('0x19')](0x1f4,_0x376196[_0x9164('0x1b')]));});});}; \ No newline at end of file +var _0xeb5f=['debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','WhatsappQueue','findAll','options','attributes','limit','include','map','model','then','GetWhatsappQueue','ShowWhatsappQueue','find','raw','where','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x2329f8,_0x3bbf48){var _0x287755=function(_0x4f6b41){while(--_0x4f6b41){_0x2329f8['push'](_0x2329f8['shift']());}};_0x287755(++_0x3bbf48);}(_0xeb5f,0xac));var _0xfeb5=function(_0x7e33b2,_0x4c9620){_0x7e33b2=_0x7e33b2-0x0;var _0x251c09=_0xeb5f[_0x7e33b2];return _0x251c09;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfeb5('0x0'));var BPromise=require('bluebird');var rs=require(_0xfeb5('0x1'));var fs=require('fs');var Redis=require(_0xfeb5('0x2'));var db=require(_0xfeb5('0x3'))['db'];var utils=require(_0xfeb5('0x4'));var logger=require(_0xfeb5('0x5'))(_0xfeb5('0x6'));var config=require(_0xfeb5('0x7'));var jayson=require(_0xfeb5('0x8'));var client=jayson[_0xfeb5('0x9')][_0xfeb5('0xa')]({'port':0x232a});config[_0xfeb5('0xb')]=_['defaults'](config[_0xfeb5('0xb')],{'host':_0xfeb5('0xc'),'port':0x18eb});var socket=require(_0xfeb5('0xd'))(new Redis(config[_0xfeb5('0xb')]));require(_0xfeb5('0xe'))['register'](socket);function respondWithRpcPromise(_0x8bd2a7,_0x3a41f9,_0x2c567f){return new BPromise(function(_0x3ff1ee,_0x4a7478){return client['request'](_0x8bd2a7,_0x2c567f)['then'](function(_0x5afc23){logger[_0xfeb5('0xf')](_0xfeb5('0x10'),_0x3a41f9,_0xfeb5('0x11'));logger[_0xfeb5('0x12')](_0xfeb5('0x13'),_0x3a41f9,_0xfeb5('0x11'),JSON[_0xfeb5('0x14')](_0x5afc23));if(_0x5afc23[_0xfeb5('0x15')]){if(_0x5afc23[_0xfeb5('0x15')]['code']===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x3a41f9,_0x5afc23[_0xfeb5('0x15')][_0xfeb5('0x16')]);return _0x4a7478(_0x5afc23[_0xfeb5('0x15')][_0xfeb5('0x16')]);}logger[_0xfeb5('0x15')](_0xfeb5('0x10'),_0x3a41f9,_0x5afc23[_0xfeb5('0x15')][_0xfeb5('0x16')]);return _0x3ff1ee(_0x5afc23[_0xfeb5('0x15')]['message']);}else{logger[_0xfeb5('0xf')](_0xfeb5('0x10'),_0x3a41f9,_0xfeb5('0x11'));_0x3ff1ee(_0x5afc23['result'][_0xfeb5('0x16')]);}})[_0xfeb5('0x17')](function(_0x1102e7){logger[_0xfeb5('0x15')](_0xfeb5('0x10'),_0x3a41f9,_0x1102e7);_0x4a7478(_0x1102e7);});});}exports['GetWhatsappQueue']=function(_0x3ef99f){var _0x424bf4=this;return new Promise(function(_0x105a28,_0x25c360){return db[_0xfeb5('0x18')][_0xfeb5('0x19')]({'raw':_0x3ef99f[_0xfeb5('0x1a')]?_0x3ef99f[_0xfeb5('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3ef99f[_0xfeb5('0x1a')]?_0x3ef99f['options']['where']||null:null,'attributes':_0x3ef99f['options']?_0x3ef99f[_0xfeb5('0x1a')][_0xfeb5('0x1b')]||null:null,'limit':_0x3ef99f[_0xfeb5('0x1a')]?_0x3ef99f['options'][_0xfeb5('0x1c')]||null:null,'include':_0x3ef99f[_0xfeb5('0x1a')]?_0x3ef99f[_0xfeb5('0x1a')][_0xfeb5('0x1d')]?_[_0xfeb5('0x1e')](_0x3ef99f[_0xfeb5('0x1a')][_0xfeb5('0x1d')],function(_0x466fb0){return{'model':db[_0x466fb0['model']],'as':_0x466fb0['as'],'attributes':_0x466fb0['attributes'],'include':_0x466fb0[_0xfeb5('0x1d')]?_['map'](_0x466fb0[_0xfeb5('0x1d')],function(_0xaed748){return{'model':db[_0xaed748['model']],'as':_0xaed748['as'],'attributes':_0xaed748['attributes'],'include':_0xaed748[_0xfeb5('0x1d')]?_[_0xfeb5('0x1e')](_0xaed748[_0xfeb5('0x1d')],function(_0x49a7b5){return{'model':db[_0x49a7b5[_0xfeb5('0x1f')]],'as':_0x49a7b5['as'],'attributes':_0x49a7b5[_0xfeb5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfeb5('0x20')](function(_0x2bba9f){logger[_0xfeb5('0xf')](_0xfeb5('0x21'),_0x3ef99f);logger[_0xfeb5('0x12')](_0xfeb5('0x21'),_0x3ef99f,JSON[_0xfeb5('0x14')](_0x2bba9f));_0x105a28(_0x2bba9f);})['catch'](function(_0x3e995){logger[_0xfeb5('0x15')](_0xfeb5('0x21'),_0x3e995['message'],_0x3ef99f);_0x25c360(_0x424bf4[_0xfeb5('0x15')](0x1f4,_0x3e995[_0xfeb5('0x16')]));});});};exports[_0xfeb5('0x22')]=function(_0x152841){var _0x489ff7=this;return new Promise(function(_0x64c9,_0x4260d5){return db[_0xfeb5('0x18')][_0xfeb5('0x23')]({'raw':_0x152841[_0xfeb5('0x1a')]?_0x152841[_0xfeb5('0x1a')][_0xfeb5('0x24')]===undefined?!![]:![]:!![],'where':_0x152841['options']?_0x152841[_0xfeb5('0x1a')][_0xfeb5('0x25')]||null:null,'attributes':_0x152841[_0xfeb5('0x1a')]?_0x152841[_0xfeb5('0x1a')]['attributes']||null:null,'include':_0x152841[_0xfeb5('0x1a')]?_0x152841[_0xfeb5('0x1a')][_0xfeb5('0x1d')]?_[_0xfeb5('0x1e')](_0x152841[_0xfeb5('0x1a')][_0xfeb5('0x1d')],function(_0x51e1d6){return{'model':db[_0x51e1d6['model']],'as':_0x51e1d6['as'],'attributes':_0x51e1d6[_0xfeb5('0x1b')],'include':_0x51e1d6[_0xfeb5('0x1d')]?_['map'](_0x51e1d6[_0xfeb5('0x1d')],function(_0x1821ac){return{'model':db[_0x1821ac[_0xfeb5('0x1f')]],'as':_0x1821ac['as'],'attributes':_0x1821ac[_0xfeb5('0x1b')],'include':_0x1821ac[_0xfeb5('0x1d')]?_[_0xfeb5('0x1e')](_0x1821ac['include'],function(_0x29125d){return{'model':db[_0x29125d[_0xfeb5('0x1f')]],'as':_0x29125d['as'],'attributes':_0x29125d[_0xfeb5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfeb5('0x20')](function(_0x476e00){logger['info'](_0xfeb5('0x22'),_0x152841);logger[_0xfeb5('0x12')](_0xfeb5('0x22'),_0x152841,JSON[_0xfeb5('0x14')](_0x476e00));_0x64c9(_0x476e00);})['catch'](function(_0x444578){logger[_0xfeb5('0x15')](_0xfeb5('0x22'),_0x444578[_0xfeb5('0x16')],_0x152841);_0x4260d5(_0x489ff7[_0xfeb5('0x15')](0x1f4,_0x444578['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index d31174f..36da22c 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 _0x1645=['length','whatsappQueue:','./whatsappQueue.events','save','emit'];(function(_0x2faa1a,_0x5bcc32){var _0x3f9dc7=function(_0x3f33b4){while(--_0x3f33b4){_0x2faa1a['push'](_0x2faa1a['shift']());}};_0x3f9dc7(++_0x5bcc32);}(_0x1645,0x75));var _0x5164=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1645[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappQueueEvents=require(_0x5164('0x0'));var events=[_0x5164('0x1'),'remove','update'];function createListener(_0x45feee,_0x513767){return function(_0x43b2a0){_0x513767[_0x5164('0x2')](_0x45feee,_0x43b2a0);};}function removeListener(_0x5b2647,_0x5f477f){return function(){WhatsappQueueEvents['removeListener'](_0x5b2647,_0x5f477f);};}exports['register']=function(_0x81bf6b){for(var _0x334679=0x0,_0x53aa5a=events[_0x5164('0x3')];_0x334679<_0x53aa5a;_0x334679++){var _0x1e82bd=events[_0x334679];var _0xa13a1=createListener(_0x5164('0x4')+_0x1e82bd,_0x81bf6b);WhatsappQueueEvents['on'](_0x1e82bd,_0xa13a1);}}; \ No newline at end of file +var _0x0199=['whatsappQueue:','remove','update','emit','removeListener','register'];(function(_0x1392eb,_0x403a79){var _0x27e96d=function(_0x5a5a32){while(--_0x5a5a32){_0x1392eb['push'](_0x1392eb['shift']());}};_0x27e96d(++_0x403a79);}(_0x0199,0x1c9));var _0x9019=function(_0x17b823,_0x42c55c){_0x17b823=_0x17b823-0x0;var _0x3a6c61=_0x0199[_0x17b823];return _0x3a6c61;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0x9019('0x0'),_0x9019('0x1')];function createListener(_0x1b14a9,_0x3342e5){return function(_0x28e17e){_0x3342e5[_0x9019('0x2')](_0x1b14a9,_0x28e17e);};}function removeListener(_0x4a08f2,_0x2368a8){return function(){WhatsappQueueEvents[_0x9019('0x3')](_0x4a08f2,_0x2368a8);};}exports[_0x9019('0x4')]=function(_0x40c5e3){for(var _0x1796aa=0x0,_0xb5deb6=events['length'];_0x1796aa<_0xb5deb6;_0x1796aa++){var _0xe72ee9=events[_0x1796aa];var _0x58665a=createListener(_0x9019('0x5')+_0xe72ee9,_0x40c5e3);WhatsappQueueEvents['on'](_0xe72ee9,_0x58665a);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index ca151d3..e214bb9 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 _0x3437=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy'];(function(_0x315002,_0x4ee032){var _0x54e480=function(_0x4683bc){while(--_0x4683bc){_0x315002['push'](_0x315002['shift']());}};_0x54e480(++_0x4ee032);}(_0x3437,0x1dc));var _0x7343=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3437[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x7343('0x0'));var util=require(_0x7343('0x1'));var path=require('path');var timeout=require(_0x7343('0x2'));var express=require(_0x7343('0x3'));var router=express['Router']();var fs_extra=require(_0x7343('0x4'));var auth=require(_0x7343('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7343('0x6'));var controller=require(_0x7343('0x7'));router[_0x7343('0x8')]('/',auth[_0x7343('0x9')](),controller[_0x7343('0xa')]);router[_0x7343('0x8')]('/describe',auth[_0x7343('0x9')](),controller['describe']);router[_0x7343('0x8')](_0x7343('0xb'),auth['isAuthenticated'](),controller[_0x7343('0xc')]);router[_0x7343('0xd')]('/',auth['isAuthenticated'](),controller[_0x7343('0xe')]);router['put'](_0x7343('0xb'),auth[_0x7343('0x9')](),controller[_0x7343('0xf')]);router[_0x7343('0x10')](_0x7343('0xb'),auth[_0x7343('0x9')](),controller[_0x7343('0x11')]);module[_0x7343('0x12')]=router; \ No newline at end of file +var _0x56fc=['./whatsappQueueReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x56fc,0x114));var _0xc56f=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x56fc[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xc56f('0x0'));var util=require(_0xc56f('0x1'));var path=require(_0xc56f('0x2'));var timeout=require(_0xc56f('0x3'));var express=require(_0xc56f('0x4'));var router=express[_0xc56f('0x5')]();var fs_extra=require(_0xc56f('0x6'));var auth=require(_0xc56f('0x7'));var interaction=require(_0xc56f('0x8'));var config=require(_0xc56f('0x9'));var controller=require(_0xc56f('0xa'));router[_0xc56f('0xb')]('/',auth[_0xc56f('0xc')](),controller[_0xc56f('0xd')]);router[_0xc56f('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc56f('0xb')]('/:id',auth[_0xc56f('0xc')](),controller[_0xc56f('0xe')]);router[_0xc56f('0xf')]('/',auth[_0xc56f('0xc')](),controller[_0xc56f('0x10')]);router[_0xc56f('0x11')](_0xc56f('0x12'),auth['isAuthenticated'](),controller[_0xc56f('0x13')]);router['delete'](_0xc56f('0x12'),auth[_0xc56f('0xc')](),controller[_0xc56f('0x14')]);module[_0xc56f('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 9ae1147..2ccdb0b 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x442486,_0x4383ed){var _0x44d56c=function(_0x5ad9b4){while(--_0x5ad9b4){_0x442486['push'](_0x442486['shift']());}};_0x44d56c(++_0x4383ed);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x5783c7,_0x5cc818){var _0x5bf8b4=function(_0x5f4294){while(--_0x5f4294){_0x5783c7['push'](_0x5783c7['shift']());}};_0x5bf8b4(++_0x5cc818);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 78c501e..31feed4 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 _0xea28=['end','stack','name','map','WhatsappQueueReport','rawAttributes','fieldName','type','query','intersection','model','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','fields','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then'];(function(_0x3b539b,_0x4143a8){var _0xa761f1=function(_0x2268f1){while(--_0x2268f1){_0x3b539b['push'](_0x3b539b['shift']());}};_0xa761f1(++_0x4143a8);}(_0xea28,0x13a));var _0x8ea2=function(_0x4eef54,_0x377a29){_0x4eef54=_0x4eef54-0x0;var _0x1ce1dd=_0xea28[_0x4eef54];return _0x1ce1dd;};'use strict';var emlformat=require(_0x8ea2('0x0'));var rimraf=require(_0x8ea2('0x1'));var zipdir=require(_0x8ea2('0x2'));var jsonpatch=require(_0x8ea2('0x3'));var rp=require(_0x8ea2('0x4'));var moment=require(_0x8ea2('0x5'));var BPromise=require(_0x8ea2('0x6'));var Mustache=require(_0x8ea2('0x7'));var util=require('util');var path=require(_0x8ea2('0x8'));var sox=require(_0x8ea2('0x9'));var csv=require(_0x8ea2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ea2('0xb'));var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0xa'));var querystring=require(_0x8ea2('0x11'));var Papa=require(_0x8ea2('0x12'));var Redis=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var qs=require(_0x8ea2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ea2('0x16'))(_0x8ea2('0x17'));var utils=require(_0x8ea2('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8ea2('0x19'));var db=require(_0x8ea2('0x1a'))['db'];function respondWithStatusCode(_0x1dfb6e,_0x10aead){_0x10aead=_0x10aead||0xcc;return function(_0xe47c0e){if(_0xe47c0e){return _0x1dfb6e['sendStatus'](_0x10aead);}return _0x1dfb6e[_0x8ea2('0x1b')](_0x10aead)['end']();};}function respondWithResult(_0x4b2192,_0x772bad){_0x772bad=_0x772bad||0xc8;return function(_0x4726a7){if(_0x4726a7){return _0x4b2192[_0x8ea2('0x1b')](_0x772bad)[_0x8ea2('0x1c')](_0x4726a7);}};}function respondWithFilteredResult(_0x393faf,_0xbb9bd1){return function(_0x3cff96){if(_0x3cff96){var _0x11f5e8=typeof _0xbb9bd1[_0x8ea2('0x1d')]===_0x8ea2('0x1e')&&typeof _0xbb9bd1[_0x8ea2('0x1f')]===_0x8ea2('0x1e');var _0x3bc774=_0x3cff96[_0x8ea2('0x20')];var _0x1b64cf=_0x11f5e8?0x0:_0xbb9bd1[_0x8ea2('0x1d')];var _0x467045=_0x11f5e8?_0x3cff96[_0x8ea2('0x20')]:_0xbb9bd1[_0x8ea2('0x1d')]+_0xbb9bd1[_0x8ea2('0x1f')];var _0x134cbe;if(_0x467045>=_0x3bc774){_0x467045=_0x3bc774;_0x134cbe=0xc8;}else{_0x134cbe=0xce;}_0x393faf[_0x8ea2('0x1b')](_0x134cbe);return _0x393faf['set']('Content-Range',_0x1b64cf+'-'+_0x467045+'/'+_0x3bc774)[_0x8ea2('0x1c')](_0x3cff96);}return null;};}function patchUpdates(_0x248c18){return function(_0x29151a){try{jsonpatch['apply'](_0x29151a,_0x248c18,!![]);}catch(_0x46f4fe){return BPromise[_0x8ea2('0x21')](_0x46f4fe);}return _0x29151a['save']();};}function saveUpdates(_0x3d593b,_0x283f00){return function(_0x37229a){if(_0x37229a){return _0x37229a[_0x8ea2('0x22')](_0x3d593b)[_0x8ea2('0x23')](function(_0xe5c943){return _0xe5c943;});}return null;};}function removeEntity(_0x199417,_0x1e4cc9){return function(_0x18ec34){if(_0x18ec34){return _0x18ec34['destroy']()[_0x8ea2('0x23')](function(){_0x199417['status'](0xcc)[_0x8ea2('0x24')]();});}};}function handleEntityNotFound(_0x42bec8,_0x29b38f){return function(_0x4e2106){if(!_0x4e2106){_0x42bec8['sendStatus'](0x194);}return _0x4e2106;};}function handleError(_0x2e4da3,_0x4dc7bf){_0x4dc7bf=_0x4dc7bf||0x1f4;return function(_0x200a49){logger['error'](_0x200a49[_0x8ea2('0x25')]);if(_0x200a49[_0x8ea2('0x26')]){delete _0x200a49[_0x8ea2('0x26')];}_0x2e4da3[_0x8ea2('0x1b')](_0x4dc7bf)['send'](_0x200a49);};}exports['index']=function(_0xacaa6c,_0x4da5b3){var _0x4a9875={},_0x287078={},_0x24f187={'count':0x0,'rows':[]};var _0x41f482=_[_0x8ea2('0x27')](db[_0x8ea2('0x28')][_0x8ea2('0x29')],function(_0x316707){return{'name':_0x316707[_0x8ea2('0x2a')],'type':_0x316707[_0x8ea2('0x2b')]['key']};});_0x287078['model']=_[_0x8ea2('0x27')](_0x41f482,_0x8ea2('0x26'));_0x287078['query']=_['keys'](_0xacaa6c[_0x8ea2('0x2c')]);_0x287078['filters']=_[_0x8ea2('0x2d')](_0x287078[_0x8ea2('0x2e')],_0x287078['query']);_0x4a9875[_0x8ea2('0x2f')]=_[_0x8ea2('0x2d')](_0x287078[_0x8ea2('0x2e')],qs['fields'](_0xacaa6c['query']['fields']));_0x4a9875[_0x8ea2('0x2f')]=_0x4a9875[_0x8ea2('0x2f')][_0x8ea2('0x30')]?_0x4a9875['attributes']:_0x287078[_0x8ea2('0x2e')];if(!_0xacaa6c[_0x8ea2('0x2c')][_0x8ea2('0x31')](_0x8ea2('0x32'))){_0x4a9875[_0x8ea2('0x1f')]=qs[_0x8ea2('0x1f')](_0xacaa6c[_0x8ea2('0x2c')][_0x8ea2('0x1f')]);_0x4a9875['offset']=qs[_0x8ea2('0x1d')](_0xacaa6c[_0x8ea2('0x2c')][_0x8ea2('0x1d')]);}_0x4a9875[_0x8ea2('0x33')]=qs['sort'](_0xacaa6c[_0x8ea2('0x2c')]['sort']);_0x4a9875[_0x8ea2('0x34')]=qs[_0x8ea2('0x35')](_[_0x8ea2('0x36')](_0xacaa6c[_0x8ea2('0x2c')],_0x287078['filters']),_0x41f482);if(_0xacaa6c[_0x8ea2('0x2c')]['filter']){_0x4a9875['where']=_[_0x8ea2('0x37')](_0x4a9875['where'],{'$or':_[_0x8ea2('0x27')](_0x41f482,function(_0x2f0779){if(_0x2f0779[_0x8ea2('0x2b')]!==_0x8ea2('0x38')){var _0x134584={};_0x134584[_0x2f0779['name']]={'$like':'%'+_0xacaa6c[_0x8ea2('0x2c')]['filter']+'%'};return _0x134584;}})});}_0x4a9875=_[_0x8ea2('0x37')]({},_0x4a9875,_0xacaa6c[_0x8ea2('0x39')]);var _0x6d0e0c={'where':_0x4a9875[_0x8ea2('0x34')]};return db['WhatsappQueueReport'][_0x8ea2('0x20')](_0x6d0e0c)['then'](function(_0x3f0c78){_0x24f187['count']=_0x3f0c78;if(_0xacaa6c[_0x8ea2('0x2c')][_0x8ea2('0x3a')]){_0x4a9875[_0x8ea2('0x3b')]=[{'all':!![]}];}return db[_0x8ea2('0x28')][_0x8ea2('0x3c')](_0x4a9875);})[_0x8ea2('0x23')](function(_0x2f4fa8){_0x24f187['rows']=_0x2f4fa8;return _0x24f187;})['then'](respondWithFilteredResult(_0x4da5b3,_0x4a9875))[_0x8ea2('0x3d')](handleError(_0x4da5b3,null));};exports['show']=function(_0x4b03fa,_0x59e2fa){var _0x3cbc09={'raw':!![],'where':{'id':_0x4b03fa[_0x8ea2('0x3e')]['id']}},_0x5d9ba0={};_0x5d9ba0[_0x8ea2('0x2e')]=_[_0x8ea2('0x3f')](db[_0x8ea2('0x28')][_0x8ea2('0x29')]);_0x5d9ba0[_0x8ea2('0x2c')]=_[_0x8ea2('0x3f')](_0x4b03fa[_0x8ea2('0x2c')]);_0x5d9ba0['filters']=_[_0x8ea2('0x2d')](_0x5d9ba0[_0x8ea2('0x2e')],_0x5d9ba0[_0x8ea2('0x2c')]);_0x3cbc09['attributes']=_[_0x8ea2('0x2d')](_0x5d9ba0[_0x8ea2('0x2e')],qs[_0x8ea2('0x40')](_0x4b03fa[_0x8ea2('0x2c')][_0x8ea2('0x40')]));_0x3cbc09['attributes']=_0x3cbc09[_0x8ea2('0x2f')][_0x8ea2('0x30')]?_0x3cbc09[_0x8ea2('0x2f')]:_0x5d9ba0['model'];if(_0x4b03fa[_0x8ea2('0x2c')][_0x8ea2('0x3a')]){_0x3cbc09[_0x8ea2('0x3b')]=[{'all':!![]}];}_0x3cbc09=_[_0x8ea2('0x37')]({},_0x3cbc09,_0x4b03fa[_0x8ea2('0x39')]);return db[_0x8ea2('0x28')][_0x8ea2('0x41')](_0x3cbc09)[_0x8ea2('0x23')](handleEntityNotFound(_0x59e2fa,null))[_0x8ea2('0x23')](respondWithResult(_0x59e2fa,null))[_0x8ea2('0x3d')](handleError(_0x59e2fa,null));};exports[_0x8ea2('0x42')]=function(_0x52d203,_0x220970){return db[_0x8ea2('0x28')]['create'](_0x52d203[_0x8ea2('0x43')],{})[_0x8ea2('0x23')](respondWithResult(_0x220970,0xc9))[_0x8ea2('0x3d')](handleError(_0x220970,null));};exports[_0x8ea2('0x22')]=function(_0x182a46,_0x1daa25){if(_0x182a46[_0x8ea2('0x43')]['id']){delete _0x182a46[_0x8ea2('0x43')]['id'];}return db['WhatsappQueueReport'][_0x8ea2('0x41')]({'where':{'id':_0x182a46[_0x8ea2('0x3e')]['id']}})[_0x8ea2('0x23')](handleEntityNotFound(_0x1daa25,null))['then'](saveUpdates(_0x182a46['body'],null))[_0x8ea2('0x23')](respondWithResult(_0x1daa25,null))[_0x8ea2('0x3d')](handleError(_0x1daa25,null));};exports[_0x8ea2('0x44')]=function(_0x5e5c37,_0x3d86f3){return db[_0x8ea2('0x28')][_0x8ea2('0x41')]({'where':{'id':_0x5e5c37[_0x8ea2('0x3e')]['id']}})[_0x8ea2('0x23')](handleEntityNotFound(_0x3d86f3,null))['then'](removeEntity(_0x3d86f3,null))['catch'](handleError(_0x3d86f3,null));};exports[_0x8ea2('0x45')]=function(_0x4148c1,_0x1b8c4b){return db['WhatsappQueueReport'][_0x8ea2('0x45')]()[_0x8ea2('0x23')](respondWithResult(_0x1b8c4b,null))[_0x8ea2('0x3d')](handleError(_0x1b8c4b,null));}; \ No newline at end of file +var _0xeb74=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','WhatsappQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring'];(function(_0xdcb07c,_0x33cfcf){var _0x129150=function(_0x52856a){while(--_0x52856a){_0xdcb07c['push'](_0xdcb07c['shift']());}};_0x129150(++_0x33cfcf);}(_0xeb74,0xe3));var _0x4eb7=function(_0x13898e,_0x18e525){_0x13898e=_0x13898e-0x0;var _0x1296ec=_0xeb74[_0x13898e];return _0x1296ec;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];function respondWithStatusCode(_0x35fa89,_0x4194e1){_0x4194e1=_0x4194e1||0xcc;return function(_0x3c9f45){if(_0x3c9f45){return _0x35fa89['sendStatus'](_0x4194e1);}return _0x35fa89['status'](_0x4194e1)['end']();};}function respondWithResult(_0x17fb81,_0x51f09d){_0x51f09d=_0x51f09d||0xc8;return function(_0x84c68b){if(_0x84c68b){return _0x17fb81[_0x4eb7('0x19')](_0x51f09d)[_0x4eb7('0x1a')](_0x84c68b);}};}function respondWithFilteredResult(_0x1c4a97,_0x5d6d5){return function(_0x21433d){if(_0x21433d){var _0x11674f=typeof _0x5d6d5[_0x4eb7('0x1b')]===_0x4eb7('0x1c')&&typeof _0x5d6d5[_0x4eb7('0x1d')]==='undefined';var _0xb86bc9=_0x21433d[_0x4eb7('0x1e')];var _0x3b6d41=_0x11674f?0x0:_0x5d6d5[_0x4eb7('0x1b')];var _0x302e16=_0x11674f?_0x21433d[_0x4eb7('0x1e')]:_0x5d6d5[_0x4eb7('0x1b')]+_0x5d6d5[_0x4eb7('0x1d')];var _0x5f4780;if(_0x302e16>=_0xb86bc9){_0x302e16=_0xb86bc9;_0x5f4780=0xc8;}else{_0x5f4780=0xce;}_0x1c4a97[_0x4eb7('0x19')](_0x5f4780);return _0x1c4a97[_0x4eb7('0x1f')](_0x4eb7('0x20'),_0x3b6d41+'-'+_0x302e16+'/'+_0xb86bc9)[_0x4eb7('0x1a')](_0x21433d);}return null;};}function patchUpdates(_0x32f0f5){return function(_0x2efd67){try{jsonpatch[_0x4eb7('0x21')](_0x2efd67,_0x32f0f5,!![]);}catch(_0x4ddbe4){return BPromise[_0x4eb7('0x22')](_0x4ddbe4);}return _0x2efd67[_0x4eb7('0x23')]();};}function saveUpdates(_0x4783b1,_0x164515){return function(_0x14a7be){if(_0x14a7be){return _0x14a7be[_0x4eb7('0x24')](_0x4783b1)[_0x4eb7('0x25')](function(_0x2df1b1){return _0x2df1b1;});}return null;};}function removeEntity(_0x1a2b8b,_0x13e871){return function(_0x4de2d9){if(_0x4de2d9){return _0x4de2d9[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x1a2b8b[_0x4eb7('0x19')](0xcc)[_0x4eb7('0x27')]();});}};}function handleEntityNotFound(_0x3e0da2,_0x25eb74){return function(_0x365060){if(!_0x365060){_0x3e0da2[_0x4eb7('0x28')](0x194);}return _0x365060;};}function handleError(_0x80b804,_0x248759){_0x248759=_0x248759||0x1f4;return function(_0xf83c11){logger[_0x4eb7('0x29')](_0xf83c11[_0x4eb7('0x2a')]);if(_0xf83c11[_0x4eb7('0x2b')]){delete _0xf83c11[_0x4eb7('0x2b')];}_0x80b804[_0x4eb7('0x19')](_0x248759)[_0x4eb7('0x2c')](_0xf83c11);};}exports[_0x4eb7('0x2d')]=function(_0x33a2c1,_0x28fda8){var _0x114c68={},_0x17030a={},_0x3ed224={'count':0x0,'rows':[]};var _0x50209d=_[_0x4eb7('0x2e')](db['WhatsappQueueReport'][_0x4eb7('0x2f')],function(_0x13f71a){return{'name':_0x13f71a[_0x4eb7('0x30')],'type':_0x13f71a[_0x4eb7('0x31')][_0x4eb7('0x32')]};});_0x17030a[_0x4eb7('0x33')]=_[_0x4eb7('0x2e')](_0x50209d,_0x4eb7('0x2b'));_0x17030a[_0x4eb7('0x34')]=_['keys'](_0x33a2c1[_0x4eb7('0x34')]);_0x17030a['filters']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],_0x17030a['query']);_0x114c68['attributes']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x33a2c1[_0x4eb7('0x34')]['fields']));_0x114c68[_0x4eb7('0x37')]=_0x114c68[_0x4eb7('0x37')][_0x4eb7('0x38')]?_0x114c68[_0x4eb7('0x37')]:_0x17030a[_0x4eb7('0x33')];if(!_0x33a2c1['query'][_0x4eb7('0x39')](_0x4eb7('0x3a'))){_0x114c68[_0x4eb7('0x1d')]=qs['limit'](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x1d')]);_0x114c68[_0x4eb7('0x1b')]=qs['offset'](_0x33a2c1[_0x4eb7('0x34')]['offset']);}_0x114c68[_0x4eb7('0x3b')]=qs[_0x4eb7('0x3c')](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x3c')]);_0x114c68['where']=qs[_0x4eb7('0x3d')](_[_0x4eb7('0x3e')](_0x33a2c1[_0x4eb7('0x34')],_0x17030a[_0x4eb7('0x3d')]),_0x50209d);if(_0x33a2c1['query']['filter']){_0x114c68['where']=_[_0x4eb7('0x3f')](_0x114c68[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x2e')](_0x50209d,function(_0x20ac7b){if(_0x20ac7b[_0x4eb7('0x31')]!==_0x4eb7('0x41')){var _0x1038c1={};_0x1038c1[_0x20ac7b[_0x4eb7('0x2b')]]={'$like':'%'+_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x42')]+'%'};return _0x1038c1;}})});}_0x114c68=_['merge']({},_0x114c68,_0x33a2c1[_0x4eb7('0x43')]);var _0x38218f={'where':_0x114c68[_0x4eb7('0x40')]};return db[_0x4eb7('0x44')][_0x4eb7('0x1e')](_0x38218f)[_0x4eb7('0x25')](function(_0x704d4d){_0x3ed224[_0x4eb7('0x1e')]=_0x704d4d;if(_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x114c68[_0x4eb7('0x46')]=[{'all':!![]}];}return db[_0x4eb7('0x44')][_0x4eb7('0x47')](_0x114c68);})[_0x4eb7('0x25')](function(_0x38af1f){_0x3ed224[_0x4eb7('0x48')]=_0x38af1f;return _0x3ed224;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x28fda8,_0x114c68))[_0x4eb7('0x49')](handleError(_0x28fda8,null));};exports[_0x4eb7('0x4a')]=function(_0x79aec5,_0x5eff9e){var _0x2fd5c2={'raw':!![],'where':{'id':_0x79aec5[_0x4eb7('0x4b')]['id']}},_0x2df542={};_0x2df542[_0x4eb7('0x33')]=_[_0x4eb7('0x4c')](db[_0x4eb7('0x44')][_0x4eb7('0x2f')]);_0x2df542[_0x4eb7('0x34')]=_[_0x4eb7('0x4c')](_0x79aec5['query']);_0x2df542[_0x4eb7('0x3d')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],_0x2df542[_0x4eb7('0x34')]);_0x2fd5c2[_0x4eb7('0x37')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x36')]));_0x2fd5c2['attributes']=_0x2fd5c2[_0x4eb7('0x37')]['length']?_0x2fd5c2[_0x4eb7('0x37')]:_0x2df542[_0x4eb7('0x33')];if(_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x2fd5c2[_0x4eb7('0x46')]=[{'all':!![]}];}_0x2fd5c2=_['merge']({},_0x2fd5c2,_0x79aec5['options']);return db[_0x4eb7('0x44')][_0x4eb7('0x4d')](_0x2fd5c2)[_0x4eb7('0x25')](handleEntityNotFound(_0x5eff9e,null))[_0x4eb7('0x25')](respondWithResult(_0x5eff9e,null))[_0x4eb7('0x49')](handleError(_0x5eff9e,null));};exports['create']=function(_0x6086,_0x104284){return db['WhatsappQueueReport'][_0x4eb7('0x4e')](_0x6086[_0x4eb7('0x4f')],{})['then'](respondWithResult(_0x104284,0xc9))[_0x4eb7('0x49')](handleError(_0x104284,null));};exports[_0x4eb7('0x24')]=function(_0x3c8049,_0x5774d5){if(_0x3c8049[_0x4eb7('0x4f')]['id']){delete _0x3c8049['body']['id'];}return db['WhatsappQueueReport'][_0x4eb7('0x4d')]({'where':{'id':_0x3c8049[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x5774d5,null))[_0x4eb7('0x25')](saveUpdates(_0x3c8049[_0x4eb7('0x4f')],null))[_0x4eb7('0x25')](respondWithResult(_0x5774d5,null))[_0x4eb7('0x49')](handleError(_0x5774d5,null));};exports[_0x4eb7('0x26')]=function(_0x2913c5,_0x23c0d5){return db[_0x4eb7('0x44')][_0x4eb7('0x4d')]({'where':{'id':_0x2913c5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x23c0d5,null))[_0x4eb7('0x25')](removeEntity(_0x23c0d5,null))[_0x4eb7('0x49')](handleError(_0x23c0d5,null));};exports[_0x4eb7('0x50')]=function(_0x1580ba,_0x1411c9){return db[_0x4eb7('0x44')]['describe']()[_0x4eb7('0x25')](respondWithResult(_0x1411c9,null))['catch'](handleError(_0x1411c9,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index f8805da..af1a377 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 _0x1e0b=['request-promise','path','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger'];(function(_0x5b47d9,_0x1327ce){var _0x4151f0=function(_0x24bda2){while(--_0x24bda2){_0x5b47d9['push'](_0x5b47d9['shift']());}};_0x4151f0(++_0x1327ce);}(_0x1e0b,0x1d4));var _0xb1e0=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0x1e0b[_0x296923];return _0x29af70;};'use strict';var _=require('lodash');var util=require(_0xb1e0('0x0'));var logger=require(_0xb1e0('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb1e0('0x2'));var fs=require('fs');var path=require(_0xb1e0('0x3'));var rimraf=require('rimraf');var config=require(_0xb1e0('0x4'));var attributes=require('./whatsappQueueReport.attributes');module[_0xb1e0('0x5')]=function(_0x192669,_0xd58781){return _0x192669[_0xb1e0('0x6')](_0xb1e0('0x7'),attributes,{'tableName':_0xb1e0('0x8'),'paranoid':![],'indexes':[{'name':_0xb1e0('0x9'),'fields':[_0xb1e0('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7555=['util','../../config/logger','api','request-promise','path','rimraf','exports','define','WhatsappQueueReport','uniqueid','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7555,0x13e));var _0x5755=function(_0x337c0b,_0x4fb880){_0x337c0b=_0x337c0b-0x0;var _0x557054=_0x7555[_0x337c0b];return _0x557054;};'use strict';var _=require(_0x5755('0x0'));var util=require(_0x5755('0x1'));var logger=require(_0x5755('0x2'))(_0x5755('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5755('0x4'));var fs=require('fs');var path=require(_0x5755('0x5'));var rimraf=require(_0x5755('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0x5755('0x7')]=function(_0x3c0e15,_0x5bc38f){return _0x3c0e15[_0x5755('0x8')](_0x5755('0x9'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x5755('0xa'),'fields':[_0x5755('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 849a2eb..7e7c071 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 _0xaa65=['code','message','info','result','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','catch','update','limit','UpdateWhatsappQueueReport','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xaa65,0x194));var _0x5aa6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa65[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5aa6('0x0'));var rs=require(_0x5aa6('0x1'));var fs=require('fs');var Redis=require(_0x5aa6('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5aa6('0x3'));var config=require(_0x5aa6('0x4'));var jayson=require(_0x5aa6('0x5'));var client=jayson[_0x5aa6('0x6')][_0x5aa6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x93d467,_0x3145b8,_0x3b1185){return new BPromise(function(_0x2d34ec,_0x41dd5e){return client[_0x5aa6('0x8')](_0x93d467,_0x3b1185)[_0x5aa6('0x9')](function(_0x5f4452){logger['info'](_0x5aa6('0xa'),_0x3145b8,'request\x20sent');logger[_0x5aa6('0xb')](_0x5aa6('0xc'),_0x3145b8,_0x5aa6('0xd'),JSON[_0x5aa6('0xe')](_0x5f4452));if(_0x5f4452[_0x5aa6('0xf')]){if(_0x5f4452['error'][_0x5aa6('0x10')]===0x1f4){logger[_0x5aa6('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3145b8,_0x5f4452[_0x5aa6('0xf')][_0x5aa6('0x11')]);return _0x41dd5e(_0x5f4452['error'][_0x5aa6('0x11')]);}logger[_0x5aa6('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3145b8,_0x5f4452[_0x5aa6('0xf')][_0x5aa6('0x11')]);return _0x2d34ec(_0x5f4452[_0x5aa6('0xf')][_0x5aa6('0x11')]);}else{logger[_0x5aa6('0x12')](_0x5aa6('0xa'),_0x3145b8,_0x5aa6('0xd'));_0x2d34ec(_0x5f4452[_0x5aa6('0x13')][_0x5aa6('0x11')]);}})['catch'](function(_0x16b04d){logger[_0x5aa6('0xf')](_0x5aa6('0xa'),_0x3145b8,_0x16b04d);_0x41dd5e(_0x16b04d);});});}exports['CreateWhatsappQueueReport']=function(_0x55ac12){var _0x4cd815=this;return new Promise(function(_0x3cbd59,_0x3e1809){return db[_0x5aa6('0x14')][_0x5aa6('0x15')](_0x55ac12[_0x5aa6('0x16')],{'raw':_0x55ac12[_0x5aa6('0x17')]?_0x55ac12[_0x5aa6('0x17')][_0x5aa6('0x18')]===undefined?!![]:![]:!![]})[_0x5aa6('0x9')](function(_0x2f3727){logger[_0x5aa6('0x12')](_0x5aa6('0x19'),_0x55ac12);logger[_0x5aa6('0xb')](_0x5aa6('0x19'),_0x55ac12,JSON[_0x5aa6('0xe')](_0x2f3727));_0x3cbd59(_0x2f3727);})[_0x5aa6('0x1a')](function(_0x327536){logger[_0x5aa6('0xf')](_0x5aa6('0x19'),_0x327536[_0x5aa6('0x11')],_0x55ac12);_0x3e1809(_0x4cd815[_0x5aa6('0xf')](0x1f4,_0x327536[_0x5aa6('0x11')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x96e533){var _0x2924fd=this;return new Promise(function(_0x1143bd,_0x4071ce){return db['WhatsappQueueReport'][_0x5aa6('0x1b')](_0x96e533[_0x5aa6('0x16')],{'raw':_0x96e533[_0x5aa6('0x17')]?_0x96e533['options'][_0x5aa6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x96e533[_0x5aa6('0x17')]?_0x96e533[_0x5aa6('0x17')]['where']||null:null,'attributes':_0x96e533[_0x5aa6('0x17')]?_0x96e533[_0x5aa6('0x17')]['attributes']||null:null,'limit':_0x96e533[_0x5aa6('0x17')]?_0x96e533[_0x5aa6('0x17')][_0x5aa6('0x1c')]||null:null})[_0x5aa6('0x9')](function(_0x439c53){logger[_0x5aa6('0x12')](_0x5aa6('0x1d'),_0x96e533);logger[_0x5aa6('0xb')](_0x5aa6('0x1d'),_0x96e533,JSON[_0x5aa6('0xe')](_0x439c53));_0x1143bd(_0x439c53);})['catch'](function(_0x524081){logger[_0x5aa6('0xf')](_0x5aa6('0x1d'),_0x524081[_0x5aa6('0x11')],_0x96e533);_0x4071ce(_0x2924fd[_0x5aa6('0xf')](0x1f4,_0x524081[_0x5aa6('0x11')]));});});}; \ No newline at end of file +var _0xcb62=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','body','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','WhatsappQueueReport','attributes','limit','lodash','util','moment','bluebird'];(function(_0x5c3514,_0x18e281){var _0x56e259=function(_0x4914e3){while(--_0x4914e3){_0x5c3514['push'](_0x5c3514['shift']());}};_0x56e259(++_0x18e281);}(_0xcb62,0x70));var _0x2cb6=function(_0x509a5b,_0xf96740){_0x509a5b=_0x509a5b-0x0;var _0x2a0c5a=_0xcb62[_0x509a5b];return _0x2a0c5a;};'use strict';var _=require(_0x2cb6('0x0'));var util=require(_0x2cb6('0x1'));var moment=require(_0x2cb6('0x2'));var BPromise=require(_0x2cb6('0x3'));var rs=require(_0x2cb6('0x4'));var fs=require('fs');var Redis=require(_0x2cb6('0x5'));var db=require(_0x2cb6('0x6'))['db'];var utils=require(_0x2cb6('0x7'));var logger=require(_0x2cb6('0x8'))('rpc');var config=require(_0x2cb6('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2cb6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa8222e,_0x2eb23b,_0x462111){return new BPromise(function(_0x4d67ff,_0x2b733a){return client[_0x2cb6('0xb')](_0xa8222e,_0x462111)[_0x2cb6('0xc')](function(_0x4e759e){logger[_0x2cb6('0xd')](_0x2cb6('0xe'),_0x2eb23b,_0x2cb6('0xf'));logger['debug'](_0x2cb6('0x10'),_0x2eb23b,'request\x20sent',JSON[_0x2cb6('0x11')](_0x4e759e));if(_0x4e759e[_0x2cb6('0x12')]){if(_0x4e759e[_0x2cb6('0x12')]['code']===0x1f4){logger[_0x2cb6('0x12')](_0x2cb6('0xe'),_0x2eb23b,_0x4e759e[_0x2cb6('0x12')][_0x2cb6('0x13')]);return _0x2b733a(_0x4e759e[_0x2cb6('0x12')][_0x2cb6('0x13')]);}logger[_0x2cb6('0x12')](_0x2cb6('0xe'),_0x2eb23b,_0x4e759e[_0x2cb6('0x12')]['message']);return _0x4d67ff(_0x4e759e[_0x2cb6('0x12')][_0x2cb6('0x13')]);}else{logger[_0x2cb6('0xd')](_0x2cb6('0xe'),_0x2eb23b,'request\x20sent');_0x4d67ff(_0x4e759e['result'][_0x2cb6('0x13')]);}})[_0x2cb6('0x14')](function(_0x5a6bf1){logger[_0x2cb6('0x12')](_0x2cb6('0xe'),_0x2eb23b,_0x5a6bf1);_0x2b733a(_0x5a6bf1);});});}exports['CreateWhatsappQueueReport']=function(_0x238f5f){var _0x57fa9e=this;return new Promise(function(_0x97670,_0x163129){return db['WhatsappQueueReport']['create'](_0x238f5f[_0x2cb6('0x15')],{'raw':_0x238f5f['options']?_0x238f5f[_0x2cb6('0x16')][_0x2cb6('0x17')]===undefined?!![]:![]:!![]})[_0x2cb6('0xc')](function(_0x360d42){logger[_0x2cb6('0xd')](_0x2cb6('0x18'),_0x238f5f);logger['debug'](_0x2cb6('0x18'),_0x238f5f,JSON[_0x2cb6('0x11')](_0x360d42));_0x97670(_0x360d42);})[_0x2cb6('0x14')](function(_0x5e3385){logger[_0x2cb6('0x12')](_0x2cb6('0x18'),_0x5e3385[_0x2cb6('0x13')],_0x238f5f);_0x163129(_0x57fa9e['error'](0x1f4,_0x5e3385[_0x2cb6('0x13')]));});});};exports[_0x2cb6('0x19')]=function(_0x4a2e23){var _0x496f9b=this;return new Promise(function(_0x1cdd9e,_0x1cdd48){return db[_0x2cb6('0x1a')]['update'](_0x4a2e23[_0x2cb6('0x15')],{'raw':_0x4a2e23[_0x2cb6('0x16')]?_0x4a2e23[_0x2cb6('0x16')][_0x2cb6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a2e23[_0x2cb6('0x16')]?_0x4a2e23[_0x2cb6('0x16')]['where']||null:null,'attributes':_0x4a2e23[_0x2cb6('0x16')]?_0x4a2e23[_0x2cb6('0x16')][_0x2cb6('0x1b')]||null:null,'limit':_0x4a2e23[_0x2cb6('0x16')]?_0x4a2e23['options'][_0x2cb6('0x1c')]||null:null})[_0x2cb6('0xc')](function(_0x1e4934){logger[_0x2cb6('0xd')](_0x2cb6('0x19'),_0x4a2e23);logger['debug'](_0x2cb6('0x19'),_0x4a2e23,JSON['stringify'](_0x1e4934));_0x1cdd9e(_0x1e4934);})[_0x2cb6('0x14')](function(_0x5a9415){logger[_0x2cb6('0x12')]('UpdateWhatsappQueueReport',_0x5a9415[_0x2cb6('0x13')],_0x4a2e23);_0x1cdd48(_0x496f9b[_0x2cb6('0x12')](0x1f4,_0x5a9415[_0x2cb6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index cade22d..5733a38 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 _0x7e1c=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','destroy','exports'];(function(_0x2c4a6b,_0x29a928){var _0xe67f09=function(_0x3cbdaf){while(--_0x3cbdaf){_0x2c4a6b['push'](_0x2c4a6b['shift']());}};_0xe67f09(++_0x29a928);}(_0x7e1c,0x1b9));var _0xc7e1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e1c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc7e1('0x0'));var util=require(_0xc7e1('0x1'));var path=require('path');var timeout=require(_0xc7e1('0x2'));var express=require(_0xc7e1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc7e1('0x4'));var interaction=require(_0xc7e1('0x5'));var config=require(_0xc7e1('0x6'));var controller=require(_0xc7e1('0x7'));router[_0xc7e1('0x8')]('/',auth[_0xc7e1('0x9')](),controller[_0xc7e1('0xa')]);router[_0xc7e1('0x8')](_0xc7e1('0xb'),auth['isAuthenticated'](),controller[_0xc7e1('0xc')]);router[_0xc7e1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc7e1('0xd')]);router[_0xc7e1('0xe')]('/',auth[_0xc7e1('0x9')](),controller[_0xc7e1('0xf')]);router[_0xc7e1('0x10')](_0xc7e1('0x11'),auth[_0xc7e1('0x9')](),controller[_0xc7e1('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc7e1('0x13')]);module[_0xc7e1('0x14')]=router; \ No newline at end of file +var _0x3d9c=['update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x3d9c,0x93));var _0xc3d9=function(_0x115e10,_0x22152d){_0x115e10=_0x115e10-0x0;var _0x1160cc=_0x3d9c[_0x115e10];return _0x1160cc;};'use strict';var multer=require(_0xc3d9('0x0'));var util=require(_0xc3d9('0x1'));var path=require(_0xc3d9('0x2'));var timeout=require(_0xc3d9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc3d9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc3d9('0x5'));var controller=require('./whatsappTransferReport.controller');router[_0xc3d9('0x6')]('/',auth[_0xc3d9('0x7')](),controller[_0xc3d9('0x8')]);router['get'](_0xc3d9('0x9'),auth[_0xc3d9('0x7')](),controller[_0xc3d9('0xa')]);router[_0xc3d9('0x6')](_0xc3d9('0xb'),auth['isAuthenticated'](),controller[_0xc3d9('0xc')]);router[_0xc3d9('0xd')]('/',auth[_0xc3d9('0x7')](),controller['create']);router[_0xc3d9('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xc3d9('0xf')]);router[_0xc3d9('0x10')](_0xc3d9('0xb'),auth[_0xc3d9('0x7')](),controller['destroy']);module[_0xc3d9('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 d3db70d..96466ff 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 _0x2e16=['DATE','sequelize','account','agent','queue'];(function(_0x51839b,_0x4bc65b){var _0x3b7f14=function(_0x160115){while(--_0x160115){_0x51839b['push'](_0x51839b['shift']());}};_0x3b7f14(++_0x4bc65b);}(_0x2e16,0x8d));var _0x62e1=function(_0x9829d7,_0x30bc84){_0x9829d7=_0x9829d7-0x0;var _0xb0f9ae=_0x2e16[_0x9829d7];return _0xb0f9ae;};'use strict';var Sequelize=require(_0x62e1('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x62e1('0x1'),_0x62e1('0x2'),_0x62e1('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x62e1('0x4')]}}; \ No newline at end of file +var _0xffe1=['DATE','sequelize','exports','ENUM','agent'];(function(_0x4bd488,_0x31bf66){var _0x48e05a=function(_0x25b183){while(--_0x25b183){_0x4bd488['push'](_0x4bd488['shift']());}};_0x48e05a(++_0x31bf66);}(_0xffe1,0x187));var _0x1ffe=function(_0x56ef3f,_0x1eaa98){_0x56ef3f=_0x56ef3f-0x0;var _0x9cbf2a=_0xffe1[_0x56ef3f];return _0x9cbf2a;};'use strict';var Sequelize=require(_0x1ffe('0x0'));module[_0x1ffe('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1ffe('0x2')]('account',_0x1ffe('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x1ffe('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 9b67c5a..fa0a213 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 _0x1dcd=['name','send','index','map','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','WhatsappTransferReport','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack'];(function(_0x1f51b7,_0x2c131c){var _0x4b26a4=function(_0x3c83a9){while(--_0x3c83a9){_0x1f51b7['push'](_0x1f51b7['shift']());}};_0x4b26a4(++_0x2c131c);}(_0x1dcd,0x100));var _0xd1dc=function(_0x3d53c3,_0x581fb0){_0x3d53c3=_0x3d53c3-0x0;var _0x136e69=_0x1dcd[_0x3d53c3];return _0x136e69;};'use strict';var emlformat=require(_0xd1dc('0x0'));var rimraf=require(_0xd1dc('0x1'));var zipdir=require(_0xd1dc('0x2'));var jsonpatch=require(_0xd1dc('0x3'));var rp=require(_0xd1dc('0x4'));var moment=require(_0xd1dc('0x5'));var BPromise=require(_0xd1dc('0x6'));var Mustache=require('mustache');var util=require(_0xd1dc('0x7'));var path=require(_0xd1dc('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd1dc('0x9'));var _=require('lodash');var squel=require(_0xd1dc('0xa'));var crypto=require(_0xd1dc('0xb'));var jsforce=require(_0xd1dc('0xc'));var deskjs=require(_0xd1dc('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd1dc('0xe'));var Papa=require(_0xd1dc('0xf'));var Redis=require(_0xd1dc('0x10'));var authService=require(_0xd1dc('0x11'));var qs=require(_0xd1dc('0x12'));var as=require(_0xd1dc('0x13'));var hardwareService=require(_0xd1dc('0x14'));var logger=require(_0xd1dc('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd1dc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd1dc('0x17'))['db'];function respondWithStatusCode(_0x3f9f70,_0x2bb880){_0x2bb880=_0x2bb880||0xcc;return function(_0x3c9158){if(_0x3c9158){return _0x3f9f70[_0xd1dc('0x18')](_0x2bb880);}return _0x3f9f70[_0xd1dc('0x19')](_0x2bb880)[_0xd1dc('0x1a')]();};}function respondWithResult(_0x5a6788,_0x2e56e5){_0x2e56e5=_0x2e56e5||0xc8;return function(_0x342dd5){if(_0x342dd5){return _0x5a6788[_0xd1dc('0x19')](_0x2e56e5)[_0xd1dc('0x1b')](_0x342dd5);}};}function respondWithFilteredResult(_0x2b80ce,_0x10b744){return function(_0xfcea49){if(_0xfcea49){var _0x3f9f69=typeof _0x10b744[_0xd1dc('0x1c')]===_0xd1dc('0x1d')&&typeof _0x10b744['limit']===_0xd1dc('0x1d');var _0x400446=_0xfcea49[_0xd1dc('0x1e')];var _0x2ae51e=_0x3f9f69?0x0:_0x10b744[_0xd1dc('0x1c')];var _0x1a24ed=_0x3f9f69?_0xfcea49[_0xd1dc('0x1e')]:_0x10b744[_0xd1dc('0x1c')]+_0x10b744[_0xd1dc('0x1f')];var _0x4cf6b7;if(_0x1a24ed>=_0x400446){_0x1a24ed=_0x400446;_0x4cf6b7=0xc8;}else{_0x4cf6b7=0xce;}_0x2b80ce[_0xd1dc('0x19')](_0x4cf6b7);return _0x2b80ce[_0xd1dc('0x20')](_0xd1dc('0x21'),_0x2ae51e+'-'+_0x1a24ed+'/'+_0x400446)[_0xd1dc('0x1b')](_0xfcea49);}return null;};}function patchUpdates(_0x235cca){return function(_0x378863){try{jsonpatch[_0xd1dc('0x22')](_0x378863,_0x235cca,!![]);}catch(_0x1dda67){return BPromise[_0xd1dc('0x23')](_0x1dda67);}return _0x378863['save']();};}function saveUpdates(_0x382630,_0x3e457d){return function(_0x1a09ae){if(_0x1a09ae){return _0x1a09ae[_0xd1dc('0x24')](_0x382630)[_0xd1dc('0x25')](function(_0x2aff4e){return _0x2aff4e;});}return null;};}function removeEntity(_0x322ca6,_0x1be746){return function(_0x3213f7){if(_0x3213f7){return _0x3213f7[_0xd1dc('0x26')]()[_0xd1dc('0x25')](function(){_0x322ca6[_0xd1dc('0x19')](0xcc)[_0xd1dc('0x1a')]();});}};}function handleEntityNotFound(_0x295e1d,_0xac1ee1){return function(_0x2b2ed6){if(!_0x2b2ed6){_0x295e1d[_0xd1dc('0x18')](0x194);}return _0x2b2ed6;};}function handleError(_0x572e0b,_0x370b8f){_0x370b8f=_0x370b8f||0x1f4;return function(_0x312167){logger['error'](_0x312167[_0xd1dc('0x27')]);if(_0x312167[_0xd1dc('0x28')]){delete _0x312167[_0xd1dc('0x28')];}_0x572e0b[_0xd1dc('0x19')](_0x370b8f)[_0xd1dc('0x29')](_0x312167);};}exports[_0xd1dc('0x2a')]=function(_0x2ff59c,_0x41ff4b){var _0x3632e3={},_0x5d0f3e={},_0x2a0a39={'count':0x0,'rows':[]};var _0x485d0c=_[_0xd1dc('0x2b')](db['WhatsappTransferReport']['rawAttributes'],function(_0x31d088){return{'name':_0x31d088[_0xd1dc('0x2c')],'type':_0x31d088[_0xd1dc('0x2d')]['key']};});_0x5d0f3e[_0xd1dc('0x2e')]=_[_0xd1dc('0x2b')](_0x485d0c,_0xd1dc('0x28'));_0x5d0f3e['query']=_[_0xd1dc('0x2f')](_0x2ff59c['query']);_0x5d0f3e[_0xd1dc('0x30')]=_['intersection'](_0x5d0f3e[_0xd1dc('0x2e')],_0x5d0f3e[_0xd1dc('0x31')]);_0x3632e3[_0xd1dc('0x32')]=_[_0xd1dc('0x33')](_0x5d0f3e[_0xd1dc('0x2e')],qs[_0xd1dc('0x34')](_0x2ff59c[_0xd1dc('0x31')][_0xd1dc('0x34')]));_0x3632e3[_0xd1dc('0x32')]=_0x3632e3[_0xd1dc('0x32')][_0xd1dc('0x35')]?_0x3632e3[_0xd1dc('0x32')]:_0x5d0f3e[_0xd1dc('0x2e')];if(!_0x2ff59c[_0xd1dc('0x31')][_0xd1dc('0x36')]('nolimit')){_0x3632e3['limit']=qs[_0xd1dc('0x1f')](_0x2ff59c[_0xd1dc('0x31')]['limit']);_0x3632e3[_0xd1dc('0x1c')]=qs['offset'](_0x2ff59c[_0xd1dc('0x31')]['offset']);}_0x3632e3['order']=qs[_0xd1dc('0x37')](_0x2ff59c[_0xd1dc('0x31')][_0xd1dc('0x37')]);_0x3632e3[_0xd1dc('0x38')]=qs['filters'](_[_0xd1dc('0x39')](_0x2ff59c[_0xd1dc('0x31')],_0x5d0f3e[_0xd1dc('0x30')]),_0x485d0c);if(_0x2ff59c[_0xd1dc('0x31')]['filter']){_0x3632e3[_0xd1dc('0x38')]=_['merge'](_0x3632e3['where'],{'$or':_[_0xd1dc('0x2b')](_0x485d0c,function(_0x422a07){if(_0x422a07[_0xd1dc('0x2d')]!==_0xd1dc('0x3a')){var _0x1821a7={};_0x1821a7[_0x422a07[_0xd1dc('0x28')]]={'$like':'%'+_0x2ff59c[_0xd1dc('0x31')][_0xd1dc('0x3b')]+'%'};return _0x1821a7;}})});}_0x3632e3=_[_0xd1dc('0x3c')]({},_0x3632e3,_0x2ff59c[_0xd1dc('0x3d')]);var _0x38c7bf={'where':_0x3632e3[_0xd1dc('0x38')]};return db[_0xd1dc('0x3e')][_0xd1dc('0x1e')](_0x38c7bf)['then'](function(_0x90857b){_0x2a0a39[_0xd1dc('0x1e')]=_0x90857b;if(_0x2ff59c['query'][_0xd1dc('0x3f')]){_0x3632e3[_0xd1dc('0x40')]=[{'all':!![]}];}return db[_0xd1dc('0x3e')][_0xd1dc('0x41')](_0x3632e3);})['then'](function(_0x558a39){_0x2a0a39[_0xd1dc('0x42')]=_0x558a39;return _0x2a0a39;})[_0xd1dc('0x25')](respondWithFilteredResult(_0x41ff4b,_0x3632e3))[_0xd1dc('0x43')](handleError(_0x41ff4b,null));};exports['show']=function(_0x732d70,_0x14023f){var _0xd13a15={'raw':!![],'where':{'id':_0x732d70[_0xd1dc('0x44')]['id']}},_0x2db11d={};_0x2db11d[_0xd1dc('0x2e')]=_[_0xd1dc('0x2f')](db[_0xd1dc('0x3e')][_0xd1dc('0x45')]);_0x2db11d['query']=_[_0xd1dc('0x2f')](_0x732d70['query']);_0x2db11d[_0xd1dc('0x30')]=_['intersection'](_0x2db11d[_0xd1dc('0x2e')],_0x2db11d[_0xd1dc('0x31')]);_0xd13a15['attributes']=_[_0xd1dc('0x33')](_0x2db11d[_0xd1dc('0x2e')],qs[_0xd1dc('0x34')](_0x732d70[_0xd1dc('0x31')][_0xd1dc('0x34')]));_0xd13a15[_0xd1dc('0x32')]=_0xd13a15[_0xd1dc('0x32')][_0xd1dc('0x35')]?_0xd13a15[_0xd1dc('0x32')]:_0x2db11d[_0xd1dc('0x2e')];if(_0x732d70[_0xd1dc('0x31')][_0xd1dc('0x3f')]){_0xd13a15[_0xd1dc('0x40')]=[{'all':!![]}];}_0xd13a15=_[_0xd1dc('0x3c')]({},_0xd13a15,_0x732d70['options']);return db[_0xd1dc('0x3e')][_0xd1dc('0x46')](_0xd13a15)[_0xd1dc('0x25')](handleEntityNotFound(_0x14023f,null))[_0xd1dc('0x25')](respondWithResult(_0x14023f,null))[_0xd1dc('0x43')](handleError(_0x14023f,null));};exports[_0xd1dc('0x47')]=function(_0x54d005,_0x67be0a){return db['WhatsappTransferReport'][_0xd1dc('0x47')](_0x54d005[_0xd1dc('0x48')],{})[_0xd1dc('0x25')](respondWithResult(_0x67be0a,0xc9))[_0xd1dc('0x43')](handleError(_0x67be0a,null));};exports[_0xd1dc('0x24')]=function(_0x6142a4,_0x4558d3){if(_0x6142a4[_0xd1dc('0x48')]['id']){delete _0x6142a4[_0xd1dc('0x48')]['id'];}return db[_0xd1dc('0x3e')]['find']({'where':{'id':_0x6142a4[_0xd1dc('0x44')]['id']}})[_0xd1dc('0x25')](handleEntityNotFound(_0x4558d3,null))[_0xd1dc('0x25')](saveUpdates(_0x6142a4[_0xd1dc('0x48')],null))[_0xd1dc('0x25')](respondWithResult(_0x4558d3,null))[_0xd1dc('0x43')](handleError(_0x4558d3,null));};exports['destroy']=function(_0x341e61,_0x5be695){return db[_0xd1dc('0x3e')][_0xd1dc('0x46')]({'where':{'id':_0x341e61[_0xd1dc('0x44')]['id']}})[_0xd1dc('0x25')](handleEntityNotFound(_0x5be695,null))[_0xd1dc('0x25')](removeEntity(_0x5be695,null))['catch'](handleError(_0x5be695,null));};exports[_0xd1dc('0x49')]=function(_0x68e6c,_0x247eea){return db[_0xd1dc('0x3e')][_0xd1dc('0x49')]()[_0xd1dc('0x25')](respondWithResult(_0x247eea,null))[_0xd1dc('0x43')](handleError(_0x247eea,null));}; \ No newline at end of file +var _0x3f74=['querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','WhatsappTransferReport','fieldName','type','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','squel','jsforce','desk.js','to-csv'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_0x3f74,0x121));var _0x43f7=function(_0x5f4b1c,_0x552a66){_0x5f4b1c=_0x5f4b1c-0x0;var _0x3ee292=_0x3f74[_0x5f4b1c];return _0x3ee292;};'use strict';var emlformat=require(_0x43f7('0x0'));var rimraf=require(_0x43f7('0x1'));var zipdir=require(_0x43f7('0x2'));var jsonpatch=require(_0x43f7('0x3'));var rp=require(_0x43f7('0x4'));var moment=require(_0x43f7('0x5'));var BPromise=require(_0x43f7('0x6'));var Mustache=require(_0x43f7('0x7'));var util=require('util');var path=require(_0x43f7('0x8'));var sox=require(_0x43f7('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43f7('0xa'));var _=require('lodash');var squel=require(_0x43f7('0xb'));var crypto=require('crypto');var jsforce=require(_0x43f7('0xc'));var deskjs=require(_0x43f7('0xd'));var toCsv=require(_0x43f7('0xe'));var querystring=require(_0x43f7('0xf'));var Papa=require(_0x43f7('0x10'));var Redis=require('ioredis');var authService=require(_0x43f7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x43f7('0x12'));var hardwareService=require(_0x43f7('0x13'));var logger=require('../../config/logger')(_0x43f7('0x14'));var utils=require(_0x43f7('0x15'));var config=require(_0x43f7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x43f7('0x17'))['db'];function respondWithStatusCode(_0x3402c1,_0x227050){_0x227050=_0x227050||0xcc;return function(_0x14abd8){if(_0x14abd8){return _0x3402c1[_0x43f7('0x18')](_0x227050);}return _0x3402c1[_0x43f7('0x19')](_0x227050)[_0x43f7('0x1a')]();};}function respondWithResult(_0x17d588,_0x2680c7){_0x2680c7=_0x2680c7||0xc8;return function(_0x1ba361){if(_0x1ba361){return _0x17d588[_0x43f7('0x19')](_0x2680c7)[_0x43f7('0x1b')](_0x1ba361);}};}function respondWithFilteredResult(_0x38a060,_0x201273){return function(_0x1775b5){if(_0x1775b5){var _0x2316fa=typeof _0x201273[_0x43f7('0x1c')]===_0x43f7('0x1d')&&typeof _0x201273['limit']===_0x43f7('0x1d');var _0x5a558e=_0x1775b5['count'];var _0x3d8571=_0x2316fa?0x0:_0x201273['offset'];var _0x44380f=_0x2316fa?_0x1775b5[_0x43f7('0x1e')]:_0x201273[_0x43f7('0x1c')]+_0x201273[_0x43f7('0x1f')];var _0x294dce;if(_0x44380f>=_0x5a558e){_0x44380f=_0x5a558e;_0x294dce=0xc8;}else{_0x294dce=0xce;}_0x38a060['status'](_0x294dce);return _0x38a060[_0x43f7('0x20')](_0x43f7('0x21'),_0x3d8571+'-'+_0x44380f+'/'+_0x5a558e)['json'](_0x1775b5);}return null;};}function patchUpdates(_0x320317){return function(_0x4c5727){try{jsonpatch[_0x43f7('0x22')](_0x4c5727,_0x320317,!![]);}catch(_0x246e06){return BPromise[_0x43f7('0x23')](_0x246e06);}return _0x4c5727[_0x43f7('0x24')]();};}function saveUpdates(_0x4185c0,_0x4528bc){return function(_0x1d15e9){if(_0x1d15e9){return _0x1d15e9[_0x43f7('0x25')](_0x4185c0)[_0x43f7('0x26')](function(_0x422bbd){return _0x422bbd;});}return null;};}function removeEntity(_0x3bdb19,_0x4e6e98){return function(_0x313965){if(_0x313965){return _0x313965[_0x43f7('0x27')]()[_0x43f7('0x26')](function(){_0x3bdb19[_0x43f7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d7b3a,_0x4cdc92){return function(_0x173cf9){if(!_0x173cf9){_0x2d7b3a[_0x43f7('0x18')](0x194);}return _0x173cf9;};}function handleError(_0x39f2a6,_0x235cbc){_0x235cbc=_0x235cbc||0x1f4;return function(_0x339775){logger[_0x43f7('0x28')](_0x339775[_0x43f7('0x29')]);if(_0x339775[_0x43f7('0x2a')]){delete _0x339775[_0x43f7('0x2a')];}_0x39f2a6[_0x43f7('0x19')](_0x235cbc)[_0x43f7('0x2b')](_0x339775);};}exports[_0x43f7('0x2c')]=function(_0x4819b1,_0xf1e837){var _0x1bdd3c={},_0x16f48c={},_0x4472cc={'count':0x0,'rows':[]};var _0x79fae=_['map'](db[_0x43f7('0x2d')]['rawAttributes'],function(_0x5385e8){return{'name':_0x5385e8[_0x43f7('0x2e')],'type':_0x5385e8[_0x43f7('0x2f')]['key']};});_0x16f48c['model']=_[_0x43f7('0x30')](_0x79fae,_0x43f7('0x2a'));_0x16f48c[_0x43f7('0x31')]=_[_0x43f7('0x32')](_0x4819b1[_0x43f7('0x31')]);_0x16f48c[_0x43f7('0x33')]=_[_0x43f7('0x34')](_0x16f48c['model'],_0x16f48c[_0x43f7('0x31')]);_0x1bdd3c[_0x43f7('0x35')]=_[_0x43f7('0x34')](_0x16f48c[_0x43f7('0x36')],qs[_0x43f7('0x37')](_0x4819b1[_0x43f7('0x31')]['fields']));_0x1bdd3c[_0x43f7('0x35')]=_0x1bdd3c[_0x43f7('0x35')][_0x43f7('0x38')]?_0x1bdd3c[_0x43f7('0x35')]:_0x16f48c[_0x43f7('0x36')];if(!_0x4819b1[_0x43f7('0x31')][_0x43f7('0x39')]('nolimit')){_0x1bdd3c[_0x43f7('0x1f')]=qs[_0x43f7('0x1f')](_0x4819b1['query']['limit']);_0x1bdd3c['offset']=qs[_0x43f7('0x1c')](_0x4819b1['query'][_0x43f7('0x1c')]);}_0x1bdd3c[_0x43f7('0x3a')]=qs[_0x43f7('0x3b')](_0x4819b1[_0x43f7('0x31')]['sort']);_0x1bdd3c[_0x43f7('0x3c')]=qs[_0x43f7('0x33')](_[_0x43f7('0x3d')](_0x4819b1[_0x43f7('0x31')],_0x16f48c[_0x43f7('0x33')]),_0x79fae);if(_0x4819b1[_0x43f7('0x31')][_0x43f7('0x3e')]){_0x1bdd3c[_0x43f7('0x3c')]=_[_0x43f7('0x3f')](_0x1bdd3c[_0x43f7('0x3c')],{'$or':_[_0x43f7('0x30')](_0x79fae,function(_0x23712d){if(_0x23712d[_0x43f7('0x2f')]!==_0x43f7('0x40')){var _0x822a8c={};_0x822a8c[_0x23712d[_0x43f7('0x2a')]]={'$like':'%'+_0x4819b1[_0x43f7('0x31')][_0x43f7('0x3e')]+'%'};return _0x822a8c;}})});}_0x1bdd3c=_['merge']({},_0x1bdd3c,_0x4819b1['options']);var _0x13f21b={'where':_0x1bdd3c[_0x43f7('0x3c')]};return db['WhatsappTransferReport'][_0x43f7('0x1e')](_0x13f21b)[_0x43f7('0x26')](function(_0x338538){_0x4472cc['count']=_0x338538;if(_0x4819b1[_0x43f7('0x31')][_0x43f7('0x41')]){_0x1bdd3c[_0x43f7('0x42')]=[{'all':!![]}];}return db[_0x43f7('0x2d')][_0x43f7('0x43')](_0x1bdd3c);})[_0x43f7('0x26')](function(_0x1096f3){_0x4472cc[_0x43f7('0x44')]=_0x1096f3;return _0x4472cc;})[_0x43f7('0x26')](respondWithFilteredResult(_0xf1e837,_0x1bdd3c))[_0x43f7('0x45')](handleError(_0xf1e837,null));};exports['show']=function(_0x207654,_0x3e459f){var _0x28c3dc={'raw':!![],'where':{'id':_0x207654[_0x43f7('0x46')]['id']}},_0x2eff54={};_0x2eff54[_0x43f7('0x36')]=_['keys'](db[_0x43f7('0x2d')][_0x43f7('0x47')]);_0x2eff54[_0x43f7('0x31')]=_[_0x43f7('0x32')](_0x207654[_0x43f7('0x31')]);_0x2eff54[_0x43f7('0x33')]=_[_0x43f7('0x34')](_0x2eff54[_0x43f7('0x36')],_0x2eff54[_0x43f7('0x31')]);_0x28c3dc[_0x43f7('0x35')]=_[_0x43f7('0x34')](_0x2eff54['model'],qs['fields'](_0x207654[_0x43f7('0x31')][_0x43f7('0x37')]));_0x28c3dc[_0x43f7('0x35')]=_0x28c3dc[_0x43f7('0x35')][_0x43f7('0x38')]?_0x28c3dc[_0x43f7('0x35')]:_0x2eff54[_0x43f7('0x36')];if(_0x207654['query'][_0x43f7('0x41')]){_0x28c3dc[_0x43f7('0x42')]=[{'all':!![]}];}_0x28c3dc=_['merge']({},_0x28c3dc,_0x207654['options']);return db[_0x43f7('0x2d')][_0x43f7('0x48')](_0x28c3dc)[_0x43f7('0x26')](handleEntityNotFound(_0x3e459f,null))[_0x43f7('0x26')](respondWithResult(_0x3e459f,null))[_0x43f7('0x45')](handleError(_0x3e459f,null));};exports[_0x43f7('0x49')]=function(_0xd9685d,_0x177135){return db['WhatsappTransferReport'][_0x43f7('0x49')](_0xd9685d[_0x43f7('0x4a')],{})[_0x43f7('0x26')](respondWithResult(_0x177135,0xc9))['catch'](handleError(_0x177135,null));};exports[_0x43f7('0x25')]=function(_0x22c83,_0x490607){if(_0x22c83[_0x43f7('0x4a')]['id']){delete _0x22c83['body']['id'];}return db[_0x43f7('0x2d')][_0x43f7('0x48')]({'where':{'id':_0x22c83['params']['id']}})[_0x43f7('0x26')](handleEntityNotFound(_0x490607,null))[_0x43f7('0x26')](saveUpdates(_0x22c83[_0x43f7('0x4a')],null))['then'](respondWithResult(_0x490607,null))[_0x43f7('0x45')](handleError(_0x490607,null));};exports[_0x43f7('0x27')]=function(_0x4df844,_0x5a394f){return db[_0x43f7('0x2d')]['find']({'where':{'id':_0x4df844[_0x43f7('0x46')]['id']}})[_0x43f7('0x26')](handleEntityNotFound(_0x5a394f,null))[_0x43f7('0x26')](removeEntity(_0x5a394f,null))[_0x43f7('0x45')](handleError(_0x5a394f,null));};exports[_0x43f7('0x4b')]=function(_0x7b735c,_0x19fffd){return db[_0x43f7('0x2d')][_0x43f7('0x4b')]()[_0x43f7('0x26')](respondWithResult(_0x19fffd,null))[_0x43f7('0x45')](handleError(_0x19fffd,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index c37bc7d..c47d430 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 _0x91d0=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','../../config/logger'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x91d0,0xef));var _0x091d=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x91d0[_0x5e6ea3];return _0x4048b5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x091d('0x0'))(_0x091d('0x1'));var moment=require(_0x091d('0x2'));var BPromise=require('bluebird');var rp=require(_0x091d('0x3'));var fs=require('fs');var path=require(_0x091d('0x4'));var rimraf=require(_0x091d('0x5'));var config=require(_0x091d('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0x091d('0x7')]=function(_0x46a08a,_0x4f441c){return _0x46a08a[_0x091d('0x8')](_0x091d('0x9'),attributes,{'tableName':_0x091d('0xa'),'paranoid':![],'indexes':[{'name':_0x091d('0xb'),'fields':[_0x091d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x12c8=['util','api','moment','bluebird','request-promise','path','rimraf','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash'];(function(_0x8e7ca9,_0x2a8b26){var _0x4150a9=function(_0x5b2f1f){while(--_0x5b2f1f){_0x8e7ca9['push'](_0x8e7ca9['shift']());}};_0x4150a9(++_0x2a8b26);}(_0x12c8,0x16b));var _0x812c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12c8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x812c('0x0'));var util=require(_0x812c('0x1'));var logger=require('../../config/logger')(_0x812c('0x2'));var moment=require(_0x812c('0x3'));var BPromise=require(_0x812c('0x4'));var rp=require(_0x812c('0x5'));var fs=require('fs');var path=require(_0x812c('0x6'));var rimraf=require(_0x812c('0x7'));var config=require('../../config/environment');var attributes=require(_0x812c('0x8'));module['exports']=function(_0x4c027e,_0x24fd0c){return _0x4c027e[_0x812c('0x9')](_0x812c('0xa'),attributes,{'tableName':_0x812c('0xb'),'paranoid':![],'indexes':[{'name':_0x812c('0xc'),'fields':[_0x812c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 472d3ae..85eed51 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 _0x6af9=['then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x30fa61,_0x5df30f){var _0x5921f5=function(_0x7730ba){while(--_0x7730ba){_0x30fa61['push'](_0x30fa61['shift']());}};_0x5921f5(++_0x5df30f);}(_0x6af9,0x136));var _0x96af=function(_0x29daf9,_0x4b5366){_0x29daf9=_0x29daf9-0x0;var _0x2bf8a7=_0x6af9[_0x29daf9];return _0x2bf8a7;};'use strict';var _=require(_0x96af('0x0'));var util=require('util');var moment=require(_0x96af('0x1'));var BPromise=require(_0x96af('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96af('0x3'));var db=require(_0x96af('0x4'))['db'];var utils=require(_0x96af('0x5'));var logger=require(_0x96af('0x6'))(_0x96af('0x7'));var config=require(_0x96af('0x8'));var jayson=require(_0x96af('0x9'));var client=jayson['client'][_0x96af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bde3a,_0x55d55a,_0x5f5cbf){return new BPromise(function(_0x383515,_0x81529a){return client[_0x96af('0xb')](_0x3bde3a,_0x5f5cbf)[_0x96af('0xc')](function(_0x56825e){logger[_0x96af('0xd')](_0x96af('0xe'),_0x55d55a,_0x96af('0xf'));logger[_0x96af('0x10')](_0x96af('0x11'),_0x55d55a,_0x96af('0xf'),JSON[_0x96af('0x12')](_0x56825e));if(_0x56825e[_0x96af('0x13')]){if(_0x56825e[_0x96af('0x13')][_0x96af('0x14')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x55d55a,_0x56825e[_0x96af('0x13')]['message']);return _0x81529a(_0x56825e[_0x96af('0x13')]['message']);}logger['error'](_0x96af('0xe'),_0x55d55a,_0x56825e['error'][_0x96af('0x15')]);return _0x383515(_0x56825e['error']['message']);}else{logger[_0x96af('0xd')](_0x96af('0xe'),_0x55d55a,_0x96af('0xf'));_0x383515(_0x56825e[_0x96af('0x16')][_0x96af('0x15')]);}})['catch'](function(_0x358cc1){logger[_0x96af('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x55d55a,_0x358cc1);_0x81529a(_0x358cc1);});});} \ No newline at end of file +var _0x4d41=['client','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x208d39,_0x5de94f){var _0x3f96cb=function(_0x23d510){while(--_0x23d510){_0x208d39['push'](_0x208d39['shift']());}};_0x3f96cb(++_0x5de94f);}(_0x4d41,0x1c5));var _0x14d4=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0x4d41[_0x10791d];return _0x1b4f9c;};'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(_0x14d4('0x0'));var db=require(_0x14d4('0x1'))['db'];var utils=require(_0x14d4('0x2'));var logger=require(_0x14d4('0x3'))(_0x14d4('0x4'));var config=require(_0x14d4('0x5'));var jayson=require(_0x14d4('0x6'));var client=jayson[_0x14d4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eedc1,_0x5c34d9,_0x32557d){return new BPromise(function(_0x1859a9,_0x4dbb28){return client[_0x14d4('0x8')](_0x3eedc1,_0x32557d)['then'](function(_0x450208){logger[_0x14d4('0x9')](_0x14d4('0xa'),_0x5c34d9,_0x14d4('0xb'));logger[_0x14d4('0xc')](_0x14d4('0xd'),_0x5c34d9,_0x14d4('0xb'),JSON[_0x14d4('0xe')](_0x450208));if(_0x450208['error']){if(_0x450208[_0x14d4('0xf')][_0x14d4('0x10')]===0x1f4){logger[_0x14d4('0xf')](_0x14d4('0xa'),_0x5c34d9,_0x450208[_0x14d4('0xf')]['message']);return _0x4dbb28(_0x450208['error'][_0x14d4('0x11')]);}logger[_0x14d4('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5c34d9,_0x450208['error'][_0x14d4('0x11')]);return _0x1859a9(_0x450208[_0x14d4('0xf')][_0x14d4('0x11')]);}else{logger[_0x14d4('0x9')](_0x14d4('0xa'),_0x5c34d9,'request\x20sent');_0x1859a9(_0x450208[_0x14d4('0x12')][_0x14d4('0x11')]);}})[_0x14d4('0x13')](function(_0x4fbab1){logger[_0x14d4('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5c34d9,_0x4fbab1);_0x4dbb28(_0x4fbab1);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index d7b7461..a0f9be8 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa0ba=['listen','info','start','Online\x20apps:','map','online','join','Offline\x20apps:','filter','name','None','./config/seedDB','catch','error','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then'];(function(_0x243dc5,_0x51707c){var _0x40896a=function(_0x40cd50){while(--_0x40cd50){_0x243dc5['push'](_0x243dc5['shift']());}};_0x40896a(++_0x51707c);}(_0xa0ba,0xf7));var _0xaa0b=function(_0xfec4f2,_0x27b2aa){_0xfec4f2=_0xfec4f2-0x0;var _0x4ee052=_0xa0ba[_0xfec4f2];return _0x4ee052;};'use strict';var _=require(_0xaa0b('0x0'));var mysqldb=require(_0xaa0b('0x1'));var rpc=require(_0xaa0b('0x2'));var config=require(_0xaa0b('0x3'));var logger=require(_0xaa0b('0x4'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0xaa0b('0x5'));var schedule=require(_0xaa0b('0x6'));var chat=require(_0xaa0b('0x7'));var whatsapp=require(_0xaa0b('0x8'));var transcribe=require(_0xaa0b('0x9'));var provider=require(_0xaa0b('0xa'));function main(){return mysqldb['db'][_0xaa0b('0xb')][_0xaa0b('0xc')]()[_0xaa0b('0xd')](function(){return rpc[_0xaa0b('0xe')]();})['then'](function(_0x4346e1){logger[_0xaa0b('0xf')](_0x4346e1);return chat['start']();})[_0xaa0b('0xd')](function(){return whatsapp['start']();})[_0xaa0b('0xd')](function(){return schedule['start']();})['then'](function(){return transcribe['start']();})[_0xaa0b('0xd')](function(){return provider[_0xaa0b('0x10')]();})[_0xaa0b('0xd')](function(_0x478c07){logger[_0xaa0b('0xf')](_0x478c07);return pm2[_0xaa0b('0x10')](pm2Config);})['then'](function(_0x1f0709){logger['info'](_0xaa0b('0x11'),_[_0xaa0b('0x12')](_['filter'](_0x1f0709,{'status':_0xaa0b('0x13')}),'name')[_0xaa0b('0x14')]());logger['info'](_0xaa0b('0x15'),_[_0xaa0b('0x12')](_[_0xaa0b('0x16')](_0x1f0709,function(_0x1779c6){return _0x1779c6['status']!==_0xaa0b('0x13');}),_0xaa0b('0x17'))[_0xaa0b('0x14')]()||_0xaa0b('0x18'));config['seedDB']&&require(_0xaa0b('0x19'))['default']();require('./config/license')['default']();})[_0xaa0b('0x1a')](function(_0x5b399b){logger[_0xaa0b('0x1b')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x5b399b);process[_0xaa0b('0x1c')](0x1);});}main(); \ No newline at end of file +var _0x3cb2=['online','name','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','sync','then','listen','info','start','Online\x20apps:','map','filter'];(function(_0x1f47d9,_0x3f26e7){var _0x1f3ccd=function(_0x1bf9fa){while(--_0x1bf9fa){_0x1f47d9['push'](_0x1f47d9['shift']());}};_0x1f3ccd(++_0x3f26e7);}(_0x3cb2,0xf6));var _0x23cb=function(_0x5458a6,_0x1688c5){_0x5458a6=_0x5458a6-0x0;var _0x2669fc=_0x3cb2[_0x5458a6];return _0x2669fc;};'use strict';var _=require(_0x23cb('0x0'));var mysqldb=require('./mysqldb');var rpc=require('./rpc');var config=require(_0x23cb('0x1'));var logger=require('./config/logger')(_0x23cb('0x2'));var pm2=require(_0x23cb('0x3'));var pm2Config=require(_0x23cb('0x4'));var schedule=require(_0x23cb('0x5'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x23cb('0x6'));var transcribe=require('./config/schedule/transcribe');var provider=require('./config/schedule/cloud-provider');function main(){return mysqldb['db']['sequelize'][_0x23cb('0x7')]()[_0x23cb('0x8')](function(){return rpc[_0x23cb('0x9')]();})[_0x23cb('0x8')](function(_0x1fca2a){logger[_0x23cb('0xa')](_0x1fca2a);return chat[_0x23cb('0xb')]();})[_0x23cb('0x8')](function(){return whatsapp[_0x23cb('0xb')]();})[_0x23cb('0x8')](function(){return schedule[_0x23cb('0xb')]();})[_0x23cb('0x8')](function(){return transcribe['start']();})[_0x23cb('0x8')](function(){return provider[_0x23cb('0xb')]();})[_0x23cb('0x8')](function(_0x3af07c){logger[_0x23cb('0xa')](_0x3af07c);return pm2[_0x23cb('0xb')](pm2Config);})[_0x23cb('0x8')](function(_0x1afc71){logger[_0x23cb('0xa')](_0x23cb('0xc'),_[_0x23cb('0xd')](_[_0x23cb('0xe')](_0x1afc71,{'status':_0x23cb('0xf')}),_0x23cb('0x10'))[_0x23cb('0x11')]());logger[_0x23cb('0xa')](_0x23cb('0x12'),_[_0x23cb('0xd')](_[_0x23cb('0xe')](_0x1afc71,function(_0x32bb89){return _0x32bb89[_0x23cb('0x13')]!==_0x23cb('0xf');}),_0x23cb('0x10'))[_0x23cb('0x11')]()||_0x23cb('0x14'));config[_0x23cb('0x15')]&&require(_0x23cb('0x16'))[_0x23cb('0x17')]();require(_0x23cb('0x18'))[_0x23cb('0x17')]();})[_0x23cb('0x19')](function(_0x2bef59){logger[_0x23cb('0x1a')](_0x23cb('0x1b'),_0x2bef59);process[_0x23cb('0x1c')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index f5b8353..f3743f9 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 _0xb323=['authorization','startsWith','Basic','find','authenticate','pass','json','Wrong\x20credentials.','user','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','sub','Setting','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','validatePasswordHistory','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','decryptString','length','splice','unshift','encryptString','join','payload','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','internal','email','userpic','permissions','md5secret','voicePause','chatPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','findOne','closed','disposition','then','status','unmanaged','Unmanaged.','headers'];(function(_0x542305,_0x331f9d){var _0xe21aa9=function(_0x22f7cd){while(--_0x22f7cd){_0x542305['push'](_0x542305['shift']());}};_0xe21aa9(++_0x331f9d);}(_0xb323,0x14c));var _0x3b32=function(_0x556a16,_0x1de76c){_0x556a16=_0x556a16-0x0;var _0x42fb08=_0xb323[_0x556a16];return _0x42fb08;};'use strict';var db=require(_0x3b32('0x0'))['db'];var config=require(_0x3b32('0x1'));var hardwareConf=require(_0x3b32('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0x3b32('0x3'));var jwt=require(_0x3b32('0x4'));var expressJwt=require(_0x3b32('0x5'));var compose=require(_0x3b32('0x6'));var basicAuth=require(_0x3b32('0x7'));var crypto=require(_0x3b32('0x8'));var BPromise=require(_0x3b32('0x9'));var util=require(_0x3b32('0xa'));var moment=require(_0x3b32('0xb'));var validateJwt=expressJwt({'secret':config[_0x3b32('0xc')][_0x3b32('0xd')]});var userAttributes=['id',_0x3b32('0xe'),'fullname','name',_0x3b32('0xf'),_0x3b32('0x10'),_0x3b32('0x11'),_0x3b32('0x12'),_0x3b32('0x13'),_0x3b32('0x14'),_0x3b32('0x15'),'mailPause',_0x3b32('0x16'),'smsPause',_0x3b32('0x17'),_0x3b32('0x18'),_0x3b32('0x19'),_0x3b32('0x1a'),'lastPauseAt',_0x3b32('0x1b'),_0x3b32('0x1c'),_0x3b32('0x1d'),_0x3b32('0x1e'),_0x3b32('0x1f'),_0x3b32('0x20'),'phoneBarDnd',_0x3b32('0x21'),_0x3b32('0x22'),_0x3b32('0x23'),'phoneBarExpires',_0x3b32('0x24'),_0x3b32('0x25'),_0x3b32('0x26'),_0x3b32('0x27'),'interface','userProfileId',_0x3b32('0x28'),_0x3b32('0x29'),_0x3b32('0x2a'),_0x3b32('0x2b'),'downloadOmnichannelInteractions',_0x3b32('0x2c'),_0x3b32('0x2d'),_0x3b32('0x2e')];exports[_0x3b32('0x2f')]=function(){return this[_0x3b32('0x30')](!![])[_0x3b32('0x31')](function(_0x398c54,_0x4b11eb,_0x16cea4){if(_0x398c54['user']){_0x16cea4();}else{return db['ChatInteraction'][_0x3b32('0x32')]({'where':{'id':_0x398c54['params']['id']},'attributes':['id',_0x3b32('0x33'),_0x3b32('0x34')],'raw':!![]})[_0x3b32('0x35')](function(_0x180eb7){if(_0x180eb7&&_0x180eb7[_0x3b32('0x33')]){return _0x4b11eb[_0x3b32('0x36')](_0x180eb7[_0x3b32('0x34')]==='unmanaged'?0x195:0x193)['json']({'message':_0x180eb7[_0x3b32('0x34')]===_0x3b32('0x37')?_0x3b32('0x38'):'Forbidden.'});}else{_0x16cea4();}})['catch'](function(_0x3bf15c){_0x16cea4(_0x3bf15c);});}});};exports['isAuthenticated']=function isAuthenticated(_0x5d3849){return compose()[_0x3b32('0x31')](function(_0x27dfb4,_0x50bf9b,_0x538f54){var _0x40a106;if(_0x27dfb4[_0x3b32('0x39')][_0x3b32('0x3a')]){if(_[_0x3b32('0x3b')](_0x27dfb4[_0x3b32('0x39')][_0x3b32('0x3a')],_0x3b32('0x3c'))){var _0x2a6fb0=basicAuth(_0x27dfb4);db['User'][_0x3b32('0x3d')]({'where':{'name':_0x2a6fb0['name']}})[_0x3b32('0x35')](function(_0x18a6bd){if(!_0x18a6bd||!_0x18a6bd[_0x3b32('0x3e')](_0x2a6fb0[_0x3b32('0x3f')])){return _0x50bf9b['status'](0x191)[_0x3b32('0x40')]({'message':_0x3b32('0x41')});}_0x27dfb4[_0x3b32('0x42')]={'id':_0x18a6bd['id']};_0x538f54();})[_0x3b32('0x43')](function(_0x100915){_0x538f54(_0x100915);});}else if(_['startsWith'](_0x27dfb4[_0x3b32('0x39')][_0x3b32('0x3a')],_0x3b32('0x44'))){validateJwt(_0x27dfb4,_0x50bf9b,_0x538f54);}else{if(_0x5d3849){_0x538f54();}else{return _0x50bf9b[_0x3b32('0x36')](0x193)[_0x3b32('0x40')]({'message':_0x3b32('0x45')});}}}else if(_0x27dfb4[_0x3b32('0x46')][_0x3b32('0x47')]){try{var _0x6fac64={'audience':hardwareConf[_0x3b32('0x48')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x27dfb4[_0x3b32('0x46')][_0x3b32('0x47')],_0x6fac64)[_0x3b32('0x35')](function(_0x196073){return db[_0x3b32('0x49')][_0x3b32('0x3d')]({'where':{'id':_0x196073[_0x3b32('0x4a')]}})[_0x3b32('0x35')](function(_0xccfb54){_0x40a106=_0xccfb54;return db[_0x3b32('0x4b')][_0x3b32('0x32')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x3b32('0x4c')],'raw':!![]});})['then'](function(_0x45740e){if(!_0x40a106||!_[_0x3b32('0x4d')](_0x40a106[_0x3b32('0x4e')],_0x196073[_0x3b32('0x4f')])){return _0x50bf9b[_0x3b32('0x36')](0x191)[_0x3b32('0x40')]({'message':_0x3b32('0x50')});}if(_0x40a106[_0x3b32('0x51')]){return _0x50bf9b['status'](0x191)[_0x3b32('0x40')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x40a106[_0x3b32('0x52')]){if(_0x45740e[_0x3b32('0x4c')]>0x0){if(moment(_0x40a106[_0x3b32('0x53')])[_0x3b32('0x54')](_0x45740e['blockDuration'],_0x3b32('0x55'))>moment()){return _0x50bf9b[_0x3b32('0x36')](0x191)[_0x3b32('0x40')]({'message':_0x3b32('0x56')});}}else{return _0x50bf9b[_0x3b32('0x36')](0x191)[_0x3b32('0x40')]({'message':_0x3b32('0x56')});}}_0x27dfb4[_0x3b32('0x42')]={'id':_0x40a106['id']};_0x538f54();});})[_0x3b32('0x43')](function(){return _0x50bf9b[_0x3b32('0x36')](0x191)[_0x3b32('0x40')]({'message':_0x3b32('0x56')});});}catch(_0x20d971){_0x538f54(_0x20d971);}}else if(_0x5d3849){_0x538f54();}else{return _0x50bf9b[_0x3b32('0x36')](0x193)[_0x3b32('0x40')]({'message':_0x3b32('0x45')});}})[_0x3b32('0x31')](function(_0x389006,_0x2169fc,_0x2deca8){if(_0x389006[_0x3b32('0x42')]){db[_0x3b32('0x49')][_0x3b32('0x3d')]({'where':{'id':_0x389006['user']['id']},'attributes':userAttributes})[_0x3b32('0x35')](function(_0x30d759){if(!_0x30d759){return _0x2169fc[_0x3b32('0x36')](0x194)[_0x3b32('0x40')]({'message':_0x3b32('0x57')});}_0x389006[_0x3b32('0x42')]=_0x30d759;_0x2deca8();})[_0x3b32('0x43')](function(_0x414b6f){_0x2deca8(_0x414b6f);});}else if(_0x5d3849){_0x2deca8();}else{return _0x2169fc[_0x3b32('0x36')](0x194)[_0x3b32('0x40')]({'message':_0x3b32('0x58')});}});};exports[_0x3b32('0x59')]=function canUpdate(){return compose()[_0x3b32('0x31')](function(_0x4790fa,_0x207bd0,_0x4a1f3e){return licenseUtil['getLicense']()[_0x3b32('0x35')](function(_0x1e6ad5){if(_0x1e6ad5[_0x3b32('0x5a')]){_0x4a1f3e();}else{return _0x207bd0[_0x3b32('0x36')](0x193)[_0x3b32('0x40')]({'message':_0x3b32('0x5b')});}})[_0x3b32('0x43')](function(_0x23d0a1){_0x4a1f3e(_0x23d0a1);});});};exports[_0x3b32('0x5c')]=function isWebrtcLicence(){return compose()[_0x3b32('0x31')](function(_0x26fc17,_0x34f5bb,_0x7bd625){return licenseUtil[_0x3b32('0x5d')]()['then'](function(_0x4d7ff1){if(_0x4d7ff1[_0x3b32('0x5e')]){_0x7bd625();}else{return _0x34f5bb[_0x3b32('0x36')](0x193)[_0x3b32('0x40')]({'message':_0x3b32('0x5b')});}})[_0x3b32('0x43')](function(_0x3bf71c){_0x7bd625(_0x3bf71c);});});};exports[_0x3b32('0x5f')]=function(_0x387c4d,_0x21047f,_0x1afb22){_0x387c4d[_0x3b32('0x5f')]=!![];return _0x1afb22();};exports[_0x3b32('0x60')]=function signToken(_0x520bb7){return signJwt(_0x520bb7);};exports[_0x3b32('0x61')]=function(_0x1f0f6e,_0x3ddf84){if(!_0x1f0f6e[_0x3b32('0x42')]){return _0x3ddf84['status'](0x194)[_0x3b32('0x40')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x55f1ae={'payload':{'id':_0x1f0f6e[_0x3b32('0x42')]['id'],'role':_0x1f0f6e['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x55f1ae)[_0x3b32('0x35')](function(_0x1a1b52){_0x3ddf84[_0x3b32('0x62')](_0x3b32('0x63'),_0x1a1b52);_0x3ddf84['redirect'](_0x3b32('0x64'));})[_0x3b32('0x43')](function(_0x36e3c7){return _0x3ddf84[_0x3b32('0x36')](0x1f4)[_0x3b32('0x65')](_0x36e3c7);});};exports[_0x3b32('0x66')]=function(_0x5c8f1d){if(_[_0x3b32('0x67')](_0x5c8f1d[_0x3b32('0x4e')])||_[_0x3b32('0x67')](_0x5c8f1d[_0x3b32('0x68')])){return null;}else{return createJwt(_0x5c8f1d);}};exports['generateApiKey']=function(_0x22f867){_0x22f867[_0x3b32('0x4e')]=generateNonce();_0x22f867[_0x3b32('0x68')]=generateIssuedAt();return createJwt(_0x22f867);};exports[_0x3b32('0x69')]=function(_0x171783,_0x1bc31b){var _0x18bf1d=_0x171783[_0x3b32('0x46')][_0x3b32('0x47')];if(_0x18bf1d){var _0x5197c5={'nonce':_0x1bc31b[_0x3b32('0x4e')],'iat':_0x1bc31b['apiKeyIat'],'audience':hardwareConf[_0x3b32('0x48')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x18bf1d,_0x5197c5)['then'](function(){return generateApiKey(_0x1bc31b);});}else{throw{'message':_0x3b32('0x6a')};}};exports[_0x3b32('0x6b')]=function(_0x54c67e){var _0x4ee37b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4ee37b[_0x3b32('0x6c')](_0x54c67e))throw new db[(_0x3b32('0x6d'))]['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~!@#$%^&-_=+[{]}.');return;};exports[_0x3b32('0x6e')]=function(_0x8f4325,_0x2a2275,_0x146c93){var _0x1dc5aa=encryptor['decryptString'](_0x2a2275)[_0x3b32('0x6f')](',');for(var _0x3de72c=0x0;_0x3de72c<_0x146c93;_0x3de72c++){if(!_0x1dc5aa[_0x3de72c])break;if(_0x8f4325[_0x3b32('0x70')]()===_0x1dc5aa[_0x3de72c][_0x3b32('0x70')]()){var _0x152ca1=util['format'](_0x3b32('0x71'),_0x146c93);if(_0x146c93===0x1){_0x152ca1='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x3b32('0x6d'))][(_0x3b32('0x72'))](_0x152ca1);}}return;};exports[_0x3b32('0x73')]=function(_0x3edc91,_0x28142d){var _0x3a6e5a=_0x28142d?encryptor[_0x3b32('0x74')](_0x28142d)['split'](','):[];if(_0x3a6e5a[_0x3b32('0x75')]===0x5){_0x3a6e5a[_0x3b32('0x76')](-0x1,0x1);}_0x3a6e5a[_0x3b32('0x77')](_0x3edc91);return encryptor[_0x3b32('0x78')](_0x3a6e5a[_0x3b32('0x79')](','));};function signJwt(_0x4e426a){var _0x4d5d8b=BPromise['promisify'](jwt['sign'],{'context':jwt});var _0x4e63c7=_0x4e426a['secret']||config['secrets'][_0x3b32('0xd')];return new BPromise(function(_0x143452,_0x5553b5){_0x4d5d8b(_0x4e426a[_0x3b32('0x7a')],_0x4e63c7,_0x4e426a['options'])[_0x3b32('0x35')](function(_0x14fded){_0x143452(_0x14fded);})[_0x3b32('0x43')](function(_0x55156e){_0x5553b5(_0x55156e);});});}function verifyJwt(_0x3c65ec,_0x35ac39,_0x2a778a){var _0x1dc90a=BPromise['promisify'](jwt[_0x3b32('0x7b')],{'context':jwt});var _0x2a482d=_0x2a778a||config['secrets'][_0x3b32('0xd')];return new BPromise(function(_0x5f3da9,_0x4e1dda){_0x1dc90a(_0x3c65ec,_0x2a482d,_0x35ac39)[_0x3b32('0x35')](function(_0x3b9c5e){_0x5f3da9(_0x3b9c5e);})[_0x3b32('0x43')](function(_0x1719c5){_0x4e1dda(_0x1719c5);});});}function generateNonce(){return crypto[_0x3b32('0x7c')](0x10)[_0x3b32('0x7d')](_0x3b32('0x7e'));}function generateIssuedAt(){return Math[_0x3b32('0x7f')](Date[_0x3b32('0x80')]()/0x3e8)[_0x3b32('0x7d')]();}function createJwt(_0x1d214b){var _0x129566={'payload':{'iat':_0x1d214b[_0x3b32('0x68')],'nonce':_0x1d214b[_0x3b32('0x4e')]},'options':{'algorithm':_0x3b32('0x81'),'subject':_0x1d214b['id']['toString'](),'issuer':hardwareConf[_0x3b32('0x48')](),'audience':hardwareConf[_0x3b32('0x48')]()}};return signJwt(_0x129566)[_0x3b32('0x35')](function(_0xf2ce5d){return{'iat':_0x1d214b[_0x3b32('0x68')],'nonce':_0x1d214b[_0x3b32('0x4e')],'token':_0xf2ce5d};});} \ No newline at end of file +var _0xc6f1=['disposition','json','unmanaged','Unmanaged.','Forbidden.','use','authorization','startsWith','Basic','User','find','authenticate','pass','status','Wrong\x20credentials.','catch','headers','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','length','unshift','encryptString','join','promisify','session','options','verify','randomBytes','toString','hex','now','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','fullname','name','internal','email','userpic','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','params','closed','then'];(function(_0x265f6a,_0x489e7b){var _0x411cb3=function(_0x2d9dcf){while(--_0x2d9dcf){_0x265f6a['push'](_0x265f6a['shift']());}};_0x411cb3(++_0x489e7b);}(_0xc6f1,0x1de));var _0x1c6f=function(_0x19af51,_0x3834ac){_0x19af51=_0x19af51-0x0;var _0x997581=_0xc6f1[_0x19af51];return _0x997581;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x1c6f('0x0'));var hardwareConf=require(_0x1c6f('0x1'));var licenseUtil=require(_0x1c6f('0x2'));var encryptor=require(_0x1c6f('0x3'));var _=require(_0x1c6f('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x1c6f('0x5'));var compose=require(_0x1c6f('0x6'));var basicAuth=require(_0x1c6f('0x7'));var crypto=require(_0x1c6f('0x8'));var BPromise=require(_0x1c6f('0x9'));var util=require('util');var moment=require(_0x1c6f('0xa'));var validateJwt=expressJwt({'secret':config[_0x1c6f('0xb')]['session']});var userAttributes=['id','role',_0x1c6f('0xc'),_0x1c6f('0xd'),_0x1c6f('0xe'),_0x1c6f('0xf'),_0x1c6f('0x10'),'permissions',_0x1c6f('0x11'),_0x1c6f('0x12'),_0x1c6f('0x13'),_0x1c6f('0x14'),_0x1c6f('0x15'),_0x1c6f('0x16'),_0x1c6f('0x17'),_0x1c6f('0x18'),_0x1c6f('0x19'),'lastLoginAt',_0x1c6f('0x1a'),_0x1c6f('0x1b'),'allowmessenger',_0x1c6f('0x1c'),_0x1c6f('0x1d'),_0x1c6f('0x1e'),_0x1c6f('0x1f'),_0x1c6f('0x20'),_0x1c6f('0x21'),'phoneBarEnableDtmfTone',_0x1c6f('0x22'),'phoneBarExpires',_0x1c6f('0x23'),_0x1c6f('0x24'),_0x1c6f('0x25'),'hotdesk',_0x1c6f('0x26'),_0x1c6f('0x27'),_0x1c6f('0x28'),'settingsEnabled','wssPort',_0x1c6f('0x29'),_0x1c6f('0x2a'),_0x1c6f('0x2b'),_0x1c6f('0x2c'),_0x1c6f('0x2d')];exports[_0x1c6f('0x2e')]=function(){return this[_0x1c6f('0x2f')](!![])['use'](function(_0x215bdc,_0x19e20c,_0x6f8ed0){if(_0x215bdc[_0x1c6f('0x30')]){_0x6f8ed0();}else{return db[_0x1c6f('0x31')][_0x1c6f('0x32')]({'where':{'id':_0x215bdc[_0x1c6f('0x33')]['id']},'attributes':['id',_0x1c6f('0x34'),'disposition'],'raw':!![]})[_0x1c6f('0x35')](function(_0x35ee61){if(_0x35ee61&&_0x35ee61[_0x1c6f('0x34')]){return _0x19e20c['status'](_0x35ee61[_0x1c6f('0x36')]==='unmanaged'?0x195:0x193)[_0x1c6f('0x37')]({'message':_0x35ee61['disposition']===_0x1c6f('0x38')?_0x1c6f('0x39'):_0x1c6f('0x3a')});}else{_0x6f8ed0();}})['catch'](function(_0x17fb8d){_0x6f8ed0(_0x17fb8d);});}});};exports[_0x1c6f('0x2f')]=function isAuthenticated(_0x251bfd){return compose()[_0x1c6f('0x3b')](function(_0x1938f5,_0x4b27e0,_0x5edcf3){var _0x4e9441;if(_0x1938f5['headers'][_0x1c6f('0x3c')]){if(_[_0x1c6f('0x3d')](_0x1938f5['headers'][_0x1c6f('0x3c')],_0x1c6f('0x3e'))){var _0x57e840=basicAuth(_0x1938f5);db[_0x1c6f('0x3f')][_0x1c6f('0x40')]({'where':{'name':_0x57e840['name']}})[_0x1c6f('0x35')](function(_0x41ec1c){if(!_0x41ec1c||!_0x41ec1c[_0x1c6f('0x41')](_0x57e840[_0x1c6f('0x42')])){return _0x4b27e0[_0x1c6f('0x43')](0x191)[_0x1c6f('0x37')]({'message':_0x1c6f('0x44')});}_0x1938f5[_0x1c6f('0x30')]={'id':_0x41ec1c['id']};_0x5edcf3();})[_0x1c6f('0x45')](function(_0x1580a6){_0x5edcf3(_0x1580a6);});}else if(_[_0x1c6f('0x3d')](_0x1938f5[_0x1c6f('0x46')][_0x1c6f('0x3c')],_0x1c6f('0x47'))){validateJwt(_0x1938f5,_0x4b27e0,_0x5edcf3);}else{if(_0x251bfd){_0x5edcf3();}else{return _0x4b27e0[_0x1c6f('0x43')](0x193)['json']({'message':_0x1c6f('0x48')});}}}else if(_0x1938f5[_0x1c6f('0x49')]['apikey']){try{var _0x53cbf7={'audience':hardwareConf[_0x1c6f('0x4a')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x1938f5['query'][_0x1c6f('0x4b')],_0x53cbf7)[_0x1c6f('0x35')](function(_0x42e160){return db[_0x1c6f('0x3f')][_0x1c6f('0x40')]({'where':{'id':_0x42e160['sub']}})[_0x1c6f('0x35')](function(_0x5d0a85){_0x4e9441=_0x5d0a85;return db[_0x1c6f('0x4c')][_0x1c6f('0x32')]({'where':{'id':0x1},'attributes':[_0x1c6f('0x4d'),_0x1c6f('0x4e')],'raw':!![]});})[_0x1c6f('0x35')](function(_0x27d982){if(!_0x4e9441||!_[_0x1c6f('0x4f')](_0x4e9441[_0x1c6f('0x50')],_0x42e160[_0x1c6f('0x51')])){return _0x4b27e0[_0x1c6f('0x43')](0x191)[_0x1c6f('0x37')]({'message':_0x1c6f('0x52')});}if(_0x4e9441[_0x1c6f('0x53')]){return _0x4b27e0[_0x1c6f('0x43')](0x191)[_0x1c6f('0x37')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x4e9441['blocked']){if(_0x27d982[_0x1c6f('0x4e')]>0x0){if(moment(_0x4e9441['blockedAt'])[_0x1c6f('0x54')](_0x27d982[_0x1c6f('0x4e')],_0x1c6f('0x55'))>moment()){return _0x4b27e0[_0x1c6f('0x43')](0x191)['json']({'message':_0x1c6f('0x56')});}}else{return _0x4b27e0['status'](0x191)[_0x1c6f('0x37')]({'message':_0x1c6f('0x56')});}}_0x1938f5['user']={'id':_0x4e9441['id']};_0x5edcf3();});})[_0x1c6f('0x45')](function(){return _0x4b27e0[_0x1c6f('0x43')](0x191)[_0x1c6f('0x37')]({'message':_0x1c6f('0x56')});});}catch(_0x4e15a3){_0x5edcf3(_0x4e15a3);}}else if(_0x251bfd){_0x5edcf3();}else{return _0x4b27e0[_0x1c6f('0x43')](0x193)[_0x1c6f('0x37')]({'message':_0x1c6f('0x48')});}})[_0x1c6f('0x3b')](function(_0xb7433e,_0x21f142,_0x3e7fb4){if(_0xb7433e[_0x1c6f('0x30')]){db[_0x1c6f('0x3f')][_0x1c6f('0x40')]({'where':{'id':_0xb7433e[_0x1c6f('0x30')]['id']},'attributes':userAttributes})['then'](function(_0x14db13){if(!_0x14db13){return _0x21f142[_0x1c6f('0x43')](0x194)[_0x1c6f('0x37')]({'message':_0x1c6f('0x57')});}_0xb7433e[_0x1c6f('0x30')]=_0x14db13;_0x3e7fb4();})[_0x1c6f('0x45')](function(_0x26e594){_0x3e7fb4(_0x26e594);});}else if(_0x251bfd){_0x3e7fb4();}else{return _0x21f142[_0x1c6f('0x43')](0x194)['json']({'message':_0x1c6f('0x58')});}});};exports[_0x1c6f('0x59')]=function canUpdate(){return compose()[_0x1c6f('0x3b')](function(_0xa8a8ca,_0x5593ed,_0x133905){return licenseUtil[_0x1c6f('0x5a')]()[_0x1c6f('0x35')](function(_0x5d192b){if(_0x5d192b[_0x1c6f('0x5b')]){_0x133905();}else{return _0x5593ed[_0x1c6f('0x43')](0x193)[_0x1c6f('0x37')]({'message':_0x1c6f('0x5c')});}})[_0x1c6f('0x45')](function(_0x246b8f){_0x133905(_0x246b8f);});});};exports[_0x1c6f('0x5d')]=function isWebrtcLicence(){return compose()['use'](function(_0x2269db,_0xd29f77,_0x5705a6){return licenseUtil['getLicense']()[_0x1c6f('0x35')](function(_0xf71fa6){if(_0xf71fa6['webrtc']){_0x5705a6();}else{return _0xd29f77['status'](0x193)['json']({'message':'Forbidden'});}})[_0x1c6f('0x45')](function(_0x39b0ee){_0x5705a6(_0x39b0ee);});});};exports[_0x1c6f('0x5e')]=function(_0x34634e,_0xea08b8,_0x59b523){_0x34634e[_0x1c6f('0x5e')]=!![];return _0x59b523();};exports[_0x1c6f('0x5f')]=function signToken(_0x2da930){return signJwt(_0x2da930);};exports[_0x1c6f('0x60')]=function(_0x1622f0,_0x4a86dd){if(!_0x1622f0[_0x1c6f('0x30')]){return _0x4a86dd[_0x1c6f('0x43')](0x194)[_0x1c6f('0x37')]({'message':_0x1c6f('0x61')});}var _0x3f4a77={'payload':{'id':_0x1622f0[_0x1c6f('0x30')]['id'],'role':_0x1622f0[_0x1c6f('0x30')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3f4a77)[_0x1c6f('0x35')](function(_0xe1577c){_0x4a86dd[_0x1c6f('0x62')]('motion.token',_0xe1577c);_0x4a86dd[_0x1c6f('0x63')](_0x1c6f('0x64'));})[_0x1c6f('0x45')](function(_0x6d847c){return _0x4a86dd['status'](0x1f4)[_0x1c6f('0x65')](_0x6d847c);});};exports[_0x1c6f('0x66')]=function(_0x3070cf){if(_[_0x1c6f('0x67')](_0x3070cf['apiKeyNonce'])||_[_0x1c6f('0x67')](_0x3070cf[_0x1c6f('0x68')])){return null;}else{return createJwt(_0x3070cf);}};exports[_0x1c6f('0x69')]=function(_0x5ba0a4){_0x5ba0a4['apiKeyNonce']=generateNonce();_0x5ba0a4[_0x1c6f('0x68')]=generateIssuedAt();return createJwt(_0x5ba0a4);};exports[_0x1c6f('0x6a')]=function(_0x3b1f88,_0x31dcb3){var _0x3b21cf=_0x3b1f88[_0x1c6f('0x49')][_0x1c6f('0x4b')];if(_0x3b21cf){var _0x454f6d={'nonce':_0x31dcb3['apiKeyNonce'],'iat':_0x31dcb3[_0x1c6f('0x68')],'audience':hardwareConf[_0x1c6f('0x4a')](),'issuer':hardwareConf[_0x1c6f('0x4a')]()};return verifyJwt(_0x3b21cf,_0x454f6d)[_0x1c6f('0x35')](function(){return generateApiKey(_0x31dcb3);});}else{throw{'message':_0x1c6f('0x6b')};}};exports[_0x1c6f('0x6c')]=function(_0x32bc5d){var _0x1fec2c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1fec2c[_0x1c6f('0x6d')](_0x32bc5d))throw new db[(_0x1c6f('0x6e'))][(_0x1c6f('0x6f'))](_0x1c6f('0x70'));return;};exports['validatePasswordHistory']=function(_0x9b817a,_0x4f6947,_0x1c4245){var _0x1417e6=encryptor[_0x1c6f('0x71')](_0x4f6947)['split'](',');for(var _0x25ca13=0x0;_0x25ca13<_0x1c4245;_0x25ca13++){if(!_0x1417e6[_0x25ca13])break;if(_0x9b817a[_0x1c6f('0x72')]()===_0x1417e6[_0x25ca13][_0x1c6f('0x72')]()){var _0x149252=util[_0x1c6f('0x73')](_0x1c6f('0x74'),_0x1c4245);if(_0x1c4245===0x1){_0x149252=_0x1c6f('0x75');}throw new db['Sequelize']['ValidationError'](_0x149252);}}return;};exports[_0x1c6f('0x76')]=function(_0x5f3f1c,_0x48685c){var _0x45b7d6=_0x48685c?encryptor['decryptString'](_0x48685c)[_0x1c6f('0x77')](','):[];if(_0x45b7d6[_0x1c6f('0x78')]===0x5){_0x45b7d6['splice'](-0x1,0x1);}_0x45b7d6[_0x1c6f('0x79')](_0x5f3f1c);return encryptor[_0x1c6f('0x7a')](_0x45b7d6[_0x1c6f('0x7b')](','));};function signJwt(_0x15c1bd){var _0x2eb1bb=BPromise[_0x1c6f('0x7c')](jwt['sign'],{'context':jwt});var _0x343937=_0x15c1bd['secret']||config[_0x1c6f('0xb')][_0x1c6f('0x7d')];return new BPromise(function(_0x3029f2,_0x3d23fa){_0x2eb1bb(_0x15c1bd['payload'],_0x343937,_0x15c1bd[_0x1c6f('0x7e')])['then'](function(_0x1cf3de){_0x3029f2(_0x1cf3de);})[_0x1c6f('0x45')](function(_0x49376f){_0x3d23fa(_0x49376f);});});}function verifyJwt(_0x106725,_0x287fb7,_0x5f14a9){var _0x43cb67=BPromise['promisify'](jwt[_0x1c6f('0x7f')],{'context':jwt});var _0xcf17a1=_0x5f14a9||config[_0x1c6f('0xb')][_0x1c6f('0x7d')];return new BPromise(function(_0x3f0a53,_0x27d8f3){_0x43cb67(_0x106725,_0xcf17a1,_0x287fb7)[_0x1c6f('0x35')](function(_0x20958e){_0x3f0a53(_0x20958e);})[_0x1c6f('0x45')](function(_0x2d89ee){_0x27d8f3(_0x2d89ee);});});}function generateNonce(){return crypto[_0x1c6f('0x80')](0x10)[_0x1c6f('0x81')](_0x1c6f('0x82'));}function generateIssuedAt(){return Math['floor'](Date[_0x1c6f('0x83')]()/0x3e8)[_0x1c6f('0x81')]();}function createJwt(_0x58348f){var _0x777d8a={'payload':{'iat':_0x58348f[_0x1c6f('0x68')],'nonce':_0x58348f[_0x1c6f('0x50')]},'options':{'algorithm':_0x1c6f('0x84'),'subject':_0x58348f['id'][_0x1c6f('0x81')](),'issuer':hardwareConf[_0x1c6f('0x4a')](),'audience':hardwareConf[_0x1c6f('0x4a')]()}};return signJwt(_0x777d8a)[_0x1c6f('0x35')](function(_0x30bd0c){return{'iat':_0x58348f[_0x1c6f('0x68')],'nonce':_0x58348f[_0x1c6f('0x50')],'token':_0x30bd0c};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index d574e48..99e0a3a 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 _0x68c7=['secret','createDecipher','final','crypto','bluebird','lodash','../../config/environment','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','binary','write','end','close','decryptFile','unlink','encryptString','utf8','base64','decryptString'];(function(_0x16f058,_0x48cbec){var _0x182223=function(_0x1de02c){while(--_0x1de02c){_0x16f058['push'](_0x16f058['shift']());}};_0x182223(++_0x48cbec);}(_0x68c7,0x1ed));var _0x768c=function(_0x25e69a,_0x33dc21){_0x25e69a=_0x25e69a-0x0;var _0x1c9c44=_0x68c7[_0x25e69a];return _0x1c9c44;};'use strict';var crypto=require(_0x768c('0x0'));var fs=require('fs');var BPromise=require(_0x768c('0x1'));var _=require(_0x768c('0x2'));var config=require(_0x768c('0x3'));var logger=require('../../config/logger')(_0x768c('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x768c('0x5')][_0x768c('0x6')],'algorithm':_0x768c('0x7')};const fileOptions={'algorithm':_0x768c('0x8')};if(config['encrypt']&&config[_0x768c('0x9')][_0x768c('0xa')]){var isSupported=isAlgorithmSupported(config[_0x768c('0x9')]['algorithm']);if(isSupported){fileOptions[_0x768c('0xa')]=config['encrypt'][_0x768c('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x768c('0xb')](config[_0x768c('0x9')]['algorithm'],_0x768c('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x1798b1){return AES_SUPPORTED_RX[_0x768c('0xd')](_0x1798b1);}function getSupportedCiphers(){return crypto[_0x768c('0xe')]()[_0x768c('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x1e0b21){return getSupportedCiphers()['indexOf'](_0x1e0b21)>-0x1;}function combineOptions(_0x32d808){var _0x5dca2b={};for(var _0x4b470d in fileOptions){if(fileOptions[_0x768c('0x10')](_0x4b470d)){_0x5dca2b[_0x4b470d]=fileOptions[_0x4b470d];}}if(_0x32d808){for(var _0x5302fe in _0x32d808){if(_0x32d808['hasOwnProperty'](_0x5302fe)){_0x5dca2b[_0x5302fe]=_0x32d808[_0x5302fe];}}}return _0x5dca2b;}exports[_0x768c('0x11')]=function(_0x331901,_0x4eb260,_0x5896cf,_0x28e75d){return new BPromise(function(_0x11fb6a,_0x58d585){_0x28e75d=combineOptions(_0x28e75d);var _0x2eb441=new Buffer(_0x5896cf);var _0x435985=fs['createReadStream'](_0x331901);var _0x165baf=fs[_0x768c('0x12')](_0x4eb260);var _0x34458c=crypto[_0x768c('0x13')](_0x28e75d['algorithm'],_0x2eb441);_0x435985['on'](_0x768c('0x14'),function(_0x57513f){var _0x131976=new Buffer(_0x34458c[_0x768c('0x15')](_0x57513f),_0x768c('0x16'));_0x165baf['write'](_0x131976);});_0x435985['on']('end',function(){try{var _0xf8ce40=new Buffer(_0x34458c['final']('binary'),_0x768c('0x16'));_0x165baf[_0x768c('0x17')](_0xf8ce40);_0x165baf[_0x768c('0x18')]();_0x165baf['on'](_0x768c('0x19'),function(){return _0x11fb6a(_0x4eb260);});}catch(_0x2efff7){fs['unlink'](_0x4eb260);return _0x58d585(_0x2efff7);}});});};exports[_0x768c('0x1a')]=function(_0x294bf0,_0x498689,_0x13a621,_0x289efc){return new BPromise(function(_0x36d6f0,_0x166de2){_0x289efc=combineOptions(_0x289efc);var _0x17456a=new Buffer(_0x13a621);var _0x169b6e=fs['createReadStream'](_0x294bf0);var _0x4c5d0c=fs[_0x768c('0x12')](_0x498689);var _0xdd65f7=crypto['createDecipher'](_0x289efc[_0x768c('0xa')],_0x17456a);_0x169b6e['on'](_0x768c('0x14'),function(_0x825e8c){var _0x27d1fe=new Buffer(_0xdd65f7[_0x768c('0x15')](_0x825e8c),_0x768c('0x16'));_0x4c5d0c[_0x768c('0x17')](_0x27d1fe);});_0x169b6e['on'](_0x768c('0x18'),function(){try{var _0x9e61aa=new Buffer(_0xdd65f7['final'](_0x768c('0x16')),_0x768c('0x16'));_0x4c5d0c[_0x768c('0x17')](_0x9e61aa);_0x4c5d0c[_0x768c('0x18')]();_0x4c5d0c['on'](_0x768c('0x19'),function(){return _0x36d6f0(_0x498689);});}catch(_0x3f4f31){fs[_0x768c('0x1b')](_0x498689);return _0x166de2(_0x3f4f31);}});});};exports[_0x768c('0x1c')]=function(_0x44c9c9,_0x2361f1,_0xa87c96){var _0x21ba95=_0xa87c96||stringOptions['algorithm'];var _0x3d2dd9=_0x2361f1||stringOptions['secret'];var _0x26a147=crypto['createCipher'](_0x21ba95,_0x3d2dd9);var _0x5ca423=_0x26a147[_0x768c('0x15')](_0x44c9c9,_0x768c('0x1d'),'base64');_0x5ca423+=_0x26a147['final'](_0x768c('0x1e'));return _0x5ca423;};exports[_0x768c('0x1f')]=function(_0x2b3e8a,_0x2a1fbf,_0x4691d9){var _0xf35d9b=_0x4691d9||stringOptions[_0x768c('0xa')];var _0x501388=_0x2a1fbf||stringOptions[_0x768c('0x20')];var _0xf43c64=crypto[_0x768c('0x21')](_0xf35d9b,_0x501388);var _0x41c11a=_0xf43c64[_0x768c('0x15')](_0x2b3e8a,'base64',_0x768c('0x1d'));_0x41c11a+=_0xf43c64[_0x768c('0x22')]('utf8');return _0x41c11a;}; \ No newline at end of file +var _0x97a5=['algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','data','binary','write','final','end','unlink','decryptFile','createWriteStream','createDecipher','update','close','encryptString','utf8','base64','secret','lodash','../../config/environment','../../config/logger','secrets','session','aes192','encrypt'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x97a5,0xc5));var _0x597a=function(_0x3d99c8,_0x5a87e4){_0x3d99c8=_0x3d99c8-0x0;var _0x1a9782=_0x97a5[_0x3d99c8];return _0x1a9782;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x597a('0x0'));var config=require(_0x597a('0x1'));var logger=require(_0x597a('0x2'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x597a('0x3')][_0x597a('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x597a('0x5')};if(config['encrypt']&&config[_0x597a('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x597a('0x6')][_0x597a('0x7')]);if(isSupported){fileOptions[_0x597a('0x7')]=config[_0x597a('0x6')][_0x597a('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x597a('0x8')](',\x20');logger[_0x597a('0x9')](config['encrypt']['algorithm'],_0x597a('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x12a995){return AES_SUPPORTED_RX[_0x597a('0xb')](_0x12a995);}function getSupportedCiphers(){return crypto[_0x597a('0xc')]()[_0x597a('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x253321){return getSupportedCiphers()[_0x597a('0xe')](_0x253321)>-0x1;}function combineOptions(_0x5e3756){var _0x47045d={};for(var _0x34b753 in fileOptions){if(fileOptions['hasOwnProperty'](_0x34b753)){_0x47045d[_0x34b753]=fileOptions[_0x34b753];}}if(_0x5e3756){for(var _0x2b2334 in _0x5e3756){if(_0x5e3756[_0x597a('0xf')](_0x2b2334)){_0x47045d[_0x2b2334]=_0x5e3756[_0x2b2334];}}}return _0x47045d;}exports[_0x597a('0x10')]=function(_0x210fdd,_0xc55ef2,_0x204ce,_0x539a95){return new BPromise(function(_0x19d159,_0x48d104){_0x539a95=combineOptions(_0x539a95);var _0x2f1f64=new Buffer(_0x204ce);var _0x3ee1d4=fs[_0x597a('0x11')](_0x210fdd);var _0xaed42=fs['createWriteStream'](_0xc55ef2);var _0x4c3065=crypto[_0x597a('0x12')](_0x539a95['algorithm'],_0x2f1f64);_0x3ee1d4['on'](_0x597a('0x13'),function(_0x3f289d){var _0x259eff=new Buffer(_0x4c3065['update'](_0x3f289d),_0x597a('0x14'));_0xaed42[_0x597a('0x15')](_0x259eff);});_0x3ee1d4['on']('end',function(){try{var _0x25ffdb=new Buffer(_0x4c3065[_0x597a('0x16')](_0x597a('0x14')),_0x597a('0x14'));_0xaed42[_0x597a('0x15')](_0x25ffdb);_0xaed42[_0x597a('0x17')]();_0xaed42['on']('close',function(){return _0x19d159(_0xc55ef2);});}catch(_0x7ed43d){fs[_0x597a('0x18')](_0xc55ef2);return _0x48d104(_0x7ed43d);}});});};exports[_0x597a('0x19')]=function(_0x55012d,_0x7797d5,_0x29363e,_0x4730d7){return new BPromise(function(_0x5779cf,_0x406088){_0x4730d7=combineOptions(_0x4730d7);var _0x282e18=new Buffer(_0x29363e);var _0x19d31f=fs['createReadStream'](_0x55012d);var _0x31fe76=fs[_0x597a('0x1a')](_0x7797d5);var _0x18a2ec=crypto[_0x597a('0x1b')](_0x4730d7[_0x597a('0x7')],_0x282e18);_0x19d31f['on'](_0x597a('0x13'),function(_0x273e1e){var _0x38d707=new Buffer(_0x18a2ec[_0x597a('0x1c')](_0x273e1e),_0x597a('0x14'));_0x31fe76[_0x597a('0x15')](_0x38d707);});_0x19d31f['on'](_0x597a('0x17'),function(){try{var _0x145905=new Buffer(_0x18a2ec[_0x597a('0x16')](_0x597a('0x14')),_0x597a('0x14'));_0x31fe76[_0x597a('0x15')](_0x145905);_0x31fe76[_0x597a('0x17')]();_0x31fe76['on'](_0x597a('0x1d'),function(){return _0x5779cf(_0x7797d5);});}catch(_0x81bf6e){fs[_0x597a('0x18')](_0x7797d5);return _0x406088(_0x81bf6e);}});});};exports[_0x597a('0x1e')]=function(_0x56a689,_0x555b8f,_0x5a7477){var _0x47c0bb=_0x5a7477||stringOptions['algorithm'];var _0x430450=_0x555b8f||stringOptions['secret'];var _0x2e083d=crypto['createCipher'](_0x47c0bb,_0x430450);var _0x115c0b=_0x2e083d[_0x597a('0x1c')](_0x56a689,_0x597a('0x1f'),_0x597a('0x20'));_0x115c0b+=_0x2e083d[_0x597a('0x16')]('base64');return _0x115c0b;};exports['decryptString']=function(_0xfc9c39,_0x43e1ea,_0x2439dd){var _0x44d78f=_0x2439dd||stringOptions[_0x597a('0x7')];var _0x2499f6=_0x43e1ea||stringOptions[_0x597a('0x21')];var _0x26e6d5=crypto[_0x597a('0x1b')](_0x44d78f,_0x2499f6);var _0x3f5055=_0x26e6d5[_0x597a('0x1c')](_0xfc9c39,_0x597a('0x20'),_0x597a('0x1f'));_0x3f5055+=_0x26e6d5['final'](_0x597a('0x1f'));return _0x3f5055;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index d92cebb..c6f4c36 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 _0x7924=['SELECT','push','dirname','basename','.csv','existsSync','join','each','csv','%s.%s','zip\x20finished','Completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','QueryTypes','num','Empty','length','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d'];(function(_0x143c39,_0x332547){var _0x23cca6=function(_0x119ac8){while(--_0x119ac8){_0x143c39['push'](_0x143c39['shift']());}};_0x23cca6(++_0x332547);}(_0x7924,0x1b9));var _0x4792=function(_0x1249f4,_0x27226c){_0x1249f4=_0x1249f4-0x0;var _0x47c8a9=_0x7924[_0x1249f4];return _0x47c8a9;};'use strict';var util=require(_0x4792('0x0'));var path=require(_0x4792('0x1'));var _=require(_0x4792('0x2'));var csv=require(_0x4792('0x3'));var fs=require('fs');var BPromise=require(_0x4792('0x4'));var zipdir=require(_0x4792('0x5'));var rimraf=require(_0x4792('0x6'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x4792('0x7')];var logger=require(_0x4792('0x8'))(_0x4792('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x4792('0xa')][0x2]);var QUERY=process[_0x4792('0xa')][0x3];var PATH=process[_0x4792('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2753b1,_0x53c63f){var _0x156f9c={'status':_0x2753b1};var _0x30adb7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x53c63f){_0x156f9c['savename']=_0x53c63f;}return db[_0x4792('0xb')]['update'](_0x156f9c,_0x30adb7);}function main(){var _0x1e12e0=0x1388;var _0x46680b;logger[_0x4792('0xc')](util[_0x4792('0xd')](_0x4792('0xe'),EXTRACTED_REPORT_ID,_0x4792('0xf')));return db[_0x4792('0x10')][_0x4792('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4792('0x12'),_0x4792('0x13')]})[_0x4792('0x14')](function(_0x3eaf44){if(_0x3eaf44){_0x46680b=_0x3eaf44;_0x1e12e0=_0x46680b['splitSizeCsv']||0x1388;}})[_0x4792('0x14')](function(){return dbH['sequelize']['query'](util[_0x4792('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x4792('0x15')][_0x4792('0x16')]['SELECT']});})[_0x4792('0x14')](function(_0x1f8391){if(!_0x1f8391[0x0][_0x4792('0x17')]){return analyticExtractedReport(_0x4792('0x18'));}var _0x7ceda0=[];var _0x46dfc3=0x0;if(_0x46680b[_0x4792('0x12')]){if(_0x1f8391&&_0x1f8391[_0x4792('0x19')]){var _0x2260e8=_['range'](_0x1f8391[0x0][_0x4792('0x17')]/_0x1e12e0);var _0x29e555=Number['isInteger'](_0x1f8391[0x0][_0x4792('0x17')]/_0x1e12e0)?_0x1f8391[0x0][_0x4792('0x17')]%_0x1e12e0:0x0;_0x2260e8[_0x4792('0x1a')](function(_0x1dc4c2){if(_0x1dc4c2>0x0){_0x46dfc3+=_0x1e12e0;}_0x7ceda0['push'](dbH[_0x4792('0x15')][_0x4792('0x1b')](util[_0x4792('0xd')](_0x4792('0x1c'),QUERY,_0x1e12e0,_0x46dfc3),{'type':dbH[_0x4792('0x15')][_0x4792('0x16')][_0x4792('0x1d')]}));});if(_0x29e555>0x0){_0x46dfc3+=_0x1e12e0;_0x7ceda0[_0x4792('0x1e')](dbH[_0x4792('0x15')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x29e555,_0x46dfc3),{'type':dbH[_0x4792('0x15')][_0x4792('0x16')][_0x4792('0x1d')]}));}}}else{_0x7ceda0[_0x4792('0x1e')](dbH[_0x4792('0x15')][_0x4792('0x1b')](QUERY,{'type':dbH['sequelize'][_0x4792('0x16')][_0x4792('0x1d')]}));}var _0x46302f=path[_0x4792('0x1f')](PATH);var _0x32b611=path[_0x4792('0x20')](PATH,_0x4792('0x21'));var _0x4093eb=_0x46680b['split']&&_0x7ceda0[_0x4792('0x19')]>0x1;var _0x270dd5=[];if(!fs[_0x4792('0x22')](path[_0x4792('0x23')](_0x46302f,_0x32b611))&&_0x4093eb){fs['mkdirSync'](path['join'](_0x46302f,_0x32b611));}return BPromise[_0x4792('0x24')](_0x7ceda0,function(_0x50c6e8){_0x270dd5['push'](_0x50c6e8);})[_0x4792('0x14')](function(){for(var _0x44c7cb=0x0;_0x44c7cb<_0x270dd5[_0x4792('0x19')];_0x44c7cb+=0x1){var _0xd8ebed;var _0x280e67=_0x270dd5[_0x44c7cb];if(_0x4093eb){_0xd8ebed=path[_0x4792('0x23')](_0x46302f,_0x32b611,util[_0x4792('0xd')]('%s%d.%s',_0x32b611,_0x44c7cb,_0x4792('0x25')));}else{_0xd8ebed=path[_0x4792('0x23')](_0x46302f,util['format']('%s.%s',_0x32b611,_0x4792('0x25')));}fs['writeFileSync'](_0xd8ebed,csv(_0x280e67));}})[_0x4792('0x14')](function(){if(_0x4093eb){return new Promise(function(_0x2ee5ed){zipdir(path[_0x4792('0x23')](_0x46302f,_0x32b611),{'saveTo':path[_0x4792('0x23')](_0x46302f,util[_0x4792('0xd')](_0x4792('0x26'),_0x32b611,'zip'))},function(_0x3dd6e8,_0x369d2e){rimraf(path['join'](_0x46302f,_0x32b611),function(){});_0x2ee5ed(_0x4792('0x27'));});});}})[_0x4792('0x14')](function(){logger[_0x4792('0xc')](util[_0x4792('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x4792('0xf')));return analyticExtractedReport(_0x4792('0x28'),_0x4093eb?util[_0x4792('0xd')](_0x4792('0x26'),_0x32b611,_0x4093eb?_0x4792('0x29'):'csv'):null);});})['catch'](function(_0x3386e2){logger['info'](util[_0x4792('0xd')](_0x4792('0x2a'),EXTRACTED_REPORT_ID,_0x4792('0xf')),util[_0x4792('0x2b')](_0x3386e2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4792('0x2c'));})[_0x4792('0x2d')](function(){process[_0x4792('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xcc61=['finally','exit','util','path','lodash','to-csv','bluebird','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','SELECT','num','Empty','length','isInteger','forEach','push','sequelize','query','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','existsSync','join','mkdirSync','%s%d.%s','%s.%s','csv','writeFileSync','zip','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect'];(function(_0x48c2ac,_0x444cb0){var _0x2f3648=function(_0x44c071){while(--_0x44c071){_0x48c2ac['push'](_0x48c2ac['shift']());}};_0x2f3648(++_0x444cb0);}(_0xcc61,0xed));var _0x1cc6=function(_0x546b6e,_0x1bac0e){_0x546b6e=_0x546b6e-0x0;var _0x5b9214=_0xcc61[_0x546b6e];return _0x5b9214;};'use strict';var util=require(_0x1cc6('0x0'));var path=require(_0x1cc6('0x1'));var _=require(_0x1cc6('0x2'));var csv=require(_0x1cc6('0x3'));var fs=require('fs');var BPromise=require(_0x1cc6('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x1cc6('0x5'))[_0x1cc6('0x6')];var logger=require('../../config/logger')(_0x1cc6('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x1cc6('0x8')][0x2]);var QUERY=process[_0x1cc6('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5682b7,_0x571521){var _0x2762f0={'status':_0x5682b7};var _0x11826d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x571521){_0x2762f0[_0x1cc6('0x9')]=_0x571521;}return db[_0x1cc6('0xa')]['update'](_0x2762f0,_0x11826d);}function main(){var _0x1b6115=0x1388;var _0x4dbbb9;logger[_0x1cc6('0xb')](util[_0x1cc6('0xc')](_0x1cc6('0xd'),EXTRACTED_REPORT_ID,_0x1cc6('0xe')));return db[_0x1cc6('0xf')][_0x1cc6('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1cc6('0x11'),_0x1cc6('0x12')]})[_0x1cc6('0x13')](function(_0x946a4a){if(_0x946a4a){_0x4dbbb9=_0x946a4a;_0x1b6115=_0x4dbbb9[_0x1cc6('0x12')]||0x1388;}})[_0x1cc6('0x13')](function(){return dbH['sequelize']['query'](util[_0x1cc6('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x1cc6('0x14')]});})[_0x1cc6('0x13')](function(_0x3e1ea2){if(!_0x3e1ea2[0x0][_0x1cc6('0x15')]){return analyticExtractedReport(_0x1cc6('0x16'));}var _0x19dc17=[];var _0x115f77=0x0;if(_0x4dbbb9[_0x1cc6('0x11')]){if(_0x3e1ea2&&_0x3e1ea2[_0x1cc6('0x17')]){var _0x1bee66=_['range'](_0x3e1ea2[0x0][_0x1cc6('0x15')]/_0x1b6115);var _0x3b0d93=Number[_0x1cc6('0x18')](_0x3e1ea2[0x0]['num']/_0x1b6115)?_0x3e1ea2[0x0][_0x1cc6('0x15')]%_0x1b6115:0x0;_0x1bee66[_0x1cc6('0x19')](function(_0x189023){if(_0x189023>0x0){_0x115f77+=_0x1b6115;}_0x19dc17[_0x1cc6('0x1a')](dbH[_0x1cc6('0x1b')][_0x1cc6('0x1c')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1b6115,_0x115f77),{'type':dbH[_0x1cc6('0x1b')][_0x1cc6('0x1d')][_0x1cc6('0x14')]}));});if(_0x3b0d93>0x0){_0x115f77+=_0x1b6115;_0x19dc17['push'](dbH['sequelize'][_0x1cc6('0x1c')](util['format'](_0x1cc6('0x1e'),QUERY,_0x3b0d93,_0x115f77),{'type':dbH['sequelize']['QueryTypes'][_0x1cc6('0x14')]}));}}}else{_0x19dc17[_0x1cc6('0x1a')](dbH['sequelize'][_0x1cc6('0x1c')](QUERY,{'type':dbH[_0x1cc6('0x1b')][_0x1cc6('0x1d')][_0x1cc6('0x14')]}));}var _0x12c3df=path[_0x1cc6('0x1f')](PATH);var _0x185efa=path['basename'](PATH,_0x1cc6('0x20'));var _0x51411c=_0x4dbbb9[_0x1cc6('0x11')]&&_0x19dc17[_0x1cc6('0x17')]>0x1;var _0x2cc139=[];if(!fs[_0x1cc6('0x21')](path[_0x1cc6('0x22')](_0x12c3df,_0x185efa))&&_0x51411c){fs[_0x1cc6('0x23')](path[_0x1cc6('0x22')](_0x12c3df,_0x185efa));}return BPromise['each'](_0x19dc17,function(_0x9c2cab){_0x2cc139[_0x1cc6('0x1a')](_0x9c2cab);})[_0x1cc6('0x13')](function(){for(var _0x43910a=0x0;_0x43910a<_0x2cc139[_0x1cc6('0x17')];_0x43910a+=0x1){var _0xce4440;var _0x32614c=_0x2cc139[_0x43910a];if(_0x51411c){_0xce4440=path['join'](_0x12c3df,_0x185efa,util['format'](_0x1cc6('0x24'),_0x185efa,_0x43910a,'csv'));}else{_0xce4440=path[_0x1cc6('0x22')](_0x12c3df,util[_0x1cc6('0xc')](_0x1cc6('0x25'),_0x185efa,_0x1cc6('0x26')));}fs[_0x1cc6('0x27')](_0xce4440,csv(_0x32614c));}})['then'](function(){if(_0x51411c){return new Promise(function(_0x2f46c5){zipdir(path[_0x1cc6('0x22')](_0x12c3df,_0x185efa),{'saveTo':path[_0x1cc6('0x22')](_0x12c3df,util[_0x1cc6('0xc')](_0x1cc6('0x25'),_0x185efa,_0x1cc6('0x28')))},function(_0x2807e4,_0x41ab9f){rimraf(path[_0x1cc6('0x22')](_0x12c3df,_0x185efa),function(){});_0x2f46c5('zip\x20finished');});});}})[_0x1cc6('0x13')](function(){logger[_0x1cc6('0xb')](util[_0x1cc6('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x1cc6('0xe')));return analyticExtractedReport(_0x1cc6('0x29'),_0x51411c?util[_0x1cc6('0xc')](_0x1cc6('0x25'),_0x185efa,_0x51411c?_0x1cc6('0x28'):_0x1cc6('0x26')):null);});})[_0x1cc6('0x2a')](function(_0x3e8305){logger[_0x1cc6('0xb')](util[_0x1cc6('0xc')](_0x1cc6('0x2b'),EXTRACTED_REPORT_ID,_0x1cc6('0xe')),util[_0x1cc6('0x2c')](_0x3e8305,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x1cc6('0x2d')](function(){process[_0x1cc6('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index a87831b..0652bb4 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 _0x8756=['then','flatten','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','catch','util','path','moment','html-to-pdfmake','pdfmake/src/printer','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','update','map','tableHeader','pick','toString','value','auto','body','push','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length','pageBreak','before','margin','\x20/\x20','footer','Arial','black','right','num','Empty','split','splitSizePdf','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','.pdf','join'];(function(_0x5525d4,_0x560178){var _0x58d7af=function(_0x4573cd){while(--_0x4573cd){_0x5525d4['push'](_0x5525d4['shift']());}};_0x58d7af(++_0x560178);}(_0x8756,0x182));var _0x6875=function(_0x1878cf,_0x15a9ce){_0x1878cf=_0x1878cf-0x0;var _0x45f45c=_0x8756[_0x1878cf];return _0x45f45c;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x6875('0x0'));var path=require(_0x6875('0x1'));var moment=require(_0x6875('0x2'));var htmlToPdfmake=require(_0x6875('0x3'));var PdfPrinter=require(_0x6875('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x6875('0x5'))[_0x6875('0x6')];var window=new JSDOM('')[_0x6875('0x7')];var BPromise=require(_0x6875('0x8'));var db=require(_0x6875('0x9'))['db'];var dbH=require('../../mysqldb')[_0x6875('0xa')];var logger=require(_0x6875('0xb'))(_0x6875('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0x6875('0xd')][0x2]);var QUERY=process[_0x6875('0xd')][0x3];var PATH=process[_0x6875('0xd')][0x4];var NAME=process[_0x6875('0xd')][0x5];var FORMAT=_0x6875('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x75eaca,_0x347417){var _0x88c4f9={'status':_0x75eaca};var _0x5d75f0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x347417){_0x88c4f9['savename']=_0x347417;}return db['AnalyticExtractedReport'][_0x6875('0xf')](_0x88c4f9,_0x5d75f0);}function getHeaders(_0xac445b){return _[_0x6875('0x10')](_0xac445b,function(_0x3a153b){return{'text':_0x3a153b,'style':_0x6875('0x11')};});}function getRows(_0x535342,_0x55653e){return _[_0x6875('0x10')](_0x55653e,function(_0x3fc9fe){return _(_0x3fc9fe)[_0x6875('0x12')](_0x535342)[_0x6875('0x10')](function(_0x3300a7){return _0x3300a7?_[_0x6875('0x13')](_0x3300a7):'';})[_0x6875('0x14')]();});}function createTable(_0x37d94e,_0x5a6ee4){var _0x3774ec={'widths':_['fill'](Array(_0x37d94e['length']),0x91),'heights':function(_0x381eb0){return _0x381eb0===0x0?_0x6875('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x172978=getHeaders(_0x37d94e);_0x3774ec[_0x6875('0x16')][_0x6875('0x17')](_0x172978);var _0x52ef93=getRows(_0x37d94e,_0x5a6ee4);_0x3774ec['body']=_0x3774ec['body']['concat'](_0x52ef93);return _0x3774ec;}function createTables(_0x396bb3){var _0x5e3e98=[];var _0xa1bea1=_[_0x6875('0x18')](Object[_0x6875('0x19')](_0x396bb3[0x0]),0x5);_0xa1bea1[_0x6875('0x1a')](function(_0x32d294){_0x5e3e98[_0x6875('0x17')](createTable(_0x32d294,_0x396bb3));});return _0x5e3e98;}function getPDFDocDefinition(_0x560ee2){var _0x855e6f=util[_0x6875('0x1b')](_0x6875('0x1c'),NAME,EXTRACTED_REPORT[_0x6875('0x1d')],moment(EXTRACTED_REPORT[_0x6875('0x1e')])[_0x6875('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x6875('0x1f')])[_0x6875('0x1b')](FORMAT));var _0x1a1eba=[];for(var _0x213bfc=0x0;_0x213bfc<_0x560ee2[_0x6875('0x20')];_0x213bfc++){var _0x5e3372=[];if(_0x213bfc===0x0){_0x5e3372['push']({'text':_0x855e6f,'style':'header'});}var _0x14cfc4={'table':_0x560ee2[_0x213bfc]};if(_0x213bfc>0x0){_0x14cfc4[_0x6875('0x21')]=_0x6875('0x22');_0x14cfc4[_0x6875('0x23')]=[0x0,0x46,0x0,0x0];}_0x5e3372[_0x6875('0x17')](_0x14cfc4);_0x1a1eba[_0x6875('0x17')](_0x5e3372);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x1a1eba,'footer':function(_0x3f4903,_0x1ef063){return{'text':_0x3f4903[_0x6875('0x13')]()+_0x6875('0x24')+_0x1ef063,'style':_0x6875('0x25')};},'defaultStyle':{'font':_0x6875('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x6875('0x27')},'footer':{'alignment':_0x6875('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3faed1){var _0x113500=0x1388;var _0xf86b1;if(!_0x3faed1[0x0][_0x6875('0x29')]){return analyticExtractedReport(_0x6875('0x2a'));}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6875('0x2b'),_0x6875('0x2c')]})['then'](function(_0x10f7d5){if(_0x10f7d5){_0xf86b1=_0x10f7d5;_0x113500=_0xf86b1['splitSizePdf']||0x3e8;}})['then'](function(){var _0x59aa10=[];var _0x285e87=0x0;if(_0xf86b1[_0x6875('0x2b')]){if(_0x3faed1&&_0x3faed1['length']){var _0x4c19e7=_[_0x6875('0x2d')](_0x3faed1[0x0][_0x6875('0x29')]/_0x113500);var _0x2b20b4=Number[_0x6875('0x2e')](_0x3faed1[0x0][_0x6875('0x29')]/_0x113500)?_0x3faed1[0x0][_0x6875('0x29')]%_0x113500:0x0;_0x4c19e7[_0x6875('0x1a')](function(_0x5d6f65){if(_0x5d6f65>0x0){_0x285e87+=_0x113500;}_0x59aa10['push'](dbH[_0x6875('0x2f')][_0x6875('0x30')](util[_0x6875('0x1b')](_0x6875('0x31'),QUERY,_0x113500,_0x285e87),{'type':dbH[_0x6875('0x2f')][_0x6875('0x32')][_0x6875('0x33')]}));});if(_0x2b20b4>0x0){_0x285e87+=_0x113500;_0x59aa10[_0x6875('0x17')](dbH['sequelize'][_0x6875('0x30')](util[_0x6875('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2b20b4,_0x285e87),{'type':dbH[_0x6875('0x2f')][_0x6875('0x32')]['SELECT']}));}}}else{_0x59aa10[_0x6875('0x17')](dbH[_0x6875('0x2f')]['query'](QUERY,{'type':dbH[_0x6875('0x2f')][_0x6875('0x32')][_0x6875('0x33')]}));}var _0x5a4119=path['dirname'](PATH);var _0x4eee35=path['basename'](PATH,_0x6875('0x34'));var _0xa1b044=_0xf86b1['split']&&_0x59aa10['length']>0x1;var _0x4b9598=[];if(!fs['existsSync'](path[_0x6875('0x35')](_0x5a4119,_0x4eee35))&&_0xa1b044){fs['mkdirSync'](path[_0x6875('0x35')](_0x5a4119,_0x4eee35));}return BPromise['each'](_0x59aa10,function(_0x3fff88){_0x4b9598[_0x6875('0x17')](_0x3fff88);})[_0x6875('0x36')](function(){var _0x2d551f=[];for(var _0x5799ed=0x0;_0x5799ed<_0x4b9598['length'];_0x5799ed+=0x1){var _0xb8f6ad=_0x4b9598[_0x5799ed];var _0x28842b=createTables(_[_0x6875('0x37')](_0xb8f6ad));var _0xccc11b;var _0x4d75d0=getPDFDocDefinition(_0x28842b);var _0x26e7d6=getPDFPrinter();var _0xae6cc0=_0x26e7d6[_0x6875('0x38')](_0x4d75d0);if(_0xa1b044){_0xccc11b=path[_0x6875('0x35')](_0x5a4119,_0x4eee35,util['format'](_0x6875('0x39'),_0x4eee35,_0x5799ed,_0x6875('0x3a')));}else{_0xccc11b=path[_0x6875('0x35')](_0x5a4119,util[_0x6875('0x1b')]('%s.%s',_0x4eee35,_0x6875('0x3a')));}_0x2d551f[_0x6875('0x17')](writePDFDocument(_0xae6cc0,_0xccc11b));}return Promise[_0x6875('0x3b')](_0x2d551f);})[_0x6875('0x36')](function(){if(_0xa1b044){return new Promise(function(_0xe4d656){zipdir(path[_0x6875('0x35')](_0x5a4119,_0x4eee35),{'saveTo':path[_0x6875('0x35')](_0x5a4119,util[_0x6875('0x1b')](_0x6875('0x3c'),_0x4eee35,_0x6875('0x3d')))},function(){rimraf(path[_0x6875('0x35')](_0x5a4119,_0x4eee35),function(){});_0xe4d656(_0x6875('0x3e'));});});}})[_0x6875('0x36')](function(){if(!_0xa1b044)return;rimraf(path['join'](_0x5a4119,_0x4eee35),function(){});})[_0x6875('0x36')](function(){logger[_0x6875('0x3f')](util[_0x6875('0x1b')](_0x6875('0x40'),EXTRACTED_REPORT_ID,_0x6875('0x41')));return analyticExtractedReport(_0x6875('0x42'),_0xa1b044?util[_0x6875('0x1b')](_0x6875('0x3c'),_0x4eee35,_0xa1b044?_0x6875('0x3d'):_0x6875('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6875('0x3f')](util[_0x6875('0x1b')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6875('0x41')));return db['AnalyticExtractedReport'][_0x6875('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x306c46){EXTRACTED_REPORT=_0x306c46;return dbH[_0x6875('0x2f')][_0x6875('0x30')](util['format'](_0x6875('0x44'),QUERY),{'type':dbH[_0x6875('0x2f')][_0x6875('0x32')][_0x6875('0x33')]});})[_0x6875('0x36')](extractReport)['catch'](function(_0x3688b5){logger[_0x6875('0x3f')](util[_0x6875('0x1b')](_0x6875('0x45'),EXTRACTED_REPORT_ID,_0x6875('0x41')),util[_0x6875('0x46')](_0x3688b5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x6875('0x47')](function(){process[_0x6875('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x143835=new PdfPrinter({'Arial':{'normal':__dirname+_0x6875('0x49'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x6875('0x4a'),'bolditalics':__dirname+_0x6875('0x4b')}});return _0x143835;}function getPDFDocDefinitionFromHTML(_0x18c526,_0x400483){var _0x442c27=util[_0x6875('0x1b')]('%s\x20#%d',_0x400483[_0x6875('0x4c')],_0x400483[_0x6875('0x4d')]);var _0x4efea4=moment()[_0x6875('0x1b')](_0x6875('0x4e'))[_0x6875('0x13')]();var _0x2a9db1=htmlToPdfmake(_0x18c526,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2a9db1],'defaultStyle':{'font':_0x6875('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x6875('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x6875('0x4f')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x6875('0x50')}];},'footer':function(_0x4c5e4a,_0x450919){return[{'text':util[_0x6875('0x1b')](_0x6875('0x51'),_0x442c27,_0x4c5e4a,_0x450919,_0x4efea4),'style':_0x6875('0x25')}];}};}function writePDFDocument(_0x165adc,_0x16d237){return new Promise(function(_0x2ac2df,_0x4247c7){var _0x442563=_0x165adc[_0x6875('0x52')](fs[_0x6875('0x53')](_0x16d237));_0x442563['on']('finish',function(){_0x2ac2df(_0x6875('0x54'));});_0x442563['on'](_0x6875('0x55'),function(_0x26445c){_0x4247c7(_0x26445c);});_0x165adc[_0x6875('0x56')]();});}exports['createPdfFromHTML']=function(_0x267a66,_0x4e379){var _0x2bb9dc=getPDFPrinter();var _0x4087f9=getPDFDocDefinitionFromHTML(_0x267a66,_0x4e379);var _0xbfecaf=_0x2bb9dc[_0x6875('0x38')](_0x4087f9);return writePDFDocument(_0xbfecaf,_0x4e379[_0x6875('0x1')])[_0x6875('0x57')](function(_0x2a8ed8){throw _0x2a8ed8;});}; \ No newline at end of file +var _0xcdc7=['\x20/\x20','Arial','black','right','num','Empty','Setting','split','splitSizePdf','then','range','isInteger','sequelize','QueryTypes','SELECT','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','existsSync','join','each','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','footer','pipe','createWriteStream','finish','error','end','createPdfFromHTML','path','util','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','bluebird','../../mysqldb','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','toString','value','fill','length','auto','body','push','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','header','pageBreak','margin','landscape'];(function(_0x27f751,_0x3d29be){var _0x406f2d=function(_0x439db0){while(--_0x439db0){_0x27f751['push'](_0x27f751['shift']());}};_0x406f2d(++_0x3d29be);}(_0xcdc7,0xe2));var _0x7cdc=function(_0x2eb8b6,_0xd3e05b){_0x2eb8b6=_0x2eb8b6-0x0;var _0x51f39f=_0xcdc7[_0x2eb8b6];return _0x51f39f;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x7cdc('0x0'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0x7cdc('0x1'));var PdfPrinter=require(_0x7cdc('0x2'));var zipdir=require(_0x7cdc('0x3'));var rimraf=require('rimraf');var JSDOM=require(_0x7cdc('0x4'))[_0x7cdc('0x5')];var window=new JSDOM('')['window'];var BPromise=require(_0x7cdc('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x7cdc('0x7'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x7cdc('0x8')][0x3];var PATH=process[_0x7cdc('0x8')][0x4];var NAME=process[_0x7cdc('0x8')][0x5];var FORMAT=_0x7cdc('0x9');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2beab3,_0x2ab238){var _0x3f7ed0={'status':_0x2beab3};var _0x2d766f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ab238){_0x3f7ed0[_0x7cdc('0xa')]=_0x2ab238;}return db[_0x7cdc('0xb')][_0x7cdc('0xc')](_0x3f7ed0,_0x2d766f);}function getHeaders(_0x153fe8){return _['map'](_0x153fe8,function(_0x367ee3){return{'text':_0x367ee3,'style':_0x7cdc('0xd')};});}function getRows(_0x3ef282,_0x587899){return _[_0x7cdc('0xe')](_0x587899,function(_0x171872){return _(_0x171872)['pick'](_0x3ef282)[_0x7cdc('0xe')](function(_0x5f361b){return _0x5f361b?_[_0x7cdc('0xf')](_0x5f361b):'';})[_0x7cdc('0x10')]();});}function createTable(_0x58f894,_0x9e2180){var _0x8c60fc={'widths':_[_0x7cdc('0x11')](Array(_0x58f894[_0x7cdc('0x12')]),0x91),'heights':function(_0x3206b1){return _0x3206b1===0x0?_0x7cdc('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x268037=getHeaders(_0x58f894);_0x8c60fc[_0x7cdc('0x14')][_0x7cdc('0x15')](_0x268037);var _0x366eb0=getRows(_0x58f894,_0x9e2180);_0x8c60fc[_0x7cdc('0x14')]=_0x8c60fc[_0x7cdc('0x14')][_0x7cdc('0x16')](_0x366eb0);return _0x8c60fc;}function createTables(_0x360e2c){var _0x463f61=[];var _0x303a8c=_[_0x7cdc('0x17')](Object['keys'](_0x360e2c[0x0]),0x5);_0x303a8c[_0x7cdc('0x18')](function(_0x387406){_0x463f61[_0x7cdc('0x15')](createTable(_0x387406,_0x360e2c));});return _0x463f61;}function getPDFDocDefinition(_0x52f494){var _0x44a212=util[_0x7cdc('0x19')](_0x7cdc('0x1a'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x7cdc('0x1b')])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x7cdc('0x19')](FORMAT));var _0x7584d3=[];for(var _0x4940c6=0x0;_0x4940c6<_0x52f494[_0x7cdc('0x12')];_0x4940c6++){var _0x41d40d=[];if(_0x4940c6===0x0){_0x41d40d['push']({'text':_0x44a212,'style':_0x7cdc('0x1c')});}var _0x107896={'table':_0x52f494[_0x4940c6]};if(_0x4940c6>0x0){_0x107896[_0x7cdc('0x1d')]='before';_0x107896[_0x7cdc('0x1e')]=[0x0,0x46,0x0,0x0];}_0x41d40d['push'](_0x107896);_0x7584d3[_0x7cdc('0x15')](_0x41d40d);}return{'pageSize':'A4','pageOrientation':_0x7cdc('0x1f'),'content':_0x7584d3,'footer':function(_0x4ad95d,_0x331a5a){return{'text':_0x4ad95d['toString']()+_0x7cdc('0x20')+_0x331a5a,'style':'footer'};},'defaultStyle':{'font':_0x7cdc('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x7cdc('0x22')},'footer':{'alignment':_0x7cdc('0x23'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5ed300){var _0x10d587=0x1388;var _0x3ded9b;if(!_0x5ed300[0x0][_0x7cdc('0x24')]){return analyticExtractedReport(_0x7cdc('0x25'));}return db[_0x7cdc('0x26')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7cdc('0x27'),_0x7cdc('0x28')]})[_0x7cdc('0x29')](function(_0x473ea3){if(_0x473ea3){_0x3ded9b=_0x473ea3;_0x10d587=_0x3ded9b[_0x7cdc('0x28')]||0x3e8;}})[_0x7cdc('0x29')](function(){var _0x460fb1=[];var _0x508078=0x0;if(_0x3ded9b[_0x7cdc('0x27')]){if(_0x5ed300&&_0x5ed300[_0x7cdc('0x12')]){var _0xc1776d=_[_0x7cdc('0x2a')](_0x5ed300[0x0][_0x7cdc('0x24')]/_0x10d587);var _0x4d2a74=Number[_0x7cdc('0x2b')](_0x5ed300[0x0]['num']/_0x10d587)?_0x5ed300[0x0]['num']%_0x10d587:0x0;_0xc1776d[_0x7cdc('0x18')](function(_0x2869ce){if(_0x2869ce>0x0){_0x508078+=_0x10d587;}_0x460fb1['push'](dbH[_0x7cdc('0x2c')]['query'](util[_0x7cdc('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x10d587,_0x508078),{'type':dbH['sequelize'][_0x7cdc('0x2d')][_0x7cdc('0x2e')]}));});if(_0x4d2a74>0x0){_0x508078+=_0x10d587;_0x460fb1[_0x7cdc('0x15')](dbH['sequelize'][_0x7cdc('0x2f')](util['format'](_0x7cdc('0x30'),QUERY,_0x4d2a74,_0x508078),{'type':dbH[_0x7cdc('0x2c')][_0x7cdc('0x2d')]['SELECT']}));}}}else{_0x460fb1[_0x7cdc('0x15')](dbH[_0x7cdc('0x2c')]['query'](QUERY,{'type':dbH[_0x7cdc('0x2c')][_0x7cdc('0x2d')][_0x7cdc('0x2e')]}));}var _0x176a14=path[_0x7cdc('0x31')](PATH);var _0x5ae069=path[_0x7cdc('0x32')](PATH,_0x7cdc('0x33'));var _0x1bb813=_0x3ded9b['split']&&_0x460fb1[_0x7cdc('0x12')]>0x1;var _0x30715c=[];if(!fs[_0x7cdc('0x34')](path[_0x7cdc('0x35')](_0x176a14,_0x5ae069))&&_0x1bb813){fs['mkdirSync'](path[_0x7cdc('0x35')](_0x176a14,_0x5ae069));}return BPromise[_0x7cdc('0x36')](_0x460fb1,function(_0x18ddb1){_0x30715c[_0x7cdc('0x15')](_0x18ddb1);})[_0x7cdc('0x29')](function(){var _0x55d907=[];for(var _0x590e4a=0x0;_0x590e4a<_0x30715c[_0x7cdc('0x12')];_0x590e4a+=0x1){var _0x4fae76=_0x30715c[_0x590e4a];var _0x58d896=createTables(_['flatten'](_0x4fae76));var _0x26b233;var _0x3517db=getPDFDocDefinition(_0x58d896);var _0x264d0c=getPDFPrinter();var _0x712e41=_0x264d0c[_0x7cdc('0x37')](_0x3517db);if(_0x1bb813){_0x26b233=path['join'](_0x176a14,_0x5ae069,util[_0x7cdc('0x19')](_0x7cdc('0x38'),_0x5ae069,_0x590e4a,_0x7cdc('0x39')));}else{_0x26b233=path[_0x7cdc('0x35')](_0x176a14,util[_0x7cdc('0x19')](_0x7cdc('0x3a'),_0x5ae069,'pdf'));}_0x55d907['push'](writePDFDocument(_0x712e41,_0x26b233));}return Promise[_0x7cdc('0x3b')](_0x55d907);})['then'](function(){if(_0x1bb813){return new Promise(function(_0x277e92){zipdir(path[_0x7cdc('0x35')](_0x176a14,_0x5ae069),{'saveTo':path['join'](_0x176a14,util[_0x7cdc('0x19')](_0x7cdc('0x3a'),_0x5ae069,_0x7cdc('0x3c')))},function(){rimraf(path[_0x7cdc('0x35')](_0x176a14,_0x5ae069),function(){});_0x277e92('zip\x20finished');});});}})[_0x7cdc('0x29')](function(){if(!_0x1bb813)return;rimraf(path[_0x7cdc('0x35')](_0x176a14,_0x5ae069),function(){});})[_0x7cdc('0x29')](function(){logger[_0x7cdc('0x3d')](util[_0x7cdc('0x19')](_0x7cdc('0x3e'),EXTRACTED_REPORT_ID,_0x7cdc('0x3f')));return analyticExtractedReport(_0x7cdc('0x40'),_0x1bb813?util['format'](_0x7cdc('0x3a'),_0x5ae069,_0x1bb813?_0x7cdc('0x3c'):_0x7cdc('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x7cdc('0x3d')](util[_0x7cdc('0x19')](_0x7cdc('0x41'),EXTRACTED_REPORT_ID,_0x7cdc('0x3f')));return db[_0x7cdc('0xb')][_0x7cdc('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x7cdc('0x29')](function(_0x10f94f){EXTRACTED_REPORT=_0x10f94f;return dbH[_0x7cdc('0x2c')][_0x7cdc('0x2f')](util[_0x7cdc('0x19')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x7cdc('0x2d')][_0x7cdc('0x2e')]});})[_0x7cdc('0x29')](extractReport)[_0x7cdc('0x43')](function(_0x29cd0f){logger[_0x7cdc('0x3d')](util[_0x7cdc('0x19')](_0x7cdc('0x44'),EXTRACTED_REPORT_ID,_0x7cdc('0x3f')),util[_0x7cdc('0x45')](_0x29cd0f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7cdc('0x46'));})[_0x7cdc('0x47')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x56a6bd=new PdfPrinter({'Arial':{'normal':__dirname+_0x7cdc('0x48'),'bold':__dirname+_0x7cdc('0x49'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x56a6bd;}function getPDFDocDefinitionFromHTML(_0x36ae78,_0x5a9266){var _0x174352=util['format'](_0x7cdc('0x4a'),_0x5a9266[_0x7cdc('0x4b')],_0x5a9266['interactionId']);var _0x11d4c2=moment()[_0x7cdc('0x19')](_0x7cdc('0x4c'))['toString']();var _0x2d3263=htmlToPdfmake(_0x36ae78,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2d3263],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x7cdc('0x4d'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x7cdc('0x4d')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x7cdc('0x1c')}];},'footer':function(_0x4ba9c5,_0x4269f9){return[{'text':util[_0x7cdc('0x19')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x174352,_0x4ba9c5,_0x4269f9,_0x11d4c2),'style':_0x7cdc('0x4e')}];}};}function writePDFDocument(_0x15d29c,_0x5e19d8){return new Promise(function(_0x435948,_0x40a9ad){var _0x3d9fa4=_0x15d29c[_0x7cdc('0x4f')](fs[_0x7cdc('0x50')](_0x5e19d8));_0x3d9fa4['on'](_0x7cdc('0x51'),function(){_0x435948(_0x7cdc('0x51'));});_0x3d9fa4['on'](_0x7cdc('0x52'),function(_0xc4c0b5){_0x40a9ad(_0xc4c0b5);});_0x15d29c[_0x7cdc('0x53')]();});}exports[_0x7cdc('0x54')]=function(_0x55dcb3,_0x3f4915){var _0x1d64f7=getPDFPrinter();var _0xa0cff6=getPDFDocDefinitionFromHTML(_0x55dcb3,_0x3f4915);var _0x1130a4=_0x1d64f7[_0x7cdc('0x37')](_0xa0cff6);return writePDFDocument(_0x1130a4,_0x3f4915[_0x7cdc('0x55')])['catch'](function(_0x308486){throw _0x308486;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index e2ba208..e7bab91 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 _0x5c38=['../../config/logger','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','length','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','writeFileSync','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','%s.%s','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','inspect','Failed','finally','exit','path','json2xls','bluebird','rimraf','../../mysqldb','dbH'];(function(_0x375b4b,_0x4bde7b){var _0x5450f6=function(_0x5ad847){while(--_0x5ad847){_0x375b4b['push'](_0x375b4b['shift']());}};_0x5450f6(++_0x4bde7b);}(_0x5c38,0xe0));var _0x85c3=function(_0x3323db,_0x2ff20e){_0x3323db=_0x3323db-0x0;var _0x1b8e56=_0x5c38[_0x3323db];return _0x1b8e56;};'use strict';var util=require('util');var path=require(_0x85c3('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x85c3('0x1'));var BPromise=require(_0x85c3('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x85c3('0x3'));var db=require(_0x85c3('0x4'))['db'];var dbH=require(_0x85c3('0x4'))[_0x85c3('0x5')];var logger=require(_0x85c3('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x85c3('0x7')][0x2]);var QUERY=process[_0x85c3('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xe19177,_0x142421){var _0xaf804c={'status':_0xe19177};var _0x2a167e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x142421){_0xaf804c['savename']=_0x142421;}return db[_0x85c3('0x8')]['update'](_0xaf804c,_0x2a167e);}function main(){var _0x5e876a=0x1388;var _0x24bfb0;logger[_0x85c3('0x9')](util[_0x85c3('0xa')](_0x85c3('0xb'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x85c3('0xc')][_0x85c3('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x85c3('0xe'),_0x85c3('0xf')]})[_0x85c3('0x10')](function(_0x10c057){if(_0x10c057){_0x24bfb0=_0x10c057;_0x5e876a=_0x24bfb0[_0x85c3('0xf')]||0x1388;}})[_0x85c3('0x10')](function(){return dbH[_0x85c3('0x11')][_0x85c3('0x12')](util['format'](_0x85c3('0x13'),QUERY),{'type':dbH[_0x85c3('0x11')]['QueryTypes'][_0x85c3('0x14')]});})[_0x85c3('0x10')](function(_0xd85f9d){if(!_0xd85f9d[0x0][_0x85c3('0x15')]){return analyticExtractedReport('Empty');}var _0x20cd56=[];var _0x23fb46=0x0;if(_0x24bfb0[_0x85c3('0xe')]){if(_0xd85f9d&&_0xd85f9d[_0x85c3('0x16')]){var _0xce9c5b=_['range'](_0xd85f9d[0x0][_0x85c3('0x15')]/_0x5e876a);var _0x39c94e=Number[_0x85c3('0x17')](_0xd85f9d[0x0][_0x85c3('0x15')]/_0x5e876a)?_0xd85f9d[0x0][_0x85c3('0x15')]%_0x5e876a:0x0;_0xce9c5b['forEach'](function(_0x10b087){if(_0x10b087>0x0){_0x23fb46+=_0x5e876a;}_0x20cd56[_0x85c3('0x18')](dbH[_0x85c3('0x11')][_0x85c3('0x12')](util['format'](_0x85c3('0x19'),QUERY,_0x5e876a,_0x23fb46),{'type':dbH[_0x85c3('0x11')][_0x85c3('0x1a')][_0x85c3('0x14')]}));});if(_0x39c94e>0x0){_0x23fb46+=_0x5e876a;_0x20cd56[_0x85c3('0x18')](dbH[_0x85c3('0x11')][_0x85c3('0x12')](util['format'](_0x85c3('0x19'),QUERY,_0x39c94e,_0x23fb46),{'type':dbH[_0x85c3('0x11')][_0x85c3('0x1a')][_0x85c3('0x14')]}));}}}else{_0x20cd56['push'](dbH[_0x85c3('0x11')]['query'](QUERY,{'type':dbH['sequelize'][_0x85c3('0x1a')][_0x85c3('0x14')]}));}var _0x2eeb27=path['dirname'](PATH);var _0x321b67=path['basename'](PATH,_0x85c3('0x1b'));var _0x5a6864=_0x24bfb0[_0x85c3('0xe')]&&_0x20cd56['length']>0x1;var _0x24e3dc=[];if(!fs[_0x85c3('0x1c')](path['join'](_0x2eeb27,_0x321b67))&&_0x5a6864){fs[_0x85c3('0x1d')](path[_0x85c3('0x1e')](_0x2eeb27,_0x321b67));}return BPromise[_0x85c3('0x1f')](_0x20cd56,function(_0x58e5ba){_0x24e3dc[_0x85c3('0x18')](_0x58e5ba);})[_0x85c3('0x10')](function(){for(var _0x13b25d=0x0;_0x13b25d<_0x24e3dc[_0x85c3('0x16')];_0x13b25d+=0x1){var _0x42d504;var _0x527b0a=_0x24e3dc[_0x13b25d];if(_0x5a6864){_0x42d504=path[_0x85c3('0x1e')](_0x2eeb27,_0x321b67,util[_0x85c3('0xa')](_0x85c3('0x20'),_0x321b67,_0x13b25d,_0x85c3('0x21')));}else{_0x42d504=path[_0x85c3('0x1e')](_0x2eeb27,util[_0x85c3('0xa')]('%s.%s',_0x321b67,'xlsx'));}fs[_0x85c3('0x22')](_0x42d504,json2xls(_0x527b0a),_0x85c3('0x23'));}})[_0x85c3('0x10')](function(){if(_0x5a6864){return new Promise(function(_0x31d301){zipdir(path[_0x85c3('0x1e')](_0x2eeb27,_0x321b67),{'saveTo':path[_0x85c3('0x1e')](_0x2eeb27,util[_0x85c3('0xa')]('%s.%s',_0x321b67,'zip'))},function(_0x299178,_0x54f35e){rimraf(path[_0x85c3('0x1e')](_0x2eeb27,_0x321b67),function(){});_0x31d301('zip\x20finished');});});}})[_0x85c3('0x10')](function(){logger[_0x85c3('0x9')](util[_0x85c3('0xa')](_0x85c3('0x24'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x5a6864?util['format'](_0x85c3('0x25'),_0x321b67,_0x5a6864?_0x85c3('0x26'):_0x85c3('0x21')):null);});})[_0x85c3('0x27')](function(_0x2c1756){logger[_0x85c3('0x9')](util[_0x85c3('0xa')](_0x85c3('0x28'),EXTRACTED_REPORT_ID,_0x85c3('0x29')),util[_0x85c3('0x2a')](_0x2c1756,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x85c3('0x2b'));})[_0x85c3('0x2c')](function(){process[_0x85c3('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xbf17=['Failed','finally','exit','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','find','splitSizeXlsx','then','query','sequelize','num','split','length','range','isInteger','forEach','push','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect'];(function(_0x46cd49,_0x5db390){var _0x44c67d=function(_0x4de579){while(--_0x4de579){_0x46cd49['push'](_0x46cd49['shift']());}};_0x44c67d(++_0x5db390);}(_0xbf17,0x69));var _0x7bf1=function(_0x28c132,_0x1f5027){_0x28c132=_0x28c132-0x0;var _0x12109d=_0xbf17[_0x28c132];return _0x12109d;};'use strict';var util=require(_0x7bf1('0x0'));var path=require(_0x7bf1('0x1'));var _=require(_0x7bf1('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x7bf1('0x3'));var zipdir=require(_0x7bf1('0x4'));var rimraf=require(_0x7bf1('0x5'));var db=require(_0x7bf1('0x6'))['db'];var dbH=require(_0x7bf1('0x6'))[_0x7bf1('0x7')];var logger=require(_0x7bf1('0x8'))(_0x7bf1('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x7bf1('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x24080b,_0x49df0d){var _0x1b6d7a={'status':_0x24080b};var _0x8c3df4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x49df0d){_0x1b6d7a[_0x7bf1('0xb')]=_0x49df0d;}return db[_0x7bf1('0xc')][_0x7bf1('0xd')](_0x1b6d7a,_0x8c3df4);}function main(){var _0x5d92df=0x1388;var _0x1dc744;logger[_0x7bf1('0xe')](util[_0x7bf1('0xf')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0x7bf1('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})['then'](function(_0xb398e9){if(_0xb398e9){_0x1dc744=_0xb398e9;_0x5d92df=_0x1dc744[_0x7bf1('0x11')]||0x1388;}})[_0x7bf1('0x12')](function(){return dbH['sequelize'][_0x7bf1('0x13')](util[_0x7bf1('0xf')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x7bf1('0x14')]['QueryTypes']['SELECT']});})['then'](function(_0x22abb6){if(!_0x22abb6[0x0][_0x7bf1('0x15')]){return analyticExtractedReport('Empty');}var _0x1b4874=[];var _0x330e7b=0x0;if(_0x1dc744[_0x7bf1('0x16')]){if(_0x22abb6&&_0x22abb6[_0x7bf1('0x17')]){var _0x17dc4a=_[_0x7bf1('0x18')](_0x22abb6[0x0][_0x7bf1('0x15')]/_0x5d92df);var _0x2d3d4d=Number[_0x7bf1('0x19')](_0x22abb6[0x0][_0x7bf1('0x15')]/_0x5d92df)?_0x22abb6[0x0][_0x7bf1('0x15')]%_0x5d92df:0x0;_0x17dc4a[_0x7bf1('0x1a')](function(_0x184eee){if(_0x184eee>0x0){_0x330e7b+=_0x5d92df;}_0x1b4874[_0x7bf1('0x1b')](dbH[_0x7bf1('0x14')][_0x7bf1('0x13')](util[_0x7bf1('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5d92df,_0x330e7b),{'type':dbH[_0x7bf1('0x14')][_0x7bf1('0x1c')][_0x7bf1('0x1d')]}));});if(_0x2d3d4d>0x0){_0x330e7b+=_0x5d92df;_0x1b4874['push'](dbH[_0x7bf1('0x14')]['query'](util['format'](_0x7bf1('0x1e'),QUERY,_0x2d3d4d,_0x330e7b),{'type':dbH['sequelize'][_0x7bf1('0x1c')][_0x7bf1('0x1d')]}));}}}else{_0x1b4874[_0x7bf1('0x1b')](dbH[_0x7bf1('0x14')]['query'](QUERY,{'type':dbH['sequelize'][_0x7bf1('0x1c')]['SELECT']}));}var _0x11c229=path['dirname'](PATH);var _0x4be9e1=path['basename'](PATH,_0x7bf1('0x1f'));var _0x4b9978=_0x1dc744[_0x7bf1('0x16')]&&_0x1b4874[_0x7bf1('0x17')]>0x1;var _0x3597e5=[];if(!fs[_0x7bf1('0x20')](path[_0x7bf1('0x21')](_0x11c229,_0x4be9e1))&&_0x4b9978){fs[_0x7bf1('0x22')](path[_0x7bf1('0x21')](_0x11c229,_0x4be9e1));}return BPromise[_0x7bf1('0x23')](_0x1b4874,function(_0x7182b8){_0x3597e5[_0x7bf1('0x1b')](_0x7182b8);})[_0x7bf1('0x12')](function(){for(var _0x2b78ee=0x0;_0x2b78ee<_0x3597e5[_0x7bf1('0x17')];_0x2b78ee+=0x1){var _0x57ce4e;var _0x5309b1=_0x3597e5[_0x2b78ee];if(_0x4b9978){_0x57ce4e=path['join'](_0x11c229,_0x4be9e1,util[_0x7bf1('0xf')](_0x7bf1('0x24'),_0x4be9e1,_0x2b78ee,'xlsx'));}else{_0x57ce4e=path['join'](_0x11c229,util[_0x7bf1('0xf')](_0x7bf1('0x25'),_0x4be9e1,'xlsx'));}fs[_0x7bf1('0x26')](_0x57ce4e,json2xls(_0x5309b1),_0x7bf1('0x27'));}})[_0x7bf1('0x12')](function(){if(_0x4b9978){return new Promise(function(_0x509955){zipdir(path['join'](_0x11c229,_0x4be9e1),{'saveTo':path['join'](_0x11c229,util['format'](_0x7bf1('0x25'),_0x4be9e1,_0x7bf1('0x28')))},function(_0x58bb34,_0x15de22){rimraf(path[_0x7bf1('0x21')](_0x11c229,_0x4be9e1),function(){});_0x509955(_0x7bf1('0x29'));});});}})['then'](function(){logger[_0x7bf1('0xe')](util['format'](_0x7bf1('0x2a'),EXTRACTED_REPORT_ID,_0x7bf1('0x2b')));return analyticExtractedReport(_0x7bf1('0x2c'),_0x4b9978?util[_0x7bf1('0xf')](_0x7bf1('0x25'),_0x4be9e1,_0x4b9978?_0x7bf1('0x28'):'xlsx'):null);});})[_0x7bf1('0x2d')](function(_0x2c4be7){logger[_0x7bf1('0xe')](util[_0x7bf1('0xf')](_0x7bf1('0x2e'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x7bf1('0x2f')](_0x2c4be7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7bf1('0x30'));})[_0x7bf1('0x31')](function(){process[_0x7bf1('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 2a227b7..37da60e 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 _0x1043=['createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','concat','Hangup','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','then','intervals','VoiceExtension','findAll','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','priority','extensions','find','push','format','type','context','inbound','Set','CDR(routeid)=','VoiceExtensionId','outbound','extension','CDR(destination)=','${EXTEN:','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase'];(function(_0x588a9c,_0x434e22){var _0x32ab03=function(_0x4928e5){while(--_0x4928e5){_0x588a9c['push'](_0x588a9c['shift']());}};_0x32ab03(++_0x434e22);}(_0x1043,0xfc));var _0x3104=function(_0x306133,_0x9023e1){_0x306133=_0x306133-0x0;var _0x3cd580=_0x1043[_0x306133];return _0x3cd580;};'use strict';var _=require(_0x3104('0x0'));var util=require(_0x3104('0x1'));function rewrite(_0x3e3936,_0x2bed32){var _0xe1b3c1=this;return _0x3e3936[_0x3104('0x2')][_0x3104('0x3')]['findAll']({'raw':!![]})[_0x3104('0x4')](function(_0x184a5a){_0xe1b3c1[_0x3104('0x5')]=_0x184a5a;return _0x3e3936[_0x3104('0x2')][_0x3104('0x6')][_0x3104('0x7')]({'where':{'IntervalId':_0x2bed32[_0x3104('0x8')]},'raw':!![]});})[_0x3104('0x4')](function(_0x19a94f){return _0x3e3936[_0x3104('0x2')][_0x3104('0x6')]['findAll']({'where':{'exten':{'$in':_[_0x3104('0x9')](_[_0x3104('0xa')](_0x19a94f,_0x3104('0xb')))}},'order':[{'raw':_0x3104('0xc')}],'raw':!![]});})[_0x3104('0x4')](function(_0x4ee0c9){var _0x35bcac=_[_0x3104('0xd')](_0x4ee0c9,{'priority':'1'});var _0x3dc343=_[_0x3104('0xd')](_0x4ee0c9,{'isApp':0x1});var _0x42f5c0=_['groupBy'](_0x3dc343,'exten');var _0x568a25=[_0x3104('0xe'),_0x3104('0xf')];var _0x81a184=[];var _0x484400=[];for(var _0x1f65f6 in _0x42f5c0){if(_0x42f5c0['hasOwnProperty'](_0x1f65f6)){_0xe1b3c1[_0x3104('0x10')]=0x2;_0xe1b3c1[_0x3104('0x11')]=[];_0xe1b3c1['extension']=_[_0x3104('0x12')](_0x35bcac,{'exten':_0x42f5c0[_0x1f65f6][0x0]['exten']});_0xe1b3c1[_0x3104('0x11')][_0x3104('0x13')]({'type':_0x42f5c0[_0x1f65f6][0x0]['type'],'app':'Set','appdata':util[_0x3104('0x14')]('CDR(type)=%s',_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x15')]),'context':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x16')],'exten':_0x42f5c0[_0x1f65f6][0x0]['exten'],'priority':_0xe1b3c1[_0x3104('0x10')]++,'VoiceExtensionId':_0x42f5c0[_0x1f65f6][0x0]['VoiceExtensionId']});if(_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x15')]===_0x3104('0x17')){_0xe1b3c1[_0x3104('0x11')]['push']({'type':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x15')],'app':_0x3104('0x18'),'appdata':_0x3104('0x19')+_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x1a')],'context':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x16')],'exten':_0x42f5c0[_0x1f65f6][0x0]['exten'],'priority':_0xe1b3c1[_0x3104('0x10')]++,'VoiceExtensionId':_0x42f5c0[_0x1f65f6][0x0]['VoiceExtensionId']});}else if(_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x15')]===_0x3104('0x1b')){if(_0xe1b3c1[_0x3104('0x1c')]){_0xe1b3c1[_0x3104('0x11')]['push']({'type':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x15')],'app':_0x3104('0x18'),'appdata':_0x3104('0x1d')+(_0xe1b3c1[_0x3104('0x1c')]['cutdigits']?_0x3104('0x1e')+_0xe1b3c1[_0x3104('0x1c')][_0x3104('0x1f')]+'}':'${EXTEN}'),'context':_0x42f5c0[_0x1f65f6][0x0]['context'],'exten':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0xb')],'priority':_0xe1b3c1[_0x3104('0x10')]++,'VoiceExtensionId':_0x42f5c0[_0x1f65f6][0x0]['VoiceExtensionId']});}_0xe1b3c1[_0x3104('0x11')]['push']({'type':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x15')],'app':_0x3104('0x18'),'appdata':_0x3104('0x19')+_0x42f5c0[_0x1f65f6][0x0]['VoiceExtensionId'],'context':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x16')],'exten':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0xb')],'priority':_0xe1b3c1['priority']++,'VoiceExtensionId':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x1a')]});var _0x1453ca=_0xe1b3c1[_0x3104('0x10')]++;_0xe1b3c1[_0x3104('0x11')]['push']({'type':_0x42f5c0[_0x1f65f6][0x0]['type'],'app':_0x3104('0x20'),'appdata':_0x3104('0x21')+(_0x1453ca+0x2)+_0x3104('0x22')+(_0x1453ca+0x1)+')','context':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x16')],'exten':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0xb')],'priority':_0x1453ca,'VoiceExtensionId':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x1a')]});if(_0xe1b3c1['extension']){_0xe1b3c1[_0x3104('0x11')][_0x3104('0x13')]({'type':_0x42f5c0[_0x1f65f6][0x0]['type'],'app':'Set','appdata':_0xe1b3c1['extension'][_0x3104('0x1f')]?_0x3104('0x23')+_0xe1b3c1['extension']['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x16')],'exten':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0xb')],'priority':_0xe1b3c1[_0x3104('0x10')]++,'VoiceExtensionId':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x1a')]});}_0xe1b3c1[_0x3104('0x11')][_0x3104('0x13')]({'type':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x15')],'app':_0x3104('0x18'),'appdata':_0x3104('0x24')+_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x1a')],'context':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x16')],'exten':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0xb')],'priority':_0xe1b3c1['priority']++,'VoiceExtensionId':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x1a')]});if(_0xe1b3c1[_0x3104('0x1c')]&&_0xe1b3c1[_0x3104('0x1c')][_0x3104('0x25')](_0x3104('0x26'))&&_0xe1b3c1[_0x3104('0x1c')]['recordingFormat']!==_0x3104('0x27')){_0xe1b3c1[_0x3104('0x11')][_0x3104('0x13')]({'type':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x15')],'app':_0x3104('0x18'),'appdata':_0x3104('0x28'),'context':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x16')],'exten':_0x42f5c0[_0x1f65f6][0x0]['exten'],'priority':_0xe1b3c1[_0x3104('0x10')]++,'VoiceExtensionId':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x1a')]});_0xe1b3c1[_0x3104('0x11')]['push']({'type':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x15')],'app':_0x3104('0x18'),'appdata':_0x3104('0x29')+_0xe1b3c1[_0x3104('0x1c')]['recordingFormat']||_0x3104('0x2a'),'context':_0x42f5c0[_0x1f65f6][0x0]['context'],'exten':_0x42f5c0[_0x1f65f6][0x0]['exten'],'priority':_0xe1b3c1[_0x3104('0x10')]++,'VoiceExtensionId':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x1a')]});}}_0xe1b3c1[_0x3104('0x11')][_0x3104('0x13')]({'type':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x15')],'app':_0x3104('0x18'),'appdata':_0x3104('0x2b'),'context':_0x42f5c0[_0x1f65f6][0x0]['context'],'exten':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0xb')],'priority':_0xe1b3c1['priority']++,'VoiceExtensionId':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x1a')]});_0xe1b3c1[_0x3104('0x11')][_0x3104('0x13')]({'type':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x15')],'app':_0x3104('0x18'),'appdata':_0x3104('0x2c'),'context':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x16')],'exten':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0xb')],'priority':_0xe1b3c1['priority']++,'VoiceExtensionId':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x1a')]});_0xe1b3c1[_0x3104('0x11')][_0x3104('0x13')]({'type':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x15')],'app':_0x3104('0x18'),'appdata':_0x3104('0x2d'),'context':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x16')],'exten':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0xb')],'priority':_0xe1b3c1[_0x3104('0x10')]++,'VoiceExtensionId':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x1a')]});for(var _0x11618b=0x0,_0x4d7023=0x0;_0x11618b<_0x42f5c0[_0x1f65f6][_0x3104('0x2e')];_0x11618b+=0x1,_0x4d7023=0x0){var _0x23f15e=_0x42f5c0[_0x1f65f6][_0x11618b];if(_0x23f15e[_0x3104('0x15')]){_0x23f15e[_0x3104('0x15')]=_0x23f15e[_0x3104('0x15')][_0x3104('0x2f')]();}var _0x243437=[];var _0x26c799=[];delete _0x23f15e['id'];delete _0x23f15e[_0x3104('0x30')];delete _0x23f15e[_0x3104('0x31')];var _0x4a2934=_0x23f15e[_0x3104('0x32')]!==_0x3104('0x33')?[_0x23f15e[_0x3104('0x32')]]:_0x23f15e[_0x3104('0x8')]?_[_0x3104('0xa')](_[_0x3104('0xd')](_0xe1b3c1[_0x3104('0x5')],{'IntervalId':_0x23f15e[_0x3104('0x8')]}),_0x3104('0x32')):[];if(_0x23f15e[_0x3104('0x25')](_0x3104('0x34'))){if(_0x23f15e[_0x3104('0x34')]&&_0x23f15e[_0x3104('0x34')]!=='--'){_0x243437['push']({'type':_0x23f15e[_0x3104('0x15')],'app':'Set','appdata':_0x3104('0x35')+_0x23f15e[_0x3104('0x34')],'context':_0x23f15e['context'],'exten':_0x23f15e[_0x3104('0xb')],'priority':_0x4a2934[_0x3104('0x2e')]+_0xe1b3c1[_0x3104('0x10')]+_0x4d7023++,'VoiceExtensionId':_0x23f15e['VoiceExtensionId']});}}if(_0x23f15e[_0x3104('0x15')]==='outbound'&&_0x23f15e['hasOwnProperty'](_0x3104('0x36'))){if(_0x23f15e['callerID']){_0x243437['push']({'type':_0x23f15e['type'],'app':_0x3104('0x20'),'appdata':_0x3104('0x37')+_0x23f15e[_0x3104('0x36')]+')','context':_0x23f15e[_0x3104('0x16')],'exten':_0x23f15e[_0x3104('0xb')],'priority':_0x4a2934[_0x3104('0x2e')]+_0xe1b3c1['priority']+_0x4d7023++,'VoiceExtensionId':_0x23f15e['VoiceExtensionId']});}else{_0x243437['push']({'type':_0x23f15e['type'],'app':'ExecIf','appdata':_0x3104('0x38'),'context':_0x23f15e[_0x3104('0x16')],'exten':_0x23f15e[_0x3104('0xb')],'priority':_0x4a2934['length']+_0xe1b3c1[_0x3104('0x10')]+_0x4d7023++,'VoiceExtensionId':_0x23f15e[_0x3104('0x1a')]});}}if(_0x23f15e[_0x3104('0x25')](_0x3104('0x39'))){if(_0x568a25[_0x3104('0x3a')](_0x23f15e[_0x3104('0x3b')]['toLowerCase']())>=0x0&&_0x23f15e[_0x3104('0x3c')]!==_0x3104('0x3d')){if(_0x23f15e['answer']){_0x243437[_0x3104('0x13')]({'type':_0x23f15e[_0x3104('0x15')],'app':_0x3104('0x20'),'appdata':_0x3104('0x3e'),'context':_0x23f15e[_0x3104('0x16')],'exten':_0x23f15e['exten'],'priority':_0x4a2934['length']+_0xe1b3c1[_0x3104('0x10')]+_0x4d7023++,'VoiceExtensionId':_0x23f15e[_0x3104('0x1a')]});_0x243437['push']({'type':_0x23f15e[_0x3104('0x15')],'app':_0x3104('0x18'),'appdata':_0x3104('0x3f'),'context':_0x23f15e['context'],'exten':_0x23f15e[_0x3104('0xb')],'priority':_0x4a2934[_0x3104('0x2e')]+_0xe1b3c1[_0x3104('0x10')]+_0x4d7023++,'VoiceExtensionId':_0x23f15e['VoiceExtensionId']});}else{_0x243437[_0x3104('0x13')]({'type':_0x23f15e[_0x3104('0x15')],'app':_0x3104('0x20'),'appdata':_0x3104('0x40'),'context':_0x23f15e[_0x3104('0x16')],'exten':_0x23f15e[_0x3104('0xb')],'priority':_0x4a2934[_0x3104('0x2e')]+_0xe1b3c1[_0x3104('0x10')]+_0x4d7023++,'VoiceExtensionId':_0x23f15e['VoiceExtensionId']});_0x243437[_0x3104('0x13')]({'type':_0x23f15e[_0x3104('0x15')],'app':_0x3104('0x18'),'appdata':_0x3104('0x41'),'context':_0x23f15e[_0x3104('0x16')],'exten':_0x23f15e[_0x3104('0xb')],'priority':_0x4a2934[_0x3104('0x2e')]+_0xe1b3c1['priority']+_0x4d7023++,'VoiceExtensionId':_0x23f15e[_0x3104('0x1a')]});}}}for(var _0x71af45=0x0;_0x71af45<_0x4a2934[_0x3104('0x2e')];_0x71af45+=0x1){var _0x4e5d8b=_0xe1b3c1[_0x3104('0x10')]+_0x4a2934[_0x3104('0x2e')];var _0x12daf4=_0x71af45===_0x4a2934['length']-0x1?_0xe1b3c1[_0x3104('0x10')]+_0x243437['length']+_0x26c799['length']+0x2:_0xe1b3c1[_0x3104('0x10')]+_0x71af45+0x1;_0x243437[_0x3104('0x42')](_0x71af45,0x0,{'type':_0x23f15e[_0x3104('0x15')],'app':'GotoIfTime','appdata':_0x4a2934[_0x71af45]+'?'+_0x23f15e[_0x3104('0x16')]+_0x3104('0x43')+_0x4e5d8b+':'+_0x23f15e['context']+_0x3104('0x43')+_0x12daf4,'exten':_0x23f15e['exten'],'context':_0x23f15e[_0x3104('0x16')],'priority':_0xe1b3c1[_0x3104('0x10')]+_0x71af45,'VoiceExtensionId':_0x42f5c0[_0x1f65f6][0x0]['VoiceExtensionId']});}_0x23f15e[_0x3104('0x10')]=_0x243437[_0x3104('0x2e')]?_['last'](_0x243437)['priority']+0x1:_0xe1b3c1[_0x3104('0x10')];_0xe1b3c1[_0x3104('0x10')]=(_0x26c799['length']?_['last'](_0x26c799)[_0x3104('0x10')]:_0x23f15e[_0x3104('0x10')])+0x1;_0xe1b3c1[_0x3104('0x11')]=_[_0x3104('0x44')](_0xe1b3c1[_0x3104('0x11')],_0x243437,[_0x23f15e],_0x26c799);}_0xe1b3c1[_0x3104('0x11')][_0x3104('0x13')]({'type':_0x42f5c0[_0x1f65f6][0x0]['type'],'app':_0x3104('0x45'),'exten':_0x42f5c0[_0x1f65f6][0x0]['exten'],'context':_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x16')],'priority':_0xe1b3c1['priority'],'VoiceExtensionId':_0x42f5c0[_0x1f65f6][0x0]['VoiceExtensionId']});_0x81a184[_0x3104('0x13')](_0x42f5c0[_0x1f65f6][0x0][_0x3104('0x1a')]);_0x484400=_['concat'](_0x484400,_0xe1b3c1[_0x3104('0x11')]);}}return _0x3e3936['transaction'](function(_0x1505a8){return _0x3e3936[_0x3104('0x2')][_0x3104('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x81a184}},'transaction':_0x1505a8})[_0x3104('0x4')](function(_0x6a19a1){return _0x3e3936[_0x3104('0x2')][_0x3104('0x6')][_0x3104('0x46')](_[_0x3104('0x47')](_0x484400,'priority'),{'transaction':_0x1505a8});});});})[_0x3104('0x48')](function(_0xbf7bcb){console[_0x3104('0x49')](_0xbf7bcb);});}exports[_0x3104('0x4a')]=rewrite; \ No newline at end of file +var _0xb4e1=['VoiceExtensionId','inbound','extensions','Set','CDR(routeid)=','outbound','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','interval','*,*,*,*','IntervalId','map','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','ExecIf','XCALLY-MOTION-ANSWER=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','catch','error','util','models','then','intervals','VoiceExtension','findAll','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','hasOwnProperty','priority','extension','find','push','CDR(type)=%s','type','context'];(function(_0x1d9959,_0x32d117){var _0x156da2=function(_0x29078e){while(--_0x29078e){_0x1d9959['push'](_0x1d9959['shift']());}};_0x156da2(++_0x32d117);}(_0xb4e1,0x1ec));var _0x1b4e=function(_0x442307,_0x6eaf8a){_0x442307=_0x442307-0x0;var _0x3c986a=_0xb4e1[_0x442307];return _0x3c986a;};'use strict';var _=require('lodash');var util=require(_0x1b4e('0x0'));function rewrite(_0x476bdd,_0x2d93dc){var _0x260b03=this;return _0x476bdd[_0x1b4e('0x1')]['Interval']['findAll']({'raw':!![]})[_0x1b4e('0x2')](function(_0x50eb41){_0x260b03[_0x1b4e('0x3')]=_0x50eb41;return _0x476bdd[_0x1b4e('0x1')][_0x1b4e('0x4')]['findAll']({'where':{'IntervalId':_0x2d93dc['IntervalId']},'raw':!![]});})['then'](function(_0x5a783f){return _0x476bdd[_0x1b4e('0x1')][_0x1b4e('0x4')][_0x1b4e('0x5')]({'where':{'exten':{'$in':_[_0x1b4e('0x6')](_['map'](_0x5a783f,'exten'))}},'order':[{'raw':_0x1b4e('0x7')}],'raw':!![]});})[_0x1b4e('0x2')](function(_0x3f2a7b){var _0x3ed4fc=_[_0x1b4e('0x8')](_0x3f2a7b,{'priority':'1'});var _0x3945bc=_[_0x1b4e('0x8')](_0x3f2a7b,{'isApp':0x1});var _0x39eff8=_[_0x1b4e('0x9')](_0x3945bc,_0x1b4e('0xa'));var _0x510638=[_0x1b4e('0xb'),'playback'];var _0x4e4166=[];var _0x2c486c=[];for(var _0x237b7c in _0x39eff8){if(_0x39eff8[_0x1b4e('0xc')](_0x237b7c)){_0x260b03[_0x1b4e('0xd')]=0x2;_0x260b03['extensions']=[];_0x260b03[_0x1b4e('0xe')]=_[_0x1b4e('0xf')](_0x3ed4fc,{'exten':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0xa')]});_0x260b03['extensions'][_0x1b4e('0x10')]({'type':_0x39eff8[_0x237b7c][0x0]['type'],'app':'Set','appdata':util['format'](_0x1b4e('0x11'),_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x12')]),'context':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x13')],'exten':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0xa')],'priority':_0x260b03[_0x1b4e('0xd')]++,'VoiceExtensionId':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')]});if(_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x12')]===_0x1b4e('0x15')){_0x260b03[_0x1b4e('0x16')][_0x1b4e('0x10')]({'type':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x12')],'app':_0x1b4e('0x17'),'appdata':_0x1b4e('0x18')+_0x39eff8[_0x237b7c][0x0]['VoiceExtensionId'],'context':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x13')],'exten':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0xa')],'priority':_0x260b03['priority']++,'VoiceExtensionId':_0x39eff8[_0x237b7c][0x0]['VoiceExtensionId']});}else if(_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x12')]===_0x1b4e('0x19')){if(_0x260b03[_0x1b4e('0xe')]){_0x260b03[_0x1b4e('0x16')][_0x1b4e('0x10')]({'type':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x12')],'app':_0x1b4e('0x17'),'appdata':'CDR(destination)='+(_0x260b03['extension'][_0x1b4e('0x1a')]?_0x1b4e('0x1b')+_0x260b03[_0x1b4e('0xe')][_0x1b4e('0x1a')]+'}':_0x1b4e('0x1c')),'context':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x13')],'exten':_0x39eff8[_0x237b7c][0x0]['exten'],'priority':_0x260b03[_0x1b4e('0xd')]++,'VoiceExtensionId':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')]});}_0x260b03[_0x1b4e('0x16')][_0x1b4e('0x10')]({'type':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x12')],'app':_0x1b4e('0x17'),'appdata':_0x1b4e('0x18')+_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')],'context':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x13')],'exten':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0xa')],'priority':_0x260b03[_0x1b4e('0xd')]++,'VoiceExtensionId':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')]});var _0x277424=_0x260b03[_0x1b4e('0xd')]++;_0x260b03[_0x1b4e('0x16')][_0x1b4e('0x10')]({'type':_0x39eff8[_0x237b7c][0x0]['type'],'app':'ExecIf','appdata':_0x1b4e('0x1d')+(_0x277424+0x2)+'):Goto('+(_0x277424+0x1)+')','context':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x13')],'exten':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0xa')],'priority':_0x277424,'VoiceExtensionId':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')]});if(_0x260b03[_0x1b4e('0xe')]){_0x260b03['extensions'][_0x1b4e('0x10')]({'type':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x12')],'app':_0x1b4e('0x17'),'appdata':_0x260b03[_0x1b4e('0xe')][_0x1b4e('0x1a')]?_0x1b4e('0x1e')+_0x260b03['extension'][_0x1b4e('0x1a')]+'}':'CDR(prefix)=noprefix','context':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x13')],'exten':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0xa')],'priority':_0x260b03[_0x1b4e('0xd')]++,'VoiceExtensionId':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')]});}_0x260b03[_0x1b4e('0x16')][_0x1b4e('0x10')]({'type':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x12')],'app':_0x1b4e('0x17'),'appdata':_0x1b4e('0x1f')+_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')],'context':_0x39eff8[_0x237b7c][0x0]['context'],'exten':_0x39eff8[_0x237b7c][0x0]['exten'],'priority':_0x260b03[_0x1b4e('0xd')]++,'VoiceExtensionId':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')]});if(_0x260b03[_0x1b4e('0xe')]&&_0x260b03['extension'][_0x1b4e('0xc')](_0x1b4e('0x20'))&&_0x260b03[_0x1b4e('0xe')]['recordingFormat']!==_0x1b4e('0x21')){_0x260b03['extensions'][_0x1b4e('0x10')]({'type':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x12')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x13')],'exten':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0xa')],'priority':_0x260b03[_0x1b4e('0xd')]++,'VoiceExtensionId':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')]});_0x260b03[_0x1b4e('0x16')][_0x1b4e('0x10')]({'type':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x12')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x260b03[_0x1b4e('0xe')][_0x1b4e('0x20')]||_0x1b4e('0x22'),'context':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x13')],'exten':_0x39eff8[_0x237b7c][0x0]['exten'],'priority':_0x260b03[_0x1b4e('0xd')]++,'VoiceExtensionId':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')]});}}_0x260b03[_0x1b4e('0x16')]['push']({'type':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x12')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x39eff8[_0x237b7c][0x0]['context'],'exten':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0xa')],'priority':_0x260b03[_0x1b4e('0xd')]++,'VoiceExtensionId':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')]});_0x260b03[_0x1b4e('0x16')][_0x1b4e('0x10')]({'type':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x12')],'app':_0x1b4e('0x17'),'appdata':_0x1b4e('0x23'),'context':_0x39eff8[_0x237b7c][0x0]['context'],'exten':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0xa')],'priority':_0x260b03[_0x1b4e('0xd')]++,'VoiceExtensionId':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')]});_0x260b03[_0x1b4e('0x16')][_0x1b4e('0x10')]({'type':_0x39eff8[_0x237b7c][0x0]['type'],'app':_0x1b4e('0x17'),'appdata':_0x1b4e('0x24'),'context':_0x39eff8[_0x237b7c][0x0]['context'],'exten':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0xa')],'priority':_0x260b03[_0x1b4e('0xd')]++,'VoiceExtensionId':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')]});for(var _0x1bc9fe=0x0,_0x478f0=0x0;_0x1bc9fe<_0x39eff8[_0x237b7c][_0x1b4e('0x25')];_0x1bc9fe+=0x1,_0x478f0=0x0){var _0x3793ad=_0x39eff8[_0x237b7c][_0x1bc9fe];if(_0x3793ad[_0x1b4e('0x12')]){_0x3793ad[_0x1b4e('0x12')]=_0x3793ad[_0x1b4e('0x12')][_0x1b4e('0x26')]();}var _0x579d35=[];var _0x3ef389=[];delete _0x3793ad['id'];delete _0x3793ad['createdAt'];delete _0x3793ad['updatedAt'];var _0xb9f1f6=_0x3793ad[_0x1b4e('0x27')]!==_0x1b4e('0x28')?[_0x3793ad['interval']]:_0x3793ad[_0x1b4e('0x29')]?_[_0x1b4e('0x2a')](_[_0x1b4e('0x8')](_0x260b03[_0x1b4e('0x3')],{'IntervalId':_0x3793ad[_0x1b4e('0x29')]}),_0x1b4e('0x27')):[];if(_0x3793ad[_0x1b4e('0xc')](_0x1b4e('0x2b'))){if(_0x3793ad[_0x1b4e('0x2b')]&&_0x3793ad[_0x1b4e('0x2b')]!=='--'){_0x579d35[_0x1b4e('0x10')]({'type':_0x3793ad['type'],'app':_0x1b4e('0x17'),'appdata':_0x1b4e('0x2c')+_0x3793ad[_0x1b4e('0x2b')],'context':_0x3793ad[_0x1b4e('0x13')],'exten':_0x3793ad[_0x1b4e('0xa')],'priority':_0xb9f1f6[_0x1b4e('0x25')]+_0x260b03[_0x1b4e('0xd')]+_0x478f0++,'VoiceExtensionId':_0x3793ad[_0x1b4e('0x14')]});}}if(_0x3793ad[_0x1b4e('0x12')]===_0x1b4e('0x19')&&_0x3793ad[_0x1b4e('0xc')]('callerID')){if(_0x3793ad[_0x1b4e('0x2d')]){_0x579d35['push']({'type':_0x3793ad[_0x1b4e('0x12')],'app':'ExecIf','appdata':_0x1b4e('0x2e')+_0x3793ad[_0x1b4e('0x2d')]+')','context':_0x3793ad[_0x1b4e('0x13')],'exten':_0x3793ad[_0x1b4e('0xa')],'priority':_0xb9f1f6[_0x1b4e('0x25')]+_0x260b03['priority']+_0x478f0++,'VoiceExtensionId':_0x3793ad[_0x1b4e('0x14')]});}else{_0x579d35[_0x1b4e('0x10')]({'type':_0x3793ad[_0x1b4e('0x12')],'app':'ExecIf','appdata':_0x1b4e('0x2f'),'context':_0x3793ad[_0x1b4e('0x13')],'exten':_0x3793ad['exten'],'priority':_0xb9f1f6[_0x1b4e('0x25')]+_0x260b03[_0x1b4e('0xd')]+_0x478f0++,'VoiceExtensionId':_0x3793ad[_0x1b4e('0x14')]});}}if(_0x3793ad[_0x1b4e('0xc')](_0x1b4e('0x30'))){if(_0x510638[_0x1b4e('0x31')](_0x3793ad[_0x1b4e('0x32')][_0x1b4e('0x26')]())>=0x0&&_0x3793ad[_0x1b4e('0x33')]!==_0x1b4e('0x34')){if(_0x3793ad['answer']){_0x579d35[_0x1b4e('0x10')]({'type':_0x3793ad['type'],'app':_0x1b4e('0x35'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x3793ad[_0x1b4e('0x13')],'exten':_0x3793ad[_0x1b4e('0xa')],'priority':_0xb9f1f6[_0x1b4e('0x25')]+_0x260b03[_0x1b4e('0xd')]+_0x478f0++,'VoiceExtensionId':_0x3793ad[_0x1b4e('0x14')]});_0x579d35[_0x1b4e('0x10')]({'type':_0x3793ad[_0x1b4e('0x12')],'app':_0x1b4e('0x17'),'appdata':_0x1b4e('0x36'),'context':_0x3793ad[_0x1b4e('0x13')],'exten':_0x3793ad[_0x1b4e('0xa')],'priority':_0xb9f1f6[_0x1b4e('0x25')]+_0x260b03[_0x1b4e('0xd')]+_0x478f0++,'VoiceExtensionId':_0x3793ad[_0x1b4e('0x14')]});}else{_0x579d35[_0x1b4e('0x10')]({'type':_0x3793ad[_0x1b4e('0x12')],'app':_0x1b4e('0x35'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3793ad[_0x1b4e('0x13')],'exten':_0x3793ad[_0x1b4e('0xa')],'priority':_0xb9f1f6[_0x1b4e('0x25')]+_0x260b03[_0x1b4e('0xd')]+_0x478f0++,'VoiceExtensionId':_0x3793ad[_0x1b4e('0x14')]});_0x579d35[_0x1b4e('0x10')]({'type':_0x3793ad['type'],'app':_0x1b4e('0x17'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x3793ad['context'],'exten':_0x3793ad[_0x1b4e('0xa')],'priority':_0xb9f1f6[_0x1b4e('0x25')]+_0x260b03[_0x1b4e('0xd')]+_0x478f0++,'VoiceExtensionId':_0x3793ad[_0x1b4e('0x14')]});}}}for(var _0x4f8579=0x0;_0x4f8579<_0xb9f1f6['length'];_0x4f8579+=0x1){var _0x41cdf6=_0x260b03[_0x1b4e('0xd')]+_0xb9f1f6[_0x1b4e('0x25')];var _0x13a97b=_0x4f8579===_0xb9f1f6[_0x1b4e('0x25')]-0x1?_0x260b03['priority']+_0x579d35[_0x1b4e('0x25')]+_0x3ef389[_0x1b4e('0x25')]+0x2:_0x260b03[_0x1b4e('0xd')]+_0x4f8579+0x1;_0x579d35['splice'](_0x4f8579,0x0,{'type':_0x3793ad['type'],'app':_0x1b4e('0x37'),'appdata':_0xb9f1f6[_0x4f8579]+'?'+_0x3793ad['context']+_0x1b4e('0x38')+_0x41cdf6+':'+_0x3793ad[_0x1b4e('0x13')]+_0x1b4e('0x38')+_0x13a97b,'exten':_0x3793ad[_0x1b4e('0xa')],'context':_0x3793ad['context'],'priority':_0x260b03[_0x1b4e('0xd')]+_0x4f8579,'VoiceExtensionId':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')]});}_0x3793ad[_0x1b4e('0xd')]=_0x579d35[_0x1b4e('0x25')]?_[_0x1b4e('0x39')](_0x579d35)[_0x1b4e('0xd')]+0x1:_0x260b03['priority'];_0x260b03[_0x1b4e('0xd')]=(_0x3ef389[_0x1b4e('0x25')]?_[_0x1b4e('0x39')](_0x3ef389)[_0x1b4e('0xd')]:_0x3793ad[_0x1b4e('0xd')])+0x1;_0x260b03[_0x1b4e('0x16')]=_[_0x1b4e('0x3a')](_0x260b03['extensions'],_0x579d35,[_0x3793ad],_0x3ef389);}_0x260b03[_0x1b4e('0x16')][_0x1b4e('0x10')]({'type':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x12')],'app':_0x1b4e('0x3b'),'exten':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0xa')],'context':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x13')],'priority':_0x260b03[_0x1b4e('0xd')],'VoiceExtensionId':_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')]});_0x4e4166['push'](_0x39eff8[_0x237b7c][0x0][_0x1b4e('0x14')]);_0x2c486c=_[_0x1b4e('0x3a')](_0x2c486c,_0x260b03[_0x1b4e('0x16')]);}}return _0x476bdd[_0x1b4e('0x3c')](function(_0x407c83){return _0x476bdd['models'][_0x1b4e('0x4')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x4e4166}},'transaction':_0x407c83})[_0x1b4e('0x2')](function(_0x189d29){return _0x476bdd[_0x1b4e('0x1')][_0x1b4e('0x4')][_0x1b4e('0x3d')](_['sortBy'](_0x2c486c,_0x1b4e('0xd')),{'transaction':_0x407c83});});});})[_0x1b4e('0x3e')](function(_0x555523){console[_0x1b4e('0x3f')](_0x555523);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 9fb49be..1c32803 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 _0x1b3c=['get','dialCheckDuplicateType','always','push','VoiceQueueId','onlyIfOpen','sequelize','query','all','CampaignId','Campaign','BlackLists','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','localhost','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','updatedAt','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper','\x20=\x20?','insert','into','fromQuery','deletedAt\x20IS\x20NULL','str','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists'];(function(_0x2c6626,_0x3c7a68){var _0x3ee899=function(_0x3d2d31){while(--_0x3d2d31){_0x2c6626['push'](_0x2c6626['shift']());}};_0x3ee899(++_0x3c7a68);}(_0x1b3c,0xf8));var _0xc1b3=function(_0x6ad2,_0x205a3b){_0x6ad2=_0x6ad2-0x0;var _0x151d14=_0x1b3c[_0x6ad2];return _0x151d14;};'use strict';var BPromise=require(_0xc1b3('0x0'));var util=require(_0xc1b3('0x1'));var _=require(_0xc1b3('0x2'));var fs=require('fs');var squel=require(_0xc1b3('0x3'));var Papa=require(_0xc1b3('0x4'));var Redis=require(_0xc1b3('0x5'));var db=require(_0xc1b3('0x6'))['db'];var config=require(_0xc1b3('0x7'));var logger=require('../../../config/logger')(_0xc1b3('0x8'));config['redis']=_['defaults'](config[_0xc1b3('0x9')],{'host':_0xc1b3('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc1b3('0x9')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0xc1b3('0xb')][0x2]||process[_0xc1b3('0xb')][0x2]===_0xc1b3('0xc')||process[_0xc1b3('0xb')][0x2]==='null'){throw new Error(_0xc1b3('0xd'));}var FILEPATH=process[_0xc1b3('0xb')][0x2];if(!process[_0xc1b3('0xb')][0x3]||process[_0xc1b3('0xb')][0x3]===_0xc1b3('0xc')||process[_0xc1b3('0xb')][0x3]===_0xc1b3('0xe')||!process['argv'][0x4]||process[_0xc1b3('0xb')][0x4]===_0xc1b3('0xc')||process[_0xc1b3('0xb')][0x4]==='null'){throw new Error(_0xc1b3('0xf'));}var FIELDS=_[_0xc1b3('0x10')](process['argv'][0x3][_0xc1b3('0x11')](','),process['argv'][0x4]['split'](','));if(!process['argv'][0x5]||process[_0xc1b3('0xb')][0x5]==='undefined'||process[_0xc1b3('0xb')][0x5]===_0xc1b3('0xe')){throw new Error(_0xc1b3('0x12'));}var LISTID=process[_0xc1b3('0xb')][0x5];var COMPANYID=process[_0xc1b3('0xb')][0x6]&&process[_0xc1b3('0xb')][0x6]!==_0xc1b3('0xc')&&process[_0xc1b3('0xb')][0x6]!==_0xc1b3('0xe')?process[_0xc1b3('0xb')][0x6]:null;var DUPLICATES=process[_0xc1b3('0xb')][0x7]&&process[_0xc1b3('0xb')][0x7]!==_0xc1b3('0xc')&&process[_0xc1b3('0xb')][0x7]!==_0xc1b3('0xe')?process[_0xc1b3('0xb')][0x7]:null;if(!process[_0xc1b3('0xb')][0x8]||process[_0xc1b3('0xb')][0x8]===_0xc1b3('0xc')||process[_0xc1b3('0xb')][0x8]===_0xc1b3('0xe')){throw new Error(_0xc1b3('0x13'));}var SOCKET_TIMESTAMP=process[_0xc1b3('0xb')][0x8];}catch(_0x94c306){logger[_0xc1b3('0x14')](_0x94c306);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(_0x1aaeb6,_0x575ce7,_0xddc674,_0x367891){var _0x5e5533={'message':_0x575ce7};_0x5e5533[_0x1aaeb6]=!![];if(_0xddc674){_0x5e5533[_0xc1b3('0x15')]=_0xddc674;}if(_0x367891){_0x5e5533[_0xc1b3('0x16')]=_0x367891;}return _0x5e5533;}function isEmail(_0x440971){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))*$/[_0xc1b3('0x17')](_0x440971);}function checkRow(_0xc3c431,_0x398664,_0x562ed7){return new BPromise(function(_0x3ed99c,_0x5af580){if(_[_0xc1b3('0x18')](_0xc3c431)){return _0x5af580(handleCheckRowError(_0xc1b3('0x14'),_0xc1b3('0x19'),null,_0x562ed7));}if(_0xc3c431[_0xc1b3('0x1a')]&&_0xc3c431[_0xc1b3('0x1a')][_0xc1b3('0x1b')]){var _0x3949e9=_[_0xc1b3('0x1c')](_0xc3c431[_0xc1b3('0x1a')],_0xc1b3('0x1d'))['join'](';');return _0x5af580(handleCheckRowError(_0xc1b3('0x14'),_0x3949e9,null,_0x562ed7));}var _0x4388a3={};for(var _0x17e08e in FIELDS){if(FIELDS['hasOwnProperty'](_0x17e08e)&&FIELDS[_0x17e08e]){_0x4388a3[_0x17e08e]=_0xc3c431[_0xc1b3('0x1e')][0x0][FIELDS[_0x17e08e]]||_0xc3c431[_0xc1b3('0x1e')][0x0]['\ufeff'+FIELDS[_0x17e08e]];}}if(!_0x4388a3[_0xc1b3('0x1f')]){return _0x5af580(handleCheckRowError('error',_0xc1b3('0x20'),null,_0x562ed7));}if(!_0x4388a3[_0xc1b3('0x21')]){return _0x5af580(handleCheckRowError(_0xc1b3('0x14'),_0xc1b3('0x22'),null,_0x562ed7));}if(_0x4388a3['birthDate']){var _0x53cefe=moment(_0x4388a3[_0xc1b3('0x23')],_0xc1b3('0x24'));if(!_0x53cefe['isValid']()){return _0x5af580(handleCheckRowError(_0xc1b3('0x14'),_0xc1b3('0x25'),null,_0x562ed7));}}if(_0x4388a3['email']){if(!isEmail(_0x4388a3[_0xc1b3('0x26')])){return _0x5af580(handleCheckRowError('error',_0xc1b3('0x27'),null,_0x562ed7));}}_0x4388a3[_0xc1b3('0x28')]=LISTID;_0x4388a3[_0xc1b3('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xc1b3('0x1b')]&&_0x398664){var _0x24f9cf={};for(var _0x4402fb=0x0,_0x48d458=DUPLICATES[_0xc1b3('0x1b')];_0x4402fb<_0x48d458;_0x4402fb+=0x1){_0x24f9cf[DUPLICATES[_0x4402fb]]=_0x4388a3[DUPLICATES[_0x4402fb]];}var _0x5513ed=_[_0xc1b3('0x2a')](_0x398664,_0x24f9cf);if(_0x5513ed){return _0x5af580(handleCheckRowError('duplicate',_0xc1b3('0x2b'),_0x5513ed,_0x562ed7));}}return db[_0xc1b3('0x2c')][_0xc1b3('0x2d')](_0x4388a3,{'raw':!![],'hooks':![],'fields':_['keys'](_0x4388a3)})[_0xc1b3('0x2e')](function(_0x1e9ebb){if(DUPLICATES&&DUPLICATES[_0xc1b3('0x1b')]&&_0x398664){_0x398664['push'](_[_0xc1b3('0x2f')](_0x4388a3,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1e9ebb['id'];return _0x3ed99c();})[_0xc1b3('0x30')](function(_0x35b362){return _0x5af580(handleCheckRowError(_0xc1b3('0x14'),_0xc1b3('0x31')+(_0x35b362[_0xc1b3('0x1d')]||JSON[_0xc1b3('0x32')](_0x35b362)),null,_0x562ed7));});});}function checkHopper(){function _0x47252a(){return function(_0x56d51e){logger[_0xc1b3('0x14')](_0xc1b3('0x33'),'checkHopper',util[_0xc1b3('0x34')](_0x56d51e,{'showHidden':![],'depth':null}));};}var _0x5433d0=function(_0x4016fb,_0x2ce405){var _0x5bfb76=squel['insert']()['into']('cm_hopper')['fromQuery']([_0xc1b3('0x21'),_0xc1b3('0x35'),_0xc1b3('0x36'),_0xc1b3('0x28'),_0x2ce405,_0xc1b3('0x37'),'updatedAt'],squel[_0xc1b3('0x38')]()[_0xc1b3('0x39')]('phone',_0xc1b3('0x21'))[_0xc1b3('0x39')](_0xc1b3('0x3a'),_0xc1b3('0x35'))[_0xc1b3('0x39')]('id',_0xc1b3('0x36'))[_0xc1b3('0x39')](LISTID[_0xc1b3('0x3b')](),_0xc1b3('0x28'))[_0xc1b3('0x39')](_0x4016fb['id']['toString'](),_0x2ce405)[_0xc1b3('0x39')]('NOW()','createdAt')[_0xc1b3('0x39')]('NOW()',_0xc1b3('0x3c'))[_0xc1b3('0x3d')](_0xc1b3('0x3e'))[_0xc1b3('0x3f')]('deletedAt\x20IS\x20NULL')[_0xc1b3('0x3f')](_0xc1b3('0x40'),LISTID[_0xc1b3('0x3b')]())[_0xc1b3('0x3f')](_0xc1b3('0x41'))[_0xc1b3('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc1b3('0x38')]()[_0xc1b3('0x39')](_0xc1b3('0x21'))[_0xc1b3('0x3d')](_0xc1b3('0x42'))[_0xc1b3('0x3f')](_0x2ce405+_0xc1b3('0x43'),_0x4016fb['id'][_0xc1b3('0x3b')]())))[_0xc1b3('0x3b')]();return _0x5bfb76;};var _0x353b43=function(_0x5cbe93,_0x58fec3){var _0x4d945e=squel[_0xc1b3('0x44')]()[_0xc1b3('0x45')]('cm_hopper')[_0xc1b3('0x46')]([_0xc1b3('0x21'),_0xc1b3('0x35'),_0xc1b3('0x36'),_0xc1b3('0x28'),_0x58fec3,_0xc1b3('0x37'),_0xc1b3('0x3c')],squel['select']()[_0xc1b3('0x39')](_0xc1b3('0x21'),_0xc1b3('0x21'))['field']('NOW()',_0xc1b3('0x35'))['field']('id',_0xc1b3('0x36'))['field'](LISTID[_0xc1b3('0x3b')](),_0xc1b3('0x28'))[_0xc1b3('0x39')](_0x5cbe93['id'][_0xc1b3('0x3b')](),_0x58fec3)[_0xc1b3('0x39')](_0xc1b3('0x3a'),'createdAt')[_0xc1b3('0x39')](_0xc1b3('0x3a'),_0xc1b3('0x3c'))[_0xc1b3('0x3d')](_0xc1b3('0x3e'))[_0xc1b3('0x3f')](_0xc1b3('0x47'))['where'](_0xc1b3('0x40'),LISTID['toString']())[_0xc1b3('0x3f')]('id\x20IN\x20?',squel[_0xc1b3('0x48')](hopperContacts))['where'](_0xc1b3('0x41'))[_0xc1b3('0x3f')](_0xc1b3('0x49'),squel[_0xc1b3('0x38')]()[_0xc1b3('0x39')]('calleridnum')['from'](_0xc1b3('0x4a'))[_0xc1b3('0x3f')](_0x58fec3+'\x20=\x20?',_0x5cbe93['id']['toString']()))['where'](_0xc1b3('0x49'),squel[_0xc1b3('0x38')]()['field'](_0xc1b3('0x21'))[_0xc1b3('0x3d')](_0xc1b3('0x42'))[_0xc1b3('0x3f')](_0x58fec3+_0xc1b3('0x43'),_0x5cbe93['id']['toString']())))[_0xc1b3('0x3b')]();return _0x4d945e;};function _0x25d1e5(_0x59ee4c,_0x520994){var _0x26ee5f=squel[_0xc1b3('0x44')]()[_0xc1b3('0x45')](_0xc1b3('0x42'))[_0xc1b3('0x46')]([_0xc1b3('0x21'),_0xc1b3('0x35'),_0xc1b3('0x36'),_0xc1b3('0x28'),_0x520994,_0xc1b3('0x37'),'updatedAt'],squel[_0xc1b3('0x38')]()[_0xc1b3('0x39')](_0xc1b3('0x21'),'phone')[_0xc1b3('0x39')]('NOW()','scheduledAt')[_0xc1b3('0x39')]('id',_0xc1b3('0x36'))[_0xc1b3('0x39')](LISTID[_0xc1b3('0x3b')](),_0xc1b3('0x28'))[_0xc1b3('0x39')](_0x59ee4c['id'][_0xc1b3('0x3b')](),_0x520994)[_0xc1b3('0x39')](_0xc1b3('0x3a'),'createdAt')['field'](_0xc1b3('0x3a'),_0xc1b3('0x3c'))[_0xc1b3('0x3d')](_0xc1b3('0x3e'))[_0xc1b3('0x3f')]('deletedAt\x20IS\x20NULL')[_0xc1b3('0x3f')](_0xc1b3('0x40'),LISTID[_0xc1b3('0x3b')]())[_0xc1b3('0x3f')](_0xc1b3('0x4b'),squel[_0xc1b3('0x48')](hopperContacts))[_0xc1b3('0x3f')](_0xc1b3('0x41')))[_0xc1b3('0x3b')]();return _0x26ee5f;}function _0x38c164(_0x9ccb40,_0x433cd5){var _0x17bb5b=squel[_0xc1b3('0x44')]()[_0xc1b3('0x45')](_0xc1b3('0x4c'))['fromQuery'](['phone','ContactId',_0xc1b3('0x28'),_0x433cd5,_0xc1b3('0x37'),'updatedAt'],squel[_0xc1b3('0x38')]()[_0xc1b3('0x39')]('phone',_0xc1b3('0x21'))['field']('id',_0xc1b3('0x36'))[_0xc1b3('0x39')](LISTID[_0xc1b3('0x3b')](),_0xc1b3('0x28'))[_0xc1b3('0x39')](_0x9ccb40['id'][_0xc1b3('0x3b')](),_0x433cd5)[_0xc1b3('0x39')]('NOW()',_0xc1b3('0x37'))[_0xc1b3('0x39')]('NOW()',_0xc1b3('0x3c'))['from'](_0xc1b3('0x3e'))[_0xc1b3('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0xc1b3('0x40'),LISTID[_0xc1b3('0x3b')]())['where'](_0xc1b3('0x4b'),squel[_0xc1b3('0x48')](hopperContacts))[_0xc1b3('0x3f')](_0xc1b3('0x41')))[_0xc1b3('0x3b')]();return _0x17bb5b;}return db[_0xc1b3('0x4d')][_0xc1b3('0x4e')]({'where':{'type':_0xc1b3('0x4f')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xc1b3('0x50')],'as':_0xc1b3('0x51'),'where':{'id':LISTID}}]})[_0xc1b3('0x2e')](function(_0x5a9b63){var _0x24b3e6=[];if(_0x5a9b63){var _0xdf2fbb;for(var _0x5e831c=0x0,_0xc1c026;_0x5e831c<_0x5a9b63['length'];_0x5e831c+=0x1){_0xc1c026=_0x5a9b63[_0x5e831c][_0xc1b3('0x52')]({'plain':!![]});switch(_0xc1c026[_0xc1b3('0x53')]){case _0xc1b3('0x54'):_0x24b3e6[_0xc1b3('0x55')](db['sequelize']['query'](_0x353b43(_0xc1c026,_0xc1b3('0x56')))['then'](function(){})['catch'](_0x47252a()));break;case _0xc1b3('0x57'):_0x24b3e6[_0xc1b3('0x55')](db[_0xc1b3('0x58')][_0xc1b3('0x59')](_0x5433d0(_0xc1c026,'VoiceQueueId'))[_0xc1b3('0x2e')](function(){})[_0xc1b3('0x30')](_0x47252a()));break;default:_0x24b3e6[_0xc1b3('0x55')](db['sequelize'][_0xc1b3('0x59')](_0x25d1e5(_0xc1c026,_0xc1b3('0x56')))[_0xc1b3('0x2e')](function(){})[_0xc1b3('0x30')](_0x47252a()));}}}return _0x24b3e6;})[_0xc1b3('0x5a')]()['then'](function(){return db[_0xc1b3('0x4d')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xc1b3('0x50')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xc1b3('0x2e')](function(_0x4b31a9){var _0x4ef3f0=[];if(_0x4b31a9){var _0x2492e4;for(var _0x18167a=0x0,_0x2d6767;_0x18167a<_0x4b31a9[_0xc1b3('0x1b')];_0x18167a+=0x1){_0x2d6767=_0x4b31a9[_0x18167a]['get']({'plain':!![]});_0x4ef3f0[_0xc1b3('0x55')](db['sequelize'][_0xc1b3('0x59')](_0x38c164(_0x2d6767,_0xc1b3('0x56')))[_0xc1b3('0x2e')](function(){})['catch'](_0x47252a()));}}return _0x4ef3f0;})[_0xc1b3('0x5a')]();})[_0xc1b3('0x2e')](function(){return db['Campaign'][_0xc1b3('0x4e')]({'attributes':['id',_0xc1b3('0x53')],'include':[{'model':db['CmList'],'as':_0xc1b3('0x51'),'where':{'id':LISTID}}]})[_0xc1b3('0x2e')](function(_0x50a934){var _0x12cc8a=[];if(_0x50a934){for(var _0x32d5cf=0x0,_0x106165;_0x32d5cf<_0x50a934[_0xc1b3('0x1b')];_0x32d5cf+=0x1){_0x106165=_0x50a934[_0x32d5cf][_0xc1b3('0x52')]({'plain':!![]});switch(_0x106165[_0xc1b3('0x53')]){case'always':_0x12cc8a['push'](db[_0xc1b3('0x58')][_0xc1b3('0x59')](_0x353b43(_0x106165,_0xc1b3('0x5b')))[_0xc1b3('0x2e')](function(){})['catch'](_0x47252a()));break;case _0xc1b3('0x57'):_0x12cc8a[_0xc1b3('0x55')](db[_0xc1b3('0x58')][_0xc1b3('0x59')](_0x5433d0(_0x106165,_0xc1b3('0x5b')))['then'](function(){})['catch'](_0x47252a()));break;default:_0x12cc8a[_0xc1b3('0x55')](db[_0xc1b3('0x58')][_0xc1b3('0x59')](_0x25d1e5(_0x106165,_0xc1b3('0x5b')))[_0xc1b3('0x2e')](function(){})['catch'](_0x47252a()));}}}return _0x12cc8a;})['all']();})[_0xc1b3('0x2e')](function(){return db[_0xc1b3('0x5c')][_0xc1b3('0x4e')]({'attributes':['id'],'include':[{'model':db[_0xc1b3('0x50')],'as':_0xc1b3('0x5d'),'where':{'id':LISTID}}]})[_0xc1b3('0x2e')](function(_0x2ae9f0){var _0x4d5eb5=[];if(_0x2ae9f0){for(var _0x165071=0x0,_0xd777e;_0x165071<_0x2ae9f0[_0xc1b3('0x1b')];_0x165071+=0x1){_0xd777e=_0x2ae9f0[_0x165071]['get']({'plain':!![]});_0x4d5eb5[_0xc1b3('0x55')](db[_0xc1b3('0x58')][_0xc1b3('0x59')](_0x38c164(_0xd777e,_0xc1b3('0x5b')))['then'](function(){})['catch'](_0x47252a()));}}return _0x4d5eb5;})['all']();})['catch'](function(_0x353f78){logger[_0xc1b3('0x14')]('cmContact,\x20%s,\x20%s',_0xc1b3('0x5e'),_0x353f78['message']);});}var processPromises=function(_0x11fe3c){return BPromise[_0xc1b3('0x5a')](promises)[_0xc1b3('0x2e')](function(_0x874179){})[_0xc1b3('0x30')](function(_0x31f4eb){logger[_0xc1b3('0x14')](_0xc1b3('0x5f'),JSON[_0xc1b3('0x32')](_0x31f4eb));})[_0xc1b3('0x60')](function(){socket[_0xc1b3('0x61')](_0xc1b3('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x11fe3c){return _0x11fe3c[_0xc1b3('0x63')]();}});};var endCsv=function(){return BPromise[_0xc1b3('0x64')]()[_0xc1b3('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0xc1b3('0x2e')](function(){socket[_0xc1b3('0x61')](_0xc1b3('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xc1b3('0x65')](FILEPATH);}catch(_0x537bd6){logger['error'](_0xc1b3('0x66'),JSON[_0xc1b3('0x32')](_0x537bd6));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0xc1b3('0x67')](_0xc1b3('0x68'));endCsv();});function main(){return BPromise[_0xc1b3('0x64')]()[_0xc1b3('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xc1b3('0x11')](',');return db[_0xc1b3('0x2c')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xc1b3('0x2e')](function(_0x3057c1){var _0x190347=fs[_0xc1b3('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xc1b3('0x6a')](_0x190347,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3a538c,_0x5b2e92){total+=0x1;var _0x2da7a2=total;promises['push'](checkRow(_0x3a538c,_0x3057c1,_0x2da7a2)[_0xc1b3('0x2e')](function(){success+=0x1;})['catch'](function(_0x42c70c){if(_0x42c70c['error']){errors+=0x1;delete _0x42c70c[_0xc1b3('0x14')];}else if(_0x42c70c[_0xc1b3('0x6b')]){duplicates+=0x1;delete _0x42c70c[_0xc1b3('0x6b')];}rows[_0xc1b3('0x55')](_0x42c70c);}));if(total%0xc8===0x0){_0x5b2e92[_0xc1b3('0x6c')]();return processPromises(_0x5b2e92);}},'complete':function(){return processPromises()[_0xc1b3('0x2e')](function(){logger[_0xc1b3('0x67')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x5f0e62,_0x1e7792){logger[_0xc1b3('0x67')](_0xc1b3('0x6d'),JSON[_0xc1b3('0x32')](_0x5f0e62));endCsv();}});})[_0xc1b3('0x30')](function(_0x1c54a3){logger[_0xc1b3('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xc1b3('0x32')](_0x1c54a3));});}main(); \ No newline at end of file +var _0x3879=['hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','CompanyId','find','Duplicate\x20Contact','CmContact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','phone','ContactId','createdAt','updatedAt','field','scheduledAt','ListId','NOW()','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','select','cm_contacts','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','\x20=\x20?','VoiceQueue','outbound','CmList','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','all','findAll','BlackLists','Lists','CampaignId','onlyIfOpen','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','duplicate','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','errors','length','map','message'];(function(_0x58bad7,_0x164026){var _0x383a3b=function(_0x1893ca){while(--_0x1893ca){_0x58bad7['push'](_0x58bad7['shift']());}};_0x383a3b(++_0x164026);}(_0x3879,0x129));var _0x9387=function(_0x3ab404,_0x1041ff){_0x3ab404=_0x3ab404-0x0;var _0x356005=_0x3879[_0x3ab404];return _0x356005;};'use strict';var BPromise=require('bluebird');var util=require(_0x9387('0x0'));var _=require(_0x9387('0x1'));var fs=require('fs');var squel=require(_0x9387('0x2'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0x9387('0x3'))['db'];var config=require(_0x9387('0x4'));var logger=require(_0x9387('0x5'))(_0x9387('0x6'));config[_0x9387('0x7')]=_[_0x9387('0x8')](config[_0x9387('0x7')],{'host':_0x9387('0x9'),'port':0x18eb});var socket=require(_0x9387('0xa'))(new Redis(config[_0x9387('0x7')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x9387('0xb')][0x2]||process[_0x9387('0xb')][0x2]===_0x9387('0xc')||process[_0x9387('0xb')][0x2]===_0x9387('0xd')){throw new Error(_0x9387('0xe'));}var FILEPATH=process[_0x9387('0xb')][0x2];if(!process[_0x9387('0xb')][0x3]||process[_0x9387('0xb')][0x3]===_0x9387('0xc')||process[_0x9387('0xb')][0x3]===_0x9387('0xd')||!process[_0x9387('0xb')][0x4]||process[_0x9387('0xb')][0x4]===_0x9387('0xc')||process[_0x9387('0xb')][0x4]===_0x9387('0xd')){throw new Error(_0x9387('0xf'));}var FIELDS=_[_0x9387('0x10')](process[_0x9387('0xb')][0x3]['split'](','),process[_0x9387('0xb')][0x4][_0x9387('0x11')](','));if(!process[_0x9387('0xb')][0x5]||process['argv'][0x5]===_0x9387('0xc')||process['argv'][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x9387('0xb')][0x6]!=='undefined'&&process[_0x9387('0xb')][0x6]!==_0x9387('0xd')?process[_0x9387('0xb')][0x6]:null;var DUPLICATES=process[_0x9387('0xb')][0x7]&&process[_0x9387('0xb')][0x7]!==_0x9387('0xc')&&process[_0x9387('0xb')][0x7]!==_0x9387('0xd')?process[_0x9387('0xb')][0x7]:null;if(!process[_0x9387('0xb')][0x8]||process['argv'][0x8]===_0x9387('0xc')||process[_0x9387('0xb')][0x8]===_0x9387('0xd')){throw new Error(_0x9387('0x12'));}var SOCKET_TIMESTAMP=process[_0x9387('0xb')][0x8];}catch(_0x26060b){logger[_0x9387('0x13')](_0x26060b);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(_0xc5be09,_0x1a5d68,_0x4c357e,_0x1b928d){var _0x2005d6={'message':_0x1a5d68};_0x2005d6[_0xc5be09]=!![];if(_0x4c357e){_0x2005d6[_0x9387('0x14')]=_0x4c357e;}if(_0x1b928d){_0x2005d6[_0x9387('0x15')]=_0x1b928d;}return _0x2005d6;}function isEmail(_0x2f8373){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))*$/[_0x9387('0x16')](_0x2f8373);}function checkRow(_0x362338,_0x11c5b1,_0x5f597a){return new BPromise(function(_0x19b7d3,_0x4e0dd3){if(_['isNil'](_0x362338)){return _0x4e0dd3(handleCheckRowError(_0x9387('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x5f597a));}if(_0x362338[_0x9387('0x17')]&&_0x362338['errors'][_0x9387('0x18')]){var _0x455f0f=_[_0x9387('0x19')](_0x362338[_0x9387('0x17')],_0x9387('0x1a'))['join'](';');return _0x4e0dd3(handleCheckRowError(_0x9387('0x13'),_0x455f0f,null,_0x5f597a));}var _0x599b1a={};for(var _0x547a5b in FIELDS){if(FIELDS[_0x9387('0x1b')](_0x547a5b)&&FIELDS[_0x547a5b]){_0x599b1a[_0x547a5b]=_0x362338[_0x9387('0x1c')][0x0][FIELDS[_0x547a5b]]||_0x362338[_0x9387('0x1c')][0x0]['\ufeff'+FIELDS[_0x547a5b]];}}if(!_0x599b1a[_0x9387('0x1d')]){return _0x4e0dd3(handleCheckRowError(_0x9387('0x13'),_0x9387('0x1e'),null,_0x5f597a));}if(!_0x599b1a['phone']){return _0x4e0dd3(handleCheckRowError(_0x9387('0x13'),_0x9387('0x1f'),null,_0x5f597a));}if(_0x599b1a[_0x9387('0x20')]){var _0x21111d=moment(_0x599b1a['birthDate'],_0x9387('0x21'));if(!_0x21111d[_0x9387('0x22')]()){return _0x4e0dd3(handleCheckRowError(_0x9387('0x13'),_0x9387('0x23'),null,_0x5f597a));}}if(_0x599b1a[_0x9387('0x24')]){if(!isEmail(_0x599b1a['email'])){return _0x4e0dd3(handleCheckRowError(_0x9387('0x13'),'email\x20format\x20is\x20not\x20valid!',null,_0x5f597a));}}_0x599b1a['ListId']=LISTID;_0x599b1a[_0x9387('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x9387('0x18')]&&_0x11c5b1){var _0x536725={};for(var _0x324c4e=0x0,_0x512399=DUPLICATES['length'];_0x324c4e<_0x512399;_0x324c4e+=0x1){_0x536725[DUPLICATES[_0x324c4e]]=_0x599b1a[DUPLICATES[_0x324c4e]];}var _0x230870=_[_0x9387('0x26')](_0x11c5b1,_0x536725);if(_0x230870){return _0x4e0dd3(handleCheckRowError('duplicate',_0x9387('0x27'),_0x230870,_0x5f597a));}}return db[_0x9387('0x28')][_0x9387('0x29')](_0x599b1a,{'raw':!![],'hooks':![],'fields':_[_0x9387('0x2a')](_0x599b1a)})[_0x9387('0x2b')](function(_0x1723bc){if(DUPLICATES&&DUPLICATES[_0x9387('0x18')]&&_0x11c5b1){_0x11c5b1[_0x9387('0x2c')](_['pick'](_0x599b1a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1723bc['id'];return _0x19b7d3();})[_0x9387('0x2d')](function(_0x5b3c17){return _0x4e0dd3(handleCheckRowError(_0x9387('0x13'),_0x9387('0x2e')+(_0x5b3c17[_0x9387('0x1a')]||JSON[_0x9387('0x2f')](_0x5b3c17)),null,_0x5f597a));});});}function checkHopper(){function _0x54ecda(){return function(_0x1a3850){logger[_0x9387('0x13')](_0x9387('0x30'),_0x9387('0x31'),util[_0x9387('0x32')](_0x1a3850,{'showHidden':![],'depth':null}));};}var _0x127b58=function(_0x5d268b,_0x36b660){var _0x3bf6e6=squel[_0x9387('0x33')]()[_0x9387('0x34')](_0x9387('0x35'))[_0x9387('0x36')]([_0x9387('0x37'),'scheduledAt',_0x9387('0x38'),'ListId',_0x36b660,_0x9387('0x39'),_0x9387('0x3a')],squel['select']()[_0x9387('0x3b')]('phone','phone')[_0x9387('0x3b')]('NOW()',_0x9387('0x3c'))[_0x9387('0x3b')]('id',_0x9387('0x38'))['field'](LISTID['toString'](),_0x9387('0x3d'))[_0x9387('0x3b')](_0x5d268b['id']['toString'](),_0x36b660)[_0x9387('0x3b')]('NOW()',_0x9387('0x39'))['field'](_0x9387('0x3e'),_0x9387('0x3a'))[_0x9387('0x3f')]('cm_contacts')[_0x9387('0x40')](_0x9387('0x41'))[_0x9387('0x40')](_0x9387('0x42'),LISTID[_0x9387('0x43')]())[_0x9387('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x9387('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9387('0x44')]()[_0x9387('0x3b')](_0x9387('0x37'))[_0x9387('0x3f')](_0x9387('0x35'))[_0x9387('0x40')](_0x36b660+'\x20=\x20?',_0x5d268b['id']['toString']())))[_0x9387('0x43')]();return _0x3bf6e6;};var _0x161aa6=function(_0x15305a,_0x23d870){var _0x1eaf06=squel[_0x9387('0x33')]()[_0x9387('0x34')](_0x9387('0x35'))[_0x9387('0x36')](['phone',_0x9387('0x3c'),_0x9387('0x38'),_0x9387('0x3d'),_0x23d870,_0x9387('0x39'),_0x9387('0x3a')],squel[_0x9387('0x44')]()[_0x9387('0x3b')](_0x9387('0x37'),_0x9387('0x37'))[_0x9387('0x3b')](_0x9387('0x3e'),_0x9387('0x3c'))[_0x9387('0x3b')]('id',_0x9387('0x38'))[_0x9387('0x3b')](LISTID[_0x9387('0x43')](),_0x9387('0x3d'))[_0x9387('0x3b')](_0x15305a['id']['toString'](),_0x23d870)['field'](_0x9387('0x3e'),'createdAt')[_0x9387('0x3b')](_0x9387('0x3e'),_0x9387('0x3a'))[_0x9387('0x3f')](_0x9387('0x45'))[_0x9387('0x40')](_0x9387('0x41'))['where'](_0x9387('0x42'),LISTID[_0x9387('0x43')]())[_0x9387('0x40')](_0x9387('0x46'),squel[_0x9387('0x47')](hopperContacts))[_0x9387('0x40')](_0x9387('0x48'))[_0x9387('0x40')](_0x9387('0x49'),squel[_0x9387('0x44')]()['field'](_0x9387('0x4a'))[_0x9387('0x3f')]('cm_hopper_final')[_0x9387('0x40')](_0x23d870+_0x9387('0x4b'),_0x15305a['id']['toString']()))[_0x9387('0x40')](_0x9387('0x49'),squel[_0x9387('0x44')]()[_0x9387('0x3b')](_0x9387('0x37'))[_0x9387('0x3f')](_0x9387('0x35'))[_0x9387('0x40')](_0x23d870+_0x9387('0x4b'),_0x15305a['id'][_0x9387('0x43')]())))[_0x9387('0x43')]();return _0x1eaf06;};function _0x1dcfb9(_0x57937c,_0x687108){var _0x19f890=squel[_0x9387('0x33')]()[_0x9387('0x34')](_0x9387('0x35'))[_0x9387('0x36')](['phone',_0x9387('0x3c'),_0x9387('0x38'),_0x9387('0x3d'),_0x687108,_0x9387('0x39'),_0x9387('0x3a')],squel[_0x9387('0x44')]()[_0x9387('0x3b')](_0x9387('0x37'),_0x9387('0x37'))['field'](_0x9387('0x3e'),_0x9387('0x3c'))[_0x9387('0x3b')]('id',_0x9387('0x38'))['field'](LISTID[_0x9387('0x43')](),_0x9387('0x3d'))['field'](_0x57937c['id'][_0x9387('0x43')](),_0x687108)[_0x9387('0x3b')](_0x9387('0x3e'),_0x9387('0x39'))['field']('NOW()','updatedAt')[_0x9387('0x3f')](_0x9387('0x45'))['where']('deletedAt\x20IS\x20NULL')[_0x9387('0x40')](_0x9387('0x42'),LISTID[_0x9387('0x43')]())[_0x9387('0x40')]('id\x20IN\x20?',squel[_0x9387('0x47')](hopperContacts))[_0x9387('0x40')](_0x9387('0x48')))['toString']();return _0x19f890;}function _0x3bad08(_0x3f269b,_0x2bfd4f){var _0x4c6927=squel[_0x9387('0x33')]()['into']('cm_hopper_black')[_0x9387('0x36')]([_0x9387('0x37'),_0x9387('0x38'),_0x9387('0x3d'),_0x2bfd4f,_0x9387('0x39'),_0x9387('0x3a')],squel[_0x9387('0x44')]()['field']('phone',_0x9387('0x37'))[_0x9387('0x3b')]('id',_0x9387('0x38'))[_0x9387('0x3b')](LISTID['toString'](),'ListId')[_0x9387('0x3b')](_0x3f269b['id'][_0x9387('0x43')](),_0x2bfd4f)['field'](_0x9387('0x3e'),_0x9387('0x39'))[_0x9387('0x3b')]('NOW()',_0x9387('0x3a'))['from'](_0x9387('0x45'))[_0x9387('0x40')](_0x9387('0x41'))['where'](_0x9387('0x42'),LISTID[_0x9387('0x43')]())['where'](_0x9387('0x46'),squel['str'](hopperContacts))[_0x9387('0x40')](_0x9387('0x48')))['toString']();return _0x4c6927;}return db[_0x9387('0x4c')]['findAll']({'where':{'type':_0x9387('0x4d')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x9387('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0x9387('0x2b')](function(_0x518f8a){var _0x3f4727=[];if(_0x518f8a){var _0x12976c;for(var _0x3af108=0x0,_0x4fb555;_0x3af108<_0x518f8a[_0x9387('0x18')];_0x3af108+=0x1){_0x4fb555=_0x518f8a[_0x3af108][_0x9387('0x4f')]({'plain':!![]});switch(_0x4fb555[_0x9387('0x50')]){case _0x9387('0x51'):_0x3f4727['push'](db[_0x9387('0x52')][_0x9387('0x53')](_0x161aa6(_0x4fb555,_0x9387('0x54')))[_0x9387('0x2b')](function(){})['catch'](_0x54ecda()));break;case'onlyIfOpen':_0x3f4727[_0x9387('0x2c')](db[_0x9387('0x52')][_0x9387('0x53')](_0x127b58(_0x4fb555,_0x9387('0x54')))[_0x9387('0x2b')](function(){})[_0x9387('0x2d')](_0x54ecda()));break;default:_0x3f4727[_0x9387('0x2c')](db['sequelize'][_0x9387('0x53')](_0x1dcfb9(_0x4fb555,'VoiceQueueId'))[_0x9387('0x2b')](function(){})[_0x9387('0x2d')](_0x54ecda()));}}}return _0x3f4727;})[_0x9387('0x55')]()[_0x9387('0x2b')](function(){return db[_0x9387('0x4c')][_0x9387('0x56')]({'where':{'type':_0x9387('0x4d')},'attributes':['id'],'include':[{'model':db[_0x9387('0x4e')],'as':_0x9387('0x57'),'where':{'id':LISTID}}]})[_0x9387('0x2b')](function(_0x43250c){var _0x430ae0=[];if(_0x43250c){var _0x1ff5a2;for(var _0x448daa=0x0,_0x48c0e1;_0x448daa<_0x43250c[_0x9387('0x18')];_0x448daa+=0x1){_0x48c0e1=_0x43250c[_0x448daa][_0x9387('0x4f')]({'plain':!![]});_0x430ae0['push'](db['sequelize'][_0x9387('0x53')](_0x3bad08(_0x48c0e1,_0x9387('0x54')))[_0x9387('0x2b')](function(){})['catch'](_0x54ecda()));}}return _0x430ae0;})['all']();})[_0x9387('0x2b')](function(){return db['Campaign']['findAll']({'attributes':['id',_0x9387('0x50')],'include':[{'model':db[_0x9387('0x4e')],'as':_0x9387('0x58'),'where':{'id':LISTID}}]})[_0x9387('0x2b')](function(_0x399c6d){var _0x47bbd3=[];if(_0x399c6d){for(var _0x5771c5=0x0,_0x4c1167;_0x5771c5<_0x399c6d[_0x9387('0x18')];_0x5771c5+=0x1){_0x4c1167=_0x399c6d[_0x5771c5][_0x9387('0x4f')]({'plain':!![]});switch(_0x4c1167[_0x9387('0x50')]){case _0x9387('0x51'):_0x47bbd3[_0x9387('0x2c')](db[_0x9387('0x52')][_0x9387('0x53')](_0x161aa6(_0x4c1167,_0x9387('0x59')))[_0x9387('0x2b')](function(){})[_0x9387('0x2d')](_0x54ecda()));break;case _0x9387('0x5a'):_0x47bbd3['push'](db['sequelize'][_0x9387('0x53')](_0x127b58(_0x4c1167,_0x9387('0x59')))[_0x9387('0x2b')](function(){})[_0x9387('0x2d')](_0x54ecda()));break;default:_0x47bbd3['push'](db[_0x9387('0x52')][_0x9387('0x53')](_0x1dcfb9(_0x4c1167,_0x9387('0x59')))['then'](function(){})[_0x9387('0x2d')](_0x54ecda()));}}}return _0x47bbd3;})[_0x9387('0x55')]();})[_0x9387('0x2b')](function(){return db[_0x9387('0x5b')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x9387('0x4e')],'as':_0x9387('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x941d57){var _0x19245c=[];if(_0x941d57){for(var _0x300c99=0x0,_0x5c7771;_0x300c99<_0x941d57[_0x9387('0x18')];_0x300c99+=0x1){_0x5c7771=_0x941d57[_0x300c99]['get']({'plain':!![]});_0x19245c[_0x9387('0x2c')](db[_0x9387('0x52')][_0x9387('0x53')](_0x3bad08(_0x5c7771,'CampaignId'))[_0x9387('0x2b')](function(){})[_0x9387('0x2d')](_0x54ecda()));}}return _0x19245c;})[_0x9387('0x55')]();})['catch'](function(_0x11a8db){logger[_0x9387('0x13')](_0x9387('0x5c'),_0x9387('0x5d'),_0x11a8db[_0x9387('0x1a')]);});}var processPromises=function(_0x1c4e35){return BPromise[_0x9387('0x55')](promises)[_0x9387('0x2b')](function(_0x3c5447){})[_0x9387('0x2d')](function(_0x51dc3b){logger[_0x9387('0x13')]('Error\x20processing\x20rows\x20block:',JSON[_0x9387('0x2f')](_0x51dc3b));})['finally'](function(){socket[_0x9387('0x5e')](_0x9387('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1c4e35){return _0x1c4e35[_0x9387('0x60')]();}});};var endCsv=function(){return BPromise[_0x9387('0x61')]()[_0x9387('0x2b')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x9387('0x5e')](_0x9387('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x161e5c){logger[_0x9387('0x13')](_0x9387('0x62'),JSON[_0x9387('0x2f')](_0x161e5c));}finally{process[_0x9387('0x63')](0x0);}});};process['on'](_0x9387('0x64'),function(){logger[_0x9387('0x65')](_0x9387('0x66'));endCsv();});function main(){return BPromise[_0x9387('0x61')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x9387('0x11')](',');return db['CmContact'][_0x9387('0x56')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x9387('0x2b')](function(_0x18465e){var _0x3cd6a9=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x9387('0x67')](_0x3cd6a9,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5dc15e,_0x277633){total+=0x1;var _0xcfd71a=total;promises[_0x9387('0x2c')](checkRow(_0x5dc15e,_0x18465e,_0xcfd71a)[_0x9387('0x2b')](function(){success+=0x1;})[_0x9387('0x2d')](function(_0x5b7b7e){if(_0x5b7b7e['error']){errors+=0x1;delete _0x5b7b7e['error'];}else if(_0x5b7b7e['duplicate']){duplicates+=0x1;delete _0x5b7b7e[_0x9387('0x68')];}rows[_0x9387('0x2c')](_0x5b7b7e);}));if(total%0xc8===0x0){_0x277633[_0x9387('0x69')]();return processPromises(_0x277633);}},'complete':function(){return processPromises()['then'](function(){logger[_0x9387('0x65')](_0x9387('0x6a'));endCsv();});},'error':function(_0x3aa8bf,_0x3d06b9){logger[_0x9387('0x65')]('CSV\x20parse\x20error',JSON['stringify'](_0x3aa8bf));endCsv();}});})[_0x9387('0x2d')](function(_0x3420c5){logger['error'](_0x9387('0x6b'),JSON[_0x9387('0x2f')](_0x3420c5));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index beb9032..3683482 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 _0x5e4d=['email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','length','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','affectedRows','unlink','catch','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','bluebird','moment','squel','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','join','.id\x20=\x20','where','\x20=\x20','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','cm_contacts.ListId\x20=\x20','.CmListId','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.updatedAt','insert','into','cm_hopper_black','updatedAt','fields','cm_contacts','.CmListId\x20=\x20?','phone','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','Received\x20SIGINT','error','message','exit','errors','query','push','info','main','stringify','send','start','binding','root','.csv','header','writeFileSync','createReadStream','data','hasOwnProperty','replace','isValid','priority','isNaN','UserId','includes','agent\x20not\x20exists'];(function(_0xba5840,_0x14a6a0){var _0x52d105=function(_0x2be18a){while(--_0x2be18a){_0xba5840['push'](_0xba5840['shift']());}};_0x52d105(++_0x14a6a0);}(_0x5e4d,0x137));var _0xd5e4=function(_0x17297e,_0x5b059c){_0x17297e=_0x17297e-0x0;var _0x483300=_0x5e4d[_0x17297e];return _0x483300;};'use strict';var fs=require('fs');var path=require(_0xd5e4('0x0'));var _=require(_0xd5e4('0x1'));var Papa=require(_0xd5e4('0x2'));var util=require('util');var BPromise=require(_0xd5e4('0x3'));var moment=require(_0xd5e4('0x4'));var squel=require(_0xd5e4('0x5'));var Redis=require('ioredis');var db=require(_0xd5e4('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0xd5e4('0x7'))(_0xd5e4('0x8'));config[_0xd5e4('0x9')]=_[_0xd5e4('0xa')](config[_0xd5e4('0x9')],{'host':_0xd5e4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xd5e4('0xc')](_0xd5e4('0xd'));function isEmail(_0x3b98a6){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x3b98a6);}function selectNotIn(_0x327af9,_0x2e1856,_0x4a2139,_0x5de1cf,_0x536ee5){return squel[_0xd5e4('0xe')]()[_0xd5e4('0xf')]('phone')[_0xd5e4('0x10')](_0x5de1cf)[_0xd5e4('0x11')](_0x2e1856,null,_0x2e1856+_0xd5e4('0x12')+_0x5de1cf+'.'+_0x4a2139)[_0xd5e4('0x13')](_0x5de1cf+'.'+_0x4a2139+_0xd5e4('0x14')+_0x327af9+'.'+_0x4a2139)['where'](_0x2e1856+'.dialCheckDuplicateType\x20IN\x20('+_0x536ee5[_0xd5e4('0x11')]()+')');}function insertCmHopper(_0x70d784,_0x4afb27,_0x3e07bd,_0xa4a7e4,_0x4b886a){var _0x49b759=[_0xd5e4('0x15'),_0xd5e4('0x16'),_0xd5e4('0x17'),_0xd5e4('0x18'),_0x4afb27+'.'+_0xa4a7e4,_0xd5e4('0x19'),'cm_contacts.updatedAt',_0xd5e4('0x1a'),_0xd5e4('0x1b'),'\x22'+_0x4b886a+'\x22'];return squel['insert']()['into'](_0xd5e4('0x1c'))[_0xd5e4('0x1d')](['phone',_0xd5e4('0x1e'),_0xd5e4('0x1f'),_0xd5e4('0x20'),_0xa4a7e4,_0xd5e4('0x21'),'updatedAt','priority','UserId','recallme'],squel[_0xd5e4('0xe')]()['fields'](_0x49b759)[_0xd5e4('0x10')](_0x4afb27)[_0xd5e4('0x11')]('cm_contacts',null,_0xd5e4('0x22')+_0x4afb27+_0xd5e4('0x23'))[_0xd5e4('0x11')](_0x3e07bd,null,_0x3e07bd+_0xd5e4('0x12')+_0x4afb27+'.'+_0xa4a7e4)[_0xd5e4('0x13')](_0x4afb27+'.CmListId\x20=\x20?',_0x70d784)[_0xd5e4('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xd5e4('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4afb27,_0x3e07bd,_0xa4a7e4,'cm_hopper',[_0xd5e4('0x24'),_0xd5e4('0x25')]))[_0xd5e4('0x13')](_0xd5e4('0x26'),selectNotIn(_0x4afb27,_0x3e07bd,_0xa4a7e4,_0xd5e4('0x1c'),[_0xd5e4('0x24')])))[_0xd5e4('0x27')]();}function insertCmHopperBlack(_0x4b2fbe,_0x2d98a8,_0x4f5866,_0x152592){var _0xd67ced=[_0xd5e4('0x15'),_0xd5e4('0x17'),'cm_contacts.ListId',_0x2d98a8+'.'+_0x152592,'cm_contacts.createdAt',_0xd5e4('0x28')];return squel[_0xd5e4('0x29')]()[_0xd5e4('0x2a')](_0xd5e4('0x2b'))[_0xd5e4('0x1d')](['phone',_0xd5e4('0x1f'),'ListId',_0x152592,_0xd5e4('0x21'),_0xd5e4('0x2c')],squel[_0xd5e4('0xe')]()[_0xd5e4('0x2d')](_0xd67ced)[_0xd5e4('0x10')](_0x2d98a8)[_0xd5e4('0x11')](_0xd5e4('0x2e'),null,_0xd5e4('0x22')+_0x2d98a8+_0xd5e4('0x23'))[_0xd5e4('0x11')](_0x4f5866,null,_0x4f5866+_0xd5e4('0x12')+_0x2d98a8+'.'+_0x152592)[_0xd5e4('0x13')](_0x2d98a8+_0xd5e4('0x2f'),_0x4b2fbe)[_0xd5e4('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xd5e4('0x13')](_0xd5e4('0x26'),squel[_0xd5e4('0xe')]()[_0xd5e4('0xf')](_0xd5e4('0x30'))['from'](_0xd5e4('0x2b'))[_0xd5e4('0x13')]('ListId\x20=\x20?',_0x4b2fbe)['where'](_0x152592+_0xd5e4('0x31'),_0x2d98a8+'.'+_0x152592)))[_0xd5e4('0x27')]();}function insertCmContact(_0x1a9de7,_0x45e456,_0x533a72,_0x3b080b){var _0x20848e=_[_0xd5e4('0x32')](_[_0xd5e4('0x33')](_0x3b080b),[_0xd5e4('0x20'),_0xd5e4('0x34'),_0xd5e4('0x21'),'updatedAt']);return squel[_0xd5e4('0x29')]()['into']('cm_contacts')[_0xd5e4('0x1d')](_0x20848e,squel['select']()[_0xd5e4('0x2d')](_0x20848e)[_0xd5e4('0x10')](_0x45e456)[_0xd5e4('0x13')]('('+_0x533a72[_0xd5e4('0x11')](',')+_0xd5e4('0x35'),squel['select']()[_0xd5e4('0x2d')](_0x533a72)[_0xd5e4('0x10')]('cm_contacts')[_0xd5e4('0x13')]('ListId\x20=\x20?',_0x1a9de7)[_0xd5e4('0x13')](_0xd5e4('0x36')))[_0xd5e4('0x13')]('id\x20IN\x20?',squel[_0xd5e4('0xe')]()[_0xd5e4('0xf')](_0xd5e4('0x37'),_0xd5e4('0x38'))[_0xd5e4('0x10')](_0x45e456)[_0xd5e4('0x39')](_0x533a72[_0xd5e4('0x11')](','))))[_0xd5e4('0x27')]();}function handleStop(){logger['info'](_0xd5e4('0x3a'));stopped=!![];}function handleUncaughtException(_0x2867f3){logger[_0xd5e4('0x3b')](_0x2867f3[_0xd5e4('0x3c')]);process[_0xd5e4('0x3d')](0x1);}function handleError(_0x1606cb,_0x439acf){stats[_0xd5e4('0x3e')]['push']({'name':_0x439acf['code'],'message':_0x439acf[_0xd5e4('0x3c')],'row':_0x1606cb});}function handleQuery(_0x15e3cb){logger['info'](_0x15e3cb);return db['sequelize'][_0xd5e4('0x3f')](_0x15e3cb)['spread'](function(_0x549bb5){results[_0xd5e4('0x40')](_0x549bb5);})['catch'](function(_0x19e681){logger[_0xd5e4('0x3b')](_0x19e681[_0xd5e4('0x3c')]);});}function main(_0x18d98c,_0x1f38af,_0x142fab,_0x209e25){logger[_0xd5e4('0x41')](_0xd5e4('0x42'),_0x18d98c,JSON[_0xd5e4('0x43')](_0x1f38af));process[_0xd5e4('0x44')](_0xd5e4('0x45'));var _0x588a49=_0x1f38af[_0xd5e4('0x46')];var _0x2f998e=_0x1f38af['socket_timestamp'];var _0x5eb4a7=path[_0xd5e4('0x11')](config[_0xd5e4('0x47')],'server/files/tmp',_0x2f998e+_0xd5e4('0x48'));var _0x46442b=_[_0xd5e4('0x33')](_0x588a49)[_0xd5e4('0x11')]();logger[_0xd5e4('0x41')](_0xd5e4('0x49'),_0x46442b);fs[_0xd5e4('0x4a')](_0x5eb4a7,_0x46442b+'\x0a');Papa['parse'](fs[_0xd5e4('0x4b')](_0x18d98c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x34f4c1,_0x38c405){try{for(var _0x21ecc4=0x0,_0x1c24f3=[];_0x21ecc4<_0x34f4c1['data']['length'];_0x21ecc4++){stats['rows']+=0x1;if(_0x34f4c1[_0xd5e4('0x3e')][_0x21ecc4]){handleError(_0x34f4c1[_0xd5e4('0x4c')][_0x21ecc4],_0x34f4c1[_0xd5e4('0x3e')][_0x21ecc4]);}else{var _0x2cb76a=[];for(var _0x5c9f12 in _0x588a49){if(_0x588a49[_0xd5e4('0x4d')](_0x5c9f12)){if(_0x34f4c1[_0xd5e4('0x4c')][_0x21ecc4][_0x588a49[_0x5c9f12]]){var _0x587344=_['trim'](_0x34f4c1[_0xd5e4('0x4c')][_0x21ecc4][_0x588a49[_0x5c9f12]][_0xd5e4('0x4e')](/"/g,'\x27'));switch(_0x5c9f12){case _0xd5e4('0x1e'):var _0xc83e14=moment(_0x587344,_0xd5e4('0xd'),!![]);if(_0xc83e14[_0xd5e4('0x4f')]()){_0x1c24f3['push']('\x22'+_0x587344+'\x22');}else{_0x2cb76a[_0xd5e4('0x40')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xd5e4('0x50'):var _0x53d109=parseInt(_0x587344);_0x587344=_[_0xd5e4('0x51')](_0x53d109)||_0x53d109<0x0||_0x53d109>0x4?_0x209e25?0x3:0x2:_0x53d109;_0x1c24f3['push']('\x22'+_0x587344+'\x22');break;case _0xd5e4('0x52'):var _0x264c39=parseInt(_0x587344);if(_['isNumber'](_0x264c39)&&_[_0xd5e4('0x53')](_0x142fab,_0x264c39)){_0x1c24f3[_0xd5e4('0x40')]('\x22'+_0x264c39+'\x22');}else{_0x2cb76a[_0xd5e4('0x40')](_0xd5e4('0x54'));}break;case _0xd5e4('0x55'):if(isEmail(_0x587344)){_0x1c24f3['push']('\x22'+_0x587344+'\x22');}else{_0x2cb76a[_0xd5e4('0x40')](_0xd5e4('0x56'));}break;case _0xd5e4('0x57'):var _0x460a02=moment(_0x587344,_0xd5e4('0x58'),!![]);if(_0x460a02[_0xd5e4('0x4f')]()){_0x1c24f3['push']('\x22'+_0x587344+'\x22');}else{_0x2cb76a[_0xd5e4('0x40')](_0xd5e4('0x59'));}break;default:_0x1c24f3[_0xd5e4('0x40')]('\x22'+_0x587344+'\x22');}}else{switch(_0x5c9f12){case _0xd5e4('0x5a'):case _0xd5e4('0x30'):_0x2cb76a['push'](_0x5c9f12+_0xd5e4('0x5b'));break;default:_0x1c24f3[_0xd5e4('0x40')]('\x22\x22');}}}}if(_0x2cb76a[_0xd5e4('0x5c')]){handleError(_0x34f4c1['data'][_0x21ecc4],{'code':'SystemRow','message':_0x2cb76a[_0xd5e4('0x11')]()});}else{fs[_0xd5e4('0x5d')](_0x5eb4a7,_0x1c24f3['join']()+'\x0a');}_0x1c24f3=[];}if(!(stats['rows']%0xc8)){socket[_0xd5e4('0x5e')](_0xd5e4('0x5f')+_0x2f998e,stats);stats['errors']=[];}}if(stopped){logger['info'](_0xd5e4('0x60'));_0x38c405[_0xd5e4('0x61')]();}}catch(_0x2c263d){handleError(_0x34f4c1[_0xd5e4('0x4c')][_0x21ecc4],{'code':_0xd5e4('0x62'),'message':_0x2c263d['message']});logger['error'](_0xd5e4('0x63'),_0x2c263d[_0xd5e4('0x3c')]);}},'complete':function(){try{var _0x20dfd3=[];var _0x18f877=_0xd5e4('0x2e');if(_0x1f38af[_0xd5e4('0x64')]&&_0x1f38af[_0xd5e4('0x64')][_0xd5e4('0x5c')]){_0x18f877=_0xd5e4('0x65')+_0x2f998e;_0x20dfd3[_0xd5e4('0x40')]('CREATE\x20TABLE\x20'+_0x18f877+_0xd5e4('0x66'));}var _0x3e5436=util[_0xd5e4('0xc')](_0xd5e4('0x67'),_0x5eb4a7,_0x18f877,_0x46442b,_0x1f38af['ListId'],_0x1f38af[_0xd5e4('0x34')]||null,NOW,NOW);if(_[_0xd5e4('0x68')](_0x588a49['scheduledat'])){_0x3e5436+=_0xd5e4('0x69');}_0x20dfd3[_0xd5e4('0x40')](_0x3e5436);if(_0x1f38af[_0xd5e4('0x64')]&&_0x1f38af[_0xd5e4('0x64')][_0xd5e4('0x5c')]){_0x20dfd3[_0xd5e4('0x40')](insertCmContact(_0x1f38af[_0xd5e4('0x20')],_0x18f877,_0x1f38af[_0xd5e4('0x64')],_0x588a49));_0x20dfd3[_0xd5e4('0x40')](_0xd5e4('0x6a')+_0x18f877+';');}_0x20dfd3['push'](insertCmHopper(_0x1f38af[_0xd5e4('0x20')],_0xd5e4('0x6b'),_0xd5e4('0x6c'),_0xd5e4('0x6d'),_0x209e25));_0x20dfd3[_0xd5e4('0x40')](insertCmHopperBlack(_0x1f38af[_0xd5e4('0x20')],_0xd5e4('0x6e'),_0xd5e4('0x6c'),_0xd5e4('0x6d')));_0x20dfd3[_0xd5e4('0x40')](insertCmHopper(_0x1f38af[_0xd5e4('0x20')],_0xd5e4('0x6f'),_0xd5e4('0x70'),_0xd5e4('0x71'),_0x209e25));_0x20dfd3['push'](insertCmHopperBlack(_0x1f38af['ListId'],_0xd5e4('0x72'),_0xd5e4('0x70'),_0xd5e4('0x71')));BPromise[_0xd5e4('0x73')](_0x20dfd3,handleQuery)[_0xd5e4('0x74')](function(_0x2cfa92){stats['finish']=!![];stats[_0xd5e4('0x75')]=_0x1f38af[_0xd5e4('0x64')]&&_0x1f38af[_0xd5e4('0x64')][_0xd5e4('0x5c')]?results[0x2]['affectedRows']:results[0x0][_0xd5e4('0x75')];socket[_0xd5e4('0x5e')]('contact:import:'+_0x2f998e,stats);fs['unlink'](_0x18d98c);fs[_0xd5e4('0x76')](_0x5eb4a7);process[_0xd5e4('0x3d')](0x0);})[_0xd5e4('0x77')](function(_0x324052){logger[_0xd5e4('0x3b')](_0x324052[_0xd5e4('0x3c')]);process[_0xd5e4('0x3d')](0x1);});}catch(_0xf5eb85){logger[_0xd5e4('0x3b')]('complete',_0xf5eb85[_0xd5e4('0x3c')]);process[_0xd5e4('0x3d')](0x1);}},'error':function(_0x4798af,_0xa2d537,_0x55335e,_0x4d011c){throw new Error(_0x4d011c);}});}function validate(){if(process[_0xd5e4('0x78')]&&process['argv'][_0xd5e4('0x5c')]<0x4){throw new Error(_0xd5e4('0x79'));}var _0x32e86a=path['join'](config[_0xd5e4('0x47')],_0xd5e4('0x7a'),process['argv'][0x2]);if(!fs[_0xd5e4('0x7b')](_0x32e86a)){throw new Error('file\x20doesn\x27t\x20exists');}var _0xed0416={};try{_0xed0416=JSON[_0xd5e4('0x7c')](process[_0xd5e4('0x78')][0x3]);if(!_0xed0416[_0xd5e4('0x46')]){throw new Error(_0xd5e4('0x7d'));}if(!_0xed0416[_0xd5e4('0x46')]['phone']){throw new Error(_0xd5e4('0x7e'));}if(!_0xed0416[_0xd5e4('0x46')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x528128=0x0;if(_0xed0416[_0xd5e4('0x46')][_0xd5e4('0x52')]){_0x528128=0x1;}if(!_0xed0416[_0xd5e4('0x20')]){throw new Error(_0xd5e4('0x7f'));}}catch(_0x22795f){throw new Error(_0xd5e4('0x80'));}var _0x1809e3=[];try{_0x1809e3=_[_0xd5e4('0x81')](JSON[_0xd5e4('0x7c')](process[_0xd5e4('0x78')][0x4]),'id');}catch(_0x209cbb){logger[_0xd5e4('0x41')](_0xd5e4('0x82'));}main(_0x32e86a,_0xed0416,_0x1809e3,_0x528128);}validate();process['on'](_0xd5e4('0x83'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x2af8=['join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.phone','ContactId','fields','cm_hopper_black','ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','info','error','message','exit','errors','push','code','sequelize','query','spread','catch','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','header','createReadStream','length','rows','data','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns','CampaignId','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','SIGINT','uncaughtException','path','papaparse','util','moment','squel','../../../mysqldb','../../../config/logger','import','defaults','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from'];(function(_0x1ac5e1,_0x43a483){var _0x3ae80e=function(_0x234518){while(--_0x234518){_0x1ac5e1['push'](_0x1ac5e1['shift']());}};_0x3ae80e(++_0x43a483);}(_0x2af8,0xf6));var _0x82af=function(_0x4f3de9,_0x1411ab){_0x4f3de9=_0x4f3de9-0x0;var _0x533c9b=_0x2af8[_0x4f3de9];return _0x533c9b;};'use strict';var fs=require('fs');var path=require(_0x82af('0x0'));var _=require('lodash');var Papa=require(_0x82af('0x1'));var util=require(_0x82af('0x2'));var BPromise=require('bluebird');var moment=require(_0x82af('0x3'));var squel=require(_0x82af('0x4'));var Redis=require('ioredis');var db=require(_0x82af('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x82af('0x6'))(_0x82af('0x7'));config['redis']=_[_0x82af('0x8')](config[_0x82af('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x82af('0xa'))(new Redis(config[_0x82af('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x82af('0xb')](_0x82af('0xc'));function isEmail(_0x4328e3){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))*$/[_0x82af('0xd')](_0x4328e3);}function selectNotIn(_0x1dbaff,_0x46fe4b,_0x41451a,_0xd5ecc8,_0x459bf0){return squel[_0x82af('0xe')]()[_0x82af('0xf')](_0x82af('0x10'))[_0x82af('0x11')](_0xd5ecc8)[_0x82af('0x12')](_0x46fe4b,null,_0x46fe4b+_0x82af('0x13')+_0xd5ecc8+'.'+_0x41451a)[_0x82af('0x14')](_0xd5ecc8+'.'+_0x41451a+'\x20=\x20'+_0x1dbaff+'.'+_0x41451a)['where'](_0x46fe4b+_0x82af('0x15')+_0x459bf0[_0x82af('0x12')]()+')');}function insertCmHopper(_0x405069,_0x4cf822,_0x2ed907,_0x18332f,_0x195bd2){var _0x2b7ce8=['cm_contacts.phone',_0x82af('0x16'),_0x82af('0x17'),_0x82af('0x18'),_0x4cf822+'.'+_0x18332f,_0x82af('0x19'),_0x82af('0x1a'),_0x82af('0x1b'),_0x82af('0x1c'),'\x22'+_0x195bd2+'\x22'];return squel[_0x82af('0x1d')]()[_0x82af('0x1e')](_0x82af('0x1f'))[_0x82af('0x20')]([_0x82af('0x10'),_0x82af('0x21'),'ContactId',_0x82af('0x22'),_0x18332f,_0x82af('0x23'),_0x82af('0x24'),_0x82af('0x25'),'UserId','recallme'],squel[_0x82af('0xe')]()['fields'](_0x2b7ce8)[_0x82af('0x11')](_0x4cf822)[_0x82af('0x12')](_0x82af('0x26'),null,_0x82af('0x27')+_0x4cf822+_0x82af('0x28'))[_0x82af('0x12')](_0x2ed907,null,_0x2ed907+_0x82af('0x13')+_0x4cf822+'.'+_0x18332f)['where'](_0x4cf822+_0x82af('0x29'),_0x405069)['where'](_0x82af('0x2a'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4cf822,_0x2ed907,_0x18332f,_0x82af('0x1f'),['\x22always\x22',_0x82af('0x2b')]))[_0x82af('0x14')](_0x82af('0x2c'),selectNotIn(_0x4cf822,_0x2ed907,_0x18332f,_0x82af('0x1f'),[_0x82af('0x2d')])))[_0x82af('0x2e')]();}function insertCmHopperBlack(_0x4579c1,_0x1adceb,_0x5c839f,_0x4e377d){var _0x122825=[_0x82af('0x2f'),'cm_contacts.id',_0x82af('0x18'),_0x1adceb+'.'+_0x4e377d,_0x82af('0x19'),_0x82af('0x1a')];return squel[_0x82af('0x1d')]()['into']('cm_hopper_black')[_0x82af('0x20')]([_0x82af('0x10'),_0x82af('0x30'),_0x82af('0x22'),_0x4e377d,_0x82af('0x23'),_0x82af('0x24')],squel[_0x82af('0xe')]()[_0x82af('0x31')](_0x122825)[_0x82af('0x11')](_0x1adceb)[_0x82af('0x12')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x1adceb+_0x82af('0x28'))['join'](_0x5c839f,null,_0x5c839f+'.id\x20=\x20'+_0x1adceb+'.'+_0x4e377d)[_0x82af('0x14')](_0x1adceb+_0x82af('0x29'),_0x4579c1)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x82af('0x14')](_0x82af('0x2c'),squel[_0x82af('0xe')]()[_0x82af('0xf')]('phone')[_0x82af('0x11')](_0x82af('0x32'))[_0x82af('0x14')](_0x82af('0x33'),_0x4579c1)[_0x82af('0x14')](_0x4e377d+'\x20=\x20?',_0x1adceb+'.'+_0x4e377d)))[_0x82af('0x2e')]();}function insertCmContact(_0x24b611,_0x2fe6c3,_0x3330ba,_0x489690){var _0x1c7ef0=_['concat'](_[_0x82af('0x34')](_0x489690),[_0x82af('0x22'),_0x82af('0x35'),_0x82af('0x23'),_0x82af('0x24')]);return squel[_0x82af('0x1d')]()['into'](_0x82af('0x26'))[_0x82af('0x20')](_0x1c7ef0,squel[_0x82af('0xe')]()[_0x82af('0x31')](_0x1c7ef0)[_0x82af('0x11')](_0x2fe6c3)[_0x82af('0x14')]('('+_0x3330ba['join'](',')+_0x82af('0x36'),squel[_0x82af('0xe')]()[_0x82af('0x31')](_0x3330ba)[_0x82af('0x11')]('cm_contacts')[_0x82af('0x14')](_0x82af('0x33'),_0x24b611)['where'](_0x82af('0x37')))[_0x82af('0x14')](_0x82af('0x38'),squel[_0x82af('0xe')]()[_0x82af('0xf')](_0x82af('0x39'),'min_id')[_0x82af('0x11')](_0x2fe6c3)['group'](_0x3330ba[_0x82af('0x12')](','))))[_0x82af('0x2e')]();}function handleStop(){logger[_0x82af('0x3a')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x349a26){logger[_0x82af('0x3b')](_0x349a26[_0x82af('0x3c')]);process[_0x82af('0x3d')](0x1);}function handleError(_0x27199c,_0x28c9eb){stats[_0x82af('0x3e')][_0x82af('0x3f')]({'name':_0x28c9eb[_0x82af('0x40')],'message':_0x28c9eb['message'],'row':_0x27199c});}function handleQuery(_0x15667a){logger['info'](_0x15667a);return db[_0x82af('0x41')][_0x82af('0x42')](_0x15667a)[_0x82af('0x43')](function(_0x59c7b8){results[_0x82af('0x3f')](_0x59c7b8);})[_0x82af('0x44')](function(_0x3c6e34){logger[_0x82af('0x3b')](_0x3c6e34[_0x82af('0x3c')]);});}function main(_0x5276bf,_0x42a7d0,_0x1e1c4f,_0x4af8f2){logger['info'](_0x82af('0x45'),_0x5276bf,JSON[_0x82af('0x46')](_0x42a7d0));process[_0x82af('0x47')]('start');var _0x477341=_0x42a7d0[_0x82af('0x48')];var _0x14a033=_0x42a7d0[_0x82af('0x49')];var _0x56a16b=path[_0x82af('0x12')](config[_0x82af('0x4a')],_0x82af('0x4b'),_0x14a033+_0x82af('0x4c'));var _0x8d7610=_[_0x82af('0x34')](_0x477341)['join']();logger['info'](_0x82af('0x4d'),_0x8d7610);fs['writeFileSync'](_0x56a16b,_0x8d7610+'\x0a');Papa['parse'](fs[_0x82af('0x4e')](_0x5276bf),{'header':!![],'skipEmptyLines':!![],'step':function(_0xee39cc,_0x106451){try{for(var _0x502b4d=0x0,_0x1b0929=[];_0x502b4d<_0xee39cc['data'][_0x82af('0x4f')];_0x502b4d++){stats[_0x82af('0x50')]+=0x1;if(_0xee39cc['errors'][_0x502b4d]){handleError(_0xee39cc[_0x82af('0x51')][_0x502b4d],_0xee39cc[_0x82af('0x3e')][_0x502b4d]);}else{var _0x44e03b=[];for(var _0x3a5199 in _0x477341){if(_0x477341[_0x82af('0x52')](_0x3a5199)){if(_0xee39cc[_0x82af('0x51')][_0x502b4d][_0x477341[_0x3a5199]]){var _0x8d8939=_[_0x82af('0x53')](_0xee39cc['data'][_0x502b4d][_0x477341[_0x3a5199]][_0x82af('0x54')](/"/g,'\x27'));switch(_0x3a5199){case _0x82af('0x21'):var _0x559175=moment(_0x8d8939,_0x82af('0xc'),!![]);if(_0x559175['isValid']()){_0x1b0929[_0x82af('0x3f')]('\x22'+_0x8d8939+'\x22');}else{_0x44e03b[_0x82af('0x3f')](_0x82af('0x55'));}break;case _0x82af('0x25'):var _0x44f9d6=parseInt(_0x8d8939);_0x8d8939=_[_0x82af('0x56')](_0x44f9d6)||_0x44f9d6<0x0||_0x44f9d6>0x4?_0x4af8f2?0x3:0x2:_0x44f9d6;_0x1b0929[_0x82af('0x3f')]('\x22'+_0x8d8939+'\x22');break;case _0x82af('0x57'):var _0xaa9d99=parseInt(_0x8d8939);if(_[_0x82af('0x58')](_0xaa9d99)&&_['includes'](_0x1e1c4f,_0xaa9d99)){_0x1b0929[_0x82af('0x3f')]('\x22'+_0xaa9d99+'\x22');}else{_0x44e03b[_0x82af('0x3f')](_0x82af('0x59'));}break;case _0x82af('0x5a'):if(isEmail(_0x8d8939)){_0x1b0929[_0x82af('0x3f')]('\x22'+_0x8d8939+'\x22');}else{_0x44e03b[_0x82af('0x3f')](_0x82af('0x5b'));}break;case'dateOfBirth':var _0x48925c=moment(_0x8d8939,_0x82af('0x5c'),!![]);if(_0x48925c['isValid']()){_0x1b0929[_0x82af('0x3f')]('\x22'+_0x8d8939+'\x22');}else{_0x44e03b['push'](_0x82af('0x5d'));}break;default:_0x1b0929[_0x82af('0x3f')]('\x22'+_0x8d8939+'\x22');}}else{switch(_0x3a5199){case _0x82af('0x5e'):case _0x82af('0x10'):_0x44e03b[_0x82af('0x3f')](_0x3a5199+_0x82af('0x5f'));break;default:_0x1b0929['push']('\x22\x22');}}}}if(_0x44e03b['length']){handleError(_0xee39cc['data'][_0x502b4d],{'code':_0x82af('0x60'),'message':_0x44e03b['join']()});}else{fs[_0x82af('0x61')](_0x56a16b,_0x1b0929[_0x82af('0x12')]()+'\x0a');}_0x1b0929=[];}if(!(stats['rows']%0xc8)){socket[_0x82af('0x62')]('contact:import:'+_0x14a033,stats);stats['errors']=[];}}if(stopped){logger[_0x82af('0x3a')](_0x82af('0x63'));_0x106451[_0x82af('0x64')]();}}catch(_0x1d9023){handleError(_0xee39cc['data'][_0x502b4d],{'code':_0x82af('0x65'),'message':_0x1d9023['message']});logger[_0x82af('0x3b')](_0x82af('0x66'),_0x1d9023['message']);}},'complete':function(){try{var _0x4bbc0f=[];var _0x32b6bc=_0x82af('0x26');if(_0x42a7d0[_0x82af('0x67')]&&_0x42a7d0['duplicates'][_0x82af('0x4f')]){_0x32b6bc=_0x82af('0x68')+_0x14a033;_0x4bbc0f[_0x82af('0x3f')](_0x82af('0x69')+_0x32b6bc+_0x82af('0x6a'));}var _0x4e305c=util[_0x82af('0xb')](_0x82af('0x6b'),_0x56a16b,_0x32b6bc,_0x8d7610,_0x42a7d0['ListId'],_0x42a7d0[_0x82af('0x35')]||null,NOW,NOW);if(_[_0x82af('0x6c')](_0x477341[_0x82af('0x21')])){_0x4e305c+=_0x82af('0x6d');}_0x4bbc0f[_0x82af('0x3f')](_0x4e305c);if(_0x42a7d0[_0x82af('0x67')]&&_0x42a7d0[_0x82af('0x67')]['length']){_0x4bbc0f[_0x82af('0x3f')](insertCmContact(_0x42a7d0[_0x82af('0x22')],_0x32b6bc,_0x42a7d0[_0x82af('0x67')],_0x477341));_0x4bbc0f['push'](_0x82af('0x6e')+_0x32b6bc+';');}_0x4bbc0f[_0x82af('0x3f')](insertCmHopper(_0x42a7d0['ListId'],_0x82af('0x6f'),_0x82af('0x70'),'VoiceQueueId',_0x4af8f2));_0x4bbc0f[_0x82af('0x3f')](insertCmHopperBlack(_0x42a7d0[_0x82af('0x22')],_0x82af('0x71'),'voice_queues',_0x82af('0x72')));_0x4bbc0f[_0x82af('0x3f')](insertCmHopper(_0x42a7d0[_0x82af('0x22')],'campaigns_has_cm_lists',_0x82af('0x73'),_0x82af('0x74'),_0x4af8f2));_0x4bbc0f[_0x82af('0x3f')](insertCmHopperBlack(_0x42a7d0[_0x82af('0x22')],'campaigns_has_cm_blacklists',_0x82af('0x73'),_0x82af('0x74')));BPromise['each'](_0x4bbc0f,handleQuery)['then'](function(_0x521983){stats[_0x82af('0x75')]=!![];stats['affectedRows']=_0x42a7d0[_0x82af('0x67')]&&_0x42a7d0[_0x82af('0x67')][_0x82af('0x4f')]?results[0x2][_0x82af('0x76')]:results[0x0][_0x82af('0x76')];socket[_0x82af('0x62')](_0x82af('0x77')+_0x14a033,stats);fs[_0x82af('0x78')](_0x5276bf);fs['unlink'](_0x56a16b);process[_0x82af('0x3d')](0x0);})[_0x82af('0x44')](function(_0x193d15){logger['error'](_0x193d15[_0x82af('0x3c')]);process[_0x82af('0x3d')](0x1);});}catch(_0x1201fd){logger[_0x82af('0x3b')](_0x82af('0x79'),_0x1201fd['message']);process[_0x82af('0x3d')](0x1);}},'error':function(_0xc08231,_0x3ba7ad,_0x5e85a9,_0x12ce1b){throw new Error(_0x12ce1b);}});}function validate(){if(process[_0x82af('0x7a')]&&process[_0x82af('0x7a')]['length']<0x4){throw new Error(_0x82af('0x7b'));}var _0x42c20c=path['join'](config[_0x82af('0x4a')],_0x82af('0x4b'),process['argv'][0x2]);if(!fs[_0x82af('0x7c')](_0x42c20c)){throw new Error(_0x82af('0x7d'));}var _0xd81db3={};try{_0xd81db3=JSON[_0x82af('0x7e')](process[_0x82af('0x7a')][0x3]);if(!_0xd81db3[_0x82af('0x48')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0xd81db3[_0x82af('0x48')][_0x82af('0x10')]){throw new Error('phone\x20is\x20mandatory');}if(!_0xd81db3['binding'][_0x82af('0x5e')]){throw new Error(_0x82af('0x7f'));}var _0x4e5d69=0x0;if(_0xd81db3[_0x82af('0x48')][_0x82af('0x57')]){_0x4e5d69=0x1;}if(!_0xd81db3['ListId']){throw new Error(_0x82af('0x80'));}}catch(_0x10b50c){throw new Error('body\x20id\x20mandatory');}var _0x30465b=[];try{_0x30465b=_[_0x82af('0x81')](JSON[_0x82af('0x7e')](process['argv'][0x4]),'id');}catch(_0x1d5b54){logger[_0x82af('0x3a')]('No\x20agent\x20available');}main(_0x42c20c,_0xd81db3,_0x30465b,_0x4e5d69);}validate();process['on'](_0x82af('0x82'),handleStop);process['on'](_0x82af('0x83'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index e68935a..e4bce71 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 _0x877a=['queue','push','calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions','inbound','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','agentcalledAt','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','outbound','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','membername','Date','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','variable'];(function(_0x4923bb,_0x3a23a5){var _0x972f81=function(_0x2f824a){while(--_0x2f824a){_0x4923bb['push'](_0x4923bb['shift']());}};_0x972f81(++_0x3a23a5);}(_0x877a,0xb2));var _0xa877=function(_0xec5635,_0xde3eb0){_0xec5635=_0xec5635-0x0;var _0x5b5ac4=_0x877a[_0xec5635];return _0x5b5ac4;};'use strict';exports[_0xa877('0x0')]=function(_0x1783a7,_0x439eaf){var _0x57af5e=[{'type':_0xa877('0x1'),'content':_0xa877('0x2'),'variableName':null}];switch(_0x1783a7['toLowerCase']()){case _0xa877('0x3'):switch(_0x439eaf[_0xa877('0x4')]()){case'inbound':_0x57af5e['push']({'type':_0xa877('0x5'),'content':'','variableName':_0xa877('0x6')});_0x57af5e[_0xa877('0x7')]({'type':_0xa877('0x5'),'content':'','variableName':_0xa877('0x8')});break;case'outbound':_0x57af5e[_0xa877('0x7')]({'type':_0xa877('0x1'),'content':_0xa877('0x9'),'variableName':null});_0x57af5e[_0xa877('0x7')]({'type':_0xa877('0x5'),'content':'','variableName':_0xa877('0xa')});break;}}return _0x57af5e;};exports[_0xa877('0xb')]=function(_0x10b9b1,_0x4ff291){var _0x3c5c58=[];switch(_0x10b9b1[_0xa877('0x4')]()){case'voice':switch(_0x4ff291[_0xa877('0x4')]()){case _0xa877('0xc'):_0x3c5c58=[{'type':_0xa877('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xa877('0xd'),'content':'','key':_0xa877('0xe'),'keyType':'variable','variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0xa877('0xf'),'keyType':_0xa877('0x5'),'variableName':_0xa877('0x10')},{'type':'keyValue','content':'','key':_0xa877('0x11'),'keyType':_0xa877('0x5'),'variableName':_0xa877('0x12')},{'type':'keyValue','content':'','key':_0xa877('0x13'),'keyType':_0xa877('0x5'),'variableName':_0xa877('0x6')},{'type':'keyValue','content':'','key':_0xa877('0x14'),'keyType':_0xa877('0x5'),'variableName':_0xa877('0x15')},{'type':_0xa877('0xd'),'content':'','key':'Date','keyType':'variable','variableName':_0xa877('0x16')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xa877('0x17'),'keyType':_0xa877('0x5'),'variableName':_0xa877('0x18')},{'type':_0xa877('0xd'),'content':'','key':'Agent\x20Number','keyType':'variable','variableName':'destcalleridnum'},{'type':'string','content':_0xa877('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xa877('0xd'),'content':'','key':_0xa877('0x1a'),'keyType':'variable','variableName':_0xa877('0x16')},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':_0xa877('0x5'),'variableName':_0xa877('0x1b')},{'type':_0xa877('0xd'),'content':'','key':_0xa877('0x1c'),'keyType':_0xa877('0x5'),'variableName':_0xa877('0x1d')},{'type':'keyValue','content':'','key':_0xa877('0x1e'),'keyType':_0xa877('0x5'),'variableName':_0xa877('0x1f')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0xa877('0x5'),'variableName':'talktime'}];break;case _0xa877('0x20'):_0x3c5c58=[{'type':_0xa877('0x1'),'content':_0xa877('0x21'),'variableName':null},{'type':_0xa877('0xd'),'content':'','key':_0xa877('0x22'),'keyType':_0xa877('0x5'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0xa877('0xd'),'content':'','key':_0xa877('0x23'),'keyType':'variable','keyContent':'','variableName':_0xa877('0x24')},{'type':_0xa877('0xd'),'content':'','key':_0xa877('0x14'),'keyType':'variable','keyContent':'','variableName':_0xa877('0x15')},{'type':_0xa877('0xd'),'content':'','key':_0xa877('0x25'),'keyType':_0xa877('0x5'),'keyContent':'','variableName':_0xa877('0x26')},{'type':'string','content':_0xa877('0x19')},{'type':'keyValue','content':'','key':_0xa877('0x27'),'keyType':_0xa877('0x5'),'keyContent':'','variableName':'answertime'},{'type':_0xa877('0xd'),'content':'','key':_0xa877('0x28'),'keyType':'variable','keyContent':'','variableName':_0xa877('0x29')},{'type':'keyValue','content':'','key':_0xa877('0x2a'),'keyType':_0xa877('0x5'),'keyContent':'','variableName':_0xa877('0x2b')},{'type':_0xa877('0xd'),'content':'','key':_0xa877('0x2c'),'keyType':_0xa877('0x5'),'keyContent':'','variableName':_0xa877('0x2d')}];break;}}return _0x3c5c58;}; \ No newline at end of file +var _0x7c25=['queue','UniqueId','uniqueid','Date','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','starttime','answertime','Complete\x20Time','Duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','destexten','Queue'];(function(_0x1c4866,_0x255b66){var _0x4239e6=function(_0xb477fe){while(--_0xb477fe){_0x1c4866['push'](_0x1c4866['shift']());}};_0x4239e6(++_0x255b66);}(_0x7c25,0x1f2));var _0x57c2=function(_0x15859c,_0x5e7bad){_0x15859c=_0x15859c-0x0;var _0x4fd7aa=_0x7c25[_0x15859c];return _0x4fd7aa;};'use strict';exports[_0x57c2('0x0')]=function(_0x16aed6,_0x7ec90e){var _0xbd11e=[{'type':_0x57c2('0x1'),'content':_0x57c2('0x2'),'variableName':null}];switch(_0x16aed6[_0x57c2('0x3')]()){case _0x57c2('0x4'):switch(_0x7ec90e['toLowerCase']()){case _0x57c2('0x5'):_0xbd11e[_0x57c2('0x6')]({'type':_0x57c2('0x7'),'content':'','variableName':'queue'});_0xbd11e[_0x57c2('0x6')]({'type':'variable','content':'','variableName':_0x57c2('0x8')});break;case _0x57c2('0x9'):_0xbd11e[_0x57c2('0x6')]({'type':_0x57c2('0x1'),'content':_0x57c2('0xa'),'variableName':null});_0xbd11e['push']({'type':_0x57c2('0x7'),'content':'','variableName':_0x57c2('0xb')});break;}}return _0xbd11e;};exports['getDescriptions']=function(_0x3d008f,_0x5eaf52){var _0x151e15=[];switch(_0x3d008f[_0x57c2('0x3')]()){case'voice':switch(_0x5eaf52['toLowerCase']()){case _0x57c2('0x5'):_0x151e15=[{'type':_0x57c2('0x1'),'content':_0x57c2('0xc'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0x57c2('0x8')},{'type':_0x57c2('0xd'),'content':'','key':_0x57c2('0xe'),'keyType':_0x57c2('0x7'),'variableName':_0x57c2('0xf')},{'type':_0x57c2('0xd'),'content':'','key':'Call\x20To','keyType':'variable','variableName':_0x57c2('0x10')},{'type':_0x57c2('0xd'),'content':'','key':_0x57c2('0x11'),'keyType':_0x57c2('0x7'),'variableName':_0x57c2('0x12')},{'type':_0x57c2('0xd'),'content':'','key':_0x57c2('0x13'),'keyType':_0x57c2('0x7'),'variableName':_0x57c2('0x14')},{'type':_0x57c2('0xd'),'content':'','key':_0x57c2('0x15'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0x57c2('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x57c2('0x16'),'keyType':_0x57c2('0x7'),'variableName':_0x57c2('0x17')},{'type':_0x57c2('0xd'),'content':'','key':_0x57c2('0x18'),'keyType':'variable','variableName':_0x57c2('0xb')},{'type':_0x57c2('0x1'),'content':_0x57c2('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x57c2('0xd'),'content':'','key':_0x57c2('0x1a'),'keyType':'variable','variableName':_0x57c2('0x1b')},{'type':_0x57c2('0xd'),'content':'','key':_0x57c2('0x1c'),'keyType':_0x57c2('0x7'),'variableName':_0x57c2('0x1d')},{'type':'keyValue','content':'','key':_0x57c2('0x1e'),'keyType':_0x57c2('0x7'),'variableName':_0x57c2('0x1f')},{'type':'keyValue','content':'','key':_0x57c2('0x20'),'keyType':_0x57c2('0x7'),'variableName':_0x57c2('0x21')},{'type':_0x57c2('0xd'),'content':'','key':_0x57c2('0x22'),'keyType':_0x57c2('0x7'),'variableName':_0x57c2('0x23')}];break;case _0x57c2('0x9'):_0x151e15=[{'type':_0x57c2('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':_0x57c2('0x24'),'keyType':_0x57c2('0x7'),'keyContent':'','variableName':_0x57c2('0xb')},{'type':'keyValue','content':'','key':_0x57c2('0x25'),'keyType':_0x57c2('0x7'),'keyContent':'','variableName':'membername'},{'type':_0x57c2('0xd'),'content':'','key':'UniqueId','keyType':'variable','keyContent':'','variableName':'uniqueid'},{'type':_0x57c2('0xd'),'content':'','key':'Date','keyType':_0x57c2('0x7'),'keyContent':'','variableName':_0x57c2('0x26')},{'type':'string','content':_0x57c2('0x19')},{'type':_0x57c2('0xd'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0x57c2('0x27')},{'type':_0x57c2('0xd'),'content':'','key':_0x57c2('0x28'),'keyType':_0x57c2('0x7'),'keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':_0x57c2('0x29'),'keyType':_0x57c2('0x7'),'keyContent':'','variableName':'duration'},{'type':_0x57c2('0xd'),'content':'','key':'Billable\x20Time','keyType':_0x57c2('0x7'),'keyContent':'','variableName':_0x57c2('0x2a')}];break;}}return _0x151e15;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 6cfb507..25c8941 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 _0xfc66=['../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','InteractionId','upperFirst','name','role','stringify','null','Interaction','findOne','then','info','error','tracked','user','query','clone','body','html','fax','mobile','lodash','../../mysqldb','openchannel-interactions','mail-interactions'];(function(_0x6ec16,_0x2e8212){var _0x2b62ac=function(_0x3aa462){while(--_0x3aa462){_0x6ec16['push'](_0x6ec16['shift']());}};_0x2b62ac(++_0x2e8212);}(_0xfc66,0x140));var _0x6fc6=function(_0x1174ca,_0x4964c3){_0x1174ca=_0x1174ca-0x0;var _0x3570c7=_0xfc66[_0x1174ca];return _0x3570c7;};'use strict';var _=require(_0x6fc6('0x0'));var db=require(_0x6fc6('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x6fc6('0x2')),'mail':require('../../config/logger')(_0x6fc6('0x3')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x6fc6('0x4'))(_0x6fc6('0x5')),'chat':require('../../config/logger')(_0x6fc6('0x6')),'whatsapp':require(_0x6fc6('0x4'))(_0x6fc6('0x7'))};function getInteractionId(_0xcc210a,_0x261e13,_0x421bb7){if(_0xcc210a&&_0xcc210a[_['upperFirst'](_0x421bb7)+_0x6fc6('0x8')]){return _0xcc210a[_[_0x6fc6('0x9')](_0x421bb7)+_0x6fc6('0x8')];}else if(_0xcc210a&&_0xcc210a['id']){return _0xcc210a['id'];}else if(_0x261e13&&_0x261e13['id']){return _0x261e13['id'];}else{return'unknown';}}function log(_0xd7e97e,_0x3b0fa0,_0x1acbe0,_0x23c4eb,_0x35401a,_0x5bf191){loggers[_0x35401a['toLowerCase']()][_0xd7e97e]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5bf191['toUpperCase'](),_0x3b0fa0?_0x3b0fa0['id']:null,_0x3b0fa0?_0x3b0fa0[_0x6fc6('0xa')]:null,_0x3b0fa0?_0x3b0fa0[_0x6fc6('0xb')]:null,getInteractionId(_0x1acbe0,_0x23c4eb,_0x35401a),_0x1acbe0?JSON[_0x6fc6('0xc')](_0x1acbe0):_0x6fc6('0xd'));}function updateUser(_0x3ed30b,_0x5f5bdc,_0x36bb8f,_0x2e339d,_0x3af1c7){db[_[_0x6fc6('0x9')](_0x2e339d)+_0x6fc6('0xe')][_0x6fc6('0xf')]({'where':{'id':getInteractionId(_0x5f5bdc,_0x36bb8f,_0x2e339d)}})[_0x6fc6('0x10')](function(_0x123bd8){if(_0x123bd8){return _0x123bd8['update']({'UserId':_0x3ed30b?_0x3ed30b['id']:null});}})[_0x6fc6('0x10')](function(_0x2c0772){if(_0x2c0772){log(_0x6fc6('0x11'),_0x3ed30b,_0x5f5bdc,_0x36bb8f,_0x2e339d,_0x3af1c7);}})['catch'](function(){log(_0x6fc6('0x12'),_0x3ed30b,_0x5f5bdc,_0x36bb8f,_0x2e339d,_0x3af1c7);});}exports[_0x6fc6('0x13')]=function(_0x129ce7,_0x504763){return function(_0x2125c0,_0xa80c14,_0x3f1ade){var _0x4f7bb1=_0x2125c0[_0x6fc6('0x14')];var _0x37674a={};var _0x3cf742=_0x2125c0[_0x6fc6('0x15')];if(_0x37674a){_0x37674a=_[_0x6fc6('0x16')](_0x2125c0[_0x6fc6('0x17')]);_0x37674a=_['omit'](_0x37674a,['body',_0x6fc6('0x18'),'phone',_0x6fc6('0x19'),_0x6fc6('0x1a')]);}updateUser(_0x4f7bb1,_0x37674a,_0x3cf742,_0x129ce7,_0x504763);_0x3f1ade(null);};}; \ No newline at end of file +var _0x3f1e=['Interaction','findOne','update','then','info','catch','user','query','body','omit','html','phone','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null'];(function(_0xd0c182,_0x527c8a){var _0x5a70eb=function(_0x5b210c){while(--_0x5b210c){_0xd0c182['push'](_0xd0c182['shift']());}};_0x5a70eb(++_0x527c8a);}(_0x3f1e,0x1dc));var _0xe3f1=function(_0x48fa1b,_0x369aa5){_0x48fa1b=_0x48fa1b-0x0;var _0x6b81a5=_0x3f1e[_0x48fa1b];return _0x6b81a5;};'use strict';var _=require('lodash');var db=require(_0xe3f1('0x0'))['db'];var loggers={'openchannel':require(_0xe3f1('0x1'))(_0xe3f1('0x2')),'mail':require(_0xe3f1('0x1'))('mail-interactions'),'fax':require('../../config/logger')(_0xe3f1('0x3')),'sms':require(_0xe3f1('0x1'))(_0xe3f1('0x4')),'chat':require(_0xe3f1('0x1'))(_0xe3f1('0x5')),'whatsapp':require('../../config/logger')(_0xe3f1('0x6'))};function getInteractionId(_0x5cb448,_0x17cdc4,_0x18ec94){if(_0x5cb448&&_0x5cb448[_[_0xe3f1('0x7')](_0x18ec94)+_0xe3f1('0x8')]){return _0x5cb448[_[_0xe3f1('0x7')](_0x18ec94)+_0xe3f1('0x8')];}else if(_0x5cb448&&_0x5cb448['id']){return _0x5cb448['id'];}else if(_0x17cdc4&&_0x17cdc4['id']){return _0x17cdc4['id'];}else{return _0xe3f1('0x9');}}function log(_0x441c15,_0x40464f,_0x20aa3d,_0x1a4278,_0x238330,_0x50b5ae){loggers[_0x238330[_0xe3f1('0xa')]()][_0x441c15](_0xe3f1('0xb'),_0x50b5ae[_0xe3f1('0xc')](),_0x40464f?_0x40464f['id']:null,_0x40464f?_0x40464f[_0xe3f1('0xd')]:null,_0x40464f?_0x40464f[_0xe3f1('0xe')]:null,getInteractionId(_0x20aa3d,_0x1a4278,_0x238330),_0x20aa3d?JSON[_0xe3f1('0xf')](_0x20aa3d):_0xe3f1('0x10'));}function updateUser(_0x21677f,_0x177b0e,_0x29f3ad,_0x302f4f,_0x2eb354){db[_[_0xe3f1('0x7')](_0x302f4f)+_0xe3f1('0x11')][_0xe3f1('0x12')]({'where':{'id':getInteractionId(_0x177b0e,_0x29f3ad,_0x302f4f)}})['then'](function(_0x3835c5){if(_0x3835c5){return _0x3835c5[_0xe3f1('0x13')]({'UserId':_0x21677f?_0x21677f['id']:null});}})[_0xe3f1('0x14')](function(_0x42c263){if(_0x42c263){log(_0xe3f1('0x15'),_0x21677f,_0x177b0e,_0x29f3ad,_0x302f4f,_0x2eb354);}})[_0xe3f1('0x16')](function(){log('error',_0x21677f,_0x177b0e,_0x29f3ad,_0x302f4f,_0x2eb354);});}exports['tracked']=function(_0x38dc80,_0x1ca8a4){return function(_0x32e17f,_0x277476,_0x57fc47){var _0x471887=_0x32e17f[_0xe3f1('0x17')];var _0x5234e0={};var _0x49d3fb=_0x32e17f[_0xe3f1('0x18')];if(_0x5234e0){_0x5234e0=_['clone'](_0x32e17f[_0xe3f1('0x19')]);_0x5234e0=_[_0xe3f1('0x1a')](_0x5234e0,[_0xe3f1('0x19'),_0xe3f1('0x1b'),_0xe3f1('0x1c'),'fax','mobile']);}updateUser(_0x471887,_0x5234e0,_0x49d3fb,_0x38dc80,_0x1ca8a4);_0x57fc47(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 6c643b1..6935d69 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 _0x5559=['data1','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','use','License','then','count','status','json','catch','users','User','admin','user','isUserLimit','crypto','util','../../config/environment'];(function(_0x15dc92,_0x45a995){var _0x21a6bb=function(_0x440ecd){while(--_0x440ecd){_0x15dc92['push'](_0x15dc92['shift']());}};_0x21a6bb(++_0x45a995);}(_0x5559,0xbd));var _0x9555=function(_0x5011ce,_0x56cefb){_0x5011ce=_0x5011ce-0x0;var _0x387448=_0x5559[_0x5011ce];return _0x387448;};'use strict';var crypto=require(_0x9555('0x0'));var util=require(_0x9555('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0x9555('0x2'));function getValueFromLicense(_0x20bdaa,_0x18c021){if(_0x20bdaa&&_0x18c021){if(_0x18c021[_0x9555('0x3')]&&_0x18c021['license']){var _0x4fa20c=_0x18c021['data1'];var _0x46e2b5=_0x18c021['license'];var _0x2ae9f0=_0x4fa20c['split']('-')[0x4];var _0x20c030=_0x4fa20c['split']('-')[0x0];var _0x465721=crypto['createDecipher'](_0x9555('0x4'),util[_0x9555('0x5')](_0x9555('0x6'),_0x2ae9f0,_0x4fa20c,_0x20c030));var _0x185000=_0x465721[_0x9555('0x7')](_0x46e2b5,_0x9555('0x8'),'utf8');_0x185000+=_0x465721['final'](_0x9555('0x9'));var _0x11b062=JSON[_0x9555('0xa')](_0x185000);return _0x11b062[_0x9555('0xb')](_0x20bdaa)?_0x11b062[_0x20bdaa]:null;}}return null;}function isLimit(_0x46eb22,_0x33fb09,_0x260d4c,_0x3b13fa){var _0x37ad4b=_0x33fb09;return compose()[_0x9555('0xc')](function(_0x45f122,_0x506975,_0x21fa25){return db[_0x9555('0xd')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x9555('0xe')](function(_0x220a34){var _0x5c0be7=getValueFromLicense(_0x46eb22,_0x220a34);return _0x5c0be7?_0x5c0be7:_0x37ad4b;})[_0x9555('0xe')](function(_0x35b6bd){_0x37ad4b=_0x35b6bd;return _0x260d4c[_0x9555('0xf')](_0x3b13fa);})[_0x9555('0xe')](function(_0x569f92){if(_0x569f92>=_0x37ad4b){return _0x506975[_0x9555('0x10')](0x193)[_0x9555('0x11')]({'message':util[_0x9555('0x5')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x46eb22)});}_0x21fa25();})[_0x9555('0x12')](function(_0x58c87d){_0x21fa25(_0x58c87d);});});}function isUserLimit(){return isLimit(_0x9555('0x13'),0x1,db[_0x9555('0x14')],{'where':{'$or':[{'role':_0x9555('0x15')},{'role':_0x9555('0x16')}]}});}exports[_0x9555('0x17')]=isUserLimit; \ No newline at end of file +var _0xe91e=['final','parse','use','License','findOne','then','count','status','json','users','User','admin','isUserLimit','crypto','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','%s:%s:%s','update','utf8'];(function(_0x2eed83,_0x22fdf8){var _0x4d793a=function(_0x58e23c){while(--_0x58e23c){_0x2eed83['push'](_0x2eed83['shift']());}};_0x4d793a(++_0x22fdf8);}(_0xe91e,0x145));var _0xee91=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xe91e[_0x1d1779];return _0x2377e9;};'use strict';var crypto=require(_0xee91('0x0'));var util=require('util');var compose=require(_0xee91('0x1'));var db=require(_0xee91('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1cf057,_0x5ab9ba){if(_0x1cf057&&_0x5ab9ba){if(_0x5ab9ba[_0xee91('0x3')]&&_0x5ab9ba[_0xee91('0x4')]){var _0xfa730c=_0x5ab9ba['data1'];var _0x435f1a=_0x5ab9ba[_0xee91('0x4')];var _0x31d8f8=_0xfa730c[_0xee91('0x5')]('-')[0x4];var _0x59da33=_0xfa730c[_0xee91('0x5')]('-')[0x0];var _0x4d8bac=crypto[_0xee91('0x6')](_0xee91('0x7'),util['format'](_0xee91('0x8'),_0x31d8f8,_0xfa730c,_0x59da33));var _0x10bea6=_0x4d8bac[_0xee91('0x9')](_0x435f1a,'base64',_0xee91('0xa'));_0x10bea6+=_0x4d8bac[_0xee91('0xb')](_0xee91('0xa'));var _0x28ef43=JSON[_0xee91('0xc')](_0x10bea6);return _0x28ef43['hasOwnProperty'](_0x1cf057)?_0x28ef43[_0x1cf057]:null;}}return null;}function isLimit(_0x6f51ff,_0x4976cd,_0x42fc9e,_0x9e04a0){var _0x6cb09c=_0x4976cd;return compose()[_0xee91('0xd')](function(_0x5e1f25,_0x358bdc,_0x49561c){return db[_0xee91('0xe')][_0xee91('0xf')]({'where':{'id':0x1},'raw':!![]})[_0xee91('0x10')](function(_0x4e6031){var _0x4b41b7=getValueFromLicense(_0x6f51ff,_0x4e6031);return _0x4b41b7?_0x4b41b7:_0x6cb09c;})[_0xee91('0x10')](function(_0xdb7289){_0x6cb09c=_0xdb7289;return _0x42fc9e[_0xee91('0x11')](_0x9e04a0);})['then'](function(_0x322c01){if(_0x322c01>=_0x6cb09c){return _0x358bdc[_0xee91('0x12')](0x193)[_0xee91('0x13')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x6f51ff)});}_0x49561c();})['catch'](function(_0x423c9b){_0x49561c(_0x423c9b);});});}function isUserLimit(){return isLimit(_0xee91('0x14'),0x1,db[_0xee91('0x15')],{'where':{'$or':[{'role':_0xee91('0x16')},{'role':'user'}]}});}exports[_0xee91('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 7e9d117..487d9af 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 _0x606e=['DATE','operator','$eq','value','$gt','$lte','format','castTo','\x20AS\x20','field','includes','$ne','$notIn','text','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','$between','pop','utcOffset','add','hours','minutes','seconds','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','shift','forEach','filter','map','conditions'];(function(_0x3c0993,_0x523490){var _0x5c090d=function(_0x208f6a){while(--_0x208f6a){_0x3c0993['push'](_0x3c0993['shift']());}};_0x5c090d(++_0x523490);}(_0x606e,0xbb));var _0xe606=function(_0x233716,_0x346676){_0x233716=_0x233716-0x0;var _0x302298=_0x606e[_0x233716];return _0x302298;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0xe606('0x0')]=function(_0x5834f0){var _0x4c99f4={'conditions':[]};_0x4c99f4[_0xe606('0x1')]=_[_0xe606('0x2')](_0x5834f0,_0xe606('0x3'))?'or':_0xe606('0x4');var _0x452de0=_0x5834f0[_0xe606('0x5')]('[$and]','')['replace'](_0xe606('0x3'),'')[_0xe606('0x6')]('||');for(var _0x345e0c=0x0;_0x345e0c<_0x452de0[_0xe606('0x7')];_0x345e0c++){var _0x1d40b5=_0x452de0[_0x345e0c]['split'](':=');var _0x506e5d=_0x1d40b5[0x0];var _0x4408b4=_0x1d40b5['slice'](0x1);_0x4408b4['forEach'](function(_0x23f7a2){var _0x380e5f=_0x23f7a2[_0xe606('0x6')]('[')[_0xe606('0x8')]();var _0xf3ace8=_0x23f7a2['match'](/\[(.*?)\]/g);_0xf3ace8[_0xe606('0x9')](function(_0x3498a9){var _0x14e43d=_0x3498a9[_0xe606('0x6')]('[')[_0xe606('0xa')](function(_0x4e085d){return _0x4e085d['indexOf'](']')>-0x1;})[_0xe606('0xb')](function(_0x4842be){return _0x4842be[_0xe606('0x6')](']')[0x0];})[0x0];_0x4c99f4[_0xe606('0xc')]['push']({'field':_0x506e5d,'operator':_0x380e5f,'value':_0x14e43d});});});}return _0x4c99f4;};exports['buildExpression']=function(_0x581c86,_0x304c26,_0x1e8019){var _0x5113d6={};if(_0x304c26===_0xe606('0xd')){if(_0x1e8019[_0xe606('0xe')]===_0xe606('0xf')){_0x1e8019[_0xe606('0xe')]='$between';_0x1e8019[_0xe606('0x10')]+=','+_0x1e8019[_0xe606('0x10')];}else if(_['includes']([_0xe606('0x11'),_0xe606('0x12')],_0x1e8019[_0xe606('0xe')])){_0x1e8019['value']=moment(_0x1e8019['value'])['add'](0x1,'days')[_0xe606('0x13')]('YYYY-MM-DD');}}if(_0x1e8019[_0xe606('0x14')]){_0x304c26=_0x1e8019[_0xe606('0x14')];_0x5113d6['text']='CAST('+_0x581c86+'.'+_0x1e8019['field']+_0xe606('0x15')+_0x1e8019['castTo']+')\x20'+parseOperator(_0x1e8019['operator']);}else{_0x5113d6['text']=_0x581c86+'.'+_0x1e8019[_0xe606('0x16')]+'\x20'+parseOperator(_0x1e8019[_0xe606('0xe')]);}if(_[_0xe606('0x17')]([_0xe606('0x18'),_0xe606('0x19')],_0x1e8019[_0xe606('0xe')]))_0x5113d6[_0xe606('0x1a')]='('+_0x5113d6[_0xe606('0x1a')]+_0xe606('0x1b')+_0x581c86+'.'+_0x1e8019[_0xe606('0x16')]+_0xe606('0x1c');_0x5113d6[_0xe606('0x10')]=parseValue(_0x304c26,_0x1e8019[_0xe606('0xe')],_0x1e8019[_0xe606('0x10')]);return _0x5113d6;};function parseOperator(_0x19df0a){var _0x336f25;switch(_0x19df0a){case'$in':_0x336f25=_0xe606('0x1d');break;case _0xe606('0x19'):_0x336f25=_0xe606('0x1e');break;case _0xe606('0xf'):_0x336f25=_0xe606('0x1f');break;case _0xe606('0x18'):_0x336f25='<>\x20?';break;case _0xe606('0x20'):case _0xe606('0x21'):case _0xe606('0x22'):_0x336f25='LIKE\x20?';break;case _0xe606('0x23'):_0x336f25=_0xe606('0x24');break;case _0xe606('0x11'):_0x336f25=_0xe606('0x25');break;case _0xe606('0x12'):_0x336f25='<=\x20?';break;case _0xe606('0x26'):_0x336f25=_0xe606('0x27');break;case'$between':_0x336f25=_0xe606('0x28');break;}return _0x336f25;}function parseValue(_0x45629f,_0x3bdc47,_0x3503d6){var _0xdd1809={'start':undefined,'end':undefined};switch(_0x3bdc47){case _0xe606('0x29'):case _0xe606('0x19'):_0xdd1809[_0xe606('0x2a')]=_0x3503d6[_0xe606('0x6')](',');break;case'$substring':_0xdd1809['start']='%'+_0x3503d6+'%';break;case _0xe606('0x21'):_0xdd1809[_0xe606('0x2a')]=_0x3503d6+'%';break;case _0xe606('0x22'):_0xdd1809[_0xe606('0x2a')]='%'+_0x3503d6;break;case _0xe606('0x2b'):var _0x2f0ddc=_0x3503d6[_0xe606('0x6')](',');var _0x3503d6=_0x2f0ddc[_0xe606('0x8')]();var _0x4520a4=_0x2f0ddc[_0xe606('0x2c')]();if(_0x45629f==='DATE'){_0x3503d6=moment(_0x3503d6)[_0xe606('0x2d')](0x0,!![])['format']();_0x4520a4=moment(_0x4520a4)['utcOffset'](0x0,!![])[_0xe606('0x2e')](0x17,_0xe606('0x2f'))[_0xe606('0x2e')](0x3b,_0xe606('0x30'))[_0xe606('0x2e')](0x3b,_0xe606('0x31'))[_0xe606('0x13')]();}_0xdd1809={'start':_0x3503d6,'end':_0x4520a4};break;default:_0xdd1809[_0xe606('0x2a')]=_0x3503d6;break;}return _0xdd1809;} \ No newline at end of file +var _0x3770=['split','slice','forEach','match','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','shift','pop','utcOffset','hours','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]'];(function(_0x138c4c,_0x5693fa){var _0x57af3d=function(_0x1b229d){while(--_0x1b229d){_0x138c4c['push'](_0x138c4c['shift']());}};_0x57af3d(++_0x5693fa);}(_0x3770,0x1b7));var _0x0377=function(_0x4b7510,_0x13c45e){_0x4b7510=_0x4b7510-0x0;var _0x47736a=_0x3770[_0x4b7510];return _0x47736a;};'use strict';var _=require(_0x0377('0x0'));var moment=require(_0x0377('0x1'));exports[_0x0377('0x2')]=function(_0x520c90){var _0x382072={'conditions':[]};_0x382072[_0x0377('0x3')]=_[_0x0377('0x4')](_0x520c90,_0x0377('0x5'))?'or':_0x0377('0x6');var _0x1808b2=_0x520c90[_0x0377('0x7')](_0x0377('0x8'),'')[_0x0377('0x7')](_0x0377('0x5'),'')[_0x0377('0x9')]('||');for(var _0x55e358=0x0;_0x55e358<_0x1808b2['length'];_0x55e358++){var _0x431b1a=_0x1808b2[_0x55e358][_0x0377('0x9')](':=');var _0x352ea1=_0x431b1a[0x0];var _0x35e0ca=_0x431b1a[_0x0377('0xa')](0x1);_0x35e0ca[_0x0377('0xb')](function(_0x3111a8){var _0x4e440d=_0x3111a8['split']('[')['shift']();var _0x1dccba=_0x3111a8[_0x0377('0xc')](/\[(.*?)\]/g);_0x1dccba[_0x0377('0xb')](function(_0x5a3f97){var _0x3d886a=_0x5a3f97[_0x0377('0x9')]('[')['filter'](function(_0x1d8571){return _0x1d8571['indexOf'](']')>-0x1;})[_0x0377('0xd')](function(_0x5b539c){return _0x5b539c['split'](']')[0x0];})[0x0];_0x382072[_0x0377('0xe')][_0x0377('0xf')]({'field':_0x352ea1,'operator':_0x4e440d,'value':_0x3d886a});});});}return _0x382072;};exports[_0x0377('0x10')]=function(_0x4a7271,_0x9d463d,_0x1f86f9){var _0x27a3ac={};if(_0x9d463d===_0x0377('0x11')){if(_0x1f86f9[_0x0377('0x12')]===_0x0377('0x13')){_0x1f86f9[_0x0377('0x12')]=_0x0377('0x14');_0x1f86f9[_0x0377('0x15')]+=','+_0x1f86f9['value'];}else if(_[_0x0377('0x16')]([_0x0377('0x17'),_0x0377('0x18')],_0x1f86f9['operator'])){_0x1f86f9[_0x0377('0x15')]=moment(_0x1f86f9[_0x0377('0x15')])[_0x0377('0x19')](0x1,_0x0377('0x1a'))[_0x0377('0x1b')](_0x0377('0x1c'));}}if(_0x1f86f9[_0x0377('0x1d')]){_0x9d463d=_0x1f86f9[_0x0377('0x1d')];_0x27a3ac[_0x0377('0x1e')]=_0x0377('0x1f')+_0x4a7271+'.'+_0x1f86f9[_0x0377('0x20')]+'\x20AS\x20'+_0x1f86f9['castTo']+')\x20'+parseOperator(_0x1f86f9[_0x0377('0x12')]);}else{_0x27a3ac[_0x0377('0x1e')]=_0x4a7271+'.'+_0x1f86f9['field']+'\x20'+parseOperator(_0x1f86f9[_0x0377('0x12')]);}if(_[_0x0377('0x16')](['$ne',_0x0377('0x21')],_0x1f86f9[_0x0377('0x12')]))_0x27a3ac['text']='('+_0x27a3ac['text']+_0x0377('0x22')+_0x4a7271+'.'+_0x1f86f9[_0x0377('0x20')]+_0x0377('0x23');_0x27a3ac[_0x0377('0x15')]=parseValue(_0x9d463d,_0x1f86f9[_0x0377('0x12')],_0x1f86f9[_0x0377('0x15')]);return _0x27a3ac;};function parseOperator(_0x40d9a3){var _0x25c01c;switch(_0x40d9a3){case _0x0377('0x24'):_0x25c01c='IN\x20?';break;case _0x0377('0x21'):_0x25c01c=_0x0377('0x25');break;case _0x0377('0x13'):_0x25c01c='=\x20?';break;case _0x0377('0x26'):_0x25c01c=_0x0377('0x27');break;case _0x0377('0x28'):case _0x0377('0x29'):case _0x0377('0x2a'):_0x25c01c='LIKE\x20?';break;case _0x0377('0x2b'):_0x25c01c=_0x0377('0x2c');break;case _0x0377('0x17'):_0x25c01c=_0x0377('0x2d');break;case _0x0377('0x18'):_0x25c01c=_0x0377('0x2e');break;case _0x0377('0x2f'):_0x25c01c=_0x0377('0x30');break;case _0x0377('0x14'):_0x25c01c=_0x0377('0x31');break;}return _0x25c01c;}function parseValue(_0x45ed85,_0x344566,_0x13d38a){var _0x2eaaa6={'start':undefined,'end':undefined};switch(_0x344566){case _0x0377('0x24'):case _0x0377('0x21'):_0x2eaaa6[_0x0377('0x32')]=_0x13d38a[_0x0377('0x9')](',');break;case'$substring':_0x2eaaa6[_0x0377('0x32')]='%'+_0x13d38a+'%';break;case _0x0377('0x29'):_0x2eaaa6[_0x0377('0x32')]=_0x13d38a+'%';break;case _0x0377('0x2a'):_0x2eaaa6[_0x0377('0x32')]='%'+_0x13d38a;break;case'$between':var _0x2db002=_0x13d38a[_0x0377('0x9')](',');var _0x13d38a=_0x2db002[_0x0377('0x33')]();var _0x3975f9=_0x2db002[_0x0377('0x34')]();if(_0x45ed85===_0x0377('0x11')){_0x13d38a=moment(_0x13d38a)[_0x0377('0x35')](0x0,!![])[_0x0377('0x1b')]();_0x3975f9=moment(_0x3975f9)[_0x0377('0x35')](0x0,!![])['add'](0x17,_0x0377('0x36'))[_0x0377('0x19')](0x3b,'minutes')[_0x0377('0x19')](0x3b,_0x0377('0x37'))[_0x0377('0x1b')]();}_0x2eaaa6={'start':_0x13d38a,'end':_0x3975f9};break;default:_0x2eaaa6[_0x0377('0x32')]=_0x13d38a;break;}return _0x2eaaa6;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 51be18b..36854e6 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 _0x0309=['ASC','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','push','join','getOptions','query','$id','model','intersection','attributes','fields','nolimit','order','filters','pick','filter','object','columns','name','value','where','VIRTUAL','lower','col','merge','options','lodash','moment','parse','keys','includes','split','forOwn','find','type','DATE','$gte','YYYY-MM-DD','utc','format','$lte','subtract','uniqueid','isArray','limit','offset','sort','map','priority','cast','unsigned','substr','DESC'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0309,0x165));var _0x9030=function(_0x349af2,_0x3c767a){_0x349af2=_0x349af2-0x0;var _0x4ec9b4=_0x0309[_0x349af2];return _0x4ec9b4;};'use strict';var _=require(_0x9030('0x0'));var sequelize=require('sequelize');var moment=require(_0x9030('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4875db){var _0x5b1a40=['ne'];try{var _0x352a94=JSON[_0x9030('0x2')](_0x4875db);var _0x4236be=Object[_0x9030('0x3')](_0x352a94)[0x0];return _0x5b1a40[_0x9030('0x4')](_0x4236be);}catch(_0xcbbe57){return![];}}function getOperatorValue(_0x482786){var _0x5a3334=JSON[_0x9030('0x2')](_0x482786);var _0x105c15=Object['keys'](_0x5a3334)[0x0];var _0xb53eb4=_0x5a3334[_0x105c15];return{['$'+_0x105c15]:_0xb53eb4};}exports['fields']=function(_0x1e2360){var _0x32d47d=null;if(_0x1e2360){_0x32d47d=_0x1e2360[_0x9030('0x5')](',');}return _0x32d47d;};exports['filters']=function(_0xe2c28b,_0x1da9ec){var _0x337b86={};if(!_['isEmpty'](_0xe2c28b)){_[_0x9030('0x6')](_0xe2c28b,function(_0x21bc06,_0x24d0f4){try{if(_0x1da9ec){var _0x11a539=_[_0x9030('0x7')](_0x1da9ec,{'name':_0x24d0f4})||{};if(hasSequelizeOperator(_0x21bc06)){_0x337b86[_0x24d0f4]=getOperatorValue(_0x21bc06);}else if(_0x11a539[_0x9030('0x8')]===_0x9030('0x9')&&_['isPlainObject'](_0x21bc06)){var _0x45e28a=JSON[_0x9030('0x2')](_0x21bc06);var _0x1e5bc9={'$gte':moment(moment(_0x45e28a[_0x9030('0xa')])['format'](_0x9030('0xb')))[_0x9030('0xc')]()[_0x9030('0xd')](),'$lte':moment(moment(_0x45e28a[_0x9030('0xe')])[_0x9030('0xd')](_0x9030('0xb')))[_0x9030('0xc')]()[_0x9030('0xf')](0x1,'s')[_0x9030('0xd')]()};_0x337b86[_0x24d0f4]=_0x1e5bc9;}else if(_0x11a539['name']===_0x9030('0x10')){_0x337b86[_0x24d0f4]=_0x21bc06;}else{_0x337b86[_0x24d0f4]=_[_0x9030('0x11')](_0x21bc06)?_0x21bc06:JSON[_0x9030('0x2')](_0x21bc06);}}else{_0x337b86[_0x24d0f4]=_[_0x9030('0x11')](_0x21bc06)?_0x21bc06:JSON[_0x9030('0x2')](_0x21bc06);}}catch(_0x1327ec){_0x337b86[_0x24d0f4]=_0x21bc06[_0x9030('0x5')](',');}});}return _0x337b86;};exports[_0x9030('0x12')]=function(_0x1f5474){_0x1f5474=parseInt(_0x1f5474,0xa);if(!_0x1f5474||_0x1f5474<0x0){_0x1f5474=LIMIT_VALUE;}return _0x1f5474;};exports[_0x9030('0x13')]=function(_0x164c88){_0x164c88=parseInt(_0x164c88,0xa);if(!_0x164c88||_0x164c88<0x0){_0x164c88=0x0;}return _0x164c88;};exports[_0x9030('0x14')]=function(_0x372716){var _0x243e7d,_0x1e5988=null;if(_0x372716){_0x243e7d=_0x372716[_0x9030('0x5')](',');_0x1e5988=_[_0x9030('0x15')](_0x243e7d,function(_0x4b0792){if(_0x4b0792['indexOf']('-')===0x0){return[_0x4b0792===_0x9030('0x16')?sequelize[_0x9030('0x17')](sequelize['col'](_0x9030('0x16')),_0x9030('0x18')):_0x4b0792[_0x9030('0x19')](0x1),_0x9030('0x1a')];}else{return[_0x4b0792==='priority'?sequelize[_0x9030('0x17')](sequelize['col']('priority'),_0x9030('0x18')):_0x4b0792,_0x9030('0x1b')];}});}return _0x1e5988;};exports[_0x9030('0x1c')]=function(_0x539bb7,_0x36a98a){if(_[_0x9030('0x1d')](_0x539bb7)){return _0x539bb7;}if(_[_0x9030('0x11')](_0x539bb7)){for(var _0xce2840=0x0;_0xce2840<_0x539bb7[_0x9030('0x1e')];_0xce2840+=0x1){_0x539bb7[_0xce2840]=this['omit'](_0x539bb7[_0xce2840],_0x36a98a);}return _0x539bb7;}if(!_[_0x9030('0x1f')](_0x539bb7)){return _0x539bb7;}if(_[_0x9030('0x20')](_0x36a98a)){_0x36a98a=[_0x36a98a];}if(!_[_0x9030('0x11')](_0x36a98a)){return _0x539bb7;}for(var _0x463dda=0x0;_0x463dda<_0x36a98a[_0x9030('0x1e')];_0x463dda+=0x1){_[_0x9030('0x21')](_0x539bb7,_0x36a98a[_0x463dda]);}for(var _0x155b8c in _0x539bb7){if(_0x539bb7[_0x9030('0x22')](_0x155b8c)){_0x539bb7[_0x155b8c]=this[_0x9030('0x1c')](_0x539bb7[_0x155b8c],_0x36a98a);}}return _0x539bb7;};exports[_0x9030('0x23')]=function(_0x3be936){return _0x3be936[_0x9030('0x24')](RegExp(_0x9030('0x25')))?!![]:![];};exports[_0x9030('0x26')]=function(_0x584013){return _0x584013[_0x9030('0x24')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x43a31b){var _0x5b745a=[];_0x43a31b[_0x9030('0x5')](/[ ,]+/)[_0x9030('0x27')](function(_0x1bbad0){_0x1bbad0=_0x1bbad0['replace'](/([^:]")"+/g,'$1');_0x1bbad0='+'+_0x1bbad0+'*';var _0x432a50=/[ `!@#$%^&*()_\-?~]/;if(_0x1bbad0[_0x9030('0x24')](_0x432a50))_0x1bbad0='\x22'+_0x1bbad0+'\x22';_0x5b745a[_0x9030('0x28')](_0x1bbad0);});return _0x5b745a[_0x9030('0x29')]('\x20');};exports[_0x9030('0x2a')]=function(_0x14619b,_0x754e00,_0x12b9b8){var _0x134260={},_0x3400db={};if(_0x754e00[_0x9030('0x2b')][_0x9030('0x2c')]){_0x754e00[_0x9030('0x2b')]['id']=_0x754e00[_0x9030('0x2b')][_0x9030('0x2c')];delete _0x754e00[_0x9030('0x2b')][_0x9030('0x2c')];}_0x134260[_0x9030('0x2d')]=_['map'](_0x14619b,'name');_0x134260[_0x9030('0x2b')]=_[_0x9030('0x3')](_0x754e00['query']);_0x134260['filters']=_[_0x9030('0x2e')](_0x134260[_0x9030('0x2d')],_0x134260[_0x9030('0x2b')]);_0x3400db[_0x9030('0x2f')]=_['intersection'](_0x134260[_0x9030('0x2d')],this['fields'](_0x754e00[_0x9030('0x2b')][_0x9030('0x30')]));_0x3400db['attributes']=_0x3400db[_0x9030('0x2f')][_0x9030('0x1e')]?_0x3400db[_0x9030('0x2f')]:_0x134260['model'];if(!_0x754e00[_0x9030('0x2b')]['hasOwnProperty'](_0x9030('0x31'))){_0x3400db['limit']=this[_0x9030('0x12')](_0x754e00['query'][_0x9030('0x12')]);_0x3400db[_0x9030('0x13')]=this[_0x9030('0x13')](_0x754e00[_0x9030('0x2b')][_0x9030('0x13')]);}_0x3400db[_0x9030('0x32')]=this[_0x9030('0x14')](_0x754e00[_0x9030('0x2b')][_0x9030('0x14')]);_0x3400db['where']=this[_0x9030('0x33')](_[_0x9030('0x34')](_0x754e00[_0x9030('0x2b')],_0x134260['filters']),_0x14619b);if(_0x754e00[_0x9030('0x2b')][_0x9030('0x35')]){var _0x3ebb74=_0x14619b;var _0x1a9ee5=_0x754e00['query'][_0x9030('0x35')];if(typeof _0x1a9ee5===_0x9030('0x36')){_0x3ebb74=_[_0x9030('0x35')](_0x14619b,function(_0x4ba687){return _[_0x9030('0x4')](_0x1a9ee5[_0x9030('0x37')],_0x4ba687[_0x9030('0x38')]);});_0x1a9ee5=_0x1a9ee5[_0x9030('0x39')];}_0x3400db[_0x9030('0x3a')]=_['merge'](_0x3400db[_0x9030('0x3a')],{'$or':_['map'](_0x3ebb74,function(_0x2b596c){if(_0x2b596c[_0x9030('0x8')]!==_0x9030('0x3b')){if(_0x12b9b8){return sequelize[_0x9030('0x3a')](sequelize['fn'](_0x9030('0x3c'),sequelize[_0x9030('0x3d')](_0x2b596c[_0x9030('0x38')])),{'$like':sequelize['fn'](_0x9030('0x3c'),'%'+_0x754e00['query'][_0x9030('0x35')]+'%')});}else{var _0x19d2d3={};_0x19d2d3[_0x2b596c[_0x9030('0x38')]]={'$like':'%'+_0x754e00[_0x9030('0x2b')][_0x9030('0x35')]+'%'};return _0x19d2d3;}}})});}_0x3400db=_[_0x9030('0x3e')]({},_0x3400db,_0x754e00[_0x9030('0x3f')]);return _0x3400db;}; \ No newline at end of file +var _0x44e8=['sort','map','indexOf','col','priority','unsigned','substr','cast','ASC','omit','length','isObject','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','fields','nolimit','filter','object','columns','value','where','lower','merge','options','lodash','parse','keys','includes','split','filters','isEmpty','forOwn','find','type','isPlainObject','$gte','YYYY-MM-DD','utc','format','subtract','name','uniqueid','isArray','limit','offset'];(function(_0x2847ec,_0x40ce19){var _0x507988=function(_0x3545a1){while(--_0x3545a1){_0x2847ec['push'](_0x2847ec['shift']());}};_0x507988(++_0x40ce19);}(_0x44e8,0xd7));var _0x844e=function(_0x5e9df5,_0x19e869){_0x5e9df5=_0x5e9df5-0x0;var _0x17cbc1=_0x44e8[_0x5e9df5];return _0x17cbc1;};'use strict';var _=require(_0x844e('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1b5be7){var _0x21307e=['ne'];try{var _0x2afcef=JSON[_0x844e('0x1')](_0x1b5be7);var _0x49ce1b=Object[_0x844e('0x2')](_0x2afcef)[0x0];return _0x21307e[_0x844e('0x3')](_0x49ce1b);}catch(_0x2c8b9e){return![];}}function getOperatorValue(_0x446f47){var _0x5c8f67=JSON[_0x844e('0x1')](_0x446f47);var _0x238796=Object[_0x844e('0x2')](_0x5c8f67)[0x0];var _0x11cbd6=_0x5c8f67[_0x238796];return{['$'+_0x238796]:_0x11cbd6};}exports['fields']=function(_0x31ab50){var _0x7dff16=null;if(_0x31ab50){_0x7dff16=_0x31ab50[_0x844e('0x4')](',');}return _0x7dff16;};exports[_0x844e('0x5')]=function(_0x32c6c7,_0x1f9921){var _0x536601={};if(!_[_0x844e('0x6')](_0x32c6c7)){_[_0x844e('0x7')](_0x32c6c7,function(_0x183c7e,_0x285a64){try{if(_0x1f9921){var _0x14909f=_[_0x844e('0x8')](_0x1f9921,{'name':_0x285a64})||{};if(hasSequelizeOperator(_0x183c7e)){_0x536601[_0x285a64]=getOperatorValue(_0x183c7e);}else if(_0x14909f[_0x844e('0x9')]==='DATE'&&_[_0x844e('0xa')](_0x183c7e)){var _0x23df3f=JSON['parse'](_0x183c7e);var _0x3a09d0={'$gte':moment(moment(_0x23df3f[_0x844e('0xb')])['format'](_0x844e('0xc')))[_0x844e('0xd')]()[_0x844e('0xe')](),'$lte':moment(moment(_0x23df3f['$lte'])[_0x844e('0xe')](_0x844e('0xc')))[_0x844e('0xd')]()[_0x844e('0xf')](0x1,'s')[_0x844e('0xe')]()};_0x536601[_0x285a64]=_0x3a09d0;}else if(_0x14909f[_0x844e('0x10')]===_0x844e('0x11')){_0x536601[_0x285a64]=_0x183c7e;}else{_0x536601[_0x285a64]=_[_0x844e('0x12')](_0x183c7e)?_0x183c7e:JSON['parse'](_0x183c7e);}}else{_0x536601[_0x285a64]=_[_0x844e('0x12')](_0x183c7e)?_0x183c7e:JSON['parse'](_0x183c7e);}}catch(_0x3c307f){_0x536601[_0x285a64]=_0x183c7e['split'](',');}});}return _0x536601;};exports[_0x844e('0x13')]=function(_0x55bcd6){_0x55bcd6=parseInt(_0x55bcd6,0xa);if(!_0x55bcd6||_0x55bcd6<0x0){_0x55bcd6=LIMIT_VALUE;}return _0x55bcd6;};exports[_0x844e('0x14')]=function(_0x10739f){_0x10739f=parseInt(_0x10739f,0xa);if(!_0x10739f||_0x10739f<0x0){_0x10739f=0x0;}return _0x10739f;};exports[_0x844e('0x15')]=function(_0x410325){var _0x3ea7da,_0x2b58c7=null;if(_0x410325){_0x3ea7da=_0x410325[_0x844e('0x4')](',');_0x2b58c7=_[_0x844e('0x16')](_0x3ea7da,function(_0x4ffb86){if(_0x4ffb86[_0x844e('0x17')]('-')===0x0){return[_0x4ffb86==='priority'?sequelize['cast'](sequelize[_0x844e('0x18')](_0x844e('0x19')),_0x844e('0x1a')):_0x4ffb86[_0x844e('0x1b')](0x1),'DESC'];}else{return[_0x4ffb86===_0x844e('0x19')?sequelize[_0x844e('0x1c')](sequelize['col'](_0x844e('0x19')),_0x844e('0x1a')):_0x4ffb86,_0x844e('0x1d')];}});}return _0x2b58c7;};exports[_0x844e('0x1e')]=function(_0x35236b,_0x3a65fc){if(_['isEmpty'](_0x35236b)){return _0x35236b;}if(_[_0x844e('0x12')](_0x35236b)){for(var _0xadf0d8=0x0;_0xadf0d8<_0x35236b[_0x844e('0x1f')];_0xadf0d8+=0x1){_0x35236b[_0xadf0d8]=this[_0x844e('0x1e')](_0x35236b[_0xadf0d8],_0x3a65fc);}return _0x35236b;}if(!_[_0x844e('0x20')](_0x35236b)){return _0x35236b;}if(_['isString'](_0x3a65fc)){_0x3a65fc=[_0x3a65fc];}if(!_[_0x844e('0x12')](_0x3a65fc)){return _0x35236b;}for(var _0x5080c1=0x0;_0x5080c1<_0x3a65fc['length'];_0x5080c1+=0x1){_[_0x844e('0x21')](_0x35236b,_0x3a65fc[_0x5080c1]);}for(var _0x130d87 in _0x35236b){if(_0x35236b[_0x844e('0x22')](_0x130d87)){_0x35236b[_0x130d87]=this['omit'](_0x35236b[_0x130d87],_0x3a65fc);}}return _0x35236b;};exports[_0x844e('0x23')]=function(_0x2d4acd){return _0x2d4acd[_0x844e('0x24')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x844e('0x25')]=function(_0x81d4de){return _0x81d4de[_0x844e('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0x844e('0x26')]=function(_0x454b68){var _0x799cde=[];_0x454b68[_0x844e('0x4')](/[ ,]+/)[_0x844e('0x27')](function(_0x618bf6){_0x618bf6=_0x618bf6[_0x844e('0x28')](/([^:]")"+/g,'$1');_0x618bf6='+'+_0x618bf6+'*';var _0x550240=/[ `!@#$%^&*()_\-?~]/;if(_0x618bf6[_0x844e('0x24')](_0x550240))_0x618bf6='\x22'+_0x618bf6+'\x22';_0x799cde[_0x844e('0x29')](_0x618bf6);});return _0x799cde[_0x844e('0x2a')]('\x20');};exports[_0x844e('0x2b')]=function(_0x43ae36,_0x31754e,_0x27e5b3){var _0x55c488={},_0x26d6f2={};if(_0x31754e[_0x844e('0x2c')][_0x844e('0x2d')]){_0x31754e['query']['id']=_0x31754e[_0x844e('0x2c')][_0x844e('0x2d')];delete _0x31754e['query'][_0x844e('0x2d')];}_0x55c488[_0x844e('0x2e')]=_['map'](_0x43ae36,_0x844e('0x10'));_0x55c488[_0x844e('0x2c')]=_[_0x844e('0x2')](_0x31754e[_0x844e('0x2c')]);_0x55c488[_0x844e('0x5')]=_[_0x844e('0x2f')](_0x55c488[_0x844e('0x2e')],_0x55c488['query']);_0x26d6f2[_0x844e('0x30')]=_[_0x844e('0x2f')](_0x55c488[_0x844e('0x2e')],this[_0x844e('0x31')](_0x31754e[_0x844e('0x2c')][_0x844e('0x31')]));_0x26d6f2[_0x844e('0x30')]=_0x26d6f2[_0x844e('0x30')][_0x844e('0x1f')]?_0x26d6f2[_0x844e('0x30')]:_0x55c488[_0x844e('0x2e')];if(!_0x31754e['query']['hasOwnProperty'](_0x844e('0x32'))){_0x26d6f2[_0x844e('0x13')]=this[_0x844e('0x13')](_0x31754e[_0x844e('0x2c')][_0x844e('0x13')]);_0x26d6f2[_0x844e('0x14')]=this[_0x844e('0x14')](_0x31754e[_0x844e('0x2c')][_0x844e('0x14')]);}_0x26d6f2['order']=this[_0x844e('0x15')](_0x31754e['query'][_0x844e('0x15')]);_0x26d6f2['where']=this[_0x844e('0x5')](_['pick'](_0x31754e[_0x844e('0x2c')],_0x55c488[_0x844e('0x5')]),_0x43ae36);if(_0x31754e[_0x844e('0x2c')][_0x844e('0x33')]){var _0x2eb412=_0x43ae36;var _0x3b4c9e=_0x31754e[_0x844e('0x2c')][_0x844e('0x33')];if(typeof _0x3b4c9e===_0x844e('0x34')){_0x2eb412=_[_0x844e('0x33')](_0x43ae36,function(_0x3bdf19){return _['includes'](_0x3b4c9e[_0x844e('0x35')],_0x3bdf19[_0x844e('0x10')]);});_0x3b4c9e=_0x3b4c9e[_0x844e('0x36')];}_0x26d6f2['where']=_['merge'](_0x26d6f2[_0x844e('0x37')],{'$or':_[_0x844e('0x16')](_0x2eb412,function(_0x1a7817){if(_0x1a7817['type']!=='VIRTUAL'){if(_0x27e5b3){return sequelize['where'](sequelize['fn']('lower',sequelize[_0x844e('0x18')](_0x1a7817[_0x844e('0x10')])),{'$like':sequelize['fn'](_0x844e('0x38'),'%'+_0x31754e[_0x844e('0x2c')][_0x844e('0x33')]+'%')});}else{var _0x4c756b={};_0x4c756b[_0x1a7817[_0x844e('0x10')]]={'$like':'%'+_0x31754e['query']['filter']+'%'};return _0x4c756b;}}})});}_0x26d6f2=_[_0x844e('0x39')]({},_0x26d6f2,_0x31754e[_0x844e('0x3a')]);return _0x26d6f2;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 1fe010e..27154ae 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1107=['production','set','appPath','join','root','test','client','json\x20replacer','toISOString','split','use','static','views','/server/views','engine','html','ejs','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','path','passport','cors','moment','./environment','../mysqldb','default','get','env'];(function(_0x406301,_0x17fd47){var _0x499091=function(_0x1b8e44){while(--_0x1b8e44){_0x406301['push'](_0x406301['shift']());}};_0x499091(++_0x17fd47);}(_0x1107,0x1a2));var _0x7110=function(_0x263204,_0x19286b){_0x263204=_0x263204-0x0;var _0xed3987=_0x1107[_0x263204];return _0xed3987;};'use strict';var express=require(_0x7110('0x0'));var favicon=require(_0x7110('0x1'));var bodyParser=require(_0x7110('0x2'));var methodOverride=require(_0x7110('0x3'));var cookieParser=require(_0x7110('0x4'));var errorHandler=require('errorhandler');var path=require(_0x7110('0x5'));var passport=require(_0x7110('0x6'));var cors=require(_0x7110('0x7'));var moment=require(_0x7110('0x8'));var config=require(_0x7110('0x9'));var db=require(_0x7110('0xa'))['db'];exports[_0x7110('0xb')]=function(_0x480be5){var _0x5d7153=_0x480be5[_0x7110('0xc')](_0x7110('0xd'));if(_0x5d7153===_0x7110('0xe')){_0x480be5[_0x7110('0xf')](_0x7110('0x10'),path[_0x7110('0x11')](config[_0x7110('0x12')],'public'));}if(_0x5d7153==='development'||_0x5d7153===_0x7110('0x13')){_0x480be5[_0x7110('0xf')](_0x7110('0x10'),path[_0x7110('0x11')](config[_0x7110('0x12')],_0x7110('0x14')));_0x480be5['use'](errorHandler());}_0x480be5['set'](_0x7110('0x15'),function(_0x2196f9,_0x4ad352){if(this[_0x2196f9]instanceof Date){_0x4ad352=this[_0x2196f9][_0x7110('0x16')]()[_0x7110('0x17')]('.')[0x0]+'Z';}return _0x4ad352;});_0x480be5[_0x7110('0x18')](express[_0x7110('0x19')](_0x480be5['get'](_0x7110('0x10'))));_0x480be5['set'](_0x7110('0x1a'),config[_0x7110('0x12')]+_0x7110('0x1b'));_0x480be5[_0x7110('0x1c')](_0x7110('0x1d'),require(_0x7110('0x1e'))['renderFile']);_0x480be5[_0x7110('0xf')](_0x7110('0x1f'),'html');_0x480be5['use'](bodyParser[_0x7110('0x20')]({'limit':_0x7110('0x21'),'extended':!![]}));_0x480be5[_0x7110('0x18')](bodyParser[_0x7110('0x22')]({'limit':'50mb'}));_0x480be5[_0x7110('0x18')](cors());_0x480be5['use'](methodOverride());_0x480be5[_0x7110('0x18')](cookieParser());_0x480be5[_0x7110('0x18')](passport[_0x7110('0x23')]());}; \ No newline at end of file +var _0x68df=['method-override','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','env','production','set','appPath','join','public','test','root','client','use','json\x20replacer','toISOString','split','static','get','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','initialize','serve-favicon','body-parser'];(function(_0x5cf94d,_0x3e9b52){var _0x3242a6=function(_0x22e8b8){while(--_0x22e8b8){_0x5cf94d['push'](_0x5cf94d['shift']());}};_0x3242a6(++_0x3e9b52);}(_0x68df,0x1d2));var _0xf68d=function(_0x52684f,_0xff73fc){_0x52684f=_0x52684f-0x0;var _0x4a55f0=_0x68df[_0x52684f];return _0x4a55f0;};'use strict';var express=require('express');var favicon=require(_0xf68d('0x0'));var bodyParser=require(_0xf68d('0x1'));var methodOverride=require(_0xf68d('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xf68d('0x3'));var path=require(_0xf68d('0x4'));var passport=require(_0xf68d('0x5'));var cors=require(_0xf68d('0x6'));var moment=require(_0xf68d('0x7'));var config=require(_0xf68d('0x8'));var db=require(_0xf68d('0x9'))['db'];exports[_0xf68d('0xa')]=function(_0x22d1ac){var _0x160198=_0x22d1ac['get'](_0xf68d('0xb'));if(_0x160198===_0xf68d('0xc')){_0x22d1ac[_0xf68d('0xd')](_0xf68d('0xe'),path[_0xf68d('0xf')](config['root'],_0xf68d('0x10')));}if(_0x160198==='development'||_0x160198===_0xf68d('0x11')){_0x22d1ac['set'](_0xf68d('0xe'),path[_0xf68d('0xf')](config[_0xf68d('0x12')],_0xf68d('0x13')));_0x22d1ac[_0xf68d('0x14')](errorHandler());}_0x22d1ac['set'](_0xf68d('0x15'),function(_0x14ac9c,_0x3dddc7){if(this[_0x14ac9c]instanceof Date){_0x3dddc7=this[_0x14ac9c][_0xf68d('0x16')]()[_0xf68d('0x17')]('.')[0x0]+'Z';}return _0x3dddc7;});_0x22d1ac[_0xf68d('0x14')](express[_0xf68d('0x18')](_0x22d1ac[_0xf68d('0x19')](_0xf68d('0xe'))));_0x22d1ac[_0xf68d('0xd')](_0xf68d('0x1a'),config[_0xf68d('0x12')]+_0xf68d('0x1b'));_0x22d1ac[_0xf68d('0x1c')](_0xf68d('0x1d'),require(_0xf68d('0x1e'))[_0xf68d('0x1f')]);_0x22d1ac[_0xf68d('0xd')](_0xf68d('0x20'),'html');_0x22d1ac['use'](bodyParser[_0xf68d('0x21')]({'limit':'50mb','extended':!![]}));_0x22d1ac[_0xf68d('0x14')](bodyParser['json']({'limit':_0xf68d('0x22')}));_0x22d1ac['use'](cors());_0x22d1ac['use'](methodOverride());_0x22d1ac[_0xf68d('0x14')](cookieParser());_0x22d1ac[_0xf68d('0x14')](passport[_0xf68d('0x23')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 45bf2db..c3a42be 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 _0xd817=['concat','head','mac','address','127.0.0.1','getFirstInterface','map','model','join','createHash','md5','update','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','digest','substring','crypto','child_process','execSync','../environment','networkInterfaces','orderBy','keys','filter','family','IPv4'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xd817,0xe4));var _0x7d81=function(_0x3fc287,_0x5c3f36){_0x3fc287=_0x3fc287-0x0;var _0x33af9f=_0xd817[_0x3fc287];return _0x33af9f;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x7d81('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0x7d81('0x1'))[_0x7d81('0x2')];var config=require(_0x7d81('0x3'));function getInterfaces(){var _0x47b0cb=[];var _0x2e36ec=os[_0x7d81('0x4')]();var _0x1c862f=_[_0x7d81('0x5')](_[_0x7d81('0x6')](_0x2e36ec));for(var _0x271ecb=0x0;_0x271ecb<_0x1c862f['length'];_0x271ecb++){var _0x250f5e=_0x2e36ec[_0x1c862f[_0x271ecb]][_0x7d81('0x7')](function(_0x5c95c4){return _0x5c95c4[_0x7d81('0x8')]===_0x7d81('0x9')&&_0x5c95c4['internal']===![];});_0x47b0cb=_0x47b0cb[_0x7d81('0xa')](_0x250f5e);}return _0x47b0cb;}function getFirstInterface(){var _0x438ef9=_[_0x7d81('0xb')](getInterfaces());return{'macAddress':_0x438ef9&&_0x438ef9[_0x7d81('0xc')]?_0x438ef9[_0x7d81('0xc')]:'00:00:00:00:00:00','ipAddress':_0x438ef9&&_0x438ef9['address']?_0x438ef9[_0x7d81('0xd')]:_0x7d81('0xe')};}exports[_0x7d81('0xf')]=getFirstInterface;function getCPUhash(){var _0x41dcd5=_['orderBy'](os['cpus']()[_0x7d81('0x10')](function(_0x1b217e){return _0x1b217e[_0x7d81('0x11')];}))[_0x7d81('0x12')](':');return crypto[_0x7d81('0x13')](_0x7d81('0x14'))[_0x7d81('0x15')](_0x41dcd5)['digest'](_0x7d81('0x16'));}exports[_0x7d81('0x17')]=function(){var _0x30619f=os[_0x7d81('0x18')]();var _0x53ffb4=/[0-9a-f-]{36}/;if(config[_0x7d81('0x19')]&&_0x53ffb4['test'](config[_0x7d81('0x19')])){return config[_0x7d81('0x19')];}else if(_0x30619f===_0x7d81('0x1a')){return exec(_0x7d81('0x1b'),{'encoding':_0x7d81('0x1c')})[_0x7d81('0x1d')]('\x0d\x0a','');}else{var _0x3f1889=getFirstInterface();var _0x4a1376=getCPUhash();var _0x4c8cd0=_0x4a1376+'|'+os[_0x7d81('0x1e')]()+'|'+_0x3f1889['macAddress']+'|'+_0x3f1889[_0x7d81('0x1f')];var _0x4f9c37=crypto[_0x7d81('0x13')](_0x7d81('0x14'))['update'](_0x4c8cd0)[_0x7d81('0x20')](_0x7d81('0x16'));return _0x4f9c37[_0x7d81('0x21')](0x0,0x8)+'-'+_0x4f9c37['substring'](0x8,0xc)+'-'+_0x4f9c37['substring'](0xc,0x10)+'-'+_0x4f9c37[_0x7d81('0x21')](0x10,0x14)+'-'+_0x4f9c37[_0x7d81('0x21')](0x14);}}; \ No newline at end of file +var _0x93ad=['127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','digest','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','update','hex','substring','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address'];(function(_0x53d354,_0x241dcd){var _0x328ad7=function(_0xc0c339){while(--_0xc0c339){_0x53d354['push'](_0x53d354['shift']());}};_0x328ad7(++_0x241dcd);}(_0x93ad,0x191));var _0xd93a=function(_0x10eb38,_0x2086bd){_0x10eb38=_0x10eb38-0x0;var _0x5af9b5=_0x93ad[_0x10eb38];return _0x5af9b5;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xd93a('0x0'));var machine=require(_0xd93a('0x1'));var exec=require(_0xd93a('0x2'))[_0xd93a('0x3')];var config=require(_0xd93a('0x4'));function getInterfaces(){var _0x473b9d=[];var _0x3918b4=os[_0xd93a('0x5')]();var _0x172fa2=_[_0xd93a('0x6')](_[_0xd93a('0x7')](_0x3918b4));for(var _0x437200=0x0;_0x437200<_0x172fa2[_0xd93a('0x8')];_0x437200++){var _0x1a5663=_0x3918b4[_0x172fa2[_0x437200]][_0xd93a('0x9')](function(_0xf4a1f7){return _0xf4a1f7[_0xd93a('0xa')]===_0xd93a('0xb')&&_0xf4a1f7[_0xd93a('0xc')]===![];});_0x473b9d=_0x473b9d[_0xd93a('0xd')](_0x1a5663);}return _0x473b9d;}function getFirstInterface(){var _0x434c42=_['head'](getInterfaces());return{'macAddress':_0x434c42&&_0x434c42[_0xd93a('0xe')]?_0x434c42['mac']:_0xd93a('0xf'),'ipAddress':_0x434c42&&_0x434c42[_0xd93a('0x10')]?_0x434c42['address']:_0xd93a('0x11')};}exports[_0xd93a('0x12')]=getFirstInterface;function getCPUhash(){var _0x527033=_[_0xd93a('0x6')](os[_0xd93a('0x13')]()[_0xd93a('0x14')](function(_0x1643fa){return _0x1643fa['model'];}))[_0xd93a('0x15')](':');return crypto[_0xd93a('0x16')](_0xd93a('0x17'))['update'](_0x527033)[_0xd93a('0x18')]('hex');}exports[_0xd93a('0x19')]=function(){var _0x551184=os[_0xd93a('0x1a')]();var _0x42e7f2=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x42e7f2[_0xd93a('0x1b')](config['licenseToken'])){return config[_0xd93a('0x1c')];}else if(_0x551184===_0xd93a('0x1d')){return exec(_0xd93a('0x1e'),{'encoding':_0xd93a('0x1f')})['replace']('\x0d\x0a','');}else{var _0x26184d=getFirstInterface();var _0xbd980a=getCPUhash();var _0x3c8e2b=_0xbd980a+'|'+os[_0xd93a('0x20')]()+'|'+_0x26184d[_0xd93a('0x21')]+'|'+_0x26184d[_0xd93a('0x22')];var _0x3fe98e=crypto[_0xd93a('0x16')](_0xd93a('0x17'))[_0xd93a('0x23')](_0x3c8e2b)[_0xd93a('0x18')](_0xd93a('0x24'));return _0x3fe98e[_0xd93a('0x25')](0x0,0x8)+'-'+_0x3fe98e[_0xd93a('0x25')](0x8,0xc)+'-'+_0x3fe98e['substring'](0xc,0x10)+'-'+_0x3fe98e[_0xd93a('0x25')](0x10,0x14)+'-'+_0x3fe98e[_0xd93a('0x25')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 5c21678..86ad9d5 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 _0x16d6=['%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format'];(function(_0x4a9238,_0x4bb654){var _0x4f318c=function(_0xf9b3d6){while(--_0xf9b3d6){_0x4a9238['push'](_0x4a9238['shift']());}};_0x4f318c(++_0x4bb654);}(_0x16d6,0x12d));var _0x616d=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0x16d6[_0x3fc97b];return _0x3a0c82;};'use strict';var util=require(_0x616d('0x0'));var moment=require(_0x616d('0x1'));var rp=require(_0x616d('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x616d('0x3'))(module,_0x616d('0x4'));var db=require(_0x616d('0x5'))['db'];var encryptor=require(_0x616d('0x6'));var hardware=require(_0x616d('0x7'));var logger=require(_0x616d('0x8'))('license');var HOST=_0x616d('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2d1318){return new BPromise(function(_0x487643,_0x3af6f3){var _0x486b31=util[_0x616d('0xa')](_0x616d('0xb'),HOST,_0x2d1318,module['exports'][_0x616d('0x4')]);if(oldToken){_0x486b31=util['format'](_0x616d('0xc'),HOST,_0x2d1318,module[_0x616d('0xd')][_0x616d('0x4')],oldToken);}var _0x4adccc={'uri':_0x486b31,'method':_0x616d('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x4adccc)[_0x616d('0xf')](function(_0x5b55a9){_0x487643(_0x5b55a9);})[_0x616d('0x10')](function(_0x54cdbe){_0x3af6f3(_0x54cdbe);});});}function manageLicense(_0x1bb850,_0x13f780){var _0x4dff18=_0x13f780['get']({'plain':!![]});if(!isOldTokenSent&&_0x4dff18[_0x616d('0x11')]!==_0x1bb850&&!_0x4dff18[_0x616d('0x12')]){oldToken=_0x4dff18['data1'];}httpRequest(_0x1bb850)[_0x616d('0xf')](function(_0x51cb61){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x51cb61[_0x616d('0x13')]){isOldTokenSent=![];if(!_0x4dff18[_0x616d('0x14')]&&_0x4dff18[_0x616d('0x14')]!=_0x51cb61[_0x616d('0x14')]||_0x4dff18[_0x616d('0x14')]&&_0x4dff18['data2']){logger[_0x616d('0x15')](_0x616d('0x16'));}if(_0x4dff18[_0x616d('0x14')]&&!_0x4dff18[_0x616d('0x12')]&&_0x4dff18[_0x616d('0x14')]!=_0x51cb61[_0x616d('0x14')]){logger[_0x616d('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x4dff18[_0x616d('0x14')]&&!_0x4dff18['data2']&&_0x4dff18[_0x616d('0x14')]==_0x51cb61[_0x616d('0x14')]){return _0x13f780;}return _0x13f780[_0x616d('0x17')]({'data1':_0x1bb850,'data2':null,'license':_0x51cb61[_0x616d('0x14')]});}else{if(_0x51cb61[_0x616d('0x14')]||_0x4dff18[_0x616d('0x14')]){if(!_0x4dff18[_0x616d('0x12')]){if(_0x4dff18[_0x616d('0x11')]==_0x1bb850){GRAY_PERIOD_REASON='Disabled';logger[_0x616d('0x15')](_0x616d('0x18'));}else{GRAY_PERIOD_REASON=_0x616d('0x19');logger[_0x616d('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4dff18[_0x616d('0x11')],_0x1bb850);}logger[_0x616d('0x15')](_0x616d('0x1a'),GRAY_PERIOD_REASON[_0x616d('0x1b')](),moment()[_0x616d('0xa')](_0x616d('0x1c')));return _0x13f780[_0x616d('0x17')]({'data2':encryptor['encryptString'](moment()[_0x616d('0xa')](_0x616d('0x1c')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x4dff18[_0x616d('0x12')]),_0x616d('0x1d'))>DAYS){logger[_0x616d('0x15')]('DEMO\x20START\x20AT\x20%s',moment()[_0x616d('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x13f780[_0x616d('0x17')]({'data1':_0x1bb850,'data2':null,'license':null});}}}else{if(_0x4dff18['data1']!=_0x1bb850){logger[_0x616d('0x15')](_0x616d('0x1e'),_0x4dff18[_0x616d('0x11')],_0x1bb850);return _0x13f780['update']({'data1':_0x1bb850,'data2':null,'license':null});}}}return _0x13f780;})[_0x616d('0xf')](function(_0x2075a5){_0x13f780=_0x2075a5;})['catch'](function(_0x2e790a){logger[_0x616d('0x1f')](_0x2e790a[_0x616d('0x20')]);})[_0x616d('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x616d('0x22')](),_0x13f780);},TIME);});}function defaultLicense(){var _0x4910f5=hardware[_0x616d('0x22')]();if(_0x4910f5){return db[_0x616d('0x23')][_0x616d('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x4910f5}})['spread'](function(_0x4f3bc8,_0x5042ef){logger[_0x616d('0x15')](_0x616d('0x25'),_0x4910f5);manageLicense(_0x4910f5,_0x4f3bc8);})['catch'](function(_0x11ff6a){logger[_0x616d('0x1f')](_0x11ff6a['message']);});}}exports[_0x616d('0x26')]=defaultLicense; \ No newline at end of file +var _0x5041=['License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','get','data1','active','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','update','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','decryptString','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','finally','getUuid'];(function(_0x414020,_0x214742){var _0x3884c2=function(_0x5c0fbb){while(--_0x5c0fbb){_0x414020['push'](_0x414020['shift']());}};_0x3884c2(++_0x214742);}(_0x5041,0x99));var _0x1504=function(_0x358388,_0xc7618f){_0x358388=_0x358388-0x0;var _0x5a90c2=_0x5041[_0x358388];return _0x5a90c2;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0x1504('0x0'));var BPromise=require(_0x1504('0x1'));var pkginfo=require(_0x1504('0x2'))(module,'version');var db=require(_0x1504('0x3'))['db'];var encryptor=require(_0x1504('0x4'));var hardware=require('./hardware');var logger=require(_0x1504('0x5'))(_0x1504('0x6'));var HOST=_0x1504('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5095ba){return new BPromise(function(_0x27f96e,_0x48e108){var _0x592533=util[_0x1504('0x8')](_0x1504('0x9'),HOST,_0x5095ba,module['exports']['version']);if(oldToken){_0x592533=util[_0x1504('0x8')](_0x1504('0xa'),HOST,_0x5095ba,module[_0x1504('0xb')]['version'],oldToken);}var _0x17af21={'uri':_0x592533,'method':_0x1504('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x17af21)[_0x1504('0xd')](function(_0xef5413){_0x27f96e(_0xef5413);})[_0x1504('0xe')](function(_0x53044b){_0x48e108(_0x53044b);});});}function manageLicense(_0x4ed601,_0x1bae94){var _0x1d2226=_0x1bae94[_0x1504('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x1d2226['data1']!==_0x4ed601&&!_0x1d2226['data2']){oldToken=_0x1d2226[_0x1504('0x10')];}httpRequest(_0x4ed601)['then'](function(_0x17865e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x17865e[_0x1504('0x11')]){isOldTokenSent=![];if(!_0x1d2226[_0x1504('0x6')]&&_0x1d2226[_0x1504('0x6')]!=_0x17865e['license']||_0x1d2226[_0x1504('0x6')]&&_0x1d2226[_0x1504('0x12')]){logger['info'](_0x1504('0x13'));}if(_0x1d2226[_0x1504('0x6')]&&!_0x1d2226['data2']&&_0x1d2226[_0x1504('0x6')]!=_0x17865e[_0x1504('0x6')]){logger[_0x1504('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x1d2226[_0x1504('0x6')]&&!_0x1d2226[_0x1504('0x12')]&&_0x1d2226[_0x1504('0x6')]==_0x17865e[_0x1504('0x6')]){return _0x1bae94;}return _0x1bae94[_0x1504('0x15')]({'data1':_0x4ed601,'data2':null,'license':_0x17865e[_0x1504('0x6')]});}else{if(_0x17865e['license']||_0x1d2226[_0x1504('0x6')]){if(!_0x1d2226[_0x1504('0x12')]){if(_0x1d2226['data1']==_0x4ed601){GRAY_PERIOD_REASON='Disabled';logger[_0x1504('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0x1504('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1d2226[_0x1504('0x10')],_0x4ed601);}logger[_0x1504('0x14')](_0x1504('0x16'),GRAY_PERIOD_REASON[_0x1504('0x17')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x1bae94['update']({'data2':encryptor[_0x1504('0x18')](moment()[_0x1504('0x8')](_0x1504('0x19')))});}else{if(moment()['diff'](encryptor[_0x1504('0x1a')](_0x1d2226[_0x1504('0x12')]),'days')>DAYS){logger[_0x1504('0x14')](_0x1504('0x1b'),moment()['format'](_0x1504('0x19')));isOldTokenSent=![];return _0x1bae94[_0x1504('0x15')]({'data1':_0x4ed601,'data2':null,'license':null});}}}else{if(_0x1d2226[_0x1504('0x10')]!=_0x4ed601){logger[_0x1504('0x14')](_0x1504('0x1c'),_0x1d2226[_0x1504('0x10')],_0x4ed601);return _0x1bae94['update']({'data1':_0x4ed601,'data2':null,'license':null});}}}return _0x1bae94;})['then'](function(_0x289aca){_0x1bae94=_0x289aca;})[_0x1504('0xe')](function(_0x523251){logger[_0x1504('0x1d')](_0x523251['message']);})[_0x1504('0x1e')](function(){setTimeout(function(){manageLicense(hardware[_0x1504('0x1f')](),_0x1bae94);},TIME);});}function defaultLicense(){var _0x136838=hardware[_0x1504('0x1f')]();if(_0x136838){return db[_0x1504('0x20')][_0x1504('0x21')]({'where':{'id':0x1},'defaults':{'data1':_0x136838}})['spread'](function(_0x3948b0,_0x54ba9e){logger[_0x1504('0x14')](_0x1504('0x22'),_0x136838);manageLicense(_0x136838,_0x3948b0);})[_0x1504('0xe')](function(_0x1145dc){logger['error'](_0x1145dc[_0x1504('0x23')]);});}}exports[_0x1504('0x24')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 0371d7c..4daf4e0 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 _0x7bcb=['role','sequelize','COUNT','count','user','users','telephones','forEach','admin','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','changed','disabled','message','User'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7bcb,0xf9));var _0xb7bc=function(_0x12a674,_0x475b5b){_0x12a674=_0x12a674-0x0;var _0x28680a=_0x7bcb[_0x12a674];return _0x28680a;};'use strict';var util=require(_0xb7bc('0x0'));var _=require(_0xb7bc('0x1'));var moment=require(_0xb7bc('0x2'));var BPromise=require(_0xb7bc('0x3'));var hardware=require(_0xb7bc('0x4'));var encryptor=require(_0xb7bc('0x5'));var db=require(_0xb7bc('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb7bc('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xb7bc('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb7bc('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xb7bc('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3795d2){return new BPromise(function(_0xb011b2,_0x5199e1){return db[_0xb7bc('0xa')][_0xb7bc('0xb')](_['defaults'](_0x3795d2,{'raw':!![],'where':{'id':0x1}}))[_0xb7bc('0xc')](function(_0x54d4cf){return checkLicense(_0x54d4cf,null);})[_0xb7bc('0xc')](function(_0x5cd054){_0xb011b2(_0x5cd054);return;})[_0xb7bc('0xd')](function(_0x446577){_0x5199e1(_0x446577);});});}function checkLicense(_0x3378db,_0x883bd9){if(!_0x3378db){demoLicense[_0xb7bc('0xe')]=_0x3378db['data1'];return demoLicense;}try{var _0x3d5afa=_0x883bd9||_0x3378db[_0xb7bc('0xf')];if(_[_0xb7bc('0x10')](_0x3d5afa)){throw new Error(_0xb7bc('0x11'));}var _0x25ad61=_0x3378db[_0xb7bc('0x12')];var _0x841201=_0x3378db['data2'];var _0x3decb6=_0x25ad61['split']('-')[0x4];var _0x5ccdf0=_0x25ad61[_0xb7bc('0x13')]('-')[0x0];var _0x4a4526=encryptor['decryptString'](_0x3d5afa,util[_0xb7bc('0x14')](_0xb7bc('0x15'),_0x3decb6,_0x25ad61,_0x5ccdf0));var _0x470690=JSON[_0xb7bc('0x16')](_0x4a4526);_0x470690[_0xb7bc('0x17')]=![];_0x470690[_0xb7bc('0xe')]=_0x25ad61;_0x470690[_0xb7bc('0x18')]=hardware[_0xb7bc('0x9')]();if(_0x841201){var _0x35c183=encryptor['decryptString'](_0x841201);_0x470690[_0xb7bc('0x19')]=_0x35c183;_0x470690[_0xb7bc('0x1a')]=moment(_0x35c183)[_0xb7bc('0x1b')](0x7,_0xb7bc('0x1c'))['format']();_0x470690['grayReason']=_0x470690['uuid']!=_0x470690['machineUuid']?_0xb7bc('0x1d'):_0xb7bc('0x1e');}return _0x470690;}catch(_0x5c1b02){breakingLicense[_0xb7bc('0xe')]=_0x3378db[_0xb7bc('0x12')];breakingLicense[_0xb7bc('0x1f')]=_0x5c1b02[_0xb7bc('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x349c24,_0x57253b){getLicense()['then'](function(_0x193103){return db[_0xb7bc('0x20')]['findAll']({'attributes':[_0xb7bc('0x21'),[db[_0xb7bc('0x22')]['fn'](_0xb7bc('0x23'),db[_0xb7bc('0x22')]['col']('role')),_0xb7bc('0x24')]],'group':'role','where':{'role':{'$or':['admin',_0xb7bc('0x25'),'telephone']}},'raw':!![]})[_0xb7bc('0xc')](function(_0x361ce2){var _0x2ab062={'user':_0x193103[_0xb7bc('0x26')]||0x0,'telephone':_0x193103[_0xb7bc('0x27')]||0x0};_0x361ce2[_0xb7bc('0x28')](function(_0x7b511){var _0x57adbe=_0x7b511['role']===_0xb7bc('0x29')?'user':_0x7b511[_0xb7bc('0x21')];_0x2ab062[_0x57adbe]-=_0x7b511['count'];if(_0x2ab062[_0x57adbe]<0x0)_0x2ab062[_0x57adbe]=0x0;});_0x349c24(_0x2ab062);return;});})[_0xb7bc('0xd')](function(_0x31f17a){_0x57253b(_0x31f17a);});});}function checkUserLimits(_0x395aa6){return new BPromise(function(_0x4a2fc3,_0x1020bd){getLimits()['then'](function(_0x48510a){var _0x2ffa21=_[_0xb7bc('0x2a')](_[_0xb7bc('0x2b')](_0x395aa6,_0xb7bc('0x21')),[_0xb7bc('0x29'),'user','telephone']);var _0x25f014=(_0x2ffa21['admin']||0x0)+(_0x2ffa21[_0xb7bc('0x25')]||0x0);var _0x5032c9=_0x2ffa21[_0xb7bc('0x2c')]||0x0;if(_0x25f014>_0x48510a[_0xb7bc('0x25')])return _0x1020bd(_0xb7bc('0x2d'));if(_0x5032c9>_0x48510a['telephone'])return _0x1020bd(_0xb7bc('0x2e'));return _0x4a2fc3();})[_0xb7bc('0xd')](function(_0x16b69e){_0x1020bd(_0x16b69e);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xab5b=['forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','demo','gray','deadline','add','days','machineUuid','changed','disabled','User','findAll','sequelize','col','count','role','admin','user','telephone','users','telephones'];(function(_0x8ed10c,_0xa2e38f){var _0x151e12=function(_0x49b509){while(--_0x49b509){_0x8ed10c['push'](_0x8ed10c['shift']());}};_0x151e12(++_0xa2e38f);}(_0xab5b,0xbd));var _0xbab5=function(_0x5d8444,_0x2d7c8d){_0x5d8444=_0x5d8444-0x0;var _0x67716d=_0xab5b[_0x5d8444];return _0x67716d;};'use strict';var util=require(_0xbab5('0x0'));var _=require(_0xbab5('0x1'));var moment=require('moment');var BPromise=require(_0xbab5('0x2'));var hardware=require(_0xbab5('0x3'));var encryptor=require(_0xbab5('0x4'));var db=require(_0xbab5('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbab5('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xbab5('0x7'),'machineUuid':hardware[_0xbab5('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbab5('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xbab5('0x9'),'machineUuid':hardware[_0xbab5('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5d37f3){return new BPromise(function(_0x19c168,_0x235afd){return db['License']['find'](_['defaults'](_0x5d37f3,{'raw':!![],'where':{'id':0x1}}))[_0xbab5('0xa')](function(_0xcb5f2f){return checkLicense(_0xcb5f2f,null);})[_0xbab5('0xa')](function(_0x3be436){_0x19c168(_0x3be436);return;})[_0xbab5('0xb')](function(_0x2824ce){_0x235afd(_0x2824ce);});});}function checkLicense(_0x1da085,_0x1c48ff){if(!_0x1da085){demoLicense[_0xbab5('0xc')]=_0x1da085[_0xbab5('0xd')];return demoLicense;}try{var _0x5558f8=_0x1c48ff||_0x1da085[_0xbab5('0xe')];if(_[_0xbab5('0xf')](_0x5558f8)){throw new Error(_0xbab5('0x10'));}var _0x3967ea=_0x1da085[_0xbab5('0xd')];var _0x1689b4=_0x1da085[_0xbab5('0x11')];var _0x3f1d78=_0x3967ea[_0xbab5('0x12')]('-')[0x4];var _0x1130d5=_0x3967ea[_0xbab5('0x12')]('-')[0x0];var _0x3a9349=encryptor[_0xbab5('0x13')](_0x5558f8,util[_0xbab5('0x14')]('%s:%s:%s',_0x3f1d78,_0x3967ea,_0x1130d5));var _0x24b605=JSON[_0xbab5('0x15')](_0x3a9349);_0x24b605[_0xbab5('0x16')]=![];_0x24b605[_0xbab5('0xc')]=_0x3967ea;_0x24b605['machineUuid']=hardware[_0xbab5('0x8')]();if(_0x1689b4){var _0x2f3f4f=encryptor[_0xbab5('0x13')](_0x1689b4);_0x24b605[_0xbab5('0x17')]=_0x2f3f4f;_0x24b605[_0xbab5('0x18')]=moment(_0x2f3f4f)[_0xbab5('0x19')](0x7,_0xbab5('0x1a'))['format']();_0x24b605['grayReason']=_0x24b605[_0xbab5('0xc')]!=_0x24b605[_0xbab5('0x1b')]?_0xbab5('0x1c'):_0xbab5('0x1d');}return _0x24b605;}catch(_0x314e67){breakingLicense[_0xbab5('0xc')]=_0x1da085[_0xbab5('0xd')];breakingLicense['message']=_0x314e67['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x249772,_0x21262e){getLicense()[_0xbab5('0xa')](function(_0x1ea35b){return db[_0xbab5('0x1e')][_0xbab5('0x1f')]({'attributes':['role',[db[_0xbab5('0x20')]['fn']('COUNT',db['sequelize'][_0xbab5('0x21')]('role')),_0xbab5('0x22')]],'group':_0xbab5('0x23'),'where':{'role':{'$or':[_0xbab5('0x24'),_0xbab5('0x25'),_0xbab5('0x26')]}},'raw':!![]})['then'](function(_0x58a7f6){var _0xe8e07c={'user':_0x1ea35b[_0xbab5('0x27')]||0x0,'telephone':_0x1ea35b[_0xbab5('0x28')]||0x0};_0x58a7f6[_0xbab5('0x29')](function(_0x1adc73){var _0x503174=_0x1adc73[_0xbab5('0x23')]===_0xbab5('0x24')?_0xbab5('0x25'):_0x1adc73[_0xbab5('0x23')];_0xe8e07c[_0x503174]-=_0x1adc73['count'];if(_0xe8e07c[_0x503174]<0x0)_0xe8e07c[_0x503174]=0x0;});_0x249772(_0xe8e07c);return;});})['catch'](function(_0x3d66e0){_0x21262e(_0x3d66e0);});});}function checkUserLimits(_0x864fa4){return new BPromise(function(_0x230918,_0x1953f9){getLimits()[_0xbab5('0xa')](function(_0x42c257){var _0x2348d7=_[_0xbab5('0x2a')](_[_0xbab5('0x2b')](_0x864fa4,_0xbab5('0x23')),[_0xbab5('0x24'),'user',_0xbab5('0x26')]);var _0x452c7e=(_0x2348d7['admin']||0x0)+(_0x2348d7['user']||0x0);var _0x5de666=_0x2348d7[_0xbab5('0x26')]||0x0;if(_0x452c7e>_0x42c257[_0xbab5('0x25')])return _0x1953f9(_0xbab5('0x2c'));if(_0x5de666>_0x42c257[_0xbab5('0x26')])return _0x1953f9(_0xbab5('0x2d'));return _0x230918();})[_0xbab5('0xb')](function(_0x5610a9){_0x1953f9(_0x5610a9);});});}module['exports']={'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 1fb6506..6917b50 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 _0x236c=['secret','exports','myappanuglar-secret','app-id'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0x236c,0x155));var _0xc236=function(_0x5f3e92,_0x484d2d){_0x5f3e92=_0x5f3e92-0x0;var _0x4f2fa8=_0x236c[_0x5f3e92];return _0x4f2fa8;};'use strict';module[_0xc236('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xc236('0x1'),'GOOGLE_ID':_0xc236('0x2'),'GOOGLE_SECRET':_0xc236('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x4e2e=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x4bf43c,_0x48cc55){_0x4bf43c=_0x4bf43c-0x0;var _0xd25261=_0x4e2e[_0x4bf43c];return _0xd25261;};'use strict';module['exports']={'DOMAIN':_0xe4e2('0x0'),'SESSION_SECRET':_0xe4e2('0x1'),'GOOGLE_ID':_0xe4e2('0x2'),'GOOGLE_SECRET':_0xe4e2('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index cdd260b..f79a3a8 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ec2=['level','exports','transports','File','%s-%s','error','info','env','debugLevel','moment','util','join','log','format','%s-%s.log','message','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xf2d685,_0x1e1fe4){var _0x5c542b=function(_0x1bcc4b){while(--_0x1bcc4b){_0xf2d685['push'](_0xf2d685['shift']());}};_0x5c542b(++_0x1e1fe4);}(_0x6ec2,0x121));var _0x26ec=function(_0xb26f0b,_0x9b98a9){_0xb26f0b=_0xb26f0b-0x0;var _0x4aa139=_0x6ec2[_0xb26f0b];return _0x4aa139;};'use strict';var moment=require(_0x26ec('0x0'));var winston=require('winston');var util=require(_0x26ec('0x1'));var path=require('path');var debugLevel='INFO';function filename(_0x1e5fbd,_0x4db265){return path[_0x26ec('0x2')]('/var',_0x26ec('0x3'),'xcally',util[_0x26ec('0x4')](_0x26ec('0x5'),_0x1e5fbd,_0x4db265));}function formatter(_0x1a73c9,_0x26f31c){_0x26f31c[_0x26ec('0x6')]=_0x26f31c[_0x26ec('0x6')]['replace'](/@@{/g,'{{{')['replace'](/}@@/g,_0x26ec('0x7'))[_0x26ec('0x8')](/@{/g,'{{')[_0x26ec('0x8')](/}@/g,'}}');return util[_0x26ec('0x4')](_0x26ec('0x9'),moment()[_0x26ec('0x4')](_0x26ec('0xa')),_0x26f31c[_0x26ec('0xb')]['toUpperCase'](),_0x1a73c9,_0x26f31c['message']);}module[_0x26ec('0xc')]=function(_0x15be48){return new winston['Logger']({'transports':[new winston[(_0x26ec('0xd'))][(_0x26ec('0xe'))]({'name':util['format'](_0x26ec('0xf'),_0x15be48,_0x26ec('0x10')),'filename':filename(_0x15be48,_0x26ec('0x10')),'level':_0x26ec('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1955e1){return formatter(_0x15be48,_0x1955e1);}}),new winston[(_0x26ec('0xd'))][(_0x26ec('0xe'))]({'name':util[_0x26ec('0x4')](_0x26ec('0xf'),_0x15be48,_0x26ec('0x11')),'filename':filename(_0x15be48,_0x26ec('0x11')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x423c4b){return formatter(_0x15be48,_0x423c4b);}}),new winston['transports']['Console']({'level':process[_0x26ec('0x12')][_0x26ec('0x13')]||debugLevel,'json':![],'formatter':function(_0x24fe9c){return formatter(_0x15be48,_0x24fe9c);}})]});}; \ No newline at end of file +var _0x4838=['message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','exports','Logger','transports','File','%s-%s','error','info','env','debugLevel','INFO','xcally','format','%s-%s.log'];(function(_0x3b54c0,_0x4a9967){var _0x3e23b2=function(_0x6b00f1){while(--_0x6b00f1){_0x3b54c0['push'](_0x3b54c0['shift']());}};_0x3e23b2(++_0x4a9967);}(_0x4838,0x1dc));var _0x8483=function(_0x1a50ed,_0x2d43eb){_0x1a50ed=_0x1a50ed-0x0;var _0x13b910=_0x4838[_0x1a50ed];return _0x13b910;};'use strict';var moment=require('moment');var winston=require('winston');var util=require('util');var path=require('path');var debugLevel=_0x8483('0x0');function filename(_0x226f10,_0x98eb74){return path['join']('/var','log',_0x8483('0x1'),util[_0x8483('0x2')](_0x8483('0x3'),_0x226f10,_0x98eb74));}function formatter(_0x92cac2,_0x15319d){_0x15319d[_0x8483('0x4')]=_0x15319d['message'][_0x8483('0x5')](/@@{/g,_0x8483('0x6'))[_0x8483('0x5')](/}@@/g,_0x8483('0x7'))['replace'](/@{/g,'{{')[_0x8483('0x5')](/}@/g,'}}');return util['format'](_0x8483('0x8'),moment()[_0x8483('0x2')](_0x8483('0x9')),_0x15319d[_0x8483('0xa')]['toUpperCase'](),_0x92cac2,_0x15319d['message']);}module[_0x8483('0xb')]=function(_0x2dcf15){return new winston[(_0x8483('0xc'))]({'transports':[new winston[(_0x8483('0xd'))][(_0x8483('0xe'))]({'name':util[_0x8483('0x2')](_0x8483('0xf'),_0x2dcf15,_0x8483('0x10')),'filename':filename(_0x2dcf15,_0x8483('0x10')),'level':_0x8483('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x525cc1){return formatter(_0x2dcf15,_0x525cc1);}}),new winston[(_0x8483('0xd'))][(_0x8483('0xe'))]({'name':util[_0x8483('0x2')]('%s-%s',_0x2dcf15,_0x8483('0x11')),'filename':filename(_0x2dcf15,_0x8483('0x11')),'level':_0x8483('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3ec56e){return formatter(_0x2dcf15,_0x3ec56e);}}),new winston['transports']['Console']({'level':process[_0x8483('0x12')][_0x8483('0x13')]||debugLevel,'json':![],'formatter':function(_0x58e165){return formatter(_0x2dcf15,_0x58e165);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 7523a87..265124f 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 _0x687d=['express','join','../../services/express/index.js','ami','../../services/ami/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x687d,0xaf));var _0xd687=function(_0x54ef48,_0x783269){_0x54ef48=_0x54ef48-0x0;var _0x24eb39=_0x687d[_0x54ef48];return _0x24eb39;};'use strict';var path=require(_0xd687('0x0'));var os=require('os');var config={'apps':[{'name':_0xd687('0x1'),'script':path[_0xd687('0x2')](__dirname,_0xd687('0x3'))},{'name':_0xd687('0x4'),'script':path[_0xd687('0x2')](__dirname,_0xd687('0x5'))},{'name':'agi','script':path['join'](__dirname,'../../services/agi/index.js')},{'name':'email','script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0xd687('0x6'),'script':path[_0xd687('0x2')](__dirname,_0xd687('0x7'))},{'name':_0xd687('0x8'),'script':path[_0xd687('0x2')](__dirname,_0xd687('0x9'))}]};module[_0xd687('0xa')]=config; \ No newline at end of file +var _0xecfa=['../../services/ami/index.js','agi','join','../../services/agi/index.js','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','../../services/express/index.js'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xecfa,0x77));var _0xaecf=function(_0x4cfb40,_0x42d67e){_0x4cfb40=_0x4cfb40-0x0;var _0x596fb0=_0xecfa[_0x4cfb40];return _0x596fb0;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,_0xaecf('0x0'))},{'name':'ami','script':path['join'](__dirname,_0xaecf('0x1'))},{'name':_0xaecf('0x2'),'script':path[_0xaecf('0x3')](__dirname,_0xaecf('0x4'))},{'name':'email','script':path[_0xaecf('0x3')](__dirname,_0xaecf('0x5'))},{'name':_0xaecf('0x6'),'script':path[_0xaecf('0x3')](__dirname,'../../services/routing/index.js')},{'name':_0xaecf('0x7'),'script':path['join'](__dirname,_0xaecf('0x8'))}]};module[_0xaecf('0x9')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 5275cd7..e46826b 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 _0x4e39=['then','restart','list','describe','delete','dump','pm2','bluebird','./config','connected','start','disconnect','stop'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0x4e39,0xfd));var _0x94e3=function(_0x4bb94b,_0x50628a){_0x4bb94b=_0x4bb94b-0x0;var _0x36dcc6=_0x4e39[_0x4bb94b];return _0x36dcc6;};'use strict';var pm2=require(_0x94e3('0x0'));var BPromise=require(_0x94e3('0x1'));var config=require(_0x94e3('0x2'));function connect(){return new BPromise(function(_0x4a61c9,_0x283546){return pm2['connect'](function(_0x26a113){if(_0x26a113){return _0x283546(_0x26a113);}return _0x4a61c9(_0x94e3('0x3'));});});};exports[_0x94e3('0x4')]=function(_0x5174f7){return connect()['then'](function(){return new BPromise(function(_0x3f6970,_0x481e18){return pm2['start'](_0x5174f7,function(_0x1b607a,_0x1a0dd1){if(_0x1b607a){return _0x481e18(_0x1b607a);}pm2[_0x94e3('0x5')]();return _0x3f6970(_0x1a0dd1);});});});};exports[_0x94e3('0x6')]=function(_0x4ddf2f){return connect()[_0x94e3('0x7')](function(){return new BPromise(function(_0x30aa3f,_0x5bdfb6){return pm2[_0x94e3('0x6')](_0x4ddf2f,function(_0x425565,_0xa284f0){if(_0x425565){return _0x5bdfb6(_0x425565);}pm2[_0x94e3('0x5')]();return _0x30aa3f(_0xa284f0);});});});};exports[_0x94e3('0x8')]=function(_0x357f62){return connect()['then'](function(){return new BPromise(function(_0x4bcb64,_0x4ab42e){return pm2[_0x94e3('0x8')](_0x357f62,function(_0x212171,_0x241f36){if(_0x212171){return _0x4ab42e(_0x212171);}pm2[_0x94e3('0x5')]();return _0x4bcb64(_0x241f36);});});});};exports[_0x94e3('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5e622e,_0x5d5a56){return pm2['list'](function(_0x2e9fbb,_0x45e2d8){if(_0x2e9fbb){return _0x5d5a56(_0x2e9fbb);}pm2[_0x94e3('0x5')]();return _0x5e622e(_0x45e2d8);});});});};exports[_0x94e3('0xa')]=function(_0x3e8f8e){return connect()[_0x94e3('0x7')](function(){return new BPromise(function(_0x1d66f3,_0x1ade4b){return pm2[_0x94e3('0xa')](_0x3e8f8e,function(_0x46e9e6,_0x1d0f5a){if(_0x46e9e6){return _0x1ade4b(_0x46e9e6);}pm2[_0x94e3('0x5')]();return _0x1d66f3(_0x1d0f5a);});});});};exports[_0x94e3('0xb')]=function(_0x580064){return connect()[_0x94e3('0x7')](function(){return new BPromise(function(_0x50815c,_0x46a3c0){return pm2[_0x94e3('0xb')](_0x580064,function(_0x5afee4,_0x896f57){if(_0x5afee4){return _0x46a3c0(_0x5afee4);}pm2[_0x94e3('0x5')]();return _0x50815c(_0x896f57);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x58dd71,_0x5a6639){return pm2[_0x94e3('0xc')](function(_0x3a60fa){if(_0x3a60fa){return _0x5a6639(_0x3a60fa);}return _0x58dd71('saved');});});});}; \ No newline at end of file +var _0x4c36=['stop','restart','list','describe','delete','saved','bluebird','./config','connect','connected','then','start','disconnect'];(function(_0x5eda7f,_0x10c0a){var _0x8f1e4a=function(_0x1dadc1){while(--_0x1dadc1){_0x5eda7f['push'](_0x5eda7f['shift']());}};_0x8f1e4a(++_0x10c0a);}(_0x4c36,0xf0));var _0x64c3=function(_0x1a1128,_0x1784d8){_0x1a1128=_0x1a1128-0x0;var _0x1f5bd2=_0x4c36[_0x1a1128];return _0x1f5bd2;};'use strict';var pm2=require('pm2');var BPromise=require(_0x64c3('0x0'));var config=require(_0x64c3('0x1'));function connect(){return new BPromise(function(_0x237ee8,_0x26b4c8){return pm2[_0x64c3('0x2')](function(_0x5cdb9e){if(_0x5cdb9e){return _0x26b4c8(_0x5cdb9e);}return _0x237ee8(_0x64c3('0x3'));});});};exports['start']=function(_0x431b43){return connect()[_0x64c3('0x4')](function(){return new BPromise(function(_0x17f593,_0x5bb250){return pm2[_0x64c3('0x5')](_0x431b43,function(_0x32546b,_0x1344dd){if(_0x32546b){return _0x5bb250(_0x32546b);}pm2[_0x64c3('0x6')]();return _0x17f593(_0x1344dd);});});});};exports[_0x64c3('0x7')]=function(_0x33b10b){return connect()[_0x64c3('0x4')](function(){return new BPromise(function(_0x1138ce,_0x4f9cbc){return pm2['stop'](_0x33b10b,function(_0x2c9ee9,_0x4c0643){if(_0x2c9ee9){return _0x4f9cbc(_0x2c9ee9);}pm2['disconnect']();return _0x1138ce(_0x4c0643);});});});};exports[_0x64c3('0x8')]=function(_0xa75bfe){return connect()[_0x64c3('0x4')](function(){return new BPromise(function(_0x420958,_0x34c8b8){return pm2[_0x64c3('0x8')](_0xa75bfe,function(_0x359cd4,_0x1e3d86){if(_0x359cd4){return _0x34c8b8(_0x359cd4);}pm2['disconnect']();return _0x420958(_0x1e3d86);});});});};exports[_0x64c3('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5cfec7,_0x382231){return pm2['list'](function(_0x29b9ff,_0x16ebf8){if(_0x29b9ff){return _0x382231(_0x29b9ff);}pm2[_0x64c3('0x6')]();return _0x5cfec7(_0x16ebf8);});});});};exports[_0x64c3('0xa')]=function(_0x35b13d){return connect()['then'](function(){return new BPromise(function(_0x5d4115,_0x498d34){return pm2[_0x64c3('0xa')](_0x35b13d,function(_0x201894,_0x43f16e){if(_0x201894){return _0x498d34(_0x201894);}pm2[_0x64c3('0x6')]();return _0x5d4115(_0x43f16e);});});});};exports[_0x64c3('0xb')]=function(_0x4256f){return connect()[_0x64c3('0x4')](function(){return new BPromise(function(_0x4eb6bc,_0x4346a0){return pm2['delete'](_0x4256f,function(_0x3bc605,_0x135513){if(_0x3bc605){return _0x4346a0(_0x3bc605);}pm2[_0x64c3('0x6')]();return _0x4eb6bc(_0x135513);});});});};exports['dump']=function(){return connect()[_0x64c3('0x4')](function(){return new BPromise(function(_0x25c766,_0x5050b6){return pm2['dump'](function(_0x4fd4c4){if(_0x4fd4c4){return _0x5050b6(_0x4fd4c4);}return _0x25c766(_0x64c3('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 9ee87b6..52fb4f8 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 _0x8a5b=['info','join','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','length'];(function(_0x199abb,_0x300aaa){var _0x4d5e38=function(_0x40dea9){while(--_0x40dea9){_0x199abb['push'](_0x199abb['shift']());}};_0x4d5e38(++_0x300aaa);}(_0x8a5b,0xfc));var _0xb8a5=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0x8a5b[_0x39cf70];return _0x580424;};'use strict';var _=require(_0xb8a5('0x0'));var moment=require(_0xb8a5('0x1'));var Redis=require(_0xb8a5('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0xb8a5('0x3'))['db'];var logger=require(_0xb8a5('0x4'))(_0xb8a5('0x5'));config[_0xb8a5('0x6')]=_['defaults'](config[_0xb8a5('0x6')],{'host':_0xb8a5('0x7'),'port':0x18eb});var io=require(_0xb8a5('0x8'))(new Redis(config[_0xb8a5('0x6')]));function closeInteractions(){var _0x503d00=0x0;var _0x4d7679=[];return db[_0xb8a5('0x9')][_0xb8a5('0xa')]({'raw':!![],'attributes':['id',_0xb8a5('0xb')],'where':{'id':0x1}})[_0xb8a5('0xc')](function(_0x60aa14){_0x503d00=_0x60aa14[_0xb8a5('0xb')];if(_0x503d00){return db[_0xb8a5('0xd')][_0xb8a5('0xe')]({'raw':!![],'attributes':['id',_0xb8a5('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xb8a5('0x10')](_0x60aa14[_0xb8a5('0xb')],'minutes')}}});}else{return[];}})[_0xb8a5('0xc')](function(_0x48bb1b){if(_0x48bb1b&&_0x48bb1b[_0xb8a5('0x11')]){_0x4d7679=_['map'](_0x48bb1b||[],'id');logger[_0xb8a5('0x12')]('[CHAT]\x20Interactions\x20to\x20close:',_0x4d7679[_0xb8a5('0x13')]());return db[_0xb8a5('0xd')]['update']({'closeReason':_0xb8a5('0x14'),'disposition':_0xb8a5('0x15'),'closed':!![],'closedAt':moment()['format'](_0xb8a5('0x16'))},{'where':{'id':_0x4d7679}});}})[_0xb8a5('0xc')](function(){if(_0x4d7679&&_0x4d7679[_0xb8a5('0x11')]){logger['info'](_0xb8a5('0x17'),_0x4d7679[_0xb8a5('0x13')]());for(var _0x42ab78=0x0;_0x42ab78<_0x4d7679['length'];_0x42ab78++){io['emit']('chatInteraction:update',{'id':_0x4d7679[_0x42ab78],'closed':!![]});}}})['catch'](function(_0x5624d7){logger['error'](_0xb8a5('0x18'),_0x5624d7?util[_0xb8a5('0x19')](_0x5624d7,{'showHidden':![],'depth':null}):'');});}exports[_0xb8a5('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x9317=['ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','chatTimeout','then','lastMsgAt','subtract','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment'];(function(_0xfec7b7,_0x26923b){var _0x1d2dca=function(_0x21c732){while(--_0x21c732){_0xfec7b7['push'](_0xfec7b7['shift']());}};_0x1d2dca(++_0x26923b);}(_0x9317,0x82));var _0x7931=function(_0x2b4448,_0x5bcc69){_0x2b4448=_0x2b4448-0x0;var _0xb4b465=_0x9317[_0x2b4448];return _0xb4b465;};'use strict';var _=require(_0x7931('0x0'));var moment=require(_0x7931('0x1'));var Redis=require(_0x7931('0x2'));var util=require(_0x7931('0x3'));var config=require(_0x7931('0x4'));var db=require(_0x7931('0x5'))['db'];var logger=require(_0x7931('0x6'))(_0x7931('0x7'));config[_0x7931('0x8')]=_[_0x7931('0x9')](config[_0x7931('0x8')],{'host':_0x7931('0xa'),'port':0x18eb});var io=require(_0x7931('0xb'))(new Redis(config[_0x7931('0x8')]));function closeInteractions(){var _0x177ec8=0x0;var _0x5ea9cd=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0x7931('0xc')],'where':{'id':0x1}})[_0x7931('0xd')](function(_0xfd828e){_0x177ec8=_0xfd828e[_0x7931('0xc')];if(_0x177ec8){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0x7931('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x7931('0xf')](_0xfd828e[_0x7931('0xc')],_0x7931('0x10'))}}});}else{return[];}})[_0x7931('0xd')](function(_0x5a7577){if(_0x5a7577&&_0x5a7577[_0x7931('0x11')]){_0x5ea9cd=_[_0x7931('0x12')](_0x5a7577||[],'id');logger['info'](_0x7931('0x13'),_0x5ea9cd[_0x7931('0x14')]());return db['ChatInteraction']['update']({'closeReason':_0x7931('0x15'),'disposition':_0x7931('0x16'),'closed':!![],'closedAt':moment()[_0x7931('0x17')](_0x7931('0x18'))},{'where':{'id':_0x5ea9cd}});}})[_0x7931('0xd')](function(){if(_0x5ea9cd&&_0x5ea9cd[_0x7931('0x11')]){logger[_0x7931('0x19')](_0x7931('0x1a'),_0x5ea9cd[_0x7931('0x14')]());for(var _0x238e01=0x0;_0x238e01<_0x5ea9cd['length'];_0x238e01++){io[_0x7931('0x1b')](_0x7931('0x1c'),{'id':_0x5ea9cd[_0x238e01],'closed':!![]});}}})[_0x7931('0x1d')](function(_0x42557c){logger[_0x7931('0x1e')](_0x7931('0x1f'),_0x42557c?util[_0x7931('0x20')](_0x42557c,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 0d2e1b9..e1e85ce 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe551=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe551,0xe0));var _0x1e55=function(_0x479ae3,_0x54c8c1){_0x479ae3=_0x479ae3-0x0;var _0x286990=_0xe551[_0x479ae3];return _0x286990;};'use strict';function start(){var _0x2c27c6=require(_0x1e55('0x0'));return _0x2c27c6['startAllRefreshIntervals']();}module[_0x1e55('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x1424=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x2224df,_0x4b0c4a){var _0x5391a5=function(_0x5886a0){while(--_0x5886a0){_0x2224df['push'](_0x2224df['shift']());}};_0x5391a5(++_0x4b0c4a);}(_0x1424,0xb3));var _0x4142=function(_0x5dc45d,_0x55f90f){_0x5dc45d=_0x5dc45d-0x0;var _0x4ce697=_0x1424[_0x5dc45d];return _0x4ce697;};'use strict';function start(){var _0x19f6d3=require(_0x4142('0x0'));return _0x19f6d3[_0x4142('0x1')]();}module[_0x4142('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 3ac6ffb..419a4af 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 _0x2b5a=['findAll','MailServerOut','jobs','map','toString','difference','intersection','length','exists','stop','toRun','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','active','update','update\x20cron','deleteJob','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','service','host','Smtp','secure','authentication','auth','user','\x22%s\x22\x20<%s>','email','bcc','format','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','existsSync','status','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','error','stringify','email\x20sent','catch','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','then','Schedule'];(function(_0x1afc80,_0x402245){var _0x5b7c1d=function(_0x5ac625){while(--_0x5ac625){_0x1afc80['push'](_0x1afc80['shift']());}};_0x5b7c1d(++_0x402245);}(_0x2b5a,0xca));var _0xa2b5=function(_0x27c0a5,_0x38be4b){_0x27c0a5=_0x27c0a5-0x0;var _0x5be2cc=_0x2b5a[_0x27c0a5];return _0x5be2cc;};'use strict';var fs=require('fs');var util=require(_0xa2b5('0x0'));var path=require(_0xa2b5('0x1'));var _=require(_0xa2b5('0x2'));var moment=require(_0xa2b5('0x3'));var CronJobManager=require(_0xa2b5('0x4'));var jayson=require(_0xa2b5('0x5'));var BPromise=require(_0xa2b5('0x6'));var logger=require(_0xa2b5('0x7'))('schedule');var db=require(_0xa2b5('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0xa2b5('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2daf81,_0x225af8){return function(){logger[_0xa2b5('0xa')](_0xa2b5('0xb'),_0x2daf81['email']);var _0x69ec8c=!![];var _0x1563ff={'tls':{'rejectUnauthorized':![]}};if(_0x2daf81[_0xa2b5('0xc')]['Smtp'][_0xa2b5('0xd')]){_0x1563ff[_0xa2b5('0xd')]=_0x2daf81[_0xa2b5('0xc')]['Smtp'][_0xa2b5('0xd')];}else{_0x1563ff[_0xa2b5('0xe')]=_0x2daf81['MailAccount'][_0xa2b5('0xf')][_0xa2b5('0xe')];_0x1563ff['port']=_0x2daf81[_0xa2b5('0xc')][_0xa2b5('0xf')]['port'];_0x1563ff[_0xa2b5('0x10')]=_0x2daf81[_0xa2b5('0xc')][_0xa2b5('0xf')][_0xa2b5('0x10')];}if(_0x2daf81[_0xa2b5('0xc')]['Smtp'][_0xa2b5('0x11')]){_0x1563ff[_0xa2b5('0x12')]={'user':_0x2daf81['MailAccount'][_0xa2b5('0xf')][_0xa2b5('0x13')],'pass':_0x2daf81[_0xa2b5('0xc')][_0xa2b5('0xf')]['pass']};}var _0x43ba9e={'account':_0x1563ff,'message':{'from':util['format'](_0xa2b5('0x14'),_0x2daf81[_0xa2b5('0xc')]['name'],_0x2daf81[_0xa2b5('0xc')][_0xa2b5('0x15')]||_0x2daf81[_0xa2b5('0xc')]['Smtp']['user']),'to':_0x2daf81[_0xa2b5('0x15')],'cc':_0x2daf81['cc'],'bcc':_0x2daf81[_0xa2b5('0x16')],'subject':util[_0xa2b5('0x17')]('Report\x20%s\x20last\x20%s\x20%s',_0x225af8[_0xa2b5('0x18')],_0x2daf81[_0xa2b5('0x19')],_0x2daf81[_0xa2b5('0x1a')])}};var _0x15852d=path[_0xa2b5('0x1b')](__dirname,_0xa2b5('0x1c'));var _0x1301ba=_0x225af8[_0xa2b5('0x1d')];var _0x4bd8e3=util['format'](_0xa2b5('0x1e'),path[_0xa2b5('0x1f')](_0x225af8[_0xa2b5('0x1d')],path[_0xa2b5('0x20')](_0x225af8[_0xa2b5('0x1d')])),'zip');var _0x203161=path[_0xa2b5('0x1b')](_0x15852d,_0x1301ba);var _0x7c8d23=path[_0xa2b5('0x1b')](_0x15852d,_0x4bd8e3);if(fs[_0xa2b5('0x21')](_0x203161)){_0x225af8[_0xa2b5('0x22')]='Sent';_0x43ba9e['message'][_0xa2b5('0x23')]=[{'filename':_0x1301ba,'path':_0x203161}];_0x43ba9e[_0xa2b5('0x24')][_0xa2b5('0x25')]=util['format'](_0xa2b5('0x26'),JSON['stringify'](_0x225af8,null,0x2));}else if(fs[_0xa2b5('0x21')](_0x7c8d23)){_0x225af8['status']=_0xa2b5('0x27');_0x43ba9e['message']['attachments']=[{'filename':_0x4bd8e3,'path':_0x7c8d23}];}else{_0x43ba9e[_0xa2b5('0x24')][_0xa2b5('0x25')]=_0xa2b5('0x28');if(!_0x2daf81['sendIfEmpty']){_0x69ec8c=![];logger[_0xa2b5('0xa')](_0xa2b5('0x29'));}}if(_0x69ec8c){return client[_0xa2b5('0x2a')]('SendMail',_0x43ba9e)['then'](function(_0x16c0da){if(_0x16c0da[_0xa2b5('0x2b')]){return logger[_0xa2b5('0x2b')]('error\x20mail',JSON[_0xa2b5('0x2c')](_0x16c0da));}return logger[_0xa2b5('0xa')](_0xa2b5('0x2d'));})[_0xa2b5('0x2e')](function(_0x55d312){return logger[_0xa2b5('0x2b')]('error\x20mail',JSON['stringify'](_0x55d312));});}};}function handleError(){return function(_0x3419a5){return logger[_0xa2b5('0x2b')](JSON[_0xa2b5('0x2c')](_0x3419a5));};}function handleResult(_0x144867){return function(_0x59a072){logger[_0xa2b5('0xa')]('data',JSON[_0xa2b5('0x2c')](_0x59a072));if(_0x144867['MailAccount']&&_0x144867[_0xa2b5('0xc')][_0xa2b5('0xf')]&&!_[_0xa2b5('0x2f')](_0x144867[_0xa2b5('0x15')])){setTimeout(handleSendEmail(_0x144867,_0x59a072),0x3c*0x3e8);}};}function handleJob(_0x3d3e01){return function(){try{if(_[_0xa2b5('0x2f')](_0x3d3e01[_0xa2b5('0x19')])){return logger[_0xa2b5('0xa')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xa2b5('0x2f')](_0x3d3e01['subtractUnit'])){return logger[_0xa2b5('0xa')](_0xa2b5('0x30'));}var _0x1fea0d={'startDate':moment()[_0xa2b5('0x31')](_0x3d3e01[_0xa2b5('0x19')],_0x3d3e01[_0xa2b5('0x1a')])[_0xa2b5('0x17')](_0xa2b5('0x32')),'endDate':moment()[_0xa2b5('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xa2b5('0x33'),'output':_0x3d3e01[_0xa2b5('0x34')],'name':_0x3d3e01[_0xa2b5('0x18')]};if(!_[_0xa2b5('0x2f')](_0x3d3e01[_0xa2b5('0x35')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x3d3e01[_0xa2b5('0x35')]);return analyticDefaultReportController['runReport']({'id':_0x3d3e01[_0xa2b5('0x35')]},_0x1fea0d)['then'](handleResult(_0x3d3e01))['catch'](handleError());}if(!_['isNil'](_0x3d3e01[_0xa2b5('0x36')])){logger['info'](_0xa2b5('0x37'),_0x3d3e01[_0xa2b5('0x36')]);return analyticCustomReportController[_0xa2b5('0x38')]({'id':_0x3d3e01[_0xa2b5('0x36')]},_0x1fea0d)[_0xa2b5('0x39')](handleResult(_0x3d3e01))[_0xa2b5('0x2e')](handleError());}}catch(_0x38375f){logger['error'](JSON['stringify'](_0x38375f));}return logger[_0xa2b5('0xa')]('no\x20report\x20id');};}function getJobs(_0x25b282){var _0x599210={};if(_0x25b282){_0x599210['id']=_0x25b282;}return db[_0xa2b5('0x3a')][_0xa2b5('0x3b')]({'where':_0x599210,'include':[{'model':db[_0xa2b5('0xc')],'attributes':['id','name',_0xa2b5('0x15')],'include':[{'model':db[_0xa2b5('0x3c')],'as':'Smtp'}]}]})['then'](function(_0xf5d9fb){var _0x25140f=_['keys'](manager[_0xa2b5('0x3d')]);var _0x455408=_[_0xa2b5('0x3e')](_0xf5d9fb,function(_0x290523){return _0x290523['id'][_0xa2b5('0x3f')]();});var _0x53cb5b=_['keyBy'](_0xf5d9fb,function(_0x4362da){return _0x4362da['id']['toString']();});var _0x376d9d=_0x25b282?_0x455408:_[_0xa2b5('0x40')](_0x455408,_0x25140f);var _0x4e658a=_[_0xa2b5('0x41')](_0x455408,_0x25140f);var _0x3674b5=_[_0xa2b5('0x40')](_0x25140f,_0x455408);var _0x1313b5;var _0x47c019;for(_0x1313b5=0x0;_0x1313b5<_0x3674b5[_0xa2b5('0x42')]&&!_0x25b282;_0x1313b5+=0x1){_0x47c019=_0x3674b5[_0x1313b5][_0xa2b5('0x3f')]();if(manager[_0xa2b5('0x43')](_0x47c019)){manager[_0xa2b5('0x44')](_0x47c019);manager['deleteJob'](_0x47c019);logger['info']('delete\x20cron',_0x47c019);}}logger[_0xa2b5('0xa')](_0xa2b5('0x45'),JSON[_0xa2b5('0x2c')](_0x376d9d));for(_0x1313b5=0x0;_0x1313b5<_0x376d9d[_0xa2b5('0x42')];_0x1313b5+=0x1){_0x47c019=_0x376d9d[_0x1313b5][_0xa2b5('0x3f')]();logger[_0xa2b5('0xa')](_0xa2b5('0x46'),_0x47c019);if(_0x25b282){logger[_0xa2b5('0xa')](_0xa2b5('0x47'),_0x25b282);logger['info'](JSON[_0xa2b5('0x2c')](_0x53cb5b[_0x47c019]));BPromise[_0xa2b5('0x48')]()[_0xa2b5('0x39')](handleJob(_0x53cb5b[_0x47c019]));logger[_0xa2b5('0xa')](_0xa2b5('0x49'),_0x53cb5b[_0x47c019][_0xa2b5('0x18')],_0x53cb5b[_0x47c019][_0xa2b5('0x4a')]);}else if(_0x53cb5b[_0x47c019]['cron']&&_0x53cb5b[_0x47c019]['active']&&moment()[_0xa2b5('0x4b')](_0x53cb5b[_0x47c019][_0xa2b5('0x4c')],_0x53cb5b[_0x47c019][_0xa2b5('0x4d')])){manager[_0xa2b5('0x4e')](_0x47c019,_0x53cb5b[_0x47c019][_0xa2b5('0x4a')],handleJob(_0x53cb5b[_0x47c019]));manager[_0xa2b5('0x4f')](_0x47c019);logger['info'](_0xa2b5('0x50'),_0x53cb5b[_0x47c019][_0xa2b5('0x18')],_0x53cb5b[_0x47c019][_0xa2b5('0x4a')]);}else if(manager[_0xa2b5('0x43')](_0x47c019)){manager['stop'](_0x47c019);manager['deleteJob'](_0x47c019);logger[_0xa2b5('0xa')](_0xa2b5('0x51'),_0x53cb5b[_0x47c019]['name'],_0x53cb5b[_0x47c019][_0xa2b5('0x4a')]);}}for(_0x1313b5=0x0,_0x47c019;_0x1313b5<_0x4e658a['length']&&!_0x25b282;_0x1313b5+=0x1){_0x47c019=_0x4e658a[_0x1313b5][_0xa2b5('0x3f')]();if(manager[_0xa2b5('0x43')](_0x47c019)){if(_0x53cb5b[_0x47c019][_0xa2b5('0x4a')]&&_0x53cb5b[_0x47c019][_0xa2b5('0x52')]&&moment()[_0xa2b5('0x4b')](_0x53cb5b[_0x47c019][_0xa2b5('0x4c')],_0x53cb5b[_0x47c019]['endAt'])){manager[_0xa2b5('0x53')](_0x47c019,_0x53cb5b[_0x47c019][_0xa2b5('0x4a')],handleJob(_0x53cb5b[_0x47c019]));logger['info'](_0xa2b5('0x54'),_0x53cb5b[_0x47c019][_0xa2b5('0x18')],_0x53cb5b[_0x47c019][_0xa2b5('0x4a')]);}else{manager[_0xa2b5('0x44')](_0x47c019);manager[_0xa2b5('0x55')](_0x47c019);logger['info'](_0xa2b5('0x51'),_0x53cb5b[_0x47c019][_0xa2b5('0x18')],_0x53cb5b[_0x47c019][_0xa2b5('0x4a')]);}}}})[_0xa2b5('0x2e')](function(_0x21c337){logger[_0xa2b5('0x2b')](JSON[_0xa2b5('0x2c')](_0x21c337));});}exports[_0xa2b5('0x56')]=function(_0x3d6590){return getJobs(_0x3d6590);};exports[_0xa2b5('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xba4a=['Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','service','Smtp','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','name','email','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','basename','extname','zip','existsSync','status','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','data','isNil','subtractNumber','subtract','YYYY-MM-DD\x20HH:mm:ss','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','catch','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','keys','jobs','map','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','run\x20job','cron','active','isBetween','startAt','endAt','add','start','update','update\x20cron','stop\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','info'];(function(_0x262a91,_0x4d3739){var _0x5dcb6b=function(_0x5df927){while(--_0x5df927){_0x262a91['push'](_0x262a91['shift']());}};_0x5dcb6b(++_0x4d3739);}(_0xba4a,0x15c));var _0xaba4=function(_0x4dfcc1,_0x30f0f5){_0x4dfcc1=_0x4dfcc1-0x0;var _0x588569=_0xba4a[_0x4dfcc1];return _0x588569;};'use strict';var fs=require('fs');var util=require(_0xaba4('0x0'));var path=require(_0xaba4('0x1'));var _=require(_0xaba4('0x2'));var moment=require(_0xaba4('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xaba4('0x4'));var BPromise=require(_0xaba4('0x5'));var logger=require(_0xaba4('0x6'))(_0xaba4('0x7'));var db=require(_0xaba4('0x8'))['db'];var analyticCustomReportController=require(_0xaba4('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xaba4('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x7da3b5,_0x28d082){return function(){logger[_0xaba4('0xb')](_0xaba4('0xc'),_0x7da3b5['email']);var _0x1b8788=!![];var _0x265ee5={'tls':{'rejectUnauthorized':![]}};if(_0x7da3b5[_0xaba4('0xd')]['Smtp'][_0xaba4('0xe')]){_0x265ee5[_0xaba4('0xe')]=_0x7da3b5[_0xaba4('0xd')][_0xaba4('0xf')][_0xaba4('0xe')];}else{_0x265ee5[_0xaba4('0x10')]=_0x7da3b5[_0xaba4('0xd')][_0xaba4('0xf')][_0xaba4('0x10')];_0x265ee5[_0xaba4('0x11')]=_0x7da3b5['MailAccount']['Smtp']['port'];_0x265ee5['secure']=_0x7da3b5[_0xaba4('0xd')][_0xaba4('0xf')][_0xaba4('0x12')];}if(_0x7da3b5['MailAccount'][_0xaba4('0xf')][_0xaba4('0x13')]){_0x265ee5[_0xaba4('0x14')]={'user':_0x7da3b5[_0xaba4('0xd')]['Smtp']['user'],'pass':_0x7da3b5[_0xaba4('0xd')]['Smtp'][_0xaba4('0x15')]};}var _0x462e89={'account':_0x265ee5,'message':{'from':util[_0xaba4('0x16')](_0xaba4('0x17'),_0x7da3b5[_0xaba4('0xd')][_0xaba4('0x18')],_0x7da3b5[_0xaba4('0xd')][_0xaba4('0x19')]||_0x7da3b5[_0xaba4('0xd')]['Smtp'][_0xaba4('0x1a')]),'to':_0x7da3b5[_0xaba4('0x19')],'cc':_0x7da3b5['cc'],'bcc':_0x7da3b5[_0xaba4('0x1b')],'subject':util[_0xaba4('0x16')](_0xaba4('0x1c'),_0x28d082[_0xaba4('0x18')],_0x7da3b5['subtractNumber'],_0x7da3b5[_0xaba4('0x1d')])}};var _0x2bb40c=path[_0xaba4('0x1e')](__dirname,_0xaba4('0x1f'));var _0x504232=_0x28d082[_0xaba4('0x20')];var _0x4429d8=util[_0xaba4('0x16')]('%s.%s',path[_0xaba4('0x21')](_0x28d082[_0xaba4('0x20')],path[_0xaba4('0x22')](_0x28d082[_0xaba4('0x20')])),_0xaba4('0x23'));var _0x3c5805=path[_0xaba4('0x1e')](_0x2bb40c,_0x504232);var _0x3486ec=path[_0xaba4('0x1e')](_0x2bb40c,_0x4429d8);if(fs[_0xaba4('0x24')](_0x3c5805)){_0x28d082[_0xaba4('0x25')]='Sent';_0x462e89['message'][_0xaba4('0x26')]=[{'filename':_0x504232,'path':_0x3c5805}];_0x462e89[_0xaba4('0x27')][_0xaba4('0x28')]=util[_0xaba4('0x16')](_0xaba4('0x29'),JSON[_0xaba4('0x2a')](_0x28d082,null,0x2));}else if(fs[_0xaba4('0x24')](_0x3486ec)){_0x28d082[_0xaba4('0x25')]='Sent';_0x462e89['message'][_0xaba4('0x26')]=[{'filename':_0x4429d8,'path':_0x3486ec}];}else{_0x462e89[_0xaba4('0x27')][_0xaba4('0x28')]=_0xaba4('0x2b');if(!_0x7da3b5[_0xaba4('0x2c')]){_0x1b8788=![];logger[_0xaba4('0xb')](_0xaba4('0x2d'));}}if(_0x1b8788){return client[_0xaba4('0x2e')]('SendMail',_0x462e89)[_0xaba4('0x2f')](function(_0x9ee6bf){if(_0x9ee6bf[_0xaba4('0x30')]){return logger[_0xaba4('0x30')](_0xaba4('0x31'),JSON[_0xaba4('0x2a')](_0x9ee6bf));}return logger[_0xaba4('0xb')](_0xaba4('0x32'));})['catch'](function(_0x58bebf){return logger[_0xaba4('0x30')]('error\x20mail',JSON[_0xaba4('0x2a')](_0x58bebf));});}};}function handleError(){return function(_0x2c3138){return logger['error'](JSON['stringify'](_0x2c3138));};}function handleResult(_0x2de847){return function(_0x1c507e){logger[_0xaba4('0xb')](_0xaba4('0x33'),JSON['stringify'](_0x1c507e));if(_0x2de847[_0xaba4('0xd')]&&_0x2de847['MailAccount'][_0xaba4('0xf')]&&!_[_0xaba4('0x34')](_0x2de847[_0xaba4('0x19')])){setTimeout(handleSendEmail(_0x2de847,_0x1c507e),0x3c*0x3e8);}};}function handleJob(_0x4dee31){return function(){try{if(_[_0xaba4('0x34')](_0x4dee31[_0xaba4('0x35')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xaba4('0x34')](_0x4dee31['subtractUnit'])){return logger[_0xaba4('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x543fcb={'startDate':moment()[_0xaba4('0x36')](_0x4dee31['subtractNumber'],_0x4dee31[_0xaba4('0x1d')])[_0xaba4('0x16')](_0xaba4('0x37')),'endDate':moment()[_0xaba4('0x16')](_0xaba4('0x37')),'type':'scheduled','output':_0x4dee31['output'],'name':_0x4dee31[_0xaba4('0x18')]};if(!_['isNil'](_0x4dee31['DefaultReportId'])){logger[_0xaba4('0xb')](_0xaba4('0x38'),_0x4dee31['DefaultReportId']);return analyticDefaultReportController[_0xaba4('0x39')]({'id':_0x4dee31[_0xaba4('0x3a')]},_0x543fcb)['then'](handleResult(_0x4dee31))[_0xaba4('0x3b')](handleError());}if(!_[_0xaba4('0x34')](_0x4dee31['CustomReportId'])){logger[_0xaba4('0xb')](_0xaba4('0x3c'),_0x4dee31[_0xaba4('0x3d')]);return analyticCustomReportController[_0xaba4('0x39')]({'id':_0x4dee31[_0xaba4('0x3d')]},_0x543fcb)['then'](handleResult(_0x4dee31))[_0xaba4('0x3b')](handleError());}}catch(_0x18d00f){logger[_0xaba4('0x30')](JSON[_0xaba4('0x2a')](_0x18d00f));}return logger['info'](_0xaba4('0x3e'));};}function getJobs(_0x2e5e4b){var _0x25c912={};if(_0x2e5e4b){_0x25c912['id']=_0x2e5e4b;}return db[_0xaba4('0x3f')]['findAll']({'where':_0x25c912,'include':[{'model':db[_0xaba4('0xd')],'attributes':['id',_0xaba4('0x18'),_0xaba4('0x19')],'include':[{'model':db['MailServerOut'],'as':_0xaba4('0xf')}]}]})[_0xaba4('0x2f')](function(_0xb2aa7c){var _0x30e8fa=_[_0xaba4('0x40')](manager[_0xaba4('0x41')]);var _0x57b7ef=_[_0xaba4('0x42')](_0xb2aa7c,function(_0x4b1833){return _0x4b1833['id'][_0xaba4('0x43')]();});var _0x50d285=_['keyBy'](_0xb2aa7c,function(_0x25c153){return _0x25c153['id'][_0xaba4('0x43')]();});var _0x33267c=_0x2e5e4b?_0x57b7ef:_[_0xaba4('0x44')](_0x57b7ef,_0x30e8fa);var _0x5ddb6a=_[_0xaba4('0x45')](_0x57b7ef,_0x30e8fa);var _0x4302f9=_[_0xaba4('0x44')](_0x30e8fa,_0x57b7ef);var _0x561f04;var _0x2f87b0;for(_0x561f04=0x0;_0x561f04<_0x4302f9[_0xaba4('0x46')]&&!_0x2e5e4b;_0x561f04+=0x1){_0x2f87b0=_0x4302f9[_0x561f04][_0xaba4('0x43')]();if(manager[_0xaba4('0x47')](_0x2f87b0)){manager[_0xaba4('0x48')](_0x2f87b0);manager[_0xaba4('0x49')](_0x2f87b0);logger[_0xaba4('0xb')](_0xaba4('0x4a'),_0x2f87b0);}}logger[_0xaba4('0xb')](_0xaba4('0x4b'),JSON[_0xaba4('0x2a')](_0x33267c));for(_0x561f04=0x0;_0x561f04<_0x33267c[_0xaba4('0x46')];_0x561f04+=0x1){_0x2f87b0=_0x33267c[_0x561f04][_0xaba4('0x43')]();logger['info'](_0xaba4('0x4c'),_0x2f87b0);if(_0x2e5e4b){logger[_0xaba4('0xb')](_0xaba4('0x4d'),_0x2e5e4b);logger[_0xaba4('0xb')](JSON['stringify'](_0x50d285[_0x2f87b0]));BPromise['resolve']()['then'](handleJob(_0x50d285[_0x2f87b0]));logger[_0xaba4('0xb')](_0xaba4('0x4e'),_0x50d285[_0x2f87b0]['name'],_0x50d285[_0x2f87b0][_0xaba4('0x4f')]);}else if(_0x50d285[_0x2f87b0][_0xaba4('0x4f')]&&_0x50d285[_0x2f87b0][_0xaba4('0x50')]&&moment()[_0xaba4('0x51')](_0x50d285[_0x2f87b0][_0xaba4('0x52')],_0x50d285[_0x2f87b0][_0xaba4('0x53')])){manager[_0xaba4('0x54')](_0x2f87b0,_0x50d285[_0x2f87b0][_0xaba4('0x4f')],handleJob(_0x50d285[_0x2f87b0]));manager[_0xaba4('0x55')](_0x2f87b0);logger[_0xaba4('0xb')]('add\x20cron',_0x50d285[_0x2f87b0][_0xaba4('0x18')],_0x50d285[_0x2f87b0][_0xaba4('0x4f')]);}else if(manager[_0xaba4('0x47')](_0x2f87b0)){manager['stop'](_0x2f87b0);manager[_0xaba4('0x49')](_0x2f87b0);logger['info']('stop\x20cron',_0x50d285[_0x2f87b0][_0xaba4('0x18')],_0x50d285[_0x2f87b0][_0xaba4('0x4f')]);}}for(_0x561f04=0x0,_0x2f87b0;_0x561f04<_0x5ddb6a[_0xaba4('0x46')]&&!_0x2e5e4b;_0x561f04+=0x1){_0x2f87b0=_0x5ddb6a[_0x561f04][_0xaba4('0x43')]();if(manager[_0xaba4('0x47')](_0x2f87b0)){if(_0x50d285[_0x2f87b0]['cron']&&_0x50d285[_0x2f87b0][_0xaba4('0x50')]&&moment()[_0xaba4('0x51')](_0x50d285[_0x2f87b0][_0xaba4('0x52')],_0x50d285[_0x2f87b0][_0xaba4('0x53')])){manager[_0xaba4('0x56')](_0x2f87b0,_0x50d285[_0x2f87b0][_0xaba4('0x4f')],handleJob(_0x50d285[_0x2f87b0]));logger['info'](_0xaba4('0x57'),_0x50d285[_0x2f87b0][_0xaba4('0x18')],_0x50d285[_0x2f87b0]['cron']);}else{manager[_0xaba4('0x48')](_0x2f87b0);manager[_0xaba4('0x49')](_0x2f87b0);logger[_0xaba4('0xb')](_0xaba4('0x58'),_0x50d285[_0x2f87b0][_0xaba4('0x18')],_0x50d285[_0x2f87b0]['cron']);}}}})[_0xaba4('0x3b')](function(_0x2443e1){logger[_0xaba4('0x30')](JSON[_0xaba4('0x2a')](_0x2443e1));});}exports[_0xaba4('0x59')]=function(_0x4c3da7){return getJobs(_0x4c3da7);};exports['start']=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 a46787c..ca21ad4 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 _0xffaa=['Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Mixed','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','findOne','transcribeAccountId','Cloud\x20Provider\x20not\x20configured','push','all','error','start','lodash','aws-sdk','request-promise','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','info','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','bucket','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','language','Sentiment','SentimentScore','Positive','Negative'];(function(_0x42a0b7,_0x528781){var _0x5170cc=function(_0x5c56c0){while(--_0x5c56c0){_0x42a0b7['push'](_0x42a0b7['shift']());}};_0x5170cc(++_0x528781);}(_0xffaa,0x130));var _0xaffa=function(_0x905c47,_0xa5a5c4){_0x905c47=_0x905c47-0x0;var _0x267599=_0xffaa[_0x905c47];return _0x267599;};var _=require(_0xaffa('0x0'));var AWS=require(_0xaffa('0x1'));var rp=require(_0xaffa('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require(_0xaffa('0x3'))['db'];var logger=require(_0xaffa('0x4'))(_0xaffa('0x5'));function getTranscriptionJob(_0xd01185,_0x444eef,_0x46692a,_0x189c6a){return new Promise(function(_0x40a369,_0x4306c0){var _0x281191=new AWS['TranscribeService']({'accessKeyId':_0x444eef,'secretAccessKey':_0xd01185,'region':_0x46692a});_0x281191[_0xaffa('0x6')]({'TranscriptionJobName':_0x189c6a},function(_0x7c018f,_0x10be9f){if(_0x7c018f){return _0x4306c0(_0x7c018f);}else{return _0x40a369(_0x10be9f);}});});}function sentiment(_0x3c7409,_0x5d2ebb,_0x32eeca,_0x53c918,_0x1d5f19){return new Promise(function(_0x1a7e4a,_0xb00c87){var _0x4f81b3=new AWS[(_0xaffa('0x7'))]({'accessKeyId':_0x5d2ebb,'secretAccessKey':_0x3c7409,'region':_0x32eeca});_0x4f81b3['detectSentiment']({'Text':_0x53c918,'LanguageCode':_0x1d5f19['substring'](0x0,0x2)},function(_0x5b0abd,_0x2aa1a4){if(_0x5b0abd){return _0xb00c87(_0x5b0abd);}else{return _0x1a7e4a(_0x2aa1a4);}});});}function checkTranscribeJob(_0x5efbe8,_0x2ba362,_0x54f27f){var _0x3806e9;return new BPromise(function(_0x576751,_0x25284e){logger['info'](util[_0xaffa('0x8')](_0xaffa('0x9'),_0x5efbe8['id'],_0x5efbe8[_0xaffa('0xa')]));return getTranscriptionJob(_0x54f27f[_0xaffa('0xb')],_0x54f27f[_0xaffa('0xc')],_0x2ba362[_0xaffa('0xd')],_0x5efbe8[_0xaffa('0xa')])[_0xaffa('0xe')](function(_0x5cc262){logger[_0xaffa('0xf')](util[_0xaffa('0x8')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x5efbe8['id'],_0x5efbe8[_0xaffa('0xa')],_0x5cc262['TranscriptionJob'][_0xaffa('0x10')]));if(!_0x5efbe8[_0xaffa('0x11')]){switch(_0x5cc262[_0xaffa('0x12')][_0xaffa('0x10')]){case _0xaffa('0x13'):var _0x46d0b1={'transcribeStatus':_0x5cc262['TranscriptionJob'][_0xaffa('0x10')],'fileUri':_0x5cc262[_0xaffa('0x12')][_0xaffa('0x14')][_0xaffa('0x15')]};logger[_0xaffa('0xf')](util[_0xaffa('0x8')](_0xaffa('0x16'),_0x5efbe8['id']));return rp({'uri':_0x5cc262['TranscriptionJob']['Transcript'][_0xaffa('0x15')],'json':!![]})[_0xaffa('0xe')](function(_0x45c856){logger[_0xaffa('0xf')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x5efbe8['id']));if(_0x45c856&&_0x45c856[_0xaffa('0x17')]&&_0x45c856[_0xaffa('0x17')]['transcripts']&&_0x45c856[_0xaffa('0x17')][_0xaffa('0x18')][_0xaffa('0x19')]){_0x46d0b1[_0xaffa('0x11')]='';for(var _0x1d83ce=0x0;_0x1d83ce<_0x45c856[_0xaffa('0x17')]['transcripts'][_0xaffa('0x19')];_0x1d83ce++){_0x46d0b1[_0xaffa('0x11')]+=_0x45c856['results']['transcripts'][_0x1d83ce][_0xaffa('0x1a')]+'';}}return _0x5efbe8[_0xaffa('0x1b')](_0x46d0b1);})[_0xaffa('0xe')](function(){logger[_0xaffa('0xf')](util[_0xaffa('0x8')](_0xaffa('0x1c'),_0x5efbe8['id']));if(!_0x5efbe8[_0xaffa('0x1d')]){throw new db[(_0xaffa('0x1e'))][(_0xaffa('0x1f'))](_0xaffa('0x20'));}if(!_0x2ba362[_0xaffa('0x21')]||!_0x2ba362[_0xaffa('0x22')]||!_0x2ba362['sentimentRegion']||!_0x2ba362['language']||!_0x2ba362[_0xaffa('0x23')]){throw new db[(_0xaffa('0x1e'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x46d0b1['fileText']){throw new Error(_0xaffa('0x24'));}if(_0x2ba362[_0xaffa('0x22')]===_0x54f27f['id']){return _0x54f27f;}else{return db[_0xaffa('0x25')]['findOne']({'where':{'id':_settings[_0xaffa('0x22')]}});}})[_0xaffa('0xe')](function(_0x1f9ed2){if(!_0x1f9ed2){throw new db[(_0xaffa('0x1e'))][(_0xaffa('0x1f'))](_0xaffa('0x26'));}if(!_0x1f9ed2[_0xaffa('0xb')]||!_0x1f9ed2[_0xaffa('0xc')]){throw new db[(_0xaffa('0x1e'))][(_0xaffa('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x3806e9=_0x1f9ed2;logger[_0xaffa('0xf')](util[_0xaffa('0x8')](_0xaffa('0x27'),_0x5efbe8['id']));return sentiment(_0x3806e9[_0xaffa('0xb')],_0x3806e9[_0xaffa('0xc')],_0x2ba362[_0xaffa('0x28')],_0x46d0b1[_0xaffa('0x11')],_0x2ba362[_0xaffa('0x29')]);})['then'](function(_0x4d91bf){logger[_0xaffa('0xf')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x5efbe8['id']));return _0x5efbe8[_0xaffa('0x1b')]({'sentiment':_0x4d91bf[_0xaffa('0x2a')],'sPositive':_0x4d91bf[_0xaffa('0x2b')][_0xaffa('0x2c')],'sNegative':_0x4d91bf['SentimentScore'][_0xaffa('0x2d')],'sMixed':_0x4d91bf[_0xaffa('0x2b')]['Mixed'],'sNeutral':_0x4d91bf[_0xaffa('0x2b')][_0xaffa('0x2e')]});})['then'](function(){logger['info'](util[_0xaffa('0x8')](_0xaffa('0x1c'),_0x5efbe8['id']));_0x576751();});case _0xaffa('0x2f'):return _0x5efbe8[_0xaffa('0x1b')]({'transcribeStatus':_0xaffa('0x2f'),'failureReason':_0x5cc262['TranscriptionJob']['FailureReason']})[_0xaffa('0xe')](function(){logger[_0xaffa('0xf')](util['format'](_0xaffa('0x1c'),_0x5efbe8['id']));_0x576751();});default:logger[_0xaffa('0xf')](util[_0xaffa('0x8')](_0xaffa('0x30'),_0x5efbe8['id']));break;}}else{return BPromise[_0xaffa('0x31')]()['then'](function(){if(!_0x5efbe8[_0xaffa('0x1d')]){throw new db['Sequelize'][(_0xaffa('0x1f'))](_0xaffa('0x20'));}if(!_0x2ba362[_0xaffa('0x21')]||!_0x2ba362['sentimentAccountId']||!_0x2ba362['sentimentRegion']||!_0x2ba362['language']||!_0x2ba362[_0xaffa('0x23')]){throw new db[(_0xaffa('0x1e'))][(_0xaffa('0x1f'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5efbe8[_0xaffa('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x2ba362[_0xaffa('0x22')]===_0x54f27f['id']){return _0x54f27f;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0xaffa('0x22')]}});}})[_0xaffa('0xe')](function(_0x2cbb42){if(!_0x2cbb42){throw new db[(_0xaffa('0x1e'))][(_0xaffa('0x1f'))](_0xaffa('0x26'));}if(!_0x2cbb42[_0xaffa('0xb')]||!_0x2cbb42[_0xaffa('0xc')]){throw new db[(_0xaffa('0x1e'))][(_0xaffa('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x3806e9=_0x2cbb42;logger[_0xaffa('0xf')](util[_0xaffa('0x8')](_0xaffa('0x27'),_0x5efbe8['id']));return sentiment(_0x3806e9[_0xaffa('0xb')],_0x3806e9[_0xaffa('0xc')],_0x2ba362[_0xaffa('0x28')],_0x5efbe8[_0xaffa('0x11')],_0x2ba362[_0xaffa('0x29')]);})['then'](function(_0x3a4c33){logger['info'](util[_0xaffa('0x8')](_0xaffa('0x32'),_0x5efbe8['id']));return _0x5efbe8[_0xaffa('0x1b')]({'sentiment':_0x3a4c33[_0xaffa('0x2a')],'sPositive':_0x3a4c33['SentimentScore']['Positive'],'sNegative':_0x3a4c33[_0xaffa('0x2b')]['Negative'],'sMixed':_0x3a4c33[_0xaffa('0x2b')][_0xaffa('0x33')],'sNeutral':_0x3a4c33['SentimentScore'][_0xaffa('0x2e')],'transcribeStatus':_0xaffa('0x13')});})[_0xaffa('0xe')](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5efbe8['id']));_0x576751();});}})[_0xaffa('0x34')](function(_0x4cb2ec){if(_0x4cb2ec){if(!_0x4cb2ec[_0xaffa('0x35')]||_0x4cb2ec[_0xaffa('0x35')]!==_0xaffa('0x36')){logger['error'](util[_0xaffa('0x8')](_0xaffa('0x37'),_0x5efbe8['id']),util[_0xaffa('0x38')](_0x4cb2ec,{'showHidden':![],'depth':null}));}}_0x576751();});});}function checkTranscribe(){var _0x3f47c5;var _0x46248c;var _0x5e0029;return db[_0xaffa('0x39')][_0xaffa('0x3a')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x5d3cd9){if(!_0x5d3cd9||!_0x5d3cd9[_0xaffa('0x19')]){throw new db[(_0xaffa('0x1e'))][(_0xaffa('0x1f'))](_0xaffa('0x3b'));}_0x3f47c5=_0x5d3cd9;return db[_0xaffa('0x3c')]['findOne']({'where':{'id':0x1}});})[_0xaffa('0xe')](function(_0x3a69cb){if(!_0x3a69cb){throw new db[(_0xaffa('0x1e'))][(_0xaffa('0x1f'))](_0xaffa('0x3d'));}_0x46248c=_0x3a69cb;if(!_0x46248c[_0xaffa('0x5')]||!_0x46248c['transcribeAccountId']||!_0x46248c[_0xaffa('0xd')]||!_0x46248c['language']||!_0x46248c[_0xaffa('0x23')]){throw new db[(_0xaffa('0x1e'))]['ValidationError'](_0xaffa('0x3e'));}return db['CloudProvider'][_0xaffa('0x3f')]({'where':{'id':_0x46248c[_0xaffa('0x40')]}});})[_0xaffa('0xe')](function(_0x3347ee){if(!_0x3347ee){throw new db[(_0xaffa('0x1e'))][(_0xaffa('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3347ee[_0xaffa('0xb')]||!_0x3347ee['data2']){throw new db['Sequelize'][(_0xaffa('0x1f'))](_0xaffa('0x41'));}_0x5e0029=_0x3347ee;var _0x11c1ac=[];_0x3f47c5['forEach'](function(_0x806817){_0x11c1ac[_0xaffa('0x42')](checkTranscribeJob(_0x806817,_0x46248c,_0x5e0029));});return BPromise[_0xaffa('0x43')](_0x11c1ac);})[_0xaffa('0x34')](function(_0x2905a8){if(_0x2905a8){if(!_0x2905a8['name']||_0x2905a8[_0xaffa('0x35')]!==_0xaffa('0x36')){logger[_0xaffa('0x44')](util[_0xaffa('0x38')](_0x2905a8,{'showHidden':![],'depth':null}));}}});}exports[_0xaffa('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x7033=['Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','tempSentiment','SequelizeValidationError','error','inspect','VoiceRecording','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','catch','name','start','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','Transcript','TranscriptFileUri','transcripts','results','length','transcript','update','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','Negative','SentimentScore','Mixed'];(function(_0x2e6b70,_0x555b6e){var _0x181f91=function(_0x179a73){while(--_0x179a73){_0x2e6b70['push'](_0x2e6b70['shift']());}};_0x181f91(++_0x555b6e);}(_0x7033,0x19e));var _0x3703=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7033[_0x4b369d];return _0x571a98;};var _=require(_0x3703('0x0'));var AWS=require(_0x3703('0x1'));var rp=require(_0x3703('0x2'));var util=require(_0x3703('0x3'));var BPromise=require('bluebird');var db=require(_0x3703('0x4'))['db'];var logger=require(_0x3703('0x5'))(_0x3703('0x6'));function getTranscriptionJob(_0x2f080e,_0x4102da,_0xab35c3,_0x3fb885){return new Promise(function(_0x283af9,_0x1170b6){var _0xb3a377=new AWS['TranscribeService']({'accessKeyId':_0x4102da,'secretAccessKey':_0x2f080e,'region':_0xab35c3});_0xb3a377['getTranscriptionJob']({'TranscriptionJobName':_0x3fb885},function(_0x4ca371,_0x12c111){if(_0x4ca371){return _0x1170b6(_0x4ca371);}else{return _0x283af9(_0x12c111);}});});}function sentiment(_0x16d296,_0x481d8c,_0x41ba6e,_0x97fbf8,_0x5b252d){return new Promise(function(_0x6acdb7,_0x367148){var _0x28e18d=new AWS['Comprehend']({'accessKeyId':_0x481d8c,'secretAccessKey':_0x16d296,'region':_0x41ba6e});_0x28e18d['detectSentiment']({'Text':_0x97fbf8,'LanguageCode':_0x5b252d[_0x3703('0x7')](0x0,0x2)},function(_0x5b898d,_0x3074ab){if(_0x5b898d){return _0x367148(_0x5b898d);}else{return _0x6acdb7(_0x3074ab);}});});}function checkTranscribeJob(_0x21361e,_0x31c0df,_0x41af55){var _0x520ce3;return new BPromise(function(_0x5b13ee,_0x3fcc9b){logger[_0x3703('0x8')](util[_0x3703('0x9')](_0x3703('0xa'),_0x21361e['id'],_0x21361e[_0x3703('0xb')]));return getTranscriptionJob(_0x41af55[_0x3703('0xc')],_0x41af55[_0x3703('0xd')],_0x31c0df[_0x3703('0xe')],_0x21361e[_0x3703('0xb')])[_0x3703('0xf')](function(_0x3a8a89){logger[_0x3703('0x8')](util[_0x3703('0x9')](_0x3703('0x10'),_0x21361e['id'],_0x21361e['transcribeName'],_0x3a8a89[_0x3703('0x11')]['TranscriptionJobStatus']));if(!_0x21361e[_0x3703('0x12')]){switch(_0x3a8a89['TranscriptionJob'][_0x3703('0x13')]){case'COMPLETED':var _0x176ddc={'transcribeStatus':_0x3a8a89[_0x3703('0x11')]['TranscriptionJobStatus'],'fileUri':_0x3a8a89[_0x3703('0x11')][_0x3703('0x14')][_0x3703('0x15')]};logger[_0x3703('0x8')](util[_0x3703('0x9')]('[RECORDING:%d]\x20Get\x20transcript',_0x21361e['id']));return rp({'uri':_0x3a8a89[_0x3703('0x11')][_0x3703('0x14')][_0x3703('0x15')],'json':!![]})['then'](function(_0x386c4a){logger[_0x3703('0x8')](util[_0x3703('0x9')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x21361e['id']));if(_0x386c4a&&_0x386c4a['results']&&_0x386c4a['results'][_0x3703('0x16')]&&_0x386c4a[_0x3703('0x17')][_0x3703('0x16')][_0x3703('0x18')]){_0x176ddc['fileText']='';for(var _0x4fe6dd=0x0;_0x4fe6dd<_0x386c4a[_0x3703('0x17')]['transcripts']['length'];_0x4fe6dd++){_0x176ddc[_0x3703('0x12')]+=_0x386c4a[_0x3703('0x17')]['transcripts'][_0x4fe6dd][_0x3703('0x19')]+'';}}return _0x21361e[_0x3703('0x1a')](_0x176ddc);})[_0x3703('0xf')](function(){logger[_0x3703('0x8')](util[_0x3703('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x21361e['id']));if(!_0x21361e['tempSentiment']){throw new db[(_0x3703('0x1b'))]['ValidationError'](_0x3703('0x1c'));}if(!_0x31c0df[_0x3703('0x1d')]||!_0x31c0df['sentimentAccountId']||!_0x31c0df['sentimentRegion']||!_0x31c0df[_0x3703('0x1e')]||!_0x31c0df[_0x3703('0x1f')]){throw new db[(_0x3703('0x1b'))][(_0x3703('0x20'))](_0x3703('0x21'));}if(!_0x176ddc[_0x3703('0x12')]){throw new Error(_0x3703('0x22'));}if(_0x31c0df[_0x3703('0x23')]===_0x41af55['id']){return _0x41af55;}else{return db[_0x3703('0x24')][_0x3703('0x25')]({'where':{'id':_settings[_0x3703('0x23')]}});}})['then'](function(_0x244f74){if(!_0x244f74){throw new db[(_0x3703('0x1b'))][(_0x3703('0x20'))](_0x3703('0x26'));}if(!_0x244f74[_0x3703('0xc')]||!_0x244f74[_0x3703('0xd')]){throw new db[(_0x3703('0x1b'))][(_0x3703('0x20'))](_0x3703('0x27'));}_0x520ce3=_0x244f74;logger[_0x3703('0x8')](util[_0x3703('0x9')](_0x3703('0x28'),_0x21361e['id']));return sentiment(_0x520ce3[_0x3703('0xc')],_0x520ce3[_0x3703('0xd')],_0x31c0df[_0x3703('0x29')],_0x176ddc[_0x3703('0x12')],_0x31c0df[_0x3703('0x1e')]);})[_0x3703('0xf')](function(_0x33134a){logger[_0x3703('0x8')](util[_0x3703('0x9')](_0x3703('0x2a'),_0x21361e['id']));return _0x21361e['update']({'sentiment':_0x33134a[_0x3703('0x2b')],'sPositive':_0x33134a['SentimentScore'][_0x3703('0x2c')],'sNegative':_0x33134a['SentimentScore'][_0x3703('0x2d')],'sMixed':_0x33134a[_0x3703('0x2e')][_0x3703('0x2f')],'sNeutral':_0x33134a[_0x3703('0x2e')][_0x3703('0x30')]});})['then'](function(){logger[_0x3703('0x8')](util['format'](_0x3703('0x31'),_0x21361e['id']));_0x5b13ee();});case _0x3703('0x32'):return _0x21361e[_0x3703('0x1a')]({'transcribeStatus':'FAILED','failureReason':_0x3a8a89[_0x3703('0x11')]['FailureReason']})[_0x3703('0xf')](function(){logger[_0x3703('0x8')](util[_0x3703('0x9')](_0x3703('0x31'),_0x21361e['id']));_0x5b13ee();});default:logger[_0x3703('0x8')](util[_0x3703('0x9')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x21361e['id']));break;}}else{return BPromise['resolve']()[_0x3703('0xf')](function(){if(!_0x21361e[_0x3703('0x33')]){throw new db['Sequelize'][(_0x3703('0x20'))](_0x3703('0x1c'));}if(!_0x31c0df[_0x3703('0x1d')]||!_0x31c0df[_0x3703('0x23')]||!_0x31c0df[_0x3703('0x29')]||!_0x31c0df[_0x3703('0x1e')]||!_0x31c0df[_0x3703('0x1f')]){throw new db[(_0x3703('0x1b'))][(_0x3703('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x21361e['fileText']){throw new Error(_0x3703('0x22'));}if(_0x31c0df[_0x3703('0x23')]===_0x41af55['id']){return _0x41af55;}else{return db['CloudProvider'][_0x3703('0x25')]({'where':{'id':_settings[_0x3703('0x23')]}});}})[_0x3703('0xf')](function(_0x333c51){if(!_0x333c51){throw new db[(_0x3703('0x1b'))][(_0x3703('0x20'))](_0x3703('0x26'));}if(!_0x333c51[_0x3703('0xc')]||!_0x333c51[_0x3703('0xd')]){throw new db['Sequelize']['ValidationError'](_0x3703('0x27'));}_0x520ce3=_0x333c51;logger['info'](util['format'](_0x3703('0x28'),_0x21361e['id']));return sentiment(_0x520ce3[_0x3703('0xc')],_0x520ce3[_0x3703('0xd')],_0x31c0df[_0x3703('0x29')],_0x21361e[_0x3703('0x12')],_0x31c0df[_0x3703('0x1e')]);})[_0x3703('0xf')](function(_0x47dcb1){logger[_0x3703('0x8')](util[_0x3703('0x9')](_0x3703('0x2a'),_0x21361e['id']));return _0x21361e[_0x3703('0x1a')]({'sentiment':_0x47dcb1['Sentiment'],'sPositive':_0x47dcb1['SentimentScore'][_0x3703('0x2c')],'sNegative':_0x47dcb1[_0x3703('0x2e')][_0x3703('0x2d')],'sMixed':_0x47dcb1[_0x3703('0x2e')][_0x3703('0x2f')],'sNeutral':_0x47dcb1[_0x3703('0x2e')][_0x3703('0x30')],'transcribeStatus':'COMPLETED'});})[_0x3703('0xf')](function(){logger[_0x3703('0x8')](util[_0x3703('0x9')](_0x3703('0x31'),_0x21361e['id']));_0x5b13ee();});}})['catch'](function(_0x59a06e){if(_0x59a06e){if(!_0x59a06e['name']||_0x59a06e['name']!==_0x3703('0x34')){logger[_0x3703('0x35')](util[_0x3703('0x9')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x21361e['id']),util[_0x3703('0x36')](_0x59a06e,{'showHidden':![],'depth':null}));}}_0x5b13ee();});});}function checkTranscribe(){var _0x4d824d;var _0x31e455;var _0x2ab470;return db[_0x3703('0x37')]['findAll']({'where':{'transcribeStatus':_0x3703('0x38')}})[_0x3703('0xf')](function(_0x2df518){if(!_0x2df518||!_0x2df518[_0x3703('0x18')]){throw new db['Sequelize']['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x4d824d=_0x2df518;return db[_0x3703('0x39')]['findOne']({'where':{'id':0x1}});})[_0x3703('0xf')](function(_0x528db8){if(!_0x528db8){throw new db[(_0x3703('0x1b'))]['ValidationError'](_0x3703('0x3a'));}_0x31e455=_0x528db8;if(!_0x31e455[_0x3703('0x6')]||!_0x31e455[_0x3703('0x3b')]||!_0x31e455['transcribeRegion']||!_0x31e455[_0x3703('0x1e')]||!_0x31e455[_0x3703('0x1f')]){throw new db[(_0x3703('0x1b'))][(_0x3703('0x20'))](_0x3703('0x3c'));}return db['CloudProvider'][_0x3703('0x25')]({'where':{'id':_0x31e455['transcribeAccountId']}});})[_0x3703('0xf')](function(_0x4a09f8){if(!_0x4a09f8){throw new db[(_0x3703('0x1b'))][(_0x3703('0x20'))](_0x3703('0x26'));}if(!_0x4a09f8[_0x3703('0xc')]||!_0x4a09f8['data2']){throw new db['Sequelize'][(_0x3703('0x20'))](_0x3703('0x27'));}_0x2ab470=_0x4a09f8;var _0x168437=[];_0x4d824d[_0x3703('0x3d')](function(_0x38ef4d){_0x168437['push'](checkTranscribeJob(_0x38ef4d,_0x31e455,_0x2ab470));});return BPromise[_0x3703('0x3e')](_0x168437);})[_0x3703('0x3f')](function(_0x3ad43a){if(_0x3ad43a){if(!_0x3ad43a[_0x3703('0x40')]||_0x3ad43a[_0x3703('0x40')]!==_0x3703('0x34')){logger['error'](util[_0x3703('0x36')](_0x3ad43a,{'showHidden':![],'depth':null}));}}});}exports[_0x3703('0x41')]=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 e460cd9..deefc80 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 _0x287f=['join','WhatsappInteraction','update','system','timeout','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','findAll','lastMsgAt','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:'];(function(_0x3124f8,_0x1a8b23){var _0x5bab5f=function(_0x18b09b){while(--_0x18b09b){_0x3124f8['push'](_0x3124f8['shift']());}};_0x5bab5f(++_0x1a8b23);}(_0x287f,0xc7));var _0xf287=function(_0x4f0427,_0x12d79b){_0x4f0427=_0x4f0427-0x0;var _0x308901=_0x287f[_0x4f0427];return _0x308901;};'use strict';var _=require(_0xf287('0x0'));var moment=require(_0xf287('0x1'));var Redis=require(_0xf287('0x2'));var util=require(_0xf287('0x3'));var config=require(_0xf287('0x4'));var db=require(_0xf287('0x5'))['db'];var logger=require(_0xf287('0x6'))(_0xf287('0x7'));config['redis']=_[_0xf287('0x8')](config[_0xf287('0x9')],{'host':_0xf287('0xa'),'port':0x18eb});var io=require(_0xf287('0xb'))(new Redis(config[_0xf287('0x9')]));function closeInteractions(){var _0x53f0ef=[];return db['WhatsappInteraction'][_0xf287('0xc')]({'raw':!![],'attributes':['id',_0xf287('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,'hours')}}})['then'](function(_0x542ccb){if(_0x542ccb&&_0x542ccb[_0xf287('0xe')]){_0x53f0ef=_[_0xf287('0xf')](_0x542ccb||[],'id');logger[_0xf287('0x10')](_0xf287('0x11'),_0x53f0ef[_0xf287('0x12')]());return db[_0xf287('0x13')][_0xf287('0x14')]({'closeReason':_0xf287('0x15'),'disposition':_0xf287('0x16'),'closed':!![],'closedAt':moment()[_0xf287('0x17')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x53f0ef}});}})['then'](function(){if(_0x53f0ef&&_0x53f0ef['length']){logger['info'](_0xf287('0x18'),_0x53f0ef[_0xf287('0x12')]());for(var _0x141cfb=0x0;_0x141cfb<_0x53f0ef[_0xf287('0xe')];_0x141cfb++){io[_0xf287('0x19')]('whatsappInteraction:update',{'id':_0x53f0ef[_0x141cfb],'closed':!![]});}}})[_0xf287('0x1a')](function(_0x5ae4ce){logger[_0xf287('0x1b')](_0xf287('0x1c'),_0x5ae4ce?util[_0xf287('0x1d')](_0x5ae4ce,{'showHidden':![],'depth':null}):'');});}exports[_0xf287('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x0330=['join','emit','whatsappInteraction:update','catch','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','findAll','subtract','hours','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','WhatsappInteraction','update','timeout','format','then'];(function(_0x33c637,_0x597c26){var _0x14aa20=function(_0x32a8b5){while(--_0x32a8b5){_0x33c637['push'](_0x33c637['shift']());}};_0x14aa20(++_0x597c26);}(_0x0330,0x172));var _0x0033=function(_0x26dea2,_0x3ca3e6){_0x26dea2=_0x26dea2-0x0;var _0x286bdc=_0x0330[_0x26dea2];return _0x286bdc;};'use strict';var _=require(_0x0033('0x0'));var moment=require('moment');var Redis=require(_0x0033('0x1'));var util=require(_0x0033('0x2'));var config=require(_0x0033('0x3'));var db=require(_0x0033('0x4'))['db'];var logger=require('../logger')(_0x0033('0x5'));config[_0x0033('0x6')]=_[_0x0033('0x7')](config[_0x0033('0x6')],{'host':_0x0033('0x8'),'port':0x18eb});var io=require(_0x0033('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x5cbc64=[];return db['WhatsappInteraction'][_0x0033('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x0033('0xb')](0x18,_0x0033('0xc'))}}})['then'](function(_0x59994e){if(_0x59994e&&_0x59994e[_0x0033('0xd')]){_0x5cbc64=_[_0x0033('0xe')](_0x59994e||[],'id');logger[_0x0033('0xf')](_0x0033('0x10'),_0x5cbc64['join']());return db[_0x0033('0x11')][_0x0033('0x12')]({'closeReason':'system','disposition':_0x0033('0x13'),'closed':!![],'closedAt':moment()[_0x0033('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x5cbc64}});}})[_0x0033('0x15')](function(){if(_0x5cbc64&&_0x5cbc64[_0x0033('0xd')]){logger[_0x0033('0xf')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x5cbc64[_0x0033('0x16')]());for(var _0x3a7416=0x0;_0x3a7416<_0x5cbc64[_0x0033('0xd')];_0x3a7416++){io[_0x0033('0x17')](_0x0033('0x18'),{'id':_0x5cbc64[_0x3a7416],'closed':!![]});}}})[_0x0033('0x19')](function(_0x1a5030){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x1a5030?util[_0x0033('0x1a')](_0x1a5030,{'showHidden':![],'depth':null}):'');});}exports[_0x0033('0x1b')]=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 462275b..40f6c5a 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3953=['then','CmContact','bulkCreate','finished\x20populating','CmHopper','log','hopper1','contacts2','hopper2','catch','Biondo','innocenzo.biondo','@xcally.com','push','now','Innocenzo','destroy'];(function(_0x2539ce,_0x3850f0){var _0x561388=function(_0x3cc2c7){while(--_0x3cc2c7){_0x2539ce['push'](_0x2539ce['shift']());}};_0x561388(++_0x3850f0);}(_0x3953,0xe7));var _0x3395=function(_0x51701b,_0x50777d){_0x51701b=_0x51701b-0x0;var _0x4c58f9=_0x3953[_0x51701b];return _0x4c58f9;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x3395('0x0')+i,'phone':0xf879fb460+i,'email':_0x3395('0x1')+i+_0x3395('0x2')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x3395('0x3')]({'id':i,'active':![],'scheduledat':Date[_0x3395('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3395('0x4')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x3395('0x3')]({'id':i,'firstName':_0x3395('0x5')+i,'lastName':_0x3395('0x0')+i,'phone':0xf879fb460+i,'email':_0x3395('0x1')+i+_0x3395('0x2')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3395('0x3')]({'id':i,'active':![],'scheduledat':Date[_0x3395('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3395('0x4')](),'updatedAt':Date[_0x3395('0x4')]()});}db['CmContact'][_0x3395('0x6')]({'where':{}})[_0x3395('0x7')](function(){return db[_0x3395('0x8')][_0x3395('0x9')](contacts);})[_0x3395('0x7')](function(){console['log'](_0x3395('0xa'),'contacts1');return db[_0x3395('0xb')][_0x3395('0x6')]({'where':{}});})[_0x3395('0x7')](function(){return db[_0x3395('0xb')]['bulkCreate'](hopper);})['then'](function(){console[_0x3395('0xc')](_0x3395('0xa'),_0x3395('0xd'));return db[_0x3395('0x8')][_0x3395('0x9')](contacts2);})[_0x3395('0x7')](function(){console['log']('finished\x20populating',_0x3395('0xe'));return db[_0x3395('0xb')][_0x3395('0x9')](hopper2);})[_0x3395('0x7')](function(){console[_0x3395('0xc')](_0x3395('0xa'),_0x3395('0xf'));})[_0x3395('0x10')](function(_0x279965){console[_0x3395('0xc')](_0x279965);}); \ No newline at end of file +var _0x28e7=['contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','@xcally.com','now','Biondo','innocenzo.biondo','then','bulkCreate','contacts1','CmHopper','destroy','log','finished\x20populating','hopper1','CmContact'];(function(_0xca6139,_0x3a55a7){var _0x1d6619=function(_0xea1dd1){while(--_0xea1dd1){_0xca6139['push'](_0xca6139['shift']());}};_0x1d6619(++_0x3a55a7);}(_0x28e7,0x193));var _0x728e=function(_0x2fa8af,_0x43829b){_0x2fa8af=_0x2fa8af-0x0;var _0x51fb92=_0x28e7[_0x2fa8af];return _0x51fb92;};'use strict';var util=require(_0x728e('0x0'));var db=require(_0x728e('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x728e('0x2')]({'id':i,'firstName':_0x728e('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x728e('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x728e('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x728e('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x728e('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x728e('0x3')+i,'lastName':_0x728e('0x6')+i,'phone':0xf879fb460+i,'email':_0x728e('0x7')+i+_0x728e('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x728e('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x728e('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x728e('0x5')](),'updatedAt':Date[_0x728e('0x5')]()});}db['CmContact']['destroy']({'where':{}})[_0x728e('0x8')](function(){return db['CmContact'][_0x728e('0x9')](contacts);})['then'](function(){console['log']('finished\x20populating',_0x728e('0xa'));return db[_0x728e('0xb')][_0x728e('0xc')]({'where':{}});})[_0x728e('0x8')](function(){return db['CmHopper'][_0x728e('0x9')](hopper);})['then'](function(){console[_0x728e('0xd')](_0x728e('0xe'),_0x728e('0xf'));return db[_0x728e('0x10')]['bulkCreate'](contacts2);})[_0x728e('0x8')](function(){console['log'](_0x728e('0xe'),_0x728e('0x11'));return db[_0x728e('0xb')]['bulkCreate'](hopper2);})[_0x728e('0x8')](function(){console[_0x728e('0xd')](_0x728e('0xe'),_0x728e('0x12'));})[_0x728e('0x13')](function(_0x582631){console[_0x728e('0xd')](_0x582631);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 20f85ba..8aa1dbd 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a28=['actpass','User','bulkCreate','add\x20user','log','util','format','%s%s','agent','%s%s@xcally.com','udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a28,0x135));var _0x89a2=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x9a28[_0xbd08b4];return _0x314f1e;};'use strict';var util=require(_0x89a2('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x89a2('0x1')](_0x89a2('0x2'),_0x89a2('0x3'),i),'fullname':util['format'](_0x89a2('0x2'),_0x89a2('0x3'),i),'email':util[_0x89a2('0x1')](_0x89a2('0x4'),'agent',i),'role':_0x89a2('0x3'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x89a2('0x5'),'ws',_0x89a2('0x6')],'disallow':[_0x89a2('0x7')],'allow':[_0x89a2('0x8')],'defaultuser':util[_0x89a2('0x1')]('%s%s',_0x89a2('0x3'),i),'encryption':_0x89a2('0x9'),'avpf':_0x89a2('0x9'),'force_avp':_0x89a2('0x9'),'icesupport':_0x89a2('0x9'),'dtlsenable':_0x89a2('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x89a2('0xa'),'dtlssetup':_0x89a2('0xb'),'callerid':util[_0x89a2('0x1')]('\x22%s\x22\x20<%s>',util[_0x89a2('0x1')](_0x89a2('0x2'),_0x89a2('0x3'),i),0xfa0+i)});}db[_0x89a2('0xc')][_0x89a2('0xd')](users)['then'](function(){console['log'](_0x89a2('0xe'));})['catch'](function(_0x4664fc){console[_0x89a2('0xf')](_0x4664fc);}); \ No newline at end of file +var _0xab4f=['User','then','add\x20user','catch','log','util','../mysqldb','push','format','%s%s','agent','password','friend','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xab4f,0xe9));var _0xfab4=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xab4f[_0x178e48];return _0x440d7e;};'use strict';var util=require(_0xfab4('0x0'));var db=require(_0xfab4('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xfab4('0x2')]({'name':util[_0xfab4('0x3')](_0xfab4('0x4'),'agent',i),'fullname':util['format'](_0xfab4('0x4'),_0xfab4('0x5'),i),'email':util[_0xfab4('0x3')]('%s%s@xcally.com','agent',i),'role':_0xfab4('0x5'),'password':_0xfab4('0x6'),'internal':0xfa0+i,'type':_0xfab4('0x7'),'transport':['udp','ws',_0xfab4('0x8')],'disallow':[_0xfab4('0x9')],'allow':[_0xfab4('0xa')],'defaultuser':util['format'](_0xfab4('0x4'),_0xfab4('0x5'),i),'encryption':_0xfab4('0xb'),'avpf':'yes','force_avp':_0xfab4('0xb'),'icesupport':_0xfab4('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xfab4('0xc'),'dtlssetup':'actpass','callerid':util[_0xfab4('0x3')](_0xfab4('0xd'),util[_0xfab4('0x3')](_0xfab4('0x4'),_0xfab4('0x5'),i),0xfa0+i)});}db[_0xfab4('0xe')]['bulkCreate'](users)[_0xfab4('0xf')](function(){console['log'](_0xfab4('0x10'));})[_0xfab4('0x11')](function(_0x38125f){console[_0xfab4('0x12')](_0x38125f);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index c154789..c3bbbb9 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1792=['handshake','userProfileId','query','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','FaxQueues','FaxQueue','Telephones','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','type','leave','removeChatInteractions','emit','MailInteractions','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','lodash','util','../mysqldb','./environment','name','Agents','role','agent','telephone','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','resourceId','map','User','where','Campaign','format','%s:queue:%s','length'];(function(_0x3287ed,_0x5ee283){var _0x1074c2=function(_0x39e6f1){while(--_0x39e6f1){_0x3287ed['push'](_0x3287ed['shift']());}};_0x1074c2(++_0x5ee283);}(_0x1792,0x111));var _0x2179=function(_0x5773ed,_0x2270ce){_0x5773ed=_0x5773ed-0x0;var _0x4a75d9=_0x1792[_0x5773ed];return _0x4a75d9;};'use strict';var _=require(_0x2179('0x0'));var util=require(_0x2179('0x1'));var BPromise=require('bluebird');var db=require(_0x2179('0x2'))['db'];var config=require(_0x2179('0x3'));var queryQueues={'attributes':['id',_0x2179('0x4')],'include':[{'as':_0x2179('0x5'),'model':db['User'],'attributes':['id',_0x2179('0x4'),_0x2179('0x6')],'raw':!![],'where':{'role':_0x2179('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x2179('0x4')],'where':{'role':_0x2179('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x2179('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x2179('0x4')],'where':{'role':_0x2179('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2179('0x4'),'type'],'where':{'type':_0x2179('0x9')}};function getAssociatedResources(_0xb59a8c,_0x3115ef,_0x2a0fb4){return db[_0x2179('0xa')]['findOne']({'where':{'name':_0xb59a8c,'userProfileId':_0x3115ef},'raw':!![]})[_0x2179('0xb')](function(_0x4f15e8){if(_0x4f15e8){if(_0x4f15e8[_0x2179('0xc')]){switch(_0xb59a8c){case _0x2179('0xd'):case _0x2179('0xe'):case'FaxQueues':case _0x2179('0xf'):case _0x2179('0x10'):case _0x2179('0x11'):case _0x2179('0x12'):return db[_0x2a0fb4]['findAll'](queryQueues);case'Telephones':return db[_0x2a0fb4][_0x2179('0x13')](queryTelephones);case _0x2179('0x14'):return db[_0x2a0fb4][_0x2179('0x13')](queryTrunks);case _0x2179('0x15'):return db[_0x2a0fb4][_0x2179('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0x2179('0x13')]({'attributes':[_0x2179('0x16')],'where':{'sectionId':_0x4f15e8['id']},'raw':!![]})[_0x2179('0xb')](function(_0x27fad4){if(_0x27fad4){var _0x1bbc8a={'where':{'id':_[_0x2179('0x17')](_0x27fad4,_0x2179('0x16'))},'raw':!![]};switch(_0x2a0fb4){case _0x2179('0x18'):_0x1bbc8a[_0x2179('0x19')][_0x2179('0x6')]='telephone';break;case _0x2179('0x1a'):_0x1bbc8a[_0x2179('0x19')]['type']=_0x2179('0x9');break;}return db[_0x2a0fb4][_0x2179('0x13')](_0x1bbc8a);}else{return[];}});}}else{return[];}})[_0x2179('0xb')](function(_0x4dbac7){return _0x4dbac7;});}function joinOrLeaveQueues(_0x529ec8,_0x58bfdb,_0x5015b7,_0x17e96a){_0x529ec8[_0x58bfdb](util[_0x2179('0x1b')](_0x2179('0x1c'),_0x5015b7,_0x17e96a['name']));if(_0x17e96a['Agents']){for(var _0x22af44=0x0;_0x22af44<_0x17e96a['Agents'][_0x2179('0x1d')];_0x22af44+=0x1){_0x529ec8[_0x58bfdb](util[_0x2179('0x1b')]('user:%s',_0x17e96a[_0x2179('0x5')][_0x22af44][_0x2179('0x4')]));}}}function joinOrLeave(_0x4a9169,_0x1e5813,_0x5137d9){var _0x5389dc;if(_0x4a9169[_0x2179('0x1e')]['query']['id']){db[_0x2179('0x18')]['find']({'attributes':['id','name',_0x2179('0x6'),_0x2179('0x1f')],'where':{'id':_0x4a9169[_0x2179('0x1e')][_0x2179('0x20')]['id']},'include':[{'model':db[_0x2179('0x21')],'as':_0x2179('0x22'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2179('0x23')],'as':_0x2179('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x2179('0x25')],'as':_0x2179('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x2179('0x27')],'as':_0x2179('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x2179('0x29')],'as':_0x2179('0x2a'),'attributes':['id'],'raw':!![]}]})[_0x2179('0xb')](function(_0x4b32ee){if(_0x4b32ee){_0x5389dc=_0x4b32ee;_0x4a9169[_0x1e5813](util['format'](_0x2179('0x2b'),_0x4b32ee[_0x2179('0x4')]));var _0x1e485c=[];switch(_0x4b32ee[_0x2179('0x6')]){case _0x2179('0x2c'):_0x4a9169[_0x1e5813](_0x2179('0x2d'));_0x4a9169[_0x1e5813](_0x2179('0x2e'));if(queryQueues[_0x2179('0x2f')](_0x2179('0x30'))){delete queryQueues[_0x2179('0x30')];}_0x1e485c[_0x2179('0x31')](db[_0x2179('0x32')][_0x2179('0x13')](queryQueues));_0x1e485c[_0x2179('0x31')](db[_0x2179('0x33')]['findAll'](queryQueues));_0x1e485c[_0x2179('0x31')](db['FaxQueue'][_0x2179('0x13')](queryQueues));_0x1e485c[_0x2179('0x31')](db[_0x2179('0x34')][_0x2179('0x13')](queryQueues));_0x1e485c[_0x2179('0x31')](db[_0x2179('0x35')][_0x2179('0x13')](queryQueues));_0x1e485c[_0x2179('0x31')](db[_0x2179('0x36')][_0x2179('0x13')](queryQueues));_0x1e485c[_0x2179('0x31')](db[_0x2179('0x37')]['findAll'](queryQueues));_0x1e485c[_0x2179('0x31')](db[_0x2179('0x18')]['findAll'](queryTelephones));_0x1e485c['push'](db[_0x2179('0x38')]['findAll'](queryTrunks));_0x1e485c['push'](db[_0x2179('0x1a')][_0x2179('0x13')](queryCampaigns));_0x1e485c[_0x2179('0x31')](db[_0x2179('0x18')][_0x2179('0x13')](queryAgents));break;case'user':_0x4a9169[_0x1e5813](_0x2179('0x2d'));_0x4a9169[_0x1e5813](_0x2179('0x2e'));_0x1e485c[_0x2179('0x31')](getAssociatedResources('VoiceQueues',_0x4b32ee['userProfileId'],_0x2179('0x32')));_0x1e485c[_0x2179('0x31')](getAssociatedResources(_0x2179('0xe'),_0x4b32ee[_0x2179('0x1f')],_0x2179('0x33')));_0x1e485c[_0x2179('0x31')](getAssociatedResources(_0x2179('0x39'),_0x4b32ee[_0x2179('0x1f')],_0x2179('0x3a')));_0x1e485c[_0x2179('0x31')](getAssociatedResources(_0x2179('0xf'),_0x4b32ee['userProfileId'],_0x2179('0x34')));_0x1e485c['push'](getAssociatedResources(_0x2179('0x10'),_0x4b32ee['userProfileId'],_0x2179('0x35')));_0x1e485c[_0x2179('0x31')](getAssociatedResources(_0x2179('0x11'),_0x4b32ee['userProfileId'],'OpenchannelQueue'));_0x1e485c[_0x2179('0x31')](getAssociatedResources(_0x2179('0x12'),_0x4b32ee['userProfileId'],_0x2179('0x37')));_0x1e485c[_0x2179('0x31')](getAssociatedResources(_0x2179('0x3b'),_0x4b32ee[_0x2179('0x1f')],_0x2179('0x18')));_0x1e485c['push'](getAssociatedResources(_0x2179('0x14'),_0x4b32ee[_0x2179('0x1f')],_0x2179('0x38')));_0x1e485c[_0x2179('0x31')](getAssociatedResources('IvrCampaigns',_0x4b32ee['userProfileId'],_0x2179('0x1a')));_0x1e485c[_0x2179('0x31')](db[_0x2179('0x18')]['findAll'](queryAgents));break;case'agent':_0x4a9169[_0x1e5813](_0x2179('0x2d'));_0x4a9169[_0x1e5813](_0x2179('0x2e'));_0x1e485c[_0x2179('0x31')](_0x4b32ee['getVoiceQueues']({'attributes':['id',_0x2179('0x4')]}));_0x1e485c['push'](_0x4b32ee[_0x2179('0x3c')]({'attributes':['id',_0x2179('0x4')]}));_0x1e485c[_0x2179('0x31')](_0x4b32ee[_0x2179('0x3d')]({'attributes':['id',_0x2179('0x4')]}));_0x1e485c[_0x2179('0x31')](_0x4b32ee[_0x2179('0x3e')]({'attributes':['id',_0x2179('0x4')]}));_0x1e485c[_0x2179('0x31')](_0x4b32ee[_0x2179('0x3f')]({'attributes':['id',_0x2179('0x4')]}));_0x1e485c[_0x2179('0x31')](_0x4b32ee[_0x2179('0x40')]({'attributes':['id',_0x2179('0x4')]}));_0x1e485c['push'](_0x4b32ee[_0x2179('0x41')]({'attributes':['id',_0x2179('0x4')]}));break;}return BPromise[_0x2179('0x42')](_0x1e485c);}})[_0x2179('0xb')](function(_0x50718f){if(_0x50718f&&_0x50718f[_0x2179('0x1d')]){for(var _0x48ab9f=0x0;_0x48ab9f<_0x50718f[_0x2179('0x1d')];_0x48ab9f+=0x1){for(var _0x9781fa=0x0;_0x9781fa<_0x50718f[_0x48ab9f]['length'];_0x9781fa+=0x1){switch(_0x48ab9f){case 0x0:joinOrLeaveQueues(_0x4a9169,_0x1e5813,_0x2179('0x43'),_0x50718f[_0x48ab9f][_0x9781fa]);break;case 0x1:joinOrLeaveQueues(_0x4a9169,_0x1e5813,'chat',_0x50718f[_0x48ab9f][_0x9781fa]);break;case 0x2:joinOrLeaveQueues(_0x4a9169,_0x1e5813,_0x2179('0x44'),_0x50718f[_0x48ab9f][_0x9781fa]);break;case 0x3:joinOrLeaveQueues(_0x4a9169,_0x1e5813,'sms',_0x50718f[_0x48ab9f][_0x9781fa]);break;case 0x4:joinOrLeaveQueues(_0x4a9169,_0x1e5813,_0x2179('0x45'),_0x50718f[_0x48ab9f][_0x9781fa]);break;case 0x5:joinOrLeaveQueues(_0x4a9169,_0x1e5813,_0x2179('0x46'),_0x50718f[_0x48ab9f][_0x9781fa]);break;case 0x6:joinOrLeaveQueues(_0x4a9169,_0x1e5813,_0x2179('0x47'),_0x50718f[_0x48ab9f][_0x9781fa]);break;case 0x7:if(_0x5389dc['role']!==_0x2179('0x7'))_0x4a9169[_0x1e5813](util[_0x2179('0x1b')](_0x2179('0x48'),_0x50718f[_0x48ab9f][_0x9781fa][_0x2179('0x4')]));break;case 0x8:if(_0x5389dc[_0x2179('0x6')]!==_0x2179('0x7'))_0x4a9169[_0x1e5813](util['format'](_0x2179('0x49'),_0x50718f[_0x48ab9f][_0x9781fa][_0x2179('0x4')]));break;case 0x9:if(_0x5389dc[_0x2179('0x6')]!==_0x2179('0x7'))_0x4a9169[_0x1e5813](util[_0x2179('0x1b')](_0x2179('0x4a'),_0x50718f[_0x48ab9f][_0x9781fa][_0x2179('0x4b')],_0x50718f[_0x48ab9f][_0x9781fa][_0x2179('0x4')]));break;case 0xa:_0x4a9169[_0x1e5813](util['format'](_0x2179('0x2b'),_0x50718f[_0x48ab9f][_0x9781fa]['name']));break;}}}}})[_0x2179('0xb')](function(){if(_0x1e5813===_0x2179('0x4c')){var _0x4026df=_[_0x2179('0x17')](_0x5389dc['ChatInteractions'],'id');return _0x5389dc[_0x2179('0x4d')](_0x4026df)['then'](function(){for(var _0xf61832=0x0;_0xf61832<_0x4026df['length'];_0xf61832+=0x1){_0x5137d9[_0x2179('0x4e')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x4026df[_0xf61832]),'UserId':Number(_0x5389dc['id'])});}});}})['then'](function(){if(_0x1e5813===_0x2179('0x4c')){var _0x296f24=_[_0x2179('0x17')](_0x5389dc[_0x2179('0x4f')],'id');return _0x5389dc[_0x2179('0x50')](_0x296f24)[_0x2179('0xb')](function(){for(var _0x1f80c1=0x0;_0x1f80c1<_0x296f24['length'];_0x1f80c1+=0x1){_0x5137d9[_0x2179('0x4e')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x296f24[_0x1f80c1]),'UserId':Number(_0x5389dc['id'])});}});}})['then'](function(){if(_0x1e5813===_0x2179('0x4c')){var _0x5b050f=_[_0x2179('0x17')](_0x5389dc[_0x2179('0x24')],'id');return _0x5389dc[_0x2179('0x51')](_0x5b050f)[_0x2179('0xb')](function(){for(var _0x55edd1=0x0;_0x55edd1<_0x5b050f[_0x2179('0x1d')];_0x55edd1+=0x1){_0x5137d9['emit'](_0x2179('0x52'),{'FaxInteractionId':Number(_0x5b050f[_0x55edd1]),'UserId':Number(_0x5389dc['id'])});}});}})[_0x2179('0xb')](function(){if(_0x1e5813==='leave'){var _0x504497=_[_0x2179('0x17')](_0x5389dc['SmsInteractions'],'id');return _0x5389dc[_0x2179('0x53')](_0x504497)[_0x2179('0xb')](function(){for(var _0x542f1e=0x0;_0x542f1e<_0x504497[_0x2179('0x1d')];_0x542f1e+=0x1){_0x5137d9[_0x2179('0x4e')](_0x2179('0x54'),{'SmsInteractionId':Number(_0x504497[_0x542f1e]),'UserId':Number(_0x5389dc['id'])});}});}})[_0x2179('0xb')](function(){if(_0x1e5813===_0x2179('0x4c')){var _0x409474=_[_0x2179('0x17')](_0x5389dc[_0x2179('0x28')],'id');return _0x5389dc['removeOpenchannelInteractions'](_0x409474)['then'](function(){for(var _0x3f85f8=0x0;_0x3f85f8<_0x409474[_0x2179('0x1d')];_0x3f85f8+=0x1){_0x5137d9[_0x2179('0x4e')](_0x2179('0x55'),{'OpenchannelInteractionId':Number(_0x409474[_0x3f85f8]),'UserId':Number(_0x5389dc['id'])});}});}})[_0x2179('0xb')](function(){if(_0x1e5813==='leave'){var _0x23da19=_[_0x2179('0x17')](_0x5389dc[_0x2179('0x2a')],'id');return _0x5389dc['removeWhatsappInteractions'](_0x23da19)[_0x2179('0xb')](function(){for(var _0x1ba999=0x0;_0x1ba999<_0x23da19[_0x2179('0x1d')];_0x1ba999+=0x1){_0x5137d9[_0x2179('0x4e')](_0x2179('0x56'),{'WhatsappInteractionId':Number(_0x23da19[_0x1ba999]),'UserId':Number(_0x5389dc['id'])});}});}})[_0x2179('0x57')](function(_0x3c61d1){_0x4a9169[_0x2179('0x58')](_0x3c61d1);});}}function onDisconnect(_0x1ebb09,_0x10ad6c){joinOrLeave(_0x1ebb09,_0x2179('0x4c'),_0x10ad6c);}function onConnect(_0x871480){joinOrLeave(_0x871480,_0x2179('0x59'));}exports[_0x2179('0x5a')]=function(_0x1e7e08){_0x1e7e08['on'](_0x2179('0x5b'),function(_0x73ac68){_0x73ac68[_0x2179('0x5c')](0x0);_0x73ac68[_0x2179('0x5d')]=_0x73ac68[_0x2179('0x5e')][_0x2179('0x5b')][_0x2179('0x5f')]+':'+_0x73ac68[_0x2179('0x5e')][_0x2179('0x5b')][_0x2179('0x60')];_0x73ac68[_0x2179('0x61')]=new Date();_0x73ac68[_0x2179('0x58')]=function(_0xc8f78e){console[_0x2179('0x58')](_0x2179('0x62')+_0x73ac68[_0x2179('0x63')]['name']+'['+_0x73ac68[_0x2179('0x5d')]+']',_0xc8f78e);};_0x73ac68['on'](_0x2179('0x64'),function(){onDisconnect(_0x73ac68,_0x1e7e08);_0x73ac68[_0x2179('0x58')]('DISCONNECTED');});onConnect(_0x73ac68);_0x73ac68[_0x2179('0x58')]('CONNECTED');});}; \ No newline at end of file +var _0x1c45=['openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','address','request','remotePort','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','where','role','Campaign','format','length','user:%s','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','Trunk','user','VoiceQueues','userProfileId','SmsQueue','WhatsappQueue','getVoiceQueues','getFaxQueues','getMailQueues','all','voice','fax','sms','mail'];(function(_0x21abe1,_0x33de53){var _0x59c808=function(_0x502916){while(--_0x502916){_0x21abe1['push'](_0x21abe1['shift']());}};_0x59c808(++_0x33de53);}(_0x1c45,0x1b0));var _0x51c4=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1c45[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x51c4('0x0'));var util=require(_0x51c4('0x1'));var BPromise=require(_0x51c4('0x2'));var db=require(_0x51c4('0x3'))['db'];var config=require(_0x51c4('0x4'));var queryQueues={'attributes':['id',_0x51c4('0x5')],'include':[{'as':_0x51c4('0x6'),'model':db[_0x51c4('0x7')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0x51c4('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x51c4('0x5')],'where':{'role':_0x51c4('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x51c4('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x51c4('0x5')],'where':{'role':_0x51c4('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x51c4('0x5'),_0x51c4('0xa')],'where':{'type':_0x51c4('0xb')}};function getAssociatedResources(_0x524a08,_0x52fc47,_0x39ceec){return db[_0x51c4('0xc')][_0x51c4('0xd')]({'where':{'name':_0x524a08,'userProfileId':_0x52fc47},'raw':!![]})[_0x51c4('0xe')](function(_0x109781){if(_0x109781){if(_0x109781[_0x51c4('0xf')]){switch(_0x524a08){case'VoiceQueues':case _0x51c4('0x10'):case _0x51c4('0x11'):case _0x51c4('0x12'):case _0x51c4('0x13'):case _0x51c4('0x14'):case _0x51c4('0x15'):return db[_0x39ceec][_0x51c4('0x16')](queryQueues);case _0x51c4('0x17'):return db[_0x39ceec][_0x51c4('0x16')](queryTelephones);case _0x51c4('0x18'):return db[_0x39ceec][_0x51c4('0x16')](queryTrunks);case _0x51c4('0x19'):return db[_0x39ceec][_0x51c4('0x16')](queryCampaigns);}}else{return db['UserProfileResource'][_0x51c4('0x16')]({'attributes':[_0x51c4('0x1a')],'where':{'sectionId':_0x109781['id']},'raw':!![]})['then'](function(_0x312169){if(_0x312169){var _0x42d96f={'where':{'id':_[_0x51c4('0x1b')](_0x312169,_0x51c4('0x1a'))},'raw':!![]};switch(_0x39ceec){case _0x51c4('0x7'):_0x42d96f[_0x51c4('0x1c')][_0x51c4('0x1d')]='telephone';break;case _0x51c4('0x1e'):_0x42d96f[_0x51c4('0x1c')]['type']=_0x51c4('0xb');break;}return db[_0x39ceec]['findAll'](_0x42d96f);}else{return[];}});}}else{return[];}})[_0x51c4('0xe')](function(_0x1f227d){return _0x1f227d;});}function joinOrLeaveQueues(_0x2e7341,_0x44c384,_0x535690,_0x3a67ed){_0x2e7341[_0x44c384](util[_0x51c4('0x1f')]('%s:queue:%s',_0x535690,_0x3a67ed['name']));if(_0x3a67ed[_0x51c4('0x6')]){for(var _0x1fb226=0x0;_0x1fb226<_0x3a67ed[_0x51c4('0x6')][_0x51c4('0x20')];_0x1fb226+=0x1){_0x2e7341[_0x44c384](util[_0x51c4('0x1f')](_0x51c4('0x21'),_0x3a67ed['Agents'][_0x1fb226][_0x51c4('0x5')]));}}}function joinOrLeave(_0x45cc46,_0x3cc1c0,_0x3b56d1){var _0x2281a0;if(_0x45cc46[_0x51c4('0x22')][_0x51c4('0x23')]['id']){db[_0x51c4('0x7')][_0x51c4('0x24')]({'attributes':['id',_0x51c4('0x5'),_0x51c4('0x1d'),'userProfileId'],'where':{'id':_0x45cc46[_0x51c4('0x22')][_0x51c4('0x23')]['id']},'include':[{'model':db[_0x51c4('0x25')],'as':_0x51c4('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x27')],'as':_0x51c4('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x29')],'as':_0x51c4('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x2b')],'as':_0x51c4('0x2c'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x2d')],'as':_0x51c4('0x2e'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x2f')],'as':_0x51c4('0x30'),'attributes':['id'],'raw':!![]}]})[_0x51c4('0xe')](function(_0x573f86){if(_0x573f86){_0x2281a0=_0x573f86;_0x45cc46[_0x3cc1c0](util[_0x51c4('0x1f')](_0x51c4('0x21'),_0x573f86['name']));var _0x2275ba=[];switch(_0x573f86[_0x51c4('0x1d')]){case _0x51c4('0x31'):_0x45cc46[_0x3cc1c0](_0x51c4('0x32'));_0x45cc46[_0x3cc1c0](_0x51c4('0x33'));if(queryQueues['hasOwnProperty'](_0x51c4('0x34'))){delete queryQueues[_0x51c4('0x34')];}_0x2275ba[_0x51c4('0x35')](db[_0x51c4('0x36')]['findAll'](queryQueues));_0x2275ba['push'](db[_0x51c4('0x37')][_0x51c4('0x16')](queryQueues));_0x2275ba['push'](db[_0x51c4('0x38')][_0x51c4('0x16')](queryQueues));_0x2275ba['push'](db['SmsQueue'][_0x51c4('0x16')](queryQueues));_0x2275ba[_0x51c4('0x35')](db[_0x51c4('0x39')]['findAll'](queryQueues));_0x2275ba[_0x51c4('0x35')](db[_0x51c4('0x3a')][_0x51c4('0x16')](queryQueues));_0x2275ba[_0x51c4('0x35')](db['WhatsappQueue'][_0x51c4('0x16')](queryQueues));_0x2275ba[_0x51c4('0x35')](db['User'][_0x51c4('0x16')](queryTelephones));_0x2275ba['push'](db[_0x51c4('0x3b')][_0x51c4('0x16')](queryTrunks));_0x2275ba[_0x51c4('0x35')](db[_0x51c4('0x1e')][_0x51c4('0x16')](queryCampaigns));_0x2275ba['push'](db[_0x51c4('0x7')]['findAll'](queryAgents));break;case _0x51c4('0x3c'):_0x45cc46[_0x3cc1c0](_0x51c4('0x32'));_0x45cc46[_0x3cc1c0](_0x51c4('0x33'));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x3d'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x36')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x10'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x37')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x11'),_0x573f86[_0x51c4('0x3e')],'FaxQueue'));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x12'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x3f')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x13'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x39')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x14'),_0x573f86['userProfileId'],_0x51c4('0x3a')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x15'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x40')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources('Telephones',_0x573f86[_0x51c4('0x3e')],_0x51c4('0x7')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x18'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x3b')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x19'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x1e')));_0x2275ba['push'](db[_0x51c4('0x7')]['findAll'](queryAgents));break;case _0x51c4('0x8'):_0x45cc46[_0x3cc1c0](_0x51c4('0x32'));_0x45cc46[_0x3cc1c0](_0x51c4('0x33'));_0x2275ba['push'](_0x573f86[_0x51c4('0x41')]({'attributes':['id','name']}));_0x2275ba[_0x51c4('0x35')](_0x573f86['getChatQueues']({'attributes':['id',_0x51c4('0x5')]}));_0x2275ba[_0x51c4('0x35')](_0x573f86[_0x51c4('0x42')]({'attributes':['id','name']}));_0x2275ba[_0x51c4('0x35')](_0x573f86['getSmsQueues']({'attributes':['id',_0x51c4('0x5')]}));_0x2275ba[_0x51c4('0x35')](_0x573f86[_0x51c4('0x43')]({'attributes':['id','name']}));_0x2275ba[_0x51c4('0x35')](_0x573f86['getOpenchannelQueues']({'attributes':['id','name']}));_0x2275ba['push'](_0x573f86['getWhatsappQueues']({'attributes':['id',_0x51c4('0x5')]}));break;}return BPromise[_0x51c4('0x44')](_0x2275ba);}})[_0x51c4('0xe')](function(_0x3046c9){if(_0x3046c9&&_0x3046c9[_0x51c4('0x20')]){for(var _0x21616a=0x0;_0x21616a<_0x3046c9[_0x51c4('0x20')];_0x21616a+=0x1){for(var _0xa642c=0x0;_0xa642c<_0x3046c9[_0x21616a][_0x51c4('0x20')];_0xa642c+=0x1){switch(_0x21616a){case 0x0:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x45'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x1:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,'chat',_0x3046c9[_0x21616a][_0xa642c]);break;case 0x2:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x46'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x3:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x47'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x4:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x48'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x5:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x49'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x6:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x4a'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x7:if(_0x2281a0[_0x51c4('0x1d')]!==_0x51c4('0x8'))_0x45cc46[_0x3cc1c0](util[_0x51c4('0x1f')]('telephone:%s',_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0x5')]));break;case 0x8:if(_0x2281a0[_0x51c4('0x1d')]!==_0x51c4('0x8'))_0x45cc46[_0x3cc1c0](util[_0x51c4('0x1f')](_0x51c4('0x4b'),_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0x5')]));break;case 0x9:if(_0x2281a0[_0x51c4('0x1d')]!=='agent')_0x45cc46[_0x3cc1c0](util[_0x51c4('0x1f')](_0x51c4('0x4c'),_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0xa')],_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0x5')]));break;case 0xa:_0x45cc46[_0x3cc1c0](util['format'](_0x51c4('0x21'),_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0x5')]));break;}}}}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x1f7b02=_[_0x51c4('0x1b')](_0x2281a0['ChatInteractions'],'id');return _0x2281a0[_0x51c4('0x4e')](_0x1f7b02)[_0x51c4('0xe')](function(){for(var _0x53b226=0x0;_0x53b226<_0x1f7b02[_0x51c4('0x20')];_0x53b226+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x50'),{'ChatInteractionId':Number(_0x1f7b02[_0x53b226]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x201020=_[_0x51c4('0x1b')](_0x2281a0['MailInteractions'],'id');return _0x2281a0[_0x51c4('0x51')](_0x201020)[_0x51c4('0xe')](function(){for(var _0x4a1a8c=0x0;_0x4a1a8c<_0x201020[_0x51c4('0x20')];_0x4a1a8c+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x52'),{'MailInteractionId':Number(_0x201020[_0x4a1a8c]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x17c2c7=_['map'](_0x2281a0[_0x51c4('0x2a')],'id');return _0x2281a0[_0x51c4('0x53')](_0x17c2c7)[_0x51c4('0xe')](function(){for(var _0x515ea5=0x0;_0x515ea5<_0x17c2c7[_0x51c4('0x20')];_0x515ea5+=0x1){_0x3b56d1['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x17c2c7[_0x515ea5]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0==='leave'){var _0x3add72=_['map'](_0x2281a0[_0x51c4('0x2c')],'id');return _0x2281a0['removeSmsInteractions'](_0x3add72)['then'](function(){for(var _0x1619c3=0x0;_0x1619c3<_0x3add72[_0x51c4('0x20')];_0x1619c3+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x54'),{'SmsInteractionId':Number(_0x3add72[_0x1619c3]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x5a47be=_['map'](_0x2281a0[_0x51c4('0x2e')],'id');return _0x2281a0['removeOpenchannelInteractions'](_0x5a47be)[_0x51c4('0xe')](function(){for(var _0xc24a04=0x0;_0xc24a04<_0x5a47be[_0x51c4('0x20')];_0xc24a04+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x55'),{'OpenchannelInteractionId':Number(_0x5a47be[_0xc24a04]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x4aa45a=_[_0x51c4('0x1b')](_0x2281a0[_0x51c4('0x30')],'id');return _0x2281a0[_0x51c4('0x56')](_0x4aa45a)[_0x51c4('0xe')](function(){for(var _0x4d1d7d=0x0;_0x4d1d7d<_0x4aa45a[_0x51c4('0x20')];_0x4d1d7d+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x57'),{'WhatsappInteractionId':Number(_0x4aa45a[_0x4d1d7d]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0x58')](function(_0x508613){_0x45cc46['log'](_0x508613);});}}function onDisconnect(_0x4cc05b,_0x17868d){joinOrLeave(_0x4cc05b,_0x51c4('0x4d'),_0x17868d);}function onConnect(_0xcc4cd8){joinOrLeave(_0xcc4cd8,_0x51c4('0x59'));}exports[_0x51c4('0x5a')]=function(_0x75a708){_0x75a708['on'](_0x51c4('0x5b'),function(_0x572553){_0x572553['setMaxListeners'](0x0);_0x572553[_0x51c4('0x5c')]=_0x572553[_0x51c4('0x5d')]['connection']['remoteAddress']+':'+_0x572553[_0x51c4('0x5d')][_0x51c4('0x5b')][_0x51c4('0x5e')];_0x572553['connectedAt']=new Date();_0x572553['log']=function(_0x53e111){console[_0x51c4('0x5f')](_0x51c4('0x60')+_0x572553[_0x51c4('0x61')]['name']+'['+_0x572553[_0x51c4('0x5c')]+']',_0x53e111);};_0x572553['on'](_0x51c4('0x62'),function(){onDisconnect(_0x572553,_0x75a708);_0x572553[_0x51c4('0x5f')](_0x51c4('0x63'));});onConnect(_0x572553);_0x572553[_0x51c4('0x5f')](_0x51c4('0x64'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 2cb9250..5e9a7fb 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 _0xe428=['length','hasOwnProperty','model','hook','callback','toLowerCase','util','jayson/promise','../logger','client','http','Chat','ChatInteraction','afterCreate','newinteraction','newmessage','Sms','SmsInteraction','afterUpdate','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','OpenchannelInteraction','OpenchannelMessage','request','EventManager','Trigger,\x20%s','error','catch','get','channel','motionChannel','direction','resolve','then','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','QueryTypes','SELECT','contact','UserId','undefined','format','SIP/%s','name','agent','outgoingmessage','AfterCreateMessage','event','offlineMessage','opened','Sequelize','interface','AfterCreate','closed','substatus','AfterUpdate','User','find','fullname','email'];(function(_0x5c71ce,_0x39c997){var _0x44dc37=function(_0x56c374){while(--_0x56c374){_0x5c71ce['push'](_0x5c71ce['shift']());}};_0x44dc37(++_0x39c997);}(_0xe428,0x1f0));var _0x8e42=function(_0x128af2,_0x11dffb){_0x128af2=_0x128af2-0x0;var _0x49208f=_0xe428[_0x128af2];return _0x49208f;};'use strict';var util=require(_0x8e42('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x8e42('0x1'));var logger=require(_0x8e42('0x2'))('triggers');var client=jayson[_0x8e42('0x3')][_0x8e42('0x4')]({'port':0x232a});var triggers=[{'channel':_0x8e42('0x5'),'model':_0x8e42('0x6'),'event':_0x8e42('0x7'),'condition':_0x8e42('0x8'),'callback':afterCreate},{'channel':_0x8e42('0x5'),'model':'ChatInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Chat','model':'ChatMessage','event':_0x8e42('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Chat','model':'ChatOfflineMessage','event':_0x8e42('0x7'),'condition':_0x8e42('0x9'),'callback':afterCreateOfflineMessage},{'channel':_0x8e42('0xa'),'model':'SmsInteraction','event':_0x8e42('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x8e42('0xa'),'model':_0x8e42('0xb'),'event':_0x8e42('0xc'),'condition':_0x8e42('0xd'),'callback':afterUpdate},{'channel':_0x8e42('0xa'),'model':_0x8e42('0xe'),'event':_0x8e42('0x7'),'condition':_0x8e42('0x9'),'callback':afterCreateMessage},{'channel':_0x8e42('0xf'),'model':_0x8e42('0x10'),'event':_0x8e42('0x7'),'condition':_0x8e42('0x8'),'callback':afterCreate},{'channel':_0x8e42('0xf'),'model':'WhatsappInteraction','event':_0x8e42('0xc'),'condition':_0x8e42('0xd'),'callback':afterUpdate},{'channel':_0x8e42('0xf'),'model':'WhatsappMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x8e42('0x11'),'model':_0x8e42('0x12'),'event':'afterCreate','condition':_0x8e42('0x8'),'callback':afterCreate},{'channel':'Fax','model':_0x8e42('0x12'),'event':_0x8e42('0xc'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x8e42('0x11'),'model':_0x8e42('0x13'),'event':_0x8e42('0x7'),'condition':_0x8e42('0x9'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x8e42('0x14'),'event':_0x8e42('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Mail','model':_0x8e42('0x14'),'event':_0x8e42('0xc'),'condition':_0x8e42('0xd'),'callback':afterUpdate},{'channel':_0x8e42('0x15'),'model':_0x8e42('0x16'),'event':_0x8e42('0x7'),'condition':_0x8e42('0x9'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x8e42('0x17'),'event':_0x8e42('0x7'),'condition':_0x8e42('0x8'),'callback':afterCreate},{'channel':'Openchannel','model':_0x8e42('0x17'),'event':_0x8e42('0xc'),'condition':_0x8e42('0xd'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x8e42('0x18'),'event':_0x8e42('0x7'),'condition':_0x8e42('0x9'),'callback':afterCreateMessage}];function request(_0x463973){return client[_0x8e42('0x19')](_0x8e42('0x1a'),_0x463973)['then'](function(_0x2f3980){logger['info'](_0x8e42('0x1b'),_0x8e42('0x1a'),_0x2f3980);if(_0x2f3980[_0x8e42('0x1c')]){if(_0x2f3980[_0x8e42('0x1c')]['code']===0x1f4){logger[_0x8e42('0x1c')](_0x8e42('0x1b'),_0x8e42('0x1a'),_0x2f3980[_0x8e42('0x1c')]);}}})[_0x8e42('0x1d')](function(_0x3441ca){logger[_0x8e42('0x1c')](_0x8e42('0x1b'),'EventManager',_0x3441ca);});}function afterCreateMessage(_0x8660bd){return function(_0x4d7561){_0x4d7561=_0x4d7561[_0x8e42('0x1e')]({'plain':!![]});_0x4d7561[_0x8e42('0x1f')]=_0x8660bd;_0x4d7561[_0x8e42('0x20')]=_0x8660bd;_0x4d7561['event']=_0x4d7561[_0x8e42('0x21')];Promise[_0x8e42('0x22')]()[_0x8e42('0x23')](function(){if(typeof _0x4d7561[_0x8e42('0x24')]==='undefined')return null;var _0x31ae30=_0x8e42('0x25')+_0x4d7561['ContactId'];return db[_0x8e42('0x26')][_0x8e42('0x27')](_0x31ae30,{'type':db['Sequelize'][_0x8e42('0x28')][_0x8e42('0x29')],'raw':!![]});})[_0x8e42('0x23')](function(_0x421f43){if(_0x421f43){_0x4d7561[_0x8e42('0x2a')]=_0x421f43[0x0];}if(typeof _0x4d7561[_0x8e42('0x2b')]===_0x8e42('0x2c'))return;return getAgent(_0x4d7561['UserId']);})[_0x8e42('0x23')](function(_0x12934d){if(_0x12934d){_0x4d7561['interface']=util[_0x8e42('0x2d')](_0x8e42('0x2e'),_0x12934d[_0x8e42('0x2f')]);_0x4d7561[_0x8e42('0x30')]=_0x12934d;_0x4d7561[_0x8e42('0x1f')]=_0x8660bd;return request({'event':'incomingmessage','message':_0x4d7561});}else{return request({'event':_0x8e42('0x31'),'message':_0x4d7561});}})[_0x8e42('0x1d')](function(_0x2aec21){logger[_0x8e42('0x1c')](_0x8e42('0x1b'),_0x8e42('0x32'),_0x2aec21);});};}function afterCreateOfflineMessage(_0x204197){return function(_0x300b51){_0x300b51=_0x300b51[_0x8e42('0x1e')]({'plain':!![]});_0x300b51['channel']=_0x204197;_0x300b51['motionChannel']=_0x204197;_0x300b51[_0x8e42('0x33')]=_0x8e42('0x34');return request({'event':_0x300b51[_0x8e42('0x33')],'message':_0x300b51});};}function afterCreate(_0x37adc2,_0x3ae849){return function(_0x371291){_0x371291=_0x371291['get']({'plain':!![]});_0x371291[_0x8e42('0x1f')]=_0x37adc2;_0x371291[_0x8e42('0x20')]=_0x37adc2;_0x371291[_0x8e42('0x33')]=_0x8e42('0x35');Promise['resolve']()[_0x8e42('0x23')](function(){var _0x17987c=_0x8e42('0x25')+_0x371291[_0x8e42('0x24')];return db['sequelize']['query'](_0x17987c,{'type':db[_0x8e42('0x36')][_0x8e42('0x28')][_0x8e42('0x29')],'raw':!![]});})['then'](function(_0x186c0e){if(_0x186c0e){_0x371291[_0x8e42('0x2a')]=_0x186c0e[0x0];}if(typeof _0x371291[_0x8e42('0x2b')]===_0x8e42('0x2c'))return;return getAgent(_0x371291[_0x8e42('0x2b')]);})[_0x8e42('0x23')](function(_0xbd5ac1){if(_0xbd5ac1){_0x371291[_0x8e42('0x37')]=util[_0x8e42('0x2d')](_0x8e42('0x2e'),_0xbd5ac1['name']);_0x371291[_0x8e42('0x30')]=_0xbd5ac1;}return request({'event':_0x3ae849,'message':_0x371291});})[_0x8e42('0x1d')](function(_0x530a2d){logger[_0x8e42('0x1c')]('Trigger,\x20%s',_0x8e42('0x38'),_0x530a2d);});};}function afterUpdate(_0x560d22){return function(_0x16bce8){var _0x287a83=_0x16bce8['changed'](_0x8e42('0x39'))&&_0x16bce8[_0x8e42('0x39')];var _0x4fa5f6=_0x16bce8['changed'](_0x8e42('0x3a'));if(_0x287a83||_0x4fa5f6){var _0x237a62=_0x287a83?'closedinteraction':_0x8e42('0x3a');var _0x12d7d1=_0x16bce8[_0x8e42('0x1e')]({'plain':!![]});_0x12d7d1[_0x8e42('0x1f')]=_0x560d22;_0x12d7d1['motionChannel']=_0x560d22;_0x12d7d1['event']=_0x287a83?_0x8e42('0x39'):_0x8e42('0x3a');var _0x56da9f=_0x8e42('0x25')+_0x12d7d1['ContactId'];return db['sequelize']['query'](_0x56da9f,{'type':db[_0x8e42('0x36')][_0x8e42('0x28')][_0x8e42('0x29')],'raw':!![]})['then'](function(_0x109233){if(_0x109233){_0x12d7d1[_0x8e42('0x2a')]=_0x109233[0x0];}if(typeof _0x12d7d1[_0x8e42('0x2b')]===_0x8e42('0x2c'))return;return getAgent(_0x12d7d1[_0x8e42('0x2b')]);})[_0x8e42('0x23')](function(_0x40ea12){if(_0x40ea12){_0x12d7d1[_0x8e42('0x37')]=util['format']('SIP/%s',_0x40ea12[_0x8e42('0x2f')]);_0x12d7d1[_0x8e42('0x30')]=_0x40ea12;}return request({'event':_0x237a62,'message':_0x12d7d1});})[_0x8e42('0x1d')](function(_0x585da0){logger[_0x8e42('0x1c')](_0x8e42('0x1b'),_0x8e42('0x3b'),_0x585da0);});}};}function getAgent(_0x2f6941){return db[_0x8e42('0x3c')][_0x8e42('0x3d')]({'where':{'id':_0x2f6941},'attributes':['id',_0x8e42('0x2f'),_0x8e42('0x3e'),_0x8e42('0x3f'),'internal'],'raw':!![]})[_0x8e42('0x23')](function(_0x59f227){return _0x59f227;});}exports['default']=function(){for(var _0x39668e=0x0;_0x39668e=_0x40fd8b[_0x0426('0x11')]){throw Error(_0x0426('0x12'));}_0x45baa3(_0x25b032);})[_0x0426('0x13')](function(_0x3cef0a){_0x314a5d(_0x3cef0a);});});}; \ No newline at end of file +var _0x581a=['updateAttributes','getLicense','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','../mysqldb','./license/util','fax','sms','whatsapp','isValidChannel','toLowerCase','includes','clearBlockUser','blockedAt'];(function(_0x47df54,_0x1aeb61){var _0x261b87=function(_0x54bc77){while(--_0x54bc77){_0x47df54['push'](_0x47df54['shift']());}};_0x261b87(++_0x1aeb61);}(_0x581a,0x14a));var _0xa581=function(_0x5b2e3c,_0x1008ec){_0x5b2e3c=_0x5b2e3c-0x0;var _0x181b20=_0x581a[_0x5b2e3c];return _0x181b20;};'use strict';var _=require(_0xa581('0x0'));var BPromise=require(_0xa581('0x1'));var db=require(_0xa581('0x2'))['db'];var util=require(_0xa581('0x3'));var channels=['voice','mail','chat',_0xa581('0x4'),_0xa581('0x5'),_0xa581('0x6'),'openchannel'];exports['getChannels']=function(){return channels;};exports[_0xa581('0x7')]=function(_0x8cab7d){_0x8cab7d=_0x8cab7d[_0xa581('0x8')]();return _[_0xa581('0x9')](channels,_0x8cab7d);};exports[_0xa581('0xa')]=function(_0x4cb99c,_0x398bc2,_0x3595f0,_0x4aef72){var _0x3e66e6={'loginAttempts':_0x398bc2,'blocked':_0x3595f0};if(!_['isUndefined'](_0x4aef72)){_0x3e66e6[_0xa581('0xb')]=_0x4aef72;}return _0x4cb99c[_0xa581('0xc')](_0x3e66e6);};exports[_0xa581('0xd')]=function(_0x44e658){return new BPromise(function(_0x2d1c73,_0x22d116){var _0x351058=0x0;if(_0x44e658['role']!==_0xa581('0xe')){_0x2d1c73(_0x44e658);}db['User']['count']({'where':{'role':_0xa581('0xe'),'online':!![],'id':{'$ne':_0x44e658['id']}}})[_0xa581('0xf')](function(_0x418844){_0x351058=_0x418844;return util['getLicense']();})[_0xa581('0xf')](function(_0x4d2608){if(_0x4d2608&&_0x4d2608[_0xa581('0x10')]&&_0x351058>=_0x4d2608[_0xa581('0x10')]){throw Error(_0xa581('0x11'));}_0x2d1c73(_0x44e658);})['catch'](function(_0x15fd3d){_0x22d116(_0x15fd3d);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 488e323..afee387 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb1d=['exports','status','render','json','send'];(function(_0x3a12c4,_0x17e120){var _0x41a66e=function(_0x34f552){while(--_0x34f552){_0x3a12c4['push'](_0x3a12c4['shift']());}};_0x41a66e(++_0x17e120);}(_0xeb1d,0x131));var _0xdeb1=function(_0x372ade,_0x23c21e){_0x372ade=_0x372ade-0x0;var _0x1cde38=_0xeb1d[_0x372ade];return _0x1cde38;};'use strict';module[_0xdeb1('0x0')][0x194]=function pageNotFound(_0x5d9598,_0x3614a1){var _0x2a1b7f='404';var _0x1f1c36=0x194;var _0x43aaad={'status':_0x1f1c36};_0x3614a1[_0xdeb1('0x1')](_0x43aaad[_0xdeb1('0x1')]);_0x3614a1[_0xdeb1('0x2')](_0x2a1b7f,{},function(_0x3039ce,_0x1a3b3a){if(_0x3039ce){return _0x3614a1[_0xdeb1('0x1')](_0x43aaad['status'])[_0xdeb1('0x3')](_0x43aaad);}_0x3614a1[_0xdeb1('0x4')](_0x1a3b3a);});}; \ No newline at end of file +var _0xb522=['exports','404','status','render','json','send'];(function(_0x79c4f3,_0x29b82a){var _0x5a88f2=function(_0x1d3117){while(--_0x1d3117){_0x79c4f3['push'](_0x79c4f3['shift']());}};_0x5a88f2(++_0x29b82a);}(_0xb522,0x1ce));var _0x2b52=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb522[_0x321bb2];return _0x9c12ed;};'use strict';module[_0x2b52('0x0')][0x194]=function pageNotFound(_0x5ed210,_0x40f5f5){var _0x275531=_0x2b52('0x1');var _0x2632ac=0x194;var _0x204809={'status':_0x2632ac};_0x40f5f5[_0x2b52('0x2')](_0x204809[_0x2b52('0x2')]);_0x40f5f5[_0x2b52('0x3')](_0x275531,{},function(_0x4c1964,_0xfb7ec4){if(_0x4c1964){return _0x40f5f5[_0x2b52('0x2')](_0x204809['status'])[_0x2b52('0x4')](_0x204809);}_0x40f5f5[_0x2b52('0x5')](_0xfb7ec4);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index a4a63ec..2766884 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7f3=['../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','Migration','../api/migration/migration.model','Attachment','../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','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','User','VoiceMail','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','belongsToMany','ChatGroup','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_whatsapp_interactions','VoicePrefixes','MailQueue','MailQueues','ChatQueues','FaxQueue','UserSmsQueue','OpenchannelQueues','WhatsappQueues','CmList','ChatWebsites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccount','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','Messages','mailboxuser','mailbox','uniqueid','AgentReports','Contact','MailAccountId','CloudProviderId','restrict','MailAccount','MailServerOut','hasOne','Disposition','Dispositions','Answers','Interactions','List','ListId','TemplateId','mandatoryDispositionPause','team_has_mail_queues','MailInteractionId','Account','ContactId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','MailApplication','TagId','Items','FaxAccountId','Exntensions','FaxMessage','Agents','FaxInteractionId','fax_interaction_has_tags','AttachmentId','SmsAccountId','SmsMessage','SmsInteractionId','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','ChatApplication','user_has_chat_websites','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Website','CompanyId','Company','cm_contact_has_tags','Campaign','OwnerId','CampaignId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','CustomReportId','sms_interaction_has_tags','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','AccountId','Descriptions','DescriptionId','Subject','SubjectId','Description','Field','VariableId','SugarcrmAccount','Configurations','Subjects','FieldId','DeskField','int_desk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','Dynamics365Account','ChatQueueReport','FromId','ToId','SessionId','ProjectId','VoiceQueues','team_has_fax_queues','FaxQueues','team_has_whatsapp_queues','HopperHistories','TrunkBackupId','SquareProjectId','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Queues','UserProfileSection','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','Imap','exports','../config/environment','sequelize','lodash','jstz','determine','motion2','xcall','127.0.0.1','utf8mb4','name','sequelizeHistory','xC@LL1234','mysql','database','password','options','username','../api/user/user.model','VoiceChanSpy','import','VoiceContext','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailQueueReport','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount'];(function(_0x25192b,_0x5ab362){var _0x599b8a=function(_0x43c422){while(--_0x43c422){_0x25192b['push'](_0x25192b['shift']());}};_0x599b8a(++_0x5ab362);}(_0xf7f3,0x12a));var _0x3f7f=function(_0x13e247,_0x5038b7){_0x13e247=_0x13e247-0x0;var _0x2fa0b9=_0xf7f3[_0x13e247];return _0x2fa0b9;};'use strict';var config=require(_0x3f7f('0x0'));var Sequelize=require(_0x3f7f('0x1'));var _=require(_0x3f7f('0x2'));var jstz=require(_0x3f7f('0x3'));var timezone=jstz[_0x3f7f('0x4')]();config[_0x3f7f('0x1')]=_['defaultsDeep'](config['sequelize'],{'database':_0x3f7f('0x5'),'username':_0x3f7f('0x6'),'password':'xC@LL1234','options':{'host':_0x3f7f('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x3f7f('0x8')},'logging':![],'timezone':timezone[_0x3f7f('0x9')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config['sequelizeHistory']=_['defaultsDeep'](config[_0x3f7f('0xa')],{'database':_0x3f7f('0x5'),'username':_0x3f7f('0x6'),'password':_0x3f7f('0xb'),'options':{'host':_0x3f7f('0x7'),'port':0xcea,'dialect':_0x3f7f('0xc'),'dialectOptions':{'charset':_0x3f7f('0x8')},'logging':![],'timezone':timezone[_0x3f7f('0x9')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3f7f('0x1')][_0x3f7f('0xd')],config['sequelize']['username'],config[_0x3f7f('0x1')][_0x3f7f('0xe')],config['sequelize'][_0x3f7f('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3f7f('0xa')][_0x3f7f('0xd')],config['sequelizeHistory'][_0x3f7f('0x10')],config[_0x3f7f('0xa')][_0x3f7f('0xe')],config[_0x3f7f('0xa')][_0x3f7f('0xf')])};db['User']=db[_0x3f7f('0x1')]['import'](_0x3f7f('0x11'));db[_0x3f7f('0x12')]=db['sequelize'][_0x3f7f('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x3f7f('0x14')]=db['sequelize']['import']('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x15'));db[_0x3f7f('0x16')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0x17'));db[_0x3f7f('0x18')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x19'));db[_0x3f7f('0x1a')]=db[_0x3f7f('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x3f7f('0x1b')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0x1c'));db[_0x3f7f('0x1d')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0x1e'));db[_0x3f7f('0x1f')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x20'));db[_0x3f7f('0x21')]=db['sequelize'][_0x3f7f('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x3f7f('0x22')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0x23'));db[_0x3f7f('0x24')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x25'));db[_0x3f7f('0x26')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x27'));db[_0x3f7f('0x28')]=db['sequelize']['import'](_0x3f7f('0x29'));db[_0x3f7f('0x2a')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0x2b'));db[_0x3f7f('0x2c')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0x2d'));db[_0x3f7f('0x2e')]=db['sequelize'][_0x3f7f('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x3f7f('0x2f')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/userChatQueue/userChatQueue.model');db[_0x3f7f('0x30')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x31'));db[_0x3f7f('0x32')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x33'));db['UserSmsQueue']=db[_0x3f7f('0x1')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0x3f7f('0x34')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x35'));db[_0x3f7f('0x36')]=db[_0x3f7f('0x1')]['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x3f7f('0x37')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x38'));db['MailServerOut']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x39'));db['MailAccount']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x3a'));db['MailQueue']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x3b'));db['MailSubstatus']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x3c'));db[_0x3f7f('0x3d')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0x3e'));db[_0x3f7f('0x3f')]=db['sequelize']['import'](_0x3f7f('0x40'));db['MailApplication']=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/mailApplication/mailApplication.model');db[_0x3f7f('0x41')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/mailQueueReport/mailQueueReport.model');db[_0x3f7f('0x42')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/dashboard/dashboard.model');db[_0x3f7f('0x43')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x44'));db[_0x3f7f('0x45')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x46'));db[_0x3f7f('0x47')]=db['sequelize'][_0x3f7f('0x13')]('../api/faxApplication/faxApplication.model');db[_0x3f7f('0x48')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x49'));db['FaxMessage']=db['sequelize'][_0x3f7f('0x13')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x4a'));db[_0x3f7f('0x4b')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0x4c'));db[_0x3f7f('0x4d')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x4e'));db[_0x3f7f('0x4f')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x50'));db[_0x3f7f('0x51')]=db[_0x3f7f('0x1')]['import']('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/smsMessage/smsMessage.model');db[_0x3f7f('0x52')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x53'));db['OpenchannelAccount']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x54'));db[_0x3f7f('0x55')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0x56'));db[_0x3f7f('0x57')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x58'));db[_0x3f7f('0x59')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x5a'));db[_0x3f7f('0x5b')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0x5c'));db[_0x3f7f('0x5d')]=db['sequelize'][_0x3f7f('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0x3f7f('0x5e')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0x5f'));db['ChatApplication']=db['sequelize']['import'](_0x3f7f('0x60'));db[_0x3f7f('0x61')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x62'));db[_0x3f7f('0x63')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0x64'));db[_0x3f7f('0x65')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0x66'));db[_0x3f7f('0x67')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0x68'));db['ChatGroup']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x69'));db[_0x3f7f('0x6a')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x3f7f('0x6b')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x6c'));db[_0x3f7f('0x6d')]=db['sequelize']['import'](_0x3f7f('0x6e'));db[_0x3f7f('0x6f')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x70'));db[_0x3f7f('0x71')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x72'));db[_0x3f7f('0x73')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x74'));db[_0x3f7f('0x75')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0x76'));db['ReportAgentPreview']=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0x77'));db[_0x3f7f('0x78')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x79'));db[_0x3f7f('0x7a')]=db[_0x3f7f('0x1')]['import']('../api/action/action.model');db[_0x3f7f('0x7b')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0x7c'));db[_0x3f7f('0x7d')]=db['sequelize']['import'](_0x3f7f('0x7e'));db['Disposition']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x7f'));db[_0x3f7f('0x80')]=db['sequelize']['import']('../api/condition/condition.model');db[_0x3f7f('0x81')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/interval/interval.model');db[_0x3f7f('0x82')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x83'));db[_0x3f7f('0x84')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x85'));db[_0x3f7f('0x86')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x87'));db[_0x3f7f('0x88')]=db['sequelize'][_0x3f7f('0x13')]('../api/schedule/schedule.model');db['Sound']=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0x89'));db[_0x3f7f('0x8a')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0x8b'));db[_0x3f7f('0x8c')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0x8d'));db[_0x3f7f('0x8e')]=db['sequelize'][_0x3f7f('0x13')]('../api/trigger/trigger.model');db[_0x3f7f('0x8f')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0x90'));db['Integration']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x91'));db[_0x3f7f('0x92')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x93'));db['AnalyticCustomReport']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x94'));db[_0x3f7f('0x95')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x96'));db[_0x3f7f('0x97')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x98'));db[_0x3f7f('0x99')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x9a'));db[_0x3f7f('0x9b')]=db['sequelize']['import']('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db['sequelize'][_0x3f7f('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x3f7f('0x9c')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0x9d'));db[_0x3f7f('0x9e')]=db['sequelize'][_0x3f7f('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x3f7f('0x9f')]=db['sequelize']['import']('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db['sequelize']['import'](_0x3f7f('0xa0'));db[_0x3f7f('0xa1')]=db['sequelize'][_0x3f7f('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x3f7f('0xa2')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0xa3'));db[_0x3f7f('0xa4')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0xa5'));db[_0x3f7f('0xa6')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xa7'));db['DeskField']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xa8'));db[_0x3f7f('0xa9')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xaa'));db[_0x3f7f('0xab')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0xac'));db[_0x3f7f('0xad')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xae'));db[_0x3f7f('0xaf')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xb0'));db[_0x3f7f('0xb1')]=db['sequelize'][_0x3f7f('0x13')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x3f7f('0xb2')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xb3'));db['FreshdeskAccount']=db[_0x3f7f('0x1')]['import'](_0x3f7f('0xb4'));db[_0x3f7f('0xb5')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xb6'));db[_0x3f7f('0xb7')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0xb8'));db[_0x3f7f('0xb9')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xba'));db[_0x3f7f('0xbb')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0xbc'));db[_0x3f7f('0xbd')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0xbe'));db[_0x3f7f('0xbf')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0xc0'));db[_0x3f7f('0xc1')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xc2'));db[_0x3f7f('0xc3')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xc4'));db['Dynamics365Account']=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x3f7f('0xc5')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xc6'));db[_0x3f7f('0xc7')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x3f7f('0xc8')]=db['sequelize']['import'](_0x3f7f('0xc9'));db[_0x3f7f('0xca')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xcb'));db[_0x3f7f('0xcc')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xcd'));db[_0x3f7f('0xce')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x91'));db[_0x3f7f('0xcf')]=db['sequelize']['import'](_0x3f7f('0xd0'));db['ChatQueueReport']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xd1'));db[_0x3f7f('0xd2')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0xd3'));db[_0x3f7f('0xd4')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0xd5'));db[_0x3f7f('0xd6')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0xd7'));db['JscriptySessionReport']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xd8'));db[_0x3f7f('0xd9')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xda'));db[_0x3f7f('0xdb')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xdc'));db[_0x3f7f('0xdd')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xde'));db['Setting']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xdf'));db['SquareOdbc']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xe0'));db[_0x3f7f('0xe1')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xe2'));db[_0x3f7f('0xe3')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0xe4'));db[_0x3f7f('0xe5')]=db['sequelize']['import']('../api/squareMessage/squareMessage.model');db[_0x3f7f('0xe6')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/team/team.model');db['License']=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/license/license.model');db['Campaign']=db[_0x3f7f('0x1')]['import']('../api/campaign/campaign.model');db[_0x3f7f('0xe7')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0xe8'));db[_0x3f7f('0xe9')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0xea'));db[_0x3f7f('0xeb')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xec'));db[_0x3f7f('0xed')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/mailTransferReport/mailTransferReport.model');db[_0x3f7f('0xee')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xef'));db[_0x3f7f('0xf0')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0xf1'));db[_0x3f7f('0xf2')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0xf3'));db[_0x3f7f('0xf4')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xf5'));db['CmList']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xf6'));db[_0x3f7f('0xf7')]=db['sequelize'][_0x3f7f('0x13')](_0x3f7f('0xf8'));db[_0x3f7f('0xf9')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xfa'));db['UserProfileSection']=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xfb'));db[_0x3f7f('0xfc')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xfd'));db[_0x3f7f('0xfe')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0xff'));db[_0x3f7f('0x100')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x101'));db[_0x3f7f('0x102')]=db[_0x3f7f('0x1')]['import']('../api/whatsappApplication/whatsappApplication.model');db[_0x3f7f('0x103')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x104'));db[_0x3f7f('0x105')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x106'));db[_0x3f7f('0x107')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x108'));db['WhatsappTransferReport']=db[_0x3f7f('0x1')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x3f7f('0x109')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0x3f7f('0x10a')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x10b'));db[_0x3f7f('0x10c')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x10d'));db[_0x3f7f('0x10e')]=db[_0x3f7f('0x1')][_0x3f7f('0x13')](_0x3f7f('0x10f'));db[_0x3f7f('0x110')]=db[_0x3f7f('0x1')]['import'](_0x3f7f('0x111'));db[_0x3f7f('0x112')]['hasOne'](db[_0x3f7f('0x113')],{'as':_0x3f7f('0x113'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x115')});db[_0x3f7f('0x112')][_0x3f7f('0x116')](db[_0x3f7f('0x1a')],{'as':_0x3f7f('0x117'),'foreignKey':_0x3f7f('0x115')});db[_0x3f7f('0x112')]['hasMany'](db[_0x3f7f('0x2c')],{'as':_0x3f7f('0x118'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x3f7f('0x119')],{'as':_0x3f7f('0x11a'),'onDelete':_0x3f7f('0x114'),'hooks':!![]});db[_0x3f7f('0x112')][_0x3f7f('0x116')](db[_0x3f7f('0x73')],{'as':_0x3f7f('0x11b'),'foreignKey':_0x3f7f('0x115')});db['User'][_0x3f7f('0x116')](db[_0x3f7f('0x75')],{'as':_0x3f7f('0x11c'),'foreignKey':'UserId'});db[_0x3f7f('0x112')][_0x3f7f('0x116')](db[_0x3f7f('0x11d')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0x3f7f('0x112')][_0x3f7f('0x116')](db[_0x3f7f('0x57')],{'as':_0x3f7f('0x11e'),'foreignKey':_0x3f7f('0x115')});db[_0x3f7f('0x112')][_0x3f7f('0x116')](db[_0x3f7f('0x61')],{'as':'ChatInteractions','foreignKey':_0x3f7f('0x115')});db[_0x3f7f('0x112')][_0x3f7f('0x116')](db['SmsInteraction'],{'as':_0x3f7f('0x11f'),'foreignKey':'UserId'});db[_0x3f7f('0x112')][_0x3f7f('0x116')](db[_0x3f7f('0x48')],{'as':_0x3f7f('0x120'),'foreignKey':_0x3f7f('0x115')});db[_0x3f7f('0x112')][_0x3f7f('0x116')](db['MailInteraction'],{'as':_0x3f7f('0x121'),'foreignKey':'UserId'});db[_0x3f7f('0x112')][_0x3f7f('0x116')](db[_0x3f7f('0x103')],{'as':_0x3f7f('0x122'),'foreignKey':'UserId'});db[_0x3f7f('0x112')][_0x3f7f('0x116')](db[_0x3f7f('0xfe')],{'as':_0x3f7f('0x123'),'foreignKey':_0x3f7f('0x124')});db[_0x3f7f('0x112')][_0x3f7f('0x125')](db['UserProfile'],{'as':_0x3f7f('0xf9'),'foreignKey':'userProfileId'});db[_0x3f7f('0x112')][_0x3f7f('0x126')](db[_0x3f7f('0x127')],{'as':_0x3f7f('0x128'),'through':_0x3f7f('0x129')});db['User']['belongsToMany'](db[_0x3f7f('0x6d')],{'as':_0x3f7f('0x12a'),'through':_0x3f7f('0x12b')});db[_0x3f7f('0x112')]['belongsToMany'](db['CmList'],{'as':'Lists','through':_0x3f7f('0x12c')});db['User'][_0x3f7f('0x126')](db['Team'],{'through':_0x3f7f('0x12d')});db['User']['belongsToMany'](db[_0x3f7f('0x3d')],{'as':_0x3f7f('0x121'),'through':_0x3f7f('0x12e')});db['User'][_0x3f7f('0x126')](db['ChatInteraction'],{'as':_0x3f7f('0x12f'),'through':_0x3f7f('0x130')});db[_0x3f7f('0x112')][_0x3f7f('0x126')](db[_0x3f7f('0x48')],{'as':'FaxInteractions','through':_0x3f7f('0x131')});db[_0x3f7f('0x112')][_0x3f7f('0x126')](db[_0x3f7f('0x51')],{'as':_0x3f7f('0x11f'),'through':'user_has_sms_interactions'});db[_0x3f7f('0x112')][_0x3f7f('0x126')](db[_0x3f7f('0x57')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x3f7f('0x112')]['belongsToMany'](db[_0x3f7f('0x103')],{'as':_0x3f7f('0x122'),'through':_0x3f7f('0x132')});db[_0x3f7f('0x112')][_0x3f7f('0x126')](db[_0x3f7f('0x18')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db[_0x3f7f('0x112')]['belongsToMany'](db['VoicePrefix'],{'as':_0x3f7f('0x133'),'through':_0x3f7f('0x110'),'required':![]});db[_0x3f7f('0x112')][_0x3f7f('0x126')](db[_0x3f7f('0x134')],{'as':_0x3f7f('0x135'),'through':_0x3f7f('0x30'),'required':![]});db[_0x3f7f('0x112')]['belongsToMany'](db[_0x3f7f('0x67')],{'as':_0x3f7f('0x136'),'through':_0x3f7f('0x2f'),'required':![],'hooks':!![]});db[_0x3f7f('0x112')]['belongsToMany'](db[_0x3f7f('0x137')],{'as':'FaxQueues','through':_0x3f7f('0x32'),'required':![]});db[_0x3f7f('0x112')]['belongsToMany'](db[_0x3f7f('0x52')],{'as':'SmsQueues','through':_0x3f7f('0x138'),'required':![]});db['User'][_0x3f7f('0x126')](db[_0x3f7f('0x5b')],{'as':_0x3f7f('0x139'),'through':_0x3f7f('0x34'),'required':![]});db[_0x3f7f('0x112')][_0x3f7f('0x126')](db[_0x3f7f('0x109')],{'as':_0x3f7f('0x13a'),'through':_0x3f7f('0x36'),'required':![]});db[_0x3f7f('0x112')][_0x3f7f('0x126')](db[_0x3f7f('0x13b')],{'through':_0x3f7f('0x12c')});db[_0x3f7f('0x112')][_0x3f7f('0x126')](db[_0x3f7f('0x5d')],{'as':_0x3f7f('0x13c'),'through':'user_has_chat_websites'});db[_0x3f7f('0x112')]['belongsToMany'](db[_0x3f7f('0x45')],{'as':_0x3f7f('0x13d'),'through':_0x3f7f('0x13e')});db[_0x3f7f('0x112')][_0x3f7f('0x126')](db['MailAccount'],{'as':'MailAccounts','through':_0x3f7f('0x13f')});db[_0x3f7f('0x112')]['belongsToMany'](db[_0x3f7f('0x140')],{'as':'OpenchannelAccounts','through':_0x3f7f('0x141')});db[_0x3f7f('0x112')][_0x3f7f('0x126')](db[_0x3f7f('0x4d')],{'as':_0x3f7f('0x142'),'through':_0x3f7f('0x143')});db[_0x3f7f('0x112')]['belongsToMany'](db[_0x3f7f('0x100')],{'as':_0x3f7f('0x144'),'through':'user_has_whatsapp_accounts'});db['User'][_0x3f7f('0x126')](db[_0x3f7f('0xe1')],{'as':'SquareProjects','through':_0x3f7f('0x145')});db['VoiceChanSpy'][_0x3f7f('0x116')](db[_0x3f7f('0x119')],{'as':_0x3f7f('0x146'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x147')});db['VoiceContext'][_0x3f7f('0x116')](db[_0x3f7f('0x119')],{'onDelete':'cascade'});db[_0x3f7f('0x119')]['hasMany'](db[_0x3f7f('0x119')],{'as':_0x3f7f('0x148'),'onDelete':'cascade'});db[_0x3f7f('0x16')]['belongsToMany'](db[_0x3f7f('0x149')],{'as':_0x3f7f('0x14a'),'through':_0x3f7f('0x14b')});db[_0x3f7f('0x18')][_0x3f7f('0x116')](db[_0x3f7f('0x2c')],{'as':_0x3f7f('0x14c'),'foreignKey':_0x3f7f('0x14d')});db['VoiceQueue'][_0x3f7f('0x116')](db[_0x3f7f('0x6f')],{'as':_0x3f7f('0x14e'),'foreignKey':'VoiceQueueId'});db[_0x3f7f('0x18')][_0x3f7f('0x116')](db[_0x3f7f('0x73')],{'as':_0x3f7f('0x11b'),'foreignKey':'VoiceQueueId'});db[_0x3f7f('0x18')][_0x3f7f('0x116')](db[_0x3f7f('0x75')],{'as':'HopperHistories','foreignKey':_0x3f7f('0x14d')});db['VoiceQueue'][_0x3f7f('0x116')](db[_0x3f7f('0x11d')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0x3f7f('0x18')][_0x3f7f('0x116')](db[_0x3f7f('0x71')],{'as':_0x3f7f('0x14f'),'foreignKey':_0x3f7f('0x14d')});db['VoiceQueue'][_0x3f7f('0x116')](db[_0x3f7f('0x150')],{'as':_0x3f7f('0x151'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x3f7f('0x125')](db[_0x3f7f('0x28')],{'as':'Trunk','foreignKey':_0x3f7f('0x152')});db[_0x3f7f('0x18')]['belongsTo'](db[_0x3f7f('0x28')],{'as':_0x3f7f('0x153'),'foreignKey':'TrunkBackupId'});db['VoiceQueue'][_0x3f7f('0x125')](db[_0x3f7f('0x81')],{'as':_0x3f7f('0x81'),'foreignKey':_0x3f7f('0x154')});db[_0x3f7f('0x18')][_0x3f7f('0x125')](db[_0x3f7f('0x82')],{'as':'mandatoryDispositionPause','foreignKey':_0x3f7f('0x155')});db[_0x3f7f('0x18')][_0x3f7f('0x126')](db['CmList'],{'as':'Lists','through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0x3f7f('0x126')](db[_0x3f7f('0x112')],{'as':'Agents','through':_0x3f7f('0x2e')});db[_0x3f7f('0x18')][_0x3f7f('0x126')](db[_0x3f7f('0xe6')],{'as':_0x3f7f('0x156'),'through':_0x3f7f('0x10c')});db[_0x3f7f('0x18')]['belongsToMany'](db[_0x3f7f('0x13b')],{'as':_0x3f7f('0x157'),'through':'voice_queues_has_cm_blacklists'});db[_0x3f7f('0x1a')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x112'),'foreignKey':_0x3f7f('0x115')});db[_0x3f7f('0x1b')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'as':'User','foreignKey':'UserId'});db['VoiceMail'][_0x3f7f('0x116')](db[_0x3f7f('0x1d')],{'as':_0x3f7f('0x158'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x159'),'sourceKey':_0x3f7f('0x15a')});db[_0x3f7f('0x1d')][_0x3f7f('0x125')](db[_0x3f7f('0x113')],{'foreignKey':_0x3f7f('0x159'),'targetKey':'mailbox'});db['VoiceCallReport'][_0x3f7f('0x116')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x3f7f('0x15b'),'constraints':![]});db[_0x3f7f('0x1f')][_0x3f7f('0x116')](db['VoiceAgentReport'],{'as':_0x3f7f('0x15c'),'foreignKey':'uniqueid','constraints':![]});db[_0x3f7f('0x1f')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x112'),'foreignKey':'UserId'});db['VoiceCallReport'][_0x3f7f('0x125')](db[_0x3f7f('0x6d')],{'as':_0x3f7f('0x15d'),'foreignKey':'ContactId'});db[_0x3f7f('0x37')]['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x3f7f('0x15e')});db['MailServerIn'][_0x3f7f('0x125')](db[_0x3f7f('0x10a')],{'as':_0x3f7f('0x10a'),'foreignKey':_0x3f7f('0x15f'),'onDelete':_0x3f7f('0x160')});db['MailServerOut']['belongsTo'](db['MailAccount'],{'as':_0x3f7f('0x161'),'foreignKey':_0x3f7f('0x15e')});db[_0x3f7f('0x162')][_0x3f7f('0x125')](db[_0x3f7f('0x10a')],{'as':'CloudProvider','foreignKey':_0x3f7f('0x15f'),'onDelete':'restrict'});db[_0x3f7f('0x161')]['hasOne'](db[_0x3f7f('0x37')],{'as':'Imap','onDelete':_0x3f7f('0x114')});db['MailAccount'][_0x3f7f('0x163')](db[_0x3f7f('0x162')],{'as':'Smtp','onDelete':_0x3f7f('0x114')});db[_0x3f7f('0x161')][_0x3f7f('0x116')](db[_0x3f7f('0x164')],{'as':_0x3f7f('0x165'),'foreignKey':_0x3f7f('0x15e'),'onDelete':_0x3f7f('0x114')});db['MailAccount'][_0x3f7f('0x116')](db[_0x3f7f('0x7d')],{'as':_0x3f7f('0x166'),'foreignKey':'MailAccountId'});db[_0x3f7f('0x161')][_0x3f7f('0x116')](db[_0x3f7f('0x3f')],{'as':_0x3f7f('0x158'),'foreignKey':_0x3f7f('0x15e')});db[_0x3f7f('0x161')]['hasMany'](db[_0x3f7f('0x3d')],{'as':_0x3f7f('0x167')});db[_0x3f7f('0x161')][_0x3f7f('0x116')](db['MailApplication'],{'as':'Applications'});db[_0x3f7f('0x161')][_0x3f7f('0x125')](db['CmList'],{'as':_0x3f7f('0x168'),'foreignKey':_0x3f7f('0x169')});db[_0x3f7f('0x161')][_0x3f7f('0x125')](db['Template'],{'as':'Template','foreignKey':_0x3f7f('0x16a')});db[_0x3f7f('0x161')][_0x3f7f('0x125')](db[_0x3f7f('0x82')],{'as':_0x3f7f('0x16b'),'foreignKey':_0x3f7f('0x155')});db[_0x3f7f('0x161')]['belongsToMany'](db[_0x3f7f('0x112')],{'as':'Agents','through':_0x3f7f('0x13f')});db[_0x3f7f('0x134')][_0x3f7f('0x126')](db[_0x3f7f('0x112')],{'as':'Agents','through':_0x3f7f('0x30')});db[_0x3f7f('0x134')]['belongsToMany'](db[_0x3f7f('0xe6')],{'through':_0x3f7f('0x16c'),'as':_0x3f7f('0x156')});db[_0x3f7f('0x3d')]['hasMany'](db[_0x3f7f('0x3f')],{'as':_0x3f7f('0x158'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x16d')});db[_0x3f7f('0x3d')][_0x3f7f('0x125')](db[_0x3f7f('0x161')],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x15e')});db[_0x3f7f('0x3d')][_0x3f7f('0x125')](db['CmContact'],{'as':'Contact','foreignKey':_0x3f7f('0x16f')});db[_0x3f7f('0x3d')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x170'),'foreignKey':_0x3f7f('0x115')});db['MailInteraction'][_0x3f7f('0x126')](db[_0x3f7f('0x8a')],{'through':_0x3f7f('0x171'),'as':_0x3f7f('0x172')});db[_0x3f7f('0x3d')][_0x3f7f('0x126')](db[_0x3f7f('0x8a')],{'through':_0x3f7f('0x171'),'as':_0x3f7f('0x173')});db['MailInteraction']['belongsToMany'](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x174'),'through':_0x3f7f('0x12e'),'foreignKey':_0x3f7f('0x16d')});db[_0x3f7f('0x3f')][_0x3f7f('0x116')](db[_0x3f7f('0xe9')],{'as':_0x3f7f('0x175'),'onDelete':'cascade'});db['MailMessage'][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'as':'User'});db['MailMessage'][_0x3f7f('0x125')](db['CmContact'],{'onDelete':_0x3f7f('0x114'),'as':_0x3f7f('0x15d')});db['MailMessage']['belongsTo'](db[_0x3f7f('0x3d')],{'as':_0x3f7f('0x176'),'foreignKey':_0x3f7f('0x16d')});db[_0x3f7f('0x3f')][_0x3f7f('0x125')](db[_0x3f7f('0x161')],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x15e')});db[_0x3f7f('0x3f')][_0x3f7f('0x125')](db[_0x3f7f('0x5d')],{'as':'ChatWebsite','foreignKey':_0x3f7f('0x177')});db[_0x3f7f('0x3f')][_0x3f7f('0x125')](db[_0x3f7f('0x65')],{'as':'ChatOfflineMessage','foreignKey':_0x3f7f('0x178')});db[_0x3f7f('0x179')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'onDelete':_0x3f7f('0x160')});db['MailApplication'][_0x3f7f('0x125')](db[_0x3f7f('0x134')],{'onDelete':'restrict'});db[_0x3f7f('0x179')][_0x3f7f('0x125')](db[_0x3f7f('0x161')],{'onDelete':'restrict'});db[_0x3f7f('0x179')][_0x3f7f('0x125')](db[_0x3f7f('0x81')],{'onDelete':_0x3f7f('0x160'),'foreignKey':_0x3f7f('0x154')});db['MailApplication'][_0x3f7f('0x125')](db['Tag'],{'onDelete':_0x3f7f('0x160'),'foreignKey':_0x3f7f('0x17a')});db[_0x3f7f('0x41')][_0x3f7f('0x125')](db[_0x3f7f('0x161')],{});db[_0x3f7f('0x41')][_0x3f7f('0x125')](db['CmList'],{'as':'List','foreignKey':_0x3f7f('0x169')});db[_0x3f7f('0x41')]['belongsTo'](db[_0x3f7f('0x6d')],{'as':_0x3f7f('0x15d'),'foreignKey':_0x3f7f('0x16f')});db[_0x3f7f('0x41')]['belongsTo'](db[_0x3f7f('0x3d')],{});db[_0x3f7f('0x41')][_0x3f7f('0x125')](db[_0x3f7f('0x3f')],{});db[_0x3f7f('0x41')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{});db[_0x3f7f('0x41')][_0x3f7f('0x125')](db[_0x3f7f('0x134')],{});db[_0x3f7f('0x42')][_0x3f7f('0x116')](db['DashboardItem'],{'as':_0x3f7f('0x17b'),'onDelete':_0x3f7f('0x114')});db[_0x3f7f('0x45')][_0x3f7f('0x116')](db[_0x3f7f('0x164')],{'as':_0x3f7f('0x165'),'foreignKey':_0x3f7f('0x17c'),'onDelete':'cascade'});db['FaxAccount'][_0x3f7f('0x116')](db[_0x3f7f('0x7d')],{'as':_0x3f7f('0x166'),'foreignKey':_0x3f7f('0x17c')});db['FaxAccount'][_0x3f7f('0x116')](db['FaxInteraction'],{'as':_0x3f7f('0x167')});db[_0x3f7f('0x45')][_0x3f7f('0x116')](db[_0x3f7f('0x47')],{'as':_0x3f7f('0x148')});db['FaxAccount'][_0x3f7f('0x116')](db[_0x3f7f('0x119')],{'as':_0x3f7f('0x17d'),'onDelete':_0x3f7f('0x114')});db[_0x3f7f('0x45')][_0x3f7f('0x116')](db[_0x3f7f('0x17e')],{'as':'Messages'});db['FaxAccount'][_0x3f7f('0x125')](db[_0x3f7f('0x28')],{'as':_0x3f7f('0x28')});db['FaxAccount'][_0x3f7f('0x125')](db[_0x3f7f('0x13b')],{'as':_0x3f7f('0x168'),'foreignKey':_0x3f7f('0x169')});db[_0x3f7f('0x45')][_0x3f7f('0x125')](db['Pause'],{'as':_0x3f7f('0x16b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3f7f('0x45')][_0x3f7f('0x126')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x17f'),'through':_0x3f7f('0x13e')});db['FaxApplication'][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'onDelete':_0x3f7f('0x160')});db[_0x3f7f('0x47')][_0x3f7f('0x125')](db[_0x3f7f('0x137')],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db[_0x3f7f('0x45')],{'onDelete':_0x3f7f('0x160')});db[_0x3f7f('0x47')][_0x3f7f('0x125')](db[_0x3f7f('0x8a')],{'onDelete':_0x3f7f('0x160'),'foreignKey':_0x3f7f('0x17a')});db[_0x3f7f('0x48')][_0x3f7f('0x116')](db[_0x3f7f('0x17e')],{'as':_0x3f7f('0x158'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x180')});db[_0x3f7f('0x48')][_0x3f7f('0x125')](db[_0x3f7f('0x45')],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x17c')});db[_0x3f7f('0x48')]['belongsTo'](db[_0x3f7f('0x6d')],{'as':_0x3f7f('0x15d'),'foreignKey':_0x3f7f('0x16f')});db[_0x3f7f('0x48')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x170'),'foreignKey':_0x3f7f('0x115')});db[_0x3f7f('0x48')][_0x3f7f('0x126')](db[_0x3f7f('0x8a')],{'through':_0x3f7f('0x181'),'as':'Tags'});db[_0x3f7f('0x48')][_0x3f7f('0x126')](db[_0x3f7f('0x8a')],{'through':_0x3f7f('0x181'),'as':_0x3f7f('0x173')});db[_0x3f7f('0x48')][_0x3f7f('0x126')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x174'),'through':_0x3f7f('0x131'),'foreignKey':_0x3f7f('0x180')});db[_0x3f7f('0x17e')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'onDelete':_0x3f7f('0x114'),'as':_0x3f7f('0x112')});db[_0x3f7f('0x17e')]['belongsTo'](db[_0x3f7f('0x48')],{'as':_0x3f7f('0x176'),'foreignKey':_0x3f7f('0x180')});db[_0x3f7f('0x17e')][_0x3f7f('0x125')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x3f7f('0x17e')][_0x3f7f('0x125')](db['Attachment'],{'as':_0x3f7f('0xe9'),'foreignKey':_0x3f7f('0x182')});db[_0x3f7f('0x17e')]['belongsTo'](db[_0x3f7f('0x45')],{'as':'Account','foreignKey':_0x3f7f('0x17c')});db[_0x3f7f('0x137')]['belongsToMany'](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x17f'),'through':_0x3f7f('0x32')});db[_0x3f7f('0x137')][_0x3f7f('0x126')](db[_0x3f7f('0xe6')],{'through':'team_has_fax_queues','as':_0x3f7f('0x156')});db['FaxQueueReport'][_0x3f7f('0x125')](db[_0x3f7f('0x45')],{});db['FaxQueueReport'][_0x3f7f('0x125')](db['CmList'],{'as':_0x3f7f('0x168'),'foreignKey':_0x3f7f('0x169')});db['FaxQueueReport'][_0x3f7f('0x125')](db[_0x3f7f('0x6d')],{'as':'Contact','foreignKey':'ContactId'});db[_0x3f7f('0x4b')][_0x3f7f('0x125')](db[_0x3f7f('0x48')],{});db[_0x3f7f('0x4b')][_0x3f7f('0x125')](db['FaxMessage'],{});db[_0x3f7f('0x4b')][_0x3f7f('0x125')](db['User'],{});db[_0x3f7f('0x4b')][_0x3f7f('0x125')](db['FaxQueue'],{});db['SmsAccount']['hasMany'](db[_0x3f7f('0x164')],{'as':_0x3f7f('0x165'),'foreignKey':_0x3f7f('0x183'),'onDelete':_0x3f7f('0x114')});db[_0x3f7f('0x4d')][_0x3f7f('0x116')](db[_0x3f7f('0x7d')],{'as':_0x3f7f('0x166'),'foreignKey':_0x3f7f('0x183')});db[_0x3f7f('0x4d')][_0x3f7f('0x116')](db[_0x3f7f('0x184')],{'as':_0x3f7f('0x158'),'foreignKey':'SmsAccountId'});db[_0x3f7f('0x4d')][_0x3f7f('0x116')](db['SmsInteraction'],{'as':_0x3f7f('0x167')});db[_0x3f7f('0x4d')]['hasMany'](db[_0x3f7f('0x4f')],{'as':_0x3f7f('0x148')});db['SmsAccount']['belongsTo'](db[_0x3f7f('0x13b')],{'as':_0x3f7f('0x168'),'foreignKey':_0x3f7f('0x169')});db[_0x3f7f('0x4d')][_0x3f7f('0x125')](db[_0x3f7f('0x82')],{'as':_0x3f7f('0x16b'),'foreignKey':'mandatoryDispositionPauseId'});db['SmsAccount'][_0x3f7f('0x126')](db['User'],{'as':_0x3f7f('0x17f'),'through':'user_has_sms_accounts'});db[_0x3f7f('0x4f')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'onDelete':'restrict'});db[_0x3f7f('0x4f')][_0x3f7f('0x125')](db['SmsQueue'],{'onDelete':_0x3f7f('0x160')});db[_0x3f7f('0x4f')][_0x3f7f('0x125')](db[_0x3f7f('0x4d')],{'onDelete':_0x3f7f('0x160')});db[_0x3f7f('0x4f')]['belongsTo'](db[_0x3f7f('0x81')],{'onDelete':_0x3f7f('0x160'),'foreignKey':_0x3f7f('0x154')});db[_0x3f7f('0x4f')]['belongsTo'](db[_0x3f7f('0x8a')],{'onDelete':'restrict','foreignKey':_0x3f7f('0x17a')});db[_0x3f7f('0x51')][_0x3f7f('0x116')](db[_0x3f7f('0x184')],{'as':_0x3f7f('0x158'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x185')});db['SmsInteraction'][_0x3f7f('0x125')](db[_0x3f7f('0x4d')],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x183')});db[_0x3f7f('0x51')][_0x3f7f('0x125')](db[_0x3f7f('0x6d')],{'as':_0x3f7f('0x15d'),'foreignKey':'ContactId'});db[_0x3f7f('0x51')][_0x3f7f('0x125')](db['User'],{'as':_0x3f7f('0x170'),'foreignKey':_0x3f7f('0x115')});db[_0x3f7f('0x51')][_0x3f7f('0x126')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x3f7f('0x172')});db['SmsInteraction'][_0x3f7f('0x126')](db[_0x3f7f('0x8a')],{'through':'sms_interaction_has_tags','as':_0x3f7f('0x173')});db['SmsInteraction'][_0x3f7f('0x126')](db['User'],{'as':_0x3f7f('0x174'),'through':_0x3f7f('0x186'),'foreignKey':_0x3f7f('0x185')});db[_0x3f7f('0x184')]['belongsTo'](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x112')});db[_0x3f7f('0x184')][_0x3f7f('0x125')](db[_0x3f7f('0x6d')],{'onDelete':_0x3f7f('0x114'),'as':_0x3f7f('0x15d')});db['SmsMessage']['belongsTo'](db[_0x3f7f('0x51')],{'onDelete':'cascade','as':_0x3f7f('0x176'),'foreignKey':'SmsInteractionId'});db[_0x3f7f('0x184')][_0x3f7f('0x125')](db[_0x3f7f('0x4d')],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x183')});db[_0x3f7f('0x52')]['belongsToMany'](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x17f'),'through':_0x3f7f('0x138'),'foreignKey':_0x3f7f('0x187')});db[_0x3f7f('0x52')]['belongsToMany'](db[_0x3f7f('0xe6')],{'through':_0x3f7f('0x188'),'as':_0x3f7f('0x156')});db[_0x3f7f('0x140')][_0x3f7f('0x116')](db[_0x3f7f('0x164')],{'as':_0x3f7f('0x165'),'foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db['OpenchannelAccount'][_0x3f7f('0x116')](db['CannedAnswer'],{'as':_0x3f7f('0x166'),'foreignKey':'OpenchannelAccountId'});db[_0x3f7f('0x140')][_0x3f7f('0x116')](db[_0x3f7f('0x57')],{'as':_0x3f7f('0x167'),'foreignKey':_0x3f7f('0x189')});db['OpenchannelAccount'][_0x3f7f('0x116')](db[_0x3f7f('0x59')],{'as':_0x3f7f('0x158'),'foreignKey':_0x3f7f('0x189')});db[_0x3f7f('0x140')][_0x3f7f('0x116')](db[_0x3f7f('0x55')],{'as':_0x3f7f('0x148'),'foreignKey':'OpenchannelAccountId'});db[_0x3f7f('0x140')]['belongsTo'](db['CmList'],{'as':_0x3f7f('0x168'),'foreignKey':_0x3f7f('0x169')});db[_0x3f7f('0x140')][_0x3f7f('0x125')](db[_0x3f7f('0x82')],{'as':_0x3f7f('0x16b'),'foreignKey':_0x3f7f('0x155')});db[_0x3f7f('0x140')]['belongsToMany'](db[_0x3f7f('0x112')],{'as':'Agents','through':_0x3f7f('0x141')});db['OpenchannelApplication'][_0x3f7f('0x125')](db['User'],{'onDelete':_0x3f7f('0x160')});db[_0x3f7f('0x55')][_0x3f7f('0x125')](db[_0x3f7f('0x5b')],{'onDelete':'restrict','foreignKey':_0x3f7f('0x18a')});db[_0x3f7f('0x55')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x3f7f('0x160'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication']['belongsTo'](db[_0x3f7f('0x81')],{'onDelete':_0x3f7f('0x160'),'foreignKey':'IntervalId'});db[_0x3f7f('0x55')]['belongsTo'](db[_0x3f7f('0x8a')],{'onDelete':'restrict','foreignKey':_0x3f7f('0x17a')});db[_0x3f7f('0x57')][_0x3f7f('0x116')](db[_0x3f7f('0x59')],{'as':_0x3f7f('0x158'),'onDelete':'cascade','foreignKey':_0x3f7f('0x18b')});db['OpenchannelInteraction'][_0x3f7f('0x125')](db[_0x3f7f('0x140')],{'as':'Account','foreignKey':_0x3f7f('0x189')});db[_0x3f7f('0x57')][_0x3f7f('0x125')](db[_0x3f7f('0x6d')],{'as':_0x3f7f('0x15d'),'foreignKey':'ContactId'});db[_0x3f7f('0x57')]['belongsTo'](db[_0x3f7f('0x112')],{'as':'Owner','foreignKey':'UserId'});db['OpenchannelInteraction'][_0x3f7f('0x126')](db[_0x3f7f('0x8a')],{'through':_0x3f7f('0x18c'),'as':_0x3f7f('0x172')});db['OpenchannelInteraction'][_0x3f7f('0x126')](db['Tag'],{'through':_0x3f7f('0x18c'),'as':'ThroughTags'});db[_0x3f7f('0x57')][_0x3f7f('0x126')](db['User'],{'as':_0x3f7f('0x174'),'through':_0x3f7f('0x18d'),'foreignKey':_0x3f7f('0x18b')});db[_0x3f7f('0x59')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'onDelete':_0x3f7f('0x114'),'as':_0x3f7f('0x112')});db[_0x3f7f('0x59')]['belongsTo'](db[_0x3f7f('0x6d')],{'onDelete':_0x3f7f('0x114'),'as':_0x3f7f('0x15d')});db['OpenchannelMessage'][_0x3f7f('0x125')](db[_0x3f7f('0x57')],{'onDelete':_0x3f7f('0x114'),'as':_0x3f7f('0x176'),'foreignKey':'OpenchannelInteractionId'});db[_0x3f7f('0x59')][_0x3f7f('0x125')](db['Attachment'],{'as':_0x3f7f('0xe9'),'foreignKey':_0x3f7f('0x182')});db['OpenchannelMessage'][_0x3f7f('0x125')](db[_0x3f7f('0x140')],{'as':_0x3f7f('0x16e'),'foreignKey':'OpenchannelAccountId'});db[_0x3f7f('0x5b')][_0x3f7f('0x126')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x17f'),'through':_0x3f7f('0x34'),'foreignKey':_0x3f7f('0x18a')});db[_0x3f7f('0x5b')][_0x3f7f('0x126')](db[_0x3f7f('0xe6')],{'through':'team_has_openchannel_queues','as':_0x3f7f('0x156')});db['ChatWebsite'][_0x3f7f('0x116')](db[_0x3f7f('0x164')],{'as':_0x3f7f('0x165'),'foreignKey':_0x3f7f('0x177'),'onDelete':_0x3f7f('0x114')});db[_0x3f7f('0x5d')]['hasMany'](db[_0x3f7f('0x7d')],{'as':_0x3f7f('0x166'),'foreignKey':_0x3f7f('0x177')});db['ChatWebsite']['hasMany'](db[_0x3f7f('0x6a')],{'as':'ProactiveActions'});db[_0x3f7f('0x5d')]['hasMany'](db['ChatInteraction'],{'as':'Interactions'});db[_0x3f7f('0x5d')][_0x3f7f('0x116')](db[_0x3f7f('0x18e')],{'as':_0x3f7f('0x148')});db[_0x3f7f('0x5d')][_0x3f7f('0x116')](db['ChatMessage'],{'as':'Messages'});db[_0x3f7f('0x5d')][_0x3f7f('0x125')](db[_0x3f7f('0x13b')],{'as':_0x3f7f('0x168'),'foreignKey':_0x3f7f('0x169')});db[_0x3f7f('0x5d')]['belongsTo'](db[_0x3f7f('0x81')],{'as':_0x3f7f('0x81'),'foreignKey':'IntervalId'});db[_0x3f7f('0x5d')]['belongsTo'](db[_0x3f7f('0x161')],{'as':_0x3f7f('0x161'),'foreignKey':_0x3f7f('0x15e')});db['ChatWebsite'][_0x3f7f('0x125')](db[_0x3f7f('0x82')],{'as':_0x3f7f('0x16b'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite']['belongsToMany'](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x17f'),'through':_0x3f7f('0x18f')});db[_0x3f7f('0x5e')][_0x3f7f('0x125')](db[_0x3f7f('0x140')],{});db[_0x3f7f('0x5e')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x3f7f('0x169')});db[_0x3f7f('0x5e')][_0x3f7f('0x125')](db[_0x3f7f('0x6d')],{'as':_0x3f7f('0x15d'),'foreignKey':_0x3f7f('0x16f')});db[_0x3f7f('0x5e')][_0x3f7f('0x125')](db['OpenchannelInteraction'],{});db[_0x3f7f('0x5e')]['belongsTo'](db[_0x3f7f('0x59')],{});db[_0x3f7f('0x5e')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{});db[_0x3f7f('0x5e')]['belongsTo'](db['OpenchannelQueue'],{});db[_0x3f7f('0x18e')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x190'),'foreignKey':_0x3f7f('0x115'),'onDelete':_0x3f7f('0x160')});db[_0x3f7f('0x18e')]['belongsTo'](db['ChatQueue'],{'as':_0x3f7f('0x191'),'foreignKey':_0x3f7f('0x192'),'onDelete':_0x3f7f('0x160')});db[_0x3f7f('0x18e')][_0x3f7f('0x125')](db[_0x3f7f('0x5d')],{'as':'Website','foreignKey':_0x3f7f('0x177'),'onDelete':_0x3f7f('0x160')});db[_0x3f7f('0x18e')][_0x3f7f('0x125')](db[_0x3f7f('0x8a')],{'onDelete':_0x3f7f('0x160'),'foreignKey':_0x3f7f('0x17a')});db[_0x3f7f('0x61')]['hasMany'](db[_0x3f7f('0x63')],{'as':_0x3f7f('0x158'),'onDelete':'cascade','foreignKey':_0x3f7f('0x193')});db[_0x3f7f('0x61')][_0x3f7f('0x125')](db[_0x3f7f('0x5d')],{'as':_0x3f7f('0x16e'),'foreignKey':'ChatWebsiteId'});db[_0x3f7f('0x61')]['belongsTo'](db['CmContact'],{'as':_0x3f7f('0x15d'),'foreignKey':_0x3f7f('0x16f')});db[_0x3f7f('0x61')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x170'),'foreignKey':_0x3f7f('0x115')});db[_0x3f7f('0x61')][_0x3f7f('0x126')](db[_0x3f7f('0x8a')],{'through':_0x3f7f('0x194'),'as':_0x3f7f('0x172')});db['ChatInteraction'][_0x3f7f('0x126')](db[_0x3f7f('0x8a')],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db[_0x3f7f('0x61')][_0x3f7f('0x126')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x174'),'through':'user_has_chat_interactions','foreignKey':_0x3f7f('0x193')});db[_0x3f7f('0x63')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'onDelete':_0x3f7f('0x114'),'as':'User'});db[_0x3f7f('0x63')][_0x3f7f('0x125')](db[_0x3f7f('0x6d')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x3f7f('0x16f')});db['ChatMessage'][_0x3f7f('0x125')](db[_0x3f7f('0x61')],{'onDelete':_0x3f7f('0x114'),'as':_0x3f7f('0x176'),'foreignKey':_0x3f7f('0x193')});db[_0x3f7f('0x63')][_0x3f7f('0x125')](db[_0x3f7f('0xe9')],{'as':_0x3f7f('0xe9'),'foreignKey':_0x3f7f('0x182')});db[_0x3f7f('0x63')]['belongsTo'](db[_0x3f7f('0x5d')],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x177')});db[_0x3f7f('0x65')]['hasMany'](db['Attachment'],{'as':_0x3f7f('0x175'),'foreignKey':_0x3f7f('0x178'),'onDelete':'cascade','hooks':!![]});db[_0x3f7f('0x65')][_0x3f7f('0x125')](db['CmContact'],{'onDelete':_0x3f7f('0x114'),'as':'Contact','foreignKey':_0x3f7f('0x16f')});db[_0x3f7f('0x65')][_0x3f7f('0x125')](db[_0x3f7f('0x5d')],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x177')});db['ChatQueue'][_0x3f7f('0x126')](db['User'],{'as':'Agents','through':_0x3f7f('0x2f'),'hooks':!![]});db[_0x3f7f('0x67')][_0x3f7f('0x126')](db[_0x3f7f('0xe6')],{'through':_0x3f7f('0x195'),'as':_0x3f7f('0x156')});db[_0x3f7f('0x127')]['hasMany'](db[_0x3f7f('0xd2')],{'as':_0x3f7f('0x158'),'foreignKey':_0x3f7f('0x196'),'onDelete':_0x3f7f('0x114')});db[_0x3f7f('0x127')][_0x3f7f('0x126')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x14c'),'through':_0x3f7f('0x129')});db['ChatProactiveAction'][_0x3f7f('0x125')](db['ChatWebsite'],{'as':_0x3f7f('0x197'),'foreignKey':_0x3f7f('0x177')});db[_0x3f7f('0x6b')][_0x3f7f('0x116')](db['CmContact'],{'as':_0x3f7f('0x12a'),'foreignKey':_0x3f7f('0x198')});db[_0x3f7f('0x6d')]['hasMany'](db[_0x3f7f('0x6f')],{'as':_0x3f7f('0x14e'),'foreignKey':_0x3f7f('0x16f')});db[_0x3f7f('0x6d')]['hasMany'](db[_0x3f7f('0x73')],{'as':_0x3f7f('0x11b'),'foreignKey':'ContactId'});db[_0x3f7f('0x6d')][_0x3f7f('0x116')](db[_0x3f7f('0x75')],{'as':'HopperHistories','foreignKey':_0x3f7f('0x16f')});db['CmContact'][_0x3f7f('0x116')](db[_0x3f7f('0x11d')],{'as':_0x3f7f('0x11d'),'foreignKey':'ContactId'});db[_0x3f7f('0x6d')][_0x3f7f('0x116')](db[_0x3f7f('0x150')],{'as':_0x3f7f('0x151'),'foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0x3f7f('0x57')],{'as':_0x3f7f('0x11e'),'foreignKey':_0x3f7f('0x16f'),'onDelete':_0x3f7f('0x160')});db[_0x3f7f('0x6d')][_0x3f7f('0x116')](db[_0x3f7f('0x61')],{'as':_0x3f7f('0x12f'),'foreignKey':'ContactId','onDelete':_0x3f7f('0x160')});db[_0x3f7f('0x6d')]['hasMany'](db[_0x3f7f('0x51')],{'as':_0x3f7f('0x11f'),'foreignKey':_0x3f7f('0x16f'),'onDelete':'restrict'});db[_0x3f7f('0x6d')][_0x3f7f('0x116')](db[_0x3f7f('0x48')],{'as':_0x3f7f('0x120'),'foreignKey':_0x3f7f('0x16f'),'onDelete':'restrict'});db[_0x3f7f('0x6d')]['hasMany'](db[_0x3f7f('0x3d')],{'as':_0x3f7f('0x121'),'foreignKey':_0x3f7f('0x16f'),'onDelete':_0x3f7f('0x160')});db['CmContact'][_0x3f7f('0x125')](db[_0x3f7f('0x6b')],{'as':_0x3f7f('0x199'),'foreignKey':_0x3f7f('0x198')});db[_0x3f7f('0x6d')]['belongsTo'](db[_0x3f7f('0x13b')],{'as':_0x3f7f('0x168'),'foreignKey':_0x3f7f('0x169'),'onDelete':_0x3f7f('0x114')});db['CmContact'][_0x3f7f('0x126')](db['User'],{'as':_0x3f7f('0x174'),'through':_0x3f7f('0x12b')});db[_0x3f7f('0x6d')][_0x3f7f('0x126')](db[_0x3f7f('0x8a')],{'as':'Tags','through':_0x3f7f('0x19a')});db[_0x3f7f('0x6d')][_0x3f7f('0x126')](db[_0x3f7f('0x8a')],{'through':_0x3f7f('0x19a'),'as':'ThroughTags'});db['CmHopper'][_0x3f7f('0x125')](db[_0x3f7f('0x6d')],{'as':_0x3f7f('0x15d'),'foreignKey':_0x3f7f('0x16f'),'onDelete':'cascade'});db['CmHopper'][_0x3f7f('0x125')](db[_0x3f7f('0x13b')],{'as':_0x3f7f('0x168'),'foreignKey':_0x3f7f('0x169'),'onDelete':'cascade'});db[_0x3f7f('0x6f')]['belongsTo'](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x190'),'foreignKey':'UserId'});db[_0x3f7f('0x6f')]['belongsTo'](db['VoiceQueue'],{'as':_0x3f7f('0x191'),'foreignKey':'VoiceQueueId','onDelete':_0x3f7f('0x114')});db['CmHopper'][_0x3f7f('0x125')](db[_0x3f7f('0x19b')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db[_0x3f7f('0x6f')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x170'),'foreignKey':_0x3f7f('0x19c')});db[_0x3f7f('0x71')][_0x3f7f('0x125')](db[_0x3f7f('0x6d')],{'as':_0x3f7f('0x15d'),'foreignKey':_0x3f7f('0x16f'),'onDelete':_0x3f7f('0x114')});db['CmHopperBlack']['belongsTo'](db[_0x3f7f('0x13b')],{'as':'List','foreignKey':_0x3f7f('0x169'),'onDelete':'cascade'});db[_0x3f7f('0x71')][_0x3f7f('0x125')](db[_0x3f7f('0x18')],{'as':_0x3f7f('0x191'),'foreignKey':_0x3f7f('0x14d'),'onDelete':_0x3f7f('0x114')});db[_0x3f7f('0x71')]['belongsTo'](db[_0x3f7f('0x19b')],{'as':_0x3f7f('0x19b'),'foreignKey':_0x3f7f('0x19d'),'onDelete':_0x3f7f('0x114')});db['Automation'][_0x3f7f('0x116')](db[_0x3f7f('0x80')],{'as':{'plural':'All','singular':_0x3f7f('0x19e')},'foreignKey':_0x3f7f('0x19f'),'onDelete':'cascade','hooks':!![]});db[_0x3f7f('0x7b')][_0x3f7f('0x116')](db[_0x3f7f('0x80')],{'as':{'plural':_0x3f7f('0x1a0'),'singular':_0x3f7f('0x1a1')},'foreignKey':_0x3f7f('0x1a2'),'onDelete':_0x3f7f('0x114'),'hooks':!![]});db['Automation']['hasMany'](db[_0x3f7f('0x7a')],{'as':'Actions','foreignKey':_0x3f7f('0x1a3'),'onDelete':'cascade','hooks':!![]});db[_0x3f7f('0x164')][_0x3f7f('0x116')](db[_0x3f7f('0x164')],{'as':_0x3f7f('0x165'),'foreignKey':_0x3f7f('0x1a4'),'onDelete':_0x3f7f('0x114')});db[_0x3f7f('0x81')][_0x3f7f('0x116')](db[_0x3f7f('0x81')],{'as':_0x3f7f('0x1a5'),'foreignKey':_0x3f7f('0x154'),'onDelete':_0x3f7f('0x114'),'hooks':!![],'required':![]});db[_0x3f7f('0x81')]['hasMany'](db[_0x3f7f('0x119')],{'as':'Extensions','foreignKey':_0x3f7f('0x154'),'onDelete':_0x3f7f('0x160')});db[_0x3f7f('0x81')]['hasMany'](db[_0x3f7f('0x179')],{'as':_0x3f7f('0x1a6'),'foreignKey':'IntervalId'});db[_0x3f7f('0x81')]['hasMany'](db[_0x3f7f('0x18e')],{'as':_0x3f7f('0x1a7'),'foreignKey':_0x3f7f('0x154')});db['Interval']['hasMany'](db[_0x3f7f('0x47')],{'as':_0x3f7f('0x1a8'),'foreignKey':'IntervalId'});db[_0x3f7f('0x81')][_0x3f7f('0x116')](db[_0x3f7f('0x4f')],{'as':_0x3f7f('0x1a9'),'foreignKey':'IntervalId'});db[_0x3f7f('0x88')][_0x3f7f('0x125')](db[_0x3f7f('0x161')],{});db[_0x3f7f('0x88')][_0x3f7f('0x125')](db[_0x3f7f('0x95')],{'foreignKey':'DefaultReportId'});db[_0x3f7f('0x88')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x3f7f('0x1aa')});db[_0x3f7f('0x149')][_0x3f7f('0x126')](db[_0x3f7f('0x16')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0x3f7f('0x160')});db['Tag'][_0x3f7f('0x126')](db[_0x3f7f('0x6d')],{'through':_0x3f7f('0x19a')});db['Tag']['belongsToMany'](db['ChatInteraction'],{'through':_0x3f7f('0x194')});db[_0x3f7f('0x8a')][_0x3f7f('0x126')](db[_0x3f7f('0x3d')],{'through':_0x3f7f('0x171')});db[_0x3f7f('0x8a')][_0x3f7f('0x126')](db[_0x3f7f('0x51')],{'through':_0x3f7f('0x1ab')});db[_0x3f7f('0x8a')][_0x3f7f('0x126')](db[_0x3f7f('0x48')],{'through':_0x3f7f('0x181')});db[_0x3f7f('0x8a')][_0x3f7f('0x126')](db['OpenchannelInteraction'],{'through':_0x3f7f('0x18c')});db[_0x3f7f('0x8a')][_0x3f7f('0x126')](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db['Trigger']['hasMany'](db['Condition'],{'as':{'plural':_0x3f7f('0x1ac'),'singular':'AllCondition'},'foreignKey':_0x3f7f('0x1ad'),'onDelete':_0x3f7f('0x114'),'hooks':!![]});db[_0x3f7f('0x8e')][_0x3f7f('0x116')](db[_0x3f7f('0x80')],{'as':{'plural':_0x3f7f('0x1ae'),'singular':_0x3f7f('0x1af')},'foreignKey':_0x3f7f('0x1b0'),'onDelete':_0x3f7f('0x114'),'hooks':!![]});db[_0x3f7f('0x8e')]['hasMany'](db[_0x3f7f('0x7a')],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0x3f7f('0x114'),'hooks':!![]});db[_0x3f7f('0x1b1')]['hasMany'](db[_0x3f7f('0x9b')],{'as':'Fields','onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1aa'),'hooks':!![]});db['AnalyticDefaultReport'][_0x3f7f('0x116')](db[_0x3f7f('0x9b')],{'as':_0x3f7f('0x1b2'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db['AnalyticMetric']['hasMany'](db[_0x3f7f('0x9b')],{'as':_0x3f7f('0x1b2'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0x3f7f('0x9b')]['belongsTo'](db[_0x3f7f('0x99')],{'foreignKey':_0x3f7f('0x1b3')});db[_0x3f7f('0x9c')][_0x3f7f('0x116')](db[_0x3f7f('0x9e')],{'as':'Configurations','onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0x9e')][_0x3f7f('0x116')](db[_0x3f7f('0x9f')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x3f7f('0x9e')][_0x3f7f('0x116')](db[_0x3f7f('0x9f')],{'as':_0x3f7f('0x1b5'),'onDelete':'cascade','foreignKey':_0x3f7f('0x1b6')});db['SalesforceConfiguration'][_0x3f7f('0x116')](db[_0x3f7f('0x9f')],{'as':_0x3f7f('0x1b2'),'onDelete':_0x3f7f('0x114'),'foreignKey':'FieldId'});db[_0x3f7f('0x9e')][_0x3f7f('0x125')](db[_0x3f7f('0x9c')],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0x9f')][_0x3f7f('0x116')](db[_0x3f7f('0x9f')],{'as':_0x3f7f('0x1b7'),'foreignKey':_0x3f7f('0x1b8')});db[_0x3f7f('0x9f')][_0x3f7f('0x116')](db['SalesforceField'],{'as':_0x3f7f('0x1b9'),'foreignKey':_0x3f7f('0x1b6')});db[_0x3f7f('0x9f')][_0x3f7f('0x116')](db[_0x3f7f('0x9f')],{'as':_0x3f7f('0x1ba'),'foreignKey':'FieldId'});db[_0x3f7f('0x9f')][_0x3f7f('0x125')](db[_0x3f7f('0x8f')],{'as':'Variable','foreignKey':_0x3f7f('0x1bb')});db[_0x3f7f('0x1bc')][_0x3f7f('0x116')](db[_0x3f7f('0xa1')],{'as':_0x3f7f('0x1bd'),'onDelete':_0x3f7f('0x114'),'foreignKey':'AccountId'});db[_0x3f7f('0xa1')][_0x3f7f('0x116')](db[_0x3f7f('0xa2')],{'as':_0x3f7f('0x1be'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1b8')});db['SugarcrmConfiguration'][_0x3f7f('0x116')](db['SugarcrmField'],{'as':_0x3f7f('0x1b5'),'onDelete':'cascade','foreignKey':_0x3f7f('0x1b6')});db[_0x3f7f('0xa1')][_0x3f7f('0x116')](db[_0x3f7f('0xa2')],{'as':_0x3f7f('0x1b2'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1bf')});db['SugarcrmConfiguration'][_0x3f7f('0x125')](db[_0x3f7f('0x1bc')],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xa2')][_0x3f7f('0x116')](db[_0x3f7f('0xa2')],{'as':_0x3f7f('0x1b7'),'foreignKey':_0x3f7f('0x1b8')});db[_0x3f7f('0xa2')][_0x3f7f('0x116')](db[_0x3f7f('0xa2')],{'as':_0x3f7f('0x1b9'),'foreignKey':_0x3f7f('0x1b6')});db[_0x3f7f('0xa2')][_0x3f7f('0x116')](db[_0x3f7f('0xa2')],{'as':_0x3f7f('0x1ba'),'foreignKey':_0x3f7f('0x1bf')});db[_0x3f7f('0xa2')][_0x3f7f('0x125')](db[_0x3f7f('0x8f')],{'as':_0x3f7f('0x8f'),'foreignKey':'VariableId'});db[_0x3f7f('0xa4')]['hasMany'](db[_0x3f7f('0xa6')],{'as':_0x3f7f('0x1bd'),'onDelete':'cascade','foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xa6')][_0x3f7f('0x116')](db[_0x3f7f('0x1c0')],{'as':_0x3f7f('0x1be'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1b8')});db[_0x3f7f('0xa6')]['hasMany'](db['DeskField'],{'as':_0x3f7f('0x1b5'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1b6')});db['DeskConfiguration']['hasMany'](db[_0x3f7f('0x1c0')],{'as':_0x3f7f('0x1b2'),'onDelete':'cascade','foreignKey':_0x3f7f('0x1bf')});db[_0x3f7f('0xa6')][_0x3f7f('0x125')](db[_0x3f7f('0xa4')],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xa6')][_0x3f7f('0x126')](db['Tag'],{'through':_0x3f7f('0x1c1')});db[_0x3f7f('0x1c0')][_0x3f7f('0x116')](db[_0x3f7f('0x1c0')],{'as':_0x3f7f('0x1b7'),'foreignKey':_0x3f7f('0x1b8')});db[_0x3f7f('0x1c0')][_0x3f7f('0x116')](db[_0x3f7f('0x1c0')],{'as':_0x3f7f('0x1b9'),'foreignKey':_0x3f7f('0x1b6')});db[_0x3f7f('0x1c0')]['hasMany'](db[_0x3f7f('0x1c0')],{'as':_0x3f7f('0x1ba'),'foreignKey':_0x3f7f('0x1bf')});db[_0x3f7f('0x1c0')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x3f7f('0x1bb')});db['ZohoAccount']['hasMany'](db[_0x3f7f('0xab')],{'as':_0x3f7f('0x1bd'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xab')][_0x3f7f('0x116')](db[_0x3f7f('0xad')],{'as':_0x3f7f('0x1be'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1b8')});db[_0x3f7f('0xab')][_0x3f7f('0x116')](db['ZohoField'],{'as':'Descriptions','onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1b6')});db['ZohoConfiguration'][_0x3f7f('0x116')](db['ZohoField'],{'as':'Fields','onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1bf')});db[_0x3f7f('0xab')]['belongsTo'](db[_0x3f7f('0xa9')],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xad')][_0x3f7f('0x116')](db[_0x3f7f('0xad')],{'as':_0x3f7f('0x1b7'),'foreignKey':'SubjectId'});db[_0x3f7f('0xad')][_0x3f7f('0x116')](db[_0x3f7f('0xad')],{'as':_0x3f7f('0x1b9'),'foreignKey':_0x3f7f('0x1b6')});db[_0x3f7f('0xad')][_0x3f7f('0x116')](db[_0x3f7f('0xad')],{'as':'Field','foreignKey':_0x3f7f('0x1bf')});db[_0x3f7f('0xad')][_0x3f7f('0x125')](db[_0x3f7f('0x8f')],{'as':_0x3f7f('0x8f'),'foreignKey':_0x3f7f('0x1bb')});db['ZendeskAccount']['hasMany'](db[_0x3f7f('0xb1')],{'as':_0x3f7f('0x1bd'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xb1')][_0x3f7f('0x116')](db['ZendeskField'],{'as':'Subjects','foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0x3f7f('0x116')](db[_0x3f7f('0xb2')],{'as':_0x3f7f('0x1b5'),'foreignKey':_0x3f7f('0x1b6')});db[_0x3f7f('0xb1')]['hasMany'](db[_0x3f7f('0xb2')],{'as':_0x3f7f('0x1b2'),'foreignKey':_0x3f7f('0x1bf')});db[_0x3f7f('0xb1')][_0x3f7f('0x125')](db['ZendeskAccount'],{'as':_0x3f7f('0x16e'),'foreignKey':'AccountId'});db[_0x3f7f('0xb1')][_0x3f7f('0x126')](db[_0x3f7f('0x8a')],{'through':'int_zendesk_configuration_has_tags'});db[_0x3f7f('0xb2')][_0x3f7f('0x116')](db[_0x3f7f('0xb2')],{'as':_0x3f7f('0x1b7'),'foreignKey':_0x3f7f('0x1b8')});db[_0x3f7f('0xb2')][_0x3f7f('0x116')](db['ZendeskField'],{'as':'Description','foreignKey':_0x3f7f('0x1b6')});db[_0x3f7f('0xb2')][_0x3f7f('0x116')](db[_0x3f7f('0xb2')],{'as':_0x3f7f('0x1ba'),'foreignKey':'FieldId'});db[_0x3f7f('0xb2')][_0x3f7f('0x125')](db[_0x3f7f('0x8f')],{'as':_0x3f7f('0x8f'),'foreignKey':_0x3f7f('0x1bb')});db[_0x3f7f('0x1c2')]['hasMany'](db[_0x3f7f('0xb5')],{'as':'Configurations','onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xb5')][_0x3f7f('0x116')](db[_0x3f7f('0xb7')],{'as':_0x3f7f('0x1be'),'onDelete':_0x3f7f('0x114'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x3f7f('0x116')](db[_0x3f7f('0xb7')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x3f7f('0xb5')][_0x3f7f('0x116')](db['FreshdeskField'],{'as':_0x3f7f('0x1b2'),'onDelete':'cascade','foreignKey':'FieldId'});db['FreshdeskConfiguration'][_0x3f7f('0x125')](db['FreshdeskAccount'],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xb5')][_0x3f7f('0x126')](db[_0x3f7f('0x8a')],{'through':_0x3f7f('0x1c3')});db[_0x3f7f('0xb7')][_0x3f7f('0x116')](db[_0x3f7f('0xb7')],{'as':_0x3f7f('0x1b7'),'foreignKey':_0x3f7f('0x1b8')});db[_0x3f7f('0xb7')][_0x3f7f('0x116')](db[_0x3f7f('0xb7')],{'as':_0x3f7f('0x1b9'),'foreignKey':'DescriptionId'});db[_0x3f7f('0xb7')][_0x3f7f('0x116')](db[_0x3f7f('0xb7')],{'as':_0x3f7f('0x1ba'),'foreignKey':'FieldId'});db[_0x3f7f('0xb7')]['belongsTo'](db['Variable'],{'as':_0x3f7f('0x8f'),'foreignKey':_0x3f7f('0x1bb')});db[_0x3f7f('0xb9')][_0x3f7f('0x116')](db['VtigerConfiguration'],{'as':_0x3f7f('0x1bd'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xbb')][_0x3f7f('0x116')](db['VtigerField'],{'as':_0x3f7f('0x1be'),'foreignKey':_0x3f7f('0x1b8')});db[_0x3f7f('0xbb')][_0x3f7f('0x116')](db[_0x3f7f('0xbd')],{'as':_0x3f7f('0x1b5'),'foreignKey':_0x3f7f('0x1b6')});db[_0x3f7f('0xbb')][_0x3f7f('0x116')](db[_0x3f7f('0xbd')],{'as':_0x3f7f('0x1b2'),'foreignKey':'FieldId'});db[_0x3f7f('0xbb')][_0x3f7f('0x125')](db[_0x3f7f('0xb9')],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xbd')][_0x3f7f('0x116')](db[_0x3f7f('0xbd')],{'as':_0x3f7f('0x1b7'),'foreignKey':_0x3f7f('0x1b8')});db['VtigerField'][_0x3f7f('0x116')](db['VtigerField'],{'as':_0x3f7f('0x1b9'),'foreignKey':_0x3f7f('0x1b6')});db['VtigerField']['hasMany'](db[_0x3f7f('0xbd')],{'as':_0x3f7f('0x1ba'),'foreignKey':_0x3f7f('0x1bf')});db['VtigerField'][_0x3f7f('0x125')](db['Variable'],{'as':_0x3f7f('0x8f'),'foreignKey':_0x3f7f('0x1bb')});db[_0x3f7f('0xbf')]['hasMany'](db[_0x3f7f('0xc1')],{'as':_0x3f7f('0x1bd'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xc1')][_0x3f7f('0x116')](db['ServicenowField'],{'as':_0x3f7f('0x1be'),'foreignKey':_0x3f7f('0x1b8')});db['ServicenowConfiguration'][_0x3f7f('0x116')](db['ServicenowField'],{'as':_0x3f7f('0x1b5'),'foreignKey':_0x3f7f('0x1b6')});db['ServicenowConfiguration'][_0x3f7f('0x116')](db[_0x3f7f('0xc3')],{'as':_0x3f7f('0x1b2'),'foreignKey':'FieldId'});db['ServicenowConfiguration']['belongsTo'](db[_0x3f7f('0xbf')],{'as':'Account','foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xc3')][_0x3f7f('0x116')](db['ServicenowField'],{'as':_0x3f7f('0x1b7'),'foreignKey':'SubjectId'});db[_0x3f7f('0xc3')][_0x3f7f('0x116')](db['ServicenowField'],{'as':_0x3f7f('0x1b9'),'foreignKey':'DescriptionId'});db['ServicenowField']['hasMany'](db['ServicenowField'],{'as':_0x3f7f('0x1ba'),'foreignKey':'FieldId'});db['ServicenowField'][_0x3f7f('0x125')](db[_0x3f7f('0x8f')],{'as':_0x3f7f('0x8f'),'foreignKey':_0x3f7f('0x1bb')});db[_0x3f7f('0x1c4')][_0x3f7f('0x116')](db[_0x3f7f('0xc5')],{'as':_0x3f7f('0x1bd'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xc5')][_0x3f7f('0x116')](db[_0x3f7f('0xc7')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x3f7f('0xc5')]['hasMany'](db[_0x3f7f('0xc7')],{'as':_0x3f7f('0x1b5'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1b6')});db[_0x3f7f('0xc5')][_0x3f7f('0x116')](db['Dynamics365Field'],{'as':_0x3f7f('0x1b2'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1bf')});db[_0x3f7f('0xc5')][_0x3f7f('0x125')](db[_0x3f7f('0x1c4')],{'as':'Account','foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xc7')]['hasMany'](db['Dynamics365Field'],{'as':_0x3f7f('0x1b7'),'foreignKey':_0x3f7f('0x1b8')});db[_0x3f7f('0xc7')][_0x3f7f('0x116')](db[_0x3f7f('0xc7')],{'as':_0x3f7f('0x1b9'),'foreignKey':_0x3f7f('0x1b6')});db[_0x3f7f('0xc7')][_0x3f7f('0x116')](db[_0x3f7f('0xc7')],{'as':'Field','foreignKey':_0x3f7f('0x1bf')});db[_0x3f7f('0xc7')]['belongsTo'](db[_0x3f7f('0x8f')],{'as':'Variable','foreignKey':_0x3f7f('0x1bb')});db[_0x3f7f('0xc8')][_0x3f7f('0x116')](db[_0x3f7f('0xca')],{'as':'Configurations','onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xca')][_0x3f7f('0x116')](db[_0x3f7f('0xcc')],{'as':'Subjects','foreignKey':_0x3f7f('0x1b8')});db[_0x3f7f('0xca')][_0x3f7f('0x116')](db[_0x3f7f('0xcc')],{'as':'Descriptions','foreignKey':_0x3f7f('0x1b6')});db[_0x3f7f('0xca')][_0x3f7f('0x116')](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x3f7f('0x1bf')});db[_0x3f7f('0xca')][_0x3f7f('0x125')](db[_0x3f7f('0xc8')],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x1b4')});db[_0x3f7f('0xcc')][_0x3f7f('0x116')](db[_0x3f7f('0xcc')],{'as':_0x3f7f('0x1b7'),'foreignKey':'SubjectId'});db[_0x3f7f('0xcc')][_0x3f7f('0x116')](db['FreshsalesField'],{'as':_0x3f7f('0x1b9'),'foreignKey':_0x3f7f('0x1b6')});db[_0x3f7f('0xcc')][_0x3f7f('0x116')](db['FreshsalesField'],{'as':_0x3f7f('0x1ba'),'foreignKey':_0x3f7f('0x1bf')});db['FreshsalesField'][_0x3f7f('0x125')](db['Variable'],{'as':_0x3f7f('0x8f'),'foreignKey':'VariableId'});db[_0x3f7f('0x1c5')][_0x3f7f('0x125')](db[_0x3f7f('0x5d')],{});db[_0x3f7f('0x1c5')][_0x3f7f('0x125')](db[_0x3f7f('0x13b')],{'as':_0x3f7f('0x168'),'foreignKey':'ListId'});db[_0x3f7f('0x1c5')][_0x3f7f('0x125')](db[_0x3f7f('0x6d')],{'as':_0x3f7f('0x15d'),'foreignKey':_0x3f7f('0x16f')});db[_0x3f7f('0x1c5')][_0x3f7f('0x125')](db[_0x3f7f('0x61')],{});db[_0x3f7f('0x1c5')][_0x3f7f('0x125')](db[_0x3f7f('0x63')],{});db[_0x3f7f('0x1c5')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{});db[_0x3f7f('0x1c5')]['belongsTo'](db[_0x3f7f('0x67')],{});db['ChatInternalMessage'][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1c6')});db[_0x3f7f('0xd2')]['belongsTo'](db['User'],{'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1c7')});db[_0x3f7f('0x150')][_0x3f7f('0x116')](db['JscriptyQuestionReport'],{'foreignKey':_0x3f7f('0x1c8'),'onDelete':_0x3f7f('0x114')});db[_0x3f7f('0x150')][_0x3f7f('0x116')](db[_0x3f7f('0xd4')],{'foreignKey':_0x3f7f('0x1c8'),'onDelete':_0x3f7f('0x114')});db[_0x3f7f('0xd9')][_0x3f7f('0x125')](db[_0x3f7f('0x4d')],{});db[_0x3f7f('0xd9')][_0x3f7f('0x125')](db[_0x3f7f('0x13b')],{'as':_0x3f7f('0x168'),'foreignKey':_0x3f7f('0x169')});db[_0x3f7f('0xd9')][_0x3f7f('0x125')](db[_0x3f7f('0x6d')],{'as':'Contact','foreignKey':_0x3f7f('0x16f')});db[_0x3f7f('0xd9')][_0x3f7f('0x125')](db[_0x3f7f('0x51')],{});db[_0x3f7f('0xd9')][_0x3f7f('0x125')](db[_0x3f7f('0x184')],{});db[_0x3f7f('0xd9')][_0x3f7f('0x125')](db['User'],{});db['SmsQueueReport']['belongsTo'](db[_0x3f7f('0x52')],{});db[_0x3f7f('0xdd')][_0x3f7f('0x116')](db[_0x3f7f('0x150')],{'foreignKey':_0x3f7f('0x1c9')});db['JscriptyProject'][_0x3f7f('0x116')](db[_0x3f7f('0xd6')],{'foreignKey':'ProjectId'});db[_0x3f7f('0xdd')][_0x3f7f('0x116')](db[_0x3f7f('0xd4')],{'foreignKey':_0x3f7f('0x1c9')});db[_0x3f7f('0xe1')][_0x3f7f('0x126')](db['User'],{'as':_0x3f7f('0x174'),'through':_0x3f7f('0x145')});db[_0x3f7f('0xe6')][_0x3f7f('0x126')](db['User'],{'as':_0x3f7f('0x17f'),'through':_0x3f7f('0x12d')});db[_0x3f7f('0xe6')][_0x3f7f('0x126')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0x3f7f('0x1ca')});db[_0x3f7f('0xe6')]['belongsToMany'](db['MailQueue'],{'through':_0x3f7f('0x16c'),'as':_0x3f7f('0x135')});db[_0x3f7f('0xe6')][_0x3f7f('0x126')](db[_0x3f7f('0x67')],{'through':_0x3f7f('0x195'),'as':_0x3f7f('0x136')});db['Team'][_0x3f7f('0x126')](db[_0x3f7f('0x137')],{'through':_0x3f7f('0x1cb'),'as':_0x3f7f('0x1cc')});db[_0x3f7f('0xe6')][_0x3f7f('0x126')](db['SmsQueue'],{'through':_0x3f7f('0x188'),'as':'SmsQueues'});db[_0x3f7f('0xe6')][_0x3f7f('0x126')](db[_0x3f7f('0x5b')],{'through':'team_has_openchannel_queues','as':_0x3f7f('0x139')});db[_0x3f7f('0xe6')][_0x3f7f('0x126')](db[_0x3f7f('0x109')],{'through':_0x3f7f('0x1cd'),'as':'WhatsappQueues'});db[_0x3f7f('0xe6')][_0x3f7f('0x126')](db[_0x3f7f('0xf7')],{'through':_0x3f7f('0x10e'),'as':_0x3f7f('0x133')});db[_0x3f7f('0x19b')][_0x3f7f('0x116')](db[_0x3f7f('0x6f')],{'as':_0x3f7f('0x14e'),'foreignKey':'CampaignId'});db['Campaign'][_0x3f7f('0x116')](db[_0x3f7f('0x73')],{'as':_0x3f7f('0x11b'),'foreignKey':_0x3f7f('0x19d')});db[_0x3f7f('0x19b')][_0x3f7f('0x116')](db[_0x3f7f('0x75')],{'as':_0x3f7f('0x1ce'),'foreignKey':_0x3f7f('0x19d')});db[_0x3f7f('0x19b')]['hasMany'](db[_0x3f7f('0x71')],{'as':_0x3f7f('0x14f'),'foreignKey':_0x3f7f('0x19d')});db[_0x3f7f('0x19b')]['belongsTo'](db[_0x3f7f('0x28')],{'as':'Trunk','foreignKey':_0x3f7f('0x152')});db[_0x3f7f('0x19b')][_0x3f7f('0x125')](db[_0x3f7f('0x28')],{'as':'TrunkBackup','foreignKey':_0x3f7f('0x1cf')});db['Campaign'][_0x3f7f('0x125')](db[_0x3f7f('0x81')],{'as':_0x3f7f('0x81'),'foreignKey':_0x3f7f('0x154')});db[_0x3f7f('0x19b')][_0x3f7f('0x125')](db[_0x3f7f('0xe1')],{'as':_0x3f7f('0xe1'),'foreignKey':_0x3f7f('0x1d0')});db[_0x3f7f('0x19b')][_0x3f7f('0x126')](db[_0x3f7f('0x13b')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0x3f7f('0x19b')][_0x3f7f('0x126')](db[_0x3f7f('0x13b')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db['Attachment']['belongsTo'](db[_0x3f7f('0x65')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db['MailTransferReport'][_0x3f7f('0x125')](db[_0x3f7f('0x3f')],{});db[_0x3f7f('0xed')][_0x3f7f('0x125')](db[_0x3f7f('0x3d')],{});db[_0x3f7f('0xed')][_0x3f7f('0x125')](db[_0x3f7f('0x161')],{'foreignKey':'FromMailAccountId','as':_0x3f7f('0x1d1')});db[_0x3f7f('0xed')]['belongsTo'](db[_0x3f7f('0x112')],{'foreignKey':_0x3f7f('0x1d2'),'as':'FromAgent'});db[_0x3f7f('0xed')]['belongsTo'](db[_0x3f7f('0x112')],{'foreignKey':_0x3f7f('0x1d3'),'as':_0x3f7f('0x1d4')});db['MailTransferReport']['belongsTo'](db[_0x3f7f('0x134')],{'foreignKey':_0x3f7f('0x1d5'),'as':_0x3f7f('0x1d6')});db['MailTransferReport'][_0x3f7f('0x125')](db[_0x3f7f('0x161')],{'foreignKey':_0x3f7f('0x1d7'),'as':_0x3f7f('0x1d8')});db['ChatTransferReport'][_0x3f7f('0x125')](db[_0x3f7f('0x63')],{});db[_0x3f7f('0xee')][_0x3f7f('0x125')](db[_0x3f7f('0x61')],{});db[_0x3f7f('0xee')][_0x3f7f('0x125')](db[_0x3f7f('0x5d')],{'foreignKey':_0x3f7f('0x1d9'),'as':'FromAccount'});db[_0x3f7f('0xee')][_0x3f7f('0x125')](db['User'],{'foreignKey':_0x3f7f('0x1d2'),'as':_0x3f7f('0x1da')});db[_0x3f7f('0xee')][_0x3f7f('0x125')](db['User'],{'foreignKey':_0x3f7f('0x1d3'),'as':'ToAgent'});db[_0x3f7f('0xee')][_0x3f7f('0x125')](db['ChatQueue'],{'foreignKey':_0x3f7f('0x1db'),'as':_0x3f7f('0x1d6')});db[_0x3f7f('0xee')]['belongsTo'](db[_0x3f7f('0x5d')],{'foreignKey':_0x3f7f('0x1dc'),'as':_0x3f7f('0x1d8')});db[_0x3f7f('0xf0')]['belongsTo'](db[_0x3f7f('0x17e')],{});db[_0x3f7f('0xf0')][_0x3f7f('0x125')](db[_0x3f7f('0x48')],{});db[_0x3f7f('0xf0')][_0x3f7f('0x125')](db[_0x3f7f('0x45')],{'foreignKey':_0x3f7f('0x1dd'),'as':'FromAccount'});db[_0x3f7f('0xf0')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'foreignKey':_0x3f7f('0x1d2'),'as':_0x3f7f('0x1da')});db[_0x3f7f('0xf0')]['belongsTo'](db[_0x3f7f('0x112')],{'foreignKey':_0x3f7f('0x1d3'),'as':'ToAgent'});db[_0x3f7f('0xf0')]['belongsTo'](db[_0x3f7f('0x137')],{'foreignKey':'ToFaxQueueId','as':_0x3f7f('0x1d6')});db['FaxTransferReport'][_0x3f7f('0x125')](db[_0x3f7f('0x45')],{'foreignKey':_0x3f7f('0x1de'),'as':_0x3f7f('0x1d8')});db[_0x3f7f('0xf2')][_0x3f7f('0x125')](db['OpenchannelMessage'],{});db[_0x3f7f('0xf2')][_0x3f7f('0x125')](db[_0x3f7f('0x57')],{});db[_0x3f7f('0xf2')][_0x3f7f('0x125')](db[_0x3f7f('0x140')],{'foreignKey':_0x3f7f('0x1df'),'as':_0x3f7f('0x1d1')});db['OpenchannelTransferReport'][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'foreignKey':_0x3f7f('0x1d2'),'as':_0x3f7f('0x1da')});db[_0x3f7f('0xf2')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'foreignKey':_0x3f7f('0x1d3'),'as':'ToAgent'});db[_0x3f7f('0xf2')][_0x3f7f('0x125')](db[_0x3f7f('0x5b')],{'foreignKey':_0x3f7f('0x1e0'),'as':'ToQueue'});db[_0x3f7f('0xf2')][_0x3f7f('0x125')](db[_0x3f7f('0x140')],{'foreignKey':_0x3f7f('0x1e1'),'as':_0x3f7f('0x1d8')});db[_0x3f7f('0xf4')][_0x3f7f('0x125')](db[_0x3f7f('0x184')],{});db[_0x3f7f('0xf4')][_0x3f7f('0x125')](db[_0x3f7f('0x51')],{});db[_0x3f7f('0xf4')][_0x3f7f('0x125')](db['SmsAccount'],{'foreignKey':_0x3f7f('0x1e2'),'as':_0x3f7f('0x1d1')});db[_0x3f7f('0xf4')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'foreignKey':_0x3f7f('0x1d2'),'as':_0x3f7f('0x1da')});db[_0x3f7f('0xf4')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'foreignKey':'ToUserId','as':_0x3f7f('0x1d4')});db[_0x3f7f('0xf4')][_0x3f7f('0x125')](db[_0x3f7f('0x52')],{'foreignKey':_0x3f7f('0x1e3'),'as':'ToQueue'});db[_0x3f7f('0xf4')][_0x3f7f('0x125')](db['SmsAccount'],{'foreignKey':_0x3f7f('0x1e4'),'as':_0x3f7f('0x1d8')});db['CmList'][_0x3f7f('0x116')](db[_0x3f7f('0x164')],{'as':_0x3f7f('0x165'),'foreignKey':_0x3f7f('0x169'),'onDelete':_0x3f7f('0x114')});db[_0x3f7f('0x13b')]['hasMany'](db[_0x3f7f('0x78')],{'as':'CustomFields','foreignKey':'ListId'});db[_0x3f7f('0x13b')][_0x3f7f('0x116')](db[_0x3f7f('0x6d')],{'as':_0x3f7f('0x12a'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x169')});db['CmList']['hasMany'](db[_0x3f7f('0x73')],{'as':_0x3f7f('0x11b'),'foreignKey':_0x3f7f('0x169')});db['CmList'][_0x3f7f('0x116')](db[_0x3f7f('0x75')],{'as':_0x3f7f('0x11c'),'foreignKey':_0x3f7f('0x169')});db['CmList']['hasMany'](db['ReportAgentPreview'],{'as':_0x3f7f('0x11d'),'foreignKey':_0x3f7f('0x169')});db[_0x3f7f('0x13b')][_0x3f7f('0x126')](db[_0x3f7f('0x18')],{'as':_0x3f7f('0x1e5'),'through':'voice_queues_has_cm_lists'});db[_0x3f7f('0x13b')][_0x3f7f('0x126')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x17f'),'through':_0x3f7f('0x12c')});db[_0x3f7f('0xf7')][_0x3f7f('0x116')](db['VoiceExtension'],{'as':_0x3f7f('0x11a'),'onDelete':_0x3f7f('0x114')});db[_0x3f7f('0xf7')][_0x3f7f('0x126')](db['User'],{'as':_0x3f7f('0x17f'),'through':_0x3f7f('0x110')});db[_0x3f7f('0xf7')][_0x3f7f('0x126')](db[_0x3f7f('0xe6')],{'through':'TeamVoicePrefix','as':_0x3f7f('0x156')});db[_0x3f7f('0xf9')][_0x3f7f('0x116')](db['User'],{'as':'Users','foreignKey':'userProfileId'});db[_0x3f7f('0xf9')][_0x3f7f('0x116')](db[_0x3f7f('0x1e6')],{'as':_0x3f7f('0x1e7'),'foreignKey':'userProfileId','onDelete':_0x3f7f('0x114')});db[_0x3f7f('0x1e6')][_0x3f7f('0x116')](db[_0x3f7f('0xfc')],{'as':'Resources','foreignKey':_0x3f7f('0x1e8'),'onDelete':_0x3f7f('0x114')});db[_0x3f7f('0x100')][_0x3f7f('0x116')](db[_0x3f7f('0x164')],{'as':_0x3f7f('0x165'),'foreignKey':_0x3f7f('0x1e9'),'onDelete':_0x3f7f('0x114')});db[_0x3f7f('0x100')][_0x3f7f('0x116')](db['CannedAnswer'],{'as':_0x3f7f('0x166'),'foreignKey':_0x3f7f('0x1e9')});db[_0x3f7f('0x100')]['hasMany'](db['WhatsappMessage'],{'as':_0x3f7f('0x158'),'foreignKey':_0x3f7f('0x1e9')});db[_0x3f7f('0x100')][_0x3f7f('0x116')](db[_0x3f7f('0x103')],{'as':_0x3f7f('0x167')});db[_0x3f7f('0x100')][_0x3f7f('0x116')](db[_0x3f7f('0x102')],{'as':'Applications'});db[_0x3f7f('0x100')][_0x3f7f('0x125')](db['CmList'],{'as':'List','foreignKey':_0x3f7f('0x169')});db[_0x3f7f('0x100')]['belongsTo'](db['Pause'],{'as':_0x3f7f('0x16b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3f7f('0x100')]['belongsToMany'](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x17f'),'through':'user_has_whatsapp_accounts'});db[_0x3f7f('0x102')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'onDelete':'restrict'});db[_0x3f7f('0x102')]['belongsTo'](db[_0x3f7f('0x109')],{'onDelete':'restrict'});db[_0x3f7f('0x102')]['belongsTo'](db[_0x3f7f('0x100')],{'onDelete':_0x3f7f('0x160')});db[_0x3f7f('0x102')][_0x3f7f('0x125')](db[_0x3f7f('0x81')],{'onDelete':'restrict','foreignKey':_0x3f7f('0x154')});db['WhatsappApplication'][_0x3f7f('0x125')](db[_0x3f7f('0x8a')],{'onDelete':_0x3f7f('0x160'),'foreignKey':'TagId'});db['WhatsappInteraction']['hasMany'](db[_0x3f7f('0x105')],{'as':_0x3f7f('0x158'),'onDelete':_0x3f7f('0x114'),'foreignKey':_0x3f7f('0x1ea')});db[_0x3f7f('0x103')]['belongsTo'](db[_0x3f7f('0x100')],{'as':_0x3f7f('0x16e'),'foreignKey':_0x3f7f('0x1e9')});db['WhatsappInteraction']['belongsTo'](db['CmContact'],{'as':_0x3f7f('0x15d'),'foreignKey':_0x3f7f('0x16f')});db['WhatsappInteraction'][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x170'),'foreignKey':_0x3f7f('0x115')});db[_0x3f7f('0x103')][_0x3f7f('0x126')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0x3f7f('0x172')});db[_0x3f7f('0x103')]['belongsToMany'](db[_0x3f7f('0x8a')],{'through':_0x3f7f('0x1eb'),'as':_0x3f7f('0x173')});db['WhatsappInteraction'][_0x3f7f('0x126')](db['User'],{'as':_0x3f7f('0x174'),'through':_0x3f7f('0x132'),'foreignKey':'WhatsappInteractionId'});db[_0x3f7f('0x105')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'as':_0x3f7f('0x112')});db[_0x3f7f('0x105')][_0x3f7f('0x125')](db['CmContact'],{'onDelete':_0x3f7f('0x114'),'as':'Contact'});db[_0x3f7f('0x105')][_0x3f7f('0x125')](db['WhatsappInteraction'],{'onDelete':_0x3f7f('0x114'),'as':'Interaction','foreignKey':_0x3f7f('0x1ea')});db['WhatsappMessage'][_0x3f7f('0x125')](db['WhatsappAccount'],{'as':_0x3f7f('0x16e'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0x3f7f('0x125')](db[_0x3f7f('0x100')],{});db['WhatsappQueueReport'][_0x3f7f('0x125')](db['CmList'],{'as':_0x3f7f('0x168'),'foreignKey':_0x3f7f('0x169')});db[_0x3f7f('0x107')][_0x3f7f('0x125')](db[_0x3f7f('0x6d')],{'as':_0x3f7f('0x15d'),'foreignKey':_0x3f7f('0x16f')});db[_0x3f7f('0x107')][_0x3f7f('0x125')](db[_0x3f7f('0x103')],{});db[_0x3f7f('0x107')]['belongsTo'](db[_0x3f7f('0x109')],{});db[_0x3f7f('0x107')][_0x3f7f('0x125')](db[_0x3f7f('0x105')],{});db['WhatsappQueueReport'][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{});db[_0x3f7f('0x1ec')][_0x3f7f('0x125')](db[_0x3f7f('0x105')],{});db[_0x3f7f('0x1ec')][_0x3f7f('0x125')](db[_0x3f7f('0x103')],{});db[_0x3f7f('0x1ec')][_0x3f7f('0x125')](db[_0x3f7f('0x100')],{'foreignKey':_0x3f7f('0x1ed'),'as':_0x3f7f('0x1d1')});db['WhatsappTransferReport'][_0x3f7f('0x125')](db[_0x3f7f('0x100')],{'foreignKey':_0x3f7f('0x1ee'),'as':'ToAccount'});db[_0x3f7f('0x1ec')][_0x3f7f('0x125')](db[_0x3f7f('0x109')],{'foreignKey':_0x3f7f('0x1ef'),'as':_0x3f7f('0x1d6')});db[_0x3f7f('0x1ec')][_0x3f7f('0x125')](db[_0x3f7f('0x112')],{'foreignKey':_0x3f7f('0x1d2'),'as':_0x3f7f('0x1da')});db[_0x3f7f('0x1ec')]['belongsTo'](db[_0x3f7f('0x112')],{'foreignKey':_0x3f7f('0x1d3'),'as':_0x3f7f('0x1d4')});db[_0x3f7f('0x109')][_0x3f7f('0x126')](db[_0x3f7f('0x112')],{'as':'Agents','through':_0x3f7f('0x36'),'foreignKey':_0x3f7f('0x1f0')});db[_0x3f7f('0x109')][_0x3f7f('0x126')](db[_0x3f7f('0xe6')],{'through':_0x3f7f('0x1cd'),'as':_0x3f7f('0x156')});db[_0x3f7f('0x10a')][_0x3f7f('0x163')](db[_0x3f7f('0x37')],{'as':_0x3f7f('0x1f1'),'onDelete':_0x3f7f('0x160')});db['CloudProvider'][_0x3f7f('0x163')](db['MailServerOut'],{'as':'Smtp','onDelete':_0x3f7f('0x160')});module[_0x3f7f('0x1f2')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xbfda=['VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../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','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmCustomField','Action','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/integration/integration.model','IntegrationReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','MailTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','CmHopperHistory','ReportAgentPreview','OpenchannelInteractions','SmsInteractions','FaxInteraction','FaxInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','SmsQueues','OpenchannelQueues','WhatsappQueue','WhatsappQueues','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','SquareProjects','user_has_square_projects','SpiedAgents','Applications','moh_has_sounds','Members','VoiceQueueId','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','VoiceMailMessage','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','AgentReports','uniqueid','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Dispositions','Answers','Interactions','List','ListId','Template','TemplateId','team_has_mail_queues','Teams','Account','mail_interaction_has_tags','Tags','Users','MailInteractionId','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','Items','FaxAccountId','FaxApplication','Exntensions','mandatoryDispositionPause','Owner','fax_interaction_has_tags','ThroughTags','FaxInteractionId','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','sms_interaction_has_tags','user_has_sms_interactions','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelInteraction','OpenchannelQueueId','OpenchannelInteractionId','ProactiveActions','user_has_chat_websites','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Contacts','CompanyId','Hoppers','Company','cm_contact_has_tags','Campaign','CampaignId','OwnerId','Automation','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyConditions','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceConfiguration','Configurations','Subjects','SubjectId','SalesforceField','FieldId','Description','DescriptionId','Field','VariableId','AccountId','Descriptions','Subject','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','ServicenowConfiguration','FreshsalesConfiguration','ToId','JscriptySessionReport','SessionId','JscriptyAnswerReport','ProjectId','JscriptyProject','MailQueues','ChatQueues','FaxQueues','team_has_sms_queues','team_has_openchannel_queues','team_has_whatsapp_queues','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromUserId','ToAgent','ToQueue','ToMailAccountId','ChatTransferReport','FromAccount','FromAgent','ToUserId','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','Imap','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xcall','127.0.0.1','utf8mb4','utf8','sequelizeHistory','xC@LL1234','mysql','name','utf8_general_ci','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model'];(function(_0x3f2eba,_0x27be52){var _0x3dcb68=function(_0x5f4b71){while(--_0x5f4b71){_0x3f2eba['push'](_0x3f2eba['shift']());}};_0x3dcb68(++_0x27be52);}(_0xbfda,0x1dc));var _0xabfd=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0xbfda[_0x5dfc2a];return _0x3f1a71;};'use strict';var config=require(_0xabfd('0x0'));var Sequelize=require(_0xabfd('0x1'));var _=require(_0xabfd('0x2'));var jstz=require('jstz');var timezone=jstz[_0xabfd('0x3')]();config['sequelize']=_[_0xabfd('0x4')](config[_0xabfd('0x1')],{'database':_0xabfd('0x5'),'username':_0xabfd('0x6'),'password':'xC@LL1234','options':{'host':_0xabfd('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xabfd('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xabfd('0x9'),'collate':'utf8_general_ci'}}});config[_0xabfd('0xa')]=_[_0xabfd('0x4')](config[_0xabfd('0xa')],{'database':_0xabfd('0x5'),'username':_0xabfd('0x6'),'password':_0xabfd('0xb'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xabfd('0xc'),'dialectOptions':{'charset':_0xabfd('0x8')},'logging':![],'timezone':timezone[_0xabfd('0xd')](),'define':{'charset':_0xabfd('0x9'),'collate':_0xabfd('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xabfd('0x1')][_0xabfd('0xf')],config[_0xabfd('0x1')][_0xabfd('0x10')],config[_0xabfd('0x1')][_0xabfd('0x11')],config[_0xabfd('0x1')][_0xabfd('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xabfd('0xf')],config[_0xabfd('0xa')]['username'],config[_0xabfd('0xa')][_0xabfd('0x11')],config[_0xabfd('0xa')][_0xabfd('0x12')])};db[_0xabfd('0x13')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x15'));db[_0xabfd('0x16')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x17'));db[_0xabfd('0x18')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x19'));db[_0xabfd('0x1a')]=db['sequelize'][_0xabfd('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0xabfd('0x1b')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x1c'));db[_0xabfd('0x1d')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x1e'));db[_0xabfd('0x1f')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x20'));db['ScreenRecording']=db['sequelize']['import']('../api/screenRecording/screenRecording.model');db[_0xabfd('0x21')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x22'));db['VoiceMailMessage']=db['sequelize']['import'](_0xabfd('0x23'));db[_0xabfd('0x24')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x25'));db['VoiceDialReport']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x26'));db[_0xabfd('0x27')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x28'));db['VoiceQueueReport']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x29'));db[_0xabfd('0x2a')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x2b'));db[_0xabfd('0x2c')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/trunk/trunk.model');db[_0xabfd('0x2d')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x2e'));db['UserVoiceQueueRt']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x2f'));db[_0xabfd('0x30')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x31'));db[_0xabfd('0x32')]=db[_0xabfd('0x1')]['import']('../api/userChatQueue/userChatQueue.model');db[_0xabfd('0x33')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x34'));db[_0xabfd('0x35')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x36'));db[_0xabfd('0x37')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x38'));db[_0xabfd('0x39')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xabfd('0x3a')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xabfd('0x3b')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0xabfd('0x3c')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x3d'));db[_0xabfd('0x3e')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x3f'));db[_0xabfd('0x40')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x41'));db[_0xabfd('0x42')]=db['sequelize']['import'](_0xabfd('0x43'));db[_0xabfd('0x44')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x45'));db[_0xabfd('0x46')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x47'));db[_0xabfd('0x48')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x49'));db[_0xabfd('0x4a')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x4b'));db[_0xabfd('0x4c')]=db['sequelize']['import'](_0xabfd('0x4d'));db[_0xabfd('0x4e')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x4f'));db[_0xabfd('0x50')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x51'));db['FaxApplication']=db[_0xabfd('0x1')]['import']('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0xabfd('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db[_0xabfd('0x52')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x53'));db[_0xabfd('0x54')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0xabfd('0x55')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x56'));db[_0xabfd('0x57')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x58'));db[_0xabfd('0x59')]=db['sequelize'][_0xabfd('0x14')]('../api/smsInteraction/smsInteraction.model');db[_0xabfd('0x5a')]=db['sequelize']['import'](_0xabfd('0x5b'));db[_0xabfd('0x5c')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/smsQueue/smsQueue.model');db[_0xabfd('0x5d')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x5e'));db[_0xabfd('0x5f')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x60'));db['OpenchannelInteraction']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x61'));db[_0xabfd('0x62')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x63'));db[_0xabfd('0x64')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x65'));db[_0xabfd('0x66')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x67'));db[_0xabfd('0x68')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x69'));db[_0xabfd('0x6a')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x6b'));db[_0xabfd('0x6c')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x6d'));db[_0xabfd('0x6e')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/chatMessage/chatMessage.model');db[_0xabfd('0x6f')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x70'));db[_0xabfd('0x71')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x72'));db[_0xabfd('0x73')]=db[_0xabfd('0x1')]['import'](_0xabfd('0x74'));db[_0xabfd('0x75')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x76'));db[_0xabfd('0x77')]=db[_0xabfd('0x1')]['import'](_0xabfd('0x78'));db[_0xabfd('0x79')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x7a'));db[_0xabfd('0x7b')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x7c'));db[_0xabfd('0x7d')]=db['sequelize']['import'](_0xabfd('0x7e'));db[_0xabfd('0x7f')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x80'));db['CmHopperHistory']=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xabfd('0x81')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/cmCustomField/cmCustomField.model');db[_0xabfd('0x82')]=db[_0xabfd('0x1')]['import']('../api/action/action.model');db['Automation']=db[_0xabfd('0x1')]['import'](_0xabfd('0x83'));db[_0xabfd('0x84')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x85'));db[_0xabfd('0x86')]=db['sequelize']['import'](_0xabfd('0x87'));db[_0xabfd('0x88')]=db[_0xabfd('0x1')]['import'](_0xabfd('0x89'));db[_0xabfd('0x8a')]=db[_0xabfd('0x1')]['import']('../api/interval/interval.model');db[_0xabfd('0x8b')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x8c'));db['Cdr']=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x8d'));db[_0xabfd('0x8e')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x8f'));db[_0xabfd('0x90')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x91'));db[_0xabfd('0x92')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x93'));db[_0xabfd('0x94')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x95'));db['Template']=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x96'));db[_0xabfd('0x97')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x98'));db[_0xabfd('0x99')]=db[_0xabfd('0x1')]['import']('../api/variable/variable.model');db['Integration']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x9a'));db[_0xabfd('0x9b')]=db[_0xabfd('0x1')]['import']('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x9c'));db[_0xabfd('0x9d')]=db['sequelize']['import'](_0xabfd('0x9e'));db[_0xabfd('0x9f')]=db['sequelize']['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xabfd('0xa0')]=db[_0xabfd('0x1')]['import'](_0xabfd('0xa1'));db[_0xabfd('0xa2')]=db[_0xabfd('0x1')]['import'](_0xabfd('0xa3'));db[_0xabfd('0xa4')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xabfd('0xa5')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xa6'));db['SalesforceConfiguration']=db[_0xabfd('0x1')]['import'](_0xabfd('0xa7'));db['SalesforceField']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xa8'));db[_0xabfd('0xa9')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xaa'));db[_0xabfd('0xab')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xac'));db[_0xabfd('0xad')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xae'));db[_0xabfd('0xaf')]=db['sequelize'][_0xabfd('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0xabfd('0xb0')]=db[_0xabfd('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xabfd('0xb1')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xb2'));db[_0xabfd('0xb3')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xb4'));db[_0xabfd('0xb5')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xabfd('0xb6')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xb7'));db[_0xabfd('0xb8')]=db['sequelize'][_0xabfd('0x14')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db['sequelize'][_0xabfd('0x14')](_0xabfd('0xb9'));db[_0xabfd('0xba')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0xbb'));db[_0xabfd('0xbc')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xbd'));db[_0xabfd('0xbe')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xbf'));db[_0xabfd('0xc0')]=db['sequelize'][_0xabfd('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xabfd('0xc1')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xc2'));db[_0xabfd('0xc3')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xc4'));db['VtigerField']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xc5'));db[_0xabfd('0xc6')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0xabfd('0x1')]['import'](_0xabfd('0xc7'));db[_0xabfd('0xc8')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xc9'));db[_0xabfd('0xca')]=db[_0xabfd('0x1')]['import'](_0xabfd('0xcb'));db[_0xabfd('0xcc')]=db[_0xabfd('0x1')]['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xabfd('0xcd')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xce'));db[_0xabfd('0xcf')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xd0'));db['FreshsalesConfiguration']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xd1'));db[_0xabfd('0xd2')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xd3'));db['Integration']=db[_0xabfd('0x1')]['import']('../api/integration/integration.model');db[_0xabfd('0xd4')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0xd5'));db[_0xabfd('0xd6')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0xd7'));db[_0xabfd('0xd8')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xd9'));db['JscriptyAnswerReport']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xda'));db[_0xabfd('0xdb')]=db[_0xabfd('0x1')]['import'](_0xabfd('0xdc'));db['JscriptySessionReport']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xdd'));db[_0xabfd('0xde')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xdf'));db[_0xabfd('0xe0')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xe1'));db[_0xabfd('0xe2')]=db[_0xabfd('0x1')]['import'](_0xabfd('0xe3'));db['JscriptyProject']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xe4'));db['Setting']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xe5'));db[_0xabfd('0xe6')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/squareOdbc/squareOdbc.model');db[_0xabfd('0xe7')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xe8'));db[_0xabfd('0xe9')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/squareRecording/squareRecording.model');db[_0xabfd('0xea')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xeb'));db[_0xabfd('0xec')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/team/team.model');db[_0xabfd('0xed')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/license/license.model');db['Campaign']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xee'));db[_0xabfd('0xef')]=db['sequelize']['import'](_0xabfd('0xf0'));db['Attachment']=db['sequelize']['import'](_0xabfd('0xf1'));db[_0xabfd('0xf2')]=db[_0xabfd('0x1')]['import']('../api/plugin/plugin.model');db[_0xabfd('0xf3')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/chatTransferReport/chatTransferReport.model');db[_0xabfd('0xf4')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xf5'));db[_0xabfd('0xf6')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xabfd('0xf7')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xf8'));db[_0xabfd('0xf9')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xfa'));db[_0xabfd('0xfb')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0xfc'));db[_0xabfd('0xfd')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0xfe'));db[_0xabfd('0xff')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x100'));db['UserProfileResource']=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0xabfd('0x101')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x102'));db['WhatsappAccount']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x103'));db[_0xabfd('0x104')]=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x105'));db[_0xabfd('0x106')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x107'));db['WhatsappMessage']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x108'));db[_0xabfd('0x109')]=db[_0xabfd('0x1')]['import'](_0xabfd('0x10a'));db[_0xabfd('0x10b')]=db['sequelize'][_0xabfd('0x14')](_0xabfd('0x10c'));db['WhatsappQueue']=db[_0xabfd('0x1')][_0xabfd('0x14')](_0xabfd('0x10d'));db[_0xabfd('0x10e')]=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db[_0xabfd('0x1')][_0xabfd('0x14')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xabfd('0x10f')]=db['sequelize']['import'](_0xabfd('0x110'));db['UserVoicePrefix']=db[_0xabfd('0x1')]['import'](_0xabfd('0x111'));db[_0xabfd('0x13')][_0xabfd('0x112')](db[_0xabfd('0x21')],{'as':_0xabfd('0x21'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x114')});db[_0xabfd('0x13')][_0xabfd('0x115')](db['VoiceRecording'],{'as':_0xabfd('0x116'),'foreignKey':_0xabfd('0x114')});db[_0xabfd('0x13')]['hasMany'](db[_0xabfd('0x117')],{'as':_0xabfd('0x118'),'foreignKey':_0xabfd('0x114')});db[_0xabfd('0x13')][_0xabfd('0x115')](db[_0xabfd('0x1a')],{'as':_0xabfd('0x119'),'onDelete':'cascade','hooks':!![]});db[_0xabfd('0x13')][_0xabfd('0x115')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xabfd('0x114')});db[_0xabfd('0x13')][_0xabfd('0x115')](db[_0xabfd('0x11a')],{'as':'HopperHistory','foreignKey':_0xabfd('0x114')});db['User']['hasMany'](db[_0xabfd('0x11b')],{'as':_0xabfd('0x11b'),'foreignKey':_0xabfd('0x114')});db[_0xabfd('0x13')][_0xabfd('0x115')](db['OpenchannelInteraction'],{'as':_0xabfd('0x11c'),'foreignKey':_0xabfd('0x114')});db['User']['hasMany'](db[_0xabfd('0x6c')],{'as':'ChatInteractions','foreignKey':_0xabfd('0x114')});db[_0xabfd('0x13')]['hasMany'](db['SmsInteraction'],{'as':_0xabfd('0x11d'),'foreignKey':_0xabfd('0x114')});db['User'][_0xabfd('0x115')](db[_0xabfd('0x11e')],{'as':_0xabfd('0x11f'),'foreignKey':'UserId'});db[_0xabfd('0x13')][_0xabfd('0x115')](db[_0xabfd('0x44')],{'as':'MailInteractions','foreignKey':'UserId'});db[_0xabfd('0x13')]['hasMany'](db[_0xabfd('0x106')],{'as':_0xabfd('0x120'),'foreignKey':_0xabfd('0x114')});db['User'][_0xabfd('0x115')](db[_0xabfd('0x101')],{'as':_0xabfd('0x121'),'foreignKey':_0xabfd('0x122')});db[_0xabfd('0x13')][_0xabfd('0x123')](db[_0xabfd('0xfd')],{'as':_0xabfd('0xfd'),'foreignKey':_0xabfd('0x124')});db[_0xabfd('0x13')][_0xabfd('0x125')](db[_0xabfd('0x73')],{'as':_0xabfd('0x126'),'through':_0xabfd('0x127')});db[_0xabfd('0x13')][_0xabfd('0x125')](db['CmContact'],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0xabfd('0x13')][_0xabfd('0x125')](db[_0xabfd('0xf9')],{'as':_0xabfd('0x128'),'through':_0xabfd('0x129')});db[_0xabfd('0x13')][_0xabfd('0x125')](db['Team'],{'through':_0xabfd('0x12a')});db[_0xabfd('0x13')][_0xabfd('0x125')](db[_0xabfd('0x44')],{'as':_0xabfd('0x12b'),'through':_0xabfd('0x12c')});db[_0xabfd('0x13')][_0xabfd('0x125')](db[_0xabfd('0x6c')],{'as':_0xabfd('0x12d'),'through':_0xabfd('0x12e')});db[_0xabfd('0x13')][_0xabfd('0x125')](db[_0xabfd('0x11e')],{'as':_0xabfd('0x11f'),'through':_0xabfd('0x12f')});db[_0xabfd('0x13')][_0xabfd('0x125')](db['SmsInteraction'],{'as':_0xabfd('0x11d'),'through':'user_has_sms_interactions'});db[_0xabfd('0x13')][_0xabfd('0x125')](db['OpenchannelInteraction'],{'as':_0xabfd('0x11c'),'through':_0xabfd('0x130')});db[_0xabfd('0x13')][_0xabfd('0x125')](db[_0xabfd('0x106')],{'as':'WhatsappInteractions','through':_0xabfd('0x131')});db[_0xabfd('0x13')][_0xabfd('0x125')](db['VoiceQueue'],{'as':_0xabfd('0x132'),'through':_0xabfd('0x30'),'required':![]});db[_0xabfd('0x13')][_0xabfd('0x125')](db[_0xabfd('0xfb')],{'as':_0xabfd('0x133'),'through':'UserVoicePrefix','required':![]});db[_0xabfd('0x13')][_0xabfd('0x125')](db[_0xabfd('0x40')],{'as':'MailQueues','through':_0xabfd('0x33'),'required':![]});db[_0xabfd('0x13')]['belongsToMany'](db[_0xabfd('0x71')],{'as':'ChatQueues','through':_0xabfd('0x32'),'required':![],'hooks':!![]});db[_0xabfd('0x13')][_0xabfd('0x125')](db[_0xabfd('0x54')],{'as':'FaxQueues','through':_0xabfd('0x35'),'required':![]});db[_0xabfd('0x13')][_0xabfd('0x125')](db['SmsQueue'],{'as':_0xabfd('0x134'),'through':'UserSmsQueue','required':![]});db[_0xabfd('0x13')]['belongsToMany'](db['OpenchannelQueue'],{'as':_0xabfd('0x135'),'through':_0xabfd('0x39'),'required':![]});db[_0xabfd('0x13')]['belongsToMany'](db[_0xabfd('0x136')],{'as':_0xabfd('0x137'),'through':_0xabfd('0x3a'),'required':![]});db[_0xabfd('0x13')][_0xabfd('0x125')](db[_0xabfd('0xf9')],{'through':_0xabfd('0x129')});db[_0xabfd('0x13')][_0xabfd('0x125')](db[_0xabfd('0x66')],{'as':'ChatWebsites','through':'user_has_chat_websites'});db[_0xabfd('0x13')][_0xabfd('0x125')](db[_0xabfd('0x50')],{'as':'FaxAccounts','through':_0xabfd('0x138')});db[_0xabfd('0x13')]['belongsToMany'](db['MailAccount'],{'as':_0xabfd('0x139'),'through':_0xabfd('0x13a')});db['User']['belongsToMany'](db['OpenchannelAccount'],{'as':_0xabfd('0x13b'),'through':_0xabfd('0x13c')});db['User']['belongsToMany'](db[_0xabfd('0x55')],{'as':'SmsAccounts','through':_0xabfd('0x13d')});db[_0xabfd('0x13')][_0xabfd('0x125')](db[_0xabfd('0x13e')],{'as':_0xabfd('0x13f'),'through':'user_has_whatsapp_accounts'});db[_0xabfd('0x13')][_0xabfd('0x125')](db[_0xabfd('0xe7')],{'as':_0xabfd('0x140'),'through':_0xabfd('0x141')});db[_0xabfd('0x16')]['hasMany'](db[_0xabfd('0x1a')],{'as':_0xabfd('0x142'),'onDelete':_0xabfd('0x113'),'foreignKey':'ChanSpyId'});db[_0xabfd('0x18')][_0xabfd('0x115')](db[_0xabfd('0x1a')],{'onDelete':_0xabfd('0x113')});db[_0xabfd('0x1a')]['hasMany'](db[_0xabfd('0x1a')],{'as':_0xabfd('0x143'),'onDelete':_0xabfd('0x113')});db[_0xabfd('0x1b')][_0xabfd('0x125')](db[_0xabfd('0x92')],{'as':'Sounds','through':_0xabfd('0x144')});db[_0xabfd('0x1d')][_0xabfd('0x115')](db[_0xabfd('0x117')],{'as':_0xabfd('0x145'),'foreignKey':_0xabfd('0x146')});db[_0xabfd('0x1d')][_0xabfd('0x115')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xabfd('0x146')});db[_0xabfd('0x1d')]['hasMany'](db['CmHopperFinal'],{'as':_0xabfd('0x147'),'foreignKey':_0xabfd('0x146')});db[_0xabfd('0x1d')][_0xabfd('0x115')](db[_0xabfd('0x11a')],{'as':_0xabfd('0x148'),'foreignKey':_0xabfd('0x146')});db[_0xabfd('0x1d')]['hasMany'](db[_0xabfd('0x11b')],{'as':_0xabfd('0x11b'),'foreignKey':_0xabfd('0x146')});db[_0xabfd('0x1d')][_0xabfd('0x115')](db[_0xabfd('0x7d')],{'as':_0xabfd('0x149'),'foreignKey':_0xabfd('0x146')});db[_0xabfd('0x1d')]['hasMany'](db['JscriptySessionReport'],{'as':_0xabfd('0x14a'),'foreignKey':_0xabfd('0x146')});db[_0xabfd('0x1d')][_0xabfd('0x123')](db[_0xabfd('0x2c')],{'as':_0xabfd('0x2c'),'foreignKey':_0xabfd('0x14b')});db[_0xabfd('0x1d')][_0xabfd('0x123')](db[_0xabfd('0x2c')],{'as':_0xabfd('0x14c'),'foreignKey':'TrunkBackupId'});db[_0xabfd('0x1d')][_0xabfd('0x123')](db[_0xabfd('0x8a')],{'as':_0xabfd('0x8a'),'foreignKey':_0xabfd('0x14d')});db[_0xabfd('0x1d')][_0xabfd('0x123')](db[_0xabfd('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':_0xabfd('0x14e')});db[_0xabfd('0x1d')][_0xabfd('0x125')](db[_0xabfd('0xf9')],{'as':_0xabfd('0x128'),'through':_0xabfd('0x14f')});db[_0xabfd('0x1d')]['belongsToMany'](db[_0xabfd('0x13')],{'as':_0xabfd('0x150'),'through':'UserVoiceQueue'});db['VoiceQueue']['belongsToMany'](db[_0xabfd('0xec')],{'as':'Teams','through':_0xabfd('0x151')});db[_0xabfd('0x1d')][_0xabfd('0x125')](db[_0xabfd('0xf9')],{'as':_0xabfd('0x152'),'through':_0xabfd('0x153')});db[_0xabfd('0x1f')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'as':'User','foreignKey':'UserId'});db[_0xabfd('0x154')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'as':'User','foreignKey':'UserId'});db[_0xabfd('0x21')][_0xabfd('0x115')](db[_0xabfd('0x155')],{'as':_0xabfd('0x156'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x157'),'sourceKey':_0xabfd('0x158')});db['VoiceMailMessage'][_0xabfd('0x123')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xabfd('0x158')});db[_0xabfd('0x24')][_0xabfd('0x115')](db[_0xabfd('0x159')],{'as':_0xabfd('0x15a'),'foreignKey':'uniqueid','constraints':![]});db[_0xabfd('0x24')][_0xabfd('0x115')](db['VoiceAgentReport'],{'as':_0xabfd('0x15b'),'foreignKey':_0xabfd('0x15c'),'constraints':![]});db[_0xabfd('0x24')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'as':_0xabfd('0x13'),'foreignKey':'UserId'});db[_0xabfd('0x24')][_0xabfd('0x123')](db[_0xabfd('0x79')],{'as':_0xabfd('0x15d'),'foreignKey':_0xabfd('0x15e')});db[_0xabfd('0x3b')][_0xabfd('0x123')](db[_0xabfd('0x3e')],{'as':'MailAccount','foreignKey':_0xabfd('0x15f')});db['MailServerIn'][_0xabfd('0x123')](db[_0xabfd('0x10e')],{'as':_0xabfd('0x10e'),'foreignKey':_0xabfd('0x160'),'onDelete':_0xabfd('0x161')});db['MailServerOut'][_0xabfd('0x123')](db['MailAccount'],{'as':_0xabfd('0x3e'),'foreignKey':_0xabfd('0x15f')});db[_0xabfd('0x3c')][_0xabfd('0x123')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':_0xabfd('0x161')});db[_0xabfd('0x3e')][_0xabfd('0x112')](db['MailServerIn'],{'as':'Imap','onDelete':'cascade'});db[_0xabfd('0x3e')][_0xabfd('0x112')](db[_0xabfd('0x3c')],{'as':'Smtp','onDelete':_0xabfd('0x113')});db[_0xabfd('0x3e')]['hasMany'](db[_0xabfd('0x86')],{'as':_0xabfd('0x162'),'foreignKey':_0xabfd('0x15f'),'onDelete':_0xabfd('0x113')});db['MailAccount'][_0xabfd('0x115')](db[_0xabfd('0x84')],{'as':_0xabfd('0x163'),'foreignKey':_0xabfd('0x15f')});db['MailAccount'][_0xabfd('0x115')](db['MailMessage'],{'as':'Messages','foreignKey':'MailAccountId'});db['MailAccount'][_0xabfd('0x115')](db[_0xabfd('0x44')],{'as':_0xabfd('0x164')});db['MailAccount']['hasMany'](db['MailApplication'],{'as':_0xabfd('0x143')});db['MailAccount']['belongsTo'](db['CmList'],{'as':_0xabfd('0x165'),'foreignKey':_0xabfd('0x166')});db[_0xabfd('0x3e')]['belongsTo'](db['Template'],{'as':_0xabfd('0x167'),'foreignKey':_0xabfd('0x168')});db[_0xabfd('0x3e')][_0xabfd('0x123')](db[_0xabfd('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':_0xabfd('0x14e')});db[_0xabfd('0x3e')][_0xabfd('0x125')](db['User'],{'as':_0xabfd('0x150'),'through':'user_has_mail_accounts'});db['MailQueue']['belongsToMany'](db[_0xabfd('0x13')],{'as':_0xabfd('0x150'),'through':_0xabfd('0x33')});db[_0xabfd('0x40')][_0xabfd('0x125')](db['Team'],{'through':_0xabfd('0x169'),'as':_0xabfd('0x16a')});db[_0xabfd('0x44')][_0xabfd('0x115')](db[_0xabfd('0x46')],{'as':'Messages','onDelete':_0xabfd('0x113'),'foreignKey':'MailInteractionId'});db[_0xabfd('0x44')][_0xabfd('0x123')](db[_0xabfd('0x3e')],{'as':_0xabfd('0x16b'),'foreignKey':_0xabfd('0x15f')});db[_0xabfd('0x44')][_0xabfd('0x123')](db[_0xabfd('0x79')],{'as':_0xabfd('0x15d'),'foreignKey':'ContactId'});db['MailInteraction'][_0xabfd('0x123')](db[_0xabfd('0x13')],{'as':'Owner','foreignKey':_0xabfd('0x114')});db[_0xabfd('0x44')][_0xabfd('0x125')](db[_0xabfd('0x94')],{'through':_0xabfd('0x16c'),'as':_0xabfd('0x16d')});db['MailInteraction'][_0xabfd('0x125')](db[_0xabfd('0x94')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0xabfd('0x44')]['belongsToMany'](db['User'],{'as':_0xabfd('0x16e'),'through':_0xabfd('0x12c'),'foreignKey':_0xabfd('0x16f')});db[_0xabfd('0x46')]['hasMany'](db[_0xabfd('0x170')],{'as':_0xabfd('0x171'),'onDelete':'cascade'});db[_0xabfd('0x46')]['belongsTo'](db['User'],{'as':_0xabfd('0x13')});db[_0xabfd('0x46')][_0xabfd('0x123')](db[_0xabfd('0x79')],{'onDelete':_0xabfd('0x113'),'as':'Contact'});db[_0xabfd('0x46')][_0xabfd('0x123')](db[_0xabfd('0x44')],{'as':_0xabfd('0x172'),'foreignKey':_0xabfd('0x16f')});db[_0xabfd('0x46')][_0xabfd('0x123')](db['MailAccount'],{'as':_0xabfd('0x16b'),'foreignKey':'MailAccountId'});db[_0xabfd('0x46')][_0xabfd('0x123')](db['ChatWebsite'],{'as':'ChatWebsite','foreignKey':_0xabfd('0x173')});db['MailMessage'][_0xabfd('0x123')](db[_0xabfd('0x6f')],{'as':_0xabfd('0x6f'),'foreignKey':_0xabfd('0x174')});db['MailApplication'][_0xabfd('0x123')](db[_0xabfd('0x13')],{'onDelete':_0xabfd('0x161')});db[_0xabfd('0x48')][_0xabfd('0x123')](db['MailQueue'],{'onDelete':_0xabfd('0x161')});db[_0xabfd('0x48')][_0xabfd('0x123')](db[_0xabfd('0x3e')],{'onDelete':_0xabfd('0x161')});db[_0xabfd('0x48')][_0xabfd('0x123')](db[_0xabfd('0x8a')],{'onDelete':_0xabfd('0x161'),'foreignKey':_0xabfd('0x14d')});db[_0xabfd('0x48')]['belongsTo'](db['Tag'],{'onDelete':_0xabfd('0x161'),'foreignKey':_0xabfd('0x175')});db[_0xabfd('0x4a')][_0xabfd('0x123')](db[_0xabfd('0x3e')],{});db[_0xabfd('0x4a')]['belongsTo'](db['CmList'],{'as':_0xabfd('0x165'),'foreignKey':_0xabfd('0x166')});db[_0xabfd('0x4a')]['belongsTo'](db['CmContact'],{'as':_0xabfd('0x15d'),'foreignKey':'ContactId'});db['MailQueueReport'][_0xabfd('0x123')](db[_0xabfd('0x44')],{});db[_0xabfd('0x4a')][_0xabfd('0x123')](db['MailMessage'],{});db['MailQueueReport'][_0xabfd('0x123')](db[_0xabfd('0x13')],{});db['MailQueueReport'][_0xabfd('0x123')](db['MailQueue'],{});db['Dashboard'][_0xabfd('0x115')](db[_0xabfd('0x4e')],{'as':_0xabfd('0x176'),'onDelete':_0xabfd('0x113')});db['FaxAccount']['hasMany'](db[_0xabfd('0x86')],{'as':'Dispositions','foreignKey':_0xabfd('0x177'),'onDelete':_0xabfd('0x113')});db['FaxAccount']['hasMany'](db[_0xabfd('0x84')],{'as':_0xabfd('0x163'),'foreignKey':'FaxAccountId'});db[_0xabfd('0x50')]['hasMany'](db[_0xabfd('0x11e')],{'as':_0xabfd('0x164')});db[_0xabfd('0x50')][_0xabfd('0x115')](db[_0xabfd('0x178')],{'as':_0xabfd('0x143')});db[_0xabfd('0x50')][_0xabfd('0x115')](db[_0xabfd('0x1a')],{'as':_0xabfd('0x179'),'onDelete':_0xabfd('0x113')});db[_0xabfd('0x50')][_0xabfd('0x115')](db[_0xabfd('0x52')],{'as':_0xabfd('0x156')});db[_0xabfd('0x50')]['belongsTo'](db[_0xabfd('0x2c')],{'as':'Trunk'});db['FaxAccount']['belongsTo'](db[_0xabfd('0xf9')],{'as':_0xabfd('0x165'),'foreignKey':'ListId'});db[_0xabfd('0x50')][_0xabfd('0x123')](db[_0xabfd('0x8b')],{'as':_0xabfd('0x17a'),'foreignKey':_0xabfd('0x14e')});db[_0xabfd('0x50')][_0xabfd('0x125')](db[_0xabfd('0x13')],{'as':_0xabfd('0x150'),'through':_0xabfd('0x138')});db[_0xabfd('0x178')]['belongsTo'](db[_0xabfd('0x13')],{'onDelete':_0xabfd('0x161')});db[_0xabfd('0x178')][_0xabfd('0x123')](db[_0xabfd('0x54')],{'onDelete':_0xabfd('0x161')});db[_0xabfd('0x178')][_0xabfd('0x123')](db[_0xabfd('0x50')],{'onDelete':_0xabfd('0x161')});db[_0xabfd('0x178')]['belongsTo'](db[_0xabfd('0x94')],{'onDelete':_0xabfd('0x161'),'foreignKey':_0xabfd('0x175')});db[_0xabfd('0x11e')][_0xabfd('0x115')](db[_0xabfd('0x52')],{'as':_0xabfd('0x156'),'onDelete':_0xabfd('0x113'),'foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0xabfd('0x123')](db[_0xabfd('0x50')],{'as':_0xabfd('0x16b'),'foreignKey':_0xabfd('0x177')});db[_0xabfd('0x11e')][_0xabfd('0x123')](db['CmContact'],{'as':_0xabfd('0x15d'),'foreignKey':_0xabfd('0x15e')});db[_0xabfd('0x11e')][_0xabfd('0x123')](db['User'],{'as':_0xabfd('0x17b'),'foreignKey':_0xabfd('0x114')});db[_0xabfd('0x11e')][_0xabfd('0x125')](db[_0xabfd('0x94')],{'through':_0xabfd('0x17c'),'as':_0xabfd('0x16d')});db['FaxInteraction'][_0xabfd('0x125')](db[_0xabfd('0x94')],{'through':_0xabfd('0x17c'),'as':_0xabfd('0x17d')});db[_0xabfd('0x11e')][_0xabfd('0x125')](db[_0xabfd('0x13')],{'as':'Users','through':_0xabfd('0x12f'),'foreignKey':_0xabfd('0x17e')});db[_0xabfd('0x52')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'onDelete':_0xabfd('0x113'),'as':_0xabfd('0x13')});db[_0xabfd('0x52')][_0xabfd('0x123')](db[_0xabfd('0x11e')],{'as':'Interaction','foreignKey':_0xabfd('0x17e')});db[_0xabfd('0x52')][_0xabfd('0x123')](db[_0xabfd('0x79')],{'onDelete':_0xabfd('0x113'),'as':_0xabfd('0x15d')});db['FaxMessage'][_0xabfd('0x123')](db['Attachment'],{'as':'Attachment','foreignKey':_0xabfd('0x17f')});db[_0xabfd('0x52')][_0xabfd('0x123')](db[_0xabfd('0x50')],{'as':'Account','foreignKey':_0xabfd('0x177')});db[_0xabfd('0x54')][_0xabfd('0x125')](db[_0xabfd('0x13')],{'as':_0xabfd('0x150'),'through':'UserFaxQueue'});db[_0xabfd('0x54')]['belongsToMany'](db[_0xabfd('0xec')],{'through':_0xabfd('0x180'),'as':_0xabfd('0x16a')});db[_0xabfd('0x181')][_0xabfd('0x123')](db['FaxAccount'],{});db['FaxQueueReport'][_0xabfd('0x123')](db[_0xabfd('0xf9')],{'as':_0xabfd('0x165'),'foreignKey':_0xabfd('0x166')});db['FaxQueueReport'][_0xabfd('0x123')](db[_0xabfd('0x79')],{'as':_0xabfd('0x15d'),'foreignKey':_0xabfd('0x15e')});db[_0xabfd('0x181')][_0xabfd('0x123')](db[_0xabfd('0x11e')],{});db['FaxQueueReport'][_0xabfd('0x123')](db['FaxMessage'],{});db[_0xabfd('0x181')][_0xabfd('0x123')](db['User'],{});db[_0xabfd('0x181')]['belongsTo'](db[_0xabfd('0x54')],{});db[_0xabfd('0x55')][_0xabfd('0x115')](db[_0xabfd('0x86')],{'as':_0xabfd('0x162'),'foreignKey':_0xabfd('0x182'),'onDelete':_0xabfd('0x113')});db[_0xabfd('0x55')][_0xabfd('0x115')](db[_0xabfd('0x84')],{'as':_0xabfd('0x163'),'foreignKey':_0xabfd('0x182')});db[_0xabfd('0x55')]['hasMany'](db[_0xabfd('0x5a')],{'as':'Messages','foreignKey':'SmsAccountId'});db[_0xabfd('0x55')]['hasMany'](db[_0xabfd('0x59')],{'as':_0xabfd('0x164')});db[_0xabfd('0x55')][_0xabfd('0x115')](db['SmsApplication'],{'as':_0xabfd('0x143')});db[_0xabfd('0x55')][_0xabfd('0x123')](db[_0xabfd('0xf9')],{'as':_0xabfd('0x165'),'foreignKey':_0xabfd('0x166')});db['SmsAccount'][_0xabfd('0x123')](db['Pause'],{'as':_0xabfd('0x17a'),'foreignKey':_0xabfd('0x14e')});db[_0xabfd('0x55')][_0xabfd('0x125')](db[_0xabfd('0x13')],{'as':_0xabfd('0x150'),'through':_0xabfd('0x13d')});db[_0xabfd('0x57')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'onDelete':_0xabfd('0x161')});db['SmsApplication'][_0xabfd('0x123')](db['SmsQueue'],{'onDelete':'restrict'});db[_0xabfd('0x57')][_0xabfd('0x123')](db[_0xabfd('0x55')],{'onDelete':_0xabfd('0x161')});db[_0xabfd('0x57')][_0xabfd('0x123')](db[_0xabfd('0x8a')],{'onDelete':'restrict','foreignKey':_0xabfd('0x14d')});db[_0xabfd('0x57')]['belongsTo'](db[_0xabfd('0x94')],{'onDelete':_0xabfd('0x161'),'foreignKey':_0xabfd('0x175')});db[_0xabfd('0x59')][_0xabfd('0x115')](db[_0xabfd('0x5a')],{'as':'Messages','onDelete':_0xabfd('0x113'),'foreignKey':'SmsInteractionId'});db[_0xabfd('0x59')][_0xabfd('0x123')](db[_0xabfd('0x55')],{'as':_0xabfd('0x16b'),'foreignKey':_0xabfd('0x182')});db[_0xabfd('0x59')][_0xabfd('0x123')](db[_0xabfd('0x79')],{'as':_0xabfd('0x15d'),'foreignKey':'ContactId'});db[_0xabfd('0x59')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'as':_0xabfd('0x17b'),'foreignKey':_0xabfd('0x114')});db[_0xabfd('0x59')][_0xabfd('0x125')](db['Tag'],{'through':_0xabfd('0x183'),'as':'Tags'});db[_0xabfd('0x59')][_0xabfd('0x125')](db[_0xabfd('0x94')],{'through':_0xabfd('0x183'),'as':_0xabfd('0x17d')});db[_0xabfd('0x59')]['belongsToMany'](db[_0xabfd('0x13')],{'as':'Users','through':_0xabfd('0x184'),'foreignKey':_0xabfd('0x185')});db[_0xabfd('0x5a')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'as':_0xabfd('0x13')});db[_0xabfd('0x5a')]['belongsTo'](db[_0xabfd('0x79')],{'onDelete':_0xabfd('0x113'),'as':_0xabfd('0x15d')});db[_0xabfd('0x5a')][_0xabfd('0x123')](db[_0xabfd('0x59')],{'onDelete':_0xabfd('0x113'),'as':_0xabfd('0x172'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xabfd('0x123')](db['SmsAccount'],{'as':_0xabfd('0x16b'),'foreignKey':_0xabfd('0x182')});db[_0xabfd('0x5c')][_0xabfd('0x125')](db[_0xabfd('0x13')],{'as':'Agents','through':_0xabfd('0x37'),'foreignKey':_0xabfd('0x186')});db['SmsQueue'][_0xabfd('0x125')](db[_0xabfd('0xec')],{'through':'team_has_sms_queues','as':'Teams'});db[_0xabfd('0x5d')][_0xabfd('0x115')](db[_0xabfd('0x86')],{'as':_0xabfd('0x162'),'foreignKey':_0xabfd('0x187'),'onDelete':_0xabfd('0x113')});db['OpenchannelAccount'][_0xabfd('0x115')](db[_0xabfd('0x84')],{'as':_0xabfd('0x163'),'foreignKey':_0xabfd('0x187')});db['OpenchannelAccount'][_0xabfd('0x115')](db[_0xabfd('0x188')],{'as':_0xabfd('0x164'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xabfd('0x115')](db['OpenchannelMessage'],{'as':_0xabfd('0x156'),'foreignKey':_0xabfd('0x187')});db[_0xabfd('0x5d')][_0xabfd('0x115')](db['OpenchannelApplication'],{'as':_0xabfd('0x143'),'foreignKey':'OpenchannelAccountId'});db[_0xabfd('0x5d')][_0xabfd('0x123')](db['CmList'],{'as':_0xabfd('0x165'),'foreignKey':_0xabfd('0x166')});db['OpenchannelAccount'][_0xabfd('0x123')](db['Pause'],{'as':_0xabfd('0x17a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xabfd('0x5d')]['belongsToMany'](db[_0xabfd('0x13')],{'as':_0xabfd('0x150'),'through':'user_has_openchannel_accounts'});db[_0xabfd('0x5f')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'onDelete':_0xabfd('0x161')});db[_0xabfd('0x5f')][_0xabfd('0x123')](db[_0xabfd('0x64')],{'onDelete':_0xabfd('0x161'),'foreignKey':_0xabfd('0x189')});db[_0xabfd('0x5f')][_0xabfd('0x123')](db[_0xabfd('0x5d')],{'onDelete':_0xabfd('0x161'),'foreignKey':'OpenchannelAccountId'});db[_0xabfd('0x5f')][_0xabfd('0x123')](db[_0xabfd('0x8a')],{'onDelete':_0xabfd('0x161'),'foreignKey':_0xabfd('0x14d')});db['OpenchannelApplication'][_0xabfd('0x123')](db[_0xabfd('0x94')],{'onDelete':_0xabfd('0x161'),'foreignKey':_0xabfd('0x175')});db[_0xabfd('0x188')][_0xabfd('0x115')](db[_0xabfd('0x62')],{'as':_0xabfd('0x156'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x18a')});db[_0xabfd('0x188')]['belongsTo'](db[_0xabfd('0x5d')],{'as':'Account','foreignKey':_0xabfd('0x187')});db[_0xabfd('0x188')]['belongsTo'](db[_0xabfd('0x79')],{'as':_0xabfd('0x15d'),'foreignKey':'ContactId'});db[_0xabfd('0x188')]['belongsTo'](db[_0xabfd('0x13')],{'as':'Owner','foreignKey':_0xabfd('0x114')});db[_0xabfd('0x188')]['belongsToMany'](db[_0xabfd('0x94')],{'through':'openchannel_interaction_has_tags','as':_0xabfd('0x16d')});db['OpenchannelInteraction'][_0xabfd('0x125')](db[_0xabfd('0x94')],{'through':'openchannel_interaction_has_tags','as':_0xabfd('0x17d')});db[_0xabfd('0x188')][_0xabfd('0x125')](db[_0xabfd('0x13')],{'as':_0xabfd('0x16e'),'through':_0xabfd('0x130'),'foreignKey':_0xabfd('0x18a')});db[_0xabfd('0x62')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'onDelete':_0xabfd('0x113'),'as':_0xabfd('0x13')});db[_0xabfd('0x62')][_0xabfd('0x123')](db[_0xabfd('0x79')],{'onDelete':_0xabfd('0x113'),'as':_0xabfd('0x15d')});db['OpenchannelMessage']['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0xabfd('0x113'),'as':'Interaction','foreignKey':_0xabfd('0x18a')});db['OpenchannelMessage'][_0xabfd('0x123')](db[_0xabfd('0x170')],{'as':_0xabfd('0x170'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0xabfd('0x123')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xabfd('0x187')});db[_0xabfd('0x64')]['belongsToMany'](db[_0xabfd('0x13')],{'as':_0xabfd('0x150'),'through':_0xabfd('0x39'),'foreignKey':'OpenchannelQueueId'});db[_0xabfd('0x64')][_0xabfd('0x125')](db[_0xabfd('0xec')],{'through':'team_has_openchannel_queues','as':_0xabfd('0x16a')});db['ChatWebsite']['hasMany'](db[_0xabfd('0x86')],{'as':_0xabfd('0x162'),'foreignKey':_0xabfd('0x173'),'onDelete':'cascade'});db['ChatWebsite'][_0xabfd('0x115')](db[_0xabfd('0x84')],{'as':_0xabfd('0x163'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0xabfd('0x115')](db[_0xabfd('0x75')],{'as':_0xabfd('0x18b')});db[_0xabfd('0x66')][_0xabfd('0x115')](db[_0xabfd('0x6c')],{'as':'Interactions'});db['ChatWebsite'][_0xabfd('0x115')](db['ChatApplication'],{'as':_0xabfd('0x143')});db[_0xabfd('0x66')][_0xabfd('0x115')](db[_0xabfd('0x6e')],{'as':_0xabfd('0x156')});db[_0xabfd('0x66')][_0xabfd('0x123')](db['CmList'],{'as':_0xabfd('0x165'),'foreignKey':_0xabfd('0x166')});db[_0xabfd('0x66')][_0xabfd('0x123')](db[_0xabfd('0x8a')],{'as':_0xabfd('0x8a'),'foreignKey':_0xabfd('0x14d')});db[_0xabfd('0x66')][_0xabfd('0x123')](db[_0xabfd('0x3e')],{'as':_0xabfd('0x3e'),'foreignKey':_0xabfd('0x15f')});db[_0xabfd('0x66')][_0xabfd('0x123')](db['Pause'],{'as':_0xabfd('0x17a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xabfd('0x66')][_0xabfd('0x125')](db[_0xabfd('0x13')],{'as':'Agents','through':_0xabfd('0x18c')});db[_0xabfd('0x68')][_0xabfd('0x123')](db[_0xabfd('0x5d')],{});db[_0xabfd('0x68')]['belongsTo'](db[_0xabfd('0xf9')],{'as':_0xabfd('0x165'),'foreignKey':_0xabfd('0x166')});db[_0xabfd('0x68')]['belongsTo'](db[_0xabfd('0x79')],{'as':_0xabfd('0x15d'),'foreignKey':_0xabfd('0x15e')});db[_0xabfd('0x68')]['belongsTo'](db[_0xabfd('0x188')],{});db['OpenchannelQueueReport'][_0xabfd('0x123')](db[_0xabfd('0x62')],{});db['OpenchannelQueueReport'][_0xabfd('0x123')](db['User'],{});db[_0xabfd('0x68')]['belongsTo'](db[_0xabfd('0x64')],{});db[_0xabfd('0x6a')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'as':_0xabfd('0x18d'),'foreignKey':_0xabfd('0x114'),'onDelete':'restrict'});db[_0xabfd('0x6a')][_0xabfd('0x123')](db[_0xabfd('0x71')],{'as':_0xabfd('0x18e'),'foreignKey':'ChatQueueId','onDelete':_0xabfd('0x161')});db['ChatApplication'][_0xabfd('0x123')](db[_0xabfd('0x66')],{'as':_0xabfd('0x18f'),'foreignKey':_0xabfd('0x173'),'onDelete':_0xabfd('0x161')});db['ChatApplication'][_0xabfd('0x123')](db['Tag'],{'onDelete':_0xabfd('0x161'),'foreignKey':_0xabfd('0x175')});db[_0xabfd('0x6c')][_0xabfd('0x115')](db[_0xabfd('0x6e')],{'as':_0xabfd('0x156'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x190')});db[_0xabfd('0x6c')][_0xabfd('0x123')](db['ChatWebsite'],{'as':_0xabfd('0x16b'),'foreignKey':'ChatWebsiteId'});db[_0xabfd('0x6c')][_0xabfd('0x123')](db[_0xabfd('0x79')],{'as':_0xabfd('0x15d'),'foreignKey':_0xabfd('0x15e')});db[_0xabfd('0x6c')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'as':_0xabfd('0x17b'),'foreignKey':'UserId'});db[_0xabfd('0x6c')][_0xabfd('0x125')](db[_0xabfd('0x94')],{'through':_0xabfd('0x191'),'as':_0xabfd('0x16d')});db[_0xabfd('0x6c')][_0xabfd('0x125')](db['Tag'],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db['ChatInteraction']['belongsToMany'](db[_0xabfd('0x13')],{'as':_0xabfd('0x16e'),'through':_0xabfd('0x12e'),'foreignKey':_0xabfd('0x190')});db[_0xabfd('0x6e')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'onDelete':_0xabfd('0x113'),'as':_0xabfd('0x13')});db[_0xabfd('0x6e')][_0xabfd('0x123')](db[_0xabfd('0x79')],{'onDelete':_0xabfd('0x113'),'as':_0xabfd('0x15d'),'foreignKey':_0xabfd('0x15e')});db[_0xabfd('0x6e')][_0xabfd('0x123')](db[_0xabfd('0x6c')],{'onDelete':_0xabfd('0x113'),'as':_0xabfd('0x172'),'foreignKey':_0xabfd('0x190')});db[_0xabfd('0x6e')]['belongsTo'](db[_0xabfd('0x170')],{'as':_0xabfd('0x170'),'foreignKey':_0xabfd('0x17f')});db['ChatMessage']['belongsTo'](db['ChatWebsite'],{'as':_0xabfd('0x16b'),'foreignKey':_0xabfd('0x173')});db[_0xabfd('0x6f')][_0xabfd('0x115')](db[_0xabfd('0x170')],{'as':_0xabfd('0x171'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db[_0xabfd('0x6f')]['belongsTo'](db['CmContact'],{'onDelete':_0xabfd('0x113'),'as':'Contact','foreignKey':'ContactId'});db[_0xabfd('0x6f')]['belongsTo'](db[_0xabfd('0x66')],{'as':_0xabfd('0x16b'),'foreignKey':_0xabfd('0x173')});db[_0xabfd('0x71')]['belongsToMany'](db['User'],{'as':_0xabfd('0x150'),'through':_0xabfd('0x32'),'hooks':!![]});db['ChatQueue'][_0xabfd('0x125')](db[_0xabfd('0xec')],{'through':_0xabfd('0x192'),'as':_0xabfd('0x16a')});db[_0xabfd('0x73')][_0xabfd('0x115')](db['ChatInternalMessage'],{'as':_0xabfd('0x156'),'foreignKey':_0xabfd('0x193'),'onDelete':_0xabfd('0x113')});db[_0xabfd('0x73')]['belongsToMany'](db[_0xabfd('0x13')],{'as':_0xabfd('0x145'),'through':_0xabfd('0x127')});db[_0xabfd('0x75')]['belongsTo'](db[_0xabfd('0x66')],{'as':_0xabfd('0x18f'),'foreignKey':_0xabfd('0x173')});db[_0xabfd('0x77')][_0xabfd('0x115')](db['CmContact'],{'as':_0xabfd('0x194'),'foreignKey':_0xabfd('0x195')});db['CmContact'][_0xabfd('0x115')](db['CmHopper'],{'as':_0xabfd('0x196'),'foreignKey':'ContactId'});db[_0xabfd('0x79')]['hasMany'](db[_0xabfd('0x7f')],{'as':_0xabfd('0x147'),'foreignKey':'ContactId'});db[_0xabfd('0x79')][_0xabfd('0x115')](db['CmHopperHistory'],{'as':_0xabfd('0x148'),'foreignKey':_0xabfd('0x15e')});db[_0xabfd('0x79')][_0xabfd('0x115')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xabfd('0x15e')});db[_0xabfd('0x79')][_0xabfd('0x115')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0xabfd('0x15e')});db[_0xabfd('0x79')][_0xabfd('0x115')](db['OpenchannelInteraction'],{'as':_0xabfd('0x11c'),'foreignKey':'ContactId','onDelete':_0xabfd('0x161')});db[_0xabfd('0x79')][_0xabfd('0x115')](db[_0xabfd('0x6c')],{'as':_0xabfd('0x12d'),'foreignKey':'ContactId','onDelete':_0xabfd('0x161')});db['CmContact'][_0xabfd('0x115')](db[_0xabfd('0x59')],{'as':'SmsInteractions','foreignKey':_0xabfd('0x15e'),'onDelete':_0xabfd('0x161')});db[_0xabfd('0x79')][_0xabfd('0x115')](db[_0xabfd('0x11e')],{'as':_0xabfd('0x11f'),'foreignKey':_0xabfd('0x15e'),'onDelete':_0xabfd('0x161')});db['CmContact']['hasMany'](db['MailInteraction'],{'as':_0xabfd('0x12b'),'foreignKey':_0xabfd('0x15e'),'onDelete':_0xabfd('0x161')});db[_0xabfd('0x79')][_0xabfd('0x123')](db[_0xabfd('0x77')],{'as':_0xabfd('0x197'),'foreignKey':_0xabfd('0x195')});db[_0xabfd('0x79')][_0xabfd('0x123')](db[_0xabfd('0xf9')],{'as':'List','foreignKey':_0xabfd('0x166'),'onDelete':_0xabfd('0x113')});db['CmContact']['belongsToMany'](db[_0xabfd('0x13')],{'as':_0xabfd('0x16e'),'through':'cm_user_has_contacts'});db[_0xabfd('0x79')]['belongsToMany'](db[_0xabfd('0x94')],{'as':'Tags','through':_0xabfd('0x198')});db[_0xabfd('0x79')]['belongsToMany'](db[_0xabfd('0x94')],{'through':_0xabfd('0x198'),'as':'ThroughTags'});db['CmHopper'][_0xabfd('0x123')](db[_0xabfd('0x79')],{'as':_0xabfd('0x15d'),'foreignKey':'ContactId','onDelete':_0xabfd('0x113')});db[_0xabfd('0x7b')][_0xabfd('0x123')](db['CmList'],{'as':_0xabfd('0x165'),'foreignKey':_0xabfd('0x166'),'onDelete':_0xabfd('0x113')});db[_0xabfd('0x7b')]['belongsTo'](db[_0xabfd('0x13')],{'as':'Agent','foreignKey':_0xabfd('0x114')});db[_0xabfd('0x7b')][_0xabfd('0x123')](db[_0xabfd('0x1d')],{'as':'Queue','foreignKey':_0xabfd('0x146'),'onDelete':_0xabfd('0x113')});db['CmHopper'][_0xabfd('0x123')](db[_0xabfd('0x199')],{'as':_0xabfd('0x199'),'foreignKey':_0xabfd('0x19a'),'onDelete':_0xabfd('0x113')});db[_0xabfd('0x7b')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'as':_0xabfd('0x17b'),'foreignKey':_0xabfd('0x19b')});db['CmHopperBlack']['belongsTo'](db[_0xabfd('0x79')],{'as':_0xabfd('0x15d'),'foreignKey':'ContactId','onDelete':'cascade'});db[_0xabfd('0x7d')][_0xabfd('0x123')](db['CmList'],{'as':_0xabfd('0x165'),'foreignKey':_0xabfd('0x166'),'onDelete':_0xabfd('0x113')});db[_0xabfd('0x7d')][_0xabfd('0x123')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0xabfd('0x146'),'onDelete':_0xabfd('0x113')});db[_0xabfd('0x7d')]['belongsTo'](db[_0xabfd('0x199')],{'as':_0xabfd('0x199'),'foreignKey':_0xabfd('0x19a'),'onDelete':_0xabfd('0x113')});db[_0xabfd('0x19c')][_0xabfd('0x115')](db['Condition'],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0xabfd('0x19d'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xabfd('0x115')](db['Condition'],{'as':{'plural':_0xabfd('0x19e'),'singular':_0xabfd('0x19f')},'foreignKey':_0xabfd('0x1a0'),'onDelete':_0xabfd('0x113'),'hooks':!![]});db[_0xabfd('0x19c')][_0xabfd('0x115')](db[_0xabfd('0x82')],{'as':_0xabfd('0x1a1'),'foreignKey':_0xabfd('0x1a2'),'onDelete':_0xabfd('0x113'),'hooks':!![]});db['Disposition'][_0xabfd('0x115')](db['Disposition'],{'as':_0xabfd('0x162'),'foreignKey':_0xabfd('0x1a3'),'onDelete':_0xabfd('0x113')});db[_0xabfd('0x8a')]['hasMany'](db['Interval'],{'as':_0xabfd('0x1a4'),'foreignKey':_0xabfd('0x14d'),'onDelete':_0xabfd('0x113'),'hooks':!![],'required':![]});db[_0xabfd('0x8a')][_0xabfd('0x115')](db[_0xabfd('0x1a')],{'as':'Extensions','foreignKey':_0xabfd('0x14d'),'onDelete':_0xabfd('0x161')});db[_0xabfd('0x8a')][_0xabfd('0x115')](db[_0xabfd('0x48')],{'as':_0xabfd('0x1a5'),'foreignKey':_0xabfd('0x14d')});db[_0xabfd('0x8a')]['hasMany'](db['ChatApplication'],{'as':_0xabfd('0x1a6'),'foreignKey':_0xabfd('0x14d')});db[_0xabfd('0x8a')]['hasMany'](db[_0xabfd('0x178')],{'as':'FaxApplications','foreignKey':'IntervalId'});db[_0xabfd('0x8a')][_0xabfd('0x115')](db[_0xabfd('0x57')],{'as':_0xabfd('0x1a7'),'foreignKey':'IntervalId'});db[_0xabfd('0x90')][_0xabfd('0x123')](db[_0xabfd('0x3e')],{});db[_0xabfd('0x90')][_0xabfd('0x123')](db[_0xabfd('0x9d')],{'foreignKey':_0xabfd('0x1a8')});db[_0xabfd('0x90')]['belongsTo'](db[_0xabfd('0x1a9')],{'foreignKey':_0xabfd('0x1aa')});db[_0xabfd('0x92')]['belongsToMany'](db[_0xabfd('0x1b')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0xabfd('0x161')});db[_0xabfd('0x94')][_0xabfd('0x125')](db[_0xabfd('0x79')],{'through':'cm_contact_has_tags'});db[_0xabfd('0x94')][_0xabfd('0x125')](db[_0xabfd('0x6c')],{'through':_0xabfd('0x191')});db['Tag'][_0xabfd('0x125')](db['MailInteraction'],{'through':_0xabfd('0x16c')});db['Tag'][_0xabfd('0x125')](db['SmsInteraction'],{'through':_0xabfd('0x183')});db['Tag'][_0xabfd('0x125')](db['FaxInteraction'],{'through':_0xabfd('0x17c')});db[_0xabfd('0x94')][_0xabfd('0x125')](db[_0xabfd('0x188')],{'through':_0xabfd('0x1ab')});db[_0xabfd('0x94')][_0xabfd('0x125')](db['WhatsappInteraction'],{'through':_0xabfd('0x1ac')});db[_0xabfd('0x97')]['hasMany'](db[_0xabfd('0x88')],{'as':{'plural':_0xabfd('0x1ad'),'singular':_0xabfd('0x1ae')},'foreignKey':'TriggerAllId','onDelete':_0xabfd('0x113'),'hooks':!![]});db[_0xabfd('0x97')][_0xabfd('0x115')](db[_0xabfd('0x88')],{'as':{'plural':_0xabfd('0x1af'),'singular':'AnyCondition'},'foreignKey':_0xabfd('0x1b0'),'onDelete':_0xabfd('0x113'),'hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':'Actions','foreignKey':_0xabfd('0x1b1'),'onDelete':_0xabfd('0x113'),'hooks':!![]});db[_0xabfd('0x1a9')][_0xabfd('0x115')](db[_0xabfd('0xa2')],{'as':'Fields','onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1aa'),'hooks':!![]});db[_0xabfd('0x9d')]['hasMany'](db[_0xabfd('0xa2')],{'as':_0xabfd('0x1b2'),'onDelete':'cascade','foreignKey':_0xabfd('0x1a8')});db[_0xabfd('0xa0')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xabfd('0x1b2'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1b3')});db[_0xabfd('0xa2')][_0xabfd('0x123')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0xabfd('0xa5')][_0xabfd('0x115')](db[_0xabfd('0x1b4')],{'as':_0xabfd('0x1b5'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xabfd('0x1b4')][_0xabfd('0x115')](db['SalesforceField'],{'as':_0xabfd('0x1b6'),'onDelete':'cascade','foreignKey':_0xabfd('0x1b7')});db[_0xabfd('0x1b4')][_0xabfd('0x115')](db[_0xabfd('0x1b8')],{'as':'Descriptions','onDelete':_0xabfd('0x113'),'foreignKey':'DescriptionId'});db[_0xabfd('0x1b4')][_0xabfd('0x115')](db[_0xabfd('0x1b8')],{'as':'Fields','onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1b9')});db[_0xabfd('0x1b4')][_0xabfd('0x123')](db[_0xabfd('0xa5')],{'as':_0xabfd('0x16b'),'foreignKey':'AccountId'});db[_0xabfd('0x1b8')][_0xabfd('0x115')](db[_0xabfd('0x1b8')],{'as':'Subject','foreignKey':'SubjectId'});db['SalesforceField'][_0xabfd('0x115')](db[_0xabfd('0x1b8')],{'as':_0xabfd('0x1ba'),'foreignKey':_0xabfd('0x1bb')});db[_0xabfd('0x1b8')][_0xabfd('0x115')](db[_0xabfd('0x1b8')],{'as':_0xabfd('0x1bc'),'foreignKey':_0xabfd('0x1b9')});db[_0xabfd('0x1b8')][_0xabfd('0x123')](db[_0xabfd('0x99')],{'as':_0xabfd('0x99'),'foreignKey':_0xabfd('0x1bd')});db[_0xabfd('0xa9')][_0xabfd('0x115')](db['SugarcrmConfiguration'],{'as':_0xabfd('0x1b5'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1be')});db[_0xabfd('0xab')][_0xabfd('0x115')](db[_0xabfd('0xad')],{'as':_0xabfd('0x1b6'),'onDelete':'cascade','foreignKey':_0xabfd('0x1b7')});db[_0xabfd('0xab')][_0xabfd('0x115')](db[_0xabfd('0xad')],{'as':_0xabfd('0x1bf'),'onDelete':'cascade','foreignKey':_0xabfd('0x1bb')});db[_0xabfd('0xab')][_0xabfd('0x115')](db['SugarcrmField'],{'as':_0xabfd('0x1b2'),'onDelete':_0xabfd('0x113'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0xabfd('0x123')](db[_0xabfd('0xa9')],{'as':_0xabfd('0x16b'),'foreignKey':_0xabfd('0x1be')});db[_0xabfd('0xad')][_0xabfd('0x115')](db['SugarcrmField'],{'as':'Subject','foreignKey':_0xabfd('0x1b7')});db['SugarcrmField'][_0xabfd('0x115')](db['SugarcrmField'],{'as':_0xabfd('0x1ba'),'foreignKey':_0xabfd('0x1bb')});db['SugarcrmField'][_0xabfd('0x115')](db['SugarcrmField'],{'as':_0xabfd('0x1bc'),'foreignKey':'FieldId'});db[_0xabfd('0xad')]['belongsTo'](db[_0xabfd('0x99')],{'as':_0xabfd('0x99'),'foreignKey':_0xabfd('0x1bd')});db[_0xabfd('0xaf')][_0xabfd('0x115')](db[_0xabfd('0xb0')],{'as':_0xabfd('0x1b5'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1be')});db[_0xabfd('0xb0')]['hasMany'](db[_0xabfd('0xb1')],{'as':_0xabfd('0x1b6'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1b7')});db[_0xabfd('0xb0')][_0xabfd('0x115')](db[_0xabfd('0xb1')],{'as':_0xabfd('0x1bf'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1bb')});db['DeskConfiguration']['hasMany'](db[_0xabfd('0xb1')],{'as':'Fields','onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1b9')});db[_0xabfd('0xb0')][_0xabfd('0x123')](db[_0xabfd('0xaf')],{'as':_0xabfd('0x16b'),'foreignKey':_0xabfd('0x1be')});db[_0xabfd('0xb0')][_0xabfd('0x125')](db['Tag'],{'through':'int_desk_configuration_has_tags'});db[_0xabfd('0xb1')]['hasMany'](db[_0xabfd('0xb1')],{'as':'Subject','foreignKey':_0xabfd('0x1b7')});db[_0xabfd('0xb1')][_0xabfd('0x115')](db['DeskField'],{'as':_0xabfd('0x1ba'),'foreignKey':_0xabfd('0x1bb')});db[_0xabfd('0xb1')][_0xabfd('0x115')](db[_0xabfd('0xb1')],{'as':'Field','foreignKey':_0xabfd('0x1b9')});db[_0xabfd('0xb1')][_0xabfd('0x123')](db[_0xabfd('0x99')],{'as':_0xabfd('0x99'),'foreignKey':_0xabfd('0x1bd')});db[_0xabfd('0xb3')][_0xabfd('0x115')](db[_0xabfd('0xb5')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xabfd('0xb5')][_0xabfd('0x115')](db[_0xabfd('0xb6')],{'as':'Subjects','onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1b7')});db[_0xabfd('0xb5')][_0xabfd('0x115')](db[_0xabfd('0xb6')],{'as':_0xabfd('0x1bf'),'onDelete':_0xabfd('0x113'),'foreignKey':'DescriptionId'});db['ZohoConfiguration'][_0xabfd('0x115')](db[_0xabfd('0xb6')],{'as':_0xabfd('0x1b2'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1b9')});db[_0xabfd('0xb5')]['belongsTo'](db['ZohoAccount'],{'as':_0xabfd('0x16b'),'foreignKey':_0xabfd('0x1be')});db['ZohoField'][_0xabfd('0x115')](db[_0xabfd('0xb6')],{'as':_0xabfd('0x1c0'),'foreignKey':_0xabfd('0x1b7')});db[_0xabfd('0xb6')]['hasMany'](db[_0xabfd('0xb6')],{'as':_0xabfd('0x1ba'),'foreignKey':_0xabfd('0x1bb')});db['ZohoField'][_0xabfd('0x115')](db[_0xabfd('0xb6')],{'as':_0xabfd('0x1bc'),'foreignKey':_0xabfd('0x1b9')});db[_0xabfd('0xb6')][_0xabfd('0x123')](db[_0xabfd('0x99')],{'as':_0xabfd('0x99'),'foreignKey':'VariableId'});db['ZendeskAccount']['hasMany'](db[_0xabfd('0x1c1')],{'as':_0xabfd('0x1b5'),'onDelete':'cascade','foreignKey':_0xabfd('0x1be')});db[_0xabfd('0x1c1')][_0xabfd('0x115')](db[_0xabfd('0xba')],{'as':_0xabfd('0x1b6'),'foreignKey':_0xabfd('0x1b7')});db['ZendeskConfiguration'][_0xabfd('0x115')](db[_0xabfd('0xba')],{'as':_0xabfd('0x1bf'),'foreignKey':'DescriptionId'});db[_0xabfd('0x1c1')]['hasMany'](db[_0xabfd('0xba')],{'as':_0xabfd('0x1b2'),'foreignKey':'FieldId'});db[_0xabfd('0x1c1')][_0xabfd('0x123')](db[_0xabfd('0xb8')],{'as':_0xabfd('0x16b'),'foreignKey':'AccountId'});db[_0xabfd('0x1c1')][_0xabfd('0x125')](db[_0xabfd('0x94')],{'through':_0xabfd('0x1c2')});db[_0xabfd('0xba')][_0xabfd('0x115')](db[_0xabfd('0xba')],{'as':_0xabfd('0x1c0'),'foreignKey':_0xabfd('0x1b7')});db[_0xabfd('0xba')][_0xabfd('0x115')](db[_0xabfd('0xba')],{'as':_0xabfd('0x1ba'),'foreignKey':_0xabfd('0x1bb')});db[_0xabfd('0xba')]['hasMany'](db[_0xabfd('0xba')],{'as':'Field','foreignKey':_0xabfd('0x1b9')});db[_0xabfd('0xba')][_0xabfd('0x123')](db[_0xabfd('0x99')],{'as':_0xabfd('0x99'),'foreignKey':_0xabfd('0x1bd')});db[_0xabfd('0xbc')][_0xabfd('0x115')](db[_0xabfd('0xbe')],{'as':_0xabfd('0x1b5'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1be')});db[_0xabfd('0xbe')][_0xabfd('0x115')](db[_0xabfd('0xc0')],{'as':_0xabfd('0x1b6'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1b7')});db[_0xabfd('0xbe')]['hasMany'](db['FreshdeskField'],{'as':_0xabfd('0x1bf'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1bb')});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1b9')});db[_0xabfd('0xbe')][_0xabfd('0x123')](db[_0xabfd('0xbc')],{'as':_0xabfd('0x16b'),'foreignKey':_0xabfd('0x1be')});db[_0xabfd('0xbe')][_0xabfd('0x125')](db['Tag'],{'through':_0xabfd('0x1c3')});db[_0xabfd('0xc0')][_0xabfd('0x115')](db['FreshdeskField'],{'as':'Subject','foreignKey':_0xabfd('0x1b7')});db['FreshdeskField'][_0xabfd('0x115')](db['FreshdeskField'],{'as':_0xabfd('0x1ba'),'foreignKey':'DescriptionId'});db[_0xabfd('0xc0')]['hasMany'](db[_0xabfd('0xc0')],{'as':_0xabfd('0x1bc'),'foreignKey':'FieldId'});db[_0xabfd('0xc0')]['belongsTo'](db[_0xabfd('0x99')],{'as':_0xabfd('0x99'),'foreignKey':_0xabfd('0x1bd')});db[_0xabfd('0xc1')][_0xabfd('0x115')](db[_0xabfd('0xc3')],{'as':_0xabfd('0x1b5'),'onDelete':_0xabfd('0x113'),'foreignKey':'AccountId'});db[_0xabfd('0xc3')][_0xabfd('0x115')](db[_0xabfd('0x1c4')],{'as':_0xabfd('0x1b6'),'foreignKey':_0xabfd('0x1b7')});db['VtigerConfiguration']['hasMany'](db[_0xabfd('0x1c4')],{'as':_0xabfd('0x1bf'),'foreignKey':_0xabfd('0x1bb')});db[_0xabfd('0xc3')][_0xabfd('0x115')](db['VtigerField'],{'as':_0xabfd('0x1b2'),'foreignKey':'FieldId'});db[_0xabfd('0xc3')][_0xabfd('0x123')](db[_0xabfd('0xc1')],{'as':_0xabfd('0x16b'),'foreignKey':_0xabfd('0x1be')});db[_0xabfd('0x1c4')][_0xabfd('0x115')](db[_0xabfd('0x1c4')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xabfd('0x1c4')][_0xabfd('0x115')](db[_0xabfd('0x1c4')],{'as':_0xabfd('0x1ba'),'foreignKey':_0xabfd('0x1bb')});db['VtigerField']['hasMany'](db[_0xabfd('0x1c4')],{'as':_0xabfd('0x1bc'),'foreignKey':'FieldId'});db[_0xabfd('0x1c4')][_0xabfd('0x123')](db[_0xabfd('0x99')],{'as':'Variable','foreignKey':_0xabfd('0x1bd')});db['ServicenowAccount'][_0xabfd('0x115')](db[_0xabfd('0x1c5')],{'as':'Configurations','onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1be')});db[_0xabfd('0x1c5')][_0xabfd('0x115')](db[_0xabfd('0xc8')],{'as':_0xabfd('0x1b6'),'foreignKey':_0xabfd('0x1b7')});db[_0xabfd('0x1c5')][_0xabfd('0x115')](db[_0xabfd('0xc8')],{'as':_0xabfd('0x1bf'),'foreignKey':'DescriptionId'});db[_0xabfd('0x1c5')]['hasMany'](db['ServicenowField'],{'as':_0xabfd('0x1b2'),'foreignKey':_0xabfd('0x1b9')});db[_0xabfd('0x1c5')][_0xabfd('0x123')](db[_0xabfd('0xc6')],{'as':'Account','foreignKey':_0xabfd('0x1be')});db[_0xabfd('0xc8')][_0xabfd('0x115')](db[_0xabfd('0xc8')],{'as':_0xabfd('0x1c0'),'foreignKey':_0xabfd('0x1b7')});db[_0xabfd('0xc8')][_0xabfd('0x115')](db[_0xabfd('0xc8')],{'as':_0xabfd('0x1ba'),'foreignKey':_0xabfd('0x1bb')});db[_0xabfd('0xc8')]['hasMany'](db[_0xabfd('0xc8')],{'as':_0xabfd('0x1bc'),'foreignKey':_0xabfd('0x1b9')});db[_0xabfd('0xc8')][_0xabfd('0x123')](db[_0xabfd('0x99')],{'as':_0xabfd('0x99'),'foreignKey':'VariableId'});db['Dynamics365Account'][_0xabfd('0x115')](db[_0xabfd('0xcc')],{'as':_0xabfd('0x1b5'),'onDelete':'cascade','foreignKey':_0xabfd('0x1be')});db[_0xabfd('0xcc')][_0xabfd('0x115')](db[_0xabfd('0xcd')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xabfd('0x1b7')});db[_0xabfd('0xcc')]['hasMany'](db[_0xabfd('0xcd')],{'as':_0xabfd('0x1bf'),'onDelete':'cascade','foreignKey':_0xabfd('0x1bb')});db[_0xabfd('0xcc')][_0xabfd('0x115')](db[_0xabfd('0xcd')],{'as':_0xabfd('0x1b2'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1b9')});db[_0xabfd('0xcc')]['belongsTo'](db['Dynamics365Account'],{'as':_0xabfd('0x16b'),'foreignKey':'AccountId'});db[_0xabfd('0xcd')]['hasMany'](db[_0xabfd('0xcd')],{'as':'Subject','foreignKey':'SubjectId'});db['Dynamics365Field'][_0xabfd('0x115')](db['Dynamics365Field'],{'as':_0xabfd('0x1ba'),'foreignKey':_0xabfd('0x1bb')});db[_0xabfd('0xcd')]['hasMany'](db[_0xabfd('0xcd')],{'as':'Field','foreignKey':_0xabfd('0x1b9')});db[_0xabfd('0xcd')][_0xabfd('0x123')](db[_0xabfd('0x99')],{'as':_0xabfd('0x99'),'foreignKey':_0xabfd('0x1bd')});db[_0xabfd('0xcf')][_0xabfd('0x115')](db[_0xabfd('0x1c6')],{'as':_0xabfd('0x1b5'),'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1be')});db['FreshsalesConfiguration'][_0xabfd('0x115')](db['FreshsalesField'],{'as':_0xabfd('0x1b6'),'foreignKey':_0xabfd('0x1b7')});db[_0xabfd('0x1c6')][_0xabfd('0x115')](db['FreshsalesField'],{'as':_0xabfd('0x1bf'),'foreignKey':_0xabfd('0x1bb')});db['FreshsalesConfiguration'][_0xabfd('0x115')](db['FreshsalesField'],{'as':'Fields','foreignKey':'FieldId'});db[_0xabfd('0x1c6')]['belongsTo'](db[_0xabfd('0xcf')],{'as':_0xabfd('0x16b'),'foreignKey':_0xabfd('0x1be')});db[_0xabfd('0xd2')][_0xabfd('0x115')](db[_0xabfd('0xd2')],{'as':'Subject','foreignKey':'SubjectId'});db['FreshsalesField']['hasMany'](db['FreshsalesField'],{'as':_0xabfd('0x1ba'),'foreignKey':'DescriptionId'});db[_0xabfd('0xd2')][_0xabfd('0x115')](db[_0xabfd('0xd2')],{'as':_0xabfd('0x1bc'),'foreignKey':_0xabfd('0x1b9')});db[_0xabfd('0xd2')][_0xabfd('0x123')](db['Variable'],{'as':_0xabfd('0x99'),'foreignKey':_0xabfd('0x1bd')});db[_0xabfd('0xd6')][_0xabfd('0x123')](db[_0xabfd('0x66')],{});db['ChatQueueReport']['belongsTo'](db[_0xabfd('0xf9')],{'as':_0xabfd('0x165'),'foreignKey':_0xabfd('0x166')});db['ChatQueueReport']['belongsTo'](db[_0xabfd('0x79')],{'as':_0xabfd('0x15d'),'foreignKey':_0xabfd('0x15e')});db[_0xabfd('0xd6')][_0xabfd('0x123')](db['ChatInteraction'],{});db[_0xabfd('0xd6')][_0xabfd('0x123')](db[_0xabfd('0x6e')],{});db['ChatQueueReport']['belongsTo'](db[_0xabfd('0x13')],{});db['ChatQueueReport'][_0xabfd('0x123')](db[_0xabfd('0x71')],{});db[_0xabfd('0xd8')]['belongsTo'](db[_0xabfd('0x13')],{'onDelete':'cascade','foreignKey':'FromId'});db['ChatInternalMessage']['belongsTo'](db[_0xabfd('0x13')],{'onDelete':_0xabfd('0x113'),'foreignKey':_0xabfd('0x1c7')});db[_0xabfd('0x1c8')][_0xabfd('0x115')](db[_0xabfd('0xdb')],{'foreignKey':_0xabfd('0x1c9'),'onDelete':_0xabfd('0x113')});db[_0xabfd('0x1c8')][_0xabfd('0x115')](db[_0xabfd('0x1ca')],{'foreignKey':_0xabfd('0x1c9'),'onDelete':_0xabfd('0x113')});db['SmsQueueReport'][_0xabfd('0x123')](db[_0xabfd('0x55')],{});db[_0xabfd('0xde')][_0xabfd('0x123')](db[_0xabfd('0xf9')],{'as':_0xabfd('0x165'),'foreignKey':_0xabfd('0x166')});db[_0xabfd('0xde')]['belongsTo'](db[_0xabfd('0x79')],{'as':_0xabfd('0x15d'),'foreignKey':_0xabfd('0x15e')});db['SmsQueueReport'][_0xabfd('0x123')](db[_0xabfd('0x59')],{});db[_0xabfd('0xde')][_0xabfd('0x123')](db[_0xabfd('0x5a')],{});db[_0xabfd('0xde')][_0xabfd('0x123')](db[_0xabfd('0x13')],{});db['SmsQueueReport'][_0xabfd('0x123')](db[_0xabfd('0x5c')],{});db['JscriptyProject'][_0xabfd('0x115')](db['JscriptySessionReport'],{'foreignKey':_0xabfd('0x1cb')});db[_0xabfd('0x1cc')][_0xabfd('0x115')](db['JscriptyQuestionReport'],{'foreignKey':_0xabfd('0x1cb')});db[_0xabfd('0x1cc')][_0xabfd('0x115')](db[_0xabfd('0x1ca')],{'foreignKey':'ProjectId'});db[_0xabfd('0xe7')][_0xabfd('0x125')](db['User'],{'as':_0xabfd('0x16e'),'through':_0xabfd('0x141')});db['Team'][_0xabfd('0x125')](db[_0xabfd('0x13')],{'as':_0xabfd('0x150'),'through':'user_has_teams'});db[_0xabfd('0xec')][_0xabfd('0x125')](db[_0xabfd('0x1d')],{'through':_0xabfd('0x151'),'as':_0xabfd('0x132')});db['Team'][_0xabfd('0x125')](db[_0xabfd('0x40')],{'through':'team_has_mail_queues','as':_0xabfd('0x1cd')});db[_0xabfd('0xec')][_0xabfd('0x125')](db[_0xabfd('0x71')],{'through':_0xabfd('0x192'),'as':_0xabfd('0x1ce')});db[_0xabfd('0xec')][_0xabfd('0x125')](db['FaxQueue'],{'through':_0xabfd('0x180'),'as':_0xabfd('0x1cf')});db[_0xabfd('0xec')][_0xabfd('0x125')](db[_0xabfd('0x5c')],{'through':_0xabfd('0x1d0'),'as':_0xabfd('0x134')});db[_0xabfd('0xec')][_0xabfd('0x125')](db[_0xabfd('0x64')],{'through':_0xabfd('0x1d1'),'as':_0xabfd('0x135')});db[_0xabfd('0xec')]['belongsToMany'](db[_0xabfd('0x136')],{'through':_0xabfd('0x1d2'),'as':_0xabfd('0x137')});db[_0xabfd('0xec')][_0xabfd('0x125')](db[_0xabfd('0xfb')],{'through':'TeamVoicePrefix','as':_0xabfd('0x133')});db[_0xabfd('0x199')][_0xabfd('0x115')](db[_0xabfd('0x7b')],{'as':_0xabfd('0x196'),'foreignKey':_0xabfd('0x19a')});db[_0xabfd('0x199')][_0xabfd('0x115')](db['CmHopperFinal'],{'as':_0xabfd('0x147'),'foreignKey':_0xabfd('0x19a')});db[_0xabfd('0x199')]['hasMany'](db[_0xabfd('0x11a')],{'as':'HopperHistories','foreignKey':_0xabfd('0x19a')});db[_0xabfd('0x199')][_0xabfd('0x115')](db[_0xabfd('0x7d')],{'as':'HopperBlacks','foreignKey':_0xabfd('0x19a')});db[_0xabfd('0x199')][_0xabfd('0x123')](db[_0xabfd('0x2c')],{'as':_0xabfd('0x2c'),'foreignKey':'TrunkId'});db[_0xabfd('0x199')]['belongsTo'](db[_0xabfd('0x2c')],{'as':_0xabfd('0x14c'),'foreignKey':_0xabfd('0x1d3')});db[_0xabfd('0x199')][_0xabfd('0x123')](db['Interval'],{'as':'Interval','foreignKey':_0xabfd('0x14d')});db[_0xabfd('0x199')][_0xabfd('0x123')](db[_0xabfd('0xe7')],{'as':_0xabfd('0xe7'),'foreignKey':_0xabfd('0x1d4')});db[_0xabfd('0x199')][_0xabfd('0x125')](db[_0xabfd('0xf9')],{'as':_0xabfd('0x128'),'through':_0xabfd('0x1d5')});db[_0xabfd('0x199')][_0xabfd('0x125')](db[_0xabfd('0xf9')],{'as':_0xabfd('0x152'),'through':_0xabfd('0x1d6')});db[_0xabfd('0x170')][_0xabfd('0x123')](db[_0xabfd('0x6f')],{'as':_0xabfd('0x6f'),'foreignKey':_0xabfd('0x174')});db['MailTransferReport'][_0xabfd('0x123')](db[_0xabfd('0x46')],{});db['MailTransferReport'][_0xabfd('0x123')](db[_0xabfd('0x44')],{});db['MailTransferReport'][_0xabfd('0x123')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db['MailTransferReport'][_0xabfd('0x123')](db[_0xabfd('0x13')],{'foreignKey':_0xabfd('0x1d7'),'as':'FromAgent'});db[_0xabfd('0xf3')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'foreignKey':'ToUserId','as':_0xabfd('0x1d8')});db['MailTransferReport'][_0xabfd('0x123')](db[_0xabfd('0x40')],{'foreignKey':'ToMailQueueId','as':_0xabfd('0x1d9')});db[_0xabfd('0xf3')][_0xabfd('0x123')](db[_0xabfd('0x3e')],{'foreignKey':_0xabfd('0x1da'),'as':'ToAccount'});db[_0xabfd('0x1db')]['belongsTo'](db['ChatMessage'],{});db[_0xabfd('0x1db')][_0xabfd('0x123')](db[_0xabfd('0x6c')],{});db[_0xabfd('0x1db')][_0xabfd('0x123')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0xabfd('0x1dc')});db[_0xabfd('0x1db')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'foreignKey':_0xabfd('0x1d7'),'as':_0xabfd('0x1dd')});db['ChatTransferReport'][_0xabfd('0x123')](db[_0xabfd('0x13')],{'foreignKey':_0xabfd('0x1de'),'as':'ToAgent'});db[_0xabfd('0x1db')]['belongsTo'](db[_0xabfd('0x71')],{'foreignKey':_0xabfd('0x1df'),'as':'ToQueue'});db['ChatTransferReport'][_0xabfd('0x123')](db[_0xabfd('0x66')],{'foreignKey':_0xabfd('0x1e0'),'as':_0xabfd('0x1e1')});db[_0xabfd('0xf4')][_0xabfd('0x123')](db[_0xabfd('0x52')],{});db[_0xabfd('0xf4')][_0xabfd('0x123')](db[_0xabfd('0x11e')],{});db['FaxTransferReport'][_0xabfd('0x123')](db['FaxAccount'],{'foreignKey':_0xabfd('0x1e2'),'as':_0xabfd('0x1dc')});db[_0xabfd('0xf4')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'foreignKey':_0xabfd('0x1d7'),'as':_0xabfd('0x1dd')});db[_0xabfd('0xf4')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'foreignKey':_0xabfd('0x1de'),'as':_0xabfd('0x1d8')});db[_0xabfd('0xf4')][_0xabfd('0x123')](db[_0xabfd('0x54')],{'foreignKey':'ToFaxQueueId','as':_0xabfd('0x1d9')});db[_0xabfd('0xf4')][_0xabfd('0x123')](db['FaxAccount'],{'foreignKey':_0xabfd('0x1e3'),'as':_0xabfd('0x1e1')});db[_0xabfd('0xf6')]['belongsTo'](db[_0xabfd('0x62')],{});db[_0xabfd('0xf6')][_0xabfd('0x123')](db[_0xabfd('0x188')],{});db[_0xabfd('0xf6')][_0xabfd('0x123')](db[_0xabfd('0x5d')],{'foreignKey':'FromOpenchannelAccountId','as':_0xabfd('0x1dc')});db[_0xabfd('0xf6')]['belongsTo'](db[_0xabfd('0x13')],{'foreignKey':_0xabfd('0x1d7'),'as':'FromAgent'});db[_0xabfd('0xf6')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'foreignKey':'ToUserId','as':_0xabfd('0x1d8')});db[_0xabfd('0xf6')][_0xabfd('0x123')](db[_0xabfd('0x64')],{'foreignKey':'ToOpenchannelQueueId','as':_0xabfd('0x1d9')});db[_0xabfd('0xf6')][_0xabfd('0x123')](db[_0xabfd('0x5d')],{'foreignKey':_0xabfd('0x1e4'),'as':'ToAccount'});db[_0xabfd('0xf7')][_0xabfd('0x123')](db['SmsMessage'],{});db['SmsTransferReport'][_0xabfd('0x123')](db[_0xabfd('0x59')],{});db[_0xabfd('0xf7')][_0xabfd('0x123')](db[_0xabfd('0x55')],{'foreignKey':_0xabfd('0x1e5'),'as':'FromAccount'});db[_0xabfd('0xf7')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'foreignKey':_0xabfd('0x1d7'),'as':'FromAgent'});db[_0xabfd('0xf7')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'foreignKey':_0xabfd('0x1de'),'as':_0xabfd('0x1d8')});db[_0xabfd('0xf7')][_0xabfd('0x123')](db[_0xabfd('0x5c')],{'foreignKey':_0xabfd('0x1e6'),'as':_0xabfd('0x1d9')});db[_0xabfd('0xf7')]['belongsTo'](db[_0xabfd('0x55')],{'foreignKey':_0xabfd('0x1e7'),'as':_0xabfd('0x1e1')});db[_0xabfd('0xf9')][_0xabfd('0x115')](db[_0xabfd('0x86')],{'as':_0xabfd('0x162'),'foreignKey':_0xabfd('0x166'),'onDelete':_0xabfd('0x113')});db[_0xabfd('0xf9')][_0xabfd('0x115')](db[_0xabfd('0x81')],{'as':_0xabfd('0x1e8'),'foreignKey':_0xabfd('0x166')});db[_0xabfd('0xf9')][_0xabfd('0x115')](db['CmContact'],{'as':'Contacts','onDelete':'cascade','foreignKey':_0xabfd('0x166')});db[_0xabfd('0xf9')][_0xabfd('0x115')](db[_0xabfd('0x7f')],{'as':_0xabfd('0x147'),'foreignKey':_0xabfd('0x166')});db[_0xabfd('0xf9')]['hasMany'](db[_0xabfd('0x11a')],{'as':_0xabfd('0x1e9'),'foreignKey':_0xabfd('0x166')});db['CmList'][_0xabfd('0x115')](db[_0xabfd('0x11b')],{'as':_0xabfd('0x11b'),'foreignKey':_0xabfd('0x166')});db[_0xabfd('0xf9')]['belongsToMany'](db[_0xabfd('0x1d')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0xabfd('0xf9')]['belongsToMany'](db[_0xabfd('0x13')],{'as':'Agents','through':_0xabfd('0x129')});db[_0xabfd('0xfb')][_0xabfd('0x115')](db[_0xabfd('0x1a')],{'as':'Extensions','onDelete':_0xabfd('0x113')});db[_0xabfd('0xfb')]['belongsToMany'](db[_0xabfd('0x13')],{'as':'Agents','through':'UserVoicePrefix'});db[_0xabfd('0xfb')][_0xabfd('0x125')](db[_0xabfd('0xec')],{'through':_0xabfd('0x10f'),'as':_0xabfd('0x16a')});db[_0xabfd('0xfd')][_0xabfd('0x115')](db[_0xabfd('0x13')],{'as':_0xabfd('0x16e'),'foreignKey':_0xabfd('0x124')});db['UserProfile']['hasMany'](db[_0xabfd('0xff')],{'as':_0xabfd('0x1ea'),'foreignKey':_0xabfd('0x124'),'onDelete':'cascade'});db[_0xabfd('0xff')][_0xabfd('0x115')](db[_0xabfd('0x1eb')],{'as':_0xabfd('0x1ec'),'foreignKey':_0xabfd('0x1ed'),'onDelete':_0xabfd('0x113')});db['WhatsappAccount']['hasMany'](db['Disposition'],{'as':_0xabfd('0x162'),'foreignKey':_0xabfd('0x1ee'),'onDelete':'cascade'});db['WhatsappAccount']['hasMany'](db['CannedAnswer'],{'as':_0xabfd('0x163'),'foreignKey':_0xabfd('0x1ee')});db[_0xabfd('0x13e')]['hasMany'](db['WhatsappMessage'],{'as':_0xabfd('0x156'),'foreignKey':_0xabfd('0x1ee')});db['WhatsappAccount'][_0xabfd('0x115')](db['WhatsappInteraction'],{'as':'Interactions'});db[_0xabfd('0x13e')][_0xabfd('0x115')](db[_0xabfd('0x104')],{'as':_0xabfd('0x143')});db[_0xabfd('0x13e')][_0xabfd('0x123')](db['CmList'],{'as':'List','foreignKey':_0xabfd('0x166')});db[_0xabfd('0x13e')]['belongsTo'](db[_0xabfd('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':_0xabfd('0x14e')});db[_0xabfd('0x13e')][_0xabfd('0x125')](db[_0xabfd('0x13')],{'as':'Agents','through':'user_has_whatsapp_accounts'});db[_0xabfd('0x104')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'onDelete':'restrict'});db[_0xabfd('0x104')][_0xabfd('0x123')](db[_0xabfd('0x136')],{'onDelete':'restrict'});db[_0xabfd('0x104')]['belongsTo'](db[_0xabfd('0x13e')],{'onDelete':'restrict'});db[_0xabfd('0x104')][_0xabfd('0x123')](db[_0xabfd('0x8a')],{'onDelete':_0xabfd('0x161'),'foreignKey':_0xabfd('0x14d')});db[_0xabfd('0x104')][_0xabfd('0x123')](db[_0xabfd('0x94')],{'onDelete':'restrict','foreignKey':_0xabfd('0x175')});db[_0xabfd('0x106')][_0xabfd('0x115')](db[_0xabfd('0x1ef')],{'as':_0xabfd('0x156'),'onDelete':'cascade','foreignKey':_0xabfd('0x1f0')});db['WhatsappInteraction'][_0xabfd('0x123')](db[_0xabfd('0x13e')],{'as':_0xabfd('0x16b'),'foreignKey':_0xabfd('0x1ee')});db['WhatsappInteraction']['belongsTo'](db['CmContact'],{'as':_0xabfd('0x15d'),'foreignKey':_0xabfd('0x15e')});db[_0xabfd('0x106')][_0xabfd('0x123')](db['User'],{'as':_0xabfd('0x17b'),'foreignKey':_0xabfd('0x114')});db[_0xabfd('0x106')][_0xabfd('0x125')](db[_0xabfd('0x94')],{'through':_0xabfd('0x1ac'),'as':'Tags'});db[_0xabfd('0x106')][_0xabfd('0x125')](db['Tag'],{'through':_0xabfd('0x1ac'),'as':_0xabfd('0x17d')});db[_0xabfd('0x106')][_0xabfd('0x125')](db['User'],{'as':_0xabfd('0x16e'),'through':'user_has_whatsapp_interactions','foreignKey':_0xabfd('0x1f0')});db[_0xabfd('0x1ef')]['belongsTo'](db[_0xabfd('0x13')],{'as':_0xabfd('0x13')});db['WhatsappMessage'][_0xabfd('0x123')](db['CmContact'],{'onDelete':_0xabfd('0x113'),'as':'Contact'});db[_0xabfd('0x1ef')][_0xabfd('0x123')](db['WhatsappInteraction'],{'onDelete':_0xabfd('0x113'),'as':_0xabfd('0x172'),'foreignKey':_0xabfd('0x1f0')});db[_0xabfd('0x1ef')][_0xabfd('0x123')](db[_0xabfd('0x13e')],{'as':_0xabfd('0x16b'),'foreignKey':_0xabfd('0x1ee')});db[_0xabfd('0x109')][_0xabfd('0x123')](db[_0xabfd('0x13e')],{});db[_0xabfd('0x109')][_0xabfd('0x123')](db[_0xabfd('0xf9')],{'as':_0xabfd('0x165'),'foreignKey':_0xabfd('0x166')});db[_0xabfd('0x109')][_0xabfd('0x123')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xabfd('0x109')][_0xabfd('0x123')](db[_0xabfd('0x106')],{});db[_0xabfd('0x109')][_0xabfd('0x123')](db[_0xabfd('0x136')],{});db[_0xabfd('0x109')][_0xabfd('0x123')](db[_0xabfd('0x1ef')],{});db[_0xabfd('0x109')][_0xabfd('0x123')](db[_0xabfd('0x13')],{});db['WhatsappTransferReport'][_0xabfd('0x123')](db[_0xabfd('0x1ef')],{});db[_0xabfd('0x10b')][_0xabfd('0x123')](db['WhatsappInteraction'],{});db[_0xabfd('0x10b')]['belongsTo'](db[_0xabfd('0x13e')],{'foreignKey':_0xabfd('0x1f1'),'as':_0xabfd('0x1dc')});db[_0xabfd('0x10b')][_0xabfd('0x123')](db[_0xabfd('0x13e')],{'foreignKey':_0xabfd('0x1f2'),'as':_0xabfd('0x1e1')});db['WhatsappTransferReport']['belongsTo'](db[_0xabfd('0x136')],{'foreignKey':_0xabfd('0x1f3'),'as':'ToQueue'});db[_0xabfd('0x10b')][_0xabfd('0x123')](db[_0xabfd('0x13')],{'foreignKey':_0xabfd('0x1d7'),'as':_0xabfd('0x1dd')});db['WhatsappTransferReport'][_0xabfd('0x123')](db[_0xabfd('0x13')],{'foreignKey':_0xabfd('0x1de'),'as':_0xabfd('0x1d8')});db[_0xabfd('0x136')][_0xabfd('0x125')](db[_0xabfd('0x13')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0xabfd('0x1f4')});db[_0xabfd('0x136')][_0xabfd('0x125')](db[_0xabfd('0xec')],{'through':_0xabfd('0x1d2'),'as':_0xabfd('0x16a')});db['CloudProvider'][_0xabfd('0x112')](db[_0xabfd('0x3b')],{'as':_0xabfd('0x1f5'),'onDelete':_0xabfd('0x161')});db[_0xabfd('0x10e')][_0xabfd('0x112')](db[_0xabfd('0x3c')],{'as':'Smtp','onDelete':_0xabfd('0x161')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index aa2dea4..af33a69 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7374=['/api/jscripty/projects','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/voice/prefixes','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappTransferReport','./api/whatsappQueue','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','street','mobile','fax','clientSecret','securityToken','code','accessKey','tenantId','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','registry','oldPassword','isPlainObject','isArray','length','isString','replace','lodash','path','express','express-winston','util','./config/environment','./config/logger','api','safeTemplate','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','inspect','logger','%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)','format','method','other','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/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/pauses','/api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','/api/square/details/reports'];(function(_0x4509e6,_0x5036a8){var _0x4bc118=function(_0x94f92e){while(--_0x94f92e){_0x4509e6['push'](_0x4509e6['shift']());}};_0x4bc118(++_0x5036a8);}(_0x7374,0x1b9));var _0x4737=function(_0x38c206,_0x29629b){_0x38c206=_0x38c206-0x0;var _0x3c0e68=_0x7374[_0x38c206];return _0x3c0e68;};'use strict';var _=require(_0x4737('0x0'));var path=require(_0x4737('0x1'));var express=require(_0x4737('0x2'));var ewinston=require(_0x4737('0x3'));var util=require(_0x4737('0x4'));var errors=require('./errors');var config=require(_0x4737('0x5'));var logger=require(_0x4737('0x6'))(_0x4737('0x7'));var authLogger=require(_0x4737('0x6'))('auth');var safeTemplate=require('./safe-template')[_0x4737('0x8')];exports[_0x4737('0x9')]=function(_0x311410){_0x311410[_0x4737('0xa')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x1595c6,_0x739dad){var _0x2e295e=_0x4737('0xb');if(!_[_0x4737('0xc')](_0x1595c6['body'])){_0x2e295e+=_0x4737('0xd');var _0x3a51a8=_0x1595c6[_0x4737('0xe')];maskSensitiveData(_0x3a51a8);}return safeTemplate(util['format'](_0x2e295e,_0x1595c6['method'],_0x1595c6[_0x4737('0xf')][_0x4737('0x10')]?_0x1595c6[_0x4737('0xf')][_0x4737('0x10')]:_0x1595c6[_0x4737('0x11')][_0x4737('0x12')]||_0x1595c6['ip'],_0x1595c6[_0x4737('0x13')],_0x739dad[_0x4737('0x14')],_0x739dad[_0x4737('0x15')],_0x1595c6['user']?_0x1595c6[_0x4737('0x16')]['id']:null,_0x1595c6[_0x4737('0x16')]?_0x1595c6[_0x4737('0x16')][_0x4737('0x17')]:null,_0x1595c6[_0x4737('0x16')]?_0x1595c6['user']['role']:null,_0x3a51a8?util[_0x4737('0x18')](_0x3a51a8,![],null):''));}}));_0x311410['use'](ewinston[_0x4737('0x19')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0xf96423,_0x5f415d){var _0x3ed96f=_0x4737('0x1a');if(_0xf96423[_0x4737('0xe')]&&_0xf96423['body'][_0x4737('0x1b')]&&_0xf96423['body'][_0x4737('0x1c')]){_0x3ed96f=_0x4737('0x1d');}return util[_0x4737('0x1e')](_0x3ed96f,_0xf96423[_0x4737('0x1f')],_0xf96423[_0x4737('0xf')]['x-forwarded-for']?_0xf96423[_0x4737('0xf')][_0x4737('0x10')]:_0xf96423[_0x4737('0x11')][_0x4737('0x12')]||_0xf96423['ip'],_0xf96423['url'],_0x5f415d[_0x4737('0x14')],_0x5f415d['responseTime'],_0xf96423[_0x4737('0x16')]?_0xf96423[_0x4737('0x16')]['id']:null,_0xf96423['user']?_0xf96423[_0x4737('0x16')][_0x4737('0x17')]:null,_0xf96423[_0x4737('0x16')]?_0xf96423[_0x4737('0x16')]['role']:null,_0xf96423[_0x4737('0xe')]&&_0xf96423[_0x4737('0xe')]['device']?_0xf96423[_0x4737('0xe')]['device']:_0x4737('0x20'),_0xf96423[_0x4737('0xe')]&&_0xf96423[_0x4737('0xe')][_0x4737('0x1c')]?_0xf96423[_0x4737('0xe')][_0x4737('0x1c')]:'',_0xf96423['body']&&_0xf96423[_0x4737('0xe')]['agent_name']?_0xf96423[_0x4737('0xe')]['agent_name']:'');},'ignoreRoute':function(_0x29618d){var _0x149877=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x149877[_0x4737('0x21')](_0x29618d['url']);}}));_0x311410['use'](_0x4737('0x22'),require(_0x4737('0x23')));_0x311410[_0x4737('0xa')](_0x4737('0x24'),require(_0x4737('0x25')));_0x311410['use'](_0x4737('0x26'),require(_0x4737('0x27')));_0x311410[_0x4737('0xa')](_0x4737('0x28'),require(_0x4737('0x29')));_0x311410[_0x4737('0xa')](_0x4737('0x2a'),require(_0x4737('0x2b')));_0x311410['use'](_0x4737('0x2c'),require(_0x4737('0x2d')));_0x311410[_0x4737('0xa')](_0x4737('0x2e'),require(_0x4737('0x2f')));_0x311410[_0x4737('0xa')](_0x4737('0x30'),require(_0x4737('0x31')));_0x311410[_0x4737('0xa')]('/api/voice/mails',require('./api/voiceMail'));_0x311410[_0x4737('0xa')](_0x4737('0x32'),require('./api/voiceMailMessage'));_0x311410[_0x4737('0xa')](_0x4737('0x33'),require(_0x4737('0x34')));_0x311410[_0x4737('0xa')](_0x4737('0x35'),require(_0x4737('0x36')));_0x311410[_0x4737('0xa')](_0x4737('0x37'),require(_0x4737('0x38')));_0x311410[_0x4737('0xa')]('/api/voice/queues/reports',require(_0x4737('0x39')));_0x311410[_0x4737('0xa')](_0x4737('0x3a'),require(_0x4737('0x3b')));_0x311410['use']('/api/trunks',require(_0x4737('0x3c')));_0x311410['use'](_0x4737('0x3d'),require(_0x4737('0x3e')));_0x311410['use'](_0x4737('0x3f'),require(_0x4737('0x40')));_0x311410[_0x4737('0xa')](_0x4737('0x41'),require(_0x4737('0x42')));_0x311410[_0x4737('0xa')](_0x4737('0x43'),require('./api/mailQueue'));_0x311410[_0x4737('0xa')](_0x4737('0x44'),require(_0x4737('0x45')));_0x311410[_0x4737('0xa')](_0x4737('0x46'),require(_0x4737('0x47')));_0x311410['use'](_0x4737('0x48'),require(_0x4737('0x49')));_0x311410[_0x4737('0xa')]('/api/mail/applications',require('./api/mailApplication'));_0x311410[_0x4737('0xa')](_0x4737('0x4a'),require('./api/mailQueueReport'));_0x311410[_0x4737('0xa')](_0x4737('0x4b'),require(_0x4737('0x4c')));_0x311410[_0x4737('0xa')](_0x4737('0x4d'),require(_0x4737('0x4e')));_0x311410[_0x4737('0xa')](_0x4737('0x4f'),require(_0x4737('0x50')));_0x311410[_0x4737('0xa')](_0x4737('0x51'),require(_0x4737('0x52')));_0x311410[_0x4737('0xa')](_0x4737('0x53'),require('./api/faxInteraction'));_0x311410[_0x4737('0xa')](_0x4737('0x54'),require(_0x4737('0x55')));_0x311410[_0x4737('0xa')](_0x4737('0x56'),require(_0x4737('0x57')));_0x311410[_0x4737('0xa')](_0x4737('0x58'),require(_0x4737('0x59')));_0x311410['use'](_0x4737('0x5a'),require(_0x4737('0x5b')));_0x311410[_0x4737('0xa')]('/api/sms/applications',require(_0x4737('0x5c')));_0x311410[_0x4737('0xa')](_0x4737('0x5d'),require(_0x4737('0x5e')));_0x311410[_0x4737('0xa')]('/api/sms/messages',require('./api/smsMessage'));_0x311410[_0x4737('0xa')](_0x4737('0x5f'),require(_0x4737('0x60')));_0x311410[_0x4737('0xa')](_0x4737('0x61'),require('./api/openchannelAccount'));_0x311410[_0x4737('0xa')](_0x4737('0x62'),require(_0x4737('0x63')));_0x311410[_0x4737('0xa')](_0x4737('0x64'),require(_0x4737('0x65')));_0x311410[_0x4737('0xa')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x311410[_0x4737('0xa')](_0x4737('0x66'),require(_0x4737('0x67')));_0x311410['use'](_0x4737('0x68'),require('./api/chatWebsite'));_0x311410[_0x4737('0xa')](_0x4737('0x69'),require(_0x4737('0x6a')));_0x311410[_0x4737('0xa')](_0x4737('0x6b'),require(_0x4737('0x6c')));_0x311410[_0x4737('0xa')](_0x4737('0x6d'),require(_0x4737('0x6e')));_0x311410['use'](_0x4737('0x6f'),require(_0x4737('0x70')));_0x311410[_0x4737('0xa')]('/api/chat/offline_messages',require(_0x4737('0x71')));_0x311410[_0x4737('0xa')](_0x4737('0x72'),require('./api/chatQueue'));_0x311410[_0x4737('0xa')](_0x4737('0x73'),require(_0x4737('0x74')));_0x311410[_0x4737('0xa')](_0x4737('0x75'),require('./api/chatProactiveAction'));_0x311410['use'](_0x4737('0x76'),require(_0x4737('0x77')));_0x311410[_0x4737('0xa')](_0x4737('0x78'),require(_0x4737('0x79')));_0x311410['use'](_0x4737('0x7a'),require('./api/cmHopper'));_0x311410[_0x4737('0xa')](_0x4737('0x7b'),require(_0x4737('0x7c')));_0x311410[_0x4737('0xa')](_0x4737('0x7d'),require(_0x4737('0x7e')));_0x311410['use'](_0x4737('0x7f'),require(_0x4737('0x80')));_0x311410['use'](_0x4737('0x81'),require(_0x4737('0x82')));_0x311410[_0x4737('0xa')]('/api/actions',require(_0x4737('0x83')));_0x311410['use'](_0x4737('0x84'),require(_0x4737('0x85')));_0x311410['use'](_0x4737('0x86'),require(_0x4737('0x87')));_0x311410[_0x4737('0xa')](_0x4737('0x88'),require(_0x4737('0x89')));_0x311410[_0x4737('0xa')](_0x4737('0x8a'),require('./api/condition'));_0x311410[_0x4737('0xa')](_0x4737('0x8b'),require(_0x4737('0x8c')));_0x311410[_0x4737('0xa')](_0x4737('0x8d'),require('./api/pause'));_0x311410['use'](_0x4737('0x8e'),require('./api/cdr'));_0x311410['use'](_0x4737('0x8f'),require('./api/voiceQueuesLog'));_0x311410[_0x4737('0xa')](_0x4737('0x90'),require(_0x4737('0x91')));_0x311410['use'](_0x4737('0x92'),require('./api/sound'));_0x311410[_0x4737('0xa')](_0x4737('0x93'),require(_0x4737('0x94')));_0x311410[_0x4737('0xa')](_0x4737('0x95'),require(_0x4737('0x96')));_0x311410['use'](_0x4737('0x97'),require(_0x4737('0x98')));_0x311410[_0x4737('0xa')](_0x4737('0x99'),require('./api/variable'));_0x311410['use']('/api/integrations',require(_0x4737('0x9a')));_0x311410[_0x4737('0xa')](_0x4737('0x9b'),require(_0x4737('0x9c')));_0x311410[_0x4737('0xa')](_0x4737('0x9d'),require(_0x4737('0x9e')));_0x311410[_0x4737('0xa')](_0x4737('0x9f'),require('./api/analyticDefaultReport'));_0x311410['use'](_0x4737('0xa0'),require('./api/analyticExtractedReport'));_0x311410['use'](_0x4737('0xa1'),require(_0x4737('0xa2')));_0x311410[_0x4737('0xa')](_0x4737('0xa3'),require(_0x4737('0xa4')));_0x311410[_0x4737('0xa')](_0x4737('0xa5'),require(_0x4737('0xa6')));_0x311410['use']('/api/integrations/salesforce/accounts',require(_0x4737('0xa7')));_0x311410[_0x4737('0xa')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x311410[_0x4737('0xa')]('/api/integrations/salesforce/fields',require(_0x4737('0xa8')));_0x311410[_0x4737('0xa')](_0x4737('0xa9'),require('./api/intSugarcrmAccount'));_0x311410['use'](_0x4737('0xaa'),require(_0x4737('0xab')));_0x311410[_0x4737('0xa')](_0x4737('0xac'),require(_0x4737('0xad')));_0x311410[_0x4737('0xa')](_0x4737('0xae'),require(_0x4737('0xaf')));_0x311410[_0x4737('0xa')](_0x4737('0xb0'),require(_0x4737('0xb1')));_0x311410['use'](_0x4737('0xb2'),require(_0x4737('0xb3')));_0x311410['use']('/api/integrations/zoho/accounts',require(_0x4737('0xb4')));_0x311410[_0x4737('0xa')](_0x4737('0xb5'),require('./api/intZohoConfiguration'));_0x311410[_0x4737('0xa')](_0x4737('0xb6'),require(_0x4737('0xb7')));_0x311410[_0x4737('0xa')](_0x4737('0xb8'),require(_0x4737('0xb9')));_0x311410[_0x4737('0xa')](_0x4737('0xba'),require(_0x4737('0xbb')));_0x311410[_0x4737('0xa')](_0x4737('0xbc'),require('./api/intZendeskField'));_0x311410[_0x4737('0xa')](_0x4737('0xbd'),require('./api/intFreshdeskAccount'));_0x311410['use']('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x311410[_0x4737('0xa')]('/api/integrations/freshdesk/fields',require(_0x4737('0xbe')));_0x311410[_0x4737('0xa')](_0x4737('0xbf'),require(_0x4737('0xc0')));_0x311410[_0x4737('0xa')]('/api/integrations/vtiger/configurations',require(_0x4737('0xc1')));_0x311410['use'](_0x4737('0xc2'),require(_0x4737('0xc3')));_0x311410['use'](_0x4737('0xc4'),require(_0x4737('0xc5')));_0x311410[_0x4737('0xa')](_0x4737('0xc6'),require(_0x4737('0xc7')));_0x311410['use'](_0x4737('0xc8'),require(_0x4737('0xc9')));_0x311410[_0x4737('0xa')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x311410['use'](_0x4737('0xca'),require(_0x4737('0xcb')));_0x311410[_0x4737('0xa')]('/api/integrations/dynamics365/fields',require(_0x4737('0xcc')));_0x311410[_0x4737('0xa')](_0x4737('0xcd'),require(_0x4737('0xce')));_0x311410[_0x4737('0xa')]('/api/integrations/freshsales/configurations',require(_0x4737('0xcf')));_0x311410[_0x4737('0xa')](_0x4737('0xd0'),require('./api/intFreshsalesField'));_0x311410[_0x4737('0xa')](_0x4737('0xd1'),require(_0x4737('0xd2')));_0x311410[_0x4737('0xa')](_0x4737('0xd3'),require(_0x4737('0xd4')));_0x311410[_0x4737('0xa')](_0x4737('0xd5'),require(_0x4737('0xd6')));_0x311410[_0x4737('0xa')](_0x4737('0xd7'),require('./api/jscriptyAnswerReport'));_0x311410[_0x4737('0xa')](_0x4737('0xd8'),require(_0x4737('0xd9')));_0x311410['use'](_0x4737('0xda'),require(_0x4737('0xdb')));_0x311410[_0x4737('0xa')]('/api/sms/reports/queue',require(_0x4737('0xdc')));_0x311410[_0x4737('0xa')](_0x4737('0xdd'),require('./api/squareReport'));_0x311410[_0x4737('0xa')](_0x4737('0xde'),require('./api/squareReportDetail'));_0x311410[_0x4737('0xa')](_0x4737('0xdf'),require('./api/jscriptyProject'));_0x311410[_0x4737('0xa')](_0x4737('0xe0'),require('./api/setting'));_0x311410['use'](_0x4737('0xe1'),require(_0x4737('0xe2')));_0x311410[_0x4737('0xa')](_0x4737('0xe3'),require(_0x4737('0xe4')));_0x311410[_0x4737('0xa')](_0x4737('0xe5'),require(_0x4737('0xe6')));_0x311410[_0x4737('0xa')]('/api/square/messages',require(_0x4737('0xe7')));_0x311410[_0x4737('0xa')](_0x4737('0xe8'),require(_0x4737('0xe9')));_0x311410['use'](_0x4737('0xea'),require(_0x4737('0xeb')));_0x311410[_0x4737('0xa')](_0x4737('0xec'),require('./api/campaign'));_0x311410[_0x4737('0xa')](_0x4737('0xed'),require('./api/migration'));_0x311410['use'](_0x4737('0xee'),require(_0x4737('0xef')));_0x311410['use']('/api/plugins',require(_0x4737('0xf0')));_0x311410[_0x4737('0xa')](_0x4737('0xf1'),require(_0x4737('0xf2')));_0x311410[_0x4737('0xa')](_0x4737('0xf3'),require(_0x4737('0xf4')));_0x311410[_0x4737('0xa')](_0x4737('0xf5'),require('./api/faxTransferReport'));_0x311410[_0x4737('0xa')](_0x4737('0xf6'),require(_0x4737('0xf7')));_0x311410[_0x4737('0xa')](_0x4737('0xf8'),require(_0x4737('0xf9')));_0x311410[_0x4737('0xa')]('/api/cm/lists',require('./api/cmList'));_0x311410['use'](_0x4737('0xfa'),require('./api/voicePrefix'));_0x311410[_0x4737('0xa')]('/api/userProfiles',require('./api/userProfile'));_0x311410[_0x4737('0xa')]('/api/userProfile/sections',require(_0x4737('0xfb')));_0x311410[_0x4737('0xa')](_0x4737('0xfc'),require(_0x4737('0xfd')));_0x311410[_0x4737('0xa')](_0x4737('0xfe'),require(_0x4737('0xff')));_0x311410[_0x4737('0xa')](_0x4737('0x100'),require(_0x4737('0x101')));_0x311410[_0x4737('0xa')]('/api/whatsapp/applications',require(_0x4737('0x102')));_0x311410[_0x4737('0xa')](_0x4737('0x103'),require('./api/whatsappInteraction'));_0x311410[_0x4737('0xa')](_0x4737('0x104'),require(_0x4737('0x105')));_0x311410[_0x4737('0xa')](_0x4737('0x106'),require('./api/whatsappQueueReport'));_0x311410[_0x4737('0xa')]('/api/whatsapp/reports/transfer',require(_0x4737('0x107')));_0x311410[_0x4737('0xa')]('/api/whatsapp/queues',require(_0x4737('0x108')));_0x311410[_0x4737('0xa')]('/api/cloudProviders',require('./api/cloudProvider'));_0x311410['use']('/api/realtime',require('./api/realtime'));_0x311410['use'](_0x4737('0x109'),require(_0x4737('0x10a')));_0x311410[_0x4737('0xa')](_0x4737('0x10b'),require(_0x4737('0x10c')));_0x311410[_0x4737('0xa')](_0x4737('0x10d'),require('./api/authActiveDirectory'));_0x311410['use'](_0x4737('0x10e'),require(_0x4737('0x10f')));_0x311410['use'](_0x4737('0x110'),require(_0x4737('0x111')));_0x311410[_0x4737('0xa')](_0x4737('0x112'),require(_0x4737('0x113')));_0x311410['use'](_0x4737('0x114'),require('./api/system'));_0x311410[_0x4737('0xa')](_0x4737('0x115'),require(_0x4737('0x116')));_0x311410['use'](_0x4737('0x117'),require(_0x4737('0x118')));_0x311410['use'](_0x4737('0x119'),express[_0x4737('0x11a')](path[_0x4737('0x11b')](config[_0x4737('0x11c')],_0x4737('0x119'))));_0x311410['use']('/www',express['static'](path[_0x4737('0x11b')](config['root'],_0x4737('0x11d'))));_0x311410[_0x4737('0xa')](_0x4737('0x11e'),express['static'](path[_0x4737('0x11b')](config[_0x4737('0x11c')],'/demo')));_0x311410[_0x4737('0xa')](_0x4737('0x11f'),express[_0x4737('0x11a')](path[_0x4737('0x11b')](config[_0x4737('0x11c')],'snippet',_0x4737('0x120'))));_0x311410[_0x4737('0xa')](_0x4737('0x121'),express[_0x4737('0x11a')](path[_0x4737('0x11b')](config[_0x4737('0x11c')],_0x4737('0x122'))));_0x311410[_0x4737('0x123')](_0x4737('0x124'))[_0x4737('0x125')](errors[0x194]);_0x311410[_0x4737('0x123')]('/*')['get'](function(_0x18ded1,_0x540345){_0x540345['sendFile'](path[_0x4737('0x126')](_0x311410[_0x4737('0x125')](_0x4737('0x127'))+_0x4737('0x128')));});};var sensitiveFields=[_0x4737('0x129'),_0x4737('0x12a'),_0x4737('0x12b'),_0x4737('0x12c'),_0x4737('0x12d'),'lastName',_0x4737('0x12e'),'phone',_0x4737('0x12f'),_0x4737('0x130'),'email','clientId',_0x4737('0x131'),_0x4737('0x132'),_0x4737('0x133'),_0x4737('0x134'),_0x4737('0x135'),'token','channelSecret',_0x4737('0x136'),_0x4737('0x137'),_0x4737('0x138'),_0x4737('0x139'),_0x4737('0x13a'),_0x4737('0x13b'),'calleridname','calleridnum',_0x4737('0x13c'),'vidaooApiKey',_0x4737('0x13d'),_0x4737('0x13e'),_0x4737('0x13f'),_0x4737('0x140'),_0x4737('0x141'),_0x4737('0x16'),'pass',_0x4737('0x142'),_0x4737('0x143'),_0x4737('0x144'),'secret',_0x4737('0x145'),_0x4737('0x146')];function maskSensitiveData(_0x2eee88){var _0x2e5fa1=/(?!^)[\s\S](?!$)/g;if(!_[_0x4737('0x147')](_0x2eee88))return;for(var _0x286a7e in _0x2eee88){if(_[_0x4737('0x148')](_0x2eee88[_0x286a7e])){for(var _0x1cdeb4=0x0;_0x1cdeb4<_0x2eee88[_0x286a7e][_0x4737('0x149')];_0x1cdeb4++){maskSensitiveData(_0x2eee88[_0x286a7e][_0x1cdeb4]);}}else if(_[_0x4737('0x147')](_0x2eee88[_0x286a7e])){maskSensitiveData(_0x2eee88[_0x286a7e]);}else if(_[_0x4737('0x14a')](_0x2eee88[_0x286a7e])){_0x2eee88[_0x286a7e]=_0x2eee88[_0x286a7e][_0x4737('0x14b')](/{{{/g,'@@{')[_0x4737('0x14b')](/}}}/g,'}@@')['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x286a7e)){_0x2eee88[_0x286a7e]=_0x2eee88[_0x286a7e][_0x4737('0x14b')](_0x2e5fa1,'*');}}}} \ No newline at end of file +var _0xf55c=['/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/version','./api/system','/api/pm2','/apidoc','static','join','/www','root','/demo','snippet','/plugins','/server/files/plugins','route','get','sendFile','appPath','/index.html','password','newPassword','apiKey','firstName','lastName','street','mobile','fax','email','clientId','securityToken','code','accessKey','tenantId','channelSecret','accessTokenSecret','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','lodash','express','express-winston','util','./errors','./config/environment','./config/logger','api','auth','./safe-template','safeTemplate','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','role','other','agent_id','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','/api/dashboards/items','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/applications','./api/smsApplication','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper_black','./api/cmHopperBlack','/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/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','./api/trigger','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField'];(function(_0x3c5362,_0x1d3705){var _0x29af79=function(_0x160675){while(--_0x160675){_0x3c5362['push'](_0x3c5362['shift']());}};_0x29af79(++_0x1d3705);}(_0xf55c,0x1e7));var _0xcf55=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xf55c[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0xcf55('0x0'));var path=require('path');var express=require(_0xcf55('0x1'));var ewinston=require(_0xcf55('0x2'));var util=require(_0xcf55('0x3'));var errors=require(_0xcf55('0x4'));var config=require(_0xcf55('0x5'));var logger=require(_0xcf55('0x6'))(_0xcf55('0x7'));var authLogger=require('./config/logger')(_0xcf55('0x8'));var safeTemplate=require(_0xcf55('0x9'))[_0xcf55('0xa')];exports[_0xcf55('0xb')]=function(_0x4b3453){_0x4b3453[_0xcf55('0xc')](ewinston[_0xcf55('0xd')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x7003f1,_0x3018aa){var _0x576566=_0xcf55('0xe');if(!_[_0xcf55('0xf')](_0x7003f1[_0xcf55('0x10')])){_0x576566+=_0xcf55('0x11');var _0x68c2b6=_0x7003f1[_0xcf55('0x10')];maskSensitiveData(_0x68c2b6);}return safeTemplate(util[_0xcf55('0x12')](_0x576566,_0x7003f1['method'],_0x7003f1[_0xcf55('0x13')][_0xcf55('0x14')]?_0x7003f1['headers']['x-forwarded-for']:_0x7003f1[_0xcf55('0x15')][_0xcf55('0x16')]||_0x7003f1['ip'],_0x7003f1[_0xcf55('0x17')],_0x3018aa[_0xcf55('0x18')],_0x3018aa[_0xcf55('0x19')],_0x7003f1[_0xcf55('0x1a')]?_0x7003f1[_0xcf55('0x1a')]['id']:null,_0x7003f1[_0xcf55('0x1a')]?_0x7003f1[_0xcf55('0x1a')][_0xcf55('0x1b')]:null,_0x7003f1[_0xcf55('0x1a')]?_0x7003f1[_0xcf55('0x1a')]['role']:null,_0x68c2b6?util[_0xcf55('0x1c')](_0x68c2b6,![],null):''));}}));_0x4b3453[_0xcf55('0xc')](ewinston[_0xcf55('0xd')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x30f6c4,_0x2174a3){var _0x4b0c1a=_0xcf55('0x1d');if(_0x30f6c4[_0xcf55('0x10')]&&_0x30f6c4[_0xcf55('0x10')][_0xcf55('0x1e')]&&_0x30f6c4[_0xcf55('0x10')]['agent_id']){_0x4b0c1a=_0xcf55('0x1f');}return util['format'](_0x4b0c1a,_0x30f6c4[_0xcf55('0x20')],_0x30f6c4[_0xcf55('0x13')][_0xcf55('0x14')]?_0x30f6c4['headers']['x-forwarded-for']:_0x30f6c4['connection'][_0xcf55('0x16')]||_0x30f6c4['ip'],_0x30f6c4[_0xcf55('0x17')],_0x2174a3[_0xcf55('0x18')],_0x2174a3['responseTime'],_0x30f6c4[_0xcf55('0x1a')]?_0x30f6c4[_0xcf55('0x1a')]['id']:null,_0x30f6c4['user']?_0x30f6c4['user'][_0xcf55('0x1b')]:null,_0x30f6c4[_0xcf55('0x1a')]?_0x30f6c4['user'][_0xcf55('0x21')]:null,_0x30f6c4[_0xcf55('0x10')]&&_0x30f6c4[_0xcf55('0x10')][_0xcf55('0x1e')]?_0x30f6c4[_0xcf55('0x10')][_0xcf55('0x1e')]:_0xcf55('0x22'),_0x30f6c4[_0xcf55('0x10')]&&_0x30f6c4['body'][_0xcf55('0x23')]?_0x30f6c4['body'][_0xcf55('0x23')]:'',_0x30f6c4[_0xcf55('0x10')]&&_0x30f6c4[_0xcf55('0x10')]['agent_name']?_0x30f6c4['body']['agent_name']:'');},'ignoreRoute':function(_0x47692b){var _0x34c18b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x34c18b['test'](_0x47692b['url']);}}));_0x4b3453[_0xcf55('0xc')]('/api/users',require(_0xcf55('0x24')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x25'),require(_0xcf55('0x26')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x27'),require(_0xcf55('0x28')));_0x4b3453['use'](_0xcf55('0x29'),require('./api/voiceExtension'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x2a'),require(_0xcf55('0x2b')));_0x4b3453['use'](_0xcf55('0x2c'),require(_0xcf55('0x2d')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x2e'),require('./api/voiceRecording'));_0x4b3453[_0xcf55('0xc')]('/api/screen/recordings',require('./api/screenRecording'));_0x4b3453['use'](_0xcf55('0x2f'),require('./api/voiceMail'));_0x4b3453['use'](_0xcf55('0x30'),require(_0xcf55('0x31')));_0x4b3453['use'](_0xcf55('0x32'),require(_0xcf55('0x33')));_0x4b3453['use']('/api/voice/dials/reports',require(_0xcf55('0x34')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x35'),require(_0xcf55('0x36')));_0x4b3453['use'](_0xcf55('0x37'),require(_0xcf55('0x38')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x39'),require(_0xcf55('0x3a')));_0x4b3453[_0xcf55('0xc')]('/api/trunks',require(_0xcf55('0x3b')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x3c'),require(_0xcf55('0x3d')));_0x4b3453['use'](_0xcf55('0x3e'),require(_0xcf55('0x3f')));_0x4b3453['use'](_0xcf55('0x40'),require(_0xcf55('0x41')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x42'),require(_0xcf55('0x43')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x44'),require(_0xcf55('0x45')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x46'),require('./api/mailInteraction'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x47'),require(_0xcf55('0x48')));_0x4b3453['use']('/api/mail/applications',require(_0xcf55('0x49')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x4a'),require('./api/mailQueueReport'));_0x4b3453[_0xcf55('0xc')]('/api/dashboards',require('./api/dashboard'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x4b'),require('./api/dashboardItem'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x4c'),require('./api/faxAccount'));_0x4b3453['use'](_0xcf55('0x4d'),require(_0xcf55('0x4e')));_0x4b3453['use'](_0xcf55('0x4f'),require(_0xcf55('0x50')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x51'),require(_0xcf55('0x52')));_0x4b3453['use'](_0xcf55('0x53'),require('./api/faxQueue'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x54'),require(_0xcf55('0x55')));_0x4b3453[_0xcf55('0xc')]('/api/sms/accounts',require('./api/smsAccount'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x56'),require(_0xcf55('0x57')));_0x4b3453[_0xcf55('0xc')]('/api/sms/interactions',require(_0xcf55('0x58')));_0x4b3453['use']('/api/sms/messages',require(_0xcf55('0x59')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x5a'),require(_0xcf55('0x5b')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x5c'),require(_0xcf55('0x5d')));_0x4b3453['use']('/api/openchannel/applications',require(_0xcf55('0x5e')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x5f'),require(_0xcf55('0x60')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x61'),require('./api/openchannelMessage'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x62'),require(_0xcf55('0x63')));_0x4b3453['use'](_0xcf55('0x64'),require(_0xcf55('0x65')));_0x4b3453['use']('/api/openchannel/reports/queue',require(_0xcf55('0x66')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x67'),require(_0xcf55('0x68')));_0x4b3453[_0xcf55('0xc')]('/api/chat/interactions',require(_0xcf55('0x69')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x6a'),require(_0xcf55('0x6b')));_0x4b3453[_0xcf55('0xc')]('/api/chat/offline_messages',require(_0xcf55('0x6c')));_0x4b3453['use']('/api/chat/queues',require(_0xcf55('0x6d')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x6e'),require(_0xcf55('0x6f')));_0x4b3453[_0xcf55('0xc')]('/api/chat/proactive_actions',require(_0xcf55('0x70')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x71'),require(_0xcf55('0x72')));_0x4b3453['use'](_0xcf55('0x73'),require(_0xcf55('0x74')));_0x4b3453['use']('/api/cm/hopper',require('./api/cmHopper'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x75'),require(_0xcf55('0x76')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x77'),require(_0xcf55('0x78')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x79'),require(_0xcf55('0x7a')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x7b'),require(_0xcf55('0x7c')));_0x4b3453[_0xcf55('0xc')]('/api/actions',require(_0xcf55('0x7d')));_0x4b3453['use'](_0xcf55('0x7e'),require(_0xcf55('0x7f')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x80'),require('./api/cannedAnswer'));_0x4b3453[_0xcf55('0xc')]('/api/dispositions',require(_0xcf55('0x81')));_0x4b3453['use'](_0xcf55('0x82'),require(_0xcf55('0x83')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x84'),require(_0xcf55('0x85')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x86'),require(_0xcf55('0x87')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x88'),require(_0xcf55('0x89')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x8a'),require('./api/voiceQueuesLog'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x8b'),require(_0xcf55('0x8c')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x8d'),require(_0xcf55('0x8e')));_0x4b3453['use'](_0xcf55('0x8f'),require('./api/tag'));_0x4b3453['use'](_0xcf55('0x90'),require(_0xcf55('0x91')));_0x4b3453[_0xcf55('0xc')]('/api/triggers',require(_0xcf55('0x92')));_0x4b3453['use']('/api/variables',require('./api/variable'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x93'),require(_0xcf55('0x94')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x95'),require('./api/integrationReport'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x96'),require('./api/analyticCustomReport'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x97'),require('./api/analyticDefaultReport'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x98'),require('./api/analyticExtractedReport'));_0x4b3453[_0xcf55('0xc')]('/api/analytics/metrics',require(_0xcf55('0x99')));_0x4b3453[_0xcf55('0xc')]('/api/analytics/field_reports',require(_0xcf55('0x9a')));_0x4b3453['use'](_0xcf55('0x9b'),require(_0xcf55('0x9c')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x9d'),require(_0xcf55('0x9e')));_0x4b3453[_0xcf55('0xc')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x9f'),require(_0xcf55('0xa0')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xa1'),require(_0xcf55('0xa2')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xa3'),require('./api/intSugarcrmConfiguration'));_0x4b3453[_0xcf55('0xc')]('/api/integrations/sugarcrm/fields',require(_0xcf55('0xa4')));_0x4b3453[_0xcf55('0xc')]('/api/integrations/desk/accounts',require(_0xcf55('0xa5')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xa6'),require('./api/intDeskConfiguration'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xa7'),require(_0xcf55('0xa8')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xa9'),require(_0xcf55('0xaa')));_0x4b3453['use']('/api/integrations/zoho/configurations',require(_0xcf55('0xab')));_0x4b3453[_0xcf55('0xc')]('/api/integrations/zoho/fields',require(_0xcf55('0xac')));_0x4b3453['use']('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xad'),require(_0xcf55('0xae')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xaf'),require(_0xcf55('0xb0')));_0x4b3453['use'](_0xcf55('0xb1'),require(_0xcf55('0xb2')));_0x4b3453['use']('/api/integrations/freshdesk/configurations',require(_0xcf55('0xb3')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xb4'),require(_0xcf55('0xb5')));_0x4b3453[_0xcf55('0xc')]('/api/integrations/vtiger/accounts',require(_0xcf55('0xb6')));_0x4b3453[_0xcf55('0xc')]('/api/integrations/vtiger/configurations',require(_0xcf55('0xb7')));_0x4b3453['use'](_0xcf55('0xb8'),require(_0xcf55('0xb9')));_0x4b3453[_0xcf55('0xc')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xba'),require('./api/intServicenowConfiguration'));_0x4b3453['use'](_0xcf55('0xbb'),require(_0xcf55('0xbc')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xbd'),require(_0xcf55('0xbe')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xbf'),require(_0xcf55('0xc0')));_0x4b3453['use']('/api/integrations/dynamics365/fields',require(_0xcf55('0xc1')));_0x4b3453[_0xcf55('0xc')]('/api/integrations/freshsales/accounts',require(_0xcf55('0xc2')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xc3'),require(_0xcf55('0xc4')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xc5'),require(_0xcf55('0xc6')));_0x4b3453['use'](_0xcf55('0xc7'),require('./api/network'));_0x4b3453['use'](_0xcf55('0xc8'),require(_0xcf55('0xc9')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xca'),require(_0xcf55('0xcb')));_0x4b3453['use'](_0xcf55('0xcc'),require(_0xcf55('0xcd')));_0x4b3453['use'](_0xcf55('0xce'),require(_0xcf55('0xcf')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xd0'),require(_0xcf55('0xd1')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xd2'),require('./api/smsQueueReport'));_0x4b3453[_0xcf55('0xc')]('/api/square/reports',require(_0xcf55('0xd3')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xd4'),require(_0xcf55('0xd5')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xd6'),require(_0xcf55('0xd7')));_0x4b3453['use']('/api/settings',require(_0xcf55('0xd8')));_0x4b3453['use'](_0xcf55('0xd9'),require(_0xcf55('0xda')));_0x4b3453[_0xcf55('0xc')]('/api/square/projects',require(_0xcf55('0xdb')));_0x4b3453['use']('/api/square/recordings',require(_0xcf55('0xdc')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xdd'),require(_0xcf55('0xde')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xdf'),require(_0xcf55('0xe0')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xe1'),require(_0xcf55('0xe2')));_0x4b3453['use'](_0xcf55('0xe3'),require(_0xcf55('0xe4')));_0x4b3453['use'](_0xcf55('0xe5'),require('./api/migration'));_0x4b3453['use'](_0xcf55('0xe6'),require(_0xcf55('0xe7')));_0x4b3453[_0xcf55('0xc')]('/api/plugins',require(_0xcf55('0xe8')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xe9'),require(_0xcf55('0xea')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xeb'),require(_0xcf55('0xec')));_0x4b3453[_0xcf55('0xc')]('/api/fax/reports/transfer',require(_0xcf55('0xed')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xee'),require(_0xcf55('0xef')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xf0'),require(_0xcf55('0xf1')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xf2'),require('./api/cmList'));_0x4b3453['use']('/api/voice/prefixes',require(_0xcf55('0xf3')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xf4'),require(_0xcf55('0xf5')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xf6'),require(_0xcf55('0xf7')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xf8'),require('./api/userProfileResource'));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xf9'),require(_0xcf55('0xfa')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xfb'),require(_0xcf55('0xfc')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xfd'),require(_0xcf55('0xfe')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0xff'),require(_0xcf55('0x100')));_0x4b3453['use'](_0xcf55('0x101'),require(_0xcf55('0x102')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x103'),require(_0xcf55('0x104')));_0x4b3453[_0xcf55('0xc')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x4b3453[_0xcf55('0xc')]('/api/whatsapp/queues',require(_0xcf55('0x105')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x106'),require(_0xcf55('0x107')));_0x4b3453[_0xcf55('0xc')]('/api/realtime',require(_0xcf55('0x108')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x109'),require(_0xcf55('0x10a')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x10b'),require(_0xcf55('0x10c')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x10d'),require(_0xcf55('0x10e')));_0x4b3453['use'](_0xcf55('0x10f'),require(_0xcf55('0x110')));_0x4b3453['use'](_0xcf55('0x111'),require('./api/rpc'));_0x4b3453['use']('/api/version',require(_0xcf55('0x112')));_0x4b3453[_0xcf55('0xc')]('/api/system',require(_0xcf55('0x113')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x114'),require('./api/pm2'));_0x4b3453['use']('/api/webbar',require('./api/webbar'));_0x4b3453['use'](_0xcf55('0x115'),express[_0xcf55('0x116')](path[_0xcf55('0x117')](config['root'],_0xcf55('0x115'))));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x118'),express['static'](path[_0xcf55('0x117')](config[_0xcf55('0x119')],_0xcf55('0x118'))));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x11a'),express[_0xcf55('0x116')](path['join'](config[_0xcf55('0x119')],_0xcf55('0x11a'))));_0x4b3453['use']('/snippet',express['static'](path['join'](config[_0xcf55('0x119')],_0xcf55('0x11b'),'3.0.0')));_0x4b3453[_0xcf55('0xc')](_0xcf55('0x11c'),express[_0xcf55('0x116')](path[_0xcf55('0x117')](config['root'],_0xcf55('0x11d'))));_0x4b3453[_0xcf55('0x11e')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x4b3453[_0xcf55('0x11e')]('/*')[_0xcf55('0x11f')](function(_0x5de4cb,_0x9c665){_0x9c665[_0xcf55('0x120')](path['resolve'](_0x4b3453['get'](_0xcf55('0x121'))+_0xcf55('0x122')));});};var sensitiveFields=['username',_0xcf55('0x123'),_0xcf55('0x124'),_0xcf55('0x125'),_0xcf55('0x126'),_0xcf55('0x127'),_0xcf55('0x128'),'phone',_0xcf55('0x129'),_0xcf55('0x12a'),_0xcf55('0x12b'),_0xcf55('0x12c'),'clientSecret',_0xcf55('0x12d'),_0xcf55('0x12e'),_0xcf55('0x12f'),_0xcf55('0x130'),'token',_0xcf55('0x131'),'accessToken',_0xcf55('0x132'),'authToken',_0xcf55('0x133'),'consumerSecret',_0xcf55('0x134'),'calleridname','calleridnum',_0xcf55('0x135'),_0xcf55('0x136'),_0xcf55('0x137'),_0xcf55('0x138'),_0xcf55('0x139'),_0xcf55('0x13a'),_0xcf55('0x13b'),_0xcf55('0x1a'),'pass',_0xcf55('0x13c'),'localstationid',_0xcf55('0x13d'),_0xcf55('0x13e'),_0xcf55('0x13f'),'oldPassword'];function maskSensitiveData(_0x13127c){var _0x6fb37c=/(?!^)[\s\S](?!$)/g;if(!_[_0xcf55('0x140')](_0x13127c))return;for(var _0x2bf4bb in _0x13127c){if(_[_0xcf55('0x141')](_0x13127c[_0x2bf4bb])){for(var _0x5861cb=0x0;_0x5861cb<_0x13127c[_0x2bf4bb][_0xcf55('0x142')];_0x5861cb++){maskSensitiveData(_0x13127c[_0x2bf4bb][_0x5861cb]);}}else if(_[_0xcf55('0x140')](_0x13127c[_0x2bf4bb])){maskSensitiveData(_0x13127c[_0x2bf4bb]);}else if(_[_0xcf55('0x143')](_0x13127c[_0x2bf4bb])){_0x13127c[_0x2bf4bb]=_0x13127c[_0x2bf4bb][_0xcf55('0x144')](/{{{/g,_0xcf55('0x145'))[_0xcf55('0x144')](/}}}/g,_0xcf55('0x146'))['replace'](/{{/g,'@{')[_0xcf55('0x144')](/}}/g,'}@');if(_[_0xcf55('0x147')](sensitiveFields,_0x2bf4bb)){_0x13127c[_0x2bf4bb]=_0x13127c[_0x2bf4bb][_0xcf55('0x144')](_0x6fb37c,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 85fc929..0374e04 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6077=['../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc'];(function(_0xc26f85,_0x27ef4b){var _0x5def67=function(_0x3c981e){while(--_0x3c981e){_0xc26f85['push'](_0xc26f85['shift']());}};_0x5def67(++_0x27ef4b);}(_0x6077,0xbc));var _0x7607=function(_0x57bb89,_0x2e6ba4){_0x57bb89=_0x57bb89-0x0;var _0x1dfe15=_0x6077[_0x57bb89];return _0x1dfe15;};'use strict';var jayson=require(_0x7607('0x0'));var BPromise=require(_0x7607('0x1'));var _=require(_0x7607('0x2'));var config=require(_0x7607('0x3'));exports[_0x7607('0x4')]=function(){return new BPromise(function(_0x5ee539,_0x33adda){var _0x34b749={};_0x34b749=_['merge'](_0x34b749,require(_0x7607('0x5')));_0x34b749=_['merge'](_0x34b749,require('../api/voiceExtension/voiceExtension.rpc'));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x7')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require('../api/voiceRecording/voiceRecording.rpc'));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x8')));_0x34b749=_['merge'](_0x34b749,require(_0x7607('0x9')));_0x34b749=_['merge'](_0x34b749,require(_0x7607('0xa')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0xb')));_0x34b749=_['merge'](_0x34b749,require(_0x7607('0xc')));_0x34b749=_['merge'](_0x34b749,require('../api/trunk/trunk.rpc'));_0x34b749=_['merge'](_0x34b749,require(_0x7607('0xd')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0xe')));_0x34b749=_['merge'](_0x34b749,require('../api/mailServerIn/mailServerIn.rpc'));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0xf')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x10')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require('../api/mailInteraction/mailInteraction.rpc'));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x11')));_0x34b749=_['merge'](_0x34b749,require(_0x7607('0x12')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x34b749=_['merge'](_0x34b749,require('../api/faxAccount/faxAccount.rpc'));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x13')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x14')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require('../api/faxMessage/faxMessage.rpc'));_0x34b749=_['merge'](_0x34b749,require(_0x7607('0x15')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x16')));_0x34b749=_['merge'](_0x34b749,require(_0x7607('0x17')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x18')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x19')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x1a')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x1b')));_0x34b749=_['merge'](_0x34b749,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x1c')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x1d')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x1e')));_0x34b749=_['merge'](_0x34b749,require(_0x7607('0x1f')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x20')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require('../api/chatQueue/chatQueue.rpc'));_0x34b749=_['merge'](_0x34b749,require(_0x7607('0x21')));_0x34b749=_['merge'](_0x34b749,require(_0x7607('0x22')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x23')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x24')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x25')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x26')));_0x34b749=_['merge'](_0x34b749,require(_0x7607('0x27')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x28')));_0x34b749=_['merge'](_0x34b749,require(_0x7607('0x29')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x2a')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require('../api/trigger/trigger.rpc'));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x2b')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x2c')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x2d')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x2e')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x2f')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x34b749=_['merge'](_0x34b749,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x30')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x31')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x32')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x33')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x34')));_0x34b749=_['merge'](_0x34b749,require('../api/squareOdbc/squareOdbc.rpc'));_0x34b749=_['merge'](_0x34b749,require(_0x7607('0x35')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x36')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x37')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x38')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x39')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require('../api/plugin/plugin.rpc'));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x3a')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x3b')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x3c')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x3d')));_0x34b749=_[_0x7607('0x6')](_0x34b749,require(_0x7607('0x3e')));var _0x3c0c9b=jayson[_0x7607('0x3f')](_0x34b749)[_0x7607('0x40')]();var _0x52f02c=config['rpc'][_0x7607('0x41')]||config[_0x7607('0x41')]+0x1;var _0x266ca4=config['rpc']['ip']||'localhost';_0x3c0c9b['on'](_0x7607('0x42'),function(_0x13360b){return _0x33adda(_0x13360b);});_0x3c0c9b[_0x7607('0x4')](_0x52f02c,_0x266ca4,function(){console[_0x7607('0x43')](_0x7607('0x44'),_0x266ca4,_0x52f02c);require('../config/triggers')['default']();return _0x5ee539(_0x7607('0x45')+_0x266ca4+':'+_0x52f02c);});});}; \ No newline at end of file +var _0x26db=['../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.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/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/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/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.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/intDeskAccount/intDeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc'];(function(_0x48d229,_0x33d990){var _0x73cdd0=function(_0x38d242){while(--_0x38d242){_0x48d229['push'](_0x48d229['shift']());}};_0x73cdd0(++_0x33d990);}(_0x26db,0x187));var _0xb26d=function(_0x5dac35,_0x4a9a3a){_0x5dac35=_0x5dac35-0x0;var _0x58073e=_0x26db[_0x5dac35];return _0x58073e;};'use strict';var jayson=require(_0xb26d('0x0'));var BPromise=require(_0xb26d('0x1'));var _=require(_0xb26d('0x2'));var config=require('../config/environment');exports[_0xb26d('0x3')]=function(){return new BPromise(function(_0x56841e,_0x323f90){var _0xabe905={};_0xabe905=_[_0xb26d('0x4')](_0xabe905,require('../api/user/user.rpc'));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x5')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require('../api/voiceQueue/voiceQueue.rpc'));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x6')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require('../api/voiceCallReport/voiceCallReport.rpc'));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x7')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require('../api/memberReport/memberReport.rpc'));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x8')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x9')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0xa')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0xb')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0xc')));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0xd')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0xe')));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0xf')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x10')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require('../api/mailQueueReport/mailQueueReport.rpc'));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x11')));_0xabe905=_['merge'](_0xabe905,require('../api/faxApplication/faxApplication.rpc'));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x12')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x13')));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x14')));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x15')));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x16')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x17')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x18')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x19')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x1a')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x1b')));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x1c')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x1d')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x1e')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x1f')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x20')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x21')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x22')));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x23')));_0xabe905=_['merge'](_0xabe905,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x24')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x25')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x26')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x27')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x28')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x29')));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x2a')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require('../api/variable/variable.rpc'));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x2b')));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x2c')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x2d')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require('../api/intZohoAccount/intZohoAccount.rpc'));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x2e')));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x2f')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x30')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x31')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x32')));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x33')));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x34')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x35')));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x36')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x37')));_0xabe905=_['merge'](_0xabe905,require(_0xb26d('0x38')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x39')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require('../api/squareMessage/squareMessage.rpc'));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x3a')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x3b')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x3c')));_0xabe905=_['merge'](_0xabe905,require('../api/whatsappAccount/whatsappAccount.rpc'));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x3d')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x3e')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x3f')));_0xabe905=_[_0xb26d('0x4')](_0xabe905,require(_0xb26d('0x40')));var _0x4241b1=jayson[_0xb26d('0x41')](_0xabe905)[_0xb26d('0x42')]();var _0x1090e9=config[_0xb26d('0x43')][_0xb26d('0x44')]||config[_0xb26d('0x44')]+0x1;var _0x24cbbb=config[_0xb26d('0x43')]['ip']||'localhost';_0x4241b1['on'](_0xb26d('0x45'),function(_0x32a725){return _0x323f90(_0x32a725);});_0x4241b1[_0xb26d('0x3')](_0x1090e9,_0x24cbbb,function(){console[_0xb26d('0x46')](_0xb26d('0x47'),_0x24cbbb,_0x1090e9);require(_0xb26d('0x48'))[_0xb26d('0x49')]();return _0x56841e(_0xb26d('0x4a')+_0x24cbbb+':'+_0x1090e9);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index 4980a31..6a7a861 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb62e=['map','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray'];(function(_0x10bcb7,_0x518c99){var _0x3c1b3b=function(_0x2d49d9){while(--_0x2d49d9){_0x10bcb7['push'](_0x10bcb7['shift']());}};_0x3c1b3b(++_0x518c99);}(_0xb62e,0x1de));var _0xeb62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb62e[_0x3dd15e];return _0x231fd0;};var _=require(_0xeb62('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x46335b){return _0x46335b==='{{'?_0xeb62('0x1'):_0xeb62('0x2');}function safeTemplate(_0x57a5ba){var _0x3dfdef=_0x57a5ba;if(typeof _0x57a5ba===_0xeb62('0x3')){_0x3dfdef=_0x57a5ba[_0xeb62('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xeb62('0x5')](_0x57a5ba)){_0x3dfdef=_0x57a5ba[_0xeb62('0x6')](function(_0x1ebdbb){return safeTemplate(_0x1ebdbb);});}else if(_['isPlainObject'](_0x57a5ba)){_0x3dfdef=Object[_0xeb62('0x7')](_0x57a5ba)[_0xeb62('0x8')](function(_0x31f5ea,_0x5e0dc4){_0x31f5ea[_0x5e0dc4]=safeTemplate(_0x57a5ba[_0x5e0dc4]);return _0x31f5ea;},{});}return _0x3dfdef;}module[_0xeb62('0x9')][_0xeb62('0xa')]=safeTemplate; \ No newline at end of file +var _0x8952=['exports','safeTemplate','{\x20{\x20','\x20}\x20}','replace','isArray','map','isPlainObject','keys','reduce'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0x8952,0x17e));var _0x2895=function(_0x104e66,_0x1e934a){_0x104e66=_0x104e66-0x0;var _0x322156=_0x8952[_0x104e66];return _0x322156;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2a7389){return _0x2a7389==='{{'?_0x2895('0x0'):_0x2895('0x1');}function safeTemplate(_0x2d485c){var _0x2454c5=_0x2d485c;if(typeof _0x2d485c==='string'){_0x2454c5=_0x2d485c[_0x2895('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x2895('0x3')](_0x2d485c)){_0x2454c5=_0x2d485c[_0x2895('0x4')](function(_0x5b28c6){return safeTemplate(_0x5b28c6);});}else if(_[_0x2895('0x5')](_0x2d485c)){_0x2454c5=Object[_0x2895('0x6')](_0x2d485c)[_0x2895('0x7')](function(_0x4ea619,_0x526c32){_0x4ea619[_0x526c32]=safeTemplate(_0x2d485c[_0x526c32]);return _0x4ea619;},{});}return _0x2454c5;}module[_0x2895('0x8')][_0x2895('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 8bdceea..71f7fb5 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 _0x282a=['continueAt','noop','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','agi','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','lodash','events','EventEmitter','./reply','./error','setEncoding','setTimeout','utf8','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s'];(function(_0x5ad182,_0x5e3ba9){var _0x585044=function(_0x25f7da){while(--_0x25f7da){_0x5ad182['push'](_0x5ad182['shift']());}};_0x585044(++_0x5e3ba9);}(_0x282a,0xa2));var _0xa282=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x282a[_0x47aa64];return _0x549c7a;};'use strict';var util=require('util');var _=require(_0xa282('0x0'));var EventEmitter=require(_0xa282('0x1'))[_0xa282('0x2')];var AGIReply=require(_0xa282('0x3'));var AGIError=require(_0xa282('0x4'));function AGIChannel(_0x4f7a2b){var _0x3a51f8=this,_0x3344f0=new AGIReply(),_0x5af988=![],_0xde1168={};EventEmitter['call'](_0x3a51f8);_0x4f7a2b[_0xa282('0x5')]('utf8');_0x4f7a2b[_0xa282('0x6')](0x8*0x3c*0x3c*0x3e8);_0x3344f0[_0xa282('0x5')](_0xa282('0x7'));_0x3344f0['on']('headers',function(_0x4ff77f){for(var _0x515324 in _0x4ff77f){_0x3a51f8[_0x515324]=_0x4ff77f[_0x515324];}_0x3a51f8[_0xa282('0x8')](_0xa282('0x9'));});_0x3344f0['on'](_0xa282('0xa'),function(_0x8bb6a0){if(_0x8bb6a0[_0xa282('0xb')]()==_0xa282('0xc')){_0x3a51f8[_0xa282('0x8')](_0xa282('0xc'));return;}if(_0x8bb6a0[_0xa282('0xd')](0x0,0xb)==_0xa282('0xe')){_0x5af988=!![];}if(_0x5af988){_0xde1168['rx']+=_0x8bb6a0+'\x0a';if(_0x8bb6a0[_0xa282('0xf')](_0xa282('0x10'))!=-0x1){_0x5af988=![];}}else{_0xde1168['rx']=_0x8bb6a0;}if(_0x5af988){return;}if(typeof _0xde1168['cb']==_0xa282('0x11')){var _0x3ebaf9=_0xde1168['rx'][_0xa282('0xd')](0x0,0x3),_0x17891c=null,_0x37eb53=null;_0x3ebaf9=parseInt(_0x3ebaf9);if(isNaN(_0x3ebaf9)){_0xde1168['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xa282('0x12')});return;}if(_0x3ebaf9!=0xc8){_0xde1168['cb'](null,{'code':_0x3ebaf9,'result':-0x1,'extra':'KO'});return;}_0x17891c=_0xde1168['rx']['substring'](0x4)[_0xa282('0x13')](_0xa282('0x14'),'');if(_0x17891c[_0xa282('0x15')]('\x20')!=-0x1){_0x17891c=_0x17891c[_0xa282('0x16')](0x0,_0x17891c[_0xa282('0x15')]('\x20'));}if(_['startsWith'](_0x17891c,'-1')){_0x17891c=parseInt(_0x17891c);}_0x37eb53=_0xde1168['rx']['split']('\x20');if(_0x37eb53[_0xa282('0x17')]==0x3){_0x37eb53=_0x37eb53[0x2][_0xa282('0xd')](0x1,_0x37eb53[0x2][_0xa282('0x17')]-0x1);}else if(_0x37eb53[_0xa282('0x17')]>0x3){var _0x1b4c2d=/\((.+)\)/;var _0x4b1dcb=_0xde1168['rx']['match'](_0x1b4c2d);if(_0x4b1dcb){_0x37eb53=_0x4b1dcb[0x1];}else{_0x37eb53=null;}}else{_0x37eb53=null;}_0xde1168['cb'](null,{'code':_0x3ebaf9,'result':_0x17891c,'extra':_0x37eb53});}});_0x4f7a2b['on'](_0xa282('0x18'),function(_0x19aef2){_0x3a51f8[_0xa282('0x8')](_0xa282('0x18'),new AGIError(_0xa282('0x19'),_0x19aef2[_0xa282('0x1a')]));});_0x4f7a2b['on'](_0xa282('0x1b'),function(){_0x3a51f8[_0xa282('0x8')](_0xa282('0x1b'),new AGIError(_0xa282('0x1c')));});_0x4f7a2b['on']('timeout',function(){_0x3a51f8[_0xa282('0x8')](_0xa282('0x1d'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x4f7a2b[_0xa282('0x1e')]();});_0x4f7a2b[_0xa282('0x1f')](_0x3344f0);this[_0xa282('0x20')]=function(_0x14fe4b,_0x1d63b5){var _0x14fe4b=_0x14fe4b||'',_0x1d63b5=typeof _0x1d63b5==_0xa282('0x11')?_0x1d63b5:new Function();_0xde1168={'tx':_0x14fe4b,'rx':'','cb':_0x1d63b5};_0x4f7a2b[_0xa282('0x21')](_0x14fe4b+'\x0a');},this[_0xa282('0x1b')]=function(){_0x4f7a2b[_0xa282('0x1e')]();};}util[_0xa282('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xa282('0x23')][_0xa282('0x24')]=function(_0x5300fc){return this['command'][_0xa282('0x25')](this,_0x5300fc);};AGIChannel[_0xa282('0x23')][_0xa282('0x26')]=function(){return this[_0xa282('0x24')](_0xa282('0x27'));};AGIChannel[_0xa282('0x23')][_0xa282('0x28')]=function(_0x472e60,_0x5175e4,_0x298901){_0x472e60=_0x472e60===undefined?'beep':_0x472e60;_0x5175e4=_0x5175e4===undefined?'5':_0x5175e4;_0x298901=_0x298901===undefined?'1':_0x298901;return this[_0xa282('0x24')](util[_0xa282('0x29')](_0xa282('0x2a'),_0x472e60,_0x5175e4*0x3e8,_0x298901));};AGIChannel['prototype']['noop']=function(_0x5dfa4e){_0x5dfa4e=_0x5dfa4e||_0xa282('0x2b');return this['sendRequest'](util[_0xa282('0x29')](_0xa282('0x2c'),_0x5dfa4e));};AGIChannel['prototype'][_0xa282('0x2d')]=function(_0x3e266d,_0x3bc695){if(_[_0xa282('0x2e')](_0x3bc695)){return this[_0xa282('0x24')](util[_0xa282('0x29')](_0xa282('0x2f'),_0x3e266d,_0x3bc695['join'](',')));}return this[_0xa282('0x24')](util[_0xa282('0x29')](_0xa282('0x2f'),_0x3e266d,_0x3bc695));};AGIChannel[_0xa282('0x23')][_0xa282('0x30')]=function(_0x4f36d7){return this['sendRequest'](util['format']('SET\x20CONTEXT\x20%s',_0x4f36d7));};AGIChannel[_0xa282('0x23')][_0xa282('0x31')]=function(_0x5420bd){return this[_0xa282('0x24')](util[_0xa282('0x29')](_0xa282('0x32'),_0x5420bd));};AGIChannel[_0xa282('0x23')]['setPriority']=function(_0x119a33){return this[_0xa282('0x24')](util[_0xa282('0x29')](_0xa282('0x33'),_0x119a33));};AGIChannel['prototype'][_0xa282('0xc')]=function(){return this['sendRequest'](_0xa282('0x34'));};AGIChannel[_0xa282('0x23')][_0xa282('0x35')]=function(_0x2dbc37,_0x42b043){var _0x447962=_[_0xa282('0x36')](_0x42b043)||_[_0xa282('0x37')](_0x42b043)?_0x42b043[_0xa282('0x38')]():_0x42b043;return this[_0xa282('0x24')](util[_0xa282('0x29')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x2dbc37,_0x447962?_0x447962[_0xa282('0x38')]()[_0xa282('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xa282('0x23')][_0xa282('0x39')]=function(_0x156362,_0x4e916e){return this[_0xa282('0x24')](util[_0xa282('0x29')](_0xa282('0x3a'),_0x156362,_0x4e916e));};AGIChannel[_0xa282('0x23')][_0xa282('0x3b')]=function(_0x3900ea,_0x102564){return this[_0xa282('0x24')](util['format'](_0xa282('0x3c'),_0x3900ea,_0x102564));};AGIChannel[_0xa282('0x23')][_0xa282('0x3d')]=function(_0x2759d2,_0x5f3010){return this[_0xa282('0x24')](util[_0xa282('0x29')](_0xa282('0x3e'),_0x2759d2,_0x5f3010));};AGIChannel['prototype'][_0xa282('0x3f')]=function(_0x149566,_0x677cdf,_0x25983b){_0x677cdf=_0x677cdf||this['extension'];_0x25983b=_0x25983b||0x1;this['setContext'](_0x149566);this[_0xa282('0x31')](_0x677cdf);this['setPriority'](_0x25983b);return this[_0xa282('0x40')](util['format'](_0xa282('0x41'),_0x149566,_0x677cdf,_0x25983b));};AGIChannel[_0xa282('0x23')]['getVariable']=function(_0x1baa8a){return this[_0xa282('0x24')](util[_0xa282('0x29')](_0xa282('0x42'),_0x1baa8a));};AGIChannel[_0xa282('0x23')][_0xa282('0x43')]=function(_0x1c1d0a,_0x4162b5,_0x41aea5,_0x3d5210,_0x4cb7c9,_0x2cd354){_0x4162b5=_0x4162b5||_0xa282('0x44');_0x41aea5=_0x41aea5||'';_0x3d5210=_0x3d5210===undefined?-0x1:_0x3d5210==='-1'?-0x1:_0x3d5210*0x3e8;_0x4cb7c9=_0x4cb7c9===undefined?'':'s='+_0x4cb7c9;_0x2cd354=_0x2cd354?_0xa282('0x45'):'';return this['sendRequest'](util[_0xa282('0x29')](_0xa282('0x46'),_0x1c1d0a,_0x4162b5,_0x41aea5,_0x3d5210,_0x2cd354,_0x4cb7c9));};AGIChannel['prototype']['streamFile']=function(_0x5eff49,_0x51cb84){_0x51cb84=_0x51cb84||'';return this[_0xa282('0x24')](util[_0xa282('0x29')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x5eff49,_0x51cb84));};AGIChannel[_0xa282('0x23')][_0xa282('0x47')]=function(_0x515391){return this[_0xa282('0x2d')]('AGI',_0x515391);};AGIChannel[_0xa282('0x23')]['wait']=function(_0x2f8a7d){return this[_0xa282('0x2d')](_0xa282('0x48'),_0x2f8a7d);};AGIChannel[_0xa282('0x23')]['error']=function(_0x1cd136,_0xfa4c04){this[_0xa282('0x40')](util[_0xa282('0x29')](_0xa282('0x49'),_0x1cd136['id'],_0x1cd136[_0xa282('0x4a')],_0xfa4c04));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0xb016=['extension','setExtension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','streamFile','agi','AGI','noop','util','lodash','./reply','call','setEncoding','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','no\x20code','replace','indexOf','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt'];(function(_0x1e69e5,_0x31c9d7){var _0x54927a=function(_0xa539ff){while(--_0xa539ff){_0x1e69e5['push'](_0x1e69e5['shift']());}};_0x54927a(++_0x31c9d7);}(_0xb016,0x159));var _0x6b01=function(_0x2c4598,_0x4dc58e){_0x2c4598=_0x2c4598-0x0;var _0x13c71c=_0xb016[_0x2c4598];return _0x13c71c;};'use strict';var util=require(_0x6b01('0x0'));var _=require(_0x6b01('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0x6b01('0x2'));var AGIError=require('./error');function AGIChannel(_0x160a7d){var _0x464e83=this,_0x161b59=new AGIReply(),_0x3b9de1=![],_0x5964ca={};EventEmitter[_0x6b01('0x3')](_0x464e83);_0x160a7d[_0x6b01('0x4')](_0x6b01('0x5'));_0x160a7d['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x161b59['setEncoding'](_0x6b01('0x5'));_0x161b59['on'](_0x6b01('0x6'),function(_0x526a7d){for(var _0x5f4636 in _0x526a7d){_0x464e83[_0x5f4636]=_0x526a7d[_0x5f4636];}_0x464e83[_0x6b01('0x7')](_0x6b01('0x8'));});_0x161b59['on'](_0x6b01('0x9'),function(_0x242394){if(_0x242394[_0x6b01('0xa')]()=='hangup'){_0x464e83['emit'](_0x6b01('0xb'));return;}if(_0x242394[_0x6b01('0xc')](0x0,0xb)==_0x6b01('0xd')){_0x3b9de1=!![];}if(_0x3b9de1){_0x5964ca['rx']+=_0x242394+'\x0a';if(_0x242394['search'](_0x6b01('0xe'))!=-0x1){_0x3b9de1=![];}}else{_0x5964ca['rx']=_0x242394;}if(_0x3b9de1){return;}if(typeof _0x5964ca['cb']=='function'){var _0x51f976=_0x5964ca['rx'][_0x6b01('0xc')](0x0,0x3),_0x26f2a0=null,_0x4fa826=null;_0x51f976=parseInt(_0x51f976);if(isNaN(_0x51f976)){_0x5964ca['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6b01('0xf')});return;}if(_0x51f976!=0xc8){_0x5964ca['cb'](null,{'code':_0x51f976,'result':-0x1,'extra':'KO'});return;}_0x26f2a0=_0x5964ca['rx']['substring'](0x4)[_0x6b01('0x10')]('result=','');if(_0x26f2a0['indexOf']('\x20')!=-0x1){_0x26f2a0=_0x26f2a0['substr'](0x0,_0x26f2a0[_0x6b01('0x11')]('\x20'));}if(_['startsWith'](_0x26f2a0,'-1')){_0x26f2a0=parseInt(_0x26f2a0);}_0x4fa826=_0x5964ca['rx']['split']('\x20');if(_0x4fa826[_0x6b01('0x12')]==0x3){_0x4fa826=_0x4fa826[0x2][_0x6b01('0xc')](0x1,_0x4fa826[0x2][_0x6b01('0x12')]-0x1);}else if(_0x4fa826[_0x6b01('0x12')]>0x3){var _0x3d7045=/\((.+)\)/;var _0x2d077f=_0x5964ca['rx'][_0x6b01('0x13')](_0x3d7045);if(_0x2d077f){_0x4fa826=_0x2d077f[0x1];}else{_0x4fa826=null;}}else{_0x4fa826=null;}_0x5964ca['cb'](null,{'code':_0x51f976,'result':_0x26f2a0,'extra':_0x4fa826});}});_0x160a7d['on'](_0x6b01('0x14'),function(_0x9c6571){_0x464e83[_0x6b01('0x7')](_0x6b01('0x14'),new AGIError('E_AGI_SOCKET_ERROR',_0x9c6571[_0x6b01('0x15')]));});_0x160a7d['on'](_0x6b01('0x16'),function(){_0x464e83[_0x6b01('0x7')](_0x6b01('0x16'),new AGIError(_0x6b01('0x17')));});_0x160a7d['on'](_0x6b01('0x18'),function(){_0x464e83[_0x6b01('0x7')](_0x6b01('0x18'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x160a7d[_0x6b01('0x19')]();});_0x160a7d[_0x6b01('0x1a')](_0x161b59);this[_0x6b01('0x1b')]=function(_0x2551b0,_0x1fced4){var _0x2551b0=_0x2551b0||'',_0x1fced4=typeof _0x1fced4=='function'?_0x1fced4:new Function();_0x5964ca={'tx':_0x2551b0,'rx':'','cb':_0x1fced4};_0x160a7d[_0x6b01('0x1c')](_0x2551b0+'\x0a');},this[_0x6b01('0x16')]=function(){_0x160a7d[_0x6b01('0x19')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x6b01('0x1d')][_0x6b01('0x1e')]=function(_0x304393){return this[_0x6b01('0x1b')][_0x6b01('0x1f')](this,_0x304393);};AGIChannel[_0x6b01('0x1d')][_0x6b01('0x20')]=function(){return this[_0x6b01('0x1e')](_0x6b01('0x21'));};AGIChannel[_0x6b01('0x1d')][_0x6b01('0x22')]=function(_0xa846d8,_0x154dfc,_0x55ca4b){_0xa846d8=_0xa846d8===undefined?_0x6b01('0x23'):_0xa846d8;_0x154dfc=_0x154dfc===undefined?'5':_0x154dfc;_0x55ca4b=_0x55ca4b===undefined?'1':_0x55ca4b;return this[_0x6b01('0x1e')](util[_0x6b01('0x24')](_0x6b01('0x25'),_0xa846d8,_0x154dfc*0x3e8,_0x55ca4b));};AGIChannel[_0x6b01('0x1d')]['noop']=function(_0x54f030){_0x54f030=_0x54f030||_0x6b01('0x26');return this[_0x6b01('0x1e')](util[_0x6b01('0x24')](_0x6b01('0x27'),_0x54f030));};AGIChannel[_0x6b01('0x1d')][_0x6b01('0x28')]=function(_0x542ca0,_0x39f193){if(_['isArray'](_0x39f193)){return this[_0x6b01('0x1e')](util['format'](_0x6b01('0x29'),_0x542ca0,_0x39f193[_0x6b01('0x2a')](',')));}return this[_0x6b01('0x1e')](util[_0x6b01('0x24')](_0x6b01('0x29'),_0x542ca0,_0x39f193));};AGIChannel['prototype'][_0x6b01('0x2b')]=function(_0x2b4a20){return this[_0x6b01('0x1e')](util['format']('SET\x20CONTEXT\x20%s',_0x2b4a20));};AGIChannel[_0x6b01('0x1d')]['setExtension']=function(_0x279850){return this[_0x6b01('0x1e')](util[_0x6b01('0x24')]('SET\x20EXTENSION\x20%s',_0x279850));};AGIChannel[_0x6b01('0x1d')][_0x6b01('0x2c')]=function(_0x186a6d){return this['sendRequest'](util[_0x6b01('0x24')](_0x6b01('0x2d'),_0x186a6d));};AGIChannel[_0x6b01('0x1d')][_0x6b01('0xb')]=function(){return this[_0x6b01('0x1e')]('HANGUP');};AGIChannel[_0x6b01('0x1d')][_0x6b01('0x2e')]=function(_0x1c9744,_0x5269c7){var _0xce4545=_[_0x6b01('0x2f')](_0x5269c7)||_[_0x6b01('0x30')](_0x5269c7)?_0x5269c7[_0x6b01('0x31')]():_0x5269c7;return this['sendRequest'](util[_0x6b01('0x24')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x1c9744,_0xce4545?_0xce4545[_0x6b01('0x31')]()[_0x6b01('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x6b01('0x1d')][_0x6b01('0x32')]=function(_0x167d08,_0x457c93){return this[_0x6b01('0x1e')](util['format'](_0x6b01('0x33'),_0x167d08,_0x457c93));};AGIChannel[_0x6b01('0x1d')][_0x6b01('0x34')]=function(_0x42ecc6,_0x1ca3aa){return this[_0x6b01('0x1e')](util[_0x6b01('0x24')](_0x6b01('0x35'),_0x42ecc6,_0x1ca3aa));};AGIChannel['prototype'][_0x6b01('0x36')]=function(_0x55907f,_0x336a67){return this[_0x6b01('0x1e')](util['format'](_0x6b01('0x37'),_0x55907f,_0x336a67));};AGIChannel[_0x6b01('0x1d')][_0x6b01('0x38')]=function(_0x45952a,_0x2d4125,_0x33a9ea){_0x2d4125=_0x2d4125||this[_0x6b01('0x39')];_0x33a9ea=_0x33a9ea||0x1;this[_0x6b01('0x2b')](_0x45952a);this[_0x6b01('0x3a')](_0x2d4125);this[_0x6b01('0x2c')](_0x33a9ea);return this['noop'](util[_0x6b01('0x24')](_0x6b01('0x3b'),_0x45952a,_0x2d4125,_0x33a9ea));};AGIChannel['prototype']['getVariable']=function(_0x32b9ec){return this[_0x6b01('0x1e')](util['format'](_0x6b01('0x3c'),_0x32b9ec));};AGIChannel[_0x6b01('0x1d')]['recordFile']=function(_0x95fd25,_0x5e6f28,_0x2ab117,_0x1c6eba,_0xf52992,_0x50b13d){_0x5e6f28=_0x5e6f28||_0x6b01('0x3d');_0x2ab117=_0x2ab117||'';_0x1c6eba=_0x1c6eba===undefined?-0x1:_0x1c6eba==='-1'?-0x1:_0x1c6eba*0x3e8;_0xf52992=_0xf52992===undefined?'':'s='+_0xf52992;_0x50b13d=_0x50b13d?_0x6b01('0x3e'):'';return this['sendRequest'](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x95fd25,_0x5e6f28,_0x2ab117,_0x1c6eba,_0x50b13d,_0xf52992));};AGIChannel[_0x6b01('0x1d')][_0x6b01('0x3f')]=function(_0x23d1b7,_0x2cb4de){_0x2cb4de=_0x2cb4de||'';return this[_0x6b01('0x1e')](util[_0x6b01('0x24')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x23d1b7,_0x2cb4de));};AGIChannel[_0x6b01('0x1d')][_0x6b01('0x40')]=function(_0x38cb74){return this[_0x6b01('0x28')](_0x6b01('0x41'),_0x38cb74);};AGIChannel[_0x6b01('0x1d')]['wait']=function(_0x1fd975){return this['exec']('WAIT',_0x1fd975);};AGIChannel[_0x6b01('0x1d')][_0x6b01('0x14')]=function(_0x50397b,_0x408bb0){this[_0x6b01('0x42')](util[_0x6b01('0x24')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x50397b['id'],_0x50397b['label'],_0x408bb0));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 1f22ac9..c4eae8a 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 _0xb39f=['Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','exports'];(function(_0x1a61a8,_0x2d263f){var _0x2387b6=function(_0xda5551){while(--_0xda5551){_0x1a61a8['push'](_0x1a61a8['shift']());}};_0x2387b6(++_0x2d263f);}(_0xb39f,0x1ee));var _0xfb39=function(_0x555bd1,_0x245f82){_0x555bd1=_0x555bd1-0x0;var _0x354d86=_0xb39f[_0x555bd1];return _0x354d86;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xfb39('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xfb39('0x1'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xfb39('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0xfb39('0x3'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xfb39('0x4'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xfb39('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xfb39('0x6'),'E_AGI_IVR_ENTRY':_0xfb39('0x7')};function AGIError(_0x25e97e){var _0x25e97e=_0x25e97e||null,_0x3f6662=_0x3f6662||[],_0x21cbb1=0x1,_0x2cc57c='';if(!error[_0x25e97e]){_0x25e97e='E_AGI_UNDEFINED';}_0x3f6662[_0xfb39('0x8')](error[_0x25e97e]);while(arguments[_0x21cbb1]){_0x3f6662['push'](arguments[_0x21cbb1]);_0x21cbb1++;}_0x2cc57c=util[_0xfb39('0x9')][_0xfb39('0xa')](util,_0x3f6662);this[_0xfb39('0xb')]=_0x2cc57c;this['name']=_0x25e97e;}module[_0xfb39('0xc')]=AGIError; \ No newline at end of file +var _0xb412=['Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xb412,0x183));var _0x2b41=function(_0x2eadbd,_0x390691){_0x2eadbd=_0x2eadbd-0x0;var _0x1bbede=_0xb412[_0x2eadbd];return _0x1bbede;};'use strict';var util=require(_0x2b41('0x0'));var error={'E_AGI_UNDEFINED':_0x2b41('0x1'),'E_AGI_ARGUMENT_PORT':_0x2b41('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x2b41('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x2b41('0x4'),'E_AGI_SOCKET_ERROR':_0x2b41('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x2b41('0x6'),'E_AGI_COMMAND_EMPTY':_0x2b41('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x2b41('0x8'),'E_AGI_IVR_ENTRY':_0x2b41('0x9')};function AGIError(_0x38f482){var _0x38f482=_0x38f482||null,_0x4bf457=_0x4bf457||[],_0x3be127=0x1,_0x369b51='';if(!error[_0x38f482]){_0x38f482=_0x2b41('0xa');}_0x4bf457[_0x2b41('0xb')](error[_0x38f482]);while(arguments[_0x3be127]){_0x4bf457[_0x2b41('0xb')](arguments[_0x3be127]);_0x3be127++;}_0x369b51=util['format'][_0x2b41('0xc')](util,_0x4bf457);this[_0x2b41('0xd')]=_0x369b51;this[_0x2b41('0xe')]=_0x38f482;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index b52e986..b4a6ff5 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 _0x1e58=['addEdge','edges','push','prototype','size','relations','getVertex','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split','agicommand','target','default','menu','invalid','traverseBFS','vswitch','default\x20on\x20switch\x20not\x20found','condition\x20not\x20found','exports','lodash','../../../config/logger','getdigits','getsecretdigits','vertices','numberOfEdges','addVertex'];(function(_0x33eee5,_0x315109){var _0xf96994=function(_0x418fcb){while(--_0x418fcb){_0x33eee5['push'](_0x33eee5['shift']());}};_0xf96994(++_0x315109);}(_0x1e58,0xe9));var _0x81e5=function(_0x53851f,_0x1de932){_0x53851f=_0x53851f-0x0;var _0x4aef59=_0x1e58[_0x53851f];return _0x4aef59;};'use strict';var _=require(_0x81e5('0x0'));var logger=require(_0x81e5('0x1'))('agi');var verticesWithRetry=['menu',_0x81e5('0x2'),_0x81e5('0x3')];var Graph=function(){this[_0x81e5('0x4')]={};this['edges']={};this[_0x81e5('0x5')]=0x0;};Graph['prototype'][_0x81e5('0x6')]=function(_0x1f6898){this[_0x81e5('0x4')][_0x1f6898['id']]=_0x1f6898;this['edges'][_0x1f6898['id']]=[];};Graph['prototype'][_0x81e5('0x7')]=function(_0x285561,_0x489906,_0x53d0da){this[_0x81e5('0x8')][_0x285561][_0x81e5('0x9')]({'target':_0x489906,'condition':_0x53d0da});this[_0x81e5('0x5')]+=0x1;};Graph[_0x81e5('0xa')][_0x81e5('0xb')]=function(){return _[_0x81e5('0xb')](this[_0x81e5('0x4')]);};Graph['prototype'][_0x81e5('0xc')]=function(){return this['numberOfEdges'];};Graph[_0x81e5('0xa')][_0x81e5('0xd')]=function(_0x277303){return this[_0x81e5('0x4')][_0x277303];};Graph[_0x81e5('0xa')]['traverseBFS']=function(_0x3dd03c,_0x42728f){if(!this[_0x81e5('0x4')][_0x3dd03c]){return logger[_0x81e5('0xe')](_0x81e5('0xf'));}var _0x1f8bca=_0x42728f(this[_0x81e5('0x4')][_0x3dd03c]);if(!_0x1f8bca){return logger[_0x81e5('0xe')]('stop\x20traverse');}if(this[_0x81e5('0x8')][_0x3dd03c][_0x81e5('0x10')]===0x0){return logger['info'](_0x81e5('0x11'));}for(var _0x4b8372=0x0,_0x562c53=[],_0x110c66=![];_0x4b8372\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','source','value','catch','createSquareReport','then','indexOf','agi_','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','evtHangup','hangup','production','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','clear','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','listening','connection','lodash','syncho','util','moment','../../config/environment','../../config/logger','../../config/license/util','./mailRpc','./vertices','agi','127.0.0.1','nextTick','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name'];(function(_0x38bc08,_0x39ab88){var _0x8110e4=function(_0x2216db){while(--_0x2216db){_0x38bc08['push'](_0x38bc08['shift']());}};_0x8110e4(++_0x39ab88);}(_0xe285,0xfa));var _0x5e28=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xe285[_0x5608a3];return _0x1ed50a;};'use strict';var parser=require('xml2json');var _=require(_0x5e28('0x0'));var syncho=require(_0x5e28('0x1'));var util=require(_0x5e28('0x2'));var moment=require(_0x5e28('0x3'));var config=require(_0x5e28('0x4'));var logger=require(_0x5e28('0x5'))('agi');var utilLicense=require(_0x5e28('0x6'));var rpc=require('./rpc');var mailRpc=require(_0x5e28('0x7'));var Graph=require('./graph');var Vertices=require(_0x5e28('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x5e28('0x9')]=_['defaults'](config[_0x5e28('0x9')],{'ip':_0x5e28('0xa'),'port':0x11dd});function connectionHandler(_0x29fe1b){process[_0x5e28('0xb')](function(){syncho(function(){try{setChannelVariables(_0x29fe1b);agiHandler(_0x29fe1b);}catch(_0x571af7){logger['error'](_0x571af7[_0x5e28('0xc')]);}});});}function listeningHandler(){console[_0x5e28('0xd')](_0x5e28('0xe'),config[_0x5e28('0x9')]['port']);logger[_0x5e28('0xf')](util[_0x5e28('0x10')](_0x5e28('0x11'),config['agi']['ip'],config['agi'][_0x5e28('0x12')]));}function errorHandler(_0x4f6aab){if(_0x4f6aab&&_0x4f6aab[_0x5e28('0x13')]&&_0x4f6aab[_0x5e28('0x14')]){logger[_0x5e28('0x15')](util['format']('[%s]\x20%s',_0x4f6aab['name'],_0x4f6aab[_0x5e28('0x14')]));}else{logger[_0x5e28('0x15')](util[_0x5e28('0x10')](_0x5e28('0x16'),_0x4f6aab[_0x5e28('0xc')]));}}function closeHandler(){logger[_0x5e28('0xf')](util[_0x5e28('0x10')](_0x5e28('0x17'),this[_0x5e28('0x18')],this['calleridname'],this['callerid'],this['dnid'],this[_0x5e28('0x19')]));try{createSquareReport(this);}catch(_0x375ba5){logger['error'](_0x375ba5[_0x5e28('0xc')]);}}function timeoutHandler(){logger[_0x5e28('0xf')](util[_0x5e28('0x10')](_0x5e28('0x1a'),this[_0x5e28('0x18')],this[_0x5e28('0x1b')],this[_0x5e28('0x1c')],this['dnid'],this[_0x5e28('0x19')]));}function hangupHandler(){logger[_0x5e28('0xf')](util['format'](_0x5e28('0x1d'),this[_0x5e28('0x18')],this[_0x5e28('0x1b')],this[_0x5e28('0x1c')],this['dnid'],this[_0x5e28('0x19')]));this['evtHangup']=!![];}function getRoot(_0x84c9a9){return parser[_0x5e28('0x1e')](_0x84c9a9,{'object':!![]})[_0x5e28('0x1f')][_0x5e28('0x20')];}function addVertex(_0x57df83,_0x3126f2,_0x242404){_0x3126f2['agicommand']=_0x242404;if(_0x3126f2[_0x5e28('0x21')](_0x5e28('0x22'))){_0x3126f2[_0x5e28('0x23')]=parseInt(_0x3126f2[_0x5e28('0x22')],0xa);}_0x57df83[_0x5e28('0x24')](_[_0x5e28('0x25')](_0x3126f2,_0x5e28('0x26')));}function initGraph(_0x3fad59,_0x35f13a){var _0x3fe0a0=new Graph();for(var _0x225e10 in _0x3fad59){if(_0x3fad59[_0x5e28('0x21')](_0x225e10)){if(_[_0x5e28('0x27')](_0x3fad59[_0x225e10])){for(var _0x6082c2=0x0;_0x6082c2<_0x3fad59[_0x225e10][_0x5e28('0x28')];_0x6082c2+=0x1){addVertex(_0x3fe0a0,_0x3fad59[_0x225e10][_0x6082c2],_0x225e10);}}else{addVertex(_0x3fe0a0,_0x3fad59[_0x225e10],_0x225e10);}}}for(var _0x3ea1fb=0x0;_0x3ea1fb<_0x35f13a['length'];_0x3ea1fb+=0x1){if(_0x35f13a[_0x3ea1fb]['source']&&_0x35f13a[_0x3ea1fb][_0x5e28('0x29')]){_0x3fe0a0['addEdge'](_0x35f13a[_0x3ea1fb][_0x5e28('0x2a')],_0x35f13a[_0x3ea1fb][_0x5e28('0x29')],_0x35f13a[_0x3ea1fb][_0x5e28('0x2b')]);}}return _0x3fe0a0;}function getSquareProject(_0x42b7be,_0x1470be){rpc['getSquareProject'](_0x42b7be)['then'](function(_0x43f2b0){_0x1470be(null,_0x43f2b0);})[_0x5e28('0x2c')](function(_0x1dce37){_0x1470be(null,_0x1dce37);});}function createSquareReport(_0x314f0e,_0x3b279c){rpc[_0x5e28('0x2d')](_0x314f0e)[_0x5e28('0x2e')](function(_0x469b2c){if(_0x3b279c){_0x3b279c(null,_0x469b2c);}})[_0x5e28('0x2c')](function(_0x3f5037){if(_0x3b279c){_0x3b279c(null,_0x3f5037);}});}function setChannelVariables(_0x2512ca){for(var _0x279b11 in _0x2512ca){if(_0x2512ca[_0x5e28('0x21')](_0x279b11)){if(_0x279b11[_0x5e28('0x2f')](_0x5e28('0x30'))===0x0){_0x2512ca[_0x279b11['substring'](0x4)]=_0x2512ca[_0x279b11];delete _0x2512ca[_0x279b11];}}}}function getLogFromObject(_0x227794){return util[_0x5e28('0x31')](_0x227794,{'showHidden':![],'depth':null});}function agiHandler(_0x106010){var _0x4916ac,_0x249508,_0x26f9b2,_0xbaa297,_0x52220f;logger[_0x5e28('0x32')](_0x5e28('0x33'),JSON[_0x5e28('0x34')](_0x106010,null,0x2));logger[_0x5e28('0xf')](util['format'](_0x5e28('0x35'),_0x106010[_0x5e28('0x18')],_0x106010['calleridname'],_0x106010[_0x5e28('0x1c')],_0x106010[_0x5e28('0x36')],_0x106010[_0x5e28('0x19')]));_0x106010['on']('error',errorHandler);_0x106010['on']('close',closeHandler);_0x106010['on']('timeout',timeoutHandler);_0x106010[_0x5e28('0x37')]=![];_0x106010['on'](_0x5e28('0x38'),hangupHandler);var _0x34ea4e=getSquareProject['sync'](null,_0x106010[_0x5e28('0x18')]);if(_0x34ea4e){if(_0x34ea4e[_0x5e28('0x39')]){_0x4916ac=getRoot(_0x34ea4e[_0x5e28('0x39')]);if(_0x4916ac&&_0x4916ac['start']){logger[_0x5e28('0x32')](_0x5e28('0x20'),JSON['stringify'](_0x4916ac,null,0x2));_0x106010[_0x5e28('0x3a')]=moment()[_0x5e28('0x10')](_0x5e28('0x3b'));_0x249508=initGraph(_[_0x5e28('0x25')](_0x4916ac,_0x5e28('0x26')),_0x4916ac[_0x5e28('0x26')]);_0x26f9b2=new Vertices(_0x106010,rpc,mailRpc);logger[_0x5e28('0xf')](util['format'](_0x5e28('0x3c'),_0x106010[_0x5e28('0x18')],_0x106010['calleridname'],_0x106010['callerid'],_0x106010[_0x5e28('0x36')],_0x106010[_0x5e28('0x19')]));_0x249508[_0x5e28('0x3d')](_0x4916ac[_0x5e28('0x3e')]['id'],function(_0x4aba43){try{_0x4aba43=_0x26f9b2[_0x5e28('0x3f')](_0x4aba43);logger[_0x5e28('0x32')](_0x5e28('0x40'),JSON['stringify'](_0x4aba43,null,0x2));if(_0x4aba43[_0x5e28('0x41')]==='gotoc'){logger[_0x5e28('0xf')](_0x5e28('0x42'));_0x106010[_0x5e28('0x43')]=_0x4aba43[_0x5e28('0x43')]||_0x106010['context'];_0x106010[_0x5e28('0x44')]=_0x4aba43['extension'];_0x106010[_0x5e28('0x45')]=_0x4aba43[_0x5e28('0x45')]?_0x4aba43[_0x5e28('0x45')]-0x1:0x1;return null;}else if(_0x4aba43&&_0x26f9b2[_0x4aba43[_0x5e28('0x41')]]){_0x52220f=_0x26f9b2[_0x4aba43[_0x5e28('0x41')]](_0x4aba43);logger[_0x5e28('0xf')](_0x5e28('0x46'),JSON['stringify'](_0x52220f,null,0x2));if(_0x52220f&&_0x52220f['code']===AGI_CODE_SUCCESS&&_0x52220f[_0x5e28('0x47')]!==AGI_RESULT_ERROR&&!_0x106010[_0x5e28('0x37')]){logger['debug']('response',getLogFromObject(_0x52220f));return _[_0x5e28('0x48')](_0x52220f[_0x5e28('0x47')])?null:_0x52220f[_0x5e28('0x47')][_0x5e28('0x49')]();}else{logger['error'](_0x5e28('0x46'),getLogFromObject(_0x52220f));return null;}}else{logger[_0x5e28('0x15')]('agicommand\x20not\x20found');return null;}}catch(_0x4cb990){logger['error'](_0x4cb990[_0x5e28('0xc')]);return null;}});if(_0x4916ac[_0x5e28('0x4a')]){logger[_0x5e28('0xf')](util[_0x5e28('0x10')](_0x5e28('0x4b'),_0x106010['arg_1'],_0x106010[_0x5e28('0x1b')],_0x106010['callerid'],_0x106010['dnid'],_0x106010[_0x5e28('0x19')]));_0x249508[_0x5e28('0x3d')](_0x4916ac[_0x5e28('0x4a')]['id'],function(_0x4749e6){try{_0x4749e6=_0x26f9b2[_0x5e28('0x3f')](_0x4749e6);logger[_0x5e28('0x32')](_0x5e28('0x40'),JSON[_0x5e28('0x34')](_0x4749e6,null,0x2));if(_0x4749e6&&_0x26f9b2[_0x4749e6[_0x5e28('0x41')]]){_0x52220f=_0x26f9b2[_0x4749e6[_0x5e28('0x41')]](_0x4749e6);if(_0x52220f){logger[_0x5e28('0x32')](_0x5e28('0x46'),getLogFromObject(_0x52220f));return _[_0x5e28('0x48')](_0x52220f[_0x5e28('0x47')])?null:_0x52220f['result']['toString']();}else{logger[_0x5e28('0x15')](_0x5e28('0x46'),getLogFromObject(_0x52220f));return null;}}else{logger[_0x5e28('0x15')](_0x5e28('0x4c'));return null;}}catch(_0x587f06){logger[_0x5e28('0x15')](_0x587f06[_0x5e28('0xc')]);return null;}});}logger[_0x5e28('0xf')](util[_0x5e28('0x10')](_0x5e28('0x4d'),_0x106010[_0x5e28('0x18')],_0x106010['calleridname'],_0x106010['callerid'],_0x106010['dnid'],_0x106010['uniqueid']));logger[_0x5e28('0xf')](util[_0x5e28('0x10')](_0x5e28('0x4e'),_0x106010['context'],_0x106010[_0x5e28('0x44')],parseInt(_0x106010[_0x5e28('0x45')],0xa)+0x1));_0x106010[_0x5e28('0x4f')](_0x106010[_0x5e28('0x43')],_0x106010[_0x5e28('0x44')],parseInt(_0x106010[_0x5e28('0x45')],0xa)+0x1);_0x106010[_0x5e28('0x50')]();}}else{logger['error'](util[_0x5e28('0x10')](_0x5e28('0x51'),_0x106010['arg_1']));_0x106010[_0x5e28('0x4f')](_0x106010[_0x5e28('0x43')],_0x106010[_0x5e28('0x44')],parseInt(_0x106010['priority'],0xa)+0x1);_0x106010[_0x5e28('0x50')]();}}else{logger['error'](util['format'](_0x5e28('0x52'),_0x106010['arg_1']));_0x106010[_0x5e28('0x4f')](_0x106010[_0x5e28('0x43')],_0x106010[_0x5e28('0x44')],parseInt(_0x106010['priority'],0xa)+0x1);_0x106010[_0x5e28('0x50')]();}}function main(){var _0x3a4b00;return utilLicense[_0x5e28('0x53')]()[_0x5e28('0x2e')](function(_0xd06a19){if(_0xd06a19){if(_0xd06a19[_0x5e28('0x54')]){if(_0xd06a19[_0x5e28('0x55')]&&_0xd06a19[_0x5e28('0x55')]>0x0){logger[_0x5e28('0xf')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0xd06a19[_0x5e28('0x55')]));_0x3a4b00=_0xd06a19[_0x5e28('0x55')];}else{logger[_0x5e28('0xf')](_0x5e28('0x56'));}}else{logger[_0x5e28('0xf')](_0x5e28('0x57'));_0x3a4b00=-0x1;}}})['catch'](function(_0x5e04c3){logger[_0x5e28('0x15')]('[LICENSE]',_0x5e04c3[_0x5e28('0xc')]);})[_0x5e28('0x4a')](function(){var _0x1f854d=require('./server')(config[_0x5e28('0x9')][_0x5e28('0x12')],config[_0x5e28('0x9')]['ip'],_0x3a4b00);_0x1f854d['on'](_0x5e28('0x15'),errorHandler);_0x1f854d['on'](_0x5e28('0x58'),listeningHandler);_0x1f854d['on'](_0x5e28('0x59'),connectionHandler);_0x1f854d['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x806c=['util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./graph','./vertices','defaults','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','hasOwnProperty','maxRetry','addVertex','omit','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','agi_','substring','inspect','debug','variables','stringify','close','hangup','sync','production','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','isUndefined','result','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toString','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','xml2json','lodash','syncho'];(function(_0x31ad84,_0x3a1364){var _0x2ab374=function(_0x596f0a){while(--_0x596f0a){_0x31ad84['push'](_0x31ad84['shift']());}};_0x2ab374(++_0x3a1364);}(_0x806c,0x111));var _0xc806=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0x806c[_0x4e11d5];return _0x5e4e4c;};'use strict';var parser=require(_0xc806('0x0'));var _=require(_0xc806('0x1'));var syncho=require(_0xc806('0x2'));var util=require(_0xc806('0x3'));var moment=require('moment');var config=require(_0xc806('0x4'));var logger=require(_0xc806('0x5'))(_0xc806('0x6'));var utilLicense=require(_0xc806('0x7'));var rpc=require(_0xc806('0x8'));var mailRpc=require('./mailRpc');var Graph=require(_0xc806('0x9'));var Vertices=require(_0xc806('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xc806('0x6')]=_[_0xc806('0xb')](config[_0xc806('0x6')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x3441b7){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x3441b7);agiHandler(_0x3441b7);}catch(_0x2391a6){logger['error'](_0x2391a6[_0xc806('0xc')]);}});});}function listeningHandler(){console[_0xc806('0xd')](_0xc806('0xe'),config[_0xc806('0x6')][_0xc806('0xf')]);logger['info'](util[_0xc806('0x10')](_0xc806('0x11'),config[_0xc806('0x6')]['ip'],config[_0xc806('0x6')]['port']));}function errorHandler(_0x9c896e){if(_0x9c896e&&_0x9c896e[_0xc806('0x12')]&&_0x9c896e[_0xc806('0x13')]){logger[_0xc806('0x14')](util[_0xc806('0x10')]('[%s]\x20%s',_0x9c896e[_0xc806('0x12')],_0x9c896e[_0xc806('0x13')]));}else{logger[_0xc806('0x14')](util[_0xc806('0x10')](_0xc806('0x15'),_0x9c896e['stack']));}}function closeHandler(){logger[_0xc806('0x16')](util['format'](_0xc806('0x17'),this['arg_1'],this['calleridname'],this[_0xc806('0x18')],this[_0xc806('0x19')],this[_0xc806('0x1a')]));try{createSquareReport(this);}catch(_0x365bcc){logger[_0xc806('0x14')](_0x365bcc[_0xc806('0xc')]);}}function timeoutHandler(){logger[_0xc806('0x16')](util[_0xc806('0x10')](_0xc806('0x1b'),this[_0xc806('0x1c')],this[_0xc806('0x1d')],this['callerid'],this[_0xc806('0x19')],this[_0xc806('0x1a')]));}function hangupHandler(){logger['info'](util['format'](_0xc806('0x1e'),this[_0xc806('0x1c')],this[_0xc806('0x1d')],this[_0xc806('0x18')],this[_0xc806('0x19')],this[_0xc806('0x1a')]));this[_0xc806('0x1f')]=!![];}function getRoot(_0x302077){return parser[_0xc806('0x20')](_0x302077,{'object':!![]})[_0xc806('0x21')][_0xc806('0x22')];}function addVertex(_0x35f2a9,_0x51fea9,_0x5ccb9b){_0x51fea9['agicommand']=_0x5ccb9b;if(_0x51fea9[_0xc806('0x23')]('retry')){_0x51fea9[_0xc806('0x24')]=parseInt(_0x51fea9['retry'],0xa);}_0x35f2a9[_0xc806('0x25')](_[_0xc806('0x26')](_0x51fea9,'mxCell'));}function initGraph(_0x20cd8c,_0xfb4b0d){var _0x3d71ff=new Graph();for(var _0x2e6102 in _0x20cd8c){if(_0x20cd8c[_0xc806('0x23')](_0x2e6102)){if(_[_0xc806('0x27')](_0x20cd8c[_0x2e6102])){for(var _0x3a00a2=0x0;_0x3a00a2<_0x20cd8c[_0x2e6102][_0xc806('0x28')];_0x3a00a2+=0x1){addVertex(_0x3d71ff,_0x20cd8c[_0x2e6102][_0x3a00a2],_0x2e6102);}}else{addVertex(_0x3d71ff,_0x20cd8c[_0x2e6102],_0x2e6102);}}}for(var _0xb21f8e=0x0;_0xb21f8e<_0xfb4b0d[_0xc806('0x28')];_0xb21f8e+=0x1){if(_0xfb4b0d[_0xb21f8e][_0xc806('0x29')]&&_0xfb4b0d[_0xb21f8e][_0xc806('0x2a')]){_0x3d71ff[_0xc806('0x2b')](_0xfb4b0d[_0xb21f8e][_0xc806('0x29')],_0xfb4b0d[_0xb21f8e][_0xc806('0x2a')],_0xfb4b0d[_0xb21f8e][_0xc806('0x2c')]);}}return _0x3d71ff;}function getSquareProject(_0x2f800f,_0x455510){rpc[_0xc806('0x2d')](_0x2f800f)[_0xc806('0x2e')](function(_0x58a8c2){_0x455510(null,_0x58a8c2);})[_0xc806('0x2f')](function(_0x5b617f){_0x455510(null,_0x5b617f);});}function createSquareReport(_0x149f2d,_0x511ace){rpc[_0xc806('0x30')](_0x149f2d)[_0xc806('0x2e')](function(_0x143346){if(_0x511ace){_0x511ace(null,_0x143346);}})[_0xc806('0x2f')](function(_0xad4e9a){if(_0x511ace){_0x511ace(null,_0xad4e9a);}});}function setChannelVariables(_0x988625){for(var _0x2be5fb in _0x988625){if(_0x988625['hasOwnProperty'](_0x2be5fb)){if(_0x2be5fb['indexOf'](_0xc806('0x31'))===0x0){_0x988625[_0x2be5fb[_0xc806('0x32')](0x4)]=_0x988625[_0x2be5fb];delete _0x988625[_0x2be5fb];}}}}function getLogFromObject(_0x24d72e){return util[_0xc806('0x33')](_0x24d72e,{'showHidden':![],'depth':null});}function agiHandler(_0x4f6125){var _0x28b453,_0x13d2b2,_0x15f0da,_0x2a6ba4,_0x2df72e;logger[_0xc806('0x34')](_0xc806('0x35'),JSON[_0xc806('0x36')](_0x4f6125,null,0x2));logger['info'](util[_0xc806('0x10')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4f6125[_0xc806('0x1c')],_0x4f6125[_0xc806('0x1d')],_0x4f6125[_0xc806('0x18')],_0x4f6125[_0xc806('0x19')],_0x4f6125[_0xc806('0x1a')]));_0x4f6125['on'](_0xc806('0x14'),errorHandler);_0x4f6125['on'](_0xc806('0x37'),closeHandler);_0x4f6125['on']('timeout',timeoutHandler);_0x4f6125['evtHangup']=![];_0x4f6125['on'](_0xc806('0x38'),hangupHandler);var _0x442e6b=getSquareProject[_0xc806('0x39')](null,_0x4f6125[_0xc806('0x1c')]);if(_0x442e6b){if(_0x442e6b[_0xc806('0x3a')]){_0x28b453=getRoot(_0x442e6b[_0xc806('0x3a')]);if(_0x28b453&&_0x28b453['start']){logger['debug']('root',JSON[_0xc806('0x36')](_0x28b453,null,0x2));_0x4f6125[_0xc806('0x3b')]=moment()[_0xc806('0x10')](_0xc806('0x3c'));_0x13d2b2=initGraph(_[_0xc806('0x26')](_0x28b453,'mxCell'),_0x28b453[_0xc806('0x3d')]);_0x15f0da=new Vertices(_0x4f6125,rpc,mailRpc);logger['info'](util[_0xc806('0x10')](_0xc806('0x3e'),_0x4f6125[_0xc806('0x1c')],_0x4f6125[_0xc806('0x1d')],_0x4f6125[_0xc806('0x18')],_0x4f6125[_0xc806('0x19')],_0x4f6125[_0xc806('0x1a')]));_0x13d2b2[_0xc806('0x3f')](_0x28b453['start']['id'],function(_0x1e8c8d){try{_0x1e8c8d=_0x15f0da[_0xc806('0x40')](_0x1e8c8d);logger['debug'](_0xc806('0x41'),JSON[_0xc806('0x36')](_0x1e8c8d,null,0x2));if(_0x1e8c8d[_0xc806('0x42')]==='gotoc'){logger[_0xc806('0x16')](_0xc806('0x43'));_0x4f6125[_0xc806('0x44')]=_0x1e8c8d[_0xc806('0x44')]||_0x4f6125[_0xc806('0x44')];_0x4f6125[_0xc806('0x45')]=_0x1e8c8d[_0xc806('0x45')];_0x4f6125[_0xc806('0x46')]=_0x1e8c8d[_0xc806('0x46')]?_0x1e8c8d[_0xc806('0x46')]-0x1:0x1;return null;}else if(_0x1e8c8d&&_0x15f0da[_0x1e8c8d[_0xc806('0x42')]]){_0x2df72e=_0x15f0da[_0x1e8c8d['agicommand']](_0x1e8c8d);logger[_0xc806('0x16')](_0xc806('0x47'),JSON[_0xc806('0x36')](_0x2df72e,null,0x2));if(_0x2df72e&&_0x2df72e[_0xc806('0x48')]===AGI_CODE_SUCCESS&&_0x2df72e['result']!==AGI_RESULT_ERROR&&!_0x4f6125[_0xc806('0x1f')]){logger[_0xc806('0x34')](_0xc806('0x47'),getLogFromObject(_0x2df72e));return _[_0xc806('0x49')](_0x2df72e[_0xc806('0x4a')])?null:_0x2df72e[_0xc806('0x4a')]['toString']();}else{logger[_0xc806('0x14')](_0xc806('0x47'),getLogFromObject(_0x2df72e));return null;}}else{logger[_0xc806('0x14')](_0xc806('0x4b'));return null;}}catch(_0x2965d3){logger[_0xc806('0x14')](_0x2965d3[_0xc806('0xc')]);return null;}});if(_0x28b453[_0xc806('0x4c')]){logger[_0xc806('0x16')](util[_0xc806('0x10')](_0xc806('0x4d'),_0x4f6125['arg_1'],_0x4f6125[_0xc806('0x1d')],_0x4f6125['callerid'],_0x4f6125[_0xc806('0x19')],_0x4f6125[_0xc806('0x1a')]));_0x13d2b2['traverseBFS'](_0x28b453[_0xc806('0x4c')]['id'],function(_0x147905){try{_0x147905=_0x15f0da[_0xc806('0x40')](_0x147905);logger[_0xc806('0x34')](_0xc806('0x41'),JSON['stringify'](_0x147905,null,0x2));if(_0x147905&&_0x15f0da[_0x147905[_0xc806('0x42')]]){_0x2df72e=_0x15f0da[_0x147905['agicommand']](_0x147905);if(_0x2df72e){logger['debug'](_0xc806('0x47'),getLogFromObject(_0x2df72e));return _['isUndefined'](_0x2df72e['result'])?null:_0x2df72e[_0xc806('0x4a')][_0xc806('0x4e')]();}else{logger[_0xc806('0x14')](_0xc806('0x47'),getLogFromObject(_0x2df72e));return null;}}else{logger[_0xc806('0x14')](_0xc806('0x4b'));return null;}}catch(_0x74cda3){logger[_0xc806('0x14')](_0x74cda3['stack']);return null;}});}logger[_0xc806('0x16')](util[_0xc806('0x10')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4f6125[_0xc806('0x1c')],_0x4f6125[_0xc806('0x1d')],_0x4f6125[_0xc806('0x18')],_0x4f6125[_0xc806('0x19')],_0x4f6125[_0xc806('0x1a')]));logger[_0xc806('0x16')](util['format'](_0xc806('0x4f'),_0x4f6125['context'],_0x4f6125[_0xc806('0x45')],parseInt(_0x4f6125[_0xc806('0x46')],0xa)+0x1));_0x4f6125[_0xc806('0x50')](_0x4f6125[_0xc806('0x44')],_0x4f6125['extension'],parseInt(_0x4f6125[_0xc806('0x46')],0xa)+0x1);_0x4f6125[_0xc806('0x37')]();}}else{logger[_0xc806('0x14')](util['format'](_0xc806('0x51'),_0x4f6125[_0xc806('0x1c')]));_0x4f6125[_0xc806('0x50')](_0x4f6125[_0xc806('0x44')],_0x4f6125[_0xc806('0x45')],parseInt(_0x4f6125[_0xc806('0x46')],0xa)+0x1);_0x4f6125[_0xc806('0x37')]();}}else{logger[_0xc806('0x14')](util[_0xc806('0x10')](_0xc806('0x52'),_0x4f6125[_0xc806('0x1c')]));_0x4f6125[_0xc806('0x50')](_0x4f6125[_0xc806('0x44')],_0x4f6125['extension'],parseInt(_0x4f6125[_0xc806('0x46')],0xa)+0x1);_0x4f6125['close']();}}function main(){var _0x1b47cd;return utilLicense[_0xc806('0x53')]()['then'](function(_0x25389d){if(_0x25389d){if(_0x25389d[_0xc806('0x54')]){if(_0x25389d[_0xc806('0x55')]&&_0x25389d[_0xc806('0x55')]>0x0){logger[_0xc806('0x16')](util[_0xc806('0x10')](_0xc806('0x56'),_0x25389d[_0xc806('0x55')]));_0x1b47cd=_0x25389d[_0xc806('0x55')];}else{logger[_0xc806('0x16')](_0xc806('0x57'));}}else{logger[_0xc806('0x16')](_0xc806('0x58'));_0x1b47cd=-0x1;}}})[_0xc806('0x2f')](function(_0xaf884f){logger[_0xc806('0x14')](_0xc806('0x59'),_0xaf884f['stack']);})[_0xc806('0x4c')](function(){var _0x418cfb=require(_0xc806('0x5a'))(config['agi']['port'],config[_0xc806('0x6')]['ip'],_0x1b47cd);_0x418cfb['on'](_0xc806('0x14'),errorHandler);_0x418cfb['on'](_0xc806('0x5b'),listeningHandler);_0x418cfb['on']('connection',connectionHandler);_0x418cfb['on'](_0xc806('0x37'),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 4f8f615..9ea4fc8 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 _0x0a60=['client','http','request','error','message','result','catch','sendMailMessage','bluebird','jayson/promise'];(function(_0x1c1ad1,_0x54c0e8){var _0x5a29a7=function(_0x403011){while(--_0x403011){_0x1c1ad1['push'](_0x1c1ad1['shift']());}};_0x5a29a7(++_0x54c0e8);}(_0x0a60,0x15c));var _0x00a6=function(_0x49ff57,_0x32630d){_0x49ff57=_0x49ff57-0x0;var _0x35f0ae=_0x0a60[_0x49ff57];return _0x35f0ae;};'use strict';var BPromise=require(_0x00a6('0x0'));var jayson=require(_0x00a6('0x1'));var client=jayson[_0x00a6('0x2')][_0x00a6('0x3')]({'port':0x232b});function request(_0x74ef2f,_0x1627f1){return new BPromise(function(_0x2fddae,_0x25af93){return client[_0x00a6('0x4')](_0x74ef2f,_0x1627f1)['then'](function(_0x319548){if(_0x319548[_0x00a6('0x5')]){return _0x25af93(_0x319548[_0x00a6('0x5')][_0x00a6('0x6')]);}else{return _0x2fddae(_0x319548[_0x00a6('0x7')]);}})[_0x00a6('0x8')](function(_0x4c4642){return _0x25af93(_0x4c4642);});});}exports[_0x00a6('0x9')]=function(_0x20a90c,_0x39fe6e){return request('SendMail',{'account':_0x20a90c,'message':_0x39fe6e});}; \ No newline at end of file +var _0x3017=['bluebird','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x37912f,_0x2b6736){var _0xf2627d=function(_0x587a64){while(--_0x587a64){_0x37912f['push'](_0x37912f['shift']());}};_0xf2627d(++_0x2b6736);}(_0x3017,0x1d4));var _0x7301=function(_0x11b7cb,_0x54a18a){_0x11b7cb=_0x11b7cb-0x0;var _0x14af1a=_0x3017[_0x11b7cb];return _0x14af1a;};'use strict';var BPromise=require(_0x7301('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7301('0x1')]({'port':0x232b});function request(_0x2765a9,_0x39866f){return new BPromise(function(_0xc93335,_0x292c19){return client[_0x7301('0x2')](_0x2765a9,_0x39866f)[_0x7301('0x3')](function(_0xdd2d37){if(_0xdd2d37[_0x7301('0x4')]){return _0x292c19(_0xdd2d37['error']['message']);}else{return _0xc93335(_0xdd2d37[_0x7301('0x5')]);}})[_0x7301('0x6')](function(_0x3a4379){return _0x292c19(_0x3a4379);});});}exports[_0x7301('0x7')]=function(_0x25803e,_0x1c402e){return request(_0x7301('0x8'),{'account':_0x25803e,'message':_0x1c402e});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index d2da2dc..87ca517 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 _0xcf74=['substring','length','split','trim','slice','headers','indexOf','line','exports','util','stream','_localBuffer','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','toString'];(function(_0x3d68cb,_0x48d362){var _0x5db0af=function(_0x29f12e){while(--_0x29f12e){_0x3d68cb['push'](_0x3d68cb['shift']());}};_0x5db0af(++_0x48d362);}(_0xcf74,0x17f));var _0x4cf7=function(_0x5d3a6,_0x5135fa){_0x5d3a6=_0x5d3a6-0x0;var _0x263e6d=_0xcf74[_0x5d3a6];return _0x263e6d;};'use strict';var util=require(_0x4cf7('0x0'));var Transform=require(_0x4cf7('0x1'))['Transform'];function AGIReply(_0x175312){Transform['call'](this,_0x175312);this[_0x4cf7('0x2')]='';this[_0x4cf7('0x3')]=![];}util[_0x4cf7('0x4')](AGIReply,Transform);AGIReply[_0x4cf7('0x5')]['_transform']=function(_0x2751dd,_0x2a5b48,_0x3c8edf){var _0x40275f='\x0a',_0x437af4=['\x0a\x0a',_0x4cf7('0x6')],_0x1aa06f=-0x1,_0x750c13=-0x1,_0x14056b='',_0x569a0f=0x0,_0x260eca='',_0x1a390c='';this[_0x4cf7('0x2')]+=_0x2751dd[_0x4cf7('0x7')]();_0x260eca=this[_0x4cf7('0x2')];if(!this[_0x4cf7('0x3')]){_0x569a0f=0x0;while(_0x437af4[_0x569a0f]){while((_0x750c13=_0x260eca['indexOf'](_0x437af4[_0x569a0f]))!=-0x1){_0x14056b=_0x437af4[_0x569a0f];_0x1a390c=_0x260eca[_0x4cf7('0x8')](0x0,_0x750c13);_0x260eca=_0x260eca[_0x4cf7('0x8')](_0x750c13+_0x14056b[_0x4cf7('0x9')]);var _0x35f4c6=_0x1a390c[_0x4cf7('0xa')](_0x40275f),_0x4eda56=0x0,_0x5f51ed={},_0x1bc7c2='',_0xad2b4c='',_0x12ac4a=-0x1;while(_0x35f4c6[_0x4eda56]){_0x12ac4a=_0x35f4c6[_0x4eda56]['indexOf'](':');if(_0x12ac4a!=-0x1){_0x1bc7c2=_0x35f4c6[_0x4eda56]['slice'](0x0,_0x12ac4a)[_0x4cf7('0xb')]();_0xad2b4c=_0x35f4c6[_0x4eda56][_0x4cf7('0xc')](_0x12ac4a+0x1)[_0x4cf7('0xb')]();if(_0x1bc7c2[_0x4cf7('0x9')]>0x0){_0x5f51ed[_0x1bc7c2]=_0xad2b4c;}}else{}_0x4eda56++;}this['emit'](_0x4cf7('0xd'),_0x5f51ed);this[_0x4cf7('0x3')]=!![];}_0x569a0f++;}this[_0x4cf7('0x2')]=_0x260eca;}else{while((_0x1aa06f=_0x260eca[_0x4cf7('0xe')](_0x40275f))!=-0x1){_0x1a390c=_0x260eca[_0x4cf7('0x8')](0x0,_0x1aa06f);this['emit'](_0x4cf7('0xf'),_0x1a390c);_0x260eca=_0x260eca['substring'](_0x1aa06f+_0x40275f[_0x4cf7('0x9')]);}this[_0x4cf7('0x2')]=_0x260eca;}_0x3c8edf();};module[_0x4cf7('0x10')]=AGIReply; \ No newline at end of file +var _0x9532=['headers','_inBody','line','exports','util','stream','Transform','call','_localBuffer','inherits','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','emit'];(function(_0x160def,_0x2493ab){var _0x1c9dce=function(_0x96c9ce){while(--_0x96c9ce){_0x160def['push'](_0x160def['shift']());}};_0x1c9dce(++_0x2493ab);}(_0x9532,0x8c));var _0x2953=function(_0x217e5e,_0x41ba00){_0x217e5e=_0x217e5e-0x0;var _0x40e37d=_0x9532[_0x217e5e];return _0x40e37d;};'use strict';var util=require(_0x2953('0x0'));var Transform=require(_0x2953('0x1'))[_0x2953('0x2')];function AGIReply(_0x345d53){Transform[_0x2953('0x3')](this,_0x345d53);this[_0x2953('0x4')]='';this['_inBody']=![];}util[_0x2953('0x5')](AGIReply,Transform);AGIReply[_0x2953('0x6')]['_transform']=function(_0x12f653,_0x5dbb28,_0x12de4a){var _0x451c3c='\x0a',_0x5b2aea=['\x0a\x0a',_0x2953('0x7')],_0x53566f=-0x1,_0x21a76a=-0x1,_0x5cbdaa='',_0x49f180=0x0,_0x422b1a='',_0x56cf37='';this[_0x2953('0x4')]+=_0x12f653[_0x2953('0x8')]();_0x422b1a=this[_0x2953('0x4')];if(!this['_inBody']){_0x49f180=0x0;while(_0x5b2aea[_0x49f180]){while((_0x21a76a=_0x422b1a[_0x2953('0x9')](_0x5b2aea[_0x49f180]))!=-0x1){_0x5cbdaa=_0x5b2aea[_0x49f180];_0x56cf37=_0x422b1a[_0x2953('0xa')](0x0,_0x21a76a);_0x422b1a=_0x422b1a[_0x2953('0xa')](_0x21a76a+_0x5cbdaa[_0x2953('0xb')]);var _0x33f599=_0x56cf37['split'](_0x451c3c),_0x3843bc=0x0,_0x5b1aca={},_0x480cae='',_0x41f2be='',_0x13c8a8=-0x1;while(_0x33f599[_0x3843bc]){_0x13c8a8=_0x33f599[_0x3843bc][_0x2953('0x9')](':');if(_0x13c8a8!=-0x1){_0x480cae=_0x33f599[_0x3843bc]['slice'](0x0,_0x13c8a8)['trim']();_0x41f2be=_0x33f599[_0x3843bc]['slice'](_0x13c8a8+0x1)['trim']();if(_0x480cae[_0x2953('0xb')]>0x0){_0x5b1aca[_0x480cae]=_0x41f2be;}}else{}_0x3843bc++;}this[_0x2953('0xc')](_0x2953('0xd'),_0x5b1aca);this[_0x2953('0xe')]=!![];}_0x49f180++;}this[_0x2953('0x4')]=_0x422b1a;}else{while((_0x53566f=_0x422b1a['indexOf'](_0x451c3c))!=-0x1){_0x56cf37=_0x422b1a[_0x2953('0xa')](0x0,_0x53566f);this[_0x2953('0xc')](_0x2953('0xf'),_0x56cf37);_0x422b1a=_0x422b1a[_0x2953('0xa')](_0x53566f+_0x451c3c[_0x2953('0xb')]);}this[_0x2953('0x4')]=_0x422b1a;}_0x12de4a();};module[_0x2953('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index a51b275..caf7b70 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 _0x49fa=['getMailAccountById','ShowMailAccount','Smtp','email','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','moment','lodash','jayson/promise','client','http','request','then','error','message','result','ShowSquareProject','production'];(function(_0x386e2c,_0x12b267){var _0x38a212=function(_0x35beb6){while(--_0x35beb6){_0x386e2c['push'](_0x386e2c['shift']());}};_0x38a212(++_0x12b267);}(_0x49fa,0xd8));var _0xa49f=function(_0x39e426,_0xe5e584){_0x39e426=_0x39e426-0x0;var _0x33aae8=_0x49fa[_0x39e426];return _0x33aae8;};'use strict';var BPromise=require('bluebird');var moment=require(_0xa49f('0x0'));var _=require(_0xa49f('0x1'));var util=require('util');var jayson=require(_0xa49f('0x2'));var client=jayson[_0xa49f('0x3')][_0xa49f('0x4')]({'port':0x2329});function request(_0xfd3e72,_0x1fcb62){return new BPromise(function(_0x157dbe,_0x1e8508){return client[_0xa49f('0x5')](_0xfd3e72,_0x1fcb62)[_0xa49f('0x6')](function(_0x1df814){if(_0x1df814[_0xa49f('0x7')]){return _0x1e8508(_0x1df814[_0xa49f('0x7')][_0xa49f('0x8')]);}else{return _0x157dbe(_0x1df814[_0xa49f('0x9')]);}})['catch'](function(_0x278847){return _0x1e8508(_0x278847);});});}exports['getSquareProject']=function(_0x3c4e7a){return request(_0xa49f('0xa'),{'options':{'raw':![],'where':{'name':_0x3c4e7a},'attributes':[_0xa49f('0xb')]}});};exports[_0xa49f('0xc')]=function(_0x44e234){return request(_0xa49f('0xd'),{'options':{'raw':![],'where':{'id':_0x44e234},'include':[{'model':'MailServerOut','as':_0xa49f('0xe')}],'attributes':['id','name',_0xa49f('0xf')]}});};exports[_0xa49f('0x10')]=function(_0x3a3805){return request(_0xa49f('0xa'),{'options':{'where':{'id':_0x3a3805},'attributes':[_0xa49f('0x11')]}});};exports[_0xa49f('0x12')]=function(_0x1e3ae2){return request(_0xa49f('0x13'),{'options':{'where':{'id':_0x1e3ae2},'attributes':[_0xa49f('0x11')]}});};exports[_0xa49f('0x14')]=function(_0x2aea63){return request(_0xa49f('0x15'),{'options':{'where':{'id':_0x2aea63},'attributes':[_0xa49f('0x11')]}});};exports[_0xa49f('0x16')]=function(_0x349db4){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x349db4},'attributes':[_0xa49f('0x17')]}});};exports['getUserById']=function(_0x477003){return request(_0xa49f('0x18'),{'options':{'where':{'id':_0x477003},'attributes':[_0xa49f('0x11')]}});};exports[_0xa49f('0x19')]=function(_0x432bff){return request(_0xa49f('0x1a'),{'options':{'where':{'id':_0x432bff},'attributes':[_0xa49f('0x11')]}});};exports[_0xa49f('0x1b')]=function(_0x5c66c0){return request(_0xa49f('0x1c'),{'options':{'where':{'id':_0x5c66c0},'attributes':[_0xa49f('0x1d')]}});};exports[_0xa49f('0x1e')]=function(_0x45e200){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x45e200},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0xa49f('0x1f')]=function(_0x3388ff){return request(_0xa49f('0x20'),{'options':{'where':{'id':_0x3388ff},'attributes':['id',_0xa49f('0x11')]}});};exports['createSmsMessage']=function(_0x1c6417){return request(_0xa49f('0x21'),{'body':_0x1c6417});};exports[_0xa49f('0x22')]=function(_0x177d51){return request(_0xa49f('0x23'),{'body':_0x177d51});};exports[_0xa49f('0x24')]=function(_0x4b087c){return request(_0xa49f('0x25'),{'body':_[_0xa49f('0x26')](_0x4b087c,{'project_name':_0x4b087c[_0xa49f('0x27')],'prev_project_name':_0x4b087c[_0xa49f('0x28')]||'','is_subproject':_0x4b087c[_0xa49f('0x28')]?!![]:![],'leaveAt':moment()[_0xa49f('0x29')](_0xa49f('0x2a'))})});};exports[_0xa49f('0x2b')]=function(_0x4cf80c){return request('CreateSquareRecording',{'body':_0x4cf80c});};exports[_0xa49f('0x2c')]=function(_0x2315cb){return request(_0xa49f('0x2d'),{'body':_0x2315cb});};exports['createCmContact']=function(_0x38631d){return request(_0xa49f('0x2e'),{'options':{'raw':![],'where':{'phone':_0x38631d['phone'],'ListId':_0x38631d['ListId']}}})['then'](function(_0xbb23ce){if(_0xbb23ce){return _0xbb23ce;}return request(_0xa49f('0x2f'),{'body':_0x38631d});});};exports[_0xa49f('0x30')]=function(_0x3f0c39){return request(_0xa49f('0x31'),{'options':{'where':{'id':_0x3f0c39},'attributes':[_0xa49f('0x11')]}});};exports[_0xa49f('0x32')]=function(_0x337d6f,_0x2eccf4){return request(_0xa49f('0x33'),{'body':{'interface':_0x2eccf4},'options':{'where':_0x337d6f}});};exports[_0xa49f('0x34')]=function(_0x11971c,_0x152f84,_0x16f373){return request(_0xa49f('0x35'),{'body':{'type':_0x152f84,'uniqueid':_0x16f373},'options':{'where':_0x11971c}});};exports[_0xa49f('0x36')]=function(_0x1bd3d1){return request(_0xa49f('0x37'),{'body':{},'options':{'where':_0x1bd3d1}});};exports['agentLogout']=function(_0x117970){return request(_0xa49f('0x38'),{'body':{},'options':{'where':_0x117970}});}; \ No newline at end of file +var _0x492d=['merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','then','CreateCmContact','getPauseById','ShowPause','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','error','result','catch','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','CreateSquareDetailsReport','CreateSquareReport'];(function(_0x3a526d,_0x11f1aa){var _0x461700=function(_0x452537){while(--_0x452537){_0x3a526d['push'](_0x3a526d['shift']());}};_0x461700(++_0x11f1aa);}(_0x492d,0x14b));var _0xd492=function(_0x31252f,_0x184262){_0x31252f=_0x31252f-0x0;var _0xb8c154=_0x492d[_0x31252f];return _0xb8c154;};'use strict';var BPromise=require(_0xd492('0x0'));var moment=require(_0xd492('0x1'));var _=require(_0xd492('0x2'));var util=require('util');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x2329});function request(_0x45dda9,_0x5158f2){return new BPromise(function(_0x4cdee2,_0x3ba3b2){return client['request'](_0x45dda9,_0x5158f2)['then'](function(_0x27121c){if(_0x27121c[_0xd492('0x3')]){return _0x3ba3b2(_0x27121c[_0xd492('0x3')]['message']);}else{return _0x4cdee2(_0x27121c[_0xd492('0x4')]);}})[_0xd492('0x5')](function(_0x3ae21e){return _0x3ba3b2(_0x3ae21e);});});}exports['getSquareProject']=function(_0x5f50dd){return request(_0xd492('0x6'),{'options':{'raw':![],'where':{'name':_0x5f50dd},'attributes':['production']}});};exports[_0xd492('0x7')]=function(_0x21a8a1){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x21a8a1},'include':[{'model':_0xd492('0x8'),'as':_0xd492('0x9')}],'attributes':['id','name','email']}});};exports[_0xd492('0xa')]=function(_0x6470f8){return request(_0xd492('0x6'),{'options':{'where':{'id':_0x6470f8},'attributes':[_0xd492('0xb')]}});};exports[_0xd492('0xc')]=function(_0x65679b){return request(_0xd492('0xd'),{'options':{'where':{'id':_0x65679b},'attributes':['name']}});};exports[_0xd492('0xe')]=function(_0x51f01d){return request(_0xd492('0xf'),{'options':{'where':{'id':_0x51f01d},'attributes':[_0xd492('0xb')]}});};exports[_0xd492('0x10')]=function(_0x2c1f29){return request(_0xd492('0x11'),{'options':{'where':{'id':_0x2c1f29},'attributes':[_0xd492('0x12')]}});};exports[_0xd492('0x13')]=function(_0x30b6f1){return request(_0xd492('0x14'),{'options':{'where':{'id':_0x30b6f1},'attributes':['name']}});};exports[_0xd492('0x15')]=function(_0x5124f4){return request('ShowTrunk',{'options':{'where':{'id':_0x5124f4},'attributes':[_0xd492('0xb')]}});};exports[_0xd492('0x16')]=function(_0x3e916c){return request('ShowSound',{'options':{'where':{'id':_0x3e916c},'attributes':[_0xd492('0x17')]}});};exports[_0xd492('0x18')]=function(_0x4b384e){return request(_0xd492('0x19'),{'options':{'raw':![],'where':{'id':_0x4b384e},'include':[{'model':_0xd492('0x1a'),'as':_0xd492('0x1b')}]}});};exports[_0xd492('0x1c')]=function(_0x32fd07){return request(_0xd492('0x1d'),{'options':{'where':{'id':_0x32fd07},'attributes':['id',_0xd492('0xb')]}});};exports['createSmsMessage']=function(_0x589ad0){return request(_0xd492('0x1e'),{'body':_0x589ad0});};exports['createSquareDetailsReport']=function(_0x10e02b){return request(_0xd492('0x1f'),{'body':_0x10e02b});};exports['createSquareReport']=function(_0x309f31){return request(_0xd492('0x20'),{'body':_[_0xd492('0x21')](_0x309f31,{'project_name':_0x309f31[_0xd492('0x22')],'prev_project_name':_0x309f31[_0xd492('0x23')]||'','is_subproject':_0x309f31[_0xd492('0x23')]?!![]:![],'leaveAt':moment()['format'](_0xd492('0x24'))})});};exports[_0xd492('0x25')]=function(_0x136521){return request('CreateSquareRecording',{'body':_0x136521});};exports[_0xd492('0x26')]=function(_0x44f351){return request(_0xd492('0x27'),{'body':_0x44f351});};exports[_0xd492('0x28')]=function(_0xf3ab37){return request(_0xd492('0x29'),{'options':{'raw':![],'where':{'phone':_0xf3ab37[_0xd492('0x2a')],'ListId':_0xf3ab37['ListId']}}})[_0xd492('0x2b')](function(_0x21a44d){if(_0x21a44d){return _0x21a44d;}return request(_0xd492('0x2c'),{'body':_0xf3ab37});});};exports[_0xd492('0x2d')]=function(_0x2be56b){return request(_0xd492('0x2e'),{'options':{'where':{'id':_0x2be56b},'attributes':[_0xd492('0xb')]}});};exports['agentLogin']=function(_0x2f305b,_0x682aba){return request('LoginUser',{'body':{'interface':_0x682aba},'options':{'where':_0x2f305b}});};exports[_0xd492('0x2f')]=function(_0x55d47a,_0x569b98,_0x28d2e1){return request(_0xd492('0x30'),{'body':{'type':_0x569b98,'uniqueid':_0x28d2e1},'options':{'where':_0x55d47a}});};exports['agentUnpause']=function(_0x7deae9){return request(_0xd492('0x31'),{'body':{},'options':{'where':_0x7deae9}});};exports[_0xd492('0x32')]=function(_0x347ae0){return request(_0xd492('0x33'),{'body':{},'options':{'where':_0x347ae0}});}; \ 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 26e2be0..1c1248a 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 _0xb2ac=['./lex','exports','./polly'];(function(_0x2554d8,_0x177fe2){var _0x3a57f0=function(_0x3f8649){while(--_0x3f8649){_0x2554d8['push'](_0x2554d8['shift']());}};_0x3a57f0(++_0x177fe2);}(_0xb2ac,0x16a));var _0xcb2a=function(_0x131d00,_0x37c3a9){_0x131d00=_0x131d00-0x0;var _0x301d4e=_0xb2ac[_0x131d00];return _0x301d4e;};var polly=require(_0xcb2a('0x0'));var lex=require(_0xcb2a('0x1'));module[_0xcb2a('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x17c4=['./polly','./lex','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x17c4,0x102));var _0x417c=function(_0x28e178,_0x2f91a3){_0x28e178=_0x28e178-0x0;var _0x1abf49=_0x17c4[_0x28e178];return _0x1abf49;};var polly=require(_0x417c('0x0'));var lex=require(_0x417c('0x1'));module[_0x417c('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 64863c2..cf7667c 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 _0xb688=['exports'];(function(_0x1fbfff,_0x1ab056){var _0x7716e0=function(_0x35151b){while(--_0x35151b){_0x1fbfff['push'](_0x1fbfff['shift']());}};_0x7716e0(++_0x1ab056);}(_0xb688,0xcf));var _0x8b68=function(_0x7804a7,_0x23996c){_0x7804a7=_0x7804a7-0x0;var _0x44b34a=_0xb688[_0x7804a7];return _0x44b34a;};'use strict';var lex=require('./lib/api');module[_0x8b68('0x0')]=function(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c){return lex(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c);}; \ No newline at end of file +var _0x2547=['exports'];(function(_0x5baf31,_0x4f84b5){var _0x2ea96f=function(_0x135575){while(--_0x135575){_0x5baf31['push'](_0x5baf31['shift']());}};_0x2ea96f(++_0x4f84b5);}(_0x2547,0x1cd));var _0x7254=function(_0x5df1d6,_0x167889){_0x5df1d6=_0x5df1d6-0x0;var _0x2931a5=_0x2547[_0x5df1d6];return _0x2931a5;};'use strict';var lex=require('./lib/api');module[_0x7254('0x0')]=function(_0x23e38c,_0x44b692,_0x3ea6e6,_0xbbc747,_0x1a36de,_0x9f3435){return lex(_0x23e38c,_0x44b692,_0x3ea6e6,_0xbbc747,_0x1a36de,_0x9f3435);}; \ 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 221a0e3..839d701 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(_0x179166,_0x1ba50d){var _0xe0847=function(_0x3cd4ec){while(--_0x3cd4ec){_0x179166['push'](_0x179166['shift']());}};_0xe0847(++_0x1ba50d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x302cb0,_0xd04a61){var _0x28d91c=function(_0x2d343a){while(--_0x2d343a){_0x302cb0['push'](_0x302cb0['shift']());}};_0x28d91c(++_0xd04a61);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 31f660a..857d165 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 _0xcad5=['exports','./lib/api'];(function(_0x3960a3,_0x5e59b8){var _0x2e103b=function(_0x1255a1){while(--_0x1255a1){_0x3960a3['push'](_0x3960a3['shift']());}};_0x2e103b(++_0x5e59b8);}(_0xcad5,0x14d));var _0x5cad=function(_0x5501ef,_0x50f597){_0x5501ef=_0x5501ef-0x0;var _0x2a977a=_0xcad5[_0x5501ef];return _0x2a977a;};'use strict';var polly=require(_0x5cad('0x0'));module[_0x5cad('0x1')]=function(_0x3a7bf5,_0x4472cb,_0x3b7ddf,_0x2f92e7,_0x190484,_0x2a00d5,_0x56383c){return polly(_0x3a7bf5,_0x4472cb,_0x3b7ddf,_0x2f92e7,_0x190484,_0x2a00d5,_0x56383c);}; \ No newline at end of file +'use strict';var polly=require('./lib/api');module['exports']=function(_0x8b1614,_0x4a223a,_0x58f220,_0x1aaced,_0x2a77ac,_0x7f1bd0,_0x5cd275){return polly(_0x8b1614,_0x4a223a,_0x58f220,_0x1aaced,_0x2a77ac,_0x7f1bd0,_0x5cd275);}; \ 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 b364dfa..9c23db0 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 _0x5285=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','path','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5285,0xdc));var _0x5528=function(_0x2dc7c9,_0x3a15f8){_0x2dc7c9=_0x2dc7c9-0x0;var _0x3e6536=_0x5285[_0x2dc7c9];return _0x3e6536;};'use strict';var fs=require('fs');var path=require(_0x5528('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0x5528('0x1'));function pollyResult(_0x2c605b,_0x420c4f,_0x1aa4da){return new BPromise(function(_0x3a36ca,_0x588d3a){_0x2c605b[_0x5528('0x2')](_0x420c4f,function(_0x358a53,_0x129341){if(_0x358a53){_0x588d3a(_0x358a53);}else if(_0x129341){if(_0x129341[_0x5528('0x3')]instanceof Buffer){fs[_0x5528('0x4')](_0x1aa4da,_0x129341[_0x5528('0x3')],function(_0xa06c72){if(_0xa06c72){_0x588d3a(_0xa06c72);}else{_0x3a36ca();}});}else{_0x588d3a(new Error(_0x5528('0x5')));}}else{_0x588d3a(new Error(_0x5528('0x6')));}});});}module['exports']=function(_0x593f32,_0x399954,_0x479406,_0x554224,_0xe307c0,_0x121c80,_0x189dc0){var _0x4ef81a=new AWS[(_0x5528('0x7'))]({'accessKeyId':_0x593f32,'secretAccessKey':_0x399954,'region':_0x479406});var _0x46f733={'Text':_0xe307c0,'TextType':_0x121c80||'text','OutputFormat':'mp3','VoiceId':_0x554224};return pollyResult(_0x4ef81a,_0x46f733,_0x189dc0);}; \ No newline at end of file +var _0x08b4=['mp3','bluebird','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text'];(function(_0x475f8c,_0x9a1129){var _0x50deda=function(_0x47f607){while(--_0x47f607){_0x475f8c['push'](_0x475f8c['shift']());}};_0x50deda(++_0x9a1129);}(_0x08b4,0x91));var _0x408b=function(_0x235563,_0x260ece){_0x235563=_0x235563-0x0;var _0x219be0=_0x08b4[_0x235563];return _0x219be0;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x408b('0x0'));var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x3cabea,_0x3d92bb,_0x1a52ed){return new BPromise(function(_0x526b0f,_0x4d14c3){_0x3cabea['synthesizeSpeech'](_0x3d92bb,function(_0x470083,_0x219592){if(_0x470083){_0x4d14c3(_0x470083);}else if(_0x219592){if(_0x219592['AudioStream']instanceof Buffer){fs[_0x408b('0x1')](_0x1a52ed,_0x219592[_0x408b('0x2')],function(_0xc52102){if(_0xc52102){_0x4d14c3(_0xc52102);}else{_0x526b0f();}});}else{_0x4d14c3(new Error(_0x408b('0x3')));}}else{_0x4d14c3(new Error(_0x408b('0x4')));}});});}module[_0x408b('0x5')]=function(_0x5f0724,_0x2c751d,_0xbf7bb5,_0x2b2166,_0x297dca,_0x31ebfe,_0x2ecb99){var _0x50e282=new AWS['Polly']({'accessKeyId':_0x5f0724,'secretAccessKey':_0x2c751d,'region':_0xbf7bb5});var _0x2f424c={'Text':_0x297dca,'TextType':_0x31ebfe||_0x408b('0x6'),'OutputFormat':_0x408b('0x7'),'VoiceId':_0x2b2166};return pollyResult(_0x50e282,_0x2f424c,_0x2ecb99);}; \ 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 e009307..a3e9551 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5238=['./lib/api','exports'];(function(_0x2ea024,_0x14ce3b){var _0x327778=function(_0x2385bb){while(--_0x2385bb){_0x2ea024['push'](_0x2ea024['shift']());}};_0x327778(++_0x14ce3b);}(_0x5238,0x156));var _0x8523=function(_0x3d36a7,_0x52edc3){_0x3d36a7=_0x3d36a7-0x0;var _0x20b870=_0x5238[_0x3d36a7];return _0x20b870;};'use strict';var asr=require(_0x8523('0x0'));module[_0x8523('0x1')]=function(_0x1890e5,_0x59f08a,_0x5c409f,_0x272781){return asr(_0x1890e5,_0x59f08a,_0x5c409f);}; \ No newline at end of file +var _0x84be=['./lib/api','exports'];(function(_0x22ad70,_0x9a00d0){var _0x49a4f3=function(_0x4a7fed){while(--_0x4a7fed){_0x22ad70['push'](_0x22ad70['shift']());}};_0x49a4f3(++_0x9a00d0);}(_0x84be,0xe2));var _0xe84b=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x84be[_0x4709c0];return _0x13348b;};'use strict';var asr=require(_0xe84b('0x0'));module[_0xe84b('0x1')]=function(_0x36481f,_0x556cd2,_0x5686c7,_0x48b215){return asr(_0x36481f,_0x556cd2,_0x5686c7);}; \ 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 e0c63c9..d957024 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 _0x0eaa=['LINEAR16','8000','url','bluebird','string','length','undefined','readFileSync','toString','base64','POST'];(function(_0x56e0e8,_0x16ef91){var _0x2dab50=function(_0x4fe720){while(--_0x4fe720){_0x56e0e8['push'](_0x56e0e8['shift']());}};_0x2dab50(++_0x16ef91);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x2b5e91,_0x49d024){_0x2b5e91=_0x2b5e91-0x0;var _0x33cfce=_0x0eaa[_0x2b5e91];return _0x33cfce;};'use strict';var url=require(_0xa0ea('0x0'));var BPromise=require(_0xa0ea('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x17efb8,_0x1fe195,_0x5800e9){return new BPromise(function(_0x1dca77,_0x1c74b8){var _0x30dd52;if(typeof _0x17efb8!==_0xa0ea('0x2')||_0x17efb8[_0xa0ea('0x3')]===0x0){return _0x1c74b8('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x1fe195!==_0xa0ea('0x2')||_0x1fe195['length']===0x0){return _0x1c74b8('key\x20should\x20be\x20a\x20string');}if(typeof _0x5800e9!==_0xa0ea('0x4')&&(typeof _0x5800e9!==_0xa0ea('0x2')||_0x5800e9['length']===0x0)){return _0x1c74b8('lang\x20should\x20be\x20a\x20string');}try{_0x30dd52=fs[_0xa0ea('0x5')](_0x17efb8)[_0xa0ea('0x6')](_0xa0ea('0x7'));}catch(_0x309f0b){return _0x1c74b8(_0x309f0b);}return _0x1dca77({'method':_0xa0ea('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x1fe195,'body':{'config':{'encoding':_0xa0ea('0x9'),'sampleRateHertz':_0xa0ea('0xa'),'languageCode':_0x5800e9},'audio':{'content':_0x30dd52}},'json':!![]});});}; \ No newline at end of file +var _0x8f37=['base64','POST','/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com','length','string','undefined','lang\x20should\x20be\x20a\x20string','toString'];(function(_0x2847d0,_0x10a787){var _0x1cc209=function(_0x3863ff){while(--_0x3863ff){_0x2847d0['push'](_0x2847d0['shift']());}};_0x1cc209(++_0x10a787);}(_0x8f37,0x190));var _0x78f3=function(_0x19afbb,_0x52fdc7){_0x19afbb=_0x19afbb-0x0;var _0x4855c3=_0x8f37[_0x19afbb];return _0x4855c3;};'use strict';var url=require(_0x78f3('0x0'));var BPromise=require(_0x78f3('0x1'));var fs=require('fs');var host=_0x78f3('0x2');module['exports']=function(_0x542bc0,_0x2a7d93,_0x3c1fa6){return new BPromise(function(_0x3b0667,_0x539794){var _0x1d59a5;if(typeof _0x542bc0!=='string'||_0x542bc0[_0x78f3('0x3')]===0x0){return _0x539794('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x2a7d93!==_0x78f3('0x4')||_0x2a7d93[_0x78f3('0x3')]===0x0){return _0x539794('key\x20should\x20be\x20a\x20string');}if(typeof _0x3c1fa6!==_0x78f3('0x5')&&(typeof _0x3c1fa6!=='string'||_0x3c1fa6[_0x78f3('0x3')]===0x0)){return _0x539794(_0x78f3('0x6'));}try{_0x1d59a5=fs['readFileSync'](_0x542bc0)[_0x78f3('0x7')](_0x78f3('0x8'));}catch(_0x268525){return _0x539794(_0x268525);}return _0x3b0667({'method':_0x78f3('0x9'),'uri':host+_0x78f3('0xa')+_0x2a7d93,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x78f3('0xb'),'languageCode':_0x3c1fa6},'audio':{'content':_0x1d59a5}},'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 726c768..8a774dc 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 _0xfc1b=['./asr','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xfc1b,0xc0));var _0xbfc1=function(_0x493f58,_0x5335ee){_0x493f58=_0x493f58-0x0;var _0x1906f8=_0xfc1b[_0x493f58];return _0x1906f8;};var asr=require(_0xbfc1('0x0'));module[_0xbfc1('0x1')]={'asr':asr}; \ No newline at end of file +var _0x5aa5=['./asr','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5aa5,0x102));var _0x55aa=function(_0x1f4871,_0x297a7e){_0x1f4871=_0x1f4871-0x0;var _0xaa7a4a=_0x5aa5[_0x1f4871];return _0xaa7a4a;};var asr=require(_0x55aa('0x0'));module[_0x55aa('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 51aa98a..27eb5eb 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 _0x06f0=['../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','error','unlink','pipe','end','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','generate','writeFileSync','chmodSync','777','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','then','.mp3','audioContent','tmp','.wav','googleCloudTTS\x20path','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','data','length','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','join','confidence','catch','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','isFallback','responseId','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','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','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','https','md5','querystring','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','./tilde'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x06f0,0x18e));var _0x006f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06f0[_0x3dd15e];return _0x231fd0;};'use strict';var apiai=require(_0x006f('0x0'));var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0x006f('0x1'));var md5=require(_0x006f('0x2'));var path=require('path');var querystring=require(_0x006f('0x3'));var rp=require('request-promise');var rs=require(_0x006f('0x4'));var sox=require(_0x006f('0x5'));var tts=require(_0x006f('0x6'));var urlParse=require('url')[_0x006f('0x7')];var util=require(_0x006f('0x8'));var aws=require(_0x006f('0x9'));var google=require(_0x006f('0xa'));var sestek=require(_0x006f('0xb'));var tilde=require(_0x006f('0xc'));var logger=require(_0x006f('0xd'))(_0x006f('0xe'));var ISPEECH_API=_0x006f('0xf');function downloadFile(_0x3778fb,_0x37eab3){return new BPromise(function(_0x2d977f,_0x501b94){var _0x4b2b9f=urlParse(_0x3778fb);var _0x33cbaa=_0x4b2b9f[_0x006f('0x10')]===_0x006f('0x11')?https:http;var _0x359a5f={'host':_0x4b2b9f[_0x006f('0x12')],'path':_0x4b2b9f[_0x006f('0x13')],'headers':{'user-agent':_0x006f('0x14')}};_0x33cbaa[_0x006f('0x15')](_0x359a5f,function(_0x4fa7ad){if(_0x4fa7ad[_0x006f('0x16')]!==0xc8){logger['error'](_0x006f('0x17')+_0x3778fb+_0x006f('0x18')+_0x4fa7ad[_0x006f('0x16')]+'\x20('+_0x4fa7ad[_0x006f('0x19')]+')');_0x501b94(new Error(_0x006f('0x17')+_0x3778fb+_0x006f('0x18')+_0x4fa7ad[_0x006f('0x16')]+'\x20('+_0x4fa7ad['statusMessage']+')'));return;}var _0x37a353=fs[_0x006f('0x1a')](_0x37eab3);_0x37a353['on']('finish',function(){logger[_0x006f('0x1b')](_0x006f('0x1c'));_0x37a353[_0x006f('0x1d')](_0x2d977f);});_0x37a353['on'](_0x006f('0x1e'),function(_0x28bb3e){fs[_0x006f('0x1f')](_0x37eab3);logger[_0x006f('0x1e')]('download\x20error',_0x28bb3e);_0x501b94(_0x28bb3e);});_0x4fa7ad[_0x006f('0x20')](_0x37a353);})['on'](_0x006f('0x1e'),function(_0x32c6c2){logger[_0x006f('0x1e')](_0x32c6c2);_0x501b94(_0x32c6c2);})[_0x006f('0x21')]();});}function uploadFile(_0x24df26){return new BPromise(function(_0x5e290b,_0x4a8fd4){var _0x164705=urlParse(_0x24df26);var _0x21cd8b=_0x164705['protocol']==='https:'?https:http;var _0xfe0221={'host':_0x164705['host'],'path':_0x164705['path'],'headers':{'user-agent':_0x006f('0x14')}};_0x21cd8b[_0x006f('0x15')](_0xfe0221,function(_0x15f370){if(_0x15f370[_0x006f('0x16')]!==0xc8){_0x4a8fd4(new Error(_0x006f('0x17')+_0x24df26+_0x006f('0x18')+_0x15f370['statusCode']+'\x20('+_0x15f370[_0x006f('0x19')]+')'));return;}var _0x3b8ba1='';_0x15f370['on']('data',function(_0x5ee69c){_0x3b8ba1+=_0x5ee69c;});_0x15f370['on'](_0x006f('0x21'),function(){_0x5e290b(_0x3b8ba1);});})['on'](_0x006f('0x1e'),function(_0x3a2b3f){_0x4a8fd4(_0x3a2b3f);})['end']();});}function convertFile(_0x1ea52b,_0x399fee){return new BPromise(function(_0x33b369,_0x44192e){var _0x2e492b=sox[_0x006f('0x22')](_0x1ea52b,_0x399fee,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2e492b['on']('error',function(_0x1b4f5c){logger[_0x006f('0x1e')](_0x006f('0x23'),_0x1b4f5c);_0x44192e(_0x1b4f5c);});_0x2e492b['on'](_0x006f('0x21'),function(){logger['info'](_0x006f('0x24'));_0x33b369();});_0x2e492b[_0x006f('0x25')]();});}function base64Decode(_0x273906,_0x2dc6a3){var _0x45334c=path[_0x006f('0x26')](__dirname,'tmp',rs[_0x006f('0x27')](0x4)+'.wav');fs[_0x006f('0x28')](_0x45334c,_0x273906,'base64');return convertFile(_0x45334c,_0x2dc6a3)['then'](function(){try{fs[_0x006f('0x1f')](_0x45334c);fs[_0x006f('0x29')](_0x2dc6a3,_0x006f('0x2a'));}catch(_0x3593ce){logger['error'](_0x3593ce);}return _0x2dc6a3['split']('.')[0x0];});}function base64Encode(_0xacb3c5){var _0x373a3b=fs[_0x006f('0x2b')](_0xacb3c5);return new Buffer(_0x373a3b)[_0x006f('0x2c')](_0x006f('0x2d'));}exports[_0x006f('0x2e')]=function(_0x4d224e,_0x209159,_0x4713e2,_0x35c699,_0x3678cb,_0x510e16){var _0x54fe73,_0x336118;var _0x378910=_0x006f('0x2f');var _0x73a8bb=_0x006f('0x30')+_0x4d224e;var _0x494fad={};if(_0x209159===_0x006f('0x31')){_0x494fad[_0x006f('0x32')]={'ssml':_0x4713e2};}else{_0x494fad[_0x006f('0x32')]={'text':_0x4713e2};};_0x494fad[_0x006f('0x33')]={'languageCode':_0x35c699,'ssmlGender':_0x3678cb};_0x494fad[_0x006f('0x34')]={'audioEncoding':_0x006f('0x35'),'sampleRateHertz':0x1f40};var _0x5c97c6={'url':_0x378910+_0x006f('0x36')+_0x73a8bb,'method':'POST','json':!![],'body':_0x494fad};return rp(_0x5c97c6)[_0x006f('0x37')](function(_0x37b12f){return new BPromise(function(_0x35075a,_0x5910bd){_0x54fe73=path[_0x006f('0x26')](__dirname,'tmp',rs[_0x006f('0x27')](0x4)+_0x006f('0x38'));var _0x27ef9d=Buffer['from'](_0x37b12f[_0x006f('0x39')],'base64');return fs['writeFile'](_0x54fe73,_0x27ef9d,function(_0x1ae303){_0x5910bd(_0x1ae303);},function(_0x4970c8){fs[_0x006f('0x29')](_0x54fe73,_0x006f('0x2a'));_0x35075a(_0x4970c8);});});})[_0x006f('0x37')](function(_0x1171fc){_0x336118=path['resolve'](__dirname,_0x006f('0x3a'),rs[_0x006f('0x27')](0x4)+_0x006f('0x3b'));return convertFile(_0x54fe73,_0x336118);})['then'](function(){try{fs[_0x006f('0x1f')](_0x54fe73);fs['chmodSync'](_0x336118,_0x006f('0x2a'));}catch(_0x2a286e){logger[_0x006f('0x1e')](_0x2a286e);}logger['info'](_0x006f('0x3c'),_0x336118[_0x006f('0x3d')]('.')[0x0]);return _0x336118[_0x006f('0x3d')]('.')[0x0];});};exports['googleTTS']=function(_0xa04cf0,_0xc0ee7a){var _0x24a8f6=_0x006f('0x3e');var _0x284676,_0x4ed6be;var _0x4509e2;var _0x3a0288={'encoding':_0x006f('0x3f'),'method':'POST','timeout':0x2710,'url':_0x24a8f6,'headers':{'Content-Type':_0x006f('0x40')},'body':'f.req='+encodeURIComponent(JSON[_0x006f('0x41')]([[[_0x006f('0x42'),JSON['stringify']([_0xa04cf0,_0xc0ee7a||'en',![],_0x006f('0x43')]),null,_0x006f('0x44')]]]))};return rp(_0x3a0288)[_0x006f('0x37')](function(_0x4493b0){try{_0x4509e2=eval(_0x4493b0[_0x006f('0x45')](0x5))[0x0][0x2];}catch(_0x17b014){throw new Error('parse\x20response\x20failed:\x0a'+_0x4493b0[_0x006f('0x46')]);}if(!_0x4509e2){if(_0xa04cf0[_0x006f('0x47')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x006f('0x48')+_0xc0ee7a+_0x006f('0x49'));}}try{_0x4509e2=eval(_0x4509e2)[0x0];}catch(_0x5a24c6){throw new Error(_0x006f('0x4a')+res[_0x006f('0x46')]);}const _0x44693d=_0x4509e2;_0x284676=path[_0x006f('0x26')](__dirname,_0x006f('0x3a'),rs[_0x006f('0x27')](0x4)+_0x006f('0x38'));fs[_0x006f('0x28')](_0x284676,_0x4509e2,{'encoding':_0x006f('0x2d')});_0x4ed6be=path['resolve'](__dirname,_0x006f('0x3a'),rs[_0x006f('0x27')](0x4)+'.wav');return convertFile(_0x284676,_0x4ed6be);})[_0x006f('0x37')](function(){try{fs[_0x006f('0x1f')](_0x284676);fs[_0x006f('0x29')](_0x4ed6be,_0x006f('0x2a'));}catch(_0x57d264){logger['error'](_0x57d264);}logger[_0x006f('0x1b')](_0x006f('0x4b'),_0x4ed6be[_0x006f('0x3d')]('.')[0x0]);return _0x4ed6be[_0x006f('0x3d')]('.')[0x0];});};exports[_0x006f('0x4c')]=function(_0x1e3c2f,_0x464961,_0x24c92b){return google['asr'](_0x1e3c2f,_0x464961,_0x24c92b)[_0x006f('0x37')](function(_0x36a907){logger[_0x006f('0x1b')](_0x36a907[_0x006f('0x4d')]);return rp(_0x36a907);})[_0x006f('0x37')](function(_0x2f3f73){var _0x4e0d65='';var _0x44f7c0=0x0;try{fs[_0x006f('0x1f')](_0x1e3c2f);}catch(_0x4bbbb8){logger[_0x006f('0x1e')](_0x4bbbb8);}if(_0x2f3f73&&_0x2f3f73[_0x006f('0x4e')]){_0x4e0d65=_0x2f3f73[_0x006f('0x4e')][_0x006f('0x4f')](function(_0x4a0f16){return _0x4a0f16&&_0x4a0f16[_0x006f('0x50')][0x0]&&_0x4a0f16[_0x006f('0x50')][0x0][_0x006f('0x51')]?_0x4a0f16[_0x006f('0x50')][0x0][_0x006f('0x51')]:'';})[_0x006f('0x52')]('\x0a');_0x44f7c0=_0x2f3f73[_0x006f('0x4e')][_0x006f('0x4f')](function(_0x450589){return _0x450589&&_0x450589[_0x006f('0x50')][0x0]&&_0x450589[_0x006f('0x50')][0x0][_0x006f('0x53')]?_0x450589['alternatives'][0x0]['confidence']:0x0;})[_0x006f('0x52')]('\x0a');}logger[_0x006f('0x1b')]('googleASR\x20transcription',_0x4e0d65);logger[_0x006f('0x1b')]('googleASR\x20confidence',_0x44f7c0);return{'transcript':_0x4e0d65,'confidence':_0x44f7c0};})[_0x006f('0x54')](function(_0x3df798){logger[_0x006f('0x1e')]('[%s]\x20%s:%s',_0x3df798[_0x006f('0x16')],_0x3df798['name'],_0x3df798['message']);});};exports[_0x006f('0x55')]=function(_0x1c88c8,_0x332a43,_0xbf45e8,_0x439825){var _0x1ce70b=apiai(_0x332a43,{'language':_0x439825||'en'});return _0x1ce70b[_0x006f('0x56')](_0xbf45e8,{'sessionId':md5(_0x1c88c8)})[_0x006f('0x37')](function(_0x3b85de){logger[_0x006f('0x1b')](JSON[_0x006f('0x41')](_0x3b85de));return{'source':_0x3b85de[_0x006f('0x57')][_0x006f('0x58')],'resolvedQuery':_0x3b85de[_0x006f('0x57')][_0x006f('0x59')],'action':_0x3b85de[_0x006f('0x57')][_0x006f('0x5a')],'actionIncomplete':_0x3b85de[_0x006f('0x57')][_0x006f('0x5b')],'speech':_0x3b85de['result'][_0x006f('0x5c')]['speech'],'score':_0x3b85de[_0x006f('0x57')][_0x006f('0x5d')],'statusCode':_0x3b85de[_0x006f('0x5e')][_0x006f('0x5f')],'endConversation':_0x3b85de[_0x006f('0x57')][_0x006f('0x60')][_0x006f('0x61')]||![],'isFallbackIntent':_0x3b85de['result'][_0x006f('0x60')][_0x006f('0x62')]};});};exports[_0x006f('0x63')]=function(_0x5a7381,_0x16249b,_0x2024b9,_0x1dc4b7,_0x531beb,_0x29e1bf){var _0x44eb39=_0x1dc4b7['replace'](/\\n/g,'\x0a');var _0x1f7c59={'credentials':{'private_key':_0x44eb39,'client_email':_0x2024b9}};var _0x55745f=new dialogflow[(_0x006f('0x64'))](_0x1f7c59);var _0x1bd46f=_0x55745f['sessionPath'](_0x16249b,md5(_0x5a7381));var _0x53d074={'session':_0x1bd46f,'queryInput':{'text':{'text':_0x531beb,'languageCode':_0x29e1bf}}};return _0x55745f[_0x006f('0x65')](_0x53d074)[_0x006f('0x37')](function(_0x5b4f5d){if(_0x5b4f5d&&_0x5b4f5d[_0x006f('0x47')]){logger[_0x006f('0x1b')](_0x006f('0x66'),JSON[_0x006f('0x41')](_0x5b4f5d));var _0x787ef3=_0x5b4f5d[0x0];if(_0x787ef3){var _0x55afe3={'action':_0x787ef3[_0x006f('0x67')]['action'],'allRequiredParamsPresent':_0x787ef3[_0x006f('0x67')][_0x006f('0x68')],'endConversation':_0x787ef3['queryResult'][_0x006f('0x69')]&&_0x787ef3['queryResult'][_0x006f('0x69')][_0x006f('0x6a')]?_0x787ef3['queryResult'][_0x006f('0x69')][_0x006f('0x6a')][_0x006f('0x6b')][_0x006f('0x6c')]:![],'fulfillmentText':_0x787ef3['queryResult'][_0x006f('0x6d')],'intentName':_0x787ef3[_0x006f('0x67')][_0x006f('0x6e')][_0x006f('0x6f')],'intentDisplayName':_0x787ef3['queryResult']['intent'][_0x006f('0x70')],'isFallbackIntent':_0x787ef3[_0x006f('0x67')][_0x006f('0x6e')][_0x006f('0x71')],'languageCode':_0x787ef3[_0x006f('0x67')]['languageCode'],'queryText':_0x787ef3['queryResult']['queryText'],'responseId':_0x787ef3[_0x006f('0x72')],'score':_0x787ef3[_0x006f('0x67')]['intentDetectionConfidence'],'speech':_0x787ef3['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x006f('0x41')](_0x5b4f5d)};return _0x55afe3;}}});};exports['tildeASR']=function(_0x10b5e6,_0x3aa9c4,_0x4068f4,_0x409fc1){return tilde[_0x006f('0x73')](_0x10b5e6,_0x3aa9c4,_0x4068f4,_0x409fc1)[_0x006f('0x37')](function(_0x318a4f){try{fs[_0x006f('0x1f')](_0x10b5e6);}catch(_0xe84128){logger[_0x006f('0x1e')](_0xe84128);}logger[_0x006f('0x1b')](_0x006f('0x74'),_0x318a4f[_0x006f('0x51')]);logger[_0x006f('0x1b')](_0x006f('0x75'),_0x318a4f[_0x006f('0x53')]);return _0x318a4f;});};exports[_0x006f('0x76')]=function(_0x471544,_0x5914ab,_0x431a38,_0x466c53,_0x533ebb,_0x53c3e7){var _0xdaaec0=path[_0x006f('0x26')](__dirname,_0x006f('0x3a'),rs['generate'](0x4)+_0x006f('0x38'));var _0x4797d8;return aws[_0x006f('0x77')](_0x471544,_0x5914ab,_0x431a38,_0x466c53,_0x533ebb,_0x53c3e7,_0xdaaec0)[_0x006f('0x37')](function(){_0x4797d8=path[_0x006f('0x26')](__dirname,_0x006f('0x3a'),rs[_0x006f('0x27')](0x4)+_0x006f('0x3b'));return convertFile(_0xdaaec0,_0x4797d8);})['then'](function(){try{fs['unlink'](_0xdaaec0);fs['chmodSync'](_0x4797d8,'777');}catch(_0x4a4596){logger[_0x006f('0x1e')](_0x4a4596);}return _0x4797d8['split']('.')[0x0];});};exports[_0x006f('0x78')]=function(_0x3c6706,_0x964503,_0x21d724,_0x550c0f,_0x531a5a,_0x1db7b5){return aws[_0x006f('0x79')](_0x3c6706,_0x964503,_0x21d724,_0x550c0f,_0x531a5a,_0x1db7b5)[_0x006f('0x37')](function(_0x12cb3b){logger[_0x006f('0x1b')](JSON['stringify'](_0x12cb3b));return _0x12cb3b;});};exports[_0x006f('0x7a')]=function(_0x5ae0a7,_0x17e12b,_0x575ce5,_0x3d7cd5){var _0x2c6068=util[_0x006f('0x7b')](_0x006f('0x7c'),ISPEECH_API,_0x5ae0a7,encodeURIComponent(_0x17e12b),_0x575ce5,_0x3d7cd5);var _0x1506ac=path[_0x006f('0x26')](__dirname,_0x006f('0x3a'),rs[_0x006f('0x27')](0x4)+_0x006f('0x38'));var _0x3dfd1b;return downloadFile(_0x2c6068,_0x1506ac)[_0x006f('0x37')](function(){_0x3dfd1b=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0x1506ac,_0x3dfd1b);})['then'](function(){try{fs['unlink'](_0x1506ac);fs[_0x006f('0x29')](_0x3dfd1b,_0x006f('0x2a'));}catch(_0x5623ef){logger['error'](_0x5623ef);}return _0x3dfd1b[_0x006f('0x3d')]('.')[0x0];});};exports[_0x006f('0x7d')]=function(_0x41445a,_0x3411e5,_0xee1760,_0x3049dc){var _0x197fd3=util[_0x006f('0x7b')](_0x006f('0x7e'),ISPEECH_API,_0x3411e5,_0xee1760,base64Encode(_0x41445a),_0x3049dc?util[_0x006f('0x7b')]('model=%s',encodeURIComponent(_0x3049dc)):_0x006f('0x7f'));return uploadFile(_0x197fd3)[_0x006f('0x37')](function(_0x3b4aa3){return querystring[_0x006f('0x7')](_0x3b4aa3);});};exports[_0x006f('0x80')]=function(_0x3fb5b2,_0x173615){return sestek[_0x006f('0x81')](_0x3fb5b2,_0x173615)['then'](function(_0x17c854){logger[_0x006f('0x1b')](JSON[_0x006f('0x41')](_0x17c854));var _0x3b1348={'speech':_0x17c854[_0x006f('0x82')],'action':_0x17c854[_0x006f('0x83')]?_0x17c854[_0x006f('0x83')][_0x006f('0x84')]:undefined,'actiondata':_0x17c854[_0x006f('0x83')]?_0x17c854['channelData'][_0x006f('0x85')]:undefined};if(_0x17c854[_0x006f('0x83')]&&_0x17c854['channelData'][_0x006f('0x86')]){return base64Decode(_0x17c854[_0x006f('0x83')]['AudioFromTts'][_0x006f('0x87')],path[_0x006f('0x26')](__dirname,_0x006f('0x3a'),rs['generate'](0x4)+_0x006f('0x3b')))[_0x006f('0x37')](function(_0x52fb51){_0x3b1348[_0x006f('0x88')]=_0x52fb51;return _0x3b1348;});}return _0x3b1348;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x6e44=['fulfillment','score','code','endConversation','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','action','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','get','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','finish','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','WHAT_EVER','data','wav','error\x20convert','finish\x20to\x20convert','start','.wav','writeFileSync','base64','then','chmodSync','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','text:synthesize','POST','generate','.mp3','from','audioContent','resolve','tmp','googleCloudTTS\x20path','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','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','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','map','confidence','join','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','resolvedQuery','result','actionIncomplete'];(function(_0x3ac882,_0x370ae4){var _0x505c4c=function(_0x2abd9c){while(--_0x2abd9c){_0x3ac882['push'](_0x3ac882['shift']());}};_0x505c4c(++_0x370ae4);}(_0x6e44,0xb2));var _0x46e4=function(_0x2594e0,_0x1ee198){_0x2594e0=_0x2594e0-0x0;var _0x1eadb9=_0x6e44[_0x2594e0];return _0x1eadb9;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x46e4('0x0'));var https=require(_0x46e4('0x1'));var md5=require(_0x46e4('0x2'));var path=require(_0x46e4('0x3'));var querystring=require(_0x46e4('0x4'));var rp=require(_0x46e4('0x5'));var rs=require(_0x46e4('0x6'));var sox=require(_0x46e4('0x7'));var tts=require(_0x46e4('0x8'));var urlParse=require('url')[_0x46e4('0x9')];var util=require('util');var aws=require(_0x46e4('0xa'));var google=require(_0x46e4('0xb'));var sestek=require(_0x46e4('0xc'));var tilde=require(_0x46e4('0xd'));var logger=require(_0x46e4('0xe'))(_0x46e4('0xf'));var ISPEECH_API=_0x46e4('0x10');function downloadFile(_0x58d037,_0x504500){return new BPromise(function(_0x19f363,_0x249c22){var _0x289e55=urlParse(_0x58d037);var _0x54831b=_0x289e55['protocol']===_0x46e4('0x11')?https:http;var _0x1eb37d={'host':_0x289e55[_0x46e4('0x12')],'path':_0x289e55[_0x46e4('0x3')],'headers':{'user-agent':'WHAT_EVER'}};_0x54831b[_0x46e4('0x13')](_0x1eb37d,function(_0x148a56){if(_0x148a56['statusCode']!==0xc8){logger['error'](_0x46e4('0x14')+_0x58d037+_0x46e4('0x15')+_0x148a56[_0x46e4('0x16')]+'\x20('+_0x148a56[_0x46e4('0x17')]+')');_0x249c22(new Error(_0x46e4('0x14')+_0x58d037+_0x46e4('0x15')+_0x148a56[_0x46e4('0x16')]+'\x20('+_0x148a56[_0x46e4('0x17')]+')'));return;}var _0x232710=fs['createWriteStream'](_0x504500);_0x232710['on'](_0x46e4('0x18'),function(){logger[_0x46e4('0x19')](_0x46e4('0x1a'));_0x232710['close'](_0x19f363);});_0x232710['on'](_0x46e4('0x1b'),function(_0x2b40c1){fs[_0x46e4('0x1c')](_0x504500);logger[_0x46e4('0x1b')](_0x46e4('0x1d'),_0x2b40c1);_0x249c22(_0x2b40c1);});_0x148a56[_0x46e4('0x1e')](_0x232710);})['on']('error',function(_0x1128ba){logger[_0x46e4('0x1b')](_0x1128ba);_0x249c22(_0x1128ba);})[_0x46e4('0x1f')]();});}function uploadFile(_0x48df90){return new BPromise(function(_0x467a03,_0x12fb59){var _0x21a3f2=urlParse(_0x48df90);var _0x5854df=_0x21a3f2[_0x46e4('0x20')]===_0x46e4('0x11')?https:http;var _0x2c757b={'host':_0x21a3f2[_0x46e4('0x12')],'path':_0x21a3f2[_0x46e4('0x3')],'headers':{'user-agent':_0x46e4('0x21')}};_0x5854df[_0x46e4('0x13')](_0x2c757b,function(_0xa4cf0e){if(_0xa4cf0e[_0x46e4('0x16')]!==0xc8){_0x12fb59(new Error(_0x46e4('0x14')+_0x48df90+_0x46e4('0x15')+_0xa4cf0e['statusCode']+'\x20('+_0xa4cf0e[_0x46e4('0x17')]+')'));return;}var _0x4f105c='';_0xa4cf0e['on'](_0x46e4('0x22'),function(_0x422eb0){_0x4f105c+=_0x422eb0;});_0xa4cf0e['on'](_0x46e4('0x1f'),function(){_0x467a03(_0x4f105c);});})['on'](_0x46e4('0x1b'),function(_0x33dfba){_0x12fb59(_0x33dfba);})[_0x46e4('0x1f')]();});}function convertFile(_0xcd1a6c,_0x50db2a){return new BPromise(function(_0x3fdd5e,_0x851e66){var _0x118431=sox['transcode'](_0xcd1a6c,_0x50db2a,{'sampleRate':0x1f40,'format':_0x46e4('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x118431['on'](_0x46e4('0x1b'),function(_0x4a8171){logger[_0x46e4('0x1b')](_0x46e4('0x24'),_0x4a8171);_0x851e66(_0x4a8171);});_0x118431['on']('end',function(){logger[_0x46e4('0x19')](_0x46e4('0x25'));_0x3fdd5e();});_0x118431[_0x46e4('0x26')]();});}function base64Decode(_0x379d5e,_0x37d375){var _0x1977f9=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x46e4('0x27'));fs[_0x46e4('0x28')](_0x1977f9,_0x379d5e,_0x46e4('0x29'));return convertFile(_0x1977f9,_0x37d375)[_0x46e4('0x2a')](function(){try{fs[_0x46e4('0x1c')](_0x1977f9);fs[_0x46e4('0x2b')](_0x37d375,_0x46e4('0x2c'));}catch(_0x5da4bf){logger['error'](_0x5da4bf);}return _0x37d375['split']('.')[0x0];});}function base64Encode(_0x240fc2){var _0x214f32=fs[_0x46e4('0x2d')](_0x240fc2);return new Buffer(_0x214f32)[_0x46e4('0x2e')](_0x46e4('0x29'));}exports[_0x46e4('0x2f')]=function(_0x3011e2,_0x34918a,_0x30449e,_0x3fd37b,_0x3a07c8,_0x2af84d){var _0xf6111b,_0x3c8fd3;var _0x5f57de=_0x46e4('0x30');var _0x524cbe=_0x46e4('0x31')+_0x3011e2;var _0x10a8e5={};if(_0x34918a===_0x46e4('0x32')){_0x10a8e5[_0x46e4('0x33')]={'ssml':_0x30449e};}else{_0x10a8e5[_0x46e4('0x33')]={'text':_0x30449e};};_0x10a8e5['voice']={'languageCode':_0x3fd37b,'ssmlGender':_0x3a07c8};_0x10a8e5['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x1a4365={'url':_0x5f57de+_0x46e4('0x34')+_0x524cbe,'method':_0x46e4('0x35'),'json':!![],'body':_0x10a8e5};return rp(_0x1a4365)['then'](function(_0x29605b){return new BPromise(function(_0x3003dc,_0x37a42d){_0xf6111b=path['resolve'](__dirname,'tmp',rs[_0x46e4('0x36')](0x4)+_0x46e4('0x37'));var _0x5d771e=Buffer[_0x46e4('0x38')](_0x29605b[_0x46e4('0x39')],_0x46e4('0x29'));return fs['writeFile'](_0xf6111b,_0x5d771e,function(_0x4720da){_0x37a42d(_0x4720da);},function(_0x55d8cd){fs[_0x46e4('0x2b')](_0xf6111b,'777');_0x3003dc(_0x55d8cd);});});})[_0x46e4('0x2a')](function(_0x353b80){_0x3c8fd3=path[_0x46e4('0x3a')](__dirname,_0x46e4('0x3b'),rs['generate'](0x4)+_0x46e4('0x27'));return convertFile(_0xf6111b,_0x3c8fd3);})[_0x46e4('0x2a')](function(){try{fs[_0x46e4('0x1c')](_0xf6111b);fs['chmodSync'](_0x3c8fd3,_0x46e4('0x2c'));}catch(_0x4b73bc){logger['error'](_0x4b73bc);}logger[_0x46e4('0x19')](_0x46e4('0x3c'),_0x3c8fd3[_0x46e4('0x3d')]('.')[0x0]);return _0x3c8fd3['split']('.')[0x0];});};exports['googleTTS']=function(_0x2063cb,_0x553a3a){var _0x356dae=_0x46e4('0x3e');var _0x4e3366,_0x18300a;var _0x32925;var _0x46fbca={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x356dae,'headers':{'Content-Type':_0x46e4('0x3f')},'body':_0x46e4('0x40')+encodeURIComponent(JSON[_0x46e4('0x41')]([[[_0x46e4('0x42'),JSON[_0x46e4('0x41')]([_0x2063cb,_0x553a3a||'en',![],_0x46e4('0x43')]),null,'generic']]]))};return rp(_0x46fbca)[_0x46e4('0x2a')](function(_0x57f48d){try{_0x32925=eval(_0x57f48d[_0x46e4('0x44')](0x5))[0x0][0x2];}catch(_0x18abaa){throw new Error(_0x46e4('0x45')+_0x57f48d[_0x46e4('0x22')]);}if(!_0x32925){if(_0x2063cb[_0x46e4('0x46')]>0xc8){throw new Error(_0x46e4('0x47'));}else{throw new Error(_0x46e4('0x48')+_0x553a3a+_0x46e4('0x49'));}}try{_0x32925=eval(_0x32925)[0x0];}catch(_0x7ebc3d){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x46e4('0x22')]);}const _0x2786a1=_0x32925;_0x4e3366=path[_0x46e4('0x3a')](__dirname,_0x46e4('0x3b'),rs[_0x46e4('0x36')](0x4)+'.mp3');fs[_0x46e4('0x28')](_0x4e3366,_0x32925,{'encoding':_0x46e4('0x29')});_0x18300a=path[_0x46e4('0x3a')](__dirname,'tmp',rs[_0x46e4('0x36')](0x4)+_0x46e4('0x27'));return convertFile(_0x4e3366,_0x18300a);})[_0x46e4('0x2a')](function(){try{fs['unlink'](_0x4e3366);fs[_0x46e4('0x2b')](_0x18300a,'777');}catch(_0x52a80e){logger[_0x46e4('0x1b')](_0x52a80e);}logger[_0x46e4('0x19')](_0x46e4('0x4a'),_0x18300a[_0x46e4('0x3d')]('.')[0x0]);return _0x18300a['split']('.')[0x0];});};exports[_0x46e4('0x4b')]=function(_0x4786ad,_0x3d3efd,_0x550e40){return google[_0x46e4('0x4c')](_0x4786ad,_0x3d3efd,_0x550e40)[_0x46e4('0x2a')](function(_0x44c5ea){logger[_0x46e4('0x19')](_0x44c5ea[_0x46e4('0x4d')]);return rp(_0x44c5ea);})['then'](function(_0x204c63){var _0x2c1f31='';var _0x40e0ae=0x0;try{fs['unlink'](_0x4786ad);}catch(_0x4f9903){logger[_0x46e4('0x1b')](_0x4f9903);}if(_0x204c63&&_0x204c63[_0x46e4('0x4e')]){_0x2c1f31=_0x204c63['results']['map'](function(_0x533f33){return _0x533f33&&_0x533f33[_0x46e4('0x4f')][0x0]&&_0x533f33[_0x46e4('0x4f')][0x0]['transcript']?_0x533f33[_0x46e4('0x4f')][0x0][_0x46e4('0x50')]:'';})['join']('\x0a');_0x40e0ae=_0x204c63[_0x46e4('0x4e')][_0x46e4('0x51')](function(_0x27f047){return _0x27f047&&_0x27f047[_0x46e4('0x4f')][0x0]&&_0x27f047[_0x46e4('0x4f')][0x0]['confidence']?_0x27f047[_0x46e4('0x4f')][0x0][_0x46e4('0x52')]:0x0;})[_0x46e4('0x53')]('\x0a');}logger[_0x46e4('0x19')](_0x46e4('0x54'),_0x2c1f31);logger[_0x46e4('0x19')](_0x46e4('0x55'),_0x40e0ae);return{'transcript':_0x2c1f31,'confidence':_0x40e0ae};})['catch'](function(_0x2bd23a){logger[_0x46e4('0x1b')](_0x46e4('0x56'),_0x2bd23a[_0x46e4('0x16')],_0x2bd23a[_0x46e4('0x57')],_0x2bd23a[_0x46e4('0x58')]);});};exports[_0x46e4('0x59')]=function(_0x486d40,_0x7068f0,_0x2ecdc1,_0x4e28ce){var _0x1a1a3a=apiai(_0x7068f0,{'language':_0x4e28ce||'en'});return _0x1a1a3a[_0x46e4('0x5a')](_0x2ecdc1,{'sessionId':md5(_0x486d40)})['then'](function(_0x1c8c94){logger['info'](JSON[_0x46e4('0x41')](_0x1c8c94));return{'source':_0x1c8c94['result']['source'],'resolvedQuery':_0x1c8c94['result'][_0x46e4('0x5b')],'action':_0x1c8c94[_0x46e4('0x5c')]['action'],'actionIncomplete':_0x1c8c94[_0x46e4('0x5c')][_0x46e4('0x5d')],'speech':_0x1c8c94[_0x46e4('0x5c')][_0x46e4('0x5e')]['speech'],'score':_0x1c8c94[_0x46e4('0x5c')][_0x46e4('0x5f')],'statusCode':_0x1c8c94['status'][_0x46e4('0x60')],'endConversation':_0x1c8c94['result']['metadata'][_0x46e4('0x61')]||![],'isFallbackIntent':_0x1c8c94[_0x46e4('0x5c')]['metadata']['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0xa53cbb,_0x15ddb0,_0xf8da19,_0x26c9a6,_0x3e09d7,_0x56b9e3){var _0x1b6258=_0x26c9a6[_0x46e4('0x62')](/\\n/g,'\x0a');var _0x5be43b={'credentials':{'private_key':_0x1b6258,'client_email':_0xf8da19}};var _0x3b8ed3=new dialogflow[(_0x46e4('0x63'))](_0x5be43b);var _0x1ce5de=_0x3b8ed3[_0x46e4('0x64')](_0x15ddb0,md5(_0xa53cbb));var _0x159c48={'session':_0x1ce5de,'queryInput':{'text':{'text':_0x3e09d7,'languageCode':_0x56b9e3}}};return _0x3b8ed3[_0x46e4('0x65')](_0x159c48)[_0x46e4('0x2a')](function(_0x572b14){if(_0x572b14&&_0x572b14['length']){logger[_0x46e4('0x19')](_0x46e4('0x66'),JSON['stringify'](_0x572b14));var _0x5be1ef=_0x572b14[0x0];if(_0x5be1ef){var _0x5492b6={'action':_0x5be1ef['queryResult'][_0x46e4('0x67')],'allRequiredParamsPresent':_0x5be1ef[_0x46e4('0x68')]['allRequiredParamsPresent'],'endConversation':_0x5be1ef[_0x46e4('0x68')]['diagnosticInfo']&&_0x5be1ef[_0x46e4('0x68')][_0x46e4('0x69')][_0x46e4('0x6a')]?_0x5be1ef[_0x46e4('0x68')][_0x46e4('0x69')]['fields'][_0x46e4('0x6b')][_0x46e4('0x6c')]:![],'fulfillmentText':_0x5be1ef[_0x46e4('0x68')][_0x46e4('0x6d')],'intentName':_0x5be1ef['queryResult'][_0x46e4('0x6e')][_0x46e4('0x57')],'intentDisplayName':_0x5be1ef[_0x46e4('0x68')][_0x46e4('0x6e')][_0x46e4('0x6f')],'isFallbackIntent':_0x5be1ef[_0x46e4('0x68')][_0x46e4('0x6e')][_0x46e4('0x70')],'languageCode':_0x5be1ef['queryResult']['languageCode'],'queryText':_0x5be1ef['queryResult'][_0x46e4('0x71')],'responseId':_0x5be1ef[_0x46e4('0x72')],'score':_0x5be1ef[_0x46e4('0x68')][_0x46e4('0x73')],'speech':_0x5be1ef['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x46e4('0x41')](_0x572b14)};return _0x5492b6;}}});};exports[_0x46e4('0x74')]=function(_0xad5200,_0x341fa8,_0x3d5d56,_0x50586c){return tilde[_0x46e4('0x4c')](_0xad5200,_0x341fa8,_0x3d5d56,_0x50586c)[_0x46e4('0x2a')](function(_0x1e4f54){try{fs[_0x46e4('0x1c')](_0xad5200);}catch(_0x6399c6){logger[_0x46e4('0x1b')](_0x6399c6);}logger[_0x46e4('0x19')](_0x46e4('0x75'),_0x1e4f54['transcript']);logger[_0x46e4('0x19')]('Tilde\x20ASR\x20confidence',_0x1e4f54[_0x46e4('0x52')]);return _0x1e4f54;});};exports[_0x46e4('0x76')]=function(_0x227f1c,_0x5f0797,_0x55a7d6,_0x5e490d,_0x246d01,_0x14f6fc){var _0xf5c67f=path[_0x46e4('0x3a')](__dirname,_0x46e4('0x3b'),rs['generate'](0x4)+_0x46e4('0x37'));var _0x12a9cd;return aws['polly'](_0x227f1c,_0x5f0797,_0x55a7d6,_0x5e490d,_0x246d01,_0x14f6fc,_0xf5c67f)[_0x46e4('0x2a')](function(){_0x12a9cd=path[_0x46e4('0x3a')](__dirname,'tmp',rs[_0x46e4('0x36')](0x4)+_0x46e4('0x27'));return convertFile(_0xf5c67f,_0x12a9cd);})[_0x46e4('0x2a')](function(){try{fs[_0x46e4('0x1c')](_0xf5c67f);fs[_0x46e4('0x2b')](_0x12a9cd,_0x46e4('0x2c'));}catch(_0x350f8b){logger['error'](_0x350f8b);}return _0x12a9cd[_0x46e4('0x3d')]('.')[0x0];});};exports[_0x46e4('0x77')]=function(_0x12427e,_0x221f73,_0x35c43f,_0x5425c7,_0x1d81b9,_0x6a2a34){return aws[_0x46e4('0x78')](_0x12427e,_0x221f73,_0x35c43f,_0x5425c7,_0x1d81b9,_0x6a2a34)['then'](function(_0x5c4d8e){logger[_0x46e4('0x19')](JSON[_0x46e4('0x41')](_0x5c4d8e));return _0x5c4d8e;});};exports['ispeechTTS']=function(_0x2db69b,_0x344ed2,_0x35b69e,_0x3b64db){var _0x5ee13d=util[_0x46e4('0x79')](_0x46e4('0x7a'),ISPEECH_API,_0x2db69b,encodeURIComponent(_0x344ed2),_0x35b69e,_0x3b64db);var _0x3e452d=path[_0x46e4('0x3a')](__dirname,_0x46e4('0x3b'),rs[_0x46e4('0x36')](0x4)+_0x46e4('0x37'));var _0xd7a775;return downloadFile(_0x5ee13d,_0x3e452d)[_0x46e4('0x2a')](function(){_0xd7a775=path[_0x46e4('0x3a')](__dirname,_0x46e4('0x3b'),rs[_0x46e4('0x36')](0x4)+_0x46e4('0x27'));return convertFile(_0x3e452d,_0xd7a775);})[_0x46e4('0x2a')](function(){try{fs[_0x46e4('0x1c')](_0x3e452d);fs[_0x46e4('0x2b')](_0xd7a775,'777');}catch(_0x253bef){logger[_0x46e4('0x1b')](_0x253bef);}return _0xd7a775[_0x46e4('0x3d')]('.')[0x0];});};exports[_0x46e4('0x7b')]=function(_0xc20e0b,_0x34af28,_0x304330,_0xd53f96){var _0x339f22=util[_0x46e4('0x79')](_0x46e4('0x7c'),ISPEECH_API,_0x34af28,_0x304330,base64Encode(_0xc20e0b),_0xd53f96?util['format'](_0x46e4('0x7d'),encodeURIComponent(_0xd53f96)):'freeform=3');return uploadFile(_0x339f22)['then'](function(_0x1d4522){return querystring[_0x46e4('0x9')](_0x1d4522);});};exports[_0x46e4('0x7e')]=function(_0x4062ca,_0x3100b2){return sestek[_0x46e4('0x7f')](_0x4062ca,_0x3100b2)[_0x46e4('0x2a')](function(_0x5de30f){logger[_0x46e4('0x19')](JSON[_0x46e4('0x41')](_0x5de30f));var _0x46e787={'speech':_0x5de30f[_0x46e4('0x80')],'action':_0x5de30f[_0x46e4('0x81')]?_0x5de30f['channelData'][_0x46e4('0x82')]:undefined,'actiondata':_0x5de30f[_0x46e4('0x81')]?_0x5de30f[_0x46e4('0x81')][_0x46e4('0x83')]:undefined};if(_0x5de30f[_0x46e4('0x81')]&&_0x5de30f['channelData']['AudioFromTts']){return base64Decode(_0x5de30f[_0x46e4('0x81')][_0x46e4('0x84')][_0x46e4('0x85')],path[_0x46e4('0x3a')](__dirname,'tmp',rs[_0x46e4('0x36')](0x4)+_0x46e4('0x27')))[_0x46e4('0x2a')](function(_0x49488d){_0x46e787[_0x46e4('0x86')]=_0x49488d;return _0x46e787;});}return _0x46e787;});};exports[_0x46e4('0x87')]=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 6748490..7911ad2 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 _0xd99d=['./nda'];(function(_0x4be7b1,_0x5e0be9){var _0x588327=function(_0x541c7b){while(--_0x541c7b){_0x4be7b1['push'](_0x4be7b1['shift']());}};_0x588327(++_0x5e0be9);}(_0xd99d,0x1e3));var _0xdd99=function(_0xf614fe,_0x34751a){_0xf614fe=_0xf614fe-0x0;var _0x283ab0=_0xd99d[_0xf614fe];return _0x283ab0;};var nda=require(_0xdd99('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0xa421=['exports'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xa421,0xb3));var _0x1a42=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xa421[_0x4e9628];return _0x27bc8c;};var nda=require('./nda');module[_0x1a42('0x0')]={'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 7f58df4..d857648 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 _0xd64b=['POST','username','password','then','resolve','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','Bearer\x20','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','../../../../../config/logger','exports'];(function(_0x170c23,_0x1fff6e){var _0x46eb81=function(_0x213ee4){while(--_0x213ee4){_0x170c23['push'](_0x170c23['shift']());}};_0x46eb81(++_0x1fff6e);}(_0xd64b,0xc1));var _0xbd64=function(_0x57182a,_0x1f0016){_0x57182a=_0x57182a-0x0;var _0x4fddc6=_0xd64b[_0x57182a];return _0x4fddc6;};'use strict';var rp=require(_0xbd64('0x0'));var url=require('url');var logger=require(_0xbd64('0x1'))('agi');module[_0xbd64('0x2')]=function(_0xcbecd5,_0x64bd3b){var _0x3f1f05={'method':_0xbd64('0x3'),'uri':url['resolve'](_0x64bd3b['ndauth_url'],'/token'),'form':{'grant_type':'password','username':_0x64bd3b[_0xbd64('0x4')],'password':_0x64bd3b[_0xbd64('0x5')]},'json':!![]};return rp(_0x3f1f05)[_0xbd64('0x6')](function(_0x38204e){var _0x3f1f17={'method':_0xbd64('0x3'),'uri':url[_0xbd64('0x7')](_0x64bd3b['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x64bd3b[_0xbd64('0x8')]||_0xbd64('0x9'),'channelId':_0xbd64('0xa'),'conversation':{'id':_0xcbecd5['uniqueid']},'from':{'id':_0xcbecd5[_0xbd64('0xb')],'name':_0xcbecd5[_0xbd64('0xc')]},'recipient':{'id':_0xcbecd5[_0xbd64('0xd')],'name':_0xcbecd5[_0xbd64('0xe')]},'text':_0x64bd3b['text'],'channelData':{}},'headers':{'Authorization':_0xbd64('0xf')+_0x38204e['access_token']},'json':!![]};if(_0x64bd3b[_0xbd64('0x10')]){_0x3f1f17[_0xbd64('0x11')][_0xbd64('0x12')][_0xbd64('0x13')]=_0x64bd3b[_0xbd64('0x10')];}if(_0x64bd3b[_0xbd64('0x14')]=='1'){_0x3f1f17[_0xbd64('0x11')][_0xbd64('0x12')][_0xbd64('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x64bd3b[_0xbd64('0x16')]){_0x3f1f17[_0xbd64('0x11')][_0xbd64('0x12')][_0xbd64('0x17')]=_0x64bd3b[_0xbd64('0x16')];if(_0x64bd3b['custom_action_data']){_0x3f1f17[_0xbd64('0x11')]['channelData'][_0xbd64('0x18')]=_0x64bd3b[_0xbd64('0x19')];}}logger[_0xbd64('0x1a')](JSON[_0xbd64('0x1b')](_0x3f1f17));return rp(_0x3f1f17);});}; \ No newline at end of file +var _0xf4dd=['Nda','uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','ndauth_url','password','resolve','ndassistant_url','ndaactivity_type','message'];(function(_0x41ffb8,_0x398477){var _0x291e07=function(_0x170a3e){while(--_0x170a3e){_0x41ffb8['push'](_0x41ffb8['shift']());}};_0x291e07(++_0x398477);}(_0xf4dd,0xb4));var _0xdf4d=function(_0x189aad,_0xc1007a){_0x189aad=_0x189aad-0x0;var _0x472674=_0xf4dd[_0x189aad];return _0x472674;};'use strict';var rp=require(_0xdf4d('0x0'));var url=require(_0xdf4d('0x1'));var logger=require(_0xdf4d('0x2'))(_0xdf4d('0x3'));module[_0xdf4d('0x4')]=function(_0x3f6a00,_0x309103){var _0x47d568={'method':_0xdf4d('0x5'),'uri':url['resolve'](_0x309103[_0xdf4d('0x6')],'/token'),'form':{'grant_type':_0xdf4d('0x7'),'username':_0x309103['username'],'password':_0x309103[_0xdf4d('0x7')]},'json':!![]};return rp(_0x47d568)['then'](function(_0x64c256){var _0x4a3e29={'method':_0xdf4d('0x5'),'uri':url[_0xdf4d('0x8')](_0x309103[_0xdf4d('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x309103[_0xdf4d('0xa')]||_0xdf4d('0xb'),'channelId':_0xdf4d('0xc'),'conversation':{'id':_0x3f6a00[_0xdf4d('0xd')]},'from':{'id':_0x3f6a00[_0xdf4d('0xe')],'name':_0x3f6a00[_0xdf4d('0xf')]},'recipient':{'id':_0x3f6a00[_0xdf4d('0x10')],'name':_0x3f6a00[_0xdf4d('0x11')]},'text':_0x309103[_0xdf4d('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x64c256[_0xdf4d('0x13')]},'json':!![]};if(_0x309103[_0xdf4d('0x14')]){_0x4a3e29[_0xdf4d('0x15')][_0xdf4d('0x16')][_0xdf4d('0x17')]=_0x309103[_0xdf4d('0x14')];}if(_0x309103[_0xdf4d('0x18')]=='1'){_0x4a3e29[_0xdf4d('0x15')][_0xdf4d('0x16')][_0xdf4d('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xdf4d('0x1a')};}if(_0x309103[_0xdf4d('0x1b')]){_0x4a3e29[_0xdf4d('0x15')][_0xdf4d('0x16')][_0xdf4d('0x1c')]=_0x309103[_0xdf4d('0x1b')];if(_0x309103[_0xdf4d('0x1d')]){_0x4a3e29[_0xdf4d('0x15')][_0xdf4d('0x16')]['CustomActionData']=_0x309103['custom_action_data'];}}logger[_0xdf4d('0x1e')](JSON[_0xdf4d('0x1f')](_0x4a3e29));return rp(_0x4a3e29);});}; \ 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 a01b23d..98bd042 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 _0xf695=['exports'];(function(_0x13e55f,_0x48eb7a){var _0x5a094a=function(_0x29fad3){while(--_0x29fad3){_0x13e55f['push'](_0x13e55f['shift']());}};_0x5a094a(++_0x48eb7a);}(_0xf695,0xb7));var _0x5f69=function(_0x1bf4b4,_0x11dcf6){_0x1bf4b4=_0x1bf4b4-0x0;var _0x33f6e4=_0xf695[_0x1bf4b4];return _0x33f6e4;};'use strict';var asr=require('./lib/api');module[_0x5f69('0x0')]=function(_0x2f4912,_0x594cfd,_0x147e4a,_0x3328c1){return asr(_0x2f4912,_0x594cfd,_0x147e4a,_0x3328c1);}; \ No newline at end of file +var _0x839b=['exports','./lib/api'];(function(_0x52ccd3,_0x1921cf){var _0x253ccc=function(_0x1d6eb2){while(--_0x1d6eb2){_0x52ccd3['push'](_0x52ccd3['shift']());}};_0x253ccc(++_0x1921cf);}(_0x839b,0x1d5));var _0xb839=function(_0xfa4e4e,_0x1c4c0e){_0xfa4e4e=_0xfa4e4e-0x0;var _0x3dbb8c=_0x839b[_0xfa4e4e];return _0x3dbb8c;};'use strict';var asr=require(_0xb839('0x0'));module[_0xb839('0x1')]=function(_0x54c90c,_0x3b0ed0,_0x37dd43,_0x302cbc){return asr(_0x54c90c,_0x3b0ed0,_0x37dd43,_0x302cbc);}; \ 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 7f6571b..d89c958 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 _0x8668=['open','message','bluebird','crypto','../../../../../../config/logger','agi','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','unix','stringify','createReadStream','data','send','close','EOS','error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','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.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject'];(function(_0x4bcfa6,_0x1c7e43){var _0x1c0165=function(_0x30c963){while(--_0x30c963){_0x4bcfa6['push'](_0x4bcfa6['shift']());}};_0x1c0165(++_0x1c7e43);}(_0x8668,0x74));var _0x8866=function(_0x2a4eeb,_0xd50b87){_0x2a4eeb=_0x2a4eeb-0x0;var _0x297132=_0x8668[_0x2a4eeb];return _0x297132;};'use strict';var BPromise=require(_0x8866('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x8866('0x1'));var logger=require(_0x8866('0x2'))(_0x8866('0x3'));module['exports']=function(_0x8f8144,_0xc2e4b7,_0x18de52,_0x1dbd18){return new BPromise(function(_0x4161d4,_0x56e9cb){logger[_0x8866('0x4')]('Tilde\x20URI',_0x1dbd18||_0x8866('0x5'));var _0x1c524e=new WebSocket(_0x1dbd18||_0x8866('0x5'),{'perMessageDeflate':![]});var _0x31fceb='';var _0x42a79c='0';var _0x1e6aa3='1';var _0x57373b='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x1b7921(_0x50f68b){var _0x2d7abe=crypto[_0x8866('0x6')](_0x8866('0x7'));_0x2d7abe[_0x8866('0x8')](_0x50f68b);return _0x2d7abe[_0x8866('0x9')](_0x8866('0xa'));}function _0x46d5bd(){try{logger[_0x8866('0x4')]('Open\x20Tilde\x20ASR\x20socket');var _0x3b6399=moment()[_0x8866('0xb')]();var _0x5b21d8=_0x1b7921(_0x3b6399+_0xc2e4b7+_0x18de52);_0x1c524e['send'](JSON[_0x8866('0xc')]({'appID':_0xc2e4b7,'timestamp':_0x3b6399,'appKey':_0x5b21d8}));var _0x162fe4=fs[_0x8866('0xd')](_0x8f8144);_0x162fe4['on'](_0x8866('0xe'),function(_0x15c772){_0x1c524e[_0x8866('0xf')](_0x15c772);});_0x162fe4['on'](_0x8866('0x10'),function(){_0x1c524e[_0x8866('0xf')](_0x8866('0x11'));});}catch(_0x5ceceb){logger[_0x8866('0x12')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x5ceceb));_0x1c524e[_0x8866('0x13')]();}}function _0x14847a(_0x4353b2){try{if(_0x4353b2){var _0x49a81e=JSON['parse'](_0x4353b2);switch(_0x49a81e[_0x8866('0x14')]){case 0x0:if(_0x49a81e[_0x8866('0x15')]){if(_0x49a81e[_0x8866('0x15')][_0x8866('0x16')]){logger[_0x8866('0x4')](_0x8866('0x17'),JSON[_0x8866('0xc')](_0x49a81e['result']['hypotheses']));_0x31fceb=_0x49a81e[_0x8866('0x15')][_0x8866('0x18')][0x0][_0x8866('0x19')];_0x42a79c=_0x49a81e[_0x8866('0x15')][_0x8866('0x18')][0x0][_0x8866('0x1a')];_0x1e6aa3='0';_0x57373b=_0x8866('0x1b');_0x1c524e[_0x8866('0x13')]();}}break;case 0x1:logger[_0x8866('0x4')](_0x8866('0x1c'));_0x1e6aa3='1';_0x57373b=_0x8866('0x1c');break;case 0x2:logger[_0x8866('0x4')](_0x8866('0x1d'));_0x1e6aa3='2';_0x57373b=_0x8866('0x1d');break;case 0x9:logger[_0x8866('0x4')](_0x8866('0x1e'));_0x1e6aa3='9';_0x57373b='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0x8866('0x1f'));_0x1e6aa3='10';_0x57373b=_0x8866('0x1f');break;case 0xb:logger[_0x8866('0x4')](_0x8866('0x20'));_0x1e6aa3='11';_0x57373b=_0x8866('0x20');}}}catch(_0xe9091b){logger[_0x8866('0x12')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x8866('0xc')](_0xe9091b));_0x1c524e[_0x8866('0x13')]();}}function _0x60f5e2(){logger['info'](_0x8866('0x21'));_0x4161d4({'transcript':_0x31fceb,'confidence':_0x42a79c,'status':_0x1e6aa3,'status_message':_0x57373b});}function _0x6d61be(_0x2ebc16){logger[_0x8866('0x12')](_0x8866('0x22'));if(!_['isNil'](_0x2ebc16)){logger['error'](_[_0x8866('0x23')](_0x2ebc16)?JSON['stringify'](_0x2ebc16):_0x2ebc16);}}_0x1c524e['on'](_0x8866('0x24'),_0x46d5bd);_0x1c524e['on'](_0x8866('0x25'),_0x14847a);_0x1c524e['on'](_0x8866('0x10'),_0x60f5e2);_0x1c524e['on'](_0x8866('0x12'),_0x6d61be);});}; \ No newline at end of file +var _0x519a=['error','Tilde\x20ASR\x20send\x20error','terminate','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','lodash','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','send','stringify','createReadStream','close'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x519a,0x1b7));var _0xa519=function(_0x15797a,_0x16274f){_0x15797a=_0x15797a-0x0;var _0x3e2618=_0x519a[_0x15797a];return _0x3e2618;};'use strict';var BPromise=require('bluebird');var _=require(_0xa519('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xa519('0x1'));var logger=require(_0xa519('0x2'))(_0xa519('0x3'));module[_0xa519('0x4')]=function(_0x39337f,_0x260aeb,_0x238f25,_0x116f3d){return new BPromise(function(_0xd2dfd,_0x5a951d){logger[_0xa519('0x5')]('Tilde\x20URI',_0x116f3d||_0xa519('0x6'));var _0x42c607=new WebSocket(_0x116f3d||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x2f80db='';var _0x7e01e6='0';var _0x1dda38='1';var _0x17142f=_0xa519('0x7');function _0x16edc8(_0x14c233){var _0x45c94e=crypto['createHash'](_0xa519('0x8'));_0x45c94e[_0xa519('0x9')](_0x14c233);return _0x45c94e[_0xa519('0xa')](_0xa519('0xb'));}function _0x145408(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x14614f=moment()['unix']();var _0x488c0c=_0x16edc8(_0x14614f+_0x260aeb+_0x238f25);_0x42c607[_0xa519('0xc')](JSON[_0xa519('0xd')]({'appID':_0x260aeb,'timestamp':_0x14614f,'appKey':_0x488c0c}));var _0x758305=fs[_0xa519('0xe')](_0x39337f);_0x758305['on']('data',function(_0x167bba){_0x42c607[_0xa519('0xc')](_0x167bba);});_0x758305['on'](_0xa519('0xf'),function(){_0x42c607[_0xa519('0xc')]('EOS');});}catch(_0x4b19d2){logger[_0xa519('0x10')](_0xa519('0x11'),JSON[_0xa519('0xd')](_0x4b19d2));_0x42c607[_0xa519('0x12')]();}}function _0x2277e7(_0x48db72){try{if(_0x48db72){var _0x2c8ba7=JSON['parse'](_0x48db72);switch(_0x2c8ba7[_0xa519('0x13')]){case 0x0:if(_0x2c8ba7[_0xa519('0x14')]){if(_0x2c8ba7[_0xa519('0x14')]['final']){logger[_0xa519('0x5')](_0xa519('0x15'),JSON[_0xa519('0xd')](_0x2c8ba7[_0xa519('0x14')][_0xa519('0x16')]));_0x2f80db=_0x2c8ba7[_0xa519('0x14')][_0xa519('0x16')][0x0][_0xa519('0x17')];_0x7e01e6=_0x2c8ba7[_0xa519('0x14')][_0xa519('0x16')][0x0]['likelihood'];_0x1dda38='0';_0x17142f=_0xa519('0x18');_0x42c607[_0xa519('0x12')]();}}break;case 0x1:logger[_0xa519('0x5')](_0xa519('0x7'));_0x1dda38='1';_0x17142f=_0xa519('0x7');break;case 0x2:logger[_0xa519('0x5')](_0xa519('0x19'));_0x1dda38='2';_0x17142f=_0xa519('0x19');break;case 0x9:logger[_0xa519('0x5')](_0xa519('0x1a'));_0x1dda38='9';_0x17142f=_0xa519('0x1a');break;case 0xa:logger[_0xa519('0x5')](_0xa519('0x1b'));_0x1dda38='10';_0x17142f=_0xa519('0x1b');break;case 0xb:logger[_0xa519('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x1dda38='11';_0x17142f=_0xa519('0x1c');}}}catch(_0xb7d00b){logger[_0xa519('0x10')](_0xa519('0x1d'),JSON[_0xa519('0xd')](_0xb7d00b));_0x42c607[_0xa519('0x12')]();}}function _0xcff13a(){logger[_0xa519('0x5')](_0xa519('0x1e'));_0xd2dfd({'transcript':_0x2f80db,'confidence':_0x7e01e6,'status':_0x1dda38,'status_message':_0x17142f});}function _0x1fd47e(_0x42fadf){logger['error'](_0xa519('0x1f'));if(!_['isNil'](_0x42fadf)){logger[_0xa519('0x10')](_[_0xa519('0x20')](_0x42fadf)?JSON[_0xa519('0xd')](_0x42fadf):_0x42fadf);}}_0x42c607['on'](_0xa519('0x21'),_0x145408);_0x42c607['on'](_0xa519('0x22'),_0x2277e7);_0x42c607['on'](_0xa519('0xf'),_0xcff13a);_0x42c607['on'](_0xa519('0x10'),_0x1fd47e);});}; \ 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 fc26bed..d1c00fe 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 _0x2cba=['./asr','exports'];(function(_0x216f98,_0x470c7f){var _0xea6b36=function(_0x38f18c){while(--_0x38f18c){_0x216f98['push'](_0x216f98['shift']());}};_0xea6b36(++_0x470c7f);}(_0x2cba,0x162));var _0xa2cb=function(_0x3a49ed,_0x450ecb){_0x3a49ed=_0x3a49ed-0x0;var _0x216407=_0x2cba[_0x3a49ed];return _0x216407;};var asr=require(_0xa2cb('0x0'));module[_0xa2cb('0x1')]={'asr':asr}; \ No newline at end of file +var _0x0762=['exports','./asr'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x0762,0x89));var _0x2076=function(_0x1479dc,_0x1f3dc1){_0x1479dc=_0x1479dc-0x0;var _0x29e589=_0x0762[_0x1479dc];return _0x29e589;};var asr=require(_0x2076('0x0'));module[_0x2076('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index e8c44ed..90c025a 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 _0x9ee6=['ready','E_AGI_SERVER_CLOSE','exports','net','events','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x9ee6,0x16b));var _0x69ee=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0x9ee6[_0x2d994d];return _0xd54be4;};'use strict';var util=require('util');var net=require(_0x69ee('0x0'));var EventEmitter=require(_0x69ee('0x1'))['EventEmitter'];var AGIError=require(_0x69ee('0x2'));var AGIChannel=require('./channel');var AGIServer=function(_0x1750ba,_0x50043d,_0x549ad4){var _0x3892c7=this,_0x1750ba=_0x1750ba||0x11dd,_0x50043d=_0x50043d||_0x69ee('0x3'),_0xdd8b67=null,_0x1a3ede=0x0;EventEmitter[_0x69ee('0x4')](_0x3892c7);function _0x4e12b5(){if(!_0x1750ba){_0x3892c7[_0x69ee('0x5')](_0x69ee('0x6'),new AGIError(_0x69ee('0x7')));return![];}_0xdd8b67=net['createServer']();_0xdd8b67[_0x69ee('0x8')](_0x1750ba,_0x50043d);_0xdd8b67['on'](_0x69ee('0x9'),function(){_0x3892c7[_0x69ee('0x5')](_0x69ee('0x9'));});_0xdd8b67['on'](_0x69ee('0xa'),function(_0x1cfee7){_0xdd8b67[_0x69ee('0xb')](function(_0x42f0e6,_0x56aadc){if(_0x42f0e6){_0x3892c7[_0x69ee('0x5')](_0x69ee('0x6'),new AGIError(_0x69ee('0xc'),_0x42f0e6));}else if(_0x549ad4&&_0x549ad4<0x0){_0x3892c7['emit'](_0x69ee('0x6'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x1cfee7[_0x69ee('0xd')]();}else if(_0x549ad4&&_0x549ad4>0x0&&_0x549ad4<_0x56aadc){_0x1a3ede+=0x1;_0x3892c7[_0x69ee('0x5')]('error',new AGIError(_0x69ee('0xe'),_0x1a3ede));_0x1cfee7[_0x69ee('0xd')]();}else{var _0x207b92=new AGIChannel(_0x1cfee7);_0x207b92['on'](_0x69ee('0xf'),function(){_0x3892c7[_0x69ee('0x5')](_0x69ee('0xa'),_0x207b92);});}});});_0xdd8b67['on'](_0x69ee('0x6'),function(_0x200070){_0x3892c7[_0x69ee('0x5')](_0x69ee('0x6'),new AGIError(_0x69ee('0xc'),_0x200070['code']));});_0xdd8b67['on']('close',function(){_0x3892c7[_0x69ee('0x5')]('close',new AGIError(_0x69ee('0x10')));});}process['nextTick'](function(){_0x4e12b5();});};util['inherits'](AGIServer,EventEmitter);module[_0x69ee('0x11')]=function(_0x3dde19,_0xbc0d2,_0x20d102){return new AGIServer(_0x3dde19,_0xbc0d2,_0x20d102);}; \ No newline at end of file +var _0x74ee=['emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','events','EventEmitter','./error','./channel','127.0.0.1','call'];(function(_0x27d447,_0x4bdeb6){var _0x1f47d0=function(_0x159d2b){while(--_0x159d2b){_0x27d447['push'](_0x27d447['shift']());}};_0x1f47d0(++_0x4bdeb6);}(_0x74ee,0x83));var _0xe74e=function(_0x1857ba,_0x59a84d){_0x1857ba=_0x1857ba-0x0;var _0xb48fe8=_0x74ee[_0x1857ba];return _0xb48fe8;};'use strict';var util=require(_0xe74e('0x0'));var net=require('net');var EventEmitter=require(_0xe74e('0x1'))[_0xe74e('0x2')];var AGIError=require(_0xe74e('0x3'));var AGIChannel=require(_0xe74e('0x4'));var AGIServer=function(_0x50a3e0,_0x543e17,_0x5604ac){var _0x15f7e1=this,_0x50a3e0=_0x50a3e0||0x11dd,_0x543e17=_0x543e17||_0xe74e('0x5'),_0x555b1c=null,_0x7b4311=0x0;EventEmitter[_0xe74e('0x6')](_0x15f7e1);function _0x24c52c(){if(!_0x50a3e0){_0x15f7e1[_0xe74e('0x7')](_0xe74e('0x8'),new AGIError(_0xe74e('0x9')));return![];}_0x555b1c=net[_0xe74e('0xa')]();_0x555b1c[_0xe74e('0xb')](_0x50a3e0,_0x543e17);_0x555b1c['on'](_0xe74e('0xc'),function(){_0x15f7e1[_0xe74e('0x7')]('listening');});_0x555b1c['on'](_0xe74e('0xd'),function(_0x6d7688){_0x555b1c[_0xe74e('0xe')](function(_0x368aff,_0x2c513f){if(_0x368aff){_0x15f7e1[_0xe74e('0x7')](_0xe74e('0x8'),new AGIError(_0xe74e('0xf'),_0x368aff));}else if(_0x5604ac&&_0x5604ac<0x0){_0x15f7e1[_0xe74e('0x7')](_0xe74e('0x8'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x6d7688[_0xe74e('0x10')]();}else if(_0x5604ac&&_0x5604ac>0x0&&_0x5604ac<_0x2c513f){_0x7b4311+=0x1;_0x15f7e1[_0xe74e('0x7')](_0xe74e('0x8'),new AGIError(_0xe74e('0x11'),_0x7b4311));_0x6d7688[_0xe74e('0x10')]();}else{var _0x319da1=new AGIChannel(_0x6d7688);_0x319da1['on'](_0xe74e('0x12'),function(){_0x15f7e1[_0xe74e('0x7')](_0xe74e('0xd'),_0x319da1);});}});});_0x555b1c['on'](_0xe74e('0x8'),function(_0x1b737d){_0x15f7e1[_0xe74e('0x7')](_0xe74e('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x1b737d['code']));});_0x555b1c['on'](_0xe74e('0x13'),function(){_0x15f7e1[_0xe74e('0x7')]('close',new AGIError(_0xe74e('0x14')));});}process[_0xe74e('0x15')](function(){_0x24c52c();});};util['inherits'](AGIServer,EventEmitter);module[_0xe74e('0x16')]=function(_0x539ad9,_0x214abe,_0x11c565){return new AGIServer(_0x539ad9,_0x214abe,_0x11c565);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 0115018..c0ce3bf 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 _0xc4be=['Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','util','shelljs','odbc','randomstring','moment','mustache','request-promise','agi','./scripts','/var/opt/motion2/server/files','rawHeaders','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getTrunk','getSound','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','Intervals','interval','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','callback','scheduledAt','toString','callback_priority','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','googleTTS','google_tts_language','url','method','timeout','includes','PUT','toUpperCase','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','computedVariables','uri','render','stringify','body','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','saveRestApiResult','%s.%s','isArray','length','setVariable','split','replaceAll','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','sync','retry','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','MRCPSynth','mrcprecog','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','getAndSetVariable','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','lumenvoxasr','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','replace','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','keys','%s[%s][%s]','%s_ROWS_COUNT','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','speech','dialogflow','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','phone','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws\x20Polly\x20%s\x20file\x20created','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','.wav','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','findBy','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','forEach','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Executed\x20command\x20%s\x20%s','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','record','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','getMailAccount','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','service','port','secure','authentication','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','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s'];(function(_0x55e71b,_0x4fc5c9){var _0x50595a=function(_0x55ce1c){while(--_0x55ce1c){_0x55e71b['push'](_0x55e71b['shift']());}};_0x50595a(++_0x4fc5c9);}(_0xc4be,0x1ed));var _0xec4b=function(_0x32cd68,_0x502595){_0x32cd68=_0x32cd68-0x0;var _0x309748=_0xc4be[_0x32cd68];return _0x309748;};'use strict';var fs=require('fs');var path=require(_0xec4b('0x0'));var util=require(_0xec4b('0x1'));var _=require('lodash');var sh=require(_0xec4b('0x2'));var odbc=require(_0xec4b('0x3'))();var rs=require(_0xec4b('0x4'));var moment=require(_0xec4b('0x5'));var Mustache=require(_0xec4b('0x6'));var rp=require(_0xec4b('0x7'));var logger=require('../../config/logger')(_0xec4b('0x8'));var config=require('../../config/environment');var scripts=require(_0xec4b('0x9'));var FILES_PATH=_0xec4b('0xa');var recursiveMapAttributes=[_0xec4b('0xb'),'rawBody'];var verticesWithRetry=['menu','getdigits',_0xec4b('0xc')];var AGIVertices=function(_0x923d71,_0x5b7e2e,_0x38a623){this[_0xec4b('0xd')]=_0x923d71;this[_0xec4b('0xe')]=_0x5b7e2e;this[_0xec4b('0xf')]=_0x38a623;};AGIVertices[_0xec4b('0x10')][_0xec4b('0x11')]=function(_0x606484,_0x46bcf3){this[_0xec4b('0xe')][_0xec4b('0x12')](_0x606484)['then'](function(_0x1a564e){_0x46bcf3(null,_0x1a564e?_0x1a564e[_0xec4b('0x13')]:![]);})[_0xec4b('0x14')](function(_0x54cf07){_0x46bcf3(_0x54cf07);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x15')]=function(_0x2adab6,_0x1ea164){this[_0xec4b('0xe')][_0xec4b('0x16')](_0x2adab6)[_0xec4b('0x17')](function(_0x52856b){_0x1ea164(null,_0x52856b?_0x52856b[_0xec4b('0x13')]:![]);})['catch'](function(_0x532503){_0x1ea164(_0x532503);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x18')]=function(_0x15d3f7,_0x2cb6a1){this[_0xec4b('0xe')][_0xec4b('0x19')](_0x15d3f7)['then'](function(_0x303a91){_0x2cb6a1(null,_0x303a91?_0x303a91[_0xec4b('0x13')]:![]);})[_0xec4b('0x14')](function(_0x1f83ed){_0x2cb6a1(_0x1f83ed);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x1a')]=function(_0x59ff41,_0xba2f52){this[_0xec4b('0xe')][_0xec4b('0x1b')](_0x59ff41)[_0xec4b('0x17')](function(_0x1d06fa){_0xba2f52(null,_0x1d06fa?_0x1d06fa[_0xec4b('0x1c')]:![]);})[_0xec4b('0x14')](function(_0x53c77e){_0xba2f52(_0x53c77e);});};AGIVertices['prototype']['getUser']=function(_0x27b30d,_0x2a1be0){this['rpc']['getUserById'](_0x27b30d)['then'](function(_0x1dc45e){_0x2a1be0(null,_0x1dc45e?_0x1dc45e[_0xec4b('0x13')]:![]);})['catch'](function(_0x2efb1e){_0x2a1be0(_0x2efb1e);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x1d')]=function(_0x324f9e,_0x1c5055){this[_0xec4b('0xe')]['getTrunkById'](_0x324f9e)[_0xec4b('0x17')](function(_0x5066db){_0x1c5055(null,_0x5066db?_0x5066db['name']:![]);})[_0xec4b('0x14')](function(_0x5ddc64){_0x1c5055(_0x5ddc64);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x1e')]=function(_0x1c8358,_0x21b773){var _0x2de5be=this;this[_0xec4b('0xe')]['getSoundById'](_0x1c8358)[_0xec4b('0x17')](function(_0x1bdc60){_0x21b773(null,_0x1bdc60?_0x2de5be['getSoundPath'](_0x1bdc60[_0xec4b('0x1f')]):![]);})['catch'](function(_0x5c8fff){_0x21b773(_0x5c8fff);});};AGIVertices[_0xec4b('0x10')]['getMailAccount']=function(_0x12ef26,_0x17ebdb){this[_0xec4b('0xe')][_0xec4b('0x20')](_0x12ef26)['then'](function(_0x502a69){_0x17ebdb(null,_0x502a69?_0x502a69:![]);})[_0xec4b('0x14')](function(_0x18ae08){_0x17ebdb(_0x18ae08);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x21')]=function(_0x16fd21,_0x1962d6,_0x2034d2){this['mailRpc'][_0xec4b('0x21')](_0x16fd21,_0x1962d6)[_0xec4b('0x17')](function(){_0x2034d2(null);})[_0xec4b('0x14')](function(_0xa6a695){_0x2034d2(_0xa6a695);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x22')]=function(_0x54e761,_0x1b43f8){this[_0xec4b('0xe')][_0xec4b('0x23')](_0x54e761)['then'](function(_0x4ca96b){if(_0x4ca96b){if(_0x4ca96b['IntervalId']){_0x1b43f8(null,[_0x4ca96b['interval']]);}else{_0x1b43f8(null,_['map'](_0x4ca96b[_0xec4b('0x24')],_0xec4b('0x25')));}}else{_0x1b43f8(null,![]);}})['catch'](function(_0xe3ab11){_0x1b43f8(_0xe3ab11);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x26')]=function(_0xf611bb){return util[_0xec4b('0x27')](_0xec4b('0x28'),FILES_PATH,_0xf611bb);};AGIVertices[_0xec4b('0x10')][_0xec4b('0x29')]=function(_0x7a111a,_0x159dc4,_0x3e49f7){odbc[_0xec4b('0x2a')](_0x7a111a,function(_0x48385d){if(_0x48385d){logger[_0xec4b('0x2b')](_0xec4b('0x2c'),_0x48385d);_0x3e49f7(_0x48385d);}else{logger[_0xec4b('0x2d')](_0xec4b('0x2e'));odbc['query'](_0x159dc4,function(_0x38ef75,_0x1965fa){if(_0x38ef75){logger[_0xec4b('0x2d')](_0xec4b('0x2f'),_0x159dc4);_0x3e49f7(_0x38ef75);}else{logger['info'](_0xec4b('0x30'),_0x159dc4);odbc[_0xec4b('0x31')](function(_0x5d6aa3){if(_0x5d6aa3){logger[_0xec4b('0x2b')](_0xec4b('0x32'),_0x5d6aa3);}_0x3e49f7(null,_0x1965fa);});}});}});};AGIVertices['prototype'][_0xec4b('0x33')]=function(_0x5c8443,_0x2e5ae3){this[_0xec4b('0xe')][_0xec4b('0x34')](_0x5c8443)[_0xec4b('0x17')](function(_0x44b991){_0x2e5ae3(null,_0x44b991?_0x44b991:![]);})[_0xec4b('0x14')](function(_0x3a437f){_0x2e5ae3(_0x3a437f);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x35')]=function(_0x39482e,_0x320366){this[_0xec4b('0xe')]['createSmsMessage'](_0x39482e)[_0xec4b('0x17')](function(_0x427352){_0x320366(null,_0x427352);})[_0xec4b('0x14')](function(_0x232933){_0x320366(_0x232933);});};AGIVertices['prototype'][_0xec4b('0x36')]=function(_0x4410c2,_0x599d1d,_0xa9c257){this[_0xec4b('0xe')][_0xec4b('0x36')]({'uniqueid':this[_0xec4b('0xd')][_0xec4b('0x37')],'node':_0x4410c2[_0xec4b('0x38')],'application':_0x4410c2[_0xec4b('0x39')],'data':_0x599d1d||null,'project_name':this[_0xec4b('0xd')][_0xec4b('0x3a')],'callerid':this['channel'][_0xec4b('0x3b')]})[_0xec4b('0x17')](function(_0x526695){if(_0xa9c257){_0xa9c257(null,_0x526695);}})[_0xec4b('0x14')](function(_0x266f69){if(_0xa9c257){_0xa9c257(_0x266f69);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x57e46b,_0x1f1193,_0x5e7c6d,_0x15f319){this['rpc'][_0xec4b('0x3c')]({'uniqueid':this[_0xec4b('0xd')][_0xec4b('0x37')],'callerid':this[_0xec4b('0xd')][_0xec4b('0x3b')],'calleridname':this[_0xec4b('0xd')]['calleridname'],'context':this[_0xec4b('0xd')][_0xec4b('0x3d')],'extension':this[_0xec4b('0xd')][_0xec4b('0x3e')],'priority':this[_0xec4b('0xd')][_0xec4b('0x3f')],'accountcode':this[_0xec4b('0xd')][_0xec4b('0x40')],'dnid':this[_0xec4b('0xd')][_0xec4b('0x41')],'projectName':this[_0xec4b('0xd')]['arg_1'],'saveName':_0x1f1193,'filename':_0x57e46b['file']||_0x1f1193,'savePath':_0x5e7c6d})[_0xec4b('0x17')](function(_0x43e383){_0x15f319(null,_0x43e383);})[_0xec4b('0x14')](function(_0x206d8e){_0x15f319(_0x206d8e);});};AGIVertices[_0xec4b('0x10')]['createSquareMessage']=function(_0x814bda,_0x5ec4bd,_0x20071d,_0x3939ee,_0x7121fb){this['rpc'][_0xec4b('0x42')]({'uniqueid':this['channel'][_0xec4b('0x37')],'body':_0x814bda,'direction':_0x5ec4bd,'providerName':_0x20071d,'providerResponse':_0x3939ee})[_0xec4b('0x17')](function(_0x27246f){if(_0x7121fb){_0x7121fb(null,_0x27246f);}})[_0xec4b('0x14')](function(_0x55e1a1){if(_0x7121fb){_0x7121fb(_0x55e1a1);}});};AGIVertices['prototype'][_0xec4b('0x43')]=function(_0x253268,_0x218c75){this[_0xec4b('0xe')][_0xec4b('0x43')]({'firstName':_[_0xec4b('0x44')](_0x253268[_0xec4b('0x13')])||_[_0xec4b('0x45')](_0x253268[_0xec4b('0x13')])?_0xec4b('0x46')+Math[_0xec4b('0x47')]():_0x253268[_0xec4b('0x13')],'lastName':_[_0xec4b('0x44')](_0x253268[_0xec4b('0x48')])||_[_0xec4b('0x45')](_0x253268[_0xec4b('0x48')])?null:_0x253268[_0xec4b('0x48')],'phone':_0x253268['phone'],'ListId':_0x253268[_0xec4b('0x49')],'scheduledat':_0x253268['scheduledAt'],'callbackUniqueid':this[_0xec4b('0xd')][_0xec4b('0x37')],'tags':_0xec4b('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x253268[_0xec4b('0x4b')][_0xec4b('0x4c')](),'priority':_0x253268[_0xec4b('0x4d')]})[_0xec4b('0x17')](function(_0x3c5537){_0x218c75(null,_0x3c5537);})[_0xec4b('0x14')](function(_0x27eb8b){_0x218c75(_0x27eb8b);});};AGIVertices[_0xec4b('0x10')]['getPause']=function(_0x3fae15,_0x30631b){this[_0xec4b('0xe')]['getPauseById'](_0x3fae15)[_0xec4b('0x17')](function(_0x54c3a1){_0x30631b(null,_0x54c3a1?_0x54c3a1[_0xec4b('0x13')]:![]);})[_0xec4b('0x14')](function(_0x132cca){_0x30631b(_0x132cca);});};AGIVertices['prototype'][_0xec4b('0x4e')]=function(_0x219161,_0x4fe076,_0xd8b135){var _0x45904b={'role':_0xec4b('0x4f')};_0x45904b[_0x219161]=this[_0xec4b('0xd')][_0xec4b('0x3b')];this[_0xec4b('0xe')]['agentPause'](_0x45904b,_0x4fe076,this[_0xec4b('0xd')][_0xec4b('0x37')])[_0xec4b('0x17')](function(_0x806f55){_0xd8b135(null,_[_0xec4b('0x45')](_0x806f55)?![]:!![]);})[_0xec4b('0x14')](function(_0xddb22a){logger[_0xec4b('0x2b')](_0xddb22a);_0xd8b135(null,![]);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x50')]=function(_0xcf7159,_0x5e6014){var _0xa7ef22={'role':_0xec4b('0x4f')};_0xa7ef22[_0xcf7159]=this[_0xec4b('0xd')][_0xec4b('0x3b')];this[_0xec4b('0xe')][_0xec4b('0x50')](_0xa7ef22)['then'](function(_0x54adf0){_0x5e6014(null,_[_0xec4b('0x45')](_0x54adf0)?![]:!![]);})[_0xec4b('0x14')](function(_0x2a335e){logger[_0xec4b('0x2b')](_0x2a335e);_0x5e6014(null,![]);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x51')]=function(_0x37c7d2,_0x51c06f){var _0x26d33d={'role':'agent'};_0x26d33d[_0x37c7d2]=this[_0xec4b('0xd')][_0xec4b('0x3b')];this['rpc'][_0xec4b('0x51')](_0x26d33d)[_0xec4b('0x17')](function(_0x354bfe){_0x51c06f(null,_[_0xec4b('0x45')](_0x354bfe)?![]:!![]);})[_0xec4b('0x14')](function(_0x483f60){logger[_0xec4b('0x2b')](_0x483f60);_0x51c06f(null,![]);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x52')]=function(_0x2caf00,_0x5b4dfe){var _0x360813={'role':_0xec4b('0x4f')};_0x360813[_0x2caf00]=this[_0xec4b('0xd')]['callerid'];var _0x17887d=_0x2caf00!=_0xec4b('0x53')?util[_0xec4b('0x27')](_0xec4b('0x54'),_0xec4b('0x55'),this['channel']['callerid']):undefined;this[_0xec4b('0xe')][_0xec4b('0x52')](_0x360813,_0x17887d)['then'](function(_0x1ec8ad){_0x5b4dfe(null,_['isNil'](_0x1ec8ad)?![]:!![]);})[_0xec4b('0x14')](function(_0x23060a){logger[_0xec4b('0x2b')](_0x23060a);_0x5b4dfe(null,![]);});};AGIVertices[_0xec4b('0x10')]['shellCommand']=function(_0x7ca656,_0x1febdf){sh['exec'](_[_0xec4b('0x56')](_0x7ca656),function(_0x41a6c6,_0x2798f6){var _0x4cfd86=_0x2798f6['replace'](/(\r\n|\n|\r)/gm,'');_0x1febdf(null,_0x4cfd86);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x57')]=function(_0x129541,_0x1a12d2){scripts[_0xec4b('0x57')](_0x129541[_0xec4b('0x58')],_0x129541[_0xec4b('0x59')]||_0xec4b('0x5a'),_0x129541[_0xec4b('0x5a')],_0x129541[_0xec4b('0x5b')]||_0xec4b('0x5c'),_0x129541['ssmlGender']||_0xec4b('0x5d'),_0x129541[_0xec4b('0x5e')]||'MP3')['then'](function(_0x59c2c3){_0x1a12d2(null,_0x59c2c3);})[_0xec4b('0x14')](function(_0x354fa2){_0x1a12d2(_0x354fa2);});};AGIVertices['prototype'][_0xec4b('0x5f')]=function(_0x4c2239,_0x4ffe83){scripts['googleTTS'](_0x4c2239['text'],_0x4c2239[_0xec4b('0x60')]||'en',0x1)[_0xec4b('0x17')](function(_0x16fa52){_0x4ffe83(null,_0x16fa52);})[_0xec4b('0x14')](function(_0x2616cb){_0x4ffe83(_0x2616cb);});};AGIVertices[_0xec4b('0x10')]['restAPI']=function(_0x42e941,_0xeb8834){var _0x23cea7={'uri':_0x42e941[_0xec4b('0x61')],'method':_0x42e941[_0xec4b('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x42e941[_0xec4b('0x63')])==='number'&&parseInt(_0x42e941[_0xec4b('0x63')])>=0x1?parseInt(_0x42e941[_0xec4b('0x63')])*0x3e8:0x5*0x3e8};if(_[_0xec4b('0x64')](['POST',_0xec4b('0x65')],_0x23cea7[_0xec4b('0x62')][_0xec4b('0x66')]())){try{_0x23cea7['body']=_0x42e941[_0xec4b('0x67')]?JSON['parse'](_0x42e941['rawBody']):{};}catch(_0x265733){logger['error'](_0xec4b('0x68'),_0x265733);}}try{_0x23cea7[_0xec4b('0x69')]=_0x42e941[_0xec4b('0xb')]?JSON[_0xec4b('0x6a')](_0x42e941[_0xec4b('0xb')]):{};}catch(_0x44bdd4){logger[_0xec4b('0x2b')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x44bdd4);}if(_0x42e941[_0xec4b('0x6b')]){try{var _0x25c9ce=require(_0x42e941['computedVariables'])['sync'](this,_0x23cea7);_0x23cea7[_0xec4b('0x6c')]=Mustache[_0xec4b('0x6d')](_0x42e941[_0xec4b('0x61')],_0x25c9ce,{},['$$','$$']);if(_0x23cea7[_0xec4b('0x69')]){_0x23cea7[_0xec4b('0x69')]=JSON['parse'](Mustache[_0xec4b('0x6d')](JSON[_0xec4b('0x6e')](_0x23cea7[_0xec4b('0x69')]),_0x25c9ce,{},['$$','$$']));}if(_0x23cea7['body']){_0x23cea7[_0xec4b('0x6f')]=JSON[_0xec4b('0x6a')](Mustache[_0xec4b('0x6d')](JSON[_0xec4b('0x6e')](_0x23cea7['body']),_0x25c9ce,{},['$$','$$']));}}catch(_0x246dbf){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x246dbf);}}rp(_0x23cea7)['then'](function(_0x31a08f){var _0x5baebc={'statusCode':_0x31a08f['statusCode']||0xc8,'statusMessage':_0x31a08f['statusMessage']||'OK','headers':_0x31a08f[_0xec4b('0x69')]||{},'body':_0x31a08f[_0xec4b('0x6f')]||{}};_0xeb8834(null,_0x5baebc);})[_0xec4b('0x14')](function(_0x17569b){var _0x5c64fc={'statusCode':_0x17569b[_0xec4b('0x70')]||0x1f4,'statusMessage':_0x17569b[_0xec4b('0x71')]||_0xec4b('0x72'),'headers':_0x17569b[_0xec4b('0x73')][_0xec4b('0x69')]||{},'body':_0x17569b[_0xec4b('0x73')][_0xec4b('0x6f')]||{}};_0xeb8834(null,_0x5c64fc);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x74')]=function(_0x4d5a75,_0x500d5a){scripts[_0xec4b('0x74')](this['channel'][_0xec4b('0x37')],_0x4d5a75[_0xec4b('0x75')],_0x4d5a75[_0xec4b('0x5a')],_0x4d5a75[_0xec4b('0x76')]||'en')[_0xec4b('0x17')](function(_0x11c040){_0x500d5a(null,_0x11c040);})[_0xec4b('0x14')](function(_0x579747){_0x500d5a(_0x579747);});};AGIVertices[_0xec4b('0x10')]['googleDialogflowV2']=function(_0x17b7d6,_0x5ce939){scripts['googleDialogflowV2'](this[_0xec4b('0xd')]['uniqueid'],_0x17b7d6[_0xec4b('0x77')],_0x17b7d6[_0xec4b('0x78')],_0x17b7d6[_0xec4b('0x79')],_0x17b7d6[_0xec4b('0x5a')],_0x17b7d6[_0xec4b('0x7a')]||'en')[_0xec4b('0x17')](function(_0x3d0c33){_0x5ce939(null,_0x3d0c33);})['catch'](function(_0x2dfb74){_0x5ce939(_0x2dfb74);});};AGIVertices['prototype'][_0xec4b('0x7b')]=function(_0x177ad9,_0xe49458){scripts[_0xec4b('0x7b')](this[_0xec4b('0xd')],_0x177ad9)[_0xec4b('0x17')](function(_0x30a967){_0xe49458(null,_0x30a967);})[_0xec4b('0x14')](function(_0x12f401){_0xe49458(_0x12f401);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x7c')]=function(_0x2a478c,_0x5a381a){scripts['ispeechTTS'](_0x2a478c[_0xec4b('0x75')],_0x2a478c[_0xec4b('0x5a')],_0x2a478c[_0xec4b('0x7d')]||'en-US',_0x2a478c[_0xec4b('0x7e')])[_0xec4b('0x17')](function(_0xe64f79){_0x5a381a(null,_0xe64f79);})[_0xec4b('0x14')](function(_0x2aa4b8){_0x5a381a(_0x2aa4b8);});};AGIVertices['prototype']['ispeechASR']=function(_0x55193f,_0x279cf5,_0x32a8d6){scripts[_0xec4b('0x7f')](_0x279cf5,_0x55193f[_0xec4b('0x75')],_0x55193f['ispeech_asr_language']||'en-US',this[_0xec4b('0x80')](_0x55193f[_0xec4b('0x81')])?_0x55193f[_0xec4b('0x81')]:undefined)[_0xec4b('0x17')](function(_0x546d55){_0x32a8d6(null,_0x546d55);})[_0xec4b('0x14')](function(_0x1c4122){_0x32a8d6(_0x1c4122);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x82')]=function(_0x51974b,_0x470880){scripts['awsPolly'](_0x51974b[_0xec4b('0x83')],_0x51974b[_0xec4b('0x84')],_0x51974b[_0xec4b('0x85')],_0x51974b[_0xec4b('0x86')]||_0xec4b('0x87'),_0x51974b['text'],_0x51974b['aws_text_type']||_0xec4b('0x5a'))['then'](function(_0x3d6609){_0x470880(null,_0x3d6609);})[_0xec4b('0x14')](function(_0x57bc71){_0x470880(_0x57bc71);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x88')]=function(_0x2ce3d1,_0x5b2f7b){scripts[_0xec4b('0x88')](this['channel'][_0xec4b('0x37')],_0x2ce3d1['aws_access_key_id'],_0x2ce3d1[_0xec4b('0x84')],_0x2ce3d1[_0xec4b('0x89')],_0x2ce3d1['text'],_0x2ce3d1[_0xec4b('0x8a')])['then'](function(_0x5063ac){_0x5b2f7b(null,_0x5063ac);})[_0xec4b('0x14')](function(_0x5d993c){_0x5b2f7b(_0x5d993c);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x8b')]=function(_0x2cbce1,_0x181a11,_0x3cd41e){scripts[_0xec4b('0x8b')](_0x181a11,_0x2cbce1[_0xec4b('0x75')],_0x2cbce1[_0xec4b('0x8c')]||_0xec4b('0x5c'))['then'](function(_0xa8937d){_0x3cd41e(null,_0xa8937d);})[_0xec4b('0x14')](function(_0x29f454){_0x3cd41e(_0x29f454);});};AGIVertices['prototype'][_0xec4b('0x8d')]=function(_0x111be8,_0x38a736,_0x4ac58a){scripts[_0xec4b('0x8d')](_0x38a736,_0x111be8[_0xec4b('0x8e')],_0x111be8[_0xec4b('0x8f')],_0x111be8[_0xec4b('0x6c')])[_0xec4b('0x17')](function(_0x324184){_0x4ac58a(null,_0x324184);})[_0xec4b('0x14')](function(_0x55ce45){_0x4ac58a(_0x55ce45);});};AGIVertices[_0xec4b('0x10')][_0xec4b('0x90')]=function(_0x5b2abe){var _0x53773d=_[_0xec4b('0x64')](verticesWithRetry,_0x5b2abe[_0xec4b('0x39')])?_0x5b2abe:_[_0xec4b('0x91')](_0x5b2abe);for(var _0x403680 in _0x53773d){if(_0x53773d[_0xec4b('0x92')](_0x403680)){if(_0x53773d[_0x403680]&&_[_0xec4b('0x93')](_0x53773d[_0x403680])){if(_[_0xec4b('0x64')](recursiveMapAttributes,_0x403680)){_0x53773d[_0x403680]=this['replaceObjectAllVariables'](_0x53773d[_0x403680]);}else{_0x53773d[_0x403680]=this[_0xec4b('0x94')](_0x53773d[_0x403680]);}}}}return _0x53773d;};AGIVertices['prototype'][_0xec4b('0x95')]=function(_0x4a962b){for(var _0x488baa in _0x4a962b){if(_0x4a962b['hasOwnProperty'](_0x488baa)){if(_[_0xec4b('0x96')](_0x4a962b[_0x488baa])){this[_0xec4b('0x95')](_0x4a962b[_0x488baa]);}else if(_['isArray'](_0x4a962b[_0x488baa])){for(var _0x468634=0x0;_0x468634<_0x4a962b[_0x488baa]['length'];_0x468634++){this[_0xec4b('0x95')](_0x4a962b[_0x488baa][_0x468634]);}}else if(_[_0xec4b('0x93')](_0x4a962b[_0x488baa])){_0x4a962b[_0x488baa]=this[_0xec4b('0x94')](_0x4a962b[_0x488baa]);}}}};AGIVertices[_0xec4b('0x10')][_0xec4b('0x97')]=function(_0x57f75b,_0x28fd6c){for(var _0xa2e236 in _0x57f75b){if(_0x57f75b['hasOwnProperty'](_0xa2e236)){if(_['isPlainObject'](_0x57f75b[_0xa2e236])){if(!_[_0xec4b('0x44')](_0x57f75b[_0xa2e236])){this['saveRestApiResult'](_0x57f75b[_0xa2e236],util[_0xec4b('0x27')](_0xec4b('0x98'),_0x28fd6c,_0xa2e236));}}else if(_[_0xec4b('0x99')](_0x57f75b[_0xa2e236])){for(var _0x1bd91b=0x0;_0x1bd91b<_0x57f75b[_0xa2e236][_0xec4b('0x9a')];_0x1bd91b++){this[_0xec4b('0x97')](_0x57f75b[_0xa2e236][_0x1bd91b],util[_0xec4b('0x27')](_0xec4b('0x98'),_0x28fd6c,_0xa2e236+'['+_0x1bd91b+']'));}}else{if(!_['isNil'](_0x57f75b[_0xa2e236])){this['channel'][_0xec4b('0x9b')](util['format'](_0xec4b('0x98'),_0x28fd6c,_0xa2e236),_0x57f75b[_0xa2e236]);}}}}};AGIVertices[_0xec4b('0x10')]['replaceObjectAllVariables']=function(_0x1a8315){try{var _0x3e1983=JSON[_0xec4b('0x6a')](_0x1a8315);this['recursiveNodeIndex'](_0x3e1983);return JSON[_0xec4b('0x6e')](_0x3e1983);}catch(_0x4bbc15){return this[_0xec4b('0x94')](_0x1a8315);}};AGIVertices[_0xec4b('0x10')][_0xec4b('0x94')]=function(_0x32bdb1){var _0x1a04b4=_0x32bdb1[_0xec4b('0x9c')]('{');for(var _0x3eab63=0x1;_0x3eab63<_0x1a04b4[_0xec4b('0x9a')];_0x3eab63+=0x1){var _0x50a317=_0x1a04b4[_0x3eab63]['split']('}');if(_0x50a317[_0xec4b('0x9a')]>0x1){_0x32bdb1=_0x32bdb1[_0xec4b('0x9d')]('{'+_0x50a317[0x0]+'}',this[_0xec4b('0xd')][_0xec4b('0x11')](_0x50a317[0x0])['extra']||_0x50a317[0x0]);}}if(_0x1a04b4['length']===0x1){return _0x32bdb1[_0xec4b('0x4c')]();}return this[_0xec4b('0x94')](_0x32bdb1);};AGIVertices['prototype']['getAndSetVariable']=function(_0x541d00,_0x4aa3ba){var _0x462087=this[_0xec4b('0xd')][_0xec4b('0x11')](_0x541d00);if(_0x462087[_0xec4b('0x9e')]===-0x1){return _0x462087;}logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x9f'),_0x4aa3ba,_0x462087[_0xec4b('0xa0')]));return this['channel'][_0xec4b('0x9b')](_0x4aa3ba,_0x462087[_0xec4b('0xa0')]);};AGIVertices['prototype'][_0xec4b('0x80')]=function(_0x1a035a){return _0x1a035a&&_0x1a035a!=='0'&&_0x1a035a!=='-1'&&_0x1a035a!=='';};AGIVertices[_0xec4b('0x10')]['maxRetry']=function(_0x74e195){this[_0xec4b('0x36')][_0xec4b('0xa1')](this,_0x74e195,'-');_0x74e195[_0xec4b('0xa2')]=_0x74e195[_0xec4b('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x41b432){logger['info'](util['format'](_0xec4b('0xa4'),_0x41b432[_0xec4b('0x38')]));if(!this['isConfigured'](_0x41b432['text'])){return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0xa6'));}var _0x44228a='\x22'+_0x41b432['text']+'\x22';if(this[_0xec4b('0x80')](_0x41b432[_0xec4b('0x73')])){_0x44228a+=','+_0x41b432[_0xec4b('0x73')];}var _0x35ddac=this['channel'][_0xec4b('0xa7')](_0xec4b('0xa8'),_0x44228a);if(_0x35ddac['result']===-0x1){return _0x35ddac;}return this[_0xec4b('0xd')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x44228a));};AGIVertices[_0xec4b('0x10')][_0xec4b('0xa9')]=function(_0xfbd9d1){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0xfbd9d1['label']));if(!this[_0xec4b('0x80')](_0xfbd9d1[_0xec4b('0xaa')])){return this[_0xec4b('0xd')]['noop'](_0xec4b('0xab'));}var _0x4ad453=_0xfbd9d1[_0xec4b('0xaa')];if(this[_0xec4b('0x80')](_0xfbd9d1['options'])){_0x4ad453+=','+_0xfbd9d1[_0xec4b('0x73')];}var _0x41c3e9=this[_0xec4b('0xd')][_0xec4b('0xa7')]('MRCPRecog',_0x4ad453);if(_0x41c3e9[_0xec4b('0x9e')]===-0x1){return _0x41c3e9;}var _0x2d2b76=this['getAndSetVariable'](_0xec4b('0xac'),_0xec4b('0xad'));if(_0x2d2b76['result']===-0x1){return _0x2d2b76;}var _0x32f048=this['getAndSetVariable'](_0xec4b('0xae'),_0xec4b('0xaf'));if(_0x32f048[_0xec4b('0x9e')]===-0x1){return _0x32f048;}var _0x5ba8cd=this[_0xec4b('0xb0')](_0xec4b('0xb1'),'MRCP_RECOG_INSTANCE');if(_0x5ba8cd[_0xec4b('0x9e')]===-0x1){return _0x5ba8cd;}return this['channel'][_0xec4b('0xa5')](util['format'](_0xec4b('0xb2'),_0x4ad453));};AGIVertices['prototype'][_0xec4b('0x8')]=function(_0x3cafde){logger['info'](util[_0xec4b('0x27')](_0xec4b('0xb3'),_0x3cafde[_0xec4b('0x38')]));return this[_0xec4b('0xd')][_0xec4b('0x8')]([_0x3cafde[_0xec4b('0xb4')],_0x3cafde[_0xec4b('0xb5')]]);};AGIVertices[_0xec4b('0x10')][_0xec4b('0xb6')]=function(_0x917337){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0xb7'),_0x917337['label']));if(this[_0xec4b('0x80')](_0x917337[_0xec4b('0x63')])){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x917337['timeout']));var _0x1aa1cf=this[_0xec4b('0xd')][_0xec4b('0xb8')](_0x917337['timeout']);if(_0x1aa1cf[_0xec4b('0x9e')]===-0x1){return _0x1aa1cf;}}return this[_0xec4b('0xd')][_0xec4b('0xb6')]();};AGIVertices['prototype']['callback']=function(_0x350431){logger[_0xec4b('0x2d')](util['format'](_0xec4b('0xb9'),_0x350431[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x350431[_0xec4b('0x49')])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x350431,_0xec4b('0xba'));}_0x350431['scheduledAt']=moment();if(this[_0xec4b('0x80')](_0x350431[_0xec4b('0xbb')])){_0x350431['scheduledAt']=moment()[_0xec4b('0xbc')](_0x350431['delay'],_0xec4b('0xbd'));}if(!this['isConfigured'](_0x350431['callback_priority'])){_0x350431[_0xec4b('0x4d')]=0x2;}this[_0xec4b('0x43')][_0xec4b('0xa1')](this,_0x350431);return this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0xbe'),_0x350431['phone'],_0x350431[_0xec4b('0x49')],_0x350431['scheduledAt']));};AGIVertices[_0xec4b('0x10')][_0xec4b('0xbf')]=function(_0xc04505){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0xc0'),_0xc04505[_0xec4b('0x38')]));var _0x2b38f1=this['channel'][_0xec4b('0xa7')](_0xc04505[_0xec4b('0xc1')],_0xc04505[_0xec4b('0x73')]);if(_0x2b38f1[_0xec4b('0x9e')]===-0x1){return _0x2b38f1;}return this['channel'][_0xec4b('0xa5')](util[_0xec4b('0x27')]('Executed\x20command\x20%s\x20%s',_0xc04505['application'],_0xc04505[_0xec4b('0x73')]));};AGIVertices['prototype'][_0xec4b('0xc2')]=function(_0xacc58f){logger['info'](util[_0xec4b('0x27')](_0xec4b('0xc3'),_0xacc58f[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0xacc58f[_0xec4b('0x5a')])){return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0xa6'));}var _0x56fd5d='\x22'+_0xacc58f[_0xec4b('0x5a')]+'\x22';if(this[_0xec4b('0x80')](_0xacc58f[_0xec4b('0x73')])){_0x56fd5d+=','+_0xacc58f[_0xec4b('0x73')];}var _0x47c1a7=this[_0xec4b('0xd')][_0xec4b('0xa7')](_0xec4b('0xa8'),_0x56fd5d);if(_0x47c1a7[_0xec4b('0x9e')]===-0x1){return _0x47c1a7;}return this[_0xec4b('0xd')]['noop'](util['format'](_0xec4b('0xc4'),_0x56fd5d));};AGIVertices[_0xec4b('0x10')][_0xec4b('0xc5')]=function(_0x97054a){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x97054a[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x97054a[_0xec4b('0x5a')])){return this['channel'][_0xec4b('0xa5')](_0xec4b('0xa6'));}var _0x363c3b='\x22'+_0x97054a['text']+'\x22';if(this[_0xec4b('0x80')](_0x97054a[_0xec4b('0x73')])){_0x363c3b+=','+_0x97054a[_0xec4b('0x73')];}var _0x33b303=this[_0xec4b('0xd')]['exec'](_0xec4b('0xa8'),_0x363c3b);if(_0x33b303[_0xec4b('0x9e')]===-0x1){return _0x33b303;}return this['channel'][_0xec4b('0xa5')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x363c3b));};AGIVertices['prototype'][_0xec4b('0xc6')]=function(_0x2d8e06){logger[_0xec4b('0x2d')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x2d8e06[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x2d8e06[_0xec4b('0xaa')])){return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0xab'));}var _0xa80115=_0x2d8e06[_0xec4b('0xaa')];if(this[_0xec4b('0x80')](_0x2d8e06[_0xec4b('0x73')])){_0xa80115+=','+_0x2d8e06[_0xec4b('0x73')];}var _0x3a70d8=this['channel'][_0xec4b('0xa7')](_0xec4b('0xc7'),_0xa80115);if(_0x3a70d8['result']===-0x1){return _0x3a70d8;}var _0x4398b8=this[_0xec4b('0xb0')]('RECOG_CONFIDENCE()',_0xec4b('0xc8'));if(_0x4398b8['result']===-0x1){return _0x4398b8;}var _0x5aeb7a=this['getAndSetVariable'](_0xec4b('0xae'),_0xec4b('0xc9'));if(_0x5aeb7a['result']===-0x1){return _0x5aeb7a;}var _0x1a9068=this[_0xec4b('0xb0')](_0xec4b('0xb1'),_0xec4b('0xca'));if(_0x1a9068['result']===-0x1){return _0x1a9068;}return this['channel']['noop'](util[_0xec4b('0x27')](_0xec4b('0xb2'),_0xa80115));};AGIVertices[_0xec4b('0x10')][_0xec4b('0xcb')]=function(_0x2de390){logger[_0xec4b('0x2d')](util['format'](_0xec4b('0xcc'),_0x2de390[_0xec4b('0x38')]));if(!this['isConfigured'](_0x2de390['grammar'])){return this['channel'][_0xec4b('0xa5')](_0xec4b('0xab'));}var _0x48986f=_0x2de390[_0xec4b('0xaa')];if(this['isConfigured'](_0x2de390[_0xec4b('0x73')])){_0x48986f+=','+_0x2de390['options'];}var _0x298956=this[_0xec4b('0xd')][_0xec4b('0xa7')](_0xec4b('0xc7'),_0x48986f);if(_0x298956[_0xec4b('0x9e')]===-0x1){return _0x298956;}var _0xbf1b8a=this[_0xec4b('0xb0')](_0xec4b('0xac'),_0xec4b('0xcd'));if(_0xbf1b8a['result']===-0x1){return _0xbf1b8a;}var _0x4fdd8d=this[_0xec4b('0xb0')](_0xec4b('0xae'),_0xec4b('0xce'));if(_0x4fdd8d[_0xec4b('0x9e')]===-0x1){return _0x4fdd8d;}var _0x2b0992=this[_0xec4b('0xb0')](_0xec4b('0xb1'),_0xec4b('0xcf'));if(_0x2b0992[_0xec4b('0x9e')]===-0x1){return _0x2b0992;}return this[_0xec4b('0xd')][_0xec4b('0xa5')](util['format'](_0xec4b('0xb2'),_0x48986f));};AGIVertices['prototype'][_0xec4b('0xd0')]=function(_0x22eb7e){logger[_0xec4b('0x2d')](util['format'](_0xec4b('0xd1'),_0x22eb7e[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x22eb7e[_0xec4b('0xd2')])){return this['channel'][_0xec4b('0x2b')](_0x22eb7e,_0xec4b('0xd3'));}var _0x17efdf=this['getSquareOdbc']['sync'](this,_0x22eb7e['odbc_id']);if(!_0x17efdf){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x22eb7e,_0xec4b('0xd4'));}if(!this['isConfigured'](_0x22eb7e[_0xec4b('0xd5')])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x22eb7e,_0xec4b('0xd6'));}var _0x5b7856=_0x22eb7e[_0xec4b('0xd5')][_0xec4b('0xd7')](/(\r\n|\n|\r)/gm,'\x20');this[_0xec4b('0xd')]['noop'](util[_0xec4b('0x27')]('query:\x20%s',_0x5b7856));var _0x272e5b=this[_0xec4b('0x29')][_0xec4b('0xa1')](this,_0x17efdf,_0x5b7856);this['createSquareDetailsReport'][_0xec4b('0xa1')](this,_0x22eb7e,_0x5b7856);if(!this[_0xec4b('0x80')](_0x22eb7e['variable_id'])){return this['channel']['noop'](_0xec4b('0xd8'));}var _0xc73cfd=this[_0xec4b('0x11')][_0xec4b('0xa1')](this,_0x22eb7e[_0xec4b('0xd9')]);if(!_0xc73cfd){return this[_0xec4b('0xd')]['error'](_0x22eb7e,_0xec4b('0xda'));}var _0x57549f=this;_0x272e5b['forEach'](function(_0x4fa130,_0x320704){Object[_0xec4b('0xdb')](_0x4fa130)['forEach'](function(_0x5e1996){_0x57549f[_0xec4b('0xd')][_0xec4b('0x9b')](util[_0xec4b('0x27')](_0xec4b('0xdc'),_0xc73cfd,_0x320704,_0x5e1996),_0x4fa130[_0x5e1996]);});});this[_0xec4b('0xd')][_0xec4b('0x9b')](util[_0xec4b('0x27')](_0xec4b('0xdd'),_0xc73cfd),_0x272e5b[_0xec4b('0x9a')]);return this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')]('variable\x20%s\x20set',_0xc73cfd));};AGIVertices[_0xec4b('0x10')]['dial']=function(_0xb9f8a9){logger[_0xec4b('0xde')](util[_0xec4b('0x27')](_0xec4b('0xdf'),_0xb9f8a9[_0xec4b('0x38')]));if(!this['isConfigured'](_0xb9f8a9[_0xec4b('0xe0')])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0xb9f8a9,_0xec4b('0xe1'));}var _0x5f4fc6=this['getUser'][_0xec4b('0xa1')](this,_0xb9f8a9['sip_id']);if(!_0x5f4fc6){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0xb9f8a9,_0xec4b('0xe2'));}var _0x2d4314=this[_0xec4b('0xd')][_0xec4b('0xa7')]('DIAL',[util[_0xec4b('0x27')](_0xec4b('0xe3'),_0x5f4fc6),_0xb9f8a9[_0xec4b('0x63')],_0xb9f8a9[_0xec4b('0xe4')],_0xb9f8a9[_0xec4b('0x61')]]);if(_0x2d4314[_0xec4b('0x9e')]===-0x1){return _0x2d4314;}return this[_0xec4b('0xd')]['noop'](util[_0xec4b('0x27')](_0xec4b('0xe5'),_0xec4b('0xe6')));};AGIVertices[_0xec4b('0x10')]['dialogflow']=function(_0x126320){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0xe7'),_0x126320[_0xec4b('0x38')]));if(!this['isConfigured'](_0x126320[_0xec4b('0x75')])){return this[_0xec4b('0xd')][_0xec4b('0xa5')]('no\x20key\x20configured');}if(!this[_0xec4b('0x80')](_0x126320[_0xec4b('0x5a')])){return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0xa6'));}this['channel'][_0xec4b('0xe8')]=!![];this[_0xec4b('0x36')](_0x126320);this[_0xec4b('0x42')](_0x126320[_0xec4b('0x5a')],'in','','');this['channel'][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0xe9'),_0x126320[_0xec4b('0x5a')]));var _0x7f33d8=this['googleDialogflow'][_0xec4b('0xa1')](this,_0x126320);if(_0x7f33d8){for(var _0x5bbb0e in _0x7f33d8){if(_0x7f33d8[_0xec4b('0x92')](_0x5bbb0e)){this['channel']['setVariable'](util[_0xec4b('0x27')]('DIALOGFLOW_%s',_0x5bbb0e[_0xec4b('0x66')]()),_0x7f33d8[_0x5bbb0e]);}}this[_0xec4b('0x42')](_0x7f33d8[_0xec4b('0xea')],'out',_0xec4b('0xeb'),'');return this[_0xec4b('0xd')][_0xec4b('0xa5')](util['format']('Dialogflow\x20Result\x20%s',_0x7f33d8[_0xec4b('0xea')]));}return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x126320,_0xec4b('0xec'));};AGIVertices['prototype'][_0xec4b('0xed')]=function(_0x3c7d2b){logger[_0xec4b('0x2d')](util['format'](_0xec4b('0xee'),_0x3c7d2b[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x3c7d2b[_0xec4b('0x77')])){return this['channel']['noop'](_0xec4b('0xef'));}if(!this[_0xec4b('0x80')](_0x3c7d2b['client_email'])){return this[_0xec4b('0xd')]['noop'](_0xec4b('0xf0'));}if(!this[_0xec4b('0x80')](_0x3c7d2b[_0xec4b('0x79')])){return this['channel'][_0xec4b('0xa5')](_0xec4b('0xf1'));}if(!this[_0xec4b('0x80')](_0x3c7d2b['dialogflowV2_language'])){return this[_0xec4b('0xd')][_0xec4b('0xa5')]('no\x20anguage\x20configured');}if(!this[_0xec4b('0x80')](_0x3c7d2b[_0xec4b('0x5a')])){return this[_0xec4b('0xd')]['noop']('no\x20text\x20configured');}this[_0xec4b('0xd')][_0xec4b('0xe8')]=!![];this[_0xec4b('0x36')](_0x3c7d2b);this[_0xec4b('0x42')](_0x3c7d2b[_0xec4b('0x5a')],'in','','');this[_0xec4b('0xd')][_0xec4b('0xa5')](util['format'](_0xec4b('0xf2'),_0x3c7d2b[_0xec4b('0x5a')]));var _0x18400f=this['googleDialogflowV2'][_0xec4b('0xa1')](this,_0x3c7d2b);if(_0x18400f){for(var _0x4e0edd in _0x18400f){if(_0x18400f[_0xec4b('0x92')](_0x4e0edd)){if(_0x4e0edd!=='providerResponse'){this[_0xec4b('0xd')][_0xec4b('0x9b')](util['format'](_0xec4b('0xf3'),_0x4e0edd[_0xec4b('0x66')]()),_0x18400f[_0x4e0edd]);}}}this[_0xec4b('0x42')](_0x18400f[_0xec4b('0xea')],'out',_0xec4b('0xed'),_0x18400f[_0xec4b('0xf4')]);return this['channel'][_0xec4b('0xa5')](util[_0xec4b('0x27')]('DialogflowV2\x20Result\x20%s',_0x18400f['speech']));}return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x3c7d2b,_0xec4b('0xf5'));};AGIVertices[_0xec4b('0x10')][_0xec4b('0xf6')]=function(_0x4e0411){logger[_0xec4b('0x2d')](util['format'](_0xec4b('0xf7'),_0x4e0411[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x4e0411[_0xec4b('0xf8')])){return this[_0xec4b('0xd')]['noop']('no\x20ndauth\x20url\x20configured');}if(!this[_0xec4b('0x80')](_0x4e0411[_0xec4b('0xf9')])){return this[_0xec4b('0xd')][_0xec4b('0xa5')]('no\x20username\x20configured');}if(!this[_0xec4b('0x80')](_0x4e0411[_0xec4b('0xfa')])){return this['channel'][_0xec4b('0xa5')](_0xec4b('0xfb'));}if(!this[_0xec4b('0x80')](_0x4e0411[_0xec4b('0xfc')])){return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0xa6'));}this['channel']['bot']=!![];this[_0xec4b('0x36')](_0x4e0411);this[_0xec4b('0x42')](_0x4e0411['text'],'in','','');this[_0xec4b('0xd')]['noop'](util[_0xec4b('0x27')](_0xec4b('0xfd'),_0x4e0411[_0xec4b('0x5a')]));var _0x4600e2=this[_0xec4b('0x7b')]['sync'](this,_0x4e0411);if(_0x4600e2){for(var _0x1f103d in _0x4600e2){if(_0x4600e2[_0xec4b('0x92')](_0x1f103d)){this['channel'][_0xec4b('0x9b')](util['format'](_0xec4b('0xfe'),_0x1f103d[_0xec4b('0x66')]()),_0x4600e2[_0x1f103d]);}}this['createSquareMessage'](_0x4600e2[_0xec4b('0xea')],'out',_0xec4b('0xf6'),'');if(_0x4600e2[_0xec4b('0xff')]){this[_0xec4b('0xd')][_0xec4b('0xa5')](util['format'](_0xec4b('0x100'),_0x4600e2['audiofile']));var _0x9cda69=this[_0xec4b('0xd')][_0xec4b('0x101')](_0x4600e2['audiofile']);try{fs[_0xec4b('0x102')](_0x4600e2[_0xec4b('0xff')]+'.wav');}catch(_0x588aec){logger[_0xec4b('0x2b')](_0x588aec);}return _0x9cda69;}else{return this[_0xec4b('0xd')][_0xec4b('0xa5')](util['format']('SestekNDA\x20Result\x20%s',_0x4600e2[_0xec4b('0xea')]));}}return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x4e0411,_0xec4b('0x103'));};AGIVertices[_0xec4b('0x10')]['end']=function(_0x12c3ec){logger[_0xec4b('0x2d')](util['format'](_0xec4b('0x104'),_0x12c3ec[_0xec4b('0x38')]));return this[_0xec4b('0xd')][_0xec4b('0xa5')]('end');};AGIVertices[_0xec4b('0x10')]['ext_dial']=function(_0x272938){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x272938['label']));var _0x522469='';if(_0x272938[_0xec4b('0x105')]){if(!this[_0xec4b('0x80')](_0x272938[_0xec4b('0x105')])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x272938,_0xec4b('0x106'));}else{var _0x3b98d1=parseInt(_0x272938[_0xec4b('0x105')],0xa);if(isNaN(_0x3b98d1)){_0x522469=_0x272938[_0xec4b('0x105')];}else{_0x522469=this[_0xec4b('0x1d')][_0xec4b('0xa1')](this,_0x272938[_0xec4b('0x105')]);if(!_0x522469){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x272938,_0xec4b('0x107'));}}}}else if(_0x272938[_0xec4b('0x108')]){_0x522469=_0x272938[_0xec4b('0x108')];}else{return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x272938,_0xec4b('0x106'));}var _0x32c77c=this['channel'][_0xec4b('0xa7')](_0xec4b('0xe6'),[util['format'](_0xec4b('0x109'),_0x522469,_0x272938[_0xec4b('0x10a')]),_0x272938[_0xec4b('0x63')],_0x272938[_0xec4b('0xe4')],_0x272938[_0xec4b('0x61')]]);if(_0x32c77c[_0xec4b('0x9e')]===-0x1){return _0x32c77c;}return this[_0xec4b('0xd')]['noop'](util[_0xec4b('0x27')](_0xec4b('0xe5'),_0xec4b('0xe6')));};AGIVertices['prototype'][_0xec4b('0x10b')]=function(_0x5475b4){logger[_0xec4b('0x2d')](util['format'](_0xec4b('0x10c'),_0x5475b4[_0xec4b('0x38')]));return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0x10b'));};AGIVertices['prototype'][_0xec4b('0x10d')]=function(_0x30dd1e){logger['info'](util[_0xec4b('0x27')](_0xec4b('0x10e'),_0x30dd1e['label']));if(_0x30dd1e[_0xec4b('0xa2')]===0x0){return this[_0xec4b('0xa3')](_0x30dd1e);}_0x30dd1e[_0xec4b('0xa2')]-=0x1;if(!this['isConfigured'](_0x30dd1e[_0xec4b('0x10f')])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x30dd1e,_0xec4b('0x110'));}var _0x29f631=this[_0xec4b('0x1e')]['sync'](this,_0x30dd1e[_0xec4b('0x10f')]);if(!_0x29f631){return this['channel'][_0xec4b('0x2b')](_0x30dd1e,_0xec4b('0x111'));}if(!this[_0xec4b('0x80')](_0x30dd1e['variable_id'])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0xec4b('0xd8'));}var _0x398413=this[_0xec4b('0xd')]['getData'](_0x29f631,_0x30dd1e[_0xec4b('0x112')],_0x30dd1e[_0xec4b('0x113')]);var _0x1a601e=_0x398413[_0xec4b('0x9e')]?_0x398413['result'][_0xec4b('0x4c')]():'';logger[_0xec4b('0x2d')](_0xec4b('0x114'),JSON[_0xec4b('0x6e')](_0x398413));if(_0x398413[_0xec4b('0x9e')]===-0x1){this[_0xec4b('0x36')][_0xec4b('0xa1')](this,_0x30dd1e,_0x1a601e);return _0x398413;}else if(_0x398413[_0xec4b('0xa0')]==='timeout'){_0x398413[_0xec4b('0x9e')]=_0x1a601e['length']>=parseInt(_0x30dd1e[_0xec4b('0x115')])?'x':'i';}else{_0x398413['result']=_0x1a601e['length']>=parseInt(_0x30dd1e[_0xec4b('0x115')])&&_0x1a601e['length']<=parseInt(_0x30dd1e['maxdigit'])?'x':'i';}var _0x3145a3=this[_0xec4b('0x11')]['sync'](this,_0x30dd1e[_0xec4b('0xd9')]);if(!_0x3145a3){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x30dd1e,'no\x20variable\x20found');}this[_0xec4b('0xd')][_0xec4b('0x9b')](_0x3145a3,_0x1a601e);if(this[_0xec4b('0x80')](_0x30dd1e[_0xec4b('0x116')])){var _0x493d1e=parseInt(_0x30dd1e[_0xec4b('0x116')],0xa);var _0x12961a=rs[_0xec4b('0x117')]({'charset':'*','length':_0x493d1e});var _0x1126a1=_0x1a601e[_0xec4b('0x9a')];if(_0x1126a1>0x0){if(_0x1126a1>_0x493d1e){this[_0xec4b('0x36')][_0xec4b('0xa1')](this,_0x30dd1e,_0x30dd1e[_0xec4b('0x118')]===_0xec4b('0x119')?_0x12961a+_0x1a601e[_0xec4b('0x11a')](_0x493d1e):_0x1a601e[_0xec4b('0x11a')](0x0,_0x1126a1-_0x493d1e)+_0x12961a);}else{this[_0xec4b('0x36')][_0xec4b('0xa1')](this,_0x30dd1e,rs['generate']({'charset':'*','length':_0x1126a1}));}}else{this[_0xec4b('0x36')][_0xec4b('0xa1')](this,_0x30dd1e,'');}}else{this[_0xec4b('0x36')][_0xec4b('0xa1')](this,_0x30dd1e,_0x1a601e);}return _0x398413;};AGIVertices[_0xec4b('0x10')][_0xec4b('0xc')]=function(_0xd63c7){logger['info'](util[_0xec4b('0x27')](_0xec4b('0x11b'),_0xd63c7[_0xec4b('0x38')]));return this[_0xec4b('0x10d')](_0xd63c7);};AGIVertices[_0xec4b('0x10')][_0xec4b('0x11c')]=function(_0x548c66){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x11d'),_0x548c66[_0xec4b('0x38')]));this[_0xec4b('0x36')][_0xec4b('0xa1')](this,_0x548c66,_0x548c66[_0xec4b('0x11e')]);return this['channel'][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0x11f'),_0x548c66[_0xec4b('0x11e')]));};AGIVertices[_0xec4b('0x10')]['awspolly']=function(_0x4b0e07){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x120'),_0x4b0e07[_0xec4b('0x38')]));if(!this['isConfigured'](_0x4b0e07['aws_access_key_id'])||!this[_0xec4b('0x80')](_0x4b0e07[_0xec4b('0x84')])){return this[_0xec4b('0xd')][_0xec4b('0xa5')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xec4b('0x80')](_0x4b0e07[_0xec4b('0x5a')])){return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0xa6'));}this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')]('Trying\x20aws\x20Polly\x20%s',_0x4b0e07[_0xec4b('0x5a')]));var _0x27265a=this[_0xec4b('0x82')][_0xec4b('0xa1')](this,_0x4b0e07);if(_0x27265a){this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0x121'),_0x27265a));var _0x192e58=this['channel']['streamFile'](_0x27265a);try{fs[_0xec4b('0x102')](_0x27265a+'.wav');}catch(_0x543ab3){logger[_0xec4b('0x2b')](_0x543ab3);}return _0x192e58;}return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x4b0e07,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xec4b('0x10')]['awslex']=function(_0x27e375){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x122'),_0x27e375[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x27e375[_0xec4b('0x83')])||!this[_0xec4b('0x80')](_0x27e375[_0xec4b('0x84')])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0xec4b('0x80')](_0x27e375[_0xec4b('0x8a')])){return this[_0xec4b('0xd')][_0xec4b('0xa5')]('no\x20bot\x20name\x20configured');}if(!this[_0xec4b('0x80')](_0x27e375[_0xec4b('0x5a')])){return this[_0xec4b('0xd')]['noop']('no\x20text\x20configured');}this['channel'][_0xec4b('0xe8')]=!![];this[_0xec4b('0x36')](_0x27e375);this[_0xec4b('0x42')](_0x27e375[_0xec4b('0x5a')],'in','','');this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0x123'),_0x27e375[_0xec4b('0x5a')]));var _0x2b681b=this[_0xec4b('0x88')][_0xec4b('0xa1')](this,_0x27e375);if(_0x2b681b){for(var _0x119674 in _0x2b681b){if(_0x2b681b[_0xec4b('0x92')](_0x119674)&&_[_0xec4b('0x93')](_0x2b681b[_0x119674])){this[_0xec4b('0xd')][_0xec4b('0x9b')](util[_0xec4b('0x27')]('AWS_LEX_%s',_0x119674[_0xec4b('0x66')]()),_0x2b681b[_0x119674]);}}if(_['isNil'](_0x2b681b[_0xec4b('0x71')])){return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0x124'));}else{this[_0xec4b('0x42')](_0x2b681b['message'],'out',_0xec4b('0x125'),'');return this[_0xec4b('0xd')][_0xec4b('0xa5')](util['format'](_0xec4b('0x126'),_0x2b681b[_0xec4b('0x71')]));}}return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x27e375,_0xec4b('0x127'));};AGIVertices[_0xec4b('0x10')][_0xec4b('0x128')]=function(_0x54158b){logger[_0xec4b('0x2d')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x54158b[_0xec4b('0x38')],_0x54158b[_0xec4b('0x63')]));if(!this[_0xec4b('0x80')](_0x54158b[_0xec4b('0x75')])){return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0x129'));}var _0x20eeb9=_0xec4b('0x12a');var _0x1f8054=util['format'](_0xec4b('0x12b'),FILES_PATH,rs['generate'](0x4));var _0x47170c=util[_0xec4b('0x27')](_0xec4b('0x98'),_0x1f8054,_0x20eeb9);var _0x1a5f58=!![];if(_0x54158b[_0xec4b('0x12c')]===_0xec4b('0x12d')){_0x1a5f58=![];}var _0x33a193=this[_0xec4b('0xd')]['recordFile'](_0x1f8054,_0x20eeb9,_0x54158b[_0xec4b('0x12e')],_0x54158b[_0xec4b('0x63')],undefined,_0x1a5f58);if(_0x33a193[_0xec4b('0x9e')]!==-0x1){this[_0xec4b('0xd')][_0xec4b('0xa5')](util['format'](_0xec4b('0x12f'),_0x47170c));var _0x3ee2a0=this[_0xec4b('0x8b')][_0xec4b('0xa1')](this,_0x54158b,_0x47170c);if(_0x3ee2a0){for(var _0x5a9763 in _0x3ee2a0){if(_0x3ee2a0[_0xec4b('0x92')](_0x5a9763)){this['channel'][_0xec4b('0x9b')](util['format'](_0xec4b('0x130'),_0x5a9763[_0xec4b('0x66')]()),_0x3ee2a0[_0x5a9763]);}}return this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0x131'),JSON[_0xec4b('0x6e')](_0x3ee2a0)));}}return _0x33a193;};AGIVertices['prototype'][_0xec4b('0x132')]=function(_0x56e23f){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x133'),_0x56e23f[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x56e23f[_0xec4b('0x8e')])){return this[_0xec4b('0xd')]['noop'](_0xec4b('0x134'));}if(!this[_0xec4b('0x80')](_0x56e23f[_0xec4b('0x8f')])){return this[_0xec4b('0xd')]['noop'](_0xec4b('0x135'));}var _0x5f4b24=_0xec4b('0x12a');var _0x4989c4=util['format']('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x29dc8f=util[_0xec4b('0x27')](_0xec4b('0x98'),_0x4989c4,_0x5f4b24);var _0x11b3a7=!![];if(_0x56e23f['beep']===_0xec4b('0x12d')){_0x11b3a7=![];}var _0x1451f5=this[_0xec4b('0xd')][_0xec4b('0x136')](_0x4989c4,_0x5f4b24,_0x56e23f[_0xec4b('0x12e')],_0x56e23f['timeout'],undefined,_0x11b3a7);if(_0x1451f5[_0xec4b('0x9e')]!==-0x1){this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0x137'),_0x29dc8f));var _0x685015=this[_0xec4b('0x8d')][_0xec4b('0xa1')](this,_0x56e23f,_0x29dc8f);if(_0x685015){for(var _0x160141 in _0x685015){if(_0x685015['hasOwnProperty'](_0x160141)){this[_0xec4b('0xd')][_0xec4b('0x9b')](util['format'](_0xec4b('0x138'),_0x160141[_0xec4b('0x66')]()),_0x685015[_0x160141]);}}return this['channel'][_0xec4b('0xa5')](util[_0xec4b('0x27')]('TildeASR\x20Result\x20%s',JSON[_0xec4b('0x6e')](_0x685015)));}}return _0x1451f5;};AGIVertices[_0xec4b('0x10')]['gotoc']=function(_0x3d84f6){logger['info'](util[_0xec4b('0x27')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x3d84f6['label']));return this[_0xec4b('0xd')][_0xec4b('0x139')](_0x3d84f6[_0xec4b('0x3d')],_0x3d84f6[_0xec4b('0x3e')],_0x3d84f6['priority']);};AGIVertices['prototype'][_0xec4b('0x13a')]=function(_0x4fe580){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x13b'),_0x4fe580['label']));if(!this[_0xec4b('0x80')](_0x4fe580[_0xec4b('0x13c')])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x4fe580,_0xec4b('0x13d'));}try{var _0x270425=eval(_0x4fe580['condition'])?_0xec4b('0x13e'):_0xec4b('0x13f');this['channel']['noop'](util[_0xec4b('0x27')](_0xec4b('0x140'),_0x4fe580[_0xec4b('0x13c')],_0x270425));return{'code':0xc8,'result':_0x270425};}catch(_0x4135b4){return{'code':0xc8,'result':_0xec4b('0x13f')};}};AGIVertices['prototype'][_0xec4b('0x141')]=function(_0x2953fb){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x2953fb[_0xec4b('0x38')]));if(!this['isConfigured'](_0x2953fb[_0xec4b('0x142')])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x2953fb,_0xec4b('0x143'));}var _0x10b7e0=this[_0xec4b('0x22')][_0xec4b('0xa1')](this,_0x2953fb[_0xec4b('0x142')]);if(!_0x10b7e0){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x2953fb,_0xec4b('0x144'));}for(var _0x5bdaca=0x0;_0x5bdaca<_0x10b7e0[_0xec4b('0x9a')];_0x5bdaca+=0x1){var _0x2c25d2=this['channel']['getVariable'](util[_0xec4b('0x27')](_0xec4b('0x145'),_0x10b7e0[_0x5bdaca]));if(_0x2c25d2[_0xec4b('0x9e')]===-0x1){return _0x2c25d2;}logger[_0xec4b('0x2d')](util['format']('IFTIME\x20%s\x20%s',_0x10b7e0[_0x5bdaca],_0x2c25d2[_0xec4b('0xa0')]));if(_0x2c25d2[_0xec4b('0xa0')]===_0xec4b('0x13e')){logger['info'](util[_0xec4b('0x27')]('IFTIME\x20%s\x20%s',_0x10b7e0[_0x5bdaca],_0xec4b('0x13e')));this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0x146'),_0x10b7e0[_0x5bdaca],_0xec4b('0x13e')));return{'code':0xc8,'result':_0xec4b('0x13e')};}else{logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x146'),_0x10b7e0[_0x5bdaca],_0xec4b('0x13f')));this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0x146'),_0x10b7e0[_0x5bdaca],_0xec4b('0x13f')));}}return{'code':0xc8,'result':_0xec4b('0x13f')};};AGIVertices[_0xec4b('0x10')]['hangup']=function(_0x3034ad){logger[_0xec4b('0x2d')](util['format'](_0xec4b('0x147'),_0x3034ad[_0xec4b('0x38')]));return this[_0xec4b('0xd')][_0xec4b('0x148')]();};AGIVertices[_0xec4b('0x10')][_0xec4b('0x149')]=function(_0x573449){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x573449[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x573449[_0xec4b('0x75')])){return this[_0xec4b('0xd')]['noop'](_0xec4b('0x129'));}var _0x322b12='wav';var _0x4016ae=util[_0xec4b('0x27')](_0xec4b('0x12b'),FILES_PATH,rs['generate'](0x4));var _0x4829e5=util[_0xec4b('0x27')](_0xec4b('0x98'),_0x4016ae,_0x322b12);var _0x30ea91=!![];if(_0x573449[_0xec4b('0x12c')]===_0xec4b('0x12d')){_0x30ea91=![];}var _0x18a965=this[_0xec4b('0xd')][_0xec4b('0x136')](_0x4016ae,_0x322b12,_0x573449[_0xec4b('0x12e')],_0x573449['timeout'],undefined,_0x30ea91);if(_0x18a965['result']!==-0x1){this[_0xec4b('0xd')]['noop'](util[_0xec4b('0x27')](_0xec4b('0x14a'),_0x4829e5));var _0x294773=this[_0xec4b('0x7f')]['sync'](this,_0x573449,_0x4829e5);if(_0x294773){for(var _0x504d84 in _0x294773){if(_0x294773['hasOwnProperty'](_0x504d84)){this[_0xec4b('0xd')]['setVariable'](util[_0xec4b('0x27')]('ISPEECH_ASR_%s',_0x504d84[_0xec4b('0x66')]()),_0x294773[_0x504d84]);}}return this[_0xec4b('0xd')][_0xec4b('0xa5')](util['format'](_0xec4b('0x14b'),JSON[_0xec4b('0x6e')](_0x294773)));}}return _0x18a965;};AGIVertices[_0xec4b('0x10')][_0xec4b('0x14c')]=function(_0x28b092){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x14d'),_0x28b092[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x28b092[_0xec4b('0x75')])){return this['channel'][_0xec4b('0xa5')](_0xec4b('0x129'));}if(!this[_0xec4b('0x80')](_0x28b092[_0xec4b('0x5a')])){return this[_0xec4b('0xd')][_0xec4b('0xa5')]('no\x20text\x20configured');}this['channel'][_0xec4b('0xa5')](util['format'](_0xec4b('0x14e'),_0x28b092[_0xec4b('0x5a')]));var _0x4b9217=this[_0xec4b('0x7c')][_0xec4b('0xa1')](this,_0x28b092);if(_0x4b9217){this['channel'][_0xec4b('0xa5')](util[_0xec4b('0x27')]('ispeech\x20%s\x20file\x20created',_0x4b9217));var _0x8f0a04=this[_0xec4b('0xd')][_0xec4b('0x101')](_0x4b9217,_0x28b092[_0xec4b('0x12e')]);try{fs[_0xec4b('0x102')](_0x4b9217+_0xec4b('0x14f'));}catch(_0x6cad20){logger[_0xec4b('0x2b')](_0x6cad20);}return _0x8f0a04;}return this['channel'][_0xec4b('0x2b')](_0x28b092,_0xec4b('0x150'));};AGIVertices[_0xec4b('0x10')][_0xec4b('0x151')]=function(_0x5ebab1){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x152'),_0x5ebab1[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x5ebab1['findBy'])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x5ebab1,_0xec4b('0x153'));}logger[_0xec4b('0x2d')](util[_0xec4b('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xec4b('0xd')][_0xec4b('0x3b')],_0x5ebab1['findBy']));var _0xdee7ac=this[_0xec4b('0x52')]['sync'](this,_0x5ebab1['findBy']);if(_0xdee7ac){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x154'),this[_0xec4b('0xd')][_0xec4b('0x3b')],_0x5ebab1[_0xec4b('0x155')]));this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xec4b('0xd')][_0xec4b('0x3b')],_0x5ebab1[_0xec4b('0x155')]));return{'code':0xc8,'result':_0xec4b('0x156')};}else{logger['info'](util[_0xec4b('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xec4b('0xd')][_0xec4b('0x3b')],_0x5ebab1[_0xec4b('0x155')]));this['channel'][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0x157'),this[_0xec4b('0xd')]['callerid'],_0x5ebab1[_0xec4b('0x155')]));return{'code':0xc8,'result':_0xec4b('0x158')};}};AGIVertices[_0xec4b('0x10')][_0xec4b('0x159')]=function(_0x3f0c88){logger[_0xec4b('0x2d')](util['format'](_0xec4b('0x15a'),_0x3f0c88[_0xec4b('0x38')]));if(!this['isConfigured'](_0x3f0c88['findBy'])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x3f0c88,'no\x20find\x20by\x20configured');}logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x15b'),this[_0xec4b('0xd')][_0xec4b('0x3b')],_0x3f0c88['findBy']));var _0x594581=this['agentLogout'][_0xec4b('0xa1')](this,_0x3f0c88['findBy']);if(_0x594581){logger[_0xec4b('0x2d')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xec4b('0xd')][_0xec4b('0x3b')],_0x3f0c88[_0xec4b('0x155')]));this[_0xec4b('0xd')]['noop'](util[_0xec4b('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xec4b('0x3b')],_0x3f0c88[_0xec4b('0x155')]));return{'code':0xc8,'result':_0xec4b('0x156')};}else{logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x157'),this[_0xec4b('0xd')][_0xec4b('0x3b')],_0x3f0c88[_0xec4b('0x155')]));this['channel']['noop'](util['format'](_0xec4b('0x157'),this['channel'][_0xec4b('0x3b')],_0x3f0c88[_0xec4b('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xec4b('0x10')][_0xec4b('0x15c')]=function(_0x1aba6d){logger['info'](util[_0xec4b('0x27')](_0xec4b('0x15d'),_0x1aba6d[_0xec4b('0x38')]));if(!this['isConfigured'](_0x1aba6d[_0xec4b('0x15e')])){return this[_0xec4b('0xd')]['error'](_0x1aba6d,_0xec4b('0x15f'));}this[_0xec4b('0xd')][_0xec4b('0xa5')](util['format']('math\x20%s',_0x1aba6d['operation']));var _0x2f3678=eval(_0x1aba6d[_0xec4b('0x15e')]);if(!this['isConfigured'](_0x1aba6d[_0xec4b('0xd9')])){return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0xd8'));}var _0x41f694=this[_0xec4b('0x11')]['sync'](this,_0x1aba6d[_0xec4b('0xd9')]);if(!_0x41f694){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x1aba6d,_0xec4b('0xda'));}if(_[_0xec4b('0x99')](_0x2f3678)){var _0x3c8f7f=this;_0x2f3678[_0xec4b('0x160')](function(_0x425a83,_0x2fb231){_0x3c8f7f[_0xec4b('0xd')]['setVariable'](util[_0xec4b('0x27')](_0xec4b('0x161'),_0x41f694,_0x2fb231),_0x425a83);});return this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0x162'),_0x41f694));}else{return this[_0xec4b('0xd')]['setVariable'](_0x41f694,_0x2f3678);}};AGIVertices[_0xec4b('0x10')]['menu']=function(_0x5300f4){logger[_0xec4b('0x2d')](util['format'](_0xec4b('0x163'),_0x5300f4[_0xec4b('0x38')]));if(_0x5300f4['retry']===0x0){return this['maxRetry'](_0x5300f4);}_0x5300f4[_0xec4b('0xa2')]-=0x1;if(!this[_0xec4b('0x80')](_0x5300f4[_0xec4b('0x10f')])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x5300f4,'no\x20file\x20audio\x20selected');}var _0x5750a3=this[_0xec4b('0x1e')][_0xec4b('0xa1')](this,_0x5300f4[_0xec4b('0x10f')]);if(!_0x5750a3){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x5300f4,_0xec4b('0x111'));}var _0x5a660e=this['channel']['getData'](_0x5750a3,_0x5300f4[_0xec4b('0x112')],_0x5300f4[_0xec4b('0x164')]);var _0x2c43de=_0x5a660e['result'];if(_0x5a660e[_0xec4b('0x9e')]===-0x1){this['createSquareDetailsReport'][_0xec4b('0xa1')](this,_0x5300f4,'-1');return _0x5a660e;}else if(_0x5a660e[_0xec4b('0xa0')]==='timeout'){_0x5a660e['result']=_0x5a660e[_0xec4b('0x9e')][_0xec4b('0x9a')]>0x0?_0x5a660e['result']:'t';}else if(_[_0xec4b('0x44')](_0x5a660e[_0xec4b('0x9e')])){_0x5a660e[_0xec4b('0x9e')]='#';_0x2c43de='#';}if(!this[_0xec4b('0x80')](_0x5300f4[_0xec4b('0xd9')])){this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0xd8'));}else{var _0x1fb132=this[_0xec4b('0x11')][_0xec4b('0xa1')](this,_0x5300f4[_0xec4b('0xd9')]);if(!_0x1fb132){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x5300f4,_0xec4b('0xda'));}this[_0xec4b('0xd')]['setVariable'](_0x1fb132,_0x2c43de);}this['createSquareDetailsReport'][_0xec4b('0xa1')](this,_0x5300f4,_0x2c43de);return _0x5a660e;};AGIVertices[_0xec4b('0x10')][_0xec4b('0xa5')]=function(_0x3bf572){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x165'),_0x3bf572[_0xec4b('0x38')]));return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0x3bf572[_0xec4b('0x166')]||_0x3bf572[_0xec4b('0x38')]);};AGIVertices[_0xec4b('0x10')][_0xec4b('0x167')]=function(_0x3faded){logger[_0xec4b('0x2d')](util['format'](_0xec4b('0x168'),_0x3faded[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x3faded[_0xec4b('0x155')])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x3faded,'no\x20find\x20by\x20configured');}logger[_0xec4b('0x2d')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x3faded[_0xec4b('0x155')]));var _0x3d1216=this['getPause'][_0xec4b('0xa1')](this,_0x3faded[_0xec4b('0x169')]);var _0x579338=this[_0xec4b('0x4e')][_0xec4b('0xa1')](this,_0x3faded[_0xec4b('0x155')],_0x3d1216);if(_0x579338){logger['info'](util[_0xec4b('0x27')](_0xec4b('0x154'),this[_0xec4b('0xd')][_0xec4b('0x3b')],_0x3faded[_0xec4b('0x155')]));this['channel']['noop'](util[_0xec4b('0x27')](_0xec4b('0x154'),this[_0xec4b('0xd')][_0xec4b('0x3b')],_0x3faded[_0xec4b('0x155')]));return{'code':0xc8,'result':_0xec4b('0x156')};}else{logger[_0xec4b('0x2d')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xec4b('0xd')]['callerid'],_0x3faded[_0xec4b('0x155')]));this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0x154'),this[_0xec4b('0xd')][_0xec4b('0x3b')],_0x3faded['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xec4b('0x16a')]=function(_0x46ff9a){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x46ff9a[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x46ff9a[_0xec4b('0x10f')])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x46ff9a,_0xec4b('0x110'));}var _0x170df8=this[_0xec4b('0x1e')][_0xec4b('0xa1')](this,_0x46ff9a[_0xec4b('0x10f')]);if(!_0x170df8){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x46ff9a,_0xec4b('0x111'));}var _0x4452c0=this['channel'][_0xec4b('0xa7')]('PLAYBACK',[_0x170df8,_0x46ff9a[_0xec4b('0xe4')]]);if(_0x4452c0[_0xec4b('0x9e')]===-0x1){return _0x4452c0;}return this[_0xec4b('0xd')][_0xec4b('0xa5')](util['format'](_0xec4b('0x16b'),_0xec4b('0x16c'),_0x170df8));};AGIVertices[_0xec4b('0x10')][_0xec4b('0x16d')]=function(_0x548111){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x548111['label']));if(!this['isConfigured'](_0x548111[_0xec4b('0x16e')])){return this['channel'][_0xec4b('0x2b')](_0x548111,_0xec4b('0x16f'));}var _0x19896e='';var _0x59cc55=parseInt(_0x548111['queue_id'],0xa);if(isNaN(_0x59cc55)){_0x19896e=_0x548111['queue_id'];}else{_0x19896e=this[_0xec4b('0x15')][_0xec4b('0xa1')](this,_0x548111[_0xec4b('0x16e')]);if(!_0x19896e){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x548111,_0xec4b('0x170'));}}var _0x16e1f4='';if(this[_0xec4b('0x80')](_0x548111[_0xec4b('0x10f')])){var _0x3b6d01=this['getSound'][_0xec4b('0xa1')](this,_0x548111[_0xec4b('0x10f')]);if(_0x3b6d01){_0x16e1f4=_0x3b6d01;}}this[_0xec4b('0x36')][_0xec4b('0xa1')](this,_0x548111,_0x19896e);if(_0x548111[_0xec4b('0xe4')][_0xec4b('0x171')]('x')<0x0){_0x548111[_0xec4b('0xe4')]+='x';}if(_0x548111[_0xec4b('0xe4')][_0xec4b('0x171')]('X')<0x0){_0x548111[_0xec4b('0xe4')]+='X';}this[_0xec4b('0xd')][_0xec4b('0x9b')](_0xec4b('0x172'),_0x19896e?_0x19896e['toLowerCase']():'');var _0x482bb2=this[_0xec4b('0xd')][_0xec4b('0xa7')](_0xec4b('0x173'),[_0x19896e,_0x548111[_0xec4b('0xe4')],_0x548111[_0xec4b('0x61')],_0x16e1f4,_0x548111['timeout'],_0x548111[_0xec4b('0x8')],_0x548111[_0xec4b('0x174')],_0x548111[_0xec4b('0x175')],'',_0x548111['position']]);if(_0x482bb2[_0xec4b('0x9e')]===-0x1){return _0x482bb2;}return this[_0xec4b('0xd')][_0xec4b('0xa5')](util['format']('Executed\x20command\x20%s\x20%s',_0xec4b('0x173'),_0x19896e));};AGIVertices[_0xec4b('0x10')][_0xec4b('0x176')]=function(_0x1fac48){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x1fac48['label']));var _0x4d3ea1=_0x1fac48['recordingFormat']||_0xec4b('0x12a');var _0x1c226a=util[_0xec4b('0x27')]('%s_%s',this['channel'][_0xec4b('0x37')],rs[_0xec4b('0x117')](0x5));var _0x326588=util[_0xec4b('0x27')](_0xec4b('0x177'),FILES_PATH,_0x1c226a,_0x4d3ea1);var _0x3ded91=util[_0xec4b('0x27')](_0xec4b('0x12b'),FILES_PATH,_0x1c226a);this[_0xec4b('0x3c')][_0xec4b('0xa1')](this,_0x1fac48,_0x1c226a,_0x326588);this['channel'][_0xec4b('0x9b')](_0xec4b('0x178'),_0x1c226a);logger[_0xec4b('0x2d')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x3ded91,_0x4d3ea1,_0x1fac48['escape_digits'],_0x1fac48[_0xec4b('0x63')]);return this[_0xec4b('0xd')][_0xec4b('0x136')](_0x3ded91,_0x4d3ea1,_0x1fac48[_0xec4b('0x179')],_0x1fac48[_0xec4b('0x63')],undefined,!![]);};AGIVertices['prototype'][_0xec4b('0x17a')]=function(_0x154982){logger[_0xec4b('0x2d')](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x154982[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x154982['url'])){return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0x17b'));}var _0x3f0eb8=this[_0xec4b('0x17c')][_0xec4b('0xa1')](this,_0x154982);logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x17d'),util[_0xec4b('0x17e')](_0x3f0eb8,{'showHidden':![],'depth':null})));if(!this[_0xec4b('0x80')](_0x154982['variable_id'])){return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0x17f'));}var _0x517a77=this['getVariable'][_0xec4b('0xa1')](this,_0x154982[_0xec4b('0xd9')]);if(!_0x517a77){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x154982,_0xec4b('0xda'));}this[_0xec4b('0xd')][_0xec4b('0x9b')](util['format'](_0xec4b('0x180'),_0x517a77),_0x3f0eb8['statusCode']?_0x3f0eb8['statusCode']:_0xec4b('0x181'));this[_0xec4b('0xd')][_0xec4b('0x9b')](util[_0xec4b('0x27')](_0xec4b('0x182'),_0x517a77),_0x3f0eb8[_0xec4b('0x183')]?_0x3f0eb8[_0xec4b('0x183')]:'OK');if(_0x3f0eb8[_0xec4b('0x6f')]){try{this[_0xec4b('0x97')](_0x3f0eb8[_0xec4b('0x6f')],_0x517a77);}catch(_0x386c40){logger[_0xec4b('0x2b')](util[_0xec4b('0x27')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x517a77));}}return this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0x184'),_0x517a77));};AGIVertices[_0xec4b('0x10')][_0xec4b('0x185')]=function(_0x28869f){logger['info'](util[_0xec4b('0x27')](_0xec4b('0x186'),_0x28869f['label']));return this[_0xec4b('0xd')][_0xec4b('0x187')](_0x28869f['digits'][_0xec4b('0xd7')](/\s+/g,''),_0x28869f['escape_digits']);};AGIVertices[_0xec4b('0x10')]['saynumber']=function(_0x31deb8){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x188'),_0x31deb8[_0xec4b('0x38')]));return this['channel'][_0xec4b('0x189')](_0x31deb8['number'][_0xec4b('0xd7')](/\s+/g,''),_0x31deb8[_0xec4b('0x179')]);};AGIVertices[_0xec4b('0x10')][_0xec4b('0x18a')]=function(_0x488dcf){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x488dcf['label']));return this[_0xec4b('0xd')][_0xec4b('0x18b')](_0x488dcf['text'],_0x488dcf['escape_digits']);};AGIVertices[_0xec4b('0x10')][_0xec4b('0x18c')]=function(_0x2a780e){logger[_0xec4b('0x2d')](util['format'](_0xec4b('0x18d'),_0x2a780e['label']));if(!this[_0xec4b('0x80')](_0x2a780e[_0xec4b('0x18e')])){return this[_0xec4b('0xd')][_0xec4b('0xa5')]('no\x20mail\x20account\x20configured');}var _0x5a576e=this[_0xec4b('0x18f')][_0xec4b('0xa1')](this,_0x2a780e['account_id']);if(!_0x5a576e||!_0x5a576e['Smtp']){return this['channel'][_0xec4b('0x2b')](_0x2a780e,'no\x20mail\x20account\x20found');}var _0x56625a={'from':util[_0xec4b('0x27')](_0xec4b('0x190'),_0x5a576e[_0xec4b('0x13')],_0x5a576e[_0xec4b('0x191')]||_0x5a576e[_0xec4b('0x192')][_0xec4b('0x193')]),'to':_0x2a780e['to']||'','cc':_0x2a780e['cc']||'','bcc':_0x2a780e[_0xec4b('0x194')]||'','subject':_0x2a780e[_0xec4b('0x195')],'html':_0x2a780e[_0xec4b('0x5a')],'text':_0x2a780e[_0xec4b('0x5a')]};var _0x4b2e2d={'tls':{'rejectUnauthorized':![]}};if(_0x5a576e[_0xec4b('0x192')][_0xec4b('0x196')]){_0x4b2e2d[_0xec4b('0x196')]=_0x5a576e['Smtp'][_0xec4b('0x196')];}else{_0x4b2e2d['host']=_0x5a576e['Smtp']['host'];_0x4b2e2d[_0xec4b('0x197')]=_0x5a576e[_0xec4b('0x192')][_0xec4b('0x197')];_0x4b2e2d['secure']=_0x5a576e['Smtp'][_0xec4b('0x198')];}if(_0x5a576e[_0xec4b('0x192')][_0xec4b('0x199')]){_0x4b2e2d[_0xec4b('0x19a')]={'user':_0x5a576e['Smtp']['user'],'pass':_0x5a576e[_0xec4b('0x192')][_0xec4b('0x19b')]};}if(this['isConfigured'](_0x2a780e['template_id'])){}logger[_0xec4b('0xde')](_0xec4b('0x19c'),JSON[_0xec4b('0x6e')](_0x56625a));this[_0xec4b('0x36')]['sync'](this,_0x2a780e,_0x2a780e[_0xec4b('0x18e')]);this[_0xec4b('0xd')][_0xec4b('0xa5')](util['format'](_0xec4b('0x19d'),_0x5a576e[_0xec4b('0x13')]));this['sendMailMessage'][_0xec4b('0xa1')](this,_0x4b2e2d,_0x56625a);return this[_0xec4b('0xd')]['noop'](_0xec4b('0x19e'));};AGIVertices[_0xec4b('0x10')][_0xec4b('0x19f')]=function(_0x30de9d){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x1a0'),_0x30de9d[_0xec4b('0x38')]));return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0x1a1'));};AGIVertices[_0xec4b('0x10')][_0xec4b('0x1a2')]=function(_0x1de074){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x1de074[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x1de074['sms_account_id'])){return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0x1a3'));}var _0x3badbd=this[_0xec4b('0x33')]['sync'](this,_0x1de074['sms_account_id']);if(!_0x3badbd){return this[_0xec4b('0xd')]['error'](_0x1de074,_0xec4b('0x1a4'));}var _0x190773={'body':_0x1de074[_0xec4b('0x1a5')],'phone':_0x1de074['to']||'','SmsAccountId':_0x3badbd['id']};logger[_0xec4b('0xde')](_0xec4b('0x1a6'),JSON[_0xec4b('0x6e')](_0x190773));this[_0xec4b('0x36')][_0xec4b('0xa1')](this,_0x1de074,_0x1de074[_0xec4b('0x1a7')]);this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0x1a8'),_0x3badbd[_0xec4b('0x13')]));this[_0xec4b('0x35')][_0xec4b('0xa1')](this,_0x190773);return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0x1a9'));};AGIVertices[_0xec4b('0x10')]['set']=function(_0x47956c){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x1aa'),_0x47956c['label']));if(!this[_0xec4b('0x80')](_0x47956c[_0xec4b('0xd9')])){return this[_0xec4b('0xd')]['error'](_0x47956c,_0xec4b('0x1ab'));}var _0x11b3b9=this['getVariable']['sync'](this,_0x47956c['variable_id']);if(!_0x11b3b9){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x47956c,_0xec4b('0xda'));}return this['channel'][_0xec4b('0x9b')](_0x11b3b9,_0x47956c[_0xec4b('0x1ac')]);};AGIVertices[_0xec4b('0x10')][_0xec4b('0x1ad')]=function(_0x21e03a){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x1ae'),_0x21e03a[_0xec4b('0x38')]));this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0x1af'));if(_0x21e03a[_0xec4b('0xb6')]===_0xec4b('0x1b0')){this['channel']['noop'](_0xec4b('0x1b1'));return this['channel'][_0xec4b('0xb6')]();}return this[_0xec4b('0xd')][_0xec4b('0xa5')]('Skipped\x20Answer');};AGIVertices[_0xec4b('0x10')][_0xec4b('0x1b2')]=function(_0x5f4680){logger[_0xec4b('0x2d')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x5f4680['label']));if(!this[_0xec4b('0x80')](_0x5f4680[_0xec4b('0x1b3')])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x5f4680,'no\x20subproject\x20selected');}var _0x483dab=this[_0xec4b('0x18')]['sync'](this,_0x5f4680[_0xec4b('0x1b3')]);if(!this[_0xec4b('0x80')](_0x483dab)){return this['channel'][_0xec4b('0x2b')](_0x5f4680,util['format'](_0xec4b('0x1b4'),_0x5f4680[_0xec4b('0x1b3')]));}if(_0x483dab===this[_0xec4b('0xd')][_0xec4b('0x3a')]){return this['channel']['error'](_0x5f4680,_0xec4b('0x1b5'));}this[_0xec4b('0x36')]['sync'](this,_0x5f4680,_0x483dab);var _0x1a092f=this[_0xec4b('0xd')][_0xec4b('0xa7')]('AGI',util[_0xec4b('0x27')](_0xec4b('0x1b6'),config[_0xec4b('0x8')]['host']||_0xec4b('0x1b7'),_0x483dab,this[_0xec4b('0xd')][_0xec4b('0x3a')]));if(_0x1a092f[_0xec4b('0x9e')]===-0x1){return _0x1a092f;}return this[_0xec4b('0xd')][_0xec4b('0xa5')](util['format']('Executed\x20command\x20%s\x20%s','AGI',_0x483dab));};AGIVertices['prototype'][_0xec4b('0x1b8')]=function(_0x47cbe8){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x1b9'),_0x47cbe8[_0xec4b('0x38')]));var _0x899573=this[_0xec4b('0x1ba')][_0xec4b('0xa1')](this,_0x47cbe8[_0xec4b('0xb4')]);this[_0xec4b('0x36')]['sync'](this,_0x47cbe8,_0x47cbe8[_0xec4b('0xb4')]);if(this['isConfigured'](_0x47cbe8[_0xec4b('0xd9')])){var _0x517fc9=this['getVariable'][_0xec4b('0xa1')](this,_0x47cbe8['variable_id']);if(_0x517fc9){this[_0xec4b('0xd')][_0xec4b('0x9b')](_0x517fc9,_0x899573);return this[_0xec4b('0xd')]['noop'](util[_0xec4b('0x27')](_0xec4b('0x1bb'),_0x47cbe8[_0xec4b('0xb4')],_0x517fc9));}}return this[_0xec4b('0xd')]['noop'](util['format'](_0xec4b('0x1bc'),_0x47cbe8['command']));};AGIVertices[_0xec4b('0x10')][_0xec4b('0x1bd')]=function(_0xfbb37a){logger[_0xec4b('0x2d')](util['format'](_0xec4b('0x1be'),_0xfbb37a[_0xec4b('0x38')]));_0xfbb37a['text']=_0xfbb37a[_0xec4b('0x5a')][_0xec4b('0xd7')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xec4b('0x80')](_0xfbb37a['apiKey'])){return this[_0xec4b('0xd')][_0xec4b('0xa5')](_0xec4b('0x1bf'));}if(!this['isConfigured'](_0xfbb37a['text'])){return this[_0xec4b('0xd')][_0xec4b('0xa5')]('no\x20text\x20configured');}this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0xfbb37a[_0xec4b('0x5a')]));var _0xb6a817=this[_0xec4b('0x57')][_0xec4b('0xa1')](this,_0xfbb37a);if(_0xb6a817){this['channel'][_0xec4b('0xa5')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0xb6a817));var _0x4d9833=this[_0xec4b('0xd')][_0xec4b('0x101')](_0xb6a817);try{fs[_0xec4b('0x102')](_0xb6a817+'.wav');}catch(_0x2dab62){logger['error'](_0x2dab62);}return _0x4d9833;}return this[_0xec4b('0xd')]['error'](_0xfbb37a,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xec4b('0x10')][_0xec4b('0x1c0')]=function(_0x409183){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x1c1'),_0x409183[_0xec4b('0x38')]));_0x409183[_0xec4b('0x5a')]=_0x409183['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xec4b('0x80')](_0x409183['text'])){return this[_0xec4b('0xd')][_0xec4b('0xa5')]('no\x20text\x20configured');}this['channel']['noop'](util[_0xec4b('0x27')]('Trying\x20Google\x20TTS\x20%s',_0x409183['text']));var _0x3c2a33=this[_0xec4b('0x5f')][_0xec4b('0xa1')](this,_0x409183);if(_0x3c2a33){this['channel'][_0xec4b('0xa5')](util[_0xec4b('0x27')]('Google\x20TTS\x20%s\x20file\x20created',_0x3c2a33));var _0x1b923e=this[_0xec4b('0xd')][_0xec4b('0x101')](_0x3c2a33);try{fs['unlink'](_0x3c2a33+_0xec4b('0x14f'));}catch(_0x4f797b){logger['error'](_0x4f797b);}return _0x1b923e;}return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x409183,_0xec4b('0x1c2'));};AGIVertices[_0xec4b('0x10')][_0xec4b('0x1c3')]=function(_0x551cb5){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x1c4'),_0x551cb5['label']));if(!this[_0xec4b('0x80')](_0x551cb5[_0xec4b('0x155')])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x551cb5,_0xec4b('0x153'));}logger[_0xec4b('0x2d')](util[_0xec4b('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xec4b('0xd')][_0xec4b('0x3b')],_0x551cb5[_0xec4b('0x155')]));var _0x47469b=this[_0xec4b('0x50')][_0xec4b('0xa1')](this,_0x551cb5['findBy']);if(_0x47469b){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x154'),this[_0xec4b('0xd')]['callerid'],_0x551cb5[_0xec4b('0x155')]));this['channel'][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0x154'),this[_0xec4b('0xd')][_0xec4b('0x3b')],_0x551cb5[_0xec4b('0x155')]));return{'code':0xc8,'result':_0xec4b('0x156')};}else{logger['info'](util['format'](_0xec4b('0x157'),this[_0xec4b('0xd')]['callerid'],_0x551cb5[_0xec4b('0x155')]));this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')](_0xec4b('0x157'),this['channel'][_0xec4b('0x3b')],_0x551cb5[_0xec4b('0x155')]));return{'code':0xc8,'result':_0xec4b('0x158')};}};AGIVertices['prototype'][_0xec4b('0x1c5')]=function(_0x35bc4e){logger['info'](util[_0xec4b('0x27')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x35bc4e[_0xec4b('0x38')]));var _0x4ebb33=this[_0xec4b('0xd')][_0xec4b('0xa7')]('VOICEMAIL',[_0x35bc4e[_0xec4b('0x1c6')],_0x35bc4e['options']]);if(_0x4ebb33[_0xec4b('0x9e')]===-0x1){return _0x4ebb33;}return this[_0xec4b('0xd')][_0xec4b('0xa5')](util[_0xec4b('0x27')]('Executed\x20command\x20%s\x20%s',_0xec4b('0x1c7'),_0x35bc4e[_0xec4b('0x1c6')]));};AGIVertices[_0xec4b('0x10')][_0xec4b('0x1c8')]=function(_0x4f811d){logger[_0xec4b('0x2d')](util[_0xec4b('0x27')](_0xec4b('0x1c9'),_0x4f811d[_0xec4b('0x38')]));if(!this[_0xec4b('0x80')](_0x4f811d[_0xec4b('0xd9')])){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x4f811d,_0xec4b('0x1ab'));}var _0x326755=this[_0xec4b('0x11')]['sync'](this,_0x4f811d['variable_id']);if(!_0x326755){return this[_0xec4b('0xd')][_0xec4b('0x2b')](_0x4f811d,_0xec4b('0xda'));}var _0x4bcc69=this[_0xec4b('0xd')][_0xec4b('0x11')](_0x326755);return{'code':0xc8,'result':_0x4bcc69[_0xec4b('0xa0')]?_0x4bcc69['extra']:'-'};};String[_0xec4b('0x10')][_0xec4b('0x9d')]=function(_0x3561a0,_0xfb620d){return this['split'](_0x3561a0)['join'](_0xfb620d);};module[_0xec4b('0x1ca')]=AGIVertices; \ No newline at end of file +var _0x3121=['sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','hasOwnProperty','isString','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','split','replaceAll','getVariable','extra','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','retry','no\x20text\x20configured','MRCPSynth','result','noop','Executed\x20command\x20MRCPSynth\x20%s','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','add','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','database','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','test','mindigit','maxdigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','priority','gotoif','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','no\x20file\x20audio\x20found','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','gosub','Executed\x20command\x20%s\x20%s','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','%s_STATUS_CODE','200','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','getMailAccount','no\x20mail\x20account\x20found','email','user','bcc','subject','Smtp','service','host','port','secure','auth','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','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','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','createSquareRecording','callerid','calleridname','context','extension','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','random','lastName','isNil','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agent','agentPause','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','private_key','dialogflowV2_language'];(function(_0x17b53e,_0x33b99b){var _0x1d4ec1=function(_0x20df69){while(--_0x20df69){_0x17b53e['push'](_0x17b53e['shift']());}};_0x1d4ec1(++_0x33b99b);}(_0x3121,0x14d));var _0x1312=function(_0x52e176,_0x49805d){_0x52e176=_0x52e176-0x0;var _0x2e37b3=_0x3121[_0x52e176];return _0x2e37b3;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x1312('0x0'));var _=require(_0x1312('0x1'));var sh=require('shelljs');var odbc=require(_0x1312('0x2'))();var rs=require(_0x1312('0x3'));var moment=require(_0x1312('0x4'));var Mustache=require(_0x1312('0x5'));var rp=require(_0x1312('0x6'));var logger=require(_0x1312('0x7'))(_0x1312('0x8'));var config=require(_0x1312('0x9'));var scripts=require(_0x1312('0xa'));var FILES_PATH=_0x1312('0xb');var recursiveMapAttributes=[_0x1312('0xc'),'rawBody'];var verticesWithRetry=['menu',_0x1312('0xd'),_0x1312('0xe')];var AGIVertices=function(_0x240b84,_0x3fe8b6,_0xa4e942){this['channel']=_0x240b84;this[_0x1312('0xf')]=_0x3fe8b6;this[_0x1312('0x10')]=_0xa4e942;};AGIVertices[_0x1312('0x11')]['getVariable']=function(_0x30b1d5,_0xf94dd9){this[_0x1312('0xf')][_0x1312('0x12')](_0x30b1d5)[_0x1312('0x13')](function(_0x2e6d07){_0xf94dd9(null,_0x2e6d07?_0x2e6d07[_0x1312('0x14')]:![]);})[_0x1312('0x15')](function(_0xe73126){_0xf94dd9(_0xe73126);});};AGIVertices[_0x1312('0x11')][_0x1312('0x16')]=function(_0x3d6615,_0x2ed27c){this['rpc'][_0x1312('0x17')](_0x3d6615)['then'](function(_0x5bb7be){_0x2ed27c(null,_0x5bb7be?_0x5bb7be[_0x1312('0x14')]:![]);})[_0x1312('0x15')](function(_0xf4c05b){_0x2ed27c(_0xf4c05b);});};AGIVertices['prototype'][_0x1312('0x18')]=function(_0x1e2f82,_0x42f25e){this[_0x1312('0xf')][_0x1312('0x19')](_0x1e2f82)[_0x1312('0x13')](function(_0x535e58){_0x42f25e(null,_0x535e58?_0x535e58[_0x1312('0x14')]:![]);})['catch'](function(_0x27e2db){_0x42f25e(_0x27e2db);});};AGIVertices[_0x1312('0x11')]['getSquareOdbc']=function(_0x14de8d,_0x3eaee7){this['rpc']['getSquareOdbcById'](_0x14de8d)[_0x1312('0x13')](function(_0x5e1705){_0x3eaee7(null,_0x5e1705?_0x5e1705['dsn']:![]);})['catch'](function(_0x1d4079){_0x3eaee7(_0x1d4079);});};AGIVertices[_0x1312('0x11')][_0x1312('0x1a')]=function(_0x91c54,_0x5952f9){this[_0x1312('0xf')][_0x1312('0x1b')](_0x91c54)['then'](function(_0x443283){_0x5952f9(null,_0x443283?_0x443283[_0x1312('0x14')]:![]);})['catch'](function(_0x42907d){_0x5952f9(_0x42907d);});};AGIVertices[_0x1312('0x11')]['getTrunk']=function(_0x10a585,_0x57ea45){this[_0x1312('0xf')][_0x1312('0x1c')](_0x10a585)[_0x1312('0x13')](function(_0x4eff44){_0x57ea45(null,_0x4eff44?_0x4eff44[_0x1312('0x14')]:![]);})[_0x1312('0x15')](function(_0x4dae02){_0x57ea45(_0x4dae02);});};AGIVertices[_0x1312('0x11')][_0x1312('0x1d')]=function(_0x13c629,_0x21b536){var _0x4d7654=this;this['rpc'][_0x1312('0x1e')](_0x13c629)[_0x1312('0x13')](function(_0x141068){_0x21b536(null,_0x141068?_0x4d7654[_0x1312('0x1f')](_0x141068[_0x1312('0x20')]):![]);})[_0x1312('0x15')](function(_0x17fe7e){_0x21b536(_0x17fe7e);});};AGIVertices[_0x1312('0x11')]['getMailAccount']=function(_0x525fcb,_0x196461){this[_0x1312('0xf')][_0x1312('0x21')](_0x525fcb)[_0x1312('0x13')](function(_0xecb465){_0x196461(null,_0xecb465?_0xecb465:![]);})[_0x1312('0x15')](function(_0x5e8ada){_0x196461(_0x5e8ada);});};AGIVertices[_0x1312('0x11')][_0x1312('0x22')]=function(_0x53efd3,_0x24e740,_0x41a3a1){this[_0x1312('0x10')][_0x1312('0x22')](_0x53efd3,_0x24e740)[_0x1312('0x13')](function(){_0x41a3a1(null);})[_0x1312('0x15')](function(_0x572745){_0x41a3a1(_0x572745);});};AGIVertices[_0x1312('0x11')][_0x1312('0x23')]=function(_0x42b7b6,_0x3236b5){this[_0x1312('0xf')][_0x1312('0x24')](_0x42b7b6)[_0x1312('0x13')](function(_0x42b765){if(_0x42b765){if(_0x42b765[_0x1312('0x25')]){_0x3236b5(null,[_0x42b765[_0x1312('0x26')]]);}else{_0x3236b5(null,_['map'](_0x42b765[_0x1312('0x27')],_0x1312('0x26')));}}else{_0x3236b5(null,![]);}})[_0x1312('0x15')](function(_0x283a33){_0x3236b5(_0x283a33);});};AGIVertices[_0x1312('0x11')][_0x1312('0x1f')]=function(_0x255536){return util[_0x1312('0x28')](_0x1312('0x29'),FILES_PATH,_0x255536);};AGIVertices[_0x1312('0x11')][_0x1312('0x2a')]=function(_0x5e74b8,_0x4592fb,_0x4f3156){odbc[_0x1312('0x2b')](_0x5e74b8,function(_0xa776e3){if(_0xa776e3){logger[_0x1312('0x2c')](_0x1312('0x2d'),_0xa776e3);_0x4f3156(_0xa776e3);}else{logger[_0x1312('0x2e')](_0x1312('0x2f'));odbc[_0x1312('0x30')](_0x4592fb,function(_0x1f23b3,_0x3ac129){if(_0x1f23b3){logger[_0x1312('0x2e')](_0x1312('0x31'),_0x4592fb);_0x4f3156(_0x1f23b3);}else{logger[_0x1312('0x2e')](_0x1312('0x32'),_0x4592fb);odbc['close'](function(_0x289a94){if(_0x289a94){logger['error'](_0x1312('0x33'),_0x289a94);}_0x4f3156(null,_0x3ac129);});}});}});};AGIVertices['prototype'][_0x1312('0x34')]=function(_0x16fee8,_0x5c89cb){this[_0x1312('0xf')][_0x1312('0x35')](_0x16fee8)[_0x1312('0x13')](function(_0x4ff50f){_0x5c89cb(null,_0x4ff50f?_0x4ff50f:![]);})[_0x1312('0x15')](function(_0x653238){_0x5c89cb(_0x653238);});};AGIVertices[_0x1312('0x11')]['createSmsMessage']=function(_0x3d6b20,_0x1b5ea1){this[_0x1312('0xf')][_0x1312('0x36')](_0x3d6b20)[_0x1312('0x13')](function(_0x1eee59){_0x1b5ea1(null,_0x1eee59);})[_0x1312('0x15')](function(_0x41a0d9){_0x1b5ea1(_0x41a0d9);});};AGIVertices[_0x1312('0x11')][_0x1312('0x37')]=function(_0x1d4911,_0x8ec231,_0x33336c){this['rpc']['createSquareDetailsReport']({'uniqueid':this[_0x1312('0x38')][_0x1312('0x39')],'node':_0x1d4911[_0x1312('0x3a')],'application':_0x1d4911[_0x1312('0x3b')],'data':_0x8ec231||null,'project_name':this[_0x1312('0x38')]['arg_1'],'callerid':this[_0x1312('0x38')]['callerid']})[_0x1312('0x13')](function(_0x3c3093){if(_0x33336c){_0x33336c(null,_0x3c3093);}})[_0x1312('0x15')](function(_0x34fb6c){if(_0x33336c){_0x33336c(_0x34fb6c);}});};AGIVertices[_0x1312('0x11')][_0x1312('0x3c')]=function(_0x1b42fb,_0x3e3948,_0x160afc,_0x246d46){this[_0x1312('0xf')][_0x1312('0x3c')]({'uniqueid':this['channel'][_0x1312('0x39')],'callerid':this['channel'][_0x1312('0x3d')],'calleridname':this[_0x1312('0x38')][_0x1312('0x3e')],'context':this[_0x1312('0x38')][_0x1312('0x3f')],'extension':this['channel'][_0x1312('0x40')],'priority':this[_0x1312('0x38')]['priority'],'accountcode':this['channel'][_0x1312('0x41')],'dnid':this[_0x1312('0x38')][_0x1312('0x42')],'projectName':this['channel'][_0x1312('0x43')],'saveName':_0x3e3948,'filename':_0x1b42fb[_0x1312('0x44')]||_0x3e3948,'savePath':_0x160afc})[_0x1312('0x13')](function(_0x1b085f){_0x246d46(null,_0x1b085f);})[_0x1312('0x15')](function(_0x462301){_0x246d46(_0x462301);});};AGIVertices[_0x1312('0x11')][_0x1312('0x45')]=function(_0x108bfe,_0x1430b5,_0x2cb20b,_0x5ef6d5,_0x4a3249){this[_0x1312('0xf')][_0x1312('0x45')]({'uniqueid':this[_0x1312('0x38')][_0x1312('0x39')],'body':_0x108bfe,'direction':_0x1430b5,'providerName':_0x2cb20b,'providerResponse':_0x5ef6d5})[_0x1312('0x13')](function(_0xc4f832){if(_0x4a3249){_0x4a3249(null,_0xc4f832);}})[_0x1312('0x15')](function(_0x3be115){if(_0x4a3249){_0x4a3249(_0x3be115);}});};AGIVertices[_0x1312('0x11')][_0x1312('0x46')]=function(_0x1f0811,_0x5c7af4){this[_0x1312('0xf')][_0x1312('0x46')]({'firstName':_[_0x1312('0x47')](_0x1f0811['name'])||_['isNil'](_0x1f0811[_0x1312('0x14')])?'callback_'+Math[_0x1312('0x48')]():_0x1f0811['name'],'lastName':_[_0x1312('0x47')](_0x1f0811[_0x1312('0x49')])||_[_0x1312('0x4a')](_0x1f0811[_0x1312('0x49')])?null:_0x1f0811[_0x1312('0x49')],'phone':_0x1f0811['phone'],'ListId':_0x1f0811['list_id'],'scheduledat':_0x1f0811[_0x1312('0x4b')],'callbackUniqueid':this[_0x1312('0x38')][_0x1312('0x39')],'tags':_0x1312('0x4c'),'description':_0x1312('0x4d')+_0x1f0811[_0x1312('0x4b')][_0x1312('0x4e')](),'priority':_0x1f0811[_0x1312('0x4f')]})[_0x1312('0x13')](function(_0x27f131){_0x5c7af4(null,_0x27f131);})[_0x1312('0x15')](function(_0x12d11a){_0x5c7af4(_0x12d11a);});};AGIVertices[_0x1312('0x11')][_0x1312('0x50')]=function(_0x5c4f18,_0x577adf){this[_0x1312('0xf')]['getPauseById'](_0x5c4f18)[_0x1312('0x13')](function(_0x3aa768){_0x577adf(null,_0x3aa768?_0x3aa768[_0x1312('0x14')]:![]);})['catch'](function(_0x53b7b9){_0x577adf(_0x53b7b9);});};AGIVertices[_0x1312('0x11')]['agentPause']=function(_0x55d04d,_0x468aad,_0x6ae2b3){var _0x26edff={'role':_0x1312('0x51')};_0x26edff[_0x55d04d]=this[_0x1312('0x38')]['callerid'];this[_0x1312('0xf')][_0x1312('0x52')](_0x26edff,_0x468aad,this[_0x1312('0x38')][_0x1312('0x39')])[_0x1312('0x13')](function(_0x33f55a){_0x6ae2b3(null,_[_0x1312('0x4a')](_0x33f55a)?![]:!![]);})[_0x1312('0x15')](function(_0x935161){logger[_0x1312('0x2c')](_0x935161);_0x6ae2b3(null,![]);});};AGIVertices[_0x1312('0x11')][_0x1312('0x53')]=function(_0x15e24b,_0x43b5e2){var _0x272321={'role':_0x1312('0x51')};_0x272321[_0x15e24b]=this[_0x1312('0x38')][_0x1312('0x3d')];this[_0x1312('0xf')]['agentUnpause'](_0x272321)[_0x1312('0x13')](function(_0x2baf2b){_0x43b5e2(null,_[_0x1312('0x4a')](_0x2baf2b)?![]:!![]);})[_0x1312('0x15')](function(_0x1e3129){logger[_0x1312('0x2c')](_0x1e3129);_0x43b5e2(null,![]);});};AGIVertices[_0x1312('0x11')][_0x1312('0x54')]=function(_0x1d421a,_0x2485f1){var _0x171964={'role':_0x1312('0x51')};_0x171964[_0x1d421a]=this['channel']['callerid'];this['rpc'][_0x1312('0x54')](_0x171964)[_0x1312('0x13')](function(_0x313790){_0x2485f1(null,_[_0x1312('0x4a')](_0x313790)?![]:!![]);})[_0x1312('0x15')](function(_0xef80d1){logger['error'](_0xef80d1);_0x2485f1(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x1cb05f,_0x3ccbf6){var _0xc967aa={'role':_0x1312('0x51')};_0xc967aa[_0x1cb05f]=this[_0x1312('0x38')][_0x1312('0x3d')];var _0x241f73=_0x1cb05f!=_0x1312('0x55')?util[_0x1312('0x28')](_0x1312('0x56'),'LOCAL',this['channel'][_0x1312('0x3d')]):undefined;this[_0x1312('0xf')]['agentLogin'](_0xc967aa,_0x241f73)[_0x1312('0x13')](function(_0x36f205){_0x3ccbf6(null,_[_0x1312('0x4a')](_0x36f205)?![]:!![]);})['catch'](function(_0x2b9f2f){logger[_0x1312('0x2c')](_0x2b9f2f);_0x3ccbf6(null,![]);});};AGIVertices[_0x1312('0x11')]['shellCommand']=function(_0x50868c,_0x47580c){sh[_0x1312('0x57')](_[_0x1312('0x58')](_0x50868c),function(_0x1ba6b3,_0x45a7ce){var _0xd6ae29=_0x45a7ce[_0x1312('0x59')](/(\r\n|\n|\r)/gm,'');_0x47580c(null,_0xd6ae29);});};AGIVertices[_0x1312('0x11')]['googleCloudTTS']=function(_0x2e13ad,_0x40d2bc){scripts[_0x1312('0x5a')](_0x2e13ad[_0x1312('0x5b')],_0x2e13ad['google_cloud_tts_text_type']||_0x1312('0x5c'),_0x2e13ad[_0x1312('0x5c')],_0x2e13ad[_0x1312('0x5d')]||_0x1312('0x5e'),_0x2e13ad[_0x1312('0x5f')]||_0x1312('0x60'),_0x2e13ad[_0x1312('0x61')]||'MP3')['then'](function(_0x1c0a9a){_0x40d2bc(null,_0x1c0a9a);})[_0x1312('0x15')](function(_0x1f274f){_0x40d2bc(_0x1f274f);});};AGIVertices[_0x1312('0x11')][_0x1312('0x62')]=function(_0x505e8e,_0x187855){scripts[_0x1312('0x62')](_0x505e8e['text'],_0x505e8e[_0x1312('0x63')]||'en',0x1)[_0x1312('0x13')](function(_0x194bf8){_0x187855(null,_0x194bf8);})[_0x1312('0x15')](function(_0x4d2787){_0x187855(_0x4d2787);});};AGIVertices[_0x1312('0x11')][_0x1312('0x64')]=function(_0x2a88f2,_0x573c22){var _0xcaca59={'uri':_0x2a88f2[_0x1312('0x65')],'method':_0x2a88f2[_0x1312('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2a88f2[_0x1312('0x67')])===_0x1312('0x68')&&parseInt(_0x2a88f2[_0x1312('0x67')])>=0x1?parseInt(_0x2a88f2[_0x1312('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x1312('0x69')]([_0x1312('0x6a'),'PUT'],_0xcaca59['method'][_0x1312('0x6b')]())){try{_0xcaca59[_0x1312('0x6c')]=_0x2a88f2[_0x1312('0x6d')]?JSON[_0x1312('0x6e')](_0x2a88f2[_0x1312('0x6d')]):{};}catch(_0x51a385){logger[_0x1312('0x2c')](_0x1312('0x6f'),_0x51a385);}}try{_0xcaca59[_0x1312('0x70')]=_0x2a88f2[_0x1312('0xc')]?JSON[_0x1312('0x6e')](_0x2a88f2['rawHeaders']):{};}catch(_0x3b4242){logger['error'](_0x1312('0x71'),_0x3b4242);}if(_0x2a88f2['computedVariables']){try{var _0x4a5b78=require(_0x2a88f2['computedVariables'])[_0x1312('0x72')](this,_0xcaca59);_0xcaca59[_0x1312('0x73')]=Mustache[_0x1312('0x74')](_0x2a88f2[_0x1312('0x65')],_0x4a5b78,{},['$$','$$']);if(_0xcaca59[_0x1312('0x70')]){_0xcaca59[_0x1312('0x70')]=JSON[_0x1312('0x6e')](Mustache['render'](JSON[_0x1312('0x75')](_0xcaca59[_0x1312('0x70')]),_0x4a5b78,{},['$$','$$']));}if(_0xcaca59['body']){_0xcaca59[_0x1312('0x6c')]=JSON[_0x1312('0x6e')](Mustache[_0x1312('0x74')](JSON[_0x1312('0x75')](_0xcaca59['body']),_0x4a5b78,{},['$$','$$']));}}catch(_0x57f59b){logger[_0x1312('0x2c')](_0x1312('0x76'),_0x57f59b);}}rp(_0xcaca59)[_0x1312('0x13')](function(_0x3fe6c3){var _0x21beab={'statusCode':_0x3fe6c3[_0x1312('0x77')]||0xc8,'statusMessage':_0x3fe6c3['statusMessage']||'OK','headers':_0x3fe6c3[_0x1312('0x70')]||{},'body':_0x3fe6c3[_0x1312('0x6c')]||{}};_0x573c22(null,_0x21beab);})[_0x1312('0x15')](function(_0x3cdba8){var _0x68e9b={'statusCode':_0x3cdba8[_0x1312('0x77')]||0x1f4,'statusMessage':_0x3cdba8[_0x1312('0x78')]||_0x1312('0x79'),'headers':_0x3cdba8[_0x1312('0x7a')][_0x1312('0x70')]||{},'body':_0x3cdba8[_0x1312('0x7a')][_0x1312('0x6c')]||{}};_0x573c22(null,_0x68e9b);});};AGIVertices['prototype'][_0x1312('0x7b')]=function(_0x3b4581,_0x288019){scripts[_0x1312('0x7b')](this[_0x1312('0x38')]['uniqueid'],_0x3b4581['key'],_0x3b4581[_0x1312('0x5c')],_0x3b4581[_0x1312('0x7c')]||'en')[_0x1312('0x13')](function(_0x285faa){_0x288019(null,_0x285faa);})[_0x1312('0x15')](function(_0x4be4ec){_0x288019(_0x4be4ec);});};AGIVertices[_0x1312('0x11')][_0x1312('0x7d')]=function(_0x5c884e,_0x48873c){scripts[_0x1312('0x7d')](this['channel'][_0x1312('0x39')],_0x5c884e['dialogflowV2_project_id'],_0x5c884e['client_email'],_0x5c884e[_0x1312('0x7e')],_0x5c884e['text'],_0x5c884e[_0x1312('0x7f')]||'en')['then'](function(_0x2e6b1c){_0x48873c(null,_0x2e6b1c);})['catch'](function(_0x4bd0ec){_0x48873c(_0x4bd0ec);});};AGIVertices[_0x1312('0x11')][_0x1312('0x80')]=function(_0x4663c8,_0x2a6806){scripts[_0x1312('0x80')](this[_0x1312('0x38')],_0x4663c8)[_0x1312('0x13')](function(_0x1dbc01){_0x2a6806(null,_0x1dbc01);})['catch'](function(_0x18c1e8){_0x2a6806(_0x18c1e8);});};AGIVertices[_0x1312('0x11')][_0x1312('0x81')]=function(_0x25b4fb,_0x1bb218){scripts[_0x1312('0x81')](_0x25b4fb[_0x1312('0x82')],_0x25b4fb[_0x1312('0x5c')],_0x25b4fb[_0x1312('0x83')]||_0x1312('0x5e'),_0x25b4fb['speed'])['then'](function(_0x52b874){_0x1bb218(null,_0x52b874);})[_0x1312('0x15')](function(_0x2d9fb8){_0x1bb218(_0x2d9fb8);});};AGIVertices[_0x1312('0x11')]['ispeechASR']=function(_0x3fedf1,_0x5e3ba6,_0x423554){scripts[_0x1312('0x84')](_0x5e3ba6,_0x3fedf1[_0x1312('0x82')],_0x3fedf1['ispeech_asr_language']||_0x1312('0x5e'),this[_0x1312('0x85')](_0x3fedf1[_0x1312('0x86')])?_0x3fedf1['model']:undefined)[_0x1312('0x13')](function(_0x317a9a){_0x423554(null,_0x317a9a);})[_0x1312('0x15')](function(_0x1954d3){_0x423554(_0x1954d3);});};AGIVertices[_0x1312('0x11')][_0x1312('0x87')]=function(_0x5996e1,_0x266067){scripts['awsPolly'](_0x5996e1[_0x1312('0x88')],_0x5996e1[_0x1312('0x89')],_0x5996e1[_0x1312('0x8a')],_0x5996e1[_0x1312('0x8b')]||_0x1312('0x8c'),_0x5996e1[_0x1312('0x5c')],_0x5996e1['aws_text_type']||_0x1312('0x5c'))['then'](function(_0x507a8d){_0x266067(null,_0x507a8d);})['catch'](function(_0x3b0108){_0x266067(_0x3b0108);});};AGIVertices[_0x1312('0x11')]['awsLex']=function(_0xc1e9f5,_0x559180){scripts[_0x1312('0x8d')](this[_0x1312('0x38')][_0x1312('0x39')],_0xc1e9f5[_0x1312('0x88')],_0xc1e9f5['aws_secret_access_key'],_0xc1e9f5[_0x1312('0x8e')],_0xc1e9f5[_0x1312('0x5c')],_0xc1e9f5[_0x1312('0x8f')])['then'](function(_0x4d9a55){_0x559180(null,_0x4d9a55);})[_0x1312('0x15')](function(_0x28b9ed){_0x559180(_0x28b9ed);});};AGIVertices[_0x1312('0x11')][_0x1312('0x90')]=function(_0x482b56,_0x3f3ec3,_0x51c1e2){scripts[_0x1312('0x90')](_0x3f3ec3,_0x482b56[_0x1312('0x82')],_0x482b56[_0x1312('0x91')]||_0x1312('0x5e'))[_0x1312('0x13')](function(_0x44fdfa){_0x51c1e2(null,_0x44fdfa);})['catch'](function(_0xc038c0){_0x51c1e2(_0xc038c0);});};AGIVertices[_0x1312('0x11')][_0x1312('0x92')]=function(_0x1e92e2,_0x35a56f,_0x508bc2){scripts['tildeASR'](_0x35a56f,_0x1e92e2[_0x1312('0x93')],_0x1e92e2[_0x1312('0x94')],_0x1e92e2[_0x1312('0x73')])[_0x1312('0x13')](function(_0x2bae4b){_0x508bc2(null,_0x2bae4b);})[_0x1312('0x15')](function(_0x3c5ce3){_0x508bc2(_0x3c5ce3);});};AGIVertices['prototype'][_0x1312('0x95')]=function(_0x2d5193){var _0x3460ec=_[_0x1312('0x69')](verticesWithRetry,_0x2d5193[_0x1312('0x3b')])?_0x2d5193:_['clone'](_0x2d5193);for(var _0x4038e3 in _0x3460ec){if(_0x3460ec[_0x1312('0x96')](_0x4038e3)){if(_0x3460ec[_0x4038e3]&&_[_0x1312('0x97')](_0x3460ec[_0x4038e3])){if(_[_0x1312('0x69')](recursiveMapAttributes,_0x4038e3)){_0x3460ec[_0x4038e3]=this['replaceObjectAllVariables'](_0x3460ec[_0x4038e3]);}else{_0x3460ec[_0x4038e3]=this[_0x1312('0x98')](_0x3460ec[_0x4038e3]);}}}}return _0x3460ec;};AGIVertices[_0x1312('0x11')]['recursiveNodeIndex']=function(_0x2e5463){for(var _0xcb8803 in _0x2e5463){if(_0x2e5463[_0x1312('0x96')](_0xcb8803)){if(_[_0x1312('0x99')](_0x2e5463[_0xcb8803])){this[_0x1312('0x9a')](_0x2e5463[_0xcb8803]);}else if(_[_0x1312('0x9b')](_0x2e5463[_0xcb8803])){for(var _0x333be2=0x0;_0x333be2<_0x2e5463[_0xcb8803][_0x1312('0x9c')];_0x333be2++){this[_0x1312('0x9a')](_0x2e5463[_0xcb8803][_0x333be2]);}}else if(_[_0x1312('0x97')](_0x2e5463[_0xcb8803])){_0x2e5463[_0xcb8803]=this[_0x1312('0x98')](_0x2e5463[_0xcb8803]);}}}};AGIVertices[_0x1312('0x11')][_0x1312('0x9d')]=function(_0x4dbb17,_0x4fe19d){for(var _0xd3d977 in _0x4dbb17){if(_0x4dbb17['hasOwnProperty'](_0xd3d977)){if(_['isPlainObject'](_0x4dbb17[_0xd3d977])){if(!_[_0x1312('0x47')](_0x4dbb17[_0xd3d977])){this[_0x1312('0x9d')](_0x4dbb17[_0xd3d977],util[_0x1312('0x28')](_0x1312('0x9e'),_0x4fe19d,_0xd3d977));}}else if(_[_0x1312('0x9b')](_0x4dbb17[_0xd3d977])){for(var _0x42ad2a=0x0;_0x42ad2a<_0x4dbb17[_0xd3d977][_0x1312('0x9c')];_0x42ad2a++){this['saveRestApiResult'](_0x4dbb17[_0xd3d977][_0x42ad2a],util[_0x1312('0x28')](_0x1312('0x9e'),_0x4fe19d,_0xd3d977+'['+_0x42ad2a+']'));}}else{if(!_[_0x1312('0x4a')](_0x4dbb17[_0xd3d977])){this['channel']['setVariable'](util[_0x1312('0x28')](_0x1312('0x9e'),_0x4fe19d,_0xd3d977),_0x4dbb17[_0xd3d977]);}}}}};AGIVertices[_0x1312('0x11')]['replaceObjectAllVariables']=function(_0x3354c9){try{var _0x50819e=JSON[_0x1312('0x6e')](_0x3354c9);this['recursiveNodeIndex'](_0x50819e);return JSON['stringify'](_0x50819e);}catch(_0x1eb611){return this[_0x1312('0x98')](_0x3354c9);}};AGIVertices[_0x1312('0x11')][_0x1312('0x98')]=function(_0x5af07d){var _0x17e03b=_0x5af07d[_0x1312('0x9f')]('{');for(var _0x1bb213=0x1;_0x1bb213<_0x17e03b[_0x1312('0x9c')];_0x1bb213+=0x1){var _0x2b216b=_0x17e03b[_0x1bb213]['split']('}');if(_0x2b216b[_0x1312('0x9c')]>0x1){_0x5af07d=_0x5af07d[_0x1312('0xa0')]('{'+_0x2b216b[0x0]+'}',this[_0x1312('0x38')][_0x1312('0xa1')](_0x2b216b[0x0])[_0x1312('0xa2')]||_0x2b216b[0x0]);}}if(_0x17e03b[_0x1312('0x9c')]===0x1){return _0x5af07d[_0x1312('0x4e')]();}return this['replaceAllVariables'](_0x5af07d);};AGIVertices['prototype']['getAndSetVariable']=function(_0x85015c,_0x51f24a){var _0x520554=this[_0x1312('0x38')]['getVariable'](_0x85015c);if(_0x520554['result']===-0x1){return _0x520554;}logger[_0x1312('0x2e')](util['format'](_0x1312('0xa3'),_0x51f24a,_0x520554[_0x1312('0xa2')]));return this['channel'][_0x1312('0xa4')](_0x51f24a,_0x520554['extra']);};AGIVertices[_0x1312('0x11')][_0x1312('0x85')]=function(_0x28bee1){return _0x28bee1&&_0x28bee1!=='0'&&_0x28bee1!=='-1'&&_0x28bee1!=='';};AGIVertices[_0x1312('0x11')][_0x1312('0xa5')]=function(_0x9355ea){this[_0x1312('0x37')][_0x1312('0x72')](this,_0x9355ea,'-');_0x9355ea[_0x1312('0xa6')]=_0x9355ea['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x1312('0x11')]['mrcpsynth']=function(_0x22c1d7){logger['info'](util[_0x1312('0x28')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x22c1d7['label']));if(!this[_0x1312('0x85')](_0x22c1d7['text'])){return this['channel']['noop'](_0x1312('0xa7'));}var _0x58b066='\x22'+_0x22c1d7[_0x1312('0x5c')]+'\x22';if(this[_0x1312('0x85')](_0x22c1d7[_0x1312('0x7a')])){_0x58b066+=','+_0x22c1d7[_0x1312('0x7a')];}var _0x25d5a3=this[_0x1312('0x38')][_0x1312('0x57')](_0x1312('0xa8'),_0x58b066);if(_0x25d5a3[_0x1312('0xa9')]===-0x1){return _0x25d5a3;}return this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0xab'),_0x58b066));};AGIVertices[_0x1312('0x11')]['mrcprecog']=function(_0x2ae579){logger[_0x1312('0x2e')](util[_0x1312('0x28')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x2ae579[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x2ae579[_0x1312('0xac')])){return this['channel'][_0x1312('0xaa')](_0x1312('0xad'));}var _0xf661a8=_0x2ae579[_0x1312('0xac')];if(this[_0x1312('0x85')](_0x2ae579[_0x1312('0x7a')])){_0xf661a8+=','+_0x2ae579[_0x1312('0x7a')];}var _0x218e02=this[_0x1312('0x38')][_0x1312('0x57')](_0x1312('0xae'),_0xf661a8);if(_0x218e02[_0x1312('0xa9')]===-0x1){return _0x218e02;}var _0x36461c=this['getAndSetVariable'](_0x1312('0xaf'),_0x1312('0xb0'));if(_0x36461c[_0x1312('0xa9')]===-0x1){return _0x36461c;}var _0x539976=this[_0x1312('0xb1')](_0x1312('0xb2'),_0x1312('0xb3'));if(_0x539976[_0x1312('0xa9')]===-0x1){return _0x539976;}var _0x189685=this[_0x1312('0xb1')](_0x1312('0xb4'),'MRCP_RECOG_INSTANCE');if(_0x189685[_0x1312('0xa9')]===-0x1){return _0x189685;}return this[_0x1312('0x38')]['noop'](util[_0x1312('0x28')](_0x1312('0xb5'),_0xf661a8));};AGIVertices['prototype'][_0x1312('0x8')]=function(_0x4ab04a){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0xb6'),_0x4ab04a[_0x1312('0x3a')]));return this[_0x1312('0x38')][_0x1312('0x8')]([_0x4ab04a[_0x1312('0xb7')],_0x4ab04a['args']]);};AGIVertices['prototype'][_0x1312('0xb8')]=function(_0x27863e){logger[_0x1312('0x2e')](util['format'](_0x1312('0xb9'),_0x27863e['label']));if(this[_0x1312('0x85')](_0x27863e[_0x1312('0x67')])){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0xba'),_0x27863e[_0x1312('0x67')]));var _0x218175=this['channel'][_0x1312('0xbb')](_0x27863e[_0x1312('0x67')]);if(_0x218175[_0x1312('0xa9')]===-0x1){return _0x218175;}}return this[_0x1312('0x38')][_0x1312('0xb8')]();};AGIVertices['prototype'][_0x1312('0x4c')]=function(_0x2836b8){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0xbc'),_0x2836b8['label']));if(!this[_0x1312('0x85')](_0x2836b8[_0x1312('0xbd')])){return this['channel'][_0x1312('0x2c')](_0x2836b8,'no\x20list\x20selected');}_0x2836b8[_0x1312('0x4b')]=moment();if(this[_0x1312('0x85')](_0x2836b8['delay'])){_0x2836b8[_0x1312('0x4b')]=moment()[_0x1312('0xbe')](_0x2836b8[_0x1312('0xbf')],'minutes');}if(!this[_0x1312('0x85')](_0x2836b8[_0x1312('0x4f')])){_0x2836b8['callback_priority']=0x2;}this[_0x1312('0x46')][_0x1312('0x72')](this,_0x2836b8);return this['channel'][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0xc0'),_0x2836b8[_0x1312('0xc1')],_0x2836b8[_0x1312('0xbd')],_0x2836b8[_0x1312('0x4b')]));};AGIVertices['prototype'][_0x1312('0xc2')]=function(_0x17512f){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0xc3'),_0x17512f[_0x1312('0x3a')]));var _0x4658b4=this[_0x1312('0x38')]['exec'](_0x17512f[_0x1312('0xc4')],_0x17512f[_0x1312('0x7a')]);if(_0x4658b4[_0x1312('0xa9')]===-0x1){return _0x4658b4;}return this['channel'][_0x1312('0xaa')](util[_0x1312('0x28')]('Executed\x20command\x20%s\x20%s',_0x17512f[_0x1312('0xc4')],_0x17512f[_0x1312('0x7a')]));};AGIVertices[_0x1312('0x11')]['lumenvoxtts']=function(_0x461e28){logger[_0x1312('0x2e')](util[_0x1312('0x28')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x461e28[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x461e28[_0x1312('0x5c')])){return this['channel']['noop'](_0x1312('0xa7'));}var _0x3153d1='\x22'+_0x461e28[_0x1312('0x5c')]+'\x22';if(this[_0x1312('0x85')](_0x461e28['options'])){_0x3153d1+=','+_0x461e28[_0x1312('0x7a')];}var _0x1f2956=this[_0x1312('0x38')][_0x1312('0x57')]('MRCPSynth',_0x3153d1);if(_0x1f2956[_0x1312('0xa9')]===-0x1){return _0x1f2956;}return this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0xab'),_0x3153d1));};AGIVertices[_0x1312('0x11')][_0x1312('0xc5')]=function(_0x45f73d){logger['info'](util[_0x1312('0x28')](_0x1312('0xc6'),_0x45f73d['label']));if(!this[_0x1312('0x85')](_0x45f73d[_0x1312('0x5c')])){return this['channel']['noop'](_0x1312('0xa7'));}var _0x4724c8='\x22'+_0x45f73d['text']+'\x22';if(this[_0x1312('0x85')](_0x45f73d[_0x1312('0x7a')])){_0x4724c8+=','+_0x45f73d['options'];}var _0x32cd6=this[_0x1312('0x38')]['exec'](_0x1312('0xa8'),_0x4724c8);if(_0x32cd6['result']===-0x1){return _0x32cd6;}return this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0xab'),_0x4724c8));};AGIVertices[_0x1312('0x11')][_0x1312('0xc7')]=function(_0x35d7d6){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0xc8'),_0x35d7d6[_0x1312('0x3a')]));if(!this['isConfigured'](_0x35d7d6[_0x1312('0xac')])){return this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0xad'));}var _0x4d9a98=_0x35d7d6[_0x1312('0xac')];if(this['isConfigured'](_0x35d7d6[_0x1312('0x7a')])){_0x4d9a98+=','+_0x35d7d6[_0x1312('0x7a')];}var _0x163b24=this[_0x1312('0x38')]['exec']('MRCPRecog',_0x4d9a98);if(_0x163b24[_0x1312('0xa9')]===-0x1){return _0x163b24;}var _0x4a4c5b=this[_0x1312('0xb1')](_0x1312('0xaf'),'LUMENVOX_ASR_CONFIDENCE');if(_0x4a4c5b['result']===-0x1){return _0x4a4c5b;}var _0xa31590=this['getAndSetVariable'](_0x1312('0xb2'),_0x1312('0xc9'));if(_0xa31590[_0x1312('0xa9')]===-0x1){return _0xa31590;}var _0x3dbddd=this[_0x1312('0xb1')]('RECOG_INSTANCE()',_0x1312('0xca'));if(_0x3dbddd[_0x1312('0xa9')]===-0x1){return _0x3dbddd;}return this['channel'][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0xb5'),_0x4d9a98));};AGIVertices['prototype'][_0x1312('0xcb')]=function(_0x5af9e1){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0xcc'),_0x5af9e1[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x5af9e1[_0x1312('0xac')])){return this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0xad'));}var _0x2e0ac7=_0x5af9e1[_0x1312('0xac')];if(this[_0x1312('0x85')](_0x5af9e1[_0x1312('0x7a')])){_0x2e0ac7+=','+_0x5af9e1[_0x1312('0x7a')];}var _0x37ea78=this[_0x1312('0x38')][_0x1312('0x57')]('MRCPRecog',_0x2e0ac7);if(_0x37ea78[_0x1312('0xa9')]===-0x1){return _0x37ea78;}var _0x1f7dc7=this[_0x1312('0xb1')](_0x1312('0xaf'),_0x1312('0xcd'));if(_0x1f7dc7['result']===-0x1){return _0x1f7dc7;}var _0x379065=this[_0x1312('0xb1')](_0x1312('0xb2'),'SESTEK_ASR_TRANSCRIPT');if(_0x379065[_0x1312('0xa9')]===-0x1){return _0x379065;}var _0x1d163e=this[_0x1312('0xb1')](_0x1312('0xb4'),'SESTEK_ASR_INSTANCE');if(_0x1d163e[_0x1312('0xa9')]===-0x1){return _0x1d163e;}return this['channel'][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0xb5'),_0x2e0ac7));};AGIVertices['prototype'][_0x1312('0xce')]=function(_0x32d72f){logger[_0x1312('0x2e')](util[_0x1312('0x28')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x32d72f[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x32d72f[_0x1312('0xcf')])){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x32d72f,_0x1312('0xd0'));}var _0x3fd4b3=this[_0x1312('0xd1')][_0x1312('0x72')](this,_0x32d72f[_0x1312('0xcf')]);if(!_0x3fd4b3){return this[_0x1312('0x38')]['error'](_0x32d72f,_0x1312('0xd2'));}if(!this['isConfigured'](_0x32d72f[_0x1312('0x30')])){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x32d72f,_0x1312('0xd3'));}var _0x28ca3c=_0x32d72f[_0x1312('0x30')][_0x1312('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0xd4'),_0x28ca3c));var _0x50d34b=this[_0x1312('0x2a')][_0x1312('0x72')](this,_0x3fd4b3,_0x28ca3c);this['createSquareDetailsReport'][_0x1312('0x72')](this,_0x32d72f,_0x28ca3c);if(!this[_0x1312('0x85')](_0x32d72f['variable_id'])){return this[_0x1312('0x38')]['noop'](_0x1312('0xd5'));}var _0x3d60ea=this['getVariable']['sync'](this,_0x32d72f[_0x1312('0xd6')]);if(!_0x3d60ea){return this[_0x1312('0x38')]['error'](_0x32d72f,_0x1312('0xd7'));}var _0x2298a7=this;_0x50d34b['forEach'](function(_0x2f42da,_0x518b89){Object[_0x1312('0xd8')](_0x2f42da)[_0x1312('0xd9')](function(_0x2a17e7){_0x2298a7[_0x1312('0x38')]['setVariable'](util[_0x1312('0x28')](_0x1312('0xda'),_0x3d60ea,_0x518b89,_0x2a17e7),_0x2f42da[_0x2a17e7]);});});this[_0x1312('0x38')][_0x1312('0xa4')](util['format'](_0x1312('0xdb'),_0x3d60ea),_0x50d34b[_0x1312('0x9c')]);return this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0xdc'),_0x3d60ea));};AGIVertices[_0x1312('0x11')][_0x1312('0xdd')]=function(_0x7a8bc7){logger[_0x1312('0xde')](util[_0x1312('0x28')](_0x1312('0xdf'),_0x7a8bc7[_0x1312('0x3a')]));if(!this['isConfigured'](_0x7a8bc7['sip_id'])){return this[_0x1312('0x38')]['error'](_0x7a8bc7,_0x1312('0xe0'));}var _0xa6585e=this['getUser'][_0x1312('0x72')](this,_0x7a8bc7[_0x1312('0xe1')]);if(!_0xa6585e){return this['channel'][_0x1312('0x2c')](_0x7a8bc7,'no\x20user\x20found');}var _0x416e23=this[_0x1312('0x38')][_0x1312('0x57')](_0x1312('0xe2'),[util[_0x1312('0x28')](_0x1312('0xe3'),_0xa6585e),_0x7a8bc7[_0x1312('0x67')],_0x7a8bc7[_0x1312('0xe4')],_0x7a8bc7['url']]);if(_0x416e23[_0x1312('0xa9')]===-0x1){return _0x416e23;}return this['channel']['noop'](util[_0x1312('0x28')](_0x1312('0xe5'),_0x1312('0xe2')));};AGIVertices[_0x1312('0x11')][_0x1312('0xe6')]=function(_0xadbd78){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0xe7'),_0xadbd78['label']));if(!this[_0x1312('0x85')](_0xadbd78[_0x1312('0x82')])){return this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0xe8'));}if(!this[_0x1312('0x85')](_0xadbd78['text'])){return this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0xa7'));}this['channel'][_0x1312('0xe9')]=!![];this[_0x1312('0x37')](_0xadbd78);this[_0x1312('0x45')](_0xadbd78[_0x1312('0x5c')],'in','','');this['channel'][_0x1312('0xaa')](util[_0x1312('0x28')]('Trying\x20Dialogflow:\x20%s',_0xadbd78['text']));var _0xec177c=this['googleDialogflow'][_0x1312('0x72')](this,_0xadbd78);if(_0xec177c){for(var _0x5c6fbf in _0xec177c){if(_0xec177c[_0x1312('0x96')](_0x5c6fbf)){this['channel'][_0x1312('0xa4')](util['format']('DIALOGFLOW_%s',_0x5c6fbf[_0x1312('0x6b')]()),_0xec177c[_0x5c6fbf]);}}this[_0x1312('0x45')](_0xec177c[_0x1312('0xea')],_0x1312('0xeb'),_0x1312('0xe6'),'');return this['channel'][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0xec'),_0xec177c[_0x1312('0xea')]));}return this['channel']['error'](_0xadbd78,_0x1312('0xed'));};AGIVertices[_0x1312('0x11')][_0x1312('0xee')]=function(_0x4d618f){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0xef'),_0x4d618f[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x4d618f[_0x1312('0xf0')])){return this['channel'][_0x1312('0xaa')](_0x1312('0xf1'));}if(!this['isConfigured'](_0x4d618f['client_email'])){return this['channel']['noop'](_0x1312('0xf2'));}if(!this['isConfigured'](_0x4d618f[_0x1312('0x7e')])){return this[_0x1312('0x38')]['noop'](_0x1312('0xf3'));}if(!this['isConfigured'](_0x4d618f[_0x1312('0x7f')])){return this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0xf4'));}if(!this[_0x1312('0x85')](_0x4d618f[_0x1312('0x5c')])){return this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0xa7'));}this['channel'][_0x1312('0xe9')]=!![];this[_0x1312('0x37')](_0x4d618f);this[_0x1312('0x45')](_0x4d618f[_0x1312('0x5c')],'in','','');this[_0x1312('0x38')]['noop'](util[_0x1312('0x28')](_0x1312('0xf5'),_0x4d618f[_0x1312('0x5c')]));var _0x5e5219=this[_0x1312('0x7d')][_0x1312('0x72')](this,_0x4d618f);if(_0x5e5219){for(var _0x280770 in _0x5e5219){if(_0x5e5219[_0x1312('0x96')](_0x280770)){if(_0x280770!=='providerResponse'){this[_0x1312('0x38')][_0x1312('0xa4')](util[_0x1312('0x28')](_0x1312('0xf6'),_0x280770[_0x1312('0x6b')]()),_0x5e5219[_0x280770]);}}}this['createSquareMessage'](_0x5e5219[_0x1312('0xea')],_0x1312('0xeb'),'dialogflowV2',_0x5e5219[_0x1312('0xf7')]);return this[_0x1312('0x38')][_0x1312('0xaa')](util['format']('DialogflowV2\x20Result\x20%s',_0x5e5219[_0x1312('0xea')]));}return this[_0x1312('0x38')][_0x1312('0x2c')](_0x4d618f,_0x1312('0xf8'));};AGIVertices[_0x1312('0x11')][_0x1312('0xf9')]=function(_0x5107d2){logger[_0x1312('0x2e')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x5107d2[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x5107d2[_0x1312('0xfa')])){return this[_0x1312('0x38')][_0x1312('0xaa')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x1312('0x85')](_0x5107d2['username'])){return this['channel'][_0x1312('0xaa')](_0x1312('0xfb'));}if(!this['isConfigured'](_0x5107d2[_0x1312('0xfc')])){return this[_0x1312('0x38')][_0x1312('0xaa')]('no\x20password\x20configured');}if(!this[_0x1312('0x85')](_0x5107d2[_0x1312('0xfd')])){return this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0xa7'));}this[_0x1312('0x38')][_0x1312('0xe9')]=!![];this[_0x1312('0x37')](_0x5107d2);this[_0x1312('0x45')](_0x5107d2[_0x1312('0x5c')],'in','','');this['channel'][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0xfe'),_0x5107d2[_0x1312('0x5c')]));var _0x4d4e8b=this['sestekNDA'][_0x1312('0x72')](this,_0x5107d2);if(_0x4d4e8b){for(var _0x11780f in _0x4d4e8b){if(_0x4d4e8b[_0x1312('0x96')](_0x11780f)){this[_0x1312('0x38')][_0x1312('0xa4')](util[_0x1312('0x28')]('SESTEK_NDA_%s',_0x11780f[_0x1312('0x6b')]()),_0x4d4e8b[_0x11780f]);}}this['createSquareMessage'](_0x4d4e8b['speech'],_0x1312('0xeb'),_0x1312('0xf9'),'');if(_0x4d4e8b[_0x1312('0xff')]){this[_0x1312('0x38')][_0x1312('0xaa')](util['format'](_0x1312('0x100'),_0x4d4e8b[_0x1312('0xff')]));var _0x1090f0=this[_0x1312('0x38')][_0x1312('0x101')](_0x4d4e8b[_0x1312('0xff')]);try{fs[_0x1312('0x102')](_0x4d4e8b['audiofile']+'.wav');}catch(_0x1874a3){logger[_0x1312('0x2c')](_0x1874a3);}return _0x1090f0;}else{return this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x103'),_0x4d4e8b[_0x1312('0xea')]));}}return this[_0x1312('0x38')][_0x1312('0x2c')](_0x5107d2,_0x1312('0x104'));};AGIVertices[_0x1312('0x11')][_0x1312('0x105')]=function(_0x1b6f9c){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x106'),_0x1b6f9c[_0x1312('0x3a')]));return this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0x105'));};AGIVertices['prototype'][_0x1312('0x107')]=function(_0x1926bc){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x108'),_0x1926bc[_0x1312('0x3a')]));var _0x106117='';if(_0x1926bc[_0x1312('0x109')]){if(!this[_0x1312('0x85')](_0x1926bc[_0x1312('0x109')])){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x1926bc,_0x1312('0x10a'));}else{var _0x301c75=parseInt(_0x1926bc['trunk_id'],0xa);if(isNaN(_0x301c75)){_0x106117=_0x1926bc[_0x1312('0x109')];}else{_0x106117=this['getTrunk'][_0x1312('0x72')](this,_0x1926bc[_0x1312('0x109')]);if(!_0x106117){return this['channel'][_0x1312('0x2c')](_0x1926bc,_0x1312('0x10b'));}}}}else if(_0x1926bc[_0x1312('0x10c')]){_0x106117=_0x1926bc[_0x1312('0x10c')];}else{return this[_0x1312('0x38')][_0x1312('0x2c')](_0x1926bc,_0x1312('0x10a'));}var _0x532a50=this[_0x1312('0x38')]['exec']('DIAL',[util[_0x1312('0x28')](_0x1312('0x10d'),_0x106117,_0x1926bc[_0x1312('0xc1')]),_0x1926bc[_0x1312('0x67')],_0x1926bc[_0x1312('0xe4')],_0x1926bc[_0x1312('0x65')]]);if(_0x532a50['result']===-0x1){return _0x532a50;}return this[_0x1312('0x38')]['noop'](util[_0x1312('0x28')]('Executed\x20command\x20%s',_0x1312('0xe2')));};AGIVertices[_0x1312('0x11')][_0x1312('0x10e')]=function(_0x4796a2){logger[_0x1312('0x2e')](util['format'](_0x1312('0x10f'),_0x4796a2[_0x1312('0x3a')]));return this[_0x1312('0x38')][_0x1312('0xaa')]('finally');};AGIVertices['prototype'][_0x1312('0xd')]=function(_0x3fd625){logger[_0x1312('0x2e')](util[_0x1312('0x28')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3fd625[_0x1312('0x3a')]));if(_0x3fd625[_0x1312('0xa6')]===0x0){return this[_0x1312('0xa5')](_0x3fd625);}_0x3fd625[_0x1312('0xa6')]-=0x1;if(!this['isConfigured'](_0x3fd625[_0x1312('0x110')])){return this[_0x1312('0x38')]['error'](_0x3fd625,_0x1312('0x111'));}var _0x38b974=this['getSound'][_0x1312('0x72')](this,_0x3fd625[_0x1312('0x110')]);if(!_0x38b974){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x3fd625,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x3fd625[_0x1312('0xd6')])){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x1312('0xd5'));}var _0x5d7d53=this[_0x1312('0x38')][_0x1312('0x112')](_0x38b974,_0x3fd625[_0x1312('0x113')],_0x3fd625['maxdigit']);var _0x25143a=_0x5d7d53['result']?_0x5d7d53[_0x1312('0xa9')][_0x1312('0x4e')]():'';logger[_0x1312('0x2e')](_0x1312('0x114'),JSON[_0x1312('0x75')](_0x5d7d53));if(_0x5d7d53[_0x1312('0xa9')]===-0x1){this[_0x1312('0x37')][_0x1312('0x72')](this,_0x3fd625,_0x25143a);return _0x5d7d53;}else if(_0x5d7d53[_0x1312('0xa2')]===_0x1312('0x67')){_0x5d7d53['result']=_0x25143a[_0x1312('0x9c')]>=parseInt(_0x3fd625[_0x1312('0x115')])?'x':'i';}else{_0x5d7d53['result']=_0x25143a[_0x1312('0x9c')]>=parseInt(_0x3fd625[_0x1312('0x115')])&&_0x25143a[_0x1312('0x9c')]<=parseInt(_0x3fd625[_0x1312('0x116')])?'x':'i';}var _0x2eccf7=this[_0x1312('0xa1')][_0x1312('0x72')](this,_0x3fd625[_0x1312('0xd6')]);if(!_0x2eccf7){return this['channel'][_0x1312('0x2c')](_0x3fd625,_0x1312('0xd7'));}this[_0x1312('0x38')][_0x1312('0xa4')](_0x2eccf7,_0x25143a);if(this[_0x1312('0x85')](_0x3fd625[_0x1312('0x117')])){var _0x409c35=parseInt(_0x3fd625[_0x1312('0x117')],0xa);var _0x3cd7fd=rs['generate']({'charset':'*','length':_0x409c35});var _0x54626f=_0x25143a[_0x1312('0x9c')];if(_0x54626f>0x0){if(_0x54626f>_0x409c35){this[_0x1312('0x37')][_0x1312('0x72')](this,_0x3fd625,_0x3fd625[_0x1312('0x118')]===_0x1312('0x119')?_0x3cd7fd+_0x25143a['substr'](_0x409c35):_0x25143a[_0x1312('0x11a')](0x0,_0x54626f-_0x409c35)+_0x3cd7fd);}else{this[_0x1312('0x37')][_0x1312('0x72')](this,_0x3fd625,rs[_0x1312('0x11b')]({'charset':'*','length':_0x54626f}));}}else{this[_0x1312('0x37')][_0x1312('0x72')](this,_0x3fd625,'');}}else{this[_0x1312('0x37')][_0x1312('0x72')](this,_0x3fd625,_0x25143a);}return _0x5d7d53;};AGIVertices[_0x1312('0x11')][_0x1312('0xe')]=function(_0x2d7a45){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x11c'),_0x2d7a45[_0x1312('0x3a')]));return this[_0x1312('0xd')](_0x2d7a45);};AGIVertices[_0x1312('0x11')][_0x1312('0x11d')]=function(_0x568db9){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x11e'),_0x568db9[_0x1312('0x3a')]));this[_0x1312('0x37')]['sync'](this,_0x568db9,_0x568db9['goalname']);return this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x11f'),_0x568db9['goalname']));};AGIVertices[_0x1312('0x11')]['awspolly']=function(_0x537172){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x120'),_0x537172[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x537172[_0x1312('0x88')])||!this[_0x1312('0x85')](_0x537172[_0x1312('0x89')])){return this[_0x1312('0x38')]['noop'](_0x1312('0x121'));}if(!this[_0x1312('0x85')](_0x537172[_0x1312('0x5c')])){return this['channel'][_0x1312('0xaa')](_0x1312('0xa7'));}this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x122'),_0x537172[_0x1312('0x5c')]));var _0x1afbdb=this[_0x1312('0x87')][_0x1312('0x72')](this,_0x537172);if(_0x1afbdb){this[_0x1312('0x38')]['noop'](util['format'](_0x1312('0x123'),_0x1afbdb));var _0x26ce78=this['channel'][_0x1312('0x101')](_0x1afbdb);try{fs[_0x1312('0x102')](_0x1afbdb+_0x1312('0x124'));}catch(_0x2198ad){logger[_0x1312('0x2c')](_0x2198ad);}return _0x26ce78;}return this[_0x1312('0x38')][_0x1312('0x2c')](_0x537172,_0x1312('0x125'));};AGIVertices[_0x1312('0x11')][_0x1312('0x126')]=function(_0xc3f8cb){logger['info'](util[_0x1312('0x28')](_0x1312('0x127'),_0xc3f8cb[_0x1312('0x3a')]));if(!this['isConfigured'](_0xc3f8cb[_0x1312('0x88')])||!this[_0x1312('0x85')](_0xc3f8cb['aws_secret_access_key'])){return this[_0x1312('0x38')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x1312('0x85')](_0xc3f8cb[_0x1312('0x8f')])){return this['channel'][_0x1312('0xaa')](_0x1312('0x128'));}if(!this[_0x1312('0x85')](_0xc3f8cb[_0x1312('0x5c')])){return this['channel'][_0x1312('0xaa')](_0x1312('0xa7'));}this['channel'][_0x1312('0xe9')]=!![];this[_0x1312('0x37')](_0xc3f8cb);this[_0x1312('0x45')](_0xc3f8cb[_0x1312('0x5c')],'in','','');this[_0x1312('0x38')]['noop'](util['format'](_0x1312('0x129'),_0xc3f8cb[_0x1312('0x5c')]));var _0x18e921=this[_0x1312('0x8d')][_0x1312('0x72')](this,_0xc3f8cb);if(_0x18e921){for(var _0x15a27d in _0x18e921){if(_0x18e921['hasOwnProperty'](_0x15a27d)&&_[_0x1312('0x97')](_0x18e921[_0x15a27d])){this[_0x1312('0x38')][_0x1312('0xa4')](util[_0x1312('0x28')](_0x1312('0x12a'),_0x15a27d[_0x1312('0x6b')]()),_0x18e921[_0x15a27d]);}}if(_[_0x1312('0x4a')](_0x18e921[_0x1312('0x78')])){return this[_0x1312('0x38')]['noop'](_0x1312('0x12b'));}else{this['createSquareMessage'](_0x18e921[_0x1312('0x78')],_0x1312('0xeb'),'amazonlex','');return this[_0x1312('0x38')]['noop'](util[_0x1312('0x28')](_0x1312('0x12c'),_0x18e921[_0x1312('0x78')]));}}return this[_0x1312('0x38')][_0x1312('0x2c')](_0xc3f8cb,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x1312('0x11')][_0x1312('0x12d')]=function(_0x1a0f2f){logger[_0x1312('0x2e')](util[_0x1312('0x28')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x1a0f2f['label'],_0x1a0f2f[_0x1312('0x67')]));if(!this['isConfigured'](_0x1a0f2f['key'])){return this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0xe8'));}var _0xfb9070=_0x1312('0x12e');var _0x295068=util[_0x1312('0x28')](_0x1312('0x12f'),FILES_PATH,rs['generate'](0x4));var _0x68a82e=util[_0x1312('0x28')](_0x1312('0x9e'),_0x295068,_0xfb9070);var _0x468261=!![];if(_0x1a0f2f[_0x1312('0x130')]===_0x1312('0x131')){_0x468261=![];}var _0x5cf4e0=this[_0x1312('0x38')][_0x1312('0x132')](_0x295068,_0xfb9070,_0x1a0f2f[_0x1312('0x133')],_0x1a0f2f['timeout'],undefined,_0x468261);if(_0x5cf4e0['result']!==-0x1){this[_0x1312('0x38')]['noop'](util[_0x1312('0x28')](_0x1312('0x134'),_0x68a82e));var _0x12d49b=this[_0x1312('0x90')][_0x1312('0x72')](this,_0x1a0f2f,_0x68a82e);if(_0x12d49b){for(var _0x231b6c in _0x12d49b){if(_0x12d49b[_0x1312('0x96')](_0x231b6c)){this[_0x1312('0x38')][_0x1312('0xa4')](util[_0x1312('0x28')]('GOOGLE_ASR_%s',_0x231b6c['toUpperCase']()),_0x12d49b[_0x231b6c]);}}return this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x135'),JSON[_0x1312('0x75')](_0x12d49b)));}}return _0x5cf4e0;};AGIVertices[_0x1312('0x11')][_0x1312('0x136')]=function(_0x114918){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x137'),_0x114918[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x114918[_0x1312('0x93')])){return this[_0x1312('0x38')]['noop'](_0x1312('0x138'));}if(!this[_0x1312('0x85')](_0x114918[_0x1312('0x94')])){return this[_0x1312('0x38')][_0x1312('0xaa')]('no\x20appsecret\x20configured');}var _0x3850ed='wav';var _0x26c097=util[_0x1312('0x28')](_0x1312('0x12f'),FILES_PATH,rs[_0x1312('0x11b')](0x4));var _0x4bc020=util['format'](_0x1312('0x9e'),_0x26c097,_0x3850ed);var _0x570df2=!![];if(_0x114918[_0x1312('0x130')]===_0x1312('0x131')){_0x570df2=![];}var _0x964c2d=this[_0x1312('0x38')][_0x1312('0x132')](_0x26c097,_0x3850ed,_0x114918[_0x1312('0x133')],_0x114918[_0x1312('0x67')],undefined,_0x570df2);if(_0x964c2d[_0x1312('0xa9')]!==-0x1){this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x139'),_0x4bc020));var _0x18ea49=this[_0x1312('0x92')][_0x1312('0x72')](this,_0x114918,_0x4bc020);if(_0x18ea49){for(var _0x28d398 in _0x18ea49){if(_0x18ea49[_0x1312('0x96')](_0x28d398)){this[_0x1312('0x38')][_0x1312('0xa4')](util['format'](_0x1312('0x13a'),_0x28d398[_0x1312('0x6b')]()),_0x18ea49[_0x28d398]);}}return this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x13b'),JSON[_0x1312('0x75')](_0x18ea49)));}}return _0x964c2d;};AGIVertices[_0x1312('0x11')]['gotoc']=function(_0x1928cc){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x13c'),_0x1928cc['label']));return this[_0x1312('0x38')]['continueAt'](_0x1928cc[_0x1312('0x3f')],_0x1928cc[_0x1312('0x40')],_0x1928cc[_0x1312('0x13d')]);};AGIVertices[_0x1312('0x11')][_0x1312('0x13e')]=function(_0x49db62){logger[_0x1312('0x2e')](util[_0x1312('0x28')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x49db62['label']));if(!this['isConfigured'](_0x49db62[_0x1312('0x13f')])){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x49db62,'no\x20condition\x20configured');}try{var _0x2da487=eval(_0x49db62[_0x1312('0x13f')])?_0x1312('0x140'):_0x1312('0x141');this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x142'),_0x49db62['condition'],_0x2da487));return{'code':0xc8,'result':_0x2da487};}catch(_0x7269f3){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x1312('0x11')][_0x1312('0x143')]=function(_0xfb5699){logger['info'](util[_0x1312('0x28')](_0x1312('0x144'),_0xfb5699[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0xfb5699['interval_id'])){return this[_0x1312('0x38')][_0x1312('0x2c')](_0xfb5699,'no\x20interval\x20configured');}var _0x3fde19=this[_0x1312('0x23')][_0x1312('0x72')](this,_0xfb5699[_0x1312('0x145')]);if(!_0x3fde19){return this[_0x1312('0x38')][_0x1312('0x2c')](_0xfb5699,_0x1312('0x146'));}for(var _0x2e2592=0x0;_0x2e2592<_0x3fde19[_0x1312('0x9c')];_0x2e2592+=0x1){var _0x136f1b=this[_0x1312('0x38')][_0x1312('0xa1')](util[_0x1312('0x28')](_0x1312('0x147'),_0x3fde19[_0x2e2592]));if(_0x136f1b['result']===-0x1){return _0x136f1b;}logger['info'](util['format'](_0x1312('0x148'),_0x3fde19[_0x2e2592],_0x136f1b['extra']));if(_0x136f1b[_0x1312('0xa2')]==='true'){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x148'),_0x3fde19[_0x2e2592],'true'));this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x148'),_0x3fde19[_0x2e2592],'true'));return{'code':0xc8,'result':_0x1312('0x140')};}else{logger['info'](util[_0x1312('0x28')](_0x1312('0x148'),_0x3fde19[_0x2e2592],_0x1312('0x141')));this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x148'),_0x3fde19[_0x2e2592],_0x1312('0x141')));}}return{'code':0xc8,'result':_0x1312('0x141')};};AGIVertices[_0x1312('0x11')][_0x1312('0x149')]=function(_0x535b77){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x14a'),_0x535b77['label']));return this[_0x1312('0x38')]['hangup']();};AGIVertices['prototype']['ispeechasr']=function(_0xba08e5){logger['info'](util[_0x1312('0x28')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0xba08e5[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0xba08e5[_0x1312('0x82')])){return this['channel'][_0x1312('0xaa')](_0x1312('0xe8'));}var _0x25aab9='wav';var _0x3f0401=util['format'](_0x1312('0x12f'),FILES_PATH,rs[_0x1312('0x11b')](0x4));var _0x2960ed=util[_0x1312('0x28')](_0x1312('0x9e'),_0x3f0401,_0x25aab9);var _0x52a185=!![];if(_0xba08e5[_0x1312('0x130')]===_0x1312('0x131')){_0x52a185=![];}var _0x38ca27=this[_0x1312('0x38')][_0x1312('0x132')](_0x3f0401,_0x25aab9,_0xba08e5[_0x1312('0x133')],_0xba08e5['timeout'],undefined,_0x52a185);if(_0x38ca27['result']!==-0x1){this['channel']['noop'](util[_0x1312('0x28')](_0x1312('0x14b'),_0x2960ed));var _0x888d3a=this[_0x1312('0x84')][_0x1312('0x72')](this,_0xba08e5,_0x2960ed);if(_0x888d3a){for(var _0x3fc2e8 in _0x888d3a){if(_0x888d3a[_0x1312('0x96')](_0x3fc2e8)){this[_0x1312('0x38')][_0x1312('0xa4')](util['format'](_0x1312('0x14c'),_0x3fc2e8['toUpperCase']()),_0x888d3a[_0x3fc2e8]);}}return this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x14d'),JSON['stringify'](_0x888d3a)));}}return _0x38ca27;};AGIVertices[_0x1312('0x11')][_0x1312('0x14e')]=function(_0x741865){logger['info'](util[_0x1312('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x741865[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x741865[_0x1312('0x82')])){return this[_0x1312('0x38')][_0x1312('0xaa')]('no\x20key\x20configured');}if(!this[_0x1312('0x85')](_0x741865[_0x1312('0x5c')])){return this[_0x1312('0x38')][_0x1312('0xaa')]('no\x20text\x20configured');}this['channel'][_0x1312('0xaa')](util[_0x1312('0x28')]('Trying\x20ispeech\x20TTS\x20%s',_0x741865[_0x1312('0x5c')]));var _0x37534b=this['ispeechTTS']['sync'](this,_0x741865);if(_0x37534b){this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x14b'),_0x37534b));var _0x45ab86=this[_0x1312('0x38')][_0x1312('0x101')](_0x37534b,_0x741865[_0x1312('0x133')]);try{fs['unlink'](_0x37534b+_0x1312('0x124'));}catch(_0x13b737){logger[_0x1312('0x2c')](_0x13b737);}return _0x45ab86;}return this[_0x1312('0x38')][_0x1312('0x2c')](_0x741865,_0x1312('0x14f'));};AGIVertices[_0x1312('0x11')][_0x1312('0x150')]=function(_0x1cd113){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x151'),_0x1cd113[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x1cd113[_0x1312('0x152')])){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x1cd113,'no\x20find\x20by\x20configured');}logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x153'),this['channel'][_0x1312('0x3d')],_0x1cd113[_0x1312('0x152')]));var _0x273fba=this[_0x1312('0x154')][_0x1312('0x72')](this,_0x1cd113[_0x1312('0x152')]);if(_0x273fba){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x155'),this[_0x1312('0x38')]['callerid'],_0x1cd113[_0x1312('0x152')]));this['channel']['noop'](util['format'](_0x1312('0x155'),this[_0x1312('0x38')][_0x1312('0x3d')],_0x1cd113[_0x1312('0x152')]));return{'code':0xc8,'result':_0x1312('0x156')};}else{logger[_0x1312('0x2e')](util['format'](_0x1312('0x157'),this[_0x1312('0x38')][_0x1312('0x3d')],_0x1cd113[_0x1312('0x152')]));this['channel'][_0x1312('0xaa')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x1312('0x3d')],_0x1cd113['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x1312('0x11')][_0x1312('0x158')]=function(_0x2d4fc3){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x159'),_0x2d4fc3[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x2d4fc3[_0x1312('0x152')])){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x2d4fc3,_0x1312('0x15a'));}logger['info'](util[_0x1312('0x28')](_0x1312('0x153'),this[_0x1312('0x38')][_0x1312('0x3d')],_0x2d4fc3[_0x1312('0x152')]));var _0x101efb=this[_0x1312('0x54')]['sync'](this,_0x2d4fc3[_0x1312('0x152')]);if(_0x101efb){logger[_0x1312('0x2e')](util[_0x1312('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1312('0x38')][_0x1312('0x3d')],_0x2d4fc3['findBy']));this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1312('0x38')][_0x1312('0x3d')],_0x2d4fc3[_0x1312('0x152')]));return{'code':0xc8,'result':_0x1312('0x156')};}else{logger[_0x1312('0x2e')](util[_0x1312('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1312('0x38')][_0x1312('0x3d')],_0x2d4fc3[_0x1312('0x152')]));this[_0x1312('0x38')]['noop'](util[_0x1312('0x28')](_0x1312('0x157'),this[_0x1312('0x38')][_0x1312('0x3d')],_0x2d4fc3['findBy']));return{'code':0xc8,'result':_0x1312('0x15b')};}};AGIVertices[_0x1312('0x11')][_0x1312('0x15c')]=function(_0x5dc7ab){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x15d'),_0x5dc7ab[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x5dc7ab['operation'])){return this[_0x1312('0x38')]['error'](_0x5dc7ab,'no\x20operation\x20configured');}this[_0x1312('0x38')][_0x1312('0xaa')](util['format'](_0x1312('0x15e'),_0x5dc7ab[_0x1312('0x15f')]));var _0x560df5=eval(_0x5dc7ab[_0x1312('0x15f')]);if(!this[_0x1312('0x85')](_0x5dc7ab['variable_id'])){return this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0xd5'));}var _0xb7812b=this[_0x1312('0xa1')][_0x1312('0x72')](this,_0x5dc7ab['variable_id']);if(!_0xb7812b){return this['channel'][_0x1312('0x2c')](_0x5dc7ab,_0x1312('0xd7'));}if(_[_0x1312('0x9b')](_0x560df5)){var _0x1b4902=this;_0x560df5[_0x1312('0xd9')](function(_0x3bcdbf,_0x4b2a95){_0x1b4902[_0x1312('0x38')][_0x1312('0xa4')](util[_0x1312('0x28')](_0x1312('0x160'),_0xb7812b,_0x4b2a95),_0x3bcdbf);});return this['channel'][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x161'),_0xb7812b));}else{return this['channel'][_0x1312('0xa4')](_0xb7812b,_0x560df5);}};AGIVertices['prototype'][_0x1312('0x162')]=function(_0x2fef7f){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x163'),_0x2fef7f[_0x1312('0x3a')]));if(_0x2fef7f[_0x1312('0xa6')]===0x0){return this[_0x1312('0xa5')](_0x2fef7f);}_0x2fef7f[_0x1312('0xa6')]-=0x1;if(!this[_0x1312('0x85')](_0x2fef7f[_0x1312('0x110')])){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x2fef7f,_0x1312('0x111'));}var _0x4c24b4=this[_0x1312('0x1d')][_0x1312('0x72')](this,_0x2fef7f[_0x1312('0x110')]);if(!_0x4c24b4){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x2fef7f,'no\x20file\x20audio\x20found');}var _0x12998b=this[_0x1312('0x38')]['getData'](_0x4c24b4,_0x2fef7f[_0x1312('0x113')],_0x2fef7f[_0x1312('0x164')]);var _0x1f8a0c=_0x12998b[_0x1312('0xa9')];if(_0x12998b[_0x1312('0xa9')]===-0x1){this['createSquareDetailsReport'][_0x1312('0x72')](this,_0x2fef7f,'-1');return _0x12998b;}else if(_0x12998b[_0x1312('0xa2')]===_0x1312('0x67')){_0x12998b[_0x1312('0xa9')]=_0x12998b[_0x1312('0xa9')][_0x1312('0x9c')]>0x0?_0x12998b[_0x1312('0xa9')]:'t';}else if(_[_0x1312('0x47')](_0x12998b[_0x1312('0xa9')])){_0x12998b[_0x1312('0xa9')]='#';_0x1f8a0c='#';}if(!this[_0x1312('0x85')](_0x2fef7f[_0x1312('0xd6')])){this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0xd5'));}else{var _0x39270e=this[_0x1312('0xa1')][_0x1312('0x72')](this,_0x2fef7f['variable_id']);if(!_0x39270e){return this[_0x1312('0x38')]['error'](_0x2fef7f,_0x1312('0xd7'));}this[_0x1312('0x38')][_0x1312('0xa4')](_0x39270e,_0x1f8a0c);}this[_0x1312('0x37')][_0x1312('0x72')](this,_0x2fef7f,_0x1f8a0c);return _0x12998b;};AGIVertices[_0x1312('0x11')][_0x1312('0xaa')]=function(_0x299008){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x165'),_0x299008[_0x1312('0x3a')]));return this[_0x1312('0x38')]['noop'](_0x299008[_0x1312('0x166')]||_0x299008[_0x1312('0x3a')]);};AGIVertices['prototype'][_0x1312('0x167')]=function(_0x60bb9c){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x168'),_0x60bb9c[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x60bb9c[_0x1312('0x152')])){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x60bb9c,_0x1312('0x15a'));}logger['info'](util[_0x1312('0x28')](_0x1312('0x153'),this['channel']['callerid'],_0x60bb9c[_0x1312('0x152')]));var _0x1f75f3=this['getPause'][_0x1312('0x72')](this,_0x60bb9c[_0x1312('0x169')]);var _0x38fd1c=this[_0x1312('0x52')][_0x1312('0x72')](this,_0x60bb9c[_0x1312('0x152')],_0x1f75f3);if(_0x38fd1c){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x155'),this[_0x1312('0x38')][_0x1312('0x3d')],_0x60bb9c[_0x1312('0x152')]));this['channel'][_0x1312('0xaa')](util['format'](_0x1312('0x155'),this[_0x1312('0x38')][_0x1312('0x3d')],_0x60bb9c[_0x1312('0x152')]));return{'code':0xc8,'result':_0x1312('0x156')};}else{logger['info'](util[_0x1312('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1312('0x38')]['callerid'],_0x60bb9c[_0x1312('0x152')]));this['channel']['noop'](util[_0x1312('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1312('0x38')][_0x1312('0x3d')],_0x60bb9c[_0x1312('0x152')]));return{'code':0xc8,'result':_0x1312('0x15b')};}};AGIVertices[_0x1312('0x11')][_0x1312('0x16a')]=function(_0x5b59dc){logger[_0x1312('0x2e')](util[_0x1312('0x28')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x5b59dc[_0x1312('0x3a')]));if(!this['isConfigured'](_0x5b59dc[_0x1312('0x110')])){return this['channel'][_0x1312('0x2c')](_0x5b59dc,_0x1312('0x111'));}var _0x2c24c9=this[_0x1312('0x1d')]['sync'](this,_0x5b59dc[_0x1312('0x110')]);if(!_0x2c24c9){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x5b59dc,_0x1312('0x16b'));}var _0x6eb86e=this[_0x1312('0x38')]['exec'](_0x1312('0x16c'),[_0x2c24c9,_0x5b59dc[_0x1312('0xe4')]]);if(_0x6eb86e['result']===-0x1){return _0x6eb86e;}return this[_0x1312('0x38')][_0x1312('0xaa')](util['format']('Executed\x20command\x20%s\x20%s',_0x1312('0x16c'),_0x2c24c9));};AGIVertices['prototype'][_0x1312('0x16d')]=function(_0x13c1c5){logger[_0x1312('0x2e')](util[_0x1312('0x28')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x13c1c5[_0x1312('0x3a')]));if(!this['isConfigured'](_0x13c1c5[_0x1312('0x16e')])){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x13c1c5,_0x1312('0x16f'));}var _0x434f36='';var _0x46255e=parseInt(_0x13c1c5['queue_id'],0xa);if(isNaN(_0x46255e)){_0x434f36=_0x13c1c5[_0x1312('0x16e')];}else{_0x434f36=this[_0x1312('0x16')][_0x1312('0x72')](this,_0x13c1c5['queue_id']);if(!_0x434f36){return this['channel'][_0x1312('0x2c')](_0x13c1c5,_0x1312('0x170'));}}var _0x26af8c='';if(this[_0x1312('0x85')](_0x13c1c5[_0x1312('0x110')])){var _0x5d4b9b=this['getSound'][_0x1312('0x72')](this,_0x13c1c5[_0x1312('0x110')]);if(_0x5d4b9b){_0x26af8c=_0x5d4b9b;}}this['createSquareDetailsReport']['sync'](this,_0x13c1c5,_0x434f36);if(_0x13c1c5[_0x1312('0xe4')]['indexOf']('x')<0x0){_0x13c1c5[_0x1312('0xe4')]+='x';}if(_0x13c1c5[_0x1312('0xe4')][_0x1312('0x171')]('X')<0x0){_0x13c1c5['opts']+='X';}this[_0x1312('0x38')][_0x1312('0xa4')]('XMCS-QUEUE',_0x434f36?_0x434f36[_0x1312('0x172')]():'');var _0x17cdb5=this['channel']['exec'](_0x1312('0x173'),[_0x434f36,_0x13c1c5['opts'],_0x13c1c5[_0x1312('0x65')],_0x26af8c,_0x13c1c5['timeout'],_0x13c1c5['agi'],_0x13c1c5['macro'],_0x13c1c5[_0x1312('0x174')],'',_0x13c1c5['position']]);if(_0x17cdb5[_0x1312('0xa9')]===-0x1){return _0x17cdb5;}return this['channel']['noop'](util[_0x1312('0x28')](_0x1312('0x175'),_0x1312('0x173'),_0x434f36));};AGIVertices['prototype'][_0x1312('0x176')]=function(_0x3abd60){logger['info'](util['format'](_0x1312('0x177'),_0x3abd60[_0x1312('0x3a')]));var _0x313a27=_0x3abd60[_0x1312('0x178')]||_0x1312('0x12e');var _0x944f99=util['format'](_0x1312('0x179'),this[_0x1312('0x38')][_0x1312('0x39')],rs[_0x1312('0x11b')](0x5));var _0x3d0abe=util[_0x1312('0x28')]('%s/recordings/%s.%s',FILES_PATH,_0x944f99,_0x313a27);var _0x29d8b4=util[_0x1312('0x28')](_0x1312('0x12f'),FILES_PATH,_0x944f99);this[_0x1312('0x3c')][_0x1312('0x72')](this,_0x3abd60,_0x944f99,_0x3d0abe);this[_0x1312('0x38')][_0x1312('0xa4')](_0x1312('0x17a'),_0x944f99);logger[_0x1312('0x2e')](_0x1312('0x17b'),_0x29d8b4,_0x313a27,_0x3abd60[_0x1312('0x17c')],_0x3abd60[_0x1312('0x67')]);return this[_0x1312('0x38')][_0x1312('0x132')](_0x29d8b4,_0x313a27,_0x3abd60['escape_digits'],_0x3abd60[_0x1312('0x67')],undefined,!![]);};AGIVertices[_0x1312('0x11')][_0x1312('0x17d')]=function(_0x549916){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x17e'),_0x549916[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x549916['url'])){return this['channel'][_0x1312('0xaa')](_0x1312('0x17f'));}var _0x3ea01c=this[_0x1312('0x64')][_0x1312('0x72')](this,_0x549916);logger['info'](util[_0x1312('0x28')]('Response:',util[_0x1312('0x180')](_0x3ea01c,{'showHidden':![],'depth':null})));if(!this[_0x1312('0x85')](_0x549916[_0x1312('0xd6')])){return this[_0x1312('0x38')][_0x1312('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x3ed428=this[_0x1312('0xa1')][_0x1312('0x72')](this,_0x549916[_0x1312('0xd6')]);if(!_0x3ed428){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x549916,_0x1312('0xd7'));}this[_0x1312('0x38')]['setVariable'](util[_0x1312('0x28')](_0x1312('0x181'),_0x3ed428),_0x3ea01c[_0x1312('0x77')]?_0x3ea01c[_0x1312('0x77')]:_0x1312('0x182'));this[_0x1312('0x38')][_0x1312('0xa4')](util[_0x1312('0x28')]('%s_STATUS_MESSAGE',_0x3ed428),_0x3ea01c[_0x1312('0x183')]?_0x3ea01c['statusMessage']:'OK');if(_0x3ea01c[_0x1312('0x6c')]){try{this[_0x1312('0x9d')](_0x3ea01c[_0x1312('0x6c')],_0x3ed428);}catch(_0x35a1f5){logger[_0x1312('0x2c')](util[_0x1312('0x28')](_0x1312('0x184'),_0x3ed428));}}return this['channel'][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0xdc'),_0x3ed428));};AGIVertices[_0x1312('0x11')][_0x1312('0x185')]=function(_0x52ac47){logger['info'](util['format']('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x52ac47[_0x1312('0x3a')]));return this[_0x1312('0x38')][_0x1312('0x186')](_0x52ac47['digits'][_0x1312('0x59')](/\s+/g,''),_0x52ac47[_0x1312('0x17c')]);};AGIVertices[_0x1312('0x11')][_0x1312('0x187')]=function(_0x13d322){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x188'),_0x13d322[_0x1312('0x3a')]));return this[_0x1312('0x38')]['sayNumber'](_0x13d322[_0x1312('0x68')][_0x1312('0x59')](/\s+/g,''),_0x13d322[_0x1312('0x17c')]);};AGIVertices['prototype'][_0x1312('0x189')]=function(_0x19bf88){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x18a'),_0x19bf88['label']));return this[_0x1312('0x38')][_0x1312('0x18b')](_0x19bf88[_0x1312('0x5c')],_0x19bf88[_0x1312('0x17c')]);};AGIVertices[_0x1312('0x11')][_0x1312('0x18c')]=function(_0x2302c5){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x18d'),_0x2302c5[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x2302c5[_0x1312('0x18e')])){return this[_0x1312('0x38')][_0x1312('0xaa')]('no\x20mail\x20account\x20configured');}var _0x1e51ce=this[_0x1312('0x18f')][_0x1312('0x72')](this,_0x2302c5['account_id']);if(!_0x1e51ce||!_0x1e51ce['Smtp']){return this[_0x1312('0x38')]['error'](_0x2302c5,_0x1312('0x190'));}var _0x21df33={'from':util['format']('\x22%s\x22\x20<%s>',_0x1e51ce[_0x1312('0x14')],_0x1e51ce[_0x1312('0x191')]||_0x1e51ce['Smtp'][_0x1312('0x192')]),'to':_0x2302c5['to']||'','cc':_0x2302c5['cc']||'','bcc':_0x2302c5[_0x1312('0x193')]||'','subject':_0x2302c5[_0x1312('0x194')],'html':_0x2302c5['text'],'text':_0x2302c5[_0x1312('0x5c')]};var _0x2b2720={'tls':{'rejectUnauthorized':![]}};if(_0x1e51ce[_0x1312('0x195')]['service']){_0x2b2720[_0x1312('0x196')]=_0x1e51ce[_0x1312('0x195')][_0x1312('0x196')];}else{_0x2b2720[_0x1312('0x197')]=_0x1e51ce[_0x1312('0x195')][_0x1312('0x197')];_0x2b2720[_0x1312('0x198')]=_0x1e51ce[_0x1312('0x195')]['port'];_0x2b2720[_0x1312('0x199')]=_0x1e51ce[_0x1312('0x195')]['secure'];}if(_0x1e51ce[_0x1312('0x195')]['authentication']){_0x2b2720[_0x1312('0x19a')]={'user':_0x1e51ce[_0x1312('0x195')][_0x1312('0x192')],'pass':_0x1e51ce[_0x1312('0x195')][_0x1312('0x19b')]};}if(this[_0x1312('0x85')](_0x2302c5['template_id'])){}logger[_0x1312('0xde')](_0x1312('0x19c'),JSON[_0x1312('0x75')](_0x21df33));this['createSquareDetailsReport']['sync'](this,_0x2302c5,_0x2302c5[_0x1312('0x18e')]);this[_0x1312('0x38')]['noop'](util[_0x1312('0x28')](_0x1312('0x19d'),_0x1e51ce[_0x1312('0x14')]));this['sendMailMessage'][_0x1312('0x72')](this,_0x2b2720,_0x21df33);return this['channel'][_0x1312('0xaa')](_0x1312('0x19e'));};AGIVertices[_0x1312('0x11')][_0x1312('0x19f')]=function(_0x341067){logger[_0x1312('0x2e')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x341067['label']));return this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0x1a0'));};AGIVertices[_0x1312('0x11')][_0x1312('0x1a1')]=function(_0x1a050e){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x1a2'),_0x1a050e[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x1a050e[_0x1312('0x1a3')])){return this[_0x1312('0x38')]['noop'](_0x1312('0x1a4'));}var _0x22014d=this[_0x1312('0x34')][_0x1312('0x72')](this,_0x1a050e['sms_account_id']);if(!_0x22014d){return this[_0x1312('0x38')]['error'](_0x1a050e,_0x1312('0x1a5'));}var _0x377da4={'body':_0x1a050e[_0x1312('0x1a6')],'phone':_0x1a050e['to']||'','SmsAccountId':_0x22014d['id']};logger[_0x1312('0xde')](_0x1312('0x1a7'),JSON['stringify'](_0x377da4));this['createSquareDetailsReport']['sync'](this,_0x1a050e,_0x1a050e[_0x1312('0x1a3')]);this[_0x1312('0x38')]['noop'](util[_0x1312('0x28')](_0x1312('0x1a8'),_0x22014d[_0x1312('0x14')]));this['createSmsMessage'][_0x1312('0x72')](this,_0x377da4);return this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0x1a9'));};AGIVertices['prototype'][_0x1312('0x1aa')]=function(_0x14a112){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x1ab'),_0x14a112[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x14a112[_0x1312('0xd6')])){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x14a112,_0x1312('0x1ac'));}var _0x246bf7=this[_0x1312('0xa1')]['sync'](this,_0x14a112[_0x1312('0xd6')]);if(!_0x246bf7){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x14a112,_0x1312('0xd7'));}return this['channel'][_0x1312('0xa4')](_0x246bf7,_0x14a112[_0x1312('0x1ad')]);};AGIVertices[_0x1312('0x11')][_0x1312('0x1ae')]=function(_0xfd53e6){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x1af'),_0xfd53e6[_0x1312('0x3a')]));this[_0x1312('0x38')][_0x1312('0xaa')]('START\x20CALLY\x20SQUARE');if(_0xfd53e6[_0x1312('0xb8')]==='yes'){this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0x1b0'));return this[_0x1312('0x38')][_0x1312('0xb8')]();}return this['channel'][_0x1312('0xaa')](_0x1312('0x1b1'));};AGIVertices[_0x1312('0x11')][_0x1312('0x1b2')]=function(_0x1e1dee){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x1b3'),_0x1e1dee['label']));if(!this[_0x1312('0x85')](_0x1e1dee['project_id'])){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x1e1dee,_0x1312('0x1b4'));}var _0x1f54a3=this[_0x1312('0x18')][_0x1312('0x72')](this,_0x1e1dee['project_id']);if(!this[_0x1312('0x85')](_0x1f54a3)){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x1e1dee,util['format'](_0x1312('0x1b5'),_0x1e1dee['project_id']));}if(_0x1f54a3===this[_0x1312('0x38')]['arg_1']){return this[_0x1312('0x38')]['error'](_0x1e1dee,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport'][_0x1312('0x72')](this,_0x1e1dee,_0x1f54a3);var _0x217b72=this[_0x1312('0x38')]['exec'](_0x1312('0x1b6'),util[_0x1312('0x28')](_0x1312('0x1b7'),config['agi'][_0x1312('0x197')]||_0x1312('0x1b8'),_0x1f54a3,this[_0x1312('0x38')][_0x1312('0x43')]));if(_0x217b72[_0x1312('0xa9')]===-0x1){return _0x217b72;}return this['channel']['noop'](util[_0x1312('0x28')](_0x1312('0x175'),'AGI',_0x1f54a3));};AGIVertices[_0x1312('0x11')][_0x1312('0x1b9')]=function(_0x247217){logger['info'](util['format'](_0x1312('0x1ba'),_0x247217['label']));var _0x17e185=this[_0x1312('0x1bb')][_0x1312('0x72')](this,_0x247217['command']);this[_0x1312('0x37')]['sync'](this,_0x247217,_0x247217['command']);if(this['isConfigured'](_0x247217['variable_id'])){var _0xe79381=this[_0x1312('0xa1')]['sync'](this,_0x247217[_0x1312('0xd6')]);if(_0xe79381){this[_0x1312('0x38')][_0x1312('0xa4')](_0xe79381,_0x17e185);return this['channel'][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x1bc'),_0x247217[_0x1312('0xb7')],_0xe79381));}}return this[_0x1312('0x38')]['noop'](util[_0x1312('0x28')](_0x1312('0x1bd'),_0x247217[_0x1312('0xb7')]));};AGIVertices[_0x1312('0x11')][_0x1312('0x1be')]=function(_0x5e8134){logger[_0x1312('0x2e')](util[_0x1312('0x28')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x5e8134[_0x1312('0x3a')]));_0x5e8134[_0x1312('0x5c')]=_0x5e8134[_0x1312('0x5c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x1312('0x85')](_0x5e8134['apiKey'])){return this[_0x1312('0x38')][_0x1312('0xaa')](_0x1312('0x1bf'));}if(!this[_0x1312('0x85')](_0x5e8134[_0x1312('0x5c')])){return this['channel'][_0x1312('0xaa')]('no\x20text\x20configured');}this[_0x1312('0x38')]['noop'](util[_0x1312('0x28')](_0x1312('0x1c0'),_0x5e8134[_0x1312('0x5c')]));var _0x265279=this[_0x1312('0x5a')][_0x1312('0x72')](this,_0x5e8134);if(_0x265279){this[_0x1312('0x38')]['noop'](util[_0x1312('0x28')](_0x1312('0x1c1'),_0x265279));var _0x418c75=this[_0x1312('0x38')][_0x1312('0x101')](_0x265279);try{fs[_0x1312('0x102')](_0x265279+_0x1312('0x124'));}catch(_0x44848f){logger[_0x1312('0x2c')](_0x44848f);}return _0x418c75;}return this[_0x1312('0x38')]['error'](_0x5e8134,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x1312('0x1c2')]=function(_0xce14d1){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x1c3'),_0xce14d1[_0x1312('0x3a')]));_0xce14d1[_0x1312('0x5c')]=_0xce14d1[_0x1312('0x5c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x1312('0x85')](_0xce14d1['text'])){return this['channel']['noop'](_0x1312('0xa7'));}this['channel']['noop'](util[_0x1312('0x28')](_0x1312('0x1c4'),_0xce14d1[_0x1312('0x5c')]));var _0x2d51d7=this[_0x1312('0x62')][_0x1312('0x72')](this,_0xce14d1);if(_0x2d51d7){this['channel'][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x1c5'),_0x2d51d7));var _0x139d38=this['channel'][_0x1312('0x101')](_0x2d51d7);try{fs[_0x1312('0x102')](_0x2d51d7+_0x1312('0x124'));}catch(_0x253f4f){logger['error'](_0x253f4f);}return _0x139d38;}return this[_0x1312('0x38')][_0x1312('0x2c')](_0xce14d1,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x1312('0x11')][_0x1312('0x1c6')]=function(_0x53e7b2){logger['info'](util[_0x1312('0x28')](_0x1312('0x1c7'),_0x53e7b2[_0x1312('0x3a')]));if(!this[_0x1312('0x85')](_0x53e7b2[_0x1312('0x152')])){return this[_0x1312('0x38')][_0x1312('0x2c')](_0x53e7b2,'no\x20find\x20by\x20configured');}logger[_0x1312('0x2e')](util['format'](_0x1312('0x153'),this['channel'][_0x1312('0x3d')],_0x53e7b2[_0x1312('0x152')]));var _0x24b150=this['agentUnpause'][_0x1312('0x72')](this,_0x53e7b2[_0x1312('0x152')]);if(_0x24b150){logger[_0x1312('0x2e')](util[_0x1312('0x28')](_0x1312('0x155'),this[_0x1312('0x38')][_0x1312('0x3d')],_0x53e7b2[_0x1312('0x152')]));this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x155'),this[_0x1312('0x38')][_0x1312('0x3d')],_0x53e7b2[_0x1312('0x152')]));return{'code':0xc8,'result':_0x1312('0x156')};}else{logger[_0x1312('0x2e')](util['format'](_0x1312('0x157'),this['channel'][_0x1312('0x3d')],_0x53e7b2[_0x1312('0x152')]));this[_0x1312('0x38')][_0x1312('0xaa')](util[_0x1312('0x28')](_0x1312('0x157'),this[_0x1312('0x38')][_0x1312('0x3d')],_0x53e7b2['findBy']));return{'code':0xc8,'result':_0x1312('0x15b')};}};AGIVertices[_0x1312('0x11')]['voicemail']=function(_0x2cc070){logger[_0x1312('0x2e')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x2cc070['label']));var _0x301b77=this[_0x1312('0x38')][_0x1312('0x57')](_0x1312('0x1c8'),[_0x2cc070['mailbox'],_0x2cc070[_0x1312('0x7a')]]);if(_0x301b77[_0x1312('0xa9')]===-0x1){return _0x301b77;}return this['channel'][_0x1312('0xaa')](util['format'](_0x1312('0x175'),_0x1312('0x1c8'),_0x2cc070[_0x1312('0x1c9')]));};AGIVertices[_0x1312('0x11')][_0x1312('0x1ca')]=function(_0xf5a1a7){logger['info'](util[_0x1312('0x28')](_0x1312('0x1cb'),_0xf5a1a7[_0x1312('0x3a')]));if(!this['isConfigured'](_0xf5a1a7['variable_id'])){return this[_0x1312('0x38')]['error'](_0xf5a1a7,_0x1312('0x1ac'));}var _0x20fed2=this[_0x1312('0xa1')][_0x1312('0x72')](this,_0xf5a1a7[_0x1312('0xd6')]);if(!_0x20fed2){return this[_0x1312('0x38')][_0x1312('0x2c')](_0xf5a1a7,'no\x20variable\x20found');}var _0x107ece=this[_0x1312('0x38')][_0x1312('0xa1')](_0x20fed2);return{'code':0xc8,'result':_0x107ece[_0x1312('0xa2')]?_0x107ece['extra']:'-'};};String[_0x1312('0x11')]['replaceAll']=function(_0x39dc34,_0x3968a){return this[_0x1312('0x9f')](_0x39dc34)[_0x1312('0x1cc')](_0x3968a);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 68f7230..e667823 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 _0x3f5d=['channels','agentconnect','bind','hanguprequest','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','message','queue','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers'];(function(_0x3cda97,_0x282b0b){var _0x5c8e93=function(_0x390845){while(--_0x390845){_0x3cda97['push'](_0x3cda97['shift']());}};_0x5c8e93(++_0x282b0b);}(_0x3f5d,0xa8));var _0xd3f5=function(_0x22b65f,_0x25d363){_0x22b65f=_0x22b65f-0x0;var _0x2e3460=_0x3f5d[_0x22b65f];return _0x2e3460;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xd3f5('0x0'));var ami=require(_0xd3f5('0x1'));var logger=require('../../../config/logger')(_0xd3f5('0x2'));var RpcUser=require(_0xd3f5('0x3'));var RpcVoiceAgentReport=require(_0xd3f5('0x4'));function Acw(_0x4d62be){this[_0xd3f5('0x5')]=_0x4d62be[_0xd3f5('0x5')];this['agents']=_0x4d62be[_0xd3f5('0x6')];this[_0xd3f5('0x7')]=_0x4d62be[_0xd3f5('0x7')];this[_0xd3f5('0x8')]={};ami['on'](_0xd3f5('0x9'),this['syncAgentConnect'][_0xd3f5('0xa')](this));ami['on'](_0xd3f5('0xb'),this['syncHangupRequest'][_0xd3f5('0xa')](this));ami['on']('hangup',this['syncHangup'][_0xd3f5('0xa')](this));ami['on'](_0xd3f5('0xc'),this[_0xd3f5('0xd')][_0xd3f5('0xa')](this));ami['on'](_0xd3f5('0xe'),this[_0xd3f5('0xf')][_0xd3f5('0xa')](this));ami['on'](_0xd3f5('0x10'),this[_0xd3f5('0x11')][_0xd3f5('0xa')](this));ami['on'](_0xd3f5('0x12'),this[_0xd3f5('0x13')][_0xd3f5('0xa')](this));}function getDiff(_0x5284e9){var _0x11e9ad=moment()[_0xd3f5('0x14')](0x0);var _0x354685=moment(_0x5284e9)[_0xd3f5('0x14')](0x0);return _0x11e9ad[_0xd3f5('0x15')](_0x354685,_0xd3f5('0x16'));}Acw[_0xd3f5('0x17')]['startAcw']=function(_0x5bdbcc){try{var _0x26b165=this;var _0x31e32d=this[_0xd3f5('0x8')][_0x5bdbcc][_0xd3f5('0x18')];var _0x401115=this[_0xd3f5('0x8')][_0x5bdbcc]['queue'];var _0x5457f2=this[_0xd3f5('0x5')][_0x401115];var _0x5c9f1c=![];var _0x206ea3=_0xd3f5('0x19');if(_0x5457f2[_0xd3f5('0x1a')]){if(_0x5457f2[_0xd3f5('0x1b')][_0xd3f5('0x1c')]){_0x5c9f1c=!![];_0x206ea3=_0x5457f2[_0xd3f5('0x1b')][_0xd3f5('0x1c')];}}ami[_0xd3f5('0x1d')]({'action':'QueuePause','interface':_0x31e32d,'paused':!![],'reason':_0x206ea3})[_0xd3f5('0x1e')](function(_0x4a720e){if(_0x26b165['agents'][_0x31e32d]){return RpcUser[_0xd3f5('0x1f')](_0x26b165[_0xd3f5('0x6')][_0x31e32d]['id'])[_0xd3f5('0x1e')](function(_0x48f4a5){if(_0x48f4a5&&!_0x48f4a5[_0xd3f5('0x20')]){logger[_0xd3f5('0x21')](_0xd3f5('0x22'),_0x5bdbcc,_0x31e32d,_0x401115);var _0x7fd51f=_0x26b165[_0xd3f5('0x8')][_0x5bdbcc][_0xd3f5('0x23')]&&_0x26b165[_0xd3f5('0x8')][_0x5bdbcc][_0xd3f5('0x24')]?_0x26b165[_0xd3f5('0x8')][_0x5bdbcc]['destlinkedid']:_0x5bdbcc;return RpcUser[_0xd3f5('0x25')](_0x26b165['agents'][_0x31e32d],_0x206ea3,_0x7fd51f)['then'](function(_0x5a1a42){if(!_0x5c9f1c){_0x26b165[_0xd3f5('0x7')][_0x31e32d]={};logger[_0xd3f5('0x21')](_0xd3f5('0x26'),_0x5bdbcc,_0x26b165[_0xd3f5('0x5')][_0x401115][_0xd3f5('0x27')],_0x31e32d,_0x401115);_0x26b165[_0xd3f5('0x7')][_0x31e32d][_0xd3f5('0x28')]=setTimeout(_0x26b165[_0xd3f5('0x29')]['bind'](_0x26b165,_0x31e32d),_0x26b165[_0xd3f5('0x5')][_0x401115]['acwTimeout']*0x3e8);_0x26b165['timers'][_0x31e32d]['lastPauseAt']=moment()['format'](_0xd3f5('0x2a'));_0x26b165[_0xd3f5('0x7')][_0x31e32d][_0xd3f5('0x2b')]=_0x5bdbcc;_0x26b165[_0xd3f5('0x7')][_0x31e32d]['queue']=_0x401115;_0x26b165[_0xd3f5('0x7')][_0x31e32d][_0xd3f5('0x2c')]=function(){var _0x5ee34d=getDiff(_0x26b165[_0xd3f5('0x7')][_0x31e32d][_0xd3f5('0x2d')]);clearTimeout(_0x26b165[_0xd3f5('0x7')][_0x31e32d][_0xd3f5('0x28')]);_0x26b165[_0xd3f5('0x7')][_0x31e32d][_0xd3f5('0x28')]=![];RpcVoiceAgentReport[_0xd3f5('0x2e')]({'acwtime':_0x5ee34d},_0x26b165['timers'][_0x31e32d][_0xd3f5('0x2b')],_0x31e32d)['then'](function(_0x236cb9){logger[_0xd3f5('0x21')](_0xd3f5('0x2f'),_0x5bdbcc,_0x5ee34d,_0x236cb9);})['catch'](function(_0x38044c){logger[_0xd3f5('0x30')](_0xd3f5('0x31'),_0x5bdbcc,_0x38044c);});delete _0x26b165[_0xd3f5('0x7')][_0x31e32d];};}});}else{logger[_0xd3f5('0x21')](_0xd3f5('0x32'),_0x5bdbcc,_0x31e32d,_0x401115);}});}})[_0xd3f5('0x33')](function(_0x1b4157){logger['error'](_0xd3f5('0x26'),_0x5bdbcc,_0x26b165['voiceQueues'][_0x401115]['acwTimeout'],_0x31e32d,_0x401115);})[_0xd3f5('0x34')](function(){delete _0x26b165[_0xd3f5('0x8')][_0x5bdbcc];});}catch(_0x5cc2b2){logger[_0xd3f5('0x30')]('[ACW][START]\x20%s',_0x5cc2b2[_0xd3f5('0x35')]);}};Acw[_0xd3f5('0x17')][_0xd3f5('0x29')]=function(_0x309109){try{var _0x47f275=this;if(_0x47f275['timers'][_0x309109]){_0x47f275[_0xd3f5('0x7')][_0x309109][_0xd3f5('0x28')]=![];var _0x341de4=_0x47f275[_0xd3f5('0x7')][_0x309109][_0xd3f5('0x2b')];var _0x3648a7=_0x47f275[_0xd3f5('0x7')][_0x309109][_0xd3f5('0x36')];var _0x34f16e=_0x47f275[_0xd3f5('0x5')][_0x3648a7][_0xd3f5('0x27')];logger[_0xd3f5('0x21')](_0xd3f5('0x37'),_0x341de4,_0x309109);RpcUser[_0xd3f5('0x38')](this['agents'][_0x309109]);RpcVoiceAgentReport[_0xd3f5('0x2e')]({'acwtime':_0x34f16e,'agentacw':!![]},_0x341de4,_0x309109)['then'](function(_0x378663){logger[_0xd3f5('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x341de4,_0x34f16e,_0x378663);})[_0xd3f5('0x33')](function(_0x5aaadb){logger['error'](_0xd3f5('0x31'),_0x341de4,_0x5aaadb);});}else{logger[_0xd3f5('0x30')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x309109);if(_0x47f275['timers']){logger[_0xd3f5('0x21')](_0xd3f5('0x39'),JSON[_0xd3f5('0x3a')](_0x47f275[_0xd3f5('0x7')]));}}}catch(_0x47b8ec){logger[_0xd3f5('0x30')](_0xd3f5('0x3b'),_0x47b8ec[_0xd3f5('0x35')]);}};Acw['prototype'][_0xd3f5('0x3c')]=function(_0x5d6531){try{if(this[_0xd3f5('0x5')][_0x5d6531[_0xd3f5('0x36')]]&&(this['voiceQueues'][_0x5d6531['queue']][_0xd3f5('0x2')]||this[_0xd3f5('0x5')][_0x5d6531[_0xd3f5('0x36')]]['mandatoryDisposition'])){if(this[_0xd3f5('0x6')][_0x5d6531['interface']]){this[_0xd3f5('0x8')][_0x5d6531['uniqueid']]={'queue':_0x5d6531['queue'],'interface':_0x5d6531['interface'],'destlinkedid':_0x5d6531['destlinkedid']};}}}catch(_0x306be8){logger[_0xd3f5('0x30')](_0xd3f5('0x3d'),_0x306be8[_0xd3f5('0x35')]);}};Acw[_0xd3f5('0x17')][_0xd3f5('0x13')]=function(_0x141d53){try{if(this[_0xd3f5('0x5')][_0x141d53[_0xd3f5('0x36')]]&&(this[_0xd3f5('0x5')][_0x141d53[_0xd3f5('0x36')]][_0xd3f5('0x2')]||this[_0xd3f5('0x5')][_0x141d53[_0xd3f5('0x36')]]['mandatoryDisposition'])){if(this[_0xd3f5('0x6')][_0x141d53[_0xd3f5('0x18')]]){this[_0xd3f5('0x8')][_0x141d53[_0xd3f5('0x2b')]]={'queue':_0x141d53[_0xd3f5('0x36')],'interface':_0x141d53[_0xd3f5('0x18')]};}}}catch(_0x2fb12d){logger[_0xd3f5('0x30')](_0xd3f5('0x3e'),_0x2fb12d[_0xd3f5('0x35')]);}};Acw[_0xd3f5('0x17')][_0xd3f5('0x3f')]=function(_0x172623){try{if(this[_0xd3f5('0x8')][_0x172623[_0xd3f5('0x2b')]]&&_[_0xd3f5('0x40')](this[_0xd3f5('0x8')][_0x172623['uniqueid']][_0xd3f5('0x23')])){logger[_0xd3f5('0x21')](_0xd3f5('0x41'),_0x172623['uniqueid']);this[_0xd3f5('0x42')](_0x172623['uniqueid']);}else if(this[_0xd3f5('0x8')][_0x172623[_0xd3f5('0x43')]]&&_[_0xd3f5('0x40')](this['channels'][_0x172623[_0xd3f5('0x43')]][_0xd3f5('0x23')])){logger[_0xd3f5('0x21')]('[%s][HANGUP:LINKEDID]',_0x172623[_0xd3f5('0x43')]);this['startAcw'](_0x172623[_0xd3f5('0x43')]);}}catch(_0x41e480){logger[_0xd3f5('0x30')](_0xd3f5('0x44'),_0x41e480['message']);}};Acw[_0xd3f5('0x17')][_0xd3f5('0x45')]=function(_0x4d7a43){try{if(this[_0xd3f5('0x8')][_0x4d7a43[_0xd3f5('0x2b')]]&&this[_0xd3f5('0x8')][_0x4d7a43['uniqueid']][_0xd3f5('0x23')]){logger[_0xd3f5('0x21')](_0xd3f5('0x46'),_0x4d7a43[_0xd3f5('0x2b')]);this[_0xd3f5('0x42')](_0x4d7a43[_0xd3f5('0x2b')]);}else if(this[_0xd3f5('0x8')][_0x4d7a43['linkedid']]&&this['channels'][_0x4d7a43['linkedid']][_0xd3f5('0x23')]){logger[_0xd3f5('0x21')](_0xd3f5('0x47'),_0x4d7a43['linkedid']);this[_0xd3f5('0x42')](_0x4d7a43[_0xd3f5('0x43')]);}}catch(_0x408aa7){logger['error']('[ACW][syncHangup]\x20%s',_0x408aa7[_0xd3f5('0x35')]);}};Acw[_0xd3f5('0x17')][_0xd3f5('0xf')]=function(_0x31e627){try{if(!_[_0xd3f5('0x48')](this['channels'][_0x31e627[_0xd3f5('0x49')]])){this[_0xd3f5('0x42')](_0x31e627[_0xd3f5('0x49')]);if(this['channels'][_0x31e627[_0xd3f5('0x4a')]]){this[_0xd3f5('0x8')][_0x31e627[_0xd3f5('0x4a')]][_0xd3f5('0x23')]=!![];this[_0xd3f5('0x8')][_0x31e627[_0xd3f5('0x4b')]]=this[_0xd3f5('0x8')][_0x31e627[_0xd3f5('0x4a')]];delete this['channels'][_0x31e627[_0xd3f5('0x4a')]];}}else if(!_['isNil'](this[_0xd3f5('0x8')][_0x31e627[_0xd3f5('0x4b')]])){this[_0xd3f5('0x42')](_0x31e627[_0xd3f5('0x4b')]);if(this[_0xd3f5('0x8')][_0x31e627[_0xd3f5('0x4c')]]){this['channels'][_0x31e627[_0xd3f5('0x4c')]]['attended']=!![];this[_0xd3f5('0x8')][_0x31e627['transfereeuniqueid']]=this[_0xd3f5('0x8')][_0x31e627[_0xd3f5('0x4c')]];delete this[_0xd3f5('0x8')][_0x31e627[_0xd3f5('0x4c')]];}}}catch(_0x4818d2){logger[_0xd3f5('0x30')](_0xd3f5('0x4d'),_0x4818d2[_0xd3f5('0x35')]);}};Acw[_0xd3f5('0x17')][_0xd3f5('0x11')]=function(_0x4e5b0c){try{if(this[_0xd3f5('0x8')][_0x4e5b0c['transfereruniqueid']]){logger[_0xd3f5('0x21')](_0xd3f5('0x4e'),JSON['stringify'](_0x4e5b0c['transfereruniqueid']));this[_0xd3f5('0x42')](_0x4e5b0c[_0xd3f5('0x4f')]);}else if(this['channels'][_0x4e5b0c[_0xd3f5('0x50')]]){logger[_0xd3f5('0x21')](_0xd3f5('0x51'),JSON['stringify'](_0x4e5b0c[_0xd3f5('0x50')]));this['startAcw'](_0x4e5b0c[_0xd3f5('0x50')]);}}catch(_0x24cdfe){logger[_0xd3f5('0x30')](_0xd3f5('0x52'),_0x24cdfe[_0xd3f5('0x35')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x21effa){try{if(this[_0xd3f5('0x5')][_0x21effa[_0xd3f5('0x36')]]&&this['voiceQueues'][_0x21effa['queue']][_0xd3f5('0x53')]===_0xd3f5('0x54')){if(this[_0xd3f5('0x6')][_0x21effa[_0xd3f5('0x18')]]){logger[_0xd3f5('0x21')](_0xd3f5('0x55'),_0x21effa[_0xd3f5('0x2b')],_0x21effa[_0xd3f5('0x18')],_0x21effa[_0xd3f5('0x36')]);return RpcUser[_0xd3f5('0x25')](this[_0xd3f5('0x6')][_0x21effa[_0xd3f5('0x18')]],'Auto-Pause',_0x21effa['uniqueid']);}}}catch(_0x632b95){logger[_0xd3f5('0x30')](_0xd3f5('0x56'),_0x632b95[_0xd3f5('0x35')]);}};module[_0xd3f5('0x57')]=Acw; \ No newline at end of file +var _0xd4c1=['[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','syncHangup','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','exports','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','syncHangupRequest','bind','hangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','interface'];(function(_0x5bcbeb,_0x4e2fe9){var _0x404f90=function(_0x54a450){while(--_0x54a450){_0x5bcbeb['push'](_0x5bcbeb['shift']());}};_0x404f90(++_0x4e2fe9);}(_0xd4c1,0x6f));var _0x1d4c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4c1[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0x1d4c('0x0'));var moment=require(_0x1d4c('0x1'));var ami=require(_0x1d4c('0x2'));var logger=require(_0x1d4c('0x3'))('acw');var RpcUser=require(_0x1d4c('0x4'));var RpcVoiceAgentReport=require(_0x1d4c('0x5'));function Acw(_0x34fd04){this['voiceQueues']=_0x34fd04[_0x1d4c('0x6')];this[_0x1d4c('0x7')]=_0x34fd04[_0x1d4c('0x7')];this[_0x1d4c('0x8')]=_0x34fd04[_0x1d4c('0x8')];this[_0x1d4c('0x9')]={};ami['on'](_0x1d4c('0xa'),this[_0x1d4c('0xb')]['bind'](this));ami['on']('hanguprequest',this[_0x1d4c('0xc')][_0x1d4c('0xd')](this));ami['on'](_0x1d4c('0xe'),this['syncHangup']['bind'](this));ami['on']('agentringnoanswer',this[_0x1d4c('0xf')]['bind'](this));ami['on'](_0x1d4c('0x10'),this[_0x1d4c('0x11')][_0x1d4c('0xd')](this));ami['on'](_0x1d4c('0x12'),this[_0x1d4c('0x13')]['bind'](this));ami['on'](_0x1d4c('0x14'),this[_0x1d4c('0x15')][_0x1d4c('0xd')](this));}function getDiff(_0xf7d11c){var _0x7cf9ed=moment()[_0x1d4c('0x16')](0x0);var _0x57b973=moment(_0xf7d11c)['milliseconds'](0x0);return _0x7cf9ed[_0x1d4c('0x17')](_0x57b973,_0x1d4c('0x18'));}Acw[_0x1d4c('0x19')][_0x1d4c('0x1a')]=function(_0x489522){try{var _0x310be1=this;var _0x2998ee=this[_0x1d4c('0x9')][_0x489522]['interface'];var _0x65ed09=this[_0x1d4c('0x9')][_0x489522]['queue'];var _0x3025d6=this[_0x1d4c('0x6')][_0x65ed09];var _0x231de5=![];var _0x3cbac2=_0x1d4c('0x1b');if(_0x3025d6[_0x1d4c('0x1c')]){if(_0x3025d6[_0x1d4c('0x1d')][_0x1d4c('0x1e')]){_0x231de5=!![];_0x3cbac2=_0x3025d6[_0x1d4c('0x1d')]['name'];}}ami[_0x1d4c('0x1f')]({'action':'QueuePause','interface':_0x2998ee,'paused':!![],'reason':_0x3cbac2})['then'](function(_0x6b1eac){if(_0x310be1[_0x1d4c('0x7')][_0x2998ee]){return RpcUser['getAgent'](_0x310be1['agents'][_0x2998ee]['id'])[_0x1d4c('0x20')](function(_0x875d6f){if(_0x875d6f&&!_0x875d6f[_0x1d4c('0x21')]){logger[_0x1d4c('0x22')](_0x1d4c('0x23'),_0x489522,_0x2998ee,_0x65ed09);var _0x4e055a=_0x310be1['channels'][_0x489522][_0x1d4c('0x24')]&&_0x310be1[_0x1d4c('0x9')][_0x489522][_0x1d4c('0x25')]?_0x310be1[_0x1d4c('0x9')][_0x489522][_0x1d4c('0x25')]:_0x489522;return RpcUser[_0x1d4c('0x26')](_0x310be1['agents'][_0x2998ee],_0x3cbac2,_0x4e055a)[_0x1d4c('0x20')](function(_0x4c4882){if(!_0x231de5){_0x310be1[_0x1d4c('0x8')][_0x2998ee]={};logger[_0x1d4c('0x22')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x489522,_0x310be1[_0x1d4c('0x6')][_0x65ed09][_0x1d4c('0x27')],_0x2998ee,_0x65ed09);_0x310be1['timers'][_0x2998ee][_0x1d4c('0x28')]=setTimeout(_0x310be1[_0x1d4c('0x29')][_0x1d4c('0xd')](_0x310be1,_0x2998ee),_0x310be1[_0x1d4c('0x6')][_0x65ed09][_0x1d4c('0x27')]*0x3e8);_0x310be1['timers'][_0x2998ee][_0x1d4c('0x2a')]=moment()[_0x1d4c('0x2b')](_0x1d4c('0x2c'));_0x310be1[_0x1d4c('0x8')][_0x2998ee][_0x1d4c('0x2d')]=_0x489522;_0x310be1['timers'][_0x2998ee][_0x1d4c('0x2e')]=_0x65ed09;_0x310be1['timers'][_0x2998ee][_0x1d4c('0x2f')]=function(){var _0xc6464d=getDiff(_0x310be1['timers'][_0x2998ee][_0x1d4c('0x2a')]);clearTimeout(_0x310be1[_0x1d4c('0x8')][_0x2998ee]['timer']);_0x310be1[_0x1d4c('0x8')][_0x2998ee][_0x1d4c('0x28')]=![];RpcVoiceAgentReport[_0x1d4c('0x30')]({'acwtime':_0xc6464d},_0x310be1[_0x1d4c('0x8')][_0x2998ee]['uniqueid'],_0x2998ee)[_0x1d4c('0x20')](function(_0x2e4ee6){logger[_0x1d4c('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x489522,_0xc6464d,_0x2e4ee6);})[_0x1d4c('0x31')](function(_0x3946f6){logger[_0x1d4c('0x32')](_0x1d4c('0x33'),_0x489522,_0x3946f6);});delete _0x310be1[_0x1d4c('0x8')][_0x2998ee];};}});}else{logger[_0x1d4c('0x22')](_0x1d4c('0x34'),_0x489522,_0x2998ee,_0x65ed09);}});}})[_0x1d4c('0x31')](function(_0x1b0fdb){logger['error'](_0x1d4c('0x35'),_0x489522,_0x310be1[_0x1d4c('0x6')][_0x65ed09][_0x1d4c('0x27')],_0x2998ee,_0x65ed09);})[_0x1d4c('0x36')](function(){delete _0x310be1[_0x1d4c('0x9')][_0x489522];});}catch(_0x3e3c68){logger['error'](_0x1d4c('0x37'),_0x3e3c68[_0x1d4c('0x38')]);}};Acw[_0x1d4c('0x19')][_0x1d4c('0x29')]=function(_0x1d7577){try{var _0x57a251=this;if(_0x57a251[_0x1d4c('0x8')][_0x1d7577]){_0x57a251[_0x1d4c('0x8')][_0x1d7577][_0x1d4c('0x28')]=![];var _0x4cc41c=_0x57a251[_0x1d4c('0x8')][_0x1d7577][_0x1d4c('0x2d')];var _0x20f0b5=_0x57a251['timers'][_0x1d7577][_0x1d4c('0x2e')];var _0x245f57=_0x57a251[_0x1d4c('0x6')][_0x20f0b5][_0x1d4c('0x27')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x4cc41c,_0x1d7577);RpcUser[_0x1d4c('0x39')](this[_0x1d4c('0x7')][_0x1d7577]);RpcVoiceAgentReport[_0x1d4c('0x30')]({'acwtime':_0x245f57,'agentacw':!![]},_0x4cc41c,_0x1d7577)[_0x1d4c('0x20')](function(_0x5071ed){logger[_0x1d4c('0x22')](_0x1d4c('0x3a'),_0x4cc41c,_0x245f57,_0x5071ed);})['catch'](function(_0x19dab4){logger[_0x1d4c('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x4cc41c,_0x19dab4);});}else{logger[_0x1d4c('0x32')](_0x1d4c('0x3b'),_0x1d7577);if(_0x57a251[_0x1d4c('0x8')]){logger[_0x1d4c('0x22')](_0x1d4c('0x3c'),JSON[_0x1d4c('0x3d')](_0x57a251['timers']));}}}catch(_0xcb4e92){logger[_0x1d4c('0x32')](_0x1d4c('0x3e'),_0xcb4e92[_0x1d4c('0x38')]);}};Acw['prototype'][_0x1d4c('0xb')]=function(_0x9104ff){try{if(this[_0x1d4c('0x6')][_0x9104ff[_0x1d4c('0x2e')]]&&(this[_0x1d4c('0x6')][_0x9104ff[_0x1d4c('0x2e')]][_0x1d4c('0x3f')]||this['voiceQueues'][_0x9104ff[_0x1d4c('0x2e')]][_0x1d4c('0x1c')])){if(this[_0x1d4c('0x7')][_0x9104ff[_0x1d4c('0x40')]]){this[_0x1d4c('0x9')][_0x9104ff['uniqueid']]={'queue':_0x9104ff[_0x1d4c('0x2e')],'interface':_0x9104ff[_0x1d4c('0x40')],'destlinkedid':_0x9104ff[_0x1d4c('0x25')]};}}}catch(_0x37f78b){logger[_0x1d4c('0x32')](_0x1d4c('0x41'),_0x37f78b[_0x1d4c('0x38')]);}};Acw[_0x1d4c('0x19')][_0x1d4c('0x15')]=function(_0x124f7f){try{if(this[_0x1d4c('0x6')][_0x124f7f[_0x1d4c('0x2e')]]&&(this['voiceQueues'][_0x124f7f['queue']][_0x1d4c('0x3f')]||this[_0x1d4c('0x6')][_0x124f7f[_0x1d4c('0x2e')]][_0x1d4c('0x1c')])){if(this[_0x1d4c('0x7')][_0x124f7f[_0x1d4c('0x40')]]){this[_0x1d4c('0x9')][_0x124f7f[_0x1d4c('0x2d')]]={'queue':_0x124f7f[_0x1d4c('0x2e')],'interface':_0x124f7f['interface']};}}}catch(_0x5514cc){logger[_0x1d4c('0x32')](_0x1d4c('0x42'),_0x5514cc[_0x1d4c('0x38')]);}};Acw[_0x1d4c('0x19')]['syncHangupRequest']=function(_0x133790){try{if(this[_0x1d4c('0x9')][_0x133790[_0x1d4c('0x2d')]]&&_[_0x1d4c('0x43')](this['channels'][_0x133790['uniqueid']]['attended'])){logger[_0x1d4c('0x22')](_0x1d4c('0x44'),_0x133790['uniqueid']);this[_0x1d4c('0x1a')](_0x133790[_0x1d4c('0x2d')]);}else if(this['channels'][_0x133790[_0x1d4c('0x45')]]&&_[_0x1d4c('0x43')](this[_0x1d4c('0x9')][_0x133790[_0x1d4c('0x45')]][_0x1d4c('0x24')])){logger[_0x1d4c('0x22')]('[%s][HANGUP:LINKEDID]',_0x133790['linkedid']);this[_0x1d4c('0x1a')](_0x133790[_0x1d4c('0x45')]);}}catch(_0x372d9b){logger[_0x1d4c('0x32')]('[ACW][syncHangupRequest]\x20%s',_0x372d9b['message']);}};Acw[_0x1d4c('0x19')][_0x1d4c('0x46')]=function(_0x1a2d0e){try{if(this['channels'][_0x1a2d0e['uniqueid']]&&this[_0x1d4c('0x9')][_0x1a2d0e[_0x1d4c('0x2d')]]['attended']){logger[_0x1d4c('0x22')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x1a2d0e[_0x1d4c('0x2d')]);this[_0x1d4c('0x1a')](_0x1a2d0e['uniqueid']);}else if(this[_0x1d4c('0x9')][_0x1a2d0e[_0x1d4c('0x45')]]&&this[_0x1d4c('0x9')][_0x1a2d0e['linkedid']][_0x1d4c('0x24')]){logger[_0x1d4c('0x22')](_0x1d4c('0x47'),_0x1a2d0e[_0x1d4c('0x45')]);this['startAcw'](_0x1a2d0e[_0x1d4c('0x45')]);}}catch(_0x37cfba){logger[_0x1d4c('0x32')](_0x1d4c('0x48'),_0x37cfba[_0x1d4c('0x38')]);}};Acw[_0x1d4c('0x19')]['syncAttendedTransfer']=function(_0x4ae11b){try{if(!_[_0x1d4c('0x49')](this['channels'][_0x4ae11b['transfereeuniqueid']])){this[_0x1d4c('0x1a')](_0x4ae11b[_0x1d4c('0x4a')]);if(this[_0x1d4c('0x9')][_0x4ae11b[_0x1d4c('0x4b')]]){this[_0x1d4c('0x9')][_0x4ae11b[_0x1d4c('0x4b')]][_0x1d4c('0x24')]=!![];this[_0x1d4c('0x9')][_0x4ae11b[_0x1d4c('0x4c')]]=this[_0x1d4c('0x9')][_0x4ae11b[_0x1d4c('0x4b')]];delete this[_0x1d4c('0x9')][_0x4ae11b['secondtransfereruniqueid']];}}else if(!_[_0x1d4c('0x49')](this[_0x1d4c('0x9')][_0x4ae11b[_0x1d4c('0x4c')]])){this['startAcw'](_0x4ae11b[_0x1d4c('0x4c')]);if(this[_0x1d4c('0x9')][_0x4ae11b['origtransfereruniqueid']]){this[_0x1d4c('0x9')][_0x4ae11b[_0x1d4c('0x4d')]]['attended']=!![];this[_0x1d4c('0x9')][_0x4ae11b[_0x1d4c('0x4a')]]=this[_0x1d4c('0x9')][_0x4ae11b['origtransfereruniqueid']];delete this[_0x1d4c('0x9')][_0x4ae11b[_0x1d4c('0x4d')]];}}}catch(_0x54ba6d){logger[_0x1d4c('0x32')](_0x1d4c('0x4e'),_0x54ba6d[_0x1d4c('0x38')]);}};Acw[_0x1d4c('0x19')][_0x1d4c('0x13')]=function(_0x411503){try{if(this['channels'][_0x411503[_0x1d4c('0x4f')]]){logger[_0x1d4c('0x22')](_0x1d4c('0x50'),JSON['stringify'](_0x411503['transfereruniqueid']));this['startAcw'](_0x411503[_0x1d4c('0x4f')]);}else if(this[_0x1d4c('0x9')][_0x411503[_0x1d4c('0x51')]]){logger[_0x1d4c('0x22')](_0x1d4c('0x52'),JSON[_0x1d4c('0x3d')](_0x411503[_0x1d4c('0x51')]));this['startAcw'](_0x411503[_0x1d4c('0x51')]);}}catch(_0x15b25c){logger['error'](_0x1d4c('0x53'),_0x15b25c['message']);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x290bc2){try{if(this[_0x1d4c('0x6')][_0x290bc2[_0x1d4c('0x2e')]]&&this[_0x1d4c('0x6')][_0x290bc2[_0x1d4c('0x2e')]][_0x1d4c('0x54')]===_0x1d4c('0x55')){if(this['agents'][_0x290bc2['interface']]){logger[_0x1d4c('0x22')](_0x1d4c('0x56'),_0x290bc2[_0x1d4c('0x2d')],_0x290bc2[_0x1d4c('0x40')],_0x290bc2[_0x1d4c('0x2e')]);return RpcUser['savePause'](this[_0x1d4c('0x7')][_0x290bc2['interface']],'Auto-Pause',_0x290bc2[_0x1d4c('0x2d')]);}}}catch(_0x9cbb90){logger[_0x1d4c('0x32')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x9cbb90['message']);}};module[_0x1d4c('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 37b2713..840a364 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['username','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','moment','lodash','ami','asterisk','port','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x108773,_0x1bab9b){var _0x595490=function(_0x519d07){while(--_0x519d07){_0x108773['push'](_0x108773['shift']());}};_0x595490(++_0x1bab9b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xb7e7[_0x4e6ae6];return _0x23c108;};'use strict';var Manager=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var moment=require(_0x7b7e('0x1'));var util=require('util');var _=require(_0x7b7e('0x2'));var logger=require('../../config/logger')(_0x7b7e('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x7b7e('0x4')][_0x7b7e('0x5')],config[_0x7b7e('0x4')]['ip'],config['asterisk']['username'],config[_0x7b7e('0x4')][_0x7b7e('0x6')],!![]);ami[_0x7b7e('0x7')]();ami['Action']=BPromise[_0x7b7e('0x8')](ami[_0x7b7e('0x9')]);function error(_0x2917f9){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xc'),config[_0x7b7e('0x4')]['username'],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x2917f9,![],null)));}function close(){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xe'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x11')});};};ami[_0x7b7e('0x12')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x7b7e('0x14')});};};ami[_0x7b7e('0x15')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x16')});};};function connect(_0x2cc400){logger[_0x7b7e('0x17')](util[_0x7b7e('0xb')](_0x7b7e('0x18'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')](_0x7b7e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x7b7e('0x1b'),function(_0x43db4f){logger[_0x7b7e('0x17')](util['format'](_0x7b7e('0x1c'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x43db4f,![],null)));});ami['on'](_0x7b7e('0x1d'),function(_0x53bbb3){logger['info'](util['format'](_0x7b7e('0x1e'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x7b7e('0x1f')]()[_0x7b7e('0x20')](ami[_0x7b7e('0x21')]())[_0x7b7e('0x20')](ami[_0x7b7e('0x22')]())['then'](ami[_0x7b7e('0x12')]())[_0x7b7e('0x20')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7b7e('0x23')](function(_0x423832){logger['error'](_0x7b7e('0x24'),util['inspect'](_0x423832,{'showHidden':![],'depth':null}));});});ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')]('close',close);module[_0x7b7e('0x25')]=ami; \ No newline at end of file +var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x57ab2b,_0x1e3226){var _0x10c32d=function(_0x345df2){while(--_0x345df2){_0x57ab2b['push'](_0x57ab2b['shift']());}};_0x10c32d(++_0x1e3226);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 62083ec..030e112 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 _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x127074,_0x3bd855){var _0x4c9463=function(_0xf337a6){while(--_0xf337a6){_0x127074['push'](_0x127074['shift']());}};_0x4c9463(++_0x3bd855);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2c8814,_0x1521c2){_0x2c8814=_0x2c8814-0x0;var _0x5387e5=_0x9bde[_0x2c8814];return _0x5387e5;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client; \ No newline at end of file +var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0xf65bf8,_0x494a66){var _0x2e4a66=function(_0x50d0de){while(--_0x50d0de){_0xf65bf8['push'](_0xf65bf8['shift']());}};_0x2e4a66(++_0x494a66);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index d07c43a..4d04b11 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 _0x11ac=['isNil','voiceQueue','uniqueid','Contact','phone','firstName','lastName','number','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','exports','lodash','moment'];(function(_0x5ad303,_0x5265bd){var _0x1e755f=function(_0x2ae1b7){while(--_0x2ae1b7){_0x5ad303['push'](_0x5ad303['shift']());}};_0x1e755f(++_0x5265bd);}(_0x11ac,0x132));var _0xc11a=function(_0x23166d,_0x14815a){_0x23166d=_0x23166d-0x0;var _0x2189b2=_0x11ac[_0x23166d];return _0x2189b2;};'use strict';var util=require('util');var _=require(_0xc11a('0x0'));var moment=require(_0xc11a('0x1'));function checkNameSurname(_0x153a77,_0x1361b1,_0x271c5b){var _0x4d6b79='';if(!_[_0xc11a('0x2')](_0x1361b1)&&'string'===typeof _0x1361b1){_0x4d6b79+=_0x1361b1;}if(!_[_0xc11a('0x2')](_0x271c5b)&&'string'===typeof _0x271c5b){_0x4d6b79+='\x20'+_0x271c5b;}if(_0x4d6b79!==''){return _0x4d6b79;}return _0x153a77;}function Action(_0x400383,_0x14cd6d,_0xbcfab6){this[_0xc11a('0x3')]=_0x400383;this[_0xc11a('0x4')]=_0xbcfab6||undefined;this['name']=checkNameSurname(_0x14cd6d[_0xc11a('0x5')][_0xc11a('0x6')],_0x14cd6d['Contact'][_0xc11a('0x7')],_0x14cd6d[_0xc11a('0x5')][_0xc11a('0x8')]);this[_0xc11a('0x9')]=_0x14cd6d[_0xc11a('0x5')][_0xc11a('0x6')];this[_0xc11a('0xa')]=_0x400383[_0xc11a('0xb')];this[_0xc11a('0xc')]=_0x14cd6d['active']||![];this[_0xc11a('0xd')]=_0x400383[_0xc11a('0xd')];this[_0xc11a('0xe')]=_0x400383['dialQueueTimeout']||0x3;this['scheduledat']=_0x14cd6d[_0xc11a('0xf')];this[_0xc11a('0x10')]=_0x14cd6d[_0xc11a('0x10')];this['countcongestionretry']=_0x14cd6d[_0xc11a('0x11')];this['countnoanswerretry']=_0x14cd6d[_0xc11a('0x12')];this[_0xc11a('0x13')]=_0x14cd6d['countnosuchnumberretry'];this[_0xc11a('0x14')]=_0x14cd6d[_0xc11a('0x14')];this[_0xc11a('0x15')]=_0x14cd6d['countabandonedretry'];this['countmachineretry']=_0x14cd6d[_0xc11a('0x16')];this[_0xc11a('0x17')]=_0x14cd6d[_0xc11a('0x17')];this[_0xc11a('0x18')]=_0x14cd6d[_0xc11a('0x18')];this[_0xc11a('0x19')]=_0x14cd6d['ListId'];this[_0xc11a('0x1a')]=_0x14cd6d[_0xc11a('0x1a')];this[_0xc11a('0x1b')]=_0x14cd6d['VoiceQueueId'];this[_0xc11a('0x1c')]=_0x14cd6d['CampaignId'];this[_0xc11a('0x1d')]=_0x14cd6d['id'];this[_0xc11a('0x1e')]=_0x14cd6d['Contact'][_0xc11a('0x7')]||'';this[_0xc11a('0x1f')]=moment()[_0xc11a('0x20')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc11a('0x21')]=_0x14cd6d['callback'];this['callbackuniqueid']=_0x14cd6d[_0xc11a('0x22')];this[_0xc11a('0x23')]=_0x14cd6d[_0xc11a('0x23')];this['recallme']=_0x14cd6d['recallme'];this['originatecalleridnum']='';this[_0xc11a('0x24')]='';}Action[_0xc11a('0x25')][_0xc11a('0x26')]=function(){return util[_0xc11a('0x20')](_0xc11a('0x27'),this[_0xc11a('0xb')],this[_0xc11a('0x3')]['dialCutDigit']>0x0?this[_0xc11a('0x9')][_0xc11a('0x28')](this[_0xc11a('0x3')][_0xc11a('0x29')]):this[_0xc11a('0x9')]);};Action[_0xc11a('0x25')][_0xc11a('0x2a')]=function(){return this['queue'];};module[_0xc11a('0x2b')]=Action; \ No newline at end of file +var _0x13ef=['lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','voiceQueue','prototype','moment','isNil','string','uniqueid','name','Contact','phone','firstName'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x13ef,0x169));var _0xf13e=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x13ef[_0x25e7cb];return _0x375d92;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xf13e('0x0'));function checkNameSurname(_0x3dd78b,_0x49572b,_0x1770eb){var _0x169018='';if(!_[_0xf13e('0x1')](_0x49572b)&&_0xf13e('0x2')===typeof _0x49572b){_0x169018+=_0x49572b;}if(!_[_0xf13e('0x1')](_0x1770eb)&&_0xf13e('0x2')===typeof _0x1770eb){_0x169018+='\x20'+_0x1770eb;}if(_0x169018!==''){return _0x169018;}return _0x3dd78b;}function Action(_0x2cb8b2,_0x28ffcc,_0x4de941){this['voiceQueue']=_0x2cb8b2;this[_0xf13e('0x3')]=_0x4de941||undefined;this[_0xf13e('0x4')]=checkNameSurname(_0x28ffcc[_0xf13e('0x5')][_0xf13e('0x6')],_0x28ffcc[_0xf13e('0x5')][_0xf13e('0x7')],_0x28ffcc[_0xf13e('0x5')][_0xf13e('0x8')]);this['number']=_0x28ffcc[_0xf13e('0x5')]['phone'];this[_0xf13e('0x9')]=_0x2cb8b2[_0xf13e('0x4')];this[_0xf13e('0xa')]=_0x28ffcc[_0xf13e('0xa')]||![];this[_0xf13e('0xb')]=_0x2cb8b2['type'];this[_0xf13e('0xc')]=_0x2cb8b2[_0xf13e('0xc')]||0x3;this[_0xf13e('0xd')]=_0x28ffcc['scheduledat'];this['countbusyretry']=_0x28ffcc[_0xf13e('0xe')];this[_0xf13e('0xf')]=_0x28ffcc[_0xf13e('0xf')];this[_0xf13e('0x10')]=_0x28ffcc[_0xf13e('0x10')];this['countnosuchnumberretry']=_0x28ffcc[_0xf13e('0x11')];this[_0xf13e('0x12')]=_0x28ffcc[_0xf13e('0x12')];this[_0xf13e('0x13')]=_0x28ffcc[_0xf13e('0x13')];this[_0xf13e('0x14')]=_0x28ffcc[_0xf13e('0x14')];this['countagentrejectretry']=_0x28ffcc[_0xf13e('0x15')];this['ContactId']=_0x28ffcc[_0xf13e('0x16')];this[_0xf13e('0x17')]=_0x28ffcc[_0xf13e('0x17')];this[_0xf13e('0x18')]=_0x28ffcc[_0xf13e('0x18')];this[_0xf13e('0x19')]=_0x28ffcc['VoiceQueueId'];this[_0xf13e('0x1a')]=_0x28ffcc[_0xf13e('0x1a')];this['idHopper']=_0x28ffcc['id'];this[_0xf13e('0x1b')]=_0x28ffcc[_0xf13e('0x5')]['firstName']||'';this[_0xf13e('0x1c')]=moment()[_0xf13e('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x28ffcc[_0xf13e('0x1e')];this[_0xf13e('0x1f')]=_0x28ffcc[_0xf13e('0x1f')];this[_0xf13e('0x20')]=_0x28ffcc[_0xf13e('0x20')];this[_0xf13e('0x21')]=_0x28ffcc[_0xf13e('0x21')];this['originatecalleridnum']='';this[_0xf13e('0x22')]='';}Action['prototype'][_0xf13e('0x23')]=function(){return util[_0xf13e('0x1d')](_0xf13e('0x24'),this[_0xf13e('0x4')],this['voiceQueue'][_0xf13e('0x25')]>0x0?this[_0xf13e('0x26')]['substring'](this[_0xf13e('0x27')][_0xf13e('0x25')]):this[_0xf13e('0x26')]);};Action[_0xf13e('0x28')]['getQueue']=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index b425ae4..50657cb 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 _0xcba2=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback'];(function(_0x38ed44,_0x23c2c4){var _0x7712a3=function(_0x1fd531){while(--_0x1fd531){_0x38ed44['push'](_0x38ed44['shift']());}};_0x7712a3(++_0x23c2c4);}(_0xcba2,0x118));var _0x2cba=function(_0x4f8ae6,_0x1139e0){_0x4f8ae6=_0x4f8ae6-0x0;var _0x19fb90=_0xcba2[_0x4f8ae6];return _0x19fb90;};'use strict';var util=require(_0x2cba('0x0'));var _=require('lodash');var moment=require(_0x2cba('0x1'));function getSeconds(_0x467caa,_0x552269){var _0x373a43=moment(_0x467caa)[_0x2cba('0x2')](0x0);var _0x465b80=moment(_0x552269)[_0x2cba('0x2')](0x0);return _0x373a43['diff'](_0x465b80,_0x2cba('0x3'));}function AgentComplete(_0x5d3f16,_0x5145bc){this[_0x2cba('0x4')]=0x4;this[_0x2cba('0x5')]='Answer';this[_0x2cba('0x6')]=_0x5d3f16[_0x2cba('0x6')];this[_0x2cba('0x7')]=_0x5d3f16[_0x2cba('0x7')];this[_0x2cba('0x8')]=_0x5d3f16[_0x2cba('0x7')]==='outbound'?_0x2cba('0x9'):_0x5d3f16[_0x2cba('0x7')];this['countbusyretry']=_0x5d3f16[_0x2cba('0xa')];this[_0x2cba('0xb')]=_0x5d3f16['countcongestionretry'];this[_0x2cba('0xc')]=_0x5d3f16[_0x2cba('0xc')];this['countglobal']=_0x5d3f16[_0x2cba('0xa')]+_0x5d3f16['countcongestionretry']+_0x5d3f16[_0x2cba('0xc')]+_0x5d3f16[_0x2cba('0xd')]+_0x5d3f16[_0x2cba('0xe')]+_0x5d3f16[_0x2cba('0xf')]+_0x5d3f16[_0x2cba('0x10')]+_0x5d3f16[_0x2cba('0x11')];this[_0x2cba('0xd')]=_0x5d3f16[_0x2cba('0xd')];this['countdropretry']=_0x5d3f16[_0x2cba('0xe')];this[_0x2cba('0xf')]=_0x5d3f16[_0x2cba('0xf')];this[_0x2cba('0x10')]=_0x5d3f16[_0x2cba('0x10')];this[_0x2cba('0x11')]=_0x5d3f16['countagentrejectretry'];this[_0x2cba('0x12')]=_0x5145bc['uniqueid'];this[_0x2cba('0x13')]=_0x5d3f16[_0x2cba('0x14')];this[_0x2cba('0x15')]=_0x5d3f16[_0x2cba('0x16')];this[_0x2cba('0x17')]=_0x5d3f16[_0x2cba('0x17')];this[_0x2cba('0x18')]=_0x5d3f16[_0x2cba('0x18')];this[_0x2cba('0x19')]=_0x5d3f16[_0x2cba('0x19')];this[_0x2cba('0x1a')]=moment()[_0x2cba('0x1b')](_0x2cba('0x1c'));this[_0x2cba('0x1d')]=getSeconds(_0x5d3f16[_0x2cba('0x18')],_0x5d3f16[_0x2cba('0x17')]);this[_0x2cba('0x1e')]=getSeconds(_0x5d3f16[_0x2cba('0x19')],_0x5d3f16[_0x2cba('0x18')]);this[_0x2cba('0x1f')]=getSeconds(this[_0x2cba('0x1a')],_0x5d3f16[_0x2cba('0x19')]);this['queue']=_0x5145bc[_0x2cba('0x9')];this[_0x2cba('0x20')]=_0x5145bc[_0x2cba('0x20')];this[_0x2cba('0x21')]=_0x5145bc[_0x2cba('0x21')];this['callback']=_0x5d3f16[_0x2cba('0x22')];this[_0x2cba('0x23')]=_0x5d3f16[_0x2cba('0x23')];this[_0x2cba('0x24')]=_0x5d3f16[_0x2cba('0x24')];this[_0x2cba('0x25')]=_0x5d3f16[_0x2cba('0x25')];this[_0x2cba('0x26')]=_0x5d3f16[_0x2cba('0x26')];this[_0x2cba('0x27')]=_0x5d3f16[_0x2cba('0x27')];this[_0x2cba('0x28')]=_0x5d3f16['UserId'];this['VoiceQueueId']=_0x5d3f16[_0x2cba('0x29')];this['CampaignId']=_0x5d3f16['CampaignId'];this[_0x2cba('0x2a')]=_0x5d3f16[_0x2cba('0x2a')]||'';this[_0x2cba('0x2b')]=_0x5d3f16[_0x2cba('0x2b')]||'';}module[_0x2cba('0x2c')]=AgentComplete; \ No newline at end of file +var _0x7172=['Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','state','statedesc'];(function(_0x22074f,_0x84b386){var _0x370e5a=function(_0x1b9f87){while(--_0x1b9f87){_0x22074f['push'](_0x22074f['shift']());}};_0x370e5a(++_0x84b386);}(_0x7172,0xd2));var _0x2717=function(_0x365877,_0x428816){_0x365877=_0x365877-0x0;var _0x2ba9ce=_0x7172[_0x365877];return _0x2ba9ce;};'use strict';var util=require('util');var _=require(_0x2717('0x0'));var moment=require(_0x2717('0x1'));function getSeconds(_0x267a21,_0x341bd2){var _0x1344bc=moment(_0x267a21)[_0x2717('0x2')](0x0);var _0x224ea7=moment(_0x341bd2)[_0x2717('0x2')](0x0);return _0x1344bc['diff'](_0x224ea7,'seconds');}function AgentComplete(_0x522493,_0x768762){this[_0x2717('0x3')]=0x4;this[_0x2717('0x4')]=_0x2717('0x5');this[_0x2717('0x6')]=_0x522493[_0x2717('0x6')];this[_0x2717('0x7')]=_0x522493['type'];this[_0x2717('0x8')]=_0x522493[_0x2717('0x7')]==='outbound'?_0x2717('0x9'):_0x522493[_0x2717('0x7')];this[_0x2717('0xa')]=_0x522493[_0x2717('0xa')];this[_0x2717('0xb')]=_0x522493['countcongestionretry'];this['countnoanswerretry']=_0x522493[_0x2717('0xc')];this[_0x2717('0xd')]=_0x522493[_0x2717('0xa')]+_0x522493['countcongestionretry']+_0x522493[_0x2717('0xc')]+_0x522493['countnosuchnumberretry']+_0x522493[_0x2717('0xe')]+_0x522493[_0x2717('0xf')]+_0x522493['countmachineretry']+_0x522493[_0x2717('0x10')];this[_0x2717('0x11')]=_0x522493['countnosuchnumberretry'];this[_0x2717('0xe')]=_0x522493[_0x2717('0xe')];this[_0x2717('0xf')]=_0x522493[_0x2717('0xf')];this[_0x2717('0x12')]=_0x522493['countmachineretry'];this['countagentrejectretry']=_0x522493[_0x2717('0x10')];this['uniqueid']=_0x768762[_0x2717('0x13')];this[_0x2717('0x14')]=_0x522493[_0x2717('0x15')];this[_0x2717('0x16')]=_0x522493[_0x2717('0x17')];this[_0x2717('0x18')]=_0x522493['starttime'];this['responsetime']=_0x522493[_0x2717('0x19')];this[_0x2717('0x1a')]=_0x522493[_0x2717('0x1a')];this['endtime']=moment()[_0x2717('0x1b')](_0x2717('0x1c'));this[_0x2717('0x1d')]=getSeconds(_0x522493[_0x2717('0x19')],_0x522493['starttime']);this[_0x2717('0x1e')]=getSeconds(_0x522493[_0x2717('0x1a')],_0x522493[_0x2717('0x19')]);this[_0x2717('0x1f')]=getSeconds(this[_0x2717('0x20')],_0x522493[_0x2717('0x1a')]);this[_0x2717('0x9')]=_0x768762[_0x2717('0x9')];this[_0x2717('0x21')]=_0x768762['membername'];this['reason']=_0x768762[_0x2717('0x22')];this['callback']=_0x522493[_0x2717('0x23')];this['callbackuniqueid']=_0x522493[_0x2717('0x24')];this[_0x2717('0x25')]=_0x522493['callbackat'];this[_0x2717('0x26')]=_0x522493[_0x2717('0x26')];this['ContactId']=_0x522493['ContactId'];this[_0x2717('0x27')]=_0x522493[_0x2717('0x27')];this['UserId']=_0x522493['UserId'];this[_0x2717('0x28')]=_0x522493[_0x2717('0x28')];this['CampaignId']=_0x522493['CampaignId'];this['originatecalleridnum']=_0x522493[_0x2717('0x29')]||'';this[_0x2717('0x2a')]=_0x522493[_0x2717('0x2a')]||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 08201af..2892fcd 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 _0x5577=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId'];(function(_0x38de98,_0x4d597f){var _0x125816=function(_0x2fb339){while(--_0x2fb339){_0x38de98['push'](_0x38de98['shift']());}};_0x125816(++_0x4d597f);}(_0x5577,0x1b4));var _0x7557=function(_0xc6879,_0x84a966){_0xc6879=_0xc6879-0x0;var _0x54f7a4=_0x5577[_0xc6879];return _0x54f7a4;};'use strict';var util=require(_0x7557('0x0'));var _=require('lodash');var moment=require(_0x7557('0x1'));function getSeconds(_0x389954,_0x52a8c6){var _0x34636a=moment(_0x389954)[_0x7557('0x2')](0x0);var _0x25c0da=moment(_0x52a8c6)[_0x7557('0x2')](0x0);return _0x34636a[_0x7557('0x3')](_0x25c0da,_0x7557('0x4'));}function Final(_0x5862e6){this[_0x7557('0x5')]=_0x5862e6[_0x7557('0x5')];this[_0x7557('0x6')]=_0x5862e6[_0x7557('0x6')];this[_0x7557('0x7')]=_0x5862e6[_0x7557('0x7')];this[_0x7557('0x8')]=_0x5862e6[_0x7557('0x7')]===_0x7557('0x9')?_0x7557('0xa'):_0x5862e6[_0x7557('0x7')];this[_0x7557('0xb')]=_0x5862e6[_0x7557('0xb')];this[_0x7557('0xc')]=_0x5862e6[_0x7557('0xc')];this['countnoanswerretry']=_0x5862e6['countnoanswerretry'];this[_0x7557('0xd')]=_0x5862e6[_0x7557('0xb')]+_0x5862e6[_0x7557('0xc')]+_0x5862e6[_0x7557('0xe')]+_0x5862e6[_0x7557('0xf')]+_0x5862e6[_0x7557('0x10')]+_0x5862e6[_0x7557('0x11')]+_0x5862e6[_0x7557('0x12')]+_0x5862e6[_0x7557('0x13')];this[_0x7557('0xf')]=_0x5862e6['countnosuchnumberretry'];this[_0x7557('0x10')]=_0x5862e6[_0x7557('0x10')];this[_0x7557('0x11')]=_0x5862e6['countabandonedretry'];this[_0x7557('0x12')]=_0x5862e6[_0x7557('0x12')];this[_0x7557('0x13')]=_0x5862e6[_0x7557('0x13')];this['queue']=_0x5862e6[_0x7557('0xa')];this[_0x7557('0x14')]=_0x5862e6['calleridname'];this['calleridnum']=_0x5862e6[_0x7557('0x15')];this[_0x7557('0x16')]=_0x5862e6[_0x7557('0x16')];this[_0x7557('0x17')]=_0x5862e6['responsetime'];this[_0x7557('0x18')]=_0x5862e6['responsetime'];this[_0x7557('0x19')]=_0x5862e6[_0x7557('0x19')]||0x0;this[_0x7557('0x1a')]=_0x5862e6[_0x7557('0x1a')]||0x0;this['talktime']=_0x5862e6[_0x7557('0x1b')]||0x0;this[_0x7557('0x1c')]=_0x5862e6[_0x7557('0x1c')];this[_0x7557('0x1d')]=_0x5862e6[_0x7557('0x1d')];this['callbackat']=_0x5862e6['callbackat'];this['recallme']=_0x5862e6[_0x7557('0x1e')];this['ContactId']=_0x5862e6[_0x7557('0x1f')];this[_0x7557('0x20')]=_0x5862e6[_0x7557('0x20')];this[_0x7557('0x21')]=_0x5862e6[_0x7557('0x21')];this[_0x7557('0x22')]=_0x5862e6[_0x7557('0x22')];this['CampaignId']=_0x5862e6[_0x7557('0x23')];this['originatecalleridnum']=_0x5862e6[_0x7557('0x24')]||'';this['originatecalleridname']=_0x5862e6[_0x7557('0x25')]||'';}module[_0x7557('0x26')]=Final; \ No newline at end of file +var _0x5fd1=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x25d1bc,_0x52dd28){var _0x59d84d=function(_0x397f5b){while(--_0x397f5b){_0x25d1bc['push'](_0x25d1bc['shift']());}};_0x59d84d(++_0x52dd28);}(_0x5fd1,0x155));var _0x15fd=function(_0x203c9a,_0xdcb6a7){_0x203c9a=_0x203c9a-0x0;var _0x2c5a14=_0x5fd1[_0x203c9a];return _0x2c5a14;};'use strict';var util=require(_0x15fd('0x0'));var _=require('lodash');var moment=require(_0x15fd('0x1'));function getSeconds(_0x570048,_0x45bd54){var _0x50fc5a=moment(_0x570048)['milliseconds'](0x0);var _0x370d34=moment(_0x45bd54)[_0x15fd('0x2')](0x0);return _0x50fc5a[_0x15fd('0x3')](_0x370d34,'seconds');}function Final(_0x1e3b97){this[_0x15fd('0x4')]=_0x1e3b97[_0x15fd('0x4')];this[_0x15fd('0x5')]=_0x1e3b97[_0x15fd('0x5')];this['type']=_0x1e3b97[_0x15fd('0x6')];this[_0x15fd('0x7')]=_0x1e3b97[_0x15fd('0x6')]==='outbound'?_0x15fd('0x8'):_0x1e3b97['type'];this[_0x15fd('0x9')]=_0x1e3b97[_0x15fd('0x9')];this['countcongestionretry']=_0x1e3b97['countcongestionretry'];this['countnoanswerretry']=_0x1e3b97[_0x15fd('0xa')];this[_0x15fd('0xb')]=_0x1e3b97[_0x15fd('0x9')]+_0x1e3b97[_0x15fd('0xc')]+_0x1e3b97[_0x15fd('0xa')]+_0x1e3b97[_0x15fd('0xd')]+_0x1e3b97[_0x15fd('0xe')]+_0x1e3b97[_0x15fd('0xf')]+_0x1e3b97[_0x15fd('0x10')]+_0x1e3b97['countagentrejectretry'];this['countnosuchnumberretry']=_0x1e3b97['countnosuchnumberretry'];this[_0x15fd('0xe')]=_0x1e3b97[_0x15fd('0xe')];this[_0x15fd('0xf')]=_0x1e3b97[_0x15fd('0xf')];this[_0x15fd('0x10')]=_0x1e3b97[_0x15fd('0x10')];this[_0x15fd('0x11')]=_0x1e3b97[_0x15fd('0x11')];this['queue']=_0x1e3b97['queue'];this[_0x15fd('0x12')]=_0x1e3b97['calleridname'];this[_0x15fd('0x13')]=_0x1e3b97['calleridnum'];this[_0x15fd('0x14')]=_0x1e3b97[_0x15fd('0x14')];this[_0x15fd('0x15')]=_0x1e3b97['responsetime'];this[_0x15fd('0x16')]=_0x1e3b97[_0x15fd('0x15')];this[_0x15fd('0x17')]=_0x1e3b97[_0x15fd('0x17')]||0x0;this[_0x15fd('0x18')]=_0x1e3b97[_0x15fd('0x18')]||0x0;this[_0x15fd('0x19')]=_0x1e3b97[_0x15fd('0x19')]||0x0;this[_0x15fd('0x1a')]=_0x1e3b97[_0x15fd('0x1a')];this[_0x15fd('0x1b')]=_0x1e3b97['callbackuniqueid'];this['callbackat']=_0x1e3b97[_0x15fd('0x1c')];this[_0x15fd('0x1d')]=_0x1e3b97[_0x15fd('0x1d')];this[_0x15fd('0x1e')]=_0x1e3b97[_0x15fd('0x1e')];this[_0x15fd('0x1f')]=_0x1e3b97[_0x15fd('0x1f')];this['UserId']=_0x1e3b97[_0x15fd('0x20')];this[_0x15fd('0x21')]=_0x1e3b97[_0x15fd('0x21')];this['CampaignId']=_0x1e3b97[_0x15fd('0x22')];this['originatecalleridnum']=_0x1e3b97[_0x15fd('0x23')]||'';this[_0x15fd('0x24')]=_0x1e3b97[_0x15fd('0x24')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index b634931..765960a 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 _0xe0ef=['UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','starttime','responsetime','endtime','format','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','recallme','ContactId','ListId'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xe0ef,0x1f2));var _0xfe0e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe0ef[_0x19950b];return _0x3c6b41;};'use strict';var util=require(_0xfe0e('0x0'));var _=require(_0xfe0e('0x1'));var moment=require(_0xfe0e('0x2'));function getSeconds(_0x222427,_0x39a852){var _0x5b4421=moment(_0x222427)[_0xfe0e('0x3')](0x0);var _0x1c633=moment(_0x39a852)[_0xfe0e('0x3')](0x0);return _0x5b4421[_0xfe0e('0x4')](_0x1c633,_0xfe0e('0x5'));}function Hangup(_0x376409,_0x4724ff){this[_0xfe0e('0x6')]=0x4;this[_0xfe0e('0x7')]=_0xfe0e('0x8');this[_0xfe0e('0x9')]=_0x376409[_0xfe0e('0x9')];this[_0xfe0e('0xa')]=_0x376409[_0xfe0e('0xa')];this[_0xfe0e('0xb')]=_0x376409[_0xfe0e('0xa')]===_0xfe0e('0xc')?_0xfe0e('0xd'):_0x376409['type'];this['countbusyretry']=_0x376409[_0xfe0e('0xe')];this['countcongestionretry']=_0x376409[_0xfe0e('0xf')];this[_0xfe0e('0x10')]=_0x376409[_0xfe0e('0x10')];this[_0xfe0e('0x11')]=_0x376409[_0xfe0e('0xe')]+_0x376409[_0xfe0e('0xf')]+_0x376409[_0xfe0e('0x10')]+_0x376409[_0xfe0e('0x12')]+_0x376409[_0xfe0e('0x13')]+_0x376409[_0xfe0e('0x14')]+_0x376409['countmachineretry']+_0x376409['countagentrejectretry'];this['countnosuchnumberretry']=_0x376409[_0xfe0e('0x12')];this['countdropretry']=_0x376409[_0xfe0e('0x13')];this[_0xfe0e('0x14')]=_0x376409['countabandonedretry'];this[_0xfe0e('0x15')]=_0x376409['countmachineretry'];this[_0xfe0e('0x16')]=_0x376409['countagentrejectretry'];this['uniqueid']=_0x4724ff['uniqueid'];this[_0xfe0e('0x17')]=_0x376409[_0xfe0e('0x18')];this[_0xfe0e('0x19')]=_0x376409['number'];this[_0xfe0e('0x1a')]=_0x376409[_0xfe0e('0x1a')];this['responsetime']=_0x376409[_0xfe0e('0x1b')];this[_0xfe0e('0x1c')]=moment()[_0xfe0e('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xfe0e('0x1e')]=getSeconds(_0x376409[_0xfe0e('0x1b')],_0x376409[_0xfe0e('0x1a')]);this[_0xfe0e('0x1f')]=0x0;this[_0xfe0e('0x20')]=getSeconds(this['endtime'],_0x376409[_0xfe0e('0x1b')]);this[_0xfe0e('0xd')]=_0x376409['queue'];this[_0xfe0e('0x21')]=_0xfe0e('0x22');this[_0xfe0e('0x23')]=_0x4724ff[_0xfe0e('0x24')];this[_0xfe0e('0x25')]=_0x376409[_0xfe0e('0x25')];this['callbackuniqueid']=_0x376409[_0xfe0e('0x26')];this['callbackat']=_0x376409['callbackat'];this['recallme']=_0x376409[_0xfe0e('0x27')];this['ContactId']=_0x376409[_0xfe0e('0x28')];this[_0xfe0e('0x29')]=_0x376409[_0xfe0e('0x29')];this[_0xfe0e('0x2a')]=_0x376409[_0xfe0e('0x2a')];this[_0xfe0e('0x2b')]=_0x376409[_0xfe0e('0x2b')];this[_0xfe0e('0x2c')]=_0x376409[_0xfe0e('0x2c')];}module['exports']=Hangup; \ No newline at end of file +var _0xbb87=['responsetime','endtime','ringtime','holdtime','talktime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','number','starttime'];(function(_0x175e89,_0x20835f){var _0x2ed996=function(_0x56239f){while(--_0x56239f){_0x175e89['push'](_0x175e89['shift']());}};_0x2ed996(++_0x20835f);}(_0xbb87,0x16a));var _0x7bb8=function(_0x12ce11,_0x14e9be){_0x12ce11=_0x12ce11-0x0;var _0x1dfebd=_0xbb87[_0x12ce11];return _0x1dfebd;};'use strict';var util=require(_0x7bb8('0x0'));var _=require(_0x7bb8('0x1'));var moment=require(_0x7bb8('0x2'));function getSeconds(_0x5203dd,_0x3080f0){var _0x1a9a61=moment(_0x5203dd)['milliseconds'](0x0);var _0x5a56ff=moment(_0x3080f0)[_0x7bb8('0x3')](0x0);return _0x1a9a61[_0x7bb8('0x4')](_0x5a56ff,'seconds');}function Hangup(_0x2e05cf,_0x3c47be){this[_0x7bb8('0x5')]=0x4;this[_0x7bb8('0x6')]=_0x7bb8('0x7');this[_0x7bb8('0x8')]=_0x2e05cf['scheduledat'];this[_0x7bb8('0x9')]=_0x2e05cf['type'];this['campaigntype']=_0x2e05cf['type']===_0x7bb8('0xa')?_0x7bb8('0xb'):_0x2e05cf[_0x7bb8('0x9')];this[_0x7bb8('0xc')]=_0x2e05cf[_0x7bb8('0xc')];this['countcongestionretry']=_0x2e05cf['countcongestionretry'];this[_0x7bb8('0xd')]=_0x2e05cf[_0x7bb8('0xd')];this[_0x7bb8('0xe')]=_0x2e05cf[_0x7bb8('0xc')]+_0x2e05cf[_0x7bb8('0xf')]+_0x2e05cf['countnoanswerretry']+_0x2e05cf[_0x7bb8('0x10')]+_0x2e05cf[_0x7bb8('0x11')]+_0x2e05cf[_0x7bb8('0x12')]+_0x2e05cf['countmachineretry']+_0x2e05cf[_0x7bb8('0x13')];this[_0x7bb8('0x10')]=_0x2e05cf[_0x7bb8('0x10')];this['countdropretry']=_0x2e05cf[_0x7bb8('0x11')];this[_0x7bb8('0x12')]=_0x2e05cf[_0x7bb8('0x12')];this[_0x7bb8('0x14')]=_0x2e05cf[_0x7bb8('0x14')];this[_0x7bb8('0x13')]=_0x2e05cf[_0x7bb8('0x13')];this[_0x7bb8('0x15')]=_0x3c47be['uniqueid'];this[_0x7bb8('0x16')]=_0x2e05cf['name'];this['calleridnum']=_0x2e05cf[_0x7bb8('0x17')];this[_0x7bb8('0x18')]=_0x2e05cf[_0x7bb8('0x18')];this[_0x7bb8('0x19')]=_0x2e05cf[_0x7bb8('0x19')];this[_0x7bb8('0x1a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x7bb8('0x1b')]=getSeconds(_0x2e05cf[_0x7bb8('0x19')],_0x2e05cf[_0x7bb8('0x18')]);this[_0x7bb8('0x1c')]=0x0;this[_0x7bb8('0x1d')]=getSeconds(this[_0x7bb8('0x1a')],_0x2e05cf[_0x7bb8('0x19')]);this[_0x7bb8('0xb')]=_0x2e05cf[_0x7bb8('0xb')];this[_0x7bb8('0x1e')]='IVR';this[_0x7bb8('0x1f')]=_0x3c47be[_0x7bb8('0x20')];this[_0x7bb8('0x21')]=_0x2e05cf[_0x7bb8('0x21')];this['callbackuniqueid']=_0x2e05cf[_0x7bb8('0x22')];this[_0x7bb8('0x23')]=_0x2e05cf[_0x7bb8('0x23')];this[_0x7bb8('0x24')]=_0x2e05cf[_0x7bb8('0x24')];this[_0x7bb8('0x25')]=_0x2e05cf[_0x7bb8('0x25')];this[_0x7bb8('0x26')]=_0x2e05cf['ListId'];this[_0x7bb8('0x27')]=_0x2e05cf[_0x7bb8('0x27')];this['VoiceQueueId']=_0x2e05cf[_0x7bb8('0x28')];this[_0x7bb8('0x29')]=_0x2e05cf[_0x7bb8('0x29')];}module[_0x7bb8('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index f2eb9e8..2c60af7 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 _0xf037=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','name','calleridnum','number','starttime','responsetime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf037,0x10f));var _0x7f03=function(_0x3ed091,_0x3491d4){_0x3ed091=_0x3ed091-0x0;var _0x49f07c=_0xf037[_0x3ed091];return _0x49f07c;};'use strict';var util=require(_0x7f03('0x0'));var _=require('lodash');var moment=require(_0x7f03('0x1'));function getSeconds(_0xdf3529,_0x7cc426){var _0x3e27e6=moment(_0xdf3529)[_0x7f03('0x2')](0x0);var _0x4b02f1=moment(_0x7cc426)['milliseconds'](0x0);return _0x3e27e6[_0x7f03('0x3')](_0x4b02f1,_0x7f03('0x4'));}function History(_0x3338a1){this[_0x7f03('0x5')]=_0x3338a1[_0x7f03('0x5')];this[_0x7f03('0x6')]=_0x3338a1[_0x7f03('0x6')]||undefined;this[_0x7f03('0x7')]=_0x3338a1[_0x7f03('0x7')];this[_0x7f03('0x8')]=_0x3338a1['type']===_0x7f03('0x9')?'queue':_0x3338a1[_0x7f03('0x7')];this[_0x7f03('0xa')]=_0x3338a1['countbusyretry'];this[_0x7f03('0xb')]=_0x3338a1[_0x7f03('0xb')];this[_0x7f03('0xc')]=_0x3338a1['countnoanswerretry'];this[_0x7f03('0xd')]=_0x3338a1[_0x7f03('0xa')]+_0x3338a1[_0x7f03('0xb')]+_0x3338a1[_0x7f03('0xc')]+_0x3338a1[_0x7f03('0xe')]+_0x3338a1[_0x7f03('0xf')]+_0x3338a1[_0x7f03('0x10')]+_0x3338a1[_0x7f03('0x11')]+_0x3338a1['countagentrejectretry'];this[_0x7f03('0xe')]=_0x3338a1['countnosuchnumberretry'];this[_0x7f03('0xf')]=_0x3338a1[_0x7f03('0xf')];this[_0x7f03('0x10')]=_0x3338a1[_0x7f03('0x10')];this['countmachineretry']=_0x3338a1[_0x7f03('0x11')];this['countagentrejectretry']=_0x3338a1[_0x7f03('0x12')];this[_0x7f03('0x13')]=_0x3338a1['queue'];this['calleridname']=_0x3338a1[_0x7f03('0x14')];this[_0x7f03('0x15')]=_0x3338a1[_0x7f03('0x16')];this[_0x7f03('0x17')]=_0x3338a1[_0x7f03('0x17')];this['responsetime']=_0x3338a1[_0x7f03('0x18')];this['endtime']=_0x3338a1[_0x7f03('0x18')];this[_0x7f03('0x19')]=getSeconds(_0x3338a1['responsetime'],_0x3338a1[_0x7f03('0x17')]);this['holdtime']=0x0;this[_0x7f03('0x1a')]=0x0;this[_0x7f03('0x1b')]=_0x3338a1[_0x7f03('0x1b')];this[_0x7f03('0x1c')]=_0x3338a1[_0x7f03('0x1c')];this[_0x7f03('0x1d')]=_0x3338a1[_0x7f03('0x1d')];this[_0x7f03('0x1e')]=_0x3338a1['recallme'];this['ContactId']=_0x3338a1['ContactId'];this[_0x7f03('0x1f')]=_0x3338a1[_0x7f03('0x1f')];this['UserId']=_0x3338a1[_0x7f03('0x20')];this[_0x7f03('0x21')]=_0x3338a1[_0x7f03('0x21')];this[_0x7f03('0x22')]=_0x3338a1['CampaignId'];this['originatecalleridnum']=_0x3338a1[_0x7f03('0x23')]||'';this['originatecalleridname']=_0x3338a1[_0x7f03('0x24')]||'';}module[_0x7f03('0x25')]=History; \ No newline at end of file +var _0xe3bb=['exports','util','lodash','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x58e302,_0x1bb64a){var _0x17306b=function(_0x1ccc63){while(--_0x1ccc63){_0x58e302['push'](_0x58e302['shift']());}};_0x17306b(++_0x1bb64a);}(_0xe3bb,0x1bd));var _0xbe3b=function(_0xf70b9b,_0x5622da){_0xf70b9b=_0xf70b9b-0x0;var _0x2270f7=_0xe3bb[_0xf70b9b];return _0x2270f7;};'use strict';var util=require(_0xbe3b('0x0'));var _=require(_0xbe3b('0x1'));var moment=require('moment');function getSeconds(_0x1b7b38,_0x3dbf57){var _0x3b6308=moment(_0x1b7b38)[_0xbe3b('0x2')](0x0);var _0x26cd2c=moment(_0x3dbf57)['milliseconds'](0x0);return _0x3b6308[_0xbe3b('0x3')](_0x26cd2c,'seconds');}function History(_0x2b8766){this[_0xbe3b('0x4')]=_0x2b8766[_0xbe3b('0x4')];this[_0xbe3b('0x5')]=_0x2b8766[_0xbe3b('0x5')]||undefined;this['type']=_0x2b8766[_0xbe3b('0x6')];this['campaigntype']=_0x2b8766['type']===_0xbe3b('0x7')?_0xbe3b('0x8'):_0x2b8766['type'];this['countbusyretry']=_0x2b8766[_0xbe3b('0x9')];this[_0xbe3b('0xa')]=_0x2b8766[_0xbe3b('0xa')];this[_0xbe3b('0xb')]=_0x2b8766[_0xbe3b('0xb')];this[_0xbe3b('0xc')]=_0x2b8766[_0xbe3b('0x9')]+_0x2b8766[_0xbe3b('0xa')]+_0x2b8766[_0xbe3b('0xb')]+_0x2b8766['countnosuchnumberretry']+_0x2b8766[_0xbe3b('0xd')]+_0x2b8766[_0xbe3b('0xe')]+_0x2b8766[_0xbe3b('0xf')]+_0x2b8766[_0xbe3b('0x10')];this[_0xbe3b('0x11')]=_0x2b8766[_0xbe3b('0x11')];this[_0xbe3b('0xd')]=_0x2b8766[_0xbe3b('0xd')];this[_0xbe3b('0xe')]=_0x2b8766['countabandonedretry'];this['countmachineretry']=_0x2b8766[_0xbe3b('0xf')];this['countagentrejectretry']=_0x2b8766[_0xbe3b('0x10')];this[_0xbe3b('0x8')]=_0x2b8766[_0xbe3b('0x8')];this[_0xbe3b('0x12')]=_0x2b8766[_0xbe3b('0x13')];this['calleridnum']=_0x2b8766['number'];this[_0xbe3b('0x14')]=_0x2b8766['starttime'];this[_0xbe3b('0x15')]=_0x2b8766[_0xbe3b('0x15')];this[_0xbe3b('0x16')]=_0x2b8766[_0xbe3b('0x15')];this[_0xbe3b('0x17')]=getSeconds(_0x2b8766[_0xbe3b('0x15')],_0x2b8766[_0xbe3b('0x14')]);this['holdtime']=0x0;this[_0xbe3b('0x18')]=0x0;this[_0xbe3b('0x19')]=_0x2b8766[_0xbe3b('0x19')];this[_0xbe3b('0x1a')]=_0x2b8766[_0xbe3b('0x1a')];this['callbackat']=_0x2b8766[_0xbe3b('0x1b')];this[_0xbe3b('0x1c')]=_0x2b8766['recallme'];this['ContactId']=_0x2b8766[_0xbe3b('0x1d')];this[_0xbe3b('0x1e')]=_0x2b8766[_0xbe3b('0x1e')];this[_0xbe3b('0x1f')]=_0x2b8766[_0xbe3b('0x1f')];this[_0xbe3b('0x20')]=_0x2b8766['VoiceQueueId'];this[_0xbe3b('0x21')]=_0x2b8766[_0xbe3b('0x21')];this[_0xbe3b('0x22')]=_0x2b8766['originatecalleridnum']||'';this['originatecalleridname']=_0x2b8766[_0xbe3b('0x23')]||'';}module[_0xbe3b('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 60edc9a..78a8442 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 _0xadb0=['launchHandleIvr','\x5cw{0,','pow','random','match','actionOriginate','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','callProgressDetecting','object','entity\x20is\x20undefine','[callProgressDetecting]','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','round','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/setting','./action','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','syncQueueMember','loopClearZombieChannels','getSettings','then','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','isEmpty','Intervals','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','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','---------\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','---------------------------','merge','diff','clearing\x20variable\x20start\x20predictive','handlePredictive','preview','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','clearZombieChannels','[uniqueid]','actions','isNil','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','ivr','[Dialer][checkChannel][ivr]','countReScheduled','catch','[countReScheduled]\x20','checkIsBlackList','resolve','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','ContactId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','dialAMDActive','MACHINE','Machine','countmachineretry','amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Machine]','buildObj','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countbusyretry','countdropretry','countabandonedretry','createStateFinal','reason\x2019\x20machine....','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','countglobal','dialDropMaxRetry','add','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','starttime','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','run','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','pick','[Catch][Preview][syncQueueStatusComplete]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','loopCampaigns','resetActiveCalls','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','power','Queue','method\x20not\x20recognized','handlePreviewRecallNotifications','Agent','user:dialPreviewRecallReminder','dialActive','dialGlobalInterval','checkIfTimeIntervals','dialTimezone','dialPreviewRecallmeReminder','checkPreviewRecallReminder','syncCampaigns'];(function(_0x5dce54,_0x14fc1d){var _0x279e5b=function(_0x1bf3c5){while(--_0x1bf3c5){_0x5dce54['push'](_0x5dce54['shift']());}};_0x279e5b(++_0x14fc1d);}(_0xadb0,0xb3));var _0x0adb=function(_0x3b2fba,_0x4587af){_0x3b2fba=_0x3b2fba-0x0;var _0x1f97c8=_0xadb0[_0x3b2fba];return _0x1f97c8;};'use strict';var util=require(_0x0adb('0x0'));var _=require('lodash');var BPromise=require(_0x0adb('0x1'));var uuid=require(_0x0adb('0x2'));var moment=require(_0x0adb('0x3'));var rr=require('rr');var md5=require(_0x0adb('0x4'));var Redis=require(_0x0adb('0x5'));var ut=require(_0x0adb('0x6'));var config=require(_0x0adb('0x7'));var logger=require(_0x0adb('0x8'))(_0x0adb('0x9'));var loggerBooked=require(_0x0adb('0x8'))(_0x0adb('0xa'));var loggerPredictive=require('../../../config/logger')(_0x0adb('0xb'));var loggerPredictiveCalls=require(_0x0adb('0x8'))(_0x0adb('0xc'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x0adb('0xd'));var ami=require(_0x0adb('0xe'));config[_0x0adb('0xf')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0adb('0x10'))(new Redis(config[_0x0adb('0xf')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x0adb('0x11'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x0adb('0x12'));var RpcSetting=require(_0x0adb('0x13'));var Action=require(_0x0adb('0x14'));var History=require('./history');var Final=require('./final');var AgentComplete=require(_0x0adb('0x15'));var QueueCallerAbandon=require(_0x0adb('0x16'));var Hangup=require(_0x0adb('0x17'));var ipAgi=process[_0x0adb('0x18')]['XCALLY_IP_AGI']||_0x0adb('0x19');var strategy={'rrmemory':_0x0adb('0x1a'),'roundrobin':_0x0adb('0x1b')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x0adb('0x1c')][_0x0adb('0x1d')]=function(_0x1451b2){this['tail']=this['tail']?this['tail']['finally'](_0x1451b2):_0x1451b2();};function Dialer(_0xce504f,_0x1b9f2a){this[_0x0adb('0x1e')]=new Sequence();this['preview']=_0x1b9f2a;this[_0x0adb('0x1f')]=_0xce504f[_0x0adb('0x1f')];this[_0x0adb('0x20')]=_0xce504f[_0x0adb('0x20')];this[_0x0adb('0x21')]=_0xce504f['agents'];this[_0x0adb('0x22')]=_0xce504f[_0x0adb('0x22')];this['maxNumberOriginate']=config[_0x0adb('0x23')]||0x2;this[_0x0adb('0x24')]={};this['actions']={};this['contactsId']={};this[_0x0adb('0x25')]={};this['optionPredictive']={};this[_0x0adb('0x26')]={};this[_0x0adb('0x27')]={};this[_0x0adb('0x28')]={};this[_0x0adb('0x29')]={};this['queueBookedRR']={};ami['on'](_0x0adb('0x2a'),this[_0x0adb('0x2b')][_0x0adb('0x2c')](this));ami['on'](_0x0adb('0x2d'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x0adb('0x2e'),this[_0x0adb('0x2f')][_0x0adb('0x2c')](this));ami['on']('agentcomplete',this[_0x0adb('0x30')]['bind'](this));ami['on'](_0x0adb('0x31'),this[_0x0adb('0xd')]['bind'](this));ami['on'](_0x0adb('0x32'),this[_0x0adb('0x33')][_0x0adb('0x2c')](this));ami['on'](_0x0adb('0x34'),this[_0x0adb('0x35')]['bind'](this));ami['on']('varset',this[_0x0adb('0x36')][_0x0adb('0x2c')](this));ami['on']('queuemember',this[_0x0adb('0x37')][_0x0adb('0x2c')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x0adb('0x2c')](this));this['loopCampaigns']();this[_0x0adb('0x38')]();RpcSetting[_0x0adb('0x39')]()[_0x0adb('0x3a')](function(_0x33d789){previewRecallmeReminderInterval=_0x33d789['previewRecallmeReminderInterval'];});}function isNotNull(_0x5cdaaa){return _0x5cdaaa!==null&&!_[_0x0adb('0x3b')](_0x5cdaaa);}function checkIsLoggedIn(_0x51684b,_0xff12e9){return function(){if(_0xff12e9<=0x0){_0x51684b[_0x0adb('0x3c')]=_0x0adb('0x3d');throw _0x51684b[_0x0adb('0x3e')]+_0x0adb('0x3f');}};}function isActive(_0x4aedb0){return _0x4aedb0;}function checkIsActive(_0x4a7841,_0x23f0b7){return function(){if(!isActive(_0x23f0b7)){_0x4a7841[_0x0adb('0x3c')]=_0x0adb('0x40');throw _0x4a7841[_0x0adb('0x3e')]+_0x0adb('0x41');}};}function checkInterval(_0x25e475){return function(){if(!isNotNull(_0x25e475[_0x0adb('0x42')])){_0x25e475[_0x0adb('0x3c')]=_0x0adb('0x43');throw _0x25e475[_0x0adb('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x25e475['Interval']['Intervals'])){_0x25e475[_0x0adb('0x3c')]=_0x0adb('0x43');throw _0x25e475[_0x0adb('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x0adb('0x44')](_0x25e475['Interval'][_0x0adb('0x45')]))){_0x25e475[_0x0adb('0x3c')]=_0x0adb('0x43');throw _0x25e475[_0x0adb('0x3e')]+_0x0adb('0x46');}};}function msgResponse(_0x20fdd7,_0xc08f1a,_0x114bd3){return{'action':_0x20fdd7,'response':_0xc08f1a,'message':_0x114bd3,'stack':_0x114bd3};}function myreject(_0x505918){return function(_0x44ab6e){return _0x505918(msgResponse(_0x0adb('0x47'),_0x0adb('0x48'),JSON[_0x0adb('0x49')](_0x44ab6e)));};}function getSeconds(_0x4511a1,_0xf1bbab){var _0x41563e=moment(_0x4511a1)['milliseconds'](0x0);var _0x222fb9=moment(_0xf1bbab)[_0x0adb('0x4a')](0x0);return _0x41563e['diff'](_0x222fb9,_0x0adb('0x4b'));}function emit(_0x3697cd,_0x2e9250,_0x4f5afa){io['to'](_0x3697cd)[_0x0adb('0x4c')](_0x2e9250,_0x4f5afa);}function emitVoiceQueueSummary(_0x47c531){if(_0x47c531[_0x0adb('0x4d')]===_0x0adb('0x4e')){var _0x288d8c={'id':_0x47c531['id'],'name':_0x47c531[_0x0adb('0x3e')],'strategy':_0x47c531[_0x0adb('0x4f')],'answered':_0x47c531[_0x0adb('0x50')],'available':_0x47c531[_0x0adb('0x51')],'loggedIn':_0x47c531[_0x0adb('0x52')],'pTalking':_0x47c531[_0x0adb('0x53')],'sumBillable':_0x47c531[_0x0adb('0x54')],'sumDuration':_0x47c531[_0x0adb('0x55')],'sumHoldTime':_0x47c531[_0x0adb('0x56')]||0x0,'talking':_0x47c531[_0x0adb('0x57')],'total':_0x47c531[_0x0adb('0x58')],'type':_0x47c531[_0x0adb('0x4d')],'unmanaged':_0x47c531[_0x0adb('0x59')],'abandoned':_0x47c531[_0x0adb('0x5a')],'waiting':_0x47c531[_0x0adb('0x5b')],'loggedInDb':_0x47c531[_0x0adb('0x5c')],'dialActive':_0x47c531['dialActive'],'dialMethod':_0x47c531[_0x0adb('0x5d')],'dialOriginateCallerIdName':_0x47c531[_0x0adb('0x5e')],'dialOriginateCallerIdNumber':_0x47c531[_0x0adb('0x5f')],'dialOriginateTimeout':_0x47c531[_0x0adb('0x60')],'dialPrefix':_0x47c531[_0x0adb('0x61')],'outboundAnswerAgiCallsDay':_0x47c531[_0x0adb('0x62')],'outboundAnswerCallsDay':_0x47c531[_0x0adb('0x63')],'outboundBlacklistCallsDay':_0x47c531['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x47c531[_0x0adb('0x64')],'outboundCongestionCallsDay':_0x47c531['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x47c531[_0x0adb('0x65')],'outboundDropCallsDayCallersExit':_0x47c531[_0x0adb('0x66')],'outboundDropCallsDayTimeout':_0x47c531['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x47c531[_0x0adb('0x67')],'outboundNoSuchCallsDay':_0x47c531['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x47c531[_0x0adb('0x68')],'outboundReCallsDay':_0x47c531[_0x0adb('0x69')],'outboundRejectCallsDay':_0x47c531[_0x0adb('0x6a')],'outboundUnknownCallsDay':_0x47c531[_0x0adb('0x6b')],'predictiveIntervalAnsweredCalls':_0x47c531['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x47c531['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x47c531[_0x0adb('0x6c')],'predictiveIntervalDroppedCallsCallersExit':_0x47c531[_0x0adb('0x6d')],'predictiveIntervalDroppedCallsTimeout':_0x47c531[_0x0adb('0x6e')],'predictiveIntervalErlangCalls':_0x47c531[_0x0adb('0x6f')],'predictiveIntervalErlangCallsDroppedCalls':_0x47c531['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x47c531['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x47c531[_0x0adb('0x70')],'predictiveIntervalPauses':_0x47c531[_0x0adb('0x71')],'predictiveIntervalAvailable':_0x47c531[_0x0adb('0x72')],'predictiveIntervalTotalCalls':_0x47c531[_0x0adb('0x73')],'message':_0x47c531[_0x0adb('0x3c')],'originated':_0x47c531[_0x0adb('0x74')],'erlangCalls':_0x47c531[_0x0adb('0x75')],'erlangCallToSecond':_0x47c531['erlangCallToSecond'],'erlangAbandonmentRate':_0x47c531[_0x0adb('0x76')],'erlangBusyFactor':_0x47c531[_0x0adb('0x77')],'startPredictive':_0x47c531['startPredictive'],'startProgressive':_0x47c531[_0x0adb('0x27')]};if(_0x47c531[_0x0adb('0x78')]){_0x288d8c[_0x0adb('0x78')]={'id':_0x47c531[_0x0adb('0x78')]['id'],'name':_0x47c531[_0x0adb('0x78')][_0x0adb('0x3e')],'active':_0x47c531[_0x0adb('0x78')][_0x0adb('0x79')],'callerid':_0x47c531[_0x0adb('0x78')][_0x0adb('0x7a')]};}if(_0x47c531[_0x0adb('0x42')]){_0x288d8c[_0x0adb('0x42')]={'id':_0x47c531[_0x0adb('0x42')]['id'],'name':_0x47c531[_0x0adb('0x42')][_0x0adb('0x3e')]};}var _0x5d84fa=md5(JSON[_0x0adb('0x49')](_0x288d8c));if(_0x47c531[_0x0adb('0x4')]!==_0x5d84fa){_0x47c531['md5']=_0x5d84fa;emit(util['format'](_0x0adb('0x7b'),_0x288d8c[_0x0adb('0x3e')]),_0x0adb('0x7c'),_0x288d8c);}}}function emitCampaignSummary(_0x1a6d71){if(_0x1a6d71['type']==='ivr'){emit(util['format'](_0x0adb('0x7d'),_0x1a6d71['name']),_0x0adb('0x7e'),_0x1a6d71);}}function checkGetDataPredictive(_0x33302d){if(isNotNull(_0x33302d)&&!_[_0x0adb('0x44')](_0x33302d)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x80'),_0x33302d['predictiveIntervalTotalCalls']);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x33302d[_0x0adb('0x81')]);loggerPredictive[_0x0adb('0x7f')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x33302d[_0x0adb('0x6e')]);loggerPredictive[_0x0adb('0x7f')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x33302d[_0x0adb('0x6d')]);loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x82'),_0x33302d[_0x0adb('0x83')]);loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x84'),_0x33302d[_0x0adb('0x6c')]);loggerPredictive[_0x0adb('0x7f')]('---------------------------');if(_0x33302d['predictiveIntervalTotalCalls']>0x0){if(!_[_0x0adb('0x3b')](_0x33302d[_0x0adb('0x6c')])&&_0x33302d[_0x0adb('0x6c')]>0x0){return!![];}loggerPredictive[_0x0adb('0x7f')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x0adb('0x3b')](_0x33302d['predictiveIntervalAvgHoldtime'])&&_0x33302d[_0x0adb('0x83')]>0x0){return!![];}loggerPredictive['info'](_0x0adb('0x85'));}else{loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x86'));}}else{loggerPredictive[_0x0adb('0x7f')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xeaa34a){return function(_0x1c992d){loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x87'));loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x88'),_0x1c992d['erlangCalls']);loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x89'),_0x1c992d['erlangCallToSecond']);loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x8a'),_0x1c992d[_0x0adb('0x76')]);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1c992d[_0x0adb('0x77')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1c992d['erlangAbandonmentRate']);loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x8b'));_[_0x0adb('0x8c')](_0xeaa34a,_0x1c992d);};}function getDiff(_0x415a55){var _0x5828aa=moment()['milliseconds'](0x0);var _0x4700f3=moment(_0x415a55)[_0x0adb('0x4a')](0x0);return _0x5828aa[_0x0adb('0x8d')](_0x4700f3,_0x0adb('0x4b'));}function ifInterval(_0x4f6df9,_0x4a89ed){if(_['isUndefined'](_0x4a89ed)){return![];}return getDiff(_0x4a89ed)<_0x4f6df9*0x3c;}function freeVariablesPredictive(_0xb18fe8){if(isNotNull(_0xb18fe8)){if(!_[_0x0adb('0x3b')](_0xb18fe8['startProgressive'])){_0xb18fe8['startProgressive']=undefined;loggerPredictive[_0x0adb('0x7f')](_0xb18fe8[_0x0adb('0x3e')],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0xb18fe8[_0x0adb('0x26')])){_0xb18fe8[_0x0adb('0x26')]=undefined;loggerPredictive['info'](_0xb18fe8[_0x0adb('0x3e')],_0x0adb('0x8e'));}if(!_[_0x0adb('0x3b')](_0xb18fe8[_0x0adb('0x8f')])){clearInterval(_0xb18fe8[_0x0adb('0x8f')]);_0xb18fe8[_0x0adb('0x8f')]=undefined;loggerPredictive[_0x0adb('0x7f')](_0xb18fe8['name'],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x270df5,_0x14cdcd){if(_0x14cdcd===0x0){return 0x0;}var _0x3413ba=0x1;for(var _0x3517ce=0x1;_0x3517ce<=_0x14cdcd;_0x3517ce+=0x1){_0x3413ba=0x1+_0x3413ba*_0x3517ce/_0x270df5;}return 0x1/_0x3413ba;}function isVoiceQueueOutbound(_0x221edd){return _0x221edd===_0x0adb('0x4e');}function isNotPreview(_0x42663b){return _0x42663b!==_0x0adb('0x90');}function isCampaignIvr(_0x1222e3){return _0x1222e3==='ivr';}function getCallerId(_0x54f85d,_0x1a056d,_0x38f0bd){if(!_[_0x0adb('0x3b')](_0x38f0bd)&&typeof _0x38f0bd===_0x0adb('0x91')&&!_['isEmpty'](_0x38f0bd)){if(!_[_0x0adb('0x3b')](_0x1a056d)&&typeof _0x1a056d==='string'&&!_[_0x0adb('0x44')](_0x1a056d)){return util[_0x0adb('0x92')](_0x0adb('0x93'),_0x1a056d,_0x38f0bd);}return util[_0x0adb('0x92')](_0x0adb('0x93'),_0x38f0bd,_0x38f0bd);}if(!_['isUndefined'](_0x54f85d)&&typeof _0x54f85d===_0x0adb('0x91')&&!_[_0x0adb('0x44')](_0x54f85d)){return _0x54f85d;}return _0x0adb('0x94');}function loggerCatchQueueSummary(_0x52cb55,_0x15cbd0){return function(_0x5ce0fc){freeVariablesPredictive(_0x15cbd0);emitVoiceQueueSummary(_0x15cbd0);emitCampaignSummary(_0x15cbd0);loggerSyncQueueSummary[_0x0adb('0x95')](_0x52cb55,util[_0x0adb('0x96')](_0x5ce0fc,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x57e783,_0x2f9730){return function(_0x6635b8){loggerPredictive['error'](_0x2f9730[_0x0adb('0x3e')],_0x57e783);loggerPredictive[_0x0adb('0x95')](_0x6635b8[_0x0adb('0x97')]);freeVariablesPredictive(_0x2f9730);};}function loggerCatch(_0x20475b){return function(_0x284fe0){logger['error'](_0x20475b,util[_0x0adb('0x96')](_0x284fe0,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x483bd6){return _0x483bd6&&!_['isUndefined'](_0x483bd6)&&_0x483bd6[_0x0adb('0x98')]>0x0;}function decremetOriginate(_0x367e25){if(!_['isUndefined'](_0x367e25)&&_0x367e25!==null){if(typeof _0x367e25[_0x0adb('0x74')]!==_0x0adb('0x99')){if(_0x367e25[_0x0adb('0x74')]>0x0){_0x367e25[_0x0adb('0x74')]-=0x1;}else{logger[_0x0adb('0x95')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x0adb('0x95')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0xf30e57,_0x5f8963,_0x236b2c){if(_0x5f8963>_0x236b2c){for(var _0x27bf86=0x0;_0x27bf86<_0x5f8963-_0x236b2c;_0x27bf86+=0x1){decremetOriginate(_0xf30e57);}}}function loggerGetContactDialer(_0x1a1b96,_0x578d6b,_0x5d17d0){return function(_0x52370b){checkContactLowerLimitOriginate(_0x578d6b,_0x5d17d0,0x0);logger[_0x0adb('0x95')](_0x1a1b96,util[_0x0adb('0x96')](_0x52370b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x26935a){return function(_0x4f2c9b){if(isNotNull(_0x4f2c9b)&&isNotNull(_0x4f2c9b[0x0])){if(_0x4f2c9b[0x0][_0x0adb('0x9a')]>0x0){_0x26935a['message']=_0x0adb('0x9b');logger[_0x0adb('0x7f')]('[getContactDialer2][ReScheduled]'+_0x26935a['name'],_0x4f2c9b[0x0][_0x0adb('0x9a')],_0x0adb('0x9c'));}else{_0x26935a['message']=_0x0adb('0x9d');logger[_0x0adb('0x7f')]('[getContactDialer2][Empty]'+_0x26935a[_0x0adb('0x3e')]);}}};}function notSendMessagesQueue(_0x15d1ae){if(_0x15d1ae[_0x0adb('0x9e')]){freeVariablesPredictive(_0x15d1ae);if(_0x15d1ae['originated']===0x0&&_0x15d1ae[_0x0adb('0x57')]===0x0&&_0x15d1ae[_0x0adb('0x5b')]===0x0&&(_0x15d1ae[_0x0adb('0x53')]||0x0)===0x0){_0x15d1ae[_0x0adb('0x9e')]=![];_0x15d1ae[_0x0adb('0x51')]=0x0;_0x15d1ae[_0x0adb('0x3c')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x0adb('0x95')](_0x0adb('0x9f'),_0x15d1ae[_0x0adb('0x3e')],_0x0adb('0xa0'));}else{_0x15d1ae[_0x0adb('0x3c')]=_0x0adb('0xa1');loggerSyncQueueSummary['error'](_0x0adb('0x9f'),_0x15d1ae[_0x0adb('0x3e')],_0x0adb('0xa2'));}emitVoiceQueueSummary(_0x15d1ae);}}function notSendMessagesCampaign(_0x3fda28){if(_0x3fda28[_0x0adb('0x9e')]){if(_0x3fda28['originated']===0x0){_0x3fda28[_0x0adb('0x9e')]=![];_0x3fda28[_0x0adb('0x3c')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x0adb('0x95')](_0x0adb('0xa3'),_0x3fda28[_0x0adb('0x3e')],'is\x20not\x20active');}else{_0x3fda28[_0x0adb('0x3c')]=_0x0adb('0xa1');loggerSyncQueueSummary['error'](_0x0adb('0xa3'),_0x3fda28['name'],_0x0adb('0xa2'));}emitCampaignSummary(_0x3fda28);}}function createObjHistory(_0xd810d3,_0x2c82e4,_0x25cceb,_0x1dc61d,_0x176bab){_0xd810d3[_0x0adb('0x3c')]=_0x25cceb;var _0x5c4210=new Action(_0xd810d3,_0x2c82e4);var _0x5e92ac=new History(_0x5c4210);_0x5e92ac[_0x0adb('0xa4')]=_0x1dc61d;_0x5e92ac[_0x0adb('0xa5')]=_0x176bab;_0x5e92ac['endtime']=_0x5c4210['starttime'];return _0x5e92ac;}Dialer[_0x0adb('0x1c')][_0x0adb('0x38')]=function(){var _0x5232ca=this;setInterval(function(){_0x5232ca[_0x0adb('0xa6')](_0x5232ca[_0x0adb('0x25')],_0x0adb('0xa7'));_0x5232ca[_0x0adb('0xa6')](_0x5232ca[_0x0adb('0xa8')],'[actions]');},0x32c8);};Dialer['prototype'][_0x0adb('0xa6')]=function(_0x10c453,_0x248521){var _0x3e9ac0=this;for(var _0x4a9019 in _0x10c453){if(typeof _0x10c453[_0x4a9019]!=='undefined'){this[_0x0adb('0x1e')]['enqueue'](function(){if(!_[_0x0adb('0xa9')](_0x10c453[_0x4a9019])){return ami['Action']({'action':_0x0adb('0xaa'),'channel':_0x10c453[_0x4a9019][_0x0adb('0xab')]})['catch'](function(_0xdd49f3){if(_0xdd49f3[_0x0adb('0x3c')]===_0x0adb('0xac')){setTimeout(function(){if(_0x10c453[_0x4a9019]&&_0x10c453[_0x4a9019][_0x0adb('0x4d')]!=='ivr'){_0x3e9ac0[_0x0adb('0xad')](_0x3e9ac0['voiceQueues'][_0x10c453[_0x4a9019][_0x0adb('0xae')]]);logger['error'](_0x0adb('0xaf'),_0x248521,_0x4a9019,_0x10c453[_0x4a9019][_0x0adb('0xae')]);delete _0x10c453[_0x4a9019];}if(_0x10c453[_0x4a9019]&&_0x10c453[_0x4a9019][_0x0adb('0x4d')]===_0x0adb('0xb0')){_0x3e9ac0['updateOriginated'](_0x3e9ac0['campaigns'][_0x10c453[_0x4a9019][_0x0adb('0xae')]]);logger[_0x0adb('0x95')](_0x0adb('0xb1'),_0x248521,_0x4a9019,_0x10c453[_0x4a9019][_0x0adb('0xae')]);delete _0x10c453[_0x4a9019];}},0x2328);}});}});}}};Dialer[_0x0adb('0x1c')]['countReScheduled']=function(_0x3c2cc3){return BPromise['resolve']()[_0x0adb('0x3a')](cmHopper[_0x0adb('0xb2')](_0x3c2cc3))[_0x0adb('0xb3')](loggerCatch(_0x0adb('0xb4')));};Dialer[_0x0adb('0x1c')][_0x0adb('0xb5')]=function(_0x25f64a){return BPromise[_0x0adb('0xb6')]()[_0x0adb('0x3a')](cmHopperBlack[_0x0adb('0xb5')](_0x25f64a))['catch'](loggerCatch('[checkIsBlackList]\x20'));};Dialer['prototype'][_0x0adb('0xb7')]=function(_0x2fa418){return BPromise[_0x0adb('0xb6')]()[_0x0adb('0x3a')](cmHopperBlack['checkIsBlackListIvr'](_0x2fa418))[_0x0adb('0xb3')](loggerCatch(_0x0adb('0xb8')));};Dialer['prototype'][_0x0adb('0xb9')]=function(_0x3d449a){return BPromise[_0x0adb('0xb6')]()[_0x0adb('0x3a')](cmHopperHistory[_0x0adb('0xba')](_0x3d449a))[_0x0adb('0xb3')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x0adb('0x1c')][_0x0adb('0xbb')]=function(_0x15f9d7){return BPromise['resolve']()[_0x0adb('0x3a')](cmHopper[_0x0adb('0xbb')](_0x15f9d7))['catch'](loggerCatch(_0x0adb('0xbc')));};Dialer[_0x0adb('0x1c')][_0x0adb('0xbd')]=function(_0x13ebfb,_0x36ddde,_0x3b4154){return BPromise[_0x0adb('0xb6')]()[_0x0adb('0x3a')](cmHopper['unlockContact'](_0x13ebfb,_0x36ddde,_0x3b4154))['catch'](loggerCatch('[unlockContact]\x20'));};Dialer['prototype'][_0x0adb('0xbe')]=function(_0x6002dc,_0xd5d8ca,_0x260cd2,_0x4fadc7,_0x2d73d1){return BPromise[_0x0adb('0xb6')]()[_0x0adb('0x3a')](cmHopper['getContactDialer'](_0x6002dc,_0xd5d8ca,_0x260cd2,_0x4fadc7))[_0x0adb('0xb3')](function(_0x4c38b3){_0x2d73d1[_0x0adb('0xbf')]-=_0x260cd2;_0x2d73d1[_0x0adb('0xbf')]=_0x2d73d1[_0x0adb('0xbf')]>0x0?_0x2d73d1[_0x0adb('0xbf')]:0x0;loggerCatch(_0x0adb('0xc0'))(_0x4c38b3);});};Dialer[_0x0adb('0x1c')][_0x0adb('0xc1')]=function(_0x20386e,_0x3600ff,_0x5841ca,_0xa5c7d7){return BPromise[_0x0adb('0xb6')]()[_0x0adb('0x3a')](cmHopper['getContactDialerIvr'](_0x20386e,_0x3600ff,_0x5841ca))[_0x0adb('0xb3')](function(_0xf9f7e5){_0xa5c7d7['temp']-=_0x3600ff;_0xa5c7d7['temp']=_0xa5c7d7['temp']>0x0?_0xa5c7d7[_0x0adb('0xbf')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0xf9f7e5);});};Dialer[_0x0adb('0x1c')]['getVoiceQueueRtPauses']=function(_0x313aef){return BPromise[_0x0adb('0xb6')]()[_0x0adb('0x3a')](voiceQueueRt[_0x0adb('0xc2')](_0x313aef))[_0x0adb('0xb3')](loggerCatch(_0x0adb('0xc3')));};Dialer[_0x0adb('0x1c')][_0x0adb('0xc4')]=function(_0x209bbd){return BPromise[_0x0adb('0xb6')]()[_0x0adb('0x3a')](cmHopper[_0x0adb('0xc4')](_0x209bbd))[_0x0adb('0xb3')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype']['createHistory']=function(_0x17fc8b){return BPromise['resolve']()[_0x0adb('0x3a')](cmHopperHistory[_0x0adb('0xc5')](_0x17fc8b))[_0x0adb('0xb3')](loggerCatch(_0x0adb('0xc6')));};Dialer[_0x0adb('0x1c')][_0x0adb('0xad')]=function(_0x470be3){if(!_[_0x0adb('0x3b')](_0x470be3)&&_0x470be3!==null){if(typeof _0x470be3['originated']!==_0x0adb('0x99')){if(_0x470be3[_0x0adb('0x74')]>0x0){_0x470be3['originated']-=0x1;}else{logger['error'](_0x0adb('0xc7'));}}}else{logger[_0x0adb('0x95')](_0x0adb('0xc8'));}};Dialer[_0x0adb('0x1c')][_0x0adb('0xc9')]=function(_0x486196,_0x51d8fd){var _0x2f65a6=this;return function(_0x3eeeeb){_0x2f65a6['updateOriginated'](_0x51d8fd);logger[_0x0adb('0x95')](_0x486196,util[_0x0adb('0x96')](_0x3eeeeb,{'showHidden':![],'depth':null}));};};Dialer[_0x0adb('0x1c')][_0x0adb('0xca')]=function(_0x7a5f3e,_0x2ec272,_0x4859cf){var _0x2293ec={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x2ec272);this[_0x0adb('0xcb')](_[_0x0adb('0x8c')](_0x2293ec,_['pick'](_0x4859cf,[_0x0adb('0xcc'),'ListId','UserId','VoiceQueueId','CampaignId'])),_0x0adb('0xcd'),_0x0adb('0xce'));logger[_0x0adb('0x95')](_0x7a5f3e);};Dialer[_0x0adb('0x1c')][_0x0adb('0xcf')]=function(_0x33067a){return _0x33067a===_0x0adb('0xd0');};Dialer['prototype'][_0x0adb('0xd1')]=function(_0x18e077){return!_[_0x0adb('0x3b')](_0x18e077)&&_0x18e077&&!_[_0x0adb('0x3b')](_0x18e077['name'])&&!_[_0x0adb('0x3b')](_0x18e077[_0x0adb('0x79')])&&_0x18e077[_0x0adb('0x79')]&&(this[_0x0adb('0x22')][util[_0x0adb('0x92')]('SIP/%s',_0x18e077['name'])][_0x0adb('0xaa')]===_0x0adb('0xd2')||this[_0x0adb('0x22')][util[_0x0adb('0x92')](_0x0adb('0xd3'),_0x18e077[_0x0adb('0x3e')])]['status']==='unmonitored');};Dialer['prototype']['saveInDb']=function(_0x1d120b,_0x52cda6,_0x1a8c7a){this[_0x0adb('0xc5')](_0x1d120b)[_0x0adb('0xb3')](loggerCatch(_0x52cda6));this[_0x0adb('0xc4')](_0x1d120b)[_0x0adb('0xb3')](loggerCatch(_0x1a8c7a));};Dialer['prototype']['syncVarSet']=function(_0x2abb29){var _0x312d3f=this[_0x0adb('0x25')][_0x2abb29[_0x0adb('0xd4')]];var _0x38d5ef;if(!_[_0x0adb('0xa9')](_0x2abb29)&&!_[_0x0adb('0xa9')](_0x2abb29['variable'])&&!_['isNil'](_0x2abb29[_0x0adb('0xd5')][_0x0adb('0xd6')])&&_0x2abb29[_0x0adb('0xd7')]===_0x0adb('0xd8')&&_0x312d3f){if(_0x312d3f[_0x0adb('0x4d')]!==_0x0adb('0xb0')&&this[_0x0adb('0x1f')][_0x312d3f[_0x0adb('0xae')]]['dialAMDActive']&&_0x2abb29[_0x0adb('0xd9')]===_0x0adb('0xda')){delete this[_0x0adb('0x25')][_0x2abb29[_0x0adb('0xd4')]];this[_0x0adb('0xad')](this[_0x0adb('0x1f')][_0x312d3f[_0x0adb('0xae')]]);this['voiceQueues'][_0x312d3f[_0x0adb('0xae')]][_0x0adb('0x63')]+=0x1;this['voiceQueues'][_0x312d3f[_0x0adb('0xae')]][_0x0adb('0x62')]+=0x1;_0x38d5ef=new Hangup(_0x312d3f,_0x2abb29);_0x38d5ef['state']=0x12;_0x38d5ef[_0x0adb('0xa5')]=_0x0adb('0xdb');_0x38d5ef[_0x0adb('0xdc')]=_0x0adb('0xdd');ami['emit'](_0x0adb('0xde'),ut['buildObj'](_0x38d5ef,'amd'));this[_0x0adb('0xcb')](_0x38d5ef,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0x312d3f['type']!=='ivr'&&this[_0x0adb('0x1f')][_0x312d3f['queue']][_0x0adb('0xdf')]&&_0x2abb29[_0x0adb('0xd9')]===_0x0adb('0xe0')){var _0x5366b4=this;return new BPromise(function(_0x8e20d7,_0x2dbb88){delete _0x5366b4[_0x0adb('0x25')][_0x2abb29[_0x0adb('0xd4')]];_0x5366b4['updateOriginated'](_0x5366b4[_0x0adb('0x1f')][_0x312d3f[_0x0adb('0xae')]]);_0x5366b4[_0x0adb('0x1f')][_0x312d3f['queue']][_0x0adb('0x63')]+=0x1;_0x5366b4[_0x0adb('0x1f')][_0x312d3f[_0x0adb('0xae')]][_0x0adb('0x62')]+=0x1;var _0x4dbab2=_0x5366b4[_0x0adb('0x1f')][_0x312d3f[_0x0adb('0xae')]];var _0x1e7451=new Hangup(_0x312d3f,_0x2abb29);_0x1e7451[_0x0adb('0xa4')]=0x13;_0x1e7451[_0x0adb('0xa5')]=_0x0adb('0xe1');_0x1e7451[_0x0adb('0xdc')]='AMD';_0x1e7451[_0x0adb('0xe2')]+=0x1;_0x1e7451['countglobal']+=0x1;_0x1e7451[_0x0adb('0xe3')]=!![];ami['emit'](_0x0adb('0xde'),ut['buildObj'](_0x1e7451,_0x0adb('0xe3')));_0x5366b4[_0x0adb('0xc5')](_0x1e7451)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0xe4')));if(_0x1e7451['countbusyretry']+_0x1e7451[_0x0adb('0xe5')]+_0x1e7451[_0x0adb('0xe6')]+_0x1e7451[_0x0adb('0xe7')]+_0x1e7451['countdropretry']+_0x1e7451['countabandonedretry']+_0x1e7451[_0x0adb('0xe2')]+_0x1e7451[_0x0adb('0xe8')]>=_0x4dbab2[_0x0adb('0xe9')]){_0x5366b4[_0x0adb('0xea')](_0x1e7451,_0x8e20d7,_0x2dbb88,_0x0adb('0xeb'));}else{if(_0x1e7451[_0x0adb('0xe2')]>=_0x4dbab2[_0x0adb('0xec')]){_0x5366b4['createStateFinal'](_0x1e7451,_0x8e20d7,_0x2dbb88,'reason\x2019\x20machine....');}else{_0x5366b4[_0x0adb('0xbb')]({'active':![],'countmachineretry':_0x1e7451[_0x0adb('0xe2')],'scheduledat':moment()['add'](_0x4dbab2['dialMachineRetryFrequency'],_0x0adb('0xed'))[_0x0adb('0x92')](_0x0adb('0xee')),'ContactId':_0x1e7451[_0x0adb('0xcc')],'ListId':_0x1e7451[_0x0adb('0xef')],'VoiceQueueId':_0x1e7451[_0x0adb('0xf0')]||undefined,'CampaignId':_0x1e7451[_0x0adb('0xf1')]||undefined})[_0x0adb('0xb3')](loggerCatch(_0x0adb('0xf2')));_0x8e20d7({'reschedule':0x1});}}});}if(_0x312d3f['type']===_0x0adb('0xb0')&&this[_0x0adb('0x20')][_0x312d3f[_0x0adb('0xae')]][_0x0adb('0xdf')]&&_0x2abb29[_0x0adb('0xd9')]===_0x0adb('0xda')){delete this[_0x0adb('0x25')][_0x2abb29[_0x0adb('0xd4')]];this[_0x0adb('0xad')](this[_0x0adb('0x20')][_0x312d3f[_0x0adb('0xae')]]);_0x38d5ef=new Hangup(_0x312d3f,_0x2abb29);_0x38d5ef[_0x0adb('0xa4')]=0x12;_0x38d5ef[_0x0adb('0xa5')]=_0x0adb('0xdb');_0x38d5ef[_0x0adb('0xdc')]=_0x0adb('0xdd');ami[_0x0adb('0x4c')](_0x0adb('0xde'),ut[_0x0adb('0xf3')](_0x38d5ef,_0x0adb('0xe3')));this['saveInDb'](_0x38d5ef,_0x0adb('0xf4'),_0x0adb('0xf5'));}if(_0x312d3f[_0x0adb('0x4d')]===_0x0adb('0xb0')&&this[_0x0adb('0x20')][_0x312d3f[_0x0adb('0xae')]][_0x0adb('0xdf')]&&_0x2abb29['value']===_0x0adb('0xe0')){var _0x5366b4=this;return new BPromise(function(_0x5f15a1,_0x4449fa){delete _0x5366b4[_0x0adb('0x25')][_0x2abb29[_0x0adb('0xd4')]];_0x5366b4[_0x0adb('0xad')](_0x5366b4['campaigns'][_0x312d3f['queue']]);_0x5366b4[_0x0adb('0x20')][_0x312d3f['queue']]['outboundAnswerCallsDay']+=0x1;_0x5366b4[_0x0adb('0x20')][_0x312d3f[_0x0adb('0xae')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x5747fc=_0x5366b4[_0x0adb('0x20')][_0x312d3f[_0x0adb('0xae')]];var _0xf5691=new Hangup(_0x312d3f,_0x2abb29);_0xf5691[_0x0adb('0xa4')]=0x13;_0xf5691[_0x0adb('0xa5')]='Machine';_0xf5691[_0x0adb('0xdc')]=_0x0adb('0xdd');_0xf5691['countmachineretry']+=0x1;_0xf5691['countglobal']+=0x1;_0xf5691[_0x0adb('0xe3')]=!![];ami[_0x0adb('0x4c')](_0x0adb('0xde'),ut[_0x0adb('0xf3')](_0xf5691,_0x0adb('0xe3')));_0x5366b4[_0x0adb('0xc5')](_0xf5691)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0xe4')));if(_0xf5691[_0x0adb('0xf6')]+_0xf5691[_0x0adb('0xe5')]+_0xf5691[_0x0adb('0xe6')]+_0xf5691[_0x0adb('0xe7')]+_0xf5691[_0x0adb('0xf7')]+_0xf5691[_0x0adb('0xf8')]+_0xf5691[_0x0adb('0xe2')]+_0xf5691[_0x0adb('0xe8')]>=_0x5747fc[_0x0adb('0xe9')]){_0x5366b4['stateGlobal'](_0xf5691,_0x5f15a1,_0x4449fa,'reason19\x20machine....');}else{if(_0xf5691[_0x0adb('0xe2')]>=_0x5747fc[_0x0adb('0xec')]){_0x5366b4[_0x0adb('0xf9')](_0xf5691,_0x5f15a1,_0x4449fa,_0x0adb('0xfa'));}else{_0x5366b4[_0x0adb('0xbb')]({'active':![],'countmachineretry':_0xf5691['countmachineretry'],'scheduledat':moment()['add'](_0x5747fc['dialMachineRetryFrequency'],_0x0adb('0xed'))[_0x0adb('0x92')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xf5691[_0x0adb('0xcc')],'ListId':_0xf5691[_0x0adb('0xef')],'VoiceQueueId':_0xf5691[_0x0adb('0xf0')]||undefined,'CampaignId':_0xf5691[_0x0adb('0xf1')]||undefined})['catch'](loggerCatch(_0x0adb('0xf2')));_0x5f15a1({'reschedule':0x1});}}});}}};Dialer[_0x0adb('0x1c')][_0x0adb('0x33')]=function(_0x4d070b){var _0x3a2812=this[_0x0adb('0x25')][_0x4d070b[_0x0adb('0xd4')]];var _0x4b156a=this;var _0x36b906;if(_0x3a2812&&_0x3a2812[_0x0adb('0x4d')]===_0x0adb('0xb0')){delete this['uniqueId'][_0x4d070b[_0x0adb('0xd4')]];this[_0x0adb('0xad')](this[_0x0adb('0x20')][_0x3a2812[_0x0adb('0xae')]]);this[_0x0adb('0x20')][_0x3a2812[_0x0adb('0xae')]][_0x0adb('0xfb')]+=0x1;_0x36b906=new Hangup(_0x3a2812,_0x4d070b);this['createHistory'](_0x36b906)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0xfc')));this['moveContactManagedDialer'](_0x36b906)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0xfd')));}if(_0x3a2812&&_0x3a2812['type']!==_0x0adb('0xb0')&&isNotNull(this[_0x0adb('0x1f')][_0x3a2812[_0x0adb('0xae')]][_0x0adb('0xfe')])){delete this[_0x0adb('0x25')][_0x4d070b['uniqueid']];this[_0x0adb('0xad')](this[_0x0adb('0x1f')][_0x3a2812[_0x0adb('0xae')]]);this['voiceQueues'][_0x3a2812[_0x0adb('0xae')]][_0x0adb('0x63')]+=0x1;this[_0x0adb('0x1f')][_0x3a2812[_0x0adb('0xae')]][_0x0adb('0x62')]+=0x1;_0x36b906=new Hangup(_0x3a2812,_0x4d070b);_0x36b906['state']=0x10;_0x36b906[_0x0adb('0xa5')]=_0x0adb('0xff');_0x36b906[_0x0adb('0xdc')]=_0x0adb('0x100');this[_0x0adb('0xc5')](_0x36b906)['catch'](loggerCatch(_0x0adb('0xfc')));this['moveContactManagedDialer'](_0x36b906)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0xfd')));}if(_0x3a2812&&_0x3a2812[_0x0adb('0x4d')]!==_0x0adb('0xb0')&&!isNotNull(this[_0x0adb('0x1f')][_0x3a2812['queue']][_0x0adb('0xfe')])){delete this[_0x0adb('0x25')][_0x4d070b[_0x0adb('0xd4')]];this[_0x0adb('0xad')](this[_0x0adb('0x1f')][_0x3a2812[_0x0adb('0xae')]]);this[_0x0adb('0x1f')][_0x3a2812['queue']][_0x0adb('0x6b')]+=0x1;_0x36b906=new Hangup(_0x3a2812,_0x4d070b);_0x36b906[_0x0adb('0xa4')]=0xc;_0x36b906['statedesc']=_0x4d070b[_0x0adb('0x101')];_0x36b906[_0x0adb('0xdc')]=_0x0adb('0x102');this[_0x0adb('0xc5')](_0x36b906)['catch'](loggerCatch(_0x0adb('0xfc')));this['moveContactManagedDialer'](_0x36b906)['catch'](loggerCatch(_0x0adb('0xfd')));}};Dialer[_0x0adb('0x1c')][_0x0adb('0x30')]=function(_0x14d08c){var _0x2c5d10=this['uniqueId'][_0x14d08c[_0x0adb('0xd4')]];var _0x528f21=this;if(this['voiceQueues'][_0x14d08c[_0x0adb('0xae')]]){if(_0x2c5d10&&_0x2c5d10[_0x0adb('0x4d')]!==_0x0adb('0xb0')){delete this[_0x0adb('0x25')][_0x14d08c['uniqueid']];this[_0x0adb('0x1f')][_0x14d08c['queue']]['outboundAnswerCallsDay']+=0x1;var _0x18202e=new AgentComplete(_0x2c5d10,_0x14d08c);if(_0x14d08c[_0x0adb('0x103')]==='agent'){_0x18202e[_0x0adb('0x104')]=this[_0x0adb('0x1f')][_0x14d08c[_0x0adb('0xae')]][_0x0adb('0x105')]&&this[_0x0adb('0x1f')][_0x14d08c[_0x0adb('0xae')]]['dialAgiAfterHangupAgent']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x0adb('0xc5')](_0x18202e)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x106')));this[_0x0adb('0xc4')](_0x18202e)[_0x0adb('0xb3')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x0adb('0x1c')][_0x0adb('0x2b')]=function(_0x1bba5c){if(this[_0x0adb('0x1f')][_0x1bba5c[_0x0adb('0xae')]]){if(this[_0x0adb('0x25')][_0x1bba5c['uniqueid']]&&this[_0x0adb('0x25')][_0x1bba5c['uniqueid']][_0x0adb('0x4d')]!==_0x0adb('0xb0')){this['updateOriginated'](this['voiceQueues'][_0x1bba5c[_0x0adb('0xae')]]);this[_0x0adb('0x25')][_0x1bba5c[_0x0adb('0xd4')]][_0x0adb('0x107')]=moment()['format'](_0x0adb('0xee'));}}};Dialer[_0x0adb('0x1c')][_0x0adb('0x108')]=function(_0x291a73){this['createHistory'](_0x291a73)['catch'](loggerCatch(_0x0adb('0x106')));this[_0x0adb('0xc4')](_0x291a73)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x109')));};Dialer[_0x0adb('0x1c')]['syncQueueCallerAbandon']=function(_0x339a96){var _0x55b01c=this[_0x0adb('0x25')][_0x339a96[_0x0adb('0xd4')]];var _0x3f3650=this;if(this['voiceQueues'][_0x339a96['queue']]){if(_0x55b01c&&_0x55b01c[_0x0adb('0x4d')]!==_0x0adb('0xb0')){delete this[_0x0adb('0x25')][_0x339a96[_0x0adb('0xd4')]];this[_0x0adb('0xad')](this[_0x0adb('0x1f')][_0x339a96[_0x0adb('0xae')]]);_0x55b01c[_0x0adb('0x10a')]=moment()[_0x0adb('0x92')](_0x0adb('0xee'));var _0x5691b7=new QueueCallerAbandon(_0x55b01c,_0x339a96);if(getSeconds(_0x55b01c['droptime'],_0x55b01c['responsetime'])>=_0x55b01c[_0x0adb('0x10b')]){this[_0x0adb('0x1f')][_0x339a96[_0x0adb('0xae')]][_0x0adb('0x6e')]+=0x1;this[_0x0adb('0x1f')][_0x339a96[_0x0adb('0xae')]][_0x0adb('0x10c')]+=0x1;this[_0x0adb('0x1f')][_0x339a96[_0x0adb('0xae')]][_0x0adb('0x10d')]+=0x1;_0x5691b7['state']=0xa;_0x5691b7[_0x0adb('0xa5')]='Drop';_0x5691b7['dropreason']='TIMEOUT';_0x5691b7['agiafterat']=this['voiceQueues'][_0x339a96['queue']][_0x0adb('0x105')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x5691b7[_0x0adb('0xf7')]+=0x1;_0x5691b7[_0x0adb('0x10e')]+=0x1;if(_0x5691b7[_0x0adb('0xf7')]>=this[_0x0adb('0x1f')][_0x339a96['queue']][_0x0adb('0x10f')]){this[_0x0adb('0x108')](_0x5691b7);}else{this[_0x0adb('0xbb')]({'active':![],'countdropretry':_0x5691b7[_0x0adb('0xf7')],'scheduledat':moment()[_0x0adb('0x110')](this[_0x0adb('0x1f')][_0x339a96[_0x0adb('0xae')]][_0x0adb('0x111')],_0x0adb('0xed'))[_0x0adb('0x92')](_0x0adb('0xee')),'ContactId':_0x55b01c[_0x0adb('0xcc')],'ListId':_0x55b01c[_0x0adb('0xef')],'VoiceQueueId':_0x55b01c[_0x0adb('0xf0')]||undefined,'CampaignId':_0x55b01c['CampaignId']||undefined})[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x112')));var _0x567700=new History(_0x5691b7);_0x567700[_0x0adb('0xa4')]=0xa;_0x567700[_0x0adb('0xa5')]=_0x0adb('0x113');_0x567700[_0x0adb('0x114')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x567700[_0x0adb('0x115')]=_0x567700[_0x0adb('0x114')];_0x567700[_0x0adb('0x116')]=_0x5691b7[_0x0adb('0x116')];_0x567700[_0x0adb('0x117')]=_0x5691b7['calleridnum'];this[_0x0adb('0xc5')](_0x567700)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x118')));}}else{this['voiceQueues'][_0x339a96['queue']][_0x0adb('0x6d')]+=0x1;this[_0x0adb('0x1f')][_0x339a96['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x5691b7[_0x0adb('0xa4')]=0xb;_0x5691b7['statedesc']=_0x0adb('0x119');_0x5691b7['dropreason']=_0x0adb('0x11a');_0x5691b7[_0x0adb('0xf8')]+=0x1;_0x5691b7['countglobal']+=0x1;if(_0x5691b7['countabandonedretry']>=this[_0x0adb('0x1f')][_0x339a96['queue']]['dialAbandonedMaxRetry']){this[_0x0adb('0x108')](_0x5691b7);}else{this[_0x0adb('0xbb')]({'active':![],'countabandonedretry':_0x5691b7[_0x0adb('0xf8')],'scheduledat':moment()[_0x0adb('0x110')](this[_0x0adb('0x1f')][_0x339a96[_0x0adb('0xae')]]['dialAbandonedRetryFrequency'],'minutes')[_0x0adb('0x92')](_0x0adb('0xee')),'ContactId':_0x55b01c[_0x0adb('0xcc')],'ListId':_0x55b01c['ListId'],'VoiceQueueId':_0x55b01c[_0x0adb('0xf0')]||undefined,'CampaignId':_0x55b01c[_0x0adb('0xf1')]||undefined})[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x11b')));var _0x567700=new History(_0x5691b7);_0x567700[_0x0adb('0xa4')]=0xb;_0x567700['statedesc']='Abandoned';_0x567700[_0x0adb('0x114')]=moment()[_0x0adb('0x92')](_0x0adb('0xee'));_0x567700[_0x0adb('0x115')]=_0x567700[_0x0adb('0x114')];_0x567700['calleridname']=_0x5691b7['calleridname'];_0x567700[_0x0adb('0x117')]=_0x5691b7[_0x0adb('0x117')];this[_0x0adb('0xc5')](_0x567700)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x11c')));}}}}};Dialer[_0x0adb('0x1c')]['syncNewExten']=function(_0x602be3){if(this[_0x0adb('0xa8')][_0x602be3[_0x0adb('0xd4')]]){this[_0x0adb('0xa8')][_0x602be3[_0x0adb('0xd4')]]['channel']=_0x602be3['channel'];}if(this[_0x0adb('0x25')][_0x602be3[_0x0adb('0xd4')]]){this[_0x0adb('0x25')][_0x602be3[_0x0adb('0xd4')]][_0x0adb('0xab')]=_0x602be3[_0x0adb('0xab')];}};Dialer[_0x0adb('0x1c')][_0x0adb('0x37')]=function(_0x41a84d){if(strategy[this[_0x0adb('0x1f')][this['actions'][_0x41a84d[_0x0adb('0x11d')]][_0x0adb('0xae')]]['strategy']]==='roundrobin'){if(this[_0x0adb('0xa8')][_0x41a84d['actionid']]&&_[_0x0adb('0xa9')](this[_0x0adb('0xa8')][_0x41a84d[_0x0adb('0x11d')]][_0x0adb('0x11e')])&&_0x41a84d['status']==='1'&&_0x41a84d[_0x0adb('0x11f')]==='0'){if(this['agents'][_0x41a84d[_0x0adb('0x120')]]){if(!this['agents'][_0x41a84d[_0x0adb('0x120')]][_0x0adb('0x11e')]){this['agents'][_0x41a84d[_0x0adb('0x120')]][_0x0adb('0x11e')]=!![];this['actions'][_0x41a84d[_0x0adb('0x11d')]][_0x0adb('0x11e')]=!![];this['actions'][_0x41a84d[_0x0adb('0x11d')]]['stateinterface']=_0x41a84d[_0x0adb('0x120')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x41a84d[_0x0adb('0x11d')]][_0x0adb('0xae')]][_0x0adb('0x4f')]]||_0x0adb('0x1a'))===_0x0adb('0x1a')){if(this[_0x0adb('0xa8')][_0x41a84d[_0x0adb('0x11d')]]){if(this[_0x0adb('0x21')][_0x41a84d[_0x0adb('0x120')]]){this['actions'][_0x41a84d['actionid']][_0x0adb('0x120')]=_0x41a84d[_0x0adb('0x120')];if(_[_0x0adb('0xa9')](this[_0x0adb('0x29')][this[_0x0adb('0xa8')][_0x41a84d['actionid']][_0x0adb('0xae')]])){this[_0x0adb('0x29')][this[_0x0adb('0xa8')][_0x41a84d['actionid']]['queue']]=[];}this['queueBooked'][this[_0x0adb('0xa8')][_0x41a84d['actionid']]['queue']][_0x0adb('0x121')](_[_0x0adb('0x8c')](_['pick'](this[_0x0adb('0xa8')][_0x41a84d[_0x0adb('0x11d')]],[_0x0adb('0x122'),'stateinterface']),{'status':_0x41a84d[_0x0adb('0xaa')],'paused':_0x41a84d[_0x0adb('0x11f')]}));}}}};function unlockQueueStatus(_0x5be876,_0x68aa5){setTimeout(function(){if(_['isUndefined'](_0x5be876[_0x0adb('0x123')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x68aa5);}_0x5be876[_0x0adb('0x123')]=!![];loggerBooked[_0x0adb('0x7f')](_0x0adb('0x124'),_0x68aa5,JSON[_0x0adb('0x49')](_['pick'](_0x5be876,['name',_0x0adb('0x123')])));},0x1f3);}Dialer[_0x0adb('0x1c')]['syncQueueStatusComplete']=function(_0x28edfa){var _0x3ef7f7=this;var _0x2304f4=_0x3ef7f7[_0x0adb('0x1f')][_0x3ef7f7['actions'][_0x28edfa['actionid']][_0x0adb('0xae')]];if(strategy[this[_0x0adb('0x1f')][this[_0x0adb('0xa8')][_0x28edfa[_0x0adb('0x11d')]][_0x0adb('0xae')]][_0x0adb('0x4f')]]===_0x0adb('0x1b')){if(this[_0x0adb('0xa8')][_0x28edfa[_0x0adb('0x11d')]]&&this[_0x0adb('0xa8')][_0x28edfa[_0x0adb('0x11d')]][_0x0adb('0x120')]){this['preview'][_0x0adb('0x125')](this[_0x0adb('0xa8')][_0x28edfa[_0x0adb('0x11d')]][_0x0adb('0x122')],this['actions'][_0x28edfa['actionid']][_0x0adb('0x120')])[_0x0adb('0xb3')](function(_0xf447f8){logger[_0x0adb('0x95')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x0adb('0x96')](_0xf447f8,{'showHidden':![],'depth':null}));})[_0x0adb('0x126')](function(){_0x3ef7f7[_0x0adb('0xad')](_0x3ef7f7[_0x0adb('0x1f')][_0x3ef7f7[_0x0adb('0xa8')][_0x28edfa['actionid']][_0x0adb('0xae')]]);_0x3ef7f7[_0x0adb('0x21')][_0x3ef7f7['actions'][_0x28edfa[_0x0adb('0x11d')]]['stateinterface']][_0x0adb('0x11e')]=![];delete _0x3ef7f7[_0x0adb('0xa8')][_0x28edfa['actionid']];unlockQueueStatus(_0x2304f4);});}else{this[_0x0adb('0xad')](this[_0x0adb('0x1f')][this[_0x0adb('0xa8')][_0x28edfa[_0x0adb('0x11d')]][_0x0adb('0xae')]]);this[_0x0adb('0xbb')]({'active':![],'ContactId':this[_0x0adb('0xa8')][_0x28edfa[_0x0adb('0x11d')]][_0x0adb('0xcc')],'ListId':this[_0x0adb('0xa8')][_0x28edfa[_0x0adb('0x11d')]][_0x0adb('0xef')],'VoiceQueueId':this[_0x0adb('0xa8')][_0x28edfa[_0x0adb('0x11d')]][_0x0adb('0xf0')]||undefined,'CampaignId':this['actions'][_0x28edfa[_0x0adb('0x11d')]][_0x0adb('0xf1')]||undefined})[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x127')));delete this[_0x0adb('0xa8')][_0x28edfa[_0x0adb('0x11d')]];unlockQueueStatus(_0x2304f4);}}else if((strategy[this[_0x0adb('0x1f')][this['actions'][_0x28edfa[_0x0adb('0x11d')]][_0x0adb('0xae')]][_0x0adb('0x4f')]]||_0x0adb('0x1a'))==='rrmemory'){var _0x2df1e1;if(this[_0x0adb('0xa8')][_0x28edfa[_0x0adb('0x11d')]]&&!_[_0x0adb('0x44')](this['queueBooked'][this['actions'][_0x28edfa[_0x0adb('0x11d')]]['queue']])){if(this[_0x0adb('0x128')][_0x3ef7f7['actions'][_0x28edfa[_0x0adb('0x11d')]][_0x0adb('0xae')]]){this[_0x0adb('0x128')][_0x3ef7f7[_0x0adb('0xa8')][_0x28edfa[_0x0adb('0x11d')]][_0x0adb('0xae')]]=this['queueBookedRR'][this[_0x0adb('0xa8')][_0x28edfa[_0x0adb('0x11d')]][_0x0adb('0xae')]]?this[_0x0adb('0x128')][this[_0x0adb('0xa8')][_0x28edfa['actionid']][_0x0adb('0xae')]]:this[_0x0adb('0x29')][this['actions'][_0x28edfa[_0x0adb('0x11d')]][_0x0adb('0xae')]]?this[_0x0adb('0x29')][this['actions'][_0x28edfa[_0x0adb('0x11d')]]['queue']][_0x0adb('0x129')]||0x0:0x0;}this['queueBooked'][this[_0x0adb('0xa8')][_0x28edfa[_0x0adb('0x11d')]][_0x0adb('0xae')]]['_rr']=this[_0x0adb('0x128')][this[_0x0adb('0xa8')][_0x28edfa['actionid']][_0x0adb('0xae')]];for(var _0x2fa716=0x0;_0x2fa716=0x0;})[_0x0adb('0xb3')](myreject(_0xf7e4a8)));}}else{_0x342894[_0x0adb('0x121')](ami[_0x0adb('0x141')]({'action':_0x0adb('0x142'),'command':util[_0x0adb('0x92')](_0x0adb('0x143'),_0x358d8a,!_[_0x0adb('0x3b')](config[_0x0adb('0x13e')][_0x1ce6cf])?_0x1ce6cf:'')})['then'](function(_0x38b57b){return _0x38b57b[_0x0adb('0x145')][_0x0adb('0x146')](_0x0adb('0x147'))>=0x0;})[_0x0adb('0xb3')](myreject(_0xf7e4a8)));}BPromise[_0x0adb('0x148')](_0x342894)['then'](function(_0x1463ce){var _0x1cd096=_[_0x0adb('0x149')](_0x1463ce);if(_0x1cd096){return _0x1f7376(_0x1cd096);}else{_0x471c8a[_0x0adb('0x3c')]=_0x554c6e?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0xf7e4a8(msgResponse(_0x0adb('0x14a'),_0x0adb('0x13a'),_0x0adb('0x14b')+_0x554c6e+'\x20'+_0x4680ec+_0x0adb('0x14c')+util[_0x0adb('0x96')](_0x358d8a,{'showHidden':![],'depth':null})+_0x0adb('0x14d')+_0x1ce6cf));}})['catch'](function(_0x596659){return _0xf7e4a8(msgResponse('ifTime',_0x0adb('0x13a'),JSON[_0x0adb('0x49')](_0x596659)));});});};Dialer['prototype'][_0x0adb('0x14e')]=function(_0x466685){var _0x1a8a63=this;return function(){switch(_0x466685[_0x0adb('0x5d')]){case'progressive':freeVariablesPredictive(_0x466685);_0x1a8a63[_0x0adb('0x14f')](_0x466685,0x1);break;case _0x0adb('0x150'):freeVariablesPredictive(_0x466685);_0x1a8a63['handlePower'](_0x466685,_0x466685['dialPowerLevel']);break;case'predictive':_0x1a8a63['predictive'](_0x466685);break;case _0x0adb('0xa'):freeVariablesPredictive(_0x466685);_0x1a8a63[_0x0adb('0x14f')](_0x466685,0x1);break;default:freeVariablesPredictive(_0x466685);logger[_0x0adb('0x95')](_0x0adb('0x151'),_0x466685[_0x0adb('0x3e')],_0x0adb('0x152'));}};};Dialer[_0x0adb('0x1c')]['checkPreviewRecallReminder']=function(_0x5a95ec){return BPromise['resolve']()['then'](cmHopper[_0x0adb('0x153')](_0x5a95ec['id'],previewRecallmeReminderInterval))[_0x0adb('0x3a')](function(_0xe40ac8){for(var _0x215921=0x0;_0x215921<_0xe40ac8[_0x0adb('0x98')];_0x215921++){var _0x477d1a=_0xe40ac8[_0x215921][_0x0adb('0x154')][_0x0adb('0x3e')];if(_0x477d1a)io['to'](util['format']('user:%s',_0x477d1a))[_0x0adb('0x4c')](_0x0adb('0x155'),{'hopper':_0xe40ac8[_0x215921]});}})['catch'](function(_0x5a0a87){});};Dialer[_0x0adb('0x1c')]['launchHandleIvr']=function(_0x49cf66){var _0x3df456=this;return function(){_0x3df456['handleIvr'](_0x49cf66);};};Dialer[_0x0adb('0x1c')][_0x0adb('0xd')]=function(_0x356eee){var _0xaccea6=this;if(isNotPreview(_0x356eee[_0x0adb('0x5d')])){if(isVoiceQueueOutbound(_0x356eee[_0x0adb('0x4d')])&&isActive(_0x356eee['dialActive'])){_0x356eee['sendMessageOneNotActive']=!![];BPromise[_0x0adb('0xb6')]()[_0x0adb('0x3a')](checkIsLoggedIn(_0x356eee,_0x356eee[_0x0adb('0x52')]))[_0x0adb('0x3a')](checkIsActive(_0x356eee,_0x356eee[_0x0adb('0x156')]))[_0x0adb('0x3a')](checkInterval(_0x356eee))['then'](_0xaccea6[_0x0adb('0x135')](_0x356eee))[_0x0adb('0x3a')](_0xaccea6[_0x0adb('0x138')](_0x356eee[_0x0adb('0x157')],_0x356eee['dialTimezone'],_0x356eee['name'],_0x356eee))['then'](_0xaccea6[_0x0adb('0x158')](_0x356eee[_0x0adb('0x42')],_0x356eee[_0x0adb('0x159')],_0x356eee[_0x0adb('0x3e')],_0x356eee))[_0x0adb('0x3a')](_0xaccea6[_0x0adb('0x14e')](_0x356eee))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x356eee));}else{notSendMessagesQueue(_0x356eee);}}else{freeVariablesPredictive(_0x356eee);if(_0x356eee[_0x0adb('0x15a')]){_0xaccea6[_0x0adb('0x15b')](_0x356eee);}}};Dialer[_0x0adb('0x1c')][_0x0adb('0x15c')]=function(){var _0x35d12e=this;var _0x3ce210;for(var _0x36ce4d in this[_0x0adb('0x20')]){if(typeof this['campaigns'][_0x36ce4d]!==_0x0adb('0x99')){_0x3ce210=this[_0x0adb('0x20')][_0x36ce4d];if(isCampaignIvr(_0x3ce210[_0x0adb('0x4d')])&&isActive(_0x3ce210[_0x0adb('0x79')])){_0x3ce210[_0x0adb('0x9e')]=!![];BPromise[_0x0adb('0xb6')]()[_0x0adb('0x3a')](checkIsActive(_0x3ce210,_0x3ce210[_0x0adb('0x79')]))['then'](checkInterval(_0x3ce210))[_0x0adb('0x3a')](_0x35d12e[_0x0adb('0x135')](_0x3ce210))['then'](_0x35d12e[_0x0adb('0x138')](_0x3ce210[_0x0adb('0x157')],_0x3ce210[_0x0adb('0x159')],_0x3ce210[_0x0adb('0x3e')],_0x3ce210))[_0x0adb('0x3a')](_0x35d12e['checkIfTimeIntervals'](_0x3ce210[_0x0adb('0x42')],_0x3ce210['dialTimezone'],_0x3ce210[_0x0adb('0x3e')],_0x3ce210))[_0x0adb('0x3a')](_0x35d12e[_0x0adb('0x15d')](_0x3ce210))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x3ce210));}else{notSendMessagesCampaign(_0x3ce210);}}}};function getCallerIdRandom(_0x89673f,_0x270f2f){var _0x19a7c5;var _0x14ea4b;var _0x1d4012;if(_0x270f2f<=0x0){_0x270f2f=0x1;}_0x19a7c5=new RegExp(_0x0adb('0x15e')+_0x270f2f+'}$');_0x14ea4b=Math['pow'](0xa,_0x270f2f-0x1);_0x1d4012=Math[_0x0adb('0x15f')](0xa,_0x270f2f)-0x1;return util[_0x0adb('0x92')]('%s',_['replace'](_0x89673f,_0x19a7c5,_[_0x0adb('0x160')](_0x14ea4b,_0x1d4012)));}function extractCalleridName(_0x37c252){var _0x282a60=_0x37c252[_0x0adb('0x161')](/"(.*?)"/);return _0x282a60?_0x282a60[0x1]:_0x37c252;}function extractCalleridNumber(_0x5c0c48){var _0x892bb1=_0x5c0c48[_0x0adb('0x161')](/<(.*?)>/);return _0x892bb1?_0x892bb1[0x1]:_0x5c0c48;}Dialer[_0x0adb('0x1c')][_0x0adb('0x162')]=function(_0x4f6e9d,_0x279817){var _0x31018e=this;var _0x5782eb=uuid['v4']();this[_0x0adb('0xa8')][_0x5782eb]=new Action(_0x4f6e9d,_0x279817,_0x5782eb);return new BPromise(function(_0x18d193,_0x245a09){if(_[_0x0adb('0x3b')](_0x4f6e9d)&&typeof _0x4f6e9d!=='object'){return _0x245a09(msgResponse('originate',_0x0adb('0x13a'),_0x0adb('0x163')));}if(_['isUndefined'](_0x279817['Contact']['phone'])||_0x279817['Contact'][_0x0adb('0x164')]===null){return _0x245a09(msgResponse(_0x0adb('0x165'),'Failure',_0x0adb('0x166')));}var _0x36680e={'XMD-CALLERID':_0x31018e['actions'][_0x5782eb][_0x0adb('0x167')](),'XMD-AGI':_0x4f6e9d[_0x0adb('0xfe')]?util[_0x0adb('0x92')](_0x0adb('0x168'),ipAgi,_0x4f6e9d['dialQueueProject']):_0x0adb('0x169'),'XMD-AGIAFTER':_0x4f6e9d['dialQueueProject2']?util[_0x0adb('0x92')](_0x0adb('0x168'),ipAgi,_0x4f6e9d[_0x0adb('0x105')]):_0x0adb('0x169'),'XMD-QUEUE':_0x4f6e9d[_0x0adb('0x4d')]===_0x0adb('0x4e')?util[_0x0adb('0x92')](_0x0adb('0x16a'),_0x4f6e9d['name'],_0x4f6e9d[_0x0adb('0x16b')]||'',_0x4f6e9d[_0x0adb('0x16c')]?'c':'',_0x4f6e9d[_0x0adb('0x10b')]||0x3):'NONE','XMD-CONTACTID':_0x279817['ContactId'],'XMD-CDRTYPE':_0x0adb('0x9'),'CALLERID(all)':_0x31018e[_0x0adb('0xa8')][_0x5782eb]['getCaller'](),'XMD-AMD':_0x4f6e9d[_0x0adb('0xdf')]?_0x0adb('0x16d'):_0x0adb('0x169'),'XMD-DESTINATION':_0x0adb('0xd8')};if(_0x4f6e9d[_0x0adb('0xdf')]){_0x36680e[_0x0adb('0x16e')]=_0x4f6e9d['dialAMDInitialSilence']||0x9c4;_0x36680e[_0x0adb('0x16f')]=_0x4f6e9d[_0x0adb('0x170')]||0x5dc;_0x36680e[_0x0adb('0x171')]=_0x4f6e9d[_0x0adb('0x172')]||0x320;_0x36680e[_0x0adb('0x173')]=_0x4f6e9d[_0x0adb('0x174')]||0x1388;_0x36680e[_0x0adb('0x175')]=_0x4f6e9d[_0x0adb('0x176')]||0x64;_0x36680e[_0x0adb('0x177')]=_0x4f6e9d[_0x0adb('0x178')]||0x32;_0x36680e[_0x0adb('0x179')]=_0x4f6e9d[_0x0adb('0x17a')]||0x3;_0x36680e['XMD-AMDSILENCETHRESHOLD']=_0x4f6e9d[_0x0adb('0x17b')]||0x100;_0x36680e[_0x0adb('0x17c')]=_0x4f6e9d[_0x0adb('0x17d')]||0x1388;}if(_0x4f6e9d['type']===_0x0adb('0x4e')){_0x36680e[_0x0adb('0x17e')]=_0x279817[_0x0adb('0xf0')];}else{_0x36680e[_0x0adb('0x17f')]=_0x279817[_0x0adb('0xf1')];}for(var _0x147367 in _0x279817[_0x0adb('0x180')]){if(typeof _0x279817[_0x0adb('0x180')][_0x147367]!=='undefined'){if(isNotNull(_0x279817[_0x0adb('0x180')][_0x147367])&&_0x147367!=='id'&&_0x147367!==_0x0adb('0x181')&&_0x147367!==_0x0adb('0x182')&&_0x147367!==_0x0adb('0x183')){_0x36680e[util['format'](_0x0adb('0x184'),_0x0adb('0x185'),_[_0x0adb('0x186')](_0x147367))]=_0x279817[_0x0adb('0x180')][_0x147367];}}}var _0x528eef=_0x31018e[_0x0adb('0xd1')](_0x4f6e9d[_0x0adb('0x78')])?getCallerId(_0x4f6e9d['Trunk'][_0x0adb('0x7a')],_0x4f6e9d[_0x0adb('0x5e')],_0x4f6e9d['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4f6e9d['dialOriginateCallerIdNumber'],_0x4f6e9d[_0x0adb('0x187')]):_0x4f6e9d['dialOriginateCallerIdNumber']):getCallerId(_[_0x0adb('0xa9')](_0x4f6e9d[_0x0adb('0x136')])?_0x4f6e9d[_0x0adb('0x78')][_0x0adb('0x7a')]:_0x4f6e9d['TrunkBackup'][_0x0adb('0x7a')],_0x4f6e9d[_0x0adb('0x5e')],_0x4f6e9d[_0x0adb('0x187')]>0x0?getCallerIdRandom(_0x4f6e9d[_0x0adb('0x5f')],_0x4f6e9d['dialRandomLastDigitCallerIdNumber']):_0x4f6e9d[_0x0adb('0x5f')]);if(_0x528eef){_0x36680e[_0x0adb('0x188')]=_0x31018e[_0x0adb('0xa8')][_0x5782eb]['originatecalleridname']=extractCalleridName(_0x528eef);_0x36680e[_0x0adb('0x189')]=_0x31018e['actions'][_0x5782eb][_0x0adb('0x18a')]=extractCalleridNumber(_0x528eef);}return ami[_0x0adb('0x141')]({'actionid':_0x5782eb,'action':_0x0adb('0x165'),'channel':_0x31018e[_0x0adb('0xd1')](_0x4f6e9d['Trunk'])?util[_0x0adb('0x92')](_0x0adb('0x18b'),_0x4f6e9d[_0x0adb('0x78')][_0x0adb('0x3e')],isNotNull(_0x4f6e9d['dialPrefix'])?_0x4f6e9d[_0x0adb('0x61')][_0x0adb('0x18c')]()||'':'',_0x4f6e9d[_0x0adb('0x18d')]>0x0?_0x279817[_0x0adb('0x180')][_0x0adb('0x164')][_0x0adb('0x18e')](_0x4f6e9d[_0x0adb('0x18d')]):_0x279817[_0x0adb('0x180')][_0x0adb('0x164')]):util['format']('SIP/%s/%s%s',_[_0x0adb('0xa9')](_0x4f6e9d[_0x0adb('0x136')])?_0x4f6e9d[_0x0adb('0x78')][_0x0adb('0x3e')]:_0x4f6e9d[_0x0adb('0x136')][_0x0adb('0x3e')],isNotNull(_0x4f6e9d[_0x0adb('0x61')])?_0x4f6e9d['dialPrefix'][_0x0adb('0x18c')]()||'':'',_0x4f6e9d['dialCutDigit']>0x0?_0x279817[_0x0adb('0x180')]['phone']['substring'](_0x4f6e9d['dialCutDigit']):_0x279817['Contact'][_0x0adb('0x164')]),'callerid':_0x528eef,'Exten':_0x0adb('0xd8'),'Context':'from-sip','Priority':'1','variable':_0x36680e,'timeout':(_0x4f6e9d[_0x0adb('0x60')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5782eb})[_0x0adb('0x3a')](function(_0x381307){return _0x18d193(_0x381307);})['catch'](function(_0x5bf2a2){_0x4f6e9d[_0x0adb('0x68')]+=0x1;var _0x10c7c5=new History(_0x31018e['actions'][_0x5782eb]);logger[_0x0adb('0x95')](util[_0x0adb('0x92')](_0x0adb('0x18f'),JSON[_0x0adb('0x49')](_0x5bf2a2)));_0x10c7c5[_0x0adb('0xa4')]=0xe;_0x10c7c5[_0x0adb('0xa5')]=_0x0adb('0x190');_0x10c7c5[_0x0adb('0x114')]=moment()[_0x0adb('0x92')](_0x0adb('0xee'));_0x10c7c5[_0x0adb('0x115')]=_0x10c7c5[_0x0adb('0x114')];_0x31018e[_0x0adb('0xc5')](_0x10c7c5)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x191')));_0x31018e[_0x0adb('0xc4')](_0x10c7c5)['catch'](loggerCatch('[originate][error]'))['finally'](function(){delete _0x31018e[_0x0adb('0xa8')][_0x5782eb];return _0x245a09(msgResponse(_0x0adb('0x165'),'Error',_0x0adb('0x192')));});});});};Dialer[_0x0adb('0x1c')][_0x0adb('0x2f')]=function(_0x5ca878){var _0x483c14=this[_0x0adb('0xa8')][_0x5ca878[_0x0adb('0x11d')]];if(_0x483c14){delete this[_0x0adb('0xa8')][_0x5ca878['actionid']];_0x483c14[_0x0adb('0x193')]=moment()[_0x0adb('0x92')](_0x0adb('0xee'));var _0x38b34d=_0x483c14['type']===_0x0adb('0xb0')?this['campaigns'][_0x483c14[_0x0adb('0xae')]]:this[_0x0adb('0x1f')][_0x483c14[_0x0adb('0x194')]()];if(!this['isSuccess'](_0x5ca878['response'])){this['updateOriginated'](_0x38b34d);return this['callProgressDetecting'](_0x483c14,_0x38b34d,_0x5ca878)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x195')));}this[_0x0adb('0x25')][_0x5ca878[_0x0adb('0xd4')]]=_0x483c14;}};Dialer['prototype']['checkRetriveMax']=function(_0x5bcdda,_0x7c566f,_0x15c0c7){var _0x2085d5=new History(_0x7c566f);if(_0x2085d5['countbusyretry']+_0x2085d5[_0x0adb('0xe5')]+_0x2085d5['countnoanswerretry']+_0x2085d5[_0x0adb('0xe7')]+_0x2085d5[_0x0adb('0xf7')]+_0x2085d5[_0x0adb('0xf8')]+_0x2085d5[_0x0adb('0xe2')]+_0x2085d5[_0x0adb('0xe8')]>=_0x15c0c7[_0x0adb('0xe9')]-0x1){return!![];}switch(_0x5bcdda){case 0x3:if(_0x2085d5[_0x0adb('0xe6')]>=_0x15c0c7[_0x0adb('0x196')]-0x1){return!![];}this[_0x0adb('0xbb')]({'active':![],'countnoanswerretry':_0x2085d5[_0x0adb('0xe6')]+=0x1,'scheduledat':moment()[_0x0adb('0x110')](_0x15c0c7['dialNoAnswerRetryFrequency'],_0x0adb('0xed'))[_0x0adb('0x92')](_0x0adb('0xee')),'ContactId':_0x2085d5['ContactId'],'ListId':_0x2085d5[_0x0adb('0xef')],'VoiceQueueId':_0x2085d5[_0x0adb('0xf0')]||undefined,'CampaignId':_0x2085d5[_0x0adb('0xf1')]||undefined})['catch'](loggerCatch(_0x0adb('0x197')));break;case 0x5:if(_0x2085d5[_0x0adb('0xf6')]>=_0x15c0c7[_0x0adb('0x198')]-0x1){return!![];}this[_0x0adb('0xbb')]({'active':![],'countbusyretry':_0x2085d5[_0x0adb('0xf6')]+=0x1,'scheduledat':moment()[_0x0adb('0x110')](_0x15c0c7['dialBusyRetryFrequency'],_0x0adb('0xed'))[_0x0adb('0x92')](_0x0adb('0xee')),'ContactId':_0x2085d5[_0x0adb('0xcc')],'ListId':_0x2085d5['ListId'],'VoiceQueueId':_0x2085d5[_0x0adb('0xf0')]||undefined,'CampaignId':_0x2085d5[_0x0adb('0xf1')]||undefined})['catch'](loggerCatch(_0x0adb('0x199')));break;case 0x8:if(_0x2085d5['countcongestionretry']>=_0x15c0c7[_0x0adb('0x19a')]-0x1){return!![];}this[_0x0adb('0xbb')]({'active':![],'countcongestionretry':_0x2085d5[_0x0adb('0xe5')]+=0x1,'scheduledat':moment()[_0x0adb('0x110')](_0x15c0c7['dialCongestionRetryFrequency'],_0x0adb('0xed'))[_0x0adb('0x92')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2085d5['ContactId'],'ListId':_0x2085d5[_0x0adb('0xef')],'VoiceQueueId':_0x2085d5[_0x0adb('0xf0')]||undefined,'CampaignId':_0x2085d5['CampaignId']||undefined})['catch'](loggerCatch(_0x0adb('0x19b')));break;case 0x0:if(_0x2085d5[_0x0adb('0xe7')]>=_0x15c0c7[_0x0adb('0x19c')]-0x1){return!![];}else{this[_0x0adb('0xbb')]({'active':![],'countnosuchnumberretry':_0x2085d5[_0x0adb('0xe7')]+=0x1,'scheduledat':moment()[_0x0adb('0x110')](_0x15c0c7['dialNoSuchNumberRetryFrequency'],_0x0adb('0xed'))[_0x0adb('0x92')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2085d5[_0x0adb('0xcc')],'ListId':_0x2085d5[_0x0adb('0xef')],'VoiceQueueId':_0x2085d5[_0x0adb('0xf0')]||undefined,'CampaignId':_0x2085d5[_0x0adb('0xf1')]||undefined})[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x19d')));}break;case 0xa:if(_0x2085d5[_0x0adb('0xf7')]>=_0x15c0c7['dialDropMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x2085d5[_0x0adb('0xf7')]+=0x1,'scheduledat':moment()[_0x0adb('0x110')](_0x15c0c7['dialDropRetryFrequency'],_0x0adb('0xed'))[_0x0adb('0x92')](_0x0adb('0xee')),'ContactId':_0x2085d5['ContactId'],'ListId':_0x2085d5[_0x0adb('0xef')],'VoiceQueueId':_0x2085d5['VoiceQueueId']||undefined,'CampaignId':_0x2085d5[_0x0adb('0xf1')]||undefined})[_0x0adb('0xb3')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x2085d5[_0x0adb('0xf8')]>=_0x15c0c7[_0x0adb('0x19e')]-0x1){return!![];}this[_0x0adb('0xbb')]({'active':![],'countabandonedretry':_0x2085d5[_0x0adb('0xf8')]+=0x1,'scheduledat':moment()['add'](_0x15c0c7[_0x0adb('0x19f')],_0x0adb('0xed'))['format'](_0x0adb('0xee')),'ContactId':_0x2085d5['ContactId'],'ListId':_0x2085d5[_0x0adb('0xef')],'VoiceQueueId':_0x2085d5['VoiceQueueId']||undefined,'CampaignId':_0x2085d5[_0x0adb('0xf1')]||undefined})[_0x0adb('0xb3')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x2085d5['countmachineretry']>=_0x15c0c7[_0x0adb('0xec')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x2085d5[_0x0adb('0xe2')]+=0x1,'scheduledat':moment()[_0x0adb('0x110')](_0x15c0c7['dialMachineRetryFrequency'],_0x0adb('0xed'))[_0x0adb('0x92')](_0x0adb('0xee')),'ContactId':_0x2085d5[_0x0adb('0xcc')],'ListId':_0x2085d5[_0x0adb('0xef')],'VoiceQueueId':_0x2085d5[_0x0adb('0xf0')]||undefined,'CampaignId':_0x2085d5[_0x0adb('0xf1')]||undefined})[_0x0adb('0xb3')](loggerCatch(_0x0adb('0xf2')));break;case 0x14:if(_0x2085d5[_0x0adb('0xe8')]>=_0x15c0c7[_0x0adb('0x1a0')]-0x1){return!![];}this[_0x0adb('0xbb')]({'active':![],'countagentrejectretry':_0x2085d5[_0x0adb('0xe8')]+=0x1,'scheduledat':moment()['add'](_0x15c0c7['dialAgentRejectRetryFrequency'],_0x0adb('0xed'))[_0x0adb('0x92')](_0x0adb('0xee')),'ContactId':_0x2085d5[_0x0adb('0xcc')],'ListId':_0x2085d5[_0x0adb('0xef')],'VoiceQueueId':_0x2085d5['VoiceQueueId']||undefined,'CampaignId':_0x2085d5[_0x0adb('0xf1')]||undefined})[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x1a1')));break;default:return!![];}};Dialer['prototype'][_0x0adb('0x1a2')]=function(_0x39d4ad,_0x127c6f,_0x3ee5e7){var _0x2c2ad8=this;var _0x35e49b=new History(_0x39d4ad);return new BPromise(function(_0x827ccf,_0x5c8920){if(_['isUndefined'](_0x127c6f)&&typeof _0x127c6f!==_0x0adb('0x1a3')){return _0x5c8920(msgResponse('[callProgressDetecting]',_0x0adb('0x13a'),_0x0adb('0x1a4')));}if(_[_0x0adb('0x3b')](_0x3ee5e7)&&typeof _0x3ee5e7!==_0x0adb('0x1a3')){return _0x5c8920(msgResponse(_0x0adb('0x1a5'),_0x0adb('0x13a'),'evt\x20is\x20undefine'));}switch(_0x3ee5e7[_0x0adb('0x103')]){case'0':_0x127c6f[_0x0adb('0x1a6')]+=0x1;_0x35e49b[_0x0adb('0xa4')]=0x0;_0x35e49b['statedesc']=_0x0adb('0x1a7');_0x35e49b[_0x0adb('0xe7')]+=0x1;_0x35e49b['countglobal']+=0x1;ami[_0x0adb('0x4c')](_0x0adb('0x1a8'),ut[_0x0adb('0xf3')](_0x39d4ad,_0x0adb('0x1a9')));_0x2c2ad8[_0x0adb('0xc5')](_0x35e49b)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0xe4')));if(_0x2c2ad8[_0x0adb('0x1aa')](0x0,_0x39d4ad,_0x127c6f)){if(_0x35e49b[_0x0adb('0xe7')]>=_0x127c6f[_0x0adb('0x19c')]){_0x2c2ad8['createStateFinal'](_0x35e49b,_0x827ccf,_0x5c8920,_0x0adb('0x1ab'));}else{_0x2c2ad8[_0x0adb('0xea')](_0x35e49b,_0x827ccf,_0x5c8920,_0x0adb('0x1ab'));}}break;case'3':_0x127c6f[_0x0adb('0x67')]+=0x1;_0x35e49b[_0x0adb('0xa4')]=0x3;_0x35e49b['statedesc']=_0x0adb('0x1ac');_0x35e49b[_0x0adb('0xe6')]+=0x1;_0x35e49b[_0x0adb('0x10e')]+=0x1;ami['emit']('custom:agentnoanswer',ut[_0x0adb('0xf3')](_0x39d4ad,_0x0adb('0x1ad')));_0x2c2ad8[_0x0adb('0xc5')](_0x35e49b)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x1ae')));if(_0x2c2ad8['checkRetriveMax'](0x3,_0x39d4ad,_0x127c6f)){if(_0x35e49b[_0x0adb('0xe6')]>=_0x127c6f['dialNoAnswerMaxRetry']){_0x2c2ad8[_0x0adb('0xf9')](_0x35e49b,_0x827ccf,_0x5c8920,_0x0adb('0x1af'));}else{_0x2c2ad8['stateGlobal'](_0x35e49b,_0x827ccf,_0x5c8920,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x127c6f[_0x0adb('0x64')]+=0x1;_0x35e49b['state']=0x5;_0x35e49b['statedesc']=_0x0adb('0x1b0');_0x35e49b[_0x0adb('0xf6')]+=0x1;_0x35e49b[_0x0adb('0x10e')]+=0x1;ami[_0x0adb('0x4c')](_0x0adb('0x1b1'),ut[_0x0adb('0xf3')](_0x39d4ad,_0x0adb('0x1b2')));_0x2c2ad8[_0x0adb('0xc5')](_0x35e49b)[_0x0adb('0xb3')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x2c2ad8[_0x0adb('0x1aa')](0x5,_0x39d4ad,_0x127c6f)){if(_0x35e49b[_0x0adb('0xf6')]>=_0x127c6f[_0x0adb('0x198')]){_0x2c2ad8[_0x0adb('0xf9')](_0x35e49b,_0x827ccf,_0x5c8920,'reason\x205\x20busy');}else{_0x2c2ad8[_0x0adb('0xea')](_0x35e49b,_0x827ccf,_0x5c8920,_0x0adb('0x1b3'));}}break;case'8':_0x127c6f[_0x0adb('0x1b4')]+=0x1;_0x35e49b[_0x0adb('0xa4')]=0x8;_0x35e49b[_0x0adb('0xa5')]=_0x0adb('0x1b5');_0x35e49b['countcongestionretry']+=0x1;_0x35e49b['countglobal']+=0x1;ami[_0x0adb('0x4c')](_0x0adb('0x1b6'),ut[_0x0adb('0xf3')](_0x39d4ad,_0x0adb('0x1b7')));_0x2c2ad8[_0x0adb('0xc5')](_0x35e49b)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x1b8')));if(_0x2c2ad8[_0x0adb('0x1aa')](0x8,_0x39d4ad,_0x127c6f)){if(_0x35e49b[_0x0adb('0xe5')]>=_0x127c6f[_0x0adb('0x19a')]){_0x2c2ad8['createStateFinal'](_0x35e49b,_0x827ccf,_0x5c8920,'reason\x208\x20congestion');}else{_0x2c2ad8[_0x0adb('0xea')](_0x35e49b,_0x827ccf,_0x5c8920,'reason\x208\x20congestion');}}break;case'11':_0x127c6f[_0x0adb('0x1b9')]+=0x1;_0x35e49b[_0x0adb('0xa4')]=0xb;_0x35e49b['statedesc']='Abandoned';_0x35e49b[_0x0adb('0xf8')]+=0x1;_0x35e49b[_0x0adb('0x10e')]+=0x1;_0x2c2ad8[_0x0adb('0xc5')](_0x35e49b)['catch'](loggerCatch(_0x0adb('0x11c')));if(_0x2c2ad8[_0x0adb('0x1aa')](0xb,_0x39d4ad,_0x127c6f)){if(_0x35e49b[_0x0adb('0xf8')]>=_0x127c6f[_0x0adb('0x19e')]){_0x2c2ad8[_0x0adb('0xf9')](_0x35e49b,_0x827ccf,_0x5c8920,_0x0adb('0x1ba'));}else{_0x2c2ad8['stateGlobal'](_0x35e49b,_0x827ccf,_0x5c8920,'reason\x2011\x20abandoned');}}break;case'20':_0x127c6f[_0x0adb('0x6a')]+=0x1;_0x35e49b[_0x0adb('0xa4')]=0x14;_0x35e49b[_0x0adb('0xa5')]='AgentReject';_0x35e49b[_0x0adb('0xe8')]+=0x1;_0x35e49b[_0x0adb('0x10e')]+=0x1;ami[_0x0adb('0x4c')](_0x0adb('0x1bb'),ut[_0x0adb('0xf3')](_0x39d4ad,'agentreject'));_0x2c2ad8[_0x0adb('0xc5')](_0x35e49b)[_0x0adb('0xb3')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x2c2ad8[_0x0adb('0x1aa')](0x14,_0x39d4ad,_0x127c6f)){if(_0x35e49b[_0x0adb('0xe8')]>=_0x127c6f[_0x0adb('0x1a0')]){_0x2c2ad8[_0x0adb('0xf9')](_0x35e49b,_0x827ccf,_0x5c8920,'reason\x2020\x20agentreject');}else{_0x2c2ad8['stateGlobal'](_0x35e49b,_0x827ccf,_0x5c8920,'reason\x2020\x20agentreject');}}break;default:_0x127c6f[_0x0adb('0x6b')]+=0x1;_0x35e49b[_0x0adb('0xa4')]=0xc;_0x35e49b[_0x0adb('0xa5')]=_0x3ee5e7['reason'];_0x2c2ad8['createHistory'](_0x35e49b)[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x1bc')));if(_0x2c2ad8[_0x0adb('0x1aa')](_0x3ee5e7[_0x0adb('0x103')],_0x39d4ad,_0x127c6f)){if(_0x35e49b[_0x0adb('0xf6')]+_0x35e49b['countcongestionretry']+_0x35e49b[_0x0adb('0xe6')]+_0x35e49b[_0x0adb('0xe7')]+_0x35e49b[_0x0adb('0xf7')]+_0x35e49b[_0x0adb('0xf8')]+_0x35e49b[_0x0adb('0xe2')]+_0x35e49b[_0x0adb('0xe8')]>=_0x127c6f['dialGlobalMaxRetry']){_0x2c2ad8[_0x0adb('0xea')](_0x35e49b,_0x827ccf,_0x5c8920,_0x3ee5e7[_0x0adb('0x103')]);}else{_0x2c2ad8[_0x0adb('0xf9')](_0x35e49b,_0x827ccf,_0x5c8920,_0x3ee5e7[_0x0adb('0x103')]);}}}});};Dialer[_0x0adb('0x1c')][_0x0adb('0xea')]=function(_0x1aa2d8,_0x1b6fde,_0x34e49b,_0x50d9fc){var _0x5542c1=new Final(_0x1aa2d8);_0x5542c1[_0x0adb('0xa4')]=0xf;_0x5542c1[_0x0adb('0xa5')]=_0x0adb('0x1bd');this['createStateFinal'](_0x5542c1,_0x1b6fde,_0x34e49b,_0x50d9fc);};Dialer[_0x0adb('0x1c')][_0x0adb('0xf9')]=function(_0x56af9a,_0x342137,_0x13d680,_0x271ce8){this[_0x0adb('0xc4')](_0x56af9a)[_0x0adb('0x3a')](function(){return _0x342137(msgResponse('[callProgressDetecting]',_0x0adb('0xd0'),_0x271ce8));})[_0x0adb('0xb3')](function(){return _0x13d680(msgResponse(_0x0adb('0x1be'),'Failure','contact\x20not\x20moved'));});};Dialer[_0x0adb('0x1c')]['predictive']=function(_0x27cc60){var _0x3d061f=_0x27cc60['dialPredictiveOptimizationPercentage']/0x64;var _0x35976d=_0x27cc60[_0x0adb('0x10c')]/(_0x27cc60[_0x0adb('0x10c')]+_0x27cc60[_0x0adb('0x63')]);var _0x12b800=Math[_0x0adb('0x1bf')](_0x27cc60['predictiveIntervalAvailable']*(_0x27cc60['predictiveIntervalMaxThreshold']/0x64));var _0x20205c=Math[_0x0adb('0x1bf')](_0x27cc60[_0x0adb('0x72')]*(_0x27cc60[_0x0adb('0x1c0')]/0x64));var _0x4c3aad=_0x27cc60[_0x0adb('0x51')]+_0x27cc60[_0x0adb('0x57')];var _0x55067c=Math[_0x0adb('0x1c1')](_0x27cc60[_0x0adb('0x75')]*_0x27cc60[_0x0adb('0x76')]*_0x27cc60[_0x0adb('0x1c2')]*_0x27cc60[_0x0adb('0x70')]);if(_[_0x0adb('0x3b')](_0x27cc60[_0x0adb('0x27')])){if(!_[_0x0adb('0x3b')](_0x27cc60['startPredictive'])){_0x27cc60['startPredictive']=undefined;loggerPredictive[_0x0adb('0x95')](_0x0adb('0x1c3'),_0x0adb('0x1c4'));}if(!_[_0x0adb('0x3b')](_0x27cc60[_0x0adb('0x8f')])){loggerPredictive[_0x0adb('0x95')](_0x0adb('0x1c3'),_0x0adb('0x1c5'));clearInterval(_0x27cc60[_0x0adb('0x8f')]);_0x27cc60[_0x0adb('0x8f')]=undefined;}_0x27cc60[_0x0adb('0x27')]=moment()[_0x0adb('0x92')](_0x0adb('0xee'));loggerPredictive['info'](_0x27cc60[_0x0adb('0x3e')],_0x0adb('0x1c6'),_0x27cc60[_0x0adb('0x27')]);this[_0x0adb('0x14f')](_0x27cc60,0x1);}else if(ifInterval(_0x27cc60[_0x0adb('0x1c7')],_0x27cc60['startProgressive'])){this[_0x0adb('0x14f')](_0x27cc60,0x1);loggerPredictiveCalls['info'](_0x0adb('0x1c8'),_0x27cc60['startProgressive'],_0x27cc60[_0x0adb('0x3e')]);_0x27cc60[_0x0adb('0x75')]=0x0;_0x27cc60[_0x0adb('0x10d')]=0x0;}else if(_0x3d061f<_0x35976d&&_0x27cc60[_0x0adb('0x1c9')]===_0x0adb('0x1ca')){freeVariablesPredictive(_0x27cc60);loggerPredictive[_0x0adb('0x7f')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x0adb('0x1cb'),_0x35976d,_0x0adb('0x27'),_0x27cc60['name']);}else if(_0x55067c<_0x27cc60[_0x0adb('0x10d')]&&_0x27cc60['dialPredictiveOptimization']===_0x0adb('0x1ca')){freeVariablesPredictive(_0x27cc60);loggerPredictive[_0x0adb('0x7f')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x0adb('0x1cc'),_0x55067c,_0x0adb('0x1cd'),_0x27cc60[_0x0adb('0x10d')],_0x0adb('0x27'),_0x27cc60[_0x0adb('0x3e')]);}else if(!ifInterval(_0x27cc60[_0x0adb('0x1c7')],_0x27cc60[_0x0adb('0x27')])&&_[_0x0adb('0x3b')](_0x27cc60[_0x0adb('0x26')])&&!_[_0x0adb('0x3b')](_0x27cc60['startProgressive'])){_0x27cc60[_0x0adb('0x26')]=moment()[_0x0adb('0x92')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x0adb('0x7f')](_0x27cc60[_0x0adb('0x3e')],_0x0adb('0x1ce'),_0x27cc60[_0x0adb('0x26')]);this[_0x0adb('0xb9')](_0x27cc60[_0x0adb('0x1c7')])[_0x0adb('0x3a')](this[_0x0adb('0x1cf')](_0x27cc60))[_0x0adb('0x3a')](mergeDataErlangB(_0x27cc60))[_0x0adb('0x3a')](this[_0x0adb('0x1d0')](_0x27cc60))[_0x0adb('0xb3')](loggerCatchPredictive(_0x0adb('0x1d1'),_0x27cc60));}else if(!ifInterval(_0x27cc60[_0x0adb('0x1c7')],_0x27cc60[_0x0adb('0x26')])){_0x27cc60[_0x0adb('0x10d')]=0x0;_0x27cc60[_0x0adb('0x26')]=moment()[_0x0adb('0x92')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x0adb('0x7f')](_0x27cc60['name'],'recalculate\x20predictive\x20at',_0x27cc60[_0x0adb('0x26')]);clearInterval(_0x27cc60['handlePredictive']);_0x27cc60[_0x0adb('0x8f')]=undefined;this[_0x0adb('0xb9')](_0x27cc60[_0x0adb('0x1c7')])['then'](this[_0x0adb('0x1cf')](_0x27cc60))[_0x0adb('0x3a')](mergeDataErlangB(_0x27cc60))['then'](this[_0x0adb('0x1d0')](_0x27cc60))[_0x0adb('0xb3')](loggerCatchPredictive(_0x0adb('0x1d2'),_0x27cc60));}else if(_0x27cc60['predictiveIntervalAvailable']&&_0x4c3aad<_0x27cc60[_0x0adb('0x72')]-_0x20205c){freeVariablesPredictive(_0x27cc60);loggerPredictive[_0x0adb('0x7f')](_0x27cc60[_0x0adb('0x3e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x4c3aad,')\x20are\x20less\x20than\x20threshold\x20(',_0x27cc60[_0x0adb('0x72')],'-',_0x20205c,'=',_0x27cc60[_0x0adb('0x72')]-_0x20205c,')');}else if(_0x27cc60[_0x0adb('0x72')]&&_0x4c3aad>_0x27cc60[_0x0adb('0x72')]+_0x12b800){freeVariablesPredictive(_0x27cc60);loggerPredictive[_0x0adb('0x7f')](_0x27cc60[_0x0adb('0x3e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x4c3aad,_0x0adb('0x1d3'),_0x27cc60[_0x0adb('0x72')],'+',_0x12b800,'=',_0x27cc60[_0x0adb('0x72')]+_0x12b800,')');}};Dialer[_0x0adb('0x1c')][_0x0adb('0x1cf')]=function(_0xca0326){var _0x4de735=this;return function(_0x4273ba){return new BPromise(function(_0x5dbff6,_0xb42ab2){_[_0x0adb('0x8c')](_0xca0326,_0x4273ba[0x0]);if(checkGetDataPredictive(_0x4273ba[0x0])){var _0xdfd7f=_0xca0326['predictiveIntervalAvailable']=_0xca0326[_0x0adb('0x57')]+_0xca0326[_0x0adb('0x51')];var _0x5a3fcb=_0xca0326[_0x0adb('0x1c7')]*0x3c;var _0x7db981=_0x4273ba[0x0][_0x0adb('0x6c')]+_0x4273ba[0x0][_0x0adb('0x83')];var _0x328c03=(_0x4273ba[0x0]['predictiveIntervalAnsweredCalls']+_0x4273ba[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4273ba[0x0][_0x0adb('0x6d')])/_0x4273ba[0x0][_0x0adb('0x73')];_0xca0326[_0x0adb('0x1c2')]=_0x328c03>0x0?_0x328c03:0x1;switch(_0xca0326[_0x0adb('0x1c9')]){case _0x0adb('0x1ca'):var _0x534650=_0xca0326[_0x0adb('0x1d4')]/0x64;return _0x4de735[_0x0adb('0x1d5')](_0xdfd7f,_0x5a3fcb,_0x7db981,_0x328c03,_0x534650)[_0x0adb('0x3a')](function(_0x59e1de){return _0x5dbff6(_0x59e1de);});case'agentBusyFactor':var _0x33c02b=_0xca0326[_0x0adb('0x1d4')]/0x64;return _0x4de735[_0x0adb('0x1d6')](_0xdfd7f,_0x5a3fcb,_0x7db981,_0x328c03,_0x33c02b)[_0x0adb('0x3a')](function(_0x168283){return _0x5dbff6(_0x168283);});default:return _0xb42ab2(msgResponse(_0x0adb('0x1d7'),'Failure',_0x0adb('0x1d8')));}}else{return _0xb42ab2(msgResponse('[getDataPredictive]','Failure',_0x0adb('0x1d9')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x1685e9){var _0x4b132e=this;return function(_0x480dbb){return new BPromise(function(_0x377740,_0x2772a3){_['merge'](_0x1685e9,_0x480dbb[0x0]);if(checkGetDataPredictive(_0x480dbb[0x0])){loggerPredictive[_0x0adb('0x7f')](JSON[_0x0adb('0x49')](_0x480dbb[0x0]));if(_0x1685e9[_0x0adb('0x1c9')]===_0x0adb('0x1ca')){return _0x4b132e[_0x0adb('0xc2')](_0x1685e9['id'])[_0x0adb('0x3a')](function(_0x2dca34){var _0x30c3c7=_0x1685e9[_0x0adb('0x52')]-_0x2dca34[0x0][_0x0adb('0x1da')];var _0x3dc9cc=_0x1685e9['dialPredictiveInterval']*0x3c;var _0x11915d=_0x480dbb[0x0][_0x0adb('0x6c')]+_0x480dbb[0x0][_0x0adb('0x83')];var _0x13f93b=(_0x480dbb[0x0][_0x0adb('0x81')]+_0x480dbb[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x480dbb[0x0][_0x0adb('0x6d')])/_0x480dbb[0x0][_0x0adb('0x73')];var _0x4b697f=_0x1685e9[_0x0adb('0x1d4')]/0x64;_0x1685e9[_0x0adb('0x71')]=_0x2dca34[0x0][_0x0adb('0x1da')]||0x0;_0x1685e9[_0x0adb('0x1c2')]=_0x13f93b>0x0?_0x13f93b:0x1;return _0x4b132e['abandonmentRate'](_0x30c3c7,_0x3dc9cc,_0x11915d,_0x13f93b,_0x4b697f);})[_0x0adb('0x3a')](function(_0x5e2d47){return _0x377740(_0x5e2d47);})['catch'](function(_0x422016){return _0x2772a3(msgResponse(_0x0adb('0x1db'),'Failure',JSON[_0x0adb('0x49')](_0x422016)));});}if(_0x1685e9['dialPredictiveOptimization']===_0x0adb('0x1dc')){return _0x4b132e[_0x0adb('0xc2')](_0x1685e9['id'])[_0x0adb('0x3a')](function(_0x352d36){var _0x333633=_0x1685e9[_0x0adb('0x52')]-_0x352d36[0x0]['outboundQueuePauses'];var _0x48d238=_0x1685e9['dialPredictiveInterval']*0x3c;var _0x5596b1=_0x480dbb[0x0]['predictiveIntervalAvgTalktime']+_0x480dbb[0x0][_0x0adb('0x83')];var _0x273228=(_0x480dbb[0x0][_0x0adb('0x81')]+_0x480dbb[0x0][_0x0adb('0x6e')]+_0x480dbb[0x0][_0x0adb('0x6d')])/_0x480dbb[0x0][_0x0adb('0x73')];var _0x42c7e7=_0x1685e9['dialPredictiveOptimizationPercentage']/0x64;_0x1685e9[_0x0adb('0x71')]=_0x352d36[0x0]['outboundQueuePauses']||0x0;_0x1685e9['predictiveIntervalHitRate']=_0x273228>0x0?_0x273228:0x1;return _0x4b132e[_0x0adb('0x1d6')](_0x333633,_0x48d238,_0x5596b1,_0x273228,_0x42c7e7);})[_0x0adb('0x3a')](function(_0x268e09){return _0x377740(_0x268e09);})[_0x0adb('0xb3')](function(_0x564fcb){return _0x2772a3(msgResponse(_0x0adb('0x1db'),_0x0adb('0x13a'),JSON[_0x0adb('0x49')](_0x564fcb)));});}}else{return _0x2772a3(msgResponse(_0x0adb('0x1d7'),_0x0adb('0x13a'),'check\x20failure'));}});};};Dialer[_0x0adb('0x1c')]['startMethodPredictive']=function(_0x5d3d40){var _0x50971c=this;return function(){var _0x14f8c9=0x0;var _0x1f420c=Math['floor'](_0x5d3d40[_0x0adb('0x1dd')]*0x3e8);if(_0x1f420c>0x0){_0x1f420c=_0x1f420c<0x64?0x64:_0x1f420c;loggerPredictive[_0x0adb('0x7f')](_0x5d3d40[_0x0adb('0x3e')],_0x0adb('0x1de'),_0x1f420c,_0x0adb('0x4a'));_0x5d3d40[_0x0adb('0x8f')]=setInterval(function(){_0x50971c[_0x0adb('0x8f')](_0x5d3d40);loggerPredictiveCalls[_0x0adb('0x7f')](_0x0adb('0x1df'),_0x14f8c9+=0x1);},_0x1f420c);}else{loggerPredictive['info'](_0x5d3d40[_0x0adb('0x3e')],_0x0adb('0x1e0'));}};};Dialer[_0x0adb('0x1c')][_0x0adb('0x1e1')]=function(_0x2640b9,_0x57b645){var _0x58dc1e=this;return function(_0x210665){if(_[_0x0adb('0x44')](_0x210665)){if(_[_0x0adb('0xa9')](_0x57b645[_0x0adb('0x1e2')])||!_0x57b645['recallme']){if(_0x2640b9['dialMethod']===_0x0adb('0xa')){_0x2640b9[_0x0adb('0x123')]=_[_0x0adb('0x3b')](_0x2640b9[_0x0adb('0x123')])?!![]:_0x2640b9[_0x0adb('0x123')];var _0x2eacdd=uuid['v4']();_0x58dc1e[_0x0adb('0xa8')][_0x2eacdd]=new Action(_0x2640b9,_0x57b645,_0x2eacdd);loggerBooked['info']('[booked][checkContactBlack]',_0x2eacdd,'queueStatusComplete:\x20',JSON[_0x0adb('0x49')](_0x2640b9[_0x0adb('0x123')]),_0x0adb('0x1e3'),_0x2640b9[_0x0adb('0x3e')]);if(_0x2640b9[_0x0adb('0x123')]){_0x2640b9[_0x0adb('0x123')]=![];_0x58dc1e[_0x0adb('0x29')][_0x58dc1e[_0x0adb('0xa8')][_0x2eacdd][_0x0adb('0xae')]]=[];ami['Action']({'actionid':_0x2eacdd,'action':_0x0adb('0x1e4'),'queue':_0x2640b9[_0x0adb('0x3e')]})[_0x0adb('0xb3')](function(){_0x58dc1e['updateOriginated'](_0x2640b9);_0x58dc1e[_0x0adb('0xbb')]({'active':![],'ContactId':_0x58dc1e[_0x0adb('0xa8')][_0x2eacdd]['ContactId'],'ListId':_0x58dc1e[_0x0adb('0xa8')][_0x2eacdd][_0x0adb('0xef')],'VoiceQueueId':_0x58dc1e['actions'][_0x2eacdd][_0x0adb('0xf0')]||undefined,'CampaignId':_0x58dc1e[_0x0adb('0xa8')][_0x2eacdd]['CampaignId']||undefined})['catch'](loggerCatch(_0x0adb('0x1e5')));delete _0x58dc1e['actions'][_0x2eacdd];});}else{loggerBooked[_0x0adb('0x7f')](_0x0adb('0x1e6'),JSON[_0x0adb('0x49')](_0x2640b9[_0x0adb('0x123')]),_0x0adb('0x1e3'),_0x2640b9[_0x0adb('0x3e')]);_0x58dc1e[_0x0adb('0xad')](_0x2640b9);_0x58dc1e[_0x0adb('0xbb')]({'active':![],'ContactId':_0x58dc1e[_0x0adb('0xa8')][_0x2eacdd][_0x0adb('0xcc')],'ListId':_0x58dc1e['actions'][_0x2eacdd][_0x0adb('0xef')],'VoiceQueueId':_0x58dc1e[_0x0adb('0xa8')][_0x2eacdd][_0x0adb('0xf0')]||undefined,'CampaignId':_0x58dc1e[_0x0adb('0xa8')][_0x2eacdd][_0x0adb('0xf1')]||undefined})[_0x0adb('0xb3')](loggerCatch(_0x0adb('0x1e5')));delete _0x58dc1e['actions'][_0x2eacdd];}}else{return _0x58dc1e[_0x0adb('0x162')](_0x2640b9,_0x57b645);}}else{if(getDiff(_0x57b645['scheduledat'])<_0x2640b9['dialRecallMeTimeout']*0x3c){if(_0x57b645['Agent']&&!_0x57b645[_0x0adb('0x154')][_0x0adb('0x1e7')]){_0x58dc1e[_0x0adb('0x90')][_0x0adb('0x125')](_0x57b645['id'])[_0x0adb('0x126')](function(){_0x58dc1e[_0x0adb('0xad')](_0x2640b9);});}else{_0x58dc1e['unlockContact']({'active':![]},_0x57b645['id'],0x1)[_0x0adb('0x126')](function(){_0x58dc1e['updateOriginated'](_0x2640b9);});}}else{_0x2640b9['outboundReCallsDay']+=0x1;_0x58dc1e[_0x0adb('0xad')](_0x2640b9);if(_0x2640b9[_0x0adb('0x1e8')]){_0x58dc1e['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x57b645[_0x0adb('0xcc')],'ListId':_0x57b645['ListId'],'VoiceQueueId':_0x57b645['VoiceQueueId']||undefined,'CampaignId':_0x57b645['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x58dc1e[_0x0adb('0xc5')](createObjHistory(_0x2640b9,_0x57b645,_0x0adb('0x1e9'),0x17,_0x0adb('0x1ea')))[_0x0adb('0xb3')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x58dc1e['saveInDb'](createObjHistory(_0x2640b9,_0x57b645,'RECALLFAILEDTIMEOUT',0x16,_0x0adb('0x1eb')),'[Originate][HistoryRecallClose][historyCatch]',_0x0adb('0x1ec'));}}}}else{_0x2640b9[_0x0adb('0x1ed')]+=0x1;_0x58dc1e[_0x0adb('0xcb')](createObjHistory(_0x2640b9,_0x57b645,_0x0adb('0x1ee'),0xd,_0x0adb('0x1ef')),'[Originate][historyBlacklist]',_0x0adb('0x1f0'));throw _0x0adb('0x1f1');}};};Dialer[_0x0adb('0x1c')][_0x0adb('0x1f2')]=function(_0x393103){var _0x192f05=this;var _0x246f42=_0x393103['limitCalls']-_0x393103[_0x0adb('0x74')]-_0x393103[_0x0adb('0xbf')];emitCampaignSummary(_0x393103);if(_0x246f42>0x0){if(_0x246f42>this[_0x0adb('0x23')]){_0x246f42=this[_0x0adb('0x23')];}_0x393103['temp']+=_0x246f42;this[_0x0adb('0xc1')](_0x393103['id'],_0x246f42,_0x393103[_0x0adb('0x1f3')],_0x393103)['then'](function(_0x501c10){_0x393103[_0x0adb('0xbf')]-=_0x246f42;_0x393103[_0x0adb('0xbf')]=_0x393103[_0x0adb('0xbf')]>0x0?_0x393103['temp']:0x0;if(!checkContactEmpty(_0x501c10)){_0x393103[_0x0adb('0x3c')]=_0x0adb('0x9d');logger['info']('[getContactCampaign2][Empty]'+_0x393103[_0x0adb('0x3e')]);}else{_0x393103[_0x0adb('0x74')]+=_0x501c10[_0x0adb('0x98')];_0x393103['message']=_0x0adb('0x1f4');for(var _0x4d9c8a=0x0;_0x4d9c8a<_0x501c10['length'];_0x4d9c8a+=0x1){_0x393103[_0x0adb('0x1f5')]+=0x1;if(_[_0x0adb('0xa9')](_0x501c10[_0x4d9c8a])||_[_0x0adb('0xa9')](_0x501c10[_0x4d9c8a][_0x0adb('0x180')])||_[_0x0adb('0xa9')](_0x501c10[_0x4d9c8a][_0x0adb('0x180')][_0x0adb('0x164')])){_0x192f05[_0x0adb('0xca')](_0x0adb('0x1f6'),_0x393103,_0x501c10[_0x4d9c8a]);}else{_0x192f05[_0x0adb('0xb7')](_['pick'](_0x501c10[_0x4d9c8a],[_0x0adb('0xf1'),_0x0adb('0x1f7')]))[_0x0adb('0x3a')](_0x192f05[_0x0adb('0x1e1')](_0x393103,_0x501c10[_0x4d9c8a]))[_0x0adb('0xb3')](_0x192f05[_0x0adb('0xc9')](_0x0adb('0x1f8'),_0x393103));}}}})[_0x0adb('0xb3')](loggerGetContactDialer(_0x0adb('0x1f9'),_0x393103,_0x246f42));}};Dialer[_0x0adb('0x1c')]['handlePower']=function(_0x25d01e,_0x237ebe){var _0x56fa30=this;var _0x521273=[];var _0x236436=_0x237ebe>=0x1?_0x237ebe:0x1;if(_0x25d01e[_0x0adb('0x5d')]===_0x0adb('0xa')){_0x236436=0x1;}var _0x330b8c=Math[_0x0adb('0x1c1')](_0x25d01e[_0x0adb('0x51')]*_0x236436)-_0x25d01e[_0x0adb('0x74')]-_0x25d01e['temp'];emitVoiceQueueSummary(_0x25d01e);if(_0x25d01e[_0x0adb('0x1fa')]>0x0){var _0x7f9452=_0x25d01e[_0x0adb('0x1fa')]-_0x25d01e[_0x0adb('0x74')]-_0x25d01e[_0x0adb('0x57')]-_0x25d01e[_0x0adb('0xbf')]-_0x25d01e[_0x0adb('0x53')];if(_0x330b8c>_0x7f9452){_0x330b8c=_0x7f9452;}}if(_0x330b8c>0x0){if(_0x25d01e[_0x0adb('0x5d')]===_0x0adb('0xa')){_0x330b8c=0x1;}if(_0x330b8c>this['maxNumberOriginate']){_0x330b8c=this[_0x0adb('0x23')];}_0x25d01e[_0x0adb('0xbf')]+=_0x330b8c;for(var _0x42b46d in this[_0x0adb('0x21')]){if(typeof this['agents'][_0x42b46d]!=='undefined'){if(this[_0x0adb('0x21')][_0x42b46d]['state']===_0x0adb('0x1fb')&&this['agents'][_0x42b46d][_0x0adb('0xaa')]===_0x0adb('0xd2')){_0x521273[_0x0adb('0x121')](this[_0x0adb('0x21')][_0x42b46d]['id']);}}}this['getContactDialer'](_0x25d01e['id'],_0x521273,_0x330b8c,_0x25d01e[_0x0adb('0x1f3')],_0x25d01e)['then'](function(_0x3e7992){_0x25d01e[_0x0adb('0xbf')]-=_0x330b8c;_0x25d01e[_0x0adb('0xbf')]=_0x25d01e[_0x0adb('0xbf')]>0x0?_0x25d01e[_0x0adb('0xbf')]:0x0;if(!checkContactEmpty(_0x3e7992)){_0x56fa30[_0x0adb('0xb2')](_0x25d01e)[_0x0adb('0x3a')](sendMessageReschedule(_0x25d01e))[_0x0adb('0xb3')](loggerCatch(_0x0adb('0xb4')));}else{_0x25d01e['originated']+=_0x3e7992[_0x0adb('0x98')];_0x25d01e[_0x0adb('0x3c')]=_0x25d01e[_0x0adb('0x5d')]===_0x0adb('0xa')?_0x0adb('0x16d'):_0x0adb('0x1f4');for(var _0x1a3e89=0x0;_0x1a3e89<_0x3e7992[_0x0adb('0x98')];_0x1a3e89+=0x1){if(_[_0x0adb('0xa9')](_0x3e7992[_0x1a3e89])||_[_0x0adb('0xa9')](_0x3e7992[_0x1a3e89]['Contact'])||_[_0x0adb('0xa9')](_0x3e7992[_0x1a3e89][_0x0adb('0x180')][_0x0adb('0x164')])){_0x56fa30[_0x0adb('0xca')](_0x0adb('0x1f6'),_0x25d01e,_0x3e7992[_0x1a3e89]);}else{_0x56fa30[_0x0adb('0xb5')](_[_0x0adb('0x12d')](_0x3e7992[_0x1a3e89],[_0x0adb('0xf0'),'Contact.phone']))[_0x0adb('0x3a')](_0x56fa30[_0x0adb('0x1e1')](_0x25d01e,_0x3e7992[_0x1a3e89]))[_0x0adb('0xb3')](_0x56fa30['loggerHandler'](_0x0adb('0x1f6'),_0x25d01e));}}}})[_0x0adb('0xb3')](loggerGetContactDialer(_0x0adb('0x1fc'),_0x25d01e,_0x330b8c));}};Dialer[_0x0adb('0x1c')][_0x0adb('0x8f')]=function(_0x198e13){if(_0x198e13[_0x0adb('0x1fa')]>0x0){var _0x24964e=_0x198e13[_0x0adb('0x1fa')]-_0x198e13[_0x0adb('0x74')]-_0x198e13[_0x0adb('0x57')];if(_0x24964e>0x0){this['tryOriginatePredictive'](_0x198e13);}else{loggerPredictiveCalls[_0x0adb('0x7f')](_0x0adb('0x1fd'));}}else{this[_0x0adb('0x1fe')](_0x198e13);}};Dialer[_0x0adb('0x1c')]['tryOriginatePredictive']=function(_0x14be26){var _0x5b17be=this;var _0x5a4f4d=[];_0x14be26[_0x0adb('0x74')]+=0x1;for(var _0x5a55c6 in this[_0x0adb('0x21')]){if(typeof this['agents'][_0x5a55c6]!==_0x0adb('0x99')){if(this[_0x0adb('0x21')][_0x5a55c6][_0x0adb('0xa4')]===_0x0adb('0x1fb')&&this[_0x0adb('0x21')][_0x5a55c6][_0x0adb('0xaa')]===_0x0adb('0xd2')){_0x5a4f4d[_0x0adb('0x121')](this[_0x0adb('0x21')][_0x5a55c6]['id']);}}}this[_0x0adb('0xbe')](_0x14be26['id'],_0x5a4f4d,0x1,_0x14be26[_0x0adb('0x1f3')],_0x14be26)['then'](function(_0x42c636){if(!checkContactEmpty(_0x42c636)){checkContactLowerLimitOriginate(_0x14be26,0x1,0x0);_0x5b17be['countReScheduled'](_0x14be26)[_0x0adb('0x3a')](sendMessageReschedule(_0x14be26))[_0x0adb('0xb3')](loggerCatch(_0x0adb('0xb4')));}else{_0x14be26[_0x0adb('0x3c')]=_0x0adb('0x1f4');if(_[_0x0adb('0xa9')](_0x42c636[0x0])||_[_0x0adb('0xa9')](_0x42c636[0x0]['Contact'])||_[_0x0adb('0xa9')](_0x42c636[0x0][_0x0adb('0x180')]['phone'])){_0x5b17be[_0x0adb('0xca')](_0x0adb('0x1f6'),_0x14be26,_0x42c636[0x0]);}else{_0x5b17be[_0x0adb('0xb5')](_[_0x0adb('0x12d')](_0x42c636[0x0],['VoiceQueueId','Contact.phone']))[_0x0adb('0x3a')](_0x5b17be[_0x0adb('0x1e1')](_0x14be26,_0x42c636[0x0]))['catch'](_0x5b17be['loggerHandler']('[actionOriginatePredictive]\x20',_0x14be26));}}})[_0x0adb('0xb3')](loggerGetContactDialer(_0x0adb('0x1ff'),_0x14be26,0x1));emitVoiceQueueSummary(_0x14be26);};Dialer[_0x0adb('0x1c')][_0x0adb('0x1d5')]=function(_0x26818f,_0x18aacc,_0x5078d6,_0x30abd1,_0x2d1b9f,_0x378415){loggerPredictive['info'](_0x0adb('0x200'));loggerPredictive[_0x0adb('0x7f')]('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',_0x26818f);loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x201'),_0x18aacc);loggerPredictive[_0x0adb('0x7f')]('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',_0x5078d6);loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x202'),_0x30abd1);loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x203'),_0x2d1b9f);loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x8b'));return new BPromise(function(_0x43edbf,_0x1dbc5e){if(_0x26818f<=0x0||isNaN(_0x26818f)){return _0x1dbc5e(msgResponse(_0x0adb('0x204'),_0x0adb('0x48'),_0x0adb('0x205')+_0x26818f));}if(_0x5078d6<=0x0||isNaN(_0x5078d6)){return _0x1dbc5e(msgResponse(_0x0adb('0x204'),_0x0adb('0x48'),_0x0adb('0x206')+_0x5078d6));}if(_0x30abd1<=0x0||isNaN(_0x30abd1)){return _0x1dbc5e(msgResponse(_0x0adb('0x204'),_0x0adb('0x48'),'p\x20=\x20'+_0x30abd1));}if(_0x18aacc<=0x0||isNaN(_0x18aacc)){return _0x1dbc5e(msgResponse(_0x0adb('0x204'),_0x0adb('0x48'),_0x0adb('0x207')+_0x18aacc));}if(_0x2d1b9f<=0x0||isNaN(_0x2d1b9f)){return _0x1dbc5e(msgResponse(_0x0adb('0x204'),_0x0adb('0x48'),'Amax\x20=\x20'+_0x2d1b9f));}_0x378415=_0x378415||0x0;var _0x36967c=0x1/_0x5078d6;var _0x5e4c45=0x0;var _0x21d58a=0x0;var _0x2bb368=0x0;var _0x420c83=0x0;for(var _0x26c946=0x0;_0x2bb368<_0x2d1b9f;_0x26c946+=0x1){_0x21d58a=_0x26c946/_0x18aacc;_0x5e4c45=(_0x30abd1*_0x21d58a+_0x378415)/_0x36967c;_0x2bb368=erlangb(_0x5e4c45,_0x26818f);_0x420c83=_0x5e4c45/_0x26818f*(0x1-erlangb(_0x5e4c45,_0x26818f));}return _0x43edbf({'erlangCalls':_0x26c946,'erlangCallToSecond':_0x18aacc/_0x26c946,'erlangAbandonmentRate':_0x2bb368,'erlangBusyFactor':_0x420c83});});};Dialer[_0x0adb('0x1c')][_0x0adb('0x1d6')]=function(_0x1119fe,_0x527598,_0x4e7c32,_0x369681,_0x10d944,_0x459001){loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x208'));loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x209'),_0x1119fe);loggerPredictive[_0x0adb('0x7f')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x527598);loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x20a'),_0x4e7c32);loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x202'),_0x369681);loggerPredictive[_0x0adb('0x7f')](_0x0adb('0x20b'),_0x10d944);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x38a5dc,_0x47bbb6){if(_0x1119fe<=0x0||isNaN(_0x1119fe)){return _0x47bbb6(msgResponse(_0x0adb('0x20c'),_0x0adb('0x48'),'m\x20=\x20'+_0x1119fe));}if(_0x4e7c32<=0x0||isNaN(_0x4e7c32)){return _0x47bbb6(msgResponse(_0x0adb('0x20c'),_0x0adb('0x48'),_0x0adb('0x206')+_0x4e7c32));}if(_0x369681<=0x0||isNaN(_0x369681)){return _0x47bbb6(msgResponse(_0x0adb('0x20c'),'Error',_0x0adb('0x20d')+_0x369681));}if(_0x527598<=0x0||isNaN(_0x527598)){return _0x47bbb6(msgResponse(_0x0adb('0x20c'),'Error',_0x0adb('0x207')+_0x527598));}if(_0x10d944<=0x0||isNaN(_0x10d944)){return _0x47bbb6(msgResponse(_0x0adb('0x20c'),'Error',_0x0adb('0x20e')+_0x10d944));}_0x459001=_0x459001||0x0;var _0x4b7f10=0x1/_0x4e7c32;var _0x562536=0x0;var _0x384f66=0x0;var _0x33dacf=0x0;var _0x2874e4=0x0;for(var _0xcd3f3e=0x0;_0x2874e4<_0x10d944;_0xcd3f3e+=0x1){_0x384f66=_0xcd3f3e/_0x527598;_0x562536=(_0x369681*_0x384f66+_0x459001)/_0x4b7f10;_0x33dacf=erlangb(_0x562536,_0x1119fe);_0x2874e4=_0x562536/_0x1119fe*(0x1-erlangb(_0x562536,_0x1119fe));}return _0x38a5dc({'erlangCalls':_0xcd3f3e,'erlangCallToSecond':_0x527598/_0xcd3f3e,'erlangAbandonmentRate':_0x33dacf,'erlangBusyFactor':_0x2874e4});});};module[_0x0adb('0x20f')]=Dialer; \ No newline at end of file +var _0xe7a0=['[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','timezones','true','iftime\x20%s,%s','content','indexOf','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','handlePower','power','dialPowerLevel','booked','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','loggedIn','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','checkIfTimeIntervals','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','originate','Contact','phone','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','dialAbandonedMaxRetry','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','dialPredictiveOptimizationPercentage','round','[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]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive',')\x20are\x20less\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','getVoiceQueueRtPauses','outboundQueuePauses','abandonmentRate','[CatchErlangB]','startMethodPredictive','one\x20call\x20every:','[handlePredictive]','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','pTalking','not_inuse','dialOrderByScheduledAt','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','bluebird','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','syncQueueMember','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','message','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','type','strategy','answered','available','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','Interval','md5','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','startPredictive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','ivr','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','catch','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','uniqueid','variable','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerCallsDay','HangupInAMD','membername','AMD','[syncHangupInAMD]','dialAMDActive','MACHINE','outboundAnswerAgiCallsDay','statedesc','Machine','countglobal','amd','custom:amd','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','[syncHangupIvr][createHistory]','cause-txt','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','Abandoned','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','endtime','actionid','locked','paused','stateinterface','rrmemory','push','pick','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xe7a0,0xed));var _0x0e7a=function(_0xac63ac,_0x35a398){_0xac63ac=_0xac63ac-0x0;var _0x315957=_0xe7a0[_0xac63ac];return _0x315957;};'use strict';var util=require(_0x0e7a('0x0'));var _=require(_0x0e7a('0x1'));var BPromise=require(_0x0e7a('0x2'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require(_0x0e7a('0x3'));var ut=require(_0x0e7a('0x4'));var config=require(_0x0e7a('0x5'));var logger=require(_0x0e7a('0x6'))(_0x0e7a('0x7'));var loggerBooked=require(_0x0e7a('0x6'))('booked');var loggerPredictive=require(_0x0e7a('0x6'))(_0x0e7a('0x8'));var loggerPredictiveCalls=require(_0x0e7a('0x6'))(_0x0e7a('0x9'));var loggerSyncQueueSummary=require(_0x0e7a('0x6'))(_0x0e7a('0xa'));var ami=require(_0x0e7a('0xb'));config[_0x0e7a('0xc')]=_[_0x0e7a('0xd')](config[_0x0e7a('0xc')],{'host':_0x0e7a('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0e7a('0xc')]));var cmHopper=require(_0x0e7a('0xf'));var cmHopperHistory=require(_0x0e7a('0x10'));var cmHopperBlack=require(_0x0e7a('0x11'));var voiceQueueRt=require(_0x0e7a('0x12'));var RpcSetting=require(_0x0e7a('0x13'));var Action=require(_0x0e7a('0x14'));var History=require('./history');var Final=require(_0x0e7a('0x15'));var AgentComplete=require(_0x0e7a('0x16'));var QueueCallerAbandon=require(_0x0e7a('0x17'));var Hangup=require(_0x0e7a('0x18'));var ipAgi=process['env'][_0x0e7a('0x19')]||_0x0e7a('0x1a');var strategy={'rrmemory':'rrmemory','roundrobin':_0x0e7a('0x1b')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x0e7a('0x1c')][_0x0e7a('0x1d')]=function(_0x3bff0f){this['tail']=this[_0x0e7a('0x1e')]?this[_0x0e7a('0x1e')]['finally'](_0x3bff0f):_0x3bff0f();};function Dialer(_0x43f70f,_0x1602a0){this[_0x0e7a('0x1f')]=new Sequence();this[_0x0e7a('0x20')]=_0x1602a0;this['voiceQueues']=_0x43f70f[_0x0e7a('0x21')];this[_0x0e7a('0x22')]=_0x43f70f['campaigns'];this[_0x0e7a('0x23')]=_0x43f70f[_0x0e7a('0x23')];this[_0x0e7a('0x24')]=_0x43f70f['trunks'];this['maxNumberOriginate']=config[_0x0e7a('0x25')]||0x2;this[_0x0e7a('0x26')]={};this[_0x0e7a('0x27')]={};this[_0x0e7a('0x28')]={};this[_0x0e7a('0x29')]={};this['optionPredictive']={};this['startPredictive']={};this[_0x0e7a('0x2a')]={};this[_0x0e7a('0x2b')]={};this[_0x0e7a('0x2c')]={};this[_0x0e7a('0x2d')]={};ami['on'](_0x0e7a('0x2e'),this[_0x0e7a('0x2f')][_0x0e7a('0x30')](this));ami['on'](_0x0e7a('0x31'),this[_0x0e7a('0x32')][_0x0e7a('0x30')](this));ami['on'](_0x0e7a('0x33'),this[_0x0e7a('0x34')][_0x0e7a('0x30')](this));ami['on'](_0x0e7a('0x35'),this[_0x0e7a('0x36')][_0x0e7a('0x30')](this));ami['on'](_0x0e7a('0x37'),this[_0x0e7a('0xa')]['bind'](this));ami['on'](_0x0e7a('0x38'),this[_0x0e7a('0x39')][_0x0e7a('0x30')](this));ami['on'](_0x0e7a('0x3a'),this[_0x0e7a('0x3b')][_0x0e7a('0x30')](this));ami['on']('varset',this[_0x0e7a('0x3c')]['bind'](this));ami['on']('queuemember',this[_0x0e7a('0x3d')][_0x0e7a('0x30')](this));ami['on']('queuestatuscomplete',this[_0x0e7a('0x3e')][_0x0e7a('0x30')](this));this['loopCampaigns']();this[_0x0e7a('0x3f')]();RpcSetting[_0x0e7a('0x40')]()[_0x0e7a('0x41')](function(_0x194f41){previewRecallmeReminderInterval=_0x194f41['previewRecallmeReminderInterval'];});}function isNotNull(_0x467b30){return _0x467b30!==null&&!_[_0x0e7a('0x42')](_0x467b30);}function checkIsLoggedIn(_0x1ab41a,_0x214925){return function(){if(_0x214925<=0x0){_0x1ab41a['message']=_0x0e7a('0x43');throw _0x1ab41a[_0x0e7a('0x44')]+_0x0e7a('0x45');}};}function isActive(_0x4435db){return _0x4435db;}function checkIsActive(_0xa63f6d,_0x137b1e){return function(){if(!isActive(_0x137b1e)){_0xa63f6d['message']=_0x0e7a('0x46');throw _0xa63f6d[_0x0e7a('0x44')]+_0x0e7a('0x47');}};}function checkInterval(_0x574b93){return function(){if(!isNotNull(_0x574b93['Interval'])){_0x574b93['message']=_0x0e7a('0x48');throw _0x574b93[_0x0e7a('0x44')]+_0x0e7a('0x49');}if(!isNotNull(_0x574b93['Interval'][_0x0e7a('0x4a')])){_0x574b93['message']=_0x0e7a('0x48');throw _0x574b93[_0x0e7a('0x44')]+_0x0e7a('0x49');}if(!isNotNull(_[_0x0e7a('0x4b')](_0x574b93['Interval'][_0x0e7a('0x4a')]))){_0x574b93[_0x0e7a('0x4c')]=_0x0e7a('0x48');throw _0x574b93[_0x0e7a('0x44')]+_0x0e7a('0x49');}};}function msgResponse(_0x39888f,_0x2cb1dd,_0x4d7704){return{'action':_0x39888f,'response':_0x2cb1dd,'message':_0x4d7704,'stack':_0x4d7704};}function myreject(_0x45589c){return function(_0x475918){return _0x45589c(msgResponse(_0x0e7a('0x4d'),'Error',JSON[_0x0e7a('0x4e')](_0x475918)));};}function getSeconds(_0x4dabb0,_0x9daa6){var _0x2cef86=moment(_0x4dabb0)['milliseconds'](0x0);var _0x2dc43b=moment(_0x9daa6)[_0x0e7a('0x4f')](0x0);return _0x2cef86[_0x0e7a('0x50')](_0x2dc43b,_0x0e7a('0x51'));}function emit(_0x49409e,_0x4b469c,_0x1134f5){io['to'](_0x49409e)[_0x0e7a('0x52')](_0x4b469c,_0x1134f5);}function emitVoiceQueueSummary(_0x1360cf){if(_0x1360cf[_0x0e7a('0x53')]==='outbound'){var _0x10a617={'id':_0x1360cf['id'],'name':_0x1360cf[_0x0e7a('0x44')],'strategy':_0x1360cf[_0x0e7a('0x54')],'answered':_0x1360cf[_0x0e7a('0x55')],'available':_0x1360cf[_0x0e7a('0x56')],'loggedIn':_0x1360cf['loggedIn'],'pTalking':_0x1360cf['pTalking'],'sumBillable':_0x1360cf[_0x0e7a('0x57')],'sumDuration':_0x1360cf['sumDuration'],'sumHoldTime':_0x1360cf[_0x0e7a('0x58')]||0x0,'talking':_0x1360cf[_0x0e7a('0x59')],'total':_0x1360cf[_0x0e7a('0x5a')],'type':_0x1360cf[_0x0e7a('0x53')],'unmanaged':_0x1360cf[_0x0e7a('0x5b')],'abandoned':_0x1360cf[_0x0e7a('0x5c')],'waiting':_0x1360cf[_0x0e7a('0x5d')],'loggedInDb':_0x1360cf['loggedInDb'],'dialActive':_0x1360cf[_0x0e7a('0x5e')],'dialMethod':_0x1360cf[_0x0e7a('0x5f')],'dialOriginateCallerIdName':_0x1360cf[_0x0e7a('0x60')],'dialOriginateCallerIdNumber':_0x1360cf[_0x0e7a('0x61')],'dialOriginateTimeout':_0x1360cf[_0x0e7a('0x62')],'dialPrefix':_0x1360cf['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1360cf['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1360cf['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1360cf['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x1360cf[_0x0e7a('0x63')],'outboundCongestionCallsDay':_0x1360cf[_0x0e7a('0x64')],'outboundDropCallsDayACS':_0x1360cf[_0x0e7a('0x65')],'outboundDropCallsDayCallersExit':_0x1360cf[_0x0e7a('0x66')],'outboundDropCallsDayTimeout':_0x1360cf[_0x0e7a('0x67')],'outboundNoAnswerCallsDay':_0x1360cf[_0x0e7a('0x68')],'outboundNoSuchCallsDay':_0x1360cf[_0x0e7a('0x69')],'outboundOriginateFailureCallsDay':_0x1360cf['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x1360cf[_0x0e7a('0x6a')],'outboundRejectCallsDay':_0x1360cf[_0x0e7a('0x6b')],'outboundUnknownCallsDay':_0x1360cf[_0x0e7a('0x6c')],'predictiveIntervalAnsweredCalls':_0x1360cf[_0x0e7a('0x6d')],'predictiveIntervalAvgHoldtime':_0x1360cf[_0x0e7a('0x6e')],'predictiveIntervalAvgTalktime':_0x1360cf['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1360cf['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1360cf[_0x0e7a('0x6f')],'predictiveIntervalErlangCalls':_0x1360cf['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1360cf[_0x0e7a('0x70')],'predictiveIntervalHitRate':_0x1360cf[_0x0e7a('0x71')],'predictiveIntervalMultiplicativeFactor':_0x1360cf[_0x0e7a('0x72')],'predictiveIntervalPauses':_0x1360cf[_0x0e7a('0x73')],'predictiveIntervalAvailable':_0x1360cf[_0x0e7a('0x74')],'predictiveIntervalTotalCalls':_0x1360cf[_0x0e7a('0x75')],'message':_0x1360cf['message'],'originated':_0x1360cf[_0x0e7a('0x76')],'erlangCalls':_0x1360cf['erlangCalls'],'erlangCallToSecond':_0x1360cf[_0x0e7a('0x77')],'erlangAbandonmentRate':_0x1360cf[_0x0e7a('0x78')],'erlangBusyFactor':_0x1360cf[_0x0e7a('0x79')],'startPredictive':_0x1360cf['startPredictive'],'startProgressive':_0x1360cf['startProgressive']};if(_0x1360cf[_0x0e7a('0x7a')]){_0x10a617[_0x0e7a('0x7a')]={'id':_0x1360cf[_0x0e7a('0x7a')]['id'],'name':_0x1360cf[_0x0e7a('0x7a')][_0x0e7a('0x44')],'active':_0x1360cf[_0x0e7a('0x7a')][_0x0e7a('0x7b')],'callerid':_0x1360cf[_0x0e7a('0x7a')][_0x0e7a('0x7c')]};}if(_0x1360cf[_0x0e7a('0x7d')]){_0x10a617['Interval']={'id':_0x1360cf[_0x0e7a('0x7d')]['id'],'name':_0x1360cf['Interval'][_0x0e7a('0x44')]};}var _0x331f44=md5(JSON[_0x0e7a('0x4e')](_0x10a617));if(_0x1360cf[_0x0e7a('0x7e')]!==_0x331f44){_0x1360cf[_0x0e7a('0x7e')]=_0x331f44;emit(util['format'](_0x0e7a('0x7f'),_0x10a617[_0x0e7a('0x44')]),_0x0e7a('0x80'),_0x10a617);}}}function emitCampaignSummary(_0x1701a8){if(_0x1701a8[_0x0e7a('0x53')]==='ivr'){emit(util['format'](_0x0e7a('0x81'),_0x1701a8['name']),_0x0e7a('0x82'),_0x1701a8);}}function checkGetDataPredictive(_0x5685dc){if(isNotNull(_0x5685dc)&&!_[_0x0e7a('0x4b')](_0x5685dc)){loggerPredictive['info'](_0x0e7a('0x83'));loggerPredictive['info'](_0x0e7a('0x84'),_0x5685dc[_0x0e7a('0x75')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5685dc[_0x0e7a('0x6d')]);loggerPredictive[_0x0e7a('0x85')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5685dc[_0x0e7a('0x6f')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5685dc[_0x0e7a('0x86')]);loggerPredictive['info'](_0x0e7a('0x87'),_0x5685dc[_0x0e7a('0x6e')]);loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x88'),_0x5685dc[_0x0e7a('0x89')]);loggerPredictive[_0x0e7a('0x85')]('---------------------------');if(_0x5685dc['predictiveIntervalTotalCalls']>0x0){if(!_[_0x0e7a('0x42')](_0x5685dc[_0x0e7a('0x89')])&&_0x5685dc[_0x0e7a('0x89')]>0x0){return!![];}loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x8a'));if(!_['isUndefined'](_0x5685dc[_0x0e7a('0x6e')])&&_0x5685dc[_0x0e7a('0x6e')]>0x0){return!![];}loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x8b'));}else{loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x8c'));}}else{loggerPredictive[_0x0e7a('0x85')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2aeb87){return function(_0x33280d){loggerPredictive['info'](_0x0e7a('0x8d'));loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x8e'),_0x33280d[_0x0e7a('0x8f')]);loggerPredictive['info'](_0x0e7a('0x90'),_0x33280d['erlangCallToSecond']);loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x91'),_0x33280d['erlangAbandonmentRate']);loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x92'),_0x33280d[_0x0e7a('0x79')]);loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x91'),_0x33280d[_0x0e7a('0x78')]);loggerPredictive[_0x0e7a('0x85')]('---------------------------');_[_0x0e7a('0x93')](_0x2aeb87,_0x33280d);};}function getDiff(_0x239193){var _0x2f4f98=moment()[_0x0e7a('0x4f')](0x0);var _0x25d5f8=moment(_0x239193)[_0x0e7a('0x4f')](0x0);return _0x2f4f98[_0x0e7a('0x50')](_0x25d5f8,_0x0e7a('0x51'));}function ifInterval(_0x2066ff,_0x41f970){if(_[_0x0e7a('0x42')](_0x41f970)){return![];}return getDiff(_0x41f970)<_0x2066ff*0x3c;}function freeVariablesPredictive(_0x4de73e){if(isNotNull(_0x4de73e)){if(!_[_0x0e7a('0x42')](_0x4de73e[_0x0e7a('0x2a')])){_0x4de73e[_0x0e7a('0x2a')]=undefined;loggerPredictive[_0x0e7a('0x85')](_0x4de73e[_0x0e7a('0x44')],_0x0e7a('0x94'));}if(!_[_0x0e7a('0x42')](_0x4de73e['startPredictive'])){_0x4de73e[_0x0e7a('0x95')]=undefined;loggerPredictive[_0x0e7a('0x85')](_0x4de73e[_0x0e7a('0x44')],_0x0e7a('0x96'));}if(!_[_0x0e7a('0x42')](_0x4de73e['handlePredictive'])){clearInterval(_0x4de73e[_0x0e7a('0x97')]);_0x4de73e['handlePredictive']=undefined;loggerPredictive[_0x0e7a('0x85')](_0x4de73e['name'],_0x0e7a('0x98'));}}}function erlangb(_0x518c0b,_0x5200ab){if(_0x5200ab===0x0){return 0x0;}var _0xa2d9c1=0x1;for(var _0x3dc3f8=0x1;_0x3dc3f8<=_0x5200ab;_0x3dc3f8+=0x1){_0xa2d9c1=0x1+_0xa2d9c1*_0x3dc3f8/_0x518c0b;}return 0x1/_0xa2d9c1;}function isVoiceQueueOutbound(_0x54960b){return _0x54960b===_0x0e7a('0x99');}function isNotPreview(_0x2977b1){return _0x2977b1!==_0x0e7a('0x20');}function isCampaignIvr(_0x2ce314){return _0x2ce314===_0x0e7a('0x9a');}function getCallerId(_0x40a431,_0xb62e29,_0x215397){if(!_[_0x0e7a('0x42')](_0x215397)&&typeof _0x215397===_0x0e7a('0x9b')&&!_[_0x0e7a('0x4b')](_0x215397)){if(!_['isUndefined'](_0xb62e29)&&typeof _0xb62e29===_0x0e7a('0x9b')&&!_[_0x0e7a('0x4b')](_0xb62e29)){return util['format'](_0x0e7a('0x9c'),_0xb62e29,_0x215397);}return util[_0x0e7a('0x9d')](_0x0e7a('0x9c'),_0x215397,_0x215397);}if(!_[_0x0e7a('0x42')](_0x40a431)&&typeof _0x40a431===_0x0e7a('0x9b')&&!_[_0x0e7a('0x4b')](_0x40a431)){return _0x40a431;}return _0x0e7a('0x9e');}function loggerCatchQueueSummary(_0x270f8d,_0x5da522){return function(_0x10c309){freeVariablesPredictive(_0x5da522);emitVoiceQueueSummary(_0x5da522);emitCampaignSummary(_0x5da522);loggerSyncQueueSummary[_0x0e7a('0x9f')](_0x270f8d,util[_0x0e7a('0xa0')](_0x10c309,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2b1316,_0x4355b7){return function(_0x432241){loggerPredictive[_0x0e7a('0x9f')](_0x4355b7[_0x0e7a('0x44')],_0x2b1316);loggerPredictive['error'](_0x432241[_0x0e7a('0xa1')]);freeVariablesPredictive(_0x4355b7);};}function loggerCatch(_0x3e3836){return function(_0x5e92b3){logger[_0x0e7a('0x9f')](_0x3e3836,util[_0x0e7a('0xa0')](_0x5e92b3,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x12f42c){return _0x12f42c&&!_[_0x0e7a('0x42')](_0x12f42c)&&_0x12f42c[_0x0e7a('0xa2')]>0x0;}function decremetOriginate(_0xde8c86){if(!_[_0x0e7a('0x42')](_0xde8c86)&&_0xde8c86!==null){if(typeof _0xde8c86[_0x0e7a('0x76')]!==_0x0e7a('0xa3')){if(_0xde8c86[_0x0e7a('0x76')]>0x0){_0xde8c86['originated']-=0x1;}else{logger['error'](_0x0e7a('0xa4'));}}}else{logger['error'](_0x0e7a('0xa5'));}}function checkContactLowerLimitOriginate(_0x57a5a4,_0x990088,_0x67fdb){if(_0x990088>_0x67fdb){for(var _0xec939f=0x0;_0xec939f<_0x990088-_0x67fdb;_0xec939f+=0x1){decremetOriginate(_0x57a5a4);}}}function loggerGetContactDialer(_0x306902,_0x378008,_0x190100){return function(_0x1f35f1){checkContactLowerLimitOriginate(_0x378008,_0x190100,0x0);logger['error'](_0x306902,util[_0x0e7a('0xa0')](_0x1f35f1,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x40fbfc){return function(_0x2b18c9){if(isNotNull(_0x2b18c9)&&isNotNull(_0x2b18c9[0x0])){if(_0x2b18c9[0x0][_0x0e7a('0xa6')]>0x0){_0x40fbfc[_0x0e7a('0x4c')]=_0x0e7a('0xa7');logger[_0x0e7a('0x85')](_0x0e7a('0xa8')+_0x40fbfc['name'],_0x2b18c9[0x0][_0x0e7a('0xa6')],_0x0e7a('0xa9'));}else{_0x40fbfc[_0x0e7a('0x4c')]=_0x0e7a('0xaa');logger[_0x0e7a('0x85')]('[getContactDialer2][Empty]'+_0x40fbfc[_0x0e7a('0x44')]);}}};}function notSendMessagesQueue(_0x1e3beb){if(_0x1e3beb[_0x0e7a('0xab')]){freeVariablesPredictive(_0x1e3beb);if(_0x1e3beb['originated']===0x0&&_0x1e3beb[_0x0e7a('0x59')]===0x0&&_0x1e3beb[_0x0e7a('0x5d')]===0x0&&(_0x1e3beb['pTalking']||0x0)===0x0){_0x1e3beb[_0x0e7a('0xab')]=![];_0x1e3beb['available']=0x0;_0x1e3beb['message']=_0x0e7a('0x46');loggerSyncQueueSummary['error'](_0x0e7a('0xac'),_0x1e3beb[_0x0e7a('0x44')],_0x0e7a('0xad'));}else{_0x1e3beb[_0x0e7a('0x4c')]=_0x0e7a('0xae');loggerSyncQueueSummary['error'](_0x0e7a('0xac'),_0x1e3beb[_0x0e7a('0x44')],_0x0e7a('0xaf'));}emitVoiceQueueSummary(_0x1e3beb);}}function notSendMessagesCampaign(_0x22afdb){if(_0x22afdb['sendMessageOneNotActive']){if(_0x22afdb[_0x0e7a('0x76')]===0x0){_0x22afdb[_0x0e7a('0xab')]=![];_0x22afdb[_0x0e7a('0x4c')]=_0x0e7a('0x46');loggerSyncQueueSummary[_0x0e7a('0x9f')](_0x0e7a('0xb0'),_0x22afdb['name'],'is\x20not\x20active');}else{_0x22afdb[_0x0e7a('0x4c')]=_0x0e7a('0xae');loggerSyncQueueSummary[_0x0e7a('0x9f')](_0x0e7a('0xb0'),_0x22afdb[_0x0e7a('0x44')],'is\x20disactive');}emitCampaignSummary(_0x22afdb);}}function createObjHistory(_0x575a2e,_0x155a1e,_0x225691,_0xefba8e,_0x4077c5){_0x575a2e[_0x0e7a('0x4c')]=_0x225691;var _0x40d5b5=new Action(_0x575a2e,_0x155a1e);var _0x181958=new History(_0x40d5b5);_0x181958[_0x0e7a('0xb1')]=_0xefba8e;_0x181958['statedesc']=_0x4077c5;_0x181958['endtime']=_0x40d5b5[_0x0e7a('0xb2')];return _0x181958;}Dialer[_0x0e7a('0x1c')][_0x0e7a('0x3f')]=function(){var _0x199f7e=this;setInterval(function(){_0x199f7e[_0x0e7a('0xb3')](_0x199f7e[_0x0e7a('0x29')],_0x0e7a('0xb4'));_0x199f7e[_0x0e7a('0xb3')](_0x199f7e['actions'],_0x0e7a('0xb5'));},0x32c8);};Dialer[_0x0e7a('0x1c')]['clearZombieChannels']=function(_0xeea1a4,_0x58b17e){var _0x40bb7f=this;for(var _0x5b7aaf in _0xeea1a4){if(typeof _0xeea1a4[_0x5b7aaf]!==_0x0e7a('0xa3')){this[_0x0e7a('0x1f')][_0x0e7a('0x1d')](function(){if(!_[_0x0e7a('0xb6')](_0xeea1a4[_0x5b7aaf])){return ami[_0x0e7a('0xb7')]({'action':_0x0e7a('0xb8'),'channel':_0xeea1a4[_0x5b7aaf][_0x0e7a('0xb9')]})['catch'](function(_0x208622){if(_0x208622[_0x0e7a('0x4c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xeea1a4[_0x5b7aaf]&&_0xeea1a4[_0x5b7aaf][_0x0e7a('0x53')]!==_0x0e7a('0x9a')){_0x40bb7f[_0x0e7a('0xba')](_0x40bb7f[_0x0e7a('0x21')][_0xeea1a4[_0x5b7aaf][_0x0e7a('0xbb')]]);logger[_0x0e7a('0x9f')](_0x0e7a('0xbc'),_0x58b17e,_0x5b7aaf,_0xeea1a4[_0x5b7aaf][_0x0e7a('0xbb')]);delete _0xeea1a4[_0x5b7aaf];}if(_0xeea1a4[_0x5b7aaf]&&_0xeea1a4[_0x5b7aaf][_0x0e7a('0x53')]===_0x0e7a('0x9a')){_0x40bb7f[_0x0e7a('0xba')](_0x40bb7f[_0x0e7a('0x22')][_0xeea1a4[_0x5b7aaf][_0x0e7a('0xbb')]]);logger['error'](_0x0e7a('0xbd'),_0x58b17e,_0x5b7aaf,_0xeea1a4[_0x5b7aaf]['queue']);delete _0xeea1a4[_0x5b7aaf];}},0x2328);}});}});}}};Dialer[_0x0e7a('0x1c')][_0x0e7a('0xbe')]=function(_0x3a84c3){return BPromise[_0x0e7a('0xbf')]()[_0x0e7a('0x41')](cmHopper['countReScheduled'](_0x3a84c3))['catch'](loggerCatch(_0x0e7a('0xc0')));};Dialer[_0x0e7a('0x1c')][_0x0e7a('0xc1')]=function(_0x119e16){return BPromise['resolve']()[_0x0e7a('0x41')](cmHopperBlack[_0x0e7a('0xc1')](_0x119e16))[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0xc3')));};Dialer[_0x0e7a('0x1c')][_0x0e7a('0xc4')]=function(_0xc370c1){return BPromise[_0x0e7a('0xbf')]()[_0x0e7a('0x41')](cmHopperBlack[_0x0e7a('0xc4')](_0xc370c1))[_0x0e7a('0xc2')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x0e7a('0x1c')][_0x0e7a('0xc5')]=function(_0x4770a8){return BPromise[_0x0e7a('0xbf')]()[_0x0e7a('0x41')](cmHopperHistory[_0x0e7a('0xc6')](_0x4770a8))[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0xc7')));};Dialer[_0x0e7a('0x1c')][_0x0e7a('0xc8')]=function(_0x584b50){return BPromise[_0x0e7a('0xbf')]()[_0x0e7a('0x41')](cmHopper['rescheduleContact'](_0x584b50))[_0x0e7a('0xc2')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype']['unlockContact']=function(_0x3d4272,_0x1fc8a6,_0x368cb8){return BPromise[_0x0e7a('0xbf')]()[_0x0e7a('0x41')](cmHopper[_0x0e7a('0xc9')](_0x3d4272,_0x1fc8a6,_0x368cb8))[_0x0e7a('0xc2')](loggerCatch('[unlockContact]\x20'));};Dialer['prototype']['getContactDialer']=function(_0x52a519,_0x5cbcae,_0x40b2ab,_0x3b29f4,_0x1fabed){return BPromise[_0x0e7a('0xbf')]()[_0x0e7a('0x41')](cmHopper[_0x0e7a('0xca')](_0x52a519,_0x5cbcae,_0x40b2ab,_0x3b29f4))[_0x0e7a('0xc2')](function(_0x14ba79){_0x1fabed['temp']-=_0x40b2ab;_0x1fabed[_0x0e7a('0xcb')]=_0x1fabed['temp']>0x0?_0x1fabed[_0x0e7a('0xcb')]:0x0;loggerCatch(_0x0e7a('0xcc'))(_0x14ba79);});};Dialer['prototype']['getContactDialerIvr']=function(_0x2a3bb5,_0x22258d,_0x49dbbc,_0x234b03){return BPromise[_0x0e7a('0xbf')]()[_0x0e7a('0x41')](cmHopper[_0x0e7a('0xcd')](_0x2a3bb5,_0x22258d,_0x49dbbc))[_0x0e7a('0xc2')](function(_0x3f0549){_0x234b03['temp']-=_0x22258d;_0x234b03[_0x0e7a('0xcb')]=_0x234b03[_0x0e7a('0xcb')]>0x0?_0x234b03['temp']:0x0;loggerCatch(_0x0e7a('0xce'))(_0x3f0549);});};Dialer[_0x0e7a('0x1c')]['getVoiceQueueRtPauses']=function(_0x58bd01){return BPromise[_0x0e7a('0xbf')]()[_0x0e7a('0x41')](voiceQueueRt['getVoiceQueueRtPauses'](_0x58bd01))['catch'](loggerCatch(_0x0e7a('0xcf')));};Dialer[_0x0e7a('0x1c')][_0x0e7a('0xd0')]=function(_0x495513){return BPromise[_0x0e7a('0xbf')]()['then'](cmHopper[_0x0e7a('0xd0')](_0x495513))[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0xd1')));};Dialer[_0x0e7a('0x1c')][_0x0e7a('0xd2')]=function(_0x18aa76){return BPromise[_0x0e7a('0xbf')]()[_0x0e7a('0x41')](cmHopperHistory[_0x0e7a('0xd2')](_0x18aa76))['catch'](loggerCatch(_0x0e7a('0xd3')));};Dialer[_0x0e7a('0x1c')][_0x0e7a('0xba')]=function(_0x397eab){if(!_[_0x0e7a('0x42')](_0x397eab)&&_0x397eab!==null){if(typeof _0x397eab[_0x0e7a('0x76')]!==_0x0e7a('0xa3')){if(_0x397eab[_0x0e7a('0x76')]>0x0){_0x397eab[_0x0e7a('0x76')]-=0x1;}else{logger[_0x0e7a('0x9f')](_0x0e7a('0xd4'));}}}else{logger[_0x0e7a('0x9f')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x0e7a('0x1c')][_0x0e7a('0xd5')]=function(_0x2ddc49,_0x507789){var _0x4d1b8d=this;return function(_0x438513){_0x4d1b8d[_0x0e7a('0xba')](_0x507789);logger[_0x0e7a('0x9f')](_0x2ddc49,util[_0x0e7a('0xa0')](_0x438513,{'showHidden':![],'depth':null}));};};Dialer[_0x0e7a('0x1c')][_0x0e7a('0xd6')]=function(_0x42c6af,_0x2d787a,_0x2e3f9b){var _0x48d01b={'state':0x19,'statedesc':_0x0e7a('0xd7')};this[_0x0e7a('0xba')](_0x2d787a);this[_0x0e7a('0xd8')](_[_0x0e7a('0x93')](_0x48d01b,_['pick'](_0x2e3f9b,[_0x0e7a('0xd9'),_0x0e7a('0xda'),_0x0e7a('0xdb'),_0x0e7a('0xdc'),_0x0e7a('0xdd')])),'[emptyContact][createHistory]',_0x0e7a('0xde'));logger['error'](_0x42c6af);};Dialer[_0x0e7a('0x1c')][_0x0e7a('0xdf')]=function(_0xc7741){return _0xc7741===_0x0e7a('0xe0');};Dialer[_0x0e7a('0x1c')][_0x0e7a('0xe1')]=function(_0x391b95){return!_[_0x0e7a('0x42')](_0x391b95)&&_0x391b95&&!_[_0x0e7a('0x42')](_0x391b95[_0x0e7a('0x44')])&&!_['isUndefined'](_0x391b95[_0x0e7a('0x7b')])&&_0x391b95[_0x0e7a('0x7b')]&&(this['trunks'][util[_0x0e7a('0x9d')]('SIP/%s',_0x391b95[_0x0e7a('0x44')])][_0x0e7a('0xb8')]===_0x0e7a('0xe2')||this[_0x0e7a('0x24')][util[_0x0e7a('0x9d')](_0x0e7a('0xe3'),_0x391b95[_0x0e7a('0x44')])][_0x0e7a('0xb8')]==='unmonitored');};Dialer[_0x0e7a('0x1c')][_0x0e7a('0xd8')]=function(_0x157c66,_0x53ec1f,_0x282ded){this[_0x0e7a('0xd2')](_0x157c66)['catch'](loggerCatch(_0x53ec1f));this['moveContactManagedDialer'](_0x157c66)['catch'](loggerCatch(_0x282ded));};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x3c')]=function(_0x107be8){var _0x112c00=this[_0x0e7a('0x29')][_0x107be8[_0x0e7a('0xe4')]];var _0x47fe55;if(!_[_0x0e7a('0xb6')](_0x107be8)&&!_[_0x0e7a('0xb6')](_0x107be8[_0x0e7a('0xe5')])&&!_['isNil'](_0x107be8[_0x0e7a('0xe5')]['amdstatus'])&&_0x107be8[_0x0e7a('0xe6')]===_0x0e7a('0xe7')&&_0x112c00){if(_0x112c00[_0x0e7a('0x53')]!==_0x0e7a('0x9a')&&this[_0x0e7a('0x21')][_0x112c00['queue']]['dialAMDActive']&&_0x107be8[_0x0e7a('0xe8')]===_0x0e7a('0xe9')){delete this['uniqueId'][_0x107be8[_0x0e7a('0xe4')]];this['updateOriginated'](this['voiceQueues'][_0x112c00[_0x0e7a('0xbb')]]);this[_0x0e7a('0x21')][_0x112c00[_0x0e7a('0xbb')]][_0x0e7a('0xea')]+=0x1;this['voiceQueues'][_0x112c00['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x47fe55=new Hangup(_0x112c00,_0x107be8);_0x47fe55[_0x0e7a('0xb1')]=0x12;_0x47fe55['statedesc']=_0x0e7a('0xeb');_0x47fe55[_0x0e7a('0xec')]=_0x0e7a('0xed');ami[_0x0e7a('0x52')]('custom:amd',ut['buildObj'](_0x47fe55,'amd'));this['saveInDb'](_0x47fe55,'[syncHangupInAMD][createHistory]',_0x0e7a('0xee'));}if(_0x112c00[_0x0e7a('0x53')]!=='ivr'&&this[_0x0e7a('0x21')][_0x112c00[_0x0e7a('0xbb')]][_0x0e7a('0xef')]&&_0x107be8[_0x0e7a('0xe8')]===_0x0e7a('0xf0')){var _0x5aa88d=this;return new BPromise(function(_0x238a95,_0x404d2b){delete _0x5aa88d[_0x0e7a('0x29')][_0x107be8[_0x0e7a('0xe4')]];_0x5aa88d[_0x0e7a('0xba')](_0x5aa88d[_0x0e7a('0x21')][_0x112c00[_0x0e7a('0xbb')]]);_0x5aa88d['voiceQueues'][_0x112c00['queue']]['outboundAnswerCallsDay']+=0x1;_0x5aa88d['voiceQueues'][_0x112c00[_0x0e7a('0xbb')]][_0x0e7a('0xf1')]+=0x1;var _0x190636=_0x5aa88d['voiceQueues'][_0x112c00[_0x0e7a('0xbb')]];var _0x71cd64=new Hangup(_0x112c00,_0x107be8);_0x71cd64['state']=0x13;_0x71cd64[_0x0e7a('0xf2')]=_0x0e7a('0xf3');_0x71cd64['membername']=_0x0e7a('0xed');_0x71cd64['countmachineretry']+=0x1;_0x71cd64[_0x0e7a('0xf4')]+=0x1;_0x71cd64[_0x0e7a('0xf5')]=!![];ami[_0x0e7a('0x52')](_0x0e7a('0xf6'),ut[_0x0e7a('0xf7')](_0x71cd64,'amd'));_0x5aa88d[_0x0e7a('0xd2')](_0x71cd64)[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0xf8')));if(_0x71cd64[_0x0e7a('0xf9')]+_0x71cd64[_0x0e7a('0xfa')]+_0x71cd64[_0x0e7a('0xfb')]+_0x71cd64[_0x0e7a('0xfc')]+_0x71cd64[_0x0e7a('0xfd')]+_0x71cd64[_0x0e7a('0xfe')]+_0x71cd64[_0x0e7a('0xff')]+_0x71cd64[_0x0e7a('0x100')]>=_0x190636[_0x0e7a('0x101')]){_0x5aa88d[_0x0e7a('0x102')](_0x71cd64,_0x238a95,_0x404d2b,_0x0e7a('0x103'));}else{if(_0x71cd64['countmachineretry']>=_0x190636[_0x0e7a('0x104')]){_0x5aa88d[_0x0e7a('0x105')](_0x71cd64,_0x238a95,_0x404d2b,_0x0e7a('0x106'));}else{_0x5aa88d[_0x0e7a('0xc8')]({'active':![],'countmachineretry':_0x71cd64[_0x0e7a('0xff')],'scheduledat':moment()[_0x0e7a('0x107')](_0x190636[_0x0e7a('0x108')],_0x0e7a('0x109'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x71cd64[_0x0e7a('0xd9')],'ListId':_0x71cd64[_0x0e7a('0xda')],'VoiceQueueId':_0x71cd64['VoiceQueueId']||undefined,'CampaignId':_0x71cd64[_0x0e7a('0xdd')]||undefined})[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x10a')));_0x238a95({'reschedule':0x1});}}});}if(_0x112c00[_0x0e7a('0x53')]===_0x0e7a('0x9a')&&this[_0x0e7a('0x22')][_0x112c00['queue']][_0x0e7a('0xef')]&&_0x107be8['value']===_0x0e7a('0xe9')){delete this[_0x0e7a('0x29')][_0x107be8[_0x0e7a('0xe4')]];this['updateOriginated'](this[_0x0e7a('0x22')][_0x112c00[_0x0e7a('0xbb')]]);_0x47fe55=new Hangup(_0x112c00,_0x107be8);_0x47fe55[_0x0e7a('0xb1')]=0x12;_0x47fe55[_0x0e7a('0xf2')]=_0x0e7a('0xeb');_0x47fe55['membername']='AMD';ami['emit'](_0x0e7a('0xf6'),ut['buildObj'](_0x47fe55,_0x0e7a('0xf5')));this['saveInDb'](_0x47fe55,'[syncHangupInAMDIvr][createHistory]',_0x0e7a('0x10b'));}if(_0x112c00[_0x0e7a('0x53')]==='ivr'&&this['campaigns'][_0x112c00[_0x0e7a('0xbb')]]['dialAMDActive']&&_0x107be8[_0x0e7a('0xe8')]===_0x0e7a('0xf0')){var _0x5aa88d=this;return new BPromise(function(_0x1edab0,_0x784ea){delete _0x5aa88d[_0x0e7a('0x29')][_0x107be8[_0x0e7a('0xe4')]];_0x5aa88d[_0x0e7a('0xba')](_0x5aa88d[_0x0e7a('0x22')][_0x112c00[_0x0e7a('0xbb')]]);_0x5aa88d[_0x0e7a('0x22')][_0x112c00['queue']][_0x0e7a('0xea')]+=0x1;_0x5aa88d[_0x0e7a('0x22')][_0x112c00[_0x0e7a('0xbb')]][_0x0e7a('0xf1')]+=0x1;var _0x1cc92e=_0x5aa88d[_0x0e7a('0x22')][_0x112c00['queue']];var _0xc8ccd9=new Hangup(_0x112c00,_0x107be8);_0xc8ccd9[_0x0e7a('0xb1')]=0x13;_0xc8ccd9[_0x0e7a('0xf2')]=_0x0e7a('0xf3');_0xc8ccd9['membername']='AMD';_0xc8ccd9['countmachineretry']+=0x1;_0xc8ccd9[_0x0e7a('0xf4')]+=0x1;_0xc8ccd9[_0x0e7a('0xf5')]=!![];ami['emit']('custom:amd',ut[_0x0e7a('0xf7')](_0xc8ccd9,'amd'));_0x5aa88d[_0x0e7a('0xd2')](_0xc8ccd9)[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0xf8')));if(_0xc8ccd9['countbusyretry']+_0xc8ccd9[_0x0e7a('0xfa')]+_0xc8ccd9[_0x0e7a('0xfb')]+_0xc8ccd9['countnosuchnumberretry']+_0xc8ccd9[_0x0e7a('0xfd')]+_0xc8ccd9[_0x0e7a('0xfe')]+_0xc8ccd9[_0x0e7a('0xff')]+_0xc8ccd9[_0x0e7a('0x100')]>=_0x1cc92e[_0x0e7a('0x101')]){_0x5aa88d[_0x0e7a('0x102')](_0xc8ccd9,_0x1edab0,_0x784ea,_0x0e7a('0x103'));}else{if(_0xc8ccd9[_0x0e7a('0xff')]>=_0x1cc92e[_0x0e7a('0x104')]){_0x5aa88d['createStateFinal'](_0xc8ccd9,_0x1edab0,_0x784ea,'reason\x2019\x20machine....');}else{_0x5aa88d[_0x0e7a('0xc8')]({'active':![],'countmachineretry':_0xc8ccd9[_0x0e7a('0xff')],'scheduledat':moment()[_0x0e7a('0x107')](_0x1cc92e['dialMachineRetryFrequency'],_0x0e7a('0x109'))[_0x0e7a('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xc8ccd9[_0x0e7a('0xd9')],'ListId':_0xc8ccd9[_0x0e7a('0xda')],'VoiceQueueId':_0xc8ccd9[_0x0e7a('0xdc')]||undefined,'CampaignId':_0xc8ccd9[_0x0e7a('0xdd')]||undefined})['catch'](loggerCatch(_0x0e7a('0x10a')));_0x1edab0({'reschedule':0x1});}}});}}};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x39')]=function(_0x58cfc5){var _0x73297b=this[_0x0e7a('0x29')][_0x58cfc5[_0x0e7a('0xe4')]];var _0x75506=this;var _0x1993a6;if(_0x73297b&&_0x73297b['type']===_0x0e7a('0x9a')){delete this[_0x0e7a('0x29')][_0x58cfc5[_0x0e7a('0xe4')]];this['updateOriginated'](this[_0x0e7a('0x22')][_0x73297b[_0x0e7a('0xbb')]]);this['campaigns'][_0x73297b['queue']][_0x0e7a('0x10c')]+=0x1;_0x1993a6=new Hangup(_0x73297b,_0x58cfc5);this[_0x0e7a('0xd2')](_0x1993a6)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x0e7a('0xd0')](_0x1993a6)[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x10d')));}if(_0x73297b&&_0x73297b[_0x0e7a('0x53')]!==_0x0e7a('0x9a')&&isNotNull(this['voiceQueues'][_0x73297b['queue']][_0x0e7a('0x10e')])){delete this['uniqueId'][_0x58cfc5[_0x0e7a('0xe4')]];this[_0x0e7a('0xba')](this[_0x0e7a('0x21')][_0x73297b['queue']]);this[_0x0e7a('0x21')][_0x73297b[_0x0e7a('0xbb')]][_0x0e7a('0xea')]+=0x1;this['voiceQueues'][_0x73297b[_0x0e7a('0xbb')]]['outboundAnswerAgiCallsDay']+=0x1;_0x1993a6=new Hangup(_0x73297b,_0x58cfc5);_0x1993a6[_0x0e7a('0xb1')]=0x10;_0x1993a6[_0x0e7a('0xf2')]='AnswerAGI';_0x1993a6['membername']='AGI';this[_0x0e7a('0xd2')](_0x1993a6)['catch'](loggerCatch(_0x0e7a('0x10f')));this[_0x0e7a('0xd0')](_0x1993a6)[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x10d')));}if(_0x73297b&&_0x73297b[_0x0e7a('0x53')]!==_0x0e7a('0x9a')&&!isNotNull(this[_0x0e7a('0x21')][_0x73297b[_0x0e7a('0xbb')]]['dialQueueProject'])){delete this['uniqueId'][_0x58cfc5[_0x0e7a('0xe4')]];this['updateOriginated'](this[_0x0e7a('0x21')][_0x73297b[_0x0e7a('0xbb')]]);this[_0x0e7a('0x21')][_0x73297b['queue']]['outboundUnknownCallsDay']+=0x1;_0x1993a6=new Hangup(_0x73297b,_0x58cfc5);_0x1993a6[_0x0e7a('0xb1')]=0xc;_0x1993a6['statedesc']=_0x58cfc5[_0x0e7a('0x110')];_0x1993a6[_0x0e7a('0xec')]='Unknow';this[_0x0e7a('0xd2')](_0x1993a6)[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x10f')));this[_0x0e7a('0xd0')](_0x1993a6)[_0x0e7a('0xc2')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x36')]=function(_0x3cbeec){var _0x1bb48d=this[_0x0e7a('0x29')][_0x3cbeec[_0x0e7a('0xe4')]];var _0x1f3d60=this;if(this['voiceQueues'][_0x3cbeec[_0x0e7a('0xbb')]]){if(_0x1bb48d&&_0x1bb48d['type']!==_0x0e7a('0x9a')){delete this[_0x0e7a('0x29')][_0x3cbeec[_0x0e7a('0xe4')]];this[_0x0e7a('0x21')][_0x3cbeec[_0x0e7a('0xbb')]][_0x0e7a('0xea')]+=0x1;var _0x31a082=new AgentComplete(_0x1bb48d,_0x3cbeec);if(_0x3cbeec[_0x0e7a('0x111')]===_0x0e7a('0x112')){_0x31a082[_0x0e7a('0x113')]=this[_0x0e7a('0x21')][_0x3cbeec['queue']][_0x0e7a('0x114')]&&this[_0x0e7a('0x21')][_0x3cbeec[_0x0e7a('0xbb')]][_0x0e7a('0x115')]?moment()['format'](_0x0e7a('0x116')):undefined;}this['createHistory'](_0x31a082)[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x117')));this[_0x0e7a('0xd0')](_0x31a082)[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x118')));}}};Dialer[_0x0e7a('0x1c')]['syncAgentConnect']=function(_0x17f2da){if(this[_0x0e7a('0x21')][_0x17f2da[_0x0e7a('0xbb')]]){if(this['uniqueId'][_0x17f2da[_0x0e7a('0xe4')]]&&this['uniqueId'][_0x17f2da[_0x0e7a('0xe4')]][_0x0e7a('0x53')]!==_0x0e7a('0x9a')){this[_0x0e7a('0xba')](this['voiceQueues'][_0x17f2da[_0x0e7a('0xbb')]]);this[_0x0e7a('0x29')][_0x17f2da[_0x0e7a('0xe4')]][_0x0e7a('0x119')]=moment()[_0x0e7a('0x9d')](_0x0e7a('0x116'));}}};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x11a')]=function(_0x12afb6){this[_0x0e7a('0xd2')](_0x12afb6)[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x117')));this[_0x0e7a('0xd0')](_0x12afb6)[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x11b')));};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x32')]=function(_0x4dcd0f){var _0x2cf549=this[_0x0e7a('0x29')][_0x4dcd0f['uniqueid']];var _0x569856=this;if(this[_0x0e7a('0x21')][_0x4dcd0f[_0x0e7a('0xbb')]]){if(_0x2cf549&&_0x2cf549['type']!==_0x0e7a('0x9a')){delete this['uniqueId'][_0x4dcd0f[_0x0e7a('0xe4')]];this[_0x0e7a('0xba')](this[_0x0e7a('0x21')][_0x4dcd0f[_0x0e7a('0xbb')]]);_0x2cf549[_0x0e7a('0x11c')]=moment()['format'](_0x0e7a('0x116'));var _0x378a8b=new QueueCallerAbandon(_0x2cf549,_0x4dcd0f);if(getSeconds(_0x2cf549['droptime'],_0x2cf549[_0x0e7a('0x11d')])>=_0x2cf549[_0x0e7a('0x11e')]){this['voiceQueues'][_0x4dcd0f[_0x0e7a('0xbb')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x0e7a('0x21')][_0x4dcd0f[_0x0e7a('0xbb')]][_0x0e7a('0x67')]+=0x1;this[_0x0e7a('0x21')][_0x4dcd0f[_0x0e7a('0xbb')]][_0x0e7a('0x70')]+=0x1;_0x378a8b[_0x0e7a('0xb1')]=0xa;_0x378a8b['statedesc']='Drop';_0x378a8b[_0x0e7a('0x11f')]=_0x0e7a('0x120');_0x378a8b[_0x0e7a('0x113')]=this[_0x0e7a('0x21')][_0x4dcd0f[_0x0e7a('0xbb')]][_0x0e7a('0x114')]?moment()[_0x0e7a('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x378a8b['countdropretry']+=0x1;_0x378a8b['countglobal']+=0x1;if(_0x378a8b[_0x0e7a('0xfd')]>=this[_0x0e7a('0x21')][_0x4dcd0f[_0x0e7a('0xbb')]][_0x0e7a('0x121')]){this[_0x0e7a('0x11a')](_0x378a8b);}else{this[_0x0e7a('0xc8')]({'active':![],'countdropretry':_0x378a8b['countdropretry'],'scheduledat':moment()[_0x0e7a('0x107')](this[_0x0e7a('0x21')][_0x4dcd0f[_0x0e7a('0xbb')]][_0x0e7a('0x122')],_0x0e7a('0x109'))['format'](_0x0e7a('0x116')),'ContactId':_0x2cf549[_0x0e7a('0xd9')],'ListId':_0x2cf549[_0x0e7a('0xda')],'VoiceQueueId':_0x2cf549[_0x0e7a('0xdc')]||undefined,'CampaignId':_0x2cf549[_0x0e7a('0xdd')]||undefined})['catch'](loggerCatch(_0x0e7a('0x123')));var _0x1ef3fe=new History(_0x378a8b);_0x1ef3fe[_0x0e7a('0xb1')]=0xa;_0x1ef3fe[_0x0e7a('0xf2')]='Drop';_0x1ef3fe['starttime']=moment()['format'](_0x0e7a('0x116'));_0x1ef3fe['endtime']=_0x1ef3fe['starttime'];_0x1ef3fe[_0x0e7a('0x124')]=_0x378a8b['calleridname'];_0x1ef3fe[_0x0e7a('0x125')]=_0x378a8b[_0x0e7a('0x125')];this[_0x0e7a('0xd2')](_0x1ef3fe)[_0x0e7a('0xc2')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this['voiceQueues'][_0x4dcd0f['queue']][_0x0e7a('0x86')]+=0x1;this[_0x0e7a('0x21')][_0x4dcd0f[_0x0e7a('0xbb')]][_0x0e7a('0x66')]+=0x1;_0x378a8b[_0x0e7a('0xb1')]=0xb;_0x378a8b[_0x0e7a('0xf2')]=_0x0e7a('0x126');_0x378a8b[_0x0e7a('0x11f')]='CALLEREXIT';_0x378a8b[_0x0e7a('0xfe')]+=0x1;_0x378a8b[_0x0e7a('0xf4')]+=0x1;if(_0x378a8b['countabandonedretry']>=this[_0x0e7a('0x21')][_0x4dcd0f[_0x0e7a('0xbb')]]['dialAbandonedMaxRetry']){this[_0x0e7a('0x11a')](_0x378a8b);}else{this[_0x0e7a('0xc8')]({'active':![],'countabandonedretry':_0x378a8b[_0x0e7a('0xfe')],'scheduledat':moment()[_0x0e7a('0x107')](this[_0x0e7a('0x21')][_0x4dcd0f[_0x0e7a('0xbb')]][_0x0e7a('0x127')],'minutes')[_0x0e7a('0x9d')](_0x0e7a('0x116')),'ContactId':_0x2cf549['ContactId'],'ListId':_0x2cf549[_0x0e7a('0xda')],'VoiceQueueId':_0x2cf549[_0x0e7a('0xdc')]||undefined,'CampaignId':_0x2cf549['CampaignId']||undefined})[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x128')));var _0x1ef3fe=new History(_0x378a8b);_0x1ef3fe[_0x0e7a('0xb1')]=0xb;_0x1ef3fe['statedesc']=_0x0e7a('0x126');_0x1ef3fe[_0x0e7a('0xb2')]=moment()[_0x0e7a('0x9d')](_0x0e7a('0x116'));_0x1ef3fe[_0x0e7a('0x129')]=_0x1ef3fe[_0x0e7a('0xb2')];_0x1ef3fe[_0x0e7a('0x124')]=_0x378a8b[_0x0e7a('0x124')];_0x1ef3fe[_0x0e7a('0x125')]=_0x378a8b[_0x0e7a('0x125')];this['createHistory'](_0x1ef3fe)[_0x0e7a('0xc2')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer['prototype'][_0x0e7a('0x3b')]=function(_0x4540e3){if(this[_0x0e7a('0x27')][_0x4540e3['uniqueid']]){this[_0x0e7a('0x27')][_0x4540e3[_0x0e7a('0xe4')]][_0x0e7a('0xb9')]=_0x4540e3['channel'];}if(this['uniqueId'][_0x4540e3[_0x0e7a('0xe4')]]){this[_0x0e7a('0x29')][_0x4540e3[_0x0e7a('0xe4')]][_0x0e7a('0xb9')]=_0x4540e3[_0x0e7a('0xb9')];}};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x3d')]=function(_0x5638d1){if(strategy[this[_0x0e7a('0x21')][this[_0x0e7a('0x27')][_0x5638d1[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]][_0x0e7a('0x54')]]===_0x0e7a('0x1b')){if(this[_0x0e7a('0x27')][_0x5638d1['actionid']]&&_[_0x0e7a('0xb6')](this[_0x0e7a('0x27')][_0x5638d1[_0x0e7a('0x12a')]][_0x0e7a('0x12b')])&&_0x5638d1[_0x0e7a('0xb8')]==='1'&&_0x5638d1[_0x0e7a('0x12c')]==='0'){if(this[_0x0e7a('0x23')][_0x5638d1[_0x0e7a('0x12d')]]){if(!this[_0x0e7a('0x23')][_0x5638d1[_0x0e7a('0x12d')]]['locked']){this[_0x0e7a('0x23')][_0x5638d1[_0x0e7a('0x12d')]][_0x0e7a('0x12b')]=!![];this[_0x0e7a('0x27')][_0x5638d1[_0x0e7a('0x12a')]][_0x0e7a('0x12b')]=!![];this['actions'][_0x5638d1[_0x0e7a('0x12a')]][_0x0e7a('0x12d')]=_0x5638d1[_0x0e7a('0x12d')];}}}}else if((strategy[this[_0x0e7a('0x21')][this[_0x0e7a('0x27')][_0x5638d1[_0x0e7a('0x12a')]]['queue']]['strategy']]||_0x0e7a('0x12e'))==='rrmemory'){if(this[_0x0e7a('0x27')][_0x5638d1[_0x0e7a('0x12a')]]){if(this['agents'][_0x5638d1[_0x0e7a('0x12d')]]){this['actions'][_0x5638d1[_0x0e7a('0x12a')]][_0x0e7a('0x12d')]=_0x5638d1[_0x0e7a('0x12d')];if(_['isNil'](this[_0x0e7a('0x2c')][this['actions'][_0x5638d1[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]])){this['queueBooked'][this[_0x0e7a('0x27')][_0x5638d1[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]]=[];}this[_0x0e7a('0x2c')][this[_0x0e7a('0x27')][_0x5638d1['actionid']][_0x0e7a('0xbb')]][_0x0e7a('0x12f')](_[_0x0e7a('0x93')](_[_0x0e7a('0x130')](this['actions'][_0x5638d1['actionid']],[_0x0e7a('0x131'),'stateinterface']),{'status':_0x5638d1[_0x0e7a('0xb8')],'paused':_0x5638d1[_0x0e7a('0x12c')]}));}}}};function unlockQueueStatus(_0x2622fe,_0x1f9091){setTimeout(function(){if(_[_0x0e7a('0x42')](_0x2622fe['queueStatusComplete'])){loggerBooked[_0x0e7a('0x9f')](_0x0e7a('0x132'),_0x1f9091);}_0x2622fe[_0x0e7a('0x133')]=!![];loggerBooked[_0x0e7a('0x85')](_0x0e7a('0x134'),_0x1f9091,JSON[_0x0e7a('0x4e')](_[_0x0e7a('0x130')](_0x2622fe,['name',_0x0e7a('0x133')])));},0x1f3);}Dialer['prototype'][_0x0e7a('0x3e')]=function(_0x10b65f){var _0x35a356=this;var _0x2211b2=_0x35a356[_0x0e7a('0x21')][_0x35a356['actions'][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]];if(strategy[this[_0x0e7a('0x21')][this[_0x0e7a('0x27')][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]][_0x0e7a('0x54')]]===_0x0e7a('0x1b')){if(this[_0x0e7a('0x27')][_0x10b65f[_0x0e7a('0x12a')]]&&this[_0x0e7a('0x27')][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0x12d')]){this[_0x0e7a('0x20')][_0x0e7a('0x135')](this[_0x0e7a('0x27')][_0x10b65f[_0x0e7a('0x12a')]]['idHopper'],this['actions'][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0x12d')])['catch'](function(_0x4059d9){logger[_0x0e7a('0x9f')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x4059d9,{'showHidden':![],'depth':null}));})[_0x0e7a('0x136')](function(){_0x35a356[_0x0e7a('0xba')](_0x35a356['voiceQueues'][_0x35a356['actions'][_0x10b65f['actionid']][_0x0e7a('0xbb')]]);_0x35a356[_0x0e7a('0x23')][_0x35a356[_0x0e7a('0x27')][_0x10b65f['actionid']][_0x0e7a('0x12d')]][_0x0e7a('0x12b')]=![];delete _0x35a356[_0x0e7a('0x27')][_0x10b65f['actionid']];unlockQueueStatus(_0x2211b2);});}else{this[_0x0e7a('0xba')](this[_0x0e7a('0x21')][this[_0x0e7a('0x27')][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0xd9')],'ListId':this[_0x0e7a('0x27')][_0x10b65f[_0x0e7a('0x12a')]]['ListId'],'VoiceQueueId':this['actions'][_0x10b65f['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x0e7a('0x27')][_0x10b65f[_0x0e7a('0x12a')]]['CampaignId']||undefined})[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x137')));delete this[_0x0e7a('0x27')][_0x10b65f[_0x0e7a('0x12a')]];unlockQueueStatus(_0x2211b2);}}else if((strategy[this['voiceQueues'][this[_0x0e7a('0x27')][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]]['strategy']]||'rrmemory')==='rrmemory'){var _0x55f8ba;if(this[_0x0e7a('0x27')][_0x10b65f['actionid']]&&!_[_0x0e7a('0x4b')](this['queueBooked'][this[_0x0e7a('0x27')][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]])){if(this[_0x0e7a('0x2d')][_0x35a356['actions'][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]]){this['queueBookedRR'][_0x35a356['actions'][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]]=this[_0x0e7a('0x2d')][this[_0x0e7a('0x27')][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]]?this['queueBookedRR'][this[_0x0e7a('0x27')][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]]:this[_0x0e7a('0x2c')][this[_0x0e7a('0x27')][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]]?this[_0x0e7a('0x2c')][this[_0x0e7a('0x27')][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]][_0x0e7a('0x138')]||0x0:0x0;}this['queueBooked'][this['actions'][_0x10b65f[_0x0e7a('0x12a')]][_0x0e7a('0xbb')]][_0x0e7a('0x138')]=this[_0x0e7a('0x2d')][this[_0x0e7a('0x27')][_0x10b65f['actionid']]['queue']];for(var _0x3ef29e=0x0;_0x3ef29e=0x0;})[_0x0e7a('0xc2')](myreject(_0x759a2c)));}}else{_0x18566e[_0x0e7a('0x12f')](ami[_0x0e7a('0xb7')]({'action':_0x0e7a('0x153'),'command':util['format'](_0x0e7a('0x156'),_0x255061,!_[_0x0e7a('0x42')](config['timezones'][_0x9ce64d])?_0x9ce64d:'')})[_0x0e7a('0x41')](function(_0x519de6){return _0x519de6[_0x0e7a('0x157')][_0x0e7a('0x158')]('true')>=0x0;})[_0x0e7a('0xc2')](myreject(_0x759a2c)));}BPromise['all'](_0x18566e)['then'](function(_0xaea7c8){var _0x301adf=_[_0x0e7a('0x159')](_0xaea7c8);if(_0x301adf){return _0x5e41ca(_0x301adf);}else{_0x52091c['message']=_0x4b8708?_0x0e7a('0x15a'):_0x0e7a('0x15b');return _0x759a2c(msgResponse('[ifTime][promiseAll]',_0x0e7a('0x14d'),_0x0e7a('0x15c')+_0x4b8708+'\x20'+_0x2b0c5b+_0x0e7a('0x15d')+util['inspect'](_0x255061,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x9ce64d));}})[_0x0e7a('0xc2')](function(_0x1fd816){return _0x759a2c(msgResponse('ifTime',_0x0e7a('0x14d'),JSON[_0x0e7a('0x4e')](_0x1fd816)));});});};Dialer[_0x0e7a('0x1c')]['checkDialMethod']=function(_0x26c038){var _0x29ea7d=this;return function(){switch(_0x26c038[_0x0e7a('0x5f')]){case'progressive':freeVariablesPredictive(_0x26c038);_0x29ea7d[_0x0e7a('0x15e')](_0x26c038,0x1);break;case _0x0e7a('0x15f'):freeVariablesPredictive(_0x26c038);_0x29ea7d[_0x0e7a('0x15e')](_0x26c038,_0x26c038[_0x0e7a('0x160')]);break;case _0x0e7a('0x8'):_0x29ea7d[_0x0e7a('0x8')](_0x26c038);break;case _0x0e7a('0x161'):freeVariablesPredictive(_0x26c038);_0x29ea7d[_0x0e7a('0x15e')](_0x26c038,0x1);break;default:freeVariablesPredictive(_0x26c038);logger[_0x0e7a('0x9f')](_0x0e7a('0x162'),_0x26c038[_0x0e7a('0x44')],_0x0e7a('0x163'));}};};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x164')]=function(_0x3cf39c){return BPromise[_0x0e7a('0xbf')]()[_0x0e7a('0x41')](cmHopper[_0x0e7a('0x165')](_0x3cf39c['id'],previewRecallmeReminderInterval))[_0x0e7a('0x41')](function(_0x3fe787){for(var _0x2d0d08=0x0;_0x2d0d08<_0x3fe787[_0x0e7a('0xa2')];_0x2d0d08++){var _0x374079=_0x3fe787[_0x2d0d08][_0x0e7a('0x166')][_0x0e7a('0x44')];if(_0x374079)io['to'](util[_0x0e7a('0x9d')](_0x0e7a('0x167'),_0x374079))[_0x0e7a('0x52')](_0x0e7a('0x168'),{'hopper':_0x3fe787[_0x2d0d08]});}})[_0x0e7a('0xc2')](function(_0x5b067b){});};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x169')]=function(_0x5e8072){var _0x14c920=this;return function(){_0x14c920[_0x0e7a('0x16a')](_0x5e8072);};};Dialer[_0x0e7a('0x1c')][_0x0e7a('0xa')]=function(_0x2968b1){var _0xcedd83=this;if(isNotPreview(_0x2968b1[_0x0e7a('0x5f')])){if(isVoiceQueueOutbound(_0x2968b1[_0x0e7a('0x53')])&&isActive(_0x2968b1[_0x0e7a('0x5e')])){_0x2968b1[_0x0e7a('0xab')]=!![];BPromise[_0x0e7a('0xbf')]()['then'](checkIsLoggedIn(_0x2968b1,_0x2968b1[_0x0e7a('0x16b')]))[_0x0e7a('0x41')](checkIsActive(_0x2968b1,_0x2968b1[_0x0e7a('0x5e')]))[_0x0e7a('0x41')](checkInterval(_0x2968b1))[_0x0e7a('0x41')](_0xcedd83[_0x0e7a('0x147')](_0x2968b1))[_0x0e7a('0x41')](_0xcedd83[_0x0e7a('0x14b')](_0x2968b1[_0x0e7a('0x16c')],_0x2968b1[_0x0e7a('0x16d')],_0x2968b1[_0x0e7a('0x44')],_0x2968b1))[_0x0e7a('0x41')](_0xcedd83['checkIfTimeIntervals'](_0x2968b1['Interval'],_0x2968b1['dialTimezone'],_0x2968b1[_0x0e7a('0x44')],_0x2968b1))[_0x0e7a('0x41')](_0xcedd83[_0x0e7a('0x16e')](_0x2968b1))['catch'](loggerCatchQueueSummary(_0x0e7a('0x16f'),_0x2968b1));}else{notSendMessagesQueue(_0x2968b1);}}else{freeVariablesPredictive(_0x2968b1);if(_0x2968b1['dialPreviewRecallmeReminder']){_0xcedd83[_0x0e7a('0x164')](_0x2968b1);}}};Dialer[_0x0e7a('0x1c')]['syncCampaigns']=function(){var _0x4c8dff=this;var _0x6740b7;for(var _0x148e4e in this['campaigns']){if(typeof this[_0x0e7a('0x22')][_0x148e4e]!==_0x0e7a('0xa3')){_0x6740b7=this[_0x0e7a('0x22')][_0x148e4e];if(isCampaignIvr(_0x6740b7[_0x0e7a('0x53')])&&isActive(_0x6740b7[_0x0e7a('0x7b')])){_0x6740b7[_0x0e7a('0xab')]=!![];BPromise[_0x0e7a('0xbf')]()['then'](checkIsActive(_0x6740b7,_0x6740b7[_0x0e7a('0x7b')]))[_0x0e7a('0x41')](checkInterval(_0x6740b7))[_0x0e7a('0x41')](_0x4c8dff[_0x0e7a('0x147')](_0x6740b7))['then'](_0x4c8dff[_0x0e7a('0x14b')](_0x6740b7['dialGlobalInterval'],_0x6740b7[_0x0e7a('0x16d')],_0x6740b7[_0x0e7a('0x44')],_0x6740b7))[_0x0e7a('0x41')](_0x4c8dff[_0x0e7a('0x170')](_0x6740b7[_0x0e7a('0x7d')],_0x6740b7['dialTimezone'],_0x6740b7[_0x0e7a('0x44')],_0x6740b7))['then'](_0x4c8dff[_0x0e7a('0x169')](_0x6740b7))['catch'](loggerCatchQueueSummary(_0x0e7a('0x171'),_0x6740b7));}else{notSendMessagesCampaign(_0x6740b7);}}}};function getCallerIdRandom(_0x5668d5,_0x26cb73){var _0x43824f;var _0x1b5494;var _0x656743;if(_0x26cb73<=0x0){_0x26cb73=0x1;}_0x43824f=new RegExp(_0x0e7a('0x172')+_0x26cb73+'}$');_0x1b5494=Math[_0x0e7a('0x173')](0xa,_0x26cb73-0x1);_0x656743=Math['pow'](0xa,_0x26cb73)-0x1;return util[_0x0e7a('0x9d')]('%s',_[_0x0e7a('0x174')](_0x5668d5,_0x43824f,_[_0x0e7a('0x175')](_0x1b5494,_0x656743)));}function extractCalleridName(_0x1473d4){var _0x54957d=_0x1473d4[_0x0e7a('0x176')](/"(.*?)"/);return _0x54957d?_0x54957d[0x1]:_0x1473d4;}function extractCalleridNumber(_0x4f4f0){var _0x199264=_0x4f4f0['match'](/<(.*?)>/);return _0x199264?_0x199264[0x1]:_0x4f4f0;}Dialer[_0x0e7a('0x1c')]['actionOriginate']=function(_0x1cd0b0,_0x1e2642){var _0x52c2d5=this;var _0x22bc4d=uuid['v4']();this['actions'][_0x22bc4d]=new Action(_0x1cd0b0,_0x1e2642,_0x22bc4d);return new BPromise(function(_0x4aea1f,_0x4f626f){if(_[_0x0e7a('0x42')](_0x1cd0b0)&&typeof _0x1cd0b0!==_0x0e7a('0x177')){return _0x4f626f(msgResponse(_0x0e7a('0x178'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0x0e7a('0x42')](_0x1e2642[_0x0e7a('0x179')]['phone'])||_0x1e2642[_0x0e7a('0x179')][_0x0e7a('0x17a')]===null){return _0x4f626f(msgResponse(_0x0e7a('0x178'),'Failure','contact\x20is\x20undefine'));}var _0x283cfa={'XMD-CALLERID':_0x52c2d5[_0x0e7a('0x27')][_0x22bc4d]['getCaller'](),'XMD-AGI':_0x1cd0b0['dialQueueProject']?util[_0x0e7a('0x9d')](_0x0e7a('0x17b'),ipAgi,_0x1cd0b0[_0x0e7a('0x10e')]):_0x0e7a('0x17c'),'XMD-AGIAFTER':_0x1cd0b0[_0x0e7a('0x114')]?util[_0x0e7a('0x9d')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1cd0b0[_0x0e7a('0x114')]):_0x0e7a('0x17c'),'XMD-QUEUE':_0x1cd0b0[_0x0e7a('0x53')]===_0x0e7a('0x99')?util[_0x0e7a('0x9d')](_0x0e7a('0x17d'),_0x1cd0b0['name'],_0x1cd0b0[_0x0e7a('0x17e')]||'',_0x1cd0b0[_0x0e7a('0x115')]?'c':'',_0x1cd0b0[_0x0e7a('0x11e')]||0x3):_0x0e7a('0x17c'),'XMD-CONTACTID':_0x1e2642[_0x0e7a('0xd9')],'XMD-CDRTYPE':_0x0e7a('0x7'),'CALLERID(all)':_0x52c2d5[_0x0e7a('0x27')][_0x22bc4d][_0x0e7a('0x17f')](),'XMD-AMD':_0x1cd0b0[_0x0e7a('0xef')]?_0x0e7a('0x180'):'NONE','XMD-DESTINATION':_0x0e7a('0xe7')};if(_0x1cd0b0[_0x0e7a('0xef')]){_0x283cfa['XMD-AMDINITIALSILENCE']=_0x1cd0b0[_0x0e7a('0x181')]||0x9c4;_0x283cfa[_0x0e7a('0x182')]=_0x1cd0b0[_0x0e7a('0x183')]||0x5dc;_0x283cfa[_0x0e7a('0x184')]=_0x1cd0b0[_0x0e7a('0x185')]||0x320;_0x283cfa[_0x0e7a('0x186')]=_0x1cd0b0[_0x0e7a('0x187')]||0x1388;_0x283cfa['XMD-AMDMINWORDLENGTH']=_0x1cd0b0['dialAMDMinWordLength']||0x64;_0x283cfa[_0x0e7a('0x188')]=_0x1cd0b0[_0x0e7a('0x189')]||0x32;_0x283cfa[_0x0e7a('0x18a')]=_0x1cd0b0[_0x0e7a('0x18b')]||0x3;_0x283cfa[_0x0e7a('0x18c')]=_0x1cd0b0[_0x0e7a('0x18d')]||0x100;_0x283cfa['XMD-AMDMAXIMUMWORDLENGTH']=_0x1cd0b0[_0x0e7a('0x18e')]||0x1388;}if(_0x1cd0b0[_0x0e7a('0x53')]==='outbound'){_0x283cfa[_0x0e7a('0x18f')]=_0x1e2642['VoiceQueueId'];}else{_0x283cfa[_0x0e7a('0x190')]=_0x1e2642['CampaignId'];}for(var _0x5edab4 in _0x1e2642[_0x0e7a('0x179')]){if(typeof _0x1e2642[_0x0e7a('0x179')][_0x5edab4]!==_0x0e7a('0xa3')){if(isNotNull(_0x1e2642[_0x0e7a('0x179')][_0x5edab4])&&_0x5edab4!=='id'&&_0x5edab4!==_0x0e7a('0x191')&&_0x5edab4!==_0x0e7a('0x192')&&_0x5edab4!==_0x0e7a('0x193')){_0x283cfa[util[_0x0e7a('0x9d')](_0x0e7a('0x194'),'XMD-',_['toUpper'](_0x5edab4))]=_0x1e2642[_0x0e7a('0x179')][_0x5edab4];}}}var _0x48e5ed=_0x52c2d5[_0x0e7a('0xe1')](_0x1cd0b0[_0x0e7a('0x7a')])?getCallerId(_0x1cd0b0['Trunk']['callerid'],_0x1cd0b0[_0x0e7a('0x60')],_0x1cd0b0['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x1cd0b0[_0x0e7a('0x61')],_0x1cd0b0[_0x0e7a('0x195')]):_0x1cd0b0[_0x0e7a('0x61')]):getCallerId(_['isNil'](_0x1cd0b0['TrunkBackup'])?_0x1cd0b0['Trunk'][_0x0e7a('0x7c')]:_0x1cd0b0[_0x0e7a('0x148')][_0x0e7a('0x7c')],_0x1cd0b0['dialOriginateCallerIdName'],_0x1cd0b0[_0x0e7a('0x195')]>0x0?getCallerIdRandom(_0x1cd0b0[_0x0e7a('0x61')],_0x1cd0b0['dialRandomLastDigitCallerIdNumber']):_0x1cd0b0[_0x0e7a('0x61')]);if(_0x48e5ed){_0x283cfa[_0x0e7a('0x196')]=_0x52c2d5[_0x0e7a('0x27')][_0x22bc4d][_0x0e7a('0x197')]=extractCalleridName(_0x48e5ed);_0x283cfa[_0x0e7a('0x198')]=_0x52c2d5['actions'][_0x22bc4d][_0x0e7a('0x199')]=extractCalleridNumber(_0x48e5ed);}return ami[_0x0e7a('0xb7')]({'actionid':_0x22bc4d,'action':_0x0e7a('0x178'),'channel':_0x52c2d5[_0x0e7a('0xe1')](_0x1cd0b0['Trunk'])?util[_0x0e7a('0x9d')](_0x0e7a('0x19a'),_0x1cd0b0[_0x0e7a('0x7a')][_0x0e7a('0x44')],isNotNull(_0x1cd0b0[_0x0e7a('0x19b')])?_0x1cd0b0[_0x0e7a('0x19b')][_0x0e7a('0x19c')]()||'':'',_0x1cd0b0[_0x0e7a('0x19d')]>0x0?_0x1e2642[_0x0e7a('0x179')][_0x0e7a('0x17a')][_0x0e7a('0x19e')](_0x1cd0b0['dialCutDigit']):_0x1e2642[_0x0e7a('0x179')]['phone']):util['format']('SIP/%s/%s%s',_[_0x0e7a('0xb6')](_0x1cd0b0[_0x0e7a('0x148')])?_0x1cd0b0[_0x0e7a('0x7a')][_0x0e7a('0x44')]:_0x1cd0b0[_0x0e7a('0x148')][_0x0e7a('0x44')],isNotNull(_0x1cd0b0[_0x0e7a('0x19b')])?_0x1cd0b0[_0x0e7a('0x19b')][_0x0e7a('0x19c')]()||'':'',_0x1cd0b0['dialCutDigit']>0x0?_0x1e2642[_0x0e7a('0x179')][_0x0e7a('0x17a')]['substring'](_0x1cd0b0[_0x0e7a('0x19d')]):_0x1e2642[_0x0e7a('0x179')][_0x0e7a('0x17a')]),'callerid':_0x48e5ed,'Exten':_0x0e7a('0xe7'),'Context':_0x0e7a('0x19f'),'Priority':'1','variable':_0x283cfa,'timeout':(_0x1cd0b0['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x22bc4d})[_0x0e7a('0x41')](function(_0x22c5a3){return _0x4aea1f(_0x22c5a3);})[_0x0e7a('0xc2')](function(_0x20da7a){_0x1cd0b0[_0x0e7a('0x1a0')]+=0x1;var _0x2b97a3=new History(_0x52c2d5[_0x0e7a('0x27')][_0x22bc4d]);logger[_0x0e7a('0x9f')](util[_0x0e7a('0x9d')](_0x0e7a('0x1a1'),JSON[_0x0e7a('0x4e')](_0x20da7a)));_0x2b97a3[_0x0e7a('0xb1')]=0xe;_0x2b97a3['statedesc']=_0x0e7a('0x1a2');_0x2b97a3[_0x0e7a('0xb2')]=moment()['format'](_0x0e7a('0x116'));_0x2b97a3[_0x0e7a('0x129')]=_0x2b97a3[_0x0e7a('0xb2')];_0x52c2d5[_0x0e7a('0xd2')](_0x2b97a3)['catch'](loggerCatch(_0x0e7a('0x1a3')));_0x52c2d5[_0x0e7a('0xd0')](_0x2b97a3)[_0x0e7a('0xc2')](loggerCatch('[originate][error]'))[_0x0e7a('0x136')](function(){delete _0x52c2d5[_0x0e7a('0x27')][_0x22bc4d];return _0x4f626f(msgResponse(_0x0e7a('0x178'),_0x0e7a('0x1a4'),_0x0e7a('0x1a5')));});});});};Dialer['prototype'][_0x0e7a('0x34')]=function(_0x45fc7e){var _0x8b94ab=this[_0x0e7a('0x27')][_0x45fc7e['actionid']];if(_0x8b94ab){delete this[_0x0e7a('0x27')][_0x45fc7e[_0x0e7a('0x12a')]];_0x8b94ab['responsetime']=moment()['format'](_0x0e7a('0x116'));var _0x48609f=_0x8b94ab[_0x0e7a('0x53')]==='ivr'?this['campaigns'][_0x8b94ab[_0x0e7a('0xbb')]]:this[_0x0e7a('0x21')][_0x8b94ab[_0x0e7a('0x1a6')]()];if(!this[_0x0e7a('0xdf')](_0x45fc7e[_0x0e7a('0x1a7')])){this['updateOriginated'](_0x48609f);return this[_0x0e7a('0x1a8')](_0x8b94ab,_0x48609f,_0x45fc7e)[_0x0e7a('0xc2')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x0e7a('0x29')][_0x45fc7e[_0x0e7a('0xe4')]]=_0x8b94ab;}};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x1a9')]=function(_0x198f47,_0x39a73a,_0x4ada2a){var _0x251a59=new History(_0x39a73a);if(_0x251a59[_0x0e7a('0xf9')]+_0x251a59[_0x0e7a('0xfa')]+_0x251a59['countnoanswerretry']+_0x251a59['countnosuchnumberretry']+_0x251a59['countdropretry']+_0x251a59[_0x0e7a('0xfe')]+_0x251a59[_0x0e7a('0xff')]+_0x251a59['countagentrejectretry']>=_0x4ada2a[_0x0e7a('0x101')]-0x1){return!![];}switch(_0x198f47){case 0x3:if(_0x251a59[_0x0e7a('0xfb')]>=_0x4ada2a[_0x0e7a('0x1aa')]-0x1){return!![];}this[_0x0e7a('0xc8')]({'active':![],'countnoanswerretry':_0x251a59[_0x0e7a('0xfb')]+=0x1,'scheduledat':moment()['add'](_0x4ada2a[_0x0e7a('0x1ab')],_0x0e7a('0x109'))[_0x0e7a('0x9d')](_0x0e7a('0x116')),'ContactId':_0x251a59[_0x0e7a('0xd9')],'ListId':_0x251a59['ListId'],'VoiceQueueId':_0x251a59[_0x0e7a('0xdc')]||undefined,'CampaignId':_0x251a59[_0x0e7a('0xdd')]||undefined})['catch'](loggerCatch(_0x0e7a('0x1ac')));break;case 0x5:if(_0x251a59['countbusyretry']>=_0x4ada2a[_0x0e7a('0x1ad')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x251a59[_0x0e7a('0xf9')]+=0x1,'scheduledat':moment()[_0x0e7a('0x107')](_0x4ada2a[_0x0e7a('0x1ae')],_0x0e7a('0x109'))[_0x0e7a('0x9d')](_0x0e7a('0x116')),'ContactId':_0x251a59[_0x0e7a('0xd9')],'ListId':_0x251a59[_0x0e7a('0xda')],'VoiceQueueId':_0x251a59[_0x0e7a('0xdc')]||undefined,'CampaignId':_0x251a59[_0x0e7a('0xdd')]||undefined})[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x1af')));break;case 0x8:if(_0x251a59['countcongestionretry']>=_0x4ada2a[_0x0e7a('0x1b0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x251a59[_0x0e7a('0xfa')]+=0x1,'scheduledat':moment()[_0x0e7a('0x107')](_0x4ada2a[_0x0e7a('0x1b1')],_0x0e7a('0x109'))['format'](_0x0e7a('0x116')),'ContactId':_0x251a59[_0x0e7a('0xd9')],'ListId':_0x251a59[_0x0e7a('0xda')],'VoiceQueueId':_0x251a59[_0x0e7a('0xdc')]||undefined,'CampaignId':_0x251a59[_0x0e7a('0xdd')]||undefined})[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x1b2')));break;case 0x0:if(_0x251a59[_0x0e7a('0xfc')]>=_0x4ada2a[_0x0e7a('0x1b3')]-0x1){return!![];}else{this[_0x0e7a('0xc8')]({'active':![],'countnosuchnumberretry':_0x251a59[_0x0e7a('0xfc')]+=0x1,'scheduledat':moment()[_0x0e7a('0x107')](_0x4ada2a[_0x0e7a('0x1b4')],'minutes')[_0x0e7a('0x9d')](_0x0e7a('0x116')),'ContactId':_0x251a59[_0x0e7a('0xd9')],'ListId':_0x251a59[_0x0e7a('0xda')],'VoiceQueueId':_0x251a59[_0x0e7a('0xdc')]||undefined,'CampaignId':_0x251a59[_0x0e7a('0xdd')]||undefined})['catch'](loggerCatch(_0x0e7a('0x1b5')));}break;case 0xa:if(_0x251a59['countdropretry']>=_0x4ada2a[_0x0e7a('0x121')]-0x1){return!![];}this[_0x0e7a('0xc8')]({'active':![],'countdropretry':_0x251a59[_0x0e7a('0xfd')]+=0x1,'scheduledat':moment()[_0x0e7a('0x107')](_0x4ada2a[_0x0e7a('0x122')],_0x0e7a('0x109'))[_0x0e7a('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x251a59[_0x0e7a('0xd9')],'ListId':_0x251a59[_0x0e7a('0xda')],'VoiceQueueId':_0x251a59[_0x0e7a('0xdc')]||undefined,'CampaignId':_0x251a59[_0x0e7a('0xdd')]||undefined})[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x123')));break;case 0xb:if(_0x251a59[_0x0e7a('0xfe')]>=_0x4ada2a['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x0e7a('0xc8')]({'active':![],'countabandonedretry':_0x251a59[_0x0e7a('0xfe')]+=0x1,'scheduledat':moment()[_0x0e7a('0x107')](_0x4ada2a[_0x0e7a('0x127')],_0x0e7a('0x109'))['format'](_0x0e7a('0x116')),'ContactId':_0x251a59[_0x0e7a('0xd9')],'ListId':_0x251a59[_0x0e7a('0xda')],'VoiceQueueId':_0x251a59[_0x0e7a('0xdc')]||undefined,'CampaignId':_0x251a59[_0x0e7a('0xdd')]||undefined})['catch'](loggerCatch(_0x0e7a('0x128')));break;case 0x13:if(_0x251a59[_0x0e7a('0xff')]>=_0x4ada2a[_0x0e7a('0x104')]-0x1){return!![];}this[_0x0e7a('0xc8')]({'active':![],'countmachineretry':_0x251a59[_0x0e7a('0xff')]+=0x1,'scheduledat':moment()[_0x0e7a('0x107')](_0x4ada2a[_0x0e7a('0x108')],_0x0e7a('0x109'))[_0x0e7a('0x9d')](_0x0e7a('0x116')),'ContactId':_0x251a59[_0x0e7a('0xd9')],'ListId':_0x251a59[_0x0e7a('0xda')],'VoiceQueueId':_0x251a59[_0x0e7a('0xdc')]||undefined,'CampaignId':_0x251a59[_0x0e7a('0xdd')]||undefined})[_0x0e7a('0xc2')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x251a59[_0x0e7a('0x100')]>=_0x4ada2a[_0x0e7a('0x1b6')]-0x1){return!![];}this[_0x0e7a('0xc8')]({'active':![],'countagentrejectretry':_0x251a59[_0x0e7a('0x100')]+=0x1,'scheduledat':moment()['add'](_0x4ada2a['dialAgentRejectRetryFrequency'],_0x0e7a('0x109'))[_0x0e7a('0x9d')](_0x0e7a('0x116')),'ContactId':_0x251a59['ContactId'],'ListId':_0x251a59[_0x0e7a('0xda')],'VoiceQueueId':_0x251a59[_0x0e7a('0xdc')]||undefined,'CampaignId':_0x251a59[_0x0e7a('0xdd')]||undefined})['catch'](loggerCatch(_0x0e7a('0x1b7')));break;default:return!![];}};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x1a8')]=function(_0x2b6271,_0x52c604,_0x21579b){var _0x27e713=this;var _0xe58d79=new History(_0x2b6271);return new BPromise(function(_0x1459de,_0x2bd917){if(_[_0x0e7a('0x42')](_0x52c604)&&typeof _0x52c604!==_0x0e7a('0x177')){return _0x2bd917(msgResponse('[callProgressDetecting]',_0x0e7a('0x14d'),_0x0e7a('0x1b8')));}if(_['isUndefined'](_0x21579b)&&typeof _0x21579b!==_0x0e7a('0x177')){return _0x2bd917(msgResponse(_0x0e7a('0x1b9'),_0x0e7a('0x14d'),'evt\x20is\x20undefine'));}switch(_0x21579b[_0x0e7a('0x111')]){case'0':_0x52c604[_0x0e7a('0x69')]+=0x1;_0xe58d79[_0x0e7a('0xb1')]=0x0;_0xe58d79[_0x0e7a('0xf2')]=_0x0e7a('0x1ba');_0xe58d79[_0x0e7a('0xfc')]+=0x1;_0xe58d79[_0x0e7a('0xf4')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut[_0x0e7a('0xf7')](_0x2b6271,_0x0e7a('0x1bb')));_0x27e713['createHistory'](_0xe58d79)[_0x0e7a('0xc2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x27e713[_0x0e7a('0x1a9')](0x0,_0x2b6271,_0x52c604)){if(_0xe58d79['countnosuchnumberretry']>=_0x52c604[_0x0e7a('0x1b3')]){_0x27e713[_0x0e7a('0x105')](_0xe58d79,_0x1459de,_0x2bd917,_0x0e7a('0x1bc'));}else{_0x27e713[_0x0e7a('0x102')](_0xe58d79,_0x1459de,_0x2bd917,_0x0e7a('0x1bc'));}}break;case'3':_0x52c604[_0x0e7a('0x68')]+=0x1;_0xe58d79[_0x0e7a('0xb1')]=0x3;_0xe58d79[_0x0e7a('0xf2')]=_0x0e7a('0x1bd');_0xe58d79[_0x0e7a('0xfb')]+=0x1;_0xe58d79[_0x0e7a('0xf4')]+=0x1;ami[_0x0e7a('0x52')](_0x0e7a('0x1be'),ut[_0x0e7a('0xf7')](_0x2b6271,_0x0e7a('0x1bf')));_0x27e713[_0x0e7a('0xd2')](_0xe58d79)[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x1c0')));if(_0x27e713['checkRetriveMax'](0x3,_0x2b6271,_0x52c604)){if(_0xe58d79[_0x0e7a('0xfb')]>=_0x52c604[_0x0e7a('0x1aa')]){_0x27e713[_0x0e7a('0x105')](_0xe58d79,_0x1459de,_0x2bd917,_0x0e7a('0x1c1'));}else{_0x27e713['stateGlobal'](_0xe58d79,_0x1459de,_0x2bd917,_0x0e7a('0x1c1'));}}break;case'5':_0x52c604[_0x0e7a('0x63')]+=0x1;_0xe58d79[_0x0e7a('0xb1')]=0x5;_0xe58d79[_0x0e7a('0xf2')]='Busy';_0xe58d79[_0x0e7a('0xf9')]+=0x1;_0xe58d79['countglobal']+=0x1;ami[_0x0e7a('0x52')](_0x0e7a('0x1c2'),ut[_0x0e7a('0xf7')](_0x2b6271,_0x0e7a('0x1c3')));_0x27e713[_0x0e7a('0xd2')](_0xe58d79)['catch'](loggerCatch(_0x0e7a('0x1c4')));if(_0x27e713['checkRetriveMax'](0x5,_0x2b6271,_0x52c604)){if(_0xe58d79[_0x0e7a('0xf9')]>=_0x52c604[_0x0e7a('0x1ad')]){_0x27e713[_0x0e7a('0x105')](_0xe58d79,_0x1459de,_0x2bd917,_0x0e7a('0x1c5'));}else{_0x27e713[_0x0e7a('0x102')](_0xe58d79,_0x1459de,_0x2bd917,_0x0e7a('0x1c5'));}}break;case'8':_0x52c604[_0x0e7a('0x64')]+=0x1;_0xe58d79[_0x0e7a('0xb1')]=0x8;_0xe58d79[_0x0e7a('0xf2')]=_0x0e7a('0x1c6');_0xe58d79[_0x0e7a('0xfa')]+=0x1;_0xe58d79[_0x0e7a('0xf4')]+=0x1;ami[_0x0e7a('0x52')](_0x0e7a('0x1c7'),ut[_0x0e7a('0xf7')](_0x2b6271,'congestion'));_0x27e713[_0x0e7a('0xd2')](_0xe58d79)[_0x0e7a('0xc2')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x27e713[_0x0e7a('0x1a9')](0x8,_0x2b6271,_0x52c604)){if(_0xe58d79[_0x0e7a('0xfa')]>=_0x52c604[_0x0e7a('0x1b0')]){_0x27e713[_0x0e7a('0x105')](_0xe58d79,_0x1459de,_0x2bd917,_0x0e7a('0x1c8'));}else{_0x27e713['stateGlobal'](_0xe58d79,_0x1459de,_0x2bd917,_0x0e7a('0x1c8'));}}break;case'11':_0x52c604[_0x0e7a('0x1c9')]+=0x1;_0xe58d79[_0x0e7a('0xb1')]=0xb;_0xe58d79[_0x0e7a('0xf2')]=_0x0e7a('0x126');_0xe58d79[_0x0e7a('0xfe')]+=0x1;_0xe58d79[_0x0e7a('0xf4')]+=0x1;_0x27e713['createHistory'](_0xe58d79)[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x1ca')));if(_0x27e713[_0x0e7a('0x1a9')](0xb,_0x2b6271,_0x52c604)){if(_0xe58d79[_0x0e7a('0xfe')]>=_0x52c604[_0x0e7a('0x1cb')]){_0x27e713[_0x0e7a('0x105')](_0xe58d79,_0x1459de,_0x2bd917,_0x0e7a('0x1cc'));}else{_0x27e713[_0x0e7a('0x102')](_0xe58d79,_0x1459de,_0x2bd917,_0x0e7a('0x1cc'));}}break;case'20':_0x52c604[_0x0e7a('0x6b')]+=0x1;_0xe58d79[_0x0e7a('0xb1')]=0x14;_0xe58d79[_0x0e7a('0xf2')]=_0x0e7a('0x1cd');_0xe58d79['countagentrejectretry']+=0x1;_0xe58d79[_0x0e7a('0xf4')]+=0x1;ami[_0x0e7a('0x52')]('custom:agentreject',ut['buildObj'](_0x2b6271,_0x0e7a('0x1ce')));_0x27e713[_0x0e7a('0xd2')](_0xe58d79)['catch'](loggerCatch(_0x0e7a('0x1cf')));if(_0x27e713[_0x0e7a('0x1a9')](0x14,_0x2b6271,_0x52c604)){if(_0xe58d79[_0x0e7a('0x100')]>=_0x52c604[_0x0e7a('0x1b6')]){_0x27e713['createStateFinal'](_0xe58d79,_0x1459de,_0x2bd917,_0x0e7a('0x1d0'));}else{_0x27e713['stateGlobal'](_0xe58d79,_0x1459de,_0x2bd917,_0x0e7a('0x1d0'));}}break;default:_0x52c604[_0x0e7a('0x6c')]+=0x1;_0xe58d79[_0x0e7a('0xb1')]=0xc;_0xe58d79[_0x0e7a('0xf2')]=_0x21579b[_0x0e7a('0x111')];_0x27e713['createHistory'](_0xe58d79)['catch'](loggerCatch(_0x0e7a('0x1d1')));if(_0x27e713[_0x0e7a('0x1a9')](_0x21579b[_0x0e7a('0x111')],_0x2b6271,_0x52c604)){if(_0xe58d79[_0x0e7a('0xf9')]+_0xe58d79[_0x0e7a('0xfa')]+_0xe58d79['countnoanswerretry']+_0xe58d79['countnosuchnumberretry']+_0xe58d79[_0x0e7a('0xfd')]+_0xe58d79[_0x0e7a('0xfe')]+_0xe58d79['countmachineretry']+_0xe58d79[_0x0e7a('0x100')]>=_0x52c604[_0x0e7a('0x101')]){_0x27e713[_0x0e7a('0x102')](_0xe58d79,_0x1459de,_0x2bd917,_0x21579b[_0x0e7a('0x111')]);}else{_0x27e713[_0x0e7a('0x105')](_0xe58d79,_0x1459de,_0x2bd917,_0x21579b[_0x0e7a('0x111')]);}}}});};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x102')]=function(_0x397358,_0x9c423e,_0x3fb5ea,_0x148c03){var _0x2da492=new Final(_0x397358);_0x2da492[_0x0e7a('0xb1')]=0xf;_0x2da492[_0x0e7a('0xf2')]=_0x0e7a('0x1d2');this[_0x0e7a('0x105')](_0x2da492,_0x9c423e,_0x3fb5ea,_0x148c03);};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x105')]=function(_0x224672,_0x178373,_0x1c9399,_0x12dc45){this[_0x0e7a('0xd0')](_0x224672)[_0x0e7a('0x41')](function(){return _0x178373(msgResponse(_0x0e7a('0x1b9'),_0x0e7a('0xe0'),_0x12dc45));})[_0x0e7a('0xc2')](function(){return _0x1c9399(msgResponse('[moveContactManagedDialer][0]',_0x0e7a('0x14d'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0x0e7a('0x8')]=function(_0x13cf9c){var _0x386a74=_0x13cf9c[_0x0e7a('0x1d3')]/0x64;var _0x30a109=_0x13cf9c[_0x0e7a('0x67')]/(_0x13cf9c[_0x0e7a('0x67')]+_0x13cf9c[_0x0e7a('0xea')]);var _0x281d0a=Math[_0x0e7a('0x1d4')](_0x13cf9c[_0x0e7a('0x74')]*(_0x13cf9c['predictiveIntervalMaxThreshold']/0x64));var _0x369b88=Math[_0x0e7a('0x1d4')](_0x13cf9c['predictiveIntervalAvailable']*(_0x13cf9c['predictiveIntervalMinThreshold']/0x64));var _0x1febb5=_0x13cf9c[_0x0e7a('0x56')]+_0x13cf9c[_0x0e7a('0x59')];var _0x4c773b=Math['floor'](_0x13cf9c[_0x0e7a('0x8f')]*_0x13cf9c[_0x0e7a('0x78')]*_0x13cf9c[_0x0e7a('0x71')]*_0x13cf9c[_0x0e7a('0x72')]);if(_[_0x0e7a('0x42')](_0x13cf9c[_0x0e7a('0x2a')])){if(!_[_0x0e7a('0x42')](_0x13cf9c[_0x0e7a('0x95')])){_0x13cf9c[_0x0e7a('0x95')]=undefined;loggerPredictive[_0x0e7a('0x9f')](_0x0e7a('0x1d5'),_0x0e7a('0x1d6'));}if(!_[_0x0e7a('0x42')](_0x13cf9c['handlePredictive'])){loggerPredictive[_0x0e7a('0x9f')](_0x0e7a('0x1d5'),_0x0e7a('0x1d7'));clearInterval(_0x13cf9c[_0x0e7a('0x97')]);_0x13cf9c[_0x0e7a('0x97')]=undefined;}_0x13cf9c[_0x0e7a('0x2a')]=moment()['format'](_0x0e7a('0x116'));loggerPredictive['info'](_0x13cf9c[_0x0e7a('0x44')],_0x0e7a('0x1d8'),_0x13cf9c[_0x0e7a('0x2a')]);this['handlePower'](_0x13cf9c,0x1);}else if(ifInterval(_0x13cf9c[_0x0e7a('0x1d9')],_0x13cf9c[_0x0e7a('0x2a')])){this['handlePower'](_0x13cf9c,0x1);loggerPredictiveCalls['info'](_0x0e7a('0x1da'),_0x13cf9c[_0x0e7a('0x2a')],_0x13cf9c[_0x0e7a('0x44')]);_0x13cf9c['erlangCalls']=0x0;_0x13cf9c[_0x0e7a('0x70')]=0x0;}else if(_0x386a74<_0x30a109&&_0x13cf9c[_0x0e7a('0x1db')]===_0x0e7a('0x1dc')){freeVariablesPredictive(_0x13cf9c);loggerPredictive['info'](_0x0e7a('0x1dd'),_0x0e7a('0x1de'),_0x30a109,_0x0e7a('0x2a'),_0x13cf9c[_0x0e7a('0x44')]);}else if(_0x4c773b<_0x13cf9c['predictiveIntervalErlangCallsDroppedCalls']&&_0x13cf9c[_0x0e7a('0x1db')]===_0x0e7a('0x1dc')){freeVariablesPredictive(_0x13cf9c);loggerPredictive['info'](_0x0e7a('0x1df'),_0x0e7a('0x1e0'),_0x4c773b,_0x0e7a('0x1e1'),_0x13cf9c[_0x0e7a('0x70')],'startProgressive',_0x13cf9c[_0x0e7a('0x44')]);}else if(!ifInterval(_0x13cf9c['dialPredictiveInterval'],_0x13cf9c[_0x0e7a('0x2a')])&&_[_0x0e7a('0x42')](_0x13cf9c['startPredictive'])&&!_[_0x0e7a('0x42')](_0x13cf9c[_0x0e7a('0x2a')])){_0x13cf9c['startPredictive']=moment()[_0x0e7a('0x9d')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x0e7a('0x85')](_0x13cf9c['name'],'started\x20in\x20predictive\x20at',_0x13cf9c[_0x0e7a('0x95')]);this[_0x0e7a('0xc5')](_0x13cf9c[_0x0e7a('0x1d9')])[_0x0e7a('0x41')](this['getDataPredictive'](_0x13cf9c))[_0x0e7a('0x41')](mergeDataErlangB(_0x13cf9c))[_0x0e7a('0x41')](this['startMethodPredictive'](_0x13cf9c))[_0x0e7a('0xc2')](loggerCatchPredictive(_0x0e7a('0x1e2'),_0x13cf9c));}else if(!ifInterval(_0x13cf9c[_0x0e7a('0x1d9')],_0x13cf9c[_0x0e7a('0x95')])){_0x13cf9c[_0x0e7a('0x70')]=0x0;_0x13cf9c[_0x0e7a('0x95')]=moment()['format'](_0x0e7a('0x116'));loggerPredictive['info'](_0x13cf9c['name'],_0x0e7a('0x1e3'),_0x13cf9c['startPredictive']);clearInterval(_0x13cf9c[_0x0e7a('0x97')]);_0x13cf9c[_0x0e7a('0x97')]=undefined;this['averageHandleTime'](_0x13cf9c['dialPredictiveInterval'])['then'](this[_0x0e7a('0x1e4')](_0x13cf9c))[_0x0e7a('0x41')](mergeDataErlangB(_0x13cf9c))[_0x0e7a('0x41')](this['startMethodPredictive'](_0x13cf9c))[_0x0e7a('0xc2')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x13cf9c));}else if(_0x13cf9c[_0x0e7a('0x74')]&&_0x1febb5<_0x13cf9c[_0x0e7a('0x74')]-_0x369b88){freeVariablesPredictive(_0x13cf9c);loggerPredictive[_0x0e7a('0x85')](_0x13cf9c[_0x0e7a('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1febb5,_0x0e7a('0x1e5'),_0x13cf9c['predictiveIntervalAvailable'],'-',_0x369b88,'=',_0x13cf9c[_0x0e7a('0x74')]-_0x369b88,')');}else if(_0x13cf9c[_0x0e7a('0x74')]&&_0x1febb5>_0x13cf9c[_0x0e7a('0x74')]+_0x281d0a){freeVariablesPredictive(_0x13cf9c);loggerPredictive[_0x0e7a('0x85')](_0x13cf9c[_0x0e7a('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1febb5,')\x20are\x20more\x20than\x20threshold\x20(',_0x13cf9c[_0x0e7a('0x74')],'+',_0x281d0a,'=',_0x13cf9c[_0x0e7a('0x74')]+_0x281d0a,')');}};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x1e4')]=function(_0x3993bd){var _0x40bc87=this;return function(_0x4ea643){return new BPromise(function(_0x2c487a,_0x1c1a8d){_[_0x0e7a('0x93')](_0x3993bd,_0x4ea643[0x0]);if(checkGetDataPredictive(_0x4ea643[0x0])){var _0x13edf1=_0x3993bd[_0x0e7a('0x74')]=_0x3993bd['talking']+_0x3993bd[_0x0e7a('0x56')];var _0x4b1927=_0x3993bd[_0x0e7a('0x1d9')]*0x3c;var _0x4024b4=_0x4ea643[0x0][_0x0e7a('0x89')]+_0x4ea643[0x0][_0x0e7a('0x6e')];var _0xbd5fe1=(_0x4ea643[0x0][_0x0e7a('0x6d')]+_0x4ea643[0x0][_0x0e7a('0x6f')]+_0x4ea643[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4ea643[0x0][_0x0e7a('0x75')];_0x3993bd['predictiveIntervalHitRate']=_0xbd5fe1>0x0?_0xbd5fe1:0x1;switch(_0x3993bd[_0x0e7a('0x1db')]){case _0x0e7a('0x1dc'):var _0x1a7beb=_0x3993bd['dialPredictiveOptimizationPercentage']/0x64;return _0x40bc87['abandonmentRate'](_0x13edf1,_0x4b1927,_0x4024b4,_0xbd5fe1,_0x1a7beb)[_0x0e7a('0x41')](function(_0x4ba679){return _0x2c487a(_0x4ba679);});case _0x0e7a('0x1e6'):var _0xce9a92=_0x3993bd[_0x0e7a('0x1d3')]/0x64;return _0x40bc87[_0x0e7a('0x1e7')](_0x13edf1,_0x4b1927,_0x4024b4,_0xbd5fe1,_0xce9a92)[_0x0e7a('0x41')](function(_0x563f9d){return _0x2c487a(_0x563f9d);});default:return _0x1c1a8d(msgResponse(_0x0e7a('0x1e8'),_0x0e7a('0x14d'),_0x0e7a('0x1e9')));}}else{return _0x1c1a8d(msgResponse('[getDataPredictive]',_0x0e7a('0x14d'),_0x0e7a('0x1ea')));}});};};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x1eb')]=function(_0x2757ad){var _0x26d050=this;return function(_0x5a3df1){return new BPromise(function(_0x519579,_0x5cc38a){_[_0x0e7a('0x93')](_0x2757ad,_0x5a3df1[0x0]);if(checkGetDataPredictive(_0x5a3df1[0x0])){loggerPredictive[_0x0e7a('0x85')](JSON[_0x0e7a('0x4e')](_0x5a3df1[0x0]));if(_0x2757ad[_0x0e7a('0x1db')]===_0x0e7a('0x1dc')){return _0x26d050[_0x0e7a('0x1ec')](_0x2757ad['id'])[_0x0e7a('0x41')](function(_0x17e3dc){var _0x5be577=_0x2757ad[_0x0e7a('0x16b')]-_0x17e3dc[0x0][_0x0e7a('0x1ed')];var _0x4f7452=_0x2757ad[_0x0e7a('0x1d9')]*0x3c;var _0x2efa4f=_0x5a3df1[0x0][_0x0e7a('0x89')]+_0x5a3df1[0x0][_0x0e7a('0x6e')];var _0x5198c3=(_0x5a3df1[0x0]['predictiveIntervalAnsweredCalls']+_0x5a3df1[0x0][_0x0e7a('0x6f')]+_0x5a3df1[0x0][_0x0e7a('0x86')])/_0x5a3df1[0x0]['predictiveIntervalTotalCalls'];var _0x581003=_0x2757ad[_0x0e7a('0x1d3')]/0x64;_0x2757ad['predictiveIntervalPauses']=_0x17e3dc[0x0][_0x0e7a('0x1ed')]||0x0;_0x2757ad[_0x0e7a('0x71')]=_0x5198c3>0x0?_0x5198c3:0x1;return _0x26d050[_0x0e7a('0x1ee')](_0x5be577,_0x4f7452,_0x2efa4f,_0x5198c3,_0x581003);})[_0x0e7a('0x41')](function(_0x11965e){return _0x519579(_0x11965e);})[_0x0e7a('0xc2')](function(_0x416e62){return _0x5cc38a(msgResponse('[CatchErlangB]',_0x0e7a('0x14d'),JSON[_0x0e7a('0x4e')](_0x416e62)));});}if(_0x2757ad[_0x0e7a('0x1db')]===_0x0e7a('0x1e6')){return _0x26d050[_0x0e7a('0x1ec')](_0x2757ad['id'])[_0x0e7a('0x41')](function(_0x2ed7d3){var _0x483f89=_0x2757ad['loggedIn']-_0x2ed7d3[0x0][_0x0e7a('0x1ed')];var _0x292f8f=_0x2757ad[_0x0e7a('0x1d9')]*0x3c;var _0x13c03a=_0x5a3df1[0x0][_0x0e7a('0x89')]+_0x5a3df1[0x0][_0x0e7a('0x6e')];var _0x5ba360=(_0x5a3df1[0x0]['predictiveIntervalAnsweredCalls']+_0x5a3df1[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5a3df1[0x0][_0x0e7a('0x86')])/_0x5a3df1[0x0][_0x0e7a('0x75')];var _0x1c7b43=_0x2757ad[_0x0e7a('0x1d3')]/0x64;_0x2757ad[_0x0e7a('0x73')]=_0x2ed7d3[0x0][_0x0e7a('0x1ed')]||0x0;_0x2757ad['predictiveIntervalHitRate']=_0x5ba360>0x0?_0x5ba360:0x1;return _0x26d050[_0x0e7a('0x1e7')](_0x483f89,_0x292f8f,_0x13c03a,_0x5ba360,_0x1c7b43);})[_0x0e7a('0x41')](function(_0x37f974){return _0x519579(_0x37f974);})['catch'](function(_0x3b68a1){return _0x5cc38a(msgResponse(_0x0e7a('0x1ef'),_0x0e7a('0x14d'),JSON[_0x0e7a('0x4e')](_0x3b68a1)));});}}else{return _0x5cc38a(msgResponse(_0x0e7a('0x1e8'),_0x0e7a('0x14d'),'check\x20failure'));}});};};Dialer['prototype'][_0x0e7a('0x1f0')]=function(_0x38be68){var _0x495bf8=this;return function(){var _0x3967fe=0x0;var _0x349df4=Math['floor'](_0x38be68[_0x0e7a('0x77')]*0x3e8);if(_0x349df4>0x0){_0x349df4=_0x349df4<0x64?0x64:_0x349df4;loggerPredictive[_0x0e7a('0x85')](_0x38be68[_0x0e7a('0x44')],_0x0e7a('0x1f1'),_0x349df4,_0x0e7a('0x4f'));_0x38be68[_0x0e7a('0x97')]=setInterval(function(){_0x495bf8['handlePredictive'](_0x38be68);loggerPredictiveCalls['info'](_0x0e7a('0x1f2'),_0x3967fe+=0x1);},_0x349df4);}else{loggerPredictive[_0x0e7a('0x85')](_0x38be68[_0x0e7a('0x44')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x1f3')]=function(_0x12d2a8,_0x516ebb){var _0xc17045=this;return function(_0x7687a4){if(_[_0x0e7a('0x4b')](_0x7687a4)){if(_[_0x0e7a('0xb6')](_0x516ebb[_0x0e7a('0xdb')])||!_0x516ebb['recallme']){if(_0x12d2a8[_0x0e7a('0x5f')]===_0x0e7a('0x161')){_0x12d2a8[_0x0e7a('0x133')]=_['isUndefined'](_0x12d2a8[_0x0e7a('0x133')])?!![]:_0x12d2a8[_0x0e7a('0x133')];var _0x2f7ee2=uuid['v4']();_0xc17045['actions'][_0x2f7ee2]=new Action(_0x12d2a8,_0x516ebb,_0x2f7ee2);loggerBooked[_0x0e7a('0x85')](_0x0e7a('0x1f4'),_0x2f7ee2,_0x0e7a('0x1f5'),JSON['stringify'](_0x12d2a8[_0x0e7a('0x133')]),_0x0e7a('0x1f6'),_0x12d2a8[_0x0e7a('0x44')]);if(_0x12d2a8[_0x0e7a('0x133')]){_0x12d2a8[_0x0e7a('0x133')]=![];_0xc17045[_0x0e7a('0x2c')][_0xc17045[_0x0e7a('0x27')][_0x2f7ee2][_0x0e7a('0xbb')]]=[];ami['Action']({'actionid':_0x2f7ee2,'action':_0x0e7a('0x1f7'),'queue':_0x12d2a8['name']})['catch'](function(){_0xc17045[_0x0e7a('0xba')](_0x12d2a8);_0xc17045['rescheduleContact']({'active':![],'ContactId':_0xc17045['actions'][_0x2f7ee2][_0x0e7a('0xd9')],'ListId':_0xc17045['actions'][_0x2f7ee2]['ListId'],'VoiceQueueId':_0xc17045[_0x0e7a('0x27')][_0x2f7ee2]['VoiceQueueId']||undefined,'CampaignId':_0xc17045[_0x0e7a('0x27')][_0x2f7ee2]['CampaignId']||undefined})[_0x0e7a('0xc2')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0xc17045[_0x0e7a('0x27')][_0x2f7ee2];});}else{loggerBooked['info'](_0x0e7a('0x1f8'),JSON[_0x0e7a('0x4e')](_0x12d2a8[_0x0e7a('0x133')]),_0x0e7a('0x1f6'),_0x12d2a8[_0x0e7a('0x44')]);_0xc17045[_0x0e7a('0xba')](_0x12d2a8);_0xc17045[_0x0e7a('0xc8')]({'active':![],'ContactId':_0xc17045[_0x0e7a('0x27')][_0x2f7ee2][_0x0e7a('0xd9')],'ListId':_0xc17045['actions'][_0x2f7ee2][_0x0e7a('0xda')],'VoiceQueueId':_0xc17045['actions'][_0x2f7ee2][_0x0e7a('0xdc')]||undefined,'CampaignId':_0xc17045['actions'][_0x2f7ee2][_0x0e7a('0xdd')]||undefined})[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x1f9')));delete _0xc17045[_0x0e7a('0x27')][_0x2f7ee2];}}else{return _0xc17045[_0x0e7a('0x1fa')](_0x12d2a8,_0x516ebb);}}else{if(getDiff(_0x516ebb['scheduledat'])<_0x12d2a8[_0x0e7a('0x1fb')]*0x3c){if(_0x516ebb[_0x0e7a('0x166')]&&!_0x516ebb['Agent'][_0x0e7a('0x1fc')]){_0xc17045[_0x0e7a('0x20')]['run'](_0x516ebb['id'])[_0x0e7a('0x136')](function(){_0xc17045[_0x0e7a('0xba')](_0x12d2a8);});}else{_0xc17045[_0x0e7a('0xc9')]({'active':![]},_0x516ebb['id'],0x1)[_0x0e7a('0x136')](function(){_0xc17045[_0x0e7a('0xba')](_0x12d2a8);});}}else{_0x12d2a8[_0x0e7a('0x6a')]+=0x1;_0xc17045[_0x0e7a('0xba')](_0x12d2a8);if(_0x12d2a8[_0x0e7a('0x1fd')]){_0xc17045[_0x0e7a('0xc8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x516ebb['ContactId'],'ListId':_0x516ebb[_0x0e7a('0xda')],'VoiceQueueId':_0x516ebb['VoiceQueueId']||undefined,'CampaignId':_0x516ebb[_0x0e7a('0xdd')]||undefined})['catch'](loggerCatch(_0x0e7a('0x1fe')));_0xc17045[_0x0e7a('0xd2')](createObjHistory(_0x12d2a8,_0x516ebb,_0x0e7a('0x1ff'),0x17,_0x0e7a('0x200')))[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0x201')));}else{_0xc17045['saveInDb'](createObjHistory(_0x12d2a8,_0x516ebb,_0x0e7a('0x202'),0x16,_0x0e7a('0x203')),_0x0e7a('0x204'),'[Originate][HistoryRecallClose]');}}}}else{_0x12d2a8[_0x0e7a('0x205')]+=0x1;_0xc17045[_0x0e7a('0xd8')](createObjHistory(_0x12d2a8,_0x516ebb,_0x0e7a('0x206'),0xd,_0x0e7a('0x207')),_0x0e7a('0x208'),_0x0e7a('0x209'));throw _0x0e7a('0x20a');}};};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x16a')]=function(_0x3efb6e){var _0x2bb950=this;var _0xd8fa64=_0x3efb6e[_0x0e7a('0x20b')]-_0x3efb6e['originated']-_0x3efb6e[_0x0e7a('0xcb')];emitCampaignSummary(_0x3efb6e);if(_0xd8fa64>0x0){if(_0xd8fa64>this[_0x0e7a('0x25')]){_0xd8fa64=this[_0x0e7a('0x25')];}_0x3efb6e[_0x0e7a('0xcb')]+=_0xd8fa64;this['getContactDialerIvr'](_0x3efb6e['id'],_0xd8fa64,_0x3efb6e['dialOrderByScheduledAt'],_0x3efb6e)[_0x0e7a('0x41')](function(_0x12eefc){_0x3efb6e[_0x0e7a('0xcb')]-=_0xd8fa64;_0x3efb6e['temp']=_0x3efb6e[_0x0e7a('0xcb')]>0x0?_0x3efb6e[_0x0e7a('0xcb')]:0x0;if(!checkContactEmpty(_0x12eefc)){_0x3efb6e[_0x0e7a('0x4c')]=_0x0e7a('0xaa');logger[_0x0e7a('0x85')](_0x0e7a('0x20c')+_0x3efb6e['name']);}else{_0x3efb6e[_0x0e7a('0x76')]+=_0x12eefc[_0x0e7a('0xa2')];_0x3efb6e['message']=_0x0e7a('0x20d');for(var _0x88e984=0x0;_0x88e984<_0x12eefc[_0x0e7a('0xa2')];_0x88e984+=0x1){_0x3efb6e[_0x0e7a('0x20e')]+=0x1;if(_[_0x0e7a('0xb6')](_0x12eefc[_0x88e984])||_[_0x0e7a('0xb6')](_0x12eefc[_0x88e984][_0x0e7a('0x179')])||_[_0x0e7a('0xb6')](_0x12eefc[_0x88e984][_0x0e7a('0x179')][_0x0e7a('0x17a')])){_0x2bb950['emptyContact'](_0x0e7a('0x20f'),_0x3efb6e,_0x12eefc[_0x88e984]);}else{_0x2bb950['checkIsBlackListIvr'](_[_0x0e7a('0x130')](_0x12eefc[_0x88e984],[_0x0e7a('0xdd'),_0x0e7a('0x210')]))[_0x0e7a('0x41')](_0x2bb950[_0x0e7a('0x1f3')](_0x3efb6e,_0x12eefc[_0x88e984]))['catch'](_0x2bb950[_0x0e7a('0xd5')](_0x0e7a('0x211'),_0x3efb6e));}}}})[_0x0e7a('0xc2')](loggerGetContactDialer('[getContactCampaign2]',_0x3efb6e,_0xd8fa64));}};Dialer[_0x0e7a('0x1c')]['handlePower']=function(_0x2fa33d,_0x19e952){var _0x847ff=this;var _0x1cbbb8=[];var _0x64ca29=_0x19e952>=0x1?_0x19e952:0x1;if(_0x2fa33d['dialMethod']==='booked'){_0x64ca29=0x1;}var _0x259aa2=Math['floor'](_0x2fa33d[_0x0e7a('0x56')]*_0x64ca29)-_0x2fa33d[_0x0e7a('0x76')]-_0x2fa33d[_0x0e7a('0xcb')];emitVoiceQueueSummary(_0x2fa33d);if(_0x2fa33d[_0x0e7a('0x212')]>0x0){var _0x4a57e5=_0x2fa33d['dialLimitQueue']-_0x2fa33d[_0x0e7a('0x76')]-_0x2fa33d[_0x0e7a('0x59')]-_0x2fa33d[_0x0e7a('0xcb')]-_0x2fa33d[_0x0e7a('0x213')];if(_0x259aa2>_0x4a57e5){_0x259aa2=_0x4a57e5;}}if(_0x259aa2>0x0){if(_0x2fa33d['dialMethod']===_0x0e7a('0x161')){_0x259aa2=0x1;}if(_0x259aa2>this['maxNumberOriginate']){_0x259aa2=this[_0x0e7a('0x25')];}_0x2fa33d[_0x0e7a('0xcb')]+=_0x259aa2;for(var _0x56d485 in this[_0x0e7a('0x23')]){if(typeof this['agents'][_0x56d485]!==_0x0e7a('0xa3')){if(this[_0x0e7a('0x23')][_0x56d485][_0x0e7a('0xb1')]===_0x0e7a('0x214')&&this['agents'][_0x56d485][_0x0e7a('0xb8')]===_0x0e7a('0xe2')){_0x1cbbb8[_0x0e7a('0x12f')](this[_0x0e7a('0x23')][_0x56d485]['id']);}}}this[_0x0e7a('0xca')](_0x2fa33d['id'],_0x1cbbb8,_0x259aa2,_0x2fa33d[_0x0e7a('0x215')],_0x2fa33d)[_0x0e7a('0x41')](function(_0x5b5595){_0x2fa33d[_0x0e7a('0xcb')]-=_0x259aa2;_0x2fa33d[_0x0e7a('0xcb')]=_0x2fa33d['temp']>0x0?_0x2fa33d[_0x0e7a('0xcb')]:0x0;if(!checkContactEmpty(_0x5b5595)){_0x847ff[_0x0e7a('0xbe')](_0x2fa33d)[_0x0e7a('0x41')](sendMessageReschedule(_0x2fa33d))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x2fa33d[_0x0e7a('0x76')]+=_0x5b5595[_0x0e7a('0xa2')];_0x2fa33d[_0x0e7a('0x4c')]=_0x2fa33d['dialMethod']===_0x0e7a('0x161')?_0x0e7a('0x180'):_0x0e7a('0x20d');for(var _0x2c1378=0x0;_0x2c1378<_0x5b5595[_0x0e7a('0xa2')];_0x2c1378+=0x1){if(_[_0x0e7a('0xb6')](_0x5b5595[_0x2c1378])||_['isNil'](_0x5b5595[_0x2c1378]['Contact'])||_[_0x0e7a('0xb6')](_0x5b5595[_0x2c1378]['Contact'][_0x0e7a('0x17a')])){_0x847ff[_0x0e7a('0xd6')](_0x0e7a('0x20f'),_0x2fa33d,_0x5b5595[_0x2c1378]);}else{_0x847ff['checkIsBlackList'](_[_0x0e7a('0x130')](_0x5b5595[_0x2c1378],[_0x0e7a('0xdc'),_0x0e7a('0x210')]))[_0x0e7a('0x41')](_0x847ff[_0x0e7a('0x1f3')](_0x2fa33d,_0x5b5595[_0x2c1378]))[_0x0e7a('0xc2')](_0x847ff[_0x0e7a('0xd5')](_0x0e7a('0x20f'),_0x2fa33d));}}}})[_0x0e7a('0xc2')](loggerGetContactDialer('[getContactDialer2]',_0x2fa33d,_0x259aa2));}};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x97')]=function(_0x5e25db){if(_0x5e25db[_0x0e7a('0x212')]>0x0){var _0x31d3ba=_0x5e25db[_0x0e7a('0x212')]-_0x5e25db[_0x0e7a('0x76')]-_0x5e25db[_0x0e7a('0x59')];if(_0x31d3ba>0x0){this[_0x0e7a('0x216')](_0x5e25db);}else{loggerPredictiveCalls['info'](_0x0e7a('0x217'));}}else{this[_0x0e7a('0x216')](_0x5e25db);}};Dialer[_0x0e7a('0x1c')]['tryOriginatePredictive']=function(_0x40d189){var _0x14ef78=this;var _0x2660f2=[];_0x40d189[_0x0e7a('0x76')]+=0x1;for(var _0x3017c2 in this[_0x0e7a('0x23')]){if(typeof this[_0x0e7a('0x23')][_0x3017c2]!==_0x0e7a('0xa3')){if(this[_0x0e7a('0x23')][_0x3017c2][_0x0e7a('0xb1')]===_0x0e7a('0x214')&&this[_0x0e7a('0x23')][_0x3017c2][_0x0e7a('0xb8')]===_0x0e7a('0xe2')){_0x2660f2['push'](this[_0x0e7a('0x23')][_0x3017c2]['id']);}}}this[_0x0e7a('0xca')](_0x40d189['id'],_0x2660f2,0x1,_0x40d189[_0x0e7a('0x215')],_0x40d189)[_0x0e7a('0x41')](function(_0x2b886a){if(!checkContactEmpty(_0x2b886a)){checkContactLowerLimitOriginate(_0x40d189,0x1,0x0);_0x14ef78[_0x0e7a('0xbe')](_0x40d189)[_0x0e7a('0x41')](sendMessageReschedule(_0x40d189))[_0x0e7a('0xc2')](loggerCatch(_0x0e7a('0xc0')));}else{_0x40d189[_0x0e7a('0x4c')]=_0x0e7a('0x20d');if(_[_0x0e7a('0xb6')](_0x2b886a[0x0])||_[_0x0e7a('0xb6')](_0x2b886a[0x0][_0x0e7a('0x179')])||_['isNil'](_0x2b886a[0x0][_0x0e7a('0x179')][_0x0e7a('0x17a')])){_0x14ef78[_0x0e7a('0xd6')](_0x0e7a('0x20f'),_0x40d189,_0x2b886a[0x0]);}else{_0x14ef78[_0x0e7a('0xc1')](_[_0x0e7a('0x130')](_0x2b886a[0x0],['VoiceQueueId',_0x0e7a('0x210')]))[_0x0e7a('0x41')](_0x14ef78[_0x0e7a('0x1f3')](_0x40d189,_0x2b886a[0x0]))['catch'](_0x14ef78[_0x0e7a('0xd5')]('[actionOriginatePredictive]\x20',_0x40d189));}}})['catch'](loggerGetContactDialer(_0x0e7a('0x218'),_0x40d189,0x1));emitVoiceQueueSummary(_0x40d189);};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x1ee')]=function(_0x5327cf,_0x4f9dc2,_0x295c44,_0x22b678,_0x487f91,_0x399c93){loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x219'));loggerPredictive[_0x0e7a('0x85')]('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',_0x5327cf);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4f9dc2);loggerPredictive['info'](_0x0e7a('0x21a'),_0x295c44);loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x21b'),_0x22b678);loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x21c'),_0x487f91);loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x21d'));return new BPromise(function(_0x1d10fb,_0x10086f){if(_0x5327cf<=0x0||isNaN(_0x5327cf)){return _0x10086f(msgResponse(_0x0e7a('0x21e'),_0x0e7a('0x1a4'),_0x0e7a('0x21f')+_0x5327cf));}if(_0x295c44<=0x0||isNaN(_0x295c44)){return _0x10086f(msgResponse('[abandonmentRate]',_0x0e7a('0x1a4'),_0x0e7a('0x220')+_0x295c44));}if(_0x22b678<=0x0||isNaN(_0x22b678)){return _0x10086f(msgResponse(_0x0e7a('0x21e'),_0x0e7a('0x1a4'),_0x0e7a('0x221')+_0x22b678));}if(_0x4f9dc2<=0x0||isNaN(_0x4f9dc2)){return _0x10086f(msgResponse(_0x0e7a('0x21e'),'Error',_0x0e7a('0x222')+_0x4f9dc2));}if(_0x487f91<=0x0||isNaN(_0x487f91)){return _0x10086f(msgResponse('[abandonmentRate]','Error',_0x0e7a('0x223')+_0x487f91));}_0x399c93=_0x399c93||0x0;var _0x2f7d7c=0x1/_0x295c44;var _0x41a6ef=0x0;var _0x4b16e9=0x0;var _0x20c70c=0x0;var _0x583a31=0x0;for(var _0x308e3c=0x0;_0x20c70c<_0x487f91;_0x308e3c+=0x1){_0x4b16e9=_0x308e3c/_0x4f9dc2;_0x41a6ef=(_0x22b678*_0x4b16e9+_0x399c93)/_0x2f7d7c;_0x20c70c=erlangb(_0x41a6ef,_0x5327cf);_0x583a31=_0x41a6ef/_0x5327cf*(0x1-erlangb(_0x41a6ef,_0x5327cf));}return _0x1d10fb({'erlangCalls':_0x308e3c,'erlangCallToSecond':_0x4f9dc2/_0x308e3c,'erlangAbandonmentRate':_0x20c70c,'erlangBusyFactor':_0x583a31});});};Dialer[_0x0e7a('0x1c')][_0x0e7a('0x1e7')]=function(_0x5c2398,_0x5393e4,_0x738eaa,_0x58015d,_0x44be1a,_0x174c52){loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x224'));loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x225'),_0x5c2398);loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x226'),_0x5393e4);loggerPredictive[_0x0e7a('0x85')]('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',_0x738eaa);loggerPredictive['info'](_0x0e7a('0x21b'),_0x58015d);loggerPredictive['info'](_0x0e7a('0x227'),_0x44be1a);loggerPredictive[_0x0e7a('0x85')](_0x0e7a('0x21d'));return new BPromise(function(_0x9c7a2a,_0x1dc8c8){if(_0x5c2398<=0x0||isNaN(_0x5c2398)){return _0x1dc8c8(msgResponse('[busyFactor]',_0x0e7a('0x1a4'),_0x0e7a('0x21f')+_0x5c2398));}if(_0x738eaa<=0x0||isNaN(_0x738eaa)){return _0x1dc8c8(msgResponse(_0x0e7a('0x228'),_0x0e7a('0x1a4'),_0x0e7a('0x220')+_0x738eaa));}if(_0x58015d<=0x0||isNaN(_0x58015d)){return _0x1dc8c8(msgResponse('[busyFactor]','Error','p\x20=\x20'+_0x58015d));}if(_0x5393e4<=0x0||isNaN(_0x5393e4)){return _0x1dc8c8(msgResponse('[busyFactor]',_0x0e7a('0x1a4'),_0x0e7a('0x222')+_0x5393e4));}if(_0x44be1a<=0x0||isNaN(_0x44be1a)){return _0x1dc8c8(msgResponse(_0x0e7a('0x228'),_0x0e7a('0x1a4'),'Umin\x20=\x20'+_0x44be1a));}_0x174c52=_0x174c52||0x0;var _0x462d97=0x1/_0x738eaa;var _0x47ed4b=0x0;var _0x2ceb4b=0x0;var _0x27228f=0x0;var _0x5cc7c5=0x0;for(var _0x3b7796=0x0;_0x5cc7c5<_0x44be1a;_0x3b7796+=0x1){_0x2ceb4b=_0x3b7796/_0x5393e4;_0x47ed4b=(_0x58015d*_0x2ceb4b+_0x174c52)/_0x462d97;_0x27228f=erlangb(_0x47ed4b,_0x5c2398);_0x5cc7c5=_0x47ed4b/_0x5c2398*(0x1-erlangb(_0x47ed4b,_0x5c2398));}return _0x9c7a2a({'erlangCalls':_0x3b7796,'erlangCallToSecond':_0x5393e4/_0x3b7796,'erlangAbandonmentRate':_0x27228f,'erlangBusyFactor':_0x5cc7c5});});};module[_0x0e7a('0x229')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 5e45efa..60237bd 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 _0x84c0=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds'];(function(_0x44176a,_0x2e387b){var _0x57d2e0=function(_0x510339){while(--_0x510339){_0x44176a['push'](_0x44176a['shift']());}};_0x57d2e0(++_0x2e387b);}(_0x84c0,0x1bd));var _0x084c=function(_0x41d729,_0x1dacdc){_0x41d729=_0x41d729-0x0;var _0x5197ea=_0x84c0[_0x41d729];return _0x5197ea;};'use strict';var util=require(_0x084c('0x0'));var _=require(_0x084c('0x1'));var moment=require(_0x084c('0x2'));function getSeconds(_0x249614,_0x2bfeb9){var _0x381fca=moment(_0x249614)[_0x084c('0x3')](0x0);var _0x4487f8=moment(_0x2bfeb9)['milliseconds'](0x0);return _0x381fca[_0x084c('0x4')](_0x4487f8,_0x084c('0x5'));}function QueueCallerAbandon(_0x38bda7,_0x2b0f14){this[_0x084c('0x6')]=_0x38bda7[_0x084c('0x6')];this['type']=_0x38bda7[_0x084c('0x7')];this[_0x084c('0x8')]=_0x38bda7[_0x084c('0x7')]===_0x084c('0x9')?_0x084c('0xa'):_0x38bda7[_0x084c('0x7')];this[_0x084c('0xb')]=_0x38bda7[_0x084c('0xb')];this[_0x084c('0xc')]=_0x38bda7['countcongestionretry'];this[_0x084c('0xd')]=_0x38bda7[_0x084c('0xd')];this['countglobal']=_0x38bda7[_0x084c('0xb')]+_0x38bda7['countcongestionretry']+_0x38bda7[_0x084c('0xd')]+_0x38bda7['countnosuchnumberretry']+_0x38bda7[_0x084c('0xe')]+_0x38bda7[_0x084c('0xf')]+_0x38bda7['countmachineretry']+_0x38bda7[_0x084c('0x10')];this[_0x084c('0x11')]=_0x38bda7[_0x084c('0x11')];this[_0x084c('0xe')]=_0x38bda7[_0x084c('0xe')];this[_0x084c('0xf')]=_0x38bda7['countabandonedretry'];this[_0x084c('0x12')]=_0x38bda7[_0x084c('0x12')];this['countagentrejectretry']=_0x38bda7[_0x084c('0x10')];this[_0x084c('0x13')]=_0x2b0f14[_0x084c('0x13')];this['calleridname']=_0x38bda7[_0x084c('0x14')];this[_0x084c('0x15')]=_0x38bda7[_0x084c('0x16')];this[_0x084c('0x17')]=_0x38bda7[_0x084c('0x17')];this[_0x084c('0x18')]=_0x38bda7['responsetime'];this[_0x084c('0x19')]=_0x38bda7[_0x084c('0x19')];this[_0x084c('0x1a')]=this[_0x084c('0x19')];this[_0x084c('0x1b')]=getSeconds(_0x38bda7[_0x084c('0x18')],_0x38bda7[_0x084c('0x17')]);this[_0x084c('0x1c')]=getSeconds(this[_0x084c('0x19')],_0x38bda7[_0x084c('0x18')]);this[_0x084c('0x1d')]=0x0;this[_0x084c('0xa')]=_0x2b0f14[_0x084c('0xa')];this[_0x084c('0x1e')]=_0x2b0f14['connectedlinename'];this[_0x084c('0x1f')]=_0x2b0f14['reason'];this[_0x084c('0x20')]=_0x38bda7[_0x084c('0x20')];this['callbackuniqueid']=_0x38bda7[_0x084c('0x21')];this['callbackat']=_0x38bda7['callbackat'];this[_0x084c('0x22')]=_0x38bda7['recallme'];this['ContactId']=_0x38bda7['ContactId'];this[_0x084c('0x23')]=_0x38bda7[_0x084c('0x23')];this['UserId']=_0x38bda7[_0x084c('0x24')];this[_0x084c('0x25')]=_0x38bda7[_0x084c('0x25')];this[_0x084c('0x26')]=_0x38bda7['CampaignId'];this[_0x084c('0x27')]=_0x38bda7[_0x084c('0x27')]||'';this[_0x084c('0x28')]=_0x38bda7[_0x084c('0x28')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x1488=['countmachineretry','uniqueid','calleridnum','responsetime','droptime','starttime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','diff','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1488,0x88));var _0x8148=function(_0xaaf2e2,_0x19d28a){_0xaaf2e2=_0xaaf2e2-0x0;var _0x28bc36=_0x1488[_0xaaf2e2];return _0x28bc36;};'use strict';var util=require(_0x8148('0x0'));var _=require('lodash');var moment=require(_0x8148('0x1'));function getSeconds(_0x4d28f5,_0x22606a){var _0x5cc7ef=moment(_0x4d28f5)['milliseconds'](0x0);var _0x2fdd7e=moment(_0x22606a)['milliseconds'](0x0);return _0x5cc7ef[_0x8148('0x2')](_0x2fdd7e,_0x8148('0x3'));}function QueueCallerAbandon(_0x11027,_0x153009){this[_0x8148('0x4')]=_0x11027[_0x8148('0x4')];this[_0x8148('0x5')]=_0x11027[_0x8148('0x5')];this['campaigntype']=_0x11027[_0x8148('0x5')]===_0x8148('0x6')?_0x8148('0x7'):_0x11027[_0x8148('0x5')];this[_0x8148('0x8')]=_0x11027[_0x8148('0x8')];this[_0x8148('0x9')]=_0x11027[_0x8148('0x9')];this[_0x8148('0xa')]=_0x11027[_0x8148('0xa')];this[_0x8148('0xb')]=_0x11027[_0x8148('0x8')]+_0x11027['countcongestionretry']+_0x11027[_0x8148('0xa')]+_0x11027[_0x8148('0xc')]+_0x11027[_0x8148('0xd')]+_0x11027['countabandonedretry']+_0x11027['countmachineretry']+_0x11027[_0x8148('0xe')];this[_0x8148('0xc')]=_0x11027['countnosuchnumberretry'];this[_0x8148('0xd')]=_0x11027[_0x8148('0xd')];this[_0x8148('0xf')]=_0x11027[_0x8148('0xf')];this[_0x8148('0x10')]=_0x11027['countmachineretry'];this[_0x8148('0xe')]=_0x11027['countagentrejectretry'];this['uniqueid']=_0x153009[_0x8148('0x11')];this['calleridname']=_0x11027['name'];this[_0x8148('0x12')]=_0x11027['number'];this['starttime']=_0x11027['starttime'];this[_0x8148('0x13')]=_0x11027['responsetime'];this['droptime']=_0x11027[_0x8148('0x14')];this['endtime']=this[_0x8148('0x14')];this['ringtime']=getSeconds(_0x11027[_0x8148('0x13')],_0x11027[_0x8148('0x15')]);this[_0x8148('0x16')]=getSeconds(this[_0x8148('0x14')],_0x11027[_0x8148('0x13')]);this[_0x8148('0x17')]=0x0;this[_0x8148('0x7')]=_0x153009[_0x8148('0x7')];this[_0x8148('0x18')]=_0x153009[_0x8148('0x19')];this[_0x8148('0x1a')]=_0x153009[_0x8148('0x1a')];this[_0x8148('0x1b')]=_0x11027[_0x8148('0x1b')];this['callbackuniqueid']=_0x11027[_0x8148('0x1c')];this[_0x8148('0x1d')]=_0x11027['callbackat'];this['recallme']=_0x11027[_0x8148('0x1e')];this['ContactId']=_0x11027[_0x8148('0x1f')];this[_0x8148('0x20')]=_0x11027[_0x8148('0x20')];this['UserId']=_0x11027['UserId'];this[_0x8148('0x21')]=_0x11027[_0x8148('0x21')];this['CampaignId']=_0x11027[_0x8148('0x22')];this[_0x8148('0x23')]=_0x11027['originatecalleridnum']||'';this[_0x8148('0x24')]=_0x11027[_0x8148('0x24')]||'';}module[_0x8148('0x25')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 2cc6fba..650b8e8 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(_0xf7c858,_0xee481){var _0x3d785e=function(_0x4327d3){while(--_0x4327d3){_0xf7c858['push'](_0xf7c858['shift']());}};_0x3d785e(++_0xee481);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x51c958,_0x69b742){var _0xddc464=function(_0x3a3225){while(--_0x3a3225){_0x51c958['push'](_0x51c958['shift']());}};_0xddc464(++_0x69b742);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 64315ee..acd3172 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 _0x0713=['syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','calleridnum','\x20notify\x20','stringify','catch','error','\x20receiveFax\x20','merge','pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','Fax\x20received','checkTrunk','FaxAccountId','Trunk','Trunk\x20Reachable','format','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState'];(function(_0x336b53,_0xb09983){var _0x22d7e7=function(_0x5da0b7){while(--_0x5da0b7){_0x336b53['push'](_0x336b53['shift']());}};_0x22d7e7(++_0xb09983);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x3071('0x0'));var uuid=require(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var path=require(_0x3071('0x3'));var tiff2pdf=require(_0x3071('0x4'));var gs=require('./util/gs');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var ami=require(_0x3071('0x7'));var rpcDb=require(_0x3071('0x8'));var Channel=require(_0x3071('0x9'));var ut=require(_0x3071('0xa'));var Action=require(_0x3071('0xb'));var faxAccount=require(_0x3071('0xc'));var attachment=require(_0x3071('0xd'));var faxMessage=require(_0x3071('0xe'));function Fax(_0x3e9a5e){this[_0x3071('0xf')]={};this[_0x3071('0x10')]=_0x3e9a5e['faxAccounts'];this[_0x3071('0x11')]=_0x3e9a5e[_0x3071('0x11')];this[_0x3071('0x12')]={};ami['on'](_0x3071('0x13'),this[_0x3071('0x14')]['bind'](this));ami['on'](_0x3071('0x15'),this[_0x3071('0x16')][_0x3071('0x17')](this));ami['on'](_0x3071('0x18'),this[_0x3071('0x19')]['bind'](this));ami['on']('newexten',this[_0x3071('0x1a')]['bind'](this));ami['on'](_0x3071('0x1b'),this[_0x3071('0x1c')]['bind'](this));ami['on'](_0x3071('0x1d'),this['syncReceiveFax'][_0x3071('0x17')](this));ami['on'](_0x3071('0x1e'),this[_0x3071('0x1f')][_0x3071('0x17')](this));ami['on'](_0x3071('0x20'),this[_0x3071('0x21')][_0x3071('0x17')](this));}Fax[_0x3071('0x22')][_0x3071('0x14')]=function(_0x344ea6){if(_0x344ea6['context']===_0x3071('0x23')){for(var _0x17dbda in this[_0x3071('0x10')]){if(this[_0x3071('0x10')][_0x3071('0x24')](_0x17dbda)){if(_0x344ea6[_0x3071('0x25')]===this[_0x3071('0x10')][_0x17dbda][_0x3071('0x26')]){this['channels'][_0x344ea6[_0x3071('0x27')]]={};this[_0x3071('0xf')][_0x344ea6[_0x3071('0x27')]]['channel']=_0x344ea6[_0x3071('0x28')];this['channels'][_0x344ea6[_0x3071('0x27')]]['id']=this[_0x3071('0x10')][_0x17dbda]['id'];this[_0x3071('0xf')][_0x344ea6[_0x3071('0x27')]][_0x3071('0x29')]=this[_0x3071('0x10')][_0x17dbda][_0x3071('0x29')];logger[_0x3071('0x2a')](_0x344ea6['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x3071('0x12')][_0x344ea6[_0x3071('0x27')]]){this[_0x3071('0xf')][_0x344ea6[_0x3071('0x27')]]={};this[_0x3071('0xf')][_0x344ea6[_0x3071('0x27')]][_0x3071('0x28')]=_0x344ea6[_0x3071('0x28')];logger[_0x3071('0x2a')](_0x344ea6['uniqueid'],_0x3071('0x2b'));}};Fax[_0x3071('0x22')][_0x3071('0x16')]=function(_0x4d5c4b){if(this[_0x3071('0xf')][_0x4d5c4b[_0x3071('0x27')]]){for(var _0x163604 in _0x4d5c4b[_0x3071('0x2c')]){if(_0x4d5c4b[_0x3071('0x2c')][_0x3071('0x24')](_0x163604)){this[_0x3071('0xf')][_0x4d5c4b[_0x3071('0x27')]][_0x163604]=_0x4d5c4b[_0x3071('0x2d')];}}}};Fax[_0x3071('0x22')][_0x3071('0x19')]=function(_0x5aba96){if(this['channels'][_0x5aba96[_0x3071('0x27')]]){this[_0x3071('0xf')][_0x5aba96[_0x3071('0x27')]][_0x3071('0x2e')]=_0x5aba96[_0x3071('0x2e')];this[_0x3071('0xf')][_0x5aba96[_0x3071('0x27')]][_0x3071('0x2f')]=_0x5aba96['channelstatedesc'];}};Fax['prototype']['syncNewExten']=function(_0x1b0aaf){if(this[_0x3071('0xf')][_0x1b0aaf['uniqueid']]){for(var _0x17407a in _0x1b0aaf[_0x3071('0x2c')]){if(_0x1b0aaf[_0x3071('0x2c')][_0x3071('0x24')](_0x17407a)){this['channels'][_0x1b0aaf[_0x3071('0x27')]][_0x17407a]=_0x1b0aaf[_0x3071('0x2d')];}}}};Fax[_0x3071('0x22')][_0x3071('0x1c')]=function(_0x148096){if(this[_0x3071('0xf')][_0x148096[_0x3071('0x27')]]){this[_0x3071('0xf')][_0x148096['uniqueid']][_0x3071('0x30')]=_0x148096['operation'];this['channels'][_0x148096[_0x3071('0x27')]][_0x3071('0x31')]=_0x148096['status'];this[_0x3071('0xf')][_0x148096[_0x3071('0x27')]][_0x3071('0x26')]=_0x148096[_0x3071('0x26')];this[_0x3071('0xf')][_0x148096[_0x3071('0x27')]]['filename']=_0x148096[_0x3071('0x32')];logger[_0x3071('0x2a')](_0x148096['uniqueid'],_0x3071('0x33'));}};Fax['prototype'][_0x3071('0x34')]=function(_0x43133a){var _0x5733e9=this;if(this['channels'][_0x43133a[_0x3071('0x27')]]){var _0x185f63=this[_0x3071('0xf')][_0x43133a['uniqueid']]['id'];this[_0x3071('0xf')][_0x43133a['uniqueid']][_0x3071('0x35')]=_0x43133a['remotestationid'];this[_0x3071('0xf')][_0x43133a[_0x3071('0x27')]][_0x3071('0x36')]=_0x43133a[_0x3071('0x36')];this[_0x3071('0xf')][_0x43133a['uniqueid']]['localstationid']=_0x43133a[_0x3071('0x26')];this[_0x3071('0xf')][_0x43133a[_0x3071('0x27')]][_0x3071('0x37')]=_0x43133a['resolution'];this[_0x3071('0xf')][_0x43133a[_0x3071('0x27')]][_0x3071('0x38')]=_0x43133a[_0x3071('0x38')];this[_0x3071('0xf')][_0x43133a[_0x3071('0x27')]]['filename']=_0x43133a[_0x3071('0x32')];this['channels'][_0x43133a['uniqueid']]['calleridnum']=_0x43133a['calleridnum'];if(this[_0x3071('0xf')][_0x43133a[_0x3071('0x27')]][_0x3071('0x36')]>0x0){tiff2pdf(_0x43133a[_0x3071('0x32')],_0x3071('0x39'),function(_0x3a81e9){logger[_0x3071('0x2a')](_0x43133a[_0x3071('0x27')],'\x20result\x20conversion\x20file\x20',_0x3a81e9[_0x3071('0x3a')]);attachment[_0x3071('0x3b')]({'name':path[_0x3071('0x3c')](_0x43133a[_0x3071('0x32')])[_0x3071('0x29')],'basename':path['parse'](_0x43133a['filename'])[_0x3071('0x29')]+_0x3071('0x3d'),'type':_0x3071('0x3e')})[_0x3071('0x3f')](function(_0x606ef8){faxAccount['notify'](_0x185f63,{'from':_0x43133a[_0x3071('0x40')],'mapKey':'fax','body':path[_0x3071('0x3c')](_0x43133a['filename'])['name']+_0x3071('0x3d'),'AttachmentId':_0x606ef8['id']})['catch'](function(_0x1862ea){logger['error'](_0x43133a[_0x3071('0x27')],_0x3071('0x41'),JSON[_0x3071('0x42')](_0x1862ea));});})[_0x3071('0x43')](function(_0x554047){logger[_0x3071('0x44')](_0x43133a['uniqueid'],_0x3071('0x45'),JSON['stringify'](_0x554047));});});}logger[_0x3071('0x2a')](_0x43133a[_0x3071('0x27')],'\x20receiveFax\x20');}};Fax[_0x3071('0x22')][_0x3071('0x21')]=function(_0x224a70){if(this[_0x3071('0x12')][_0x224a70[_0x3071('0x27')]]){_[_0x3071('0x46')](this[_0x3071('0xf')][_0x224a70['uniqueid']],_[_0x3071('0x47')](_0x224a70,[_0x3071('0x48'),_0x3071('0x49')]));}};function updateStatus(_0xda07a4){if(_0xda07a4['AttachmentId']){faxMessage[_0x3071('0x4a')](_0xda07a4[_0x3071('0x4b')],{'failMessage':_0x3071('0x4c')})[_0x3071('0x3f')](function(_0x22aade){ut[_0x3071('0x4d')](_0x3071('0x4e'),_0x22aade);})[_0x3071('0x43')](function(_0xbf014e){ut[_0x3071('0x4d')](_0x3071('0x4f'),_0xbf014e);});}else{ut[_0x3071('0x4d')](_0x3071('0x50'));}}Fax[_0x3071('0x22')][_0x3071('0x51')]=function(_0x12be97,_0x596cdd,_0x47a438){var _0x12536d=this;var _0x580c04={};if(_0x596cdd){_0x580c04={'read':_0x596cdd};}else{_0x580c04={'failMessage':_0x47a438};}if(this[_0x3071('0x12')][_0x12be97][_0x3071('0x4b')]){faxMessage[_0x3071('0x4a')](this['actions'][_0x12be97][_0x3071('0x4b')],_0x580c04)[_0x3071('0x3f')](function(_0x5bc69e){ut['logger'](_0x3071('0x52'),_0x5bc69e);})[_0x3071('0x43')](function(_0x30e9d5){ut[_0x3071('0x4d')]('[Fax][Message][NoUpdate1]',_0x30e9d5);})[_0x3071('0x53')](function(){delete _0x12536d[_0x3071('0xf')][_0x12be97];delete _0x12536d[_0x3071('0x12')][_0x12be97];});}else{ut[_0x3071('0x4d')](_0x3071('0x54'));delete this['channels'][_0x12be97];delete this[_0x3071('0x12')][_0x12be97];}};Fax[_0x3071('0x22')][_0x3071('0x1f')]=function(_0x27bad1){var _0x12d6be=this;if(this[_0x3071('0xf')][_0x27bad1[_0x3071('0x27')]]){if(this['actions'][_0x27bad1['uniqueid']]){this[_0x3071('0xf')][_0x27bad1['uniqueid']]['id']=this[_0x3071('0x12')][_0x27bad1[_0x3071('0x27')]]['id'];this['channels'][_0x27bad1[_0x3071('0x27')]][_0x3071('0x29')]=this['actions'][_0x27bad1[_0x3071('0x27')]][_0x3071('0x29')];}logger[_0x3071('0x2a')](_0x27bad1[_0x3071('0x27')],this[_0x3071('0x12')][_0x27bad1['uniqueid']]?_0x3071('0x55'):_0x3071('0x56'),JSON[_0x3071('0x42')](this['channels'][_0x27bad1[_0x3071('0x27')]]));if(this[_0x3071('0x12')][_0x27bad1[_0x3071('0x27')]]){if(this[_0x3071('0xf')][_0x27bad1[_0x3071('0x27')]][_0x3071('0x57')]>0x0&&this[_0x3071('0xf')][_0x27bad1[_0x3071('0x27')]][_0x3071('0x1b')]==='SUCCESS'){this[_0x3071('0x51')](_0x27bad1[_0x3071('0x27')],!![]);}else{this[_0x3071('0x51')](_0x27bad1[_0x3071('0x27')],![],this[_0x3071('0xf')][_0x27bad1[_0x3071('0x27')]][_0x3071('0x58')]?_0x3071('0x59')+this[_0x3071('0xf')][_0x27bad1[_0x3071('0x27')]][_0x3071('0x58')]:'SENDING\x20FAILED');}}}};Fax[_0x3071('0x22')][_0x3071('0x5a')]=function(_0x279594){var _0x3ed86c=this;return new BPromise(function(_0x429a03,_0x158dda){_0x3ed86c[_0x3071('0x5b')](_0x279594,_0x3ed86c[_0x3071('0x10')][_0x279594['FaxAccountId']])[_0x3071('0x3f')](function(_0x1ebd77){ut['logger']('[Fax][execOriginate][success]',_0x1ebd77);_0x429a03(ut[_0x3071('0x3a')](_0x3071('0x5c')));})[_0x3071('0x43')](function(_0x38bc1f){ut['logger']('[Fax][execOriginate][failure]',_0x38bc1f);updateStatus(_0x279594);_0x158dda(ut[_0x3071('0x3a')]('Fax\x20failed'));});});};Fax['prototype']['checkAfterSend']=function(_0x58da43){var _0xec6f46=this;return new BPromise(function(_0x1da52c,_0xd928e8){var _0x567d19=_0xec6f46[_0x3071('0x5d')](_0xec6f46[_0x3071('0x10')][_0x58da43[_0x3071('0x5e')]][_0x3071('0x5f')],_0x58da43);if(_0x567d19['isValid']){_0x1da52c(ut[_0x3071('0x3a')](_0x3071('0x60')));}else{_0xd928e8(ut['message'](_0x567d19[_0x3071('0x3a')]));}});};function originate(_0x29ee70,_0x388cd1,_0x40c258){return new BPromise(function(_0x4edd23,_0x11ffdd){if(_0x40c258){var _0x2deac2=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[_0x3071('0x3c')](_0x29ee70[_0x3071('0x3')])[_0x3071('0x29')],_0x29ee70['path']);gs['execute'](_0x2deac2)[_0x3071('0x3f')](function(){_0x29ee70[_0x3071('0x3')]=util[_0x3071('0x61')](_0x3071('0x62'),path[_0x3071('0x3c')](_0x29ee70[_0x3071('0x3')])[_0x3071('0x63')],path[_0x3071('0x3c')](_0x29ee70['path'])[_0x3071('0x29')]);_0x388cd1['XMF-PATH']=_0x29ee70[_0x3071('0x3')];ut[_0x3071('0x4d')](_0x3071('0x64'),'');ami[_0x3071('0x65')](ut[_0x3071('0x66')](_0x29ee70,_0x388cd1))[_0x3071('0x3f')](function(_0x155542){_0x4edd23(_0x155542);})[_0x3071('0x43')](function(_0x4fa372){_0x11ffdd(_0x4fa372);});})[_0x3071('0x43')](function(_0x138a94){_0x11ffdd(_0x138a94);});}else{ami[_0x3071('0x65')](ut['variablesAction'](_0x29ee70,_0x388cd1))[_0x3071('0x3f')](function(_0x22ec7b){_0x4edd23(_0x22ec7b);})[_0x3071('0x43')](function(_0x567e33){_0x11ffdd(_0x567e33);});}});}Fax['prototype'][_0x3071('0x5b')]=function(_0x5cff7f,_0x288bfc){var _0x10a207=this;return new BPromise(function(_0x40d987,_0x23bc22){var _0x311939=uuid['v4']();var _0x437098=ut[_0x3071('0x67')](_0x5cff7f,_0x288bfc);_0x10a207['actions'][_0x311939]=new Action(_0x311939,_0x288bfc,_0x5cff7f);var _0x1f2be3=_0x10a207[_0x3071('0x12')][_0x311939];if(path[_0x3071('0x3c')](_0x5cff7f[_0x3071('0x3')])[_0x3071('0x68')]===_0x3071('0x3d')){originate(_0x1f2be3,_0x437098,!![])[_0x3071('0x3f')](function(_0x277377){_0x40d987(_0x277377);})['catch'](function(_0x254adf){_0x23bc22(_0x254adf);});}else{originate(_0x1f2be3,_0x437098,![])['then'](function(_0x2aef6e){_0x40d987(_0x2aef6e);})[_0x3071('0x43')](function(_0x3ef605){_0x23bc22(_0x3ef605);});}});};Fax[_0x3071('0x22')][_0x3071('0x69')]=function(_0xa8e233){return!_[_0x3071('0x6a')](_0xa8e233)&&!_[_0x3071('0x6a')](_0xa8e233[_0x3071('0x29')])&&!_[_0x3071('0x6a')](_0xa8e233['active'])&&_0xa8e233[_0x3071('0x6b')]&&!_[_0x3071('0x6a')](this['trunks'][util[_0x3071('0x61')](_0x3071('0x6c'),_0xa8e233[_0x3071('0x29')])])&&!_[_0x3071('0x6a')](this[_0x3071('0x11')][util['format']('SIP/%s',_0xa8e233[_0x3071('0x29')])]['status'])&&(this[_0x3071('0x11')][util[_0x3071('0x61')](_0x3071('0x6c'),_0xa8e233[_0x3071('0x29')])][_0x3071('0x31')]===_0x3071('0x6d')||this['trunks'][util[_0x3071('0x61')](_0x3071('0x6c'),_0xa8e233[_0x3071('0x29')])][_0x3071('0x31')]==='unmonitored');};Fax[_0x3071('0x22')][_0x3071('0x5d')]=function(_0x4db74f,_0x3adaa2){if(!this[_0x3071('0x69')](_0x4db74f)){ut[_0x3071('0x4d')](_0x3071('0x6e'),_[_0x3071('0x6a')](_0x4db74f)?'':_0x4db74f['name']+_0x3071('0x6f'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x3071('0x6a')](_0x3adaa2[_0x3071('0x6')])){ut[_0x3071('0x4d')](_0x3071('0x70'),JSON[_0x3071('0x42')](_0x3adaa2));return{'isValid':![],'message':_0x3071('0x71')};}if(_[_0x3071('0x6a')](_0x3adaa2[_0x3071('0x3')])){ut['logger'](_0x3071('0x72'),JSON[_0x3071('0x42')](_0x3adaa2));return{'isValid':![],'message':_0x3071('0x73')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x3071('0x74')]=Fax; \ No newline at end of file +var _0xa5fa=['filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','then','notify','.pdf','error','\x20notify\x20','catch','\x20receiveFax\x20','stringify','merge','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','execOriginate','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','format','%s/%s.tif','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','varset','bind','newstate','syncNewState','newexten','syncFaxStatus','receivefax','syncReceiveFax','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','syncVarSet','variable','hasOwnProperty','value','channelstate','channelstatedesc','syncNewExten','operation','status'];(function(_0x17c922,_0x45fdd3){var _0x5871fc=function(_0x225369){while(--_0x225369){_0x17c922['push'](_0x17c922['shift']());}};_0x5871fc(++_0x45fdd3);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x371187,_0xe7b303){_0x371187=_0x371187-0x0;var _0x37eaae=_0xa5fa[_0x371187];return _0x37eaae;};'use strict';var util=require('util');var _=require(_0xaa5f('0x0'));var BPromise=require(_0xaa5f('0x1'));var uuid=require(_0xaa5f('0x2'));var moment=require(_0xaa5f('0x3'));var path=require('path');var tiff2pdf=require(_0xaa5f('0x4'));var gs=require(_0xaa5f('0x5'));var logger=require('../../../config/logger')(_0xaa5f('0x6'));var ami=require(_0xaa5f('0x7'));var rpcDb=require(_0xaa5f('0x8'));var Channel=require(_0xaa5f('0x9'));var ut=require(_0xaa5f('0xa'));var Action=require(_0xaa5f('0xb'));var faxAccount=require(_0xaa5f('0xc'));var attachment=require(_0xaa5f('0xd'));var faxMessage=require(_0xaa5f('0xe'));function Fax(_0x3f550e){this[_0xaa5f('0xf')]={};this['faxAccounts']=_0x3f550e[_0xaa5f('0x10')];this[_0xaa5f('0x11')]=_0x3f550e['trunks'];this['actions']={};ami['on'](_0xaa5f('0x12'),this['syncNewchannel']['bind'](this));ami['on'](_0xaa5f('0x13'),this['syncVarSet'][_0xaa5f('0x14')](this));ami['on'](_0xaa5f('0x15'),this[_0xaa5f('0x16')][_0xaa5f('0x14')](this));ami['on'](_0xaa5f('0x17'),this['syncNewExten'][_0xaa5f('0x14')](this));ami['on']('faxstatus',this[_0xaa5f('0x18')][_0xaa5f('0x14')](this));ami['on'](_0xaa5f('0x19'),this[_0xaa5f('0x1a')][_0xaa5f('0x14')](this));ami['on']('hangup',this['syncHangup'][_0xaa5f('0x14')](this));ami['on'](_0xaa5f('0x1b'),this[_0xaa5f('0x1c')][_0xaa5f('0x14')](this));}Fax[_0xaa5f('0x1d')][_0xaa5f('0x1e')]=function(_0x22a797){if(_0x22a797[_0xaa5f('0x1f')]===_0xaa5f('0x20')){for(var _0x3d874f in this[_0xaa5f('0x10')]){if(this[_0xaa5f('0x10')]['hasOwnProperty'](_0x3d874f)){if(_0x22a797[_0xaa5f('0x21')]===this[_0xaa5f('0x10')][_0x3d874f][_0xaa5f('0x22')]){this[_0xaa5f('0xf')][_0x22a797[_0xaa5f('0x23')]]={};this[_0xaa5f('0xf')][_0x22a797[_0xaa5f('0x23')]][_0xaa5f('0x24')]=_0x22a797[_0xaa5f('0x24')];this[_0xaa5f('0xf')][_0x22a797[_0xaa5f('0x23')]]['id']=this[_0xaa5f('0x10')][_0x3d874f]['id'];this[_0xaa5f('0xf')][_0x22a797['uniqueid']][_0xaa5f('0x25')]=this['faxAccounts'][_0x3d874f][_0xaa5f('0x25')];logger[_0xaa5f('0x26')](_0x22a797['uniqueid'],_0xaa5f('0x27'));}}}}if(this[_0xaa5f('0x28')][_0x22a797['uniqueid']]){this[_0xaa5f('0xf')][_0x22a797[_0xaa5f('0x23')]]={};this[_0xaa5f('0xf')][_0x22a797[_0xaa5f('0x23')]][_0xaa5f('0x24')]=_0x22a797[_0xaa5f('0x24')];logger[_0xaa5f('0x26')](_0x22a797[_0xaa5f('0x23')],'\x20syncNewchannel\x20');}};Fax[_0xaa5f('0x1d')][_0xaa5f('0x29')]=function(_0x1ed8eb){if(this['channels'][_0x1ed8eb[_0xaa5f('0x23')]]){for(var _0x269209 in _0x1ed8eb[_0xaa5f('0x2a')]){if(_0x1ed8eb['variable'][_0xaa5f('0x2b')](_0x269209)){this['channels'][_0x1ed8eb['uniqueid']][_0x269209]=_0x1ed8eb[_0xaa5f('0x2c')];}}}};Fax['prototype'][_0xaa5f('0x16')]=function(_0x4e0ec9){if(this['channels'][_0x4e0ec9['uniqueid']]){this[_0xaa5f('0xf')][_0x4e0ec9['uniqueid']][_0xaa5f('0x2d')]=_0x4e0ec9[_0xaa5f('0x2d')];this['channels'][_0x4e0ec9['uniqueid']][_0xaa5f('0x2e')]=_0x4e0ec9['channelstatedesc'];}};Fax[_0xaa5f('0x1d')][_0xaa5f('0x2f')]=function(_0x52132c){if(this[_0xaa5f('0xf')][_0x52132c[_0xaa5f('0x23')]]){for(var _0x9c733b in _0x52132c['variable']){if(_0x52132c[_0xaa5f('0x2a')][_0xaa5f('0x2b')](_0x9c733b)){this['channels'][_0x52132c['uniqueid']][_0x9c733b]=_0x52132c['value'];}}}};Fax['prototype'][_0xaa5f('0x18')]=function(_0x14fbd9){if(this[_0xaa5f('0xf')][_0x14fbd9[_0xaa5f('0x23')]]){this[_0xaa5f('0xf')][_0x14fbd9[_0xaa5f('0x23')]][_0xaa5f('0x30')]=_0x14fbd9['operation'];this[_0xaa5f('0xf')][_0x14fbd9[_0xaa5f('0x23')]][_0xaa5f('0x31')]=_0x14fbd9[_0xaa5f('0x31')];this[_0xaa5f('0xf')][_0x14fbd9[_0xaa5f('0x23')]]['localstationid']=_0x14fbd9[_0xaa5f('0x22')];this[_0xaa5f('0xf')][_0x14fbd9[_0xaa5f('0x23')]][_0xaa5f('0x32')]=_0x14fbd9[_0xaa5f('0x32')];logger['info'](_0x14fbd9['uniqueid'],_0xaa5f('0x33'));}};Fax[_0xaa5f('0x1d')][_0xaa5f('0x1a')]=function(_0x964105){var _0x56826c=this;if(this[_0xaa5f('0xf')][_0x964105[_0xaa5f('0x23')]]){var _0x1a59d2=this[_0xaa5f('0xf')][_0x964105[_0xaa5f('0x23')]]['id'];this[_0xaa5f('0xf')][_0x964105[_0xaa5f('0x23')]][_0xaa5f('0x34')]=_0x964105[_0xaa5f('0x34')];this[_0xaa5f('0xf')][_0x964105[_0xaa5f('0x23')]]['pagestransferred']=_0x964105[_0xaa5f('0x35')];this[_0xaa5f('0xf')][_0x964105[_0xaa5f('0x23')]][_0xaa5f('0x22')]=_0x964105[_0xaa5f('0x22')];this[_0xaa5f('0xf')][_0x964105[_0xaa5f('0x23')]][_0xaa5f('0x36')]=_0x964105[_0xaa5f('0x36')];this[_0xaa5f('0xf')][_0x964105['uniqueid']][_0xaa5f('0x37')]=_0x964105['transferrate'];this[_0xaa5f('0xf')][_0x964105[_0xaa5f('0x23')]][_0xaa5f('0x32')]=_0x964105['filename'];this[_0xaa5f('0xf')][_0x964105[_0xaa5f('0x23')]][_0xaa5f('0x38')]=_0x964105['calleridnum'];if(this[_0xaa5f('0xf')][_0x964105[_0xaa5f('0x23')]][_0xaa5f('0x35')]>0x0){tiff2pdf(_0x964105[_0xaa5f('0x32')],'/var/opt/motion2/server/files/attachments/',function(_0x286e01){logger[_0xaa5f('0x26')](_0x964105[_0xaa5f('0x23')],_0xaa5f('0x39'),_0x286e01[_0xaa5f('0x3a')]);attachment[_0xaa5f('0x3b')]({'name':path[_0xaa5f('0x3c')](_0x964105[_0xaa5f('0x32')])['name'],'basename':path[_0xaa5f('0x3c')](_0x964105['filename'])[_0xaa5f('0x25')]+'.pdf','type':_0xaa5f('0x3d')})[_0xaa5f('0x3e')](function(_0x506789){faxAccount[_0xaa5f('0x3f')](_0x1a59d2,{'from':_0x964105[_0xaa5f('0x38')],'mapKey':_0xaa5f('0x6'),'body':path['parse'](_0x964105['filename'])['name']+_0xaa5f('0x40'),'AttachmentId':_0x506789['id']})['catch'](function(_0x38c2e0){logger[_0xaa5f('0x41')](_0x964105[_0xaa5f('0x23')],_0xaa5f('0x42'),JSON['stringify'](_0x38c2e0));});})[_0xaa5f('0x43')](function(_0x187542){logger[_0xaa5f('0x41')](_0x964105[_0xaa5f('0x23')],_0xaa5f('0x44'),JSON[_0xaa5f('0x45')](_0x187542));});});}logger[_0xaa5f('0x26')](_0x964105[_0xaa5f('0x23')],_0xaa5f('0x44'));}};Fax[_0xaa5f('0x1d')][_0xaa5f('0x1c')]=function(_0x2de737){if(this[_0xaa5f('0x28')][_0x2de737[_0xaa5f('0x23')]]){_[_0xaa5f('0x46')](this[_0xaa5f('0xf')][_0x2de737['uniqueid']],_[_0xaa5f('0x47')](_0x2de737,[_0xaa5f('0x48'),_0xaa5f('0x49')]));}};function updateStatus(_0x3c2094){if(_0x3c2094[_0xaa5f('0x4a')]){faxMessage[_0xaa5f('0x4b')](_0x3c2094[_0xaa5f('0x4a')],{'failMessage':'SENDING\x20FAILED\x20'})[_0xaa5f('0x3e')](function(_0x474592){ut[_0xaa5f('0x4c')](_0xaa5f('0x4d'),_0x474592);})['catch'](function(_0xb10902){ut[_0xaa5f('0x4c')](_0xaa5f('0x4e'),_0xb10902);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype']['updateStatus']=function(_0x585559,_0x509c61,_0x1f47a0){var _0x451f9f=this;var _0x37ae00={};if(_0x509c61){_0x37ae00={'read':_0x509c61};}else{_0x37ae00={'failMessage':_0x1f47a0};}if(this[_0xaa5f('0x28')][_0x585559][_0xaa5f('0x4a')]){faxMessage[_0xaa5f('0x4b')](this['actions'][_0x585559]['AttachmentId'],_0x37ae00)[_0xaa5f('0x3e')](function(_0x3e0f41){ut['logger'](_0xaa5f('0x4f'),_0x3e0f41);})[_0xaa5f('0x43')](function(_0x2b815d){ut[_0xaa5f('0x4c')](_0xaa5f('0x50'),_0x2b815d);})[_0xaa5f('0x51')](function(){delete _0x451f9f[_0xaa5f('0xf')][_0x585559];delete _0x451f9f['actions'][_0x585559];});}else{ut['logger'](_0xaa5f('0x52'));delete this[_0xaa5f('0xf')][_0x585559];delete this['actions'][_0x585559];}};Fax['prototype']['syncHangup']=function(_0x138485){var _0x5e9510=this;if(this[_0xaa5f('0xf')][_0x138485['uniqueid']]){if(this['actions'][_0x138485[_0xaa5f('0x23')]]){this[_0xaa5f('0xf')][_0x138485[_0xaa5f('0x23')]]['id']=this['actions'][_0x138485[_0xaa5f('0x23')]]['id'];this[_0xaa5f('0xf')][_0x138485[_0xaa5f('0x23')]]['name']=this[_0xaa5f('0x28')][_0x138485[_0xaa5f('0x23')]]['name'];}logger[_0xaa5f('0x26')](_0x138485[_0xaa5f('0x23')],this[_0xaa5f('0x28')][_0x138485[_0xaa5f('0x23')]]?_0xaa5f('0x53'):_0xaa5f('0x54'),JSON[_0xaa5f('0x45')](this[_0xaa5f('0xf')][_0x138485[_0xaa5f('0x23')]]));if(this['actions'][_0x138485[_0xaa5f('0x23')]]){if(this[_0xaa5f('0xf')][_0x138485[_0xaa5f('0x23')]][_0xaa5f('0x55')]>0x0&&this[_0xaa5f('0xf')][_0x138485[_0xaa5f('0x23')]][_0xaa5f('0x56')]===_0xaa5f('0x57')){this['updateStatus'](_0x138485[_0xaa5f('0x23')],!![]);}else{this['updateStatus'](_0x138485[_0xaa5f('0x23')],![],this[_0xaa5f('0xf')][_0x138485[_0xaa5f('0x23')]][_0xaa5f('0x58')]?'SENDING\x20FAILED:\x20'+this[_0xaa5f('0xf')][_0x138485[_0xaa5f('0x23')]][_0xaa5f('0x58')]:'SENDING\x20FAILED');}}}};Fax[_0xaa5f('0x1d')]['send']=function(_0x42ea3b){var _0x5e7a74=this;return new BPromise(function(_0xddf1bd,_0x1c7a1f){_0x5e7a74[_0xaa5f('0x59')](_0x42ea3b,_0x5e7a74[_0xaa5f('0x10')][_0x42ea3b['FaxAccountId']])[_0xaa5f('0x3e')](function(_0x930b2c){ut['logger']('[Fax][execOriginate][success]',_0x930b2c);_0xddf1bd(ut[_0xaa5f('0x3a')](_0xaa5f('0x5a')));})['catch'](function(_0x3168f6){ut[_0xaa5f('0x4c')](_0xaa5f('0x5b'),_0x3168f6);updateStatus(_0x42ea3b);_0x1c7a1f(ut['message'](_0xaa5f('0x5c')));});});};Fax[_0xaa5f('0x1d')]['checkAfterSend']=function(_0x44e0f3){var _0x1f31f2=this;return new BPromise(function(_0x47835d,_0x5abaf6){var _0x37445c=_0x1f31f2[_0xaa5f('0x5d')](_0x1f31f2['faxAccounts'][_0x44e0f3[_0xaa5f('0x5e')]][_0xaa5f('0x5f')],_0x44e0f3);if(_0x37445c[_0xaa5f('0x60')]){_0x47835d(ut[_0xaa5f('0x3a')](_0xaa5f('0x61')));}else{_0x5abaf6(ut['message'](_0x37445c[_0xaa5f('0x3a')]));}});};function originate(_0x2ba378,_0x464ac7,_0x216399){return new BPromise(function(_0x2a1049,_0x508fe7){if(_0x216399){var _0x22011e=util['format'](_0xaa5f('0x62'),path[_0xaa5f('0x3c')](_0x2ba378[_0xaa5f('0x63')])[_0xaa5f('0x25')],_0x2ba378['path']);gs[_0xaa5f('0x64')](_0x22011e)[_0xaa5f('0x3e')](function(){_0x2ba378[_0xaa5f('0x63')]=util[_0xaa5f('0x65')](_0xaa5f('0x66'),path[_0xaa5f('0x3c')](_0x2ba378['path'])['dir'],path[_0xaa5f('0x3c')](_0x2ba378[_0xaa5f('0x63')])[_0xaa5f('0x25')]);_0x464ac7[_0xaa5f('0x67')]=_0x2ba378[_0xaa5f('0x63')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0xaa5f('0x68')](ut[_0xaa5f('0x69')](_0x2ba378,_0x464ac7))['then'](function(_0xdcc133){_0x2a1049(_0xdcc133);})['catch'](function(_0x469f92){_0x508fe7(_0x469f92);});})[_0xaa5f('0x43')](function(_0x49fd15){_0x508fe7(_0x49fd15);});}else{ami[_0xaa5f('0x68')](ut[_0xaa5f('0x69')](_0x2ba378,_0x464ac7))[_0xaa5f('0x3e')](function(_0x24c4ae){_0x2a1049(_0x24c4ae);})[_0xaa5f('0x43')](function(_0xc4c859){_0x508fe7(_0xc4c859);});}});}Fax[_0xaa5f('0x1d')]['execOriginate']=function(_0x5f86aa,_0x2974bd){var _0x3fee9f=this;return new BPromise(function(_0x5e86af,_0x12fedd){var _0x1376e1=uuid['v4']();var _0x3c11c7=ut[_0xaa5f('0x6a')](_0x5f86aa,_0x2974bd);_0x3fee9f[_0xaa5f('0x28')][_0x1376e1]=new Action(_0x1376e1,_0x2974bd,_0x5f86aa);var _0x5d4cab=_0x3fee9f[_0xaa5f('0x28')][_0x1376e1];if(path[_0xaa5f('0x3c')](_0x5f86aa[_0xaa5f('0x63')])[_0xaa5f('0x6b')]===_0xaa5f('0x40')){originate(_0x5d4cab,_0x3c11c7,!![])[_0xaa5f('0x3e')](function(_0x155eb4){_0x5e86af(_0x155eb4);})[_0xaa5f('0x43')](function(_0x3893bf){_0x12fedd(_0x3893bf);});}else{originate(_0x5d4cab,_0x3c11c7,![])[_0xaa5f('0x3e')](function(_0x47bf08){_0x5e86af(_0x47bf08);})['catch'](function(_0xb7292d){_0x12fedd(_0xb7292d);});}});};Fax[_0xaa5f('0x1d')][_0xaa5f('0x6c')]=function(_0x40acb0){return!_[_0xaa5f('0x6d')](_0x40acb0)&&!_[_0xaa5f('0x6d')](_0x40acb0[_0xaa5f('0x25')])&&!_[_0xaa5f('0x6d')](_0x40acb0['active'])&&_0x40acb0[_0xaa5f('0x6e')]&&!_[_0xaa5f('0x6d')](this[_0xaa5f('0x11')][util['format']('SIP/%s',_0x40acb0[_0xaa5f('0x25')])])&&!_[_0xaa5f('0x6d')](this[_0xaa5f('0x11')][util[_0xaa5f('0x65')](_0xaa5f('0x6f'),_0x40acb0[_0xaa5f('0x25')])][_0xaa5f('0x31')])&&(this[_0xaa5f('0x11')][util[_0xaa5f('0x65')](_0xaa5f('0x6f'),_0x40acb0['name'])][_0xaa5f('0x31')]===_0xaa5f('0x70')||this[_0xaa5f('0x11')][util[_0xaa5f('0x65')](_0xaa5f('0x6f'),_0x40acb0['name'])][_0xaa5f('0x31')]===_0xaa5f('0x71'));};Fax[_0xaa5f('0x1d')]['checkTrunk']=function(_0x553447,_0x5a9db0){if(!this[_0xaa5f('0x6c')](_0x553447)){ut[_0xaa5f('0x4c')](_0xaa5f('0x72'),_[_0xaa5f('0x6d')](_0x553447)?'':_0x553447['name']+_0xaa5f('0x73'));return{'isValid':![],'message':_0xaa5f('0x74')};}if(_[_0xaa5f('0x6d')](_0x5a9db0[_0xaa5f('0x6')])){ut[_0xaa5f('0x4c')](_0xaa5f('0x75'),JSON[_0xaa5f('0x45')](_0x5a9db0));return{'isValid':![],'message':_0xaa5f('0x76')};}if(_[_0xaa5f('0x6d')](_0x5a9db0[_0xaa5f('0x63')])){ut[_0xaa5f('0x4c')](_0xaa5f('0x77'),JSON[_0xaa5f('0x45')](_0x5a9db0));return{'isValid':![],'message':_0xaa5f('0x78')};}return{'isValid':!![],'message':_0xaa5f('0x79')};};module[_0xaa5f('0x7a')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index b501319..c549f65 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 _0x0043=['bluebird','lodash','../rpc/faxAccount','error','inspect','resolve','catch','[Notify]\x20','util'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0043,0x14c));var _0x3004=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x0043[_0x56ba92];return _0x8fe94d;};'use strict';var util=require(_0x3004('0x0'));var BPromise=require(_0x3004('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0x3004('0x2'));var faxAccount=require(_0x3004('0x3'));function loggerCatch(_0x3ae91b){return function(_0x3d6f9d){logger[_0x3004('0x4')](_0x3ae91b,util[_0x3004('0x5')](_0x3d6f9d,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x40a29d,_0x15882f){return BPromise[_0x3004('0x6')]()['then'](faxAccount['notify'](_0x40a29d,_0x15882f))[_0x3004('0x7')](loggerCatch(_0x3004('0x8')));}; \ No newline at end of file +var _0x4886=['[Notify]\x20','util','bluebird','preview','lodash','../rpc/faxAccount','error','notify','resolve','then','catch'];(function(_0x130705,_0x2d266b){var _0x1fa991=function(_0x395639){while(--_0x395639){_0x130705['push'](_0x130705['shift']());}};_0x1fa991(++_0x2d266b);}(_0x4886,0x156));var _0x6488=function(_0x5bfd33,_0x19bc88){_0x5bfd33=_0x5bfd33-0x0;var _0x5e504e=_0x4886[_0x5bfd33];return _0x5e504e;};'use strict';var util=require(_0x6488('0x0'));var BPromise=require(_0x6488('0x1'));var logger=require('../../../config/logger')(_0x6488('0x2'));var _=require(_0x6488('0x3'));var faxAccount=require(_0x6488('0x4'));function loggerCatch(_0x2355e8){return function(_0x360ef8){logger[_0x6488('0x5')](_0x2355e8,util['inspect'](_0x360ef8,{'showHidden':![],'depth':null}));};}exports[_0x6488('0x6')]=function(_0x5b0e17,_0x16f474){return BPromise[_0x6488('0x7')]()[_0x6488('0x8')](faxAccount[_0x6488('0x6')](_0x5b0e17,_0x16f474))[_0x6488('0x9')](loggerCatch(_0x6488('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 23104d7..541f299 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 _0xa6b9=['fax','bluebird','child_process','exec','execute','info','Exec\x20gs','inspect','util'];(function(_0x2f08c3,_0x1acb08){var _0x488f53=function(_0x32f4eb){while(--_0x32f4eb){_0x2f08c3['push'](_0x2f08c3['shift']());}};_0x488f53(++_0x1acb08);}(_0xa6b9,0x13a));var _0x9a6b=function(_0x2b4725,_0x6e1285){_0x2b4725=_0x2b4725-0x0;var _0x18e2aa=_0xa6b9[_0x2b4725];return _0x18e2aa;};'use strict';var util=require(_0x9a6b('0x0'));var logger=require('../../../../config/logger')(_0x9a6b('0x1'));var BPromise=require(_0x9a6b('0x2'));var exec=require(_0x9a6b('0x3'))[_0x9a6b('0x4')];exports[_0x9a6b('0x5')]=function(_0x3f97b2){return new BPromise(function(_0x2e09fe,_0x3037ac){exec(_0x3f97b2,function(_0x3c988d,_0x1b7f09,_0x591866){logger[_0x9a6b('0x6')](_0x9a6b('0x7'),_0x1b7f09);if(_0x3c988d){logger[_0x9a6b('0x6')](_0x9a6b('0x7'),'\x20Error\x20:',util[_0x9a6b('0x8')](_0x3c988d,{'showHidden':![],'depth':null}),_0x1b7f09,_0x591866);_0x3037ac(_0x3c988d);}_0x2e09fe(_0x1b7f09);});});}; \ No newline at end of file +var _0x728f=['bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger'];(function(_0x54304d,_0x5253bc){var _0x376c9c=function(_0x3960b7){while(--_0x3960b7){_0x54304d['push'](_0x54304d['shift']());}};_0x376c9c(++_0x5253bc);}(_0x728f,0x76));var _0xf728=function(_0x279f18,_0x1bd627){_0x279f18=_0x279f18-0x0;var _0x51a5ad=_0x728f[_0x279f18];return _0x51a5ad;};'use strict';var util=require(_0xf728('0x0'));var logger=require(_0xf728('0x1'))('fax');var BPromise=require(_0xf728('0x2'));var exec=require(_0xf728('0x3'))[_0xf728('0x4')];exports[_0xf728('0x5')]=function(_0x40d53d){return new BPromise(function(_0x4e6700,_0x43063c){exec(_0x40d53d,function(_0x13e47a,_0x420315,_0x3a87cb){logger[_0xf728('0x6')](_0xf728('0x7'),_0x420315);if(_0x13e47a){logger[_0xf728('0x6')](_0xf728('0x7'),_0xf728('0x8'),util[_0xf728('0x9')](_0x13e47a,{'showHidden':![],'depth':null}),_0x420315,_0x3a87cb);_0x43063c(_0x13e47a);}_0x4e6700(_0x420315);});});}; \ 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 2a8c7c5..55d6692 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 _0xa1f6=['t38timeout','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','localstationid','uniqueid','util','lodash','../../../../config/logger','fax','message','info','addVariables','ecm','minrate','maxrate','\x22%s\x22','modem','faxdetect'];(function(_0x3da7ab,_0x2e00dc){var _0x4819ed=function(_0x484ce3){while(--_0x484ce3){_0x3da7ab['push'](_0x3da7ab['shift']());}};_0x4819ed(++_0x2e00dc);}(_0xa1f6,0x1d3));var _0x6a1f=function(_0x404957,_0x5192a4){_0x404957=_0x404957-0x0;var _0x4e0365=_0xa1f6[_0x404957];return _0x4e0365;};'use strict';var util=require(_0x6a1f('0x0'));var _=require(_0x6a1f('0x1'));var moment=require('moment');var logger=require(_0x6a1f('0x2'))(_0x6a1f('0x3'));exports[_0x6a1f('0x4')]=function(_0xd5f0a2){return{'message':_0xd5f0a2};};exports['logger']=function(_0x301f52,_0x3abafe){logger[_0x6a1f('0x5')](_0x301f52,util['inspect'](_0x3abafe,{'showHidden':![],'depth':null}));};exports[_0x6a1f('0x6')]=function(_0x15cb89,_0x71ffac){var _0x4a976c={'XMF-ECM':_0x71ffac[_0x6a1f('0x7')],'XMF-HEADERINFO':_0x71ffac['headerinfo'],'XMF-MINRATE':_0x71ffac[_0x6a1f('0x8')],'XMF-MAXRATE':_0x71ffac[_0x6a1f('0x9')],'XMF-MODEM':util['format'](_0x6a1f('0xa'),_0x71ffac[_0x6a1f('0xb')]),'XMF-GATEWAY':_0x71ffac['gateway'],'XMF-FAXDETECT':_0x71ffac[_0x6a1f('0xc')],'XMF-T38TIMEOUT':_0x71ffac[_0x6a1f('0xd')],'XMF-LOCALSTATIONID':_0x71ffac['localstationid'],'XMF-PATH':_0x15cb89[_0x6a1f('0xe')]};return _0x4a976c;};exports[_0x6a1f('0xf')]=function(_0x544b20,_0x555458){return{'actionid':_0x544b20['uniqueid'],'action':_0x6a1f('0x10'),'channel':_0x544b20[_0x6a1f('0x11')],'Exten':_0x6a1f('0x12'),'Context':_0x6a1f('0x13'),'Priority':'1','callerid':util[_0x6a1f('0x14')](_0x6a1f('0x15'),_0x544b20['headerinfo']?_0x544b20['headerinfo']:'',_0x544b20[_0x6a1f('0x16')]),'variable':_0x555458,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x544b20[_0x6a1f('0x17')]};}; \ No newline at end of file +var _0x1d77=['lodash','moment','../../../../config/logger','fax','message','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','gateway','faxdetect','localstationid','path','from-sip','util'];(function(_0x294f39,_0x829176){var _0x4040f7=function(_0x11d6c1){while(--_0x11d6c1){_0x294f39['push'](_0x294f39['shift']());}};_0x4040f7(++_0x829176);}(_0x1d77,0x97));var _0x71d7=function(_0x343e44,_0x519af9){_0x343e44=_0x343e44-0x0;var _0xa5130e=_0x1d77[_0x343e44];return _0xa5130e;};'use strict';var util=require(_0x71d7('0x0'));var _=require(_0x71d7('0x1'));var moment=require(_0x71d7('0x2'));var logger=require(_0x71d7('0x3'))(_0x71d7('0x4'));exports[_0x71d7('0x5')]=function(_0x53ee32){return{'message':_0x53ee32};};exports['logger']=function(_0x4d36f8,_0x35397c){logger['info'](_0x4d36f8,util[_0x71d7('0x6')](_0x35397c,{'showHidden':![],'depth':null}));};exports[_0x71d7('0x7')]=function(_0xe6d62,_0x895a31){var _0x3b3468={'XMF-ECM':_0x895a31[_0x71d7('0x8')],'XMF-HEADERINFO':_0x895a31[_0x71d7('0x9')],'XMF-MINRATE':_0x895a31[_0x71d7('0xa')],'XMF-MAXRATE':_0x895a31[_0x71d7('0xb')],'XMF-MODEM':util[_0x71d7('0xc')]('\x22%s\x22',_0x895a31[_0x71d7('0xd')]),'XMF-GATEWAY':_0x895a31[_0x71d7('0xe')],'XMF-FAXDETECT':_0x895a31[_0x71d7('0xf')],'XMF-T38TIMEOUT':_0x895a31['t38timeout'],'XMF-LOCALSTATIONID':_0x895a31[_0x71d7('0x10')],'XMF-PATH':_0xe6d62[_0x71d7('0x11')]};return _0x3b3468;};exports['variablesAction']=function(_0xa3cca1,_0x2a0e98){return{'actionid':_0xa3cca1['uniqueid'],'action':'originate','channel':_0xa3cca1['channel'],'Exten':'xcally-motion-fax','Context':_0x71d7('0x12'),'Priority':'1','callerid':util[_0x71d7('0xc')]('\x22%s\x22\x20<%s>',_0xa3cca1['headerinfo']?_0xa3cca1[_0x71d7('0x9')]:'',_0xa3cca1[_0x71d7('0x10')]),'variable':_0x2a0e98,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xa3cca1['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index e3ff41a..b5b73f0 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 _0xe7d2=['getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getDeskAccounts','initDeskAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','moment','./server','./realtime','./acw','./dialer','./preview','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0xe7d2,0x141));var _0x2e7d=function(_0x13530a,_0x44630c){_0x13530a=_0x13530a-0x0;var _0x587e70=_0xe7d2[_0x13530a];return _0x587e70;};'use strict';var BPromise=require(_0x2e7d('0x0'));var util=require('util');var moment=require(_0x2e7d('0x1'));var server=require(_0x2e7d('0x2'));var Realtime=require(_0x2e7d('0x3'));var Report=require('./report');var Acw=require(_0x2e7d('0x4'));var Trigger=require('./trigger');var Dialer=require(_0x2e7d('0x5'));var Preview=require(_0x2e7d('0x6'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0x2e7d('0x7'));var voiceQueueReport=require(_0x2e7d('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x2e7d('0x9'));var trigger=require(_0x2e7d('0xa'));var template=require(_0x2e7d('0xb'));var cmHopperHistory=require(_0x2e7d('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x2e7d('0xd'));var faxAccount=require(_0x2e7d('0xe'));var zendesk=require(_0x2e7d('0xf'));var salesforce=require(_0x2e7d('0x10'));var sugarcrm=require(_0x2e7d('0x11'));var freshdesk=require(_0x2e7d('0x12'));var desk=require(_0x2e7d('0x13'));var zoho=require(_0x2e7d('0x14'));var vtiger=require(_0x2e7d('0x15'));var freshsales=require(_0x2e7d('0x16'));var servicenow=require(_0x2e7d('0x17'));var dynamics365=require(_0x2e7d('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x2e7d('0x19'))(_0x2e7d('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x2e7d('0x1b')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x2e7d('0x1b')](_0x2e7d('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x2e7d('0x1d')]()[_0x2e7d('0x1e')](user[_0x2e7d('0x1f')]())['then'](realtime[_0x2e7d('0x20')]())[_0x2e7d('0x1e')](user[_0x2e7d('0x21')]())[_0x2e7d('0x1e')](realtime[_0x2e7d('0x22')]())[_0x2e7d('0x1e')](trunk[_0x2e7d('0x23')]())[_0x2e7d('0x1e')](realtime[_0x2e7d('0x24')]())['then'](voiceQueue[_0x2e7d('0x25')]())[_0x2e7d('0x1e')](realtime[_0x2e7d('0x26')]())['then'](trigger[_0x2e7d('0x27')]())[_0x2e7d('0x1e')](realtime[_0x2e7d('0x28')]())[_0x2e7d('0x1e')](template['getTemplates']())[_0x2e7d('0x1e')](realtime[_0x2e7d('0x29')]())[_0x2e7d('0x1e')](zendesk[_0x2e7d('0x2a')]())[_0x2e7d('0x1e')](realtime[_0x2e7d('0x2b')]())[_0x2e7d('0x1e')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x2e7d('0x2c')]())[_0x2e7d('0x1e')](sugarcrm[_0x2e7d('0x2d')]())[_0x2e7d('0x1e')](realtime[_0x2e7d('0x2e')]())[_0x2e7d('0x1e')](freshdesk['getFreshdeskAccounts']())[_0x2e7d('0x1e')](realtime['initFreshdeskAccounts']())['then'](desk[_0x2e7d('0x2f')]())[_0x2e7d('0x1e')](realtime[_0x2e7d('0x30')]())[_0x2e7d('0x1e')](zoho['getZohoAccounts']())['then'](realtime['initZohoAccounts']())['then'](vtiger[_0x2e7d('0x31')]())[_0x2e7d('0x1e')](realtime[_0x2e7d('0x32')]())[_0x2e7d('0x1e')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x2e7d('0x33')]())[_0x2e7d('0x1e')](servicenow[_0x2e7d('0x34')]())['then'](realtime[_0x2e7d('0x35')]())[_0x2e7d('0x1e')](dynamics365['getDynamics365Accounts']())[_0x2e7d('0x1e')](realtime[_0x2e7d('0x36')]())[_0x2e7d('0x1e')](campaign[_0x2e7d('0x37')]())[_0x2e7d('0x1e')](realtime[_0x2e7d('0x38')]())[_0x2e7d('0x1e')](voiceExtension['getVoiceExtensions']())[_0x2e7d('0x1e')](realtime[_0x2e7d('0x39')]())[_0x2e7d('0x1e')](faxAccount['getFaxAccounts']())[_0x2e7d('0x1e')](realtime[_0x2e7d('0x3a')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x2e7d('0x1d')]()[_0x2e7d('0x1e')](voiceQueueReport[_0x2e7d('0x3b')]())['then'](realtime[_0x2e7d('0x3c')]())[_0x2e7d('0x1e')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0x2e7d('0x3d')]())[_0x2e7d('0x1e')](cmHopperHistory[_0x2e7d('0x3e')]())[_0x2e7d('0x1e')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0x2e7d('0x3f')]())['then'](realtime[_0x2e7d('0x40')]())[_0x2e7d('0x41')](function(_0x24b381){logger[_0x2e7d('0x42')](_0x2e7d('0x43'),util[_0x2e7d('0x44')](_0x24b381,{'showHidden':![],'depth':null}));});}function main(){return server[_0x2e7d('0x45')](realtime,preview,fax)['then'](function(_0x3bda5a){return initRealtime();})[_0x2e7d('0x1e')](function(){return initParams();})[_0x2e7d('0x1e')](function(){report[_0x2e7d('0x46')]();setInterval(initRealtime,0x1388);})[_0x2e7d('0x41')](function(_0xf7901d){logger[_0x2e7d('0x42')](_0x2e7d('0x47'),util[_0x2e7d('0x44')](_0xf7901d,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xb678=['./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','util','moment','./trigger','./dialer','./preview','./fax'];(function(_0x160e21,_0x2d1a53){var _0x5228fe=function(_0x3675d6){while(--_0x3675d6){_0x160e21['push'](_0x160e21['shift']());}};_0x5228fe(++_0x2d1a53);}(_0xb678,0xd4));var _0x8b67=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xb678[_0x36ed3c];return _0x52a2e0;};'use strict';var BPromise=require(_0x8b67('0x0'));var util=require(_0x8b67('0x1'));var moment=require(_0x8b67('0x2'));var server=require('./server');var Realtime=require('./realtime');var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x8b67('0x3'));var Dialer=require(_0x8b67('0x4'));var Preview=require(_0x8b67('0x5'));var Fax=require(_0x8b67('0x6'));var user=require(_0x8b67('0x7'));var voiceQueue=require(_0x8b67('0x8'));var voiceQueueReport=require(_0x8b67('0x9'));var voiceCallReport=require(_0x8b67('0xa'));var trunk=require(_0x8b67('0xb'));var trigger=require(_0x8b67('0xc'));var template=require(_0x8b67('0xd'));var cmHopperHistory=require(_0x8b67('0xe'));var campaign=require(_0x8b67('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x8b67('0x10'));var zendesk=require(_0x8b67('0x11'));var salesforce=require(_0x8b67('0x12'));var sugarcrm=require(_0x8b67('0x13'));var freshdesk=require(_0x8b67('0x14'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x8b67('0x15'));var vtiger=require(_0x8b67('0x16'));var freshsales=require(_0x8b67('0x17'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x8b67('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8b67('0x19')](_0x8b67('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8b67('0x19')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x8b67('0x1b')]()[_0x8b67('0x1c')](user[_0x8b67('0x1d')]())[_0x8b67('0x1c')](realtime[_0x8b67('0x1e')]())[_0x8b67('0x1c')](user[_0x8b67('0x1f')]())[_0x8b67('0x1c')](realtime[_0x8b67('0x20')]())[_0x8b67('0x1c')](trunk['getTrunks']())[_0x8b67('0x1c')](realtime[_0x8b67('0x21')]())[_0x8b67('0x1c')](voiceQueue[_0x8b67('0x22')]())[_0x8b67('0x1c')](realtime[_0x8b67('0x23')]())[_0x8b67('0x1c')](trigger[_0x8b67('0x24')]())[_0x8b67('0x1c')](realtime[_0x8b67('0x25')]())[_0x8b67('0x1c')](template[_0x8b67('0x26')]())[_0x8b67('0x1c')](realtime['initTemplates']())[_0x8b67('0x1c')](zendesk[_0x8b67('0x27')]())[_0x8b67('0x1c')](realtime['initZendeskAccounts']())[_0x8b67('0x1c')](salesforce[_0x8b67('0x28')]())[_0x8b67('0x1c')](realtime['initSalesforceAccounts']())[_0x8b67('0x1c')](sugarcrm[_0x8b67('0x29')]())[_0x8b67('0x1c')](realtime[_0x8b67('0x2a')]())['then'](freshdesk[_0x8b67('0x2b')]())[_0x8b67('0x1c')](realtime[_0x8b67('0x2c')]())[_0x8b67('0x1c')](desk['getDeskAccounts']())['then'](realtime['initDeskAccounts']())[_0x8b67('0x1c')](zoho['getZohoAccounts']())['then'](realtime[_0x8b67('0x2d')]())['then'](vtiger[_0x8b67('0x2e')]())[_0x8b67('0x1c')](realtime[_0x8b67('0x2f')]())[_0x8b67('0x1c')](freshsales[_0x8b67('0x30')]())[_0x8b67('0x1c')](realtime[_0x8b67('0x31')]())[_0x8b67('0x1c')](servicenow[_0x8b67('0x32')]())[_0x8b67('0x1c')](realtime[_0x8b67('0x33')]())[_0x8b67('0x1c')](dynamics365[_0x8b67('0x34')]())[_0x8b67('0x1c')](realtime[_0x8b67('0x35')]())['then'](campaign['getCampaigns']())[_0x8b67('0x1c')](realtime[_0x8b67('0x36')]())[_0x8b67('0x1c')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0x8b67('0x37')]())[_0x8b67('0x1c')](faxAccount[_0x8b67('0x38')]())[_0x8b67('0x1c')](realtime[_0x8b67('0x39')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x8b67('0x1b')]()[_0x8b67('0x1c')](voiceQueueReport[_0x8b67('0x3a')]())['then'](realtime[_0x8b67('0x3b')]())[_0x8b67('0x1c')](cmHopperHistory[_0x8b67('0x3c')]())[_0x8b67('0x1c')](realtime[_0x8b67('0x3d')]())[_0x8b67('0x1c')](cmHopperHistory[_0x8b67('0x3e')]())[_0x8b67('0x1c')](realtime[_0x8b67('0x3f')]())[_0x8b67('0x1c')](voiceCallReport[_0x8b67('0x40')]())[_0x8b67('0x1c')](realtime[_0x8b67('0x41')]())[_0x8b67('0x42')](function(_0x3673b7){logger[_0x8b67('0x43')](_0x8b67('0x44'),util[_0x8b67('0x45')](_0x3673b7,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8b67('0x46')](realtime,preview,fax)[_0x8b67('0x1c')](function(_0x469d25){return initRealtime();})[_0x8b67('0x1c')](function(){return initParams();})['then'](function(){report[_0x8b67('0x47')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x3536cc){logger[_0x8b67('0x43')](_0x8b67('0x48'),util[_0x8b67('0x45')](_0x3536cc,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 48c66ad..78f3109 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x22d6e4,_0x5efddd){var _0x3838b9=function(_0x37d0a4){while(--_0x37d0a4){_0x22d6e4['push'](_0x22d6e4['shift']());}};_0x3838b9(++_0x5efddd);}(_0x70e0,0x17b));var _0x070e=function(_0x24a533,_0xbd0f46){_0x24a533=_0x24a533-0x0;var _0x136fe0=_0x70e0[_0x24a533];return _0x136fe0;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xedd9,0xfc));var _0x9edd=function(_0x12a759,_0x6cd641){_0x12a759=_0x12a759-0x0;var _0x4bf5cc=_0xedd9[_0x12a759];return _0x4bf5cc;};'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 6bdf41a..ad589e7 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 _0x2d69=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x2d69,0x1a8));var _0x92d6=function(_0x46030a,_0x5ba40d){_0x46030a=_0x46030a-0x0;var _0x2f6ae5=_0x2d69[_0x46030a];return _0x2f6ae5;};'use strict';function Campaign(_0x56c2fe){this['id']=_0x56c2fe['id']||0x0;this[_0x92d6('0x0')]=_0x56c2fe['name']||'';this[_0x92d6('0x1')]=_0x56c2fe['type']||'campaign';this[_0x92d6('0x2')]=0x0;this['temp']=0x0;this[_0x92d6('0x3')]=0x0;this[_0x92d6('0x4')]=0x0;this[_0x92d6('0x5')]='';this[_0x92d6('0x6')]=!![];this[_0x92d6('0x7')]=_0x56c2fe[_0x92d6('0x7')];this[_0x92d6('0x8')]=_0x56c2fe[_0x92d6('0x8')];this[_0x92d6('0x9')]=_0x56c2fe['dialTimezone']||null;this[_0x92d6('0xa')]=_0x56c2fe[_0x92d6('0xa')]?_0x56c2fe[_0x92d6('0xa')]:null;this['dialOriginateCallerIdName']=_0x56c2fe[_0x92d6('0xb')];this[_0x92d6('0xc')]=_0x56c2fe[_0x92d6('0xc')];this['dialOriginateTimeout']=_0x56c2fe[_0x92d6('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x56c2fe[_0x92d6('0xe')];this[_0x92d6('0xf')]=_0x56c2fe[_0x92d6('0xf')];this[_0x92d6('0x10')]=_0x56c2fe[_0x92d6('0x10')];this[_0x92d6('0x11')]=_0x56c2fe[_0x92d6('0x11')];this[_0x92d6('0x12')]=_0x56c2fe['dialNoAnswerMaxRetry'];this[_0x92d6('0x13')]=_0x56c2fe[_0x92d6('0x13')];this[_0x92d6('0x14')]=_0x56c2fe[_0x92d6('0x14')];this[_0x92d6('0x15')]=_0x56c2fe['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x56c2fe[_0x92d6('0x16')]||0x96;this[_0x92d6('0x17')]=_0x56c2fe[_0x92d6('0x17')]||0x3;this[_0x92d6('0x18')]=_0x56c2fe[_0x92d6('0x18')]||0x96;this[_0x92d6('0x19')]=_0x56c2fe[_0x92d6('0x19')]||0x3;this[_0x92d6('0x1a')]=_0x56c2fe[_0x92d6('0x1a')]||0x96;this[_0x92d6('0x1b')]=_0x56c2fe[_0x92d6('0x1b')]||0x3;this[_0x92d6('0x1c')]=_0x56c2fe['dialMachineRetryFrequency']||0x96;this[_0x92d6('0x1d')]=_0x56c2fe[_0x92d6('0x1d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x56c2fe[_0x92d6('0x1e')]||0x96;this['dialOrderByScheduledAt']=_0x56c2fe[_0x92d6('0x1f')]||_0x92d6('0x20');this[_0x92d6('0x21')]=_0x56c2fe[_0x92d6('0x21')]||undefined;this[_0x92d6('0x22')]=_0x56c2fe['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x56c2fe[_0x92d6('0x23')]||undefined;this['TrunkBackup']=_0x56c2fe[_0x92d6('0x24')]?_0x56c2fe[_0x92d6('0x24')]:undefined;this[_0x92d6('0x25')]=_0x56c2fe['Trunk']?_0x56c2fe[_0x92d6('0x25')]:undefined;this['Interval']=_0x56c2fe[_0x92d6('0x26')]?_0x56c2fe[_0x92d6('0x26')]:undefined;this[_0x92d6('0x27')]=_0x56c2fe[_0x92d6('0x27')]?_0x56c2fe[_0x92d6('0x27')]:undefined;this[_0x92d6('0x28')]=_0x56c2fe[_0x92d6('0x27')]?_0x56c2fe['SquareProject'][_0x92d6('0x0')]:undefined;this[_0x92d6('0x29')]=_0x56c2fe[_0x92d6('0x29')]||![];this['dialAMDInitialSilence']=_0x56c2fe[_0x92d6('0x2a')];this[_0x92d6('0x2b')]=_0x56c2fe['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x56c2fe[_0x92d6('0x2c')];this['dialAMDTotalAnalysisTime']=_0x56c2fe[_0x92d6('0x2d')];this[_0x92d6('0x2e')]=_0x56c2fe[_0x92d6('0x2e')];this[_0x92d6('0x2f')]=_0x56c2fe[_0x92d6('0x2f')];this['dialAMDMaximumNumberOfWords']=_0x56c2fe['dialAMDMaximumNumberOfWords'];this[_0x92d6('0x30')]=_0x56c2fe['dialAMDSilenceThreshold'];this[_0x92d6('0x31')]=_0x56c2fe[_0x92d6('0x31')];}module['exports']=Campaign; \ No newline at end of file +var _0x526d=['dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x526d,0x93));var _0xd526=function(_0x928174,_0x27b2e2){_0x928174=_0x928174-0x0;var _0x50c908=_0x526d[_0x928174];return _0x50c908;};'use strict';function Campaign(_0x595970){this['id']=_0x595970['id']||0x0;this['name']=_0x595970[_0xd526('0x0')]||'';this[_0xd526('0x1')]=_0x595970[_0xd526('0x1')]||'campaign';this['originated']=0x0;this['temp']=0x0;this[_0xd526('0x2')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xd526('0x3')]='';this[_0xd526('0x4')]=!![];this[_0xd526('0x5')]=_0x595970[_0xd526('0x5')];this[_0xd526('0x6')]=_0x595970[_0xd526('0x6')];this[_0xd526('0x7')]=_0x595970['dialTimezone']||null;this[_0xd526('0x8')]=_0x595970[_0xd526('0x8')]?_0x595970['dialGlobalInterval']:null;this[_0xd526('0x9')]=_0x595970[_0xd526('0x9')];this[_0xd526('0xa')]=_0x595970['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x595970['dialOriginateTimeout']||0x1e;this[_0xd526('0xb')]=_0x595970[_0xd526('0xb')];this[_0xd526('0xc')]=_0x595970[_0xd526('0xc')];this[_0xd526('0xd')]=_0x595970[_0xd526('0xd')];this[_0xd526('0xe')]=_0x595970[_0xd526('0xe')];this[_0xd526('0xf')]=_0x595970[_0xd526('0xf')];this[_0xd526('0x10')]=_0x595970['dialNoAnswerRetryFrequency'];this[_0xd526('0x11')]=_0x595970[_0xd526('0x11')];this['dialNoSuchNumberMaxRetry']=_0x595970['dialNoSuchNumberMaxRetry']||0x3;this[_0xd526('0x12')]=_0x595970[_0xd526('0x12')]||0x96;this[_0xd526('0x13')]=_0x595970[_0xd526('0x13')]||0x3;this[_0xd526('0x14')]=_0x595970[_0xd526('0x14')]||0x96;this[_0xd526('0x15')]=_0x595970[_0xd526('0x15')]||0x3;this[_0xd526('0x16')]=_0x595970['dialAbandonedRetryFrequency']||0x96;this[_0xd526('0x17')]=_0x595970['dialMachineMaxRetry']||0x3;this[_0xd526('0x18')]=_0x595970[_0xd526('0x18')]||0x96;this['dialAgentRejectMaxRetry']=_0x595970['dialAgentRejectMaxRetry']||0x3;this[_0xd526('0x19')]=_0x595970[_0xd526('0x19')]||0x96;this[_0xd526('0x1a')]=_0x595970[_0xd526('0x1a')]||_0xd526('0x1b');this[_0xd526('0x1c')]=_0x595970[_0xd526('0x1c')]||undefined;this[_0xd526('0x1d')]=_0x595970[_0xd526('0x1d')]||undefined;this['dialCutDigit']=_0x595970[_0xd526('0x1e')]||undefined;this[_0xd526('0x1f')]=_0x595970['TrunkBackup']?_0x595970[_0xd526('0x1f')]:undefined;this[_0xd526('0x20')]=_0x595970[_0xd526('0x20')]?_0x595970[_0xd526('0x20')]:undefined;this[_0xd526('0x21')]=_0x595970['Interval']?_0x595970['Interval']:undefined;this[_0xd526('0x22')]=_0x595970[_0xd526('0x22')]?_0x595970[_0xd526('0x22')]:undefined;this[_0xd526('0x23')]=_0x595970['SquareProject']?_0x595970[_0xd526('0x22')][_0xd526('0x0')]:undefined;this[_0xd526('0x24')]=_0x595970[_0xd526('0x24')]||![];this['dialAMDInitialSilence']=_0x595970[_0xd526('0x25')];this['dialAMDGreeting']=_0x595970[_0xd526('0x26')];this['dialAMDAfterGreetingSilence']=_0x595970[_0xd526('0x27')];this[_0xd526('0x28')]=_0x595970[_0xd526('0x28')];this[_0xd526('0x29')]=_0x595970[_0xd526('0x29')];this['dialAMDBetweenWordsSilence']=_0x595970[_0xd526('0x2a')];this[_0xd526('0x2b')]=_0x595970['dialAMDMaximumNumberOfWords'];this[_0xd526('0x2c')]=_0x595970[_0xd526('0x2c')];this['dialAMDMaximumWordLength']=_0x595970[_0xd526('0x2d')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 66a5197..7d5b320 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 _0x5a1c=['lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','queue','monitors','transferType','exports','starttime','channel','calleridname','connectedlinename','accountcode','context','uniqueid','exten','answered','answertime','unmanaged','abandoned','lastapplication'];(function(_0x127370,_0x8f2171){var _0x3a453d=function(_0x11b33c){while(--_0x11b33c){_0x127370['push'](_0x127370['shift']());}};_0x3a453d(++_0x8f2171);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0xb6e8a1,_0x21a147){_0xb6e8a1=_0xb6e8a1-0x0;var _0x35bc03=_0x5a1c[_0xb6e8a1];return _0x35bc03;};'use strict';function Channel(){this[_0xc5a1('0x0')]=null;this[_0xc5a1('0x1')]='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0xc5a1('0x2')]='';this['connectedlinenum']=undefined;this[_0xc5a1('0x3')]=undefined;this[_0xc5a1('0x4')]=0x0;this[_0xc5a1('0x5')]='';this[_0xc5a1('0x6')]=0x0;this['linkedid']=0x0;this[_0xc5a1('0x7')]=0x0;this[_0xc5a1('0x8')]=![];this[_0xc5a1('0x9')]=null;this['endtime']=null;this[_0xc5a1('0xa')]=![];this[_0xc5a1('0xb')]=![];this[_0xc5a1('0xc')]='';this[_0xc5a1('0xd')]='';this[_0xc5a1('0xe')]=0x0;this[_0xc5a1('0xf')]=0x0;this[_0xc5a1('0x10')]=0x0;this[_0xc5a1('0x11')]=null;this[_0xc5a1('0x12')]=null;this[_0xc5a1('0x13')]=null;this[_0xc5a1('0x14')]=![];this['monitorFilename']=null;this[_0xc5a1('0x15')]=null;this[_0xc5a1('0x16')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0xc5a1('0x17')]=undefined;this['mohtime']=0x0;}module[_0xc5a1('0x18')]=Channel; \ No newline at end of file +var _0xd7a4=['exports','starttime','channel','calleridnum','calleridname','connectedlinenum','accountcode','uniqueid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','holdtime','tag','disposition','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime'];(function(_0x1cf7fd,_0xb7ff6c){var _0x102a5b=function(_0x28462b){while(--_0x28462b){_0x1cf7fd['push'](_0x1cf7fd['shift']());}};_0x102a5b(++_0xb7ff6c);}(_0xd7a4,0x7e));var _0x4d7a=function(_0x31f34c,_0x4449b3){_0x31f34c=_0x31f34c-0x0;var _0x3fd17a=_0xd7a4[_0x31f34c];return _0x3fd17a;};'use strict';function Channel(){this[_0x4d7a('0x0')]=null;this[_0x4d7a('0x1')]='';this['destinationchannel']='';this[_0x4d7a('0x2')]=0x0;this[_0x4d7a('0x3')]='';this[_0x4d7a('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x4d7a('0x5')]=0x0;this['context']='';this[_0x4d7a('0x6')]=0x0;this['linkedid']=0x0;this[_0x4d7a('0x7')]=0x0;this[_0x4d7a('0x8')]=![];this[_0x4d7a('0x9')]=null;this[_0x4d7a('0xa')]=null;this[_0x4d7a('0xb')]=![];this[_0x4d7a('0xc')]=![];this[_0x4d7a('0xd')]='';this[_0x4d7a('0xe')]='';this[_0x4d7a('0xf')]=0x0;this['billableseconds']=0x0;this[_0x4d7a('0x10')]=0x0;this['type']=null;this[_0x4d7a('0x11')]=null;this[_0x4d7a('0x12')]=null;this['monitor']=![];this['monitorFilename']=null;this['queue']=null;this[_0x4d7a('0x13')]=[];this[_0x4d7a('0x14')]=undefined;this[_0x4d7a('0x15')]=undefined;this[_0x4d7a('0x16')]=undefined;this[_0x4d7a('0x17')]=0x0;}module[_0x4d7a('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 553c873..783b421 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 _0x50c4=['type','serverUrl','Configurations','exports','name','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x1ac6ec,_0x1f81fc){var _0x48a489=function(_0xf38b04){while(--_0xf38b04){_0x1ac6ec['push'](_0x1ac6ec['shift']());}};_0x48a489(++_0x1f81fc);}(_0x50c4,0x154));var _0x450c=function(_0x592307,_0x2b8719){_0x592307=_0x592307-0x0;var _0x244eb8=_0x50c4[_0x592307];return _0x244eb8;};'use strict';function DeskAccount(_0x565644){this['id']=_0x565644['id']||0x0;this[_0x450c('0x0')]=_0x565644['name']||'';this['username']=_0x565644['username']||'';this[_0x450c('0x1')]=_0x565644[_0x450c('0x1')]||'';this[_0x450c('0x2')]=_0x565644[_0x450c('0x2')]||'';this['password']=_0x565644[_0x450c('0x3')]||'';this[_0x450c('0x4')]=_0x565644['consumerKey']||'';this[_0x450c('0x5')]=_0x565644[_0x450c('0x5')]||'';this[_0x450c('0x6')]=_0x565644[_0x450c('0x6')]||'';this[_0x450c('0x7')]=_0x565644[_0x450c('0x7')]||'';this[_0x450c('0x8')]=_0x565644[_0x450c('0x8')]||'';this[_0x450c('0x9')]=_0x565644[_0x450c('0x9')]||'';this[_0x450c('0xa')]=_0x565644['Configurations']||{};}module[_0x450c('0xb')]=DeskAccount; \ No newline at end of file +var _0x614f=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x4337e7,_0x4fa5eb){var _0x1928b9=function(_0x305448){while(--_0x305448){_0x4337e7['push'](_0x4337e7['shift']());}};_0x1928b9(++_0x4fa5eb);}(_0x614f,0x75));var _0xf614=function(_0x20b416,_0x1953c0){_0x20b416=_0x20b416-0x0;var _0x27cfef=_0x614f[_0x20b416];return _0x27cfef;};'use strict';function DeskAccount(_0x496b38){this['id']=_0x496b38['id']||0x0;this[_0xf614('0x0')]=_0x496b38[_0xf614('0x0')]||'';this[_0xf614('0x1')]=_0x496b38['username']||'';this[_0xf614('0x2')]=_0x496b38[_0xf614('0x2')]||'';this[_0xf614('0x3')]=_0x496b38[_0xf614('0x3')]||'';this[_0xf614('0x4')]=_0x496b38[_0xf614('0x4')]||'';this['consumerKey']=_0x496b38[_0xf614('0x5')]||'';this[_0xf614('0x6')]=_0x496b38['consumerSecret']||'';this['token']=_0x496b38[_0xf614('0x7')]||'';this[_0xf614('0x8')]=_0x496b38[_0xf614('0x8')]||'';this[_0xf614('0x9')]=_0x496b38['type']||'';this['serverUrl']=_0x496b38[_0xf614('0xa')]||'';this[_0xf614('0xb')]=_0x496b38[_0xf614('0xb')]||{};}module[_0xf614('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 35954ef..15e5a84 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 _0x087b=['Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x2085fd,_0x42942c){var _0xd64f76=function(_0x3e2319){while(--_0x3e2319){_0x2085fd['push'](_0x2085fd['shift']());}};_0xd64f76(++_0x42942c);}(_0x087b,0x11a));var _0xb087=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x087b[_0x39096d];return _0x13da4f;};'use strict';function Dynamics365Account(_0x534915){this['id']=_0x534915['id']||0x0;this[_0xb087('0x0')]=_0x534915['name']||'';this['username']=_0x534915[_0xb087('0x1')]||'';this['password']=_0x534915[_0xb087('0x2')]||'';this[_0xb087('0x3')]=_0x534915[_0xb087('0x3')]||'';this[_0xb087('0x4')]=_0x534915[_0xb087('0x4')]||'';this[_0xb087('0x5')]=_0x534915[_0xb087('0x5')]||'';this[_0xb087('0x6')]=_0x534915[_0xb087('0x6')]||{};this[_0xb087('0x7')]=_0x534915[_0xb087('0x7')]||'';this[_0xb087('0x8')]=_0x534915[_0xb087('0x8')]||{};}module[_0xb087('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x2dae=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x21d6fa,_0x5e623a){var _0x405b62=function(_0x54f24a){while(--_0x54f24a){_0x21d6fa['push'](_0x21d6fa['shift']());}};_0x405b62(++_0x5e623a);}(_0x2dae,0xc3));var _0xe2da=function(_0x59dccc,_0x184c1c){_0x59dccc=_0x59dccc-0x0;var _0xc97bcb=_0x2dae[_0x59dccc];return _0xc97bcb;};'use strict';function Dynamics365Account(_0x463a36){this['id']=_0x463a36['id']||0x0;this['name']=_0x463a36[_0xe2da('0x0')]||'';this[_0xe2da('0x1')]=_0x463a36[_0xe2da('0x1')]||'';this[_0xe2da('0x2')]=_0x463a36[_0xe2da('0x2')]||'';this['remoteUri']=_0x463a36[_0xe2da('0x3')]||'';this[_0xe2da('0x4')]=_0x463a36[_0xe2da('0x4')]||'';this[_0xe2da('0x5')]=_0x463a36['clientId']||'';this[_0xe2da('0x6')]=_0x463a36[_0xe2da('0x6')]||{};this[_0xe2da('0x7')]=_0x463a36[_0xe2da('0x7')]||'';this[_0xe2da('0x8')]=_0x463a36[_0xe2da('0x8')]||{};}module[_0xe2da('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 3d6034b..cdb3b15 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 _0x29c7=['gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','modem','v17,v27,v29'];(function(_0x451a26,_0x36bc0){var _0x3b8d60=function(_0xef0bf9){while(--_0xef0bf9){_0x451a26['push'](_0x451a26['shift']());}};_0x3b8d60(++_0x36bc0);}(_0x29c7,0x68));var _0x729c=function(_0x3553f8,_0x346d21){_0x3553f8=_0x3553f8-0x0;var _0x27559f=_0x29c7[_0x3553f8];return _0x27559f;};'use strict';function FaxAccount(_0x2770eb){this['id']=_0x2770eb['id']||0x0;this[_0x729c('0x0')]=_0x2770eb[_0x729c('0x0')]||'';this[_0x729c('0x1')]=_0x2770eb[_0x729c('0x1')];this[_0x729c('0x2')]=_0x2770eb['ecm'];this[_0x729c('0x3')]=_0x2770eb['headerinfo'];this['localstationid']=_0x2770eb[_0x729c('0x4')];this['minrate']=_0x2770eb[_0x729c('0x5')]||0x960;this['maxrate']=_0x2770eb['maxrate']||0x3840;this[_0x729c('0x6')]=_0x2770eb['modem']||_0x729c('0x7');this[_0x729c('0x8')]=_0x2770eb[_0x729c('0x8')]||'no';this[_0x729c('0x9')]=_0x2770eb[_0x729c('0x9')]||'no';this[_0x729c('0xa')]=_0x2770eb[_0x729c('0xa')]||0x1388;this[_0x729c('0xb')]=_0x2770eb[_0x729c('0xb')]||'SIP';this[_0x729c('0xc')]=_0x2770eb['Trunk']?_0x2770eb['Trunk']:undefined;this['ListId']=_0x2770eb[_0x729c('0xd')];this[_0x729c('0xe')]=_0x2770eb[_0x729c('0xe')];}module[_0x729c('0xf')]=FaxAccount; \ No newline at end of file +var _0x5d04=['description','ecm','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name'];(function(_0x275b2b,_0x4b9514){var _0x57aebe=function(_0x14bf04){while(--_0x14bf04){_0x275b2b['push'](_0x275b2b['shift']());}};_0x57aebe(++_0x4b9514);}(_0x5d04,0x1ee));var _0x45d0=function(_0x53ae49,_0x32dc41){_0x53ae49=_0x53ae49-0x0;var _0x34a527=_0x5d04[_0x53ae49];return _0x34a527;};'use strict';function FaxAccount(_0x211296){this['id']=_0x211296['id']||0x0;this[_0x45d0('0x0')]=_0x211296[_0x45d0('0x0')]||'';this[_0x45d0('0x1')]=_0x211296[_0x45d0('0x1')];this[_0x45d0('0x2')]=_0x211296[_0x45d0('0x2')];this['headerinfo']=_0x211296['headerinfo'];this[_0x45d0('0x3')]=_0x211296[_0x45d0('0x3')];this[_0x45d0('0x4')]=_0x211296[_0x45d0('0x4')]||0x960;this[_0x45d0('0x5')]=_0x211296[_0x45d0('0x5')]||0x3840;this[_0x45d0('0x6')]=_0x211296[_0x45d0('0x6')]||'v17,v27,v29';this[_0x45d0('0x7')]=_0x211296[_0x45d0('0x7')]||'no';this[_0x45d0('0x8')]=_0x211296[_0x45d0('0x8')]||'no';this[_0x45d0('0x9')]=_0x211296[_0x45d0('0x9')]||0x1388;this[_0x45d0('0xa')]=_0x211296[_0x45d0('0xa')]||'SIP';this[_0x45d0('0xb')]=_0x211296[_0x45d0('0xb')]?_0x211296[_0x45d0('0xb')]:undefined;this[_0x45d0('0xc')]=_0x211296[_0x45d0('0xc')];this[_0x45d0('0xd')]=_0x211296[_0x45d0('0xd')];}module[_0x45d0('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 91e56ba..5b45ba2 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 _0xb7f4=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x255bcd,_0x2c70e4){var _0x5d7f71=function(_0x5c5233){while(--_0x5c5233){_0x255bcd['push'](_0x255bcd['shift']());}};_0x5d7f71(++_0x2c70e4);}(_0xb7f4,0x1e0));var _0x4b7f=function(_0x1e9b82,_0x2ff5a0){_0x1e9b82=_0x1e9b82-0x0;var _0xd36b6a=_0xb7f4[_0x1e9b82];return _0xd36b6a;};'use strict';function FreshdeskAccount(_0x36c166){this['id']=_0x36c166['id']||0x0;this[_0x4b7f('0x0')]=_0x36c166['name']||'';this[_0x4b7f('0x1')]=_0x36c166[_0x4b7f('0x1')]||'';this[_0x4b7f('0x2')]=_0x36c166[_0x4b7f('0x3')]||'';this[_0x4b7f('0x4')]=_0x36c166[_0x4b7f('0x4')]||'';this[_0x4b7f('0x5')]=_0x36c166[_0x4b7f('0x5')]||'';this[_0x4b7f('0x6')]=_0x36c166[_0x4b7f('0x6')]||{};}module[_0x4b7f('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x2903=['username','apiKey','token','remoteUri','serverUrl','Configurations','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2903,0x84));var _0x3290=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x2903[_0x29d94e];return _0x106237;};'use strict';function FreshdeskAccount(_0x2f5979){this['id']=_0x2f5979['id']||0x0;this[_0x3290('0x0')]=_0x2f5979[_0x3290('0x0')]||'';this[_0x3290('0x1')]=_0x2f5979[_0x3290('0x1')]||'';this[_0x3290('0x2')]=_0x2f5979[_0x3290('0x3')]||'';this[_0x3290('0x4')]=_0x2f5979[_0x3290('0x4')]||'';this['serverUrl']=_0x2f5979[_0x3290('0x5')]||'';this[_0x3290('0x6')]=_0x2f5979[_0x3290('0x6')]||{};}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 00cdf60..1cbdcdc 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 _0xdf70=['exports','name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x4238f1,_0x40e962){var _0x5924ac=function(_0x182763){while(--_0x182763){_0x4238f1['push'](_0x4238f1['shift']());}};_0x5924ac(++_0x40e962);}(_0xdf70,0x86));var _0x0df7=function(_0x563309,_0x3f6df2){_0x563309=_0x563309-0x0;var _0x1de954=_0xdf70[_0x563309];return _0x1de954;};'use strict';function FreshsalesAccount(_0x307718){this['id']=_0x307718['id']||0x0;this[_0x0df7('0x0')]=_0x307718[_0x0df7('0x0')]||'';this['username']=_0x307718[_0x0df7('0x1')]||'';this[_0x0df7('0x2')]=_0x307718['token']||'';this[_0x0df7('0x3')]=_0x307718['remoteUri']||'';this[_0x0df7('0x4')]=_0x307718[_0x0df7('0x4')]||'';this['Configurations']=_0x307718[_0x0df7('0x5')]||{};}module[_0x0df7('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x6f7b=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x6f7b,0x168));var _0xb6f7=function(_0x346533,_0x1fdcbb){_0x346533=_0x346533-0x0;var _0x15dc70=_0x6f7b[_0x346533];return _0x15dc70;};'use strict';function FreshsalesAccount(_0x274516){this['id']=_0x274516['id']||0x0;this[_0xb6f7('0x0')]=_0x274516[_0xb6f7('0x0')]||'';this[_0xb6f7('0x1')]=_0x274516[_0xb6f7('0x1')]||'';this[_0xb6f7('0x2')]=_0x274516[_0xb6f7('0x3')]||'';this[_0xb6f7('0x4')]=_0x274516['remoteUri']||'';this[_0xb6f7('0x5')]=_0x274516['serverUrl']||'';this[_0xb6f7('0x6')]=_0x274516[_0xb6f7('0x6')]||{};}module[_0xb6f7('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 960c6b9..a9e8f46 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 _0x7f71=['queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','priority','holdtime','lastAssignedTo','motionChannel','mohtime','variables','calleridnum','calleridname','queue','queuecallerleaveAt','position','queuecallerabandon','queuecallercomplete'];(function(_0x2a7c2a,_0x37cc9e){var _0x195732=function(_0x4d3902){while(--_0x4d3902){_0x2a7c2a['push'](_0x2a7c2a['shift']());}};_0x195732(++_0x37cc9e);}(_0x7f71,0x149));var _0x17f7=function(_0x36067f,_0xba548e){_0x36067f=_0x36067f-0x0;var _0x44f0b3=_0x7f71[_0x36067f];return _0x44f0b3;};'use strict';function QueueReport(){this['type']='inbound';this['uniqueid']='';this[_0x17f7('0x0')]='';this[_0x17f7('0x1')]='';this[_0x17f7('0x2')]='';this['queuecallerjoinAt']=null;this[_0x17f7('0x3')]=null;this[_0x17f7('0x4')]=0x1;this['count']=0x1;this[_0x17f7('0x5')]=![];this['queuecallerabandonAt']=null;this[_0x17f7('0x6')]=![];this['queuecallercompleteAt']=null;this[_0x17f7('0x7')]=![];this[_0x17f7('0x8')]=null;this[_0x17f7('0x9')]=0x1;this[_0x17f7('0xa')]='';this[_0x17f7('0xb')]='';this[_0x17f7('0xc')]='';this[_0x17f7('0xd')]='';this[_0x17f7('0xe')]='';this['exten']='';this[_0x17f7('0xf')]='';this[_0x17f7('0x10')]=0x0;this['assigned']=![];this[_0x17f7('0x11')]='';this[_0x17f7('0x12')]='voice';this[_0x17f7('0x13')]=0x0;this[_0x17f7('0x14')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x8292=['assigned','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten'];(function(_0x49291d,_0x1d5023){var _0xe56f34=function(_0x296b91){while(--_0x296b91){_0x49291d['push'](_0x49291d['shift']());}};_0xe56f34(++_0x1d5023);}(_0x8292,0x97));var _0x2829=function(_0x57e14f,_0x17f93c){_0x57e14f=_0x57e14f-0x0;var _0x39fce2=_0x8292[_0x57e14f];return _0x39fce2;};'use strict';function QueueReport(){this[_0x2829('0x0')]=_0x2829('0x1');this[_0x2829('0x2')]='';this[_0x2829('0x3')]='';this[_0x2829('0x4')]='';this[_0x2829('0x5')]='';this[_0x2829('0x6')]=null;this[_0x2829('0x7')]=null;this[_0x2829('0x8')]=0x1;this[_0x2829('0x9')]=0x1;this[_0x2829('0xa')]=![];this[_0x2829('0xb')]=null;this[_0x2829('0xc')]=![];this[_0x2829('0xd')]=null;this[_0x2829('0xe')]=![];this[_0x2829('0xf')]=null;this[_0x2829('0x10')]=0x1;this[_0x2829('0x11')]='';this[_0x2829('0x12')]='';this[_0x2829('0x13')]='';this[_0x2829('0x14')]='';this[_0x2829('0x15')]='';this[_0x2829('0x16')]='';this['priority']='';this['holdtime']=0x0;this[_0x2829('0x17')]=![];this['lastAssignedTo']='';this[_0x2829('0x18')]=_0x2829('0x19');this[_0x2829('0x1a')]=0x0;this[_0x2829('0x1b')]={};}module[_0x2829('0x1c')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index aa83e0d..bd86e7e 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 _0x0901=['serverUrl','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x4f22a3,_0x398880){var _0x5048b2=function(_0x44393a){while(--_0x44393a){_0x4f22a3['push'](_0x4f22a3['shift']());}};_0x5048b2(++_0x398880);}(_0x0901,0xb6));var _0x1090=function(_0x3903c8,_0x122cf9){_0x3903c8=_0x3903c8-0x0;var _0x17aa09=_0x0901[_0x3903c8];return _0x17aa09;};'use strict';function SalesforceAccount(_0xc0f89a){this['id']=_0xc0f89a['id']||0x0;this['name']=_0xc0f89a[_0x1090('0x0')]||'';this[_0x1090('0x1')]=_0xc0f89a['username']||'';this['remoteUri']=_0xc0f89a[_0x1090('0x2')]||'';this[_0x1090('0x3')]=_0xc0f89a[_0x1090('0x3')]||'';this[_0x1090('0x4')]=_0xc0f89a[_0x1090('0x4')]||'';this[_0x1090('0x5')]=_0xc0f89a[_0x1090('0x5')]||'';this[_0x1090('0x6')]=_0xc0f89a['securityToken']||'';this[_0x1090('0x7')]=_0xc0f89a[_0x1090('0x7')]||'integrationTab';this[_0x1090('0x8')]=_0xc0f89a[_0x1090('0x8')]||'';this['Configurations']=_0xc0f89a['Configurations']||{};}module[_0x1090('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x3140=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0xa656ef,_0x3d31df){var _0x20e81=function(_0x128119){while(--_0x128119){_0xa656ef['push'](_0xa656ef['shift']());}};_0x20e81(++_0x3d31df);}(_0x3140,0xee));var _0x0314=function(_0x40e1ed,_0x297e89){_0x40e1ed=_0x40e1ed-0x0;var _0x220ddd=_0x3140[_0x40e1ed];return _0x220ddd;};'use strict';function SalesforceAccount(_0x30ccd0){this['id']=_0x30ccd0['id']||0x0;this[_0x0314('0x0')]=_0x30ccd0[_0x0314('0x0')]||'';this['username']=_0x30ccd0[_0x0314('0x1')]||'';this[_0x0314('0x2')]=_0x30ccd0[_0x0314('0x2')]||'';this[_0x0314('0x3')]=_0x30ccd0[_0x0314('0x3')]||'';this[_0x0314('0x4')]=_0x30ccd0[_0x0314('0x4')]||'';this[_0x0314('0x5')]=_0x30ccd0['clientSecret']||'';this[_0x0314('0x6')]=_0x30ccd0[_0x0314('0x6')]||'';this[_0x0314('0x7')]=_0x30ccd0[_0x0314('0x7')]||_0x0314('0x8');this['serverUrl']=_0x30ccd0[_0x0314('0x9')]||'';this['Configurations']=_0x30ccd0[_0x0314('0xa')]||{};}module[_0x0314('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 9bee135..86d7c39 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 _0xf9da=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x2eb2c7,_0x180e56){var _0x49fae4=function(_0x10e0fc){while(--_0x10e0fc){_0x2eb2c7['push'](_0x2eb2c7['shift']());}};_0x49fae4(++_0x180e56);}(_0xf9da,0x78));var _0xaf9d=function(_0x3c252e,_0x550fa5){_0x3c252e=_0x3c252e-0x0;var _0x5fd6f5=_0xf9da[_0x3c252e];return _0x5fd6f5;};'use strict';function ServicenowAccount(_0x461bd3){this['id']=_0x461bd3['id']||0x0;this[_0xaf9d('0x0')]=_0x461bd3[_0xaf9d('0x0')]||'';this[_0xaf9d('0x1')]=_0x461bd3[_0xaf9d('0x1')]||'';this[_0xaf9d('0x2')]=_0x461bd3[_0xaf9d('0x2')]||'';this[_0xaf9d('0x3')]=_0x461bd3['remoteUri']||'';this[_0xaf9d('0x4')]=_0x461bd3[_0xaf9d('0x4')]||'';this[_0xaf9d('0x5')]=_0x461bd3[_0xaf9d('0x5')]||{};}module[_0xaf9d('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x1e22=['exports','name','username','password','serverUrl','Configurations'];(function(_0x47a5a9,_0x20cab0){var _0xe822d9=function(_0x35abbe){while(--_0x35abbe){_0x47a5a9['push'](_0x47a5a9['shift']());}};_0xe822d9(++_0x20cab0);}(_0x1e22,0x1bd));var _0x21e2=function(_0x499ca5,_0x4986cf){_0x499ca5=_0x499ca5-0x0;var _0x7bfd9c=_0x1e22[_0x499ca5];return _0x7bfd9c;};'use strict';function ServicenowAccount(_0x3c5dd4){this['id']=_0x3c5dd4['id']||0x0;this[_0x21e2('0x0')]=_0x3c5dd4[_0x21e2('0x0')]||'';this[_0x21e2('0x1')]=_0x3c5dd4['username']||'';this[_0x21e2('0x2')]=_0x3c5dd4['password']||'';this['remoteUri']=_0x3c5dd4['remoteUri']||'';this[_0x21e2('0x3')]=_0x3c5dd4['serverUrl']||'';this[_0x21e2('0x4')]=_0x3c5dd4[_0x21e2('0x4')]||{};}module[_0x21e2('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 7655f44..9ca70ee 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 _0xceed=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x101cea,_0x2b736f){var _0x3cb3a6=function(_0x30ffd4){while(--_0x30ffd4){_0x101cea['push'](_0x101cea['shift']());}};_0x3cb3a6(++_0x2b736f);}(_0xceed,0xfe));var _0xdcee=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0xceed[_0x35a274];return _0x40d905;};'use strict';function SugarcrmAccount(_0x475a31){this['id']=_0x475a31['id']||0x0;this[_0xdcee('0x0')]=_0x475a31['name']||'';this[_0xdcee('0x1')]=_0x475a31[_0xdcee('0x1')]||'';this[_0xdcee('0x2')]=_0x475a31[_0xdcee('0x2')]||'';this[_0xdcee('0x3')]=_0x475a31['remoteUri']||'';this['serverUrl']=_0x475a31[_0xdcee('0x4')]||'';this[_0xdcee('0x5')]=_0x475a31[_0xdcee('0x5')]||{};}module[_0xdcee('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x4daf=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x4daf,0x14b));var _0xf4da=function(_0x1f933b,_0x18a4db){_0x1f933b=_0x1f933b-0x0;var _0x9c1efd=_0x4daf[_0x1f933b];return _0x9c1efd;};'use strict';function SugarcrmAccount(_0x3cfb50){this['id']=_0x3cfb50['id']||0x0;this['name']=_0x3cfb50[_0xf4da('0x0')]||'';this[_0xf4da('0x1')]=_0x3cfb50[_0xf4da('0x1')]||'';this[_0xf4da('0x2')]=_0x3cfb50['password']||'';this[_0xf4da('0x3')]=_0x3cfb50[_0xf4da('0x3')]||'';this['serverUrl']=_0x3cfb50[_0xf4da('0x4')]||'';this[_0xf4da('0x5')]=_0x3cfb50[_0xf4da('0x5')]||{};}module[_0xf4da('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 4e182c7..ec6cfd3 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 _0x959e=['accountcode','state','unknown','stateTime','status','exports','name'];(function(_0x212616,_0x5e5dcd){var _0x38b35e=function(_0x2e86b8){while(--_0x2e86b8){_0x212616['push'](_0x212616['shift']());}};_0x38b35e(++_0x5e5dcd);}(_0x959e,0x1e2));var _0xe959=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x959e[_0x819464];return _0x49dcc0;};'use strict';function Telephone(_0x12c95d){this['id']=_0x12c95d['id']||0x0;this[_0xe959('0x0')]=_0x12c95d[_0xe959('0x0')]||'';this['accountcode']=_0x12c95d[_0xe959('0x1')]||'';this[_0xe959('0x2')]=_0xe959('0x3');this[_0xe959('0x4')]=0x0;this[_0xe959('0x5')]=_0xe959('0x3');this['address']='';}module[_0xe959('0x6')]=Telephone; \ No newline at end of file +var _0x235a=['unknown','stateTime','status','address','exports','name','accountcode'];(function(_0x3a6e4b,_0x118cd9){var _0x36572d=function(_0x2a53cf){while(--_0x2a53cf){_0x3a6e4b['push'](_0x3a6e4b['shift']());}};_0x36572d(++_0x118cd9);}(_0x235a,0x1ef));var _0xa235=function(_0x410eb6,_0x52d994){_0x410eb6=_0x410eb6-0x0;var _0x1bdc6f=_0x235a[_0x410eb6];return _0x1bdc6f;};'use strict';function Telephone(_0x1f3e74){this['id']=_0x1f3e74['id']||0x0;this[_0xa235('0x0')]=_0x1f3e74[_0xa235('0x0')]||'';this['accountcode']=_0x1f3e74[_0xa235('0x1')]||'';this['state']=_0xa235('0x2');this[_0xa235('0x3')]=0x0;this[_0xa235('0x4')]=_0xa235('0x2');this[_0xa235('0x5')]='';}module[_0xa235('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 3d7c6a0..f4d8574 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x27d247,_0x58d3de){var _0x291ae1=function(_0x51fe33){while(--_0x51fe33){_0x27d247['push'](_0x27d247['shift']());}};_0x291ae1(++_0x58d3de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x35da0c,_0x4572f6){var _0x386247=function(_0x41cf79){while(--_0x41cf79){_0x35da0c['push'](_0x35da0c['shift']());}};_0x386247(++_0x4572f6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 4d8a1dc..6fd8b9f 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1a85,0x178));var _0x51a8=function(_0x380168,_0x40546c){_0x380168=_0x380168-0x0;var _0x12e86d=_0x1a85[_0x380168];return _0x12e86d;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x4b40de,_0x3efe59){var _0x5c9460=function(_0x192494){while(--_0x192494){_0x4b40de['push'](_0x4b40de['shift']());}};_0x5c9460(++_0x3efe59);}(_0xb7e7,0x121));var _0x7b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e7[_0x20a584];return _0x4b41a8;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index de9f7b5..03d2966 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 _0x325c=['registrationtime','defaultuser','exports','active','name','state','unknown','status','registry','indexOf','split','host','port','domain','refresh','stateRegistry'];(function(_0x1486e5,_0x39684f){var _0x29d89b=function(_0x4a0a80){while(--_0x4a0a80){_0x1486e5['push'](_0x1486e5['shift']());}};_0x29d89b(++_0x39684f);}(_0x325c,0x153));var _0xc325=function(_0x175165,_0x20e3ea){_0x175165=_0x175165-0x0;var _0x73a6c1=_0x325c[_0x175165];return _0x73a6c1;};'use strict';function Trunk(_0x19250d){this['id']=_0x19250d['id']||0x0;this[_0xc325('0x0')]=_0x19250d[_0xc325('0x0')]||![];this[_0xc325('0x1')]=_0x19250d[_0xc325('0x1')]||'';this[_0xc325('0x2')]=_0xc325('0x3');this['stateTime']=0x0;this[_0xc325('0x4')]=_0xc325('0x3');this['registry']=_0x19250d[_0xc325('0x5')]&&_0x19250d['registry'][_0xc325('0x6')](':')?_0x19250d['registry'][_0xc325('0x7')](':')[0x0]:'';this[_0xc325('0x8')]='';this[_0xc325('0x9')]='';this[_0xc325('0xa')]='';this['domainport']='';this[_0xc325('0xb')]='';this[_0xc325('0xc')]=_0xc325('0x3');this[_0xc325('0xd')]='';this['address']='';this[_0xc325('0xe')]=_0x19250d[_0xc325('0xe')]||'';}module[_0xc325('0xf')]=Trunk; \ No newline at end of file +var _0xdc8a=['indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xdc8a,0xca));var _0xadc8=function(_0x4106fc,_0x2dbeac){_0x4106fc=_0x4106fc-0x0;var _0x54f44a=_0xdc8a[_0x4106fc];return _0x54f44a;};'use strict';function Trunk(_0x1d86bc){this['id']=_0x1d86bc['id']||0x0;this['active']=_0x1d86bc[_0xadc8('0x0')]||![];this[_0xadc8('0x1')]=_0x1d86bc['name']||'';this[_0xadc8('0x2')]=_0xadc8('0x3');this[_0xadc8('0x4')]=0x0;this[_0xadc8('0x5')]=_0xadc8('0x3');this[_0xadc8('0x6')]=_0x1d86bc[_0xadc8('0x6')]&&_0x1d86bc[_0xadc8('0x6')][_0xadc8('0x7')](':')?_0x1d86bc[_0xadc8('0x6')][_0xadc8('0x8')](':')[0x0]:'';this[_0xadc8('0x9')]='';this[_0xadc8('0xa')]='';this[_0xadc8('0xb')]='';this[_0xadc8('0xc')]='';this[_0xadc8('0xd')]='';this[_0xadc8('0xe')]=_0xadc8('0x3');this[_0xadc8('0xf')]='';this[_0xadc8('0x10')]='';this[_0xadc8('0x11')]=_0x1d86bc[_0xadc8('0x11')]||'';}module[_0xadc8('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 f8532bc..76d0f3d 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 _0x0535=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0535,0xad));var _0x5053=function(_0x5788ed,_0x23ea57){_0x5788ed=_0x5788ed-0x0;var _0x1c6e5c=_0x0535[_0x5788ed];return _0x1c6e5c;};'use strict';function voiceExtension(_0x504ec8){this['id']=_0x504ec8['id']||0x0;this['exten']=_0x504ec8[_0x5053('0x0')]||'';this['recordingFormat']=_0x504ec8[_0x5053('0x1')]||_0x5053('0x2');this[_0x5053('0x3')]=_0x504ec8[_0x5053('0x3')]||![];}module[_0x5053('0x4')]=voiceExtension; \ No newline at end of file +var _0x7726=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x18e1b4,_0x1c6ff4){var _0x315540=function(_0x218eef){while(--_0x218eef){_0x18e1b4['push'](_0x18e1b4['shift']());}};_0x315540(++_0x1c6ff4);}(_0x7726,0x165));var _0x6772=function(_0x5828cc,_0x569e34){_0x5828cc=_0x5828cc-0x0;var _0x2cbaca=_0x7726[_0x5828cc];return _0x2cbaca;};'use strict';function voiceExtension(_0x2f0559){this['id']=_0x2f0559['id']||0x0;this[_0x6772('0x0')]=_0x2f0559[_0x6772('0x0')]||'';this['recordingFormat']=_0x2f0559[_0x6772('0x1')]||_0x6772('0x2');this['mandatoryDisposition']=_0x2f0559[_0x6772('0x3')]||![];}module[_0x6772('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 4a9e66f..e37f8fd 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 _0x36a3=['dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','invalid','unavailable','ringing','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone'];(function(_0x1b0a9c,_0x565fa0){var _0x599134=function(_0x3dc42b){while(--_0x3dc42b){_0x1b0a9c['push'](_0x1b0a9c['shift']());}};_0x599134(++_0x565fa0);}(_0x36a3,0x155));var _0x336a=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0x36a3[_0x543242];return _0x4c99b6;};'use strict';var statusDesc=[_0x336a('0x0'),_0x336a('0x1'),'inuse','busy',_0x336a('0x2'),_0x336a('0x3'),_0x336a('0x4'),'ringinuse',_0x336a('0x5')];var monitorFormat={'wav':_0x336a('0x6'),'wav49':_0x336a('0x7'),'gsm':_0x336a('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x336a('0x9')};function VoiceQueue(_0x1a0278){this['id']=_0x1a0278['id']||0x0;this[_0x336a('0xa')]=_0x1a0278[_0x336a('0xa')]||'';this[_0x336a('0xb')]=_0x1a0278[_0x336a('0xb')]||'';this[_0x336a('0xc')]=_0x1a0278['type']||_0x336a('0xd');this[_0x336a('0xe')]=0x0;this[_0x336a('0xf')]=0x0;this[_0x336a('0x10')]=0x0;this['answered']=0x0;this[_0x336a('0x11')]=0x0;this[_0x336a('0x12')]=0x0;this[_0x336a('0x13')]=0x0;this[_0x336a('0x14')]=0x0;this[_0x336a('0x15')]=0x0;this[_0x336a('0x16')]=0x0;this[_0x336a('0x17')]=0x0;this[_0x336a('0x18')]=_0x1a0278[_0x336a('0x18')]||![];this[_0x336a('0x19')]=_0x1a0278[_0x336a('0x19')]||0xa;this['autopause']=_0x1a0278[_0x336a('0x1a')]||'no';this['sendMessageOneNotActive']=!![];this[_0x336a('0x1b')]='';this[_0x336a('0x1c')]=0x0;this[_0x336a('0x1d')]=0x0;this[_0x336a('0x1e')]=_0x1a0278[_0x336a('0x1e')]||null;this['dialGlobalInterval']=_0x1a0278[_0x336a('0x1f')]?_0x1a0278['dialGlobalInterval']:null;this['dialActive']=_0x1a0278[_0x336a('0x20')];this['dialMethod']=_0x1a0278[_0x336a('0x21')]||'progressive';this[_0x336a('0x22')]=_0x1a0278['dialLimitChannel']||0x0;this[_0x336a('0x23')]=_0x1a0278[_0x336a('0x23')]||0x0;this[_0x336a('0x24')]=_0x1a0278['dialPowerLevel']||0x1;this[_0x336a('0x25')]=_0x1a0278[_0x336a('0x25')]||'dropRate';this[_0x336a('0x26')]=_0x1a0278[_0x336a('0x26')]||0.03;this[_0x336a('0x27')]=_0x1a0278['dialPredictiveInterval']||0x258;this[_0x336a('0x28')]=_0x1a0278[_0x336a('0x28')]||_0x336a('0x29');this[_0x336a('0x2a')]=_0x1a0278[_0x336a('0x2a')]||_0x336a('0x29');this[_0x336a('0x2b')]=_0x1a0278[_0x336a('0x2b')]||0x1e;this['dialQueueOptions']=_0x1a0278[_0x336a('0x2c')]||_0x336a('0x2d');this['dialQueueTimeout']=_0x1a0278[_0x336a('0x2e')]||0x3;this[_0x336a('0x2f')]=_0x1a0278['dialQueueProject']||undefined;this[_0x336a('0x30')]=_0x1a0278[_0x336a('0x30')]||0x3;this[_0x336a('0x31')]=_0x1a0278[_0x336a('0x31')]||0x96;this[_0x336a('0x32')]=_0x1a0278[_0x336a('0x32')]||0x3;this[_0x336a('0x33')]=_0x1a0278[_0x336a('0x33')]||0x96;this[_0x336a('0x34')]=_0x1a0278[_0x336a('0x34')]||0x3;this['dialNoAnswerRetryFrequency']=_0x1a0278[_0x336a('0x35')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x1a0278['dialNoSuchNumberMaxRetry']||0x3;this[_0x336a('0x36')]=_0x1a0278[_0x336a('0x36')]||0x96;this[_0x336a('0x37')]=_0x1a0278[_0x336a('0x37')]||0x3;this[_0x336a('0x38')]=_0x1a0278[_0x336a('0x38')]||0x96;this['dialAbandonedMaxRetry']=_0x1a0278[_0x336a('0x39')]||0x3;this[_0x336a('0x3a')]=_0x1a0278['dialAbandonedRetryFrequency']||0x96;this[_0x336a('0x3b')]=_0x1a0278[_0x336a('0x3b')]||0x3;this[_0x336a('0x3c')]=_0x1a0278[_0x336a('0x3c')]||0x96;this[_0x336a('0x3d')]=_0x1a0278['dialAgentRejectMaxRetry']||0x3;this[_0x336a('0x3e')]=_0x1a0278[_0x336a('0x3e')]||0x96;this[_0x336a('0x3f')]=_0x1a0278[_0x336a('0x3f')]||0x4;this['Trunk']=_0x1a0278[_0x336a('0x40')]?_0x1a0278['Trunk']:undefined;this[_0x336a('0x41')]=_0x1a0278[_0x336a('0x41')]?_0x1a0278[_0x336a('0x41')]:undefined;this[_0x336a('0x42')]=_0x1a0278[_0x336a('0x42')]||undefined;this[_0x336a('0x43')]=_0x1a0278['Interval']?_0x1a0278['Interval']:undefined;this[_0x336a('0x44')]=_0x1a0278['dialOrderByScheduledAt']||_0x336a('0x45');this['dialRandomLastDigitCallerIdNumber']=_0x1a0278[_0x336a('0x46')]||undefined;this[_0x336a('0x47')]=_0x1a0278[_0x336a('0x47')]||undefined;this[_0x336a('0x48')]=strategy[_0x1a0278[_0x336a('0x48')]]||_0x336a('0x49');this[_0x336a('0x4a')]=!![];this[_0x336a('0x4b')]=_0x1a0278['dialAMDActive']||![];this[_0x336a('0x4c')]=_0x1a0278[_0x336a('0x4c')];this['dialAMDGreeting']=_0x1a0278[_0x336a('0x4d')];this[_0x336a('0x4e')]=_0x1a0278[_0x336a('0x4e')];this[_0x336a('0x4f')]=_0x1a0278[_0x336a('0x4f')];this[_0x336a('0x50')]=_0x1a0278[_0x336a('0x50')];this['dialAMDBetweenWordsSilence']=_0x1a0278[_0x336a('0x51')];this[_0x336a('0x52')]=_0x1a0278[_0x336a('0x52')];this['dialAMDSilenceThreshold']=_0x1a0278['dialAMDSilenceThreshold'];this[_0x336a('0x53')]=_0x1a0278['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0x336a('0x54')]=0x0;this[_0x336a('0x55')]=_0x1a0278[_0x336a('0x55')];this[_0x336a('0x56')]=0x0;this[_0x336a('0x57')]=0x0;this[_0x336a('0x58')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x336a('0x59')]=0x0;this[_0x336a('0x5a')]=0x0;this[_0x336a('0x5b')]=0x0;this[_0x336a('0x5c')]=0x0;this[_0x336a('0x5d')]=0x0;this[_0x336a('0x5e')]=0x0;this[_0x336a('0x5f')]=0x0;this[_0x336a('0x60')]=0x0;this['outboundReCallsDay']=0x0;this[_0x336a('0x61')]=0x0;this['startProgressive']=undefined;this[_0x336a('0x62')]=undefined;this[_0x336a('0x63')]=undefined;this[_0x336a('0x64')]=1.05;this[_0x336a('0x65')]=0x0;this[_0x336a('0x66')]=0x0;this[_0x336a('0x67')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x336a('0x68')]=0x0;this[_0x336a('0x69')]=0x0;this[_0x336a('0x6a')]=0x0;this[_0x336a('0x6b')]=0x0;this[_0x336a('0x6c')]=_0x1a0278[_0x336a('0x6d')]||0x14;this['predictiveIntervalMinThreshold']=_0x1a0278[_0x336a('0x6d')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x336a('0x6e')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x336a('0x6f')]=0x0;this[_0x336a('0x70')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x336a('0x71')]=0x0;this[_0x336a('0x72')]=_0x1a0278[_0x336a('0x72')]||0x1e;this[_0x336a('0x73')]=_0x1a0278[_0x336a('0x73')]||![];this['dialPreviewAutoRecallMe']=!!_0x1a0278[_0x336a('0x74')]||![];this[_0x336a('0x75')]=!!_0x1a0278['dialPreviewRecallmeReminder']||![];this[_0x336a('0x76')]=_0x1a0278[_0x336a('0x76')]||undefined;this[_0x336a('0x77')]=_0x1a0278[_0x336a('0x77')]||![];this[_0x336a('0x78')]=_0x1a0278['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x1a0278[_0x336a('0xb')]]?monitorFormat[_0x1a0278[_0x336a('0xb')]]:undefined;this[_0x336a('0x79')]=_0x1a0278[_0x336a('0x79')]||![];this[_0x336a('0x7a')]=_0x1a0278[_0x336a('0x7a')]?_0x1a0278[_0x336a('0x7a')]:undefined;}module[_0x336a('0x7b')]=VoiceQueue; \ No newline at end of file +var _0x5870=['erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','onhold','wav','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls'];(function(_0x5ec09a,_0x35b386){var _0x1f3c39=function(_0xe1b250){while(--_0xe1b250){_0x5ec09a['push'](_0x5ec09a['shift']());}};_0x1f3c39(++_0x35b386);}(_0x5870,0x171));var _0x0587=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x5870[_0x710815];return _0x5b3b89;};'use strict';var statusDesc=[_0x0587('0x0'),_0x0587('0x1'),_0x0587('0x2'),_0x0587('0x3'),_0x0587('0x4'),'unavailable',_0x0587('0x5'),_0x0587('0x6'),_0x0587('0x7')];var monitorFormat={'wav':_0x0587('0x8'),'wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':_0x0587('0x9'),'roundrobin':_0x0587('0xa')};function VoiceQueue(_0x379048){this['id']=_0x379048['id']||0x0;this['name']=_0x379048[_0x0587('0xb')]||'';this[_0x0587('0xc')]=_0x379048[_0x0587('0xc')]||'';this[_0x0587('0xd')]=_0x379048[_0x0587('0xd')]||_0x0587('0xe');this[_0x0587('0xf')]=0x0;this[_0x0587('0x10')]=0x0;this[_0x0587('0x11')]=0x0;this[_0x0587('0x12')]=0x0;this[_0x0587('0x13')]=0x0;this[_0x0587('0x14')]=0x0;this[_0x0587('0x15')]=0x0;this[_0x0587('0x16')]=0x0;this[_0x0587('0x17')]=0x0;this[_0x0587('0x18')]=0x0;this[_0x0587('0x19')]=0x0;this[_0x0587('0x1a')]=_0x379048[_0x0587('0x1a')]||![];this['acwTimeout']=_0x379048[_0x0587('0x1b')]||0xa;this[_0x0587('0x1c')]=_0x379048['autopause']||'no';this[_0x0587('0x1d')]=!![];this['message']='';this[_0x0587('0x1e')]=0x0;this[_0x0587('0x1f')]=0x0;this['dialTimezone']=_0x379048[_0x0587('0x20')]||null;this[_0x0587('0x21')]=_0x379048[_0x0587('0x21')]?_0x379048[_0x0587('0x21')]:null;this[_0x0587('0x22')]=_0x379048[_0x0587('0x22')];this['dialMethod']=_0x379048[_0x0587('0x23')]||_0x0587('0x24');this['dialLimitChannel']=_0x379048[_0x0587('0x25')]||0x0;this[_0x0587('0x26')]=_0x379048[_0x0587('0x26')]||0x0;this['dialPowerLevel']=_0x379048['dialPowerLevel']||0x1;this[_0x0587('0x27')]=_0x379048[_0x0587('0x27')]||_0x0587('0x28');this[_0x0587('0x29')]=_0x379048[_0x0587('0x29')]||0.03;this[_0x0587('0x2a')]=_0x379048[_0x0587('0x2a')]||0x258;this['dialOriginateCallerIdName']=_0x379048[_0x0587('0x2b')]||_0x0587('0x2c');this[_0x0587('0x2d')]=_0x379048['dialOriginateCallerIdNumber']||'anonymous';this[_0x0587('0x2e')]=_0x379048[_0x0587('0x2e')]||0x1e;this[_0x0587('0x2f')]=_0x379048[_0x0587('0x2f')]||_0x0587('0x30');this[_0x0587('0x31')]=_0x379048['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x379048['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x379048[_0x0587('0x32')]||0x3;this[_0x0587('0x33')]=_0x379048[_0x0587('0x33')]||0x96;this[_0x0587('0x34')]=_0x379048[_0x0587('0x34')]||0x3;this[_0x0587('0x35')]=_0x379048['dialBusyRetryFrequency']||0x96;this[_0x0587('0x36')]=_0x379048[_0x0587('0x36')]||0x3;this[_0x0587('0x37')]=_0x379048[_0x0587('0x37')]||0x96;this[_0x0587('0x38')]=_0x379048[_0x0587('0x38')]||0x3;this[_0x0587('0x39')]=_0x379048['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x379048[_0x0587('0x3a')]||0x3;this[_0x0587('0x3b')]=_0x379048[_0x0587('0x3b')]||0x96;this[_0x0587('0x3c')]=_0x379048[_0x0587('0x3c')]||0x3;this[_0x0587('0x3d')]=_0x379048[_0x0587('0x3d')]||0x96;this[_0x0587('0x3e')]=_0x379048['dialMachineMaxRetry']||0x3;this[_0x0587('0x3f')]=_0x379048[_0x0587('0x3f')]||0x96;this[_0x0587('0x40')]=_0x379048[_0x0587('0x40')]||0x3;this['dialAgentRejectRetryFrequency']=_0x379048[_0x0587('0x41')]||0x96;this['dialGlobalMaxRetry']=_0x379048[_0x0587('0x42')]||0x4;this[_0x0587('0x43')]=_0x379048[_0x0587('0x43')]?_0x379048['Trunk']:undefined;this[_0x0587('0x44')]=_0x379048[_0x0587('0x44')]?_0x379048[_0x0587('0x44')]:undefined;this[_0x0587('0x45')]=_0x379048[_0x0587('0x45')]||undefined;this[_0x0587('0x46')]=_0x379048[_0x0587('0x46')]?_0x379048[_0x0587('0x46')]:undefined;this[_0x0587('0x47')]=_0x379048[_0x0587('0x47')]||_0x0587('0x48');this[_0x0587('0x49')]=_0x379048[_0x0587('0x49')]||undefined;this[_0x0587('0x4a')]=_0x379048[_0x0587('0x4a')]||undefined;this['strategy']=strategy[_0x379048[_0x0587('0x4b')]]||_0x0587('0x9');this[_0x0587('0x4c')]=!![];this[_0x0587('0x4d')]=_0x379048[_0x0587('0x4d')]||![];this[_0x0587('0x4e')]=_0x379048[_0x0587('0x4e')];this[_0x0587('0x4f')]=_0x379048[_0x0587('0x4f')];this[_0x0587('0x50')]=_0x379048[_0x0587('0x50')];this[_0x0587('0x51')]=_0x379048['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x379048[_0x0587('0x52')];this[_0x0587('0x53')]=_0x379048[_0x0587('0x53')];this['dialAMDMaximumNumberOfWords']=_0x379048[_0x0587('0x54')];this[_0x0587('0x55')]=_0x379048[_0x0587('0x55')];this[_0x0587('0x56')]=_0x379048['dialAMDMaximumWordLength'];this[_0x0587('0x57')]=0x0;this[_0x0587('0x58')]=0x0;this[_0x0587('0x59')]=_0x379048['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0x0587('0x5a')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x0587('0x5b')]=0x0;this[_0x0587('0x5c')]=0x0;this[_0x0587('0x5d')]=0x0;this[_0x0587('0x5e')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x0587('0x5f')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x0587('0x60')]=0x0;this[_0x0587('0x61')]=0x0;this[_0x0587('0x62')]=0x0;this[_0x0587('0x63')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0x0587('0x64')]=undefined;this[_0x0587('0x65')]=1.05;this[_0x0587('0x66')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x0587('0x67')]=0x0;this[_0x0587('0x68')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x0587('0x69')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x0587('0x6a')]=_0x379048['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x0587('0x6b')]=_0x379048[_0x0587('0x6c')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x0587('0x6d')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x0587('0x6e')]=0x0;this['erlangCallToSecond']=0x0;this[_0x0587('0x6f')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x379048[_0x0587('0x70')]||0x1e;this[_0x0587('0x71')]=_0x379048[_0x0587('0x71')]||![];this[_0x0587('0x72')]=!!_0x379048[_0x0587('0x72')]||![];this['dialPreviewRecallmeReminder']=!!_0x379048['dialPreviewRecallmeReminder']||![];this[_0x0587('0x73')]=_0x379048[_0x0587('0x73')]||undefined;this[_0x0587('0x74')]=_0x379048[_0x0587('0x74')]||![];this[_0x0587('0x75')]=_0x379048[_0x0587('0x75')]||![];this[_0x0587('0xc')]=monitorFormat[_0x379048[_0x0587('0xc')]]?monitorFormat[_0x379048['monitor_format']]:undefined;this['mandatoryDisposition']=_0x379048['mandatoryDisposition']||![];this[_0x0587('0x76')]=_0x379048[_0x0587('0x76')]?_0x379048[_0x0587('0x76')]:undefined;}module[_0x0587('0x77')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 0f611e7..cb9e754 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 _0xda4f=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xda4f,0x16f));var _0xfda4=function(_0x41802d,_0x567734){_0x41802d=_0x41802d-0x0;var _0x57871c=_0xda4f[_0x41802d];return _0x57871c;};'use strict';function VtigerAccount(_0x501b8e){this['id']=_0x501b8e['id']||0x0;this[_0xfda4('0x0')]=_0x501b8e['name']||'';this[_0xfda4('0x1')]=_0x501b8e[_0xfda4('0x1')]||'';this[_0xfda4('0x2')]=_0x501b8e[_0xfda4('0x2')]||'';this[_0xfda4('0x3')]=_0x501b8e[_0xfda4('0x3')]||'';this[_0xfda4('0x4')]=_0x501b8e[_0xfda4('0x4')]||'';this[_0xfda4('0x5')]=_0x501b8e['Configurations']||{};}module[_0xfda4('0x6')]=VtigerAccount; \ No newline at end of file +var _0x8710=['remoteUri','serverUrl','Configurations','name','accessKey'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x8710,0x14d));var _0x0871=function(_0x21fc62,_0x56f39c){_0x21fc62=_0x21fc62-0x0;var _0x286b2d=_0x8710[_0x21fc62];return _0x286b2d;};'use strict';function VtigerAccount(_0x2457f1){this['id']=_0x2457f1['id']||0x0;this[_0x0871('0x0')]=_0x2457f1[_0x0871('0x0')]||'';this['username']=_0x2457f1['username']||'';this['accessKey']=_0x2457f1[_0x0871('0x1')]||'';this[_0x0871('0x2')]=_0x2457f1[_0x0871('0x2')]||'';this[_0x0871('0x3')]=_0x2457f1['serverUrl']||'';this[_0x0871('0x4')]=_0x2457f1[_0x0871('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 7a94466..2e40c6a 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 _0x8450=['integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','type'];(function(_0x27c732,_0xc6e5d2){var _0x1ba2e8=function(_0x4801d7){while(--_0x4801d7){_0x27c732['push'](_0x27c732['shift']());}};_0x1ba2e8(++_0xc6e5d2);}(_0x8450,0x138));var _0x0845=function(_0x3f2aec,_0x573331){_0x3f2aec=_0x3f2aec-0x0;var _0x3400ca=_0x8450[_0x3f2aec];return _0x3400ca;};'use strict';function ZendeskAccount(_0x54c35d){this['id']=_0x54c35d['id']||0x0;this[_0x0845('0x0')]=_0x54c35d[_0x0845('0x0')]||'';this[_0x0845('0x1')]=_0x54c35d[_0x0845('0x1')]||'';this[_0x0845('0x2')]=_0x54c35d[_0x0845('0x2')]||'';this[_0x0845('0x3')]=_0x54c35d[_0x0845('0x3')]||'';this[_0x0845('0x4')]=_0x54c35d[_0x0845('0x4')]||'';this[_0x0845('0x5')]=_0x54c35d['authType']||'';this['type']=_0x54c35d[_0x0845('0x6')]||_0x0845('0x7');this[_0x0845('0x8')]=_0x54c35d[_0x0845('0x8')]||'';this[_0x0845('0x9')]=_0x54c35d[_0x0845('0x9')]||{};}module[_0x0845('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xe50b=['remoteUri','authType','type','serverUrl','Configurations','name','username','password','token'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xe50b,0x16d));var _0xbe50=function(_0x2a7ff8,_0x1876d8){_0x2a7ff8=_0x2a7ff8-0x0;var _0x17449f=_0xe50b[_0x2a7ff8];return _0x17449f;};'use strict';function ZendeskAccount(_0x38b0fd){this['id']=_0x38b0fd['id']||0x0;this[_0xbe50('0x0')]=_0x38b0fd[_0xbe50('0x0')]||'';this[_0xbe50('0x1')]=_0x38b0fd[_0xbe50('0x1')]||'';this[_0xbe50('0x2')]=_0x38b0fd[_0xbe50('0x2')]||'';this[_0xbe50('0x3')]=_0x38b0fd['token']||'';this[_0xbe50('0x4')]=_0x38b0fd[_0xbe50('0x4')]||'';this[_0xbe50('0x5')]=_0x38b0fd[_0xbe50('0x5')]||'';this[_0xbe50('0x6')]=_0x38b0fd[_0xbe50('0x6')]||'integrationTab';this[_0xbe50('0x7')]=_0x38b0fd[_0xbe50('0x7')]||'';this[_0xbe50('0x8')]=_0x38b0fd[_0xbe50('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 8ac717f..497c1f4 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 _0x75cd=['Configurations','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x130c5e,_0x8ab49f){var _0x5d4a47=function(_0x3b974d){while(--_0x3b974d){_0x130c5e['push'](_0x130c5e['shift']());}};_0x5d4a47(++_0x8ab49f);}(_0x75cd,0xc9));var _0xd75c=function(_0x23ce6b,_0x30a5e3){_0x23ce6b=_0x23ce6b-0x0;var _0x50fc40=_0x75cd[_0x23ce6b];return _0x50fc40;};'use strict';function ZohoAccount(_0x31f007){this['id']=_0x31f007['id']||0x0;this[_0xd75c('0x0')]=_0x31f007['name']||'';this['description']=_0x31f007[_0xd75c('0x1')]||'';this[_0xd75c('0x2')]=_0x31f007[_0xd75c('0x2')]||'';this[_0xd75c('0x3')]=_0x31f007[_0xd75c('0x3')]||'';this[_0xd75c('0x4')]=_0x31f007[_0xd75c('0x4')]||'';this[_0xd75c('0x5')]=_0x31f007[_0xd75c('0x5')]||'';this[_0xd75c('0x6')]=_0x31f007[_0xd75c('0x6')]||'';this[_0xd75c('0x7')]=_0x31f007['code']||'';this['refreshToken']=_0x31f007[_0xd75c('0x8')]||'';this[_0xd75c('0x9')]=_0x31f007[_0xd75c('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x3c21=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','zone'];(function(_0x380916,_0x412345){var _0x2d4482=function(_0x78c94f){while(--_0x78c94f){_0x380916['push'](_0x380916['shift']());}};_0x2d4482(++_0x412345);}(_0x3c21,0x10b));var _0x13c2=function(_0x5237f0,_0xf27dd4){_0x5237f0=_0x5237f0-0x0;var _0x20a089=_0x3c21[_0x5237f0];return _0x20a089;};'use strict';function ZohoAccount(_0x596a54){this['id']=_0x596a54['id']||0x0;this[_0x13c2('0x0')]=_0x596a54[_0x13c2('0x0')]||'';this[_0x13c2('0x1')]=_0x596a54[_0x13c2('0x1')]||'';this['host']=_0x596a54['host']||'';this['zone']=_0x596a54[_0x13c2('0x2')]||'';this['clientId']=_0x596a54[_0x13c2('0x3')]||'';this[_0x13c2('0x4')]=_0x596a54[_0x13c2('0x4')]||'';this['serverUrl']=_0x596a54[_0x13c2('0x5')]||'';this[_0x13c2('0x6')]=_0x596a54[_0x13c2('0x6')]||'';this['refreshToken']=_0x596a54[_0x13c2('0x7')]||'';this[_0x13c2('0x8')]=_0x596a54[_0x13c2('0x8')]||{};}module[_0x13c2('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 0e63987..136c490 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 _0x7140=['idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','format','SIP/%s','calleridname','phone','Contact','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','moment','isNil','string','uniqueid'];(function(_0x4446dc,_0x316e68){var _0x4fe0a9=function(_0xb9c0c){while(--_0xb9c0c){_0x4446dc['push'](_0x4446dc['shift']());}};_0x4fe0a9(++_0x316e68);}(_0x7140,0x128));var _0x0714=function(_0x28e2cd,_0x153b42){_0x28e2cd=_0x28e2cd-0x0;var _0x11fd46=_0x7140[_0x28e2cd];return _0x11fd46;};'use strict';var util=require(_0x0714('0x0'));var _=require('lodash');var moment=require(_0x0714('0x1'));function checkNameSurname(_0x27e611,_0x2ea0c5,_0x18431b){var _0x49384c='';if(!_[_0x0714('0x2')](_0x2ea0c5)&&_0x0714('0x3')===typeof _0x2ea0c5){_0x49384c+=_0x2ea0c5;}if(!_['isNil'](_0x18431b)&&_0x0714('0x3')===typeof _0x18431b){_0x49384c+='\x20'+_0x18431b;}if(_0x49384c!==''){return _0x49384c;}return _0x27e611;}function Action(_0x285cc4,_0x48e262,_0x2ec3ea,_0x166dbd,_0x367c7b){this[_0x0714('0x4')]=_0x2ec3ea||undefined;this[_0x0714('0x5')]=_0x285cc4['id'];this[_0x0714('0x6')]=_0x48e262[_0x0714('0x7')];this[_0x0714('0x8')]=_0x48e262[_0x0714('0x8')];this[_0x0714('0x9')]='queue';this[_0x0714('0xa')]=![];this[_0x0714('0xb')]=_[_0x0714('0x2')](_0x285cc4[_0x0714('0xc')])?undefined:_0x285cc4[_0x0714('0xc')][_0x0714('0x7')];this['channelAgent']=this['membername']?util[_0x0714('0xd')](_0x0714('0xe'),this[_0x0714('0xb')]):_0x166dbd||undefined;this[_0x0714('0xf')]=checkNameSurname(_0x285cc4['Contact'][_0x0714('0x10')],_0x285cc4[_0x0714('0x11')]['firstName'],_0x285cc4['Contact']['lastName']);this['active']=_0x285cc4[_0x0714('0x12')]||![];this[_0x0714('0x13')]=_0x285cc4[_0x0714('0x11')][_0x0714('0x10')];this['scheduledat']=_0x285cc4[_0x0714('0x14')];this[_0x0714('0x15')]=_0x285cc4['countbusyretry']||0x0;this['countcongestionretry']=_0x285cc4['countcongestionretry']||0x0;this[_0x0714('0x16')]=_0x285cc4[_0x0714('0x16')]||0x0;this[_0x0714('0x17')]=(_0x285cc4['countbusyretry']||0x0)+(_0x285cc4['countcongestionretry']||0x0)+(_0x285cc4[_0x0714('0x16')]||0x0)+(_0x285cc4[_0x0714('0x18')]||0x0)+(_0x285cc4[_0x0714('0x19')]||0x0)+(_0x285cc4[_0x0714('0x1a')]||0x0)+(_0x285cc4[_0x0714('0x1b')]||0x0)+(_0x285cc4[_0x0714('0x1c')]||0x0);this[_0x0714('0x18')]=_0x285cc4[_0x0714('0x18')]||0x0;this[_0x0714('0x19')]=_0x285cc4[_0x0714('0x19')]||0x0;this[_0x0714('0x1a')]=_0x285cc4[_0x0714('0x1a')]||0x0;this[_0x0714('0x1b')]=_0x285cc4[_0x0714('0x1b')]||0x0;this['countagentrejectretry']=_0x285cc4[_0x0714('0x1c')]||0x0;this[_0x0714('0x1d')]=_0x285cc4['callback'];this[_0x0714('0x1e')]=_0x285cc4[_0x0714('0x1e')];this['callbackat']=_0x285cc4[_0x0714('0x1f')];this[_0x0714('0x20')]=_0x285cc4[_0x0714('0x20')];this[_0x0714('0x21')]=_0x285cc4[_0x0714('0x21')];this[_0x0714('0x22')]=_0x285cc4['ListId'];this[_0x0714('0x23')]=_[_0x0714('0x2')](_0x285cc4[_0x0714('0xc')])?_0x285cc4['UserId']:_0x285cc4[_0x0714('0xc')]['id'];this[_0x0714('0x24')]=_0x285cc4['VoiceQueueId'];this[_0x0714('0x25')]='';this[_0x0714('0x26')]='';}Action[_0x0714('0x27')][_0x0714('0x28')]=function(){return util[_0x0714('0xd')](_0x0714('0x29'),this[_0x0714('0xf')],this['number']);};module[_0x0714('0x2a')]=Action; \ No newline at end of file +var _0x15df=['originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','Agent','channelAgent','SIP/%s','membername','calleridname','Contact','phone','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId'];(function(_0x3b8f2e,_0x5a99a8){var _0x1433d5=function(_0x5e0353){while(--_0x5e0353){_0x3b8f2e['push'](_0x3b8f2e['shift']());}};_0x1433d5(++_0x5a99a8);}(_0x15df,0xf5));var _0xf15d=function(_0xddc74a,_0x4dc8f2){_0xddc74a=_0xddc74a-0x0;var _0x12ae14=_0x15df[_0xddc74a];return _0x12ae14;};'use strict';var util=require(_0xf15d('0x0'));var _=require('lodash');var moment=require(_0xf15d('0x1'));function checkNameSurname(_0x1a8cba,_0x54f72f,_0x132d16){var _0xad0639='';if(!_[_0xf15d('0x2')](_0x54f72f)&&'string'===typeof _0x54f72f){_0xad0639+=_0x54f72f;}if(!_['isNil'](_0x132d16)&&_0xf15d('0x3')===typeof _0x132d16){_0xad0639+='\x20'+_0x132d16;}if(_0xad0639!==''){return _0xad0639;}return _0x1a8cba;}function Action(_0x1a35a5,_0x51b48d,_0x1ba544,_0x2b8d32,_0x1289aa){this[_0xf15d('0x4')]=_0x1ba544||undefined;this[_0xf15d('0x5')]=_0x1a35a5['id'];this[_0xf15d('0x6')]=_0x51b48d['name'];this[_0xf15d('0x7')]=_0x51b48d[_0xf15d('0x7')];this[_0xf15d('0x8')]=_0xf15d('0x6');this[_0xf15d('0x9')]=![];this['membername']=_[_0xf15d('0x2')](_0x1a35a5[_0xf15d('0xa')])?undefined:_0x1a35a5[_0xf15d('0xa')]['name'];this[_0xf15d('0xb')]=this['membername']?util['format'](_0xf15d('0xc'),this[_0xf15d('0xd')]):_0x2b8d32||undefined;this[_0xf15d('0xe')]=checkNameSurname(_0x1a35a5[_0xf15d('0xf')][_0xf15d('0x10')],_0x1a35a5[_0xf15d('0xf')]['firstName'],_0x1a35a5[_0xf15d('0xf')]['lastName']);this[_0xf15d('0x11')]=_0x1a35a5[_0xf15d('0x11')]||![];this[_0xf15d('0x12')]=_0x1a35a5[_0xf15d('0xf')]['phone'];this[_0xf15d('0x13')]=_0x1a35a5['scheduledat'];this[_0xf15d('0x14')]=_0x1a35a5[_0xf15d('0x14')]||0x0;this[_0xf15d('0x15')]=_0x1a35a5[_0xf15d('0x15')]||0x0;this[_0xf15d('0x16')]=_0x1a35a5[_0xf15d('0x16')]||0x0;this['countglobal']=(_0x1a35a5['countbusyretry']||0x0)+(_0x1a35a5[_0xf15d('0x15')]||0x0)+(_0x1a35a5[_0xf15d('0x16')]||0x0)+(_0x1a35a5[_0xf15d('0x17')]||0x0)+(_0x1a35a5[_0xf15d('0x18')]||0x0)+(_0x1a35a5[_0xf15d('0x19')]||0x0)+(_0x1a35a5[_0xf15d('0x1a')]||0x0)+(_0x1a35a5[_0xf15d('0x1b')]||0x0);this['countnosuchnumberretry']=_0x1a35a5['countnosuchnumberretry']||0x0;this[_0xf15d('0x18')]=_0x1a35a5[_0xf15d('0x18')]||0x0;this[_0xf15d('0x19')]=_0x1a35a5['countabandonedretry']||0x0;this[_0xf15d('0x1a')]=_0x1a35a5[_0xf15d('0x1a')]||0x0;this[_0xf15d('0x1b')]=_0x1a35a5[_0xf15d('0x1b')]||0x0;this['callback']=_0x1a35a5[_0xf15d('0x1c')];this['callbackuniqueid']=_0x1a35a5[_0xf15d('0x1d')];this[_0xf15d('0x1e')]=_0x1a35a5['callbackat'];this[_0xf15d('0x1f')]=_0x1a35a5[_0xf15d('0x1f')];this[_0xf15d('0x20')]=_0x1a35a5[_0xf15d('0x20')];this['ListId']=_0x1a35a5['ListId'];this['UserId']=_[_0xf15d('0x2')](_0x1a35a5[_0xf15d('0xa')])?_0x1a35a5[_0xf15d('0x21')]:_0x1a35a5[_0xf15d('0xa')]['id'];this[_0xf15d('0x22')]=_0x1a35a5['VoiceQueueId'];this[_0xf15d('0x23')]='';this[_0xf15d('0x24')]='';}Action['prototype']['getCaller']=function(){return util['format'](_0xf15d('0x25'),this[_0xf15d('0xe')],this[_0xf15d('0x26')]);};module[_0xf15d('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index b324639..ea6865f 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 _0x6737=['Action','status','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','createCustomerFinal','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','responsetime','answertime','dialAnswer','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','talktime','BUSY','outboundBusyCallsDay','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','activeContact','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','Global','[callProgressDetectingCustomer][logNoAnswerGlobal]','CONGESTION','outboundCongestionCallsDay','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','outboundRejectCallsDay','countagentrejectretry','custom:agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','outboundUnknownCallsDay','countmachineretry','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','object','isUndefined','reason','logAgent','createAgentHistory','Busy','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','run','unlock','unlockContact','disableContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialCutDigit','substring','trim','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','syncNewExten','channel','syncOriginateResponse','actionid','logLookAgent','response','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destlinkedid','addVariable','variables','syncVarSet','keys','variable','[syncVarSet][Preview]','inspect','transfertargetlinkedid','exports','lodash','bluebird','moment','md5','ioredis','../../../config/environment','preview','../../../config/logger','../ami','./rpcDb','redis','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','newexten','varset','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','name','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','Interval','stringify','format','voice_queue:save','info','voice_queue_channel:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','loopCampaigns','syncCampaigns','prototype','hasOwnProperty','dialMethod','outbound','clearZombieChannels','type','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','pick','contactId','UserId','ListId'];(function(_0x6c0123,_0x4c8d3b){var _0x5a87d2=function(_0x1ff614){while(--_0x1ff614){_0x6c0123['push'](_0x6c0123['shift']());}};_0x5a87d2(++_0x4c8d3b);}(_0x6737,0xe2));var _0x7673=function(_0x382d54,_0x4a1cc6){_0x382d54=_0x382d54-0x0;var _0x137535=_0x6737[_0x382d54];return _0x137535;};'use strict';var util=require('util');var _=require(_0x7673('0x0'));var BPromise=require(_0x7673('0x1'));var uuid=require('uuid');var moment=require(_0x7673('0x2'));var md5=require(_0x7673('0x3'));var Redis=require(_0x7673('0x4'));var config=require(_0x7673('0x5'));var logger=require('../../../config/logger')(_0x7673('0x6'));var loggerAction=require(_0x7673('0x7'))('actionPreview');var ami=require(_0x7673('0x8'));var rpcDb=require(_0x7673('0x9'));var Action=require('./action');var ut=require('./util/util');config['redis']=_['defaults'](config[_0x7673('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x7673('0xb'))(new Redis(config[_0x7673('0xa')]));var Sequence=function(){};Sequence['prototype'][_0x7673('0xc')]=function(_0x331f57){this[_0x7673('0xd')]=this['tail']?this['tail'][_0x7673('0xe')](_0x331f57):_0x331f57();};function Preview(_0x571b87){this[_0x7673('0xf')]=new Sequence();this[_0x7673('0x10')]=_0x571b87[_0x7673('0x11')];this[_0x7673('0x12')]=_0x571b87[_0x7673('0x12')];this[_0x7673('0x13')]={};this[_0x7673('0x14')]=_0x571b87[_0x7673('0x14')];this[_0x7673('0x15')]=0x0;ami['on'](_0x7673('0x16'),this['syncOriginateResponse'][_0x7673('0x17')](this));ami['on'](_0x7673('0x18'),this[_0x7673('0x19')][_0x7673('0x17')](this));ami['on'](_0x7673('0x1a'),this[_0x7673('0x1b')][_0x7673('0x17')](this));ami['on']('dialend',this['syncDialEnd'][_0x7673('0x17')](this));ami['on'](_0x7673('0x1c'),this['syncNewExten'][_0x7673('0x17')](this));ami['on'](_0x7673('0x1d'),this['syncVarSet'][_0x7673('0x17')](this));ami['on'](_0x7673('0x1e'),this[_0x7673('0x1f')]['bind'](this));ami['on']('blindtransfer',this[_0x7673('0x20')][_0x7673('0x17')](this));this['loopCampaigns'](this[_0x7673('0x10')]);}function emit(_0x29bbd9,_0x2e1260,_0x33eb47){io['to'](_0x29bbd9)[_0x7673('0x21')](_0x2e1260,_0x33eb47);}function emitCampaignPreview(_0x3e28ca){if(_0x3e28ca['type']==='outbound'){var _0xea9b37={'id':_0x3e28ca['id'],'name':_0x3e28ca[_0x7673('0x22')],'strategy':_0x3e28ca[_0x7673('0x23')],'answered':_0x3e28ca[_0x7673('0x24')],'available':_0x3e28ca[_0x7673('0x25')],'loggedIn':_0x3e28ca['loggedIn'],'pTalking':_0x3e28ca[_0x7673('0x26')],'sumBillable':_0x3e28ca[_0x7673('0x27')],'sumDuration':_0x3e28ca[_0x7673('0x28')],'sumHoldTime':_0x3e28ca[_0x7673('0x29')]||0x0,'talking':_0x3e28ca[_0x7673('0x2a')],'total':_0x3e28ca[_0x7673('0x2b')],'type':_0x3e28ca['type'],'unmanaged':_0x3e28ca[_0x7673('0x2c')],'abandoned':_0x3e28ca[_0x7673('0x2d')],'waiting':_0x3e28ca[_0x7673('0x2e')],'loggedInDb':_0x3e28ca[_0x7673('0x2f')],'dialActive':_0x3e28ca['dialActive'],'dialMethod':_0x3e28ca['dialMethod'],'dialOriginateCallerIdName':_0x3e28ca[_0x7673('0x30')],'dialOriginateCallerIdNumber':_0x3e28ca[_0x7673('0x31')],'dialOriginateTimeout':_0x3e28ca[_0x7673('0x32')],'dialPrefix':_0x3e28ca[_0x7673('0x33')],'outboundAnswerAgiCallsDay':_0x3e28ca[_0x7673('0x34')],'outboundAnswerCallsDay':_0x3e28ca[_0x7673('0x35')],'outboundBlacklistCallsDay':_0x3e28ca[_0x7673('0x36')],'outboundBusyCallsDay':_0x3e28ca['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3e28ca['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3e28ca[_0x7673('0x37')],'outboundDropCallsDayCallersExit':_0x3e28ca[_0x7673('0x38')],'outboundDropCallsDayTimeout':_0x3e28ca[_0x7673('0x39')],'outboundNoAnswerCallsDay':_0x3e28ca[_0x7673('0x3a')],'outboundNoSuchCallsDay':_0x3e28ca[_0x7673('0x3b')],'outboundOriginateFailureCallsDay':_0x3e28ca[_0x7673('0x3c')],'outboundReCallsDay':_0x3e28ca[_0x7673('0x3d')],'outboundRejectCallsDay':_0x3e28ca['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3e28ca['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x3e28ca[_0x7673('0x3e')],'predictiveIntervalAnsweredCalls':_0x3e28ca[_0x7673('0x3f')],'predictiveIntervalAvgHoldtime':_0x3e28ca[_0x7673('0x40')],'predictiveIntervalAvgTalktime':_0x3e28ca[_0x7673('0x41')],'predictiveIntervalDroppedCallsCallersExit':_0x3e28ca['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3e28ca[_0x7673('0x42')],'predictiveIntervalErlangCalls':_0x3e28ca['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x3e28ca[_0x7673('0x43')],'predictiveIntervalHitRate':_0x3e28ca[_0x7673('0x44')],'predictiveIntervalMultiplicativeFactor':_0x3e28ca[_0x7673('0x45')],'predictiveIntervalPauses':_0x3e28ca[_0x7673('0x46')],'predictiveIntervalAvailable':_0x3e28ca[_0x7673('0x47')],'predictiveIntervalTotalCalls':_0x3e28ca[_0x7673('0x48')],'message':_0x3e28ca[_0x7673('0x49')],'originated':_0x3e28ca[_0x7673('0x4a')],'erlangCalls':_0x3e28ca[_0x7673('0x4b')],'erlangCallToSecond':_0x3e28ca[_0x7673('0x4c')],'erlangAbandonmentRate':_0x3e28ca[_0x7673('0x4d')],'erlangBusyFactor':_0x3e28ca[_0x7673('0x4e')],'startPredictive':_0x3e28ca[_0x7673('0x4f')],'startProgressive':_0x3e28ca['startProgressive']};if(_0x3e28ca[_0x7673('0x50')]){_0xea9b37[_0x7673('0x50')]={'id':_0x3e28ca[_0x7673('0x50')]['id'],'name':_0x3e28ca[_0x7673('0x50')][_0x7673('0x22')],'active':_0x3e28ca[_0x7673('0x50')][_0x7673('0x51')],'callerid':_0x3e28ca['Trunk']['callerid']};}if(_0x3e28ca[_0x7673('0x52')]){_0xea9b37[_0x7673('0x52')]={'id':_0x3e28ca[_0x7673('0x52')]['id'],'name':_0x3e28ca[_0x7673('0x52')][_0x7673('0x22')]};}var _0x101e03=md5(JSON[_0x7673('0x53')](_0xea9b37));if(_0x3e28ca['md5']!==_0x101e03){_0x3e28ca[_0x7673('0x3')]=_0x101e03;emit(util[_0x7673('0x54')]('voice:queue:%s',_0xea9b37[_0x7673('0x22')]),_0x7673('0x55'),_0xea9b37);}}}function emitVoiceQueueChannelRemove(_0x287eee){logger[_0x7673('0x56')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x7673('0x53')](_0x287eee));emit(util[_0x7673('0x54')]('voice:queue:%s',_0x287eee[_0x7673('0x22')]),_0x7673('0x57'),_0x287eee);io[_0x7673('0x21')]('voice_queue_presence:remove',_0x287eee);}function notSendMessagesQueue(_0xe50aa5){if(_0xe50aa5[_0x7673('0x58')]){if(_0xe50aa5[_0x7673('0x4a')]===0x0&&_0xe50aa5['pTalking']===0x0){_0xe50aa5['sendMessageOneNotActive']=![];_0xe50aa5[_0x7673('0x25')]=0x0;_0xe50aa5['paused']=0x0;_0xe50aa5['message']=_0x7673('0x59');ut[_0x7673('0x5a')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0xe50aa5[_0x7673('0x22')]+_0x7673('0x5b'));}else{_0xe50aa5[_0x7673('0x49')]=_0x7673('0x5c');ut[_0x7673('0x5a')](_0x7673('0x5d'),_0xe50aa5['name']+_0x7673('0x5e'));}emitCampaignPreview(_0xe50aa5);}}Preview['prototype'][_0x7673('0x5f')]=function(){var _0x52f803=this;setInterval(function(){_0x52f803[_0x7673('0x60')]();},0x7cf);};Preview[_0x7673('0x61')]['syncCampaigns']=function(){var _0x5b2e69=this[_0x7673('0x10')];this['clockClearZombieChannels']+=0x1;for(var _0x23dca4 in _0x5b2e69){if(_0x5b2e69[_0x7673('0x62')](_0x23dca4)&&(_0x5b2e69[_0x23dca4][_0x7673('0x63')]===_0x7673('0x6')||_0x5b2e69[_0x23dca4][_0x7673('0x63')]==='booked')&&_0x5b2e69[_0x23dca4]['type']===_0x7673('0x64')){if(this[_0x7673('0x15')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x7673('0x65')]();}}if(_0x5b2e69[_0x7673('0x62')](_0x23dca4)&&_0x5b2e69[_0x23dca4][_0x7673('0x63')]==='preview'&&_0x5b2e69[_0x23dca4][_0x7673('0x66')]===_0x7673('0x64')){if(_0x5b2e69[_0x23dca4][_0x7673('0x67')]){this[_0x7673('0x68')](_0x5b2e69[_0x23dca4]);if(_0x5b2e69[_0x23dca4][_0x7673('0x69')])this[_0x7673('0x6a')](_0x5b2e69[_0x23dca4]);}else{notSendMessagesQueue(_0x5b2e69[_0x23dca4]);}}}};Preview[_0x7673('0x61')][_0x7673('0x6b')]=function(_0x58e17d){var _0x4ed31d=this;this[_0x7673('0xf')][_0x7673('0xc')](function(){if(!_[_0x7673('0x6c')](_0x4ed31d[_0x7673('0x13')][_0x58e17d])){loggerAction[_0x7673('0x56')](_0x7673('0x6d'),_0x58e17d,_0x7673('0x6e'),_0x4ed31d['actions'][_0x58e17d][_0x7673('0x6f')],_0x7673('0x70'),JSON[_0x7673('0x53')](_0x4ed31d[_0x7673('0x10')][_0x4ed31d[_0x7673('0x13')][_0x58e17d]['queue']][_0x7673('0x4a')]),_0x7673('0x71'),JSON[_0x7673('0x53')](_0x4ed31d[_0x7673('0x10')][_0x4ed31d[_0x7673('0x13')][_0x58e17d]['queue']]['pTalking']),JSON[_0x7673('0x53')](_0x4ed31d[_0x7673('0x13')][_0x58e17d]['dialAnswer']),JSON[_0x7673('0x53')](_[_0x7673('0x72')](_0x4ed31d[_0x7673('0x13')][_0x58e17d],[_0x7673('0x73'),_0x7673('0x74'),'VoiceQueueId',_0x7673('0x75')])));return ami[_0x7673('0x76')]({'action':_0x7673('0x77'),'channel':_0x4ed31d[_0x7673('0x13')][_0x58e17d]['channel']})[_0x7673('0x78')](function(_0x5e8632){if(_0x5e8632[_0x7673('0x49')]===_0x7673('0x79')){setTimeout(function(){if(_0x4ed31d[_0x7673('0x13')][_0x58e17d]){ut[_0x7673('0x7a')](_0x4ed31d[_0x7673('0x10')][_0x4ed31d[_0x7673('0x13')][_0x58e17d][_0x7673('0x6f')]],_0x7673('0x7b'));if(_0x4ed31d[_0x7673('0x13')][_0x58e17d]['dialAnswer']===!![]){ut[_0x7673('0x7c')](_0x4ed31d['campaignsPreview'][_0x4ed31d[_0x7673('0x13')][_0x58e17d][_0x7673('0x6f')]],_0x7673('0x7b'));ut['loggerError'](_0x7673('0x7d')+_0x58e17d,_0x4ed31d[_0x7673('0x13')][_0x58e17d][_0x7673('0x6f')]);}ut[_0x7673('0x7e')](_0x7673('0x7f')+_0x58e17d,_0x4ed31d[_0x7673('0x13')][_0x58e17d][_0x7673('0x6f')]);delete _0x4ed31d[_0x7673('0x13')][_0x58e17d];}},0x2328);}});}});};Preview[_0x7673('0x61')][_0x7673('0x65')]=function(){var _0x3965c2=this;loggerAction[_0x7673('0x56')](_0x7673('0x80'),_[_0x7673('0x81')](this['actions']));for(var _0x29dc1a in this['actions']){if(_0x3965c2[_0x7673('0x13')][_0x7673('0x62')](_0x29dc1a)){_0x3965c2[_0x7673('0x6b')](_0x29dc1a);}}};Preview['prototype'][_0x7673('0x6a')]=function(_0x5d71b7){var _0x4f9e7a=this;rpcDb[_0x7673('0x82')](_0x5d71b7['id'],ut['agentReadyId'](this['agents']))[_0x7673('0x83')](function(_0x3f6ef3){if(!_[_0x7673('0x6c')](_0x3f6ef3)){for(var _0xeaa731=0x0;_0xeaa731<_0x3f6ef3[_0x7673('0x84')];_0xeaa731+=0x1){if(ut[_0x7673('0x85')](_0x3f6ef3[_0xeaa731][_0x7673('0x86')])<_0x5d71b7[_0x7673('0x87')]*0x3c){if(_0x3f6ef3[_0xeaa731][_0x7673('0x88')]&&!_0x3f6ef3[_0xeaa731][_0x7673('0x88')][_0x7673('0x89')]){_0x4f9e7a['run'](_0x3f6ef3[_0xeaa731]['id'])['then'](ut[_0x7673('0x8a')](_0x7673('0x8b')))[_0x7673('0x78')](ut[_0x7673('0x8a')](_0x7673('0x8b')));}else{rpcDb['disableContact'](_0x3f6ef3[_0xeaa731]['id']);}}else{var _0x5caca9=new Action(_0x3f6ef3[_0xeaa731],_0x5d71b7);_0x5caca9[_0x7673('0x8c')]=moment()[_0x7673('0x54')](_0x7673('0x8d'));_0x5d71b7[_0x7673('0x3d')]+=0x1;ut[_0x7673('0x8e')](_0x5caca9,0x17,'RecallInQueue');if(_0x5d71b7[_0x7673('0x8f')]){rpcDb[_0x7673('0x90')](ut[_0x7673('0x91')](_0x3f6ef3[_0xeaa731]));rpcDb['createCustomerHistory'](_0x5caca9,_0x7673('0x92'));}else{ut['logCustomer'](_0x5caca9,0x16,_0x7673('0x93'));rpcDb[_0x7673('0x94')](_0x5caca9,_0x7673('0x95'));rpcDb['createCustomerFinal'](_0x5caca9,_0x7673('0x95'));}}}}})[_0x7673('0x78')](ut['logger2']('[getContactRecallMe]'));};Preview['prototype'][_0x7673('0x68')]=function(_0x2dd367){_0x2dd367[_0x7673('0x58')]=!![];if(ut[_0x7673('0x96')](_0x2dd367['loggedIn'])){_0x2dd367[_0x7673('0x49')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x7673('0x97')](_0x2dd367[_0x7673('0x67')])){_0x2dd367[_0x7673('0x49')]=_0x7673('0x59');}else if(!this['isTrunkReachable'](_0x2dd367[_0x7673('0x50')])){if(!this[_0x7673('0x98')](_0x2dd367[_0x7673('0x99')])){_0x2dd367['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x2dd367[_0x7673('0x49')]=_0x7673('0x9a');}}else{_0x2dd367[_0x7673('0x49')]=_0x7673('0x9a');}emitCampaignPreview(_0x2dd367);};Preview[_0x7673('0x61')]['callProgressDetectingCustomer']=function(_0x2a9f6d,_0x212ed5,_0x5f5cb0){var _0x5a5442=this;var _0x4a6ef8=this[_0x7673('0x13')][_0x212ed5];var _0x2a44c0=this['campaignsPreview'][_0x4a6ef8[_0x7673('0x6f')]];var _0x484b9b;if(_0x2a44c0){switch(_0x5f5cb0){case'1':_0x2a44c0['outboundNoSuchCallsDay']+=0x1;_0x4a6ef8[_0x7673('0x9b')]+=0x1;_0x4a6ef8[_0x7673('0x9c')]=ut[_0x7673('0x9d')](_0x4a6ef8);ut[_0x7673('0x8e')](_0x4a6ef8,0x0,'NoSuchNumber');ami[_0x7673('0x21')]('custom:agentnosuchnumber',ut[_0x7673('0x9e')](_0x4a6ef8,_0x7673('0x9f')));rpcDb[_0x7673('0x94')](_0x4a6ef8,_0x7673('0xa0'));if(ut[_0x7673('0x9d')](_0x4a6ef8)>=_0x2a44c0[_0x7673('0xa1')]){_0x484b9b=ut[_0x7673('0xa2')](_0x4a6ef8,0xf,'Global');rpcDb['createCustomerFinal'](_0x484b9b,_0x7673('0xa3'));}else{if(_0x4a6ef8[_0x7673('0x9b')]>=_0x2a44c0[_0x7673('0xa4')]){rpcDb[_0x7673('0xa5')](_0x4a6ef8,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x7673('0xa6')](ut[_0x7673('0xa7')](_0x4a6ef8,_0x7673('0x9b'),_0x2a44c0[_0x7673('0xa8')]),_0x4a6ef8[_0x7673('0xa9')],_0x4a6ef8['activeContact']);}}delete this[_0x7673('0x13')][_0x2a9f6d[_0x7673('0xaa')]];break;case _0x7673('0xab'):var _0x4f35a3=moment()[_0x7673('0x54')](_0x7673('0x8d'));_0x4a6ef8[_0x7673('0xac')]=_0x4f35a3;_0x4a6ef8[_0x7673('0xad')]=_0x4f35a3;_0x4a6ef8[_0x7673('0xae')]=!![];_0x2a44c0[_0x7673('0x26')]+=0x1;logger['info'](_0x7673('0xaf'),_0x4a6ef8[_0x7673('0xb0')],_0x7673('0xb1'),_0x2a44c0[_0x7673('0x22')],_0x7673('0x71'),_0x2a44c0[_0x7673('0x26')]);ami['emit'](_0x7673('0xb2'),ut[_0x7673('0x9e')](_0x4a6ef8,_0x7673('0xb3'),this[_0x7673('0x10')][_0x4a6ef8['queue']]));if(_0x2a44c0[_0x7673('0xb4')]){ami[_0x7673('0x21')](_0x7673('0xb5'),ut[_0x7673('0xb6')](_0x4a6ef8));}break;case'16':ami[_0x7673('0x21')](_0x7673('0xb7'),ut[_0x7673('0x9e')](_0x4a6ef8,_0x7673('0xb8'),this[_0x7673('0x10')][_0x4a6ef8[_0x7673('0x6f')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x4a6ef8,'complete'));_0x2a44c0[_0x7673('0x35')]+=0x1;_0x2a44c0[_0x7673('0x2b')]+=0x1;_0x2a44c0[_0x7673('0x24')]+=0x1;ut['decrementTalkink'](_0x2a44c0,_0x7673('0xb9'));_0x4a6ef8[_0x7673('0x9c')]=ut[_0x7673('0x9d')](_0x4a6ef8);ut['logCustomer'](_0x4a6ef8,0x4,_0x7673('0xba'));rpcDb['createCustomerHistory'](_0x4a6ef8,_0x7673('0xbb'));rpcDb[_0x7673('0xa5')](_0x4a6ef8,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x4a6ef8);_0x2a44c0[_0x7673('0x28')]+=_0x4a6ef8[_0x7673('0xbc')];_0x2a44c0['sumBillable']+=_0x4a6ef8['talktime'];logger[_0x7673('0x56')]('[syncHangup][talking][decrement]',_0x4a6ef8[_0x7673('0xb0')],_0x7673('0xb1'),_0x2a44c0[_0x7673('0x22')],_0x7673('0x71'),_0x2a44c0[_0x7673('0x26')]);delete this[_0x7673('0x13')][_0x2a9f6d[_0x7673('0xaa')]];break;case _0x7673('0xbd'):_0x2a44c0[_0x7673('0xbe')]+=0x1;_0x4a6ef8['countbusyretry']+=0x1;_0x4a6ef8[_0x7673('0x9c')]=ut[_0x7673('0x9d')](_0x4a6ef8);ut[_0x7673('0x8e')](_0x4a6ef8,0x5,'Busy');ami[_0x7673('0x21')](_0x7673('0xbf'),ut[_0x7673('0x9e')](_0x4a6ef8,_0x7673('0xc0')));rpcDb[_0x7673('0x94')](_0x4a6ef8,_0x7673('0xc1'));if(ut[_0x7673('0x9d')](_0x4a6ef8)>=_0x2a44c0['dialGlobalMaxRetry']){_0x484b9b=ut[_0x7673('0xa2')](_0x4a6ef8,0xf,'Global');rpcDb[_0x7673('0xa5')](_0x484b9b,_0x7673('0xc2'));}else{if(_0x4a6ef8[_0x7673('0xc3')]>=_0x2a44c0[_0x7673('0xc4')]){rpcDb['createCustomerFinal'](_0x4a6ef8,_0x7673('0xc1'));}else{rpcDb[_0x7673('0xa6')](ut[_0x7673('0xa7')](_0x4a6ef8,'countbusyretry',_0x2a44c0[_0x7673('0xc5')]),_0x4a6ef8[_0x7673('0xa9')],_0x4a6ef8[_0x7673('0xc6')]);}}break;case _0x7673('0xc7'):_0x2a44c0['outboundNoAnswerCallsDay']+=0x1;_0x4a6ef8[_0x7673('0xc8')]+=0x1;_0x4a6ef8[_0x7673('0x9c')]=ut['totalGlobal'](_0x4a6ef8);ut[_0x7673('0x8e')](_0x4a6ef8,0x3,_0x7673('0xc9'));ami['emit'](_0x7673('0xca'),ut['buildObj'](_0x4a6ef8,_0x7673('0xcb')));rpcDb['createCustomerHistory'](_0x4a6ef8,_0x7673('0xcc'));if(ut[_0x7673('0x9d')](_0x4a6ef8)>=_0x2a44c0[_0x7673('0xa1')]){_0x484b9b=ut[_0x7673('0xa2')](_0x4a6ef8,0xf,_0x7673('0xcd'));rpcDb[_0x7673('0xa5')](_0x484b9b,_0x7673('0xce'));}else{if(_0x4a6ef8[_0x7673('0xc8')]>=_0x2a44c0['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x4a6ef8,_0x7673('0xcc'));}else{rpcDb[_0x7673('0xa6')](ut[_0x7673('0xa7')](_0x4a6ef8,_0x7673('0xc8'),_0x2a44c0['dialNoAnswerRetryFrequency']),_0x4a6ef8[_0x7673('0xa9')],_0x4a6ef8[_0x7673('0xc6')]);}}break;case _0x7673('0xcf'):_0x2a44c0[_0x7673('0xd0')]+=0x1;_0x4a6ef8[_0x7673('0xd1')]+=0x1;_0x4a6ef8[_0x7673('0x9c')]=ut['totalGlobal'](_0x4a6ef8);ut[_0x7673('0x8e')](_0x4a6ef8,0x8,'Congestion');ami[_0x7673('0x21')](_0x7673('0xd2'),ut[_0x7673('0x9e')](_0x4a6ef8,_0x7673('0xd3')));rpcDb[_0x7673('0x94')](_0x4a6ef8,_0x7673('0xd4'));if(ut[_0x7673('0x9d')](_0x4a6ef8)>=_0x2a44c0[_0x7673('0xa1')]){_0x484b9b=ut[_0x7673('0xa2')](_0x4a6ef8,0xf,_0x7673('0xcd'));rpcDb[_0x7673('0xa5')](_0x484b9b,_0x7673('0xd5'));}else{if(_0x4a6ef8[_0x7673('0xd1')]>=_0x2a44c0['dialCongestionMaxRetry']){rpcDb[_0x7673('0xa5')](_0x4a6ef8,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x7673('0xa6')](ut['scheduledAt'](_0x4a6ef8,_0x7673('0xd1'),_0x2a44c0[_0x7673('0xc5')]),_0x4a6ef8[_0x7673('0xa9')],_0x4a6ef8[_0x7673('0xc6')]);}}break;case _0x7673('0xd6'):_0x2a44c0[_0x7673('0xd7')]+=0x1;_0x4a6ef8[_0x7673('0xd8')]+=0x1;_0x4a6ef8[_0x7673('0x9c')]=ut[_0x7673('0x9d')](_0x4a6ef8);ut[_0x7673('0x8e')](_0x4a6ef8,0x14,'AgentReject');ami['emit'](_0x7673('0xd9'),ut['buildObj'](_0x4a6ef8,'agentreject'));rpcDb[_0x7673('0x94')](_0x4a6ef8,_0x7673('0xda'));if(ut[_0x7673('0x9d')](_0x4a6ef8)>=_0x2a44c0['dialGlobalMaxRetry']){_0x484b9b=ut[_0x7673('0xa2')](_0x4a6ef8,0x14,'AgentReject');rpcDb[_0x7673('0xa5')](_0x484b9b,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x4a6ef8[_0x7673('0xd8')]>=_0x2a44c0[_0x7673('0xdb')]){rpcDb[_0x7673('0xa5')](_0x4a6ef8,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x7673('0xa6')](ut['scheduledAt'](_0x4a6ef8,_0x7673('0xd8'),_0x2a44c0[_0x7673('0xdc')]),_0x4a6ef8[_0x7673('0xa9')],_0x4a6ef8[_0x7673('0xc6')]);}}break;case _0x7673('0xdd'):_0x2a44c0[_0x7673('0x3e')]+=0x1;_0x4a6ef8[_0x7673('0xde')]+=0x1;_0x4a6ef8[_0x7673('0x9c')]=ut[_0x7673('0x9d')](_0x4a6ef8);ut['logCustomer'](_0x4a6ef8,0xb,'Abandoned');rpcDb[_0x7673('0x94')](_0x4a6ef8,_0x7673('0xdf'));if(ut['totalGlobal'](_0x4a6ef8)>=_0x2a44c0[_0x7673('0xa1')]){_0x484b9b=ut[_0x7673('0xa2')](_0x4a6ef8,0xf,_0x7673('0xcd'));rpcDb[_0x7673('0xa5')](_0x484b9b,_0x7673('0xdf'));}else{if(_0x4a6ef8[_0x7673('0xe0')]>=_0x2a44c0[_0x7673('0xe1')]){rpcDb[_0x7673('0xa5')](_0x4a6ef8,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x7673('0xa6')](ut[_0x7673('0xa7')](_0x4a6ef8,_0x7673('0xde'),_0x2a44c0['dialAbandonedRetryFrequency']),_0x4a6ef8[_0x7673('0xa9')],_0x4a6ef8[_0x7673('0xc6')]);}}break;case'18':_0x2a44c0[_0x7673('0xe2')]+=0x1;_0x4a6ef8[_0x7673('0xe3')]+=0x1;_0x4a6ef8[_0x7673('0x9c')]=ut[_0x7673('0x9d')](_0x4a6ef8);ut[_0x7673('0x8e')](_0x4a6ef8,0x12,_0x2a9f6d['cause-txt']||_0x2a9f6d[_0x7673('0xe4')]);ami['emit'](_0x7673('0xe5'),ut[_0x7673('0x9e')](_0x4a6ef8,_0x7673('0xe6')));rpcDb['createCustomerHistory'](_0x4a6ef8,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0x7673('0x9d')](_0x4a6ef8)>=_0x2a44c0['dialGlobalMaxRetry']){_0x484b9b=ut[_0x7673('0xa2')](_0x4a6ef8,0xf,_0x7673('0xcd'));rpcDb[_0x7673('0xa5')](_0x484b9b,_0x7673('0xe7'));}else{rpcDb[_0x7673('0xa5')](_0x4a6ef8,_0x7673('0xe7'));}delete this['actions'][_0x2a9f6d[_0x7673('0xaa')]];break;case'19':_0x2a44c0[_0x7673('0xe2')]+=0x1;_0x4a6ef8[_0x7673('0x9c')]=ut[_0x7673('0x9d')](_0x4a6ef8);ut[_0x7673('0x8e')](_0x4a6ef8,0x13,_0x2a9f6d[_0x7673('0xe8')]||_0x2a9f6d[_0x7673('0xe4')]);ami[_0x7673('0x21')]('custom:amd',ut[_0x7673('0x9e')](_0x4a6ef8,_0x7673('0xe6')));rpcDb['createCustomerHistory'](_0x4a6ef8,_0x7673('0xe9'));if(ut['totalGlobal'](_0x4a6ef8)>=_0x2a44c0['dialGlobalMaxRetry']){_0x484b9b=ut[_0x7673('0xa2')](_0x4a6ef8,0xf,'Global');rpcDb[_0x7673('0xa5')](_0x484b9b,_0x7673('0xe9'));}else{rpcDb[_0x7673('0xa5')](_0x4a6ef8,_0x7673('0xe9'));}delete this[_0x7673('0x13')][_0x2a9f6d[_0x7673('0xaa')]];break;default:if(_0x4a6ef8[_0x7673('0xae')]){ut[_0x7673('0x7c')](_0x2a44c0,_0x7673('0xea'));ut[_0x7673('0x7e')](_0x7673('0xeb')+_0x2a44c0[_0x7673('0x22')],_0x2a9f6d);}_0x2a44c0['outboundUnknownCallsDay']+=0x1;_0x4a6ef8[_0x7673('0x9c')]=ut[_0x7673('0x9d')](_0x4a6ef8);ut[_0x7673('0x8e')](_0x4a6ef8,0xc,_0x2a9f6d['cause-txt']||_0x2a9f6d[_0x7673('0xe4')]);rpcDb[_0x7673('0x94')](_0x4a6ef8,_0x7673('0xec'));if(ut[_0x7673('0x9d')](_0x4a6ef8)>=_0x2a44c0['dialGlobalMaxRetry']){_0x484b9b=ut['cloneAction'](_0x4a6ef8,0xf,'Global');rpcDb[_0x7673('0xa5')](_0x484b9b,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x7673('0xa5')](_0x4a6ef8,_0x7673('0xed'));}delete this[_0x7673('0x13')][_0x2a9f6d['linkedid']];}if(!(_0x4a6ef8[_0x7673('0xae')]&&_0x5f5cb0==='16')){ut[_0x7673('0x7a')](_0x2a44c0,_0x7673('0xee'));logger[_0x7673('0x56')](_0x7673('0xef'),_0x4a6ef8[_0x7673('0xb0')],_0x7673('0xb1'),_0x2a44c0[_0x7673('0x22')],_0x7673('0x70'),_0x2a44c0[_0x7673('0x4a')]);}if(_0x5f5cb0!==_0x7673('0xab')){delete this[_0x7673('0x13')][_0x2a9f6d['linkedid']];delete this['actions'][_0x2a9f6d['destlinkedid']];}}};Preview['prototype'][_0x7673('0xf0')]=function(_0xbeff92,_0x54d23b,_0x58949d){if(_['isUndefined'](_0x54d23b)&&_0x7673('0xf1')!==typeof _0x54d23b){return;}if(_[_0x7673('0xf2')](_0x58949d)&&_0x7673('0xf1')!==typeof _0x58949d){return;}switch(_0x58949d[_0x7673('0xf3')]){case'0':ut[_0x7673('0xf4')](_0xbeff92,0x0,'NoSuchNumber');rpcDb[_0x7673('0xf5')](_0xbeff92,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x7673('0xf4')](_0xbeff92,0x3,_0x7673('0xc9'));rpcDb['createAgentHistory'](_0xbeff92,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x7673('0xf4')](_0xbeff92,0x5,_0x7673('0xf6'));rpcDb[_0x7673('0xf5')](_0xbeff92,_0x7673('0xf7'));break;case'8':ut[_0x7673('0xf4')](_0xbeff92,0x8,_0x7673('0xf8'));rpcDb[_0x7673('0xf5')](_0xbeff92,_0x7673('0xf9'));break;case'22':ut[_0x7673('0xf4')](_0xbeff92,0x16,_0x7673('0xfa'));rpcDb[_0x7673('0xf5')](_0xbeff92,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0xbeff92,0xc,_0x58949d[_0x7673('0xf3')]);rpcDb[_0x7673('0xf5')](_0xbeff92,_0x7673('0xf9'));}ut[_0x7673('0x7a')](_0x54d23b,_0x7673('0xfb'));logger['info'](_0x7673('0xfc'),_0xbeff92[_0x7673('0xb0')],_0x7673('0xb1'),_0x54d23b[_0x7673('0x22')],_0x7673('0x70'),_0x54d23b[_0x7673('0x4a')]);delete this['actions'][_0xbeff92[_0x7673('0xb0')]];};Preview['prototype'][_0x7673('0xfd')]=function(_0x4032fc,_0x3ad5d8,_0x57da03,_0x561204,_0x4afa80){var _0x291899=this;return new BPromise(function(_0x27d345,_0x58da8a){if(_[_0x7673('0x6c')](_0x3ad5d8)||_['isNil'](_0x3ad5d8[_0x7673('0xfe')])||_['isNil'](_0x3ad5d8[_0x7673('0xfe')][_0x7673('0xff')])||_[_0x7673('0x6c')](_0x3ad5d8[_0x7673('0x100')])){_0x58da8a(ut['message'](_0x7673('0x101'),_0x561204,_0x4afa80));return;}var _0x7ed790=uuid['v4']();var _0x43f2f9=_0x291899['campaignsPreview'][_0x3ad5d8['Queue'][_0x7673('0x22')]];var _0x6c8b4e=_0x57da03?_0x291899['agents'][_0x57da03]['id']:undefined;_0x291899[_0x7673('0x13')][_0x7ed790]=new Action(_0x3ad5d8,_0x43f2f9,_0x7ed790,_0x57da03,_0x6c8b4e);var _0x4c02be=_0x291899[_0x7673('0x13')][_0x7ed790];_0x4c02be['unlockAgent']=_0x561204;_0x4c02be['activeContact']=_0x4afa80;_0x4c02be[_0x7673('0x102')]=_0x57da03;if(_[_0x7673('0x103')](_0x4032fc)){_0x291899['execCall'](_0x4c02be,_0x43f2f9,_0x3ad5d8,_0x57da03)[_0x7673('0x83')](function(_0x56d530){logger[_0x7673('0x56')](_0x7673('0x104'),_0x7673('0x105')+_0x4c02be[_0x7673('0x6f')]+_0x7673('0x106')+_0x4c02be[_0x7673('0x107')],JSON[_0x7673('0x53')](_0x56d530));ami['emit'](_0x7673('0x108'),ut[_0x7673('0x9e')](_0x4c02be,_0x7673('0x109'),_0x291899[_0x7673('0x10')][_0x4c02be['queue']]));_0x27d345(ut[_0x7673('0x49')](_0x7673('0x10a')));})[_0x7673('0x78')](function(_0x4961d2){ut[_0x7673('0x5a')](_0x7673('0x10b'),_0x4961d2);_0x58da8a(ut[_0x7673('0x49')](_0x7673('0x10c'),_0x561204,_0x4afa80));});}else{_0x43f2f9[_0x7673('0x36')]+=0x1;ut[_0x7673('0x10d')](_0x4c02be);rpcDb[_0x7673('0x10e')](_0x4c02be,_0x7673('0x10f'));delete _0x291899[_0x7673('0x13')][_0x7ed790];_0x58da8a(ut[_0x7673('0x49')](_0x7673('0x110'),_0x561204,_0x4afa80));}});};Preview[_0x7673('0x61')]['isTrunkReachable']=function(_0x3ff143){return!_[_0x7673('0x6c')](_0x3ff143)&&!_[_0x7673('0x6c')](_0x3ff143[_0x7673('0x22')])&&!_[_0x7673('0x6c')](_0x3ff143[_0x7673('0x51')])&&_0x3ff143[_0x7673('0x51')]&&!_[_0x7673('0x6c')](this['trunks'][util['format'](_0x7673('0x111'),_0x3ff143[_0x7673('0x22')])])&&!_[_0x7673('0x6c')](this[_0x7673('0x12')][util[_0x7673('0x54')]('SIP/%s',_0x3ff143[_0x7673('0x22')])]['status'])&&(this['trunks'][util[_0x7673('0x54')]('SIP/%s',_0x3ff143[_0x7673('0x22')])][_0x7673('0x77')]===_0x7673('0x112')||this[_0x7673('0x12')][util[_0x7673('0x54')](_0x7673('0x111'),_0x3ff143[_0x7673('0x22')])][_0x7673('0x77')]===_0x7673('0x113'));};Preview['prototype'][_0x7673('0x114')]=function(_0x21503e,_0xb5ffc){var _0x5282ad=this;return new BPromise(function(_0x16af07,_0x3a4741){_0x5282ad['execRun'](_0x21503e,_0xb5ffc)[_0x7673('0x83')](function(_0x13b0a2){_0x16af07(_[_0x7673('0x72')](_0x13b0a2,[_0x7673('0x49')]));})[_0x7673('0x78')](function(_0x50f0cd){if(_0x50f0cd[_0x7673('0x115')]){rpcDb[_0x7673('0x116')](_0x21503e);}if(_0x50f0cd[_0x7673('0x51')]){rpcDb[_0x7673('0x117')](_0x21503e);}_0x3a4741(_['pick'](_0x50f0cd,[_0x7673('0x49')]));});});};Preview[_0x7673('0x61')][_0x7673('0x118')]=function(_0x98c2b8,_0x1250dd){var _0x2ff033=this;return new BPromise(function(_0x1cf15b,_0x41f35c){var _0x5acf42,_0x4f99cd;rpcDb[_0x7673('0x119')](_0x98c2b8)[_0x7673('0x83')](function(_0x46b56d){if(!_[_0x7673('0x6c')](_0x46b56d[0x0])){_0x4f99cd=_0x46b56d[0x0][_0x7673('0x11a')]?![]:!![];_0x5acf42=_0x46b56d[0x0][_0x7673('0x11a')]?!![]:![];_0x5acf42=_0x1250dd?!![]:_0x5acf42;}var _0x30eabf=_0x2ff033[_0x7673('0x11b')](_0x46b56d);if(_0x30eabf[_0x7673('0x11c')]){rpcDb[_0x7673('0x11d')](_[_0x7673('0x72')](_0x46b56d[0x0],[_0x7673('0x100'),_0x7673('0x11e')]))['then'](function(_0x87ca84){_0x2ff033[_0x7673('0xfd')](_0x87ca84,_0x46b56d[0x0],_0x1250dd,_0x4f99cd,_0x5acf42)[_0x7673('0x83')](function(_0x4f5a07){_0x1cf15b(_0x4f5a07);})[_0x7673('0x78')](function(_0x1ba2ec){_0x41f35c(_0x1ba2ec);});})['catch'](function(_0x482cbe){ut['logger'](_0x7673('0x11f'),_0x482cbe);_0x41f35c(ut[_0x7673('0x49')](_0x7673('0x120'),_0x4f99cd,_0x5acf42));});}else{_0x41f35c(ut[_0x7673('0x49')](_0x30eabf[_0x7673('0x49')],_0x4f99cd,_0x5acf42));}})[_0x7673('0x78')](function(_0x48ea16){ut[_0x7673('0x5a')](_0x7673('0x121'),_0x48ea16);_0x41f35c(ut[_0x7673('0x49')](_0x7673('0x120'),![],!![]));});});};Preview[_0x7673('0x61')][_0x7673('0x11b')]=function(_0x2a561d){if(_[_0x7673('0x6c')](_0x2a561d)||_[_0x7673('0x103')](_0x2a561d)||!_[_0x7673('0x6c')](_0x2a561d[0x0][_0x7673('0x88')])&&_[_0x7673('0x6c')](_0x2a561d[0x0][_0x7673('0x88')][_0x7673('0x22')])){ut['logger'](_0x7673('0x122'),_0x2a561d);return{'isValid':![],'message':_0x7673('0x123')};}var _0x53a27e=this[_0x7673('0x10')][_0x2a561d[0x0][_0x7673('0x6e')][_0x7673('0x22')]];_0x53a27e[_0x7673('0x49')]=_0x7673('0x9a');if(_[_0x7673('0x6c')](_0x53a27e)){ut[_0x7673('0x5a')](_0x7673('0x124'),_0x53a27e);return{'isValid':![],'message':_0x7673('0x125')};}if(!this['isTrunkReachable'](_0x53a27e[_0x7673('0x50')])){ut[_0x7673('0x5a')](_0x7673('0x126'),_0x7673('0x127')+_0x53a27e[_0x7673('0x22')]+_0x7673('0x128'));if(!this[_0x7673('0x98')](_0x53a27e[_0x7673('0x99')])){ut[_0x7673('0x5a')](_0x7673('0x126'),_0x53a27e['name']+_0x7673('0x129'));return{'isValid':![],'message':_0x7673('0x12a')};}}if(!ut[_0x7673('0x97')](_0x53a27e[_0x7673('0x67')])){ut[_0x7673('0x5a')]('[Preview][validateContact][Campaign\x20Active]',_0x53a27e[_0x7673('0x22')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x7673('0x127')+_0x53a27e[_0x7673('0x22')]+_0x7673('0x12b')};}return{'isValid':!![],'message':_0x7673('0x12c')};};Preview[_0x7673('0x61')][_0x7673('0x12d')]=function(_0x5ad9fb,_0x43b6e3,_0x5006ef,_0x496800){var _0x6980ef=this;return new BPromise(function(_0x5b999d,_0x5a0961){var _0x4086bf=_0x5ad9fb[_0x7673('0xb0')];var _0x4d9b55=_0x6980ef[_0x7673('0x98')](_0x43b6e3[_0x7673('0x50')])?util[_0x7673('0x54')](_0x7673('0x12e'),_0x43b6e3[_0x7673('0x50')]['name'],_['isNil'](_0x43b6e3['dialPrefix'])?'':_0x43b6e3[_0x7673('0x33')]['trim']()||'',_0x43b6e3[_0x7673('0x12f')]>0x0?_0x5006ef[_0x7673('0xfe')]['phone'][_0x7673('0x130')](_0x43b6e3[_0x7673('0x12f')]):_0x5006ef[_0x7673('0xfe')][_0x7673('0xff')]):util[_0x7673('0x54')](_0x7673('0x12e'),_[_0x7673('0x6c')](_0x43b6e3[_0x7673('0x99')])?_0x43b6e3[_0x7673('0x50')][_0x7673('0x22')]:_0x43b6e3[_0x7673('0x99')][_0x7673('0x22')],_[_0x7673('0x6c')](_0x43b6e3[_0x7673('0x33')])?'':_0x43b6e3[_0x7673('0x33')][_0x7673('0x131')]()||'',_0x43b6e3[_0x7673('0x12f')]>0x0?_0x5006ef[_0x7673('0xfe')][_0x7673('0xff')][_0x7673('0x130')](_0x43b6e3[_0x7673('0x12f')]):_0x5006ef[_0x7673('0xfe')][_0x7673('0xff')]);var _0x14f91c=_0x6980ef[_0x7673('0x98')](_0x43b6e3['Trunk'])?ut[_0x7673('0x132')](_0x43b6e3[_0x7673('0x50')][_0x7673('0x133')],_0x43b6e3[_0x7673('0x30')],_0x43b6e3[_0x7673('0x134')]>0x0?ut[_0x7673('0x135')](_0x43b6e3[_0x7673('0x31')],_0x43b6e3[_0x7673('0x134')]):_0x43b6e3['dialOriginateCallerIdNumber']):ut[_0x7673('0x132')](_[_0x7673('0x6c')](_0x43b6e3[_0x7673('0x99')])?_0x43b6e3[_0x7673('0x50')][_0x7673('0x133')]:_0x43b6e3[_0x7673('0x99')]['callerid'],_0x43b6e3[_0x7673('0x30')],_0x43b6e3['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x43b6e3[_0x7673('0x31')],_0x43b6e3[_0x7673('0x134')]):_0x43b6e3[_0x7673('0x31')]);if(_0x14f91c){_0x5ad9fb[_0x7673('0x136')]=ut['extractCalleridName'](_0x14f91c);_0x5ad9fb['originatecalleridnum']=ut[_0x7673('0x137')](_0x14f91c);}var _0x24623d=ut[_0x7673('0x138')](_0x43b6e3,_0x5006ef,_0x4d9b55,_0x14f91c,_0x4086bf,_0x5ad9fb);_[_0x7673('0x139')](_0x5ad9fb,ut[_0x7673('0x13a')](_0x24623d));_0x5ad9fb[_0x7673('0x8c')]=moment()[_0x7673('0x54')]('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut[_0x7673('0x13b')](_0x5ad9fb,_0x43b6e3,_0x24623d,_0x5ad9fb[_0x7673('0xc6')],_0x496800))['then'](function(_0x232324){_0x43b6e3[_0x7673('0x4a')]+=0x1;logger['info'](_0x7673('0x13c'),_0x4086bf,'\x20Queue',_0x43b6e3['name'],_0x7673('0x70'),_0x43b6e3[_0x7673('0x4a')]);_0x5b999d(_0x232324);})[_0x7673('0x78')](function(_0x35587c){ut[_0x7673('0xf4')](_0x5ad9fb,0xe,_0x7673('0x13d'));rpcDb[_0x7673('0xf5')](_0x5ad9fb,'[originateFailure][logOriginateFailure]');_0x5a0961(_0x35587c);});});};Preview[_0x7673('0x61')][_0x7673('0x13e')]=function(_0xe36405){if(this[_0x7673('0x13')][_0xe36405['linkedid']]){this[_0x7673('0x13')][_0xe36405[_0x7673('0xaa')]]['channel']=_0xe36405[_0x7673('0x13f')];}};Preview['prototype'][_0x7673('0x140')]=function(_0x4d4fb3){var _0x3b6905=this;var _0x366a2d=this[_0x7673('0x13')][_0x4d4fb3[_0x7673('0x141')]];if(_0x366a2d){if(_0x366a2d[_0x7673('0x102')]&&this[_0x7673('0x14')][_0x366a2d[_0x7673('0x102')]]){ut[_0x7673('0x142')](_0x366a2d,this[_0x7673('0x14')][_0x366a2d[_0x7673('0x102')]][_0x7673('0x22')],this[_0x7673('0x14')][_0x366a2d[_0x7673('0x102')]]['id']);}var _0x48787e=_['clone'](_0x366a2d);_0x48787e[_0x7673('0xac')]=moment()[_0x7673('0x54')](_0x7673('0x8d'));var _0x3f049f=_0x3b6905['campaignsPreview'][_0x366a2d[_0x7673('0x6f')]];if(ut['isFailure'](_0x4d4fb3[_0x7673('0x143')])){if(_0x366a2d[_0x7673('0xa9')]){rpcDb[_0x7673('0x116')](_0x366a2d[_0x7673('0x107')]);}if(_0x366a2d['activeContact']){rpcDb[_0x7673('0x117')](_0x366a2d[_0x7673('0x107')]);}ami[_0x7673('0x21')](_0x7673('0x144'),ut[_0x7673('0x9e')](_0x366a2d,'rejected',this['campaignsPreview'][_0x366a2d[_0x7673('0x6f')]]));this[_0x7673('0xf0')](_0x48787e,_0x3f049f,_0x4d4fb3);}else{_0x366a2d[_0x7673('0x8c')]=moment()['format'](_0x7673('0x8d'));ut[_0x7673('0xf4')](_0x48787e,0x4,_0x7673('0xba'));rpcDb[_0x7673('0xf5')](_0x48787e,_0x7673('0x145'));}}};Preview['prototype'][_0x7673('0x19')]=function(_0x3137e8){var _0x17ad4c=this;var _0x41d8b2=this['actions'][_0x3137e8[_0x7673('0xaa')]];var _0x18221a;if(_0x41d8b2){_0x18221a=this[_0x7673('0x10')][_0x41d8b2['queue']];logger['info'](_0x7673('0x146'),_0x3137e8[_0x7673('0xaa')],_0x7673('0xb1'),_0x18221a[_0x7673('0x22')],'pTalking:\x20',_0x18221a[_0x7673('0x26')]);}if(this['actions'][_0x3137e8[_0x7673('0xaa')]]&&_0x3137e8[_0x7673('0xaa')]!==_0x3137e8[_0x7673('0xb0')]){if(_0x3137e8[_0x7673('0x147')]==='16'&&this[_0x7673('0x13')][_0x3137e8[_0x7673('0xaa')]][_0x7673('0xae')]){this[_0x7673('0x148')](_0x3137e8,_0x3137e8[_0x7673('0xaa')],_0x3137e8[_0x7673('0x147')]);}else if(this[_0x7673('0x13')][_0x3137e8['linkedid']][_0x7673('0xae')]){logger[_0x7673('0x56')](_0x7673('0x149'),_0x3137e8['linkedid'],_0x3137e8[_0x7673('0x147')],_0x7673('0xb1'),_0x18221a[_0x7673('0x22')],'pTalking:\x20',_0x18221a[_0x7673('0x26')]);this[_0x7673('0x148')](_0x3137e8,_0x3137e8['linkedid'],_0x3137e8[_0x7673('0x147')]);}}else if(_0x41d8b2&&_['isNil'](_0x41d8b2[_0x7673('0x14a')])&&_0x18221a[_0x7673('0x14b')]&&_0x3137e8[_0x7673('0xaa')]===_0x3137e8['uniqueid']&&_[_0x7673('0x6c')](_0x3137e8[_0x7673('0xf3')])&&_0x3137e8[_0x7673('0x147')]==='16'&&_0x3137e8['channelstate']==='6'&&_['isUndefined'](_0x41d8b2[_0x7673('0x14c')])){if(_0x41d8b2[_0x7673('0xa9')]){rpcDb[_0x7673('0x116')](_0x41d8b2[_0x7673('0x107')]);}if(_0x41d8b2['activeContact']){rpcDb['disableContact'](_0x41d8b2[_0x7673('0x107')]);}_0x3137e8[_0x7673('0xf3')]='22';this[_0x7673('0xf0')](_0x41d8b2,_0x18221a,_0x3137e8);}else if(_0x41d8b2&&_0x41d8b2[_0x7673('0x14c')]){if(_0x3137e8[_0x7673('0x147')]==='16'&&this[_0x7673('0x13')][_0x3137e8[_0x7673('0xaa')]][_0x7673('0xae')]){logger[_0x7673('0x56')](_0x7673('0x14d'),_0x3137e8[_0x7673('0xaa')],_0x3137e8['cause'],_0x7673('0xb1'),_0x18221a[_0x7673('0x22')],_0x7673('0x71'),_0x18221a[_0x7673('0x26')]);this[_0x7673('0x148')](_0x3137e8,_0x3137e8[_0x7673('0xaa')],_0x3137e8[_0x7673('0x147')]);}else if(this[_0x7673('0x13')][_0x3137e8[_0x7673('0xaa')]]['dialAnswer']){logger['info'](_0x7673('0x149'),_0x3137e8[_0x7673('0xaa')],_0x3137e8[_0x7673('0x147')],_0x7673('0xb1'),_0x18221a[_0x7673('0x22')],_0x7673('0x71'),_0x18221a[_0x7673('0x26')]);this[_0x7673('0x148')](_0x3137e8,_0x3137e8[_0x7673('0xaa')],_0x3137e8['cause']);}}};Preview[_0x7673('0x61')]['syncDialEnd']=function(_0xeeb3ec){if(this[_0x7673('0x13')][_0xeeb3ec['destlinkedid']]&&_0xeeb3ec[_0x7673('0x14e')]!==_0xeeb3ec['destuniqueid']){this['callProgressDetectingCustomer'](_0xeeb3ec,_0xeeb3ec[_0x7673('0x14e')],_0xeeb3ec[_0x7673('0xe4')]);}};Preview['prototype'][_0x7673('0x1b')]=function(_0x5d8820){if(this[_0x7673('0x13')][_0x5d8820[_0x7673('0xaa')]]&&_0x5d8820[_0x7673('0xaa')]!==_0x5d8820[_0x7673('0xb0')]&&!this[_0x7673('0x13')][_0x5d8820[_0x7673('0xaa')]][_0x7673('0xae')]){if(_0x5d8820[_0x7673('0x147')]==='1'){this[_0x7673('0x148')](_0x5d8820,_0x5d8820[_0x7673('0xaa')],_0x5d8820[_0x7673('0x147')]);}}};Preview['prototype'][_0x7673('0x14f')]=function(_0x2febc0,_0x490b15,_0x5eef56){if(this['actions'][_0x2febc0]){if(_[_0x7673('0x6c')](this[_0x7673('0x13')][_0x2febc0][_0x7673('0x150')])){this['actions'][_0x2febc0][_0x7673('0x150')]={};}this[_0x7673('0x13')][_0x2febc0][_0x7673('0x150')][_0x490b15]=_0x5eef56;}};Preview[_0x7673('0x61')][_0x7673('0x151')]=function(_0x381d43){try{if(!_[_0x7673('0x6c')](_0x381d43)){if(ut['filterKey'](_[_0x7673('0x152')](_0x381d43[_0x7673('0x153')])[0x0])){this[_0x7673('0x14f')](_0x381d43[_0x7673('0xb0')],_['keys'](_0x381d43[_0x7673('0x153')])[0x0],_0x381d43['value']);}}}catch(_0x18bfea){logger['error'](_0x7673('0x154'),util[_0x7673('0x155')](_0x18bfea,{'showHidden':![],'depth':null}));}};Preview[_0x7673('0x61')]['syncAttendedTransfer']=function(_0x2d185c){if(_0x2d185c){if(this['actions'][_0x2d185c[_0x7673('0x156')]]){this[_0x7673('0x13')][_0x2d185c[_0x7673('0x156')]][_0x7673('0x14c')]=!![];}}};Preview[_0x7673('0x61')][_0x7673('0x20')]=function(_0x302406){if(_0x302406){if(this[_0x7673('0x13')][_0x302406['transfererlinkedid']]){this[_0x7673('0x13')][_0x302406['transfererlinkedid']]['transfer']=!![];}}};module[_0x7673('0x157')]=Preview; \ No newline at end of file +var _0x3937=['logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','isTrunkReachable','TrunkBackup','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','BUSY','countbusyretry','custom:agentbusy','Global','[callProgressDetectingCustomer][logBusyGlobal]','[callProgressDetectingCustomer][logBusy]','unlockAgent','NOANSWER','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','object','reason','NoSuchNumber','createAgentHistory','logAgent','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','updateOriginated','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlockContact','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','trim','substring','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','extractCalleridNumber','addVariables','toLowerVariables','starttime','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','clone','isFailure','response','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','channelstate','isUndefined','transfer','[syncHangup][talking][transfer]','syncDialEnd','destlinkedid','addVariable','variables','filterKey','variable','keys','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','md5','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','socket.io-emitter','prototype','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','dialend','newexten','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','strategy','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','format','voice:queue:%s','voice_queue:save','stringify','sendMessageOneNotActive','available','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','outbound','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','enqueue','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','status','channel','catch','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x3937,0xbf));var _0x7393=function(_0x3e3fc6,_0x3453a2){_0x3e3fc6=_0x3e3fc6-0x0;var _0x59e06c=_0x3937[_0x3e3fc6];return _0x59e06c;};'use strict';var util=require(_0x7393('0x0'));var _=require('lodash');var BPromise=require(_0x7393('0x1'));var uuid=require(_0x7393('0x2'));var moment=require('moment');var md5=require(_0x7393('0x3'));var Redis=require('ioredis');var config=require(_0x7393('0x4'));var logger=require('../../../config/logger')(_0x7393('0x5'));var loggerAction=require(_0x7393('0x6'))(_0x7393('0x7'));var ami=require(_0x7393('0x8'));var rpcDb=require(_0x7393('0x9'));var Action=require(_0x7393('0xa'));var ut=require(_0x7393('0xb'));config[_0x7393('0xc')]=_[_0x7393('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7393('0xe'))(new Redis(config[_0x7393('0xc')]));var Sequence=function(){};Sequence[_0x7393('0xf')]['enqueue']=function(_0xab290c){this['tail']=this['tail']?this['tail']['finally'](_0xab290c):_0xab290c();};function Preview(_0xe00598){this[_0x7393('0x10')]=new Sequence();this[_0x7393('0x11')]=_0xe00598['voiceQueues'];this[_0x7393('0x12')]=_0xe00598[_0x7393('0x12')];this[_0x7393('0x13')]={};this[_0x7393('0x14')]=_0xe00598[_0x7393('0x14')];this[_0x7393('0x15')]=0x0;ami['on'](_0x7393('0x16'),this[_0x7393('0x17')][_0x7393('0x18')](this));ami['on']('hangup',this['syncHangup'][_0x7393('0x18')](this));ami['on']('hanguprequest',this['syncHangupRequest']['bind'](this));ami['on'](_0x7393('0x19'),this['syncDialEnd'][_0x7393('0x18')](this));ami['on'](_0x7393('0x1a'),this['syncNewExten'][_0x7393('0x18')](this));ami['on']('varset',this['syncVarSet'][_0x7393('0x18')](this));ami['on'](_0x7393('0x1b'),this[_0x7393('0x1c')][_0x7393('0x18')](this));ami['on'](_0x7393('0x1d'),this[_0x7393('0x1e')][_0x7393('0x18')](this));this[_0x7393('0x1f')](this['campaignsPreview']);}function emit(_0x52cd6a,_0x30eae3,_0x16f617){io['to'](_0x52cd6a)[_0x7393('0x20')](_0x30eae3,_0x16f617);}function emitCampaignPreview(_0x7fc0ef){if(_0x7fc0ef[_0x7393('0x21')]==='outbound'){var _0x4d7870={'id':_0x7fc0ef['id'],'name':_0x7fc0ef['name'],'strategy':_0x7fc0ef[_0x7393('0x22')],'answered':_0x7fc0ef['answered'],'available':_0x7fc0ef['available'],'loggedIn':_0x7fc0ef[_0x7393('0x23')],'pTalking':_0x7fc0ef[_0x7393('0x24')],'sumBillable':_0x7fc0ef['sumBillable'],'sumDuration':_0x7fc0ef[_0x7393('0x25')],'sumHoldTime':_0x7fc0ef[_0x7393('0x26')]||0x0,'talking':_0x7fc0ef[_0x7393('0x27')],'total':_0x7fc0ef[_0x7393('0x28')],'type':_0x7fc0ef[_0x7393('0x21')],'unmanaged':_0x7fc0ef[_0x7393('0x29')],'abandoned':_0x7fc0ef[_0x7393('0x2a')],'waiting':_0x7fc0ef[_0x7393('0x2b')],'loggedInDb':_0x7fc0ef[_0x7393('0x2c')],'dialActive':_0x7fc0ef[_0x7393('0x2d')],'dialMethod':_0x7fc0ef[_0x7393('0x2e')],'dialOriginateCallerIdName':_0x7fc0ef[_0x7393('0x2f')],'dialOriginateCallerIdNumber':_0x7fc0ef[_0x7393('0x30')],'dialOriginateTimeout':_0x7fc0ef['dialOriginateTimeout'],'dialPrefix':_0x7fc0ef[_0x7393('0x31')],'outboundAnswerAgiCallsDay':_0x7fc0ef[_0x7393('0x32')],'outboundAnswerCallsDay':_0x7fc0ef[_0x7393('0x33')],'outboundBlacklistCallsDay':_0x7fc0ef[_0x7393('0x34')],'outboundBusyCallsDay':_0x7fc0ef[_0x7393('0x35')],'outboundCongestionCallsDay':_0x7fc0ef[_0x7393('0x36')],'outboundDropCallsDayACS':_0x7fc0ef['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x7fc0ef[_0x7393('0x37')],'outboundDropCallsDayTimeout':_0x7fc0ef['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x7fc0ef[_0x7393('0x38')],'outboundNoSuchCallsDay':_0x7fc0ef['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x7fc0ef[_0x7393('0x39')],'outboundReCallsDay':_0x7fc0ef[_0x7393('0x3a')],'outboundRejectCallsDay':_0x7fc0ef[_0x7393('0x3b')],'outboundUnknownCallsDay':_0x7fc0ef[_0x7393('0x3c')],'outboundAbandonedCallsDay':_0x7fc0ef[_0x7393('0x3d')],'predictiveIntervalAnsweredCalls':_0x7fc0ef[_0x7393('0x3e')],'predictiveIntervalAvgHoldtime':_0x7fc0ef[_0x7393('0x3f')],'predictiveIntervalAvgTalktime':_0x7fc0ef[_0x7393('0x40')],'predictiveIntervalDroppedCallsCallersExit':_0x7fc0ef[_0x7393('0x41')],'predictiveIntervalDroppedCallsTimeout':_0x7fc0ef[_0x7393('0x42')],'predictiveIntervalErlangCalls':_0x7fc0ef[_0x7393('0x43')],'predictiveIntervalErlangCallsDroppedCalls':_0x7fc0ef[_0x7393('0x44')],'predictiveIntervalHitRate':_0x7fc0ef['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x7fc0ef['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x7fc0ef[_0x7393('0x45')],'predictiveIntervalAvailable':_0x7fc0ef['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x7fc0ef[_0x7393('0x46')],'message':_0x7fc0ef['message'],'originated':_0x7fc0ef[_0x7393('0x47')],'erlangCalls':_0x7fc0ef['erlangCalls'],'erlangCallToSecond':_0x7fc0ef[_0x7393('0x48')],'erlangAbandonmentRate':_0x7fc0ef[_0x7393('0x49')],'erlangBusyFactor':_0x7fc0ef[_0x7393('0x4a')],'startPredictive':_0x7fc0ef[_0x7393('0x4b')],'startProgressive':_0x7fc0ef[_0x7393('0x4c')]};if(_0x7fc0ef[_0x7393('0x4d')]){_0x4d7870[_0x7393('0x4d')]={'id':_0x7fc0ef[_0x7393('0x4d')]['id'],'name':_0x7fc0ef[_0x7393('0x4d')][_0x7393('0x4e')],'active':_0x7fc0ef['Trunk'][_0x7393('0x4f')],'callerid':_0x7fc0ef['Trunk'][_0x7393('0x50')]};}if(_0x7fc0ef['Interval']){_0x4d7870[_0x7393('0x51')]={'id':_0x7fc0ef[_0x7393('0x51')]['id'],'name':_0x7fc0ef[_0x7393('0x51')][_0x7393('0x4e')]};}var _0x121d48=md5(JSON['stringify'](_0x4d7870));if(_0x7fc0ef[_0x7393('0x3')]!==_0x121d48){_0x7fc0ef['md5']=_0x121d48;emit(util[_0x7393('0x52')](_0x7393('0x53'),_0x4d7870[_0x7393('0x4e')]),_0x7393('0x54'),_0x4d7870);}}}function emitVoiceQueueChannelRemove(_0x27f469){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x7393('0x55')](_0x27f469));emit(util[_0x7393('0x52')](_0x7393('0x53'),_0x27f469[_0x7393('0x4e')]),'voice_queue_channel:remove',_0x27f469);io['emit']('voice_queue_presence:remove',_0x27f469);}function notSendMessagesQueue(_0x264393){if(_0x264393[_0x7393('0x56')]){if(_0x264393[_0x7393('0x47')]===0x0&&_0x264393[_0x7393('0x24')]===0x0){_0x264393[_0x7393('0x56')]=![];_0x264393[_0x7393('0x57')]=0x0;_0x264393[_0x7393('0x58')]=0x0;_0x264393[_0x7393('0x59')]=_0x7393('0x5a');ut[_0x7393('0x5b')](_0x7393('0x5c'),_0x264393[_0x7393('0x4e')]+_0x7393('0x5d'));}else{_0x264393[_0x7393('0x59')]=_0x7393('0x5e');ut[_0x7393('0x5b')](_0x7393('0x5c'),_0x264393[_0x7393('0x4e')]+_0x7393('0x5f'));}emitCampaignPreview(_0x264393);}}Preview[_0x7393('0xf')][_0x7393('0x1f')]=function(){var _0x2c498d=this;setInterval(function(){_0x2c498d['syncCampaigns']();},0x7cf);};Preview[_0x7393('0xf')][_0x7393('0x60')]=function(){var _0x25a2a6=this[_0x7393('0x11')];this[_0x7393('0x15')]+=0x1;for(var _0x8c550e in _0x25a2a6){if(_0x25a2a6[_0x7393('0x61')](_0x8c550e)&&(_0x25a2a6[_0x8c550e][_0x7393('0x2e')]==='preview'||_0x25a2a6[_0x8c550e]['dialMethod']===_0x7393('0x62'))&&_0x25a2a6[_0x8c550e]['type']===_0x7393('0x63')){if(this[_0x7393('0x15')]>0x7){this[_0x7393('0x15')]=0x0;this[_0x7393('0x64')]();}}if(_0x25a2a6[_0x7393('0x61')](_0x8c550e)&&_0x25a2a6[_0x8c550e][_0x7393('0x2e')]==='preview'&&_0x25a2a6[_0x8c550e][_0x7393('0x21')]===_0x7393('0x63')){if(_0x25a2a6[_0x8c550e][_0x7393('0x2d')]){this[_0x7393('0x65')](_0x25a2a6[_0x8c550e]);if(_0x25a2a6[_0x8c550e][_0x7393('0x66')])this['recallMe'](_0x25a2a6[_0x8c550e]);}else{notSendMessagesQueue(_0x25a2a6[_0x8c550e]);}}}};Preview['prototype'][_0x7393('0x67')]=function(_0x51a192){var _0x21b358=this;this[_0x7393('0x10')][_0x7393('0x68')](function(){if(!_[_0x7393('0x69')](_0x21b358[_0x7393('0x13')][_0x51a192])){loggerAction[_0x7393('0x6a')](_0x7393('0x6b'),_0x51a192,_0x7393('0x6c'),_0x21b358[_0x7393('0x13')][_0x51a192][_0x7393('0x6d')],_0x7393('0x6e'),JSON[_0x7393('0x55')](_0x21b358[_0x7393('0x11')][_0x21b358[_0x7393('0x13')][_0x51a192][_0x7393('0x6d')]]['originated']),_0x7393('0x6f'),JSON[_0x7393('0x55')](_0x21b358[_0x7393('0x11')][_0x21b358[_0x7393('0x13')][_0x51a192]['queue']][_0x7393('0x24')]),JSON[_0x7393('0x55')](_0x21b358[_0x7393('0x13')][_0x51a192][_0x7393('0x70')]),JSON[_0x7393('0x55')](_[_0x7393('0x71')](_0x21b358[_0x7393('0x13')][_0x51a192],[_0x7393('0x72'),_0x7393('0x73'),'VoiceQueueId',_0x7393('0x74')])));return ami[_0x7393('0x75')]({'action':_0x7393('0x76'),'channel':_0x21b358['actions'][_0x51a192][_0x7393('0x77')]})[_0x7393('0x78')](function(_0x4c26e3){if(_0x4c26e3[_0x7393('0x59')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x21b358[_0x7393('0x13')][_0x51a192]){ut['updateOriginated'](_0x21b358[_0x7393('0x11')][_0x21b358[_0x7393('0x13')][_0x51a192]['queue']],_0x7393('0x79'));if(_0x21b358[_0x7393('0x13')][_0x51a192][_0x7393('0x70')]===!![]){ut[_0x7393('0x7a')](_0x21b358['campaignsPreview'][_0x21b358['actions'][_0x51a192]['queue']],_0x7393('0x79'));ut[_0x7393('0x7b')](_0x7393('0x7c')+_0x51a192,_0x21b358[_0x7393('0x13')][_0x51a192][_0x7393('0x6d')]);}ut[_0x7393('0x7b')](_0x7393('0x7d')+_0x51a192,_0x21b358[_0x7393('0x13')][_0x51a192][_0x7393('0x6d')]);delete _0x21b358[_0x7393('0x13')][_0x51a192];}},0x2328);}});}});};Preview[_0x7393('0xf')][_0x7393('0x64')]=function(){var _0x42217a=this;loggerAction[_0x7393('0x6a')](_0x7393('0x7e'),_[_0x7393('0x7f')](this['actions']));for(var _0x53d44e in this[_0x7393('0x13')]){if(_0x42217a['actions']['hasOwnProperty'](_0x53d44e)){_0x42217a['clearZombieChannel'](_0x53d44e);}}};Preview[_0x7393('0xf')]['recallMe']=function(_0x4645bd){var _0x57d7b1=this;rpcDb['getContactRecallMe'](_0x4645bd['id'],ut[_0x7393('0x80')](this['agents']))[_0x7393('0x81')](function(_0x4a0642){if(!_[_0x7393('0x69')](_0x4a0642)){for(var _0x5f7d6c=0x0;_0x5f7d6c<_0x4a0642[_0x7393('0x82')];_0x5f7d6c+=0x1){if(ut[_0x7393('0x83')](_0x4a0642[_0x5f7d6c]['scheduledat'])<_0x4645bd[_0x7393('0x84')]*0x3c){if(_0x4a0642[_0x5f7d6c][_0x7393('0x85')]&&!_0x4a0642[_0x5f7d6c][_0x7393('0x85')]['voicePause']){_0x57d7b1[_0x7393('0x86')](_0x4a0642[_0x5f7d6c]['id'])['then'](ut['logger2']('[RecallMe]'))[_0x7393('0x78')](ut[_0x7393('0x87')](_0x7393('0x88')));}else{rpcDb[_0x7393('0x89')](_0x4a0642[_0x5f7d6c]['id']);}}else{var _0x582e65=new Action(_0x4a0642[_0x5f7d6c],_0x4645bd);_0x582e65['starttime']=moment()['format'](_0x7393('0x8a'));_0x4645bd['outboundReCallsDay']+=0x1;ut[_0x7393('0x8b')](_0x582e65,0x17,_0x7393('0x8c'));if(_0x4645bd[_0x7393('0x8d')]){rpcDb[_0x7393('0x8e')](ut[_0x7393('0x8f')](_0x4a0642[_0x5f7d6c]));rpcDb[_0x7393('0x90')](_0x582e65,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x7393('0x8b')](_0x582e65,0x16,_0x7393('0x91'));rpcDb['createCustomerHistory'](_0x582e65,_0x7393('0x92'));rpcDb[_0x7393('0x93')](_0x582e65,_0x7393('0x92'));}}}}})[_0x7393('0x78')](ut[_0x7393('0x87')]('[getContactRecallMe]'));};Preview['prototype'][_0x7393('0x65')]=function(_0x45166d){_0x45166d[_0x7393('0x56')]=!![];if(ut['IsNotLoggedIn'](_0x45166d[_0x7393('0x23')])){_0x45166d[_0x7393('0x59')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x45166d['dialActive'])){_0x45166d['message']='NOT_ACTIVE';}else if(!this[_0x7393('0x94')](_0x45166d[_0x7393('0x4d')])){if(!this[_0x7393('0x94')](_0x45166d[_0x7393('0x95')])){_0x45166d['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x45166d[_0x7393('0x59')]=_0x7393('0x96');}}else{_0x45166d[_0x7393('0x59')]=_0x7393('0x96');}emitCampaignPreview(_0x45166d);};Preview[_0x7393('0xf')]['callProgressDetectingCustomer']=function(_0x13fc0c,_0x517846,_0x12f8d3){var _0x4b2079=this;var _0x1a42c8=this['actions'][_0x517846];var _0x3250b9=this['campaignsPreview'][_0x1a42c8['queue']];var _0x7f3a81;if(_0x3250b9){switch(_0x12f8d3){case'1':_0x3250b9[_0x7393('0x97')]+=0x1;_0x1a42c8[_0x7393('0x98')]+=0x1;_0x1a42c8[_0x7393('0x99')]=ut[_0x7393('0x9a')](_0x1a42c8);ut[_0x7393('0x8b')](_0x1a42c8,0x0,'NoSuchNumber');ami['emit'](_0x7393('0x9b'),ut[_0x7393('0x9c')](_0x1a42c8,_0x7393('0x9d')));rpcDb[_0x7393('0x90')](_0x1a42c8,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x7393('0x9a')](_0x1a42c8)>=_0x3250b9[_0x7393('0x9e')]){_0x7f3a81=ut[_0x7393('0x9f')](_0x1a42c8,0xf,'Global');rpcDb[_0x7393('0x93')](_0x7f3a81,_0x7393('0xa0'));}else{if(_0x1a42c8[_0x7393('0x98')]>=_0x3250b9[_0x7393('0xa1')]){rpcDb[_0x7393('0x93')](_0x1a42c8,_0x7393('0xa0'));}else{rpcDb[_0x7393('0xa2')](ut[_0x7393('0xa3')](_0x1a42c8,_0x7393('0x98'),_0x3250b9[_0x7393('0xa4')]),_0x1a42c8['unlockAgent'],_0x1a42c8[_0x7393('0xa5')]);}}delete this[_0x7393('0x13')][_0x13fc0c[_0x7393('0xa6')]];break;case _0x7393('0xa7'):var _0x5e42f3=moment()[_0x7393('0x52')](_0x7393('0x8a'));_0x1a42c8[_0x7393('0xa8')]=_0x5e42f3;_0x1a42c8[_0x7393('0xa9')]=_0x5e42f3;_0x1a42c8[_0x7393('0x70')]=!![];_0x3250b9[_0x7393('0x24')]+=0x1;logger[_0x7393('0x6a')](_0x7393('0xaa'),_0x1a42c8[_0x7393('0xab')],_0x7393('0xac'),_0x3250b9['name'],'pTalking:\x20',_0x3250b9['pTalking']);ami[_0x7393('0x20')](_0x7393('0xad'),ut['buildObj'](_0x1a42c8,_0x7393('0xae'),this[_0x7393('0x11')][_0x1a42c8[_0x7393('0x6d')]]));if(_0x3250b9[_0x7393('0xaf')]){ami[_0x7393('0x20')](_0x7393('0xb0'),ut['buildAcw'](_0x1a42c8));}break;case'16':ami[_0x7393('0x20')](_0x7393('0xb1'),ut[_0x7393('0x9c')](_0x1a42c8,_0x7393('0xb2'),this[_0x7393('0x11')][_0x1a42c8[_0x7393('0x6d')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x1a42c8,_0x7393('0xb2')));_0x3250b9[_0x7393('0x33')]+=0x1;_0x3250b9[_0x7393('0x28')]+=0x1;_0x3250b9['answered']+=0x1;ut[_0x7393('0x7a')](_0x3250b9,_0x7393('0xb3'));_0x1a42c8[_0x7393('0x99')]=ut[_0x7393('0x9a')](_0x1a42c8);ut[_0x7393('0x8b')](_0x1a42c8,0x4,_0x7393('0xb4'));rpcDb[_0x7393('0x90')](_0x1a42c8,_0x7393('0xb5'));rpcDb[_0x7393('0x93')](_0x1a42c8,_0x7393('0xb6'));rpcDb[_0x7393('0xb7')](_0x1a42c8);_0x3250b9[_0x7393('0x25')]+=_0x1a42c8[_0x7393('0xb8')];_0x3250b9[_0x7393('0xb9')]+=_0x1a42c8['talktime'];logger[_0x7393('0x6a')](_0x7393('0xba'),_0x1a42c8[_0x7393('0xab')],'\x20Queue',_0x3250b9[_0x7393('0x4e')],'pTalking:\x20',_0x3250b9[_0x7393('0x24')]);delete this[_0x7393('0x13')][_0x13fc0c['linkedid']];break;case _0x7393('0xbb'):_0x3250b9[_0x7393('0x35')]+=0x1;_0x1a42c8[_0x7393('0xbc')]+=0x1;_0x1a42c8[_0x7393('0x99')]=ut['totalGlobal'](_0x1a42c8);ut[_0x7393('0x8b')](_0x1a42c8,0x5,'Busy');ami[_0x7393('0x20')](_0x7393('0xbd'),ut[_0x7393('0x9c')](_0x1a42c8,'busy'));rpcDb['createCustomerHistory'](_0x1a42c8,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x7393('0x9a')](_0x1a42c8)>=_0x3250b9['dialGlobalMaxRetry']){_0x7f3a81=ut['cloneAction'](_0x1a42c8,0xf,_0x7393('0xbe'));rpcDb[_0x7393('0x93')](_0x7f3a81,_0x7393('0xbf'));}else{if(_0x1a42c8[_0x7393('0xbc')]>=_0x3250b9['dialBusyMaxRetry']){rpcDb[_0x7393('0x93')](_0x1a42c8,_0x7393('0xc0'));}else{rpcDb[_0x7393('0xa2')](ut['scheduledAt'](_0x1a42c8,_0x7393('0xbc'),_0x3250b9['dialBusyRetryFrequency']),_0x1a42c8[_0x7393('0xc1')],_0x1a42c8[_0x7393('0xa5')]);}}break;case _0x7393('0xc2'):_0x3250b9[_0x7393('0x38')]+=0x1;_0x1a42c8[_0x7393('0xc3')]+=0x1;_0x1a42c8[_0x7393('0x99')]=ut[_0x7393('0x9a')](_0x1a42c8);ut['logCustomer'](_0x1a42c8,0x3,'NoAnswer');ami[_0x7393('0x20')](_0x7393('0xc4'),ut['buildObj'](_0x1a42c8,_0x7393('0xc5')));rpcDb['createCustomerHistory'](_0x1a42c8,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x7393('0x9a')](_0x1a42c8)>=_0x3250b9[_0x7393('0x9e')]){_0x7f3a81=ut['cloneAction'](_0x1a42c8,0xf,_0x7393('0xbe'));rpcDb[_0x7393('0x93')](_0x7f3a81,_0x7393('0xc6'));}else{if(_0x1a42c8[_0x7393('0xc3')]>=_0x3250b9['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x1a42c8,_0x7393('0xc7'));}else{rpcDb[_0x7393('0xa2')](ut[_0x7393('0xa3')](_0x1a42c8,_0x7393('0xc3'),_0x3250b9['dialNoAnswerRetryFrequency']),_0x1a42c8[_0x7393('0xc1')],_0x1a42c8['activeContact']);}}break;case _0x7393('0xc8'):_0x3250b9[_0x7393('0x36')]+=0x1;_0x1a42c8[_0x7393('0xc9')]+=0x1;_0x1a42c8[_0x7393('0x99')]=ut[_0x7393('0x9a')](_0x1a42c8);ut[_0x7393('0x8b')](_0x1a42c8,0x8,'Congestion');ami[_0x7393('0x20')](_0x7393('0xca'),ut[_0x7393('0x9c')](_0x1a42c8,_0x7393('0xcb')));rpcDb[_0x7393('0x90')](_0x1a42c8,_0x7393('0xcc'));if(ut['totalGlobal'](_0x1a42c8)>=_0x3250b9['dialGlobalMaxRetry']){_0x7f3a81=ut[_0x7393('0x9f')](_0x1a42c8,0xf,_0x7393('0xbe'));rpcDb[_0x7393('0x93')](_0x7f3a81,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x1a42c8[_0x7393('0xc9')]>=_0x3250b9[_0x7393('0xcd')]){rpcDb[_0x7393('0x93')](_0x1a42c8,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x7393('0xa2')](ut[_0x7393('0xa3')](_0x1a42c8,_0x7393('0xc9'),_0x3250b9['dialBusyRetryFrequency']),_0x1a42c8[_0x7393('0xc1')],_0x1a42c8[_0x7393('0xa5')]);}}break;case _0x7393('0xce'):_0x3250b9[_0x7393('0x3b')]+=0x1;_0x1a42c8['countagentrejectretry']+=0x1;_0x1a42c8[_0x7393('0x99')]=ut[_0x7393('0x9a')](_0x1a42c8);ut[_0x7393('0x8b')](_0x1a42c8,0x14,_0x7393('0xcf'));ami[_0x7393('0x20')](_0x7393('0xd0'),ut[_0x7393('0x9c')](_0x1a42c8,'agentreject'));rpcDb[_0x7393('0x90')](_0x1a42c8,_0x7393('0xd1'));if(ut[_0x7393('0x9a')](_0x1a42c8)>=_0x3250b9['dialGlobalMaxRetry']){_0x7f3a81=ut['cloneAction'](_0x1a42c8,0x14,_0x7393('0xcf'));rpcDb[_0x7393('0x93')](_0x7f3a81,_0x7393('0xd2'));}else{if(_0x1a42c8['countagentrejectretry']>=_0x3250b9[_0x7393('0xd3')]){rpcDb[_0x7393('0x93')](_0x1a42c8,_0x7393('0xd2'));}else{rpcDb[_0x7393('0xa2')](ut[_0x7393('0xa3')](_0x1a42c8,'countagentrejectretry',_0x3250b9[_0x7393('0xd4')]),_0x1a42c8[_0x7393('0xc1')],_0x1a42c8['activeContact']);}}break;case _0x7393('0xd5'):_0x3250b9[_0x7393('0x3d')]+=0x1;_0x1a42c8[_0x7393('0xd6')]+=0x1;_0x1a42c8[_0x7393('0x99')]=ut[_0x7393('0x9a')](_0x1a42c8);ut[_0x7393('0x8b')](_0x1a42c8,0xb,'Abandoned');rpcDb[_0x7393('0x90')](_0x1a42c8,_0x7393('0xd7'));if(ut['totalGlobal'](_0x1a42c8)>=_0x3250b9[_0x7393('0x9e')]){_0x7f3a81=ut[_0x7393('0x9f')](_0x1a42c8,0xf,_0x7393('0xbe'));rpcDb[_0x7393('0x93')](_0x7f3a81,_0x7393('0xd7'));}else{if(_0x1a42c8[_0x7393('0xd8')]>=_0x3250b9[_0x7393('0xd9')]){rpcDb[_0x7393('0x93')](_0x1a42c8,_0x7393('0xd7'));}else{rpcDb['rescheduleContact'](ut[_0x7393('0xa3')](_0x1a42c8,'countabandonedretry',_0x3250b9[_0x7393('0xda')]),_0x1a42c8[_0x7393('0xc1')],_0x1a42c8[_0x7393('0xa5')]);}}break;case'18':_0x3250b9['outboundUnknownCallsDay']+=0x1;_0x1a42c8[_0x7393('0xdb')]+=0x1;_0x1a42c8[_0x7393('0x99')]=ut[_0x7393('0x9a')](_0x1a42c8);ut[_0x7393('0x8b')](_0x1a42c8,0x12,_0x13fc0c[_0x7393('0xdc')]||_0x13fc0c['dialstatus']);ami[_0x7393('0x20')](_0x7393('0xdd'),ut[_0x7393('0x9c')](_0x1a42c8,'amd'));rpcDb[_0x7393('0x90')](_0x1a42c8,_0x7393('0xde'));if(ut[_0x7393('0x9a')](_0x1a42c8)>=_0x3250b9[_0x7393('0x9e')]){_0x7f3a81=ut[_0x7393('0x9f')](_0x1a42c8,0xf,_0x7393('0xbe'));rpcDb['createCustomerFinal'](_0x7f3a81,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0x1a42c8,_0x7393('0xde'));}delete this[_0x7393('0x13')][_0x13fc0c[_0x7393('0xa6')]];break;case'19':_0x3250b9[_0x7393('0x3c')]+=0x1;_0x1a42c8[_0x7393('0x99')]=ut[_0x7393('0x9a')](_0x1a42c8);ut[_0x7393('0x8b')](_0x1a42c8,0x13,_0x13fc0c['cause-txt']||_0x13fc0c['dialstatus']);ami['emit']('custom:amd',ut[_0x7393('0x9c')](_0x1a42c8,'amd'));rpcDb[_0x7393('0x90')](_0x1a42c8,_0x7393('0xdf'));if(ut[_0x7393('0x9a')](_0x1a42c8)>=_0x3250b9['dialGlobalMaxRetry']){_0x7f3a81=ut[_0x7393('0x9f')](_0x1a42c8,0xf,_0x7393('0xbe'));rpcDb[_0x7393('0x93')](_0x7f3a81,_0x7393('0xdf'));}else{rpcDb[_0x7393('0x93')](_0x1a42c8,'[callProgressDetectingCustomer][machine]');}delete this[_0x7393('0x13')][_0x13fc0c['linkedid']];break;default:if(_0x1a42c8[_0x7393('0x70')]){ut[_0x7393('0x7a')](_0x3250b9,_0x7393('0xe0'));ut[_0x7393('0x7b')](_0x7393('0xe1')+_0x3250b9[_0x7393('0x4e')],_0x13fc0c);}_0x3250b9['outboundUnknownCallsDay']+=0x1;_0x1a42c8['countglobal']=ut[_0x7393('0x9a')](_0x1a42c8);ut[_0x7393('0x8b')](_0x1a42c8,0xc,_0x13fc0c[_0x7393('0xdc')]||_0x13fc0c['dialstatus']);rpcDb['createCustomerHistory'](_0x1a42c8,_0x7393('0xe2'));if(ut[_0x7393('0x9a')](_0x1a42c8)>=_0x3250b9[_0x7393('0x9e')]){_0x7f3a81=ut[_0x7393('0x9f')](_0x1a42c8,0xf,_0x7393('0xbe'));rpcDb['createCustomerFinal'](_0x7f3a81,_0x7393('0xe3'));}else{rpcDb[_0x7393('0x93')](_0x1a42c8,_0x7393('0xe3'));}delete this[_0x7393('0x13')][_0x13fc0c[_0x7393('0xa6')]];}if(!(_0x1a42c8['dialAnswer']&&_0x12f8d3==='16')){ut['updateOriginated'](_0x3250b9,_0x7393('0xe4'));logger['info'](_0x7393('0xe5'),_0x1a42c8[_0x7393('0xab')],_0x7393('0xac'),_0x3250b9[_0x7393('0x4e')],_0x7393('0x6e'),_0x3250b9[_0x7393('0x47')]);}if(_0x12f8d3!=='ANSWER'){delete this[_0x7393('0x13')][_0x13fc0c['linkedid']];delete this[_0x7393('0x13')][_0x13fc0c['destlinkedid']];}}};Preview['prototype'][_0x7393('0xe6')]=function(_0x5addef,_0x100e14,_0x54852a){if(_['isUndefined'](_0x100e14)&&_0x7393('0xe7')!==typeof _0x100e14){return;}if(_['isUndefined'](_0x54852a)&&'object'!==typeof _0x54852a){return;}switch(_0x54852a[_0x7393('0xe8')]){case'0':ut['logAgent'](_0x5addef,0x0,_0x7393('0xe9'));rpcDb[_0x7393('0xea')](_0x5addef,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x7393('0xeb')](_0x5addef,0x3,_0x7393('0xec'));rpcDb[_0x7393('0xea')](_0x5addef,_0x7393('0xed'));break;case'5':ut[_0x7393('0xeb')](_0x5addef,0x5,_0x7393('0xee'));rpcDb[_0x7393('0xea')](_0x5addef,_0x7393('0xef'));break;case'8':ut[_0x7393('0xeb')](_0x5addef,0x8,_0x7393('0xf0'));rpcDb['createAgentHistory'](_0x5addef,_0x7393('0xf1'));break;case'22':ut[_0x7393('0xeb')](_0x5addef,0x16,_0x7393('0xf2'));rpcDb['createAgentHistory'](_0x5addef,_0x7393('0xf3'));break;default:ut[_0x7393('0xeb')](_0x5addef,0xc,_0x54852a[_0x7393('0xe8')]);rpcDb[_0x7393('0xea')](_0x5addef,'[callProgressDetectingAgent][logCongestion]');}ut[_0x7393('0xf4')](_0x100e14,_0x7393('0xf5'));logger[_0x7393('0x6a')](_0x7393('0xf6'),_0x5addef[_0x7393('0xab')],_0x7393('0xac'),_0x100e14['name'],_0x7393('0x6e'),_0x100e14[_0x7393('0x47')]);delete this[_0x7393('0x13')][_0x5addef['uniqueid']];};Preview[_0x7393('0xf')][_0x7393('0xf7')]=function(_0x5f03cb,_0x5d2a9b,_0x2318df,_0x5e82ef,_0x5743f0){var _0xe0039d=this;return new BPromise(function(_0x2ff7c6,_0xfc6392){if(_[_0x7393('0x69')](_0x5d2a9b)||_['isNil'](_0x5d2a9b['Contact'])||_[_0x7393('0x69')](_0x5d2a9b[_0x7393('0xf8')][_0x7393('0xf9')])||_['isNil'](_0x5d2a9b[_0x7393('0xfa')])){_0xfc6392(ut[_0x7393('0x59')](_0x7393('0xfb'),_0x5e82ef,_0x5743f0));return;}var _0x1b9452=uuid['v4']();var _0x598591=_0xe0039d[_0x7393('0x11')][_0x5d2a9b[_0x7393('0x6c')]['name']];var _0x51d909=_0x2318df?_0xe0039d[_0x7393('0x14')][_0x2318df]['id']:undefined;_0xe0039d[_0x7393('0x13')][_0x1b9452]=new Action(_0x5d2a9b,_0x598591,_0x1b9452,_0x2318df,_0x51d909);var _0x15f81e=_0xe0039d[_0x7393('0x13')][_0x1b9452];_0x15f81e[_0x7393('0xc1')]=_0x5e82ef;_0x15f81e[_0x7393('0xa5')]=_0x5743f0;_0x15f81e['lookAgent']=_0x2318df;if(_[_0x7393('0xfc')](_0x5f03cb)){_0xe0039d[_0x7393('0xfd')](_0x15f81e,_0x598591,_0x5d2a9b,_0x2318df)[_0x7393('0x81')](function(_0x3ec2b9){logger[_0x7393('0x6a')]('[Preview][execCall][success]',_0x7393('0xfe')+_0x15f81e[_0x7393('0x6d')]+_0x7393('0xff')+_0x15f81e[_0x7393('0x100')],JSON[_0x7393('0x55')](_0x3ec2b9));ami['emit'](_0x7393('0x101'),ut[_0x7393('0x9c')](_0x15f81e,_0x7393('0x102'),_0xe0039d[_0x7393('0x11')][_0x15f81e[_0x7393('0x6d')]]));_0x2ff7c6(ut['message'](_0x7393('0x103')));})[_0x7393('0x78')](function(_0x3fb82a){ut['logger'](_0x7393('0x104'),_0x3fb82a);_0xfc6392(ut[_0x7393('0x59')](_0x7393('0x105'),_0x5e82ef,_0x5743f0));});}else{_0x598591[_0x7393('0x34')]+=0x1;ut[_0x7393('0x106')](_0x15f81e);rpcDb[_0x7393('0x107')](_0x15f81e,_0x7393('0x108'));delete _0xe0039d['actions'][_0x1b9452];_0xfc6392(ut['message'](_0x7393('0x109'),_0x5e82ef,_0x5743f0));}});};Preview[_0x7393('0xf')][_0x7393('0x94')]=function(_0x48f3d0){return!_['isNil'](_0x48f3d0)&&!_['isNil'](_0x48f3d0[_0x7393('0x4e')])&&!_[_0x7393('0x69')](_0x48f3d0['active'])&&_0x48f3d0['active']&&!_[_0x7393('0x69')](this[_0x7393('0x12')][util[_0x7393('0x52')]('SIP/%s',_0x48f3d0[_0x7393('0x4e')])])&&!_[_0x7393('0x69')](this[_0x7393('0x12')][util[_0x7393('0x52')](_0x7393('0x10a'),_0x48f3d0['name'])][_0x7393('0x76')])&&(this[_0x7393('0x12')][util[_0x7393('0x52')](_0x7393('0x10a'),_0x48f3d0['name'])][_0x7393('0x76')]===_0x7393('0x10b')||this[_0x7393('0x12')][util[_0x7393('0x52')](_0x7393('0x10a'),_0x48f3d0[_0x7393('0x4e')])]['status']===_0x7393('0x10c'));};Preview[_0x7393('0xf')][_0x7393('0x86')]=function(_0x205772,_0x45c0b6){var _0x5dd71a=this;return new BPromise(function(_0x3d4a43,_0x56345c){_0x5dd71a[_0x7393('0x10d')](_0x205772,_0x45c0b6)[_0x7393('0x81')](function(_0x354466){_0x3d4a43(_[_0x7393('0x71')](_0x354466,[_0x7393('0x59')]));})[_0x7393('0x78')](function(_0x4ffc80){if(_0x4ffc80['unlock']){rpcDb[_0x7393('0x10e')](_0x205772);}if(_0x4ffc80['active']){rpcDb[_0x7393('0x89')](_0x205772);}_0x56345c(_[_0x7393('0x71')](_0x4ffc80,['message']));});});};Preview[_0x7393('0xf')][_0x7393('0x10d')]=function(_0x33ce5b,_0x119a72){var _0x3f146e=this;return new BPromise(function(_0x58bd7a,_0x46abac){var _0x4579be,_0x2448b8;rpcDb[_0x7393('0x10f')](_0x33ce5b)[_0x7393('0x81')](function(_0x5c76a0){if(!_[_0x7393('0x69')](_0x5c76a0[0x0])){_0x2448b8=_0x5c76a0[0x0]['recallme']?![]:!![];_0x4579be=_0x5c76a0[0x0][_0x7393('0x110')]?!![]:![];_0x4579be=_0x119a72?!![]:_0x4579be;}var _0x3cfe18=_0x3f146e[_0x7393('0x111')](_0x5c76a0);if(_0x3cfe18[_0x7393('0x112')]){rpcDb['checkIsBlackList'](_[_0x7393('0x71')](_0x5c76a0[0x0],[_0x7393('0xfa'),_0x7393('0x113')]))['then'](function(_0x153485){_0x3f146e[_0x7393('0xf7')](_0x153485,_0x5c76a0[0x0],_0x119a72,_0x2448b8,_0x4579be)['then'](function(_0x2d9d47){_0x58bd7a(_0x2d9d47);})[_0x7393('0x78')](function(_0x42b1ba){_0x46abac(_0x42b1ba);});})[_0x7393('0x78')](function(_0x45feb4){ut[_0x7393('0x5b')](_0x7393('0x114'),_0x45feb4);_0x46abac(ut['message'](_0x7393('0x115'),_0x2448b8,_0x4579be));});}else{_0x46abac(ut['message'](_0x3cfe18[_0x7393('0x59')],_0x2448b8,_0x4579be));}})[_0x7393('0x78')](function(_0x2324bb){ut[_0x7393('0x5b')](_0x7393('0x116'),_0x2324bb);_0x46abac(ut[_0x7393('0x59')](_0x7393('0x115'),![],!![]));});});};Preview[_0x7393('0xf')]['validateContact']=function(_0x1458a0){if(_[_0x7393('0x69')](_0x1458a0)||_[_0x7393('0xfc')](_0x1458a0)||!_[_0x7393('0x69')](_0x1458a0[0x0][_0x7393('0x85')])&&_[_0x7393('0x69')](_0x1458a0[0x0][_0x7393('0x85')][_0x7393('0x4e')])){ut['logger'](_0x7393('0x117'),_0x1458a0);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x159e40=this[_0x7393('0x11')][_0x1458a0[0x0][_0x7393('0x6c')]['name']];_0x159e40[_0x7393('0x59')]=_0x7393('0x96');if(_['isNil'](_0x159e40)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x159e40);return{'isValid':![],'message':_0x7393('0x118')};}if(!this['isTrunkReachable'](_0x159e40[_0x7393('0x4d')])){ut[_0x7393('0x5b')](_0x7393('0x119'),'campaign\x20Name:\x20'+_0x159e40[_0x7393('0x4e')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x7393('0x94')](_0x159e40[_0x7393('0x95')])){ut['logger'](_0x7393('0x119'),_0x159e40['name']+_0x7393('0x11a'));return{'isValid':![],'message':_0x7393('0x11b')};}}if(!ut['isActive'](_0x159e40[_0x7393('0x2d')])){ut[_0x7393('0x5b')](_0x7393('0x11c'),_0x159e40[_0x7393('0x4e')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x7393('0x11d')+_0x159e40[_0x7393('0x4e')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x7393('0x11e')};};Preview['prototype'][_0x7393('0xfd')]=function(_0x2db944,_0x45f3b7,_0x31cdb3,_0x57ad6f){var _0x3aaf24=this;return new BPromise(function(_0x74e1f,_0x1d9600){var _0x4a9b35=_0x2db944[_0x7393('0xab')];var _0x4fbd1d=_0x3aaf24[_0x7393('0x94')](_0x45f3b7[_0x7393('0x4d')])?util[_0x7393('0x52')](_0x7393('0x11f'),_0x45f3b7[_0x7393('0x4d')]['name'],_['isNil'](_0x45f3b7[_0x7393('0x31')])?'':_0x45f3b7['dialPrefix'][_0x7393('0x120')]()||'',_0x45f3b7['dialCutDigit']>0x0?_0x31cdb3['Contact'][_0x7393('0xf9')][_0x7393('0x121')](_0x45f3b7[_0x7393('0x122')]):_0x31cdb3[_0x7393('0xf8')][_0x7393('0xf9')]):util[_0x7393('0x52')]('SIP/%s/%s%s',_[_0x7393('0x69')](_0x45f3b7[_0x7393('0x95')])?_0x45f3b7[_0x7393('0x4d')][_0x7393('0x4e')]:_0x45f3b7[_0x7393('0x95')][_0x7393('0x4e')],_[_0x7393('0x69')](_0x45f3b7['dialPrefix'])?'':_0x45f3b7['dialPrefix'][_0x7393('0x120')]()||'',_0x45f3b7[_0x7393('0x122')]>0x0?_0x31cdb3[_0x7393('0xf8')][_0x7393('0xf9')][_0x7393('0x121')](_0x45f3b7[_0x7393('0x122')]):_0x31cdb3[_0x7393('0xf8')]['phone']);var _0x4ba2d0=_0x3aaf24[_0x7393('0x94')](_0x45f3b7[_0x7393('0x4d')])?ut[_0x7393('0x123')](_0x45f3b7[_0x7393('0x4d')][_0x7393('0x50')],_0x45f3b7[_0x7393('0x2f')],_0x45f3b7[_0x7393('0x124')]>0x0?ut[_0x7393('0x125')](_0x45f3b7[_0x7393('0x30')],_0x45f3b7[_0x7393('0x124')]):_0x45f3b7[_0x7393('0x30')]):ut[_0x7393('0x123')](_[_0x7393('0x69')](_0x45f3b7[_0x7393('0x95')])?_0x45f3b7[_0x7393('0x4d')][_0x7393('0x50')]:_0x45f3b7['TrunkBackup'][_0x7393('0x50')],_0x45f3b7['dialOriginateCallerIdName'],_0x45f3b7[_0x7393('0x124')]>0x0?ut[_0x7393('0x125')](_0x45f3b7['dialOriginateCallerIdNumber'],_0x45f3b7[_0x7393('0x124')]):_0x45f3b7[_0x7393('0x30')]);if(_0x4ba2d0){_0x2db944['originatecalleridname']=ut[_0x7393('0x126')](_0x4ba2d0);_0x2db944['originatecalleridnum']=ut[_0x7393('0x127')](_0x4ba2d0);}var _0x3f8816=ut[_0x7393('0x128')](_0x45f3b7,_0x31cdb3,_0x4fbd1d,_0x4ba2d0,_0x4a9b35,_0x2db944);_['merge'](_0x2db944,ut[_0x7393('0x129')](_0x3f8816));_0x2db944[_0x7393('0x12a')]=moment()[_0x7393('0x52')](_0x7393('0x8a'));ami[_0x7393('0x75')](ut['variablesAction'](_0x2db944,_0x45f3b7,_0x3f8816,_0x2db944[_0x7393('0xa5')],_0x57ad6f))[_0x7393('0x81')](function(_0x56c1a4){_0x45f3b7[_0x7393('0x47')]+=0x1;logger[_0x7393('0x6a')]('[originated][increment]',_0x4a9b35,_0x7393('0xac'),_0x45f3b7[_0x7393('0x4e')],_0x7393('0x6e'),_0x45f3b7[_0x7393('0x47')]);_0x74e1f(_0x56c1a4);})['catch'](function(_0x4dcc39){ut['logAgent'](_0x2db944,0xe,_0x7393('0x12b'));rpcDb['createAgentHistory'](_0x2db944,_0x7393('0x12c'));_0x1d9600(_0x4dcc39);});});};Preview[_0x7393('0xf')]['syncNewExten']=function(_0x1f6895){if(this[_0x7393('0x13')][_0x1f6895[_0x7393('0xa6')]]){this[_0x7393('0x13')][_0x1f6895[_0x7393('0xa6')]][_0x7393('0x77')]=_0x1f6895[_0x7393('0x77')];}};Preview[_0x7393('0xf')][_0x7393('0x17')]=function(_0x11c9e9){var _0x349e05=this;var _0x31b4ed=this[_0x7393('0x13')][_0x11c9e9[_0x7393('0x12d')]];if(_0x31b4ed){if(_0x31b4ed['lookAgent']&&this[_0x7393('0x14')][_0x31b4ed['lookAgent']]){ut['logLookAgent'](_0x31b4ed,this[_0x7393('0x14')][_0x31b4ed[_0x7393('0x12e')]][_0x7393('0x4e')],this[_0x7393('0x14')][_0x31b4ed[_0x7393('0x12e')]]['id']);}var _0xd0502c=_[_0x7393('0x12f')](_0x31b4ed);_0xd0502c[_0x7393('0xa8')]=moment()[_0x7393('0x52')](_0x7393('0x8a'));var _0x42085b=_0x349e05[_0x7393('0x11')][_0x31b4ed[_0x7393('0x6d')]];if(ut[_0x7393('0x130')](_0x11c9e9[_0x7393('0x131')])){if(_0x31b4ed[_0x7393('0xc1')]){rpcDb[_0x7393('0x10e')](_0x31b4ed[_0x7393('0x100')]);}if(_0x31b4ed[_0x7393('0xa5')]){rpcDb[_0x7393('0x89')](_0x31b4ed[_0x7393('0x100')]);}ami['emit']('custom:agentringnoanswer',ut[_0x7393('0x9c')](_0x31b4ed,_0x7393('0x132'),this[_0x7393('0x11')][_0x31b4ed[_0x7393('0x6d')]]));this[_0x7393('0xe6')](_0xd0502c,_0x42085b,_0x11c9e9);}else{_0x31b4ed[_0x7393('0x12a')]=moment()[_0x7393('0x52')]('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0xd0502c,0x4,_0x7393('0xb4'));rpcDb[_0x7393('0xea')](_0xd0502c,_0x7393('0x133'));}}};Preview[_0x7393('0xf')]['syncHangup']=function(_0x4e6c4c){var _0x385333=this;var _0x553649=this[_0x7393('0x13')][_0x4e6c4c['linkedid']];var _0x49b58e;if(_0x553649){_0x49b58e=this[_0x7393('0x11')][_0x553649['queue']];logger[_0x7393('0x6a')](_0x7393('0x134'),_0x4e6c4c[_0x7393('0xa6')],_0x7393('0xac'),_0x49b58e[_0x7393('0x4e')],_0x7393('0x6f'),_0x49b58e[_0x7393('0x24')]);}if(this[_0x7393('0x13')][_0x4e6c4c[_0x7393('0xa6')]]&&_0x4e6c4c[_0x7393('0xa6')]!==_0x4e6c4c['uniqueid']){if(_0x4e6c4c[_0x7393('0x135')]==='16'&&this[_0x7393('0x13')][_0x4e6c4c[_0x7393('0xa6')]][_0x7393('0x70')]){this[_0x7393('0x136')](_0x4e6c4c,_0x4e6c4c[_0x7393('0xa6')],_0x4e6c4c[_0x7393('0x135')]);}else if(this['actions'][_0x4e6c4c[_0x7393('0xa6')]][_0x7393('0x70')]){logger['info'](_0x7393('0x137'),_0x4e6c4c[_0x7393('0xa6')],_0x4e6c4c[_0x7393('0x135')],_0x7393('0xac'),_0x49b58e[_0x7393('0x4e')],_0x7393('0x6f'),_0x49b58e['pTalking']);this[_0x7393('0x136')](_0x4e6c4c,_0x4e6c4c[_0x7393('0xa6')],_0x4e6c4c[_0x7393('0x135')]);}}else if(_0x553649&&_[_0x7393('0x69')](_0x553649[_0x7393('0x138')])&&_0x49b58e['dialQueueProject']&&_0x4e6c4c[_0x7393('0xa6')]===_0x4e6c4c[_0x7393('0xab')]&&_['isNil'](_0x4e6c4c[_0x7393('0xe8')])&&_0x4e6c4c[_0x7393('0x135')]==='16'&&_0x4e6c4c[_0x7393('0x139')]==='6'&&_[_0x7393('0x13a')](_0x553649['transfer'])){if(_0x553649[_0x7393('0xc1')]){rpcDb['unlockContact'](_0x553649[_0x7393('0x100')]);}if(_0x553649[_0x7393('0xa5')]){rpcDb[_0x7393('0x89')](_0x553649[_0x7393('0x100')]);}_0x4e6c4c[_0x7393('0xe8')]='22';this[_0x7393('0xe6')](_0x553649,_0x49b58e,_0x4e6c4c);}else if(_0x553649&&_0x553649[_0x7393('0x13b')]){if(_0x4e6c4c[_0x7393('0x135')]==='16'&&this[_0x7393('0x13')][_0x4e6c4c[_0x7393('0xa6')]][_0x7393('0x70')]){logger[_0x7393('0x6a')](_0x7393('0x13c'),_0x4e6c4c[_0x7393('0xa6')],_0x4e6c4c[_0x7393('0x135')],_0x7393('0xac'),_0x49b58e[_0x7393('0x4e')],_0x7393('0x6f'),_0x49b58e[_0x7393('0x24')]);this[_0x7393('0x136')](_0x4e6c4c,_0x4e6c4c[_0x7393('0xa6')],_0x4e6c4c[_0x7393('0x135')]);}else if(this[_0x7393('0x13')][_0x4e6c4c[_0x7393('0xa6')]][_0x7393('0x70')]){logger[_0x7393('0x6a')](_0x7393('0x137'),_0x4e6c4c['linkedid'],_0x4e6c4c[_0x7393('0x135')],_0x7393('0xac'),_0x49b58e[_0x7393('0x4e')],_0x7393('0x6f'),_0x49b58e[_0x7393('0x24')]);this[_0x7393('0x136')](_0x4e6c4c,_0x4e6c4c[_0x7393('0xa6')],_0x4e6c4c[_0x7393('0x135')]);}}};Preview['prototype'][_0x7393('0x13d')]=function(_0xba3e38){if(this[_0x7393('0x13')][_0xba3e38[_0x7393('0x13e')]]&&_0xba3e38['destlinkedid']!==_0xba3e38['destuniqueid']){this[_0x7393('0x136')](_0xba3e38,_0xba3e38[_0x7393('0x13e')],_0xba3e38['dialstatus']);}};Preview[_0x7393('0xf')]['syncHangupRequest']=function(_0x30a2da){if(this[_0x7393('0x13')][_0x30a2da['linkedid']]&&_0x30a2da[_0x7393('0xa6')]!==_0x30a2da[_0x7393('0xab')]&&!this[_0x7393('0x13')][_0x30a2da[_0x7393('0xa6')]][_0x7393('0x70')]){if(_0x30a2da[_0x7393('0x135')]==='1'){this[_0x7393('0x136')](_0x30a2da,_0x30a2da[_0x7393('0xa6')],_0x30a2da[_0x7393('0x135')]);}}};Preview[_0x7393('0xf')][_0x7393('0x13f')]=function(_0x59315f,_0x84b553,_0x1ff2c4){if(this['actions'][_0x59315f]){if(_[_0x7393('0x69')](this[_0x7393('0x13')][_0x59315f][_0x7393('0x140')])){this[_0x7393('0x13')][_0x59315f][_0x7393('0x140')]={};}this[_0x7393('0x13')][_0x59315f][_0x7393('0x140')][_0x84b553]=_0x1ff2c4;}};Preview[_0x7393('0xf')]['syncVarSet']=function(_0x12aa32){try{if(!_[_0x7393('0x69')](_0x12aa32)){if(ut[_0x7393('0x141')](_['keys'](_0x12aa32[_0x7393('0x142')])[0x0])){this[_0x7393('0x13f')](_0x12aa32[_0x7393('0xab')],_[_0x7393('0x143')](_0x12aa32[_0x7393('0x142')])[0x0],_0x12aa32[_0x7393('0x144')]);}}}catch(_0x24943a){logger[_0x7393('0x145')](_0x7393('0x146'),util['inspect'](_0x24943a,{'showHidden':![],'depth':null}));}};Preview[_0x7393('0xf')][_0x7393('0x1c')]=function(_0x239bc0){if(_0x239bc0){if(this[_0x7393('0x13')][_0x239bc0[_0x7393('0x147')]]){this[_0x7393('0x13')][_0x239bc0[_0x7393('0x147')]]['transfer']=!![];}}};Preview[_0x7393('0xf')]['syncBlindTransfer']=function(_0x445003){if(_0x445003){if(this[_0x7393('0x13')][_0x445003[_0x7393('0x148')]]){this[_0x7393('0x13')][_0x445003['transfererlinkedid']][_0x7393('0x13b')]=!![];}}};module[_0x7393('0x149')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 0e35857..51629b2 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 _0xd797=['[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','error','inspect','then','createHistory','[createHistory]\x20','resolve','moveContactManagedDialer','[checkIsBlackList]\x20','getContactPreview','catch','createAgentHistory','createCustomerHistory','rescheduleContact','UserId'];(function(_0x16c614,_0x543ddc){var _0x5ef2a1=function(_0xc75840){while(--_0xc75840){_0x16c614['push'](_0x16c614['shift']());}};_0x5ef2a1(++_0x543ddc);}(_0xd797,0x11d));var _0x7d79=function(_0x206c93,_0x41d4e8){_0x206c93=_0x206c93-0x0;var _0xd1ec4b=_0xd797[_0x206c93];return _0xd1ec4b;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x7d79('0x0'))(_0x7d79('0x1'));var _=require(_0x7d79('0x2'));var cmHopper=require(_0x7d79('0x3'));var cmHopperFinal=require(_0x7d79('0x4'));var cmHopperHistory=require(_0x7d79('0x5'));var cmHopperBlack=require(_0x7d79('0x6'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x4ff21f){return function(_0x48bc86){logger[_0x7d79('0x7')](_0x4ff21f,util[_0x7d79('0x8')](_0x48bc86,{'showHidden':![],'depth':null}));};}function create(_0x3a7783){return BPromise['resolve']()[_0x7d79('0x9')](cmHopperHistory[_0x7d79('0xa')](_0x3a7783))['catch'](loggerCatch(_0x7d79('0xb')));}function createAgent(_0x32ebff){return BPromise[_0x7d79('0xc')]()['then'](agentReportPreview[_0x7d79('0xa')](_0x32ebff))['catch'](loggerCatch(_0x7d79('0xb')));}function moveContact(_0x14bdde){return BPromise[_0x7d79('0xc')]()[_0x7d79('0x9')](cmHopper[_0x7d79('0xd')](_0x14bdde,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x5f13ab){return BPromise[_0x7d79('0xc')]()[_0x7d79('0x9')](cmHopperBlack['checkIsBlackList'](_0x5f13ab))['catch'](loggerCatch(_0x7d79('0xe')));};exports[_0x7d79('0xf')]=function(_0x473340){return BPromise[_0x7d79('0xc')]()['then'](cmHopper['getContactPreview'](_0x473340))[_0x7d79('0x10')](loggerCatch('[getContactPreview]\x20'));};exports[_0x7d79('0xa')]=function(_0x898b8f,_0x435d4a){create(_0x898b8f)[_0x7d79('0x10')](loggerCatch(_0x435d4a));moveContact(_0x898b8f)[_0x7d79('0x10')](loggerCatch(_0x435d4a));};exports[_0x7d79('0x11')]=function(_0x16bbb5,_0x347a48){createAgent(_0x16bbb5)[_0x7d79('0x10')](loggerCatch(_0x347a48));};exports[_0x7d79('0x12')]=function(_0x53ed28,_0x4a9c8e){create(_0x53ed28)[_0x7d79('0x10')](loggerCatch(_0x4a9c8e));};exports['createCustomerFinal']=function(_0x2558e5,_0x186dec){moveContact(_0x2558e5)[_0x7d79('0x10')](loggerCatch(_0x186dec));};exports[_0x7d79('0x13')]=function(_0x4a610c,_0x1b7182,_0x44db27){if(_0x1b7182){_0x4a610c[_0x7d79('0x14')]=null;}if(_0x44db27){_0x4a610c['active']=![];}return BPromise[_0x7d79('0xc')]()[_0x7d79('0x9')](cmHopper[_0x7d79('0x13')](_0x4a610c))[_0x7d79('0x10')](loggerCatch(_0x7d79('0x15')));};exports[_0x7d79('0x16')]=function(_0x3e7031){return BPromise[_0x7d79('0xc')]()[_0x7d79('0x9')](cmHopper[_0x7d79('0x16')](_0x3e7031))[_0x7d79('0x10')](loggerCatch(_0x7d79('0x17')));};exports[_0x7d79('0x18')]=function(_0x10c28c){return BPromise['resolve']()[_0x7d79('0x9')](cmHopper[_0x7d79('0x18')]({'UserId':null},_0x10c28c,0x1))[_0x7d79('0x10')](loggerCatch(_0x7d79('0x19')));};exports['disableContact']=function(_0x74df63){return BPromise[_0x7d79('0xc')]()[_0x7d79('0x9')](cmHopper[_0x7d79('0x18')]({'active':![]},_0x74df63,0x1))[_0x7d79('0x10')](loggerCatch('[activeContact]\x20'));};exports[_0x7d79('0x1a')]=function(_0x828fc7){var _0x1288bf={};_0x1288bf['type']=_0x828fc7[_0x7d79('0x1b')];_0x1288bf['uniqueid']=_0x828fc7[_0x7d79('0x1c')];_0x1288bf['calleridnum']=_0x828fc7[_0x7d79('0x1d')];_0x1288bf[_0x7d79('0x1e')]=_0x828fc7[_0x7d79('0x1e')];_0x1288bf[_0x7d79('0x1f')]=_0x828fc7['queue'];_0x1288bf[_0x7d79('0x20')]=_0x828fc7[_0x7d79('0x21')];_0x1288bf['queuecallerleaveAt']=_0x828fc7[_0x7d79('0x21')];_0x1288bf[_0x7d79('0x22')]=0x1;_0x1288bf[_0x7d79('0x23')]=_0x828fc7[_0x7d79('0x24')];_0x1288bf[_0x7d79('0x25')]=_0x828fc7[_0x7d79('0x26')];_0x1288bf[_0x7d79('0x27')]=_0x7d79('0x28');_0x1288bf[_0x7d79('0x29')]=_0x7d79('0x2a');_0x1288bf[_0x7d79('0x2b')]=0x0;_0x1288bf[_0x7d79('0x2c')]=0x1;_0x1288bf[_0x7d79('0x2d')]=_0x828fc7[_0x7d79('0x26')];_0x1288bf['queuecallerexitreason']=_0x7d79('0x2e');return BPromise['resolve']()[_0x7d79('0x9')](voiceQueueReport['create'](_0x1288bf))[_0x7d79('0x10')](loggerCatch(_0x7d79('0x2f')));};exports['getContactRecallMe']=function(_0x4d6014,_0xa64101){return BPromise[_0x7d79('0xc')]()[_0x7d79('0x9')](cmHopper['getContactRecallMe'](_0x4d6014,_0xa64101))['catch'](loggerCatch(_0x7d79('0x30')));};exports[_0x7d79('0x31')]=function(_0x208b78){return BPromise[_0x7d79('0xc')]()[_0x7d79('0x9')](cmHopper[_0x7d79('0x13')](_0x208b78,!![],!![]))[_0x7d79('0x10')](loggerCatch(_0x7d79('0x32')));}; \ No newline at end of file +var _0x85b2=['createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','membername','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','catch','[createHistory]\x20','resolve'];(function(_0x214626,_0x24fed9){var _0x2b39bb=function(_0xb9abfd){while(--_0xb9abfd){_0x214626['push'](_0x214626['shift']());}};_0x2b39bb(++_0x24fed9);}(_0x85b2,0xfa));var _0x285b=function(_0x56554d,_0x3ebfa4){_0x56554d=_0x56554d-0x0;var _0x268f65=_0x85b2[_0x56554d];return _0x268f65;};'use strict';var util=require(_0x285b('0x0'));var BPromise=require(_0x285b('0x1'));var logger=require(_0x285b('0x2'))(_0x285b('0x3'));var _=require(_0x285b('0x4'));var cmHopper=require(_0x285b('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x285b('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x285b('0x7'));var voiceQueueReport=require(_0x285b('0x8'));function loggerCatch(_0x13a099){return function(_0x581903){logger[_0x285b('0x9')](_0x13a099,util[_0x285b('0xa')](_0x581903,{'showHidden':![],'depth':null}));};}function create(_0x4176e2){return BPromise['resolve']()[_0x285b('0xb')](cmHopperHistory['createHistory'](_0x4176e2))[_0x285b('0xc')](loggerCatch(_0x285b('0xd')));}function createAgent(_0x405ea3){return BPromise[_0x285b('0xe')]()[_0x285b('0xb')](agentReportPreview[_0x285b('0xf')](_0x405ea3))[_0x285b('0xc')](loggerCatch(_0x285b('0xd')));}function moveContact(_0x14640f){return BPromise['resolve']()[_0x285b('0xb')](cmHopper[_0x285b('0x10')](_0x14640f,!![]))['catch'](loggerCatch(_0x285b('0x11')));}exports['checkIsBlackList']=function(_0x16c4a4){return BPromise['resolve']()[_0x285b('0xb')](cmHopperBlack[_0x285b('0x12')](_0x16c4a4))[_0x285b('0xc')](loggerCatch(_0x285b('0x13')));};exports[_0x285b('0x14')]=function(_0x5e3543){return BPromise['resolve']()[_0x285b('0xb')](cmHopper['getContactPreview'](_0x5e3543))['catch'](loggerCatch(_0x285b('0x15')));};exports[_0x285b('0xf')]=function(_0x36f98b,_0x9622db){create(_0x36f98b)['catch'](loggerCatch(_0x9622db));moveContact(_0x36f98b)['catch'](loggerCatch(_0x9622db));};exports[_0x285b('0x16')]=function(_0x4dfa8b,_0x4b798d){createAgent(_0x4dfa8b)[_0x285b('0xc')](loggerCatch(_0x4b798d));};exports[_0x285b('0x17')]=function(_0x938600,_0x5f4708){create(_0x938600)['catch'](loggerCatch(_0x5f4708));};exports[_0x285b('0x18')]=function(_0xfecf3a,_0x1756b2){moveContact(_0xfecf3a)[_0x285b('0xc')](loggerCatch(_0x1756b2));};exports[_0x285b('0x19')]=function(_0x43f31d,_0x47a1f0,_0x3fce2a){if(_0x47a1f0){_0x43f31d[_0x285b('0x1a')]=null;}if(_0x3fce2a){_0x43f31d[_0x285b('0x1b')]=![];}return BPromise[_0x285b('0xe')]()[_0x285b('0xb')](cmHopper[_0x285b('0x19')](_0x43f31d))[_0x285b('0xc')](loggerCatch(_0x285b('0x1c')));};exports[_0x285b('0x1d')]=function(_0x5049a6){return BPromise['resolve']()['then'](cmHopper[_0x285b('0x1d')](_0x5049a6))[_0x285b('0xc')](loggerCatch('[countReScheduled]\x20'));};exports[_0x285b('0x1e')]=function(_0x1604f6){return BPromise[_0x285b('0xe')]()['then'](cmHopper[_0x285b('0x1e')]({'UserId':null},_0x1604f6,0x1))[_0x285b('0xc')](loggerCatch(_0x285b('0x1f')));};exports[_0x285b('0x20')]=function(_0x5dff67){return BPromise[_0x285b('0xe')]()['then'](cmHopper[_0x285b('0x1e')]({'active':![]},_0x5dff67,0x1))[_0x285b('0xc')](loggerCatch(_0x285b('0x21')));};exports['crateCustomerReportQueue']=function(_0x335bf7){var _0x3487b6={};_0x3487b6[_0x285b('0x22')]=_0x335bf7[_0x285b('0x22')];_0x3487b6[_0x285b('0x23')]=_0x335bf7[_0x285b('0x23')];_0x3487b6[_0x285b('0x24')]=_0x335bf7['calleridnum'];_0x3487b6[_0x285b('0x25')]=_0x335bf7[_0x285b('0x25')];_0x3487b6['queue']=_0x335bf7[_0x285b('0x26')];_0x3487b6[_0x285b('0x27')]=_0x335bf7[_0x285b('0x28')];_0x3487b6[_0x285b('0x29')]=_0x335bf7['answertime'];_0x3487b6['queuecallercomplete']=0x1;_0x3487b6['queuecallercompleteAt']=_0x335bf7['endtime'];_0x3487b6['connectedlinename']=_0x335bf7[_0x285b('0x2a')];_0x3487b6['context']=_0x285b('0x2b');_0x3487b6[_0x285b('0x2c')]=_0x285b('0x2d');_0x3487b6['holdtime']=0x0;_0x3487b6[_0x285b('0x2e')]=0x1;_0x3487b6[_0x285b('0x2f')]=_0x335bf7['membername'];_0x3487b6[_0x285b('0x30')]=_0x285b('0x31');return BPromise['resolve']()[_0x285b('0xb')](voiceQueueReport[_0x285b('0x32')](_0x3487b6))[_0x285b('0xc')](loggerCatch(_0x285b('0x33')));};exports['getContactRecallMe']=function(_0xc2f420,_0xb893d9){return BPromise[_0x285b('0xe')]()['then'](cmHopper[_0x285b('0x34')](_0xc2f420,_0xb893d9))[_0x285b('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x48fc35){return BPromise[_0x285b('0xe')]()[_0x285b('0xb')](cmHopper[_0x285b('0x19')](_0x48fc35,!![],!![]))[_0x285b('0xc')](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 ee9cbcc..b1fce4f 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 _0x7184=['callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','extractCalleridName','match','extractCalleridNumber','lodash','moment','../../../../config/logger','preview','env','127.0.0.1','milliseconds','diff','seconds','logger','info','inspect','loggerError','error','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject','NONE','dialQueueProject2','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','state','statedesc','Blacklist','starttime','endtime','logAgent','responsetime','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','Failure','variablesAction','RECALL','uniqueid','channelAgent','from-sip','totalGlobal','countbusyretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','queue','interface','voice','mandatoryDisposition','buildAcw','agentReadyId','hasOwnProperty','not_inuse','status','reachable','push','createBody','filterKey','idContact','type','dialAnswer','countcongestionretry','countglobal'];(function(_0x4504ef,_0x4a6b6d){var _0x12fe6c=function(_0x36527e){while(--_0x36527e){_0x4504ef['push'](_0x4504ef['shift']());}};_0x12fe6c(++_0x4a6b6d);}(_0x7184,0x124));var _0x4718=function(_0x56f187,_0x2eec20){_0x56f187=_0x56f187-0x0;var _0x1b8b67=_0x7184[_0x56f187];return _0x1b8b67;};'use strict';var util=require('util');var _=require(_0x4718('0x0'));var moment=require(_0x4718('0x1'));var logger=require(_0x4718('0x2'))(_0x4718('0x3'));var ipAgi=process[_0x4718('0x4')]['XCALLY_IP_AGI']||_0x4718('0x5');function getSeconds(_0x13493b,_0x4c83d9){var _0x514429=moment(_0x13493b)[_0x4718('0x6')](0x0);var _0x3d9828=moment(_0x4c83d9)[_0x4718('0x6')](0x0);return _0x514429[_0x4718('0x7')](_0x3d9828,_0x4718('0x8'));}exports['loggerCatch']=function(_0x4cd1ab){return function(_0x368d4b){logger['error'](_0x4cd1ab,util['inspect'](_0x368d4b,{'showHidden':![],'depth':null}));};};exports[_0x4718('0x9')]=function(_0x570791,_0x3e9a89){logger[_0x4718('0xa')](_0x570791,util[_0x4718('0xb')](_0x3e9a89,{'showHidden':![],'depth':null}));};exports[_0x4718('0xc')]=function(_0x2326a5,_0x246a1b){logger[_0x4718('0xd')](_0x2326a5,util[_0x4718('0xb')](_0x246a1b,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x1180c9){return function(_0xa63a52){logger[_0x4718('0xa')](_0x1180c9,util[_0x4718('0xb')](_0xa63a52,{'showHidden':![],'depth':null}));};};exports[_0x4718('0xe')]=function(_0x211fd0,_0x1501db,_0x474de2){return{'message':_0x211fd0,'unlock':_0x1501db,'active':_0x474de2};};exports[_0x4718('0xf')]=function(_0x567f28,_0x375f91,_0x119818){if(!_[_0x4718('0x10')](_0x119818)&&_0x4718('0x11')===typeof _0x119818&&!_[_0x4718('0x12')](_0x119818)){if(!_[_0x4718('0x10')](_0x375f91)&&_0x4718('0x11')===typeof _0x375f91&&!_[_0x4718('0x12')](_0x375f91)){return util[_0x4718('0x13')](_0x4718('0x14'),_0x375f91,_0x119818);}return util[_0x4718('0x13')](_0x4718('0x14'),_0x119818,_0x119818);}if(!_[_0x4718('0x10')](_0x567f28)&&'string'===typeof _0x567f28&&!_['isEmpty'](_0x567f28)){return _0x567f28;}return _0x4718('0x15');};exports['isActive']=function(_0x471cd4){if(_[_0x4718('0x16')](_0x471cd4)){return![];}return _0x471cd4;};exports[_0x4718('0x17')]=function(_0x65f39e,_0x1d81e2,_0x30ce97,_0x57a7d7,_0x2bb53c,_0x4fa95b){var _0x1f6311={'XMD-QUEUE':_0x1d81e2['Queue']?_0x1d81e2[_0x4718('0x18')][_0x4718('0x19')]:'','XMD-CALLERID':_0x57a7d7,'XMD-CALLERID-PREVIEW':_0x4fa95b?util['format'](_0x4718('0x14'),_0x4fa95b[_0x4718('0x1a')],_0x4fa95b[_0x4718('0x1b')]):_0x57a7d7,'XMD-DIALID':_0x2bb53c,'XMD-CONTACTID':_0x1d81e2[_0x4718('0x1c')],'XMD-CDRTYPE':_0x4718('0x1d'),'CALLERID(all)':_0x57a7d7,'XMD-VOICEQUEUEID':_0x1d81e2[_0x4718('0x1e')],'XMD-DIALCHANNEL':_0x30ce97,'XMD-DIALTIMEOUT':_0x65f39e['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x4718('0x13')](_0x4718('0x1f'),_0x65f39e['dialQueueProject2']?'g':'',_[_0x4718('0x12')](_0x65f39e['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x65f39e['dialPreviewUrl']||'','XMD-AGI':_0x65f39e['dialQueueProject']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x65f39e[_0x4718('0x20')]):_0x4718('0x21'),'XMD-AGIAFTER':_0x65f39e[_0x4718('0x22')]?util[_0x4718('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x65f39e['dialQueueProject2']):_0x4718('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x4fa95b?_0x4fa95b[_0x4718('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x4fa95b?_0x4fa95b['originatecalleridname']:'','XMD-DESTINATION':_0x4718('0x24'),'SIPADDHEADER':_0x4718('0x25')};if(!_[_0x4718('0x12')](_0x65f39e[_0x4718('0x26')])){_0x1f6311[util[_0x4718('0x13')]('%s',_0x4718('0x27'))]=_0x65f39e['monitor_format'];_0x1f6311[util[_0x4718('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x2bb53c;}if(_0x1d81e2&&_0x1d81e2[_0x4718('0x28')]){for(var _0x17cba2 in _0x1d81e2[_0x4718('0x28')]){if(_0x1d81e2['Contact']['hasOwnProperty'](_0x17cba2)){if(!_[_0x4718('0x16')](_0x1d81e2['Contact'][_0x17cba2])&&_0x17cba2!=='id'&&_0x17cba2!==_0x4718('0x29')&&_0x17cba2!==_0x4718('0x2a')&&_0x17cba2!==_0x4718('0x2b')){_0x1f6311[util[_0x4718('0x13')](_0x4718('0x2c'),_0x4718('0x2d'),_[_0x4718('0x2e')](_0x17cba2))]=_0x1d81e2[_0x4718('0x28')][_0x17cba2];}}}}return _0x1f6311;};exports[_0x4718('0x2f')]=function(_0x5a7934){var _0x2d7215={};for(var _0x1ca7b7 in _0x5a7934){if(_0x5a7934['hasOwnProperty'](_0x1ca7b7)){_0x2d7215[util[_0x4718('0x13')]('%s',_[_0x4718('0x30')](_0x1ca7b7))]=_0x5a7934[_0x1ca7b7];}}return{'variables':_0x2d7215};};exports[_0x4718('0x31')]=function(_0x28af9d,_0x28de2d){if(!_['isNil'](_0x28af9d)){if(_0x28af9d['hasOwnProperty']('originated')){if(_0x28af9d[_0x4718('0x32')]>0x0){_0x28af9d[_0x4718('0x32')]-=0x1;}else{logger[_0x4718('0xd')](_0x4718('0x33'),_0x28de2d);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x28de2d);}};exports[_0x4718('0x34')]=function(_0x1abeb5){var _0x439efa=moment()[_0x4718('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x1abeb5[_0x4718('0x35')]=0xd;_0x1abeb5[_0x4718('0x36')]=_0x4718('0x37');_0x1abeb5[_0x4718('0x38')]=_0x439efa;_0x1abeb5['responsetime']=_0x439efa;_0x1abeb5[_0x4718('0x39')]=_0x439efa;};exports[_0x4718('0x3a')]=function(_0x40801c,_0x22a065,_0x3a20f3){var _0x4edb05=moment()[_0x4718('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x40801c[_0x4718('0x35')]=_0x22a065;_0x40801c[_0x4718('0x36')]=_0x3a20f3;_0x40801c[_0x4718('0x3b')]=_0x4edb05;_0x40801c[_0x4718('0x3c')]=getSeconds(_0x40801c[_0x4718('0x3b')],_0x40801c[_0x4718('0x38')]);};exports[_0x4718('0x3d')]=function(_0x2bcdb,_0xc7f5ba,_0x23caea){_0x2bcdb[_0x4718('0x3e')]=_0xc7f5ba;_0x2bcdb[_0x4718('0x3f')]=_0x23caea;};exports[_0x4718('0x40')]=function(_0x390473,_0x599a9e,_0x30e7df){var _0x52d0da=moment()[_0x4718('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x390473[_0x4718('0x35')]=_0x599a9e;_0x390473[_0x4718('0x36')]=_0x30e7df;_0x390473[_0x4718('0x3b')]=_0x390473['responsetime']?_0x390473[_0x4718('0x3b')]:_0x52d0da;_0x390473[_0x4718('0x39')]=_0x390473[_0x4718('0x39')]?_0x390473[_0x4718('0x39')]:_0x52d0da;_0x390473[_0x4718('0x3c')]=getSeconds(_0x390473['responsetime']||0x0,_0x390473[_0x4718('0x38')]||0x0);_0x390473[_0x4718('0x41')]=_0x390473[_0x4718('0x42')]?getSeconds(_0x390473[_0x4718('0x39')],_0x390473[_0x4718('0x42')]):0x0;};exports['isFailure']=function(_0x376738){return _0x376738===_0x4718('0x43');};exports[_0x4718('0x44')]=function(_0x52e268,_0x27d1be,_0x19fc57,_0x496ca3,_0x6d4a9f){var _0x54f2b2=_0x496ca3?_0x4718('0x45'):_0x52e268[_0x4718('0x1a')];_0x54f2b2=_0x6d4a9f?'BOOKED':_0x54f2b2;return{'actionid':_0x52e268[_0x4718('0x46')],'action':'originate','channel':_0x52e268[_0x4718('0x47')],'callerid':util[_0x4718('0x13')]('\x22%s\x22\x20<%s>',_0x54f2b2,_0x52e268[_0x4718('0x1b')]),'Exten':_0x4718('0x24'),'Context':_0x4718('0x48'),'Priority':'1','variable':_0x19fc57,'timeout':(_0x27d1be['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x52e268['uniqueid']};};exports[_0x4718('0x49')]=function(_0x486945){return _0x486945[_0x4718('0x4a')]+_0x486945['countcongestionretry']+_0x486945['countnoanswerretry']+_0x486945[_0x4718('0x4b')]+_0x486945['countnosuchnumberretry'];};exports[_0x4718('0x4c')]=function(_0x17a598){var _0x1ec921=_[_0x4718('0x4d')](_0x17a598);_0x1ec921[_0x4718('0x35')]=0xf;_0x1ec921[_0x4718('0x36')]=_0x4718('0x4e');return _0x1ec921;};exports[_0x4718('0x4f')]=function(_0x31cd22,_0x4aa99e,_0x3738bf){var _0x34a870={};_0x34a870[_0x4aa99e]=_0x31cd22[_0x4aa99e];_0x34a870[_0x4718('0x50')]=![];_0x34a870[_0x4718('0x51')]=moment()[_0x4718('0x52')](_0x3738bf,_0x4718('0x53'))[_0x4718('0x13')](_0x4718('0x54'));_0x34a870[_0x4718('0x1c')]=_0x31cd22['ContactId'];_0x34a870[_0x4718('0x55')]=_0x31cd22[_0x4718('0x55')];_0x34a870[_0x4718('0x1e')]=_0x31cd22[_0x4718('0x1e')]||undefined;return _0x34a870;};exports[_0x4718('0x56')]=function(_0x471ee8,_0x5b0235){if(!_[_0x4718('0x16')](_0x471ee8)){if(_0x471ee8[_0x4718('0x57')]>0x0){_0x471ee8[_0x4718('0x57')]-=0x1;}else{logger[_0x4718('0xd')](_0x5b0235,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x4718('0xd')](_0x5b0235,_0x4718('0x58'));}};exports['IsNotLoggedIn']=function(_0x2060a6){if(_0x2060a6<=0x0){return!![];}return![];};exports['buildObj']=function(_0x4a02b8,_0x21681d,_0x42cac4){_0x4a02b8['lastevent']=_0x21681d;_0x4a02b8['name']=_0x4a02b8[_0x4718('0x59')];_0x4a02b8[_0x4718('0x5a')]=_0x4a02b8['channelAgent'];_0x4a02b8['motionChannel']=_0x4718('0x5b');if(_0x42cac4){_0x4a02b8[_0x4718('0x5c')]=_0x42cac4['mandatoryDisposition'];}return _0x4a02b8;};exports[_0x4718('0x5d')]=function(_0x2951c6){var _0xe399a={};_0xe399a[_0x4718('0x59')]=_0x2951c6['queue'];_0xe399a[_0x4718('0x5a')]=_0x2951c6[_0x4718('0x47')];_0xe399a[_0x4718('0x46')]=_0x2951c6[_0x4718('0x46')];return _0xe399a;};exports[_0x4718('0x5e')]=function(_0x39ead6){var _0x32ee2=[];for(var _0x1a1467 in _0x39ead6){if(_0x39ead6[_0x4718('0x5f')](_0x1a1467)){if(!_[_0x4718('0x16')](_0x39ead6[_0x1a1467])&&_0x39ead6[_0x1a1467][_0x4718('0x35')]===_0x4718('0x60')&&_0x39ead6[_0x1a1467][_0x4718('0x61')]===_0x4718('0x62')){_0x32ee2[_0x4718('0x63')](_0x39ead6[_0x1a1467]['id']);}}}return _0x32ee2;};exports['getDiff']=function(_0xb1c986){var _0x8de6b2=moment()[_0x4718('0x6')](0x0);var _0x2f28cb=moment(_0xb1c986)['milliseconds'](0x0);return _0x8de6b2[_0x4718('0x7')](_0x2f28cb,'seconds');};exports[_0x4718('0x64')]=function(_0x2334d9){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2334d9[_0x4718('0x1c')],'ListId':_0x2334d9[_0x4718('0x55')],'VoiceQueueId':_0x2334d9[_0x4718('0x1e')]||undefined,'CampaignId':_0x2334d9['CampaignId']||undefined};};exports[_0x4718('0x65')]=function(_0x5c4e1d){if(_0x5c4e1d===_0x4718('0x46')||_0x5c4e1d===_0x4718('0x66')||_0x5c4e1d===_0x4718('0x59')||_0x5c4e1d===_0x4718('0x67')||_0x5c4e1d==='campaigntype'||_0x5c4e1d===_0x4718('0x68')||_0x5c4e1d===_0x4718('0x3e')||_0x5c4e1d===_0x4718('0x47')||_0x5c4e1d===_0x4718('0x1a')||_0x5c4e1d==='active'||_0x5c4e1d==='calleridnum'||_0x5c4e1d==='scheduledat'||_0x5c4e1d===_0x4718('0x4a')||_0x5c4e1d===_0x4718('0x69')||_0x5c4e1d==='countnoanswerretry'||_0x5c4e1d===_0x4718('0x6a')||_0x5c4e1d==='callback'||_0x5c4e1d===_0x4718('0x6b')||_0x5c4e1d===_0x4718('0x6c')||_0x5c4e1d===_0x4718('0x6d')||_0x5c4e1d==='ContactId'||_0x5c4e1d===_0x4718('0x55')||_0x5c4e1d===_0x4718('0x3f')||_0x5c4e1d==='VoiceQueueId'||_0x5c4e1d===_0x4718('0x6e')||_0x5c4e1d==='xmd-voicequeueid'||_0x5c4e1d===_0x4718('0x6f')||_0x5c4e1d===_0x4718('0x70')||_0x5c4e1d===_0x4718('0x71')||_0x5c4e1d===_0x4718('0x72')||_0x5c4e1d==='xmd-dialtimeout'||_0x5c4e1d===_0x4718('0x73')||_0x5c4e1d==='xmd-dialid'||_0x5c4e1d===_0x4718('0x74')||_0x5c4e1d==='xmd-contactid'||_0x5c4e1d===_0x4718('0x75')||_0x5c4e1d==='xmd-callerid'||_0x5c4e1d==='xmd-agiafter'||_0x5c4e1d===_0x4718('0x76')||_0x5c4e1d===_0x4718('0x77')||_0x5c4e1d===_0x4718('0x78')||_0x5c4e1d===_0x4718('0x79')||_0x5c4e1d==='rtpaudioqosjitterbridged'||_0x5c4e1d==='rtpaudioqosloss'||_0x5c4e1d===_0x4718('0x7a')||_0x5c4e1d===_0x4718('0x7b')||_0x5c4e1d===_0x4718('0x7c')||_0x5c4e1d==='rtpaudioqos'||_0x5c4e1d===_0x4718('0x78')||_0x5c4e1d===_0x4718('0x79')||_0x5c4e1d==='rtpaudioqosjitterbridged'||_0x5c4e1d==='rtpaudioqosloss'||_0x5c4e1d===_0x4718('0x7a')||_0x5c4e1d===_0x4718('0x7b')||_0x5c4e1d===_0x4718('0x7c')||_0x5c4e1d===_0x4718('0x7d')||_0x5c4e1d===_0x4718('0x7e')||_0x5c4e1d===_0x4718('0x35')||_0x5c4e1d===_0x4718('0x36')){return![];}return!![];};exports[_0x4718('0x7f')]=function(_0x423ce0,_0x4b810e){var _0x5a9719,_0x1f8a78,_0x66db88;if(_0x4b810e<=0x0){_0x4b810e=0x1;}_0x5a9719=new RegExp('\x5cw{0,'+_0x4b810e+'}$');_0x1f8a78=Math[_0x4718('0x80')](0xa,_0x4b810e-0x1);_0x66db88=Math[_0x4718('0x80')](0xa,_0x4b810e)-0x1;return util[_0x4718('0x13')]('%s',_[_0x4718('0x81')](_0x423ce0,_0x5a9719,_['random'](_0x1f8a78,_0x66db88)));};exports[_0x4718('0x82')]=function(_0x11c9a4){var _0x2dee04=_0x11c9a4[_0x4718('0x83')](/"(.*?)"/);return _0x2dee04?_0x2dee04[0x1]:_0x11c9a4;};exports[_0x4718('0x84')]=function(_0x5242a9){var _0xb661d1=_0x5242a9[_0x4718('0x83')](/<(.*?)>/);return _0xb661d1?_0xb661d1[0x1]:_0x5242a9;}; \ No newline at end of file +var _0xf075=['util','lodash','moment','../../../../config/logger','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','inspect','logger','info','error','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','dialQueueProject2','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','membername','UserId','talktime','answertime','isFailure','variablesAction','RECALL','uniqueid','channelAgent','from-sip','timeout','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','dialAnswer','active','scheduledat','countbusyretry','countglobal','callbackuniqueid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','pow','replace','random','extractCalleridName','extractCalleridNumber','match'];(function(_0x4be8ba,_0x5d10ba){var _0x1af822=function(_0x40ed8a){while(--_0x40ed8a){_0x4be8ba['push'](_0x4be8ba['shift']());}};_0x1af822(++_0x5d10ba);}(_0xf075,0x8a));var _0x5f07=function(_0xd2d0cf,_0x2ea0fb){_0xd2d0cf=_0xd2d0cf-0x0;var _0x21771c=_0xf075[_0xd2d0cf];return _0x21771c;};'use strict';var util=require(_0x5f07('0x0'));var _=require(_0x5f07('0x1'));var moment=require(_0x5f07('0x2'));var logger=require(_0x5f07('0x3'))('preview');var ipAgi=process[_0x5f07('0x4')]['XCALLY_IP_AGI']||_0x5f07('0x5');function getSeconds(_0x4d6146,_0x4eb82a){var _0x4c5ed8=moment(_0x4d6146)['milliseconds'](0x0);var _0xdc184b=moment(_0x4eb82a)[_0x5f07('0x6')](0x0);return _0x4c5ed8[_0x5f07('0x7')](_0xdc184b,_0x5f07('0x8'));}exports[_0x5f07('0x9')]=function(_0x1c55cb){return function(_0x3dffcc){logger['error'](_0x1c55cb,util[_0x5f07('0xa')](_0x3dffcc,{'showHidden':![],'depth':null}));};};exports[_0x5f07('0xb')]=function(_0x7f5370,_0x5ee1fd){logger[_0x5f07('0xc')](_0x7f5370,util[_0x5f07('0xa')](_0x5ee1fd,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x2c9de4,_0x393e74){logger[_0x5f07('0xd')](_0x2c9de4,util[_0x5f07('0xa')](_0x393e74,{'showHidden':![],'depth':null}));};exports[_0x5f07('0xe')]=function(_0x2696dc){return function(_0x1c0c16){logger[_0x5f07('0xc')](_0x2696dc,util[_0x5f07('0xa')](_0x1c0c16,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x1fd539,_0x3822dc,_0x113237){return{'message':_0x1fd539,'unlock':_0x3822dc,'active':_0x113237};};exports[_0x5f07('0xf')]=function(_0x508274,_0x41d0bf,_0x2d14a3){if(!_[_0x5f07('0x10')](_0x2d14a3)&&_0x5f07('0x11')===typeof _0x2d14a3&&!_[_0x5f07('0x12')](_0x2d14a3)){if(!_[_0x5f07('0x10')](_0x41d0bf)&&_0x5f07('0x11')===typeof _0x41d0bf&&!_[_0x5f07('0x12')](_0x41d0bf)){return util[_0x5f07('0x13')](_0x5f07('0x14'),_0x41d0bf,_0x2d14a3);}return util[_0x5f07('0x13')](_0x5f07('0x14'),_0x2d14a3,_0x2d14a3);}if(!_[_0x5f07('0x10')](_0x508274)&&_0x5f07('0x11')===typeof _0x508274&&!_['isEmpty'](_0x508274)){return _0x508274;}return _0x5f07('0x15');};exports[_0x5f07('0x16')]=function(_0x34b5b4){if(_[_0x5f07('0x17')](_0x34b5b4)){return![];}return _0x34b5b4;};exports[_0x5f07('0x18')]=function(_0x3be121,_0x468acc,_0x4fe301,_0x5978a2,_0x174ce8,_0x151a16){var _0x2ec65b={'XMD-QUEUE':_0x468acc[_0x5f07('0x19')]?_0x468acc[_0x5f07('0x19')]['name']:'','XMD-CALLERID':_0x5978a2,'XMD-CALLERID-PREVIEW':_0x151a16?util[_0x5f07('0x13')](_0x5f07('0x14'),_0x151a16[_0x5f07('0x1a')],_0x151a16['calleridnum']):_0x5978a2,'XMD-DIALID':_0x174ce8,'XMD-CONTACTID':_0x468acc['ContactId'],'XMD-CDRTYPE':_0x5f07('0x1b'),'CALLERID(all)':_0x5978a2,'XMD-VOICEQUEUEID':_0x468acc['VoiceQueueId'],'XMD-DIALCHANNEL':_0x4fe301,'XMD-DIALTIMEOUT':_0x3be121[_0x5f07('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x5f07('0x1d'),_0x3be121['dialQueueProject2']?'g':'',_[_0x5f07('0x12')](_0x3be121[_0x5f07('0x1e')])?'':_0x5f07('0x1f')),'XMD-DIALURL':_0x3be121[_0x5f07('0x20')]||'','XMD-AGI':_0x3be121['dialQueueProject']?util[_0x5f07('0x13')](_0x5f07('0x21'),ipAgi,_0x3be121[_0x5f07('0x22')]):_0x5f07('0x23'),'XMD-AGIAFTER':_0x3be121[_0x5f07('0x24')]?util[_0x5f07('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3be121['dialQueueProject2']):_0x5f07('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x151a16?_0x151a16[_0x5f07('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x151a16?_0x151a16['originatecalleridname']:'','XMD-DESTINATION':_0x5f07('0x26'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x3be121[_0x5f07('0x1e')])){_0x2ec65b[util[_0x5f07('0x13')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x3be121[_0x5f07('0x1e')];_0x2ec65b[util[_0x5f07('0x13')]('%s',_0x5f07('0x27'))]=_0x174ce8;}if(_0x468acc&&_0x468acc[_0x5f07('0x28')]){for(var _0x33188f in _0x468acc[_0x5f07('0x28')]){if(_0x468acc[_0x5f07('0x28')]['hasOwnProperty'](_0x33188f)){if(!_[_0x5f07('0x17')](_0x468acc['Contact'][_0x33188f])&&_0x33188f!=='id'&&_0x33188f!==_0x5f07('0x29')&&_0x33188f!==_0x5f07('0x2a')&&_0x33188f!==_0x5f07('0x2b')){_0x2ec65b[util[_0x5f07('0x13')](_0x5f07('0x2c'),'XMD-',_[_0x5f07('0x2d')](_0x33188f))]=_0x468acc['Contact'][_0x33188f];}}}}return _0x2ec65b;};exports[_0x5f07('0x2e')]=function(_0x4b0eb6){var _0x56c88d={};for(var _0x1fde64 in _0x4b0eb6){if(_0x4b0eb6[_0x5f07('0x2f')](_0x1fde64)){_0x56c88d[util[_0x5f07('0x13')]('%s',_[_0x5f07('0x30')](_0x1fde64))]=_0x4b0eb6[_0x1fde64];}}return{'variables':_0x56c88d};};exports[_0x5f07('0x31')]=function(_0x8d4f6b,_0x2e9c8b){if(!_[_0x5f07('0x17')](_0x8d4f6b)){if(_0x8d4f6b[_0x5f07('0x2f')](_0x5f07('0x32'))){if(_0x8d4f6b[_0x5f07('0x32')]>0x0){_0x8d4f6b['originated']-=0x1;}else{logger[_0x5f07('0xd')](_0x5f07('0x33'),_0x2e9c8b);}}}else{logger['error'](_0x5f07('0x34'),_0x2e9c8b);}};exports['logBlacklist']=function(_0x1b5942){var _0x5db1ad=moment()[_0x5f07('0x13')](_0x5f07('0x35'));_0x1b5942[_0x5f07('0x36')]=0xd;_0x1b5942[_0x5f07('0x37')]='Blacklist';_0x1b5942[_0x5f07('0x38')]=_0x5db1ad;_0x1b5942[_0x5f07('0x39')]=_0x5db1ad;_0x1b5942[_0x5f07('0x3a')]=_0x5db1ad;};exports[_0x5f07('0x3b')]=function(_0x3ae703,_0x131980,_0xebb6dc){var _0x481d6c=moment()[_0x5f07('0x13')](_0x5f07('0x35'));_0x3ae703[_0x5f07('0x36')]=_0x131980;_0x3ae703[_0x5f07('0x37')]=_0xebb6dc;_0x3ae703[_0x5f07('0x39')]=_0x481d6c;_0x3ae703['ringtime']=getSeconds(_0x3ae703[_0x5f07('0x39')],_0x3ae703[_0x5f07('0x38')]);};exports['logLookAgent']=function(_0x22b9d2,_0x3769c9,_0xf7df8f){_0x22b9d2[_0x5f07('0x3c')]=_0x3769c9;_0x22b9d2[_0x5f07('0x3d')]=_0xf7df8f;};exports['logCustomer']=function(_0x32b84a,_0x368a82,_0xf2711c){var _0x114930=moment()[_0x5f07('0x13')](_0x5f07('0x35'));_0x32b84a[_0x5f07('0x36')]=_0x368a82;_0x32b84a[_0x5f07('0x37')]=_0xf2711c;_0x32b84a['responsetime']=_0x32b84a[_0x5f07('0x39')]?_0x32b84a[_0x5f07('0x39')]:_0x114930;_0x32b84a[_0x5f07('0x3a')]=_0x32b84a[_0x5f07('0x3a')]?_0x32b84a[_0x5f07('0x3a')]:_0x114930;_0x32b84a['ringtime']=getSeconds(_0x32b84a[_0x5f07('0x39')]||0x0,_0x32b84a[_0x5f07('0x38')]||0x0);_0x32b84a[_0x5f07('0x3e')]=_0x32b84a['answertime']?getSeconds(_0x32b84a[_0x5f07('0x3a')],_0x32b84a[_0x5f07('0x3f')]):0x0;};exports[_0x5f07('0x40')]=function(_0x22b83e){return _0x22b83e==='Failure';};exports[_0x5f07('0x41')]=function(_0x1484de,_0x54a25d,_0x3eaaf2,_0x3007a8,_0x38c226){var _0x26ae68=_0x3007a8?_0x5f07('0x42'):_0x1484de[_0x5f07('0x1a')];_0x26ae68=_0x38c226?'BOOKED':_0x26ae68;return{'actionid':_0x1484de[_0x5f07('0x43')],'action':'originate','channel':_0x1484de[_0x5f07('0x44')],'callerid':util[_0x5f07('0x13')]('\x22%s\x22\x20<%s>',_0x26ae68,_0x1484de['calleridnum']),'Exten':_0x5f07('0x26'),'Context':_0x5f07('0x45'),'Priority':'1','variable':_0x3eaaf2,'timeout':(_0x54a25d[_0x5f07('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1484de[_0x5f07('0x43')]};};exports['totalGlobal']=function(_0xa4d928){return _0xa4d928['countbusyretry']+_0xa4d928[_0x5f07('0x47')]+_0xa4d928[_0x5f07('0x48')]+_0xa4d928['countagentrejectretry']+_0xa4d928[_0x5f07('0x49')];};exports[_0x5f07('0x4a')]=function(_0x3e1a36){var _0xe30436=_[_0x5f07('0x4b')](_0x3e1a36);_0xe30436['state']=0xf;_0xe30436[_0x5f07('0x37')]=_0x5f07('0x4c');return _0xe30436;};exports[_0x5f07('0x4d')]=function(_0x5f34f2,_0x3fe362,_0x2d2631){var _0x2c04fc={};_0x2c04fc[_0x3fe362]=_0x5f34f2[_0x3fe362];_0x2c04fc['active']=![];_0x2c04fc['scheduledat']=moment()['add'](_0x2d2631,'minutes')[_0x5f07('0x13')](_0x5f07('0x35'));_0x2c04fc[_0x5f07('0x4e')]=_0x5f34f2[_0x5f07('0x4e')];_0x2c04fc[_0x5f07('0x4f')]=_0x5f34f2[_0x5f07('0x4f')];_0x2c04fc[_0x5f07('0x50')]=_0x5f34f2['VoiceQueueId']||undefined;return _0x2c04fc;};exports[_0x5f07('0x51')]=function(_0x13973a,_0xc9484e){if(!_[_0x5f07('0x17')](_0x13973a)){if(_0x13973a[_0x5f07('0x52')]>0x0){_0x13973a['pTalking']-=0x1;}else{logger[_0x5f07('0xd')](_0xc9484e,_0x5f07('0x53'));}}else{logger['error'](_0xc9484e,_0x5f07('0x54'));}};exports[_0x5f07('0x55')]=function(_0x4db858){if(_0x4db858<=0x0){return!![];}return![];};exports[_0x5f07('0x56')]=function(_0x5b5151,_0x181678,_0x4415f3){_0x5b5151[_0x5f07('0x57')]=_0x181678;_0x5b5151[_0x5f07('0x58')]=_0x5b5151[_0x5f07('0x59')];_0x5b5151[_0x5f07('0x5a')]=_0x5b5151[_0x5f07('0x44')];_0x5b5151[_0x5f07('0x5b')]=_0x5f07('0x5c');if(_0x4415f3){_0x5b5151[_0x5f07('0x5d')]=_0x4415f3['mandatoryDisposition'];}return _0x5b5151;};exports[_0x5f07('0x5e')]=function(_0x3a2c26){var _0x1d017e={};_0x1d017e['queue']=_0x3a2c26['queue'];_0x1d017e[_0x5f07('0x5a')]=_0x3a2c26[_0x5f07('0x44')];_0x1d017e['uniqueid']=_0x3a2c26[_0x5f07('0x43')];return _0x1d017e;};exports[_0x5f07('0x5f')]=function(_0x4a61c2){var _0x3b6fd9=[];for(var _0x503fa4 in _0x4a61c2){if(_0x4a61c2['hasOwnProperty'](_0x503fa4)){if(!_[_0x5f07('0x17')](_0x4a61c2[_0x503fa4])&&_0x4a61c2[_0x503fa4]['state']===_0x5f07('0x60')&&_0x4a61c2[_0x503fa4][_0x5f07('0x61')]===_0x5f07('0x62')){_0x3b6fd9[_0x5f07('0x63')](_0x4a61c2[_0x503fa4]['id']);}}}return _0x3b6fd9;};exports[_0x5f07('0x64')]=function(_0x50dae3){var _0x3aa956=moment()[_0x5f07('0x6')](0x0);var _0x28f0b6=moment(_0x50dae3)[_0x5f07('0x6')](0x0);return _0x3aa956[_0x5f07('0x7')](_0x28f0b6,'seconds');};exports[_0x5f07('0x65')]=function(_0x44d5be){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x44d5be['ContactId'],'ListId':_0x44d5be[_0x5f07('0x4f')],'VoiceQueueId':_0x44d5be['VoiceQueueId']||undefined,'CampaignId':_0x44d5be[_0x5f07('0x66')]||undefined};};exports[_0x5f07('0x67')]=function(_0x57ff42){if(_0x57ff42===_0x5f07('0x43')||_0x57ff42===_0x5f07('0x68')||_0x57ff42===_0x5f07('0x59')||_0x57ff42===_0x5f07('0x69')||_0x57ff42==='campaigntype'||_0x57ff42===_0x5f07('0x6a')||_0x57ff42==='membername'||_0x57ff42==='channelAgent'||_0x57ff42===_0x5f07('0x1a')||_0x57ff42===_0x5f07('0x6b')||_0x57ff42==='calleridnum'||_0x57ff42===_0x5f07('0x6c')||_0x57ff42===_0x5f07('0x6d')||_0x57ff42===_0x5f07('0x47')||_0x57ff42===_0x5f07('0x48')||_0x57ff42===_0x5f07('0x6e')||_0x57ff42==='callback'||_0x57ff42===_0x5f07('0x6f')||_0x57ff42==='callbackat'||_0x57ff42==='recallme'||_0x57ff42===_0x5f07('0x4e')||_0x57ff42===_0x5f07('0x4f')||_0x57ff42===_0x5f07('0x3d')||_0x57ff42===_0x5f07('0x50')||_0x57ff42==='sipcallid'||_0x57ff42===_0x5f07('0x70')||_0x57ff42===_0x5f07('0x71')||_0x57ff42===_0x5f07('0x72')||_0x57ff42===_0x5f07('0x73')||_0x57ff42==='xmd-dialurl'||_0x57ff42===_0x5f07('0x74')||_0x57ff42===_0x5f07('0x75')||_0x57ff42==='xmd-dialid'||_0x57ff42===_0x5f07('0x76')||_0x57ff42===_0x5f07('0x77')||_0x57ff42===_0x5f07('0x78')||_0x57ff42===_0x5f07('0x79')||_0x57ff42===_0x5f07('0x7a')||_0x57ff42==='xmd-agi'||_0x57ff42===_0x5f07('0x7b')||_0x57ff42===_0x5f07('0x7c')||_0x57ff42===_0x5f07('0x7d')||_0x57ff42===_0x5f07('0x7e')||_0x57ff42===_0x5f07('0x7f')||_0x57ff42===_0x5f07('0x80')||_0x57ff42===_0x5f07('0x81')||_0x57ff42===_0x5f07('0x82')||_0x57ff42==='rtpaudioqos'||_0x57ff42==='rtpaudioqosbridged'||_0x57ff42===_0x5f07('0x7d')||_0x57ff42===_0x5f07('0x7e')||_0x57ff42===_0x5f07('0x7f')||_0x57ff42===_0x5f07('0x80')||_0x57ff42===_0x5f07('0x81')||_0x57ff42===_0x5f07('0x82')||_0x57ff42===_0x5f07('0x83')||_0x57ff42==='bridgepvtcallid'||_0x57ff42==='state'||_0x57ff42===_0x5f07('0x37')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x346377,_0x2b6d7c){var _0x860e44,_0x24eb9a,_0x2788b1;if(_0x2b6d7c<=0x0){_0x2b6d7c=0x1;}_0x860e44=new RegExp('\x5cw{0,'+_0x2b6d7c+'}$');_0x24eb9a=Math['pow'](0xa,_0x2b6d7c-0x1);_0x2788b1=Math[_0x5f07('0x84')](0xa,_0x2b6d7c)-0x1;return util[_0x5f07('0x13')]('%s',_[_0x5f07('0x85')](_0x346377,_0x860e44,_[_0x5f07('0x86')](_0x24eb9a,_0x2788b1)));};exports[_0x5f07('0x87')]=function(_0x29bdc4){var _0x166ecc=_0x29bdc4['match'](/"(.*?)"/);return _0x166ecc?_0x166ecc[0x1]:_0x29bdc4;};exports[_0x5f07('0x88')]=function(_0xf5aaab){var _0x72355e=_0xf5aaab[_0x5f07('0x89')](/<(.*?)>/);return _0x72355e?_0x72355e[0x1]:_0xf5aaab;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 024ff95..ead08c4 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 _0x4807=['voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel'];(function(_0xf1dbd8,_0x1cb2e1){var _0x5ee4be=function(_0x2b8af1){while(--_0x2b8af1){_0xf1dbd8['push'](_0xf1dbd8['shift']());}};_0x5ee4be(++_0x1cb2e1);}(_0x4807,0x1d8));var _0x7480=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4807[_0x40a045];return _0x1a687c;};'use strict';exports[_0x7480('0x0')]={'queue':{'type':_0x7480('0x1'),'required':!![]},'interface':{'type':_0x7480('0x1'),'required':!![]},'membername':{'type':_0x7480('0x1'),'required':!![]},'penalty':{'type':_0x7480('0x2'),'required':![]},'paused':{'type':_0x7480('0x3'),'required':![]}};exports[_0x7480('0x4')]={'queue':{'type':_0x7480('0x1'),'required':!![]},'interface':{'type':_0x7480('0x1'),'required':!![]}};exports[_0x7480('0x5')]={'interface':{'type':_0x7480('0x1'),'required':!![]},'paused':{'type':_0x7480('0x3')},'reason':{'type':_0x7480('0x1'),'required':![]}};exports[_0x7480('0x6')]={'module':{'type':_0x7480('0x1'),'required':![]}};exports[_0x7480('0x7')]={'uniqueid':{'type':_0x7480('0x1'),'required':!![]}};exports[_0x7480('0x8')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x7480('0x1')},'format':{'type':_0x7480('0x1')},'mixmonitorid':{'type':_0x7480('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x7480('0x1'),'required':!![]}};exports[_0x7480('0x9')]={'uniqueid':{'type':_0x7480('0x1'),'required':!![]},'exten':{'type':_0x7480('0x1'),'required':!![]},'context':{'type':_0x7480('0x1')}}; \ No newline at end of file +var _0x55d2=['queueadd','string','number','boolean','queueremove','queuepause','reload','voicechannel','voicequeuechannelhangup'];(function(_0x517e50,_0x25b6e1){var _0x3fdb49=function(_0x1b5bd5){while(--_0x1b5bd5){_0x517e50['push'](_0x517e50['shift']());}};_0x3fdb49(++_0x25b6e1);}(_0x55d2,0xd8));var _0x255d=function(_0x38ed15,_0x2b12e8){_0x38ed15=_0x38ed15-0x0;var _0x29db8b=_0x55d2[_0x38ed15];return _0x29db8b;};'use strict';exports[_0x255d('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x255d('0x1'),'required':!![]},'membername':{'type':_0x255d('0x1'),'required':!![]},'penalty':{'type':_0x255d('0x2'),'required':![]},'paused':{'type':_0x255d('0x3'),'required':![]}};exports[_0x255d('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x255d('0x1'),'required':!![]}};exports[_0x255d('0x5')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x255d('0x3')},'reason':{'type':_0x255d('0x1'),'required':![]}};exports[_0x255d('0x6')]={'module':{'type':_0x255d('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0x255d('0x7')]={'uniqueid':{'type':_0x255d('0x1'),'required':!![]},'filename':{'type':_0x255d('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x255d('0x1')}};exports[_0x255d('0x8')]={'uniqueid':{'type':_0x255d('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x255d('0x1'),'required':!![]},'exten':{'type':_0x255d('0x1'),'required':!![]},'context':{'type':_0x255d('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index e4aa179..4fc96d5 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 _0x0e94=['initZohoAccounts','initDeskAccounts','deskAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queuecallerexit','queuecallerabandon','queuecallerjoinAt','seconds','queuecallercomplete','queuecallercompleteAt','diff','queuecallerleaveAt','initVoiceCallReports','duration','ANSWERED','billableseconds','SquareProject','initVoiceExtensions','voiceExtensions','initFaxAccounts','exports','bluebird','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','interface','name','total','sumDuration','sumBillable','ivrAnswerCallsDay','isEmpty','answered','unmanaged','sumHoldTime','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','initTelephones','isUndefined','initTrunks','initVoiceQueues','initZendeskAccounts','initSalesforceAccounts','freshdeskAccounts'];(function(_0x9923c6,_0x31d498){var _0x11f252=function(_0x289f89){while(--_0x289f89){_0x9923c6['push'](_0x9923c6['shift']());}};_0x11f252(++_0x31d498);}(_0x0e94,0x1a4));var _0x40e9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0e94[_0x4b369d];return _0x571a98;};'use strict';var BPromise=require(_0x40e9('0x0'));var util=require('util');var _=require('lodash');var moment=require(_0x40e9('0x1'));var Agent=require(_0x40e9('0x2'));var Telephone=require(_0x40e9('0x3'));var Trunk=require(_0x40e9('0x4'));var VoiceQueue=require(_0x40e9('0x5'));var Trigger=require(_0x40e9('0x6'));var Template=require(_0x40e9('0x7'));var Campaign=require(_0x40e9('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x40e9('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x40e9('0xa'));var SugarcrmAccount=require(_0x40e9('0xb'));var ZohoAccount=require(_0x40e9('0xc'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x40e9('0xd'));var ServicenowAccount=require(_0x40e9('0xe'));var Dynamics365Account=require(_0x40e9('0xf'));var FreshsalesAccount=require(_0x40e9('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x40e9('0x11')]={};this[_0x40e9('0x12')]={};this[_0x40e9('0x13')]={};this[_0x40e9('0x14')]={};this[_0x40e9('0x15')]={};this[_0x40e9('0x16')]={};this[_0x40e9('0x17')]={};this[_0x40e9('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x40e9('0x19')]={};this['queueChannels']={};this[_0x40e9('0x1a')]={};this['timers']={};this[_0x40e9('0x1b')]={};this[_0x40e9('0x1c')]={};this[_0x40e9('0x1d')]={};this[_0x40e9('0x1e')]={};this['freshdeskAccounts']={};this[_0x40e9('0x1f')]={};this['deskAccounts']={};this[_0x40e9('0x20')]={};this['servicenowAccounts']={};this[_0x40e9('0x21')]={};this[_0x40e9('0x22')]={};this[_0x40e9('0x23')]={};};function freeIsNotKey(_0xe12260,_0x394cb2,_0x5bbba1){var _0xa6defe=_[_0x40e9('0x24')](_0xe12260,function(_0x435450,_0x27ccaf){return _0x435450[_0x5bbba1];});for(var _0x24e980 in _0x394cb2){if(_0x394cb2[_0x40e9('0x25')](_0x24e980)){if(!_0xa6defe[_0x24e980]){delete _0x394cb2[_0x24e980];}}}}function freeIsNotKeySip(_0x5c3318,_0x5f068b){var _0x442856=_['mapKeys'](_0x5c3318,function(_0x145d86,_0x155e2d){return util[_0x40e9('0x26')](_0x40e9('0x27'),_0x145d86['name']);});for(var _0x124688 in _0x5f068b){if(_0x5f068b[_0x40e9('0x25')](_0x124688)){if(!_0x442856[_0x124688]){delete _0x5f068b[_0x124688];}}}}function freeIsNotKeyAgent(_0x3e736e,_0x47c640){var _0x31c763=_[_0x40e9('0x24')](_0x3e736e,function(_0x38fadb,_0x577e04){var _0x27c313=_[_0x40e9('0x28')](_0x38fadb[_0x40e9('0x29')])?util[_0x40e9('0x26')](_0x40e9('0x27'),_0x38fadb[_0x40e9('0x2a')]):_0x38fadb['interface'];return _0x27c313;});for(var _0x1653b7 in _0x47c640){if(_0x47c640['hasOwnProperty'](_0x1653b7)){if(!_0x31c763[_0x1653b7]){delete _0x47c640[_0x1653b7];}}}}function clearVoiceCallReports(_0x30daf1){_0x30daf1[_0x40e9('0x2b')]=0x0;_0x30daf1['answered']=0x0;_0x30daf1['sumHoldTime']=0x0;_0x30daf1[_0x40e9('0x2c')]=0x0;_0x30daf1[_0x40e9('0x2d')]=0x0;}function clearCampaigns(_0x465857){if(!_['isEmpty'](_0x465857)){for(var _0x1beefb in _0x465857){if(_0x465857[_0x40e9('0x25')](_0x1beefb)){_0x465857[_0x1beefb]['ivrTotalCallsDays']=0x0;_0x465857[_0x1beefb][_0x40e9('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x1c3058){if(!_[_0x40e9('0x2f')](_0x1c3058)){for(var _0xc39603 in _0x1c3058){if(_0x1c3058['hasOwnProperty'](_0xc39603)){_0x1c3058[_0xc39603][_0x40e9('0x2b')]=0x0;_0x1c3058[_0xc39603][_0x40e9('0x30')]=0x0;_0x1c3058[_0xc39603][_0x40e9('0x31')]=0x0;_0x1c3058[_0xc39603]['abandoned']=0x0;_0x1c3058[_0xc39603][_0x40e9('0x32')]=0x0;_0x1c3058[_0xc39603][_0x40e9('0x2c')]=0x0;_0x1c3058[_0xc39603]['sumBillable']=0x0;_0x1c3058[_0xc39603]['outboundAnswerAgiCallsDay']=0x0;_0x1c3058[_0xc39603]['outboundNoAnswerCallsDay']=0x0;_0x1c3058[_0xc39603][_0x40e9('0x33')]=0x0;_0x1c3058[_0xc39603]['outboundCongestionCallsDay']=0x0;_0x1c3058[_0xc39603][_0x40e9('0x34')]=0x0;_0x1c3058[_0xc39603]['outboundUnknownCallsDay']=0x0;_0x1c3058[_0xc39603]['outboundDropCallsDayTimeout']=0x0;_0x1c3058[_0xc39603][_0x40e9('0x35')]=0x0;_0x1c3058[_0xc39603][_0x40e9('0x36')]=0x0;_0x1c3058[_0xc39603]['outboundOriginateFailureCallsDay']=0x0;_0x1c3058[_0xc39603][_0x40e9('0x37')]=0x0;_0x1c3058[_0xc39603][_0x40e9('0x38')]=0x0;_0x1c3058[_0xc39603][_0x40e9('0x39')]=0x0;_0x1c3058[_0xc39603][_0x40e9('0x3a')]=0x0;_0x1c3058[_0xc39603][_0x40e9('0x3b')]=!![];}}}}Realtime[_0x40e9('0x3c')][_0x40e9('0x3d')]=function(_0x5a73b5,_0x146293){for(var _0x15259b in _0x146293){if(_0x5a73b5[_0x40e9('0x25')](_0x15259b)){_0x5a73b5[_0x15259b]=_0x146293[_0x15259b];}}};Realtime[_0x40e9('0x3c')]['initAgents']=function(){var _0x227cd=this;return function(_0x410eeb){if(_0x410eeb){freeIsNotKeyAgent(_0x410eeb,_0x227cd[_0x40e9('0x11')]);for(var _0x1529ef=0x0,_0x1e3267={},_0x5248c2={};_0x1529ef<_0x410eeb[_0x40e9('0x3e')];_0x1529ef+=0x1){_0x1e3267=_0x410eeb[_0x1529ef];var _0xb410b8=_[_0x40e9('0x28')](_0x1e3267['interface'])?util[_0x40e9('0x26')](_0x40e9('0x27'),_0x1e3267[_0x40e9('0x2a')]):_0x1e3267[_0x40e9('0x29')];if(_['isUndefined'](_0x227cd[_0x40e9('0x11')][_0xb410b8])){_0x227cd[_0x40e9('0x11')][_0xb410b8]=new Agent(_0x1e3267);}else{_0x227cd['mergeFromDatabase'](_0x227cd[_0x40e9('0x11')][_0xb410b8],_0x1e3267);}}}return _0x227cd['agents'];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x3f')]=function(){var _0x396621=this;return function(_0x3092db){if(_0x3092db){freeIsNotKeySip(_0x3092db,_0x396621['telephones']);for(var _0x2c604f=0x0,_0x4446b4={},_0x51e801={};_0x2c604f<_0x3092db[_0x40e9('0x3e')];_0x2c604f+=0x1){_0x4446b4=_0x3092db[_0x2c604f];if(_[_0x40e9('0x40')](_0x396621['telephones'][util[_0x40e9('0x26')](_0x40e9('0x27'),_0x4446b4[_0x40e9('0x2a')])])){_0x396621[_0x40e9('0x12')][util['format'](_0x40e9('0x27'),_0x4446b4[_0x40e9('0x2a')])]=new Telephone(_0x4446b4);}else{_0x396621['mergeFromDatabase'](_0x396621[_0x40e9('0x12')][util[_0x40e9('0x26')](_0x40e9('0x27'),_0x4446b4['name'])],_0x4446b4);}}}return _0x396621[_0x40e9('0x12')];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x41')]=function(){var _0x2377e6=this;return function(_0x4f4549){if(_0x4f4549){freeIsNotKeySip(_0x4f4549,_0x2377e6[_0x40e9('0x13')]);for(var _0x150961=0x0,_0x36baf5={},_0x140fc6={};_0x150961<_0x4f4549[_0x40e9('0x3e')];_0x150961+=0x1){_0x36baf5=_0x4f4549[_0x150961];if(_['isUndefined'](_0x2377e6[_0x40e9('0x13')][util[_0x40e9('0x26')](_0x40e9('0x27'),_0x36baf5[_0x40e9('0x2a')])])){_0x2377e6[_0x40e9('0x13')][util[_0x40e9('0x26')](_0x40e9('0x27'),_0x36baf5['name'])]=new Trunk(_0x36baf5);}else{_0x2377e6[_0x40e9('0x3d')](_0x2377e6['trunks'][util['format'](_0x40e9('0x27'),_0x36baf5[_0x40e9('0x2a')])],_0x36baf5);}}}return _0x2377e6['trunks'];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x42')]=function(){var _0x5688ea=this;return function(_0x2a5be5){if(_0x2a5be5){freeIsNotKey(_0x2a5be5,_0x5688ea[_0x40e9('0x14')],_0x40e9('0x2a'));for(var _0xa93206=0x0,_0x3a52e8={},_0x1f29b2={};_0xa93206<_0x2a5be5[_0x40e9('0x3e')];_0xa93206+=0x1){_0x3a52e8=_0x2a5be5[_0xa93206];if(_[_0x40e9('0x40')](_0x5688ea['voiceQueues'][_0x3a52e8[_0x40e9('0x2a')]])){_0x5688ea[_0x40e9('0x14')][_0x3a52e8[_0x40e9('0x2a')]]=new VoiceQueue(_0x3a52e8);}else{_0x5688ea['mergeFromDatabase'](_0x5688ea[_0x40e9('0x14')][_0x3a52e8[_0x40e9('0x2a')]],_0x3a52e8);}}}return _0x5688ea[_0x40e9('0x14')];};};Realtime[_0x40e9('0x3c')]['initTriggers']=function(){var _0x321170=this;return function(_0x3fe151){if(_0x3fe151){freeIsNotKey(_0x3fe151,_0x321170['triggers'],'id');for(var _0x15075e=0x0,_0x2c0923={},_0x1b84bd={};_0x15075e<_0x3fe151[_0x40e9('0x3e')];_0x15075e+=0x1){_0x2c0923=_0x3fe151[_0x15075e];if(_[_0x40e9('0x40')](_0x321170[_0x40e9('0x15')][_0x2c0923['id']])){_0x321170[_0x40e9('0x15')][_0x2c0923['id']]=new Trigger(_0x2c0923);}else{_0x321170['mergeFromDatabase'](_0x321170[_0x40e9('0x15')][_0x2c0923['id']],_0x2c0923);}}}return _0x321170[_0x40e9('0x15')];};};Realtime['prototype']['initTemplates']=function(){var _0x56de3d=this;return function(_0x5b6ce4){if(_0x5b6ce4){freeIsNotKey(_0x5b6ce4,_0x56de3d[_0x40e9('0x17')],'id');for(var _0x4779bd=0x0,_0x1ea9b0={},_0xa4af87={};_0x4779bd<_0x5b6ce4[_0x40e9('0x3e')];_0x4779bd+=0x1){_0x1ea9b0=_0x5b6ce4[_0x4779bd];if(_[_0x40e9('0x40')](_0x56de3d['templates'][_0x1ea9b0['id']])){_0x56de3d[_0x40e9('0x17')][_0x1ea9b0['id']]=new Template(_0x1ea9b0);}else{_0x56de3d[_0x40e9('0x3d')](_0x56de3d['templates'][_0x1ea9b0['id']],_0x1ea9b0);}}}return _0x56de3d[_0x40e9('0x17')];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x43')]=function(){var _0x89be22=this;return function(_0x45ad03){if(_0x45ad03){freeIsNotKey(_0x45ad03,_0x89be22[_0x40e9('0x1c')],'id');for(var _0x5c45e8=0x0,_0x1decbb={},_0x589ad1={};_0x5c45e8<_0x45ad03[_0x40e9('0x3e')];_0x5c45e8+=0x1){_0x1decbb=_0x45ad03[_0x5c45e8];if(_[_0x40e9('0x40')](_0x89be22[_0x40e9('0x1c')][_0x1decbb['id']])){_0x89be22['zendeskAccounts'][_0x1decbb['id']]=new ZendeskAccount(_0x1decbb);}else{_0x89be22[_0x40e9('0x3d')](_0x89be22['zendeskAccounts'][_0x1decbb['id']],_0x1decbb);}}}return _0x89be22[_0x40e9('0x1c')];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x44')]=function(){var _0x2b20e4=this;return function(_0x56d90a){if(_0x56d90a){freeIsNotKey(_0x56d90a,_0x2b20e4[_0x40e9('0x1d')],'id');for(var _0x4bbea4=0x0,_0x274e8a={},_0x24e523={};_0x4bbea4<_0x56d90a[_0x40e9('0x3e')];_0x4bbea4+=0x1){_0x274e8a=_0x56d90a[_0x4bbea4];if(_[_0x40e9('0x40')](_0x2b20e4[_0x40e9('0x1d')][_0x274e8a['id']])){_0x2b20e4[_0x40e9('0x1d')][_0x274e8a['id']]=new SalesforceAccount(_0x274e8a);}else{_0x2b20e4[_0x40e9('0x3d')](_0x2b20e4[_0x40e9('0x1d')][_0x274e8a['id']],_0x274e8a);}}}return _0x2b20e4[_0x40e9('0x1d')];};};Realtime[_0x40e9('0x3c')]['initFreshdeskAccounts']=function(){var _0x48e422=this;return function(_0x343025){if(_0x343025){freeIsNotKey(_0x343025,_0x48e422[_0x40e9('0x45')],'id');for(var _0x100a62=0x0,_0x2de7b7={},_0x5a4663={};_0x100a62<_0x343025['length'];_0x100a62+=0x1){_0x2de7b7=_0x343025[_0x100a62];if(_['isUndefined'](_0x48e422[_0x40e9('0x45')][_0x2de7b7['id']])){_0x48e422[_0x40e9('0x45')][_0x2de7b7['id']]=new FreshdeskAccount(_0x2de7b7);}else{_0x48e422[_0x40e9('0x3d')](_0x48e422[_0x40e9('0x45')][_0x2de7b7['id']],_0x2de7b7);}}}return _0x48e422['freshdeskAccounts'];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x46')]=function(){var _0x13d30d=this;return function(_0x26a5dc){if(_0x26a5dc){freeIsNotKey(_0x26a5dc,_0x13d30d[_0x40e9('0x1f')],'id');for(var _0x43e20a=0x0,_0x254bb8={},_0x488313={};_0x43e20a<_0x26a5dc[_0x40e9('0x3e')];_0x43e20a+=0x1){_0x254bb8=_0x26a5dc[_0x43e20a];if(_[_0x40e9('0x40')](_0x13d30d[_0x40e9('0x1f')][_0x254bb8['id']])){_0x13d30d[_0x40e9('0x1f')][_0x254bb8['id']]=new ZohoAccount(_0x254bb8);}else{_0x13d30d['mergeFromDatabase'](_0x13d30d[_0x40e9('0x1f')][_0x254bb8['id']],_0x254bb8);}}}return _0x13d30d[_0x40e9('0x1f')];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x47')]=function(){var _0xea1f0b=this;return function(_0x3190a0){if(_0x3190a0){freeIsNotKey(_0x3190a0,_0xea1f0b[_0x40e9('0x48')],'id');for(var _0x31ecd4=0x0,_0x7dfd76={},_0x16edec={};_0x31ecd4<_0x3190a0[_0x40e9('0x3e')];_0x31ecd4+=0x1){_0x7dfd76=_0x3190a0[_0x31ecd4];if(_[_0x40e9('0x40')](_0xea1f0b[_0x40e9('0x48')][_0x7dfd76['id']])){_0xea1f0b[_0x40e9('0x48')][_0x7dfd76['id']]=new DeskAccount(_0x7dfd76);}else{_0xea1f0b[_0x40e9('0x3d')](_0xea1f0b[_0x40e9('0x48')][_0x7dfd76['id']],_0x7dfd76);}}}return _0xea1f0b[_0x40e9('0x48')];};};Realtime[_0x40e9('0x3c')]['initSugarcrmAccounts']=function(){var _0x583fa3=this;return function(_0x4b7379){if(_0x4b7379){freeIsNotKey(_0x4b7379,_0x583fa3['sugarcrmAccounts'],'id');for(var _0x205bfc=0x0,_0x223354={},_0x2898f3={};_0x205bfc<_0x4b7379[_0x40e9('0x3e')];_0x205bfc+=0x1){_0x223354=_0x4b7379[_0x205bfc];if(_[_0x40e9('0x40')](_0x583fa3[_0x40e9('0x1e')][_0x223354['id']])){_0x583fa3[_0x40e9('0x1e')][_0x223354['id']]=new SugarcrmAccount(_0x223354);}else{_0x583fa3[_0x40e9('0x3d')](_0x583fa3[_0x40e9('0x1e')][_0x223354['id']],_0x223354);}}}return _0x583fa3[_0x40e9('0x1e')];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x49')]=function(){var _0x18579a=this;return function(_0x109329){if(_0x109329){freeIsNotKey(_0x109329,_0x18579a['vtigerAccounts'],'id');for(var _0x50ba1d=0x0,_0x1d0e0d={},_0x24ff7b={};_0x50ba1d<_0x109329[_0x40e9('0x3e')];_0x50ba1d+=0x1){_0x1d0e0d=_0x109329[_0x50ba1d];if(_['isUndefined'](_0x18579a[_0x40e9('0x20')][_0x1d0e0d['id']])){_0x18579a['vtigerAccounts'][_0x1d0e0d['id']]=new VtigerAccount(_0x1d0e0d);}else{_0x18579a['mergeFromDatabase'](_0x18579a[_0x40e9('0x20')][_0x1d0e0d['id']],_0x1d0e0d);}}}return _0x18579a['vtigerAccounts'];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x4a')]=function(){var _0x305187=this;return function(_0x38af7f){if(_0x38af7f){freeIsNotKey(_0x38af7f,_0x305187['servicenowAccounts'],'id');for(var _0x2ea0f5=0x0,_0x55ecae={},_0x5ac131={};_0x2ea0f5<_0x38af7f[_0x40e9('0x3e')];_0x2ea0f5+=0x1){_0x55ecae=_0x38af7f[_0x2ea0f5];if(_[_0x40e9('0x40')](_0x305187[_0x40e9('0x4b')][_0x55ecae['id']])){_0x305187[_0x40e9('0x4b')][_0x55ecae['id']]=new ServicenowAccount(_0x55ecae);}else{_0x305187[_0x40e9('0x3d')](_0x305187[_0x40e9('0x4b')][_0x55ecae['id']],_0x55ecae);}}}return _0x305187[_0x40e9('0x4b')];};};Realtime[_0x40e9('0x3c')]['initDynamics365Accounts']=function(){var _0x2b18b5=this;return function(_0x1ab326){if(_0x1ab326){freeIsNotKey(_0x1ab326,_0x2b18b5[_0x40e9('0x21')],'id');for(var _0x3af418=0x0,_0x479c9f={},_0x3b54ff={};_0x3af418<_0x1ab326[_0x40e9('0x3e')];_0x3af418+=0x1){_0x479c9f=_0x1ab326[_0x3af418];if(_['isUndefined'](_0x2b18b5['dynamics365Accounts'][_0x479c9f['id']])){_0x2b18b5[_0x40e9('0x21')][_0x479c9f['id']]=new Dynamics365Account(_0x479c9f);}else{_0x2b18b5['mergeFromDatabase'](_0x2b18b5[_0x40e9('0x21')][_0x479c9f['id']],_0x479c9f);}}}return _0x2b18b5[_0x40e9('0x21')];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x4c')]=function(){var _0x1910a3=this;return function(_0x2ff8b5){if(_0x2ff8b5){freeIsNotKey(_0x2ff8b5,_0x1910a3['freshsalesAccounts'],'id');for(var _0x155f07=0x0,_0x3ef530={},_0x4ac48a={};_0x155f07<_0x2ff8b5[_0x40e9('0x3e')];_0x155f07+=0x1){_0x3ef530=_0x2ff8b5[_0x155f07];if(_[_0x40e9('0x40')](_0x1910a3['freshsalesAccounts'][_0x3ef530['id']])){_0x1910a3['freshsalesAccounts'][_0x3ef530['id']]=new FreshsalesAccount(_0x3ef530);}else{_0x1910a3[_0x40e9('0x3d')](_0x1910a3['freshsalesAccounts'][_0x3ef530['id']],_0x3ef530);}}}return _0x1910a3[_0x40e9('0x22')];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x4d')]=function(){var _0xcf841a=this;return function(_0x1f24ca){for(var _0xee6e0=0x0;_0xee6e0<_0x1f24ca[_0x40e9('0x3e')];_0xee6e0+=0x1){_[_0x40e9('0x4e')](_0xcf841a[_0x40e9('0x14')][_0x1f24ca[_0xee6e0][_0x40e9('0x2a')]],_0x1f24ca[_0xee6e0]);}return _0xcf841a[_0x40e9('0x14')];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x4f')]=function(){var _0x26d829=this;return function(_0x2f90f5){clearVoiceQueues(_0x26d829['voiceQueues']);if(_0x2f90f5){_0x2f90f5=_[_0x40e9('0x50')](_0x2f90f5,'uniqueid');for(var _0x2b2818 in _0x2f90f5){if(_0x2f90f5[_0x40e9('0x25')](_0x2b2818)){var _0x5ec76d={};for(var _0x125405=0x0;_0x125405<_0x2f90f5[_0x2b2818][_0x40e9('0x3e')];_0x125405+=0x1){var _0x48287a=_0x2f90f5[_0x2b2818][_0x125405]['queue'];if(_0x26d829[_0x40e9('0x14')][_0x48287a]){if(_0x2f90f5[_0x2b2818][_0x125405][_0x40e9('0x51')]){_0x26d829[_0x40e9('0x14')][_0x48287a][_0x40e9('0x31')]+=0x1;}if(_0x2f90f5[_0x2b2818][_0x125405][_0x40e9('0x52')]){_0x26d829[_0x40e9('0x14')][_0x48287a]['abandoned']+=0x1;}_0x26d829[_0x40e9('0x14')][_0x48287a]['sumHoldTime']+=moment(_0x2f90f5[_0x2b2818][_0x125405]['queuecallerleaveAt'])['diff'](moment(_0x2f90f5[_0x2b2818][_0x125405][_0x40e9('0x53')]),_0x40e9('0x54'))||0x0;if(_0x125405===_0x2f90f5[_0x2b2818][_0x40e9('0x3e')]-0x1){_0x26d829[_0x40e9('0x14')][_0x48287a][_0x40e9('0x2c')]+=moment(_0x2f90f5[_0x2b2818][_0x125405]['queuecallercompleteAt']||_0x2f90f5[_0x2b2818][_0x125405]['queuecallerabandonAt']||_0x2f90f5[_0x2b2818][_0x125405]['queuecallerexitAt'])['diff'](moment(_0x2f90f5[_0x2b2818][_0x125405][_0x40e9('0x53')]),_0x40e9('0x54'))||0x0;_0x26d829['voiceQueues'][_0x48287a][_0x40e9('0x2b')]+=0x1;if(_0x2f90f5[_0x2b2818][_0x125405][_0x40e9('0x55')]){_0x26d829['voiceQueues'][_0x48287a][_0x40e9('0x30')]+=0x1;_0x26d829[_0x40e9('0x14')][_0x48287a][_0x40e9('0x2d')]+=moment(_0x2f90f5[_0x2b2818][_0x125405][_0x40e9('0x56')])[_0x40e9('0x57')](moment(_0x2f90f5[_0x2b2818][_0x125405][_0x40e9('0x58')]),_0x40e9('0x54'))||0x0;}}else{_0x26d829[_0x40e9('0x14')][_0x48287a][_0x40e9('0x2c')]+=_0x26d829[_0x40e9('0x14')][_0x48287a][_0x40e9('0x32')]||0x0;}}}}}}return _0x26d829['voiceQueues'];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x59')]=function(){var _0x503712=this;return function(_0x579b68){clearVoiceCallReports(_0x503712[_0x40e9('0x18')]);if(_0x579b68){for(var _0x5de11e=0x0;_0x5de11e<_0x579b68[_0x40e9('0x3e')];_0x5de11e+=0x1){_0x503712[_0x40e9('0x18')][_0x40e9('0x2b')]+=0x1;_0x503712[_0x40e9('0x18')][_0x40e9('0x2c')]+=_0x579b68[_0x5de11e][_0x40e9('0x5a')];if(_0x579b68[_0x5de11e]['disposition']===_0x40e9('0x5b')){_0x503712['outbound'][_0x40e9('0x30')]+=0x1;_0x503712[_0x40e9('0x18')][_0x40e9('0x32')]+=_0x579b68[_0x5de11e][_0x40e9('0x5a')]-_0x579b68[_0x5de11e][_0x40e9('0x5c')]||0x0;_0x503712[_0x40e9('0x18')][_0x40e9('0x2d')]+=_0x579b68[_0x5de11e]['billableseconds'];}}}return _0x503712[_0x40e9('0x18')];};};Realtime['prototype']['initCampaigns']=function(){var _0x4d2c0e=this;return function(_0xb4217c){if(_0xb4217c){freeIsNotKey(_0xb4217c,_0x4d2c0e['campaigns'],'name');for(var _0xce20fd=0x0,_0xefe6d3={};_0xce20fd<_0xb4217c['length'];_0xce20fd+=0x1){_0xefe6d3=_0xb4217c[_0xce20fd];if(_[_0x40e9('0x40')](_0x4d2c0e[_0x40e9('0x16')][_0xefe6d3['name']])){_0x4d2c0e[_0x40e9('0x16')][_0xefe6d3['name']]=new Campaign(_0xefe6d3);}else{_0x4d2c0e[_0x40e9('0x3d')](_0x4d2c0e[_0x40e9('0x16')][_0xefe6d3[_0x40e9('0x2a')]],_0xefe6d3);_0x4d2c0e[_0x40e9('0x16')][_0xefe6d3['name']]['dialQueueProject']=_0xefe6d3['SquareProject']?_0xefe6d3[_0x40e9('0x5d')][_0x40e9('0x2a')]:undefined;}}}return _0x4d2c0e[_0x40e9('0x16')];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x5e')]=function(){var _0x1fa67e=this;return function(_0x3cc5f7){if(_0x3cc5f7){freeIsNotKey(_0x3cc5f7,_0x1fa67e[_0x40e9('0x5f')],'id');for(var _0x262b36=0x0,_0x2cc83b={};_0x262b36<_0x3cc5f7[_0x40e9('0x3e')];_0x262b36+=0x1){_0x2cc83b=_0x3cc5f7[_0x262b36];if(_['isUndefined'](_0x1fa67e[_0x40e9('0x5f')][_0x2cc83b['id']])){_0x1fa67e[_0x40e9('0x5f')][_0x2cc83b['id']]=new VoiceExtension(_0x2cc83b);}else{_0x1fa67e[_0x40e9('0x3d')](_0x1fa67e[_0x40e9('0x5f')][_0x2cc83b['id']],_0x2cc83b);}}}return _0x1fa67e[_0x40e9('0x5f')];};};Realtime[_0x40e9('0x3c')]['initCampaignHopperHistory']=function(){var _0x19aaf9=this;return function(_0x24336d){clearCampaigns(_0x19aaf9[_0x40e9('0x16')]);for(var _0x298a06=0x0;_0x298a06<_0x24336d['length'];_0x298a06+=0x1){_[_0x40e9('0x4e')](_0x19aaf9[_0x40e9('0x16')][_0x24336d[_0x298a06][_0x40e9('0x2a')]],_0x24336d[_0x298a06]);}return _0x19aaf9['campaigns'];};};Realtime[_0x40e9('0x3c')][_0x40e9('0x60')]=function(){var _0x3a66eb=this;return function(_0x55f27e){if(_0x55f27e){freeIsNotKey(_0x55f27e,_0x3a66eb[_0x40e9('0x23')],'id');for(var _0x364095=0x0,_0x41c023={},_0x420e31={};_0x364095<_0x55f27e[_0x40e9('0x3e')];_0x364095+=0x1){_0x41c023=_0x55f27e[_0x364095];if(_['isUndefined'](_0x3a66eb[_0x40e9('0x23')][_0x41c023['id']])){_0x3a66eb['faxAccounts'][_0x41c023['id']]=new FaxAccount(_0x41c023);}else{_0x3a66eb[_0x40e9('0x3d')](_0x3a66eb[_0x40e9('0x23')][_0x41c023['id']],_0x41c023);}}}return _0x3a66eb[_0x40e9('0x23')];};};module[_0x40e9('0x61')]=Realtime; \ No newline at end of file +var _0x7713=['initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerleaveAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','diff','initVoiceCallReports','duration','disposition','sumBillable','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','exports','bluebird','util','lodash','../model/agent','../model/telephone','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','sumHoldTime','sumDuration','isEmpty','ivrAnswerCallsDay','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTrunks','trunks','initVoiceQueues','initTemplates','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initSugarcrmAccounts'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x7713,0x86));var _0x3771=function(_0x4d21f0,_0x24e7e8){_0x4d21f0=_0x4d21f0-0x0;var _0x1a488a=_0x7713[_0x4d21f0];return _0x1a488a;};'use strict';var BPromise=require(_0x3771('0x0'));var util=require(_0x3771('0x1'));var _=require(_0x3771('0x2'));var moment=require('moment');var Agent=require(_0x3771('0x3'));var Telephone=require(_0x3771('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x3771('0x5'));var Template=require(_0x3771('0x6'));var Campaign=require(_0x3771('0x7'));var VoiceExtension=require(_0x3771('0x8'));var ZendeskAccount=require(_0x3771('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x3771('0xa'));var SugarcrmAccount=require(_0x3771('0xb'));var ZohoAccount=require(_0x3771('0xc'));var DeskAccount=require(_0x3771('0xd'));var VtigerAccount=require(_0x3771('0xe'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x3771('0xf'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x3771('0x10'));var Realtime=function(){this[_0x3771('0x11')]={};this[_0x3771('0x12')]={};this['trunks']={};this[_0x3771('0x13')]={};this[_0x3771('0x14')]={};this[_0x3771('0x15')]={};this[_0x3771('0x16')]={};this[_0x3771('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x3771('0x18')]={};this[_0x3771('0x19')]={};this[_0x3771('0x1a')]={};this[_0x3771('0x1b')]={};this[_0x3771('0x1c')]={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x3771('0x1d')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x3771('0x1e')]={};this[_0x3771('0x1f')]={};this[_0x3771('0x20')]={};this[_0x3771('0x21')]={};this[_0x3771('0x22')]={};this[_0x3771('0x23')]={};};function freeIsNotKey(_0xaa0c81,_0x35a1fd,_0x59bc40){var _0x2ac5cf=_[_0x3771('0x24')](_0xaa0c81,function(_0xf85632,_0x32c8b7){return _0xf85632[_0x59bc40];});for(var _0x4f1fb6 in _0x35a1fd){if(_0x35a1fd[_0x3771('0x25')](_0x4f1fb6)){if(!_0x2ac5cf[_0x4f1fb6]){delete _0x35a1fd[_0x4f1fb6];}}}}function freeIsNotKeySip(_0x119766,_0x1689e7){var _0x237ca1=_['mapKeys'](_0x119766,function(_0x480ad1,_0x243174){return util[_0x3771('0x26')](_0x3771('0x27'),_0x480ad1[_0x3771('0x28')]);});for(var _0x4b4b63 in _0x1689e7){if(_0x1689e7[_0x3771('0x25')](_0x4b4b63)){if(!_0x237ca1[_0x4b4b63]){delete _0x1689e7[_0x4b4b63];}}}}function freeIsNotKeyAgent(_0x6bdb49,_0x5b9e3a){var _0x26437f=_[_0x3771('0x24')](_0x6bdb49,function(_0x549014,_0x18c9e9){var _0x1932ca=_[_0x3771('0x29')](_0x549014[_0x3771('0x2a')])?util[_0x3771('0x26')]('SIP/%s',_0x549014[_0x3771('0x28')]):_0x549014[_0x3771('0x2a')];return _0x1932ca;});for(var _0x1e9bfa in _0x5b9e3a){if(_0x5b9e3a['hasOwnProperty'](_0x1e9bfa)){if(!_0x26437f[_0x1e9bfa]){delete _0x5b9e3a[_0x1e9bfa];}}}}function clearVoiceCallReports(_0x260795){_0x260795[_0x3771('0x2b')]=0x0;_0x260795['answered']=0x0;_0x260795[_0x3771('0x2c')]=0x0;_0x260795[_0x3771('0x2d')]=0x0;_0x260795['sumBillable']=0x0;}function clearCampaigns(_0x2d7669){if(!_[_0x3771('0x2e')](_0x2d7669)){for(var _0x4197e9 in _0x2d7669){if(_0x2d7669[_0x3771('0x25')](_0x4197e9)){_0x2d7669[_0x4197e9]['ivrTotalCallsDays']=0x0;_0x2d7669[_0x4197e9][_0x3771('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x2115f2){if(!_['isEmpty'](_0x2115f2)){for(var _0x3ee370 in _0x2115f2){if(_0x2115f2[_0x3771('0x25')](_0x3ee370)){_0x2115f2[_0x3ee370][_0x3771('0x2b')]=0x0;_0x2115f2[_0x3ee370][_0x3771('0x30')]=0x0;_0x2115f2[_0x3ee370][_0x3771('0x31')]=0x0;_0x2115f2[_0x3ee370][_0x3771('0x32')]=0x0;_0x2115f2[_0x3ee370][_0x3771('0x2c')]=0x0;_0x2115f2[_0x3ee370][_0x3771('0x2d')]=0x0;_0x2115f2[_0x3ee370]['sumBillable']=0x0;_0x2115f2[_0x3ee370][_0x3771('0x33')]=0x0;_0x2115f2[_0x3ee370][_0x3771('0x34')]=0x0;_0x2115f2[_0x3ee370][_0x3771('0x35')]=0x0;_0x2115f2[_0x3ee370]['outboundCongestionCallsDay']=0x0;_0x2115f2[_0x3ee370][_0x3771('0x36')]=0x0;_0x2115f2[_0x3ee370]['outboundUnknownCallsDay']=0x0;_0x2115f2[_0x3ee370]['outboundDropCallsDayTimeout']=0x0;_0x2115f2[_0x3ee370][_0x3771('0x37')]=0x0;_0x2115f2[_0x3ee370][_0x3771('0x38')]=0x0;_0x2115f2[_0x3ee370][_0x3771('0x39')]=0x0;_0x2115f2[_0x3ee370][_0x3771('0x3a')]=0x0;_0x2115f2[_0x3ee370][_0x3771('0x3b')]=0x0;_0x2115f2[_0x3ee370][_0x3771('0x33')]=0x0;_0x2115f2[_0x3ee370][_0x3771('0x3c')]=0x0;_0x2115f2[_0x3ee370][_0x3771('0x3d')]=!![];}}}}Realtime[_0x3771('0x3e')][_0x3771('0x3f')]=function(_0xd30330,_0x5b5623){for(var _0x56a6c7 in _0x5b5623){if(_0xd30330[_0x3771('0x25')](_0x56a6c7)){_0xd30330[_0x56a6c7]=_0x5b5623[_0x56a6c7];}}};Realtime[_0x3771('0x3e')][_0x3771('0x40')]=function(){var _0x32bb5f=this;return function(_0x3e3a46){if(_0x3e3a46){freeIsNotKeyAgent(_0x3e3a46,_0x32bb5f[_0x3771('0x11')]);for(var _0x56d6b9=0x0,_0x45c126={},_0x3360af={};_0x56d6b9<_0x3e3a46[_0x3771('0x41')];_0x56d6b9+=0x1){_0x45c126=_0x3e3a46[_0x56d6b9];var _0x21c280=_[_0x3771('0x29')](_0x45c126['interface'])?util[_0x3771('0x26')](_0x3771('0x27'),_0x45c126['name']):_0x45c126[_0x3771('0x2a')];if(_[_0x3771('0x42')](_0x32bb5f['agents'][_0x21c280])){_0x32bb5f[_0x3771('0x11')][_0x21c280]=new Agent(_0x45c126);}else{_0x32bb5f[_0x3771('0x3f')](_0x32bb5f[_0x3771('0x11')][_0x21c280],_0x45c126);}}}return _0x32bb5f['agents'];};};Realtime[_0x3771('0x3e')][_0x3771('0x43')]=function(){var _0x13a80c=this;return function(_0x167452){if(_0x167452){freeIsNotKeySip(_0x167452,_0x13a80c['telephones']);for(var _0x3ffc45=0x0,_0x47e445={},_0x2699fe={};_0x3ffc45<_0x167452['length'];_0x3ffc45+=0x1){_0x47e445=_0x167452[_0x3ffc45];if(_['isUndefined'](_0x13a80c[_0x3771('0x12')][util[_0x3771('0x26')]('SIP/%s',_0x47e445[_0x3771('0x28')])])){_0x13a80c[_0x3771('0x12')][util[_0x3771('0x26')](_0x3771('0x27'),_0x47e445['name'])]=new Telephone(_0x47e445);}else{_0x13a80c[_0x3771('0x3f')](_0x13a80c[_0x3771('0x12')][util[_0x3771('0x26')](_0x3771('0x27'),_0x47e445[_0x3771('0x28')])],_0x47e445);}}}return _0x13a80c['telephones'];};};Realtime['prototype'][_0x3771('0x44')]=function(){var _0x393b89=this;return function(_0x331a82){if(_0x331a82){freeIsNotKeySip(_0x331a82,_0x393b89['trunks']);for(var _0x2ac8a2=0x0,_0x11ff53={},_0x216b43={};_0x2ac8a2<_0x331a82[_0x3771('0x41')];_0x2ac8a2+=0x1){_0x11ff53=_0x331a82[_0x2ac8a2];if(_['isUndefined'](_0x393b89[_0x3771('0x45')][util['format'](_0x3771('0x27'),_0x11ff53[_0x3771('0x28')])])){_0x393b89[_0x3771('0x45')][util[_0x3771('0x26')](_0x3771('0x27'),_0x11ff53[_0x3771('0x28')])]=new Trunk(_0x11ff53);}else{_0x393b89['mergeFromDatabase'](_0x393b89[_0x3771('0x45')][util[_0x3771('0x26')](_0x3771('0x27'),_0x11ff53[_0x3771('0x28')])],_0x11ff53);}}}return _0x393b89['trunks'];};};Realtime[_0x3771('0x3e')][_0x3771('0x46')]=function(){var _0x2784fa=this;return function(_0x496726){if(_0x496726){freeIsNotKey(_0x496726,_0x2784fa['voiceQueues'],'name');for(var _0x456ccc=0x0,_0x41a786={},_0x304d44={};_0x456ccc<_0x496726[_0x3771('0x41')];_0x456ccc+=0x1){_0x41a786=_0x496726[_0x456ccc];if(_[_0x3771('0x42')](_0x2784fa[_0x3771('0x13')][_0x41a786[_0x3771('0x28')]])){_0x2784fa[_0x3771('0x13')][_0x41a786['name']]=new VoiceQueue(_0x41a786);}else{_0x2784fa[_0x3771('0x3f')](_0x2784fa[_0x3771('0x13')][_0x41a786[_0x3771('0x28')]],_0x41a786);}}}return _0x2784fa[_0x3771('0x13')];};};Realtime[_0x3771('0x3e')]['initTriggers']=function(){var _0x4a97fc=this;return function(_0x1db4df){if(_0x1db4df){freeIsNotKey(_0x1db4df,_0x4a97fc[_0x3771('0x14')],'id');for(var _0x4519e1=0x0,_0xcfef01={},_0x157fc5={};_0x4519e1<_0x1db4df['length'];_0x4519e1+=0x1){_0xcfef01=_0x1db4df[_0x4519e1];if(_['isUndefined'](_0x4a97fc['triggers'][_0xcfef01['id']])){_0x4a97fc[_0x3771('0x14')][_0xcfef01['id']]=new Trigger(_0xcfef01);}else{_0x4a97fc[_0x3771('0x3f')](_0x4a97fc[_0x3771('0x14')][_0xcfef01['id']],_0xcfef01);}}}return _0x4a97fc[_0x3771('0x14')];};};Realtime[_0x3771('0x3e')][_0x3771('0x47')]=function(){var _0x317606=this;return function(_0x68a76){if(_0x68a76){freeIsNotKey(_0x68a76,_0x317606['templates'],'id');for(var _0x40df35=0x0,_0x178bff={},_0x4460b4={};_0x40df35<_0x68a76['length'];_0x40df35+=0x1){_0x178bff=_0x68a76[_0x40df35];if(_[_0x3771('0x42')](_0x317606[_0x3771('0x16')][_0x178bff['id']])){_0x317606['templates'][_0x178bff['id']]=new Template(_0x178bff);}else{_0x317606['mergeFromDatabase'](_0x317606[_0x3771('0x16')][_0x178bff['id']],_0x178bff);}}}return _0x317606[_0x3771('0x16')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x45413c=this;return function(_0x113f96){if(_0x113f96){freeIsNotKey(_0x113f96,_0x45413c[_0x3771('0x48')],'id');for(var _0x5c008e=0x0,_0x565d88={},_0x18d175={};_0x5c008e<_0x113f96[_0x3771('0x41')];_0x5c008e+=0x1){_0x565d88=_0x113f96[_0x5c008e];if(_[_0x3771('0x42')](_0x45413c[_0x3771('0x48')][_0x565d88['id']])){_0x45413c[_0x3771('0x48')][_0x565d88['id']]=new ZendeskAccount(_0x565d88);}else{_0x45413c[_0x3771('0x3f')](_0x45413c[_0x3771('0x48')][_0x565d88['id']],_0x565d88);}}}return _0x45413c[_0x3771('0x48')];};};Realtime[_0x3771('0x3e')][_0x3771('0x49')]=function(){var _0x3607fa=this;return function(_0x2877c2){if(_0x2877c2){freeIsNotKey(_0x2877c2,_0x3607fa[_0x3771('0x4a')],'id');for(var _0x1720f2=0x0,_0x1e05f7={},_0x543776={};_0x1720f2<_0x2877c2['length'];_0x1720f2+=0x1){_0x1e05f7=_0x2877c2[_0x1720f2];if(_['isUndefined'](_0x3607fa[_0x3771('0x4a')][_0x1e05f7['id']])){_0x3607fa['salesforceAccounts'][_0x1e05f7['id']]=new SalesforceAccount(_0x1e05f7);}else{_0x3607fa['mergeFromDatabase'](_0x3607fa[_0x3771('0x4a')][_0x1e05f7['id']],_0x1e05f7);}}}return _0x3607fa[_0x3771('0x4a')];};};Realtime[_0x3771('0x3e')][_0x3771('0x4b')]=function(){var _0x587066=this;return function(_0x2b8b72){if(_0x2b8b72){freeIsNotKey(_0x2b8b72,_0x587066['freshdeskAccounts'],'id');for(var _0x4e3a4d=0x0,_0x40074e={},_0x142c5c={};_0x4e3a4d<_0x2b8b72[_0x3771('0x41')];_0x4e3a4d+=0x1){_0x40074e=_0x2b8b72[_0x4e3a4d];if(_[_0x3771('0x42')](_0x587066[_0x3771('0x4c')][_0x40074e['id']])){_0x587066[_0x3771('0x4c')][_0x40074e['id']]=new FreshdeskAccount(_0x40074e);}else{_0x587066[_0x3771('0x3f')](_0x587066[_0x3771('0x4c')][_0x40074e['id']],_0x40074e);}}}return _0x587066[_0x3771('0x4c')];};};Realtime[_0x3771('0x3e')][_0x3771('0x4d')]=function(){var _0x2bbf1c=this;return function(_0x573f62){if(_0x573f62){freeIsNotKey(_0x573f62,_0x2bbf1c[_0x3771('0x4e')],'id');for(var _0x5acb6d=0x0,_0x1d2d17={},_0x12b9e0={};_0x5acb6d<_0x573f62[_0x3771('0x41')];_0x5acb6d+=0x1){_0x1d2d17=_0x573f62[_0x5acb6d];if(_['isUndefined'](_0x2bbf1c[_0x3771('0x4e')][_0x1d2d17['id']])){_0x2bbf1c['zohoAccounts'][_0x1d2d17['id']]=new ZohoAccount(_0x1d2d17);}else{_0x2bbf1c['mergeFromDatabase'](_0x2bbf1c['zohoAccounts'][_0x1d2d17['id']],_0x1d2d17);}}}return _0x2bbf1c[_0x3771('0x4e')];};};Realtime[_0x3771('0x3e')]['initDeskAccounts']=function(){var _0xf1e9cb=this;return function(_0x5cba73){if(_0x5cba73){freeIsNotKey(_0x5cba73,_0xf1e9cb[_0x3771('0x1e')],'id');for(var _0x102eaa=0x0,_0x192be9={},_0x2163b3={};_0x102eaa<_0x5cba73[_0x3771('0x41')];_0x102eaa+=0x1){_0x192be9=_0x5cba73[_0x102eaa];if(_['isUndefined'](_0xf1e9cb[_0x3771('0x1e')][_0x192be9['id']])){_0xf1e9cb[_0x3771('0x1e')][_0x192be9['id']]=new DeskAccount(_0x192be9);}else{_0xf1e9cb[_0x3771('0x3f')](_0xf1e9cb[_0x3771('0x1e')][_0x192be9['id']],_0x192be9);}}}return _0xf1e9cb[_0x3771('0x1e')];};};Realtime['prototype'][_0x3771('0x4f')]=function(){var _0x2115a4=this;return function(_0x4c1bc7){if(_0x4c1bc7){freeIsNotKey(_0x4c1bc7,_0x2115a4['sugarcrmAccounts'],'id');for(var _0x1348eb=0x0,_0x2cb83e={},_0x313c82={};_0x1348eb<_0x4c1bc7[_0x3771('0x41')];_0x1348eb+=0x1){_0x2cb83e=_0x4c1bc7[_0x1348eb];if(_[_0x3771('0x42')](_0x2115a4['sugarcrmAccounts'][_0x2cb83e['id']])){_0x2115a4['sugarcrmAccounts'][_0x2cb83e['id']]=new SugarcrmAccount(_0x2cb83e);}else{_0x2115a4['mergeFromDatabase'](_0x2115a4[_0x3771('0x1d')][_0x2cb83e['id']],_0x2cb83e);}}}return _0x2115a4[_0x3771('0x1d')];};};Realtime[_0x3771('0x3e')][_0x3771('0x50')]=function(){var _0x1d9414=this;return function(_0x4cbea4){if(_0x4cbea4){freeIsNotKey(_0x4cbea4,_0x1d9414[_0x3771('0x1f')],'id');for(var _0x27240e=0x0,_0x4a2d60={},_0x1d00f4={};_0x27240e<_0x4cbea4[_0x3771('0x41')];_0x27240e+=0x1){_0x4a2d60=_0x4cbea4[_0x27240e];if(_[_0x3771('0x42')](_0x1d9414[_0x3771('0x1f')][_0x4a2d60['id']])){_0x1d9414['vtigerAccounts'][_0x4a2d60['id']]=new VtigerAccount(_0x4a2d60);}else{_0x1d9414[_0x3771('0x3f')](_0x1d9414[_0x3771('0x1f')][_0x4a2d60['id']],_0x4a2d60);}}}return _0x1d9414[_0x3771('0x1f')];};};Realtime[_0x3771('0x3e')][_0x3771('0x51')]=function(){var _0x447769=this;return function(_0x22fe2a){if(_0x22fe2a){freeIsNotKey(_0x22fe2a,_0x447769['servicenowAccounts'],'id');for(var _0x2010aa=0x0,_0x3f2660={},_0x43f71e={};_0x2010aa<_0x22fe2a[_0x3771('0x41')];_0x2010aa+=0x1){_0x3f2660=_0x22fe2a[_0x2010aa];if(_['isUndefined'](_0x447769[_0x3771('0x20')][_0x3f2660['id']])){_0x447769[_0x3771('0x20')][_0x3f2660['id']]=new ServicenowAccount(_0x3f2660);}else{_0x447769['mergeFromDatabase'](_0x447769['servicenowAccounts'][_0x3f2660['id']],_0x3f2660);}}}return _0x447769[_0x3771('0x20')];};};Realtime[_0x3771('0x3e')][_0x3771('0x52')]=function(){var _0x29705b=this;return function(_0x48df9f){if(_0x48df9f){freeIsNotKey(_0x48df9f,_0x29705b[_0x3771('0x21')],'id');for(var _0x50c54b=0x0,_0x36af2d={},_0x1b6337={};_0x50c54b<_0x48df9f[_0x3771('0x41')];_0x50c54b+=0x1){_0x36af2d=_0x48df9f[_0x50c54b];if(_['isUndefined'](_0x29705b[_0x3771('0x21')][_0x36af2d['id']])){_0x29705b[_0x3771('0x21')][_0x36af2d['id']]=new Dynamics365Account(_0x36af2d);}else{_0x29705b[_0x3771('0x3f')](_0x29705b[_0x3771('0x21')][_0x36af2d['id']],_0x36af2d);}}}return _0x29705b['dynamics365Accounts'];};};Realtime[_0x3771('0x3e')][_0x3771('0x53')]=function(){var _0x4ae6b2=this;return function(_0x3c0e49){if(_0x3c0e49){freeIsNotKey(_0x3c0e49,_0x4ae6b2[_0x3771('0x22')],'id');for(var _0x53717d=0x0,_0x20008f={},_0x238b71={};_0x53717d<_0x3c0e49['length'];_0x53717d+=0x1){_0x20008f=_0x3c0e49[_0x53717d];if(_[_0x3771('0x42')](_0x4ae6b2['freshsalesAccounts'][_0x20008f['id']])){_0x4ae6b2[_0x3771('0x22')][_0x20008f['id']]=new FreshsalesAccount(_0x20008f);}else{_0x4ae6b2['mergeFromDatabase'](_0x4ae6b2[_0x3771('0x22')][_0x20008f['id']],_0x20008f);}}}return _0x4ae6b2[_0x3771('0x22')];};};Realtime[_0x3771('0x3e')][_0x3771('0x54')]=function(){var _0x4d5432=this;return function(_0x1e5543){for(var _0x58fa99=0x0;_0x58fa99<_0x1e5543['length'];_0x58fa99+=0x1){_[_0x3771('0x55')](_0x4d5432['voiceQueues'][_0x1e5543[_0x58fa99][_0x3771('0x28')]],_0x1e5543[_0x58fa99]);}return _0x4d5432['voiceQueues'];};};Realtime['prototype'][_0x3771('0x56')]=function(){var _0x4c89a1=this;return function(_0x12eeb4){clearVoiceQueues(_0x4c89a1[_0x3771('0x13')]);if(_0x12eeb4){_0x12eeb4=_[_0x3771('0x57')](_0x12eeb4,_0x3771('0x58'));for(var _0x270076 in _0x12eeb4){if(_0x12eeb4[_0x3771('0x25')](_0x270076)){var _0x51b468={};for(var _0x46bf98=0x0;_0x46bf98<_0x12eeb4[_0x270076][_0x3771('0x41')];_0x46bf98+=0x1){var _0x55239e=_0x12eeb4[_0x270076][_0x46bf98]['queue'];if(_0x4c89a1[_0x3771('0x13')][_0x55239e]){if(_0x12eeb4[_0x270076][_0x46bf98][_0x3771('0x59')]){_0x4c89a1[_0x3771('0x13')][_0x55239e][_0x3771('0x31')]+=0x1;}if(_0x12eeb4[_0x270076][_0x46bf98][_0x3771('0x5a')]){_0x4c89a1[_0x3771('0x13')][_0x55239e][_0x3771('0x32')]+=0x1;}_0x4c89a1[_0x3771('0x13')][_0x55239e]['sumHoldTime']+=moment(_0x12eeb4[_0x270076][_0x46bf98][_0x3771('0x5b')])['diff'](moment(_0x12eeb4[_0x270076][_0x46bf98]['queuecallerjoinAt']),_0x3771('0x5c'))||0x0;if(_0x46bf98===_0x12eeb4[_0x270076][_0x3771('0x41')]-0x1){_0x4c89a1['voiceQueues'][_0x55239e][_0x3771('0x2d')]+=moment(_0x12eeb4[_0x270076][_0x46bf98][_0x3771('0x5d')]||_0x12eeb4[_0x270076][_0x46bf98]['queuecallerabandonAt']||_0x12eeb4[_0x270076][_0x46bf98][_0x3771('0x5e')])['diff'](moment(_0x12eeb4[_0x270076][_0x46bf98]['queuecallerjoinAt']),'seconds')||0x0;_0x4c89a1[_0x3771('0x13')][_0x55239e]['total']+=0x1;if(_0x12eeb4[_0x270076][_0x46bf98][_0x3771('0x5f')]){_0x4c89a1['voiceQueues'][_0x55239e]['answered']+=0x1;_0x4c89a1['voiceQueues'][_0x55239e]['sumBillable']+=moment(_0x12eeb4[_0x270076][_0x46bf98][_0x3771('0x5d')])[_0x3771('0x60')](moment(_0x12eeb4[_0x270076][_0x46bf98][_0x3771('0x5b')]),_0x3771('0x5c'))||0x0;}}else{_0x4c89a1[_0x3771('0x13')][_0x55239e][_0x3771('0x2d')]+=_0x4c89a1[_0x3771('0x13')][_0x55239e][_0x3771('0x2c')]||0x0;}}}}}}return _0x4c89a1[_0x3771('0x13')];};};Realtime['prototype'][_0x3771('0x61')]=function(){var _0x41de9e=this;return function(_0x52bf82){clearVoiceCallReports(_0x41de9e[_0x3771('0x17')]);if(_0x52bf82){for(var _0xffc0a5=0x0;_0xffc0a5<_0x52bf82[_0x3771('0x41')];_0xffc0a5+=0x1){_0x41de9e['outbound'][_0x3771('0x2b')]+=0x1;_0x41de9e[_0x3771('0x17')][_0x3771('0x2d')]+=_0x52bf82[_0xffc0a5][_0x3771('0x62')];if(_0x52bf82[_0xffc0a5][_0x3771('0x63')]==='ANSWERED'){_0x41de9e[_0x3771('0x17')][_0x3771('0x30')]+=0x1;_0x41de9e[_0x3771('0x17')][_0x3771('0x2c')]+=_0x52bf82[_0xffc0a5][_0x3771('0x62')]-_0x52bf82[_0xffc0a5]['billableseconds']||0x0;_0x41de9e[_0x3771('0x17')][_0x3771('0x64')]+=_0x52bf82[_0xffc0a5][_0x3771('0x65')];}}}return _0x41de9e[_0x3771('0x17')];};};Realtime['prototype'][_0x3771('0x66')]=function(){var _0x59e2fe=this;return function(_0x3a62d9){if(_0x3a62d9){freeIsNotKey(_0x3a62d9,_0x59e2fe[_0x3771('0x15')],_0x3771('0x28'));for(var _0x4597e6=0x0,_0x3af570={};_0x4597e6<_0x3a62d9['length'];_0x4597e6+=0x1){_0x3af570=_0x3a62d9[_0x4597e6];if(_[_0x3771('0x42')](_0x59e2fe['campaigns'][_0x3af570['name']])){_0x59e2fe[_0x3771('0x15')][_0x3af570[_0x3771('0x28')]]=new Campaign(_0x3af570);}else{_0x59e2fe[_0x3771('0x3f')](_0x59e2fe[_0x3771('0x15')][_0x3af570[_0x3771('0x28')]],_0x3af570);_0x59e2fe['campaigns'][_0x3af570[_0x3771('0x28')]][_0x3771('0x67')]=_0x3af570[_0x3771('0x68')]?_0x3af570[_0x3771('0x68')][_0x3771('0x28')]:undefined;}}}return _0x59e2fe[_0x3771('0x15')];};};Realtime[_0x3771('0x3e')][_0x3771('0x69')]=function(){var _0x464b5c=this;return function(_0x26e20c){if(_0x26e20c){freeIsNotKey(_0x26e20c,_0x464b5c[_0x3771('0x18')],'id');for(var _0x211ff2=0x0,_0x1727ee={};_0x211ff2<_0x26e20c['length'];_0x211ff2+=0x1){_0x1727ee=_0x26e20c[_0x211ff2];if(_['isUndefined'](_0x464b5c['voiceExtensions'][_0x1727ee['id']])){_0x464b5c['voiceExtensions'][_0x1727ee['id']]=new VoiceExtension(_0x1727ee);}else{_0x464b5c[_0x3771('0x3f')](_0x464b5c['voiceExtensions'][_0x1727ee['id']],_0x1727ee);}}}return _0x464b5c[_0x3771('0x18')];};};Realtime[_0x3771('0x3e')]['initCampaignHopperHistory']=function(){var _0xb45269=this;return function(_0x8399ea){clearCampaigns(_0xb45269[_0x3771('0x15')]);for(var _0x50bcd9=0x0;_0x50bcd9<_0x8399ea[_0x3771('0x41')];_0x50bcd9+=0x1){_[_0x3771('0x55')](_0xb45269[_0x3771('0x15')][_0x8399ea[_0x50bcd9]['name']],_0x8399ea[_0x50bcd9]);}return _0xb45269[_0x3771('0x15')];};};Realtime[_0x3771('0x3e')]['initFaxAccounts']=function(){var _0x12580d=this;return function(_0x266e69){if(_0x266e69){freeIsNotKey(_0x266e69,_0x12580d[_0x3771('0x23')],'id');for(var _0xd1879d=0x0,_0x4a8778={},_0x1a37b9={};_0xd1879d<_0x266e69[_0x3771('0x41')];_0xd1879d+=0x1){_0x4a8778=_0x266e69[_0xd1879d];if(_[_0x3771('0x42')](_0x12580d[_0x3771('0x23')][_0x4a8778['id']])){_0x12580d['faxAccounts'][_0x4a8778['id']]=new FaxAccount(_0x4a8778);}else{_0x12580d[_0x3771('0x3f')](_0x12580d[_0x3771('0x23')][_0x4a8778['id']],_0x4a8778);}}}return _0x12580d[_0x3771('0x23')];};};module[_0x3771('0x6a')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index f18a3c9..8c2aaf8 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 _0x89cd=['disposition','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','uniqueid','UserId','membername','monitor','monitorFilename','monitors','filename','createdAt','exten','connectedlinename','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./userReport','agents','telephones','sync','realtime','xdr','disabled','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','accountcode','name','isNil','find','interface','format','length','connectedlinenum','assigned','lastAssignedTo','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','voiceQueueReport','create','keys','getCallType','channel','split','getAgentByInternal','calleridnum','outbound','destination','type','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel'];(function(_0x1297e2,_0x53276f){var _0x5a7568=function(_0x1eade6){while(--_0x1eade6){_0x1297e2['push'](_0x1297e2['shift']());}};_0x5a7568(++_0x53276f);}(_0x89cd,0x1eb));var _0xd89c=function(_0x1c4a25,_0xd3e9ef){_0x1c4a25=_0x1c4a25-0x0;var _0x277ed7=_0x89cd[_0x1c4a25];return _0x277ed7;};'use strict';var _=require(_0xd89c('0x0'));var moment=require(_0xd89c('0x1'));var util=require(_0xd89c('0x2'));var config=require(_0xd89c('0x3'));var ami=require(_0xd89c('0x4'));var RpcVoiceAgentReport=require(_0xd89c('0x5'));var RpcVoiceCallReport=require(_0xd89c('0x6'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xd89c('0x7'));var RpcVoiceRecording=require(_0xd89c('0x8'));var RpcVoiceTransferReport=require(_0xd89c('0x9'));var VoiceQueueReport=require(_0xd89c('0xa'));var VoiceCallReport=require(_0xd89c('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xd89c('0xc'));function Report(_0x3497fd){this['realtime']=_0x3497fd;this['agents']=_0x3497fd[_0xd89c('0xd')];this['telephones']=_0x3497fd[_0xd89c('0xe')];}Report['prototype'][_0xd89c('0xf')]=function(_0x5e7884){var _0x3b084e=new VoiceQueueReport(this['realtime']);var _0x49f93b=new VoiceAgentReport(this[_0xd89c('0x10')]);var _0x324413=new VoiceDialReport(this[_0xd89c('0x10')]);var _0xadc90e=new VoiceCallReport(this['realtime']);var _0x58a597=new UserReport(this[_0xd89c('0x10')]);if(config[_0xd89c('0x11')]&&config[_0xd89c('0x11')][_0xd89c('0x12')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0xd89c('0x13')](this));ami['on']('custom:voiceCallReport',this[_0xd89c('0x14')][_0xd89c('0x13')](this));ami['on'](_0xd89c('0x15'),this[_0xd89c('0x16')][_0xd89c('0x13')](this));ami['on'](_0xd89c('0x17'),this[_0xd89c('0x18')][_0xd89c('0x13')](this));ami['on'](_0xd89c('0x19'),this[_0xd89c('0x1a')][_0xd89c('0x13')](this));ami['on'](_0xd89c('0x1b'),this[_0xd89c('0x1c')]['bind'](this));}};Report[_0xd89c('0x1d')][_0xd89c('0x1e')]=function(_0x5ce637){var _0x18dc77;_0x18dc77=_['find'](this['agents'],function(_0x1b2bf3){return _0x1b2bf3[_0xd89c('0x1f')]==_0x5ce637||_0x1b2bf3[_0xd89c('0x20')]==_0x5ce637;});if(_[_0xd89c('0x21')](_0x18dc77)){var _0x203b5=_[_0xd89c('0x22')](this[_0xd89c('0xe')],function(_0x38b4e2){return _0x38b4e2['accountcode']==_0x5ce637||_0x38b4e2[_0xd89c('0x20')]==_0x5ce637;});if(_0x203b5){_0x18dc77=_['find'](this[_0xd89c('0xd')],function(_0x34a5da){return _0x34a5da[_0xd89c('0x23')]==util[_0xd89c('0x24')]('SIP/%s',_0x203b5['name']);});}}return _0x18dc77;};Report['prototype']['voiceQueueReport']=function(_0x3f1c2a){for(var _0x324508=0x0;_0x324508<_0x3f1c2a[_0xd89c('0x25')];_0x324508+=0x1){var _0x36d8f9=this[_0xd89c('0x1e')](_0x3f1c2a[_0x324508][_0xd89c('0x26')]);if(_0x36d8f9){_0x3f1c2a[_0x324508][_0xd89c('0x1f')]=_0x36d8f9[_0xd89c('0x1f')];_0x3f1c2a[_0x324508][_0xd89c('0x27')]=!![];_0x3f1c2a[_0x324508][_0xd89c('0x28')]=_0x36d8f9[_0xd89c('0x20')];_0x3f1c2a[_0x324508][_0xd89c('0x23')]=_[_0xd89c('0x21')](_0x36d8f9['interface'])?util['format'](_0xd89c('0x29'),_0x36d8f9[_0xd89c('0x20')]):_0x36d8f9[_0xd89c('0x23')];if(_0x3f1c2a[_0x324508]['queuecallercomplete']){_0x3f1c2a[_0x324508]['queuecallercompleteAt']=moment()[_0xd89c('0x24')](_0xd89c('0x2a'));}if(_0x3f1c2a[_0x324508][_0xd89c('0x2b')]){_0x3f1c2a[_0x324508][_0xd89c('0x2c')]=moment()[_0xd89c('0x24')](_0xd89c('0x2a'));}RpcMemberReport[_0xd89c('0x2d')](_0x3f1c2a[_0x324508]);}RpcVoiceQueueReport[_0xd89c('0x2e')](_0x3f1c2a[_0x324508]);}};function extractCalleridNumber(_0x39156a){var _0x5f4d82=_0x39156a['match'](/<(.*?)>/);return _0x5f4d82?_0x5f4d82[0x1]:_0x39156a;}Report[_0xd89c('0x1d')]['getAgentByInternal']=function(_0x817094){for(var _0x3d5e6e=0x0;_0x3d5e6e','transfers','linkedid','transfereelinkedid','UserId','split','membername','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','voiceAgentReport','forEach','Local','substring','indexOf','mobile','phone','transfererlinkedid','exports','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','custom:voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','interface','prototype','voiceQueueReport','length','assigned','lastAssignedTo','format','SIP/%s','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','create','match','getAgentByInternal'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5bb5,0x188));var _0x55bb=function(_0x3a0006,_0x2f2279){_0x3a0006=_0x3a0006-0x0;var _0x381fdd=_0x5bb5[_0x3a0006];return _0x381fdd;};'use strict';var _=require('lodash');var moment=require(_0x55bb('0x0'));var util=require(_0x55bb('0x1'));var config=require(_0x55bb('0x2'));var ami=require(_0x55bb('0x3'));var RpcVoiceAgentReport=require(_0x55bb('0x4'));var RpcVoiceCallReport=require(_0x55bb('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x55bb('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x55bb('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x55bb('0x8'));var VoiceAgentReport=require(_0x55bb('0x9'));var VoiceDialReport=require(_0x55bb('0xa'));var UserReport=require(_0x55bb('0xb'));function Report(_0x1a3212){this[_0x55bb('0xc')]=_0x1a3212;this['agents']=_0x1a3212[_0x55bb('0xd')];this[_0x55bb('0xe')]=_0x1a3212['telephones'];}Report['prototype'][_0x55bb('0xf')]=function(_0x5db0a5){var _0x5abd0c=new VoiceQueueReport(this[_0x55bb('0xc')]);var _0x58d549=new VoiceAgentReport(this['realtime']);var _0x4dcefc=new VoiceDialReport(this['realtime']);var _0xa6f371=new VoiceCallReport(this[_0x55bb('0xc')]);var _0x17e0b0=new UserReport(this[_0x55bb('0xc')]);if(config[_0x55bb('0x10')]&&config[_0x55bb('0x10')]['disabled']){ami['on'](_0x55bb('0x11'),this['voiceQueueReport'][_0x55bb('0x12')](this));ami['on'](_0x55bb('0x13'),this['voiceCallReport'][_0x55bb('0x12')](this));ami['on'](_0x55bb('0x14'),this['voiceAgentReport'][_0x55bb('0x12')](this));ami['on']('custom:voiceDialReport',this[_0x55bb('0x15')][_0x55bb('0x12')](this));ami['on'](_0x55bb('0x16'),this[_0x55bb('0x17')][_0x55bb('0x12')](this));ami['on']('attendedtransfer',this[_0x55bb('0x18')][_0x55bb('0x12')](this));}};Report['prototype'][_0x55bb('0x19')]=function(_0x25b000){var _0x350042;_0x350042=_['find'](this[_0x55bb('0xd')],function(_0x3ae0de){return _0x3ae0de[_0x55bb('0x1a')]==_0x25b000||_0x3ae0de[_0x55bb('0x1b')]==_0x25b000;});if(_[_0x55bb('0x1c')](_0x350042)){var _0x55ee12=_['find'](this[_0x55bb('0xe')],function(_0x2a19a3){return _0x2a19a3[_0x55bb('0x1a')]==_0x25b000||_0x2a19a3[_0x55bb('0x1b')]==_0x25b000;});if(_0x55ee12){_0x350042=_[_0x55bb('0x1d')](this[_0x55bb('0xd')],function(_0x1fccb4){return _0x1fccb4[_0x55bb('0x1e')]==util['format']('SIP/%s',_0x55ee12[_0x55bb('0x1b')]);});}}return _0x350042;};Report[_0x55bb('0x1f')][_0x55bb('0x20')]=function(_0x413787){for(var _0x4d9a52=0x0;_0x4d9a52<_0x413787[_0x55bb('0x21')];_0x4d9a52+=0x1){var _0x5d5f1b=this[_0x55bb('0x19')](_0x413787[_0x4d9a52]['connectedlinenum']);if(_0x5d5f1b){_0x413787[_0x4d9a52][_0x55bb('0x1a')]=_0x5d5f1b['accountcode'];_0x413787[_0x4d9a52][_0x55bb('0x22')]=!![];_0x413787[_0x4d9a52][_0x55bb('0x23')]=_0x5d5f1b[_0x55bb('0x1b')];_0x413787[_0x4d9a52]['interface']=_['isNil'](_0x5d5f1b[_0x55bb('0x1e')])?util[_0x55bb('0x24')](_0x55bb('0x25'),_0x5d5f1b[_0x55bb('0x1b')]):_0x5d5f1b[_0x55bb('0x1e')];if(_0x413787[_0x4d9a52]['queuecallercomplete']){_0x413787[_0x4d9a52][_0x55bb('0x26')]=moment()['format'](_0x55bb('0x27'));}if(_0x413787[_0x4d9a52]['queuecallerexit']){_0x413787[_0x4d9a52]['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x55bb('0x20')](_0x413787[_0x4d9a52]);}RpcVoiceQueueReport[_0x55bb('0x28')](_0x413787[_0x4d9a52]);}};function extractCalleridNumber(_0x296ae5){var _0x419154=_0x296ae5[_0x55bb('0x29')](/<(.*?)>/);return _0x419154?_0x419154[0x1]:_0x296ae5;}Report['prototype'][_0x55bb('0x2a')]=function(_0x232f1e){for(var _0x52a681=0x0;_0x52a6810x0?_0x1e10cb:0x0;this['voiceQueues'][_0x2eecdc[_0x7f88('0x63')]][_0x7f88('0x2f')]=this[_0x7f88('0x12')][_0x2eecdc[_0x7f88('0x63')]][_0x7f88('0x2f')]>_['toNumber'](_0x2eecdc['loggedin'])?_[_0x7f88('0x69')](_0x2eecdc[_0x7f88('0x6b')]):this[_0x7f88('0x12')][_0x2eecdc[_0x7f88('0x63')]]['talking'];this[_0x7f88('0x4f')](this[_0x7f88('0x12')][_0x2eecdc[_0x7f88('0x63')]],_0x7f88('0x16'));}logger[_0x7f88('0x44')](_0x7f88('0x6c'),util[_0x7f88('0x3f')](this[_0x7f88('0x12')][_0x2eecdc['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0x7f88('0x6d'),this['voiceQueues'][_0x2eecdc[_0x7f88('0x63')]]);}}}catch(_0x131041){logger[_0x7f88('0x3c')](_0x7f88('0x62'),util['inspect'](_0x131041,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0x6e')]=function(_0x31c890){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x7f88('0x3f')](_0x31c890,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x7f88('0xc')]['syncQueueCallerJoin']=function(_0x1b5d13){try{if(this[_0x7f88('0x5e')](_0x1b5d13)){logger['debug'](_0x7f88('0x6f'),_0x1b5d13[_0x7f88('0x4c')],util['inspect'](_0x1b5d13,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x1b5d13[_0x7f88('0x4c')]]))this[_0x7f88('0xf')][_0x1b5d13[_0x7f88('0x4c')]]=[];if(_['isUndefined'](this[_0x7f88('0x34')][_0x1b5d13['uniqueid']]))this['channels'][_0x1b5d13[_0x7f88('0x4c')]]={};var _0x5c4d33=new QueueReport();_0x5c4d33[_0x7f88('0x49')]=_0x1b5d13[_0x7f88('0x63')];_0x5c4d33[_0x7f88('0x50')]=this['voiceQueues'][_0x5c4d33[_0x7f88('0x49')]]&&this['voiceQueues'][_0x5c4d33[_0x7f88('0x49')]][_0x7f88('0x50')]?this['voiceQueues'][_0x5c4d33['name']][_0x7f88('0x50')]||_0x7f88('0x51'):'inbound';_0x5c4d33['queue']=_0x1b5d13['queue'];_0x5c4d33[_0x7f88('0x70')]=moment()[_0x7f88('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c4d33['position']=_0x1b5d13[_0x7f88('0x71')];_0x5c4d33[_0x7f88('0x72')]=_0x1b5d13[_0x7f88('0x72')];_0x5c4d33['uniqueid']=_0x1b5d13[_0x7f88('0x4c')];_0x5c4d33[_0x7f88('0x73')]=this[_0x7f88('0x34')][_0x1b5d13['uniqueid']][_0x7f88('0x73')];logger[_0x7f88('0x65')](_0x7f88('0x74'),_0x5c4d33[_0x7f88('0x49')],_0x5c4d33[_0x7f88('0x50')]);_[_0x7f88('0x75')](_0x5c4d33,_[_0x7f88('0x76')](_0x1b5d13,_['keys'](_0x5c4d33)));this[_0x7f88('0xf')][_0x1b5d13['uniqueid']][_0x7f88('0x77')](_0x5c4d33);this[_0x7f88('0x34')][_0x1b5d13['uniqueid']]=_0x5c4d33;this[_0x7f88('0x78')](_0x5c4d33,_0x7f88('0x18'));}}catch(_0x3158d2){logger[_0x7f88('0x3c')](_0x7f88('0x6f'),_0x1b5d13[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x3158d2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7f88('0xc')]['syncQueueCallerAbandon']=function(_0x573d7d){try{if(this[_0x7f88('0x5e')](_0x573d7d)){logger[_0x7f88('0x44')](_0x7f88('0x79'),_0x573d7d[_0x7f88('0x4c')],util['inspect'](_0x573d7d,{'showHidden':![],'depth':null}));if(this[_0x7f88('0xf')][_0x573d7d[_0x7f88('0x4c')]]){var _0x3cdc82=_['last'](this[_0x7f88('0xf')][_0x573d7d[_0x7f88('0x4c')]]);_0x3cdc82[_0x7f88('0x7a')]=![];_0x3cdc82[_0x7f88('0x7b')]=null;_0x3cdc82[_0x7f88('0x7c')]=_0x573d7d[_0x7f88('0x7c')];_0x3cdc82[_0x7f88('0x7d')]=_0x573d7d[_0x7f88('0x7d')];_0x3cdc82[_0x7f88('0x1a')]=!![];_0x3cdc82[_0x7f88('0x7e')]=moment()[_0x7f88('0x47')](_0x7f88('0x7f'));_0x3cdc82[_0x7f88('0x80')]=_0x7f88('0x81');_0x3cdc82[_0x7f88('0x82')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x3cdc82[_0x7f88('0x49')],_0x3cdc82[_0x7f88('0x50')]);this[_0x7f88('0x34')][_0x573d7d[_0x7f88('0x4c')]]=_0x3cdc82;this[_0x7f88('0x42')](_0x3cdc82,'queuecallerabandon');}}}catch(_0x1dc351){logger[_0x7f88('0x3c')](_0x7f88('0x79'),_0x573d7d['uniqueid'],util[_0x7f88('0x3f')](_0x1dc351,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7f88('0x1d')]=function(_0x55d9bb){try{if(this[_0x7f88('0x5e')](_0x55d9bb)){logger[_0x7f88('0x44')](_0x7f88('0x83'),_0x55d9bb[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x55d9bb,{'showHidden':![],'depth':null}));if(this[_0x7f88('0xf')][_0x55d9bb[_0x7f88('0x4c')]]){var _0x1b2a55=_[_0x7f88('0x84')](this['queueReports'][_0x55d9bb[_0x7f88('0x4c')]]);_0x1b2a55[_0x7f88('0x85')]=moment()[_0x7f88('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x1b2a55['connectedlinenum']=_0x55d9bb[_0x7f88('0x86')];_0x1b2a55[_0x7f88('0x87')]=_0x55d9bb[_0x7f88('0x87')];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1b2a55[_0x7f88('0x49')],_0x1b2a55[_0x7f88('0x50')],_0x55d9bb[_0x7f88('0x86')],_0x55d9bb['connectedlinename']);this[_0x7f88('0x34')][_0x55d9bb[_0x7f88('0x4c')]]=_0x1b2a55;this['emitVoiceQueueChannelSave'](_0x1b2a55,_0x7f88('0x1c'));}}}catch(_0x33db26){logger[_0x7f88('0x3c')](_0x7f88('0x83'),_0x55d9bb[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x33db26,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7f88('0x21')]=function(_0x3e0b7f){try{if(this[_0x7f88('0x5e')](_0x3e0b7f)){logger[_0x7f88('0x44')](_0x7f88('0x88'),_0x3e0b7f[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x3e0b7f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3e0b7f[_0x7f88('0x4c')]]){var _0x4cc046=_['last'](this[_0x7f88('0xf')][_0x3e0b7f[_0x7f88('0x4c')]]);_0x4cc046['queuecallercomplete']=!![];_0x4cc046[_0x7f88('0x80')]=_0x7f88('0x89');logger[_0x7f88('0x65')](_0x7f88('0x8a'),_0x4cc046[_0x7f88('0x49')],_0x4cc046[_0x7f88('0x50')]);}}}catch(_0x556701){logger[_0x7f88('0x3c')](_0x7f88('0x88'),_0x3e0b7f[_0x7f88('0x4c')],util['inspect'](_0x556701,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0x1f')]=function(_0x58f388){try{if(this['isNotNull'](_0x58f388)){logger[_0x7f88('0x44')](_0x7f88('0x8b'),_0x58f388[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x58f388,{'showHidden':![],'depth':null}));if(this[_0x7f88('0xf')][_0x58f388[_0x7f88('0x4c')]]){var _0x6ade8f=_[_0x7f88('0x84')](this['queueReports'][_0x58f388[_0x7f88('0x4c')]]);_0x6ade8f[_0x7f88('0x1a')]=![];_0x6ade8f[_0x7f88('0x7e')]=null;_0x6ade8f['assigned']=!![];_0x6ade8f[_0x7f88('0x82')]=_0x58f388[_0x7f88('0x8c')];_0x6ade8f[_0x7f88('0x7c')]=_0x58f388['holdtime'];_0x6ade8f[_0x7f88('0x7a')]=!![];_0x6ade8f[_0x7f88('0x8d')]=![];_0x6ade8f['queuecallerexitAt']=null;if(!_0x6ade8f['transfer']){if(_0x58f388[_0x7f88('0x8e')]==_0x7f88('0x8f')){_0x6ade8f[_0x7f88('0x80')]=_0x7f88('0x90');logger[_0x7f88('0x65')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x6ade8f[_0x7f88('0x49')],_0x6ade8f[_0x7f88('0x50')]);}else{if(_['startsWith'](_0x58f388[_0x7f88('0x91')][_0x7f88('0x92')](),_0x7f88('0x93'))){if(this['queueReports'][_0x58f388[_0x7f88('0x94')]]){var _0x368413=_['last'](this[_0x7f88('0xf')][_0x58f388[_0x7f88('0x94')]]);_0x368413[_0x7f88('0x7a')]=![];_0x368413[_0x7f88('0x8d')]=!![];_0x368413[_0x7f88('0x95')]=moment(_0x6ade8f[_0x7f88('0x70')])[_0x7f88('0x96')](_0x58f388[_0x7f88('0x7c')],'seconds')[_0x7f88('0x47')](_0x7f88('0x7f'));_0x368413[_0x7f88('0x80')]=_0x7f88('0x97');_0x368413[_0x7f88('0x8f')]=!![];_0x368413[_0x7f88('0x98')]=_0x7f88('0x99');_0x368413['transferexten']=_0x58f388[_0x7f88('0x9a')];_0x368413[_0x7f88('0x9b')]=_0x58f388[_0x7f88('0x4c')];logger[_0x7f88('0x65')](_0x7f88('0x9c'),_0x368413[_0x7f88('0x49')],_0x368413[_0x7f88('0x50')]);var _0x1d44b9=this[_0x7f88('0xf')][_0x58f388[_0x7f88('0x94')]];this['queueReports'][_0x58f388['linkedid']]=this[_0x7f88('0xf')][_0x58f388[_0x7f88('0x4c')]];this[_0x7f88('0xf')][_0x58f388[_0x7f88('0x4c')]]=_0x1d44b9;}}else{_0x6ade8f[_0x7f88('0x80')]='COMPLETEDBY'+_0x58f388[_0x7f88('0x8e')][_0x7f88('0x9d')]();logger[_0x7f88('0x65')](_0x7f88('0x9e'),_0x6ade8f[_0x7f88('0x49')],_0x6ade8f[_0x7f88('0x50')],_0x6ade8f[_0x7f88('0x80')]);}}}this['channels'][_0x58f388['uniqueid']]=_0x6ade8f;this['emitVoiceQueueChannelRemove'](_0x6ade8f,'agentcomplete');}}}catch(_0x41c591){logger[_0x7f88('0x3c')]('[%s][voiceQueueReport][agentcomplete]',_0x58f388[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x41c591,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7f88('0x9f')]=function(_0x299a79){try{if(this[_0x7f88('0x5e')](_0x299a79)){logger[_0x7f88('0x44')](_0x7f88('0xa0'),_0x299a79['uniqueid'],util[_0x7f88('0x3f')](_0x299a79,{'showHidden':![],'depth':null}));this[_0x7f88('0xa1')](_0x299a79[_0x7f88('0x4c')],_[_0x7f88('0xa2')](_0x299a79[_0x7f88('0xa3')])[0x0],_0x299a79[_0x7f88('0xa4')]);if(this[_0x7f88('0xf')][_0x299a79['uniqueid']]){var _0x5db04d=_['last'](this[_0x7f88('0xf')][_0x299a79[_0x7f88('0x4c')]]);if(_0x5db04d){if(this[_0x7f88('0x5e')](_0x299a79[_0x7f88('0xa3')])&&this[_0x7f88('0x5e')](_0x299a79[_0x7f88('0xa3')][_0x7f88('0xa5')])){switch(_0x299a79[_0x7f88('0xa4')]){case'CONTINUE':_0x5db04d[_0x7f88('0x8d')]=![];_0x5db04d[_0x7f88('0x95')]=null;break;case'TIMEOUT':_0x5db04d['lastevent']=_0x7f88('0xa6');_0x5db04d['queuecallerexit']=!![];_0x5db04d[_0x7f88('0x95')]=moment()['format'](_0x7f88('0x7f'));_0x5db04d[_0x7f88('0x85')]=moment()[_0x7f88('0x47')](_0x7f88('0x7f'));logger['debug'](_0x7f88('0xa7'),_0x299a79['uniqueid'],util[_0x7f88('0x3f')](_0x5db04d,{'showHidden':![],'depth':null}));ami[_0x7f88('0x43')](_0x7f88('0xa8'),_0x5db04d);break;default:_0x5db04d[_0x7f88('0x8d')]=!![];_0x5db04d[_0x7f88('0x95')]=moment()[_0x7f88('0x47')](_0x7f88('0x7f'));_0x5db04d[_0x7f88('0x85')]=moment()[_0x7f88('0x47')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5db04d[_0x7f88('0x1a')]=![];_0x5db04d[_0x7f88('0x7e')]=null;_0x5db04d['queuecallerexitreason']=_0x299a79['value'];this['channels'][_0x299a79[_0x7f88('0x4c')]]=_0x5db04d;this[_0x7f88('0x42')](_0x5db04d,_0x7f88('0xa9'));}else if(this['isNotNull'](_0x299a79[_0x7f88('0xa3')])&&this[_0x7f88('0x5e')](_0x299a79[_0x7f88('0xa3')][_0x7f88('0xaa')])){if(!_0x5db04d[_0x7f88('0x1a')]){_0x5db04d[_0x7f88('0x8d')]=!![];_0x5db04d[_0x7f88('0x95')]=moment()[_0x7f88('0x47')](_0x7f88('0x7f'));_0x5db04d['queuecallerexitreason']='EXITWITHKEY';_0x5db04d[_0x7f88('0x85')]=moment()[_0x7f88('0x47')](_0x7f88('0x7f'));this[_0x7f88('0x34')][_0x299a79[_0x7f88('0x4c')]]=_0x5db04d;}}logger[_0x7f88('0x65')](_0x7f88('0xab'),_0x299a79[_0x7f88('0x4c')],_0x5db04d[_0x7f88('0x49')],_0x5db04d[_0x7f88('0x50')],_['keys'](_0x299a79[_0x7f88('0xa3')])[0x0],_0x299a79[_0x7f88('0xa4')]);_0x5db04d[_0x7f88('0x15')]=this[_0x7f88('0x15')][_0x299a79['uniqueid']];}}}}catch(_0x9479){logger[_0x7f88('0x3c')]('[%s][voiceQueueReport][varset]',_0x299a79[_0x7f88('0x4c')],util['inspect'](_0x9479,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0xa1')]=function(_0x56d1cd,_0x59ae1f,_0x2ea78c){var _0x3dccf3=[_0x7f88('0xac'),_0x7f88('0xad'),_0x7f88('0xae'),_0x7f88('0xaf'),_0x7f88('0xb0'),_0x7f88('0xb1'),'rtpaudioqosrtt',_0x7f88('0xb2'),'sipcallid',_0x7f88('0xb3'),_0x7f88('0xb4'),_0x7f88('0xb5'),'membercalls',_0x7f88('0xb6'),_0x7f88('0xb7'),_0x7f88('0xb8'),_0x7f88('0x8c'),_0x7f88('0xb9'),_0x7f88('0xba')];if(!_[_0x7f88('0x37')](_0x59ae1f)&&!_[_0x7f88('0xbb')](_0x3dccf3,_0x59ae1f)){if(_[_0x7f88('0x5f')](this[_0x7f88('0x15')][_0x56d1cd])){this[_0x7f88('0x15')][_0x56d1cd]={};}this[_0x7f88('0x15')][_0x56d1cd][_0x59ae1f]=_0x2ea78c;}};VoiceQueueReport[_0x7f88('0xc')]['syncHangup']=function(_0x173408){try{if(this[_0x7f88('0x5e')](_0x173408)){logger[_0x7f88('0x44')](_0x7f88('0xbc'),_0x173408[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x173408,{'showHidden':![],'depth':null}));if(this[_0x7f88('0xf')][_0x173408['uniqueid']]){for(var _0x5705c4=0x0,_0x4d1e74={};_0x5705c40x0?_0x2c988e:0x0;this[_0x8ddb('0x12')][_0x3361cc[_0x8ddb('0x6b')]][_0x8ddb('0x32')]=this[_0x8ddb('0x12')][_0x3361cc[_0x8ddb('0x6b')]][_0x8ddb('0x32')]>_[_0x8ddb('0x71')](_0x3361cc[_0x8ddb('0x72')])?_['toNumber'](_0x3361cc[_0x8ddb('0x72')]):this[_0x8ddb('0x12')][_0x3361cc[_0x8ddb('0x6b')]]['talking'];this[_0x8ddb('0x4f')](this[_0x8ddb('0x12')][_0x3361cc['queue']],_0x8ddb('0x16'));}logger[_0x8ddb('0x44')](_0x8ddb('0x73'),util[_0x8ddb('0x3e')](this[_0x8ddb('0x12')][_0x3361cc[_0x8ddb('0x6b')]],{'showHidden':![],'depth':null}));ami[_0x8ddb('0x42')](_0x8ddb('0x74'),this['voiceQueues'][_0x3361cc[_0x8ddb('0x6b')]]);}}}catch(_0x586e77){logger['error'](_0x8ddb('0x6a'),util['inspect'](_0x586e77,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8ddb('0x35')][_0x8ddb('0x19')]=function(_0x429330){logger[_0x8ddb('0x44')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x429330,{'showHidden':![],'depth':null}));this[_0x8ddb('0x13')]=!![];};VoiceQueueReport[_0x8ddb('0x35')]['syncQueueCallerJoin']=function(_0x526440){try{if(this[_0x8ddb('0x64')](_0x526440)){logger[_0x8ddb('0x44')](_0x8ddb('0x75'),_0x526440[_0x8ddb('0x46')],util[_0x8ddb('0x3e')](_0x526440,{'showHidden':![],'depth':null}));if(_[_0x8ddb('0x65')](this[_0x8ddb('0xf')][_0x526440[_0x8ddb('0x46')]]))this[_0x8ddb('0xf')][_0x526440[_0x8ddb('0x46')]]=[];if(_[_0x8ddb('0x65')](this[_0x8ddb('0x11')][_0x526440[_0x8ddb('0x46')]]))this[_0x8ddb('0x11')][_0x526440['uniqueid']]={};var _0x2eaf9b=new QueueReport();_0x2eaf9b[_0x8ddb('0x49')]=_0x526440[_0x8ddb('0x6b')];_0x2eaf9b[_0x8ddb('0x5a')]=this['voiceQueues'][_0x2eaf9b[_0x8ddb('0x49')]]&&this[_0x8ddb('0x12')][_0x2eaf9b[_0x8ddb('0x49')]][_0x8ddb('0x5a')]?this['voiceQueues'][_0x2eaf9b[_0x8ddb('0x49')]][_0x8ddb('0x5a')]||'inbound':_0x8ddb('0x50');_0x2eaf9b[_0x8ddb('0x6b')]=_0x526440[_0x8ddb('0x6b')];_0x2eaf9b[_0x8ddb('0x76')]=moment()[_0x8ddb('0x47')](_0x8ddb('0x77'));_0x2eaf9b[_0x8ddb('0x78')]=_0x526440[_0x8ddb('0x78')];_0x2eaf9b[_0x8ddb('0x79')]=_0x526440[_0x8ddb('0x79')];_0x2eaf9b[_0x8ddb('0x46')]=_0x526440[_0x8ddb('0x46')];_0x2eaf9b[_0x8ddb('0x7a')]=this[_0x8ddb('0x11')][_0x526440['uniqueid']][_0x8ddb('0x7a')];logger[_0x8ddb('0x6d')](_0x8ddb('0x7b'),_0x2eaf9b['name'],_0x2eaf9b['type']);_[_0x8ddb('0x7c')](_0x2eaf9b,_[_0x8ddb('0x7d')](_0x526440,_[_0x8ddb('0x7e')](_0x2eaf9b)));this[_0x8ddb('0xf')][_0x526440['uniqueid']][_0x8ddb('0x7f')](_0x2eaf9b);this[_0x8ddb('0x11')][_0x526440[_0x8ddb('0x46')]]=_0x2eaf9b;this[_0x8ddb('0x43')](_0x2eaf9b,'queuecallerjoin');}}catch(_0x961cd4){logger[_0x8ddb('0x3f')](_0x8ddb('0x75'),_0x526440[_0x8ddb('0x46')],util[_0x8ddb('0x3e')](_0x961cd4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8ddb('0x35')][_0x8ddb('0x1d')]=function(_0x806c4){try{if(this[_0x8ddb('0x64')](_0x806c4)){logger[_0x8ddb('0x44')](_0x8ddb('0x80'),_0x806c4[_0x8ddb('0x46')],util[_0x8ddb('0x3e')](_0x806c4,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x806c4[_0x8ddb('0x46')]]){var _0x4edf2c=_[_0x8ddb('0x81')](this[_0x8ddb('0xf')][_0x806c4['uniqueid']]);_0x4edf2c[_0x8ddb('0x82')]=![];_0x4edf2c[_0x8ddb('0x83')]=null;_0x4edf2c[_0x8ddb('0x84')]=_0x806c4[_0x8ddb('0x84')];_0x4edf2c[_0x8ddb('0x85')]=_0x806c4[_0x8ddb('0x85')];_0x4edf2c[_0x8ddb('0x1c')]=!![];_0x4edf2c[_0x8ddb('0x86')]=moment()[_0x8ddb('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x4edf2c[_0x8ddb('0x87')]=_0x8ddb('0x88');_0x4edf2c[_0x8ddb('0x89')]=null;logger[_0x8ddb('0x6d')](_0x8ddb('0x8a'),_0x4edf2c[_0x8ddb('0x49')],_0x4edf2c['type']);this[_0x8ddb('0x11')][_0x806c4['uniqueid']]=_0x4edf2c;this[_0x8ddb('0x41')](_0x4edf2c,_0x8ddb('0x1c'));}}}catch(_0x4c8461){logger['error'](_0x8ddb('0x80'),_0x806c4[_0x8ddb('0x46')],util[_0x8ddb('0x3e')](_0x4c8461,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8ddb('0x35')][_0x8ddb('0x1e')]=function(_0x3703bd){try{if(this[_0x8ddb('0x64')](_0x3703bd)){logger['debug'](_0x8ddb('0x8b'),_0x3703bd['uniqueid'],util['inspect'](_0x3703bd,{'showHidden':![],'depth':null}));if(this[_0x8ddb('0xf')][_0x3703bd[_0x8ddb('0x46')]]){var _0x57d39f=_[_0x8ddb('0x81')](this[_0x8ddb('0xf')][_0x3703bd[_0x8ddb('0x46')]]);_0x57d39f[_0x8ddb('0x8c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x57d39f['connectedlinenum']=_0x3703bd[_0x8ddb('0x8d')];_0x57d39f[_0x8ddb('0x8e')]=_0x3703bd[_0x8ddb('0x8e')];logger['info'](_0x8ddb('0x8f'),_0x57d39f['name'],_0x57d39f[_0x8ddb('0x5a')],_0x3703bd[_0x8ddb('0x8d')],_0x3703bd[_0x8ddb('0x8e')]);this[_0x8ddb('0x11')][_0x3703bd['uniqueid']]=_0x57d39f;this[_0x8ddb('0x43')](_0x57d39f,'queuecallerleave');}}}catch(_0x409142){logger[_0x8ddb('0x3f')](_0x8ddb('0x8b'),_0x3703bd[_0x8ddb('0x46')],util[_0x8ddb('0x3e')](_0x409142,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8ddb('0x35')]['syncAgentConnect']=function(_0x446838){try{if(this['isNotNull'](_0x446838)){logger[_0x8ddb('0x44')](_0x8ddb('0x90'),_0x446838['uniqueid'],util[_0x8ddb('0x3e')](_0x446838,{'showHidden':![],'depth':null}));if(this[_0x8ddb('0xf')][_0x446838[_0x8ddb('0x46')]]){var _0x4bddae=_[_0x8ddb('0x81')](this[_0x8ddb('0xf')][_0x446838[_0x8ddb('0x46')]]);_0x4bddae[_0x8ddb('0x82')]=!![];_0x4bddae[_0x8ddb('0x87')]='COMPLETEDBYAGENT';logger['info'](_0x8ddb('0x91'),_0x4bddae[_0x8ddb('0x49')],_0x4bddae['type']);}}}catch(_0x43439e){logger['error'](_0x8ddb('0x90'),_0x446838[_0x8ddb('0x46')],util[_0x8ddb('0x3e')](_0x43439e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8ddb('0x35')][_0x8ddb('0x20')]=function(_0x2feac3){try{if(this['isNotNull'](_0x2feac3)){logger[_0x8ddb('0x44')]('[%s][voiceQueueReport][agentcomplete]',_0x2feac3[_0x8ddb('0x46')],util[_0x8ddb('0x3e')](_0x2feac3,{'showHidden':![],'depth':null}));if(this[_0x8ddb('0xf')][_0x2feac3[_0x8ddb('0x46')]]){var _0x3cb8b7=_['last'](this[_0x8ddb('0xf')][_0x2feac3[_0x8ddb('0x46')]]);_0x3cb8b7['queuecallerabandon']=![];_0x3cb8b7['queuecallerabandonAt']=null;_0x3cb8b7[_0x8ddb('0x92')]=!![];_0x3cb8b7[_0x8ddb('0x89')]=_0x2feac3[_0x8ddb('0x93')];_0x3cb8b7[_0x8ddb('0x84')]=_0x2feac3[_0x8ddb('0x84')];_0x3cb8b7[_0x8ddb('0x82')]=!![];_0x3cb8b7[_0x8ddb('0x94')]=![];_0x3cb8b7['queuecallerexitAt']=null;if(!_0x3cb8b7[_0x8ddb('0x95')]){if(_0x2feac3[_0x8ddb('0x96')]=='transfer'){_0x3cb8b7['queuecallerexitreason']='COMPLETED';logger[_0x8ddb('0x6d')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x3cb8b7[_0x8ddb('0x49')],_0x3cb8b7[_0x8ddb('0x5a')]);}else{if(_[_0x8ddb('0x97')](_0x2feac3[_0x8ddb('0x3b')][_0x8ddb('0x98')](),_0x8ddb('0x99'))){if(this[_0x8ddb('0xf')][_0x2feac3[_0x8ddb('0x9a')]]){var _0x323ef3=_[_0x8ddb('0x81')](this[_0x8ddb('0xf')][_0x2feac3[_0x8ddb('0x9a')]]);_0x323ef3[_0x8ddb('0x82')]=![];_0x323ef3[_0x8ddb('0x94')]=!![];_0x323ef3[_0x8ddb('0x9b')]=moment(_0x3cb8b7[_0x8ddb('0x76')])['add'](_0x2feac3[_0x8ddb('0x84')],'seconds')[_0x8ddb('0x47')](_0x8ddb('0x77'));_0x323ef3[_0x8ddb('0x87')]=_0x8ddb('0x9c');_0x323ef3['transfer']=!![];_0x323ef3[_0x8ddb('0x9d')]=_0x8ddb('0x9e');_0x323ef3['transferexten']=_0x2feac3[_0x8ddb('0x9f')];_0x323ef3[_0x8ddb('0xa0')]=_0x2feac3[_0x8ddb('0x46')];logger['info'](_0x8ddb('0xa1'),_0x323ef3['name'],_0x323ef3[_0x8ddb('0x5a')]);var _0xaca0a0=this[_0x8ddb('0xf')][_0x2feac3['linkedid']];this[_0x8ddb('0xf')][_0x2feac3[_0x8ddb('0x9a')]]=this['queueReports'][_0x2feac3[_0x8ddb('0x46')]];this[_0x8ddb('0xf')][_0x2feac3[_0x8ddb('0x46')]]=_0xaca0a0;}}else{_0x3cb8b7[_0x8ddb('0x87')]=_0x8ddb('0xa2')+_0x2feac3[_0x8ddb('0x96')][_0x8ddb('0xa3')]();logger['info'](_0x8ddb('0xa4'),_0x3cb8b7['name'],_0x3cb8b7[_0x8ddb('0x5a')],_0x3cb8b7[_0x8ddb('0x87')]);}}}this[_0x8ddb('0x11')][_0x2feac3[_0x8ddb('0x46')]]=_0x3cb8b7;this[_0x8ddb('0x41')](_0x3cb8b7,_0x8ddb('0x1f'));}}}catch(_0x2ce52f){logger[_0x8ddb('0x3f')](_0x8ddb('0xa5'),_0x2feac3[_0x8ddb('0x46')],util[_0x8ddb('0x3e')](_0x2ce52f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8ddb('0x35')]['syncVarSet']=function(_0x2e283f){try{if(this[_0x8ddb('0x64')](_0x2e283f)){logger['debug'](_0x8ddb('0xa6'),_0x2e283f[_0x8ddb('0x46')],util['inspect'](_0x2e283f,{'showHidden':![],'depth':null}));this[_0x8ddb('0xa7')](_0x2e283f['uniqueid'],_[_0x8ddb('0x7e')](_0x2e283f['variable'])[0x0],_0x2e283f[_0x8ddb('0xa8')]);if(this['queueReports'][_0x2e283f['uniqueid']]){var _0x2c20d6=_[_0x8ddb('0x81')](this[_0x8ddb('0xf')][_0x2e283f[_0x8ddb('0x46')]]);if(_0x2c20d6){if(this['isNotNull'](_0x2e283f[_0x8ddb('0xa9')])&&this[_0x8ddb('0x64')](_0x2e283f[_0x8ddb('0xa9')][_0x8ddb('0xaa')])){switch(_0x2e283f['value']){case _0x8ddb('0xab'):_0x2c20d6['queuecallerexit']=![];_0x2c20d6[_0x8ddb('0x9b')]=null;break;case _0x8ddb('0xac'):_0x2c20d6[_0x8ddb('0xad')]=_0x8ddb('0xae');_0x2c20d6['queuecallerexit']=!![];_0x2c20d6[_0x8ddb('0x9b')]=moment()[_0x8ddb('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c20d6['queuecallerleaveAt']=moment()[_0x8ddb('0x47')](_0x8ddb('0x77'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x2e283f[_0x8ddb('0x46')],util[_0x8ddb('0x3e')](_0x2c20d6,{'showHidden':![],'depth':null}));ami[_0x8ddb('0x42')](_0x8ddb('0xaf'),_0x2c20d6);break;default:_0x2c20d6['queuecallerexit']=!![];_0x2c20d6[_0x8ddb('0x9b')]=moment()[_0x8ddb('0x47')](_0x8ddb('0x77'));_0x2c20d6[_0x8ddb('0x8c')]=moment()[_0x8ddb('0x47')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2c20d6[_0x8ddb('0x1c')]=![];_0x2c20d6[_0x8ddb('0x86')]=null;_0x2c20d6[_0x8ddb('0x87')]=_0x2e283f['value'];this[_0x8ddb('0x11')][_0x2e283f['uniqueid']]=_0x2c20d6;this[_0x8ddb('0x41')](_0x2c20d6,_0x8ddb('0x22'));}else if(this[_0x8ddb('0x64')](_0x2e283f[_0x8ddb('0xa9')])&&this[_0x8ddb('0x64')](_0x2e283f['variable']['queueposition'])){if(!_0x2c20d6[_0x8ddb('0x1c')]){_0x2c20d6[_0x8ddb('0x94')]=!![];_0x2c20d6[_0x8ddb('0x9b')]=moment()['format'](_0x8ddb('0x77'));_0x2c20d6['queuecallerexitreason']=_0x8ddb('0xb0');_0x2c20d6[_0x8ddb('0x8c')]=moment()['format'](_0x8ddb('0x77'));this[_0x8ddb('0x11')][_0x2e283f['uniqueid']]=_0x2c20d6;}}logger[_0x8ddb('0x6d')](_0x8ddb('0xb1'),_0x2e283f[_0x8ddb('0x46')],_0x2c20d6['name'],_0x2c20d6[_0x8ddb('0x5a')],_['keys'](_0x2e283f[_0x8ddb('0xa9')])[0x0],_0x2e283f['value']);_0x2c20d6['variables']=this['variables'][_0x2e283f[_0x8ddb('0x46')]];}}}}catch(_0xc6b3b5){logger[_0x8ddb('0x3f')](_0x8ddb('0xa6'),_0x2e283f['uniqueid'],util[_0x8ddb('0x3e')](_0xc6b3b5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x441f6e,_0x55610f,_0x2a6fc9){var _0x1cb491=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter',_0x8ddb('0xb2'),_0x8ddb('0xb3'),_0x8ddb('0xb4'),_0x8ddb('0xb5'),_0x8ddb('0xb6'),_0x8ddb('0xb7'),_0x8ddb('0xb8'),_0x8ddb('0xb9'),_0x8ddb('0xba'),_0x8ddb('0xbb'),_0x8ddb('0xbc'),'memberinterface',_0x8ddb('0xbd'),_0x8ddb('0x93'),_0x8ddb('0xbe'),_0x8ddb('0xbf')];if(!_[_0x8ddb('0x38')](_0x55610f)&&!_[_0x8ddb('0xc0')](_0x1cb491,_0x55610f)){if(_[_0x8ddb('0x65')](this['variables'][_0x441f6e])){this[_0x8ddb('0x15')][_0x441f6e]={};}this[_0x8ddb('0x15')][_0x441f6e][_0x55610f]=_0x2a6fc9;}};VoiceQueueReport[_0x8ddb('0x35')]['syncHangup']=function(_0x59c1b8){try{if(this[_0x8ddb('0x64')](_0x59c1b8)){logger['debug'](_0x8ddb('0xc1'),_0x59c1b8[_0x8ddb('0x46')],util[_0x8ddb('0x3e')](_0x59c1b8,{'showHidden':![],'depth':null}));if(this[_0x8ddb('0xf')][_0x59c1b8[_0x8ddb('0x46')]]){for(var _0x393517=0x0,_0x23ac4d={};_0x393517=0x0?moment(_0x46637a[_0xa407('0x18')])['diff'](_0x46637a['starttime'],_0xa407('0xe')):null,'data1':_0xa407('0x19'),'data2':_0x46637a[_0xa407('0x13')],'data3':_0x46637a[_0xa407('0x11')],'data4':_0x46637a[_0xa407('0x1a')]||null,'role':_0xa407('0x1b'),'internal':_0x46637a['accountcode']?_[_0xa407('0x14')](_0x46637a[_0xa407('0x13')]):undefined,'uniqueid':_0x46637a[_0xa407('0x1c')]},'log':_0xa407('0x5')});}; \ No newline at end of file +var _0xd16f=['calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','starttime','endtime','outbound','dialstring','CreateMemberReport','moment','lodash','util','../client','voiceQueueReport','Request','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound'];(function(_0x4579e8,_0x6eaeed){var _0x5dc197=function(_0x3c5e85){while(--_0x3c5e85){_0x4579e8['push'](_0x4579e8['shift']());}};_0x5dc197(++_0x6eaeed);}(_0xd16f,0xdf));var _0xfd16=function(_0x27688d,_0x3d7331){_0x27688d=_0x27688d-0x0;var _0x54d06f=_0xd16f[_0x27688d];return _0x54d06f;};'use strict';var moment=require(_0xfd16('0x0'));var _=require(_0xfd16('0x1'));var util=require(_0xfd16('0x2'));var client=require(_0xfd16('0x3'));exports[_0xfd16('0x4')]=function(_0x1c970c){var _0x1fd887=_0x1c970c['queuecallercompleteAt']||_0x1c970c['queuecallerexitAt'];return client[_0xfd16('0x5')]('CreateMemberReport',{'body':{'channel':_0xfd16('0x6'),'membername':_0x1c970c[_0xfd16('0x7')],'interface':_[_0xfd16('0x8')](_0x1c970c[_0xfd16('0x9')])?util[_0xfd16('0xa')](_0xfd16('0xb'),_0x1c970c[_0xfd16('0x7')]):_0x1c970c[_0xfd16('0x9')],'type':_0xfd16('0xc'),'enterAt':_0x1c970c[_0xfd16('0xd')],'exitAt':_0x1fd887,'duration':moment(_0x1fd887)[_0xfd16('0xe')](_0x1c970c[_0xfd16('0xd')],_0xfd16('0xf')),'data1':_0xfd16('0x10'),'data2':_0x1c970c[_0xfd16('0x11')],'data3':_0x1c970c[_0xfd16('0x12')],'data4':null,'data5':_0x1c970c[_0xfd16('0x13')],'role':_0xfd16('0x14'),'internal':_0x1c970c[_0xfd16('0x15')]?_[_0xfd16('0x16')](_0x1c970c['accountcode']):undefined,'uniqueid':_0x1c970c[_0xfd16('0x17')]},'log':'CreateMemberReport'});};exports[_0xfd16('0x18')]=function(_0x234142){return client[_0xfd16('0x5')]('CreateMemberReport',{'body':{'channel':_0xfd16('0x6'),'membername':_0x234142['membername'],'interface':_0x234142[_0xfd16('0x9')],'type':_0xfd16('0xc'),'enterAt':_0x234142[_0xfd16('0x19')],'exitAt':_0x234142[_0xfd16('0x1a')],'duration':moment(_0x234142[_0xfd16('0x1a')])['diff'](_0x234142['starttime'],_0xfd16('0xf'))>=0x0?moment(_0x234142[_0xfd16('0x1a')])[_0xfd16('0xe')](_0x234142[_0xfd16('0x19')],_0xfd16('0xf')):null,'data1':_0xfd16('0x1b'),'data2':_0x234142[_0xfd16('0x15')],'data3':_0x234142[_0xfd16('0x12')],'data4':_0x234142[_0xfd16('0x1c')]||null,'role':_0xfd16('0x14'),'internal':_0x234142[_0xfd16('0x15')]?_['toNumber'](_0x234142['accountcode']):undefined,'uniqueid':_0x234142['uniqueid']},'log':_0xfd16('0x1d')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 05a3efe..093f69b 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 _0x707b=['getSettings','Request','stopRecordingOnTransfer','../client'];(function(_0x334979,_0x55e948){var _0x1d9d8c=function(_0x185955){while(--_0x185955){_0x334979['push'](_0x334979['shift']());}};_0x1d9d8c(++_0x55e948);}(_0x707b,0xdf));var _0xb707=function(_0x2902c2,_0x40150){_0x2902c2=_0x2902c2-0x0;var _0x16f4fb=_0x707b[_0x2902c2];return _0x16f4fb;};'use strict';var client=require(_0xb707('0x0'));exports[_0xb707('0x1')]=function(){return client[_0xb707('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb707('0x3'),'previewRecallmeReminderInterval']},'log':'GetSettings'});}; \ No newline at end of file +var _0xcb49=['../client','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings'];(function(_0x12877b,_0x8650cf){var _0x3549ff=function(_0x4f96b7){while(--_0x4f96b7){_0x12877b['push'](_0x12877b['shift']());}};_0x3549ff(++_0x8650cf);}(_0xcb49,0x156));var _0x9cb4=function(_0x3ae96c,_0x5f1e7e){_0x3ae96c=_0x3ae96c-0x0;var _0x1b0c90=_0xcb49[_0x3ae96c];return _0x1b0c90;};'use strict';var client=require(_0x9cb4('0x0'));exports['getSettings']=function(){return client[_0x9cb4('0x1')](_0x9cb4('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9cb4('0x3'),_0x9cb4('0x4')]},'log':_0x9cb4('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index cd479a5..43fa697 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 _0x3da7=['html','../client','Request','GetTemplate','name'];(function(_0x441f45,_0x16130c){var _0x2bc267=function(_0x44f8a4){while(--_0x44f8a4){_0x441f45['push'](_0x441f45['shift']());}};_0x2bc267(++_0x16130c);}(_0x3da7,0xe2));var _0x73da=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x3da7[_0x36884e];return _0x1cc367;};'use strict';var client=require(_0x73da('0x0'));exports['getTemplates']=function(_0x25070f){return function(_0x14e1bf){return client[_0x73da('0x1')](_0x73da('0x2'),{'options':{'raw':!![],'attributes':['id',_0x73da('0x3'),_0x73da('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xecf5=['getTemplates','Request','GetTemplate'];(function(_0x16e0c8,_0x4861eb){var _0xe4b5af=function(_0x5248bc){while(--_0x5248bc){_0x16e0c8['push'](_0x16e0c8['shift']());}};_0xe4b5af(++_0x4861eb);}(_0xecf5,0x1c5));var _0x5ecf=function(_0x5afc30,_0x58de50){_0x5afc30=_0x5afc30-0x0;var _0x5339ed=_0xecf5[_0x5afc30];return _0x5339ed;};'use strict';var client=require('../client');exports[_0x5ecf('0x0')]=function(_0xeb34b2){return function(_0x51c585){return client[_0x5ecf('0x1')](_0x5ecf('0x2'),{'options':{'raw':!![],'attributes':['id','name','html']},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 7362038..5b448b9 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 _0xc124=['operator','value','Actions','data1','data2','data5','data7','../client','getTriggers','Request','GetTrigger','channel','status','Condition','AllConditions','field'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xc124,0x137));var _0x4c12=function(_0xae188,_0x1121c2){_0xae188=_0xae188-0x0;var _0x507a48=_0xc124[_0xae188];return _0x507a48;};'use strict';var client=require(_0x4c12('0x0'));exports[_0x4c12('0x1')]=function(_0x2219a4){return function(_0x4755db){return client[_0x4c12('0x2')](_0x4c12('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x4c12('0x4'),_0x4c12('0x5')],'include':[{'model':_0x4c12('0x6'),'as':_0x4c12('0x7'),'attributes':['id',_0x4c12('0x8'),_0x4c12('0x9'),'value']},{'model':_0x4c12('0x6'),'as':'AnyConditions','attributes':['id',_0x4c12('0x8'),_0x4c12('0x9'),_0x4c12('0xa')]},{'model':'Action','as':_0x4c12('0xb'),'attributes':['id','action',_0x4c12('0xc'),_0x4c12('0xd'),'data3','data4',_0x4c12('0xe'),'data6',_0x4c12('0xf')]}]},'log':_0x4c12('0x3')});};}; \ No newline at end of file +var _0x8b6c=['name','channel','status','Condition','AllConditions','field','AnyConditions','operator','value','Action','action','data2','data3','data4','data6','data7','../client','getTriggers','Request','GetTrigger'];(function(_0x397f31,_0xf8db87){var _0x599155=function(_0x2c25fd){while(--_0x2c25fd){_0x397f31['push'](_0x397f31['shift']());}};_0x599155(++_0xf8db87);}(_0x8b6c,0x74));var _0xc8b6=function(_0x3dbff1,_0x49b677){_0x3dbff1=_0x3dbff1-0x0;var _0x47d92e=_0x8b6c[_0x3dbff1];return _0x47d92e;};'use strict';var client=require(_0xc8b6('0x0'));exports[_0xc8b6('0x1')]=function(_0xa7348b){return function(_0x1fcb25){return client[_0xc8b6('0x2')](_0xc8b6('0x3'),{'options':{'raw':![],'attributes':['id',_0xc8b6('0x4'),_0xc8b6('0x5'),_0xc8b6('0x6')],'include':[{'model':_0xc8b6('0x7'),'as':_0xc8b6('0x8'),'attributes':['id',_0xc8b6('0x9'),'operator','value']},{'model':_0xc8b6('0x7'),'as':_0xc8b6('0xa'),'attributes':['id',_0xc8b6('0x9'),_0xc8b6('0xb'),_0xc8b6('0xc')]},{'model':_0xc8b6('0xd'),'as':'Actions','attributes':['id',_0xc8b6('0xe'),'data1',_0xc8b6('0xf'),_0xc8b6('0x10'),_0xc8b6('0x11'),'data5',_0xc8b6('0x12'),_0xc8b6('0x13')]}]},'log':_0xc8b6('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index c49d539..e2d9baa 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 _0x2ae0=['getTrunks','Request','GetTrunk','name','registry','../client'];(function(_0x11cd17,_0x489e02){var _0x3343ad=function(_0xfb1588){while(--_0xfb1588){_0x11cd17['push'](_0x11cd17['shift']());}};_0x3343ad(++_0x489e02);}(_0x2ae0,0x161));var _0x02ae=function(_0x213b44,_0x46bb8f){_0x213b44=_0x213b44-0x0;var _0x4c1ddb=_0x2ae0[_0x213b44];return _0x4c1ddb;};'use strict';var client=require(_0x02ae('0x0'));exports[_0x02ae('0x1')]=function(_0x5da946){return function(_0x52ba5e){return client[_0x02ae('0x2')](_0x02ae('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x02ae('0x4'),_0x02ae('0x5'),'defaultuser']},'log':_0x02ae('0x3')});};}; \ No newline at end of file +var _0xe8f7=['Request','GetTrunk','name','registry','defaultuser','../client'];(function(_0x5e98c2,_0x49675b){var _0xd987d8=function(_0x815cab){while(--_0x815cab){_0x5e98c2['push'](_0x5e98c2['shift']());}};_0xd987d8(++_0x49675b);}(_0xe8f7,0x137));var _0x7e8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe8f7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7e8f('0x0'));exports['getTrunks']=function(_0x357eeb){return function(_0x1e09e3){return client[_0x7e8f('0x1')](_0x7e8f('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7e8f('0x3'),_0x7e8f('0x4'),_0x7e8f('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 03c3da9..8355473 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x4f9aaf,_0x43ccf1){var _0x481a1d=function(_0x1e553f){while(--_0x1e553f){_0x4f9aaf['push'](_0x4f9aaf['shift']());}};_0x481a1d(++_0x43ccf1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xe706,0xa3));var _0x6e70=function(_0x136e11,_0x29bd0b){_0x136e11=_0x136e11-0x0;var _0x36d346=_0xe706[_0x136e11];return _0x36d346;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index a1d7745..40cf9fd 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 _0x1e6f=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0x1e6f,0x79));var _0xf1e6=function(_0x7033c6,_0x45ce18){_0x7033c6=_0x7033c6-0x0;var _0x36805b=_0x1e6f[_0x7033c6];return _0x36805b;};'use strict';var client=require(_0xf1e6('0x0'));exports[_0xf1e6('0x1')]=function(_0x3db5bb){return client[_0xf1e6('0x2')]('CreateVoiceAgentReport',{'body':_0x3db5bb,'log':_0xf1e6('0x3')});};exports['update']=function(_0x235005,_0x52711d,_0x331fc8){return client[_0xf1e6('0x2')](_0xf1e6('0x4'),{'body':_0x235005,'options':{'where':{'uniqueid':_0x52711d,'interface':_0x331fc8,'agentcomplete':!![]}},'log':_0xf1e6('0x4')});}; \ No newline at end of file +var _0xc15d=['../client','create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xc15d,0x150));var _0xdc15=function(_0x4f392a,_0x2f06ec){_0x4f392a=_0x4f392a-0x0;var _0x58489b=_0xc15d[_0x4f392a];return _0x58489b;};'use strict';var client=require(_0xdc15('0x0'));exports[_0xdc15('0x1')]=function(_0x34e993){return client[_0xdc15('0x2')](_0xdc15('0x3'),{'body':_0x34e993,'log':_0xdc15('0x3')});};exports[_0xdc15('0x4')]=function(_0x45ca6a,_0x3ec38b,_0x4967f1){return client[_0xdc15('0x2')](_0xdc15('0x5'),{'body':_0x45ca6a,'options':{'where':{'uniqueid':_0x3ec38b,'interface':_0x4967f1,'agentcomplete':!![]}},'log':_0xdc15('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 4281366..fce86c1 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 _0x7172=['outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','billableseconds','moment','lodash','merge','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','Request'];(function(_0x4cef95,_0x361d19){var _0x1d72e9=function(_0x310d06){while(--_0x310d06){_0x4cef95['push'](_0x4cef95['shift']());}};_0x1d72e9(++_0x361d19);}(_0x7172,0x167));var _0x2717=function(_0x11aa9c,_0x2e9dd9){_0x11aa9c=_0x11aa9c-0x0;var _0x14f952=_0x7172[_0x11aa9c];return _0x14f952;};'use strict';var moment=require(_0x2717('0x0'));var util=require('util');var _=require(_0x2717('0x1'));var client=require('../client');exports['create']=function(_0x222542){return client['Request']('CreateVoiceCallReport',{'body':_[_0x2717('0x2')](_0x222542,{'source':_0x222542[_0x2717('0x3')],'destinationcontext':_0x222542[_0x2717('0x4')],'callerid':_0x222542[_0x2717('0x5')],'amaflags':_0x2717('0x6')}),'log':_0x2717('0x7')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x2717('0x8')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x2717('0x9')],'createdAt':{'$between':[moment()[_0x2717('0xa')](_0x2717('0xb'))[_0x2717('0xc')](_0x2717('0xd')),moment()['endOf'](_0x2717('0xb'))[_0x2717('0xc')](_0x2717('0xd'))]}},'attributes':['type',_0x2717('0xe'),'duration',_0x2717('0xf')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x4e03=['YYYY-MM-DD\x20HH:mm:ss','type','disposition','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','calleridnum','callerid','DOCUMENTATION','outbound','startOf','day','format','endOf'];(function(_0x1d9333,_0xe1a4e4){var _0x4ea612=function(_0x468edc){while(--_0x468edc){_0x1d9333['push'](_0x1d9333['shift']());}};_0x4ea612(++_0xe1a4e4);}(_0x4e03,0x82));var _0x34e0=function(_0x18d7d1,_0x7d2e7d){_0x18d7d1=_0x18d7d1-0x0;var _0x140009=_0x4e03[_0x18d7d1];return _0x140009;};'use strict';var moment=require(_0x34e0('0x0'));var util=require(_0x34e0('0x1'));var _=require(_0x34e0('0x2'));var client=require('../client');exports[_0x34e0('0x3')]=function(_0x2cc572){return client[_0x34e0('0x4')](_0x34e0('0x5'),{'body':_['merge'](_0x2cc572,{'source':_0x2cc572[_0x34e0('0x6')],'destinationcontext':_0x2cc572['context'],'callerid':_0x2cc572[_0x34e0('0x7')],'amaflags':_0x34e0('0x8')}),'log':_0x34e0('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x34e0('0x9')],'createdAt':{'$between':[moment()[_0x34e0('0xa')](_0x34e0('0xb'))[_0x34e0('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x34e0('0xd')](_0x34e0('0xb'))[_0x34e0('0xc')](_0x34e0('0xe'))]}},'attributes':[_0x34e0('0xf'),_0x34e0('0x10'),'duration','billableseconds']},'log':_0x34e0('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 0ab8fed..db17c39 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 _0x225b=['CreateVoiceDialReport','../client','create','Request'];(function(_0x1e6022,_0x1ba9b7){var _0x582bc0=function(_0x2d88e1){while(--_0x2d88e1){_0x1e6022['push'](_0x1e6022['shift']());}};_0x582bc0(++_0x1ba9b7);}(_0x225b,0x129));var _0xb225=function(_0x134d87,_0x40bdd0){_0x134d87=_0x134d87-0x0;var _0x408633=_0x225b[_0x134d87];return _0x408633;};'use strict';var client=require(_0xb225('0x0'));exports[_0xb225('0x1')]=function(_0x314cbd){return client[_0xb225('0x2')]('CreateVoiceDialReport',{'body':_0x314cbd,'log':_0xb225('0x3')});}; \ No newline at end of file +var _0x1ba3=['CreateVoiceDialReport','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ba3,0x9d));var _0x31ba=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x1ba3[_0x1caf6a];return _0x1bf493;};'use strict';var client=require(_0x31ba('0x0'));exports[_0x31ba('0x1')]=function(_0x1060a4){return client['Request'](_0x31ba('0x2'),{'body':_0x1060a4,'log':_0x31ba('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index b578d8d..3a25af3 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 _0x9aea=['recordingFormat','../client','Request','exten'];(function(_0x3b594b,_0x5835c3){var _0x1ea5f8=function(_0x191b3e){while(--_0x191b3e){_0x3b594b['push'](_0x3b594b['shift']());}};_0x1ea5f8(++_0x5835c3);}(_0x9aea,0xdd));var _0xa9ae=function(_0x5b2131,_0x1e3440){_0x5b2131=_0x5b2131-0x0;var _0x9ee509=_0x9aea[_0x5b2131];return _0x9ee509;};'use strict';var client=require(_0xa9ae('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xa9ae('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xa9ae('0x2'),_0xa9ae('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xf403=['Request','GetVoiceExtension','exten','recordingFormat','getVoiceExtensions','../client'];(function(_0x34f661,_0x3a994c){var _0x3924e0=function(_0x463001){while(--_0x463001){_0x34f661['push'](_0x34f661['shift']());}};_0x3924e0(++_0x3a994c);}(_0xf403,0x1d3));var _0x3f40=function(_0xcc3885,_0x305c76){_0xcc3885=_0xcc3885-0x0;var _0x23573e=_0xf403[_0xcc3885];return _0x23573e;};'use strict';var client=require(_0x3f40('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x3f40('0x1')](_0x3f40('0x2'),{'options':{'raw':!![],'attributes':['id',_0x3f40('0x3'),_0x3f40('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x3f40('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index ea70435..1ff3124 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 _0xfe86=['acw','acwTimeout','autopause','dialActive','dialMethod','dialLimitChannel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','Trunk','name','active','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','getVoiceQueues','GetVoiceQueue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfe86,0x16d));var _0x6fe8=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0xfe86[_0x1602ef];return _0x5870ee;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x6fe8('0x0'),{'options':{'raw':![],'attributes':['id','name',_0x6fe8('0x1'),_0x6fe8('0x2'),_0x6fe8('0x3'),'monitor_format','type',_0x6fe8('0x4'),_0x6fe8('0x5'),_0x6fe8('0x6'),'dialLimitQueue','dialPowerLevel',_0x6fe8('0x7'),'dialPredictiveOptimizationPercentage',_0x6fe8('0x8'),_0x6fe8('0x9'),'dialOriginateCallerIdNumber',_0x6fe8('0xa'),_0x6fe8('0xb'),_0x6fe8('0xc'),_0x6fe8('0xd'),'dialCongestionMaxRetry',_0x6fe8('0xe'),'dialBusyMaxRetry',_0x6fe8('0xf'),_0x6fe8('0x10'),_0x6fe8('0x11'),'dialGlobalMaxRetry',_0x6fe8('0x12'),'dialGlobalInterval',_0x6fe8('0x13'),_0x6fe8('0x14'),_0x6fe8('0x15'),_0x6fe8('0x16'),'dialAMDGreeting',_0x6fe8('0x17'),_0x6fe8('0x18'),'dialAMDMinWordLength',_0x6fe8('0x19'),_0x6fe8('0x1a'),_0x6fe8('0x1b'),_0x6fe8('0x1c'),_0x6fe8('0x1d'),_0x6fe8('0x1e'),_0x6fe8('0x1f'),_0x6fe8('0x20'),_0x6fe8('0x21'),_0x6fe8('0x22'),_0x6fe8('0x23'),_0x6fe8('0x24'),_0x6fe8('0x25'),_0x6fe8('0x26'),'dialCutDigit',_0x6fe8('0x27'),_0x6fe8('0x28'),_0x6fe8('0x29'),_0x6fe8('0x2a'),_0x6fe8('0x2b'),_0x6fe8('0x2c'),_0x6fe8('0x2d'),_0x6fe8('0x2e'),_0x6fe8('0x2f'),'dialAgentRejectRetryFrequency',_0x6fe8('0x30'),_0x6fe8('0x31'),'dialPredictiveIntervalMinThreshold',_0x6fe8('0x32'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x6fe8('0x33'),'as':_0x6fe8('0x33'),'attributes':['id',_0x6fe8('0x34'),'callerid',_0x6fe8('0x35')]},{'model':'Pause','as':_0x6fe8('0x36'),'attributes':['id','name']},{'model':_0x6fe8('0x33'),'as':_0x6fe8('0x37'),'attributes':['id',_0x6fe8('0x34'),_0x6fe8('0x38'),_0x6fe8('0x35')]},{'model':'Interval','as':_0x6fe8('0x39'),'attributes':['id',_0x6fe8('0x34')],'include':[{'model':_0x6fe8('0x39'),'as':_0x6fe8('0x3a'),'attributes':['id','name',_0x6fe8('0x3b')]}]}]},'log':_0x6fe8('0x3c')});};}; \ No newline at end of file +var _0x7621=['dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDAfterGreetingSilence'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x7621,0x147));var _0x1762=function(_0x179b91,_0xaa2a0b){_0x179b91=_0x179b91-0x0;var _0x8da851=_0x7621[_0x179b91];return _0x8da851;};'use strict';var client=require('../client');exports[_0x1762('0x0')]=function(){return function(){return client[_0x1762('0x1')](_0x1762('0x2'),{'options':{'raw':![],'attributes':['id',_0x1762('0x3'),_0x1762('0x4'),_0x1762('0x5'),'autopause','monitor_format',_0x1762('0x6'),_0x1762('0x7'),'dialMethod',_0x1762('0x8'),_0x1762('0x9'),_0x1762('0xa'),_0x1762('0xb'),'dialPredictiveOptimizationPercentage',_0x1762('0xc'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x1762('0xd'),'dialQueueOptions',_0x1762('0xe'),_0x1762('0xf'),_0x1762('0x10'),_0x1762('0x11'),_0x1762('0x12'),_0x1762('0x13'),_0x1762('0x14'),_0x1762('0x15'),_0x1762('0x16'),'dialTimezone',_0x1762('0x17'),'dialPrefix',_0x1762('0x18'),'dialAMDActive',_0x1762('0x19'),'dialAMDGreeting',_0x1762('0x1a'),_0x1762('0x1b'),_0x1762('0x1c'),'dialAMDBetweenWordsSilence',_0x1762('0x1d'),'dialAMDSilenceThreshold',_0x1762('0x1e'),_0x1762('0x1f'),_0x1762('0x20'),_0x1762('0x21'),_0x1762('0x22'),_0x1762('0x23'),'dialAgiAfterHangupClient',_0x1762('0x24'),_0x1762('0x25'),_0x1762('0x26'),_0x1762('0x27'),'dialCutDigit',_0x1762('0x28'),_0x1762('0x29'),_0x1762('0x2a'),_0x1762('0x2b'),'dialAbandonedMaxRetry',_0x1762('0x2c'),_0x1762('0x2d'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry',_0x1762('0x2e'),_0x1762('0x2f'),'dialPredictiveIntervalMaxThreshold',_0x1762('0x30'),_0x1762('0x31'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x1762('0x32'),'as':_0x1762('0x32'),'attributes':['id','name',_0x1762('0x33'),'active']},{'model':_0x1762('0x34'),'as':_0x1762('0x35'),'attributes':['id',_0x1762('0x3')]},{'model':_0x1762('0x32'),'as':_0x1762('0x36'),'attributes':['id',_0x1762('0x3'),'callerid',_0x1762('0x37')]},{'model':_0x1762('0x38'),'as':_0x1762('0x38'),'attributes':['id',_0x1762('0x3')],'include':[{'model':_0x1762('0x38'),'as':_0x1762('0x39'),'attributes':['id',_0x1762('0x3'),_0x1762('0x3a')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 6996b6b..8227232 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(_0x3242cd,_0x299125){var _0x209c55=function(_0x24e784){while(--_0x24e784){_0x3242cd['push'](_0x3242cd['shift']());}};_0x209c55(++_0x299125);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x24ae87,_0x307589){var _0x3b1461=function(_0x14ba1f){while(--_0x14ba1f){_0x24ae87['push'](_0x24ae87['shift']());}};_0x3b1461(++_0x307589);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 e961225..273eacc 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 _0xccf9=['../client','getVoiceQueueRtPauses','Request'];(function(_0x13c25c,_0x69a4f3){var _0x414d7f=function(_0x3efd4e){while(--_0x3efd4e){_0x13c25c['push'](_0x13c25c['shift']());}};_0x414d7f(++_0x69a4f3);}(_0xccf9,0x99));var _0x9ccf=function(_0x2aa828,_0x1b65de){_0x2aa828=_0x2aa828-0x0;var _0x1f1908=_0xccf9[_0x2aa828];return _0x1f1908;};'use strict';var client=require(_0x9ccf('0x0'));exports[_0x9ccf('0x1')]=function(_0x2fc738){return function(){return client[_0x9ccf('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x2fc738,'paused':!![]},'raw':!![]},'log':_0x9ccf('0x1')});};}; \ No newline at end of file +var _0xe4fc=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x1a0b5a,_0x258cec){var _0x142050=function(_0x492586){while(--_0x492586){_0x1a0b5a['push'](_0x1a0b5a['shift']());}};_0x142050(++_0x258cec);}(_0xe4fc,0x164));var _0xce4f=function(_0x505241,_0x54a73d){_0x505241=_0x505241-0x0;var _0x1a1fcb=_0xe4fc[_0x505241];return _0x1a1fcb;};'use strict';var client=require(_0xce4f('0x0'));exports[_0xce4f('0x1')]=function(_0x20034f){return function(){return client[_0xce4f('0x2')](_0xce4f('0x3'),{'options':{'where':{'VoiceQueueId':_0x20034f,'paused':!![]},'raw':!![]},'log':_0xce4f('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 19fc155..c8b0c1b 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x415a6c,_0x123363){var _0x3459a0=function(_0x503432){while(--_0x503432){_0x415a6c['push'](_0x415a6c['shift']());}};_0x3459a0(++_0x123363);}(_0x7a54,0x106));var _0x47a5=function(_0x507b92,_0x3c804e){_0x507b92=_0x507b92-0x0;var _0x4d0d57=_0x7a54[_0x507b92];return _0x4d0d57;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x33ee57,_0x2df98f){var _0x57fcff=function(_0x53b35e){while(--_0x53b35e){_0x33ee57['push'](_0x33ee57['shift']());}};_0x57fcff(++_0x2df98f);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 06166e9..30d1ca1 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 _0x968e=['transfertargetconnectedlinename','transfertargetexten','origtransfererexten','attended','../client','blindTransfer','Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinename','transfereeexten','isexternal','context','extension','blind','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0x968e,0x16c));var _0xe968=function(_0x51bfa7,_0x51c8e0){_0x51bfa7=_0x51bfa7-0x0;var _0x1cf7ae=_0x968e[_0x51bfa7];return _0x1cf7ae;};'use strict';var client=require(_0xe968('0x0'));exports['transfers']={};exports[_0xe968('0x1')]=function(_0x3658a6){return client[_0xe968('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x3658a6[_0xe968('0x3')],'transfererchannel':_0x3658a6[_0xe968('0x4')],'transferercalleridnum':_0x3658a6[_0xe968('0x5')],'transferercalleridname':_0x3658a6[_0xe968('0x6')],'transfererconnectedlinenum':_0x3658a6['transfererconnectedlinenum'],'transfererconnectedlinename':_0x3658a6[_0xe968('0x7')],'transfereraccountcode':_0x3658a6['transfereraccountcode'],'transferercontext':_0x3658a6[_0xe968('0x8')],'transfererexten':_0x3658a6[_0xe968('0x9')],'transfererlinkedid':_0x3658a6[_0xe968('0xa')],'transfereechannel':_0x3658a6[_0xe968('0xb')],'transfereecalleridnum':_0x3658a6[_0xe968('0xc')],'transfereecalleridname':_0x3658a6['transfereecalleridname'],'transfereeconnectedlinenum':_0x3658a6['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x3658a6[_0xe968('0xd')],'transfereeaccountcode':_0x3658a6['transfereeaccountcode'],'transfereecontext':_0x3658a6['transfereecontext'],'transfereeexten':_0x3658a6[_0xe968('0xe')],'transfereelinkedid':_0x3658a6['transfereelinkedid'],'isexternal':_0x3658a6[_0xe968('0xf')],'context':_0x3658a6[_0xe968('0x10')],'extension':_0x3658a6[_0xe968('0x11')],'type':_0xe968('0x12')},'log':_0xe968('0x13')});};exports['attendedTransfer']=function(_0x35730f){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x35730f['result'],'transfererchannel':_0x35730f[_0xe968('0x14')],'transferercalleridnum':_0x35730f['origtransferercalleridnum'],'transferercalleridname':_0x35730f[_0xe968('0x15')],'transfererconnectedlinenum':_0x35730f[_0xe968('0x16')],'transfererconnectedlinename':_0x35730f[_0xe968('0x17')],'transfereraccountcode':_0x35730f[_0xe968('0x18')],'transferercontext':_0x35730f[_0xe968('0x19')],'transfererexten':_0x35730f['secondtransfererexten'],'transfererlinkedid':_0x35730f['origtransfererlinkedid'],'transfereechannel':_0x35730f['transfertargetchannel'],'transfereecalleridnum':_0x35730f['transfertargetcalleridnum'],'transfereecalleridname':_0x35730f['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x35730f['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x35730f[_0xe968('0x1a')],'transfereeaccountcode':_0x35730f['transfertargetaccountcode'],'transfereecontext':_0x35730f['transfertargetcontext'],'transfereeexten':_0x35730f[_0xe968('0x1b')],'transfereelinkedid':_0x35730f['transfertargetlinkedid'],'isexternal':_0x35730f['isexternal'],'context':_0x35730f['origtransferercontext'],'extension':_0x35730f[_0xe968('0x1c')],'type':_0xe968('0x1d')},'log':_0xe968('0x13')});}; \ No newline at end of file +var _0xdc1f=['transfereecalleridname','transfereeconnectedlinename','transfereeexten','transfereelinkedid','isexternal','context','extension','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum'];(function(_0x3dd696,_0x3c0440){var _0x71d7e=function(_0x2ecddf){while(--_0x2ecddf){_0x3dd696['push'](_0x3dd696['shift']());}};_0x71d7e(++_0x3c0440);}(_0xdc1f,0x19e));var _0xfdc1=function(_0x110dea,_0x538312){_0x110dea=_0x110dea-0x0;var _0x1c3e3b=_0xdc1f[_0x110dea];return _0x1c3e3b;};'use strict';var client=require(_0xfdc1('0x0'));exports[_0xfdc1('0x1')]={};exports[_0xfdc1('0x2')]=function(_0x8f7158){return client[_0xfdc1('0x3')](_0xfdc1('0x4'),{'body':{'result':_0x8f7158[_0xfdc1('0x5')],'transfererchannel':_0x8f7158['transfererchannel'],'transferercalleridnum':_0x8f7158[_0xfdc1('0x6')],'transferercalleridname':_0x8f7158[_0xfdc1('0x7')],'transfererconnectedlinenum':_0x8f7158[_0xfdc1('0x8')],'transfererconnectedlinename':_0x8f7158[_0xfdc1('0x9')],'transfereraccountcode':_0x8f7158[_0xfdc1('0xa')],'transferercontext':_0x8f7158[_0xfdc1('0xb')],'transfererexten':_0x8f7158[_0xfdc1('0xc')],'transfererlinkedid':_0x8f7158[_0xfdc1('0xd')],'transfereechannel':_0x8f7158[_0xfdc1('0xe')],'transfereecalleridnum':_0x8f7158[_0xfdc1('0xf')],'transfereecalleridname':_0x8f7158[_0xfdc1('0x10')],'transfereeconnectedlinenum':_0x8f7158['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x8f7158[_0xfdc1('0x11')],'transfereeaccountcode':_0x8f7158['transfereeaccountcode'],'transfereecontext':_0x8f7158['transfereecontext'],'transfereeexten':_0x8f7158[_0xfdc1('0x12')],'transfereelinkedid':_0x8f7158[_0xfdc1('0x13')],'isexternal':_0x8f7158[_0xfdc1('0x14')],'context':_0x8f7158[_0xfdc1('0x15')],'extension':_0x8f7158[_0xfdc1('0x16')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0xfdc1('0x17')]=function(_0xa1f543){return client[_0xfdc1('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0xa1f543[_0xfdc1('0x5')],'transfererchannel':_0xa1f543[_0xfdc1('0x18')],'transferercalleridnum':_0xa1f543[_0xfdc1('0x19')],'transferercalleridname':_0xa1f543['origtransferercalleridname'],'transfererconnectedlinenum':_0xa1f543[_0xfdc1('0x1a')],'transfererconnectedlinename':_0xa1f543[_0xfdc1('0x1b')],'transfereraccountcode':_0xa1f543[_0xfdc1('0x1c')],'transferercontext':_0xa1f543[_0xfdc1('0x1d')],'transfererexten':_0xa1f543[_0xfdc1('0x1e')],'transfererlinkedid':_0xa1f543[_0xfdc1('0x1f')],'transfereechannel':_0xa1f543[_0xfdc1('0x20')],'transfereecalleridnum':_0xa1f543[_0xfdc1('0x21')],'transfereecalleridname':_0xa1f543[_0xfdc1('0x22')],'transfereeconnectedlinenum':_0xa1f543[_0xfdc1('0x23')],'transfereeconnectedlinename':_0xa1f543[_0xfdc1('0x24')],'transfereeaccountcode':_0xa1f543[_0xfdc1('0x25')],'transfereecontext':_0xa1f543[_0xfdc1('0x26')],'transfereeexten':_0xa1f543[_0xfdc1('0x27')],'transfereelinkedid':_0xa1f543[_0xfdc1('0x28')],'isexternal':_0xa1f543[_0xfdc1('0x14')],'context':_0xa1f543['origtransferercontext'],'extension':_0xa1f543[_0xfdc1('0x29')],'type':_0xfdc1('0x2a')},'log':_0xfdc1('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index e1d97c5..220a782 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 _0xfc46=['send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','validate','bluebird','../../../config/environment','../properties','../ami','listen','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','then','error','command','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','catch','map','resolve','Action','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts'];(function(_0x3887ba,_0x390009){var _0x3faa4a=function(_0x3329c3){while(--_0x3329c3){_0x3887ba['push'](_0x3887ba['shift']());}};_0x3faa4a(++_0x390009);}(_0xfc46,0x9a));var _0x6fc4=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xfc46[_0x42f009];return _0x22a1e0;};'use strict';var _=require(_0x6fc4('0x0'));var util=require('util');var jayson=require(_0x6fc4('0x1'));var schema=require(_0x6fc4('0x2'));var BPromise=require(_0x6fc4('0x3'));var moment=require('moment');var config=require(_0x6fc4('0x4'));var properties=require(_0x6fc4('0x5'));var ami=require(_0x6fc4('0x6'));exports[_0x6fc4('0x7')]=function(_0x52b4c0,_0x1504a6,_0xf57aa9){return new BPromise(function(_0x3100a0,_0x454abb){var _0x31e6c7={'QueuePause':function(_0x241761){return new Promise(function(_0x56cee3,_0x1fcd95){var _0x52851a=util[_0x6fc4('0x8')](_0x6fc4('0x9'),'SIP',_0x241761[_0x6fc4('0xa')]);if(_0x52b4c0[_0x6fc4('0xb')]&&_0x52b4c0[_0x6fc4('0xb')][_0x52851a]&&_0x52b4c0[_0x6fc4('0xb')][_0x52851a][_0x6fc4('0xc')]){_0x52b4c0[_0x6fc4('0xb')][_0x52851a][_0x6fc4('0xd')]();}if(_0x52b4c0[_0x6fc4('0xe')][_0x52851a]){_0x52b4c0[_0x6fc4('0xe')][_0x52851a][_0x6fc4('0xf')]({'statePause':_0x241761[_0x6fc4('0x10')]?!![]:![]});}_0x56cee3({'code':0xc8,'message':_0x6fc4('0x11')});});},'Reload':function(_0x34cb6b){var _0x1e91cb=this;return new Promise(function(_0x13eb64,_0x2c9fa3){if(ami[_0x6fc4('0x12')]()==![]){return _0x2c9fa3(_0x1e91cb['error'](0x1f4,[config['asterisk']['ip'],config[_0x6fc4('0x13')][_0x6fc4('0x14')],_0x6fc4('0x15')][_0x6fc4('0x16')]('\x20')));}_0x34cb6b=_[_0x6fc4('0x17')](_0x34cb6b,_[_0x6fc4('0x18')](properties[_0x6fc4('0x19')]));_0x34cb6b[_0x6fc4('0x1a')]=_0x6fc4('0x1b');return ami['Action'](_0x34cb6b)[_0x6fc4('0x1c')](function(_0x2e7f81){_0x13eb64({'code':0xc8,'message':_0x2e7f81['message']});})['catch'](function(_0x2bc789){_0x2c9fa3(_0x1e91cb[_0x6fc4('0x1d')](0x1f5,_0x2bc789['message']));});});},'Command':function(_0xf34889){var _0xb4a47a=this;return new Promise(function(_0x20f362,_0x4edb51){if(ami[_0x6fc4('0x12')]()==![]){return _0x4edb51(_0xb4a47a[_0x6fc4('0x1d')](0x1f4,[config[_0x6fc4('0x13')]['ip'],config['asterisk'][_0x6fc4('0x14')],_0x6fc4('0x15')]['join']('\x20')));}_0xf34889=_['pick'](_0xf34889,_0x6fc4('0x1e'));_0xf34889['action']='Command';return ami['Action'](_0xf34889)[_0x6fc4('0x1c')](function(_0x952c87){_0x20f362({'code':0xc8,'message':_0x952c87[_0x6fc4('0x1f')]});})['catch'](function(_0x1912a8){_0x4edb51(_0xb4a47a[_0x6fc4('0x1d')](0x1f5,_0x1912a8['message']));});});},'VoiceQueues':function(_0x14aa5f){return new Promise(function(_0x1e93d2,_0x2b9811){var _0x143813=[];for(var _0x6f99fe in _0x52b4c0[_0x6fc4('0x20')]){if(_0x52b4c0[_0x6fc4('0x20')][_0x6fc4('0x21')](_0x6f99fe)){var _0x2e7fde=_0x52b4c0[_0x6fc4('0x20')][_0x6f99fe];var _0x3be501={'id':_0x2e7fde['id'],'name':_0x2e7fde[_0x6fc4('0xa')],'strategy':_0x2e7fde[_0x6fc4('0x22')],'answered':_0x2e7fde['answered'],'available':_0x2e7fde[_0x6fc4('0x23')],'loggedIn':_0x2e7fde[_0x6fc4('0x24')],'pTalking':_0x2e7fde[_0x6fc4('0x25')],'sumBillable':_0x2e7fde[_0x6fc4('0x26')],'sumDuration':_0x2e7fde[_0x6fc4('0x27')],'sumHoldTime':_0x2e7fde[_0x6fc4('0x28')]||0x0,'talking':_0x2e7fde[_0x6fc4('0x29')],'total':_0x2e7fde[_0x6fc4('0x2a')],'type':_0x2e7fde[_0x6fc4('0x2b')],'unmanaged':_0x2e7fde[_0x6fc4('0x2c')],'abandoned':_0x2e7fde[_0x6fc4('0x2d')],'waiting':_0x2e7fde[_0x6fc4('0x2e')],'loggedInDb':_0x2e7fde['loggedInDb']};if(_0x2e7fde[_0x6fc4('0x2b')]==='outbound'){_0x3be501['dialActive']=_0x2e7fde[_0x6fc4('0x2f')];_0x3be501[_0x6fc4('0x30')]=_0x2e7fde[_0x6fc4('0x30')];_0x3be501[_0x6fc4('0x31')]=_0x2e7fde[_0x6fc4('0x31')];_0x3be501[_0x6fc4('0x32')]=_0x2e7fde['dialOriginateCallerIdNumber'];_0x3be501[_0x6fc4('0x33')]=_0x2e7fde[_0x6fc4('0x33')];_0x3be501[_0x6fc4('0x34')]=_0x2e7fde[_0x6fc4('0x34')];_0x3be501[_0x6fc4('0x35')]=_0x2e7fde[_0x6fc4('0x35')];_0x3be501[_0x6fc4('0x36')]=_0x2e7fde[_0x6fc4('0x36')];_0x3be501['outboundAnswerCallsDay']=_0x2e7fde[_0x6fc4('0x37')];_0x3be501[_0x6fc4('0x38')]=_0x2e7fde[_0x6fc4('0x38')];_0x3be501[_0x6fc4('0x39')]=_0x2e7fde[_0x6fc4('0x39')];_0x3be501[_0x6fc4('0x3a')]=_0x2e7fde[_0x6fc4('0x3a')];_0x3be501[_0x6fc4('0x3b')]=_0x2e7fde[_0x6fc4('0x3b')];_0x3be501['outboundDropCallsDayCallersExit']=_0x2e7fde['outboundDropCallsDayCallersExit'];_0x3be501[_0x6fc4('0x3c')]=_0x2e7fde[_0x6fc4('0x3c')];_0x3be501[_0x6fc4('0x3d')]=_0x2e7fde[_0x6fc4('0x3d')];_0x3be501[_0x6fc4('0x3e')]=_0x2e7fde[_0x6fc4('0x3e')];_0x3be501['outboundOriginateFailureCallsDay']=_0x2e7fde[_0x6fc4('0x3f')];_0x3be501[_0x6fc4('0x40')]=_0x2e7fde[_0x6fc4('0x40')];_0x3be501[_0x6fc4('0x41')]=_0x2e7fde[_0x6fc4('0x41')];_0x3be501[_0x6fc4('0x42')]=_0x2e7fde[_0x6fc4('0x42')];_0x3be501[_0x6fc4('0x43')]=_0x2e7fde[_0x6fc4('0x43')];_0x3be501[_0x6fc4('0x44')]=_0x2e7fde[_0x6fc4('0x44')];_0x3be501[_0x6fc4('0x45')]=_0x2e7fde[_0x6fc4('0x45')];_0x3be501[_0x6fc4('0x46')]=_0x2e7fde['predictiveIntervalDroppedCallsCallersExit'];_0x3be501[_0x6fc4('0x47')]=_0x2e7fde[_0x6fc4('0x47')];_0x3be501[_0x6fc4('0x48')]=_0x2e7fde['predictiveIntervalErlangCalls'];_0x3be501[_0x6fc4('0x49')]=_0x2e7fde[_0x6fc4('0x49')];_0x3be501[_0x6fc4('0x4a')]=_0x2e7fde[_0x6fc4('0x4a')];_0x3be501[_0x6fc4('0x4b')]=_0x2e7fde[_0x6fc4('0x4b')];_0x3be501[_0x6fc4('0x4c')]=_0x2e7fde[_0x6fc4('0x4c')];_0x3be501[_0x6fc4('0x4d')]=_0x2e7fde[_0x6fc4('0x4d')];_0x3be501[_0x6fc4('0x4e')]=_0x2e7fde[_0x6fc4('0x4e')];_0x3be501['message']=_0x2e7fde[_0x6fc4('0x4f')];_0x3be501[_0x6fc4('0x50')]=_0x2e7fde[_0x6fc4('0x50')];_0x3be501['erlangCalls']=_0x2e7fde[_0x6fc4('0x51')];_0x3be501[_0x6fc4('0x52')]=_0x2e7fde[_0x6fc4('0x52')];_0x3be501['erlangAbandonmentRate']=_0x2e7fde['erlangAbandonmentRate'];_0x3be501[_0x6fc4('0x53')]=_0x2e7fde[_0x6fc4('0x53')];_0x3be501[_0x6fc4('0x54')]=_0x2e7fde['startPredictive'];_0x3be501[_0x6fc4('0x55')]=_0x2e7fde[_0x6fc4('0x55')];}if(_0x2e7fde[_0x6fc4('0x56')]){_0x3be501[_0x6fc4('0x56')]={'id':_0x2e7fde[_0x6fc4('0x56')]['id'],'name':_0x2e7fde[_0x6fc4('0x56')][_0x6fc4('0xa')],'active':_0x2e7fde[_0x6fc4('0x56')][_0x6fc4('0x57')],'callerid':_0x2e7fde['Trunk'][_0x6fc4('0x58')]};}if(_0x2e7fde[_0x6fc4('0x59')]){_0x3be501['Interval']={'id':_0x2e7fde[_0x6fc4('0x59')]['id'],'name':_0x2e7fde[_0x6fc4('0x59')][_0x6fc4('0xa')]};}_0x143813[_0x6fc4('0x5a')](_0x3be501);}}_0x1e93d2({'count':_0x143813[_0x6fc4('0x5b')],'rows':_0x143813});});},'UpdateVoiceQueue':function(_0x5ece24){return new Promise(function(_0x3b19cd,_0x4c7011){var _0x3743a6=_[_0x6fc4('0x5c')](_0x52b4c0['voiceQueues'],{'id':parseInt(_0x5ece24['id'])});var _0x5d8387=_[_0x6fc4('0x5d')](_0x5ece24,['id']);if(_0x3743a6){for(var _0xb61016 in _0x5d8387){if(typeof _0x5d8387[_0xb61016]!==_0x6fc4('0x5e')&&typeof _0x3743a6[_0xb61016]!=='undefined'){_0x3743a6[_0xb61016]=_0x5d8387[_0xb61016];}}_0x3b19cd(_0x3743a6);}else{_0x4c7011();}});},'VoiceChannels':function(_0x1803a3){return new Promise(function(_0x1aa300,_0x1c0ab1){var _0x2a8e80=_[_0x6fc4('0x5f')](_0x52b4c0[_0x6fc4('0x60')]);_0x1aa300({'count':_0x2a8e80[_0x6fc4('0x5b')],'rows':_0x2a8e80});});},'VoiceChannelMixMonitor':function(_0x244459){var _0x770f34=this;return new Promise(function(_0x128f4e,_0x51de58){if(ami[_0x6fc4('0x12')]()==![]){return _0x51de58(_0x770f34[_0x6fc4('0x1d')](0x1f4,[config[_0x6fc4('0x13')]['ip'],config[_0x6fc4('0x13')]['username'],_0x6fc4('0x15')][_0x6fc4('0x16')]('\x20')));}var _0x488540=schema(properties[_0x6fc4('0x61')])[_0x6fc4('0x2')](_0x244459);if(_0x488540[_0x6fc4('0x5b')]>0x0){return _0x51de58(_0x770f34['error'](0x1f4,_['map'](_0x488540,_0x6fc4('0x4f'))[_0x6fc4('0x16')](',\x20')));}var _0x3e0481=_[_0x6fc4('0x5c')](_0x52b4c0[_0x6fc4('0x60')],{'uniqueid':_0x244459[_0x6fc4('0x62')]});if(_0x3e0481&&_0x3e0481[_0x6fc4('0x63')]){var _0xec2ff3=util[_0x6fc4('0x8')](_0x6fc4('0x64'),_0x244459[_0x6fc4('0x65')]||_0x244459[_0x6fc4('0x62')],_0x244459[_0x6fc4('0x8')]||_0x6fc4('0x66'));return ami['Action']({'action':_0x6fc4('0x67'),'channel':_0x3e0481['channel'],'file':_0xec2ff3,'options':_0x6fc4('0x68')})[_0x6fc4('0x1c')](function(_0x17c558){var _0x3f0f9e=_['find'](_0x3e0481[_0x6fc4('0x69')],{'filename':_0x6fc4('0x6a')+_0xec2ff3[_0x6fc4('0x6b')]()});if(_[_0x6fc4('0x6c')](_0x3f0f9e)){_0x3e0481['monitors'][_0x6fc4('0x5a')]({'filename':_0x6fc4('0x6a')+_0xec2ff3[_0x6fc4('0x6b')](),'createdAt':moment()[_0x6fc4('0x8')](_0x6fc4('0x6d')),'mixmonitorid':_0x17c558[_0x6fc4('0x6e')],'status':_0x6fc4('0x6f')});}else{_0x3f0f9e[_0x6fc4('0x6e')]=_0x17c558['mixmonitorid'];_0x3f0f9e['status']='rec';}_0x128f4e({'code':0xc8,'message':[_0x244459[_0x6fc4('0x62')],_0x6fc4('0x70'),_0x17c558[_0x6fc4('0x6e')]][_0x6fc4('0x16')]('\x20'),'mixmonitorid':_0x17c558[_0x6fc4('0x6e')]});})[_0x6fc4('0x71')](function(_0x4c39a7){_0x51de58(_0x770f34[_0x6fc4('0x1d')](0x1f5,[_0x244459['uniqueid'],_0x4c39a7[_0x6fc4('0x4f')][_0x6fc4('0x6b')]()][_0x6fc4('0x16')]('\x20')));});}else{return _0x51de58(_0x770f34[_0x6fc4('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x7d0241){var _0x39184f=this;return new Promise(function(_0x5506b5,_0x2def91){if(ami[_0x6fc4('0x12')]()==![]){return _0x2def91(_0x39184f[_0x6fc4('0x1d')](0x1f4,[config[_0x6fc4('0x13')]['ip'],config[_0x6fc4('0x13')]['username'],'ami\x20disconnected'][_0x6fc4('0x16')]('\x20')));}var _0x9b34f7=schema(properties[_0x6fc4('0x61')])[_0x6fc4('0x2')](_0x7d0241);if(_0x9b34f7[_0x6fc4('0x5b')]>0x0){return _0x2def91(_0x39184f[_0x6fc4('0x1d')](0x1f4,_[_0x6fc4('0x72')](_0x9b34f7,_0x6fc4('0x4f'))[_0x6fc4('0x16')](',\x20')));}var _0x126839=_[_0x6fc4('0x5c')](_0x52b4c0[_0x6fc4('0x60')],{'uniqueid':_0x7d0241[_0x6fc4('0x62')]});if(_0x126839){return BPromise[_0x6fc4('0x73')]()[_0x6fc4('0x1c')](function(){if(_0x126839['channel']){return ami[_0x6fc4('0x74')]({'action':_0x6fc4('0x75'),'channel':_0x126839['channel'],'mixmonitorid':_0x7d0241['mixmonitorid']})[_0x6fc4('0x71')](function(_0x434ed9){});}})[_0x6fc4('0x1c')](function(){if(_0x126839[_0x6fc4('0x76')]){return ami[_0x6fc4('0x74')]({'action':_0x6fc4('0x75'),'channel':_0x126839[_0x6fc4('0x76')],'mixmonitorid':_0x7d0241[_0x6fc4('0x6e')]})[_0x6fc4('0x71')](function(_0x4355d1){});}})[_0x6fc4('0x1c')](function(_0x1c2cfd){var _0x2cffee=_[_0x6fc4('0x5c')](_0x126839['monitors'],{'mixmonitorid':_0x7d0241[_0x6fc4('0x6e')]});if(_0x2cffee){_0x2cffee['status']=_0x6fc4('0x77');}})[_0x6fc4('0x1c')](function(){var _0x566ccf=util[_0x6fc4('0x8')](_0x6fc4('0x64'),_0x7d0241[_0x6fc4('0x65')]||_0x7d0241[_0x6fc4('0x62')],_0x7d0241[_0x6fc4('0x8')]||_0x6fc4('0x66'));var _0x5f48f7=_[_0x6fc4('0x5c')](_0x126839[_0x6fc4('0x69')],{'filename':_0x6fc4('0x6a')+_0x566ccf['toLowerCase']()});if(_0x5f48f7){_0x5f48f7['status']=_0x6fc4('0x77');}})[_0x6fc4('0x1c')](function(){_0x5506b5({'code':0xc8,'message':[_0x7d0241[_0x6fc4('0x62')],_0x6fc4('0x78')]['join']('\x20')});})[_0x6fc4('0x71')](function(_0x33868f){_0x2def91(_0x39184f['error'](0x1f5,[_0x7d0241[_0x6fc4('0x62')],_0x33868f['message'][_0x6fc4('0x6b')]()][_0x6fc4('0x16')]('\x20')));});}else{return _0x2def91(_0x39184f[_0x6fc4('0x1d')](0x1f5,_0x6fc4('0x79')));}});},'VoiceQueuesChannels':function(_0x37aa3f){return new Promise(function(_0x16ec60,_0x23f6ba){var _0x5d59b2=_[_0x6fc4('0x5f')](_0x52b4c0[_0x6fc4('0x7a')]);_0x16ec60({'count':_0x5d59b2[_0x6fc4('0x5b')],'rows':_0x5d59b2});});},'VoiceQueuesChannel':function(_0xdee5bc){var _0x16ad86=this;return new Promise(function(_0x1b373b,_0x253044){var _0x66d0a3=schema(properties[_0x6fc4('0x7b')])[_0x6fc4('0x2')](_0xdee5bc);if(_0x66d0a3[_0x6fc4('0x5b')]>0x0){return _0x253044(_0x16ad86[_0x6fc4('0x1d')](0x1f4,_[_0x6fc4('0x72')](_0x66d0a3,'message')[_0x6fc4('0x16')](',\x20')));}var _0xeafa8e=_[_0x6fc4('0x5c')](_0x52b4c0['queueChannels'],{'uniqueid':_0xdee5bc[_0x6fc4('0x62')]});if(_0xeafa8e){_0x1b373b(_0xeafa8e);}else{return _0x253044(_0x16ad86['error'](0x1f5,_0x6fc4('0x79')));}});},'VoiceQueuesChannelHangup':function(_0x39fd3d){var _0x9e476d=this;return new Promise(function(_0x2775e8,_0xb74de5){if(ami[_0x6fc4('0x12')]()==![]){return _0xb74de5(_0x9e476d['error'](0x1f4,[config[_0x6fc4('0x13')]['ip'],config[_0x6fc4('0x13')]['username'],_0x6fc4('0x15')][_0x6fc4('0x16')]('\x20')));}var _0x45c21c=schema(properties[_0x6fc4('0x7c')])[_0x6fc4('0x2')](_0x39fd3d);if(_0x45c21c[_0x6fc4('0x5b')]>0x0){return _0xb74de5(_0x9e476d[_0x6fc4('0x1d')](0x1f4,_[_0x6fc4('0x72')](_0x45c21c,_0x6fc4('0x4f'))[_0x6fc4('0x16')](',\x20')));}var _0x19d134=_[_0x6fc4('0x5c')](_0x52b4c0['queueChannels'],{'uniqueid':_0x39fd3d[_0x6fc4('0x62')]});if(_0x19d134&&_0x19d134[_0x6fc4('0x63')]){return ami[_0x6fc4('0x74')]({'action':_0x6fc4('0x7d'),'channel':_0x19d134[_0x6fc4('0x63')]})[_0x6fc4('0x1c')](function(_0x114819){_0x2775e8({'code':0xc8,'message':[_0x39fd3d[_0x6fc4('0x62')],_0x114819[_0x6fc4('0x4f')][_0x6fc4('0x6b')]()][_0x6fc4('0x16')]('\x20')});})['catch'](function(_0x475acc){_0xb74de5(_0x9e476d['error'](0x1f5,[_0x39fd3d[_0x6fc4('0x62')],_0x475acc[_0x6fc4('0x4f')][_0x6fc4('0x6b')]()][_0x6fc4('0x16')]('\x20')));});}else{return _0xb74de5(_0x9e476d['error'](0x1f5,_0x6fc4('0x79')));}});},'VoiceQueuesChannelRedirect':function(_0x470705){var _0x438b47=this;return new Promise(function(_0x79731a,_0x51e350){if(ami['isConnected']()==![]){return _0x51e350(_0x438b47[_0x6fc4('0x1d')](0x1f4,[config[_0x6fc4('0x13')]['ip'],config[_0x6fc4('0x13')][_0x6fc4('0x14')],'ami\x20disconnected']['join']('\x20')));}var _0x3e15ff=schema(properties[_0x6fc4('0x7e')])['validate'](_0x470705);if(_0x3e15ff['length']>0x0){return _0x51e350(_0x438b47['error'](0x1f4,_[_0x6fc4('0x72')](_0x3e15ff,_0x6fc4('0x4f'))[_0x6fc4('0x16')](',\x20')));}var _0x3554ce=_[_0x6fc4('0x5c')](_0x52b4c0[_0x6fc4('0x7a')],{'uniqueid':_0x470705[_0x6fc4('0x62')]});if(_0x3554ce&&_0x3554ce['channel']){return ami['Action']({'action':_0x6fc4('0x7f'),'channel':_0x3554ce[_0x6fc4('0x63')],'exten':_0x470705[_0x6fc4('0x80')],'context':_0x470705[_0x6fc4('0x81')]||_0x3554ce['context'],'priority':0x1})['then'](function(_0x16e521){_0x79731a({'code':0xc8,'message':[_0x470705[_0x6fc4('0x62')],_0x16e521[_0x6fc4('0x4f')][_0x6fc4('0x6b')]()][_0x6fc4('0x16')]('\x20')});})[_0x6fc4('0x71')](function(_0xbfc137){_0x51e350(_0x438b47[_0x6fc4('0x1d')](0x1f5,[_0x470705[_0x6fc4('0x62')],_0xbfc137['message'][_0x6fc4('0x6b')]()][_0x6fc4('0x16')]('\x20')));});}else{return _0x51e350(_0x438b47['error'](0x1f5,_0x6fc4('0x79')));}});},'Agents':function(_0x5d8dab){return new Promise(function(_0x3ea969,_0x29638b){var _0x273c03=_[_0x6fc4('0x5f')](_0x52b4c0['agents']);_0x3ea969({'count':_0x273c03[_0x6fc4('0x5b')],'rows':_0x273c03});});},'Telephones':function(_0x301721){return new Promise(function(_0x15198e,_0x2d22f9){var _0x15a3ab=_[_0x6fc4('0x5f')](_0x52b4c0[_0x6fc4('0x82')]);_0x15198e({'count':_0x15a3ab[_0x6fc4('0x5b')],'rows':_0x15a3ab});});},'Trunks':function(_0x31174f){return new Promise(function(_0x5b7706,_0x58ad70){var _0x568934=_['values'](_0x52b4c0[_0x6fc4('0x83')]);_0x5b7706({'count':_0x568934[_0x6fc4('0x5b')],'rows':_0x568934});});},'OutboundChannels':function(_0x42f4d2){return new Promise(function(_0x11026d,_0x2165bf){var _0x3dab4a=_[_0x6fc4('0x5f')](_0x52b4c0[_0x6fc4('0x84')]);_0x11026d({'count':_0x3dab4a[_0x6fc4('0x5b')],'rows':_0x3dab4a});});},'Outbound':function(_0x1ea260){return new Promise(function(_0x5ee562,_0x8c7988){_0x5ee562(_0x52b4c0[_0x6fc4('0x85')]);});},'Campaigns':function(_0x511ac1){return new Promise(function(_0x1038fd,_0x7a4188){var _0x421f19=_[_0x6fc4('0x5f')](_0x52b4c0[_0x6fc4('0x86')]);_0x1038fd({'count':_0x421f19[_0x6fc4('0x5b')],'rows':_0x421f19});});},'VoiceQueuesPreview':function(_0x10048f){var _0x572cca=this;return new Promise(function(_0xaa88f7,_0x103828){_0x1504a6[_0x6fc4('0x87')](_0x10048f['id'])[_0x6fc4('0x1c')](function(_0x165d12){_0xaa88f7({'code':0xc8,'message':_0x165d12['message']});})[_0x6fc4('0x71')](function(_0xe0c2b3){_0x103828(_0x572cca[_0x6fc4('0x1d')](0x1f4,_0xe0c2b3['message']));});});},'EventManager':function(_0x3d4703){var _0x13e5dc=this;return new Promise(function(_0x102a15,_0x44b143){if(!_0x3d4703[_0x6fc4('0x88')]){return _0x44b143(_0x13e5dc['error'](0x1f4,_0x6fc4('0x89')));}ami[_0x6fc4('0x8a')]('custom:'+_0x3d4703[_0x6fc4('0x88')],_0x3d4703[_0x6fc4('0x4f')]);_0x102a15({'code':0xc8,'message':_0x3d4703});});},'FaxAccounts':function(_0x21794b){return new Promise(function(_0x18434a,_0x6201d4){var _0x4381a8=_['values'](_0x52b4c0[_0x6fc4('0x8b')]);_0x18434a({'count':_0x4381a8[_0x6fc4('0x5b')],'rows':_0x4381a8});});},'SendFax':function(_0x15f891){var _0x271807=this;return new Promise(function(_0x51f76c,_0x14c732){_0xf57aa9[_0x6fc4('0x8c')](_0x15f891)[_0x6fc4('0x1c')](function(_0x17a8dc){_0x51f76c({'code':0xc8,'message':_0x17a8dc['message']});})[_0x6fc4('0x71')](function(_0x1c1644){_0x14c732(_0x271807[_0x6fc4('0x1d')](0x1f4,_0x1c1644[_0x6fc4('0x4f')]));});});},'CheckAfterSend':function(_0x23ed98){var _0x410042=this;return new Promise(function(_0xb375f1,_0x1c2885){_0xf57aa9[_0x6fc4('0x8d')](_0x23ed98)['then'](function(_0x41d82d){_0xb375f1({'code':0xc8,'message':_0x41d82d['message']});})[_0x6fc4('0x71')](function(_0x27ffae){_0x1c2885(_0x410042[_0x6fc4('0x1d')](0x1f4,_0x27ffae[_0x6fc4('0x4f')]));});});}};var _0x136504=jayson[_0x6fc4('0x8e')](_0x31e6c7)[_0x6fc4('0x8f')]();_0x136504['on']('error',function(_0x5ba87d){return _0x454abb(_0x5ba87d);});_0x136504[_0x6fc4('0x7')](0x232a,_0x6fc4('0x90'),function(){console[_0x6fc4('0x91')](_0x6fc4('0x92'),0x232a);return _0x3100a0('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0xc6ac=['outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','find','omit','undefined','channels','voicechannel','map','channel','%s.%s','filename','uniqueid','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','wav','stop','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','values','telephones','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','Reload','Action','then','message','catch','command','action','Command','content','voiceQueues','strategy','answered','available','pTalking','sumBillable','sumDuration','talking','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay'];(function(_0x50cfc3,_0x526cc6){var _0x5c11ef=function(_0xeaf96a){while(--_0xeaf96a){_0x50cfc3['push'](_0x50cfc3['shift']());}};_0x5c11ef(++_0x526cc6);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x33a77c,_0x37e0d3){_0x33a77c=_0x33a77c-0x0;var _0x3bb6b9=_0xc6ac[_0x33a77c];return _0x3bb6b9;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var jayson=require(_0xcc6a('0x2'));var schema=require(_0xcc6a('0x3'));var BPromise=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var config=require(_0xcc6a('0x6'));var properties=require(_0xcc6a('0x7'));var ami=require(_0xcc6a('0x8'));exports[_0xcc6a('0x9')]=function(_0x2f26ab,_0x188b05,_0x12330e){return new BPromise(function(_0x197bd7,_0x5f3887){var _0x3dd497={'QueuePause':function(_0x11b919){return new Promise(function(_0xf02261,_0x560cc4){var _0x43e3bf=util[_0xcc6a('0xa')](_0xcc6a('0xb'),_0xcc6a('0xc'),_0x11b919[_0xcc6a('0xd')]);if(_0x2f26ab['timers']&&_0x2f26ab[_0xcc6a('0xe')][_0x43e3bf]&&_0x2f26ab[_0xcc6a('0xe')][_0x43e3bf][_0xcc6a('0xf')]){_0x2f26ab['timers'][_0x43e3bf][_0xcc6a('0x10')]();}if(_0x2f26ab[_0xcc6a('0x11')][_0x43e3bf]){_0x2f26ab[_0xcc6a('0x11')][_0x43e3bf]['updateStatusRealtime']({'statePause':_0x11b919['pause']?!![]:![]});}_0xf02261({'code':0xc8,'message':_0xcc6a('0x12')});});},'Reload':function(_0x211444){var _0x4300c0=this;return new Promise(function(_0x559a0a,_0x483ed4){if(ami[_0xcc6a('0x13')]()==![]){return _0x483ed4(_0x4300c0[_0xcc6a('0x14')](0x1f4,[config[_0xcc6a('0x15')]['ip'],config[_0xcc6a('0x15')][_0xcc6a('0x16')],_0xcc6a('0x17')][_0xcc6a('0x18')]('\x20')));}_0x211444=_[_0xcc6a('0x19')](_0x211444,_['keys'](properties['module']));_0x211444['action']=_0xcc6a('0x1a');return ami[_0xcc6a('0x1b')](_0x211444)[_0xcc6a('0x1c')](function(_0x3e63d9){_0x559a0a({'code':0xc8,'message':_0x3e63d9[_0xcc6a('0x1d')]});})[_0xcc6a('0x1e')](function(_0x2d9585){_0x483ed4(_0x4300c0[_0xcc6a('0x14')](0x1f5,_0x2d9585[_0xcc6a('0x1d')]));});});},'Command':function(_0x2a3994){var _0x1d20a3=this;return new Promise(function(_0x5b657e,_0xfec60f){if(ami[_0xcc6a('0x13')]()==![]){return _0xfec60f(_0x1d20a3[_0xcc6a('0x14')](0x1f4,[config[_0xcc6a('0x15')]['ip'],config[_0xcc6a('0x15')][_0xcc6a('0x16')],_0xcc6a('0x17')][_0xcc6a('0x18')]('\x20')));}_0x2a3994=_[_0xcc6a('0x19')](_0x2a3994,_0xcc6a('0x1f'));_0x2a3994[_0xcc6a('0x20')]=_0xcc6a('0x21');return ami['Action'](_0x2a3994)[_0xcc6a('0x1c')](function(_0x3a081e){_0x5b657e({'code':0xc8,'message':_0x3a081e[_0xcc6a('0x22')]});})['catch'](function(_0x10016a){_0xfec60f(_0x1d20a3[_0xcc6a('0x14')](0x1f5,_0x10016a[_0xcc6a('0x1d')]));});});},'VoiceQueues':function(_0x3ed7ce){return new Promise(function(_0x432c23,_0x5fc697){var _0x50abc1=[];for(var _0x26def8 in _0x2f26ab[_0xcc6a('0x23')]){if(_0x2f26ab[_0xcc6a('0x23')]['hasOwnProperty'](_0x26def8)){var _0x3afb3a=_0x2f26ab[_0xcc6a('0x23')][_0x26def8];var _0x4da301={'id':_0x3afb3a['id'],'name':_0x3afb3a[_0xcc6a('0xd')],'strategy':_0x3afb3a[_0xcc6a('0x24')],'answered':_0x3afb3a[_0xcc6a('0x25')],'available':_0x3afb3a[_0xcc6a('0x26')],'loggedIn':_0x3afb3a['loggedIn'],'pTalking':_0x3afb3a[_0xcc6a('0x27')],'sumBillable':_0x3afb3a[_0xcc6a('0x28')],'sumDuration':_0x3afb3a[_0xcc6a('0x29')],'sumHoldTime':_0x3afb3a['sumHoldTime']||0x0,'talking':_0x3afb3a[_0xcc6a('0x2a')],'total':_0x3afb3a['total'],'type':_0x3afb3a['type'],'unmanaged':_0x3afb3a[_0xcc6a('0x2b')],'abandoned':_0x3afb3a[_0xcc6a('0x2c')],'waiting':_0x3afb3a[_0xcc6a('0x2d')],'loggedInDb':_0x3afb3a[_0xcc6a('0x2e')]};if(_0x3afb3a[_0xcc6a('0x2f')]===_0xcc6a('0x30')){_0x4da301['dialActive']=_0x3afb3a[_0xcc6a('0x31')];_0x4da301[_0xcc6a('0x32')]=_0x3afb3a[_0xcc6a('0x32')];_0x4da301[_0xcc6a('0x33')]=_0x3afb3a[_0xcc6a('0x33')];_0x4da301[_0xcc6a('0x34')]=_0x3afb3a[_0xcc6a('0x34')];_0x4da301[_0xcc6a('0x35')]=_0x3afb3a['dialOriginateTimeout'];_0x4da301[_0xcc6a('0x36')]=_0x3afb3a[_0xcc6a('0x36')];_0x4da301[_0xcc6a('0x37')]=_0x3afb3a[_0xcc6a('0x37')];_0x4da301[_0xcc6a('0x38')]=_0x3afb3a[_0xcc6a('0x38')];_0x4da301[_0xcc6a('0x39')]=_0x3afb3a['outboundAnswerCallsDay'];_0x4da301[_0xcc6a('0x3a')]=_0x3afb3a['outboundBlacklistCallsDay'];_0x4da301['outboundBusyCallsDay']=_0x3afb3a['outboundBusyCallsDay'];_0x4da301[_0xcc6a('0x3b')]=_0x3afb3a[_0xcc6a('0x3b')];_0x4da301[_0xcc6a('0x3c')]=_0x3afb3a[_0xcc6a('0x3c')];_0x4da301[_0xcc6a('0x3d')]=_0x3afb3a['outboundDropCallsDayCallersExit'];_0x4da301['outboundDropCallsDayTimeout']=_0x3afb3a[_0xcc6a('0x3e')];_0x4da301[_0xcc6a('0x3f')]=_0x3afb3a[_0xcc6a('0x3f')];_0x4da301['outboundNoSuchCallsDay']=_0x3afb3a[_0xcc6a('0x40')];_0x4da301[_0xcc6a('0x41')]=_0x3afb3a[_0xcc6a('0x41')];_0x4da301[_0xcc6a('0x42')]=_0x3afb3a[_0xcc6a('0x42')];_0x4da301[_0xcc6a('0x43')]=_0x3afb3a[_0xcc6a('0x43')];_0x4da301[_0xcc6a('0x44')]=_0x3afb3a[_0xcc6a('0x44')];_0x4da301[_0xcc6a('0x45')]=_0x3afb3a[_0xcc6a('0x45')];_0x4da301[_0xcc6a('0x46')]=_0x3afb3a[_0xcc6a('0x46')];_0x4da301[_0xcc6a('0x47')]=_0x3afb3a[_0xcc6a('0x47')];_0x4da301[_0xcc6a('0x48')]=_0x3afb3a[_0xcc6a('0x48')];_0x4da301[_0xcc6a('0x49')]=_0x3afb3a['predictiveIntervalDroppedCallsTimeout'];_0x4da301['predictiveIntervalErlangCalls']=_0x3afb3a[_0xcc6a('0x4a')];_0x4da301[_0xcc6a('0x4b')]=_0x3afb3a[_0xcc6a('0x4b')];_0x4da301[_0xcc6a('0x4c')]=_0x3afb3a[_0xcc6a('0x4c')];_0x4da301[_0xcc6a('0x4d')]=_0x3afb3a[_0xcc6a('0x4d')];_0x4da301[_0xcc6a('0x4e')]=_0x3afb3a['predictiveIntervalPauses'];_0x4da301['predictiveIntervalAvailable']=_0x3afb3a[_0xcc6a('0x4f')];_0x4da301['predictiveIntervalTotalCalls']=_0x3afb3a['predictiveIntervalTotalCalls'];_0x4da301['message']=_0x3afb3a[_0xcc6a('0x1d')];_0x4da301[_0xcc6a('0x50')]=_0x3afb3a[_0xcc6a('0x50')];_0x4da301[_0xcc6a('0x51')]=_0x3afb3a[_0xcc6a('0x51')];_0x4da301['erlangCallToSecond']=_0x3afb3a[_0xcc6a('0x52')];_0x4da301[_0xcc6a('0x53')]=_0x3afb3a[_0xcc6a('0x53')];_0x4da301[_0xcc6a('0x54')]=_0x3afb3a[_0xcc6a('0x54')];_0x4da301[_0xcc6a('0x55')]=_0x3afb3a['startPredictive'];_0x4da301[_0xcc6a('0x56')]=_0x3afb3a[_0xcc6a('0x56')];}if(_0x3afb3a[_0xcc6a('0x57')]){_0x4da301[_0xcc6a('0x57')]={'id':_0x3afb3a['Trunk']['id'],'name':_0x3afb3a[_0xcc6a('0x57')]['name'],'active':_0x3afb3a[_0xcc6a('0x57')][_0xcc6a('0x58')],'callerid':_0x3afb3a[_0xcc6a('0x57')]['callerid']};}if(_0x3afb3a[_0xcc6a('0x59')]){_0x4da301[_0xcc6a('0x59')]={'id':_0x3afb3a[_0xcc6a('0x59')]['id'],'name':_0x3afb3a['Interval']['name']};}_0x50abc1[_0xcc6a('0x5a')](_0x4da301);}}_0x432c23({'count':_0x50abc1[_0xcc6a('0x5b')],'rows':_0x50abc1});});},'UpdateVoiceQueue':function(_0x42075f){return new Promise(function(_0x3d1e6b,_0x345e94){var _0x5e59af=_[_0xcc6a('0x5c')](_0x2f26ab[_0xcc6a('0x23')],{'id':parseInt(_0x42075f['id'])});var _0x50ef8c=_[_0xcc6a('0x5d')](_0x42075f,['id']);if(_0x5e59af){for(var _0xa45d06 in _0x50ef8c){if(typeof _0x50ef8c[_0xa45d06]!==_0xcc6a('0x5e')&&typeof _0x5e59af[_0xa45d06]!==_0xcc6a('0x5e')){_0x5e59af[_0xa45d06]=_0x50ef8c[_0xa45d06];}}_0x3d1e6b(_0x5e59af);}else{_0x345e94();}});},'VoiceChannels':function(_0x3b595f){return new Promise(function(_0x22d4f1,_0x5c88e5){var _0x4e1a0b=_['values'](_0x2f26ab[_0xcc6a('0x5f')]);_0x22d4f1({'count':_0x4e1a0b[_0xcc6a('0x5b')],'rows':_0x4e1a0b});});},'VoiceChannelMixMonitor':function(_0x13f4df){var _0x323bb7=this;return new Promise(function(_0x4a25ce,_0x1c3bb8){if(ami['isConnected']()==![]){return _0x1c3bb8(_0x323bb7[_0xcc6a('0x14')](0x1f4,[config[_0xcc6a('0x15')]['ip'],config[_0xcc6a('0x15')][_0xcc6a('0x16')],_0xcc6a('0x17')][_0xcc6a('0x18')]('\x20')));}var _0x47b175=schema(properties[_0xcc6a('0x60')])[_0xcc6a('0x3')](_0x13f4df);if(_0x47b175[_0xcc6a('0x5b')]>0x0){return _0x1c3bb8(_0x323bb7[_0xcc6a('0x14')](0x1f4,_[_0xcc6a('0x61')](_0x47b175,_0xcc6a('0x1d'))[_0xcc6a('0x18')](',\x20')));}var _0x392805=_[_0xcc6a('0x5c')](_0x2f26ab[_0xcc6a('0x5f')],{'uniqueid':_0x13f4df['uniqueid']});if(_0x392805&&_0x392805[_0xcc6a('0x62')]){var _0x3197b5=util[_0xcc6a('0xa')](_0xcc6a('0x63'),_0x13f4df[_0xcc6a('0x64')]||_0x13f4df[_0xcc6a('0x65')],_0x13f4df['format']||'wav');return ami[_0xcc6a('0x1b')]({'action':'MixMonitor','channel':_0x392805[_0xcc6a('0x62')],'file':_0x3197b5,'options':_0xcc6a('0x66')})[_0xcc6a('0x1c')](function(_0x346660){var _0x146362=_[_0xcc6a('0x5c')](_0x392805[_0xcc6a('0x67')],{'filename':_0xcc6a('0x68')+_0x3197b5[_0xcc6a('0x69')]()});if(_[_0xcc6a('0x6a')](_0x146362)){_0x392805[_0xcc6a('0x67')]['push']({'filename':_0xcc6a('0x68')+_0x3197b5['toLowerCase'](),'createdAt':moment()[_0xcc6a('0xa')](_0xcc6a('0x6b')),'mixmonitorid':_0x346660[_0xcc6a('0x6c')],'status':'rec'});}else{_0x146362[_0xcc6a('0x6c')]=_0x346660['mixmonitorid'];_0x146362[_0xcc6a('0x6d')]='rec';}_0x4a25ce({'code':0xc8,'message':[_0x13f4df[_0xcc6a('0x65')],_0xcc6a('0x6e'),_0x346660[_0xcc6a('0x6c')]][_0xcc6a('0x18')]('\x20'),'mixmonitorid':_0x346660[_0xcc6a('0x6c')]});})[_0xcc6a('0x1e')](function(_0xd891b5){_0x1c3bb8(_0x323bb7[_0xcc6a('0x14')](0x1f5,[_0x13f4df['uniqueid'],_0xd891b5[_0xcc6a('0x1d')]['toLowerCase']()][_0xcc6a('0x18')]('\x20')));});}else{return _0x1c3bb8(_0x323bb7['error'](0x1f5,_0xcc6a('0x6f')));}});},'VoiceChannelStopMixMonitor':function(_0x242892){var _0x3c4b7c=this;return new Promise(function(_0x586789,_0x2fa7fa){if(ami['isConnected']()==![]){return _0x2fa7fa(_0x3c4b7c['error'](0x1f4,[config[_0xcc6a('0x15')]['ip'],config[_0xcc6a('0x15')][_0xcc6a('0x16')],_0xcc6a('0x17')][_0xcc6a('0x18')]('\x20')));}var _0x1ce9ba=schema(properties[_0xcc6a('0x60')])[_0xcc6a('0x3')](_0x242892);if(_0x1ce9ba[_0xcc6a('0x5b')]>0x0){return _0x2fa7fa(_0x3c4b7c[_0xcc6a('0x14')](0x1f4,_[_0xcc6a('0x61')](_0x1ce9ba,_0xcc6a('0x1d'))[_0xcc6a('0x18')](',\x20')));}var _0x483aa4=_[_0xcc6a('0x5c')](_0x2f26ab[_0xcc6a('0x5f')],{'uniqueid':_0x242892[_0xcc6a('0x65')]});if(_0x483aa4){return BPromise[_0xcc6a('0x70')]()['then'](function(){if(_0x483aa4[_0xcc6a('0x62')]){return ami[_0xcc6a('0x1b')]({'action':_0xcc6a('0x71'),'channel':_0x483aa4[_0xcc6a('0x62')],'mixmonitorid':_0x242892[_0xcc6a('0x6c')]})[_0xcc6a('0x1e')](function(_0x16c6a3){});}})[_0xcc6a('0x1c')](function(){if(_0x483aa4[_0xcc6a('0x72')]){return ami[_0xcc6a('0x1b')]({'action':'StopMixMonitor','channel':_0x483aa4['destinationchannel'],'mixmonitorid':_0x242892['mixmonitorid']})[_0xcc6a('0x1e')](function(_0x332c20){});}})[_0xcc6a('0x1c')](function(_0x4a9f34){var _0x2f7787=_[_0xcc6a('0x5c')](_0x483aa4[_0xcc6a('0x67')],{'mixmonitorid':_0x242892[_0xcc6a('0x6c')]});if(_0x2f7787){_0x2f7787['status']='stop';}})[_0xcc6a('0x1c')](function(){var _0x41527b=util[_0xcc6a('0xa')](_0xcc6a('0x63'),_0x242892['filename']||_0x242892[_0xcc6a('0x65')],_0x242892[_0xcc6a('0xa')]||_0xcc6a('0x73'));var _0x3b5e04=_[_0xcc6a('0x5c')](_0x483aa4['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x41527b[_0xcc6a('0x69')]()});if(_0x3b5e04){_0x3b5e04[_0xcc6a('0x6d')]=_0xcc6a('0x74');}})[_0xcc6a('0x1c')](function(){_0x586789({'code':0xc8,'message':[_0x242892['uniqueid'],'StopMixMonitor\x20Success'][_0xcc6a('0x18')]('\x20')});})[_0xcc6a('0x1e')](function(_0x472f5c){_0x2fa7fa(_0x3c4b7c[_0xcc6a('0x14')](0x1f5,[_0x242892['uniqueid'],_0x472f5c['message']['toLowerCase']()][_0xcc6a('0x18')]('\x20')));});}else{return _0x2fa7fa(_0x3c4b7c[_0xcc6a('0x14')](0x1f5,_0xcc6a('0x6f')));}});},'VoiceQueuesChannels':function(_0x729b2){return new Promise(function(_0x51a10b,_0xb85224){var _0x2ddfe0=_['values'](_0x2f26ab[_0xcc6a('0x75')]);_0x51a10b({'count':_0x2ddfe0['length'],'rows':_0x2ddfe0});});},'VoiceQueuesChannel':function(_0x3b4ce0){var _0x4ca4ab=this;return new Promise(function(_0x1770b0,_0xcf0bf5){var _0xa35084=schema(properties['voicequeuechannel'])[_0xcc6a('0x3')](_0x3b4ce0);if(_0xa35084['length']>0x0){return _0xcf0bf5(_0x4ca4ab[_0xcc6a('0x14')](0x1f4,_['map'](_0xa35084,_0xcc6a('0x1d'))[_0xcc6a('0x18')](',\x20')));}var _0x29a029=_[_0xcc6a('0x5c')](_0x2f26ab[_0xcc6a('0x75')],{'uniqueid':_0x3b4ce0[_0xcc6a('0x65')]});if(_0x29a029){_0x1770b0(_0x29a029);}else{return _0xcf0bf5(_0x4ca4ab['error'](0x1f5,_0xcc6a('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0x44796a){var _0x3efd18=this;return new Promise(function(_0x42755f,_0x3f4a88){if(ami['isConnected']()==![]){return _0x3f4a88(_0x3efd18[_0xcc6a('0x14')](0x1f4,[config[_0xcc6a('0x15')]['ip'],config['asterisk']['username'],_0xcc6a('0x17')][_0xcc6a('0x18')]('\x20')));}var _0x304c2b=schema(properties[_0xcc6a('0x76')])[_0xcc6a('0x3')](_0x44796a);if(_0x304c2b[_0xcc6a('0x5b')]>0x0){return _0x3f4a88(_0x3efd18['error'](0x1f4,_[_0xcc6a('0x61')](_0x304c2b,_0xcc6a('0x1d'))[_0xcc6a('0x18')](',\x20')));}var _0x3e31bd=_[_0xcc6a('0x5c')](_0x2f26ab[_0xcc6a('0x75')],{'uniqueid':_0x44796a['uniqueid']});if(_0x3e31bd&&_0x3e31bd['channel']){return ami[_0xcc6a('0x1b')]({'action':_0xcc6a('0x77'),'channel':_0x3e31bd[_0xcc6a('0x62')]})[_0xcc6a('0x1c')](function(_0x302edb){_0x42755f({'code':0xc8,'message':[_0x44796a[_0xcc6a('0x65')],_0x302edb[_0xcc6a('0x1d')]['toLowerCase']()][_0xcc6a('0x18')]('\x20')});})[_0xcc6a('0x1e')](function(_0x4741df){_0x3f4a88(_0x3efd18[_0xcc6a('0x14')](0x1f5,[_0x44796a[_0xcc6a('0x65')],_0x4741df[_0xcc6a('0x1d')]['toLowerCase']()][_0xcc6a('0x18')]('\x20')));});}else{return _0x3f4a88(_0x3efd18[_0xcc6a('0x14')](0x1f5,_0xcc6a('0x6f')));}});},'VoiceQueuesChannelRedirect':function(_0x5ad57c){var _0x25098f=this;return new Promise(function(_0x1a8a70,_0x313b1c){if(ami[_0xcc6a('0x13')]()==![]){return _0x313b1c(_0x25098f[_0xcc6a('0x14')](0x1f4,[config[_0xcc6a('0x15')]['ip'],config['asterisk'][_0xcc6a('0x16')],_0xcc6a('0x17')]['join']('\x20')));}var _0x1848dd=schema(properties[_0xcc6a('0x78')])[_0xcc6a('0x3')](_0x5ad57c);if(_0x1848dd[_0xcc6a('0x5b')]>0x0){return _0x313b1c(_0x25098f[_0xcc6a('0x14')](0x1f4,_['map'](_0x1848dd,_0xcc6a('0x1d'))[_0xcc6a('0x18')](',\x20')));}var _0xbd536e=_[_0xcc6a('0x5c')](_0x2f26ab[_0xcc6a('0x75')],{'uniqueid':_0x5ad57c[_0xcc6a('0x65')]});if(_0xbd536e&&_0xbd536e['channel']){return ami['Action']({'action':_0xcc6a('0x79'),'channel':_0xbd536e['channel'],'exten':_0x5ad57c[_0xcc6a('0x7a')],'context':_0x5ad57c[_0xcc6a('0x7b')]||_0xbd536e[_0xcc6a('0x7b')],'priority':0x1})[_0xcc6a('0x1c')](function(_0x1149dd){_0x1a8a70({'code':0xc8,'message':[_0x5ad57c[_0xcc6a('0x65')],_0x1149dd[_0xcc6a('0x1d')][_0xcc6a('0x69')]()][_0xcc6a('0x18')]('\x20')});})[_0xcc6a('0x1e')](function(_0xdf3385){_0x313b1c(_0x25098f[_0xcc6a('0x14')](0x1f5,[_0x5ad57c['uniqueid'],_0xdf3385[_0xcc6a('0x1d')][_0xcc6a('0x69')]()][_0xcc6a('0x18')]('\x20')));});}else{return _0x313b1c(_0x25098f[_0xcc6a('0x14')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x4024d5){return new Promise(function(_0x4d7c56,_0x33f67a){var _0x2b25d7=_[_0xcc6a('0x7c')](_0x2f26ab[_0xcc6a('0x11')]);_0x4d7c56({'count':_0x2b25d7[_0xcc6a('0x5b')],'rows':_0x2b25d7});});},'Telephones':function(_0x327a39){return new Promise(function(_0x13f72f,_0x4d2c38){var _0x357b66=_[_0xcc6a('0x7c')](_0x2f26ab[_0xcc6a('0x7d')]);_0x13f72f({'count':_0x357b66[_0xcc6a('0x5b')],'rows':_0x357b66});});},'Trunks':function(_0xc5cc18){return new Promise(function(_0x4473ab,_0x558e2f){var _0x14a957=_[_0xcc6a('0x7c')](_0x2f26ab['trunks']);_0x4473ab({'count':_0x14a957['length'],'rows':_0x14a957});});},'OutboundChannels':function(_0x23c34d){return new Promise(function(_0x2569d3,_0x303cde){var _0x24f6ec=_[_0xcc6a('0x7c')](_0x2f26ab['outboundChannels']);_0x2569d3({'count':_0x24f6ec[_0xcc6a('0x5b')],'rows':_0x24f6ec});});},'Outbound':function(_0x4a268b){return new Promise(function(_0x42b61d,_0x23a55d){_0x42b61d(_0x2f26ab[_0xcc6a('0x30')]);});},'Campaigns':function(_0x8f9055){return new Promise(function(_0x3c6e89,_0x1e6daf){var _0x294dd5=_[_0xcc6a('0x7c')](_0x2f26ab['campaigns']);_0x3c6e89({'count':_0x294dd5[_0xcc6a('0x5b')],'rows':_0x294dd5});});},'VoiceQueuesPreview':function(_0x2a850c){var _0x13b1df=this;return new Promise(function(_0x5cb0bd,_0x3a8613){_0x188b05[_0xcc6a('0x7e')](_0x2a850c['id'])[_0xcc6a('0x1c')](function(_0x290196){_0x5cb0bd({'code':0xc8,'message':_0x290196[_0xcc6a('0x1d')]});})[_0xcc6a('0x1e')](function(_0x45b55a){_0x3a8613(_0x13b1df['error'](0x1f4,_0x45b55a[_0xcc6a('0x1d')]));});});},'EventManager':function(_0x402df1){var _0x119a3c=this;return new Promise(function(_0x3febcd,_0x192117){if(!_0x402df1[_0xcc6a('0x7f')]){return _0x192117(_0x119a3c[_0xcc6a('0x14')](0x1f4,_0xcc6a('0x80')));}ami['emit']('custom:'+_0x402df1[_0xcc6a('0x7f')],_0x402df1['message']);_0x3febcd({'code':0xc8,'message':_0x402df1});});},'FaxAccounts':function(_0x1e3414){return new Promise(function(_0x377050,_0x9bb85c){var _0x37ecd2=_[_0xcc6a('0x7c')](_0x2f26ab[_0xcc6a('0x81')]);_0x377050({'count':_0x37ecd2[_0xcc6a('0x5b')],'rows':_0x37ecd2});});},'SendFax':function(_0x48b6e3){var _0x10d731=this;return new Promise(function(_0x537e2b,_0x5eb00a){_0x12330e[_0xcc6a('0x82')](_0x48b6e3)['then'](function(_0x207e7f){_0x537e2b({'code':0xc8,'message':_0x207e7f[_0xcc6a('0x1d')]});})['catch'](function(_0x5aef98){_0x5eb00a(_0x10d731[_0xcc6a('0x14')](0x1f4,_0x5aef98['message']));});});},'CheckAfterSend':function(_0x23f83b){var _0x3df510=this;return new Promise(function(_0x3a72f7,_0x2e7f3e){_0x12330e[_0xcc6a('0x83')](_0x23f83b)[_0xcc6a('0x1c')](function(_0x56ffcf){_0x3a72f7({'code':0xc8,'message':_0x56ffcf[_0xcc6a('0x1d')]});})[_0xcc6a('0x1e')](function(_0x38cfc3){_0x2e7f3e(_0x3df510[_0xcc6a('0x14')](0x1f4,_0x38cfc3['message']));});});}};var _0x1b869a=jayson[_0xcc6a('0x84')](_0x3dd497)[_0xcc6a('0x85')]();_0x1b869a['on'](_0xcc6a('0x14'),function(_0x383e2b){return _0x5f3887(_0x383e2b);});_0x1b869a[_0xcc6a('0x9')](0x232a,_0xcc6a('0x86'),function(){console['log'](_0xcc6a('0x87'),0x232a);return _0x197bd7(_0xcc6a('0x88')+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 3f7d516..2836fa6 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 _0x7bae=['data5','xmd-contactid','ListId','data3','map','firstName','lastName','phone','mobile','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridnum','routeId','','calleridname','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','destcalleridnum','format','user:%s','trigger:%s','action','toLowerCase','merge','ioredis','util','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','isNil'];(function(_0x344b24,_0x2b6b0d){var _0x5b66cc=function(_0x17e48){while(--_0x17e48){_0x344b24['push'](_0x344b24['shift']());}};_0x5b66cc(++_0x2b6b0d);}(_0x7bae,0x13b));var _0xe7ba=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7bae[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0xe7ba('0x0'));var util=require(_0xe7ba('0x1'));var config=require('../../../../config/environment');var logger=require(_0xe7ba('0x2'))('trigger');var cmContactRpc=require(_0xe7ba('0x3'));config[_0xe7ba('0x4')]=_[_0xe7ba('0x5')](config[_0xe7ba('0x4')],{'host':_0xe7ba('0x6'),'port':0x18eb});var io=require(_0xe7ba('0x7'))(new Redis(config[_0xe7ba('0x4')]));function emit(_0x3c5e59,_0x10b307,_0x34fb18,_0x160565,_0x27b1d5){logger[_0xe7ba('0x8')](_0xe7ba('0x9'),_0x3c5e59,_0x10b307['id'],_0x34fb18,_0x160565,JSON['stringify'](_0x27b1d5));io['to'](_0x34fb18)[_0xe7ba('0xa')](_0x160565,_0x27b1d5);}exports[_0xe7ba('0xb')]=function(_0x375ebb,_0x276bc3,_0x15083a,_0x1672f0){var _0x99a86f,_0x448bcc;var _0x194447={};var _0x4b6597=Number(_0x15083a[_0xe7ba('0xc')]);var _0x588c8b=_0x15083a[_0xe7ba('0xd')]?Boolean(Number(_0x15083a[_0xe7ba('0xd')])):![];var _0x390596;var _0x17e4e6=![];if(!_[_0xe7ba('0xe')](_0x15083a[_0xe7ba('0xf')])){if(_0x15083a['data5']=='1')_0x17e4e6=!![];}if(!_0x17e4e6){if(_0x1672f0['xmd-contactid']){_0x194447['id']=_0x1672f0[_0xe7ba('0x10')];}}if(!_0x194447['id']){_0x194447[_0xe7ba('0x11')]=_0x4b6597;_0x390596=_0x15083a[_0xe7ba('0x12')]&&_0x15083a['data3']!=='0'?_0x15083a[_0xe7ba('0x12')]['split'](','):['phone'];_0x194447['$or']=_[_0xe7ba('0x13')](_0x390596,function(_0x4e87f5){var _0x41a773={};_0x41a773[_0x4e87f5]=_0x1672f0['routeId']?_0x1672f0['destcalleridnum']:_0x1672f0['calleridnum'];return _0x41a773;});}var _0x3f326a=['id',_0xe7ba('0x14'),_0xe7ba('0x15'),_0xe7ba('0x16'),_0xe7ba('0x17'),'fax',_0xe7ba('0x11'),_0xe7ba('0x18'),_0xe7ba('0x19'),_0xe7ba('0x1a')];var _0x4aaf35=_[_0xe7ba('0x1b')](_0x3f326a,_0x390596);BPromise[_0xe7ba('0x1c')]()['then'](cmContactRpc[_0xe7ba('0x1d')]({'attributes':_0x4aaf35,'where':_0x194447}))[_0xe7ba('0x1e')](function(_0x27c882){_0x448bcc=_0x27c882;if(!_[_0xe7ba('0x1f')](_0x448bcc)){if(_0x448bcc[_0xe7ba('0x20')]===0x1){_0x99a86f=_0x448bcc[0x0];logger[_0xe7ba('0x8')](_0xe7ba('0x21'),_0x1672f0[_0xe7ba('0x22')],_0x276bc3['id'],_0x99a86f['id']);}else{logger[_0xe7ba('0x8')](_0xe7ba('0x23'),_0x1672f0['uniqueid'],_0x276bc3['id'],_['map'](_0x448bcc,'id')['join'](','));}return;}else{logger['info'](_0xe7ba('0x24'),_0x1672f0['uniqueid'],_0x276bc3['id']);var _0x4ecc0d={'ListId':_0x4b6597};var _0x5ece11=_0x15083a[_0xe7ba('0x25')]&&_0x15083a[_0xe7ba('0x25')]!=='0'?_0x15083a[_0xe7ba('0x25')]:_0xe7ba('0x16');if(_0x588c8b){logger[_0xe7ba('0x8')](_0xe7ba('0x26'),_0x1672f0[_0xe7ba('0x22')],_0x276bc3['id']);_0x4ecc0d[_0x5ece11]=_[_0xe7ba('0xe')](_0x1672f0['routeId'])?_0x1672f0[_0xe7ba('0x27')]:_0x1672f0['destcalleridnum'];if(_[_0xe7ba('0xe')](_0x1672f0[_0xe7ba('0x28')])){_0x4ecc0d[_0xe7ba('0x14')]=_0x1672f0['calleridname']&&_0x1672f0['calleridname']!==_0xe7ba('0x29')?_0x1672f0[_0xe7ba('0x2a')]:_0xe7ba('0x2b');}else{_0x4ecc0d[_0xe7ba('0x14')]=_0x1672f0[_0xe7ba('0x2c')]&&_0x1672f0['destcalleridname']!==_0xe7ba('0x29')?_0x1672f0[_0xe7ba('0x2c')]:'Unknown';}return BPromise[_0xe7ba('0x1c')]()['then'](cmContactRpc['createContact'](_0x4ecc0d))[_0xe7ba('0x1e')](function(_0x134f21){_0x99a86f=_0x134f21;_0x448bcc[_0xe7ba('0x2d')](_0x134f21);if(_0x99a86f){logger['info'](_0xe7ba('0x2e'),_0x1672f0['uniqueid'],_0x276bc3['id'],_0x99a86f['id']);}return;});}else{logger[_0xe7ba('0x8')](_0xe7ba('0x2f'),_0x1672f0[_0xe7ba('0x22')],_0x276bc3['id']);_0x4ecc0d[_0x5ece11]=_[_0xe7ba('0xe')](_0x1672f0[_0xe7ba('0x28')])?_0x1672f0['calleridnum']:_0x1672f0[_0xe7ba('0x30')];if(_[_0xe7ba('0xe')](_0x1672f0['routeId'])){_0x4ecc0d[_0xe7ba('0x14')]=_0x1672f0[_0xe7ba('0x2a')]&&_0x1672f0[_0xe7ba('0x2a')]!==''?_0x1672f0[_0xe7ba('0x2a')]:_0xe7ba('0x2b');}else{_0x4ecc0d['firstName']=_0x1672f0[_0xe7ba('0x2c')]&&_0x1672f0[_0xe7ba('0x2c')]!==_0xe7ba('0x29')?_0x1672f0['destcalleridname']:_0xe7ba('0x2b');}_0x99a86f=_0x4ecc0d;_0x448bcc[_0xe7ba('0x2d')](_0x4ecc0d);return;}}})['then'](function(){if(_0x375ebb){emit(_0x1672f0[_0xe7ba('0x22')],_0x276bc3,util[_0xe7ba('0x31')](_0xe7ba('0x32'),_0x375ebb['name']),util['format'](_0xe7ba('0x33'),_0x15083a[_0xe7ba('0x34')][_0xe7ba('0x35')]()),{'evt':_[_0xe7ba('0x36')](_0x1672f0,{'autoCreate':_0x588c8b}),'contact':_0x99a86f===undefined?{}:_0x99a86f,'contacts':_0x448bcc[_0xe7ba('0x20')]===0x0?undefined:_0x448bcc});}});}; \ No newline at end of file +var _0x54ef=['../../rpc/cmContact','redis','defaults','info','[CM][%s][%s]','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname','','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger'];(function(_0x3da3c4,_0x2b874d){var _0x36a3af=function(_0x6d3f2d){while(--_0x6d3f2d){_0x3da3c4['push'](_0x3da3c4['shift']());}};_0x36a3af(++_0x2b874d);}(_0x54ef,0x112));var _0xf54e=function(_0x325041,_0x3559ad){_0x325041=_0x325041-0x0;var _0x3fea11=_0x54ef[_0x325041];return _0x3fea11;};'use strict';var _=require(_0xf54e('0x0'));var BPromise=require(_0xf54e('0x1'));var Redis=require(_0xf54e('0x2'));var util=require('util');var config=require(_0xf54e('0x3'));var logger=require(_0xf54e('0x4'))(_0xf54e('0x5'));var cmContactRpc=require(_0xf54e('0x6'));config[_0xf54e('0x7')]=_[_0xf54e('0x8')](config[_0xf54e('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf54e('0x7')]));function emit(_0x99cf9,_0x2464ae,_0x561870,_0x27e69b,_0x57a1ce){logger[_0xf54e('0x9')](_0xf54e('0xa'),_0x99cf9,_0x2464ae['id'],_0x561870,_0x27e69b,JSON['stringify'](_0x57a1ce));io['to'](_0x561870)[_0xf54e('0xb')](_0x27e69b,_0x57a1ce);}exports[_0xf54e('0xc')]=function(_0x6b9e61,_0x3ecfb3,_0x5f232a,_0x558502){var _0xc939ab,_0x143d66;var _0x326eef={};var _0x553759=Number(_0x5f232a[_0xf54e('0xd')]);var _0x4b0ee1=_0x5f232a['data2']?Boolean(Number(_0x5f232a[_0xf54e('0xe')])):![];var _0x2033e9;var _0x28f776=![];if(!_[_0xf54e('0xf')](_0x5f232a['data5'])){if(_0x5f232a[_0xf54e('0x10')]=='1')_0x28f776=!![];}if(!_0x28f776){if(_0x558502[_0xf54e('0x11')]){_0x326eef['id']=_0x558502[_0xf54e('0x11')];}}if(!_0x326eef['id']){_0x326eef[_0xf54e('0x12')]=_0x553759;_0x2033e9=_0x5f232a['data3']&&_0x5f232a[_0xf54e('0x13')]!=='0'?_0x5f232a[_0xf54e('0x13')][_0xf54e('0x14')](','):['phone'];_0x326eef['$or']=_[_0xf54e('0x15')](_0x2033e9,function(_0x41fb35){var _0x1c02e7={};_0x1c02e7[_0x41fb35]=_0x558502[_0xf54e('0x16')]?_0x558502[_0xf54e('0x17')]:_0x558502[_0xf54e('0x18')];return _0x1c02e7;});}var _0x2e27b6=['id',_0xf54e('0x19'),_0xf54e('0x1a'),_0xf54e('0x1b'),_0xf54e('0x1c'),'fax','ListId',_0xf54e('0x1d'),'scheduledAt',_0xf54e('0x1e')];var _0x1bfe99=_[_0xf54e('0x1f')](_0x2e27b6,_0x2033e9);BPromise[_0xf54e('0x20')]()[_0xf54e('0x21')](cmContactRpc[_0xf54e('0x22')]({'attributes':_0x1bfe99,'where':_0x326eef}))[_0xf54e('0x21')](function(_0x11985e){_0x143d66=_0x11985e;if(!_[_0xf54e('0x23')](_0x143d66)){if(_0x143d66[_0xf54e('0x24')]===0x1){_0xc939ab=_0x143d66[0x0];logger[_0xf54e('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x558502[_0xf54e('0x25')],_0x3ecfb3['id'],_0xc939ab['id']);}else{logger['info'](_0xf54e('0x26'),_0x558502[_0xf54e('0x25')],_0x3ecfb3['id'],_[_0xf54e('0x15')](_0x143d66,'id')[_0xf54e('0x27')](','));}return;}else{logger[_0xf54e('0x9')](_0xf54e('0x28'),_0x558502[_0xf54e('0x25')],_0x3ecfb3['id']);var _0x43488d={'ListId':_0x553759};var _0x2342a9=_0x5f232a[_0xf54e('0x29')]&&_0x5f232a[_0xf54e('0x29')]!=='0'?_0x5f232a[_0xf54e('0x29')]:_0xf54e('0x1b');if(_0x4b0ee1){logger['info'](_0xf54e('0x2a'),_0x558502['uniqueid'],_0x3ecfb3['id']);_0x43488d[_0x2342a9]=_[_0xf54e('0xf')](_0x558502['routeId'])?_0x558502[_0xf54e('0x18')]:_0x558502[_0xf54e('0x17')];if(_[_0xf54e('0xf')](_0x558502[_0xf54e('0x16')])){_0x43488d[_0xf54e('0x19')]=_0x558502[_0xf54e('0x2b')]&&_0x558502[_0xf54e('0x2b')]!==''?_0x558502['calleridname']:_0xf54e('0x2c');}else{_0x43488d[_0xf54e('0x19')]=_0x558502[_0xf54e('0x2d')]&&_0x558502[_0xf54e('0x2d')]!==_0xf54e('0x2e')?_0x558502[_0xf54e('0x2d')]:_0xf54e('0x2c');}return BPromise[_0xf54e('0x20')]()[_0xf54e('0x21')](cmContactRpc[_0xf54e('0x2f')](_0x43488d))['then'](function(_0x5f29d3){_0xc939ab=_0x5f29d3;_0x143d66[_0xf54e('0x30')](_0x5f29d3);if(_0xc939ab){logger[_0xf54e('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x558502[_0xf54e('0x25')],_0x3ecfb3['id'],_0xc939ab['id']);}return;});}else{logger[_0xf54e('0x9')](_0xf54e('0x31'),_0x558502[_0xf54e('0x25')],_0x3ecfb3['id']);_0x43488d[_0x2342a9]=_['isNil'](_0x558502['routeId'])?_0x558502['calleridnum']:_0x558502[_0xf54e('0x17')];if(_[_0xf54e('0xf')](_0x558502[_0xf54e('0x16')])){_0x43488d[_0xf54e('0x19')]=_0x558502[_0xf54e('0x2b')]&&_0x558502[_0xf54e('0x2b')]!==''?_0x558502['calleridname']:'Unknown';}else{_0x43488d[_0xf54e('0x19')]=_0x558502[_0xf54e('0x2d')]&&_0x558502['destcalleridname']!==''?_0x558502[_0xf54e('0x2d')]:_0xf54e('0x2c');}_0xc939ab=_0x43488d;_0x143d66[_0xf54e('0x30')](_0x43488d);return;}}})['then'](function(){if(_0x6b9e61){emit(_0x558502[_0xf54e('0x25')],_0x3ecfb3,util[_0xf54e('0x32')]('user:%s',_0x6b9e61[_0xf54e('0x33')]),util[_0xf54e('0x32')](_0xf54e('0x34'),_0x5f232a[_0xf54e('0x35')][_0xf54e('0x36')]()),{'evt':_[_0xf54e('0x37')](_0x558502,{'autoCreate':_0x4b0ee1}),'contact':_0xc939ab===undefined?{}:_0xc939ab,'contacts':_0x143d66['length']===0x0?undefined:_0x143d66});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index da44afb..4da0552 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 _0x9a18=['account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','equals','exports','util','url','mustache','ioredis','./urlforward','./integration','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','popup','winapp','triggers','agents','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','syncCustomEvent','custom:agentconnect','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','clone','motionChannel','undefined','checkTriggers','interface','hasOwnProperty','status','merge','variables','Actions','contactmanager','motionbar','browser','data1','data2','html','templates','render','template\x20not\x20found','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','600','data6','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','action','toLowerCase','exec','queue','routeId','urlforward','parse','query','search','checkTrigger','AllConditions','checkConditions','channel','AnyConditions','length','some'];(function(_0x378a48,_0x5b012f){var _0x1538c5=function(_0x372bcc){while(--_0x372bcc){_0x378a48['push'](_0x378a48['shift']());}};_0x1538c5(++_0x5b012f);}(_0x9a18,0x187));var _0x89a1=function(_0x32d58b,_0x3a8916){_0x32d58b=_0x32d58b-0x0;var _0x4d9dbc=_0x9a18[_0x32d58b];return _0x4d9dbc;};'use strict';var util=require(_0x89a1('0x0'));var _=require('lodash');var url=require(_0x89a1('0x1'));var Mustache=require(_0x89a1('0x2'));var Redis=require(_0x89a1('0x3'));var urlforward=require(_0x89a1('0x4'));var integration=require(_0x89a1('0x5'));var cmContact=require('./cmContact');var script=require(_0x89a1('0x6'));var config=require(_0x89a1('0x7'));var logger=require(_0x89a1('0x8'))(_0x89a1('0x9'));var ami=require(_0x89a1('0xa'));config[_0x89a1('0xb')]=_[_0x89a1('0xc')](config[_0x89a1('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x89a1('0xb')]));var operators={'equals':function(_0x4993c1,_0x751fb3){return _0x4993c1==_0x751fb3;},'not_equals':function(_0x541951,_0x3c7e38){return _0x541951!=_0x3c7e38;}};var barAndWebActions=[_0x89a1('0xd'),_0x89a1('0x1'),_0x89a1('0xe')];function Trigger(_0x25fef3){this[_0x89a1('0xf')]=_0x25fef3[_0x89a1('0xf')];this[_0x89a1('0x10')]=_0x25fef3[_0x89a1('0x10')];this[_0x89a1('0x11')]=_0x25fef3[_0x89a1('0x11')];this['templates']=_0x25fef3['templates'];this[_0x89a1('0x12')]=_0x25fef3[_0x89a1('0x12')];this[_0x89a1('0x13')]=_0x25fef3[_0x89a1('0x13')];this['freshdeskAccounts']=_0x25fef3[_0x89a1('0x14')];this[_0x89a1('0x15')]=_0x25fef3['salesforceAccounts'];this[_0x89a1('0x16')]=_0x25fef3[_0x89a1('0x16')];this[_0x89a1('0x17')]=_0x25fef3[_0x89a1('0x17')];this[_0x89a1('0x18')]=_0x25fef3[_0x89a1('0x18')];this[_0x89a1('0x19')]=_0x25fef3[_0x89a1('0x19')];this['servicenowAccounts']=_0x25fef3[_0x89a1('0x1a')];this[_0x89a1('0x1b')]=_0x25fef3[_0x89a1('0x1b')];this[_0x89a1('0x1c')]=_0x25fef3[_0x89a1('0x1c')];this['accounts']={'zendesk':this[_0x89a1('0x13')],'salesforce':this[_0x89a1('0x15')],'freshdesk':this[_0x89a1('0x14')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x89a1('0x17')],'desk':this[_0x89a1('0x18')],'vtiger':this[_0x89a1('0x19')],'dynamics365':this[_0x89a1('0x1b')],'freshsales':this[_0x89a1('0x1c')],'servicenow':this[_0x89a1('0x1a')]};ami['on']('custom:agentcalled',this[_0x89a1('0x1d')]['bind'](this));ami['on'](_0x89a1('0x1e'),this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on']('custom:agentringnoanswer',this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on'](_0x89a1('0x20'),this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on'](_0x89a1('0x21'),this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on'](_0x89a1('0x22'),this['syncCustomEvent']['bind'](this));ami['on'](_0x89a1('0x23'),this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on'](_0x89a1('0x24'),this[_0x89a1('0x1d')]['bind'](this));ami['on'](_0x89a1('0x25'),this['syncCustomEvent']['bind'](this));ami['on'](_0x89a1('0x26'),this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on'](_0x89a1('0x27'),this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on'](_0x89a1('0x28'),this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on']('custom:dialbegin',this[_0x89a1('0x29')][_0x89a1('0x1f')](this));ami['on'](_0x89a1('0x2a'),this[_0x89a1('0x29')][_0x89a1('0x1f')](this));ami['on'](_0x89a1('0x2b'),this[_0x89a1('0x29')]['bind'](this));ami['on'](_0x89a1('0x2c'),this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on']('custom:closedinteraction',this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on'](_0x89a1('0x2d'),this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on'](_0x89a1('0x2e'),this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on'](_0x89a1('0x2f'),this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on'](_0x89a1('0x30'),this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on'](_0x89a1('0x31'),this[_0x89a1('0x1d')][_0x89a1('0x1f')](this));ami['on'](_0x89a1('0x32'),this['syncCustomEvent'][_0x89a1('0x1f')](this));}Trigger[_0x89a1('0x33')][_0x89a1('0x34')]=function(_0x2b86dd,_0xb270d1,_0x2cf63f){logger['info'](_0x2b86dd,_0xb270d1,JSON[_0x89a1('0x35')](_0x2cf63f));io['to'](_0x2b86dd)[_0x89a1('0x34')](_0xb270d1,_0x2cf63f);};Trigger['prototype'][_0x89a1('0x1d')]=function(_0x52e779){var _0x435d95=_[_0x89a1('0x36')](_0x52e779);if(typeof _0x435d95[_0x89a1('0x37')]===_0x89a1('0x38')){_0x435d95[_0x89a1('0x37')]='voice';}this[_0x89a1('0x39')](_0x435d95);};Trigger[_0x89a1('0x33')][_0x89a1('0x29')]=function(_0x51118f){if(this[_0x89a1('0x10')][_0x51118f[_0x89a1('0x3a')]]){this[_0x89a1('0x1d')](_0x51118f);}};Trigger[_0x89a1('0x33')][_0x89a1('0x39')]=function(_0x315b40){var _0x270fe6;for(var _0x361c1b in this['triggers']){if(this['triggers'][_0x89a1('0x3b')](_0x361c1b)){if(this[_0x89a1('0xf')][_0x361c1b][_0x89a1('0x3c')]){_0x270fe6=this['checkTrigger'](this[_0x89a1('0xf')][_0x361c1b],_0x315b40);if(_0x270fe6){_[_0x89a1('0x3d')](_0x315b40,_0x315b40[_0x89a1('0x3e')]);for(var _0x357dee=0x0,_0x4c2247,_0x21b3d4,_0x702874;_0x357dee0x0){_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 +var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x3415fd,_0xc68e5e){var _0x13e4ab=function(_0x418d49){while(--_0x418d49){_0x3415fd['push'](_0x3415fd['shift']());}};_0x13e4ab(++_0xc68e5e);}(_0x55ca,0x126));var _0xa55c=function(_0x430469,_0x20e783){_0x430469=_0x430469-0x0;var _0x1ca55e=_0x55ca[_0x430469];return _0x1ca55e;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 67ef8dc..020071e 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 _0x10a4=['toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','value','validateEmail','userEmail','email','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','internalemailaddress','username','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','lastIndexOf','replace','%2b','enduserId','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','picklist','type','nameField','idField','toLowerCase','substring','indexOf','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','ticketType','queue','callDirection','phonecalls','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\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',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','request-promise','util','./util','md5','ioredis','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','password','clientSecret','then','access_token','catch','error'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x10a4,0x1d3));var _0x410a=function(_0x4d6991,_0x522735){_0x4d6991=_0x4d6991-0x0;var _0x3d3512=_0x10a4[_0x4d6991];return _0x3d3512;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var rp=require(_0x410a('0x0'));var util=require(_0x410a('0x1'));var intUtil=require(_0x410a('0x2'));var md5=require(_0x410a('0x3'));var Redis=require(_0x410a('0x4'));var logger=require('../../../../config/logger')('dynamics365');var config=require('../../../../config/environment');config[_0x410a('0x5')]=_[_0x410a('0x6')](config['redis'],{'host':_0x410a('0x7'),'port':0x18eb});var io=require(_0x410a('0x8'))(new Redis(config[_0x410a('0x5')]));function getAuthToken(_0x6d689f,_0xed6268,_0x39744f){var _0x2d5fbb={'method':_0x410a('0x9'),'uri':_0xed6268,'form':{'client_id':_0x6d689f[_0x410a('0xa')],'resource':_0x6d689f[_0x410a('0xb')],'username':_0x6d689f['username'],'password':_0x6d689f[_0x410a('0xc')],'grant_type':_0x410a('0xc'),'client_secret':_0x6d689f[_0x410a('0xd')]},'json':!![]};return rp(_0x2d5fbb)[_0x410a('0xe')](function(_0x19c11e){return _0x19c11e[_0x410a('0xf')];})[_0x410a('0x10')](function(_0x35b542){logger[_0x410a('0x11')]('['+[_0x39744f[_0x410a('0x12')]()]+_0x410a('0x13'));return _0x35b542[_0x410a('0x14')];});}function getUser(_0x30193e,_0x5ee75b,_0x45df9b,_0x2d2f65,_0x1972ab,_0x289c53){return new BPromise(function(_0x50f5ca,_0xc65fab){return getAuthToken(_0x5ee75b,_0x2d2f65,_0x289c53)[_0x410a('0xe')](function(_0x2b0a36){var _0x4716dd={'method':_0x410a('0x15'),'uri':_0x1972ab+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x410a('0x16')+_0x2b0a36,'OData-Version':_0x410a('0x17')},'json':!![]};return rp(_0x4716dd);})['then'](function(_0x2097ee){var _0x38fb6c=_0x2097ee[_0x410a('0x18')];var _0x54ac8e=![];var _0xe59e57=null;if(!_['isNil'](_0x45df9b)){if(intUtil[_0x410a('0x19')](_0x45df9b['email'])){_0x30193e[_0x410a('0x1a')]=_0x45df9b[_0x410a('0x1b')];for(_0xe59e57=0x0;_0xe59e57<_0x38fb6c[_0x410a('0x1c')];_0xe59e57++){if(_0x38fb6c[_0xe59e57]['internalemailaddress']===_0x45df9b['email']&&!_0x38fb6c[_0xe59e57][_0x410a('0x1d')]){_0x54ac8e=!![];logger[_0x410a('0x1e')]('['+[_0x289c53['toUpperCase']()]+_0x410a('0x1f')+_0x38fb6c[_0xe59e57][_0x410a('0x20')]+'!');_0x30193e[_0x410a('0x21')]=_0x38fb6c[_0xe59e57][_0x410a('0x20')];}}}}if(!_0x54ac8e){logger['info']('['+[_0x289c53[_0x410a('0x12')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x30193e[_0x410a('0x1a')]=_0x5ee75b['username'];for(_0xe59e57=0x0;_0xe59e57<_0x38fb6c[_0x410a('0x1c')];_0xe59e57++){if(_0x38fb6c[_0xe59e57][_0x410a('0x22')]===_0x5ee75b[_0x410a('0x23')]){_0x30193e[_0x410a('0x21')]=_0x38fb6c[_0xe59e57][_0x410a('0x20')];}}}_0x50f5ca(_0x30193e);})[_0x410a('0x10')](function(_0x36bcd0){_0xc65fab(_0x36bcd0[_0x410a('0x14')]);});});}function createEndUser(_0x385a9e,_0x4982e7,_0x139b47,_0x21a8fb,_0x4425f4,_0x2545bd){return new BPromise(function(_0x438217,_0x58d7d8){return getAuthToken(_0x4982e7,_0x139b47,_0x2545bd)[_0x410a('0xe')](function(_0x253479){var _0x262d41=_0x2545bd['toLowerCase']()===_0x410a('0x24')?_0x4425f4[_0x410a('0x25')]:_0x4425f4[_0x410a('0x26')];var _0x534e85={'method':_0x410a('0x9'),'uri':_0x21a8fb+_0x410a('0x27'),'body':{'telephone1':_0x262d41,'fullname':_0x262d41,'firstname':_0x262d41,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x410a('0x28')+_0x385a9e[_0x410a('0x21')]+')'},'headers':{'Authorization':_0x410a('0x16')+_0x253479,'OData-Version':_0x410a('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x534e85);})[_0x410a('0xe')](function(_0x449bbe){var _0x1ee8ed=_0x449bbe[_0x410a('0x29')][_0x410a('0x2a')];var _0x215d8e=_0x1ee8ed['substring'](_0x1ee8ed[_0x410a('0x2b')]('(')+0x1,_0x1ee8ed[_0x410a('0x2b')](')'));_0x385a9e['enduserId']=_0x215d8e;_0x438217(_0x385a9e);})[_0x410a('0x10')](function(_0x5320fc){_0x58d7d8(_0x5320fc['message']);});});}function getEndUser(_0x492a9c,_0x868770,_0x577ef1,_0x4a68fb,_0x275d45,_0x2e7045,_0x3d014e){var _0x243fe8=_0x2e7045['toLowerCase']()==='outbound'?_0x275d45[_0x410a('0x25')]:_0x275d45[_0x410a('0x26')];return getAuthToken(_0x868770,_0x577ef1,_0x2e7045)[_0x410a('0xe')](function(_0x5abeb7){var _0x3c3a5d={'method':_0x410a('0x15'),'uri':_0x4a68fb+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x243fe8[_0x410a('0x2c')]('+',_0x410a('0x2d'))+'\x27','headers':{'Authorization':_0x410a('0x16')+_0x5abeb7,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3c3a5d);})[_0x410a('0xe')](function(_0x50af77){var _0x139f57=![];if(!_0x50af77)return _0x139f57;var _0x2b4bf0=_0x50af77[_0x410a('0x18')];for(var _0x25a44c=0x0;_0x25a44c<_0x2b4bf0['length'];_0x25a44c++){if(_0x2b4bf0[_0x25a44c]['telephone1']===_0x243fe8){_0x139f57=!![];_0x492a9c[_0x410a('0x2e')]=_0x2b4bf0[_0x25a44c][_0x410a('0x2f')];}}return _0x139f57;})[_0x410a('0xe')](function(_0x5b20a3){if(_0x5b20a3)return _0x492a9c;if(_0x3d014e==='nothing'){logger[_0x410a('0x1e')]('['+[_0x2e7045[_0x410a('0x12')]()]+_0x410a('0x30'));return _0x492a9c;}return createEndUser(_0x492a9c,_0x868770,_0x577ef1,_0x4a68fb,_0x275d45,_0x2e7045)['then'](function(_0xb69c3){logger[_0x410a('0x1e')]('['+[_0x2e7045[_0x410a('0x12')]()]+_0x410a('0x31'),_0xb69c3[_0x410a('0x2e')]);return _0xb69c3;});});}function getCustomFields(_0x14b274,_0x26dc08,_0x68f2ea){var _0x2591b4={};if(_0x14b274[_0x410a('0x1c')]>0x0){_[_0x410a('0x32')](_0x14b274,function(_0x31f2bb){if(_['includes']([_0x410a('0x33'),_0x410a('0x34')],_0x31f2bb[_0x410a('0x35')])&&_0x31f2bb[_0x410a('0x36')]&&!_0x31f2bb['customField']){var _0x30b117=_0x31f2bb[_0x410a('0x37')][_0x410a('0x38')]();var _0x45abf1=_0x30b117[_0x410a('0x39')](0x0,_0x30b117[_0x410a('0x3a')]('_'));var _0x3ff652=_0x30b117[_0x410a('0x39')](_0x30b117[_0x410a('0x3a')]('_')+0x1);if(_0x45abf1===_0x68f2ea){_0x2591b4[_0x3ff652]=_0x31f2bb['content'];}}});}return _0x2591b4;}function getTicket(_0xc99a31,_0x41c6d4,_0x362800,_0x484892,_0x57617d,_0xd015f,_0x448346){return new BPromise(function(_0x30565f,_0x395b8f){var _0x4afc7e;return getAuthToken(_0x41c6d4,_0x362800,_0x448346)['then'](function(_0x23f2dc){if(_0xd015f['ticketType']===_0x410a('0x3b')){_0x4afc7e={'method':_0x410a('0x9'),'uri':_0x484892+_0x410a('0x3c'),'body':Object[_0x410a('0x3d')]({},{'title':intUtil[_0x410a('0x3e')](_0xd015f[_0x410a('0x3f')],_0x57617d,'\x20'),'description':intUtil[_0x410a('0x3e')](_0xd015f[_0x410a('0x40')],_0x57617d,'\x0a'),'customerid_contact@odata.bind':_0xc99a31[_0x410a('0x2e')]?_0x410a('0x41')+_0xc99a31[_0x410a('0x2e')]+')':undefined,'ownerid@odata.bind':_0x410a('0x28')+_0xc99a31[_0x410a('0x21')]+')','caseorigincode':'1'},getCustomFields(_0xd015f['Fields'],_0x57617d,_0xd015f[_0x410a('0x42')])),'headers':{'Authorization':'Bearer\x20'+_0x23f2dc,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0xd015f[_0x410a('0x42')]==='phonecall'){var _0x461572=_0xc99a31[_0x410a('0x2e')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0xc99a31[_0x410a('0x21')]+')','participationtypemask':_0xc99a31['callDirection']===_0x410a('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0x410a('0x41')+_0xc99a31[_0x410a('0x2e')]+')','participationtypemask':_0xc99a31[_0x410a('0x44')]===_0x410a('0x43')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0xc99a31[_0x410a('0x21')]+')','participationtypemask':_0xc99a31[_0x410a('0x44')]===_0x410a('0x43')?0x2:0x1}];_0x4afc7e={'method':_0x410a('0x9'),'uri':_0x484892+_0x410a('0x45'),'body':Object['assign']({},{'subject':intUtil[_0x410a('0x3e')](_0xd015f[_0x410a('0x3f')],_0x57617d,'\x20'),'phonenumber':String(_0x57617d[_0x410a('0x26')]),'description':intUtil['getString'](_0xd015f[_0x410a('0x40')],_0x57617d,'\x0a'),'regardingobjectid_contact@odata.bind':_0xc99a31[_0x410a('0x2e')]?_0x410a('0x41')+_0xc99a31[_0x410a('0x2e')]+')':undefined,'ownerid@odata.bind':_0x410a('0x28')+_0xc99a31[_0x410a('0x21')]+')','directioncode':_0xc99a31[_0x410a('0x44')]===_0x410a('0x43')?![]:!![],'phonecall_activity_parties':_0x461572},getCustomFields(_0xd015f[_0x410a('0x46')],_0x57617d,_0xd015f[_0x410a('0x42')])),'headers':{'Authorization':'Bearer\x20'+_0x23f2dc,'OData-Version':_0x410a('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4afc7e);})['then'](function(_0x273f30){var _0x18866d=_0x273f30[_0x410a('0x29')][_0x410a('0x2a')];var _0x5a301b=_0x18866d[_0x410a('0x39')](_0x18866d[_0x410a('0x2b')]('(')+0x1,_0x18866d[_0x410a('0x2b')](')'));_0xc99a31[_0x410a('0x47')]=_0x5a301b;_0x30565f(_0xc99a31);})[_0x410a('0x10')](function(_0x2c0bf6){_0x395b8f(_0x2c0bf6['message']);});});}function emit(_0x2fd55d,_0x556aac,_0xbce85f,_0x5d620f){var _0xa110a6={'uri':util[_0x410a('0x48')](_0x410a('0x49'),_0x2fd55d,_0xbce85f,_0x5d620f)};io['to'](util[_0x410a('0x48')](_0x410a('0x4a'),_0x556aac))[_0x410a('0x4b')](_0x410a('0x4c'),_0xa110a6);}exports['cs']=function(_0x2be950,_0x3eb5c1,_0x4edffc,_0x471f52,_0x6ff4c1,_0x172a5b,_0x3da9c4,_0x319f4d){var _0x3ecde3={};_0x172a5b['remoteUri']=intUtil[_0x410a('0x4d')](_0x172a5b[_0x410a('0xb')]);_0x172a5b['serverUrl']=intUtil['stripTrailingSlash'](_0x172a5b['serverUrl']);_0x3ecde3[_0x410a('0x44')]=_0x319f4d==='queue'||_0x319f4d===_0x410a('0x4e')?_0x410a('0x43'):_0x410a('0x24');var _0x79ae1b=util[_0x410a('0x48')](_0x410a('0x4f'),_0x172a5b['remoteUri']);var _0x4280a1=util[_0x410a('0x48')]('https://login.microsoftonline.com/%s/oauth2/token',_0x172a5b['tenantId']);var _0x42b261=util['format'](_0x410a('0x50'),_0x172a5b[_0x410a('0x51')],_0x3eb5c1[_0x410a('0x52')],md5(_0x3eb5c1[_0x410a('0x52')]));if(_0x6ff4c1&&_0x6ff4c1[_0x410a('0x53')]){logger[_0x410a('0x1e')]('[QUEUE]',_0x410a('0x54'));_0x3eb5c1[_0x410a('0x55')]=_0x42b261;}else if(_0x3da9c4&&_0x3da9c4[_0x410a('0x56')]&&_0x3da9c4[_0x410a('0x56')]!==_0x410a('0x57')){logger[_0x410a('0x1e')](_0x410a('0x58'),_0x410a('0x54'));_0x3eb5c1[_0x410a('0x55')]=_0x42b261;}else{_0x3eb5c1['recordingURL']='';}return getUser(_0x3ecde3,_0x172a5b,_0x471f52,_0x4280a1,_0x79ae1b,_0x319f4d)['then'](function(_0x28f790){logger[_0x410a('0x1e')]('['+_0x319f4d[_0x410a('0x12')]()+_0x410a('0x59'),_0x28f790['userId']);logger[_0x410a('0x1e')]('['+_0x319f4d['toUpperCase']()+_0x410a('0x5a'),_0x28f790[_0x410a('0x1a')]);return getEndUser(_0x28f790,_0x172a5b,_0x4280a1,_0x79ae1b,_0x3eb5c1,_0x319f4d,_0x4edffc['moduleCreate']);})[_0x410a('0xe')](function(_0x253928){logger['info']('['+_0x319f4d[_0x410a('0x12')]()+_0x410a('0x5b'),_0x253928['enduserId']);logger[_0x410a('0x1e')]('['+_0x319f4d[_0x410a('0x12')]()+_0x410a('0x5c'),_0x3eb5c1[_0x410a('0x26')]);return getTicket(_0x253928,_0x172a5b,_0x4280a1,_0x79ae1b,_0x3eb5c1,_0x4edffc,_0x319f4d);})[_0x410a('0xe')](function(_0x1ef7f8){logger[_0x410a('0x1e')](util[_0x410a('0x48')]('['+_0x319f4d[_0x410a('0x12')]()+_0x410a('0x5d'),_0x4edffc['ticketType'],_0x1ef7f8[_0x410a('0x47')]));logger[_0x410a('0x1e')](util[_0x410a('0x48')]('['+_0x319f4d[_0x410a('0x12')]()+_0x410a('0x5e'),_0x319f4d));if(_0x319f4d!==_0x410a('0x4e')){logger[_0x410a('0x1e')]('['+_0x319f4d[_0x410a('0x12')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x172a5b['remoteUri'],_0x471f52['name'],_0x4edffc[_0x410a('0x42')],_0x1ef7f8[_0x410a('0x47')]);}})[_0x410a('0x10')](function(_0x57bc92){logger[_0x410a('0x11')]('['+_0x319f4d[_0x410a('0x12')]()+_0x410a('0x5f'),util[_0x410a('0x60')](_0x57bc92,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x61bb=['picklist','type','nameField','customField','substring','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','userId','queue','callDirection','phonecalls','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','then','access_token','catch',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','internalemailaddress','toLowerCase','destcalleridnum','calleridnum','/systemusers(','headers','odata-entityid','lastIndexOf','enduserId','outbound','replace','%2b','telephone1','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','string'];(function(_0x45f870,_0xf9f9fc){var _0x303cf0=function(_0x5e86d6){while(--_0x5e86d6){_0x45f870['push'](_0x45f870['shift']());}};_0x303cf0(++_0xf9f9fc);}(_0x61bb,0xa1));var _0xb61b=function(_0x41a96a,_0x2cc2a4){_0x41a96a=_0x41a96a-0x0;var _0x37f93b=_0x61bb[_0x41a96a];return _0x37f93b;};'use strict';var _=require('lodash');var BPromise=require(_0xb61b('0x0'));var rp=require(_0xb61b('0x1'));var util=require(_0xb61b('0x2'));var intUtil=require(_0xb61b('0x3'));var md5=require(_0xb61b('0x4'));var Redis=require(_0xb61b('0x5'));var logger=require(_0xb61b('0x6'))(_0xb61b('0x7'));var config=require(_0xb61b('0x8'));config[_0xb61b('0x9')]=_[_0xb61b('0xa')](config[_0xb61b('0x9')],{'host':_0xb61b('0xb'),'port':0x18eb});var io=require(_0xb61b('0xc'))(new Redis(config[_0xb61b('0x9')]));function getAuthToken(_0x4e5f16,_0x5a3c8b,_0x5a7d57){var _0x2c9a05={'method':_0xb61b('0xd'),'uri':_0x5a3c8b,'form':{'client_id':_0x4e5f16[_0xb61b('0xe')],'resource':_0x4e5f16[_0xb61b('0xf')],'username':_0x4e5f16[_0xb61b('0x10')],'password':_0x4e5f16[_0xb61b('0x11')],'grant_type':_0xb61b('0x11'),'client_secret':_0x4e5f16['clientSecret']},'json':!![]};return rp(_0x2c9a05)[_0xb61b('0x12')](function(_0x14b177){return _0x14b177[_0xb61b('0x13')];})[_0xb61b('0x14')](function(_0x56f6c8){logger['error']('['+[_0x5a7d57['toUpperCase']()]+_0xb61b('0x15'));return _0x56f6c8[_0xb61b('0x16')];});}function getUser(_0x4617d3,_0x374e2e,_0x544123,_0x2545c7,_0x4bf60b,_0x379f02){return new BPromise(function(_0x51ecd0,_0x40cd12){return getAuthToken(_0x374e2e,_0x2545c7,_0x379f02)['then'](function(_0x567bbc){var _0x270497={'method':_0xb61b('0x17'),'uri':_0x4bf60b+_0xb61b('0x18'),'headers':{'Authorization':_0xb61b('0x19')+_0x567bbc,'OData-Version':_0xb61b('0x1a')},'json':!![]};return rp(_0x270497);})[_0xb61b('0x12')](function(_0x1e53c6){var _0x48ea41=_0x1e53c6[_0xb61b('0x1b')];var _0x41c081=![];var _0x3c2be3=null;if(!_[_0xb61b('0x1c')](_0x544123)){if(intUtil[_0xb61b('0x1d')](_0x544123[_0xb61b('0x1e')])){_0x4617d3[_0xb61b('0x1f')]=_0x544123[_0xb61b('0x1e')];for(_0x3c2be3=0x0;_0x3c2be3<_0x48ea41[_0xb61b('0x20')];_0x3c2be3++){if(_0x48ea41[_0x3c2be3]['internalemailaddress']===_0x544123[_0xb61b('0x1e')]&&!_0x48ea41[_0x3c2be3]['isdisabled']){_0x41c081=!![];logger[_0xb61b('0x21')]('['+[_0x379f02[_0xb61b('0x22')]()]+_0xb61b('0x23')+_0x48ea41[_0x3c2be3][_0xb61b('0x24')]+'!');_0x4617d3['userId']=_0x48ea41[_0x3c2be3][_0xb61b('0x24')];}}}}if(!_0x41c081){logger['info']('['+[_0x379f02['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4617d3[_0xb61b('0x1f')]=_0x374e2e[_0xb61b('0x10')];for(_0x3c2be3=0x0;_0x3c2be3<_0x48ea41[_0xb61b('0x20')];_0x3c2be3++){if(_0x48ea41[_0x3c2be3][_0xb61b('0x25')]===_0x374e2e['username']){_0x4617d3['userId']=_0x48ea41[_0x3c2be3]['systemuserid'];}}}_0x51ecd0(_0x4617d3);})[_0xb61b('0x14')](function(_0x3c2429){_0x40cd12(_0x3c2429['message']);});});}function createEndUser(_0x5ca62e,_0xd3055,_0x1d3309,_0x4db739,_0x2ec74b,_0x564954){return new BPromise(function(_0x4de95b,_0x40fd8c){return getAuthToken(_0xd3055,_0x1d3309,_0x564954)[_0xb61b('0x12')](function(_0x591ec1){var _0x40137b=_0x564954[_0xb61b('0x26')]()==='outbound'?_0x2ec74b[_0xb61b('0x27')]:_0x2ec74b[_0xb61b('0x28')];var _0x1c4d4d={'method':_0xb61b('0xd'),'uri':_0x4db739+'contacts','body':{'telephone1':_0x40137b,'fullname':_0x40137b,'firstname':_0x40137b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xb61b('0x29')+_0x5ca62e['userId']+')'},'headers':{'Authorization':_0xb61b('0x19')+_0x591ec1,'OData-Version':_0xb61b('0x1a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x1c4d4d);})[_0xb61b('0x12')](function(_0x31705a){var _0x40f1aa=_0x31705a[_0xb61b('0x2a')][_0xb61b('0x2b')];var _0x169dce=_0x40f1aa['substring'](_0x40f1aa['lastIndexOf']('(')+0x1,_0x40f1aa[_0xb61b('0x2c')](')'));_0x5ca62e[_0xb61b('0x2d')]=_0x169dce;_0x4de95b(_0x5ca62e);})[_0xb61b('0x14')](function(_0xe00564){_0x40fd8c(_0xe00564[_0xb61b('0x16')]);});});}function getEndUser(_0x548f1e,_0x452a07,_0x3b4294,_0x14731d,_0xa269f6,_0x13b38a,_0x2d610f){var _0xa9a350=_0x13b38a[_0xb61b('0x26')]()===_0xb61b('0x2e')?_0xa269f6[_0xb61b('0x27')]:_0xa269f6[_0xb61b('0x28')];return getAuthToken(_0x452a07,_0x3b4294,_0x13b38a)[_0xb61b('0x12')](function(_0xa84de0){var _0x2186ad={'method':_0xb61b('0x17'),'uri':_0x14731d+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0xa9a350[_0xb61b('0x2f')]('+',_0xb61b('0x30'))+'\x27','headers':{'Authorization':_0xb61b('0x19')+_0xa84de0,'If-None-Match':null,'OData-Version':_0xb61b('0x1a')},'json':!![]};return rp(_0x2186ad);})[_0xb61b('0x12')](function(_0x214829){var _0x2c9ec1=![];if(!_0x214829)return _0x2c9ec1;var _0x904f9d=_0x214829[_0xb61b('0x1b')];for(var _0x2e4a2c=0x0;_0x2e4a2c<_0x904f9d[_0xb61b('0x20')];_0x2e4a2c++){if(_0x904f9d[_0x2e4a2c][_0xb61b('0x31')]===_0xa9a350){_0x2c9ec1=!![];_0x548f1e['enduserId']=_0x904f9d[_0x2e4a2c][_0xb61b('0x32')];}}return _0x2c9ec1;})[_0xb61b('0x12')](function(_0x430145){if(_0x430145)return _0x548f1e;if(_0x2d610f==='nothing'){logger[_0xb61b('0x21')]('['+[_0x13b38a[_0xb61b('0x22')]()]+_0xb61b('0x33'));return _0x548f1e;}return createEndUser(_0x548f1e,_0x452a07,_0x3b4294,_0x14731d,_0xa269f6,_0x13b38a)[_0xb61b('0x12')](function(_0x29e444){logger[_0xb61b('0x21')]('['+[_0x13b38a['toUpperCase']()]+_0xb61b('0x34'),_0x29e444['enduserId']);return _0x29e444;});});}function getCustomFields(_0x3b6fa6,_0x5af38f,_0x2ac7cd){var _0x9b8948={};if(_0x3b6fa6['length']>0x0){_['forEach'](_0x3b6fa6,function(_0x4307bd){if(_[_0xb61b('0x35')]([_0xb61b('0x36'),_0xb61b('0x37')],_0x4307bd[_0xb61b('0x38')])&&_0x4307bd[_0xb61b('0x39')]&&!_0x4307bd[_0xb61b('0x3a')]){var _0xef081b=_0x4307bd['idField']['toLowerCase']();var _0x3ca7b7=_0xef081b[_0xb61b('0x3b')](0x0,_0xef081b[_0xb61b('0x3c')]('_'));var _0x2d0a65=_0xef081b[_0xb61b('0x3b')](_0xef081b[_0xb61b('0x3c')]('_')+0x1);if(_0x3ca7b7===_0x2ac7cd){_0x9b8948[_0x2d0a65]=_0x4307bd[_0xb61b('0x3d')];}}});}return _0x9b8948;}function getTicket(_0xe92791,_0x2b47f9,_0x39ec3b,_0x39a6d7,_0x513912,_0x2c87c9,_0x4b0256){return new BPromise(function(_0x464373,_0x84c51c){var _0x13549b;return getAuthToken(_0x2b47f9,_0x39ec3b,_0x4b0256)['then'](function(_0x39f5c2){if(_0x2c87c9[_0xb61b('0x3e')]===_0xb61b('0x3f')){_0x13549b={'method':'POST','uri':_0x39a6d7+_0xb61b('0x40'),'body':Object[_0xb61b('0x41')]({},{'title':intUtil[_0xb61b('0x42')](_0x2c87c9[_0xb61b('0x43')],_0x513912,'\x20'),'description':intUtil['getString'](_0x2c87c9[_0xb61b('0x44')],_0x513912,'\x0a'),'customerid_contact@odata.bind':_0xe92791[_0xb61b('0x2d')]?_0xb61b('0x45')+_0xe92791[_0xb61b('0x2d')]+')':undefined,'ownerid@odata.bind':_0xb61b('0x29')+_0xe92791['userId']+')','caseorigincode':'1'},getCustomFields(_0x2c87c9[_0xb61b('0x46')],_0x513912,_0x2c87c9[_0xb61b('0x3e')])),'headers':{'Authorization':_0xb61b('0x19')+_0x39f5c2,'OData-Version':_0xb61b('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2c87c9[_0xb61b('0x3e')]===_0xb61b('0x47')){var _0x2d9b4d=_0xe92791[_0xb61b('0x2d')]?[{'partyid_systemuser@odata.bind':_0xb61b('0x29')+_0xe92791[_0xb61b('0x48')]+')','participationtypemask':_0xe92791['callDirection']===_0xb61b('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0xb61b('0x45')+_0xe92791[_0xb61b('0x2d')]+')','participationtypemask':_0xe92791['callDirection']===_0xb61b('0x49')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xb61b('0x29')+_0xe92791[_0xb61b('0x48')]+')','participationtypemask':_0xe92791[_0xb61b('0x4a')]==='queue'?0x2:0x1}];_0x13549b={'method':'POST','uri':_0x39a6d7+_0xb61b('0x4b'),'body':Object[_0xb61b('0x41')]({},{'subject':intUtil['getString'](_0x2c87c9[_0xb61b('0x43')],_0x513912,'\x20'),'phonenumber':String(_0x513912['calleridnum']),'description':intUtil[_0xb61b('0x42')](_0x2c87c9[_0xb61b('0x44')],_0x513912,'\x0a'),'regardingobjectid_contact@odata.bind':_0xe92791[_0xb61b('0x2d')]?'/contacts('+_0xe92791[_0xb61b('0x2d')]+')':undefined,'ownerid@odata.bind':_0xb61b('0x29')+_0xe92791[_0xb61b('0x48')]+')','directioncode':_0xe92791[_0xb61b('0x4a')]===_0xb61b('0x49')?![]:!![],'phonecall_activity_parties':_0x2d9b4d},getCustomFields(_0x2c87c9[_0xb61b('0x46')],_0x513912,_0x2c87c9[_0xb61b('0x3e')])),'headers':{'Authorization':_0xb61b('0x19')+_0x39f5c2,'OData-Version':_0xb61b('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x13549b);})[_0xb61b('0x12')](function(_0x3e9a13){var _0x56df27=_0x3e9a13[_0xb61b('0x2a')][_0xb61b('0x2b')];var _0xfc4cc1=_0x56df27[_0xb61b('0x3b')](_0x56df27[_0xb61b('0x2c')]('(')+0x1,_0x56df27['lastIndexOf'](')'));_0xe92791['ticketId']=_0xfc4cc1;_0x464373(_0xe92791);})[_0xb61b('0x14')](function(_0x35433d){_0x84c51c(_0x35433d[_0xb61b('0x16')]);});});}function emit(_0x5d3993,_0x235b51,_0xa7862f,_0x31e247){var _0x1cf76f={'uri':util[_0xb61b('0x4c')](_0xb61b('0x4d'),_0x5d3993,_0xa7862f,_0x31e247)};io['to'](util[_0xb61b('0x4c')](_0xb61b('0x4e'),_0x235b51))[_0xb61b('0x4f')](_0xb61b('0x50'),_0x1cf76f);}exports['cs']=function(_0x379149,_0x36133f,_0x4f3699,_0xcabd75,_0x2ca35c,_0xde5b91,_0x217ab8,_0x2eb999){var _0xc1d992={};_0xde5b91[_0xb61b('0xf')]=intUtil[_0xb61b('0x51')](_0xde5b91['remoteUri']);_0xde5b91['serverUrl']=intUtil[_0xb61b('0x51')](_0xde5b91[_0xb61b('0x52')]);_0xc1d992[_0xb61b('0x4a')]=_0x2eb999===_0xb61b('0x49')||_0x2eb999==='unmanaged'?_0xb61b('0x49'):'outbound';var _0x2667f3=util[_0xb61b('0x4c')](_0xb61b('0x53'),_0xde5b91[_0xb61b('0xf')]);var _0x2e7f0a=util['format'](_0xb61b('0x54'),_0xde5b91[_0xb61b('0x55')]);var _0x569ae2=util[_0xb61b('0x4c')](_0xb61b('0x56'),_0xde5b91[_0xb61b('0x52')],_0x36133f[_0xb61b('0x57')],md5(_0x36133f[_0xb61b('0x57')]));if(_0x2ca35c&&_0x2ca35c[_0xb61b('0x58')]){logger[_0xb61b('0x21')](_0xb61b('0x59'),_0xb61b('0x5a'));_0x36133f[_0xb61b('0x5b')]=_0x569ae2;}else if(_0x217ab8&&_0x217ab8[_0xb61b('0x5c')]&&_0x217ab8[_0xb61b('0x5c')]!==_0xb61b('0x5d')){logger[_0xb61b('0x21')]('[OUTBOUND]',_0xb61b('0x5a'));_0x36133f[_0xb61b('0x5b')]=_0x569ae2;}else{_0x36133f[_0xb61b('0x5b')]='';}return getUser(_0xc1d992,_0xde5b91,_0xcabd75,_0x2e7f0a,_0x2667f3,_0x2eb999)[_0xb61b('0x12')](function(_0x2c386a){logger['info']('['+_0x2eb999['toUpperCase']()+_0xb61b('0x5e'),_0x2c386a['userId']);logger['info']('['+_0x2eb999[_0xb61b('0x22')]()+_0xb61b('0x5f'),_0x2c386a['userEmail']);return getEndUser(_0x2c386a,_0xde5b91,_0x2e7f0a,_0x2667f3,_0x36133f,_0x2eb999,_0x4f3699[_0xb61b('0x60')]);})[_0xb61b('0x12')](function(_0x21c5a8){logger[_0xb61b('0x21')]('['+_0x2eb999[_0xb61b('0x22')]()+_0xb61b('0x61'),_0x21c5a8[_0xb61b('0x2d')]);logger['info']('['+_0x2eb999[_0xb61b('0x22')]()+_0xb61b('0x62'),_0x36133f[_0xb61b('0x28')]);return getTicket(_0x21c5a8,_0xde5b91,_0x2e7f0a,_0x2667f3,_0x36133f,_0x4f3699,_0x2eb999);})['then'](function(_0x1cec80){logger[_0xb61b('0x21')](util[_0xb61b('0x4c')]('['+_0x2eb999['toUpperCase']()+_0xb61b('0x63'),_0x4f3699[_0xb61b('0x3e')],_0x1cec80[_0xb61b('0x64')]));logger[_0xb61b('0x21')](util[_0xb61b('0x4c')]('['+_0x2eb999[_0xb61b('0x22')]()+_0xb61b('0x65'),_0x2eb999));if(_0x2eb999!==_0xb61b('0x66')){logger[_0xb61b('0x21')]('['+_0x2eb999[_0xb61b('0x22')]()+']',_0xb61b('0x67'));emit(_0xde5b91[_0xb61b('0xf')],_0xcabd75[_0xb61b('0x68')],_0x4f3699[_0xb61b('0x3e')],_0x1cec80[_0xb61b('0x64')]);}})['catch'](function(_0x115d4d){logger[_0xb61b('0x69')]('['+_0x2eb999['toUpperCase']()+_0xb61b('0x6a'),util[_0xb61b('0x6b')](_0x115d4d,{'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 b47335f..1a6b3b8 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 _0x672a=['recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','%s/helpdesk/tickets/%d','catch','error','unmanaged','lastevent','toUpperCase','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','Subjects','getString','name','Fields','custom_fields','mapValues','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','format','%s/api/v2/agents','length','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','push','idField','variable','variableName','customVariable','Variable','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x5e8602,_0x2ce012){var _0x4434fb=function(_0x5ea1cb){while(--_0x5ea1cb){_0x5e8602['push'](_0x5e8602['shift']());}};_0x4434fb(++_0x2ce012);}(_0x672a,0x76));var _0xa672=function(_0x292310,_0x27accd){_0x292310=_0x292310-0x0;var _0x369a9f=_0x672a[_0x292310];return _0x369a9f;};'use strict';var _=require('lodash');var rp=require(_0xa672('0x0'));var md5=require(_0xa672('0x1'));var util=require(_0xa672('0x2'));var Redis=require(_0xa672('0x3'));var intUtil=require(_0xa672('0x4'));var config=require(_0xa672('0x5'));var logger=require(_0xa672('0x6'))(_0xa672('0x7'));config['redis']=_[_0xa672('0x8')](config[_0xa672('0x9')],{'host':_0xa672('0xa'),'port':0x18eb});var io=require(_0xa672('0xb'))(new Redis(config['redis']));var headers={'Content-Type':_0xa672('0xc'),'Accept':_0xa672('0xc')};function emit(_0xf8560c,_0x5a45c2,_0x1192f2){io['to'](_0xf8560c)[_0xa672('0xd')](_0x5a45c2,_0x1192f2);}function getTicket(_0x3061dc,_0x490185,_0x356b0e,_0x5e53c1,_0x19b0bb){logger[_0xa672('0xe')](_0xa672('0xf'));var _0x193d58=_['merge']({'responder_id':_0x490185['id'],'requester_id':_0x356b0e['id'],'name':util['format'](_0xa672('0x10'),_0x19b0bb['calleridname']),'phone':_0x19b0bb['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x5e53c1[_0xa672('0x11')],_0x19b0bb,'\x20'),'description':intUtil[_0xa672('0x12')](_0x5e53c1['Descriptions'],_0x19b0bb,'
'),'tags':getTags(_0x5e53c1['Tags'],_0xa672('0x13'))},getCustomFields(_0x5e53c1[_0xa672('0x14')],_0x19b0bb));_0x193d58[_0xa672('0x15')]=_[_0xa672('0x16')](_['keyBy'](_0x193d58['custom_fields'],'id'),_0xa672('0x17'));return request({'uri':util['format'](_0xa672('0x18'),_0x3061dc[_0xa672('0x19')]),'method':_0xa672('0x1a'),'body':_0x193d58})[_0xa672('0x1b')](function(_0x1d6a48){logger['info'](_0xa672('0x1c'));return _0x1d6a48;});}function getUser(_0x34e405,_0x2430c6){if(intUtil['validateEmail'](_0x2430c6)){return request({'uri':util[_0xa672('0x1d')](_0xa672('0x1e'),_0x34e405['remoteUri']),'qs':{'email':_0x2430c6}})[_0xa672('0x1b')](function(_0x3f2c81){if(_0x3f2c81[_0xa672('0x1f')]){logger[_0xa672('0xe')](_0xa672('0x20'));return _[_0xa672('0x21')](_0x3f2c81,function(_0x27bd5f){return _0x27bd5f[_0xa672('0x22')]['email']===_0x2430c6;});}else{logger[_0xa672('0xe')](_0xa672('0x23'));return request({'uri':util[_0xa672('0x1d')](_0xa672('0x24'),_0x34e405[_0xa672('0x19')])})['then'](function(_0x545f22){logger['info']('Admin\x20account\x20selected.');return _0x545f22;});}});}else{logger[_0xa672('0xe')](_0xa672('0x25'));return request({'uri':util[_0xa672('0x1d')]('%s/api/v2/agents/me',_0x34e405['remoteUri'])})[_0xa672('0x1b')](function(_0x52ec5f){logger[_0xa672('0xe')]('Admin\x20account\x20selected.');return _0x52ec5f;});}}function getEndUser(_0x552b57,_0x22270b,_0x5d6a53){logger[_0xa672('0xe')](_0xa672('0x26'),_0x5d6a53);return request({'uri':util[_0xa672('0x1d')](_0xa672('0x27'),_0x552b57['remoteUri']),'qs':{'phone':_0x5d6a53}})[_0xa672('0x1b')](function(_0x235313){if(_0x235313['length']){logger[_0xa672('0xe')]('Enduser\x20found!');return _[_0xa672('0x21')](_0x235313,{'phone':_0x5d6a53});}else{logger[_0xa672('0xe')](_0xa672('0x28'));return request({'uri':util['format'](_0xa672('0x27'),_0x552b57[_0xa672('0x19')]),'method':_0xa672('0x1a'),'body':{'name':_0x22270b,'phone':_0x5d6a53}})[_0xa672('0x1b')](function(_0x5e96a6){logger[_0xa672('0xe')](_0xa672('0x29'));return _0x5e96a6;});}});}function getAuth(_0x3a6a26){return util[_0xa672('0x1d')](_0xa672('0x2a'),new Buffer(_0x3a6a26['apiKey']+':X')[_0xa672('0x2b')](_0xa672('0x2c')));}function request(_0x204b02){logger['debug'](_0xa672('0x2d'),JSON[_0xa672('0x2e')](_0x204b02));return rp(_[_0xa672('0x8')](_0x204b02,{'method':_0xa672('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x37d732,_0x4a935f){var _0x3323e=[];if(_0x37d732&&_0x37d732[_0xa672('0x1f')]>0x0){_0x3323e=_[_0xa672('0x30')](_0x37d732,_0x4a935f);}return _0x3323e;}function getCustomFields(_0x243519,_0x149462){var _0xb27d48=[];var _0x1c22f8={'custom_fields':[]};if(_0x243519['length']>0x0){_[_0xa672('0x31')](_0x243519,function(_0x38c35e){if(_[_0xa672('0x32')]([_0xa672('0x33'),_0xa672('0x34')],_0x38c35e['type'])&&_0x38c35e[_0xa672('0x35')]&&!_0x38c35e[_0xa672('0x36')]){_0x1c22f8[_0x38c35e[_0xa672('0x35')][_0xa672('0x37')]()]=_0x38c35e[_0xa672('0x38')][_0xa672('0x2b')]();}else if(_['includes']([_0xa672('0x33'),_0xa672('0x34')],_0x38c35e[_0xa672('0x39')])&&_0x38c35e['idField']&&_0x38c35e[_0xa672('0x36')]){_0x1c22f8[_0xa672('0x15')][_0xa672('0x3a')]({'id':_0x38c35e[_0xa672('0x3b')],'value':_0x38c35e[_0xa672('0x38')]['toString']()});}else if(_0x38c35e[_0xa672('0x39')]===_0xa672('0x3c')&&_0x38c35e[_0xa672('0x3d')]&&_0x38c35e[_0xa672('0x3b')]&&_0x38c35e[_0xa672('0x36')]){_0x149462[_0x38c35e[_0xa672('0x3d')]]&&_0x1c22f8[_0xa672('0x15')][_0xa672('0x3a')]({'id':_0x38c35e[_0xa672('0x3b')],'value':_0x149462[_0x38c35e[_0xa672('0x3d')]][_0xa672('0x2b')]()});}else if(_0x38c35e[_0xa672('0x39')]===_0xa672('0x3e')&&_0x38c35e[_0xa672('0x3f')]&&_0x38c35e[_0xa672('0x3f')][_0xa672('0x13')]&&_0x38c35e[_0xa672('0x3b')]&&_0x38c35e[_0xa672('0x36')]){_0x149462[_0x38c35e[_0xa672('0x3f')]['name'][_0xa672('0x37')]()]&&_0x1c22f8[_0xa672('0x15')][_0xa672('0x3a')]({'id':_0x38c35e[_0xa672('0x3b')],'value':_0x149462[_0x38c35e[_0xa672('0x3f')][_0xa672('0x13')][_0xa672('0x37')]()][_0xa672('0x2b')]()});}});}return _0x1c22f8;}exports['queue']=function(_0x1e0f2a,_0xdc578c,_0x2a90e6,_0x5417e9,_0x158de3,_0x52e06a){var _0x266a1d,_0x1e99b0;_0x52e06a['remoteUri']=intUtil['stripTrailingSlash'](_0x52e06a[_0xa672('0x19')]);_0x52e06a[_0xa672('0x40')]=intUtil['stripTrailingSlash'](_0x52e06a[_0xa672('0x40')]);if(_0x158de3&&_0x158de3[_0xa672('0x41')]){logger[_0xa672('0xe')](_0xa672('0x42'),_0xa672('0x43'));_0xdc578c[_0xa672('0x44')]=util[_0xa672('0x1d')](_0xa672('0x45'),_0x52e06a[_0xa672('0x40')],_0xdc578c[_0xa672('0x46')],md5(_0xdc578c[_0xa672('0x46')]));}else{_0xdc578c[_0xa672('0x44')]='';}headers['Authorization']=getAuth(_0x52e06a);return getUser(_0x52e06a,_0x5417e9[_0xa672('0x47')])[_0xa672('0x1b')](function(_0x512786){_0x266a1d=_0x512786;logger[_0xa672('0xe')](_0xa672('0x48'),_0x266a1d['id']);return getEndUser(_0x52e06a,_0xdc578c[_0xa672('0x49')],_0xdc578c[_0xa672('0x4a')]);})[_0xa672('0x1b')](function(_0x46ad94){_0x1e99b0=_0x46ad94;logger[_0xa672('0xe')](_0xa672('0x4b'),_0x1e99b0['id']);return getTicket(_0x52e06a,_0x266a1d,_0x1e99b0,_0x2a90e6,_0xdc578c);})['then'](function(_0x543324){if(_0x543324&&_0x543324['id']){logger[_0xa672('0xe')]('Ticket\x20created!');logger[_0xa672('0xe')](_0xa672('0x4c'),_0x543324['id']);logger[_0xa672('0xe')](_0xa672('0x42'),_0xa672('0x4d'));emit(util[_0xa672('0x1d')](_0xa672('0x4e'),_0x5417e9[_0xa672('0x13')]),_0xa672('0x4f'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x52e06a['remoteUri'],_0x543324['id'])});}})['catch'](function(_0xfdc1cc){logger['error'](_0xa672('0x42'),JSON[_0xa672('0x2e')](_0xfdc1cc));});};exports[_0xa672('0x50')]=function(_0x31957e,_0xa04ae4,_0x42599c,_0x512a7b,_0x29ccf3,_0x5ca2d9,_0x209e14){var _0x5bd87f,_0x53fcdf;_0x5ca2d9[_0xa672('0x19')]=intUtil[_0xa672('0x51')](_0x5ca2d9[_0xa672('0x19')]);_0x5ca2d9[_0xa672('0x40')]=intUtil[_0xa672('0x51')](_0x5ca2d9[_0xa672('0x40')]);if(_0x209e14&&_0x209e14['recordingFormat']&&_0x209e14[_0xa672('0x52')]!==_0xa672('0x53')){logger[_0xa672('0xe')](_0xa672('0x54'),_0xa672('0x43'));_0xa04ae4[_0xa672('0x44')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5ca2d9[_0xa672('0x40')],_0xa04ae4[_0xa672('0x46')],md5(_0xa04ae4['uniqueid']));}headers[_0xa672('0x55')]=getAuth(_0x5ca2d9);return getUser(_0x5ca2d9,_0x512a7b[_0xa672('0x47')])['then'](function(_0x25ab7a){_0x5bd87f=_0x25ab7a;logger['info'](_0xa672('0x48'),_0x5bd87f['id']);return getEndUser(_0x5ca2d9,_0xa04ae4[_0xa672('0x56')],_0xa04ae4['destcalleridnum']);})[_0xa672('0x1b')](function(_0x1280fb){_0x53fcdf=_0x1280fb;logger[_0xa672('0xe')](_0xa672('0x4b'),_0x53fcdf['id']);return getTicket(_0x5ca2d9,_0x5bd87f,_0x53fcdf,_0x42599c,_0xa04ae4);})[_0xa672('0x1b')](function(_0x348336){if(_0x348336&&_0x348336['id']){logger[_0xa672('0xe')](_0xa672('0x1c'));logger[_0xa672('0xe')](_0xa672('0x4c'),_0x348336['id']);logger[_0xa672('0xe')](_0xa672('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xa672('0x4e'),_0x512a7b[_0xa672('0x13')]),_0xa672('0x4f'),{'uri':util[_0xa672('0x1d')](_0xa672('0x57'),_0x5ca2d9['remoteUri'],_0x348336['id'])});}})[_0xa672('0x58')](function(_0x59b6f8){logger[_0xa672('0x59')]('[OUTBOUND]',JSON[_0xa672('0x2e')](_0x59b6f8));});};exports[_0xa672('0x5a')]=function(_0x47449a,_0x17af32,_0x21766f,_0x5b27df,_0x537bde,_0x377e9b){var _0x340d38,_0x4b25bb;_0x377e9b[_0xa672('0x19')]=intUtil[_0xa672('0x51')](_0x377e9b['remoteUri']);_0x377e9b[_0xa672('0x40')]=intUtil[_0xa672('0x51')](_0x377e9b[_0xa672('0x40')]);if(_0x537bde&&_0x537bde[_0xa672('0x41')]){logger['info']('['+_0x17af32[_0xa672('0x5b')][_0xa672('0x5c')]()+']',_0xa672('0x43'));_0x17af32[_0xa672('0x44')]=util[_0xa672('0x1d')](_0xa672('0x45'),_0x377e9b[_0xa672('0x40')],_0x17af32[_0xa672('0x46')],md5(_0x17af32[_0xa672('0x46')]));}else{_0x17af32[_0xa672('0x44')]='';}headers[_0xa672('0x55')]=getAuth(_0x377e9b);return getUser(_0x377e9b,'')[_0xa672('0x1b')](function(_0x1a1196){_0x340d38=_0x1a1196;logger[_0xa672('0xe')](_0xa672('0x48'),_0x340d38['id']);return getEndUser(_0x377e9b,_0x17af32[_0xa672('0x49')],_0x17af32[_0xa672('0x4a')]);})[_0xa672('0x1b')](function(_0x590f4b){_0x4b25bb=_0x590f4b;logger[_0xa672('0xe')](_0xa672('0x4b'),_0x4b25bb['id']);return getTicket(_0x377e9b,_0x340d38,_0x4b25bb,_0x21766f,_0x17af32);})['then'](function(_0x18ad06){if(_0x18ad06){logger[_0xa672('0xe')](_0xa672('0x1c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x18ad06['id']);}})['catch'](function(_0x213fc5){logger['error']('['+_0x17af32[_0xa672('0x5b')][_0xa672('0x5c')]()+']',JSON[_0xa672('0x2e')](_0x213fc5));});}; \ No newline at end of file +var _0x5094=['length','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','idField','push','content','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','catch','monitor_format','toUpperCase','request-promise','md5','./util','freshdesk','localhost','socket.io-emitter','redis','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents'];(function(_0x33dacd,_0xdf5a52){var _0x40e4c9=function(_0x133aae){while(--_0x133aae){_0x33dacd['push'](_0x33dacd['shift']());}};_0x40e4c9(++_0xdf5a52);}(_0x5094,0x1a8));var _0x4509=function(_0x9a51b3,_0x34ac18){_0x9a51b3=_0x9a51b3-0x0;var _0x4ca7b1=_0x5094[_0x9a51b3];return _0x4ca7b1;};'use strict';var _=require('lodash');var rp=require(_0x4509('0x0'));var md5=require(_0x4509('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x4509('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x4509('0x3'));config['redis']=_['defaults'](config['redis'],{'host':_0x4509('0x4'),'port':0x18eb});var io=require(_0x4509('0x5'))(new Redis(config[_0x4509('0x6')]));var headers={'Content-Type':_0x4509('0x7'),'Accept':_0x4509('0x7')};function emit(_0x2e3578,_0x1fc50a,_0x5a14b0){io['to'](_0x2e3578)['emit'](_0x1fc50a,_0x5a14b0);}function getTicket(_0x27be47,_0x1e4753,_0x41beea,_0x5608d6,_0x512631){logger[_0x4509('0x8')](_0x4509('0x9'));var _0x589063=_[_0x4509('0xa')]({'responder_id':_0x1e4753['id'],'requester_id':_0x41beea['id'],'name':util[_0x4509('0xb')](_0x4509('0xc'),_0x512631[_0x4509('0xd')]),'phone':_0x512631[_0x4509('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x4509('0xf')](_0x5608d6[_0x4509('0x10')],_0x512631,'\x20'),'description':intUtil[_0x4509('0xf')](_0x5608d6[_0x4509('0x11')],_0x512631,_0x4509('0x12')),'tags':getTags(_0x5608d6[_0x4509('0x13')],_0x4509('0x14'))},getCustomFields(_0x5608d6[_0x4509('0x15')],_0x512631));_0x589063[_0x4509('0x16')]=_[_0x4509('0x17')](_[_0x4509('0x18')](_0x589063[_0x4509('0x16')],'id'),'value');return request({'uri':util['format'](_0x4509('0x19'),_0x27be47[_0x4509('0x1a')]),'method':_0x4509('0x1b'),'body':_0x589063})[_0x4509('0x1c')](function(_0x3fcae6){logger[_0x4509('0x8')]('Ticket\x20created!');return _0x3fcae6;});}function getUser(_0x1bb732,_0x4e4350){if(intUtil[_0x4509('0x1d')](_0x4e4350)){return request({'uri':util[_0x4509('0xb')](_0x4509('0x1e'),_0x1bb732['remoteUri']),'qs':{'email':_0x4e4350}})[_0x4509('0x1c')](function(_0x39421c){if(_0x39421c[_0x4509('0x1f')]){logger['info']('Agent\x20found!');return _[_0x4509('0x20')](_0x39421c,function(_0x23545b){return _0x23545b[_0x4509('0x21')][_0x4509('0x22')]===_0x4e4350;});}else{logger[_0x4509('0x8')](_0x4509('0x23'));return request({'uri':util['format'](_0x4509('0x24'),_0x1bb732[_0x4509('0x1a')])})[_0x4509('0x1c')](function(_0x5ce83d){logger[_0x4509('0x8')](_0x4509('0x25'));return _0x5ce83d;});}});}else{logger[_0x4509('0x8')](_0x4509('0x26'));return request({'uri':util['format'](_0x4509('0x24'),_0x1bb732['remoteUri'])})[_0x4509('0x1c')](function(_0x2d8c0b){logger[_0x4509('0x8')](_0x4509('0x25'));return _0x2d8c0b;});}}function getEndUser(_0x44ec0e,_0x179dbd,_0x2bd3bb){logger['info'](_0x4509('0x27'),_0x2bd3bb);return request({'uri':util[_0x4509('0xb')](_0x4509('0x28'),_0x44ec0e['remoteUri']),'qs':{'phone':_0x2bd3bb}})['then'](function(_0xb9ef85){if(_0xb9ef85[_0x4509('0x1f')]){logger[_0x4509('0x8')](_0x4509('0x29'));return _[_0x4509('0x20')](_0xb9ef85,{'phone':_0x2bd3bb});}else{logger[_0x4509('0x8')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x4509('0xb')]('%s/api/v2/contacts',_0x44ec0e['remoteUri']),'method':'POST','body':{'name':_0x179dbd,'phone':_0x2bd3bb}})['then'](function(_0x273109){logger['info']('Enduser\x20created.');return _0x273109;});}});}function getAuth(_0x564d3b){return util[_0x4509('0xb')](_0x4509('0x2a'),new Buffer(_0x564d3b['apiKey']+':X')[_0x4509('0x2b')](_0x4509('0x2c')));}function request(_0xce612f){logger[_0x4509('0x2d')](_0x4509('0x2e'),JSON[_0x4509('0x2f')](_0xce612f));return rp(_['defaults'](_0xce612f,{'method':_0x4509('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x489ec3,_0x197079){var _0xf4b5bf=[];if(_0x489ec3&&_0x489ec3['length']>0x0){_0xf4b5bf=_[_0x4509('0x31')](_0x489ec3,_0x197079);}return _0xf4b5bf;}function getCustomFields(_0xf0d8c,_0x21ec9b){var _0x57ece5=[];var _0x1b6ace={'custom_fields':[]};if(_0xf0d8c[_0x4509('0x1f')]>0x0){_[_0x4509('0x32')](_0xf0d8c,function(_0x4b7e47){if(_[_0x4509('0x33')]([_0x4509('0x34'),_0x4509('0x35')],_0x4b7e47[_0x4509('0x36')])&&_0x4b7e47[_0x4509('0x37')]&&!_0x4b7e47[_0x4509('0x38')]){_0x1b6ace[_0x4b7e47['nameField'][_0x4509('0x39')]()]=_0x4b7e47['content'][_0x4509('0x2b')]();}else if(_[_0x4509('0x33')](['string',_0x4509('0x35')],_0x4b7e47[_0x4509('0x36')])&&_0x4b7e47[_0x4509('0x3a')]&&_0x4b7e47[_0x4509('0x38')]){_0x1b6ace['custom_fields'][_0x4509('0x3b')]({'id':_0x4b7e47[_0x4509('0x3a')],'value':_0x4b7e47[_0x4509('0x3c')][_0x4509('0x2b')]()});}else if(_0x4b7e47[_0x4509('0x36')]===_0x4509('0x3d')&&_0x4b7e47['variableName']&&_0x4b7e47['idField']&&_0x4b7e47[_0x4509('0x38')]){_0x21ec9b[_0x4b7e47[_0x4509('0x3e')]]&&_0x1b6ace[_0x4509('0x16')][_0x4509('0x3b')]({'id':_0x4b7e47[_0x4509('0x3a')],'value':_0x21ec9b[_0x4b7e47[_0x4509('0x3e')]]['toString']()});}else if(_0x4b7e47[_0x4509('0x36')]===_0x4509('0x3f')&&_0x4b7e47[_0x4509('0x40')]&&_0x4b7e47[_0x4509('0x40')]['name']&&_0x4b7e47['idField']&&_0x4b7e47[_0x4509('0x38')]){_0x21ec9b[_0x4b7e47[_0x4509('0x40')]['name'][_0x4509('0x39')]()]&&_0x1b6ace[_0x4509('0x16')]['push']({'id':_0x4b7e47['idField'],'value':_0x21ec9b[_0x4b7e47['Variable'][_0x4509('0x14')][_0x4509('0x39')]()][_0x4509('0x2b')]()});}});}return _0x1b6ace;}exports[_0x4509('0x41')]=function(_0x188cee,_0xedf076,_0x2a68c5,_0x23d878,_0x4311da,_0xaef846){var _0x46fb8f,_0x4434d3;_0xaef846[_0x4509('0x1a')]=intUtil['stripTrailingSlash'](_0xaef846[_0x4509('0x1a')]);_0xaef846[_0x4509('0x42')]=intUtil[_0x4509('0x43')](_0xaef846[_0x4509('0x42')]);if(_0x4311da&&_0x4311da['monitor_format']){logger[_0x4509('0x8')](_0x4509('0x44'),_0x4509('0x45'));_0xedf076[_0x4509('0x46')]=util[_0x4509('0xb')](_0x4509('0x47'),_0xaef846[_0x4509('0x42')],_0xedf076[_0x4509('0x48')],md5(_0xedf076[_0x4509('0x48')]));}else{_0xedf076[_0x4509('0x46')]='';}headers[_0x4509('0x49')]=getAuth(_0xaef846);return getUser(_0xaef846,_0x23d878[_0x4509('0x22')])[_0x4509('0x1c')](function(_0x83b166){_0x46fb8f=_0x83b166;logger[_0x4509('0x8')](_0x4509('0x4a'),_0x46fb8f['id']);return getEndUser(_0xaef846,_0xedf076[_0x4509('0xd')],_0xedf076[_0x4509('0xe')]);})[_0x4509('0x1c')](function(_0x63e1d9){_0x4434d3=_0x63e1d9;logger['info'](_0x4509('0x4b'),_0x4434d3['id']);return getTicket(_0xaef846,_0x46fb8f,_0x4434d3,_0x2a68c5,_0xedf076);})['then'](function(_0xedea66){if(_0xedea66&&_0xedea66['id']){logger[_0x4509('0x8')](_0x4509('0x4c'));logger[_0x4509('0x8')](_0x4509('0x4d'),_0xedea66['id']);logger[_0x4509('0x8')](_0x4509('0x44'),_0x4509('0x4e'));emit(util[_0x4509('0xb')](_0x4509('0x4f'),_0x23d878[_0x4509('0x14')]),_0x4509('0x50'),{'uri':util[_0x4509('0xb')](_0x4509('0x51'),_0xaef846[_0x4509('0x1a')],_0xedea66['id'])});}})['catch'](function(_0x19b76e){logger[_0x4509('0x52')](_0x4509('0x44'),JSON[_0x4509('0x2f')](_0x19b76e));});};exports[_0x4509('0x53')]=function(_0x263fa3,_0x2c2cad,_0xe20632,_0x45e4fd,_0x5b2d1e,_0x2ed924,_0xddfc35){var _0x1d6be1,_0x48b676;_0x2ed924[_0x4509('0x1a')]=intUtil[_0x4509('0x43')](_0x2ed924[_0x4509('0x1a')]);_0x2ed924[_0x4509('0x42')]=intUtil[_0x4509('0x43')](_0x2ed924[_0x4509('0x42')]);if(_0xddfc35&&_0xddfc35[_0x4509('0x54')]&&_0xddfc35['recordingFormat']!==_0x4509('0x55')){logger[_0x4509('0x8')](_0x4509('0x56'),'Recording\x20is\x20enabled!');_0x2c2cad[_0x4509('0x46')]=util[_0x4509('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2ed924[_0x4509('0x42')],_0x2c2cad[_0x4509('0x48')],md5(_0x2c2cad[_0x4509('0x48')]));}headers[_0x4509('0x49')]=getAuth(_0x2ed924);return getUser(_0x2ed924,_0x45e4fd['email'])[_0x4509('0x1c')](function(_0x520aee){_0x1d6be1=_0x520aee;logger[_0x4509('0x8')]('The\x20User\x20ID\x20is:',_0x1d6be1['id']);return getEndUser(_0x2ed924,_0x2c2cad[_0x4509('0x57')],_0x2c2cad['destcalleridnum']);})[_0x4509('0x1c')](function(_0x1036db){_0x48b676=_0x1036db;logger[_0x4509('0x8')](_0x4509('0x4b'),_0x48b676['id']);return getTicket(_0x2ed924,_0x1d6be1,_0x48b676,_0xe20632,_0x2c2cad);})['then'](function(_0x271697){if(_0x271697&&_0x271697['id']){logger[_0x4509('0x8')](_0x4509('0x4c'));logger[_0x4509('0x8')](_0x4509('0x4d'),_0x271697['id']);logger[_0x4509('0x8')](_0x4509('0x56'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4509('0xb')]('user:%s',_0x45e4fd['name']),'trigger:browser:url',{'uri':util[_0x4509('0xb')](_0x4509('0x51'),_0x2ed924[_0x4509('0x1a')],_0x271697['id'])});}})[_0x4509('0x58')](function(_0x3c4e96){logger['error'](_0x4509('0x56'),JSON['stringify'](_0x3c4e96));});};exports['unmanaged']=function(_0x3af662,_0x1a26dc,_0x5e2c17,_0x8ab397,_0x47abd0,_0x64b375){var _0x57e15c,_0x256734;_0x64b375[_0x4509('0x1a')]=intUtil['stripTrailingSlash'](_0x64b375['remoteUri']);_0x64b375[_0x4509('0x42')]=intUtil[_0x4509('0x43')](_0x64b375[_0x4509('0x42')]);if(_0x47abd0&&_0x47abd0[_0x4509('0x59')]){logger[_0x4509('0x8')]('['+_0x1a26dc['lastevent'][_0x4509('0x5a')]()+']',_0x4509('0x45'));_0x1a26dc['recordingURL']=util['format'](_0x4509('0x47'),_0x64b375[_0x4509('0x42')],_0x1a26dc[_0x4509('0x48')],md5(_0x1a26dc[_0x4509('0x48')]));}else{_0x1a26dc[_0x4509('0x46')]='';}headers[_0x4509('0x49')]=getAuth(_0x64b375);return getUser(_0x64b375,'')[_0x4509('0x1c')](function(_0x2c382e){_0x57e15c=_0x2c382e;logger['info'](_0x4509('0x4a'),_0x57e15c['id']);return getEndUser(_0x64b375,_0x1a26dc[_0x4509('0xd')],_0x1a26dc[_0x4509('0xe')]);})[_0x4509('0x1c')](function(_0x2cae22){_0x256734=_0x2cae22;logger[_0x4509('0x8')]('The\x20Enduser\x20ID\x20is:',_0x256734['id']);return getTicket(_0x64b375,_0x57e15c,_0x256734,_0x5e2c17,_0x1a26dc);})[_0x4509('0x1c')](function(_0x3a878f){if(_0x3a878f){logger[_0x4509('0x8')](_0x4509('0x4c'));logger['info'](_0x4509('0x4d'),_0x3a878f['id']);}})['catch'](function(_0x22bf42){logger[_0x4509('0x52')]('['+_0x1a26dc['lastevent'][_0x4509('0x5a')]()+']',JSON[_0x4509('0x2f')](_0x22bf42));});}; \ 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 d5441ae..cbb9490 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 _0xd2a5=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','lodash','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','getString','Subjects','task','Task\x20created:','ticketId','/contacts/','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x2980d0,_0x4719bb){var _0x1ab541=function(_0x2aebc7){while(--_0x2aebc7){_0x2980d0['push'](_0x2980d0['shift']());}};_0x1ab541(++_0x4719bb);}(_0xd2a5,0x138));var _0x5d2a=function(_0x4b1475,_0x41bf4c){_0x4b1475=_0x4b1475-0x0;var _0x3153e6=_0xd2a5[_0x4b1475];return _0x3153e6;};'use strict';var _=require(_0x5d2a('0x0'));var rp=require(_0x5d2a('0x1'));var md5=require(_0x5d2a('0x2'));var util=require(_0x5d2a('0x3'));var moment=require(_0x5d2a('0x4'));var Promise=require(_0x5d2a('0x5'));var Redis=require('ioredis');var intUtil=require(_0x5d2a('0x6'));var config=require(_0x5d2a('0x7'));var logger=require(_0x5d2a('0x8'))(_0x5d2a('0x9'));config[_0x5d2a('0xa')]=_['defaults'](config['redis'],{'host':_0x5d2a('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x4e9dec,_0x411c59,_0x2211c2,_0x3626a6){return new Promise(function(_0x54c62b,_0x1fbc30){var _0x1dbbe5=![];var _0xa0f9d7={'method':'GET','uri':_0x3626a6+_0x5d2a('0xc'),'json':!![]};_0xa0f9d7[_0x5d2a('0xd')]=_0x2211c2;logger[_0x5d2a('0xe')](_0x5d2a('0xf'));return rp(_0xa0f9d7)[_0x5d2a('0x10')](function(_0x338715){if(_0x338715){var _0x1a7c1c=_0x338715[_0x5d2a('0x11')];var _0x34118f=null;for(_0x34118f=0x0;_0x34118f<_0x1a7c1c[_0x5d2a('0x12')];_0x34118f++){if(_0x1a7c1c[_0x34118f]['email']===_0x4e9dec[_0x5d2a('0x13')]){_0x4e9dec['adminId']=_0x1a7c1c[_0x34118f]['id'];_0x1dbbe5=!![];}}if(_0x1dbbe5){logger[_0x5d2a('0xe')]('Admin\x20found:',_0x4e9dec[_0x5d2a('0x14')]);_0x54c62b(_0x4e9dec);}else{_0x1fbc30({'statusCode':0x194,'message':_0x5d2a('0x15')});}}else{_0x1fbc30({'statusCode':0x194,'message':_0x5d2a('0x15')});}})[_0x5d2a('0x16')](function(_0x56b4f5){logger[_0x5d2a('0x17')]('['+[_0x411c59[_0x5d2a('0x18')]()]+']',_0x56b4f5[_0x5d2a('0x19')]);_0x1fbc30(_0x56b4f5);});});}function getUser(_0xec04c7,_0x441262,_0x1a50a0){return function(_0x24c2b5){return new Promise(function(_0x2a2bee,_0x98cd87){var _0x1b8db0={'method':'GET','uri':_0x1a50a0+_0x5d2a('0xc'),'json':!![]};_0x1b8db0[_0x5d2a('0xd')]=_0x441262;logger[_0x5d2a('0xe')](_0x5d2a('0x1a'));return rp(_0x1b8db0)['then'](function(_0x159676){if(_0x159676){var _0x50bcfb=_0x159676[_0x5d2a('0x11')];var _0x4effaf=![];var _0x1caf5c=null;if(_0x24c2b5[_0x5d2a('0x1b')]!==null){logger['info'](_0x5d2a('0x1c'),_0x24c2b5[_0x5d2a('0x1b')]);_0x24c2b5[_0x5d2a('0x1d')]=_0x24c2b5[_0x5d2a('0x1b')];for(_0x1caf5c=0x0;_0x1caf5c<_0x50bcfb[_0x5d2a('0x12')];_0x1caf5c++){if(_0x50bcfb[_0x1caf5c][_0x5d2a('0x1e')]===_0x24c2b5[_0x5d2a('0x1b')]){_0x4effaf=!![];_0x24c2b5[_0x5d2a('0x1f')]=_0x50bcfb[_0x1caf5c]['id'];logger['info'](_0x5d2a('0x20'),_0x24c2b5['userId']);}}}if(!_0x4effaf){logger[_0x5d2a('0xe')](_0x5d2a('0x21'));_0x24c2b5[_0x5d2a('0x1d')]=_0x24c2b5[_0x5d2a('0x13')];_0x24c2b5[_0x5d2a('0x1f')]=_0x24c2b5[_0x5d2a('0x14')];_0x4effaf=!![];}if(_0x4effaf){_0x2a2bee(_0x24c2b5);}else{_0x98cd87({'statusCode':0x194,'message':_0x5d2a('0x15')});}}else{_0x98cd87({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x5d2a('0x16')](function(_0x187a95){logger[_0x5d2a('0x17')]('['+[_0xec04c7[_0x5d2a('0x18')]()]+']',_0x187a95[_0x5d2a('0x19')]);_0x98cd87(_0x187a95);});});};}function searchContact(_0x3c20eb,_0x1f122b,_0x36367b,_0x35a663){return new Promise(function(_0x27df31,_0x5af223){var _0xebf99a={'method':'GET','headers':_0x1f122b,'uri':_0x3c20eb+_0x5d2a('0x22')+_0x35a663+_0x5d2a('0x23')+_0x36367b+'&entities=contact','json':!![]};rp(_0xebf99a)[_0x5d2a('0x10')](function(_0x23f05d){var _0xbcdbc3=_[_0x5d2a('0x24')](_0x23f05d[_0x5d2a('0x25')][_0x5d2a('0x25')],[_0x36367b,_0x35a663]);_0x27df31(_0xbcdbc3);})[_0x5d2a('0x16')](function(_0x219288){_0x5af223(_0x219288);});});}function getEndUser(_0x57691a,_0xde8471,_0x3c06e5){return function(_0x1f136c){return new Promise(function(_0x144904,_0x2c3092){logger[_0x5d2a('0xe')](util[_0x5d2a('0x26')](_0x5d2a('0x27'),_0x1f136c['contactNumber']));searchContact(_0x3c06e5,_0xde8471,'mobile_number',_0x1f136c[_0x5d2a('0x28')])[_0x5d2a('0x10')](function(_0x31c4a7){if(_0x31c4a7){_0x1f136c[_0x5d2a('0x29')]=_0x31c4a7['id'];logger[_0x5d2a('0xe')](_0x5d2a('0x2a'),_0x1f136c['endUserId']);return _0x144904(_0x1f136c);}searchContact(_0x3c06e5,_0xde8471,'work_number',_0x1f136c[_0x5d2a('0x28')])[_0x5d2a('0x10')](function(_0xeecf81){if(_0xeecf81){_0x1f136c[_0x5d2a('0x29')]=_0xeecf81['id'];logger[_0x5d2a('0xe')](_0x5d2a('0x2b'),_0x1f136c['endUserId']);return _0x144904(_0x1f136c);}createEndUser(_0x1f136c,_0x57691a,_0xde8471,_0x3c06e5)['then'](function(_0x30798c){logger[_0x5d2a('0xe')](_0x5d2a('0x2c'),_0x30798c[_0x5d2a('0x29')]);return _0x144904(_0x30798c);});});})[_0x5d2a('0x16')](function(_0x560f0c){_0x2c3092(_0x560f0c);});});};}function createEndUser(_0x902f52,_0x2791b2,_0x44753d,_0x4982dd){return new Promise(function(_0x3a9417,_0x259618){var _0x49a36a=moment();var _0x35cfb6={'method':_0x5d2a('0x2d'),'uri':_0x4982dd+_0x5d2a('0x2e'),'body':{'contact':{'last_name':_0x902f52[_0x5d2a('0x28')],'work_number':_0x902f52[_0x5d2a('0x28')],'mobile_number':_0x902f52[_0x5d2a('0x28')],'owner_id':_0x902f52['userId'],'created_at':_0x49a36a[_0x5d2a('0x26')](_0x5d2a('0x2f'))}},'json':!![]};_0x35cfb6[_0x5d2a('0xd')]=_0x44753d;logger['info'](_0x5d2a('0x30'));return rp(_0x35cfb6)[_0x5d2a('0x10')](function(_0x348d8e){_0x902f52['endUserId']=_0x348d8e['contact']['id'];_0x3a9417(_0x902f52);})['catch'](function(_0xa385d2){logger['error']('['+[_0x2791b2[_0x5d2a('0x18')]()]+']',_0xa385d2[_0x5d2a('0x19')]);_0x259618(_0xa385d2[_0x5d2a('0x19')]);});});}function getTicket(_0x262e94,_0x371d0e,_0x3a44eb,_0xa4ce36,_0x446c31){return function(_0x59ca67){logger[_0x5d2a('0xe')]('Creating\x20new\x20task');return new Promise(function(_0x1c1237,_0x3cf07c){var _0x429df2=moment();var _0x53a53b={'method':_0x5d2a('0x2d'),'uri':_0x3a44eb+'/api/tasks','body':{'title':intUtil[_0x5d2a('0x31')](_0xa4ce36[_0x5d2a('0x32')],_0x446c31,'\x20'),'description':intUtil['getString'](_0xa4ce36['Descriptions'],_0x446c31,'\x0a'),'owner_id':_0x59ca67[_0x5d2a('0x1f')],'creater_id':_0x59ca67[_0x5d2a('0x14')],'targetable_id':_0x59ca67[_0x5d2a('0x29')],'targetable_type':'Contact','created_at':_0x429df2['format'](_0x5d2a('0x2f')),'due_date':_0x429df2['add'](0x1e,'m')[_0x5d2a('0x26')](_0x5d2a('0x2f'))},'json':!![]};_0x53a53b[_0x5d2a('0xd')]=_0x371d0e;return rp(_0x53a53b)['then'](function(_0x10d29d){_0x59ca67['ticketId']=_0x10d29d[_0x5d2a('0x33')]['id'];logger[_0x5d2a('0xe')](_0x5d2a('0x34'),_0x59ca67[_0x5d2a('0x35')]);_0x1c1237(_0x59ca67);})['catch'](function(_0xb7759e){logger['error']('['+[_0x262e94[_0x5d2a('0x18')]()]+']',_0xb7759e['message']);_0x3cf07c(_0xb7759e[_0x5d2a('0x19')]);});});};}function emit(_0x4329b3,_0x16a6ee,_0x202a28){var _0x470c11={'uri':_0x4329b3+_0x5d2a('0x36')+_0x202a28};io['to'](util[_0x5d2a('0x26')]('user:%s',_0x16a6ee))['emit']('trigger:browser:url',_0x470c11);}exports['cs']=function(_0x1a0d58,_0x8fb842,_0x3787ef,_0x5228ee,_0x4bd5a9,_0x166155,_0x68bd78,_0x33160b){var _0xc2dc18={};var _0x2ee444={'Authorization':_0x5d2a('0x37')+_0x166155[_0x5d2a('0x38')]};_0x166155[_0x5d2a('0x39')]=intUtil[_0x5d2a('0x3a')](_0x166155[_0x5d2a('0x39')]);_0x166155['serverUrl']=intUtil[_0x5d2a('0x3a')](_0x166155[_0x5d2a('0x3b')]);var _0xb1c259=_0x166155[_0x5d2a('0x39')];_0xc2dc18[_0x5d2a('0x13')]=_0x166155['username'];_0xc2dc18[_0x5d2a('0x28')]=_0x33160b[_0x5d2a('0x3c')]()===_0x5d2a('0x3d')?_0x8fb842['destcalleridnum']:_0x8fb842[_0x5d2a('0x3e')];_0xc2dc18[_0x5d2a('0x3f')]=_0x33160b===_0x5d2a('0x40')||_0x33160b===_0x5d2a('0x41')?_0x5d2a('0x40'):_0x5d2a('0x3d');if(_0x5228ee){_0xc2dc18[_0x5d2a('0x1b')]=_0x5228ee['email'];}var _0xaf2210=util[_0x5d2a('0x26')](_0x5d2a('0x42'),_0x166155[_0x5d2a('0x3b')],_0x8fb842[_0x5d2a('0x43')],md5(_0x8fb842[_0x5d2a('0x43')]));if(_0x4bd5a9&&_0x4bd5a9['monitor_format']){logger[_0x5d2a('0xe')](_0x5d2a('0x44'),_0x5d2a('0x45'));_0x8fb842[_0x5d2a('0x46')]=_0xaf2210;}else if(_0x68bd78&&_0x68bd78[_0x5d2a('0x47')]&&_0x68bd78[_0x5d2a('0x47')]!==_0x5d2a('0x48')){logger['info']('[OUTBOUND]',_0x5d2a('0x45'));_0x8fb842[_0x5d2a('0x46')]=_0xaf2210;}else{_0x8fb842[_0x5d2a('0x46')]='';}return getAdminId(_0xc2dc18,_0x33160b,_0x2ee444,_0xb1c259)['then'](getUser(_0x33160b,_0x2ee444,_0xb1c259))[_0x5d2a('0x10')](getEndUser(_0x33160b,_0x2ee444,_0xb1c259))[_0x5d2a('0x10')](getTicket(_0x33160b,_0x2ee444,_0xb1c259,_0x3787ef,_0x8fb842))[_0x5d2a('0x10')](function(_0x467d35){logger[_0x5d2a('0xe')](util[_0x5d2a('0x26')](_0x5d2a('0x49'),_0x467d35['ticketId']));if(_0x33160b!==_0x5d2a('0x41')){logger[_0x5d2a('0xe')]('['+[_0x33160b['toUpperCase']()]+']',_0x5d2a('0x4a'));emit(_0xb1c259,_0x5228ee['name'],_0x467d35[_0x5d2a('0x29')]);}})['catch'](function(_0x5429a1){logger['error']('['+[_0x33160b[_0x5d2a('0x18')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x5d2a('0x4b')](_0x5429a1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8309=['adminEmail','error','toUpperCase','message','/api/lookup?q=','&f=','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','task','Task\x20created:','ticketId','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','toLowerCase','outbound','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','md5','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','/api/selector/owners','headers','Getting\x20admin\x20information','then','length','email','adminId','Requested\x20Resource\x20not\x20Found','catch','GET','info','Getting\x20user\x20list','users','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected'];(function(_0x4599ed,_0x5d731c){var _0x1b4384=function(_0x402bca){while(--_0x402bca){_0x4599ed['push'](_0x4599ed['shift']());}};_0x1b4384(++_0x5d731c);}(_0x8309,0x124));var _0x9830=function(_0x1cad07,_0x4670ef){_0x1cad07=_0x1cad07-0x0;var _0x23e480=_0x8309[_0x1cad07];return _0x23e480;};'use strict';var _=require(_0x9830('0x0'));var rp=require('request-promise');var md5=require(_0x9830('0x1'));var util=require('util');var moment=require('moment');var Promise=require(_0x9830('0x2'));var Redis=require('ioredis');var intUtil=require(_0x9830('0x3'));var config=require(_0x9830('0x4'));var logger=require(_0x9830('0x5'))(_0x9830('0x6'));config[_0x9830('0x7')]=_[_0x9830('0x8')](config[_0x9830('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x9830('0x9'))(new Redis(config[_0x9830('0x7')]));function getAdminId(_0x5b2f99,_0x4ca32b,_0x3b4f25,_0x46580f){return new Promise(function(_0x4565f5,_0x33f8e0){var _0x3f5e19=![];var _0x572128={'method':'GET','uri':_0x46580f+_0x9830('0xa'),'json':!![]};_0x572128[_0x9830('0xb')]=_0x3b4f25;logger['info'](_0x9830('0xc'));return rp(_0x572128)[_0x9830('0xd')](function(_0x30e82e){if(_0x30e82e){var _0x543b99=_0x30e82e['users'];var _0x359d62=null;for(_0x359d62=0x0;_0x359d62<_0x543b99[_0x9830('0xe')];_0x359d62++){if(_0x543b99[_0x359d62][_0x9830('0xf')]===_0x5b2f99['adminEmail']){_0x5b2f99[_0x9830('0x10')]=_0x543b99[_0x359d62]['id'];_0x3f5e19=!![];}}if(_0x3f5e19){logger['info']('Admin\x20found:',_0x5b2f99[_0x9830('0x10')]);_0x4565f5(_0x5b2f99);}else{_0x33f8e0({'statusCode':0x194,'message':_0x9830('0x11')});}}else{_0x33f8e0({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x9830('0x12')](function(_0x4a8f11){logger['error']('['+[_0x4ca32b['toUpperCase']()]+']',_0x4a8f11['message']);_0x33f8e0(_0x4a8f11);});});}function getUser(_0x3a7df0,_0x558faf,_0xf00e96){return function(_0x33433d){return new Promise(function(_0x26f6cd,_0x130b7b){var _0x12ebcd={'method':_0x9830('0x13'),'uri':_0xf00e96+_0x9830('0xa'),'json':!![]};_0x12ebcd[_0x9830('0xb')]=_0x558faf;logger[_0x9830('0x14')](_0x9830('0x15'));return rp(_0x12ebcd)['then'](function(_0x31f5d7){if(_0x31f5d7){var _0x77e995=_0x31f5d7[_0x9830('0x16')];var _0x2ac66a=![];var _0x58e7ea=null;if(_0x33433d[_0x9830('0x17')]!==null){logger[_0x9830('0x14')]('Getting\x20user\x20with\x20email',_0x33433d['agentEmail']);_0x33433d[_0x9830('0x18')]=_0x33433d[_0x9830('0x17')];for(_0x58e7ea=0x0;_0x58e7ea<_0x77e995[_0x9830('0xe')];_0x58e7ea++){if(_0x77e995[_0x58e7ea][_0x9830('0xf')]===_0x33433d[_0x9830('0x17')]){_0x2ac66a=!![];_0x33433d[_0x9830('0x19')]=_0x77e995[_0x58e7ea]['id'];logger[_0x9830('0x14')](_0x9830('0x1a'),_0x33433d[_0x9830('0x19')]);}}}if(!_0x2ac66a){logger[_0x9830('0x14')](_0x9830('0x1b'));_0x33433d[_0x9830('0x18')]=_0x33433d[_0x9830('0x1c')];_0x33433d[_0x9830('0x19')]=_0x33433d[_0x9830('0x10')];_0x2ac66a=!![];}if(_0x2ac66a){_0x26f6cd(_0x33433d);}else{_0x130b7b({'statusCode':0x194,'message':_0x9830('0x11')});}}else{_0x130b7b({'statusCode':0x194,'message':_0x9830('0x11')});}})[_0x9830('0x12')](function(_0x3e05bc){logger[_0x9830('0x1d')]('['+[_0x3a7df0[_0x9830('0x1e')]()]+']',_0x3e05bc[_0x9830('0x1f')]);_0x130b7b(_0x3e05bc);});});};}function searchContact(_0x51a1c0,_0x1da865,_0x50aecc,_0x55e987){return new Promise(function(_0x30423d,_0x441d9c){var _0x1b6419={'method':_0x9830('0x13'),'headers':_0x1da865,'uri':_0x51a1c0+_0x9830('0x20')+_0x55e987+_0x9830('0x21')+_0x50aecc+'&entities=contact','json':!![]};rp(_0x1b6419)['then'](function(_0x2b6954){var _0x322b9a=_['find'](_0x2b6954[_0x9830('0x22')]['contacts'],[_0x50aecc,_0x55e987]);_0x30423d(_0x322b9a);})[_0x9830('0x12')](function(_0x4b1ff8){_0x441d9c(_0x4b1ff8);});});}function getEndUser(_0x4b1cb1,_0xf4707f,_0x2ad7e2){return function(_0x3caf8a){return new Promise(function(_0x1fa06e,_0x59a939){logger[_0x9830('0x14')](util[_0x9830('0x23')](_0x9830('0x24'),_0x3caf8a['contactNumber']));searchContact(_0x2ad7e2,_0xf4707f,_0x9830('0x25'),_0x3caf8a[_0x9830('0x26')])['then'](function(_0x9343b){if(_0x9343b){_0x3caf8a[_0x9830('0x27')]=_0x9343b['id'];logger[_0x9830('0x14')]('Contact\x20found\x20mobile_number:',_0x3caf8a[_0x9830('0x27')]);return _0x1fa06e(_0x3caf8a);}searchContact(_0x2ad7e2,_0xf4707f,_0x9830('0x28'),_0x3caf8a[_0x9830('0x26')])[_0x9830('0xd')](function(_0x117e76){if(_0x117e76){_0x3caf8a[_0x9830('0x27')]=_0x117e76['id'];logger['info'](_0x9830('0x29'),_0x3caf8a[_0x9830('0x27')]);return _0x1fa06e(_0x3caf8a);}createEndUser(_0x3caf8a,_0x4b1cb1,_0xf4707f,_0x2ad7e2)[_0x9830('0xd')](function(_0x1e107d){logger['info']('Contact\x20created:',_0x1e107d['endUserId']);return _0x1fa06e(_0x1e107d);});});})['catch'](function(_0x40a844){_0x59a939(_0x40a844);});});};}function createEndUser(_0xbbb044,_0x33a643,_0x3a4820,_0xfd1979){return new Promise(function(_0x1a88d2,_0x7183f0){var _0x28e272=moment();var _0x285cb6={'method':'POST','uri':_0xfd1979+'/api/contacts','body':{'contact':{'last_name':_0xbbb044[_0x9830('0x26')],'work_number':_0xbbb044['contactNumber'],'mobile_number':_0xbbb044[_0x9830('0x26')],'owner_id':_0xbbb044[_0x9830('0x19')],'created_at':_0x28e272[_0x9830('0x23')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x285cb6['headers']=_0x3a4820;logger[_0x9830('0x14')](_0x9830('0x2a'));return rp(_0x285cb6)[_0x9830('0xd')](function(_0x11ef76){_0xbbb044[_0x9830('0x27')]=_0x11ef76[_0x9830('0x2b')]['id'];_0x1a88d2(_0xbbb044);})[_0x9830('0x12')](function(_0x1782fc){logger[_0x9830('0x1d')]('['+[_0x33a643['toUpperCase']()]+']',_0x1782fc['message']);_0x7183f0(_0x1782fc[_0x9830('0x1f')]);});});}function getTicket(_0xe79c6c,_0x338c69,_0x2f3734,_0x11eb08,_0x245ff0){return function(_0x4aaf59){logger[_0x9830('0x14')](_0x9830('0x2c'));return new Promise(function(_0x1423a1,_0x38f2a1){var _0x43b6bc=moment();var _0x22a44b={'method':_0x9830('0x2d'),'uri':_0x2f3734+_0x9830('0x2e'),'body':{'title':intUtil['getString'](_0x11eb08[_0x9830('0x2f')],_0x245ff0,'\x20'),'description':intUtil['getString'](_0x11eb08[_0x9830('0x30')],_0x245ff0,'\x0a'),'owner_id':_0x4aaf59[_0x9830('0x19')],'creater_id':_0x4aaf59[_0x9830('0x10')],'targetable_id':_0x4aaf59[_0x9830('0x27')],'targetable_type':_0x9830('0x31'),'created_at':_0x43b6bc['format'](_0x9830('0x32')),'due_date':_0x43b6bc[_0x9830('0x33')](0x1e,'m')[_0x9830('0x23')](_0x9830('0x32'))},'json':!![]};_0x22a44b[_0x9830('0xb')]=_0x338c69;return rp(_0x22a44b)['then'](function(_0x51c78e){_0x4aaf59['ticketId']=_0x51c78e[_0x9830('0x34')]['id'];logger[_0x9830('0x14')](_0x9830('0x35'),_0x4aaf59[_0x9830('0x36')]);_0x1423a1(_0x4aaf59);})[_0x9830('0x12')](function(_0xd285cc){logger[_0x9830('0x1d')]('['+[_0xe79c6c['toUpperCase']()]+']',_0xd285cc['message']);_0x38f2a1(_0xd285cc[_0x9830('0x1f')]);});});};}function emit(_0x269496,_0x3b71d9,_0x2504b7){var _0x5359d5={'uri':_0x269496+_0x9830('0x37')+_0x2504b7};io['to'](util['format']('user:%s',_0x3b71d9))[_0x9830('0x38')](_0x9830('0x39'),_0x5359d5);}exports['cs']=function(_0x251cb6,_0x573c5c,_0x92cbee,_0x138a75,_0x57092f,_0x298854,_0x4ba536,_0x37075b){var _0x221a29={};var _0x29f0a1={'Authorization':_0x9830('0x3a')+_0x298854[_0x9830('0x3b')]};_0x298854[_0x9830('0x3c')]=intUtil['stripTrailingSlash'](_0x298854[_0x9830('0x3c')]);_0x298854[_0x9830('0x3d')]=intUtil[_0x9830('0x3e')](_0x298854[_0x9830('0x3d')]);var _0x18614a=_0x298854[_0x9830('0x3c')];_0x221a29[_0x9830('0x1c')]=_0x298854['username'];_0x221a29[_0x9830('0x26')]=_0x37075b[_0x9830('0x3f')]()===_0x9830('0x40')?_0x573c5c['destcalleridnum']:_0x573c5c[_0x9830('0x41')];_0x221a29[_0x9830('0x42')]=_0x37075b===_0x9830('0x43')||_0x37075b===_0x9830('0x44')?_0x9830('0x43'):_0x9830('0x40');if(_0x138a75){_0x221a29[_0x9830('0x17')]=_0x138a75[_0x9830('0xf')];}var _0x2b06cc=util[_0x9830('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x298854[_0x9830('0x3d')],_0x573c5c[_0x9830('0x45')],md5(_0x573c5c[_0x9830('0x45')]));if(_0x57092f&&_0x57092f[_0x9830('0x46')]){logger['info'](_0x9830('0x47'),'Recording\x20is\x20enabled!');_0x573c5c['recordingURL']=_0x2b06cc;}else if(_0x4ba536&&_0x4ba536['recordingFormat']&&_0x4ba536[_0x9830('0x48')]!=='none'){logger[_0x9830('0x14')](_0x9830('0x49'),_0x9830('0x4a'));_0x573c5c[_0x9830('0x4b')]=_0x2b06cc;}else{_0x573c5c[_0x9830('0x4b')]='';}return getAdminId(_0x221a29,_0x37075b,_0x29f0a1,_0x18614a)[_0x9830('0xd')](getUser(_0x37075b,_0x29f0a1,_0x18614a))[_0x9830('0xd')](getEndUser(_0x37075b,_0x29f0a1,_0x18614a))[_0x9830('0xd')](getTicket(_0x37075b,_0x29f0a1,_0x18614a,_0x92cbee,_0x573c5c))[_0x9830('0xd')](function(_0x90f377){logger[_0x9830('0x14')](util[_0x9830('0x23')](_0x9830('0x4c'),_0x90f377[_0x9830('0x36')]));if(_0x37075b!==_0x9830('0x44')){logger[_0x9830('0x14')]('['+[_0x37075b['toUpperCase']()]+']',_0x9830('0x4d'));emit(_0x18614a,_0x138a75[_0x9830('0x4e')],_0x90f377['endUserId']);}})[_0x9830('0x12')](function(_0x18bee9){logger[_0x9830('0x1d')]('['+[_0x37075b['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x9830('0x4f')](_0x18bee9,{'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 91123fb..683c0ba 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 _0xbb80=['freshsales','../../../../config/logger','error','[EXEC]','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','vtiger','dynamics365','servicenow','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','sugarcrm','zoho','desk'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbb80,0x11c));var _0x0bb8=function(_0x37e5ee,_0x2bc3d7){_0x37e5ee=_0x37e5ee-0x0;var _0x4d9af6=_0xbb80[_0x37e5ee];return _0x4d9af6;};'use strict';var _=require(_0x0bb8('0x0'));var util=require(_0x0bb8('0x1'));var zendesk=require(_0x0bb8('0x2'));var salesforce=require(_0x0bb8('0x3'));var sugarcrm=require(_0x0bb8('0x4'));var freshdesk=require(_0x0bb8('0x5'));var zoho=require('./zoho');var desk=require(_0x0bb8('0x6'));var vtiger=require(_0x0bb8('0x7'));var servicenow=require(_0x0bb8('0x8'));var dynamics365=require(_0x0bb8('0x9'));var freshsales=require(_0x0bb8('0xa'));var integrations=[_0x0bb8('0xb'),_0x0bb8('0xc'),'sugarcrm',_0x0bb8('0xd'),'zoho','desk',_0x0bb8('0xe'),_0x0bb8('0xf'),'freshsales',_0x0bb8('0x10')];exports['exec']=function(_0x34dd07,_0x656af1,_0x3abe31,_0x2da3cc,_0x53b9b5,_0x527b9c){if(_0x3abe31){if(_[_0x0bb8('0x11')](integrations,_0x34dd07[_0x0bb8('0x12')][_0x0bb8('0x13')]())){try{var _0xd9b11d=null;var _0x543d7a='';var _0x1f1719=_0x3abe31[_0x34dd07[_0x0bb8('0x12')][_0x0bb8('0x13')]()];if(_0x1f1719){var _0x447622=_0x1f1719[_0x34dd07[_0x0bb8('0x14')]];if(_0x447622){var _0x4cfe28=_[_0x0bb8('0x15')](_0x447622[_0x0bb8('0x16')],{'id':parseInt(_0x34dd07[_0x0bb8('0x17')],0xa)});if(_0x4cfe28){if(_0x2da3cc){if(_0x53b9b5&&_0x656af1[_0x0bb8('0x18')]){_0x543d7a=_0x0bb8('0x18');}else if(_0x656af1[_0x0bb8('0x19')]){_0x543d7a='outbound';}else{console[_0x0bb8('0x1a')](_0x0bb8('0x1b'),_0x656af1);}}else{_0x543d7a='unmanaged';}switch(_0x34dd07['data1']['toLowerCase']()){case'zendesk':zendesk[_0x543d7a](_0x34dd07,_0x656af1,_0x4cfe28,_0x2da3cc,_0x53b9b5,_0x447622,_0x527b9c);break;case _0x0bb8('0xc'):salesforce[_0x543d7a](_0x34dd07,_0x656af1,_0x4cfe28,_0x2da3cc,_0x53b9b5,_0x447622,_0x527b9c);break;case _0x0bb8('0x1c'):sugarcrm[_0x543d7a](_0x34dd07,_0x656af1,_0x4cfe28,_0x2da3cc,_0x53b9b5,_0x447622,_0x527b9c);break;case'freshdesk':freshdesk[_0x543d7a](_0x34dd07,_0x656af1,_0x4cfe28,_0x2da3cc,_0x53b9b5,_0x447622,_0x527b9c);break;case _0x0bb8('0x1d'):zoho[_0x543d7a](_0x34dd07,_0x656af1,_0x4cfe28,_0x2da3cc,_0x53b9b5,_0x447622,_0x527b9c);break;case _0x0bb8('0x1e'):desk[_0x543d7a](_0x34dd07,_0x656af1,_0x4cfe28,_0x2da3cc,_0x53b9b5,_0x447622,_0x527b9c);break;case _0x0bb8('0xe'):vtiger[_0x543d7a](_0x34dd07,_0x656af1,_0x4cfe28,_0x2da3cc,_0x53b9b5,_0x447622,_0x527b9c);break;case _0x0bb8('0x1f'):freshsales['cs'](_0x34dd07,_0x656af1,_0x4cfe28,_0x2da3cc,_0x53b9b5,_0x447622,_0x527b9c,_0x543d7a);break;case'servicenow':servicenow['cs'](_0x34dd07,_0x656af1,_0x4cfe28,_0x2da3cc,_0x53b9b5,_0x447622,_0x527b9c,_0x543d7a);break;case'dynamics365':dynamics365['cs'](_0x34dd07,_0x656af1,_0x4cfe28,_0x2da3cc,_0x53b9b5,_0x447622,_0x527b9c,_0x543d7a);break;default:console['log']('unknown\x20integration');}}else{_0xd9b11d=require(_0x0bb8('0x20'))(_0x34dd07[_0x0bb8('0x12')][_0x0bb8('0x13')]());_0xd9b11d[_0x0bb8('0x21')]('[EXEC]',util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x34dd07[_0x0bb8('0x12')]['toLowerCase'](),_0x34dd07[_0x0bb8('0x17')]));}}else{_0xd9b11d=require('../../../../config/logger')(_0x34dd07[_0x0bb8('0x12')][_0x0bb8('0x13')]());_0xd9b11d[_0x0bb8('0x21')](_0x0bb8('0x22'),util['format']('%s\x20account\x20#%s\x20not\x20found',_0x34dd07[_0x0bb8('0x12')][_0x0bb8('0x13')](),_0x34dd07[_0x0bb8('0x14')]));}}else{}}catch(_0x239c5d){console[_0x0bb8('0x21')](_0x239c5d);}}}}; \ No newline at end of file +var _0xbdf6=['format','[EXEC]','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./freshsales','salesforce','sugarcrm','zoho','vtiger','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','routeId','zendesk','freshdesk','log','../../../../config/logger','error'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xbdf6,0x1d3));var _0x6bdf=function(_0x40e1cd,_0xec25e8){_0x40e1cd=_0x40e1cd-0x0;var _0x2349a3=_0xbdf6[_0x40e1cd];return _0x2349a3;};'use strict';var _=require('lodash');var util=require(_0x6bdf('0x0'));var zendesk=require(_0x6bdf('0x1'));var salesforce=require(_0x6bdf('0x2'));var sugarcrm=require(_0x6bdf('0x3'));var freshdesk=require(_0x6bdf('0x4'));var zoho=require('./zoho');var desk=require(_0x6bdf('0x5'));var vtiger=require(_0x6bdf('0x6'));var servicenow=require(_0x6bdf('0x7'));var dynamics365=require('./dynamics365');var freshsales=require(_0x6bdf('0x8'));var integrations=['zendesk',_0x6bdf('0x9'),_0x6bdf('0xa'),'freshdesk',_0x6bdf('0xb'),'desk',_0x6bdf('0xc'),'dynamics365',_0x6bdf('0xd'),_0x6bdf('0xe')];exports[_0x6bdf('0xf')]=function(_0x118a4b,_0x208f4c,_0x1ca291,_0x217637,_0x3df60e,_0x473a2f){if(_0x1ca291){if(_[_0x6bdf('0x10')](integrations,_0x118a4b[_0x6bdf('0x11')]['toLowerCase']())){try{var _0x47a078=null;var _0x59b2ad='';var _0x9787d=_0x1ca291[_0x118a4b[_0x6bdf('0x11')][_0x6bdf('0x12')]()];if(_0x9787d){var _0x2bcc3e=_0x9787d[_0x118a4b[_0x6bdf('0x13')]];if(_0x2bcc3e){var _0x2433ef=_[_0x6bdf('0x14')](_0x2bcc3e[_0x6bdf('0x15')],{'id':parseInt(_0x118a4b[_0x6bdf('0x16')],0xa)});if(_0x2433ef){if(_0x217637){if(_0x3df60e&&_0x208f4c['queue']){_0x59b2ad='queue';}else if(_0x208f4c[_0x6bdf('0x17')]){_0x59b2ad='outbound';}else{console['log']('EVENT\x20UNKNOWN',_0x208f4c);}}else{_0x59b2ad='unmanaged';}switch(_0x118a4b[_0x6bdf('0x11')]['toLowerCase']()){case _0x6bdf('0x18'):zendesk[_0x59b2ad](_0x118a4b,_0x208f4c,_0x2433ef,_0x217637,_0x3df60e,_0x2bcc3e,_0x473a2f);break;case _0x6bdf('0x9'):salesforce[_0x59b2ad](_0x118a4b,_0x208f4c,_0x2433ef,_0x217637,_0x3df60e,_0x2bcc3e,_0x473a2f);break;case'sugarcrm':sugarcrm[_0x59b2ad](_0x118a4b,_0x208f4c,_0x2433ef,_0x217637,_0x3df60e,_0x2bcc3e,_0x473a2f);break;case _0x6bdf('0x19'):freshdesk[_0x59b2ad](_0x118a4b,_0x208f4c,_0x2433ef,_0x217637,_0x3df60e,_0x2bcc3e,_0x473a2f);break;case _0x6bdf('0xb'):zoho[_0x59b2ad](_0x118a4b,_0x208f4c,_0x2433ef,_0x217637,_0x3df60e,_0x2bcc3e,_0x473a2f);break;case'desk':desk[_0x59b2ad](_0x118a4b,_0x208f4c,_0x2433ef,_0x217637,_0x3df60e,_0x2bcc3e,_0x473a2f);break;case'vtiger':vtiger[_0x59b2ad](_0x118a4b,_0x208f4c,_0x2433ef,_0x217637,_0x3df60e,_0x2bcc3e,_0x473a2f);break;case _0x6bdf('0xd'):freshsales['cs'](_0x118a4b,_0x208f4c,_0x2433ef,_0x217637,_0x3df60e,_0x2bcc3e,_0x473a2f,_0x59b2ad);break;case _0x6bdf('0xe'):servicenow['cs'](_0x118a4b,_0x208f4c,_0x2433ef,_0x217637,_0x3df60e,_0x2bcc3e,_0x473a2f,_0x59b2ad);break;case'dynamics365':dynamics365['cs'](_0x118a4b,_0x208f4c,_0x2433ef,_0x217637,_0x3df60e,_0x2bcc3e,_0x473a2f,_0x59b2ad);break;default:console[_0x6bdf('0x1a')]('unknown\x20integration');}}else{_0x47a078=require(_0x6bdf('0x1b'))(_0x118a4b['data1'][_0x6bdf('0x12')]());_0x47a078[_0x6bdf('0x1c')]('[EXEC]',util[_0x6bdf('0x1d')]('%s\x20configuration\x20#%s\x20not\x20found',_0x118a4b[_0x6bdf('0x11')][_0x6bdf('0x12')](),_0x118a4b[_0x6bdf('0x16')]));}}else{_0x47a078=require('../../../../config/logger')(_0x118a4b[_0x6bdf('0x11')]['toLowerCase']());_0x47a078[_0x6bdf('0x1c')](_0x6bdf('0x1e'),util['format']('%s\x20account\x20#%s\x20not\x20found',_0x118a4b[_0x6bdf('0x11')][_0x6bdf('0x12')](),_0x118a4b[_0x6bdf('0x13')]));}}else{}}catch(_0x3e301d){console[_0x6bdf('0x1c')](_0x3e301d);}}}}; \ 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 59ba2ce..794c0a2 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 _0xb01d=['ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','socket.io-emitter','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','WhatId','Case','contact','ContactId','AccountId','leadId','info','sobject','isNil','validateEmail','User','find','execute','then','length','Name','identity','resolve','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','Phone','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','format','Company','No\x20Company','upperFirst','create','forEach','includes','picklist','idField','content','toString','type','variable','variableName','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','username','Connection\x20established.','queue','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','util'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xb01d,0x100));var _0xdb01=function(_0x16b1a4,_0x451c0c){_0x16b1a4=_0x16b1a4-0x0;var _0xeb0aac=_0xb01d[_0x16b1a4];return _0xeb0aac;};'use strict';var _=require(_0xdb01('0x0'));var rp=require(_0xdb01('0x1'));var moment=require(_0xdb01('0x2'));var BPromise=require('bluebird');var md5=require(_0xdb01('0x3'));var jsforce=require(_0xdb01('0x4'));var util=require(_0xdb01('0x5'));var Redis=require(_0xdb01('0x6'));var intUtil=require(_0xdb01('0x7'));var config=require(_0xdb01('0x8'));var logger=require(_0xdb01('0x9'))(_0xdb01('0xa'));config[_0xdb01('0xb')]=_['defaults'](config[_0xdb01('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xdb01('0xc'))(new Redis(config[_0xdb01('0xb')]));function emit(_0x5e581b,_0x5a06f0,_0x3673a5){io['to'](_0x5e581b)['emit'](_0x5a06f0,_0x3673a5);}function getTicket(_0x310982,_0x571a81,_0x49215e,_0xcd6205,_0x3e61d6,_0x352be7,_0x1edb07,_0xbb79dd){var _0x22d38c=Object['assign']({},{'OwnerId':_0x571a81['id'],'Subject':intUtil[_0xdb01('0xd')](_0xcd6205[_0xdb01('0xe')],_0x3e61d6,'\x20'),'Description':intUtil[_0xdb01('0xd')](_0xcd6205[_0xdb01('0xf')],_0x3e61d6,'\x0a')},getCustomFields(_0x352be7,_0x3e61d6));if(_0x49215e){if(_0xcd6205[_0xdb01('0x10')]===_0xdb01('0x11')){_0x22d38c[_0xdb01('0x12')]=moment[_0xdb01('0x13')]();_0x22d38c[_0xdb01('0x14')]=![];_0x22d38c[_0xdb01('0x15')]=![];if(_0x49215e[_0xdb01('0x16')]==='contact'||_0x49215e['endUserType']===_0xdb01('0x17')){_0x22d38c[_0xdb01('0x18')]=_0x49215e['id'];}else if(_0x49215e[_0xdb01('0x16')]===_0xdb01('0x19')){_0x22d38c[_0xdb01('0x1a')]=_0x49215e['id'];}}else if(_0xcd6205[_0xdb01('0x10')]===_0xdb01('0x1b')){if(_0x49215e['endUserType']===_0xdb01('0x1c')){_0x22d38c[_0xdb01('0x1d')]=_0x49215e['id'];}else if(_0x49215e[_0xdb01('0x16')]==='account'){_0x22d38c[_0xdb01('0x1e')]=_0x49215e['id'];}else if(_0x49215e[_0xdb01('0x16')]===_0xdb01('0x17')&&_0xcd6205[_0xdb01('0x1f')]){_0x22d38c[_0xcd6205[_0xdb01('0x1f')]]=_0x49215e['id'];}else{logger[_0xdb01('0x20')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x1edb07[_0xdb01('0x21')](_0xcd6205['ticketType'])['create'](_0x22d38c);}function getUser(_0xcd9d2e,_0x36fe8a,_0x1826f3){if(!_[_0xdb01('0x22')](_0x36fe8a)&&intUtil[_0xdb01('0x23')](_0x36fe8a)){var _0x3dc03d={'Email':_0x36fe8a};var _0x1900ba={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1826f3[_0xdb01('0x21')](_0xdb01('0x24'))[_0xdb01('0x25')](_0x3dc03d,_0x1900ba)[_0xdb01('0x26')]()[_0xdb01('0x27')](function(_0x3c17c4){if(_0x3c17c4[_0xdb01('0x28')]){var _0xdc3e93=_[_0xdb01('0x25')](_0x3c17c4,function(_0x203677){return _0x203677['Email']===_0x36fe8a;});if(_0xdc3e93){logger[_0xdb01('0x20')]('Agent\x20%s\x20found.',_0x36fe8a);return BPromise['resolve']({'id':_0xdc3e93['Id'],'name':_0xdc3e93[_0xdb01('0x29')]});}}else{logger[_0xdb01('0x20')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x36fe8a);return _0x1826f3[_0xdb01('0x2a')]()['then'](function(_0x4411a8){return BPromise[_0xdb01('0x2b')]({'id':_0x4411a8[_0xdb01('0x2c')],'name':_0x4411a8[_0xdb01('0x2d')]});});}});}else{logger[_0xdb01('0x20')](_0xdb01('0x2e'),_0x36fe8a);return _0x1826f3[_0xdb01('0x2a')]()[_0xdb01('0x27')](function(_0x450600){return BPromise[_0xdb01('0x2b')]({'id':_0x450600[_0xdb01('0x2c')],'name':_0x450600[_0xdb01('0x2d')]});});}}function getEndUser(_0x742b0f,_0x5db565,_0x368fdf,_0x30b490,_0x56b153){var _0x35340f={'$or':{'Phone':_0x30b490}};var _0x5449e3={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xdb01('0x2b')]()[_0xdb01('0x27')](function(){logger[_0xdb01('0x20')](_0xdb01('0x2f'),_0x30b490,_0x5db565[_0xdb01('0x30')]);switch(_0x5db565[_0xdb01('0x30')]){case _0xdb01('0x31'):var _0x480032=_[_0xdb01('0x32')](_0x35340f);if(_0x5db565[_0xdb01('0x33')]){var _0x3e1461={};_0x3e1461[_0x5db565[_0xdb01('0x33')]]=_0x30b490;_[_0xdb01('0x34')](_0x480032[_0xdb01('0x35')],_0x3e1461);}return _0x56b153['sobject']('Contact')['find'](_0x480032,_0x5449e3)[_0xdb01('0x26')]()[_0xdb01('0x27')](function(_0x172038){if(_0x172038&&_0x172038['length']){return _0x172038;}else{var _0x45f2ae=_['cloneDeep'](_0x35340f);if(_0x5db565[_0xdb01('0x36')]){var _0xf95af9={};_0xf95af9[_0x5db565[_0xdb01('0x36')]]=_0x30b490;_[_0xdb01('0x34')](_0x45f2ae['$or'],_0xf95af9);}return _0x56b153['sobject'](_0xdb01('0x37'))['find'](_0x45f2ae,_0x5449e3);}});case _0xdb01('0x38'):var _0x530094=_[_0xdb01('0x32')](_0x35340f);if(_0x5db565[_0xdb01('0x39')]){var _0x3e1461={};_0x3e1461[_0x5db565[_0xdb01('0x39')]]=_0x30b490;_[_0xdb01('0x34')](_0x530094[_0xdb01('0x35')],_0x3e1461);}return _0x56b153[_0xdb01('0x21')](_0xdb01('0x3a'))['find'](_0x530094,_0x5449e3)[_0xdb01('0x26')]()[_0xdb01('0x27')](function(_0x102e3a){if(_0x102e3a&&_0x102e3a['length']){return _0x102e3a;}else{var _0x3ece30=_['cloneDeep'](_0x35340f);if(_0x5db565['additionalSearchContact']){var _0x4dec48={};_0x4dec48[_0x5db565[_0xdb01('0x33')]]=_0x30b490;_[_0xdb01('0x34')](_0x3ece30[_0xdb01('0x35')],_0x4dec48);}return _0x56b153[_0xdb01('0x21')](_0xdb01('0x3b'))[_0xdb01('0x25')](_0x3ece30,_0x5449e3)[_0xdb01('0x27')](function(_0x52abab){if(_0x52abab&&_0x52abab[_0xdb01('0x28')]){return _0x52abab;}else{var _0x219eb2=_['cloneDeep'](_0x35340f);if(_0x5db565[_0xdb01('0x36')]){var _0x399e53={};_0x399e53[_0x5db565[_0xdb01('0x36')]]=_0x30b490;_[_0xdb01('0x34')](_0x219eb2[_0xdb01('0x35')],_0x399e53);}return _0x56b153['sobject'](_0xdb01('0x37'))[_0xdb01('0x25')](_0x219eb2,_0x5449e3);}});}});case _0xdb01('0x1c'):var _0x480032=_['cloneDeep'](_0x35340f);if(_0x5db565[_0xdb01('0x33')]){var _0x3e1461={};_0x3e1461[_0x5db565[_0xdb01('0x33')]]=_0x30b490;_[_0xdb01('0x34')](_0x480032['$or'],_0x3e1461);}return _0x56b153[_0xdb01('0x21')](_0xdb01('0x3b'))[_0xdb01('0x25')](_0x480032,_0x5449e3)[_0xdb01('0x26')]();case'lead':var _0x2a63ff=_['cloneDeep'](_0x35340f);if(_0x5db565[_0xdb01('0x36')]){var _0x3e1461={};_0x3e1461[_0x5db565[_0xdb01('0x36')]]=_0x30b490;_['merge'](_0x2a63ff[_0xdb01('0x35')],_0x3e1461);}return _0x56b153[_0xdb01('0x21')](_0xdb01('0x37'))[_0xdb01('0x25')](_0x2a63ff,_0x5449e3);case _0xdb01('0x19'):var _0x530094=_[_0xdb01('0x32')](_0x35340f);if(_0x5db565[_0xdb01('0x39')]){var _0x3e1461={};_0x3e1461[_0x5db565['additionalSearchAccount']]=_0x30b490;_[_0xdb01('0x34')](_0x530094[_0xdb01('0x35')],_0x3e1461);}return _0x56b153[_0xdb01('0x21')]('Account')[_0xdb01('0x25')](_0x530094,_0x5449e3);default:return null;}})[_0xdb01('0x27')](function(_0x35ba99){if(_0x35ba99&&_0x35ba99[_0xdb01('0x28')]){var _0xe241f5=_[_0xdb01('0x3c')](_0x35ba99);if(_0xe241f5){return BPromise[_0xdb01('0x2b')]({'id':_0xe241f5['Id'],'name':_0xe241f5[_0xdb01('0x29')],'phone':_0xe241f5[_0xdb01('0x3d')],'endUserType':_0xe241f5[_0xdb01('0x3e')]['type'][_0xdb01('0x3f')]()});}}})[_0xdb01('0x27')](function(_0x239233){if(_0x239233){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x239233['endUserType'],_0x30b490);return BPromise[_0xdb01('0x2b')](_0x239233);}else{logger[_0xdb01('0x20')](_0xdb01('0x40'),_0x30b490);var _0x4df9aa={'Phone':_0x30b490};if(_0x5db565[_0xdb01('0x41')]){if(_0x5db565[_0xdb01('0x41')]===_0xdb01('0x1c')){logger[_0xdb01('0x20')](_0xdb01('0x42'),_0x30b490,_0x5db565['moduleCreate']);_0x4df9aa[_0xdb01('0x43')]=_0x368fdf!==_0xdb01('0x44')?_0x368fdf:util['format'](_0xdb01('0x45'),_0x30b490);}else if(_0x5db565[_0xdb01('0x41')]===_0xdb01('0x17')){logger[_0xdb01('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x30b490,_0x5db565[_0xdb01('0x41')]);_0x4df9aa['LastName']=_0x368fdf!==_0xdb01('0x44')?_0x368fdf:util[_0xdb01('0x46')](_0xdb01('0x45'),_0x30b490);_0x4df9aa[_0xdb01('0x47')]=_0xdb01('0x48');}else if(_0x5db565[_0xdb01('0x41')]===_0xdb01('0x19')){logger[_0xdb01('0x20')](_0xdb01('0x42'),_0x30b490,_0x5db565[_0xdb01('0x41')]);_0x4df9aa[_0xdb01('0x29')]=_0x368fdf!==_0xdb01('0x44')?_0x368fdf:util[_0xdb01('0x46')]('Caller\x20-\x20%s',_0x30b490);}else{return null;}}return _0x56b153[_0xdb01('0x21')](_[_0xdb01('0x49')](_0x5db565[_0xdb01('0x41')]))[_0xdb01('0x4a')](_0x4df9aa)[_0xdb01('0x27')](function(_0x13aafc){return BPromise[_0xdb01('0x2b')]({'id':_0x13aafc['id'],'endUserType':_0x5db565[_0xdb01('0x41')]});});}});}function getCustomFields(_0x6da304,_0x301273){var _0x237817={};if(_0x6da304[_0xdb01('0x28')]>0x0){_[_0xdb01('0x4b')](_0x6da304,function(_0x3e3d79){if(_[_0xdb01('0x4c')](['string',_0xdb01('0x4d')],_0x3e3d79['type'])&&_0x3e3d79[_0xdb01('0x4e')]){_0x237817[_0x3e3d79[_0xdb01('0x4e')]]=_0x3e3d79[_0xdb01('0x4f')][_0xdb01('0x50')]();}else if(_0x3e3d79[_0xdb01('0x51')]===_0xdb01('0x52')&&_0x3e3d79[_0xdb01('0x53')]&&_0x3e3d79['idField']){_0x301273[_0x3e3d79['variableName']]&&(_0x237817[_0x3e3d79[_0xdb01('0x4e')]]=_0x301273[_0x3e3d79[_0xdb01('0x53')]][_0xdb01('0x50')]());}else if(_0x3e3d79[_0xdb01('0x51')]==='customVariable'&&_0x3e3d79[_0xdb01('0x54')]&&_0x3e3d79[_0xdb01('0x54')][_0xdb01('0x55')]&&_0x3e3d79['idField']){_0x301273[_0x3e3d79[_0xdb01('0x54')][_0xdb01('0x55')]['toLowerCase']()]&&(_0x237817[_0x3e3d79[_0xdb01('0x4e')]]=_0x301273[_0x3e3d79[_0xdb01('0x54')][_0xdb01('0x55')][_0xdb01('0x3f')]()]['toString']());}});}return _0x237817;}function getConnection(_0x213e5e){var _0x550145=_0x213e5e[_0xdb01('0x56')][_0xdb01('0x57')](_0x213e5e[_0xdb01('0x58')]);var _0x45de50=new jsforce[(_0xdb01('0x59'))]({'oauth2':{'loginUrl':_0x213e5e[_0xdb01('0x5a')]||_0xdb01('0x5b'),'clientId':_0x213e5e['clientId'],'clientSecret':_0x213e5e['clientSecret']}});return _0x45de50['login'](_0x213e5e[_0xdb01('0x5c')],_0x550145)['then'](function(){logger[_0xdb01('0x20')](_0xdb01('0x5d'));return _0x45de50;});}exports[_0xdb01('0x5e')]=function(_0x45cc7e,_0x48a1b7,_0x59b3c1,_0x4bcec7,_0x4ff845,_0x28fd57){var _0x4fc657,_0x311c67,_0x25d40c,_0x42ea44;_0x28fd57['serverUrl']=intUtil[_0xdb01('0x5f')](_0x28fd57['serverUrl']);_0x28fd57[_0xdb01('0x5a')]=intUtil[_0xdb01('0x5f')](_0x28fd57['remoteUri']);if(_0x4ff845&&_0x4ff845[_0xdb01('0x60')]){logger[_0xdb01('0x20')]('[QUEUE]',_0xdb01('0x61'));_0x48a1b7[_0xdb01('0x62')]=util[_0xdb01('0x46')](_0xdb01('0x63'),_0x28fd57[_0xdb01('0x64')],_0x48a1b7[_0xdb01('0x65')],md5(_0x48a1b7['uniqueid']));}else{_0x48a1b7[_0xdb01('0x62')]='';}return getConnection(_0x28fd57)['then'](function(_0x4b3f3f){_0x42ea44=_0x4b3f3f;return getUser(_0x28fd57,_0x4bcec7['email'],_0x42ea44);})[_0xdb01('0x27')](function(_0x146f04){_0x4fc657=_0x146f04;return getEndUser(_0x28fd57,_0x59b3c1,_0x48a1b7[_0xdb01('0x66')],_0x48a1b7['calleridnum'],_0x42ea44);})['then'](function(_0x5ddc9e){_0x311c67=_0x5ddc9e;return getTicket(_0x28fd57,_0x4fc657,_0x311c67,_0x59b3c1,_0x48a1b7,_0x59b3c1[_0xdb01('0x67')],_0x42ea44,_0xdb01('0x5e'));})[_0xdb01('0x27')](function(_0x253671){_0x25d40c=_0x253671;logger['info'](_0xdb01('0x68'),_0x25d40c['id']);logger[_0xdb01('0x20')](_0xdb01('0x69'),_0x25d40c['id'],_0x4bcec7['name'],_0x28fd57[_0xdb01('0x51')]);switch(_0x28fd57[_0xdb01('0x51')]){case _0xdb01('0x6a'):emit(util[_0xdb01('0x46')](_0xdb01('0x6b'),_0x4bcec7[_0xdb01('0x55')]),_0xdb01('0x6c'),{'recordId':_0x25d40c['id']});break;case _0xdb01('0x6d'):emit(util[_0xdb01('0x46')](_0xdb01('0x6b'),_0x4bcec7[_0xdb01('0x55')]),_0xdb01('0x6e'),{'uri':util[_0xdb01('0x46')]('%s/%s/e',_0x42ea44[_0xdb01('0x6f')],_0x25d40c['id'])});break;default:logger[_0xdb01('0x70')](_0xdb01('0x71'));}})[_0xdb01('0x72')](function(_0x5460f5){logger[_0xdb01('0x70')](_0xdb01('0x73'),_0x5460f5);});};exports['outbound']=function(_0x434204,_0x28fe4d,_0x1a6149,_0x17cfca,_0x336049,_0x411194,_0xd99471){var _0x4a8ac8,_0x13e240,_0x2f5b29,_0x5ded07;_0x411194[_0xdb01('0x64')]=intUtil[_0xdb01('0x5f')](_0x411194[_0xdb01('0x64')]);_0x411194[_0xdb01('0x5a')]=intUtil[_0xdb01('0x5f')](_0x411194[_0xdb01('0x5a')]);if(_0xd99471&&_0xd99471[_0xdb01('0x74')]&&_0xd99471[_0xdb01('0x74')]!==_0xdb01('0x75')){logger[_0xdb01('0x20')](_0xdb01('0x76'),_0xdb01('0x61'));_0x28fe4d[_0xdb01('0x62')]=util[_0xdb01('0x46')](_0xdb01('0x63'),_0x411194[_0xdb01('0x64')],_0x28fe4d[_0xdb01('0x65')],md5(_0x28fe4d[_0xdb01('0x65')]));}return getConnection(_0x411194)[_0xdb01('0x27')](function(_0x42d204){_0x5ded07=_0x42d204;return getUser(_0x411194,_0x17cfca[_0xdb01('0x77')],_0x5ded07);})[_0xdb01('0x27')](function(_0x25a905){_0x4a8ac8=_0x25a905;return getEndUser(_0x411194,_0x1a6149,_0x28fe4d[_0xdb01('0x78')],_0x28fe4d[_0xdb01('0x79')],_0x5ded07);})[_0xdb01('0x27')](function(_0x550ba7){_0x13e240=_0x550ba7;return getTicket(_0x411194,_0x4a8ac8,_0x13e240,_0x1a6149,_0x28fe4d,_0x1a6149[_0xdb01('0x67')],_0x5ded07,_0xdb01('0x7a'));})[_0xdb01('0x27')](function(_0x39ee78){_0x2f5b29=_0x39ee78;logger[_0xdb01('0x20')](_0xdb01('0x7b'),_0x2f5b29['id']);logger[_0xdb01('0x20')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2f5b29['id'],_0x17cfca[_0xdb01('0x55')],_0x411194[_0xdb01('0x51')]);switch(_0x411194['type']){case _0xdb01('0x6a'):emit(util[_0xdb01('0x46')]('user:%s',_0x17cfca['name']),_0xdb01('0x6c'),{'recordId':_0x2f5b29['id']});break;case'newTab':emit(util[_0xdb01('0x46')](_0xdb01('0x6b'),_0x17cfca[_0xdb01('0x55')]),'trigger:browser:url',{'uri':util[_0xdb01('0x46')]('%s/%s/e',_0x5ded07[_0xdb01('0x6f')],_0x2f5b29['id'])});break;default:logger[_0xdb01('0x70')](_0xdb01('0x76'),_0xdb01('0x7c'));}})['catch'](function(_0x446aab){logger[_0xdb01('0x70')](_0xdb01('0x76'),_0x446aab);});};exports[_0xdb01('0x7d')]=function(_0x5022a5,_0x76bfad,_0x458436,_0x1c3f6d,_0x151b4e,_0x467c38){var _0x50df6b,_0x399dfc,_0x2808e3,_0x32c315;_0x467c38[_0xdb01('0x64')]=intUtil['stripTrailingSlash'](_0x467c38[_0xdb01('0x64')]);_0x467c38[_0xdb01('0x5a')]=intUtil['stripTrailingSlash'](_0x467c38['remoteUri']);if(_0x151b4e&&_0x151b4e['monitor_format']){logger[_0xdb01('0x20')]('['+_0x76bfad[_0xdb01('0x7e')][_0xdb01('0x7f')]()+']',_0xdb01('0x61'));_0x76bfad[_0xdb01('0x62')]=util[_0xdb01('0x46')](_0xdb01('0x63'),_0x467c38[_0xdb01('0x64')],_0x76bfad[_0xdb01('0x65')],md5(_0x76bfad[_0xdb01('0x65')]));}else{_0x76bfad[_0xdb01('0x62')]='';}return getConnection(_0x467c38)[_0xdb01('0x27')](function(_0x32bf5d){_0x32c315=_0x32bf5d;if(!_[_0xdb01('0x22')](_0x1c3f6d)){return getUser(_0x467c38,_0x1c3f6d[_0xdb01('0x55')],_0x32c315);}else{return getUser(_0x467c38,null,_0x32c315);}})['then'](function(_0xf5a5c3){_0x50df6b=_0xf5a5c3;return getEndUser(_0x467c38,_0x458436,_0x76bfad['calleridname'],_0x76bfad[_0xdb01('0x80')],_0x32c315);})[_0xdb01('0x27')](function(_0x5dff34){_0x399dfc=_0x5dff34;return getTicket(_0x467c38,_0x50df6b,_0x399dfc,_0x458436,_0x76bfad,_0x458436[_0xdb01('0x67')],_0x32c315);})[_0xdb01('0x27')](function(_0x2a328d){_0x2808e3=_0x2a328d;logger['info']('['+_0x76bfad[_0xdb01('0x7e')][_0xdb01('0x7f')]()+_0xdb01('0x81'),_0x2808e3['id']);logger[_0xdb01('0x20')]('['+_0x76bfad['lastevent']['toUpperCase']()+_0xdb01('0x82'),_0x467c38[_0xdb01('0x51')]);})['catch'](function(_0x117381){logger[_0xdb01('0x70')]('['+_0x76bfad[_0xdb01('0x7e')][_0xdb01('0x7f')]()+']',_0x117381);});}; \ No newline at end of file +var _0xf925=['content','toString','variableName','Variable','name','password','concat','securityToken','remoteUri','clientId','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','[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','monitor_format','toUpperCase','calleridname','lastevent',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','jsforce','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','emit','assign','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','lead','WhoId','account','Case','endUserType','contact','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','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','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','execute','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','upperFirst','create','includes','string','idField'];(function(_0x58f032,_0x1ce454){var _0x480cdf=function(_0x522bfc){while(--_0x522bfc){_0x58f032['push'](_0x58f032['shift']());}};_0x480cdf(++_0x1ce454);}(_0xf925,0x127));var _0x5f92=function(_0x4ece58,_0x50922a){_0x4ece58=_0x4ece58-0x0;var _0x20d209=_0xf925[_0x4ece58];return _0x20d209;};'use strict';var _=require(_0x5f92('0x0'));var rp=require(_0x5f92('0x1'));var moment=require(_0x5f92('0x2'));var BPromise=require(_0x5f92('0x3'));var md5=require('md5');var jsforce=require(_0x5f92('0x4'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x5f92('0x5'));var config=require(_0x5f92('0x6'));var logger=require(_0x5f92('0x7'))(_0x5f92('0x8'));config[_0x5f92('0x9')]=_[_0x5f92('0xa')](config[_0x5f92('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x5f92('0xb'))(new Redis(config['redis']));function emit(_0x4e7251,_0x92d888,_0x370922){io['to'](_0x4e7251)[_0x5f92('0xc')](_0x92d888,_0x370922);}function getTicket(_0x141067,_0x330605,_0x45085d,_0x5b7da9,_0x154e44,_0x2b05b3,_0x42f700,_0x29ba49){var _0x286899=Object[_0x5f92('0xd')]({},{'OwnerId':_0x330605['id'],'Subject':intUtil[_0x5f92('0xe')](_0x5b7da9['Subjects'],_0x154e44,'\x20'),'Description':intUtil[_0x5f92('0xe')](_0x5b7da9[_0x5f92('0xf')],_0x154e44,'\x0a')},getCustomFields(_0x2b05b3,_0x154e44));if(_0x45085d){if(_0x5b7da9[_0x5f92('0x10')]===_0x5f92('0x11')){_0x286899[_0x5f92('0x12')]=moment[_0x5f92('0x13')]();_0x286899[_0x5f92('0x14')]=![];_0x286899['IsRecurrence']=![];if(_0x45085d['endUserType']==='contact'||_0x45085d['endUserType']===_0x5f92('0x15')){_0x286899[_0x5f92('0x16')]=_0x45085d['id'];}else if(_0x45085d['endUserType']===_0x5f92('0x17')){_0x286899['WhatId']=_0x45085d['id'];}}else if(_0x5b7da9[_0x5f92('0x10')]===_0x5f92('0x18')){if(_0x45085d[_0x5f92('0x19')]===_0x5f92('0x1a')){_0x286899[_0x5f92('0x1b')]=_0x45085d['id'];}else if(_0x45085d[_0x5f92('0x19')]==='account'){_0x286899['AccountId']=_0x45085d['id'];}else if(_0x45085d[_0x5f92('0x19')]===_0x5f92('0x15')&&_0x5b7da9[_0x5f92('0x1c')]){_0x286899[_0x5b7da9[_0x5f92('0x1c')]]=_0x45085d['id'];}else{logger[_0x5f92('0x1d')](_0x5f92('0x1e'));}}}return _0x42f700[_0x5f92('0x1f')](_0x5b7da9[_0x5f92('0x10')])['create'](_0x286899);}function getUser(_0x41ece5,_0x17beff,_0x534346){if(!_[_0x5f92('0x20')](_0x17beff)&&intUtil[_0x5f92('0x21')](_0x17beff)){var _0x1e9fc5={'Email':_0x17beff};var _0x4074f2={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x534346['sobject'](_0x5f92('0x22'))[_0x5f92('0x23')](_0x1e9fc5,_0x4074f2)['execute']()['then'](function(_0x30cca1){if(_0x30cca1['length']){var _0x175399=_[_0x5f92('0x23')](_0x30cca1,function(_0x1c6409){return _0x1c6409[_0x5f92('0x24')]===_0x17beff;});if(_0x175399){logger[_0x5f92('0x1d')](_0x5f92('0x25'),_0x17beff);return BPromise[_0x5f92('0x26')]({'id':_0x175399['Id'],'name':_0x175399[_0x5f92('0x27')]});}}else{logger[_0x5f92('0x1d')](_0x5f92('0x28'),_0x17beff);return _0x534346[_0x5f92('0x29')]()[_0x5f92('0x2a')](function(_0x5481bb){return BPromise[_0x5f92('0x26')]({'id':_0x5481bb[_0x5f92('0x2b')],'name':_0x5481bb[_0x5f92('0x2c')]});});}});}else{logger[_0x5f92('0x1d')](_0x5f92('0x28'),_0x17beff);return _0x534346[_0x5f92('0x29')]()[_0x5f92('0x2a')](function(_0x8513a4){return BPromise[_0x5f92('0x26')]({'id':_0x8513a4[_0x5f92('0x2b')],'name':_0x8513a4[_0x5f92('0x2c')]});});}}function getEndUser(_0x2648e6,_0x4e1d1c,_0xa4bcd1,_0x228659,_0x5c33d2){var _0x41e972={'$or':{'Phone':_0x228659}};var _0x2baa16={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x5f92('0x26')]()['then'](function(){logger['info'](_0x5f92('0x2d'),_0x228659,_0x4e1d1c['moduleSearch']);switch(_0x4e1d1c[_0x5f92('0x2e')]){case _0x5f92('0x2f'):var _0x138a59=_[_0x5f92('0x30')](_0x41e972);if(_0x4e1d1c[_0x5f92('0x31')]){var _0x244410={};_0x244410[_0x4e1d1c[_0x5f92('0x31')]]=_0x228659;_[_0x5f92('0x32')](_0x138a59[_0x5f92('0x33')],_0x244410);}return _0x5c33d2[_0x5f92('0x1f')](_0x5f92('0x34'))[_0x5f92('0x23')](_0x138a59,_0x2baa16)[_0x5f92('0x35')]()['then'](function(_0x56b97f){if(_0x56b97f&&_0x56b97f[_0x5f92('0x36')]){return _0x56b97f;}else{var _0x42dc31=_['cloneDeep'](_0x41e972);if(_0x4e1d1c[_0x5f92('0x37')]){var _0x94a480={};_0x94a480[_0x4e1d1c[_0x5f92('0x37')]]=_0x228659;_[_0x5f92('0x32')](_0x42dc31[_0x5f92('0x33')],_0x94a480);}return _0x5c33d2['sobject'](_0x5f92('0x38'))[_0x5f92('0x23')](_0x42dc31,_0x2baa16);}});case _0x5f92('0x39'):var _0x4ee326=_[_0x5f92('0x30')](_0x41e972);if(_0x4e1d1c[_0x5f92('0x3a')]){var _0x244410={};_0x244410[_0x4e1d1c['additionalSearchAccount']]=_0x228659;_[_0x5f92('0x32')](_0x4ee326[_0x5f92('0x33')],_0x244410);}return _0x5c33d2[_0x5f92('0x1f')](_0x5f92('0x3b'))[_0x5f92('0x23')](_0x4ee326,_0x2baa16)[_0x5f92('0x35')]()[_0x5f92('0x2a')](function(_0x31dd57){if(_0x31dd57&&_0x31dd57[_0x5f92('0x36')]){return _0x31dd57;}else{var _0x7a595d=_[_0x5f92('0x30')](_0x41e972);if(_0x4e1d1c[_0x5f92('0x31')]){var _0x591383={};_0x591383[_0x4e1d1c[_0x5f92('0x31')]]=_0x228659;_[_0x5f92('0x32')](_0x7a595d[_0x5f92('0x33')],_0x591383);}return _0x5c33d2[_0x5f92('0x1f')]('Contact')[_0x5f92('0x23')](_0x7a595d,_0x2baa16)['then'](function(_0x1bf378){if(_0x1bf378&&_0x1bf378['length']){return _0x1bf378;}else{var _0x3acff1=_[_0x5f92('0x30')](_0x41e972);if(_0x4e1d1c['additionalSearchLead']){var _0x49963e={};_0x49963e[_0x4e1d1c[_0x5f92('0x37')]]=_0x228659;_[_0x5f92('0x32')](_0x3acff1[_0x5f92('0x33')],_0x49963e);}return _0x5c33d2[_0x5f92('0x1f')]('Lead')[_0x5f92('0x23')](_0x3acff1,_0x2baa16);}});}});case _0x5f92('0x1a'):var _0x138a59=_[_0x5f92('0x30')](_0x41e972);if(_0x4e1d1c[_0x5f92('0x31')]){var _0x244410={};_0x244410[_0x4e1d1c['additionalSearchContact']]=_0x228659;_[_0x5f92('0x32')](_0x138a59[_0x5f92('0x33')],_0x244410);}return _0x5c33d2[_0x5f92('0x1f')](_0x5f92('0x34'))[_0x5f92('0x23')](_0x138a59,_0x2baa16)[_0x5f92('0x35')]();case _0x5f92('0x15'):var _0x2a43a8=_[_0x5f92('0x30')](_0x41e972);if(_0x4e1d1c[_0x5f92('0x37')]){var _0x244410={};_0x244410[_0x4e1d1c['additionalSearchLead']]=_0x228659;_[_0x5f92('0x32')](_0x2a43a8['$or'],_0x244410);}return _0x5c33d2[_0x5f92('0x1f')](_0x5f92('0x38'))[_0x5f92('0x23')](_0x2a43a8,_0x2baa16);case'account':var _0x4ee326=_['cloneDeep'](_0x41e972);if(_0x4e1d1c[_0x5f92('0x3a')]){var _0x244410={};_0x244410[_0x4e1d1c['additionalSearchAccount']]=_0x228659;_[_0x5f92('0x32')](_0x4ee326[_0x5f92('0x33')],_0x244410);}return _0x5c33d2[_0x5f92('0x1f')](_0x5f92('0x3b'))[_0x5f92('0x23')](_0x4ee326,_0x2baa16);default:return null;}})[_0x5f92('0x2a')](function(_0x3e5806){if(_0x3e5806&&_0x3e5806['length']){var _0x5a2160=_[_0x5f92('0x3c')](_0x3e5806);if(_0x5a2160){return BPromise[_0x5f92('0x26')]({'id':_0x5a2160['Id'],'name':_0x5a2160['Name'],'phone':_0x5a2160['Phone'],'endUserType':_0x5a2160[_0x5f92('0x3d')][_0x5f92('0x3e')][_0x5f92('0x3f')]()});}}})['then'](function(_0x594372){if(_0x594372){logger[_0x5f92('0x1d')](_0x5f92('0x40'),_0x594372[_0x5f92('0x19')],_0x228659);return BPromise[_0x5f92('0x26')](_0x594372);}else{logger['info'](_0x5f92('0x41'),_0x228659);var _0x253db4={'Phone':_0x228659};if(_0x4e1d1c['moduleCreate']){if(_0x4e1d1c[_0x5f92('0x42')]==='contact'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x228659,_0x4e1d1c[_0x5f92('0x42')]);_0x253db4[_0x5f92('0x43')]=_0xa4bcd1!==''?_0xa4bcd1:util[_0x5f92('0x44')](_0x5f92('0x45'),_0x228659);}else if(_0x4e1d1c[_0x5f92('0x42')]==='lead'){logger['info'](_0x5f92('0x46'),_0x228659,_0x4e1d1c[_0x5f92('0x42')]);_0x253db4[_0x5f92('0x43')]=_0xa4bcd1!==_0x5f92('0x47')?_0xa4bcd1:util[_0x5f92('0x44')]('Caller\x20-\x20%s',_0x228659);_0x253db4['Company']='No\x20Company';}else if(_0x4e1d1c[_0x5f92('0x42')]==='account'){logger[_0x5f92('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x228659,_0x4e1d1c[_0x5f92('0x42')]);_0x253db4[_0x5f92('0x27')]=_0xa4bcd1!==_0x5f92('0x47')?_0xa4bcd1:util[_0x5f92('0x44')](_0x5f92('0x45'),_0x228659);}else{return null;}}return _0x5c33d2[_0x5f92('0x1f')](_[_0x5f92('0x48')](_0x4e1d1c[_0x5f92('0x42')]))[_0x5f92('0x49')](_0x253db4)[_0x5f92('0x2a')](function(_0x2e5509){return BPromise['resolve']({'id':_0x2e5509['id'],'endUserType':_0x4e1d1c[_0x5f92('0x42')]});});}});}function getCustomFields(_0x5921f2,_0x11195b){var _0x2efa13={};if(_0x5921f2[_0x5f92('0x36')]>0x0){_['forEach'](_0x5921f2,function(_0x4ea712){if(_[_0x5f92('0x4a')]([_0x5f92('0x4b'),'picklist'],_0x4ea712[_0x5f92('0x3e')])&&_0x4ea712[_0x5f92('0x4c')]){_0x2efa13[_0x4ea712[_0x5f92('0x4c')]]=_0x4ea712[_0x5f92('0x4d')][_0x5f92('0x4e')]();}else if(_0x4ea712[_0x5f92('0x3e')]==='variable'&&_0x4ea712['variableName']&&_0x4ea712[_0x5f92('0x4c')]){_0x11195b[_0x4ea712[_0x5f92('0x4f')]]&&(_0x2efa13[_0x4ea712[_0x5f92('0x4c')]]=_0x11195b[_0x4ea712[_0x5f92('0x4f')]][_0x5f92('0x4e')]());}else if(_0x4ea712['type']==='customVariable'&&_0x4ea712['Variable']&&_0x4ea712[_0x5f92('0x50')][_0x5f92('0x51')]&&_0x4ea712[_0x5f92('0x4c')]){_0x11195b[_0x4ea712[_0x5f92('0x50')][_0x5f92('0x51')]['toLowerCase']()]&&(_0x2efa13[_0x4ea712[_0x5f92('0x4c')]]=_0x11195b[_0x4ea712[_0x5f92('0x50')][_0x5f92('0x51')][_0x5f92('0x3f')]()]['toString']());}});}return _0x2efa13;}function getConnection(_0x25ee1a){var _0x1a2f91=_0x25ee1a[_0x5f92('0x52')][_0x5f92('0x53')](_0x25ee1a[_0x5f92('0x54')]);var _0x1219fa=new jsforce['Connection']({'oauth2':{'loginUrl':_0x25ee1a[_0x5f92('0x55')]||'https://login.salesforce.com','clientId':_0x25ee1a[_0x5f92('0x56')],'clientSecret':_0x25ee1a[_0x5f92('0x57')]}});return _0x1219fa[_0x5f92('0x58')](_0x25ee1a['username'],_0x1a2f91)[_0x5f92('0x2a')](function(){logger[_0x5f92('0x1d')](_0x5f92('0x59'));return _0x1219fa;});}exports[_0x5f92('0x5a')]=function(_0x5e97fd,_0x6b2d34,_0x971a15,_0x490643,_0x12b47b,_0x124a7d){var _0x285798,_0x1d1f24,_0x268d87,_0x4a3e5c;_0x124a7d[_0x5f92('0x5b')]=intUtil['stripTrailingSlash'](_0x124a7d['serverUrl']);_0x124a7d[_0x5f92('0x55')]=intUtil[_0x5f92('0x5c')](_0x124a7d['remoteUri']);if(_0x12b47b&&_0x12b47b['monitor_format']){logger[_0x5f92('0x1d')](_0x5f92('0x5d'),_0x5f92('0x5e'));_0x6b2d34['recordingURL']=util[_0x5f92('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x124a7d[_0x5f92('0x5b')],_0x6b2d34[_0x5f92('0x5f')],md5(_0x6b2d34[_0x5f92('0x5f')]));}else{_0x6b2d34['recordingURL']='';}return getConnection(_0x124a7d)[_0x5f92('0x2a')](function(_0x336492){_0x4a3e5c=_0x336492;return getUser(_0x124a7d,_0x490643[_0x5f92('0x60')],_0x4a3e5c);})[_0x5f92('0x2a')](function(_0x2e430f){_0x285798=_0x2e430f;return getEndUser(_0x124a7d,_0x971a15,_0x6b2d34['calleridname'],_0x6b2d34[_0x5f92('0x61')],_0x4a3e5c);})[_0x5f92('0x2a')](function(_0x1ecd2c){_0x1d1f24=_0x1ecd2c;return getTicket(_0x124a7d,_0x285798,_0x1d1f24,_0x971a15,_0x6b2d34,_0x971a15[_0x5f92('0x62')],_0x4a3e5c,_0x5f92('0x5a'));})[_0x5f92('0x2a')](function(_0x291689){_0x268d87=_0x291689;logger[_0x5f92('0x1d')](_0x5f92('0x63'),_0x268d87['id']);logger[_0x5f92('0x1d')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x268d87['id'],_0x490643[_0x5f92('0x51')],_0x124a7d[_0x5f92('0x3e')]);switch(_0x124a7d['type']){case _0x5f92('0x64'):emit(util[_0x5f92('0x44')](_0x5f92('0x65'),_0x490643[_0x5f92('0x51')]),_0x5f92('0x66'),{'recordId':_0x268d87['id']});break;case'newTab':emit(util[_0x5f92('0x44')]('user:%s',_0x490643[_0x5f92('0x51')]),_0x5f92('0x67'),{'uri':util[_0x5f92('0x44')](_0x5f92('0x68'),_0x4a3e5c[_0x5f92('0x69')],_0x268d87['id'])});break;default:logger[_0x5f92('0x6a')](_0x5f92('0x6b'));}})[_0x5f92('0x6c')](function(_0x479453){logger[_0x5f92('0x6a')](_0x5f92('0x5d'),_0x479453);});};exports[_0x5f92('0x6d')]=function(_0x592bb0,_0x7eedde,_0x16bb1f,_0x458aeb,_0x4e2172,_0x233662,_0x34542d){var _0x593ca2,_0xe04949,_0x1f398f,_0x97564;_0x233662[_0x5f92('0x5b')]=intUtil[_0x5f92('0x5c')](_0x233662[_0x5f92('0x5b')]);_0x233662[_0x5f92('0x55')]=intUtil['stripTrailingSlash'](_0x233662[_0x5f92('0x55')]);if(_0x34542d&&_0x34542d[_0x5f92('0x6e')]&&_0x34542d['recordingFormat']!=='none'){logger[_0x5f92('0x1d')](_0x5f92('0x6f'),_0x5f92('0x5e'));_0x7eedde[_0x5f92('0x70')]=util[_0x5f92('0x44')](_0x5f92('0x71'),_0x233662['serverUrl'],_0x7eedde['uniqueid'],md5(_0x7eedde[_0x5f92('0x5f')]));}return getConnection(_0x233662)[_0x5f92('0x2a')](function(_0x223fb5){_0x97564=_0x223fb5;return getUser(_0x233662,_0x458aeb[_0x5f92('0x60')],_0x97564);})['then'](function(_0x4f9137){_0x593ca2=_0x4f9137;return getEndUser(_0x233662,_0x16bb1f,_0x7eedde[_0x5f92('0x72')],_0x7eedde['destcalleridnum'],_0x97564);})[_0x5f92('0x2a')](function(_0x1e4cfb){_0xe04949=_0x1e4cfb;return getTicket(_0x233662,_0x593ca2,_0xe04949,_0x16bb1f,_0x7eedde,_0x16bb1f[_0x5f92('0x62')],_0x97564,_0x5f92('0x6d'));})[_0x5f92('0x2a')](function(_0x122f66){_0x1f398f=_0x122f66;logger[_0x5f92('0x1d')](_0x5f92('0x73'),_0x1f398f['id']);logger[_0x5f92('0x1d')](_0x5f92('0x74'),_0x1f398f['id'],_0x458aeb['name'],_0x233662[_0x5f92('0x3e')]);switch(_0x233662['type']){case _0x5f92('0x64'):emit(util['format'](_0x5f92('0x65'),_0x458aeb[_0x5f92('0x51')]),_0x5f92('0x66'),{'recordId':_0x1f398f['id']});break;case'newTab':emit(util['format'](_0x5f92('0x65'),_0x458aeb[_0x5f92('0x51')]),_0x5f92('0x67'),{'uri':util[_0x5f92('0x44')](_0x5f92('0x68'),_0x97564[_0x5f92('0x69')],_0x1f398f['id'])});break;default:logger[_0x5f92('0x6a')]('[OUTBOUND]',_0x5f92('0x75'));}})[_0x5f92('0x6c')](function(_0x493e5e){logger[_0x5f92('0x6a')](_0x5f92('0x6f'),_0x493e5e);});};exports[_0x5f92('0x76')]=function(_0x3d5656,_0x243b7f,_0x4e443f,_0x235d18,_0x33a8da,_0x39119b){var _0x353d3a,_0x5a134d,_0x1030fd,_0x42f347;_0x39119b[_0x5f92('0x5b')]=intUtil[_0x5f92('0x5c')](_0x39119b[_0x5f92('0x5b')]);_0x39119b[_0x5f92('0x55')]=intUtil[_0x5f92('0x5c')](_0x39119b[_0x5f92('0x55')]);if(_0x33a8da&&_0x33a8da[_0x5f92('0x77')]){logger[_0x5f92('0x1d')]('['+_0x243b7f['lastevent'][_0x5f92('0x78')]()+']',_0x5f92('0x5e'));_0x243b7f[_0x5f92('0x70')]=util[_0x5f92('0x44')](_0x5f92('0x71'),_0x39119b['serverUrl'],_0x243b7f['uniqueid'],md5(_0x243b7f['uniqueid']));}else{_0x243b7f[_0x5f92('0x70')]='';}return getConnection(_0x39119b)['then'](function(_0x2cfcb1){_0x42f347=_0x2cfcb1;if(!_[_0x5f92('0x20')](_0x235d18)){return getUser(_0x39119b,_0x235d18[_0x5f92('0x51')],_0x42f347);}else{return getUser(_0x39119b,null,_0x42f347);}})[_0x5f92('0x2a')](function(_0x511f29){_0x353d3a=_0x511f29;return getEndUser(_0x39119b,_0x4e443f,_0x243b7f[_0x5f92('0x79')],_0x243b7f['calleridnum'],_0x42f347);})[_0x5f92('0x2a')](function(_0x5080dc){_0x5a134d=_0x5080dc;return getTicket(_0x39119b,_0x353d3a,_0x5a134d,_0x4e443f,_0x243b7f,_0x4e443f[_0x5f92('0x62')],_0x42f347);})[_0x5f92('0x2a')](function(_0x523980){_0x1030fd=_0x523980;logger[_0x5f92('0x1d')]('['+_0x243b7f[_0x5f92('0x7a')][_0x5f92('0x78')]()+']\x20Ticket\x20%s\x20created.',_0x1030fd['id']);logger[_0x5f92('0x1d')]('['+_0x243b7f[_0x5f92('0x7a')][_0x5f92('0x78')]()+_0x5f92('0x7b'),_0x39119b[_0x5f92('0x3e')]);})[_0x5f92('0x6c')](function(_0x2e872f){logger[_0x5f92('0x6a')]('['+_0x243b7f['lastevent'][_0x5f92('0x78')]()+']',_0x2e872f);});}; \ 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 0c69b49..9dd0282 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 _0x2691=['outbound','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','bluebird','md5','ioredis','./util','../../../../config/environment','servicenow','redis','localhost','socket.io-emitter','GET','then','length','adminId','result','sys_id','info','toUpperCase','catch','error','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','userEmail','active','true','userId','message',']\x20using\x20admin\x20profile','adminEmail','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','idField','variable','customField','Variable','name',']\x20getTicket\x20input\x20crm','incident','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketNumber',']\x20getTicket\x20crm','POST','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','email'];(function(_0x5d80ca,_0x1e59b1){var _0xb86b8=function(_0xc131cb){while(--_0xc131cb){_0x5d80ca['push'](_0x5d80ca['shift']());}};_0xb86b8(++_0x1e59b1);}(_0x2691,0x186));var _0x1269=function(_0x4e269c,_0x12fca5){_0x4e269c=_0x4e269c-0x0;var _0x50539f=_0x2691[_0x4e269c];return _0x50539f;};'use strict';var _=require('lodash');var Promise=require(_0x1269('0x0'));var rp=require('request-promise');var util=require('util');var md5=require(_0x1269('0x1'));var Redis=require(_0x1269('0x2'));var intUtil=require(_0x1269('0x3'));var config=require(_0x1269('0x4'));var logger=require('../../../../config/logger')(_0x1269('0x5'));config['redis']=_['defaults'](config[_0x1269('0x6')],{'host':_0x1269('0x7'),'port':0x18eb});var io=require(_0x1269('0x8'))(new Redis(config[_0x1269('0x6')]));function getAdminUser(_0x2d8e62,_0x4e77ff,_0x5c5d11,_0x56066a,_0x228fce,_0x11064e){return new Promise(function(_0x99c844,_0x3026f8){var _0x31f080={'method':_0x1269('0x9'),'uri':_0x56066a+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x228fce+'&'+_0x11064e,'auth':_0x4e77ff,'json':!![]};return rp(_0x31f080)[_0x1269('0xa')](function(_0x4148cb){if(_0x4148cb['result'][_0x1269('0xb')]>0x0){_0x5c5d11[_0x1269('0xc')]=_0x4148cb[_0x1269('0xd')][0x0][_0x1269('0xe')];}logger[_0x1269('0xf')]('['+[_0x2d8e62[_0x1269('0x10')]()]+'],\x20getAdminUser\x20crm',_0x5c5d11);_0x99c844(_0x5c5d11);})[_0x1269('0x11')](function(_0x5513c5){logger[_0x1269('0x12')]('['+[_0x2d8e62[_0x1269('0x10')]()]+']',_0x5513c5['message']);_0x3026f8(_0x5513c5['message']);});});}function getUser(_0x20eff9,_0x17afd9,_0x5249ed,_0x59fd4,_0x22763c){return function(_0x458281){logger[_0x1269('0xf')]('['+[_0x20eff9[_0x1269('0x10')]()]+_0x1269('0x13'),_0x458281);return new Promise(function(_0x5e048c,_0xe68053){if(intUtil['validateEmail'](_0x458281['userEmail'])){var _0x1716c1={'method':_0x1269('0x9'),'uri':_0x5249ed+_0x1269('0x14')+_0x458281[_0x1269('0x15')]+'&'+_0x59fd4+'&'+_0x22763c,'auth':_0x17afd9,'json':!![]};logger[_0x1269('0xf')]('['+[_0x20eff9[_0x1269('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x1716c1);return rp(_0x1716c1)['then'](function(_0x1cf2cc){logger[_0x1269('0xf')]('['+[_0x20eff9[_0x1269('0x10')]()]+'],\x20getUser\x20entity',_0x1cf2cc);if(_0x1cf2cc['result'][_0x1269('0xb')]>0x0&&String(_0x1cf2cc[_0x1269('0xd')][0x0][_0x1269('0x16')])===_0x1269('0x17')){_0x458281['userId']=_0x1cf2cc[_0x1269('0xd')][0x0][_0x1269('0xe')];}else{_0x458281[_0x1269('0x18')]=_0x458281[_0x1269('0xc')];_0x458281[_0x1269('0x15')]=_0x458281['adminEmail'];}logger[_0x1269('0xf')]('['+[_0x20eff9[_0x1269('0x10')]()]+'],\x20getUser\x20crm',_0x458281);_0x5e048c(_0x458281);})[_0x1269('0x11')](function(_0x143aee){logger[_0x1269('0x12')]('['+[_0x20eff9[_0x1269('0x10')]()]+']',_0x143aee[_0x1269('0x19')]);_0xe68053(_0x143aee[_0x1269('0x19')]);});}else{logger[_0x1269('0xf')]('['+[_0x20eff9[_0x1269('0x10')]()]+_0x1269('0x1a'));_0x458281[_0x1269('0x18')]=_0x458281['adminId'];_0x458281[_0x1269('0x15')]=_0x458281[_0x1269('0x1b')];_0x5e048c(_0x458281);}});};}function createEndUser(_0x47a65b,_0x530e7e,_0x2dc098,_0x38f62c,_0x2aaab0){logger[_0x1269('0xf')]('['+[_0x47a65b['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x2dc098);return new Promise(function(_0x3465a4,_0x2ef742){var _0x3109f9={'method':'POST','uri':_0x38f62c+_0x1269('0x1c')+_0x2aaab0,'body':{'user_name':_0x2dc098[_0x1269('0x1d')],'roles':_0x1269('0x1e'),'first_name':_0x2dc098['endUserNumber'],'active':_0x1269('0x17'),'date_format':'System','phone':_0x2dc098[_0x1269('0x1d')]},'auth':_0x530e7e,'json':!![]};return rp(_0x3109f9)['then'](function(_0x3409b2){logger[_0x1269('0xf')]('['+[_0x47a65b[_0x1269('0x10')]()]+_0x1269('0x1f'),_0x3409b2['result']);_0x2dc098[_0x1269('0x20')]=_0x3409b2[_0x1269('0xd')][_0x1269('0xe')];_0x3465a4(_0x2dc098);})['catch'](function(_0xd4429d){logger[_0x1269('0x12')]('['+[_0x47a65b[_0x1269('0x10')]()]+']',_0xd4429d[_0x1269('0x19')]);_0x2ef742(_0xd4429d[_0x1269('0x19')]);});});}function getEndUser(_0x261194,_0x48e308,_0xb1078d,_0x3be2fd,_0x46f1d9){return function(_0x273c37){logger[_0x1269('0xf')]('['+[_0x261194[_0x1269('0x10')]()]+'],\x20getEndUser\x20input\x20crm',_0x273c37);return new Promise(function(_0x375a19,_0x23d50a){var _0x4d36f6={'method':_0x1269('0x9'),'uri':_0xb1078d+_0x1269('0x21')+_0x273c37[_0x1269('0x1d')]+'&'+_0x3be2fd+'&'+_0x46f1d9,'auth':_0x48e308,'json':!![]};return rp(_0x4d36f6)[_0x1269('0xa')](function(_0x11634b){if(_0x11634b['result'][_0x1269('0xb')]>0x0){_0x273c37[_0x1269('0x20')]=_0x11634b[_0x1269('0xd')][0x0][_0x1269('0xe')];logger[_0x1269('0xf')]('['+[_0x261194[_0x1269('0x10')]()]+_0x1269('0x22'),_0x273c37);_0x375a19(_0x273c37);}else{return createEndUser(_0x261194,_0x48e308,_0x273c37,_0xb1078d,_0x3be2fd)['then'](function(_0x230b5b){logger[_0x1269('0xf')]('['+[_0x261194[_0x1269('0x10')]()]+'],\x20createEndUser\x20crm',_0x230b5b);_0x375a19(_0x230b5b);});}})['catch'](function(_0x53e87e){logger[_0x1269('0x12')]('['+[_0x261194['toUpperCase']()]+']',_0x53e87e['message']);_0x23d50a(_0x53e87e[_0x1269('0x19')]);});});};}function getCustomFields(_0x15da0d,_0x52c62a){var _0x364c08={};if(_0x15da0d[_0x1269('0xb')]>0x0){_[_0x1269('0x23')](_0x15da0d,function(_0x432fdd){if(_[_0x1269('0x24')]([_0x1269('0x25'),_0x1269('0x26')],_0x432fdd[_0x1269('0x27')])&&_0x432fdd[_0x1269('0x28')]&&!_0x432fdd['customField']){_0x364c08[_0x432fdd[_0x1269('0x28')][_0x1269('0x29')]()]=_0x432fdd[_0x1269('0x2a')][_0x1269('0x2b')]();}else if(_[_0x1269('0x24')](['string',_0x1269('0x26')],_0x432fdd[_0x1269('0x27')])&&_0x432fdd[_0x1269('0x2c')]&&_0x432fdd['customField']){_0x364c08[_0x432fdd['idField'][_0x1269('0x29')]()]=_0x432fdd[_0x1269('0x2a')][_0x1269('0x2b')]();}else if(_0x432fdd[_0x1269('0x27')]===_0x1269('0x2d')&&_0x432fdd['variableName']&&_0x432fdd[_0x1269('0x2c')]&&_0x432fdd[_0x1269('0x2e')]){_0x364c08[_0x432fdd['idField'][_0x1269('0x29')]()]=_0x52c62a[_0x432fdd['variableName']]['toString']();}else if(_0x432fdd[_0x1269('0x27')]==='customVariable'&&_0x432fdd['Variable']&&_0x432fdd[_0x1269('0x2f')][_0x1269('0x30')]&&_0x432fdd[_0x1269('0x2c')]&&_0x432fdd['customField']){_0x364c08[_0x432fdd[_0x1269('0x2c')][_0x1269('0x29')]()]=_0x52c62a[_0x432fdd['Variable'][_0x1269('0x30')][_0x1269('0x29')]()][_0x1269('0x2b')]();}});}return _0x364c08;}function getTicket(_0xd2bd93,_0x36d624,_0x5e9fd4,_0x1a0050,_0x534736,_0x347408){return function(_0xdd1aa2){logger[_0x1269('0xf')]('['+[_0xd2bd93[_0x1269('0x10')]()]+_0x1269('0x31'),_0xdd1aa2);return new Promise(function(_0xfe6cd3,_0x5b80fa){var _0x2c1a6d=_0xd2bd93['toLowerCase']()==='outbound'?_0xdd1aa2[_0x1269('0x18')]:_0xdd1aa2[_0x1269('0x20')];var _0x5548f4={'method':'POST','uri':_0x5e9fd4+_0x1269('0x32')+'?'+_0x347408,'body':Object['assign']({},{'active':_0x1269('0x17'),'caller_id':_0x2c1a6d,'assigned_to':_0xdd1aa2['userId'],'short_description':intUtil[_0x1269('0x33')](_0x1a0050['Subjects'],_0x534736,'\x20'),'description':intUtil[_0x1269('0x33')](_0x1a0050[_0x1269('0x34')],_0x534736,'\x0a')},getCustomFields(_0x1a0050['Fields'],_0x534736)),'auth':_0x36d624,'json':!![]};return rp(_0x5548f4)['then'](function(_0x16b8a9){logger['info']('['+[_0xd2bd93[_0x1269('0x10')]()]+_0x1269('0x35'),_0x16b8a9[_0x1269('0xd')]);_0xdd1aa2['ticketId']=_0x16b8a9[_0x1269('0xd')][_0x1269('0xe')];_0xdd1aa2[_0x1269('0x36')]=_0x16b8a9['result']['number'];logger[_0x1269('0xf')]('['+[_0xd2bd93[_0x1269('0x10')]()]+_0x1269('0x37'),_0xdd1aa2);_0xfe6cd3(_0xdd1aa2);})[_0x1269('0x11')](function(_0x52c922){logger['error']('['+[_0xd2bd93[_0x1269('0x10')]()]+']',_0x52c922[_0x1269('0x19')]);_0x5b80fa(_0x52c922[_0x1269('0x19')]);});});};}function createRemoteTag(_0x498eba,_0x9b1c39,_0x391327,_0x5576a0){return new Promise(function(_0x177b3c,_0x42f297){var _0x22059d={'method':_0x1269('0x38'),'uri':_0x391327+'label'+'?'+_0x5576a0,'body':{'short_description':_0x498eba,'global':!![],'active':!![],'name':_0x498eba},'auth':_0x9b1c39,'json':!![]};return rp(_0x22059d)[_0x1269('0xa')](function(_0x38fb29){var _0x4ebf43=_0x38fb29['result']['sys_id'];_0x177b3c(_0x4ebf43);});});}function getRemoteTag(_0x4e8cea,_0x15ad1c,_0x1839d3,_0x43d173,_0x136cc8){return new Promise(function(_0x3ac28e,_0x5a2c99){var _0x51369d={'method':_0x1269('0x9'),'uri':_0x1839d3+_0x1269('0x39')+_0x1269('0x3a')+_0x4e8cea+'&'+_0x43d173,'auth':_0x15ad1c,'json':!![]};return rp(_0x51369d)[_0x1269('0xa')](function(_0xf4be82){if(_0xf4be82[_0x1269('0xd')]['length']>0x0){var _0x15ad79=_0xf4be82['result'][0x0]['sys_id'];_0x3ac28e(_0x15ad79);}else{return createRemoteTag(_0x4e8cea,_0x15ad1c,_0x1839d3,_0x43d173)[_0x1269('0xa')](function(_0x2ac4d1){_0x3ac28e(_0x2ac4d1);});}});});}function assignTagToIncident(_0x35b1e6,_0x2ce9b1,_0x4fbb7e,_0x1b4ac7,_0x3f48cd){return new Promise(function(_0x274220,_0x2b5f62){var _0x405391={'method':'POST','uri':_0x4fbb7e+'label_entry'+'?'+_0x3f48cd,'body':{'label':_0x35b1e6,'table':_0x1269('0x32'),'id_type':_0x1269('0x3b'),'table_key':_0x1b4ac7['ticketId'],'title':_0x1269('0x3c')+_0x1b4ac7[_0x1269('0x36')],'id_display':_0x1b4ac7[_0x1269('0x36')]},'auth':_0x2ce9b1,'json':!![]};return rp(_0x405391)[_0x1269('0xa')](function(_0x2ab2d1){_0x274220();})['catch'](function(){_0x274220();});});}function manageTags(_0x5a7d3d,_0x5d9911,_0x4aaa3a,_0x35ddba,_0xb3e5eb,_0x4673b2,_0xbd7cd4){return new Promise(function(_0x26c1ea,_0x330af3){var _0x43b253=[];_0x5d9911[_0x1269('0x23')](function(_0x17dea2){_0x43b253[_0x1269('0x3d')](getRemoteTag(_0x17dea2,_0x4aaa3a,_0x35ddba,_0x4673b2,_0xbd7cd4));});return Promise[_0x1269('0x3e')](_0x43b253)['then'](function(_0x6fa443){if(_0x6fa443[_0x1269('0xb')]){logger[_0x1269('0xf')]('['+[_0x5a7d3d['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x6fa443);var _0x2a5d80=[];_0x6fa443[_0x1269('0x23')](function(_0x4097cc){_0x2a5d80['push'](assignTagToIncident(_0x4097cc,_0x4aaa3a,_0x35ddba,_0xb3e5eb,_0x4673b2));});return Promise[_0x1269('0x3e')](_0x2a5d80)['then'](function(){_0x26c1ea();})['catch'](function(){_0x26c1ea();});}else{_0x26c1ea();}});});}function getTags(_0x31ddeb,_0x52a084,_0x39b291,_0x7bab5c,_0x36d479,_0x4e0b33){return function(_0x26e3c4){return new Promise(function(_0x5cf84d,_0x29d7b0){var _0x214db0=[];var _0x5a3d31=_0x7bab5c[_0x1269('0x3f')];if(_0x5a3d31&&_0x5a3d31[_0x1269('0xb')]>0x0){_0x214db0=_[_0x1269('0x40')](_0x5a3d31,'name');}if(_0x214db0[_0x1269('0xb')]>0x0){return manageTags(_0x31ddeb,_0x214db0,_0x52a084,_0x39b291,_0x26e3c4,_0x36d479,_0x4e0b33)[_0x1269('0xa')](function(){_0x5cf84d(_0x26e3c4);});}else{_0x5cf84d(_0x26e3c4);}});};}function emit(_0x2c4752,_0x171da4,_0x215c1e){var _0x412b5b='%26sysparm_record_target%3Dincident'+_0x1269('0x41')+_0x1269('0x42')+_0x1269('0x43');var _0x2f7fb3={'uri':_0x2c4752+_0x1269('0x44')+_0x215c1e+_0x412b5b};io['to'](util[_0x1269('0x45')]('user:%s',_0x171da4))[_0x1269('0x46')]('trigger:browser:url',_0x2f7fb3);}exports['cs']=function(_0x9fa035,_0x59ac71,_0x52cf29,_0x569251,_0x420d59,_0x2785dc,_0x114c4d,_0x2ef487){var _0x488d2a={};var _0x198539={'user':_0x2785dc[_0x1269('0x47')],'pass':_0x2785dc[_0x1269('0x48')]};var _0x13967d=_0x1269('0x49');var _0xd4c4c1=_0x1269('0x4a');_0x2785dc['remoteUri']=intUtil[_0x1269('0x4b')](_0x2785dc[_0x1269('0x4c')]);_0x2785dc[_0x1269('0x4d')]=intUtil[_0x1269('0x4b')](_0x2785dc['serverUrl']);var _0xffb7ef=util[_0x1269('0x45')](_0x1269('0x4e'),_0x2785dc[_0x1269('0x4c')]);_0x488d2a[_0x1269('0x15')]=!_['isNil'](_0x569251)?_0x569251[_0x1269('0x4f')]:null;_0x488d2a[_0x1269('0x1b')]=_0x2785dc[_0x1269('0x4f')];_0x488d2a[_0x1269('0x1d')]=_0x2ef487[_0x1269('0x29')]()===_0x1269('0x50')?_0x59ac71['destcalleridnum']:_0x59ac71['calleridnum'];_0x488d2a[_0x1269('0x51')]=_0x2ef487===_0x1269('0x52')||_0x2ef487==='unmanaged'?_0x1269('0x52'):_0x1269('0x50');var _0x385043=util[_0x1269('0x45')](_0x1269('0x53'),_0x2785dc['serverUrl'],_0x59ac71[_0x1269('0x54')],md5(_0x59ac71[_0x1269('0x54')]));if(_0x420d59&&_0x420d59['monitor_format']){logger['info'](_0x1269('0x55'),_0x1269('0x56'));_0x59ac71[_0x1269('0x57')]=_0x385043;}else if(_0x114c4d&&_0x114c4d['recordingFormat']&&_0x114c4d['recordingFormat']!=='none'){logger[_0x1269('0xf')](_0x1269('0x58'),_0x1269('0x56'));_0x59ac71[_0x1269('0x57')]=_0x385043;}else{_0x59ac71[_0x1269('0x57')]='';}return getAdminUser(_0x2ef487,_0x198539,_0x488d2a,_0xffb7ef,_0xd4c4c1,_0x13967d)['then'](getUser(_0x2ef487,_0x198539,_0xffb7ef,_0xd4c4c1,_0x13967d))[_0x1269('0xa')](getEndUser(_0x2ef487,_0x198539,_0xffb7ef,_0xd4c4c1,_0x13967d))[_0x1269('0xa')](getTicket(_0x2ef487,_0x198539,_0xffb7ef,_0x52cf29,_0x59ac71,_0xd4c4c1))[_0x1269('0xa')](function(_0x4d617e){logger['info'](util[_0x1269('0x45')](_0x1269('0x59'),_0x4d617e[_0x1269('0x5a')]));logger[_0x1269('0xf')](util['format'](_0x1269('0x5b'),_0x2ef487));if(_0x2ef487!==_0x1269('0x5c')){logger[_0x1269('0xf')]('['+[_0x2ef487[_0x1269('0x10')]()]+']',_0x1269('0x5d'));emit(_0x2785dc[_0x1269('0x4c')],_0x569251[_0x1269('0x30')],_0x4d617e['ticketId']);}})[_0x1269('0x11')](function(_0x334d25){logger[_0x1269('0x12')]('['+[_0x2ef487[_0x1269('0x10')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x334d25,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x740f=['idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','ticketId','forEach','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','callDirection','unmanaged','queue','format','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','userId','adminEmail','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x740f,0x187));var _0xf740=function(_0x3e630a,_0x507613){_0x3e630a=_0x3e630a-0x0;var _0xca5993=_0x740f[_0x3e630a];return _0xca5993;};'use strict';var _=require(_0xf740('0x0'));var Promise=require(_0xf740('0x1'));var rp=require(_0xf740('0x2'));var util=require(_0xf740('0x3'));var md5=require('md5');var Redis=require(_0xf740('0x4'));var intUtil=require(_0xf740('0x5'));var config=require(_0xf740('0x6'));var logger=require(_0xf740('0x7'))('servicenow');config[_0xf740('0x8')]=_['defaults'](config[_0xf740('0x8')],{'host':_0xf740('0x9'),'port':0x18eb});var io=require(_0xf740('0xa'))(new Redis(config[_0xf740('0x8')]));function getAdminUser(_0x538fc2,_0x36d15f,_0x12e013,_0x5a750a,_0xf412aa,_0x39fc08){return new Promise(function(_0xaad09e,_0x1d0e21){var _0x467e2b={'method':_0xf740('0xb'),'uri':_0x5a750a+_0xf740('0xc')+'&'+_0xf412aa+'&'+_0x39fc08,'auth':_0x36d15f,'json':!![]};return rp(_0x467e2b)[_0xf740('0xd')](function(_0x374526){if(_0x374526[_0xf740('0xe')][_0xf740('0xf')]>0x0){_0x12e013[_0xf740('0x10')]=_0x374526[_0xf740('0xe')][0x0][_0xf740('0x11')];}logger[_0xf740('0x12')]('['+[_0x538fc2[_0xf740('0x13')]()]+'],\x20getAdminUser\x20crm',_0x12e013);_0xaad09e(_0x12e013);})[_0xf740('0x14')](function(_0x4cc644){logger['error']('['+[_0x538fc2[_0xf740('0x13')]()]+']',_0x4cc644[_0xf740('0x15')]);_0x1d0e21(_0x4cc644[_0xf740('0x15')]);});});}function getUser(_0x4483cc,_0x138f4e,_0x215d9d,_0x4be1a6,_0x4a9e3f){return function(_0x15ad41){logger[_0xf740('0x12')]('['+[_0x4483cc[_0xf740('0x13')]()]+_0xf740('0x16'),_0x15ad41);return new Promise(function(_0x1a5048,_0x12fc91){if(intUtil[_0xf740('0x17')](_0x15ad41[_0xf740('0x18')])){var _0x3c3512={'method':_0xf740('0xb'),'uri':_0x215d9d+_0xf740('0x19')+_0x15ad41[_0xf740('0x18')]+'&'+_0x4be1a6+'&'+_0x4a9e3f,'auth':_0x138f4e,'json':!![]};logger[_0xf740('0x12')]('['+[_0x4483cc['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x3c3512);return rp(_0x3c3512)[_0xf740('0xd')](function(_0x3f5ea4){logger[_0xf740('0x12')]('['+[_0x4483cc[_0xf740('0x13')]()]+_0xf740('0x1a'),_0x3f5ea4);if(_0x3f5ea4['result']['length']>0x0&&String(_0x3f5ea4[_0xf740('0xe')][0x0][_0xf740('0x1b')])==='true'){_0x15ad41[_0xf740('0x1c')]=_0x3f5ea4['result'][0x0]['sys_id'];}else{_0x15ad41[_0xf740('0x1c')]=_0x15ad41[_0xf740('0x10')];_0x15ad41['userEmail']=_0x15ad41[_0xf740('0x1d')];}logger[_0xf740('0x12')]('['+[_0x4483cc[_0xf740('0x13')]()]+'],\x20getUser\x20crm',_0x15ad41);_0x1a5048(_0x15ad41);})[_0xf740('0x14')](function(_0x1a3cda){logger[_0xf740('0x1e')]('['+[_0x4483cc[_0xf740('0x13')]()]+']',_0x1a3cda[_0xf740('0x15')]);_0x12fc91(_0x1a3cda[_0xf740('0x15')]);});}else{logger[_0xf740('0x12')]('['+[_0x4483cc[_0xf740('0x13')]()]+_0xf740('0x1f'));_0x15ad41[_0xf740('0x1c')]=_0x15ad41[_0xf740('0x10')];_0x15ad41['userEmail']=_0x15ad41[_0xf740('0x1d')];_0x1a5048(_0x15ad41);}});};}function createEndUser(_0x25ac35,_0x4ab79c,_0xfb2da3,_0x366e92,_0x2d882d){logger['info']('['+[_0x25ac35[_0xf740('0x13')]()]+_0xf740('0x20'),_0xfb2da3);return new Promise(function(_0x5ead90,_0xc3c00b){var _0x2b6306={'method':_0xf740('0x21'),'uri':_0x366e92+_0xf740('0x22')+_0x2d882d,'body':{'user_name':_0xfb2da3[_0xf740('0x23')],'roles':_0xf740('0x24'),'first_name':_0xfb2da3['endUserNumber'],'active':_0xf740('0x25'),'date_format':_0xf740('0x26'),'phone':_0xfb2da3['endUserNumber']},'auth':_0x4ab79c,'json':!![]};return rp(_0x2b6306)[_0xf740('0xd')](function(_0x180ef1){logger[_0xf740('0x12')]('['+[_0x25ac35[_0xf740('0x13')]()]+_0xf740('0x27'),_0x180ef1[_0xf740('0xe')]);_0xfb2da3[_0xf740('0x28')]=_0x180ef1['result'][_0xf740('0x11')];_0x5ead90(_0xfb2da3);})[_0xf740('0x14')](function(_0xce529f){logger[_0xf740('0x1e')]('['+[_0x25ac35['toUpperCase']()]+']',_0xce529f[_0xf740('0x15')]);_0xc3c00b(_0xce529f[_0xf740('0x15')]);});});}function getEndUser(_0x7086bb,_0x21ffaa,_0x48b621,_0x616e74,_0x45779e){return function(_0x38d70b){logger[_0xf740('0x12')]('['+[_0x7086bb[_0xf740('0x13')]()]+_0xf740('0x29'),_0x38d70b);return new Promise(function(_0x518bf3,_0x482691){var _0x1e2e79={'method':'GET','uri':_0x48b621+_0xf740('0x2a')+_0x38d70b[_0xf740('0x23')]+'&'+_0x616e74+'&'+_0x45779e,'auth':_0x21ffaa,'json':!![]};return rp(_0x1e2e79)[_0xf740('0xd')](function(_0x1535ef){if(_0x1535ef[_0xf740('0xe')][_0xf740('0xf')]>0x0){_0x38d70b[_0xf740('0x28')]=_0x1535ef[_0xf740('0xe')][0x0][_0xf740('0x11')];logger[_0xf740('0x12')]('['+[_0x7086bb['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x38d70b);_0x518bf3(_0x38d70b);}else{return createEndUser(_0x7086bb,_0x21ffaa,_0x38d70b,_0x48b621,_0x616e74)['then'](function(_0x3ce2d3){logger['info']('['+[_0x7086bb['toUpperCase']()]+_0xf740('0x2b'),_0x3ce2d3);_0x518bf3(_0x3ce2d3);});}})[_0xf740('0x14')](function(_0x241d02){logger[_0xf740('0x1e')]('['+[_0x7086bb['toUpperCase']()]+']',_0x241d02[_0xf740('0x15')]);_0x482691(_0x241d02['message']);});});};}function getCustomFields(_0x5c7f01,_0x31c940){var _0xaf7c85={};if(_0x5c7f01[_0xf740('0xf')]>0x0){_['forEach'](_0x5c7f01,function(_0x4e45dc){if(_[_0xf740('0x2c')]([_0xf740('0x2d'),_0xf740('0x2e')],_0x4e45dc[_0xf740('0x2f')])&&_0x4e45dc[_0xf740('0x30')]&&!_0x4e45dc[_0xf740('0x31')]){_0xaf7c85[_0x4e45dc[_0xf740('0x30')][_0xf740('0x32')]()]=_0x4e45dc[_0xf740('0x33')][_0xf740('0x34')]();}else if(_[_0xf740('0x2c')]([_0xf740('0x2d'),_0xf740('0x2e')],_0x4e45dc[_0xf740('0x2f')])&&_0x4e45dc[_0xf740('0x35')]&&_0x4e45dc[_0xf740('0x31')]){_0xaf7c85[_0x4e45dc[_0xf740('0x35')]['toLowerCase']()]=_0x4e45dc[_0xf740('0x33')][_0xf740('0x34')]();}else if(_0x4e45dc['type']===_0xf740('0x36')&&_0x4e45dc[_0xf740('0x37')]&&_0x4e45dc[_0xf740('0x35')]&&_0x4e45dc[_0xf740('0x31')]){_0xaf7c85[_0x4e45dc[_0xf740('0x35')][_0xf740('0x32')]()]=_0x31c940[_0x4e45dc[_0xf740('0x37')]]['toString']();}else if(_0x4e45dc[_0xf740('0x2f')]===_0xf740('0x38')&&_0x4e45dc[_0xf740('0x39')]&&_0x4e45dc[_0xf740('0x39')][_0xf740('0x3a')]&&_0x4e45dc[_0xf740('0x35')]&&_0x4e45dc[_0xf740('0x31')]){_0xaf7c85[_0x4e45dc['idField'][_0xf740('0x32')]()]=_0x31c940[_0x4e45dc[_0xf740('0x39')][_0xf740('0x3a')]['toLowerCase']()][_0xf740('0x34')]();}});}return _0xaf7c85;}function getTicket(_0x53f0c4,_0x5e6734,_0x47af0a,_0x2c4005,_0x44fa11,_0x155a8a){return function(_0x1a317e){logger[_0xf740('0x12')]('['+[_0x53f0c4[_0xf740('0x13')]()]+_0xf740('0x3b'),_0x1a317e);return new Promise(function(_0x5dd185,_0x2c0453){var _0x4a2709=_0x53f0c4[_0xf740('0x32')]()===_0xf740('0x3c')?_0x1a317e[_0xf740('0x1c')]:_0x1a317e[_0xf740('0x28')];var _0x9e1f2f={'method':_0xf740('0x21'),'uri':_0x47af0a+'incident'+'?'+_0x155a8a,'body':Object['assign']({},{'active':_0xf740('0x25'),'caller_id':_0x4a2709,'assigned_to':_0x1a317e[_0xf740('0x1c')],'short_description':intUtil[_0xf740('0x3d')](_0x2c4005[_0xf740('0x3e')],_0x44fa11,'\x20'),'description':intUtil[_0xf740('0x3d')](_0x2c4005['Descriptions'],_0x44fa11,'\x0a')},getCustomFields(_0x2c4005[_0xf740('0x3f')],_0x44fa11)),'auth':_0x5e6734,'json':!![]};return rp(_0x9e1f2f)[_0xf740('0xd')](function(_0x23364a){logger[_0xf740('0x12')]('['+[_0x53f0c4[_0xf740('0x13')]()]+_0xf740('0x40'),_0x23364a['result']);_0x1a317e['ticketId']=_0x23364a[_0xf740('0xe')][_0xf740('0x11')];_0x1a317e[_0xf740('0x41')]=_0x23364a['result'][_0xf740('0x42')];logger[_0xf740('0x12')]('['+[_0x53f0c4[_0xf740('0x13')]()]+_0xf740('0x43'),_0x1a317e);_0x5dd185(_0x1a317e);})[_0xf740('0x14')](function(_0x1b0c22){logger[_0xf740('0x1e')]('['+[_0x53f0c4[_0xf740('0x13')]()]+']',_0x1b0c22['message']);_0x2c0453(_0x1b0c22['message']);});});};}function createRemoteTag(_0x297d24,_0x307ae6,_0x2ca483,_0x2a834e){return new Promise(function(_0x227654,_0x5106bb){var _0x5c72e0={'method':_0xf740('0x21'),'uri':_0x2ca483+_0xf740('0x44')+'?'+_0x2a834e,'body':{'short_description':_0x297d24,'global':!![],'active':!![],'name':_0x297d24},'auth':_0x307ae6,'json':!![]};return rp(_0x5c72e0)[_0xf740('0xd')](function(_0x4bf5ad){var _0x31cabd=_0x4bf5ad[_0xf740('0xe')][_0xf740('0x11')];_0x227654(_0x31cabd);});});}function getRemoteTag(_0x3c195a,_0x587c31,_0x57529e,_0x5626b8,_0x2b3d96){return new Promise(function(_0x672f4f,_0x4af73a){var _0x4957ae={'method':'GET','uri':_0x57529e+_0xf740('0x44')+_0xf740('0x45')+_0x3c195a+'&'+_0x5626b8,'auth':_0x587c31,'json':!![]};return rp(_0x4957ae)[_0xf740('0xd')](function(_0x223fb2){if(_0x223fb2[_0xf740('0xe')]['length']>0x0){var _0x3667b6=_0x223fb2[_0xf740('0xe')][0x0][_0xf740('0x11')];_0x672f4f(_0x3667b6);}else{return createRemoteTag(_0x3c195a,_0x587c31,_0x57529e,_0x5626b8)[_0xf740('0xd')](function(_0x3fcf55){_0x672f4f(_0x3fcf55);});}});});}function assignTagToIncident(_0x5040c6,_0x4378c6,_0x3925cc,_0x502f34,_0x2655de){return new Promise(function(_0x1570a2,_0x40a610){var _0x1b246d={'method':'POST','uri':_0x3925cc+_0xf740('0x46')+'?'+_0x2655de,'body':{'label':_0x5040c6,'table':_0xf740('0x47'),'id_type':'Incident','table_key':_0x502f34[_0xf740('0x48')],'title':'Incident\x20-\x20'+_0x502f34[_0xf740('0x41')],'id_display':_0x502f34[_0xf740('0x41')]},'auth':_0x4378c6,'json':!![]};return rp(_0x1b246d)[_0xf740('0xd')](function(_0x15441f){_0x1570a2();})[_0xf740('0x14')](function(){_0x1570a2();});});}function manageTags(_0x369ce2,_0x46d565,_0x54fe02,_0x20fc5e,_0xe07f89,_0x2c7994,_0x7fca26){return new Promise(function(_0x8e1e6d,_0x3ab4c3){var _0xf34450=[];_0x46d565[_0xf740('0x49')](function(_0x3f1447){_0xf34450[_0xf740('0x4a')](getRemoteTag(_0x3f1447,_0x54fe02,_0x20fc5e,_0x2c7994,_0x7fca26));});return Promise['all'](_0xf34450)[_0xf740('0xd')](function(_0xbc315b){if(_0xbc315b[_0xf740('0xf')]){logger[_0xf740('0x12')]('['+[_0x369ce2['toUpperCase']()]+_0xf740('0x4b'),_0xbc315b);var _0x387540=[];_0xbc315b[_0xf740('0x49')](function(_0x2953b7){_0x387540['push'](assignTagToIncident(_0x2953b7,_0x54fe02,_0x20fc5e,_0xe07f89,_0x2c7994));});return Promise[_0xf740('0x4c')](_0x387540)[_0xf740('0xd')](function(){_0x8e1e6d();})[_0xf740('0x14')](function(){_0x8e1e6d();});}else{_0x8e1e6d();}});});}function getTags(_0x54b62e,_0x2e021a,_0x5700a1,_0x29dc3e,_0x9a92,_0x1d4332){return function(_0xdae37a){return new Promise(function(_0x766422,_0x5028d7){var _0x618fbd=[];var _0x2c1185=_0x29dc3e['Tags'];if(_0x2c1185&&_0x2c1185[_0xf740('0xf')]>0x0){_0x618fbd=_[_0xf740('0x4d')](_0x2c1185,_0xf740('0x3a'));}if(_0x618fbd[_0xf740('0xf')]>0x0){return manageTags(_0x54b62e,_0x618fbd,_0x2e021a,_0x5700a1,_0xdae37a,_0x9a92,_0x1d4332)[_0xf740('0xd')](function(){_0x766422(_0xdae37a);});}else{_0x766422(_0xdae37a);}});};}function emit(_0x3d5910,_0x5bbb7b,_0x45a9c2){var _0x47cb7c=_0xf740('0x4e')+_0xf740('0x4f')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xf740('0x50');var _0x50d61d={'uri':_0x3d5910+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x45a9c2+_0x47cb7c};io['to'](util['format'](_0xf740('0x51'),_0x5bbb7b))[_0xf740('0x52')](_0xf740('0x53'),_0x50d61d);}exports['cs']=function(_0x126c7c,_0x3c0d03,_0x44d1bb,_0x1b9c7e,_0x37e947,_0x80376a,_0x295a02,_0x1244d0){var _0x1b5c88={};var _0x233c7f={'user':_0x80376a['username'],'pass':_0x80376a[_0xf740('0x54')]};var _0x21aa1b=_0xf740('0x55');var _0x1a41ae=_0xf740('0x56');_0x80376a['remoteUri']=intUtil[_0xf740('0x57')](_0x80376a[_0xf740('0x58')]);_0x80376a[_0xf740('0x59')]=intUtil[_0xf740('0x57')](_0x80376a[_0xf740('0x59')]);var _0x584695=util['format'](_0xf740('0x5a'),_0x80376a[_0xf740('0x58')]);_0x1b5c88[_0xf740('0x18')]=!_[_0xf740('0x5b')](_0x1b9c7e)?_0x1b9c7e['email']:null;_0x1b5c88[_0xf740('0x1d')]=_0x80376a[_0xf740('0x5c')];_0x1b5c88['endUserNumber']=_0x1244d0[_0xf740('0x32')]()===_0xf740('0x3c')?_0x3c0d03[_0xf740('0x5d')]:_0x3c0d03['calleridnum'];_0x1b5c88[_0xf740('0x5e')]=_0x1244d0==='queue'||_0x1244d0===_0xf740('0x5f')?_0xf740('0x60'):_0xf740('0x3c');var _0x21d60d=util[_0xf740('0x61')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x80376a['serverUrl'],_0x3c0d03[_0xf740('0x62')],md5(_0x3c0d03['uniqueid']));if(_0x37e947&&_0x37e947[_0xf740('0x63')]){logger[_0xf740('0x12')](_0xf740('0x64'),'Recording\x20is\x20enabled!');_0x3c0d03[_0xf740('0x65')]=_0x21d60d;}else if(_0x295a02&&_0x295a02[_0xf740('0x66')]&&_0x295a02[_0xf740('0x66')]!==_0xf740('0x67')){logger[_0xf740('0x12')](_0xf740('0x68'),_0xf740('0x69'));_0x3c0d03[_0xf740('0x65')]=_0x21d60d;}else{_0x3c0d03[_0xf740('0x65')]='';}return getAdminUser(_0x1244d0,_0x233c7f,_0x1b5c88,_0x584695,_0x1a41ae,_0x21aa1b)['then'](getUser(_0x1244d0,_0x233c7f,_0x584695,_0x1a41ae,_0x21aa1b))['then'](getEndUser(_0x1244d0,_0x233c7f,_0x584695,_0x1a41ae,_0x21aa1b))[_0xf740('0xd')](getTicket(_0x1244d0,_0x233c7f,_0x584695,_0x44d1bb,_0x3c0d03,_0x1a41ae))[_0xf740('0xd')](function(_0x173a28){logger[_0xf740('0x12')](util[_0xf740('0x61')](_0xf740('0x6a'),_0x173a28[_0xf740('0x48')]));logger[_0xf740('0x12')](util['format'](_0xf740('0x6b'),_0x1244d0));if(_0x1244d0!==_0xf740('0x5f')){logger[_0xf740('0x12')]('['+[_0x1244d0[_0xf740('0x13')]()]+']',_0xf740('0x6c'));emit(_0x80376a[_0xf740('0x58')],_0x1b9c7e[_0xf740('0x3a')],_0x173a28['ticketId']);}})[_0xf740('0x14')](function(_0xeaa40e){logger['error']('['+[_0x1244d0['toUpperCase']()]+_0xf740('0x6d'),util[_0xf740('0x6e')](_0xeaa40e,{'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 d72973f..0630b7b 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 _0xf022=['info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','first_name','merge','map','type','string','nameField','customField','toLowerCase','content','toString','custom_fields','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','version','error','unmanaged','lastevent','calleridname','catch','request-promise','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit'];(function(_0x3d29c0,_0x4ad70e){var _0x4dc56a=function(_0x46f50f){while(--_0x46f50f){_0x3d29c0['push'](_0x3d29c0['shift']());}};_0x4dc56a(++_0x4ad70e);}(_0xf022,0x16c));var _0x2f02=function(_0x233716,_0x346676){_0x233716=_0x233716-0x0;var _0x302298=_0xf022[_0x233716];return _0x302298;};'use strict';var _=require('lodash');var rp=require(_0x2f02('0x0'));var BPromise=require(_0x2f02('0x1'));var md5=require(_0x2f02('0x2'));var util=require(_0x2f02('0x3'));var Redis=require(_0x2f02('0x4'));var intUtil=require('./util');var config=require(_0x2f02('0x5'));var logger=require(_0x2f02('0x6'))(_0x2f02('0x7'));config[_0x2f02('0x8')]=_[_0x2f02('0x9')](config[_0x2f02('0x8')],{'host':_0x2f02('0xa'),'port':0x18eb});var io=require(_0x2f02('0xb'))(new Redis(config[_0x2f02('0x8')]));var def={'method':_0x2f02('0xc'),'json':!![]};function emit(_0x227d45,_0x3396f9,_0x362803){io['to'](_0x227d45)[_0x2f02('0xd')](_0x3396f9,_0x362803);}function getTicket(_0x4fc19f,_0x5e595c,_0x1fd1f1,_0x47396c,_0x2bc3c0,_0x2c169d,_0x2396f1,_0x551da1){logger[_0x2f02('0xe')](_0x2f02('0xf'));var _0xfc824b=new Date();var _0x463232=[{'name':_0x2f02('0x10'),'value':intUtil[_0x2f02('0x11')](_0x47396c[_0x2f02('0x12')],_0x2bc3c0,'\x20')},{'name':'assigned_user_id','value':_0x5e595c['id']},{'name':_0x2f02('0x13'),'value':_0x5e595c['id']},{'name':_0x2f02('0x14'),'value':intUtil['getString'](_0x47396c[_0x2f02('0x15')],_0x2bc3c0,'\x0a')},{'name':_0x2f02('0x16'),'value':_0xfc824b[_0x2f02('0x17')]()['slice'](0x0,0x13)[_0x2f02('0x18')]('T','\x20')},{'name':_0x2f02('0x19'),'value':'0'},{'name':_0x2f02('0x1a'),'value':'15'},{'name':_0x2f02('0x1b'),'value':_0x1fd1f1['id']},{'name':_0x2f02('0x1c'),'value':_0x2f02('0x1d')},{'name':_0x2f02('0x1e'),'value':_0x1fd1f1['name']},{'name':'direction','value':_0x551da1}];if(_0x2c169d['length']){_[_0x2f02('0x1f')](_0x2c169d,function(_0x4dde1c){if(_0x2bc3c0[_0x4dde1c[_0x2f02('0x20')]]){_0x463232[_0x2f02('0x21')]({'name':_0x4dde1c[_0x2f02('0x22')],'value':_0x2bc3c0[_0x4dde1c[_0x2f02('0x20')]]});}});}return request({'form':{'method':_0x2f02('0x23'),'input_type':_0x2f02('0x24'),'response_type':_0x2f02('0x24'),'rest_data':JSON[_0x2f02('0x25')]({'session':_0x2396f1['id'],'module_name':_0x2f02('0x26'),'name_value_list':_0x463232})}});}function getAuth(_0x15ffdf){return util[_0x2f02('0x27')](_0x2f02('0x28'),new Buffer(_0x15ffdf[_0x2f02('0x29')]+':X')['toString'](_0x2f02('0x2a')));}function getServerInfo(_0x3d2197){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x2f02('0x24'),'rest_data':JSON[_0x2f02('0x25')]({'session':_0x3d2197['id']})}});}function getUser(_0x268bc5,_0x1d18fd,_0xc018dd){if(!_[_0x2f02('0x2b')](_0x1d18fd)){logger[_0x2f02('0xe')](_0x2f02('0x2c'),_0x1d18fd);return request({'form':{'method':'get_entry_list','input_type':_0x2f02('0x24'),'response_type':_0x2f02('0x24'),'rest_data':JSON[_0x2f02('0x25')]({'session':_0xc018dd['id'],'module_name':_0x2f02('0x2d'),'query':util[_0x2f02('0x27')](_0x2f02('0x2e'),_0x1d18fd),'order_by':'','offset':'0','select_fields':['id','name',_0x2f02('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2f02('0x30')](function(_0x3366bc){if(_0x3366bc[_0x2f02('0x31')]['length']){var _0x5ee094=_[_0x2f02('0x32')](_0x3366bc[_0x2f02('0x31')],function(_0x3d37bb){return _0x3d37bb[_0x2f02('0x33')]['user_name'][_0x2f02('0x34')]===_0x1d18fd;});if(_0x5ee094){logger[_0x2f02('0xe')](_0x2f02('0x35'));return BPromise['resolve']({'id':_0x5ee094[_0x2f02('0x33')]['id'][_0x2f02('0x34')],'name':_0x5ee094[_0x2f02('0x33')][_0x2f02('0x10')][_0x2f02('0x34')]});}}logger[_0x2f02('0xe')](_0x2f02('0x36'));return BPromise[_0x2f02('0x37')]({'id':_0xc018dd[_0x2f02('0x33')][_0x2f02('0x38')][_0x2f02('0x34')],'name':_0xc018dd[_0x2f02('0x33')][_0x2f02('0x2f')][_0x2f02('0x34')]});});}else{logger[_0x2f02('0xe')](_0x2f02('0x39'));return BPromise[_0x2f02('0x37')]({'id':_0xc018dd[_0x2f02('0x33')][_0x2f02('0x38')][_0x2f02('0x34')],'name':_0xc018dd[_0x2f02('0x33')][_0x2f02('0x2f')]['value']});}}function getEndUser(_0x231bf7,_0x31a662,_0x46050f,_0x29db1e){logger['info'](_0x2f02('0x3a'),_0x46050f);return request({'form':{'method':_0x2f02('0x3b'),'input_type':_0x2f02('0x24'),'response_type':_0x2f02('0x24'),'rest_data':JSON[_0x2f02('0x25')]({'session':_0x29db1e['id'],'module_name':_0x2f02('0x1d'),'query':util[_0x2f02('0x27')](_0x2f02('0x3c'),_0x46050f),'order_by':'','offset':'0','select_fields':['id',_0x2f02('0x10'),_0x2f02('0x3d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2f02('0x30')](function(_0x1d8a65){if(_0x1d8a65['entry_list'][_0x2f02('0x3e')]){var _0x54deb4=_['find'](_0x1d8a65['entry_list'],function(_0x9e34c4){return _0x9e34c4['name_value_list'][_0x2f02('0x3d')][_0x2f02('0x34')]===_0x46050f;});if(_0x54deb4){logger[_0x2f02('0xe')](_0x2f02('0x3f'));return BPromise[_0x2f02('0x37')]({'id':_0x54deb4['name_value_list']['id'][_0x2f02('0x34')],'name':_0x54deb4[_0x2f02('0x33')][_0x2f02('0x10')][_0x2f02('0x34')],'phone':_0x54deb4[_0x2f02('0x33')][_0x2f02('0x3d')][_0x2f02('0x34')]});}}else{logger['info'](_0x2f02('0x40'));return request({'form':{'method':_0x2f02('0x23'),'input_type':_0x2f02('0x24'),'response_type':_0x2f02('0x24'),'rest_data':JSON[_0x2f02('0x25')]({'session':_0x29db1e['id'],'module_name':_0x2f02('0x1d'),'name_value_list':[{'name':'first_name','value':_0x31a662!==_0x2f02('0x41')?_0x31a662:util[_0x2f02('0x27')](_0x2f02('0x42'),_0x46050f)},{'name':'phone_home','value':_0x46050f}]})}})[_0x2f02('0x30')](function(_0x324e63){logger[_0x2f02('0xe')]('Enduser\x20created.');return BPromise['resolve']({'id':_0x324e63['id'],'name':_0x324e63['entry_list'][_0x2f02('0x43')][_0x2f02('0x34')],'phone':_0x324e63[_0x2f02('0x31')][_0x2f02('0x3d')]['value']});});}});}function request(_0x41949f){logger['debug']('[HTTP]',JSON[_0x2f02('0x25')](_0x41949f));return rp(_[_0x2f02('0x44')](def,_0x41949f));}function getTags(_0x22db33,_0x1baf68){var _0x11823a=[];if(_0x22db33&&_0x22db33[_0x2f02('0x3e')]>0x0){_0x11823a=_[_0x2f02('0x45')](_0x22db33,_0x1baf68);}return _0x11823a;}function getCustomFields(_0x5a0ada,_0x2d01b2){var _0x2785ab=[];var _0x109c89={'custom_fields':[]};if(_0x5a0ada['length']>0x0){_['forEach'](_0x5a0ada,function(_0x158487){if(_0x158487[_0x2f02('0x46')]===_0x2f02('0x47')&&_0x158487[_0x2f02('0x48')]&&!_0x158487[_0x2f02('0x49')]){_0x109c89[_0x158487[_0x2f02('0x48')][_0x2f02('0x4a')]()]=_0x158487[_0x2f02('0x4b')][_0x2f02('0x4c')]();}else if(_0x158487[_0x2f02('0x46')]===_0x2f02('0x47')&&_0x158487['idField']&&_0x158487[_0x2f02('0x49')]){_0x109c89['custom_fields']['push']({'id':_0x158487[_0x2f02('0x22')],'value':_0x158487[_0x2f02('0x4b')][_0x2f02('0x4c')]()});}else if(_0x158487[_0x2f02('0x46')]==='variable'&&_0x158487[_0x2f02('0x20')]&&_0x158487[_0x2f02('0x22')]&&_0x158487['customField']){_0x2d01b2[_0x158487[_0x2f02('0x20')]]&&_0x109c89[_0x2f02('0x4d')][_0x2f02('0x21')]({'id':_0x158487[_0x2f02('0x22')],'value':_0x2d01b2[_0x158487[_0x2f02('0x20')]][_0x2f02('0x4c')]()});}else if(_0x158487[_0x2f02('0x46')]===_0x2f02('0x4e')&&_0x158487[_0x2f02('0x4f')]&&_0x158487['Variable'][_0x2f02('0x10')]&&_0x158487[_0x2f02('0x22')]&&_0x158487[_0x2f02('0x49')]){_0x2d01b2[_0x158487['Variable'][_0x2f02('0x10')]['toLowerCase']()]&&_0x109c89['custom_fields'][_0x2f02('0x21')]({'id':_0x158487['idField'],'value':_0x2d01b2[_0x158487[_0x2f02('0x4f')][_0x2f02('0x10')][_0x2f02('0x4a')]()][_0x2f02('0x4c')]()});}});}return _0x109c89;}function getConnection(_0x467490){return request({'method':'POST','form':{'method':_0x2f02('0x50'),'input_type':_0x2f02('0x24'),'response_type':'JSON','rest_data':JSON[_0x2f02('0x25')]({'user_auth':{'user_name':_0x467490[_0x2f02('0x51')],'password':_0x467490[_0x2f02('0x52')],'encryption':_0x2f02('0x53')},'application':_0x2f02('0x54')})}})[_0x2f02('0x30')](function(_0x5004c2){var _0x1008dd=_0x5004c2;if(_0x1008dd['id']){def[_0x2f02('0x55')]=_0x1008dd['id'];return BPromise[_0x2f02('0x37')](_0x1008dd);}else{throw new Error(util['format'](_0x2f02('0x56'),_0x467490['id']));}});}function setRelationship(_0x5bdc7a,_0x441983,_0x5e3bd0,_0x32fa16){return request({'form':{'method':_0x2f02('0x57'),'input_type':'JSON','response_type':_0x2f02('0x24'),'rest_data':JSON[_0x2f02('0x25')]({'session':_0x5bdc7a['id'],'module_name':_0x2f02('0x26'),'module_id':_0x5e3bd0['id'],'link_field_name':_0x32fa16,'related_ids':[_0x441983['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x1a4549,_0x46a1b2,_0x583958,_0x3a7d0e,_0x39309a,_0x30ce23){var _0x4221b5,_0x167a02,_0x16f07b,_0x322fde;_0x30ce23[_0x2f02('0x58')]=intUtil[_0x2f02('0x59')](_0x30ce23['remoteUri']);_0x30ce23[_0x2f02('0x5a')]=intUtil[_0x2f02('0x59')](_0x30ce23[_0x2f02('0x5a')]);def[_0x2f02('0x5b')]=util['format']('%s/service/v4_1/rest.php',_0x30ce23[_0x2f02('0x58')]);if(_0x39309a&&_0x39309a[_0x2f02('0x5c')]){logger[_0x2f02('0xe')](_0x2f02('0x5d'),_0x2f02('0x5e'));_0x46a1b2[_0x2f02('0x5f')]=util[_0x2f02('0x27')](_0x2f02('0x60'),_0x30ce23[_0x2f02('0x5a')],_0x46a1b2[_0x2f02('0x61')],md5(_0x46a1b2[_0x2f02('0x61')]));}else{_0x46a1b2['recordingURL']='';}return getConnection(_0x30ce23)['then'](function(_0x2a5676){_0x322fde=_0x2a5676;return getUser(_0x30ce23,_0x3a7d0e[_0x2f02('0x10')],_0x322fde);})[_0x2f02('0x30')](function(_0x176ab3){_0x4221b5=_0x176ab3;logger['info'](_0x2f02('0x62'),_0x4221b5['id']);return getEndUser(_0x30ce23,_0x46a1b2['calleridname'],_0x46a1b2[_0x2f02('0x63')],_0x322fde);})[_0x2f02('0x30')](function(_0x3e6ffe){_0x167a02=_0x3e6ffe;logger[_0x2f02('0xe')](_0x2f02('0x64'),_0x167a02['id']);return getTicket(_0x30ce23,_0x4221b5,_0x167a02,_0x583958,_0x46a1b2,_0x583958[_0x2f02('0x65')],_0x322fde,'Inbound');})[_0x2f02('0x30')](function(_0x2c00b9){_0x16f07b=_0x2c00b9;logger['info'](_0x2f02('0x66'));logger[_0x2f02('0xe')](_0x2f02('0x67'),_0x16f07b['id']);return setRelationship(_0x322fde,_0x4221b5,_0x16f07b,_0x2f02('0x68'));})[_0x2f02('0x30')](function(){return setRelationship(_0x322fde,_0x167a02,_0x16f07b,_0x2f02('0x69'));})[_0x2f02('0x30')](function(){return getServerInfo(_0x322fde);})['then'](function(_0x5c614b){var _0x381af4=parseInt(_0x5c614b['version'][_0x2f02('0x6a')](0x0));var _0x3b5e69=util[_0x2f02('0x27')](_0x2f02('0x6b'),_0x30ce23[_0x2f02('0x58')],_0x16f07b['id']);if(_0x381af4>0x6){_0x3b5e69=util[_0x2f02('0x27')](_0x2f02('0x6c'),_0x30ce23['remoteUri'],_0x16f07b['id']);}logger[_0x2f02('0xe')]('[QUEUE]',_0x2f02('0x6d'));emit(util[_0x2f02('0x27')](_0x2f02('0x6e'),_0x3a7d0e[_0x2f02('0x10')]),_0x2f02('0x6f'),{'uri':_0x3b5e69});})['catch'](function(_0x320cc2){logger['error']('[QUEUE]',JSON[_0x2f02('0x25')](_0x320cc2));});};exports[_0x2f02('0x70')]=function(_0x35c5cb,_0x27d852,_0x435eac,_0x5d59f6,_0x4fdb8f,_0x4f5339,_0x23d339){var _0x286881,_0x1166b7,_0x555b3b,_0x5d7467;_0x4f5339[_0x2f02('0x58')]=intUtil[_0x2f02('0x59')](_0x4f5339['remoteUri']);_0x4f5339[_0x2f02('0x5a')]=intUtil[_0x2f02('0x59')](_0x4f5339[_0x2f02('0x5a')]);def['uri']=util[_0x2f02('0x27')](_0x2f02('0x71'),_0x4f5339[_0x2f02('0x58')]);if(_0x23d339&&_0x23d339[_0x2f02('0x72')]&&_0x23d339[_0x2f02('0x72')]!==_0x2f02('0x73')){logger[_0x2f02('0xe')](_0x2f02('0x74'),_0x2f02('0x5e'));_0x27d852[_0x2f02('0x5f')]=util[_0x2f02('0x27')](_0x2f02('0x60'),_0x4f5339[_0x2f02('0x5a')],_0x27d852[_0x2f02('0x61')],md5(_0x27d852[_0x2f02('0x61')]));}return getConnection(_0x4f5339)[_0x2f02('0x30')](function(_0x407987){_0x5d7467=_0x407987;return getUser(_0x4f5339,_0x5d59f6[_0x2f02('0x10')],_0x5d7467);})['then'](function(_0x51c914){_0x286881=_0x51c914;logger[_0x2f02('0xe')](_0x2f02('0x62'),_0x286881['id']);return getEndUser(_0x4f5339,_0x27d852[_0x2f02('0x75')],_0x27d852[_0x2f02('0x76')],_0x5d7467);})[_0x2f02('0x30')](function(_0x98daf0){_0x1166b7=_0x98daf0;logger[_0x2f02('0xe')](_0x2f02('0x64'),_0x1166b7['id']);return getTicket(_0x4f5339,_0x286881,_0x1166b7,_0x435eac,_0x27d852,_0x435eac[_0x2f02('0x65')],_0x5d7467,_0x2f02('0x77'));})['then'](function(_0x27136f){_0x555b3b=_0x27136f;logger[_0x2f02('0xe')]('Ticket\x20created!');logger[_0x2f02('0xe')](_0x2f02('0x67'),_0x555b3b['id']);return setRelationship(_0x5d7467,_0x286881,_0x555b3b,_0x2f02('0x68'));})[_0x2f02('0x30')](function(){return setRelationship(_0x5d7467,_0x1166b7,_0x555b3b,_0x2f02('0x69'));})['then'](function(){return getServerInfo(_0x5d7467);})['then'](function(_0x4de897){var _0x2c909=parseInt(_0x4de897[_0x2f02('0x78')][_0x2f02('0x6a')](0x0));var _0x4f77f7=util['format'](_0x2f02('0x6b'),_0x4f5339[_0x2f02('0x58')],_0x555b3b['id']);if(_0x2c909>0x6){_0x4f77f7=util['format'](_0x2f02('0x6c'),_0x4f5339[_0x2f02('0x58')],_0x555b3b['id']);}logger[_0x2f02('0xe')]('[OUTBOUND]',_0x2f02('0x6d'));emit(util[_0x2f02('0x27')](_0x2f02('0x6e'),_0x5d59f6['name']),_0x2f02('0x6f'),{'uri':_0x4f77f7});})['catch'](function(_0x484bf9){logger[_0x2f02('0x79')]('[OUTBOUND]',JSON[_0x2f02('0x25')](_0x484bf9));});};exports[_0x2f02('0x7a')]=function(_0x507f16,_0x20a55f,_0x3f9649,_0x4456fe,_0x2318a9,_0x49a4de){var _0xe9ce8e,_0x32ec18,_0xcaf908,_0x414180;_0x49a4de[_0x2f02('0x58')]=intUtil[_0x2f02('0x59')](_0x49a4de[_0x2f02('0x58')]);_0x49a4de['serverUrl']=intUtil[_0x2f02('0x59')](_0x49a4de[_0x2f02('0x5a')]);def[_0x2f02('0x5b')]=util['format'](_0x2f02('0x71'),_0x49a4de['remoteUri']);if(_0x2318a9&&_0x2318a9['monitor_format']){logger[_0x2f02('0xe')]('['+_0x20a55f[_0x2f02('0x7b')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x20a55f[_0x2f02('0x5f')]=util[_0x2f02('0x27')](_0x2f02('0x60'),_0x49a4de[_0x2f02('0x5a')],_0x20a55f[_0x2f02('0x61')],md5(_0x20a55f[_0x2f02('0x61')]));}else{_0x20a55f[_0x2f02('0x5f')]='';}return getConnection(_0x49a4de)[_0x2f02('0x30')](function(_0x3ca44b){_0x414180=_0x3ca44b;if(!_[_0x2f02('0x2b')](_0x4456fe)){return getUser(_0x49a4de,_0x4456fe[_0x2f02('0x10')],_0x414180);}else{return getUser(_0x49a4de,null,_0x414180);}})[_0x2f02('0x30')](function(_0x3551bd){_0xe9ce8e=_0x3551bd;logger[_0x2f02('0xe')]('The\x20User\x20ID\x20is:',_0xe9ce8e['id']);return getEndUser(_0x49a4de,_0x20a55f[_0x2f02('0x7c')],_0x20a55f[_0x2f02('0x63')],_0x414180);})[_0x2f02('0x30')](function(_0x1cb9b5){_0x32ec18=_0x1cb9b5;logger[_0x2f02('0xe')](_0x2f02('0x64'),_0x32ec18['id']);return getTicket(_0x49a4de,_0xe9ce8e,_0x32ec18,_0x3f9649,_0x20a55f,_0x3f9649['Fields'],_0x414180,'Inbound');})['then'](function(_0x36d275){_0xcaf908=_0x36d275;logger[_0x2f02('0xe')](_0x2f02('0x66'));logger[_0x2f02('0xe')](_0x2f02('0x67'),_0xcaf908['id']);return setRelationship(_0x414180,_0xe9ce8e,_0xcaf908,_0x2f02('0x68'));})[_0x2f02('0x30')](function(){return setRelationship(_0x414180,_0x32ec18,_0xcaf908,_0x2f02('0x69'));})['then'](function(){return getServerInfo(_0x414180);})[_0x2f02('0x7d')](function(_0x2a117f){logger[_0x2f02('0x79')]('['+_0x20a55f['lastevent']['toUpperCase']()+']',JSON[_0x2f02('0x25')](_0x2a117f));});}; \ No newline at end of file +var _0x1e35=['set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map','type','string','nameField','toLowerCase','customField','custom_fields','push','content','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','Calls','queue','stripTrailingSlash','remoteUri','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','uri','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','./util','../../../../config/environment','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','description','Descriptions','date_start','slice','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','direction','forEach','idField','variableName','Basic\x20%s','toString','base64','JSON','stringify','isNil','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','length','Enduser\x20found!'];(function(_0x2ea052,_0x338b39){var _0x14b6dc=function(_0x4d97be){while(--_0x4d97be){_0x2ea052['push'](_0x2ea052['shift']());}};_0x14b6dc(++_0x338b39);}(_0x1e35,0xbd));var _0x51e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e35[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x51e3('0x0'));var rp=require(_0x51e3('0x1'));var BPromise=require(_0x51e3('0x2'));var md5=require(_0x51e3('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x51e3('0x4'));var config=require(_0x51e3('0x5'));var logger=require('../../../../config/logger')(_0x51e3('0x6'));config['redis']=_[_0x51e3('0x7')](config[_0x51e3('0x8')],{'host':_0x51e3('0x9'),'port':0x18eb});var io=require(_0x51e3('0xa'))(new Redis(config['redis']));var def={'method':_0x51e3('0xb'),'json':!![]};function emit(_0x4fa704,_0x27a1ff,_0x4cfb2f){io['to'](_0x4fa704)[_0x51e3('0xc')](_0x27a1ff,_0x4cfb2f);}function getTicket(_0x330417,_0x401ac2,_0x29d6ef,_0x50c60c,_0x589f2b,_0x9003c6,_0x4400aa,_0x79423f){logger[_0x51e3('0xd')](_0x51e3('0xe'));var _0x49a1f6=new Date();var _0x476053=[{'name':_0x51e3('0xf'),'value':intUtil['getString'](_0x50c60c[_0x51e3('0x10')],_0x589f2b,'\x20')},{'name':_0x51e3('0x11'),'value':_0x401ac2['id']},{'name':'created_by','value':_0x401ac2['id']},{'name':_0x51e3('0x12'),'value':intUtil['getString'](_0x50c60c[_0x51e3('0x13')],_0x589f2b,'\x0a')},{'name':_0x51e3('0x14'),'value':_0x49a1f6['toISOString']()[_0x51e3('0x15')](0x0,0x13)[_0x51e3('0x16')]('T','\x20')},{'name':_0x51e3('0x17'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x51e3('0x18'),'value':_0x29d6ef['id']},{'name':_0x51e3('0x19'),'value':_0x51e3('0x1a')},{'name':_0x51e3('0x1b'),'value':_0x29d6ef['name']},{'name':_0x51e3('0x1c'),'value':_0x79423f}];if(_0x9003c6['length']){_[_0x51e3('0x1d')](_0x9003c6,function(_0xd6ebb1){if(_0x589f2b[_0xd6ebb1['variableName']]){_0x476053['push']({'name':_0xd6ebb1[_0x51e3('0x1e')],'value':_0x589f2b[_0xd6ebb1[_0x51e3('0x1f')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x4400aa['id'],'module_name':'Calls','name_value_list':_0x476053})}});}function getAuth(_0x4119ba){return util['format'](_0x51e3('0x20'),new Buffer(_0x4119ba['apiKey']+':X')[_0x51e3('0x21')](_0x51e3('0x22')));}function getServerInfo(_0x470cef){return request({'form':{'method':'get_server_info','input_type':_0x51e3('0x23'),'response_type':_0x51e3('0x23'),'rest_data':JSON[_0x51e3('0x24')]({'session':_0x470cef['id']})}});}function getUser(_0x5099f1,_0x3ffbc4,_0x53bd97){if(!_[_0x51e3('0x25')](_0x3ffbc4)){logger[_0x51e3('0xd')]('Getting\x20agent\x20with\x20name',_0x3ffbc4);return request({'form':{'method':'get_entry_list','input_type':_0x51e3('0x23'),'response_type':_0x51e3('0x23'),'rest_data':JSON[_0x51e3('0x24')]({'session':_0x53bd97['id'],'module_name':_0x51e3('0x26'),'query':util[_0x51e3('0x27')](_0x51e3('0x28'),_0x3ffbc4),'order_by':'','offset':'0','select_fields':['id',_0x51e3('0xf'),_0x51e3('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x51e3('0x2a')](function(_0x36f4b6){if(_0x36f4b6[_0x51e3('0x2b')]['length']){var _0x4b947b=_[_0x51e3('0x2c')](_0x36f4b6[_0x51e3('0x2b')],function(_0x2b9ced){return _0x2b9ced[_0x51e3('0x2d')][_0x51e3('0x29')][_0x51e3('0x2e')]===_0x3ffbc4;});if(_0x4b947b){logger[_0x51e3('0xd')](_0x51e3('0x2f'));return BPromise[_0x51e3('0x30')]({'id':_0x4b947b[_0x51e3('0x2d')]['id'][_0x51e3('0x2e')],'name':_0x4b947b[_0x51e3('0x2d')][_0x51e3('0xf')][_0x51e3('0x2e')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x51e3('0x30')]({'id':_0x53bd97[_0x51e3('0x2d')][_0x51e3('0x31')][_0x51e3('0x2e')],'name':_0x53bd97[_0x51e3('0x2d')][_0x51e3('0x29')][_0x51e3('0x2e')]});});}else{logger[_0x51e3('0xd')](_0x51e3('0x32'));return BPromise[_0x51e3('0x30')]({'id':_0x53bd97[_0x51e3('0x2d')][_0x51e3('0x31')][_0x51e3('0x2e')],'name':_0x53bd97[_0x51e3('0x2d')][_0x51e3('0x29')][_0x51e3('0x2e')]});}}function getEndUser(_0xa82c3f,_0x1a288f,_0x118fc1,_0x4d1557){logger['info'](_0x51e3('0x33'),_0x118fc1);return request({'form':{'method':_0x51e3('0x34'),'input_type':_0x51e3('0x23'),'response_type':_0x51e3('0x23'),'rest_data':JSON['stringify']({'session':_0x4d1557['id'],'module_name':_0x51e3('0x1a'),'query':util['format'](_0x51e3('0x35'),_0x118fc1),'order_by':'','offset':'0','select_fields':['id',_0x51e3('0xf'),_0x51e3('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x51e3('0x2a')](function(_0x5e709b){if(_0x5e709b[_0x51e3('0x2b')][_0x51e3('0x37')]){var _0x46fc5f=_[_0x51e3('0x2c')](_0x5e709b['entry_list'],function(_0x17a14d){return _0x17a14d[_0x51e3('0x2d')]['phone_home'][_0x51e3('0x2e')]===_0x118fc1;});if(_0x46fc5f){logger['info'](_0x51e3('0x38'));return BPromise[_0x51e3('0x30')]({'id':_0x46fc5f[_0x51e3('0x2d')]['id'][_0x51e3('0x2e')],'name':_0x46fc5f[_0x51e3('0x2d')][_0x51e3('0xf')][_0x51e3('0x2e')],'phone':_0x46fc5f[_0x51e3('0x2d')]['phone_home'][_0x51e3('0x2e')]});}}else{logger[_0x51e3('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x51e3('0x39'),'input_type':_0x51e3('0x23'),'response_type':_0x51e3('0x23'),'rest_data':JSON[_0x51e3('0x24')]({'session':_0x4d1557['id'],'module_name':_0x51e3('0x1a'),'name_value_list':[{'name':_0x51e3('0x3a'),'value':_0x1a288f!==_0x51e3('0x3b')?_0x1a288f:util[_0x51e3('0x27')](_0x51e3('0x3c'),_0x118fc1)},{'name':'phone_home','value':_0x118fc1}]})}})[_0x51e3('0x2a')](function(_0xe5bc31){logger[_0x51e3('0xd')](_0x51e3('0x3d'));return BPromise[_0x51e3('0x30')]({'id':_0xe5bc31['id'],'name':_0xe5bc31['entry_list']['first_name'][_0x51e3('0x2e')],'phone':_0xe5bc31['entry_list']['phone_home'][_0x51e3('0x2e')]});});}});}function request(_0x2dcc5e){logger['debug'](_0x51e3('0x3e'),JSON['stringify'](_0x2dcc5e));return rp(_[_0x51e3('0x3f')](def,_0x2dcc5e));}function getTags(_0x450eda,_0x203af4){var _0x26a598=[];if(_0x450eda&&_0x450eda[_0x51e3('0x37')]>0x0){_0x26a598=_[_0x51e3('0x40')](_0x450eda,_0x203af4);}return _0x26a598;}function getCustomFields(_0x4587c7,_0x3e5d16){var _0x603002=[];var _0x39ab47={'custom_fields':[]};if(_0x4587c7[_0x51e3('0x37')]>0x0){_[_0x51e3('0x1d')](_0x4587c7,function(_0x419fd9){if(_0x419fd9[_0x51e3('0x41')]===_0x51e3('0x42')&&_0x419fd9[_0x51e3('0x43')]&&!_0x419fd9['customField']){_0x39ab47[_0x419fd9[_0x51e3('0x43')][_0x51e3('0x44')]()]=_0x419fd9['content']['toString']();}else if(_0x419fd9[_0x51e3('0x41')]===_0x51e3('0x42')&&_0x419fd9[_0x51e3('0x1e')]&&_0x419fd9[_0x51e3('0x45')]){_0x39ab47[_0x51e3('0x46')][_0x51e3('0x47')]({'id':_0x419fd9[_0x51e3('0x1e')],'value':_0x419fd9[_0x51e3('0x48')][_0x51e3('0x21')]()});}else if(_0x419fd9[_0x51e3('0x41')]==='variable'&&_0x419fd9[_0x51e3('0x1f')]&&_0x419fd9[_0x51e3('0x1e')]&&_0x419fd9[_0x51e3('0x45')]){_0x3e5d16[_0x419fd9['variableName']]&&_0x39ab47['custom_fields']['push']({'id':_0x419fd9['idField'],'value':_0x3e5d16[_0x419fd9[_0x51e3('0x1f')]][_0x51e3('0x21')]()});}else if(_0x419fd9[_0x51e3('0x41')]===_0x51e3('0x49')&&_0x419fd9[_0x51e3('0x4a')]&&_0x419fd9[_0x51e3('0x4a')]['name']&&_0x419fd9[_0x51e3('0x1e')]&&_0x419fd9[_0x51e3('0x45')]){_0x3e5d16[_0x419fd9[_0x51e3('0x4a')][_0x51e3('0xf')][_0x51e3('0x44')]()]&&_0x39ab47[_0x51e3('0x46')]['push']({'id':_0x419fd9[_0x51e3('0x1e')],'value':_0x3e5d16[_0x419fd9[_0x51e3('0x4a')][_0x51e3('0xf')][_0x51e3('0x44')]()][_0x51e3('0x21')]()});}});}return _0x39ab47;}function getConnection(_0x2635d2){return request({'method':_0x51e3('0xb'),'form':{'method':'login','input_type':_0x51e3('0x23'),'response_type':_0x51e3('0x23'),'rest_data':JSON[_0x51e3('0x24')]({'user_auth':{'user_name':_0x2635d2[_0x51e3('0x4b')],'password':_0x2635d2[_0x51e3('0x4c')],'encryption':_0x51e3('0x4d')},'application':_0x51e3('0x4e')})}})['then'](function(_0x47914e){var _0x361271=_0x47914e;if(_0x361271['id']){def[_0x51e3('0x4f')]=_0x361271['id'];return BPromise['resolve'](_0x361271);}else{throw new Error(util[_0x51e3('0x27')](_0x51e3('0x50'),_0x2635d2['id']));}});}function setRelationship(_0x165934,_0x586994,_0x2e3a2,_0x56eb48){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0x51e3('0x23'),'rest_data':JSON[_0x51e3('0x24')]({'session':_0x165934['id'],'module_name':_0x51e3('0x51'),'module_id':_0x2e3a2['id'],'link_field_name':_0x56eb48,'related_ids':[_0x586994['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x51e3('0x52')]=function(_0x2e303f,_0x1d3d71,_0x3a2ad9,_0x3b36d4,_0x22f2f1,_0x1e5385){var _0xa5f618,_0x3881ef,_0x54cd6d,_0x4dd8fc;_0x1e5385['remoteUri']=intUtil[_0x51e3('0x53')](_0x1e5385[_0x51e3('0x54')]);_0x1e5385[_0x51e3('0x55')]=intUtil[_0x51e3('0x53')](_0x1e5385[_0x51e3('0x55')]);def['uri']=util['format'](_0x51e3('0x56'),_0x1e5385[_0x51e3('0x54')]);if(_0x22f2f1&&_0x22f2f1[_0x51e3('0x57')]){logger[_0x51e3('0xd')](_0x51e3('0x58'),_0x51e3('0x59'));_0x1d3d71[_0x51e3('0x5a')]=util[_0x51e3('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1e5385['serverUrl'],_0x1d3d71[_0x51e3('0x5b')],md5(_0x1d3d71[_0x51e3('0x5b')]));}else{_0x1d3d71[_0x51e3('0x5a')]='';}return getConnection(_0x1e5385)[_0x51e3('0x2a')](function(_0x4ad9a2){_0x4dd8fc=_0x4ad9a2;return getUser(_0x1e5385,_0x3b36d4[_0x51e3('0xf')],_0x4dd8fc);})[_0x51e3('0x2a')](function(_0x16e745){_0xa5f618=_0x16e745;logger['info'](_0x51e3('0x5c'),_0xa5f618['id']);return getEndUser(_0x1e5385,_0x1d3d71[_0x51e3('0x5d')],_0x1d3d71[_0x51e3('0x5e')],_0x4dd8fc);})[_0x51e3('0x2a')](function(_0x1a96e9){_0x3881ef=_0x1a96e9;logger['info'](_0x51e3('0x5f'),_0x3881ef['id']);return getTicket(_0x1e5385,_0xa5f618,_0x3881ef,_0x3a2ad9,_0x1d3d71,_0x3a2ad9[_0x51e3('0x60')],_0x4dd8fc,_0x51e3('0x61'));})[_0x51e3('0x2a')](function(_0x2af634){_0x54cd6d=_0x2af634;logger['info'](_0x51e3('0x62'));logger['info'](_0x51e3('0x63'),_0x54cd6d['id']);return setRelationship(_0x4dd8fc,_0xa5f618,_0x54cd6d,_0x51e3('0x64'));})[_0x51e3('0x2a')](function(){return setRelationship(_0x4dd8fc,_0x3881ef,_0x54cd6d,_0x51e3('0x65'));})[_0x51e3('0x2a')](function(){return getServerInfo(_0x4dd8fc);})[_0x51e3('0x2a')](function(_0x4b5ecb){var _0x5e5d1b=parseInt(_0x4b5ecb[_0x51e3('0x66')][_0x51e3('0x67')](0x0));var _0x100294=util['format'](_0x51e3('0x68'),_0x1e5385[_0x51e3('0x54')],_0x54cd6d['id']);if(_0x5e5d1b>0x6){_0x100294=util[_0x51e3('0x27')](_0x51e3('0x69'),_0x1e5385[_0x51e3('0x54')],_0x54cd6d['id']);}logger[_0x51e3('0xd')](_0x51e3('0x58'),_0x51e3('0x6a'));emit(util[_0x51e3('0x27')](_0x51e3('0x6b'),_0x3b36d4[_0x51e3('0xf')]),'trigger:browser:url',{'uri':_0x100294});})[_0x51e3('0x6c')](function(_0x50ec58){logger[_0x51e3('0x6d')]('[QUEUE]',JSON[_0x51e3('0x24')](_0x50ec58));});};exports[_0x51e3('0x6e')]=function(_0x23c55c,_0x44cb3e,_0x1c9ffd,_0x13cfcb,_0x1b8cc7,_0x2675bb,_0x3ef903){var _0x44d438,_0x55f90f,_0x542b14,_0x1d32f0;_0x2675bb[_0x51e3('0x54')]=intUtil[_0x51e3('0x53')](_0x2675bb['remoteUri']);_0x2675bb['serverUrl']=intUtil['stripTrailingSlash'](_0x2675bb[_0x51e3('0x55')]);def[_0x51e3('0x6f')]=util[_0x51e3('0x27')](_0x51e3('0x56'),_0x2675bb[_0x51e3('0x54')]);if(_0x3ef903&&_0x3ef903[_0x51e3('0x70')]&&_0x3ef903[_0x51e3('0x70')]!==_0x51e3('0x71')){logger[_0x51e3('0xd')](_0x51e3('0x72'),_0x51e3('0x59'));_0x44cb3e[_0x51e3('0x5a')]=util['format'](_0x51e3('0x73'),_0x2675bb[_0x51e3('0x55')],_0x44cb3e[_0x51e3('0x5b')],md5(_0x44cb3e['uniqueid']));}return getConnection(_0x2675bb)[_0x51e3('0x2a')](function(_0x524523){_0x1d32f0=_0x524523;return getUser(_0x2675bb,_0x13cfcb[_0x51e3('0xf')],_0x1d32f0);})['then'](function(_0x392174){_0x44d438=_0x392174;logger['info'](_0x51e3('0x5c'),_0x44d438['id']);return getEndUser(_0x2675bb,_0x44cb3e[_0x51e3('0x74')],_0x44cb3e[_0x51e3('0x75')],_0x1d32f0);})[_0x51e3('0x2a')](function(_0x2194c8){_0x55f90f=_0x2194c8;logger['info'](_0x51e3('0x5f'),_0x55f90f['id']);return getTicket(_0x2675bb,_0x44d438,_0x55f90f,_0x1c9ffd,_0x44cb3e,_0x1c9ffd['Fields'],_0x1d32f0,_0x51e3('0x76'));})['then'](function(_0x575314){_0x542b14=_0x575314;logger[_0x51e3('0xd')](_0x51e3('0x62'));logger[_0x51e3('0xd')]('The\x20Ticket\x20ID\x20is:',_0x542b14['id']);return setRelationship(_0x1d32f0,_0x44d438,_0x542b14,'users');})['then'](function(){return setRelationship(_0x1d32f0,_0x55f90f,_0x542b14,_0x51e3('0x65'));})[_0x51e3('0x2a')](function(){return getServerInfo(_0x1d32f0);})['then'](function(_0x128b60){var _0x255bdf=parseInt(_0x128b60[_0x51e3('0x66')][_0x51e3('0x67')](0x0));var _0xd0e65e=util[_0x51e3('0x27')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2675bb[_0x51e3('0x54')],_0x542b14['id']);if(_0x255bdf>0x6){_0xd0e65e=util[_0x51e3('0x27')](_0x51e3('0x69'),_0x2675bb['remoteUri'],_0x542b14['id']);}logger[_0x51e3('0xd')](_0x51e3('0x72'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x51e3('0x27')](_0x51e3('0x6b'),_0x13cfcb[_0x51e3('0xf')]),_0x51e3('0x77'),{'uri':_0xd0e65e});})[_0x51e3('0x6c')](function(_0x1f65c9){logger[_0x51e3('0x6d')](_0x51e3('0x72'),JSON[_0x51e3('0x24')](_0x1f65c9));});};exports[_0x51e3('0x78')]=function(_0x4d0be5,_0x27ab7a,_0x5614d1,_0x3d9c88,_0x3802f8,_0x417ab6){var _0x92db7a,_0x342dae,_0x2b989a,_0x226bed;_0x417ab6[_0x51e3('0x54')]=intUtil['stripTrailingSlash'](_0x417ab6[_0x51e3('0x54')]);_0x417ab6[_0x51e3('0x55')]=intUtil['stripTrailingSlash'](_0x417ab6[_0x51e3('0x55')]);def[_0x51e3('0x6f')]=util[_0x51e3('0x27')](_0x51e3('0x56'),_0x417ab6[_0x51e3('0x54')]);if(_0x3802f8&&_0x3802f8['monitor_format']){logger[_0x51e3('0xd')]('['+_0x27ab7a[_0x51e3('0x79')][_0x51e3('0x7a')]()+']',_0x51e3('0x59'));_0x27ab7a[_0x51e3('0x5a')]=util[_0x51e3('0x27')](_0x51e3('0x73'),_0x417ab6[_0x51e3('0x55')],_0x27ab7a[_0x51e3('0x5b')],md5(_0x27ab7a[_0x51e3('0x5b')]));}else{_0x27ab7a[_0x51e3('0x5a')]='';}return getConnection(_0x417ab6)[_0x51e3('0x2a')](function(_0x1e8789){_0x226bed=_0x1e8789;if(!_['isNil'](_0x3d9c88)){return getUser(_0x417ab6,_0x3d9c88[_0x51e3('0xf')],_0x226bed);}else{return getUser(_0x417ab6,null,_0x226bed);}})[_0x51e3('0x2a')](function(_0x1e4d74){_0x92db7a=_0x1e4d74;logger[_0x51e3('0xd')](_0x51e3('0x5c'),_0x92db7a['id']);return getEndUser(_0x417ab6,_0x27ab7a[_0x51e3('0x5d')],_0x27ab7a[_0x51e3('0x5e')],_0x226bed);})[_0x51e3('0x2a')](function(_0x4fb9a8){_0x342dae=_0x4fb9a8;logger[_0x51e3('0xd')](_0x51e3('0x5f'),_0x342dae['id']);return getTicket(_0x417ab6,_0x92db7a,_0x342dae,_0x5614d1,_0x27ab7a,_0x5614d1['Fields'],_0x226bed,_0x51e3('0x61'));})[_0x51e3('0x2a')](function(_0x43eda5){_0x2b989a=_0x43eda5;logger[_0x51e3('0xd')](_0x51e3('0x62'));logger['info'](_0x51e3('0x63'),_0x2b989a['id']);return setRelationship(_0x226bed,_0x92db7a,_0x2b989a,'users');})['then'](function(){return setRelationship(_0x226bed,_0x342dae,_0x2b989a,_0x51e3('0x65'));})['then'](function(){return getServerInfo(_0x226bed);})[_0x51e3('0x6c')](function(_0x8d6f73){logger['error']('['+_0x27ab7a[_0x51e3('0x79')]['toUpperCase']()+']',JSON[_0x51e3('0x24')](_0x8d6f73));});}; \ 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 3d3174b..8d29fce 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 _0xffdc=['getString','length','sortBy','type','push','content','customVariable','name','Variable','toLowerCase','toString','keyValue','keyType','string','key','format','%s:\x20%s','keyContent','variableName','join','stripTrailingSlash','slice','substring','validateEmail','isNil','test','lodash'];(function(_0x327950,_0x3c07d8){var _0x3dc1c4=function(_0x1076a6){while(--_0x1076a6){_0x327950['push'](_0x327950['shift']());}};_0x3dc1c4(++_0x3c07d8);}(_0xffdc,0x1af));var _0xcffd=function(_0x1c52ef,_0x43185f){_0x1c52ef=_0x1c52ef-0x0;var _0x20ebcd=_0xffdc[_0x1c52ef];return _0x20ebcd;};'use strict';var _=require(_0xcffd('0x0'));var util=require('util');exports[_0xcffd('0x1')]=function(_0x31f7e5,_0x4befd0,_0x4c36c4){var _0xd43032=[];if(_0x31f7e5[_0xcffd('0x2')]>0x0){var _0x37b18f=_[_0xcffd('0x3')](_0x31f7e5,['id']);for(var _0x4dba63=0x0;_0x4dba63<_0x37b18f[_0xcffd('0x2')];_0x4dba63++){var _0x2c3ca1=_0x37b18f[_0x4dba63];if(_0x2c3ca1[_0xcffd('0x4')]==='string'){_0xd43032[_0xcffd('0x5')](_0x2c3ca1[_0xcffd('0x6')]);}else if(_0x2c3ca1[_0xcffd('0x4')]==='variable'&&_0x2c3ca1['variableName']){_0x4befd0[_0x2c3ca1['variableName']]&&_0xd43032['push'](_0x4befd0[_0x2c3ca1['variableName']]['toString']());}else if(_0x2c3ca1['type']===_0xcffd('0x7')&&_0x2c3ca1['Variable']&&_0x2c3ca1['Variable'][_0xcffd('0x8')]){_0x4befd0[_0x2c3ca1[_0xcffd('0x9')]['name'][_0xcffd('0xa')]()]&&_0xd43032[_0xcffd('0x5')](_0x4befd0[_0x2c3ca1[_0xcffd('0x9')][_0xcffd('0x8')]['toLowerCase']()][_0xcffd('0xb')]());}else if(_0x2c3ca1[_0xcffd('0x4')]===_0xcffd('0xc')){if(_0x2c3ca1[_0xcffd('0xd')]===_0xcffd('0xe')&&_0x2c3ca1[_0xcffd('0xf')]){_0xd43032[_0xcffd('0x5')](util[_0xcffd('0x10')](_0xcffd('0x11'),_0x2c3ca1[_0xcffd('0xf')],_0x2c3ca1[_0xcffd('0x12')]));}else if(_0x2c3ca1[_0xcffd('0xd')]==='variable'&&_0x2c3ca1[_0xcffd('0x13')]&&_0x2c3ca1[_0xcffd('0xf')]){_0x4befd0[_0x2c3ca1[_0xcffd('0x13')]]&&_0xd43032[_0xcffd('0x5')](util[_0xcffd('0x10')](_0xcffd('0x11'),_0x2c3ca1[_0xcffd('0xf')],_0x4befd0[_0x2c3ca1[_0xcffd('0x13')]]));}else if(_0x2c3ca1['keyType']===_0xcffd('0x7')&&_0x2c3ca1[_0xcffd('0x9')]&&_0x2c3ca1['Variable']['name']&&_0x2c3ca1['key']){_0x4befd0[_0x2c3ca1[_0xcffd('0x9')][_0xcffd('0x8')][_0xcffd('0xa')]()]&&_0xd43032[_0xcffd('0x5')](util[_0xcffd('0x10')](_0xcffd('0x11'),_0x2c3ca1[_0xcffd('0xf')],_0x4befd0[_0x2c3ca1[_0xcffd('0x9')][_0xcffd('0x8')][_0xcffd('0xa')]()]));}}}}return _0xd43032[_0xcffd('0x14')](_0x4c36c4);};exports[_0xcffd('0x15')]=function(_0x4acb85){var _0x24a000=_0x4acb85[_0xcffd('0x16')](-0x1);if(_0x24a000==='/'){_0x4acb85=_0x4acb85[_0xcffd('0x17')](0x0,_0x4acb85['lastIndexOf'](_0x24a000));}return _0x4acb85;};exports[_0xcffd('0x18')]=function(_0x16e9fb){if(!_[_0xcffd('0x19')](_0x16e9fb)&&_0x16e9fb!==''){var _0x3e273f=/^(([^<>()\[\]\\.,;:\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 _0x3e273f[_0xcffd('0x1a')](String(_0x16e9fb)[_0xcffd('0xa')]());}else{return![];}}; \ No newline at end of file +var _0xb1f7=['validateEmail','isNil','lodash','getString','length','type','string','content','variableName','toString','customVariable','Variable','name','toLowerCase','push','keyType','key','%s:\x20%s','keyContent','format'];(function(_0x44dbc2,_0x333e80){var _0x4e4bed=function(_0x3f4a52){while(--_0x3f4a52){_0x44dbc2['push'](_0x44dbc2['shift']());}};_0x4e4bed(++_0x333e80);}(_0xb1f7,0x7a));var _0x7b1f=function(_0x5056d9,_0x1f678c){_0x5056d9=_0x5056d9-0x0;var _0x166f29=_0xb1f7[_0x5056d9];return _0x166f29;};'use strict';var _=require(_0x7b1f('0x0'));var util=require('util');exports[_0x7b1f('0x1')]=function(_0x996cd0,_0x45c538,_0x451c9a){var _0x58b4ea=[];if(_0x996cd0[_0x7b1f('0x2')]>0x0){var _0x4e8cbd=_['sortBy'](_0x996cd0,['id']);for(var _0x1552d6=0x0;_0x1552d6<_0x4e8cbd[_0x7b1f('0x2')];_0x1552d6++){var _0x5576dc=_0x4e8cbd[_0x1552d6];if(_0x5576dc[_0x7b1f('0x3')]===_0x7b1f('0x4')){_0x58b4ea['push'](_0x5576dc[_0x7b1f('0x5')]);}else if(_0x5576dc[_0x7b1f('0x3')]==='variable'&&_0x5576dc[_0x7b1f('0x6')]){_0x45c538[_0x5576dc[_0x7b1f('0x6')]]&&_0x58b4ea['push'](_0x45c538[_0x5576dc[_0x7b1f('0x6')]][_0x7b1f('0x7')]());}else if(_0x5576dc[_0x7b1f('0x3')]===_0x7b1f('0x8')&&_0x5576dc['Variable']&&_0x5576dc[_0x7b1f('0x9')][_0x7b1f('0xa')]){_0x45c538[_0x5576dc[_0x7b1f('0x9')][_0x7b1f('0xa')][_0x7b1f('0xb')]()]&&_0x58b4ea[_0x7b1f('0xc')](_0x45c538[_0x5576dc['Variable']['name']['toLowerCase']()][_0x7b1f('0x7')]());}else if(_0x5576dc[_0x7b1f('0x3')]==='keyValue'){if(_0x5576dc[_0x7b1f('0xd')]===_0x7b1f('0x4')&&_0x5576dc[_0x7b1f('0xe')]){_0x58b4ea[_0x7b1f('0xc')](util['format'](_0x7b1f('0xf'),_0x5576dc[_0x7b1f('0xe')],_0x5576dc[_0x7b1f('0x10')]));}else if(_0x5576dc[_0x7b1f('0xd')]==='variable'&&_0x5576dc[_0x7b1f('0x6')]&&_0x5576dc['key']){_0x45c538[_0x5576dc[_0x7b1f('0x6')]]&&_0x58b4ea['push'](util[_0x7b1f('0x11')](_0x7b1f('0xf'),_0x5576dc['key'],_0x45c538[_0x5576dc['variableName']]));}else if(_0x5576dc[_0x7b1f('0xd')]===_0x7b1f('0x8')&&_0x5576dc[_0x7b1f('0x9')]&&_0x5576dc[_0x7b1f('0x9')][_0x7b1f('0xa')]&&_0x5576dc[_0x7b1f('0xe')]){_0x45c538[_0x5576dc[_0x7b1f('0x9')]['name'][_0x7b1f('0xb')]()]&&_0x58b4ea['push'](util[_0x7b1f('0x11')]('%s:\x20%s',_0x5576dc[_0x7b1f('0xe')],_0x45c538[_0x5576dc[_0x7b1f('0x9')][_0x7b1f('0xa')][_0x7b1f('0xb')]()]));}}}}return _0x58b4ea['join'](_0x451c9a);};exports['stripTrailingSlash']=function(_0x50ccfa){var _0x39c9b9=_0x50ccfa['slice'](-0x1);if(_0x39c9b9==='/'){_0x50ccfa=_0x50ccfa['substring'](0x0,_0x50ccfa['lastIndexOf'](_0x39c9b9));}return _0x50ccfa;};exports[_0x7b1f('0x12')]=function(_0x50dcca){if(!_[_0x7b1f('0x13')](_0x50dcca)&&_0x50dcca!==''){var _0x5dd502=/^(([^<>()\[\]\\.,;:\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 _0x5dd502['test'](String(_0x50dcca)[_0x7b1f('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 d4d8c0b..bc12a41 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(_0x204d2a,_0x4548c5){var _0x2b4e09=function(_0x456f41){while(--_0x456f41){_0x204d2a['push'](_0x204d2a['shift']());}};_0x2b4e09(++_0x4548c5);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'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 _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x25b72e,_0x4477f1){var _0x437744=function(_0x49d727){while(--_0x49d727){_0x25b72e['push'](_0x25b72e['shift']());}};_0x437744(++_0x4477f1);}(_0xe706,0xa3));var _0x6e70=function(_0x30aa48,_0x5cf0c9){_0x30aa48=_0x30aa48-0x0;var _0x35fc1f=_0xe706[_0x30aa48];return _0x35fc1f;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 4674b79..bf81c68 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 _0x7462=['includes','picklist','type','customField','toLowerCase','string','idField','custom_fields','push','content','variable','variableName','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','integrationTab','[QUEUE]','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','The\x20Ticket\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','util','ioredis','redis','defaults','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','merge','Subjects','getString','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','count','Agent\x20found!','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','password','username','authType','%s/token:%s','token','Basic\x20%s','toString','base64','debug','[HTTP]','map','forEach'];(function(_0x60ebb0,_0x1371ce){var _0x4ea9ed=function(_0x2555a7){while(--_0x2555a7){_0x60ebb0['push'](_0x60ebb0['shift']());}};_0x4ea9ed(++_0x1371ce);}(_0x7462,0xf8));var _0x2746=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x7462[_0x3f5dca];return _0x5b833a;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x2746('0x0'));var Redis=require(_0x2746('0x1'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('zendesk');config[_0x2746('0x2')]=_[_0x2746('0x3')](config[_0x2746('0x2')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x3cfaa8,_0x28efbd,_0x23bc62){io['to'](_0x3cfaa8)['emit'](_0x28efbd,_0x23bc62);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x551785,_0xede901,_0x1b9ff8,_0x1f390a,_0x229123){logger[_0x2746('0x4')](_0x2746('0x5'));return request({'uri':util['format'](_0x2746('0x6'),_0x551785[_0x2746('0x7')]),'method':'POST','body':{'ticket':_[_0x2746('0x8')]({'requester_id':_0x1b9ff8['id'],'submitter_id':_0xede901?_0xede901['id']:undefined,'assignee_id':_0xede901?_0xede901['id']:undefined,'tags':getTags(_0x1f390a['Tags'],'name'),'subject':intUtil['getString'](_0x1f390a[_0x2746('0x9')],_0x229123,'\x20'),'description':intUtil['getString'](_0x1f390a['Descriptions'],_0x229123,'\x0a'),'comment':{'public':![],'body':intUtil[_0x2746('0xa')](_0x1f390a[_0x2746('0xb')],_0x229123,'\x0a')}},getCustomFields(_0x1f390a['Fields'],_0x229123))}})[_0x2746('0xc')](function(_0x565d3f){logger[_0x2746('0x4')](_0x2746('0xd'));return _0x565d3f[_0x2746('0xe')];});}function getUser(_0x28c4d9,_0x79fcb){if(intUtil[_0x2746('0xf')](_0x79fcb)){logger['info'](_0x2746('0x10'),_0x79fcb);return request({'uri':util[_0x2746('0x11')](_0x2746('0x12'),_0x28c4d9['remoteUri']),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x79fcb)}})[_0x2746('0xc')](function(_0x14d7f6){if(_0x14d7f6[_0x2746('0x13')]){logger[_0x2746('0x4')](_0x2746('0x14'));return _['find'](_0x14d7f6[_0x2746('0x15')],{'email':_0x79fcb,'role':'agent'});}else{logger[_0x2746('0x4')](_0x2746('0x16'));return request({'uri':util[_0x2746('0x11')](_0x2746('0x17'),_0x28c4d9[_0x2746('0x7')])})['then'](function(_0x89687e){logger[_0x2746('0x4')](_0x2746('0x18'));return _0x89687e[_0x2746('0x19')];});}});}else{logger[_0x2746('0x4')](_0x2746('0x16'));return request({'uri':util[_0x2746('0x11')](_0x2746('0x17'),_0x28c4d9[_0x2746('0x7')])})[_0x2746('0xc')](function(_0x3f6de0){logger[_0x2746('0x4')](_0x2746('0x18'));return _0x3f6de0[_0x2746('0x19')];});}}function getEndUser(_0x62cbc5,_0x23771b,_0x271d3e){logger[_0x2746('0x4')]('Searching\x20enduser\x20with\x20phone',_0x271d3e);return request({'uri':util['format']('%s/search.json',_0x62cbc5[_0x2746('0x7')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x271d3e)}})[_0x2746('0xc')](function(_0x56f102){var _0x49769b;if(_0x56f102[_0x2746('0x15')]['length']){_0x56f102['results']=_[_0x2746('0x1a')](_0x56f102[_0x2746('0x15')],{'suspended':![],'role':_0x2746('0x1b')});if(_0x56f102['results'][_0x2746('0x1c')]){_0x49769b=_[_0x2746('0x1d')](_0x56f102[_0x2746('0x15')]);}}if(_0x49769b){logger['info'](_0x2746('0x1e'));return _0x49769b;}else{logger[_0x2746('0x4')](_0x2746('0x1f'));return request({'uri':util['format']('%s/users.json',_0x62cbc5[_0x2746('0x7')]),'method':_0x2746('0x20'),'body':{'user':{'role':_0x2746('0x1b'),'name':util[_0x2746('0x11')]('Caller\x20-\x20%s',_0x23771b||_0x271d3e),'phone':_0x271d3e}}})[_0x2746('0xc')](function(_0x5792ec){logger[_0x2746('0x4')](_0x2746('0x21'));return _0x5792ec[_0x2746('0x19')];});}});}function getAuth(_0x370abe){var _0x24c961;if(_0x370abe['authType']===_0x2746('0x22')){_0x24c961=util[_0x2746('0x11')]('%s:%s',_0x370abe[_0x2746('0x23')],_0x370abe[_0x2746('0x22')]);}else if(_0x370abe[_0x2746('0x24')]==='token'){_0x24c961=util[_0x2746('0x11')](_0x2746('0x25'),_0x370abe[_0x2746('0x23')],_0x370abe[_0x2746('0x26')]);}return util[_0x2746('0x11')](_0x2746('0x27'),new Buffer(_0x24c961)[_0x2746('0x28')](_0x2746('0x29')));}function request(_0x13f163){logger[_0x2746('0x2a')](_0x2746('0x2b'),JSON['stringify'](_0x13f163));return rp(_[_0x2746('0x3')](_0x13f163,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x25e790,_0x1ea737){var _0x4e797e=[];if(_0x25e790&&_0x25e790[_0x2746('0x1c')]>0x0){_0x4e797e=_[_0x2746('0x2c')](_0x25e790,_0x1ea737);}return _0x4e797e;}function getCustomFields(_0x3d8901,_0x387611){var _0x49bf3f=[];var _0x4e406b={'custom_fields':[]};if(_0x3d8901[_0x2746('0x1c')]>0x0){_[_0x2746('0x2d')](_0x3d8901,function(_0x23043b){if(_[_0x2746('0x2e')](['string',_0x2746('0x2f')],_0x23043b[_0x2746('0x30')])&&_0x23043b['nameField']&&!_0x23043b[_0x2746('0x31')]){_0x4e406b[_0x23043b['nameField'][_0x2746('0x32')]()]=_0x23043b['content'][_0x2746('0x28')]();}else if(_[_0x2746('0x2e')]([_0x2746('0x33'),_0x2746('0x2f')],_0x23043b['type'])&&_0x23043b[_0x2746('0x34')]&&_0x23043b[_0x2746('0x31')]){_0x4e406b[_0x2746('0x35')][_0x2746('0x36')]({'id':_0x23043b[_0x2746('0x34')],'value':_0x23043b[_0x2746('0x37')][_0x2746('0x28')]()});}else if(_0x23043b['type']===_0x2746('0x38')&&_0x23043b[_0x2746('0x39')]&&_0x23043b[_0x2746('0x34')]&&_0x23043b['customField']){_0x387611[_0x23043b[_0x2746('0x39')]]&&_0x4e406b[_0x2746('0x35')][_0x2746('0x36')]({'id':_0x23043b[_0x2746('0x34')],'value':_0x387611[_0x23043b[_0x2746('0x39')]]['toString']()});}else if(_0x23043b['type']==='customVariable'&&_0x23043b[_0x2746('0x3a')]&&_0x23043b[_0x2746('0x3a')][_0x2746('0x3b')]&&_0x23043b['idField']&&_0x23043b[_0x2746('0x31')]){_0x387611[_0x23043b['Variable'][_0x2746('0x3b')]['toLowerCase']()]&&_0x4e406b['custom_fields'][_0x2746('0x36')]({'id':_0x23043b[_0x2746('0x34')],'value':_0x387611[_0x23043b[_0x2746('0x3a')][_0x2746('0x3b')]['toLowerCase']()][_0x2746('0x28')]()});}});}return _0x4e406b;}exports[_0x2746('0x3c')]=function(_0x12885c,_0x421d7e,_0x34ffd4,_0x44617d,_0x5a9fbf,_0x3320b3){var _0x47bceb,_0x5d369a;_0x3320b3[_0x2746('0x7')]=intUtil[_0x2746('0x3d')](_0x3320b3['remoteUri']);_0x3320b3[_0x2746('0x3e')]=intUtil[_0x2746('0x3d')](_0x3320b3[_0x2746('0x3e')]);if(_0x5a9fbf&&_0x5a9fbf[_0x2746('0x3f')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x421d7e[_0x2746('0x40')]=util['format'](_0x2746('0x41'),_0x3320b3[_0x2746('0x3e')],_0x421d7e[_0x2746('0x42')],md5(_0x421d7e[_0x2746('0x42')]));}else{_0x421d7e['recordingURL']='';}headers[_0x2746('0x43')]=getAuth(_0x3320b3);return getUser(_0x3320b3,_0x44617d['email'])[_0x2746('0xc')](function(_0x124f86){_0x47bceb=_0x124f86;logger[_0x2746('0x4')](_0x2746('0x44'),_0x47bceb['id']);return getEndUser(_0x3320b3,_0x421d7e[_0x2746('0x45')],_0x421d7e[_0x2746('0x46')]);})[_0x2746('0xc')](function(_0x2e047f){_0x5d369a=_0x2e047f;logger[_0x2746('0x4')]('The\x20Enduser\x20ID\x20is:',_0x5d369a['id']);return getTicket(_0x3320b3,_0x47bceb,_0x5d369a,_0x34ffd4,_0x421d7e);})[_0x2746('0xc')](function(_0x5b52bd){if(_0x5b52bd){logger[_0x2746('0x4')]('The\x20Ticket\x20ID\x20is:',_0x5b52bd['id']);switch(_0x3320b3[_0x2746('0x30')]){case _0x2746('0x47'):logger[_0x2746('0x4')](_0x2746('0x48'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x2746('0x11')](_0x2746('0x49'),_0x3320b3[_0x2746('0x7')],_0x47bceb['id'],_0x5b52bd['id']),'method':_0x2746('0x20')});case _0x2746('0x4a'):logger[_0x2746('0x4')](_0x2746('0x48'),_0x2746('0x4b'));emit(util[_0x2746('0x11')](_0x2746('0x4c'),_0x44617d[_0x2746('0x3b')]),_0x2746('0x4d'),{'uri':util['format']('%s/agent/tickets/%s',_0x3320b3[_0x2746('0x7')][_0x2746('0x4e')]('/api/v2',''),_0x5b52bd['id'])});break;default:logger[_0x2746('0x4f')](_0x2746('0x48'),_0x2746('0x50'));}}})[_0x2746('0x51')](function(_0x1e1e44){logger[_0x2746('0x4f')](_0x2746('0x52'),util['inspect'](_0x1e1e44,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x1550d2,_0x230924,_0x49adfc,_0x18e9d2,_0xcf2f0e,_0x513abb,_0x3cdaba){var _0x341421,_0x6f8c51;_0x513abb[_0x2746('0x7')]=intUtil[_0x2746('0x3d')](_0x513abb[_0x2746('0x7')]);_0x513abb[_0x2746('0x3e')]=intUtil[_0x2746('0x3d')](_0x513abb['serverUrl']);if(_0x3cdaba&&_0x3cdaba['recordingFormat']&&_0x3cdaba[_0x2746('0x53')]!==_0x2746('0x54')){logger[_0x2746('0x4')](_0x2746('0x55'),_0x2746('0x56'));_0x230924[_0x2746('0x40')]=util[_0x2746('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513abb[_0x2746('0x3e')],_0x230924['uniqueid'],md5(_0x230924['uniqueid']));}headers[_0x2746('0x43')]=getAuth(_0x513abb);return getUser(_0x513abb,_0x18e9d2['email'])[_0x2746('0xc')](function(_0x47f31f){_0x341421=_0x47f31f;logger['info']('The\x20User\x20ID\x20is:',_0x341421['id']);return getEndUser(_0x513abb,_0x230924[_0x2746('0x57')],_0x230924[_0x2746('0x58')]);})[_0x2746('0xc')](function(_0x23d63d){_0x6f8c51=_0x23d63d;logger[_0x2746('0x4')](_0x2746('0x59'),_0x6f8c51['id']);return getTicket(_0x513abb,_0x341421,_0x6f8c51,_0x49adfc,_0x230924);})[_0x2746('0xc')](function(_0x3341a4){if(_0x3341a4){logger[_0x2746('0x4')]('The\x20Ticket\x20ID\x20is:',_0x3341a4['id']);switch(_0x513abb[_0x2746('0x30')]){case _0x2746('0x47'):logger[_0x2746('0x4')]('[OUTBOUND]',_0x2746('0x5a'));return request({'uri':util[_0x2746('0x11')](_0x2746('0x49'),_0x513abb[_0x2746('0x7')],_0x341421['id'],_0x3341a4['id']),'method':_0x2746('0x20')});case _0x2746('0x4a'):logger[_0x2746('0x4')]('[OUTBOUND]',_0x2746('0x4b'));emit(util[_0x2746('0x11')]('user:%s',_0x18e9d2[_0x2746('0x3b')]),_0x2746('0x4d'),{'uri':util['format'](_0x2746('0x5b'),_0x513abb[_0x2746('0x7')][_0x2746('0x4e')]('/api/v2',''),_0x3341a4['id'])});break;default:logger[_0x2746('0x4f')](_0x2746('0x55'),_0x2746('0x50'));}}})[_0x2746('0x51')](function(_0x349cdb){logger[_0x2746('0x4f')](_0x2746('0x5c'),util[_0x2746('0x5d')](_0x349cdb,{'showHidden':!![],'depth':null}));});};exports[_0x2746('0x5e')]=function(_0x10e294,_0x2987e5,_0x5cc990,_0x3f186a,_0x5bec22,_0x90aa3d){var _0x14978d,_0x17ce2c;_0x90aa3d['remoteUri']=intUtil[_0x2746('0x3d')](_0x90aa3d[_0x2746('0x7')]);_0x90aa3d[_0x2746('0x3e')]=intUtil['stripTrailingSlash'](_0x90aa3d[_0x2746('0x3e')]);if(_0x5bec22&&_0x5bec22[_0x2746('0x3f')]){logger[_0x2746('0x4')]('['+_0x2987e5[_0x2746('0x5f')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x2987e5[_0x2746('0x40')]=util[_0x2746('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x90aa3d['serverUrl'],_0x2987e5[_0x2746('0x42')],md5(_0x2987e5['uniqueid']));}else{_0x2987e5[_0x2746('0x40')]='';}headers[_0x2746('0x43')]=getAuth(_0x90aa3d);return getUser(_0x90aa3d)['then'](function(_0x2a3e5){_0x14978d=_0x2a3e5;logger[_0x2746('0x4')]('The\x20User\x20ID\x20is:',_0x14978d['id']);return getEndUser(_0x90aa3d,_0x2987e5[_0x2746('0x45')],_0x2987e5['calleridnum']);})[_0x2746('0xc')](function(_0x525811){_0x17ce2c=_0x525811;logger['info'](_0x2746('0x59'),_0x17ce2c['id']);return getTicket(_0x90aa3d,_0x14978d,_0x17ce2c,_0x5cc990,_0x2987e5);})[_0x2746('0xc')](function(_0x4061f2){if(_0x4061f2){logger['info'](_0x2746('0x60'),_0x4061f2['id']);}})[_0x2746('0x51')](function(_0x38fcb7){logger[_0x2746('0x4f')]('['+_0x2987e5[_0x2746('0x5f')]['toUpperCase']()+']'+_0x2746('0x61'),util[_0x2746('0x5d')](_0x38fcb7,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4a59=['authType','%s:%s','token','%s/token:%s','username','Basic\x20%s','base64','debug','stringify','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','idField','custom_fields','toString','variable','variableName','push','customVariable','Variable','name','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','Authorization','destcalleridname','destcalleridnum','[OUTBOUND]','trigger:browser:url','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','getString','Descriptions','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','then','Admin\x20account\x20selected.','user','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s'];(function(_0x33154d,_0x854047){var _0x3b2f03=function(_0x35f7a6){while(--_0x35f7a6){_0x33154d['push'](_0x33154d['shift']());}};_0x3b2f03(++_0x854047);}(_0x4a59,0xab));var _0x94a5=function(_0x5bb243,_0x4e3882){_0x5bb243=_0x5bb243-0x0;var _0x2340c7=_0x4a59[_0x5bb243];return _0x2340c7;};'use strict';var _=require('lodash');var rp=require(_0x94a5('0x0'));var md5=require(_0x94a5('0x1'));var util=require(_0x94a5('0x2'));var Redis=require('ioredis');var intUtil=require(_0x94a5('0x3'));var config=require(_0x94a5('0x4'));var logger=require(_0x94a5('0x5'))('zendesk');config[_0x94a5('0x6')]=_[_0x94a5('0x7')](config['redis'],{'host':_0x94a5('0x8'),'port':0x18eb});var io=require(_0x94a5('0x9'))(new Redis(config[_0x94a5('0x6')]));function emit(_0x7f0605,_0x46a559,_0x2221d2){io['to'](_0x7f0605)['emit'](_0x46a559,_0x2221d2);}var headers={'Content-Type':_0x94a5('0xa'),'Accept':_0x94a5('0xa')};function getTicket(_0x535599,_0x2d8b7e,_0x4d741a,_0x2661b0,_0x3e8c8b){logger[_0x94a5('0xb')](_0x94a5('0xc'));return request({'uri':util[_0x94a5('0xd')](_0x94a5('0xe'),_0x535599[_0x94a5('0xf')]),'method':_0x94a5('0x10'),'body':{'ticket':_['merge']({'requester_id':_0x4d741a['id'],'submitter_id':_0x2d8b7e?_0x2d8b7e['id']:undefined,'assignee_id':_0x2d8b7e?_0x2d8b7e['id']:undefined,'tags':getTags(_0x2661b0[_0x94a5('0x11')],'name'),'subject':intUtil[_0x94a5('0x12')](_0x2661b0['Subjects'],_0x3e8c8b,'\x20'),'description':intUtil[_0x94a5('0x12')](_0x2661b0[_0x94a5('0x13')],_0x3e8c8b,'\x0a'),'comment':{'public':![],'body':intUtil[_0x94a5('0x12')](_0x2661b0[_0x94a5('0x13')],_0x3e8c8b,'\x0a')}},getCustomFields(_0x2661b0['Fields'],_0x3e8c8b))}})['then'](function(_0x4e74d1){logger[_0x94a5('0xb')](_0x94a5('0x14'));return _0x4e74d1[_0x94a5('0x15')];});}function getUser(_0x22857a,_0x9256eb){if(intUtil[_0x94a5('0x16')](_0x9256eb)){logger[_0x94a5('0xb')](_0x94a5('0x17'),_0x9256eb);return request({'uri':util['format']('%s/search.json',_0x22857a[_0x94a5('0xf')]),'qs':{'query':util['format'](_0x94a5('0x18'),_0x9256eb)}})['then'](function(_0x12ca6b){if(_0x12ca6b['count']){logger[_0x94a5('0xb')](_0x94a5('0x19'));return _[_0x94a5('0x1a')](_0x12ca6b[_0x94a5('0x1b')],{'email':_0x9256eb,'role':_0x94a5('0x1c')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x94a5('0xd')]('%s/users/me.json',_0x22857a[_0x94a5('0xf')])})[_0x94a5('0x1d')](function(_0x44ea09){logger[_0x94a5('0xb')](_0x94a5('0x1e'));return _0x44ea09[_0x94a5('0x1f')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x94a5('0xd')]('%s/users/me.json',_0x22857a[_0x94a5('0xf')])})[_0x94a5('0x1d')](function(_0x36e4bd){logger[_0x94a5('0xb')]('Admin\x20account\x20selected.');return _0x36e4bd[_0x94a5('0x1f')];});}}function getEndUser(_0x5dbf0a,_0x5dbab6,_0x1b9e27){logger[_0x94a5('0xb')]('Searching\x20enduser\x20with\x20phone',_0x1b9e27);return request({'uri':util[_0x94a5('0xd')](_0x94a5('0x20'),_0x5dbf0a[_0x94a5('0xf')]),'qs':{'query':util[_0x94a5('0xd')](_0x94a5('0x21'),_0x1b9e27)}})[_0x94a5('0x1d')](function(_0x50f065){var _0x3a39cb;if(_0x50f065['results'][_0x94a5('0x22')]){_0x50f065['results']=_[_0x94a5('0x23')](_0x50f065[_0x94a5('0x1b')],{'suspended':![],'role':_0x94a5('0x24')});if(_0x50f065[_0x94a5('0x1b')][_0x94a5('0x22')]){_0x3a39cb=_[_0x94a5('0x25')](_0x50f065['results']);}}if(_0x3a39cb){logger[_0x94a5('0xb')](_0x94a5('0x26'));return _0x3a39cb;}else{logger[_0x94a5('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x94a5('0xd')](_0x94a5('0x27'),_0x5dbf0a[_0x94a5('0xf')]),'method':_0x94a5('0x10'),'body':{'user':{'role':_0x94a5('0x24'),'name':util[_0x94a5('0xd')](_0x94a5('0x28'),_0x5dbab6||_0x1b9e27),'phone':_0x1b9e27}}})[_0x94a5('0x1d')](function(_0x2b1358){logger[_0x94a5('0xb')]('Enduser\x20created.');return _0x2b1358[_0x94a5('0x1f')];});}});}function getAuth(_0x483d12){var _0x255160;if(_0x483d12[_0x94a5('0x29')]==='password'){_0x255160=util['format'](_0x94a5('0x2a'),_0x483d12['username'],_0x483d12['password']);}else if(_0x483d12['authType']===_0x94a5('0x2b')){_0x255160=util[_0x94a5('0xd')](_0x94a5('0x2c'),_0x483d12[_0x94a5('0x2d')],_0x483d12['token']);}return util[_0x94a5('0xd')](_0x94a5('0x2e'),new Buffer(_0x255160)['toString'](_0x94a5('0x2f')));}function request(_0x4a3c80){logger[_0x94a5('0x30')]('[HTTP]',JSON[_0x94a5('0x31')](_0x4a3c80));return rp(_[_0x94a5('0x7')](_0x4a3c80,{'method':_0x94a5('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x7d1908,_0x2d3c27){var _0x3709d4=[];if(_0x7d1908&&_0x7d1908[_0x94a5('0x22')]>0x0){_0x3709d4=_['map'](_0x7d1908,_0x2d3c27);}return _0x3709d4;}function getCustomFields(_0x338a18,_0xa4b35e){var _0x4c4361=[];var _0x406284={'custom_fields':[]};if(_0x338a18[_0x94a5('0x22')]>0x0){_[_0x94a5('0x33')](_0x338a18,function(_0x18c5e8){if(_[_0x94a5('0x34')]([_0x94a5('0x35'),_0x94a5('0x36')],_0x18c5e8[_0x94a5('0x37')])&&_0x18c5e8[_0x94a5('0x38')]&&!_0x18c5e8[_0x94a5('0x39')]){_0x406284[_0x18c5e8[_0x94a5('0x38')][_0x94a5('0x3a')]()]=_0x18c5e8['content']['toString']();}else if(_[_0x94a5('0x34')]([_0x94a5('0x35'),_0x94a5('0x36')],_0x18c5e8[_0x94a5('0x37')])&&_0x18c5e8[_0x94a5('0x3b')]&&_0x18c5e8[_0x94a5('0x39')]){_0x406284[_0x94a5('0x3c')]['push']({'id':_0x18c5e8[_0x94a5('0x3b')],'value':_0x18c5e8['content'][_0x94a5('0x3d')]()});}else if(_0x18c5e8[_0x94a5('0x37')]===_0x94a5('0x3e')&&_0x18c5e8[_0x94a5('0x3f')]&&_0x18c5e8['idField']&&_0x18c5e8['customField']){_0xa4b35e[_0x18c5e8['variableName']]&&_0x406284['custom_fields'][_0x94a5('0x40')]({'id':_0x18c5e8[_0x94a5('0x3b')],'value':_0xa4b35e[_0x18c5e8['variableName']]['toString']()});}else if(_0x18c5e8[_0x94a5('0x37')]===_0x94a5('0x41')&&_0x18c5e8['Variable']&&_0x18c5e8[_0x94a5('0x42')][_0x94a5('0x43')]&&_0x18c5e8['idField']&&_0x18c5e8[_0x94a5('0x39')]){_0xa4b35e[_0x18c5e8[_0x94a5('0x42')][_0x94a5('0x43')][_0x94a5('0x3a')]()]&&_0x406284[_0x94a5('0x3c')][_0x94a5('0x40')]({'id':_0x18c5e8[_0x94a5('0x3b')],'value':_0xa4b35e[_0x18c5e8[_0x94a5('0x42')][_0x94a5('0x43')][_0x94a5('0x3a')]()][_0x94a5('0x3d')]()});}});}return _0x406284;}exports['queue']=function(_0x372a04,_0x54ba84,_0xde10be,_0x3327d2,_0x381645,_0x390f75){var _0x213c61,_0x4c010b;_0x390f75[_0x94a5('0xf')]=intUtil[_0x94a5('0x44')](_0x390f75['remoteUri']);_0x390f75[_0x94a5('0x45')]=intUtil[_0x94a5('0x44')](_0x390f75[_0x94a5('0x45')]);if(_0x381645&&_0x381645[_0x94a5('0x46')]){logger[_0x94a5('0xb')](_0x94a5('0x47'),_0x94a5('0x48'));_0x54ba84[_0x94a5('0x49')]=util[_0x94a5('0xd')](_0x94a5('0x4a'),_0x390f75[_0x94a5('0x45')],_0x54ba84[_0x94a5('0x4b')],md5(_0x54ba84[_0x94a5('0x4b')]));}else{_0x54ba84['recordingURL']='';}headers['Authorization']=getAuth(_0x390f75);return getUser(_0x390f75,_0x3327d2[_0x94a5('0x4c')])[_0x94a5('0x1d')](function(_0x310791){_0x213c61=_0x310791;logger[_0x94a5('0xb')](_0x94a5('0x4d'),_0x213c61['id']);return getEndUser(_0x390f75,_0x54ba84[_0x94a5('0x4e')],_0x54ba84[_0x94a5('0x4f')]);})[_0x94a5('0x1d')](function(_0x45c34a){_0x4c010b=_0x45c34a;logger[_0x94a5('0xb')](_0x94a5('0x50'),_0x4c010b['id']);return getTicket(_0x390f75,_0x213c61,_0x4c010b,_0xde10be,_0x54ba84);})['then'](function(_0x3e88c1){if(_0x3e88c1){logger[_0x94a5('0xb')](_0x94a5('0x51'),_0x3e88c1['id']);switch(_0x390f75['type']){case _0x94a5('0x52'):logger[_0x94a5('0xb')](_0x94a5('0x47'),_0x94a5('0x53'));return request({'uri':util[_0x94a5('0xd')](_0x94a5('0x54'),_0x390f75[_0x94a5('0xf')],_0x213c61['id'],_0x3e88c1['id']),'method':'POST'});case _0x94a5('0x55'):logger[_0x94a5('0xb')](_0x94a5('0x47'),_0x94a5('0x56'));emit(util[_0x94a5('0xd')](_0x94a5('0x57'),_0x3327d2[_0x94a5('0x43')]),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x390f75[_0x94a5('0xf')][_0x94a5('0x58')](_0x94a5('0x59'),''),_0x3e88c1['id'])});break;default:logger['error']('[QUEUE]',_0x94a5('0x5a'));}}})[_0x94a5('0x5b')](function(_0x1dd6ae){logger[_0x94a5('0x5c')](_0x94a5('0x5d'),util[_0x94a5('0x5e')](_0x1dd6ae,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x4c0512,_0x3b1139,_0x574ad2,_0x4e7c39,_0xc4feac,_0x5eddc7,_0x4ce76c){var _0x1fe82e,_0x768ae3;_0x5eddc7['remoteUri']=intUtil['stripTrailingSlash'](_0x5eddc7['remoteUri']);_0x5eddc7[_0x94a5('0x45')]=intUtil[_0x94a5('0x44')](_0x5eddc7[_0x94a5('0x45')]);if(_0x4ce76c&&_0x4ce76c[_0x94a5('0x5f')]&&_0x4ce76c[_0x94a5('0x5f')]!=='none'){logger[_0x94a5('0xb')]('[OUTBOUND]',_0x94a5('0x48'));_0x3b1139[_0x94a5('0x49')]=util[_0x94a5('0xd')](_0x94a5('0x4a'),_0x5eddc7[_0x94a5('0x45')],_0x3b1139['uniqueid'],md5(_0x3b1139['uniqueid']));}headers[_0x94a5('0x60')]=getAuth(_0x5eddc7);return getUser(_0x5eddc7,_0x4e7c39[_0x94a5('0x4c')])['then'](function(_0x21f16b){_0x1fe82e=_0x21f16b;logger[_0x94a5('0xb')](_0x94a5('0x4d'),_0x1fe82e['id']);return getEndUser(_0x5eddc7,_0x3b1139[_0x94a5('0x61')],_0x3b1139[_0x94a5('0x62')]);})[_0x94a5('0x1d')](function(_0x404b4a){_0x768ae3=_0x404b4a;logger[_0x94a5('0xb')](_0x94a5('0x50'),_0x768ae3['id']);return getTicket(_0x5eddc7,_0x1fe82e,_0x768ae3,_0x574ad2,_0x3b1139);})['then'](function(_0x429c0e){if(_0x429c0e){logger[_0x94a5('0xb')](_0x94a5('0x51'),_0x429c0e['id']);switch(_0x5eddc7[_0x94a5('0x37')]){case _0x94a5('0x52'):logger[_0x94a5('0xb')]('[OUTBOUND]',_0x94a5('0x53'));return request({'uri':util[_0x94a5('0xd')](_0x94a5('0x54'),_0x5eddc7['remoteUri'],_0x1fe82e['id'],_0x429c0e['id']),'method':_0x94a5('0x10')});case _0x94a5('0x55'):logger[_0x94a5('0xb')](_0x94a5('0x63'),_0x94a5('0x56'));emit(util['format'](_0x94a5('0x57'),_0x4e7c39['name']),_0x94a5('0x64'),{'uri':util[_0x94a5('0xd')](_0x94a5('0x65'),_0x5eddc7[_0x94a5('0xf')]['replace'](_0x94a5('0x59'),''),_0x429c0e['id'])});break;default:logger[_0x94a5('0x5c')](_0x94a5('0x63'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x237ed6){logger[_0x94a5('0x5c')](_0x94a5('0x66'),util[_0x94a5('0x5e')](_0x237ed6,{'showHidden':!![],'depth':null}));});};exports[_0x94a5('0x67')]=function(_0x275778,_0x5b08cb,_0x59b130,_0x2fa47e,_0x49f821,_0x252dbe){var _0x45026e,_0x31c664;_0x252dbe[_0x94a5('0xf')]=intUtil[_0x94a5('0x44')](_0x252dbe[_0x94a5('0xf')]);_0x252dbe[_0x94a5('0x45')]=intUtil['stripTrailingSlash'](_0x252dbe['serverUrl']);if(_0x49f821&&_0x49f821[_0x94a5('0x46')]){logger[_0x94a5('0xb')]('['+_0x5b08cb['lastevent'][_0x94a5('0x68')]()+']','Recording\x20is\x20enabled!');_0x5b08cb[_0x94a5('0x49')]=util[_0x94a5('0xd')](_0x94a5('0x4a'),_0x252dbe[_0x94a5('0x45')],_0x5b08cb[_0x94a5('0x4b')],md5(_0x5b08cb[_0x94a5('0x4b')]));}else{_0x5b08cb['recordingURL']='';}headers[_0x94a5('0x60')]=getAuth(_0x252dbe);return getUser(_0x252dbe)['then'](function(_0x3406bd){_0x45026e=_0x3406bd;logger[_0x94a5('0xb')](_0x94a5('0x4d'),_0x45026e['id']);return getEndUser(_0x252dbe,_0x5b08cb['calleridname'],_0x5b08cb[_0x94a5('0x4f')]);})[_0x94a5('0x1d')](function(_0x431b52){_0x31c664=_0x431b52;logger[_0x94a5('0xb')](_0x94a5('0x50'),_0x31c664['id']);return getTicket(_0x252dbe,_0x45026e,_0x31c664,_0x59b130,_0x5b08cb);})['then'](function(_0xbac456){if(_0xbac456){logger[_0x94a5('0xb')](_0x94a5('0x51'),_0xbac456['id']);}})[_0x94a5('0x5b')](function(_0x4500ef){logger['error']('['+_0x5b08cb['lastevent']['toUpperCase']()+']'+_0x94a5('0x69'),util[_0x94a5('0x5e')](_0x4500ef,{'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 d5c665e..ce5cb92 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 _0x9232=['https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','info','Using\x20the\x20admin\x20account!','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','profile','administrator','Subject','getString','Subjects','Description','Descriptions','enduserType','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','format','mm:ss','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','outbound','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','code','SUCCESS','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','uniqueid','destcalleridname','Outbound','The\x20Call\x20ID\x20is:','[OUTBOUND]','unmanaged','toUpperCase','lodash','request-promise','util','./util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9232,0x75));var _0x2923=function(_0x3a71ae,_0x1043a1){_0x3a71ae=_0x3a71ae-0x0;var _0x4d84c0=_0x9232[_0x3a71ae];return _0x4d84c0;};'use strict';var _=require(_0x2923('0x0'));var rp=require(_0x2923('0x1'));var md5=require('md5');var util=require(_0x2923('0x2'));var intUtil=require(_0x2923('0x3'));var moment=require('moment');var Redis=require(_0x2923('0x4'));var BPromise=require('bluebird');var config=require(_0x2923('0x5'));var logger=require(_0x2923('0x6'))('zoho');config[_0x2923('0x7')]=_[_0x2923('0x8')](config[_0x2923('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x2923('0x9'))(new Redis(config[_0x2923('0x7')]));function emit(_0x13db54,_0x21038e,_0x1506e3){io['to'](_0x13db54)[_0x2923('0xa')](_0x21038e,_0x1506e3);}function request(_0x2c8441){logger[_0x2923('0xb')](_0x2923('0xc'),JSON[_0x2923('0xd')](_0x2c8441));return rp(_0x2c8441);}function getCustomFields(_0x42d5e6,_0x3abb99){var _0x1e7801={};if(_0x42d5e6[_0x2923('0xe')]>0x0){_[_0x2923('0xf')](_0x42d5e6,function(_0x27c945){if(_['includes'](['string','picklist'],_0x27c945['type'])&&_0x27c945[_0x2923('0x10')]){_0x1e7801[_0x27c945[_0x2923('0x10')]]=_0x27c945[_0x2923('0x11')][_0x2923('0x12')]();}else if(_0x27c945[_0x2923('0x13')]===_0x2923('0x14')&&_0x27c945[_0x2923('0x15')]&&_0x27c945[_0x2923('0x10')]&&_0x3abb99[_0x27c945['variableName']]){_0x1e7801[_0x27c945[_0x2923('0x10')]]=_0x3abb99[_0x27c945[_0x2923('0x15')]][_0x2923('0x12')]();}else if(_0x27c945['type']===_0x2923('0x16')&&_0x27c945['Variable']&&_0x27c945[_0x2923('0x17')][_0x2923('0x18')]&&_0x27c945[_0x2923('0x10')]&&_0x3abb99[_0x27c945[_0x2923('0x17')]['name'][_0x2923('0x19')]()]){_0x1e7801[_0x27c945[_0x2923('0x10')]]=_0x3abb99[_0x27c945[_0x2923('0x17')]['name'][_0x2923('0x19')]()][_0x2923('0x12')]();}});}return _0x1e7801;}function getName(_0x5c1648){if(_0x5c1648[_0x2923('0x1a')]('\x20')>0x0){var _0x2e4f61=_0x5c1648[_0x2923('0x1b')](/ (.+)/);if(_0x2e4f61[0x1]){return _0x2e4f61;}}return[_0x5c1648,_0x5c1648];}var accountsTokens={};function getAccessToken(_0x3155dc){return new Promise(function(_0x3c06a1,_0x5c55c7){if(!_[_0x2923('0x1c')](accountsTokens[_0x3155dc['id']])&&!_[_0x2923('0x1c')](accountsTokens[_0x3155dc['id']][_0x2923('0x1d')])){if(moment()[_0x2923('0x1e')](accountsTokens[_0x3155dc['id']][_0x2923('0x1f')])){_0x3c06a1(accountsTokens[_0x3155dc['id']]['access_token']);}}var _0x565d8e;switch(_0x3155dc['zone']){case'US':_0x565d8e='https://accounts.zoho.com';break;case'AU':_0x565d8e=_0x2923('0x20');break;case'EU':_0x565d8e=_0x2923('0x21');break;case'IN':_0x565d8e=_0x2923('0x22');break;case'CN':_0x565d8e=_0x2923('0x23');break;default:_0x565d8e=_0x2923('0x21');break;}var _0x3ece98={'method':_0x2923('0x24'),'uri':_0x565d8e+_0x2923('0x25'),'qs':{'refresh_token':_0x3155dc['refreshToken'],'client_id':_0x3155dc[_0x2923('0x26')],'client_secret':_0x3155dc[_0x2923('0x27')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3ece98)[_0x2923('0x28')](function(_0x2b041a){accountsTokens[_0x3155dc['id']]={'access_token':_0x2b041a[_0x2923('0x1d')],'expires_in':moment()['add'](_0x2b041a[_0x2923('0x1f')],_0x2923('0x29'))};_0x3c06a1(_0x2b041a[_0x2923('0x1d')]);})[_0x2923('0x2a')](function(_0x2bd67d){logger[_0x2923('0x2b')](_0x2923('0x2c'),_0x2bd67d[_0x2923('0x2d')]);_0x5c55c7(_0x2bd67d);});});}function getUser(_0x2202b3,_0x44a55e,_0x40bd93,_0x4bc266){logger['info']('Search\x20user');return request({'method':_0x2923('0x2e'),'uri':util['format'](_0x2923('0x2f'),_0x44a55e),'qs':{'type':_0x2923('0x30')},'headers':{'Authorization':_0x2923('0x31')+_0x2202b3},'json':!![]})[_0x2923('0x28')](function(_0x19f45f){if(_0x19f45f[_0x2923('0x32')]){var _0x2d8025=-0x1;if(_['isArrayLikeObject'](_0x19f45f[_0x2923('0x32')])){if(!_[_0x2923('0x1c')](_0x4bc266)){_0x2d8025=_[_0x2923('0x33')](_0x19f45f[_0x2923('0x32')],function(_0xb44a94){return _0xb44a94[_0x2923('0x34')]===_0x4bc266;});}if(_0x2d8025>=0x0){logger[_0x2923('0x35')]('Agent\x20found!');}else{logger['info'](_0x2923('0x36'));_0x2d8025=_[_0x2923('0x33')](_0x19f45f[_0x2923('0x32')],function(_0xc4c381){return _0xc4c381['profile'][_0x2923('0x18')]==='Administrator';});}return _0x19f45f['users'][_0x2d8025];}else{if(_0x19f45f['user']['profile']['name']==='Administrator'){logger[_0x2923('0x35')]('Using\x20the\x20admin\x20account!');user=_0x19f45f[_0x2923('0x37')];return user;}else{logger['error'](_0x2923('0x38'),JSON[_0x2923('0xd')](_0x19f45f));throw new Error(_0x2923('0x39')+JSON[_0x2923('0xd')](_0x19f45f));}}}else{logger[_0x2923('0x2b')](_0x2923('0x38'),JSON[_0x2923('0xd')](_0x19f45f));throw new Error(_0x2923('0x39')+JSON[_0x2923('0xd')](_0x19f45f));}})['catch'](function(_0x505078){console[_0x2923('0x2b')](_0x505078);});}function getZohoUser(_0xfa7476,_0x228a72){return new BPromise(function(_0x1acab9,_0x58c8d2){request(_0xfa7476)[_0x2923('0x28')](function(_0x1d8f19){var _0x427146=null;if(_0x1d8f19){_0x427146=_0x1d8f19[_0x2923('0x3a')][0x0];_0x427146['enduserType']=_0x228a72;}_0x1acab9(_0x427146);})[_0x2923('0x2a')](function(_0x3510a2){_0x58c8d2(_0x3510a2);});});}function createEndUser(_0x54c36a,_0x49d57c,_0x4fb7a6,_0x9e5330,_0x1556af,_0x2a4e0c){var _0x4fb7a6=getName(_0x4fb7a6);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x49d57c+_0x2923('0x3b')+_[_0x2923('0x3c')](_0x2a4e0c[_0x2923('0x3d')])+'s','body':{'data':[{'Last_Name':_0x4fb7a6[0x1],'First_Name':_0x4fb7a6[0x0],'Phone':_0x9e5330,'Owner':{'name':!_[_0x2923('0x1c')](_0x1556af['role'][_0x2923('0x18')])?_0x1556af[_0x2923('0x3e')][_0x2923('0x18')]:!_[_0x2923('0x1c')](_0x1556af['first_name'])?_0x1556af[_0x2923('0x3f')]+'\x20'+_0x1556af[_0x2923('0x40')]:_0x1556af[_0x2923('0x40')],'id':_0x1556af['id']}}]},'headers':{'Authorization':_0x2923('0x31')+_0x54c36a},'json':!![]})[_0x2923('0x28')](function(_0x55c57c){if(_0x55c57c&&_0x55c57c['data'][0x0]['code']==='SUCCESS'){var _0x3b9895=_0x55c57c[_0x2923('0x3a')][0x0][_0x2923('0x41')];_0x3b9895['enduserType']=_[_0x2923('0x3c')](_0x2a4e0c[_0x2923('0x3d')])+'s';return _0x3b9895;}logger[_0x2923('0x2b')](_0x2923('0x38'),JSON['stringify'](data));throw new Error(_0x2923('0x42')+JSON[_0x2923('0xd')](data));})[_0x2923('0x2a')](function(_0x33d2c1){console[_0x2923('0x43')](_0x2923('0x44'),_0x33d2c1);});}function getEndUser(_0x2753f8,_0x430bce,_0x175c87,_0x3e0853,_0x3b32f9,_0x2d56f7,_0x4b4038){var _0x1ac0b5={'method':'GET','uri':'','headers':{'Authorization':_0x2923('0x31')+_0x2753f8},'json':!![]};switch(_0x4b4038[_0x2923('0x45')]){case _0x2923('0x46'):_0x1ac0b5[_0x2923('0x47')]='https://www.zohoapis.'+_0x430bce+_0x2923('0x48')+_0x3b32f9+'))';return getZohoUser(_0x1ac0b5,_0x2923('0x49'))['then'](function(_0x36149e){if(_0x36149e)return _0x36149e;_0x1ac0b5['uri']=_0x2923('0x4a')+_0x430bce+_0x2923('0x4b')+_0x3b32f9+'))';return getZohoUser(_0x1ac0b5,_0x2923('0x4c'))[_0x2923('0x28')](function(_0x5cb3f8){if(_0x5cb3f8)return _0x5cb3f8;if(_0x4b4038[_0x2923('0x3d')]!=_0x2923('0x4d')){return createEndUser(_0x2753f8,_0x430bce,_0x3e0853,_0x3b32f9,_0x2d56f7,_0x4b4038);}else{return{};}});});break;case _0x2923('0x4e'):_0x1ac0b5[_0x2923('0x47')]=_0x2923('0x4a')+_0x430bce+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3b32f9+'))';return getZohoUser(_0x1ac0b5,_0x2923('0x49'))[_0x2923('0x28')](function(_0x1e1aee){if(_0x1e1aee)return _0x1e1aee;if(_0x4b4038[_0x2923('0x3d')]!=_0x2923('0x4d')){return createEndUser(_0x2753f8,_0x430bce,_0x3e0853,_0x3b32f9,_0x2d56f7,_0x4b4038);}else{return{};}});break;case _0x2923('0x4f'):_0x1ac0b5[_0x2923('0x47')]='https://www.zohoapis.'+_0x430bce+_0x2923('0x4b')+_0x3b32f9+'))';return getZohoUser(_0x1ac0b5,'Leads')[_0x2923('0x28')](function(_0x2e0f83){if(_0x2e0f83)return _0x2e0f83;if(_0x4b4038['moduleCreate']!=_0x2923('0x4d')){return createEndUser(_0x2753f8,_0x430bce,_0x3e0853,_0x3b32f9,_0x2d56f7,_0x4b4038);}else{return{};}});break;}}function getCall(_0x2651ac,_0x3c56c9,_0x461ec9,_0xb066c,_0x4eb0b9,_0x4fb8e2,_0x5c8e16,_0xa3d12a){logger[_0x2923('0x35')](_0x2923('0x50'));var _0x2c9b42={};_0x2c9b42['Owner']={'name':!_[_0x2923('0x1c')](_0xb066c[_0x2923('0x3e')][_0x2923('0x18')])&&!_[_0x2923('0x1c')](_0xb066c[_0x2923('0x51')][_0x2923('0x18')])&&_0xb066c[_0x2923('0x51')][_0x2923('0x18')]===_0x2923('0x52')?_0xb066c['role'][_0x2923('0x18')]:!_['isNil'](_0xb066c[_0x2923('0x3f')])?_0xb066c[_0x2923('0x3f')]+'\x20'+_0xb066c[_0x2923('0x40')]:_0xb066c[_0x2923('0x40')],'id':_0xb066c['id']};_0x2c9b42[_0x2923('0x53')]=intUtil[_0x2923('0x54')](_0x4fb8e2[_0x2923('0x55')],_0x5c8e16,'\x20');_0x2c9b42[_0x2923('0x56')]=intUtil['getString'](_0x4fb8e2[_0x2923('0x57')],_0x5c8e16,'\x0a');if(_0x4eb0b9[_0x2923('0x58')]==='Contacts'){_0x2c9b42['Who_Id']={'name':!_[_0x2923('0x1c')](_0x4eb0b9['Full_Name'])?_0x4eb0b9[_0x2923('0x59')]:!_[_0x2923('0x1c')](_0x4eb0b9[_0x2923('0x5a')])?_0x4eb0b9['First_Name']+'\x20'+_0x4eb0b9[_0x2923('0x5b')]:_0x4eb0b9['Last_Name'],'id':_0x4eb0b9['id']};}if(_0x4eb0b9['enduserType']==='Leads'){_0x2c9b42['What_Id']={'name':!_[_0x2923('0x1c')](_0x4eb0b9['Full_Name'])?_0x4eb0b9[_0x2923('0x59')]:!_[_0x2923('0x1c')](_0x4eb0b9['First_Name'])?_0x4eb0b9[_0x2923('0x5a')]+'\x20'+_0x4eb0b9[_0x2923('0x5b')]:_0x4eb0b9['Last_Name'],'id':_0x4eb0b9['id']};_0x2c9b42[_0x2923('0x5c')]=_[_0x2923('0x3c')](_0x4eb0b9[_0x2923('0x58')]);}if(_0x5c8e16[_0x2923('0x5d')]){_0x2c9b42[_0x2923('0x5e')]=moment[_0x2923('0x5f')](parseInt(_0x5c8e16[_0x2923('0x5d')])*0x3e8)[_0x2923('0x60')](_0x2923('0x61'));}else if(_0x5c8e16[_0x2923('0x62')]&&_0x5c8e16[_0x2923('0x63')]){_0x2c9b42['Call_Duration']=moment[_0x2923('0x5f')](moment(_0x5c8e16['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x2923('0x64')](moment(_0x5c8e16[_0x2923('0x65')],_0x2923('0x66'))))[_0x2923('0x60')](_0x2923('0x61'));}switch(_0x5c8e16[_0x2923('0x67')]){case _0x2923('0x68'):_0x2c9b42[_0x2923('0x69')]=_0x2923('0x6a');break;case _0x2923('0x6b'):case _0x2923('0x6c'):_0x2c9b42[_0x2923('0x69')]=_0x2923('0x6d');break;case _0x2923('0x6e'):_0x2c9b42[_0x2923('0x69')]=_0x2923('0x6f');break;case _0x2923('0x70'):_0x2c9b42['Call_Result']='Abandoned';break;case'timeout':_0x2c9b42[_0x2923('0x69')]='Timeout';default:}_0x2c9b42['Call_Start_Time']=(_0xa3d12a===_0x2923('0x71')?moment(_0x5c8e16[_0x2923('0x65')])[_0x2923('0x60')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x5c8e16[_0x2923('0x72')])[_0x2923('0x60')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x2923('0x60')](_0x2923('0x66'));_0x2c9b42['Call_Type']=_0xa3d12a||_0x2923('0x73');_0x2c9b42=_[_0x2923('0x74')](_0x2c9b42,getCustomFields(_0x4fb8e2[_0x2923('0x75')],_0x5c8e16));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x3c56c9+_0x2923('0x76'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2651ac},'body':{'data':[_0x2c9b42]},'json':!![]})['then'](function(_0x3a7a92){if(_0x3a7a92&&_0x3a7a92['data'][0x0][_0x2923('0x77')]===_0x2923('0x78')){logger['info'](_0x2923('0x79'));return{'id':_0x3a7a92[_0x2923('0x3a')][0x0][_0x2923('0x41')]['id']};}})[_0x2923('0x2a')](function(_0x5ba736){logger['info'](_0x2923('0x7a'),_0x5ba736['stack']);console['log']('err',_0x5ba736);});}exports['queue']=function(_0x3f4a09,_0x137d17,_0x2c7674,_0x1a956c,_0x4ac4a3,_0x1bf7fc){var _0x595741,_0x2924d1,_0x15a3f0;_0x1bf7fc[_0x2923('0x7b')]=intUtil[_0x2923('0x7c')](_0x1bf7fc['host']);_0x1bf7fc['serverUrl']=intUtil[_0x2923('0x7c')](_0x1bf7fc[_0x2923('0x7d')]);if(_0x4ac4a3&&_0x4ac4a3[_0x2923('0x7e')]){logger['info'](_0x2923('0x7f'),_0x2923('0x80'));_0x137d17[_0x2923('0x81')]=_0x1bf7fc[_0x2923('0x7d')]+_0x2923('0x82')+_0x137d17['uniqueid']+_0x2923('0x83')+md5(_0x137d17['uniqueid']);}else{_0x137d17['recordingURL']='';}var _0x349c80=_0x1bf7fc[_0x2923('0x7b')]===_0x2923('0x84')?'eu':_0x2923('0x85');return getAccessToken(_0x1bf7fc)[_0x2923('0x28')](function(_0x23c9a3){_0x15a3f0=_0x23c9a3;return getUser(_0x15a3f0,_0x349c80,_0x1bf7fc,_0x1a956c['email']);})[_0x2923('0x28')](function(_0x49b97e){_0x595741=_0x49b97e;logger[_0x2923('0x35')](_0x2923('0x86'),_0x595741['id']);return getEndUser(_0x15a3f0,_0x349c80,_0x1bf7fc,_0x137d17[_0x2923('0x87')],_0x137d17[_0x2923('0x88')],_0x595741,_0x2c7674);})['then'](function(_0x47300b){_0x2924d1=_0x47300b;return getCall(_0x15a3f0,_0x349c80,_0x1bf7fc,_0x595741,_0x2924d1,_0x2c7674,_0x137d17,'Inbound');})[_0x2923('0x28')](function(_0x2ab6a6){if(_0x2ab6a6){logger[_0x2923('0x35')]('The\x20Call\x20ID\x20is:',_0x2ab6a6['id']);logger[_0x2923('0x35')](_0x2923('0x7f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x1a956c[_0x2923('0x18')]),_0x2923('0x89'),{'uri':_0x2923('0x8a')+_0x1bf7fc[_0x2923('0x7b')]+_0x2923('0x8b')+_0x2ab6a6['id']});}})[_0x2923('0x2a')](function(_0x4630d5){logger[_0x2923('0x2b')](_0x2923('0x7f'),JSON[_0x2923('0xd')](_0x4630d5));});};exports['outbound']=function(_0x2586eb,_0x262f21,_0x40ee41,_0x2e8a52,_0x493709,_0x37d1c4,_0x3c3038){var _0x55aa0e,_0x34046a,_0x31f4d3;_0x37d1c4[_0x2923('0x7b')]=intUtil[_0x2923('0x7c')](_0x37d1c4[_0x2923('0x7b')]);_0x37d1c4[_0x2923('0x7d')]=intUtil[_0x2923('0x7c')](_0x37d1c4[_0x2923('0x7d')]);if(_0x3c3038&&_0x3c3038[_0x2923('0x8c')]&&_0x3c3038['recordingFormat']!==_0x2923('0x8d')){logger[_0x2923('0x35')]('[OUTBOUND]',_0x2923('0x80'));_0x262f21[_0x2923('0x81')]=_0x37d1c4['serverUrl']+_0x2923('0x82')+_0x262f21['uniqueid']+_0x2923('0x83')+md5(_0x262f21[_0x2923('0x8e')]);}var _0x930036=_0x37d1c4[_0x2923('0x7b')]===_0x2923('0x84')?'eu':_0x2923('0x85');return getAccessToken(_0x37d1c4)[_0x2923('0x28')](function(_0xad6e37){_0x31f4d3=_0xad6e37;return getUser(_0x31f4d3,_0x930036,_0x37d1c4,_0x2e8a52[_0x2923('0x34')]);})[_0x2923('0x28')](function(_0x5077a9){_0x55aa0e=_0x5077a9;logger[_0x2923('0x35')](_0x2923('0x86'),_0x55aa0e['id']);return getEndUser(_0x31f4d3,_0x930036,_0x37d1c4,_0x262f21[_0x2923('0x8f')],_0x262f21['destcalleridnum'],_0x55aa0e,_0x40ee41);})[_0x2923('0x28')](function(_0x328fa5){_0x34046a=_0x328fa5;return getCall(_0x31f4d3,_0x930036,_0x37d1c4,_0x55aa0e,_0x34046a,_0x40ee41,_0x262f21,_0x2923('0x90'));})[_0x2923('0x28')](function(_0x161d31){if(_0x161d31){logger[_0x2923('0x35')](_0x2923('0x91'),_0x161d31['id']);logger[_0x2923('0x35')](_0x2923('0x92'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2923('0x60')]('user:%s',_0x2e8a52[_0x2923('0x18')]),'trigger:browser:url',{'uri':_0x2923('0x8a')+_0x37d1c4[_0x2923('0x7b')]+_0x2923('0x8b')+_0x161d31['id']});}})[_0x2923('0x2a')](function(_0xb41d4e){logger['error']('[OUTBOUND]',JSON[_0x2923('0xd')](_0xb41d4e));});};exports[_0x2923('0x93')]=function(_0x442d84,_0xc15d6f,_0x18116b,_0x2b46e0,_0x58708a,_0x217baf){var _0x2f9aba,_0x307b78,_0x54c290;_0x217baf[_0x2923('0x7b')]=intUtil[_0x2923('0x7c')](_0x217baf[_0x2923('0x7b')]);_0x217baf[_0x2923('0x7d')]=intUtil[_0x2923('0x7c')](_0x217baf[_0x2923('0x7d')]);if(_0x58708a&&_0x58708a[_0x2923('0x7e')]){logger[_0x2923('0x35')]('['+_0xc15d6f[_0x2923('0x67')][_0x2923('0x94')]()+']',_0x2923('0x80'));_0xc15d6f[_0x2923('0x81')]=_0x217baf[_0x2923('0x7d')]+_0x2923('0x82')+_0xc15d6f['uniqueid']+_0x2923('0x83')+md5(_0xc15d6f[_0x2923('0x8e')]);}else{_0xc15d6f[_0x2923('0x81')]='';}var _0x2383df=_0x217baf[_0x2923('0x7b')]===_0x2923('0x84')?'eu':_0x2923('0x85');return getAccessToken(_0x217baf)[_0x2923('0x28')](function(_0x900002){_0x54c290=_0x900002;return getUser(_0x54c290,_0x2383df,_0x217baf);})[_0x2923('0x28')](function(_0xcb9ba2){_0x2f9aba=_0xcb9ba2;logger[_0x2923('0x35')](_0x2923('0x86'),_0x2f9aba['id']);return getEndUser(_0x54c290,_0x2383df,_0x217baf,_0xc15d6f['calleridname'],_0xc15d6f['calleridnum'],_0x2f9aba,_0x18116b);})[_0x2923('0x28')](function(_0x2135fb){_0x307b78=_0x2135fb;return getCall(_0x54c290,_0x2383df,_0x217baf,_0x2f9aba,_0x307b78,_0x18116b,_0xc15d6f,'Inbound');})[_0x2923('0x28')](function(_0x3275b0){if(_0x3275b0){logger[_0x2923('0x35')]('The\x20Call\x20ID\x20is:',_0x3275b0['id']);}})[_0x2923('0x2a')](function(_0x54a257){logger['error']('['+_0xc15d6f[_0x2923('0x67')][_0x2923('0x94')]()+']',JSON[_0x2923('0xd')](_0x54a257));});}; \ No newline at end of file +var _0xd3d1=['/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','complete','Answered','rejected','Rejected','Abandoned','timeout','Timeout','outbound','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','code','SUCCESS','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','/downloads?type=uniqueid&token=','email','destcalleridnum','Outbound','[OUTBOUND]','user:%s','https://crm.','unmanaged','toUpperCase','lodash','request-promise','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','error','stack','info','Search\x20user','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','data','details','Error:\x20','log','CREATE\x20ERROR','GET','contact_lead','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact'];(function(_0x342df6,_0x35dc19){var _0x45da37=function(_0x4b0be1){while(--_0x4b0be1){_0x342df6['push'](_0x342df6['shift']());}};_0x45da37(++_0x35dc19);}(_0xd3d1,0x172));var _0x1d3d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd3d1[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x1d3d('0x0'));var rp=require(_0x1d3d('0x1'));var md5=require('md5');var util=require('util');var intUtil=require(_0x1d3d('0x2'));var moment=require(_0x1d3d('0x3'));var Redis=require(_0x1d3d('0x4'));var BPromise=require(_0x1d3d('0x5'));var config=require(_0x1d3d('0x6'));var logger=require(_0x1d3d('0x7'))(_0x1d3d('0x8'));config[_0x1d3d('0x9')]=_[_0x1d3d('0xa')](config[_0x1d3d('0x9')],{'host':_0x1d3d('0xb'),'port':0x18eb});var io=require(_0x1d3d('0xc'))(new Redis(config[_0x1d3d('0x9')]));function emit(_0x2c377c,_0xbea61e,_0x2ba122){io['to'](_0x2c377c)[_0x1d3d('0xd')](_0xbea61e,_0x2ba122);}function request(_0x510a37){logger[_0x1d3d('0xe')](_0x1d3d('0xf'),JSON[_0x1d3d('0x10')](_0x510a37));return rp(_0x510a37);}function getCustomFields(_0x32742c,_0x27d914){var _0x372ff2={};if(_0x32742c[_0x1d3d('0x11')]>0x0){_[_0x1d3d('0x12')](_0x32742c,function(_0x3b3913){if(_[_0x1d3d('0x13')]([_0x1d3d('0x14'),'picklist'],_0x3b3913[_0x1d3d('0x15')])&&_0x3b3913[_0x1d3d('0x16')]){_0x372ff2[_0x3b3913['idField']]=_0x3b3913['content'][_0x1d3d('0x17')]();}else if(_0x3b3913[_0x1d3d('0x15')]===_0x1d3d('0x18')&&_0x3b3913['variableName']&&_0x3b3913[_0x1d3d('0x16')]&&_0x27d914[_0x3b3913['variableName']]){_0x372ff2[_0x3b3913[_0x1d3d('0x16')]]=_0x27d914[_0x3b3913[_0x1d3d('0x19')]][_0x1d3d('0x17')]();}else if(_0x3b3913[_0x1d3d('0x15')]===_0x1d3d('0x1a')&&_0x3b3913[_0x1d3d('0x1b')]&&_0x3b3913[_0x1d3d('0x1b')]['name']&&_0x3b3913['idField']&&_0x27d914[_0x3b3913[_0x1d3d('0x1b')][_0x1d3d('0x1c')]['toLowerCase']()]){_0x372ff2[_0x3b3913[_0x1d3d('0x16')]]=_0x27d914[_0x3b3913['Variable'][_0x1d3d('0x1c')][_0x1d3d('0x1d')]()][_0x1d3d('0x17')]();}});}return _0x372ff2;}function getName(_0x2d6dfb){if(_0x2d6dfb['indexOf']('\x20')>0x0){var _0x2b77ee=_0x2d6dfb['split'](/ (.+)/);if(_0x2b77ee[0x1]){return _0x2b77ee;}}return[_0x2d6dfb,_0x2d6dfb];}var accountsTokens={};function getAccessToken(_0x56c424){return new Promise(function(_0x108005,_0x2bfac3){if(!_[_0x1d3d('0x1e')](accountsTokens[_0x56c424['id']])&&!_[_0x1d3d('0x1e')](accountsTokens[_0x56c424['id']][_0x1d3d('0x1f')])){if(moment()[_0x1d3d('0x20')](accountsTokens[_0x56c424['id']][_0x1d3d('0x21')])){_0x108005(accountsTokens[_0x56c424['id']][_0x1d3d('0x1f')]);}}var _0x270b90;switch(_0x56c424[_0x1d3d('0x22')]){case'US':_0x270b90=_0x1d3d('0x23');break;case'AU':_0x270b90='https://accounts.zoho.com.au';break;case'EU':_0x270b90=_0x1d3d('0x24');break;case'IN':_0x270b90=_0x1d3d('0x25');break;case'CN':_0x270b90='https://accounts.zoho.com.cn';break;default:_0x270b90=_0x1d3d('0x24');break;}var _0x5c52da={'method':_0x1d3d('0x26'),'uri':_0x270b90+_0x1d3d('0x27'),'qs':{'refresh_token':_0x56c424[_0x1d3d('0x28')],'client_id':_0x56c424[_0x1d3d('0x29')],'client_secret':_0x56c424[_0x1d3d('0x2a')],'grant_type':_0x1d3d('0x2b')},'json':!![]};return rp(_0x5c52da)[_0x1d3d('0x2c')](function(_0x298fd3){accountsTokens[_0x56c424['id']]={'access_token':_0x298fd3[_0x1d3d('0x1f')],'expires_in':moment()[_0x1d3d('0x2d')](_0x298fd3[_0x1d3d('0x21')],'seconds')};_0x108005(_0x298fd3[_0x1d3d('0x1f')]);})['catch'](function(_0x227ce7){logger[_0x1d3d('0x2e')]('Failing\x20creating\x20the\x20access_token',_0x227ce7[_0x1d3d('0x2f')]);_0x2bfac3(_0x227ce7);});});}function getUser(_0x16b7b3,_0x3cb011,_0x2a3812,_0x4abbfc){logger[_0x1d3d('0x30')](_0x1d3d('0x31'));return request({'method':'GET','uri':util[_0x1d3d('0x32')]('https://www.zohoapis.%s/crm/v2/users',_0x3cb011),'qs':{'type':_0x1d3d('0x33')},'headers':{'Authorization':_0x1d3d('0x34')+_0x16b7b3},'json':!![]})['then'](function(_0x106a79){if(_0x106a79[_0x1d3d('0x35')]){var _0x102b70=-0x1;if(_[_0x1d3d('0x36')](_0x106a79[_0x1d3d('0x35')])){if(!_[_0x1d3d('0x1e')](_0x4abbfc)){_0x102b70=_[_0x1d3d('0x37')](_0x106a79[_0x1d3d('0x35')],function(_0x2c2201){return _0x2c2201['email']===_0x4abbfc;});}if(_0x102b70>=0x0){logger[_0x1d3d('0x30')](_0x1d3d('0x38'));}else{logger[_0x1d3d('0x30')](_0x1d3d('0x39'));_0x102b70=_['findIndex'](_0x106a79['users'],function(_0x3dacee){return _0x3dacee[_0x1d3d('0x3a')]['name']===_0x1d3d('0x3b');});}return _0x106a79[_0x1d3d('0x35')][_0x102b70];}else{if(_0x106a79[_0x1d3d('0x3c')][_0x1d3d('0x3a')]['name']==='Administrator'){logger[_0x1d3d('0x30')]('Using\x20the\x20admin\x20account!');user=_0x106a79[_0x1d3d('0x3c')];return user;}else{logger[_0x1d3d('0x2e')](_0x1d3d('0x3d'),JSON[_0x1d3d('0x10')](_0x106a79));throw new Error(_0x1d3d('0x3e')+JSON[_0x1d3d('0x10')](_0x106a79));}}}else{logger[_0x1d3d('0x2e')](_0x1d3d('0x3d'),JSON['stringify'](_0x106a79));throw new Error(_0x1d3d('0x3e')+JSON['stringify'](_0x106a79));}})[_0x1d3d('0x3f')](function(_0x206e4c){console['error'](_0x206e4c);});}function getZohoUser(_0x175e8a,_0x2319af){return new BPromise(function(_0x182083,_0xb6742f){request(_0x175e8a)['then'](function(_0x4a9914){var _0x434dad=null;if(_0x4a9914){_0x434dad=_0x4a9914['data'][0x0];_0x434dad[_0x1d3d('0x40')]=_0x2319af;}_0x182083(_0x434dad);})[_0x1d3d('0x3f')](function(_0x5ba0cd){_0xb6742f(_0x5ba0cd);});});}function createEndUser(_0x1ad7a6,_0x175028,_0x51be79,_0x2d5015,_0x40f8ca,_0x410893){var _0x51be79=getName(_0x51be79);return request({'method':_0x1d3d('0x26'),'uri':_0x1d3d('0x41')+_0x175028+'/crm/v2/'+_[_0x1d3d('0x42')](_0x410893[_0x1d3d('0x43')])+'s','body':{'data':[{'Last_Name':_0x51be79[0x1],'First_Name':_0x51be79[0x0],'Phone':_0x2d5015,'Owner':{'name':!_[_0x1d3d('0x1e')](_0x40f8ca[_0x1d3d('0x44')][_0x1d3d('0x1c')])?_0x40f8ca['role'][_0x1d3d('0x1c')]:!_[_0x1d3d('0x1e')](_0x40f8ca[_0x1d3d('0x45')])?_0x40f8ca[_0x1d3d('0x45')]+'\x20'+_0x40f8ca['last_name']:_0x40f8ca[_0x1d3d('0x46')],'id':_0x40f8ca['id']}}]},'headers':{'Authorization':_0x1d3d('0x34')+_0x1ad7a6},'json':!![]})[_0x1d3d('0x2c')](function(_0x1c34e0){if(_0x1c34e0&&_0x1c34e0[_0x1d3d('0x47')][0x0]['code']==='SUCCESS'){var _0x229f48=_0x1c34e0[_0x1d3d('0x47')][0x0][_0x1d3d('0x48')];_0x229f48[_0x1d3d('0x40')]=_[_0x1d3d('0x42')](_0x410893['moduleCreate'])+'s';return _0x229f48;}logger[_0x1d3d('0x2e')]('The\x20failing\x20result\x20is',JSON[_0x1d3d('0x10')](data));throw new Error(_0x1d3d('0x49')+JSON[_0x1d3d('0x10')](data));})[_0x1d3d('0x3f')](function(_0x58c7ab){console[_0x1d3d('0x4a')](_0x1d3d('0x4b'),_0x58c7ab);});}function getEndUser(_0x3b269b,_0x34534d,_0x23a6d9,_0x1c8ee3,_0x3a3389,_0x55aa8a,_0x3c5ccf){var _0x5891cc={'method':_0x1d3d('0x4c'),'uri':'','headers':{'Authorization':_0x1d3d('0x34')+_0x3b269b},'json':!![]};switch(_0x3c5ccf['moduleSearch']){case _0x1d3d('0x4d'):_0x5891cc['uri']=_0x1d3d('0x41')+_0x34534d+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3a3389+'))';return getZohoUser(_0x5891cc,_0x1d3d('0x4e'))[_0x1d3d('0x2c')](function(_0x1dafe8){if(_0x1dafe8)return _0x1dafe8;_0x5891cc[_0x1d3d('0x4f')]=_0x1d3d('0x41')+_0x34534d+_0x1d3d('0x50')+_0x3a3389+'))';return getZohoUser(_0x5891cc,_0x1d3d('0x51'))[_0x1d3d('0x2c')](function(_0x59e88a){if(_0x59e88a)return _0x59e88a;if(_0x3c5ccf['moduleCreate']!='nothing'){return createEndUser(_0x3b269b,_0x34534d,_0x1c8ee3,_0x3a3389,_0x55aa8a,_0x3c5ccf);}else{return{};}});});break;case _0x1d3d('0x52'):_0x5891cc[_0x1d3d('0x4f')]=_0x1d3d('0x41')+_0x34534d+_0x1d3d('0x53')+_0x3a3389+'))';return getZohoUser(_0x5891cc,_0x1d3d('0x4e'))[_0x1d3d('0x2c')](function(_0x47beed){if(_0x47beed)return _0x47beed;if(_0x3c5ccf['moduleCreate']!='nothing'){return createEndUser(_0x3b269b,_0x34534d,_0x1c8ee3,_0x3a3389,_0x55aa8a,_0x3c5ccf);}else{return{};}});break;case'lead':_0x5891cc[_0x1d3d('0x4f')]=_0x1d3d('0x41')+_0x34534d+_0x1d3d('0x50')+_0x3a3389+'))';return getZohoUser(_0x5891cc,_0x1d3d('0x51'))[_0x1d3d('0x2c')](function(_0x363f4c){if(_0x363f4c)return _0x363f4c;if(_0x3c5ccf[_0x1d3d('0x43')]!=_0x1d3d('0x54')){return createEndUser(_0x3b269b,_0x34534d,_0x1c8ee3,_0x3a3389,_0x55aa8a,_0x3c5ccf);}else{return{};}});break;}}function getCall(_0x3792ab,_0x445cb0,_0xefc84c,_0xb88d59,_0x3e6431,_0x212929,_0x311b05,_0x5ce0d3){logger[_0x1d3d('0x30')](_0x1d3d('0x55'));var _0x1bbfc8={};_0x1bbfc8[_0x1d3d('0x56')]={'name':!_['isNil'](_0xb88d59[_0x1d3d('0x44')]['name'])&&!_['isNil'](_0xb88d59[_0x1d3d('0x3a')][_0x1d3d('0x1c')])&&_0xb88d59['profile'][_0x1d3d('0x1c')]===_0x1d3d('0x57')?_0xb88d59['role'][_0x1d3d('0x1c')]:!_[_0x1d3d('0x1e')](_0xb88d59[_0x1d3d('0x45')])?_0xb88d59[_0x1d3d('0x45')]+'\x20'+_0xb88d59[_0x1d3d('0x46')]:_0xb88d59[_0x1d3d('0x46')],'id':_0xb88d59['id']};_0x1bbfc8[_0x1d3d('0x58')]=intUtil[_0x1d3d('0x59')](_0x212929[_0x1d3d('0x5a')],_0x311b05,'\x20');_0x1bbfc8['Description']=intUtil[_0x1d3d('0x59')](_0x212929['Descriptions'],_0x311b05,'\x0a');if(_0x3e6431['enduserType']==='Contacts'){_0x1bbfc8['Who_Id']={'name':!_[_0x1d3d('0x1e')](_0x3e6431[_0x1d3d('0x5b')])?_0x3e6431[_0x1d3d('0x5b')]:!_[_0x1d3d('0x1e')](_0x3e6431['First_Name'])?_0x3e6431[_0x1d3d('0x5c')]+'\x20'+_0x3e6431['Last_Name']:_0x3e6431[_0x1d3d('0x5d')],'id':_0x3e6431['id']};}if(_0x3e6431[_0x1d3d('0x40')]==='Leads'){_0x1bbfc8[_0x1d3d('0x5e')]={'name':!_[_0x1d3d('0x1e')](_0x3e6431['Full_Name'])?_0x3e6431[_0x1d3d('0x5b')]:!_[_0x1d3d('0x1e')](_0x3e6431[_0x1d3d('0x5c')])?_0x3e6431[_0x1d3d('0x5c')]+'\x20'+_0x3e6431[_0x1d3d('0x5d')]:_0x3e6431[_0x1d3d('0x5d')],'id':_0x3e6431['id']};_0x1bbfc8['$se_module']=_[_0x1d3d('0x42')](_0x3e6431[_0x1d3d('0x40')]);}if(_0x311b05[_0x1d3d('0x5f')]){_0x1bbfc8[_0x1d3d('0x60')]=moment[_0x1d3d('0x61')](parseInt(_0x311b05['talktime'])*0x3e8)[_0x1d3d('0x32')]('mm:ss');}else if(_0x311b05[_0x1d3d('0x62')]&&_0x311b05['endtime']){_0x1bbfc8[_0x1d3d('0x60')]=moment[_0x1d3d('0x61')](moment(_0x311b05[_0x1d3d('0x63')],_0x1d3d('0x64'))[_0x1d3d('0x65')](moment(_0x311b05[_0x1d3d('0x66')],_0x1d3d('0x64'))))['format'](_0x1d3d('0x67'));}switch(_0x311b05[_0x1d3d('0x68')]){case _0x1d3d('0x69'):_0x1bbfc8[_0x1d3d('0x6a')]=_0x1d3d('0x6b');break;case _0x1d3d('0x6c'):case'connect':_0x1bbfc8[_0x1d3d('0x6a')]=_0x1d3d('0x6d');break;case _0x1d3d('0x6e'):_0x1bbfc8[_0x1d3d('0x6a')]=_0x1d3d('0x6f');break;case'abandoned':_0x1bbfc8[_0x1d3d('0x6a')]=_0x1d3d('0x70');break;case _0x1d3d('0x71'):_0x1bbfc8['Call_Result']=_0x1d3d('0x72');default:}_0x1bbfc8['Call_Start_Time']=(_0x5ce0d3===_0x1d3d('0x73')?moment(_0x311b05['starttime'])[_0x1d3d('0x32')](_0x1d3d('0x64')):moment(_0x311b05[_0x1d3d('0x74')])['format'](_0x1d3d('0x64')))||moment()[_0x1d3d('0x32')](_0x1d3d('0x64'));_0x1bbfc8['Call_Type']=_0x5ce0d3||_0x1d3d('0x75');_0x1bbfc8=_[_0x1d3d('0x76')](_0x1bbfc8,getCustomFields(_0x212929[_0x1d3d('0x77')],_0x311b05));return request({'method':'POST','uri':_0x1d3d('0x41')+_0x445cb0+_0x1d3d('0x78'),'headers':{'Authorization':_0x1d3d('0x34')+_0x3792ab},'body':{'data':[_0x1bbfc8]},'json':!![]})[_0x1d3d('0x2c')](function(_0x107494){if(_0x107494&&_0x107494['data'][0x0][_0x1d3d('0x79')]===_0x1d3d('0x7a')){logger[_0x1d3d('0x30')]('Call\x20created!');return{'id':_0x107494[_0x1d3d('0x47')][0x0][_0x1d3d('0x48')]['id']};}})[_0x1d3d('0x3f')](function(_0xf63f11){logger[_0x1d3d('0x30')]('err',_0xf63f11[_0x1d3d('0x2f')]);console[_0x1d3d('0x4a')]('err',_0xf63f11);});}exports[_0x1d3d('0x7b')]=function(_0x32639e,_0x51f4fd,_0x3416ec,_0x276f87,_0x14fce0,_0x25220f){var _0x4c59a0,_0x3fc022,_0x1b7741;_0x25220f[_0x1d3d('0x7c')]=intUtil[_0x1d3d('0x7d')](_0x25220f['host']);_0x25220f['serverUrl']=intUtil[_0x1d3d('0x7d')](_0x25220f[_0x1d3d('0x7e')]);if(_0x14fce0&&_0x14fce0[_0x1d3d('0x7f')]){logger[_0x1d3d('0x30')](_0x1d3d('0x80'),_0x1d3d('0x81'));_0x51f4fd[_0x1d3d('0x82')]=_0x25220f['serverUrl']+_0x1d3d('0x83')+_0x51f4fd[_0x1d3d('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x51f4fd[_0x1d3d('0x84')]);}else{_0x51f4fd[_0x1d3d('0x82')]='';}var _0x3ab561=_0x25220f['host']===_0x1d3d('0x85')?'eu':_0x1d3d('0x86');return getAccessToken(_0x25220f)[_0x1d3d('0x2c')](function(_0x4ae421){_0x1b7741=_0x4ae421;return getUser(_0x1b7741,_0x3ab561,_0x25220f,_0x276f87['email']);})[_0x1d3d('0x2c')](function(_0x300ce9){_0x4c59a0=_0x300ce9;logger[_0x1d3d('0x30')](_0x1d3d('0x87'),_0x4c59a0['id']);return getEndUser(_0x1b7741,_0x3ab561,_0x25220f,_0x51f4fd['calleridname'],_0x51f4fd[_0x1d3d('0x88')],_0x4c59a0,_0x3416ec);})[_0x1d3d('0x2c')](function(_0x17081a){_0x3fc022=_0x17081a;return getCall(_0x1b7741,_0x3ab561,_0x25220f,_0x4c59a0,_0x3fc022,_0x3416ec,_0x51f4fd,'Inbound');})[_0x1d3d('0x2c')](function(_0x3a66d2){if(_0x3a66d2){logger['info'](_0x1d3d('0x89'),_0x3a66d2['id']);logger['info'](_0x1d3d('0x80'),_0x1d3d('0x8a'));emit(util['format']('user:%s',_0x276f87[_0x1d3d('0x1c')]),_0x1d3d('0x8b'),{'uri':'https://crm.'+_0x25220f[_0x1d3d('0x7c')]+_0x1d3d('0x8c')+_0x3a66d2['id']});}})[_0x1d3d('0x3f')](function(_0xb8f1b5){logger['error'](_0x1d3d('0x80'),JSON[_0x1d3d('0x10')](_0xb8f1b5));});};exports[_0x1d3d('0x73')]=function(_0x5b75df,_0x216a42,_0x2d884c,_0x3a6655,_0x5a3725,_0x14f5f3,_0x434d65){var _0x3fd82a,_0x939714,_0x1f9d7e;_0x14f5f3[_0x1d3d('0x7c')]=intUtil['stripTrailingSlash'](_0x14f5f3[_0x1d3d('0x7c')]);_0x14f5f3[_0x1d3d('0x7e')]=intUtil['stripTrailingSlash'](_0x14f5f3[_0x1d3d('0x7e')]);if(_0x434d65&&_0x434d65[_0x1d3d('0x8d')]&&_0x434d65[_0x1d3d('0x8d')]!=='none'){logger[_0x1d3d('0x30')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x216a42['recordingURL']=_0x14f5f3[_0x1d3d('0x7e')]+'/api/voice/recordings/'+_0x216a42[_0x1d3d('0x84')]+_0x1d3d('0x8e')+md5(_0x216a42[_0x1d3d('0x84')]);}var _0x175e7f=_0x14f5f3['host']==='zoho.eu'?'eu':_0x1d3d('0x86');return getAccessToken(_0x14f5f3)[_0x1d3d('0x2c')](function(_0x5dc159){_0x1f9d7e=_0x5dc159;return getUser(_0x1f9d7e,_0x175e7f,_0x14f5f3,_0x3a6655[_0x1d3d('0x8f')]);})[_0x1d3d('0x2c')](function(_0x5be307){_0x3fd82a=_0x5be307;logger[_0x1d3d('0x30')](_0x1d3d('0x87'),_0x3fd82a['id']);return getEndUser(_0x1f9d7e,_0x175e7f,_0x14f5f3,_0x216a42['destcalleridname'],_0x216a42[_0x1d3d('0x90')],_0x3fd82a,_0x2d884c);})['then'](function(_0x3ac7e6){_0x939714=_0x3ac7e6;return getCall(_0x1f9d7e,_0x175e7f,_0x14f5f3,_0x3fd82a,_0x939714,_0x2d884c,_0x216a42,_0x1d3d('0x91'));})[_0x1d3d('0x2c')](function(_0x41d4ee){if(_0x41d4ee){logger[_0x1d3d('0x30')]('The\x20Call\x20ID\x20is:',_0x41d4ee['id']);logger[_0x1d3d('0x30')](_0x1d3d('0x92'),_0x1d3d('0x8a'));emit(util[_0x1d3d('0x32')](_0x1d3d('0x93'),_0x3a6655[_0x1d3d('0x1c')]),_0x1d3d('0x8b'),{'uri':_0x1d3d('0x94')+_0x14f5f3[_0x1d3d('0x7c')]+_0x1d3d('0x8c')+_0x41d4ee['id']});}})[_0x1d3d('0x3f')](function(_0x123523){logger['error'](_0x1d3d('0x92'),JSON['stringify'](_0x123523));});};exports[_0x1d3d('0x95')]=function(_0x12a986,_0x3a8a53,_0x1d5518,_0x410d43,_0x38fceb,_0x3e9c1e){var _0xe36eb8,_0x264c82,_0x4b6240;_0x3e9c1e['host']=intUtil['stripTrailingSlash'](_0x3e9c1e[_0x1d3d('0x7c')]);_0x3e9c1e['serverUrl']=intUtil[_0x1d3d('0x7d')](_0x3e9c1e['serverUrl']);if(_0x38fceb&&_0x38fceb[_0x1d3d('0x7f')]){logger[_0x1d3d('0x30')]('['+_0x3a8a53[_0x1d3d('0x68')][_0x1d3d('0x96')]()+']','Recording\x20is\x20enabled!');_0x3a8a53[_0x1d3d('0x82')]=_0x3e9c1e[_0x1d3d('0x7e')]+_0x1d3d('0x83')+_0x3a8a53[_0x1d3d('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x3a8a53[_0x1d3d('0x84')]);}else{_0x3a8a53[_0x1d3d('0x82')]='';}var _0x527791=_0x3e9c1e[_0x1d3d('0x7c')]===_0x1d3d('0x85')?'eu':'com';return getAccessToken(_0x3e9c1e)['then'](function(_0x5e8bea){_0x4b6240=_0x5e8bea;return getUser(_0x4b6240,_0x527791,_0x3e9c1e);})['then'](function(_0x2762df){_0xe36eb8=_0x2762df;logger['info'](_0x1d3d('0x87'),_0xe36eb8['id']);return getEndUser(_0x4b6240,_0x527791,_0x3e9c1e,_0x3a8a53['calleridname'],_0x3a8a53['calleridnum'],_0xe36eb8,_0x1d5518);})['then'](function(_0x55a7e6){_0x264c82=_0x55a7e6;return getCall(_0x4b6240,_0x527791,_0x3e9c1e,_0xe36eb8,_0x264c82,_0x1d5518,_0x3a8a53,'Inbound');})['then'](function(_0x33960e){if(_0x33960e){logger['info'](_0x1d3d('0x89'),_0x33960e['id']);}})[_0x1d3d('0x3f')](function(_0x2f949a){logger[_0x1d3d('0x2e')]('['+_0x3a8a53[_0x1d3d('0x68')]['toUpperCase']()+']',JSON[_0x1d3d('0x10')](_0x2f949a));});}; \ 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 66a495b..ce2e54b 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 _0x349c=['util','shelljs','mustache','../../../../config/logger','trigger','data2','Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x1820a5,_0x552e13){var _0x3a1f37=function(_0x667274){while(--_0x667274){_0x1820a5['push'](_0x1820a5['shift']());}};_0x3a1f37(++_0x552e13);}(_0x349c,0x7e));var _0xc349=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0x349c[_0x52e363];return _0x3fc2b5;};'use strict';var util=require(_0xc349('0x0'));var sh=require(_0xc349('0x1'));var Mustache=require(_0xc349('0x2'));var logger=require(_0xc349('0x3'))(_0xc349('0x4'));exports['exec']=function(_0x3677e2,_0x1d3db3){var _0x254c98=_0x3677e2[_0xc349('0x5')]?_0x3677e2['data2']:_0xc349('0x6');var _0x379794=_0x3677e2[_0xc349('0x7')]?Mustache[_0xc349('0x8')](_0x3677e2['data3'],_0x1d3db3):_0x1d3db3;sh['exec'](_0x379794,function(_0x463e42,_0x534ae4,_0x3b42b1){if(_0x463e42!==0x0){logger[_0xc349('0x9')](util['format'](_0xc349('0xa'),_0x254c98,_0x379794,_0x463e42,_0x3b42b1));}else{logger[_0xc349('0xb')](util[_0xc349('0xc')](_0xc349('0xd'),_0x254c98,_0x379794,_0x534ae4));}});}; \ No newline at end of file +var _0xb266=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','data2','data3','render','exec','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format'];(function(_0x11a962,_0x3cc338){var _0x55d423=function(_0xf4b236){while(--_0xf4b236){_0x11a962['push'](_0x11a962['shift']());}};_0x55d423(++_0x3cc338);}(_0xb266,0xcd));var _0x6b26=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb266[_0x4a9fb1];return _0x348672;};'use strict';var util=require('util');var sh=require(_0x6b26('0x0'));var Mustache=require(_0x6b26('0x1'));var logger=require(_0x6b26('0x2'))('trigger');exports['exec']=function(_0x38adad,_0x551615){var _0x3685be=_0x38adad['data2']?_0x38adad[_0x6b26('0x3')]:'Script';var _0x184819=_0x38adad[_0x6b26('0x4')]?Mustache[_0x6b26('0x5')](_0x38adad[_0x6b26('0x4')],_0x551615):_0x551615;sh[_0x6b26('0x6')](_0x184819,function(_0x1c6def,_0x26a7a5,_0x29b60f){if(_0x1c6def!==0x0){logger[_0x6b26('0x7')](util['format'](_0x6b26('0x8'),_0x3685be,_0x184819,_0x1c6def,_0x29b60f));}else{logger[_0x6b26('0x9')](util[_0x6b26('0xa')](_0x6b26('0xb'),_0x3685be,_0x184819,_0x26a7a5));}});}; \ 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 35e51bf..21ce8e7 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 _0xd1ec=['isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','util','lodash','mustache','trigger','toUpperCase','render','data2','data5','number','headers','parse','data6','error','stack','data1','GET','DELETE','POST','PUT','data7','body','info','format','stringify','then'];(function(_0x1bde14,_0x1f9a91){var _0x4626a1=function(_0x37cd34){while(--_0x37cd34){_0x1bde14['push'](_0x1bde14['shift']());}};_0x4626a1(++_0x1f9a91);}(_0xd1ec,0x110));var _0xcd1e=function(_0x1374fa,_0x11ddf1){_0x1374fa=_0x1374fa-0x0;var _0x4a218b=_0xd1ec[_0x1374fa];return _0x4a218b;};'use strict';var rp=require('request-promise');var util=require(_0xcd1e('0x0'));var _=require(_0xcd1e('0x1'));var Mustache=require(_0xcd1e('0x2'));var logger=require('../../../../config/logger')(_0xcd1e('0x3'));exports['exec']=function(_0x25c71a,_0x3a309c){var _0x2b2d69,_0x196152;var _0x170801={'method':_0x25c71a['data1'][_0xcd1e('0x4')](),'uri':Mustache[_0xcd1e('0x5')](_0x25c71a[_0xcd1e('0x6')],_0x3a309c),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x25c71a[_0xcd1e('0x7')])===_0xcd1e('0x8')&&parseInt(_0x25c71a[_0xcd1e('0x7')])>=0x1&&parseInt(_0x25c71a[_0xcd1e('0x7')])<=0xa?parseInt(_0x25c71a[_0xcd1e('0x7')])*0x3e8:0x5*0x3e8};try{_0x170801[_0xcd1e('0x9')]=_0x25c71a['data6']?JSON[_0xcd1e('0xa')](Mustache[_0xcd1e('0x5')](_0x25c71a[_0xcd1e('0xb')],_0x3a309c)):{};}catch(_0x49c8bb){logger[_0xcd1e('0xc')](_0x49c8bb[_0xcd1e('0xd')]);}switch(_0x25c71a[_0xcd1e('0xe')]['toUpperCase']()){case _0xcd1e('0xf'):case _0xcd1e('0x10'):_0x2b2d69=null;_0x170801['qs']=_0x3a309c;break;case _0xcd1e('0x11'):case _0xcd1e('0x12'):if(_0x25c71a[_0xcd1e('0x13')]){try{_0x2b2d69=JSON['parse'](Mustache['render'](_0x25c71a[_0xcd1e('0x13')],_0x3a309c));_0x170801[_0xcd1e('0x14')]=_0x2b2d69;}catch(_0x1879a6){logger['error'](_0x1879a6[_0xcd1e('0xd')]);logger[_0xcd1e('0xc')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2b2d69=_0x3a309c;_0x170801[_0xcd1e('0x14')]=_0x2b2d69;}break;}logger[_0xcd1e('0x15')](util[_0xcd1e('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x25c71a[_0xcd1e('0xe')],_0x25c71a[_0xcd1e('0x6')],JSON[_0xcd1e('0x17')](_0x170801)));rp(_0x170801)[_0xcd1e('0x18')](function(_0x425e0d){_0x2b2d69=!_[_0xcd1e('0x19')](_0x2b2d69)?_0xcd1e('0x1a')+_0x2b2d69:'';_0x196152=typeof _0x425e0d['body']===_0xcd1e('0x1b')?JSON[_0xcd1e('0x17')](_0x425e0d['body']):_0x425e0d[_0xcd1e('0x14')];logger[_0xcd1e('0x15')](util['format'](_0xcd1e('0x1c'),_0x25c71a[_0xcd1e('0xe')],_0x25c71a['data2'],_0x425e0d['statusCode'],_0x196152));})['catch'](function(_0x23ac73){logger[_0xcd1e('0xc')](util[_0xcd1e('0x16')](_0xcd1e('0x1d'),_0x25c71a[_0xcd1e('0xe')],_0x25c71a['data2'],_0x23ac73[_0xcd1e('0x1e')],_0x23ac73[_0xcd1e('0x1f')],_0x23ac73[_0xcd1e('0x20')]));});}; \ No newline at end of file +var _0x71cb=['number','headers','parse','error','stack','GET','DELETE','POST','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x71cb,0x9f));var _0xb71c=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x71cb[_0x2bf141];return _0x48277b;};'use strict';var rp=require(_0xb71c('0x0'));var util=require(_0xb71c('0x1'));var _=require(_0xb71c('0x2'));var Mustache=require('mustache');var logger=require(_0xb71c('0x3'))(_0xb71c('0x4'));exports[_0xb71c('0x5')]=function(_0x2cf513,_0x20f855){var _0x5cdebb,_0x1568fa;var _0x5b7fdf={'method':_0x2cf513[_0xb71c('0x6')][_0xb71c('0x7')](),'uri':Mustache[_0xb71c('0x8')](_0x2cf513[_0xb71c('0x9')],_0x20f855),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2cf513[_0xb71c('0xa')])===_0xb71c('0xb')&&parseInt(_0x2cf513[_0xb71c('0xa')])>=0x1&&parseInt(_0x2cf513['data5'])<=0xa?parseInt(_0x2cf513[_0xb71c('0xa')])*0x3e8:0x5*0x3e8};try{_0x5b7fdf[_0xb71c('0xc')]=_0x2cf513['data6']?JSON[_0xb71c('0xd')](Mustache[_0xb71c('0x8')](_0x2cf513['data6'],_0x20f855)):{};}catch(_0x158eb0){logger[_0xb71c('0xe')](_0x158eb0[_0xb71c('0xf')]);}switch(_0x2cf513[_0xb71c('0x6')]['toUpperCase']()){case _0xb71c('0x10'):case _0xb71c('0x11'):_0x5cdebb=null;_0x5b7fdf['qs']=_0x20f855;break;case _0xb71c('0x12'):case'PUT':if(_0x2cf513['data7']){try{_0x5cdebb=JSON['parse'](Mustache[_0xb71c('0x8')](_0x2cf513[_0xb71c('0x13')],_0x20f855));_0x5b7fdf['body']=_0x5cdebb;}catch(_0x4949d8){logger[_0xb71c('0xe')](_0x4949d8[_0xb71c('0xf')]);logger[_0xb71c('0xe')](_0xb71c('0x14'));}}else{_0x5cdebb=_0x20f855;_0x5b7fdf[_0xb71c('0x15')]=_0x5cdebb;}break;}logger[_0xb71c('0x16')](util[_0xb71c('0x17')](_0xb71c('0x18'),_0x2cf513[_0xb71c('0x6')],_0x2cf513['data2'],JSON[_0xb71c('0x19')](_0x5b7fdf)));rp(_0x5b7fdf)[_0xb71c('0x1a')](function(_0x3e65bf){_0x5cdebb=!_['isNil'](_0x5cdebb)?',\x20request\x20body:\x20'+_0x5cdebb:'';_0x1568fa=typeof _0x3e65bf['body']===_0xb71c('0x1b')?JSON[_0xb71c('0x19')](_0x3e65bf[_0xb71c('0x15')]):_0x3e65bf[_0xb71c('0x15')];logger['info'](util[_0xb71c('0x17')](_0xb71c('0x1c'),_0x2cf513[_0xb71c('0x6')],_0x2cf513[_0xb71c('0x9')],_0x3e65bf[_0xb71c('0x1d')],_0x1568fa));})[_0xb71c('0x1e')](function(_0x2fad6f){logger[_0xb71c('0xe')](util['format'](_0xb71c('0x1f'),_0x2cf513[_0xb71c('0x6')],_0x2cf513[_0xb71c('0x9')],_0x2fad6f['statusCode'],_0x2fad6f[_0xb71c('0x20')],_0x2fad6f[_0xb71c('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 498260c..f5d5935 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 _0xe84b=['result','catch','exports','jayson/promise','../../config/logger','routing','client','Request','request','then','rpc','error','message'];(function(_0x3bb3d8,_0x2cd73c){var _0x2e50a3=function(_0x22f0c1){while(--_0x22f0c1){_0x3bb3d8['push'](_0x3bb3d8['shift']());}};_0x2e50a3(++_0x2cd73c);}(_0xe84b,0x1b0));var _0xbe84=function(_0x15ccae,_0xecc32a){_0x15ccae=_0x15ccae-0x0;var _0x186890=_0xe84b[_0x15ccae];return _0x186890;};'use strict';var jayson=require(_0xbe84('0x0'));var BPromise=require('bluebird');var logger=require(_0xbe84('0x1'))(_0xbe84('0x2'));var client=jayson[_0xbe84('0x3')]['http']({'port':0x2329});client[_0xbe84('0x4')]=function(_0x589383,_0x4ca0ff){return new BPromise(function(_0x205be1,_0x1d436d){return client[_0xbe84('0x5')](_0x589383,_0x4ca0ff)[_0xbe84('0x6')](function(_0x49cc42){logger['debug'](_0xbe84('0x7'),_0xbe84('0x2'),_0x589383,_0x4ca0ff,_0x49cc42);if(_0x49cc42[_0xbe84('0x8')]){logger['error'](_0xbe84('0x7'),_0xbe84('0x2'),_0x589383,_0x49cc42[_0xbe84('0x8')]['message'],_0x4ca0ff);return _0x1d436d(_0x49cc42[_0xbe84('0x8')][_0xbe84('0x9')]);}else{return _0x205be1(_0x49cc42[_0xbe84('0xa')]);}})[_0xbe84('0xb')](function(_0x2cc870){logger[_0xbe84('0x8')](_0xbe84('0x7'),_0xbe84('0x2'),_0x589383,_0x2cc870,_0x4ca0ff);return _0x1d436d(_0x2cc870);});});};module[_0xbe84('0xc')]=client; \ No newline at end of file +var _0x8741=['result','../../config/logger','client','http','Request','then','debug','routing','error','message'];(function(_0x139fd7,_0x332bea){var _0xb6e662=function(_0x2f077b){while(--_0x2f077b){_0x139fd7['push'](_0x139fd7['shift']());}};_0xb6e662(++_0x332bea);}(_0x8741,0x1af));var _0x1874=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8741[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1874('0x0'))('routing');var client=jayson[_0x1874('0x1')][_0x1874('0x2')]({'port':0x2329});client[_0x1874('0x3')]=function(_0x4150c6,_0xe34df7){return new BPromise(function(_0x3ac260,_0x174745){return client['request'](_0x4150c6,_0xe34df7)[_0x1874('0x4')](function(_0x66737a){logger[_0x1874('0x5')]('rpc',_0x1874('0x6'),_0x4150c6,_0xe34df7,_0x66737a);if(_0x66737a[_0x1874('0x7')]){logger[_0x1874('0x7')]('rpc',_0x1874('0x6'),_0x4150c6,_0x66737a[_0x1874('0x7')]['message'],_0xe34df7);return _0x174745(_0x66737a['error'][_0x1874('0x8')]);}else{return _0x3ac260(_0x66737a[_0x1874('0x9')]);}})['catch'](function(_0x276b8e){logger[_0x1874('0x7')]('rpc',_0x1874('0x6'),_0x4150c6,_0x276b8e,_0xe34df7);return _0x174745(_0x276b8e);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 3d6b6bf..0d3cede 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 _0x13db=['error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch'];(function(_0x560379,_0x991ccd){var _0x436d47=function(_0x1daed7){while(--_0x1daed7){_0x560379['push'](_0x560379['shift']());}};_0x436d47(++_0x991ccd);}(_0x13db,0x87));var _0xb13d=function(_0x318e32,_0x263c77){_0x318e32=_0x318e32-0x0;var _0x41538d=_0x13db[_0x318e32];return _0x41538d;};'use strict';var server=require(_0xb13d('0x0'));var Realtime=require(_0xb13d('0x1'));var EmailChannel=require(_0xb13d('0x2'));var mailAccount=require(_0xb13d('0x3'));var setting=require(_0xb13d('0x4'));var logger=require(_0xb13d('0x5'))(_0xb13d('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xb13d('0x7')]()[_0xb13d('0x8')](mailAccount[_0xb13d('0x9')]())[_0xb13d('0x8')](realtime[_0xb13d('0xa')]())[_0xb13d('0x8')](function(){email[_0xb13d('0xb')](realtime[_0xb13d('0xc')]);return realtime;});}function main(){return server[_0xb13d('0xd')](realtime,email)[_0xb13d('0x8')](function(){return initRealtime();})[_0xb13d('0x8')](function(){return setting[_0xb13d('0xe')]();})[_0xb13d('0x8')](function(_0x93c30d){return setInterval(initRealtime,_0x93c30d[_0xb13d('0xf')]*0x3e8);})[_0xb13d('0x10')](function(_0x54520e){logger[_0xb13d('0x11')](_0xb13d('0x12'),_0x54520e);});}main(); \ No newline at end of file +var _0xc14e=['./rpc/setting','email','resolve','getMailAccounts','then','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./realtime','./rpc/mailAccount'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0xc14e,0x156));var _0xec14=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc14e[_0x3dd15e];return _0x231fd0;};'use strict';var server=require(_0xec14('0x0'));var Realtime=require(_0xec14('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xec14('0x2'));var setting=require(_0xec14('0x3'));var logger=require('../../config/logger')(_0xec14('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xec14('0x5')]()['then'](mailAccount[_0xec14('0x6')]())[_0xec14('0x7')](realtime['initMailAccounts']())[_0xec14('0x7')](function(){email[_0xec14('0x8')](realtime[_0xec14('0x9')]);return realtime;});}function main(){return server[_0xec14('0xa')](realtime,email)['then'](function(){return initRealtime();})[_0xec14('0x7')](function(){return setting[_0xec14('0xb')]();})[_0xec14('0x7')](function(_0x113b93){return setInterval(initRealtime,_0x113b93[_0xec14('0xc')]*0x3e8);})[_0xec14('0xd')](function(_0x57bb30){logger['error'](_0xec14('0xe'),_0x57bb30);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 749c04c..91f8ddb 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 _0xce93=['mailAccounts','imapAccounts','smtp','prototype','emit','name','active','Imap','status','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','email','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','messageStatus','messages','firstName','lastName','notify','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','Smtp','verify','verified','catch','exports','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','redis','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info'];(function(_0xcc71ee,_0x22794e){var _0xb8517c=function(_0x156151){while(--_0x156151){_0xcc71ee['push'](_0xcc71ee['shift']());}};_0xb8517c(++_0x22794e);}(_0xce93,0x107));var _0x3ce9=function(_0x44b057,_0x4f87f2){_0x44b057=_0x44b057-0x0;var _0x440a12=_0xce93[_0x44b057];return _0x440a12;};'use strict';var _=require(_0x3ce9('0x0'));var moment=require(_0x3ce9('0x1'));var BPromise=require(_0x3ce9('0x2'));var md5=require('md5');var Redis=require(_0x3ce9('0x3'));var config=require(_0x3ce9('0x4'));var logger=require(_0x3ce9('0x5'))('email');config[_0x3ce9('0x6')]=_['defaults'](config[_0x3ce9('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x3ce9('0x7'))(new Redis(config[_0x3ce9('0x6')]));var EmailImap=require(_0x3ce9('0x8'));var EmailSmtp=require(_0x3ce9('0x9'));var mailAccount=require(_0x3ce9('0xa'));var md5Accounts={};function EmailChannel(_0x4d1f2f){logger[_0x3ce9('0xb')]('start\x20email\x20channel');this['mailAccounts']=_0x4d1f2f[_0x3ce9('0xc')];this[_0x3ce9('0xd')]={};this[_0x3ce9('0xe')]=new EmailSmtp();}EmailChannel[_0x3ce9('0xf')][_0x3ce9('0x10')]=function(_0xf97632){var _0x32d31f=this[_0x3ce9('0xc')][_0xf97632];var _0x41a94b={'id':_0x32d31f['id'],'name':_0x32d31f[_0x3ce9('0x11')],'key':_0x32d31f['key'],'active':_0x32d31f[_0x3ce9('0x12')],'Imap':{'status':_0x32d31f[_0x3ce9('0x13')][_0x3ce9('0x14')],'messageStatus':_0x32d31f[_0x3ce9('0x13')]['messageStatus'],'total':_0x32d31f['Imap'][_0x3ce9('0x15')]}};if(_[_0x3ce9('0x16')](md5Accounts[_0xf97632])){md5Accounts[_0xf97632]={};}var _0x14efcc=md5(JSON[_0x3ce9('0x17')](_0x41a94b));if(md5Accounts[_0xf97632][_0x3ce9('0x18')]!==_0x14efcc){md5Accounts[_0xf97632][_0x3ce9('0x18')]=_0x14efcc;io[_0x3ce9('0x10')](_0x3ce9('0x19'),_0x41a94b);}};EmailChannel[_0x3ce9('0xf')][_0x3ce9('0x1a')]=function(_0x6ba3f6){for(var _0x5cf083 in _0x6ba3f6){if(_0x6ba3f6[_0x3ce9('0x1b')](_0x5cf083)){if(_0x6ba3f6[_0x5cf083][_0x3ce9('0x13')]&&_0x6ba3f6[_0x5cf083][_0x3ce9('0x12')]){var _0x13fe3a=_0x6ba3f6[_0x5cf083][_0x3ce9('0x13')];if(!_0x13fe3a[_0x3ce9('0x1c')]&&_0x6ba3f6[_0x5cf083][_0x3ce9('0x1d')]!==_0x3ce9('0x1e'))_0x13fe3a[_0x3ce9('0x1c')]=_0x6ba3f6[_0x5cf083][_0x3ce9('0x1d')];if(!this['imapAccounts'][_0x3ce9('0x1b')](_0x13fe3a['id'])){this[_0x3ce9('0xd')][_0x13fe3a['id']]=new EmailImap(_0x13fe3a,_0x6ba3f6[_0x5cf083][_0x3ce9('0x1f')]);this['imapAccounts'][_0x13fe3a['id']]['on'](_0x3ce9('0x20'),this[_0x3ce9('0x21')][_0x3ce9('0x22')](this,_0x5cf083));this[_0x3ce9('0xd')][_0x13fe3a['id']]['on'](_0x3ce9('0x1f'),this[_0x3ce9('0x23')][_0x3ce9('0x22')](this,_0x5cf083));this[_0x3ce9('0xd')][_0x13fe3a['id']]['on'](_0x3ce9('0x24'),this[_0x3ce9('0x25')][_0x3ce9('0x22')](this,_0x5cf083));this['imapAccounts'][_0x13fe3a['id']]['on'](_0x3ce9('0x26'),this[_0x3ce9('0x27')][_0x3ce9('0x22')](this,_0x5cf083));}}else{if(_[_0x3ce9('0x16')](this[_0x3ce9('0xc')][_0x5cf083][_0x3ce9('0x13')])){this[_0x3ce9('0xc')][_0x5cf083][_0x3ce9('0x13')]={};}this[_0x3ce9('0xc')][_0x5cf083][_0x3ce9('0x13')][_0x3ce9('0x14')]=_0x3ce9('0x28');this[_0x3ce9('0xc')][_0x5cf083]['Imap'][_0x3ce9('0x29')]='';this[_0x3ce9('0x10')](_0x5cf083);}}}};EmailChannel[_0x3ce9('0xf')]['handleImapBox']=function(_0x471355,_0x151cb2){if(this[_0x3ce9('0xc')][_0x471355]){this['mailAccounts'][_0x471355]['Imap'][_0x3ce9('0x14')]='connected';this[_0x3ce9('0xc')][_0x471355][_0x3ce9('0x13')]['messageStatus']=_0x151cb2['name'];if(_0x151cb2[_0x3ce9('0x2a')]){this[_0x3ce9('0xc')][_0x471355][_0x3ce9('0x13')][_0x3ce9('0x15')]=_0x151cb2[_0x3ce9('0x2a')]['total'];}return this['emit'](_0x471355);}};EmailChannel['prototype'][_0x3ce9('0x23')]=function(_0x1fe34b,_0x14c492){logger[_0x3ce9('0xb')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x14c492[_0x3ce9('0x2b')],_0x14c492[_0x3ce9('0x2c')],_0x14c492['from'],_0x1fe34b);if(this['mailAccounts'][_0x1fe34b]){return mailAccount[_0x3ce9('0x2d')](_0x1fe34b,_0x14c492)['then'](function(_0x2b2247){if(_0x2b2247){logger[_0x3ce9('0xb')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x533eeb){logger[_0x3ce9('0x26')](_0x3ce9('0x2e'),JSON[_0x3ce9('0x17')](_0x533eeb));});}};EmailChannel[_0x3ce9('0xf')][_0x3ce9('0x25')]=function(_0x5714d8){if(this['mailAccounts'][_0x5714d8]&&this[_0x3ce9('0xc')][_0x5714d8]['Imap']){if(this['imapAccounts'][this[_0x3ce9('0xc')][_0x5714d8][_0x3ce9('0x13')]['id']]){delete this[_0x3ce9('0xd')][this[_0x3ce9('0xc')][_0x5714d8]['Imap']['id']];}this[_0x3ce9('0xc')][_0x5714d8][_0x3ce9('0x13')][_0x3ce9('0x2f')]=moment();this[_0x3ce9('0x10')](_0x5714d8);}};EmailChannel[_0x3ce9('0xf')]['handleImapError']=function(_0x1a700c,_0x8f5e74){if(this['mailAccounts'][_0x1a700c]){this['mailAccounts'][_0x1a700c][_0x3ce9('0x13')][_0x3ce9('0x14')]=_0x3ce9('0x26');this[_0x3ce9('0xc')][_0x1a700c]['Imap']['messageStatus']=_0x8f5e74;return this['emit'](_0x1a700c);}};EmailChannel['prototype'][_0x3ce9('0x30')]=function(_0x12956c,_0x3de84c){return this[_0x3ce9('0xe')][_0x3ce9('0x31')](_0x12956c,_0x3de84c);};EmailChannel[_0x3ce9('0xf')]['verifySmtp']=function(_0x372431){var _0x3849ea=this;if(this[_0x3ce9('0xc')][_0x372431['id']]){if(_[_0x3ce9('0x16')](this[_0x3ce9('0xc')][_0x372431['id']][_0x3ce9('0x32')])){this['mailAccounts'][_0x372431['id']][_0x3ce9('0x32')]={};}this['mailAccounts'][_0x372431['id']][_0x3ce9('0x32')]['lastSync']=moment();return new BPromise(function(_0x59371c,_0x5ba8f7){return _0x3849ea[_0x3ce9('0xe')][_0x3ce9('0x33')](_0x372431)['then'](function(_0x53fd8c){_0x3849ea[_0x3ce9('0xc')][_0x372431['id']][_0x3ce9('0x32')][_0x3ce9('0x14')]=_0x3ce9('0x34');_0x3849ea['mailAccounts'][_0x372431['id']][_0x3ce9('0x32')]['messageStatus']='';_0x3849ea[_0x3ce9('0x10')](_0x372431['id']);_0x59371c(_0x53fd8c);})[_0x3ce9('0x35')](function(_0x25fd81){_0x3849ea[_0x3ce9('0xc')][_0x372431['id']][_0x3ce9('0x32')][_0x3ce9('0x14')]='error';_0x3849ea[_0x3ce9('0xc')][_0x372431['id']][_0x3ce9('0x32')][_0x3ce9('0x29')]=_0x25fd81;_0x3849ea['emit'](_0x372431['id']);_0x5ba8f7(_0x25fd81);});});}return this[_0x3ce9('0xe')][_0x3ce9('0x33')](_0x372431);};module[_0x3ce9('0x36')]=EmailChannel; \ No newline at end of file +var _0xa935=['Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','service','provider','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','messages','firstName','notify','then','Mail\x20accepted\x20from\x20routing'];(function(_0x5148d6,_0x40c47c){var _0x3033a5=function(_0xc0f67d){while(--_0xc0f67d){_0x5148d6['push'](_0x5148d6['shift']());}};_0x3033a5(++_0x40c47c);}(_0xa935,0x158));var _0x5a93=function(_0x493030,_0x29ec7e){_0x493030=_0x493030-0x0;var _0x56f5e4=_0xa935[_0x493030];return _0x56f5e4;};'use strict';var _=require(_0x5a93('0x0'));var moment=require(_0x5a93('0x1'));var BPromise=require(_0x5a93('0x2'));var md5=require('md5');var Redis=require(_0x5a93('0x3'));var config=require(_0x5a93('0x4'));var logger=require(_0x5a93('0x5'))(_0x5a93('0x6'));config[_0x5a93('0x7')]=_[_0x5a93('0x8')](config[_0x5a93('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5a93('0x9'))(new Redis(config['redis']));var EmailImap=require(_0x5a93('0xa'));var EmailSmtp=require(_0x5a93('0xb'));var mailAccount=require(_0x5a93('0xc'));var md5Accounts={};function EmailChannel(_0x195ab6){logger[_0x5a93('0xd')](_0x5a93('0xe'));this[_0x5a93('0xf')]=_0x195ab6[_0x5a93('0xf')];this[_0x5a93('0x10')]={};this[_0x5a93('0x11')]=new EmailSmtp();}EmailChannel[_0x5a93('0x12')][_0x5a93('0x13')]=function(_0x411132){var _0x2de4c3=this[_0x5a93('0xf')][_0x411132];var _0x308f62={'id':_0x2de4c3['id'],'name':_0x2de4c3[_0x5a93('0x14')],'key':_0x2de4c3[_0x5a93('0x15')],'active':_0x2de4c3[_0x5a93('0x16')],'Imap':{'status':_0x2de4c3[_0x5a93('0x17')][_0x5a93('0x18')],'messageStatus':_0x2de4c3[_0x5a93('0x17')][_0x5a93('0x19')],'total':_0x2de4c3[_0x5a93('0x17')][_0x5a93('0x1a')]}};if(_[_0x5a93('0x1b')](md5Accounts[_0x411132])){md5Accounts[_0x411132]={};}var _0x1c25d7=md5(JSON[_0x5a93('0x1c')](_0x308f62));if(md5Accounts[_0x411132]['md5']!==_0x1c25d7){md5Accounts[_0x411132][_0x5a93('0x1d')]=_0x1c25d7;io[_0x5a93('0x13')](_0x5a93('0x1e'),_0x308f62);}};EmailChannel[_0x5a93('0x12')][_0x5a93('0x1f')]=function(_0x3b54f){for(var _0x43117f in _0x3b54f){if(_0x3b54f[_0x5a93('0x20')](_0x43117f)){if(_0x3b54f[_0x43117f][_0x5a93('0x17')]&&_0x3b54f[_0x43117f]['active']){var _0x26e362=_0x3b54f[_0x43117f]['Imap'];if(!_0x26e362[_0x5a93('0x21')]&&_0x3b54f[_0x43117f][_0x5a93('0x22')]!=='custom')_0x26e362[_0x5a93('0x21')]=_0x3b54f[_0x43117f][_0x5a93('0x22')];if(!this[_0x5a93('0x10')][_0x5a93('0x20')](_0x26e362['id'])){this[_0x5a93('0x10')][_0x26e362['id']]=new EmailImap(_0x26e362,_0x3b54f[_0x43117f]['email']);this[_0x5a93('0x10')][_0x26e362['id']]['on'](_0x5a93('0x23'),this[_0x5a93('0x24')][_0x5a93('0x25')](this,_0x43117f));this['imapAccounts'][_0x26e362['id']]['on'](_0x5a93('0x6'),this[_0x5a93('0x26')][_0x5a93('0x25')](this,_0x43117f));this['imapAccounts'][_0x26e362['id']]['on'](_0x5a93('0x27'),this[_0x5a93('0x28')][_0x5a93('0x25')](this,_0x43117f));this['imapAccounts'][_0x26e362['id']]['on'](_0x5a93('0x29'),this[_0x5a93('0x2a')][_0x5a93('0x25')](this,_0x43117f));}}else{if(_[_0x5a93('0x1b')](this[_0x5a93('0xf')][_0x43117f][_0x5a93('0x17')])){this[_0x5a93('0xf')][_0x43117f]['Imap']={};}this[_0x5a93('0xf')][_0x43117f][_0x5a93('0x17')][_0x5a93('0x18')]='disabled';this['mailAccounts'][_0x43117f][_0x5a93('0x17')][_0x5a93('0x19')]='';this[_0x5a93('0x13')](_0x43117f);}}}};EmailChannel[_0x5a93('0x12')][_0x5a93('0x24')]=function(_0x4fa0aa,_0x2ea171){if(this[_0x5a93('0xf')][_0x4fa0aa]){this['mailAccounts'][_0x4fa0aa][_0x5a93('0x17')][_0x5a93('0x18')]='connected';this['mailAccounts'][_0x4fa0aa][_0x5a93('0x17')][_0x5a93('0x19')]=_0x2ea171[_0x5a93('0x14')];if(_0x2ea171[_0x5a93('0x2b')]){this[_0x5a93('0xf')][_0x4fa0aa][_0x5a93('0x17')][_0x5a93('0x1a')]=_0x2ea171['messages'][_0x5a93('0x1a')];}return this[_0x5a93('0x13')](_0x4fa0aa);}};EmailChannel[_0x5a93('0x12')]['handleImapEmail']=function(_0x4047b3,_0x5197c9){logger[_0x5a93('0xd')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x5197c9[_0x5a93('0x2c')],_0x5197c9['lastName'],_0x5197c9['from'],_0x4047b3);if(this[_0x5a93('0xf')][_0x4047b3]){return mailAccount[_0x5a93('0x2d')](_0x4047b3,_0x5197c9)[_0x5a93('0x2e')](function(_0xfe31ff){if(_0xfe31ff){logger['info'](_0x5a93('0x2f'));}})['catch'](function(_0x37486e){logger[_0x5a93('0x29')](_0x5a93('0x30'),JSON[_0x5a93('0x1c')](_0x37486e));});}};EmailChannel['prototype'][_0x5a93('0x28')]=function(_0x21bc9c){if(this[_0x5a93('0xf')][_0x21bc9c]&&this[_0x5a93('0xf')][_0x21bc9c][_0x5a93('0x17')]){if(this[_0x5a93('0x10')][this[_0x5a93('0xf')][_0x21bc9c]['Imap']['id']]){delete this[_0x5a93('0x10')][this[_0x5a93('0xf')][_0x21bc9c][_0x5a93('0x17')]['id']];}this['mailAccounts'][_0x21bc9c][_0x5a93('0x17')][_0x5a93('0x31')]=moment();this[_0x5a93('0x13')](_0x21bc9c);}};EmailChannel[_0x5a93('0x12')][_0x5a93('0x2a')]=function(_0xc2156c,_0x198a32){if(this['mailAccounts'][_0xc2156c]){this[_0x5a93('0xf')][_0xc2156c][_0x5a93('0x17')]['status']=_0x5a93('0x29');this[_0x5a93('0xf')][_0xc2156c][_0x5a93('0x17')][_0x5a93('0x19')]=_0x198a32;return this[_0x5a93('0x13')](_0xc2156c);}};EmailChannel['prototype'][_0x5a93('0x32')]=function(_0x3a7c6a,_0x29b3a2){return this['smtp'][_0x5a93('0x33')](_0x3a7c6a,_0x29b3a2);};EmailChannel[_0x5a93('0x12')][_0x5a93('0x34')]=function(_0x47c4fd){var _0x349ebc=this;if(this[_0x5a93('0xf')][_0x47c4fd['id']]){if(_[_0x5a93('0x1b')](this['mailAccounts'][_0x47c4fd['id']][_0x5a93('0x35')])){this[_0x5a93('0xf')][_0x47c4fd['id']][_0x5a93('0x35')]={};}this[_0x5a93('0xf')][_0x47c4fd['id']]['Smtp'][_0x5a93('0x31')]=moment();return new BPromise(function(_0x5a1e7b,_0x572871){return _0x349ebc[_0x5a93('0x11')][_0x5a93('0x36')](_0x47c4fd)[_0x5a93('0x2e')](function(_0x5c0d35){_0x349ebc[_0x5a93('0xf')][_0x47c4fd['id']][_0x5a93('0x35')]['status']='verified';_0x349ebc[_0x5a93('0xf')][_0x47c4fd['id']][_0x5a93('0x35')][_0x5a93('0x19')]='';_0x349ebc['emit'](_0x47c4fd['id']);_0x5a1e7b(_0x5c0d35);})['catch'](function(_0x124ccb){_0x349ebc[_0x5a93('0xf')][_0x47c4fd['id']][_0x5a93('0x35')][_0x5a93('0x18')]=_0x5a93('0x29');_0x349ebc[_0x5a93('0xf')][_0x47c4fd['id']][_0x5a93('0x35')]['messageStatus']=_0x124ccb;_0x349ebc['emit'](_0x47c4fd['id']);_0x572871(_0x124ccb);});});}return this[_0x5a93('0x11')]['verify'](_0x47c4fd);};module[_0x5a93('0x37')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 0940b20..fd783f0 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 _0x33af=['service','user','password','host','port','tls','autotls','required','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','getHost','anonymous@xcally.com','prototype','openBox','emit','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','stringify','textCode','hasOwnProperty','exports','util','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','once','ready','handleReady','bind','handleEnd','error','handleError','connect','connTimeout','authTimeout'];(function(_0x216b9b,_0x1bf025){var _0x51ba89=function(_0x5bab61){while(--_0x5bab61){_0x216b9b['push'](_0x216b9b['shift']());}};_0x51ba89(++_0x1bf025);}(_0x33af,0xec));var _0xf33a=function(_0x19cce8,_0x23a814){_0x19cce8=_0x19cce8-0x0;var _0x575f93=_0x33af[_0x19cce8];return _0x575f93;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var Imap=require('imap');var simpleParser=require(_0xf33a('0x1'))[_0xf33a('0x2')];var Iconv=require(_0xf33a('0x3'))[_0xf33a('0x4')];var EventEmitter=require(_0xf33a('0x5'))[_0xf33a('0x6')];var utils=require('./utils');var logger=require(_0xf33a('0x7'))(_0xf33a('0x8'));function EmailImap(_0x583e54,_0xc0dd13){this[_0xf33a('0x9')]=_0xf33a('0xa');this[_0xf33a('0xb')]=this[_0xf33a('0xc')](_0x583e54,_0xc0dd13);this[_0xf33a('0xd')]=new Imap(this['account']);this[_0xf33a('0xd')][_0xf33a('0xe')](_0xf33a('0xf'),this[_0xf33a('0x10')][_0xf33a('0x11')](this));this[_0xf33a('0xd')]['once']('end',this[_0xf33a('0x12')][_0xf33a('0x11')](this));this[_0xf33a('0xd')]['on'](_0xf33a('0x13'),this[_0xf33a('0x14')]['bind'](this));this[_0xf33a('0xd')][_0xf33a('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0xf33a('0xc')]=function(_0x1b3bf0,_0x17043){var _0x153bda={'connTimeout':_0x1b3bf0[_0xf33a('0x16')]?_0x1b3bf0[_0xf33a('0x16')]*0x3e8:0x2710,'authTimeout':_0x1b3bf0[_0xf33a('0x17')]?_0x1b3bf0[_0xf33a('0x17')]*0x3e8:0x1388};if(_['isNil'](_0x1b3bf0[_0xf33a('0x18')])){if(_0x1b3bf0['authentication']){_0x153bda[_0xf33a('0x19')]=_0x1b3bf0[_0xf33a('0x19')];_0x153bda['password']=_0x1b3bf0[_0xf33a('0x1a')];}_0x153bda[_0xf33a('0x1b')]=_0x1b3bf0['host'];_0x153bda[_0xf33a('0x1c')]=_0x1b3bf0[_0xf33a('0x1c')]||0x3e1;if(_0x1b3bf0[_0xf33a('0x1d')]){_0x153bda[_0xf33a('0x1d')]=!![];}else{_0x153bda['tls']=![];_0x153bda[_0xf33a('0x1e')]=_0xf33a('0x1f');}}else{if(_0x1b3bf0[_0xf33a('0x20')]){_0x153bda[_0xf33a('0x21')]=utils[_0xf33a('0x22')](_0x1b3bf0[_0xf33a('0x23')][_0xf33a('0x24')],_0x1b3bf0[_0xf33a('0x19')]);_0x153bda[_0xf33a('0x19')]=_0x1b3bf0[_0xf33a('0x19')];}else{_0x153bda['user']=_0x1b3bf0[_0xf33a('0x19')];_0x153bda[_0xf33a('0x1a')]=_0x1b3bf0[_0xf33a('0x1a')];}_0x153bda[_0xf33a('0x1b')]=utils[_0xf33a('0x25')](_0x1b3bf0['service']);_0x153bda[_0xf33a('0x1c')]=0x3e1;_0x153bda['tls']=!![];}_0x153bda[_0xf33a('0x8')]=_0x17043||_0x1b3bf0[_0xf33a('0x19')]||_0xf33a('0x26');return _0x153bda;};EmailImap[_0xf33a('0x27')][_0xf33a('0x10')]=function(){this['imap'][_0xf33a('0x28')](this[_0xf33a('0x9')],![],this['handleOpenBox']['bind'](this));};EmailImap[_0xf33a('0x27')]['handleOpenBox']=function(_0x5cf981,_0x38eba2){if(_0x5cf981){this['handleError'](_0x5cf981,!![]);}else{this[_0xf33a('0x29')]('box',_0x38eba2);this[_0xf33a('0x2a')]();}};EmailImap[_0xf33a('0x27')][_0xf33a('0x2b')]=function(_0x729fca){if(_0x729fca){this[_0xf33a('0x14')](_0x729fca,!![]);}else{this[_0xf33a('0xd')][_0xf33a('0x2c')]();}};EmailImap[_0xf33a('0x27')][_0xf33a('0x2a')]=function(){this[_0xf33a('0xd')][_0xf33a('0x2d')]([_0xf33a('0x2e')],this[_0xf33a('0x2f')][_0xf33a('0x11')](this));};EmailImap[_0xf33a('0x27')]['handleReadUnseen']=function(_0x627fd2,_0x293cb5){if(_0x627fd2){this[_0xf33a('0x14')](_0x627fd2,!![]);}else{if(_0x293cb5[_0xf33a('0x30')]){try{var _0x4ee492=this[_0xf33a('0xd')][_0xf33a('0x31')](_0x293cb5,{'bodies':'','markSeen':!![]});_0x4ee492['on'](_0xf33a('0x32'),this[_0xf33a('0x33')][_0xf33a('0x11')](this));_0x4ee492[_0xf33a('0xe')]('error',this[_0xf33a('0x34')][_0xf33a('0x11')](this));_0x4ee492[_0xf33a('0xe')](_0xf33a('0x2c'),this[_0xf33a('0x35')]['bind'](this));}catch(_0x578998){logger[_0xf33a('0x13')](_0x578998);}}else{this['imap']['closeBox'](!![],this['handleCloseBox'][_0xf33a('0x11')](this));}}};EmailImap[_0xf33a('0x27')]['handleFetchMessage']=function(_0x21f250){_0x21f250['on']('body',this[_0xf33a('0x36')][_0xf33a('0x11')](this));_0x21f250[_0xf33a('0xe')](_0xf33a('0x37'),this[_0xf33a('0x38')][_0xf33a('0x11')](this));_0x21f250['once'](_0xf33a('0x2c'),this[_0xf33a('0x39')]['bind'](this));};EmailImap[_0xf33a('0x27')][_0xf33a('0x36')]=function(_0x3e0a98){simpleParser(_0x3e0a98,{'Iconv':Iconv},this['handleSimpleParser'][_0xf33a('0x11')](this));};EmailImap[_0xf33a('0x27')][_0xf33a('0x38')]=function(){};EmailImap[_0xf33a('0x27')][_0xf33a('0x39')]=function(){};EmailImap[_0xf33a('0x27')][_0xf33a('0x3a')]=function(_0x128baf,_0xd488ef){if(_0x128baf){logger['error'](_0x128baf);}else{var _0x31028b=this;utils[_0xf33a('0x3b')](this['account'],_0xd488ef,function(_0x1e8800){_0x31028b['emit']('email',_0x1e8800);});}};EmailImap[_0xf33a('0x27')][_0xf33a('0x35')]=function(){this['imap'][_0xf33a('0x3c')](!![],this[_0xf33a('0x2b')][_0xf33a('0x11')](this));};EmailImap['prototype'][_0xf33a('0x34')]=function(_0x21b8da){this['handleError'](_0x21b8da);this[_0xf33a('0xd')][_0xf33a('0x3c')](!![],this[_0xf33a('0x2b')][_0xf33a('0x11')](this));};EmailImap[_0xf33a('0x27')]['handleEnd']=function(){this[_0xf33a('0x29')](_0xf33a('0x2c'));};EmailImap[_0xf33a('0x27')][_0xf33a('0x14')]=function(_0x253f21,_0x5ef2b8){logger[_0xf33a('0x13')](_0xf33a('0x14'),this[_0xf33a('0xb')]['email'],JSON[_0xf33a('0x3d')](_0x253f21));var _0x43889e='';if(_0x253f21){if(_0x253f21[_0xf33a('0x3e')]){_0x43889e=_0x253f21[_0xf33a('0x3e')];}else{for(var _0x2e36f2 in _0x253f21){if(_0x253f21[_0xf33a('0x3f')](_0x2e36f2)){_0x43889e+=_['upperFirst'](_0x2e36f2)+':\x20'+_0x253f21[_0x2e36f2]+'\x0a';}}}}if(_0x5ef2b8){this[_0xf33a('0xd')][_0xf33a('0x2c')]();}else{this[_0xf33a('0x29')](_0xf33a('0x13'),_0x43889e);this[_0xf33a('0x29')]('end');}};module[_0xf33a('0x40')]=EmailImap; \ No newline at end of file +var _0x1623=['bind','error','handleError','connect','prototype','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','modernAuthentication','CloudProvider','data5','getHost','email','anonymous@xcally.com','handleReady','openBox','mailbox','handleOpenBox','box','readUnseen','search','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','emit','closeBox','textCode','hasOwnProperty','upperFirst','exports','lodash','mailparser','simpleParser','iconv','Iconv','events','../../../config/logger','INBOX','account','getAccount','imap','once','ready','end','handleEnd'];(function(_0x4e6fb2,_0x3cf23e){var _0x2f1636=function(_0x53c7eb){while(--_0x53c7eb){_0x4e6fb2['push'](_0x4e6fb2['shift']());}};_0x2f1636(++_0x3cf23e);}(_0x1623,0xab));var _0x3162=function(_0xa66bc0,_0x3dd273){_0xa66bc0=_0xa66bc0-0x0;var _0x28f754=_0x1623[_0xa66bc0];return _0x28f754;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var Imap=require('imap');var simpleParser=require(_0x3162('0x1'))[_0x3162('0x2')];var Iconv=require(_0x3162('0x3'))[_0x3162('0x4')];var EventEmitter=require(_0x3162('0x5'))['EventEmitter'];var utils=require('./utils');var logger=require(_0x3162('0x6'))('email');function EmailImap(_0x1b55f2,_0x428de6){this['mailbox']=_0x3162('0x7');this[_0x3162('0x8')]=this[_0x3162('0x9')](_0x1b55f2,_0x428de6);this[_0x3162('0xa')]=new Imap(this[_0x3162('0x8')]);this[_0x3162('0xa')][_0x3162('0xb')](_0x3162('0xc'),this['handleReady']['bind'](this));this[_0x3162('0xa')][_0x3162('0xb')](_0x3162('0xd'),this[_0x3162('0xe')][_0x3162('0xf')](this));this[_0x3162('0xa')]['on'](_0x3162('0x10'),this[_0x3162('0x11')][_0x3162('0xf')](this));this['imap'][_0x3162('0x12')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x3162('0x13')][_0x3162('0x9')]=function(_0x49d1ad,_0x4a393a){var _0x198764={'connTimeout':_0x49d1ad[_0x3162('0x14')]?_0x49d1ad[_0x3162('0x14')]*0x3e8:0x2710,'authTimeout':_0x49d1ad['authTimeout']?_0x49d1ad[_0x3162('0x15')]*0x3e8:0x1388};if(_[_0x3162('0x16')](_0x49d1ad[_0x3162('0x17')])){if(_0x49d1ad['authentication']){_0x198764[_0x3162('0x18')]=_0x49d1ad[_0x3162('0x18')];_0x198764[_0x3162('0x19')]=_0x49d1ad[_0x3162('0x19')];}_0x198764[_0x3162('0x1a')]=_0x49d1ad[_0x3162('0x1a')];_0x198764[_0x3162('0x1b')]=_0x49d1ad['port']||0x3e1;if(_0x49d1ad[_0x3162('0x1c')]){_0x198764[_0x3162('0x1c')]=!![];}else{_0x198764[_0x3162('0x1c')]=![];_0x198764[_0x3162('0x1d')]='required';}}else{if(_0x49d1ad[_0x3162('0x1e')]){_0x198764['xoauth2']=utils['generateXOAuth2Token'](_0x49d1ad[_0x3162('0x1f')][_0x3162('0x20')],_0x49d1ad[_0x3162('0x18')]);_0x198764['user']=_0x49d1ad['user'];}else{_0x198764[_0x3162('0x18')]=_0x49d1ad[_0x3162('0x18')];_0x198764[_0x3162('0x19')]=_0x49d1ad[_0x3162('0x19')];}_0x198764[_0x3162('0x1a')]=utils[_0x3162('0x21')](_0x49d1ad[_0x3162('0x17')]);_0x198764[_0x3162('0x1b')]=0x3e1;_0x198764['tls']=!![];}_0x198764[_0x3162('0x22')]=_0x4a393a||_0x49d1ad[_0x3162('0x18')]||_0x3162('0x23');return _0x198764;};EmailImap[_0x3162('0x13')][_0x3162('0x24')]=function(){this[_0x3162('0xa')][_0x3162('0x25')](this[_0x3162('0x26')],![],this[_0x3162('0x27')][_0x3162('0xf')](this));};EmailImap[_0x3162('0x13')][_0x3162('0x27')]=function(_0x1c03a4,_0x48de45){if(_0x1c03a4){this[_0x3162('0x11')](_0x1c03a4,!![]);}else{this['emit'](_0x3162('0x28'),_0x48de45);this[_0x3162('0x29')]();}};EmailImap[_0x3162('0x13')]['handleCloseBox']=function(_0x4903e7){if(_0x4903e7){this[_0x3162('0x11')](_0x4903e7,!![]);}else{this[_0x3162('0xa')][_0x3162('0xd')]();}};EmailImap[_0x3162('0x13')][_0x3162('0x29')]=function(){this['imap'][_0x3162('0x2a')](['UNSEEN'],this[_0x3162('0x2b')][_0x3162('0xf')](this));};EmailImap[_0x3162('0x13')][_0x3162('0x2b')]=function(_0x118dab,_0x18b9f2){if(_0x118dab){this[_0x3162('0x11')](_0x118dab,!![]);}else{if(_0x18b9f2[_0x3162('0x2c')]){try{var _0x549ffe=this[_0x3162('0xa')][_0x3162('0x2d')](_0x18b9f2,{'bodies':'','markSeen':!![]});_0x549ffe['on']('message',this[_0x3162('0x2e')][_0x3162('0xf')](this));_0x549ffe['once']('error',this[_0x3162('0x2f')]['bind'](this));_0x549ffe[_0x3162('0xb')](_0x3162('0xd'),this[_0x3162('0x30')]['bind'](this));}catch(_0x548f7f){logger[_0x3162('0x10')](_0x548f7f);}}else{this[_0x3162('0xa')]['closeBox'](!![],this[_0x3162('0x31')]['bind'](this));}}};EmailImap[_0x3162('0x13')][_0x3162('0x2e')]=function(_0x339be2){_0x339be2['on'](_0x3162('0x32'),this[_0x3162('0x33')][_0x3162('0xf')](this));_0x339be2[_0x3162('0xb')](_0x3162('0x34'),this[_0x3162('0x35')][_0x3162('0xf')](this));_0x339be2[_0x3162('0xb')]('end',this[_0x3162('0x36')][_0x3162('0xf')](this));};EmailImap[_0x3162('0x13')]['handleMessageBody']=function(_0x59759d){simpleParser(_0x59759d,{'Iconv':Iconv},this[_0x3162('0x37')][_0x3162('0xf')](this));};EmailImap[_0x3162('0x13')][_0x3162('0x35')]=function(){};EmailImap['prototype'][_0x3162('0x36')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x5dee49,_0x298ed7){if(_0x5dee49){logger[_0x3162('0x10')](_0x5dee49);}else{var _0x315fdb=this;utils['parser'](this[_0x3162('0x8')],_0x298ed7,function(_0x2ce9c6){_0x315fdb[_0x3162('0x38')](_0x3162('0x22'),_0x2ce9c6);});}};EmailImap[_0x3162('0x13')]['handleFetchEnd']=function(){this['imap'][_0x3162('0x39')](!![],this[_0x3162('0x31')]['bind'](this));};EmailImap['prototype'][_0x3162('0x2f')]=function(_0x32c960){this[_0x3162('0x11')](_0x32c960);this['imap'][_0x3162('0x39')](!![],this[_0x3162('0x31')][_0x3162('0xf')](this));};EmailImap[_0x3162('0x13')]['handleEnd']=function(){this[_0x3162('0x38')](_0x3162('0xd'));};EmailImap['prototype'][_0x3162('0x11')]=function(_0x337352,_0x500e6b){logger[_0x3162('0x10')](_0x3162('0x11'),this['account'][_0x3162('0x22')],JSON['stringify'](_0x337352));var _0x4146f1='';if(_0x337352){if(_0x337352[_0x3162('0x3a')]){_0x4146f1=_0x337352[_0x3162('0x3a')];}else{for(var _0x262f9d in _0x337352){if(_0x337352[_0x3162('0x3b')](_0x262f9d)){_0x4146f1+=_[_0x3162('0x3c')](_0x262f9d)+':\x20'+_0x337352[_0x262f9d]+'\x0a';}}}}if(_0x500e6b){this['imap'][_0x3162('0xd')]();}else{this[_0x3162('0x38')](_0x3162('0x10'),_0x4146f1);this['emit'](_0x3162('0xd'));}};module[_0x3162('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 b2c4659..d5d59f5 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 _0xe2c9=['verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','sendMail','toString'];(function(_0x503bc0,_0x12aeee){var _0x383246=function(_0x298a3d){while(--_0x298a3d){_0x503bc0['push'](_0x503bc0['shift']());}};_0x383246(++_0x12aeee);}(_0xe2c9,0x18f));var _0x9e2c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe2c9[_0x3947c9];return _0x2e7871;};'use strict';var nodemailer=require(_0x9e2c('0x0'));var inlineBase64=require(_0x9e2c('0x1'));function EmailSmtp(){}EmailSmtp[_0x9e2c('0x2')][_0x9e2c('0x3')]=function(_0x1d83be,_0x267498){return new Promise(function(_0x375be6,_0x4282d4){var _0x3b7718=nodemailer['createTransport'](_0x1d83be);_0x3b7718['use']('compile',inlineBase64());_0x3b7718[_0x9e2c('0x4')](_0x267498,function(_0x353568,_0x497652){if(_0x353568){_0x4282d4(_0x353568[_0x9e2c('0x5')]());}else{_0x375be6(_0x497652);}});});};EmailSmtp['prototype']['verify']=function(_0x20b6f2){return new Promise(function(_0x2171cd,_0x4d5f6b){var _0xcfd511=nodemailer['createTransport'](_0x20b6f2);_0xcfd511[_0x9e2c('0x6')](function(_0x864103,_0x4790be){if(_0x864103){_0x4d5f6b(_0x864103[_0x9e2c('0x5')]());}else{if(_0x4790be){_0x2171cd(_0x4790be);}else{_0x4d5f6b(_0x9e2c('0x7'));}}});});};module[_0x9e2c('0x8')]=EmailSmtp; \ No newline at end of file +var _0x09a8=['nodemailer','nodemailer-plugin-inline-base64','prototype','use','compile','sendMail','verify','createTransport','toString','Not\x20verifired','exports'];(function(_0x341ed9,_0x510ecf){var _0x5acfd5=function(_0x4532a3){while(--_0x4532a3){_0x341ed9['push'](_0x341ed9['shift']());}};_0x5acfd5(++_0x510ecf);}(_0x09a8,0xd1));var _0x809a=function(_0x210788,_0x3180a4){_0x210788=_0x210788-0x0;var _0x5ef908=_0x09a8[_0x210788];return _0x5ef908;};'use strict';var nodemailer=require(_0x809a('0x0'));var inlineBase64=require(_0x809a('0x1'));function EmailSmtp(){}EmailSmtp[_0x809a('0x2')]['send']=function(_0x14d2dc,_0x205afb){return new Promise(function(_0x654291,_0x6268){var _0x215f74=nodemailer['createTransport'](_0x14d2dc);_0x215f74[_0x809a('0x3')](_0x809a('0x4'),inlineBase64());_0x215f74[_0x809a('0x5')](_0x205afb,function(_0x1b9c41,_0x4a0bcf){if(_0x1b9c41){_0x6268(_0x1b9c41['toString']());}else{_0x654291(_0x4a0bcf);}});});};EmailSmtp[_0x809a('0x2')][_0x809a('0x6')]=function(_0x268080){return new Promise(function(_0x4d3eba,_0x39ca54){var _0x2f11cd=nodemailer[_0x809a('0x7')](_0x268080);_0x2f11cd[_0x809a('0x6')](function(_0xe113a1,_0x1cb442){if(_0xe113a1){_0x39ca54(_0xe113a1[_0x809a('0x8')]());}else{if(_0x1cb442){_0x4d3eba(_0x1cb442);}else{_0x39ca54(_0x809a('0x9'));}}});});};module[_0x809a('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index a65d109..61a281a 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 _0xdebc=['user=','auth=Bearer\x20','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','slice','Anonymous','split','length','isEmpty','html','test','replace','includes','','body','textAsHtml','message','originTo','originCc','bcc','attachments','attach','type','attachment','filename','%s-%s','now','join','root','server/files/attachments/','content','contentType','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','isAutoreply','parser','from','subject','inReplyTo','date','application/ms-tnef','info','format','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook.office365.com','127.0.0.1'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xdebc,0xf7));var _0xcdeb=function(_0x310cd6,_0x1001bc){_0x310cd6=_0x310cd6-0x0;var _0x575b75=_0xdebc[_0x310cd6];return _0x575b75;};'use strict';var _=require(_0xcdeb('0x0'));var moment=require(_0xcdeb('0x1'));var random=require(_0xcdeb('0x2'));var fs=require('fs');var path=require(_0xcdeb('0x3'));var util=require(_0xcdeb('0x4'));var tnef=require(_0xcdeb('0x5'));var logger=require(_0xcdeb('0x6'))(_0xcdeb('0x7'));var config=require(_0xcdeb('0x8'));function getAddress(_0x4419fc){var _0x3e2da7=_[_0xcdeb('0x9')](_0x4419fc[_0xcdeb('0xa')]);return _0x3e2da7&&_0x3e2da7[_0xcdeb('0xb')]?_0x3e2da7[_0xcdeb('0xb')]:_0xcdeb('0xc')+random[_0xcdeb('0xd')](0x6)+_0xcdeb('0xe');}function getFirstName(_0x36169f){var _0xf34eb3=_[_0xcdeb('0x9')](_0x36169f['value']);if(_0xf34eb3&&_0xf34eb3[_0xcdeb('0xf')]){if(_0xf34eb3['name']==_0xf34eb3[_0xcdeb('0xb')]){return _0xf34eb3[_0xcdeb('0xf')][_0xcdeb('0x10')](0x0,_0xf34eb3['name'][_0xcdeb('0x11')]('@'));}var _0xb5bba0=_0xf34eb3[_0xcdeb('0xf')]['split'](/\s+/);return _0xb5bba0['length']>0x1?_0xb5bba0[_0xcdeb('0x12')](0x0,-0x1)['join']('\x20'):_0xf34eb3['name'];}return _0xcdeb('0x13');}function getLastName(_0x403230){var _0x11faf1=_['head'](_0x403230['value']);if(_0x11faf1&&_0x11faf1['name']){var _0x504147=_0x11faf1['name'][_0xcdeb('0x14')](/\s+/);return _0x504147[_0xcdeb('0x15')]>0x1?_0x504147['pop']():'';}return'';}function getMails(_0x478195,_0x5ca46d){var _0x3a9f2d='';for(var _0x485f80=0x0;_0x485f80<_0x5ca46d[_0xcdeb('0xa')][_0xcdeb('0x15')];_0x485f80+=0x1){if(_0x5ca46d['value'][_0x485f80][_0xcdeb('0xb')]!==_0x478195){if(!_[_0xcdeb('0x16')](_0x3a9f2d)){_0x3a9f2d+=',';}_0x3a9f2d+=_0x5ca46d[_0xcdeb('0xa')][_0x485f80][_0xcdeb('0xf')]||_0x5ca46d[_0xcdeb('0xa')][_0x485f80]['address']||'';_0x3a9f2d+='\x20<';_0x3a9f2d+=_0x5ca46d[_0xcdeb('0xa')][_0x485f80][_0xcdeb('0xb')]?_0x5ca46d[_0xcdeb('0xa')][_0x485f80][_0xcdeb('0xb')]:_0xcdeb('0xc')+random[_0xcdeb('0xd')](0x6)+'@xcally.com';_0x3a9f2d+='>';}}return _0x3a9f2d;}function parseEmail(_0x145dd7,_0x5f074b,_0x117a4c){if(_0x5f074b[_0xcdeb('0x17')]){var _0x1df7d1=/)<[^<]*)*<\/script>/gi;while(_0x1df7d1[_0xcdeb('0x18')](_0x5f074b[_0xcdeb('0x17')])){_0x5f074b[_0xcdeb('0x17')]=_0x5f074b['html'][_0xcdeb('0x19')](_0x1df7d1,'');}if(_0x5f074b['html'][_0xcdeb('0x1a')](_0xcdeb('0x1b'))){var _0x3ffcfa=[];_0x5f074b['attachments'][_0xcdeb('0x1c')](_0x17dbd7=>{_0x3ffcfa[_0xcdeb('0x1d')](_0x17dbd7['filename']);});var _0x52e436=/]+>/g;var _0x3e7571=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x56f68f=_0x5f074b[_0xcdeb('0x17')]['replace'](_0x3e7571,_0xcdeb('0x1e'));var _0x362862=_0x56f68f[_0xcdeb('0x19')](_0x52e436,_0xcdeb('0x1f'));for(let _0x124159=0x0;_0x124159<_0x3ffcfa[_0xcdeb('0x15')];_0x124159++){var _0x4cc5ce=_0x362862[_0xcdeb('0x19')](_0xcdeb('0x1f'),'\x20[Attachment:\x20'+_0x3ffcfa[_0x124159]+_0xcdeb('0x20'));_0x362862=_0x4cc5ce;}_0x5f074b[_0xcdeb('0x17')]=_0x362862;}_0x117a4c[_0xcdeb('0x21')]=_0x5f074b[_0xcdeb('0x17')];}else{_0x117a4c[_0xcdeb('0x21')]=_0x5f074b[_0xcdeb('0x22')];}if(_0x117a4c[_0xcdeb('0x21')]){_0x117a4c[_0xcdeb('0x21')]=_0x117a4c[_0xcdeb('0x21')][_0xcdeb('0x19')](/0x0){var _0x131949=[_0xcdeb('0x33'),_0xcdeb('0x34'),_0xcdeb('0x35')];for(var _0x3563c0=0x0;_0x3563c0<_0x5f074b['headerLines'][_0xcdeb('0x15')];_0x3563c0++){var _0x2fbd92=_[_0xcdeb('0x11')](_0x131949,_0x5f074b['headerLines'][_0x3563c0]['line']);if(_0x2fbd92>=0x0){_0x117a4c[_0xcdeb('0x36')]=!![];}}}return _0x117a4c;}exports[_0xcdeb('0x37')]=function(_0x1415a3,_0xbaa1a0,_0x3ed149){var _0x2dbf09={'from':getAddress(_0xbaa1a0['from']),'firstName':getFirstName(_0xbaa1a0[_0xcdeb('0x38')]),'lastName':getLastName(_0xbaa1a0[_0xcdeb('0x38')]),'mapKey':_0xcdeb('0x7'),'message':{'from':getMails(_0x1415a3[_0xcdeb('0x7')],_0xbaa1a0[_0xcdeb('0x38')]),'to':_0x1415a3[_0xcdeb('0x7')],'cc':'','subject':_0xbaa1a0[_0xcdeb('0x39')]||'','messageId':_0xbaa1a0['messageId'],'inReplyTo':_0xbaa1a0[_0xcdeb('0x3a')],'sentAt':moment(_0xbaa1a0[_0xcdeb('0x3b')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0xbaa1a0[_0xcdeb('0x17')]&&!_0xbaa1a0[_0xcdeb('0x22')]){var _0x2c249f=_['filter'](_0xbaa1a0[_0xcdeb('0x27')],{'contentType':_0xcdeb('0x3c')});if(_0x2c249f[_0xcdeb('0x15')]){logger[_0xcdeb('0x3d')](util[_0xcdeb('0x3e')](_0xcdeb('0x3f'),_0xbaa1a0[_0xcdeb('0x40')]));tnef['parseBuffer'](_[_0xcdeb('0x41')](_0x2c249f)[_0xcdeb('0x31')],function(_0xe8e4ce,_0x140430){if(_0x140430){_0xbaa1a0['html']=_0x140430[_0xcdeb('0x42')]||_0xcdeb('0x43');if(_0x140430[_0xcdeb('0x44')]){for(var _0x51a3f9=0x0;_0x51a3f9<_0x140430[_0xcdeb('0x44')][_0xcdeb('0x15')];_0x51a3f9++){var _0x156624=_0x140430[_0xcdeb('0x44')][_0x51a3f9];_0x2dbf09['message'][_0xcdeb('0x27')][_0xcdeb('0x1d')]({'filename':_0x156624[_0xcdeb('0x45')],'content':Buffer['from'](_0x156624[_0xcdeb('0x46')])});}}}_0x3ed149(parseEmail(_0x1415a3,_0xbaa1a0,_0x2dbf09));});}else{_0xbaa1a0['html']=_0xcdeb('0x43');_0x3ed149(parseEmail(_0x1415a3,_0xbaa1a0,_0x2dbf09));}}else{_0x3ed149(parseEmail(_0x1415a3,_0xbaa1a0,_0x2dbf09));}};exports['getHost']=function(_0x35a10b){switch(_0x35a10b){case'gmail':return _0xcdeb('0x47');case _0xcdeb('0x48'):return _0xcdeb('0x49');case _0xcdeb('0x4a'):return'imap-mail.outlook.com';case'outlook365':return _0xcdeb('0x4b');}return _0xcdeb('0x4c');};exports['generateXOAuth2Token']=function(_0x350176,_0x4d4c39){var _0x51bd22=[_0xcdeb('0x4d')+(_0x4d4c39||''),_0xcdeb('0x4e')+_0x350176,'',''];return Buffer[_0xcdeb('0x38')](_0x51bd22[_0xcdeb('0x2e')](''),'utf-8')[_0xcdeb('0x4f')](_0xcdeb('0x50'));}; \ No newline at end of file +var _0xf95e=['filename','replace','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','user=','auth=Bearer\x20','utf-8','base64','lodash','randomstring','path','util','../../../config/environment','head','value','address','anonymous','generate','name','indexOf','split','length','join','Anonymous','isEmpty','@xcally.com','html','test','includes','0x1?_0x2e4d80['slice'](0x0,-0x1)[_0xef95('0xe')]('\x20'):_0x2e1231['name'];}return _0xef95('0xf');}function getLastName(_0x238cf8){var _0x3fb5be=_['head'](_0x238cf8['value']);if(_0x3fb5be&&_0x3fb5be[_0xef95('0xa')]){var _0x51c664=_0x3fb5be[_0xef95('0xa')][_0xef95('0xc')](/\s+/);return _0x51c664[_0xef95('0xd')]>0x1?_0x51c664['pop']():'';}return'';}function getMails(_0x184798,_0x5db00a){var _0x1f3bc4='';for(var _0x18cbf9=0x0;_0x18cbf9<_0x5db00a['value'][_0xef95('0xd')];_0x18cbf9+=0x1){if(_0x5db00a['value'][_0x18cbf9]['address']!==_0x184798){if(!_[_0xef95('0x10')](_0x1f3bc4)){_0x1f3bc4+=',';}_0x1f3bc4+=_0x5db00a['value'][_0x18cbf9][_0xef95('0xa')]||_0x5db00a[_0xef95('0x6')][_0x18cbf9][_0xef95('0x7')]||'';_0x1f3bc4+='\x20<';_0x1f3bc4+=_0x5db00a[_0xef95('0x6')][_0x18cbf9]['address']?_0x5db00a['value'][_0x18cbf9][_0xef95('0x7')]:_0xef95('0x8')+random['generate'](0x6)+_0xef95('0x11');_0x1f3bc4+='>';}}return _0x1f3bc4;}function parseEmail(_0x41f6bd,_0x369afd,_0xf89eb8){if(_0x369afd[_0xef95('0x12')]){var _0x42dfd6=/)<[^<]*)*<\/script>/gi;while(_0x42dfd6[_0xef95('0x13')](_0x369afd[_0xef95('0x12')])){_0x369afd[_0xef95('0x12')]=_0x369afd['html']['replace'](_0x42dfd6,'');}if(_0x369afd[_0xef95('0x12')][_0xef95('0x14')](_0xef95('0x15'))){var _0x1cbe69=[];_0x369afd[_0xef95('0x16')]['forEach'](_0x39ca48=>{_0x1cbe69[_0xef95('0x17')](_0x39ca48[_0xef95('0x18')]);});var _0xba1179=/]+>/g;var _0x26fadf=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1d5011=_0x369afd[_0xef95('0x12')][_0xef95('0x19')](_0x26fadf,_0xef95('0x1a'));var _0x4e0087=_0x1d5011[_0xef95('0x19')](_0xba1179,'_IMG');for(let _0x3f6f69=0x0;_0x3f6f69<_0x1cbe69[_0xef95('0xd')];_0x3f6f69++){var _0x524137=_0x4e0087[_0xef95('0x19')](_0xef95('0x1b'),_0xef95('0x1c')+_0x1cbe69[_0x3f6f69]+_0xef95('0x1d'));_0x4e0087=_0x524137;}_0x369afd['html']=_0x4e0087;}_0xf89eb8[_0xef95('0x1e')]=_0x369afd[_0xef95('0x12')];}else{_0xf89eb8['body']=_0x369afd[_0xef95('0x1f')];}if(_0xf89eb8[_0xef95('0x1e')]){_0xf89eb8[_0xef95('0x1e')]=_0xf89eb8[_0xef95('0x1e')][_0xef95('0x19')](/0x0){var _0x5a2153=[_0xef95('0x2d'),'X-Auto-Response-Suppress:\x20All',_0xef95('0x2e')];for(var _0x769796=0x0;_0x769796<_0x369afd['headerLines']['length'];_0x769796++){var _0x557aae=_['indexOf'](_0x5a2153,_0x369afd[_0xef95('0x2c')][_0x769796][_0xef95('0x2f')]);if(_0x557aae>=0x0){_0xf89eb8[_0xef95('0x30')]=!![];}}}return _0xf89eb8;}exports[_0xef95('0x31')]=function(_0x55be2b,_0x32b124,_0x603d9d){var _0x1cc10d={'from':getAddress(_0x32b124[_0xef95('0x32')]),'firstName':getFirstName(_0x32b124[_0xef95('0x32')]),'lastName':getLastName(_0x32b124['from']),'mapKey':_0xef95('0x22'),'message':{'from':getMails(_0x55be2b[_0xef95('0x22')],_0x32b124[_0xef95('0x32')]),'to':_0x55be2b['email'],'cc':'','subject':_0x32b124[_0xef95('0x33')]||'','messageId':_0x32b124[_0xef95('0x34')],'inReplyTo':_0x32b124[_0xef95('0x35')],'sentAt':moment(_0x32b124[_0xef95('0x36')])[_0xef95('0x37')](_0xef95('0x38')),'attach':![],'attachments':[]}};if(!_0x32b124[_0xef95('0x12')]&&!_0x32b124[_0xef95('0x1f')]){var _0x2a44b5=_['filter'](_0x32b124[_0xef95('0x16')],{'contentType':_0xef95('0x39')});if(_0x2a44b5[_0xef95('0xd')]){logger['info'](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x32b124[_0xef95('0x34')]));tnef[_0xef95('0x3a')](_[_0xef95('0x3b')](_0x2a44b5)['content'],function(_0x4a18a2,_0x2b775f){if(_0x2b775f){_0x32b124[_0xef95('0x12')]=_0x2b775f[_0xef95('0x3c')]||_0xef95('0x3d');if(_0x2b775f[_0xef95('0x3e')]){for(var _0x1b700f=0x0;_0x1b700f<_0x2b775f[_0xef95('0x3e')][_0xef95('0xd')];_0x1b700f++){var _0x5020fa=_0x2b775f[_0xef95('0x3e')][_0x1b700f];_0x1cc10d[_0xef95('0x21')][_0xef95('0x16')][_0xef95('0x17')]({'filename':_0x5020fa['Title'],'content':Buffer['from'](_0x5020fa[_0xef95('0x3f')])});}}}_0x603d9d(parseEmail(_0x55be2b,_0x32b124,_0x1cc10d));});}else{_0x32b124[_0xef95('0x12')]=_0xef95('0x3d');_0x603d9d(parseEmail(_0x55be2b,_0x32b124,_0x1cc10d));}}else{_0x603d9d(parseEmail(_0x55be2b,_0x32b124,_0x1cc10d));}};exports[_0xef95('0x40')]=function(_0x3e2ac6){switch(_0x3e2ac6){case _0xef95('0x41'):return _0xef95('0x42');case _0xef95('0x43'):return _0xef95('0x44');case _0xef95('0x45'):return _0xef95('0x46');case _0xef95('0x47'):return _0xef95('0x48');}return _0xef95('0x49');};exports['generateXOAuth2Token']=function(_0x22f9ba,_0x295816){var _0x4d757a=[_0xef95('0x4a')+(_0x295816||''),_0xef95('0x4b')+_0x22f9ba,'',''];return Buffer[_0xef95('0x32')](_0x4d757a[_0xef95('0xe')](''),_0xef95('0x4c'))['toString'](_0xef95('0x4d'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 129b91c..d5aec67 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 _0x09f6=['key','SERV','active','Imap','Smtp','exports','lodash','name','Service'];(function(_0x751ac5,_0x4ad02a){var _0x4dc561=function(_0x7c2b34){while(--_0x7c2b34){_0x751ac5['push'](_0x751ac5['shift']());}};_0x4dc561(++_0x4ad02a);}(_0x09f6,0x84));var _0x609f=function(_0x590af5,_0x1795fa){_0x590af5=_0x590af5-0x0;var _0xe5464e=_0x09f6[_0x590af5];return _0xe5464e;};'use strict';var _=require(_0x609f('0x0'));function MailAccount(_0x1c1ff9){this['id']=_0x1c1ff9['id']||0x0;this[_0x609f('0x1')]=_0x1c1ff9[_0x609f('0x1')]||_0x609f('0x2');this['key']=_0x1c1ff9[_0x609f('0x3')]||_0x609f('0x4');this['active']=_0x1c1ff9[_0x609f('0x5')]||![];this['Imap']=_0x1c1ff9[_0x609f('0x6')]||[];this['Smtp']=_0x1c1ff9[_0x609f('0x7')]||[];}module[_0x609f('0x8')]=MailAccount; \ No newline at end of file +var _0xd04c=['active','exports','Service','key','SERV'];(function(_0x434ca8,_0x137097){var _0x3e5ba0=function(_0x4cac4f){while(--_0x4cac4f){_0x434ca8['push'](_0x434ca8['shift']());}};_0x3e5ba0(++_0x137097);}(_0xd04c,0x133));var _0xcd04=function(_0x2ad986,_0x50ecd4){_0x2ad986=_0x2ad986-0x0;var _0x1474b3=_0xd04c[_0x2ad986];return _0x1474b3;};'use strict';var _=require('lodash');function MailAccount(_0x698ce7){this['id']=_0x698ce7['id']||0x0;this['name']=_0x698ce7['name']||_0xcd04('0x0');this[_0xcd04('0x1')]=_0x698ce7['key']||_0xcd04('0x2');this[_0xcd04('0x3')]=_0x698ce7[_0xcd04('0x3')]||![];this['Imap']=_0x698ce7['Imap']||[];this['Smtp']=_0x698ce7['Smtp']||[];}module[_0xcd04('0x4')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 398bf4d..63d292a 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 _0xfb18=['length','isUndefined','merge','exports','../model/mailAccount','mailAccounts','prototype','initMailAccounts'];(function(_0x9a825b,_0x35c63e){var _0x4e5706=function(_0x20e4f2){while(--_0x20e4f2){_0x9a825b['push'](_0x9a825b['shift']());}};_0x4e5706(++_0x35c63e);}(_0xfb18,0x114));var _0x8fb1=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xfb18[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require('lodash');var MailAccount=require(_0x8fb1('0x0'));var Realtime=function(){this[_0x8fb1('0x1')]={};};function freeIsNotKey(_0x188b82,_0x1ce922,_0x54761c){var _0x36c4a0=_['mapKeys'](_0x188b82,function(_0x1724de,_0x442fea){return _0x1724de[_0x54761c];});for(var _0x2797b9 in _0x1ce922){if(_0x1ce922['hasOwnProperty'](_0x2797b9)){if(!_0x36c4a0[_0x2797b9]){delete _0x1ce922[_0x2797b9];}}}}Realtime[_0x8fb1('0x2')]['mergeFromDatabase']=function(_0x4dccdf,_0x4a1b3d){for(var _0x530027 in _0x4a1b3d){if(_0x4dccdf['hasOwnProperty'](_0x530027)){_0x4dccdf[_0x530027]=_0x4a1b3d[_0x530027];}}};Realtime[_0x8fb1('0x2')][_0x8fb1('0x3')]=function(){var _0x5b986b=this;return function(_0x40a82b){if(_0x40a82b){freeIsNotKey(_0x40a82b,_0x5b986b['mailAccounts'],'id');for(var _0x360a00=0x0,_0x5233ad={},_0x2b97d5={};_0x360a00<_0x40a82b[_0x8fb1('0x4')];_0x360a00+=0x1){_0x5233ad=_0x40a82b[_0x360a00];if(_[_0x8fb1('0x5')](_0x5b986b[_0x8fb1('0x1')][_0x5233ad['id']])){_0x5b986b[_0x8fb1('0x1')][_0x5233ad['id']]=new MailAccount(_0x5233ad);}else{_[_0x8fb1('0x6')](_0x5b986b['mailAccounts'][_0x5233ad['id']],_0x5233ad);}}}return _0x5b986b[_0x8fb1('0x1')];};};module[_0x8fb1('0x7')]=Realtime; \ No newline at end of file +var _0xfcf8=['mapKeys','prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','length','isUndefined','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x28bef9,_0x28e8d6){var _0x45db81=function(_0x269033){while(--_0x269033){_0x28bef9['push'](_0x28bef9['shift']());}};_0x45db81(++_0x28e8d6);}(_0xfcf8,0x1c0));var _0x8fcf=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xfcf8[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0x8fcf('0x0'));var MailAccount=require(_0x8fcf('0x1'));var Realtime=function(){this[_0x8fcf('0x2')]={};};function freeIsNotKey(_0xa5863b,_0x41c530,_0x4d429d){var _0x23bf53=_[_0x8fcf('0x3')](_0xa5863b,function(_0x326440,_0x592e1c){return _0x326440[_0x4d429d];});for(var _0x129f37 in _0x41c530){if(_0x41c530['hasOwnProperty'](_0x129f37)){if(!_0x23bf53[_0x129f37]){delete _0x41c530[_0x129f37];}}}}Realtime[_0x8fcf('0x4')][_0x8fcf('0x5')]=function(_0x374cd5,_0x2cd4a8){for(var _0x5d1635 in _0x2cd4a8){if(_0x374cd5[_0x8fcf('0x6')](_0x5d1635)){_0x374cd5[_0x5d1635]=_0x2cd4a8[_0x5d1635];}}};Realtime[_0x8fcf('0x4')][_0x8fcf('0x7')]=function(){var _0xed4798=this;return function(_0x366035){if(_0x366035){freeIsNotKey(_0x366035,_0xed4798['mailAccounts'],'id');for(var _0x453e11=0x0,_0x2a20b0={},_0x19872c={};_0x453e11<_0x366035[_0x8fcf('0x8')];_0x453e11+=0x1){_0x2a20b0=_0x366035[_0x453e11];if(_[_0x8fcf('0x9')](_0xed4798[_0x8fcf('0x2')][_0x2a20b0['id']])){_0xed4798['mailAccounts'][_0x2a20b0['id']]=new MailAccount(_0x2a20b0);}else{_['merge'](_0xed4798[_0x8fcf('0x2')][_0x2a20b0['id']],_0x2a20b0);}}}return _0xed4798['mailAccounts'];};};module[_0x8fcf('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 811873f..3371594 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 _0xadb5=['notify','NotifyMailAccount','getMailAccounts','GetMailAccount','name','provider','email','active','key','TemplateId','MailServerIn','Imap','CloudProvider','service','type','data5','MailServerOut','Smtp','getMailAccount'];(function(_0xcf7a26,_0x9d9464){var _0x301fc0=function(_0x5b610e){while(--_0x5b610e){_0xcf7a26['push'](_0xcf7a26['shift']());}};_0x301fc0(++_0x9d9464);}(_0xadb5,0xad));var _0x5adb=function(_0x5bc2ee,_0x14017b){_0x5bc2ee=_0x5bc2ee-0x0;var _0x112fdd=_0xadb5[_0x5bc2ee];return _0x112fdd;};'use strict';var client=require('../client');exports[_0x5adb('0x0')]=function(){return function(){return client['Request'](_0x5adb('0x1'),{'options':{'attributes':['id',_0x5adb('0x2'),_0x5adb('0x3'),'service',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'ListId',_0x5adb('0x7')],'raw':![],'include':[{'model':_0x5adb('0x8'),'as':_0x5adb('0x9'),'include':[{'model':_0x5adb('0xa'),'attributes':['id',_0x5adb('0x2'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd')],'as':_0x5adb('0xa')}]},{'model':_0x5adb('0xe'),'as':_0x5adb('0xf'),'include':[{'model':_0x5adb('0xa'),'attributes':['id',_0x5adb('0x2'),_0x5adb('0xb'),'type','data5'],'as':_0x5adb('0xa')}]}]},'log':_0x5adb('0x10')});};};exports[_0x5adb('0x11')]=function(_0x53b772,_0x29f0d5){return client['Request'](_0x5adb('0x12'),{'account':{'id':_0x53b772},'body':_0x29f0d5,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x3c36=['getMailAccount','notify','Request','GetMailAccount','name','service','email','active','ListId','TemplateId','type','CloudProvider','MailServerOut','Smtp'];(function(_0x3a0d64,_0xa4119c){var _0x41cbd0=function(_0x487e4d){while(--_0x487e4d){_0x3a0d64['push'](_0x3a0d64['shift']());}};_0x41cbd0(++_0xa4119c);}(_0x3c36,0x10c));var _0x63c3=function(_0x3a87ea,_0x3daafb){_0x3a87ea=_0x3a87ea-0x0;var _0x447a3c=_0x3c36[_0x3a87ea];return _0x447a3c;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0x63c3('0x0')](_0x63c3('0x1'),{'options':{'attributes':['id',_0x63c3('0x2'),'provider',_0x63c3('0x3'),_0x63c3('0x4'),_0x63c3('0x5'),'key',_0x63c3('0x6'),_0x63c3('0x7')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':'CloudProvider','attributes':['id',_0x63c3('0x2'),'service',_0x63c3('0x8'),'data5'],'as':_0x63c3('0x9')}]},{'model':_0x63c3('0xa'),'as':_0x63c3('0xb'),'include':[{'model':_0x63c3('0x9'),'attributes':['id','name',_0x63c3('0x3'),'type','data5'],'as':_0x63c3('0x9')}]}]},'log':_0x63c3('0xc')});};};exports[_0x63c3('0xd')]=function(_0x211adc,_0xcf3381){return client[_0x63c3('0x0')]('NotifyMailAccount',{'account':{'id':_0x211adc},'body':_0xcf3381,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 74dd121..fc54f90 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 _0x62c4=['GetSettings','Request','ShowSetting'];(function(_0x5f53f6,_0x4cab87){var _0x5aadb7=function(_0x2f4cf6){while(--_0x2f4cf6){_0x5f53f6['push'](_0x5f53f6['shift']());}};_0x5aadb7(++_0x4cab87);}(_0x62c4,0x127));var _0x462c=function(_0x39f751,_0xfd4687){_0x39f751=_0x39f751-0x0;var _0x43371c=_0x62c4[_0x39f751];return _0x43371c;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x462c('0x0')](_0x462c('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x462c('0x2')});}; \ No newline at end of file +var _0x245e=['loginMailFrequency','../client','getSettings','Request'];(function(_0x460ad3,_0x35c6f3){var _0x5c2274=function(_0x33dcba){while(--_0x33dcba){_0x460ad3['push'](_0x460ad3['shift']());}};_0x5c2274(++_0x35c6f3);}(_0x245e,0x1bd));var _0xe245=function(_0x3858dc,_0x4b98eb){_0x3858dc=_0x3858dc-0x0;var _0x40e811=_0x245e[_0x3858dc];return _0x40e811;};'use strict';var client=require(_0xe245('0x0'));exports[_0xe245('0x1')]=function(){return client[_0xe245('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe245('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index c3977ee..199bffe 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 d4d578e..de61e1b 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 _0x4d76=['listen','port','socket.io','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/express','../../routes','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','ioredis','../../config/environment','createServer','timeout'];(function(_0x1c88f9,_0x211646){var _0x1779f7=function(_0x1dc48e){while(--_0x1dc48e){_0x1c88f9['push'](_0x1c88f9['shift']());}};_0x1779f7(++_0x211646);}(_0x4d76,0x1c8));var _0x64d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d76[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var http=require(_0x64d7('0x0'));var express=require(_0x64d7('0x1'));var sticky=require('sticky-session');var Redis=require(_0x64d7('0x2'));var config=require(_0x64d7('0x3'));var app=express();var server=http[_0x64d7('0x4')](app);server[_0x64d7('0x5')]=0xdbba0;if(sticky[_0x64d7('0x6')](server,config[_0x64d7('0x7')])){var socketio=require(_0x64d7('0x8'))(server,{'transports':['websocket','polling']});config[_0x64d7('0x9')]=_[_0x64d7('0xa')](config[_0x64d7('0x9')],{'host':_0x64d7('0xb'),'port':0x18eb});socketio[_0x64d7('0xc')](require(_0x64d7('0xd'))({'pubClient':new Redis(config[_0x64d7('0x9')]),'subClient':new Redis(config['redis'])}));require(_0x64d7('0xe'))['default']();require('../../config/socketio')[_0x64d7('0xf')](socketio);require(_0x64d7('0x10'))['default'](app);require(_0x64d7('0x11'))[_0x64d7('0xf')](app);}else{server['once'](_0x64d7('0x12'),function(){console['log'](_0x64d7('0x13'),config['port']);});}exports=module[_0x64d7('0x14')]=app; \ No newline at end of file +var _0x96b7=['createServer','socket.io','websocket','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','http','express','sticky-session','ioredis','../../config/environment'];(function(_0x4bfe08,_0x48ae7b){var _0x1f9125=function(_0x11450e){while(--_0x11450e){_0x4bfe08['push'](_0x4bfe08['shift']());}};_0x1f9125(++_0x48ae7b);}(_0x96b7,0x163));var _0x796b=function(_0x26f1c4,_0x2bbc6a){_0x26f1c4=_0x26f1c4-0x0;var _0x393a70=_0x96b7[_0x26f1c4];return _0x393a70;};'use strict';var _=require('lodash');var http=require(_0x796b('0x0'));var express=require(_0x796b('0x1'));var sticky=require(_0x796b('0x2'));var Redis=require(_0x796b('0x3'));var config=require(_0x796b('0x4'));var app=express();var server=http[_0x796b('0x5')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0x796b('0x6'))(server,{'transports':[_0x796b('0x7'),_0x796b('0x8')]});config[_0x796b('0x9')]=_[_0x796b('0xa')](config[_0x796b('0x9')],{'host':_0x796b('0xb'),'port':0x18eb});socketio['adapter'](require(_0x796b('0xc'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x796b('0x9')])}));require(_0x796b('0xd'))[_0x796b('0xe')]();require(_0x796b('0xf'))[_0x796b('0xe')](socketio);require(_0x796b('0x10'))[_0x796b('0xe')](app);require(_0x796b('0x11'))['default'](app);}else{server[_0x796b('0x12')](_0x796b('0x13'),function(){console[_0x796b('0x14')](_0x796b('0x15'),config[_0x796b('0x16')]);});}exports=module[_0x796b('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index d7bbca8..5de0065 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 _0xd617=['routing','client','http','Request','request','then','debug','rpc','error','message','catch','exports','jayson/promise','bluebird'];(function(_0x361cc1,_0x311f01){var _0x4af04c=function(_0x33b4c8){while(--_0x33b4c8){_0x361cc1['push'](_0x361cc1['shift']());}};_0x4af04c(++_0x311f01);}(_0xd617,0xfa));var _0x7d61=function(_0x2b924a,_0x1abf32){_0x2b924a=_0x2b924a-0x0;var _0x198a7e=_0xd617[_0x2b924a];return _0x198a7e;};'use strict';var jayson=require(_0x7d61('0x0'));var BPromise=require(_0x7d61('0x1'));var logger=require('../../config/logger')(_0x7d61('0x2'));var client=jayson[_0x7d61('0x3')][_0x7d61('0x4')]({'port':0x2329});client[_0x7d61('0x5')]=function(_0x434e97,_0x3e6a77){return new BPromise(function(_0x354105,_0x8d9736){return client[_0x7d61('0x6')](_0x434e97,_0x3e6a77)[_0x7d61('0x7')](function(_0x10f0f9){logger[_0x7d61('0x8')](_0x7d61('0x9'),_0x7d61('0x2'),_0x434e97,_0x3e6a77,_0x10f0f9);if(_0x10f0f9[_0x7d61('0xa')]){logger['error']('rpc',_0x7d61('0x2'),_0x434e97,_0x10f0f9[_0x7d61('0xa')][_0x7d61('0xb')],_0x3e6a77);return _0x8d9736(_0x10f0f9[_0x7d61('0xa')][_0x7d61('0xb')]);}else{return _0x354105(_0x10f0f9['result']);}})[_0x7d61('0xc')](function(_0x1056db){logger['error'](_0x7d61('0x9'),'routing',_0x434e97,_0x1056db,_0x3e6a77);return _0x8d9736(_0x1056db);});});};module[_0x7d61('0xd')]=client; \ No newline at end of file +var _0x9542=['../../config/logger','routing','client','http','Request','request','then','debug','error','rpc','message','exports','jayson/promise','bluebird'];(function(_0x48be3a,_0x117ae9){var _0x399773=function(_0x9a89a5){while(--_0x9a89a5){_0x48be3a['push'](_0x48be3a['shift']());}};_0x399773(++_0x117ae9);}(_0x9542,0x140));var _0x2954=function(_0x25d321,_0x54d79a){_0x25d321=_0x25d321-0x0;var _0x4c1450=_0x9542[_0x25d321];return _0x4c1450;};'use strict';var jayson=require(_0x2954('0x0'));var BPromise=require(_0x2954('0x1'));var logger=require(_0x2954('0x2'))(_0x2954('0x3'));var client=jayson[_0x2954('0x4')][_0x2954('0x5')]({'port':0x2329});client[_0x2954('0x6')]=function(_0x162f0f,_0x56d588){return new BPromise(function(_0x420684,_0x5bbae5){return client[_0x2954('0x7')](_0x162f0f,_0x56d588)[_0x2954('0x8')](function(_0x2162ef){logger[_0x2954('0x9')]('rpc',_0x2954('0x3'),_0x162f0f,_0x56d588,_0x2162ef);if(_0x2162ef[_0x2954('0xa')]){logger[_0x2954('0xa')](_0x2954('0xb'),_0x2954('0x3'),_0x162f0f,_0x2162ef['error'][_0x2954('0xc')],_0x56d588);return _0x5bbae5(_0x2162ef[_0x2954('0xa')][_0x2954('0xc')]);}else{return _0x420684(_0x2162ef['result']);}})['catch'](function(_0x2cdccb){logger[_0x2954('0xa')](_0x2954('0xb'),'routing',_0x162f0f,_0x2cdccb,_0x56d588);return _0x5bbae5(_0x2cdccb);});});};module[_0x2954('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index cbc030b..e0d85ea 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 _0x067e=['initFaxQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initSmsQueues','getMailQueues','getFaxQueues'];(function(_0x117ca4,_0x4391f1){var _0x8632ca=function(_0x41a7c9){while(--_0x41a7c9){_0x117ca4['push'](_0x117ca4['shift']());}};_0x8632ca(++_0x4391f1);}(_0x067e,0x123));var _0xe067=function(_0x3c58af,_0x4d82af){_0x3c58af=_0x3c58af-0x0;var _0x2d3ad3=_0x067e[_0x3c58af];return _0x2d3ad3;};'use strict';var BPromise=require(_0xe067('0x0'));var server=require(_0xe067('0x1'));var Realtime=require(_0xe067('0x2'));var user=require(_0xe067('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xe067('0x4'));var chatQueue=require(_0xe067('0x5'));var smsQueue=require(_0xe067('0x6'));var mailQueue=require(_0xe067('0x7'));var faxQueue=require(_0xe067('0x8'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xe067('0x9')]()[_0xe067('0xa')](user[_0xe067('0xb')]())['then'](realtime[_0xe067('0xc')]())[_0xe067('0xa')](interval[_0xe067('0xd')]())[_0xe067('0xa')](realtime[_0xe067('0xe')]())[_0xe067('0xa')](openchannelQueue[_0xe067('0xf')]())[_0xe067('0xa')](realtime[_0xe067('0x10')]())[_0xe067('0xa')](chatQueue[_0xe067('0x11')]())[_0xe067('0xa')](realtime['initChatQueues']())[_0xe067('0xa')](smsQueue['getSmsQueues']())['then'](realtime[_0xe067('0x12')]())['then'](mailQueue[_0xe067('0x13')]())[_0xe067('0xa')](realtime['initMailQueues']())[_0xe067('0xa')](faxQueue[_0xe067('0x14')]())[_0xe067('0xa')](realtime[_0xe067('0x15')]())[_0xe067('0xa')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0xe067('0x16')]())[_0xe067('0xa')](function(){return realtime;});}function main(){return server[_0xe067('0x17')](realtime)['then'](function(_0x344d8a){return initRealtime();})[_0xe067('0xa')](function(_0x498538){return setInterval(initRealtime,0x1388);})[_0xe067('0x18')](function(_0x4c2c67){console[_0xe067('0x19')](_0x4c2c67);});}main(); \ No newline at end of file +var _0x2f3a=['getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then'];(function(_0x353eee,_0x5c4358){var _0x200e8e=function(_0x2a7b1b){while(--_0x2a7b1b){_0x353eee['push'](_0x353eee['shift']());}};_0x200e8e(++_0x5c4358);}(_0x2f3a,0xd3));var _0xa2f3=function(_0x35b8f1,_0x45ca7d){_0x35b8f1=_0x35b8f1-0x0;var _0x1c23b7=_0x2f3a[_0x35b8f1];return _0x1c23b7;};'use strict';var BPromise=require(_0xa2f3('0x0'));var server=require('./server');var Realtime=require(_0xa2f3('0x1'));var user=require(_0xa2f3('0x2'));var interval=require(_0xa2f3('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xa2f3('0x4'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xa2f3('0x5'));var whatsappQueue=require(_0xa2f3('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xa2f3('0x7')]()[_0xa2f3('0x8')](user[_0xa2f3('0x9')]())['then'](realtime[_0xa2f3('0xa')]())['then'](interval[_0xa2f3('0xb')]())[_0xa2f3('0x8')](realtime[_0xa2f3('0xc')]())[_0xa2f3('0x8')](openchannelQueue[_0xa2f3('0xd')]())['then'](realtime[_0xa2f3('0xe')]())['then'](chatQueue[_0xa2f3('0xf')]())[_0xa2f3('0x8')](realtime['initChatQueues']())['then'](smsQueue[_0xa2f3('0x10')]())[_0xa2f3('0x8')](realtime[_0xa2f3('0x11')]())[_0xa2f3('0x8')](mailQueue['getMailQueues']())[_0xa2f3('0x8')](realtime[_0xa2f3('0x12')]())['then'](faxQueue[_0xa2f3('0x13')]())[_0xa2f3('0x8')](realtime[_0xa2f3('0x14')]())[_0xa2f3('0x8')](whatsappQueue['getWhatsappQueues']())[_0xa2f3('0x8')](realtime[_0xa2f3('0x15')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0xc8051d){return initRealtime();})[_0xa2f3('0x8')](function(_0x2e3677){return setInterval(initRealtime,0x1388);})['catch'](function(_0xf79dbe){console['log'](_0xf79dbe);});}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 d6953d5..d8f4294 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 _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1261,0x144));var _0x1126=function(_0x61bb05,_0x47421f){_0x61bb05=_0x61bb05-0x0;var _0x3ceb3e=_0x1261[_0x61bb05];return _0x3ceb3e;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file +var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x295bc8,_0x5efe94){var _0x94d369=function(_0x39c22a){while(--_0x39c22a){_0x295bc8['push'](_0x295bc8['shift']());}};_0x94d369(++_0x5efe94);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc4aa[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 2a3e7ec..d5b42eb 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 _0xda40=['bluebird','jayson/promise','request','error','result','catch','sendMailMessage','SendMail'];(function(_0x2c1c33,_0x5dd691){var _0x504faa=function(_0x446a34){while(--_0x446a34){_0x2c1c33['push'](_0x2c1c33['shift']());}};_0x504faa(++_0x5dd691);}(_0xda40,0xf0));var _0x0da4=function(_0x50fa9a,_0x1da236){_0x50fa9a=_0x50fa9a-0x0;var _0x2bff39=_0xda40[_0x50fa9a];return _0x2bff39;};'use strict';var BPromise=require(_0x0da4('0x0'));var jayson=require(_0x0da4('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x204c6c,_0x1dc4e6){return new BPromise(function(_0x431a8c,_0x56456e){return client[_0x0da4('0x2')](_0x204c6c,_0x1dc4e6)['then'](function(_0x3fce37){if(_0x3fce37[_0x0da4('0x3')]){return _0x56456e(_0x3fce37[_0x0da4('0x3')]['message']);}else{return _0x431a8c(_0x3fce37[_0x0da4('0x4')]);}})[_0x0da4('0x5')](function(_0x371bfa){return _0x56456e(_0x371bfa);});});}exports[_0x0da4('0x6')]=function(_0x39398e,_0x1241cd){return request(_0x0da4('0x7'),{'account':_0x39398e,'message':_0x1241cd});}; \ No newline at end of file +var _0x6023=['SendMail','jayson/promise','client','http','error','result','sendMailMessage'];(function(_0x6cd03c,_0x37ee8d){var _0x4eae0f=function(_0x3c93df){while(--_0x3c93df){_0x6cd03c['push'](_0x6cd03c['shift']());}};_0x4eae0f(++_0x37ee8d);}(_0x6023,0x197));var _0x3602=function(_0x339981,_0x2b7a62){_0x339981=_0x339981-0x0;var _0x51b2c6=_0x6023[_0x339981];return _0x51b2c6;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x3602('0x0'));var client=jayson[_0x3602('0x1')][_0x3602('0x2')]({'port':0x232b});function request(_0x48a637,_0x50f198){return new BPromise(function(_0x155425,_0x46d37d){return client['request'](_0x48a637,_0x50f198)['then'](function(_0x3242e4){if(_0x3242e4[_0x3602('0x3')]){return _0x46d37d(_0x3242e4[_0x3602('0x3')]['message']);}else{return _0x155425(_0x3242e4[_0x3602('0x4')]);}})['catch'](function(_0x22a2aa){return _0x46d37d(_0x22a2aa);});});}exports[_0x3602('0x5')]=function(_0xfa7c5a,_0x1577d3){return request(_0x3602('0x6'),{'account':_0xfa7c5a,'message':_0x1577d3});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 6c4132f..6409476 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 _0x21aa=['ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCurrentCapacity','smsStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','updateRealtime','mail','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatPause','mailPause','faxStatusTime','faxCapacity','smsCapacity','smsCurrentCapacity','openchannelStatus','busy','stringify','user:save','exports','lodash','md5'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x21aa,0x154));var _0xa21a=function(_0x30f07a,_0x98341){_0x30f07a=_0x30f07a-0x0;var _0xb38461=_0x21aa[_0x30f07a];return _0xb38461;};'use strict';var _=require(_0xa21a('0x0'));var moment=require('moment');var md5=require(_0xa21a('0x1'));var Redis=require(_0xa21a('0x2'));var config=require(_0xa21a('0x3'));config[_0xa21a('0x4')]=_[_0xa21a('0x5')](config[_0xa21a('0x4')],{'host':_0xa21a('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa21a('0x4')]));function Agent(_0x2592b3){this['id']=_0x2592b3['id']||0x0;this[_0xa21a('0x7')]=_0x2592b3['name']||'';this['online']=_0x2592b3[_0xa21a('0x8')]||!![];this[_0xa21a('0x9')]=_0x2592b3[_0xa21a('0x9')]||![];this['chatPause']=_0x2592b3['chatPause']||![];this['mailPause']=_0x2592b3['mailPause']||![];this[_0xa21a('0xa')]=_0x2592b3[_0xa21a('0xa')]||![];this[_0xa21a('0xb')]=_0x2592b3[_0xa21a('0xb')]||![];this[_0xa21a('0xc')]=_0x2592b3['openchannelPause']||![];this[_0xa21a('0xd')]=_0xa21a('0xe');this[_0xa21a('0xf')]=0x0;this[_0xa21a('0x10')]=_0x2592b3[_0xa21a('0x10')]||0x0;this[_0xa21a('0x11')]=0x0;this[_0xa21a('0x12')]=_0xa21a('0xe');this[_0xa21a('0x13')]=0x0;this[_0xa21a('0x14')]=_0x2592b3[_0xa21a('0x14')]||0x0;this[_0xa21a('0x15')]=0x0;this[_0xa21a('0x16')]=_0xa21a('0xe');this['faxStatusTime']=0x0;this['faxCapacity']=_0x2592b3['faxCapacity']||0x0;this[_0xa21a('0x17')]=0x0;this[_0xa21a('0x18')]='unknown';this['smsStatusTime']=0x0;this['smsCapacity']=_0x2592b3['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']='unknown';this['whatsappStatusTime']=0x0;this[_0xa21a('0x19')]=_0x2592b3[_0xa21a('0x19')]||0x0;this[_0xa21a('0x1a')]=0x0;this['openchannelStatus']=_0xa21a('0xe');this[_0xa21a('0x1b')]=0x0;this[_0xa21a('0x1c')]=_0x2592b3[_0xa21a('0x1c')]||0x0;this[_0xa21a('0x1d')]=0x0;this['busy']=![];this[_0xa21a('0x1e')]=undefined;this[_0xa21a('0x1')]='';this['updateRealtime']();}Agent[_0xa21a('0x1f')][_0xa21a('0x20')]=function(_0x3a9bec){if(this[_0x3a9bec+_0xa21a('0x21')]>0x0){if(this[_0x3a9bec+_0xa21a('0x22')]>0x0&&this[_0x3a9bec+_0xa21a('0x21')]>=this[_0x3a9bec+_0xa21a('0x22')]){return'maxcapacity';}else{return'working';}}else{return'idle';}};Agent['prototype'][_0xa21a('0x23')]=function(){var _0x4de496=[_0xa21a('0x24'),'chat',_0xa21a('0x25'),_0xa21a('0x26'),_0xa21a('0x27'),_0xa21a('0x28')];for(var _0x5b23aa=0x0;_0x5b23aa<_0x4de496[_0xa21a('0x29')];_0x5b23aa+=0x1){var _0x52908a=this['getChannelStatus'](_0x4de496[_0x5b23aa]);if(this[_0x4de496[_0x5b23aa]+_0xa21a('0x2a')]!==_0x52908a){this[_0x4de496[_0x5b23aa]+_0xa21a('0x2b')]=_[_0xa21a('0x2c')](moment()[_0xa21a('0x2d')]('x'));}this[_0x4de496[_0x5b23aa]+'Status']=_0x52908a;}var _0x127549={'id':this['id'],'name':this['name'],'online':this[_0xa21a('0x8')],'voicePause':this[_0xa21a('0x9')],'chatPause':this[_0xa21a('0x2e')],'mailPause':this[_0xa21a('0x2f')],'smsPause':this[_0xa21a('0xb')],'faxPause':this[_0xa21a('0xa')],'openchannelPause':this[_0xa21a('0xc')],'chatStatus':this[_0xa21a('0xd')],'chatStatusTime':this[_0xa21a('0xf')],'chatCapacity':this[_0xa21a('0x10')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xa21a('0x12')],'mailStatusTime':this[_0xa21a('0x13')],'mailCapacity':this[_0xa21a('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xa21a('0x30')],'faxCapacity':this[_0xa21a('0x31')],'faxCurrentCapacity':this[_0xa21a('0x17')],'smsStatus':this[_0xa21a('0x18')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xa21a('0x32')],'smsCurrentCapacity':this[_0xa21a('0x33')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xa21a('0x19')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xa21a('0x34')],'openchannelStatusTime':this[_0xa21a('0x1b')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xa21a('0x1d')],'busy':this[_0xa21a('0x35')],'busyQueue':this[_0xa21a('0x1e')]};var _0x18ea10=md5(JSON[_0xa21a('0x36')](_0x127549));if(this['md5']!==_0x18ea10){this[_0xa21a('0x1')]=_0x18ea10;io['emit'](_0xa21a('0x37'),_0x127549);}};module[_0xa21a('0x38')]=Agent; \ No newline at end of file +var _0x2b84=['working','updateRealtime','mail','chat','openchannel','sms','whatsapp','length','Status','StatusTime','format','chatStatusTime','chatCurrentCapacity','mailStatusTime','faxStatusTime','smsStatus','whatsappStatusTime','stringify','emit','user:save','exports','lodash','moment','ioredis','../../../config/environment','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','unknown','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','CurrentCapacity','Capacity','maxcapacity'];(function(_0x34f0fb,_0x3323b2){var _0x9b7b2b=function(_0x3cca84){while(--_0x3cca84){_0x34f0fb['push'](_0x34f0fb['shift']());}};_0x9b7b2b(++_0x3323b2);}(_0x2b84,0x1ed));var _0x42b8=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x2b84[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x42b8('0x0'));var moment=require(_0x42b8('0x1'));var md5=require('md5');var Redis=require(_0x42b8('0x2'));var config=require(_0x42b8('0x3'));config[_0x42b8('0x4')]=_['defaults'](config[_0x42b8('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x42b8('0x5'))(new Redis(config['redis']));function Agent(_0x87b30){this['id']=_0x87b30['id']||0x0;this[_0x42b8('0x6')]=_0x87b30['name']||'';this['online']=_0x87b30[_0x42b8('0x7')]||!![];this[_0x42b8('0x8')]=_0x87b30[_0x42b8('0x8')]||![];this[_0x42b8('0x9')]=_0x87b30[_0x42b8('0x9')]||![];this['mailPause']=_0x87b30[_0x42b8('0xa')]||![];this[_0x42b8('0xb')]=_0x87b30[_0x42b8('0xb')]||![];this[_0x42b8('0xc')]=_0x87b30[_0x42b8('0xc')]||![];this[_0x42b8('0xd')]=_0x87b30[_0x42b8('0xd')]||![];this[_0x42b8('0xe')]='unknown';this['chatStatusTime']=0x0;this[_0x42b8('0xf')]=_0x87b30[_0x42b8('0xf')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x42b8('0x10')]='unknown';this['mailStatusTime']=0x0;this[_0x42b8('0x11')]=_0x87b30[_0x42b8('0x11')]||0x0;this[_0x42b8('0x12')]=0x0;this[_0x42b8('0x13')]=_0x42b8('0x14');this['faxStatusTime']=0x0;this[_0x42b8('0x15')]=_0x87b30['faxCapacity']||0x0;this[_0x42b8('0x16')]=0x0;this['smsStatus']='unknown';this[_0x42b8('0x17')]=0x0;this[_0x42b8('0x18')]=_0x87b30[_0x42b8('0x18')]||0x0;this[_0x42b8('0x19')]=0x0;this[_0x42b8('0x1a')]=_0x42b8('0x14');this['whatsappStatusTime']=0x0;this[_0x42b8('0x1b')]=_0x87b30['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x42b8('0x1c')]=_0x42b8('0x14');this[_0x42b8('0x1d')]=0x0;this[_0x42b8('0x1e')]=_0x87b30[_0x42b8('0x1e')]||0x0;this[_0x42b8('0x1f')]=0x0;this[_0x42b8('0x20')]=![];this[_0x42b8('0x21')]=undefined;this[_0x42b8('0x22')]='';this['updateRealtime']();}Agent['prototype']['getChannelStatus']=function(_0x161446){if(this[_0x161446+_0x42b8('0x23')]>0x0){if(this[_0x161446+_0x42b8('0x24')]>0x0&&this[_0x161446+_0x42b8('0x23')]>=this[_0x161446+'Capacity']){return _0x42b8('0x25');}else{return _0x42b8('0x26');}}else{return'idle';}};Agent['prototype'][_0x42b8('0x27')]=function(){var _0x38d941=[_0x42b8('0x28'),_0x42b8('0x29'),_0x42b8('0x2a'),'fax',_0x42b8('0x2b'),_0x42b8('0x2c')];for(var _0x3685bc=0x0;_0x3685bc<_0x38d941[_0x42b8('0x2d')];_0x3685bc+=0x1){var _0x37a904=this['getChannelStatus'](_0x38d941[_0x3685bc]);if(this[_0x38d941[_0x3685bc]+_0x42b8('0x2e')]!==_0x37a904){this[_0x38d941[_0x3685bc]+_0x42b8('0x2f')]=_['toNumber'](moment()[_0x42b8('0x30')]('x'));}this[_0x38d941[_0x3685bc]+'Status']=_0x37a904;}var _0x1fd893={'id':this['id'],'name':this[_0x42b8('0x6')],'online':this['online'],'voicePause':this[_0x42b8('0x8')],'chatPause':this['chatPause'],'mailPause':this[_0x42b8('0xa')],'smsPause':this[_0x42b8('0xc')],'faxPause':this[_0x42b8('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x42b8('0xe')],'chatStatusTime':this[_0x42b8('0x31')],'chatCapacity':this[_0x42b8('0xf')],'chatCurrentCapacity':this[_0x42b8('0x32')],'mailStatus':this[_0x42b8('0x10')],'mailStatusTime':this[_0x42b8('0x33')],'mailCapacity':this[_0x42b8('0x11')],'mailCurrentCapacity':this[_0x42b8('0x12')],'faxStatus':this[_0x42b8('0x13')],'faxStatusTime':this[_0x42b8('0x34')],'faxCapacity':this[_0x42b8('0x15')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x42b8('0x35')],'smsStatusTime':this[_0x42b8('0x17')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x42b8('0x19')],'whatsappStatus':this[_0x42b8('0x1a')],'whatsappStatusTime':this[_0x42b8('0x36')],'whatsappCapacity':this[_0x42b8('0x1b')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x42b8('0x1c')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x42b8('0x1e')],'openchannelCurrentCapacity':this[_0x42b8('0x1f')],'busy':this['busy'],'busyQueue':this[_0x42b8('0x21')]};var _0x3abe33=md5(JSON[_0x42b8('0x37')](_0x1fd893));if(this[_0x42b8('0x22')]!==_0x3abe33){this[_0x42b8('0x22')]=_0x3abe33;io[_0x42b8('0x38')](_0x42b8('0x39'),_0x1fd893);}};module[_0x42b8('0x3a')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 5848265..ffab7e1 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 _0x1401=['Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','chatPause','available','stringify','chat:queue:%s','emit','lodash','md5','util','../../../config/environment','redis','localhost','name','timeout','strategy','beepall'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1401,0xbe));var _0x1140=function(_0x220676,_0x105785){_0x220676=_0x220676-0x0;var _0x433dba=_0x1401[_0x220676];return _0x433dba;};'use strict';var _=require(_0x1140('0x0'));var md5=require(_0x1140('0x1'));var util=require(_0x1140('0x2'));var Redis=require('ioredis');var config=require(_0x1140('0x3'));config[_0x1140('0x4')]=_['defaults'](config['redis'],{'host':_0x1140('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x35cdb){this['id']=_0x35cdb['id']||0x0;this['name']=_0x35cdb[_0x1140('0x6')]||'';this[_0x1140('0x7')]=_0x35cdb['timeout']||0xa;this[_0x1140('0x8')]=_0x35cdb[_0x1140('0x8')]||_0x1140('0x9');this[_0x1140('0xa')]=_0x35cdb[_0x1140('0xa')];this[_0x1140('0xb')]={};this['waiting']=0x0;this[_0x1140('0x1')]='';this[_0x1140('0xc')]();this[_0x1140('0xd')]();}ChatQueue[_0x1140('0xe')][_0x1140('0xc')]=function(){var _0x4aabea=this['mapAgentsId'][_0x1140('0xf')];this[_0x1140('0xb')]=_[_0x1140('0x10')](this[_0x1140('0xa')],'id');this['mapAgentsId']['_rr']=_0x4aabea;};ChatQueue['prototype'][_0x1140('0xd')]=function(){this[_0x1140('0x11')]=0x0;this[_0x1140('0x12')]=0x0;for(var _0x3bd6e6=0x0;_0x3bd6e6=0x0?this[_0x1140('0x15')]:0x0;var _0x449c21={'id':this['id'],'available':this[_0x1140('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x1140('0x6')],'paused':this[_0x1140('0x12')],'waiting':this['waiting']};var _0x11fc12=md5(JSON[_0x1140('0x16')](_0x449c21));if(this['md5']!==_0x11fc12){this[_0x1140('0x1')]=_0x11fc12;io['to'](util['format'](_0x1140('0x17'),_0x449c21['name']))[_0x1140('0x18')]('chat_queue:save',_0x449c21);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x6979=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','map','_rr','prototype','paused','online','chatPause','available','loggedIn','stringify','chat:queue:%s','chat_queue:save','util','ioredis'];(function(_0x3ea3ae,_0x29dd29){var _0x2aa587=function(_0x1d6dca){while(--_0x1d6dca){_0x3ea3ae['push'](_0x3ea3ae['shift']());}};_0x2aa587(++_0x29dd29);}(_0x6979,0x66));var _0x9697=function(_0x50709f,_0x471e8a){_0x50709f=_0x50709f-0x0;var _0x8cfd9=_0x6979[_0x50709f];return _0x8cfd9;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x9697('0x0'));var Redis=require(_0x9697('0x1'));var config=require('../../../config/environment');config[_0x9697('0x2')]=_['defaults'](config[_0x9697('0x2')],{'host':_0x9697('0x3'),'port':0x18eb});var io=require(_0x9697('0x4'))(new Redis(config[_0x9697('0x2')]));function ChatQueue(_0x68e547){this['id']=_0x68e547['id']||0x0;this[_0x9697('0x5')]=_0x68e547['name']||'';this[_0x9697('0x6')]=_0x68e547['timeout']||0xa;this[_0x9697('0x7')]=_0x68e547[_0x9697('0x7')]||_0x9697('0x8');this[_0x9697('0x9')]=_0x68e547['Agents'];this[_0x9697('0xa')]={};this[_0x9697('0xb')]=0x0;this[_0x9697('0xc')]='';this[_0x9697('0xd')]();this[_0x9697('0xe')]();}ChatQueue['prototype'][_0x9697('0xd')]=function(){var _0x2cb8bc=this['mapAgentsId']['_rr'];this[_0x9697('0xa')]=_[_0x9697('0xf')](this[_0x9697('0x9')],'id');this[_0x9697('0xa')][_0x9697('0x10')]=_0x2cb8bc;};ChatQueue[_0x9697('0x11')][_0x9697('0xe')]=function(){this['loggedIn']=0x0;this[_0x9697('0x12')]=0x0;for(var _0x5c5047=0x0;_0x5c5047=0x0?this[_0x9697('0x15')]:0x0;var _0x31de1f={'id':this['id'],'available':this[_0x9697('0x15')],'loggedIn':this[_0x9697('0x16')],'name':this[_0x9697('0x5')],'paused':this[_0x9697('0x12')],'waiting':this[_0x9697('0xb')]};var _0x42eb86=md5(JSON[_0x9697('0x17')](_0x31de1f));if(this[_0x9697('0xc')]!==_0x42eb86){this['md5']=_0x42eb86;io['to'](util['format'](_0x9697('0x18'),_0x31de1f['name']))['emit'](_0x9697('0x19'),_0x31de1f);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 0f77215..bf8a46f 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 _0xf5b5=['paused','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','_rr','mapAgentsId','loggedIn','faxPause','available'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xf5b5,0xa2));var _0x5f5b=function(_0x32e082,_0x563537){_0x32e082=_0x32e082-0x0;var _0x5138a4=_0xf5b5[_0x32e082];return _0x5138a4;};'use strict';var _=require(_0x5f5b('0x0'));var md5=require(_0x5f5b('0x1'));var util=require(_0x5f5b('0x2'));var Redis=require(_0x5f5b('0x3'));var config=require(_0x5f5b('0x4'));config[_0x5f5b('0x5')]=_['defaults'](config[_0x5f5b('0x5')],{'host':_0x5f5b('0x6'),'port':0x18eb});var io=require(_0x5f5b('0x7'))(new Redis(config[_0x5f5b('0x5')]));function FaxQueue(_0x5899e9){this['id']=_0x5899e9['id']||0x0;this[_0x5f5b('0x8')]=_0x5899e9['name']||'';this['timeout']=_0x5899e9['timeout']||0xa;this[_0x5f5b('0x9')]=_0x5899e9[_0x5f5b('0x9')]||_0x5f5b('0xa');this['Agents']=_0x5899e9[_0x5f5b('0xb')];this['mapAgentsId']={};this[_0x5f5b('0xc')]=0x0;this[_0x5f5b('0x1')]='';this[_0x5f5b('0xd')]();this[_0x5f5b('0xe')]();}FaxQueue['prototype'][_0x5f5b('0xd')]=function(){var _0x36acf9=this['mapAgentsId'][_0x5f5b('0xf')];this[_0x5f5b('0x10')]=_['map'](this[_0x5f5b('0xb')],'id');this['mapAgentsId'][_0x5f5b('0xf')]=_0x36acf9;};FaxQueue['prototype']['updateRealtime']=function(){this[_0x5f5b('0x11')]=0x0;this['paused']=0x0;for(var _0x1605e4=0x0;_0x1605e4=0x0?this['available']:0x0;var _0x3e6a75={'id':this['id'],'available':this[_0x5f5b('0x13')],'loggedIn':this['loggedIn'],'name':this[_0x5f5b('0x8')],'paused':this[_0x5f5b('0x14')],'waiting':this[_0x5f5b('0xc')]};var _0x186afc=md5(JSON[_0x5f5b('0x15')](_0x3e6a75));if(this['md5']!==_0x186afc){this[_0x5f5b('0x1')]=_0x186afc;io['to'](util[_0x5f5b('0x16')](_0x5f5b('0x17'),_0x3e6a75['name']))['emit'](_0x5f5b('0x18'),_0x3e6a75);}};module[_0x5f5b('0x19')]=FaxQueue; \ No newline at end of file +var _0x232c=['loggedIn','length','online','faxPause','paused','available','stringify','format','fax:queue:%s','emit','fax_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x232c,0x1af));var _0xc232=function(_0x249249,_0x55290e){_0x249249=_0x249249-0x0;var _0xdbe04b=_0x232c[_0x249249];return _0xdbe04b;};'use strict';var _=require(_0xc232('0x0'));var md5=require(_0xc232('0x1'));var util=require(_0xc232('0x2'));var Redis=require(_0xc232('0x3'));var config=require(_0xc232('0x4'));config[_0xc232('0x5')]=_[_0xc232('0x6')](config[_0xc232('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xc232('0x7'))(new Redis(config[_0xc232('0x5')]));function FaxQueue(_0x1dfa6d){this['id']=_0x1dfa6d['id']||0x0;this[_0xc232('0x8')]=_0x1dfa6d[_0xc232('0x8')]||'';this[_0xc232('0x9')]=_0x1dfa6d['timeout']||0xa;this[_0xc232('0xa')]=_0x1dfa6d['strategy']||_0xc232('0xb');this[_0xc232('0xc')]=_0x1dfa6d[_0xc232('0xc')];this[_0xc232('0xd')]={};this[_0xc232('0xe')]=0x0;this[_0xc232('0x1')]='';this['updateRouting']();this[_0xc232('0xf')]();}FaxQueue[_0xc232('0x10')]['updateRouting']=function(){var _0x300500=this[_0xc232('0xd')][_0xc232('0x11')];this[_0xc232('0xd')]=_[_0xc232('0x12')](this[_0xc232('0xc')],'id');this[_0xc232('0xd')][_0xc232('0x11')]=_0x300500;};FaxQueue[_0xc232('0x10')][_0xc232('0xf')]=function(){this[_0xc232('0x13')]=0x0;this['paused']=0x0;for(var _0x16b564=0x0;_0x16b564=0x0?this['available']:0x0;var _0x2324da={'id':this['id'],'available':this[_0xc232('0x18')],'loggedIn':this[_0xc232('0x13')],'name':this[_0xc232('0x8')],'paused':this[_0xc232('0x17')],'waiting':this[_0xc232('0xe')]};var _0x3109a8=md5(JSON[_0xc232('0x19')](_0x2324da));if(this[_0xc232('0x1')]!==_0x3109a8){this[_0xc232('0x1')]=_0x3109a8;io['to'](util[_0xc232('0x1a')](_0xc232('0x1b'),_0x2324da[_0xc232('0x8')]))[_0xc232('0x1c')](_0xc232('0x1d'),_0x2324da);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 8cb7e50..0fe8ad0 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 _0x3f77=['Intervals','exports','name'];(function(_0x2f24d0,_0x12efce){var _0x2f89fe=function(_0x4d7858){while(--_0x4d7858){_0x2f24d0['push'](_0x2f24d0['shift']());}};_0x2f89fe(++_0x12efce);}(_0x3f77,0x11c));var _0x73f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f77[_0x3dd15e];return _0x231fd0;};'use strict';function Interval(_0x29e4ad){this['id']=_0x29e4ad['id']||0x0;this['name']=_0x29e4ad[_0x73f7('0x0')]||'';this['Intervals']=_0x29e4ad[_0x73f7('0x1')]||{};}module[_0x73f7('0x2')]=Interval; \ No newline at end of file +var _0xce5c=['name','Intervals','exports'];(function(_0x51f2c0,_0xb7c46e){var _0x34ffd5=function(_0x2238c0){while(--_0x2238c0){_0x51f2c0['push'](_0x51f2c0['shift']());}};_0x34ffd5(++_0xb7c46e);}(_0xce5c,0x1e6));var _0xcce5=function(_0x3b4b1d,_0x15029e){_0x3b4b1d=_0x3b4b1d-0x0;var _0x488c36=_0xce5c[_0x3b4b1d];return _0x488c36;};'use strict';function Interval(_0x2e89a5){this['id']=_0x2e89a5['id']||0x0;this[_0xcce5('0x0')]=_0x2e89a5[_0xcce5('0x0')]||'';this[_0xcce5('0x1')]=_0x2e89a5[_0xcce5('0x1')]||{};}module[_0xcce5('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 3245386..f304a4e 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 _0x408f=['redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','paused','length','loggedIn','mailPause','available','stringify','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x45ade7,_0x237b70){var _0x4d70ce=function(_0x534690){while(--_0x534690){_0x45ade7['push'](_0x45ade7['shift']());}};_0x4d70ce(++_0x237b70);}(_0x408f,0xdb));var _0xf408=function(_0x3c75c2,_0x1daec2){_0x3c75c2=_0x3c75c2-0x0;var _0x700e18=_0x408f[_0x3c75c2];return _0x700e18;};'use strict';var _=require(_0xf408('0x0'));var md5=require(_0xf408('0x1'));var util=require(_0xf408('0x2'));var Redis=require(_0xf408('0x3'));var config=require(_0xf408('0x4'));config[_0xf408('0x5')]=_[_0xf408('0x6')](config[_0xf408('0x5')],{'host':_0xf408('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf408('0x5')]));function MailQueue(_0x23f53f){this['id']=_0x23f53f['id']||0x0;this[_0xf408('0x8')]=_0x23f53f['name']||'';this['timeout']=_0x23f53f[_0xf408('0x9')]||0xa;this['strategy']=_0x23f53f[_0xf408('0xa')]||'beepall';this[_0xf408('0xb')]=_0x23f53f[_0xf408('0xb')];this[_0xf408('0xc')]={};this[_0xf408('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0xf408('0xe')]();}MailQueue[_0xf408('0xf')]['updateRouting']=function(){var _0x822435=this['mapAgentsId'][_0xf408('0x10')];this[_0xf408('0xc')]=_[_0xf408('0x11')](this['Agents'],'id');this['mapAgentsId'][_0xf408('0x10')]=_0x822435;};MailQueue['prototype'][_0xf408('0xe')]=function(){this['loggedIn']=0x0;this[_0xf408('0x12')]=0x0;for(var _0x24a941=0x0;_0x24a941=0x0?this[_0xf408('0x16')]:0x0;var _0x3f9761={'id':this['id'],'available':this[_0xf408('0x16')],'loggedIn':this[_0xf408('0x14')],'name':this[_0xf408('0x8')],'paused':this[_0xf408('0x12')],'waiting':this[_0xf408('0xd')]};var _0x57556f=md5(JSON[_0xf408('0x17')](_0x3f9761));if(this['md5']!==_0x57556f){this[_0xf408('0x1')]=_0x57556f;io['to'](util['format'](_0xf408('0x18'),_0x3f9761[_0xf408('0x8')]))[_0xf408('0x19')](_0xf408('0x1a'),_0x3f9761);}};module[_0xf408('0x1b')]=MailQueue; \ No newline at end of file +var _0x7293=['map','prototype','length','online','loggedIn','mailPause','paused','available','waiting','stringify','format','mail:queue:%s','mail_queue:save','exports','md5','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr'];(function(_0x5af3e6,_0x107d87){var _0x330ffb=function(_0x38041c){while(--_0x38041c){_0x5af3e6['push'](_0x5af3e6['shift']());}};_0x330ffb(++_0x107d87);}(_0x7293,0x196));var _0x3729=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7293[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var md5=require(_0x3729('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x3729('0x1'));config[_0x3729('0x2')]=_['defaults'](config[_0x3729('0x2')],{'host':_0x3729('0x3'),'port':0x18eb});var io=require(_0x3729('0x4'))(new Redis(config[_0x3729('0x2')]));function MailQueue(_0x25eb6f){this['id']=_0x25eb6f['id']||0x0;this[_0x3729('0x5')]=_0x25eb6f[_0x3729('0x5')]||'';this[_0x3729('0x6')]=_0x25eb6f[_0x3729('0x6')]||0xa;this[_0x3729('0x7')]=_0x25eb6f[_0x3729('0x7')]||_0x3729('0x8');this[_0x3729('0x9')]=_0x25eb6f[_0x3729('0x9')];this[_0x3729('0xa')]={};this['waiting']=0x0;this[_0x3729('0x0')]='';this[_0x3729('0xb')]();this[_0x3729('0xc')]();}MailQueue['prototype'][_0x3729('0xb')]=function(){var _0x394040=this['mapAgentsId'][_0x3729('0xd')];this[_0x3729('0xa')]=_[_0x3729('0xe')](this[_0x3729('0x9')],'id');this[_0x3729('0xa')][_0x3729('0xd')]=_0x394040;};MailQueue[_0x3729('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x436e6c=0x0;_0x436e6c=0x0?this[_0x3729('0x15')]:0x0;var _0x4ed3dd={'id':this['id'],'available':this[_0x3729('0x15')],'loggedIn':this[_0x3729('0x12')],'name':this[_0x3729('0x5')],'paused':this['paused'],'waiting':this[_0x3729('0x16')]};var _0x26116f=md5(JSON[_0x3729('0x17')](_0x4ed3dd));if(this['md5']!==_0x26116f){this[_0x3729('0x0')]=_0x26116f;io['to'](util[_0x3729('0x18')](_0x3729('0x19'),_0x4ed3dd[_0x3729('0x5')]))['emit'](_0x3729('0x1a'),_0x4ed3dd);}};module[_0x3729('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index f558d46..126c786 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 _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(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0x1261,0x144));var _0x1126=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x1261[_0xbeb808];return _0x5d6909;};'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 +var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x53e19d,_0x604957){var _0x5ba332=function(_0x34f66e){while(--_0x34f66e){_0x53e19d['push'](_0x53e19d['shift']());}};_0x5ba332(++_0x604957);}(_0xadb5,0xad));var _0x5adb=function(_0x39ce40,_0x357255){_0x39ce40=_0x39ce40-0x0;var _0x5d00c6=_0xadb5[_0x39ce40];return _0x5d00c6;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 526ee1a..6c5ec0b 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 _0x6b19=['mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','online','smsPause','available','stringify','format','sms:queue:%s','sms_queue:save','exports','lodash','md5','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x6b19,0xe8));var _0x96b1=function(_0x1e31fa,_0x5374a5){_0x1e31fa=_0x1e31fa-0x0;var _0x4fc7a3=_0x6b19[_0x1e31fa];return _0x4fc7a3;};'use strict';var _=require(_0x96b1('0x0'));var md5=require(_0x96b1('0x1'));var util=require('util');var Redis=require(_0x96b1('0x2'));var config=require('../../../config/environment');config['redis']=_[_0x96b1('0x3')](config[_0x96b1('0x4')],{'host':_0x96b1('0x5'),'port':0x18eb});var io=require(_0x96b1('0x6'))(new Redis(config[_0x96b1('0x4')]));function SmsQueue(_0x55e8fa){this['id']=_0x55e8fa['id']||0x0;this[_0x96b1('0x7')]=_0x55e8fa['name']||'';this[_0x96b1('0x8')]=_0x55e8fa['timeout']||0xa;this['strategy']=_0x55e8fa[_0x96b1('0x9')]||'beepall';this[_0x96b1('0xa')]=_0x55e8fa['Agents'];this[_0x96b1('0xb')]={};this[_0x96b1('0xc')]=0x0;this[_0x96b1('0x1')]='';this[_0x96b1('0xd')]();this[_0x96b1('0xe')]();}SmsQueue[_0x96b1('0xf')][_0x96b1('0xd')]=function(){var _0x5a87f3=this['mapAgentsId'][_0x96b1('0x10')];this['mapAgentsId']=_['map'](this[_0x96b1('0xa')],'id');this[_0x96b1('0xb')][_0x96b1('0x10')]=_0x5a87f3;};SmsQueue['prototype'][_0x96b1('0xe')]=function(){this[_0x96b1('0x11')]=0x0;this[_0x96b1('0x12')]=0x0;for(var _0x2119b1=0x0;_0x2119b1=0x0?this[_0x96b1('0x15')]:0x0;var _0x2b192a={'id':this['id'],'available':this[_0x96b1('0x15')],'loggedIn':this[_0x96b1('0x11')],'name':this['name'],'paused':this[_0x96b1('0x12')],'waiting':this['waiting']};var _0x33ac6d=md5(JSON[_0x96b1('0x16')](_0x2b192a));if(this[_0x96b1('0x1')]!==_0x33ac6d){this['md5']=_0x33ac6d;io['to'](util[_0x96b1('0x17')](_0x96b1('0x18'),_0x2b192a[_0x96b1('0x7')]))['emit'](_0x96b1('0x19'),_0x2b192a);}};module[_0x96b1('0x1a')]=SmsQueue; \ No newline at end of file +var _0x3e5c=['waiting','updateRouting','prototype','map','_rr','length','loggedIn','smsPause','paused','available','format','sms:queue:%s','sms_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x10e70d,_0x369bec){_0x10e70d=_0x10e70d-0x0;var _0x353b49=_0x3e5c[_0x10e70d];return _0x353b49;};'use strict';var _=require(_0xc3e5('0x0'));var md5=require(_0xc3e5('0x1'));var util=require(_0xc3e5('0x2'));var Redis=require(_0xc3e5('0x3'));var config=require('../../../config/environment');config[_0xc3e5('0x4')]=_[_0xc3e5('0x5')](config[_0xc3e5('0x4')],{'host':_0xc3e5('0x6'),'port':0x18eb});var io=require(_0xc3e5('0x7'))(new Redis(config[_0xc3e5('0x4')]));function SmsQueue(_0x4cb0db){this['id']=_0x4cb0db['id']||0x0;this[_0xc3e5('0x8')]=_0x4cb0db[_0xc3e5('0x8')]||'';this[_0xc3e5('0x9')]=_0x4cb0db[_0xc3e5('0x9')]||0xa;this[_0xc3e5('0xa')]=_0x4cb0db['strategy']||_0xc3e5('0xb');this[_0xc3e5('0xc')]=_0x4cb0db[_0xc3e5('0xc')];this[_0xc3e5('0xd')]={};this[_0xc3e5('0xe')]=0x0;this[_0xc3e5('0x1')]='';this[_0xc3e5('0xf')]();this['updateRealtime']();}SmsQueue[_0xc3e5('0x10')][_0xc3e5('0xf')]=function(){var _0x26985c=this[_0xc3e5('0xd')]['_rr'];this[_0xc3e5('0xd')]=_[_0xc3e5('0x11')](this[_0xc3e5('0xc')],'id');this[_0xc3e5('0xd')][_0xc3e5('0x12')]=_0x26985c;};SmsQueue[_0xc3e5('0x10')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x27c226=0x0;_0x27c226=0x0?this[_0xc3e5('0x17')]:0x0;var _0x1e884a={'id':this['id'],'available':this[_0xc3e5('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xc3e5('0x8')],'paused':this[_0xc3e5('0x16')],'waiting':this['waiting']};var _0x1d0c5a=md5(JSON['stringify'](_0x1e884a));if(this[_0xc3e5('0x1')]!==_0x1d0c5a){this[_0xc3e5('0x1')]=_0x1d0c5a;io['to'](util[_0xc3e5('0x18')](_0xc3e5('0x19'),_0x1e884a[_0xc3e5('0x8')]))['emit'](_0xc3e5('0x1a'),_0x1e884a);}};module[_0xc3e5('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 7c76c66..d5168f2 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 _0xca23=['md5','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','updateRouting','_rr','mapAgentsId','map','updateRealtime','loggedIn','paused','online','whatsappPause','available','waiting','stringify','format','emit','whatsapp_queue:save'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0xca23,0xa8));var _0x3ca2=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xca23[_0x11005e];return _0x29338f;};'use strict';var _=require('lodash');var md5=require(_0x3ca2('0x0'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x3ca2('0x1')](config[_0x3ca2('0x2')],{'host':_0x3ca2('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3ca2('0x2')]));function WhatsappQueue(_0x18431e){this['id']=_0x18431e['id']||0x0;this[_0x3ca2('0x4')]=_0x18431e[_0x3ca2('0x4')]||'';this[_0x3ca2('0x5')]=_0x18431e['timeout']||0xa;this[_0x3ca2('0x6')]=_0x18431e[_0x3ca2('0x6')]||_0x3ca2('0x7');this['Agents']=_0x18431e[_0x3ca2('0x8')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x3ca2('0x9')]();this['updateRealtime']();}WhatsappQueue['prototype'][_0x3ca2('0x9')]=function(){var _0x10c479=this['mapAgentsId'][_0x3ca2('0xa')];this[_0x3ca2('0xb')]=_[_0x3ca2('0xc')](this['Agents'],'id');this[_0x3ca2('0xb')][_0x3ca2('0xa')]=_0x10c479;};WhatsappQueue['prototype'][_0x3ca2('0xd')]=function(){this[_0x3ca2('0xe')]=0x0;this[_0x3ca2('0xf')]=0x0;for(var _0x4fb22f=0x0;_0x4fb22f=0x0?this[_0x3ca2('0x12')]:0x0;var _0x23c77a={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3ca2('0xe')],'name':this[_0x3ca2('0x4')],'paused':this[_0x3ca2('0xf')],'waiting':this[_0x3ca2('0x13')]};var _0x42fe47=md5(JSON[_0x3ca2('0x14')](_0x23c77a));if(this['md5']!==_0x42fe47){this[_0x3ca2('0x0')]=_0x42fe47;io['to'](util[_0x3ca2('0x15')]('whatsapp:queue:%s',_0x23c77a['name']))[_0x3ca2('0x16')](_0x3ca2('0x17'),_0x23c77a);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x0300=['length','online','whatsappPause','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused'];(function(_0x305da2,_0x10d5df){var _0x2b5102=function(_0x3c271f){while(--_0x3c271f){_0x305da2['push'](_0x305da2['shift']());}};_0x2b5102(++_0x10d5df);}(_0x0300,0x10e));var _0x0030=function(_0x2973a7,_0x1fd1e4){_0x2973a7=_0x2973a7-0x0;var _0x162a04=_0x0300[_0x2973a7];return _0x162a04;};'use strict';var _=require('lodash');var md5=require(_0x0030('0x0'));var util=require('util');var Redis=require(_0x0030('0x1'));var config=require('../../../config/environment');config[_0x0030('0x2')]=_[_0x0030('0x3')](config['redis'],{'host':_0x0030('0x4'),'port':0x18eb});var io=require(_0x0030('0x5'))(new Redis(config[_0x0030('0x2')]));function WhatsappQueue(_0x50e943){this['id']=_0x50e943['id']||0x0;this[_0x0030('0x6')]=_0x50e943[_0x0030('0x6')]||'';this[_0x0030('0x7')]=_0x50e943['timeout']||0xa;this[_0x0030('0x8')]=_0x50e943['strategy']||_0x0030('0x9');this['Agents']=_0x50e943[_0x0030('0xa')];this[_0x0030('0xb')]={};this[_0x0030('0xc')]=0x0;this[_0x0030('0x0')]='';this[_0x0030('0xd')]();this[_0x0030('0xe')]();}WhatsappQueue['prototype'][_0x0030('0xd')]=function(){var _0x4d2cd4=this[_0x0030('0xb')][_0x0030('0xf')];this[_0x0030('0xb')]=_[_0x0030('0x10')](this[_0x0030('0xa')],'id');this[_0x0030('0xb')][_0x0030('0xf')]=_0x4d2cd4;};WhatsappQueue[_0x0030('0x11')]['updateRealtime']=function(){this[_0x0030('0x12')]=0x0;this[_0x0030('0x13')]=0x0;for(var _0x16871e=0x0;_0x16871e=0x0?this[_0x0030('0x17')]:0x0;var _0x8ce6fd={'id':this['id'],'available':this[_0x0030('0x17')],'loggedIn':this[_0x0030('0x12')],'name':this[_0x0030('0x6')],'paused':this[_0x0030('0x13')],'waiting':this['waiting']};var _0x588bb3=md5(JSON[_0x0030('0x18')](_0x8ce6fd));if(this[_0x0030('0x0')]!==_0x588bb3){this[_0x0030('0x0')]=_0x588bb3;io['to'](util['format'](_0x0030('0x19'),_0x8ce6fd['name']))[_0x0030('0x1a')](_0x0030('0x1b'),_0x8ce6fd);}};module[_0x0030('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 89259ae..716a07e 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(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x384ba1,_0x2a24d8){var _0x5db9de=function(_0x1a8922){while(--_0x1a8922){_0x384ba1['push'](_0x384ba1['shift']());}};_0x5db9de(++_0x2a24d8);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a7874,_0x5464ed){_0x4a7874=_0x4a7874-0x0;var _0x336b94=_0xb10b[_0x4a7874];return _0x336b94;};'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 974211b..471c8d5 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 _0x42d2=['Request','AddTagsToChatInteraction','../client','update','UpdateChatInteraction'];(function(_0x578d47,_0x30ba49){var _0x2f6ca8=function(_0x78f0b4){while(--_0x78f0b4){_0x578d47['push'](_0x578d47['shift']());}};_0x2f6ca8(++_0x30ba49);}(_0x42d2,0x10b));var _0x242d=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x42d2[_0x1b5aea];return _0x15cfc6;};'use strict';var client=require(_0x242d('0x0'));exports[_0x242d('0x1')]=function(_0x1da044,_0x40ef6f){return client['Request'](_0x242d('0x2'),{'body':_0x40ef6f,'options':{'where':{'id':_0x1da044}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x569ea2,_0x573fe6){return client[_0x242d('0x3')](_0x242d('0x4'),{'body':_0x573fe6,'options':{'where':{'id':_0x569ea2}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x36a5=['AddTagsToChatInteraction','addTagsToChatInteraction','update','Request','updateChatInteraction','addTags'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x36a5,0x18e));var _0x536a=function(_0x17e47d,_0x14a471){_0x17e47d=_0x17e47d-0x0;var _0x324ea9=_0x36a5[_0x17e47d];return _0x324ea9;};'use strict';var client=require('../client');exports[_0x536a('0x0')]=function(_0x368fd0,_0xccd562){return client[_0x536a('0x1')]('UpdateChatInteraction',{'body':_0xccd562,'options':{'where':{'id':_0x368fd0}},'log':_0x536a('0x2')});};exports[_0x536a('0x3')]=function(_0x5e4c38,_0x4f5e53){return client['Request'](_0x536a('0x4'),{'body':_0x4f5e53,'options':{'where':{'id':_0x5e4c38}},'log':_0x536a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index cdd40df..a8af072 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 _0xbb46=['CreateChatMessage','createChatMessage','../client','create'];(function(_0x26c127,_0x1ef1e5){var _0x4b50cb=function(_0x14db56){while(--_0x14db56){_0x26c127['push'](_0x26c127['shift']());}};_0x4b50cb(++_0x1ef1e5);}(_0xbb46,0xf6));var _0x6bb4=function(_0x1ef2e7,_0x5404db){_0x1ef2e7=_0x1ef2e7-0x0;var _0x1cc129=_0xbb46[_0x1ef2e7];return _0x1cc129;};'use strict';var client=require(_0x6bb4('0x0'));exports[_0x6bb4('0x1')]=function(_0x4859f4){return client['Request'](_0x6bb4('0x2'),{'body':_0x4859f4,'log':_0x6bb4('0x3')});}; \ No newline at end of file +var _0x2eb2=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x3b7fdf,_0x10451d){var _0x2ad958=function(_0x4aa0a7){while(--_0x4aa0a7){_0x3b7fdf['push'](_0x3b7fdf['shift']());}};_0x2ad958(++_0x10451d);}(_0x2eb2,0x1ea));var _0x22eb=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x2eb2[_0x2b7764];return _0x848dcb;};'use strict';var client=require(_0x22eb('0x0'));exports[_0x22eb('0x1')]=function(_0x1a3aab){return client[_0x22eb('0x2')](_0x22eb('0x3'),{'body':_0x1a3aab,'log':_0x22eb('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index c72d748..1b98930 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 _0x5395=['online','chatPause','getChatQueues','../client','Request','timeout','strategy','User','name'];(function(_0xd43124,_0x38eb34){var _0x10796b=function(_0x273d93){while(--_0x273d93){_0xd43124['push'](_0xd43124['shift']());}};_0x10796b(++_0x38eb34);}(_0x5395,0x150));var _0x5539=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5395[_0x57b54c];return _0x59cc19;};'use strict';var client=require(_0x5539('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x5539('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id','name',_0x5539('0x2'),_0x5539('0x3')],'include':[{'model':_0x5539('0x4'),'as':'Agents','attributes':['id',_0x5539('0x5'),_0x5539('0x6'),_0x5539('0x7')]}]},'log':_0x5539('0x8')});};}; \ No newline at end of file +var _0x23f4=['timeout','strategy','User','Agents','online','chatPause','getChatQueues','name'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x23f4,0x1ee));var _0x423f=function(_0x296fdb,_0x60db51){_0x296fdb=_0x296fdb-0x0;var _0x38232e=_0x23f4[_0x296fdb];return _0x38232e;};'use strict';var client=require('../client');exports[_0x423f('0x0')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x423f('0x1'),_0x423f('0x2'),_0x423f('0x3')],'include':[{'model':_0x423f('0x4'),'as':_0x423f('0x5'),'attributes':['id',_0x423f('0x1'),_0x423f('0x6'),_0x423f('0x7')]}]},'log':_0x423f('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 1bd0800..56bde65 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 _0x86dd=['UpdateChatQueueReport','DESC','create','Request','CreateChatQueueReport','update'];(function(_0x38da13,_0x39c817){var _0x241374=function(_0x4cd1cc){while(--_0x4cd1cc){_0x38da13['push'](_0x38da13['shift']());}};_0x241374(++_0x39c817);}(_0x86dd,0x1ee));var _0xd86d=function(_0x20b50f,_0x1d636a){_0x20b50f=_0x20b50f-0x0;var _0x12b9ae=_0x86dd[_0x20b50f];return _0x12b9ae;};'use strict';var client=require('../client');exports[_0xd86d('0x0')]=function(_0x52e445){return client[_0xd86d('0x1')](_0xd86d('0x2'),{'body':_0x52e445,'log':_0xd86d('0x2')});};exports[_0xd86d('0x3')]=function(_0x17237d,_0x30a31c){return client[_0xd86d('0x1')](_0xd86d('0x4'),{'body':_0x30a31c,'options':{'where':{'uniqueid':_0x17237d},'order':[['id',_0xd86d('0x5')]],'limit':0x1},'log':_0xd86d('0x4')});}; \ No newline at end of file +var _0x0a12=['CreateChatQueueReport','Request','UpdateChatQueueReport','DESC','create'];(function(_0x363b81,_0x81e6ca){var _0x1d92fb=function(_0x129644){while(--_0x129644){_0x363b81['push'](_0x363b81['shift']());}};_0x1d92fb(++_0x81e6ca);}(_0x0a12,0xb8));var _0x20a1=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x0a12[_0x4d8ed9];return _0x1e2140;};'use strict';var client=require('../client');exports[_0x20a1('0x0')]=function(_0x4bd998){return client['Request']('CreateChatQueueReport',{'body':_0x4bd998,'log':_0x20a1('0x1')});};exports['update']=function(_0x3fe991,_0x2079d8){return client[_0x20a1('0x2')](_0x20a1('0x3'),{'body':_0x2079d8,'options':{'where':{'uniqueid':_0x3fe991},'order':[['id',_0x20a1('0x4')]],'limit':0x1},'log':_0x20a1('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index db9d52d..0d77bd2 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x3b56c0,_0xe100d8){var _0x377efe=function(_0x181589){while(--_0x181589){_0x3b56c0['push'](_0x3b56c0['shift']());}};_0x377efe(++_0xe100d8);}(_0x7a54,0x106));var _0x47a5=function(_0x5d8372,_0x51f011){_0x5d8372=_0x5d8372-0x0;var _0x500a0d=_0x7a54[_0x5d8372];return _0x500a0d;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x503c61,_0xbbc8ac){var _0x61a262=function(_0x3c760d){while(--_0x3c760d){_0x503c61['push'](_0x503c61['shift']());}};_0x61a262(++_0xbbc8ac);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index b90425c..dc5af3f 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 _0xf65a=['../client','create','CreateFaxMessage','createFaxMessage'];(function(_0x3cae18,_0x1c8c40){var _0x5847b7=function(_0x49ab9b){while(--_0x49ab9b){_0x3cae18['push'](_0x3cae18['shift']());}};_0x5847b7(++_0x1c8c40);}(_0xf65a,0x1c8));var _0xaf65=function(_0x124218,_0x5a388d){_0x124218=_0x124218-0x0;var _0x57a457=_0xf65a[_0x124218];return _0x57a457;};'use strict';var client=require(_0xaf65('0x0'));exports[_0xaf65('0x1')]=function(_0x1623d7){return client['Request'](_0xaf65('0x2'),{'body':_0x1623d7,'log':_0xaf65('0x3')});}; \ No newline at end of file +var _0x0f4a=['CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x207d2f,_0x44400f){var _0x3c3498=function(_0x57fdfb){while(--_0x57fdfb){_0x207d2f['push'](_0x207d2f['shift']());}};_0x3c3498(++_0x44400f);}(_0x0f4a,0x7a));var _0xa0f4=function(_0x5ed624,_0x322f34){_0x5ed624=_0x5ed624-0x0;var _0x59bfba=_0x0f4a[_0x5ed624];return _0x59bfba;};'use strict';var client=require(_0xa0f4('0x0'));exports[_0xa0f4('0x1')]=function(_0xb734b0){return client['Request'](_0xa0f4('0x2'),{'body':_0xb734b0,'log':_0xa0f4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 49c027f..7908e5f 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 _0x3620=['User','Agents','name','online','getFaxQueues','Request','GetFaxQueue','timeout','strategy'];(function(_0x616077,_0x4bb3ed){var _0x11967f=function(_0x9dbae4){while(--_0x9dbae4){_0x616077['push'](_0x616077['shift']());}};_0x11967f(++_0x4bb3ed);}(_0x3620,0x82));var _0x0362=function(_0x20d2ed,_0x49a15e){_0x20d2ed=_0x20d2ed-0x0;var _0x536dc4=_0x3620[_0x20d2ed];return _0x536dc4;};'use strict';var client=require('../client');exports[_0x0362('0x0')]=function(){return function(){return client[_0x0362('0x1')](_0x0362('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0362('0x3'),_0x0362('0x4')],'include':[{'model':_0x0362('0x5'),'as':_0x0362('0x6'),'attributes':['id',_0x0362('0x7'),_0x0362('0x8'),'faxPause']}]},'log':_0x0362('0x0')});};}; \ No newline at end of file +var _0x2bf6=['faxPause','getFaxQueues','../client','Request','name','timeout','strategy','User','Agents','online'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2bf6,0x188));var _0x62bf=function(_0x2b1afd,_0x3183fe){_0x2b1afd=_0x2b1afd-0x0;var _0x1ae22b=_0x2bf6[_0x2b1afd];return _0x1ae22b;};'use strict';var client=require(_0x62bf('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x62bf('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x62bf('0x2'),_0x62bf('0x3'),_0x62bf('0x4')],'include':[{'model':_0x62bf('0x5'),'as':_0x62bf('0x6'),'attributes':['id','name',_0x62bf('0x7'),_0x62bf('0x8')]}]},'log':_0x62bf('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 7dd368a..4dbdda8 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 _0x4cd9=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x4cd9,0x13c));var _0x94cd=function(_0x47199b,_0x16e824){_0x47199b=_0x47199b-0x0;var _0x390911=_0x4cd9[_0x47199b];return _0x390911;};'use strict';var client=require(_0x94cd('0x0'));exports[_0x94cd('0x1')]=function(_0x34f1b8){return client[_0x94cd('0x2')](_0x94cd('0x3'),{'body':_0x34f1b8,'log':_0x94cd('0x3')});};exports[_0x94cd('0x4')]=function(_0x5aade8,_0x5c6866){return client['Request'](_0x94cd('0x5'),{'body':_0x5c6866,'options':{'where':{'uniqueid':_0x5aade8},'order':[['id',_0x94cd('0x6')]],'limit':0x1},'log':_0x94cd('0x5')});}; \ No newline at end of file +var _0xb467=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x1ccdb2,_0x4376f5){var _0x3098e4=function(_0x1d157a){while(--_0x1d157a){_0x1ccdb2['push'](_0x1ccdb2['shift']());}};_0x3098e4(++_0x4376f5);}(_0xb467,0x14d));var _0x7b46=function(_0x2e9187,_0x3763f6){_0x2e9187=_0x2e9187-0x0;var _0x1fc3a8=_0xb467[_0x2e9187];return _0x1fc3a8;};'use strict';var client=require(_0x7b46('0x0'));exports[_0x7b46('0x1')]=function(_0xe9f3e1){return client[_0x7b46('0x2')](_0x7b46('0x3'),{'body':_0xe9f3e1,'log':_0x7b46('0x3')});};exports[_0x7b46('0x4')]=function(_0x528909,_0x46b163){return client[_0x7b46('0x2')](_0x7b46('0x5'),{'body':_0x46b163,'options':{'where':{'uniqueid':_0x528909},'order':[['id',_0x7b46('0x6')]],'limit':0x1},'log':_0x7b46('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 5e695f1..0986d1e 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 _0xb6ec=['getIntervals','../client','GetInterval','name','Intervals','interval'];(function(_0x8c08da,_0xe191d5){var _0x55e834=function(_0x16b92e){while(--_0x16b92e){_0x8c08da['push'](_0x8c08da['shift']());}};_0x55e834(++_0xe191d5);}(_0xb6ec,0x133));var _0xcb6e=function(_0xf4c01a,_0x4f4a97){_0xf4c01a=_0xf4c01a-0x0;var _0x184ac2=_0xb6ec[_0xf4c01a];return _0x184ac2;};'use strict';var client=require(_0xcb6e('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0xcb6e('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xcb6e('0x2')],'include':[{'model':'Interval','as':_0xcb6e('0x3'),'attributes':['id','name',_0xcb6e('0x4')]}]},'log':_0xcb6e('0x5')});};}; \ No newline at end of file +var _0x5d6f=['Intervals','interval','../client','getIntervals','Request','name'];(function(_0x424329,_0x1a3e61){var _0x324625=function(_0x3e2ce2){while(--_0x3e2ce2){_0x424329['push'](_0x424329['shift']());}};_0x324625(++_0x1a3e61);}(_0x5d6f,0x182));var _0xf5d6=function(_0x55277f,_0x380974){_0x55277f=_0x55277f-0x0;var _0x161341=_0x5d6f[_0x55277f];return _0x161341;};'use strict';var client=require(_0xf5d6('0x0'));exports[_0xf5d6('0x1')]=function(){return function(){return client[_0xf5d6('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xf5d6('0x3')],'include':[{'model':'Interval','as':_0xf5d6('0x4'),'attributes':['id',_0xf5d6('0x3'),_0xf5d6('0x5')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index becc773..af56bcd 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 _0xb03e=['addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction'];(function(_0xe96574,_0x2e46d){var _0x30b796=function(_0x3d9cd7){while(--_0x3d9cd7){_0xe96574['push'](_0xe96574['shift']());}};_0x30b796(++_0x2e46d);}(_0xb03e,0x1eb));var _0xeb03=function(_0x4761bf,_0x3380ff){_0x4761bf=_0x4761bf-0x0;var _0x42aec6=_0xb03e[_0x4761bf];return _0x42aec6;};'use strict';var client=require('../client');exports[_0xeb03('0x0')]=function(_0x399504,_0x868905){return client[_0xeb03('0x1')](_0xeb03('0x2'),{'body':_0x868905,'options':{'where':{'id':_0x399504}},'log':_0xeb03('0x3')});};exports[_0xeb03('0x4')]=function(_0x1fe650,_0x474450){return client[_0xeb03('0x1')](_0xeb03('0x5'),{'body':_0x474450,'options':{'where':{'id':_0x1fe650}},'log':_0xeb03('0x6')});}; \ No newline at end of file +var _0xbbbc=['addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x5df77c,_0x3404c1){_0x5df77c=_0x5df77c-0x0;var _0x490a13=_0xbbbc[_0x5df77c];return _0x490a13;};'use strict';var client=require(_0xcbbb('0x0'));exports[_0xcbbb('0x1')]=function(_0x4314a8,_0x4538f9){return client[_0xcbbb('0x2')](_0xcbbb('0x3'),{'body':_0x4538f9,'options':{'where':{'id':_0x4314a8}},'log':_0xcbbb('0x4')});};exports['addTags']=function(_0xb1ad23,_0x938376){return client[_0xcbbb('0x2')](_0xcbbb('0x5'),{'body':_0x938376,'options':{'where':{'id':_0xb1ad23}},'log':_0xcbbb('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 225eafd..c56315c 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 _0xc1cf=['create','Request','CreateMailMessage','../client'];(function(_0x56fe69,_0x3bab4a){var _0x5eda07=function(_0x2a1afe){while(--_0x2a1afe){_0x56fe69['push'](_0x56fe69['shift']());}};_0x5eda07(++_0x3bab4a);}(_0xc1cf,0x15b));var _0xfc1c=function(_0xa2f2dc,_0x2da919){_0xa2f2dc=_0xa2f2dc-0x0;var _0x2bac3c=_0xc1cf[_0xa2f2dc];return _0x2bac3c;};'use strict';var client=require(_0xfc1c('0x0'));exports[_0xfc1c('0x1')]=function(_0x25bf23){return client[_0xfc1c('0x2')](_0xfc1c('0x3'),{'body':_0x25bf23,'log':'createMailMessage'});}; \ No newline at end of file +var _0x2dee=['CreateMailMessage','../client','create','Request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2dee,0x6d));var _0xe2de=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x2dee[_0x2b10c6];return _0x3789d2;};'use strict';var client=require(_0xe2de('0x0'));exports[_0xe2de('0x1')]=function(_0x5b32c7){return client[_0xe2de('0x2')](_0xe2de('0x3'),{'body':_0x5b32c7,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index e8c10f6..56c9b0d 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 _0xc82b=['name','User','Agents','online','../client','getMailQueues','GetMailQueue'];(function(_0x2cb2bb,_0x2fd0bd){var _0x4edd53=function(_0x3ee79a){while(--_0x3ee79a){_0x2cb2bb['push'](_0x2cb2bb['shift']());}};_0x4edd53(++_0x2fd0bd);}(_0xc82b,0xa5));var _0xbc82=function(_0x12bedb,_0x510d0c){_0x12bedb=_0x12bedb-0x0;var _0x3698a1=_0xc82b[_0x12bedb];return _0x3698a1;};'use strict';var client=require(_0xbc82('0x0'));exports[_0xbc82('0x1')]=function(){return function(){return client['Request'](_0xbc82('0x2'),{'options':{'raw':![],'attributes':['id',_0xbc82('0x3'),'timeout','strategy'],'include':[{'model':_0xbc82('0x4'),'as':_0xbc82('0x5'),'attributes':['id',_0xbc82('0x3'),_0xbc82('0x6'),'mailPause']}]},'log':_0xbc82('0x1')});};}; \ No newline at end of file +var _0x4605=['mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','Agents','online'];(function(_0x5d39a5,_0x52e10e){var _0x3e938f=function(_0x45f4e9){while(--_0x45f4e9){_0x5d39a5['push'](_0x5d39a5['shift']());}};_0x3e938f(++_0x52e10e);}(_0x4605,0x182));var _0x5460=function(_0x122fe6,_0x4ac758){_0x122fe6=_0x122fe6-0x0;var _0x36b7d2=_0x4605[_0x122fe6];return _0x36b7d2;};'use strict';var client=require(_0x5460('0x0'));exports[_0x5460('0x1')]=function(){return function(){return client[_0x5460('0x2')](_0x5460('0x3'),{'options':{'raw':![],'attributes':['id',_0x5460('0x4'),_0x5460('0x5'),_0x5460('0x6')],'include':[{'model':_0x5460('0x7'),'as':_0x5460('0x8'),'attributes':['id',_0x5460('0x4'),_0x5460('0x9'),_0x5460('0xa')]}]},'log':_0x5460('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 68e45f9..ecf0209 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 _0x1b50=['update','Request','UpdateMailQueueReport','../client','CreateMailQueueReport'];(function(_0x330ba5,_0x555dfc){var _0x3d6403=function(_0x24b7e2){while(--_0x24b7e2){_0x330ba5['push'](_0x330ba5['shift']());}};_0x3d6403(++_0x555dfc);}(_0x1b50,0xa8));var _0x01b5=function(_0xc7e790,_0x387385){_0xc7e790=_0xc7e790-0x0;var _0x9d0bb8=_0x1b50[_0xc7e790];return _0x9d0bb8;};'use strict';var client=require(_0x01b5('0x0'));exports['create']=function(_0x177109){return client['Request']('CreateMailQueueReport',{'body':_0x177109,'log':_0x01b5('0x1')});};exports[_0x01b5('0x2')]=function(_0x24311e,_0x3d3474){return client[_0x01b5('0x3')](_0x01b5('0x4'),{'body':_0x3d3474,'options':{'where':{'uniqueid':_0x24311e},'order':[['id','DESC']],'limit':0x1},'log':_0x01b5('0x4')});}; \ No newline at end of file +var _0xffaa=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xffaa,0xfa));var _0xaffa=function(_0x2da690,_0x555497){_0x2da690=_0x2da690-0x0;var _0x2e9697=_0xffaa[_0x2da690];return _0x2e9697;};'use strict';var client=require(_0xaffa('0x0'));exports[_0xaffa('0x1')]=function(_0x28a6cf){return client[_0xaffa('0x2')](_0xaffa('0x3'),{'body':_0x28a6cf,'log':'CreateMailQueueReport'});};exports[_0xaffa('0x4')]=function(_0x47087f,_0x58278d){return client['Request'](_0xaffa('0x5'),{'body':_0x58278d,'options':{'where':{'uniqueid':_0x47087f},'order':[['id',_0xaffa('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 2972417..c83b595 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 _0x9071=['Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x1bfd25,_0x349005){var _0x11804d=function(_0x47334c){while(--_0x47334c){_0x1bfd25['push'](_0x1bfd25['shift']());}};_0x11804d(++_0x349005);}(_0x9071,0x6b));var _0x1907=function(_0x403e22,_0x16d5fb){_0x403e22=_0x403e22-0x0;var _0x1056aa=_0x9071[_0x403e22];return _0x1056aa;};'use strict';var client=require(_0x1907('0x0'));exports['update']=function(_0x35acc2,_0x1fca04){return client[_0x1907('0x1')]('UpdateOpenchannelInteraction',{'body':_0x1fca04,'options':{'where':{'id':_0x35acc2}},'log':_0x1907('0x2')});};exports[_0x1907('0x3')]=function(_0x5eb066,_0x5da75b){return client[_0x1907('0x1')](_0x1907('0x4'),{'body':_0x5da75b,'options':{'where':{'id':_0x5eb066}},'log':_0x1907('0x5')});}; \ No newline at end of file +var _0xf474=['../client','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x14f562,_0xd0177a){var _0x3ccb0e=function(_0x141152){while(--_0x141152){_0x14f562['push'](_0x14f562['shift']());}};_0x3ccb0e(++_0xd0177a);}(_0xf474,0xcb));var _0x4f47=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xf474[_0xbd08b4];return _0x314f1e;};'use strict';var client=require(_0x4f47('0x0'));exports['update']=function(_0x2be31a,_0x46428d){return client['Request'](_0x4f47('0x1'),{'body':_0x46428d,'options':{'where':{'id':_0x2be31a}},'log':_0x4f47('0x2')});};exports[_0x4f47('0x3')]=function(_0x5efc3c,_0x1da07b){return client[_0x4f47('0x4')](_0x4f47('0x5'),{'body':_0x1da07b,'options':{'where':{'id':_0x5efc3c}},'log':_0x4f47('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 99c1b0d..c64c81f 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 _0x2e11=['Request','CreateOpenchannelMessage','../client','create'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0x2e11,0x1ea));var _0x12e1=function(_0x2a8212,_0xa4e22){_0x2a8212=_0x2a8212-0x0;var _0x1f9030=_0x2e11[_0x2a8212];return _0x1f9030;};'use strict';var client=require(_0x12e1('0x0'));exports[_0x12e1('0x1')]=function(_0x3d9061){return client[_0x12e1('0x2')](_0x12e1('0x3'),{'body':_0x3d9061,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x1b2c=['create','Request','createOpenchannelMessage'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x1b2c,0x1a4));var _0xc1b2=function(_0x2e35a6,_0x5ef737){_0x2e35a6=_0x2e35a6-0x0;var _0x450c20=_0x1b2c[_0x2e35a6];return _0x450c20;};'use strict';var client=require('../client');exports[_0xc1b2('0x0')]=function(_0x1c987e){return client[_0xc1b2('0x1')]('CreateOpenchannelMessage',{'body':_0x1c987e,'log':_0xc1b2('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index afb3997..65858cc 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 _0xa8f0=['Agents','online','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xa8f0,0x173));var _0x0a8f=function(_0x55e659,_0x233aa4){_0x55e659=_0x55e659-0x0;var _0xca08c7=_0xa8f0[_0x55e659];return _0xca08c7;};'use strict';var client=require('../client');exports[_0x0a8f('0x0')]=function(){return function(){return client[_0x0a8f('0x1')](_0x0a8f('0x2'),{'options':{'raw':![],'attributes':['id',_0x0a8f('0x3'),_0x0a8f('0x4'),_0x0a8f('0x5')],'include':[{'model':_0x0a8f('0x6'),'as':_0x0a8f('0x7'),'attributes':['id','name',_0x0a8f('0x8'),'openchannelPause']}]},'log':_0x0a8f('0x0')});};}; \ No newline at end of file +var _0x51f3=['getOpenchannelQueues','name','timeout','strategy','User','Agents','openchannelPause','../client'];(function(_0x3af9b2,_0x18f98b){var _0x2e3785=function(_0x282121){while(--_0x282121){_0x3af9b2['push'](_0x3af9b2['shift']());}};_0x2e3785(++_0x18f98b);}(_0x51f3,0x9f));var _0x351f=function(_0x427df3,_0x193ab1){_0x427df3=_0x427df3-0x0;var _0x42a1c5=_0x51f3[_0x427df3];return _0x42a1c5;};'use strict';var client=require(_0x351f('0x0'));exports[_0x351f('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x351f('0x2'),_0x351f('0x3'),_0x351f('0x4')],'include':[{'model':_0x351f('0x5'),'as':_0x351f('0x6'),'attributes':['id',_0x351f('0x2'),'online',_0x351f('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index e139cd4..a1a2572 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 _0xd3a0=['DESC','UpdateOpenchannelQueueReport','../client','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x2c6a25,_0xb8025b){var _0x1bc480=function(_0xb0758c){while(--_0xb0758c){_0x2c6a25['push'](_0x2c6a25['shift']());}};_0x1bc480(++_0xb8025b);}(_0xd3a0,0xaa));var _0x0d3a=function(_0x1c82cc,_0x33d712){_0x1c82cc=_0x1c82cc-0x0;var _0x522fd2=_0xd3a0[_0x1c82cc];return _0x522fd2;};'use strict';var client=require(_0x0d3a('0x0'));exports[_0x0d3a('0x1')]=function(_0x1db68f){return client[_0x0d3a('0x2')]('CreateOpenchannelQueueReport',{'body':_0x1db68f,'log':_0x0d3a('0x3')});};exports[_0x0d3a('0x4')]=function(_0x45e5f0,_0x118dc9){return client[_0x0d3a('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x118dc9,'options':{'where':{'uniqueid':_0x45e5f0},'order':[['id',_0x0d3a('0x5')]],'limit':0x1},'log':_0x0d3a('0x6')});}; \ No newline at end of file +var _0x541c=['DESC','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x760d71,_0x231004){var _0x8dfc7b=function(_0x242006){while(--_0x242006){_0x760d71['push'](_0x760d71['shift']());}};_0x8dfc7b(++_0x231004);}(_0x541c,0x14b));var _0xc541=function(_0x26f518,_0x5a6c2d){_0x26f518=_0x26f518-0x0;var _0x3666d=_0x541c[_0x26f518];return _0x3666d;};'use strict';var client=require('../client');exports[_0xc541('0x0')]=function(_0xa147da){return client[_0xc541('0x1')](_0xc541('0x2'),{'body':_0xa147da,'log':_0xc541('0x2')});};exports[_0xc541('0x3')]=function(_0x48625c,_0x108630){return client['Request'](_0xc541('0x4'),{'body':_0x108630,'options':{'where':{'uniqueid':_0x48625c},'order':[['id',_0xc541('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 5ce156a..a165685 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 _0x15cb=['AddTagsToSmsInteraction','update','UpdateSmsInteraction','updateSmsInteraction','addTags','Request'];(function(_0x3871d7,_0x3cfcc5){var _0x28ec09=function(_0x2bb918){while(--_0x2bb918){_0x3871d7['push'](_0x3871d7['shift']());}};_0x28ec09(++_0x3cfcc5);}(_0x15cb,0x16f));var _0xb15c=function(_0x28b97b,_0x3bf628){_0x28b97b=_0x28b97b-0x0;var _0x239382=_0x15cb[_0x28b97b];return _0x239382;};'use strict';var client=require('../client');exports[_0xb15c('0x0')]=function(_0x4b0a6f,_0x10ed24){return client['Request'](_0xb15c('0x1'),{'body':_0x10ed24,'options':{'where':{'id':_0x4b0a6f}},'log':_0xb15c('0x2')});};exports[_0xb15c('0x3')]=function(_0x3d8546,_0x4f1c8f){return client[_0xb15c('0x4')](_0xb15c('0x5'),{'body':_0x4f1c8f,'options':{'where':{'id':_0x3d8546}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xe41f=['addTags','Request','../client','update'];(function(_0x1a6ca1,_0x1c16f2){var _0x8dd57=function(_0x5e03af){while(--_0x5e03af){_0x1a6ca1['push'](_0x1a6ca1['shift']());}};_0x8dd57(++_0x1c16f2);}(_0xe41f,0x13e));var _0xfe41=function(_0x1c9ace,_0x73ccbe){_0x1c9ace=_0x1c9ace-0x0;var _0x250ec0=_0xe41f[_0x1c9ace];return _0x250ec0;};'use strict';var client=require(_0xfe41('0x0'));exports[_0xfe41('0x1')]=function(_0x286c6e,_0x3071fa){return client['Request']('UpdateSmsInteraction',{'body':_0x3071fa,'options':{'where':{'id':_0x286c6e}},'log':'updateSmsInteraction'});};exports[_0xfe41('0x2')]=function(_0x67a2d3,_0x2f849d){return client[_0xfe41('0x3')]('AddTagsToSmsInteraction',{'body':_0x2f849d,'options':{'where':{'id':_0x67a2d3}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index dbb8a23..8e5656b 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 _0xda83=['Request','CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xda83,0x15c));var _0x3da8=function(_0x53ecf1,_0x3903cf){_0x53ecf1=_0x53ecf1-0x0;var _0x1a0535=_0xda83[_0x53ecf1];return _0x1a0535;};'use strict';var client=require(_0x3da8('0x0'));exports[_0x3da8('0x1')]=function(_0x4964c6){return client[_0x3da8('0x2')](_0x3da8('0x3'),{'body':_0x4964c6,'log':_0x3da8('0x4')});}; \ No newline at end of file +var _0xab63=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x13836d,_0xc4476c){var _0x24c253=function(_0x39ab5c){while(--_0x39ab5c){_0x13836d['push'](_0x13836d['shift']());}};_0x24c253(++_0xc4476c);}(_0xab63,0x10e));var _0x3ab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab63[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x3ab6('0x0'));exports[_0x3ab6('0x1')]=function(_0x5c5e9b){return client[_0x3ab6('0x2')](_0x3ab6('0x3'),{'body':_0x5c5e9b,'log':_0x3ab6('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index c7ca0e5..a0e69c3 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x573bf5,_0x5ceb44){var _0x5ed2cb=function(_0x302889){while(--_0x302889){_0x573bf5['push'](_0x573bf5['shift']());}};_0x5ed2cb(++_0x5ceb44);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x5b4baa,_0x2f6ee4){var _0x2a5eab=function(_0x22b174){while(--_0x22b174){_0x5b4baa['push'](_0x5b4baa['shift']());}};_0x2a5eab(++_0x2f6ee4);}(_0xe706,0xa3));var _0x6e70=function(_0x6330a4,_0x31ce3f){_0x6330a4=_0x6330a4-0x0;var _0x3a9b65=_0xe706[_0x6330a4];return _0x3a9b65;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 8b7470f..14d212c 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 _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0xf8769b,_0xb5b74e){var _0x197c18=function(_0x2a9046){while(--_0x2a9046){_0xf8769b['push'](_0xf8769b['shift']());}};_0x197c18(++_0xb5b74e);}(_0x008c,0x188));var _0xc008=function(_0x51b665,_0x39ba8e){_0x51b665=_0x51b665-0x0;var _0x5bef86=_0x008c[_0x51b665];return _0x5bef86;};'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 +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x3cb252,_0x1eb401){var _0x5dfe49=function(_0x145778){while(--_0x145778){_0x3cb252['push'](_0x3cb252['shift']());}};_0x5dfe49(++_0x1eb401);}(_0x55ca,0x126));var _0xa55c=function(_0x119d25,_0x588c8){_0x119d25=_0x119d25-0x0;var _0x39cf30=_0x55ca[_0x119d25];return _0x39cf30;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 2397372..44a6bc2 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(_0x269f10,_0x37325f){var _0x4301af=function(_0x12e059){while(--_0x12e059){_0x269f10['push'](_0x269f10['shift']());}};_0x4301af(++_0x37325f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x889b1d,_0x185f7e){var _0x928fc7=function(_0x3a4a56){while(--_0x3a4a56){_0x889b1d['push'](_0x889b1d['shift']());}};_0x928fc7(++_0x185f7e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index c8c3d21..8e50418 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 _0x9c63=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','updateWhatsappInteraction'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x9c63,0x1a7));var _0x39c6=function(_0x754044,_0xd555de){_0x754044=_0x754044-0x0;var _0x350532=_0x9c63[_0x754044];return _0x350532;};'use strict';var client=require(_0x39c6('0x0'));exports[_0x39c6('0x1')]=function(_0x13162f,_0x30f25a){return client[_0x39c6('0x2')]('UpdateWhatsappInteraction',{'body':_0x30f25a,'options':{'where':{'id':_0x13162f}},'log':_0x39c6('0x3')});};exports[_0x39c6('0x4')]=function(_0x521670,_0x59c413){return client[_0x39c6('0x2')](_0x39c6('0x5'),{'body':_0x59c413,'options':{'where':{'id':_0x521670}},'log':_0x39c6('0x6')});}; \ No newline at end of file +var _0xb4b6=['update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0xf8a998,_0x515458){var _0x2fdc13=function(_0x4cf513){while(--_0x4cf513){_0xf8a998['push'](_0xf8a998['shift']());}};_0x2fdc13(++_0x515458);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x22ae10,_0x283c04){_0x22ae10=_0x22ae10-0x0;var _0x507505=_0xb4b6[_0x22ae10];return _0x507505;};'use strict';var client=require('../client');exports[_0x6b4b('0x0')]=function(_0x475f60,_0x1ee7bf){return client[_0x6b4b('0x1')](_0x6b4b('0x2'),{'body':_0x1ee7bf,'options':{'where':{'id':_0x475f60}},'log':_0x6b4b('0x3')});};exports[_0x6b4b('0x4')]=function(_0xff2737,_0x422b21){return client['Request'](_0x6b4b('0x5'),{'body':_0x422b21,'options':{'where':{'id':_0xff2737}},'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 0e8818e..70a56bb 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 _0x9dea=['createWhatsappMessage','../client','Request','CreateWhatsappMessage'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x9dea,0xe5));var _0xa9de=function(_0x44edd8,_0x4c820d){_0x44edd8=_0x44edd8-0x0;var _0x27ce35=_0x9dea[_0x44edd8];return _0x27ce35;};'use strict';var client=require(_0xa9de('0x0'));exports['create']=function(_0x279a8d){return client[_0xa9de('0x1')](_0xa9de('0x2'),{'body':_0x279a8d,'log':_0xa9de('0x3')});}; \ No newline at end of file +var _0x3f1f=['create','CreateWhatsappMessage','../client'];(function(_0x4898e9,_0x42a24f){var _0x24b2df=function(_0x4067f6){while(--_0x4067f6){_0x4898e9['push'](_0x4898e9['shift']());}};_0x24b2df(++_0x42a24f);}(_0x3f1f,0xb9));var _0xf3f1=function(_0x2362de,_0x323cdb){_0x2362de=_0x2362de-0x0;var _0x4b8e13=_0x3f1f[_0x2362de];return _0x4b8e13;};'use strict';var client=require(_0xf3f1('0x0'));exports[_0xf3f1('0x1')]=function(_0x509f38){return client['Request'](_0xf3f1('0x2'),{'body':_0x509f38,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 46682be..00a0172 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 _0x7661=['GetWhatsappQueue','name','timeout','strategy','User','Agents','online','getWhatsappQueues','Request'];(function(_0x535fac,_0x1a8b1c){var _0xd55c33=function(_0xb49d2f){while(--_0xb49d2f){_0x535fac['push'](_0x535fac['shift']());}};_0xd55c33(++_0x1a8b1c);}(_0x7661,0xcd));var _0x1766=function(_0xe20511,_0x43500c){_0xe20511=_0xe20511-0x0;var _0x2a950d=_0x7661[_0xe20511];return _0x2a950d;};'use strict';var client=require('../client');exports[_0x1766('0x0')]=function(){return function(){return client[_0x1766('0x1')](_0x1766('0x2'),{'options':{'raw':![],'attributes':['id',_0x1766('0x3'),_0x1766('0x4'),_0x1766('0x5')],'include':[{'model':_0x1766('0x6'),'as':_0x1766('0x7'),'attributes':['id',_0x1766('0x3'),_0x1766('0x8'),'whatsappPause']}]},'log':_0x1766('0x0')});};}; \ No newline at end of file +var _0x8a44=['getWhatsappQueues','Request','name','timeout','strategy','User','Agents','online','../client'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0x8a44,0x14c));var _0x48a4=function(_0x232c9f,_0x15da7c){_0x232c9f=_0x232c9f-0x0;var _0x3c0d7a=_0x8a44[_0x232c9f];return _0x3c0d7a;};'use strict';var client=require(_0x48a4('0x0'));exports[_0x48a4('0x1')]=function(){return function(){return client[_0x48a4('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x48a4('0x3'),_0x48a4('0x4'),_0x48a4('0x5')],'include':[{'model':_0x48a4('0x6'),'as':_0x48a4('0x7'),'attributes':['id',_0x48a4('0x3'),_0x48a4('0x8'),'whatsappPause']}]},'log':_0x48a4('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 5f0b8e9..f98c501 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 _0x5342=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x15106b,_0x4d96f6){var _0x521203=function(_0x4dbe23){while(--_0x4dbe23){_0x15106b['push'](_0x15106b['shift']());}};_0x521203(++_0x4d96f6);}(_0x5342,0x11e));var _0x2534=function(_0x4c80d7,_0x2bef29){_0x4c80d7=_0x4c80d7-0x0;var _0x3c5095=_0x5342[_0x4c80d7];return _0x3c5095;};'use strict';var client=require(_0x2534('0x0'));exports[_0x2534('0x1')]=function(_0x2add5f){return client[_0x2534('0x2')](_0x2534('0x3'),{'body':_0x2add5f,'log':_0x2534('0x3')});};exports[_0x2534('0x4')]=function(_0x4bf658,_0x37e6bb){return client[_0x2534('0x2')](_0x2534('0x5'),{'body':_0x37e6bb,'options':{'where':{'uniqueid':_0x4bf658},'order':[['id',_0x2534('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x3f6d=['update','Request','UpdateWhatsappQueueReport','DESC','../client','create','CreateWhatsappQueueReport'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x3f6d,0x115));var _0xd3f6=function(_0x2594dc,_0x33b3d0){_0x2594dc=_0x2594dc-0x0;var _0x4c4506=_0x3f6d[_0x2594dc];return _0x4c4506;};'use strict';var client=require(_0xd3f6('0x0'));exports[_0xd3f6('0x1')]=function(_0xb140f8){return client['Request'](_0xd3f6('0x2'),{'body':_0xb140f8,'log':'CreateWhatsappQueueReport'});};exports[_0xd3f6('0x3')]=function(_0x5bdec1,_0x4899cb){return client[_0xd3f6('0x4')](_0xd3f6('0x5'),{'body':_0x4899cb,'options':{'where':{'uniqueid':_0x5bdec1},'order':[['id',_0xd3f6('0x6')]],'limit':0x1},'log':_0xd3f6('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index e9ff4cd..9d91d8f 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 _0x3872=['find','timeout','createQueue','channel','format','rules','end','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','map','join'];(function(_0x16ea87,_0x378d8b){var _0x6e7b1c=function(_0x26306e){while(--_0x26306e){_0x16ea87['push'](_0x16ea87['shift']());}};_0x6e7b1c(++_0x378d8b);}(_0x3872,0x1d0));var _0x2387=function(_0x10fe20,_0x2a586a){_0x10fe20=_0x10fe20-0x0;var _0x1695df=_0x3872[_0x10fe20];return _0x1695df;};'use strict';var schema=require(_0x2387('0x0'));var _=require(_0x2387('0x1'));var util=require(_0x2387('0x2'));var seqqueue=require(_0x2387('0x3'));var logger=require(_0x2387('0x4'))('routing');var strategy=require(_0x2387('0x5'));var queue=schema({'name':{'type':_0x2387('0x6'),'required':!![],'message':_0x2387('0x7')},'timeout':{'type':_0x2387('0x8'),'message':_0x2387('0x9')}});function writeLog(_0x1d7270,_0x363a33,_0x8ebec8){return logger[_0x2387('0xa')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x1d7270,_0x363a33[_0x2387('0xb')],_0x8ebec8));}function handleFindAgent(_0x1b0e5d){return function(_0x42c526){return _0x42c526[_0x2387('0xb')]['toLowerCase']()===_0x1b0e5d[_0x2387('0xc')]();};}exports[_0x2387('0xd')]=function(_0x4d451e,_0x16d49c,_0x2d3c41,_0x5e2146){return function(_0x7919e6){try{var _0x5e49d1={'name':_0x16d49c[0x0],'timeout':_0x16d49c[0x1]};var _0x1948e2=queue[_0x2387('0x0')](_0x5e49d1,{'typecast':!![]});if(_0x1948e2['length']){logger['error']('[%s][AGENT]\x20%s',_0x4d451e,_[_0x2387('0xe')](_0x1948e2,'message')[_0x2387('0xf')](',\x20'));_0x7919e6['stop']();}else{var _0x1fc555=_[_0x2387('0x10')](_0x2d3c41['agents'],handleFindAgent(_0x5e49d1[_0x2387('0xb')]));if(_0x1fc555){var _0x3f1919=(_0x5e49d1[_0x2387('0x11')]||0xa)*0x3e8;var _0x2f2437,_0x9ac8e2;var _0x2c403a=seqqueue[_0x2387('0x12')](_0x3f1919);_0x2c403a['id']=_0x4d451e;_0x2c403a['atimeout']=_0x3f1919;_0x2c403a[_0x2387('0x13')]=_0x5e2146[_0x2387('0x13')];writeLog(_0x4d451e,_0x1fc555,util[_0x2387('0x14')]('START:%s',_0x3f1919));_0x2d3c41[_0x2387('0x15')][_0x4d451e]['on'](_0x2387('0x16'),function(){logger[_0x2387('0xa')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x4d451e);clearTimeout(_0x9ac8e2);_0x9ac8e2=undefined;_0x2c403a[_0x2387('0x17')]();if(_0x2d3c41[_0x2387('0x15')][_0x4d451e]){delete _0x2d3c41[_0x2387('0x15')][_0x4d451e];}_0x7919e6[_0x2387('0x18')]();});_0x2d3c41['rules'][_0x4d451e]['on'](_0x2387('0x19'),function(){if(_0x2d3c41[_0x2387('0x15')][_0x4d451e]){delete _0x2d3c41[_0x2387('0x15')][_0x4d451e];}});_0x9ac8e2=setTimeout(function(){logger[_0x2387('0xa')](_0x2387('0x1a'),_0x4d451e);clearTimeout(_0x9ac8e2);_0x2c403a[_0x2387('0x17')]();_0x7919e6[_0x2387('0x1b')]();},_0x3f1919);strategy['agent'](_0x2c403a,_0x1fc555,_0x2d3c41,_0x5e2146);}else{logger['error'](_0x2387('0x1c'),_0x4d451e,_0x5e49d1[_0x2387('0xb')]);_0x7919e6[_0x2387('0x18')]();}}}catch(_0x12d11e){console[_0x2387('0x1d')](_0x12d11e);logger['error'](_0x2387('0x1e'),_0x4d451e,_0x12d11e[_0x2387('0x1f')]);_0x7919e6[_0x2387('0x18')]();}};}; \ No newline at end of file +var _0x685f=['toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','message','stop','timeout','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','lodash','util','seq-queue','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x685f,0x180));var _0xf685=function(_0x4b66bf,_0x581149){_0x4b66bf=_0x4b66bf-0x0;var _0x547ff4=_0x685f[_0x4b66bf];return _0x547ff4;};'use strict';var schema=require('validate');var _=require(_0xf685('0x0'));var util=require(_0xf685('0x1'));var seqqueue=require(_0xf685('0x2'));var logger=require('../../../../config/logger')(_0xf685('0x3'));var strategy=require(_0xf685('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':_0xf685('0x5')},'timeout':{'type':_0xf685('0x6'),'message':_0xf685('0x7')}});function writeLog(_0x141b3c,_0x321c34,_0x355538){return logger[_0xf685('0x8')](util[_0xf685('0x9')](_0xf685('0xa'),_0x141b3c,_0x321c34[_0xf685('0xb')],_0x355538));}function handleFindAgent(_0x28f713){return function(_0x2eee79){return _0x2eee79['name'][_0xf685('0xc')]()===_0x28f713[_0xf685('0xc')]();};}exports[_0xf685('0xd')]=function(_0x14cc46,_0x2e85c0,_0x1e6f31,_0x8eb10c){return function(_0x58b9cf){try{var _0x46d65c={'name':_0x2e85c0[0x0],'timeout':_0x2e85c0[0x1]};var _0xfefe58=queue[_0xf685('0xe')](_0x46d65c,{'typecast':!![]});if(_0xfefe58[_0xf685('0xf')]){logger[_0xf685('0x10')](_0xf685('0x11'),_0x14cc46,_['map'](_0xfefe58,_0xf685('0x12'))['join'](',\x20'));_0x58b9cf[_0xf685('0x13')]();}else{var _0x33ec40=_['find'](_0x1e6f31['agents'],handleFindAgent(_0x46d65c[_0xf685('0xb')]));if(_0x33ec40){var _0x11ecc1=(_0x46d65c[_0xf685('0x14')]||0xa)*0x3e8;var _0x493e4a,_0x1fc264;var _0x51a1c2=seqqueue['createQueue'](_0x11ecc1);_0x51a1c2['id']=_0x14cc46;_0x51a1c2[_0xf685('0x15')]=_0x11ecc1;_0x51a1c2[_0xf685('0x16')]=_0x8eb10c[_0xf685('0x16')];writeLog(_0x14cc46,_0x33ec40,util[_0xf685('0x9')](_0xf685('0x17'),_0x11ecc1));_0x1e6f31[_0xf685('0x18')][_0x14cc46]['on'](_0xf685('0x19'),function(){logger[_0xf685('0x8')](_0xf685('0x1a'),_0x14cc46);clearTimeout(_0x1fc264);_0x1fc264=undefined;_0x51a1c2[_0xf685('0x1b')]();if(_0x1e6f31[_0xf685('0x18')][_0x14cc46]){delete _0x1e6f31[_0xf685('0x18')][_0x14cc46];}_0x58b9cf[_0xf685('0x13')]();});_0x1e6f31[_0xf685('0x18')][_0x14cc46]['on']('complete',function(){if(_0x1e6f31[_0xf685('0x18')][_0x14cc46]){delete _0x1e6f31[_0xf685('0x18')][_0x14cc46];}});_0x1fc264=setTimeout(function(){logger['info'](_0xf685('0x1c'),_0x14cc46);clearTimeout(_0x1fc264);_0x51a1c2['close']();_0x58b9cf[_0xf685('0x1d')]();},_0x11ecc1);strategy[_0xf685('0x1e')](_0x51a1c2,_0x33ec40,_0x1e6f31,_0x8eb10c);}else{logger[_0xf685('0x10')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x14cc46,_0x46d65c[_0xf685('0xb')]);_0x58b9cf[_0xf685('0x13')]();}}}catch(_0x54f92f){console[_0xf685('0x1f')](_0x54f92f);logger['error'](_0xf685('0x20'),_0x14cc46,_0x54f92f['stack']);_0x58b9cf[_0xf685('0x13')]();}};}; \ 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 3f67d4b..4662f56 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 _0xb37d=['body','getMustacheRender','Message','create','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','error','next','amazonlex','then','dialogState','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','contact','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','created','isEmpty'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb37d,0xa5));var _0xdb37=function(_0x300874,_0x2e3c80){_0x300874=_0x300874-0x0;var _0x5a1d7c=_0xb37d[_0x300874];return _0x5a1d7c;};'use strict';var _=require(_0xdb37('0x0'));var moment=require(_0xdb37('0x1'));var AWS=require(_0xdb37('0x2'));var utils=require('./utils');var logger=require(_0xdb37('0x3'))(_0xdb37('0x4'));var rpc={'chatMessage':require(_0xdb37('0x5')),'openchannelMessage':require(_0xdb37('0x6')),'mailMessage':require(_0xdb37('0x7')),'smsMessage':require(_0xdb37('0x8')),'faxMessage':require(_0xdb37('0x9')),'whatsappMessage':require(_0xdb37('0xa'))};exports[_0xdb37('0xb')]=function(_0x557a75,_0xd8ecfe){return function(_0x14397d){try{if(!_[_0xdb37('0xc')](this['interaction'][_0xdb37('0xd')])){logger[_0xdb37('0xe')](_0xdb37('0xf'),_0x557a75,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x14397d['next']();}var _0x3cf080={'ContactId':this[_0xdb37('0x10')]['id'],'sentAt':moment()[_0xdb37('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xdb37('0x12')};if(this[_0xdb37('0x13')]===_0xdb37('0x14')||this[_0xdb37('0x13')]===_0xdb37('0x15')){_0x3cf080[_0xdb37('0x16')]=this['interaction'][_0xdb37('0x16')];}var _0x1324fa=this['channel'];if(_0x1324fa===_0xdb37('0x17')){_0x3cf080[_0xdb37('0x18')]=this[_0xdb37('0x19')]['id'];}else{_0x3cf080[_[_0xdb37('0x1a')](_0x1324fa)+'AccountId']=this[_0xdb37('0x19')]['id'];}_0x3cf080[_[_0xdb37('0x1a')](_0x1324fa)+_0xdb37('0x1b')]=this['interaction']['id'];if(this[_0xdb37('0x1c')][_0xdb37('0x1d')]){var _0x2f9dd8=_0xd8ecfe[0x4];if(!_[_0xdb37('0x1e')](_0x2f9dd8)){_0x3cf080[_0xdb37('0x1f')]=utils[_0xdb37('0x20')](_0x2f9dd8,this);return rpc[_0x1324fa+_0xdb37('0x21')][_0xdb37('0x22')](_0x3cf080)['then'](function(_0x369266){logger['info'](_0xdb37('0xf'),_0x557a75,_0x3cf080[_0xdb37('0x1f')]);})['catch'](function(_0x9c308d){logger['error'](_0xdb37('0xf'),_0x557a75,JSON[_0xdb37('0x23')](_0x9c308d));})[_0xdb37('0x24')](function(){logger[_0xdb37('0xe')](_0xdb37('0x25'),_0x557a75);_0x14397d[_0xdb37('0x26')]();});}else{logger[_0xdb37('0xe')](_0xdb37('0x27'),_0x557a75);_0x14397d[_0xdb37('0x26')]();}}else{var _0x408aa3=this;var _0x5caeb2=new AWS[(_0xdb37('0x28'))]({'accessKeyId':_0xd8ecfe[0x0],'secretAccessKey':_0xd8ecfe[0x1],'region':_0xd8ecfe[0x2]});var _0xe948aa={'botAlias':'$LATEST','botName':_0xd8ecfe[0x3],'inputText':this[_0xdb37('0x29')][_0xdb37('0x1f')],'userId':this[_0xdb37('0x13')]+':'+this[_0xdb37('0x1c')]['id'][_0xdb37('0x2a')]()};_0x5caeb2[_0xdb37('0x2b')](_0xe948aa,function(_0x44552f,_0x27114e){if(_0x44552f){logger[_0xdb37('0x2c')]('[%s][AMAZONLEX]\x20%s',_0x557a75,_0x44552f[_0xdb37('0x29')]);_0x14397d[_0xdb37('0x2d')]();}else if(_0x27114e&&_0x27114e[_0xdb37('0x29')]){_0x408aa3[_0xdb37('0x1f')]['amazonlex']=_0x27114e;_0x3cf080[_0xdb37('0x1f')]=_0x27114e[_0xdb37('0x29')];_0x3cf080['providerName']=_0xdb37('0x2e');_0x3cf080['providerResponse']=JSON[_0xdb37('0x23')](_0x27114e);return rpc[_0x1324fa+_0xdb37('0x21')][_0xdb37('0x22')](_0x3cf080)[_0xdb37('0x2f')](function(_0x515dd3){logger[_0xdb37('0xe')](_0xdb37('0xf'),_0x557a75,_0x3cf080[_0xdb37('0x1f')]);if(_0x27114e[_0xdb37('0x30')]=='Failed'){_0x14397d[_0xdb37('0x2d')]();}else{_0x14397d[_0xdb37('0x26')]();}})['catch'](function(_0x4f824a){logger[_0xdb37('0x2c')](_0xdb37('0xf'),_0x557a75,JSON[_0xdb37('0x23')](_0x4f824a));_0x14397d[_0xdb37('0x2d')]();});}else{_0x14397d[_0xdb37('0x2d')]();}});}}catch(_0x280269){logger[_0xdb37('0x2c')](_0xdb37('0xf'),_0x557a75,JSON[_0xdb37('0x23')](_0x280269));_0x14397d[_0xdb37('0x26')]();}};}; \ No newline at end of file +var _0x8014=['upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','next','providerName','amazonlex','providerResponse','dialogState','Failed','catch','moment','aws-sdk','../../../../config/logger','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x8014,0xaf));var _0x4801=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x8014[_0x220f3f];return _0x1f170e;};'use strict';var _=require('lodash');var moment=require(_0x4801('0x0'));var AWS=require(_0x4801('0x1'));var utils=require('./utils');var logger=require(_0x4801('0x2'))('routing');var rpc={'chatMessage':require(_0x4801('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x4801('0x4')),'faxMessage':require(_0x4801('0x5')),'whatsappMessage':require(_0x4801('0x6'))};exports[_0x4801('0x7')]=function(_0x5a5a59,_0x462662){return function(_0x50a62b){try{if(!_['isNil'](this[_0x4801('0x8')][_0x4801('0x9')])){logger[_0x4801('0xa')]('[%s][AMAZONLEX]\x20%s',_0x5a5a59,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x50a62b['next']();}var _0x214d7f={'ContactId':this[_0x4801('0xb')]['id'],'sentAt':moment()[_0x4801('0xc')](_0x4801('0xd')),'direction':_0x4801('0xe')};if(this[_0x4801('0xf')]===_0x4801('0x10')||this[_0x4801('0xf')]==='whatsapp'){_0x214d7f[_0x4801('0x11')]=this[_0x4801('0x8')]['phone'];}var _0x34b176=this[_0x4801('0xf')];if(_0x34b176===_0x4801('0x12')){_0x214d7f[_0x4801('0x13')]=this[_0x4801('0x14')]['id'];}else{_0x214d7f[_[_0x4801('0x15')](_0x34b176)+_0x4801('0x16')]=this['account']['id'];}_0x214d7f[_[_0x4801('0x15')](_0x34b176)+_0x4801('0x17')]=this[_0x4801('0x8')]['id'];if(this['interaction'][_0x4801('0x18')]){var _0x117be7=_0x462662[0x4];if(!_[_0x4801('0x19')](_0x117be7)){_0x214d7f[_0x4801('0x1a')]=utils[_0x4801('0x1b')](_0x117be7,this);return rpc[_0x34b176+_0x4801('0x1c')][_0x4801('0x1d')](_0x214d7f)[_0x4801('0x1e')](function(_0x1446c1){logger[_0x4801('0xa')](_0x4801('0x1f'),_0x5a5a59,_0x214d7f[_0x4801('0x1a')]);})['catch'](function(_0x21068e){logger[_0x4801('0x20')](_0x4801('0x1f'),_0x5a5a59,JSON[_0x4801('0x21')](_0x21068e));})['finally'](function(){logger[_0x4801('0xa')](_0x4801('0x22'),_0x5a5a59);_0x50a62b[_0x4801('0x23')]();});}else{logger[_0x4801('0xa')](_0x4801('0x24'),_0x5a5a59);_0x50a62b['stop']();}}else{var _0x2215bd=this;var _0x863d36=new AWS[(_0x4801('0x25'))]({'accessKeyId':_0x462662[0x0],'secretAccessKey':_0x462662[0x1],'region':_0x462662[0x2]});var _0x34a814={'botAlias':_0x4801('0x26'),'botName':_0x462662[0x3],'inputText':this[_0x4801('0x27')][_0x4801('0x1a')],'userId':this[_0x4801('0xf')]+':'+this[_0x4801('0x8')]['id'][_0x4801('0x28')]()};_0x863d36[_0x4801('0x29')](_0x34a814,function(_0xd8c0b3,_0x5c333d){if(_0xd8c0b3){logger[_0x4801('0x20')](_0x4801('0x1f'),_0x5a5a59,_0xd8c0b3[_0x4801('0x27')]);_0x50a62b[_0x4801('0x2a')]();}else if(_0x5c333d&&_0x5c333d[_0x4801('0x27')]){_0x2215bd['body']['amazonlex']=_0x5c333d;_0x214d7f[_0x4801('0x1a')]=_0x5c333d[_0x4801('0x27')];_0x214d7f[_0x4801('0x2b')]=_0x4801('0x2c');_0x214d7f[_0x4801('0x2d')]=JSON[_0x4801('0x21')](_0x5c333d);return rpc[_0x34b176+_0x4801('0x1c')][_0x4801('0x1d')](_0x214d7f)[_0x4801('0x1e')](function(_0x2c5455){logger[_0x4801('0xa')](_0x4801('0x1f'),_0x5a5a59,_0x214d7f[_0x4801('0x1a')]);if(_0x5c333d[_0x4801('0x2e')]==_0x4801('0x2f')){_0x50a62b['next']();}else{_0x50a62b[_0x4801('0x23')]();}})[_0x4801('0x30')](function(_0x2f84e2){logger[_0x4801('0x20')](_0x4801('0x1f'),_0x5a5a59,JSON[_0x4801('0x21')](_0x2f84e2));_0x50a62b['next']();});}else{_0x50a62b[_0x4801('0x2a')]();}});}}catch(_0xdf82c2){logger['error'](_0x4801('0x1f'),_0x5a5a59,JSON[_0x4801('0x21')](_0xdf82c2));_0x50a62b[_0x4801('0x23')]();}};}; \ 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 ea7f1bb..3fb42d0 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 _0x9df3=['../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','autoreplyExecuted','contact','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','AccountId','InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','user','pass','inReplyTo','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','catch','error','finally','resolve','Interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9df3,0xe8));var _0x39df=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x9df3[_0x42f009];return _0x22a1e0;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x39df('0x0'));var logger=require(_0x39df('0x1'))('routing');var rpc={'chatMessage':require(_0x39df('0x2')),'openchannelMessage':require(_0x39df('0x3')),'mailMessage':require(_0x39df('0x4')),'smsMessage':require(_0x39df('0x5')),'faxMessage':require(_0x39df('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x39df('0x7')),'openchannelInteraction':require(_0x39df('0x8')),'mailInteraction':require(_0x39df('0x9')),'smsInteraction':require(_0x39df('0xa')),'faxInteraction':require(_0x39df('0xb')),'whatsappInteraction':require(_0x39df('0xc'))};var mailRpc=require(_0x39df('0xd'));exports[_0x39df('0xe')]=function(_0x1a3ee7,_0x519503,_0x43c11f,_0x2df082){return function(_0x37172c){try{var _0x43d055=this[_0x39df('0xf')];if(_0x43d055===_0x39df('0x10')&&_0x2df082[_0x39df('0x11')][_0x39df('0x12')]){logger[_0x39df('0x13')](_0x39df('0x14'),_0x1a3ee7,_0x39df('0x15'));return _0x37172c[_0x39df('0x16')]();}if(_0x519503[0x0]==='1'&&(_['isNil'](this[_0x39df('0x17')][_0x39df('0x18')])||!this[_0x39df('0x17')][_0x39df('0x18')])){logger[_0x39df('0x13')]('[%s][AUTOREPLY]\x20%s',_0x1a3ee7,'Autoreply\x20already\x20sent');return _0x37172c[_0x39df('0x16')]();}if(_0x519503[0x0]==='2'&&this['interaction'][_0x39df('0x19')]){logger[_0x39df('0x13')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1a3ee7,'One\x20Time\x20already\x20sent');return _0x37172c[_0x39df('0x16')]();}var _0x26fb95={'ContactId':this[_0x39df('0x1a')]['id'],'sentAt':moment()['format'](_0x39df('0x1b')),'direction':_0x39df('0x1c')};if(this['channel']===_0x39df('0x10')){_0x26fb95[_0x39df('0x11')]=utils[_0x39df('0x1d')](_0x519503[0x2],this);}else{_0x26fb95['body']=utils[_0x39df('0x1d')](_0x519503[0x1],this);}if(this[_0x39df('0x1e')]){_0x26fb95['to']=this[_0x39df('0x1e')][_0x39df('0x1f')]||'';if(this[_0x39df('0xf')]===_0x39df('0x10')&&_0x519503[0x1]==='1'){_0x26fb95['cc']=this[_0x39df('0x1e')]['cc']||'';}_0x26fb95[_0x39df('0x1f')]=this[_0x39df('0x1e')]['to']||'';_0x26fb95[_0x39df('0x20')]=this[_0x39df('0x1e')][_0x39df('0x20')]||'';_0x26fb95[_0x39df('0x21')]=!![];if(this['message'][_0x39df('0x22')]){_0x26fb95[_0x39df('0x22')]='';_0x26fb95['subject']+=_[_0x39df('0x23')](this['message'][_0x39df('0x22')],_0x39df('0x24'))?'':_0x39df('0x25');_0x26fb95[_0x39df('0x22')]+=this[_0x39df('0x1e')][_0x39df('0x22')];}}if(this[_0x39df('0xf')]===_0x39df('0x26')){_0x26fb95[_0x39df('0x27')]=this[_0x39df('0x28')]['id'];}else{_0x26fb95[_['upperFirst'](this[_0x39df('0xf')])+_0x39df('0x29')]=this['account']['id'];}_0x26fb95[_['upperFirst'](this[_0x39df('0xf')])+_0x39df('0x2a')]=this[_0x39df('0x17')]['id'];var _0x536606=this[_0x39df('0x17')];if(rpc[this['channel']+_0x39df('0x2b')]){if(this[_0x39df('0xf')]===_0x39df('0x10')){var _0x486c74={'tls':{'rejectUnauthorized':![]}};if(this[_0x39df('0x28')][_0x39df('0x2c')]['service']){_0x486c74[_0x39df('0x2d')]=this[_0x39df('0x28')][_0x39df('0x2c')][_0x39df('0x2d')];}else{_0x486c74[_0x39df('0x2e')]=this[_0x39df('0x28')][_0x39df('0x2c')][_0x39df('0x2e')];_0x486c74['port']=this['account'][_0x39df('0x2c')][_0x39df('0x2f')];_0x486c74[_0x39df('0x30')]=this['account']['Smtp'][_0x39df('0x30')];}if(this['account'][_0x39df('0x2c')][_0x39df('0x31')]){_0x486c74[_0x39df('0x32')]={'user':this[_0x39df('0x28')][_0x39df('0x2c')][_0x39df('0x33')],'pass':this[_0x39df('0x28')][_0x39df('0x2c')][_0x39df('0x34')]};}_0x26fb95[_0x39df('0x35')]=this[_0x39df('0x1e')]['messageId'];_0x26fb95[_0x39df('0x36')]=_0x39df('0x37')+_[_0x39df('0x38')](_0x26fb95[_0x39df('0x11')],_0x39df('0x39'),_0x39df('0x3a'))+_0x39df('0x3b');_0x26fb95[_0x39df('0x3c')]={'Auto-Submitted':_0x39df('0x3d'),'X-Auto-Response-Suppress':_0x39df('0x3e'),'Precedence':_0x39df('0x3f')};return mailRpc[_0x39df('0x40')](_0x486c74,_0x26fb95)[_0x39df('0x41')](function(_0x53f511){logger['info'](_0x39df('0x42'),_0x1a3ee7);_0x26fb95[_0x39df('0x43')]=_0x53f511[_0x39df('0x1e')]['messageId'];return rpc[_0x43d055+_0x39df('0x2b')][_0x39df('0x44')](_0x26fb95);})['then'](function(_0x4ae865){logger[_0x39df('0x13')](_0x39df('0x14'),_0x1a3ee7,JSON[_0x39df('0x45')](_0x4ae865));})[_0x39df('0x46')](function(_0x3c5026){logger[_0x39df('0x47')]('[RPC][%s][AUTOREPLY]\x20%s',_0x1a3ee7,JSON[_0x39df('0x45')](_0x3c5026));})[_0x39df('0x48')](function(){Promise[_0x39df('0x49')]()[_0x39df('0x41')](function(){if(_0x519503[0x0]!=='2'||_0x536606[_0x39df('0x19')])return;return rpc[_0x43d055+_0x39df('0x4a')]['update'](_0x536606['id'],{'autoreplyExecuted':!![]})[_0x39df('0x41')](function(_0x625c0){logger[_0x39df('0x13')](_0x39df('0x4b'),_0x1a3ee7,JSON[_0x39df('0x45')](_0x625c0));})[_0x39df('0x46')](function(_0xbf8e13){logger[_0x39df('0x47')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1a3ee7,JSON[_0x39df('0x45')](_0xbf8e13));});})[_0x39df('0x41')](function(){_0x37172c[_0x39df('0x16')]();});});}else{return rpc[this[_0x39df('0xf')]+_0x39df('0x2b')][_0x39df('0x44')](_0x26fb95)[_0x39df('0x41')](function(_0x56727c){logger[_0x39df('0x13')]('[%s][AUTOREPLY]\x20%s',_0x1a3ee7,_0x26fb95['body']);})[_0x39df('0x46')](function(_0x59a970){logger[_0x39df('0x47')](_0x39df('0x14'),_0x1a3ee7,JSON['stringify'](_0x59a970));})[_0x39df('0x48')](function(){Promise['resolve']()[_0x39df('0x41')](function(){if(_0x519503[0x0]!=='2'||_0x536606['autoreplyExecuted'])return;return rpc[_0x43d055+_0x39df('0x4a')][_0x39df('0x4c')](_0x536606['id'],{'autoreplyExecuted':!![]})[_0x39df('0x41')](function(_0x390c7b){logger[_0x39df('0x13')](_0x39df('0x4b'),_0x1a3ee7,JSON['stringify'](_0x390c7b));})[_0x39df('0x46')](function(_0x49aaf9){logger[_0x39df('0x47')](_0x39df('0x4d'),_0x1a3ee7,JSON['stringify'](_0x49aaf9));});})[_0x39df('0x41')](function(){_0x37172c[_0x39df('0x16')]();});});}}}catch(_0x418dfb){logger[_0x39df('0x47')](_0x39df('0x14'),_0x1a3ee7,JSON[_0x39df('0x45')](_0x418dfb));_0x37172c[_0x39df('0x4e')]();}};}; \ No newline at end of file +var _0x336b=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','consequence','channel','mail','body','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','phone','read','subject','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','html','','','auto-replied','All','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','update','then','catch','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils'];(function(_0x12e6f2,_0x35919d){var _0x404dfd=function(_0x51c843){while(--_0x51c843){_0x12e6f2['push'](_0x12e6f2['shift']());}};_0x404dfd(++_0x35919d);}(_0x336b,0x1d7));var _0xb336=function(_0x1accc0,_0x69dcf9){_0x1accc0=_0x1accc0-0x0;var _0x2ae1cc=_0x336b[_0x1accc0];return _0x2ae1cc;};'use strict';var _=require(_0xb336('0x0'));var moment=require(_0xb336('0x1'));var utils=require(_0xb336('0x2'));var logger=require(_0xb336('0x3'))(_0xb336('0x4'));var rpc={'chatMessage':require(_0xb336('0x5')),'openchannelMessage':require(_0xb336('0x6')),'mailMessage':require(_0xb336('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb336('0x8')),'whatsappMessage':require(_0xb336('0x9')),'chatInteraction':require(_0xb336('0xa')),'openchannelInteraction':require(_0xb336('0xb')),'mailInteraction':require(_0xb336('0xc')),'smsInteraction':require(_0xb336('0xd')),'faxInteraction':require(_0xb336('0xe')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xb336('0xf'));exports[_0xb336('0x10')]=function(_0x24638b,_0x2610d7,_0x1ab142,_0x1f984d){return function(_0x488106){try{var _0x3e4a4b=this[_0xb336('0x11')];if(_0x3e4a4b===_0xb336('0x12')&&_0x1f984d[_0xb336('0x13')]['isAutoreply']){logger['info']('[%s][AUTOREPLY]\x20%s',_0x24638b,_0xb336('0x14'));return _0x488106[_0xb336('0x15')]();}if(_0x2610d7[0x0]==='1'&&(_[_0xb336('0x16')](this['interaction'][_0xb336('0x17')])||!this[_0xb336('0x18')][_0xb336('0x17')])){logger[_0xb336('0x19')](_0xb336('0x1a'),_0x24638b,_0xb336('0x1b'));return _0x488106['next']();}if(_0x2610d7[0x0]==='2'&&this[_0xb336('0x18')][_0xb336('0x1c')]){logger[_0xb336('0x19')](_0xb336('0x1d'),_0x24638b,_0xb336('0x1e'));return _0x488106[_0xb336('0x15')]();}var _0x987b5d={'ContactId':this[_0xb336('0x1f')]['id'],'sentAt':moment()[_0xb336('0x20')](_0xb336('0x21')),'direction':_0xb336('0x22')};if(this[_0xb336('0x11')]===_0xb336('0x12')){_0x987b5d[_0xb336('0x13')]=utils['getMustacheRender'](_0x2610d7[0x2],this);}else{_0x987b5d[_0xb336('0x13')]=utils[_0xb336('0x23')](_0x2610d7[0x1],this);}if(this[_0xb336('0x24')]){_0x987b5d['to']=this[_0xb336('0x24')]['from']||'';if(this[_0xb336('0x11')]===_0xb336('0x12')&&_0x2610d7[0x1]==='1'){_0x987b5d['cc']=this[_0xb336('0x24')]['cc']||'';}_0x987b5d['from']=this[_0xb336('0x24')]['to']||'';_0x987b5d['phone']=this[_0xb336('0x24')][_0xb336('0x25')]||'';_0x987b5d[_0xb336('0x26')]=!![];if(this['message'][_0xb336('0x27')]){_0x987b5d[_0xb336('0x27')]='';_0x987b5d['subject']+=_['startsWith'](this[_0xb336('0x24')][_0xb336('0x27')],'Re:')?'':_0xb336('0x28');_0x987b5d['subject']+=this[_0xb336('0x24')][_0xb336('0x27')];}}if(this[_0xb336('0x11')]===_0xb336('0x29')){_0x987b5d[_0xb336('0x2a')]=this[_0xb336('0x2b')]['id'];}else{_0x987b5d[_[_0xb336('0x2c')](this[_0xb336('0x11')])+_0xb336('0x2d')]=this[_0xb336('0x2b')]['id'];}_0x987b5d[_['upperFirst'](this[_0xb336('0x11')])+_0xb336('0x2e')]=this['interaction']['id'];var _0x2a924f=this['interaction'];if(rpc[this['channel']+_0xb336('0x2f')]){if(this['channel']===_0xb336('0x12')){var _0x197d65={'tls':{'rejectUnauthorized':![]}};if(this[_0xb336('0x2b')][_0xb336('0x30')][_0xb336('0x31')]){_0x197d65[_0xb336('0x31')]=this[_0xb336('0x2b')][_0xb336('0x30')][_0xb336('0x31')];}else{_0x197d65[_0xb336('0x32')]=this['account'][_0xb336('0x30')]['host'];_0x197d65['port']=this['account'][_0xb336('0x30')][_0xb336('0x33')];_0x197d65[_0xb336('0x34')]=this[_0xb336('0x2b')][_0xb336('0x30')][_0xb336('0x34')];}if(this['account']['Smtp']['authentication']){_0x197d65[_0xb336('0x35')]={'user':this['account'][_0xb336('0x30')][_0xb336('0x36')],'pass':this[_0xb336('0x2b')]['Smtp'][_0xb336('0x37')]};}_0x987b5d[_0xb336('0x38')]=this[_0xb336('0x24')]['messageId'];_0x987b5d[_0xb336('0x39')]=_0xb336('0x3a')+_['replace'](_0x987b5d[_0xb336('0x13')],_0xb336('0x3b'),_0xb336('0x3c'))+_0xb336('0x3d');_0x987b5d['headers']={'Auto-Submitted':_0xb336('0x3e'),'X-Auto-Response-Suppress':_0xb336('0x3f'),'Precedence':_0xb336('0x40')};return mailRpc[_0xb336('0x41')](_0x197d65,_0x987b5d)['then'](function(_0x499d1c){logger['info'](_0xb336('0x42'),_0x24638b);_0x987b5d[_0xb336('0x43')]=_0x499d1c['message'][_0xb336('0x43')];return rpc[_0x3e4a4b+_0xb336('0x2f')][_0xb336('0x44')](_0x987b5d);})['then'](function(_0xec6b85){logger['info'](_0xb336('0x1a'),_0x24638b,JSON[_0xb336('0x45')](_0xec6b85));})['catch'](function(_0x3de38f){logger['error'](_0xb336('0x46'),_0x24638b,JSON[_0xb336('0x45')](_0x3de38f));})[_0xb336('0x47')](function(){Promise[_0xb336('0x48')]()['then'](function(){if(_0x2610d7[0x0]!=='2'||_0x2a924f[_0xb336('0x1c')])return;return rpc[_0x3e4a4b+'Interaction'][_0xb336('0x49')](_0x2a924f['id'],{'autoreplyExecuted':!![]})[_0xb336('0x4a')](function(_0x5ba3fe){logger[_0xb336('0x19')](_0xb336('0x1d'),_0x24638b,JSON[_0xb336('0x45')](_0x5ba3fe));})[_0xb336('0x4b')](function(_0x41de0c){logger[_0xb336('0x4c')](_0xb336('0x4d'),_0x24638b,JSON[_0xb336('0x45')](_0x41de0c));});})['then'](function(){_0x488106[_0xb336('0x15')]();});});}else{return rpc[this['channel']+'Message'][_0xb336('0x44')](_0x987b5d)[_0xb336('0x4a')](function(_0x36b7fd){logger['info'](_0xb336('0x1a'),_0x24638b,_0x987b5d[_0xb336('0x13')]);})[_0xb336('0x4b')](function(_0x914310){logger[_0xb336('0x4c')]('[%s][AUTOREPLY]\x20%s',_0x24638b,JSON[_0xb336('0x45')](_0x914310));})[_0xb336('0x47')](function(){Promise[_0xb336('0x48')]()[_0xb336('0x4a')](function(){if(_0x2610d7[0x0]!=='2'||_0x2a924f[_0xb336('0x1c')])return;return rpc[_0x3e4a4b+'Interaction']['update'](_0x2a924f['id'],{'autoreplyExecuted':!![]})['then'](function(_0x5648c8){logger[_0xb336('0x19')](_0xb336('0x1d'),_0x24638b,JSON[_0xb336('0x45')](_0x5648c8));})[_0xb336('0x4b')](function(_0x5dfbd3){logger['error'](_0xb336('0x4d'),_0x24638b,JSON[_0xb336('0x45')](_0x5dfbd3));});})[_0xb336('0x4a')](function(){_0x488106['next']();});});}}}catch(_0x23a6fc){logger[_0xb336('0x4c')](_0xb336('0x1a'),_0x24638b,JSON[_0xb336('0x45')](_0x23a6fc));_0x488106[_0xb336('0x4e')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index bf4465c..5d2a8ed 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6d0=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','info','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing'];(function(_0x2ce288,_0x37702a){var _0x533008=function(_0x2d0a10){while(--_0x2d0a10){_0x2ce288['push'](_0x2ce288['shift']());}};_0x533008(++_0x37702a);}(_0xa6d0,0x11a));var _0x0a6d=function(_0x3d8a27,_0x46442d){_0x3d8a27=_0x3d8a27-0x0;var _0x9a0d4a=_0xa6d0[_0x3d8a27];return _0x9a0d4a;};'use strict';var moment=require(_0x0a6d('0x0'));var logger=require(_0x0a6d('0x1'))(_0x0a6d('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x0a6d('0x3')),'smsInteraction':require(_0x0a6d('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x0a6d('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x0a6d('0x6')]=function(_0x1369a3,_0x31ae8b,_0xb7bac3,_0x5ae3d8){return function(_0x3513db){try{logger[_0x0a6d('0x7')]('[%s][CLOSE]\x20reason\x20%s',_0x1369a3,_0x31ae8b[0x0]);var _0x5b7404={'closed':0x1,'closedAt':moment()['format'](_0x0a6d('0x8')),'closeReason':'system','disposition':_0x31ae8b[0x0]};if(rpc[_0x5ae3d8[_0x0a6d('0x9')]+_0x0a6d('0xa')]){rpc[_0x5ae3d8[_0x0a6d('0x9')]+_0x0a6d('0xa')][_0x0a6d('0xb')](_0x5ae3d8[_0x0a6d('0xc')]['id'],_0x5b7404)['then'](function(_0x1b142f){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x1369a3,_0x5ae3d8[_0x0a6d('0xc')]['id']);})[_0x0a6d('0xd')](function(_0x21915c){logger[_0x0a6d('0xe')](_0x0a6d('0xf'),_0x1369a3,JSON[_0x0a6d('0x10')](_0x21915c));})[_0x0a6d('0x11')](function(){_0x3513db[_0x0a6d('0x12')]();});}}catch(_0x5cc3b8){logger[_0x0a6d('0xe')](_0x0a6d('0xf'),_0x1369a3,JSON['stringify'](_0x5cc3b8));_0x3513db[_0x0a6d('0x12')]();}};}; \ No newline at end of file +var _0x3e76=['moment','../../../../config/logger','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','finally','stringify','stop'];(function(_0x7b7391,_0x334649){var _0x5e2a2f=function(_0x38bac3){while(--_0x38bac3){_0x7b7391['push'](_0x7b7391['shift']());}};_0x5e2a2f(++_0x334649);}(_0x3e76,0xb8));var _0x63e7=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x3e76[_0x295314];return _0x584b0c;};'use strict';var moment=require(_0x63e7('0x0'));var logger=require(_0x63e7('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x63e7('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x63e7('0x3')),'whatsappInteraction':require(_0x63e7('0x4'))};exports[_0x63e7('0x5')]=function(_0x5ce582,_0x48cca7,_0x396077,_0x4cf75c){return function(_0x10b05a){try{logger[_0x63e7('0x6')](_0x63e7('0x7'),_0x5ce582,_0x48cca7[0x0]);var _0x246637={'closed':0x1,'closedAt':moment()[_0x63e7('0x8')](_0x63e7('0x9')),'closeReason':_0x63e7('0xa'),'disposition':_0x48cca7[0x0]};if(rpc[_0x4cf75c['channel']+_0x63e7('0xb')]){rpc[_0x4cf75c[_0x63e7('0xc')]+_0x63e7('0xb')][_0x63e7('0xd')](_0x4cf75c['interaction']['id'],_0x246637)[_0x63e7('0xe')](function(_0xd07685){logger[_0x63e7('0x6')](_0x63e7('0xf'),_0x5ce582,_0x4cf75c[_0x63e7('0x10')]['id']);})[_0x63e7('0x11')](function(_0x49fda4){logger[_0x63e7('0x12')](_0x63e7('0x13'),_0x5ce582,JSON['stringify'](_0x49fda4));})[_0x63e7('0x14')](function(){_0x10b05a['stop']();});}}catch(_0xb01d3b){logger['error'](_0x63e7('0x13'),_0x5ce582,JSON[_0x63e7('0x15')](_0xb01d3b));_0x10b05a[_0x63e7('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 041cd0c..d5d6dc8 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda19=['next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','interaction','phone','ChatWebsiteId','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','info','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','providerName','moment','apiai-promise','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','[%s][DIALOGFLOW]\x20%s'];(function(_0x575cfe,_0x413cac){var _0x123bb0=function(_0x277580){while(--_0x277580){_0x575cfe['push'](_0x575cfe['shift']());}};_0x123bb0(++_0x413cac);}(_0xda19,0xd5));var _0x9da1=function(_0x39c117,_0x3c40a2){_0x39c117=_0x39c117-0x0;var _0x48cce0=_0xda19[_0x39c117];return _0x48cce0;};'use strict';var _=require('lodash');var moment=require(_0x9da1('0x0'));var apiai=require(_0x9da1('0x1'));var md5=require('md5');var utils=require(_0x9da1('0x2'));var logger=require('../../../../config/logger')(_0x9da1('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x9da1('0x4')),'mailMessage':require(_0x9da1('0x5')),'smsMessage':require(_0x9da1('0x6')),'faxMessage':require(_0x9da1('0x7')),'whatsappMessage':require(_0x9da1('0x8'))};exports[_0x9da1('0x9')]=function(_0x23e4f7,_0x2c3cdd){return function(_0x1c24e6){try{if(!_[_0x9da1('0xa')](this['interaction']['UserId'])){logger['info'](_0x9da1('0xb'),_0x23e4f7,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1c24e6[_0x9da1('0xc')]();}var _0x1cca84={'ContactId':this[_0x9da1('0xd')]['id'],'sentAt':moment()[_0x9da1('0xe')](_0x9da1('0xf')),'direction':_0x9da1('0x10')};if(this[_0x9da1('0x11')]==='sms'||this['channel']===_0x9da1('0x12')){_0x1cca84['phone']=this[_0x9da1('0x13')][_0x9da1('0x14')];}var _0xd2d225=this[_0x9da1('0x11')];if(_0xd2d225==='chat'){_0x1cca84[_0x9da1('0x15')]=this['account']['id'];}else{_0x1cca84[_['upperFirst'](_0xd2d225)+_0x9da1('0x16')]=this['account']['id'];}_0x1cca84[_[_0x9da1('0x17')](_0xd2d225)+_0x9da1('0x18')]=this[_0x9da1('0x13')]['id'];if(this[_0x9da1('0x13')][_0x9da1('0x19')]){var _0x514d8e=_0x2c3cdd[0x2];if(!_[_0x9da1('0x1a')](_0x514d8e)){_0x1cca84[_0x9da1('0x1b')]=utils[_0x9da1('0x1c')](_0x514d8e,this);return rpc[_0xd2d225+_0x9da1('0x1d')][_0x9da1('0x1e')](_0x1cca84)[_0x9da1('0x1f')](function(_0x497676){logger['info'](_0x9da1('0xb'),_0x23e4f7,_0x1cca84[_0x9da1('0x1b')]);})[_0x9da1('0x20')](function(_0x41e555){logger[_0x9da1('0x21')](_0x9da1('0xb'),_0x23e4f7,JSON[_0x9da1('0x22')](_0x41e555));})['finally'](function(){logger[_0x9da1('0x23')](_0x9da1('0x24'),_0x23e4f7);_0x1c24e6[_0x9da1('0x25')]();});}else{logger[_0x9da1('0x23')](_0x9da1('0x26'),_0x23e4f7);_0x1c24e6['stop']();}}else{var _0x5454d3=this;var _0x14793b=apiai(_0x2c3cdd[0x0],{'language':_0x2c3cdd[0x1]||'en'});return _0x14793b[_0x9da1('0x27')](this[_0x9da1('0x28')][_0x9da1('0x1b')],{'sessionId':md5(this[_0x9da1('0x13')]['id'])})[_0x9da1('0x1f')](function(_0x4c60aa){_0x5454d3[_0x9da1('0x1b')][_0x9da1('0x29')]=_0x4c60aa;_0x1cca84['body']=_0x4c60aa[_0x9da1('0x2a')][_0x9da1('0x2b')]['speech'];_0x1cca84[_0x9da1('0x2c')]=_0x9da1('0x29');_0x1cca84['providerResponse']=JSON[_0x9da1('0x22')](_0x4c60aa);return rpc[_0xd2d225+_0x9da1('0x1d')]['create'](_0x1cca84)['then'](function(_0x67dbc8){logger[_0x9da1('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x23e4f7,_0x1cca84[_0x9da1('0x1b')]);if(_0x4c60aa['result']['metadata']['endConversation']){_0x1c24e6[_0x9da1('0xc')]();}else{_0x1c24e6[_0x9da1('0x25')]();}})[_0x9da1('0x20')](function(_0x26dd58){logger[_0x9da1('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x23e4f7,JSON[_0x9da1('0x22')](_0x26dd58));_0x1c24e6['next']();});})[_0x9da1('0x20')](function(_0x235ced){logger['error'](_0x9da1('0xb'),_0x23e4f7,_0x235ced[_0x9da1('0x28')]);_0x1c24e6['next']();});}}catch(_0x1a0771){logger[_0x9da1('0x21')](_0x9da1('0xb'),_0x23e4f7,JSON[_0x9da1('0x22')](_0x1a0771));_0x1c24e6['stop']();}};}; \ No newline at end of file +var _0x2f4a=['./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','next','contact','format','out','sms','channel','phone','ChatWebsiteId','account','upperFirst','AccountId','isEmpty','body','getMustacheRender','info','[%s][DIALOGFLOW]\x20%s','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','then','dialogflow','result','speech','providerName','providerResponse','Message','create','metadata','endConversation','error','message','lodash','moment','apiai-promise','md5'];(function(_0x446862,_0x1c4e2e){var _0x2fc938=function(_0x393b67){while(--_0x393b67){_0x446862['push'](_0x446862['shift']());}};_0x2fc938(++_0x1c4e2e);}(_0x2f4a,0x8f));var _0xa2f4=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x2f4a[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0xa2f4('0x0'));var moment=require(_0xa2f4('0x1'));var apiai=require(_0xa2f4('0x2'));var md5=require(_0xa2f4('0x3'));var utils=require(_0xa2f4('0x4'));var logger=require(_0xa2f4('0x5'))(_0xa2f4('0x6'));var rpc={'chatMessage':require(_0xa2f4('0x7')),'openchannelMessage':require(_0xa2f4('0x8')),'mailMessage':require(_0xa2f4('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xa2f4('0xa')),'whatsappMessage':require(_0xa2f4('0xb'))};exports[_0xa2f4('0xc')]=function(_0x151045,_0x2cd086){return function(_0x194ee8){try{if(!_['isNil'](this[_0xa2f4('0xd')]['UserId'])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x151045,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x194ee8[_0xa2f4('0xe')]();}var _0x1a8c24={'ContactId':this[_0xa2f4('0xf')]['id'],'sentAt':moment()[_0xa2f4('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa2f4('0x11')};if(this['channel']===_0xa2f4('0x12')||this[_0xa2f4('0x13')]==='whatsapp'){_0x1a8c24[_0xa2f4('0x14')]=this['interaction'][_0xa2f4('0x14')];}var _0x485447=this[_0xa2f4('0x13')];if(_0x485447==='chat'){_0x1a8c24[_0xa2f4('0x15')]=this[_0xa2f4('0x16')]['id'];}else{_0x1a8c24[_[_0xa2f4('0x17')](_0x485447)+_0xa2f4('0x18')]=this[_0xa2f4('0x16')]['id'];}_0x1a8c24[_[_0xa2f4('0x17')](_0x485447)+'InteractionId']=this[_0xa2f4('0xd')]['id'];if(this[_0xa2f4('0xd')]['created']){var _0x4ae792=_0x2cd086[0x2];if(!_[_0xa2f4('0x19')](_0x4ae792)){_0x1a8c24[_0xa2f4('0x1a')]=utils[_0xa2f4('0x1b')](_0x4ae792,this);return rpc[_0x485447+'Message']['create'](_0x1a8c24)['then'](function(_0x5a0aa3){logger[_0xa2f4('0x1c')](_0xa2f4('0x1d'),_0x151045,_0x1a8c24['body']);})[_0xa2f4('0x1e')](function(_0x426013){logger['error'](_0xa2f4('0x1d'),_0x151045,JSON[_0xa2f4('0x1f')](_0x426013));})[_0xa2f4('0x20')](function(){logger[_0xa2f4('0x1c')](_0xa2f4('0x21'),_0x151045);_0x194ee8[_0xa2f4('0x22')]();});}else{logger[_0xa2f4('0x1c')](_0xa2f4('0x23'),_0x151045);_0x194ee8[_0xa2f4('0x22')]();}}else{var _0x21dce2=this;var _0x47c203=apiai(_0x2cd086[0x0],{'language':_0x2cd086[0x1]||'en'});return _0x47c203[_0xa2f4('0x24')](this['message'][_0xa2f4('0x1a')],{'sessionId':md5(this['interaction']['id'])})[_0xa2f4('0x25')](function(_0x235cae){_0x21dce2[_0xa2f4('0x1a')][_0xa2f4('0x26')]=_0x235cae;_0x1a8c24['body']=_0x235cae[_0xa2f4('0x27')]['fulfillment'][_0xa2f4('0x28')];_0x1a8c24[_0xa2f4('0x29')]='dialogflow';_0x1a8c24[_0xa2f4('0x2a')]=JSON[_0xa2f4('0x1f')](_0x235cae);return rpc[_0x485447+_0xa2f4('0x2b')][_0xa2f4('0x2c')](_0x1a8c24)[_0xa2f4('0x25')](function(_0x49824c){logger[_0xa2f4('0x1c')](_0xa2f4('0x1d'),_0x151045,_0x1a8c24[_0xa2f4('0x1a')]);if(_0x235cae[_0xa2f4('0x27')][_0xa2f4('0x2d')][_0xa2f4('0x2e')]){_0x194ee8[_0xa2f4('0xe')]();}else{_0x194ee8[_0xa2f4('0x22')]();}})[_0xa2f4('0x1e')](function(_0x3650fc){logger[_0xa2f4('0x2f')](_0xa2f4('0x1d'),_0x151045,JSON[_0xa2f4('0x1f')](_0x3650fc));_0x194ee8['next']();});})[_0xa2f4('0x1e')](function(_0x4bfd92){logger[_0xa2f4('0x2f')](_0xa2f4('0x1d'),_0x151045,_0x4bfd92[_0xa2f4('0x30')]);_0x194ee8[_0xa2f4('0xe')]();});}}catch(_0x383f9d){logger[_0xa2f4('0x2f')](_0xa2f4('0x1d'),_0x151045,JSON['stringify'](_0x383f9d));_0x194ee8[_0xa2f4('0x22')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 4940dea..0c9ec31 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf1e=['sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','isEmpty','getMustacheRender','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','diagnosticInfo','queryResult','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','fulfillmentText','all','next','md5','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel'];(function(_0x27ee1c,_0x5d93b7){var _0x226db3=function(_0x55f2a2){while(--_0x55f2a2){_0x27ee1c['push'](_0x27ee1c['shift']());}};_0x226db3(++_0x5d93b7);}(_0xbf1e,0x75));var _0xebf1=function(_0x26a0d4,_0x33ceb1){_0x26a0d4=_0x26a0d4-0x0;var _0x3e1ed4=_0xbf1e[_0x26a0d4];return _0x3e1ed4;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0xebf1('0x0'));var moment=require('moment');var Promise=require(_0xebf1('0x1'));var logger=require(_0xebf1('0x2'))(_0xebf1('0x3'));var utils=require('./utils');var rpc={'chatMessage':require(_0xebf1('0x4')),'openchannelMessage':require(_0xebf1('0x5')),'mailMessage':require(_0xebf1('0x6')),'smsMessage':require(_0xebf1('0x7')),'faxMessage':require(_0xebf1('0x8')),'whatsappMessage':require(_0xebf1('0x9'))};function createMessage(_0x3019ec,_0x1dd664,_0x5d58a7,_0x3a5521){return new Promise(function(_0x2ea308,_0x11f7b0){var _0x26c6da=_['clone'](_0x5d58a7);_0x26c6da[_0xebf1('0xa')]=_0x3a5521;return rpc[_0x1dd664+_0xebf1('0xb')][_0xebf1('0xc')](_0x26c6da)[_0xebf1('0xd')](function(){logger[_0xebf1('0xe')](_0xebf1('0xf'),_0x3019ec,_0x26c6da[_0xebf1('0xa')]);_0x2ea308();})[_0xebf1('0x10')](function(_0x21453e){logger[_0xebf1('0x11')](_0xebf1('0xf'),_0x3019ec,JSON[_0xebf1('0x12')](_0x21453e));_0x11f7b0(_0x21453e);});});}exports[_0xebf1('0x13')]=function(_0x385d25,_0x7686a7){return function(_0xd949){try{if(!_[_0xebf1('0x14')](this[_0xebf1('0x15')][_0xebf1('0x16')])){logger[_0xebf1('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x385d25,_0xebf1('0x17'));return _0xd949['next']();}var _0x40e8f7={'ContactId':this[_0xebf1('0x18')]['id'],'sentAt':moment()[_0xebf1('0x19')](_0xebf1('0x1a')),'direction':_0xebf1('0x1b')};if(this[_0xebf1('0x1c')]===_0xebf1('0x1d')||this[_0xebf1('0x1c')]===_0xebf1('0x1e')){_0x40e8f7[_0xebf1('0x1f')]=this[_0xebf1('0x15')][_0xebf1('0x1f')];}var _0x143984=this[_0xebf1('0x1c')];if(_0x143984===_0xebf1('0x20')){_0x40e8f7[_0xebf1('0x21')]=this['account']['id'];}else{_0x40e8f7[_[_0xebf1('0x22')](_0x143984)+_0xebf1('0x23')]=this[_0xebf1('0x24')]['id'];}_0x40e8f7[_['upperFirst'](_0x143984)+_0xebf1('0x25')]=this[_0xebf1('0x15')]['id'];if(this[_0xebf1('0x15')]['created']){var _0x3fea69=_0x7686a7[0x4];if(!_[_0xebf1('0x26')](_0x3fea69)){_0x40e8f7['body']=utils[_0xebf1('0x27')](_0x3fea69,this);return rpc[_0x143984+_0xebf1('0xb')][_0xebf1('0xc')](_0x40e8f7)[_0xebf1('0xd')](function(_0x44e818){logger[_0xebf1('0xe')](_0xebf1('0xf'),_0x385d25,_0x40e8f7['body']);})[_0xebf1('0x10')](function(_0x3415c5){logger[_0xebf1('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x385d25,JSON['stringify'](_0x3415c5));})[_0xebf1('0x28')](function(){logger[_0xebf1('0xe')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x385d25);_0xd949[_0xebf1('0x29')]();});}else{logger[_0xebf1('0xe')](_0xebf1('0x2a'),_0x385d25);_0xd949[_0xebf1('0x29')]();}}else{var _0x42d62f=this;var _0x5ca250=_0x7686a7[0x2]['replace'](/\\n/g,'\x0a');var _0x132ff3={'credentials':{'private_key':_0x5ca250,'client_email':_0x7686a7[0x1]}};var _0x83bdcd=new dialogflow[(_0xebf1('0x2b'))](_0x132ff3);var _0x23988d=_0x83bdcd[_0xebf1('0x2c')](_0x7686a7[0x0],md5(_0x42d62f[_0xebf1('0x15')]['id']));var _0x4d9bde={'session':_0x23988d,'queryInput':{'text':{'text':_0x42d62f[_0xebf1('0x2d')][_0xebf1('0xa')],'languageCode':_0x7686a7[0x3]||'en'}}};return _0x83bdcd[_0xebf1('0x2e')](_0x4d9bde)[_0xebf1('0xd')](function(_0xbfcbc0){if(_0xbfcbc0&&_0xbfcbc0[_0xebf1('0x2f')]){_0x42d62f[_0xebf1('0xa')][_0xebf1('0x30')]=_0xbfcbc0;var _0x305263=_0xbfcbc0[0x0];var _0x4a08e9=_0x305263['queryResult'][_0xebf1('0x31')]&&_0x305263[_0xebf1('0x32')]['diagnosticInfo']['fields']?_0x305263['queryResult'][_0xebf1('0x31')][_0xebf1('0x33')][_0xebf1('0x34')][_0xebf1('0x35')]:![];_0x42d62f[_0xebf1('0xa')][_0xebf1('0x36')]=_0x305263[_0xebf1('0x32')][_0xebf1('0x37')];_0x42d62f[_0xebf1('0xa')][_0xebf1('0x38')]=_0x305263[_0xebf1('0x32')][_0xebf1('0x39')];_0x42d62f[_0xebf1('0xa')][_0xebf1('0x3a')]=_0x305263[_0xebf1('0x32')][_0xebf1('0x31')]&&_0x305263[_0xebf1('0x32')][_0xebf1('0x31')]['fields']?_0x305263[_0xebf1('0x32')]['diagnosticInfo'][_0xebf1('0x33')][_0xebf1('0x34')][_0xebf1('0x35')]:![];_0x42d62f['body']['DIALOGFLOWV2_INTENTNAME']=_0x305263[_0xebf1('0x32')][_0xebf1('0x3b')][_0xebf1('0x3c')];_0x42d62f['body'][_0xebf1('0x3d')]=_0x305263[_0xebf1('0x32')][_0xebf1('0x3b')][_0xebf1('0x3e')];_0x42d62f[_0xebf1('0xa')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x305263[_0xebf1('0x32')][_0xebf1('0x3b')][_0xebf1('0x3f')];_0x42d62f[_0xebf1('0xa')][_0xebf1('0x40')]=_0x305263[_0xebf1('0x32')][_0xebf1('0x41')];_0x42d62f['body']['DIALOGFLOWV2_QUERYTEXT']=_0x305263[_0xebf1('0x32')][_0xebf1('0x42')];_0x42d62f[_0xebf1('0xa')][_0xebf1('0x43')]=_0x305263[_0xebf1('0x32')][_0xebf1('0x44')];_0x40e8f7['providerName']='dialogflowV2';_0x40e8f7[_0xebf1('0x45')]=JSON[_0xebf1('0x12')](_0xbfcbc0);var _0x7e6cdd=[];for(var _0x5ad38b=0x0;_0x5ad38b<_0xbfcbc0[_0xebf1('0x2f')];_0x5ad38b++){var _0x767a7e=_0xbfcbc0[_0x5ad38b];if(_0x767a7e&&_0x767a7e['queryResult']&&_0x767a7e[_0xebf1('0x32')][_0xebf1('0x46')]){_0x7e6cdd['push'](createMessage(_0x385d25,_0x143984,_0x40e8f7,_0x767a7e['queryResult'][_0xebf1('0x46')]));}}return Promise[_0xebf1('0x47')](_0x7e6cdd)[_0xebf1('0xd')](function(){if(_0x4a08e9){_0xd949[_0xebf1('0x48')]();}else{_0xd949[_0xebf1('0x29')]();}})[_0xebf1('0x10')](function(_0x2c5778){logger[_0xebf1('0x11')](_0xebf1('0xf'),_0x385d25,JSON[_0xebf1('0x12')](_0x2c5778));_0xd949[_0xebf1('0x48')]();});}})[_0xebf1('0x10')](function(_0x554375){logger[_0xebf1('0x11')](_0xebf1('0xf'),_0x385d25,_0x554375[_0xebf1('0x2d')]);_0xd949['next']();});}}catch(_0x352901){logger['error'](_0xebf1('0xf'),_0x385d25,JSON['stringify'](_0x352901));_0xd949[_0xebf1('0x29')]();}};}; \ No newline at end of file +var _0xeed7=['allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','md5','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','body','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action'];(function(_0x190148,_0xda6bdd){var _0x5009de=function(_0x19c769){while(--_0x19c769){_0x190148['push'](_0x190148['shift']());}};_0x5009de(++_0xda6bdd);}(_0xeed7,0xdf));var _0x7eed=function(_0x5541b5,_0xfa0023){_0x5541b5=_0x5541b5-0x0;var _0x763958=_0xeed7[_0x5541b5];return _0x763958;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0x7eed('0x0'));var moment=require(_0x7eed('0x1'));var Promise=require('bluebird');var logger=require(_0x7eed('0x2'))(_0x7eed('0x3'));var utils=require(_0x7eed('0x4'));var rpc={'chatMessage':require(_0x7eed('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x7eed('0x6')),'smsMessage':require(_0x7eed('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x7eed('0x8'))};function createMessage(_0x50ab76,_0x3438fa,_0x518cea,_0x5847fd){return new Promise(function(_0x37c0af,_0x1fec59){var _0x46ee90=_['clone'](_0x518cea);_0x46ee90[_0x7eed('0x9')]=_0x5847fd;return rpc[_0x3438fa+'Message']['create'](_0x46ee90)[_0x7eed('0xa')](function(){logger[_0x7eed('0xb')](_0x7eed('0xc'),_0x50ab76,_0x46ee90[_0x7eed('0x9')]);_0x37c0af();})[_0x7eed('0xd')](function(_0x2d47dc){logger[_0x7eed('0xe')](_0x7eed('0xc'),_0x50ab76,JSON[_0x7eed('0xf')](_0x2d47dc));_0x1fec59(_0x2d47dc);});});}exports['consequence']=function(_0x7f5aa4,_0x682b77){return function(_0x54ae73){try{if(!_['isNil'](this['interaction'][_0x7eed('0x10')])){logger[_0x7eed('0xb')](_0x7eed('0xc'),_0x7f5aa4,_0x7eed('0x11'));return _0x54ae73[_0x7eed('0x12')]();}var _0x55426b={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x7eed('0x13')),'direction':'out'};if(this['channel']==='sms'||this[_0x7eed('0x14')]===_0x7eed('0x15')){_0x55426b[_0x7eed('0x16')]=this[_0x7eed('0x17')][_0x7eed('0x16')];}var _0x13df98=this[_0x7eed('0x14')];if(_0x13df98===_0x7eed('0x18')){_0x55426b[_0x7eed('0x19')]=this[_0x7eed('0x1a')]['id'];}else{_0x55426b[_[_0x7eed('0x1b')](_0x13df98)+_0x7eed('0x1c')]=this[_0x7eed('0x1a')]['id'];}_0x55426b[_[_0x7eed('0x1b')](_0x13df98)+'InteractionId']=this[_0x7eed('0x17')]['id'];if(this['interaction'][_0x7eed('0x1d')]){var _0x50f58c=_0x682b77[0x4];if(!_[_0x7eed('0x1e')](_0x50f58c)){_0x55426b[_0x7eed('0x9')]=utils['getMustacheRender'](_0x50f58c,this);return rpc[_0x13df98+'Message']['create'](_0x55426b)[_0x7eed('0xa')](function(_0x451e71){logger[_0x7eed('0xb')](_0x7eed('0xc'),_0x7f5aa4,_0x55426b[_0x7eed('0x9')]);})[_0x7eed('0xd')](function(_0x329e5f){logger[_0x7eed('0xe')](_0x7eed('0xc'),_0x7f5aa4,JSON[_0x7eed('0xf')](_0x329e5f));})[_0x7eed('0x1f')](function(){logger[_0x7eed('0xb')](_0x7eed('0x20'),_0x7f5aa4);_0x54ae73[_0x7eed('0x21')]();});}else{logger[_0x7eed('0xb')](_0x7eed('0x22'),_0x7f5aa4);_0x54ae73[_0x7eed('0x21')]();}}else{var _0x34c4ac=this;var _0x1ee2e5=_0x682b77[0x2][_0x7eed('0x23')](/\\n/g,'\x0a');var _0x4482e6={'credentials':{'private_key':_0x1ee2e5,'client_email':_0x682b77[0x1]}};var _0x356828=new dialogflow[(_0x7eed('0x24'))](_0x4482e6);var _0x764ea3=_0x356828[_0x7eed('0x25')](_0x682b77[0x0],md5(_0x34c4ac[_0x7eed('0x17')]['id']));var _0x4016ca={'session':_0x764ea3,'queryInput':{'text':{'text':_0x34c4ac[_0x7eed('0x26')][_0x7eed('0x9')],'languageCode':_0x682b77[0x3]||'en'}}};return _0x356828[_0x7eed('0x27')](_0x4016ca)[_0x7eed('0xa')](function(_0x3d6e09){if(_0x3d6e09&&_0x3d6e09[_0x7eed('0x28')]){_0x34c4ac[_0x7eed('0x9')][_0x7eed('0x29')]=_0x3d6e09;var _0x3fa0b8=_0x3d6e09[0x0];var _0x55fae2=_0x3fa0b8[_0x7eed('0x2a')][_0x7eed('0x2b')]&&_0x3fa0b8[_0x7eed('0x2a')][_0x7eed('0x2b')][_0x7eed('0x2c')]?_0x3fa0b8['queryResult']['diagnosticInfo']['fields'][_0x7eed('0x2d')][_0x7eed('0x2e')]:![];_0x34c4ac[_0x7eed('0x9')][_0x7eed('0x2f')]=_0x3fa0b8['queryResult'][_0x7eed('0x30')];_0x34c4ac[_0x7eed('0x9')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x3fa0b8['queryResult'][_0x7eed('0x31')];_0x34c4ac[_0x7eed('0x9')][_0x7eed('0x32')]=_0x3fa0b8['queryResult'][_0x7eed('0x2b')]&&_0x3fa0b8['queryResult'][_0x7eed('0x2b')][_0x7eed('0x2c')]?_0x3fa0b8[_0x7eed('0x2a')][_0x7eed('0x2b')][_0x7eed('0x2c')][_0x7eed('0x2d')][_0x7eed('0x2e')]:![];_0x34c4ac[_0x7eed('0x9')]['DIALOGFLOWV2_INTENTNAME']=_0x3fa0b8[_0x7eed('0x2a')][_0x7eed('0x33')][_0x7eed('0x34')];_0x34c4ac[_0x7eed('0x9')][_0x7eed('0x35')]=_0x3fa0b8[_0x7eed('0x2a')][_0x7eed('0x33')][_0x7eed('0x36')];_0x34c4ac[_0x7eed('0x9')][_0x7eed('0x37')]=_0x3fa0b8[_0x7eed('0x2a')]['intent'][_0x7eed('0x38')];_0x34c4ac[_0x7eed('0x9')][_0x7eed('0x39')]=_0x3fa0b8['queryResult'][_0x7eed('0x3a')];_0x34c4ac['body'][_0x7eed('0x3b')]=_0x3fa0b8[_0x7eed('0x2a')][_0x7eed('0x3c')];_0x34c4ac[_0x7eed('0x9')][_0x7eed('0x3d')]=_0x3fa0b8[_0x7eed('0x2a')][_0x7eed('0x3e')];_0x55426b[_0x7eed('0x3f')]=_0x7eed('0x29');_0x55426b[_0x7eed('0x40')]=JSON[_0x7eed('0xf')](_0x3d6e09);var _0x5e8c17=[];for(var _0x1ca060=0x0;_0x1ca060<_0x3d6e09[_0x7eed('0x28')];_0x1ca060++){var _0x51658f=_0x3d6e09[_0x1ca060];if(_0x51658f&&_0x51658f[_0x7eed('0x2a')]&&_0x51658f[_0x7eed('0x2a')][_0x7eed('0x41')]){_0x5e8c17[_0x7eed('0x42')](createMessage(_0x7f5aa4,_0x13df98,_0x55426b,_0x51658f[_0x7eed('0x2a')][_0x7eed('0x41')]));}}return Promise[_0x7eed('0x43')](_0x5e8c17)[_0x7eed('0xa')](function(){if(_0x55fae2){_0x54ae73[_0x7eed('0x12')]();}else{_0x54ae73[_0x7eed('0x21')]();}})['catch'](function(_0x2cfc7f){logger[_0x7eed('0xe')](_0x7eed('0xc'),_0x7f5aa4,JSON[_0x7eed('0xf')](_0x2cfc7f));_0x54ae73[_0x7eed('0x12')]();});}})[_0x7eed('0xd')](function(_0x3e2cb2){logger[_0x7eed('0xe')](_0x7eed('0xc'),_0x7f5aa4,_0x3e2cb2[_0x7eed('0x26')]);_0x54ae73[_0x7eed('0x12')]();});}}catch(_0x21a4f4){logger[_0x7eed('0xe')](_0x7eed('0xc'),_0x7f5aa4,JSON[_0x7eed('0xf')](_0x21a4f4));_0x54ae73['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 78b198e..16a42c9 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x74b2=['[%s][GOTOIF]\x20%s','stringify','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','validate','length','error','map','message','stop','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x74b2,0x84));var _0x274b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x74b2[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0x274b('0x0'));var utils=require('./utils');var logger=require(_0x274b('0x1'))(_0x274b('0x2'));var gotoif=schema({'condition':{'type':_0x274b('0x3'),'required':!![],'message':_0x274b('0x4')},'priorityTrue':{'type':_0x274b('0x5'),'message':_0x274b('0x6')},'priorityFalse':{'type':_0x274b('0x5'),'message':_0x274b('0x7')}});exports['consequence']=function(_0x4b4b7a,_0x3d7a1f){return function(_0x6a23e8){try{var _0x18d46b={'condition':htmlToText[_0x274b('0x8')](utils[_0x274b('0x9')](_0x3d7a1f[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3d7a1f[0x1],'priorityFalse':_0x3d7a1f[0x2]};var _0x33dd78=gotoif[_0x274b('0xa')](_0x18d46b,{'typecast':!![]});if(_0x33dd78[_0x274b('0xb')]){logger[_0x274b('0xc')]('[%s][GOTOIF]\x20%s',_0x4b4b7a,_[_0x274b('0xd')](_0x33dd78,_0x274b('0xe'))['join'](',\x20'));_0x6a23e8[_0x274b('0xf')]();}else{try{var _0x46482a=eval('('+_0x18d46b['condition']+')');var _0x521036=_0x46482a?_0x18d46b['priorityTrue']:_0x18d46b[_0x274b('0x10')];logger[_0x274b('0x11')](_0x274b('0x12'),_0x4b4b7a,_0x18d46b[_0x274b('0x13')],_0x46482a,_0x521036||_0x274b('0x14'));if(_0x521036){var _0x1160b2=_[_0x274b('0x15')](_0x6a23e8[_0x274b('0x16')](),{'p':_0x521036});if(_0x1160b2>=0x0){logger['info'](_0x274b('0x17'),_0x4b4b7a,_0x521036||_0x274b('0x14'),_0x1160b2);_0x6a23e8[_0x274b('0x14')](_0x1160b2);}else{logger[_0x274b('0x11')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x4b4b7a,_0x521036||_0x274b('0x14'));_0x6a23e8[_0x274b('0xf')]();}}else{_0x6a23e8['next']();}}catch(_0x3816be){logger[_0x274b('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x4b4b7a,_0x3816be[_0x274b('0xe')]);_0x6a23e8[_0x274b('0xf')]();}}}catch(_0x491aff){logger['error'](_0x274b('0x18'),_0x4b4b7a,JSON[_0x274b('0x19')](_0x491aff));_0x6a23e8[_0x274b('0xf')]();}};}; \ No newline at end of file +var _0x6127=['findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','error','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','[%s][GOTOIF]\x20%s','map','message','join','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next'];(function(_0xb37589,_0x27058d){var _0x42ce47=function(_0x35c9b3){while(--_0x35c9b3){_0xb37589['push'](_0xb37589['shift']());}};_0x42ce47(++_0x27058d);}(_0x6127,0x1d8));var _0x7612=function(_0x1ae125,_0x20820a){_0x1ae125=_0x1ae125-0x0;var _0x1f3b2b=_0x6127[_0x1ae125];return _0x1f3b2b;};'use strict';var schema=require(_0x7612('0x0'));var _=require(_0x7612('0x1'));var htmlToText=require(_0x7612('0x2'));var utils=require(_0x7612('0x3'));var logger=require(_0x7612('0x4'))(_0x7612('0x5'));var gotoif=schema({'condition':{'type':_0x7612('0x6'),'required':!![],'message':_0x7612('0x7')},'priorityTrue':{'type':_0x7612('0x8'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x7612('0x8'),'message':_0x7612('0x9')}});exports[_0x7612('0xa')]=function(_0x30ce55,_0x2cb65e){return function(_0x28974d){try{var _0x1f1d33={'condition':htmlToText[_0x7612('0xb')](utils[_0x7612('0xc')](_0x2cb65e[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2cb65e[0x1],'priorityFalse':_0x2cb65e[0x2]};var _0x49c0bf=gotoif[_0x7612('0x0')](_0x1f1d33,{'typecast':!![]});if(_0x49c0bf[_0x7612('0xd')]){logger['error'](_0x7612('0xe'),_0x30ce55,_[_0x7612('0xf')](_0x49c0bf,_0x7612('0x10'))[_0x7612('0x11')](',\x20'));_0x28974d['stop']();}else{try{var _0x4e7cfe=eval('('+_0x1f1d33['condition']+')');var _0x366a09=_0x4e7cfe?_0x1f1d33[_0x7612('0x12')]:_0x1f1d33[_0x7612('0x13')];logger[_0x7612('0x14')](_0x7612('0x15'),_0x30ce55,_0x1f1d33[_0x7612('0x16')],_0x4e7cfe,_0x366a09||_0x7612('0x17'));if(_0x366a09){var _0xba3112=_[_0x7612('0x18')](_0x28974d[_0x7612('0x19')](),{'p':_0x366a09});if(_0xba3112>=0x0){logger[_0x7612('0x14')](_0x7612('0x1a'),_0x30ce55,_0x366a09||'next',_0xba3112);_0x28974d[_0x7612('0x17')](_0xba3112);}else{logger[_0x7612('0x14')](_0x7612('0x1b'),_0x30ce55,_0x366a09||'next');_0x28974d['stop']();}}else{_0x28974d[_0x7612('0x17')]();}}catch(_0x1c5b1e){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x30ce55,_0x1c5b1e[_0x7612('0x10')]);_0x28974d[_0x7612('0x1c')]();}}}catch(_0x1b7e6c){logger[_0x7612('0x1d')](_0x7612('0xe'),_0x30ce55,JSON[_0x7612('0x1e')](_0x1b7e6c));_0x28974d['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 8ce2e0c..2a4f2a0 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 _0x4be7=['[%s][GOTOP]\x20priority\x20%s','priority','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOP]\x20%s','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','map','message','join','stop'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x4be7,0x15a));var _0x74be=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x4be7[_0x36ed48];return _0x51c63a;};'use strict';var schema=require(_0x74be('0x0'));var _=require('lodash');var logger=require(_0x74be('0x1'))(_0x74be('0x2'));var gotop=schema({'priority':{'type':_0x74be('0x3'),'required':!![],'message':_0x74be('0x4')}});exports[_0x74be('0x5')]=function(_0x3ddd2e,_0x2481ba){return function(_0x2c9fbe){try{var _0x52ef3a={'priority':_0x2481ba[0x0]};var _0x3663f8=gotop[_0x74be('0x0')](_0x52ef3a,{'typecast':!![]});if(_0x3663f8[_0x74be('0x6')]){logger['error']('[%s][GOTOP]\x20%s',_0x3ddd2e,_[_0x74be('0x7')](_0x3663f8,_0x74be('0x8'))[_0x74be('0x9')](',\x20'));_0x2c9fbe[_0x74be('0xa')]();}else{logger['info'](_0x74be('0xb'),_0x3ddd2e,_0x52ef3a[_0x74be('0xc')]);if(_0x52ef3a[_0x74be('0xc')]){var _0x56e971=_['findIndex'](_0x2c9fbe[_0x74be('0xd')](),{'p':_0x52ef3a[_0x74be('0xc')]});if(_0x56e971>=0x0){logger[_0x74be('0xe')](_0x74be('0xf'),_0x3ddd2e,_0x52ef3a[_0x74be('0xc')]||_0x74be('0x10'),_0x56e971);_0x2c9fbe['next'](_0x56e971);}else{logger[_0x74be('0xe')](_0x74be('0x11'),_0x3ddd2e,_0x52ef3a[_0x74be('0xc')]||_0x74be('0x10'));_0x2c9fbe[_0x74be('0xa')]();}}else{_0x2c9fbe[_0x74be('0x10')]();}}}catch(_0x221e1b){logger[_0x74be('0x12')](_0x74be('0x13'),_0x3ddd2e,JSON[_0x74be('0x14')](_0x221e1b));_0x2c9fbe['stop']();}};}; \ No newline at end of file +var _0xb2ea=['stop','info','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','message','join'];(function(_0x563129,_0x26d5f9){var _0x28d1a3=function(_0x2c2d43){while(--_0x2c2d43){_0x563129['push'](_0x563129['shift']());}};_0x28d1a3(++_0x26d5f9);}(_0xb2ea,0x170));var _0xab2e=function(_0x17e0ff,_0x4dbd1e){_0x17e0ff=_0x17e0ff-0x0;var _0x357979=_0xb2ea[_0x17e0ff];return _0x357979;};'use strict';var schema=require(_0xab2e('0x0'));var _=require(_0xab2e('0x1'));var logger=require(_0xab2e('0x2'))(_0xab2e('0x3'));var gotop=schema({'priority':{'type':_0xab2e('0x4'),'required':!![],'message':_0xab2e('0x5')}});exports[_0xab2e('0x6')]=function(_0x2ee255,_0x51009f){return function(_0x1d80ee){try{var _0x556a0={'priority':_0x51009f[0x0]};var _0x4223f8=gotop[_0xab2e('0x0')](_0x556a0,{'typecast':!![]});if(_0x4223f8['length']){logger[_0xab2e('0x7')](_0xab2e('0x8'),_0x2ee255,_[_0xab2e('0x9')](_0x4223f8,_0xab2e('0xa'))[_0xab2e('0xb')](',\x20'));_0x1d80ee[_0xab2e('0xc')]();}else{logger[_0xab2e('0xd')]('[%s][GOTOP]\x20priority\x20%s',_0x2ee255,_0x556a0[_0xab2e('0xe')]);if(_0x556a0[_0xab2e('0xe')]){var _0x28b8e6=_[_0xab2e('0xf')](_0x1d80ee[_0xab2e('0x10')](),{'p':_0x556a0[_0xab2e('0xe')]});if(_0x28b8e6>=0x0){logger[_0xab2e('0xd')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2ee255,_0x556a0[_0xab2e('0xe')]||_0xab2e('0x11'),_0x28b8e6);_0x1d80ee['next'](_0x28b8e6);}else{logger[_0xab2e('0xd')](_0xab2e('0x12'),_0x2ee255,_0x556a0[_0xab2e('0xe')]||'next');_0x1d80ee[_0xab2e('0xc')]();}}else{_0x1d80ee[_0xab2e('0x11')]();}}}catch(_0x2bc4ce){logger[_0xab2e('0x7')](_0xab2e('0x8'),_0x2ee255,JSON['stringify'](_0x2bc4ce));_0x1d80ee[_0xab2e('0xc')]();}};}; \ 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 26021e0..f664707 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 _0x25c9=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','error','lodash','./utils','../../../../config/logger'];(function(_0x4acb2e,_0x15492b){var _0x3b41b7=function(_0x327693){while(--_0x327693){_0x4acb2e['push'](_0x4acb2e['shift']());}};_0x3b41b7(++_0x15492b);}(_0x25c9,0x1d9));var _0x925c=function(_0x26f118,_0x28df48){_0x26f118=_0x26f118-0x0;var _0xb40093=_0x25c9[_0x26f118];return _0xb40093;};'use strict';var _=require(_0x925c('0x0'));var utils=require(_0x925c('0x1'));var logger=require(_0x925c('0x2'))(_0x925c('0x3'));var rpc={'chatMessage':require(_0x925c('0x4')),'openchannelMessage':require(_0x925c('0x5')),'mailMessage':require(_0x925c('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x925c('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x925c('0x8')]=function(_0x58010f,_0x479e60){return function(_0x18ddd9){try{var _0x4af9af={'body':utils[_0x925c('0x9')](_0x479e60[0x0],this),'ContactId':this[_0x925c('0xa')]['id']};if(this[_0x925c('0xb')]===_0x925c('0xc')){_0x4af9af[_0x925c('0xd')]=this['account']['id'];}else{_0x4af9af[_[_0x925c('0xe')](this[_0x925c('0xb')])+_0x925c('0xf')]=this['account']['id'];}_0x4af9af[_[_0x925c('0xe')](this['channel'])+_0x925c('0x10')]=this[_0x925c('0x11')]['id'];if(rpc[this[_0x925c('0xb')]+_0x925c('0x12')]){return rpc[this[_0x925c('0xb')]+'Message'][_0x925c('0x13')](_0x4af9af)[_0x925c('0x14')](function(_0x2fdd3b){logger['info'](_0x925c('0x15'),_0x58010f,_0x4af9af[_0x925c('0x16')]);_0x18ddd9[_0x925c('0x17')]();})[_0x925c('0x18')](function(_0x4df95a){logger['error'](_0x925c('0x15'),_0x58010f,JSON[_0x925c('0x19')](_0x4df95a));_0x18ddd9[_0x925c('0x1a')]();});}}catch(_0x255285){logger[_0x925c('0x1b')](_0x925c('0x15'),_0x58010f,JSON[_0x925c('0x19')](_0x255285));_0x18ddd9['stop']();}};}; \ No newline at end of file +var _0x88c3=['upperFirst','InteractionId','interaction','Message','create','then','next','catch','error','[%s][MESSAGE]\x20%s','stop','lodash','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account'];(function(_0x35045d,_0x36fcf8){var _0x14f135=function(_0x4bc90e){while(--_0x4bc90e){_0x35045d['push'](_0x35045d['shift']());}};_0x14f135(++_0x36fcf8);}(_0x88c3,0x1ee));var _0x388c=function(_0x5b5c84,_0x5101af){_0x5b5c84=_0x5b5c84-0x0;var _0x37064b=_0x88c3[_0x5b5c84];return _0x37064b;};'use strict';var _=require(_0x388c('0x0'));var utils=require('./utils');var logger=require(_0x388c('0x1'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x388c('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x388c('0x3')),'whatsappMessage':require(_0x388c('0x4'))};exports[_0x388c('0x5')]=function(_0x33c1dc,_0x28ed4d){return function(_0x23199c){try{var _0x5a1c0d={'body':utils[_0x388c('0x6')](_0x28ed4d[0x0],this),'ContactId':this[_0x388c('0x7')]['id']};if(this[_0x388c('0x8')]===_0x388c('0x9')){_0x5a1c0d[_0x388c('0xa')]=this[_0x388c('0xb')]['id'];}else{_0x5a1c0d[_[_0x388c('0xc')](this[_0x388c('0x8')])+'AccountId']=this[_0x388c('0xb')]['id'];}_0x5a1c0d[_['upperFirst'](this['channel'])+_0x388c('0xd')]=this[_0x388c('0xe')]['id'];if(rpc[this[_0x388c('0x8')]+_0x388c('0xf')]){return rpc[this[_0x388c('0x8')]+_0x388c('0xf')][_0x388c('0x10')](_0x5a1c0d)[_0x388c('0x11')](function(_0x262ed1){logger['info']('[%s][MESSAGE]\x20%s',_0x33c1dc,_0x5a1c0d['body']);_0x23199c[_0x388c('0x12')]();})[_0x388c('0x13')](function(_0x50e78e){logger[_0x388c('0x14')](_0x388c('0x15'),_0x33c1dc,JSON['stringify'](_0x50e78e));_0x23199c['stop']();});}}catch(_0x76001f){logger[_0x388c('0x14')](_0x388c('0x15'),_0x33c1dc,JSON['stringify'](_0x76001f));_0x23199c[_0x388c('0x16')]();}};}; \ 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 4b61d42..0aa02ba 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 _0xd547=['next','[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger','consequence','info'];(function(_0x98f9d1,_0x1a47f5){var _0x49a7f9=function(_0x1075c1){while(--_0x1075c1){_0x98f9d1['push'](_0x98f9d1['shift']());}};_0x49a7f9(++_0x1a47f5);}(_0xd547,0x94));var _0x7d54=function(_0x3f1076,_0x23b6c1){_0x3f1076=_0x3f1076-0x0;var _0x21d34f=_0xd547[_0x3f1076];return _0x21d34f;};'use strict';var utils=require(_0x7d54('0x0'));var logger=require(_0x7d54('0x1'))('routing');exports[_0x7d54('0x2')]=function(_0x185564,_0x5c517a){return function(_0x5ab2e3){try{logger[_0x7d54('0x3')]('[%s][NOOP]\x20%s',_0x185564,utils['getMustacheRender'](_0x5c517a[0x0],this));_0x5ab2e3[_0x7d54('0x4')]();}catch(_0x32a772){logger['error'](_0x7d54('0x5'),_0x185564,JSON[_0x7d54('0x6')](_0x32a772));_0x5ab2e3[_0x7d54('0x7')]();}};}; \ No newline at end of file +var _0x7549=['next','error','stringify','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x56c5c0,_0x2901e6){var _0x3610b8=function(_0x3a1958){while(--_0x3a1958){_0x56c5c0['push'](_0x56c5c0['shift']());}};_0x3610b8(++_0x2901e6);}(_0x7549,0xf3));var _0x9754=function(_0x416dc2,_0x4e6267){_0x416dc2=_0x416dc2-0x0;var _0x50e83c=_0x7549[_0x416dc2];return _0x50e83c;};'use strict';var utils=require(_0x9754('0x0'));var logger=require(_0x9754('0x1'))(_0x9754('0x2'));exports[_0x9754('0x3')]=function(_0x43aa6f,_0x168623){return function(_0x4a5dbb){try{logger[_0x9754('0x4')](_0x9754('0x5'),_0x43aa6f,utils[_0x9754('0x6')](_0x168623[0x0],this));_0x4a5dbb[_0x9754('0x7')]();}catch(_0x547172){logger[_0x9754('0x8')](_0x9754('0x5'),_0x43aa6f,JSON[_0x9754('0x9')](_0x547172));_0x4a5dbb['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 dafaf21..7d650a0 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 _0x5d17=['toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','find','timeout','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','socket.io-emitter','queue_id','queue','from','joinAt','emit','clone','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','QueueId','upperFirst','channel','InteractionId','interaction','MessageId','message','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report'];(function(_0x56d189,_0x36df1c){var _0x1bcec1=function(_0x4273ff){while(--_0x4273ff){_0x56d189['push'](_0x56d189['shift']());}};_0x1bcec1(++_0x36df1c);}(_0x5d17,0xb8));var _0x75d1=function(_0xe1441d,_0x36fb8e){_0xe1441d=_0xe1441d-0x0;var _0x2ef242=_0x5d17[_0xe1441d];return _0x2ef242;};'use strict';var schema=require(_0x75d1('0x0'));var _=require(_0x75d1('0x1'));var util=require(_0x75d1('0x2'));var seqqueue=require(_0x75d1('0x3'));var moment=require(_0x75d1('0x4'));var Redis=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var logger=require(_0x75d1('0x7'))(_0x75d1('0x8'));var strategy=require('./strategy');config[_0x75d1('0x9')]=_[_0x75d1('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x75d1('0xb'))(new Redis(config['redis']));var attributes=['id',_0x75d1('0xc'),'account',_0x75d1('0xd'),_0x75d1('0xe'),_0x75d1('0xf')];function emit(_0x5f5910,_0x2e5c31,_0x4c5bf3){io['to'](_0x5f5910)[_0x75d1('0x10')](_0x2e5c31,_0x4c5bf3);}function emitChannelQueueInteraction(_0x3cd46b,_0x5a3af0,_0x58a059,_0x15f81c,_0x582342,_0x53a8df,_0x1b7be4,_0x579ca2){var _0x5dd630=_[_0x75d1('0x11')](_0x58a059);_0x5dd630['queue_id']=_0x579ca2;_0x5dd630[_0x75d1('0xd')]=_0x5a3af0;_0x5dd630[_0x75d1('0x12')]=_0x15f81c;_0x5dd630['id']=_0x582342;if(_0x53a8df){_0x1b7be4[util[_0x75d1('0x13')](_0x75d1('0x14'),_0x3cd46b)][_0x582342]=_[_0x75d1('0x15')](_0x5dd630,attributes);}else{delete _0x1b7be4[util[_0x75d1('0x13')]('%sQueuesWaitingInteractions',_0x3cd46b)][_0x582342];}emit(util[_0x75d1('0x13')](_0x75d1('0x16'),_0x3cd46b,_0x5a3af0),util[_0x75d1('0x13')]('%s_queue_waiting_interaction:%s',_0x3cd46b,_0x53a8df?_0x75d1('0x17'):_0x75d1('0x18')),_[_0x75d1('0x15')](_0x5dd630,attributes));}var rpc={'openchannelQueueReport':require(_0x75d1('0x19')),'mailQueueReport':require(_0x75d1('0x1a')),'chatQueueReport':require(_0x75d1('0x1b')),'smsQueueReport':require(_0x75d1('0x1c')),'faxQueueReport':require(_0x75d1('0x1d')),'whatsappQueueReport':require(_0x75d1('0x1e'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x75d1('0x1f')},'timeout':{'type':_0x75d1('0x20'),'message':_0x75d1('0x21')}});function startRouting(_0x24c560,_0x697a47,_0x532d5e,_0x2b5866){if(_0x24c560&&_0x697a47&&_0x532d5e){_0x697a47[_0x75d1('0x22')]+=0x1;var _0x313bf8={'uniqueid':_0x24c560,'from':_0x532d5e[_0x75d1('0x23')]?_0x532d5e[_0x75d1('0x23')][_0x75d1('0xe')]:'','joinAt':moment()[_0x75d1('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x532d5e[_0x75d1('0x24')]?_0x532d5e[_0x75d1('0x24')]['id']:null,'ListId':_0x532d5e[_0x75d1('0x25')]?_0x532d5e[_0x75d1('0x25')]['id']:null};_0x313bf8[_['upperFirst'](_0x532d5e['channel'])+_0x75d1('0x26')]=_0x697a47['id']||null;_0x313bf8[_[_0x75d1('0x27')](_0x532d5e[_0x75d1('0x28')])+_0x75d1('0x29')]=_0x532d5e[_0x75d1('0x2a')]?_0x532d5e[_0x75d1('0x2a')]['id']:null;_0x313bf8[_['upperFirst'](_0x532d5e[_0x75d1('0x28')])+_0x75d1('0x2b')]=_0x532d5e[_0x75d1('0x2c')]?_0x532d5e['message']['id']:null;_0x313bf8[_[_0x75d1('0x27')](_0x532d5e['channel'])+(_0x532d5e[_0x75d1('0x28')]!=='chat'?'AccountId':_0x75d1('0x2d'))]=_0x532d5e[_0x75d1('0x12')]?_0x532d5e[_0x75d1('0x12')]['id']:null;logger[_0x75d1('0x2e')](util[_0x75d1('0x13')](_0x75d1('0x2f'),_0x24c560,_0x697a47['name']));emitChannelQueueInteraction(_0x532d5e[_0x75d1('0x28')],_0x697a47[_0x75d1('0x30')],_0x313bf8,_0x532d5e[_0x75d1('0x12')][_0x75d1('0x30')],_0x532d5e['message']['id'],!![],_0x2b5866,_0x697a47['id']);if(rpc[_0x532d5e[_0x75d1('0x28')]+_0x75d1('0x31')]){return rpc[_0x532d5e[_0x75d1('0x28')]+_0x75d1('0x31')][_0x75d1('0x32')](_0x313bf8)[_0x75d1('0x33')](function(_0x10a36e){logger[_0x75d1('0x34')](_0x75d1('0x35'));});}}}function stopRouting(_0x1fd87d,_0xebadbc,_0x9c71de,_0x15a7f0){if(_0x1fd87d&&_0xebadbc){_0xebadbc[_0x75d1('0x22')]-=0x1;var _0x42c4e0={'leaveAt':moment()['format'](_0x75d1('0x36')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x75d1('0x37')};logger[_0x75d1('0x2e')](util[_0x75d1('0x13')](_0x75d1('0x38'),_0x1fd87d,_0xebadbc[_0x75d1('0x30')]));emitChannelQueueInteraction(_0x9c71de[_0x75d1('0x28')],_0xebadbc[_0x75d1('0x30')],_0x9c71de[_0x75d1('0x23')],_0x9c71de[_0x75d1('0x12')][_0x75d1('0x30')],_0x9c71de[_0x75d1('0x2c')]['id'],![],_0x15a7f0,_0xebadbc['id']);if(rpc[_0x9c71de['channel']+_0x75d1('0x31')]){return rpc[_0x9c71de[_0x75d1('0x28')]+'QueueReport']['update'](_0x1fd87d,_0x42c4e0)[_0x75d1('0x33')](function(_0x2963be){logger[_0x75d1('0x34')]('update\x20queue\x20report');});}}}function endRouting(_0x2cade8,_0x5925fb,_0x366816,_0x580470){if(_0x2cade8&&_0x5925fb){_0x5925fb['waiting']-=0x1;var _0x3853ae={'leaveAt':moment()[_0x75d1('0x13')](_0x75d1('0x36')),'exitAt':moment()['format'](_0x75d1('0x36')),'reason':'timeout'};logger['info'](util['format']('[%s][END:QUEUE][NAME:%s]',_0x2cade8,_0x5925fb[_0x75d1('0x30')]));emitChannelQueueInteraction(_0x366816[_0x75d1('0x28')],_0x5925fb[_0x75d1('0x30')],_0x366816[_0x75d1('0x23')],_0x366816[_0x75d1('0x12')][_0x75d1('0x30')],_0x366816[_0x75d1('0x2c')]['id'],![],_0x580470);if(rpc[_0x366816['channel']+_0x75d1('0x31')]){return rpc[_0x366816[_0x75d1('0x28')]+_0x75d1('0x31')][_0x75d1('0x39')](_0x2cade8,_0x3853ae)[_0x75d1('0x33')](function(_0x10cebf){logger[_0x75d1('0x34')](_0x75d1('0x3a'));});}}}function handleFindQueue(_0x36334e){return function(_0x30cbd1){return _0x30cbd1[_0x75d1('0x30')]['toLowerCase']()===_0x36334e[_0x75d1('0x3b')]();};}exports[_0x75d1('0x3c')]=function(_0x5c4d95,_0x10de76,_0x29b957,_0x2cf1b6){return function(_0x5ed01b){try{var _0x43f90e={'name':_0x10de76[0x0],'timeout':_0x10de76[0x1]};var _0x4b9af4=queue['validate'](_0x43f90e,{'typecast':!![]});if(_0x4b9af4[_0x75d1('0x3d')]){logger[_0x75d1('0x34')](_0x75d1('0x3e'),_0x5c4d95,_['map'](_0x4b9af4,'message')[_0x75d1('0x3f')](',\x20'));_0x5ed01b['stop']();}else{var _0x25fcca=_[_0x75d1('0x40')](_0x29b957[_0x2cf1b6[_0x75d1('0x28')]+'Queues'],handleFindQueue(_0x43f90e['name']));if(_0x25fcca){startRouting(_0x5c4d95,_0x25fcca,_0x2cf1b6,_0x29b957);var _0x183b19=(_0x25fcca[_0x75d1('0x41')]||0xa)*0x3e8;var _0x2c8407=(_0x43f90e[_0x75d1('0x41')]||0x14)*0x3e8;var _0x262ce,_0x379ffb;if(_0x183b19>_0x2c8407){_0x2c8407=_0x183b19;}var _0x2c838e=seqqueue[_0x75d1('0x42')](_0x183b19);_0x2c838e['id']=_0x5c4d95;_0x2c838e[_0x75d1('0x43')]=_0x183b19;_0x2c838e[_0x75d1('0x44')]=_0x2c8407;_0x2c838e[_0x75d1('0x28')]=_0x2cf1b6['channel'];_0x29b957[_0x75d1('0x45')][_0x5c4d95]['on'](_0x75d1('0x46'),function(){logger[_0x75d1('0x2e')](_0x75d1('0x47'),_0x5c4d95);stopRouting(_0x5c4d95,_0x25fcca,_0x2cf1b6,_0x29b957);clearTimeout(_0x262ce);_0x262ce=undefined;_0x2c838e['close'](!![]);if(_0x29b957[_0x75d1('0x45')][_0x5c4d95]){delete _0x29b957[_0x75d1('0x45')][_0x5c4d95];}_0x5ed01b[_0x75d1('0x48')]();});_0x29b957['rules'][_0x5c4d95]['on'](_0x75d1('0x49'),function(){if(_0x29b957[_0x75d1('0x45')][_0x5c4d95]){delete _0x29b957['rules'][_0x5c4d95];}});_0x262ce=setTimeout(function(){logger['info'](_0x75d1('0x4a'),_0x5c4d95);endRouting(_0x5c4d95,_0x25fcca,_0x2cf1b6,_0x29b957);clearTimeout(_0x262ce);_0x2c838e[_0x75d1('0x4b')](!![]);_0x5ed01b[_0x75d1('0x4c')]();},_0x2c8407);switch(_0x25fcca['strategy']){case'rrmemory':strategy['rrmemory'](_0x2c838e,_0x25fcca,_0x29b957,_0x2cf1b6);break;default:strategy[_0x75d1('0x4d')](_0x2c838e,_0x25fcca,_0x29b957,_0x2cf1b6);}}else{logger['error'](_0x75d1('0x4e'),_0x5c4d95,_0x43f90e[_0x75d1('0x30')]);_0x5ed01b[_0x75d1('0x48')]();}}}catch(_0x37205e){console[_0x75d1('0x4f')](_0x37205e);logger[_0x75d1('0x34')]('[%s][QUEUE]\x20%s',_0x5c4d95,_0x37205e[_0x75d1('0x50')]);_0x5ed01b[_0x75d1('0x48')]();}};}; \ No newline at end of file +var _0x1ae8=['WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','join','stop','find','Queues','timeout','atimeout','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','util','seq-queue','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter','queue_id','account','from','emit','clone','queue','format','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','body','contact','list','upperFirst','channel','interaction','MessageId','message'];(function(_0x4429e0,_0xee6f1f){var _0x51a5b3=function(_0x16eb11){while(--_0x16eb11){_0x4429e0['push'](_0x4429e0['shift']());}};_0x51a5b3(++_0xee6f1f);}(_0x1ae8,0xb2));var _0x81ae=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x1ae8[_0x5e36d1];return _0x950b9e;};'use strict';var schema=require(_0x81ae('0x0'));var _=require('lodash');var util=require(_0x81ae('0x1'));var seqqueue=require(_0x81ae('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x81ae('0x3'));var logger=require(_0x81ae('0x4'))(_0x81ae('0x5'));var strategy=require(_0x81ae('0x6'));config[_0x81ae('0x7')]=_[_0x81ae('0x8')](config[_0x81ae('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x81ae('0x9'))(new Redis(config[_0x81ae('0x7')]));var attributes=['id',_0x81ae('0xa'),_0x81ae('0xb'),'queue',_0x81ae('0xc'),'joinAt'];function emit(_0x1e2a04,_0x5c531c,_0x2035db){io['to'](_0x1e2a04)[_0x81ae('0xd')](_0x5c531c,_0x2035db);}function emitChannelQueueInteraction(_0x141928,_0x4c620c,_0x78277f,_0x4dd422,_0x2d994d,_0x4810e2,_0x517443,_0x1a48e6){var _0x41caea=_[_0x81ae('0xe')](_0x78277f);_0x41caea['queue_id']=_0x1a48e6;_0x41caea[_0x81ae('0xf')]=_0x4c620c;_0x41caea['account']=_0x4dd422;_0x41caea['id']=_0x2d994d;if(_0x4810e2){_0x517443[util[_0x81ae('0x10')]('%sQueuesWaitingInteractions',_0x141928)][_0x2d994d]=_[_0x81ae('0x11')](_0x41caea,attributes);}else{delete _0x517443[util[_0x81ae('0x10')]('%sQueuesWaitingInteractions',_0x141928)][_0x2d994d];}emit(util[_0x81ae('0x10')](_0x81ae('0x12'),_0x141928,_0x4c620c),util[_0x81ae('0x10')](_0x81ae('0x13'),_0x141928,_0x4810e2?_0x81ae('0x14'):_0x81ae('0x15')),_[_0x81ae('0x11')](_0x41caea,attributes));}var rpc={'openchannelQueueReport':require(_0x81ae('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x81ae('0x17')),'smsQueueReport':require(_0x81ae('0x18')),'faxQueueReport':require(_0x81ae('0x19')),'whatsappQueueReport':require(_0x81ae('0x1a'))};var queue=schema({'name':{'type':_0x81ae('0x1b'),'required':!![],'message':_0x81ae('0x1c')},'timeout':{'type':'number','message':_0x81ae('0x1d')}});function startRouting(_0x382138,_0x387292,_0x2c9d04,_0xf42a81){if(_0x382138&&_0x387292&&_0x2c9d04){_0x387292['waiting']+=0x1;var _0xd11747={'uniqueid':_0x382138,'from':_0x2c9d04[_0x81ae('0x1e')]?_0x2c9d04[_0x81ae('0x1e')][_0x81ae('0xc')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2c9d04['contact']?_0x2c9d04[_0x81ae('0x1f')]['id']:null,'ListId':_0x2c9d04[_0x81ae('0x20')]?_0x2c9d04[_0x81ae('0x20')]['id']:null};_0xd11747[_[_0x81ae('0x21')](_0x2c9d04[_0x81ae('0x22')])+'QueueId']=_0x387292['id']||null;_0xd11747[_[_0x81ae('0x21')](_0x2c9d04['channel'])+'InteractionId']=_0x2c9d04[_0x81ae('0x23')]?_0x2c9d04[_0x81ae('0x23')]['id']:null;_0xd11747[_['upperFirst'](_0x2c9d04[_0x81ae('0x22')])+_0x81ae('0x24')]=_0x2c9d04[_0x81ae('0x25')]?_0x2c9d04[_0x81ae('0x25')]['id']:null;_0xd11747[_[_0x81ae('0x21')](_0x2c9d04[_0x81ae('0x22')])+(_0x2c9d04[_0x81ae('0x22')]!=='chat'?'AccountId':_0x81ae('0x26'))]=_0x2c9d04[_0x81ae('0xb')]?_0x2c9d04['account']['id']:null;logger[_0x81ae('0x27')](util[_0x81ae('0x10')](_0x81ae('0x28'),_0x382138,_0x387292[_0x81ae('0x29')]));emitChannelQueueInteraction(_0x2c9d04[_0x81ae('0x22')],_0x387292[_0x81ae('0x29')],_0xd11747,_0x2c9d04[_0x81ae('0xb')][_0x81ae('0x29')],_0x2c9d04[_0x81ae('0x25')]['id'],!![],_0xf42a81,_0x387292['id']);if(rpc[_0x2c9d04[_0x81ae('0x22')]+_0x81ae('0x2a')]){return rpc[_0x2c9d04['channel']+'QueueReport'][_0x81ae('0x2b')](_0xd11747)[_0x81ae('0x2c')](function(_0x3a4e90){logger[_0x81ae('0x2d')]('create\x20queue\x20report');});}}}function stopRouting(_0x508e62,_0x3f4328,_0x5b733a,_0xa6389){if(_0x508e62&&_0x3f4328){_0x3f4328[_0x81ae('0x2e')]-=0x1;var _0x1db5a6={'leaveAt':moment()[_0x81ae('0x10')](_0x81ae('0x2f')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x81ae('0x30')};logger['info'](util[_0x81ae('0x10')](_0x81ae('0x31'),_0x508e62,_0x3f4328[_0x81ae('0x29')]));emitChannelQueueInteraction(_0x5b733a[_0x81ae('0x22')],_0x3f4328[_0x81ae('0x29')],_0x5b733a[_0x81ae('0x1e')],_0x5b733a[_0x81ae('0xb')][_0x81ae('0x29')],_0x5b733a[_0x81ae('0x25')]['id'],![],_0xa6389,_0x3f4328['id']);if(rpc[_0x5b733a[_0x81ae('0x22')]+_0x81ae('0x2a')]){return rpc[_0x5b733a[_0x81ae('0x22')]+_0x81ae('0x2a')][_0x81ae('0x32')](_0x508e62,_0x1db5a6)[_0x81ae('0x2c')](function(_0x18aa95){logger['error'](_0x81ae('0x33'));});}}}function endRouting(_0xc1e84b,_0x482092,_0x504c7c,_0x401392){if(_0xc1e84b&&_0x482092){_0x482092[_0x81ae('0x2e')]-=0x1;var _0x23c934={'leaveAt':moment()[_0x81ae('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x81ae('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger['info'](util[_0x81ae('0x10')](_0x81ae('0x34'),_0xc1e84b,_0x482092[_0x81ae('0x29')]));emitChannelQueueInteraction(_0x504c7c[_0x81ae('0x22')],_0x482092[_0x81ae('0x29')],_0x504c7c[_0x81ae('0x1e')],_0x504c7c[_0x81ae('0xb')]['name'],_0x504c7c[_0x81ae('0x25')]['id'],![],_0x401392);if(rpc[_0x504c7c['channel']+_0x81ae('0x2a')]){return rpc[_0x504c7c[_0x81ae('0x22')]+_0x81ae('0x2a')][_0x81ae('0x32')](_0xc1e84b,_0x23c934)[_0x81ae('0x2c')](function(_0x50b43e){logger[_0x81ae('0x2d')](_0x81ae('0x33'));});}}}function handleFindQueue(_0x4766d7){return function(_0x5488ca){return _0x5488ca[_0x81ae('0x29')][_0x81ae('0x35')]()===_0x4766d7[_0x81ae('0x35')]();};}exports[_0x81ae('0x36')]=function(_0x49e157,_0x3c27e5,_0x317cce,_0x35cd53){return function(_0x7dd736){try{var _0x510911={'name':_0x3c27e5[0x0],'timeout':_0x3c27e5[0x1]};var _0x145487=queue[_0x81ae('0x0')](_0x510911,{'typecast':!![]});if(_0x145487['length']){logger[_0x81ae('0x2d')](_0x81ae('0x37'),_0x49e157,_['map'](_0x145487,_0x81ae('0x25'))[_0x81ae('0x38')](',\x20'));_0x7dd736[_0x81ae('0x39')]();}else{var _0x280e73=_[_0x81ae('0x3a')](_0x317cce[_0x35cd53[_0x81ae('0x22')]+_0x81ae('0x3b')],handleFindQueue(_0x510911[_0x81ae('0x29')]));if(_0x280e73){startRouting(_0x49e157,_0x280e73,_0x35cd53,_0x317cce);var _0x401a34=(_0x280e73[_0x81ae('0x3c')]||0xa)*0x3e8;var _0x5a3e1e=(_0x510911['timeout']||0x14)*0x3e8;var _0x18b746,_0x36cec3;if(_0x401a34>_0x5a3e1e){_0x5a3e1e=_0x401a34;}var _0x81dd42=seqqueue['createQueue'](_0x401a34);_0x81dd42['id']=_0x49e157;_0x81dd42[_0x81ae('0x3d')]=_0x401a34;_0x81dd42['qtimeout']=_0x5a3e1e;_0x81dd42['channel']=_0x35cd53[_0x81ae('0x22')];_0x317cce['rules'][_0x49e157]['on']('end',function(){logger[_0x81ae('0x27')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x49e157);stopRouting(_0x49e157,_0x280e73,_0x35cd53,_0x317cce);clearTimeout(_0x18b746);_0x18b746=undefined;_0x81dd42['close'](!![]);if(_0x317cce[_0x81ae('0x3e')][_0x49e157]){delete _0x317cce[_0x81ae('0x3e')][_0x49e157];}_0x7dd736['stop']();});_0x317cce['rules'][_0x49e157]['on'](_0x81ae('0x3f'),function(){if(_0x317cce[_0x81ae('0x3e')][_0x49e157]){delete _0x317cce[_0x81ae('0x3e')][_0x49e157];}});_0x18b746=setTimeout(function(){logger['info'](_0x81ae('0x40'),_0x49e157);endRouting(_0x49e157,_0x280e73,_0x35cd53,_0x317cce);clearTimeout(_0x18b746);_0x81dd42[_0x81ae('0x41')](!![]);_0x7dd736['next']();},_0x5a3e1e);switch(_0x280e73[_0x81ae('0x42')]){case _0x81ae('0x43'):strategy[_0x81ae('0x43')](_0x81dd42,_0x280e73,_0x317cce,_0x35cd53);break;default:strategy[_0x81ae('0x44')](_0x81dd42,_0x280e73,_0x317cce,_0x35cd53);}}else{logger[_0x81ae('0x2d')](_0x81ae('0x45'),_0x49e157,_0x510911[_0x81ae('0x29')]);_0x7dd736['stop']();}}}catch(_0x5e2df9){console[_0x81ae('0x46')](_0x5e2df9);logger['error']('[%s][QUEUE]\x20%s',_0x49e157,_0x5e2df9[_0x81ae('0x47')]);_0x7dd736[_0x81ae('0x39')]();}};}; \ 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 0467591..c5ed7e1 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 _0x31db=['agents','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','forcedOwnership','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','push','handleRun','bind','timeout','handleTimeout','drained','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x31db,0xdc));var _0xb31d=function(_0x421c56,_0x4efd00){_0x421c56=_0x421c56-0x0;var _0x49b244=_0x31db[_0x421c56];return _0x49b244;};'use strict';var _=require(_0xb31d('0x0'));var uuid=require(_0xb31d('0x1'));var util=require(_0xb31d('0x2'));var logger=require(_0xb31d('0x3'))('routing');var Agent=function(_0x457aea,_0x302e01,_0x1f649e,_0x3df133){this[_0xb31d('0x4')]=uuid['v4']();this[_0xb31d('0x5')]=_0x457aea;this['agent']=_0x302e01;this['realtime']=_0x1f649e;this['routing']=_0x3df133;this[_0xb31d('0x5')][_0xb31d('0x6')](this[_0xb31d('0x7')]['bind'](this),this['handleTimeout'][_0xb31d('0x8')](this));this['squeue']['on'](_0xb31d('0x9'),this[_0xb31d('0xa')][_0xb31d('0x8')](this));this['squeue']['on'](_0xb31d('0xb'),this['handleDrained'][_0xb31d('0x8')](this));};Agent['prototype']['push']=function(){this[_0xb31d('0x5')][_0xb31d('0x6')](this['handleRun'][_0xb31d('0x8')](this),this[_0xb31d('0xa')][_0xb31d('0x8')](this));};Agent[_0xb31d('0xc')][_0xb31d('0xd')]=function(){this[_0xb31d('0xa')](!![]);};Agent[_0xb31d('0xc')]['handleRun']=function(_0x4e312a){logger[_0xb31d('0xe')](_0xb31d('0xf'),this[_0xb31d('0x5')]['id'],this['agent']['id']);if(_[_0xb31d('0x10')](this[_0xb31d('0x11')][_0xb31d('0x12')][this[_0xb31d('0x13')]['id']])){logger[_0xb31d('0xe')](_0xb31d('0x14'),this[_0xb31d('0x5')]['id'],this[_0xb31d('0x13')]['id']);setTimeout(this[_0xb31d('0x6')][_0xb31d('0x8')](this),0x3e8);}else{if(this[_0xb31d('0x15')][_0xb31d('0x16')]||util['isAgentAvailable'](this[_0xb31d('0x5')]['id'],this['realtime'][_0xb31d('0x12')][this[_0xb31d('0x13')]['id']],this[_0xb31d('0x5')]['channel'],![])){this['realtime'][_0xb31d('0x12')][this[_0xb31d('0x13')]['id']][_0xb31d('0x17')]=!![];this[_0xb31d('0x11')][_0xb31d('0x12')][this[_0xb31d('0x13')]['id']][_0xb31d('0x18')]=undefined;util[_0xb31d('0x19')](this[_0xb31d('0x4')],this[_0xb31d('0x5')]['id'],this[_0xb31d('0x11')][_0xb31d('0x12')][this[_0xb31d('0x13')]['id']],null,this[_0xb31d('0x15')]);util[_0xb31d('0x1a')](this[_0xb31d('0x5')]['id'],this[_0xb31d('0x11')]['agents'][this[_0xb31d('0x13')]['id']],_0xb31d('0x1b')+(this[_0xb31d('0x15')][_0xb31d('0x16')]?_0xb31d('0x1c'):''));}else{logger[_0xb31d('0xe')](_0xb31d('0x1d'),this[_0xb31d('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xb31d('0x6')][_0xb31d('0x8')](this),0x3e8);}}};Agent['prototype'][_0xb31d('0xa')]=function(_0x4171b3){if(_[_0xb31d('0x10')](this[_0xb31d('0x11')]['agents'][this['agent']['id']])){return logger['info'](_0xb31d('0x14'),this[_0xb31d('0x5')]['id'],this[_0xb31d('0x13')]['id']);}else{logger['info'](_0xb31d('0x1e'),this[_0xb31d('0x5')]['id'],this[_0xb31d('0x13')]['id']);util[_0xb31d('0x1f')](this[_0xb31d('0x4')],this[_0xb31d('0x5')]['id'],this['realtime'][_0xb31d('0x12')][this['agent']['id']],null,this[_0xb31d('0x15')]);this[_0xb31d('0x11')][_0xb31d('0x12')][this['agent']['id']][_0xb31d('0x17')]=![];this[_0xb31d('0x11')][_0xb31d('0x12')][this['agent']['id']][_0xb31d('0x18')]=undefined;util[_0xb31d('0x1a')](this[_0xb31d('0x5')]['id'],this[_0xb31d('0x11')]['agents'][this[_0xb31d('0x13')]['id']],_0x4171b3?_0xb31d('0x20'):'TIMEOUT');}if(!_0x4171b3){setTimeout(this[_0xb31d('0x6')][_0xb31d('0x8')](this),0x3e8);}};function agent(_0x5301fe,_0xaca609,_0x345cf9,_0x1dd7d2){return new Agent(_0x5301fe,_0xaca609,_0x345cf9,_0x1dd7d2);}module[_0xb31d('0x21')]=agent; \ No newline at end of file +var _0x2d9b=['[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','exports','./util','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0x446c68,_0x2e8e0f){var _0xfb066=function(_0x3256e5){while(--_0x3256e5){_0x446c68['push'](_0x446c68['shift']());}};_0xfb066(++_0x2e8e0f);}(_0x2d9b,0xb0));var _0xb2d9=function(_0x13835f,_0x3cbbaa){_0x13835f=_0x13835f-0x0;var _0x359b2a=_0x2d9b[_0x13835f];return _0x359b2a;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0xb2d9('0x0'));var logger=require('../../../../../config/logger')(_0xb2d9('0x1'));var Agent=function(_0x32acf5,_0x4ddc7b,_0x4b627e,_0x13558d){this[_0xb2d9('0x2')]=uuid['v4']();this[_0xb2d9('0x3')]=_0x32acf5;this[_0xb2d9('0x4')]=_0x4ddc7b;this[_0xb2d9('0x5')]=_0x4b627e;this[_0xb2d9('0x1')]=_0x13558d;this[_0xb2d9('0x3')][_0xb2d9('0x6')](this[_0xb2d9('0x7')][_0xb2d9('0x8')](this),this[_0xb2d9('0x9')][_0xb2d9('0x8')](this));this['squeue']['on'](_0xb2d9('0xa'),this[_0xb2d9('0x9')][_0xb2d9('0x8')](this));this[_0xb2d9('0x3')]['on'](_0xb2d9('0xb'),this[_0xb2d9('0xc')][_0xb2d9('0x8')](this));};Agent['prototype']['push']=function(){this[_0xb2d9('0x3')]['push'](this['handleRun'][_0xb2d9('0x8')](this),this[_0xb2d9('0x9')]['bind'](this));};Agent[_0xb2d9('0xd')][_0xb2d9('0xc')]=function(){this[_0xb2d9('0x9')](!![]);};Agent[_0xb2d9('0xd')][_0xb2d9('0x7')]=function(_0x721e91){logger[_0xb2d9('0xe')](_0xb2d9('0xf'),this['squeue']['id'],this[_0xb2d9('0x4')]['id']);if(_['isNil'](this[_0xb2d9('0x5')]['agents'][this[_0xb2d9('0x4')]['id']])){logger[_0xb2d9('0xe')](_0xb2d9('0x10'),this[_0xb2d9('0x3')]['id'],this[_0xb2d9('0x4')]['id']);setTimeout(this[_0xb2d9('0x6')]['bind'](this),0x3e8);}else{if(this[_0xb2d9('0x1')][_0xb2d9('0x11')]||util[_0xb2d9('0x12')](this[_0xb2d9('0x3')]['id'],this['realtime'][_0xb2d9('0x13')][this['agent']['id']],this['squeue'][_0xb2d9('0x14')],![])){this[_0xb2d9('0x5')]['agents'][this[_0xb2d9('0x4')]['id']][_0xb2d9('0x15')]=!![];this[_0xb2d9('0x5')][_0xb2d9('0x13')][this[_0xb2d9('0x4')]['id']][_0xb2d9('0x16')]=undefined;util[_0xb2d9('0x17')](this[_0xb2d9('0x2')],this['squeue']['id'],this['realtime']['agents'][this[_0xb2d9('0x4')]['id']],null,this[_0xb2d9('0x1')]);util[_0xb2d9('0x18')](this[_0xb2d9('0x3')]['id'],this[_0xb2d9('0x5')][_0xb2d9('0x13')][this[_0xb2d9('0x4')]['id']],_0xb2d9('0x19')+(this['routing']['forcedOwnership']?_0xb2d9('0x1a'):''));}else{logger['info'](_0xb2d9('0x1b'),this[_0xb2d9('0x3')]['id'],this['agent']['id']);setTimeout(this[_0xb2d9('0x6')][_0xb2d9('0x8')](this),0x3e8);}}};Agent[_0xb2d9('0xd')][_0xb2d9('0x9')]=function(_0x1b22f2){if(_['isNil'](this['realtime'][_0xb2d9('0x13')][this[_0xb2d9('0x4')]['id']])){return logger['info'](_0xb2d9('0x10'),this['squeue']['id'],this[_0xb2d9('0x4')]['id']);}else{logger[_0xb2d9('0xe')](_0xb2d9('0x1c'),this[_0xb2d9('0x3')]['id'],this[_0xb2d9('0x4')]['id']);util[_0xb2d9('0x1d')](this[_0xb2d9('0x2')],this['squeue']['id'],this[_0xb2d9('0x5')][_0xb2d9('0x13')][this['agent']['id']],null,this['routing']);this['realtime'][_0xb2d9('0x13')][this[_0xb2d9('0x4')]['id']][_0xb2d9('0x15')]=![];this[_0xb2d9('0x5')][_0xb2d9('0x13')][this['agent']['id']][_0xb2d9('0x16')]=undefined;util['writeLog'](this[_0xb2d9('0x3')]['id'],this[_0xb2d9('0x5')][_0xb2d9('0x13')][this[_0xb2d9('0x4')]['id']],_0x1b22f2?_0xb2d9('0x1e'):'TIMEOUT');}if(!_0x1b22f2){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x4eb969,_0x1575a4,_0x84e850,_0x33817e){return new Agent(_0x4eb969,_0x1575a4,_0x84e850,_0x33817e);}module[_0xb2d9('0x1f')]=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 9fb08c0..4c77ba7 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 _0x102b=['agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','RINGING','busy','name','showNotification','writeLog','STOP','TIMEOUT','busyQueue','uuid','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','handleTimeout','timeout','drained','bind','prototype','handleDrained','isNil','queue','Agents','length'];(function(_0xa8f8d8,_0x573598){var _0x3c1145=function(_0xdda756){while(--_0xdda756){_0xa8f8d8['push'](_0xa8f8d8['shift']());}};_0x3c1145(++_0x573598);}(_0x102b,0x1be));var _0xb102=function(_0x1270d8,_0x5d20fd){_0x1270d8=_0x1270d8-0x0;var _0x5c0d80=_0x102b[_0x1270d8];return _0x5c0d80;};'use strict';var _=require('lodash');var uuid=require(_0xb102('0x0'));var util=require('./util');var logger=require(_0xb102('0x1'))(_0xb102('0x2'));var Beepall=function(_0x42172c,_0x1be904,_0x1e44cb,_0x1402fb){this[_0xb102('0x3')]=uuid['v4']();this[_0xb102('0x4')]=_0x42172c;this['queue']=_0x1be904;this[_0xb102('0x5')]=_0x1e44cb;this[_0xb102('0x2')]=_0x1402fb;this[_0xb102('0x4')][_0xb102('0x6')](this[_0xb102('0x7')]['bind'](this),this[_0xb102('0x8')]['bind'](this));this['squeue']['on'](_0xb102('0x9'),this['handleTimeout']['bind'](this));this[_0xb102('0x4')]['on'](_0xb102('0xa'),this['handleDrained'][_0xb102('0xb')](this));};Beepall[_0xb102('0xc')][_0xb102('0x6')]=function(){this[_0xb102('0x4')][_0xb102('0x6')](this[_0xb102('0x7')][_0xb102('0xb')](this),this['handleTimeout'][_0xb102('0xb')](this));};Beepall['prototype'][_0xb102('0xd')]=function(_0xfb7240){this['handleTimeout'](!![]);};Beepall[_0xb102('0xc')][_0xb102('0x7')]=function(_0x5ab722){var _0x13895e=!![];if(!_[_0xb102('0xe')](this[_0xb102('0xf')])&&!_['isNil'](this['queue']['Agents'])&&this[_0xb102('0xf')][_0xb102('0x10')][_0xb102('0x11')]>0x0){for(var _0xc80615=0x0,_0x52c8c0;_0xc806150x0){for(var _0x5a41cb=0x0,_0x1ddad0;_0x5a41cb0x0&&_0xe14f94[_0x4adba7+_0x0543('0x26')]>=_0xe14f94[_0x4adba7+_0x0543('0x25')]){writeLog(_0x37347e,_0xe14f94,_0x4adba7['toUpperCase']()+_0x0543('0x27'));return![];}}return!![];};exports[_0x0543('0x28')]=function(_0x30ad9e,_0x4f2592,_0x9c7e34,_0x27031f,_0x41c4a7){return sendNotification(!![],_0x30ad9e,_0x4f2592,_0x9c7e34,_0x27031f,_0x41c4a7);};exports[_0x0543('0x29')]=function(_0x5dd789,_0x1732be,_0x10b9f3,_0x492f60,_0x576084){return sendNotification(![],_0x5dd789,_0x1732be,_0x10b9f3,_0x492f60,_0x576084);};exports[_0x0543('0x2a')]=writeLog; \ No newline at end of file +var _0x3e24=['hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','emit','format','name','split','\x20interaction','account','notificationSound','notificationShake','body','queue','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','online','OFFLINE','Pause','PAUSE'];(function(_0x2ca7ca,_0x24c7af){var _0x55ecf0=function(_0x513b54){while(--_0x513b54){_0x2ca7ca['push'](_0x2ca7ca['shift']());}};_0x55ecf0(++_0x24c7af);}(_0x3e24,0x167));var _0x43e2=function(_0x124128,_0x1934dd){_0x124128=_0x124128-0x0;var _0x25079e=_0x3e24[_0x124128];return _0x25079e;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var utils=require(_0x43e2('0x2'));var Mustache=require(_0x43e2('0x3'));var Redis=require(_0x43e2('0x4'));var config=require('../../../../../config/environment');var logger=require(_0x43e2('0x5'))(_0x43e2('0x6'));config['redis']=_[_0x43e2('0x7')](config[_0x43e2('0x8')],{'host':_0x43e2('0x9'),'port':0x18eb});var io=require(_0x43e2('0xa'))(new Redis(config[_0x43e2('0x8')]));function emit(_0x121e2e,_0x23b2d8,_0x59956d){io['to'](_0x121e2e)[_0x43e2('0xb')](_0x23b2d8,_0x59956d);}function sendNotification(_0x2357bc,_0x4bd2ce,_0x1c96f9,_0x2fdf85,_0x5375d8,_0x2ed387){io['to'](util[_0x43e2('0xc')]('user:%s',_0x2fdf85[_0x43e2('0xd')]))['emit']('user:save',_0x2fdf85);var _0x5847f0=_0x2ed387||{};var _0x103220=_0x1c96f9[_0x43e2('0xe')]('.');var _0x236b88={'uniqueid':_0x4bd2ce,'channel':_0x103220[0x0],'id':_0x103220[0x1],'title':_0x103220[0x0]+_0x43e2('0xf'),'interactionId':_0x103220[0x2],'queue':_0x5375d8?_0x5375d8[_0x43e2('0xd')]:null,'sound':_0x5847f0[_0x43e2('0x10')][_0x43e2('0x11')],'shake':_0x5847f0[_0x43e2('0x10')][_0x43e2('0x12')]};try{if(!_0x5847f0[_0x43e2('0x13')]){_0x5847f0[_0x43e2('0x13')]={};}if(_0x5375d8){_0x5847f0[_0x43e2('0x13')]['queue']=_0x5375d8;}else if(_0x5847f0[_0x43e2('0x13')][_0x43e2('0x14')]){delete _0x5847f0[_0x43e2('0x13')][_0x43e2('0x14')];}_0x236b88['msg']=utils['getMustacheRender'](_0x5847f0[_0x43e2('0x10')][_0x43e2('0x15')],_0x5847f0);}catch(_0x27aa89){_0x236b88[_0x43e2('0x16')]=_0x43e2('0x17');logger[_0x43e2('0x18')](util[_0x43e2('0xc')](_0x43e2('0x19'),_0x4bd2ce,_0x27aa89[_0x43e2('0x1a')]));}io['to'](util[_0x43e2('0xc')]('user:%s',_0x2fdf85[_0x43e2('0xd')]))[_0x43e2('0xb')](util['format'](_0x43e2('0x1b'),_0x2357bc?'save':_0x43e2('0x1c')),_0x236b88);}function writeLog(_0x13610f,_0x1fac53,_0x23825c){return logger[_0x43e2('0x1d')](util['format'](_0x43e2('0x1e'),_0x13610f,_0x1fac53[_0x43e2('0xd')],_0x23825c));}exports[_0x43e2('0x1f')]=function(_0x52e361,_0x234a1d,_0x32f048,_0x43078f){if(_0x234a1d[_0x43e2('0x20')]){writeLog(_0x52e361,_0x234a1d,'BUSY');return![];}if(!_0x234a1d[_0x43e2('0x21')]){writeLog(_0x52e361,_0x234a1d,_0x43e2('0x22'));return![];}if(_0x234a1d[_0x32f048+_0x43e2('0x23')]){writeLog(_0x52e361,_0x234a1d,_0x43e2('0x24'));return![];}if(_0x43078f&&_0x234a1d[_0x43e2('0x25')](_0x32f048+_0x43e2('0x26'))&&_0x234a1d[_0x43e2('0x25')](_0x32f048+_0x43e2('0x27'))){if(_0x234a1d[_0x32f048+_0x43e2('0x26')]>0x0&&_0x234a1d[_0x32f048+_0x43e2('0x27')]>=_0x234a1d[_0x32f048+_0x43e2('0x26')]){writeLog(_0x52e361,_0x234a1d,_0x32f048[_0x43e2('0x28')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x43e2('0x29')]=function(_0x2f2bd8,_0x545246,_0x163063,_0x1883c6,_0x2dffa2){return sendNotification(!![],_0x2f2bd8,_0x545246,_0x163063,_0x1883c6,_0x2dffa2);};exports[_0x43e2('0x2a')]=function(_0x3fd232,_0x5a896b,_0x42f495,_0xd1b43a,_0x1779f9){return sendNotification(![],_0x3fd232,_0x5a896b,_0x42f495,_0xd1b43a,_0x1779f9);};exports[_0x43e2('0x2b')]=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 e3eb13e..33d17d4 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 _0xdcdc=['info','next','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','message','join'];(function(_0x5ebbfe,_0x1f550d){var _0x67138e=function(_0x1ec0bb){while(--_0x1ec0bb){_0x5ebbfe['push'](_0x5ebbfe['shift']());}};_0x67138e(++_0x1f550d);}(_0xdcdc,0x8f));var _0xcdcd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdcdc[_0xa464c9];return _0x3d73c4;};'use strict';var schema=require('validate');var sh=require(_0xcdcd('0x0'));var _=require(_0xcdcd('0x1'));var utils=require(_0xcdcd('0x2'));var logger=require(_0xcdcd('0x3'))(_0xcdcd('0x4'));var system=schema({'command':{'type':_0xcdcd('0x5'),'required':!![],'message':_0xcdcd('0x6')}});exports[_0xcdcd('0x7')]=function(_0x1e92ad,_0x73f5f0){return function(_0x3d6861){try{var _0x6a3dd5={'command':_0x73f5f0[0x0]};var _0x8b0f0d=system['validate'](_0x6a3dd5,{'typecast':!![]});if(_0x8b0f0d['length']){logger[_0xcdcd('0x8')](_0xcdcd('0x9'),_0x1e92ad,_[_0xcdcd('0xa')](_0x8b0f0d,_0xcdcd('0xb'))[_0xcdcd('0xc')](',\x20'));logger[_0xcdcd('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1e92ad);_0x3d6861[_0xcdcd('0xe')]();}else{var _0x4e4222=this;var _0x2d0c1a=utils['getMustacheRender'](_0x73f5f0[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x1e92ad,_0x2d0c1a);sh[_0xcdcd('0xf')](_[_0xcdcd('0x10')](_0x2d0c1a),function(_0x111fca,_0x5a0a4b){logger[_0xcdcd('0xd')](_0xcdcd('0x11'),_0x1e92ad,_0x111fca);if(_0x111fca==0x0){var _0x3f59de=_0x5a0a4b[_0xcdcd('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xcdcd('0x13')](_0x73f5f0[0x1])||_[_0xcdcd('0x14')](_0x73f5f0[0x1])){logger['info'](_0xcdcd('0x15'),_0x1e92ad);_0x4e4222['body'][_0x73f5f0[0x1]]=_0x3f59de;}else{logger[_0xcdcd('0xd')](_0xcdcd('0x16'),_0x1e92ad,_0x73f5f0[0x1],_0x3f59de);_0x4e4222['body'][_0x73f5f0[0x1]]=_0x3f59de;}}_0x3d6861['next']();});}}catch(_0x32b075){logger[_0xcdcd('0x8')](_0xcdcd('0x9'),_0x1e92ad,_[_0xcdcd('0x17')](_0x32b075)?JSON[_0xcdcd('0x18')](_0x32b075):_0x32b075);logger[_0xcdcd('0xd')](_0xcdcd('0x19'),_0x1e92ad);_0x3d6861[_0xcdcd('0xe')]();}};}; \ No newline at end of file +var _0x440f=['length','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','info','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x304ce7,_0x55cf2e){var _0x393e3c=function(_0x59a97d){while(--_0x59a97d){_0x304ce7['push'](_0x304ce7['shift']());}};_0x393e3c(++_0x55cf2e);}(_0x440f,0xfc));var _0xf440=function(_0x2adb9a,_0x4cc763){_0x2adb9a=_0x2adb9a-0x0;var _0x188345=_0x440f[_0x2adb9a];return _0x188345;};'use strict';var schema=require(_0xf440('0x0'));var sh=require(_0xf440('0x1'));var _=require(_0xf440('0x2'));var utils=require(_0xf440('0x3'));var logger=require(_0xf440('0x4'))(_0xf440('0x5'));var system=schema({'command':{'type':_0xf440('0x6'),'required':!![],'message':_0xf440('0x7')}});exports[_0xf440('0x8')]=function(_0x10edf,_0x4e4a7d){return function(_0x28454f){try{var _0x29a1fb={'command':_0x4e4a7d[0x0]};var _0x3c7015=system[_0xf440('0x0')](_0x29a1fb,{'typecast':!![]});if(_0x3c7015[_0xf440('0x9')]){logger['error'](_0xf440('0xa'),_0x10edf,_[_0xf440('0xb')](_0x3c7015,_0xf440('0xc'))[_0xf440('0xd')](',\x20'));logger['info'](_0xf440('0xe'),_0x10edf);_0x28454f[_0xf440('0xf')]();}else{var _0x39b559=this;var _0xc60919=utils['getMustacheRender'](_0x4e4a7d[0x0],this);logger['info'](_0xf440('0x10'),_0x10edf,_0xc60919);sh[_0xf440('0x11')](_[_0xf440('0x12')](_0xc60919),function(_0x47d84c,_0x25487c){logger['info'](_0xf440('0x13'),_0x10edf,_0x47d84c);if(_0x47d84c==0x0){var _0x20c382=_0x25487c[_0xf440('0x14')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x4e4a7d[0x1])||_[_0xf440('0x15')](_0x4e4a7d[0x1])){logger[_0xf440('0x16')](_0xf440('0x17'),_0x10edf);_0x39b559[_0xf440('0x18')][_0x4e4a7d[0x1]]=_0x20c382;}else{logger[_0xf440('0x16')](_0xf440('0x19'),_0x10edf,_0x4e4a7d[0x1],_0x20c382);_0x39b559['body'][_0x4e4a7d[0x1]]=_0x20c382;}}_0x28454f[_0xf440('0xf')]();});}}catch(_0x1436ce){logger[_0xf440('0x1a')](_0xf440('0xa'),_0x10edf,_[_0xf440('0x1b')](_0x1436ce)?JSON[_0xf440('0x1c')](_0x1436ce):_0x1436ce);logger[_0xf440('0x16')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x10edf);_0x28454f['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 897d73a..3d55340 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 _0xd846=['validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd846,0x105));var _0x6d84=function(_0x158351,_0x3465d9){_0x158351=_0x158351-0x0;var _0x43207d=_0xd846[_0x158351];return _0x43207d;};'use strict';var schema=require(_0x6d84('0x0'));var _=require(_0x6d84('0x1'));var rpc={'chatInteraction':require(_0x6d84('0x2')),'openchannelInteraction':require(_0x6d84('0x3')),'smsInteraction':require(_0x6d84('0x4')),'mailInteraction':require(_0x6d84('0x5')),'faxInteraction':require(_0x6d84('0x6')),'whatsappInteraction':require(_0x6d84('0x7'))};var logger=require(_0x6d84('0x8'))(_0x6d84('0x9'));var tag=schema({'tag':{'type':_0x6d84('0xa'),'required':!![],'message':_0x6d84('0xb')}});exports[_0x6d84('0xc')]=function(_0x42d5d5,_0x7adac7,_0x136fad,_0x5910c6){return function(_0x330acf){try{var _0x52489e={'tag':_0x7adac7[0x0]};var _0x285130=tag[_0x6d84('0x0')](_0x52489e,{'typecast':!![]});if(_0x285130[_0x6d84('0xd')]){logger[_0x6d84('0xe')](_0x6d84('0xf'),_0x42d5d5,_[_0x6d84('0x10')](_0x285130,'message')[_0x6d84('0x11')](',\x20'));logger[_0x6d84('0x12')](_0x6d84('0x13'),_0x42d5d5);_0x330acf[_0x6d84('0x14')]();}else{var _0x932c01={'ids':[_0x7adac7[0x0]]};if(rpc[_0x5910c6['channel']+_0x6d84('0x15')]){rpc[_0x5910c6[_0x6d84('0x16')]+_0x6d84('0x15')]['addTags'](_0x5910c6[_0x6d84('0x17')]['id'],_0x932c01)[_0x6d84('0x18')](function(_0x1906b4){logger['info'](_0x6d84('0x19'),_0x42d5d5,_0x7adac7[0x1],_0x5910c6[_0x6d84('0x16')],_0x5910c6[_0x6d84('0x17')]['id']);})[_0x6d84('0x1a')](function(_0x137f69){logger[_0x6d84('0xe')]('[%s][TAG]\x20%s',_0x42d5d5,JSON[_0x6d84('0x1b')](_0x137f69));logger[_0x6d84('0x12')](_0x6d84('0x13'),_0x42d5d5);})[_0x6d84('0x1c')](function(){_0x330acf[_0x6d84('0x14')]();});}}}catch(_0x227ef7){logger['error'](_0x6d84('0xf'),_0x42d5d5,_['isObject'](_0x227ef7)?JSON['stringify'](_0x227ef7):_0x227ef7);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x42d5d5);_0x330acf[_0x6d84('0x14')]();}};}; \ No newline at end of file +var _0x9653=['stringify','next','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','length','error','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','then','catch'];(function(_0x21e38c,_0x5cd897){var _0x2ba423=function(_0x49c365){while(--_0x49c365){_0x21e38c['push'](_0x21e38c['shift']());}};_0x2ba423(++_0x5cd897);}(_0x9653,0x13b));var _0x3965=function(_0x242170,_0x475cd4){_0x242170=_0x242170-0x0;var _0x370f30=_0x9653[_0x242170];return _0x370f30;};'use strict';var schema=require(_0x3965('0x0'));var _=require(_0x3965('0x1'));var rpc={'chatInteraction':require(_0x3965('0x2')),'openchannelInteraction':require(_0x3965('0x3')),'smsInteraction':require(_0x3965('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x3965('0x5'))};var logger=require(_0x3965('0x6'))(_0x3965('0x7'));var tag=schema({'tag':{'type':_0x3965('0x8'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x3965('0x9')]=function(_0x1411fe,_0x10feb2,_0x2d84b3,_0x49542b){return function(_0x261f8a){try{var _0x21ecfc={'tag':_0x10feb2[0x0]};var _0x4ac7b5=tag[_0x3965('0x0')](_0x21ecfc,{'typecast':!![]});if(_0x4ac7b5[_0x3965('0xa')]){logger[_0x3965('0xb')](_0x3965('0xc'),_0x1411fe,_['map'](_0x4ac7b5,_0x3965('0xd'))[_0x3965('0xe')](',\x20'));logger[_0x3965('0xf')](_0x3965('0x10'),_0x1411fe);_0x261f8a['next']();}else{var _0x185678={'ids':[_0x10feb2[0x0]]};if(rpc[_0x49542b[_0x3965('0x11')]+_0x3965('0x12')]){rpc[_0x49542b['channel']+'Interaction'][_0x3965('0x13')](_0x49542b[_0x3965('0x14')]['id'],_0x185678)[_0x3965('0x15')](function(_0x28849b){logger[_0x3965('0xf')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x1411fe,_0x10feb2[0x1],_0x49542b[_0x3965('0x11')],_0x49542b['interaction']['id']);})[_0x3965('0x16')](function(_0x557f95){logger[_0x3965('0xb')]('[%s][TAG]\x20%s',_0x1411fe,JSON[_0x3965('0x17')](_0x557f95));logger['info'](_0x3965('0x10'),_0x1411fe);})['finally'](function(){_0x261f8a[_0x3965('0x18')]();});}}}catch(_0x163bf7){logger[_0x3965('0xb')]('[%s][TAG]\x20%s',_0x1411fe,_[_0x3965('0x19')](_0x163bf7)?JSON[_0x3965('0x17')](_0x163bf7):_0x163bf7);logger['info'](_0x3965('0x10'),_0x1411fe);_0x261f8a[_0x3965('0x18')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 7c29b51..4c18fe4 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb171=['urlOnAnswer','?params=','urlOnRing','title','2.0','method','login','params','stringify','utf8','POST','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','replace','\x20-\x20','push'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0xb171,0x101));var _0x1b17=function(_0x339df7,_0x144352){_0x339df7=_0x339df7-0x0;var _0x279d0d=_0xb171[_0x339df7];return _0x279d0d;};'use strict';var rp=require(_0x1b17('0x0'));var logger=require(_0x1b17('0x1'))(_0x1b17('0x2'));var _=require(_0x1b17('0x3'));var arr=[];exports['consequence']=function(_0x1fa9e1,_0x15466d){return function(_0x20cdbe){var _0x3e5a0f=_0x15466d[0xa];var _0x35e6f4=_0x15466d[0xb];var _0x4ccd31=_0x15466d[0xc];var _0x10383b=_0x15466d[0xd];var _0x4f8b5c=_0x15466d[0xe];var _0x114014=_0x15466d[0xf][_0x1b17('0x4')](/\n/g,_0x1b17('0x5'));var _0x3c15bc=_0x15466d[0x10][_0x1b17('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x35e6f4)){arr[_0x1b17('0x6')](_0x35e6f4);var _0x156671=_0x15466d[0x3];var _0x2ef20f=_0x15466d[0x4];var _0x357fff=_0x15466d[0x1];var _0x115039=_0x15466d[0x0];var _0x4a23db={};_0x4a23db[_0x1b17('0x7')]=_0x15466d[0x8]+_0x1b17('0x8')+_0x4ccd31+'|'+_0x3e5a0f+'|'+_0x10383b+'|'+_0x35e6f4+'|'+_0x4f8b5c;_0x4a23db[_0x1b17('0x9')]=_0x15466d[0x7]+_0x1b17('0x8')+_0x4ccd31+'|'+_0x3e5a0f+'|'+_0x10383b+'|'+_0x35e6f4+'|'+_0x4f8b5c+'|'+_0x114014+'|'+_0x3c15bc;_0x4a23db[_0x1b17('0xa')]=_0x15466d[0x9];var _0x4bd11b={};_0x4bd11b['jsonrpc']=_0x1b17('0xb');_0x4bd11b[_0x1b17('0xc')]=_0x1b17('0xd');var _0x339a43=[];_0x339a43[_0x1b17('0x6')](_0x15466d[0x2]);_0x339a43['push'](_0x15466d[0x5]);_0x339a43['push'](_0x15466d[0x6]);_0x4bd11b[_0x1b17('0xe')]=_0x339a43;_0x4bd11b['id']=0x1;var _0x4aa0b2=JSON[_0x1b17('0xf')](_0x4bd11b);var _0x12395d={'encoding':_0x1b17('0x10'),'method':_0x1b17('0x11'),'timeout':0x2710,'url':_0x156671,'headers':{'Content-Type':'application/json-rpc'},'body':_0x4aa0b2};return rp(_0x12395d)[_0x1b17('0x12')](function(_0x360b7c){const _0x2e2f4d=JSON[_0x1b17('0x13')](_0x360b7c);if(!_0x2e2f4d[_0x1b17('0x14')][_0x1b17('0x15')]){throw new Error(_0x1b17('0x16'));}var _0x295aa3=_0x35e6f4;var _0x18a530=_0x1b17('0x17')+_0x357fff+_0x1b17('0x18')+_0x115039+_0x1b17('0x19')+_0x295aa3+'&data='+JSON[_0x1b17('0xf')](_0x4a23db);var _0x5b301d=_0x2ef20f+'?'+_0x18a530;return rp(_0x5b301d);})[_0x1b17('0x12')](function(_0x298bc8){logger['info'](_0x1b17('0x1a'),_0x1fa9e1,_0x298bc8);_0x20cdbe[_0x1b17('0x1b')]();})['catch'](function(_0x4a4f52){logger['error'](_0x1b17('0x1c'),_0x1fa9e1,_[_0x1b17('0x1d')](_0x4a4f52)?JSON[_0x1b17('0xf')](_0x4a4f52):_0x4a4f52);_0x20cdbe[_0x1b17('0x1b')]();});}else{logger[_0x1b17('0x1e')](_0x1b17('0x1f'),_0x1fa9e1);_0x20cdbe[_0x1b17('0x20')]();}};}; \ No newline at end of file +var _0x422d=['../../../../config/logger','routing','lodash','\x20-\x20','replace','includes','urlOnAnswer','urlOnRing','?params=','title','jsonrpc','2.0','method','login','push','params','stringify','utf8','application/json-rpc','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','&data=','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise'];(function(_0x417c84,_0x1de9c1){var _0xb5550d=function(_0x88f154){while(--_0x88f154){_0x417c84['push'](_0x417c84['shift']());}};_0xb5550d(++_0x1de9c1);}(_0x422d,0x68));var _0xd422=function(_0x37c073,_0x274234){_0x37c073=_0x37c073-0x0;var _0x4e4caa=_0x422d[_0x37c073];return _0x4e4caa;};'use strict';var rp=require(_0xd422('0x0'));var logger=require(_0xd422('0x1'))(_0xd422('0x2'));var _=require(_0xd422('0x3'));var arr=[];exports['consequence']=function(_0x2962df,_0x304dd3){return function(_0x5a30c3){var _0x57dd9c=_0x304dd3[0xa];var _0x426828=_0x304dd3[0xb];var _0x80fda4=_0x304dd3[0xc];var _0x54b49b=_0x304dd3[0xd];var _0x135aa6=_0x304dd3[0xe];var _0x4897e4=_0x304dd3[0xf]['replace'](/\n/g,_0xd422('0x4'));var _0x2b1028=_0x304dd3[0x10][_0xd422('0x5')](/\n/g,'\x20');if(!arr[_0xd422('0x6')](_0x426828)){arr['push'](_0x426828);var _0x10c898=_0x304dd3[0x3];var _0x33750d=_0x304dd3[0x4];var _0x5ab135=_0x304dd3[0x1];var _0x34e3d3=_0x304dd3[0x0];var _0x3c309b={};_0x3c309b[_0xd422('0x7')]=_0x304dd3[0x8]+'?params='+_0x80fda4+'|'+_0x57dd9c+'|'+_0x54b49b+'|'+_0x426828+'|'+_0x135aa6;_0x3c309b[_0xd422('0x8')]=_0x304dd3[0x7]+_0xd422('0x9')+_0x80fda4+'|'+_0x57dd9c+'|'+_0x54b49b+'|'+_0x426828+'|'+_0x135aa6+'|'+_0x4897e4+'|'+_0x2b1028;_0x3c309b[_0xd422('0xa')]=_0x304dd3[0x9];var _0x45c669={};_0x45c669[_0xd422('0xb')]=_0xd422('0xc');_0x45c669[_0xd422('0xd')]=_0xd422('0xe');var _0x4e182b=[];_0x4e182b['push'](_0x304dd3[0x2]);_0x4e182b[_0xd422('0xf')](_0x304dd3[0x5]);_0x4e182b['push'](_0x304dd3[0x6]);_0x45c669[_0xd422('0x10')]=_0x4e182b;_0x45c669['id']=0x1;var _0x26617c=JSON[_0xd422('0x11')](_0x45c669);var _0x17b12c={'encoding':_0xd422('0x12'),'method':'POST','timeout':0x2710,'url':_0x10c898,'headers':{'Content-Type':_0xd422('0x13')},'body':_0x26617c};return rp(_0x17b12c)[_0xd422('0x14')](function(_0x3a3f3f){const _0x3f69e1=JSON[_0xd422('0x15')](_0x3a3f3f);if(!_0x3f69e1['result'][_0xd422('0x16')]){throw new Error(_0xd422('0x17'));}var _0x163aac=_0x426828;var _0x444501=_0xd422('0x18')+_0x5ab135+'&serviceId='+_0x34e3d3+_0xd422('0x19')+_0x163aac+_0xd422('0x1a')+JSON[_0xd422('0x11')](_0x3c309b);var _0x288be7=_0x33750d+'?'+_0x444501;return rp(_0x288be7);})[_0xd422('0x14')](function(_0x3a1a90){logger[_0xd422('0x1b')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x2962df,_0x3a1a90);_0x5a30c3[_0xd422('0x1c')]();})[_0xd422('0x1d')](function(_0x34dbfb){logger[_0xd422('0x1e')](_0xd422('0x1f'),_0x2962df,_[_0xd422('0x20')](_0x34dbfb)?JSON['stringify'](_0x34dbfb):_0x34dbfb);_0x5a30c3[_0xd422('0x1c')]();});}else{logger['info'](_0xd422('0x21'),_0x2962df);_0x5a30c3[_0xd422('0x22')]();}};}; \ 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 56ad4a1..cb9ace1 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(_0x455315,_0x955a05){var _0x2a906f=function(_0x557569){while(--_0x557569){_0x455315['push'](_0x455315['shift']());}};_0x2a906f(++_0x955a05);}(_0xe706,0xa3));var _0x6e70=function(_0xbb02a6,_0x2b3f2c){_0xbb02a6=_0xbb02a6-0x0;var _0x4d7739=_0xe706[_0xbb02a6];return _0x4d7739;};'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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x412d18,_0x4f020a){var _0x41af86=function(_0x281900){while(--_0x281900){_0x412d18['push'](_0x412d18['shift']());}};_0x41af86(++_0x4f020a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 41a38b0..926d991 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 _0x1306=['tag','TagId','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','error','stack','agent','agents','busy','channel','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','paused','waiting','mailQueues','available','name','openchannelQueues','loggedIn','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','.js','app','toLowerCase','split','mail','push','slice','appdata','dialogflowv2','amazonlex'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x1306,0x17a));var _0x6130=function(_0x3e25bb,_0x4dbff0){_0x3e25bb=_0x3e25bb-0x0;var _0x3f04a6=_0x1306[_0x3e25bb];return _0x3f04a6;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var path=require(_0x6130('0x2'));var fs=require('fs');var jayson=require(_0x6130('0x3'));var BPromise=require(_0x6130('0x4'));var uuid=require(_0x6130('0x5'));var utils=require(_0x6130('0x6'));var config=require(_0x6130('0x7'));var logger=require(_0x6130('0x8'))(_0x6130('0x9'));var rpc={'openchannelQueueReport':require(_0x6130('0xa')),'mailQueueReport':require(_0x6130('0xb')),'chatQueueReport':require(_0x6130('0xc')),'smsQueueReport':require(_0x6130('0xd')),'faxQueueReport':require(_0x6130('0xe')),'whatsappQueueReport':require(_0x6130('0xf'))};var RuleEngine=require(_0x6130('0x10'));function getId(_0x288b1d,_0x13163f,_0x2854a1){return util[_0x6130('0x11')](_0x6130('0x12'),_0x288b1d,_0x13163f||0x0,_0x2854a1||0x0);}function getIntervals(_0xb9c7e6,_0x34d1a6){var _0x2d06a5=[];if(!_[_0x6130('0x13')](_0x34d1a6[_0x6130('0x14')])&&!_[_0x6130('0x13')](_0xb9c7e6[_0x34d1a6[_0x6130('0x14')]])&&!_['isNil'](_0xb9c7e6[_0x34d1a6[_0x6130('0x14')]]['Intervals'])){_0x2d06a5=_[_0x6130('0x15')](_0xb9c7e6[_0x34d1a6[_0x6130('0x14')]]['Intervals'],_0x6130('0x16'));}else if(!_[_0x6130('0x13')](_0x34d1a6[_0x6130('0x16')])){_0x2d06a5=[_0x34d1a6[_0x6130('0x16')]];}return _0x2d06a5;}exports[_0x6130('0x17')]=function(_0x3470e8){_0x3470e8[_0x6130('0x18')]={};return new BPromise(function(_0x3ce875,_0x3c15df){var _0x3ef4c1={'Start':function(_0x401a70){var _0x4626a2=this;return new Promise(function(_0x39b444,_0x274659){if(_0x401a70){try{var _0x3298f0=[];var _0x46c2e3=getId(_0x401a70['channel'],_0x401a70['message']?_0x401a70[_0x6130('0x19')]['id']:0x0,_0x401a70['interaction']?_0x401a70[_0x6130('0x1a')]['id']:0x0);if(_0x401a70[_0x6130('0x1b')]&&_[_0x6130('0x1c')](_0x401a70[_0x6130('0x1b')])&&_0x401a70[_0x6130('0x1b')]['length']){for(var _0x33f0f6=0x0;_0x33f0f6<_0x401a70['applications'][_0x6130('0x1d')];_0x33f0f6+=0x1){var _0x41f56a=_0x401a70[_0x6130('0x1b')][_0x33f0f6];if(fs[_0x6130('0x1e')](path[_0x6130('0x1f')](__dirname,'applications',_0x41f56a['app']+_0x6130('0x20')))){var _0x534390=[];switch(_0x41f56a[_0x6130('0x21')][_0x6130('0x22')]()){case'autoreply':var _0x4dbc02=_0x41f56a['appdata'][_0x6130('0x23')](',');if(_0x401a70['channel']===_0x6130('0x24')){_0x534390['push'](_0x4dbc02[0x0]);_0x534390['push'](_0x4dbc02[0x1]);_0x534390['push'](_0x4dbc02['slice'](0x2,_0x4dbc02['length'])[_0x6130('0x1f')](','));}else{_0x534390[_0x6130('0x25')](_0x4dbc02[0x0]);_0x534390['push'](_0x4dbc02[_0x6130('0x26')](0x1,_0x4dbc02['length'])[_0x6130('0x1f')](','));}break;case'dialogflow':var _0x5787a6=_0x41f56a[_0x6130('0x27')][_0x6130('0x23')](',');_0x534390[_0x6130('0x25')](_0x5787a6[0x0]);_0x534390[_0x6130('0x25')](_0x5787a6[0x1]);_0x534390[_0x6130('0x25')](_0x5787a6[_0x6130('0x26')](0x2,_0x5787a6[_0x6130('0x1d')])[_0x6130('0x1f')](','));break;case _0x6130('0x28'):var _0x5809e4=_0x41f56a['appdata'][_0x6130('0x23')](',');_0x534390[_0x6130('0x25')](_0x5809e4[0x0]);_0x534390[_0x6130('0x25')](_0x5809e4[0x1]);_0x534390[_0x6130('0x25')](_0x5809e4[0x2]);_0x534390[_0x6130('0x25')](_0x5809e4[0x3]);_0x534390['push'](_0x5809e4[_0x6130('0x26')](0x4,_0x5809e4[_0x6130('0x1d')])[_0x6130('0x1f')](','));break;case _0x6130('0x29'):var _0x76dfa6=_0x41f56a['appdata'][_0x6130('0x23')](',');_0x534390[_0x6130('0x25')](_0x76dfa6[0x0]);_0x534390[_0x6130('0x25')](_0x76dfa6[0x1]);_0x534390['push'](_0x76dfa6[0x2]);_0x534390[_0x6130('0x25')](_0x76dfa6[0x3]);_0x534390[_0x6130('0x25')](_0x76dfa6[_0x6130('0x26')](0x4,_0x76dfa6[_0x6130('0x1d')])[_0x6130('0x1f')](','));break;case _0x6130('0x19'):_0x534390[_0x6130('0x25')](_0x41f56a[_0x6130('0x27')]);break;case _0x6130('0x2a'):_0x534390['push'](_0x41f56a[_0x6130('0x2b')]);_0x534390['push'](_0x41f56a['appdata']);break;case'tvox':var _0x1ffc85=utils[_0x6130('0x2c')](_0x401a70[_0x6130('0x2d')][_0x6130('0x2e')],_0x401a70);var _0x438cde=_0x41f56a[_0x6130('0x27')][_0x6130('0x23')](',');_0x534390[_0x6130('0x25')](_0x438cde[0x0]);_0x534390['push'](_0x438cde[0x1]);_0x534390[_0x6130('0x25')](_0x438cde[0x2]);_0x534390[_0x6130('0x25')](_0x438cde[0x3]);_0x534390['push'](_0x438cde[0x4]);_0x534390[_0x6130('0x25')](_0x438cde[0x5]);_0x534390[_0x6130('0x25')](_0x438cde[0x6]);_0x534390[_0x6130('0x25')](_0x438cde[0x7]);_0x534390['push'](_0x438cde[0x8]);_0x534390[_0x6130('0x25')](_0x438cde[0x9]);_0x534390[_0x6130('0x25')](_0x438cde[0xa]);_0x534390['push'](_0x401a70['interaction']['id']);_0x534390[_0x6130('0x25')](_0x401a70[_0x6130('0x19')]['id']);_0x534390[_0x6130('0x25')](_0x41f56a['ChatWebsiteId']);_0x534390['push'](_0x401a70[_0x6130('0x1a')][_0x6130('0x2f')]);_0x534390[_0x6130('0x25')](_0x401a70[_0x6130('0x30')][_0x6130('0x30')]);_0x534390[_0x6130('0x25')](_0x1ffc85);break;default:_0x534390=_[_0x6130('0x13')](_0x41f56a['appdata'])?[]:_0x41f56a[_0x6130('0x27')][_0x6130('0x23')](',');}var _0x101aab={'id':util[_0x6130('0x11')](_0x6130('0x31'),_0x46c2e3,_0x41f56a['id'],_0x41f56a[_0x6130('0x21')]),'condition':require(_0x6130('0x32'))['condition'](_0x46c2e3,getIntervals(_0x3470e8[_0x6130('0x33')],_0x41f56a),_0x3470e8),'consequence':require(_0x6130('0x34')+_0x41f56a[_0x6130('0x21')])[_0x6130('0x35')](_0x46c2e3,_0x534390,_0x3470e8,_0x401a70),'p':_0x41f56a[_0x6130('0x36')]||0x0};logger[_0x6130('0x37')](_0x6130('0x38'),_0x101aab['id'],_0x6130('0x39'),getIntervals(_0x3470e8['intervals'],_0x41f56a)[_0x6130('0x1f')](_0x6130('0x3a')));_0x3298f0[_0x6130('0x25')](_0x101aab);}else{logger['error'](_0x6130('0x3b'),path[_0x6130('0x1f')](__dirname,_0x6130('0x1b'),_0x41f56a['app']+'.js'));}}_0x3470e8[_0x6130('0x18')][_0x46c2e3]=new RuleEngine(_0x3298f0);_0x3470e8[_0x6130('0x18')][_0x46c2e3][_0x6130('0x3c')](_0x401a70,function(_0xd87943){logger[_0x6130('0x37')]('Applications\x20executed',JSON[_0x6130('0x3d')](_0xd87943[_0x6130('0x3e')]));if(_0x3470e8['rules'][_0x46c2e3]){_0x3470e8[_0x6130('0x18')][_0x46c2e3][_0x6130('0x3f')](_0x6130('0x40'));}});return _0x39b444({'code':0xc8,'message':_0x401a70});}else{logger[_0x6130('0x37')](_0x6130('0x41'));return _0x39b444({'code':0xc8,'message':_0x401a70});}}catch(_0x30152a){logger[_0x6130('0x42')](_0x30152a[_0x6130('0x43')]);return _0x274659(_0x4626a2['error'](0x1f4,_0x30152a));}}return _0x274659('routing\x20is\x20empty');});},'AcceptMessage':function(_0x20423b){var _0x534a67=this;return new Promise(function(_0x28fb1f,_0x4170d9){if(_0x20423b[_0x6130('0x44')]&&_0x20423b[_0x6130('0x44')]['id']){if(_0x3470e8[_0x6130('0x45')][_0x20423b[_0x6130('0x44')]['id']]){_0x3470e8[_0x6130('0x45')][_0x20423b[_0x6130('0x44')]['id']][_0x6130('0x46')]=![];_0x3470e8[_0x6130('0x45')][_0x20423b[_0x6130('0x44')]['id']]['busyQueue']=undefined;}}if(_0x20423b[_0x6130('0x19')]&&_0x20423b[_0x6130('0x19')]['id']){try{var _0xd80b54=getId(_0x20423b[_0x6130('0x47')],_0x20423b[_0x6130('0x19')]?_0x20423b[_0x6130('0x19')]['id']:0x0,_0x20423b[_0x6130('0x1a')]?_0x20423b[_0x6130('0x1a')]['id']:0x0);if(_0x3470e8[_0x6130('0x18')][_0xd80b54]){_0x3470e8[_0x6130('0x18')][_0xd80b54]['emit'](_0x6130('0x48'));if(rpc[_0x20423b[_0x6130('0x47')]+_0x6130('0x49')]){rpc[_0x20423b[_0x6130('0x47')]+_0x6130('0x49')][_0x6130('0x4a')](_0xd80b54,{'UserId':_0x20423b[_0x6130('0x19')][_0x6130('0x4b')]})[_0x6130('0x4c')](function(_0x484e1b){logger[_0x6130('0x42')](_0x6130('0x4d'));});}}return _0x28fb1f({'code':0xc8,'message':_0x20423b});}catch(_0x1d0240){logger[_0x6130('0x42')](_0x1d0240[_0x6130('0x43')]);return _0x4170d9(_0x534a67[_0x6130('0x42')](0x1f4,_0x1d0240));}}logger['error'](_0x6130('0x4e'));return _0x4170d9(_0x534a67[_0x6130('0x42')](0x1f4,_0x6130('0x4e')));});},'RejectMessage':function(_0x5180ab){var _0x4f5207=this;return new Promise(function(_0x523535,_0x529977){if(_0x5180ab[_0x6130('0x44')]&&_0x5180ab[_0x6130('0x44')]['id']){try{if(_0x3470e8[_0x6130('0x45')][_0x5180ab['agent']['id']]){_0x3470e8['agents'][_0x5180ab['agent']['id']]['busy']=![];_0x3470e8[_0x6130('0x45')][_0x5180ab[_0x6130('0x44')]['id']][_0x6130('0x4f')]=undefined;}return _0x523535({'code':0xc8,'message':_0x5180ab});}catch(_0x49b9ba){logger[_0x6130('0x42')](_0x49b9ba['stack']);return _0x529977(_0x4f5207[_0x6130('0x42')](0x1f4,_0x49b9ba));}}logger[_0x6130('0x42')]('message\x20is\x20empty');return _0x529977(_0x4f5207[_0x6130('0x42')](0x1f4,_0x6130('0x4e')));});},'AbandonInteraction':function(_0x36700f){var _0x32bf20=this;return new Promise(function(_0x2fab80,_0x27c0df){if(_0x36700f[_0x6130('0x47')]&&_0x36700f[_0x6130('0x1a')]&&_0x36700f['interaction']['id']){try{var _0x159ff8=getId(_0x36700f[_0x6130('0x47')],_0x36700f[_0x6130('0x19')]?_0x36700f['message']['id']:0x0,_0x36700f['interaction']?_0x36700f[_0x6130('0x1a')]['id']:0x0);if(_0x3470e8[_0x6130('0x18')][_0x159ff8]){_0x3470e8[_0x6130('0x18')][_0x159ff8][_0x6130('0x3f')](_0x6130('0x48'));}return _0x2fab80({'code':0xc8,'message':_0x36700f});}catch(_0x519a0c){logger[_0x6130('0x42')](_0x519a0c[_0x6130('0x43')]);return _0x27c0df(_0x32bf20[_0x6130('0x42')](0x1f4,_0x519a0c));}}logger[_0x6130('0x42')](_0x6130('0x4e'));return _0x27c0df(_0x32bf20[_0x6130('0x42')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x4e5ec0){var _0x1dea6f=this;return new Promise(function(_0xcf6aea,_0x5c55cf){if(_0x3470e8[_0x6130('0x45')][_0x6130('0x50')](_0x4e5ec0['id'])){for(var _0x1a8629 in _0x4e5ec0[_0x6130('0x51')]){if(_0x4e5ec0['capacity'][_0x6130('0x50')](_0x1a8629)){if(_0x3470e8[_0x6130('0x45')][_0x4e5ec0['id']][_0x6130('0x50')](_0x1a8629+_0x6130('0x52'))){_0x3470e8[_0x6130('0x45')][_0x4e5ec0['id']][_0x1a8629+_0x6130('0x52')]=parseInt(_0x4e5ec0[_0x6130('0x51')][_0x1a8629],0xa);}}}_0x3470e8[_0x6130('0x45')][_0x4e5ec0['id']]['updateRealtime']();return _0xcf6aea({'code':0xc8,'message':_0x3470e8[_0x6130('0x45')][_0x4e5ec0['id']]});}else{return _0x5c55cf(_0x1dea6f[_0x6130('0x42')](0x1f4,_0x6130('0x53')));}});},'Agents':function(_0x14e745){return new Promise(function(_0xc18fa0,_0x42cfe3){var _0x4a6c08=_[_0x6130('0x54')](_0x3470e8[_0x6130('0x45')]);_0xc18fa0({'count':_0x4a6c08[_0x6130('0x1d')],'rows':_0x4a6c08});});},'ChatQueues':function(_0x1dd821){return new Promise(function(_0x274add,_0x42abae){var _0x2d27e6=[];for(var _0x31d20d in _0x3470e8[_0x6130('0x55')]){if(_0x3470e8[_0x6130('0x55')][_0x6130('0x50')](_0x31d20d)){var _0x3a5876=_0x3470e8['chatQueues'][_0x31d20d];var _0x5c3f68={'id':_0x3a5876['id'],'available':_0x3a5876['available'],'loggedIn':_0x3a5876['loggedIn'],'name':_0x3a5876['name'],'paused':_0x3a5876[_0x6130('0x56')],'waiting':_0x3a5876[_0x6130('0x57')]};_0x2d27e6['push'](_0x5c3f68);}}_0x274add({'count':_0x2d27e6[_0x6130('0x1d')],'rows':_0x2d27e6});});},'MailQueues':function(_0x529e4c){return new Promise(function(_0x43187c,_0xf82ecf){var _0x2d48f=[];for(var _0x28ccef in _0x3470e8[_0x6130('0x58')]){if(_0x3470e8[_0x6130('0x58')][_0x6130('0x50')](_0x28ccef)){var _0x20a5d8=_0x3470e8['mailQueues'][_0x28ccef];var _0x3f76ef={'id':_0x20a5d8['id'],'available':_0x20a5d8[_0x6130('0x59')],'loggedIn':_0x20a5d8['loggedIn'],'name':_0x20a5d8[_0x6130('0x5a')],'paused':_0x20a5d8[_0x6130('0x56')],'waiting':_0x20a5d8[_0x6130('0x57')]};_0x2d48f[_0x6130('0x25')](_0x3f76ef);}}_0x43187c({'count':_0x2d48f['length'],'rows':_0x2d48f});});},'OpenchannelQueues':function(_0x76ac33){return new Promise(function(_0x5a7009,_0x232b38){var _0x340fa8=[];for(var _0x34e7fe in _0x3470e8[_0x6130('0x5b')]){if(_0x3470e8['openchannelQueues']['hasOwnProperty'](_0x34e7fe)){var _0x486037=_0x3470e8[_0x6130('0x5b')][_0x34e7fe];var _0x22581c={'id':_0x486037['id'],'available':_0x486037[_0x6130('0x59')],'loggedIn':_0x486037[_0x6130('0x5c')],'name':_0x486037[_0x6130('0x5a')],'paused':_0x486037[_0x6130('0x56')],'waiting':_0x486037[_0x6130('0x57')]};_0x340fa8[_0x6130('0x25')](_0x22581c);}}_0x5a7009({'count':_0x340fa8[_0x6130('0x1d')],'rows':_0x340fa8});});},'SmsQueues':function(_0x2892f2){return new Promise(function(_0x44662b,_0x19986c){var _0x4965f5=[];for(var _0x447b62 in _0x3470e8[_0x6130('0x5d')]){if(_0x3470e8[_0x6130('0x5d')][_0x6130('0x50')](_0x447b62)){var _0x4a945a=_0x3470e8[_0x6130('0x5d')][_0x447b62];var _0x5e094c={'id':_0x4a945a['id'],'available':_0x4a945a[_0x6130('0x59')],'loggedIn':_0x4a945a[_0x6130('0x5c')],'name':_0x4a945a[_0x6130('0x5a')],'paused':_0x4a945a[_0x6130('0x56')],'waiting':_0x4a945a[_0x6130('0x57')]};_0x4965f5['push'](_0x5e094c);}}_0x44662b({'count':_0x4965f5['length'],'rows':_0x4965f5});});},'FaxQueues':function(_0x92d7f7){return new Promise(function(_0x6b2727,_0x1314e3){var _0x553c07=[];for(var _0x261f2c in _0x3470e8[_0x6130('0x5e')]){if(_0x3470e8[_0x6130('0x5e')][_0x6130('0x50')](_0x261f2c)){var _0x3dff69=_0x3470e8[_0x6130('0x5e')][_0x261f2c];var _0x434294={'id':_0x3dff69['id'],'available':_0x3dff69[_0x6130('0x59')],'loggedIn':_0x3dff69['loggedIn'],'name':_0x3dff69['name'],'paused':_0x3dff69[_0x6130('0x56')],'waiting':_0x3dff69[_0x6130('0x57')]};_0x553c07[_0x6130('0x25')](_0x434294);}}_0x6b2727({'count':_0x553c07['length'],'rows':_0x553c07});});},'WhatsappQueues':function(_0x3b72dd){return new Promise(function(_0x3fd1e4,_0x96de7f){var _0x55a7f6=[];for(var _0xb0b0b2 in _0x3470e8[_0x6130('0x5f')]){if(_0x3470e8[_0x6130('0x5f')][_0x6130('0x50')](_0xb0b0b2)){var _0xdeefaf=_0x3470e8[_0x6130('0x5f')][_0xb0b0b2];var _0x447b80={'id':_0xdeefaf['id'],'available':_0xdeefaf[_0x6130('0x59')],'loggedIn':_0xdeefaf['loggedIn'],'name':_0xdeefaf[_0x6130('0x5a')],'paused':_0xdeefaf[_0x6130('0x56')],'waiting':_0xdeefaf[_0x6130('0x57')]};_0x55a7f6['push'](_0x447b80);}}_0x3fd1e4({'count':_0x55a7f6['length'],'rows':_0x55a7f6});});},'ChatQueuesWaitingInteractions':function(_0x1e8263){return new Promise(function(_0x70fd04,_0x55c59c){var _0x19069c=_[_0x6130('0x54')](_0x3470e8[_0x6130('0x60')]);_0x70fd04({'count':_0x19069c[_0x6130('0x1d')],'rows':_0x19069c});});},'MailQueuesWaitingInteractions':function(_0xb5e827){return new Promise(function(_0x30b43b,_0x3b0e9f){var _0x356867=_[_0x6130('0x54')](_0x3470e8['mailQueuesWaitingInteractions']);_0x30b43b({'count':_0x356867[_0x6130('0x1d')],'rows':_0x356867});});},'OpenchannelQueuesWaitingInteractions':function(_0x24d710){return new Promise(function(_0x507835,_0x460c32){var _0x2f80b3=_['values'](_0x3470e8[_0x6130('0x61')]);_0x507835({'count':_0x2f80b3[_0x6130('0x1d')],'rows':_0x2f80b3});});},'SmsQueuesWaitingInteractions':function(_0x441cfc){return new Promise(function(_0x297142,_0x11043d){var _0x5abd1a=_[_0x6130('0x54')](_0x3470e8[_0x6130('0x62')]);_0x297142({'count':_0x5abd1a['length'],'rows':_0x5abd1a});});},'FaxQueuesWaitingInteractions':function(_0x1d0591){return new Promise(function(_0x2d5d76,_0x50f26b){var _0x13e869=_[_0x6130('0x54')](_0x3470e8[_0x6130('0x63')]);_0x2d5d76({'count':_0x13e869[_0x6130('0x1d')],'rows':_0x13e869});});},'WhatsappQueuesWaitingInteractions':function(_0x5f531a){return new Promise(function(_0x13f193,_0xc18d8d){var _0x5cac5c=_[_0x6130('0x54')](_0x3470e8[_0x6130('0x64')]);_0x13f193({'count':_0x5cac5c['length'],'rows':_0x5cac5c});});}};var _0x114e2f=jayson[_0x6130('0x65')](_0x3ef4c1)['http']();_0x114e2f['on'](_0x6130('0x42'),function(_0x5c77df){logger[_0x6130('0x42')](JSON[_0x6130('0x3d')](_0x5c77df));return _0x3c15df(_0x5c77df);});_0x114e2f[_0x6130('0x17')](0x232c,_0x6130('0x66'),function(){console[_0x6130('0x67')](_0x6130('0x68'),0x232c);return _0x3ce875('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x630e=['QueueReport','update','UserId','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','stringify','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','path','uuid','./applications/utils','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','appdata','split','mail','push','slice','dialogflow','dialogflowv2','tag','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','consequence','priority','info','on\x20interval','intervals','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','matchPath','emit','No\x20applications\x20to\x20execute','stack','error','routing\x20is\x20empty','agent','agents','busy','busyQueue','end'];(function(_0x4d9598,_0x498a4e){var _0x493d83=function(_0x1a0b42){while(--_0x1a0b42){_0x4d9598['push'](_0x4d9598['shift']());}};_0x493d83(++_0x498a4e);}(_0x630e,0x1af));var _0xe630=function(_0x32cefe,_0x8f3241){_0x32cefe=_0x32cefe-0x0;var _0x27850c=_0x630e[_0x32cefe];return _0x27850c;};'use strict';var _=require(_0xe630('0x0'));var util=require('util');var path=require(_0xe630('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var uuid=require(_0xe630('0x2'));var utils=require(_0xe630('0x3'));var config=require(_0xe630('0x4'));var logger=require('../../../config/logger')(_0xe630('0x5'));var rpc={'openchannelQueueReport':require(_0xe630('0x6')),'mailQueueReport':require(_0xe630('0x7')),'chatQueueReport':require(_0xe630('0x8')),'smsQueueReport':require(_0xe630('0x9')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xe630('0xa'))};var RuleEngine=require(_0xe630('0xb'));function getId(_0x5a73ad,_0x267926,_0x5a9d7c){return util[_0xe630('0xc')](_0xe630('0xd'),_0x5a73ad,_0x267926||0x0,_0x5a9d7c||0x0);}function getIntervals(_0x3bceb0,_0x5a3a70){var _0x5cac88=[];if(!_[_0xe630('0xe')](_0x5a3a70[_0xe630('0xf')])&&!_[_0xe630('0xe')](_0x3bceb0[_0x5a3a70[_0xe630('0xf')]])&&!_['isNil'](_0x3bceb0[_0x5a3a70[_0xe630('0xf')]][_0xe630('0x10')])){_0x5cac88=_[_0xe630('0x11')](_0x3bceb0[_0x5a3a70[_0xe630('0xf')]][_0xe630('0x10')],_0xe630('0x12'));}else if(!_[_0xe630('0xe')](_0x5a3a70[_0xe630('0x12')])){_0x5cac88=[_0x5a3a70[_0xe630('0x12')]];}return _0x5cac88;}exports[_0xe630('0x13')]=function(_0xe92984){_0xe92984[_0xe630('0x14')]={};return new BPromise(function(_0x2e314e,_0x4f48d0){var _0x1d8b1c={'Start':function(_0x1587a7){var _0x3e89f7=this;return new Promise(function(_0x3916a5,_0x6671d0){if(_0x1587a7){try{var _0x43b74a=[];var _0x26a2b7=getId(_0x1587a7[_0xe630('0x15')],_0x1587a7[_0xe630('0x16')]?_0x1587a7[_0xe630('0x16')]['id']:0x0,_0x1587a7[_0xe630('0x17')]?_0x1587a7[_0xe630('0x17')]['id']:0x0);if(_0x1587a7[_0xe630('0x18')]&&_[_0xe630('0x19')](_0x1587a7[_0xe630('0x18')])&&_0x1587a7[_0xe630('0x18')][_0xe630('0x1a')]){for(var _0x29a67f=0x0;_0x29a67f<_0x1587a7[_0xe630('0x18')][_0xe630('0x1a')];_0x29a67f+=0x1){var _0x226041=_0x1587a7[_0xe630('0x18')][_0x29a67f];if(fs[_0xe630('0x1b')](path[_0xe630('0x1c')](__dirname,_0xe630('0x18'),_0x226041[_0xe630('0x1d')]+'.js'))){var _0x4516f2=[];switch(_0x226041[_0xe630('0x1d')][_0xe630('0x1e')]()){case'autoreply':var _0x426873=_0x226041[_0xe630('0x1f')][_0xe630('0x20')](',');if(_0x1587a7['channel']===_0xe630('0x21')){_0x4516f2[_0xe630('0x22')](_0x426873[0x0]);_0x4516f2[_0xe630('0x22')](_0x426873[0x1]);_0x4516f2[_0xe630('0x22')](_0x426873[_0xe630('0x23')](0x2,_0x426873[_0xe630('0x1a')])[_0xe630('0x1c')](','));}else{_0x4516f2['push'](_0x426873[0x0]);_0x4516f2[_0xe630('0x22')](_0x426873[_0xe630('0x23')](0x1,_0x426873['length'])[_0xe630('0x1c')](','));}break;case _0xe630('0x24'):var _0x2a80d6=_0x226041['appdata']['split'](',');_0x4516f2['push'](_0x2a80d6[0x0]);_0x4516f2['push'](_0x2a80d6[0x1]);_0x4516f2['push'](_0x2a80d6[_0xe630('0x23')](0x2,_0x2a80d6['length'])['join'](','));break;case _0xe630('0x25'):var _0x100b6f=_0x226041[_0xe630('0x1f')][_0xe630('0x20')](',');_0x4516f2[_0xe630('0x22')](_0x100b6f[0x0]);_0x4516f2[_0xe630('0x22')](_0x100b6f[0x1]);_0x4516f2[_0xe630('0x22')](_0x100b6f[0x2]);_0x4516f2['push'](_0x100b6f[0x3]);_0x4516f2[_0xe630('0x22')](_0x100b6f[_0xe630('0x23')](0x4,_0x100b6f['length'])['join'](','));break;case'amazonlex':var _0x338e23=_0x226041['appdata'][_0xe630('0x20')](',');_0x4516f2[_0xe630('0x22')](_0x338e23[0x0]);_0x4516f2[_0xe630('0x22')](_0x338e23[0x1]);_0x4516f2[_0xe630('0x22')](_0x338e23[0x2]);_0x4516f2[_0xe630('0x22')](_0x338e23[0x3]);_0x4516f2[_0xe630('0x22')](_0x338e23['slice'](0x4,_0x338e23[_0xe630('0x1a')])['join'](','));break;case'message':_0x4516f2[_0xe630('0x22')](_0x226041[_0xe630('0x1f')]);break;case _0xe630('0x26'):_0x4516f2[_0xe630('0x22')](_0x226041['TagId']);_0x4516f2[_0xe630('0x22')](_0x226041[_0xe630('0x1f')]);break;case _0xe630('0x27'):var _0x499e16=utils[_0xe630('0x28')](_0x1587a7[_0xe630('0x29')][_0xe630('0x2a')],_0x1587a7);var _0x4d2e92=_0x226041[_0xe630('0x1f')]['split'](',');_0x4516f2[_0xe630('0x22')](_0x4d2e92[0x0]);_0x4516f2[_0xe630('0x22')](_0x4d2e92[0x1]);_0x4516f2[_0xe630('0x22')](_0x4d2e92[0x2]);_0x4516f2[_0xe630('0x22')](_0x4d2e92[0x3]);_0x4516f2[_0xe630('0x22')](_0x4d2e92[0x4]);_0x4516f2[_0xe630('0x22')](_0x4d2e92[0x5]);_0x4516f2[_0xe630('0x22')](_0x4d2e92[0x6]);_0x4516f2[_0xe630('0x22')](_0x4d2e92[0x7]);_0x4516f2['push'](_0x4d2e92[0x8]);_0x4516f2[_0xe630('0x22')](_0x4d2e92[0x9]);_0x4516f2[_0xe630('0x22')](_0x4d2e92[0xa]);_0x4516f2['push'](_0x1587a7['interaction']['id']);_0x4516f2['push'](_0x1587a7['message']['id']);_0x4516f2[_0xe630('0x22')](_0x226041[_0xe630('0x2b')]);_0x4516f2[_0xe630('0x22')](_0x1587a7[_0xe630('0x17')][_0xe630('0x2c')]);_0x4516f2[_0xe630('0x22')](_0x1587a7[_0xe630('0x2d')][_0xe630('0x2d')]);_0x4516f2[_0xe630('0x22')](_0x499e16);break;default:_0x4516f2=_[_0xe630('0xe')](_0x226041[_0xe630('0x1f')])?[]:_0x226041[_0xe630('0x1f')][_0xe630('0x20')](',');}var _0x171cdc={'id':util[_0xe630('0xc')](_0xe630('0x2e'),_0x26a2b7,_0x226041['id'],_0x226041[_0xe630('0x1d')]),'condition':require(_0xe630('0x2f'))[_0xe630('0x30')](_0x26a2b7,getIntervals(_0xe92984['intervals'],_0x226041),_0xe92984),'consequence':require('./applications/'+_0x226041['app'])[_0xe630('0x31')](_0x26a2b7,_0x4516f2,_0xe92984,_0x1587a7),'p':_0x226041[_0xe630('0x32')]||0x0};logger[_0xe630('0x33')]('Push\x20new\x20rule',_0x171cdc['id'],_0xe630('0x34'),getIntervals(_0xe92984[_0xe630('0x35')],_0x226041)['join']('\x20|\x20'));_0x43b74a[_0xe630('0x22')](_0x171cdc);}else{logger['error'](_0xe630('0x36'),path[_0xe630('0x1c')](__dirname,_0xe630('0x18'),_0x226041['app']+_0xe630('0x37')));}}_0xe92984[_0xe630('0x14')][_0x26a2b7]=new RuleEngine(_0x43b74a);_0xe92984[_0xe630('0x14')][_0x26a2b7][_0xe630('0x38')](_0x1587a7,function(_0x4d13a5){logger[_0xe630('0x33')](_0xe630('0x39'),JSON['stringify'](_0x4d13a5[_0xe630('0x3a')]));if(_0xe92984[_0xe630('0x14')][_0x26a2b7]){_0xe92984[_0xe630('0x14')][_0x26a2b7][_0xe630('0x3b')]('complete');}});return _0x3916a5({'code':0xc8,'message':_0x1587a7});}else{logger[_0xe630('0x33')](_0xe630('0x3c'));return _0x3916a5({'code':0xc8,'message':_0x1587a7});}}catch(_0x4393a1){logger['error'](_0x4393a1[_0xe630('0x3d')]);return _0x6671d0(_0x3e89f7[_0xe630('0x3e')](0x1f4,_0x4393a1));}}return _0x6671d0(_0xe630('0x3f'));});},'AcceptMessage':function(_0x336096){var _0x5aebe2=this;return new Promise(function(_0x25d623,_0x5ebde4){if(_0x336096[_0xe630('0x40')]&&_0x336096['agent']['id']){if(_0xe92984[_0xe630('0x41')][_0x336096[_0xe630('0x40')]['id']]){_0xe92984[_0xe630('0x41')][_0x336096[_0xe630('0x40')]['id']][_0xe630('0x42')]=![];_0xe92984[_0xe630('0x41')][_0x336096['agent']['id']][_0xe630('0x43')]=undefined;}}if(_0x336096['message']&&_0x336096[_0xe630('0x16')]['id']){try{var _0x12c7c0=getId(_0x336096[_0xe630('0x15')],_0x336096[_0xe630('0x16')]?_0x336096[_0xe630('0x16')]['id']:0x0,_0x336096[_0xe630('0x17')]?_0x336096[_0xe630('0x17')]['id']:0x0);if(_0xe92984[_0xe630('0x14')][_0x12c7c0]){_0xe92984[_0xe630('0x14')][_0x12c7c0]['emit'](_0xe630('0x44'));if(rpc[_0x336096['channel']+_0xe630('0x45')]){rpc[_0x336096[_0xe630('0x15')]+_0xe630('0x45')][_0xe630('0x46')](_0x12c7c0,{'UserId':_0x336096['message'][_0xe630('0x47')]})['catch'](function(_0x558e3e){logger[_0xe630('0x3e')]('error\x20update\x20queue\x20report');});}}return _0x25d623({'code':0xc8,'message':_0x336096});}catch(_0x4c693b){logger[_0xe630('0x3e')](_0x4c693b[_0xe630('0x3d')]);return _0x5ebde4(_0x5aebe2['error'](0x1f4,_0x4c693b));}}logger[_0xe630('0x3e')]('message\x20is\x20empty');return _0x5ebde4(_0x5aebe2['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x4fb7dd){var _0x5c3a93=this;return new Promise(function(_0x301ffc,_0xf0f784){if(_0x4fb7dd['agent']&&_0x4fb7dd['agent']['id']){try{if(_0xe92984['agents'][_0x4fb7dd[_0xe630('0x40')]['id']]){_0xe92984['agents'][_0x4fb7dd[_0xe630('0x40')]['id']][_0xe630('0x42')]=![];_0xe92984[_0xe630('0x41')][_0x4fb7dd[_0xe630('0x40')]['id']]['busyQueue']=undefined;}return _0x301ffc({'code':0xc8,'message':_0x4fb7dd});}catch(_0x39ac0f){logger[_0xe630('0x3e')](_0x39ac0f[_0xe630('0x3d')]);return _0xf0f784(_0x5c3a93[_0xe630('0x3e')](0x1f4,_0x39ac0f));}}logger['error']('message\x20is\x20empty');return _0xf0f784(_0x5c3a93[_0xe630('0x3e')](0x1f4,_0xe630('0x48')));});},'AbandonInteraction':function(_0x4abde0){var _0x27e341=this;return new Promise(function(_0x448570,_0x1fdd03){if(_0x4abde0[_0xe630('0x15')]&&_0x4abde0['interaction']&&_0x4abde0[_0xe630('0x17')]['id']){try{var _0x118310=getId(_0x4abde0['channel'],_0x4abde0[_0xe630('0x16')]?_0x4abde0[_0xe630('0x16')]['id']:0x0,_0x4abde0[_0xe630('0x17')]?_0x4abde0[_0xe630('0x17')]['id']:0x0);if(_0xe92984['rules'][_0x118310]){_0xe92984[_0xe630('0x14')][_0x118310][_0xe630('0x3b')]('end');}return _0x448570({'code':0xc8,'message':_0x4abde0});}catch(_0x401d8d){logger[_0xe630('0x3e')](_0x401d8d[_0xe630('0x3d')]);return _0x1fdd03(_0x27e341[_0xe630('0x3e')](0x1f4,_0x401d8d));}}logger[_0xe630('0x3e')](_0xe630('0x48'));return _0x1fdd03(_0x27e341[_0xe630('0x3e')](0x1f4,_0xe630('0x48')));});},'AgentCapacity':function(_0x42092e){var _0x1edf6c=this;return new Promise(function(_0xf8c509,_0x1d2523){if(_0xe92984[_0xe630('0x41')][_0xe630('0x49')](_0x42092e['id'])){for(var _0x568acd in _0x42092e[_0xe630('0x4a')]){if(_0x42092e[_0xe630('0x4a')][_0xe630('0x49')](_0x568acd)){if(_0xe92984[_0xe630('0x41')][_0x42092e['id']]['hasOwnProperty'](_0x568acd+_0xe630('0x4b'))){_0xe92984[_0xe630('0x41')][_0x42092e['id']][_0x568acd+_0xe630('0x4b')]=parseInt(_0x42092e['capacity'][_0x568acd],0xa);}}}_0xe92984[_0xe630('0x41')][_0x42092e['id']][_0xe630('0x4c')]();return _0xf8c509({'code':0xc8,'message':_0xe92984[_0xe630('0x41')][_0x42092e['id']]});}else{return _0x1d2523(_0x1edf6c['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x1c58e0){return new Promise(function(_0x2796e8,_0x31d54c){var _0x54af1d=_[_0xe630('0x4d')](_0xe92984['agents']);_0x2796e8({'count':_0x54af1d[_0xe630('0x1a')],'rows':_0x54af1d});});},'ChatQueues':function(_0x3f36a1){return new Promise(function(_0x262700,_0x556f5d){var _0x2cacea=[];for(var _0x2d80be in _0xe92984[_0xe630('0x4e')]){if(_0xe92984[_0xe630('0x4e')][_0xe630('0x49')](_0x2d80be)){var _0x1898ee=_0xe92984[_0xe630('0x4e')][_0x2d80be];var _0x233d0a={'id':_0x1898ee['id'],'available':_0x1898ee[_0xe630('0x4f')],'loggedIn':_0x1898ee[_0xe630('0x50')],'name':_0x1898ee[_0xe630('0x51')],'paused':_0x1898ee[_0xe630('0x52')],'waiting':_0x1898ee[_0xe630('0x53')]};_0x2cacea['push'](_0x233d0a);}}_0x262700({'count':_0x2cacea[_0xe630('0x1a')],'rows':_0x2cacea});});},'MailQueues':function(_0x18310c){return new Promise(function(_0x40443c,_0x4e6fb1){var _0x4edeb4=[];for(var _0x5de483 in _0xe92984['mailQueues']){if(_0xe92984[_0xe630('0x54')][_0xe630('0x49')](_0x5de483)){var _0x53ada1=_0xe92984[_0xe630('0x54')][_0x5de483];var _0x382b50={'id':_0x53ada1['id'],'available':_0x53ada1[_0xe630('0x4f')],'loggedIn':_0x53ada1[_0xe630('0x50')],'name':_0x53ada1[_0xe630('0x51')],'paused':_0x53ada1[_0xe630('0x52')],'waiting':_0x53ada1[_0xe630('0x53')]};_0x4edeb4['push'](_0x382b50);}}_0x40443c({'count':_0x4edeb4[_0xe630('0x1a')],'rows':_0x4edeb4});});},'OpenchannelQueues':function(_0x2ebfa1){return new Promise(function(_0x58c66b,_0x57227c){var _0x1ef4c8=[];for(var _0x56a0d7 in _0xe92984[_0xe630('0x55')]){if(_0xe92984[_0xe630('0x55')][_0xe630('0x49')](_0x56a0d7)){var _0x296ecb=_0xe92984[_0xe630('0x55')][_0x56a0d7];var _0x143e48={'id':_0x296ecb['id'],'available':_0x296ecb[_0xe630('0x4f')],'loggedIn':_0x296ecb['loggedIn'],'name':_0x296ecb[_0xe630('0x51')],'paused':_0x296ecb['paused'],'waiting':_0x296ecb[_0xe630('0x53')]};_0x1ef4c8['push'](_0x143e48);}}_0x58c66b({'count':_0x1ef4c8[_0xe630('0x1a')],'rows':_0x1ef4c8});});},'SmsQueues':function(_0x33cd25){return new Promise(function(_0x2a4457,_0x407e4b){var _0xccd977=[];for(var _0x3ba2e2 in _0xe92984[_0xe630('0x56')]){if(_0xe92984[_0xe630('0x56')]['hasOwnProperty'](_0x3ba2e2)){var _0x2de90b=_0xe92984[_0xe630('0x56')][_0x3ba2e2];var _0x3d3461={'id':_0x2de90b['id'],'available':_0x2de90b[_0xe630('0x4f')],'loggedIn':_0x2de90b['loggedIn'],'name':_0x2de90b[_0xe630('0x51')],'paused':_0x2de90b[_0xe630('0x52')],'waiting':_0x2de90b[_0xe630('0x53')]};_0xccd977[_0xe630('0x22')](_0x3d3461);}}_0x2a4457({'count':_0xccd977[_0xe630('0x1a')],'rows':_0xccd977});});},'FaxQueues':function(_0x187c3a){return new Promise(function(_0x1377ad,_0x4962fa){var _0x18e00d=[];for(var _0x14cfc4 in _0xe92984[_0xe630('0x57')]){if(_0xe92984[_0xe630('0x57')][_0xe630('0x49')](_0x14cfc4)){var _0x2f20f4=_0xe92984[_0xe630('0x57')][_0x14cfc4];var _0x2957ad={'id':_0x2f20f4['id'],'available':_0x2f20f4['available'],'loggedIn':_0x2f20f4['loggedIn'],'name':_0x2f20f4['name'],'paused':_0x2f20f4[_0xe630('0x52')],'waiting':_0x2f20f4[_0xe630('0x53')]};_0x18e00d[_0xe630('0x22')](_0x2957ad);}}_0x1377ad({'count':_0x18e00d['length'],'rows':_0x18e00d});});},'WhatsappQueues':function(_0x14c076){return new Promise(function(_0x44bc1b,_0x39325){var _0x1e80b4=[];for(var _0x45530b in _0xe92984['whatsappQueues']){if(_0xe92984['whatsappQueues']['hasOwnProperty'](_0x45530b)){var _0x3f79c3=_0xe92984[_0xe630('0x58')][_0x45530b];var _0x4cb6d4={'id':_0x3f79c3['id'],'available':_0x3f79c3['available'],'loggedIn':_0x3f79c3[_0xe630('0x50')],'name':_0x3f79c3[_0xe630('0x51')],'paused':_0x3f79c3[_0xe630('0x52')],'waiting':_0x3f79c3[_0xe630('0x53')]};_0x1e80b4[_0xe630('0x22')](_0x4cb6d4);}}_0x44bc1b({'count':_0x1e80b4[_0xe630('0x1a')],'rows':_0x1e80b4});});},'ChatQueuesWaitingInteractions':function(_0x3fe2f9){return new Promise(function(_0x1e3aad,_0x4114fc){var _0x4be34f=_[_0xe630('0x4d')](_0xe92984[_0xe630('0x59')]);_0x1e3aad({'count':_0x4be34f[_0xe630('0x1a')],'rows':_0x4be34f});});},'MailQueuesWaitingInteractions':function(_0x11ae60){return new Promise(function(_0x4516bc,_0x56eff5){var _0x5a1fe1=_[_0xe630('0x4d')](_0xe92984[_0xe630('0x5a')]);_0x4516bc({'count':_0x5a1fe1[_0xe630('0x1a')],'rows':_0x5a1fe1});});},'OpenchannelQueuesWaitingInteractions':function(_0x3a724d){return new Promise(function(_0x4ba853,_0x1a3b0e){var _0x1fe41f=_[_0xe630('0x4d')](_0xe92984[_0xe630('0x5b')]);_0x4ba853({'count':_0x1fe41f[_0xe630('0x1a')],'rows':_0x1fe41f});});},'SmsQueuesWaitingInteractions':function(_0x388e01){return new Promise(function(_0x32c6fd,_0x4de931){var _0xf9eb7f=_[_0xe630('0x4d')](_0xe92984[_0xe630('0x5c')]);_0x32c6fd({'count':_0xf9eb7f[_0xe630('0x1a')],'rows':_0xf9eb7f});});},'FaxQueuesWaitingInteractions':function(_0x4f2ad7){return new Promise(function(_0x62f002,_0x4a2578){var _0x6fc3a3=_['values'](_0xe92984[_0xe630('0x5d')]);_0x62f002({'count':_0x6fc3a3['length'],'rows':_0x6fc3a3});});},'WhatsappQueuesWaitingInteractions':function(_0x4ffdaa){return new Promise(function(_0x561a43,_0x27d9d7){var _0x5e7b4c=_[_0xe630('0x4d')](_0xe92984['whatsappQueuesWaitingInteractions']);_0x561a43({'count':_0x5e7b4c[_0xe630('0x1a')],'rows':_0x5e7b4c});});}};var _0x3a6818=jayson[_0xe630('0x5e')](_0x1d8b1c)[_0xe630('0x5f')]();_0x3a6818['on']('error',function(_0x456d31){logger[_0xe630('0x3e')](JSON[_0xe630('0x60')](_0x456d31));return _0x4f48d0(_0x456d31);});_0x3a6818[_0xe630('0x13')](0x232c,_0xe630('0x61'),function(){console[_0xe630('0x62')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x2e314e(_0xe630('0x63')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index b40231e..267660b 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 _0xdf14=['iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','log','\x20|\x20','util','bluebird','../../../config/logger','routing','client','request','then','error','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command'];(function(_0x41e532,_0x892c41){var _0x4b830d=function(_0x5c9f13){while(--_0x5c9f13){_0x41e532['push'](_0x41e532['shift']());}};_0x4b830d(++_0x892c41);}(_0xdf14,0x97));var _0x4df1=function(_0x42a3d6,_0x3bf544){_0x42a3d6=_0x42a3d6-0x0;var _0x4333e0=_0xdf14[_0x42a3d6];return _0x4333e0;};'use strict';var util=require(_0x4df1('0x0'));var BPromise=require(_0x4df1('0x1'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x4df1('0x2'))(_0x4df1('0x3'));var client=jayson[_0x4df1('0x4')]['http']({'port':0x232a});function request(_0x358c9e,_0x47eaf6){return new BPromise(function(_0x2198e3,_0x4cd6fb){return client[_0x4df1('0x5')](_0x358c9e,_0x47eaf6)[_0x4df1('0x6')](function(_0x1e52b4){if(_0x1e52b4[_0x4df1('0x7')]){return _0x4cd6fb(_0x1e52b4[_0x4df1('0x7')][_0x4df1('0x8')]);}else{return _0x2198e3(_0x1e52b4[_0x4df1('0x9')]);}})[_0x4df1('0xa')](function(_0x32f533){return _0x4cd6fb(_0x32f533);});});}exports[_0x4df1('0xb')]=function(_0x3ac2d1,_0x1a82ec,_0x19e725){return function(_0x5a1006){if(_0x19e725[_0x4df1('0xc')]&&!_0x19e725[_0x4df1('0xc')][_0x3ac2d1]){logger['info'](_0x4df1('0xd'),_0x3ac2d1);return _0x5a1006[_0x4df1('0xe')]();}var _0xeef763=[];for(var _0x2b6836=0x0;_0x2b6836<_0x1a82ec['length'];_0x2b6836+=0x1){_0xeef763[_0x4df1('0xf')](request(_0x4df1('0x10'),{'command':util['format'](_0x4df1('0x11'),_0x1a82ec[_0x2b6836])})[_0x4df1('0x6')](function(_0x2658f1){return _0x2658f1&&_0x2658f1[_0x4df1('0x8')]&&_0x2658f1[_0x4df1('0x8')][_0x4df1('0x12')](_0x4df1('0x13'))>=0x0?!![]:![];})[_0x4df1('0xa')](function(_0x355794){logger[_0x4df1('0x7')](_0x4df1('0x14'),_0x3ac2d1,_0x1a82ec[_0x2b6836]);}));}BPromise[_0x4df1('0x15')](_0xeef763)[_0x4df1('0x6')](function(_0x41230c){var _0x4863e0=_[_0x4df1('0x16')](_0x41230c);logger[_0x4df1('0x17')](_0x4df1('0x18'),_0x3ac2d1,_0x1a82ec[_0x4df1('0x19')]('\x20|\x20'),_0x4863e0);_0x5a1006['when'](_0x4863e0);})[_0x4df1('0xa')](function(_0x1b4b3f){console[_0x4df1('0x1a')](_0x1b4b3f);logger['error'](_0x4df1('0x18'),_0x3ac2d1,_0x1a82ec[_0x4df1('0x19')](_0x4df1('0x1b')),_0x1b4b3f['stack']);_0x5a1006[_0x4df1('0xe')]();});};}; \ No newline at end of file +var _0x6f29=['then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','join','\x20|\x20','when','[%s][INTERVAL]\x20%s\x20%s','bluebird','jayson/promise','../../../config/logger','routing','http','request'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x6f29,0xae));var _0x96f2=function(_0x2375e1,_0x3d125a){_0x2375e1=_0x2375e1-0x0;var _0x2ccc7d=_0x6f29[_0x2375e1];return _0x2ccc7d;};'use strict';var util=require('util');var BPromise=require(_0x96f2('0x0'));var jayson=require(_0x96f2('0x1'));var _=require('lodash');var logger=require(_0x96f2('0x2'))(_0x96f2('0x3'));var client=jayson['client'][_0x96f2('0x4')]({'port':0x232a});function request(_0xab817a,_0x392798){return new BPromise(function(_0x3aad39,_0x362475){return client[_0x96f2('0x5')](_0xab817a,_0x392798)[_0x96f2('0x6')](function(_0x4170bf){if(_0x4170bf['error']){return _0x362475(_0x4170bf[_0x96f2('0x7')][_0x96f2('0x8')]);}else{return _0x3aad39(_0x4170bf[_0x96f2('0x9')]);}})[_0x96f2('0xa')](function(_0x55d481){return _0x362475(_0x55d481);});});}exports[_0x96f2('0xb')]=function(_0x37915a,_0x1ef82f,_0x11794d){return function(_0x493d4d){if(_0x11794d[_0x96f2('0xc')]&&!_0x11794d[_0x96f2('0xc')][_0x37915a]){logger[_0x96f2('0xd')](_0x96f2('0xe'),_0x37915a);return _0x493d4d[_0x96f2('0xf')]();}var _0x33d05f=[];for(var _0x1699fb=0x0;_0x1699fb<_0x1ef82f[_0x96f2('0x10')];_0x1699fb+=0x1){_0x33d05f[_0x96f2('0x11')](request(_0x96f2('0x12'),{'command':util[_0x96f2('0x13')](_0x96f2('0x14'),_0x1ef82f[_0x1699fb])})[_0x96f2('0x6')](function(_0xf89b3){return _0xf89b3&&_0xf89b3[_0x96f2('0x8')]&&_0xf89b3[_0x96f2('0x8')][_0x96f2('0x15')](_0x96f2('0x16'))>=0x0?!![]:![];})[_0x96f2('0xa')](function(_0x4407f0){logger[_0x96f2('0x7')](_0x96f2('0x17'),_0x37915a,_0x1ef82f[_0x1699fb]);}));}BPromise[_0x96f2('0x18')](_0x33d05f)['then'](function(_0x2116cf){var _0x5530d3=_[_0x96f2('0x19')](_0x2116cf);logger[_0x96f2('0xd')]('[%s][INTERVAL]\x20%s\x20%s',_0x37915a,_0x1ef82f[_0x96f2('0x1a')](_0x96f2('0x1b')),_0x5530d3);_0x493d4d[_0x96f2('0x1c')](_0x5530d3);})[_0x96f2('0xa')](function(_0x4dd20e){console['log'](_0x4dd20e);logger['error'](_0x96f2('0x1d'),_0x37915a,_0x1ef82f[_0x96f2('0x1a')](_0x96f2('0x1b')),_0x4dd20e['stack']);_0x493d4d[_0x96f2('0xf')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index f0841cb..69616c7 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 _0x3f8c=['[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','[%s][agents][hangup]','./utils','info','membername','interface','calleridnum','connectedlinenum','lastevent','queue','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','debug','format','[%s][agents][agentcalled]','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','error','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','isNil','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','cause','rejected','indexOf','splice','agent'];(function(_0x52ee2a,_0x5b8415){var _0x1ba6d3=function(_0x109e02){while(--_0x109e02){_0x52ee2a['push'](_0x52ee2a['shift']());}};_0x1ba6d3(++_0x5b8415);}(_0x3f8c,0x104));var _0xc3f8=function(_0x390487,_0x1ee9b5){_0x390487=_0x390487-0x0;var _0x3f44bb=_0x3f8c[_0x390487];return _0x3f44bb;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xc3f8('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3a1f6a,_0x2e70c4){utils[_0xc3f8('0x1')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3a1f6a['uniqueid'],_0x3a1f6a['channel'],_0x3a1f6a['queue'],_0x3a1f6a[_0xc3f8('0x2')],_0x3a1f6a[_0xc3f8('0x3')],_0x3a1f6a[_0xc3f8('0x4')],_0x3a1f6a[_0xc3f8('0x5')],_0x3a1f6a[_0xc3f8('0x6')]));if(_0x3a1f6a[_0xc3f8('0x7')]){utils['getVoiceQueueByName'](_0x3a1f6a[_0xc3f8('0x7')])[_0xc3f8('0x8')](function(_0x15cb3b){if(_0x15cb3b){_0x3a1f6a[_0xc3f8('0x9')]=_0x15cb3b[_0xc3f8('0x9')];_0x3a1f6a[_0xc3f8('0xa')]=_0x3a1f6a[_0xc3f8('0xb')]?_0x15cb3b['acw']:![];_0x3a1f6a[_0xc3f8('0xc')]=_0x3a1f6a[_0xc3f8('0xa')]?_0x15cb3b[_0xc3f8('0xd')]:0x0;}utils[_0xc3f8('0xe')]('CreateVoiceAgentReport',_0x3a1f6a);});}else{utils[_0xc3f8('0xe')](_0xc3f8('0xf'),_0x3a1f6a);}if(_0x2e70c4){delete transfers[_0x3a1f6a[_0xc3f8('0x10')]];}else{delete agents[_0x3a1f6a[_0xc3f8('0x11')]];}}exports['agentcalled']=function(_0x84f489){try{utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x14'),_0x84f489[_0xc3f8('0x10')]),_0x84f489);agents[_0x84f489[_0xc3f8('0x11')]]=_0x84f489;agents[_0x84f489[_0xc3f8('0x11')]][_0xc3f8('0x15')]=utils[_0xc3f8('0x16')]();agents[_0x84f489[_0xc3f8('0x11')]][_0xc3f8('0x6')]=_0xc3f8('0x17');agents[_0x84f489[_0xc3f8('0x11')]]['connectedlinenum']=null;agents[_0x84f489[_0xc3f8('0x11')]]['connectedlinename']=null;utils['info'](util[_0xc3f8('0x13')](_0xc3f8('0x18'),_0x84f489[_0xc3f8('0x10')],agents[_0x84f489[_0xc3f8('0x11')]]['membername'],_0x84f489[_0xc3f8('0x11')]));}catch(_0x1db809){utils['error'](util[_0xc3f8('0x13')]('[%s][agents][agentcalled]',_0x84f489[_0xc3f8('0x10')]),_0x1db809);}};exports[_0xc3f8('0x19')]=function(_0x3b2e98){try{if(!_['isNil'](agents[_0x3b2e98['destuniqueid']])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x1a'),_0x3b2e98[_0xc3f8('0x10')]),_0x3b2e98);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x1b'),_0x3b2e98[_0xc3f8('0x10')],agents[_0x3b2e98['destuniqueid']]['membername'],_0x3b2e98['destuniqueid']));agents[_0x3b2e98[_0xc3f8('0x11')]]['agentringnoanswer']=!![];agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1c')]=utils['now']();agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x6')]=_0xc3f8('0x1d');agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1e')]=_0xc3f8('0x1d');agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1f')]=_0x3b2e98[_0xc3f8('0x20')]?parseInt(_0x3b2e98[_0xc3f8('0x20')])/0x3e8:0x0;agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x21')]=0x0;unanswered[_0xc3f8('0x22')](_0x3b2e98[_0xc3f8('0x11')]);}}catch(_0x59e4dd){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x1a'),_0x3b2e98['uniqueid']),_0x59e4dd);}};exports[_0xc3f8('0x24')]=function(_0x4d39a0){try{_[_0xc3f8('0x25')](agents,function(_0x32343e,_0x47ab53){if(_0x32343e['uniqueid']==_0x4d39a0[_0xc3f8('0x10')]&&!_[_0xc3f8('0x26')](unanswered,_0x32343e[_0xc3f8('0x11')])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x27'),_0x4d39a0[_0xc3f8('0x10')]),_0x4d39a0);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x28'),_0x4d39a0['uniqueid'],_0x32343e[_0xc3f8('0x2')],_0x32343e[_0xc3f8('0x11')]));_0x32343e[_0xc3f8('0x19')]=!![];_0x32343e[_0xc3f8('0x1c')]=utils[_0xc3f8('0x16')]();_0x32343e['lastevent']='abandoned';_0x32343e[_0xc3f8('0x1e')]=_0xc3f8('0x29');_0x32343e[_0xc3f8('0x1f')]=_0x4d39a0[_0xc3f8('0x1f')];_0x32343e[_0xc3f8('0x21')]=0x0;writeDB(_0x32343e);}});}catch(_0x4e51ac){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x27'),_0x4d39a0['uniqueid']),_0x4e51ac);}};exports[_0xc3f8('0x2a')]=function(_0x11ecc2){try{if(agents[_0x11ecc2[_0xc3f8('0x11')]]){utils['debug'](util[_0xc3f8('0x13')](_0xc3f8('0x2b'),_0x11ecc2['uniqueid']),_0x11ecc2);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x2c'),_0x11ecc2[_0xc3f8('0x10')],agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2')],_0x11ecc2['destuniqueid']));agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2d')]=utils[_0xc3f8('0x16')]();agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x5')]=_0x11ecc2['connectedlinenum'];agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2e')]=_0x11ecc2[_0xc3f8('0x2e')];agents[_0x11ecc2['destuniqueid']][_0xc3f8('0x1f')]=_0x11ecc2[_0xc3f8('0x20')];agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x6')]='connect';_[_0xc3f8('0x25')](agents,function(_0x45d416,_0x2df096){if(_0x45d416[_0xc3f8('0x11')]!=_0x11ecc2['destuniqueid']&&_0x45d416[_0xc3f8('0x10')]==_0x11ecc2['uniqueid']){_0x45d416['talktime']=0x0;_0x45d416[_0xc3f8('0x1f')]=_0x11ecc2[_0xc3f8('0x20')];_0x45d416[_0xc3f8('0x19')]=!![];_0x45d416[_0xc3f8('0x1c')]=utils['now']();_0x45d416['lastevent']=_0xc3f8('0x2f');_0x45d416[_0xc3f8('0x1e')]=_0xc3f8('0x2f');_0x45d416[_0xc3f8('0x30')]=_0x11ecc2[_0xc3f8('0x11')];_0x45d416[_0xc3f8('0x31')]=_0x11ecc2[_0xc3f8('0x2')];writeDB(_0x45d416);}});}}catch(_0x45e6ea){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x2b'),_0x11ecc2['uniqueid']),_0x45e6ea);}};exports[_0xc3f8('0xb')]=function(_0x22e9b3){try{if(!_['isNil'](agents[_0x22e9b3[_0xc3f8('0x11')]])){utils[_0xc3f8('0x12')](util['format'](_0xc3f8('0x32'),_0x22e9b3[_0xc3f8('0x10')]),_0x22e9b3);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x33'),_0x22e9b3[_0xc3f8('0x10')],agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x2')],_0x22e9b3[_0xc3f8('0x11')]));agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0xb')]=!![];agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x34')]=utils[_0xc3f8('0x16')]();agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x21')]=utils[_0xc3f8('0x35')](agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x34')],agents[_0x22e9b3['destuniqueid']]['agentconnectAt']);agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x1e')]=_0x22e9b3[_0xc3f8('0x1e')];agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x6')]=_0xc3f8('0x36');writeDB(agents[_0x22e9b3[_0xc3f8('0x11')]]);}}catch(_0xe3d5c4){utils[_0xc3f8('0x23')](util['format'](_0xc3f8('0x32'),_0x22e9b3[_0xc3f8('0x10')]),_0xe3d5c4);}};exports['blindtransfer']=function(_0x1becae){try{if(!_[_0xc3f8('0x37')](agents[_0x1becae[_0xc3f8('0x38')]])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x39'),_0x1becae[_0xc3f8('0x10')]),_0x1becae);utils['info'](util[_0xc3f8('0x13')](_0xc3f8('0x3a'),_0x1becae['uniqueid'],agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x2')],agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x10')]));agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3b')]=!![];agents[_0x1becae[_0xc3f8('0x38')]]['transfertype']=_0xc3f8('0x3c');agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3d')]=_0x1becae[_0xc3f8('0x3e')];agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3f')]=agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x10')];}}catch(_0x4fc02c){utils['error'](util[_0xc3f8('0x13')](_0xc3f8('0x39'),_0x1becae['uniqueid']),_0x4fc02c);}};exports['attendedtransfer']=function(_0x773d56){try{utils['debug'](util[_0xc3f8('0x13')](_0xc3f8('0x40'),_0x773d56[_0xc3f8('0x41')]),_0x773d56);if(_0x773d56['origtransfereruniqueid']==_0x773d56[_0xc3f8('0x42')]){if(!_['isNil'](agents[_0x773d56['secondtransfereruniqueid']])){utils[_0xc3f8('0x1')](util['format'](_0xc3f8('0x43'),_0x773d56[_0xc3f8('0x41')],agents[_0x773d56[_0xc3f8('0x44')]]['membername']));agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x3b')]=!![];agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x45')]=_0xc3f8('0x46');agents[_0x773d56['secondtransfereruniqueid']]['transferexten']=_0x773d56[_0xc3f8('0x47')];agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x3f')]=_0x773d56[_0xc3f8('0x41')];}if(_0x773d56[_0xc3f8('0x48')]&&agents[_0x773d56['transfereeuniqueid']]){agents[_0x773d56[_0xc3f8('0x48')]]['agententerreason']=0x1;transfers[_0x773d56[_0xc3f8('0x48')]]=_[_0xc3f8('0x49')](agents[_0x773d56[_0xc3f8('0x48')]]);transfers[_0x773d56[_0xc3f8('0x48')]]['calleridnum']=agents[_0x773d56[_0xc3f8('0x44')]]['calleridnum'];transfers[_0x773d56['transfereeuniqueid']]['calleridname']=agents[_0x773d56['secondtransfereruniqueid']][_0xc3f8('0x4a')];transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x15')]=utils[_0xc3f8('0x16')]();transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x2d')]=utils[_0xc3f8('0x16')]();transfers[_0x773d56[_0xc3f8('0x48')]]['holdtime']=0x0;transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x4b')]=0x2;}}else if(_0x773d56[_0xc3f8('0x44')]==_0x773d56[_0xc3f8('0x4c')]){if(!_[_0xc3f8('0x37')](agents[_0x773d56['origtransfereruniqueid']])){utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x43'),_0x773d56[_0xc3f8('0x41')],agents[_0x773d56[_0xc3f8('0x41')]]['membername']));agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x3b')]=!![];agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x45')]=_0xc3f8('0x46');agents[_0x773d56[_0xc3f8('0x41')]]['transferexten']=_0x773d56[_0xc3f8('0x4d')];agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x3f')]=_0x773d56['secondtransfereruniqueid'];}if(_0x773d56[_0xc3f8('0x4e')]&&agents[_0x773d56[_0xc3f8('0x4e')]]){agents[_0x773d56['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x773d56[_0xc3f8('0x4e')]]=_[_0xc3f8('0x49')](agents[_0x773d56['transfertargetuniqueid']]);transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4')]=agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x4')];transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4a')]=agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x4a')];transfers[_0x773d56['transfertargetuniqueid']]['agentcalledAt']=utils[_0xc3f8('0x16')]();transfers[_0x773d56['transfertargetuniqueid']]['agentconnectAt']=utils['now']();transfers[_0x773d56['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4b')]=0x2;}}}catch(_0x188d39){utils[_0xc3f8('0x23')](util['format'](_0xc3f8('0x40'),_0x773d56[_0xc3f8('0x41')]),_0x188d39);}};exports['hangup']=function(_0x3b9b47){try{utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')]('[%s][agents][hangup]',_0x3b9b47[_0xc3f8('0x10')]),_0x3b9b47);if(agents[_0x3b9b47['uniqueid']]&&agents[_0x3b9b47['uniqueid']]['reason']===_0xc3f8('0x1d')){if(_0x3b9b47[_0xc3f8('0x4f')]==='21'){agents[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')]=_0xc3f8('0x50');agents[_0x3b9b47['uniqueid']][_0xc3f8('0x6')]=_0xc3f8('0x50');}utils['info'](util[_0xc3f8('0x13')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3b9b47[_0xc3f8('0x10')],agents[_0x3b9b47[_0xc3f8('0x10')]]['membername'],agents[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')],agents[_0x3b9b47[_0xc3f8('0x10')]]['lastevent']));writeDB(agents[_0x3b9b47[_0xc3f8('0x10')]]);var _0x5de19e=unanswered[_0xc3f8('0x51')](_0x3b9b47['uniqueid']);if(_0x5de19e>-0x1){unanswered[_0xc3f8('0x52')](_0x5de19e,0x1);}}if(transfers[_0x3b9b47[_0xc3f8('0x10')]]){transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0xb')]=!![];transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')]=utils[_0xc3f8('0x16')]();transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x21')]=utils['diffTime'](transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')],transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x2d')]);transfers[_0x3b9b47[_0xc3f8('0x10')]]['reason']=_0xc3f8('0x53');transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]=_0xc3f8('0x36');utils[_0xc3f8('0x1')](util['format'](_0xc3f8('0x54'),_0x3b9b47[_0xc3f8('0x10')],transfers[_0x3b9b47[_0xc3f8('0x10')]]['membername'],transfers[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')],transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]));writeDB(transfers[_0x3b9b47[_0xc3f8('0x10')]],!![]);}if(agents[_0x3b9b47['uniqueid']]&&agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x2d')]){agents[_0x3b9b47[_0xc3f8('0x10')]]['agentcomplete']=!![];agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')]=utils['now']();agents[_0x3b9b47['uniqueid']][_0xc3f8('0x21')]=utils[_0xc3f8('0x35')](agents[_0x3b9b47['uniqueid']][_0xc3f8('0x34')],agents[_0x3b9b47[_0xc3f8('0x10')]]['agentconnectAt']);agents[_0x3b9b47[_0xc3f8('0x10')]]['reason']=agents[_0x3b9b47[_0xc3f8('0x10')]]['transfer']?_0xc3f8('0x3b'):_0xc3f8('0x53');agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]=_0xc3f8('0x36');utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x54'),_0x3b9b47[_0xc3f8('0x10')],agents[_0x3b9b47['uniqueid']]['membername'],agents[_0x3b9b47[_0xc3f8('0x10')]]['reason'],agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]));writeDB(agents[_0x3b9b47[_0xc3f8('0x10')]]);}}catch(_0xfb05eb){utils['error'](util[_0xc3f8('0x13')](_0xc3f8('0x55'),_0x3b9b47[_0xc3f8('0x10')]),_0xfb05eb);}}; \ No newline at end of file +var _0x0bb5=['called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','agentringnoanswer','agentringnoanswerAt','now','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','timeout','cause','rejected','indexOf','splice','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt'];(function(_0x1196bd,_0xba4aea){var _0x26014f=function(_0x542a3d){while(--_0x542a3d){_0x1196bd['push'](_0x1196bd['shift']());}};_0x26014f(++_0xba4aea);}(_0x0bb5,0x148));var _0x50bb=function(_0x12b7f3,_0x59c581){_0x12b7f3=_0x12b7f3-0x0;var _0x113ec7=_0x0bb5[_0x12b7f3];return _0x113ec7;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5a12b6,_0x348380){utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x4'),_0x5a12b6[_0x50bb('0x5')],_0x5a12b6[_0x50bb('0x6')],_0x5a12b6[_0x50bb('0x7')],_0x5a12b6[_0x50bb('0x8')],_0x5a12b6['interface'],_0x5a12b6['calleridnum'],_0x5a12b6[_0x50bb('0x9')],_0x5a12b6[_0x50bb('0xa')]));if(_0x5a12b6[_0x50bb('0x7')]){utils[_0x50bb('0xb')](_0x5a12b6['queue'])['then'](function(_0x2bede8){if(_0x2bede8){_0x5a12b6[_0x50bb('0xc')]=_0x2bede8[_0x50bb('0xc')];_0x5a12b6[_0x50bb('0xd')]=_0x5a12b6['agentcomplete']?_0x2bede8[_0x50bb('0xe')]:![];_0x5a12b6[_0x50bb('0xf')]=_0x5a12b6[_0x50bb('0xd')]?_0x2bede8[_0x50bb('0x10')]:0x0;}utils[_0x50bb('0x11')](_0x50bb('0x12'),_0x5a12b6);});}else{utils[_0x50bb('0x11')]('CreateVoiceAgentReport',_0x5a12b6);}if(_0x348380){delete transfers[_0x5a12b6[_0x50bb('0x5')]];}else{delete agents[_0x5a12b6['destuniqueid']];}}exports[_0x50bb('0x13')]=function(_0xd8ab27){try{utils[_0x50bb('0x14')](util['format'](_0x50bb('0x15'),_0xd8ab27[_0x50bb('0x5')]),_0xd8ab27);agents[_0xd8ab27[_0x50bb('0x16')]]=_0xd8ab27;agents[_0xd8ab27['destuniqueid']][_0x50bb('0x17')]=utils['now']();agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0xa')]=_0x50bb('0x18');agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0x9')]=null;agents[_0xd8ab27['destuniqueid']][_0x50bb('0x19')]=null;utils[_0x50bb('0x2')](util['format'](_0x50bb('0x1a'),_0xd8ab27['uniqueid'],agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0x8')],_0xd8ab27['destuniqueid']));}catch(_0x4f1c0a){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x15'),_0xd8ab27[_0x50bb('0x5')]),_0x4f1c0a);}};exports['agentringnoanswer']=function(_0x19dc5d){try{if(!_[_0x50bb('0x1c')](agents[_0x19dc5d[_0x50bb('0x16')]])){utils['debug'](util[_0x50bb('0x3')](_0x50bb('0x1d'),_0x19dc5d[_0x50bb('0x5')]),_0x19dc5d);utils['info'](util[_0x50bb('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x19dc5d[_0x50bb('0x5')],agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x8')],_0x19dc5d[_0x50bb('0x16')]));agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x1e')]=!![];agents[_0x19dc5d['destuniqueid']][_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0xa')]='timeout';agents[_0x19dc5d[_0x50bb('0x16')]]['reason']='timeout';agents[_0x19dc5d[_0x50bb('0x16')]]['holdtime']=_0x19dc5d['ringtime']?parseInt(_0x19dc5d[_0x50bb('0x21')])/0x3e8:0x0;agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x22')]=0x0;unanswered[_0x50bb('0x23')](_0x19dc5d[_0x50bb('0x16')]);}}catch(_0x269479){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')]('[%s][agents][agentringnoanswer]',_0x19dc5d[_0x50bb('0x5')]),_0x269479);}};exports[_0x50bb('0x24')]=function(_0x15ee2e){try{_[_0x50bb('0x25')](agents,function(_0x560b07,_0x13dc3c){if(_0x560b07[_0x50bb('0x5')]==_0x15ee2e[_0x50bb('0x5')]&&!_[_0x50bb('0x26')](unanswered,_0x560b07[_0x50bb('0x16')])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x27'),_0x15ee2e[_0x50bb('0x5')]),_0x15ee2e);utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x28'),_0x15ee2e['uniqueid'],_0x560b07[_0x50bb('0x8')],_0x560b07[_0x50bb('0x16')]));_0x560b07[_0x50bb('0x1e')]=!![];_0x560b07[_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();_0x560b07[_0x50bb('0xa')]=_0x50bb('0x29');_0x560b07[_0x50bb('0x2a')]=_0x50bb('0x29');_0x560b07[_0x50bb('0x2b')]=_0x15ee2e[_0x50bb('0x2b')];_0x560b07['talktime']=0x0;writeDB(_0x560b07);}});}catch(_0x364ea0){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x27'),_0x15ee2e[_0x50bb('0x5')]),_0x364ea0);}};exports[_0x50bb('0x2c')]=function(_0x53600a){try{if(agents[_0x53600a['destuniqueid']]){utils[_0x50bb('0x14')](util['format'](_0x50bb('0x2d'),_0x53600a[_0x50bb('0x5')]),_0x53600a);utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x2e'),_0x53600a['uniqueid'],agents[_0x53600a[_0x50bb('0x16')]]['membername'],_0x53600a[_0x50bb('0x16')]));agents[_0x53600a[_0x50bb('0x16')]][_0x50bb('0x2f')]=utils['now']();agents[_0x53600a['destuniqueid']][_0x50bb('0x9')]=_0x53600a[_0x50bb('0x9')];agents[_0x53600a[_0x50bb('0x16')]][_0x50bb('0x19')]=_0x53600a['connectedlinename'];agents[_0x53600a[_0x50bb('0x16')]]['holdtime']=_0x53600a['ringtime'];agents[_0x53600a[_0x50bb('0x16')]]['lastevent']=_0x50bb('0x30');_[_0x50bb('0x25')](agents,function(_0x1ef231,_0x1f156e){if(_0x1ef231[_0x50bb('0x16')]!=_0x53600a[_0x50bb('0x16')]&&_0x1ef231[_0x50bb('0x5')]==_0x53600a[_0x50bb('0x5')]){_0x1ef231[_0x50bb('0x22')]=0x0;_0x1ef231[_0x50bb('0x2b')]=_0x53600a['ringtime'];_0x1ef231['agentringnoanswer']=!![];_0x1ef231[_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();_0x1ef231[_0x50bb('0xa')]=_0x50bb('0x31');_0x1ef231['reason']=_0x50bb('0x31');_0x1ef231['answeredelsewheredestinationuniqueid']=_0x53600a[_0x50bb('0x16')];_0x1ef231[_0x50bb('0x32')]=_0x53600a[_0x50bb('0x8')];writeDB(_0x1ef231);}});}}catch(_0x40748d){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x2d'),_0x53600a[_0x50bb('0x5')]),_0x40748d);}};exports[_0x50bb('0x33')]=function(_0x46c1c3){try{if(!_[_0x50bb('0x1c')](agents[_0x46c1c3[_0x50bb('0x16')]])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x34'),_0x46c1c3[_0x50bb('0x5')]),_0x46c1c3);utils['info'](util[_0x50bb('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x46c1c3[_0x50bb('0x5')],agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x8')],_0x46c1c3[_0x50bb('0x16')]));agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x33')]=!![];agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x35')]=utils[_0x50bb('0x20')]();agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x22')]=utils[_0x50bb('0x36')](agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x35')],agents[_0x46c1c3['destuniqueid']][_0x50bb('0x2f')]);agents[_0x46c1c3['destuniqueid']][_0x50bb('0x2a')]=_0x46c1c3[_0x50bb('0x2a')];agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0xa')]=_0x50bb('0x37');writeDB(agents[_0x46c1c3[_0x50bb('0x16')]]);}}catch(_0x133dd9){utils[_0x50bb('0x1b')](util['format'](_0x50bb('0x34'),_0x46c1c3[_0x50bb('0x5')]),_0x133dd9);}};exports[_0x50bb('0x38')]=function(_0x13afe2){try{if(!_[_0x50bb('0x1c')](agents[_0x13afe2['transfereruniqueid']])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x39'),_0x13afe2[_0x50bb('0x5')]),_0x13afe2);utils[_0x50bb('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x13afe2[_0x50bb('0x5')],agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x8')],agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x5')]));agents[_0x13afe2[_0x50bb('0x3a')]][_0x50bb('0x3b')]=!![];agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x3c')]=_0x50bb('0x3d');agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x3e')]=_0x13afe2[_0x50bb('0x3f')];agents[_0x13afe2[_0x50bb('0x3a')]][_0x50bb('0x40')]=agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x5')];}}catch(_0x46b51e){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x39'),_0x13afe2['uniqueid']),_0x46b51e);}};exports[_0x50bb('0x41')]=function(_0x50943a){try{utils[_0x50bb('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x50943a[_0x50bb('0x42')]),_0x50943a);if(_0x50943a['origtransfereruniqueid']==_0x50943a['origtransfererlinkedid']){if(!_[_0x50bb('0x1c')](agents[_0x50943a[_0x50bb('0x43')]])){utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x44'),_0x50943a[_0x50bb('0x42')],agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x8')]));agents[_0x50943a['secondtransfereruniqueid']]['transfer']=!![];agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x3c')]=_0x50bb('0x45');agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x3e')]=_0x50943a[_0x50bb('0x46')];agents[_0x50943a[_0x50bb('0x43')]]['transferuniqueid']=_0x50943a[_0x50bb('0x42')];}if(_0x50943a[_0x50bb('0x47')]&&agents[_0x50943a[_0x50bb('0x47')]]){agents[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x48')]=0x1;transfers[_0x50943a['transfereeuniqueid']]=_[_0x50bb('0x49')](agents[_0x50943a[_0x50bb('0x47')]]);transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x4a')]=agents[_0x50943a[_0x50bb('0x43')]]['calleridnum'];transfers[_0x50943a[_0x50bb('0x47')]]['calleridname']=agents[_0x50943a['secondtransfereruniqueid']][_0x50bb('0x4b')];transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x17')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x2f')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x2b')]=0x0;transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x48')]=0x2;}}else if(_0x50943a['secondtransfereruniqueid']==_0x50943a[_0x50bb('0x4c')]){if(!_['isNil'](agents[_0x50943a[_0x50bb('0x42')]])){utils[_0x50bb('0x2')](util['format'](_0x50bb('0x44'),_0x50943a[_0x50bb('0x42')],agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x8')]));agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3b')]=!![];agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3c')]='ATTENDED';agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3e')]=_0x50943a[_0x50bb('0x4d')];agents[_0x50943a['origtransfereruniqueid']][_0x50bb('0x40')]=_0x50943a[_0x50bb('0x43')];}if(_0x50943a[_0x50bb('0x4e')]&&agents[_0x50943a[_0x50bb('0x4e')]]){agents[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x48')]=0x1;transfers[_0x50943a['transfertargetuniqueid']]=_[_0x50bb('0x49')](agents[_0x50943a[_0x50bb('0x4e')]]);transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x4a')]=agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x4a')];transfers[_0x50943a['transfertargetuniqueid']][_0x50bb('0x4b')]=agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x4b')];transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x17')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x2f')]=utils[_0x50bb('0x20')]();transfers[_0x50943a['transfertargetuniqueid']][_0x50bb('0x2b')]=0x0;transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x48')]=0x2;}}}catch(_0x2d2463){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x4f'),_0x50943a[_0x50bb('0x42')]),_0x2d2463);}};exports[_0x50bb('0x50')]=function(_0x578ff3){try{utils['debug'](util['format'](_0x50bb('0x51'),_0x578ff3['uniqueid']),_0x578ff3);if(agents[_0x578ff3['uniqueid']]&&agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')]===_0x50bb('0x52')){if(_0x578ff3[_0x50bb('0x53')]==='21'){agents[_0x578ff3['uniqueid']][_0x50bb('0x2a')]=_0x50bb('0x54');agents[_0x578ff3['uniqueid']][_0x50bb('0xa')]='rejected';}utils[_0x50bb('0x2')](util[_0x50bb('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x578ff3[_0x50bb('0x5')],agents[_0x578ff3['uniqueid']][_0x50bb('0x8')],agents[_0x578ff3[_0x50bb('0x5')]]['reason'],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]));writeDB(agents[_0x578ff3[_0x50bb('0x5')]]);var _0x51142c=unanswered[_0x50bb('0x55')](_0x578ff3[_0x50bb('0x5')]);if(_0x51142c>-0x1){unanswered[_0x50bb('0x56')](_0x51142c,0x1);}}if(transfers[_0x578ff3[_0x50bb('0x5')]]){transfers[_0x578ff3['uniqueid']][_0x50bb('0x33')]=!![];transfers[_0x578ff3[_0x50bb('0x5')]]['agentcompleteAt']=utils['now']();transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x22')]=utils['diffTime'](transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2f')]);transfers[_0x578ff3[_0x50bb('0x5')]]['reason']='agent';transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]=_0x50bb('0x37');utils[_0x50bb('0x2')](util['format'](_0x50bb('0x57'),_0x578ff3['uniqueid'],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x8')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]));writeDB(transfers[_0x578ff3[_0x50bb('0x5')]],!![]);}if(agents[_0x578ff3['uniqueid']]&&agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2f')]){agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x33')]=!![];agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')]=utils[_0x50bb('0x20')]();agents[_0x578ff3['uniqueid']][_0x50bb('0x22')]=utils[_0x50bb('0x36')](agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')],agents[_0x578ff3[_0x50bb('0x5')]]['agentconnectAt']);agents[_0x578ff3['uniqueid']][_0x50bb('0x2a')]=agents[_0x578ff3['uniqueid']][_0x50bb('0x3b')]?_0x50bb('0x3b'):'agent';agents[_0x578ff3['uniqueid']][_0x50bb('0xa')]=_0x50bb('0x37');utils[_0x50bb('0x2')](util['format'](_0x50bb('0x57'),_0x578ff3[_0x50bb('0x5')],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x8')],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')],agents[_0x578ff3[_0x50bb('0x5')]]['lastevent']));writeDB(agents[_0x578ff3['uniqueid']]);}}catch(_0x28c99d){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x51'),_0x578ff3[_0x50bb('0x5')]),_0x28c99d);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index e967802..3150b33 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 _0x14c5=['userfield','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','cdr','split','lastIndexOf','includes','noop','execif','gotoif','lastdata','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','newstate','debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer','answertime','toNumber','hangup','[%s][calls][hangup]','callerid','endtime','duration','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','_attended','transfertargetchannel','origtransfereruniqueid','origtransfererchannel'];(function(_0x49f4b2,_0x3fbf95){var _0x5efb36=function(_0x4d7b5d){while(--_0x4d7b5d){_0x49f4b2['push'](_0x49f4b2['shift']());}};_0x5efb36(++_0x3fbf95);}(_0x14c5,0x1de));var _0x514c=function(_0x2c3039,_0xa8f353){_0x2c3039=_0x2c3039-0x0;var _0x3510cf=_0x14c5[_0x2c3039];return _0x3510cf;};'use strict';var _=require(_0x514c('0x0'));var util=require(_0x514c('0x1'));var utils=require(_0x514c('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x514c('0x3'),_0x514c('0x4'),_0x514c('0x4'),_0x514c('0x3'),_0x514c('0x3'),_0x514c('0x3'),_0x514c('0x5'),_0x514c('0x6'),_0x514c('0x4'),'FAILED',_0x514c('0x4')];var channels={};function writeDB(_0x308760){var _0x2cb9fc;if(transfers[_0x514c('0x7')][_0x308760[_0x514c('0x8')]]){_0x2cb9fc=_0x308760[_0x514c('0x8')];_0x308760[_0x514c('0x8')]=transfers[_0x514c('0x7')][_0x308760['uniqueid']][_0x514c('0x9')];}utils[_0x514c('0xa')](util[_0x514c('0xb')](_0x514c('0xc'),_0x308760[_0x514c('0x8')],_0x308760[_0x514c('0xd')],_0x308760[_0x514c('0xe')],_0x308760[_0x514c('0xf')],_0x308760[_0x514c('0x10')],_0x308760[_0x514c('0x11')],_0x308760['connectedlinenum'],_0x308760[_0x514c('0x12')]));if(_0x308760['accountcode']){utils[_0x514c('0x13')](_0x308760[_0x514c('0x14')])[_0x514c('0x15')](function(_0x5d7a19){if(_0x5d7a19){_0x308760[_0x514c('0x16')]=_0x5d7a19['id'];}utils[_0x514c('0x17')](_0x514c('0x18'),_0x308760);});}else{utils[_0x514c('0x17')]('CreateVoiceCallReport',_0x308760);}if(channels[_0x308760[_0x514c('0x8')]]){delete channels[_0x308760[_0x514c('0x8')]];}else if(_0x2cb9fc&&channels[_0x2cb9fc]){if(!transfers[_0x514c('0x7')][_0x2cb9fc][_0x514c('0x19')])delete transfers[_0x514c('0x7')][_0x2cb9fc];delete channels[_0x2cb9fc];}}exports[_0x514c('0x1a')]=function(_0x3f942d){try{utils['debug'](util[_0x514c('0xb')](_0x514c('0x1b'),_0x3f942d[_0x514c('0x8')]),_0x3f942d);if(_0x3f942d['uniqueid']==_0x3f942d[_0x514c('0x1c')]&&_0x3f942d[_0x514c('0xd')]!='OutgoingSpoolFailed'){utils['info'](util[_0x514c('0xb')](_0x514c('0x1d'),_0x3f942d[_0x514c('0x8')],_0x3f942d[_0x514c('0x1e')],_0x3f942d[_0x514c('0x1f')]));channels[_0x3f942d[_0x514c('0x8')]]={'uniqueid':_0x3f942d[_0x514c('0x8')],'accountcode':_0x3f942d['accountcode'],'source':_0x3f942d[_0x514c('0x11')],'destination':_0x3f942d['exten'],'destinationcontext':_0x3f942d['context'],'channel':_0x3f942d[_0x514c('0xd')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x514c('0x3'),'amaflags':_0x514c('0x20')};}}catch(_0x2f3863){utils[_0x514c('0x21')](util[_0x514c('0xb')](_0x514c('0x1b'),_0x3f942d['uniqueid']),_0x2f3863);}};exports[_0x514c('0x22')]=function(_0x4d601b){try{utils[_0x514c('0x23')](util[_0x514c('0xb')](_0x514c('0x24'),_0x4d601b[_0x514c('0x8')]),_0x4d601b);if(!_[_0x514c('0x25')](channels[_0x4d601b[_0x514c('0x8')]])&&_0x4d601b[_0x514c('0x26')]==0x6){utils[_0x514c('0xa')](util[_0x514c('0xb')](_0x514c('0x27'),_0x4d601b['uniqueid'],_0x4d601b[_0x514c('0x1e')],_0x4d601b[_0x514c('0xd')]));if(_[_0x514c('0x25')](channels[_0x4d601b[_0x514c('0x8')]]['systemanswertime'])){channels[_0x4d601b[_0x514c('0x8')]][_0x514c('0x28')]=utils[_0x514c('0x29')]();}}else if(!_[_0x514c('0x25')](channels[_0x4d601b[_0x514c('0x1c')]])&&_0x4d601b['channelstate']==0x6&&_0x4d601b[_0x514c('0x1e')]!=_0x514c('0x2a')){utils[_0x514c('0xa')](util['format']('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x4d601b[_0x514c('0x8')],_0x4d601b[_0x514c('0x1c')],_0x4d601b[_0x514c('0x1e')],_0x4d601b[_0x514c('0xd')]));channels[_0x4d601b[_0x514c('0x1c')]]['accountcode']=_0x4d601b[_0x514c('0x14')];channels[_0x4d601b[_0x514c('0x1c')]]['destinationchannel']=_0x4d601b['channel'];if(_['isNil'](channels[_0x4d601b[_0x514c('0x1c')]][_0x514c('0x2b')])){channels[_0x4d601b[_0x514c('0x1c')]][_0x514c('0x2b')]=utils[_0x514c('0x29')]();}channels[_0x4d601b[_0x514c('0x1c')]]['disposition']=dispositions[_[_0x514c('0x2c')](_0x4d601b[_0x514c('0x26')])]||_0x514c('0x5');}}catch(_0x487dfd){utils[_0x514c('0x21')](util[_0x514c('0xb')]('[%s][calls][newstate]',_0x4d601b[_0x514c('0x8')]),_0x487dfd);}};exports[_0x514c('0x2d')]=function(_0x51be51){try{if(!_[_0x514c('0x25')](channels[_0x51be51['uniqueid']])){utils[_0x514c('0x23')](util[_0x514c('0xb')](_0x514c('0x2e'),_0x51be51[_0x514c('0x8')]),_0x51be51);if(_[_0x514c('0x25')](channels[_0x51be51[_0x514c('0x8')]][_0x514c('0x2f')])){channels[_0x51be51[_0x514c('0x8')]]['callerid']=_0x51be51['calleridname']+'\x20<'+_0x51be51[_0x514c('0x11')]+'>';}utils[_0x514c('0xa')](util[_0x514c('0xb')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x51be51['uniqueid'],channels[_0x51be51[_0x514c('0x8')]][_0x514c('0x2f')],_0x51be51['cause-txt']));channels[_0x51be51[_0x514c('0x8')]][_0x514c('0x30')]=utils[_0x514c('0x29')]();channels[_0x51be51[_0x514c('0x8')]][_0x514c('0x31')]=utils['diffTime'](channels[_0x51be51['uniqueid']]['endtime'],channels[_0x51be51[_0x514c('0x8')]][_0x514c('0x32')]);channels[_0x51be51[_0x514c('0x8')]][_0x514c('0x33')]=channels[_0x51be51[_0x514c('0x8')]][_0x514c('0x2b')]?utils['diffTime'](channels[_0x51be51[_0x514c('0x8')]][_0x514c('0x30')],channels[_0x51be51['uniqueid']]['answertime']):0x0;writeDB(channels[_0x51be51[_0x514c('0x8')]]);}}catch(_0x595b96){utils[_0x514c('0x21')](util[_0x514c('0xb')](_0x514c('0x2e'),_0x51be51[_0x514c('0x8')]),_0x595b96);}};exports['attendedtransfer']=function(_0xdcc793){try{if(!_[_0x514c('0x25')](channels[_0xdcc793[_0x514c('0x34')]])){utils[_0x514c('0x23')](util[_0x514c('0xb')](_0x514c('0x35'),_0xdcc793['origtransfereruniqueid']),_0xdcc793);if(channels[_0xdcc793[_0x514c('0x34')]][_0x514c('0xd')]==_0xdcc793[_0x514c('0x36')]){utils[_0x514c('0xa')](util[_0x514c('0xb')](_0x514c('0x37'),_0xdcc793['origtransfereruniqueid'],_0xdcc793[_0x514c('0x34')],_0xdcc793[_0x514c('0x38')]));channels[_0xdcc793['localtwolinkedid']][_0x514c('0x39')]=_0xdcc793['secondtransfererchannel'];channels[_0xdcc793['localtwolinkedid']]['userfield']=_0x514c('0x3a');}else if(channels[_0xdcc793['localtwolinkedid']]['channel']=_0xdcc793[_0x514c('0x3b')]){utils[_0x514c('0xa')](util[_0x514c('0xb')](_0x514c('0x37'),_0xdcc793[_0x514c('0x3c')],_0xdcc793[_0x514c('0x34')],_0xdcc793[_0x514c('0x3d')]));channels[_0xdcc793['localtwolinkedid']][_0x514c('0x39')]=_0xdcc793[_0x514c('0x3d')];channels[_0xdcc793[_0x514c('0x34')]][_0x514c('0x3e')]='_attended';}}}catch(_0x5ec0c0){utils[_0x514c('0x21')](util[_0x514c('0xb')]('[%s][calls][attendedtransfer]',_0xdcc793[_0x514c('0x3c')]),_0x5ec0c0);}};exports['musiconholdstart']=function(_0x582fd3){try{if(!_['isNil'](channels[_0x582fd3[_0x514c('0x8')]])){utils[_0x514c('0x23')](util[_0x514c('0xb')](_0x514c('0x3f'),_0x582fd3[_0x514c('0x8')]),_0x582fd3);channels[_0x582fd3[_0x514c('0x8')]][_0x514c('0x40')]=utils[_0x514c('0x29')]();utils[_0x514c('0xa')](util[_0x514c('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x582fd3[_0x514c('0x8')],channels[_0x582fd3[_0x514c('0x8')]]['musiconholdstartAt']));}}catch(_0x4dedc6){utils[_0x514c('0x21')](util[_0x514c('0xb')](_0x514c('0x3f'),_0x582fd3[_0x514c('0x8')]),_0x4dedc6);}};exports[_0x514c('0x41')]=function(_0xcb4929){try{if(!_[_0x514c('0x25')](channels[_0xcb4929[_0x514c('0x8')]])){utils[_0x514c('0x23')](util[_0x514c('0xb')]('[%s][calls][musiconholdstop]',_0xcb4929['uniqueid']),_0xcb4929);if(!_['isNil'](channels[_0xcb4929[_0x514c('0x8')]][_0x514c('0x40')])){channels[_0xcb4929[_0x514c('0x8')]]['mohtime']+=utils['diffTime'](utils[_0x514c('0x29')](),channels[_0xcb4929['uniqueid']]['musiconholdstartAt']);utils[_0x514c('0xa')](util[_0x514c('0xb')](_0x514c('0x42'),_0xcb4929[_0x514c('0x8')],channels[_0xcb4929[_0x514c('0x8')]]['mohtime']));delete channels[_0xcb4929['uniqueid']][_0x514c('0x40')];}}}catch(_0x1fca70){utils['error'](util[_0x514c('0xb')](_0x514c('0x43'),_0xcb4929[_0x514c('0x8')]),_0x1fca70);}};exports[_0x514c('0x44')]=function(_0x379532){try{if(!_[_0x514c('0x25')](channels[_0x379532[_0x514c('0x8')]])){utils[_0x514c('0x23')](util[_0x514c('0xb')](_0x514c('0x45'),_0x379532['uniqueid']),_0x379532);if(!_[_0x514c('0x25')](_0x379532[_0x514c('0x46')][_0x514c('0x47')])){utils[_0x514c('0xa')](util[_0x514c('0xb')](_0x514c('0x48'),_0x379532['uniqueid'],_0x379532[_0x514c('0x49')]));channels[_0x379532[_0x514c('0x8')]][_0x514c('0x4a')]=_0x379532[_0x514c('0x49')];}if(!_[_0x514c('0x25')](_0x379532[_0x514c('0x46')][_0x514c('0x4b')])){utils[_0x514c('0xa')](util[_0x514c('0xb')](_0x514c('0x4c'),_0x379532['uniqueid'],_0x379532['value']));channels[_0x379532['uniqueid']][_0x514c('0x4d')]=_0x379532[_0x514c('0x49')];channels[_0x379532['uniqueid']][_0x514c('0x2f')]='\x22'+_0x379532[_0x514c('0x49')]+_0x514c('0x4e')+_0x379532[_0x514c('0x49')]+'>';}if(!_[_0x514c('0x25')](_0x379532[_0x514c('0x46')]['xmd-callerid-preview'])||!_[_0x514c('0x25')](_0x379532[_0x514c('0x46')][_0x514c('0x4f')])){utils[_0x514c('0xa')](util[_0x514c('0xb')](_0x514c('0x50'),_0x379532[_0x514c('0x8')],!_[_0x514c('0x25')](_0x379532['variable'][_0x514c('0x51')])?'xmd-callerid-preview':_0x514c('0x4f'),_0x379532[_0x514c('0x49')]));channels[_0x379532[_0x514c('0x8')]][_0x514c('0x2f')]=_0x379532[_0x514c('0x49')];}if(!_[_0x514c('0x25')](_0x379532[_0x514c('0x46')][_0x514c('0x52')])||!_['isNil'](_0x379532['variable']['xmcs-queue'])){utils[_0x514c('0xa')](util[_0x514c('0xb')](_0x514c('0x50'),_0x379532[_0x514c('0x8')],!_[_0x514c('0x25')](_0x379532[_0x514c('0x46')][_0x514c('0x52')])?'xmd-queue':_0x514c('0x53'),_0x379532[_0x514c('0x49')]));channels[_0x379532[_0x514c('0x8')]][_0x514c('0x54')]=_0x514c('0x55');channels[_0x379532['uniqueid']]['lastdata']=_0x379532[_0x514c('0x49')];channels[_0x379532[_0x514c('0x8')]][_0x514c('0xe')]=!![];}if(!_[_0x514c('0x25')](_0x379532[_0x514c('0x46')][_0x514c('0x56')])){utils[_0x514c('0xa')](util[_0x514c('0xb')](_0x514c('0x57'),_0x379532['uniqueid'],_0x379532[_0x514c('0x49')]));channels[_0x379532['uniqueid']][_0x514c('0x58')]=_0x379532[_0x514c('0x49')];}if(!_[_0x514c('0x25')](_0x379532['variable']['xmd-cdrtype'])){utils[_0x514c('0xa')](util[_0x514c('0xb')](_0x514c('0x59'),_0x379532[_0x514c('0x8')],_0x379532[_0x514c('0x49')]));channels[_0x379532['uniqueid']][_0x514c('0x5a')]=_0x379532[_0x514c('0x49')];}if(!_[_0x514c('0x25')](_0x379532[_0x514c('0x46')][_0x514c('0x5b')])){utils['info'](util[_0x514c('0xb')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x379532[_0x514c('0x8')],_0x379532[_0x514c('0x49')]));channels[_0x379532[_0x514c('0x8')]]['routeid']=_0x379532[_0x514c('0x49')];}if(!_['isNil'](_0x379532[_0x514c('0x46')]['sipcallid'])){utils[_0x514c('0xa')](util[_0x514c('0xb')](_0x514c('0x5c'),_0x379532['uniqueid'],_0x379532[_0x514c('0x49')]));channels[_0x379532[_0x514c('0x8')]][_0x514c('0x5d')]=_0x379532[_0x514c('0x49')];}}}catch(_0x3a856b){utils['error'](util[_0x514c('0xb')](_0x514c('0x45'),_0x379532[_0x514c('0x8')]),_0x3a856b);}};exports[_0x514c('0x5e')]=function(_0x246e10){try{if(!_[_0x514c('0x25')](channels[_0x246e10[_0x514c('0x8')]])){utils[_0x514c('0x23')](util['format'](_0x514c('0x5f'),_0x246e10[_0x514c('0x8')]),_0x246e10);utils['info'](util[_0x514c('0xb')](_0x514c('0x60'),_0x246e10[_0x514c('0x8')],_0x246e10['application'],_0x246e10[_0x514c('0x61')]));if(_0x246e10['application'][_0x514c('0x62')]()==_0x514c('0x63')&&_['startsWith'](_0x246e10[_0x514c('0x61')]['toLowerCase'](),_0x514c('0x64'))){var _0x4d387f=_0x246e10[_0x514c('0x61')][_0x514c('0x65')]('=');var _0x58fec9=_0x4d387f[0x0]['substring'](_0x4d387f[0x0][_0x514c('0x66')]('(')+0x1,_0x4d387f[0x0][_0x514c('0x66')](')'));var _0x3e517c=_0x4d387f[0x1];channels[_0x246e10[_0x514c('0x8')]][_0x58fec9]=_0x3e517c;}if(!_[_0x514c('0x67')](['hangup',_0x514c('0x68'),_0x514c('0x69'),_0x514c('0x63'),_0x514c('0x6a')],_0x246e10['application'][_0x514c('0x62')]())){channels[_0x246e10[_0x514c('0x8')]][_0x514c('0x54')]=_0x246e10['application'];channels[_0x246e10['uniqueid']][_0x514c('0x6b')]=_0x246e10[_0x514c('0x61')];}}}catch(_0x4d28d){utils[_0x514c('0x21')](util[_0x514c('0xb')](_0x514c('0x5f'),_0x246e10[_0x514c('0x8')]),_0x4d28d);}}; \ No newline at end of file +var _0x3588=['xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr','split','lastIndexOf','gotoif','toLowerCase','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','newchannel','debug','[%s][calls][newchannel]','linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','toNumber','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','billableseconds','diffTime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x3588,0x82));var _0x8358=function(_0xff5df6,_0x514e73){_0xff5df6=_0xff5df6-0x0;var _0x2634bb=_0x3588[_0xff5df6];return _0x2634bb;};'use strict';var _=require(_0x8358('0x0'));var util=require(_0x8358('0x1'));var utils=require(_0x8358('0x2'));var transfers=require(_0x8358('0x3'));var dispositions=[_0x8358('0x4'),_0x8358('0x5'),_0x8358('0x5'),'NO\x20ANSWER',_0x8358('0x4'),_0x8358('0x4'),_0x8358('0x6'),_0x8358('0x7'),'FAILED',_0x8358('0x5'),_0x8358('0x5')];var channels={};function writeDB(_0x49d515){var _0x11d369;if(transfers['blinds'][_0x49d515[_0x8358('0x8')]]){_0x11d369=_0x49d515[_0x8358('0x8')];_0x49d515[_0x8358('0x8')]=transfers[_0x8358('0x9')][_0x49d515['uniqueid']][_0x8358('0xa')];}utils['info'](util[_0x8358('0xb')](_0x8358('0xc'),_0x49d515[_0x8358('0x8')],_0x49d515[_0x8358('0xd')],_0x49d515[_0x8358('0xe')],_0x49d515[_0x8358('0xf')],_0x49d515[_0x8358('0x10')],_0x49d515[_0x8358('0x11')],_0x49d515[_0x8358('0x12')],_0x49d515[_0x8358('0x13')]));if(_0x49d515[_0x8358('0x14')]){utils[_0x8358('0x15')](_0x49d515[_0x8358('0x14')])[_0x8358('0x16')](function(_0xda422b){if(_0xda422b){_0x49d515[_0x8358('0x17')]=_0xda422b['id'];}utils['request']('CreateVoiceCallReport',_0x49d515);});}else{utils[_0x8358('0x18')]('CreateVoiceCallReport',_0x49d515);}if(channels[_0x49d515[_0x8358('0x8')]]){delete channels[_0x49d515['uniqueid']];}else if(_0x11d369&&channels[_0x11d369]){if(!transfers['blinds'][_0x11d369]['recording'])delete transfers[_0x8358('0x9')][_0x11d369];delete channels[_0x11d369];}}exports[_0x8358('0x19')]=function(_0x25b340){try{utils[_0x8358('0x1a')](util[_0x8358('0xb')](_0x8358('0x1b'),_0x25b340[_0x8358('0x8')]),_0x25b340);if(_0x25b340['uniqueid']==_0x25b340[_0x8358('0x1c')]&&_0x25b340[_0x8358('0xd')]!='OutgoingSpoolFailed'){utils[_0x8358('0x1d')](util[_0x8358('0xb')](_0x8358('0x1e'),_0x25b340[_0x8358('0x8')],_0x25b340['context'],_0x25b340['exten']));channels[_0x25b340[_0x8358('0x8')]]={'uniqueid':_0x25b340[_0x8358('0x8')],'accountcode':_0x25b340[_0x8358('0x14')],'source':_0x25b340['calleridnum'],'destination':_0x25b340['exten'],'destinationcontext':_0x25b340[_0x8358('0x1f')],'channel':_0x25b340['channel'],'starttime':utils[_0x8358('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x8358('0x4'),'amaflags':_0x8358('0x21')};}}catch(_0x21e9ad){utils[_0x8358('0x22')](util[_0x8358('0xb')](_0x8358('0x1b'),_0x25b340['uniqueid']),_0x21e9ad);}};exports[_0x8358('0x23')]=function(_0x4acebb){try{utils[_0x8358('0x1a')](util['format'](_0x8358('0x24'),_0x4acebb[_0x8358('0x8')]),_0x4acebb);if(!_[_0x8358('0x25')](channels[_0x4acebb[_0x8358('0x8')]])&&_0x4acebb[_0x8358('0x26')]==0x6){utils[_0x8358('0x1d')](util[_0x8358('0xb')](_0x8358('0x27'),_0x4acebb[_0x8358('0x8')],_0x4acebb[_0x8358('0x1f')],_0x4acebb[_0x8358('0xd')]));if(_['isNil'](channels[_0x4acebb[_0x8358('0x8')]][_0x8358('0x28')])){channels[_0x4acebb[_0x8358('0x8')]][_0x8358('0x28')]=utils[_0x8358('0x20')]();}}else if(!_[_0x8358('0x25')](channels[_0x4acebb[_0x8358('0x1c')]])&&_0x4acebb[_0x8358('0x26')]==0x6&&_0x4acebb[_0x8358('0x1f')]!=_0x8358('0x29')){utils[_0x8358('0x1d')](util[_0x8358('0xb')](_0x8358('0x2a'),_0x4acebb['uniqueid'],_0x4acebb[_0x8358('0x1c')],_0x4acebb['context'],_0x4acebb['channel']));channels[_0x4acebb[_0x8358('0x1c')]][_0x8358('0x14')]=_0x4acebb[_0x8358('0x14')];channels[_0x4acebb[_0x8358('0x1c')]]['destinationchannel']=_0x4acebb[_0x8358('0xd')];if(_[_0x8358('0x25')](channels[_0x4acebb[_0x8358('0x1c')]]['answertime'])){channels[_0x4acebb[_0x8358('0x1c')]][_0x8358('0x2b')]=utils[_0x8358('0x20')]();}channels[_0x4acebb[_0x8358('0x1c')]]['disposition']=dispositions[_[_0x8358('0x2c')](_0x4acebb['channelstate'])]||_0x8358('0x6');}}catch(_0x29d578){utils[_0x8358('0x22')](util[_0x8358('0xb')](_0x8358('0x24'),_0x4acebb[_0x8358('0x8')]),_0x29d578);}};exports[_0x8358('0x2d')]=function(_0xfe9940){try{if(!_[_0x8358('0x25')](channels[_0xfe9940[_0x8358('0x8')]])){utils[_0x8358('0x1a')](util['format']('[%s][calls][hangup]',_0xfe9940[_0x8358('0x8')]),_0xfe9940);if(_[_0x8358('0x25')](channels[_0xfe9940[_0x8358('0x8')]][_0x8358('0x2e')])){channels[_0xfe9940['uniqueid']][_0x8358('0x2e')]=_0xfe9940[_0x8358('0x2f')]+'\x20<'+_0xfe9940[_0x8358('0x11')]+'>';}utils[_0x8358('0x1d')](util[_0x8358('0xb')](_0x8358('0x30'),_0xfe9940[_0x8358('0x8')],channels[_0xfe9940['uniqueid']][_0x8358('0x2e')],_0xfe9940[_0x8358('0x31')]));channels[_0xfe9940['uniqueid']][_0x8358('0x32')]=utils[_0x8358('0x20')]();channels[_0xfe9940[_0x8358('0x8')]][_0x8358('0x33')]=utils['diffTime'](channels[_0xfe9940[_0x8358('0x8')]][_0x8358('0x32')],channels[_0xfe9940[_0x8358('0x8')]]['starttime']);channels[_0xfe9940[_0x8358('0x8')]][_0x8358('0x34')]=channels[_0xfe9940[_0x8358('0x8')]][_0x8358('0x2b')]?utils[_0x8358('0x35')](channels[_0xfe9940['uniqueid']]['endtime'],channels[_0xfe9940[_0x8358('0x8')]]['answertime']):0x0;writeDB(channels[_0xfe9940[_0x8358('0x8')]]);}}catch(_0x4bac99){utils['error'](util[_0x8358('0xb')](_0x8358('0x36'),_0xfe9940[_0x8358('0x8')]),_0x4bac99);}};exports[_0x8358('0x37')]=function(_0x213be2){try{if(!_[_0x8358('0x25')](channels[_0x213be2[_0x8358('0x38')]])){utils[_0x8358('0x1a')](util['format']('[%s][calls][attendedtransfer]',_0x213be2['origtransfereruniqueid']),_0x213be2);if(channels[_0x213be2[_0x8358('0x38')]][_0x8358('0xd')]==_0x213be2['transfereechannel']){utils[_0x8358('0x1d')](util[_0x8358('0xb')](_0x8358('0x39'),_0x213be2[_0x8358('0x3a')],_0x213be2['localtwolinkedid'],_0x213be2[_0x8358('0x3b')]));channels[_0x213be2['localtwolinkedid']][_0x8358('0x3c')]=_0x213be2['secondtransfererchannel'];channels[_0x213be2[_0x8358('0x38')]][_0x8358('0x3d')]=_0x8358('0x3e');}else if(channels[_0x213be2['localtwolinkedid']][_0x8358('0xd')]=_0x213be2[_0x8358('0x3f')]){utils[_0x8358('0x1d')](util[_0x8358('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x213be2['origtransfereruniqueid'],_0x213be2['localtwolinkedid'],_0x213be2['origtransfererchannel']));channels[_0x213be2[_0x8358('0x38')]][_0x8358('0x3c')]=_0x213be2[_0x8358('0x40')];channels[_0x213be2[_0x8358('0x38')]][_0x8358('0x3d')]=_0x8358('0x3e');}}}catch(_0x5d7c41){utils[_0x8358('0x22')](util[_0x8358('0xb')](_0x8358('0x41'),_0x213be2[_0x8358('0x3a')]),_0x5d7c41);}};exports[_0x8358('0x42')]=function(_0x36e39b){try{if(!_[_0x8358('0x25')](channels[_0x36e39b[_0x8358('0x8')]])){utils['debug'](util[_0x8358('0xb')](_0x8358('0x43'),_0x36e39b['uniqueid']),_0x36e39b);channels[_0x36e39b['uniqueid']][_0x8358('0x44')]=utils['now']();utils[_0x8358('0x1d')](util[_0x8358('0xb')](_0x8358('0x45'),_0x36e39b[_0x8358('0x8')],channels[_0x36e39b[_0x8358('0x8')]][_0x8358('0x44')]));}}catch(_0x34ae49){utils[_0x8358('0x22')](util['format'](_0x8358('0x43'),_0x36e39b[_0x8358('0x8')]),_0x34ae49);}};exports[_0x8358('0x46')]=function(_0x54105d){try{if(!_[_0x8358('0x25')](channels[_0x54105d[_0x8358('0x8')]])){utils[_0x8358('0x1a')](util[_0x8358('0xb')](_0x8358('0x47'),_0x54105d['uniqueid']),_0x54105d);if(!_[_0x8358('0x25')](channels[_0x54105d['uniqueid']][_0x8358('0x44')])){channels[_0x54105d['uniqueid']][_0x8358('0x48')]+=utils['diffTime'](utils[_0x8358('0x20')](),channels[_0x54105d['uniqueid']][_0x8358('0x44')]);utils[_0x8358('0x1d')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x54105d[_0x8358('0x8')],channels[_0x54105d[_0x8358('0x8')]][_0x8358('0x48')]));delete channels[_0x54105d[_0x8358('0x8')]][_0x8358('0x44')];}}}catch(_0x2a50b5){utils[_0x8358('0x22')](util[_0x8358('0xb')](_0x8358('0x47'),_0x54105d[_0x8358('0x8')]),_0x2a50b5);}};exports['varset']=function(_0xefa0c2){try{if(!_[_0x8358('0x25')](channels[_0xefa0c2[_0x8358('0x8')]])){utils[_0x8358('0x1a')](util['format'](_0x8358('0x49'),_0xefa0c2['uniqueid']),_0xefa0c2);if(!_['isNil'](_0xefa0c2[_0x8358('0x4a')]['xmd-originatecalleridnum'])){utils[_0x8358('0x1d')](util['format'](_0x8358('0x4b'),_0xefa0c2['uniqueid'],_0xefa0c2[_0x8358('0x4c')]));channels[_0xefa0c2['uniqueid']][_0x8358('0x4d')]=_0xefa0c2['value'];}if(!_[_0x8358('0x25')](_0xefa0c2['variable'][_0x8358('0x4e')])){utils[_0x8358('0x1d')](util[_0x8358('0xb')](_0x8358('0x4f'),_0xefa0c2[_0x8358('0x8')],_0xefa0c2['value']));channels[_0xefa0c2[_0x8358('0x8')]]['destination']=_0xefa0c2[_0x8358('0x4c')];channels[_0xefa0c2['uniqueid']][_0x8358('0x2e')]='\x22'+_0xefa0c2['value']+_0x8358('0x50')+_0xefa0c2[_0x8358('0x4c')]+'>';}if(!_[_0x8358('0x25')](_0xefa0c2['variable'][_0x8358('0x51')])||!_[_0x8358('0x25')](_0xefa0c2['variable']['xmd-callerid'])){utils[_0x8358('0x1d')](util['format'](_0x8358('0x52'),_0xefa0c2[_0x8358('0x8')],!_[_0x8358('0x25')](_0xefa0c2[_0x8358('0x4a')]['xmd-callerid-preview'])?'xmd-callerid-preview':'xmd-callerid',_0xefa0c2[_0x8358('0x4c')]));channels[_0xefa0c2[_0x8358('0x8')]][_0x8358('0x2e')]=_0xefa0c2[_0x8358('0x4c')];}if(!_['isNil'](_0xefa0c2[_0x8358('0x4a')][_0x8358('0x53')])||!_['isNil'](_0xefa0c2[_0x8358('0x4a')]['xmcs-queue'])){utils[_0x8358('0x1d')](util[_0x8358('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xefa0c2[_0x8358('0x8')],!_['isNil'](_0xefa0c2[_0x8358('0x4a')]['xmd-queue'])?'xmd-queue':_0x8358('0x54'),_0xefa0c2[_0x8358('0x4c')]));channels[_0xefa0c2[_0x8358('0x8')]][_0x8358('0x55')]=_0x8358('0x56');channels[_0xefa0c2['uniqueid']][_0x8358('0x57')]=_0xefa0c2[_0x8358('0x4c')];channels[_0xefa0c2[_0x8358('0x8')]]['queue']=!![];}if(!_[_0x8358('0x25')](_0xefa0c2['variable'][_0x8358('0x58')])){utils[_0x8358('0x1d')](util[_0x8358('0xb')](_0x8358('0x59'),_0xefa0c2[_0x8358('0x8')],_0xefa0c2[_0x8358('0x4c')]));channels[_0xefa0c2[_0x8358('0x8')]][_0x8358('0x5a')]=_0xefa0c2[_0x8358('0x4c')];}if(!_[_0x8358('0x25')](_0xefa0c2['variable'][_0x8358('0x5b')])){utils[_0x8358('0x1d')](util[_0x8358('0xb')](_0x8358('0x5c'),_0xefa0c2[_0x8358('0x8')],_0xefa0c2[_0x8358('0x4c')]));channels[_0xefa0c2['uniqueid']][_0x8358('0x5d')]=_0xefa0c2[_0x8358('0x4c')];}if(!_[_0x8358('0x25')](_0xefa0c2['variable']['outboundrouteid'])){utils[_0x8358('0x1d')](util[_0x8358('0xb')](_0x8358('0x5e'),_0xefa0c2[_0x8358('0x8')],_0xefa0c2['value']));channels[_0xefa0c2[_0x8358('0x8')]][_0x8358('0x5f')]=_0xefa0c2[_0x8358('0x4c')];}if(!_[_0x8358('0x25')](_0xefa0c2[_0x8358('0x4a')][_0x8358('0x60')])){utils[_0x8358('0x1d')](util[_0x8358('0xb')](_0x8358('0x61'),_0xefa0c2['uniqueid'],_0xefa0c2[_0x8358('0x4c')]));channels[_0xefa0c2[_0x8358('0x8')]][_0x8358('0x60')]=_0xefa0c2[_0x8358('0x4c')];}}}catch(_0x144107){utils[_0x8358('0x22')](util[_0x8358('0xb')](_0x8358('0x49'),_0xefa0c2[_0x8358('0x8')]),_0x144107);}};exports['newexten']=function(_0x4f602c){try{if(!_['isNil'](channels[_0x4f602c['uniqueid']])){utils[_0x8358('0x1a')](util[_0x8358('0xb')](_0x8358('0x62'),_0x4f602c[_0x8358('0x8')]),_0x4f602c);utils[_0x8358('0x1d')](util[_0x8358('0xb')](_0x8358('0x63'),_0x4f602c[_0x8358('0x8')],_0x4f602c[_0x8358('0x64')],_0x4f602c[_0x8358('0x65')]));if(_0x4f602c['application']['toLowerCase']()==_0x8358('0x66')&&_[_0x8358('0x67')](_0x4f602c[_0x8358('0x65')]['toLowerCase'](),_0x8358('0x68'))){var _0x421d19=_0x4f602c[_0x8358('0x65')][_0x8358('0x69')]('=');var _0x309ae8=_0x421d19[0x0]['substring'](_0x421d19[0x0][_0x8358('0x6a')]('(')+0x1,_0x421d19[0x0][_0x8358('0x6a')](')'));var _0x476e6d=_0x421d19[0x1];channels[_0x4f602c['uniqueid']][_0x309ae8]=_0x476e6d;}if(!_['includes'](['hangup','noop','execif',_0x8358('0x66'),_0x8358('0x6b')],_0x4f602c['application'][_0x8358('0x6c')]())){channels[_0x4f602c['uniqueid']][_0x8358('0x55')]=_0x4f602c[_0x8358('0x64')];channels[_0x4f602c[_0x8358('0x8')]]['lastdata']=_0x4f602c[_0x8358('0x65')];}}}catch(_0x493193){utils[_0x8358('0x22')](util[_0x8358('0xb')](_0x8358('0x62'),_0x4f602c[_0x8358('0x8')]),_0x493193);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 848c408..d9bbd30 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 _0xa694=['[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','info'];(function(_0x4a5517,_0x574167){var _0x175a02=function(_0x42e86d){while(--_0x42e86d){_0x4a5517['push'](_0x4a5517['shift']());}};_0x175a02(++_0x574167);}(_0xa694,0x153));var _0x4a69=function(_0x116b2a,_0x47be67){_0x116b2a=_0x116b2a-0x0;var _0x1b2c42=_0xa694[_0x116b2a];return _0x1b2c42;};'use strict';var utils=require(_0x4a69('0x0'));exports['connect']=function(){utils[_0x4a69('0x1')](_0x4a69('0x2'));};exports[_0x4a69('0x3')]=function(){utils[_0x4a69('0x1')]('[core]\x20shutdown');};exports[_0x4a69('0x4')]=function(){utils[_0x4a69('0x1')](_0x4a69('0x5'));};exports[_0x4a69('0x6')]=function(_0x556fab){utils[_0x4a69('0x6')](_0x4a69('0x7'),_0x556fab);};exports[_0x4a69('0x8')]=function(){utils[_0x4a69('0x1')](_0x4a69('0x9'));};exports[_0x4a69('0xa')]=function(_0x1ce957){}; \ No newline at end of file +var _0x5e39=['shutdown','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','./utils','connect','info'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x5e39,0xbb));var _0x95e3=function(_0x1ded76,_0x463f14){_0x1ded76=_0x1ded76-0x0;var _0x3d58e3=_0x5e39[_0x1ded76];return _0x3d58e3;};'use strict';var utils=require(_0x95e3('0x0'));exports[_0x95e3('0x1')]=function(){utils[_0x95e3('0x2')]('[core]\x20connected');};exports[_0x95e3('0x3')]=function(){utils[_0x95e3('0x2')](_0x95e3('0x4'));};exports['fullybooted']=function(){utils[_0x95e3('0x2')](_0x95e3('0x5'));};exports[_0x95e3('0x6')]=function(_0x42920a){utils[_0x95e3('0x6')](_0x95e3('0x7'),_0x42920a);};exports[_0x95e3('0x8')]=function(){utils[_0x95e3('0x2')](_0x95e3('0x9'));};exports['managerevent']=function(_0x2aa5f2){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 9affcf9..af81e17 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 _0x6512=['debug','[%s][dials][newexten]','application','appdata','set','startsWith','toLowerCase','cdr(routeid)','split','error','varset','[%s][dials][varset]','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','isNil','ANSWER','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten'];(function(_0x248805,_0x4d8c4a){var _0x243b1c=function(_0xaa370e){while(--_0xaa370e){_0x248805['push'](_0x248805['shift']());}};_0x243b1c(++_0x4d8c4a);}(_0x6512,0x1f1));var _0x2651=function(_0x240736,_0x2fe946){_0x240736=_0x240736-0x0;var _0x3a191f=_0x6512[_0x240736];return _0x3a191f;};'use strict';var _=require(_0x2651('0x0'));var util=require(_0x2651('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x4d0ce4){utils[_0x2651('0x2')](util[_0x2651('0x3')](_0x2651('0x4'),_0x4d0ce4['uniqueid'],_0x4d0ce4['channel'],_0x4d0ce4[_0x2651('0x5')],_0x4d0ce4[_0x2651('0x6')],_0x4d0ce4[_0x2651('0x7')],_0x4d0ce4[_0x2651('0x8')]));utils[_0x2651('0x9')](_0x2651('0xa'),_0x4d0ce4);delete dials[_0x4d0ce4[_0x2651('0xb')]];}exports[_0x2651('0xc')]=function(_0xe74d46){try{utils[_0x2651('0xd')](util['format'](_0x2651('0xe'),_0xe74d46[_0x2651('0xb')]),_0xe74d46);utils['info'](util[_0x2651('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0xe74d46[_0x2651('0xb')],_0xe74d46[_0x2651('0xf')],_0xe74d46[_0x2651('0x10')]));if(_0xe74d46[_0x2651('0xf')]['toLowerCase']()==_0x2651('0x11')&&_[_0x2651('0x12')](_0xe74d46[_0x2651('0x10')][_0x2651('0x13')](),_0x2651('0x14'))){var _0xd046fa=_0xe74d46[_0x2651('0x10')][_0x2651('0x15')]('=');dials[_0xe74d46[_0x2651('0xb')]]={'routeId':_0xd046fa[0x1]};}}catch(_0x24921f){utils[_0x2651('0x16')](util[_0x2651('0x3')](_0x2651('0xe'),_0xe74d46['uniqueid']),_0x24921f);}};exports[_0x2651('0x17')]=function(_0x1adf62){try{utils[_0x2651('0xd')](util[_0x2651('0x3')](_0x2651('0x18'),_0x1adf62[_0x2651('0xb')]),_0x1adf62);if(!_['isNil'](_0x1adf62[_0x2651('0x19')]['outboundrouteid'])){utils['info'](util[_0x2651('0x3')](_0x2651('0x1a'),_0x1adf62[_0x2651('0xb')],_0x1adf62[_0x2651('0x1b')]));dials[_0x1adf62['uniqueid']]={'routeId':_0x1adf62['value']};}}catch(_0x16cba0){utils['error'](util[_0x2651('0x3')]('[%s][dials][varset]',_0x1adf62[_0x2651('0xb')]),_0x16cba0);}};exports[_0x2651('0x1c')]=function(_0xd6c934){try{if(!_['isNil'](dials[_0xd6c934['uniqueid']])){utils['debug'](util[_0x2651('0x3')](_0x2651('0x1d'),_0xd6c934[_0x2651('0xb')]),_0xd6c934);dials[_0xd6c934[_0x2651('0xb')]]=_['assign'](dials[_0xd6c934[_0x2651('0xb')]],_0xd6c934);dials[_0xd6c934['uniqueid']][_0x2651('0x1e')]=utils[_0x2651('0x1f')]();dials[_0xd6c934[_0x2651('0xb')]][_0x2651('0x20')]=_0x2651('0x21');utils[_0x2651('0x2')](util[_0x2651('0x3')](_0x2651('0x22'),_0xd6c934[_0x2651('0xb')],dials[_0xd6c934[_0x2651('0xb')]]['starttime']));}}catch(_0x24736c){utils[_0x2651('0x16')](util[_0x2651('0x3')]('[%s][dials][dialbegin]',_0xd6c934[_0x2651('0xb')]),_0x24736c);}};exports[_0x2651('0x23')]=function(_0x1c74be){try{if(!_[_0x2651('0x24')](dials[_0x1c74be[_0x2651('0xb')]])){utils['debug'](util[_0x2651('0x3')]('[%s][dials][dialend]',_0x1c74be[_0x2651('0xb')]),_0x1c74be);dials[_0x1c74be[_0x2651('0xb')]][_0x2651('0x8')]=_0x1c74be['dialstatus'];if(_0x1c74be[_0x2651('0x8')]==_0x2651('0x25')){dials[_0x1c74be[_0x2651('0xb')]]=_[_0x2651('0x26')](dials[_0x1c74be['uniqueid']],_0x1c74be);dials[_0x1c74be[_0x2651('0xb')]][_0x2651('0x27')]=utils[_0x2651('0x1f')]();dials[_0x1c74be[_0x2651('0xb')]][_0x2651('0x20')]=_0x2651('0x28');utils['info'](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x1c74be[_0x2651('0xb')],_0x1c74be['dialstatus'],dials[_0x1c74be[_0x2651('0xb')]]['answertime']));}else{utils['info'](util['format'](_0x2651('0x29'),_0x1c74be[_0x2651('0xb')],_0x1c74be['dialstatus']));}}}catch(_0x490cb3){utils[_0x2651('0x16')](util[_0x2651('0x3')](_0x2651('0x2a'),_0x1c74be[_0x2651('0xb')]),_0x490cb3);}};exports[_0x2651('0x2b')]=function(_0x5d3445){try{if(!_[_0x2651('0x24')](dials[_0x5d3445[_0x2651('0xb')]])){utils[_0x2651('0xd')](util['format'](_0x2651('0x2c'),_0x5d3445['uniqueid']),_0x5d3445);utils[_0x2651('0x2')](util[_0x2651('0x3')](_0x2651('0x2d'),_0x5d3445[_0x2651('0xb')],_0x5d3445['calleridnum'],_0x5d3445['calleridname'],_0x5d3445['cause-txt']));dials[_0x5d3445[_0x2651('0xb')]]=_[_0x2651('0x26')](dials[_0x5d3445[_0x2651('0xb')]],{'endtime':utils[_0x2651('0x1f')](),'lastevent':'complete'});dials[_0x5d3445[_0x2651('0xb')]][_0x2651('0x2e')]=utils[_0x2651('0x2f')](dials[_0x5d3445[_0x2651('0xb')]][_0x2651('0x30')],dials[_0x5d3445[_0x2651('0xb')]][_0x2651('0x1e')]);dials[_0x5d3445[_0x2651('0xb')]][_0x2651('0x31')]=utils['diffTime'](dials[_0x5d3445[_0x2651('0xb')]]['answertime']||dials[_0x5d3445['uniqueid']][_0x2651('0x30')],dials[_0x5d3445[_0x2651('0xb')]][_0x2651('0x1e')]);dials[_0x5d3445[_0x2651('0xb')]][_0x2651('0x32')]=dials[_0x5d3445[_0x2651('0xb')]]['answertime']?utils[_0x2651('0x2f')](dials[_0x5d3445[_0x2651('0xb')]][_0x2651('0x30')],dials[_0x5d3445['uniqueid']][_0x2651('0x27')]):0x0;writeDB(dials[_0x5d3445[_0x2651('0xb')]]);}}catch(_0x121aaa){utils['error'](util[_0x2651('0x3')](_0x2651('0x2c'),_0x5d3445['uniqueid']),_0x121aaa);}}; \ No newline at end of file +var _0xf148=['complete','diffTime','endtime','holdtime','billableseconds','util','./utils','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','calleridnum','dialstatus','CreateVoiceDialReport','uniqueid','debug','format','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','startsWith','appdata','toLowerCase','cdr(routeid)','error','[%s][dials][newexten]','varset','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','[%s][dials][dialend]','assign','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt'];(function(_0x161d1d,_0x1cb38a){var _0xbd4bb1=function(_0x3da144){while(--_0x3da144){_0x161d1d['push'](_0x161d1d['shift']());}};_0xbd4bb1(++_0x1cb38a);}(_0xf148,0x1ac));var _0x8f14=function(_0x10729c,_0x205305){_0x10729c=_0x10729c-0x0;var _0x271e69=_0xf148[_0x10729c];return _0x271e69;};'use strict';var _=require('lodash');var util=require(_0x8f14('0x0'));var utils=require(_0x8f14('0x1'));var dials={};function writeDB(_0x196259){utils['info'](util['format'](_0x8f14('0x2'),_0x196259['uniqueid'],_0x196259['channel'],_0x196259[_0x8f14('0x3')],_0x196259[_0x8f14('0x4')],_0x196259['connectedlinenum'],_0x196259[_0x8f14('0x5')]));utils['request'](_0x8f14('0x6'),_0x196259);delete dials[_0x196259[_0x8f14('0x7')]];}exports['newexten']=function(_0xe3c7f8){try{utils[_0x8f14('0x8')](util[_0x8f14('0x9')]('[%s][dials][newexten]',_0xe3c7f8[_0x8f14('0x7')]),_0xe3c7f8);utils[_0x8f14('0xa')](util[_0x8f14('0x9')](_0x8f14('0xb'),_0xe3c7f8[_0x8f14('0x7')],_0xe3c7f8[_0x8f14('0xc')],_0xe3c7f8['appdata']));if(_0xe3c7f8[_0x8f14('0xc')]['toLowerCase']()=='set'&&_[_0x8f14('0xd')](_0xe3c7f8[_0x8f14('0xe')][_0x8f14('0xf')](),_0x8f14('0x10'))){var _0x2a1373=_0xe3c7f8[_0x8f14('0xe')]['split']('=');dials[_0xe3c7f8[_0x8f14('0x7')]]={'routeId':_0x2a1373[0x1]};}}catch(_0x1cfe37){utils[_0x8f14('0x11')](util[_0x8f14('0x9')](_0x8f14('0x12'),_0xe3c7f8[_0x8f14('0x7')]),_0x1cfe37);}};exports[_0x8f14('0x13')]=function(_0x3cf057){try{utils[_0x8f14('0x8')](util[_0x8f14('0x9')]('[%s][dials][varset]',_0x3cf057[_0x8f14('0x7')]),_0x3cf057);if(!_[_0x8f14('0x14')](_0x3cf057[_0x8f14('0x15')][_0x8f14('0x16')])){utils['info'](util[_0x8f14('0x9')](_0x8f14('0x17'),_0x3cf057[_0x8f14('0x7')],_0x3cf057[_0x8f14('0x18')]));dials[_0x3cf057['uniqueid']]={'routeId':_0x3cf057[_0x8f14('0x18')]};}}catch(_0x26e08d){utils[_0x8f14('0x11')](util['format'](_0x8f14('0x19'),_0x3cf057[_0x8f14('0x7')]),_0x26e08d);}};exports[_0x8f14('0x1a')]=function(_0x42a52a){try{if(!_['isNil'](dials[_0x42a52a['uniqueid']])){utils['debug'](util[_0x8f14('0x9')]('[%s][dials][dialbegin]',_0x42a52a[_0x8f14('0x7')]),_0x42a52a);dials[_0x42a52a[_0x8f14('0x7')]]=_['assign'](dials[_0x42a52a[_0x8f14('0x7')]],_0x42a52a);dials[_0x42a52a[_0x8f14('0x7')]][_0x8f14('0x1b')]=utils[_0x8f14('0x1c')]();dials[_0x42a52a['uniqueid']][_0x8f14('0x1d')]=_0x8f14('0x1e');utils[_0x8f14('0xa')](util[_0x8f14('0x9')](_0x8f14('0x1f'),_0x42a52a['uniqueid'],dials[_0x42a52a[_0x8f14('0x7')]][_0x8f14('0x1b')]));}}catch(_0xf78124){utils[_0x8f14('0x11')](util[_0x8f14('0x9')](_0x8f14('0x20'),_0x42a52a[_0x8f14('0x7')]),_0xf78124);}};exports['dialend']=function(_0x24a40e){try{if(!_[_0x8f14('0x14')](dials[_0x24a40e[_0x8f14('0x7')]])){utils[_0x8f14('0x8')](util[_0x8f14('0x9')](_0x8f14('0x21'),_0x24a40e['uniqueid']),_0x24a40e);dials[_0x24a40e[_0x8f14('0x7')]][_0x8f14('0x5')]=_0x24a40e[_0x8f14('0x5')];if(_0x24a40e[_0x8f14('0x5')]=='ANSWER'){dials[_0x24a40e[_0x8f14('0x7')]]=_[_0x8f14('0x22')](dials[_0x24a40e[_0x8f14('0x7')]],_0x24a40e);dials[_0x24a40e[_0x8f14('0x7')]]['answertime']=utils[_0x8f14('0x1c')]();dials[_0x24a40e[_0x8f14('0x7')]][_0x8f14('0x1d')]=_0x8f14('0x23');utils['info'](util[_0x8f14('0x9')](_0x8f14('0x24'),_0x24a40e[_0x8f14('0x7')],_0x24a40e[_0x8f14('0x5')],dials[_0x24a40e[_0x8f14('0x7')]][_0x8f14('0x25')]));}else{utils[_0x8f14('0xa')](util[_0x8f14('0x9')]('[%s][dials][dialend]\x20dialstatus:%s',_0x24a40e[_0x8f14('0x7')],_0x24a40e[_0x8f14('0x5')]));}}}catch(_0x663de1){utils[_0x8f14('0x11')](util[_0x8f14('0x9')]('[%s][dials][dialend]',_0x24a40e[_0x8f14('0x7')]),_0x663de1);}};exports['hangup']=function(_0x1abd3a){try{if(!_['isNil'](dials[_0x1abd3a['uniqueid']])){utils[_0x8f14('0x8')](util[_0x8f14('0x9')](_0x8f14('0x26'),_0x1abd3a['uniqueid']),_0x1abd3a);utils['info'](util[_0x8f14('0x9')](_0x8f14('0x27'),_0x1abd3a[_0x8f14('0x7')],_0x1abd3a['calleridnum'],_0x1abd3a[_0x8f14('0x28')],_0x1abd3a[_0x8f14('0x29')]));dials[_0x1abd3a[_0x8f14('0x7')]]=_[_0x8f14('0x22')](dials[_0x1abd3a[_0x8f14('0x7')]],{'endtime':utils['now'](),'lastevent':_0x8f14('0x2a')});dials[_0x1abd3a[_0x8f14('0x7')]]['duration']=utils[_0x8f14('0x2b')](dials[_0x1abd3a[_0x8f14('0x7')]][_0x8f14('0x2c')],dials[_0x1abd3a['uniqueid']][_0x8f14('0x1b')]);dials[_0x1abd3a['uniqueid']][_0x8f14('0x2d')]=utils['diffTime'](dials[_0x1abd3a[_0x8f14('0x7')]][_0x8f14('0x25')]||dials[_0x1abd3a[_0x8f14('0x7')]]['endtime'],dials[_0x1abd3a[_0x8f14('0x7')]]['starttime']);dials[_0x1abd3a[_0x8f14('0x7')]][_0x8f14('0x2e')]=dials[_0x1abd3a[_0x8f14('0x7')]][_0x8f14('0x25')]?utils['diffTime'](dials[_0x1abd3a[_0x8f14('0x7')]]['endtime'],dials[_0x1abd3a[_0x8f14('0x7')]][_0x8f14('0x25')]):0x0;writeDB(dials[_0x1abd3a[_0x8f14('0x7')]]);}}catch(_0x5de57c){utils[_0x8f14('0x11')](util[_0x8f14('0x9')](_0x8f14('0x26'),_0x1abd3a[_0x8f14('0x7')]),_0x5de57c);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 7715ee8..522fc64 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 _0xe0d8=['uniqueid','[%s][index][agentcalled]','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','[%s][index][attendedtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','port','asterisk','username','password','keepConnected','xdr','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','devicestatechange','device','agentcalled'];(function(_0x48628e,_0x393ec1){var _0x185426=function(_0x43369e){while(--_0x43369e){_0x48628e['push'](_0x48628e['shift']());}};_0x185426(++_0x393ec1);}(_0xe0d8,0x13a));var _0x8e0d=function(_0x2f37e0,_0x393ef9){_0x2f37e0=_0x2f37e0-0x0;var _0x43ccce=_0xe0d8[_0x2f37e0];return _0x43ccce;};var AsteriskManager=require(_0x8e0d('0x0'));var config=require(_0x8e0d('0x1'));var utils=require(_0x8e0d('0x2'));var util=require(_0x8e0d('0x3'));var ami=new AsteriskManager(config['asterisk'][_0x8e0d('0x4')],config[_0x8e0d('0x5')]['ip'],config[_0x8e0d('0x5')][_0x8e0d('0x6')],config['asterisk'][_0x8e0d('0x7')],!![]);ami[_0x8e0d('0x8')]();if(config[_0x8e0d('0x9')]&&config[_0x8e0d('0x9')]['disabled']){utils['info'](_0x8e0d('0xa'));}else{var agents=require(_0x8e0d('0xb'));var calls=require(_0x8e0d('0xc'));var queues=require(_0x8e0d('0xd'));var recordings=require(_0x8e0d('0xe'));var members=require(_0x8e0d('0xf'));var dials=require(_0x8e0d('0x10'));var transfers=require(_0x8e0d('0x11'));var core=require(_0x8e0d('0x12'));ami['on'](_0x8e0d('0x13'),core[_0x8e0d('0x13')]);ami['on'](_0x8e0d('0x14'),core['shutdown']);ami['on']('fullybooted',core[_0x8e0d('0x15')]);ami['on']('error',core[_0x8e0d('0x16')]);ami['on'](_0x8e0d('0x17'),core['close']);ami['on'](_0x8e0d('0x18'),core[_0x8e0d('0x18')]);ami['on']('devicestatechange',function(_0x1ab83c){try{utils[_0x8e0d('0x19')](util[_0x8e0d('0x1a')](_0x8e0d('0x1b'),_0x1ab83c['device']),_0x1ab83c);members[_0x8e0d('0x1c')](_0x1ab83c);}catch(_0x2e11eb){utils[_0x8e0d('0x16')](util[_0x8e0d('0x1a')](_0x8e0d('0x1b'),_0x1ab83c[_0x8e0d('0x1d')]),_0x2e11eb);}});ami['on'](_0x8e0d('0x1e'),function(_0x395acd){try{utils['debug'](util[_0x8e0d('0x1a')]('[%s][index][agentcalled]',_0x395acd[_0x8e0d('0x1f')]),_0x395acd);agents['agentcalled'](_0x395acd);}catch(_0x1799f3){utils['error'](util[_0x8e0d('0x1a')](_0x8e0d('0x20'),_0x395acd[_0x8e0d('0x1f')]),_0x1799f3);}});ami['on']('agentringnoanswer',function(_0x8dba84){try{utils[_0x8e0d('0x19')](util[_0x8e0d('0x1a')](_0x8e0d('0x21'),_0x8dba84[_0x8e0d('0x1f')]),_0x8dba84);agents[_0x8e0d('0x22')](_0x8dba84);}catch(_0x312102){utils[_0x8e0d('0x16')](util[_0x8e0d('0x1a')](_0x8e0d('0x21'),_0x8dba84[_0x8e0d('0x1f')]),_0x312102);}});ami['on']('agentconnect',function(_0x3d65fd){try{utils[_0x8e0d('0x19')](util[_0x8e0d('0x1a')]('[%s][index][agentconnect]',_0x3d65fd['uniqueid']),_0x3d65fd);agents[_0x8e0d('0x23')](_0x3d65fd);queues['agentconnect'](_0x3d65fd);}catch(_0x15089d){utils[_0x8e0d('0x16')](util[_0x8e0d('0x1a')]('[%s][index][agentconnect]',_0x3d65fd['uniqueid']),_0x15089d);}});ami['on'](_0x8e0d('0x24'),function(_0x339aed){try{utils['debug'](util[_0x8e0d('0x1a')](_0x8e0d('0x25'),_0x339aed['uniqueid']),_0x339aed);agents[_0x8e0d('0x24')](_0x339aed);queues['agentcomplete'](_0x339aed);members[_0x8e0d('0x24')](_0x339aed);}catch(_0x265af6){utils[_0x8e0d('0x16')](util['format'](_0x8e0d('0x25'),_0x339aed[_0x8e0d('0x1f')]),_0x265af6);}});ami['on']('queuecallerabandon',function(_0x1c4336){try{utils['debug'](util['format'](_0x8e0d('0x26'),_0x1c4336['uniqueid']),_0x1c4336);agents['queuecallerabandon'](_0x1c4336);queues[_0x8e0d('0x27')](_0x1c4336);}catch(_0x1806f8){utils[_0x8e0d('0x16')](util[_0x8e0d('0x1a')](_0x8e0d('0x26'),_0x1c4336[_0x8e0d('0x1f')]),_0x1806f8);}});ami['on'](_0x8e0d('0x28'),function(_0x3e574c){try{utils[_0x8e0d('0x19')](util[_0x8e0d('0x1a')](_0x8e0d('0x29'),_0x3e574c['uniqueid']),_0x3e574c);queues[_0x8e0d('0x28')](_0x3e574c);recordings[_0x8e0d('0x28')](_0x3e574c);}catch(_0x4c60f1){utils[_0x8e0d('0x16')](util['format'](_0x8e0d('0x29'),_0x3e574c['uniqueid']),_0x4c60f1);}});ami['on']('queuecallerleave',function(_0x1ae9ee){try{utils[_0x8e0d('0x19')](util['format']('[%s][index][queuecallerleave]',_0x1ae9ee[_0x8e0d('0x1f')]),_0x1ae9ee);queues[_0x8e0d('0x2a')](_0x1ae9ee);}catch(_0xc746fd){utils[_0x8e0d('0x16')](util['format'](_0x8e0d('0x2b'),_0x1ae9ee[_0x8e0d('0x1f')]),_0xc746fd);}});ami['on'](_0x8e0d('0x2c'),function(_0x35d0ef){try{utils[_0x8e0d('0x19')](util[_0x8e0d('0x1a')]('[%s][index][musiconholdstart]',_0x35d0ef[_0x8e0d('0x1f')]),_0x35d0ef);queues[_0x8e0d('0x2c')](_0x35d0ef);calls[_0x8e0d('0x2c')](_0x35d0ef);}catch(_0x23191d){utils[_0x8e0d('0x16')](util[_0x8e0d('0x1a')](_0x8e0d('0x2d'),_0x35d0ef['uniqueid']),_0x23191d);}});ami['on'](_0x8e0d('0x2e'),function(_0x280ca3){try{utils[_0x8e0d('0x19')](util[_0x8e0d('0x1a')](_0x8e0d('0x2f'),_0x280ca3[_0x8e0d('0x1f')]),_0x280ca3);queues['musiconholdstop'](_0x280ca3);calls[_0x8e0d('0x2e')](_0x280ca3);}catch(_0xaca5f3){utils[_0x8e0d('0x16')](util['format'](_0x8e0d('0x2f'),_0x280ca3[_0x8e0d('0x1f')]),_0xaca5f3);}});ami['on'](_0x8e0d('0x30'),function(_0x4d8cca){try{utils[_0x8e0d('0x19')](util[_0x8e0d('0x1a')]('[%s][index][newstate]',_0x4d8cca[_0x8e0d('0x1f')]),_0x4d8cca);calls[_0x8e0d('0x30')](_0x4d8cca);recordings[_0x8e0d('0x30')](_0x4d8cca);}catch(_0x5988ea){utils['error'](util[_0x8e0d('0x1a')]('[%s][index][newstate]',_0x4d8cca[_0x8e0d('0x1f')]),_0x5988ea);}});ami['on'](_0x8e0d('0x31'),function(_0x38e01d){try{utils[_0x8e0d('0x19')](util['format'](_0x8e0d('0x32'),_0x38e01d[_0x8e0d('0x1f')]),_0x38e01d);calls[_0x8e0d('0x31')](_0x38e01d);recordings[_0x8e0d('0x31')](_0x38e01d);dials[_0x8e0d('0x31')](_0x38e01d);agents['hangup'](_0x38e01d);queues[_0x8e0d('0x31')](_0x38e01d);}catch(_0x4512f9){utils[_0x8e0d('0x16')](util[_0x8e0d('0x1a')](_0x8e0d('0x32'),_0x38e01d[_0x8e0d('0x1f')]),_0x4512f9);}});ami['on'](_0x8e0d('0x33'),function(_0x2f6f13){try{utils[_0x8e0d('0x19')](util[_0x8e0d('0x1a')]('[%s][index][cdr]',_0x2f6f13[_0x8e0d('0x1f')]),_0x2f6f13);members[_0x8e0d('0x33')](_0x2f6f13);}catch(_0x3f1ae5){utils[_0x8e0d('0x16')](util[_0x8e0d('0x1a')](_0x8e0d('0x34'),_0x2f6f13[_0x8e0d('0x1f')]),_0x3f1ae5);}});ami['on']('blindtransfer',function(_0x5e40c0){try{utils[_0x8e0d('0x19')](util['format'](_0x8e0d('0x35'),_0x5e40c0[_0x8e0d('0x1f')]),_0x5e40c0);queues[_0x8e0d('0x36')](_0x5e40c0);agents[_0x8e0d('0x36')](_0x5e40c0);transfers[_0x8e0d('0x36')](_0x5e40c0);recordings[_0x8e0d('0x36')](_0x5e40c0);}catch(_0xb66998){utils['error'](util[_0x8e0d('0x1a')](_0x8e0d('0x35'),_0x5e40c0['uniqueid']),_0xb66998);}});ami['on']('attendedtransfer',function(_0x50d4d4){try{utils[_0x8e0d('0x19')](util[_0x8e0d('0x1a')](_0x8e0d('0x37'),_0x50d4d4['origtransfereruniqueid']),_0x50d4d4);queues['attendedtransfer'](_0x50d4d4);transfers[_0x8e0d('0x38')](_0x50d4d4);agents['attendedtransfer'](_0x50d4d4);calls['attendedtransfer'](_0x50d4d4);}catch(_0x3d60a8){utils['error'](util[_0x8e0d('0x1a')](_0x8e0d('0x37'),_0x50d4d4[_0x8e0d('0x39')]),_0x3d60a8);}});ami['on'](_0x8e0d('0x3a'),function(_0x813b3e){try{utils['debug'](util['format'](_0x8e0d('0x3b'),_0x813b3e['uniqueid']),_0x813b3e);queues['varset'](_0x813b3e);recordings[_0x8e0d('0x3a')](_0x813b3e);calls[_0x8e0d('0x3a')](_0x813b3e);dials[_0x8e0d('0x3a')](_0x813b3e);}catch(_0x54bfb0){utils[_0x8e0d('0x16')](util['format']('[%s][index][varset]',_0x813b3e['uniqueid']),_0x54bfb0);}});ami['on'](_0x8e0d('0x3c'),function(_0x326236){try{utils[_0x8e0d('0x19')](util[_0x8e0d('0x1a')](_0x8e0d('0x3d'),_0x326236[_0x8e0d('0x1f')]),_0x326236);calls['newexten'](_0x326236);recordings[_0x8e0d('0x3c')](_0x326236);dials[_0x8e0d('0x3c')](_0x326236);}catch(_0x413522){utils[_0x8e0d('0x16')](util[_0x8e0d('0x1a')](_0x8e0d('0x3d'),_0x326236['uniqueid']),_0x413522);}});ami['on']('newchannel',function(_0xe69706){try{utils[_0x8e0d('0x19')](util['format']('[%s][index][newchannel]',_0xe69706[_0x8e0d('0x1f')]),_0xe69706);calls['newchannel'](_0xe69706);recordings[_0x8e0d('0x3e')](_0xe69706);}catch(_0xd0ef4b){utils[_0x8e0d('0x16')](util[_0x8e0d('0x1a')](_0x8e0d('0x3f'),_0xe69706[_0x8e0d('0x1f')]),_0xd0ef4b);}});ami['on'](_0x8e0d('0x40'),function(_0x3f6088){try{utils[_0x8e0d('0x19')](util[_0x8e0d('0x1a')](_0x8e0d('0x41'),_0x3f6088[_0x8e0d('0x1f')]),_0x3f6088);dials[_0x8e0d('0x40')](_0x3f6088);}catch(_0x4a0bbc){utils[_0x8e0d('0x16')](util[_0x8e0d('0x1a')](_0x8e0d('0x42'),_0x3f6088[_0x8e0d('0x1f')]),_0x4a0bbc);}});ami['on'](_0x8e0d('0x43'),function(_0x84a1c8){try{utils[_0x8e0d('0x19')](util[_0x8e0d('0x1a')]('[%s][index][dialend]',_0x84a1c8[_0x8e0d('0x1f')]),_0x84a1c8);dials[_0x8e0d('0x43')](_0x84a1c8);}catch(_0x1bf5f9){utils[_0x8e0d('0x16')](util[_0x8e0d('0x1a')](_0x8e0d('0x44'),_0x84a1c8[_0x8e0d('0x1f')]),_0x1bf5f9);}});} \ No newline at end of file +var _0x7343=['username','password','info','XDR\x20DISABLED','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','format','device','devicestatechange','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','debug','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][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]','./utils','util','asterisk','port'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x7343,0xbc));var _0x3734=function(_0x1687fa,_0x33c7eb){_0x1687fa=_0x1687fa-0x0;var _0x201deb=_0x7343[_0x1687fa];return _0x201deb;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x3734('0x0'));var util=require(_0x3734('0x1'));var ami=new AsteriskManager(config[_0x3734('0x2')][_0x3734('0x3')],config['asterisk']['ip'],config[_0x3734('0x2')][_0x3734('0x4')],config[_0x3734('0x2')][_0x3734('0x5')],!![]);ami['keepConnected']();if(config['xdr']&&config['xdr']['disabled']){utils[_0x3734('0x6')](_0x3734('0x7'));}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0x3734('0x8'));var recordings=require(_0x3734('0x9'));var members=require(_0x3734('0xa'));var dials=require(_0x3734('0xb'));var transfers=require(_0x3734('0xc'));var core=require(_0x3734('0xd'));ami['on']('connect',core[_0x3734('0xe')]);ami['on'](_0x3734('0xf'),core['shutdown']);ami['on'](_0x3734('0x10'),core[_0x3734('0x10')]);ami['on'](_0x3734('0x11'),core[_0x3734('0x11')]);ami['on']('close',core[_0x3734('0x12')]);ami['on'](_0x3734('0x13'),core['managerevent']);ami['on']('devicestatechange',function(_0x933063){try{utils['debug'](util[_0x3734('0x14')]('[%s][index][devicestatechange]',_0x933063[_0x3734('0x15')]),_0x933063);members[_0x3734('0x16')](_0x933063);}catch(_0x291dee){utils[_0x3734('0x11')](util[_0x3734('0x14')]('[%s][index][devicestatechange]',_0x933063['device']),_0x291dee);}});ami['on'](_0x3734('0x17'),function(_0x4eca70){try{utils['debug'](util[_0x3734('0x14')](_0x3734('0x18'),_0x4eca70[_0x3734('0x19')]),_0x4eca70);agents[_0x3734('0x17')](_0x4eca70);}catch(_0x449674){utils[_0x3734('0x11')](util[_0x3734('0x14')]('[%s][index][agentcalled]',_0x4eca70[_0x3734('0x19')]),_0x449674);}});ami['on'](_0x3734('0x1a'),function(_0x2a7d59){try{utils[_0x3734('0x1b')](util['format'](_0x3734('0x1c'),_0x2a7d59[_0x3734('0x19')]),_0x2a7d59);agents['agentringnoanswer'](_0x2a7d59);}catch(_0x58892c){utils[_0x3734('0x11')](util[_0x3734('0x14')]('[%s][index][agentringnoanswer]',_0x2a7d59[_0x3734('0x19')]),_0x58892c);}});ami['on'](_0x3734('0x1d'),function(_0x48179b){try{utils[_0x3734('0x1b')](util[_0x3734('0x14')](_0x3734('0x1e'),_0x48179b[_0x3734('0x19')]),_0x48179b);agents[_0x3734('0x1d')](_0x48179b);queues[_0x3734('0x1d')](_0x48179b);}catch(_0x1efeff){utils[_0x3734('0x11')](util['format']('[%s][index][agentconnect]',_0x48179b[_0x3734('0x19')]),_0x1efeff);}});ami['on'](_0x3734('0x1f'),function(_0x18bc0c){try{utils[_0x3734('0x1b')](util[_0x3734('0x14')](_0x3734('0x20'),_0x18bc0c['uniqueid']),_0x18bc0c);agents[_0x3734('0x1f')](_0x18bc0c);queues[_0x3734('0x1f')](_0x18bc0c);members[_0x3734('0x1f')](_0x18bc0c);}catch(_0x1d10c5){utils[_0x3734('0x11')](util[_0x3734('0x14')]('[%s][index][agentcomplete]',_0x18bc0c['uniqueid']),_0x1d10c5);}});ami['on'](_0x3734('0x21'),function(_0x47f619){try{utils[_0x3734('0x1b')](util[_0x3734('0x14')](_0x3734('0x22'),_0x47f619[_0x3734('0x19')]),_0x47f619);agents[_0x3734('0x21')](_0x47f619);queues[_0x3734('0x21')](_0x47f619);}catch(_0x43330b){utils['error'](util[_0x3734('0x14')](_0x3734('0x22'),_0x47f619['uniqueid']),_0x43330b);}});ami['on'](_0x3734('0x23'),function(_0x1c1e49){try{utils[_0x3734('0x1b')](util[_0x3734('0x14')](_0x3734('0x24'),_0x1c1e49[_0x3734('0x19')]),_0x1c1e49);queues[_0x3734('0x23')](_0x1c1e49);recordings[_0x3734('0x23')](_0x1c1e49);}catch(_0x35a426){utils[_0x3734('0x11')](util['format'](_0x3734('0x24'),_0x1c1e49[_0x3734('0x19')]),_0x35a426);}});ami['on'](_0x3734('0x25'),function(_0x46e949){try{utils[_0x3734('0x1b')](util[_0x3734('0x14')](_0x3734('0x26'),_0x46e949[_0x3734('0x19')]),_0x46e949);queues[_0x3734('0x25')](_0x46e949);}catch(_0x321ede){utils[_0x3734('0x11')](util[_0x3734('0x14')](_0x3734('0x26'),_0x46e949[_0x3734('0x19')]),_0x321ede);}});ami['on'](_0x3734('0x27'),function(_0x53ea3d){try{utils[_0x3734('0x1b')](util[_0x3734('0x14')]('[%s][index][musiconholdstart]',_0x53ea3d[_0x3734('0x19')]),_0x53ea3d);queues[_0x3734('0x27')](_0x53ea3d);calls[_0x3734('0x27')](_0x53ea3d);}catch(_0x404e5f){utils[_0x3734('0x11')](util[_0x3734('0x14')]('[%s][index][musiconholdstart]',_0x53ea3d[_0x3734('0x19')]),_0x404e5f);}});ami['on'](_0x3734('0x28'),function(_0x2c165e){try{utils[_0x3734('0x1b')](util[_0x3734('0x14')](_0x3734('0x29'),_0x2c165e['uniqueid']),_0x2c165e);queues[_0x3734('0x28')](_0x2c165e);calls['musiconholdstop'](_0x2c165e);}catch(_0x24295a){utils[_0x3734('0x11')](util[_0x3734('0x14')]('[%s][index][musiconholdstop]',_0x2c165e[_0x3734('0x19')]),_0x24295a);}});ami['on'](_0x3734('0x2a'),function(_0x5122c5){try{utils[_0x3734('0x1b')](util[_0x3734('0x14')]('[%s][index][newstate]',_0x5122c5['uniqueid']),_0x5122c5);calls[_0x3734('0x2a')](_0x5122c5);recordings['newstate'](_0x5122c5);}catch(_0x2b87b6){utils[_0x3734('0x11')](util[_0x3734('0x14')](_0x3734('0x2b'),_0x5122c5[_0x3734('0x19')]),_0x2b87b6);}});ami['on'](_0x3734('0x2c'),function(_0x2ed2c3){try{utils[_0x3734('0x1b')](util['format'](_0x3734('0x2d'),_0x2ed2c3[_0x3734('0x19')]),_0x2ed2c3);calls[_0x3734('0x2c')](_0x2ed2c3);recordings[_0x3734('0x2c')](_0x2ed2c3);dials[_0x3734('0x2c')](_0x2ed2c3);agents[_0x3734('0x2c')](_0x2ed2c3);queues['hangup'](_0x2ed2c3);}catch(_0x5af123){utils['error'](util[_0x3734('0x14')](_0x3734('0x2d'),_0x2ed2c3[_0x3734('0x19')]),_0x5af123);}});ami['on']('cdr',function(_0x5da86d){try{utils['debug'](util[_0x3734('0x14')](_0x3734('0x2e'),_0x5da86d['uniqueid']),_0x5da86d);members[_0x3734('0x2f')](_0x5da86d);}catch(_0x529a54){utils[_0x3734('0x11')](util[_0x3734('0x14')]('[%s][index][cdr]',_0x5da86d['uniqueid']),_0x529a54);}});ami['on'](_0x3734('0x30'),function(_0x40504b){try{utils['debug'](util[_0x3734('0x14')]('[%s][index][blindtransfer]',_0x40504b[_0x3734('0x19')]),_0x40504b);queues['blindtransfer'](_0x40504b);agents['blindtransfer'](_0x40504b);transfers[_0x3734('0x30')](_0x40504b);recordings[_0x3734('0x30')](_0x40504b);}catch(_0x5d3ea0){utils['error'](util[_0x3734('0x14')](_0x3734('0x31'),_0x40504b['uniqueid']),_0x5d3ea0);}});ami['on'](_0x3734('0x32'),function(_0x3b1576){try{utils[_0x3734('0x1b')](util['format'](_0x3734('0x33'),_0x3b1576[_0x3734('0x34')]),_0x3b1576);queues['attendedtransfer'](_0x3b1576);transfers['attendedtransfer'](_0x3b1576);agents['attendedtransfer'](_0x3b1576);calls[_0x3734('0x32')](_0x3b1576);}catch(_0x1a44dd){utils['error'](util['format'](_0x3734('0x33'),_0x3b1576[_0x3734('0x34')]),_0x1a44dd);}});ami['on'](_0x3734('0x35'),function(_0x50f554){try{utils[_0x3734('0x1b')](util[_0x3734('0x14')](_0x3734('0x36'),_0x50f554['uniqueid']),_0x50f554);queues[_0x3734('0x35')](_0x50f554);recordings[_0x3734('0x35')](_0x50f554);calls[_0x3734('0x35')](_0x50f554);dials[_0x3734('0x35')](_0x50f554);}catch(_0x54a260){utils[_0x3734('0x11')](util['format'](_0x3734('0x36'),_0x50f554[_0x3734('0x19')]),_0x54a260);}});ami['on']('newexten',function(_0x155ae1){try{utils[_0x3734('0x1b')](util[_0x3734('0x14')](_0x3734('0x37'),_0x155ae1[_0x3734('0x19')]),_0x155ae1);calls[_0x3734('0x38')](_0x155ae1);recordings[_0x3734('0x38')](_0x155ae1);dials['newexten'](_0x155ae1);}catch(_0x4b2f8f){utils[_0x3734('0x11')](util[_0x3734('0x14')]('[%s][index][newexten]',_0x155ae1[_0x3734('0x19')]),_0x4b2f8f);}});ami['on'](_0x3734('0x39'),function(_0x4eb1df){try{utils['debug'](util['format'](_0x3734('0x3a'),_0x4eb1df[_0x3734('0x19')]),_0x4eb1df);calls[_0x3734('0x39')](_0x4eb1df);recordings['newchannel'](_0x4eb1df);}catch(_0x5b7274){utils['error'](util[_0x3734('0x14')](_0x3734('0x3a'),_0x4eb1df['uniqueid']),_0x5b7274);}});ami['on'](_0x3734('0x3b'),function(_0x492d52){try{utils[_0x3734('0x1b')](util[_0x3734('0x14')](_0x3734('0x3c'),_0x492d52['uniqueid']),_0x492d52);dials[_0x3734('0x3b')](_0x492d52);}catch(_0x29ceb3){utils[_0x3734('0x11')](util[_0x3734('0x14')](_0x3734('0x3d'),_0x492d52[_0x3734('0x19')]),_0x29ceb3);}});ami['on'](_0x3734('0x3e'),function(_0x244b44){try{utils[_0x3734('0x1b')](util[_0x3734('0x14')](_0x3734('0x3f'),_0x244b44['uniqueid']),_0x244b44);dials[_0x3734('0x3e')](_0x244b44);}catch(_0x346c99){utils['error'](util['format'](_0x3734('0x3f'),_0x244b44[_0x3734('0x19')]),_0x346c99);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index f4a32af..0d425c1 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 _0x8ec1=['INUSE','BUSY','voice','now','agent','NOT_INUSE','isNil','diffTime','exitAt','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','assign','data2','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','source','util','./utils','Local/_attended@transfer','Queue:','info','uniqueid','interface','channel','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','split','error','format','[%s][members][writeDB]','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state'];(function(_0x5447a8,_0x45c8e9){var _0x4c586b=function(_0x344dee){while(--_0x344dee){_0x5447a8['push'](_0x5447a8['shift']());}};_0x4c586b(++_0x45c8e9);}(_0x8ec1,0x1e3));var _0x18ec=function(_0x5a213a,_0x2b4a23){_0x5a213a=_0x5a213a-0x0;var _0x3577b3=_0x8ec1[_0x5a213a];return _0x3577b3;};'use strict';var _=require('lodash');var util=require(_0x18ec('0x0'));var utils=require(_0x18ec('0x1'));var members={};var exclude=[_0x18ec('0x2'),_0x18ec('0x3')];function writeDB(_0x3cf2ab){utils[_0x18ec('0x4')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x3cf2ab[_0x18ec('0x5')],_0x3cf2ab[_0x18ec('0x6')],_0x3cf2ab[_0x18ec('0x7')],_0x3cf2ab['data2'],_0x3cf2ab[_0x18ec('0x8')],_0x3cf2ab[_0x18ec('0x9')]));if(_0x3cf2ab[_0x18ec('0x6')]){utils[_0x18ec('0xa')](_0x3cf2ab[_0x18ec('0x6')])[_0x18ec('0xb')](function(_0x3134e5){if(_0x3134e5){_0x3cf2ab['membername']=_0x3134e5[_0x18ec('0xc')];_0x3cf2ab[_0x18ec('0xd')]=_0x3134e5[_0x18ec('0xd')];utils[_0x18ec('0xe')](_0x18ec('0xf'),_0x3cf2ab);}else{utils['getUserByName'](_0x3cf2ab['interface'][_0x18ec('0x10')]('/')[0x1])[_0x18ec('0xb')](function(_0x3de3b1){if(_0x3de3b1){_0x3cf2ab['membername']=_0x3de3b1[_0x18ec('0xc')];_0x3cf2ab['internal']=_0x3de3b1[_0x18ec('0xd')];utils['request']('CreateMemberReport',_0x3cf2ab);}});}})['catch'](function(_0x3f912f){utils[_0x18ec('0x11')](util[_0x18ec('0x12')](_0x18ec('0x13'),_0x3cf2ab[_0x18ec('0x5')]),_0x3f912f);});}delete members[_0x3cf2ab[_0x18ec('0x6')]];}function startsWith(_0x564265,_0x58ed94){return _['some'](_0x564265,function(_0x2a5119){return _[_0x18ec('0x14')](_0x58ed94,_0x2a5119);});}exports[_0x18ec('0x15')]=function(_0x5d872e){try{utils[_0x18ec('0x16')](util[_0x18ec('0x12')](_0x18ec('0x17'),members[_0x5d872e['device']]?members[_0x5d872e[_0x18ec('0x18')]]['uniqueid']:_0x5d872e[_0x18ec('0x18')]),_0x5d872e);utils[_0x18ec('0x4')](util[_0x18ec('0x12')](_0x18ec('0x19'),members[_0x5d872e[_0x18ec('0x18')]]?members[_0x5d872e[_0x18ec('0x18')]][_0x18ec('0x5')]:_0x5d872e[_0x18ec('0x18')],_0x5d872e['state'],_0x5d872e[_0x18ec('0x18')]));switch(_0x5d872e[_0x18ec('0x1a')]){case _0x18ec('0x1b'):case _0x18ec('0x1c'):if(!startsWith(exclude,_0x5d872e[_0x18ec('0x18')])){members[_0x5d872e[_0x18ec('0x18')]]={'channel':_0x18ec('0x1d'),'interface':_0x5d872e['device'],'type':'TALKING','enterAt':utils[_0x18ec('0x1e')](),'role':_0x18ec('0x1f')};}break;case _0x18ec('0x20'):if(!_[_0x18ec('0x21')](members[_0x5d872e['device']])){members[_0x5d872e[_0x18ec('0x18')]]['exitAt']=utils[_0x18ec('0x1e')]();members[_0x5d872e[_0x18ec('0x18')]]['duration']=utils[_0x18ec('0x22')](members[_0x5d872e[_0x18ec('0x18')]][_0x18ec('0x23')],members[_0x5d872e[_0x18ec('0x18')]][_0x18ec('0x24')]);if(members[_0x5d872e[_0x18ec('0x18')]][_0x18ec('0x5')]){writeDB(members[_0x5d872e['device']]);}}break;default:break;}}catch(_0x1c4d31){utils['error'](util[_0x18ec('0x12')](_0x18ec('0x17'),members[_0x5d872e[_0x18ec('0x18')]]?members[_0x5d872e[_0x18ec('0x18')]][_0x18ec('0x5')]:_0x5d872e[_0x18ec('0x18')]),_0x1c4d31);}};exports[_0x18ec('0x25')]=function(_0xd237ab){try{if(!_['isNil'](members[_0xd237ab[_0x18ec('0x6')]])){utils[_0x18ec('0x16')](util[_0x18ec('0x12')]('[%s][members][agentcomplete]',_0xd237ab['uniqueid']),_0xd237ab);utils['info'](util[_0x18ec('0x12')](_0x18ec('0x26'),_0xd237ab[_0x18ec('0x5')],_0xd237ab['interface'],_0xd237ab[_0x18ec('0x27')]));members[_0xd237ab['interface']]=_['assign'](members[_0xd237ab[_0x18ec('0x6')]],{'data4':_0xd237ab[_0x18ec('0x27')],'uniqueid':_0xd237ab[_0x18ec('0x5')]});}}catch(_0x86cd0a){utils[_0x18ec('0x11')](util['format'](_0x18ec('0x28'),_0xd237ab[_0x18ec('0x5')]),_0x86cd0a);}};exports[_0x18ec('0x29')]=function(_0x31ba0d){try{utils[_0x18ec('0x16')](util[_0x18ec('0x12')](_0x18ec('0x2a'),_0x31ba0d[_0x18ec('0x5')]),_0x31ba0d);if(_0x31ba0d[_0x18ec('0x7')]){var _0xd1cdd=_0x31ba0d[_0x18ec('0x7')][_0x18ec('0x10')]('-')[0x0];if(!_[_0x18ec('0x21')](members[_0xd1cdd])){members[_0xd1cdd]=_[_0x18ec('0x2b')](members[_0xd1cdd],{'data1':members[_0xd1cdd]['data1']||_0x31ba0d[_0x18ec('0x9')],'data2':members[_0xd1cdd][_0x18ec('0x2c')]||_0x31ba0d['source'],'data3':members[_0xd1cdd][_0x18ec('0x2d')]||_0x31ba0d[_0x18ec('0x2e')],'uniqueid':members[_0xd1cdd][_0x18ec('0x5')]||_0x31ba0d['uniqueid']});utils[_0x18ec('0x4')](util[_0x18ec('0x12')](_0x18ec('0x2f'),_0x31ba0d[_0x18ec('0x5')],members[_0xd1cdd][_0x18ec('0x30')],members[_0xd1cdd][_0x18ec('0x2c')],members[_0xd1cdd][_0x18ec('0x2d')]));if(members[_0xd1cdd][_0x18ec('0x23')]){writeDB(members[_0xd1cdd]);}}}if(_0x31ba0d[_0x18ec('0x31')]){var _0x287feb=_0x31ba0d[_0x18ec('0x31')][_0x18ec('0x10')]('-')[0x0];if(!_[_0x18ec('0x21')](members[_0x287feb])){members[_0x287feb]=_['assign'](members[_0x287feb],{'data1':members[_0x287feb]['data1']||_0x31ba0d['type'],'data2':members[_0x287feb][_0x18ec('0x2c')]||_0x31ba0d[_0x18ec('0x32')],'data3':members[_0x287feb]['data3']||_0x31ba0d[_0x18ec('0x2e')],'uniqueid':members[_0x287feb][_0x18ec('0x5')]||_0x31ba0d[_0x18ec('0x5')]});utils[_0x18ec('0x4')](util[_0x18ec('0x12')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x31ba0d['uniqueid'],members[_0x287feb][_0x18ec('0x30')],members[_0x287feb][_0x18ec('0x2c')],members[_0x287feb][_0x18ec('0x2d')]));if(members[_0x287feb][_0x18ec('0x23')]){writeDB(members[_0x287feb]);}}}}catch(_0x5cf5fa){utils[_0x18ec('0x11')](util[_0x18ec('0x12')]('[%s][members][cdr]',_0x31ba0d[_0x18ec('0x5')]),_0x5cf5fa);}}; \ No newline at end of file +var _0xa85d=['lodash','util','./utils','Queue:','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','CreateMemberReport','getUserByName','split','internal','request','error','[%s][members][writeDB]','some','devicestatechange','debug','[%s][members][devicestatechange]','device','info','format','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','[%s][members][agentcomplete]','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel'];(function(_0x45161c,_0x5494fc){var _0x186581=function(_0x78fada){while(--_0x78fada){_0x45161c['push'](_0x45161c['shift']());}};_0x186581(++_0x5494fc);}(_0xa85d,0x68));var _0xda85=function(_0x3f4315,_0xd6ec89){_0x3f4315=_0x3f4315-0x0;var _0x5842e3=_0xa85d[_0x3f4315];return _0x5842e3;};'use strict';var _=require(_0xda85('0x0'));var util=require(_0xda85('0x1'));var utils=require(_0xda85('0x2'));var members={};var exclude=['Local/_attended@transfer',_0xda85('0x3')];function writeDB(_0x4a5b5f){utils['info'](util['format'](_0xda85('0x4'),_0x4a5b5f[_0xda85('0x5')],_0x4a5b5f[_0xda85('0x6')],_0x4a5b5f[_0xda85('0x7')],_0x4a5b5f[_0xda85('0x8')],_0x4a5b5f[_0xda85('0x9')],_0x4a5b5f[_0xda85('0xa')]));if(_0x4a5b5f[_0xda85('0x6')]){utils[_0xda85('0xb')](_0x4a5b5f[_0xda85('0x6')])[_0xda85('0xc')](function(_0x33ec13){if(_0x33ec13){_0x4a5b5f[_0xda85('0x9')]=_0x33ec13[_0xda85('0xd')];_0x4a5b5f['internal']=_0x33ec13['internal'];utils['request'](_0xda85('0xe'),_0x4a5b5f);}else{utils[_0xda85('0xf')](_0x4a5b5f[_0xda85('0x6')][_0xda85('0x10')]('/')[0x1])[_0xda85('0xc')](function(_0x4e56cd){if(_0x4e56cd){_0x4a5b5f[_0xda85('0x9')]=_0x4e56cd[_0xda85('0xd')];_0x4a5b5f[_0xda85('0x11')]=_0x4e56cd[_0xda85('0x11')];utils[_0xda85('0x12')](_0xda85('0xe'),_0x4a5b5f);}});}})['catch'](function(_0x14cb3f){utils[_0xda85('0x13')](util['format'](_0xda85('0x14'),_0x4a5b5f['uniqueid']),_0x14cb3f);});}delete members[_0x4a5b5f[_0xda85('0x6')]];}function startsWith(_0x3716a4,_0x2a62c9){return _[_0xda85('0x15')](_0x3716a4,function(_0x240d5c){return _['startsWith'](_0x2a62c9,_0x240d5c);});}exports[_0xda85('0x16')]=function(_0x5b42f1){try{utils[_0xda85('0x17')](util['format'](_0xda85('0x18'),members[_0x5b42f1[_0xda85('0x19')]]?members[_0x5b42f1[_0xda85('0x19')]][_0xda85('0x5')]:_0x5b42f1[_0xda85('0x19')]),_0x5b42f1);utils[_0xda85('0x1a')](util[_0xda85('0x1b')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x5b42f1[_0xda85('0x19')]]?members[_0x5b42f1['device']]['uniqueid']:_0x5b42f1[_0xda85('0x19')],_0x5b42f1[_0xda85('0x1c')],_0x5b42f1[_0xda85('0x19')]));switch(_0x5b42f1[_0xda85('0x1c')]){case _0xda85('0x1d'):case _0xda85('0x1e'):if(!startsWith(exclude,_0x5b42f1[_0xda85('0x19')])){members[_0x5b42f1['device']]={'channel':_0xda85('0x1f'),'interface':_0x5b42f1[_0xda85('0x19')],'type':_0xda85('0x20'),'enterAt':utils[_0xda85('0x21')](),'role':_0xda85('0x22')};}break;case _0xda85('0x23'):if(!_[_0xda85('0x24')](members[_0x5b42f1[_0xda85('0x19')]])){members[_0x5b42f1[_0xda85('0x19')]][_0xda85('0x25')]=utils[_0xda85('0x21')]();members[_0x5b42f1[_0xda85('0x19')]][_0xda85('0x26')]=utils['diffTime'](members[_0x5b42f1['device']][_0xda85('0x25')],members[_0x5b42f1['device']][_0xda85('0x27')]);if(members[_0x5b42f1['device']]['uniqueid']){writeDB(members[_0x5b42f1['device']]);}}break;default:break;}}catch(_0x423a2f){utils[_0xda85('0x13')](util[_0xda85('0x1b')]('[%s][members][devicestatechange]',members[_0x5b42f1[_0xda85('0x19')]]?members[_0x5b42f1[_0xda85('0x19')]][_0xda85('0x5')]:_0x5b42f1[_0xda85('0x19')]),_0x423a2f);}};exports[_0xda85('0x28')]=function(_0x173fe4){try{if(!_['isNil'](members[_0x173fe4[_0xda85('0x6')]])){utils[_0xda85('0x17')](util[_0xda85('0x1b')]('[%s][members][agentcomplete]',_0x173fe4[_0xda85('0x5')]),_0x173fe4);utils[_0xda85('0x1a')](util[_0xda85('0x1b')](_0xda85('0x29'),_0x173fe4[_0xda85('0x5')],_0x173fe4[_0xda85('0x6')],_0x173fe4['queue']));members[_0x173fe4[_0xda85('0x6')]]=_[_0xda85('0x2a')](members[_0x173fe4[_0xda85('0x6')]],{'data4':_0x173fe4[_0xda85('0x2b')],'uniqueid':_0x173fe4['uniqueid']});}}catch(_0x89c552){utils[_0xda85('0x13')](util[_0xda85('0x1b')](_0xda85('0x2c'),_0x173fe4[_0xda85('0x5')]),_0x89c552);}};exports['cdr']=function(_0x120544){try{utils[_0xda85('0x17')](util[_0xda85('0x1b')](_0xda85('0x2d'),_0x120544[_0xda85('0x5')]),_0x120544);if(_0x120544[_0xda85('0x7')]){var _0x37dc65=_0x120544[_0xda85('0x7')]['split']('-')[0x0];if(!_[_0xda85('0x24')](members[_0x37dc65])){members[_0x37dc65]=_[_0xda85('0x2a')](members[_0x37dc65],{'data1':members[_0x37dc65][_0xda85('0x2e')]||_0x120544[_0xda85('0xa')],'data2':members[_0x37dc65][_0xda85('0x8')]||_0x120544[_0xda85('0x2f')],'data3':members[_0x37dc65][_0xda85('0x30')]||_0x120544[_0xda85('0x31')],'uniqueid':members[_0x37dc65][_0xda85('0x5')]||_0x120544[_0xda85('0x5')]});utils[_0xda85('0x1a')](util[_0xda85('0x1b')](_0xda85('0x32'),_0x120544[_0xda85('0x5')],members[_0x37dc65][_0xda85('0x2e')],members[_0x37dc65][_0xda85('0x8')],members[_0x37dc65][_0xda85('0x30')]));if(members[_0x37dc65][_0xda85('0x25')]){writeDB(members[_0x37dc65]);}}}if(_0x120544['destinationchannel']){var _0x337592=_0x120544[_0xda85('0x33')]['split']('-')[0x0];if(!_[_0xda85('0x24')](members[_0x337592])){members[_0x337592]=_[_0xda85('0x2a')](members[_0x337592],{'data1':members[_0x337592][_0xda85('0x2e')]||_0x120544[_0xda85('0xa')],'data2':members[_0x337592][_0xda85('0x8')]||_0x120544[_0xda85('0x2f')],'data3':members[_0x337592][_0xda85('0x30')]||_0x120544[_0xda85('0x31')],'uniqueid':members[_0x337592]['uniqueid']||_0x120544[_0xda85('0x5')]});utils['info'](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x120544[_0xda85('0x5')],members[_0x337592][_0xda85('0x2e')],members[_0x337592][_0xda85('0x8')],members[_0x337592]['data3']));if(members[_0x337592][_0xda85('0x25')]){writeDB(members[_0x337592]);}}}}catch(_0x4b49d3){utils[_0xda85('0x13')](util[_0xda85('0x1b')]('[%s][members][cdr]',_0x120544['uniqueid']),_0x4b49d3);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 4243bc5..49d5ee6 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 _0xdc5e=['[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferuniqueid','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','queuecallerenterreason','transfertargetuniqueid','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','calleridnum','accountcode','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][hangup]','varset','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerjoinAt','count','connectedlinenum','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]'];(function(_0x2265d0,_0x145b4f){var _0x27e4fa=function(_0x58361e){while(--_0x58361e){_0x2265d0['push'](_0x2265d0['shift']());}};_0x27e4fa(++_0x145b4f);}(_0xdc5e,0x1b6));var _0xedc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc5e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x5530ee){utils[_0xedc5('0x0')](util[_0xedc5('0x1')](_0xedc5('0x2'),_0x5530ee[_0xedc5('0x3')],_0x5530ee['channel'],_0x5530ee[_0xedc5('0x4')],_0x5530ee['lastAssignedTo'],_0x5530ee[_0xedc5('0x5')],_0x5530ee[_0xedc5('0x6')],_0x5530ee['queuecallerexitreason']));if(_0x5530ee[_0xedc5('0x4')]){utils[_0xedc5('0x7')](_0x5530ee[_0xedc5('0x4')])[_0xedc5('0x8')](function(_0x2f8b04){if(_0x2f8b04){_0x5530ee[_0xedc5('0x9')]=_0x2f8b04[_0xedc5('0x9')];}utils[_0xedc5('0xa')](_0xedc5('0xb'),_0x5530ee);});}else{utils['request'](_0xedc5('0xb'),_0x5530ee);}if(_0x5530ee[_0xedc5('0xc')]){delete queues[_0x5530ee['transfereduniqueid']];}else{delete queues[_0x5530ee[_0xedc5('0x3')]];}}exports['queuecallerjoin']=function(_0x4d2800){try{utils[_0xedc5('0xd')](util[_0xedc5('0x1')]('[%s][queues][queuecallerjoin]',_0x4d2800['uniqueid']),_0x4d2800);utils[_0xedc5('0x0')](util[_0xedc5('0x1')](_0xedc5('0xe'),_0x4d2800[_0xedc5('0x3')],_0x4d2800[_0xedc5('0x4')],_0x4d2800['position']));queues[_0x4d2800[_0xedc5('0x3')]]=_[_0xedc5('0xf')](_0x4d2800,{'originalposition':_0x4d2800[_0xedc5('0x10')],'queuecallerjoinAt':utils[_0xedc5('0x11')](),'mohtime':0x0});}catch(_0x1b4956){utils[_0xedc5('0x12')](util[_0xedc5('0x1')]('[%s][queues][queuecallerjoin]',_0x4d2800[_0xedc5('0x3')]),_0x1b4956);}};exports['hangup']=function(_0x312a3a){try{if(!_[_0xedc5('0x13')](queues[_0x312a3a[_0xedc5('0x3')]])){utils['debug'](util[_0xedc5('0x1')]('[%s][queues][hangup]',_0x312a3a[_0xedc5('0x3')]),_0x312a3a);if(queues[_0x312a3a[_0xedc5('0x3')]][_0xedc5('0x14')]){if(!queues[_0x312a3a['uniqueid']][_0xedc5('0x15')]&&!queues[_0x312a3a[_0xedc5('0x3')]][_0xedc5('0x16')]){queues[_0x312a3a[_0xedc5('0x3')]][_0xedc5('0x17')]=!![];queues[_0x312a3a[_0xedc5('0x3')]][_0xedc5('0x18')]=utils[_0xedc5('0x11')]();queues[_0x312a3a[_0xedc5('0x3')]][_0xedc5('0x19')]=_0xedc5('0x1a');}utils[_0xedc5('0x0')](util[_0xedc5('0x1')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x312a3a[_0xedc5('0x3')],queues[_0x312a3a[_0xedc5('0x3')]][_0xedc5('0x1b')],queues[_0x312a3a['uniqueid']][_0xedc5('0x19')]));writeDB(queues[_0x312a3a[_0xedc5('0x3')]]);}else if(queues[_0x312a3a[_0xedc5('0x3')]][_0xedc5('0xc')]){utils['info'](util[_0xedc5('0x1')](_0xedc5('0x1c'),_0x312a3a[_0xedc5('0x3')],queues[_0x312a3a[_0xedc5('0x3')]][_0xedc5('0x1b')],queues[_0x312a3a[_0xedc5('0x3')]][_0xedc5('0xc')]));queues[queues[_0x312a3a[_0xedc5('0x3')]]['transfereduniqueid']]=queues[_0x312a3a[_0xedc5('0x3')]];queues[queues[_0x312a3a['uniqueid']][_0xedc5('0xc')]]['queuecallerenterreason']=0x2;delete queues[_0x312a3a[_0xedc5('0x3')]];}}}catch(_0x449268){utils[_0xedc5('0x12')](util[_0xedc5('0x1')](_0xedc5('0x1d'),_0x312a3a[_0xedc5('0x3')]),_0x449268);}};exports[_0xedc5('0x1e')]=function(_0x3cfac1){try{utils[_0xedc5('0xd')](util['format']('[%s][queues][varset]',_0x3cfac1[_0xedc5('0x3')]),_0x3cfac1);if(!_[_0xedc5('0x13')](_0x3cfac1[_0xedc5('0x1f')]['queuestatus'])&&_0x3cfac1[_0xedc5('0x20')][_0xedc5('0x21')]()!==_0xedc5('0x22')){if(!_['isNil'](queues[_0x3cfac1[_0xedc5('0x3')]])){queues[_0x3cfac1['uniqueid']][_0xedc5('0x15')]=![];queues[_0x3cfac1['uniqueid']][_0xedc5('0x23')]=null;queues[_0x3cfac1[_0xedc5('0x3')]][_0xedc5('0x16')]=!![];queues[_0x3cfac1[_0xedc5('0x3')]][_0xedc5('0x24')]=utils[_0xedc5('0x11')]();queues[_0x3cfac1['uniqueid']]['queuecallerexitreason']=_0x3cfac1[_0xedc5('0x20')]['toUpperCase']();utils[_0xedc5('0x0')](util['format'](_0xedc5('0x25'),_0x3cfac1['uniqueid'],queues[_0x3cfac1['uniqueid']][_0xedc5('0x1b')],_0x3cfac1['value'],queues[_0x3cfac1[_0xedc5('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x3cfac1['uniqueid']]);}}else if(!_[_0xedc5('0x13')](_0x3cfac1[_0xedc5('0x1f')][_0xedc5('0x26')])){if(!_[_0xedc5('0x13')](queues[_0x3cfac1[_0xedc5('0x3')]])&&!queues[_0x3cfac1[_0xedc5('0x3')]][_0xedc5('0x15')]){queues[_0x3cfac1[_0xedc5('0x3')]][_0xedc5('0x15')]=![];queues[_0x3cfac1[_0xedc5('0x3')]][_0xedc5('0x23')]=null;queues[_0x3cfac1[_0xedc5('0x3')]][_0xedc5('0x16')]=!![];queues[_0x3cfac1[_0xedc5('0x3')]]['queuecallerexitAt']=utils['now']();queues[_0x3cfac1[_0xedc5('0x3')]][_0xedc5('0x19')]='EXITWITHKEY';utils[_0xedc5('0x0')](util['format'](_0xedc5('0x27'),_0x3cfac1[_0xedc5('0x3')],queues[_0x3cfac1['uniqueid']][_0xedc5('0x1b')],_0x3cfac1[_0xedc5('0x20')],queues[_0x3cfac1[_0xedc5('0x3')]][_0xedc5('0x19')]));}}}catch(_0x286197){utils['error'](util[_0xedc5('0x1')]('[%s][queues][varset]',_0x3cfac1[_0xedc5('0x3')]),_0x286197);}};exports[_0xedc5('0x15')]=function(_0x553a3b){try{if(!_[_0xedc5('0x13')](queues[_0x553a3b[_0xedc5('0x3')]])){utils['debug'](util[_0xedc5('0x1')](_0xedc5('0x28'),_0x553a3b[_0xedc5('0x3')]),_0x553a3b);queues[_0x553a3b['uniqueid']][_0xedc5('0x16')]=![];queues[_0x553a3b[_0xedc5('0x3')]][_0xedc5('0x24')]=null;queues[_0x553a3b[_0xedc5('0x3')]]['queuecallerabandon']=!![];queues[_0x553a3b[_0xedc5('0x3')]][_0xedc5('0x23')]=utils[_0xedc5('0x11')]();queues[_0x553a3b['uniqueid']][_0xedc5('0x19')]=_0xedc5('0x29');utils[_0xedc5('0x0')](util[_0xedc5('0x1')](_0xedc5('0x2a'),_0x553a3b[_0xedc5('0x3')],queues[_0x553a3b[_0xedc5('0x3')]]['name'],queues[_0x553a3b[_0xedc5('0x3')]][_0xedc5('0x19')]));}}catch(_0x2cd897){utils[_0xedc5('0x12')](util[_0xedc5('0x1')](_0xedc5('0x28'),_0x553a3b['uniqueid']),_0x2cd897);}};exports[_0xedc5('0x2b')]=function(_0x12f1ff){try{if(!_[_0xedc5('0x13')](queues[_0x12f1ff[_0xedc5('0x3')]])){utils[_0xedc5('0xd')](util[_0xedc5('0x1')]('[%s][queues][queuecallerleave]',_0x12f1ff[_0xedc5('0x3')]),_0x12f1ff);utils[_0xedc5('0x0')](util['format'](_0xedc5('0x2c'),_0x12f1ff[_0xedc5('0x3')],queues[_0x12f1ff[_0xedc5('0x3')]][_0xedc5('0x1b')],_0x12f1ff['connectedlinenum'],_0x12f1ff[_0xedc5('0x2d')]));queues[_0x12f1ff[_0xedc5('0x3')]][_0xedc5('0x2b')]=!![];queues[_0x12f1ff[_0xedc5('0x3')]][_0xedc5('0x14')]=utils[_0xedc5('0x11')]();queues[_0x12f1ff[_0xedc5('0x3')]]['holdtime']=utils['diffTime'](queues[_0x12f1ff[_0xedc5('0x3')]][_0xedc5('0x14')],queues[_0x12f1ff[_0xedc5('0x3')]][_0xedc5('0x2e')]);queues[_0x12f1ff['uniqueid']][_0xedc5('0x10')]=_0x12f1ff[_0xedc5('0x10')];queues[_0x12f1ff['uniqueid']][_0xedc5('0x2f')]=_0x12f1ff[_0xedc5('0x2f')];queues[_0x12f1ff[_0xedc5('0x3')]][_0xedc5('0x30')]=_0x12f1ff[_0xedc5('0x30')];queues[_0x12f1ff[_0xedc5('0x3')]][_0xedc5('0x2d')]=_0x12f1ff['connectedlinename'];}}catch(_0xfac08f){utils[_0xedc5('0x12')](util[_0xedc5('0x1')](_0xedc5('0x31'),_0x12f1ff[_0xedc5('0x3')]),_0xfac08f);}};exports[_0xedc5('0x32')]=function(_0xf4a214){try{if(!_[_0xedc5('0x13')](queues[_0xf4a214[_0xedc5('0x3')]])){utils[_0xedc5('0xd')](util[_0xedc5('0x1')](_0xedc5('0x33'),_0xf4a214[_0xedc5('0x3')]),_0xf4a214);utils[_0xedc5('0x0')](util['format'](_0xedc5('0x34'),_0xf4a214[_0xedc5('0x3')],queues[_0xf4a214[_0xedc5('0x3')]]['name'],_0xf4a214[_0xedc5('0x35')],_0xf4a214[_0xedc5('0x36')]));queues[_0xf4a214[_0xedc5('0x3')]][_0xedc5('0x15')]=![];queues[_0xf4a214[_0xedc5('0x3')]]['queuecallerabandon']=![];queues[_0xf4a214['uniqueid']][_0xedc5('0x23')]=null;queues[_0xf4a214[_0xedc5('0x3')]][_0xedc5('0x16')]=![];queues[_0xf4a214['uniqueid']]['queuecallerexitreason']=null;queues[_0xf4a214[_0xedc5('0x3')]]['queuecallerexitAt']=null;queues[_0xf4a214[_0xedc5('0x3')]]['assigned']=!![];queues[_0xf4a214[_0xedc5('0x3')]][_0xedc5('0x6')]=_0xf4a214[_0xedc5('0x36')];queues[_0xf4a214[_0xedc5('0x3')]][_0xedc5('0x37')]=_0xf4a214['membername'];}}catch(_0x416be5){utils['error'](util[_0xedc5('0x1')](_0xedc5('0x33'),_0xf4a214[_0xedc5('0x3')]),_0x416be5);}};exports[_0xedc5('0x38')]=function(_0x4d8bc2){try{if(!_['isNil'](queues[_0x4d8bc2[_0xedc5('0x3')]])){if(queues[_0x4d8bc2['uniqueid']]['queuecallerleaveAt']){utils[_0xedc5('0xd')](util[_0xedc5('0x1')](_0xedc5('0x39'),_0x4d8bc2[_0xedc5('0x3')]),_0x4d8bc2);queues[_0x4d8bc2['uniqueid']][_0xedc5('0x15')]=![];queues[_0x4d8bc2[_0xedc5('0x3')]][_0xedc5('0x15')]=![];queues[_0x4d8bc2[_0xedc5('0x3')]][_0xedc5('0x23')]=null;queues[_0x4d8bc2[_0xedc5('0x3')]][_0xedc5('0x16')]=![];queues[_0x4d8bc2[_0xedc5('0x3')]][_0xedc5('0x24')]=null;queues[_0x4d8bc2[_0xedc5('0x3')]]['assigned']=!![];queues[_0x4d8bc2[_0xedc5('0x3')]][_0xedc5('0x37')]=_0x4d8bc2[_0xedc5('0x35')];queues[_0x4d8bc2[_0xedc5('0x3')]]['queuecallercomplete']=!![];queues[_0x4d8bc2[_0xedc5('0x3')]][_0xedc5('0x18')]=utils['now']();if(_0x4d8bc2['reason']==_0xedc5('0x3a')){if(!queues[_0x4d8bc2[_0xedc5('0x3')]][_0xedc5('0x3a')]){queues[_0x4d8bc2[_0xedc5('0x3')]]['queuecallerexitreason']=_0xedc5('0x3b');}}else{queues[_0x4d8bc2[_0xedc5('0x3')]]['queuecallerexitreason']=_0xedc5('0x3c')+_0x4d8bc2[_0xedc5('0x3d')][_0xedc5('0x21')]();}utils[_0xedc5('0x0')](util[_0xedc5('0x1')](_0xedc5('0x3e'),_0x4d8bc2['uniqueid'],queues[_0x4d8bc2[_0xedc5('0x3')]]['name'],_0x4d8bc2['membername'],queues[_0x4d8bc2[_0xedc5('0x3')]][_0xedc5('0x19')]));writeDB(queues[_0x4d8bc2['uniqueid']]);}}}catch(_0x310315){utils[_0xedc5('0x12')](util[_0xedc5('0x1')](_0xedc5('0x39'),_0x4d8bc2[_0xedc5('0x3')]),_0x310315);}};exports[_0xedc5('0x3f')]=function(_0x17b74f){try{if(!_[_0xedc5('0x13')](queues[_0x17b74f['transfereeuniqueid']])){utils['debug'](util[_0xedc5('0x1')](_0xedc5('0x40'),_0x17b74f[_0xedc5('0x3')]),_0x17b74f);queues[_0x17b74f[_0xedc5('0x41')]][_0xedc5('0x3a')]=!![];queues[_0x17b74f[_0xedc5('0x41')]][_0xedc5('0x42')]=_0xedc5('0x43');queues[_0x17b74f[_0xedc5('0x41')]][_0xedc5('0x44')]=_0x17b74f[_0xedc5('0x45')];queues[_0x17b74f[_0xedc5('0x41')]]['transferuniqueid']=_0x17b74f[_0xedc5('0x41')];queues[_0x17b74f[_0xedc5('0x41')]]['queuecallerexitreason']='BLINDTRANSFER';utils[_0xedc5('0x0')](util[_0xedc5('0x1')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x17b74f['uniqueid'],queues[_0x17b74f['transfereeuniqueid']][_0xedc5('0x1b')],_0x17b74f[_0xedc5('0x41')],_0x17b74f[_0xedc5('0x45')]));}}catch(_0x4dd499){utils[_0xedc5('0x12')](util[_0xedc5('0x1')]('[%s][queues][blindtransfer]',_0x17b74f[_0xedc5('0x3')]),_0x4dd499);}};exports[_0xedc5('0x46')]=function(_0x52df9d){try{utils[_0xedc5('0xd')](util[_0xedc5('0x1')](_0xedc5('0x47'),_0x52df9d[_0xedc5('0x48')]),_0x52df9d);if(_0x52df9d['origtransfereruniqueid']==_0x52df9d[_0xedc5('0x49')]){if(!_[_0xedc5('0x13')](queues[_0x52df9d[_0xedc5('0x4a')]])){utils['info'](util[_0xedc5('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x52df9d[_0xedc5('0x48')],queues[_0x52df9d['secondtransfererlinkedid']][_0xedc5('0x1b')],_0x52df9d[_0xedc5('0x4b')]));queues[_0x52df9d[_0xedc5('0x4a')]]['transfer']=!![];queues[_0x52df9d[_0xedc5('0x4a')]][_0xedc5('0x42')]=_0xedc5('0x4c');queues[_0x52df9d[_0xedc5('0x4a')]][_0xedc5('0x44')]=_0x52df9d[_0xedc5('0x4b')];queues[_0x52df9d[_0xedc5('0x4a')]][_0xedc5('0x4d')]=_0x52df9d[_0xedc5('0x48')];queues[_0x52df9d[_0xedc5('0x4a')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x52df9d[_0xedc5('0x49')]])){if(_0x52df9d['transfereelinkedid']&&queues[_0x52df9d[_0xedc5('0x4e')]]){queues[_0x52df9d[_0xedc5('0x4e')]]['queuecallerenterreason']=0x1;queues[_0x52df9d['transfereeuniqueid']]=_[_0xedc5('0x4f')](queues[_0x52df9d[_0xedc5('0x4e')]]);queues[_0x52df9d[_0xedc5('0x41')]][_0xedc5('0xc')]=_0x52df9d['transfertargetuniqueid'];queues[_0x52df9d[_0xedc5('0x41')]]['queuecallerenterreason']=0x2;queues[_0x52df9d[_0xedc5('0x41')]][_0xedc5('0x5')]=queues[_0x52df9d[_0xedc5('0x4a')]][_0xedc5('0x5')];queues[_0x52df9d[_0xedc5('0x41')]][_0xedc5('0x50')]=queues[_0x52df9d[_0xedc5('0x4a')]][_0xedc5('0x50')];queues[_0x52df9d['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0xedc5('0x11')]();queues[_0x52df9d['transfereeuniqueid']][_0xedc5('0x14')]=utils[_0xedc5('0x11')]();queues[_0x52df9d[_0xedc5('0x41')]]['holdtime']=0x0;queues[_0x52df9d[_0xedc5('0x41')]]['mohtime']=0x0;utils[_0xedc5('0x0')](util[_0xedc5('0x1')](_0xedc5('0x51'),_0x52df9d[_0xedc5('0x48')],queues[_0x52df9d[_0xedc5('0x41')]]['name'],queues[_0x52df9d[_0xedc5('0x41')]][_0xedc5('0x5')],queues[_0x52df9d[_0xedc5('0x41')]][_0xedc5('0x50')]));}else{utils['info'](util[_0xedc5('0x1')](_0xedc5('0x52'),_0x52df9d[_0xedc5('0x48')],queues[_0x52df9d[_0xedc5('0x49')]][_0xedc5('0x1b')],_0x52df9d[_0xedc5('0x4a')]));queues[_0x52df9d[_0xedc5('0x49')]]['transfereduniqueid']=_0x52df9d[_0xedc5('0x4a')];}}}else if(_0x52df9d[_0xedc5('0x53')]==_0x52df9d['secondtransfererlinkedid']){if(!_[_0xedc5('0x13')](queues[_0x52df9d[_0xedc5('0x49')]])){utils[_0xedc5('0x0')](util[_0xedc5('0x1')](_0xedc5('0x54'),_0x52df9d['origtransfereruniqueid'],queues[_0x52df9d[_0xedc5('0x49')]][_0xedc5('0x1b')],_0x52df9d[_0xedc5('0x53')],_0x52df9d[_0xedc5('0x55')]));queues[_0x52df9d['origtransfererlinkedid']][_0xedc5('0x3a')]=!![];queues[_0x52df9d[_0xedc5('0x49')]][_0xedc5('0x42')]=_0xedc5('0x4c');queues[_0x52df9d[_0xedc5('0x49')]][_0xedc5('0x44')]=_0x52df9d['secondtransfererexten'];queues[_0x52df9d[_0xedc5('0x49')]][_0xedc5('0x4d')]=_0x52df9d[_0xedc5('0x53')];queues[_0x52df9d[_0xedc5('0x49')]][_0xedc5('0x19')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x52df9d[_0xedc5('0x4a')]])){if(_0x52df9d[_0xedc5('0x56')]&&queues[_0x52df9d[_0xedc5('0x56')]]){queues[_0x52df9d['transfertargetlinkedid']][_0xedc5('0x57')]=0x1;queues[_0x52df9d[_0xedc5('0x58')]]=_[_0xedc5('0x4f')](queues[_0x52df9d['transfertargetlinkedid']]);queues[_0x52df9d[_0xedc5('0x58')]][_0xedc5('0xc')]=_0x52df9d[_0xedc5('0x58')];queues[_0x52df9d[_0xedc5('0x58')]]['queuecallerenterreason']=0x2;queues[_0x52df9d[_0xedc5('0x58')]][_0xedc5('0x5')]=queues[_0x52df9d[_0xedc5('0x49')]][_0xedc5('0x5')];queues[_0x52df9d['transfertargetuniqueid']][_0xedc5('0x50')]=queues[_0x52df9d[_0xedc5('0x49')]][_0xedc5('0x50')];queues[_0x52df9d[_0xedc5('0x58')]][_0xedc5('0x2e')]=utils[_0xedc5('0x11')]();queues[_0x52df9d['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0xedc5('0x11')]();queues[_0x52df9d['transfertargetuniqueid']][_0xedc5('0x59')]=0x0;queues[_0x52df9d[_0xedc5('0x58')]][_0xedc5('0x5a')]=0x0;utils[_0xedc5('0x0')](util[_0xedc5('0x1')](_0xedc5('0x5b'),_0x52df9d[_0xedc5('0x48')],queues[_0x52df9d[_0xedc5('0x58')]]['name'],queues[_0x52df9d['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x52df9d[_0xedc5('0x58')]]['calleridnum'],queues[_0x52df9d[_0xedc5('0x58')]][_0xedc5('0x50')]));}else{utils['info'](util[_0xedc5('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x52df9d[_0xedc5('0x48')],queues[_0x52df9d[_0xedc5('0x4a')]][_0xedc5('0x1b')],_0x52df9d[_0xedc5('0x49')]));queues[_0x52df9d['secondtransfererlinkedid']][_0xedc5('0xc')]=_0x52df9d[_0xedc5('0x49')];}}}}catch(_0x10aa31){utils[_0xedc5('0x12')](util[_0xedc5('0x1')](_0xedc5('0x47'),_0x52df9d[_0xedc5('0x48')]),_0x10aa31);}};exports['musiconholdstart']=function(_0x14ded0){try{if(!_[_0xedc5('0x13')](queues[_0x14ded0['uniqueid']])){utils[_0xedc5('0xd')](util[_0xedc5('0x1')](_0xedc5('0x5c'),_0x14ded0[_0xedc5('0x3')]),_0x14ded0);queues[_0x14ded0[_0xedc5('0x3')]][_0xedc5('0x5d')]=utils['now']();utils[_0xedc5('0x0')](util[_0xedc5('0x1')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x14ded0[_0xedc5('0x3')],queues[_0x14ded0['uniqueid']]['name'],queues[_0x14ded0[_0xedc5('0x3')]][_0xedc5('0x5d')]));}}catch(_0x395d98){utils[_0xedc5('0x12')](util[_0xedc5('0x1')]('[%s][queues][musiconholdstart]',_0x14ded0[_0xedc5('0x3')]),_0x395d98);}};exports[_0xedc5('0x5e')]=function(_0x418bf1){try{if(!_['isNil'](queues[_0x418bf1['uniqueid']])){if(!_[_0xedc5('0x13')](queues[_0x418bf1[_0xedc5('0x3')]]['musiconholdstartAt'])){utils[_0xedc5('0xd')](util[_0xedc5('0x1')](_0xedc5('0x5f'),_0x418bf1['uniqueid']),_0x418bf1);queues[_0x418bf1[_0xedc5('0x3')]][_0xedc5('0x5a')]+=utils[_0xedc5('0x60')](utils[_0xedc5('0x11')](),queues[_0x418bf1[_0xedc5('0x3')]][_0xedc5('0x5d')]);utils[_0xedc5('0x0')](util[_0xedc5('0x1')](_0xedc5('0x61'),_0x418bf1['uniqueid'],queues[_0x418bf1[_0xedc5('0x3')]][_0xedc5('0x1b')],queues[_0x418bf1[_0xedc5('0x3')]][_0xedc5('0x5a')]));delete queues[_0x418bf1[_0xedc5('0x3')]]['musiconholdstartAt'];}}}catch(_0x41a6ca){utils[_0xedc5('0x12')](util['format'](_0xedc5('0x5f'),_0x418bf1[_0xedc5('0x3')]),_0x41a6ca);}}; \ No newline at end of file +var _0xf049=['extension','transfereeuniqueid','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','transferexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','ATTENDED','transfertargetlinkedid','queuecallerjoinAt','mohtime','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','accountcode','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','position','now','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexitAt','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfertype','BLIND'];(function(_0x476531,_0x4db620){var _0x1942d3=function(_0x111d21){while(--_0x111d21){_0x476531['push'](_0x476531['shift']());}};_0x1942d3(++_0x4db620);}(_0xf049,0x83));var _0x9f04=function(_0x21a8a9,_0x5624db){_0x21a8a9=_0x21a8a9-0x0;var _0x1bff62=_0xf049[_0x21a8a9];return _0x1bff62;};'use strict';var _=require(_0x9f04('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x5d025b){utils['info'](util[_0x9f04('0x1')](_0x9f04('0x2'),_0x5d025b['uniqueid'],_0x5d025b[_0x9f04('0x3')],_0x5d025b[_0x9f04('0x4')],_0x5d025b[_0x9f04('0x5')],_0x5d025b['calleridnum'],_0x5d025b[_0x9f04('0x6')],_0x5d025b['queuecallerexitreason']));if(_0x5d025b[_0x9f04('0x4')]){utils[_0x9f04('0x7')](_0x5d025b[_0x9f04('0x4')])['then'](function(_0x5e0504){if(_0x5e0504){_0x5d025b[_0x9f04('0x8')]=_0x5e0504[_0x9f04('0x8')];}utils[_0x9f04('0x9')](_0x9f04('0xa'),_0x5d025b);});}else{utils[_0x9f04('0x9')](_0x9f04('0xa'),_0x5d025b);}if(_0x5d025b[_0x9f04('0xb')]){delete queues[_0x5d025b[_0x9f04('0xb')]];}else{delete queues[_0x5d025b[_0x9f04('0xc')]];}}exports[_0x9f04('0xd')]=function(_0x25b596){try{utils[_0x9f04('0xe')](util[_0x9f04('0x1')](_0x9f04('0xf'),_0x25b596[_0x9f04('0xc')]),_0x25b596);utils[_0x9f04('0x10')](util[_0x9f04('0x1')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x25b596[_0x9f04('0xc')],_0x25b596[_0x9f04('0x4')],_0x25b596[_0x9f04('0x11')]));queues[_0x25b596['uniqueid']]=_['assign'](_0x25b596,{'originalposition':_0x25b596[_0x9f04('0x11')],'queuecallerjoinAt':utils[_0x9f04('0x12')](),'mohtime':0x0});}catch(_0x583cbd){utils[_0x9f04('0x13')](util['format'](_0x9f04('0xf'),_0x25b596[_0x9f04('0xc')]),_0x583cbd);}};exports[_0x9f04('0x14')]=function(_0x5c5635){try{if(!_['isNil'](queues[_0x5c5635[_0x9f04('0xc')]])){utils['debug'](util['format'](_0x9f04('0x15'),_0x5c5635[_0x9f04('0xc')]),_0x5c5635);if(queues[_0x5c5635[_0x9f04('0xc')]][_0x9f04('0x16')]){if(!queues[_0x5c5635[_0x9f04('0xc')]][_0x9f04('0x17')]&&!queues[_0x5c5635[_0x9f04('0xc')]][_0x9f04('0x18')]){queues[_0x5c5635[_0x9f04('0xc')]][_0x9f04('0x19')]=!![];queues[_0x5c5635[_0x9f04('0xc')]]['queuecallercompleteAt']=utils[_0x9f04('0x12')]();queues[_0x5c5635[_0x9f04('0xc')]][_0x9f04('0x1a')]=_0x9f04('0x1b');}utils[_0x9f04('0x10')](util[_0x9f04('0x1')](_0x9f04('0x1c'),_0x5c5635['uniqueid'],queues[_0x5c5635[_0x9f04('0xc')]]['name'],queues[_0x5c5635[_0x9f04('0xc')]][_0x9f04('0x1a')]));writeDB(queues[_0x5c5635[_0x9f04('0xc')]]);}else if(queues[_0x5c5635[_0x9f04('0xc')]][_0x9f04('0xb')]){utils[_0x9f04('0x10')](util[_0x9f04('0x1')](_0x9f04('0x1d'),_0x5c5635[_0x9f04('0xc')],queues[_0x5c5635[_0x9f04('0xc')]][_0x9f04('0x1e')],queues[_0x5c5635[_0x9f04('0xc')]][_0x9f04('0xb')]));queues[queues[_0x5c5635['uniqueid']][_0x9f04('0xb')]]=queues[_0x5c5635['uniqueid']];queues[queues[_0x5c5635[_0x9f04('0xc')]]['transfereduniqueid']][_0x9f04('0x1f')]=0x2;delete queues[_0x5c5635[_0x9f04('0xc')]];}}}catch(_0x540d87){utils['error'](util[_0x9f04('0x1')](_0x9f04('0x15'),_0x5c5635[_0x9f04('0xc')]),_0x540d87);}};exports['varset']=function(_0x1e6705){try{utils[_0x9f04('0xe')](util['format'](_0x9f04('0x20'),_0x1e6705['uniqueid']),_0x1e6705);if(!_[_0x9f04('0x21')](_0x1e6705[_0x9f04('0x22')][_0x9f04('0x23')])&&_0x1e6705[_0x9f04('0x24')][_0x9f04('0x25')]()!==_0x9f04('0x26')){if(!_[_0x9f04('0x21')](queues[_0x1e6705[_0x9f04('0xc')]])){queues[_0x1e6705[_0x9f04('0xc')]]['queuecallerabandon']=![];queues[_0x1e6705[_0x9f04('0xc')]]['queuecallerabandonAt']=null;queues[_0x1e6705[_0x9f04('0xc')]][_0x9f04('0x18')]=!![];queues[_0x1e6705['uniqueid']][_0x9f04('0x27')]=utils[_0x9f04('0x12')]();queues[_0x1e6705['uniqueid']][_0x9f04('0x1a')]=_0x1e6705[_0x9f04('0x24')][_0x9f04('0x25')]();utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x1e6705[_0x9f04('0xc')],queues[_0x1e6705[_0x9f04('0xc')]][_0x9f04('0x1e')],_0x1e6705[_0x9f04('0x24')],queues[_0x1e6705[_0x9f04('0xc')]][_0x9f04('0x1a')]));writeDB(queues[_0x1e6705[_0x9f04('0xc')]]);}}else if(!_[_0x9f04('0x21')](_0x1e6705[_0x9f04('0x22')][_0x9f04('0x28')])){if(!_[_0x9f04('0x21')](queues[_0x1e6705[_0x9f04('0xc')]])&&!queues[_0x1e6705['uniqueid']][_0x9f04('0x17')]){queues[_0x1e6705[_0x9f04('0xc')]][_0x9f04('0x17')]=![];queues[_0x1e6705[_0x9f04('0xc')]][_0x9f04('0x29')]=null;queues[_0x1e6705[_0x9f04('0xc')]][_0x9f04('0x18')]=!![];queues[_0x1e6705[_0x9f04('0xc')]]['queuecallerexitAt']=utils[_0x9f04('0x12')]();queues[_0x1e6705[_0x9f04('0xc')]][_0x9f04('0x1a')]=_0x9f04('0x2a');utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x1e6705[_0x9f04('0xc')],queues[_0x1e6705[_0x9f04('0xc')]][_0x9f04('0x1e')],_0x1e6705['value'],queues[_0x1e6705[_0x9f04('0xc')]][_0x9f04('0x1a')]));}}}catch(_0x2fd730){utils[_0x9f04('0x13')](util[_0x9f04('0x1')](_0x9f04('0x20'),_0x1e6705[_0x9f04('0xc')]),_0x2fd730);}};exports['queuecallerabandon']=function(_0x3af554){try{if(!_[_0x9f04('0x21')](queues[_0x3af554[_0x9f04('0xc')]])){utils[_0x9f04('0xe')](util[_0x9f04('0x1')](_0x9f04('0x2b'),_0x3af554[_0x9f04('0xc')]),_0x3af554);queues[_0x3af554[_0x9f04('0xc')]]['queuecallerexit']=![];queues[_0x3af554[_0x9f04('0xc')]][_0x9f04('0x27')]=null;queues[_0x3af554[_0x9f04('0xc')]][_0x9f04('0x17')]=!![];queues[_0x3af554[_0x9f04('0xc')]][_0x9f04('0x29')]=utils[_0x9f04('0x12')]();queues[_0x3af554['uniqueid']]['queuecallerexitreason']=_0x9f04('0x2c');utils[_0x9f04('0x10')](util[_0x9f04('0x1')](_0x9f04('0x2d'),_0x3af554[_0x9f04('0xc')],queues[_0x3af554[_0x9f04('0xc')]][_0x9f04('0x1e')],queues[_0x3af554[_0x9f04('0xc')]][_0x9f04('0x1a')]));}}catch(_0x3d6bde){utils['error'](util[_0x9f04('0x1')](_0x9f04('0x2b'),_0x3af554['uniqueid']),_0x3d6bde);}};exports[_0x9f04('0x2e')]=function(_0x13ef10){try{if(!_[_0x9f04('0x21')](queues[_0x13ef10[_0x9f04('0xc')]])){utils[_0x9f04('0xe')](util[_0x9f04('0x1')](_0x9f04('0x2f'),_0x13ef10[_0x9f04('0xc')]),_0x13ef10);utils[_0x9f04('0x10')](util[_0x9f04('0x1')](_0x9f04('0x30'),_0x13ef10[_0x9f04('0xc')],queues[_0x13ef10[_0x9f04('0xc')]][_0x9f04('0x1e')],_0x13ef10[_0x9f04('0x31')],_0x13ef10['connectedlinename']));queues[_0x13ef10['uniqueid']][_0x9f04('0x2e')]=!![];queues[_0x13ef10[_0x9f04('0xc')]]['queuecallerleaveAt']=utils['now']();queues[_0x13ef10[_0x9f04('0xc')]][_0x9f04('0x32')]=utils[_0x9f04('0x33')](queues[_0x13ef10[_0x9f04('0xc')]]['queuecallerleaveAt'],queues[_0x13ef10['uniqueid']]['queuecallerjoinAt']);queues[_0x13ef10[_0x9f04('0xc')]][_0x9f04('0x11')]=_0x13ef10[_0x9f04('0x11')];queues[_0x13ef10[_0x9f04('0xc')]][_0x9f04('0x34')]=_0x13ef10[_0x9f04('0x34')];queues[_0x13ef10[_0x9f04('0xc')]][_0x9f04('0x31')]=_0x13ef10[_0x9f04('0x31')];queues[_0x13ef10['uniqueid']]['connectedlinename']=_0x13ef10[_0x9f04('0x35')];}}catch(_0x4c3984){utils['error'](util['format'](_0x9f04('0x2f'),_0x13ef10['uniqueid']),_0x4c3984);}};exports[_0x9f04('0x36')]=function(_0xb68031){try{if(!_[_0x9f04('0x21')](queues[_0xb68031[_0x9f04('0xc')]])){utils['debug'](util[_0x9f04('0x1')](_0x9f04('0x37'),_0xb68031[_0x9f04('0xc')]),_0xb68031);utils['info'](util[_0x9f04('0x1')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0xb68031[_0x9f04('0xc')],queues[_0xb68031[_0x9f04('0xc')]][_0x9f04('0x1e')],_0xb68031[_0x9f04('0x38')],_0xb68031[_0x9f04('0x39')]));queues[_0xb68031[_0x9f04('0xc')]][_0x9f04('0x17')]=![];queues[_0xb68031['uniqueid']][_0x9f04('0x17')]=![];queues[_0xb68031[_0x9f04('0xc')]]['queuecallerabandonAt']=null;queues[_0xb68031[_0x9f04('0xc')]][_0x9f04('0x18')]=![];queues[_0xb68031[_0x9f04('0xc')]][_0x9f04('0x1a')]=null;queues[_0xb68031['uniqueid']][_0x9f04('0x27')]=null;queues[_0xb68031[_0x9f04('0xc')]][_0x9f04('0x3a')]=!![];queues[_0xb68031[_0x9f04('0xc')]][_0x9f04('0x6')]=_0xb68031['destaccountcode'];queues[_0xb68031[_0x9f04('0xc')]][_0x9f04('0x5')]=_0xb68031[_0x9f04('0x38')];}}catch(_0x4a429e){utils[_0x9f04('0x13')](util[_0x9f04('0x1')](_0x9f04('0x37'),_0xb68031[_0x9f04('0xc')]),_0x4a429e);}};exports[_0x9f04('0x3b')]=function(_0x306b39){try{if(!_[_0x9f04('0x21')](queues[_0x306b39[_0x9f04('0xc')]])){if(queues[_0x306b39[_0x9f04('0xc')]][_0x9f04('0x16')]){utils[_0x9f04('0xe')](util[_0x9f04('0x1')](_0x9f04('0x3c'),_0x306b39[_0x9f04('0xc')]),_0x306b39);queues[_0x306b39[_0x9f04('0xc')]]['queuecallerabandon']=![];queues[_0x306b39[_0x9f04('0xc')]][_0x9f04('0x17')]=![];queues[_0x306b39['uniqueid']]['queuecallerabandonAt']=null;queues[_0x306b39[_0x9f04('0xc')]]['queuecallerexit']=![];queues[_0x306b39['uniqueid']][_0x9f04('0x27')]=null;queues[_0x306b39['uniqueid']]['assigned']=!![];queues[_0x306b39[_0x9f04('0xc')]][_0x9f04('0x5')]=_0x306b39['membername'];queues[_0x306b39['uniqueid']][_0x9f04('0x19')]=!![];queues[_0x306b39[_0x9f04('0xc')]][_0x9f04('0x3d')]=utils[_0x9f04('0x12')]();if(_0x306b39[_0x9f04('0x3e')]=='transfer'){if(!queues[_0x306b39[_0x9f04('0xc')]][_0x9f04('0x3f')]){queues[_0x306b39['uniqueid']]['queuecallerexitreason']=_0x9f04('0x40');}}else{queues[_0x306b39[_0x9f04('0xc')]][_0x9f04('0x1a')]=_0x9f04('0x41')+_0x306b39['reason']['toUpperCase']();}utils[_0x9f04('0x10')](util[_0x9f04('0x1')](_0x9f04('0x42'),_0x306b39[_0x9f04('0xc')],queues[_0x306b39[_0x9f04('0xc')]][_0x9f04('0x1e')],_0x306b39[_0x9f04('0x38')],queues[_0x306b39[_0x9f04('0xc')]][_0x9f04('0x1a')]));writeDB(queues[_0x306b39[_0x9f04('0xc')]]);}}}catch(_0x25f465){utils['error'](util['format'](_0x9f04('0x3c'),_0x306b39[_0x9f04('0xc')]),_0x25f465);}};exports[_0x9f04('0x43')]=function(_0x48384b){try{if(!_['isNil'](queues[_0x48384b['transfereeuniqueid']])){utils['debug'](util[_0x9f04('0x1')](_0x9f04('0x44'),_0x48384b[_0x9f04('0xc')]),_0x48384b);queues[_0x48384b['transfereeuniqueid']][_0x9f04('0x3f')]=!![];queues[_0x48384b['transfereeuniqueid']][_0x9f04('0x45')]=_0x9f04('0x46');queues[_0x48384b['transfereeuniqueid']]['transferexten']=_0x48384b[_0x9f04('0x47')];queues[_0x48384b[_0x9f04('0x48')]][_0x9f04('0x49')]=_0x48384b[_0x9f04('0x48')];queues[_0x48384b[_0x9f04('0x48')]][_0x9f04('0x1a')]='BLINDTRANSFER';utils[_0x9f04('0x10')](util[_0x9f04('0x1')](_0x9f04('0x4a'),_0x48384b[_0x9f04('0xc')],queues[_0x48384b[_0x9f04('0x48')]][_0x9f04('0x1e')],_0x48384b[_0x9f04('0x48')],_0x48384b['extension']));}}catch(_0xa86e6b){utils['error'](util[_0x9f04('0x1')]('[%s][queues][blindtransfer]',_0x48384b[_0x9f04('0xc')]),_0xa86e6b);}};exports[_0x9f04('0x4b')]=function(_0x381019){try{utils[_0x9f04('0xe')](util['format'](_0x9f04('0x4c'),_0x381019[_0x9f04('0x4d')]),_0x381019);if(_0x381019[_0x9f04('0x4d')]==_0x381019[_0x9f04('0x4e')]){if(!_['isNil'](queues[_0x381019['secondtransfererlinkedid']])){utils[_0x9f04('0x10')](util[_0x9f04('0x1')](_0x9f04('0x4f'),_0x381019[_0x9f04('0x4d')],queues[_0x381019[_0x9f04('0x50')]][_0x9f04('0x1e')],_0x381019[_0x9f04('0x51')]));queues[_0x381019[_0x9f04('0x50')]][_0x9f04('0x3f')]=!![];queues[_0x381019['secondtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x381019[_0x9f04('0x50')]][_0x9f04('0x52')]=_0x381019[_0x9f04('0x51')];queues[_0x381019[_0x9f04('0x50')]][_0x9f04('0x49')]=_0x381019[_0x9f04('0x4d')];queues[_0x381019['secondtransfererlinkedid']][_0x9f04('0x1a')]=_0x9f04('0x53');}if(!_[_0x9f04('0x21')](queues[_0x381019[_0x9f04('0x4e')]])){if(_0x381019[_0x9f04('0x54')]&&queues[_0x381019[_0x9f04('0x54')]]){queues[_0x381019[_0x9f04('0x54')]][_0x9f04('0x1f')]=0x1;queues[_0x381019[_0x9f04('0x48')]]=_[_0x9f04('0x55')](queues[_0x381019[_0x9f04('0x54')]]);queues[_0x381019[_0x9f04('0x48')]][_0x9f04('0xb')]=_0x381019[_0x9f04('0x56')];queues[_0x381019[_0x9f04('0x48')]][_0x9f04('0x1f')]=0x2;queues[_0x381019[_0x9f04('0x48')]][_0x9f04('0x57')]=queues[_0x381019[_0x9f04('0x50')]][_0x9f04('0x57')];queues[_0x381019[_0x9f04('0x48')]][_0x9f04('0x58')]=queues[_0x381019[_0x9f04('0x50')]][_0x9f04('0x58')];queues[_0x381019['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0x9f04('0x12')]();queues[_0x381019[_0x9f04('0x48')]][_0x9f04('0x16')]=utils[_0x9f04('0x12')]();queues[_0x381019[_0x9f04('0x48')]][_0x9f04('0x32')]=0x0;queues[_0x381019['transfereeuniqueid']]['mohtime']=0x0;utils[_0x9f04('0x10')](util[_0x9f04('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x381019[_0x9f04('0x4d')],queues[_0x381019[_0x9f04('0x48')]][_0x9f04('0x1e')],queues[_0x381019[_0x9f04('0x48')]][_0x9f04('0x57')],queues[_0x381019[_0x9f04('0x48')]]['calleridname']));}else{utils[_0x9f04('0x10')](util[_0x9f04('0x1')](_0x9f04('0x59'),_0x381019[_0x9f04('0x4d')],queues[_0x381019['origtransfererlinkedid']][_0x9f04('0x1e')],_0x381019['secondtransfererlinkedid']));queues[_0x381019[_0x9f04('0x4e')]][_0x9f04('0xb')]=_0x381019['secondtransfererlinkedid'];}}}else if(_0x381019[_0x9f04('0x5a')]==_0x381019[_0x9f04('0x50')]){if(!_[_0x9f04('0x21')](queues[_0x381019[_0x9f04('0x4e')]])){utils[_0x9f04('0x10')](util[_0x9f04('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x381019[_0x9f04('0x4d')],queues[_0x381019[_0x9f04('0x4e')]][_0x9f04('0x1e')],_0x381019['secondtransfereruniqueid'],_0x381019[_0x9f04('0x5b')]));queues[_0x381019[_0x9f04('0x4e')]][_0x9f04('0x3f')]=!![];queues[_0x381019[_0x9f04('0x4e')]][_0x9f04('0x45')]=_0x9f04('0x5c');queues[_0x381019[_0x9f04('0x4e')]]['transferexten']=_0x381019[_0x9f04('0x5b')];queues[_0x381019['origtransfererlinkedid']][_0x9f04('0x49')]=_0x381019['secondtransfereruniqueid'];queues[_0x381019['origtransfererlinkedid']]['queuecallerexitreason']=_0x9f04('0x53');}if(!_['isNil'](queues[_0x381019[_0x9f04('0x50')]])){if(_0x381019['transfertargetlinkedid']&&queues[_0x381019[_0x9f04('0x5d')]]){queues[_0x381019[_0x9f04('0x5d')]]['queuecallerenterreason']=0x1;queues[_0x381019['transfertargetuniqueid']]=_[_0x9f04('0x55')](queues[_0x381019['transfertargetlinkedid']]);queues[_0x381019['transfertargetuniqueid']][_0x9f04('0xb')]=_0x381019[_0x9f04('0x56')];queues[_0x381019[_0x9f04('0x56')]]['queuecallerenterreason']=0x2;queues[_0x381019['transfertargetuniqueid']][_0x9f04('0x57')]=queues[_0x381019[_0x9f04('0x4e')]][_0x9f04('0x57')];queues[_0x381019[_0x9f04('0x56')]][_0x9f04('0x58')]=queues[_0x381019[_0x9f04('0x4e')]][_0x9f04('0x58')];queues[_0x381019[_0x9f04('0x56')]][_0x9f04('0x5e')]=utils[_0x9f04('0x12')]();queues[_0x381019['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0x9f04('0x12')]();queues[_0x381019[_0x9f04('0x56')]][_0x9f04('0x32')]=0x0;queues[_0x381019[_0x9f04('0x56')]][_0x9f04('0x5f')]=0x0;utils[_0x9f04('0x10')](util[_0x9f04('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x381019[_0x9f04('0x4d')],queues[_0x381019[_0x9f04('0x56')]][_0x9f04('0x1e')],queues[_0x381019[_0x9f04('0x56')]][_0x9f04('0xb')],queues[_0x381019['transfertargetuniqueid']]['calleridnum'],queues[_0x381019[_0x9f04('0x56')]][_0x9f04('0x58')]));}else{utils[_0x9f04('0x10')](util[_0x9f04('0x1')](_0x9f04('0x59'),_0x381019[_0x9f04('0x4d')],queues[_0x381019['secondtransfererlinkedid']][_0x9f04('0x1e')],_0x381019[_0x9f04('0x4e')]));queues[_0x381019[_0x9f04('0x50')]][_0x9f04('0xb')]=_0x381019[_0x9f04('0x4e')];}}}}catch(_0x3f5871){utils['error'](util['format'](_0x9f04('0x4c'),_0x381019[_0x9f04('0x4d')]),_0x3f5871);}};exports['musiconholdstart']=function(_0x1cb94d){try{if(!_[_0x9f04('0x21')](queues[_0x1cb94d[_0x9f04('0xc')]])){utils[_0x9f04('0xe')](util[_0x9f04('0x1')]('[%s][queues][musiconholdstart]',_0x1cb94d['uniqueid']),_0x1cb94d);queues[_0x1cb94d['uniqueid']][_0x9f04('0x60')]=utils[_0x9f04('0x12')]();utils['info'](util[_0x9f04('0x1')](_0x9f04('0x61'),_0x1cb94d[_0x9f04('0xc')],queues[_0x1cb94d[_0x9f04('0xc')]][_0x9f04('0x1e')],queues[_0x1cb94d['uniqueid']][_0x9f04('0x60')]));}}catch(_0x837005){utils['error'](util['format'](_0x9f04('0x62'),_0x1cb94d[_0x9f04('0xc')]),_0x837005);}};exports['musiconholdstop']=function(_0x8b5aed){try{if(!_['isNil'](queues[_0x8b5aed[_0x9f04('0xc')]])){if(!_['isNil'](queues[_0x8b5aed['uniqueid']][_0x9f04('0x60')])){utils[_0x9f04('0xe')](util[_0x9f04('0x1')](_0x9f04('0x63'),_0x8b5aed['uniqueid']),_0x8b5aed);queues[_0x8b5aed['uniqueid']][_0x9f04('0x5f')]+=utils[_0x9f04('0x33')](utils[_0x9f04('0x12')](),queues[_0x8b5aed[_0x9f04('0xc')]][_0x9f04('0x60')]);utils['info'](util[_0x9f04('0x1')](_0x9f04('0x64'),_0x8b5aed[_0x9f04('0xc')],queues[_0x8b5aed[_0x9f04('0xc')]][_0x9f04('0x1e')],queues[_0x8b5aed[_0x9f04('0xc')]][_0x9f04('0x5f')]));delete queues[_0x8b5aed[_0x9f04('0xc')]]['musiconholdstartAt'];}}}catch(_0x575053){utils[_0x9f04('0x13')](util[_0x9f04('0x1')]('[%s][queues][musiconholdstop]',_0x8b5aed[_0x9f04('0xc')]),_0x575053);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 3227302..75858b5 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 _0x277f=['accountcode','membername','CreateVoiceRecording','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','[%s][recordings][newchannel]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','channel','[%s][recordings][newstate]','varset','variable','value','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','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]\x20queue:%s','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid'];(function(_0x458d65,_0x1ddb20){var _0x50e750=function(_0xb80554){while(--_0xb80554){_0x458d65['push'](_0x458d65['shift']());}};_0x50e750(++_0x1ddb20);}(_0x277f,0xc6));var _0xf277=function(_0x31ac9f,_0x526097){_0x31ac9f=_0x31ac9f-0x0;var _0x1e2a7c=_0x277f[_0x31ac9f];return _0x1e2a7c;};'use strict';var _=require(_0xf277('0x0'));var util=require('util');var utils=require(_0xf277('0x1'));var transfers=require(_0xf277('0x2'));var recordings={};function writeDB(_0x2868cf){var _0x479347;utils[_0xf277('0x3')](util[_0xf277('0x4')](_0xf277('0x5'),_0x2868cf[_0xf277('0x6')]));if(transfers[_0xf277('0x7')][_0x2868cf[_0xf277('0x6')]]){_0x479347=_0x2868cf[_0xf277('0x6')];_0x2868cf[_0xf277('0x6')]=transfers[_0xf277('0x7')][_0x2868cf[_0xf277('0x6')]][_0xf277('0x8')];}if(_0x2868cf[_0xf277('0x9')]){utils['getUserByInternal'](_0x2868cf['accountcode'])['then'](function(_0x1b095e){if(_0x1b095e){_0x2868cf[_0xf277('0xa')]=_0x1b095e['name'];_0x2868cf['UserId']=_0x1b095e['id'];}utils['request'](_0xf277('0xb'),_0x2868cf);});}else{utils['request'](_0xf277('0xb'),_0x2868cf);}if(_0x479347)delete transfers['blinds'][_0x479347];}exports[_0xf277('0xc')]=function(_0x198687){try{utils[_0xf277('0xd')](util[_0xf277('0x4')]('[%s][recordings][newchannel]',_0x198687['uniqueid']),_0x198687);if(_0x198687['uniqueid']==_0x198687[_0xf277('0xe')]){utils[_0xf277('0x3')](util['format'](_0xf277('0xf'),_0x198687[_0xf277('0x6')],_0x198687[_0xf277('0x10')],_0x198687[_0xf277('0x11')]));recordings[_0x198687[_0xf277('0x6')]]={'uniqueid':_0x198687['uniqueid'],'accountcode':_0x198687[_0xf277('0x9')],'exten':_0x198687[_0xf277('0x11')],'context':_0x198687[_0xf277('0x10')],'channel':_0x198687['channel'],'monitors':[]};}}catch(_0x4792f6){utils[_0xf277('0x12')](util[_0xf277('0x4')](_0xf277('0x13'),_0x198687[_0xf277('0x6')]),_0x4792f6);}};exports['newstate']=function(_0x45815a){try{utils[_0xf277('0xd')](util['format']('[%s][recordings][newstate]',_0x45815a[_0xf277('0x6')]),_0x45815a);if(!_[_0xf277('0x14')](recordings[_0x45815a[_0xf277('0x6')]])&&_0x45815a[_0xf277('0x15')]==0x6){utils[_0xf277('0x3')](util[_0xf277('0x4')](_0xf277('0x16'),_0x45815a[_0xf277('0x6')],_0x45815a['context'],_0x45815a['channel']));}else if(!_[_0xf277('0x14')](recordings[_0x45815a[_0xf277('0xe')]])&&_0x45815a[_0xf277('0x15')]==0x6&&_0x45815a['context']!=_0xf277('0x17')){utils[_0xf277('0x3')](util['format'](_0xf277('0x18'),_0x45815a[_0xf277('0x6')],_0x45815a['linkedid'],_0x45815a['context'],_0x45815a[_0xf277('0x19')]));recordings[_0x45815a[_0xf277('0xe')]][_0xf277('0x9')]=_0x45815a[_0xf277('0x9')];}}catch(_0x60b5aa){utils[_0xf277('0x12')](util[_0xf277('0x4')](_0xf277('0x1a'),_0x45815a['uniqueid']),_0x60b5aa);}};exports[_0xf277('0x1b')]=function(_0x2bb1fc){try{if(!_[_0xf277('0x14')](_0x2bb1fc[_0xf277('0x1c')])&&!_[_0xf277('0x14')](_0x2bb1fc[_0xf277('0x1c')]['mixmonitor_filename'])){utils[_0xf277('0xd')](util[_0xf277('0x4')]('[%s][recordings][varset]',_0x2bb1fc['uniqueid']),_0x2bb1fc);utils[_0xf277('0x3')](util[_0xf277('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x2bb1fc[_0xf277('0x6')],_0x2bb1fc[_0xf277('0x1c')],_0x2bb1fc[_0xf277('0x1d')]));if(_['endsWith'](_0x2bb1fc[_0xf277('0x1d')],_0xf277('0x1e'))){_0x2bb1fc['value']=_0x2bb1fc[_0xf277('0x1d')][_0xf277('0x1f')](_0xf277('0x1e'),_0xf277('0x20'));}if(recordings[_0x2bb1fc[_0xf277('0xe')]]){var _0x3f184f=_[_0xf277('0x21')](recordings[_0x2bb1fc['linkedid']]['monitors'],{'value':_0x2bb1fc[_0xf277('0x1d')]});if(_[_0xf277('0x14')](_0x3f184f)){recordings[_0x2bb1fc[_0xf277('0xe')]][_0xf277('0x22')][_0xf277('0x23')]({'value':_0x2bb1fc[_0xf277('0x1d')]});}}}}catch(_0xdb5d0){utils[_0xf277('0x12')](util[_0xf277('0x4')]('[%s][recordings][varset]',_0x2bb1fc[_0xf277('0x6')]),_0xdb5d0);}};exports[_0xf277('0x24')]=function(_0x176ef2){try{if(!_[_0xf277('0x14')](recordings[_0x176ef2[_0xf277('0x6')]])){utils['debug'](util[_0xf277('0x4')](_0xf277('0x25'),_0x176ef2[_0xf277('0x6')]),_0x176ef2);utils[_0xf277('0x3')](util[_0xf277('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x176ef2[_0xf277('0x6')],_0x176ef2['calleridnum'],_0x176ef2[_0xf277('0x26')],_0x176ef2[_0xf277('0x27')]));recordings[_0x176ef2[_0xf277('0x6')]][_0xf277('0x28')]=_0x176ef2[_0xf277('0x28')];recordings[_0x176ef2[_0xf277('0x6')]]['calleridname']=_0x176ef2[_0xf277('0x26')];recordings[_0x176ef2[_0xf277('0x6')]][_0xf277('0x29')]=_0x176ef2['connectedlinenum'];recordings[_0x176ef2[_0xf277('0x6')]][_0xf277('0x2a')]=_0x176ef2[_0xf277('0x2a')];if(recordings[_0x176ef2[_0xf277('0x6')]][_0xf277('0x2b')]==_0xf277('0x2c')&&recordings[_0x176ef2['uniqueid']][_0xf277('0x9')]){recordings[_0x176ef2[_0xf277('0x6')]][_0xf277('0x29')]=recordings[_0x176ef2[_0xf277('0x6')]][_0xf277('0x9')];recordings[_0x176ef2[_0xf277('0x6')]][_0xf277('0x2a')]='';}recordings[_0x176ef2[_0xf277('0x6')]][_0xf277('0x22')][_0xf277('0x2d')](function(_0x5a781a){var _0x2e1258=_[_0xf277('0x2e')](recordings[_0x176ef2[_0xf277('0x6')]]);_0x2e1258[_0xf277('0x1d')]=_0x5a781a['value'];writeDB(_0x2e1258);});delete recordings[_0x176ef2[_0xf277('0x6')]];}}catch(_0x2c68b8){utils[_0xf277('0x12')](util[_0xf277('0x4')]('[%s][recordings][hangup]',_0x176ef2[_0xf277('0x6')]),_0x2c68b8);}};exports[_0xf277('0x2f')]=function(_0x52b7fe){try{if(!_[_0xf277('0x14')](recordings[_0x52b7fe[_0xf277('0x6')]])){utils[_0xf277('0xd')](util[_0xf277('0x4')](_0xf277('0x30'),_0x52b7fe['uniqueid']),_0x52b7fe);utils[_0xf277('0x3')](util[_0xf277('0x4')](_0xf277('0x31'),_0x52b7fe['uniqueid'],_0x52b7fe[_0xf277('0x32')],_0x52b7fe[_0xf277('0x33')]));if(_0x52b7fe['application'][_0xf277('0x34')]()==_0xf277('0x35')&&_[_0xf277('0x36')](_0x52b7fe['appdata'][_0xf277('0x34')](),_0xf277('0x37'))){var _0x1fc0b0=_0x52b7fe[_0xf277('0x33')][_0xf277('0x38')]('=');var _0x59bff6=_0x1fc0b0[0x0][_0xf277('0x39')](_0x1fc0b0[0x0][_0xf277('0x3a')]('(')+0x1,_0x1fc0b0[0x0][_0xf277('0x3a')](')'));var _0x44e5e9=_0x1fc0b0[0x1];recordings[_0x52b7fe[_0xf277('0x6')]][_0x59bff6]=_0x44e5e9;}}}catch(_0x5551ee){utils['error'](util[_0xf277('0x4')](_0xf277('0x30'),_0x52b7fe[_0xf277('0x6')]),_0x5551ee);}};exports[_0xf277('0x3b')]=function(_0x11302d){try{if(!_[_0xf277('0x14')](recordings[_0x11302d[_0xf277('0x6')]])){utils['debug'](util[_0xf277('0x4')]('[%s][recordings][queuecallerjoin]',_0x11302d[_0xf277('0x6')]),_0x11302d);utils[_0xf277('0x3')](util[_0xf277('0x4')](_0xf277('0x3c'),_0x11302d[_0xf277('0x6')],_0x11302d[_0xf277('0x3d')]));recordings[_0x11302d[_0xf277('0x6')]][_0xf277('0x3d')]=_0x11302d[_0xf277('0x3d')];}}catch(_0x35eda6){utils[_0xf277('0x12')](util[_0xf277('0x4')]('[%s][recordings][queuecallerjoin]',_0x11302d[_0xf277('0x6')]),_0x35eda6);}};exports['blindtransfer']=function(_0x181740){try{utils[_0xf277('0xd')](util[_0xf277('0x4')](_0xf277('0x3e'),_0x181740[_0xf277('0x6')]),_0x181740);utils[_0xf277('0x3')](util[_0xf277('0x4')](_0xf277('0x3f'),_0x181740[_0xf277('0x6')],_0x181740[_0xf277('0x40')],_0x181740[_0xf277('0x41')],_0x181740[_0xf277('0x42')],_0x181740[_0xf277('0x43')]));if(recordings[_0x181740['transfereruniqueid']]&&transfers[_0xf277('0x7')][_0x181740[_0xf277('0x44')]]){transfers['blinds'][_0x181740['transfereruniqueid']]['recording']=!![];}}catch(_0x59ed46){utils[_0xf277('0x12')](util[_0xf277('0x4')]('[%s][recordings][blindtransfer]',_0x181740[_0xf277('0x6')]),_0x59ed46);}}; \ No newline at end of file +var _0x92bf=['transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','variable','value','.wav49','replace','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','cdr','substring','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','UserId','CreateVoiceRecording','request','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','context','exten','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel'];(function(_0x524bb0,_0x326327){var _0x2fb947=function(_0x56302b){while(--_0x56302b){_0x524bb0['push'](_0x524bb0['shift']());}};_0x2fb947(++_0x326327);}(_0x92bf,0xbb));var _0xf92b=function(_0x173ad1,_0x56c4ac){_0x173ad1=_0x173ad1-0x0;var _0x26e30b=_0x92bf[_0x173ad1];return _0x26e30b;};'use strict';var _=require('lodash');var util=require(_0xf92b('0x0'));var utils=require(_0xf92b('0x1'));var transfers=require(_0xf92b('0x2'));var recordings={};function writeDB(_0x5d22e2){var _0x456c6c;utils[_0xf92b('0x3')](util['format'](_0xf92b('0x4'),_0x5d22e2[_0xf92b('0x5')]));if(transfers[_0xf92b('0x6')][_0x5d22e2[_0xf92b('0x5')]]){_0x456c6c=_0x5d22e2[_0xf92b('0x5')];_0x5d22e2[_0xf92b('0x5')]=transfers['blinds'][_0x5d22e2['uniqueid']][_0xf92b('0x7')];}if(_0x5d22e2[_0xf92b('0x8')]){utils[_0xf92b('0x9')](_0x5d22e2[_0xf92b('0x8')])[_0xf92b('0xa')](function(_0x2966d9){if(_0x2966d9){_0x5d22e2[_0xf92b('0xb')]=_0x2966d9['name'];_0x5d22e2[_0xf92b('0xc')]=_0x2966d9['id'];}utils['request'](_0xf92b('0xd'),_0x5d22e2);});}else{utils[_0xf92b('0xe')](_0xf92b('0xd'),_0x5d22e2);}if(_0x456c6c)delete transfers[_0xf92b('0x6')][_0x456c6c];}exports[_0xf92b('0xf')]=function(_0x172dab){try{utils[_0xf92b('0x10')](util[_0xf92b('0x11')](_0xf92b('0x12'),_0x172dab[_0xf92b('0x5')]),_0x172dab);if(_0x172dab[_0xf92b('0x5')]==_0x172dab[_0xf92b('0x13')]){utils[_0xf92b('0x3')](util[_0xf92b('0x11')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x172dab[_0xf92b('0x5')],_0x172dab[_0xf92b('0x14')],_0x172dab[_0xf92b('0x15')]));recordings[_0x172dab['uniqueid']]={'uniqueid':_0x172dab[_0xf92b('0x5')],'accountcode':_0x172dab[_0xf92b('0x8')],'exten':_0x172dab[_0xf92b('0x15')],'context':_0x172dab[_0xf92b('0x14')],'channel':_0x172dab['channel'],'monitors':[]};}}catch(_0x322407){utils[_0xf92b('0x16')](util[_0xf92b('0x11')]('[%s][recordings][newchannel]',_0x172dab[_0xf92b('0x5')]),_0x322407);}};exports[_0xf92b('0x17')]=function(_0xabd133){try{utils[_0xf92b('0x10')](util['format'](_0xf92b('0x18'),_0xabd133[_0xf92b('0x5')]),_0xabd133);if(!_[_0xf92b('0x19')](recordings[_0xabd133[_0xf92b('0x5')]])&&_0xabd133[_0xf92b('0x1a')]==0x6){utils['info'](util[_0xf92b('0x11')](_0xf92b('0x1b'),_0xabd133[_0xf92b('0x5')],_0xabd133[_0xf92b('0x14')],_0xabd133[_0xf92b('0x1c')]));}else if(!_[_0xf92b('0x19')](recordings[_0xabd133[_0xf92b('0x13')]])&&_0xabd133[_0xf92b('0x1a')]==0x6&&_0xabd133['context']!=_0xf92b('0x1d')){utils[_0xf92b('0x3')](util[_0xf92b('0x11')](_0xf92b('0x1e'),_0xabd133[_0xf92b('0x5')],_0xabd133[_0xf92b('0x13')],_0xabd133[_0xf92b('0x14')],_0xabd133[_0xf92b('0x1c')]));recordings[_0xabd133[_0xf92b('0x13')]][_0xf92b('0x8')]=_0xabd133[_0xf92b('0x8')];}}catch(_0x102d8e){utils[_0xf92b('0x16')](util['format'](_0xf92b('0x18'),_0xabd133[_0xf92b('0x5')]),_0x102d8e);}};exports['varset']=function(_0x23b7f1){try{if(!_[_0xf92b('0x19')](_0x23b7f1['variable'])&&!_['isNil'](_0x23b7f1['variable'][_0xf92b('0x1f')])){utils['debug'](util['format'](_0xf92b('0x20'),_0x23b7f1[_0xf92b('0x5')]),_0x23b7f1);utils['info'](util['format'](_0xf92b('0x21'),_0x23b7f1[_0xf92b('0x5')],_0x23b7f1[_0xf92b('0x22')],_0x23b7f1[_0xf92b('0x23')]));if(_['endsWith'](_0x23b7f1[_0xf92b('0x23')],_0xf92b('0x24'))){_0x23b7f1[_0xf92b('0x23')]=_0x23b7f1[_0xf92b('0x23')][_0xf92b('0x25')](_0xf92b('0x24'),'.WAV');}if(recordings[_0x23b7f1[_0xf92b('0x13')]]){var _0x88b8a3=_[_0xf92b('0x26')](recordings[_0x23b7f1[_0xf92b('0x13')]][_0xf92b('0x27')],{'value':_0x23b7f1['value']});if(_[_0xf92b('0x19')](_0x88b8a3)){recordings[_0x23b7f1[_0xf92b('0x13')]][_0xf92b('0x27')][_0xf92b('0x28')]({'value':_0x23b7f1['value']});}}}}catch(_0x5a41fc){utils[_0xf92b('0x16')](util[_0xf92b('0x11')](_0xf92b('0x20'),_0x23b7f1[_0xf92b('0x5')]),_0x5a41fc);}};exports[_0xf92b('0x29')]=function(_0x369cb6){try{if(!_[_0xf92b('0x19')](recordings[_0x369cb6[_0xf92b('0x5')]])){utils[_0xf92b('0x10')](util[_0xf92b('0x11')](_0xf92b('0x2a'),_0x369cb6[_0xf92b('0x5')]),_0x369cb6);utils[_0xf92b('0x3')](util['format'](_0xf92b('0x2b'),_0x369cb6[_0xf92b('0x5')],_0x369cb6[_0xf92b('0x2c')],_0x369cb6[_0xf92b('0x2d')],_0x369cb6[_0xf92b('0x2e')]));recordings[_0x369cb6['uniqueid']][_0xf92b('0x2c')]=_0x369cb6[_0xf92b('0x2c')];recordings[_0x369cb6[_0xf92b('0x5')]][_0xf92b('0x2d')]=_0x369cb6[_0xf92b('0x2d')];recordings[_0x369cb6[_0xf92b('0x5')]]['connectedlinenum']=_0x369cb6[_0xf92b('0x2f')];recordings[_0x369cb6['uniqueid']][_0xf92b('0x30')]=_0x369cb6[_0xf92b('0x30')];if(recordings[_0x369cb6[_0xf92b('0x5')]][_0xf92b('0x31')]==_0xf92b('0x32')&&recordings[_0x369cb6[_0xf92b('0x5')]]['accountcode']){recordings[_0x369cb6[_0xf92b('0x5')]]['connectedlinenum']=recordings[_0x369cb6['uniqueid']]['accountcode'];recordings[_0x369cb6[_0xf92b('0x5')]][_0xf92b('0x30')]='';}recordings[_0x369cb6[_0xf92b('0x5')]]['monitors'][_0xf92b('0x33')](function(_0x37dd08){var _0x347379=_[_0xf92b('0x34')](recordings[_0x369cb6['uniqueid']]);_0x347379[_0xf92b('0x23')]=_0x37dd08[_0xf92b('0x23')];writeDB(_0x347379);});delete recordings[_0x369cb6[_0xf92b('0x5')]];}}catch(_0x72ce2d){utils[_0xf92b('0x16')](util[_0xf92b('0x11')](_0xf92b('0x2a'),_0x369cb6['uniqueid']),_0x72ce2d);}};exports['newexten']=function(_0x53251f){try{if(!_[_0xf92b('0x19')](recordings[_0x53251f[_0xf92b('0x5')]])){utils[_0xf92b('0x10')](util[_0xf92b('0x11')](_0xf92b('0x35'),_0x53251f[_0xf92b('0x5')]),_0x53251f);utils['info'](util[_0xf92b('0x11')](_0xf92b('0x36'),_0x53251f[_0xf92b('0x5')],_0x53251f[_0xf92b('0x37')],_0x53251f[_0xf92b('0x38')]));if(_0x53251f[_0xf92b('0x37')]['toLowerCase']()==_0xf92b('0x39')&&_['startsWith'](_0x53251f[_0xf92b('0x38')][_0xf92b('0x3a')](),_0xf92b('0x3b'))){var _0xc40f40=_0x53251f[_0xf92b('0x38')]['split']('=');var _0xedc31a=_0xc40f40[0x0][_0xf92b('0x3c')](_0xc40f40[0x0]['lastIndexOf']('(')+0x1,_0xc40f40[0x0]['lastIndexOf'](')'));var _0x26fad2=_0xc40f40[0x1];recordings[_0x53251f[_0xf92b('0x5')]][_0xedc31a]=_0x26fad2;}}}catch(_0x1c484f){utils['error'](util['format']('[%s][recordings][newexten]',_0x53251f[_0xf92b('0x5')]),_0x1c484f);}};exports['queuecallerjoin']=function(_0x45a522){try{if(!_[_0xf92b('0x19')](recordings[_0x45a522[_0xf92b('0x5')]])){utils[_0xf92b('0x10')](util[_0xf92b('0x11')](_0xf92b('0x3d'),_0x45a522[_0xf92b('0x5')]),_0x45a522);utils['info'](util[_0xf92b('0x11')](_0xf92b('0x3e'),_0x45a522[_0xf92b('0x5')],_0x45a522[_0xf92b('0x3f')]));recordings[_0x45a522['uniqueid']][_0xf92b('0x3f')]=_0x45a522[_0xf92b('0x3f')];}}catch(_0x3975cc){utils[_0xf92b('0x16')](util['format'](_0xf92b('0x3d'),_0x45a522[_0xf92b('0x5')]),_0x3975cc);}};exports[_0xf92b('0x40')]=function(_0x164b94){try{utils[_0xf92b('0x10')](util[_0xf92b('0x11')](_0xf92b('0x41'),_0x164b94['uniqueid']),_0x164b94);utils[_0xf92b('0x3')](util[_0xf92b('0x11')](_0xf92b('0x42'),_0x164b94[_0xf92b('0x5')],_0x164b94[_0xf92b('0x43')],_0x164b94[_0xf92b('0x44')],_0x164b94['transfereecalleridnum'],_0x164b94[_0xf92b('0x45')]));if(recordings[_0x164b94['transfereruniqueid']]&&transfers[_0xf92b('0x6')][_0x164b94[_0xf92b('0x46')]]){transfers['blinds'][_0x164b94[_0xf92b('0x46')]][_0xf92b('0x47')]=!![];}}catch(_0x3260ce){utils[_0xf92b('0x16')](util[_0xf92b('0x11')](_0xf92b('0x41'),_0x164b94[_0xf92b('0x5')]),_0x3260ce);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index caf418a..0c0df12 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 _0xe66b=['transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','type','attended','origtransfereruniqueid','uniqueid','request','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign'];(function(_0x2b6235,_0xadfbcf){var _0x4cee7f=function(_0x358fff){while(--_0x358fff){_0x2b6235['push'](_0x2b6235['shift']());}};_0x4cee7f(++_0xadfbcf);}(_0xe66b,0x1e6));var _0xbe66=function(_0x4747dc,_0x54f4cb){_0x4747dc=_0x4747dc-0x0;var _0x308d9d=_0xe66b[_0x4747dc];return _0x308d9d;};'use strict';var _=require(_0xbe66('0x0'));var util=require(_0xbe66('0x1'));var utils=require(_0xbe66('0x2'));function writeDB(_0x5db942){utils[_0xbe66('0x3')](util[_0xbe66('0x4')]('[%s][transfers][writeDB]\x20type:%s',_0x5db942[_0xbe66('0x5')]===_0xbe66('0x6')?_0x5db942[_0xbe66('0x7')]:_0x5db942[_0xbe66('0x8')],_0x5db942[_0xbe66('0x5')]));utils[_0xbe66('0x9')]('CreateVoiceTransferReport',_0x5db942);}exports['blinds']={};exports['blindtransfer']=function(_0x30f477){try{utils[_0xbe66('0xa')](util['format'](_0xbe66('0xb'),_0x30f477[_0xbe66('0x8')]),_0x30f477);utils[_0xbe66('0x3')](util[_0xbe66('0x4')](_0xbe66('0xc'),_0x30f477['uniqueid'],_0x30f477[_0xbe66('0xd')],_0x30f477['transferercalleridname'],_0x30f477[_0xbe66('0xe')],_0x30f477[_0xbe66('0xf')]));_0x30f477[_0xbe66('0x5')]='blind';exports[_0xbe66('0x10')][_0x30f477[_0xbe66('0x11')]]=_0x30f477;writeDB(_0x30f477);}catch(_0x2c562f){utils[_0xbe66('0x12')](util[_0xbe66('0x4')]('[%s][transfers][blindtransfer]',_0x30f477[_0xbe66('0x8')]),_0x2c562f);}};exports[_0xbe66('0x13')]=function(_0x4b92ee){try{utils['debug'](util[_0xbe66('0x4')](_0xbe66('0x14'),_0x4b92ee[_0xbe66('0x7')]),_0x4b92ee);utils[_0xbe66('0x3')](util[_0xbe66('0x4')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4b92ee['origtransfereruniqueid'],_0x4b92ee['origtransferercalleridnum'],_0x4b92ee[_0xbe66('0x15')],_0x4b92ee[_0xbe66('0x16')],_0x4b92ee[_0xbe66('0x17')]));_0x4b92ee=_['assign'](_0x4b92ee,{'transfererchannel':_0x4b92ee[_0xbe66('0x18')],'transferercalleridnum':_0x4b92ee[_0xbe66('0x19')],'transferercalleridname':_0x4b92ee[_0xbe66('0x15')],'transfererconnectedlinenum':_0x4b92ee['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x4b92ee[_0xbe66('0x1a')],'transfereraccountcode':_0x4b92ee[_0xbe66('0x1b')],'transferercontext':_0x4b92ee['secondtransferercontext'],'transfererexten':_0x4b92ee['secondtransfererexten'],'transfererlinkedid':_0x4b92ee[_0xbe66('0x1c')],'context':_0x4b92ee[_0xbe66('0x1d')],'extension':_0x4b92ee[_0xbe66('0x1e')],'type':_0xbe66('0x6')});if(_[_0xbe66('0x1f')](_0x4b92ee[_0xbe66('0x20')])){_0x4b92ee=_[_0xbe66('0x21')](_0x4b92ee,{'transfereechannel':_0x4b92ee[_0xbe66('0x22')],'transfereecalleridnum':_0x4b92ee['transfertargetcalleridnum'],'transfereecalleridname':_0x4b92ee[_0xbe66('0x17')],'transfereeconnectedlinenum':_0x4b92ee['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4b92ee[_0xbe66('0x23')],'transfereeaccountcode':_0x4b92ee[_0xbe66('0x24')],'transfereecontext':_0x4b92ee[_0xbe66('0x25')],'transfereeexten':_0x4b92ee[_0xbe66('0x26')],'transfereelinkedid':_0x4b92ee[_0xbe66('0x27')]});}writeDB(_0x4b92ee);}catch(_0x52f0bd){utils[_0xbe66('0x12')](util['format'](_0xbe66('0x14'),_0x4b92ee[_0xbe66('0x7')]),_0x52f0bd);}}; \ No newline at end of file +var _0xdfc4=['origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','request','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','error','attendedtransfer','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','assign'];(function(_0x4e3bca,_0x30c989){var _0x54437e=function(_0x526ac8){while(--_0x526ac8){_0x4e3bca['push'](_0x4e3bca['shift']());}};_0x54437e(++_0x30c989);}(_0xdfc4,0x18b));var _0x4dfc=function(_0x30e977,_0x5edc12){_0x30e977=_0x30e977-0x0;var _0x536cb5=_0xdfc4[_0x30e977];return _0x536cb5;};'use strict';var _=require(_0x4dfc('0x0'));var util=require('util');var utils=require(_0x4dfc('0x1'));function writeDB(_0x3f226b){utils[_0x4dfc('0x2')](util[_0x4dfc('0x3')](_0x4dfc('0x4'),_0x3f226b[_0x4dfc('0x5')]==='attended'?_0x3f226b['origtransfereruniqueid']:_0x3f226b['uniqueid'],_0x3f226b[_0x4dfc('0x5')]));utils[_0x4dfc('0x6')](_0x4dfc('0x7'),_0x3f226b);}exports['blinds']={};exports['blindtransfer']=function(_0x42cdf9){try{utils[_0x4dfc('0x8')](util[_0x4dfc('0x3')](_0x4dfc('0x9'),_0x42cdf9[_0x4dfc('0xa')]),_0x42cdf9);utils[_0x4dfc('0x2')](util[_0x4dfc('0x3')](_0x4dfc('0xb'),_0x42cdf9[_0x4dfc('0xa')],_0x42cdf9[_0x4dfc('0xc')],_0x42cdf9[_0x4dfc('0xd')],_0x42cdf9[_0x4dfc('0xe')],_0x42cdf9[_0x4dfc('0xf')]));_0x42cdf9[_0x4dfc('0x5')]=_0x4dfc('0x10');exports[_0x4dfc('0x11')][_0x42cdf9['transfereruniqueid']]=_0x42cdf9;writeDB(_0x42cdf9);}catch(_0x5ecf7b){utils[_0x4dfc('0x12')](util['format'](_0x4dfc('0x9'),_0x42cdf9['uniqueid']),_0x5ecf7b);}};exports[_0x4dfc('0x13')]=function(_0x59b51d){try{utils[_0x4dfc('0x8')](util[_0x4dfc('0x3')]('[%s][transfers][attendedtransfer]',_0x59b51d[_0x4dfc('0x14')]),_0x59b51d);utils[_0x4dfc('0x2')](util[_0x4dfc('0x3')](_0x4dfc('0x15'),_0x59b51d[_0x4dfc('0x14')],_0x59b51d['origtransferercalleridnum'],_0x59b51d[_0x4dfc('0x16')],_0x59b51d[_0x4dfc('0x17')],_0x59b51d['transfertargetcalleridname']));_0x59b51d=_[_0x4dfc('0x18')](_0x59b51d,{'transfererchannel':_0x59b51d[_0x4dfc('0x19')],'transferercalleridnum':_0x59b51d[_0x4dfc('0x1a')],'transferercalleridname':_0x59b51d[_0x4dfc('0x16')],'transfererconnectedlinenum':_0x59b51d[_0x4dfc('0x1b')],'transfererconnectedlinename':_0x59b51d[_0x4dfc('0x1c')],'transfereraccountcode':_0x59b51d[_0x4dfc('0x1d')],'transferercontext':_0x59b51d['secondtransferercontext'],'transfererexten':_0x59b51d['secondtransfererexten'],'transfererlinkedid':_0x59b51d[_0x4dfc('0x1e')],'context':_0x59b51d[_0x4dfc('0x1f')],'extension':_0x59b51d[_0x4dfc('0x20')],'type':_0x4dfc('0x21')});if(_[_0x4dfc('0x22')](_0x59b51d[_0x4dfc('0x23')])){_0x59b51d=_[_0x4dfc('0x18')](_0x59b51d,{'transfereechannel':_0x59b51d['transfertargetchannel'],'transfereecalleridnum':_0x59b51d[_0x4dfc('0x17')],'transfereecalleridname':_0x59b51d[_0x4dfc('0x24')],'transfereeconnectedlinenum':_0x59b51d[_0x4dfc('0x25')],'transfereeconnectedlinename':_0x59b51d[_0x4dfc('0x26')],'transfereeaccountcode':_0x59b51d['transfertargetaccountcode'],'transfereecontext':_0x59b51d[_0x4dfc('0x27')],'transfereeexten':_0x59b51d['transfertargetexten'],'transfereelinkedid':_0x59b51d[_0x4dfc('0x28')]});}writeDB(_0x59b51d);}catch(_0x1f45e6){utils[_0x4dfc('0x12')](util[_0x4dfc('0x3')](_0x4dfc('0x29'),_0x59b51d['origtransfereruniqueid']),_0x1f45e6);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 98d0cfb..5f07977 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 _0x34d2=['internal','name','interface','[utils][getUser]\x20where:%s','stringify','length','getUserByInternal','then','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','result','[utils][getVoiceQueueByName]','addTime','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','format','diffTime','diff','sumTime','isAfter','isBefore','jayson/promise','http','xdr','info','debug','inspect','error','request','catch','GetUser'];(function(_0x5f415d,_0x39b258){var _0x3ac7a6=function(_0x314dc5){while(--_0x314dc5){_0x5f415d['push'](_0x5f415d['shift']());}};_0x3ac7a6(++_0x39b258);}(_0x34d2,0x12a));var _0x234d=function(_0x1e0e31,_0x212cd6){_0x1e0e31=_0x1e0e31-0x0;var _0x495be0=_0x34d2[_0x1e0e31];return _0x495be0;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x234d('0x0'));var moment=require('moment');var util=require('util');var client=jayson['client'][_0x234d('0x1')]({'port':0x2329});var logger=require('../../config/logger')(_0x234d('0x2'));exports[_0x234d('0x3')]=function(_0x5530d7,_0x4ba374){logger[_0x234d('0x3')](_0x5530d7,_0x4ba374?util['inspect'](_0x4ba374,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x31aa2c,_0x318ff0){logger[_0x234d('0x4')](_0x31aa2c,_0x318ff0?util[_0x234d('0x5')](_0x318ff0,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x8d0cf2,_0x25e350){logger[_0x234d('0x6')](_0x8d0cf2,_0x25e350?util[_0x234d('0x5')](_0x25e350,{'showHidden':![],'depth':null}):'');};exports[_0x234d('0x7')]=function(_0x3a2a60,_0x3179d1){return client['request'](_0x3a2a60,{'body':_0x3179d1})['then'](function(_0x4b1615){logger[_0x234d('0x4')]('[utils][request]\x20name:%s',_0x3a2a60,_0x4b1615?util[_0x234d('0x5')](_0x4b1615,{'showHidden':![],'depth':null}):'');})[_0x234d('0x8')](function(_0x2c48bb){logger[_0x234d('0x6')]('[utils][request]\x20name:%s',_0x3a2a60,_0x2c48bb?util[_0x234d('0x5')](_0x2c48bb,{'showHidden':![],'depth':null}):'');});};function getUser(_0xca341a){return client['request'](_0x234d('0x9'),{'options':{'raw':!![],'attributes':['id',_0x234d('0xa'),_0x234d('0xb'),_0x234d('0xc')],'where':_0xca341a,'limit':0x1}})['then'](function(_0x560711){logger[_0x234d('0x4')](_0x234d('0xd'),JSON[_0x234d('0xe')](_0xca341a),_0x560711?util[_0x234d('0x5')](_0x560711,{'showHidden':![],'depth':null}):'');return _0x560711['result'][_0x234d('0xf')]?_0x560711['result'][0x0]:null;});}exports[_0x234d('0x10')]=function(_0x2ae590){return new BPromise(function(_0x25e2a2,_0x507967){if(_0x2ae590){return getUser({'internal':_0x2ae590})[_0x234d('0x11')](function(_0x239441){logger[_0x234d('0x3')](_0x234d('0x12'),_0x2ae590,_0x239441?_0x234d('0x13'):_0x234d('0x14'));return _0x25e2a2(_0x239441);})[_0x234d('0x8')](function(_0x316e71){logger[_0x234d('0x6')](_0x234d('0x15'),_0x316e71?util['inspect'](_0x316e71,{'showHidden':![],'depth':null}):'');return _0x25e2a2(null);});}return _0x25e2a2(null);});};exports[_0x234d('0x16')]=function(_0x4a34cd){return new BPromise(function(_0x55b76c,_0x16c748){if(_0x4a34cd){return getUser({'interface':_0x4a34cd})['then'](function(_0x2d59e5){logger['info'](_0x234d('0x17'),_0x4a34cd,_0x2d59e5?_0x234d('0x13'):_0x234d('0x14'));return _0x55b76c(_0x2d59e5);})[_0x234d('0x8')](function(_0x5916db){logger[_0x234d('0x6')](_0x234d('0x18'),_0x5916db?util[_0x234d('0x5')](_0x5916db,{'showHidden':![],'depth':null}):'');return _0x55b76c(null);});}return _0x55b76c(null);});};exports[_0x234d('0x19')]=function(_0x44380a){return new BPromise(function(_0x410323,_0x2dfbe8){if(_0x44380a){return getUser({'name':_0x44380a})[_0x234d('0x11')](function(_0x4d0115){logger[_0x234d('0x3')](_0x234d('0x1a'),_0x44380a,_0x4d0115?_0x234d('0x13'):_0x234d('0x14'));return _0x410323(_0x4d0115);})['catch'](function(_0x4ffb61){logger[_0x234d('0x6')](_0x234d('0x1b'),_0x4ffb61?util[_0x234d('0x5')](_0x4ffb61,{'showHidden':![],'depth':null}):'');return _0x410323(null);});}return _0x410323(null);});};exports['getVoiceQueueByName']=function(_0x56c388){return new BPromise(function(_0x54b8ac,_0x4f029e){if(_0x56c388){return client[_0x234d('0x7')](_0x234d('0x1c'),{'options':{'raw':!![],'attributes':['id',_0x234d('0xb'),_0x234d('0x1d'),_0x234d('0x1e'),'acwTimeout'],'where':{'name':_0x56c388},'limit':0x1}})[_0x234d('0x11')](function(_0x29467c){logger[_0x234d('0x4')](_0x234d('0x1f'),_0x56c388,_0x29467c?util[_0x234d('0x5')](_0x29467c,{'showHidden':![],'depth':null}):'');logger[_0x234d('0x3')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x56c388,_0x29467c?_0x234d('0x13'):_0x234d('0x14'));return _0x54b8ac(_0x29467c[_0x234d('0x20')][_0x234d('0xf')]?_0x29467c[_0x234d('0x20')][0x0]:null);})['catch'](function(_0x135ce9){logger[_0x234d('0x6')](_0x234d('0x21'),_0x135ce9?util[_0x234d('0x5')](_0x135ce9,{'showHidden':![],'depth':null}):'');return _0x54b8ac(null);});}return _0x54b8ac(null);});};exports[_0x234d('0x22')]=function(_0x554fde,_0x489076){return moment(_0x554fde)['add'](_0x489076,_0x234d('0x23'))['format'](_0x234d('0x24'));};exports[_0x234d('0x25')]=function(_0x1dba4f,_0x21aed3){return moment(_0x1dba4f)['subtract'](_0x21aed3,_0x234d('0x23'))[_0x234d('0x26')](_0x234d('0x24'));};exports[_0x234d('0x27')]=function(_0x1af41a,_0x947a4e){return moment(_0x1af41a)[_0x234d('0x28')](moment(_0x947a4e),_0x234d('0x23'));};exports[_0x234d('0x29')]=function(_0x43d16e,_0x48c1e7){return parseInt(_0x43d16e,0xa)+parseInt(_0x48c1e7,0xa);};exports['now']=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x234d('0x2a')]=function(_0x2ddba8,_0x471477){if(_0x471477){return moment(_0x2ddba8)['isAfter'](_0x471477);}return!![];};exports[_0x234d('0x2b')]=function(_0x335266,_0x2c4b1b){if(_0x2c4b1b){return moment(_0x335266)[_0x234d('0x2b')](_0x2c4b1b);}else if(_0x335266){return!![];}return![];}; \ No newline at end of file +var _0x3bf0=['[utils][request]\x20name:%s','catch','GetUser','internal','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','name','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','sumTime','now','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','info','inspect','error','request','then','debug'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x3bf0,0x83));var _0x03bf=function(_0x1d1d40,_0xedf59d){_0x1d1d40=_0x1d1d40-0x0;var _0x3db8d9=_0x3bf0[_0x1d1d40];return _0x3db8d9;};'use strict';var BPromise=require(_0x03bf('0x0'));var jayson=require(_0x03bf('0x1'));var moment=require(_0x03bf('0x2'));var util=require(_0x03bf('0x3'));var client=jayson[_0x03bf('0x4')][_0x03bf('0x5')]({'port':0x2329});var logger=require(_0x03bf('0x6'))('xdr');exports[_0x03bf('0x7')]=function(_0x412688,_0x3398b8){logger[_0x03bf('0x7')](_0x412688,_0x3398b8?util[_0x03bf('0x8')](_0x3398b8,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x2c37c7,_0xf513cf){logger['debug'](_0x2c37c7,_0xf513cf?util[_0x03bf('0x8')](_0xf513cf,{'showHidden':![],'depth':null}):'');};exports[_0x03bf('0x9')]=function(_0x151297,_0x4c43a1){logger[_0x03bf('0x9')](_0x151297,_0x4c43a1?util[_0x03bf('0x8')](_0x4c43a1,{'showHidden':![],'depth':null}):'');};exports[_0x03bf('0xa')]=function(_0x3baf28,_0x374024){return client[_0x03bf('0xa')](_0x3baf28,{'body':_0x374024})[_0x03bf('0xb')](function(_0x33152f){logger[_0x03bf('0xc')](_0x03bf('0xd'),_0x3baf28,_0x33152f?util[_0x03bf('0x8')](_0x33152f,{'showHidden':![],'depth':null}):'');})[_0x03bf('0xe')](function(_0xfde47c){logger[_0x03bf('0x9')](_0x03bf('0xd'),_0x3baf28,_0xfde47c?util[_0x03bf('0x8')](_0xfde47c,{'showHidden':![],'depth':null}):'');});};function getUser(_0x34af14){return client[_0x03bf('0xa')](_0x03bf('0xf'),{'options':{'raw':!![],'attributes':['id',_0x03bf('0x10'),'name','interface'],'where':_0x34af14,'limit':0x1}})[_0x03bf('0xb')](function(_0x7f2750){logger['debug'](_0x03bf('0x11'),JSON[_0x03bf('0x12')](_0x34af14),_0x7f2750?util[_0x03bf('0x8')](_0x7f2750,{'showHidden':![],'depth':null}):'');return _0x7f2750[_0x03bf('0x13')][_0x03bf('0x14')]?_0x7f2750[_0x03bf('0x13')][0x0]:null;});}exports[_0x03bf('0x15')]=function(_0x316f4b){return new BPromise(function(_0x573dc4,_0x37e8fe){if(_0x316f4b){return getUser({'internal':_0x316f4b})[_0x03bf('0xb')](function(_0x3f7e65){logger[_0x03bf('0x7')](_0x03bf('0x16'),_0x316f4b,_0x3f7e65?_0x03bf('0x17'):_0x03bf('0x18'));return _0x573dc4(_0x3f7e65);})[_0x03bf('0xe')](function(_0x30a7fd){logger[_0x03bf('0x9')](_0x03bf('0x19'),_0x30a7fd?util[_0x03bf('0x8')](_0x30a7fd,{'showHidden':![],'depth':null}):'');return _0x573dc4(null);});}return _0x573dc4(null);});};exports[_0x03bf('0x1a')]=function(_0x22e0e2){return new BPromise(function(_0x51fc81,_0x24d1f){if(_0x22e0e2){return getUser({'interface':_0x22e0e2})[_0x03bf('0xb')](function(_0x5686fb){logger[_0x03bf('0x7')](_0x03bf('0x1b'),_0x22e0e2,_0x5686fb?_0x03bf('0x17'):_0x03bf('0x18'));return _0x51fc81(_0x5686fb);})[_0x03bf('0xe')](function(_0x57c873){logger['error'](_0x03bf('0x1c'),_0x57c873?util[_0x03bf('0x8')](_0x57c873,{'showHidden':![],'depth':null}):'');return _0x51fc81(null);});}return _0x51fc81(null);});};exports[_0x03bf('0x1d')]=function(_0x250850){return new BPromise(function(_0x16c0ab,_0x59378f){if(_0x250850){return getUser({'name':_0x250850})[_0x03bf('0xb')](function(_0x50d1a7){logger[_0x03bf('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x250850,_0x50d1a7?_0x03bf('0x17'):_0x03bf('0x18'));return _0x16c0ab(_0x50d1a7);})['catch'](function(_0x1ba789){logger[_0x03bf('0x9')](_0x03bf('0x1e'),_0x1ba789?util['inspect'](_0x1ba789,{'showHidden':![],'depth':null}):'');return _0x16c0ab(null);});}return _0x16c0ab(null);});};exports[_0x03bf('0x1f')]=function(_0x45a5df){return new BPromise(function(_0x12e554,_0x20e9ba){if(_0x45a5df){return client[_0x03bf('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x03bf('0x20'),'type',_0x03bf('0x21'),_0x03bf('0x22')],'where':{'name':_0x45a5df},'limit':0x1}})[_0x03bf('0xb')](function(_0x1f7595){logger[_0x03bf('0xc')](_0x03bf('0x23'),_0x45a5df,_0x1f7595?util[_0x03bf('0x8')](_0x1f7595,{'showHidden':![],'depth':null}):'');logger[_0x03bf('0x7')](_0x03bf('0x24'),_0x45a5df,_0x1f7595?'found':_0x03bf('0x18'));return _0x12e554(_0x1f7595[_0x03bf('0x13')][_0x03bf('0x14')]?_0x1f7595['result'][0x0]:null);})[_0x03bf('0xe')](function(_0x352ac4){logger['error'](_0x03bf('0x25'),_0x352ac4?util[_0x03bf('0x8')](_0x352ac4,{'showHidden':![],'depth':null}):'');return _0x12e554(null);});}return _0x12e554(null);});};exports['addTime']=function(_0x4a9466,_0x2b0db7){return moment(_0x4a9466)[_0x03bf('0x26')](_0x2b0db7,_0x03bf('0x27'))[_0x03bf('0x28')](_0x03bf('0x29'));};exports['subtractTime']=function(_0x3beb7a,_0x1b0eed){return moment(_0x3beb7a)[_0x03bf('0x2a')](_0x1b0eed,'seconds')[_0x03bf('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x03bf('0x2b')]=function(_0x3a7603,_0x5b4e42){return moment(_0x3a7603)[_0x03bf('0x2c')](moment(_0x5b4e42),_0x03bf('0x27'));};exports[_0x03bf('0x2d')]=function(_0x53e729,_0x31f05f){return parseInt(_0x53e729,0xa)+parseInt(_0x31f05f,0xa);};exports[_0x03bf('0x2e')]=function(){return moment()[_0x03bf('0x28')](_0x03bf('0x29'));};exports['isAfter']=function(_0xd498f3,_0x5be22f){if(_0x5be22f){return moment(_0xd498f3)['isAfter'](_0x5be22f);}return!![];};exports[_0x03bf('0x2f')]=function(_0x2f6e61,_0x329ab7){if(_0x329ab7){return moment(_0x2f6e61)[_0x03bf('0x2f')](_0x329ab7);}else if(_0x2f6e61){return!![];}return![];}; \ No newline at end of file